diff --git a/.changeset/bright-crabs-live.md b/.changeset/bright-crabs-live.md deleted file mode 100644 index 7e21431ee24..00000000000 --- a/.changeset/bright-crabs-live.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -"chainlink": minor ---- - -Remove ocr2vrf - -#removed all ocr2vrf and dkg OCR2 plugin materials. \ No newline at end of file diff --git a/.changeset/cuddly-toys-warn.md b/.changeset/cuddly-toys-warn.md deleted file mode 100644 index 8e15ba65014..00000000000 --- a/.changeset/cuddly-toys-warn.md +++ /dev/null @@ -1,14 +0,0 @@ ---- -"chainlink": patch ---- - -Add "VerboseLogging" option to mercury - -Off by default, can be enabled like so: - -```toml -[Mercury] -VerboseLogging = true -``` - -#updated diff --git a/.changeset/curly-zebras-agree.md b/.changeset/curly-zebras-agree.md deleted file mode 100644 index a57b379d2a3..00000000000 --- a/.changeset/curly-zebras-agree.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"chainlink": patch ---- - -#added support for EIP-1559 transactions for Scroll diff --git a/.changeset/few-pillows-yawn.md b/.changeset/few-pillows-yawn.md new file mode 100644 index 00000000000..ada48200d53 --- /dev/null +++ b/.changeset/few-pillows-yawn.md @@ -0,0 +1,5 @@ +--- +"chainlink": minor +--- + +#added Add RMNRemote in the chain reader definition diff --git a/.changeset/fifty-pillows-peel.md b/.changeset/fifty-pillows-peel.md new file mode 100644 index 00000000000..711a8869aa4 --- /dev/null +++ b/.changeset/fifty-pillows-peel.md @@ -0,0 +1,5 @@ +--- +"chainlink": patch +--- + +Added `EVM.HeadTracker.PersistenceEnabled` config option to disable persistence for HeadTracker. #added diff --git a/.changeset/fluffy-ghosts-sneeze.md b/.changeset/fluffy-ghosts-sneeze.md deleted file mode 100644 index 48503995c23..00000000000 --- a/.changeset/fluffy-ghosts-sneeze.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"chainlink": patch ---- - -Dequeue minimum guaranteed upkeeps as a priority #changed diff --git a/.changeset/fresh-falcons-cheer.md b/.changeset/fresh-falcons-cheer.md new file mode 100644 index 00000000000..505582cc4fd --- /dev/null +++ b/.changeset/fresh-falcons-cheer.md @@ -0,0 +1,5 @@ +--- +"chainlink": minor +--- + +#added solana: compute unit limit configuration and transaction instruction diff --git a/.changeset/gold-candles-flow.md b/.changeset/gold-candles-flow.md deleted file mode 100644 index 277a96469ef..00000000000 --- a/.changeset/gold-candles-flow.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"chainlink": patch ---- - -#internal Bumped dependencies for `chainlink-common`, `chainlink-solana`, and `chainlink-starknet`. diff --git a/.changeset/good-paws-switch.md b/.changeset/good-paws-switch.md deleted file mode 100644 index 76758a2c86e..00000000000 --- a/.changeset/good-paws-switch.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"chainlink": patch ---- - -#internal add `NewChainWriter` method onto the dummy relayer. diff --git a/.changeset/healthy-lamps-argue.md b/.changeset/healthy-lamps-argue.md deleted file mode 100644 index 33357ddd6ce..00000000000 --- a/.changeset/healthy-lamps-argue.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"chainlink": minor ---- - -Initialize registry syncer' contract reader lazily #keystone #internal diff --git a/.changeset/hungry-pandas-suffer.md b/.changeset/hungry-pandas-suffer.md deleted file mode 100644 index f8f151a7ce5..00000000000 --- a/.changeset/hungry-pandas-suffer.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"chainlink": patch ---- - -Make send signatures configurable when Transmit in Contract Transmitter #internal diff --git a/.changeset/neat-rockets-love.md b/.changeset/neat-rockets-love.md deleted file mode 100644 index 29fdcebe6e5..00000000000 --- a/.changeset/neat-rockets-love.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"chainlink": minor ---- - -#internal Added small check to allow for nil TxMeta in CW SubmitTransaction diff --git a/.changeset/nervous-books-push.md b/.changeset/nervous-books-push.md new file mode 100644 index 00000000000..b0f797344e3 --- /dev/null +++ b/.changeset/nervous-books-push.md @@ -0,0 +1,5 @@ +--- +"chainlink": minor +--- + +#internal Updated QueryKey to be able to do advanced queries on contract event data words diff --git a/.changeset/ninety-feet-change.md b/.changeset/ninety-feet-change.md new file mode 100644 index 00000000000..2c4cea72106 --- /dev/null +++ b/.changeset/ninety-feet-change.md @@ -0,0 +1,5 @@ +--- +"chainlink": patch +--- + +#updated default config values for FinalityTagEnabled to match CCIP configs diff --git a/.changeset/proud-zoos-sort.md b/.changeset/proud-zoos-sort.md deleted file mode 100644 index 571beae821d..00000000000 --- a/.changeset/proud-zoos-sort.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"chainlink": patch ---- - -VRFV2Plus coordinator and wrapper split contracts between L1 and L2 chains #updated diff --git a/.changeset/red-meals-mix.md b/.changeset/red-meals-mix.md deleted file mode 100644 index a3667ed20e0..00000000000 --- a/.changeset/red-meals-mix.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"chainlink": minor ---- - -Bump to start the next version diff --git a/.changeset/silent-cups-flow.md b/.changeset/silent-cups-flow.md deleted file mode 100644 index 564e02223fa..00000000000 --- a/.changeset/silent-cups-flow.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"chainlink": minor ---- - -#internal refactor goose migrations to use provider diff --git a/.changeset/six-frogs-juggle.md b/.changeset/six-frogs-juggle.md new file mode 100644 index 00000000000..2b960c4be0f --- /dev/null +++ b/.changeset/six-frogs-juggle.md @@ -0,0 +1,5 @@ +--- +"chainlink": minor +--- + +#added HTTP target capability and gateway connector handler diff --git a/.changeset/tidy-apricots-care.md b/.changeset/tidy-apricots-care.md new file mode 100644 index 00000000000..60429107f11 --- /dev/null +++ b/.changeset/tidy-apricots-care.md @@ -0,0 +1,5 @@ +--- +"chainlink": minor +--- + +#added Pass the home chain selector to the commit plugin factory diff --git a/.changeset/tough-boats-shop.md b/.changeset/tough-boats-shop.md new file mode 100644 index 00000000000..45a16fc965a --- /dev/null +++ b/.changeset/tough-boats-shop.md @@ -0,0 +1,5 @@ +--- +"chainlink": minor +--- + +start of next release diff --git a/.changeset/tricky-seas-invite.md b/.changeset/tricky-seas-invite.md deleted file mode 100644 index f109a2d8f93..00000000000 --- a/.changeset/tricky-seas-invite.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"chainlink": patch ---- - -Fix TestHeadTracker_CallsHeadTrackableCallbacks flaky test #internal diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index c7eb22991b5..a0818dfc197 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -11,8 +11,9 @@ # Services /core/services/directrequest @smartcontractkit/keepers -/core/services/feeds @smartcontractkit/FMS +/core/services/feeds @smartcontractkit/op-core @eutopian @yevshev /core/services/synchronization/telem @smartcontractkit/realtime +/core/capabilities/ccip @smartcontractkit/ccip-offchain # To be deprecated in Chainlink V3 /core/services/fluxmonitorv2 @smartcontractkit/foundations @@ -23,9 +24,9 @@ /core/services/pg @smartcontractkit/foundations @samsondav /core/services/pipeline @smartcontractkit/foundations @smartcontractkit/bix-framework /core/services/telemetry @smartcontractkit/realtime -/core/services/relay/evm/mercury @smartcontractkit/mercury-team +/core/services/relay/evm/mercury @smartcontractkit/data-streams-engineers /core/services/webhook @smartcontractkit/foundations @smartcontractkit/bix-framework -/core/services/llo @smartcontractkit/mercury-team +/core/services/llo @smartcontractkit/data-streams-engineers # VRF-related services /core/services/vrf @smartcontractkit/vrf-team @@ -51,7 +52,7 @@ core/scripts/functions @smartcontractkit/functions core/scripts/gateway @smartcontractkit/functions # Contracts -/contracts/ @RensR +/contracts/ @RensR @matYang @RayXpub @elatoskinas # First we match on project names to catch files like the compilation scripts, # gas snapshots and other files not places in the project directories. @@ -62,20 +63,19 @@ core/scripts/gateway @smartcontractkit/functions /contracts/**/*upkeep* @smartcontractkit/keepers /contracts/**/*automation* @smartcontractkit/keepers /contracts/**/*functions* @smartcontractkit/functions -/contracts/**/*llo-feeds* @smartcontrackit/mercury-team +/contracts/**/*llo-feeds* @smartcontractkit/data-streams-engineers /contracts/**/*vrf* @smartcontractkit/vrf-team /contracts/**/*l2ep* @smartcontractkit/bix-ship -# TODO: replace with a team tag when ready -/contracts/**/*keystone* @archseer @bolekk @patrick-dowell +/contracts/**/*keystone* @smartcontractkit/keystone /contracts/src/v0.8/automation @smartcontractkit/keepers /contracts/src/v0.8/functions @smartcontractkit/functions # TODO: interfaces folder, folder should be removed and files moved to the correct folders /contracts/src/v0.8/l2ep @chris-de-leon-cll -/contracts/src/v0.8/llo-feeds @smartcontractkit/mercury-team +/contracts/src/v0.8/llo-feeds @smartcontractkit/data-streams-engineers # TODO: mocks folder, folder should be removed and files moved to the correct folders -/contracts/src/v0.8/operatorforwarder @austinborn -/contracts/src/v0.8/shared @RensR +/contracts/src/v0.8/operatorforwarder @smartcontractkit/data-feeds-engineers +/contracts/src/v0.8/shared @RensR @matYang @RayXpub @elatoskinas # TODO: tests folder, folder should be removed and files moved to the correct folders # TODO: transmission folder, owner should be found /contracts/src/v0.8/vrf @smartcontractkit/vrf-team @@ -90,9 +90,16 @@ core/scripts/gateway @smartcontractkit/functions # Tests /integration-tests/ @smartcontractkit/test-tooling-team +/integration-tests/ccip-tests @smartcontractkit/ccip-offchain /integration-tests/**/*keeper* @smartcontractkit/keepers /integration-tests/**/*automation* @smartcontractkit/keepers +# Deployment tooling +# Initially the common structures owned by CCIP +/integration-tests/deployment @smartcontractkit/ccip +/integration-tests/deployment/ccip @smartcontractkit/ccip +# TODO: As more products add their deployment logic here, add the team as an owner + # CI/CD /.github/** @smartcontractkit/releng @smartcontractkit/test-tooling-team /.github/workflows/performance-tests.yml @smartcontractkit/test-tooling-team diff --git a/.github/E2E_TESTS_ON_GITHUB_CI.md b/.github/E2E_TESTS_ON_GITHUB_CI.md new file mode 100644 index 00000000000..02144eff64f --- /dev/null +++ b/.github/E2E_TESTS_ON_GITHUB_CI.md @@ -0,0 +1,58 @@ +# E2E Tests on GitHub CI + +E2E tests are executed on GitHub CI using the [E2E Tests Reusable Workflow](#about-the-reusable-workflow) or dedicated workflows. + +## Automatic workflows + +These workflows are designed to run automatically at crucial stages of the software development process, such as on every commit in a PR, nightly or before release. + +### PR E2E Tests + +Run on every commit in a PR to ensure changes do not introduce regressions. + +[Link](https://github.com/smartcontractkit/chainlink/blob/develop/.github/workflows/integration-tests.yml) + +### Nightly E2E Tests + +Conducted nightly to catch issues that may develop over time or with accumulated changes. + +[Link](https://github.com/smartcontractkit/chainlink/blob/develop/.github/workflows/run-nightly-e2e-tests.yml) + +### Release E2E Tests + +This section contains automatic workflows triggering E2E tests at release. + +#### Client Compatibility Tests + +[Link](https://github.com/smartcontractkit/chainlink/actions/workflows/client-compatibility-tests.yml) + +## On-Demand Workflows + +Triggered manually by QA for specific testing needs. + +**Examples:** + +- [On-Demand Automation Tests](https://github.com/smartcontractkit/chainlink/actions/workflows/automation-ondemand-tests.yml) +- [CCIP Chaos Tests](https://github.com/smartcontractkit/chainlink/actions/workflows/ccip-chaos-tests.yml) +- [OCR Soak Tests](https://github.com/smartcontractkit/chainlink/actions/workflows/on-demand-ocr-soak-test.yml) +- [VRFv2Plus Smoke Tests](https://github.com/smartcontractkit/chainlink/actions/workflows/on-demand-vrfv2plus-smoke-tests.yml) + +## Test Configs + +E2E tests utilize TOML files to define their parameters. Each test is equipped with a default TOML config, which can be overridden by specifying an alternative TOML config. This allows for running tests with varied parameters, such as on a non-default blockchain network. For tests executed on GitHub CI, both the default configs and any override configs must reside within the git repository. The `test_config_override_path` workflow input is used to provide a path to an override config. + +Config overrides should be stored in `testconfig/*/overrides/*.toml`. Placing files here will not trigger a rebuild of the test runner image. + +**Important Note:** The use of `base64Config` input is deprecated in favor of `test_config_override_path`. For more details, refer to [the decision log](https://smartcontract-it.atlassian.net/wiki/spaces/TT/pages/927596563/Storing+All+Test+Configs+In+Git). + +To learn more about test configs see [CTF Test Config](https://github.com/smartcontractkit/chainlink-testing-framework/blob/main/lib/config/README.md). + +## Test Secrets + +For security reasons, test secrets and sensitive information are not stored directly within the test config TOML files. Instead, these secrets are securely injected into tests using environment variables. For a detailed explanation on managing test secrets, refer to our [Test Secrets documentation](https://github.com/smartcontractkit/chainlink-testing-framework/blob/main/lib/config/README.md#test-secrets). + +If you need to run a GitHub workflow using custom secrets, please refer to the [guide on running GitHub workflows with your test secrets](https://github.com/smartcontractkit/chainlink-testing-framework/blob/main/lib/config/README.md#run-github-workflow-with-your-test-secrets). + +## About the E2E Test Reusable Workflow + +For information on the E2E Test Reusable Workflow, visit the documentation in the [smartcontractkit/.github repository](https://github.com/smartcontractkit/.github/blob/main/.github/workflows/README.md). diff --git a/.github/actions/build-chainlink-image/action.yml b/.github/actions/build-chainlink-image/action.yml index 9cd90432e9e..0e457560bf0 100644 --- a/.github/actions/build-chainlink-image/action.yml +++ b/.github/actions/build-chainlink-image/action.yml @@ -37,7 +37,7 @@ runs: AWS_ROLE_TO_ASSUME: ${{ inputs.AWS_ROLE_TO_ASSUME }} - name: Build Image if: steps.check-image.outputs.exists != 'true' - uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/build-image@75a9005952a9e905649cfb5a6971fd9429436acd # v2.3.25 + uses: smartcontractkit/.github/actions/ctf-build-image@1a26fe378d7ebdc34ab1fe31ec4a6d1c376199f8 # ctf-build-image@0.0.0 with: cl_repo: smartcontractkit/chainlink cl_ref: ${{ inputs.git_commit_sha }} @@ -51,4 +51,4 @@ runs: shell: sh run: | echo "### Chainlink node image tag used for this test run :link:" >>$GITHUB_STEP_SUMMARY - echo "\`${GITHUB_SHA}\`" >>$GITHUB_STEP_SUMMARY + echo "\`${{inputs.git_commit_sha}}\`" >>$GITHUB_STEP_SUMMARY diff --git a/.github/actions/build-sign-publish-chainlink/action.yml b/.github/actions/build-sign-publish-chainlink/action.yml index b5bb725098d..b0e70b742d5 100644 --- a/.github/actions/build-sign-publish-chainlink/action.yml +++ b/.github/actions/build-sign-publish-chainlink/action.yml @@ -51,24 +51,19 @@ inputs: description: When set to the string boolean value of "true", the resulting build image will be signed default: "false" required: false - cosign-private-key: - description: The private key to be used with cosign to sign the image - required: false - cosign-public-key: - description: The public key to be used with cosign for verification - required: false - cosign-password: - description: The password to decrypt the cosign private key needed to sign the image - required: false - sign-method: - description: Build image will be signed using keypair or keyless methods - default: "keypair" - required: true verify-signature: description: When set to the string boolean value of "true", the resulting build image signature will be verified default: "false" required: false +outputs: + docker-image-tag: + description: The docker image tag that was built and pushed + value: ${{ steps.save-non-root-image-name-env.outputs.image-tag }} + docker-image-digest: + description: The docker image digest that was built and pushed + value: ${{ steps.save-non-root-image-name-env.outputs.image-digest }} + runs: using: composite steps: @@ -77,6 +72,8 @@ runs: # See https://docs.github.com/en/actions/learn-github-actions/workflow-commands-for-github-actions#multiline-strings run: | SHARED_IMAGES=${{ inputs.ecr-hostname }}/${{ inputs.ecr-image-name }} + OIDC_ISSUER=https://token.actions.githubusercontent.com + OIDC_IDENTITY=https://github.com/smartcontractkit/chainlink/.github/workflows/build-publish.yml@${{ github.ref }} SHARED_TAG_LIST=$(cat << EOF type=ref,event=branch,suffix=${{ inputs.ecr-tag-suffix }} @@ -94,6 +91,9 @@ runs: echo "$SHARED_IMAGES" >> $GITHUB_ENV echo "EOF" >> $GITHUB_ENV + echo "oidc-issuer=${OIDC_ISSUER}" >> $GITHUB_ENV + echo "oidc-identity=${OIDC_IDENTITY}" >> $GITHUB_ENV + echo "shared-tag-list<> $GITHUB_ENV echo "$SHARED_TAG_LIST" >> $GITHUB_ENV echo "EOF" >> $GITHUB_ENV @@ -164,7 +164,9 @@ runs: run: | IMAGES_NAME_RAW=${{ fromJSON(steps.buildpush-root.outputs.metadata)['image.name'] }} IMAGE_NAME=$(echo "$IMAGES_NAME_RAW" | cut -d"," -f1) + IMAGE_DIGEST=${{ fromJSON(steps.buildpush-root.outputs.metadata)['containerimage.digest'] }} echo "root_image_name=${IMAGE_NAME}" >> $GITHUB_ENV + echo "root_image_digest=${IMAGE_DIGEST}" >> $GITHUB_ENV - name: Generate docker metadata for non-root image id: meta-nonroot @@ -208,10 +210,14 @@ runs: IMAGES_NAME_RAW=${{ fromJSON(steps.buildpush-nonroot.outputs.metadata)['image.name'] }} IMAGE_DIGEST=${{ fromJSON(steps.buildpush-nonroot.outputs.metadata)['containerimage.digest'] }} IMAGE_NAME=$(echo "$IMAGES_NAME_RAW" | cut -d"," -f1) + IMAGE_TAG=$(echo "$IMAGES_NAME_RAW" | cut -d":" -f2) echo "nonroot_image_name=${IMAGE_NAME}" >> $GITHUB_ENV + echo "nonroot_image_digest=${IMAGE_DIGEST}" >> $GITHUB_ENV echo '### Docker Image' >> $GITHUB_STEP_SUMMARY echo "Image Name: ${IMAGE_NAME}" >> $GITHUB_STEP_SUMMARY echo "Image Digest: ${IMAGE_DIGEST}" >> $GITHUB_STEP_SUMMARY + echo "image-tag=${IMAGE_TAG}" >> $GITHUB_OUTPUT + echo "image-digest=${IMAGE_DIGEST}" >> $GITHUB_OUTPUT - name: Check if non-root image runs as root id: check-nonroot-runs-root @@ -229,74 +235,36 @@ runs: - if: inputs.sign-images == 'true' name: Install cosign - uses: sigstore/cosign-installer@e1523de7571e31dbe865fd2e80c5c7c23ae71eb4 # v3.4.0 + uses: sigstore/cosign-installer@4959ce089c160fddf62f7b42464195ba1a56d382 # v3.6.0 with: - cosign-release: "v1.6.0" + cosign-release: "v2.4.0" - - if: inputs.sign-images == 'true' && inputs.sign-method == 'keypair' - name: Sign the published root Docker image using keypair method - shell: sh - env: - COSIGN_PASSWORD: "${{ inputs.cosign-password }}" - run: | - echo "${{ inputs.cosign-private-key }}" > cosign.key - cosign sign --key cosign.key "${{ env.root_image_name }}" - rm -f cosign.key - - - if: inputs.verify-signature == 'true' && inputs.sign-method == 'keypair' - name: Verify the signature of the published root Docker image using keypair - shell: sh - run: | - echo "${{ inputs.cosign-public-key }}" > cosign.key - cosign verify --key cosign.key "${{ env.root_image_name }}" - rm -f cosign.key - - - if: inputs.sign-images == 'true' && inputs.sign-method == 'keyless' + # This automatically signs the image with the correct OIDC provider from Github + - if: inputs.sign-images == 'true' name: Sign the published root Docker image using keyless method shell: sh - env: - COSIGN_EXPERIMENTAL: 1 run: | - cosign sign "${{ env.root_image_name }}" + cosign sign "${{ env.root_image_name }}" --yes - - if: inputs.verify-signature == 'true' && inputs.sign-method == 'keyless' + - if: inputs.verify-signature == 'true' name: Verify the signature of the published root Docker image using keyless shell: sh - env: - COSIGN_EXPERIMENTAL: 1 - run: | - cosign verify "${{ env.root_image_name }}" - - - if: inputs.sign-images == 'true' && inputs.sign-method == 'keypair' - name: Sign the published non-root Docker image using keypair method - shell: sh - env: - COSIGN_PASSWORD: "${{ inputs.cosign-password }}" - run: | - echo "${{ inputs.cosign-private-key }}" > cosign.key - cosign sign --key cosign.key "${{ env.nonroot_image_name }}" - rm -f cosign.key - - - if: inputs.verify-signature == 'true' && inputs.sign-method == 'keypair' - name: Verify the signature of the published non-root Docker image using keypair - shell: sh run: | - echo "${{ inputs.cosign-public-key }}" > cosign.key - cosign verify --key cosign.key "${{ env.nonroot_image_name }}" - rm -f cosign.key + cosign verify "${{ env.root_image_name }}" \ + --certificate-oidc-issuer ${{ env.oidc-issuer }} \ + --certificate-identity "${{ env.oidc-identity }}" - - if: inputs.sign-images == 'true' && inputs.sign-method == 'keyless' + # This automatically signs the image with the correct OIDC provider from Github + - if: inputs.sign-images == 'true' name: Sign the published non-root Docker image using keyless method shell: sh - env: - COSIGN_EXPERIMENTAL: 1 run: | - cosign sign "${{ env.nonroot_image_name }}" + cosign sign "${{ env.nonroot_image_name }}" --yes - - if: inputs.verify-signature == 'true' && inputs.sign-method == 'keyless' + - if: inputs.verify-signature == 'true' name: Verify the signature of the published non-root Docker image using keyless shell: sh - env: - COSIGN_EXPERIMENTAL: 1 run: | - cosign verify "${{ env.nonroot_image_name }}" + cosign verify "${{ env.nonroot_image_name }}" \ + --certificate-oidc-issuer ${{ env.oidc-issuer }} \ + --certificate-identity "${{ env.oidc-identity }}" diff --git a/.github/actions/build-test-image/action.yml b/.github/actions/build-test-image/action.yml deleted file mode 100644 index dcc9fefda71..00000000000 --- a/.github/actions/build-test-image/action.yml +++ /dev/null @@ -1,123 +0,0 @@ -name: Build Test Image -description: A composite action that allows building and publishing the test remote runner image - -inputs: - repository: - description: The docker repository for the image - default: chainlink-tests - required: false - tag: - description: The tag to use by default and to use for checking image existance - default: ${{ github.sha }} - required: false - other_tags: - description: Other tags to push if needed - required: false - suites: - description: The test suites to build into the image - default: chaos migration reorg smoke soak benchmark load - required: false - QA_AWS_ROLE_TO_ASSUME: - description: The AWS role to assume as the CD user, if any. Used in configuring the docker/login-action - required: true - QA_AWS_REGION: - description: The AWS region the ECR repository is located in, should only be needed for public ECR repositories, used in configuring docker/login-action - required: true - QA_AWS_ACCOUNT_NUMBER: - description: The AWS region the ECR repository is located in, should only be needed for public ECR repositories, used in configuring docker/login-action - required: true - -runs: - using: composite - steps: - - # Base Test Image Logic - - name: Get CTF Version - id: version - uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/mod-version@fc3e0df622521019f50d772726d6bf8dc919dd38 # v2.3.19 - with: - go-project-path: ./integration-tests - module-name: github.com/smartcontractkit/chainlink-testing-framework - enforce-semantic-tag: false - - name: Get CTF sha - if: steps.version.outputs.is_semantic == 'false' - id: short_sha - env: - VERSION: ${{ steps.version.outputs.version }} - shell: bash - run: | - short_sha="${VERSION##*-}" - echo "short sha is: ${short_sha}" - echo "short_sha=${short_sha}" >> "$GITHUB_OUTPUT" - - name: Checkout chainlink-testing-framework - if: steps.version.outputs.is_semantic == 'false' - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 - with: - repository: smartcontractkit/chainlink-testing-framework - ref: main - fetch-depth: 0 - path: ctf - - name: Get long sha - if: steps.version.outputs.is_semantic == 'false' - id: long_sha - env: - SHORT_SHA: ${{ steps.short_sha.outputs.short_sha }} - shell: bash - run: | - cd ctf - long_sha=$(git rev-parse ${SHORT_SHA}) - echo "sha is: ${long_sha}" - echo "long_sha=${long_sha}" >> "$GITHUB_OUTPUT" - - name: Check if test base image exists - if: steps.version.outputs.is_semantic == 'false' - id: check-base-image - uses: smartcontractkit/chainlink-github-actions/docker/image-exists@75a9005952a9e905649cfb5a6971fd9429436acd # v2.3.25 - with: - repository: test-base-image - tag: ${{ steps.long_sha.outputs.long_sha }} - AWS_REGION: ${{ inputs.QA_AWS_REGION }} - AWS_ROLE_TO_ASSUME: ${{ inputs.QA_AWS_ROLE_TO_ASSUME }} - - name: Build Base Image - if: steps.version.outputs.is_semantic == 'false' && steps.check-base-image.outputs.exists == 'false' - uses: smartcontractkit/chainlink-github-actions/docker/build-push@75a9005952a9e905649cfb5a6971fd9429436acd # v2.3.25 - env: - BASE_IMAGE_NAME: ${{ inputs.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ inputs.QA_AWS_REGION }}.amazonaws.com/test-base-image:${{ steps.long_sha.outputs.long_sha }} - with: - tags: ${{ env.BASE_IMAGE_NAME }} - file: ctf/k8s/Dockerfile.base - AWS_REGION: ${{ inputs.QA_AWS_REGION }} - AWS_ROLE_TO_ASSUME: ${{ inputs.QA_AWS_ROLE_TO_ASSUME }} - # End Base Image Logic - - # Test Runner Logic - - name: Check if image exists - id: check-image - uses: smartcontractkit/chainlink-github-actions/docker/image-exists@75a9005952a9e905649cfb5a6971fd9429436acd # v2.3.25 - with: - repository: ${{ inputs.repository }} - tag: ${{ inputs.tag }} - AWS_REGION: ${{ inputs.QA_AWS_REGION }} - AWS_ROLE_TO_ASSUME: ${{ inputs.QA_AWS_ROLE_TO_ASSUME }} - - name: Build and Publish Test Runner - if: steps.check-image.outputs.exists == 'false' - uses: smartcontractkit/chainlink-github-actions/docker/build-push@75a9005952a9e905649cfb5a6971fd9429436acd # v2.3.25 - with: - tags: | - ${{ inputs.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ inputs.QA_AWS_REGION }}.amazonaws.com/${{ inputs.repository }}:${{ inputs.tag }} - ${{ inputs.other_tags }} - file: ./integration-tests/test.Dockerfile - build-args: | - BASE_IMAGE=${{ inputs.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ inputs.QA_AWS_REGION }}.amazonaws.com/test-base-image - IMAGE_VERSION=${{ steps.long_sha.outputs.long_sha || steps.version.outputs.version }} - SUITES="${{ inputs.suites }}" - AWS_REGION: ${{ inputs.QA_AWS_REGION }} - AWS_ROLE_TO_ASSUME: ${{ inputs.QA_AWS_ROLE_TO_ASSUME }} - - name: Print Image Built - shell: sh - env: - INPUTS_REPOSITORY: ${{ inputs.repository }} - INPUTS_TAG: ${{ inputs.tag }} - run: | - echo "### ${INPUTS_REPOSITORY} image tag for this test run :ship:" >>$GITHUB_STEP_SUMMARY - echo "\`${INPUTS_TAG}\`" >>$GITHUB_STEP_SUMMARY - # End Test Runner Logic diff --git a/.github/actions/detect-solidity-file-changes/action.yml b/.github/actions/detect-solidity-file-changes/action.yml index 37cb871d68d..b86c91dbb4d 100644 --- a/.github/actions/detect-solidity-file-changes/action.yml +++ b/.github/actions/detect-solidity-file-changes/action.yml @@ -1,5 +1,5 @@ -name: 'Detect Changes Composite Action' -description: 'Detects changes in solidity files and fails if read-only files are modified.' +name: 'Detect Solidity File Changes Composite Action' +description: 'Detects changes in solidity files and outputs the result.' outputs: changes: description: 'Whether or not changes were detected' @@ -19,18 +19,3 @@ runs: - '.github/workflows/solidity.yml' - '.github/workflows/solidity-foundry.yml' - '.github/workflows/solidity-wrappers.yml' - read_only_sol: - - 'contracts/src/v0.8/interfaces/**/*' - - 'contracts/src/v0.8/automation/v1_2/**/*' - - 'contracts/src/v0.8/automation/v1_3/**/*' - - 'contracts/src/v0.8/automation/v2_0/**/*' - - - name: Fail if read-only files have changed - if: ${{ steps.changed_files.outputs.read_only_sol == 'true' }} - shell: bash - run: | - echo "One or more read-only Solidity file(s) has changed." - for file in ${{ steps.changed_files.outputs.read_only_sol_files }}; do - echo "$file was changed" - done - exit 1 diff --git a/.github/actions/detect-solidity-foundry-version/action.yml b/.github/actions/detect-solidity-foundry-version/action.yml new file mode 100644 index 00000000000..b37f1e25094 --- /dev/null +++ b/.github/actions/detect-solidity-foundry-version/action.yml @@ -0,0 +1,26 @@ +name: 'Detect Foundry version in GNUmakefile' +description: 'Detects Foundry version in GNUmakefile' +inputs: + working-directory: + description: 'The GNUmakefile directory' + required: false + default: 'contracts' +outputs: + foundry-version: + description: 'Foundry version found in GNUmakefile' + value: ${{ steps.extract-foundry-version.outputs.foundry-version }} +runs: + using: 'composite' + steps: + - name: Extract Foundry version + id: extract-foundry-version + shell: bash + working-directory: ${{ inputs.working-directory }} + run: | + foundry_version=$(grep -Eo "foundryup --version [^ ]+" GNUmakefile | awk '{print $3}') + if [ -z "$foundry_version" ]; then + echo "::error::Foundry version not found in GNUmakefile" + exit 1 + fi + echo "Foundry version found: $foundry_version" + echo "foundry-version=$foundry_version" >> $GITHUB_OUTPUT diff --git a/.github/actions/detect-solidity-readonly-file-changes/action.yml b/.github/actions/detect-solidity-readonly-file-changes/action.yml new file mode 100644 index 00000000000..faca16d53f0 --- /dev/null +++ b/.github/actions/detect-solidity-readonly-file-changes/action.yml @@ -0,0 +1,31 @@ +name: 'Detect Solidity Readonly Files Changes Composite Action' +description: 'Detects changes in readonly solidity files and fails if they are modified.' +outputs: + changes: + description: 'Whether or not changes were detected' + value: ${{ steps.changed_files.outputs.src }} +runs: + using: 'composite' + steps: + + - name: Filter paths + uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2 + id: changed_files + with: + list-files: 'csv' + filters: | + read_only_sol: + - 'contracts/src/v0.8/interfaces/**/*' + - 'contracts/src/v0.8/automation/v1_2/**/*' + - 'contracts/src/v0.8/automation/v1_3/**/*' + - 'contracts/src/v0.8/automation/v2_0/**/*' + + - name: Fail if read-only files have changed + if: ${{ steps.changed_files.outputs.read_only_sol == 'true' }} + shell: bash + run: | + echo "One or more read-only Solidity file(s) has changed." + for file in ${{ steps.changed_files.outputs.read_only_sol_files }}; do + echo "$file was changed" + done + exit 1 diff --git a/.github/actions/golangci-lint/action.yml b/.github/actions/golangci-lint/action.yml index f3697ed7195..a90a764ef2f 100644 --- a/.github/actions/golangci-lint/action.yml +++ b/.github/actions/golangci-lint/action.yml @@ -36,6 +36,9 @@ runs: using: composite steps: - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 + with: + # We only need a full clone on merge_group events for golangci-lint. + fetch-depth: ${{ github.event_name == 'merge_group' && '0' || '1' }}" - name: Setup Go uses: ./.github/actions/setup-go with: @@ -50,17 +53,23 @@ runs: working-directory: ${{ inputs.go-directory }} shell: bash run: go build ./... + - name: Set golangci-lint working directory + shell: bash + id: set-working-directory + # XXX: Don't use `.` default working directory here due to issues with the golangci-lint-action. + run: | + if [ "${{ inputs.go-directory }}" == "." ]; then + echo "golangci-lint-working-directory=" | tee -a $GITHUB_OUTPUT + else + echo "golangci-lint-working-directory=${{ inputs.go-directory }}" | tee -a $GITHUB_OUTPUT + fi - name: golangci-lint - uses: golangci/golangci-lint-action@3cfe3a4abbb849e10058ce4af15d205b6da42804 # v4.0.0 + uses: golangci/golangci-lint-action@38e1018663fa5173f3968ea0777460d3de38f256 # v5.3.0 with: - version: v1.59.1 - # We already cache these directories in setup-go - skip-pkg-cache: true - skip-build-cache: true - # only-new-issues is only applicable to PRs, otherwise it is always set to false - only-new-issues: false # disabled for PRs due to unreliability + version: v1.60.3 + only-new-issues: true args: --out-format colored-line-number,checkstyle:golangci-lint-report.xml - working-directory: ${{ inputs.go-directory }} + working-directory: ${{ steps.set-working-directory.outputs.golangci-lint-working-directory }} - name: Print lint report artifact if: failure() shell: bash diff --git a/.github/actions/goreleaser-build-sign-publish/README.md b/.github/actions/goreleaser-build-sign-publish/README.md index d6bf7e6fd4a..189578391f5 100644 --- a/.github/actions/goreleaser-build-sign-publish/README.md +++ b/.github/actions/goreleaser-build-sign-publish/README.md @@ -97,13 +97,17 @@ Following inputs can be used as `step.with` keys | Name | Type | Default | Description | | ---------------------------- | ------ | ------------------ | ----------------------------------------------------------------------- | -| `goreleaser-version` | String | `1.13.1` | `goreleaser` version | -| `zig-version` | String | `0.10.0` | `zig` version | -| `cosign-version` | String | `v1.13.1` | `cosign` version | +| `goreleaser-version` | String | `~> v2` | `goreleaser` version | +| `zig-version` | String | `0.10.1` | `zig` version | +| `cosign-version` | String | `v2.2.2` | `cosign` version | | `macos-sdk-dir` | String | `MacOSX12.3.sdk` | MacOSX sdk directory | | `enable-docker-publish` | Bool | `true` | Enable publishing of Docker images / manifests | | `docker-registry` | String | `localhost:5001` | Docker registry | +| `docker-image-name` | String | `chainlink` | Docker image name | +| `docker-image-tag` | String | `develop` | Docker image tag | | `enable-goreleaser-snapshot` | Bool | `false` | Enable goreleaser build / release snapshot | +| `enable-goreleaser-split` | Bool | `false` | Enable goreleaser build using split and merge | +| `goreleaser-split-arch` | String | `""` | The arch to build the image with - amd64, arm64 | | `goreleaser-exec` | String | `goreleaser` | The goreleaser executable, can invoke wrapper script | | `goreleaser-config` | String | `.goreleaser.yaml` | The goreleaser configuration yaml | | `enable-cosign` | Bool | `false` | Enable signing of Docker images | diff --git a/.github/actions/goreleaser-build-sign-publish/action.yml b/.github/actions/goreleaser-build-sign-publish/action.yml index f4b2111bea5..0d4958387ae 100644 --- a/.github/actions/goreleaser-build-sign-publish/action.yml +++ b/.github/actions/goreleaser-build-sign-publish/action.yml @@ -3,7 +3,7 @@ description: A composite action that allows building and publishing signed chain inputs: goreleaser-version: description: The goreleaser version - default: 1.23.0 + default: "~> v2" required: false goreleaser-key: description: The goreleaser key @@ -14,7 +14,7 @@ inputs: required: false cosign-version: description: The cosign version - default: v2.2.2 + default: v2.4.0 required: false macos-sdk-dir: description: The macos sdk directory @@ -29,10 +29,13 @@ inputs: description: The docker registry default: localhost:5001 required: false - # snapshot inputs - enable-goreleaser-snapshot: - description: Enable goreleaser build / release snapshot - default: "false" + docker-image-name: + description: The docker image name + default: chainlink + required: false + docker-image-tag: + description: The docker image tag + default: develop required: false # goreleaser inputs goreleaser-exec: @@ -43,27 +46,22 @@ inputs: description: "The goreleaser configuration yaml" default: ".goreleaser.yaml" required: false - # signing inputs - enable-cosign: - description: Enable signing of docker images + enable-goreleaser-snapshot: + description: Enable goreleaser build / release snapshot default: "false" required: false - cosign-private-key: - description: The private key to be used with cosign to sign the image + enable-goreleaser-split: + description: Enable goreleaser split and merge builds + default: "false" required: false - cosign-public-key: - description: The public key to be used with cosign for verification + goreleaser-split-arch: + description: The architecture to split the goreleaser build required: false - cosign-password: - description: The password to decrypt the cosign private key needed to sign the image + # signing inputs + enable-cosign: + description: Enable signing of docker images + default: "false" required: false -outputs: - goreleaser-metadata: - description: "Build result metadata" - value: ${{ steps.goreleaser.outputs.metadata }} - goreleaser-artifacts: - description: "Build result artifacts" - value: ${{ steps.goreleaser.outputs.artifacts }} runs: using: composite steps: @@ -76,7 +74,7 @@ runs: with: go-version-file: "go.mod" - name: Setup goreleaser - uses: goreleaser/goreleaser-action@7ec5c2b0c6cdda6e8bbb49444bc797dd33d74dd8 # v5.0.0 + uses: goreleaser/goreleaser-action@286f3b13b1b49da4ac219696163fb8c1c93e1200 # v6.0.0 with: distribution: goreleaser-pro install-only: true @@ -89,7 +87,7 @@ runs: version: ${{ inputs.zig-version }} - name: Setup cosign if: inputs.enable-cosign == 'true' - uses: sigstore/cosign-installer@e1523de7571e31dbe865fd2e80c5c7c23ae71eb4 # v3.4.0 + uses: sigstore/cosign-installer@4959ce089c160fddf62f7b42464195ba1a56d382 # v3.6.0 with: cosign-release: ${{ inputs.cosign-version }} - name: Login to docker registry @@ -97,19 +95,27 @@ runs: uses: docker/login-action@e92390c5fb421da1463c202d546fed0ec5c39f20 # v3.1.0 with: registry: ${{ inputs.docker-registry }} - - name: Goreleaser release - id: goreleaser + - name: Set goreleaser split env + if: inputs.enable-goreleaser-split == 'true' + shell: bash + run: | + echo "GOOS=linux" | tee -a $GITHUB_ENV + echo "GOARCH=${{ inputs.goreleaser-split-arch }}" | tee -a $GITHUB_ENV + - name: Install syft + uses: anchore/sbom-action/download-syft@61119d458adab75f756bc0b9e4bde25725f86a7a # v0.17.2 + - name: Run goreleaser release shell: bash env: - ENABLE_COSIGN: ${{ inputs.enable-cosign }} ENABLE_GORELEASER_SNAPSHOT: ${{ inputs.enable-goreleaser-snapshot }} + ENABLE_GORELEASER_SPLIT: ${{ inputs.enable-goreleaser-split }} ENABLE_DOCKER_PUBLISH: ${{ inputs.enable-docker-publish }} IMAGE_PREFIX: ${{ inputs.docker-registry }} + IMAGE_NAME: ${{ inputs.docker-image-name }} + IMAGE_TAG: ${{ inputs.docker-image-tag }} GORELEASER_EXEC: ${{ inputs.goreleaser-exec }} GORELEASER_CONFIG: ${{ inputs.goreleaser-config }} - COSIGN_PASSWORD: ${{ inputs.cosign-password }} - COSIGN_PUBLIC_KEY: ${{ inputs.cosign-public-key }} - COSIGN_PRIVATE_KEY: ${{ inputs.cosign-private-key }} + GORELEASER_KEY: ${{ inputs.goreleaser-key }} + GITHUB_TOKEN: ${{ github.token }} MACOS_SDK_DIR: ${{ inputs.macos-sdk-dir }} run: | # https://github.com/orgs/community/discussions/24950 diff --git a/.github/actions/goreleaser-build-sign-publish/action_utils b/.github/actions/goreleaser-build-sign-publish/action_utils index 4aac78d6fcc..51c7c90aa1a 100755 --- a/.github/actions/goreleaser-build-sign-publish/action_utils +++ b/.github/actions/goreleaser-build-sign-publish/action_utils @@ -2,10 +2,9 @@ set -x set -euo pipefail -ENABLE_COSIGN=${ENABLE_COSIGN:-false} ENABLE_GORELEASER_SNAPSHOT=${ENABLE_GORELEASER_SNAPSHOT:-false} +ENABLE_GORELEASER_SPLIT=${ENABLE_GORELEASER_SPLIT:-false} ENABLE_DOCKER_PUBLISH=${ENABLE_DOCKER_PUBLISH:-false} -COSIGN_PASSWORD=${COSIGN_PASSWORD:-""} GORELEASER_EXEC=${GORELEASER_EXEC:-goreleaser} GORELEASER_CONFIG=${GORELEASER_CONFIG:-.goreleaser.yaml} IMAGE_PREFIX=${IMAGE_PREFIX:-"localhost:5001"} @@ -27,8 +26,12 @@ _publish_snapshot_manifests() { local docker_manifest_extra_args=$DOCKER_MANIFEST_EXTRA_ARGS local full_sha=$(git rev-parse HEAD) local images=$(docker images --filter "label=org.opencontainers.image.revision=$full_sha" --format "{{.Repository}}:{{.Tag}}" | sort) - local arches=(amd64 arm64) local raw_manifest_lists="" + if [[ $ENABLE_GORELEASER_SPLIT == "true" ]]; then + local arches=(${GOARCH:-""}) + else + local arches=(amd64 arm64) + fi for image in $images; do for arch in "${arches[@]}"; do image=${image%"-$arch"} @@ -51,25 +54,28 @@ _publish_snapshot_manifests() { # wrapper function to invoke goreleaser release goreleaser_release() { - if [[ $ENABLE_COSIGN == "true" ]]; then - echo "$COSIGN_PUBLIC_KEY" > cosign.pub - echo "$COSIGN_PRIVATE_KEY" > cosign.key + goreleaser_flags=() + + # set goreleaser flags + if [[ $ENABLE_GORELEASER_SNAPSHOT == "true" ]]; then + goreleaser_flags+=("--snapshot") + goreleaser_flags+=("--clean") + fi + if [[ $ENABLE_GORELEASER_SPLIT == "true" ]]; then + goreleaser_flags+=("--split") fi + flags=$(printf "%s " "${goreleaser_flags[@]}") + flags=$(echo "$flags" | sed 's/ *$//') + if [[ -n $MACOS_SDK_DIR ]]; then MACOS_SDK_DIR=$(echo "$(cd "$(dirname "$MACOS_SDK_DIR")" || exit; pwd)/$(basename "$MACOS_SDK_DIR")") fi - if [[ $ENABLE_GORELEASER_SNAPSHOT == "true" ]]; then - $GORELEASER_EXEC release --snapshot --clean --config "$GORELEASER_CONFIG" "$@" - if [[ $ENABLE_DOCKER_PUBLISH == "true" ]]; then + + $GORELEASER_EXEC release ${flags} --config "$GORELEASER_CONFIG" "$@" + + if [[ $ENABLE_DOCKER_PUBLISH == "true" ]] && [[ $ENABLE_GORELEASER_SNAPSHOT == "true" ]]; then _publish_snapshot_images _publish_snapshot_manifests - fi - else - $GORELEASER_EXEC release --clean --config "$GORELEASER_CONFIG" "$@" - fi - if [[ $ENABLE_COSIGN == "true" ]]; then - rm -rf cosign.pub - rm -rf cosign.key fi } diff --git a/.github/actions/setup-create-base64-config-live-testnets/action.yml b/.github/actions/setup-create-base64-config-live-testnets/action.yml deleted file mode 100644 index 64fc134b46e..00000000000 --- a/.github/actions/setup-create-base64-config-live-testnets/action.yml +++ /dev/null @@ -1,144 +0,0 @@ -name: Create Base64 Config -description: A composite action that creates a base64-encoded config to be used by integration tests - -inputs: - runId: - description: The run id - testLogCollect: - description: Whether to always collect logs, even for passing tests - default: "false" - chainlinkImage: - description: The chainlink image to use - default: "public.ecr.aws/chainlink/chainlink" - chainlinkVersion: - description: The git commit sha to use for the image tag - chainlinkPostgresVersion: - description: The postgres version to use with the chainlink node - default: "15.6" - pyroscopeServer: - description: URL of Pyroscope server - pyroscopeEnvironment: - description: Name of Pyroscope environment - pyroscopeKey: - description: Pyroscope server key - lokiEndpoint: - description: Loki push endpoint - lokiTenantId: - description: Loki tenant id - lokiBasicAuth: - description: Loki basic auth - logstreamLogTargets: - description: Where to send logs (e.g. file, loki) - grafanaUrl: - description: Grafana URL - grafanaDashboardUrl: - description: Grafana dashboard URL - grafanaBearerToken: - description: Grafana bearer token - network: - description: Network to run tests on - httpEndpoints: - description: HTTP endpoints to use for network - wsEndpoints: - description: WS endpoints to use for network - fundingKeys: - description: Funding keys to use for network - -runs: - using: composite - steps: - - name: Prepare Base64 TOML override - shell: bash - id: base64-config-override - env: - RUN_ID: ${{ inputs.runId }} - PYROSCOPE_SERVER: ${{ inputs.pyroscopeServer }} - PYROSCOPE_ENVIRONMENT: ${{ inputs.pyroscopeEnvironment }} - PYROSCOPE_KEY: ${{ inputs.pyroscopeKey }} - CHAINLINK_IMAGE: ${{ inputs.chainlinkImage }} - CHAINLINK_VERSION: ${{ inputs.chainlinkVersion }} - CHAINLINK_POSTGRES_VERSION: ${{ inputs.chainlinkPostgresVersion }} - LOKI_ENDPOINT: ${{ inputs.lokiEndpoint }} - LOKI_TENANT_ID: ${{ inputs.lokiTenantId }} - LOKI_BASIC_AUTH: ${{ inputs.lokiBasicAuth }} - LOGSTREAM_LOG_TARGETS: ${{ inputs.logstreamLogTargets }} - GRAFANA_URL: ${{ inputs.grafanaUrl }} - GRAFANA_DASHBOARD_URL: ${{ inputs.grafanaDashboardUrl }} - GRAFANA_BEARER_TOKEN: ${{ inputs.grafanaBearerToken }} - NETWORK: ${{ inputs.network }} - HTTP_ENDPOINTS: ${{ inputs.httpEndpoints }} - WS_ENDPOINTS: ${{ inputs.wsEndpoints }} - FUNDING_KEYS: ${{ inputs.fundingKeys }} - run: | - convert_to_toml_array() { - local IFS=',' - local input_array=($1) - local toml_array_format="[" - - for element in "${input_array[@]}"; do - toml_array_format+="\"$element\"," - done - - toml_array_format="${toml_array_format%,}]" - echo "$toml_array_format" - } - - if [ -n "$PYROSCOPE_SERVER" ]; then - pyroscope_enabled=true - else - pyroscope_enabled=false - fi - - grafana_bearer_token="" - if [ -n "$GRAFANA_BEARER_TOKEN" ]; then - grafana_bearer_token="bearer_token_secret=\"$GRAFANA_BEARER_TOKEN\"" - fi - - cat << EOF > config.toml - [Common] - chainlink_node_funding=0.5 - - [ChainlinkImage] - image="$CHAINLINK_IMAGE" - version="$CHAINLINK_VERSION" - postgres_version="$CHAINLINK_POSTGRES_VERSION" - - [Pyroscope] - enabled=$pyroscope_enabled - server_url="$PYROSCOPE_SERVER" - environment="$PYROSCOPE_ENVIRONMENT" - key_secret="$PYROSCOPE_KEY" - - [Logging] - run_id="$RUN_ID" - - [Logging.LogStream] - log_targets=$(convert_to_toml_array "$LOGSTREAM_LOG_TARGETS") - - [Logging.Loki] - tenant_id="$LOKI_TENANT_ID" - endpoint="$LOKI_URL" - basic_auth_secret="$LOKI_BASIC_AUTH" - - [Logging.Grafana] - base_url="$GRAFANA_URL" - dashboard_url="$GRAFANA_DASHBOARD_URL" - $grafana_bearer_token - - [Network] - selected_networks=["$NETWORK"] - - [Network.RpcHttpUrls] - "$NETWORK" = $(convert_to_toml_array "$HTTP_ENDPOINTS") - - [Network.RpcWsUrls] - "$NETWORK" = $(convert_to_toml_array "$WS_ENDPOINTS") - - [Network.WalletKeys] - "$NETWORK" = $(convert_to_toml_array "$FUNDING_KEYS") - EOF - - BASE64_CONFIG_OVERRIDE=$(cat config.toml | base64 -w 0) - echo ::add-mask::$BASE64_CONFIG_OVERRIDE - echo "BASE64_CONFIG_OVERRIDE=$BASE64_CONFIG_OVERRIDE" >> $GITHUB_ENV - touch .root_dir diff --git a/.github/actions/setup-create-base64-config/action.yml b/.github/actions/setup-create-base64-config/action.yml deleted file mode 100644 index a5e7c8f0b4d..00000000000 --- a/.github/actions/setup-create-base64-config/action.yml +++ /dev/null @@ -1,106 +0,0 @@ -name: Create Base64 Config -description: A composite action that creates a base64-encoded config to be used by integration tests - -inputs: - runId: - description: The run id - testLogCollect: - description: Whether to always collect logs, even for passing tests - default: "false" - selectedNetworks: - description: The networks to run tests against - chainlinkPostgresVersion: - description: The postgres version to use with the chainlink node - default: "15.6" - chainlinkVersion: - description: The git commit sha to use for the image tag - logstreamLogTargets: - description: Where to send logs (e.g. file, loki) - ethExecutionClient: - description: Ethereum execution client to use (geth, besu, nethermind or erigon) - customEthClientDockerImage: - description: custom docker image to use for eth client (e.g. hyperledger/besu:21.10.0) - -runs: - using: composite - steps: - - name: Prepare Base64 TOML override - shell: bash - id: base64-config-override - env: - RUN_ID: ${{ inputs.runId }} - TEST_LOG_COLLECT: ${{ inputs.testLogCollect }} - SELECTED_NETWORKS: ${{ inputs.selectedNetworks }} - CHAINLINK_VERSION: ${{ inputs.chainlinkVersion }} - CHAINLINK_POSTGRES_VERSION: ${{ inputs.chainlinkPostgresVersion }} - LOGSTREAM_LOG_TARGETS: ${{ inputs.logstreamLogTargets }} - ETH_EXECUTION_CLIENT: ${{ inputs.ethExecutionClient }} - CUSTOM_ETH_CLIENT_DOCKER_IMAGE: ${{ inputs.customEthClientDockerImage }} - run: | - function convert_to_toml_array() { - local IFS=',' - local input_array=($1) - local toml_array_format="[" - - for element in "${input_array[@]}"; do - toml_array_format+="\"$element\"," - done - - toml_array_format="${toml_array_format%,}]" - echo "$toml_array_format" - } - - selected_networks=$(convert_to_toml_array "$SELECTED_NETWORKS") - log_targets=$(convert_to_toml_array "$LOGSTREAM_LOG_TARGETS") - - if [ -n "$TEST_LOG_COLLECT" ]; then - test_log_collect=true - else - test_log_collect=false - fi - - custom_images="" - ethereum_version="" - - if [ -n "$CUSTOM_ETH_CLIENT_DOCKER_IMAGE" ]; then - ethereum_version="ethereum_version=\"\"" - custom_images+="[PrivateEthereumNetwork.CustomDockerImages]" - custom_images+=$'\n'"execution_layer=\"$CUSTOM_ETH_CLIENT_DOCKER_IMAGE\"" - fi - - if [ -n "$ETH_EXECUTION_CLIENT" ]; then - execution_layer="$ETH_EXECUTION_CLIENT" - else - execution_layer="geth" - fi - - grafana_bearer_token="" - if [ -n "$GRAFANA_BEARER_TOKEN" ]; then - grafana_bearer_token="bearer_token_secret=\"$GRAFANA_BEARER_TOKEN\"" - fi - - cat << EOF > config.toml - [Network] - selected_networks=$selected_networks - - [ChainlinkImage] - version="$CHAINLINK_VERSION" - postgres_version="$CHAINLINK_POSTGRES_VERSION" - - [Logging] - test_log_collect=$test_log_collect - run_id="$RUN_ID" - - [Logging.LogStream] - log_targets=$log_targets - - [PrivateEthereumNetwork] - execution_layer="$execution_layer" - $ethereum_version - - $custom_images - EOF - - BASE64_CONFIG_OVERRIDE=$(cat config.toml | base64 -w 0) - echo ::add-mask::$BASE64_CONFIG_OVERRIDE - echo "BASE64_CONFIG_OVERRIDE=$BASE64_CONFIG_OVERRIDE" >> $GITHUB_ENV diff --git a/.github/actions/setup-create-base64-upgrade-config/action.yml b/.github/actions/setup-create-base64-upgrade-config/action.yml deleted file mode 100644 index c2d0bc19f35..00000000000 --- a/.github/actions/setup-create-base64-upgrade-config/action.yml +++ /dev/null @@ -1,125 +0,0 @@ -name: Create Base64 Upgrade Config -description: A composite action that creates a base64-encoded config to be used by Chainlink version upgrade tests - -inputs: - selectedNetworks: - description: The networks to run tests against - chainlinkImage: - description: The chainlink image to upgrade from - default: "public.ecr.aws/chainlink/chainlink" - chainlinkVersion: - description: The git commit sha to use for the image tag - chainlinkPostgresVersion: - description: The postgres version to use with the chainlink node - default: "15.6" - upgradeImage: - description: The chainlink image to upgrade to - default: "public.ecr.aws/chainlink/chainlink" - upgradeVersion: - description: The git commit sha to use for the image tag - runId: - description: The run id - testLogCollect: - description: Whether to always collect logs, even for passing tests - default: "false" - lokiEndpoint: - description: Loki push endpoint - lokiTenantId: - description: Loki tenant id - lokiBasicAuth: - description: Loki basic auth - logstreamLogTargets: - description: Where to send logs (e.g. file, loki) - grafanaUrl: - description: Grafana URL - grafanaDashboardUrl: - description: Grafana dashboard URL - grafanaBearerToken: - description: Grafana bearer token - -runs: - using: composite - steps: - - name: Prepare Base64 TOML override - shell: bash - id: base64-config-override - env: - SELECTED_NETWORKS: ${{ inputs.selectedNetworks }} - CHAINLINK_IMAGE: ${{ inputs.chainlinkImage }} - CHAINLINK_VERSION: ${{ inputs.chainlinkVersion }} - CHAINLINK_POSTGRES_VERSION: ${{ inputs.chainlinkPostgresVersion }} - UPGRADE_IMAGE: ${{ inputs.upgradeImage }} - UPGRADE_VERSION: ${{ inputs.upgradeVersion }} - RUN_ID: ${{ inputs.runId }} - TEST_LOG_COLLECT: ${{ inputs.testLogCollect }} - LOKI_ENDPOINT: ${{ inputs.lokiEndpoint }} - LOKI_TENANT_ID: ${{ inputs.lokiTenantId }} - LOKI_BASIC_AUTH: ${{ inputs.lokiBasicAuth }} - LOGSTREAM_LOG_TARGETS: ${{ inputs.logstreamLogTargets }} - GRAFANA_URL: ${{ inputs.grafanaUrl }} - GRAFANA_DASHBOARD_URL: ${{ inputs.grafanaDashboardUrl }} - GRAFANA_BEARER_TOKEN: ${{ inputs.grafanaBearerToken }} - run: | - function convert_to_toml_array() { - local IFS=',' - local input_array=($1) - local toml_array_format="[" - - for element in "${input_array[@]}"; do - toml_array_format+="\"$element\"," - done - - toml_array_format="${toml_array_format%,}]" - echo "$toml_array_format" - } - - selected_networks=$(convert_to_toml_array "$SELECTED_NETWORKS") - - if [ -n "$TEST_LOG_COLLECT" ]; then - test_log_collect=true - else - test_log_collect=false - fi - - log_targets=$(convert_to_toml_array "$LOGSTREAM_LOG_TARGETS") - - grafana_bearer_token="" - if [ -n "$GRAFANA_BEARER_TOKEN" ]; then - grafana_bearer_token="bearer_token_secret=\"$GRAFANA_BEARER_TOKEN\"" - fi - - cat << EOF > config.toml - [Network] - selected_networks=$selected_networks - - [ChainlinkImage] - image="$CHAINLINK_IMAGE" - version="$CHAINLINK_VERSION" - postgres_version="$CHAINLINK_POSTGRES_VERSION" - - [ChainlinkUpgradeImage] - image="$UPGRADE_IMAGE" - version="$UPGRADE_VERSION" - postgres_version="$CHAINLINK_POSTGRES_VERSION" - - [Logging] - test_log_collect=$test_log_collect - run_id="$RUN_ID" - - [Logging.LogStream] - log_targets=$log_targets - - [Logging.Loki] - tenant_id="$LOKI_TENANT_ID" - endpoint="$LOKI_ENDPOINT" - basic_auth_secret="$LOKI_BASIC_AUTH" - - [Logging.Grafana] - base_url="$GRAFANA_URL" - dashboard_url="$GRAFANA_DASHBOARD_URL" - $grafana_bearer_token - EOF - - BASE64_CONFIG_OVERRIDE=$(cat config.toml | base64 -w 0) - echo ::add-mask::$BASE64_CONFIG_OVERRIDE - echo "BASE64_CONFIG_OVERRIDE=$BASE64_CONFIG_OVERRIDE" >> $GITHUB_ENV diff --git a/.github/actions/setup-merge-base64-config/action.yml b/.github/actions/setup-merge-base64-config/action.yml deleted file mode 100644 index b734873c1f6..00000000000 --- a/.github/actions/setup-merge-base64-config/action.yml +++ /dev/null @@ -1,72 +0,0 @@ -name: Merge Base64 Config -description: A composite action that merges user-provided Base64-encoded config with repository's secrets - -inputs: - base64Config: - description: Base64-encoded config to decode - -runs: - using: composite - steps: - - name: Install dasel - shell: bash - run: | - if ! which dasel > /dev/null; then - curl -L -o dasel "https://github.com/TomWright/dasel/releases/download/v2.6.0/dasel_linux_amd64" && chmod +x dasel && sudo mv dasel /usr/local/bin/ - else - echo "Dasel is already installed." - fi - - name: Add masks and export base64 config - shell: bash - run: | - BASE64_CONFIG_OVERRIDE=$(jq -r '.inputs.base64Config' $GITHUB_EVENT_PATH) - echo ::add-mask::$BASE64_CONFIG_OVERRIDE - echo "BASE64_CONFIG_OVERRIDE=$BASE64_CONFIG_OVERRIDE" >> $GITHUB_ENV - - decoded_toml=$(echo $BASE64_CONFIG_OVERRIDE | base64 -d) - CHAINLINK_IMAGE=$(echo "$decoded_toml" | dasel -r toml 'ChainlinkImage.image') - echo ::add-mask::$CHAINLINK_IMAGE - CHAINLINK_VERSION=$(echo "$decoded_toml" | dasel -r toml 'ChainlinkImage.version') - NETWORKS=$(echo "$decoded_toml" | awk -F'=' '/^[[:space:]]*selected_networks[[:space:]]*=/ {gsub(/^[[:space:]]+|[[:space:]]+$/, "", $2); print $2}' 2>/dev/null) - - if [ -n "$CHAINLINK_IMAGE" ]; then - echo "CHAINLINK_IMAGE=$CHAINLINK_IMAGE" >> $GITHUB_ENV - else - echo "No Chainlink Image found in base64-ed config. Exiting" - exit 1 - fi - if [ -n "$CHAINLINK_VERSION" ]; then - echo "CHAINLINK_VERSION=$CHAINLINK_VERSION" >> $GITHUB_ENV - else - echo "No Chainlink Version found in base64-ed config. Exiting" - exit 1 - fi - if [ -n "$NETWORKS" ]; then - echo "NETWORKS=$NETWORKS" >> $GITHUB_ENV - fi - - grafana_bearer_token="" - if [ -n "$GRAFANA_BEARER_TOKEN" ]; then - grafana_bearer_token="bearer_token_secret=\"$GRAFANA_BEARER_TOKEN\"" - fi - - # use Loki config from GH secrets and merge it with base64 input - cat << EOF > config.toml - [Logging.Loki] - tenant_id="$LOKI_TENANT_ID" - endpoint="$LOKI_URL" - basic_auth_secret="$LOKI_BASIC_AUTH" - # legacy, you only need this to access the cloud version - # bearer_token_secret="bearer_token" - - [Logging.Grafana] - base_url="$GRAFANA_URL" - dashboard_url="$GRAFANA_DASHBOARD_URL" - $grafana_bearer_token - EOF - - echo "$decoded_toml" >> final_config.toml - cat config.toml >> final_config.toml - BASE64_CONFIG_OVERRIDE=$(cat final_config.toml | base64 -w 0) - echo ::add-mask::$BASE64_CONFIG_OVERRIDE - echo "BASE64_CONFIG_OVERRIDE=$BASE64_CONFIG_OVERRIDE" >> $GITHUB_ENV \ No newline at end of file diff --git a/.github/actions/setup-parse-base64-config/action.yml b/.github/actions/setup-parse-base64-config/action.yml deleted file mode 100644 index 5e03c6de284..00000000000 --- a/.github/actions/setup-parse-base64-config/action.yml +++ /dev/null @@ -1,46 +0,0 @@ -name: Parse Base64 Config -description: A composite action that extracts the chainlink image, version and network from a base64-encoded config - -inputs: - base64Config: - description: Base64-encoded config to decode - -runs: - using: composite - steps: - - name: Install dasel - shell: bash - run: | - if ! which dasel > /dev/null; then - curl -L -o dasel "https://github.com/TomWright/dasel/releases/download/v2.6.0/dasel_linux_amd64" && chmod +x dasel && sudo mv dasel /usr/local/bin/ - else - echo "Dasel is already installed." - fi - - name: Add masks and export base64 config - shell: bash - run: | - decoded_toml=$(echo $BASE64_CONFIG_OVERRIDE | base64 -d) - CHAINLINK_IMAGE=$(echo "$decoded_toml" | dasel -r toml 'ChainlinkImage.image') - echo ::add-mask::$CHAINLINK_IMAGE - CHAINLINK_VERSION=$(echo "$decoded_toml" | dasel -r toml 'ChainlinkImage.version') - NETWORKS=$(echo "$decoded_toml" | awk -F'=' '/^[[:space:]]*selected_networks[[:space:]]*=/ {gsub(/^[[:space:]]+|[[:space:]]+$/, "", $2); print $2}' 2>/dev/null) - ETH2_EL_CLIENT=$(echo "$decoded_toml" | awk -F'=' '/^[[:space:]]*execution_layer[[:space:]]*=/ {gsub(/^[[:space:]]+|[[:space:]]+$/, "", $2); print $2}' 2>/dev/null) - - if [ -n "$CHAINLINK_IMAGE" ]; then - echo "CHAINLINK_IMAGE=$CHAINLINK_IMAGE" >> $GITHUB_ENV - else - echo "No Chainlink Image found in base64-ed config. Exiting" - exit 1 - fi - if [ -n "$CHAINLINK_VERSION" ]; then - echo "CHAINLINK_VERSION=$CHAINLINK_VERSION" >> $GITHUB_ENV - else - echo "No Chainlink Version found in base64-ed config. Exiting" - exit 1 - fi - if [ -n "$NETWORKS" ]; then - echo "NETWORKS=$NETWORKS" >> $GITHUB_ENV - fi - if [ -n "$ETH2_EL_CLIENT" ]; then - echo "ETH2_EL_CLIENT=$ETH2_EL_CLIENT" >> $GITHUB_ENV - fi \ No newline at end of file diff --git a/.github/actions/validate-artifact-scope/action.yaml b/.github/actions/validate-artifact-scope/action.yaml new file mode 100644 index 00000000000..7440efc63a3 --- /dev/null +++ b/.github/actions/validate-artifact-scope/action.yaml @@ -0,0 +1,103 @@ +name: Validate Artifact Scope +description: Checks there are any modified Solidity files outside of the specified scope. If so, it prints a warning message, but does not fail the workflow. +inputs: + product: + description: The product for which the artifacts are being generated + required: true + sol_files: + description: Comma-separated (CSV) or space-separated (shell) list of Solidity files to check + required: true + +runs: + using: composite + steps: + - name: Transform input array + id: transform_input_array + shell: bash + run: | + is_csv_format() { + local input="$1" + if [[ "$input" =~ "," ]]; then + return 0 + else + return 1 + fi + } + + is_space_separated_string() { + local input="$1" + if [[ "$input" =~ ^[^[:space:]]+([[:space:]][^[:space:]]+)*$ ]]; then + return 0 + else + return 1 + fi + } + + array="${{ inputs.sol_files }}" + + if is_csv_format "$array"; then + echo "::debug::CSV format detected, nothing to do" + echo "sol_files=$array" >> $GITHUB_OUTPUT + exit 0 + fi + + if is_space_separated_string "$array"; then + echo "::debug::Space-separated format detected, converting to CSV" + csv_array="${array// /,}" + echo "sol_files=$csv_array" >> $GITHUB_OUTPUT + exit 0 + fi + + echo "::error::Invalid input format for sol_files. Please provide a comma-separated (CSV) or space-separated (shell) list of Solidity files" + exit 1 + + - name: Check for changes outside of artifact scope + shell: bash + run: | + echo "::debug::All modified contracts:" + echo "${{ steps.transform_input_array.outputs.sol_files }}" | tr ',' '\n' + if [ "${{ inputs.product }}" = "shared" ]; then + excluded_paths_pattern="!/^contracts\/src\/v0\.8\/interfaces/ && !/^contracts\/src\/v0\.8\/${{ inputs.product }}/ && !/^contracts\/src\/v0\.8\/[^\/]+\.sol$/" + else + excluded_paths_pattern="!/^contracts\/src\/v0\.8\/${{ inputs.product }}/" + fi + echo "::debug::Excluded paths: $excluded_paths_pattern" + unexpected_files=$(echo "${{ steps.transform_input_array.outputs.sol_files }}" | tr ',' '\n' | awk "$excluded_paths_pattern") + missing_files="" + set -e + set -o pipefail + if [[ -n "$unexpected_files" ]]; then + products=() + productsStr="" + IFS=$'\n' read -r -d '' -a files <<< "$unexpected_files" || true + echo "Files: ${files[@]}" + + for file in "${files[@]}"; do + missing_files+="$file," + + product=$(echo "$file" | awk -F'src/v0.8/' '{if ($2 ~ /\//) print substr($2, 1, index($2, "/")-1); else print "shared"}') + if [[ ! " ${products[@]} " =~ " ${product} " ]]; then + products+=("$product") + productsStr+="$product, " + fi + done + productsStr=${productsStr%, } + + set +e + set +o pipefail + + missing_files=$(echo $missing_files | tr ',' '\n') + + echo "Error: Found modified contracts outside of the expected scope: ${{ inputs.product }}" + echo "Files:" + echo "$missing_files" + echo "Action required: If you want to generate artifacts for other products ($productsStr) run this workflow again with updated configuration" + + echo "# Warning!" >> $GITHUB_STEP_SUMMARY + echo "## Reason: Found modified contracts outside of the expected scope: ${{ inputs.product }}" >> $GITHUB_STEP_SUMMARY + echo "### Files:" >> $GITHUB_STEP_SUMMARY + echo "$missing_files" >> $GITHUB_STEP_SUMMARY + echo "## Action required: If you want to generate artifacts for other products ($productsStr) run this workflow again with updated configuration" >> $GITHUB_STEP_SUMMARY + else + echo "No unexpected files found." + fi diff --git a/.github/dependabot.yml b/.github/dependabot.yml index cdb1d4fe2f5..d7af2d7f750 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,17 +1,17 @@ version: 2 updates: - package-ecosystem: gomod - directory: '/' + directory: "/" schedule: interval: monthly - open-pull-requests-limit: 10 + open-pull-requests-limit: 0 ignore: # Old versions are pinned for libocr. - dependency-name: github.com/libp2p/go-libp2p-core - dependency-name: github.com/libp2p/go-libp2p-peerstore - dependency-name: github.com/multiformats/go-multiaddr - package-ecosystem: npm - directory: '/' + directory: "/" schedule: interval: monthly open-pull-requests-limit: 0 @@ -24,7 +24,47 @@ updates: versions: - 4.17.21 - package-ecosystem: github-actions - directory: '/' + directory: "/" + schedule: + interval: monthly + open-pull-requests-limit: 0 + - package-ecosystem: gomod + directory: "/lib" + schedule: + interval: "daily" + open-pull-requests-limit: 10 + labels: + - "dependencies" + - "ctf" + - package-ecosystem: gomod + directory: "/wasp" + schedule: + interval: "daily" + open-pull-requests-limit: 10 + labels: + - "dependencies" + - "ctf" + - package-ecosystem: gomod + directory: "/seth" + schedule: + interval: "daily" + open-pull-requests-limit: 10 + labels: + - "dependencies" + - "ctf" + - package-ecosystem: gomod + directory: "/havoc" + schedule: + interval: "daily" + open-pull-requests-limit: 10 + labels: + - "dependencies" + - "ctf" + - package-ecosystem: gomod + directory: "/k8s-test-runner" schedule: - interval: daily + interval: "daily" open-pull-requests-limit: 10 + labels: + - "dependencies" + - "ctf" diff --git a/.github/e2e-tests.yml b/.github/e2e-tests.yml new file mode 100644 index 00000000000..3b91bd251a1 --- /dev/null +++ b/.github/e2e-tests.yml @@ -0,0 +1,1181 @@ +# This file specifies the GitHub runner for each E2E test and is utilized by all E2E CI workflows. +# +# Each entry in this file includes the following: +# - The GitHub runner (runs_on field) that will execute tests. +# - The tests that will be run by the runner. +# - The triggers (e.g., Run PR E2E Tests, Nightly E2E Tests) that should trigger these tests. +# +runner-test-matrix: + + # START: OCR tests + + # Example of 1 runner for all tests in integration-tests/smoke/ocr_test.go + - id: smoke/ocr_test.go:* + path: integration-tests/smoke/ocr_test.go + test_env_type: docker + runs_on: ubuntu-latest + triggers: + - PR E2E Core Tests + - Merge Queue E2E Core Tests + - Nightly E2E Tests + test_cmd: cd integration-tests/ && go test smoke/ocr_test.go -timeout 30m -count=1 -test.parallel=2 -json + pyroscope_env: ci-smoke-ocr-evm-simulated + + - id: soak/ocr_test.go:TestOCRv1Soak + path: integration-tests/soak/ocr_test.go + test_env_type: k8s-remote-runner + runs_on: ubuntu-latest + test_cmd: cd integration-tests/ && go test soak/ocr_test.go -v -test.run ^TestOCRv1Soak$ -test.parallel=1 -timeout 900h -count=1 -json + test_cmd_opts: 2>&1 | tee /tmp/gotest.log | gotestloghelper -ci -singlepackage -hidepassingtests=false + test_secrets_required: true + test_env_vars: + TEST_SUITE: soak + + - id: soak/ocr_test.go:TestOCRv2Soak + path: integration-tests/soak/ocr_test.go + test_env_type: k8s-remote-runner + runs_on: ubuntu-latest + test_cmd: cd integration-tests/ && go test soak/ocr_test.go -v -test.run ^TestOCRv2Soak$ -test.parallel=1 -timeout 900h -count=1 -json + test_cmd_opts: 2>&1 | tee /tmp/gotest.log | gotestloghelper -ci -singlepackage -hidepassingtests=false + test_secrets_required: true + test_env_vars: + TEST_SUITE: soak + + - id: soak/ocr_test.go:TestOCRv2Soak_WemixTestnet + path: integration-tests/soak/ocr_test.go + test_env_type: k8s-remote-runner + runs_on: ubuntu-latest + test_cmd: cd integration-tests/ && go test soak/ocr_test.go -v -test.run ^TestOCRv2Soak$ -test.parallel=1 -timeout 900h -count=1 -json + test_config_override_path: integration-tests/testconfig/ocr2/overrides/wemix_testnet.toml + test_secrets_required: true + test_env_vars: + TEST_SUITE: soak + + # This can be used to run a quick smoke test for OCRv2 to see if integration-tests/soak/ocr_test.go is working + - id: soak/ocr_test.go:TestOCRv2Soak_QuickSmokeTest + path: integration-tests/soak/ocr_test.go + test_env_type: k8s-remote-runner + runs_on: ubuntu-latest + test_cmd: cd integration-tests/ && go test soak/ocr_test.go -v -test.run ^TestOCRv2Soak$ -test.parallel=1 -timeout 900h -count=1 -json + test_config_override_path: integration-tests/testconfig/ocr2/overrides/base_sepolia_quick_smoke_test.toml + test_secrets_required: true + test_env_vars: + TEST_SUITE: soak + + - id: soak/ocr_test.go:TestForwarderOCRv1Soak + path: integration-tests/soak/ocr_test.go + test_env_type: k8s-remote-runner + runs_on: ubuntu-latest + test_cmd: cd integration-tests/ && go test soak/ocr_test.go -v -test.run ^TestForwarderOCRv1Soak$ -test.parallel=1 -timeout 900h -count=1 -json + test_secrets_required: true + test_env_vars: + TEST_SUITE: soak + + - id: soak/ocr_test.go:TestForwarderOCRv2Soak + path: integration-tests/soak/ocr_test.go + test_env_type: k8s-remote-runner + runs_on: ubuntu-latest + test_cmd: cd integration-tests/ && go test soak/ocr_test.go -v -test.run ^TestForwarderOCRv2Soak$ -test.parallel=1 -timeout 900h -count=1 -json + test_secrets_required: true + test_env_vars: + TEST_SUITE: soak + + - id: soak/ocr_test.go:TestOCRSoak_GethReorgBelowFinality_FinalityTagDisabled + path: integration-tests/soak/ocr_test.go + test_env_type: k8s-remote-runner + runs_on: ubuntu-latest + test_cmd: cd integration-tests/ && go test soak/ocr_test.go -v -test.run TestOCRSoak_GethReorgBelowFinality_FinalityTagDisabled -test.parallel=1 -timeout 900h -count=1 -json + test_secrets_required: true + test_env_vars: + TEST_SUITE: soak + + - id: soak/ocr_test.go:TestOCRSoak_GethReorgBelowFinality_FinalityTagEnabled + path: integration-tests/soak/ocr_test.go + test_env_type: k8s-remote-runner + runs_on: ubuntu-latest + test_cmd: cd integration-tests/ && go test soak/ocr_test.go -v -test.run ^TestOCRSoak_GethReorgBelowFinality_FinalityTagEnabled$ -test.parallel=1 -timeout 900h -count=1 -json + test_secrets_required: true + test_env_vars: + TEST_SUITE: soak + + - id: soak/ocr_test.go:TestOCRSoak_GasSpike + path: integration-tests/soak/ocr_test.go + test_env_type: k8s-remote-runner + runs_on: ubuntu-latest + test_cmd: cd integration-tests/ && go test soak/ocr_test.go -v -test.run ^TestOCRSoak_GasSpike$ -test.parallel=1 -timeout 900h -count=1 -json + test_secrets_required: true + test_env_vars: + TEST_SUITE: soak + + - id: soak/ocr_test.go:TestOCRSoak_ChangeBlockGasLimit + path: integration-tests/soak/ocr_test.go + test_env_type: k8s-remote-runner + runs_on: ubuntu-latest + test_cmd: cd integration-tests/ && go test soak/ocr_test.go -v -test.run ^TestOCRSoak_ChangeBlockGasLimit$ -test.parallel=1 -timeout 900h -count=1 -json + test_secrets_required: true + test_env_vars: + TEST_SUITE: soak + + - id: soak/ocr_test.go:TestOCRSoak_RPCDownForAllCLNodes + path: integration-tests/soak/ocr_test.go + test_env_type: k8s-remote-runner + runs_on: ubuntu-latest + test_cmd: cd integration-tests/ && go test soak/ocr_test.go -v -test.run ^TestOCRSoak_RPCDownForAllCLNodes$ -test.parallel=1 -timeout 900h -count=1 -json + test_secrets_required: true + test_env_vars: + TEST_SUITE: soak + + - id: soak/ocr_test.go:TestOCRSoak_RPCDownForHalfCLNodes + path: integration-tests/soak/ocr_test.go + test_env_type: k8s-remote-runner + runs_on: ubuntu-latest + test_cmd: cd integration-tests/ && go test soak/ocr_test.go -v -test.run ^TestOCRSoak_RPCDownForHalfCLNodes$ -test.parallel=1 -timeout 900h -count=1 -json + test_secrets_required: true + test_env_vars: + TEST_SUITE: soak + + - id: smoke/forwarder_ocr_test.go:* + path: integration-tests/smoke/forwarder_ocr_test.go + test_env_type: docker + runs_on: ubuntu-latest + triggers: + - PR E2E Core Tests + - Merge Queue E2E Core Tests + - Nightly E2E Tests + test_cmd: cd integration-tests/ && go test smoke/forwarder_ocr_test.go -timeout 30m -count=1 -test.parallel=2 -json + pyroscope_env: ci-smoke-forwarder-ocr-evm-simulated + + - id: smoke/forwarders_ocr2_test.go:* + path: integration-tests/smoke/forwarders_ocr2_test.go + test_env_type: docker + runs_on: ubuntu-latest + triggers: + - PR E2E Core Tests + - Merge Queue E2E Core Tests + - Nightly E2E Tests + test_cmd: cd integration-tests/ && go test smoke/forwarders_ocr2_test.go -timeout 30m -count=1 -test.parallel=2 -json + pyroscope_env: ci-smoke-forwarder-ocr-evm-simulated + + - id: smoke/ocr2_test.go:* + path: integration-tests/smoke/ocr2_test.go + test_env_type: docker + runs_on: ubuntu22.04-16cores-64GB + triggers: + - PR E2E Core Tests + - Merge Queue E2E Core Tests + - Nightly E2E Tests + test_cmd: cd integration-tests/ && go test smoke/ocr2_test.go -timeout 30m -count=1 -test.parallel=6 -json + pyroscope_env: ci-smoke-ocr2-evm-simulated + test_env_vars: + E2E_TEST_CHAINLINK_VERSION: '{{ env.DEFAULT_CHAINLINK_PLUGINS_VERSION }}' # This is the chainlink version that has the plugins + + - id: smoke/ocr2_test.go:*-plugins + path: integration-tests/smoke/ocr2_test.go + test_env_type: docker + runs_on: ubuntu22.04-16cores-64GB + triggers: + - PR E2E Core Tests + - Merge Queue E2E Core Tests + - Nightly E2E Tests + test_cmd: cd integration-tests/ && go test smoke/ocr2_test.go -timeout 30m -count=1 -test.parallel=6 -json + pyroscope_env: ci-smoke-ocr2-plugins-evm-simulated + test_env_vars: + E2E_TEST_CHAINLINK_VERSION: '{{ env.DEFAULT_CHAINLINK_PLUGINS_VERSION }}' # This is the chainlink version that has the plugins + ENABLE_OTEL_TRACES: true + + - id: chaos/ocr_chaos_test.go + path: integration-tests/chaos/ocr_chaos_test.go + test_env_type: k8s-remote-runner + runs_on: ubuntu-latest + triggers: + - Automation On Demand Tests + - E2E Chaos Tests + test_cmd: cd integration-tests/chaos && DETACH_RUNNER=false go test -test.run "^TestOCRChaos$" -v -test.parallel=10 -timeout 60m -count=1 -json + test_env_vars: + TEST_SUITE: chaos + + # END: OCR tests + + # START: Automation tests + + - id: smoke/automation_test.go:^TestAutomationBasic/registry_2_0|TestAutomationBasic/registry_2_1_conditional|TestAutomationBasic/registry_2_1_logtrigger$ + path: integration-tests/smoke/automation_test.go + test_env_type: docker + runs_on: ubuntu-latest + triggers: + - PR E2E Core Tests + - Merge Queue E2E Core Tests + - Nightly E2E Tests + test_cmd: cd integration-tests/smoke && go test -test.run "^TestAutomationBasic/registry_2_0|TestAutomationBasic/registry_2_1_conditional|TestAutomationBasic/registry_2_1_logtrigger$" -test.parallel=3 -timeout 30m -count=1 -json + pyroscope_env: ci-smoke-automation-evm-simulated + + - id: smoke/automation_test.go:^TestAutomationBasic/registry_2_1_with_mercury_v02|TestAutomationBasic/registry_2_1_with_mercury_v03|TestAutomationBasic/registry_2_1_with_logtrigger_and_mercury_v02$ + path: integration-tests/smoke/automation_test.go + test_env_type: docker + runs_on: ubuntu-latest + triggers: + - PR E2E Core Tests + - Merge Queue E2E Core Tests + - Nightly E2E Tests + test_cmd: cd integration-tests/smoke && go test -test.run "^TestAutomationBasic/registry_2_1_with_mercury_v02|TestAutomationBasic/registry_2_1_with_mercury_v03|TestAutomationBasic/registry_2_1_with_logtrigger_and_mercury_v02$" -test.parallel=3 -timeout 30m -count=1 -json + pyroscope_env: ci-smoke-automation-evm-simulated + + - id: smoke/automation_test.go:^TestAutomationBasic/registry_2_2_conditional|TestAutomationBasic/registry_2_2_logtrigger|TestAutomationBasic/registry_2_2_with_mercury_v02$ + path: integration-tests/smoke/automation_test.go + test_env_type: docker + runs_on: ubuntu-latest + triggers: + - PR E2E Core Tests + - Merge Queue E2E Core Tests + - Nightly E2E Tests + test_cmd: cd integration-tests/smoke && go test -test.run "^TestAutomationBasic/registry_2_2_conditional|TestAutomationBasic/registry_2_2_logtrigger|TestAutomationBasic/registry_2_2_with_mercury_v02$" -test.parallel=3 -timeout 30m -count=1 -json + pyroscope_env: ci-smoke-automation-evm-simulated + + - id: smoke/automation_test.go:^TestAutomationBasic/registry_2_2_with_mercury_v03|TestAutomationBasic/registry_2_2_with_logtrigger_and_mercury_v02$ + path: integration-tests/smoke/automation_test.go + test_env_type: docker + runs_on: ubuntu-latest + triggers: + - PR E2E Core Tests + - Merge Queue E2E Core Tests + - Nightly E2E Tests + test_cmd: cd integration-tests/smoke && go test -test.run "^TestAutomationBasic/registry_2_2_with_mercury_v03|TestAutomationBasic/registry_2_2_with_logtrigger_and_mercury_v02$" -test.parallel=2 -timeout 30m -count=1 -json + pyroscope_env: ci-smoke-automation-evm-simulated + + - id: smoke/automation_test.go:^TestAutomationBasic/registry_2_3_conditional_native|TestAutomationBasic/registry_2_3_conditional_link$ + path: integration-tests/smoke/automation_test.go + test_env_type: docker + runs_on: ubuntu-latest + triggers: + - PR E2E Core Tests + - Merge Queue E2E Core Tests + - Nightly E2E Tests + test_cmd: cd integration-tests/smoke && go test -test.run "^TestAutomationBasic/registry_2_3_conditional_native|TestAutomationBasic/registry_2_3_conditional_link$" -test.parallel=2 -timeout 30m -count=1 -json + pyroscope_env: ci-smoke-automation-evm-simulated + + - id: smoke/automation_test.go:^TestAutomationBasic/registry_2_3_logtrigger_native|TestAutomationBasic/registry_2_3_logtrigger_link$ + path: integration-tests/smoke/automation_test.go + test_env_type: docker + runs_on: ubuntu-latest + triggers: + - PR E2E Core Tests + - Merge Queue E2E Core Tests + - Nightly E2E Tests + test_cmd: cd integration-tests/smoke && go test -test.run "^TestAutomationBasic/registry_2_3_logtrigger_native|TestAutomationBasic/registry_2_3_logtrigger_link$" -test.parallel=2 -timeout 30m -count=1 -json + pyroscope_env: ci-smoke-automation-evm-simulated + + - id: smoke/automation_test.go:^TestAutomationBasic/registry_2_3_with_mercury_v03_link|TestAutomationBasic/registry_2_3_with_logtrigger_and_mercury_v02_link$ + path: integration-tests/smoke/automation_test.go + test_env_type: docker + runs_on: ubuntu-latest + triggers: + - PR E2E Core Tests + - Merge Queue E2E Core Tests + - Nightly E2E Tests + test_cmd: cd integration-tests/smoke && go test -test.run "^TestAutomationBasic/registry_2_3_with_mercury_v03_link|TestAutomationBasic/registry_2_3_with_logtrigger_and_mercury_v02_link$" -test.parallel=2 -timeout 30m -count=1 -json + pyroscope_env: ci-smoke-automation-evm-simulated + + - id: smoke/automation_test.go:^TestSetUpkeepTriggerConfig$ + path: integration-tests/smoke/automation_test.go + test_env_type: docker + runs_on: ubuntu-latest + triggers: + - PR E2E Core Tests + - Merge Queue E2E Core Tests + - Nightly E2E Tests + test_cmd: cd integration-tests/smoke && go test -test.run ^TestSetUpkeepTriggerConfig$ -test.parallel=2 -timeout 30m -count=1 -json + pyroscope_env: ci-smoke-automation-evm-simulated + + - id: smoke/automation_test.go:^TestAutomationAddFunds$ + path: integration-tests/smoke/automation_test.go + test_env_type: docker + runs_on: ubuntu-latest + triggers: + - PR E2E Core Tests + - Merge Queue E2E Core Tests + - Nightly E2E Tests + test_cmd: cd integration-tests/smoke && go test -test.run ^TestAutomationAddFunds$ -test.parallel=3 -timeout 30m -count=1 -json + pyroscope_env: ci-smoke-automation-evm-simulated + + - id: smoke/automation_test.go:^TestAutomationPauseUnPause$ + path: integration-tests/smoke/automation_test.go + test_env_type: docker + runs_on: ubuntu-latest + triggers: + - PR E2E Core Tests + - Merge Queue E2E Core Tests + - Nightly E2E Tests + test_cmd: cd integration-tests/smoke && go test -test.run ^TestAutomationPauseUnPause$ -test.parallel=3 -timeout 30m -count=1 -json + pyroscope_env: ci-smoke-automation-evm-simulated + + - id: smoke/automation_test.go:^TestAutomationRegisterUpkeep$ + path: integration-tests/smoke/automation_test.go + test_env_type: docker + runs_on: ubuntu-latest + triggers: + - PR E2E Core Tests + - Merge Queue E2E Core Tests + - Nightly E2E Tests + test_cmd: cd integration-tests/smoke && go test -test.run ^TestAutomationRegisterUpkeep$ -test.parallel=3 -timeout 30m -count=1 -json + pyroscope_env: ci-smoke-automation-evm-simulated + + - id: smoke/automation_test.go:^TestAutomationPauseRegistry$ + path: integration-tests/smoke/automation_test.go + test_env_type: docker + runs_on: ubuntu-latest + triggers: + - PR E2E Core Tests + - Merge Queue E2E Core Tests + - Nightly E2E Tests + test_cmd: cd integration-tests/smoke && go test -test.run ^TestAutomationPauseRegistry$ -test.parallel=3 -timeout 30m -count=1 -json + pyroscope_env: ci-smoke-automation-evm-simulated + + - id: smoke/automation_test.go:^TestAutomationKeeperNodesDown$ + path: integration-tests/smoke/automation_test.go + test_env_type: docker + runs_on: ubuntu-latest + triggers: + - PR E2E Core Tests + - Merge Queue E2E Core Tests + - Nightly E2E Tests + test_cmd: cd integration-tests/smoke && go test -test.run ^TestAutomationKeeperNodesDown$ -test.parallel=3 -timeout 30m -count=1 -json + pyroscope_env: ci-smoke-automation-evm-simulated + + - id: smoke/automation_test.go:^TestAutomationPerformSimulation$ + path: integration-tests/smoke/automation_test.go + test_env_type: docker + runs_on: ubuntu-latest + triggers: + - PR E2E Core Tests + - Merge Queue E2E Core Tests + - Nightly E2E Tests + test_cmd: cd integration-tests/smoke && go test -test.run ^TestAutomationPerformSimulation$ -test.parallel=3 -timeout 30m -count=1 -json + pyroscope_env: ci-smoke-automation-evm-simulated + + - id: smoke/automation_test.go:^TestAutomationCheckPerformGasLimit$ + path: integration-tests/smoke/automation_test.go + test_env_type: docker + runs_on: ubuntu-latest + triggers: + - PR E2E Core Tests + - Merge Queue E2E Core Tests + - Nightly E2E Tests + test_cmd: cd integration-tests/smoke && go test -test.run ^TestAutomationCheckPerformGasLimit$ -test.parallel=3 -timeout 30m -count=1 -json + pyroscope_env: ci-smoke-automation-evm-simulated + + - id: smoke/automation_test.go:^TestUpdateCheckData$ + path: integration-tests/smoke/automation_test.go + test_env_type: docker + runs_on: ubuntu-latest + triggers: + - PR E2E Core Tests + - Merge Queue E2E Core Tests + - Nightly E2E Tests + test_cmd: cd integration-tests/smoke && go test -test.run ^TestUpdateCheckData$ -test.parallel=3 -timeout 30m -count=1 -json + pyroscope_env: ci-smoke-automation-evm-simulated + + - id: smoke/automation_test.go:^TestSetOffchainConfigWithMaxGasPrice$ + path: integration-tests/smoke/automation_test.go + test_env_type: docker + runs_on: ubuntu-latest + triggers: + - PR E2E Core Tests + - Merge Queue E2E Core Tests + - Nightly E2E Tests + test_cmd: cd integration-tests/smoke && go test -test.run ^TestSetOffchainConfigWithMaxGasPrice$ -test.parallel=2 -timeout 30m -count=1 -json + pyroscope_env: ci-smoke-automation-evm-simulated + + - id: smoke/keeper_test.go:^TestKeeperBasicSmoke$ + path: integration-tests/smoke/keeper_test.go + test_env_type: docker + runs_on: ubuntu-latest + triggers: + - Merge Queue E2E Core Tests + - Nightly E2E Tests + test_cmd: cd integration-tests/smoke && go test -test.run ^TestKeeperBasicSmoke$ -test.parallel=3 -timeout 30m -count=1 -json + pyroscope_env: ci-smoke-keeper-evm-simulated + + - id: smoke/keeper_test.go:^TestKeeperBlockCountPerTurn$ + path: integration-tests/smoke/keeper_test.go + test_env_type: docker + runs_on: ubuntu-latest + triggers: + - Merge Queue E2E Core Tests + - Nightly E2E Tests + test_cmd: cd integration-tests/smoke && go test -test.run ^TestKeeperBlockCountPerTurn$ -test.parallel=3 -timeout 30m -count=1 -json + pyroscope_env: ci-smoke-keeper-evm-simulated + + - id: smoke/keeper_test.go:^TestKeeperSimulation$ + path: integration-tests/smoke/keeper_test.go + test_env_type: docker + runs_on: ubuntu-latest + triggers: + - Merge Queue E2E Core Tests + - Nightly E2E Tests + test_cmd: cd integration-tests/smoke && go test -test.run ^TestKeeperSimulation$ -test.parallel=2 -timeout 30m -count=1 -json + pyroscope_env: ci-smoke-keeper-evm-simulated + + - id: smoke/keeper_test.go:^TestKeeperCheckPerformGasLimit$ + path: integration-tests/smoke/keeper_test.go + test_env_type: docker + runs_on: ubuntu-latest + triggers: + - Merge Queue E2E Core Tests + - Nightly E2E Tests + test_cmd: cd integration-tests/smoke && go test -test.run ^TestKeeperCheckPerformGasLimit$ -test.parallel=2 -timeout 30m -count=1 -json + pyroscope_env: ci-smoke-keeper-evm-simulated + + - id: smoke/keeper_test.go:^TestKeeperRegisterUpkeep$ + path: integration-tests/smoke/keeper_test.go + test_env_type: docker + runs_on: ubuntu-latest + triggers: + - Merge Queue E2E Core Tests + - Nightly E2E Tests + test_cmd: cd integration-tests/smoke && go test -test.run ^TestKeeperRegisterUpkeep$ -test.parallel=3 -timeout 30m -count=1 -json + pyroscope_env: ci-smoke-keeper-evm-simulated + + - id: smoke/keeper_test.go:^TestKeeperAddFunds$ + path: integration-tests/smoke/keeper_test.go + test_env_type: docker + runs_on: ubuntu-latest + triggers: + - Merge Queue E2E Core Tests + - Nightly E2E Tests + test_cmd: cd integration-tests/smoke && go test -test.run ^TestKeeperAddFunds$ -test.parallel=3 -timeout 30m -count=1 -json + pyroscope_env: ci-smoke-keeper-evm-simulated + + - id: smoke/keeper_test.go:^TestKeeperRemove$ + path: integration-tests/smoke/keeper_test.go + test_env_type: docker + runs_on: ubuntu-latest + triggers: + - Merge Queue E2E Core Tests + - Nightly E2E Tests + test_cmd: cd integration-tests/smoke && go test -test.run ^TestKeeperRemove$ -test.parallel=3 -timeout 30m -count=1 -json + pyroscope_env: ci-smoke-keeper-evm-simulated + + - id: smoke/keeper_test.go:^TestKeeperPauseRegistry$ + path: integration-tests/smoke/keeper_test.go + test_env_type: docker + runs_on: ubuntu-latest + triggers: + - Merge Queue E2E Core Tests + - Nightly E2E Tests + test_cmd: cd integration-tests/smoke && go test -test.run ^TestKeeperPauseRegistry$ -test.parallel=2 -timeout 30m -count=1 -json + pyroscope_env: ci-smoke-keeper-evm-simulated + + - id: smoke/keeper_test.go:^TestKeeperMigrateRegistry$ + path: integration-tests/smoke/keeper_test.go + test_env_type: docker + runs_on: ubuntu-latest + triggers: + - Merge Queue E2E Core Tests + - Nightly E2E Tests + test_cmd: cd integration-tests/smoke && go test -test.run ^TestKeeperMigrateRegistry$ -test.parallel=1 -timeout 30m -count=1 -json + pyroscope_env: ci-smoke-keeper-evm-simulated + + - id: smoke/keeper_test.go:^TestKeeperNodeDown$ + path: integration-tests/smoke/keeper_test.go + test_env_type: docker + runs_on: ubuntu-latest + triggers: + - Merge Queue E2E Core Tests + - Nightly E2E Tests + test_cmd: cd integration-tests/smoke && go test -test.run ^TestKeeperNodeDown$ -test.parallel=3 -timeout 30m -count=1 -json + pyroscope_env: ci-smoke-keeper-evm-simulated + + - id: smoke/keeper_test.go:^TestKeeperPauseUnPauseUpkeep$ + path: integration-tests/smoke/keeper_test.go + test_env_type: docker + runs_on: ubuntu-latest + triggers: + - Merge Queue E2E Core Tests + - Nightly E2E Tests + test_cmd: cd integration-tests/smoke && go test -test.run ^TestKeeperPauseUnPauseUpkeep$ -test.parallel=1 -timeout 30m -count=1 -json + pyroscope_env: ci-smoke-keeper-evm-simulated + + - id: smoke/keeper_test.go:^TestKeeperUpdateCheckData$ + path: integration-tests/smoke/keeper_test.go + test_env_type: docker + runs_on: ubuntu-latest + triggers: + - Merge Queue E2E Core Tests + - Nightly E2E Tests + test_cmd: cd integration-tests/smoke && go test -test.run ^TestKeeperUpdateCheckData$ -test.parallel=1 -timeout 30m -count=1 -json + pyroscope_env: ci-smoke-keeper-evm-simulated + + - id: smoke/keeper_test.go:^TestKeeperJobReplacement$ + path: integration-tests/smoke/keeper_test.go + test_env_type: docker + runs_on: ubuntu-latest + triggers: + - Merge Queue E2E Core Tests + - Nightly E2E Tests + test_cmd: cd integration-tests/smoke && go test -test.run ^TestKeeperJobReplacement$ -test.parallel=1 -timeout 30m -count=1 -json + pyroscope_env: ci-smoke-keeper-evm-simulated + + - id: load/automationv2_1/automationv2_1_test.go:TestLogTrigger + path: integration-tests/load/automationv2_1/automationv2_1_test.go + runs_on: ubuntu-latest + test_env_type: k8s-remote-runner + test_cmd: cd integration-tests/load/automationv2_1 && go test -test.run TestLogTrigger -test.parallel=1 -timeout 60m -count=1 -json + remote_runner_memory: 4Gi + test_secrets_required: true + test_env_vars: + TEST_LOG_LEVEL: info + TEST_SUITE: automationv2_1 + pyroscope_env: automation-load-test + + - id: smoke/automation_upgrade_test.go:^TestAutomationNodeUpgrade/registry_2_0 + path: integration-tests/smoke/automation_upgrade_test.go + test_env_type: docker + runs_on: ubuntu22.04-8cores-32GB + triggers: + - Automation Nightly Tests + test_cmd: cd integration-tests/smoke && go test -test.run ^TestAutomationNodeUpgrade/registry_2_0 -test.parallel=1 -timeout 60m -count=1 -json + test_env_vars: + E2E_TEST_CHAINLINK_IMAGE: public.ecr.aws/chainlink/chainlink + E2E_TEST_CHAINLINK_VERSION: latest + E2E_TEST_CHAINLINK_UPGRADE_IMAGE: '{{ env.QA_CHAINLINK_IMAGE }}' + E2E_TEST_CHAINLINK_UPGRADE_VERSION: '{{ env.DEFAULT_CHAINLINK_UPGRADE_VERSION }}' + pyroscope_env: ci-smoke-automation-upgrade-tests + + - id: smoke/automation_upgrade_test.go:^TestAutomationNodeUpgrade/registry_2_1 + path: integration-tests/smoke/automation_upgrade_test.go + test_env_type: docker + runs_on: ubuntu22.04-8cores-32GB + triggers: + - Automation Nightly Tests + test_cmd: cd integration-tests/smoke && go test -test.run ^TestAutomationNodeUpgrade/registry_2_1 -test.parallel=5 -timeout 60m -count=1 -json + test_env_vars: + E2E_TEST_CHAINLINK_IMAGE: public.ecr.aws/chainlink/chainlink + E2E_TEST_CHAINLINK_VERSION: latest + E2E_TEST_CHAINLINK_UPGRADE_IMAGE: '{{ env.QA_CHAINLINK_IMAGE }}' + E2E_TEST_CHAINLINK_UPGRADE_VERSION: '{{ env.DEFAULT_CHAINLINK_UPGRADE_VERSION }}' + pyroscope_env: ci-smoke-automation-upgrade-tests + + - id: smoke/automation_upgrade_test.go:^TestAutomationNodeUpgrade/registry_2_2 + path: integration-tests/smoke/automation_upgrade_test.go + test_env_type: docker + runs_on: ubuntu22.04-8cores-32GB + triggers: + - Automation Nightly Tests + test_cmd: cd integration-tests/smoke && go test -test.run ^TestAutomationNodeUpgrade/registry_2_2 -test.parallel=5 -timeout 60m -count=1 -json + test_env_vars: + E2E_TEST_CHAINLINK_IMAGE: public.ecr.aws/chainlink/chainlink + E2E_TEST_CHAINLINK_VERSION: latest + E2E_TEST_CHAINLINK_UPGRADE_IMAGE: '{{ env.QA_CHAINLINK_IMAGE }}' + E2E_TEST_CHAINLINK_UPGRADE_VERSION: '{{ env.DEFAULT_CHAINLINK_UPGRADE_VERSION }}' + pyroscope_env: ci-smoke-automation-upgrade-tests + + - id: reorg/automation_reorg_test.go^TestAutomationReorg/registry_2_0 + path: integration-tests/reorg/automation_reorg_test.go + runs_on: ubuntu-latest + test_env_type: docker + test_env_vars: + TEST_SUITE: reorg + triggers: + - Automation On Demand Tests + test_cmd: cd integration-tests/reorg && DETACH_RUNNER=false go test -v -test.run ^TestAutomationReorg/registry_2_0 -test.parallel=1 -timeout 30m -count=1 -json + pyroscope_env: ci-automation-on-demand-reorg + + - id: reorg/automation_reorg_test.go^TestAutomationReorg/registry_2_1 + path: integration-tests/reorg/automation_reorg_test.go + runs_on: ubuntu-latest + test_env_type: docker + test_env_vars: + TEST_SUITE: reorg + triggers: + - Automation On Demand Tests + test_cmd: cd integration-tests/reorg && DETACH_RUNNER=false go test -v -test.run ^TestAutomationReorg/registry_2_1 -test.parallel=2 -timeout 30m -count=1 -json + pyroscope_env: ci-automation-on-demand-reorg + + - id: reorg/automation_reorg_test.go^TestAutomationReorg/registry_2_2 + path: integration-tests/reorg/automation_reorg_test.go + runs_on: ubuntu-latest + test_env_type: docker + test_env_vars: + TEST_SUITE: reorg + triggers: + - Automation On Demand Tests + test_cmd: cd integration-tests/reorg && DETACH_RUNNER=false go test -v -test.run ^TestAutomationReorg/registry_2_2 -test.parallel=2 -timeout 30m -count=1 -json + pyroscope_env: ci-automation-on-demand-reorg + + - id: reorg/automation_reorg_test.go^TestAutomationReorg/registry_2_3 + path: integration-tests/reorg/automation_reorg_test.go + runs_on: ubuntu-latest + test_env_type: docker + test_env_vars: + TEST_SUITE: reorg + triggers: + - Automation On Demand Tests + test_cmd: cd integration-tests/reorg && DETACH_RUNNER=false go test -v -test.run ^TestAutomationReorg/registry_2_3 -test.parallel=2 -timeout 30m -count=1 -json + pyroscope_env: ci-automation-on-demand-reorg + + - id: chaos/automation_chaos_test.go + path: integration-tests/chaos/automation_chaos_test.go + test_env_type: k8s-remote-runner + runs_on: ubuntu-latest + triggers: + - Automation On Demand Tests + - E2E Chaos Tests + test_cmd: cd integration-tests/chaos && DETACH_RUNNER=false go test -v -test.run ^TestAutomationChaos$ -test.parallel=20 -timeout 60m -count=1 -json + pyroscope_env: ci-automation-on-demand-chaos + test_env_vars: + TEST_SUITE: chaos + + - id: benchmark/automation_test.go:TestAutomationBenchmark + path: integration-tests/benchmark/automation_test.go + test_env_type: k8s-remote-runner + remote_runner_memory: 4Gi + runs_on: ubuntu-latest + # triggers: + # - Nightly E2E Tests + test_cmd: cd integration-tests/benchmark && go test -v -test.run ^TestAutomationBenchmark$ -test.parallel=1 -timeout 30m -count=1 -json + pyroscope_env: ci-benchmark-automation-nightly + test_env_vars: + TEST_LOG_LEVEL: info + TEST_SUITE: benchmark + TEST_TYPE: benchmark + + - id: soak/automation_test.go:TestAutomationBenchmark + path: integration-tests/benchmark/automation_test.go + test_env_type: k8s-remote-runner + remote_runner_memory: 4Gi + runs_on: ubuntu-latest + # triggers: + # - Nightly E2E Tests + test_cmd: cd integration-tests/benchmark && go test -v -test.run ^TestAutomationBenchmark$ -test.parallel=1 -timeout 30m -count=1 -json + pyroscope_env: ci-benchmark-automation-nightly + test_env_vars: + TEST_LOG_LEVEL: info + TEST_SUITE: benchmark + TEST_TYPE: soak + + # END: Automation tests + + # START: VRF tests + + - id: smoke/vrfv2_test.go:TestVRFv2Basic + path: integration-tests/smoke/vrfv2_test.go + runs_on: ubuntu22.04-8cores-32GB + test_env_type: docker + test_cmd: cd integration-tests/smoke && go test -v -test.run TestVRFv2Basic -test.parallel=1 -timeout 30m -count=1 -json + test_secrets_required: true + triggers: + - On Demand VRFV2 Smoke Test (Ethereum clients) + + - id: load/vrfv2plus/vrfv2plus_test.go:^TestVRFV2PlusPerformance$Smoke + path: integration-tests/load/vrfv2plus/vrfv2plus_test.go + runs_on: ubuntu22.04-8cores-32GB + test_env_type: docker + test_cmd: cd integration-tests/load/vrfv2plus && go test -v -test.run ^TestVRFV2PlusPerformance$ -test.parallel=1 -timeout 24h -count=1 -json + test_config_override_required: true + test_secrets_required: true + test_env_vars: + TEST_TYPE: Smoke + triggers: + - On Demand VRFV2 Plus Performance Test + + - id: load/vrfv2plus/vrfv2plus_test.go:^TestVRFV2PlusBHSPerformance$Smoke + path: integration-tests/load/vrfv2plus/vrfv2plus_test.go + runs_on: ubuntu22.04-8cores-32GB + test_env_type: docker + test_cmd: cd integration-tests/load/vrfv2plus && go test -v -test.run ^TestVRFV2PlusBHSPerformance$ -test.parallel=1 -timeout 24h -count=1 -json + test_config_override_required: true + test_secrets_required: true + test_env_vars: + TEST_TYPE: Smoke + triggers: + - On Demand VRFV2 Plus Performance Test + + - id: load/vrfv2/vrfv2_test.go:^TestVRFV2Performance$Smoke + path: integration-tests/load/vrfv2/vrfv2_test.go + runs_on: ubuntu22.04-8cores-32GB + test_env_type: docker + test_cmd: cd integration-tests/load/vrfv2 && go test -v -test.run ^TestVRFV2Performance$ -test.parallel=1 -timeout 24h -count=1 -json + test_config_override_required: true + test_secrets_required: true + test_env_vars: + TEST_TYPE: Smoke + triggers: + - On Demand VRFV2 Performance Test + + - id: load/vrfv2/vrfv2_test.go:^TestVRFV2PlusBHSPerformance$Smoke + path: integration-tests/load/vrfv2/vrfv2_test.go + runs_on: ubuntu22.04-8cores-32GB + test_env_type: docker + test_cmd: cd integration-tests/load/vrfv2 && go test -v -test.run ^TestVRFV2PlusBHSPerformance$ -test.parallel=1 -timeout 24h -count=1 -json + test_config_override_required: true + test_secrets_required: true + test_env_vars: + TEST_TYPE: Smoke + triggers: + - On Demand VRFV2 Performance Test + + - id: smoke/vrf_test.go:* + path: integration-tests/smoke/vrf_test.go + test_env_type: docker + runs_on: ubuntu-latest + triggers: + - PR E2E Core Tests + - Merge Queue E2E Core Tests + - Nightly E2E Tests + test_cmd: cd integration-tests/ && go test smoke/vrf_test.go -timeout 30m -count=1 -test.parallel=2 -json + pyroscope_env: ci-smoke-vrf-evm-simulated + + - id: smoke/vrfv2_test.go:* + path: integration-tests/smoke/vrfv2_test.go + test_env_type: docker + runs_on: ubuntu-latest + triggers: + - PR E2E Core Tests + - Merge Queue E2E Core Tests + - Nightly E2E Tests + test_cmd: cd integration-tests/ && go test smoke/vrfv2_test.go -timeout 30m -count=1 -test.parallel=6 -json + pyroscope_env: ci-smoke-vrf2-evm-simulated + + - id: smoke/vrfv2plus_test.go:* + path: integration-tests/smoke/vrfv2plus_test.go + test_env_type: docker + runs_on: ubuntu-latest + triggers: + - PR E2E Core Tests + - Merge Queue E2E Core Tests + - Nightly E2E Tests + test_cmd: cd integration-tests/ && go test smoke/vrfv2plus_test.go -timeout 30m -count=1 -test.parallel=9 -json + pyroscope_env: ci-smoke-vrf2plus-evm-simulated + + # VRFv2Plus tests on any live testnet (test_config_override_path required) + # Tests have to run in sequence because of a single private key used + - id: TestVRFv2Plus_LiveTestnets + path: integration-tests/smoke/vrfv2plus_test.go + runs_on: ubuntu-latest + test_env_type: docker + test_cmd: cd integration-tests/smoke && go test -v -test.run "TestVRFv2Plus$/(Link_Billing|Native_Billing|Direct_Funding)|TestVRFV2PlusWithBHS" -test.parallel=1 -timeout 2h -count=1 -json + + # VRFv2Plus release tests on Sepolia testnet + - id: TestVRFv2Plus_Release_Sepolia + path: integration-tests/smoke/vrfv2plus_test.go + runs_on: ubuntu-latest + test_env_type: docker + test_cmd: cd integration-tests/smoke && go test -v -test.run "TestVRFv2Plus$/(Link_Billing|Native_Billing|Direct_Funding)|TestVRFV2PlusWithBHS" -test.parallel=1 -timeout 2h -count=1 -json + test_config_override_path: integration-tests/testconfig/vrfv2plus/overrides/new_env/sepolia_new_env_test_config.toml + triggers: + - VRF E2E Release Tests + + # END: VRF tests + + # START: LogPoller tests + + - id: smoke/log_poller_test.go:^TestLogPollerFewFiltersFixedDepth$ + path: integration-tests/smoke/log_poller_test.go + test_env_type: docker + runs_on: ubuntu-latest + triggers: + - PR E2E Core Tests + - Merge Queue E2E Core Tests + - Nightly E2E Tests + test_cmd: cd integration-tests/smoke && go test -test.run ^TestLogPollerFewFiltersFixedDepth$ -test.parallel=1 -timeout 30m -count=1 -json + pyroscope_env: ci-smoke-log_poller-evm-simulated + + - id: smoke/log_poller_test.go:^TestLogPollerFewFiltersFinalityTag$ + path: integration-tests/smoke/log_poller_test.go + test_env_type: docker + runs_on: ubuntu-latest + triggers: + - PR E2E Core Tests + - Merge Queue E2E Core Tests + - Nightly E2E Tests + test_cmd: cd integration-tests/smoke && go test -test.run ^TestLogPollerFewFiltersFinalityTag$ -test.parallel=1 -timeout 30m -count=1 -json + pyroscope_env: ci-smoke-log_poller-evm-simulated + + - id: smoke/log_poller_test.go:^TestLogPollerWithChaosFixedDepth$ + path: integration-tests/smoke/log_poller_test.go + test_env_type: docker + runs_on: ubuntu-latest + triggers: + - PR E2E Core Tests + - Merge Queue E2E Core Tests + - Nightly E2E Tests + test_cmd: cd integration-tests/smoke && go test -test.run ^TestLogPollerWithChaosFixedDepth$ -test.parallel=1 -timeout 30m -count=1 -json + pyroscope_env: ci-smoke-log_poller-evm-simulated + + - id: smoke/log_poller_test.go:^TestLogPollerWithChaosFinalityTag$ + path: integration-tests/smoke/log_poller_test.go + test_env_type: docker + runs_on: ubuntu-latest + triggers: + - PR E2E Core Tests + - Merge Queue E2E Core Tests + - Nightly E2E Tests + test_cmd: cd integration-tests/smoke && go test -test.run ^TestLogPollerWithChaosFinalityTag$ -test.parallel=1 -timeout 30m -count=1 -json + pyroscope_env: ci-smoke-log_poller-evm-simulated + + - id: smoke/log_poller_test.go:^TestLogPollerWithChaosPostgresFinalityTag$ + path: integration-tests/smoke/log_poller_test.go + test_env_type: docker + runs_on: ubuntu-latest + triggers: + - PR E2E Core Tests + - Merge Queue E2E Core Tests + - Nightly E2E Tests + test_cmd: cd integration-tests/smoke && go test -test.run ^TestLogPollerWithChaosPostgresFinalityTag$ -test.parallel=1 -timeout 30m -count=1 -json + pyroscope_env: ci-smoke-log_poller-evm-simulated + + - id: smoke/log_poller_test.go:^TestLogPollerWithChaosPostgresFixedDepth$ + path: integration-tests/smoke/log_poller_test.go + test_env_type: docker + runs_on: ubuntu-latest + triggers: + - PR E2E Core Tests + - Merge Queue E2E Core Tests + - Nightly E2E Tests + test_cmd: cd integration-tests/smoke && go test -test.run ^TestLogPollerWithChaosPostgresFixedDepth$ -test.parallel=1 -timeout 30m -count=1 -json + pyroscope_env: ci-smoke-log_poller-evm-simulated + + - id: smoke/log_poller_test.go:^TestLogPollerReplayFixedDepth$ + path: integration-tests/smoke/log_poller_test.go + test_env_type: docker + runs_on: ubuntu-latest + triggers: + - PR E2E Core Tests + - Merge Queue E2E Core Tests + - Nightly E2E Tests + test_cmd: cd integration-tests/smoke && go test -test.run ^TestLogPollerReplayFixedDepth$ -test.parallel=1 -timeout 30m -count=1 -json + pyroscope_env: ci-smoke-log_poller-evm-simulated + + - id: smoke/log_poller_test.go:^TestLogPollerReplayFinalityTag$ + path: integration-tests/smoke/log_poller_test.go + test_env_type: docker + runs_on: ubuntu-latest + triggers: + - PR E2E Core Tests + - Merge Queue E2E Core Tests + - Nightly E2E Tests + test_cmd: cd integration-tests/smoke && go test -test.run ^TestLogPollerReplayFinalityTag$ -test.parallel=1 -timeout 30m -count=1 -json + pyroscope_env: ci-smoke-log_poller-evm-simulated + + # END: LogPoller tests + + # START: Other tests + + - id: smoke/runlog_test.go:* + path: integration-tests/smoke/runlog_test.go + test_env_type: docker + runs_on: ubuntu-latest + triggers: + - PR E2E Core Tests + - Merge Queue E2E Core Tests + - Nightly E2E Tests + test_cmd: cd integration-tests/ && go test smoke/runlog_test.go -timeout 30m -test.parallel=2 -count=1 -json + pyroscope_env: ci-smoke-runlog-evm-simulated + + - id: smoke/cron_test.go:* + path: integration-tests/smoke/cron_test.go + test_env_type: docker + runs_on: ubuntu-latest + triggers: + - PR E2E Core Tests + - Merge Queue E2E Core Tests + - Nightly E2E Tests + test_cmd: cd integration-tests/ && go test smoke/cron_test.go -timeout 30m -count=1 -json + pyroscope_env: ci-smoke-cron-evm-simulated + + - id: smoke/flux_test.go:* + path: integration-tests/smoke/flux_test.go + test_env_type: docker + runs_on: ubuntu-latest + triggers: + - PR E2E Core Tests + - Merge Queue E2E Core Tests + - Nightly E2E Tests + test_cmd: cd integration-tests/ && go test smoke/flux_test.go -timeout 30m -count=1 -json + pyroscope_env: ci-smoke-flux-evm-simulated + + - id: smoke/reorg_above_finality_test.go:* + path: integration-tests/smoke/reorg_above_finality_test.go + test_env_type: docker + runs_on: ubuntu-latest + triggers: + - PR E2E Core Tests + - Merge Queue E2E Core Tests + - Nightly E2E Tests + test_cmd: cd integration-tests/ && go test smoke/reorg_above_finality_test.go -timeout 30m -count=1 -json + pyroscope_env: ci-smoke-reorg-above-finality-evm-simulated + + - id: migration/upgrade_version_test.go:* + path: integration-tests/migration/upgrade_version_test.go + test_env_type: docker + runs_on: ubuntu-latest + triggers: + - PR E2E Core Tests + - Merge Queue E2E Core Tests + - Nightly E2E Tests + test_cmd: cd integration-tests/migration && go test upgrade_version_test.go -timeout 30m -count=1 -test.parallel=2 -json + test_env_vars: + E2E_TEST_CHAINLINK_IMAGE: public.ecr.aws/chainlink/chainlink + E2E_TEST_CHAINLINK_VERSION: '{{ env.LATEST_CHAINLINK_RELEASE_VERSION }}' + E2E_TEST_CHAINLINK_UPGRADE_IMAGE: '{{ env.QA_CHAINLINK_IMAGE }}' + E2E_TEST_CHAINLINK_UPGRADE_VERSION: '{{ env.DEFAULT_CHAINLINK_VERSION }}' + + - id: smoke/job_distributor_test.go:* + path: integration-tests/smoke/job_distributor_test.go + test_env_type: docker + runs_on: ubuntu-latest + triggers: + - PR E2E Core Tests + - Merge Queue E2E Core Tests + - Nightly E2E Tests + test_cmd: cd integration-tests/ && go test smoke/job_distributor_test.go -timeout 30m -count=1 -json + pyroscope_env: ci-smoke-jd-evm-simulated + + # END: Other tests + + # START: CCIPv1.6 tests + + - id: smoke/ccip_test.go:* + path: integration-tests/smoke/ccip_test.go + test_env_type: docker + runs_on: ubuntu-latest + triggers: + - PR E2E Core Tests + - Merge Queue E2E Core Tests + - Nightly E2E Tests + test_cmd: cd integration-tests/ && go test smoke/ccip_test.go -timeout 12m -test.parallel=1 -count=1 -json + pyroscope_env: ci-smoke-ccipv1_6-evm-simulated + test_env_vars: + E2E_TEST_SELECTED_NETWORK: SIMULATED_1,SIMULATED_2 + E2E_JD_VERSION: 0.4.0 + + # END: CCIPv1.6 tests + + # START: CCIP tests + + - id: ccip-smoke + path: integration-tests/ccip-tests/smoke/ccip_test.go + test_env_type: docker + runs_on: ubuntu-latest + triggers: + - PR E2E CCIP Tests + - Merge Queue E2E CCIP Tests + - Nightly E2E Tests + test_cmd: cd integration-tests/ccip-tests/smoke && go test ccip_test.go -test.run ^TestSmokeCCIPForBidirectionalLane$ -timeout 30m -count=1 -test.parallel=1 -json + test_env_vars: + E2E_TEST_SELECTED_NETWORK: SIMULATED_1,SIMULATED_2 + + - id: ccip-smoke-1.4-pools + path: integration-tests/ccip-tests/smoke/ccip_test.go + test_env_type: docker + runs_on: ubuntu-latest + triggers: + - PR E2E CCIP Tests + - Merge Queue E2E CCIP Tests + - Nightly E2E Tests + test_cmd: cd integration-tests/ccip-tests/smoke && go test ccip_test.go -test.run ^TestSmokeCCIPForBidirectionalLane$ -timeout 30m -count=1 -test.parallel=1 -json + test_env_vars: + E2E_TEST_SELECTED_NETWORK: SIMULATED_1,SIMULATED_2 + test_config_override_path: integration-tests/ccip-tests/testconfig/tomls/contract-version1.4.toml + + - id: ccip-smoke-usdc + path: integration-tests/ccip-tests/smoke/ccip_test.go + test_env_type: docker + runs_on: ubuntu-latest + triggers: + - PR E2E CCIP Tests + - Merge Queue E2E CCIP Tests + - Nightly E2E Tests + test_cmd: cd integration-tests/ccip-tests/smoke && go test ccip_test.go -test.run ^TestSmokeCCIPForBidirectionalLane$ -timeout 30m -count=1 -test.parallel=1 -json + test_env_vars: + E2E_TEST_SELECTED_NETWORK: SIMULATED_1,SIMULATED_2 + test_config_override_path: integration-tests/ccip-tests/testconfig/tomls/usdc_mock_deployment.toml + + - id: ccip-smoke-db-compatibility + path: integration-tests/ccip-tests/smoke/ccip_test.go + test_env_type: docker + runs_on: ubuntu-latest + triggers: + - PR E2E CCIP Tests + - Merge Queue E2E CCIP Tests + - Nightly E2E Tests + test_cmd: cd integration-tests/ccip-tests/smoke && go test ccip_test.go -test.run ^TestSmokeCCIPForBidirectionalLane$ -timeout 30m -count=1 -test.parallel=1 -json + test_env_vars: + E2E_TEST_SELECTED_NETWORK: SIMULATED_1,SIMULATED_2 + test_config_override_path: integration-tests/ccip-tests/testconfig/tomls/db-compatibility.toml + + - id: ccip-smoke-leader-lane + path: integration-tests/ccip-tests/smoke/ccip_test.go + test_env_type: docker + runs_on: ubuntu-latest + # Leader lane test is flakey in Core repo - Need to fix CCIP-3074 to enable it. + triggers: + # - PR E2E CCIP Tests + # - Nightly E2E Tests + test_cmd: cd integration-tests/ccip-tests/smoke && go test ccip_test.go -test.run ^TestSmokeCCIPForBidirectionalLane$ -timeout 30m -count=1 -test.parallel=1 -json + test_env_vars: + E2E_TEST_SELECTED_NETWORK: SIMULATED_1,SIMULATED_2 + test_config_override_path: integration-tests/ccip-tests/testconfig/tomls/leader-lane.toml + + - id: ccip-tests/smoke/ccip_test.go:^TestSmokeCCIPTokenPoolRateLimits$ + path: integration-tests/ccip-tests/smoke/ccip_test.go + test_env_type: docker + runs_on: ubuntu-latest + triggers: + - PR E2E CCIP Tests + - Merge Queue E2E CCIP Tests + - Nightly E2E Tests + test_cmd: cd integration-tests/ccip-tests/smoke && go test ccip_test.go -test.run ^TestSmokeCCIPTokenPoolRateLimits$ -timeout 30m -count=1 -test.parallel=1 -json + test_env_vars: + E2E_TEST_SELECTED_NETWORK: SIMULATED_1,SIMULATED_2 + + - id: ccip-tests/smoke/ccip_test.go:^TestSmokeCCIPMulticall$ + path: integration-tests/ccip-tests/smoke/ccip_test.go + test_env_type: docker + runs_on: ubuntu-latest + triggers: + - PR E2E CCIP Tests + - Merge Queue E2E CCIP Tests + - Nightly E2E Tests + test_cmd: cd integration-tests/ccip-tests/smoke && go test ccip_test.go -test.run ^TestSmokeCCIPMulticall$ -timeout 30m -count=1 -test.parallel=1 -json + test_env_vars: + E2E_TEST_SELECTED_NETWORK: SIMULATED_1,SIMULATED_2 + + - id: ccip-tests/smoke/ccip_test.go:^TestSmokeCCIPManuallyExecuteAfterExecutionFailingDueToInsufficientGas$ + path: integration-tests/ccip-tests/smoke/ccip_test.go + test_env_type: docker + runs_on: ubuntu-latest + triggers: + - PR E2E CCIP Tests + - Merge Queue E2E CCIP Tests + - Nightly E2E Tests + test_cmd: cd integration-tests/ccip-tests/smoke && go test ccip_test.go -test.run ^TestSmokeCCIPManuallyExecuteAfterExecutionFailingDueToInsufficientGas$ -timeout 30m -count=1 -test.parallel=1 -json + test_env_vars: + E2E_TEST_SELECTED_NETWORK: SIMULATED_1,SIMULATED_2 + + - id: ccip-tests/smoke/ccip_test.go:^TestSmokeCCIPOnRampLimits$ + path: integration-tests/ccip-tests/smoke/ccip_test.go + test_env_type: docker + runs_on: ubuntu-latest + triggers: + - PR E2E CCIP Tests + - Merge Queue E2E CCIP Tests + - Nightly E2E Tests + test_cmd: cd integration-tests/ccip-tests/smoke && go test ccip_test.go -test.run ^TestSmokeCCIPOnRampLimits$ -timeout 30m -count=1 -test.parallel=1 -json + test_env_vars: + E2E_TEST_SELECTED_NETWORK: SIMULATED_1,SIMULATED_2 + + - id: ccip-tests/smoke/ccip_test.go:^TestSmokeCCIPOffRampCapacityLimit$ + path: integration-tests/ccip-tests/smoke/ccip_test.go + test_env_type: docker + runs_on: ubuntu-latest + triggers: + - Nightly E2E Tests + test_cmd: cd integration-tests/ccip-tests/smoke && go test ccip_test.go -test.run ^TestSmokeCCIPOffRampCapacityLimit$ -timeout 30m -count=1 -test.parallel=1 -json + test_env_vars: + E2E_TEST_SELECTED_NETWORK: SIMULATED_1,SIMULATED_2 + + - id: ccip-tests/smoke/ccip_test.go:^TestSmokeCCIPOffRampAggRateLimit$ + path: integration-tests/ccip-tests/smoke/ccip_test.go + test_env_type: docker + runs_on: ubuntu-latest + triggers: + - Nightly E2E Tests + test_cmd: cd integration-tests/ccip-tests/smoke && go test ccip_test.go -test.run ^TestSmokeCCIPOffRampAggRateLimit$ -timeout 30m -count=1 -test.parallel=1 -json + test_env_vars: + E2E_TEST_SELECTED_NETWORK: SIMULATED_1,SIMULATED_2 + + - id: ccip-tests/smoke/ccip_test.go:^TestSmokeCCIPReorgBelowFinality$ + path: integration-tests/ccip-tests/smoke/ccip_test.go + test_env_type: docker + runs_on: ubuntu-latest + triggers: + - PR E2E CCIP Tests + - Merge Queue E2E CCIP Tests + - Nightly E2E Tests + test_cmd: cd integration-tests/ccip-tests/smoke && go test ccip_test.go -test.run ^TestSmokeCCIPReorgBelowFinality$ -timeout 30m -count=1 -test.parallel=1 -json + test_env_vars: + E2E_TEST_SELECTED_NETWORK: SIMULATED_1,SIMULATED_2 + test_config_override_path: integration-tests/ccip-tests/testconfig/tomls/ccip-reorg.toml + + - id: ccip-tests/smoke/ccip_test.go:^TestSmokeCCIPReorgAboveFinalityAtDestination$ + path: integration-tests/ccip-tests/smoke/ccip_test.go + test_env_type: docker + runs_on: ubuntu-latest + triggers: + - PR E2E CCIP Tests + - Merge Queue E2E CCIP Tests + - Nightly E2E Tests + test_cmd: cd integration-tests/ccip-tests/smoke && go test ccip_test.go -test.run ^TestSmokeCCIPReorgAboveFinalityAtDestination$ -timeout 30m -count=1 -test.parallel=1 -json + test_env_vars: + E2E_TEST_SELECTED_NETWORK: SIMULATED_1,SIMULATED_2 + test_config_override_path: integration-tests/ccip-tests/testconfig/tomls/ccip-reorg.toml + + - id: ccip-tests/smoke/ccip_test.go:^TestSmokeCCIPReorgAboveFinalityAtSource$ + path: integration-tests/ccip-tests/smoke/ccip_test.go + test_env_type: docker + runs_on: ubuntu-latest + triggers: + - PR E2E CCIP Tests + - Merge Queue E2E CCIP Tests + - Nightly E2E Tests + test_cmd: cd integration-tests/ccip-tests/smoke && go test ccip_test.go -test.run ^TestSmokeCCIPReorgAboveFinalityAtSource$ -timeout 30m -count=1 -test.parallel=1 -json + test_env_vars: + E2E_TEST_SELECTED_NETWORK: SIMULATED_1,SIMULATED_2 + test_config_override_path: integration-tests/ccip-tests/testconfig/tomls/ccip-reorg.toml + + - id: integration-tests/ccip-tests/load/ccip_test.go:TestLoadCCIPStableRPS + path: integration-tests/ccip-tests/load/ccip_test.go + test_env_type: k8s-remote-runner + runs_on: ubuntu-latest + test_cmd: cd integration-tests/ccip-tests/load && DETACH_RUNNER=false go test -test.run ^TestLoadCCIPStableRPS$ -timeout 70m -count=1 -test.parallel=1 -json + test_env_vars: + TEST_SUITE: ccip-load + E2E_TEST_GRAFANA_DASHBOARD_URL: "/d/6vjVx-1V8/ccip-long-running-tests" + triggers: + - E2E CCIP Load Tests + test_artifacts_on_failure: + - ./integration-tests/load/logs/payload_ccip.json + + # Enable when CCIP-2277 is resolved + # + # - id: integration-tests/ccip-tests/load/ccip_test.go:TestLoadCCIPStableRPSAfterARMCurseAndUncurse + # path: integration-tests/ccip-tests/load/ccip_test.go + # test_env_type: k8s-remote-runner + # runs_on: ubuntu-latest + # test_cmd: cd integration-tests/ccip-tests/load && DETACH_RUNNER=false go test -test.run $TestLoadCCIPStableRPSAfterARMCurseAndUncurse$ -timeout 70m -count=1 -test.parallel=1 -json + # test_config_override_path: integration-tests/ccip-tests/testconfig/tomls/load-with-arm-curse-uncurse.toml + # test_env_vars: + # E2E_TEST_GRAFANA_DASHBOARD_URL: "/d/6vjVx-1V8/ccip-long-running-tests" + # triggers: + # - E2E CCIP Load Tests + # test_artifacts_on_failure: + # - ./integration-tests/load/logs/payload_ccip.json + + - id: ccip-tests/chaos/ccip_test.go + path: integration-tests/ccip-tests/chaos/ccip_test.go + test_env_type: k8s-remote-runner + runs_on: ubuntu-latest + triggers: + - E2E CCIP Chaos Tests + test_cmd: cd integration-tests/ccip-tests/chaos && DETACH_RUNNER=false go test ccip_test.go -v -test.parallel=11 -timeout 60m -count=1 -json + test_env_vars: + TEST_SUITE: chaos + TEST_TRIGGERED_BY: ccip-cron-chaos-eth + TEST_LOG_LEVEL: debug + + - id: ccip-tests/load/ccip_test.go:^TestLoadCCIPStableWithPodChaosDiffCommitAndExec + path: integration-tests/ccip-tests/load/ccip_test.go + test_env_type: k8s-remote-runner + runs_on: ubuntu-latest + triggers: + # Disabled until CCIP-2555 is resolved + # - E2E CCIP Chaos Tests + test_cmd: cd integration-tests/ccip-tests/load && DETACH_RUNNER=false go test -run '^TestLoadCCIPStableWithPodChaosDiffCommitAndExec' -v -test.parallel=4 -timeout 120m -count=1 -json + test_env_vars: + TEST_SUITE: chaos + TEST_TRIGGERED_BY: ccip-cron-chaos-eth + TEST_LOG_LEVEL: debug + E2E_TEST_GRAFANA_DASHBOARD_URL: /d/6vjVx-1V8/ccip-long-running-tests + + # END: CCIP tests \ No newline at end of file diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 291bfe4ce88..7e3ec812438 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,36 +1,16 @@ - -### Requires Dependencies - -### Resolves Dependencies - diff --git a/.github/scripts/crib/lib/check-route53-records.js b/.github/scripts/crib/lib/check-route53-records.js deleted file mode 100644 index f35762ec88a..00000000000 --- a/.github/scripts/crib/lib/check-route53-records.js +++ /dev/null @@ -1,91 +0,0 @@ -import { setTimeout } from "node:timers/promises"; -import { - Route53Client, - ListResourceRecordSetsCommand, -} from "@aws-sdk/client-route-53"; - -// us-east-1 is the global region used by Route 53. -const route53Client = new Route53Client({ region: "us-east-1" }); - -async function paginateListResourceRecordSets(route53Client, params) { - let isTruncated = true; - let nextRecordName, nextRecordType; - let allRecordSets = []; - - while (isTruncated) { - const response = await route53Client.send( - new ListResourceRecordSetsCommand({ - ...params, - ...(nextRecordName && { StartRecordName: nextRecordName }), - ...(nextRecordType && { StartRecordType: nextRecordType }), - }) - ); - - allRecordSets = allRecordSets.concat(response.ResourceRecordSets); - isTruncated = response.IsTruncated; - if (isTruncated) { - nextRecordName = response.NextRecordName; - nextRecordType = response.NextRecordType; - } - } - - return allRecordSets; -} - -/** - * Check if Route 53 records exist for a given Route 53 zone. - * - * @param {string} hostedZoneId The ID of the hosted zone. - * @param {string[]} recordNames An array of record names to check. - * @param {number} maxRetries The maximum number of retries. - * @param {number} initialBackoffMs The initial backoff time in milliseconds. - * @returns {Promise} True if records exist, false otherwise. - */ -export async function route53RecordsExist( - hostedZoneId, - recordNames, - maxRetries = 8, - initialBackoffMs = 2000 -) { - let attempts = 0; - - // We try to gather all records within a specified time limit. - // We issue retries due to an indeterminate amount of time required - // for record propagation. - console.info("Checking DNS records in Route 53..."); - while (attempts < maxRetries) { - try { - const allRecordSets = await paginateListResourceRecordSets( - route53Client, - { - HostedZoneId: hostedZoneId, - MaxItems: "300", - } - ); - - const recordExists = recordNames.every((name) => - allRecordSets.some((r) => r.Name.includes(name)) - ); - - if (recordExists) { - console.info("All records found in Route 53."); - return true; - } - - // If any record is not found, throw an error to trigger a retry - throw new Error( - "One or more DNS records not found in Route 53, retrying..." - ); - } catch (error) { - console.error(`Attempt ${attempts + 1}:`, error.message); - if (attempts === maxRetries - 1) { - return false; // Return false after the last attempt - } - // Exponential backoff - await setTimeout(initialBackoffMs * 2 ** attempts); - attempts++; - } - } - // Should not reach here if retries are exhausted - return false; -} diff --git a/.github/scripts/crib/package.json b/.github/scripts/crib/package.json deleted file mode 100644 index b009d63f386..00000000000 --- a/.github/scripts/crib/package.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "crib", - "version": "1.0.0", - "description": "", - "main": "pr-comment-crib-env.js", - "type": "module", - "keywords": [], - "author": "", - "license": "MIT", - "engines": { - "node": ">=18", - "pnpm": ">=9" - }, - "dependencies": { - "@actions/core": "^1.10.1", - "@actions/github": "^6.0.0", - "@aws-sdk/client-route-53": "^3.525.0", - "@octokit/rest": "^20.0.2" - } -} diff --git a/.github/scripts/crib/pnpm-lock.yaml b/.github/scripts/crib/pnpm-lock.yaml deleted file mode 100644 index a65caf8355d..00000000000 --- a/.github/scripts/crib/pnpm-lock.yaml +++ /dev/null @@ -1,1206 +0,0 @@ -lockfileVersion: '9.0' - -settings: - autoInstallPeers: true - excludeLinksFromLockfile: false - -importers: - - .: - dependencies: - '@actions/core': - specifier: ^1.10.1 - version: 1.10.1 - '@actions/github': - specifier: ^6.0.0 - version: 6.0.0 - '@aws-sdk/client-route-53': - specifier: ^3.525.0 - version: 3.529.1 - '@octokit/rest': - specifier: ^20.0.2 - version: 20.0.2 - -packages: - - '@actions/core@1.10.1': - resolution: {integrity: sha512-3lBR9EDAY+iYIpTnTIXmWcNbX3T2kCkAEQGIQx4NVQ0575nk2k3GRZDTPQG+vVtS2izSLmINlxXf0uLtnrTP+g==} - - '@actions/github@6.0.0': - resolution: {integrity: sha512-alScpSVnYmjNEXboZjarjukQEzgCRmjMv6Xj47fsdnqGS73bjJNDpiiXmp8jr0UZLdUB6d9jW63IcmddUP+l0g==} - - '@actions/http-client@2.2.1': - resolution: {integrity: sha512-KhC/cZsq7f8I4LfZSJKgCvEwfkE8o1538VoBeoGzokVLLnbFDEAdFD3UhoMklxo2un9NJVBdANOresx7vTHlHw==} - - '@aws-crypto/crc32@3.0.0': - resolution: {integrity: sha512-IzSgsrxUcsrejQbPVilIKy16kAT52EwB6zSaI+M3xxIhKh5+aldEyvI+z6erM7TCLB2BJsFrtHjp6/4/sr+3dA==} - - '@aws-crypto/ie11-detection@3.0.0': - resolution: {integrity: sha512-341lBBkiY1DfDNKai/wXM3aujNBkXR7tq1URPQDL9wi3AUbI80NR74uF1TXHMm7po1AcnFk8iu2S2IeU/+/A+Q==} - - '@aws-crypto/sha256-browser@3.0.0': - resolution: {integrity: sha512-8VLmW2B+gjFbU5uMeqtQM6Nj0/F1bro80xQXCW6CQBWgosFWXTx77aeOF5CAIAmbOK64SdMBJdNr6J41yP5mvQ==} - - '@aws-crypto/sha256-js@3.0.0': - resolution: {integrity: sha512-PnNN7os0+yd1XvXAy23CFOmTbMaDxgxXtTKHybrJ39Y8kGzBATgBFibWJKH6BhytLI/Zyszs87xCOBNyBig6vQ==} - - '@aws-crypto/supports-web-crypto@3.0.0': - resolution: {integrity: sha512-06hBdMwUAb2WFTuGG73LSC0wfPu93xWwo5vL2et9eymgmu3Id5vFAHBbajVWiGhPO37qcsdCap/FqXvJGJWPIg==} - - '@aws-crypto/util@3.0.0': - resolution: {integrity: sha512-2OJlpeJpCR48CC8r+uKVChzs9Iungj9wkZrl8Z041DWEWvyIHILYKCPNzJghKsivj+S3mLo6BVc7mBNzdxA46w==} - - '@aws-sdk/client-route-53@3.529.1': - resolution: {integrity: sha512-osra30V5ILwEBeE1DUZreY7HYWQGco+WcQ1qg1UDSh/C0Nyxlu+8bVpwB/bjaldmy5Fi9MRv8SQsMdiAJFNp+w==} - engines: {node: '>=14.0.0'} - - '@aws-sdk/client-sso-oidc@3.529.1': - resolution: {integrity: sha512-bimxCWAvRnVcluWEQeadXvHyzWlBWsuGVligsaVZaGF0TLSn0eLpzpN9B1EhHzTf7m0Kh/wGtPSH1JxO6PpB+A==} - engines: {node: '>=14.0.0'} - peerDependencies: - '@aws-sdk/credential-provider-node': ^3.529.1 - - '@aws-sdk/client-sso@3.529.1': - resolution: {integrity: sha512-KT1U/ZNjDhVv2ZgjzaeAn9VM7l667yeSguMrRYC8qk5h91/61MbjZypi6eOuKuVM+0fsQvzKScTQz0Lio0eYag==} - engines: {node: '>=14.0.0'} - - '@aws-sdk/client-sts@3.529.1': - resolution: {integrity: sha512-Rvk2Sr3MACQTOtngUU+omlf4E17k47dRVXR7OFRD6Ow5iGgC9tkN2q/ExDPW/ktPOmM0lSgzWyQ6/PC/Zq3HUg==} - engines: {node: '>=14.0.0'} - peerDependencies: - '@aws-sdk/credential-provider-node': ^3.529.1 - - '@aws-sdk/core@3.529.1': - resolution: {integrity: sha512-Sj42sYPfaL9PHvvciMICxhyrDZjqnnvFbPKDmQL5aFKyXy122qx7RdVqUOQERDmMQfvJh6+0W1zQlLnre89q4Q==} - engines: {node: '>=14.0.0'} - - '@aws-sdk/credential-provider-env@3.523.0': - resolution: {integrity: sha512-Y6DWdH6/OuMDoNKVzZlNeBc6f1Yjk1lYMjANKpIhMbkRCvLJw/PYZKOZa8WpXbTYdgg9XLjKybnLIb3ww3uuzA==} - engines: {node: '>=14.0.0'} - - '@aws-sdk/credential-provider-http@3.525.0': - resolution: {integrity: sha512-RNWQGuSBQZhl3iqklOslUEfQ4br1V3DCPboMpeqFtddUWJV3m2u2extFur9/4Uy+1EHVF120IwZUKtd8dF+ibw==} - engines: {node: '>=14.0.0'} - - '@aws-sdk/credential-provider-ini@3.529.1': - resolution: {integrity: sha512-RjHsuTvHIwXG7a/3ERexemiD3c9riKMCZQzY2/b0Gg0ButEVbBcMfERtUzWmQ0V4ufe/PEZjP68MH1gupcoF9A==} - engines: {node: '>=14.0.0'} - - '@aws-sdk/credential-provider-node@3.529.1': - resolution: {integrity: sha512-mvY7F3dMmk/0dZOCfl5sUI1bG0osureBjxhELGCF0KkJqhWI0hIzh8UnPkYytSg3vdc97CMv7pTcozxrdA3b0g==} - engines: {node: '>=14.0.0'} - - '@aws-sdk/credential-provider-process@3.523.0': - resolution: {integrity: sha512-f0LP9KlFmMvPWdKeUKYlZ6FkQAECUeZMmISsv6NKtvPCI9e4O4cLTeR09telwDK8P0HrgcRuZfXM7E30m8re0Q==} - engines: {node: '>=14.0.0'} - - '@aws-sdk/credential-provider-sso@3.529.1': - resolution: {integrity: sha512-KFMKkaoTGDgSJG+o9Ii7AglWG5JQeF6IFw9cXLMwDdIrp3KUmRcUIqe0cjOoCqeQEDGy0VHsimHmKKJ3894i/A==} - engines: {node: '>=14.0.0'} - - '@aws-sdk/credential-provider-web-identity@3.529.1': - resolution: {integrity: sha512-AGuZDOKN+AttjwTjrF47WLqzeEut2YynyxjkXZhxZF/xn8i5Y51kUAUdXsXw1bgR25pAeXQIdhsrQlRa1Pm5kw==} - engines: {node: '>=14.0.0'} - - '@aws-sdk/middleware-host-header@3.523.0': - resolution: {integrity: sha512-4g3q7Ta9sdD9TMUuohBAkbx/e3I/juTqfKi7TPgP+8jxcYX72MOsgemAMHuP6CX27eyj4dpvjH+w4SIVDiDSmg==} - engines: {node: '>=14.0.0'} - - '@aws-sdk/middleware-logger@3.523.0': - resolution: {integrity: sha512-PeDNJNhfiaZx54LBaLTXzUaJ9LXFwDFFIksipjqjvxMafnoVcQwKbkoPUWLe5ytT4nnL1LogD3s55mERFUsnwg==} - engines: {node: '>=14.0.0'} - - '@aws-sdk/middleware-recursion-detection@3.523.0': - resolution: {integrity: sha512-nZ3Vt7ehfSDYnrcg/aAfjjvpdE+61B3Zk68i6/hSUIegT3IH9H1vSW67NDKVp+50hcEfzWwM2HMPXxlzuyFyrw==} - engines: {node: '>=14.0.0'} - - '@aws-sdk/middleware-sdk-route53@3.523.0': - resolution: {integrity: sha512-d+SKqDBM3XCVkF/crRWwJD1WuS4PBY/CaTGwIyND1Z3o3ZCMhyo4f2ni19U+7ZtEULW50ZGznhB2F4GJHqpDUg==} - engines: {node: '>=14.0.0'} - - '@aws-sdk/middleware-user-agent@3.525.0': - resolution: {integrity: sha512-4al/6uO+t/QIYXK2OgqzDKQzzLAYJza1vWFS+S0lJ3jLNGyLB5BMU5KqWjDzevYZ4eCnz2Nn7z0FveUTNz8YdQ==} - engines: {node: '>=14.0.0'} - - '@aws-sdk/region-config-resolver@3.525.0': - resolution: {integrity: sha512-8kFqXk6UyKgTMi7N7QlhA6qM4pGPWbiUXqEY2RgUWngtxqNFGeM9JTexZeuavQI+qLLe09VPShPNX71fEDcM6w==} - engines: {node: '>=14.0.0'} - - '@aws-sdk/token-providers@3.529.1': - resolution: {integrity: sha512-NpgMjsfpqiugbxrYGXtta914N43Mx/H0niidqv8wKMTgWQEtsJvYtOni+kuLXB+LmpjaMFNlpadooFU/bK4buA==} - engines: {node: '>=14.0.0'} - - '@aws-sdk/types@3.523.0': - resolution: {integrity: sha512-AqGIu4u+SxPiUuNBp2acCVcq80KDUFjxe6e3cMTvKWTzCbrVk1AXv0dAaJnCmdkWIha6zJDWxpIk/aL4EGhZ9A==} - engines: {node: '>=14.0.0'} - - '@aws-sdk/util-endpoints@3.525.0': - resolution: {integrity: sha512-DIW7WWU5tIGkeeKX6NJUyrEIdWMiqjLQG3XBzaUj+ufIENwNjdAHhlD8l2vX7Yr3JZRT6yN/84wBCj7Tw1xd1g==} - engines: {node: '>=14.0.0'} - - '@aws-sdk/util-locate-window@3.495.0': - resolution: {integrity: sha512-MfaPXT0kLX2tQaR90saBT9fWQq2DHqSSJRzW+MZWsmF+y5LGCOhO22ac/2o6TKSQm7h0HRc2GaADqYYYor62yg==} - engines: {node: '>=14.0.0'} - - '@aws-sdk/util-user-agent-browser@3.523.0': - resolution: {integrity: sha512-6ZRNdGHX6+HQFqTbIA5+i8RWzxFyxsZv8D3soRfpdyWIKkzhSz8IyRKXRciwKBJDaC7OX2jzGE90wxRQft27nA==} - - '@aws-sdk/util-user-agent-node@3.525.0': - resolution: {integrity: sha512-88Wjt4efyUSBGcyIuh1dvoMqY1k15jpJc5A/3yi67clBQEFsu9QCodQCQPqmRjV3VRcMtBOk+jeCTiUzTY5dRQ==} - engines: {node: '>=14.0.0'} - peerDependencies: - aws-crt: '>=1.0.0' - peerDependenciesMeta: - aws-crt: - optional: true - - '@aws-sdk/util-utf8-browser@3.259.0': - resolution: {integrity: sha512-UvFa/vR+e19XookZF8RzFZBrw2EUkQWxiBW0yYQAhvk3C+QVGl0H3ouca8LDBlBfQKXwmW3huo/59H8rwb1wJw==} - - '@aws-sdk/xml-builder@3.523.0': - resolution: {integrity: sha512-wfvyVymj2TUw7SuDor9IuFcAzJZvWRBZotvY/wQJOlYa3UP3Oezzecy64N4FWfBJEsZdrTN+HOZFl+IzTWWnUA==} - engines: {node: '>=14.0.0'} - - '@fastify/busboy@2.1.1': - resolution: {integrity: sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA==} - engines: {node: '>=14'} - - '@octokit/auth-token@4.0.0': - resolution: {integrity: sha512-tY/msAuJo6ARbK6SPIxZrPBms3xPbfwBrulZe0Wtr/DIY9lje2HeV1uoebShn6mx7SjCHif6EjMvoREj+gZ+SA==} - engines: {node: '>= 18'} - - '@octokit/core@5.1.0': - resolution: {integrity: sha512-BDa2VAMLSh3otEiaMJ/3Y36GU4qf6GI+VivQ/P41NC6GHcdxpKlqV0ikSZ5gdQsmS3ojXeRx5vasgNTinF0Q4g==} - engines: {node: '>= 18'} - - '@octokit/endpoint@9.0.4': - resolution: {integrity: sha512-DWPLtr1Kz3tv8L0UvXTDP1fNwM0S+z6EJpRcvH66orY6Eld4XBMCSYsaWp4xIm61jTWxK68BrR7ibO+vSDnZqw==} - engines: {node: '>= 18'} - - '@octokit/graphql@7.0.2': - resolution: {integrity: sha512-OJ2iGMtj5Tg3s6RaXH22cJcxXRi7Y3EBqbHTBRq+PQAqfaS8f/236fUrWhfSn8P4jovyzqucxme7/vWSSZBX2Q==} - engines: {node: '>= 18'} - - '@octokit/openapi-types@20.0.0': - resolution: {integrity: sha512-EtqRBEjp1dL/15V7WiX5LJMIxxkdiGJnabzYx5Apx4FkQIFgAfKumXeYAqqJCj1s+BMX4cPFIFC4OLCR6stlnA==} - - '@octokit/plugin-paginate-rest@9.2.1': - resolution: {integrity: sha512-wfGhE/TAkXZRLjksFXuDZdmGnJQHvtU/joFQdweXUgzo1XwvBCD4o4+75NtFfjfLK5IwLf9vHTfSiU3sLRYpRw==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': '5' - - '@octokit/plugin-request-log@4.0.1': - resolution: {integrity: sha512-GihNqNpGHorUrO7Qa9JbAl0dbLnqJVrV8OXe2Zm5/Y4wFkZQDfTreBzVmiRfJVfE4mClXdihHnbpyyO9FSX4HA==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': '5' - - '@octokit/plugin-rest-endpoint-methods@10.4.1': - resolution: {integrity: sha512-xV1b+ceKV9KytQe3zCVqjg+8GTGfDYwaT1ATU5isiUyVtlVAO3HNdzpS4sr4GBx4hxQ46s7ITtZrAsxG22+rVg==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': '5' - - '@octokit/request-error@5.0.1': - resolution: {integrity: sha512-X7pnyTMV7MgtGmiXBwmO6M5kIPrntOXdyKZLigNfQWSEQzVxR4a4vo49vJjTWX70mPndj8KhfT4Dx+2Ng3vnBQ==} - engines: {node: '>= 18'} - - '@octokit/request@8.2.0': - resolution: {integrity: sha512-exPif6x5uwLqv1N1irkLG1zZNJkOtj8bZxuVHd71U5Ftuxf2wGNvAJyNBcPbPC+EBzwYEbBDdSFb8EPcjpYxPQ==} - engines: {node: '>= 18'} - - '@octokit/rest@20.0.2': - resolution: {integrity: sha512-Ux8NDgEraQ/DMAU1PlAohyfBBXDwhnX2j33Z1nJNziqAfHi70PuxkFYIcIt8aIAxtRE7KVuKp8lSR8pA0J5iOQ==} - engines: {node: '>= 18'} - - '@octokit/types@12.6.0': - resolution: {integrity: sha512-1rhSOfRa6H9w4YwK0yrf5faDaDTb+yLyBUKOCV4xtCDB5VmIPqd/v9yr9o6SAzOAlRxMiRiCic6JVM1/kunVkw==} - - '@smithy/abort-controller@2.1.4': - resolution: {integrity: sha512-66HO817oIZ2otLIqy06R5muapqZjkgF1jfU0wyNko8cuqZNu8nbS9ljlhcRYw/M/uWRJzB9ih81DLSHhYbBLlQ==} - engines: {node: '>=14.0.0'} - - '@smithy/config-resolver@2.1.5': - resolution: {integrity: sha512-LcBB5JQC3Tx2ZExIJzfvWaajhFIwHrUNQeqxhred2r5nnqrdly9uoCrvM1sxOOdghYuWWm2Kr8tBCDOmxsgeTA==} - engines: {node: '>=14.0.0'} - - '@smithy/core@1.3.8': - resolution: {integrity: sha512-6cFhQ9ChU7MxvOXJn6nuUSONacpNsGHWhfueROQuM/0vibDdZA9FWEdNbVkuVuc+BFI5BnaX3ltERUlpUirpIA==} - engines: {node: '>=14.0.0'} - - '@smithy/credential-provider-imds@2.2.6': - resolution: {integrity: sha512-+xQe4Pite0kdk9qn0Vyw5BRVh0iSlj+T4TEKRXr4E1wZKtVgIzGlkCrfICSjiPVFkPxk4jMpVboMYdEiiA88/w==} - engines: {node: '>=14.0.0'} - - '@smithy/eventstream-codec@2.1.4': - resolution: {integrity: sha512-UkiieTztP7adg8EuqZvB0Y4LewdleZCJU7Kgt9RDutMsRYqO32fMpWeQHeTHaIMosmzcRZUykMRrhwGJe9mP3A==} - - '@smithy/fetch-http-handler@2.4.5': - resolution: {integrity: sha512-FR1IMGdo0yRFs1tk71zRGSa1MznVLQOVNaPjyNtx6dOcy/u0ovEnXN5NVz6slw5KujFlg3N1w4+UbO8F3WyYUg==} - - '@smithy/hash-node@2.1.4': - resolution: {integrity: sha512-uvCcpDLXaTTL0X/9ezF8T8sS77UglTfZVQaUOBiCvR0QydeSyio3t0Hj3QooVdyFsKTubR8gCk/ubLk3vAyDng==} - engines: {node: '>=14.0.0'} - - '@smithy/invalid-dependency@2.1.4': - resolution: {integrity: sha512-QzlNBl6jt3nb9jNnE51wTegReVvUdozyMMrFEyb/rc6AzPID1O+qMJYjAAoNw098y0CZVfCpEnoK2+mfBOd8XA==} - - '@smithy/is-array-buffer@2.1.1': - resolution: {integrity: sha512-xozSQrcUinPpNPNPds4S7z/FakDTh1MZWtRP/2vQtYB/u3HYrX2UXuZs+VhaKBd6Vc7g2XPr2ZtwGBNDN6fNKQ==} - engines: {node: '>=14.0.0'} - - '@smithy/middleware-content-length@2.1.4': - resolution: {integrity: sha512-C6VRwfcr0w9qRFhDGCpWMVhlEIBFlmlPRP1aX9Cv9xDj9SUwlDrNvoV1oP1vjRYuLxCDgovBBynCwwcluS2wLw==} - engines: {node: '>=14.0.0'} - - '@smithy/middleware-endpoint@2.4.6': - resolution: {integrity: sha512-AsXtUXHPOAS0EGZUSFOsVJvc7p0KL29PGkLxLfycPOcFVLru/oinYB6yvyL73ZZPX2OB8sMYUMrj7eH2kI7V/w==} - engines: {node: '>=14.0.0'} - - '@smithy/middleware-retry@2.1.7': - resolution: {integrity: sha512-8fOP/cJN4oMv+5SRffZC8RkqfWxHqGgn/86JPINY/1DnTRegzf+G5GT9lmIdG1YasuSbU7LISfW9PXil3isPVw==} - engines: {node: '>=14.0.0'} - - '@smithy/middleware-serde@2.2.1': - resolution: {integrity: sha512-VAWRWqnNjgccebndpyK94om4ZTYzXLQxUmNCXYzM/3O9MTfQjTNBgtFtQwyIIez6z7LWcCsXmnKVIOE9mLqAHQ==} - engines: {node: '>=14.0.0'} - - '@smithy/middleware-stack@2.1.4': - resolution: {integrity: sha512-Qqs2ba8Ax1rGKOSGJS2JN23fhhox2WMdRuzx0NYHtXzhxbJOIMmz9uQY6Hf4PY8FPteBPp1+h0j5Fmr+oW12sg==} - engines: {node: '>=14.0.0'} - - '@smithy/node-config-provider@2.2.5': - resolution: {integrity: sha512-CxPf2CXhjO79IypHJLBATB66Dw6suvr1Yc2ccY39hpR6wdse3pZ3E8RF83SODiNH0Wjmkd0ze4OF8exugEixgA==} - engines: {node: '>=14.0.0'} - - '@smithy/node-http-handler@2.4.3': - resolution: {integrity: sha512-bD5zRdEl1u/4vAAMeQnGEUNbH1seISV2Z0Wnn7ltPRl/6B2zND1R9XzTfsOnH1R5jqghpochF/mma8u7uXz0qQ==} - engines: {node: '>=14.0.0'} - - '@smithy/property-provider@2.1.4': - resolution: {integrity: sha512-nWaY/MImj1BiXZ9WY65h45dcxOx8pl06KYoHxwojDxDL+Q9yLU1YnZpgv8zsHhEftlj9KhePENjQTlNowWVyug==} - engines: {node: '>=14.0.0'} - - '@smithy/protocol-http@3.2.2': - resolution: {integrity: sha512-xYBlllOQcOuLoxzhF2u8kRHhIFGQpDeTQj/dBSnw4kfI29WMKL5RnW1m9YjnJAJ49miuIvrkJR+gW5bCQ+Mchw==} - engines: {node: '>=14.0.0'} - - '@smithy/querystring-builder@2.1.4': - resolution: {integrity: sha512-LXSL0J/nRWvGT+jIj+Fip3j0J1ZmHkUyBFRzg/4SmPNCLeDrtVu7ptKOnTboPsFZu5BxmpYok3kJuQzzRdrhbw==} - engines: {node: '>=14.0.0'} - - '@smithy/querystring-parser@2.1.4': - resolution: {integrity: sha512-U2b8olKXgZAs0eRo7Op11jTNmmcC/sqYmsA7vN6A+jkGnDvJlEl7AetUegbBzU8q3D6WzC5rhR/joIy8tXPzIg==} - engines: {node: '>=14.0.0'} - - '@smithy/service-error-classification@2.1.4': - resolution: {integrity: sha512-JW2Hthy21evnvDmYYk1kItOmbp3X5XI5iqorXgFEunb6hQfSDZ7O1g0Clyxg7k/Pcr9pfLk5xDIR2To/IohlsQ==} - engines: {node: '>=14.0.0'} - - '@smithy/shared-ini-file-loader@2.3.5': - resolution: {integrity: sha512-oI99+hOvsM8oAJtxAGmoL/YCcGXtbP0fjPseYGaNmJ4X5xOFTer0KPk7AIH3AL6c5AlYErivEi1X/X78HgTVIw==} - engines: {node: '>=14.0.0'} - - '@smithy/signature-v4@2.1.4': - resolution: {integrity: sha512-gnu9gCn0qQ8IdhNjs6o3QVCXzUs33znSDYwVMWo3nX4dM6j7z9u6FC302ShYyVWfO4MkVMuGCCJ6nl3PcH7V1Q==} - engines: {node: '>=14.0.0'} - - '@smithy/smithy-client@2.4.5': - resolution: {integrity: sha512-igXOM4kPXPo6b5LZXTUqTnrGk20uVd8OXoybC3f89gczzGfziLK4yUNOmiHSdxY9OOMOnnhVe5MpTm01MpFqvA==} - engines: {node: '>=14.0.0'} - - '@smithy/types@2.11.0': - resolution: {integrity: sha512-AR0SXO7FuAskfNhyGfSTThpLRntDI5bOrU0xrpVYU0rZyjl3LBXInZFMTP/NNSd7IS6Ksdtar0QvnrPRIhVrLQ==} - engines: {node: '>=14.0.0'} - - '@smithy/url-parser@2.1.4': - resolution: {integrity: sha512-1hTy6UYRYqOZlHKH2/2NzdNQ4NNmW2Lp0sYYvztKy+dEQuLvZL9w88zCzFQqqFer3DMcscYOshImxkJTGdV+rg==} - - '@smithy/util-base64@2.2.1': - resolution: {integrity: sha512-troGfokrpoqv8TGgsb8p4vvM71vqor314514jyQ0i9Zae3qs0jUVbSMCIBB1tseVynXFRcZJAZ9hPQYlifLD5A==} - engines: {node: '>=14.0.0'} - - '@smithy/util-body-length-browser@2.1.1': - resolution: {integrity: sha512-ekOGBLvs1VS2d1zM2ER4JEeBWAvIOUKeaFch29UjjJsxmZ/f0L3K3x0dEETgh3Q9bkZNHgT+rkdl/J/VUqSRag==} - - '@smithy/util-body-length-node@2.2.2': - resolution: {integrity: sha512-U7DooaT1SfW7XHrOcxthYJnQ+WMaefRrFPxW5Qmypw38Ivv+TKvfVuVHA9V162h8BeW9rzOJwOunjgXd0DdB4w==} - engines: {node: '>=14.0.0'} - - '@smithy/util-buffer-from@2.1.1': - resolution: {integrity: sha512-clhNjbyfqIv9Md2Mg6FffGVrJxw7bgK7s3Iax36xnfVj6cg0fUG7I4RH0XgXJF8bxi+saY5HR21g2UPKSxVCXg==} - engines: {node: '>=14.0.0'} - - '@smithy/util-config-provider@2.2.1': - resolution: {integrity: sha512-50VL/tx9oYYcjJn/qKqNy7sCtpD0+s8XEBamIFo4mFFTclKMNp+rsnymD796uybjiIquB7VCB/DeafduL0y2kw==} - engines: {node: '>=14.0.0'} - - '@smithy/util-defaults-mode-browser@2.1.7': - resolution: {integrity: sha512-vvIpWsysEdY77R0Qzr6+LRW50ye7eii7AyHM0OJnTi0isHYiXo5M/7o4k8gjK/b1upQJdfjzSBoJVa2SWrI+2g==} - engines: {node: '>= 10.0.0'} - - '@smithy/util-defaults-mode-node@2.2.7': - resolution: {integrity: sha512-qzXkSDyU6Th+rNNcNkG4a7Ix7m5HlMOtSCPxTVKlkz7eVsqbSSPggegbFeQJ2MVELBB4wnzNPsVPJIrpIaJpXA==} - engines: {node: '>= 10.0.0'} - - '@smithy/util-endpoints@1.1.5': - resolution: {integrity: sha512-tgDpaUNsUtRvNiBulKU1VnpoXU1GINMfZZXunRhUXOTBEAufG1Wp79uDXLau2gg1RZ4dpAR6lXCkrmddihCGUg==} - engines: {node: '>= 14.0.0'} - - '@smithy/util-hex-encoding@2.1.1': - resolution: {integrity: sha512-3UNdP2pkYUUBGEXzQI9ODTDK+Tcu1BlCyDBaRHwyxhA+8xLP8agEKQq4MGmpjqb4VQAjq9TwlCQX0kP6XDKYLg==} - engines: {node: '>=14.0.0'} - - '@smithy/util-middleware@2.1.4': - resolution: {integrity: sha512-5yYNOgCN0DL0OplME0pthoUR/sCfipnROkbTO7m872o0GHCVNJj5xOFJ143rvHNA54+pIPMLum4z2DhPC2pVGA==} - engines: {node: '>=14.0.0'} - - '@smithy/util-retry@2.1.4': - resolution: {integrity: sha512-JRZwhA3fhkdenSEYIWatC8oLwt4Bdf2LhHbNQApqb7yFoIGMl4twcYI3BcJZ7YIBZrACA9jGveW6tuCd836XzQ==} - engines: {node: '>= 14.0.0'} - - '@smithy/util-stream@2.1.5': - resolution: {integrity: sha512-FqvBFeTgx+QC4+i8USHqU8Ifs9nYRpW/OBfksojtgkxPIQ2H7ypXDEbnQRAV7PwoNHWcSwPomLYi0svmQQG5ow==} - engines: {node: '>=14.0.0'} - - '@smithy/util-uri-escape@2.1.1': - resolution: {integrity: sha512-saVzI1h6iRBUVSqtnlOnc9ssU09ypo7n+shdQ8hBTZno/9rZ3AuRYvoHInV57VF7Qn7B+pFJG7qTzFiHxWlWBw==} - engines: {node: '>=14.0.0'} - - '@smithy/util-utf8@2.2.0': - resolution: {integrity: sha512-hBsKr5BqrDrKS8qy+YcV7/htmMGxriA1PREOf/8AGBhHIZnfilVv1Waf1OyKhSbFW15U/8+gcMUQ9/Kk5qwpHQ==} - engines: {node: '>=14.0.0'} - - '@smithy/util-waiter@2.1.4': - resolution: {integrity: sha512-AK17WaC0hx1wR9juAOsQkJ6DjDxBGEf5TrKhpXtNFEn+cVto9Li3MVsdpAO97AF7bhFXSyC8tJA3F4ThhqwCdg==} - engines: {node: '>=14.0.0'} - - before-after-hook@2.2.3: - resolution: {integrity: sha512-NzUnlZexiaH/46WDhANlyR2bXRopNg4F/zuSA3OpZnllCUgRaOF2znDioDWrmbNVsuZk6l9pMquQB38cfBZwkQ==} - - bowser@2.11.0: - resolution: {integrity: sha512-AlcaJBi/pqqJBIQ8U9Mcpc9i8Aqxn88Skv5d+xBX006BY5u8N3mGLHa5Lgppa7L/HfwgwLgZ6NYs+Ag6uUmJRA==} - - deprecation@2.3.1: - resolution: {integrity: sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==} - - fast-xml-parser@4.2.5: - resolution: {integrity: sha512-B9/wizE4WngqQftFPmdaMYlXoJlJOYxGQOanC77fq9k8+Z0v5dDSVh+3glErdIROP//s/jgb7ZuxKfB8nVyo0g==} - hasBin: true - - once@1.4.0: - resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} - - strnum@1.0.5: - resolution: {integrity: sha512-J8bbNyKKXl5qYcR36TIO8W3mVGVHrmmxsd5PAItGkmyzwJvybiw2IVq5nqd0i4LSNSkB/sx9VHllbfFdr9k1JA==} - - tslib@1.14.1: - resolution: {integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==} - - tslib@2.6.2: - resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==} - - tunnel@0.0.6: - resolution: {integrity: sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==} - engines: {node: '>=0.6.11 <=0.7.0 || >=0.7.3'} - - undici@5.28.3: - resolution: {integrity: sha512-3ItfzbrhDlINjaP0duwnNsKpDQk3acHI3gVJ1z4fmwMK31k5G9OVIAMLSIaP6w4FaGkaAkN6zaQO9LUvZ1t7VA==} - engines: {node: '>=14.0'} - - universal-user-agent@6.0.1: - resolution: {integrity: sha512-yCzhz6FN2wU1NiiQRogkTQszlQSlpWaw8SvVegAc+bDxbzHgh1vX8uIe8OYyMH6DwH+sdTJsgMl36+mSMdRJIQ==} - - uuid@8.3.2: - resolution: {integrity: sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==} - hasBin: true - - wrappy@1.0.2: - resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} - -snapshots: - - '@actions/core@1.10.1': - dependencies: - '@actions/http-client': 2.2.1 - uuid: 8.3.2 - - '@actions/github@6.0.0': - dependencies: - '@actions/http-client': 2.2.1 - '@octokit/core': 5.1.0 - '@octokit/plugin-paginate-rest': 9.2.1(@octokit/core@5.1.0) - '@octokit/plugin-rest-endpoint-methods': 10.4.1(@octokit/core@5.1.0) - - '@actions/http-client@2.2.1': - dependencies: - tunnel: 0.0.6 - undici: 5.28.3 - - '@aws-crypto/crc32@3.0.0': - dependencies: - '@aws-crypto/util': 3.0.0 - '@aws-sdk/types': 3.523.0 - tslib: 1.14.1 - - '@aws-crypto/ie11-detection@3.0.0': - dependencies: - tslib: 1.14.1 - - '@aws-crypto/sha256-browser@3.0.0': - dependencies: - '@aws-crypto/ie11-detection': 3.0.0 - '@aws-crypto/sha256-js': 3.0.0 - '@aws-crypto/supports-web-crypto': 3.0.0 - '@aws-crypto/util': 3.0.0 - '@aws-sdk/types': 3.523.0 - '@aws-sdk/util-locate-window': 3.495.0 - '@aws-sdk/util-utf8-browser': 3.259.0 - tslib: 1.14.1 - - '@aws-crypto/sha256-js@3.0.0': - dependencies: - '@aws-crypto/util': 3.0.0 - '@aws-sdk/types': 3.523.0 - tslib: 1.14.1 - - '@aws-crypto/supports-web-crypto@3.0.0': - dependencies: - tslib: 1.14.1 - - '@aws-crypto/util@3.0.0': - dependencies: - '@aws-sdk/types': 3.523.0 - '@aws-sdk/util-utf8-browser': 3.259.0 - tslib: 1.14.1 - - '@aws-sdk/client-route-53@3.529.1': - dependencies: - '@aws-crypto/sha256-browser': 3.0.0 - '@aws-crypto/sha256-js': 3.0.0 - '@aws-sdk/client-sts': 3.529.1(@aws-sdk/credential-provider-node@3.529.1) - '@aws-sdk/core': 3.529.1 - '@aws-sdk/credential-provider-node': 3.529.1 - '@aws-sdk/middleware-host-header': 3.523.0 - '@aws-sdk/middleware-logger': 3.523.0 - '@aws-sdk/middleware-recursion-detection': 3.523.0 - '@aws-sdk/middleware-sdk-route53': 3.523.0 - '@aws-sdk/middleware-user-agent': 3.525.0 - '@aws-sdk/region-config-resolver': 3.525.0 - '@aws-sdk/types': 3.523.0 - '@aws-sdk/util-endpoints': 3.525.0 - '@aws-sdk/util-user-agent-browser': 3.523.0 - '@aws-sdk/util-user-agent-node': 3.525.0 - '@aws-sdk/xml-builder': 3.523.0 - '@smithy/config-resolver': 2.1.5 - '@smithy/core': 1.3.8 - '@smithy/fetch-http-handler': 2.4.5 - '@smithy/hash-node': 2.1.4 - '@smithy/invalid-dependency': 2.1.4 - '@smithy/middleware-content-length': 2.1.4 - '@smithy/middleware-endpoint': 2.4.6 - '@smithy/middleware-retry': 2.1.7 - '@smithy/middleware-serde': 2.2.1 - '@smithy/middleware-stack': 2.1.4 - '@smithy/node-config-provider': 2.2.5 - '@smithy/node-http-handler': 2.4.3 - '@smithy/protocol-http': 3.2.2 - '@smithy/smithy-client': 2.4.5 - '@smithy/types': 2.11.0 - '@smithy/url-parser': 2.1.4 - '@smithy/util-base64': 2.2.1 - '@smithy/util-body-length-browser': 2.1.1 - '@smithy/util-body-length-node': 2.2.2 - '@smithy/util-defaults-mode-browser': 2.1.7 - '@smithy/util-defaults-mode-node': 2.2.7 - '@smithy/util-endpoints': 1.1.5 - '@smithy/util-middleware': 2.1.4 - '@smithy/util-retry': 2.1.4 - '@smithy/util-utf8': 2.2.0 - '@smithy/util-waiter': 2.1.4 - tslib: 2.6.2 - transitivePeerDependencies: - - aws-crt - - '@aws-sdk/client-sso-oidc@3.529.1(@aws-sdk/credential-provider-node@3.529.1)': - dependencies: - '@aws-crypto/sha256-browser': 3.0.0 - '@aws-crypto/sha256-js': 3.0.0 - '@aws-sdk/client-sts': 3.529.1(@aws-sdk/credential-provider-node@3.529.1) - '@aws-sdk/core': 3.529.1 - '@aws-sdk/credential-provider-node': 3.529.1 - '@aws-sdk/middleware-host-header': 3.523.0 - '@aws-sdk/middleware-logger': 3.523.0 - '@aws-sdk/middleware-recursion-detection': 3.523.0 - '@aws-sdk/middleware-user-agent': 3.525.0 - '@aws-sdk/region-config-resolver': 3.525.0 - '@aws-sdk/types': 3.523.0 - '@aws-sdk/util-endpoints': 3.525.0 - '@aws-sdk/util-user-agent-browser': 3.523.0 - '@aws-sdk/util-user-agent-node': 3.525.0 - '@smithy/config-resolver': 2.1.5 - '@smithy/core': 1.3.8 - '@smithy/fetch-http-handler': 2.4.5 - '@smithy/hash-node': 2.1.4 - '@smithy/invalid-dependency': 2.1.4 - '@smithy/middleware-content-length': 2.1.4 - '@smithy/middleware-endpoint': 2.4.6 - '@smithy/middleware-retry': 2.1.7 - '@smithy/middleware-serde': 2.2.1 - '@smithy/middleware-stack': 2.1.4 - '@smithy/node-config-provider': 2.2.5 - '@smithy/node-http-handler': 2.4.3 - '@smithy/protocol-http': 3.2.2 - '@smithy/smithy-client': 2.4.5 - '@smithy/types': 2.11.0 - '@smithy/url-parser': 2.1.4 - '@smithy/util-base64': 2.2.1 - '@smithy/util-body-length-browser': 2.1.1 - '@smithy/util-body-length-node': 2.2.2 - '@smithy/util-defaults-mode-browser': 2.1.7 - '@smithy/util-defaults-mode-node': 2.2.7 - '@smithy/util-endpoints': 1.1.5 - '@smithy/util-middleware': 2.1.4 - '@smithy/util-retry': 2.1.4 - '@smithy/util-utf8': 2.2.0 - tslib: 2.6.2 - transitivePeerDependencies: - - aws-crt - - '@aws-sdk/client-sso@3.529.1': - dependencies: - '@aws-crypto/sha256-browser': 3.0.0 - '@aws-crypto/sha256-js': 3.0.0 - '@aws-sdk/core': 3.529.1 - '@aws-sdk/middleware-host-header': 3.523.0 - '@aws-sdk/middleware-logger': 3.523.0 - '@aws-sdk/middleware-recursion-detection': 3.523.0 - '@aws-sdk/middleware-user-agent': 3.525.0 - '@aws-sdk/region-config-resolver': 3.525.0 - '@aws-sdk/types': 3.523.0 - '@aws-sdk/util-endpoints': 3.525.0 - '@aws-sdk/util-user-agent-browser': 3.523.0 - '@aws-sdk/util-user-agent-node': 3.525.0 - '@smithy/config-resolver': 2.1.5 - '@smithy/core': 1.3.8 - '@smithy/fetch-http-handler': 2.4.5 - '@smithy/hash-node': 2.1.4 - '@smithy/invalid-dependency': 2.1.4 - '@smithy/middleware-content-length': 2.1.4 - '@smithy/middleware-endpoint': 2.4.6 - '@smithy/middleware-retry': 2.1.7 - '@smithy/middleware-serde': 2.2.1 - '@smithy/middleware-stack': 2.1.4 - '@smithy/node-config-provider': 2.2.5 - '@smithy/node-http-handler': 2.4.3 - '@smithy/protocol-http': 3.2.2 - '@smithy/smithy-client': 2.4.5 - '@smithy/types': 2.11.0 - '@smithy/url-parser': 2.1.4 - '@smithy/util-base64': 2.2.1 - '@smithy/util-body-length-browser': 2.1.1 - '@smithy/util-body-length-node': 2.2.2 - '@smithy/util-defaults-mode-browser': 2.1.7 - '@smithy/util-defaults-mode-node': 2.2.7 - '@smithy/util-endpoints': 1.1.5 - '@smithy/util-middleware': 2.1.4 - '@smithy/util-retry': 2.1.4 - '@smithy/util-utf8': 2.2.0 - tslib: 2.6.2 - transitivePeerDependencies: - - aws-crt - - '@aws-sdk/client-sts@3.529.1(@aws-sdk/credential-provider-node@3.529.1)': - dependencies: - '@aws-crypto/sha256-browser': 3.0.0 - '@aws-crypto/sha256-js': 3.0.0 - '@aws-sdk/core': 3.529.1 - '@aws-sdk/credential-provider-node': 3.529.1 - '@aws-sdk/middleware-host-header': 3.523.0 - '@aws-sdk/middleware-logger': 3.523.0 - '@aws-sdk/middleware-recursion-detection': 3.523.0 - '@aws-sdk/middleware-user-agent': 3.525.0 - '@aws-sdk/region-config-resolver': 3.525.0 - '@aws-sdk/types': 3.523.0 - '@aws-sdk/util-endpoints': 3.525.0 - '@aws-sdk/util-user-agent-browser': 3.523.0 - '@aws-sdk/util-user-agent-node': 3.525.0 - '@smithy/config-resolver': 2.1.5 - '@smithy/core': 1.3.8 - '@smithy/fetch-http-handler': 2.4.5 - '@smithy/hash-node': 2.1.4 - '@smithy/invalid-dependency': 2.1.4 - '@smithy/middleware-content-length': 2.1.4 - '@smithy/middleware-endpoint': 2.4.6 - '@smithy/middleware-retry': 2.1.7 - '@smithy/middleware-serde': 2.2.1 - '@smithy/middleware-stack': 2.1.4 - '@smithy/node-config-provider': 2.2.5 - '@smithy/node-http-handler': 2.4.3 - '@smithy/protocol-http': 3.2.2 - '@smithy/smithy-client': 2.4.5 - '@smithy/types': 2.11.0 - '@smithy/url-parser': 2.1.4 - '@smithy/util-base64': 2.2.1 - '@smithy/util-body-length-browser': 2.1.1 - '@smithy/util-body-length-node': 2.2.2 - '@smithy/util-defaults-mode-browser': 2.1.7 - '@smithy/util-defaults-mode-node': 2.2.7 - '@smithy/util-endpoints': 1.1.5 - '@smithy/util-middleware': 2.1.4 - '@smithy/util-retry': 2.1.4 - '@smithy/util-utf8': 2.2.0 - tslib: 2.6.2 - transitivePeerDependencies: - - aws-crt - - '@aws-sdk/core@3.529.1': - dependencies: - '@smithy/core': 1.3.8 - '@smithy/protocol-http': 3.2.2 - '@smithy/signature-v4': 2.1.4 - '@smithy/smithy-client': 2.4.5 - '@smithy/types': 2.11.0 - fast-xml-parser: 4.2.5 - tslib: 2.6.2 - - '@aws-sdk/credential-provider-env@3.523.0': - dependencies: - '@aws-sdk/types': 3.523.0 - '@smithy/property-provider': 2.1.4 - '@smithy/types': 2.11.0 - tslib: 2.6.2 - - '@aws-sdk/credential-provider-http@3.525.0': - dependencies: - '@aws-sdk/types': 3.523.0 - '@smithy/fetch-http-handler': 2.4.5 - '@smithy/node-http-handler': 2.4.3 - '@smithy/property-provider': 2.1.4 - '@smithy/protocol-http': 3.2.2 - '@smithy/smithy-client': 2.4.5 - '@smithy/types': 2.11.0 - '@smithy/util-stream': 2.1.5 - tslib: 2.6.2 - - '@aws-sdk/credential-provider-ini@3.529.1(@aws-sdk/credential-provider-node@3.529.1)': - dependencies: - '@aws-sdk/client-sts': 3.529.1(@aws-sdk/credential-provider-node@3.529.1) - '@aws-sdk/credential-provider-env': 3.523.0 - '@aws-sdk/credential-provider-process': 3.523.0 - '@aws-sdk/credential-provider-sso': 3.529.1(@aws-sdk/credential-provider-node@3.529.1) - '@aws-sdk/credential-provider-web-identity': 3.529.1(@aws-sdk/credential-provider-node@3.529.1) - '@aws-sdk/types': 3.523.0 - '@smithy/credential-provider-imds': 2.2.6 - '@smithy/property-provider': 2.1.4 - '@smithy/shared-ini-file-loader': 2.3.5 - '@smithy/types': 2.11.0 - tslib: 2.6.2 - transitivePeerDependencies: - - '@aws-sdk/credential-provider-node' - - aws-crt - - '@aws-sdk/credential-provider-node@3.529.1': - dependencies: - '@aws-sdk/credential-provider-env': 3.523.0 - '@aws-sdk/credential-provider-http': 3.525.0 - '@aws-sdk/credential-provider-ini': 3.529.1(@aws-sdk/credential-provider-node@3.529.1) - '@aws-sdk/credential-provider-process': 3.523.0 - '@aws-sdk/credential-provider-sso': 3.529.1(@aws-sdk/credential-provider-node@3.529.1) - '@aws-sdk/credential-provider-web-identity': 3.529.1(@aws-sdk/credential-provider-node@3.529.1) - '@aws-sdk/types': 3.523.0 - '@smithy/credential-provider-imds': 2.2.6 - '@smithy/property-provider': 2.1.4 - '@smithy/shared-ini-file-loader': 2.3.5 - '@smithy/types': 2.11.0 - tslib: 2.6.2 - transitivePeerDependencies: - - aws-crt - - '@aws-sdk/credential-provider-process@3.523.0': - dependencies: - '@aws-sdk/types': 3.523.0 - '@smithy/property-provider': 2.1.4 - '@smithy/shared-ini-file-loader': 2.3.5 - '@smithy/types': 2.11.0 - tslib: 2.6.2 - - '@aws-sdk/credential-provider-sso@3.529.1(@aws-sdk/credential-provider-node@3.529.1)': - dependencies: - '@aws-sdk/client-sso': 3.529.1 - '@aws-sdk/token-providers': 3.529.1(@aws-sdk/credential-provider-node@3.529.1) - '@aws-sdk/types': 3.523.0 - '@smithy/property-provider': 2.1.4 - '@smithy/shared-ini-file-loader': 2.3.5 - '@smithy/types': 2.11.0 - tslib: 2.6.2 - transitivePeerDependencies: - - '@aws-sdk/credential-provider-node' - - aws-crt - - '@aws-sdk/credential-provider-web-identity@3.529.1(@aws-sdk/credential-provider-node@3.529.1)': - dependencies: - '@aws-sdk/client-sts': 3.529.1(@aws-sdk/credential-provider-node@3.529.1) - '@aws-sdk/types': 3.523.0 - '@smithy/property-provider': 2.1.4 - '@smithy/types': 2.11.0 - tslib: 2.6.2 - transitivePeerDependencies: - - '@aws-sdk/credential-provider-node' - - aws-crt - - '@aws-sdk/middleware-host-header@3.523.0': - dependencies: - '@aws-sdk/types': 3.523.0 - '@smithy/protocol-http': 3.2.2 - '@smithy/types': 2.11.0 - tslib: 2.6.2 - - '@aws-sdk/middleware-logger@3.523.0': - dependencies: - '@aws-sdk/types': 3.523.0 - '@smithy/types': 2.11.0 - tslib: 2.6.2 - - '@aws-sdk/middleware-recursion-detection@3.523.0': - dependencies: - '@aws-sdk/types': 3.523.0 - '@smithy/protocol-http': 3.2.2 - '@smithy/types': 2.11.0 - tslib: 2.6.2 - - '@aws-sdk/middleware-sdk-route53@3.523.0': - dependencies: - '@aws-sdk/types': 3.523.0 - '@smithy/types': 2.11.0 - tslib: 2.6.2 - - '@aws-sdk/middleware-user-agent@3.525.0': - dependencies: - '@aws-sdk/types': 3.523.0 - '@aws-sdk/util-endpoints': 3.525.0 - '@smithy/protocol-http': 3.2.2 - '@smithy/types': 2.11.0 - tslib: 2.6.2 - - '@aws-sdk/region-config-resolver@3.525.0': - dependencies: - '@aws-sdk/types': 3.523.0 - '@smithy/node-config-provider': 2.2.5 - '@smithy/types': 2.11.0 - '@smithy/util-config-provider': 2.2.1 - '@smithy/util-middleware': 2.1.4 - tslib: 2.6.2 - - '@aws-sdk/token-providers@3.529.1(@aws-sdk/credential-provider-node@3.529.1)': - dependencies: - '@aws-sdk/client-sso-oidc': 3.529.1(@aws-sdk/credential-provider-node@3.529.1) - '@aws-sdk/types': 3.523.0 - '@smithy/property-provider': 2.1.4 - '@smithy/shared-ini-file-loader': 2.3.5 - '@smithy/types': 2.11.0 - tslib: 2.6.2 - transitivePeerDependencies: - - '@aws-sdk/credential-provider-node' - - aws-crt - - '@aws-sdk/types@3.523.0': - dependencies: - '@smithy/types': 2.11.0 - tslib: 2.6.2 - - '@aws-sdk/util-endpoints@3.525.0': - dependencies: - '@aws-sdk/types': 3.523.0 - '@smithy/types': 2.11.0 - '@smithy/util-endpoints': 1.1.5 - tslib: 2.6.2 - - '@aws-sdk/util-locate-window@3.495.0': - dependencies: - tslib: 2.6.2 - - '@aws-sdk/util-user-agent-browser@3.523.0': - dependencies: - '@aws-sdk/types': 3.523.0 - '@smithy/types': 2.11.0 - bowser: 2.11.0 - tslib: 2.6.2 - - '@aws-sdk/util-user-agent-node@3.525.0': - dependencies: - '@aws-sdk/types': 3.523.0 - '@smithy/node-config-provider': 2.2.5 - '@smithy/types': 2.11.0 - tslib: 2.6.2 - - '@aws-sdk/util-utf8-browser@3.259.0': - dependencies: - tslib: 2.6.2 - - '@aws-sdk/xml-builder@3.523.0': - dependencies: - '@smithy/types': 2.11.0 - tslib: 2.6.2 - - '@fastify/busboy@2.1.1': {} - - '@octokit/auth-token@4.0.0': {} - - '@octokit/core@5.1.0': - dependencies: - '@octokit/auth-token': 4.0.0 - '@octokit/graphql': 7.0.2 - '@octokit/request': 8.2.0 - '@octokit/request-error': 5.0.1 - '@octokit/types': 12.6.0 - before-after-hook: 2.2.3 - universal-user-agent: 6.0.1 - - '@octokit/endpoint@9.0.4': - dependencies: - '@octokit/types': 12.6.0 - universal-user-agent: 6.0.1 - - '@octokit/graphql@7.0.2': - dependencies: - '@octokit/request': 8.2.0 - '@octokit/types': 12.6.0 - universal-user-agent: 6.0.1 - - '@octokit/openapi-types@20.0.0': {} - - '@octokit/plugin-paginate-rest@9.2.1(@octokit/core@5.1.0)': - dependencies: - '@octokit/core': 5.1.0 - '@octokit/types': 12.6.0 - - '@octokit/plugin-request-log@4.0.1(@octokit/core@5.1.0)': - dependencies: - '@octokit/core': 5.1.0 - - '@octokit/plugin-rest-endpoint-methods@10.4.1(@octokit/core@5.1.0)': - dependencies: - '@octokit/core': 5.1.0 - '@octokit/types': 12.6.0 - - '@octokit/request-error@5.0.1': - dependencies: - '@octokit/types': 12.6.0 - deprecation: 2.3.1 - once: 1.4.0 - - '@octokit/request@8.2.0': - dependencies: - '@octokit/endpoint': 9.0.4 - '@octokit/request-error': 5.0.1 - '@octokit/types': 12.6.0 - universal-user-agent: 6.0.1 - - '@octokit/rest@20.0.2': - dependencies: - '@octokit/core': 5.1.0 - '@octokit/plugin-paginate-rest': 9.2.1(@octokit/core@5.1.0) - '@octokit/plugin-request-log': 4.0.1(@octokit/core@5.1.0) - '@octokit/plugin-rest-endpoint-methods': 10.4.1(@octokit/core@5.1.0) - - '@octokit/types@12.6.0': - dependencies: - '@octokit/openapi-types': 20.0.0 - - '@smithy/abort-controller@2.1.4': - dependencies: - '@smithy/types': 2.11.0 - tslib: 2.6.2 - - '@smithy/config-resolver@2.1.5': - dependencies: - '@smithy/node-config-provider': 2.2.5 - '@smithy/types': 2.11.0 - '@smithy/util-config-provider': 2.2.1 - '@smithy/util-middleware': 2.1.4 - tslib: 2.6.2 - - '@smithy/core@1.3.8': - dependencies: - '@smithy/middleware-endpoint': 2.4.6 - '@smithy/middleware-retry': 2.1.7 - '@smithy/middleware-serde': 2.2.1 - '@smithy/protocol-http': 3.2.2 - '@smithy/smithy-client': 2.4.5 - '@smithy/types': 2.11.0 - '@smithy/util-middleware': 2.1.4 - tslib: 2.6.2 - - '@smithy/credential-provider-imds@2.2.6': - dependencies: - '@smithy/node-config-provider': 2.2.5 - '@smithy/property-provider': 2.1.4 - '@smithy/types': 2.11.0 - '@smithy/url-parser': 2.1.4 - tslib: 2.6.2 - - '@smithy/eventstream-codec@2.1.4': - dependencies: - '@aws-crypto/crc32': 3.0.0 - '@smithy/types': 2.11.0 - '@smithy/util-hex-encoding': 2.1.1 - tslib: 2.6.2 - - '@smithy/fetch-http-handler@2.4.5': - dependencies: - '@smithy/protocol-http': 3.2.2 - '@smithy/querystring-builder': 2.1.4 - '@smithy/types': 2.11.0 - '@smithy/util-base64': 2.2.1 - tslib: 2.6.2 - - '@smithy/hash-node@2.1.4': - dependencies: - '@smithy/types': 2.11.0 - '@smithy/util-buffer-from': 2.1.1 - '@smithy/util-utf8': 2.2.0 - tslib: 2.6.2 - - '@smithy/invalid-dependency@2.1.4': - dependencies: - '@smithy/types': 2.11.0 - tslib: 2.6.2 - - '@smithy/is-array-buffer@2.1.1': - dependencies: - tslib: 2.6.2 - - '@smithy/middleware-content-length@2.1.4': - dependencies: - '@smithy/protocol-http': 3.2.2 - '@smithy/types': 2.11.0 - tslib: 2.6.2 - - '@smithy/middleware-endpoint@2.4.6': - dependencies: - '@smithy/middleware-serde': 2.2.1 - '@smithy/node-config-provider': 2.2.5 - '@smithy/shared-ini-file-loader': 2.3.5 - '@smithy/types': 2.11.0 - '@smithy/url-parser': 2.1.4 - '@smithy/util-middleware': 2.1.4 - tslib: 2.6.2 - - '@smithy/middleware-retry@2.1.7': - dependencies: - '@smithy/node-config-provider': 2.2.5 - '@smithy/protocol-http': 3.2.2 - '@smithy/service-error-classification': 2.1.4 - '@smithy/smithy-client': 2.4.5 - '@smithy/types': 2.11.0 - '@smithy/util-middleware': 2.1.4 - '@smithy/util-retry': 2.1.4 - tslib: 2.6.2 - uuid: 8.3.2 - - '@smithy/middleware-serde@2.2.1': - dependencies: - '@smithy/types': 2.11.0 - tslib: 2.6.2 - - '@smithy/middleware-stack@2.1.4': - dependencies: - '@smithy/types': 2.11.0 - tslib: 2.6.2 - - '@smithy/node-config-provider@2.2.5': - dependencies: - '@smithy/property-provider': 2.1.4 - '@smithy/shared-ini-file-loader': 2.3.5 - '@smithy/types': 2.11.0 - tslib: 2.6.2 - - '@smithy/node-http-handler@2.4.3': - dependencies: - '@smithy/abort-controller': 2.1.4 - '@smithy/protocol-http': 3.2.2 - '@smithy/querystring-builder': 2.1.4 - '@smithy/types': 2.11.0 - tslib: 2.6.2 - - '@smithy/property-provider@2.1.4': - dependencies: - '@smithy/types': 2.11.0 - tslib: 2.6.2 - - '@smithy/protocol-http@3.2.2': - dependencies: - '@smithy/types': 2.11.0 - tslib: 2.6.2 - - '@smithy/querystring-builder@2.1.4': - dependencies: - '@smithy/types': 2.11.0 - '@smithy/util-uri-escape': 2.1.1 - tslib: 2.6.2 - - '@smithy/querystring-parser@2.1.4': - dependencies: - '@smithy/types': 2.11.0 - tslib: 2.6.2 - - '@smithy/service-error-classification@2.1.4': - dependencies: - '@smithy/types': 2.11.0 - - '@smithy/shared-ini-file-loader@2.3.5': - dependencies: - '@smithy/types': 2.11.0 - tslib: 2.6.2 - - '@smithy/signature-v4@2.1.4': - dependencies: - '@smithy/eventstream-codec': 2.1.4 - '@smithy/is-array-buffer': 2.1.1 - '@smithy/types': 2.11.0 - '@smithy/util-hex-encoding': 2.1.1 - '@smithy/util-middleware': 2.1.4 - '@smithy/util-uri-escape': 2.1.1 - '@smithy/util-utf8': 2.2.0 - tslib: 2.6.2 - - '@smithy/smithy-client@2.4.5': - dependencies: - '@smithy/middleware-endpoint': 2.4.6 - '@smithy/middleware-stack': 2.1.4 - '@smithy/protocol-http': 3.2.2 - '@smithy/types': 2.11.0 - '@smithy/util-stream': 2.1.5 - tslib: 2.6.2 - - '@smithy/types@2.11.0': - dependencies: - tslib: 2.6.2 - - '@smithy/url-parser@2.1.4': - dependencies: - '@smithy/querystring-parser': 2.1.4 - '@smithy/types': 2.11.0 - tslib: 2.6.2 - - '@smithy/util-base64@2.2.1': - dependencies: - '@smithy/util-buffer-from': 2.1.1 - '@smithy/util-utf8': 2.2.0 - tslib: 2.6.2 - - '@smithy/util-body-length-browser@2.1.1': - dependencies: - tslib: 2.6.2 - - '@smithy/util-body-length-node@2.2.2': - dependencies: - tslib: 2.6.2 - - '@smithy/util-buffer-from@2.1.1': - dependencies: - '@smithy/is-array-buffer': 2.1.1 - tslib: 2.6.2 - - '@smithy/util-config-provider@2.2.1': - dependencies: - tslib: 2.6.2 - - '@smithy/util-defaults-mode-browser@2.1.7': - dependencies: - '@smithy/property-provider': 2.1.4 - '@smithy/smithy-client': 2.4.5 - '@smithy/types': 2.11.0 - bowser: 2.11.0 - tslib: 2.6.2 - - '@smithy/util-defaults-mode-node@2.2.7': - dependencies: - '@smithy/config-resolver': 2.1.5 - '@smithy/credential-provider-imds': 2.2.6 - '@smithy/node-config-provider': 2.2.5 - '@smithy/property-provider': 2.1.4 - '@smithy/smithy-client': 2.4.5 - '@smithy/types': 2.11.0 - tslib: 2.6.2 - - '@smithy/util-endpoints@1.1.5': - dependencies: - '@smithy/node-config-provider': 2.2.5 - '@smithy/types': 2.11.0 - tslib: 2.6.2 - - '@smithy/util-hex-encoding@2.1.1': - dependencies: - tslib: 2.6.2 - - '@smithy/util-middleware@2.1.4': - dependencies: - '@smithy/types': 2.11.0 - tslib: 2.6.2 - - '@smithy/util-retry@2.1.4': - dependencies: - '@smithy/service-error-classification': 2.1.4 - '@smithy/types': 2.11.0 - tslib: 2.6.2 - - '@smithy/util-stream@2.1.5': - dependencies: - '@smithy/fetch-http-handler': 2.4.5 - '@smithy/node-http-handler': 2.4.3 - '@smithy/types': 2.11.0 - '@smithy/util-base64': 2.2.1 - '@smithy/util-buffer-from': 2.1.1 - '@smithy/util-hex-encoding': 2.1.1 - '@smithy/util-utf8': 2.2.0 - tslib: 2.6.2 - - '@smithy/util-uri-escape@2.1.1': - dependencies: - tslib: 2.6.2 - - '@smithy/util-utf8@2.2.0': - dependencies: - '@smithy/util-buffer-from': 2.1.1 - tslib: 2.6.2 - - '@smithy/util-waiter@2.1.4': - dependencies: - '@smithy/abort-controller': 2.1.4 - '@smithy/types': 2.11.0 - tslib: 2.6.2 - - before-after-hook@2.2.3: {} - - bowser@2.11.0: {} - - deprecation@2.3.1: {} - - fast-xml-parser@4.2.5: - dependencies: - strnum: 1.0.5 - - once@1.4.0: - dependencies: - wrappy: 1.0.2 - - strnum@1.0.5: {} - - tslib@1.14.1: {} - - tslib@2.6.2: {} - - tunnel@0.0.6: {} - - undici@5.28.3: - dependencies: - '@fastify/busboy': 2.1.1 - - universal-user-agent@6.0.1: {} - - uuid@8.3.2: {} - - wrappy@1.0.2: {} diff --git a/.github/scripts/crib/pr-comment-crib-env.js b/.github/scripts/crib/pr-comment-crib-env.js deleted file mode 100755 index cc36a9deb7b..00000000000 --- a/.github/scripts/crib/pr-comment-crib-env.js +++ /dev/null @@ -1,145 +0,0 @@ -#!/usr/bin/env node - -import * as core from "@actions/core"; -import * as github from "@actions/github"; -import { route53RecordsExist } from "./lib/check-route53-records.js"; - -function generateSubdomains(subdomainPrefix, prNumber) { - const subDomainSuffixes = [ - "node1", - "node2", - "node3", - "node4", - "node5", - "geth-1337-http", - "geth-1337-ws", - "geth-2337-http", - "geth-2337-ws", - "mockserver", - ]; - return subDomainSuffixes.map( - (suffix) => `${subdomainPrefix}-${prNumber}-${suffix}` - ); -} - -async function commentExists(octokit, owner, repo, prNumber, uniqueIdentifier) { - // This will automatically paginate through all comments - const comments = await octokit.paginate(octokit.rest.issues.listComments, { - owner, - repo, - issue_number: prNumber, - }); - - // Check each comment for the unique identifier - return comments.some((comment) => comment.body.includes(uniqueIdentifier)); -} - -async function run() { - try { - const token = process.env.GITHUB_TOKEN; - const route53ZoneId = process.env.ROUTE53_ZONE_ID; - const subdomainPrefix = process.env.SUBDOMAIN_PREFIX || "crib-chainlink"; - - // Check for the existence of GITHUB_TOKEN and ROUTE53_ZONE_ID - if (!token || !route53ZoneId) { - core.setFailed( - "Error: Missing required environment variables: GITHUB_TOKEN or ROUTE53_ZONE_ID." - ); - return; - } - - const octokit = github.getOctokit(token); - const context = github.context; - - const labelsToCheck = ["crib"]; - const { owner, repo } = context.repo; - const prNumber = context.issue.number; - - if (!prNumber) { - core.setFailed("Error: Could not get PR number from context"); - return; - } - - // List labels on the PR - const { data: labels } = await octokit.rest.issues.listLabelsOnIssue({ - owner, - repo, - issue_number: prNumber, - }); - - // Check if any label matches the labelsToCheck - const labelMatches = labels.some((label) => - labelsToCheck.includes(label.name) - ); - - if (!labelMatches) { - core.info("No 'crib' PR label found. Proceeding."); - return; - } - - const subdomains = generateSubdomains(subdomainPrefix, prNumber); - core.debug("Subdomains:", subdomains); - - // Comment header and unique identifier - const commentHeader = "## CRIB Environment Details"; - - // Check if the comment already exists - if (await commentExists(octokit, owner, repo, prNumber, commentHeader)) { - core.info("CRIB environment comment already exists. Skipping."); - return; - } - - // Check if DNS records exist in Route 53 before printing out the subdomains. - try { - const maxRetries = 8; - const recordsExist = await route53RecordsExist( - route53ZoneId, - subdomains, - maxRetries - ); - if (recordsExist) { - core.info("Route 53 DNS records exist."); - } else { - core.setFailed( - "Route 53 DNS records do not exist. Please check the Route 53 hosted zone." - ); - return; - } - } catch (error) { - core.setFailed(error.message); - return; - } - - const subdomainsFormatted = subdomains - .map((subdomain) => `- ${subdomain}.`) - .join("\n"); - - // Construct the comment - const comment = `${commentHeader} :information_source: - -CRIB activated via the 'crib' label. To destroy the environment, remove the 'crib' PR label or close the PR. - -Please review the following details: - -### Subdomains - -_Use these subdomains to access the CRIB environment. They are prefixes to the internal base domain which work over the VPN._ - -${subdomainsFormatted} - -**NOTE:** If you have trouble resolving these subdomains, please try to reset your VPN DNS and/or local DNS. -`; - - // Create a comment on the PR - await octokit.rest.issues.createComment({ - owner, - repo, - issue_number: prNumber, - body: comment, - }); - } catch (error) { - core.setFailed(error.message); - } -} - -run(); diff --git a/.github/scripts/functions.sh b/.github/scripts/functions.sh deleted file mode 100644 index 53b53392269..00000000000 --- a/.github/scripts/functions.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -# Function to convert a comma-separated list into a TOML array format. -# Usage: convert_to_toml_array "elem1,elem2,elem3" -# Effect: "a,b,c" -> ["a","b","c"] -function convert_to_toml_array() { - local IFS=',' - local input_array=($1) - local toml_array_format="[" - - for element in "${input_array[@]}"; do - toml_array_format+="\"$element\"," - done - - toml_array_format="${toml_array_format%,}]" - echo "$toml_array_format" -} \ No newline at end of file diff --git a/.github/scripts/jira/package.json b/.github/scripts/jira/package.json deleted file mode 100644 index 2c57d35a647..00000000000 --- a/.github/scripts/jira/package.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "jira", - "version": "0.1.0", - "description": "Updates Jira issue with release information like the version and tags for a PR.", - "main": "update-jira-issue.js", - "type": "module", - "private": true, - "keywords": [], - "author": "", - "license": "MIT", - "engines": { - "node": ">=18", - "pnpm": ">=9" - }, - "dependencies": { - "@actions/core": "^1.10.1", - "node-fetch": "^2.7.0" - } -} diff --git a/.github/scripts/jira/pnpm-lock.yaml b/.github/scripts/jira/pnpm-lock.yaml deleted file mode 100644 index 09ba8c749cc..00000000000 --- a/.github/scripts/jira/pnpm-lock.yaml +++ /dev/null @@ -1,93 +0,0 @@ -lockfileVersion: '9.0' - -settings: - autoInstallPeers: true - excludeLinksFromLockfile: false - -importers: - - .: - dependencies: - '@actions/core': - specifier: ^1.10.1 - version: 1.10.1 - node-fetch: - specifier: ^2.7.0 - version: 2.7.0 - -packages: - - '@actions/core@1.10.1': - resolution: {integrity: sha512-3lBR9EDAY+iYIpTnTIXmWcNbX3T2kCkAEQGIQx4NVQ0575nk2k3GRZDTPQG+vVtS2izSLmINlxXf0uLtnrTP+g==} - - '@actions/http-client@2.2.1': - resolution: {integrity: sha512-KhC/cZsq7f8I4LfZSJKgCvEwfkE8o1538VoBeoGzokVLLnbFDEAdFD3UhoMklxo2un9NJVBdANOresx7vTHlHw==} - - '@fastify/busboy@2.1.1': - resolution: {integrity: sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA==} - engines: {node: '>=14'} - - node-fetch@2.7.0: - resolution: {integrity: sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==} - engines: {node: 4.x || >=6.0.0} - peerDependencies: - encoding: ^0.1.0 - peerDependenciesMeta: - encoding: - optional: true - - tr46@0.0.3: - resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} - - tunnel@0.0.6: - resolution: {integrity: sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==} - engines: {node: '>=0.6.11 <=0.7.0 || >=0.7.3'} - - undici@5.28.4: - resolution: {integrity: sha512-72RFADWFqKmUb2hmmvNODKL3p9hcB6Gt2DOQMis1SEBaV6a4MH8soBvzg+95CYhCKPFedut2JY9bMfrDl9D23g==} - engines: {node: '>=14.0'} - - uuid@8.3.2: - resolution: {integrity: sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==} - hasBin: true - - webidl-conversions@3.0.1: - resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==} - - whatwg-url@5.0.0: - resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==} - -snapshots: - - '@actions/core@1.10.1': - dependencies: - '@actions/http-client': 2.2.1 - uuid: 8.3.2 - - '@actions/http-client@2.2.1': - dependencies: - tunnel: 0.0.6 - undici: 5.28.4 - - '@fastify/busboy@2.1.1': {} - - node-fetch@2.7.0: - dependencies: - whatwg-url: 5.0.0 - - tr46@0.0.3: {} - - tunnel@0.0.6: {} - - undici@5.28.4: - dependencies: - '@fastify/busboy': 2.1.1 - - uuid@8.3.2: {} - - webidl-conversions@3.0.1: {} - - whatwg-url@5.0.0: - dependencies: - tr46: 0.0.3 - webidl-conversions: 3.0.1 diff --git a/.github/scripts/jira/update-jira-issue.js b/.github/scripts/jira/update-jira-issue.js deleted file mode 100644 index 77d5b81bff8..00000000000 --- a/.github/scripts/jira/update-jira-issue.js +++ /dev/null @@ -1,118 +0,0 @@ -#!/usr/bin/env node - -import * as core from "@actions/core"; -import fetch from "node-fetch"; - -function parseIssueNumber(prTitle, commitMessage, branchName) { - const jiraIssueRegex = /[A-Z]{2,}-\d+/; - if (!!branchName && jiraIssueRegex.test(branchName.toUpperCase())) { - return branchName.toUpperCase().match(jiraIssueRegex)[0]; - } else if ( - !!commitMessage && - jiraIssueRegex.test(commitMessage.toUpperCase()) - ) { - return commitMessage.toUpperCase().match(jiraIssueRegex)[0]; - } else if (!!prTitle && jiraIssueRegex.test(prTitle.toUpperCase())) { - return prTitle.toUpperCase().match(jiraIssueRegex)[0]; - } else { - return null; - } -} - -function getLabels(tags) { - const labelPrefix = "core-release"; - return tags.map((tag) => { - return { - add: `${labelPrefix}/${tag.substring(1)}`, - }; - }); -} - -async function updateJiraIssue( - jiraHost, - jiraUserName, - jiraApiToken, - issueNumber, - tags, - fixVersionName -) { - const token = Buffer.from(`${jiraUserName}:${jiraApiToken}`).toString( - "base64" - ); - const bodyData = { - update: { - labels: getLabels(tags), - fixVersions: [{ set: [{ name: fixVersionName }] }], - }, - }; - - fetch(`https://${jiraHost}/rest/api/3/issue/${issueNumber}`, { - method: "PUT", - headers: { - Authorization: `Basic ${token}`, - Accept: "application/json", - "Content-Type": "application/json", - }, - body: JSON.stringify(bodyData), - }) - .then((response) => { - console.log(`Response: ${JSON.stringify(response)}`); - return response.text(); - }) - .then((text) => console.log(text)) - .catch((err) => console.error(err)); -} - -async function run() { - try { - const jiraHost = process.env.JIRA_HOST; - const jiraUserName = process.env.JIRA_USERNAME; - const jiraApiToken = process.env.JIRA_API_TOKEN; - const chainlinkVersion = process.env.CHAINLINK_VERSION; - const prTitle = process.env.PR_TITLE; - const commitMessage = process.env.COMMIT_MESSAGE; - const branchName = process.env.BRANCH_NAME; - // tags are not getting used at the current moment so will always default to [] - const tags = process.env.FOUND_TAGS - ? process.env.FOUND_TAGS.split(",") - : []; - - // Check for the existence of JIRA_HOST and JIRA_USERNAME and JIRA_API_TOKEN - if (!jiraHost || !jiraUserName || !jiraApiToken) { - core.setFailed( - "Error: Missing required environment variables: JIRA_HOST and JIRA_USERNAME and JIRA_API_TOKEN." - ); - return; - } - - // Checks for the Jira issue number and exit if it can't find it - const issueNumber = parseIssueNumber(prTitle, commitMessage, branchName); - if (!issueNumber) { - core.info( - "No JIRA issue number found in: PR title, commit message, or branch name. Please include the issue ID in one of these." - ); - core.notice( - "No JIRA issue number found in: PR title, commit message, or branch name. Please include the issue ID in one of these." - ); - core.setOutput( - "jiraComment", - "> :medal_military: No JIRA issue number found - Please include it in the PR title or in a commit message." - ); - return; - } - const fixVersionName = `chainlink-v${chainlinkVersion}`; - await updateJiraIssue( - jiraHost, - jiraUserName, - jiraApiToken, - issueNumber, - tags, - fixVersionName - ); - core.setOutput("jiraComment", ""); - } catch (error) { - core.setFailed(error.message); - } -} - -run(); diff --git a/.github/workflows/automation-benchmark-tests.yml b/.github/workflows/automation-benchmark-tests.yml index 6a589af49ae..47ffc368ced 100644 --- a/.github/workflows/automation-benchmark-tests.yml +++ b/.github/workflows/automation-benchmark-tests.yml @@ -2,100 +2,54 @@ name: Automation Benchmark Test on: workflow_dispatch: inputs: - testType: - description: Type of test to run (benchmark, soak) - required: true - default: benchmark - type: string - base64Config: - description: base64-ed config - required: true - type: string + test_config_override_path: + description: Path to a test config file used to override the default test config + required: false + type: string + test_secrets_override_key: + description: Key to run tests with custom test secrets + required: false + type: string slackMemberID: description: Notifies test results (Not your @) required: true default: U02Q14G80TY type: string + testType: + description: Type of test to run (benchmark, soak) + required: true + default: benchmark + type: string + jobs: - automation_benchmark: - environment: integration - permissions: - checks: write - pull-requests: write - id-token: write - contents: read - name: Automation Benchmark Test - runs-on: ubuntu22.04-16cores-64GB - env: - SLACK_API_KEY: ${{ secrets.QA_SLACK_API_KEY }} + run-e2e-tests-workflow: + name: Run E2E Tests + uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@827d85b57065211ddd254457a7cf21581d85092d + with: + test_path: .github/e2e-tests.yml + test_ids: '${{ inputs.testType }}/automation_test.go:TestAutomationBenchmark' + test_config_override_path: ${{ inputs.test_config_override_path }} + SLACK_USER: ${{ inputs.slackMemberID }} SLACK_CHANNEL: C03KJ5S7KEK - CHAINLINK_ENV_USER: ${{ github.actor }} - REF_NAME: ${{ github.head_ref || github.ref_name }} - steps: - - name: Checkout the repo - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 - with: - ref: ${{ env.REF_NAME }} - - name: Get Slack config and mask base64 config - run: | - SLACK_USER=$(jq -r '.inputs.slackMemberID' $GITHUB_EVENT_PATH) - echo ::add-mask::$SLACK_USER - echo SLACK_USER=$SLACK_USER >> $GITHUB_ENV - - BASE64_CONFIG_OVERRIDE=$(jq -r '.inputs.base64Config' $GITHUB_EVENT_PATH) - echo ::add-mask::$BASE64_CONFIG_OVERRIDE - echo "BASE64_CONFIG_OVERRIDE=$BASE64_CONFIG_OVERRIDE" >> $GITHUB_ENV - - name: Parse base64 config - uses: ./.github/actions/setup-parse-base64-config - with: - base64Config: ${{ env.BASE64_CONFIG_OVERRIDE }} - - name: Send details to Step Summary - shell: bash - run: | - echo "### chainlink image used for this test run :link:" >>$GITHUB_STEP_SUMMARY - echo "\`${{ env.CHAINLINK_IMAGE }}\`" >>$GITHUB_STEP_SUMMARY - echo "### chainlink-tests image tag for this test run :ship:" >>$GITHUB_STEP_SUMMARY - echo "\`${GITHUB_SHA}\`" >>$GITHUB_STEP_SUMMARY - echo "### Networks on which test was run" >>$GITHUB_STEP_SUMMARY - echo "\`${{ env.NETWORKS }}\`" >>$GITHUB_STEP_SUMMARY - - name: Build Test Image - uses: ./.github/actions/build-test-image - with: - QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} - QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} - QA_AWS_ACCOUNT_NUMBER: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }} - suites: benchmark chaos reorg load - - name: Run Tests - uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests@75a9005952a9e905649cfb5a6971fd9429436acd # v2.3.25 - env: - DETACH_RUNNER: true - TEST_SUITE: benchmark - TEST_ARGS: -test.timeout 720h - ENV_JOB_IMAGE: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/chainlink-tests:${{ github.sha }} - INTERNAL_DOCKER_REPO: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com - TEST_TYPE: ${{ github.event.inputs.testType }} - TEST_TEST_TYPE: ${{ github.event.inputs.testType }} - RR_MEM: 4Gi - TEST_LOG_LEVEL: info - with: - test_command_to_run: cd integration-tests && go test -timeout 30m -v -run ^TestAutomationBenchmark$ ./benchmark -count=1 - test_download_vendor_packages_command: make gomod - cl_repo: ${{ env.CHAINLINK_IMAGE }} - cl_image_tag: ${{ env.CHAINLINK_VERSION }} - token: ${{ secrets.GITHUB_TOKEN }} - should_cleanup: false - go_mod_path: ./integration-tests/go.mod - QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} - QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} - QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }} - - name: Collect Metrics - if: always() - id: collect-gha-metrics - uses: smartcontractkit/push-gha-metrics-action@d9da21a2747016b3e13de58c7d4115a3d5c97935 # v3.0.1 - with: - id: automation-benchmark-build-test-image - org-id: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} - basic-auth: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} - hostname: ${{ secrets.GRAFANA_INTERNAL_HOST }} - this-job-name: Automation Benchmark Test - continue-on-error: true + secrets: + QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} + QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} + QA_AWS_ACCOUNT_NUMBER: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }} + PROD_AWS_ACCOUNT_NUMBER: ${{ secrets.AWS_ACCOUNT_ID_PROD }} + QA_PYROSCOPE_INSTANCE: ${{ secrets.QA_PYROSCOPE_INSTANCE }} + QA_PYROSCOPE_KEY: ${{ secrets.QA_PYROSCOPE_KEY }} + QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }} + GRAFANA_INTERNAL_TENANT_ID: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} + GRAFANA_INTERNAL_BASIC_AUTH: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} + GRAFANA_INTERNAL_HOST: ${{ secrets.GRAFANA_INTERNAL_HOST }} + GRAFANA_INTERNAL_URL_SHORTENER_TOKEN: ${{ secrets.GRAFANA_INTERNAL_URL_SHORTENER_TOKEN }} + LOKI_TENANT_ID: ${{ secrets.LOKI_TENANT_ID }} + LOKI_URL: https://${{ secrets.GRAFANA_INTERNAL_HOST }}/loki/api/v1/push + LOKI_BASIC_AUTH: ${{ secrets.LOKI_BASIC_AUTH }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + AWS_REGION: ${{ secrets.QA_AWS_REGION }} + AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN: ${{ secrets.AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN }} + AWS_API_GW_HOST_GRAFANA: ${{ secrets.AWS_API_GW_HOST_GRAFANA }} + TEST_SECRETS_OVERRIDE_BASE64: ${{ secrets[inputs.test_secrets_override_key] }} + SLACK_BOT_TOKEN: ${{ secrets.QA_SLACK_API_KEY }} + SLACK_API_KEY: ${{ secrets.QA_SLACK_API_KEY }} diff --git a/.github/workflows/automation-load-tests.yml b/.github/workflows/automation-load-tests.yml index a237b5b7dd5..a7d58e39783 100644 --- a/.github/workflows/automation-load-tests.yml +++ b/.github/workflows/automation-load-tests.yml @@ -2,116 +2,49 @@ name: Automation Load Test on: workflow_dispatch: inputs: - base64Config: - description: base64-ed config - required: true - type: string + test_config_override_path: + description: Path to a test config file used to override the default test config + required: false + type: string + test_secrets_override_key: + description: 'Key to run tests with custom test secrets' + required: false + type: string slackMemberID: description: Notifies test results (Not your @) required: true default: U02Q14G80TY - type: string + type: string jobs: - automation_load: - environment: integration - permissions: - checks: write - pull-requests: write - id-token: write - contents: read - name: Automation Load Test - runs-on: ubuntu22.04-16cores-64GB - env: - SLACK_API_KEY: ${{ secrets.QA_SLACK_API_KEY }} + run-e2e-tests-workflow: + name: Run E2E Tests + uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@827d85b57065211ddd254457a7cf21581d85092d + with: + test_path: .github/e2e-tests.yml + test_ids: 'load/automationv2_1/automationv2_1_test.go:TestLogTrigger' + test_config_override_path: ${{ inputs.test_config_override_path }} + SLACK_USER: ${{ inputs.slackMemberID }} SLACK_CHANNEL: C03KJ5S7KEK - CHAINLINK_ENV_USER: ${{ github.actor }} - REF_NAME: ${{ github.head_ref || github.ref_name }} - steps: - - name: Checkout the repo - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 - with: - ref: ${{ env.REF_NAME }} - - name: Get Slack config and mask base64 config - run: | - SLACK_USER=$(jq -r '.inputs.slackMemberID' $GITHUB_EVENT_PATH) - echo ::add-mask::$SLACK_USER - echo SLACK_USER=$SLACK_USER >> $GITHUB_ENV - - BASE64_CONFIG_OVERRIDE=$(jq -r '.inputs.base64Config' $GITHUB_EVENT_PATH) - echo ::add-mask::$BASE64_CONFIG_OVERRIDE - echo "BASE64_CONFIG_OVERRIDE=$BASE64_CONFIG_OVERRIDE" >> $GITHUB_ENV - - name: Merge Pyrsoscope config - env: - PYROSCOPE_SERVER: ${{ secrets.QA_PYROSCOPE_INSTANCE }} - PYROSCOPE_ENVIRONMENT: "automation-load-test" - PYROSCOPE_KEY: ${{ secrets.QA_PYROSCOPE_KEY }} - run: | - decoded_toml=$(echo $BASE64_CONFIG_OVERRIDE | base64 -d) - - # use Pyroscope config from GH secrets and merge it with base64 input - cat << EOF > config.toml - server_url="$PYROSCOPE_SERVER" - environment="$PYROSCOPE_ENVIRONMENT" - key_secret="$PYROSCOPE_KEY" - EOF - - echo "$decoded_toml" >> final_config.toml - cat config.toml >> final_config.toml - BASE64_CONFIG_OVERRIDE=$(cat final_config.toml | base64 -w 0) - echo ::add-mask::$BASE64_CONFIG_OVERRIDE - echo "BASE64_CONFIG_OVERRIDE=$BASE64_CONFIG_OVERRIDE" >> $GITHUB_ENV - - name: Parse base64 config - uses: ./.github/actions/setup-parse-base64-config - with: - base64Config: ${{ env.BASE64_CONFIG_OVERRIDE }} - - name: Send details to Step Summary - shell: bash - run: | - echo "### chainlink image used for this test run :link:" >>$GITHUB_STEP_SUMMARY - echo "\`${{ env.CHAINLINK_IMAGE }}\`" >>$GITHUB_STEP_SUMMARY - echo "### chainlink-tests image tag for this test run :ship:" >>$GITHUB_STEP_SUMMARY - echo "\`${GITHUB_SHA}\`" >>$GITHUB_STEP_SUMMARY - echo "### Networks on which test was run" >>$GITHUB_STEP_SUMMARY - echo "\`${{ env.NETWORKS }}\`" >>$GITHUB_STEP_SUMMARY - - name: Build Test Image - uses: ./.github/actions/build-test-image - with: - QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} - QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} - QA_AWS_ACCOUNT_NUMBER: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }} - suites: benchmark chaos reorg load - - name: Run Tests - uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests@75a9005952a9e905649cfb5a6971fd9429436acd # v2.3.25 - env: - RR_CPU: 4000m - RR_MEM: 4Gi - DETACH_RUNNER: true - TEST_SUITE: automationv2_1 - TEST_ARGS: -test.timeout 720h - ENV_JOB_IMAGE: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/chainlink-tests:${{ github.sha }} - INTERNAL_DOCKER_REPO: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com - PYROSCOPE_SERVER: ${{ secrets.QA_PYROSCOPE_INSTANCE }} - PYROSCOPE_KEY: ${{ secrets.QA_PYROSCOPE_KEY }} - with: - test_command_to_run: cd integration-tests/load && go test -timeout 1h -v -run TestLogTrigger ./automationv2_1 -count=1 - test_download_vendor_packages_command: make gomod - cl_repo: ${{ env.CHAINLINK_IMAGE }} - cl_image_tag: ${{ env.CHAINLINK_VERSION }} - token: ${{ secrets.GITHUB_TOKEN }} - should_cleanup: false - go_mod_path: ./integration-tests/go.mod - QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} - QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} - QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }} - - name: Collect Metrics - if: always() - id: collect-gha-metrics - uses: smartcontractkit/push-gha-metrics-action@d9da21a2747016b3e13de58c7d4115a3d5c97935 # v3.0.1 - with: - id: automation-load-test - org-id: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} - basic-auth: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} - hostname: ${{ secrets.GRAFANA_INTERNAL_HOST }} - this-job-name: Automation Load Test - continue-on-error: true + secrets: + QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} + QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} + QA_AWS_ACCOUNT_NUMBER: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }} + PROD_AWS_ACCOUNT_NUMBER: ${{ secrets.AWS_ACCOUNT_ID_PROD }} + QA_PYROSCOPE_INSTANCE: ${{ secrets.QA_PYROSCOPE_INSTANCE }} + QA_PYROSCOPE_KEY: ${{ secrets.QA_PYROSCOPE_KEY }} + QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }} + GRAFANA_INTERNAL_TENANT_ID: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} + GRAFANA_INTERNAL_BASIC_AUTH: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} + GRAFANA_INTERNAL_HOST: ${{ secrets.GRAFANA_INTERNAL_HOST }} + GRAFANA_INTERNAL_URL_SHORTENER_TOKEN: ${{ secrets.GRAFANA_INTERNAL_URL_SHORTENER_TOKEN }} + LOKI_TENANT_ID: ${{ secrets.LOKI_TENANT_ID }} + LOKI_URL: https://${{ secrets.GRAFANA_INTERNAL_HOST }}/loki/api/v1/push + LOKI_BASIC_AUTH: ${{ secrets.LOKI_BASIC_AUTH }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + AWS_REGION: ${{ secrets.QA_AWS_REGION }} + AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN: ${{ secrets.AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN }} + AWS_API_GW_HOST_GRAFANA: ${{ secrets.AWS_API_GW_HOST_GRAFANA }} + TEST_SECRETS_OVERRIDE_BASE64: ${{ secrets[inputs.test_secrets_override_key] }} + SLACK_BOT_TOKEN: ${{ secrets.QA_SLACK_API_KEY }} + SLACK_API_KEY: ${{ secrets.QA_SLACK_API_KEY }} diff --git a/.github/workflows/automation-nightly-tests.yml b/.github/workflows/automation-nightly-tests.yml index 5925a8195f0..efc5cbf59bc 100644 --- a/.github/workflows/automation-nightly-tests.yml +++ b/.github/workflows/automation-nightly-tests.yml @@ -7,294 +7,36 @@ on: - "*" workflow_dispatch: -env: - CHAINLINK_IMAGE: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/chainlink - jobs: - build-chainlink: - environment: integration - permissions: - id-token: write - contents: read - name: Build Chainlink Image - runs-on: ubuntu22.04-16cores-64GB - steps: - - name: Collect Metrics - id: collect-gha-metrics - uses: smartcontractkit/push-gha-metrics-action@d9da21a2747016b3e13de58c7d4115a3d5c97935 # v3.0.1 - with: - id: automation-nightly-build-chainlink - org-id: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} - basic-auth: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} - hostname: ${{ secrets.GRAFANA_INTERNAL_HOST }} - this-job-name: Build Chainlink Image - continue-on-error: true - - name: Checkout the repo - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 - with: - ref: ${{ github.event.pull_request.head.sha || github.event.merge_group.head_sha }} - - name: Build Chainlink Image - uses: ./.github/actions/build-chainlink-image - with: - tag_suffix: "" - dockerfile: core/chainlink.Dockerfile - git_commit_sha: ${{ github.sha }} - AWS_REGION: ${{ secrets.QA_AWS_REGION }} - AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} - - automation-upgrade-tests: - environment: integration - permissions: - checks: write - pull-requests: write - id-token: write - contents: read - needs: [build-chainlink] - env: - CHAINLINK_COMMIT_SHA: ${{ github.sha }} - CHAINLINK_ENV_USER: ${{ github.actor }} - TEST_LOG_LEVEL: info - SELECTED_NETWORKS: "SIMULATED" - strategy: - fail-fast: false - matrix: - tests: - - name: Upgrade 2.0 - id: upgrade-2-0 - suite: smoke - nodes: 1 - os: ubuntu22.04-8cores-32GB - network: SIMULATED - command: -run ^TestAutomationNodeUpgrade/registry_2_0 ./smoke - - name: Upgrade 2.1 - id: upgrade-2-1 - suite: smoke - nodes: 5 - os: ubuntu22.04-8cores-32GB - network: SIMULATED - command: -run ^TestAutomationNodeUpgrade/registry_2_1 ./smoke - - name: Upgrade 2.2 - id: upgrade-2-2 - suite: smoke - nodes: 5 - os: ubuntu22.04-8cores-32GB - network: SIMULATED - command: -run ^TestAutomationNodeUpgrade/registry_2_2 ./smoke - runs-on: ${{ matrix.tests.os }} - name: Automation ${{ matrix.tests.name }} Test - steps: - - name: Checkout the repo - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 - with: - ref: ${{ github.head_ref || github.ref_name }} - - name: Setup GAP for Grafana - uses: smartcontractkit/.github/actions/setup-gap@d316f66b2990ea4daa479daa3de6fc92b00f863e # setup-gap@0.3.2 - with: - # aws inputs - aws-region: ${{ secrets.AWS_REGION }} - aws-role-arn: ${{ secrets.AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN }} - api-gateway-host: ${{ secrets.AWS_API_GW_HOST_GRAFANA }} - # other inputs - duplicate-authorization-header: "true" - - name: Prepare Base64 TOML override - uses: ./.github/actions/setup-create-base64-upgrade-config - with: - selectedNetworks: ${{ env.SELECTED_NETWORKS }} - chainlinkImage: "public.ecr.aws/chainlink/chainlink" - chainlinkVersion: "latest" - upgradeImage: ${{ env.CHAINLINK_IMAGE }} - upgradeVersion: ${{ github.sha }} - runId: ${{ github.run_id }} - testLogCollect: "true" - lokiEndpoint: https://${{ secrets.GRAFANA_INTERNAL_HOST }}/loki/api/v1/push - lokiTenantId: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} - lokiBasicAuth: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} - logstreamLogTargets: ${{ vars.LOGSTREAM_LOG_TARGETS }} - grafanaUrl: "http://localhost:8080/primary" - grafanaDashboardUrl: "/d/ddf75041-1e39-42af-aa46-361fe4c36e9e/ci-e2e-tests-logs" - grafanaBearerToken: ${{ secrets.GRAFANA_INTERNAL_URL_SHORTENER_TOKEN }} - - name: Run Tests - uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests@75a9005952a9e905649cfb5a6971fd9429436acd # v2.3.25 - env: - TEST_SUITE: ${{ matrix.tests.suite }} - with: - test_command_to_run: cd ./integration-tests && go test -timeout 60m -count=1 -json -test.parallel=${{ matrix.tests.nodes }} ${{ matrix.tests.command }} 2>&1 | tee /tmp/gotest.log | gotestloghelper -ci -singlepackage -hidepassingtests=false -hidepassinglogs - test_download_vendor_packages_command: cd ./integration-tests && go mod download - cl_repo: 'public.ecr.aws/chainlink/chainlink' - cl_image_tag: 'latest' - aws_registries: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }} - artifacts_location: ./integration-tests/${{ matrix.tests.suite }}/logs - artifacts_name: testcontainers-logs-${{ matrix.tests.name }} - publish_check_name: Automation Results ${{ matrix.tests.name }} - token: ${{ secrets.GITHUB_TOKEN }} - go_mod_path: ./integration-tests/go.mod - QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} - QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} - QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }} - - name: Upload test log - uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 - if: failure() - with: - name: gotest-logs-${{ matrix.tests.name }} - path: /tmp/gotest.log - retention-days: 7 - continue-on-error: true - - name: Collect Metrics - if: always() - id: collect-gha-metrics - uses: smartcontractkit/push-gha-metrics-action@d9da21a2747016b3e13de58c7d4115a3d5c97935 # v3.0.1 - with: - id: automation-nightly-upgrade-tests-${{ matrix.tests.id }} - org-id: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} - basic-auth: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} - hostname: ${{ secrets.GRAFANA_INTERNAL_HOST }} - this-job-name: Automation ${{ matrix.tests.name }} Test - test-results-file: '{"testType":"go","filePath":"/tmp/gotest.log"}' - continue-on-error: true - - name: Print failed test summary - if: always() - uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/show-test-summary@b49a9d04744b0237908831730f8553f26d73a94b # v2.3.17 - - test-notify: - name: Start Slack Thread - if: ${{ always() && needs.*.result != 'skipped' && needs.*.result != 'cancelled' }} - environment: integration - outputs: - thread_ts: ${{ steps.slack.outputs.thread_ts }} - permissions: - checks: write - pull-requests: write - id-token: write - contents: read - runs-on: ubuntu-latest - needs: [ automation-upgrade-tests ] - steps: - - name: Debug Result - run: echo ${{ join(needs.*.result, ',') }} - - name: Main Slack Notification - uses: slackapi/slack-github-action@6c661ce58804a1a20f6dc5fbee7f0381b469e001 # v1.25.0 - id: slack - with: - channel-id: C03KJ5S7KEK - payload: | - { - "attachments": [ - { - "color": "${{ contains(join(needs.*.result, ','), 'failure') && '#C62828' || '#2E7D32' }}", - "blocks": [ - { - "type": "header", - "text": { - "type": "plain_text", - "text": "Automation Nightly Tests ${{ contains(join(needs.*.result, ','), 'failure') && ':x:' || ':white_check_mark:'}}", - "emoji": true - } - }, - { - "type": "divider" - }, - { - "type": "section", - "text": { - "type": "mrkdwn", - "text": "<${{ github.server_url }}/${{ github.repository }}/releases/tag/${{ github.ref_name }}|${{ github.ref_name }}> | <${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}|${{ github.sha }}> | <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|Run>" - } - } - ] - } - ] - } - env: - SLACK_BOT_TOKEN: ${{ secrets.QA_SLACK_API_KEY }} - - test-results: - name: Post Test Results for ${{ matrix.name }} - if: ${{ always() && needs.*.result != 'skipped' && needs.*.result != 'cancelled' }} - environment: integration - permissions: - checks: write - pull-requests: write - id-token: write - contents: read - runs-on: ubuntu-latest - needs: test-notify - strategy: - fail-fast: false - matrix: - name: [ Upgrade 2.0, Upgrade 2.1, Upgrade 2.2 ] - steps: - - name: Get Results - id: test-results - run: | - # I feel like there's some clever, fully jq way to do this, but I ain't got the motivation to figure it out - echo "Querying test results" - - PARSED_RESULTS=$(curl \ - -H "Authorization: Bearer ${{ github.token }}" \ - 'https://api.github.com/repos/${{github.repository}}/actions/runs/${{ github.run_id }}/jobs' \ - | jq -r --arg pattern "${{ matrix.name }} Test" '.jobs[] - | select(.name | test($pattern)) as $job - | $job.steps[] - | select(.name == "Run Tests") - | { conclusion: (if .conclusion == "success" then ":white_check_mark:" else ":x:" end), product: ("*" + ($job.name | capture($pattern).product) + "*") }') - - echo "Parsed Results:" - echo $PARSED_RESULTS - - ALL_SUCCESS=true - for row in $(echo "$PARSED_RESULTS" | jq -s | jq -r '.[] | select(.conclusion != ":white_check_mark:")'); do - success=false - break - done - - echo all_success=$ALL_SUCCESS >> $GITHUB_OUTPUT - - FORMATTED_RESULTS=$(echo $PARSED_RESULTS | jq -s '[.[] - | { - conclusion: .conclusion, - product: .product - } - ] - | map("{\"type\": \"section\", \"text\": {\"type\": \"mrkdwn\", \"text\": \"\(.product): \(.conclusion)\"}}") - | join(",")') - - echo "Formatted Results:" - echo $FORMATTED_RESULTS - - # Cleans out backslashes and quotes from jq - CLEAN_RESULTS=$(echo "$FORMATTED_RESULTS" | sed 's/\\\"/"/g' | sed 's/^"//;s/"$//') - - echo "Clean Results" - echo $CLEAN_RESULTS - - echo results=$CLEAN_RESULTS >> $GITHUB_OUTPUT - - - name: Test Details - uses: slackapi/slack-github-action@6c661ce58804a1a20f6dc5fbee7f0381b469e001 # v1.25.0 - with: - channel-id: C03KJ5S7KEK - payload: | - { - "thread_ts": "${{ needs.test-notify.outputs.thread_ts }}", - "attachments": [ - { - "color": "${{ steps.test-results.outputs.all_success && '#2E7D32' || '#C62828' }}", - "blocks": [ - { - "type": "header", - "text": { - "type": "plain_text", - "text": "${{ matrix.name }} ${{ steps.test-results.outputs.all_success && ':white_check_mark:' || ':x: Notifying <@U02Q14G80TY>'}}", - "emoji": true - } - }, - { - "type": "divider" - }, - ${{ steps.test-results.outputs.results }} - ] - } - ] - } - env: - SLACK_BOT_TOKEN: ${{ secrets.QA_SLACK_API_KEY }} \ No newline at end of file + run-e2e-tests-workflow: + name: Run E2E Tests + uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@827d85b57065211ddd254457a7cf21581d85092d + with: + test_path: .github/e2e-tests.yml + test_trigger: Automation Nightly Tests + chainlink_version: ${{ github.sha }} + slack_notification_after_tests: true + slack_notification_after_tests_channel_id: "#automation-test-notifications" + slack_notification_after_tests_name: Automation Nightly E2E Tests + # slack_notification_after_tests_notify_user_id_on_failure: U0XXXXXXX + secrets: + QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} + QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} + QA_AWS_ACCOUNT_NUMBER: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }} + PROD_AWS_ACCOUNT_NUMBER: ${{ secrets.AWS_ACCOUNT_ID_PROD }} + QA_PYROSCOPE_INSTANCE: ${{ secrets.QA_PYROSCOPE_INSTANCE }} + QA_PYROSCOPE_KEY: ${{ secrets.QA_PYROSCOPE_KEY }} + QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }} + GRAFANA_INTERNAL_TENANT_ID: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} + GRAFANA_INTERNAL_BASIC_AUTH: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} + GRAFANA_INTERNAL_HOST: ${{ secrets.GRAFANA_INTERNAL_HOST }} + GRAFANA_INTERNAL_URL_SHORTENER_TOKEN: ${{ secrets.GRAFANA_INTERNAL_URL_SHORTENER_TOKEN }} + LOKI_TENANT_ID: ${{ secrets.LOKI_TENANT_ID }} + LOKI_URL: https://${{ secrets.GRAFANA_INTERNAL_HOST }}/loki/api/v1/push + LOKI_BASIC_AUTH: ${{ secrets.LOKI_BASIC_AUTH }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + AWS_REGION: ${{ secrets.QA_AWS_REGION }} + AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN: ${{ secrets.AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN }} + AWS_API_GW_HOST_GRAFANA: ${{ secrets.AWS_API_GW_HOST_GRAFANA }} + TEST_SECRETS_OVERRIDE_BASE64: ${{ secrets[inputs.test_secrets_override_key] }} + SLACK_BOT_TOKEN: ${{ secrets.QA_SLACK_API_KEY }} diff --git a/.github/workflows/automation-ondemand-tests.yml b/.github/workflows/automation-ondemand-tests.yml index f0046b341e3..74a98121fea 100644 --- a/.github/workflows/automation-ondemand-tests.yml +++ b/.github/workflows/automation-ondemand-tests.yml @@ -1,23 +1,24 @@ -name: Automation On Demand Tests +name: Run Automation On Demand Tests + on: workflow_dispatch: inputs: - chainlinkVersion: - description: Chainlink image version to use + chainlinkVersionUpdate: + description: Chainlink image version to upgrade to (Leave empty to build from head/ref) required: false type: string - chainlinkImage: - description: Chainlink image repo to use (Leave empty to build from head/ref) + chainlinkImageUpdate: + description: Chainlink image repo to upgrade to options: - - public.ecr.aws/chainlink/chainlink - QA_ECR + - public.ecr.aws/chainlink/chainlink type: choice - chainlinkVersionUpdate: + chainlinkVersion: description: Chainlink image version to use initially for upgrade test default: latest required: true type: string - chainlinkImageUpdate: + chainlinkImage: description: Chainlink image repo to use initially for upgrade test required: true options: @@ -34,300 +35,149 @@ on: type: boolean default: false required: true - -env: - ENV_JOB_IMAGE: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/chainlink-tests:${{ github.sha }} - CHAINLINK_IMAGE: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/chainlink + with_existing_remote_runner_version: + description: 'Tag of the existing remote runner version to use (Leave empty to build from head/ref)' + required: false + type: string jobs: - build-chainlink: - environment: integration - permissions: - id-token: write - contents: read - strategy: - matrix: - image: - - name: "" - dockerfile: core/chainlink.Dockerfile - tag-suffix: "" - - name: (plugins) - dockerfile: plugins/chainlink.Dockerfile - tag-suffix: -plugins - name: Build Chainlink Image ${{ matrix.image.name }} - runs-on: ubuntu22.04-16cores-64GB - steps: - - name: Collect Metrics - if: inputs.chainlinkImage == '' - id: collect-gha-metrics - uses: smartcontractkit/push-gha-metrics-action@d9da21a2747016b3e13de58c7d4115a3d5c97935 # v3.0.1 - with: - id: automation-on-demand-build-chainlink - org-id: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} - basic-auth: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} - hostname: ${{ secrets.GRAFANA_INTERNAL_HOST }} - this-job-name: Build Chainlink Image ${{ matrix.image.name }} - continue-on-error: true - - name: Checkout the repo - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 - with: - ref: ${{ github.head_ref || github.ref_name }} - - name: Check if image exists - if: inputs.chainlinkImage == '' - id: check-image - uses: smartcontractkit/chainlink-github-actions/docker/image-exists@75a9005952a9e905649cfb5a6971fd9429436acd # v2.3.25 - with: - repository: chainlink - tag: ${{ github.sha }}${{ matrix.image.tag-suffix }} - AWS_REGION: ${{ secrets.QA_AWS_REGION }} - AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} - - name: Build Image - if: steps.check-image.outputs.exists == 'false' && inputs.chainlinkImage == '' - uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/build-image@75a9005952a9e905649cfb5a6971fd9429436acd # v2.3.25 - with: - cl_repo: smartcontractkit/chainlink - cl_ref: ${{ github.sha }} - cl_dockerfile: ${{ matrix.image.dockerfile }} - push_tag: ${{ env.CHAINLINK_IMAGE }}:${{ github.sha }}${{ matrix.image.tag-suffix }} - QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} - QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} - - name: Print Chainlink Image Built - if: inputs.chainlinkImage == '' - run: | - echo "### chainlink node image tag used for this test run :link:" >>$GITHUB_STEP_SUMMARY - echo "\`${GITHUB_SHA}\`" >>$GITHUB_STEP_SUMMARY - - build-test-image: - environment: integration - permissions: - id-token: write - contents: read - name: Build Test Image - runs-on: ubuntu22.04-16cores-64GB - steps: - - name: Collect Metrics - id: collect-gha-metrics - uses: smartcontractkit/push-gha-metrics-action@d9da21a2747016b3e13de58c7d4115a3d5c97935 # v3.0.1 - with: - id: automation-on-demand-build-test-image - org-id: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} - basic-auth: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} - hostname: ${{ secrets.GRAFANA_INTERNAL_HOST }} - this-job-name: Build Test Image - continue-on-error: true - - name: Checkout the repo - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 - with: - ref: ${{ github.head_ref || github.ref_name }} - - name: Build Test Image - if: inputs.enableChaos || inputs.enableReorg - uses: ./.github/actions/build-test-image - with: - QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} - QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} - QA_AWS_ACCOUNT_NUMBER: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }} - - automation-on-demand-tests: - environment: integration - permissions: - checks: write - pull-requests: write - id-token: write - contents: read - needs: [build-chainlink, build-test-image] - env: - CHAINLINK_COMMIT_SHA: ${{ github.sha }} - CHAINLINK_ENV_USER: ${{ github.actor }} - TEST_LOG_LEVEL: info - strategy: - fail-fast: false - matrix: - tests: - - name: chaos - id: chaos - suite: chaos - nodes: 15 - os: ubuntu-latest - enabled: ${{ inputs.enableChaos }} - pyroscope_env: ci-automation-on-demand-chaos - network: SIMULATED - command: -run ^TestAutomationChaos$ ./chaos - - name: reorg - id: reorg - suite: reorg - nodes: 5 - os: ubuntu-latest - enabled: ${{ inputs.enableReorg }} - pyroscope_env: ci-automation-on-demand-reorg - network: SIMULATED - command: -run ^TestAutomationReorg$ ./reorg - - name: upgrade 2.0 - id: upgrade-2.0 - type: upgrade - suite: smoke - nodes: 1 - os: ubuntu22.04-8cores-32GB - enabled: true - pyroscope_env: ci-automation-on-demand-upgrade - network: SIMULATED - command: -run ^TestAutomationNodeUpgrade/registry_2_0 ./smoke - - name: upgrade 2.1 - id: upgrade-2.1 - type: upgrade - suite: smoke - nodes: 5 - os: ubuntu22.04-8cores-32GB - enabled: true - pyroscope_env: ci-automation-on-demand-upgrade - network: SIMULATED - command: -run ^TestAutomationNodeUpgrade/registry_2_1 ./smoke - - name: upgrade 2.2 - id: upgrade-2.2 - type: upgrade - suite: smoke - nodes: 5 - os: ubuntu22.04-8cores-32GB - enabled: true - pyroscope_env: ci-automation-on-demand-upgrade - network: SIMULATED - command: -run ^TestAutomationNodeUpgrade/registry_2_2 ./smoke - runs-on: ${{ matrix.tests.os }} - name: Automation On Demand ${{ matrix.tests.name }} Test + # Set tests to run based on the workflow inputs + set-tests-to-run: + name: Set tests to run + runs-on: ubuntu-latest + outputs: + test_list: ${{ steps.set-tests.outputs.test_list }} + require_chainlink_image_versions_in_qa_ecr: ${{ steps.determine-chainlink-image-check.outputs.require_chainlink_image_versions_in_qa_ecr }} steps: - - name: Checkout the repo - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 - with: - ref: ${{ github.head_ref || github.ref_name }} - name: Determine build to use id: determine-build shell: bash run: | if [[ "${{ inputs.chainlinkImage }}" == "QA_ECR" ]]; then - echo "image=${{ env.CHAINLINK_IMAGE }}" >>$GITHUB_OUTPUT - echo "version=${{ github.sha }}" >>$GITHUB_OUTPUT - echo "upgrade_version=${{ github.sha }}" >>$GITHUB_OUTPUT - echo "upgrade_image=${{ env.CHAINLINK_IMAGE }}" >>$GITHUB_OUTPUT - elif [[ "${{ inputs.chainlinkImage }}" == "public.ecr.aws/chainlink/chainlink" ]]; then - READ_CL_IMAGE="public.ecr.aws/chainlink/chainlink" - echo "image=$READ_CL_IMAGE" >>$GITHUB_OUTPUT - echo "version=${{ inputs.chainlinkVersion }}" >>$GITHUB_OUTPUT - echo "upgrade_version=${{ inputs.chainlinkVersion }}" >>$GITHUB_OUTPUT - echo "upgrade_image=$READ_CL_IMAGE" >>$GITHUB_OUTPUT + echo "image='{{ env.QA_CHAINLINK_IMAGE }}'" >> $GITHUB_ENV + else + echo "image=${{ inputs.chainlinkImage }}" >> $GITHUB_ENV fi - if [[ "${{ matrix.tests.type }}" == "upgrade" ]]; then - if [[ "${{ inputs.chainlinkImageUpdate }}" == "QA_ECR" ]]; then - echo "image=${{ env.CHAINLINK_IMAGE }}" >>$GITHUB_OUTPUT - elif [[ "${{ inputs.chainlinkImageUpdate }}" == "public.ecr.aws/chainlink/chainlink" ]]; then - echo "image=public.ecr.aws/chainlink/chainlink" >>$GITHUB_OUTPUT - fi - echo "version=${{ inputs.chainlinkVersionUpdate }}" >>$GITHUB_OUTPUT + if [[ "${{ inputs.chainlinkImageUpdate }}" == "QA_ECR" ]]; then + echo "upgrade_image='{{ env.QA_CHAINLINK_IMAGE }}'" >> $GITHUB_ENV + else + echo "upgrade_image=${{ inputs.chainlinkImageUpdate }}" >> $GITHUB_ENV fi - - name: Setup GAP for Grafana - uses: smartcontractkit/.github/actions/setup-gap@d316f66b2990ea4daa479daa3de6fc92b00f863e # setup-gap@0.3.2 - with: - # aws inputs - aws-region: ${{ secrets.AWS_REGION }} - aws-role-arn: ${{ secrets.AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN }} - api-gateway-host: ${{ secrets.AWS_API_GW_HOST_GRAFANA }} - # other inputs - duplicate-authorization-header: "true" - - name: Prepare Base64 TOML config - env: - SELECTED_NETWORKS: ${{ matrix.tests.network }} - OLD_IMAGE: ${{ steps.determine-build.outputs.image }} - OLD_VERSION: ${{ steps.determine-build.outputs.version }} - UPGRADE_VERSION: ${{ steps.determine-build.outputs.upgrade_version }} - UPGRADE_IMAGE: ${{ steps.determine-build.outputs.upgrade_image }} - RUN_ID: ${{ github.run_id }} - TEST_LOG_COLLECT: "true" - LOGSTREAM_LOG_TARGETS: ${{ vars.LOGSTREAM_LOG_TARGETS }} - run: | - echo ::add-mask::$UPGRADE_IMAGE - echo ::add-mask::$OLD_IMAGE - - # load reusable functions - source ./.github/scripts/functions.sh - - selected_networks=$(convert_to_toml_array "$SELECTED_NETWORKS") - - if [ -n "$TEST_LOG_COLLECT" ]; then - test_log_collect=true + if [[ -z "${{ inputs.chainlinkVersion }}" ]] && [[ "${{ inputs.chainlinkImage }}" == "QA_ECR" ]]; then + echo "version=${{ github.sha }}" >> $GITHUB_ENV + else + echo "version=${{ inputs.chainlinkVersion }}" >> $GITHUB_ENV + fi + if [[ -z "${{ inputs.chainlinkVersionUpdate }}" ]] && [[ "${{ inputs.chainlinkImageUpdate }}" == "QA_ECR" ]]; then + echo "upgrade_version=${{ github.sha }}" >> $GITHUB_ENV else - test_log_collect=false + echo "upgrade_version=${{ inputs.chainlinkVersionUpdate }}" >> $GITHUB_ENV + fi + - name: Check if chainlink image check required + id: determine-chainlink-image-check + shell: bash + run: | + chainlink_image_versions="" + if [ "${{ github.event.inputs.chainlinkImage }}" = "QA_ECR" ]; then + chainlink_image_versions+="${{ env.version }}," + fi + if [ "${{ github.event.inputs.chainlinkImageUpdate }}" = "QA_ECR" ]; then + chainlink_image_versions+="${{ env.upgrade_version }}" fi + echo "require_chainlink_image_versions_in_qa_ecr=$chainlink_image_versions" >> $GITHUB_OUTPUT + - name: Set tests to run + id: set-tests + run: | + + # Always run upgrade tests + cat > test_list.yaml < config.toml - [Network] - selected_networks=$selected_networks - - [ChainlinkImage] - image="$OLD_IMAGE" - version="$OLD_VERSION" + - id: smoke/automation_upgrade_test.go:^TestAutomationNodeUpgrade/registry_2_2 + test_env_vars: + E2E_TEST_CHAINLINK_IMAGE: ${{ env.image }} + E2E_TEST_CHAINLINK_VERSION: ${{ env.version }} + E2E_TEST_CHAINLINK_UPGRADE_IMAGE: ${{ env.upgrade_image }} + E2E_TEST_CHAINLINK_UPGRADE_VERSION: ${{ env.upgrade_version }} + EOF - [ChainlinkUpgradeImage] - image="$UPGRADE_IMAGE" - version="$UPGRADE_VERSION" + # Run reorg tests if enabled + if [[ "${{ github.event.inputs.enableReorg }}" == 'true' ]]; then + cat >> test_list.yaml <> test_list.yaml <> $GITHUB_OUTPUT + + call-run-e2e-tests-workflow: + name: Run E2E Tests + needs: set-tests-to-run + uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@827d85b57065211ddd254457a7cf21581d85092d + with: + test_path: .github/e2e-tests.yml + test_list: ${{ needs.set-tests-to-run.outputs.test_list }} + require_chainlink_image_versions_in_qa_ecr: ${{ needs.set-tests-to-run.outputs.require_chainlink_image_versions_in_qa_ecr }} + with_existing_remote_runner_version: ${{ github.event.inputs.with_existing_remote_runner_version }} + test_log_upload_on_failure: true + test_log_upload_retention_days: 7 + secrets: + QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} + QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} + QA_AWS_ACCOUNT_NUMBER: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }} + PROD_AWS_ACCOUNT_NUMBER: ${{ secrets.AWS_ACCOUNT_ID_PROD }} + QA_PYROSCOPE_INSTANCE: ${{ secrets.QA_PYROSCOPE_INSTANCE }} + QA_PYROSCOPE_KEY: ${{ secrets.QA_PYROSCOPE_KEY }} + QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }} + GRAFANA_INTERNAL_TENANT_ID: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} + GRAFANA_INTERNAL_BASIC_AUTH: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} + GRAFANA_INTERNAL_HOST: ${{ secrets.GRAFANA_INTERNAL_HOST }} + GRAFANA_INTERNAL_URL_SHORTENER_TOKEN: ${{ secrets.GRAFANA_INTERNAL_URL_SHORTENER_TOKEN }} + LOKI_TENANT_ID: ${{ secrets.LOKI_TENANT_ID }} + LOKI_URL: https://${{ secrets.GRAFANA_INTERNAL_HOST }}/loki/api/v1/push + LOKI_BASIC_AUTH: ${{ secrets.LOKI_BASIC_AUTH }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + AWS_REGION: ${{ secrets.QA_AWS_REGION }} + AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN: ${{ secrets.AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN }} + AWS_API_GW_HOST_GRAFANA: ${{ secrets.AWS_API_GW_HOST_GRAFANA }} - BASE64_CONFIG_OVERRIDE=$(cat config.toml | base64 -w 0) - echo ::add-mask::$BASE64_CONFIG_OVERRIDE - echo "BASE64_CONFIG_OVERRIDE=$BASE64_CONFIG_OVERRIDE" >> $GITHUB_ENV - - name: Run Tests - uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests@75a9005952a9e905649cfb5a6971fd9429436acd # v2.3.25 - if: ${{ matrix.tests.enabled == true }} - env: - TEST_SUITE: ${{ matrix.tests.suite }} - with: - test_config_override_base64: ${{ env.BASE64_CONFIG_OVERRIDE }} - test_command_to_run: cd ./integration-tests && go test -timeout 60m -count=1 -json -test.parallel=${{ matrix.tests.nodes }} ${{ matrix.tests.command }} 2>&1 | tee /tmp/gotest.log | gotestloghelper -ci -singlepackage -hidepassingtests=false -hidepassinglogs - test_download_vendor_packages_command: cd ./integration-tests && go mod download - cl_repo: ${{ steps.determine-build.outputs.image }} - cl_image_tag: ${{ steps.determine-build.outputs.version }} - aws_registries: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }} - artifacts_location: ./integration-tests/${{ matrix.tests.suite }}/logs - publish_check_name: Automation On Demand Results ${{ matrix.tests.name }} - token: ${{ secrets.GITHUB_TOKEN }} - go_mod_path: ./integration-tests/go.mod - QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} - QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} - QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }} - DEFAULT_LOKI_TENANT_ID: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} - DEFAULT_LOKI_ENDPOINT: https://${{ secrets.GRAFANA_INTERNAL_HOST }}/loki/api/v1/push - DEFAULT_LOKI_BASIC_AUTH: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} - DEFAULT_GRAFANA_BASE_URL: "http://localhost:8080/primary" - DEFAULT_GRAFANA_DASHBOARD_URL: "/d/ddf75041-1e39-42af-aa46-361fe4c36e9e/ci-e2e-tests-logs" - DEFAULT_GRAFANA_BEARER_TOKEN: ${{ secrets.GRAFANA_INTERNAL_URL_SHORTENER_TOKEN }} - DEFAULT_PYROSCOPE_SERVER_URL: ${{ matrix.tests.pyroscope_env == '' && '' || !startsWith(github.ref, 'refs/tags/') && '' || secrets.QA_PYROSCOPE_INSTANCE }} # Avoid sending blank envs https://github.com/orgs/community/discussions/25725 - DEFAULT_PYROSCOPE_KEY: ${{ secrets.QA_PYROSCOPE_KEY }} - DEFAULT_PYROSCOPE_ENVIRONMENT: ${{ matrix.tests.pyroscope_env }} - DEFAULT_PYROSCOPE_ENABLED: ${{ matrix.tests.pyroscope_env == '' || !startsWith(github.ref, 'refs/tags/') && 'false' || 'true' }} - - - name: Upload test log - uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 - if: failure() - with: - name: test-log-${{ matrix.tests.name }} - path: /tmp/gotest.log - retention-days: 7 - continue-on-error: true - - name: Collect Metrics - if: always() - id: collect-gha-metrics - uses: smartcontractkit/push-gha-metrics-action@d9da21a2747016b3e13de58c7d4115a3d5c97935 # v3.0.1 - with: - id: automation-on-demand-tests-${{ matrix.tests.id }} - org-id: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} - basic-auth: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} - hostname: ${{ secrets.GRAFANA_INTERNAL_HOST }} - this-job-name: Automation On Demand ${{ matrix.tests.name }} Test - test-results-file: '{"testType":"go","filePath":"/tmp/gotest.log"}' - continue-on-error: true diff --git a/.github/workflows/build-publish-develop-pr.yml b/.github/workflows/build-publish-develop-pr.yml new file mode 100644 index 00000000000..2868616ace0 --- /dev/null +++ b/.github/workflows/build-publish-develop-pr.yml @@ -0,0 +1,115 @@ +name: "Build and Publish Chainlink" + +on: + pull_request: + push: + branches: + - develop + - "release/**" + workflow_dispatch: + inputs: + git_ref: + description: "The git ref to check out" + required: true + build-publish: + description: "Whether to build and publish - defaults to just build" + required: false + default: "false" + +env: + GIT_REF: ${{ github.event.inputs.git_ref || github.ref }} + +jobs: + goreleaser-build-publish-chainlink: + name: "goreleaser-build-publish-${{ matrix.image-name }}" + strategy: + fail-fast: false + matrix: + include: + - image-name: chainlink + goreleaser-config: .goreleaser.develop.yaml + - image-name: ccip + goreleaser-config: .goreleaser.ccip.develop.yaml + runs-on: ubuntu-20.04 + permissions: + id-token: write + contents: read + steps: + - name: Checkout repository + uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 + with: + ref: ${{ env.GIT_REF }} + + # This gets the image tag and whether to publish the image based on the event type + # PR builds: pr-- (if label 'build-publish' is present publishes the image) + # develop builds: develop- and develop (only amd64) + # release builds: release- + # manual builds: (if build-publish is true publishes the image) + - name: Get image tag + id: get-image-tag + run: | + short_sha=$(git rev-parse --short HEAD) + echo "build-publish=false" | tee -a $GITHUB_OUTPUT + if [[ ${{ github.event_name }} == 'push' ]]; then + if [[ ${{ github.ref_name }} == 'release/'* ]]; then + echo "image-tag=release-${short_sha}" | tee -a $GITHUB_OUTPUT + echo "build-publish=true" | tee -a $GITHUB_OUTPUT + else + echo "image-tag=develop" | tee -a $GITHUB_OUTPUT + echo "build-publish=true" | tee -a $GITHUB_OUTPUT + fi + elif [[ ${{ github.event_name }} == 'workflow_dispatch' ]]; then + echo "image-tag=${short_sha}" | tee -a $GITHUB_OUTPUT + echo "build-publish=${{ github.event.inputs.build-publish }}" | tee -a $GITHUB_OUTPUT + else + if [[ ${{ github.event_name }} == "pull_request" ]]; then + echo "image-tag=pr-${{ github.event.number }}-${short_sha}" | tee -a $GITHUB_OUTPUT + if [[ ${{ contains(github.event.pull_request.labels.*.name, 'build-publish') }} == "true" ]]; then + echo "build-publish=true" | tee -a $GITHUB_OUTPUT + fi + fi + fi + + - name: Configure aws credentials + if: steps.get-image-tag.outputs.build-publish == 'true' + uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2 + with: + role-to-assume: ${{ secrets.AWS_OIDC_IAM_ROLE_BUILD_PUBLISH_DEVELOP_PR }} + aws-region: ${{ secrets.AWS_REGION }} + mask-aws-account-id: true + role-session-name: goreleaser-build-publish-${{ matrix.image-name }} + + - name: Build and publish images + uses: ./.github/actions/goreleaser-build-sign-publish + with: + enable-docker-publish: ${{ steps.get-image-tag.outputs.build-publish }} + docker-registry: ${{ secrets.AWS_SDLC_ECR_HOSTNAME }} + docker-image-name: ${{ matrix.image-name }} + docker-image-tag: ${{ steps.get-image-tag.outputs.image-tag }} + enable-goreleaser-snapshot: "true" + goreleaser-exec: ./tools/bin/goreleaser_wrapper + goreleaser-config: ${{ matrix.goreleaser-config }} + goreleaser-key: ${{ secrets.GORELEASER_KEY }} + zig-version: 0.11.0 + + - name: Output image name and digest + if: steps.get-image-tag.outputs.build-publish == 'true' + shell: bash + run: | + echo "### Docker Images" | tee -a "$GITHUB_STEP_SUMMARY" + jq -r '.[] | select(.type == "Docker Image") | "\(.name)"' ${artifact_path} >> output.txt + while read -r line; do + echo "$line" | tee -a "$GITHUB_STEP_SUMMARY" + done < output.txt + + - name: Collect Metrics + if: always() + id: collect-gha-metrics + uses: smartcontractkit/push-gha-metrics-action@d9da21a2747016b3e13de58c7d4115a3d5c97935 # v3.0.1 + with: + id: goreleaser-build-publish + org-id: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} + basic-auth: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} + hostname: ${{ secrets.GRAFANA_INTERNAL_HOST }} + this-job-name: goreleaser-build-publish-${{ matrix.image-name }} + continue-on-error: true \ No newline at end of file diff --git a/.github/workflows/build-publish-develop.yml b/.github/workflows/build-publish-develop.yml deleted file mode 100644 index 8c6e5e76ac4..00000000000 --- a/.github/workflows/build-publish-develop.yml +++ /dev/null @@ -1,69 +0,0 @@ -name: "Push develop to private ECR" - -on: - push: - branches: - - develop - workflow_dispatch: - inputs: - git_ref: - description: "Git ref (commit SHA, branch name, tag name, etc.) to checkout" - required: true -env: - GIT_REF: ${{ github.event.inputs.git_ref || github.ref }} - -jobs: - push-chainlink-develop: - runs-on: ubuntu-20.04 - environment: build-develop - permissions: - id-token: write - contents: read - strategy: - matrix: - image: - - name: "" - dockerfile: core/chainlink.Dockerfile - tag-suffix: "" - - name: (plugins) - dockerfile: plugins/chainlink.Dockerfile - tag-suffix: -plugins - name: push-chainlink-develop ${{ matrix.image.name }} - steps: - - name: Checkout repository - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 - with: - ref: ${{ env.GIT_REF }} - # When this is ran from manual workflow_dispatch, the github.sha may be - # different than the checked out commit sha. The core build uses this - # commit sha as build metadata, so we need to make sure it's correct. - - name: Get checked out git ref - if: github.event.inputs.git_ref - id: git-ref - run: echo "checked-out=$(git rev-parse HEAD)" | tee -a "${GITHUB_OUTPUT}" - - name: Build, sign and publish chainlink image - uses: ./.github/actions/build-sign-publish-chainlink - with: - publish: true - aws-role-to-assume: ${{ secrets.AWS_OIDC_IAM_ROLE_ARN }} - aws-role-duration-seconds: ${{ secrets.AWS_ROLE_DURATION_SECONDS }} - aws-region: ${{ secrets.AWS_REGION }} - ecr-hostname: ${{ secrets.AWS_DEVELOP_ECR_HOSTNAME }} - ecr-image-name: chainlink - ecr-tag-suffix: ${{ matrix.image.tag-suffix }} - dockerfile: ${{ matrix.image.dockerfile }} - dockerhub_username: ${{ secrets.DOCKERHUB_READONLY_USERNAME }} - dockerhub_password: ${{ secrets.DOCKERHUB_READONLY_PASSWORD }} - git-commit-sha: ${{ steps.git-ref.outputs.checked-out || github.sha }} - - - name: Collect Metrics - if: always() - id: collect-gha-metrics - uses: smartcontractkit/push-gha-metrics-action@d9da21a2747016b3e13de58c7d4115a3d5c97935 # v3.0.1 - with: - id: build-chainlink-develop - org-id: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} - basic-auth: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} - hostname: ${{ secrets.GRAFANA_INTERNAL_HOST }} - this-job-name: push-chainlink-develop ${{ matrix.image.name }} - continue-on-error: true diff --git a/.github/workflows/build-publish-pr.yml b/.github/workflows/build-publish-pr.yml deleted file mode 100644 index 36eac61cab0..00000000000 --- a/.github/workflows/build-publish-pr.yml +++ /dev/null @@ -1,66 +0,0 @@ -name: "Build and Publish from PR" - -## -# This workflow builds and publishes a Docker image for Chainlink from a PR. -# It has its own special IAM role, does not sign the image, and publishes to -# a special ECR repo. -## - -on: - pull_request: - -jobs: - build-publish-untrusted: - if: ${{ ! startsWith(github.ref_name, 'release/') || (! startsWith(github.head_ref, 'release/') && ! startsWith(github.ref_name, 'chore/'))}} - runs-on: ubuntu-20.04 - environment: sdlc - permissions: - id-token: write - contents: read - env: - ECR_IMAGE_NAME: crib-chainlink-untrusted - steps: - - name: Checkout repository - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 - - - name: Git Short SHA - shell: bash - env: - GIT_PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }} - run: | - echo "GIT_SHORT_SHA=${GIT_PR_HEAD_SHA:0:7}" | tee -a "$GITHUB_ENV" - - - name: Check if image exists - id: check-image - uses: smartcontractkit/chainlink-github-actions/docker/image-exists@75a9005952a9e905649cfb5a6971fd9429436acd # v2.3.25 - with: - repository: ${{ env.ECR_IMAGE_NAME}} - tag: sha-${{ env.GIT_SHORT_SHA }} - AWS_REGION: ${{ secrets.AWS_REGION }} - AWS_ROLE_TO_ASSUME: ${{ secrets.AWS_OIDC_IAM_ROLE_PUBLISH_PR_ARN }} - - - name: Build and publish chainlink image - if: steps.check-image.outputs.exists == 'false' - uses: ./.github/actions/build-sign-publish-chainlink - with: - publish: true - aws-role-to-assume: ${{ secrets.AWS_OIDC_IAM_ROLE_PUBLISH_PR_ARN }} - aws-role-duration-seconds: ${{ secrets.AWS_ROLE_DURATION_SECONDS_DEFAULT }} - aws-region: ${{ secrets.AWS_REGION }} - sign-images: false - ecr-hostname: ${{ secrets.AWS_SDLC_ECR_HOSTNAME }} - ecr-image-name: ${{ env.ECR_IMAGE_NAME }} - dockerhub_username: ${{ secrets.DOCKERHUB_READONLY_USERNAME }} - dockerhub_password: ${{ secrets.DOCKERHUB_READONLY_PASSWORD }} - - - name: Collect Metrics - if: always() - id: collect-gha-metrics - uses: smartcontractkit/push-gha-metrics-action@d9da21a2747016b3e13de58c7d4115a3d5c97935 # v3.0.1 - with: - id: build-chainlink-pr - org-id: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} - basic-auth: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} - hostname: ${{ secrets.GRAFANA_INTERNAL_HOST }} - this-job-name: build-publish-untrusted - continue-on-error: true diff --git a/.github/workflows/build-publish.yml b/.github/workflows/build-publish.yml index ef0f641db1b..ca6a2d5275a 100644 --- a/.github/workflows/build-publish.yml +++ b/.github/workflows/build-publish.yml @@ -1,4 +1,4 @@ -name: "Build Chainlink and Publish" +name: "Build, Sign and Publish Chainlink" on: # Mimics old circleci behaviour @@ -8,6 +8,10 @@ on: branches: - "release/**" +env: + ECR_HOSTNAME: public.ecr.aws + ECR_IMAGE_NAME: chainlink/chainlink + jobs: checks: name: "Checks" @@ -29,26 +33,37 @@ jobs: environment: build-publish permissions: id-token: write - contents: read + contents: write + attestations: write + outputs: + docker-image-tag: ${{ steps.build-sign-publish.outputs.docker-image-tag }} + docker-image-digest: ${{ steps.build-sign-publish.outputs.docker-image-digest }} steps: - name: Checkout repository uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 - name: Build, sign and publish chainlink image + id: build-sign-publish uses: ./.github/actions/build-sign-publish-chainlink with: publish: true aws-role-to-assume: ${{ secrets.AWS_OIDC_IAM_ROLE_ARN }} aws-role-duration-seconds: ${{ secrets.AWS_ROLE_DURATION_SECONDS }} aws-region: ${{ secrets.AWS_REGION }} - sign-images: true - sign-method: "keypair" - cosign-private-key: ${{ secrets.COSIGN_PRIVATE_KEY }} - cosign-public-key: ${{ secrets.COSIGN_PUBLIC_KEY }} - cosign-password: ${{ secrets.COSIGN_PASSWORD }} + ecr-hostname: ${{ env.ECR_HOSTNAME }} + ecr-image-name: ${{ env.ECR_IMAGE_NAME }} dockerhub_username: ${{ secrets.DOCKERHUB_READONLY_USERNAME }} dockerhub_password: ${{ secrets.DOCKERHUB_READONLY_PASSWORD }} + sign-images: true verify-signature: true + + - name: Attest Docker image + uses: actions/attest-build-provenance@6149ea5740be74af77f260b9db67e633f6b0a9a1 # v1.4.2 + with: + subject-digest: ${{ steps.build-sign-publish.outputs.docker-image-digest }} + subject-name: ${{ env.ECR_HOSTNAME }}/${{ env.ECR_IMAGE_NAME }} + push-to-registry: true + - name: Collect Metrics if: always() id: collect-gha-metrics @@ -60,3 +75,177 @@ jobs: hostname: ${{ secrets.GRAFANA_INTERNAL_HOST }} this-job-name: build-sign-publish-chainlink continue-on-error: true + + goreleaser-build-sign-publish-chainlink: + needs: [checks] + if: ${{ ! startsWith(github.ref_name, 'release/') }} + runs-on: ubuntu-20.04 + environment: build-publish + permissions: + id-token: write + contents: write + attestations: write + steps: + - name: Checkout repository + uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 + + - name: Configure aws credentials + uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2 + with: + role-to-assume: ${{ secrets.AWS_OIDC_IAM_ROLE_ARN }} + role-duration-seconds: ${{ secrets.AWS_ROLE_DURATION_SECONDS }} + aws-region: ${{ secrets.AWS_REGION }} + mask-aws-account-id: true + role-session-name: goreleaser-build-sign-publish-chainlink + + - name: Set build configs + shell: bash + id: set-build-configs + run: | + if [[ ${{ github.ref_name }} =~ "-ccip" ]]; then + echo "ECR_IMAGE_NAME=chainlink/ccip" | tee -a $GITHUB_OUTPUT + echo "GORELEASER_CONFIG=.goreleaser.ccip.production.yaml" | tee -a $GITHUB_OUTPUT + else + echo "ECR_IMAGE_NAME=chainlink/chainlink" | tee -a $GITHUB_OUTPUT + echo "GORELEASER_CONFIG=.goreleaser.production.yaml" | tee -a $GITHUB_OUTPUT + fi + + - name: Build, sign, and publish image + id: goreleaser-build-sign-publish + uses: ./.github/actions/goreleaser-build-sign-publish + with: + docker-registry: ${{ env.ECR_HOSTNAME}} + docker-image-name: ${{ steps.set-build-configs.outputs.ECR_IMAGE_NAME }} + docker-image-tag: ${{ github.ref_name }} + goreleaser-exec: ./tools/bin/goreleaser_wrapper + goreleaser-config: ${{ steps.set-build-configs.outputs.GORELEASER_CONFIG }} + goreleaser-key: ${{ secrets.GORELEASER_KEY }} + zig-version: 0.11.0 + enable-cosign: true + cosign-version: "v2.4.0" + + - name: Output image name and digest + id: get-image-name-digest + shell: bash + run: | + artifact_path="dist/artifacts.json" + jq -r '.[] | select(.type == "Docker Image") | "\(.name)"' ${artifact_path} >> output.txt + + echo "### Docker Images" | tee -a "$GITHUB_STEP_SUMMARY" + while read -r line; do + echo "$line" | tee -a "$GITHUB_STEP_SUMMARY" + done < output.txt + + core_amd64_name="${{ env.ECR_HOSTNAME }}/${{ steps.set-build-configs.outputs.ECR_IMAGE_NAME }}:${{ github.ref_name }}-amd64" + plugins_amd64_name="${{ env.ECR_HOSTNAME }}/${{ steps.set-build-configs.outputs.ECR_IMAGE_NAME }}:${{ github.ref_name }}-plugins-amd64" + core_arm64_name="${{ env.ECR_HOSTNAME }}/${{ steps.set-build-configs.outputs.ECR_IMAGE_NAME }}:${{ github.ref_name }}-arm64" + plugins_arm64_name="${{ env.ECR_HOSTNAME }}/${{ steps.set-build-configs.outputs.ECR_IMAGE_NAME }}:${{ github.ref_name }}-plugins-arm64" + + echo "core_amd64_digest=$(jq -r --arg name "$core_amd64_name" '.[]|select(.type=="Published Docker Image" and .name==$name)|.extra.Digest' ${artifact_path})" | tee -a "$GITHUB_OUTPUT" "$GITHUB_STEP_SUMMARY" + echo "plugins_amd64_digest=$(jq -r --arg name "$plugins_amd64_name" '.[]|select(.type=="Published Docker Image" and .name==$name)|.extra.Digest' ${artifact_path})" | tee -a "$GITHUB_OUTPUT" "$GITHUB_STEP_SUMMARY" + echo "core_arm64_digest=$(jq -r --arg name "$core_amd64_name" '.[]|select(.type=="Published Docker Image" and .name==$name)|.extra.Digest' ${artifact_path})" | tee -a "$GITHUB_OUTPUT" "$GITHUB_STEP_SUMMARY" + echo "plugins_arm64_digest=$(jq -r --arg name "$plugins_amd64_name" '.[]|select(.type=="Published Docker Image" and .name==$name)|.extra.Digest' ${artifact_path})" | tee -a "$GITHUB_OUTPUT" "$GITHUB_STEP_SUMMARY" + + - name: Attest tarballs + uses: actions/attest-build-provenance@6149ea5740be74af77f260b9db67e633f6b0a9a1 # v1.4.2 + with: + subject-path: "dist/*.tar.gz" + + - name: Attest Docker image (core-amd64) + uses: actions/attest-build-provenance@6149ea5740be74af77f260b9db67e633f6b0a9a1 # v1.4.2 + with: + subject-digest: ${{ steps.get-image-name-digest.outputs.core_amd64_digest }} + subject-name: ${{ env.ECR_HOSTNAME }}/${{ steps.set-build-configs.outputs.ECR_IMAGE_NAME }} + push-to-registry: true + + - name: Attest Docker image (plugins-amd64) + uses: actions/attest-build-provenance@6149ea5740be74af77f260b9db67e633f6b0a9a1 # v1.4.2 + with: + subject-digest: ${{ steps.get-image-name-digest.outputs.plugins_amd64_digest }} + subject-name: ${{ env.ECR_HOSTNAME }}/${{ steps.set-build-configs.outputs.ECR_IMAGE_NAME }} + push-to-registry: true + + - name: Attest Docker image (core-arm64) + uses: actions/attest-build-provenance@6149ea5740be74af77f260b9db67e633f6b0a9a1 # v1.4.2 + with: + subject-digest: ${{ steps.get-image-name-digest.outputs.core_arm64_digest }} + subject-name: ${{ env.ECR_HOSTNAME }}/${{ steps.set-build-configs.outputs.ECR_IMAGE_NAME }} + push-to-registry: true + + - name: Attest Docker image (plugins-arm64) + uses: actions/attest-build-provenance@6149ea5740be74af77f260b9db67e633f6b0a9a1 # v1.4.2 + with: + subject-digest: ${{ steps.get-image-name-digest.outputs.plugins_arm64_digest }} + subject-name: ${{ env.ECR_HOSTNAME }}/${{ steps.set-build-configs.outputs.ECR_IMAGE_NAME }} + push-to-registry: true + + - name: Upload SBOMs + uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4 + with: + name: goreleaser-sboms + path: dist/*.sbom.json + + - name: Print SBOM artifact to job summary + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + shell: bash + run: | + ARTIFACTS=$(gh api -X GET repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts) + ARTIFACT_ID=$(echo "$ARTIFACTS" | jq '.artifacts[] | select(.name=="goreleaser-sboms") | .id') + echo "Artifact ID: $ARTIFACT_ID" + echo "### SBOM Artifact" | tee -a "$GITHUB_STEP_SUMMARY" + artifact_url="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts/$ARTIFACT_ID" + echo "[Artifact URL]($artifact_url)" | tee -a $GITHUB_STEP_SUMMARY + + - name: Collect Metrics + if: always() + id: collect-gha-metrics + uses: smartcontractkit/push-gha-metrics-action@d9da21a2747016b3e13de58c7d4115a3d5c97935 # v3.0.1 + with: + id: goreleaser-build-chainlink-publish + org-id: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} + basic-auth: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} + hostname: ${{ secrets.GRAFANA_INTERNAL_HOST }} + this-job-name: goreleaser-build-sign-publish-chainlink + continue-on-error: true + + # Notify Slack channel for new git tags. + slack-notify: + if: github.ref_type == 'tag' + needs: [build-sign-publish-chainlink] + runs-on: ubuntu-24.04 + environment: build-publish + steps: + - name: Checkout repository + uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 + - name: Notify Slack + uses: smartcontractkit/.github/actions/slack-notify-git-ref@31e00facdd8f57a2bc7868b5e4c8591bf2aa3727 # slack-notify-git-ref@0.1.2 + with: + slack-channel-id: ${{ secrets.SLACK_CHANNEL_RELEASE_NOTIFICATIONS }} + slack-bot-token: ${{ secrets.SLACK_BOT_TOKEN_RELENG }} # Releng Bot + git-ref: ${{ github.ref_name }} + git-ref-type: ${{ github.ref_type }} + changelog-url: >- + ${{ + github.ref_type == 'tag' && + format( + 'https://github.com/{0}/blob/{1}/CHANGELOG.md', + github.repository, + github.ref_name + ) || '' + }} + docker-image-name: >- + ${{ + github.ref_type == 'tag' && + format( + '{0}/{1}:{2}', + env.ECR_HOSTNAME, + env.ECR_IMAGE_NAME, + needs.build-sign-publish-chainlink.outputs.docker-image-tag + ) || '' + }} + docker-image-digest: >- + ${{ + github.ref_type == 'tag' && + needs.build-sign-publish-chainlink.outputs.docker-image-digest || '' + }} diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index 6e3272204ed..00000000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,52 +0,0 @@ -name: "Build Chainlink" - -on: - pull_request: - -jobs: - build-chainlink: - runs-on: ubuntu-20.04 - if: ${{ ! startsWith(github.head_ref, 'release/') && ! startsWith(github.ref_name, 'chore/') }} - steps: - - name: Checkout repository - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 - - - uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2 - id: change - with: - predicate-quantifier: every - filters: | - changelog-only: - - 'CHANGELOG.md' - - '!common/**' - - '!contracts/**' - - '!core/**' - - '!crib/**' - - '!dashboard-lib/**' - - '!fuzz/**' - - '!integration-tests/**' - - '!internal/**' - - '!operator_ui/**' - - '!plugins/**' - - '!tools/**' - - - name: Build chainlink image - if: ${{ steps.change.outputs.changelog-only == 'false' }} - uses: ./.github/actions/build-sign-publish-chainlink - with: - dockerhub_username: ${{ secrets.DOCKERHUB_READONLY_USERNAME }} - dockerhub_password: ${{ secrets.DOCKERHUB_READONLY_PASSWORD }} - publish: false - sign-images: false - - - name: Collect Metrics - if: always() - id: collect-gha-metrics - uses: smartcontractkit/push-gha-metrics-action@d9da21a2747016b3e13de58c7d4115a3d5c97935 # v3.0.1 - with: - id: build-chainlink - org-id: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} - basic-auth: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} - hostname: ${{ secrets.GRAFANA_INTERNAL_HOST }} - this-job-name: build-chainlink - continue-on-error: true diff --git a/.github/workflows/ccip-chaos-tests.yml b/.github/workflows/ccip-chaos-tests.yml new file mode 100644 index 00000000000..0e01ee83cdf --- /dev/null +++ b/.github/workflows/ccip-chaos-tests.yml @@ -0,0 +1,46 @@ +name: CCIP Chaos Tests +on: + workflow_run: + workflows: [ CCIP Load Test ] + types: [ completed ] + branches: [ develop ] + workflow_dispatch: + +# Only run 1 of this workflow at a time per PR +concurrency: + group: chaos-ccip-tests-chainlink-${{ github.ref }} + cancel-in-progress: true + +jobs: + run-e2e-tests-workflow: + name: Run E2E Tests + uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@827d85b57065211ddd254457a7cf21581d85092d + with: + test_path: .github/e2e-tests.yml + chainlink_version: ${{ github.sha }} + require_chainlink_image_versions_in_qa_ecr: ${{ github.sha }} + test_trigger: E2E CCIP Chaos Tests + test_log_level: debug + slack_notification_after_tests: on_failure + slack_notification_after_tests_channel_id: '#ccip-testing' + slack_notification_after_tests_name: CCIP Chaos E2E Tests + secrets: + QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} + QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} + QA_AWS_ACCOUNT_NUMBER: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }} + PROD_AWS_ACCOUNT_NUMBER: ${{ secrets.AWS_ACCOUNT_ID_PROD }} + QA_PYROSCOPE_INSTANCE: ${{ secrets.QA_PYROSCOPE_INSTANCE }} + QA_PYROSCOPE_KEY: ${{ secrets.QA_PYROSCOPE_KEY }} + QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }} + GRAFANA_INTERNAL_TENANT_ID: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} + GRAFANA_INTERNAL_BASIC_AUTH: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} + GRAFANA_INTERNAL_HOST: ${{ secrets.GRAFANA_INTERNAL_HOST }} + GRAFANA_INTERNAL_URL_SHORTENER_TOKEN: ${{ secrets.GRAFANA_INTERNAL_URL_SHORTENER_TOKEN }} + LOKI_TENANT_ID: ${{ secrets.LOKI_TENANT_ID }} + LOKI_URL: https://${{ secrets.GRAFANA_INTERNAL_HOST }}/loki/api/v1/push + LOKI_BASIC_AUTH: ${{ secrets.LOKI_BASIC_AUTH }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + AWS_REGION: ${{ secrets.QA_AWS_REGION }} + AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN: ${{ secrets.AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN }} + AWS_API_GW_HOST_GRAFANA: ${{ secrets.AWS_API_GW_HOST_GRAFANA }} + SLACK_BOT_TOKEN: ${{ secrets.QA_SLACK_API_KEY }} diff --git a/.github/workflows/ccip-load-tests.yml b/.github/workflows/ccip-load-tests.yml new file mode 100644 index 00000000000..fca4b0c01dc --- /dev/null +++ b/.github/workflows/ccip-load-tests.yml @@ -0,0 +1,65 @@ +name: CCIP Load Test +on: + push: + paths: + - '**/*ccip*' + - '**/*ccip*/**' + branches: + - develop + tags: + - '*' + workflow_dispatch: + inputs: + test_config_override_path: + description: Path to a test config file used to override the default test config + required: false + type: string + test_secrets_override_key: + description: 'Key to run tests with custom test secrets' + required: false + type: string + chainlink_version: + description: Chainlink image version to use. Commit sha if not provided + required: false + type: string + +# Only run 1 of this workflow at a time per PR +concurrency: + group: load-ccip-tests-chainlink-${{ github.ref }} + cancel-in-progress: true + +jobs: + run-e2e-tests-workflow: + name: Run E2E Tests + uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@827d85b57065211ddd254457a7cf21581d85092d + with: + test_path: .github/e2e-tests.yml + test_trigger: E2E CCIP Load Tests + test_config_override_path: ${{ inputs.test_config_override_path }} + chainlink_version: ${{ inputs.chainlink_version || github.sha }} + slack_notification_after_tests: always + slack_notification_after_tests_channel_id: '#ccip-testing' + slack_notification_after_tests_name: CCIP E2E Load Tests + test_image_suites: ccip-load + secrets: + QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} + QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} + QA_AWS_ACCOUNT_NUMBER: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }} + PROD_AWS_ACCOUNT_NUMBER: ${{ secrets.AWS_ACCOUNT_ID_PROD }} + QA_PYROSCOPE_INSTANCE: ${{ secrets.QA_PYROSCOPE_INSTANCE }} + QA_PYROSCOPE_KEY: ${{ secrets.QA_PYROSCOPE_KEY }} + QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }} + GRAFANA_INTERNAL_TENANT_ID: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} + GRAFANA_INTERNAL_BASIC_AUTH: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} + GRAFANA_INTERNAL_HOST: ${{ secrets.GRAFANA_INTERNAL_HOST }} + GRAFANA_INTERNAL_URL_SHORTENER_TOKEN: ${{ secrets.GRAFANA_INTERNAL_URL_SHORTENER_TOKEN }} + LOKI_TENANT_ID: ${{ secrets.LOKI_TENANT_ID }} + LOKI_URL: https://${{ secrets.GRAFANA_INTERNAL_HOST }}/loki/api/v1/push + LOKI_BASIC_AUTH: ${{ secrets.LOKI_BASIC_AUTH }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + AWS_REGION: ${{ secrets.QA_AWS_REGION }} + AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN: ${{ secrets.AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN }} + AWS_API_GW_HOST_GRAFANA: ${{ secrets.AWS_API_GW_HOST_GRAFANA }} + TEST_SECRETS_OVERRIDE_BASE64: ${{ secrets[inputs.test_secrets_override_key] }} + SLACK_BOT_TOKEN: ${{ secrets.QA_SLACK_API_KEY }} + SLACK_API_KEY: ${{ secrets.QA_SLACK_API_KEY }} diff --git a/.github/workflows/chain-selectors-check.yml b/.github/workflows/chain-selectors-check.yml new file mode 100644 index 00000000000..c2b58e68d44 --- /dev/null +++ b/.github/workflows/chain-selectors-check.yml @@ -0,0 +1,39 @@ +name: Chain Selectors Version Check + +on: + push: + branches: + - develop + - release/* + tags: + - v* + pull_request: + branches: + - release/* + + +jobs: + verify-version: + runs-on: ubuntu-latest + steps: + - name: Checkout Repo + uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 + + - name: Setup Go + uses: ./.github/actions/setup-go + with: + only-modules: true + go-version-file: "go.mod" + + - name: Get chain-selectors version + id: get-chain-selectors-version + shell: bash + env: + GH_TOKEN: ${{ github.token }} + run: | + current_chain_selector_version=$(go list -m -f '{{.Version}}' github.com/smartcontractkit/chain-selectors) + latest_chain_selector_version=$(gh release view -R smartcontractkit/chain-selectors --json tagName --jq '.tagName') + if [[ "$current_chain_selector_version" != "$latest_chain_selector_version" ]]; then + echo "::error:: Chain Selectors version mismatch. Current version: $current_chain_selector_version, Latest version: $latest_chain_selector_version" + exit 1 + fi diff --git a/.github/workflows/changeset.yml b/.github/workflows/changeset.yml index cfb4b322bf2..e72bde7465b 100644 --- a/.github/workflows/changeset.yml +++ b/.github/workflows/changeset.yml @@ -50,13 +50,8 @@ jobs: - '!core/**/*.json' - '!core/chainlink.goreleaser.Dockerfile' - '!core/chainlink.Dockerfile' - contracts: - - contracts/**/*.sol - - '!contracts/**/*.t.sol' core-changeset: - added: '.changeset/**' - contracts-changeset: - - added: 'contracts/.changeset/**' - name: Check for changeset tags for core id: changeset-tags @@ -87,19 +82,34 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # we need to set the top level directory for the jira-tracing action manually + # because now we are working with two repositories and automatic detection would + # select the repository with jira-tracing and not the chainlink repository + - name: Setup git top level directory + id: find-git-top-level-dir + run: echo "top_level_dir=$(pwd)" >> $GITHUB_OUTPUT + + - name: Checkout .Github repository + uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 + with: + repository: smartcontractkit/.github + ref: 9aed33e5298471f20a3d630d711b96ae5538728c # jira-tracing@0.2.0 + path: ./dot_github + - name: Update Jira ticket for core id: jira if: ${{ steps.files-changed.outputs.core == 'true' || steps.files-changed.outputs.shared == 'true' }} shell: bash - working-directory: ./.github/scripts/jira + working-directory: ./dot_github run: | echo "COMMIT_MESSAGE=$(git log -1 --pretty=format:'%s')" >> $GITHUB_ENV - pnpm install && node update-jira-issue.js + pnpm install --filter jira-tracing && pnpm --filter jira-tracing issue:update env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - JIRA_HOST: ${{ secrets.JIRA_HOST }} + JIRA_HOST: ${{ vars.JIRA_HOST }} JIRA_USERNAME: ${{ secrets.JIRA_USERNAME }} JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }} + GIT_TOP_LEVEL_DIR: ${{ steps.find-git-top-level-dir.outputs.top_level_dir }} CHAINLINK_VERSION: ${{ steps.chainlink-version.outputs.chainlink_version }} PR_TITLE: ${{ github.event.pull_request.title }} BRANCH_NAME: ${{ github.event.pull_request.head.ref }} @@ -120,19 +130,6 @@ jobs: mode: ${{ steps.files-changed.outputs.core-changeset == 'false' && 'upsert' || 'delete' }} create_if_not_exists: ${{ steps.files-changed.outputs.core-changeset == 'false' && 'true' || 'false' }} - - name: Make a comment - uses: thollander/actions-comment-pull-request@fabd468d3a1a0b97feee5f6b9e499eab0dd903f6 # v2.5.0 - if: ${{ steps.files-changed.outputs.contracts == 'true' }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - message: | - I see you updated files related to `contracts`. Please run `pnpm changeset` in the `contracts` directory to add a changeset. - reactions: eyes - comment_tag: changeset-contracts - mode: ${{ steps.files-changed.outputs.contracts-changeset == 'false' && 'upsert' || 'delete' }} - create_if_not_exists: ${{ steps.files-changed.outputs.contracts-changeset == 'false' && 'true' || 'false' }} - - name: Check for new changeset for core if: ${{ (steps.files-changed.outputs.core == 'true' || steps.files-changed.outputs.shared == 'true') && steps.files-changed.outputs.core-changeset == 'false' }} shell: bash @@ -140,13 +137,6 @@ jobs: echo "Please run pnpm changeset to add a changeset for core and include in the text at least one tag." exit 1 - - name: Check for new changeset for contracts - if: ${{ steps.files-changed.outputs.contracts == 'true' && steps.files-changed.outputs.contracts-changeset == 'false' }} - shell: bash - run: | - echo "Please run pnpm changeset to add a changeset for contracts." - exit 1 - - name: Make a comment uses: thollander/actions-comment-pull-request@fabd468d3a1a0b97feee5f6b9e499eab0dd903f6 # v2.5.0 if: ${{ steps.files-changed.outputs.core-changeset == 'true' }} diff --git a/.github/workflows/ci-core.yml b/.github/workflows/ci-core.yml index 6b24f749c42..d415c58f7b6 100644 --- a/.github/workflows/ci-core.yml +++ b/.github/workflows/ci-core.yml @@ -45,7 +45,9 @@ jobs: with: filters: | changes: + - 'integration-tests/deployment/**' - '!integration-tests/**' + - 'integration-tests/deployment/**' - name: Ignore Filter On Workflow Dispatch if: ${{ github.event_name == 'workflow_dispatch' }} id: ignore-filter @@ -55,7 +57,13 @@ jobs: # We don't directly merge dependabot PRs, so let's not waste the resources if: ${{ (github.event_name == 'pull_request' || github.event_name == 'schedule') && github.actor != 'dependabot[bot]' }} name: lint - runs-on: ubuntu22.04-8cores-32GB + permissions: + # For golangci-lint-actions to annotate code in the PR. + checks: write + contents: read + # For golangci-lint-action's `only-new-issues` option. + pull-requests: read + runs-on: ubuntu-24.04-8cores-32GB-ARM needs: [filter] steps: - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 @@ -68,6 +76,7 @@ jobs: gc-basic-auth: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} gc-host: ${{ secrets.GRAFANA_INTERNAL_HOST }} gc-org-id: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} + - name: Notify Slack if: ${{ failure() && github.event.schedule != '' }} uses: slackapi/slack-github-action@6c661ce58804a1a20f6dc5fbee7f0381b469e001 # v1.25.0 @@ -89,6 +98,11 @@ jobs: - cmd: go_core_tests id: core_unit os: ubuntu22.04-32cores-128GB + printResults: true + - cmd: go_core_ccip_deployment_tests + id: core_unit + os: ubuntu22.04-32cores-128GB + printResults: true - cmd: go_core_race_tests id: core_race # use 64cores for overnight runs only due to massive number of runs from PRs @@ -177,9 +191,11 @@ jobs: CL_DATABASE_URL: ${{ env.DB_URL }} run: ./tools/bin/${{ matrix.type.cmd }} ./... - name: Print Filtered Test Results - if: ${{ failure() && matrix.type.cmd == 'go_core_tests' && needs.filter.outputs.changes == 'true' && steps.run-tests.conclusion == 'failure' }} + if: ${{ failure() && needs.filter.outputs.changes == 'true' && steps.run-tests.conclusion == 'failure' }} run: | - cat output.txt | gotestloghelper -ci + if [[ "${{ matrix.type.printResults }}" == "true" ]]; then + cat output.txt | gotestloghelper -ci + fi - name: Print Races id: print-races if: ${{ failure() && matrix.type.cmd == 'go_core_race_tests' && needs.filter.outputs.changes == 'true' }} @@ -287,7 +303,14 @@ jobs: if: ${{ needs.filter.outputs.changes == 'true' }} uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4 with: + name: go_core_tests_logs path: ./artifacts + - name: Delete go_core_tests_logs/coverage.txt + if: ${{ needs.filter.outputs.changes == 'true' }} + shell: bash + run: | + # Need to delete coverage.txt so the disk doesn't fill up + rm -f ./artifacts/go_core_tests_logs/coverage.txt - name: Build flakey test runner if: ${{ needs.filter.outputs.changes == 'true' }} run: go build ./tools/flakeytests/cmd/runner @@ -312,7 +335,7 @@ jobs: -gh_run_id=$GITHUB_RUN_ID \ -gh_repo=$GITHUB_REPO \ -command=./tools/bin/go_core_tests \ - `ls -R ./artifacts/go_core_tests*/output.txt` + `ls -R ./artifacts/output.txt` - name: Store logs artifacts if: ${{ needs.filter.outputs.changes == 'true' && always() }} uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 @@ -333,22 +356,61 @@ jobs: fetch-depth: 0 # fetches all history for all tags and branches to provide more metadata for sonar reports - name: Download all workflow run artifacts uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4 - - name: Set SonarQube Report Paths - id: sonarqube_report_paths + + - name: Check and Set SonarQube Report Paths shell: bash run: | - echo "sonarqube_tests_report_paths=$(find go_core_tests_logs -name output.txt | paste -sd "," -)" >> $GITHUB_OUTPUT - echo "sonarqube_coverage_report_paths=$(find go_core_tests_logs -name coverage.txt | paste -sd "," -)" >> $GITHUB_OUTPUT + # Check and assign paths for coverage/test reports + if [ -d "go_core_tests_logs" ]; then + sonarqube_coverage_report_paths=$(find go_core_tests_logs -name coverage.txt | paste -sd "," -) + sonarqube_tests_report_paths=$(find go_core_tests_logs -name output.txt | paste -sd "," -) + else + sonarqube_coverage_report_paths="" + sonarqube_tests_report_paths="" + fi + + # Check and assign paths for lint reports + if [ -d "golangci-lint-report" ]; then + sonarqube_lint_report_paths=$(find golangci-lint-report -name golangci-lint-report.xml | paste -sd "," -) + else + sonarqube_lint_report_paths="" + fi + + ARGS="" + if [[ -z "$sonarqube_tests_report_paths" ]]; then + echo "::warning::No test report paths found, will not pass to sonarqube" + else + echo "Found test report paths: $sonarqube_tests_report_paths" + ARGS="$ARGS -Dsonar.go.tests.reportPaths=$sonarqube_tests_report_paths" + fi + + if [[ -z "$sonarqube_coverage_report_paths" ]]; then + echo "::warning::No coverage report paths found, will not pass to sonarqube" + else + echo "Found coverage report paths: $sonarqube_coverage_report_paths" + ARGS="$ARGS -Dsonar.go.coverage.reportPaths=$sonarqube_coverage_report_paths" + fi + + if [[ -z "$sonarqube_lint_report_paths" ]]; then + echo "::warning::No lint report paths found, will not pass to sonarqube" + else + echo "Found lint report paths: $sonarqube_lint_report_paths" + ARGS="$ARGS -Dsonar.go.golangci-lint.reportPaths=$sonarqube_lint_report_paths" + fi + + echo "Final SONARQUBE_ARGS: $ARGS" + echo "SONARQUBE_ARGS=$ARGS" >> $GITHUB_ENV + - name: SonarQube Scan - uses: sonarsource/sonarqube-scan-action@69c1a75940dec6249b86dace6b630d3a2ae9d2a7 # v2.0.1 + if: ${{ env.SONARQUBE_ARGS != '' }} + uses: sonarsource/sonarqube-scan-action@aecaf43ae57e412bd97d70ef9ce6076e672fe0a9 # v2.3.0 with: - args: > - -Dsonar.go.tests.reportPaths=${{ steps.sonarqube_report_paths.outputs.sonarqube_tests_report_paths }} - -Dsonar.go.coverage.reportPaths=${{ steps.sonarqube_report_paths.outputs.sonarqube_coverage_report_paths }} - -Dsonar.go.golangci-lint.reportPaths=golangci-lint-report/golangci-lint-report.xml + args: ${{ env.SONARQUBE_ARGS }} env: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} + SONAR_SCANNER_OPTS: "-Xms6g -Xmx8g" + - name: Collect Metrics if: always() id: collect-gha-metrics @@ -385,7 +447,10 @@ jobs: run: curl https://github.com/smartcontractkit/wsrpc/raw/main/cmd/protoc-gen-go-wsrpc/protoc-gen-go-wsrpc --output $HOME/go/bin/protoc-gen-go-wsrpc && chmod +x $HOME/go/bin/protoc-gen-go-wsrpc - name: Setup NodeJS uses: ./.github/actions/setup-nodejs - - run: make generate # generate install go deps + - name: make generate + run: | + make rm-mocked + make generate - name: Ensure clean after generate run: git diff --stat --exit-code - run: make gomodtidy diff --git a/.github/workflows/ci-scripts.yml b/.github/workflows/ci-scripts.yml index 2c1024310f2..8fa27f66274 100644 --- a/.github/workflows/ci-scripts.yml +++ b/.github/workflows/ci-scripts.yml @@ -6,7 +6,15 @@ on: jobs: lint-scripts: + # We don't directly merge dependabot PRs, so let's not waste the resources + if: ${{ (github.event_name == 'pull_request' || github.event_name == 'schedule') && github.actor != 'dependabot[bot]' }} runs-on: ubuntu-latest + permissions: + # For golangci-lint-actions to annotate code in the PR. + checks: write + contents: read + # For golangci-lint-action's `only-new-issues` option. + pull-requests: read steps: - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 - name: Golang Lint diff --git a/.github/workflows/client-compatibility-tests.yml b/.github/workflows/client-compatibility-tests.yml index b744ffcc83d..c98cecf89d8 100644 --- a/.github/workflows/client-compatibility-tests.yml +++ b/.github/workflows/client-compatibility-tests.yml @@ -14,10 +14,10 @@ on: required: false type: string evmImplementations: - description: comma separated list of EVM implementations to test (ignored if base64TestList is used) + description: comma separated list of EVM implementations to test (ignored if base64TestList is used); supports geth,besu,nethermind,erigon,reth required: true type: string - default: "geth,besu,nethermind,erigon" + default: "geth,besu,nethermind,erigon,reth" latestVersionsNumber: description: how many of latest images of EVM implementations to test with (ignored if base64TestList is used) required: true @@ -54,6 +54,12 @@ jobs: - name: Check for go.mod changes id: changes run: | + if [ -z "${{ github.base_ref }}" ]; then + echo "No base branch found, this should not happen in a PR or MQ. Please reach out to the Test Tooling team." + echo "Github even that triggered the workflow: $GITHUB_EVENT_NAME" + echo "Github ref that triggered the workflow: $GITHUB_REF" + exit 1 + fi git fetch origin ${{ github.base_ref }} # if no match is found then grep exits with code 1, but if there is a match it exits with code 0 # this will return a match if there are any changes on that corresponding line, for example if spacing was changed @@ -84,7 +90,7 @@ jobs: runs-on: ubuntu-latest outputs: should_run: ${{ steps.should-run.outputs.should_run }} - eth_implementations : ${{ steps.should-run.outputs.eth_implementations }} + eth_implementations: ${{ steps.should-run.outputs.eth_implementations }} env: GITHUB_REF_TYPE: ${{ github.ref_type }} steps: @@ -92,15 +98,21 @@ jobs: id: should-run run: | if [ "${{ needs.check-dependency-bump.outputs.dependency_changed }}" == "true" ]; then + echo "## Build trigger" >> $GITHUB_STEP_SUMMARY + echo "go-ethereum dependency bump" >> $GITHUB_STEP_SUMMARY echo "Will run tests, because go-ethereum dependency was bumped" echo "should_run=true" >> $GITHUB_OUTPUT elif [ "$GITHUB_EVENT_NAME" = "schedule" ]; then + echo "## Build trigger" >> $GITHUB_STEP_SUMMARY + echo "schedule" >> $GITHUB_STEP_SUMMARY echo "Will run tests, because trigger event was $GITHUB_EVENT_NAME" echo "should_run=true" >> $GITHUB_OUTPUT elif [ "$GITHUB_EVENT_NAME" = "workflow_dispatch" ]; then echo "Will run tests, because trigger event was $GITHUB_EVENT_NAME" echo "should_run=true" >> $GITHUB_OUTPUT elif [ "$GITHUB_REF_TYPE" = "tag" ]; then + echo "## Build trigger" >> $GITHUB_STEP_SUMMARY + echo "new tag" >> $GITHUB_STEP_SUMMARY echo "Will run tests, because new tag was created" echo "should_run=true" >> $GITHUB_OUTPUT else @@ -117,9 +129,11 @@ jobs: RELEASED_DAYS_AGO: 4 GITHUB_REF_TYPE: ${{ github.ref_type }} outputs: - evm_implementations : ${{ steps.select-implementations.outputs.evm_implementations }} + evm_implementations: ${{ steps.select-implementations.outputs.evm_implementations }} chainlink_version: ${{ steps.select-chainlink-version.outputs.chainlink_version }} + chainlink_image_version: ${{ steps.select-chainlink-version.outputs.chainlink_image_version }} latest_image_count: ${{ steps.get-image-count.outputs.image_count }} + chainlink_ref_path: ${{ steps.select-chainlink-version.outputs.cl_ref_path }} steps: # ghlatestreleasechecker is a tool to check if new release is available for a given repo - name: Set Up ghlatestreleasechecker @@ -131,7 +145,7 @@ jobs: run: | PATH=$PATH:$(go env GOPATH)/bin export PATH - + if [ "$GITHUB_EVENT_NAME" = "schedule" ]; then echo "Checking for new releases" implementations_arr=() @@ -155,6 +169,12 @@ jobs: echo "New nethermind release found: $new_nethermind" implementations_arr+=("nethermind") fi + new_reth=$(ghlatestreleasechecker "paradigmxyz/reth" $RELEASED_DAYS_AGO) + if [ "$new_reth" != "none" ]; then + echo "New reth release found: $new_reth" + implementations_arr+=("reth") + fi + IFS=',' eth_implementations="${implementations_arr[*]}" if [ -n "$eth_implementations" ]; then @@ -172,47 +192,65 @@ jobs: fi else echo "Will test all EVM implementations" - echo "evm_implementations=geth,besu,nethermind,erigon" >> $GITHUB_OUTPUT + echo "evm_implementations=geth,besu,nethermind,erigon,reth" >> $GITHUB_OUTPUT fi - name: Select Chainlink version id: select-chainlink-version run: | PATH=$PATH:$(go env GOPATH)/bin export PATH - + if [ "$GITHUB_EVENT_NAME" = "schedule" ]; then echo "Fetching latest Chainlink stable version" implementations_arr=() # we use 100 days since we really want the latest one, and it's highly improbable there won't be a release in last 100 days - chainlink_version=$(ghlatestreleasechecker "smartcontractkit/chainlink" 100) - echo "chainlink_version=$chainlink_version" >> $GITHUB_OUTPUT + chainlink_version=$(ghlatestreleasechecker "smartcontractkit/chainlink" 100) + chainlink_image_version=$chainlink_version + cl_ref_path="releases" elif [ "$GITHUB_EVENT_NAME" = "workflow_dispatch" ]; then echo "Fetching Chainlink version from input" if [ -n "${{ github.event.inputs.chainlinkVersion }}" ]; then echo "Chainlink version provided in input" - chainlink_version="${{ github.event.inputs.chainlinkVersion }}" + chainlink_version="${{ github.event.inputs.chainlinkVersion }}" + if [[ "$chainlink_version" =~ ^[0-9a-f]{40}$ ]]; then + cl_ref_path="commit" + chainlink_image_version=$chainlink_version + else + cl_ref_path="releases" + # strip the 'v' from the version, because we tag our Docker images without it + chainlink_image_version="${chainlink_version#v}" + fi else echo "Chainlink version not provided in input. Using latest commit SHA." chainlink_version=${{ github.sha }} + chainlink_image_version=$chainlink_version + cl_ref_path="commit" fi - echo "chainlink_version=$chainlink_version" >> $GITHUB_OUTPUT elif [ "$GITHUB_EVENT_NAME" = "pull_request" ]; then echo "Fetching Chainlink version from PR's head commit" chainlink_version="${{ github.event.pull_request.head.sha }}" - echo "chainlink_version=$chainlink_version" >> $GITHUB_OUTPUT + chainlink_image_version=$chainlink_version + cl_ref_path="commit" elif [ "$GITHUB_EVENT_NAME" = "merge_queue" ]; then echo "Fetching Chainlink version from merge queue's head commit" chainlink_version="${{ github.event.merge_group.head_sha }}" - echo "chainlink_version=$chainlink_version" >> $GITHUB_OUTPUT + chainlink_image_version=$chainlink_version + cl_ref_path="commit" elif [ "$GITHUB_REF_TYPE" = "tag" ]; then echo "Fetching Chainlink version from tag" - chainlink_version="${{ github.ref }}" - echo "chainlink_version=$chainlink_version" >> $GITHUB_OUTPUT + chainlink_version="${{ github.ref_name }}" + # strip the 'v' from the version, because we tag our Docker images without it + chainlink_image_version="${chainlink_version#v}" + cl_ref_path="releases" else echo "Unsupported trigger event. It's probably an issue with the pipeline definition. Please reach out to the Test Tooling team." exit 1 fi echo "Will use following Chainlink version: $chainlink_version" + echo "chainlink_version=$chainlink_version" >> $GITHUB_OUTPUT + echo "Will use following Chainlink Docker image version: $chainlink_image_version" + echo "chainlink_image_version=$chainlink_image_version" >> $GITHUB_OUTPUT + echo "cl_ref_path=$cl_ref_path" >> $GITHUB_OUTPUT - name: Get image count id: get-image-count run: | @@ -223,7 +261,7 @@ jobs: else image_count="${{ github.event.inputs.latestVersionsNumber }}" echo "image_count=$image_count" >> $GITHUB_OUTPUT - fi + fi else echo "Fetching default latest image count" image_count=3 @@ -255,9 +293,11 @@ jobs: expression: '^[0-9]+\.[0-9]+\.[0-9]+$' - name: tofelb/ethereum-genesis-generator expression: '^[0-9]+\.[0-9]+\.[0-9]+(\-slots\-per\-epoch)?' + - name: ghcr.io/paradigmxyz/reth + expression: '^v[0-9]+\.[0-9]+\.[0-9]+$' steps: - name: Update internal ECR if the latest Ethereum client image does not exist - uses: smartcontractkit/chainlink-testing-framework/.github/actions/update-internal-mirrors@5eea86ee4f7742b4e944561a570a6b268e712d9e # v1.30.3 + uses: smartcontractkit/chainlink-testing-framework/.github/actions/update-internal-mirrors@352cf299b529a33208146d9f7f0e0b5534fba6e7 # v1.33.0 with: aws_region: ${{ secrets.QA_AWS_REGION }} role_to_assume: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} @@ -265,9 +305,16 @@ jobs: image_name: ${{matrix.mirror.name}} expression: ${{matrix.mirror.expression}} page_size: ${{matrix.mirror.page_size}} + github_token: ${{ secrets.RETH_GH_TOKEN }} # needed only for checking GHRC.io repositories build-chainlink: - if: always() && needs.should-run.outputs.should_run == 'true' && (needs.select-versions.outputs.evm_implementations != '' || github.event.inputs.base64TestList != '') + if: | + always() && + needs.should-run.outputs.should_run == 'true' && + ( + needs.select-versions.outputs.evm_implementations != '' || + github.event.inputs.base64TestList != '' + ) environment: integration permissions: id-token: write @@ -276,16 +323,6 @@ jobs: runs-on: ubuntu-latest needs: [should-run, select-versions] steps: - - name: Collect Metrics - id: collect-gha-metrics - uses: smartcontractkit/push-gha-metrics-action@d9da21a2747016b3e13de58c7d4115a3d5c97935 # v3.0.1 - with: - id: client-compatablility-build-chainlink - org-id: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} - basic-auth: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} - hostname: ${{ secrets.GRAFANA_INTERNAL_HOST }} - this-job-name: Build Chainlink Image - continue-on-error: true - name: Checkout the repo uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 with: @@ -295,14 +332,26 @@ jobs: with: tag_suffix: "" dockerfile: core/chainlink.Dockerfile - git_commit_sha: ${{ needs.select-versions.outputs.chainlink_version }} - check_image_exists: 'true' + # for tagged releases Docker image version is different from the Chainlink version (v2.13.0 -> 2.13.0) + # for all other cases (PRs, commits, etc.) Docker image version is the same as the Chainlink version + git_commit_sha: ${{ needs.select-versions.outputs.chainlink_image_version }} + check_image_exists: "true" AWS_REGION: ${{ secrets.QA_AWS_REGION }} AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} + - name: Collect Metrics + id: collect-gha-metrics + uses: smartcontractkit/push-gha-metrics-action@d9da21a2747016b3e13de58c7d4115a3d5c97935 # v3.0.1 + with: + id: client-compatablility-build-chainlink + org-id: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} + basic-auth: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} + hostname: ${{ secrets.GRAFANA_INTERNAL_HOST }} + this-job-name: Build Chainlink Image + continue-on-error: true get-latest-available-images: name: Get Latest EVM Implementation's Images - if: always() && needs.should-run.outputs.should_run == 'true' && (needs.select-versions.outputs.evm_implementations != '' || github.event.inputs.base64TestList != '') + if: always() && needs.should-run.outputs.should_run == 'true' && needs.select-versions.outputs.evm_implementations != '' && github.event.inputs.base64TestList == '' environment: integration runs-on: ubuntu-latest needs: [check-ecr-images-exist, should-run, select-versions] @@ -316,6 +365,7 @@ jobs: nethermind_images: ${{ env.NETHERMIND_IMAGES }} besu_images: ${{ env.BESU_IMAGES }} erigon_images: ${{ env.ERIGON_IMAGES }} + reth_images: ${{ env.RETH_IMAGES }} steps: # Setup AWS creds - name: Configure AWS Credentials @@ -350,26 +400,32 @@ jobs: echo "GETH_IMAGES=$geth_images" >> $GITHUB_ENV echo "Geth latest images: $geth_images" fi - + if [[ "$ETH_IMPLEMENTATIONS" == *"nethermind"* ]]; then nethermind_images=$(ecrimagefetcher 'nethermind/nethermind' '^[0-9]+\.[0-9]+\.[0-9]+$' ${{ env.LATEST_IMAGE_COUNT }}) echo "NETHERMIND_IMAGES=$nethermind_images" >> $GITHUB_ENV echo "Nethermind latest images: $nethermind_images" fi - + if [[ "$ETH_IMPLEMENTATIONS" == *"besu"* ]]; then # 24.3.3 is ignored as it doesn't support data & input fields in eth_call besu_images=$(ecrimagefetcher 'hyperledger/besu' '^[0-9]+\.[0-9]+(\.[0-9]+)?$' ${{ env.LATEST_IMAGE_COUNT }} ">=24.5.1") echo "BESU_IMAGES=$besu_images" >> $GITHUB_ENV echo "Besu latest images: $besu_images" fi - + if [[ "$ETH_IMPLEMENTATIONS" == *"erigon"* ]]; then # 2.60.0 and 2.60.1 are ignored as they stopped working with CL node erigon_images=$(ecrimagefetcher 'thorax/erigon' '^v[0-9]+\.[0-9]+\.[0-9]+$' ${{ env.LATEST_IMAGE_COUNT }} "> $GITHUB_ENV echo "Erigon latest images: $erigon_images" fi + + if [[ "$ETH_IMPLEMENTATIONS" == *"reth"* ]]; then + reth_images=$(ecrimagefetcher 'ghcr.io/paradigmxyz/reth' '^v[0-9]+\.[0-9]+\.[0-9]+$' ${{ env.LATEST_IMAGE_COUNT }}) + echo "RETH_IMAGES=$reth_images" >> $GITHUB_ENV + echo "Reth latest images: $reth_images" + fi # End Build Test Dependencies @@ -382,7 +438,7 @@ jobs: pull-requests: write id-token: write contents: read - needs: [get-latest-available-images,should-run,select-versions] + needs: [get-latest-available-images, should-run, select-versions] runs-on: ubuntu-latest env: ETH_IMPLEMENTATIONS: ${{ needs.select-versions.outputs.evm_implementations }} @@ -445,7 +501,7 @@ jobs: else echo "Will not test compatibility with geth" fi - + if [[ "$ETH_IMPLEMENTATIONS" == *"besu"* ]]; then echo "Will test compatibility with besu" testlistgenerator -o compatibility_test_list.json -p cron -r TestCronBasic -f './smoke/cron_test.go' -e besu -d "${{ needs.get-latest-available-images.outputs.besu_images }}" -t "evm-implementation-compatibility-test" -n "ubuntu-latest" @@ -463,7 +519,7 @@ jobs: else echo "Will not test compatibility with besu" fi - + if [[ "$ETH_IMPLEMENTATIONS" == *"erigon"* ]]; then echo "Will test compatibility with erigon" testlistgenerator -o compatibility_test_list.json -p cron -r TestCronBasic -f './smoke/cron_test.go' -e erigon -d "${{ needs.get-latest-available-images.outputs.erigon_images }}" -t "evm-implementation-compatibility-test" -n "ubuntu-latest" @@ -480,7 +536,7 @@ jobs: else echo "Will not test compatibility with erigon" fi - + if [[ "$ETH_IMPLEMENTATIONS" == *"nethermind"* ]]; then echo "Will test compatibility with nethermind" testlistgenerator -o compatibility_test_list.json -p cron -r TestCronBasic -f './smoke/cron_test.go' -e nethermind -d "${{ needs.get-latest-available-images.outputs.nethermind_images }}" -t "evm-implementation-compatibility-test" -n "ubuntu-latest" @@ -499,20 +555,41 @@ jobs: echo "Will not test compatibility with nethermind" fi + if [[ "$ETH_IMPLEMENTATIONS" == *"reth"* ]]; then + echo "Will test compatibility with reth" + testlistgenerator -o compatibility_test_list.json -p cron -r TestCronBasic -f './smoke/cron_test.go' -e reth -d "${{ needs.get-latest-available-images.outputs.reth_images }}" -t "evm-implementation-compatibility-test" -n "ubuntu-latest" + testlistgenerator -o compatibility_test_list.json -p flux -r TestFluxBasic -f './smoke/flux_test.go' -e reth -d "${{ needs.get-latest-available-images.outputs.reth_images }}" -t "evm-implementation-compatibility-test" -n "ubuntu-latest" + testlistgenerator -o compatibility_test_list.json -p runlog -r TestRunLogBasic -f './smoke/runlog_test.go' -e reth -d "${{ needs.get-latest-available-images.outputs.reth_images }}" -t "evm-implementation-compatibility-test" -n "ubuntu-latest" + testlistgenerator -o compatibility_test_list.json -p log_poller -r TestLogPollerFewFiltersFixedDepth -f './smoke/log_poller_test.go' -e reth -d "${{ needs.get-latest-available-images.outputs.reth_images }}" -t "evm-implementation-compatibility-test" -n "ubuntu-latest" + testlistgenerator -o compatibility_test_list.json -p ocr -r TestOCRBasic -f './smoke/ocr_test.go' -e reth -d "${{ needs.get-latest-available-images.outputs.reth_images }}" -t "evm-implementation-compatibility-test" -n "ubuntu-latest" + testlistgenerator -o compatibility_test_list.json -p ocr2 -r '^TestOCRv2Basic/plugins$' -f './smoke/ocr2_test.go' -e reth -d "${{ needs.get-latest-available-images.outputs.reth_images }}" -t "evm-implementation-compatibility-test" -n "ubuntu-latest" + testlistgenerator -o compatibility_test_list.json -p automation -r 'TestAutomationBasic/registry_2_1_logtrigger' -f './smoke/automation_test.go' -e reth -d "${{ needs.get-latest-available-images.outputs.reth_images }}" -t "evm-implementation-compatibility-test" -n "ubuntu-latest" + testlistgenerator -o compatibility_test_list.json -p keeper -r 'TestKeeperBasicSmoke/registry_1_3' -f './smoke/keeper_test.go' -e reth -d "${{ needs.get-latest-available-images.outputs.reth_images }}" -t "evm-implementation-compatibility-test" -n "ubuntu-latest" + testlistgenerator -o compatibility_test_list.json -p vrf -r '^TestVRFBasic/Request_Randomness$' -f './smoke/vrf_test.go' -e reth -d "${{ needs.get-latest-available-images.outputs.reth_images }}" -t "evm-implementation-compatibility-test" -n "ubuntu-latest" + testlistgenerator -o compatibility_test_list.json -p vrfv2 -r '^TestVRFv2Basic/Request_Randomness$' -f './smoke/vrfv2_test.go' -e reth -d "${{ needs.get-latest-available-images.outputs.reth_images }}" -t "evm-implementation-compatibility-test" -n "ubuntu-latest" + testlistgenerator -o compatibility_test_list.json -p vrfv2plus -r '^TestVRFv2Plus$/^Link_Billing$' -f './smoke/vrfv2plus_test.go' -e reth -d "${{ needs.get-latest-available-images.outputs.reth_images }}" -t "evm-implementation-compatibility-test" -n "ubuntu-latest" + else + echo "Will not test compatibility with reth" + fi + jq . compatibility_test_list.json JOB_MATRIX_JSON=$(jq -c . compatibility_test_list.json) - echo "JOB_MATRIX_JSON=${JOB_MATRIX_JSON}" >> $GITHUB_ENV + echo "JOB_MATRIX_JSON=${JOB_MATRIX_JSON}" >> $GITHUB_ENV run-client-compatibility-matrix: name: ${{ matrix.evm_node.product }} compatibility with ${{ matrix.evm_node.docker_image }} - if: always() && needs.should-run.outputs.should_run == 'true' && needs.build-chainlink.result == 'success' && needs.prepare-compatibility-matrix.outputs.matrix != '' + if: always() && needs.should-run.outputs.should_run == 'true' && (needs.build-chainlink.result == 'success' || needs.build-chainlink.result == 'skipped') && needs.prepare-compatibility-matrix.outputs.matrix != '' environment: integration permissions: checks: write pull-requests: write id-token: write contents: read - needs: [build-chainlink, prepare-compatibility-matrix, should-run, select-versions] + needs: + - build-chainlink + - prepare-compatibility-matrix + - should-run + - select-versions env: SELECTED_NETWORKS: SIMULATED,SIMULATED_1,SIMULATED_2 CHAINLINK_COMMIT_SHA: ${{ needs.select-versions.outputs.chainlink_version }} @@ -539,16 +616,6 @@ jobs: api-gateway-host: ${{ secrets.AWS_API_GW_HOST_GRAFANA }} # other inputs duplicate-authorization-header: "true" - - name: Prepare Base64 TOML override - uses: ./.github/actions/setup-create-base64-config - with: - runId: ${{ github.run_id }} - testLogCollect: ${{ vars.TEST_LOG_COLLECT }} - selectedNetworks: ${{ env.SELECTED_NETWORKS }} - chainlinkVersion: ${{ needs.select-versions.outputs.chainlink_version }} - logstreamLogTargets: ${{ vars.LOGSTREAM_LOG_TARGETS }} - ethExecutionClient: ${{ matrix.evm_node.eth_implementation }} - customEthClientDockerImage: ${{ matrix.evm_node.docker_image }} - name: Prepare test log name run: | replace_special_chars() { @@ -571,22 +638,21 @@ jobs: echo "$modified_string" } echo "TEST_LOG_NAME=$(replace_special_chars "${{ matrix.evm_node.product }}-${{ matrix.evm_node.docker_image }}-test-logs")" >> $GITHUB_ENV -# - name: Collect Workflow Telemetry -# uses: catchpoint/workflow-telemetry-action@v2 -# with: -# comment_on_pr: false -# theme: 'dark' + # - name: Collect Workflow Telemetry + # uses: catchpoint/workflow-telemetry-action@v2 + # with: + # comment_on_pr: false + # theme: 'dark' - name: Run Tests - uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests@75a9005952a9e905649cfb5a6971fd9429436acd # v2.3.25 + uses: smartcontractkit/.github/actions/ctf-run-tests@b6e37806737eef87e8c9137ceeb23ef0bff8b1db # ctf-run-tests@0.1.0 with: test_command_to_run: cd ./integration-tests && touch .root_dir && go test -timeout 30m -count=1 -json ${{ matrix.evm_node.run }} 2>&1 | tee /tmp/gotest.log | gotestloghelper -ci -singlepackage -hidepassingtests=false -hidepassinglogs test_download_vendor_packages_command: cd ./integration-tests && go mod download - cl_repo: ${{ env.CHAINLINK_IMAGE }} - cl_image_tag: ${{ needs.select-versions.outputs.chainlink_version }} aws_registries: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }} artifacts_name: ${{ env.TEST_LOG_NAME }} artifacts_location: | ./integration-tests/smoke/logs/ + ./integration-tests/smoke/db_dumps/ /tmp/gotest.log publish_check_name: ${{ matrix.evm_node.product }}-${{ matrix.evm_node.eth_implementation }} token: ${{ secrets.GITHUB_TOKEN }} @@ -599,22 +665,30 @@ jobs: should_tidy: "false" go_coverage_src_dir: /var/tmp/go-coverage go_coverage_dest_dir: ${{ github.workspace }}/.covdata - DEFAULT_CHAINLINK_IMAGE: ${{ env.CHAINLINK_IMAGE }} - DEFAULT_LOKI_TENANT_ID: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} - DEFAULT_LOKI_ENDPOINT: https://${{ secrets.GRAFANA_INTERNAL_HOST }}/loki/api/v1/push - DEFAULT_LOKI_BASIC_AUTH: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} - DEFAULT_GRAFANA_BASE_URL: "http://localhost:8080/primary" - DEFAULT_GRAFANA_DASHBOARD_URL: "/d/ddf75041-1e39-42af-aa46-361fe4c36e9e/ci-e2e-tests-logs" - DEFAULT_GRAFANA_BEARER_TOKEN: ${{ secrets.GRAFANA_INTERNAL_URL_SHORTENER_TOKEN }} - DEFAULT_PYROSCOPE_SERVER_URL: ${{ secrets.QA_PYROSCOPE_INSTANCE }} - DEFAULT_PYROSCOPE_KEY: ${{ secrets.QA_PYROSCOPE_KEY }} - DEFAULT_PYROSCOPE_ENVIRONMENT: ci-client-compatability-${{ matrix.eth_client }}-testnet - DEFAULT_PYROSCOPE_ENABLED: "true" - - - name: Print failed test summary - if: always() - uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/show-test-summary@75a9005952a9e905649cfb5a6971fd9429436acd # v2.3.25 + env: + E2E_TEST_SELECTED_NETWORK: ${{ env.SELECTED_NETWORKS}} + E2E_TEST_CHAINLINK_IMAGE: ${{ env.CHAINLINK_IMAGE }} + E2E_TEST_CHAINLINK_VERSION: ${{ needs.select-versions.outputs.chainlink_image_version }} + E2E_TEST_LOKI_TENANT_ID: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} + E2E_TEST_LOKI_ENDPOINT: https://${{ secrets.GRAFANA_INTERNAL_HOST }}/loki/api/v1/push + E2E_TEST_LOKI_BASIC_AUTH: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} + E2E_TEST_GRAFANA_DASHBOARD_URL: "/d/ddf75041-1e39-42af-aa46-361fe4c36e9e/ci-e2e-tests-logs" + E2E_TEST_GRAFANA_BEARER_TOKEN: ${{ secrets.GRAFANA_INTERNAL_URL_SHORTENER_TOKEN }} + E2E_TEST_PYROSCOPE_SERVER_URL: ${{ secrets.QA_PYROSCOPE_INSTANCE }} + E2E_TEST_PYROSCOPE_KEY: ${{ secrets.QA_PYROSCOPE_KEY }} + E2E_TEST_PYROSCOPE_ENVIRONMENT: ci-client-compatability-${{ matrix.eth_client }}-testnet + E2E_TEST_PYROSCOPE_ENABLED: "true" + E2E_TEST_LOGGING_RUN_ID: ${{ github.run_id }} + E2E_TEST_LOG_COLLECT: ${{ vars.TEST_LOG_COLLECT }} + E2E_TEST_LOG_STREAM_LOG_TARGETS: ${{ vars.LOGSTREAM_LOG_TARGETS }} + E2E_TEST_PRIVATE_ETHEREUM_EXECUTION_LAYER: ${{ matrix.evm_node.eth_implementation || 'geth' }} + E2E_TEST_PRIVATE_ETHEREUM_ETHEREUM_VERSION: auto_fill # Auto fill the version based on the docker image + E2E_TEST_PRIVATE_ETHEREUM_CUSTOM_DOCKER_IMAGE: ${{ matrix.evm_node.docker_image }} + - name: Show Grafana url in test summary + if: always() + uses: smartcontractkit/.github/actions/ctf-show-grafana-in-test-summary@b6e37806737eef87e8c9137ceeb23ef0bff8b1db # ctf-show-grafana-in-test-summary@0.1.0 + start-slack-thread: name: Start Slack Thread if: always() && needs.*.result != 'skipped' && needs.*.result != 'cancelled' && needs.should-run.outputs.should_run == 'true' && (needs.select-versions.outputs.evm_implementations != '' || github.event.inputs.base64TestList != '') @@ -627,7 +701,7 @@ jobs: id-token: write contents: read runs-on: ubuntu-latest - needs: [run-client-compatibility-matrix, should-run, select-versions] + needs: [run-client-compatibility-matrix, should-run, select-versions, build-chainlink, prepare-compatibility-matrix] steps: - name: Debug Result run: echo ${{ join(needs.*.result, ',') }} @@ -640,7 +714,7 @@ jobs: { "attachments": [ { - "color": "${{ contains(join(needs.*.result, ','), 'failure') && '#C62828' || '#2E7D32' }}", + "color": "${{ (contains(join(needs.*.result, ','), 'failure') || needs.build-chainlink.result == 'failure') && '#C62828' || '#2E7D32' }}", "blocks": [ { "type": "header", @@ -654,7 +728,7 @@ jobs: "type": "section", "text": { "type": "mrkdwn", - "text": "${{ contains(join(needs.*.result, ','), 'failure') && 'Some tests failed, notifying <@S0536FX9ZDZ>' || 'All Good!' }}" + "text": "${{ needs.prepare-compatibility-matrix.result == 'failure' && 'Failed to prepare test matrix, notifying ' || needs.build-chainlink.result == 'failure' && 'Failed to build Chainlink image, notifying ' || contains(join(needs.*.result, ','), 'failure') && format('Some tests failed, notifying ', secrets.COMPAT_SLACK_NOTIFICATION_HANDLE) || 'All Good!' }}" } }, { @@ -664,7 +738,7 @@ jobs: "type": "section", "text": { "type": "mrkdwn", - "text": "<${{ github.server_url }}/${{ github.repository }}/releases/tag/${{ github.ref_name }}|${{ github.ref_name }}> | <${{ github.server_url }}/${{ github.repository }}/commit/${{ needs.select-versions.outputs.chainlink_version }}|${{ needs.select-versions.outputs.chainlink_version }}> | <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|Run>" + "text": "<${{ github.server_url }}/${{ github.repository }}/${{ needs.select-versions.outputs.chainlink_ref_path }}/${{ needs.select-versions.outputs.chainlink_version }}|${{ needs.select-versions.outputs.chainlink_version }}> | <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|Run>" } } ] @@ -684,7 +758,7 @@ jobs: id-token: write contents: read runs-on: ubuntu-latest - needs: [run-client-compatibility-matrix,should-run] + needs: [run-client-compatibility-matrix, should-run] outputs: base64_parsed_results: ${{ steps.get-test-results.outputs.base64_parsed_results }} steps: @@ -699,7 +773,7 @@ jobs: run: | PATH=$PATH:$(go env GOPATH)/bin export PATH - + workflowresultparser -workflowRunID ${{ github.run_id }} -githubToken ${{ github.token }} -githubRepo "${{ github.repository }}" -jobNameRegex "^automation compatibility with (.*?)$" -namedKey="automation" -outputFile=output.json workflowresultparser -workflowRunID ${{ github.run_id }} -githubToken ${{ github.token }} -githubRepo "${{ github.repository }}" -jobNameRegex "^keeper compatibility with (.*?)$" -namedKey="keeper" -outputFile=output.json workflowresultparser -workflowRunID ${{ github.run_id }} -githubToken ${{ github.token }} -githubRepo "${{ github.repository }}" -jobNameRegex "^log_poller compatibility with (.*?)$" -namedKey="log_poller" -outputFile=output.json @@ -716,7 +790,7 @@ jobs: display-test-results: name: Aggregated test results - if: always() && needs.*.result != 'skipped' && needs.*.result != 'cancelled' && needs.should-run.outputs.should_run == 'true' && needs.parse-test-results.result == 'success' + if: always() && needs.*.result != 'skipped' && needs.*.result != 'cancelled' && needs.should-run.outputs.should_run == 'true' && needs.parse-test-results.result == 'success' environment: integration permissions: checks: write @@ -736,7 +810,7 @@ jobs: run: | PATH=$PATH:$(go env GOPATH)/bin export PATH - + raw_results="$(echo ${{ needs.parse-test-results.outputs.base64_parsed_results }} | base64 -d)" echo $raw_results > input.json asciitable --firstColumn "EVM Implementation" --secondColumn Result --jsonfile input.json --outputFile output.txt --section "automation" --namedKey "automation" @@ -750,11 +824,11 @@ jobs: asciitable --firstColumn "EVM Implementation" --secondColumn Result --jsonfile input.json --outputFile output.txt --section "flux" --namedKey "flux" asciitable --firstColumn "EVM Implementation" --secondColumn Result --jsonfile input.json --outputFile output.txt --section "cron" --namedKey "cron" asciitable --firstColumn "EVM Implementation" --secondColumn Result --jsonfile input.json --outputFile output.txt --section "runlog" --namedKey "runlog" - + echo echo "AGGREGATED RESULTS" cat output.txt - + echo "## Aggregated EVM Implementations compatibility results summary" >> $GITHUB_STEP_SUMMARY echo '```' >> $GITHUB_STEP_SUMMARY cat output.txt >> $GITHUB_STEP_SUMMARY @@ -774,7 +848,18 @@ jobs: strategy: fail-fast: false matrix: - product: [automation, keeper, log_poller, ocr, ocr2, vrf, vrfv2, vrfv2plus, cron, flux, runlog] + product: + - automation + - keeper + - log_poller + - ocr + - ocr2 + - vrf + - vrfv2 + - vrfv2plus + - cron + - flux + - runlog steps: - name: Checkout the repo uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 diff --git a/.github/workflows/crib-integration-test.yml b/.github/workflows/crib-integration-test.yml new file mode 100644 index 00000000000..8fd23a783f0 --- /dev/null +++ b/.github/workflows/crib-integration-test.yml @@ -0,0 +1,118 @@ +name: CRIB Integration Tests +on: + pull_request: + paths: + - ".github/workflows/crib-integration-test.yml" + schedule: + - cron: "0 1 * * *" + workflow_call: +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true +jobs: + test: + runs-on: ubuntu-latest + environment: integration + permissions: + id-token: write + contents: read + actions: read + steps: + - name: Checkout repository + uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 + + - uses: cachix/install-nix-action@ba0dd844c9180cbf77aa72a116d6fbc515d0e87b # v27 + with: + nix_path: nixpkgs=channel:nixos-unstable + + - name: setup-gap crib + uses: smartcontractkit/.github/actions/setup-gap@00b58566e0ee2761e56d9db0ea72b783fdb89b8d # setup-gap@0.4.0 + with: + aws-role-duration-seconds: 3600 # 1 hour + aws-role-arn: ${{ secrets.AWS_OIDC_CRIB_ROLE_ARN_STAGE }} + api-gateway-host: ${{ secrets.AWS_API_GW_HOST_CRIB_STAGE }} + aws-region: ${{ secrets.AWS_REGION }} + ecr-private-registry: ${{ secrets.AWS_ACCOUNT_ID_PROD }} + k8s-cluster-name: ${{ secrets.AWS_K8S_CLUSTER_NAME_STAGE }} + gap-name: crib + use-private-ecr-registry: true + use-tls: true + proxy-port: 8080 + metrics-job-name: "test" + gc-basic-auth: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} + gc-host: ${{ secrets.GRAFANA_INTERNAL_HOST }} + gc-org-id: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} + + - name: setup-gap k8s + uses: smartcontractkit/.github/actions/setup-gap@00b58566e0ee2761e56d9db0ea72b783fdb89b8d # setup-gap@0.4.0 + with: + aws-role-duration-seconds: 3600 # 1 hour + aws-role-arn: ${{ secrets.AWS_OIDC_CRIB_ROLE_ARN_STAGE }} + api-gateway-host: ${{ secrets.AWS_API_GW_HOST_K8S_STAGE }} + aws-region: ${{ secrets.AWS_REGION }} + ecr-private-registry: ${{ secrets.AWS_ACCOUNT_ID_PROD }} + k8s-cluster-name: ${{ secrets.AWS_K8S_CLUSTER_NAME_STAGE }} + gap-name: k8s + use-private-ecr-registry: true + use-k8s: true + proxy-port: 8443 + metrics-job-name: "test" + gc-basic-auth: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} + gc-host: ${{ secrets.GRAFANA_INTERNAL_HOST }} + gc-org-id: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} + + - name: Setup GitHub token using GATI + id: token + uses: smartcontractkit/.github/actions/setup-github-token@c0b38e6c40d72d01b8d2f24f92623a2538b3dedb # main + with: + aws-role-arn: ${{ secrets.AWS_OIDC_GLOBAL_READ_ONLY_TOKEN_ISSUER_ROLE_ARN }} + aws-lambda-url: ${{ secrets.AWS_INFRA_RELENG_TOKEN_ISSUER_LAMBDA_URL }} + aws-region: ${{ secrets.AWS_REGION }} + aws-role-duration-seconds: "1800" + - name: Debug workspace dir + shell: bash + run: | + echo ${{ github.workspace }} + echo $GITHUB_WORKSPACE + + - name: Deploy and validate CRIB Environment for Core + uses: smartcontractkit/.github/actions/crib-deploy-environment@fa63a0fb95039c4d89fec6a9a78b53c0cacf5457 # crib-deploy-environment@2.0.0 + id: deploy-crib + with: + github-token: ${{ steps.token.outputs.access-token }} + api-gateway-host: ${{ secrets.AWS_API_GW_HOST_K8S_STAGE }} + aws-region: ${{ secrets.AWS_REGION }} + aws-role-arn: ${{ secrets.AWS_OIDC_CRIB_ROLE_ARN_STAGE }} + ecr-private-registry: ${{ secrets.AWS_ACCOUNT_ID_PROD }} + ingress-base-domain: ${{ secrets.INGRESS_BASE_DOMAIN_STAGE }} + k8s-cluster-name: ${{ secrets.AWS_K8S_CLUSTER_NAME_STAGE }} + command: "core-dev-simulated-core-ocr1" + crib-alert-slack-webhook: ${{ secrets.CRIB_ALERT_SLACK_WEBHOOK }} + product-image: ${{ secrets.AWS_SDLC_ECR_HOSTNAME }}/chainlink + product-image-tag: develop + - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 + - name: Setup go + uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 + with: + go-version-file: "go.mod" + - name: Run CRIB integration test + working-directory: integration-tests/crib + env: + K8S_STAGING_INGRESS_SUFFIX: ${{ secrets.K8S_STAGING_INGRESS_SUFFIX }} + CRIB_NAMESPACE: ${{ steps.deploy-crib.outputs.devspace-namespace }} + CRIB_NETWORK: geth + CRIB_NODES: 5 + GAP_URL: ${{ secrets.GAP_URL }} + SETH_LOG_LEVEL: info + # RESTY_DEBUG: true + TEST_PERSISTENCE: true + E2E_TEST_CHAINLINK_IMAGE: public.ecr.aws/chainlink/chainlink + E2E_TEST_CHAINLINK_VERSION: latest + run: |- + go test -v -run TestCRIBChaos + - name: Destroy CRIB Environment + id: destroy + if: always() && steps.deploy-crib.outputs.devspace-namespace != '' + uses: smartcontractkit/.github/actions/crib-purge-environment@c0b38e6c40d72d01b8d2f24f92623a2538b3dedb # crib-purge-environment@0.1.0 + with: + namespace: ${{ steps.deploy-crib.outputs.devspace-namespace }} diff --git a/.github/workflows/gha-workflow-validation.yml b/.github/workflows/gha-workflow-validation.yml deleted file mode 100644 index 1ec502432ca..00000000000 --- a/.github/workflows/gha-workflow-validation.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: GHA Workflow Validation - -on: - pull_request: - -jobs: - - validate-worfklow-changes: - name: Validate Workflow Changes - permissions: - contents: read - pull-requests: write - actions: read - runs-on: ubuntu-latest - steps: - - name: GHA Workflow Validator - uses: smartcontractkit/.github/actions/gha-workflow-validator@d316f66b2990ea4daa479daa3de6fc92b00f863e # gha-workflow-validator@0.2.0 - env: - GITHUB_TOKEN: ${{ github.token }} - - - name: Collect Metrics - if: always() - id: collect-gha-metrics - uses: smartcontractkit/push-gha-metrics-action@d9da21a2747016b3e13de58c7d4115a3d5c97935 # v3.0.1 - with: - id: lint-gh-workflows - org-id: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} - basic-auth: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} - hostname: ${{ secrets.GRAFANA_INTERNAL_HOST }} - this-job-name: Validate Workflow Changes - continue-on-error: true diff --git a/.github/workflows/goreleaser-build-publish-develop.yml b/.github/workflows/goreleaser-build-publish-develop.yml deleted file mode 100644 index 835d650f181..00000000000 --- a/.github/workflows/goreleaser-build-publish-develop.yml +++ /dev/null @@ -1,52 +0,0 @@ -name: "Build publish Chainlink develop on private ECR" - -on: - push: - branches: - - develop - -jobs: - push-chainlink-develop-goreleaser: - runs-on: - labels: ubuntu22.04-16cores-64GB - outputs: - goreleaser-metadata: ${{ steps.build-sign-publish.outputs.goreleaser-metadata }} - goreleaser-artifacts: ${{ steps.build-sign-publish.outputs.goreleaser-artifacts }} - environment: build-develop - permissions: - id-token: write - contents: read - steps: - - name: Checkout repository - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 - - name: Configure aws credentials - uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2 - with: - role-to-assume: ${{ secrets.AWS_OIDC_IAM_ROLE_ARN }} - role-duration-seconds: ${{ secrets.AWS_ROLE_DURATION_SECONDS }} - aws-region: ${{ secrets.AWS_REGION }} - mask-aws-account-id: true - role-session-name: goreleaser-build-publish-chainlink.push-develop - - name: Build, sign, and publish image - id: build-sign-publish - uses: ./.github/actions/goreleaser-build-sign-publish - with: - enable-docker-publish: "true" - docker-registry: ${{ secrets.AWS_DEVELOP_ECR_HOSTNAME }} - enable-goreleaser-snapshot: "true" - goreleaser-exec: ./tools/bin/goreleaser_wrapper - goreleaser-config: .goreleaser.develop.yaml - goreleaser-key: ${{ secrets.GORELEASER_KEY }} - zig-version: 0.11.0 - - name: Collect Metrics - if: always() - id: collect-gha-metrics - uses: smartcontractkit/push-gha-metrics-action@d9da21a2747016b3e13de58c7d4115a3d5c97935 # v3.0.1 - with: - id: goreleaser-build-publish - org-id: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} - basic-auth: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} - hostname: ${{ secrets.GRAFANA_INTERNAL_HOST }} - this-job-name: push-chainlink-develop-goreleaser - continue-on-error: true - \ No newline at end of file diff --git a/.github/workflows/integration-chaos-tests.yml b/.github/workflows/integration-chaos-tests.yml index f4160de2b0e..dcfbca661a9 100644 --- a/.github/workflows/integration-chaos-tests.yml +++ b/.github/workflows/integration-chaos-tests.yml @@ -7,148 +7,33 @@ on: - "*" workflow_dispatch: -env: - CHAINLINK_IMAGE: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/chainlink - ENV_JOB_IMAGE: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/chainlink-tests:${{ github.sha }} - TEST_SUITE: chaos - TEST_ARGS: -test.timeout 1h - CHAINLINK_COMMIT_SHA: ${{ github.sha }} - CHAINLINK_ENV_USER: ${{ github.actor }} - TEST_LOG_LEVEL: debug - jobs: - build-chainlink: - environment: integration - permissions: - id-token: write - contents: read - name: Build Chainlink Image - runs-on: ubuntu-latest - steps: - - name: Checkout the repo - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 - - name: Check if image exists - id: check-image - uses: smartcontractkit/chainlink-github-actions/docker/image-exists@75a9005952a9e905649cfb5a6971fd9429436acd # v2.3.25 - with: - repository: chainlink - tag: ${{ github.sha }} - AWS_REGION: ${{ secrets.QA_AWS_REGION }} - AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} - - name: Build Image - if: steps.check-image.outputs.exists == 'false' - uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/build-image@75a9005952a9e905649cfb5a6971fd9429436acd # v2.3.25 - with: - cl_repo: smartcontractkit/chainlink - cl_ref: ${{ github.sha }} - push_tag: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/chainlink:${{ github.sha }} - QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} - QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} - - name: Print Chainlink Image Built - id: push - run: | - echo "### chainlink node image tag used for this test run :link:" >>$GITHUB_STEP_SUMMARY - echo "\`${GITHUB_SHA}\`" >>$GITHUB_STEP_SUMMARY - - name: Collect Metrics - if: always() - id: collect-gha-metrics - uses: smartcontractkit/push-gha-metrics-action@d9da21a2747016b3e13de58c7d4115a3d5c97935 # v3.0.1 - with: - id: e2e-chaos-build-chainlink - org-id: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} - basic-auth: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} - hostname: ${{ secrets.GRAFANA_INTERNAL_HOST }} - this-job-name: Build Chainlink Image - continue-on-error: true - - build-test-runner: - environment: integration - permissions: - id-token: write - contents: read - name: Build Test Runner Image - runs-on: ubuntu-latest - steps: - - name: Checkout the repo - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 - - name: Build Test Image - uses: ./.github/actions/build-test-image - with: - QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} - QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} - QA_AWS_ACCOUNT_NUMBER: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }} - - name: Collect Metrics - if: always() - id: collect-gha-metrics - uses: smartcontractkit/push-gha-metrics-action@d9da21a2747016b3e13de58c7d4115a3d5c97935 # v3.0.1 - with: - id: e2e-chaos-build-test-image - org-id: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} - basic-auth: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} - hostname: ${{ secrets.GRAFANA_INTERNAL_HOST }} - this-job-name: Build Test Runner Image - continue-on-error: true - - chaos-tests: - environment: integration - permissions: - checks: write - pull-requests: write - id-token: write - contents: read - name: EVM Pods Chaos Tests - runs-on: ubuntu-latest - needs: [build-test-runner, build-chainlink] - steps: - - name: Collect Metrics - id: collect-gha-metrics - uses: smartcontractkit/push-gha-metrics-action@d9da21a2747016b3e13de58c7d4115a3d5c97935 # v3.0.1 - with: - id: e2e-chaos-tests - org-id: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} - basic-auth: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} - hostname: ${{ secrets.GRAFANA_INTERNAL_HOST }} - this-job-name: EVM Pods Chaos Tests - test-results-file: '{"testType":"go","filePath":"/tmp/gotest.log"}' - continue-on-error: true - - name: Checkout the repo - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 - - name: Prepare Base64 TOML config - env: - CHAINLINK_VERSION: ${{ github.sha }} - run: | - echo ::add-mask::$CHAINLINK_IMAGE - - cat << EOF > config.toml - [Network] - selected_networks=["SIMULATED"] - - [ChainlinkImage] - image="$CHAINLINK_IMAGE" - version="$CHAINLINK_VERSION" - EOF - - BASE64_CONFIG_OVERRIDE=$(cat config.toml | base64 -w 0) - echo ::add-mask::$BASE64_CONFIG_OVERRIDE - echo "BASE64_CONFIG_OVERRIDE=$BASE64_CONFIG_OVERRIDE" >> $GITHUB_ENV - - name: Run Tests - uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests@75a9005952a9e905649cfb5a6971fd9429436acd # v2.3.25 - with: - test_command_to_run: cd integration-tests && go test -timeout 1h -count=1 -json -test.parallel 11 ./chaos 2>&1 | tee /tmp/gotest.log | gotestloghelper -ci -singlepackage -hidepassingtests=false -hidepassinglogs - test_download_vendor_packages_command: cd ./integration-tests && go mod download - cl_repo: ${{ env.CHAINLINK_IMAGE }} - cl_image_tag: ${{ github.sha }} - artifacts_location: ./integration-tests/chaos/logs - publish_check_name: EVM Pods Chaos Test Results - token: ${{ secrets.GITHUB_TOKEN }} - go_mod_path: ./integration-tests/go.mod - QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} - QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} - QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }} - - name: Upload test log - uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 - if: failure() - with: - name: Test Results Log - path: /tmp/gotest.log - retention-days: 7 + run-e2e-tests-workflow: + name: Run E2E Tests + uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@827d85b57065211ddd254457a7cf21581d85092d + with: + test_path: .github/e2e-tests.yml + chainlink_version: ${{ github.sha }} + require_chainlink_image_versions_in_qa_ecr: ${{ github.sha }} + test_trigger: E2E Chaos Tests + test_log_level: debug + secrets: + QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} + QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} + QA_AWS_ACCOUNT_NUMBER: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }} + PROD_AWS_ACCOUNT_NUMBER: ${{ secrets.AWS_ACCOUNT_ID_PROD }} + QA_PYROSCOPE_INSTANCE: ${{ secrets.QA_PYROSCOPE_INSTANCE }} + QA_PYROSCOPE_KEY: ${{ secrets.QA_PYROSCOPE_KEY }} + QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }} + GRAFANA_INTERNAL_TENANT_ID: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} + GRAFANA_INTERNAL_BASIC_AUTH: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} + GRAFANA_INTERNAL_HOST: ${{ secrets.GRAFANA_INTERNAL_HOST }} + GRAFANA_INTERNAL_URL_SHORTENER_TOKEN: ${{ secrets.GRAFANA_INTERNAL_URL_SHORTENER_TOKEN }} + LOKI_TENANT_ID: ${{ secrets.LOKI_TENANT_ID }} + LOKI_URL: https://${{ secrets.GRAFANA_INTERNAL_HOST }}/loki/api/v1/push + LOKI_BASIC_AUTH: ${{ secrets.LOKI_BASIC_AUTH }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + AWS_REGION: ${{ secrets.QA_AWS_REGION }} + AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN: ${{ secrets.AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN }} + AWS_API_GW_HOST_GRAFANA: ${{ secrets.AWS_API_GW_HOST_GRAFANA }} + SLACK_BOT_TOKEN: ${{ secrets.QA_SLACK_API_KEY }} diff --git a/.github/workflows/integration-staging-tests.yml b/.github/workflows/integration-staging-tests.yml deleted file mode 100644 index d092b2bca1c..00000000000 --- a/.github/workflows/integration-staging-tests.yml +++ /dev/null @@ -1,132 +0,0 @@ -# NEEDS ADJUSTING TO TOML CONFIG BEFORE USING!! -name: E2E Functions staging tests - -on: -# TODO: enable when env will be stable -# schedule: -# - cron: "0 0 * * *" - workflow_dispatch: - inputs: - network: - description: Blockchain network (testnet) - type: choice - default: "MUMBAI" - options: - - "MUMBAI" - test_type: - description: Test type - type: choice - default: "mumbai_functions_soak_test_real" - options: - - "mumbai_functions_soak_test_http" - - "mumbai_functions_stress_test_http" - - "mumbai_functions_soak_test_only_secrets" - - "mumbai_functions_stress_test_only_secrets" - - "mumbai_functions_soak_test_real" - - "mumbai_functions_stress_test_real" -# TODO: disabled, need GATI access -# - "gateway_secrets_set_soak_test" -# - "gateway_secrets_list_soak_test" - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - e2e-soak-test: - environment: sdlc - runs-on: ubuntu22.04-8cores-32GB - permissions: - contents: read - id-token: write - env: - LOKI_URL: ${{ secrets.LOKI_URL }} - LOKI_TOKEN: ${{ secrets.LOKI_TOKEN }} - SELECTED_NETWORKS: ${{ inputs.network }} - SELECTED_TEST: ${{ inputs.test_type }} - MUMBAI_URLS: ${{ secrets.FUNCTIONS_STAGING_MUMBAI_URLS }} - MUMBAI_KEYS: ${{ secrets.FUNCTIONS_STAGING_MUMBAI_KEYS }} - WASP_LOG_LEVEL: info - steps: - - name: Checkout code - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 - with: - fetch-depth: 0 - - name: Prepare Base64 TOML override - env: - PYROSCOPE_SERVER: ${{ secrets.QA_PYROSCOPE_INSTANCE }} - PYROSCOPE_ENVIRONMENT: ci-smoke-${{ matrix.product }}-sepolia - PYROSCOPE_KEY: ${{ secrets.QA_PYROSCOPE_KEY }} - run: | - convert_to_toml_array() { - local IFS=',' - local input_array=($1) - local toml_array_format="[" - - for element in "${input_array[@]}"; do - toml_array_format+="\"$element\"," - done - - toml_array_format="${toml_array_format%,}]" - echo "$toml_array_format" - } - - if [ -n "$PYROSCOPE_SERVER" ]; then - pyroscope_enabled=true - else - pyroscope_enabled=false - fi - - cat << EOF > config.toml - [Common] - chainlink_node_funding=0.5 - - [ChainlinkImage] - image="$CHAINLINK_IMAGE" - version="${{ github.sha }}" - - [Pyroscope] - enabled=$pyroscope_enabled - server_url="$PYROSCOPE_SERVER" - environment="$PYROSCOPE_ENVIRONMENT" - key_secret="$PYROSCOPE_KEY" - - [Logging] - run_id="$RUN_ID" - - [Logging.LogStream] - log_targets=$log_targets - - [Logging.Loki] - tenant_id="$LOKI_TENANT_ID" - endpoint="$LOKI_URL" - basic_auth_secret="$LOKI_BASIC_AUTH" - - [Logging.Grafana] - base_url="$GRAFANA_URL" - dashboard_url="/d/ddf75041-1e39-42af-aa46-361fe4c36e9e/ci-e2e-tests-logs" - - [Network] - selected_networks=["sepolia"] - - [Network.RpcHttpUrls] - sepolia = $(convert_to_toml_array "$SEPOLIA_HTTP_URLS") - - [Network.RpcWsUrls] - sepolia = $(convert_to_toml_array "$SEPOLIA_URLS") - - [Network.WalletKeys] - sepolia = $(convert_to_toml_array "$EVM_KEYS") - EOF - - BASE64_CONFIG_OVERRIDE=$(cat config.toml | base64 -w 0) - echo ::add-mask::$BASE64_CONFIG_OVERRIDE - echo "BASE64_CONFIG_OVERRIDE=$BASE64_CONFIG_OVERRIDE" >> $GITHUB_ENV - - name: Run E2E soak tests - run: | - cd integration-tests/load/functions - if [[ $SELECTED_TEST == mumbai_functions* ]]; then - go test -v -timeout 6h -run TestFunctionsLoad/$SELECTED_TEST - elif [[ $SELECTED_TEST == gateway* ]]; then - go test -v -timeout 6h -run TestGatewayLoad/$SELECTED_TEST - fi \ No newline at end of file diff --git a/.github/workflows/integration-tests-publish.yml b/.github/workflows/integration-tests-publish.yml index 76a86c43238..b74902cdc43 100644 --- a/.github/workflows/integration-tests-publish.yml +++ b/.github/workflows/integration-tests-publish.yml @@ -40,7 +40,7 @@ jobs: run: | echo "other_tags=${ECR_TAG}" >> $GITHUB_OUTPUT - name: Build Image - uses: ./.github/actions/build-test-image + uses: smartcontractkit/.github/actions/ctf-build-test-image@a5e4f4c8fbb8e15ab2ad131552eca6ac83c4f4b3 # ctf-build-test-image@0.1.0 with: other_tags: ${{ steps.tags.outputs.other_tags }} QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} @@ -54,7 +54,7 @@ jobs: SLACK_BOT_TOKEN: ${{ secrets.QA_SLACK_API_KEY }} with: channel-id: "#team-test-tooling-internal" - slack-message: ":x: :mild-panic-intensifies: Publish Integration Test Image failed: \n${{ format('https://github.com/{0}/actions/runs/{1}', github.repository, github.run_id) }}" + slack-message: ":x: :mild-panic-intensifies: Publish Integration Test Image failed: \n${{ format('https://github.com/{0}/actions/runs/{1}', github.repository, github.run_id) }}\nRepository: Chainlink\n${{ format('Notifying ', secrets.GUARDIAN_SLACK_NOTIFICATION_HANDLE)}}" build-chainlink-image: environment: integration # Only run this build for workflow_dispatch diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index 736d4301775..1933ec520fb 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -71,10 +71,10 @@ jobs: echo "should-enforce=$SHOULD_ENFORCE" >> $GITHUB_OUTPUT - name: Enforce CTF Version if: steps.condition-check.outputs.should-enforce == 'true' - uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/mod-version@fc3e0df622521019f50d772726d6bf8dc919dd38 # v2.3.19 + uses: smartcontractkit/.github/actions/ctf-check-mod-version@21b0189c5fdca0318617d259634b1a91e6d80262 # ctf-check-mod-version@0.0.0 with: go-project-path: ./integration-tests - module-name: github.com/smartcontractkit/chainlink-testing-framework + module-name: github.com/smartcontractkit/chainlink-testing-framework/lib enforce-semantic-tag: "true" changes: environment: integration @@ -92,15 +92,21 @@ jobs: id: changes with: filters: | - changes: + github_ci_changes: + - '.github/workflows/integration-tests.yml' + - '.github/workflows/run-e2e-tests-reusable-workflow.yml' + - '.github/e2e-tests.yml' + core_changes: - '**/*.go' - '**/*go.sum' - '**/*go.mod' - - '.github/workflows/integration-tests.yml' - '**/*Dockerfile' - 'core/**/migrations/*.sql' - 'core/**/config/**/*.toml' - 'integration-tests/**/*.toml' + ccip_changes: + - '**/*ccip*' + - '**/*ccip*/**' - name: Ignore Filter On Workflow Dispatch if: ${{ github.event_name == 'workflow_dispatch' }} id: ignore-filter @@ -117,24 +123,26 @@ jobs: this-job-name: Check Paths That Require Tests To Run continue-on-error: true outputs: - src: ${{ steps.ignore-filter.outputs.changes || steps.changes.outputs.changes }} + github_ci_changes: ${{ steps.ignore-filter.outputs.changes || steps.changes.outputs.github_ci_changes }} + core_changes: ${{ steps.ignore-filter.outputs.changes || steps.changes.outputs.core_changes }} + ccip_changes: ${{ steps.ignore-filter.outputs.changes || steps.changes.outputs.ccip_changes }} - build-lint-integration-tests: - name: Build and Lint ${{ matrix.project.name }} - runs-on: ubuntu22.04-16cores-64GB + lint-integration-tests: + name: Lint ${{ matrix.project.name }} + runs-on: ubuntu-24.04-8cores-32GB-ARM # We don't directly merge dependabot PRs, so let's not waste the resources if: github.actor != 'dependabot[bot]' strategy: matrix: project: - name: integration-tests - id: e2e + id: e2e-tests path: ./integration-tests - cache-id: e2e + cache_id: e2e-tests - name: load id: load path: ./integration-tests/load - cache-id: load + cache_id: load steps: - name: Collect Metrics id: collect-gha-metrics @@ -144,7 +152,7 @@ jobs: org-id: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} basic-auth: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} hostname: ${{ secrets.GRAFANA_INTERNAL_HOST }} - this-job-name: Build and Lint ${{ matrix.project.name }} + this-job-name: Lint ${{ matrix.project.name }} continue-on-error: true - name: Checkout the repo uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 @@ -152,17 +160,12 @@ jobs: repository: smartcontractkit/chainlink ref: ${{ inputs.cl_ref }} - name: Setup Go - uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/setup-go@75a9005952a9e905649cfb5a6971fd9429436acd # v2.3.25 + uses: smartcontractkit/.github/actions/ctf-setup-go@b0d756c57fcdbcff187e74166562a029fdd5d1b9 # ctf-setup-go@0.0.0 with: test_download_vendor_packages_command: cd ${{ matrix.project.path }} && go mod download go_mod_path: ${{ matrix.project.path }}/go.mod - cache_key_id: core-${{ matrix.project.cache-id }}-${{ env.MOD_CACHE_VERSION }} + cache_key_id: ${{ matrix.project.cache_id }} cache_restore_only: "true" - - name: Build Go - run: | - cd ${{ matrix.project.path }} - go build ./... - go test -run=^# ./... - name: Lint Go uses: golangci/golangci-lint-action@3cfe3a4abbb849e10058ce4af15d205b6da42804 # v4.0.0 with: @@ -190,11 +193,11 @@ jobs: dockerfile: plugins/chainlink.Dockerfile tag-suffix: -plugins name: Build Chainlink Image ${{ matrix.image.name }} - runs-on: ubuntu22.04-16cores-64GB + runs-on: ubuntu22.04-8cores-32GB needs: [changes, enforce-ctf-version] steps: - name: Collect Metrics - if: needs.changes.outputs.src == 'true' || github.event_name == 'workflow_dispatch' + if: needs.changes.outputs.core_changes == 'true' || needs.changes.outputs.github_ci_changes == 'true' || github.event_name == 'workflow_dispatch' id: collect-gha-metrics uses: smartcontractkit/push-gha-metrics-action@d9da21a2747016b3e13de58c7d4115a3d5c97935 # v3.0.1 with: @@ -219,7 +222,7 @@ jobs: aws-region: ${{ secrets.AWS_REGION }} set-git-config: "true" - name: Build Chainlink Image - if: needs.changes.outputs.src == 'true' || github.event_name == 'workflow_dispatch' + if: needs.changes.outputs.core_changes == 'true' || needs.changes.outputs.github_ci_changes == 'true' || github.event_name == 'workflow_dispatch' uses: ./.github/actions/build-chainlink-image with: tag_suffix: ${{ matrix.image.tag-suffix }} @@ -229,601 +232,226 @@ jobs: AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} dep_evm_sha: ${{ inputs.evm-ref }} - compare-tests: - needs: [changes] - runs-on: ubuntu-latest - name: Compare/Build Automation Test List - outputs: - automation-matrix: ${{ env.AUTOMATION_JOB_MATRIX_JSON }} - lp-matrix: ${{ env.LP_JOB_MATRIX_JSON }} - steps: - - name: Check for Skip Tests Label - if: contains(join(github.event.pull_request.labels.*.name, ' '), 'skip-smoke-tests') - run: | - echo "## \`skip-smoke-tests\` label is active, skipping E2E smoke tests" >>$GITHUB_STEP_SUMMARY - exit 0 - - name: Checkout the repo - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 - with: - repository: smartcontractkit/chainlink - ref: ${{ inputs.cl_ref }} - - name: Compare Test Lists - run: | - cd ./integration-tests - ./scripts/compareTestList.sh ./smoke/automation_test.go - ./scripts/compareTestList.sh ./smoke/keeper_test.go - ./scripts/compareTestList.sh ./smoke/log_poller_test.go - - name: Build Test Matrix Lists - id: build-test-matrix-list - run: | - cd ./integration-tests - MATRIX_JSON_AUTOMATION=$(./scripts/buildTestMatrixList.sh ./smoke/automation_test.go automation ubuntu-latest 1) - MATRIX_JSON_KEEPER=$(./scripts/buildTestMatrixList.sh ./smoke/keeper_test.go keeper ubuntu-latest 1) - COMBINED_ARRAY=$(jq -c -n "$MATRIX_JSON_AUTOMATION + $MATRIX_JSON_KEEPER") - echo "combined array = ${COMBINED_ARRAY}" - echo "event name = $GITHUB_EVENT_NAME" - - LOG_POLLER_MATRIX_JSON=$(./scripts/buildTestMatrixList.sh ./smoke/log_poller_test.go log_poller ubuntu-latest 1) - echo "LP_JOB_MATRIX_JSON=${LOG_POLLER_MATRIX_JSON}" >> $GITHUB_ENV - - # if we running a PR against the develop branch we should only run the automation tests unless we are in the merge group event - if [[ "$GITHUB_EVENT_NAME" == "merge_group" ]]; then - echo "We are in a merge_group event, run both automation and keepers tests" - echo "AUTOMATION_JOB_MATRIX_JSON=${COMBINED_ARRAY}" >> $GITHUB_ENV - else - echo "we are not in a merge_group event, if this is a PR to develop run only automation tests, otherwise run everything because we could be running against a release branch" - target_branch=$(cat $GITHUB_EVENT_PATH | jq -r .pull_request.base.ref) - if [[ "$target_branch" == "develop" ]]; then - echo "only run automation tests" - echo "AUTOMATION_JOB_MATRIX_JSON=${MATRIX_JSON_AUTOMATION}" >> $GITHUB_ENV - else - echo "run both automation and keepers tests" - echo "AUTOMATION_JOB_MATRIX_JSON=${COMBINED_ARRAY}" >> $GITHUB_ENV - fi - fi - - eth-smoke-tests-matrix-automation: - if: ${{ !contains(join(github.event.pull_request.labels.*.name, ' '), 'skip-smoke-tests') }} - environment: integration + run-core-e2e-tests-for-pr: + name: Run Core E2E Tests For PR permissions: + actions: read checks: write pull-requests: write id-token: write contents: read - needs: - [build-chainlink, changes, compare-tests, build-lint-integration-tests] - env: - SELECTED_NETWORKS: SIMULATED,SIMULATED_1,SIMULATED_2 - CHAINLINK_COMMIT_SHA: ${{ inputs.evm-ref || github.sha }} - CHAINLINK_ENV_USER: ${{ github.actor }} - TEST_LOG_LEVEL: debug - strategy: - fail-fast: false - matrix: - product: ${{fromJson(needs.compare-tests.outputs.automation-matrix)}} - runs-on: ${{ matrix.product.os }} - name: ETH Smoke Tests ${{ matrix.product.name }} - steps: - - name: Collect Metrics - if: needs.changes.outputs.src == 'true' || github.event_name == 'workflow_dispatch' - id: collect-gha-metrics - uses: smartcontractkit/push-gha-metrics-action@d9da21a2747016b3e13de58c7d4115a3d5c97935 # v3.0.1 - with: - id: ${{ env.COLLECTION_ID }}-matrix-${{ matrix.product.name }} - basic-auth: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} - hostname: ${{ secrets.GRAFANA_INTERNAL_HOST }} - org-id: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} - this-job-name: ETH Smoke Tests ${{ matrix.product.name }} - test-results-file: '{"testType":"go","filePath":"/tmp/gotest.log"}' - continue-on-error: true - - name: Checkout the repo - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 - with: - repository: smartcontractkit/chainlink - ref: ${{ inputs.cl_ref || github.event.pull_request.head.sha || github.event.merge_group.head_sha }} - - name: Build Go Test Command - id: build-go-test-command - run: | - # if the matrix.product.run is set, use it for a different command - if [ "${{ matrix.product.run }}" != "" ]; then - echo "run_command=${{ matrix.product.run }} ./smoke/${{ matrix.product.file }}_test.go" >> "$GITHUB_OUTPUT" - else - echo "run_command=./smoke/${{ matrix.product.name }}_test.go" >> "$GITHUB_OUTPUT" - fi - - name: Setup GAP for Grafana - uses: smartcontractkit/.github/actions/setup-gap@d316f66b2990ea4daa479daa3de6fc92b00f863e # setup-gap@0.3.2 - id: setup-gap - with: - # aws inputs - aws-region: ${{ secrets.AWS_REGION }} - aws-role-arn: ${{ secrets.AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN }} - api-gateway-host: ${{ secrets.AWS_API_GW_HOST_GRAFANA }} - # other inputs - duplicate-authorization-header: "true" - - name: Prepare Base64 TOML override - uses: ./.github/actions/setup-create-base64-config - with: - runId: ${{ github.run_id }} - testLogCollect: ${{ vars.TEST_LOG_COLLECT }} - selectedNetworks: ${{ env.SELECTED_NETWORKS }} - chainlinkVersion: ${{ inputs.evm-ref || github.sha }} - logstreamLogTargets: ${{ vars.LOGSTREAM_LOG_TARGETS }} - - ## Run this step when changes that require tests to be run are made - - name: Run Tests - if: needs.changes.outputs.src == 'true' || github.event_name == 'workflow_dispatch' - uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests@75a9005952a9e905649cfb5a6971fd9429436acd # v2.3.25 - with: - test_command_to_run: cd ./integration-tests && go test -timeout 30m -count=1 -json -test.parallel=${{ matrix.product.nodes }} ${{ steps.build-go-test-command.outputs.run_command }} 2>&1 | tee /tmp/gotest.log | gotestloghelper -ci -singlepackage -hidepassingtests=false -hidepassinglogs - test_download_vendor_packages_command: cd ./integration-tests && go mod download - test_config_override_base64: ${{ env.BASE64_CONFIG_OVERRIDE }} - cl_repo: ${{ env.CHAINLINK_IMAGE }} - cl_image_tag: ${{ inputs.evm-ref || github.sha }} - aws_registries: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }} - artifacts_name: ${{ matrix.product.name }}-test-logs - artifacts_location: | - ./integration-tests/smoke/logs/ - /tmp/gotest.log - publish_check_name: ${{ matrix.product.name }} - token: ${{ secrets.GITHUB_TOKEN }} - go_mod_path: ./integration-tests/go.mod - cache_key_id: core-e2e-${{ env.MOD_CACHE_VERSION }} - cache_restore_only: "true" - QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} - QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} - QA_KUBECONFIG: "" - should_tidy: "false" - go_coverage_src_dir: /var/tmp/go-coverage - go_coverage_dest_dir: ${{ github.workspace }}/.covdata - DEFAULT_CHAINLINK_IMAGE: ${{ env.CHAINLINK_IMAGE }} - DEFAULT_LOKI_TENANT_ID: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} - DEFAULT_LOKI_ENDPOINT: https://${{ secrets.GRAFANA_INTERNAL_HOST }}/loki/api/v1/push - DEFAULT_LOKI_BASIC_AUTH: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} - DEFAULT_GRAFANA_BASE_URL: "http://localhost:8080/primary" - DEFAULT_GRAFANA_DASHBOARD_URL: "/d/ddf75041-1e39-42af-aa46-361fe4c36e9e/ci-e2e-tests-logs" - DEFAULT_GRAFANA_BEARER_TOKEN: ${{ secrets.GRAFANA_INTERNAL_URL_SHORTENER_TOKEN }} - DEFAULT_PYROSCOPE_SERVER_URL: ${{ matrix.product.pyroscope_env == '' && '' || !startsWith(github.ref, 'refs/tags/') && '' || secrets.QA_PYROSCOPE_INSTANCE }} # Avoid sending blank envs https://github.com/orgs/community/discussions/25725 - DEFAULT_PYROSCOPE_KEY: ${{ secrets.QA_PYROSCOPE_KEY }} - DEFAULT_PYROSCOPE_ENVIRONMENT: ${{ matrix.product.pyroscope_env }} - DEFAULT_PYROSCOPE_ENABLED: ${{ matrix.product.pyroscope_env == '' || !startsWith(github.ref, 'refs/tags/') && 'false' || 'true' }} - - - name: Upload Coverage Data - uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3 - timeout-minutes: 2 - continue-on-error: true - with: - name: cl-node-coverage-data-${{ matrix.product.name }} - path: .covdata - retention-days: 1 - - - name: Print failed test summary - if: always() - uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/show-test-summary@75a9005952a9e905649cfb5a6971fd9429436acd # v2.3.25 - - eth-smoke-tests-matrix-log-poller: - if: ${{ !(contains(join(github.event.pull_request.labels.*.name, ' '), 'skip-smoke-tests') || github.event_name == 'workflow_dispatch') || inputs.distinct_run_name != '' }} - environment: integration + needs: [build-chainlink, changes] + if: github.event_name == 'pull_request' && ( needs.changes.outputs.core_changes == 'true' || needs.changes.outputs.github_ci_changes == 'true') + uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@827d85b57065211ddd254457a7cf21581d85092d + with: + workflow_name: Run Core E2E Tests For PR + chainlink_version: ${{ inputs.evm-ref || github.sha }} + chainlink_upgrade_version: ${{ github.sha }} + test_path: .github/e2e-tests.yml + test_trigger: PR E2E Core Tests + upload_cl_node_coverage_artifact: true + upload_cl_node_coverage_artifact_prefix: cl_node_coverage_data_ + enable_otel_traces_for_ocr2_plugins: ${{ contains(join(github.event.pull_request.labels.*.name, ' '), 'enable tracing') }} + secrets: + QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} + QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} + QA_AWS_ACCOUNT_NUMBER: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }} + PROD_AWS_ACCOUNT_NUMBER: ${{ secrets.AWS_ACCOUNT_ID_PROD }} + QA_PYROSCOPE_INSTANCE: ${{ secrets.QA_PYROSCOPE_INSTANCE }} + QA_PYROSCOPE_KEY: ${{ secrets.QA_PYROSCOPE_KEY }} + QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }} + GRAFANA_INTERNAL_TENANT_ID: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} + GRAFANA_INTERNAL_BASIC_AUTH: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} + GRAFANA_INTERNAL_HOST: ${{ secrets.GRAFANA_INTERNAL_HOST }} + GRAFANA_INTERNAL_URL_SHORTENER_TOKEN: ${{ secrets.GRAFANA_INTERNAL_URL_SHORTENER_TOKEN }} + LOKI_TENANT_ID: ${{ secrets.LOKI_TENANT_ID }} + LOKI_URL: https://${{ secrets.GRAFANA_INTERNAL_HOST }}/loki/api/v1/push + LOKI_BASIC_AUTH: ${{ secrets.LOKI_BASIC_AUTH }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + AWS_REGION: ${{ secrets.QA_AWS_REGION }} + AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN: ${{ secrets.AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN }} + AWS_API_GW_HOST_GRAFANA: ${{ secrets.AWS_API_GW_HOST_GRAFANA }} + SLACK_BOT_TOKEN: ${{ secrets.QA_SLACK_API_KEY }} + + run-core-e2e-tests-for-merge-queue: + name: Run Core E2E Tests For Merge Queue permissions: + actions: read checks: write pull-requests: write id-token: write contents: read - needs: - [build-chainlink, changes, compare-tests, build-lint-integration-tests] - env: - SELECTED_NETWORKS: SIMULATED,SIMULATED_1,SIMULATED_2 - CHAINLINK_COMMIT_SHA: ${{ inputs.evm-ref || github.sha }} - CHAINLINK_ENV_USER: ${{ github.actor }} - TEST_LOG_LEVEL: debug - strategy: - fail-fast: false - matrix: - product: ${{fromJson(needs.compare-tests.outputs.lp-matrix)}} - runs-on: ${{ matrix.product.os }} - name: ETH Smoke Tests ${{ matrix.product.name }} - steps: - - name: Collect Metrics - if: needs.changes.outputs.src == 'true' - id: collect-gha-metrics - uses: smartcontractkit/push-gha-metrics-action@d9da21a2747016b3e13de58c7d4115a3d5c97935 # v3.0.1 - with: - id: ${{ env.COLLECTION_ID }}-matrix-${{ matrix.product.name }} - org-id: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} - basic-auth: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} - hostname: ${{ secrets.GRAFANA_INTERNAL_HOST }} - this-job-name: ETH Smoke Tests ${{ matrix.product.name }} - test-results-file: '{"testType":"go","filePath":"/tmp/gotest.log"}' - continue-on-error: true - - name: Checkout the repo - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 - with: - repository: smartcontractkit/chainlink - ref: ${{ inputs.cl_ref || github.event.pull_request.head.sha || github.event.merge_group.head_sha }} - - name: Build Go Test Command - id: build-go-test-command - run: | - # if the matrix.product.run is set, use it for a different command - if [ "${{ matrix.product.run }}" != "" ]; then - echo "run_command=${{ matrix.product.run }} ./smoke/${{ matrix.product.file }}_test.go" >> "$GITHUB_OUTPUT" - else - echo "run_command=./smoke/${{ matrix.product.name }}_test.go" >> "$GITHUB_OUTPUT" - fi - - name: Setup GAP for Grafana - uses: smartcontractkit/.github/actions/setup-gap@d316f66b2990ea4daa479daa3de6fc92b00f863e # setup-gap@0.3.2 - id: setup-gap - with: - # aws inputs - aws-region: ${{ secrets.AWS_REGION }} - aws-role-arn: ${{ secrets.AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN }} - api-gateway-host: ${{ secrets.AWS_API_GW_HOST_GRAFANA }} - # other inputs - duplicate-authorization-header: "true" - - name: Prepare Base64 TOML override - uses: ./.github/actions/setup-create-base64-config - with: - runId: ${{ github.run_id }} - testLogCollect: ${{ vars.TEST_LOG_COLLECT }} - selectedNetworks: ${{ env.SELECTED_NETWORKS }} - chainlinkVersion: ${{ inputs.evm-ref || github.sha }} - logstreamLogTargets: ${{ vars.LOGSTREAM_LOG_TARGETS }} - - ## Run this step when changes that require tests to be run are made - - name: Run Tests - if: needs.changes.outputs.src == 'true' - uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests@75a9005952a9e905649cfb5a6971fd9429436acd # v2.3.25 - with: - test_command_to_run: cd ./integration-tests && go test -timeout 30m -count=1 -json -test.parallel=${{ matrix.product.nodes }} ${{ steps.build-go-test-command.outputs.run_command }} 2>&1 | tee /tmp/gotest.log | gotestloghelper -ci -singlepackage -hidepassingtests=false -hidepassinglogs - test_download_vendor_packages_command: cd ./integration-tests && go mod download - test_config_override_base64: ${{ env.BASE64_CONFIG_OVERRIDE }} - cl_repo: ${{ env.CHAINLINK_IMAGE }} - cl_image_tag: ${{ inputs.evm-ref || github.sha }} - aws_registries: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }} - artifacts_name: ${{ matrix.product.name }}-test-logs - artifacts_location: | - ./integration-tests/smoke/logs/ - /tmp/gotest.log - publish_check_name: ${{ matrix.product.name }} - token: ${{ secrets.GITHUB_TOKEN }} - go_mod_path: ./integration-tests/go.mod - cache_key_id: core-e2e-${{ env.MOD_CACHE_VERSION }} - cache_restore_only: "true" - QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} - QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} - QA_KUBECONFIG: "" - should_tidy: "false" - go_coverage_src_dir: /var/tmp/go-coverage - go_coverage_dest_dir: ${{ github.workspace }}/.covdata - DEFAULT_CHAINLINK_IMAGE: ${{ env.CHAINLINK_IMAGE }} - DEFAULT_LOKI_TENANT_ID: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} - DEFAULT_LOKI_ENDPOINT: https://${{ secrets.GRAFANA_INTERNAL_HOST }}/loki/api/v1/push - DEFAULT_LOKI_BASIC_AUTH: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} - DEFAULT_GRAFANA_BASE_URL: "http://localhost:8080/primary" - DEFAULT_GRAFANA_DASHBOARD_URL: "/d/ddf75041-1e39-42af-aa46-361fe4c36e9e/ci-e2e-tests-logs" - DEFAULT_GRAFANA_BEARER_TOKEN: ${{ secrets.GRAFANA_INTERNAL_URL_SHORTENER_TOKEN }} - DEFAULT_PYROSCOPE_SERVER_URL: ${{ matrix.product.pyroscope_env == '' && '' || !startsWith(github.ref, 'refs/tags/') && '' || secrets.QA_PYROSCOPE_INSTANCE }} # Avoid sending blank envs https://github.com/orgs/community/discussions/25725 - DEFAULT_PYROSCOPE_KEY: ${{ secrets.QA_PYROSCOPE_KEY }} - DEFAULT_PYROSCOPE_ENVIRONMENT: ${{ matrix.product.pyroscope_env }} - DEFAULT_PYROSCOPE_ENABLED: ${{ matrix.product.pyroscope_env == '' || !startsWith(github.ref, 'refs/tags/') && 'false' || 'true' }} - - - name: Upload Coverage Data - uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3 - timeout-minutes: 2 - continue-on-error: true - with: - name: cl-node-coverage-data-${{ matrix.product.name }} - path: .covdata - retention-days: 1 - - - name: Print failed test summary - if: always() - uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/show-test-summary@75a9005952a9e905649cfb5a6971fd9429436acd # v2.3.25 - - - eth-smoke-tests-matrix: - if: ${{ !contains(join(github.event.pull_request.labels.*.name, ' '), 'skip-smoke-tests') }} - environment: integration + needs: [build-chainlink, changes] + if: github.event_name == 'merge_group' && ( needs.changes.outputs.core_changes == 'true' || needs.changes.outputs.github_ci_changes == 'true') + uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@827d85b57065211ddd254457a7cf21581d85092d + with: + workflow_name: Run Core E2E Tests For Merge Queue + chainlink_version: ${{ inputs.evm-ref || github.sha }} + chainlink_upgrade_version: ${{ github.sha }} + test_path: .github/e2e-tests.yml + test_trigger: Merge Queue E2E Core Tests + upload_cl_node_coverage_artifact: true + upload_cl_node_coverage_artifact_prefix: cl_node_coverage_data_ + enable_otel_traces_for_ocr2_plugins: ${{ contains(join(github.event.pull_request.labels.*.name, ' '), 'enable tracing') }} + # Notify Test Tooling team in slack when merge queue tests fail + slack_notification_after_tests: on_failure + slack_notification_after_tests_channel_id: "#team-test-tooling-internal" + slack_notification_after_tests_name: Core E2E Tests In Merge Queue + secrets: + QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} + QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} + QA_AWS_ACCOUNT_NUMBER: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }} + PROD_AWS_ACCOUNT_NUMBER: ${{ secrets.AWS_ACCOUNT_ID_PROD }} + QA_PYROSCOPE_INSTANCE: ${{ secrets.QA_PYROSCOPE_INSTANCE }} + QA_PYROSCOPE_KEY: ${{ secrets.QA_PYROSCOPE_KEY }} + QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }} + GRAFANA_INTERNAL_TENANT_ID: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} + GRAFANA_INTERNAL_BASIC_AUTH: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} + GRAFANA_INTERNAL_HOST: ${{ secrets.GRAFANA_INTERNAL_HOST }} + GRAFANA_INTERNAL_URL_SHORTENER_TOKEN: ${{ secrets.GRAFANA_INTERNAL_URL_SHORTENER_TOKEN }} + LOKI_TENANT_ID: ${{ secrets.LOKI_TENANT_ID }} + LOKI_URL: https://${{ secrets.GRAFANA_INTERNAL_HOST }}/loki/api/v1/push + LOKI_BASIC_AUTH: ${{ secrets.LOKI_BASIC_AUTH }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + AWS_REGION: ${{ secrets.QA_AWS_REGION }} + AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN: ${{ secrets.AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN }} + AWS_API_GW_HOST_GRAFANA: ${{ secrets.AWS_API_GW_HOST_GRAFANA }} + SLACK_BOT_TOKEN: ${{ secrets.QA_SLACK_API_KEY }} + + run-ccip-e2e-tests-for-pr: + name: Run CCIP E2E Tests For PR permissions: actions: read checks: write pull-requests: write id-token: write contents: read - needs: [build-chainlink, changes, build-lint-integration-tests] - env: - SELECTED_NETWORKS: SIMULATED - CHAINLINK_COMMIT_SHA: ${{ inputs.evm-ref || github.sha }} - CHAINLINK_ENV_USER: ${{ github.actor }} - TEST_LOG_LEVEL: debug - strategy: - fail-fast: false - matrix: - product: - - name: runlog - id: runlog - nodes: 2 - os: ubuntu-latest - pyroscope_env: "ci-smoke-runlog-evm-simulated" - - name: cron - id: cron - nodes: 2 - os: ubuntu-latest - pyroscope_env: "ci-smoke-cron-evm-simulated" - - name: flux - id: flux - nodes: 1 - os: ubuntu-latest - pyroscope_env: "ci-smoke-flux-evm-simulated" - - name: ocr - id: ocr - nodes: 2 - os: ubuntu-latest - file: ocr - pyroscope_env: ci-smoke-ocr-evm-simulated - - name: reorg_above_finality - id: reorg_above_finality - nodes: 1 - os: ubuntu-latest - file: reorg_above_finality - pyroscope_env: ci-smoke-reorg-above-finality-evm-simulated - - name: ocr2 - id: ocr2 - nodes: 6 - os: ubuntu22.04-16cores-64GB - file: ocr2 - pyroscope_env: ci-smoke-ocr2-evm-simulated - - name: ocr2 - id: ocr2-plugins - nodes: 6 - os: ubuntu22.04-16cores-64GB - pyroscope_env: ci-smoke-ocr2-plugins-evm-simulated - tag_suffix: "-plugins" - - name: vrf - id: vrf - nodes: 2 - os: ubuntu-latest - pyroscope_env: ci-smoke-vrf-evm-simulated - - name: vrfv2 - id: vrfv2 - nodes: 6 - os: ubuntu-latest - pyroscope_env: ci-smoke-vrf2-evm-simulated - - name: vrfv2plus - id: vrfv2plus - nodes: 9 - os: ubuntu-latest - pyroscope_env: ci-smoke-vrf2plus-evm-simulated - - name: forwarder_ocr - id: forwarder_ocr - nodes: 2 - os: ubuntu-latest - pyroscope_env: ci-smoke-forwarder-ocr-evm-simulated - - name: forwarders_ocr2 - id: forwarders_ocr2 - nodes: 2 - os: ubuntu-latest - pyroscope_env: ci-smoke-forwarder-ocr-evm-simulated - runs-on: ${{ matrix.product.os }} - name: ETH Smoke Tests ${{ matrix.product.name }}${{ matrix.product.tag_suffix }} + needs: [build-chainlink, changes] + if: github.event_name == 'pull_request' && (needs.changes.outputs.ccip_changes == 'true' || needs.changes.outputs.github_ci_changes == 'true') + uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@827d85b57065211ddd254457a7cf21581d85092d + with: + workflow_name: Run CCIP E2E Tests For PR + chainlink_version: ${{ inputs.evm-ref || github.sha }} + chainlink_upgrade_version: ${{ github.sha }} + test_path: .github/e2e-tests.yml + test_trigger: PR E2E CCIP Tests + upload_cl_node_coverage_artifact: true + upload_cl_node_coverage_artifact_prefix: cl_node_coverage_data_ + enable_otel_traces_for_ocr2_plugins: ${{ contains(join(github.event.pull_request.labels.*.name, ' '), 'enable tracing') }} + secrets: + QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} + QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} + QA_AWS_ACCOUNT_NUMBER: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }} + PROD_AWS_ACCOUNT_NUMBER: ${{ secrets.AWS_ACCOUNT_ID_PROD }} + QA_PYROSCOPE_INSTANCE: ${{ secrets.QA_PYROSCOPE_INSTANCE }} + QA_PYROSCOPE_KEY: ${{ secrets.QA_PYROSCOPE_KEY }} + QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }} + GRAFANA_INTERNAL_TENANT_ID: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} + GRAFANA_INTERNAL_BASIC_AUTH: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} + GRAFANA_INTERNAL_HOST: ${{ secrets.GRAFANA_INTERNAL_HOST }} + GRAFANA_INTERNAL_URL_SHORTENER_TOKEN: ${{ secrets.GRAFANA_INTERNAL_URL_SHORTENER_TOKEN }} + LOKI_TENANT_ID: ${{ secrets.LOKI_TENANT_ID }} + LOKI_URL: https://${{ secrets.GRAFANA_INTERNAL_HOST }}/loki/api/v1/push + LOKI_BASIC_AUTH: ${{ secrets.LOKI_BASIC_AUTH }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + AWS_REGION: ${{ secrets.QA_AWS_REGION }} + AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN: ${{ secrets.AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN }} + AWS_API_GW_HOST_GRAFANA: ${{ secrets.AWS_API_GW_HOST_GRAFANA }} + SLACK_BOT_TOKEN: ${{ secrets.QA_SLACK_API_KEY }} + + run-ccip-e2e-tests-for-merge-queue: + name: Run CCIP E2E Tests For Merge Queue + permissions: + actions: read + checks: write + pull-requests: write + id-token: write + contents: read + needs: [build-chainlink, changes] + if: github.event_name == 'merge_group' && (needs.changes.outputs.ccip_changes == 'true' || needs.changes.outputs.github_ci_changes == 'true') + uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@827d85b57065211ddd254457a7cf21581d85092d + with: + workflow_name: Run CCIP E2E Tests For Merge Queue + chainlink_version: ${{ inputs.evm-ref || github.sha }} + chainlink_upgrade_version: ${{ github.sha }} + test_path: .github/e2e-tests.yml + test_trigger: Merge Queue E2E CCIP Tests + upload_cl_node_coverage_artifact: true + upload_cl_node_coverage_artifact_prefix: cl_node_coverage_data_ + enable_otel_traces_for_ocr2_plugins: ${{ contains(join(github.event.pull_request.labels.*.name, ' '), 'enable tracing') }} + secrets: + QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} + QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} + QA_AWS_ACCOUNT_NUMBER: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }} + PROD_AWS_ACCOUNT_NUMBER: ${{ secrets.AWS_ACCOUNT_ID_PROD }} + QA_PYROSCOPE_INSTANCE: ${{ secrets.QA_PYROSCOPE_INSTANCE }} + QA_PYROSCOPE_KEY: ${{ secrets.QA_PYROSCOPE_KEY }} + QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }} + GRAFANA_INTERNAL_TENANT_ID: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} + GRAFANA_INTERNAL_BASIC_AUTH: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} + GRAFANA_INTERNAL_HOST: ${{ secrets.GRAFANA_INTERNAL_HOST }} + GRAFANA_INTERNAL_URL_SHORTENER_TOKEN: ${{ secrets.GRAFANA_INTERNAL_URL_SHORTENER_TOKEN }} + LOKI_TENANT_ID: ${{ secrets.LOKI_TENANT_ID }} + LOKI_URL: https://${{ secrets.GRAFANA_INTERNAL_HOST }}/loki/api/v1/push + LOKI_BASIC_AUTH: ${{ secrets.LOKI_BASIC_AUTH }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + AWS_REGION: ${{ secrets.QA_AWS_REGION }} + AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN: ${{ secrets.AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN }} + AWS_API_GW_HOST_GRAFANA: ${{ secrets.AWS_API_GW_HOST_GRAFANA }} + SLACK_BOT_TOKEN: ${{ secrets.QA_SLACK_API_KEY }} + + check-e2e-test-results: + if: always() + name: ETH Smoke Tests + runs-on: ubuntu-latest + needs: [lint-integration-tests, run-core-e2e-tests-for-pr, run-ccip-e2e-tests-for-pr, run-core-e2e-tests-for-merge-queue, run-ccip-e2e-tests-for-merge-queue] steps: - # Handy for debugging resource usage - # - name: Collect Workflow Telemetry - # uses: catchpoint/workflow-telemetry-action@v2 - - name: Collect Metrics - if: needs.changes.outputs.src == 'true' || github.event_name == 'workflow_dispatch' - id: collect-gha-metrics - uses: smartcontractkit/push-gha-metrics-action@d9da21a2747016b3e13de58c7d4115a3d5c97935 # v3.0.1 - with: - id: ${{ env.COLLECTION_ID }}-matrix-${{ matrix.product.id }} - org-id: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} - basic-auth: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} - hostname: ${{ secrets.GRAFANA_INTERNAL_HOST }} - this-job-name: ETH Smoke Tests ${{ matrix.product.name }}${{ matrix.product.tag_suffix }} - test-results-file: '{"testType":"go","filePath":"/tmp/gotest.log"}' - continue-on-error: true - - name: Checkout the repo - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 - with: - repository: smartcontractkit/chainlink - ref: ${{ inputs.cl_ref || github.event.pull_request.head.sha || github.event.merge_group.head_sha }} - - name: Build Go Test Command - id: build-go-test-command + - name: Check Core test results + id: check_core_results run: | - # if the matrix.product.run is set, use it for a different command - if [ "${{ matrix.product.run }}" != "" ]; then - echo "run_command=${{ matrix.product.run }} ./smoke/${{ matrix.product.file }}_test.go" >> "$GITHUB_OUTPUT" - else - echo "run_command=./smoke/${{ matrix.product.name }}_test.go" >> "$GITHUB_OUTPUT" - fi - - name: Check for "enable tracing" label - id: check-label - run: | - label=$(jq -r '.pull_request.labels[]?.name // empty' "$GITHUB_EVENT_PATH") + results='${{ needs.run-core-e2e-tests-for-pr.outputs.test_results }}' + echo "Core test results:" + echo "$results" | jq . + + node_migration_tests_failed=$(echo $results | jq '[.[] | select(.id == "integration-tests/migration/upgrade_version_test.go:*" ) | select(.result != "success")] | length > 0') + echo "node_migration_tests_failed=$node_migration_tests_failed" >> $GITHUB_OUTPUT - if [[ -n "$label" ]]; then - if [[ "$label" == "enable tracing" ]]; then - echo "Enable tracing label found." - echo "trace=true" >> $GITHUB_OUTPUT - else - echo "Enable tracing label not found." - echo "trace=false" >> $GITHUB_OUTPUT - fi + - name: Check CCIP test results + id: check_ccip_results + run: | + if [[ '${{ needs.run-ccip-e2e-tests-for-pr.result }}' != 'skipped' ]]; then + results='${{ needs.run-ccip-e2e-tests-for-pr.outputs.test_results }}' + echo "CCIP test results:" + echo "$results" | jq . else - echo "No labels present or labels are null." - echo "trace=false" >> $GITHUB_OUTPUT + echo "CCIP tests were skipped." fi - - name: Setup Grafana and OpenTelemetry - id: docker-setup - if: steps.check-label.outputs.trace == 'true' && matrix.product.name == 'ocr2' && matrix.product.tag_suffix == '-plugins' - run: | - # Create network - docker network create --driver bridge tracing - - # Make trace directory - cd integration-tests/smoke/ - mkdir ./traces - chmod -R 777 ./traces - - # Switch directory - cd ../../.github/tracing - - # Create a Docker volume for traces - # docker volume create otel-traces - - # Start OpenTelemetry Collector - # Note the user must be set to the same user as the runner for the trace data to be accessible - docker run -d --network=tracing --name=otel-collector \ - -v $PWD/otel-collector-ci.yaml:/etc/otel-collector.yaml \ - -v $PWD/../../integration-tests/smoke/traces:/tracing \ - --user "$(id -u):$(id -g)" \ - -p 4317:4317 otel/opentelemetry-collector:0.88.0 --config=/etc/otel-collector.yaml - - - name: Locate Docker Volume - id: locate-volume - if: false - run: | - echo "VOLUME_PATH=$(docker volume inspect --format '{{ .Mountpoint }}' otel-traces)" >> $GITHUB_OUTPUT - - - name: Show Otel-Collector Logs - if: steps.check-label.outputs.trace == 'true' && matrix.product.name == 'ocr2' && matrix.product.tag_suffix == '-plugins' - run: | - docker logs otel-collector - - - name: Setup GAP for Grafana - uses: smartcontractkit/.github/actions/setup-gap@d316f66b2990ea4daa479daa3de6fc92b00f863e # setup-gap@0.3.2 - id: setup-gap - with: - # aws inputs - aws-region: ${{ secrets.AWS_REGION }} - aws-role-arn: ${{ secrets.AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN }} - api-gateway-host: ${{ secrets.AWS_API_GW_HOST_GRAFANA }} - # other inputs - duplicate-authorization-header: "true" - - - name: Prepare Base64 TOML override - uses: ./.github/actions/setup-create-base64-config - with: - runId: ${{ github.run_id }} - testLogCollect: ${{ vars.TEST_LOG_COLLECT }} - selectedNetworks: ${{ env.SELECTED_NETWORKS }} - chainlinkVersion: ${{ inputs.evm-ref || github.sha }} - logstreamLogTargets: ${{ vars.LOGSTREAM_LOG_TARGETS }} - - ## Run this step when changes that require tests to be run are made - - name: Run Tests - if: needs.changes.outputs.src == 'true' || github.event_name == 'workflow_dispatch' - uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests@75a9005952a9e905649cfb5a6971fd9429436acd # v2.3.25 - with: - test_command_to_run: cd ./integration-tests && go test -timeout 30m -count=1 -json -test.parallel=${{ matrix.product.nodes }} ${{ steps.build-go-test-command.outputs.run_command }} 2>&1 | tee /tmp/gotest.log | gotestloghelper -ci -singlepackage -hidepassingtests=false -hidepassinglogs - test_download_vendor_packages_command: cd ./integration-tests && go mod download - test_config_override_base64: ${{ env.BASE64_CONFIG_OVERRIDE }} - cl_repo: ${{ env.CHAINLINK_IMAGE }} - cl_image_tag: ${{ inputs.evm-ref || github.sha }}${{ matrix.product.tag_suffix }} - aws_registries: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }} - artifacts_name: ${{ matrix.product.name }}${{ matrix.product.tag_suffix }}-test-logs - artifacts_location: | - ./integration-tests/smoke/logs/ - /tmp/gotest.log - publish_check_name: ${{ matrix.product.name }} - token: ${{ secrets.GITHUB_TOKEN }} - go_mod_path: ./integration-tests/go.mod - cache_key_id: core-e2e-${{ env.MOD_CACHE_VERSION }} - cache_restore_only: "true" - QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} - QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} - QA_KUBECONFIG: "" - should_tidy: "false" - go_coverage_src_dir: /var/tmp/go-coverage - go_coverage_dest_dir: ${{ github.workspace }}/.covdata - DEFAULT_CHAINLINK_IMAGE: ${{ env.CHAINLINK_IMAGE }} - DEFAULT_LOKI_TENANT_ID: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} - DEFAULT_LOKI_ENDPOINT: https://${{ secrets.GRAFANA_INTERNAL_HOST }}/loki/api/v1/push - DEFAULT_LOKI_BASIC_AUTH: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} - DEFAULT_GRAFANA_BASE_URL: "http://localhost:8080/primary" - DEFAULT_GRAFANA_DASHBOARD_URL: "/d/ddf75041-1e39-42af-aa46-361fe4c36e9e/ci-e2e-tests-logs" - DEFAULT_GRAFANA_BEARER_TOKEN: ${{ secrets.GRAFANA_INTERNAL_URL_SHORTENER_TOKEN }} - DEFAULT_PYROSCOPE_SERVER_URL: ${{ matrix.product.pyroscope_env == '' && '' || !startsWith(github.ref, 'refs/tags/') && '' || secrets.QA_PYROSCOPE_INSTANCE }} # Avoid sending blank envs https://github.com/orgs/community/discussions/25725 - DEFAULT_PYROSCOPE_KEY: ${{ secrets.QA_PYROSCOPE_KEY }} - DEFAULT_PYROSCOPE_ENVIRONMENT: ${{ matrix.product.pyroscope_env }} - DEFAULT_PYROSCOPE_ENABLED: ${{ matrix.product.pyroscope_env == '' || !startsWith(github.ref, 'refs/tags/') && 'false' || 'true' }} - - - name: Upload Coverage Data - uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3 - timeout-minutes: 2 - continue-on-error: true - with: - name: cl-node-coverage-data-${{ matrix.product.name }}-${{ matrix.product.tag_suffix }} - path: .covdata - retention-days: 1 - - # Run this step when changes that do not need the test to run are made - - name: Run Setup - if: needs.changes.outputs.src == 'false' - uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/setup-run-tests-environment@75a9005952a9e905649cfb5a6971fd9429436acd # v2.3.25 + - name: Send slack notification for failed migration tests + if: steps.check_core_results.outputs.node_migration_tests_failed == 'true' && github.event_name != 'workflow_dispatch' + uses: slackapi/slack-github-action@6c661ce58804a1a20f6dc5fbee7f0381b469e001 # v1.25.0 + env: + SLACK_BOT_TOKEN: ${{ secrets.QA_SLACK_API_KEY }} with: - test_download_vendor_packages_command: cd ./integration-tests && go mod download - go_mod_path: ./integration-tests/go.mod - cache_key_id: core-e2e-${{ env.MOD_CACHE_VERSION }} - cache_restore_only: "true" - QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} - QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} - QA_KUBECONFIG: "" - should_tidy: "false" - - - name: Show Otel-Collector Logs - if: steps.check-label.outputs.trace == 'true' && matrix.product.name == 'ocr2' && matrix.product.tag_suffix == '-plugins' - run: | - docker logs otel-collector - - - name: Permissions on traces - if: steps.check-label.outputs.trace == 'true' && matrix.product.name == 'ocr2' && matrix.product.tag_suffix == '-plugins' - run: | - ls -l ./integration-tests/smoke/traces + channel-id: "#team-test-tooling-internal" + slack-message: ":x: :mild-panic-intensifies: Node Migration Tests Failed: \n${{ format('https://github.com/{0}/actions/runs/{1}', github.repository, github.run_id) }}\n${{ format('Notifying ', secrets.GUARDIAN_SLACK_NOTIFICATION_HANDLE) }}" - - name: Upload Trace Data - if: steps.check-label.outputs.trace == 'true' && matrix.product.name == 'ocr2' && matrix.product.tag_suffix == '-plugins' - uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 - with: - name: trace-data - path: ./integration-tests/smoke/traces/trace-data.json + - name: Fail the job if core tests in PR not successful + if: always() && needs.run-core-e2e-tests-for-pr.result == 'failure' + run: exit 1 - - name: Print failed test summary - if: always() - uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/show-test-summary@75a9005952a9e905649cfb5a6971fd9429436acd # v2.3.25 - with: - test_directory: ./integration-tests/smoke/ + - name: Fail the job if core tests in merge queue not successful + if: always() && needs.run-core-e2e-tests-for-merge-queue.result == 'failure' + run: exit 1 - ### Used to check the required checks box when the matrix completes - eth-smoke-tests: - if: always() - runs-on: ubuntu-latest - name: ETH Smoke Tests - needs: [eth-smoke-tests-matrix, eth-smoke-tests-matrix-automation, eth-smoke-tests-matrix-log-poller] - steps: - - name: Check smoke test matrix status - if: needs.eth-smoke-tests-matrix.result != 'success' || needs.eth-smoke-tests-matrix-automation.result != 'success' || needs.eth-smoke-tests-matrix-log-poller.result != 'success' - run: | - echo "ETH Smoke Tests: ${{ needs.eth-smoke-tests-matrix.result }}" - echo "Automation: ${{ needs.eth-smoke-tests-matrix-automation.result }}" - echo "Log Poller: ${{ needs.eth-smoke-tests-matrix-log-poller.result }}" - exit 1 - - name: Collect Metrics - if: always() - id: collect-gha-metrics - uses: smartcontractkit/push-gha-metrics-action@d9da21a2747016b3e13de58c7d4115a3d5c97935 # v3.0.1 - with: - id: ${{ env.COLLECTION_ID }}-matrix-results - org-id: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} - basic-auth: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} - hostname: ${{ secrets.GRAFANA_INTERNAL_HOST }} - this-job-name: ETH Smoke Tests - matrix-aggregator-status: ${{ needs.eth-smoke-tests-matrix.result }} - continue-on-error: true + - name: Fail the job if lint not successful + if: always() && needs.lint-integration-tests.result == 'failure' + run: exit 1 cleanup: name: Clean up integration environment deployments if: always() - needs: [eth-smoke-tests] + needs: [run-core-e2e-tests-for-pr, run-ccip-e2e-tests-for-pr, run-core-e2e-tests-for-merge-queue, run-ccip-e2e-tests-for-merge-queue] runs-on: ubuntu-latest steps: - name: Checkout repo @@ -852,10 +480,10 @@ jobs: this-job-name: Clean up integration environment deployments continue-on-error: true - show-coverage: + show-chainlink-node-coverage: name: Show Chainlink Node Go Coverage if: always() - needs: [cleanup] + needs: [run-core-e2e-tests-for-pr, run-ccip-e2e-tests-for-pr, run-core-e2e-tests-for-merge-queue, run-ccip-e2e-tests-for-merge-queue] runs-on: ubuntu-latest steps: - name: Checkout the repo @@ -866,159 +494,11 @@ jobs: - name: Download All Artifacts uses: actions/download-artifact@9c19ed7fe5d278cd354c7dfd5d3b88589c7e2395 # v4.1.6 with: - path: cl-node-coverage-data - pattern: cl-node-coverage-data-* + path: cl_node_coverage_data + pattern: cl_node_coverage_data_* merge-multiple: true - name: Show Coverage - run: go run ./integration-tests/scripts/show_coverage.go "${{ github.workspace }}/cl-node-coverage-data/*/merged" - - # Run the setup if the matrix finishes but this time save the cache if we have a cache hit miss - # this will also only run if both of the matrix jobs pass - eth-smoke-go-mod-cache: - environment: integration - needs: [eth-smoke-tests] - runs-on: ubuntu-latest - name: ETH Smoke Tests Go Mod Cache - continue-on-error: true - steps: - - name: Checkout the repo - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 - with: - repository: smartcontractkit/chainlink - ref: ${{ inputs.cl_ref || github.event.pull_request.head.sha || github.event.merge_group.head_sha }} - - name: Run Setup - uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/setup-go@75a9005952a9e905649cfb5a6971fd9429436acd # v2.3.25 - with: - test_download_vendor_packages_command: | - cd ./integration-tests - go mod download - # force download of test dependencies - go test -run=NonExistentTest ./smoke/... || echo "ignore expected test failure" - go_mod_path: ./integration-tests/go.mod - cache_key_id: core-e2e-${{ env.MOD_CACHE_VERSION }} - cache_restore_only: "false" - - ### Migration tests - node-migration-tests: - name: Version Migration Tests - environment: integration - permissions: - checks: write - pull-requests: write - id-token: write - contents: read - runs-on: ubuntu-latest - needs: [build-chainlink, changes] - # Only run migration tests on new tags - if: startsWith(github.ref, 'refs/tags/') - env: - SELECTED_NETWORKS: SIMULATED,SIMULATED_1,SIMULATED_2 - CHAINLINK_COMMIT_SHA: ${{ inputs.evm-ref || github.sha }} - CHAINLINK_ENV_USER: ${{ github.actor }} - CHAINLINK_IMAGE: public.ecr.aws/chainlink/chainlink - UPGRADE_VERSION: ${{ inputs.evm-ref || github.sha }} - UPGRADE_IMAGE: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/chainlink - TEST_LOG_LEVEL: debug - TEST_SUITE: migration - steps: - - name: Collect Metrics - id: collect-gha-metrics - uses: smartcontractkit/push-gha-metrics-action@d9da21a2747016b3e13de58c7d4115a3d5c97935 # v3.0.1 - with: - id: ${{ env.COLLECTION_ID }}-migration-tests - org-id: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} - basic-auth: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} - hostname: ${{ secrets.GRAFANA_INTERNAL_HOST }} - this-job-name: Version Migration Tests - test-results-file: '{"testType":"go","filePath":"/tmp/gotest.log"}' - continue-on-error: true - - name: Checkout the repo - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 - with: - repository: smartcontractkit/chainlink - ref: ${{ inputs.cl_ref || github.event.pull_request.head.sha || github.event.merge_group.head_sha }} - - name: Get Latest Version - id: get_latest_version - run: | - untrimmed_ver=$(curl --header "Authorization: token ${{ secrets.GITHUB_TOKEN }}" --request GET https://api.github.com/repos/${{ github.repository }}/releases/latest | jq -r .name) - latest_version="${untrimmed_ver:1}" - # Check if latest_version is empty - if [ -z "$latest_version" ]; then - echo "Error: The latest_version is empty. The migration tests need a verison to run." - exit 1 - fi - echo "latest_version=${latest_version}" >> "$GITHUB_OUTPUT" - - name: Name Versions - run: | - echo "Running migration tests from version '${{ steps.get_latest_version.outputs.latest_version }}' to: '${{ inputs.evm-ref || github.sha }}'" - - name: Prepare Base64 TOML override - uses: ./.github/actions/setup-create-base64-upgrade-config - with: - selectedNetworks: ${{ env.SELECTED_NETWORKS }} - chainlinkImage: ${{ env.CHAINLINK_IMAGE }} - chainlinkVersion: ${{ steps.get_latest_version.outputs.latest_version }} - upgradeImage: ${{ env.UPGRADE_IMAGE }} - upgradeVersion: ${{ env.UPGRADE_VERSION }} - runId: ${{ github.run_id }} - testLogCollect: ${{ vars.TEST_LOG_COLLECT }} - lokiEndpoint: https://${{ secrets.GRAFANA_INTERNAL_HOST }}/loki/api/v1/push - lokiTenantId: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} - lokiBasicAuth: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} - logstreamLogTargets: ${{ vars.LOGSTREAM_LOG_TARGETS }} - grafanaUrl: ${{ vars.GRAFANA_URL }} - grafanaDashboardUrl: "/d/ddf75041-1e39-42af-aa46-361fe4c36e9e/ci-e2e-tests-logs" - - name: Run Migration Tests - uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests@75a9005952a9e905649cfb5a6971fd9429436acd # v2.3.25 - with: - test_command_to_run: cd ./integration-tests && go test -timeout 20m -count=1 -json ./migration 2>&1 | tee /tmp/gotest.log | gotestloghelper -ci -singlepackage -hidepassingtests=false -hidepassinglogs - test_download_vendor_packages_command: cd ./integration-tests && go mod download - test_config_override_base64: ${{ env.BASE64_CONFIG_OVERRIDE }} - cl_repo: ${{ env.CHAINLINK_IMAGE }} - cl_image_tag: ${{ steps.get_latest_version.outputs.latest_version }} - aws_registries: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }} - artifacts_name: node-migration-test-logs - artifacts_location: | - ./integration-tests/migration/logs - /tmp/gotest.log - publish_check_name: Node Migration Test Results - token: ${{ secrets.GITHUB_TOKEN }} - go_mod_path: ./integration-tests/go.mod - cache_key_id: core-e2e-${{ env.MOD_CACHE_VERSION }} - cache_restore_only: "true" - QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} - QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} - QA_KUBECONFIG: "" - go_coverage_src_dir: /var/tmp/go-coverage - go_coverage_dest_dir: ${{ github.workspace }}/.covdata - should_tidy: "false" - DEFAULT_CHAINLINK_IMAGE: ${{ env.CHAINLINK_IMAGE }} - DEFAULT_LOKI_TENANT_ID: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} - DEFAULT_LOKI_ENDPOINT: https://${{ secrets.GRAFANA_INTERNAL_HOST }}/loki/api/v1/push - DEFAULT_LOKI_BASIC_AUTH: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} - DEFAULT_GRAFANA_BASE_URL: "http://localhost:8080/primary" - DEFAULT_GRAFANA_DASHBOARD_URL: "/d/ddf75041-1e39-42af-aa46-361fe4c36e9e/ci-e2e-tests-logs" - DEFAULT_GRAFANA_BEARER_TOKEN: ${{ secrets.GRAFANA_INTERNAL_URL_SHORTENER_TOKEN }} - DEFAULT_PYROSCOPE_SERVER_URL: ${{ matrix.product.pyroscope_env == '' && '' || !startsWith(github.ref, 'refs/tags/') && '' || secrets.QA_PYROSCOPE_INSTANCE }} # Avoid sending blank envs https://github.com/orgs/community/discussions/25725 - DEFAULT_PYROSCOPE_KEY: ${{ secrets.QA_PYROSCOPE_KEY }} - DEFAULT_PYROSCOPE_ENVIRONMENT: ${{ matrix.product.pyroscope_env }} - DEFAULT_PYROSCOPE_ENABLED: ${{ matrix.product.pyroscope_env == '' || !startsWith(github.ref, 'refs/tags/') && 'false' || 'true' }} - - - name: Upload Coverage Data - uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3 - timeout-minutes: 2 - continue-on-error: true - with: - name: cl-node-coverage-data-migration-tests - path: .covdata - retention-days: 1 - - name: Notify Slack - if: failure() && github.event_name != 'workflow_dispatch' - uses: slackapi/slack-github-action@6c661ce58804a1a20f6dc5fbee7f0381b469e001 # v1.25.0 - env: - SLACK_BOT_TOKEN: ${{ secrets.QA_SLACK_API_KEY }} - with: - channel-id: "#team-test-tooling-internal" - slack-message: ":x: :mild-panic-intensifies: Node Migration Tests Failed: \n${{ format('https://github.com/{0}/actions/runs/{1}', github.repository, github.run_id) }}" + run: go run ./integration-tests/scripts/show_coverage.go "${{ github.workspace }}/cl_node_coverage_data/*/merged" ## Solana Section get_solana_sha: @@ -1061,7 +541,7 @@ jobs: id: getsha run: | cd solanapath - full_sha=$(git rev-parse ${{steps.getshortsha.outputs.short_sha}}) + full_sha=$(git rev-parse ${{steps.getshortsha.outputs.short_sha}}^{}) # additional suffix allows handling tagged versions as well if [ -z "${full_sha}" ]; then echo "Error: could not get the full sha from the short sha using git, look above for error(s)" exit 1 @@ -1101,7 +581,7 @@ jobs: steps: - name: Check if image exists id: check-image - uses: smartcontractkit/chainlink-github-actions/docker/image-exists@75a9005952a9e905649cfb5a6971fd9429436acd # v2.3.25 + uses: smartcontractkit/chainlink-github-actions/docker/image-exists@0ce1e67b254a4f041e03cc6f0e3afc987b47c7bd # v2.3.30 with: repository: chainlink-solana-tests tag: ${{ needs.get_solana_sha.outputs.sha }} @@ -1116,7 +596,7 @@ jobs: id-token: write contents: read name: Solana Build Artifacts - runs-on: ubuntu22.04-16cores-64GB + runs-on: ubuntu22.04-8cores-32GB needs: [ changes, @@ -1126,7 +606,7 @@ jobs: ] steps: - name: Collect Metrics - if: needs.changes.outputs.src == 'true' || github.event_name == 'workflow_dispatch' + if: needs.changes.outputs.core_changes == 'true' || github.event_name == 'workflow_dispatch' id: collect-gha-metrics uses: smartcontractkit/push-gha-metrics-action@d9da21a2747016b3e13de58c7d4115a3d5c97935 # v3.0.1 with: @@ -1142,11 +622,11 @@ jobs: repository: smartcontractkit/chainlink-solana ref: ${{ needs.get_solana_sha.outputs.sha }} - name: Build contracts - if: (needs.changes.outputs.src == 'true' || github.event_name == 'workflow_dispatch') && needs.solana-test-image-exists.outputs.exists == 'false' + if: (needs.changes.outputs.core_changes == 'true' || github.event_name == 'workflow_dispatch') && needs.solana-test-image-exists.outputs.exists == 'false' uses: smartcontractkit/chainlink-solana/.github/actions/build_contract_artifacts@46b1311a5a83f33d08ffa8e1e0ab04f9ad51665d # node20 update on may 10, 2024 with: ref: ${{ needs.get_solana_sha.outputs.sha }} - image: projectserum/build + image: backpackapp/build image-version: ${{ needs.get_projectserum_version.outputs.projectserum_version }} solana-build-test-image: @@ -1157,7 +637,7 @@ jobs: id-token: write contents: read name: Solana Build Test Image - runs-on: ubuntu22.04-16cores-64GB + runs-on: ubuntu22.04-8cores-32GB needs: [ solana-build-contracts, @@ -1169,7 +649,7 @@ jobs: CONTRACT_ARTIFACTS_PATH: contracts/target/deploy steps: - name: Collect Metrics - if: (needs.changes.outputs.src == 'true' || github.event_name == 'workflow_dispatch') && needs.solana-test-image-exists.outputs.exists == 'false' + if: (needs.changes.outputs.core_changes == 'true' || github.event_name == 'workflow_dispatch') && needs.solana-test-image-exists.outputs.exists == 'false' id: collect-gha-metrics uses: smartcontractkit/push-gha-metrics-action@d9da21a2747016b3e13de58c7d4115a3d5c97935 # v3.0.1 with: @@ -1180,22 +660,29 @@ jobs: this-job-name: Solana Build Test Image continue-on-error: true - name: Checkout the repo - if: (needs.changes.outputs.src == 'true' || github.event_name == 'workflow_dispatch') && needs.solana-test-image-exists.outputs.exists == 'false' + if: (needs.changes.outputs.core_changes == 'true' || github.event_name == 'workflow_dispatch') && needs.solana-test-image-exists.outputs.exists == 'false' uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 with: repository: smartcontractkit/chainlink-solana ref: ${{ needs.get_solana_sha.outputs.sha }} + - name: Download Artifacts + if: (needs.changes.outputs.core_changes == 'true' || github.event_name == 'workflow_dispatch') && needs.solana-test-image-exists.outputs.exists == 'false' + uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7 + with: + name: artifacts + path: ${{ env.CONTRACT_ARTIFACTS_PATH }} - name: Build Test Image - if: (needs.changes.outputs.src == 'true' || github.event_name == 'workflow_dispatch') && needs.solana-test-image-exists.outputs.exists == 'false' - uses: ./.github/actions/build-test-image + if: (needs.changes.outputs.core_changes == 'true' || github.event_name == 'workflow_dispatch') && needs.solana-test-image-exists.outputs.exists == 'false' + uses: smartcontractkit/.github/actions/ctf-build-test-image@a5e4f4c8fbb8e15ab2ad131552eca6ac83c4f4b3 # ctf-build-test-image@0.1.0 with: + repository: chainlink-solana-tests tag: ${{ needs.get_solana_sha.outputs.sha }} - artifacts_path: ${{ env.CONTRACT_ARTIFACTS_PATH }} + suites: smoke QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} QA_AWS_ACCOUNT_NUMBER: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }} - run: echo "this exists so we don't have to run anything else if the build is skipped" - if: needs.changes.outputs.src == 'false' || needs.solana-test-image-exists.outputs.exists == 'true' + if: needs.changes.outputs.core_changes == 'false' || needs.solana-test-image-exists.outputs.exists == 'true' solana-smoke-tests: if: ${{ !contains(join(github.event.pull_request.labels.*.name, ' '), 'skip-smoke-tests') }} @@ -1206,7 +693,7 @@ jobs: id-token: write contents: read name: Solana Smoke Tests - runs-on: ubuntu22.04-16cores-64GB + runs-on: ubuntu22.04-8cores-32GB needs: [ build-chainlink, @@ -1222,7 +709,7 @@ jobs: CONTRACT_ARTIFACTS_PATH: contracts/target/deploy steps: - name: Collect Metrics - if: needs.changes.outputs.src == 'true' || github.event_name == 'workflow_dispatch' + if: needs.changes.outputs.core_changes == 'true' || github.event_name == 'workflow_dispatch' id: collect-gha-metrics uses: smartcontractkit/push-gha-metrics-action@d9da21a2747016b3e13de58c7d4115a3d5c97935 # v3.0.1 with: @@ -1239,8 +726,8 @@ jobs: repository: smartcontractkit/chainlink-solana ref: ${{ needs.get_solana_sha.outputs.sha }} - name: Run Setup - if: needs.changes.outputs.src == 'true' || github.event_name == 'workflow_dispatch' - uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/setup-run-tests-environment@75a9005952a9e905649cfb5a6971fd9429436acd # v2.3.25 + if: needs.changes.outputs.core_changes == 'true' || github.event_name == 'workflow_dispatch' + uses: smartcontractkit/.github/actions/ctf-setup-run-tests-environment@49cb1613e96c9ce17f7290e4dabd38f43aa9bd4d # ctf-setup-run-tests-environment@0.0.0 with: go_mod_path: ./integration-tests/go.mod cache_restore_only: true @@ -1252,7 +739,7 @@ jobs: QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }} - name: Pull Artifacts - if: needs.changes.outputs.src == 'true' || github.event_name == 'workflow_dispatch' + if: needs.changes.outputs.core_changes == 'true' || github.event_name == 'workflow_dispatch' run: | IMAGE_NAME=${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/chainlink-solana-tests:${{ needs.get_solana_sha.outputs.sha }} # Pull the Docker image @@ -1269,16 +756,16 @@ jobs: docker rm "$CONTAINER_ID" - name: Install Solana CLI # required for ensuring the local test validator is configured correctly run: ./scripts/install-solana-ci.sh + - name: Install gauntlet run: | yarn --cwd ./gauntlet install --frozen-lockfile yarn --cwd ./gauntlet build yarn --cwd ./gauntlet gauntlet - name: Generate config overrides - run: | # https://github.com/smartcontractkit/chainlink-testing-framework/blob/main/config/README.md + run: | # https://github.com/smartcontractkit/chainlink-testing-framework/lib/blob/main/config/README.md cat << EOF > config.toml [ChainlinkImage] - image="${{ env.CHAINLINK_IMAGE }}" version="${{ inputs.evm-ref || github.sha }}" [Common] user="${{ github.actor }}" @@ -1291,10 +778,11 @@ jobs: # shellcheck disable=SC2086 echo "BASE64_CONFIG_OVERRIDE=$BASE64_CONFIG_OVERRIDE" >> $GITHUB_ENV - name: Run Tests - if: needs.changes.outputs.src == 'true' || github.event_name == 'workflow_dispatch' - uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests@75a9005952a9e905649cfb5a6971fd9429436acd # v2.3.25 + if: needs.changes.outputs.core_changes == 'true' || github.event_name == 'workflow_dispatch' + uses: smartcontractkit/.github/actions/ctf-run-tests@b8731364b119e88983e94b0c4da87fc27ddb41b8 # ctf-run-tests@0.0.0 with: test_command_to_run: export ENV_JOB_IMAGE=${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/chainlink-solana-tests:${{ needs.get_solana_sha.outputs.sha }} && make test_smoke + test_config_override_base64: ${{ env.BASE64_CONFIG_OVERRIDE }} cl_repo: ${{ env.CHAINLINK_IMAGE }} cl_image_tag: ${{ inputs.evm-ref || github.sha }} publish_check_name: Solana Smoke Test Results @@ -1302,9 +790,11 @@ jobs: cache_key_id: core-solana-e2e-${{ env.MOD_CACHE_VERSION }} token: ${{ secrets.GITHUB_TOKEN }} aws_registries: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }} - artifacts_name: solana-test-logs + artifacts_name: solana-test-artifacts artifacts_location: | ./integration-tests/smoke/logs + ./integration-tests/smoke/db_dumps + ./integration-tests/smoke/seth_artifacts /tmp/gotest.log QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} @@ -1312,13 +802,16 @@ jobs: run_setup: false go_coverage_src_dir: /var/tmp/go-coverage go_coverage_dest_dir: ${{ github.workspace }}/.covdata + env: + E2E_TEST_CHAINLINK_IMAGE: ${{ env.CHAINLINK_IMAGE }} + E2E_TEST_SOLANA_SECRET: thisisatestingonlysecret - name: Upload Coverage Data uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3 timeout-minutes: 2 continue-on-error: true with: - name: cl-node-coverage-data-solana-tests + name: cl_node_coverage_data_solana_tests path: .covdata retention-days: 1 diff --git a/.github/workflows/live-testnet-tests.yml b/.github/workflows/live-testnet-tests.yml deleted file mode 100644 index a7eaa19f7f0..00000000000 --- a/.github/workflows/live-testnet-tests.yml +++ /dev/null @@ -1,1119 +0,0 @@ -# *** -# This workflow is a monstrosity of copy-paste, and that's to increase legibility in reporting and running, so the code be damned. -# I suspect this can be cleaned up significantly with some clever trickery of the GitHub actions matrices, but I am not that clever. -# We want each chain to run in parallel, but each test within the chain needs to be able to run sequentially -# (we're trying to eliminate this as a requirement, should make it a lot easier). -# Each chain can have a variety of tests to run. -# We also want reporting to be clear in the start-slack-thread and post-test-results-to-slack jobs. -# Funding address: 0xC1107e57082945E28d3202A81B1520DEA3AE6AEC -# *** - -name: Live Testnet Tests -on: - # Disable refular runs for now until we can fix some test client flakiness and improve stability - # schedule: - # - cron: "0 5 * * *" # Run every night at midnight EST - # push: - # tags: - # - "*" - workflow_dispatch: - inputs: - slack_user_id: - description: "The Slack member ID to notify" - required: true - type: string - network: - description: "The network to run tests on" - required: true - type: choice - options: - - "All" - - "Sepolia" - - "Optimism Sepolia" - - "Arbitrum Sepolia" - - "Base Sepolia" - - "Polygon Mumbai" - - "Avalanche Fuji" - - "Fantom Testnet" - - "Celo Alfajores" - - "Linea Goerli" - - "BSC Testnet" - -env: - CHAINLINK_IMAGE: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/chainlink - INTERNAL_DOCKER_REPO: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com - MOD_CACHE_VERSION: 2 - CHAINLINK_NODE_FUNDING: .5 - PYROSCOPE_KEY: ${{ secrets.QA_PYROSCOPE_KEY }} - LOKI_TENANT_ID: ${{ vars.LOKI_TENANT_ID }} - LOKI_URL: ${{ secrets.LOKI_URL }} - LOKI_BASIC_AUTH: ${{ secrets.LOKI_BASIC_AUTH }} - LOGSTREAM_LOG_TARGETS: loki - GRAFANA_URL: ${{ vars.GRAFANA_URL }} - RUN_ID: ${{ github.run_id }} - - CHAINLINK_COMMIT_SHA: ${{ github.sha }} - CHAINLINK_ENV_USER: ${{ github.actor }} - TEST_LOG_LEVEL: debug - -jobs: - - # Build Test Dependencies - - build-chainlink: - environment: integration - permissions: - id-token: write - contents: read - name: Build Chainlink Image - runs-on: ubuntu-latest - steps: - - name: Collect Metrics - id: collect-gha-metrics - uses: smartcontractkit/push-gha-metrics-action@d9da21a2747016b3e13de58c7d4115a3d5c97935 # v3.0.1 - with: - id: live-testnet-build-chainlink - org-id: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} - basic-auth: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} - hostname: ${{ secrets.GRAFANA_INTERNAL_HOST }} - this-job-name: Build Chainlink Image - continue-on-error: true - - name: Checkout the repo - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 - with: - ref: ${{ github.event.pull_request.head.sha || github.event.merge_group.head_sha }} - - name: Build Chainlink Image - uses: ./.github/actions/build-chainlink-image - with: - tag_suffix: "" - dockerfile: core/chainlink.Dockerfile - git_commit_sha: ${{ github.sha }} - AWS_REGION: ${{ secrets.QA_AWS_REGION }} - AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} - - build-tests: - environment: integration - permissions: - id-token: write - contents: read - name: Build Tests Binary - runs-on: ubuntu-latest - steps: - - name: Collect Metrics - id: collect-gha-metrics - uses: smartcontractkit/push-gha-metrics-action@d9da21a2747016b3e13de58c7d4115a3d5c97935 # v3.0.1 - with: - id: live-testnet-build-test-image - org-id: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} - basic-auth: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} - hostname: ${{ secrets.GRAFANA_INTERNAL_HOST }} - this-job-name: Build Tests Binary - continue-on-error: true - - name: Checkout the repo - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 - with: - ref: ${{ github.event.pull_request.head.sha || github.event.merge_group.head_sha }} - - name: Build Tests - uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/build-tests@75a9005952a9e905649cfb5a6971fd9429436acd # v2.3.25 - with: - test_download_vendor_packages_command: cd ./integration-tests && go mod download - token: ${{ secrets.GITHUB_TOKEN }} - go_mod_path: ./integration-tests/go.mod - go_tags: embed - cache_key_id: core-e2e-${{ env.MOD_CACHE_VERSION }} - cache_restore_only: "true" - binary_name: tests - - # End Build Test Dependencies - - # Reporting Jobs - - start-slack-thread: - name: Start Slack Thread - if: ${{ always() && needs.*.result != 'skipped' && needs.*.result != 'cancelled' }} - environment: integration - outputs: - thread_ts: ${{ steps.slack.outputs.thread_ts }} - permissions: - checks: write - pull-requests: write - id-token: write - contents: read - runs-on: ubuntu-latest - needs: [sepolia-smoke-tests, optimism-sepolia-smoke-tests, arbitrum-sepolia-smoke-tests, base-sepolia-smoke-tests, polygon-mumbai-smoke-tests, avalanche-fuji-smoke-tests, fantom-testnet-smoke-tests, celo-alfajores-smoke-tests, linea-goerli-smoke-tests, bsc-testnet-smoke-tests] - steps: - - name: Debug Result - run: echo ${{ join(needs.*.result, ',') }} - - name: Main Slack Notification - uses: slackapi/slack-github-action@6c661ce58804a1a20f6dc5fbee7f0381b469e001 # v1.25.0 - id: slack - with: - channel-id: ${{ secrets.QA_SLACK_CHANNEL }} - payload: | - { - "attachments": [ - { - "color": "${{ contains(join(needs.*.result, ','), 'failure') && '#C62828' || '#2E7D32' }}", - "blocks": [ - { - "type": "header", - "text": { - "type": "plain_text", - "text": "Live Smoke Test Results ${{ contains(join(needs.*.result, ','), 'failure') && ':x:' || ':white_check_mark:'}}", - "emoji": true - } - }, - { - "type": "section", - "text": { - "type": "mrkdwn", - "text": "Notifying <@${{ inputs.slack_user_id }}>" - } - }, - { - "type": "divider" - }, - { - "type": "section", - "text": { - "type": "mrkdwn", - "text": "<${{ github.server_url }}/${{ github.repository }}/releases/tag/${{ github.ref_name }}|${{ github.ref_name }}> | <${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}|${{ github.sha }}> | <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|Run>\nThe funding address for all tests and networks is `0xC1107e57082945E28d3202A81B1520DEA3AE6AEC`" - } - } - ] - } - ] - } - env: - SLACK_BOT_TOKEN: ${{ secrets.QA_SLACK_API_KEY }} - - post-test-results-to-slack: - name: Post Test Results for ${{ matrix.network }} - if: ${{ always() && needs.*.result != 'skipped' && needs.*.result != 'cancelled' }} - environment: integration - permissions: - checks: write - pull-requests: write - id-token: write - contents: read - runs-on: ubuntu-latest - needs: start-slack-thread - strategy: - fail-fast: false - matrix: - network: [Sepolia, Optimism Sepolia, Arbitrum Sepolia, Base Sepolia, Polygon Mumbai, Avalanche Fuji, Fantom Testnet, Celo Alfajores, Linea Goerli, BSC Testnet] - steps: - - name: Checkout the repo - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 - with: - ref: ${{ github.event.pull_request.head.sha || github.event.merge_group.head_sha }} - - name: Post Test Results - uses: ./.github/actions/notify-slack-jobs-result - with: - github_token: ${{ github.token }} - github_repository: ${{ github.repository }} - workflow_run_id: ${{ github.run_id }} - github_job_name_regex: ^${{ matrix.network }} (.*?) Tests$ - message_title: ${{ matrix.network }} - slack_channel_id: ${{ secrets.QA_SLACK_CHANNEL }} - slack_bot_token: ${{ secrets.QA_SLACK_API_KEY }} - slack_thread_ts: ${{ needs.start-slack-thread.outputs.thread_ts }} - - # End Reporting Jobs - - sepolia-smoke-tests: - environment: integration - if: ${{ (github.event.inputs.network == 'All' || github.event.inputs.network == 'Sepolia') }} - permissions: - checks: write - pull-requests: write - id-token: write - contents: read - needs: [build-chainlink, build-tests] - strategy: - max-parallel: 1 - fail-fast: false - matrix: - include: # https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs#example-adding-configurations - - product: OCR - test: TestOCRBasic - - product: Automation Conditional - test: TestAutomationBasic/registry_2_1_conditional - - product: Automation Log Trigger - test: TestAutomationBasic/registry_2_1_logtrigger - name: Sepolia ${{ matrix.product }} Tests - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 - with: - fetch-depth: 0 - - name: Setup GAP for Grafana - uses: smartcontractkit/.github/actions/setup-gap@d316f66b2990ea4daa479daa3de6fc92b00f863e # setup-gap@0.3.2 - with: - # aws inputs - aws-region: ${{ secrets.AWS_REGION }} - aws-role-arn: ${{ secrets.AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN }} - api-gateway-host: ${{ secrets.AWS_API_GW_HOST_GRAFANA }} - # other inputs - duplicate-authorization-header: "true" - - name: Prepare Base64 TOML override - uses: ./.github/actions/setup-create-base64-config-live-testnets - with: - runId: ${{ github.run_id }} - testLogCollect: ${{ vars.TEST_LOG_COLLECT }} - chainlinkImage: ${{ env.CHAINLINK_IMAGE }} - chainlinkVersion: ${{ github.sha }} - pyroscopeServer: ${{ matrix.product.pyroscope_env == '' && '' || !startsWith(github.ref, 'refs/tags/') && '' || secrets.QA_PYROSCOPE_INSTANCE }} # Avoid sending blank envs https://github.com/orgs/community/discussions/25725 - pyroscopeEnvironment: ci-smoke-${{ matrix.product }}-sepolia - pyroscopeKey: ${{ secrets.QA_PYROSCOPE_KEY }} - lokiEndpoint: ${{ secrets.LOKI_URL }} - lokiTenantId: ${{ vars.LOKI_TENANT_ID }} - lokiBasicAuth: ${{ secrets.LOKI_BASIC_AUTH }} - logstreamLogTargets: ${{ vars.LOGSTREAM_LOG_TARGETS }} - grafanaUrl: "http://localhost:8080/primary" - grafanaDashboardUrl: "/d/ddf75041-1e39-42af-aa46-361fe4c36e9e/ci-e2e-tests-logs" - grafanaBearerToken: ${{ secrets.GRAFANA_INTERNAL_URL_SHORTENER_TOKEN }} - network: "sepolia" - httpEndpoints: ${{ secrets.QA_SEPOLIA_HTTP_URLS }} - wsEndpoints: ${{ secrets.QA_SEPOLIA_URLS }} - fundingKeys: ${{ secrets.QA_EVM_KEYS }} - - name: Download Tests Binary - uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4 - with: - name: tests - - name: Run Tests - uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests-binary@75a9005952a9e905649cfb5a6971fd9429436acd # v2.3.25 - with: - test_command_to_run: ./tests -test.timeout 30m -test.count=1 -test.parallel=1 -test.run ${{ matrix.test }} - binary_name: tests - cl_repo: ${{ env.CHAINLINK_IMAGE }} - cl_image_tag: ${{ github.sha }} - aws_registries: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }} - dockerhub_username: ${{ secrets.DOCKERHUB_READONLY_USERNAME }} - dockerhub_password: ${{ secrets.DOCKERHUB_READONLY_PASSWORD }} - artifacts_location: ./logs - token: ${{ secrets.GITHUB_TOKEN }} - cache_key_id: core-e2e-${{ env.MOD_CACHE_VERSION }} - cache_restore_only: "true" - QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} - QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} - QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }} - - name: Print failed test summary - if: always() - uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/show-test-summary@75a9005952a9e905649cfb5a6971fd9429436acd # v2.3.25 - with: - test_directory: "./" - - bsc-testnet-smoke-tests: - environment: integration - if: ${{ github.event.inputs.network == 'All' || github.event.inputs.network == 'BSC Testnet' }} - permissions: - checks: write - pull-requests: write - id-token: write - contents: read - needs: [build-chainlink, build-tests] - strategy: - max-parallel: 1 - fail-fast: false - matrix: - include: # https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs#example-adding-configurations - - product: OCR - test: TestOCRBasic - - product: Automation Conditional - test: TestAutomationBasic/registry_2_1_conditional - - product: Automation Log Trigger - test: TestAutomationBasic/registry_2_1_logtrigger - name: BSC Testnet ${{ matrix.product }} Tests - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 - with: - fetch-depth: 0 - - name: Setup GAP for Grafana - uses: smartcontractkit/.github/actions/setup-gap@d316f66b2990ea4daa479daa3de6fc92b00f863e # setup-gap@0.3.2 - with: - # aws inputs - aws-region: ${{ secrets.AWS_REGION }} - aws-role-arn: ${{ secrets.AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN }} - api-gateway-host: ${{ secrets.AWS_API_GW_HOST_GRAFANA }} - # other inputs - duplicate-authorization-header: "true" - - name: Prepare Base64 TOML override - uses: ./.github/actions/setup-create-base64-config-live-testnets - with: - runId: ${{ github.run_id }} - testLogCollect: ${{ vars.TEST_LOG_COLLECT }} - chainlinkImage: ${{ env.CHAINLINK_IMAGE }} - chainlinkVersion: ${{ github.sha }} - pyroscopeServer: ${{ matrix.product.pyroscope_env == '' && '' || !startsWith(github.ref, 'refs/tags/') && '' || secrets.QA_PYROSCOPE_INSTANCE }} # Avoid sending blank envs https://github.com/orgs/community/discussions/25725 - pyroscopeEnvironment: ci-smoke-${{ matrix.product }}-bsc-testnet - pyroscopeKey: ${{ secrets.QA_PYROSCOPE_KEY }} - lokiEndpoint: ${{ secrets.LOKI_URL }} - lokiTenantId: ${{ vars.LOKI_TENANT_ID }} - lokiBasicAuth: ${{ secrets.LOKI_BASIC_AUTH }} - logstreamLogTargets: ${{ vars.LOGSTREAM_LOG_TARGETS }} - grafanaUrl: "http://localhost:8080/primary" - grafanaDashboardUrl: "/d/ddf75041-1e39-42af-aa46-361fe4c36e9e/ci-e2e-tests-logs" - grafanaBearerToken: ${{ secrets.GRAFANA_INTERNAL_URL_SHORTENER_TOKEN }} - network: "bsc_testnet" - httpEndpoints: ${{ secrets.QA_BSC_TESTNET_HTTP_URLS }} - wsEndpoints: ${{ secrets.QA_BSC_TESTNET_URLS }} - fundingKeys: ${{ secrets.QA_EVM_KEYS }} - - name: Download Tests Binary - uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4 - with: - name: tests - - name: Run Tests - uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests-binary@75a9005952a9e905649cfb5a6971fd9429436acd # v2.3.25 - with: - test_command_to_run: ./tests -test.timeout 30m -test.count=1 -test.parallel=1 -test.run ${{ matrix.test }} - binary_name: tests - cl_repo: ${{ env.CHAINLINK_IMAGE }} - cl_image_tag: ${{ github.sha }} - aws_registries: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }} - dockerhub_username: ${{ secrets.DOCKERHUB_READONLY_USERNAME }} - dockerhub_password: ${{ secrets.DOCKERHUB_READONLY_PASSWORD }} - artifacts_location: ./logs - token: ${{ secrets.GITHUB_TOKEN }} - cache_key_id: core-e2e-${{ env.MOD_CACHE_VERSION }} - cache_restore_only: "true" - QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} - QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} - QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }} - - name: Print failed test summary - if: always() - uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/show-test-summary@75a9005952a9e905649cfb5a6971fd9429436acd # v2.3.25 - with: - test_directory: "./" - - optimism-sepolia-smoke-tests: - environment: integration - if: ${{ github.event.inputs.network == 'All' || github.event.inputs.network == 'Optimism Sepolia' }} - permissions: - checks: write - pull-requests: write - id-token: write - contents: read - needs: [build-chainlink, build-tests] - strategy: - max-parallel: 1 - fail-fast: false - matrix: - include: # https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs#example-adding-configurations - - product: OCR - test: TestOCRBasic - - product: Automation Conditional - test: TestAutomationBasic/registry_2_1_conditional - - product: Automation Log Trigger - test: TestAutomationBasic/registry_2_1_logtrigger - name: Optimism Sepolia ${{ matrix.product }} Tests - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 - with: - fetch-depth: 0 - - name: Setup GAP for Grafana - uses: smartcontractkit/.github/actions/setup-gap@d316f66b2990ea4daa479daa3de6fc92b00f863e # setup-gap@0.3.2 - with: - # aws inputs - aws-region: ${{ secrets.AWS_REGION }} - aws-role-arn: ${{ secrets.AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN }} - api-gateway-host: ${{ secrets.AWS_API_GW_HOST_GRAFANA }} - # other inputs - duplicate-authorization-header: "true" - - name: Prepare Base64 TOML override - uses: ./.github/actions/setup-create-base64-config-live-testnets - with: - runId: ${{ github.run_id }} - testLogCollect: ${{ vars.TEST_LOG_COLLECT }} - chainlinkImage: ${{ env.CHAINLINK_IMAGE }} - chainlinkVersion: ${{ github.sha }} - pyroscopeServer: ${{ matrix.product.pyroscope_env == '' && '' || !startsWith(github.ref, 'refs/tags/') && '' || secrets.QA_PYROSCOPE_INSTANCE }} # Avoid sending blank envs https://github.com/orgs/community/discussions/25725 - pyroscopeEnvironment: ci-smoke-${{ matrix.product }}-optimism-sepolia - pyroscopeKey: ${{ secrets.QA_PYROSCOPE_KEY }} - lokiEndpoint: ${{ secrets.LOKI_URL }} - lokiTenantId: ${{ vars.LOKI_TENANT_ID }} - lokiBasicAuth: ${{ secrets.LOKI_BASIC_AUTH }} - logstreamLogTargets: ${{ vars.LOGSTREAM_LOG_TARGETS }} - grafanaUrl: "http://localhost:8080/primary" - grafanaDashboardUrl: "/d/ddf75041-1e39-42af-aa46-361fe4c36e9e/ci-e2e-tests-logs" - grafanaBearerToken: ${{ secrets.GRAFANA_INTERNAL_URL_SHORTENER_TOKEN }} - network: "optimism_sepolia" - httpEndpoints: ${{ secrets.QA_OPTIMISM_SEPOLIA_HTTP_URLS }} - wsEndpoints: ${{ secrets.QA_OPTIMISM_SEPOLIA_URLS }} - fundingKeys: ${{ secrets.QA_EVM_KEYS }} - - name: Download Tests Binary - uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4 - with: - name: tests - - name: Run Tests - uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests-binary@75a9005952a9e905649cfb5a6971fd9429436acd # v2.3.25 - with: - test_command_to_run: ./tests -test.timeout 30m -test.count=1 -test.parallel=1 -test.run ${{ matrix.test }} - binary_name: tests - cl_repo: ${{ env.CHAINLINK_IMAGE }} - cl_image_tag: ${{ github.sha }} - aws_registries: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }} - dockerhub_username: ${{ secrets.DOCKERHUB_READONLY_USERNAME }} - dockerhub_password: ${{ secrets.DOCKERHUB_READONLY_PASSWORD }} - artifacts_location: ./logs - token: ${{ secrets.GITHUB_TOKEN }} - cache_key_id: core-e2e-${{ env.MOD_CACHE_VERSION }} - cache_restore_only: "true" - QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} - QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} - QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }} - - name: Print failed test summary - if: always() - uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/show-test-summary@75a9005952a9e905649cfb5a6971fd9429436acd # v2.3.25 - with: - test_directory: "./" - - arbitrum-sepolia-smoke-tests: - environment: integration - if: ${{ github.event.inputs.network == 'All' || github.event.inputs.network == 'Arbitrum Sepolia' }} - permissions: - checks: write - pull-requests: write - id-token: write - contents: read - needs: [build-chainlink, build-tests] - strategy: - max-parallel: 1 - fail-fast: false - matrix: - include: # https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs#example-adding-configurations - - product: OCR - test: TestOCRBasic - - product: Automation Conditional - test: TestAutomationBasic/registry_2_1_conditional - - product: Automation Log Trigger - test: TestAutomationBasic/registry_2_1_logtrigger - name: Arbitrum Sepolia ${{ matrix.product }} Tests - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 - with: - fetch-depth: 0 - - name: Setup GAP for Grafana - uses: smartcontractkit/.github/actions/setup-gap@d316f66b2990ea4daa479daa3de6fc92b00f863e # setup-gap@0.3.2 - with: - # aws inputs - aws-region: ${{ secrets.AWS_REGION }} - aws-role-arn: ${{ secrets.AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN }} - api-gateway-host: ${{ secrets.AWS_API_GW_HOST_GRAFANA }} - # other inputs - duplicate-authorization-header: "true" - - name: Prepare Base64 TOML override - uses: ./.github/actions/setup-create-base64-config-live-testnets - with: - runId: ${{ github.run_id }} - testLogCollect: ${{ vars.TEST_LOG_COLLECT }} - chainlinkImage: ${{ env.CHAINLINK_IMAGE }} - chainlinkVersion: ${{ github.sha }} - pyroscopeServer: ${{ matrix.product.pyroscope_env == '' && '' || !startsWith(github.ref, 'refs/tags/') && '' || secrets.QA_PYROSCOPE_INSTANCE }} # Avoid sending blank envs https://github.com/orgs/community/discussions/25725 - pyroscopeEnvironment: ci-smoke-${{ matrix.product }}-arbitrum-sepolia - pyroscopeKey: ${{ secrets.QA_PYROSCOPE_KEY }} - lokiEndpoint: ${{ secrets.LOKI_URL }} - lokiTenantId: ${{ vars.LOKI_TENANT_ID }} - lokiBasicAuth: ${{ secrets.LOKI_BASIC_AUTH }} - logstreamLogTargets: ${{ vars.LOGSTREAM_LOG_TARGETS }} - grafanaUrl: "http://localhost:8080/primary" - grafanaDashboardUrl: "/d/ddf75041-1e39-42af-aa46-361fe4c36e9e/ci-e2e-tests-logs" - grafanaBearerToken: ${{ secrets.GRAFANA_INTERNAL_URL_SHORTENER_TOKEN }} - network: "arbitrum_sepolia" - httpEndpoints: ${{ secrets.QA_ARBITRUM_SEPOLIA_HTTP_URLS }} - wsEndpoints: ${{ secrets.QA_ARBITRUM_SEPOLIA_URLS }} - fundingKeys: ${{ secrets.QA_EVM_KEYS }} - - name: Download Tests Binary - uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4 - with: - name: tests - - name: Run Tests - uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests-binary@75a9005952a9e905649cfb5a6971fd9429436acd # v2.3.25 - with: - test_command_to_run: ./tests -test.timeout 30m -test.count=1 -test.parallel=1 -test.run ${{ matrix.test }} - binary_name: tests - cl_repo: ${{ env.CHAINLINK_IMAGE }} - cl_image_tag: ${{ github.sha }} - aws_registries: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }} - dockerhub_username: ${{ secrets.DOCKERHUB_READONLY_USERNAME }} - dockerhub_password: ${{ secrets.DOCKERHUB_READONLY_PASSWORD }} - artifacts_location: ./logs - token: ${{ secrets.GITHUB_TOKEN }} - cache_key_id: core-e2e-${{ env.MOD_CACHE_VERSION }} - cache_restore_only: "true" - QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} - QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} - QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }} - - name: Print failed test summary - if: always() - uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/show-test-summary@75a9005952a9e905649cfb5a6971fd9429436acd # v2.3.25 - with: - test_directory: "./" - - base-sepolia-smoke-tests: - environment: integration - if: ${{ github.event.inputs.network == 'All' || github.event.inputs.network == 'Base Sepolia' }} - permissions: - checks: write - pull-requests: write - id-token: write - contents: read - needs: [build-chainlink, build-tests] - strategy: - max-parallel: 1 - fail-fast: false - matrix: - include: # https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs#example-adding-configurations - - product: OCR - test: TestOCRBasic - name: Base Sepolia ${{ matrix.product }} Tests - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 - with: - fetch-depth: 0 - - name: Setup GAP for Grafana - uses: smartcontractkit/.github/actions/setup-gap@d316f66b2990ea4daa479daa3de6fc92b00f863e # setup-gap@0.3.2 - with: - # aws inputs - aws-region: ${{ secrets.AWS_REGION }} - aws-role-arn: ${{ secrets.AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN }} - api-gateway-host: ${{ secrets.AWS_API_GW_HOST_GRAFANA }} - # other inputs - duplicate-authorization-header: "true" - - name: Prepare Base64 TOML override - uses: ./.github/actions/setup-create-base64-config-live-testnets - with: - runId: ${{ github.run_id }} - testLogCollect: ${{ vars.TEST_LOG_COLLECT }} - chainlinkImage: ${{ env.CHAINLINK_IMAGE }} - chainlinkVersion: ${{ github.sha }} - pyroscopeServer: ${{ matrix.product.pyroscope_env == '' && '' || !startsWith(github.ref, 'refs/tags/') && '' || secrets.QA_PYROSCOPE_INSTANCE }} # Avoid sending blank envs https://github.com/orgs/community/discussions/25725 - pyroscopeEnvironment: ci-smoke-${{ matrix.product }}-base-sepolia - pyroscopeKey: ${{ secrets.QA_PYROSCOPE_KEY }} - lokiEndpoint: ${{ secrets.LOKI_URL }} - lokiTenantId: ${{ vars.LOKI_TENANT_ID }} - lokiBasicAuth: ${{ secrets.LOKI_BASIC_AUTH }} - logstreamLogTargets: ${{ vars.LOGSTREAM_LOG_TARGETS }} - grafanaUrl: "http://localhost:8080/primary" - grafanaDashboardUrl: "/d/ddf75041-1e39-42af-aa46-361fe4c36e9e/ci-e2e-tests-logs" - grafanaBearerToken: ${{ secrets.GRAFANA_INTERNAL_URL_SHORTENER_TOKEN }} - network: "base_sepolia" - httpEndpoints: ${{ secrets.QA_BASE_SEPOLIA_HTTP_URLS }} - wsEndpoints: ${{ secrets.QA_BASE_SEPOLIA_URLS }} - fundingKeys: ${{ secrets.QA_EVM_KEYS }} - - name: Download Tests Binary - uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4 - with: - name: tests - - name: Run Tests - uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests-binary@75a9005952a9e905649cfb5a6971fd9429436acd # v2.3.25 - with: - test_command_to_run: ./tests -test.timeout 30m -test.count=1 -test.parallel=1 -test.run ${{ matrix.test }} - binary_name: tests - cl_repo: ${{ env.CHAINLINK_IMAGE }} - cl_image_tag: ${{ github.sha }} - aws_registries: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }} - dockerhub_username: ${{ secrets.DOCKERHUB_READONLY_USERNAME }} - dockerhub_password: ${{ secrets.DOCKERHUB_READONLY_PASSWORD }} - artifacts_location: ./logs - token: ${{ secrets.GITHUB_TOKEN }} - cache_key_id: core-e2e-${{ env.MOD_CACHE_VERSION }} - cache_restore_only: "true" - QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} - QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} - QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }} - - name: Print failed test summary - if: always() - uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/show-test-summary@75a9005952a9e905649cfb5a6971fd9429436acd # v2.3.25 - with: - test_directory: "./" - - polygon-mumbai-smoke-tests: - environment: integration - if: ${{ github.event.inputs.network == 'All' || github.event.inputs.network == 'Polygon Mumbai' }} - permissions: - checks: write - pull-requests: write - id-token: write - contents: read - needs: [build-chainlink, build-tests] - strategy: - max-parallel: 1 - fail-fast: false - matrix: - include: # https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs#example-adding-configurations - - product: OCR - test: TestOCRBasic - - product: Automation Conditional - test: TestAutomationBasic/registry_2_1_conditional - - product: Automation Log Trigger - test: TestAutomationBasic/registry_2_1_logtrigger - name: Polygon Mumbai ${{ matrix.product }} Tests - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 - with: - fetch-depth: 0 - - name: Setup GAP for Grafana - uses: smartcontractkit/.github/actions/setup-gap@d316f66b2990ea4daa479daa3de6fc92b00f863e # setup-gap@0.3.2 - with: - # aws inputs - aws-region: ${{ secrets.AWS_REGION }} - aws-role-arn: ${{ secrets.AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN }} - api-gateway-host: ${{ secrets.AWS_API_GW_HOST_GRAFANA }} - # other inputs - duplicate-authorization-header: "true" - - name: Prepare Base64 TOML override - uses: ./.github/actions/setup-create-base64-config-live-testnets - with: - runId: ${{ github.run_id }} - testLogCollect: ${{ vars.TEST_LOG_COLLECT }} - chainlinkImage: ${{ env.CHAINLINK_IMAGE }} - chainlinkVersion: ${{ github.sha }} - pyroscopeServer: ${{ matrix.product.pyroscope_env == '' && '' || !startsWith(github.ref, 'refs/tags/') && '' || secrets.QA_PYROSCOPE_INSTANCE }} # Avoid sending blank envs https://github.com/orgs/community/discussions/25725 - pyroscopeEnvironment: ci-smoke-${{ matrix.product }}-polygon-mumbai - pyroscopeKey: ${{ secrets.QA_PYROSCOPE_KEY }} - lokiEndpoint: ${{ secrets.LOKI_URL }} - lokiTenantId: ${{ vars.LOKI_TENANT_ID }} - lokiBasicAuth: ${{ secrets.LOKI_BASIC_AUTH }} - logstreamLogTargets: ${{ vars.LOGSTREAM_LOG_TARGETS }} - grafanaUrl: "http://localhost:8080/primary" - grafanaDashboardUrl: "/d/ddf75041-1e39-42af-aa46-361fe4c36e9e/ci-e2e-tests-logs" - grafanaBearerToken: ${{ secrets.GRAFANA_INTERNAL_URL_SHORTENER_TOKEN }} - network: "polygon_mumbai" - httpEndpoints: ${{ secrets.QA_POLYGON_MUMBAI_HTTP_URLS }} - wsEndpoints: ${{ secrets.QA_POLYGON_MUMBAI_URLS }} - fundingKeys: ${{ secrets.QA_EVM_KEYS }} - - name: Download Tests Binary - uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4 - with: - name: tests - - name: Run Tests - uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests-binary@75a9005952a9e905649cfb5a6971fd9429436acd # v2.3.25 - with: - test_command_to_run: ./tests -test.timeout 30m -test.count=1 -test.parallel=1 -test.run ${{ matrix.test }} - binary_name: tests - cl_repo: ${{ env.CHAINLINK_IMAGE }} - cl_image_tag: ${{ github.sha }} - aws_registries: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }} - dockerhub_username: ${{ secrets.DOCKERHUB_READONLY_USERNAME }} - dockerhub_password: ${{ secrets.DOCKERHUB_READONLY_PASSWORD }} - artifacts_location: ./logs - token: ${{ secrets.GITHUB_TOKEN }} - cache_key_id: core-e2e-${{ env.MOD_CACHE_VERSION }} - cache_restore_only: "true" - QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} - QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} - QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }} - - name: Print failed test summary - if: always() - uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/show-test-summary@75a9005952a9e905649cfb5a6971fd9429436acd # v2.3.25 - with: - test_directory: "./" - - avalanche-fuji-smoke-tests: - environment: integration - if: ${{ github.event.inputs.network == 'All' || github.event.inputs.network == 'Avalanche Fuji' }} - permissions: - checks: write - pull-requests: write - id-token: write - contents: read - needs: [build-chainlink, build-tests] - strategy: - max-parallel: 1 - fail-fast: false - matrix: - include: # https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs#example-adding-configurations - - product: OCR - test: TestOCRBasic - - product: Automation Conditional - test: TestAutomationBasic/registry_2_1_conditional - - product: Automation Log Trigger - test: TestAutomationBasic/registry_2_1_logtrigger - name: Avalanche Fuji ${{ matrix.product }} Tests - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 - with: - fetch-depth: 0 - - name: Setup GAP for Grafana - uses: smartcontractkit/.github/actions/setup-gap@d316f66b2990ea4daa479daa3de6fc92b00f863e # setup-gap@0.3.2 - with: - # aws inputs - aws-region: ${{ secrets.AWS_REGION }} - aws-role-arn: ${{ secrets.AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN }} - api-gateway-host: ${{ secrets.AWS_API_GW_HOST_GRAFANA }} - # other inputs - duplicate-authorization-header: "true" - - name: Prepare Base64 TOML override - uses: ./.github/actions/setup-create-base64-config-live-testnets - with: - runId: ${{ github.run_id }} - testLogCollect: ${{ vars.TEST_LOG_COLLECT }} - chainlinkImage: ${{ env.CHAINLINK_IMAGE }} - chainlinkVersion: ${{ github.sha }} - pyroscopeServer: ${{ matrix.product.pyroscope_env == '' && '' || !startsWith(github.ref, 'refs/tags/') && '' || secrets.QA_PYROSCOPE_INSTANCE }} # Avoid sending blank envs https://github.com/orgs/community/discussions/25725 - pyroscopeEnvironment: ci-smoke-${{ matrix.product }}-avalanche-fuji - pyroscopeKey: ${{ secrets.QA_PYROSCOPE_KEY }} - lokiEndpoint: ${{ secrets.LOKI_URL }} - lokiTenantId: ${{ vars.LOKI_TENANT_ID }} - lokiBasicAuth: ${{ secrets.LOKI_BASIC_AUTH }} - logstreamLogTargets: ${{ vars.LOGSTREAM_LOG_TARGETS }} - grafanaUrl: "http://localhost:8080/primary" - grafanaDashboardUrl: "/d/ddf75041-1e39-42af-aa46-361fe4c36e9e/ci-e2e-tests-logs" - grafanaBearerToken: ${{ secrets.GRAFANA_INTERNAL_URL_SHORTENER_TOKEN }} - network: "avalanche_fuji" - httpEndpoints: ${{ secrets.QA_AVALANCHE_FUJI_HTTP_URLS }} - wsEndpoints: ${{ secrets.QA_AVALANCHE_FUJI_URLS }} - fundingKeys: ${{ secrets.QA_EVM_KEYS }} - - name: Download Tests Binary - uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4 - with: - name: tests - - name: Run Tests - uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests-binary@75a9005952a9e905649cfb5a6971fd9429436acd # v2.3.25 - with: - test_command_to_run: ./tests -test.timeout 30m -test.count=1 -test.parallel=1 -test.run ${{ matrix.test }} - binary_name: tests - cl_repo: ${{ env.CHAINLINK_IMAGE }} - cl_image_tag: ${{ github.sha }} - aws_registries: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }} - dockerhub_username: ${{ secrets.DOCKERHUB_READONLY_USERNAME }} - dockerhub_password: ${{ secrets.DOCKERHUB_READONLY_PASSWORD }} - artifacts_location: ./logs - token: ${{ secrets.GITHUB_TOKEN }} - cache_key_id: core-e2e-${{ env.MOD_CACHE_VERSION }} - cache_restore_only: "true" - QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} - QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} - QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }} - - name: Print failed test summary - if: always() - uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/show-test-summary@75a9005952a9e905649cfb5a6971fd9429436acd # v2.3.25 - with: - test_directory: "./" - - fantom-testnet-smoke-tests: - environment: integration - if: ${{ github.event.inputs.network == 'All' || github.event.inputs.network == 'Fantom Testnet' }} - permissions: - checks: write - pull-requests: write - id-token: write - contents: read - needs: [build-chainlink, build-tests] - strategy: - max-parallel: 1 - fail-fast: false - matrix: - include: # https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs#example-adding-configurations - - product: OCR - test: TestOCRBasic - - product: Automation Conditional - test: TestAutomationBasic/registry_2_1_conditional - - product: Automation Log Trigger - test: TestAutomationBasic/registry_2_1_logtrigger - name: Fantom Testnet ${{ matrix.product }} Tests - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 - with: - fetch-depth: 0 - - name: Setup GAP for Grafana - uses: smartcontractkit/.github/actions/setup-gap@d316f66b2990ea4daa479daa3de6fc92b00f863e # setup-gap@0.3.2 - with: - # aws inputs - aws-region: ${{ secrets.AWS_REGION }} - aws-role-arn: ${{ secrets.AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN }} - api-gateway-host: ${{ secrets.AWS_API_GW_HOST_GRAFANA }} - # other inputs - duplicate-authorization-header: "true" - - name: Prepare Base64 TOML override - uses: ./.github/actions/setup-create-base64-config-live-testnets - with: - runId: ${{ github.run_id }} - testLogCollect: ${{ vars.TEST_LOG_COLLECT }} - chainlinkImage: ${{ env.CHAINLINK_IMAGE }} - chainlinkVersion: ${{ github.sha }} - pyroscopeServer: ${{ matrix.product.pyroscope_env == '' && '' || !startsWith(github.ref, 'refs/tags/') && '' || secrets.QA_PYROSCOPE_INSTANCE }} # Avoid sending blank envs https://github.com/orgs/community/discussions/25725 - pyroscopeEnvironment: ci-smoke-${{ matrix.product }}-fantom-testnet - pyroscopeKey: ${{ secrets.QA_PYROSCOPE_KEY }} - lokiEndpoint: ${{ secrets.LOKI_URL }} - lokiTenantId: ${{ vars.LOKI_TENANT_ID }} - lokiBasicAuth: ${{ secrets.LOKI_BASIC_AUTH }} - logstreamLogTargets: ${{ vars.LOGSTREAM_LOG_TARGETS }} - grafanaUrl: "http://localhost:8080/primary" - grafanaDashboardUrl: "/d/ddf75041-1e39-42af-aa46-361fe4c36e9e/ci-e2e-tests-logs" - grafanaBearerToken: ${{ secrets.GRAFANA_INTERNAL_URL_SHORTENER_TOKEN }} - network: "fantom_testnet" - httpEndpoints: ${{ secrets.QA_FANTOM_TESTNET_HTTP_URLS }} - wsEndpoints: ${{ secrets.QA_FANTOM_TESTNET_URLS }} - fundingKeys: ${{ secrets.QA_EVM_KEYS }} - - name: Download Tests Binary - uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4 - with: - name: tests - - name: Run Tests - uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests-binary@75a9005952a9e905649cfb5a6971fd9429436acd # v2.3.25 - with: - test_command_to_run: ./tests -test.timeout 30m -test.count=1 -test.parallel=1 -test.run ${{ matrix.test }} - binary_name: tests - cl_repo: ${{ env.CHAINLINK_IMAGE }} - cl_image_tag: ${{ github.sha }} - aws_registries: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }} - dockerhub_username: ${{ secrets.DOCKERHUB_READONLY_USERNAME }} - dockerhub_password: ${{ secrets.DOCKERHUB_READONLY_PASSWORD }} - artifacts_location: ./logs - token: ${{ secrets.GITHUB_TOKEN }} - cache_key_id: core-e2e-${{ env.MOD_CACHE_VERSION }} - cache_restore_only: "true" - QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} - QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} - QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }} - - name: Print failed test summary - if: always() - uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/show-test-summary@75a9005952a9e905649cfb5a6971fd9429436acd # v2.3.25 - with: - test_directory: "./" - - celo-alfajores-smoke-tests: - environment: integration - if: ${{ github.event.inputs.network == 'All' || github.event.inputs.network == 'Celo Alfajores' }} - permissions: - checks: write - pull-requests: write - id-token: write - contents: read - needs: [build-chainlink, build-tests] - strategy: - max-parallel: 1 - fail-fast: false - matrix: - include: # https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs#example-adding-configurations - - product: OCR - test: TestOCRBasic - name: Celo Alfajores ${{ matrix.product }} Tests - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 - with: - fetch-depth: 0 - - name: Setup GAP for Grafana - uses: smartcontractkit/.github/actions/setup-gap@d316f66b2990ea4daa479daa3de6fc92b00f863e # setup-gap@0.3.2 - with: - # aws inputs - aws-region: ${{ secrets.AWS_REGION }} - aws-role-arn: ${{ secrets.AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN }} - api-gateway-host: ${{ secrets.AWS_API_GW_HOST_GRAFANA }} - # other inputs - duplicate-authorization-header: "true" - - name: Prepare Base64 TOML override - uses: ./.github/actions/setup-create-base64-config-live-testnets - with: - runId: ${{ github.run_id }} - testLogCollect: ${{ vars.TEST_LOG_COLLECT }} - chainlinkImage: ${{ env.CHAINLINK_IMAGE }} - chainlinkVersion: ${{ github.sha }} - pyroscopeServer: ${{ matrix.product.pyroscope_env == '' && '' || !startsWith(github.ref, 'refs/tags/') && '' || secrets.QA_PYROSCOPE_INSTANCE }} # Avoid sending blank envs https://github.com/orgs/community/discussions/25725 - pyroscopeEnvironment: ci-smoke-${{ matrix.product }}-celo-alfajores - pyroscopeKey: ${{ secrets.QA_PYROSCOPE_KEY }} - lokiEndpoint: ${{ secrets.LOKI_URL }} - lokiTenantId: ${{ vars.LOKI_TENANT_ID }} - lokiBasicAuth: ${{ secrets.LOKI_BASIC_AUTH }} - logstreamLogTargets: ${{ vars.LOGSTREAM_LOG_TARGETS }} - grafanaUrl: "http://localhost:8080/primary" - grafanaDashboardUrl: "/d/ddf75041-1e39-42af-aa46-361fe4c36e9e/ci-e2e-tests-logs" - grafanaBearerToken: ${{ secrets.GRAFANA_INTERNAL_URL_SHORTENER_TOKEN }} - network: "celo_alfajores" - httpEndpoints: ${{ secrets.QA_CELO_ALFAJORES_HTTP_URLS }} - wsEndpoints: ${{ secrets.QA_CELO_ALFAJORES_URLS }} - fundingKeys: ${{ secrets.QA_EVM_KEYS }} - - name: Download Tests Binary - uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4 - with: - name: tests - - name: Run Tests - uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests-binary@75a9005952a9e905649cfb5a6971fd9429436acd # v2.3.25 - with: - test_command_to_run: ./tests -test.timeout 30m -test.count=1 -test.parallel=1 -test.run ${{ matrix.test }} - binary_name: tests - cl_repo: ${{ env.CHAINLINK_IMAGE }} - cl_image_tag: ${{ github.sha }} - aws_registries: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }} - dockerhub_username: ${{ secrets.DOCKERHUB_READONLY_USERNAME }} - dockerhub_password: ${{ secrets.DOCKERHUB_READONLY_PASSWORD }} - artifacts_location: ./logs - token: ${{ secrets.GITHUB_TOKEN }} - cache_key_id: core-e2e-${{ env.MOD_CACHE_VERSION }} - cache_restore_only: "true" - QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} - QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} - QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }} - - name: Print failed test summary - if: always() - uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/show-test-summary@75a9005952a9e905649cfb5a6971fd9429436acd # v2.3.25 - with: - test_directory: "./" - - scroll-sepolia-smoke-tests: - if: false - environment: integration - permissions: - checks: write - pull-requests: write - id-token: write - contents: read - needs: [build-chainlink, build-tests] - strategy: - max-parallel: 1 - fail-fast: false - matrix: - include: # https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs#example-adding-configurations - - product: OCR - test: TestOCRBasic - name: Scroll Sepolia ${{ matrix.product }} Tests - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 - with: - fetch-depth: 0 - - name: Setup GAP for Grafana - uses: smartcontractkit/.github/actions/setup-gap@d316f66b2990ea4daa479daa3de6fc92b00f863e # setup-gap@0.3.2 - with: - # aws inputs - aws-region: ${{ secrets.AWS_REGION }} - aws-role-arn: ${{ secrets.AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN }} - api-gateway-host: ${{ secrets.AWS_API_GW_HOST_GRAFANA }} - # other inputs - duplicate-authorization-header: "true" - - name: Prepare Base64 TOML override - uses: ./.github/actions/setup-create-base64-config-live-testnets - with: - runId: ${{ github.run_id }} - testLogCollect: ${{ vars.TEST_LOG_COLLECT }} - chainlinkImage: ${{ env.CHAINLINK_IMAGE }} - chainlinkVersion: ${{ github.sha }} - pyroscopeServer: ${{ matrix.product.pyroscope_env == '' && '' || !startsWith(github.ref, 'refs/tags/') && '' || secrets.QA_PYROSCOPE_INSTANCE }} # Avoid sending blank envs https://github.com/orgs/community/discussions/25725 - pyroscopeEnvironment: ci-smoke-${{ matrix.product }}-scroll-sepolia - pyroscopeKey: ${{ secrets.QA_PYROSCOPE_KEY }} - lokiEndpoint: ${{ secrets.LOKI_URL }} - lokiTenantId: ${{ vars.LOKI_TENANT_ID }} - lokiBasicAuth: ${{ secrets.LOKI_BASIC_AUTH }} - logstreamLogTargets: ${{ vars.LOGSTREAM_LOG_TARGETS }} - grafanaUrl: "http://localhost:8080/primary" - grafanaDashboardUrl: "/d/ddf75041-1e39-42af-aa46-361fe4c36e9e/ci-e2e-tests-logs" - grafanaBearerToken: ${{ secrets.GRAFANA_INTERNAL_URL_SHORTENER_TOKEN }} - network: "scroll_sepolia" - httpEndpoints: ${{ secrets.QA_SCROLL_SEPOLIA_HTTP_URLS }} - wsEndpoints: ${{ secrets.QA_SCROLL_SEPOLIA_URLS }} - fundingKeys: ${{ secrets.QA_EVM_KEYS }} - - name: Download Tests Binary - uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4 - with: - name: tests - - name: Run Tests - uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests-binary@75a9005952a9e905649cfb5a6971fd9429436acd # v2.3.25 - with: - test_command_to_run: ./tests -test.timeout 30m -test.count=1 -test.parallel=1 -test.run ${{ matrix.test }} - binary_name: tests - cl_repo: ${{ env.CHAINLINK_IMAGE }} - cl_image_tag: ${{ github.sha }} - aws_registries: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }} - dockerhub_username: ${{ secrets.DOCKERHUB_READONLY_USERNAME }} - dockerhub_password: ${{ secrets.DOCKERHUB_READONLY_PASSWORD }} - artifacts_location: ./logs - token: ${{ secrets.GITHUB_TOKEN }} - cache_key_id: core-e2e-${{ env.MOD_CACHE_VERSION }} - cache_restore_only: "true" - QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} - QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} - QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }} - - name: Print failed test summary - if: always() - uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/show-test-summary@75a9005952a9e905649cfb5a6971fd9429436acd # v2.3.25 - with: - test_directory: "./" - - linea-goerli-smoke-tests: - environment: integration - if: ${{ github.event.inputs.network == 'All' || github.event.inputs.network == 'Linea Goerli' }} - permissions: - checks: write - pull-requests: write - id-token: write - contents: read - needs: [build-chainlink, build-tests] - strategy: - max-parallel: 1 - fail-fast: false - matrix: - include: # https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs#example-adding-configurations - - product: OCR - test: TestOCRBasic - name: Linea Goerli ${{ matrix.product }} Tests - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 - with: - fetch-depth: 0 - - name: Setup GAP for Grafana - uses: smartcontractkit/.github/actions/setup-gap@d316f66b2990ea4daa479daa3de6fc92b00f863e # setup-gap@0.3.2 - with: - # aws inputs - aws-region: ${{ secrets.AWS_REGION }} - aws-role-arn: ${{ secrets.AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN }} - api-gateway-host: ${{ secrets.AWS_API_GW_HOST_GRAFANA }} - # other inputs - duplicate-authorization-header: "true" - - name: Prepare Base64 TOML override - uses: ./.github/actions/setup-create-base64-config-live-testnets - with: - runId: ${{ github.run_id }} - testLogCollect: ${{ vars.TEST_LOG_COLLECT }} - chainlinkImage: ${{ env.CHAINLINK_IMAGE }} - chainlinkVersion: ${{ github.sha }} - pyroscopeServer: ${{ matrix.product.pyroscope_env == '' && '' || !startsWith(github.ref, 'refs/tags/') && '' || secrets.QA_PYROSCOPE_INSTANCE }} # Avoid sending blank envs https://github.com/orgs/community/discussions/25725 - pyroscopeEnvironment: ci-smoke-${{ matrix.product }}-linea-goerli - pyroscopeKey: ${{ secrets.QA_PYROSCOPE_KEY }} - lokiEndpoint: ${{ secrets.LOKI_URL }} - lokiTenantId: ${{ vars.LOKI_TENANT_ID }} - lokiBasicAuth: ${{ secrets.LOKI_BASIC_AUTH }} - logstreamLogTargets: ${{ vars.LOGSTREAM_LOG_TARGETS }} - grafanaUrl: "http://localhost:8080/primary" - grafanaDashboardUrl: "/d/ddf75041-1e39-42af-aa46-361fe4c36e9e/ci-e2e-tests-logs" - grafanaBearerToken: ${{ secrets.GRAFANA_INTERNAL_URL_SHORTENER_TOKEN }} - network: "linea_goerli" - httpEndpoints: ${{ secrets.QA_LINEA_GOERLI_HTTP_URLS }} - wsEndpoints: ${{ secrets.QA_LINEA_GOERLI_URLS }} - fundingKeys: ${{ secrets.QA_EVM_KEYS }} - - name: Download Tests Binary - uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4 - with: - name: tests - - name: Run Tests - uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests-binary@75a9005952a9e905649cfb5a6971fd9429436acd # v2.3.25 - with: - test_command_to_run: ./tests -test.timeout 30m -test.count=1 -test.parallel=1 -test.run ${{ matrix.test }} - binary_name: tests - cl_repo: ${{ env.CHAINLINK_IMAGE }} - cl_image_tag: ${{ github.sha }} - aws_registries: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }} - dockerhub_username: ${{ secrets.DOCKERHUB_READONLY_USERNAME }} - dockerhub_password: ${{ secrets.DOCKERHUB_READONLY_PASSWORD }} - artifacts_location: ./logs - token: ${{ secrets.GITHUB_TOKEN }} - cache_key_id: core-e2e-${{ env.MOD_CACHE_VERSION }} - cache_restore_only: "true" - QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} - QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} - QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }} - - name: Print failed test summary - if: always() - uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/show-test-summary@75a9005952a9e905649cfb5a6971fd9429436acd # v2.3.25 - with: - test_directory: "./" diff --git a/.github/workflows/live-vrf-tests.yml b/.github/workflows/live-vrf-tests.yml deleted file mode 100644 index faa4042e66e..00000000000 --- a/.github/workflows/live-vrf-tests.yml +++ /dev/null @@ -1,193 +0,0 @@ -# Funding address: 0xC1107e57082945E28d3202A81B1520DEA3AE6AEC -name: Generic Live Smoke Tests -on: - workflow_dispatch: - inputs: - networks: - description: "Comma-separated list of networks to run on" - required: true - default: "SEPOLIA,OPTIMISM_SEPOLIA,ARBITRUM_SEPOLIA" - test_list: - description: "Comma-separated list of tests to run" - required: true - default: "TestVRFBasic,TestVRFv2Basic,TestVRFv2Plus" - -env: - CHAINLINK_IMAGE: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/chainlink - INTERNAL_DOCKER_REPO: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com - MOD_CACHE_VERSION: 2 - CHAINLINK_NODE_FUNDING: .5 - PYROSCOPE_KEY: ${{ secrets.QA_PYROSCOPE_KEY }} - LOKI_TENANT_ID: ${{ vars.LOKI_TENANT_ID }} - LOKI_URL: ${{ secrets.LOKI_URL }} - LOKI_BASIC_AUTH: ${{ secrets.LOKI_BASIC_AUTH }} - LOGSTREAM_LOG_TARGETS: loki - GRAFANA_URL: ${{ vars.GRAFANA_URL }} - RUN_ID: ${{ github.run_id }} - - CHAINLINK_COMMIT_SHA: ${{ github.sha }} - CHAINLINK_ENV_USER: ${{ github.actor }} - TEST_LOG_LEVEL: debug - -jobs: - - # Build Test Dependencies - - build-chainlink: - environment: integration - permissions: - id-token: write - contents: read - name: Build Chainlink Image - runs-on: ubuntu-latest - steps: - - name: Collect Metrics - id: collect-gha-metrics - uses: smartcontractkit/push-gha-metrics-action@d9da21a2747016b3e13de58c7d4115a3d5c97935 # v3.0.1 - with: - id: live-vrf-build-chainlink - org-id: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} - basic-auth: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} - hostname: ${{ secrets.GRAFANA_INTERNAL_HOST }} - this-job-name: Build Chainlink Image - continue-on-error: true - - name: Checkout the repo - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 - with: - ref: ${{ github.event.pull_request.head.sha || github.event.merge_group.head_sha }} - - name: Build Chainlink Image - uses: ./.github/actions/build-chainlink-image - with: - tag_suffix: "" - dockerfile: core/chainlink.Dockerfile - git_commit_sha: ${{ github.sha }} - GRAFANA_CLOUD_BASIC_AUTH: ${{ secrets.GRAFANA_CLOUD_BASIC_AUTH }} - GRAFANA_CLOUD_HOST: ${{ secrets.GRAFANA_CLOUD_HOST }} - AWS_REGION: ${{ secrets.QA_AWS_REGION }} - AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} - - build-tests: - environment: integration - permissions: - id-token: write - contents: read - name: Build Tests Binary - runs-on: ubuntu-latest - outputs: - matrix: ${{ steps.build-matrix.outputs.matrix }} - steps: - - name: Collect Metrics - id: collect-gha-metrics - uses: smartcontractkit/push-gha-metrics-action@d9da21a2747016b3e13de58c7d4115a3d5c97935 # v3.0.1 - with: - id: live-vrf-build-test-image - org-id: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} - basic-auth: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} - hostname: ${{ secrets.GRAFANA_INTERNAL_HOST }} - this-job-name: Build Tests Binary - continue-on-error: true - - name: Checkout the repo - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 - with: - ref: ${{ github.event.pull_request.head.sha || github.event.merge_group.head_sha }} - - name: Build Network Matrix - id: build-matrix - run: | - NETWORKS="[\"${{ github.event.inputs.networks }}\"]" - NETWORKS="${NETWORKS//,/\",\"}" - echo "matrix=${NETWORKS}" >> "$GITHUB_OUTPUT" - - name: Build Tests - uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/build-tests@75a9005952a9e905649cfb5a6971fd9429436acd # v2.3.25 - with: - test_download_vendor_packages_command: cd ./integration-tests && go mod download - token: ${{ secrets.GITHUB_TOKEN }} - go_mod_path: ./integration-tests/go.mod - go_tags: embed - cache_key_id: core-e2e-${{ env.MOD_CACHE_VERSION }} - cache_restore_only: "true" - binary_name: tests - - - # End Build Test Dependencies - - live-smoke-tests: - environment: integration - permissions: - checks: write - pull-requests: write - id-token: write - contents: read - needs: [build-chainlink, build-tests] - strategy: - fail-fast: false - matrix: - network: ${{fromJson(needs.build-tests.outputs.matrix)}} - name: Smoke Tests on ${{ matrix.network }} - runs-on: ubuntu-latest - steps: - - name: Build Secrets Names - id: build-secrets-names - run: | - echo "HTTP_URLS_SECRET_NAME=QA_${{ matrix.network }}_HTTP_URLS" >> $GITHUB_ENV - echo "URLS_SECRET_NAME=QA_${{ matrix.network }}_URLS" >> $GITHUB_ENV - - name: Split Test Names - id: split_list - run: | - IFS=',' read -ra ADDR <<< "${{ inputs.test_list }}" - echo "test_list=${ADDR[*]}" >> $GITHUB_ENV - - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 - with: - fetch-depth: 0 - - name: Setup GAP for Grafana - uses: smartcontractkit/.github/actions/setup-gap@d316f66b2990ea4daa479daa3de6fc92b00f863e # setup-gap@0.3.2 - with: - # aws inputs - aws-region: ${{ secrets.AWS_REGION }} - aws-role-arn: ${{ secrets.AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN }} - api-gateway-host: ${{ secrets.AWS_API_GW_HOST_GRAFANA }} - # other inputs - duplicate-authorization-header: "true" - - name: Prepare Base64 TOML override - uses: ./.github/actions/setup-create-base64-config-live-testnets - with: - runId: ${{ github.run_id }} - testLogCollect: ${{ vars.TEST_LOG_COLLECT }} - chainlinkImage: ${{ env.CHAINLINK_IMAGE }} - chainlinkVersion: ${{ github.sha }} - lokiEndpoint: ${{ secrets.LOKI_URL }} - lokiTenantId: ${{ vars.LOKI_TENANT_ID }} - lokiBasicAuth: ${{ secrets.LOKI_BASIC_AUTH }} - logstreamLogTargets: ${{ vars.LOGSTREAM_LOG_TARGETS }} - grafanaUrl: "http://localhost:8080/primary" - grafanaDashboardUrl: "/d/ddf75041-1e39-42af-aa46-361fe4c36e9e/ci-e2e-tests-logs" - grafanaBearerToken: ${{ secrets.GRAFANA_INTERNAL_URL_SHORTENER_TOKEN }} - network: ${{ matrix.network }} - httpEndpoints: ${{ secrets[env.HTTP_URLS_SECRET_NAME] }} - wsEndpoints: ${{ secrets[env.URLS_SECRET_NAME] }} - fundingKeys: ${{ secrets.QA_EVM_KEYS }} - - name: Download Tests Binary - uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4 - with: - name: tests - - name: Run Tests - uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests-binary@75a9005952a9e905649cfb5a6971fd9429436acd # v2.3.25 - with: - test_command_to_run: ./tests -test.v -test.timeout 4h -test.count=1 -test.parallel=1 -test.run ${{ env.test_list }} - binary_name: tests - cl_repo: ${{ env.CHAINLINK_IMAGE }} - cl_image_tag: ${{ github.sha }} - aws_registries: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }} - dockerhub_username: ${{ secrets.DOCKERHUB_READONLY_USERNAME }} - dockerhub_password: ${{ secrets.DOCKERHUB_READONLY_PASSWORD }} - artifacts_location: ./logs - token: ${{ secrets.GITHUB_TOKEN }} - cache_key_id: core-e2e-${{ env.MOD_CACHE_VERSION }} - cache_restore_only: "true" - QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} - QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} - QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }} - - name: Print failed test summary - if: always() - uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/show-test-summary@75a9005952a9e905649cfb5a6971fd9429436acd # v2.3.25 - with: - test_directory: "./" \ No newline at end of file diff --git a/.github/workflows/on-demand-keeper-smoke-tests.yml b/.github/workflows/on-demand-keeper-smoke-tests.yml deleted file mode 100644 index 6af4d1be0c3..00000000000 --- a/.github/workflows/on-demand-keeper-smoke-tests.yml +++ /dev/null @@ -1,292 +0,0 @@ -name: On Demand Keeper Smoke Tests -run-name: On Demand Keeper Smoke Tests ${{ inputs.distinct_run_name && inputs.distinct_run_name || '' }} -on: - workflow_dispatch: - inputs: - distinct_run_name: - description: 'A unique identifier for this run, only use from other repos' - required: false - type: string - -# Only run 1 of this workflow at a time per PR -concurrency: - group: on-demand-keeper-smoke-tests-${{ github.ref }}-${{ inputs.distinct_run_name }} - cancel-in-progress: true - -env: - # for run-test variables and environment - ENV_JOB_IMAGE: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/chainlink-tests:${{ inputs.evm-ref || github.sha }} - CHAINLINK_IMAGE: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/chainlink - TEST_SUITE: smoke - TEST_ARGS: -test.timeout 12m - INTERNAL_DOCKER_REPO: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com - MOD_CACHE_VERSION: 2 - COLLECTION_ID: chainlink-e2e-tests - -jobs: - build-chainlink: - environment: integration - permissions: - id-token: write - contents: read - strategy: - matrix: - image: - - name: "" - dockerfile: core/chainlink.Dockerfile - tag-suffix: "" - name: Build Chainlink Image ${{ matrix.image.name }} - runs-on: ubuntu22.04-16cores-64GB - steps: - - name: Collect Metrics - id: collect-gha-metrics - uses: smartcontractkit/push-gha-metrics-action@d9da21a2747016b3e13de58c7d4115a3d5c97935 # v3.0.1 - with: - id: ${{ env.COLLECTION_ID }}-build-chainlink - org-id: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} - basic-auth: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} - hostname: ${{ secrets.GRAFANA_INTERNAL_HOST }} - this-job-name: Build Chainlink Image ${{ matrix.image.name }} - continue-on-error: true - - name: Checkout the repo - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 - with: - repository: smartcontractkit/chainlink - ref: ${{ inputs.cl_ref || github.event.pull_request.head.sha || github.event.merge_group.head_sha }} - - name: Build Chainlink Image - uses: ./.github/actions/build-chainlink-image - with: - tag_suffix: ${{ matrix.image.tag-suffix }} - dockerfile: ${{ matrix.image.dockerfile }} - git_commit_sha: ${{ inputs.evm-ref || github.sha }} - AWS_REGION: ${{ secrets.QA_AWS_REGION }} - AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} - dep_evm_sha: ${{ inputs.evm-ref }} - - compare-tests: - runs-on: ubuntu-latest - name: Build Automation Test List - outputs: - automation-matrix: ${{ env.AUTOMATION_JOB_MATRIX_JSON }} - steps: - - name: Checkout the repo - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 - with: - repository: smartcontractkit/chainlink - ref: ${{ inputs.cl_ref }} - - name: Compare Test Lists - run: | - cd ./integration-tests - ./scripts/compareTestList.sh ./smoke/keeper_test.go - - name: Build Test Matrix Lists - id: build-test-matrix-list - run: | - cd ./integration-tests - KEEPER_JOB_MATRIX_JSON=$(./scripts/buildTestMatrixList.sh ./smoke/keeper_test.go keeper ubuntu-latest 1) - echo "AUTOMATION_JOB_MATRIX_JSON=${KEEPER_JOB_MATRIX_JSON}" >> $GITHUB_ENV - - eth-smoke-tests-matrix-automation: - if: ${{ !contains(join(github.event.pull_request.labels.*.name, ' '), 'skip-smoke-tests') }} - environment: integration - permissions: - checks: write - pull-requests: write - id-token: write - contents: read - needs: [build-chainlink, compare-tests] - env: - SELECTED_NETWORKS: SIMULATED,SIMULATED_1,SIMULATED_2 - CHAINLINK_COMMIT_SHA: ${{ inputs.evm-ref || github.sha }} - CHAINLINK_ENV_USER: ${{ github.actor }} - TEST_LOG_LEVEL: debug - strategy: - fail-fast: false - matrix: - product: ${{fromJson(needs.compare-tests.outputs.automation-matrix)}} - runs-on: ${{ matrix.product.os }} - name: ETH Smoke Tests ${{ matrix.product.name }} - steps: - - name: Collect Metrics - id: collect-gha-metrics - uses: smartcontractkit/push-gha-metrics-action@d9da21a2747016b3e13de58c7d4115a3d5c97935 # v3.0.1 - with: - id: ${{ env.COLLECTION_ID }}-matrix-${{ matrix.product.name }} - basic-auth: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} - hostname: ${{ secrets.GRAFANA_INTERNAL_HOST }} - org-id: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} - this-job-name: ETH Smoke Tests ${{ matrix.product.name }} - test-results-file: '{"testType":"go","filePath":"/tmp/gotest.log"}' - continue-on-error: true - - name: Checkout the repo - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 - with: - repository: smartcontractkit/chainlink - ref: ${{ inputs.cl_ref || github.event.pull_request.head.sha || github.event.merge_group.head_sha }} - - name: Build Go Test Command - id: build-go-test-command - run: | - # if the matrix.product.run is set, use it for a different command - if [ "${{ matrix.product.run }}" != "" ]; then - echo "run_command=${{ matrix.product.run }} ./smoke/${{ matrix.product.file }}_test.go" >> "$GITHUB_OUTPUT" - else - echo "run_command=./smoke/${{ matrix.product.name }}_test.go" >> "$GITHUB_OUTPUT" - fi - - name: Prepare Base64 TOML override - uses: ./.github/actions/setup-create-base64-config - with: - runId: ${{ github.run_id }} - testLogCollect: ${{ vars.TEST_LOG_COLLECT }} - selectedNetworks: ${{ env.SELECTED_NETWORKS }} - chainlinkVersion: ${{ inputs.evm-ref || github.sha }} - logstreamLogTargets: ${{ vars.LOGSTREAM_LOG_TARGETS }} - - ## Run this step when changes that require tests to be run are made - - name: Run Tests - uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests@75a9005952a9e905649cfb5a6971fd9429436acd # v2.3.25 - with: - test_command_to_run: cd ./integration-tests && go test -timeout 30m -count=1 -json -test.parallel=${{ matrix.product.nodes }} ${{ steps.build-go-test-command.outputs.run_command }} 2>&1 | tee /tmp/gotest.log | gotestloghelper -ci -singlepackage -hidepassingtests=false -hidepassinglogs - test_download_vendor_packages_command: cd ./integration-tests && go mod download - cl_repo: ${{ env.CHAINLINK_IMAGE }} - cl_image_tag: ${{ inputs.evm-ref || github.sha }} - aws_registries: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }} - artifacts_name: ${{ matrix.product.name }}-test-logs - artifacts_location: | - ./integration-tests/smoke/logs/ - /tmp/gotest.log - publish_check_name: ${{ matrix.product.name }} - token: ${{ secrets.GITHUB_TOKEN }} - go_mod_path: ./integration-tests/go.mod - cache_key_id: core-e2e-${{ env.MOD_CACHE_VERSION }} - cache_restore_only: "true" - QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} - QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} - QA_KUBECONFIG: "" - should_tidy: "false" - go_coverage_src_dir: /var/tmp/go-coverage - go_coverage_dest_dir: ${{ github.workspace }}/.covdata - DEFAULT_CHAINLINK_IMAGE: ${{ env.CHAINLINK_IMAGE }} - DEFAULT_LOKI_TENANT_ID: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} - DEFAULT_LOKI_ENDPOINT: https://${{ secrets.GRAFANA_INTERNAL_HOST }}/loki/api/v1/push - DEFAULT_LOKI_BASIC_AUTH: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} - DEFAULT_GRAFANA_BASE_URL: ${{ vars.GRAFANA_URL }} - DEFAULT_GRAFANA_DASHBOARD_URL: "/d/ddf75041-1e39-42af-aa46-361fe4c36e9e/ci-e2e-tests-logs" - DEFAULT_GRAFANA_BEARER_TOKEN: ${{ secrets.GRAFANA_INTERNAL_URL_SHORTENER_TOKEN }} - DEFAULT_PYROSCOPE_SERVER_URL: ${{ matrix.product.pyroscope_env == '' && '' || !startsWith(github.ref, 'refs/tags/') && '' || secrets.QA_PYROSCOPE_INSTANCE }} # Avoid sending blank envs https://github.com/orgs/community/discussions/25725 - DEFAULT_PYROSCOPE_KEY: ${{ secrets.QA_PYROSCOPE_KEY }} - DEFAULT_PYROSCOPE_ENVIRONMENT: ${{ matrix.product.pyroscope_env }} - DEFAULT_PYROSCOPE_ENABLED: ${{ matrix.product.pyroscope_env == '' || !startsWith(github.ref, 'refs/tags/') && 'false' || 'true' }} - - - name: Upload Coverage Data - uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3 - with: - name: cl-node-coverage-data-${{ matrix.product.name }} - path: .covdata - retention-days: 1 - - - name: Print failed test summary - if: always() - uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/show-test-summary@5dd916d08c03cb5f9a97304f4f174820421bb946 # v2.3.11 - - ### Used to check the required checks box when the matrix completes - eth-smoke-tests: - if: always() - runs-on: ubuntu-latest - name: ETH Smoke Tests - needs: [eth-smoke-tests-matrix-automation] - steps: - - name: Check smoke test matrix status - if: needs.eth-smoke-tests-matrix-automation.result != 'success' - run: | - echo "Automation: ${{ needs.eth-smoke-tests-matrix-automation.result }}" - exit 1 - - name: Collect Metrics - if: always() - id: collect-gha-metrics - uses: smartcontractkit/push-gha-metrics-action@d9da21a2747016b3e13de58c7d4115a3d5c97935 # v3.0.1 - with: - id: ${{ env.COLLECTION_ID }}-matrix-results - org-id: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} - basic-auth: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} - hostname: ${{ secrets.GRAFANA_INTERNAL_HOST }} - this-job-name: ETH Smoke Tests - matrix-aggregator-status: ${{ needs.eth-smoke-tests-matrix.result }} - continue-on-error: true - - cleanup: - name: Clean up integration environment deployments - if: always() - needs: [eth-smoke-tests] - runs-on: ubuntu-latest - steps: - - name: Checkout repo - if: ${{ github.event_name == 'pull_request' }} - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 - with: - repository: smartcontractkit/chainlink - ref: ${{ inputs.cl_ref }} - - - name: 🧼 Clean up Environment - if: ${{ github.event_name == 'pull_request' }} - uses: ./.github/actions/delete-deployments - with: - environment: integration - ref: ${{ github.head_ref }} # See https://github.com/github/docs/issues/15319#issuecomment-1476705663 - - - name: Collect Metrics - if: ${{ github.event_name == 'pull_request' }} - id: collect-gha-metrics - uses: smartcontractkit/push-gha-metrics-action@d9da21a2747016b3e13de58c7d4115a3d5c97935 # v3.0.1 - with: - id: ${{ env.COLLECTION_ID }}-env-cleanup - org-id: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} - basic-auth: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} - hostname: ${{ secrets.GRAFANA_INTERNAL_HOST }} - this-job-name: Clean up integration environment deployments - continue-on-error: true - - show-coverage: - name: Show Chainlink Node Go Coverage - if: always() - needs: [cleanup] - runs-on: ubuntu-latest - steps: - - name: Checkout the repo - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 - with: - repository: smartcontractkit/chainlink - ref: ${{ inputs.cl_ref || github.event.pull_request.head.sha || github.event.merge_group.head_sha }} - - name: Download All Artifacts - uses: actions/download-artifact@9c19ed7fe5d278cd354c7dfd5d3b88589c7e2395 # v4.1.6 - with: - path: cl-node-coverage-data - pattern: cl-node-coverage-data-* - merge-multiple: true - - name: Show Coverage - run: go run ./integration-tests/scripts/show_coverage.go "${{ github.workspace }}/cl-node-coverage-data/*/merged" - - # Run the setup if the matrix finishes but this time save the cache if we have a cache hit miss - # this will also only run if both of the matrix jobs pass - eth-smoke-go-mod-cache: - - environment: integration - needs: [eth-smoke-tests] - runs-on: ubuntu-latest - name: ETH Smoke Tests Go Mod Cache - continue-on-error: true - steps: - - name: Checkout the repo - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 - with: - repository: smartcontractkit/chainlink - ref: ${{ inputs.cl_ref || github.event.pull_request.head.sha || github.event.merge_group.head_sha }} - - name: Run Setup - uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/setup-go@5dd916d08c03cb5f9a97304f4f174820421bb946 # v2.3.11 - with: - test_download_vendor_packages_command: | - cd ./integration-tests - go mod download - # force download of test dependencies - go test -run=NonExistentTest ./smoke/... || echo "ignore expected test failure" - go_mod_path: ./integration-tests/go.mod - cache_key_id: core-e2e-${{ env.MOD_CACHE_VERSION }} - cache_restore_only: "false" \ No newline at end of file diff --git a/.github/workflows/on-demand-log-poller.yml b/.github/workflows/on-demand-log-poller.yml deleted file mode 100644 index 1685c7e4556..00000000000 --- a/.github/workflows/on-demand-log-poller.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: On Demand Log Poller Consistency Test -on: - workflow_dispatch: - inputs: - base64Config: - description: base64-ed config - required: true - type: string - -jobs: - test: - env: - REF_NAME: ${{ github.head_ref || github.ref_name }} - runs-on: ubuntu22.04-8cores-32GB - steps: - - name: Add masks and export base64 config - run: | - BASE64_CONFIG_OVERRIDE=$(jq -r '.inputs.base64Config' $GITHUB_EVENT_PATH) - echo ::add-mask::$BASE64_CONFIG_OVERRIDE - echo "BASE64_CONFIG_OVERRIDE=$BASE64_CONFIG_OVERRIDE" >> $GITHUB_ENV - - name: Checkout the repo - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 - with: - ref: ${{ env.REF_NAME }} - - name: Setup Go - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 - with: - go-version-file: "integration-tests/go.mod" - cache: true - - name: Run tests - run: | - cd integration-tests - go mod download - go test -v -timeout 5h -v -count=1 -run ^TestLogPollerFewFiltersFixedDepth$ ./smoke/log_poller_test.go diff --git a/.github/workflows/on-demand-ocr-soak-test.yml b/.github/workflows/on-demand-ocr-soak-test.yml index 8eb498f68cd..fd3da6296c3 100644 --- a/.github/workflows/on-demand-ocr-soak-test.yml +++ b/.github/workflows/on-demand-ocr-soak-test.yml @@ -3,109 +3,68 @@ on: workflow_dispatch: inputs: testToRun: - description: Select a test to run + description: Select a test to run from .github/e2e-tests.yml required: true default: TestOCRSoak type: choice options: - - TestOCRv1Soak - - TestOCRv2Soak - - TestForwarderOCRv1Soak - - TestForwarderOCRv2Soak - - TestOCRSoak_GethReorgBelowFinality_FinalityTagDisabled - - TestOCRSoak_GethReorgBelowFinality_FinalityTagEnabled - - TestOCRSoak_GasSpike - - TestOCRSoak_ChangeBlockGasLimit - - TestOCRSoak_RPCDownForAllCLNodes - - TestOCRSoak_RPCDownForHalfCLNodes - base64Config: - description: base64-ed config + - soak/ocr_test.go:TestOCRv1Soak + - soak/ocr_test.go:TestOCRv2Soak + - soak/ocr_test.go:TestForwarderOCRv1Soak + - soak/ocr_test.go:TestForwarderOCRv2Soak + - soak/ocr_test.go:TestOCRSoak_GethReorgBelowFinality_FinalityTagDisabled + - soak/ocr_test.go:TestOCRSoak_GethReorgBelowFinality_FinalityTagEnabled + - soak/ocr_test.go:TestOCRSoak_GasSpike + - soak/ocr_test.go:TestOCRSoak_ChangeBlockGasLimit + - soak/ocr_test.go:TestOCRSoak_RPCDownForAllCLNodes + - soak/ocr_test.go:TestOCRSoak_RPCDownForHalfCLNodes + test_config_override_path: + description: Path to a test config file used to override the default test config + required: false + type: string + test_secrets_override_key: + description: 'Key to run tests with custom test secrets' + required: false + type: string + chainlink_version: + description: Chainlink image version to use + default: develop required: true type: string slackMemberID: description: Slack Member ID (Not your @) required: true - default: U01A2B2C3D4 - type: string - + default: U01A2B2C3D4 + jobs: - ocr_soak_test: - name: OCR Soak Test - environment: integration - runs-on: ubuntu-latest - permissions: - checks: write - pull-requests: write - id-token: write - contents: read - env: - CHAINLINK_ENV_USER: ${{ github.actor }} + run-e2e-tests-workflow: + name: Run E2E Tests + uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@827d85b57065211ddd254457a7cf21581d85092d + with: + test_path: .github/e2e-tests.yml + test_ids: ${{ inputs.testToRun}} + test_config_override_path: ${{ inputs.test_config_override_path }} + chainlink_version: ${{ inputs.chainlink_version }} + SLACK_USER: ${{ inputs.slackMemberID }} + secrets: + QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} + QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} + QA_AWS_ACCOUNT_NUMBER: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }} + PROD_AWS_ACCOUNT_NUMBER: ${{ secrets.AWS_ACCOUNT_ID_PROD }} + QA_PYROSCOPE_INSTANCE: ${{ secrets.QA_PYROSCOPE_INSTANCE }} + QA_PYROSCOPE_KEY: ${{ secrets.QA_PYROSCOPE_KEY }} + QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }} + GRAFANA_INTERNAL_TENANT_ID: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} + GRAFANA_INTERNAL_BASIC_AUTH: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} + GRAFANA_INTERNAL_HOST: ${{ secrets.GRAFANA_INTERNAL_HOST }} + GRAFANA_INTERNAL_URL_SHORTENER_TOKEN: ${{ secrets.GRAFANA_INTERNAL_URL_SHORTENER_TOKEN }} + LOKI_TENANT_ID: ${{ secrets.LOKI_TENANT_ID }} + LOKI_URL: https://${{ secrets.GRAFANA_INTERNAL_HOST }}/loki/api/v1/push + LOKI_BASIC_AUTH: ${{ secrets.LOKI_BASIC_AUTH }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + AWS_REGION: ${{ secrets.QA_AWS_REGION }} + AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN: ${{ secrets.AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN }} + AWS_API_GW_HOST_GRAFANA: ${{ secrets.AWS_API_GW_HOST_GRAFANA }} + TEST_SECRETS_OVERRIDE_BASE64: ${{ secrets[inputs.test_secrets_override_key] }} SLACK_API_KEY: ${{ secrets.QA_SLACK_API_KEY }} SLACK_CHANNEL: ${{ secrets.QA_SLACK_CHANNEL }} - TEST_LOG_LEVEL: debug - REF_NAME: ${{ github.head_ref || github.ref_name }} - ENV_JOB_IMAGE_BASE: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/chainlink-tests - steps: - - name: Collect Metrics - id: collect-gha-metrics - uses: smartcontractkit/push-gha-metrics-action@d9da21a2747016b3e13de58c7d4115a3d5c97935 # v3.0.1 - with: - id: on-demand-ocr-soak-test - org-id: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} - basic-auth: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} - hostname: ${{ secrets.GRAFANA_INTERNAL_HOST }} - this-job-name: ${{ inputs.network }} OCR Soak Test - continue-on-error: true - - name: Checkout the repo - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 - with: - ref: ${{ env.REF_NAME }} - - name: Get Slack config and mask base64 config - run: | - SLACK_USER=$(jq -r '.inputs.slackMemberID' $GITHUB_EVENT_PATH) - echo ::add-mask::$SLACK_USER - echo SLACK_USER=$SLACK_USER >> $GITHUB_ENV - - BASE64_CONFIG_OVERRIDE=$(jq -r '.inputs.base64Config' $GITHUB_EVENT_PATH) - echo ::add-mask::$BASE64_CONFIG_OVERRIDE - echo "BASE64_CONFIG_OVERRIDE=$BASE64_CONFIG_OVERRIDE" >> $GITHUB_ENV - - name: Parse base64 config - uses: ./.github/actions/setup-parse-base64-config - with: - base64Config: ${{ env.BASE64_CONFIG_OVERRIDE }} - - name: Setup Push Tag - shell: bash - run: | - echo "### chainlink image used for this test run :link:" >>$GITHUB_STEP_SUMMARY - echo "\`${{ env.CHAINLINK_IMAGE }}\`" >>$GITHUB_STEP_SUMMARY - echo "### chainlink-tests image tag for this test run :ship:" >>$GITHUB_STEP_SUMMARY - echo "\`${GITHUB_SHA}\`" >>$GITHUB_STEP_SUMMARY - echo "### Networks on which test was run" >>$GITHUB_STEP_SUMMARY - echo "\`${{ env.NETWORKS }}\`" >>$GITHUB_STEP_SUMMARY - - name: Build Image - uses: ./.github/actions/build-test-image - with: - QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} - QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} - QA_AWS_ACCOUNT_NUMBER: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }} - - name: Run Tests - uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests@75a9005952a9e905649cfb5a6971fd9429436acd # v2.3.25 - env: - DETACH_RUNNER: true - TEST_SUITE: soak - TEST_ARGS: -test.timeout 900h -test.memprofile memprofile.out -test.cpuprofile profile.out - ENV_JOB_IMAGE: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/chainlink-tests:${{ github.sha }} - # We can comment these out when we have a stable soak test and aren't worried about resource consumption - TEST_UPLOAD_CPU_PROFILE: true - TEST_UPLOAD_MEM_PROFILE: true - with: - test_command_to_run: cd ./integration-tests && go test -v -count=1 -run ^${{ github.event.inputs.testToRun }}$ ./soak - test_download_vendor_packages_command: make gomod - cl_repo: ${{ env.CHAINLINK_IMAGE }} - cl_image_tag: ${{ env.CHAINLINK_VERSION }} - token: ${{ secrets.GITHUB_TOKEN }} - should_cleanup: false - go_mod_path: ./integration-tests/go.mod - QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} - QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} - QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }} diff --git a/.github/workflows/on-demand-vrfv2-eth2-clients-test.yml b/.github/workflows/on-demand-vrfv2-eth2-clients-test.yml deleted file mode 100644 index f1de054cd82..00000000000 --- a/.github/workflows/on-demand-vrfv2-eth2-clients-test.yml +++ /dev/null @@ -1,70 +0,0 @@ -name: On Demand VRFV2 Smoke Test (Ethereum clients) -on: - workflow_dispatch: - inputs: - base64Config: - description: base64-ed config - required: true - type: string - -jobs: - vrfv2_smoke_test: - name: VRFV2 Smoke Test with custom EL client client - environment: integration - runs-on: ubuntu22.04-8cores-32GB - permissions: - checks: write - pull-requests: write - id-token: write - contents: read - env: - TEST_LOG_LEVEL: debug - REF_NAME: ${{ github.head_ref || github.ref_name }} - steps: - - name: Checkout code - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 - with: - fetch-depth: 0 - - name: Mask base64 config - run: | - BASE64_CONFIG_OVERRIDE=$(jq -r '.inputs.base64Config' $GITHUB_EVENT_PATH) - echo ::add-mask::$BASE64_CONFIG_OVERRIDE - echo "BASE64_CONFIG_OVERRIDE=$BASE64_CONFIG_OVERRIDE" >> $GITHUB_ENV - - name: Parse base64 config - uses: ./.github/actions/setup-parse-base64-config - with: - base64Config: ${{ env.BASE64_CONFIG_OVERRIDE }} - - name: Send details to Step Summary - shell: bash - run: | - echo "### chainlink image used for this test run :link:" >>$GITHUB_STEP_SUMMARY - echo "\`${{ env.CHAINLINK_IMAGE }}\`" >>$GITHUB_STEP_SUMMARY - echo "### chainlink-tests image tag for this test run :ship:" >>$GITHUB_STEP_SUMMARY - echo "\`${GITHUB_SHA}\`" >>$GITHUB_STEP_SUMMARY - echo "### Networks on which test was run" >>$GITHUB_STEP_SUMMARY - echo "\`${{ env.NETWORKS }}\`" >>$GITHUB_STEP_SUMMARY - echo "### Execution client used" >>$GITHUB_STEP_SUMMARY - echo "\`${{ env.ETH2_EL_CLIENT }}\`" >>$GITHUB_STEP_SUMMARY - - name: Run Tests - uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests@75a9005952a9e905649cfb5a6971fd9429436acd # v2.3.25 - with: - test_command_to_run: cd ./integration-tests && go test -timeout 30m -count=1 -json -run TestVRFv2Basic ./smoke/vrfv2_test.go 2>&1 | tee /tmp/gotest.log | gotestloghelper -ci -singlepackage -hidepassingtests=false -hidepassinglogs - test_download_vendor_packages_command: cd ./integration-tests && go mod download - cl_repo: ${{ env.CHAINLINK_IMAGE }} - cl_image_tag: ${{ env.CHAINLINK_VERSION }} - aws_registries: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }} - artifacts_name: vrf-test-logs - artifacts_location: ./integration-tests/smoke/logs/ - token: ${{ secrets.GITHUB_TOKEN }} - go_mod_path: ./integration-tests/go.mod - should_cleanup: false - QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} - QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} - QA_KUBECONFIG: "" - DEFAULT_CHAINLINK_IMAGE: ${{ env.CHAINLINK_IMAGE }} - DEFAULT_LOKI_TENANT_ID: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} - DEFAULT_LOKI_ENDPOINT: https://${{ secrets.GRAFANA_INTERNAL_HOST }}/loki/api/v1/push - DEFAULT_LOKI_BASIC_AUTH: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} - DEFAULT_GRAFANA_BASE_URL: "http://localhost:8080/primary" - DEFAULT_GRAFANA_DASHBOARD_URL: "/d/ddf75041-1e39-42af-aa46-361fe4c36e9e/ci-e2e-tests-logs" - DEFAULT_GRAFANA_BEARER_TOKEN: ${{ secrets.GRAFANA_INTERNAL_URL_SHORTENER_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/on-demand-vrfv2-performance-test.yml b/.github/workflows/on-demand-vrfv2-performance-test.yml index 6bcc378d9da..c3b0f5dd65f 100644 --- a/.github/workflows/on-demand-vrfv2-performance-test.yml +++ b/.github/workflows/on-demand-vrfv2-performance-test.yml @@ -2,10 +2,6 @@ name: On Demand VRFV2 Performance Test on: workflow_dispatch: inputs: - base64Config: - description: base64-ed config - required: true - type: string performanceTestType: description: Performance Test Type of test to run type: choice @@ -19,75 +15,85 @@ on: description: "Regex for tests to run" required: false default: "(TestVRFV2Performance)" + test_config_override_path: + description: Path to a test config file used to override the default test config + required: false + type: string + test_secrets_override_key: + description: 'Key to run tests with custom test secrets' + required: false + type: string + notify_user_id_on_failure: + description: 'Enter Slack user ID to notify on test failure' + required: false + type: string + jobs: - vrfv2_performance_test: - name: VRFV2 Performance Test - environment: integration - runs-on: ubuntu22.04-8cores-32GB - permissions: - checks: write - pull-requests: write - id-token: write - contents: read - env: - LOKI_URL: ${{ secrets.LOKI_URL }} + set-tests-to-run: + name: Set tests to run + runs-on: ubuntu-latest + outputs: + test_list: ${{ steps.set-tests.outputs.test_list }} + steps: + - name: Generate Test List JSON + id: set-tests + run: | + TEST_CMD='cd integration-tests/load && go test -v -count=1 -timeout 24h -run "${{ inputs.test_list_regex }}" ./vrfv2' + TEST_CONFIG_OVERRIDE_PATH=${{ inputs.test_config_override_path }} + TEST_TYPE=${{ inputs.performanceTestType }} + + TEST_LIST=$(jq -n -c \ + --arg test_cmd "$TEST_CMD" \ + --arg test_config_override_path "$TEST_CONFIG_OVERRIDE_PATH" \ + --arg TEST_TYPE "$TEST_TYPE" \ + '{ + "tests": [ + { + "id": "TestVRFv2Plus_Performance", + "path": "integration-tests/load/vrfv2plus/vrfv2plus_test.go", + "runs_on": "ubuntu22.04-8cores-32GB", + "test_env_type": "docker", + "test_cmd": $test_cmd, + "test_config_override_path": $test_config_override_path, + "test_env_vars": { + "TEST_TYPE": $TEST_TYPE + } + } + ] + }') + + echo "test_list=$TEST_LIST" >> $GITHUB_OUTPUT + + run-e2e-tests-workflow: + name: Run E2E Tests + needs: set-tests-to-run + uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@827d85b57065211ddd254457a7cf21581d85092d + with: + custom_test_list_json: ${{ needs.set-tests-to-run.outputs.test_list }} + chainlink_version: ${{ inputs.chainlink_version }} + slack_notification_after_tests: always + slack_notification_after_tests_name: "VRF V2 Performance Tests with test config: ${{ inputs.test_config_override_path || 'default' }}" + slack_notification_after_tests_notify_user_id_on_failure: ${{ inputs.notify_user_id_on_failure }} + secrets: + QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} + QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} + QA_AWS_ACCOUNT_NUMBER: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }} + PROD_AWS_ACCOUNT_NUMBER: ${{ secrets.AWS_ACCOUNT_ID_PROD }} + QA_PYROSCOPE_INSTANCE: ${{ secrets.QA_PYROSCOPE_INSTANCE }} + QA_PYROSCOPE_KEY: ${{ secrets.QA_PYROSCOPE_KEY }} + QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }} + GRAFANA_INTERNAL_TENANT_ID: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} + GRAFANA_INTERNAL_BASIC_AUTH: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} + GRAFANA_INTERNAL_HOST: ${{ secrets.GRAFANA_INTERNAL_HOST }} + GRAFANA_INTERNAL_URL_SHORTENER_TOKEN: ${{ secrets.GRAFANA_INTERNAL_URL_SHORTENER_TOKEN }} LOKI_TENANT_ID: ${{ secrets.LOKI_TENANT_ID }} + LOKI_URL: https://${{ secrets.GRAFANA_INTERNAL_HOST }}/loki/api/v1/push LOKI_BASIC_AUTH: ${{ secrets.LOKI_BASIC_AUTH }} - TEST_TYPE: ${{ inputs.performanceTestType }} - TEST_LOG_LEVEL: debug - REF_NAME: ${{ github.head_ref || github.ref_name }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + AWS_REGION: ${{ secrets.QA_AWS_REGION }} + AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN: ${{ secrets.AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN }} + AWS_API_GW_HOST_GRAFANA: ${{ secrets.AWS_API_GW_HOST_GRAFANA }} + TEST_SECRETS_OVERRIDE_BASE64: ${{ secrets[inputs.test_secrets_override_key] }} + SLACK_BOT_TOKEN: ${{ secrets.QA_SLACK_API_KEY }} SLACK_API_KEY: ${{ secrets.QA_SLACK_API_KEY }} - SLACK_CHANNEL: ${{ secrets.QA_VRF_SLACK_CHANNEL }} - GRAFANA_URL: "http://localhost:8080/primary" - GRAFANA_DASHBOARD_URL: "/d/ddf75041-1e39-42af-aa46-361fe4c36e9e/ci-e2e-tests-logs" - GRAFANA_BEARER_TOKEN: ${{ secrets.GRAFANA_INTERNAL_URL_SHORTENER_TOKEN }} - WASP_LOG_LEVEL: info - steps: - - name: Collect Metrics - id: collect-gha-metrics - uses: smartcontractkit/push-gha-metrics-action@d9da21a2747016b3e13de58c7d4115a3d5c97935 # v3.0.1 - with: - id: on-demand-vrfv2-performance-test - org-id: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} - basic-auth: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} - hostname: ${{ secrets.GRAFANA_INTERNAL_HOST }} - this-job-name: ${{ inputs.network }} VRFV2 Performance Test - continue-on-error: true - - name: Checkout code - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 - with: - fetch-depth: 0 - - name: Mask base64 config - run: | - BASE64_CONFIG_OVERRIDE=$(jq -r '.inputs.base64Config' $GITHUB_EVENT_PATH) - echo ::add-mask::$BASE64_CONFIG_OVERRIDE - echo "BASE64_CONFIG_OVERRIDE=$BASE64_CONFIG_OVERRIDE" >> $GITHUB_ENV - - name: Merge and export base64 config - uses: ./.github/actions/setup-merge-base64-config - with: - base64Config: ${{ env.BASE64_CONFIG_OVERRIDE }} - - name: Send details to Step Summary - shell: bash - run: | - echo "### chainlink image used for this test run :link:" >>$GITHUB_STEP_SUMMARY - echo "\`${{ env.CHAINLINK_IMAGE }}\`" >>$GITHUB_STEP_SUMMARY - echo "### chainlink-tests image tag for this test run :ship:" >>$GITHUB_STEP_SUMMARY - echo "\`${GITHUB_SHA}\`" >>$GITHUB_STEP_SUMMARY - echo "### Networks on which test was run" >>$GITHUB_STEP_SUMMARY - echo "\`${{ env.NETWORKS }}\`" >>$GITHUB_STEP_SUMMARY - - name: Run Tests - uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests@75a9005952a9e905649cfb5a6971fd9429436acd # v2.3.25 - with: - test_command_to_run: cd ./integration-tests/load && go test -v -count=1 -timeout 24h -run "${{ inputs.test_list_regex }}" ./vrfv2 - test_download_vendor_packages_command: cd ./integration-tests && go mod download - cl_repo: ${{ env.CHAINLINK_IMAGE }} - cl_image_tag: ${{ env.CHAINLINK_VERSION }} - aws_registries: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }} - artifacts_name: vrf-test-logs - artifacts_location: ./integration-tests/load/vrfv2/logs/ - token: ${{ secrets.GITHUB_TOKEN }} - go_mod_path: ./integration-tests/go.mod - should_cleanup: false - QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} - QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} - QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }} + SLACK_CHANNEL: ${{ secrets.QA_VRF_SLACK_CHANNEL }} diff --git a/.github/workflows/on-demand-vrfv2-smoke-tests.yml b/.github/workflows/on-demand-vrfv2-smoke-tests.yml new file mode 100644 index 00000000000..7c3b9560759 --- /dev/null +++ b/.github/workflows/on-demand-vrfv2-smoke-tests.yml @@ -0,0 +1,101 @@ +name: On Demand VRFV2 Smoke Tests +on: + workflow_dispatch: + inputs: + test_suite: + description: "Test Suite to run" + required: true + type: choice + default: "All Tests" + options: + - "All Tests" + - "Selected Tests" + test_list_regex: + description: "Regex for 'Selected Tests' to run" + required: false + default: "TestVRFv2Basic/(Request_Randomness|Direct_Funding)|TestVRFV2WithBHS" + test_config_override_path: + description: Path to a test config file used to override the default test config + required: false + type: string + test_secrets_override_key: + description: 'Key to run tests with custom test secrets' + required: false + type: string + chainlink_version: + description: Chainlink image version to use + default: develop + required: false + type: string + notify_user_id_on_failure: + description: 'Enter Slack user ID to notify on test failure' + required: false + type: string + +jobs: + set-tests-to-run: + name: Set tests to run + runs-on: ubuntu-latest + outputs: + test_list: ${{ steps.set-tests.outputs.test_list }} + steps: + - name: Generate Test List JSON + id: set-tests + run: | + if [[ "${{ inputs.test_suite }}" == "All Tests" ]]; then + TEST_CMD="cd integration-tests/smoke && go test vrfv2_test.go -test.parallel=1 -timeout 3h -count=1 -json -v" + else + TEST_CMD='cd integration-tests/smoke && go test -test.run "${{ inputs.test_list_regex }}" -test.parallel=1 -timeout 2h -count=1 -json -v' + fi + TEST_CONFIG_OVERRIDE_PATH=${{ inputs.test_config_override_path }} + + TEST_LIST=$(jq -n -c \ + --arg test_cmd "$TEST_CMD" \ + --arg test_config_override_path "$TEST_CONFIG_OVERRIDE_PATH" \ + '{ + "tests": [ + { + "id": "TestVRFv2_Smoke", + "path": "integration-tests/smoke/vrfv2_test.go", + "runs_on": "ubuntu-latest", + "test_env_type": "docker", + "test_cmd": $test_cmd, + "test_config_override_path": $test_config_override_path + } + ] + }') + + echo "test_list=$TEST_LIST" >> $GITHUB_OUTPUT + + run-e2e-tests-workflow: + name: Run E2E Tests + needs: set-tests-to-run + uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@827d85b57065211ddd254457a7cf21581d85092d + with: + custom_test_list_json: ${{ needs.set-tests-to-run.outputs.test_list }} + chainlink_version: ${{ inputs.chainlink_version }} + slack_notification_after_tests: always + slack_notification_after_tests_name: "VRF V2 Smoke Tests with test config: ${{ inputs.test_config_override_path || 'default' }}" + slack_notification_after_tests_notify_user_id_on_failure: ${{ inputs.notify_user_id_on_failure }} + secrets: + QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} + QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} + QA_AWS_ACCOUNT_NUMBER: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }} + PROD_AWS_ACCOUNT_NUMBER: ${{ secrets.AWS_ACCOUNT_ID_PROD }} + QA_PYROSCOPE_INSTANCE: ${{ secrets.QA_PYROSCOPE_INSTANCE }} + QA_PYROSCOPE_KEY: ${{ secrets.QA_PYROSCOPE_KEY }} + QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }} + GRAFANA_INTERNAL_TENANT_ID: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} + GRAFANA_INTERNAL_BASIC_AUTH: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} + GRAFANA_INTERNAL_HOST: ${{ secrets.GRAFANA_INTERNAL_HOST }} + GRAFANA_INTERNAL_URL_SHORTENER_TOKEN: ${{ secrets.GRAFANA_INTERNAL_URL_SHORTENER_TOKEN }} + LOKI_TENANT_ID: ${{ secrets.LOKI_TENANT_ID }} + LOKI_URL: https://${{ secrets.GRAFANA_INTERNAL_HOST }}/loki/api/v1/push + LOKI_BASIC_AUTH: ${{ secrets.LOKI_BASIC_AUTH }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + AWS_REGION: ${{ secrets.QA_AWS_REGION }} + AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN: ${{ secrets.AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN }} + AWS_API_GW_HOST_GRAFANA: ${{ secrets.AWS_API_GW_HOST_GRAFANA }} + TEST_SECRETS_OVERRIDE_BASE64: ${{ secrets[inputs.test_secrets_override_key] }} + SLACK_BOT_TOKEN: ${{ secrets.QA_SLACK_API_KEY }} + SLACK_NOTIFICATION_AFTER_TESTS_CHANNEL_ID: ${{ secrets.QA_VRF_SLACK_CHANNEL }} diff --git a/.github/workflows/on-demand-vrfv2plus-eth2-clients-test.yml b/.github/workflows/on-demand-vrfv2plus-eth2-clients-test.yml deleted file mode 100644 index 6e8a232fa8a..00000000000 --- a/.github/workflows/on-demand-vrfv2plus-eth2-clients-test.yml +++ /dev/null @@ -1,70 +0,0 @@ -name: On Demand VRFV2Plus Smoke Test (Ethereum clients) -on: - workflow_dispatch: - inputs: - base64Config: - description: base64-ed config - required: true - type: string - -jobs: - vrfv2plus_smoke_test: - name: VRFV2Plus Smoke Test with custom EL client - environment: integration - runs-on: ubuntu22.04-8cores-32GB - permissions: - checks: write - pull-requests: write - id-token: write - contents: read - env: - TEST_LOG_LEVEL: debug - REF_NAME: ${{ github.head_ref || github.ref_name }} - steps: - - name: Checkout code - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 - with: - fetch-depth: 0 - - name: Mask base64 config - run: | - BASE64_CONFIG_OVERRIDE=$(jq -r '.inputs.base64Config' $GITHUB_EVENT_PATH) - echo ::add-mask::$BASE64_CONFIG_OVERRIDE - echo "BASE64_CONFIG_OVERRIDE=$BASE64_CONFIG_OVERRIDE" >> $GITHUB_ENV - - name: Parse base64 config - uses: ./.github/actions/setup-parse-base64-config - with: - base64Config: ${{ env.BASE64_CONFIG_OVERRIDE }} - - name: Send details to Step Summary - shell: bash - run: | - echo "### chainlink image used for this test run :link:" >>$GITHUB_STEP_SUMMARY - echo "\`${{ env.CHAINLINK_IMAGE }}\`" >>$GITHUB_STEP_SUMMARY - echo "### chainlink-tests image tag for this test run :ship:" >>$GITHUB_STEP_SUMMARY - echo "\`${GITHUB_SHA}\`" >>$GITHUB_STEP_SUMMARY - echo "### Networks on which test was run" >>$GITHUB_STEP_SUMMARY - echo "\`${{ env.NETWORKS }}\`" >>$GITHUB_STEP_SUMMARY - echo "### Execution client used" >>$GITHUB_STEP_SUMMARY - echo "\`${{ env.ETH2_EL_CLIENT }}\`" >>$GITHUB_STEP_SUMMARY - - name: Run Tests - uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests@75a9005952a9e905649cfb5a6971fd9429436acd # v2.3.25 - with: - test_command_to_run: cd ./integration-tests && go test -timeout 30m -count=1 -json -run ^TestVRFv2Plus$/^Link_Billing$ ./smoke/vrfv2plus_test.go 2>&1 | tee /tmp/gotest.log | gotestloghelper -ci -singlepackage -hidepassingtests=false -hidepassinglogs - test_download_vendor_packages_command: cd ./integration-tests && go mod download - cl_repo: ${{ env.CHAINLINK_IMAGE }} - cl_image_tag: ${{ env.CHAINLINK_VERSION }} - aws_registries: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }} - artifacts_name: vrfplus-test-logs - artifacts_location: ./integration-tests/smoke/logs/ - token: ${{ secrets.GITHUB_TOKEN }} - go_mod_path: ./integration-tests/go.mod - should_cleanup: false - QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} - QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} - QA_KUBECONFIG: "" - DEFAULT_CHAINLINK_IMAGE: ${{ env.CHAINLINK_IMAGE }} - DEFAULT_LOKI_TENANT_ID: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} - DEFAULT_LOKI_ENDPOINT: https://${{ secrets.GRAFANA_INTERNAL_HOST }}/loki/api/v1/push - DEFAULT_LOKI_BASIC_AUTH: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} - DEFAULT_GRAFANA_BASE_URL: "http://localhost:8080/primary" - DEFAULT_GRAFANA_DASHBOARD_URL: "/d/ddf75041-1e39-42af-aa46-361fe4c36e9e/ci-e2e-tests-logs" - DEFAULT_GRAFANA_BEARER_TOKEN: ${{ secrets.GRAFANA_INTERNAL_URL_SHORTENER_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/on-demand-vrfv2plus-performance-test.yml b/.github/workflows/on-demand-vrfv2plus-performance-test.yml index 9714cf13d3a..3f5ae75fbed 100644 --- a/.github/workflows/on-demand-vrfv2plus-performance-test.yml +++ b/.github/workflows/on-demand-vrfv2plus-performance-test.yml @@ -2,10 +2,6 @@ name: On Demand VRFV2 Plus Performance Test on: workflow_dispatch: inputs: - base64Config: - description: base64-ed config - required: true - type: string performanceTestType: description: Performance Test Type of test to run type: string @@ -14,75 +10,91 @@ on: description: "Regex for tests to run" required: false default: "(TestVRFV2PlusPerformance)" + test_config_override_path: + description: Path to a test config file used to override the default test config + required: false + type: string + test_secrets_override_key: + description: 'Key to run tests with custom test secrets' + required: false + type: string + chainlink_version: + description: Chainlink image version to use + default: develop + required: false + type: string + notify_user_id_on_failure: + description: 'Enter Slack user ID to notify on test failure' + required: false + type: string + jobs: - vrfv2plus_performance_test: - name: VRFV2 Plus Performance Test - environment: integration - runs-on: ubuntu22.04-8cores-32GB - permissions: - checks: write - pull-requests: write - id-token: write - contents: read - env: - LOKI_URL: ${{ secrets.LOKI_URL }} + set-tests-to-run: + name: Set tests to run + runs-on: ubuntu-latest + outputs: + test_list: ${{ steps.set-tests.outputs.test_list }} + steps: + - name: Generate Test List JSON + id: set-tests + run: | + TEST_CMD='cd integration-tests/load && go test -v -count=1 -timeout 24h -run "${{ inputs.test_list_regex }}" ./vrfv2plus' + TEST_CONFIG_OVERRIDE_PATH=${{ inputs.test_config_override_path }} + TEST_TYPE=${{ inputs.performanceTestType }} + + TEST_LIST=$(jq -n -c \ + --arg test_cmd "$TEST_CMD" \ + --arg test_config_override_path "$TEST_CONFIG_OVERRIDE_PATH" \ + --arg TEST_TYPE "$TEST_TYPE" \ + '{ + "tests": [ + { + "id": "TestVRFv2Plus_Performance", + "path": "integration-tests/load/vrfv2plus/vrfv2plus_test.go", + "runs_on": "ubuntu-latest", + "test_env_type": "docker", + "test_cmd": $test_cmd, + "test_config_override_path": $test_config_override_path, + "test_env_vars": { + "TEST_TYPE": $TEST_TYPE + } + } + ] + }') + + echo "test_list=$TEST_LIST" >> $GITHUB_OUTPUT + + run-e2e-tests-workflow: + name: Run E2E Tests + needs: set-tests-to-run + uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@827d85b57065211ddd254457a7cf21581d85092d + with: + custom_test_list_json: ${{ needs.set-tests-to-run.outputs.test_list }} + chainlink_version: ${{ inputs.chainlink_version }} + slack_notification_after_tests: always + slack_notification_after_tests_name: "VRF V2 Plus Performance Tests with test config: ${{ inputs.test_config_override_path || 'default' }}" + slack_notification_after_tests_notify_user_id_on_failure: ${{ inputs.notify_user_id_on_failure }} + secrets: + QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} + QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} + QA_AWS_ACCOUNT_NUMBER: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }} + PROD_AWS_ACCOUNT_NUMBER: ${{ secrets.AWS_ACCOUNT_ID_PROD }} + QA_PYROSCOPE_INSTANCE: ${{ secrets.QA_PYROSCOPE_INSTANCE }} + QA_PYROSCOPE_KEY: ${{ secrets.QA_PYROSCOPE_KEY }} + QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }} + GRAFANA_INTERNAL_TENANT_ID: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} + GRAFANA_INTERNAL_BASIC_AUTH: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} + GRAFANA_INTERNAL_HOST: ${{ secrets.GRAFANA_INTERNAL_HOST }} + GRAFANA_INTERNAL_URL_SHORTENER_TOKEN: ${{ secrets.GRAFANA_INTERNAL_URL_SHORTENER_TOKEN }} LOKI_TENANT_ID: ${{ secrets.LOKI_TENANT_ID }} + LOKI_URL: https://${{ secrets.GRAFANA_INTERNAL_HOST }}/loki/api/v1/push LOKI_BASIC_AUTH: ${{ secrets.LOKI_BASIC_AUTH }} - TEST_TYPE: ${{ inputs.performanceTestType }} - TEST_LOG_LEVEL: debug - REF_NAME: ${{ github.head_ref || github.ref_name }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + AWS_REGION: ${{ secrets.QA_AWS_REGION }} + AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN: ${{ secrets.AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN }} + AWS_API_GW_HOST_GRAFANA: ${{ secrets.AWS_API_GW_HOST_GRAFANA }} + TEST_SECRETS_OVERRIDE_BASE64: ${{ secrets[inputs.test_secrets_override_key] }} + SLACK_BOT_TOKEN: ${{ secrets.QA_SLACK_API_KEY }} + SLACK_NOTIFICATION_AFTER_TESTS_CHANNEL_ID: ${{ secrets.QA_VRF_SLACK_CHANNEL }} SLACK_API_KEY: ${{ secrets.QA_SLACK_API_KEY }} - SLACK_CHANNEL: ${{ secrets.QA_VRF_SLACK_CHANNEL }} - GRAFANA_URL: "http://localhost:8080/primary" - GRAFANA_DASHBOARD_URL: "/d/ddf75041-1e39-42af-aa46-361fe4c36e9e/ci-e2e-tests-logs" - GRAFANA_BEARER_TOKEN: ${{ secrets.GRAFANA_INTERNAL_URL_SHORTENER_TOKEN }} - WASP_LOG_LEVEL: info - steps: - - name: Collect Metrics - id: collect-gha-metrics - uses: smartcontractkit/push-gha-metrics-action@d9da21a2747016b3e13de58c7d4115a3d5c97935 # v3.0.1 - with: - id: on-demand-vrfv2-plus-performance-test - org-id: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} - basic-auth: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} - hostname: ${{ secrets.GRAFANA_INTERNAL_HOST }} - this-job-name: ${{ inputs.network }} VRFV2 Plus Performance Test - continue-on-error: true - - name: Checkout code - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 - with: - fetch-depth: 0 - - name: Mask base64 config - run: | - BASE64_CONFIG_OVERRIDE=$(jq -r '.inputs.base64Config' $GITHUB_EVENT_PATH) - echo ::add-mask::$BASE64_CONFIG_OVERRIDE - echo "BASE64_CONFIG_OVERRIDE=$BASE64_CONFIG_OVERRIDE" >> $GITHUB_ENV - - name: Merge and export base64 config - uses: ./.github/actions/setup-merge-base64-config - with: - base64Config: ${{ env.BASE64_CONFIG_OVERRIDE }} - - name: Send details to Step Summary - shell: bash - run: | - echo "### chainlink image used for this test run :link:" >>$GITHUB_STEP_SUMMARY - echo "\`${{ env.CHAINLINK_IMAGE }}\`" >>$GITHUB_STEP_SUMMARY - echo "### chainlink-tests image tag for this test run :ship:" >>$GITHUB_STEP_SUMMARY - echo "\`${GITHUB_SHA}\`" >>$GITHUB_STEP_SUMMARY - echo "### Networks on which test was run" >>$GITHUB_STEP_SUMMARY - echo "\`${{ env.NETWORKS }}\`" >>$GITHUB_STEP_SUMMARY - - name: Run Tests - uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests@75a9005952a9e905649cfb5a6971fd9429436acd # v2.3.25 - with: - test_command_to_run: cd ./integration-tests/load && go test -v -count=1 -timeout 24h -run "${{ inputs.test_list_regex }}" ./vrfv2plus - test_download_vendor_packages_command: cd ./integration-tests && go mod download - cl_repo: ${{ env.CHAINLINK_IMAGE }} - cl_image_tag: ${{ env.CHAINLINK_VERSION }} - aws_registries: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }} - artifacts_name: vrf-test-logs - artifacts_location: ./integration-tests/load/vrfv2plus/logs/ - token: ${{ secrets.GITHUB_TOKEN }} - go_mod_path: ./integration-tests/go.mod - should_cleanup: false - QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} - QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} - QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }} + SLACK_CHANNEL: ${{ secrets.QA_VRF_SLACK_CHANNEL }} diff --git a/.github/workflows/on-demand-vrfv2plus-smoke-tests.yml b/.github/workflows/on-demand-vrfv2plus-smoke-tests.yml new file mode 100644 index 00000000000..add26643a24 --- /dev/null +++ b/.github/workflows/on-demand-vrfv2plus-smoke-tests.yml @@ -0,0 +1,101 @@ +name: On Demand VRFV2 Plus Smoke Tests +on: + workflow_dispatch: + inputs: + test_suite: + description: "Test Suite to run" + required: true + type: choice + default: "All Tests" + options: + - "All Tests" + - "Selected Tests" + test_list_regex: + description: "Regex for 'Selected Tests' to run" + required: false + default: "TestVRFv2Plus$/(Link_Billing|Native_Billing|Direct_Funding)|TestVRFV2PlusWithBHS" + test_config_override_path: + description: Path to a test config file used to override the default test config + required: false + type: string + test_secrets_override_key: + description: 'Key to run tests with custom test secrets' + required: false + type: string + chainlink_version: + description: Chainlink image version to use + default: develop + required: false + type: string + notify_user_id_on_failure: + description: 'Enter Slack user ID to notify on test failure' + required: false + type: string + +jobs: + set-tests-to-run: + name: Set tests to run + runs-on: ubuntu-latest + outputs: + test_list: ${{ steps.set-tests.outputs.test_list }} + steps: + - name: Generate Test List JSON + id: set-tests + run: | + if [[ "${{ inputs.test_suite }}" == "All Tests" ]]; then + TEST_CMD="cd integration-tests/smoke && go test vrfv2plus_test.go -test.parallel=1 -timeout 3h -count=1 -json -v" + else + TEST_CMD='cd integration-tests/smoke && go test -test.run "${{ inputs.test_list_regex }}" -test.parallel=1 -timeout 2h -count=1 -json -v' + fi + TEST_CONFIG_OVERRIDE_PATH=${{ inputs.test_config_override_path }} + + TEST_LIST=$(jq -n -c \ + --arg test_cmd "$TEST_CMD" \ + --arg test_config_override_path "$TEST_CONFIG_OVERRIDE_PATH" \ + '{ + "tests": [ + { + "id": "TestVRFv2Plus_Smoke", + "path": "integration-tests/smoke/vrfv2plus_test.go", + "runs_on": "ubuntu-latest", + "test_env_type": "docker", + "test_cmd": $test_cmd, + "test_config_override_path": $test_config_override_path + } + ] + }') + + echo "test_list=$TEST_LIST" >> $GITHUB_OUTPUT + + run-e2e-tests-workflow: + name: Run E2E Tests + needs: set-tests-to-run + uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@827d85b57065211ddd254457a7cf21581d85092d + with: + custom_test_list_json: ${{ needs.set-tests-to-run.outputs.test_list }} + chainlink_version: ${{ inputs.chainlink_version }} + slack_notification_after_tests: always + slack_notification_after_tests_name: "VRF V2 Plus Smoke Tests with test config: ${{ inputs.test_config_override_path || 'default' }}" + slack_notification_after_tests_notify_user_id_on_failure: ${{ inputs.notify_user_id_on_failure }} + secrets: + QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} + QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} + QA_AWS_ACCOUNT_NUMBER: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }} + PROD_AWS_ACCOUNT_NUMBER: ${{ secrets.AWS_ACCOUNT_ID_PROD }} + QA_PYROSCOPE_INSTANCE: ${{ secrets.QA_PYROSCOPE_INSTANCE }} + QA_PYROSCOPE_KEY: ${{ secrets.QA_PYROSCOPE_KEY }} + QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }} + GRAFANA_INTERNAL_TENANT_ID: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} + GRAFANA_INTERNAL_BASIC_AUTH: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} + GRAFANA_INTERNAL_HOST: ${{ secrets.GRAFANA_INTERNAL_HOST }} + GRAFANA_INTERNAL_URL_SHORTENER_TOKEN: ${{ secrets.GRAFANA_INTERNAL_URL_SHORTENER_TOKEN }} + LOKI_TENANT_ID: ${{ secrets.LOKI_TENANT_ID }} + LOKI_URL: https://${{ secrets.GRAFANA_INTERNAL_HOST }}/loki/api/v1/push + LOKI_BASIC_AUTH: ${{ secrets.LOKI_BASIC_AUTH }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + AWS_REGION: ${{ secrets.QA_AWS_REGION }} + AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN: ${{ secrets.AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN }} + AWS_API_GW_HOST_GRAFANA: ${{ secrets.AWS_API_GW_HOST_GRAFANA }} + TEST_SECRETS_OVERRIDE_BASE64: ${{ secrets[inputs.test_secrets_override_key] }} + SLACK_BOT_TOKEN: ${{ secrets.QA_SLACK_API_KEY }} + SLACK_NOTIFICATION_AFTER_TESTS_CHANNEL_ID: ${{ secrets.QA_VRF_SLACK_CHANNEL }} diff --git a/.github/workflows/pr-labels.yml b/.github/workflows/pr-labels.yml deleted file mode 100644 index fc4cae227a5..00000000000 --- a/.github/workflows/pr-labels.yml +++ /dev/null @@ -1,46 +0,0 @@ -name: PR Labels - -on: - pull_request: - types: [labeled] - -jobs: - crib: - runs-on: ubuntu-latest - permissions: - # For AWS assume role. - id-token: write - contents: read - # To comment on PR's. - issues: write - pull-requests: write - steps: - - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 - - - uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # v3.0.0 - with: - version: ^9.0.0 - - - uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 - with: - node-version: 20 - cache: pnpm - cache-dependency-path: ./.github/scripts/crib/pnpm-lock.yaml - - - run: pnpm install - working-directory: ./.github/scripts/crib - - - name: Assume role capable of dispatching action - uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2 - with: - role-to-assume: ${{ secrets.AWS_OIDC_CRIB_ROLE_ARN_SAND }} - aws-region: ${{ secrets.AWS_REGION }} - role-duration-seconds: 900 - mask-aws-account-id: true - role-session-name: pr-labels.crib - - - name: Comment CRIB details on PR - run: ./.github/scripts/crib/pr-comment-crib-env.js - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - ROUTE53_ZONE_ID: ${{ secrets.ROUTE53_ZONE_ID_SAND }} diff --git a/.github/workflows/run-nightly-e2e-tests.yml b/.github/workflows/run-nightly-e2e-tests.yml new file mode 100644 index 00000000000..067a41911e6 --- /dev/null +++ b/.github/workflows/run-nightly-e2e-tests.yml @@ -0,0 +1,50 @@ +name: Run Nightly E2E Tests + +on: + schedule: + # Run every night at midnight UTC (0:00 AM) + - cron: '0 0 * * *' + workflow_dispatch: + # Useful when running the workflow manually + inputs: + chainlink_version: + description: 'Enter Chainlink version to use for the tests. Example: "v2.10.0" or sha' + required: true + type: string + default: develop + slack_notification_after_tests: + description: 'Notify on Slack after tests' + required: false + type: string + +jobs: + call-run-e2e-tests-workflow: + name: Run E2E Tests + uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@827d85b57065211ddd254457a7cf21581d85092d + with: + chainlink_version: ${{ inputs.chainlink_version || 'develop' }} + test_path: .github/e2e-tests.yml + test_trigger: Nightly E2E Tests + slack_notification_after_tests: ${{ inputs.slack_notification_after_tests || 'always' }} + slack_notification_after_tests_channel_id: "#team-test-tooling-internal" + slack_notification_after_tests_name: Nightly E2E Tests + secrets: + QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} + QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} + QA_AWS_ACCOUNT_NUMBER: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }} + PROD_AWS_ACCOUNT_NUMBER: ${{ secrets.AWS_ACCOUNT_ID_PROD }} + QA_PYROSCOPE_INSTANCE: ${{ secrets.QA_PYROSCOPE_INSTANCE }} + QA_PYROSCOPE_KEY: ${{ secrets.QA_PYROSCOPE_KEY }} + QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }} + GRAFANA_INTERNAL_TENANT_ID: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} + GRAFANA_INTERNAL_BASIC_AUTH: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} + GRAFANA_INTERNAL_HOST: ${{ secrets.GRAFANA_INTERNAL_HOST }} + GRAFANA_INTERNAL_URL_SHORTENER_TOKEN: ${{ secrets.GRAFANA_INTERNAL_URL_SHORTENER_TOKEN }} + LOKI_TENANT_ID: ${{ secrets.LOKI_TENANT_ID }} + LOKI_URL: https://${{ secrets.GRAFANA_INTERNAL_HOST }}/loki/api/v1/push + LOKI_BASIC_AUTH: ${{ secrets.LOKI_BASIC_AUTH }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + AWS_REGION: ${{ secrets.QA_AWS_REGION }} + AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN: ${{ secrets.AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN }} + AWS_API_GW_HOST_GRAFANA: ${{ secrets.AWS_API_GW_HOST_GRAFANA }} + SLACK_BOT_TOKEN: ${{ secrets.QA_SLACK_API_KEY }} diff --git a/.github/workflows/run-selected-e2e-tests.yml b/.github/workflows/run-selected-e2e-tests.yml new file mode 100644 index 00000000000..c7716a7a0a5 --- /dev/null +++ b/.github/workflows/run-selected-e2e-tests.yml @@ -0,0 +1,65 @@ +name: Run Selected E2E Tests + +on: + workflow_dispatch: + inputs: + chainlink_version: + description: 'Enter Chainlink version to use for the tests. Example: "v2.10.0" or sha' + required: false + type: string + test_ids: + description: 'Run all tests "*" by default. Or, enter test IDs to run separated by commas. Example: "run_all_in_ocr_tests_go,run_TestOCRv2Request_in_ocr2_test_go". Check all test IDs in .github/e2e-tests.yml' + default: "*" + required: true + type: string + test_secrets_override_key: + description: 'Enter the secret key to override test secrets' + required: false + type: string + test_config_override_path: + description: 'Path to a test config file used to override the default test config' + required: false + type: string + with_existing_remote_runner_version: + description: 'Use the existing remote runner version for k8s tests. Example: "d3bf5044af33e08be788a2df31c4a745cf69d787"' + required: false + type: string + workflow_run_name: + description: 'Enter the name of the workflow run' + default: 'Run E2E Tests' + required: false + type: string + +run-name: ${{ inputs.workflow_run_name }} + +jobs: + call-run-e2e-tests-workflow: + name: Run E2E Tests + uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@827d85b57065211ddd254457a7cf21581d85092d + with: + chainlink_version: ${{ github.event.inputs.chainlink_version }} + test_path: .github/e2e-tests.yml + test_ids: ${{ github.event.inputs.test_ids }} + test_config_override_path: ${{ github.event.inputs.test_config_override_path }} + with_existing_remote_runner_version: ${{ github.event.inputs.with_existing_remote_runner_version }} + secrets: + QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} + QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} + QA_AWS_ACCOUNT_NUMBER: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }} + PROD_AWS_ACCOUNT_NUMBER: ${{ secrets.AWS_ACCOUNT_ID_PROD }} + QA_PYROSCOPE_INSTANCE: ${{ secrets.QA_PYROSCOPE_INSTANCE }} + QA_PYROSCOPE_KEY: ${{ secrets.QA_PYROSCOPE_KEY }} + QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }} + GRAFANA_INTERNAL_TENANT_ID: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} + GRAFANA_INTERNAL_BASIC_AUTH: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} + GRAFANA_INTERNAL_HOST: ${{ secrets.GRAFANA_INTERNAL_HOST }} + GRAFANA_INTERNAL_URL_SHORTENER_TOKEN: ${{ secrets.GRAFANA_INTERNAL_URL_SHORTENER_TOKEN }} + LOKI_TENANT_ID: ${{ secrets.LOKI_TENANT_ID }} + LOKI_URL: https://${{ secrets.GRAFANA_INTERNAL_HOST }}/loki/api/v1/push + LOKI_BASIC_AUTH: ${{ secrets.LOKI_BASIC_AUTH }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + AWS_REGION: ${{ secrets.QA_AWS_REGION }} + AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN: ${{ secrets.AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN }} + AWS_API_GW_HOST_GRAFANA: ${{ secrets.AWS_API_GW_HOST_GRAFANA }} + TEST_SECRETS_OVERRIDE_BASE64: ${{ secrets[inputs.test_secrets_override_key] }} + SLACK_BOT_TOKEN: ${{ secrets.QA_SLACK_API_KEY }} diff --git a/.github/workflows/solidity-foundry-artifacts.yml b/.github/workflows/solidity-foundry-artifacts.yml new file mode 100644 index 00000000000..2a3f6677b04 --- /dev/null +++ b/.github/workflows/solidity-foundry-artifacts.yml @@ -0,0 +1,169 @@ +name: Solidity Foundry Artifact Generation +on: + workflow_dispatch: + inputs: + product: + type: choice + description: 'product for which to generate artifacts; should be the same as Foundry profile' + required: true + options: + - "automation" + - "ccip" + - "functions" + - "keystone" + - "l2ep" + - "liquiditymanager" + - "llo-feeds" + - "operatorforwarder" + - "shared" + - "transmission" + - "vrf" + commit_to_use: + type: string + description: 'commit SHA to use for artifact generation; if empty HEAD will be used' + required: false + base_ref: + description: 'commit or tag to use as base reference, when looking for modified Solidity files' + required: true + link_with_jira: + description: 'link generated artifacts with Jira issues?' + type: boolean + default: true + required: false + +env: + FOUNDRY_PROFILE: ci + # Unfortunately, we can't use the "default" field in the inputs section, because it does not have + # access to the workflow context + head_ref: ${{ inputs.commit_to_use || github.sha }} + +jobs: + changes: + name: Detect changes + runs-on: ubuntu-latest + outputs: + product_changes: ${{ steps.changes-transform.outputs.product_changes }} + product_files: ${{ steps.changes-transform.outputs.product_files }} + changeset_changes: ${{ steps.changes-dorny.outputs.changeset }} + changeset_files: ${{ steps.changes-dorny.outputs.changeset_files }} + steps: + - name: Checkout the repo + uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 + with: + ref: ${{ env.head_ref }} + - name: Find modified contracts + uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2 + id: changes-dorny + with: + list-files: 'csv' + base: ${{ inputs.base_ref }} + # This is a valid input, see https://github.com/dorny/paths-filter/pull/226 + predicate-quantifier: every + filters: | + ignored: &ignored + - '!contracts/src/v0.8/**/test/**' + - '!contracts/src/v0.8/**/tests/**' + - '!contracts/src/v0.8/**/mock/**' + - '!contracts/src/v0.8/**/mocks/**' + - '!contracts/src/v0.8/**/*.t.sol' + - '!contracts/src/v0.8/*.t.sol' + - '!contracts/src/v0.8/**/testhelpers/**' + - '!contracts/src/v0.8/testhelpers/**' + - '!contracts/src/v0.8/vendor/**' + other_shared: + - modified|added: 'contracts/src/v0.8/(interfaces/**/*.sol|*.sol)' + - *ignored + sol: + - modified|added: 'contracts/src/v0.8/**/*.sol' + - *ignored + product: &product + - modified|added: 'contracts/src/v0.8/${{ inputs.product }}/**/*.sol' + - *ignored + changeset: + - modified|added: 'contracts/.changeset/!(README)*.md' + + # Manual transformation needed, because shared contracts have a different folder structure + - name: Transform modified files + id: changes-transform + shell: bash + run: | + if [ "${{ inputs.product }}" = "shared" ]; then + echo "::debug:: Product is shared, transforming changes" + if [[ "${{ steps.changes-dorny.outputs.product }}" == "true" && "${{ steps.changes-dorny.outputs.other_shared }}" == "true" ]]; then + echo "::debug:: Changes were found in 'shared' folder and in 'interfaces' and root folders" + echo "product_changes=true" >> $GITHUB_OUTPUT + echo "product_files=${{ steps.changes-dorny.outputs.product_files }},${{ steps.changes-dorny.outputs.other_shared_files }}" >> $GITHUB_OUTPUT + elif [[ "${{ steps.changes-dorny.outputs.product }}" == "false" && "${{ steps.changes-dorny.outputs.other_shared }}" == "true" ]]; then + echo "::debug:: Only contracts in' interfaces' and root folders were modified" + echo "product_changes=true" >> $GITHUB_OUTPUT + echo "product_files=${{ steps.changes-dorny.outputs.other_shared_files }}" >> $GITHUB_OUTPUT + elif [[ "${{ steps.changes-dorny.outputs.product }}" == "true" && "${{ steps.changes-dorny.outputs.other_shared }}" == "false" ]]; then + echo "::debug:: Only contracts in 'shared' folder were modified" + echo "product_changes=true" >> $GITHUB_OUTPUT + echo "product_files=${{ steps.changes-dorny.outputs.product_files }}" >> $GITHUB_OUTPUT + else + echo "::debug:: No contracts were modified" + echo "product_changes=false" >> $GITHUB_OUTPUT + echo "product_files=" >> $GITHUB_OUTPUT + fi + else + echo "product_changes=${{ steps.changes-dorny.outputs.product }}" >> $GITHUB_OUTPUT + echo "product_files=${{ steps.changes-dorny.outputs.product_files }}" >> $GITHUB_OUTPUT + fi + + - name: Check for changes outside of artifact scope + uses: ./.github/actions/validate-artifact-scope + if: ${{ steps.changes-dorny.outputs.sol == 'true' }} + with: + sol_files: ${{ steps.changes-dorny.outputs.sol_files }} + product: ${{ inputs.product }} + + prepare-workflow-inputs: + name: Prepare workflow inputs + runs-on: ubuntu-22.04 + needs: [ changes ] + outputs: + foundry_version: ${{ steps.extract-foundry-version.outputs.foundry-version }} + generate_code_coverage: ${{ steps.skip-code-coverage.outputs.generate_code_coverage }} + steps: + - name: Checkout the repo + uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 + + - name: Extract Foundry version + id: extract-foundry-version + uses: ./.github/actions/detect-solidity-foundry-version + with: + working-directory: contracts + + - name: Should skip code coverage report + id: skip-code-coverage + run: | + if [[ "${{ inputs.product }}" = "automation" || "${{ inputs.product }}" = "vrf" || "${{ inputs.product }}" = "functions" ]]; then + echo "generate_code_coverage=false" >> $GITHUB_OUTPUT + else + echo "generate_code_coverage=true" >> $GITHUB_OUTPUT + fi + + generate-artifacts: + name: Generate Solidity Review Artifacts + needs: [changes, prepare-workflow-inputs] + uses: smartcontractkit/.github/.github/workflows/solidity-review-artifacts.yml@b6e37806737eef87e8c9137ceeb23ef0bff8b1db # validate-solidity-artifacts@0.1.0 + with: + product: ${{ inputs.product }} + commit_to_use: ${{ inputs.commit_to_use }} + base_ref: ${{ inputs.base_ref }} + product_changes: ${{ needs.changes.outputs.product_changes }} + product_files: ${{ needs.changes.outputs.product_files }} + changeset_changes: ${{ needs.changes.outputs.changeset_changes }} + changeset_files: ${{ needs.changes.outputs.changeset_files }} + foundry_version: ${{ needs.prepare-workflow-inputs.outputs.foundry_version }} + contracts_directory: './contracts' + generate_code_coverage: ${{ needs.prepare-workflow-inputs.outputs.generate_code_coverage == 'true' }} + link_with_jira: ${{ inputs.link_with_jira }} + jira_host: ${{ vars.JIRA_HOST }} + install_semver: false + slither_config_file_path: 'contracts/configs/slither/.slither.config-artifacts.json' + lcov_prune_script_path: 'scripts/lcov_prune' + secrets: + jira_username: ${{ secrets.JIRA_USERNAME }} + jira_api_token: ${{ secrets.JIRA_API_TOKEN }} diff --git a/.github/workflows/solidity-foundry.yml b/.github/workflows/solidity-foundry.yml index a7ced0f5653..eb59bc85f6c 100644 --- a/.github/workflows/solidity-foundry.yml +++ b/.github/workflows/solidity-foundry.yml @@ -4,39 +4,151 @@ on: [pull_request] env: FOUNDRY_PROFILE: ci +# Making changes: +# * use the top-level matrix to decide, which checks should run for each product. +# * when enabling code coverage, remember to adjust the minimum code coverage as it's set to 98.5% by default. + +# This pipeline will run product tests only if product-specific contracts were modified or if broad-impact changes were made (e.g. changes to this pipeline, Foundry configuration, etc.) +# For modified contracts we use a LLM to extract new issues introduced by the changes. For new contracts full report is delivered. +# Slither has a default configuration, but also supports per-product configuration. If a product-specific configuration is not found, the default one is used. +# Changes to test files do not trigger static analysis or formatting checks. + jobs: + define-matrix: + name: Define test matrix + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.define-matrix.outputs.matrix }} + foundry-version: ${{ steps.extract-foundry-version.outputs.foundry-version }} + steps: + - name: Define test matrix + id: define-matrix + shell: bash + run: | + cat < matrix.json + [ + { "name": "automation", "setup": { "run-coverage": false, "min-coverage": 98.5, "run-gas-snapshot": false, "run-forge-fmt": false }}, + { "name": "ccip", "setup": { "run-coverage": true, "min-coverage": 97.6, "run-gas-snapshot": true, "run-forge-fmt": true }}, + { "name": "functions", "setup": { "run-coverage": false, "min-coverage": 98.5, "run-gas-snapshot": true, "run-forge-fmt": false }}, + { "name": "keystone", "setup": { "run-coverage": true, "min-coverage": 72.8, "run-gas-snapshot": false, "run-forge-fmt": false }}, + { "name": "l2ep", "setup": { "run-coverage": true, "min-coverage": 61.0, "run-gas-snapshot": true, "run-forge-fmt": false }}, + { "name": "liquiditymanager", "setup": { "run-coverage": true, "min-coverage": 46.3, "run-gas-snapshot": true, "run-forge-fmt": false }}, + { "name": "llo-feeds", "setup": { "run-coverage": true, "min-coverage": 49.3, "run-gas-snapshot": true, "run-forge-fmt": false }}, + { "name": "operatorforwarder", "setup": { "run-coverage": true, "min-coverage": 55.7, "run-gas-snapshot": true, "run-forge-fmt": false }}, + { "name": "shared", "setup": { "run-coverage": true, "extra-coverage-params": "--no-match-path='*CallWithExactGas*'", "min-coverage": 32.6, "run-gas-snapshot": true, "run-forge-fmt": false }}, + { "name": "transmission", "setup": { "run-coverage": true, "min-coverage": 61.5, "run-gas-snapshot": true, "run-forge-fmt": false }}, + { "name": "vrf", "setup": { "run-coverage": false, "min-coverage": 98.5, "run-gas-snapshot": false, "run-forge-fmt": false }} + ] + EOF + + matrix=$(cat matrix.json | jq -c .) + echo "matrix=$matrix" >> $GITHUB_OUTPUT + + - name: Checkout the repo + uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 + + - name: Extract Foundry version + id: extract-foundry-version + uses: ./.github/actions/detect-solidity-foundry-version + with: + working-directory: contracts + changes: name: Detect changes runs-on: ubuntu-latest outputs: - changes: ${{ steps.changes.outputs.src }} + non_src_changes: ${{ steps.changes.outputs.non_src }} + sol_modified_added: ${{ steps.changes.outputs.sol }} + sol_mod_only: ${{ steps.changes.outputs.sol_mod_only }} + sol_mod_only_files: ${{ steps.changes.outputs.sol_mod_only_files }} + not_test_sol_modified: ${{ steps.changes-non-test.outputs.not_test_sol }} + not_test_sol_modified_files: ${{ steps.changes-non-test.outputs.not_test_sol_files }} + all_changes: ${{ steps.changes.outputs.changes }} steps: - name: Checkout the repo uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 - - uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2 + - name: Detect changes + uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2 id: changes with: + list-files: 'shell' filters: | - src: - - 'contracts/src/v0.8/**/*' + non_src: - '.github/workflows/solidity-foundry.yml' - 'contracts/foundry.toml' - 'contracts/gas-snapshots/*.gas-snapshot' + - 'contracts/package.json' + - 'contracts/GNUmakefile' + sol: + - modified|added: 'contracts/src/v0.8/**/*.sol' + sol_mod_only: + - modified: 'contracts/src/v0.8/**/!(tests|mocks)/!(*.t).sol' + not_test_sol: + - modified|added: 'contracts/src/v0.8/**/!(tests|mocks)/!(*.t).sol' + automation: + - 'contracts/src/v0.8/automation/**/*.sol' + ccip: + - 'contracts/src/v0.8/ccip/**/*.sol' + functions: + - 'contracts/src/v0.8/functions/**/*.sol' + keystone: + - 'contracts/src/v0.8/keystone/**/*.sol' + l2ep: + - 'contracts/src/v0.8/l2ep/**/*.sol' + liquiditymanager: + - 'contracts/src/v0.8/liquiditymanager/**/*.sol' + llo-feeds: + - 'contracts/src/v0.8/llo-feeds/**/*.sol' + operatorforwarder: + - 'contracts/src/v0.8/operatorforwarder/**/*.sol' + vrf: + - 'contracts/src/v0.8/vrf/**/*.sol' + shared: + - 'contracts/src/v0.8/shared/**/*.sol' + - 'contracts/src/v0.8/*.sol' + - 'contracts/src/v0.8/mocks/**/*.sol' + - 'contracts/src/v0.8/tests/**/*.sol' + - 'contracts/src/v0.8/vendor/**/*.sol' + transmission: + - 'contracts/src/v0.8/transmission/**/*.sol' + + - name: Detect non-test changes + uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2 + id: changes-non-test + with: + list-files: 'shell' + # This is a valid input, see https://github.com/dorny/paths-filter/pull/226 + predicate-quantifier: every + filters: | + not_test_sol: + - modified|added: 'contracts/src/v0.8/**/!(*.t).sol' + - '!contracts/src/v0.8/**/test/**' + - '!contracts/src/v0.8/**/tests/**' + - '!contracts/src/v0.8/**/mock/**' + - '!contracts/src/v0.8/**/mocks/**' + - '!contracts/src/v0.8/**/*.t.sol' + - '!contracts/src/v0.8/*.t.sol' + - '!contracts/src/v0.8/**/testhelpers/**' + - '!contracts/src/v0.8/testhelpers/**' + - '!contracts/src/v0.8/vendor/**' tests: + if: ${{ needs.changes.outputs.non_src_changes == 'true' || needs.changes.outputs.sol_modified_added == 'true' }} strategy: fail-fast: false matrix: - product: [automation, functions, keystone, l2ep, llo-feeds, operatorforwarder, shared, vrf] - needs: [changes] - name: Foundry Tests ${{ matrix.product }} - # See https://github.com/foundry-rs/foundry/issues/3827 + product: ${{fromJson(needs.define-matrix.outputs.matrix)}} + needs: [define-matrix, changes] + name: Foundry Tests ${{ matrix.product.name }} runs-on: ubuntu-22.04 # The if statements for steps after checkout repo is workaround for # passing required check for PRs that don't have filtered changes. steps: - name: Checkout the repo + if: ${{ contains(fromJson(needs.changes.outputs.all_changes), matrix.product.name) + || contains(fromJson(needs.changes.outputs.all_changes), 'shared') + || needs.changes.outputs.non_src_changes == 'true' }} uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 with: submodules: recursive @@ -45,52 +157,441 @@ jobs: # and not native Foundry. This is to make sure the dependencies # stay in sync. - name: Setup NodeJS - if: needs.changes.outputs.changes == 'true' + if: ${{ contains(fromJson(needs.changes.outputs.all_changes), matrix.product.name) + || contains(fromJson(needs.changes.outputs.all_changes), 'shared') + || needs.changes.outputs.non_src_changes == 'true' }} uses: ./.github/actions/setup-nodejs + with: + prod: "true" - name: Install Foundry - if: needs.changes.outputs.changes == 'true' + if: ${{ contains(fromJson(needs.changes.outputs.all_changes), matrix.product.name) + || contains(fromJson(needs.changes.outputs.all_changes), 'shared') + || needs.changes.outputs.non_src_changes == 'true' }} uses: foundry-rs/foundry-toolchain@8f1998e9878d786675189ef566a2e4bf24869773 # v1.2.0 with: - # Has to match the `make foundry` version. - version: nightly-de33b6af53005037b463318d2628b5cfcaf39916 + version: ${{ needs.define-matrix.outputs.foundry-version }} - name: Run Forge build - if: needs.changes.outputs.changes == 'true' + if: ${{ contains(fromJson(needs.changes.outputs.all_changes), matrix.product.name) + || contains(fromJson(needs.changes.outputs.all_changes), 'shared') + || needs.changes.outputs.non_src_changes == 'true' }} run: | forge --version forge build id: build working-directory: contracts env: - FOUNDRY_PROFILE: ${{ matrix.product }} + FOUNDRY_PROFILE: ${{ matrix.product.name }} - name: Run Forge tests - if: needs.changes.outputs.changes == 'true' + if: ${{ contains(fromJson(needs.changes.outputs.all_changes), matrix.product.name) + || contains(fromJson(needs.changes.outputs.all_changes), 'shared') + || needs.changes.outputs.non_src_changes == 'true' }} run: | forge test -vvv id: test working-directory: contracts env: - FOUNDRY_PROFILE: ${{ matrix.product }} + FOUNDRY_PROFILE: ${{ matrix.product.name }} - name: Run Forge snapshot - if: ${{ !contains(fromJson('["vrf"]'), matrix.product) && !contains(fromJson('["automation"]'), matrix.product) && !contains(fromJson('["keystone"]'), matrix.product) && needs.changes.outputs.changes == 'true' }} + if: ${{ (contains(fromJson(needs.changes.outputs.all_changes), matrix.product.name) + || contains(fromJson(needs.changes.outputs.all_changes), 'shared') + || needs.changes.outputs.non_src_changes == 'true') + && matrix.product.setup.run-gas-snapshot }} run: | - forge snapshot --nmt "testFuzz_\w{1,}?" --check gas-snapshots/${{ matrix.product }}.gas-snapshot + forge snapshot --nmt "test_?Fuzz_\w{1,}?" --check gas-snapshots/${{ matrix.product.name }}.gas-snapshot id: snapshot working-directory: contracts env: - FOUNDRY_PROFILE: ${{ matrix.product }} + FOUNDRY_PROFILE: ${{ matrix.product.name }} + + # required for code coverage report generation + - name: Setup LCOV + if: ${{ (contains(fromJson(needs.changes.outputs.all_changes), matrix.product.name) + || contains(fromJson(needs.changes.outputs.all_changes), 'shared') + || needs.changes.outputs.non_src_changes == 'true') + && matrix.product.setup.run-coverage }} + uses: hrishikesh-kadam/setup-lcov@f5da1b26b0dcf5d893077a3c4f29cf78079c841d # v1.0.0 + + - name: Run coverage for ${{ matrix.product.name }} + if: ${{ (contains(fromJson(needs.changes.outputs.all_changes), matrix.product.name) + || contains(fromJson(needs.changes.outputs.all_changes), 'shared') + || needs.changes.outputs.non_src_changes == 'true') + && matrix.product.setup.run-coverage }} + working-directory: contracts + shell: bash + run: | + if [[ -n "${{ matrix.product.setup.extra-coverage-params }}" ]]; then + forge coverage --report lcov ${{ matrix.product.setup.extra-coverage-params }} + else + forge coverage --report lcov + fi + env: + FOUNDRY_PROFILE: ${{ matrix.product.name }} + + - name: Prune lcov report + if: ${{ (contains(fromJson(needs.changes.outputs.all_changes), matrix.product.name) + || contains(fromJson(needs.changes.outputs.all_changes), 'shared') + || needs.changes.outputs.non_src_changes == 'true') + && matrix.product.setup.run-coverage }} + run: | + ./contracts/scripts/lcov_prune ${{ matrix.product.name }} ./contracts/lcov.info ./contracts/lcov.info.pruned + + - name: Report code coverage for ${{ matrix.product.name }} + if: ${{ (contains(fromJson(needs.changes.outputs.all_changes), matrix.product.name) + || contains(fromJson(needs.changes.outputs.all_changes), 'shared') + || needs.changes.outputs.non_src_changes == 'true') + && matrix.product.setup.run-coverage }} + uses: zgosalvez/github-actions-report-lcov@a546f89a65a0cdcd82a92ae8d65e74d450ff3fbc # v4.1.4 + with: + update-comment: false + coverage-files: ./contracts/lcov.info.pruned + minimum-coverage: ${{ matrix.product.setup.min-coverage }} + artifact-name: code-coverage-report-${{ matrix.product.name }} + working-directory: ./contracts - name: Collect Metrics - if: needs.changes.outputs.changes == 'true' + if: ${{ contains(fromJson(needs.changes.outputs.all_changes), matrix.product.name) + || contains(fromJson(needs.changes.outputs.all_changes), 'shared') + || needs.changes.outputs.non_src_changes == 'true' }} id: collect-gha-metrics uses: smartcontractkit/push-gha-metrics-action@d9da21a2747016b3e13de58c7d4115a3d5c97935 # v3.0.1 with: - id: solidity-foundry + id: ${{ matrix.product.name }}-solidity-foundry + org-id: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} + basic-auth: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} + hostname: ${{ secrets.GRAFANA_INTERNAL_HOST }} + this-job-name: Foundry Tests ${{ matrix.product.name }} + continue-on-error: true + + # runs only if non-test contracts were modified; scoped only to modified or added contracts + analyze: + needs: [ changes, define-matrix ] + name: Run static analysis + if: needs.changes.outputs.not_test_sol_modified == 'true' + runs-on: ubuntu-22.04 + steps: + - name: Checkout this repository + uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 + + - name: Checkout .github repository + uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 + with: + repository: smartcontractkit/.github + ref: b6e37806737eef87e8c9137ceeb23ef0bff8b1db # validate-solidity-artifacts@0.1.0 + path: ./dot_github + + - name: Setup NodeJS + uses: ./.github/actions/setup-nodejs + + - name: Install Foundry + uses: foundry-rs/foundry-toolchain@8f1998e9878d786675189ef566a2e4bf24869773 # v1.2.0 + with: + version: ${{ needs.define-matrix.outputs.foundry-version }} + + - name: Set up Python + uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f #v5.1.1 + with: + python-version: '3.8' + + - name: Install solc-select and solc + uses: smartcontractkit/.github/actions/setup-solc-select@b6e37806737eef87e8c9137ceeb23ef0bff8b1db # validate-solidity-artifacts@0.1.0 + with: + to_install: '0.8.24' + to_use: '0.8.24' + + - name: Install Slither + uses: smartcontractkit/.github/actions/setup-slither@b6e37806737eef87e8c9137ceeb23ef0bff8b1db # validate-solidity-artifacts@0.1.0 + + - name: Run Slither + shell: bash + run: | + # modify remappings so that solc can find dependencies + ./dot_github/tools/scripts/solidity/modify_remappings.sh contracts contracts/remappings.txt + mv remappings_modified.txt remappings.txt + + # without it Slither sometimes fails to use remappings correctly + cp contracts/foundry.toml foundry.toml + + FILES="${{ needs.changes.outputs.not_test_sol_modified_files }}" + + for FILE in $FILES; do + PRODUCT=$(echo "$FILE" | awk -F'src/[^/]*/' '{print $2}' | cut -d'/' -f1) + echo "::debug::Running Slither for $FILE in $PRODUCT" + SLITHER_CONFIG="contracts/configs/slither/.slither.config-$PRODUCT-pr.json" + if [[ ! -f $SLITHER_CONFIG ]]; then + echo "::debug::No Slither config found for $PRODUCT, using default" + SLITHER_CONFIG="contracts/configs/slither/.slither.config-default-pr.json" + fi + ./dot_github/tools/scripts/solidity/generate_slither_report.sh "${{ github.server_url }}/${{ github.repository }}/blob/${{ github.sha }}/" "$SLITHER_CONFIG" "./contracts" "$FILE" "contracts/slither-reports-current" "--solc-remaps @=contracts/node_modules/@" + done + + # all the actions below, up to printing results, run only if any existing contracts were modified + # in that case we extract new issues introduced by the changes by using an LLM model + - name: Upload Slither results for current branch + if: needs.changes.outputs.sol_mod_only == 'true' + uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4 + timeout-minutes: 2 + continue-on-error: true + with: + name: slither-reports-current-${{ github.sha }} + path: contracts/slither-reports-current + retention-days: 7 + + # we need to upload scripts and configuration in case base_ref doesn't have the scripts, or they are in different version + - name: Upload Slither scripts + if: needs.changes.outputs.sol_mod_only == 'true' + uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4 + timeout-minutes: 2 + continue-on-error: true + with: + name: tmp-slither-scripts-${{ github.sha }} + path: ./dot_github/tools/scripts/solidity + retention-days: 7 + + - name: Upload configs + if: needs.changes.outputs.sol_mod_only == 'true' + uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4 + timeout-minutes: 2 + continue-on-error: true + with: + name: tmp-configs-${{ github.sha }} + path: contracts/configs + retention-days: 7 + + - name: Checkout earlier version of this repository + if: needs.changes.outputs.sol_mod_only == 'true' + uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 + with: + ref: ${{ github.base_ref }} + + - name: Download Slither scripts + if: needs.changes.outputs.sol_mod_only == 'true' + uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7 + with: + name: tmp-slither-scripts-${{ github.sha }} + path: ./dot_github/tools/scripts/solidity + + - name: Download configs + if: needs.changes.outputs.sol_mod_only == 'true' + uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7 + with: + name: tmp-configs-${{ github.sha }} + path: contracts/configs + + # since we have just checked out the repository again, we lose NPM dependencies installs previously, we need to install them again to compile contracts + - name: Setup NodeJS + if: needs.changes.outputs.sol_mod_only == 'true' + uses: ./.github/actions/setup-nodejs + + - name: Run Slither for base reference + if: needs.changes.outputs.sol_mod_only == 'true' + shell: bash + run: | + # we need to set file permission again since they are lost during download + for file in ./dot_github/tools/scripts/solidity/*.sh; do + chmod +x "$file" + done + + # modify remappings so that solc can find dependencies + ./dot_github/tools/scripts/solidity/modify_remappings.sh contracts contracts/remappings.txt + mv remappings_modified.txt remappings.txt + + # without it Slither sometimes fails to use remappings correctly + cp contracts/foundry.toml foundry.toml + + FILES="${{ needs.changes.outputs.sol_mod_only_files }}" + + for FILE in $FILES; do + PRODUCT=$(echo "$FILE" | awk -F'src/[^/]*/' '{print $2}' | cut -d'/' -f1) + echo "::debug::Running Slither for $FILE in $PRODUCT" + SLITHER_CONFIG="contracts/configs/slither/.slither.config-$PRODUCT-pr.json" + if [[ ! -f $SLITHER_CONFIG ]]; then + echo "::debug::No Slither config found for $PRODUCT, using default" + SLITHER_CONFIG="contracts/configs/slither/.slither.config-default-pr.json" + fi + ./dot_github/tools/scripts/solidity/generate_slither_report.sh "${{ github.server_url }}/${{ github.repository }}/blob/${{ github.sha }}/" "$SLITHER_CONFIG" "./contracts" "$FILE" "contracts/slither-reports-base-ref" "--solc-remaps @=contracts/node_modules/@" + done + + - name: Upload Slither report + if: needs.changes.outputs.sol_mod_only == 'true' + uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4 + timeout-minutes: 10 + continue-on-error: true + with: + name: slither-reports-base-${{ github.sha }} + path: | + contracts/slither-reports-base-ref + retention-days: 7 + + - name: Download Slither results for current branch + if: needs.changes.outputs.sol_mod_only == 'true' + uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7 + with: + name: slither-reports-current-${{ github.sha }} + path: contracts/slither-reports-current + + - name: Generate diff of Slither reports for modified files + if: needs.changes.outputs.sol_mod_only == 'true' + env: + OPEN_API_KEY: ${{ secrets.OPEN_AI_SLITHER_API_KEY }} + shell: bash + run: | + set -euo pipefail + for base_report in contracts/slither-reports-base-ref/*.md; do + filename=$(basename "$base_report") + current_report="contracts/slither-reports-current/$filename" + new_issues_report="contracts/slither-reports-current/${filename%.md}_new_issues.md" + if [ -f "$current_report" ]; then + if ./contracts/scripts/ci/find_slither_report_diff.sh "$base_report" "$current_report" "$new_issues_report" "contracts/scripts/ci/prompt-difference.md" "contracts/scripts/ci/prompt-validation.md"; then + if [[ -s $new_issues_report ]]; then + awk 'NR==2{print "*This new issues report has been automatically generated by LLM model using two Slither reports. One based on `${{ github.base_ref}}` and another on `${{ github.sha }}` commits.*"}1' $new_issues_report > tmp.md && mv tmp.md $new_issues_report + echo "Replacing full Slither report with diff for $current_report" + rm $current_report && mv $new_issues_report $current_report + else + echo "No difference detected between $base_report and $current_report reports. Won't include any of them." + rm $current_report + fi + else + echo "::warning::Failed to generate a diff report with new issues for $base_report using an LLM model, will use full report." + fi + + else + echo "::warning::Failed to find current commit's equivalent of $base_report (file $current_report doesn't exist, but should have been generated). Please check Slither logs." + fi + done + + # actions that execute only if any existing contracts were modified end here + - name: Print Slither summary + shell: bash + run: | + echo "# Static analysis results " >> $GITHUB_STEP_SUMMARY + for file in "contracts/slither-reports-current"/*.md; do + if [ -e "$file" ]; then + cat "$file" >> $GITHUB_STEP_SUMMARY + fi + done + + - name: Validate if all Slither run for all contracts + uses: smartcontractkit/.github/actions/validate-solidity-artifacts@094e8de69ca35d17f321cecc062cbeed12642ef5 # validate-solidity-artifacts@0.2.0 + with: + validate_slither_reports: 'true' + validate_uml_diagrams: 'false' + slither_reports_path: 'contracts/slither-reports-current' + sol_files: ${{ needs.changes.outputs.not_test_sol_modified_files }} + + - name: Upload Slither reports + uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4 + timeout-minutes: 10 + continue-on-error: true + with: + name: slither-reports-${{ github.sha }} + path: | + contracts/slither-reports-current + retention-days: 7 + + - name: Find Slither comment in the PR + # We only want to create the comment if the PR is not modified by a bot + if: "(github.event_name == 'push' && github.event.pusher.username && ! contains(github.event.pusher.username, '[bot]')) || (github.event_name != 'push' && ! contains(github.actor, '[bot]'))" + uses: peter-evans/find-comment@3eae4d37986fb5a8592848f6a574fdf654e61f9e # v3.0.0 + id: find-comment + with: + issue-number: ${{ github.event.pull_request.number }} + comment-author: 'github-actions[bot]' + body-includes: 'Static analysis results' + + - name: Extract job summary URL + id: job-summary-url + uses: pl-strflt/job-summary-url-action@df2d22c5351f73e0a187d20879854b8d98e6e001 # v1.0.0 + with: + job: 'Run static analysis' + + - name: Build Slither reports artifacts URL + id: build-slither-artifact-url + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + ARTIFACTS=$(gh api -X GET repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts) + ARTIFACT_ID=$(echo "$ARTIFACTS" | jq '.artifacts[] | select(.name=="slither-reports-${{ github.sha }}") | .id') + echo "Artifact ID: $ARTIFACT_ID" + + slither_artifact_url="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts/$ARTIFACT_ID" + echo "slither_artifact_url=$slither_artifact_url" >> $GITHUB_OUTPUT + + - name: Create or update Slither comment in the PR + # We only want to create the comment if the PR is not modified by a bot + if: "(github.event_name == 'push' && github.event.pusher.username && ! contains(github.event.pusher.username, '[bot]')) || (github.event_name != 'push' && ! contains(github.actor, '[bot]'))" + uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 # v4.0.0 + with: + comment-id: ${{ steps.find-comment.outputs.comment-id }} + issue-number: ${{ github.event.pull_request.number }} + body: | + ## Static analysis results are available + Hey @${{ github.event.push && github.event.push.pusher && github.event.push.pusher.username || github.actor }}, you can view Slither reports in the job summary [here](${{ steps.job-summary-url.outputs.job_summary_url }}) or download them as artifact [here](${{ steps.build-slither-artifact-url.outputs.slither_artifact_url }}). + + Please check them before merging and make sure you have addressed all issues. + edit-mode: replace + + - name: Remove temp artifacts + uses: geekyeggo/delete-artifact@24928e75e6e6590170563b8ddae9fac674508aa1 # v5.0 + with: + name: tmp-* + + - name: Collect Metrics + id: collect-gha-metrics + uses: smartcontractkit/push-gha-metrics-action@dea9b546553cb4ca936607c2267a09c004e4ab3f # v3.0.0 + with: + id: solidity-foundry-slither + org-id: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} + basic-auth: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} + hostname: ${{ secrets.GRAFANA_INTERNAL_HOST }} + this-job-name: Run static analysis + continue-on-error: true + + solidity-forge-fmt: + name: Forge fmt ${{ matrix.product.name }} + if: ${{ needs.changes.outputs.non_src_changes == 'true' || needs.changes.outputs.not_test_sol_modified == 'true' }} + needs: [define-matrix, changes] + strategy: + fail-fast: false + matrix: + product: ${{fromJson(needs.define-matrix.outputs.matrix)}} + runs-on: ubuntu-22.04 + steps: + - name: Checkout the repo + if: ${{ (contains(fromJson(needs.changes.outputs.all_changes), matrix.product.name) || needs.changes.outputs.non_src_changes == 'true') && matrix.product.setup.run-forge-fmt }} + uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 + with: + submodules: recursive + + - name: Setup NodeJS + if: ${{ (contains(fromJson(needs.changes.outputs.all_changes), matrix.product.name) || needs.changes.outputs.non_src_changes == 'true') && matrix.product.setup.run-forge-fmt }} + uses: ./.github/actions/setup-nodejs + + - name: Install Foundry + if: ${{ (contains(fromJson(needs.changes.outputs.all_changes), matrix.product.name) || needs.changes.outputs.non_src_changes == 'true') && matrix.product.setup.run-forge-fmt }} + uses: foundry-rs/foundry-toolchain@8f1998e9878d786675189ef566a2e4bf24869773 # v1.2.0 + with: + version: ${{ needs.define-matrix.outputs.foundry-version }} + + - name: Run Forge fmt + if: ${{ (contains(fromJson(needs.changes.outputs.all_changes), matrix.product.name) || needs.changes.outputs.non_src_changes == 'true') && matrix.product.setup.run-forge-fmt }} + run: forge fmt --check + id: fmt + working-directory: contracts + env: + FOUNDRY_PROFILE: ${{ matrix.product.name }} + + - name: Collect Metrics + if: ${{ (contains(fromJson(needs.changes.outputs.all_changes), matrix.product.name) || needs.changes.outputs.non_src_changes == 'true') && matrix.product.setup.run-forge-fmt }} + id: collect-gha-metrics + uses: smartcontractkit/push-gha-metrics-action@dea9b546553cb4ca936607c2267a09c004e4ab3f # v3.0.0 + with: + id: solidity-forge-fmt-${{ matrix.product.name }} org-id: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} basic-auth: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} hostname: ${{ secrets.GRAFANA_INTERNAL_HOST }} - this-job-name: Foundry Tests ${{ matrix.product }} + this-job-name: Forge fmt ${{ matrix.product.name }} continue-on-error: true diff --git a/.github/workflows/solidity-hardhat.yml b/.github/workflows/solidity-hardhat.yml index fb6ba6fef43..705fad3be60 100644 --- a/.github/workflows/solidity-hardhat.yml +++ b/.github/workflows/solidity-hardhat.yml @@ -25,7 +25,7 @@ jobs: with: filters: | src: - - 'contracts/src/!(v0.8/(ccip|functions|keystone|l2ep|llo-feeds|transmission|vrf)/**)/**/*' + - 'contracts/src/!(v0.8/(ccip|functions|keystone|l2ep|liquiditymanager|llo-feeds|transmission|vrf)/**)/**/*' - 'contracts/test/**/*' - 'contracts/package.json' - 'contracts/pnpm-lock.yaml' @@ -84,4 +84,4 @@ jobs: basic-auth: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} hostname: ${{ secrets.GRAFANA_INTERNAL_HOST }} this-job-name: Solidity - continue-on-error: true \ No newline at end of file + continue-on-error: true diff --git a/.github/workflows/solidity-tracability.yml b/.github/workflows/solidity-tracability.yml new file mode 100644 index 00000000000..37f5399535b --- /dev/null +++ b/.github/workflows/solidity-tracability.yml @@ -0,0 +1,203 @@ +# This workflow handles the enforcement of code Traceability via changesets and jira issue linking for our Solidity codebase. +name: Solidity Tracability + +on: + merge_group: + pull_request: + +defaults: + run: + shell: bash + +jobs: + files-changed: + # The job skips on merge_group events, and any release branches, and forks + # Since we only want to enforce Jira issues on pull requests related to feature branches + if: ${{ github.event_name != 'merge_group' && !startsWith(github.head_ref, 'release/') && github.event.pull_request.head.repo.full_name == 'smartcontractkit/chainlink' }} + name: Detect Changes + runs-on: ubuntu-latest + outputs: + source: ${{ steps.files-changed.outputs.source }} + changesets: ${{ steps.files-changed.outputs.changesets }} + changesets_files: ${{ steps.files-changed.outputs.changesets_files }} + steps: + - name: Checkout the repo + uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 + + - name: Filter paths + uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2 + id: files-changed + with: + list-files: "csv" + # This is a valid input, see https://github.com/dorny/paths-filter/pull/226 + predicate-quantifier: "every" + filters: | + source: + - contracts/**/*.sol + - '!contracts/**/*.t.sol' + changesets: + - added|modified: 'contracts/.changeset/**' + + enforce-traceability: + # Note: A job that is skipped will report its status as "Success". + # It will not prevent a pull request from merging, even if it is a required check. + needs: [files-changed] + # We only want to run this job if the source files have changed + if: ${{ needs.files-changed.outputs.source == 'true' }} + name: Enforce Traceability + runs-on: ubuntu-latest + permissions: + actions: read + id-token: write + contents: read + pull-requests: write + steps: + # https://github.com/planetscale/ghcommit-action/blob/c7915d6c18d5ce4eb42b0eff3f10a29fe0766e4c/README.md?plain=1#L41 + # + # Include the pull request ref in the checkout action to prevent merge commit + # https://github.com/actions/checkout?tab=readme-ov-file#checkout-pull-request-head-commit-instead-of-merge-commit + - name: Checkout the repo + uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 + with: + ref: ${{ github.event.pull_request.head.sha }} + + - name: Assume role capable of dispatching action + uses: smartcontractkit/.github/actions/setup-github-token@ef78fa97bf3c77de6563db1175422703e9e6674f # setup-github-token@0.2.1 + id: get-gh-token + with: + aws-role-arn: ${{ secrets.AWS_OIDC_CHAINLINK_CI_AUTO_PR_TOKEN_ISSUER_ROLE_ARN }} + aws-lambda-url: ${{ secrets.AWS_INFRA_RELENG_TOKEN_ISSUER_LAMBDA_URL }} + aws-region: ${{ secrets.AWS_REGION }} + + - name: Make a comment + uses: thollander/actions-comment-pull-request@fabd468d3a1a0b97feee5f6b9e499eab0dd903f6 # v2.5.0 + with: + message: | + I see you updated files related to `contracts`. Please run `pnpm changeset` in the `contracts` directory to add a changeset. + reactions: eyes + comment_tag: changeset-contracts + # If the changeset is added, then we delete the comment, otherwise we add it. + mode: ${{ needs.files-changed.outputs.changesets == 'true' && 'delete' || 'upsert' }} + # We only create the comment if the changeset is not added + create_if_not_exists: ${{ needs.files-changed.outputs.changesets == 'true' && 'false' || 'true' }} + + - name: Check for new changeset for contracts + if: ${{ needs.files-changed.outputs.changesets == 'false' }} + shell: bash + run: | + echo "Please run pnpm changeset to add a changeset for contracts." + exit 1 + + - name: Setup NodeJS + uses: ./.github/actions/setup-nodejs + + - name: Checkout .Github repository + uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 + with: + repository: smartcontractkit/.github + ref: 9aed33e5298471f20a3d630d711b96ae5538728c # jira-tracing@0.2.0 + path: ./dot_github + + # we need to set the top level directory for the jira-tracing action manually + # because now we are working with two repositories and automatic detection would + # select the repository with jira-tracing and not the chainlink repository + - name: Setup git top level directory + id: find-git-top-level-dir + run: echo "top_level_dir=$(pwd)" >> $GITHUB_OUTPUT + + - name: Setup Jira + working-directory: ./dot_github + run: pnpm install --filter jira-tracing + + # Because of our earlier checks, we know that both the source and changeset files have changed + - name: Enforce Traceability + working-directory: ./dot_github + run: | + echo "COMMIT_MESSAGE=$(git log -1 --pretty=format:'%s')" >> $GITHUB_ENV + pnpm --filter jira-tracing issue:enforce + env: + CHANGESET_FILES: ${{ needs.files-changed.outputs.changesets_files }} + GIT_TOP_LEVEL_DIR: ${{ steps.find-git-top-level-dir.outputs.top_level_dir }} + + PR_TITLE: ${{ github.event.pull_request.title }} + BRANCH_NAME: ${{ github.event.pull_request.head.ref }} + + JIRA_HOST: ${{ vars.JIRA_HOST }} + JIRA_USERNAME: ${{ secrets.JIRA_USERNAME }} + JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }} + + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Enforce Solidity Review Jira issue + working-directory: ./dot_github + shell: bash + run: | + # we do not want to fail the workflow if there are issues with the script + if ! pnpm --filter jira-tracing issue:enforce-solidity-review; then + echo "::warning::Failed to enforce Solidity Review Jira issue, this is not a blocking issue. You can safely ignore it." + fi + env: + CHANGESET_FILES: ${{ needs.files-changed.outputs.changesets_files }} + GIT_TOP_LEVEL_DIR: ${{ steps.find-git-top-level-dir.outputs.top_level_dir }} + + SOLIDITY_REVIEW_TEMPLATE_KEY: 'TT-1756' + EXPORT_JIRA_ISSUE_KEYS: 'true' + + JIRA_HOST: ${{ vars.JIRA_HOST }} + JIRA_USERNAME: ${{ secrets.JIRA_USERNAME }} + JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }} + + # Commit appended changeset file back to repo + - uses: planetscale/ghcommit-action@13a844326508cdefc72235201bb0446d6d10a85f # v0.1.6 + with: + commit_message: "[Bot] Update changeset file with jira issues" + repo: ${{ github.repository }} + branch: ${{ github.head_ref }} + file_pattern: "contracts/.changeset/*" + env: + GITHUB_TOKEN: ${{ steps.get-gh-token.outputs.access-token }} + + - name: Read issue keys from env vars + shell: bash + id: read-issue-keys + run: | + # issue:enforce-solidity-review should have set two env vars with the issue keys + echo "Jira issue key related to pr: ${{ env.PR_JIRA_ISSUE_KEY }}" + echo "Jira issue key related to solidity review: ${{ env.SOLIDITY_REVIEW_JIRA_ISSUE_KEY }}" + + - name: Find traceability comment in the PR + uses: peter-evans/find-comment@3eae4d37986fb5a8592848f6a574fdf654e61f9e # v3.0.0 + id: find-comment + with: + issue-number: ${{ github.event.pull_request.number }} + comment-author: 'github-actions[bot]' + body-includes: 'Solidity Review Jira issue' + + - name: Create or update traceability comment in the PR + uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 # v4.0.0 + with: + comment-id: ${{ steps.find-comment.outputs.comment-id }} + issue-number: ${{ github.event.pull_request.number }} + body: | + ## Solidity Review Jira issue + Hey! We have taken the liberty to link this PR to a Jira issue for Solidity Review. + + This is a new feature, that's currently in the pilot phase, so please make sure that the linkage is correct. In a contrary case, please update it manually in JIRA and replace Solidity Review issue key in the changeset file with the correct one. + Please reach out to the Test Tooling team and notify them about any issues you encounter. + + Any changes to the Solidity Review Jira issue should be reflected in the changeset file. If you need to update the issue key, please do so manually in the following changeset file: `${{ needs.files-changed.outputs.changesets_files }}` + + This PR has been linked to Solidity Review Jira issue: [${{ env.SOLIDITY_REVIEW_JIRA_ISSUE_KEY }}](${{ vars.JIRA_HOST }}browse/${{ env.SOLIDITY_REVIEW_JIRA_ISSUE_KEY }}) + edit-mode: replace + + - name: Collect Metrics + id: collect-gha-metrics + if: always() + uses: smartcontractkit/push-gha-metrics-action@d9da21a2747016b3e13de58c7d4115a3d5c97935 # v3.0.1 + with: + id: soldity-traceability + org-id: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} + basic-auth: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} + hostname: ${{ secrets.GRAFANA_INTERNAL_HOST }} + this-job-name: Enforce Traceability + continue-on-error: true diff --git a/.github/workflows/solidity-wrappers.yml b/.github/workflows/solidity-wrappers.yml index bbd7ac0c670..5f593f3a334 100644 --- a/.github/workflows/solidity-wrappers.yml +++ b/.github/workflows/solidity-wrappers.yml @@ -2,7 +2,7 @@ name: Solidity Wrappers # This is its own workflow file rather than being merged into "solidity.yml" to avoid over complicating the conditionals # used for job execution. The jobs in "solidity.yml" are configured around push events, whereas # we only want to generate gethwrappers during pull requests. -on: +on: pull_request: types: - opened @@ -31,7 +31,7 @@ jobs: # On a pull request event, make updates to gethwrappers if there are changes. update-wrappers: needs: [changes] - if: needs.changes.outputs.changes == 'true' + if: needs.changes.outputs.changes == 'true' name: Update Wrappers permissions: actions: read @@ -65,7 +65,7 @@ jobs: - name: Commit any wrapper changes uses: planetscale/ghcommit-action@21a8cda29f55e5cc2cdae0cdbdd08e38dd148c25 # v0.1.37 with: - commit_message: "Update gethwrappers" + commit_message: "Update gethwrappers" repo: ${{ github.repository }} branch: ${{ github.head_ref }} file_pattern: "core/gethwrappers/**/generated/*.go core/gethwrappers/**/generated-wrapper-dependency-versions-do-not-edit.txt" @@ -80,5 +80,5 @@ jobs: org-id: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} basic-auth: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} hostname: ${{ secrets.GRAFANA_INTERNAL_HOST }} - this-job-name: Update Wrappers + this-job-name: Update Wrappers continue-on-error: true diff --git a/.github/workflows/solidity.yml b/.github/workflows/solidity.yml index dff35b3cc93..10193bfc2ec 100644 --- a/.github/workflows/solidity.yml +++ b/.github/workflows/solidity.yml @@ -9,6 +9,18 @@ defaults: shell: bash jobs: + readonly_changes: + name: Detect readonly solidity file changes + runs-on: ubuntu-latest + outputs: + changes: ${{ steps.ch.outputs.changes }} + steps: + - name: Checkout the repo + uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 + - name: Detect readonly solidity file changes + id: ch + uses: ./.github/actions/detect-solidity-readonly-file-changes + changes: name: Detect changes runs-on: ubuntu-latest @@ -31,15 +43,15 @@ jobs: release-version: ${{ steps.release-tag-check.outputs.release-version }} pre-release-version: ${{ steps.release-tag-check.outputs.pre-release-version }} steps: - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 - name: Check release tag id: release-tag-check - uses: smartcontractkit/chainlink-github-actions/release/release-tag-check@2031e56eb4edb8115ce8ba07cbbfb457149d865d # v2.3.8 + uses: smartcontractkit/chainlink-github-actions/release/release-tag-check@5dd916d08c03cb5f9a97304f4f174820421bb946 # v2.3.11 env: # Match semver git tags with a "contracts-" prefix. RELEASE_REGEX: '^contracts-v[0-9]+\.[0-9]+\.[0-9]+$' PRE_RELEASE_REGEX: '^contracts-v[0-9]+\.[0-9]+\.[0-9]+-(.+)$' - # Get the version by stripping the "contracts-v" prefix. + # Get the version by stripping the "contracts-v" prefix. VERSION_PREFIX: 'contracts-v' prepublish-test: @@ -171,7 +183,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout the repo - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 - name: Setup NodeJS uses: ./.github/actions/setup-nodejs @@ -211,7 +223,7 @@ jobs: contents: write steps: - name: Checkout the repo - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 - name: Setup NodeJS uses: ./.github/actions/setup-nodejs diff --git a/.gitignore b/.gitignore index 4f07e40516c..4c4e76bee98 100644 --- a/.gitignore +++ b/.gitignore @@ -69,10 +69,13 @@ ztarrepo.tar.gz **/test-ledger/* __debug_bin* .test_summary/ +db_dumps/ .run.id integration-tests/**/traces/ benchmark_report.csv benchmark_summary.json +secrets.toml +tmp_laneconfig/ # goreleaser builds cosign.* @@ -83,6 +86,7 @@ MacOSX* *report.xml *report.json *.out +dot_graphs/ contracts/yarn.lock @@ -99,7 +103,9 @@ tools/flakeytests/coverage.txt # Runtime test configuration that might contain secrets override*.toml -# Pythin venv +# Python venv .venv/ ocr_soak_report.csv + +vendor/* diff --git a/.golangci.yml b/.golangci.yml index 7155cff2d51..72f52bd4528 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -71,9 +71,10 @@ linters-settings: - name: error-return - name: error-strings - name: error-naming + - name: exported - name: if-return - name: increment-decrement - # - name: var-naming + - name: var-naming - name: var-declaration - name: package-comments - name: range @@ -92,7 +93,7 @@ linters-settings: - name: struct-tag # - name: string-format - name: string-of-int - # - name: range-val-address + - name: range-val-address - name: range-val-in-closure - name: modifies-value-receiver - name: modifies-parameter diff --git a/.goreleaser.ccip.develop.yaml b/.goreleaser.ccip.develop.yaml new file mode 100644 index 00000000000..595fe14c27b --- /dev/null +++ b/.goreleaser.ccip.develop.yaml @@ -0,0 +1,229 @@ +project_name: chainlink + +version: 2 + +env: + - ZIG_EXEC={{ if index .Env "ZIG_EXEC" }}{{ .Env.ZIG_EXEC }}{{ else }}zig{{ end }} + - IMAGE_PREFIX={{ if index .Env "IMAGE_PREFIX" }}{{ .Env.IMAGE_PREFIX }}{{ else }}localhost:5001{{ end }} + - IMAGE_NAME={{ if index .Env "IMAGE_NAME" }}{{ .Env.IMAGE_NAME }}{{ else }}chainlink{{ end }} + - IMAGE_TAG={{ if index .Env "IMAGE_TAG" }}{{ .Env.IMAGE_TAG }}{{ else }}develop{{ end }} + - IMAGE_LABEL_DESCRIPTION="node of the decentralized oracle network, bridging on and off-chain computation" + - IMAGE_LABEL_LICENSES="MIT" + - IMAGE_LABEL_SOURCE="https://github.com/smartcontractkit/{{ .ProjectName }}" + +before: + hooks: + - go mod tidy + - ./tools/bin/goreleaser_utils before_hook + +# See https://goreleaser.com/customization/build/ +builds: + - binary: chainlink + id: linux-arm64 + goos: + - linux + goarch: + - arm64 + hooks: + post: ./tools/bin/goreleaser_utils build_post_hook {{ dir .Path }} {{ .Os }} {{ .Arch }} + env: + - CGO_ENABLED=1 + - CC=$ZIG_EXEC cc -target aarch64-linux-gnu + - CCX=$ZIG_EXEC c++ -target aarch64-linux-gnu + flags: + - -trimpath + - -buildmode=pie + ldflags: + - -s -w -r=$ORIGIN/libs + - -X github.com/smartcontractkit/chainlink/v2/core/static.Version={{ .Env.CHAINLINK_VERSION }} + - -X github.com/smartcontractkit/chainlink/v2/core/static.Sha={{ .FullCommit }} + - binary: chainlink + id: linux-amd64 + goos: + - linux + goarch: + - amd64 + hooks: + post: ./tools/bin/goreleaser_utils build_post_hook {{ dir .Path }} {{ .Os }} {{ .Arch }} + env: + - CGO_ENABLED=1 + - CC=$ZIG_EXEC cc -target x86_64-linux-gnu + - CCX=$ZIG_EXEC c++ -target x86_64-linux-gnu + flags: + - -trimpath + - -buildmode=pie + ldflags: + - -s -w -r=$ORIGIN/libs + - -X github.com/smartcontractkit/chainlink/v2/core/static.Version={{ .Env.CHAINLINK_VERSION }} + - -X github.com/smartcontractkit/chainlink/v2/core/static.Sha={{ .FullCommit }} + +# See https://goreleaser.com/customization/docker/ +dockers: + - id: linux-amd64 + dockerfile: core/chainlink.goreleaser.Dockerfile + use: buildx + goos: linux + goarch: amd64 + extra_files: + - tmp/linux_amd64/libs + - tools/bin/ldd_fix + - ccip/config + build_flag_templates: + - "--platform=linux/amd64" + - "--pull" + - "--build-arg=CHAINLINK_USER=chainlink" + - "--build-arg=COMMIT_SHA={{ .FullCommit }}" + - "--build-arg=CL_CHAIN_DEFAULTS=/chainlink/ccip-config" + - "--label=org.opencontainers.image.created={{ .Date }}" + - "--label=org.opencontainers.image.description={{ .Env.IMAGE_LABEL_DESCRIPTION }}" + - "--label=org.opencontainers.image.licenses={{ .Env.IMAGE_LABEL_LICENSES }}" + - "--label=org.opencontainers.image.revision={{ .FullCommit }}" + - "--label=org.opencontainers.image.source={{ .Env.IMAGE_LABEL_SOURCE }}" + - "--label=org.opencontainers.image.title={{ .ProjectName }}" + - "--label=org.opencontainers.image.version={{ .Env.CHAINLINK_VERSION }}" + - "--label=org.opencontainers.image.url={{ .Env.IMAGE_LABEL_SOURCE }}" + image_templates: + - "{{ .Env.IMAGE_PREFIX }}/{{ .Env.IMAGE_NAME }}:{{ .Env.IMAGE_TAG }}" + - "{{ .Env.IMAGE_PREFIX }}/{{ .Env.IMAGE_NAME }}:{{ .Env.IMAGE_TAG }}-amd64" + - "{{ .Env.IMAGE_PREFIX }}/{{ .Env.IMAGE_NAME }}:sha-{{ .ShortCommit }}-amd64" + - id: linux-arm64 + dockerfile: core/chainlink.goreleaser.Dockerfile + use: buildx + goos: linux + goarch: arm64 + extra_files: + - tmp/linux_arm64/libs + - tools/bin/ldd_fix + - ccip/config + build_flag_templates: + - "--platform=linux/arm64" + - "--pull" + - "--build-arg=CHAINLINK_USER=chainlink" + - "--build-arg=COMMIT_SHA={{ .FullCommit }}" + - "--build-arg=CL_CHAIN_DEFAULTS=/chainlink/ccip-config" + - "--label=org.opencontainers.image.created={{ .Date }}" + - "--label=org.opencontainers.image.description={{ .Env.IMAGE_LABEL_DESCRIPTION }}" + - "--label=org.opencontainers.image.licenses={{ .Env.IMAGE_LABEL_LICENSES }}" + - "--label=org.opencontainers.image.revision={{ .FullCommit }}" + - "--label=org.opencontainers.image.source={{ .Env.IMAGE_LABEL_SOURCE }}" + - "--label=org.opencontainers.image.title={{ .ProjectName }}" + - "--label=org.opencontainers.image.version={{ .Env.CHAINLINK_VERSION }}" + - "--label=org.opencontainers.image.url={{ .Env.IMAGE_LABEL_SOURCE }}" + image_templates: + - "{{ .Env.IMAGE_PREFIX }}/{{ .Env.IMAGE_NAME }}:{{ .Env.IMAGE_TAG }}-arm64" + - "{{ .Env.IMAGE_PREFIX }}/{{ .Env.IMAGE_NAME }}:sha-{{ .ShortCommit }}-arm64" + - id: linux-amd64-plugins + dockerfile: core/chainlink.goreleaser.Dockerfile + use: buildx + goos: linux + goarch: amd64 + extra_files: + - tmp/linux_amd64/libs + - tmp/linux_amd64/plugins + - tools/bin/ldd_fix + - ccip/config + build_flag_templates: + - "--platform=linux/amd64" + - "--pull" + - "--build-arg=CHAINLINK_USER=chainlink" + - "--build-arg=COMMIT_SHA={{ .FullCommit }}" + - "--build-arg=CL_MEDIAN_CMD=chainlink-feeds" + - "--build-arg=CL_MERCURY_CMD=chainlink-mercury" + - "--build-arg=CL_SOLANA_CMD=chainlink-solana" + - "--build-arg=CL_STARKNET_CMD=chainlink-starknet" + - "--build-arg=CL_CHAIN_DEFAULTS=/chainlink/ccip-config" + - "--label=org.opencontainers.image.created={{ .Date }}" + - "--label=org.opencontainers.image.description={{ .Env.IMAGE_LABEL_DESCRIPTION }}" + - "--label=org.opencontainers.image.licenses={{ .Env.IMAGE_LABEL_LICENSES }}" + - "--label=org.opencontainers.image.revision={{ .FullCommit }}" + - "--label=org.opencontainers.image.source={{ .Env.IMAGE_LABEL_SOURCE }}" + - "--label=org.opencontainers.image.title={{ .ProjectName }}" + - "--label=org.opencontainers.image.version={{ .Env.CHAINLINK_VERSION }}" + - "--label=org.opencontainers.image.url={{ .Env.IMAGE_LABEL_SOURCE }}" + image_templates: + - "{{ .Env.IMAGE_PREFIX }}/{{ .Env.IMAGE_NAME }}:{{ .Env.IMAGE_TAG }}-plugins" + - "{{ .Env.IMAGE_PREFIX }}/{{ .Env.IMAGE_NAME }}:{{ .Env.IMAGE_TAG }}-plugins-amd64" + - "{{ .Env.IMAGE_PREFIX }}/{{ .Env.IMAGE_NAME }}:sha-{{ .ShortCommit }}-plugins-amd64" + - id: linux-arm64-plugins + dockerfile: core/chainlink.goreleaser.Dockerfile + use: buildx + goos: linux + goarch: arm64 + extra_files: + - tmp/linux_arm64/libs + - tmp/linux_arm64/plugins + - tools/bin/ldd_fix + - ccip/config + build_flag_templates: + - "--platform=linux/arm64" + - "--pull" + - "--build-arg=CHAINLINK_USER=chainlink" + - "--build-arg=COMMIT_SHA={{ .FullCommit }}" + - "--build-arg=CL_MEDIAN_CMD=chainlink-feeds" + - "--build-arg=CL_MERCURY_CMD=chainlink-mercury" + - "--build-arg=CL_SOLANA_CMD=chainlink-solana" + - "--build-arg=CL_STARKNET_CMD=chainlink-starknet" + - "--build-arg=CL_CHAIN_DEFAULTS=/chainlink/ccip-config" + - "--label=org.opencontainers.image.created={{ .Date }}" + - "--label=org.opencontainers.image.description={{ .Env.IMAGE_LABEL_DESCRIPTION }}" + - "--label=org.opencontainers.image.licenses={{ .Env.IMAGE_LABEL_LICENSES }}" + - "--label=org.opencontainers.image.revision={{ .FullCommit }}" + - "--label=org.opencontainers.image.source={{ .Env.IMAGE_LABEL_SOURCE }}" + - "--label=org.opencontainers.image.title={{ .ProjectName }}" + - "--label=org.opencontainers.image.version={{ .Env.CHAINLINK_VERSION }}" + - "--label=org.opencontainers.image.url={{ .Env.IMAGE_LABEL_SOURCE }}" + image_templates: + - "{{ .Env.IMAGE_PREFIX }}/{{ .Env.IMAGE_NAME }}:{{ .Env.IMAGE_TAG }}-plugins-arm64" + - "{{ .Env.IMAGE_PREFIX }}/{{ .Env.IMAGE_NAME }}:sha-{{ .ShortCommit }}-plugins-arm64" + +# See https://goreleaser.com/customization/docker_manifest/ +docker_manifests: + - name_template: "{{ .Env.IMAGE_PREFIX }}/{{ .Env.IMAGE_NAME }}:{{ .Env.IMAGE_TAG }}" + image_templates: + - "{{ .Env.IMAGE_PREFIX }}/{{ .Env.IMAGE_NAME }}:{{ .Env.IMAGE_TAG }}" + - "{{ .Env.IMAGE_PREFIX }}/{{ .Env.IMAGE_NAME }}:{{ .Env.IMAGE_TAG }}-amd64" + - "{{ .Env.IMAGE_PREFIX }}/{{ .Env.IMAGE_NAME }}:{{ .Env.IMAGE_TAG }}-arm64" + - name_template: "{{ .Env.IMAGE_PREFIX }}/{{ .Env.IMAGE_NAME }}:sha-{{ .ShortCommit }}" + image_templates: + - "{{ .Env.IMAGE_PREFIX }}/{{ .Env.IMAGE_NAME }}:sha-{{ .ShortCommit }}-amd64" + - "{{ .Env.IMAGE_PREFIX }}/{{ .Env.IMAGE_NAME }}:sha-{{ .ShortCommit }}-arm64" + - name_template: "{{ .Env.IMAGE_PREFIX }}/{{ .Env.IMAGE_NAME }}:{{ .Env.IMAGE_TAG }}-plugins" + image_templates: + - "{{ .Env.IMAGE_PREFIX }}/{{ .Env.IMAGE_NAME }}:{{ .Env.IMAGE_TAG }}-plugins" + - "{{ .Env.IMAGE_PREFIX }}/{{ .Env.IMAGE_NAME }}:{{ .Env.IMAGE_TAG }}-plugins-amd64" + - "{{ .Env.IMAGE_PREFIX }}/{{ .Env.IMAGE_NAME }}:{{ .Env.IMAGE_TAG }}-plugins-arm64" + - name_template: "{{ .Env.IMAGE_PREFIX }}/{{ .Env.IMAGE_NAME }}:sha-{{ .ShortCommit }}-plugins" + image_templates: + - "{{ .Env.IMAGE_PREFIX }}/{{ .Env.IMAGE_NAME }}:sha-{{ .ShortCommit }}-plugins-amd64" + - "{{ .Env.IMAGE_PREFIX }}/{{ .Env.IMAGE_NAME }}:sha-{{ .ShortCommit }}-plugins-arm64" + +# See https://goreleaser.com/customization/docker_sign/ +docker_signs: + - artifacts: all + args: + - "sign" + - "${artifact}" + - "--yes" + +checksum: + name_template: "checksums.txt" + +snapshot: + version_template: "{{ .Env.CHAINLINK_VERSION }}-{{ .ShortCommit }}" + +partial: + by: target + +# See https://goreleaser.com/customization/release/ +release: + disable: true + +changelog: + sort: asc + filters: + exclude: + - "^docs:" + - "^test:" +# modelines, feel free to remove those if you don't want/use them: +# yaml-language-server: $schema=https://goreleaser.com/static/schema.json +# vim: set ts=2 sw=2 tw=0 fo=cnqoj diff --git a/.goreleaser.ccip.production.yaml b/.goreleaser.ccip.production.yaml new file mode 100644 index 00000000000..1247be143ca --- /dev/null +++ b/.goreleaser.ccip.production.yaml @@ -0,0 +1,229 @@ +project_name: chainlink + +version: 2 + +env: + - ZIG_EXEC={{ if index .Env "ZIG_EXEC" }}{{ .Env.ZIG_EXEC }}{{ else }}zig{{ end }} + - IMAGE_PREFIX={{ if index .Env "IMAGE_PREFIX" }}{{ .Env.IMAGE_PREFIX }}{{ else }}localhost:5001{{ end }} + - IMAGE_NAME={{ if index .Env "IMAGE_NAME" }}{{ .Env.IMAGE_NAME }}{{ else }}chainlink{{ end }} + - IMAGE_TAG={{ if index .Env "IMAGE_TAG" }}{{ .Env.IMAGE_TAG }}{{ else }}develop{{ end }} + - IMAGE_LABEL_DESCRIPTION="node of the decentralized oracle network, bridging on and off-chain computation" + - IMAGE_LABEL_LICENSES="MIT" + - IMAGE_LABEL_SOURCE="https://github.com/smartcontractkit/{{ .ProjectName }}" + +before: + hooks: + - go mod tidy + - ./tools/bin/goreleaser_utils before_hook + +# See https://goreleaser.com/customization/build/ +builds: + - binary: chainlink + id: linux-arm64 + goos: + - linux + goarch: + - arm64 + hooks: + post: ./tools/bin/goreleaser_utils build_post_hook {{ dir .Path }} {{ .Os }} {{ .Arch }} + env: + - CGO_ENABLED=1 + - CC=$ZIG_EXEC cc -target aarch64-linux-gnu + - CCX=$ZIG_EXEC c++ -target aarch64-linux-gnu + flags: + - -trimpath + - -buildmode=pie + ldflags: + - -s -w -r=$ORIGIN/libs + - -X github.com/smartcontractkit/chainlink/v2/core/static.Version={{ .Env.CHAINLINK_VERSION }} + - -X github.com/smartcontractkit/chainlink/v2/core/static.Sha={{ .FullCommit }} + - binary: chainlink + id: linux-amd64 + goos: + - linux + goarch: + - amd64 + hooks: + post: ./tools/bin/goreleaser_utils build_post_hook {{ dir .Path }} {{ .Os }} {{ .Arch }} + env: + - CGO_ENABLED=1 + - CC=$ZIG_EXEC cc -target x86_64-linux-gnu + - CCX=$ZIG_EXEC c++ -target x86_64-linux-gnu + flags: + - -trimpath + - -buildmode=pie + ldflags: + - -s -w -r=$ORIGIN/libs + - -X github.com/smartcontractkit/chainlink/v2/core/static.Version={{ .Env.CHAINLINK_VERSION }} + - -X github.com/smartcontractkit/chainlink/v2/core/static.Sha={{ .FullCommit }} + +# See https://goreleaser.com/customization/docker/ +dockers: + - id: linux-amd64 + dockerfile: core/chainlink.goreleaser.Dockerfile + use: buildx + goos: linux + goarch: amd64 + extra_files: + - tmp/linux_amd64/libs + - tools/bin/ldd_fix + - ccip/config + build_flag_templates: + - "--platform=linux/amd64" + - "--pull" + - "--build-arg=CHAINLINK_USER=chainlink" + - "--build-arg=COMMIT_SHA={{ .FullCommit }}" + - "--build-arg=CL_CHAIN_DEFAULTS=/chainlink/ccip-config" + - "--label=org.opencontainers.image.created={{ .Date }}" + - "--label=org.opencontainers.image.description={{ .Env.IMAGE_LABEL_DESCRIPTION }}" + - "--label=org.opencontainers.image.licenses={{ .Env.IMAGE_LABEL_LICENSES }}" + - "--label=org.opencontainers.image.revision={{ .FullCommit }}" + - "--label=org.opencontainers.image.source={{ .Env.IMAGE_LABEL_SOURCE }}" + - "--label=org.opencontainers.image.title={{ .ProjectName }}" + - "--label=org.opencontainers.image.version={{ .Env.CHAINLINK_VERSION }}" + - "--label=org.opencontainers.image.url={{ .Env.IMAGE_LABEL_SOURCE }}" + image_templates: + - "{{ .Env.IMAGE_PREFIX }}/{{ .Env.IMAGE_NAME }}:{{ .Env.IMAGE_TAG }}-amd64" + - "{{ .Env.IMAGE_PREFIX }}/{{ .Env.IMAGE_NAME }}:sha-{{ .ShortCommit }}-amd64" + - id: linux-arm64 + dockerfile: core/chainlink.goreleaser.Dockerfile + use: buildx + goos: linux + goarch: arm64 + extra_files: + - tmp/linux_arm64/libs + - tools/bin/ldd_fix + - ccip/config + build_flag_templates: + - "--platform=linux/arm64" + - "--pull" + - "--build-arg=CHAINLINK_USER=chainlink" + - "--build-arg=COMMIT_SHA={{ .FullCommit }}" + - "--build-arg=CL_CHAIN_DEFAULTS=/chainlink/ccip-config" + - "--label=org.opencontainers.image.created={{ .Date }}" + - "--label=org.opencontainers.image.description={{ .Env.IMAGE_LABEL_DESCRIPTION }}" + - "--label=org.opencontainers.image.licenses={{ .Env.IMAGE_LABEL_LICENSES }}" + - "--label=org.opencontainers.image.revision={{ .FullCommit }}" + - "--label=org.opencontainers.image.source={{ .Env.IMAGE_LABEL_SOURCE }}" + - "--label=org.opencontainers.image.title={{ .ProjectName }}" + - "--label=org.opencontainers.image.version={{ .Env.CHAINLINK_VERSION }}" + - "--label=org.opencontainers.image.url={{ .Env.IMAGE_LABEL_SOURCE }}" + image_templates: + - "{{ .Env.IMAGE_PREFIX }}/{{ .Env.IMAGE_NAME }}:{{ .Env.IMAGE_TAG }}-arm64" + - "{{ .Env.IMAGE_PREFIX }}/{{ .Env.IMAGE_NAME }}:sha-{{ .ShortCommit }}-arm64" + - id: linux-amd64-plugins + dockerfile: core/chainlink.goreleaser.Dockerfile + use: buildx + goos: linux + goarch: amd64 + extra_files: + - tmp/linux_amd64/libs + - tmp/linux_amd64/plugins + - tools/bin/ldd_fix + - ccip/config + build_flag_templates: + - "--platform=linux/amd64" + - "--pull" + - "--build-arg=CHAINLINK_USER=chainlink" + - "--build-arg=COMMIT_SHA={{ .FullCommit }}" + - "--build-arg=CL_MEDIAN_CMD=chainlink-feeds" + - "--build-arg=CL_MERCURY_CMD=chainlink-mercury" + - "--build-arg=CL_SOLANA_CMD=chainlink-solana" + - "--build-arg=CL_STARKNET_CMD=chainlink-starknet" + - "--build-arg=CL_CHAIN_DEFAULTS=/chainlink/ccip-config" + - "--label=org.opencontainers.image.created={{ .Date }}" + - "--label=org.opencontainers.image.description={{ .Env.IMAGE_LABEL_DESCRIPTION }}" + - "--label=org.opencontainers.image.licenses={{ .Env.IMAGE_LABEL_LICENSES }}" + - "--label=org.opencontainers.image.revision={{ .FullCommit }}" + - "--label=org.opencontainers.image.source={{ .Env.IMAGE_LABEL_SOURCE }}" + - "--label=org.opencontainers.image.title={{ .ProjectName }}" + - "--label=org.opencontainers.image.version={{ .Env.CHAINLINK_VERSION }}" + - "--label=org.opencontainers.image.url={{ .Env.IMAGE_LABEL_SOURCE }}" + image_templates: + - "{{ .Env.IMAGE_PREFIX }}/{{ .Env.IMAGE_NAME }}:{{ .Env.IMAGE_TAG }}-plugins-amd64" + - "{{ .Env.IMAGE_PREFIX }}/{{ .Env.IMAGE_NAME }}:sha-{{ .ShortCommit }}-plugins-amd64" + - id: linux-arm64-plugins + dockerfile: core/chainlink.goreleaser.Dockerfile + use: buildx + goos: linux + goarch: arm64 + extra_files: + - tmp/linux_arm64/libs + - tmp/linux_arm64/plugins + - tools/bin/ldd_fix + - ccip/config + build_flag_templates: + - "--platform=linux/arm64" + - "--pull" + - "--build-arg=CHAINLINK_USER=chainlink" + - "--build-arg=COMMIT_SHA={{ .FullCommit }}" + - "--build-arg=CL_MEDIAN_CMD=chainlink-feeds" + - "--build-arg=CL_MERCURY_CMD=chainlink-mercury" + - "--build-arg=CL_SOLANA_CMD=chainlink-solana" + - "--build-arg=CL_STARKNET_CMD=chainlink-starknet" + - "--build-arg=CL_CHAIN_DEFAULTS=/chainlink/ccip-config" + - "--label=org.opencontainers.image.created={{ .Date }}" + - "--label=org.opencontainers.image.description={{ .Env.IMAGE_LABEL_DESCRIPTION }}" + - "--label=org.opencontainers.image.licenses={{ .Env.IMAGE_LABEL_LICENSES }}" + - "--label=org.opencontainers.image.revision={{ .FullCommit }}" + - "--label=org.opencontainers.image.source={{ .Env.IMAGE_LABEL_SOURCE }}" + - "--label=org.opencontainers.image.title={{ .ProjectName }}" + - "--label=org.opencontainers.image.version={{ .Env.CHAINLINK_VERSION }}" + - "--label=org.opencontainers.image.url={{ .Env.IMAGE_LABEL_SOURCE }}" + image_templates: + - "{{ .Env.IMAGE_PREFIX }}/{{ .Env.IMAGE_NAME }}:{{ .Env.IMAGE_TAG }}-plugins-arm64" + - "{{ .Env.IMAGE_PREFIX }}/{{ .Env.IMAGE_NAME }}:sha-{{ .ShortCommit }}-plugins-arm64" + +# See https://goreleaser.com/customization/docker_manifest/ +docker_manifests: + - name_template: "{{ .Env.IMAGE_PREFIX }}/{{ .Env.IMAGE_NAME }}:{{ .Env.IMAGE_TAG }}" + image_templates: + - "{{ .Env.IMAGE_PREFIX }}/{{ .Env.IMAGE_NAME }}:{{ .Env.IMAGE_TAG }}-amd64" + - "{{ .Env.IMAGE_PREFIX }}/{{ .Env.IMAGE_NAME }}:{{ .Env.IMAGE_TAG }}-arm64" + - name_template: "{{ .Env.IMAGE_PREFIX }}/{{ .Env.IMAGE_NAME }}:sha-{{ .ShortCommit }}" + image_templates: + - "{{ .Env.IMAGE_PREFIX }}/{{ .Env.IMAGE_NAME }}:sha-{{ .ShortCommit }}-amd64" + - "{{ .Env.IMAGE_PREFIX }}/{{ .Env.IMAGE_NAME }}:sha-{{ .ShortCommit }}-arm64" + - name_template: "{{ .Env.IMAGE_PREFIX }}/{{ .Env.IMAGE_NAME }}:{{ .Env.IMAGE_TAG }}-plugins" + image_templates: + - "{{ .Env.IMAGE_PREFIX }}/{{ .Env.IMAGE_NAME }}:{{ .Env.IMAGE_TAG }}-plugins-amd64" + - "{{ .Env.IMAGE_PREFIX }}/{{ .Env.IMAGE_NAME }}:{{ .Env.IMAGE_TAG }}-plugins-arm64" + - name_template: "{{ .Env.IMAGE_PREFIX }}/{{ .Env.IMAGE_NAME }}:sha-{{ .ShortCommit }}-plugins" + image_templates: + - "{{ .Env.IMAGE_PREFIX }}/{{ .Env.IMAGE_NAME }}:sha-{{ .ShortCommit }}-plugins-amd64" + - "{{ .Env.IMAGE_PREFIX }}/{{ .Env.IMAGE_NAME }}:sha-{{ .ShortCommit }}-plugins-arm64" + +# See https://goreleaser.com/customization/docker_sign/ +docker_signs: + - artifacts: all + args: + - "sign" + - "${artifact}" + - "--yes" + +checksum: + name_template: "checksums.txt" + +# See https://goreleaser.com/customization/sbom +sboms: + - artifacts: archive + +snapshot: + version_template: "{{ .Env.CHAINLINK_VERSION }}-{{ .ShortCommit }}" + +partial: + by: target + +# See https://goreleaser.com/customization/release/ +release: + disable: true + +changelog: + sort: asc + filters: + exclude: + - "^docs:" + - "^test:" +# modelines, feel free to remove those if you don't want/use them: +# yaml-language-server: $schema=https://goreleaser.com/static/schema.json +# vim: set ts=2 sw=2 tw=0 fo=cnqoj diff --git a/.goreleaser.develop.yaml b/.goreleaser.develop.yaml index 7fbd2aa667b..f8757676f83 100644 --- a/.goreleaser.develop.yaml +++ b/.goreleaser.develop.yaml @@ -1,9 +1,12 @@ -## goreleaser <1.14.0 project_name: chainlink +version: 2 + env: - ZIG_EXEC={{ if index .Env "ZIG_EXEC" }}{{ .Env.ZIG_EXEC }}{{ else }}zig{{ end }} - IMAGE_PREFIX={{ if index .Env "IMAGE_PREFIX" }}{{ .Env.IMAGE_PREFIX }}{{ else }}localhost:5001{{ end }} + - IMAGE_NAME={{ if index .Env "IMAGE_NAME" }}{{ .Env.IMAGE_NAME }}{{ else }}chainlink{{ end }} + - IMAGE_TAG={{ if index .Env "IMAGE_TAG" }}{{ .Env.IMAGE_TAG }}{{ else }}develop{{ end }} - IMAGE_LABEL_DESCRIPTION="node of the decentralized oracle network, bridging on and off-chain computation" - IMAGE_LABEL_LICENSES="MIT" - IMAGE_LABEL_SOURCE="https://github.com/smartcontractkit/{{ .ProjectName }}" @@ -56,18 +59,18 @@ builds: # See https://goreleaser.com/customization/docker/ dockers: - - id: root-linux-amd64 + - id: linux-amd64 dockerfile: core/chainlink.goreleaser.Dockerfile use: buildx goos: linux goarch: amd64 extra_files: - tmp/linux_amd64/libs - - tmp/linux_amd64/plugins - tools/bin/ldd_fix build_flag_templates: - "--platform=linux/amd64" - "--pull" + - "--build-arg=CHAINLINK_USER=chainlink" - "--build-arg=COMMIT_SHA={{ .FullCommit }}" - "--label=org.opencontainers.image.created={{ .Date }}" - "--label=org.opencontainers.image.description={{ .Env.IMAGE_LABEL_DESCRIPTION }}" @@ -78,20 +81,21 @@ dockers: - "--label=org.opencontainers.image.version={{ .Env.CHAINLINK_VERSION }}" - "--label=org.opencontainers.image.url={{ .Env.IMAGE_LABEL_SOURCE }}" image_templates: - - "{{ .Env.IMAGE_PREFIX }}/{{ .ProjectName }}-develop:develop-root-amd64" - - "{{ .Env.IMAGE_PREFIX }}/{{ .ProjectName }}-develop:sha-{{ .ShortCommit }}-root-amd64" - - id: root-linux-arm64 + - "{{ .Env.IMAGE_PREFIX }}/{{ .Env.IMAGE_NAME }}:{{ .Env.IMAGE_TAG }}" + - "{{ .Env.IMAGE_PREFIX }}/{{ .Env.IMAGE_NAME }}:{{ .Env.IMAGE_TAG }}-amd64" + - "{{ .Env.IMAGE_PREFIX }}/{{ .Env.IMAGE_NAME }}:sha-{{ .ShortCommit }}-amd64" + - id: linux-arm64 dockerfile: core/chainlink.goreleaser.Dockerfile use: buildx goos: linux goarch: arm64 extra_files: - tmp/linux_arm64/libs - - tmp/linux_arm64/plugins - tools/bin/ldd_fix build_flag_templates: - "--platform=linux/arm64" - "--pull" + - "--build-arg=CHAINLINK_USER=chainlink" - "--build-arg=COMMIT_SHA={{ .FullCommit }}" - "--label=org.opencontainers.image.created={{ .Date }}" - "--label=org.opencontainers.image.description={{ .Env.IMAGE_LABEL_DESCRIPTION }}" @@ -102,9 +106,9 @@ dockers: - "--label=org.opencontainers.image.version={{ .Env.CHAINLINK_VERSION }}" - "--label=org.opencontainers.image.url={{ .Env.IMAGE_LABEL_SOURCE }}" image_templates: - - "{{ .Env.IMAGE_PREFIX }}/{{ .ProjectName }}-develop:develop-root-arm64" - - "{{ .Env.IMAGE_PREFIX }}/{{ .ProjectName }}-develop:sha-{{ .ShortCommit }}-root-arm64" - - id: linux-amd64 + - "{{ .Env.IMAGE_PREFIX }}/{{ .Env.IMAGE_NAME }}:{{ .Env.IMAGE_TAG }}-arm64" + - "{{ .Env.IMAGE_PREFIX }}/{{ .Env.IMAGE_NAME }}:sha-{{ .ShortCommit }}-arm64" + - id: linux-amd64-plugins dockerfile: core/chainlink.goreleaser.Dockerfile use: buildx goos: linux @@ -118,6 +122,10 @@ dockers: - "--pull" - "--build-arg=CHAINLINK_USER=chainlink" - "--build-arg=COMMIT_SHA={{ .FullCommit }}" + - "--build-arg=CL_MEDIAN_CMD=chainlink-feeds" + - "--build-arg=CL_MERCURY_CMD=chainlink-mercury" + - "--build-arg=CL_SOLANA_CMD=chainlink-solana" + - "--build-arg=CL_STARKNET_CMD=chainlink-starknet" - "--label=org.opencontainers.image.created={{ .Date }}" - "--label=org.opencontainers.image.description={{ .Env.IMAGE_LABEL_DESCRIPTION }}" - "--label=org.opencontainers.image.licenses={{ .Env.IMAGE_LABEL_LICENSES }}" @@ -127,9 +135,10 @@ dockers: - "--label=org.opencontainers.image.version={{ .Env.CHAINLINK_VERSION }}" - "--label=org.opencontainers.image.url={{ .Env.IMAGE_LABEL_SOURCE }}" image_templates: - - "{{ .Env.IMAGE_PREFIX }}/{{ .ProjectName }}-develop:develop-amd64" - - "{{ .Env.IMAGE_PREFIX }}/{{ .ProjectName }}-develop:sha-{{ .ShortCommit }}-amd64" - - id: linux-arm64 + - "{{ .Env.IMAGE_PREFIX }}/{{ .Env.IMAGE_NAME }}:{{ .Env.IMAGE_TAG }}-plugins" + - "{{ .Env.IMAGE_PREFIX }}/{{ .Env.IMAGE_NAME }}:{{ .Env.IMAGE_TAG }}-plugins-amd64" + - "{{ .Env.IMAGE_PREFIX }}/{{ .Env.IMAGE_NAME }}:sha-{{ .ShortCommit }}-plugins-amd64" + - id: linux-arm64-plugins dockerfile: core/chainlink.goreleaser.Dockerfile use: buildx goos: linux @@ -143,6 +152,10 @@ dockers: - "--pull" - "--build-arg=CHAINLINK_USER=chainlink" - "--build-arg=COMMIT_SHA={{ .FullCommit }}" + - "--build-arg=CL_MEDIAN_CMD=chainlink-feeds" + - "--build-arg=CL_MERCURY_CMD=chainlink-mercury" + - "--build-arg=CL_SOLANA_CMD=chainlink-solana" + - "--build-arg=CL_STARKNET_CMD=chainlink-starknet" - "--label=org.opencontainers.image.created={{ .Date }}" - "--label=org.opencontainers.image.description={{ .Env.IMAGE_LABEL_DESCRIPTION }}" - "--label=org.opencontainers.image.licenses={{ .Env.IMAGE_LABEL_LICENSES }}" @@ -152,38 +165,50 @@ dockers: - "--label=org.opencontainers.image.version={{ .Env.CHAINLINK_VERSION }}" - "--label=org.opencontainers.image.url={{ .Env.IMAGE_LABEL_SOURCE }}" image_templates: - - "{{ .Env.IMAGE_PREFIX }}/{{ .ProjectName }}-develop:develop-arm64" - - "{{ .Env.IMAGE_PREFIX }}/{{ .ProjectName }}-develop:sha-{{ .ShortCommit }}-arm64" + - "{{ .Env.IMAGE_PREFIX }}/{{ .Env.IMAGE_NAME }}:{{ .Env.IMAGE_TAG }}-plugins-arm64" + - "{{ .Env.IMAGE_PREFIX }}/{{ .Env.IMAGE_NAME }}:sha-{{ .ShortCommit }}-plugins-arm64" # See https://goreleaser.com/customization/docker_manifest/ docker_manifests: - - name_template: "{{ .Env.IMAGE_PREFIX }}/{{ .ProjectName }}-develop:develop-root" + - name_template: "{{ .Env.IMAGE_PREFIX }}/{{ .Env.IMAGE_NAME }}:{{ .Env.IMAGE_TAG }}" image_templates: - - "{{ .Env.IMAGE_PREFIX }}/{{ .ProjectName }}-develop:develop-root-amd64" - - "{{ .Env.IMAGE_PREFIX }}/{{ .ProjectName }}-develop:develop-root-arm64" - - name_template: "{{ .Env.IMAGE_PREFIX }}/{{ .ProjectName }}-develop:sha-{{ .ShortCommit }}-root" + - "{{ .Env.IMAGE_PREFIX }}/{{ .Env.IMAGE_NAME }}:{{ .Env.IMAGE_TAG }}" + - "{{ .Env.IMAGE_PREFIX }}/{{ .Env.IMAGE_NAME }}:{{ .Env.IMAGE_TAG }}-amd64" + - "{{ .Env.IMAGE_PREFIX }}/{{ .Env.IMAGE_NAME }}:{{ .Env.IMAGE_TAG }}-arm64" + - name_template: "{{ .Env.IMAGE_PREFIX }}/{{ .Env.IMAGE_NAME }}:sha-{{ .ShortCommit }}" image_templates: - - "{{ .Env.IMAGE_PREFIX }}/{{ .ProjectName }}-develop:sha-{{ .ShortCommit }}-root-amd64" - - "{{ .Env.IMAGE_PREFIX }}/{{ .ProjectName }}-develop:sha-{{ .ShortCommit }}-root-arm64" - - name_template: "{{ .Env.IMAGE_PREFIX }}/{{ .ProjectName }}-develop:develop" + - "{{ .Env.IMAGE_PREFIX }}/{{ .Env.IMAGE_NAME }}:sha-{{ .ShortCommit }}-amd64" + - "{{ .Env.IMAGE_PREFIX }}/{{ .Env.IMAGE_NAME }}:sha-{{ .ShortCommit }}-arm64" + - name_template: "{{ .Env.IMAGE_PREFIX }}/{{ .Env.IMAGE_NAME }}:{{ .Env.IMAGE_TAG }}-plugins" image_templates: - - "{{ .Env.IMAGE_PREFIX }}/{{ .ProjectName }}-develop:develop-amd64" - - "{{ .Env.IMAGE_PREFIX }}/{{ .ProjectName }}-develop:develop-arm64" - - name_template: "{{ .Env.IMAGE_PREFIX }}/{{ .ProjectName }}-develop:sha-{{ .ShortCommit }}" + - "{{ .Env.IMAGE_PREFIX }}/{{ .Env.IMAGE_NAME }}:{{ .Env.IMAGE_TAG }}-plugins" + - "{{ .Env.IMAGE_PREFIX }}/{{ .Env.IMAGE_NAME }}:{{ .Env.IMAGE_TAG }}-plugins-amd64" + - "{{ .Env.IMAGE_PREFIX }}/{{ .Env.IMAGE_NAME }}:{{ .Env.IMAGE_TAG }}-plugins-arm64" + - name_template: "{{ .Env.IMAGE_PREFIX }}/{{ .Env.IMAGE_NAME }}:sha-{{ .ShortCommit }}-plugins" image_templates: - - "{{ .Env.IMAGE_PREFIX }}/{{ .ProjectName }}-develop:sha-{{ .ShortCommit }}-amd64" - - "{{ .Env.IMAGE_PREFIX }}/{{ .ProjectName }}-develop:sha-{{ .ShortCommit }}-arm64" + - "{{ .Env.IMAGE_PREFIX }}/{{ .Env.IMAGE_NAME }}:sha-{{ .ShortCommit }}-plugins-amd64" + - "{{ .Env.IMAGE_PREFIX }}/{{ .Env.IMAGE_NAME }}:sha-{{ .ShortCommit }}-plugins-arm64" # See https://goreleaser.com/customization/docker_sign/ docker_signs: - artifacts: all - stdin: "{{ .Env.COSIGN_PASSWORD }}" + args: + - "sign" + - "${artifact}" + - "--yes" checksum: name_template: "checksums.txt" snapshot: - name_template: "{{ .Env.CHAINLINK_VERSION }}-{{ .ShortCommit }}" + version_template: "{{ .Env.CHAINLINK_VERSION }}-{{ .ShortCommit }}" + +partial: + by: target + +# See https://goreleaser.com/customization/release/ +release: + disable: true changelog: sort: asc diff --git a/.goreleaser.devspace.yaml b/.goreleaser.devspace.yaml index bca65e90454..d0167b34cda 100644 --- a/.goreleaser.devspace.yaml +++ b/.goreleaser.devspace.yaml @@ -1,6 +1,7 @@ -## goreleaser <1.14.0 project_name: chainlink-devspace +version: 2 + env: - ZIG_EXEC={{ if index .Env "ZIG_EXEC" }}{{ .Env.ZIG_EXEC }}{{ else }}zig{{ end }} - IMAGE_LABEL_DESCRIPTION="node of the decentralized oracle network, bridging on and off-chain computation" @@ -75,7 +76,7 @@ checksum: name_template: "checksums.txt" snapshot: - name_template: '{{ .Env.CHAINLINK_VERSION }}-{{ .Runtime.Goarch }}-{{ .Now.Format "2006-01-02-15-04-05Z" }}' + version_template: '{{ .Env.CHAINLINK_VERSION }}-{{ .Runtime.Goarch }}-{{ .Now.Format "2006-01-02-15-04-05Z" }}' changelog: sort: asc diff --git a/.goreleaser.production.yaml b/.goreleaser.production.yaml new file mode 100644 index 00000000000..0274f1322b8 --- /dev/null +++ b/.goreleaser.production.yaml @@ -0,0 +1,221 @@ +project_name: chainlink + +version: 2 + +env: + - ZIG_EXEC={{ if index .Env "ZIG_EXEC" }}{{ .Env.ZIG_EXEC }}{{ else }}zig{{ end }} + - IMAGE_PREFIX={{ if index .Env "IMAGE_PREFIX" }}{{ .Env.IMAGE_PREFIX }}{{ else }}localhost:5001{{ end }} + - IMAGE_NAME={{ if index .Env "IMAGE_NAME" }}{{ .Env.IMAGE_NAME }}{{ else }}chainlink{{ end }} + - IMAGE_TAG={{ if index .Env "IMAGE_TAG" }}{{ .Env.IMAGE_TAG }}{{ else }}develop{{ end }} + - IMAGE_LABEL_DESCRIPTION="node of the decentralized oracle network, bridging on and off-chain computation" + - IMAGE_LABEL_LICENSES="MIT" + - IMAGE_LABEL_SOURCE="https://github.com/smartcontractkit/{{ .ProjectName }}" + +before: + hooks: + - go mod tidy + - ./tools/bin/goreleaser_utils before_hook + +# See https://goreleaser.com/customization/build/ +builds: + - binary: chainlink + id: linux-arm64 + goos: + - linux + goarch: + - arm64 + hooks: + post: ./tools/bin/goreleaser_utils build_post_hook {{ dir .Path }} {{ .Os }} {{ .Arch }} + env: + - CGO_ENABLED=1 + - CC=$ZIG_EXEC cc -target aarch64-linux-gnu + - CCX=$ZIG_EXEC c++ -target aarch64-linux-gnu + flags: + - -trimpath + - -buildmode=pie + ldflags: + - -s -w -r=$ORIGIN/libs + - -X github.com/smartcontractkit/chainlink/v2/core/static.Version={{ .Env.CHAINLINK_VERSION }} + - -X github.com/smartcontractkit/chainlink/v2/core/static.Sha={{ .FullCommit }} + - binary: chainlink + id: linux-amd64 + goos: + - linux + goarch: + - amd64 + hooks: + post: ./tools/bin/goreleaser_utils build_post_hook {{ dir .Path }} {{ .Os }} {{ .Arch }} + env: + - CGO_ENABLED=1 + - CC=$ZIG_EXEC cc -target x86_64-linux-gnu + - CCX=$ZIG_EXEC c++ -target x86_64-linux-gnu + flags: + - -trimpath + - -buildmode=pie + ldflags: + - -s -w -r=$ORIGIN/libs + - -X github.com/smartcontractkit/chainlink/v2/core/static.Version={{ .Env.CHAINLINK_VERSION }} + - -X github.com/smartcontractkit/chainlink/v2/core/static.Sha={{ .FullCommit }} + +# See https://goreleaser.com/customization/docker/ +dockers: + - id: linux-amd64 + dockerfile: core/chainlink.goreleaser.Dockerfile + use: buildx + goos: linux + goarch: amd64 + extra_files: + - tmp/linux_amd64/libs + - tools/bin/ldd_fix + build_flag_templates: + - "--platform=linux/amd64" + - "--pull" + - "--build-arg=CHAINLINK_USER=chainlink" + - "--build-arg=COMMIT_SHA={{ .FullCommit }}" + - "--label=org.opencontainers.image.created={{ .Date }}" + - "--label=org.opencontainers.image.description={{ .Env.IMAGE_LABEL_DESCRIPTION }}" + - "--label=org.opencontainers.image.licenses={{ .Env.IMAGE_LABEL_LICENSES }}" + - "--label=org.opencontainers.image.revision={{ .FullCommit }}" + - "--label=org.opencontainers.image.source={{ .Env.IMAGE_LABEL_SOURCE }}" + - "--label=org.opencontainers.image.title={{ .ProjectName }}" + - "--label=org.opencontainers.image.version={{ .Env.CHAINLINK_VERSION }}" + - "--label=org.opencontainers.image.url={{ .Env.IMAGE_LABEL_SOURCE }}" + image_templates: + - "{{ .Env.IMAGE_PREFIX }}/{{ .Env.IMAGE_NAME }}:{{ .Env.IMAGE_TAG }}-amd64" + - "{{ .Env.IMAGE_PREFIX }}/{{ .Env.IMAGE_NAME }}:sha-{{ .ShortCommit }}-amd64" + - id: linux-arm64 + dockerfile: core/chainlink.goreleaser.Dockerfile + use: buildx + goos: linux + goarch: arm64 + extra_files: + - tmp/linux_arm64/libs + - tools/bin/ldd_fix + build_flag_templates: + - "--platform=linux/arm64" + - "--pull" + - "--build-arg=CHAINLINK_USER=chainlink" + - "--build-arg=COMMIT_SHA={{ .FullCommit }}" + - "--label=org.opencontainers.image.created={{ .Date }}" + - "--label=org.opencontainers.image.description={{ .Env.IMAGE_LABEL_DESCRIPTION }}" + - "--label=org.opencontainers.image.licenses={{ .Env.IMAGE_LABEL_LICENSES }}" + - "--label=org.opencontainers.image.revision={{ .FullCommit }}" + - "--label=org.opencontainers.image.source={{ .Env.IMAGE_LABEL_SOURCE }}" + - "--label=org.opencontainers.image.title={{ .ProjectName }}" + - "--label=org.opencontainers.image.version={{ .Env.CHAINLINK_VERSION }}" + - "--label=org.opencontainers.image.url={{ .Env.IMAGE_LABEL_SOURCE }}" + image_templates: + - "{{ .Env.IMAGE_PREFIX }}/{{ .Env.IMAGE_NAME }}:{{ .Env.IMAGE_TAG }}-arm64" + - "{{ .Env.IMAGE_PREFIX }}/{{ .Env.IMAGE_NAME }}:sha-{{ .ShortCommit }}-arm64" + - id: linux-amd64-plugins + dockerfile: core/chainlink.goreleaser.Dockerfile + use: buildx + goos: linux + goarch: amd64 + extra_files: + - tmp/linux_amd64/libs + - tmp/linux_amd64/plugins + - tools/bin/ldd_fix + build_flag_templates: + - "--platform=linux/amd64" + - "--pull" + - "--build-arg=CHAINLINK_USER=chainlink" + - "--build-arg=COMMIT_SHA={{ .FullCommit }}" + - "--build-arg=CL_MEDIAN_CMD=chainlink-feeds" + - "--build-arg=CL_MERCURY_CMD=chainlink-mercury" + - "--build-arg=CL_SOLANA_CMD=chainlink-solana" + - "--build-arg=CL_STARKNET_CMD=chainlink-starknet" + - "--label=org.opencontainers.image.created={{ .Date }}" + - "--label=org.opencontainers.image.description={{ .Env.IMAGE_LABEL_DESCRIPTION }}" + - "--label=org.opencontainers.image.licenses={{ .Env.IMAGE_LABEL_LICENSES }}" + - "--label=org.opencontainers.image.revision={{ .FullCommit }}" + - "--label=org.opencontainers.image.source={{ .Env.IMAGE_LABEL_SOURCE }}" + - "--label=org.opencontainers.image.title={{ .ProjectName }}" + - "--label=org.opencontainers.image.version={{ .Env.CHAINLINK_VERSION }}" + - "--label=org.opencontainers.image.url={{ .Env.IMAGE_LABEL_SOURCE }}" + image_templates: + - "{{ .Env.IMAGE_PREFIX }}/{{ .Env.IMAGE_NAME }}:{{ .Env.IMAGE_TAG }}-plugins-amd64" + - "{{ .Env.IMAGE_PREFIX }}/{{ .Env.IMAGE_NAME }}:sha-{{ .ShortCommit }}-plugins-amd64" + - id: linux-arm64-plugins + dockerfile: core/chainlink.goreleaser.Dockerfile + use: buildx + goos: linux + goarch: arm64 + extra_files: + - tmp/linux_arm64/libs + - tmp/linux_arm64/plugins + - tools/bin/ldd_fix + build_flag_templates: + - "--platform=linux/arm64" + - "--pull" + - "--build-arg=CHAINLINK_USER=chainlink" + - "--build-arg=COMMIT_SHA={{ .FullCommit }}" + - "--build-arg=CL_MEDIAN_CMD=chainlink-feeds" + - "--build-arg=CL_MERCURY_CMD=chainlink-mercury" + - "--build-arg=CL_SOLANA_CMD=chainlink-solana" + - "--build-arg=CL_STARKNET_CMD=chainlink-starknet" + - "--label=org.opencontainers.image.created={{ .Date }}" + - "--label=org.opencontainers.image.description={{ .Env.IMAGE_LABEL_DESCRIPTION }}" + - "--label=org.opencontainers.image.licenses={{ .Env.IMAGE_LABEL_LICENSES }}" + - "--label=org.opencontainers.image.revision={{ .FullCommit }}" + - "--label=org.opencontainers.image.source={{ .Env.IMAGE_LABEL_SOURCE }}" + - "--label=org.opencontainers.image.title={{ .ProjectName }}" + - "--label=org.opencontainers.image.version={{ .Env.CHAINLINK_VERSION }}" + - "--label=org.opencontainers.image.url={{ .Env.IMAGE_LABEL_SOURCE }}" + image_templates: + - "{{ .Env.IMAGE_PREFIX }}/{{ .Env.IMAGE_NAME }}:{{ .Env.IMAGE_TAG }}-plugins-arm64" + - "{{ .Env.IMAGE_PREFIX }}/{{ .Env.IMAGE_NAME }}:sha-{{ .ShortCommit }}-plugins-arm64" + +# See https://goreleaser.com/customization/docker_manifest/ +docker_manifests: + - name_template: "{{ .Env.IMAGE_PREFIX }}/{{ .Env.IMAGE_NAME }}:{{ .Env.IMAGE_TAG }}" + image_templates: + - "{{ .Env.IMAGE_PREFIX }}/{{ .Env.IMAGE_NAME }}:{{ .Env.IMAGE_TAG }}-amd64" + - "{{ .Env.IMAGE_PREFIX }}/{{ .Env.IMAGE_NAME }}:{{ .Env.IMAGE_TAG }}-arm64" + - name_template: "{{ .Env.IMAGE_PREFIX }}/{{ .Env.IMAGE_NAME }}:sha-{{ .ShortCommit }}" + image_templates: + - "{{ .Env.IMAGE_PREFIX }}/{{ .Env.IMAGE_NAME }}:sha-{{ .ShortCommit }}-amd64" + - "{{ .Env.IMAGE_PREFIX }}/{{ .Env.IMAGE_NAME }}:sha-{{ .ShortCommit }}-arm64" + - name_template: "{{ .Env.IMAGE_PREFIX }}/{{ .Env.IMAGE_NAME }}:{{ .Env.IMAGE_TAG }}-plugins" + image_templates: + - "{{ .Env.IMAGE_PREFIX }}/{{ .Env.IMAGE_NAME }}:{{ .Env.IMAGE_TAG }}-plugins-amd64" + - "{{ .Env.IMAGE_PREFIX }}/{{ .Env.IMAGE_NAME }}:{{ .Env.IMAGE_TAG }}-plugins-arm64" + - name_template: "{{ .Env.IMAGE_PREFIX }}/{{ .Env.IMAGE_NAME }}:sha-{{ .ShortCommit }}-plugins" + image_templates: + - "{{ .Env.IMAGE_PREFIX }}/{{ .Env.IMAGE_NAME }}:sha-{{ .ShortCommit }}-plugins-amd64" + - "{{ .Env.IMAGE_PREFIX }}/{{ .Env.IMAGE_NAME }}:sha-{{ .ShortCommit }}-plugins-arm64" + +# See https://goreleaser.com/customization/docker_sign/ +docker_signs: + - artifacts: all + args: + - "sign" + - "${artifact}" + - "--yes" + +checksum: + name_template: "checksums.txt" + +# See https://goreleaser.com/customization/sbom +sboms: + - artifacts: archive + +snapshot: + version_template: "{{ .Env.CHAINLINK_VERSION }}-{{ .ShortCommit }}" + +partial: + by: target + +# See https://goreleaser.com/customization/release/ +release: + disable: true + +changelog: + sort: asc + filters: + exclude: + - "^docs:" + - "^test:" +# modelines, feel free to remove those if you don't want/use them: +# yaml-language-server: $schema=https://goreleaser.com/static/schema.json +# vim: set ts=2 sw=2 tw=0 fo=cnqoj diff --git a/.mockery.yaml b/.mockery.yaml index 331655e7b3e..b22875e3f9f 100644 --- a/.mockery.yaml +++ b/.mockery.yaml @@ -1 +1,592 @@ -# empty config to prevent info/debug level log spam +dir: "{{ .InterfaceDir }}/mocks" +mockname: "{{ .InterfaceName }}" +outpkg: mocks +filename: "{{ .InterfaceName | snakecase }}.go" +packages: + github.com/smartcontractkit/chainlink/v2/common/client: + config: + dir: "{{ .InterfaceDir }}" + filename: "mock_{{ .InterfaceName | snakecase }}_test.go" + inpackage: true + mockname: "mock{{ .InterfaceName | camelcase }}" + interfaces: + Node: + NodeSelector: + sendOnlyClient: + SendOnlyNode: + RPC: + Head: + NodeClient: + PoolChainInfoProvider: + github.com/smartcontractkit/chainlink/v2/common/headtracker: + interfaces: + HeadTrackable: + HeadTracker: + HeadBroadcaster: + github.com/smartcontractkit/chainlink/v2/common/txmgr: + interfaces: + TxManager: + github.com/smartcontractkit/chainlink/v2/common/txmgr/types: + interfaces: + ReaperChainConfig: + config: + mockname: ReaperConfig + ForwarderManager: + KeyStore: + TxStrategy: + TxAttemptBuilder: + TxStore: + github.com/smartcontractkit/chainlink/v2/common/types: + interfaces: + Head: + Subscription: + github.com/smartcontractkit/chainlink/v2/core/bridges: + interfaces: + ORM: + github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/types: + interfaces: + CCIPOracle: + OracleCreator: + github.com/smartcontractkit/chainlink/v2/core/capabilities/remote/types: + interfaces: + Dispatcher: + Receiver: + github.com/smartcontractkit/chainlink/v2/core/chains/evm/client: + interfaces: + Client: + RPCClient: + github.com/smartcontractkit/chainlink/v2/core/chains/evm/config: + interfaces: + GasEstimator: + ChainScopedConfig: + github.com/smartcontractkit/chainlink/v2/core/chains/evm/forwarders: + interfaces: + ORM: + github.com/smartcontractkit/chainlink/v2/core/chains/evm/gas: + interfaces: + Config: + EvmFeeEstimator: + feeEstimatorClient: + config: + mockname: FeeEstimatorClient + feeHistoryEstimatorClient: + config: + mockname: FeeHistoryEstimatorClient + EvmEstimator: + github.com/smartcontractkit/chainlink/v2/core/chains/evm/gas/rollups: + interfaces: + L1Oracle: + l1OracleClient: + config: + mockname: L1OracleClient + github.com/smartcontractkit/chainlink/v2/core/chains/evm/keystore: + interfaces: + Eth: + github.com/smartcontractkit/chainlink/v2/core/chains/evm/log: + interfaces: + Broadcaster: + Broadcast: + AbigenContract: + github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller: + interfaces: + LogPoller: + github.com/smartcontractkit/chainlink/v2/core/chains/evm/monitor: + interfaces: + BalanceMonitor: + config: + dir: "{{ .InterfaceDir }}/../mocks" + github.com/smartcontractkit/chainlink/v2/core/chains/evm/txmgr: + interfaces: + ChainConfig: + config: + mockname: Config + filename: config.go + EvmTxStore: + github.com/smartcontractkit/chainlink/v2/core/chains/legacyevm: + interfaces: + Chain: + LegacyChainContainer: + github.com/smartcontractkit/chainlink/v2/core/cmd: + interfaces: + Prompter: + github.com/smartcontractkit/chainlink/v2/core/config: + interfaces: + TelemetryIngress: + TelemetryIngressEndpoint: + github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/flux_aggregator_wrapper: + config: + dir: core/internal/mocks + filename: flux_aggregator.go + interfaces: + FluxAggregatorInterface: + config: + mockname: FluxAggregator + github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/flags_wrapper: + config: + dir: core/internal/mocks + filename: flags.go + interfaces: + FlagsInterface: + config: + mockname: Flags + github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/aggregator_v3_interface: + config: + dir: core/services/vrf/mocks + filename: aggregator_v3_interface.go + interfaces: + AggregatorV3InterfaceInterface: + github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_coordinator_v2: + config: + dir: core/services/vrf/mocks + filename: vrf_coordinator_v2.go + interfaces: + VRFCoordinatorV2Interface: + github.com/smartcontractkit/chainlink/v2/core/logger: + config: + dir: "{{ .InterfaceDir }}" + mockname: "Mock{{ .InterfaceName }}" + inpackage: true + filename: logger_mocks.go + interfaces: + Logger: + github.com/smartcontractkit/chainlink/v2/core/services: + interfaces: + Checker: + github.com/smartcontractkit/chainlink/v2/core/services/blockhashstore: + interfaces: + BHS: + Timer: + github.com/smartcontractkit/chainlink/v2/core/services/ccip: + interfaces: + ORM: + github.com/smartcontractkit/chainlink/v2/core/services/chainlink: + interfaces: + Application: + config: + dir: core/internal/mocks + GeneralConfig: + github.com/smartcontractkit/chainlink/v2/core/services/feeds: + interfaces: + ConnectionsManager: + ORM: + Service: + github.com/smartcontractkit/chainlink/v2/core/services/feeds/proto: + config: + dir: "{{ .InterfaceDir }}/../mocks" + interfaces: + FeedsManagerClient: + github.com/smartcontractkit/chainlink/v2/core/services/fluxmonitorv2: + interfaces: + ContractSubmitter: + Flags: + KeyStoreInterface: + ORM: + github.com/smartcontractkit/chainlink/v2/core/services/functions: + interfaces: + ExternalAdapterClient: + BridgeAccessor: + FunctionsListener: + OffchainTransmitter: + ORM: + github.com/smartcontractkit/chainlink/v2/core/services/gateway/connector: + interfaces: + GatewayConnector: + GatewayConnectorHandler: + Signer: + github.com/smartcontractkit/chainlink/v2/core/services/gateway/handlers: + interfaces: + Handler: + DON: + github.com/smartcontractkit/chainlink/v2/core/services/gateway/handlers/functions/allowlist: + interfaces: + OnchainAllowlist: + ORM: + github.com/smartcontractkit/chainlink/v2/core/services/gateway/handlers/functions/subscriptions: + interfaces: + OnchainSubscriptions: + ORM: + github.com/smartcontractkit/chainlink/v2/core/services/gateway/network: + interfaces: + ConnectionInitiator: + ConnectionAcceptor: + HttpServer: + HTTPRequestHandler: + WebSocketServer: + github.com/smartcontractkit/chainlink/v2/core/services/job: + interfaces: + ServiceCtx: + KVStore: + ORM: + Spawner: + github.com/smartcontractkit/chainlink/v2/core/services/keystore: + interfaces: + Aptos: + Cosmos: + CSA: + Eth: + Master: + OCR: + OCR2: + P2P: + config: + filename: p2p.go + Solana: + StarkNet: + config: + filename: starknet.go + VRF: + github.com/smartcontractkit/chainlink/v2/core/services/ocr: + interfaces: + OCRContractTrackerDB: + github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ocr2keeper/evmregistry/v20: + interfaces: + Registry: + github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21: + interfaces: + Registry: + HttpClient: + github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/core: + interfaces: + UpkeepStateReader: + github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/promwrapper: + interfaces: + PrometheusBackend: + github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/threshold: + interfaces: + Decryptor: + github.com/smartcontractkit/chainlink/v2/core/services/p2p/types: + interfaces: + Peer: + PeerWrapper: + Signer: + github.com/smartcontractkit/chainlink/v2/core/services/pipeline: + interfaces: + Config: + ORM: + Runner: + PipelineParamUnmarshaler: + github.com/smartcontractkit/chainlink/v2/core/services/headreporter: + config: + dir: "{{ .InterfaceDir }}" + filename: "{{ .InterfaceName | snakecase }}_mock.go" + inpackage: true + mockname: "Mock{{ .InterfaceName | camelcase }}" + interfaces: + HeadReporter: + PrometheusBackend: + github.com/smartcontractkit/libocr/commontypes: + config: + dir: "common/types/mocks" + interfaces: + MonitoringEndpoint: + github.com/smartcontractkit/chainlink/v2/core/services/relay/evm: + interfaces: + BatchCaller: + config: + dir: "{{ .InterfaceDir }}/rpclibmocks" + outpkg: rpclibmocks + LoopRelayAdapter: + RequestRoundDB: + github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury: + interfaces: + asyncDeleter: + config: + mockname: AsyncDeleter + github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/types: + interfaces: + LogPollerWrapper: + github.com/smartcontractkit/chainlink/v2/core/services/s4: + interfaces: + ORM: + Storage: + github.com/smartcontractkit/chainlink/v2/core/services/synchronization: + interfaces: + TelemetryService: + github.com/smartcontractkit/chainlink/v2/core/services/synchronization/telem: + config: + dir: "{{ .InterfaceDir }}/../mocks" + interfaces: + TelemClient: + github.com/smartcontractkit/chainlink/v2/core/services/vrf/vrfcommon: + config: + dir: "{{ .InterfaceDir }}/../mocks" + interfaces: + Config: + FeeConfig: + github.com/smartcontractkit/chainlink/v2/core/services/telemetry: + config: + dir: "{{ .InterfaceDir }}" + filename: "{{ .InterfaceName | snakecase }}_mock.go" + inpackage: true + mockname: "Mock{{ .InterfaceName | camelcase }}" + interfaces: + MonitoringEndpointGenerator: + IngressAgent: + github.com/smartcontractkit/chainlink/v2/core/services/webhook: + interfaces: + ExternalInitiatorManager: + HTTPClient: + github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/read: + config: + dir: "{{ .InterfaceDir }}/mocks" + interfaces: + Registrar: + Reader: + BatchCaller: + github.com/smartcontractkit/chainlink/v2/core/sessions: + interfaces: + BasicAdminUsersORM: + AuthenticationProvider: + github.com/smartcontractkit/chainlink/v2/core/sessions/ldapauth: + interfaces: + LDAPClient: + LDAPConn: + github.com/smartcontractkit/chainlink-common/pkg/types: + config: + dir: core/capabilities/targets/mocks + interfaces: + Codec: + config: + dir: core/services/relay/evm/mocks + ChainWriter: + github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/evm_2_evm_onramp: + config: + dir: core/gethwrappers/ccip/mocks/ + filename: evm2_evm_on_ramp_interface.go + outpkg: mock_contracts + interfaces: + EVM2EVMOnRampInterface: + github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/evm_2_evm_offramp: + config: + dir: core/gethwrappers/ccip/mocks/ + filename: evm2_evm_off_ramp_interface.go + outpkg: mock_contracts + interfaces: + EVM2EVMOffRampInterface: + github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/evm_2_evm_offramp_1_2_0: + config: + dir: core/gethwrappers/ccip/mocks/v1_2_0/ + filename: evm2_evm_off_ramp_interface.go + outpkg: mock_contracts + interfaces: + EVM2EVMOffRampInterface: + github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/evm_2_evm_offramp_1_0_0: + config: + dir: core/gethwrappers/ccip/mocks/v1_0_0/ + filename: evm2_evm_off_ramp_interface.go + outpkg: mock_contracts + interfaces: + EVM2EVMOffRampInterface: + github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/commit_store: + config: + dir: core/gethwrappers/ccip/mocks/ + filename: commit_store_interface.go + outpkg: mock_contracts + interfaces: + CommitStoreInterface: + github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/fee_quoter: + config: + dir: core/gethwrappers/ccip/mocks/ + filename: fee_quoter_interface.go + outpkg: mock_contracts + interfaces: + FeeQuoterInterface: + github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/link_token_interface: + config: + dir: core/gethwrappers/ccip/mocks/ + filename: link_token_interface.go + outpkg: mock_contracts + interfaces: + LinkTokenInterface: + github.com/smartcontractkit/chainlink/v2/core/gethwrappers/liquiditymanager/generated/arbitrum_l1_bridge_adapter: + config: + dir: core/gethwrappers/liquiditymanager/mocks/mock_arbitrum_l1_bridge_adapter/ + filename: arbitrum_l1_bridge_adapter_interface.go + outpkg: mock_arbitrum_l1_bridge_adapter + interfaces: + ArbitrumL1BridgeAdapterInterface: + github.com/smartcontractkit/chainlink/v2/core/gethwrappers/liquiditymanager/generated/arbitrum_l2_bridge_adapter: + config: + dir: core/gethwrappers/liquiditymanager/mocks/mock_arbitrum_l2_bridge_adapter/ + filename: arbitrum_l2_bridge_adapter_interface.go + outpkg: mock_arbitrum_l2_bridge_adapter + interfaces: + ArbitrumL2BridgeAdapterInterface: + github.com/smartcontractkit/chainlink/v2/core/gethwrappers/liquiditymanager/generated/arbitrum_gateway_router: + config: + dir: core/gethwrappers/liquiditymanager/mocks/mock_arbitrum_gateway_router/ + filename: arbitrum_gateway_router_interface.go + outpkg: mock_arbitrum_gateway_router + interfaces: + ArbitrumGatewayRouterInterface: + github.com/smartcontractkit/chainlink/v2/core/gethwrappers/liquiditymanager/generated/arbitrum_inbox: + config: + dir: core/gethwrappers/liquiditymanager/mocks/mock_arbitrum_inbox/ + filename: arbitrum_inbox_interface.go + outpkg: mock_arbitrum_inbox + interfaces: + ArbitrumInboxInterface: + github.com/smartcontractkit/chainlink/v2/core/gethwrappers/liquiditymanager/generated/l2_arbitrum_gateway: + config: + dir: core/gethwrappers/liquiditymanager/mocks/mock_l2_arbitrum_gateway/ + filename: l2_arbitrum_gateway_interface.go + outpkg: mock_l2_arbitrum_gateway + interfaces: + L2ArbitrumGatewayInterface: + github.com/smartcontractkit/chainlink/v2/core/gethwrappers/liquiditymanager/generated/arbsys: + config: + dir: core/gethwrappers/liquiditymanager/mocks/mock_arbsys/ + filename: arb_sys_interface.go + outpkg: mock_arbsys + interfaces: + ArbSysInterface: + github.com/smartcontractkit/chainlink/v2/core/gethwrappers/liquiditymanager/generated/arb_node_interface: + config: + dir: core/gethwrappers/liquiditymanager/mocks/mock_node_interface/ + filename: node_interface_interface.go + outpkg: mock_node_interface + interfaces: + NodeInterfaceInterface: + github.com/smartcontractkit/chainlink/v2/core/gethwrappers/liquiditymanager/generated/l2_arbitrum_messenger: + config: + dir: core/gethwrappers/liquiditymanager/mocks/mock_l2_arbitrum_messenger/ + filename: l2_arbitrum_messenger_interface.go + outpkg: mock_l2_arbitrum_messenger + interfaces: + L2ArbitrumMessengerInterface: + github.com/smartcontractkit/chainlink/v2/core/gethwrappers/liquiditymanager/generated/arbitrum_rollup_core: + config: + dir: core/gethwrappers/liquiditymanager/mocks/mock_arbitrum_rollup_core/ + filename: arb_rollup_core_interface.go + outpkg: mock_arbitrum_rollup_core + interfaces: + ArbRollupCoreInterface: + github.com/smartcontractkit/chainlink/v2/core/gethwrappers/liquiditymanager/generated/optimism_portal: + config: + dir: core/gethwrappers/liquiditymanager/mocks/mock_optimism_portal/ + filename: optimism_portal_interface.go + outpkg: mock_optimism_portal + interfaces: + OptimismPortalInterface: + github.com/smartcontractkit/chainlink/v2/core/gethwrappers/liquiditymanager/generated/optimism_l2_output_oracle: + config: + dir: core/gethwrappers/liquiditymanager/mocks/mock_optimism_l2_output_oracle/ + filename: optimism_l2_output_oracle_interface.go + outpkg: mock_optimism_l2_output_oracle + interfaces: + OptimismL2OutputOracleInterface: + github.com/smartcontractkit/chainlink/v2/core/gethwrappers/liquiditymanager/generated/optimism_portal_2: + config: + dir: core/gethwrappers/liquiditymanager/mocks/mock_optimism_portal_2/ + filename: optimism_portal2_interface.go + outpkg: mock_optimism_portal_2 + interfaces: + OptimismPortal2Interface: + github.com/smartcontractkit/chainlink/v2/core/gethwrappers/liquiditymanager/generated/optimism_dispute_game_factory: + config: + dir: core/gethwrappers/liquiditymanager/mocks/mock_optimism_dispute_game_factory/ + filename: optimism_dispute_game_factory_interface.go + outpkg: mock_optimism_dispute_game_factory + interfaces: + OptimismDisputeGameFactoryInterface: + github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/cache: + config: + filename: chain_health_mock.go + interfaces: + ChainHealthcheck: + github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata: + interfaces: + CommitStoreReader: + config: + filename: commit_store_reader_mock.go + OffRampReader: + config: + filename: offramp_reader_mock.go + OnRampReader: + config: + filename: onramp_reader_mock.go + PriceRegistryReader: + config: + filename: price_registry_reader_mock.go + TokenPoolReader: + config: + filename: token_pool_reader_mock.go + USDCReader: + config: + filename: usdc_reader_mock.go + github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/batchreader: + config: + filename: token_pool_batched_reader_mock.go + interfaces: + TokenPoolBatchedReader: + github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/ccipdataprovider: + config: + filename: price_registry_mock.go + interfaces: + PriceRegistry: + github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdb: + config: + filename: price_service_mock.go + interfaces: + PriceService: + github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/pricegetter: + config: + filename: mock.go + dir: "{{ .InterfaceDir }}/" + outpkg: pricegetter + interfaces: + PriceGetter: + config: + mockname: "Mock{{ .InterfaceName }}" + filename: mock.go + AllTokensPriceGetter: + config: + mockname: "Mock{{ .InterfaceName }}" + filename: all_price_getter_mock.go + github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/statuschecker: + interfaces: + CCIPTransactionStatusChecker: + github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/rpclib: + config: + outpkg: rpclibmocks + interfaces: + BatchCaller: + config: + filename: batch_caller.go + dir: core/services/relay/evm/rpclibmocks + EvmBatchCaller: + config: + filename: evm_mock.go + dir: "{{ .InterfaceDir }}/rpclibmocks" + github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/prices: + config: + dir: "{{ .InterfaceDir }}/" + outpkg: prices + interfaces: + GasPriceEstimatorCommit: + config: + mockname: "Mock{{ .InterfaceName }}" + filename: gas_price_estimator_commit_mock.go + GasPriceEstimatorExec: + config: + mockname: "Mock{{ .InterfaceName }}" + filename: gas_price_estimator_exec_mock.go + GasPriceEstimator: + config: + mockname: "Mock{{ .InterfaceName }}" + filename: gas_price_estimator_mock.go + github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/tokendata: + config: + filename: reader_mock.go + dir: "{{ .InterfaceDir }}/" + outpkg: tokendata + interfaces: + Reader: + config: + mockname: "Mock{{ .InterfaceName }}" + github.com/smartcontractkit/chainlink/v2/core/services/registrysyncer: + interfaces: + ORM: + github.com/smartcontractkit/chainlink/v2/core/capabilities/targets: + interfaces: + ContractValueGetter: \ No newline at end of file diff --git a/.tool-versions b/.tool-versions index f660f2ac116..6cd01e3f913 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1,9 +1,9 @@ -golang 1.21.7 +golang 1.22.5 mockery 2.43.2 nodejs 20.13.1 pnpm 9.4.0 postgres 15.1 helm 3.10.3 zig 0.11.0 -golangci-lint 1.59.1 +golangci-lint 1.60.3 protoc 25.1 diff --git a/CHANGELOG.md b/CHANGELOG.md index f2124455030..6fb69c6bd1f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,403 @@ # Changelog Chainlink Core -## 2.14.0 - UNRELEASED +## 2.17.0 - UNRELEASED + +### Minor Changes + +- [#14316](https://github.com/smartcontractkit/chainlink/pull/14316) [`2a21b170f3`](https://github.com/smartcontractkit/chainlink/commit/2a21b170f38ded4cf0f15db283035e69b53aeeb9) Thanks [@graham-chainlink](https://github.com/graham-chainlink)! - #internal updated to latest operator-ui to bring in new UI changes for supporting multiple job distributors + +- [#14264](https://github.com/smartcontractkit/chainlink/pull/14264) [`33e6a0c1e4`](https://github.com/smartcontractkit/chainlink/commit/33e6a0c1e44b805064fe423b5570a40c07daed41) Thanks [@chainchad](https://github.com/chainchad)! - Bump to start the next version + +- [#14109](https://github.com/smartcontractkit/chainlink/pull/14109) [`2761cd5bc5`](https://github.com/smartcontractkit/chainlink/commit/2761cd5bc5ed91bc17d4d67265ddc8fa03b84540) Thanks [@Farber98](https://github.com/Farber98)! - FilteredLogs receive Expression instead of whole KeyFilter. #internal + +- [#14239](https://github.com/smartcontractkit/chainlink/pull/14239) [`674eac31cc`](https://github.com/smartcontractkit/chainlink/commit/674eac31cc161250fdadb838ba2a0fc7c796e932) Thanks [@bolekk](https://github.com/bolekk)! - #added Implements rate limiter for capabilities dispatcher + +- [#14470](https://github.com/smartcontractkit/chainlink/pull/14470) [`5885454e9a`](https://github.com/smartcontractkit/chainlink/commit/5885454e9a7eaa8f8c180ac3708afbdf5bdb08cd) Thanks [@austinborn](https://github.com/austinborn)! - #changed: Add new OCR3DataFeeds telemetry type for Mercury jobs + +- [#14266](https://github.com/smartcontractkit/chainlink/pull/14266) [`c323e0d600`](https://github.com/smartcontractkit/chainlink/commit/c323e0d600c659a4ea584dbae0a0db187afd51eb) Thanks [@asoliman92](https://github.com/asoliman92)! - #updated move latest capabilities code from ccip repo to chainlink repo [CCIP-2946] + + PR issue: CCIP-2946 + +- [#14197](https://github.com/smartcontractkit/chainlink/pull/14197) [`7f69993c86`](https://github.com/smartcontractkit/chainlink/commit/7f69993c8655053b7550f50b817ba9c6888037e2) Thanks [@graham-chainlink](https://github.com/graham-chainlink)! - #changed Connect to multiple feeds managers on app start instead of just one (default to first) + +- [#14373](https://github.com/smartcontractkit/chainlink/pull/14373) [`5acca3719e`](https://github.com/smartcontractkit/chainlink/commit/5acca3719ecd7a3189db3a8a8d09418ed8423016) Thanks [@huangzhen1997](https://github.com/huangzhen1997)! - This PR introduce few changes: + + - Add a new config option `EVM.NodePool.NewHeadsPollInterval` (0 by default indicate disabled), which is an interval for polling new block periodically using http client rather than subscribe to ws feed. + - Updated new head handler for polling new head over http, and register the subscription in node lifecycle logic. + - If the polling new heads is enabled, WS new heads subscription will be replaced with the new http based polling. + + Note: There will be another PR for making WS URL optional with some extra condition. + #added + +- [#14438](https://github.com/smartcontractkit/chainlink/pull/14438) [`6814bcef45`](https://github.com/smartcontractkit/chainlink/commit/6814bcef45a7157ac9835c25a9a5b95a135bdc01) Thanks [@graham-chainlink](https://github.com/graham-chainlink)! - #internal Update to latest UI - PeerId field is introduced for OCR2 bootstrap node in chain config page + +- [#14354](https://github.com/smartcontractkit/chainlink/pull/14354) [`bf6618da8a`](https://github.com/smartcontractkit/chainlink/commit/bf6618da8aa9695c747b81df172acdd43e379cb2) Thanks [@huangzhen1997](https://github.com/huangzhen1997)! - Adding feature flag for `LogBroadcaster` called `LogBroadcasterEnabled`, which is `true` by default to support backwards compatibility. + Adding `LogBroadcasterEnabled` allows certain chains to completely disable the `LogBroadcaster` feature, which is an old feature (getting replaced by logPoller) that only few products are using it: + + - OCR1 Median + - \*OCR2 Median when ChainReader is disabled + - \*pre-OCR2 Keeper + - Flux Monitor + - Direct RequestOCR1 Median + + #added + +- [#13735](https://github.com/smartcontractkit/chainlink/pull/13735) [`920413c3ce`](https://github.com/smartcontractkit/chainlink/commit/920413c3ce2ca8effc138e69ec063b0ce5e94c6b) Thanks [@silaslenihan](https://github.com/silaslenihan)! - #internal Added ChainWriter to ChainReader tests + +- [#14041](https://github.com/smartcontractkit/chainlink/pull/14041) [`8d818ea265`](https://github.com/smartcontractkit/chainlink/commit/8d818ea265ff08887e61ace4f83364a3ee149ef0) Thanks [@amit-momin](https://github.com/amit-momin)! - Added gas limit estimation feature to EVM gas estimators. Introduced a new config `EVM.GasEstimator.EstimateLimit` to toggle this feature. #added + +- [#14207](https://github.com/smartcontractkit/chainlink/pull/14207) [`328b62ae50`](https://github.com/smartcontractkit/chainlink/commit/328b62ae5067619e59da42f6db6703d3b327f1a2) Thanks [@ilija42](https://github.com/ilija42)! - #internal Implement EVM ChainReader ValueComparator filtering by non-indexed event data. Right now only simple non indexed data where byte offsets don't exist is supported. + + PR issue: BCFR-203 + +- [#14197](https://github.com/smartcontractkit/chainlink/pull/14197) [`7f69993c86`](https://github.com/smartcontractkit/chainlink/commit/7f69993c8655053b7550f50b817ba9c6888037e2) Thanks [@graham-chainlink](https://github.com/graham-chainlink)! - #changed Allow registration of more than 1 feeds manager on CreateFeedsManager + +- [#14394](https://github.com/smartcontractkit/chainlink/pull/14394) [`28989b30d9`](https://github.com/smartcontractkit/chainlink/commit/28989b30d94bbd3490330cd8e50e7d9223d33cff) Thanks [@ilija42](https://github.com/ilija42)! - #internal Implement LatestHead for ChainService + +- [#14234](https://github.com/smartcontractkit/chainlink/pull/14234) [`a234e14ebd`](https://github.com/smartcontractkit/chainlink/commit/a234e14ebd266269b4d5893b0d2aeeb01bc58a70) Thanks [@huangzhen1997](https://github.com/huangzhen1997)! - use new estimation for insufficient fund instead of retry to overcome gas spike #internal + +- [#14369](https://github.com/smartcontractkit/chainlink/pull/14369) [`e51472763d`](https://github.com/smartcontractkit/chainlink/commit/e51472763da4039242ebd4c3939ab44c87e595d1) Thanks [@archseer](https://github.com/archseer)! - Small fixes to multichain keyring adapter #internal + +- [#13833](https://github.com/smartcontractkit/chainlink/pull/13833) [`1ea9f79793`](https://github.com/smartcontractkit/chainlink/commit/1ea9f79793f646977b44e38a34b2e70c28b2849e) Thanks [@dimriou](https://github.com/dimriou)! - Introduce new gas estimator #internal + +- [#14110](https://github.com/smartcontractkit/chainlink/pull/14110) [`8454f46db1`](https://github.com/smartcontractkit/chainlink/commit/8454f46db1985c0a4968b4eb5e0a4a6b81dfef5c) Thanks [@jmank88](https://github.com/jmank88)! - #added Full Open Telemetry support, configurable via `Telemetry` + +- [#14504](https://github.com/smartcontractkit/chainlink/pull/14504) [`10f7aabc29`](https://github.com/smartcontractkit/chainlink/commit/10f7aabc2972615cae4edd8f3532ad6aea521cee) Thanks [@austinborn](https://github.com/austinborn)! - #bugfix Fix potential nil ptr reference for LinkFeedID and NativeFeedID in Mercury specs + #bugfix Ensure Streams PluginConfig is checked for contents correctly when validated + #changed New Feed IDs with 0x01 prefix can be parsed for Mercury report schemas + +- [#14370](https://github.com/smartcontractkit/chainlink/pull/14370) [`882cdce681`](https://github.com/smartcontractkit/chainlink/commit/882cdce6811a952a38c61c3fb88349990d635d59) Thanks [@dimriou](https://github.com/dimriou)! - Remove PriceMin and TipCapMin check from attempt builder #internal + +- [#13888](https://github.com/smartcontractkit/chainlink/pull/13888) [`37c5a2ff29`](https://github.com/smartcontractkit/chainlink/commit/37c5a2ff29ad1fe661547777e60a077430530be9) Thanks [@karen-stepanyan](https://github.com/karen-stepanyan)! - #updated mercury plugin to consider PluginConfig as optional if EnableTriggerCapability relay config is true. Then if PluginConfig is nil, skip fetching latestPrice for linkFeedId and nativeFeedId. + +### Patch Changes + +- [#14350](https://github.com/smartcontractkit/chainlink/pull/14350) [`070b272f30`](https://github.com/smartcontractkit/chainlink/commit/070b272f30054be6d4239d078121ca3b3054fc33) Thanks [@DeividasK](https://github.com/DeividasK)! - #internal + +- [#14317](https://github.com/smartcontractkit/chainlink/pull/14317) [`72f4cc8aaa`](https://github.com/smartcontractkit/chainlink/commit/72f4cc8aaa128202fd5974c6dbfb29c6beb1be12) Thanks [@ettec](https://github.com/ettec)! - #internal changes required for capability api chance to sync + +- [#14471](https://github.com/smartcontractkit/chainlink/pull/14471) [`a9a4f746bf`](https://github.com/smartcontractkit/chainlink/commit/a9a4f746bf3e18d2bf9228d591166c437d5a9e6a) Thanks [@matYang](https://github.com/matYang)! - #changed Make Mantle use default OP stack l1 gas oracle in core + +- [#14416](https://github.com/smartcontractkit/chainlink/pull/14416) [`3c5bdf8d4b`](https://github.com/smartcontractkit/chainlink/commit/3c5bdf8d4b2244b3826ab54a56ec172bb9a8459c) Thanks [@dimkouv](https://github.com/dimkouv)! - RMNCrypto evm implementation for CCIP - RMN Integration #added + +- [#14313](https://github.com/smartcontractkit/chainlink/pull/14313) [`b71e692e7b`](https://github.com/smartcontractkit/chainlink/commit/b71e692e7ba8523ec57ea5e10c5d9c6810e038e5) Thanks [@ferglor](https://github.com/ferglor)! - Use a lock to sync access to the ConfigDigest #internal + +- [#14423](https://github.com/smartcontractkit/chainlink/pull/14423) [`0187f18ba6`](https://github.com/smartcontractkit/chainlink/commit/0187f18ba62b44d4c8ff20f07ef8dfd6e0d7b451) Thanks [@asoliman92](https://github.com/asoliman92)! - #updated refactor ccip oracle creator + +- [#14314](https://github.com/smartcontractkit/chainlink/pull/14314) [`8fa3ebee3e`](https://github.com/smartcontractkit/chainlink/commit/8fa3ebee3e0ce09bf2e8270ab46c168756d25db0) Thanks [@DeividasK](https://github.com/DeividasK)! - #internal validate capability trigger event ID before executing + +- [#14366](https://github.com/smartcontractkit/chainlink/pull/14366) [`27d5cbf578`](https://github.com/smartcontractkit/chainlink/commit/27d5cbf5787531d541ba774397b3abdfcb8b20a7) Thanks [@dhaidashenko](https://github.com/dhaidashenko)! - LogPoller polls logs even if chain have not reached finality #internal + +- [#14401](https://github.com/smartcontractkit/chainlink/pull/14401) [`f6443a14e8`](https://github.com/smartcontractkit/chainlink/commit/f6443a14e836523dfa8a78b1b98a00999832f204) Thanks [@george-dorin](https://github.com/george-dorin)! - #updated Changed TelemetryIngress.UniConn default to false + +- [#14282](https://github.com/smartcontractkit/chainlink/pull/14282) [`1a2b7b61cb`](https://github.com/smartcontractkit/chainlink/commit/1a2b7b61cbd22256e4e29e891a74228fa453fc9d) Thanks [@amit-momin](https://github.com/amit-momin)! - Updated TXM Confirmer logic to resume pending task runs with failure if transaction is terminally stuck #internal + +- [#14325](https://github.com/smartcontractkit/chainlink/pull/14325) [`b1c59ddfe3`](https://github.com/smartcontractkit/chainlink/commit/b1c59ddfe31d53be6669df8f1cf246b222fbe3b0) Thanks [@DavidOrchard](https://github.com/DavidOrchard)! - configuration updates + +- [#14486](https://github.com/smartcontractkit/chainlink/pull/14486) [`1d6a88ee73`](https://github.com/smartcontractkit/chainlink/commit/1d6a88ee7313ccb857db3995d7d6ed363d7d6589) Thanks [@simsonraj](https://github.com/simsonraj)! - #added Soneium testnet chain configs + +- [#14315](https://github.com/smartcontractkit/chainlink/pull/14315) [`adb3c95799`](https://github.com/smartcontractkit/chainlink/commit/adb3c957993f9f022db395fd54e65528631c1030) Thanks [@friedemannf](https://github.com/friedemannf)! - Handle zkEVM node level OOC error as TerminallyStuck #internal + +- [#14541](https://github.com/smartcontractkit/chainlink/pull/14541) [`d9894d129d`](https://github.com/smartcontractkit/chainlink/commit/d9894d129d12204bdb14dcb0a7ce42fd19205a6d) Thanks [@friedemannf](https://github.com/friedemannf)! - #added #nops Add Zircuit Configs + +- [#14241](https://github.com/smartcontractkit/chainlink/pull/14241) [`7c248e7c46`](https://github.com/smartcontractkit/chainlink/commit/7c248e7c466ad278b0024e4ac743813009b16805) Thanks [@cds95](https://github.com/cds95)! - #internal index don ID in ConfigSet event + +- [#14543](https://github.com/smartcontractkit/chainlink/pull/14543) [`c4fa565f54`](https://github.com/smartcontractkit/chainlink/commit/c4fa565f5441bfa997907256e1990f9be276934d) Thanks [@DeividasK](https://github.com/DeividasK)! - #internal + +- [#14129](https://github.com/smartcontractkit/chainlink/pull/14129) [`85a8d09845`](https://github.com/smartcontractkit/chainlink/commit/85a8d09845d6bd30f62b1de4bf8c62f3a77a6c8e) Thanks [@simsonraj](https://github.com/simsonraj)! - #added Hedera configs + +- [#14252](https://github.com/smartcontractkit/chainlink/pull/14252) [`8490c9610b`](https://github.com/smartcontractkit/chainlink/commit/8490c9610b1208f3efafe29587032679e5727247) Thanks [@martin-cll](https://github.com/martin-cll)! - Remove bid/ask fields for Mercury v4 schema #internal + +- [#14516](https://github.com/smartcontractkit/chainlink/pull/14516) [`0e32c07d22`](https://github.com/smartcontractkit/chainlink/commit/0e32c07d22973343e722a228ff1c3b1e8f9bc04e) Thanks [@mateusz-sekara](https://github.com/mateusz-sekara)! - Adding USDCReaderTester contract for CCIP integration tests #internal + +- [#14345](https://github.com/smartcontractkit/chainlink/pull/14345) [`c83c68735b`](https://github.com/smartcontractkit/chainlink/commit/c83c68735bdee6bbd8510733b7415797cd08ecbd) Thanks [@makramkd](https://github.com/makramkd)! - #internal merge ccip contracts + +- [#14392](https://github.com/smartcontractkit/chainlink/pull/14392) [`3f83f9e8e6`](https://github.com/smartcontractkit/chainlink/commit/3f83f9e8e66029c78a52e2c1eeb5dfb95a615f55) Thanks [@kalverra](https://github.com/kalverra)! - #added Adds the ability to use out of order execution transactions in CCIP E2E tests + +- [#14318](https://github.com/smartcontractkit/chainlink/pull/14318) [`544ded0afa`](https://github.com/smartcontractkit/chainlink/commit/544ded0afa685de146da215a949ad08b3667bb99) Thanks [@winder](https://github.com/winder)! - #internal ccip reader nonces work. + +- [#13992](https://github.com/smartcontractkit/chainlink/pull/13992) [`c1878f7374`](https://github.com/smartcontractkit/chainlink/commit/c1878f7374b7fb2de450c83b6dcae62d2a36f3bf) Thanks [@EasterTheBunny](https://github.com/EasterTheBunny)! - #internal `ContractReader` interface update to accept `BoundContract` for all methods + +- [#14130](https://github.com/smartcontractkit/chainlink/pull/14130) [`31874ba5a4`](https://github.com/smartcontractkit/chainlink/commit/31874ba5a4abbc2dca7b985f04019485a339a71c) Thanks [@dhaidashenko](https://github.com/dhaidashenko)! - Optimize HeadTracker's memory usage #internal + +- [#14474](https://github.com/smartcontractkit/chainlink/pull/14474) [`aa04bfab89`](https://github.com/smartcontractkit/chainlink/commit/aa04bfab8950f001b92635388b2fb63ab1bbcec9) Thanks [@dimkouv](https://github.com/dimkouv)! - bump chainlink-ccip #updated + +- [#14488](https://github.com/smartcontractkit/chainlink/pull/14488) [`700dd7c074`](https://github.com/smartcontractkit/chainlink/commit/700dd7c074706b1a5fa89328876bdc4f3d39e025) Thanks [@ettec](https://github.com/ettec)! - #internal add support for values.Value type in the contract reader GetLatestValue and QueryKey methods + +- [#14361](https://github.com/smartcontractkit/chainlink/pull/14361) [`3a89dceab7`](https://github.com/smartcontractkit/chainlink/commit/3a89dceab79217880625f7af75db0d798cf79488) Thanks [@dhaidashenko](https://github.com/dhaidashenko)! - Use tx in insertLogsWithinTx #internal + +- [#14258](https://github.com/smartcontractkit/chainlink/pull/14258) [`7905901c40`](https://github.com/smartcontractkit/chainlink/commit/7905901c40fc6ab7c65066d02e2d63324e2d640f) Thanks [@ettec](https://github.com/ettec)! - #internal gas limit default value + +- [#14415](https://github.com/smartcontractkit/chainlink/pull/14415) [`d2d9568318`](https://github.com/smartcontractkit/chainlink/commit/d2d9568318abe0ce88bc12a1308e0e96131b0223) Thanks [@martin-cll](https://github.com/martin-cll)! - Skip telemetry for market-status bridges #internal + +- [#14484](https://github.com/smartcontractkit/chainlink/pull/14484) [`d2a01ca51b`](https://github.com/smartcontractkit/chainlink/commit/d2a01ca51bb4a7654d2ceb4f5c25f2ca2de3df11) Thanks [@ogtownsend](https://github.com/ogtownsend)! - #internal KMS client for deployment + +- [#14398](https://github.com/smartcontractkit/chainlink/pull/14398) [`52b480fcc5`](https://github.com/smartcontractkit/chainlink/commit/52b480fcc53bf0162cb3aa04cc13f946babb643a) Thanks [@bolekk](https://github.com/bolekk)! - #added [Keystone] Batch identical trigger events + +- [#14355](https://github.com/smartcontractkit/chainlink/pull/14355) [`356c70cb80`](https://github.com/smartcontractkit/chainlink/commit/356c70cb8079b1052faa45d0c53fa1d8212db355) Thanks [@samsondav](https://github.com/samsondav)! - #changed + + Productionize transmitter for LLO + + Note that some minor changes to prometheus metrics will occur in the transition to LLO. Since feed IDs no longer apply, the metrics for transmissions change as follows: + + ``` + "mercury_transmit_*" + []string{"feedID", ...}, + ``` + + Will change to: + + ``` + "llo_mercury_transmit_*" + []string{"donID", ...}, + ``` + +- [#14352](https://github.com/smartcontractkit/chainlink/pull/14352) [`718e885a53`](https://github.com/smartcontractkit/chainlink/commit/718e885a53d003e16f6bc2d1be5596e63ac88b24) Thanks [@winder](https://github.com/winder)! - #internal update chainlink-ccip version + +- [#14161](https://github.com/smartcontractkit/chainlink/pull/14161) [`2b1e8ad51b`](https://github.com/smartcontractkit/chainlink/commit/2b1e8ad51b98aa41eca78758d2041ffcd7fba94a) Thanks [@friedemannf](https://github.com/friedemannf)! - Enable FeeHistory estimator for Polygon zkEVM #nops + +- [#14367](https://github.com/smartcontractkit/chainlink/pull/14367) [`cd8be702ff`](https://github.com/smartcontractkit/chainlink/commit/cd8be702ffdaef0a9176da977411ab237e544da5) Thanks [@bolekk](https://github.com/bolekk)! - Support per-method handlers in GatewayConnector + +- [#14298](https://github.com/smartcontractkit/chainlink/pull/14298) [`85b33fd9ac`](https://github.com/smartcontractkit/chainlink/commit/85b33fd9acbd342d25bd84804d08451ab2590b97) Thanks [@AnieeG](https://github.com/AnieeG)! - moved deployments ccip tooling from ccip repo to chainlink repo #added + +- [#14281](https://github.com/smartcontractkit/chainlink/pull/14281) [`73c41d1f27`](https://github.com/smartcontractkit/chainlink/commit/73c41d1f27ac43ec6ed6a27368776b187c5e5e45) Thanks [@eutopian](https://github.com/eutopian)! - skip checking isJobManaged if the proposal in fms has already been deleted #changed + +- [#14467](https://github.com/smartcontractkit/chainlink/pull/14467) [`358fc17d5b`](https://github.com/smartcontractkit/chainlink/commit/358fc17d5b5149d962002225cee7c44215cc77d4) Thanks [@akuzni2](https://github.com/akuzni2)! - #added + + - Adds support for "tags" to Tasks that can be used generically. + - Adds a descendent task search method + - Added support in Mercury EA telemetry to utilize tags for telemetry extraction + +- [#14418](https://github.com/smartcontractkit/chainlink/pull/14418) [`a2c03fc380`](https://github.com/smartcontractkit/chainlink/commit/a2c03fc380ca5919bf2f33f771a6efd98a6f4103) Thanks [@mateusz-sekara](https://github.com/mateusz-sekara)! - Updating CCIP OCR3 integration tests according to changes in the chainlink-ccip repo #internal + +- [#14357](https://github.com/smartcontractkit/chainlink/pull/14357) [`ac3523aaa4`](https://github.com/smartcontractkit/chainlink/commit/ac3523aaa4cee6f30b9ac0f25cc7cce559067594) Thanks [@AnieeG](https://github.com/AnieeG)! - #internal Add ccip JobType in feeds service and other jobtype validations + +- [#14461](https://github.com/smartcontractkit/chainlink/pull/14461) [`22a8c993ae`](https://github.com/smartcontractkit/chainlink/commit/22a8c993ae6ae6ee69626bd239ba2a419fbad450) Thanks [@asoliman92](https://github.com/asoliman92)! - #added feed deployment to ccip integration tests + +## 2.16.0 - 2024-09-23 + +### Minor Changes + +- [#14138](https://github.com/smartcontractkit/chainlink/pull/14138) [`69335dc6b0`](https://github.com/smartcontractkit/chainlink/commit/69335dc6b0837ba9726a2772bf1dc98174c03310) Thanks [@silaslenihan](https://github.com/silaslenihan)! - #internal Exposed Confirmed state to ChainWriter GetTransactionStatus method + +- [#14157](https://github.com/smartcontractkit/chainlink/pull/14157) [`1852353bbf`](https://github.com/smartcontractkit/chainlink/commit/1852353bbf6ae4726287cb376bc7a323f657c92a) Thanks [@dimriou](https://github.com/dimriou)! - Fix bhe datarace #internal + +- [#14132](https://github.com/smartcontractkit/chainlink/pull/14132) [`2e314cddf0`](https://github.com/smartcontractkit/chainlink/commit/2e314cddf0f4dbd29cad4a43926dc1a5390cc70f) Thanks [@amit-momin](https://github.com/amit-momin)! - Updated ZK overflow detection to skip transactions with non-broadcasted attempts. Delayed detection for zkEVM using the MinAttempts config. Updated XLayer to use the same detection logic as zkEVM. #internal + +- [#13948](https://github.com/smartcontractkit/chainlink/pull/13948) [`3b4c2b58c3`](https://github.com/smartcontractkit/chainlink/commit/3b4c2b58c3ebb04a2261108e758a3419de436a71) Thanks [@chainchad](https://github.com/chainchad)! - Initialize start of v2.16.0 release + +- [#14100](https://github.com/smartcontractkit/chainlink/pull/14100) [`6a9528db29`](https://github.com/smartcontractkit/chainlink/commit/6a9528db29dadd231ec592f10d655e5367301d8f) Thanks [@huangzhen1997](https://github.com/huangzhen1997)! - add error handling when arbitrum sequencer is not accessible #added + +- [#13794](https://github.com/smartcontractkit/chainlink/pull/13794) [`c330defde2`](https://github.com/smartcontractkit/chainlink/commit/c330defde2211aa4a0d8392f867400a829220b2f) Thanks [@Farber98](https://github.com/Farber98)! - remove dependency on FinalityDepth in EVM TXM code. #internal + +- [#14099](https://github.com/smartcontractkit/chainlink/pull/14099) [`1d1af81c51`](https://github.com/smartcontractkit/chainlink/commit/1d1af81c51d78a7e1406d3e182b8740a2ae43c9c) Thanks [@huangzhen1997](https://github.com/huangzhen1997)! - add error handle for gnosis chiado for seen tx #added + +- [#14039](https://github.com/smartcontractkit/chainlink/pull/14039) [`b0e31e08d5`](https://github.com/smartcontractkit/chainlink/commit/b0e31e08d5a635521afc48570a4b2a01e1daa0fb) Thanks [@huangzhen1997](https://github.com/huangzhen1997)! - Improve TXM performance by optimizing Confirmer and Finalizer queries to stop pulling EVM receipt. #internal + +- [#14096](https://github.com/smartcontractkit/chainlink/pull/14096) [`3f0fad643d`](https://github.com/smartcontractkit/chainlink/commit/3f0fad643d554d2445273a67f58974cb6a785ec4) Thanks [@Farber98](https://github.com/Farber98)! - use FilteredLogs in EventBinding GetLatestValue instead of manual filtering. #internal + +- [#14068](https://github.com/smartcontractkit/chainlink/pull/14068) [`6ab3eb5b67`](https://github.com/smartcontractkit/chainlink/commit/6ab3eb5b67739ff88d3c4cf8ea125fd8273bc2b1) Thanks [@asoliman92](https://github.com/asoliman92)! - #added merging core/capabilities/ccip from https://github.com/smartcontractkit/ccip + +- [#14095](https://github.com/smartcontractkit/chainlink/pull/14095) [`aa4e981c8f`](https://github.com/smartcontractkit/chainlink/commit/aa4e981c8f51692ae19f57569260171736a3e4d9) Thanks [@cedric-cordenier](https://github.com/cedric-cordenier)! - #internal Change CapabilityType to string; remove possiblity of a panic + +- [#13957](https://github.com/smartcontractkit/chainlink/pull/13957) [`20dbba8e76`](https://github.com/smartcontractkit/chainlink/commit/20dbba8e76604a2488b0717d53d706ee11b11a9c) Thanks [@amit-momin](https://github.com/amit-momin)! - Added nonce validation immediately after broadcast for Hedera #internal + +- [#13638](https://github.com/smartcontractkit/chainlink/pull/13638) [`2312827156`](https://github.com/smartcontractkit/chainlink/commit/2312827156f24fa4a6e420aec12e5a3aeac81e2b) Thanks [@amit-momin](https://github.com/amit-momin)! - Introduced finalized transaction state. Added a finalizer component to the TXM to mark transactions as finalized. #internal + +- [#14041](https://github.com/smartcontractkit/chainlink/pull/14041) [`8d818ea265`](https://github.com/smartcontractkit/chainlink/commit/8d818ea265ff08887e61ace4f83364a3ee149ef0) Thanks [@amit-momin](https://github.com/amit-momin)! - Added gas limit estimation feature to EVM gas estimators. Introduced a new config `EVM.GasEstimator.EstimateLimit` to toggle this feature. #added + +- [#14165](https://github.com/smartcontractkit/chainlink/pull/14165) [`e76463cfa9`](https://github.com/smartcontractkit/chainlink/commit/e76463cfa9a0fbe6e35a74cbb3f7d63c85efcd88) Thanks [@silaslenihan](https://github.com/silaslenihan)! - #internal Add hexutil Bytes encoding to batchcall data + +- [#11654](https://github.com/smartcontractkit/chainlink/pull/11654) [`bf2b72d164`](https://github.com/smartcontractkit/chainlink/commit/bf2b72d164f8cc714cfbf57df59a3f3bf952b153) Thanks [@reductionista](https://github.com/reductionista)! - #bugfix More robust error handling in LogPoller, including no more misleading CRITICAL errors emitted under non-critical conditions + +- [#13647](https://github.com/smartcontractkit/chainlink/pull/13647) [`a41b353a20`](https://github.com/smartcontractkit/chainlink/commit/a41b353a20d73aa2d3fe3e8e979a0bcacc46fafe) Thanks [@bukata-sa](https://github.com/bukata-sa)! - #added Report new heads as a telemetry to OTI + +- [#13981](https://github.com/smartcontractkit/chainlink/pull/13981) [`6ef1d6eb44`](https://github.com/smartcontractkit/chainlink/commit/6ef1d6eb449ee1dc1d7d10d50990de7da55561ee) Thanks [@amaechiokolobi](https://github.com/amaechiokolobi)! - error handling for Treasure #added + +- [#14057](https://github.com/smartcontractkit/chainlink/pull/14057) [`e0850a6a31`](https://github.com/smartcontractkit/chainlink/commit/e0850a6a31843606015d1c49d52b5a6ad8727378) Thanks [@reductionista](https://github.com/reductionista)! - #bugfix Addresses 2 minor issues with the pruning of LogPoller's db tables: logs not matching any filter will now be pruned, and rows deleted are now properly reported for observability + +- [#14146](https://github.com/smartcontractkit/chainlink/pull/14146) [`d0d2f3046d`](https://github.com/smartcontractkit/chainlink/commit/d0d2f3046d44dc929b97bfff69b2daf4de2d4c8e) Thanks [@Farber98](https://github.com/Farber98)! - remove chainReader from the Relayer struct. #internal + +- [#14016](https://github.com/smartcontractkit/chainlink/pull/14016) [`8b9f2b6b90`](https://github.com/smartcontractkit/chainlink/commit/8b9f2b6b9098e8ec2368773368239106d066e4e3) Thanks [@ilija42](https://github.com/ilija42)! - #internal Add evm Chain Reader GetLatestValue support for filtering on indexed topic types that get hashed. + +- [#14033](https://github.com/smartcontractkit/chainlink/pull/14033) [`375e17b70f`](https://github.com/smartcontractkit/chainlink/commit/375e17b70fe6f17483556a491370e72218896dbc) Thanks [@Farber98](https://github.com/Farber98)! - Change ChainReader Block primitive field from int to string. #internal + +- [#14160](https://github.com/smartcontractkit/chainlink/pull/14160) [`c98feb205d`](https://github.com/smartcontractkit/chainlink/commit/c98feb205d5eef64d71c42b43516a87b83796a1d) Thanks [@ma33r](https://github.com/ma33r)! - Edited the Optimism Stack L1 Oracle to add support for Mantle #added + +- [#13999](https://github.com/smartcontractkit/chainlink/pull/13999) [`2a032e83a5`](https://github.com/smartcontractkit/chainlink/commit/2a032e83a5e09ae128e8c751779a7d1eebb729ea) Thanks [@amit-momin](https://github.com/amit-momin)! - Updated AutoPurge.Threshold and AutoPurge.MinAttempts configs to only be required for heuristic and added content-type header for Scroll API #internal + +- [#14021](https://github.com/smartcontractkit/chainlink/pull/14021) [`bd648bd73d`](https://github.com/smartcontractkit/chainlink/commit/bd648bd73df2a1de91a463a988f4c5b61e74b240) Thanks [@dhaidashenko](https://github.com/dhaidashenko)! - Added custom finality calculation for Astar #internal + +- [#14145](https://github.com/smartcontractkit/chainlink/pull/14145) [`567ce229ed`](https://github.com/smartcontractkit/chainlink/commit/567ce229ed434a74b09124feadf3265017ec5313) Thanks [@cedric-cordenier](https://github.com/cedric-cordenier)! - Formalize trigger API #internal + +- [#14127](https://github.com/smartcontractkit/chainlink/pull/14127) [`5e99bdb764`](https://github.com/smartcontractkit/chainlink/commit/5e99bdb764171f584df1fc6e10495c8ec0a3bb63) Thanks [@amit-momin](https://github.com/amit-momin)! - Added client error classification for terminally stuck transactions in the TXM #internal + +- [#14043](https://github.com/smartcontractkit/chainlink/pull/14043) [`55e7c8b505`](https://github.com/smartcontractkit/chainlink/commit/55e7c8b5055c975665a59199d5eda9fa21801a07) Thanks [@asoliman92](https://github.com/asoliman92)! - Added CCIP plugins code from https://github.com/smartcontractkit/ccip/ #added + +### Patch Changes + +- [#14148](https://github.com/smartcontractkit/chainlink/pull/14148) [`0ceb9b5fc6`](https://github.com/smartcontractkit/chainlink/commit/0ceb9b5fc67199b850d16b6a5ab1848327e91a5b) Thanks [@vyzaldysanchez](https://github.com/vyzaldysanchez)! - #bugfix Fixes test flake + +- [#14174](https://github.com/smartcontractkit/chainlink/pull/14174) [`b9a433bff5`](https://github.com/smartcontractkit/chainlink/commit/b9a433bff513223378b8b29c6f694446d00c345b) Thanks [@DeividasK](https://github.com/DeividasK)! - #added Allow workflows to run without external registry configured + +- [#13987](https://github.com/smartcontractkit/chainlink/pull/13987) [`c1bd103e9b`](https://github.com/smartcontractkit/chainlink/commit/c1bd103e9b134a90e0bd5f77b6e54797c7c881a8) Thanks [@KodeyThomas](https://github.com/KodeyThomas)! - #added L3X Config + +- [#14236](https://github.com/smartcontractkit/chainlink/pull/14236) [`0294e1f381`](https://github.com/smartcontractkit/chainlink/commit/0294e1f3813c0643b61af828ec438307dcab3123) Thanks [@dhaidashenko](https://github.com/dhaidashenko)! - Fixed deadlock in RPCClient causing CL Node to stop performing RPC requests for the affected chain #bugfix + +- [#14206](https://github.com/smartcontractkit/chainlink/pull/14206) [`621e87538c`](https://github.com/smartcontractkit/chainlink/commit/621e87538c931d5d3996974589dc27a0ab43f758) Thanks [@bukata-sa](https://github.com/bukata-sa)! - #bugfix head reporter non-zero reporting period + +- [#13862](https://github.com/smartcontractkit/chainlink/pull/13862) [`05ef7fdbb1`](https://github.com/smartcontractkit/chainlink/commit/05ef7fdbb115f55a85bcbbc5402350818501e1f5) Thanks [@martin-cll](https://github.com/martin-cll)! - New Mercury v4 report schema #added + +- [#14112](https://github.com/smartcontractkit/chainlink/pull/14112) [`1b584366d6`](https://github.com/smartcontractkit/chainlink/commit/1b584366d6bedc114946d0c8e202e95d031d5d37) Thanks [@giogam](https://github.com/giogam)! - #updated Sync feeds-manager wsrpc proto + +- [#14246](https://github.com/smartcontractkit/chainlink/pull/14246) [`f1bc2e7ad3`](https://github.com/smartcontractkit/chainlink/commit/f1bc2e7ad3610339145930991bf6a3c9ef94fa52) Thanks [@amit-momin](https://github.com/amit-momin)! - Updated gas limit estimation feature to set From address #internal + +- [#14018](https://github.com/smartcontractkit/chainlink/pull/14018) [`82accfff5c`](https://github.com/smartcontractkit/chainlink/commit/82accfff5c445fd1d29a26607234eba73e6b30fd) Thanks [@ettec](https://github.com/ettec)! - #internal fix to keystone e2e test dispatcher to correctly mock duplicate registration error + +- [#13990](https://github.com/smartcontractkit/chainlink/pull/13990) [`98fc8813dd`](https://github.com/smartcontractkit/chainlink/commit/98fc8813dd7f46e86a15fc3e838bbb681f835d0b) Thanks [@flodesi](https://github.com/flodesi)! - #added Add Astar TerminallyUnderpriced error mapping + +- [#14179](https://github.com/smartcontractkit/chainlink/pull/14179) [`633eb41a44`](https://github.com/smartcontractkit/chainlink/commit/633eb41a4467f91506e05e7fda6873c7b34f4731) Thanks [@bukata-sa](https://github.com/bukata-sa)! - #internal log info on missed finalized head instead of returning an error + +- [#14154](https://github.com/smartcontractkit/chainlink/pull/14154) [`a937d5c577`](https://github.com/smartcontractkit/chainlink/commit/a937d5c577d8ba13dc7542a757359339442ae33f) Thanks [@mateusz-sekara](https://github.com/mateusz-sekara)! - Separate price updates schedule for token prices in CCIP #updated + +- [#14185](https://github.com/smartcontractkit/chainlink/pull/14185) [`b563d77dd3`](https://github.com/smartcontractkit/chainlink/commit/b563d77dd30ad96253ae6586c06fd34a66d61936) Thanks [@mateusz-sekara](https://github.com/mateusz-sekara)! - Reporting all the token prices from the job spec for CCIP #updated + +- [#13756](https://github.com/smartcontractkit/chainlink/pull/13756) [`c92a7212ee`](https://github.com/smartcontractkit/chainlink/commit/c92a7212ee77b08c40d62925216e5081278a4e3f) Thanks [@vyzaldysanchez](https://github.com/vyzaldysanchez)! - #updated Adds DB syncing for registry syncer + +- [#13876](https://github.com/smartcontractkit/chainlink/pull/13876) [`15dc74cabd`](https://github.com/smartcontractkit/chainlink/commit/15dc74cabd3a83041ca97df54ea0fbb7e76e2a0a) Thanks [@dhaidashenko](https://github.com/dhaidashenko)! - Custom (30s) timeout for Hedera RPC requests with large payloads (SendTransaction, CallContext, etc.) #internal + +- [#14214](https://github.com/smartcontractkit/chainlink/pull/14214) [`32a2ccd2ba`](https://github.com/smartcontractkit/chainlink/commit/32a2ccd2ba4cbe59e46779c82ec35c909141ba2a) Thanks [@ettec](https://github.com/ettec)! - #internal allow gas limit to be specified when submitting transaction + +- [#14092](https://github.com/smartcontractkit/chainlink/pull/14092) [`3399dd6d7f`](https://github.com/smartcontractkit/chainlink/commit/3399dd6d7fee12bd8d099b74397edcc4dc56c11d) Thanks [@cds95](https://github.com/cds95)! - #internal prevent editing whether or not a DON accepts workflows + +- [#13780](https://github.com/smartcontractkit/chainlink/pull/13780) [`af335c1a52`](https://github.com/smartcontractkit/chainlink/commit/af335c1a522769c8c29858d8d6510330af3204cf) Thanks [@samsondav](https://github.com/samsondav)! - Further development of LLO plugin (parallel composition) #wip + +- [#14030](https://github.com/smartcontractkit/chainlink/pull/14030) [`d90bb66934`](https://github.com/smartcontractkit/chainlink/commit/d90bb66934a46bb1c6d376b000d860e1588d91c7) Thanks [@ettec](https://github.com/ettec)! - #internal restore common version to head of develop + +- [#14105](https://github.com/smartcontractkit/chainlink/pull/14105) [`eb31cf7970`](https://github.com/smartcontractkit/chainlink/commit/eb31cf7970bef1615b10b5a734c16879b448f30a) Thanks [@ettec](https://github.com/ettec)! - #internal speed up keystone e2e tests + +- [#14047](https://github.com/smartcontractkit/chainlink/pull/14047) [`d963b0aaac`](https://github.com/smartcontractkit/chainlink/commit/d963b0aaac2117902742cf1d6fc8471e82ae711b) Thanks [@ettec](https://github.com/ettec)! - #internal fix the mock trigger to ensure events are sent + +- [#13853](https://github.com/smartcontractkit/chainlink/pull/13853) [`0f557ae1e0`](https://github.com/smartcontractkit/chainlink/commit/0f557ae1e08040c931f6f3e5c6a96b93b1ca2182) Thanks [@flodesi](https://github.com/flodesi)! - #bugfix Bump BSC PriceMin to 3 gwei to match BSC node's required gas price. This value can be pushed back down to 1 gwei to enable cheaper transactions if the GasPrice field under the Eth.Miner header in the BSC node's config is also pushed down to 1000000000 + +- [#13935](https://github.com/smartcontractkit/chainlink/pull/13935) [`7ec99efc64`](https://github.com/smartcontractkit/chainlink/commit/7ec99efc64832750825f8bc6711fb9794d6e40df) Thanks [@ettec](https://github.com/ettec)! - #internal ensure remote target request hash is deterministic + +- [#14017](https://github.com/smartcontractkit/chainlink/pull/14017) [`1257d33913`](https://github.com/smartcontractkit/chainlink/commit/1257d33913d243c146bccbf4bda67a2bb1c7d5af) Thanks [@DeividasK](https://github.com/DeividasK)! - #internal + +- [#14053](https://github.com/smartcontractkit/chainlink/pull/14053) [`4f0f7802a8`](https://github.com/smartcontractkit/chainlink/commit/4f0f7802a884e831cd76d9578ee5c4a7134034db) Thanks [@DylanTinianov](https://github.com/DylanTinianov)! - Added custom client error messages for Mantle to capture InsufficientEth and Fatal errors. #added + +- [#14059](https://github.com/smartcontractkit/chainlink/pull/14059) [`40f4becb1e`](https://github.com/smartcontractkit/chainlink/commit/40f4becb1eab96920d8bfd59019cdb9358a94122) Thanks [@DeividasK](https://github.com/DeividasK)! - #internal + +- [#14116](https://github.com/smartcontractkit/chainlink/pull/14116) [`7fdc0c8e95`](https://github.com/smartcontractkit/chainlink/commit/7fdc0c8e95c4157dd9e3ce3f9a4efe370554a19c) Thanks [@ettec](https://github.com/ettec)! - #internal ks-404 validate ids before using as seed of transmission schedule + +- [#13993](https://github.com/smartcontractkit/chainlink/pull/13993) [`f5e0bd614a`](https://github.com/smartcontractkit/chainlink/commit/f5e0bd614a6c42d195c4ad74a10f7070970d01d5) Thanks [@DeividasK](https://github.com/DeividasK)! - #internal + +- [#14209](https://github.com/smartcontractkit/chainlink/pull/14209) [`c00ac968e6`](https://github.com/smartcontractkit/chainlink/commit/c00ac968e651fd7b09f473d20f0fe4755ba57367) Thanks [@AnieeG](https://github.com/AnieeG)! - #internal Adding deployment package as new pattern for product deployment/configuration + +- [#14183](https://github.com/smartcontractkit/chainlink/pull/14183) [`35f68c806b`](https://github.com/smartcontractkit/chainlink/commit/35f68c806b10cc0fe4a565293e32e2f5581bfeb5) Thanks [@graham-chainlink](https://github.com/graham-chainlink)! - #bugfix Fix incorrect error handling when registering a new feed manager + +- [#14212](https://github.com/smartcontractkit/chainlink/pull/14212) [`25d2961154`](https://github.com/smartcontractkit/chainlink/commit/25d29611543c3d43484c168e7efc23a7bf83f035) Thanks [@bukata-sa](https://github.com/bukata-sa)! - #internal add head report chain_id + +- [#14066](https://github.com/smartcontractkit/chainlink/pull/14066) [`98b9054397`](https://github.com/smartcontractkit/chainlink/commit/98b90543972d37e4c00196f3f00bcf5f380ea04d) Thanks [@DeividasK](https://github.com/DeividasK)! - #internal + +- [#14014](https://github.com/smartcontractkit/chainlink/pull/14014) [`c2c31c05ac`](https://github.com/smartcontractkit/chainlink/commit/c2c31c05ac3fe19d4df8313af25eb740953b935a) Thanks [@Madalosso](https://github.com/Madalosso)! - #updated Update Polygon configs to match PIP-35 + +- [#14125](https://github.com/smartcontractkit/chainlink/pull/14125) [`8fa8c3a075`](https://github.com/smartcontractkit/chainlink/commit/8fa8c3a07512bb8358abdabc3fdcc8ae310c6c1c) Thanks [@bukata-sa](https://github.com/bukata-sa)! - #bugfix balance shutdown deadlock + +- [#14181](https://github.com/smartcontractkit/chainlink/pull/14181) [`ee57b4f940`](https://github.com/smartcontractkit/chainlink/commit/ee57b4f940b8a9d9d7bba41a74e4757874755f5f) Thanks [@ettec](https://github.com/ettec)! - #internal topeerid should validate []byte length + +- [#14074](https://github.com/smartcontractkit/chainlink/pull/14074) [`a865709ea1`](https://github.com/smartcontractkit/chainlink/commit/a865709ea18bfc792db758b60de6f03e953f141f) Thanks [@mateusz-sekara](https://github.com/mateusz-sekara)! - Simplify how token and gas prices are stored in the database - user upsert instead of insert/delete flow #db_update + +- [#14050](https://github.com/smartcontractkit/chainlink/pull/14050) [`537d2ec1ad`](https://github.com/smartcontractkit/chainlink/commit/537d2ec1ad846898f820874442c3f69915096bad) Thanks [@ettec](https://github.com/ettec)! - #internal fix data race in syncer launcher + +- [#13970](https://github.com/smartcontractkit/chainlink/pull/13970) [`cefbb09797`](https://github.com/smartcontractkit/chainlink/commit/cefbb09797249309ac18e4ef81147e30f7c24360) Thanks [@cds95](https://github.com/cds95)! - #internal prevent reentrancy when configuring DON in Capabilities Registry + +- [#13907](https://github.com/smartcontractkit/chainlink/pull/13907) [`1eaf5e087a`](https://github.com/smartcontractkit/chainlink/commit/1eaf5e087a5ac204e0b472e1c307722887104678) Thanks [@dhaidashenko](https://github.com/dhaidashenko)! - Added new health check that ensures RPC provides new finalized heads at least every `NoNewFinalizedHeadsThreshold` #added + +## 2.15.0 - 2024-08-21 + +### Minor Changes + +- [#13472](https://github.com/smartcontractkit/chainlink/pull/13472) [`685681e1b3`](https://github.com/smartcontractkit/chainlink/commit/685681e1b3b44ec9dadd4756ec6f0407ffda8afe) Thanks [@vreff](https://github.com/vreff)! - Remove ocr2vrf + + #removed all ocr2vrf and dkg OCR2 plugin materials. + +- [#13787](https://github.com/smartcontractkit/chainlink/pull/13787) [`e065b82d2b`](https://github.com/smartcontractkit/chainlink/commit/e065b82d2b8d565c046c2d96065ad1f593d9b488) Thanks [@cedric-cordenier](https://github.com/cedric-cordenier)! - Initialize registry syncer' contract reader lazily #keystone #internal + +- [#13514](https://github.com/smartcontractkit/chainlink/pull/13514) [`f84a3f2f27`](https://github.com/smartcontractkit/chainlink/commit/f84a3f2f276847d26c94bf67215e2a3600951c9c) Thanks [@ilija42](https://github.com/ilija42)! - #internal Change CR GetLatestValue to accept confidenceLevels that map to finality for contract read and event querying. Also remove Pending from BoundContract which used to map to finality for log events. + +- [#13805](https://github.com/smartcontractkit/chainlink/pull/13805) [`5daee38379`](https://github.com/smartcontractkit/chainlink/commit/5daee38379495cd858d8022339b5e9202e2ef0aa) Thanks [@silaslenihan](https://github.com/silaslenihan)! - #internal Added small check to allow for nil TxMeta in CW SubmitTransaction + +- [#13635](https://github.com/smartcontractkit/chainlink/pull/13635) [`055a9d24f8`](https://github.com/smartcontractkit/chainlink/commit/055a9d24f80a0a6cba8a44cab1a2832eef883761) Thanks [@ilija42](https://github.com/ilija42)! - #internal Add BatchGetLatestValues to ChainReader + +- [#13753](https://github.com/smartcontractkit/chainlink/pull/13753) [`8beda6093f`](https://github.com/smartcontractkit/chainlink/commit/8beda6093fe464a98b34ceb77bac6ba51add26b2) Thanks [@snehaagni](https://github.com/snehaagni)! - Bump to start the next version + +- [#13678](https://github.com/smartcontractkit/chainlink/pull/13678) [`4e3f5e8d4f`](https://github.com/smartcontractkit/chainlink/commit/4e3f5e8d4f022dcabce177ac52477820b85f04b1) Thanks [@krehermann](https://github.com/krehermann)! - #internal refactor goose migrations to use provider + +- [#13843](https://github.com/smartcontractkit/chainlink/pull/13843) [`31557117b2`](https://github.com/smartcontractkit/chainlink/commit/31557117b25f456b0dda38453098fa92dba55200) Thanks [@krehermann](https://github.com/krehermann)! - #internal cleanup heavyweight test databases automatically + +- [#13861](https://github.com/smartcontractkit/chainlink/pull/13861) [`b3c93a7f25`](https://github.com/smartcontractkit/chainlink/commit/b3c93a7f259a279060f555098efb4d683ab7e838) Thanks [@reductionista](https://github.com/reductionista)! - #bugfix Set LatestFinalizedBlock for finalized blocks saved by logpoller + +- [#13821](https://github.com/smartcontractkit/chainlink/pull/13821) [`5b668c186a`](https://github.com/smartcontractkit/chainlink/commit/5b668c186ac8ba294a97b20484352221f258bae2) Thanks [@ferglor](https://github.com/ferglor)! - Use the new log buffer in automation #changed + +### Patch Changes + +- [#13749](https://github.com/smartcontractkit/chainlink/pull/13749) [`e28f8a4386`](https://github.com/smartcontractkit/chainlink/commit/e28f8a4386fcd0baa09cf95e5f59e3312b592506) Thanks [@shileiwill](https://github.com/shileiwill)! - add chaos and reorg tests #added + +- [#13937](https://github.com/smartcontractkit/chainlink/pull/13937) [`27d9c71b19`](https://github.com/smartcontractkit/chainlink/commit/27d9c71b196961666de87bc3128d31f3c22fb3fa) Thanks [@cds95](https://github.com/cds95)! - #internal address security vulnerabilities around updating nodes and node operators on capabilities registry + +- [#13692](https://github.com/smartcontractkit/chainlink/pull/13692) [`5f3d58ba67`](https://github.com/smartcontractkit/chainlink/commit/5f3d58ba67a4e92832d2fa9fc2af487b697ee8ab) Thanks [@samsondav](https://github.com/samsondav)! - Add "VerboseLogging" option to mercury + + Off by default, can be enabled like so: + + ```toml + [Mercury] + VerboseLogging = true + ``` + + #updated + +- [#13687](https://github.com/smartcontractkit/chainlink/pull/13687) [`df0b06ee1c`](https://github.com/smartcontractkit/chainlink/commit/df0b06ee1ce28a8a7977bd3c9bdd8c9c307bef79) Thanks [@KodeyThomas](https://github.com/KodeyThomas)! - #added support for EIP-1559 transactions for Scroll + +- [#13857](https://github.com/smartcontractkit/chainlink/pull/13857) [`6bf25fc01c`](https://github.com/smartcontractkit/chainlink/commit/6bf25fc01c2e0c7de2ef9d79d511688c276368c1) Thanks [@Farber98](https://github.com/Farber98)! - remove tautological err check within evm txm. #internal + +- [#13839](https://github.com/smartcontractkit/chainlink/pull/13839) [`48b11ddff4`](https://github.com/smartcontractkit/chainlink/commit/48b11ddff47675c4c645764b0a25fd8a23b247ed) Thanks [@jinhoonbang](https://github.com/jinhoonbang)! - #db_update add an empty BAL spec in migrations + +- [#13653](https://github.com/smartcontractkit/chainlink/pull/13653) [`b1c9315776`](https://github.com/smartcontractkit/chainlink/commit/b1c9315776c906bd671c5be404b5cd0c5c34fdba) Thanks [@ferglor](https://github.com/ferglor)! - Dequeue minimum guaranteed upkeeps as a priority #changed + +- [#13906](https://github.com/smartcontractkit/chainlink/pull/13906) [`6adb82788a`](https://github.com/smartcontractkit/chainlink/commit/6adb82788a3b53514dd8b2c0742565e5bd175f9b) Thanks [@ettec](https://github.com/ettec)! - #internal change chain reader to use nil blocknumber when reading latest value + +- [#13793](https://github.com/smartcontractkit/chainlink/pull/13793) [`741351107b`](https://github.com/smartcontractkit/chainlink/commit/741351107b11966f0af8246a76ac7b5bd6a20556) Thanks [@nickcorin](https://github.com/nickcorin)! - #internal Bumped dependencies for `chainlink-common`, `chainlink-solana`, and `chainlink-starknet`. + +- [#13789](https://github.com/smartcontractkit/chainlink/pull/13789) [`e140a2bc1c`](https://github.com/smartcontractkit/chainlink/commit/e140a2bc1c90fa2522109c9da021c3085ed9268d) Thanks [@nickcorin](https://github.com/nickcorin)! - #internal add `NewChainWriter` method onto the dummy relayer. + +- [#13761](https://github.com/smartcontractkit/chainlink/pull/13761) [`89196f1fb8`](https://github.com/smartcontractkit/chainlink/commit/89196f1fb8306c90d4e45281130c894bb12328f7) Thanks [@agusaldasoro](https://github.com/agusaldasoro)! - Make send signatures configurable when Transmit in Contract Transmitter #internal + +- [#13795](https://github.com/smartcontractkit/chainlink/pull/13795) [`683a12e85e`](https://github.com/smartcontractkit/chainlink/commit/683a12e85e91628f240fe24f32b982b53ac30bd9) Thanks [@KuphJr](https://github.com/KuphJr)! - Updated Functions ToS contract wrappers #internal + +- [#13838](https://github.com/smartcontractkit/chainlink/pull/13838) [`d6ebada1b6`](https://github.com/smartcontractkit/chainlink/commit/d6ebada1b6572820a98255b8762cf60810db3210) Thanks [@ettec](https://github.com/ettec)! - #internal end to end test for streams capabilities + +- [#13815](https://github.com/smartcontractkit/chainlink/pull/13815) [`fb177f4ee7`](https://github.com/smartcontractkit/chainlink/commit/fb177f4ee77898dd12e20499e421a4d591fb92ef) Thanks [@KuphJr](https://github.com/KuphJr)! - #internal Updated wrappers for improved L1 -> L2 fee calculation for Functions + +- [#13335](https://github.com/smartcontractkit/chainlink/pull/13335) [`697e469e41`](https://github.com/smartcontractkit/chainlink/commit/697e469e41e640c8c71214461426174340527b4b) Thanks [@ibrajer](https://github.com/ibrajer)! - VRFV2Plus coordinator and wrapper split contracts between L1 and L2 chains #updated + +- [#13785](https://github.com/smartcontractkit/chainlink/pull/13785) [`873abacbc6`](https://github.com/smartcontractkit/chainlink/commit/873abacbc6ce1391fec245045c9436b92d3749f4) Thanks [@martin-cll](https://github.com/martin-cll)! - #internal Mercury v3: Include telemetry if bid/ask violation is detected + +- [#13877](https://github.com/smartcontractkit/chainlink/pull/13877) [`81a21bb56c`](https://github.com/smartcontractkit/chainlink/commit/81a21bb56cd597858221f775c796994be0f2e0da) Thanks [@ettec](https://github.com/ettec)! - #internal logging of non determinism in target server + +- [#13868](https://github.com/smartcontractkit/chainlink/pull/13868) [`00ef51a7c1`](https://github.com/smartcontractkit/chainlink/commit/00ef51a7c11fd227b73e3533f59950aa78b82162) Thanks [@samsondav](https://github.com/samsondav)! - Protocol-level support for preventing bid/ask variant violations in mercury #added + +- [#13120](https://github.com/smartcontractkit/chainlink/pull/13120) [`68a6a66919`](https://github.com/smartcontractkit/chainlink/commit/68a6a6691906aec5807f6c8dae12f9da621304ee) Thanks [@george-dorin](https://github.com/george-dorin)! - #changed Rename the `InBackupHealthReport` to `StartUpHealthReport` and enable it for DB migrations as well. This will enable health report to be available during long start-up tasks (db backups and migrations). + +- [#13852](https://github.com/smartcontractkit/chainlink/pull/13852) [`ced300beeb`](https://github.com/smartcontractkit/chainlink/commit/ced300beebbd1971e11e83a558bb9b1efe0290d9) Thanks [@ettec](https://github.com/ettec)! - #internal additional logging to remote target capability + +- [#13829](https://github.com/smartcontractkit/chainlink/pull/13829) [`51225f83f3`](https://github.com/smartcontractkit/chainlink/commit/51225f83f30a87606c3c7af56618cd16393c345e) Thanks [@nickcorin](https://github.com/nickcorin)! - #internal Use txid as the idempotency key in the evm chainwriter + +- [#13712](https://github.com/smartcontractkit/chainlink/pull/13712) [`535d2795c6`](https://github.com/smartcontractkit/chainlink/commit/535d2795c6e9b66315fe066c7dbaf91977d3e913) Thanks [@dhaidashenko](https://github.com/dhaidashenko)! - Fix TestHeadTracker_CallsHeadTrackableCallbacks flaky test #internal + +- [#13713](https://github.com/smartcontractkit/chainlink/pull/13713) [`6d2b5faf10`](https://github.com/smartcontractkit/chainlink/commit/6d2b5faf10efb81a235ff3470bc205c929a6d35d) Thanks [@dhaidashenko](https://github.com/dhaidashenko)! - Fix TestIntegration_KeeperPluginLogUpkeep_ErrHandler flaky test #internal + +## 2.14.0 - 2024-07-29 ### Minor Changes diff --git a/GNUmakefile b/GNUmakefile index 8353a288e87..e2a3508e199 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -27,12 +27,8 @@ gomod: ## Ensure chainlink's go dependencies are installed. go mod download .PHONY: gomodtidy -gomodtidy: ## Run go mod tidy on all modules. - go mod tidy - cd ./core/scripts && go mod tidy - cd ./integration-tests && go mod tidy - cd ./integration-tests/load && go mod tidy - cd ./dashboard-lib && go mod tidy +gomodtidy: gomods ## Run go mod tidy on all modules. + gomods tidy .PHONY: docs docs: ## Install and run pkgsite to view Go docs @@ -74,6 +70,16 @@ docker: --build-arg COMMIT_SHA=$(COMMIT_SHA) \ -f core/chainlink.Dockerfile . +.PHONY: docker-ccip ## Build the chainlink docker image +docker-ccip: + docker buildx build \ + --build-arg COMMIT_SHA=$(COMMIT_SHA) \ + -f core/chainlink.Dockerfile . -t chainlink-ccip:latest + + docker buildx build \ + --build-arg COMMIT_SHA=$(COMMIT_SHA) \ + -f ccip/ccip.Dockerfile . + .PHONY: docker-plugins ## Build the chainlink-plugins docker image docker-plugins: docker buildx build \ @@ -89,12 +95,13 @@ abigen: ## Build & install abigen. ./tools/bin/build_abigen .PHONY: generate -generate: abigen codecgen mockery protoc ## Execute all go:generate commands. - go generate -x ./... - cd ./core/scripts && go generate -x ./... - cd ./integration-tests && go generate -x ./... - cd ./integration-tests/load && go generate -x ./... - cd ./dashboard-lib && go generate -x ./... +generate: abigen codecgen mockery protoc gomods ## Execute all go:generate commands. + gomods -w go generate -x ./... + mockery + +.PHONY: rm-mocked +rm-mocked: + grep -rl "^// Code generated by mockery" | grep .go$ | xargs -r rm .PHONY: testscripts testscripts: chainlink-test ## Install and run testscript against testdata/scripts/* files. @@ -131,7 +138,7 @@ presubmit: ## Format go files and imports. .PHONY: gomods gomods: ## Install gomods - go install github.com/jmank88/gomods@v0.1.1 + go install github.com/jmank88/gomods@v0.1.4 .PHONY: mockery mockery: $(mockery) ## Install mockery. @@ -145,6 +152,7 @@ codecgen: $(codecgen) ## Install codecgen protoc: ## Install protoc core/scripts/install-protoc.sh 25.1 / go install google.golang.org/protobuf/cmd/protoc-gen-go@`go list -m -json google.golang.org/protobuf | jq -r .Version` + go install github.com/smartcontractkit/wsrpc/cmd/protoc-gen-go-wsrpc@`go list -m -json github.com/smartcontractkit/wsrpc | jq -r .Version` .PHONY: telemetry-protobuf telemetry-protobuf: $(telemetry-protobuf) ## Generate telemetry protocol buffers. @@ -162,8 +170,7 @@ config-docs: ## Generate core node configuration documentation .PHONY: golangci-lint golangci-lint: ## Run golangci-lint for all issues. [ -d "./golangci-lint" ] || mkdir ./golangci-lint && \ - docker run --rm -v $(shell pwd):/app -w /app golangci/golangci-lint:v1.59.1 golangci-lint run --max-issues-per-linter 0 --max-same-issues 0 > ./golangci-lint/$(shell date +%Y-%m-%d_%H:%M:%S).txt - + docker run --rm -v $(shell pwd):/app -w /app golangci/golangci-lint:v1.59.1 golangci-lint run --max-issues-per-linter 0 --max-same-issues 0 | tee ./golangci-lint/$(shell date +%Y-%m-%d_%H:%M:%S).txt GORELEASER_CONFIG ?= .goreleaser.yaml @@ -181,7 +188,7 @@ modgraph: .PHONY: test-short test-short: ## Run 'go test -short' and suppress uninteresting output - go test -short ./... | grep -v "[no test files]" | grep -v "\(cached\)" + go test -short ./... | grep -v "no test files" | grep -v "\(cached\)" help: @echo "" diff --git a/LICENSE b/LICENSE index 1fa3822f510..3af9faa6c6f 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,8 @@ -The MIT License (MIT) +Copyright (c) 2018 SmartContract ChainLink Limited SEZC + +Portions of this software are licensed as follows: -Copyright (c) 2018 SmartContract ChainLink, Ltd. +The MIT License (MIT) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -19,3 +21,12 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + +*All content residing under (1) “/contracts/src/v0.8/ccip”; (2) +“/core/gethwrappers/ccip”; (3) “/core/services/ocr2/plugins/ccip”; (4) "/core/capabilities/ccip" are licensed +under “Business Source License 1.1” with a Change Date of May 23, 2027 and +Change License to “MIT License” + +* Content outside of the above mentioned directories or restrictions +above is available under the "MIT" license as defined above. \ No newline at end of file diff --git a/README.md b/README.md index a62be57a6ea..e7c21c1e094 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ regarding Chainlink social accounts, news, and networking. ## Build Chainlink -1. [Install Go 1.21](https://golang.org/doc/install), and add your GOPATH's [bin directory to your PATH](https://golang.org/doc/code.html#GOPATH) +1. [Install Go 1.22](https://golang.org/doc/install), and add your GOPATH's [bin directory to your PATH](https://golang.org/doc/code.html#GOPATH) - Example Path for macOS `export PATH=$GOPATH/bin:$PATH` & `export GOPATH=/Users/$USER/go` 2. Install [NodeJS v20](https://nodejs.org/en/download/package-manager/) & [pnpm v9 via npm](https://pnpm.io/installation#using-npm). - It might be easier long term to use [nvm](https://nodejs.org/en/download/package-manager/#nvm) to switch between node versions for different projects. For example, assuming $NODE_VERSION was set to a valid version of NodeJS, you could run: `nvm install $NODE_VERSION && nvm use $NODE_VERSION` @@ -132,6 +132,21 @@ External adapters are what make Chainlink easily extensible, providing simple in For more information on creating and using external adapters, please see our [external adapters page](https://docs.chain.link/docs/external-adapters). +## Verify Official Chainlink Releases + +We use `cosign` with OIDC keyless signing during the [Build, Sign and Publish Chainlink](https://github.com/smartcontractkit/chainlink/actions/workflows/build-publish.yml) workflow. + +It is encourage for any node operator building from the official Chainlink docker image to verify the tagged release version was did indeed built from this workflow. + +You will need `cosign` in order to do this verification. [Follow the instruction here to install cosign](https://docs.sigstore.dev/system_config/installation/). + +```bash +# tag is the tagged release version - ie. v2.16.0 +cosign verify public.ecr.aws/chainlink/chainlink:${tag} \ + --certificate-oidc-issuer https://token.actions.githubusercontent.com \ + --certificate-identity "https://github.com/smartcontractkit/chainlink/.github/workflows/build-publish.yml@refs/tags/${tag}" +``` + ## Development ### Running tests @@ -158,7 +173,7 @@ popd 4. Generate and compile static assets: ```bash -go generate ./... +make generate ``` 5. Prepare your development environment: diff --git a/bors.toml b/bors.toml deleted file mode 100644 index 5970c638cee..00000000000 --- a/bors.toml +++ /dev/null @@ -1,20 +0,0 @@ -# https://github.com/bors-ng/bors-ng/issues/730 -status = [ - "sigscanner-check", - "lint", - "Core Tests (go_core_tests)", - "Core Tests (go_core_race_tests)", - "Solana Smoke Tests", - "Prettier Formatting", - "ETH Smoke Tests", - "Solidity" -] -block_labels = [ "do-not-merge", "do-not-merge-yet", "needs changes", "wip" ] -timeout_sec = 3600 # one hour -required_approvals = 1 -up_to_date_approvals = true -delete_merged_branches = true -update_base_for_deletes = true -# todo: enable after organizing codeowners -# use_codeowners = true -use_squash_merge = true diff --git a/ccip/config/README.md b/ccip/config/README.md new file mode 100644 index 00000000000..f5cd87e688e --- /dev/null +++ b/ccip/config/README.md @@ -0,0 +1,10 @@ +# Default Configurations + +:warning: IMPORTANT :warning: + +This directory contains configs that are specific to the CCIP build. Apply changes here only if related to the CCIP. + + +All config sets **inherit** from `fallback.toml` first and overwrite +fields as necessary. Do not create a new full configuration from +scratch. diff --git a/ccip/config/evm/Arbitrum_Mainnet.toml b/ccip/config/evm/Arbitrum_Mainnet.toml new file mode 100644 index 00000000000..e3dcafd56fb --- /dev/null +++ b/ccip/config/evm/Arbitrum_Mainnet.toml @@ -0,0 +1,29 @@ +# Arbitrum is an L2 chain. Pending proper L2 support, for now we rely on their sequencer +ChainID = '42161' +ChainType = 'arbitrum' +FinalityTagEnabled = true +LinkContractAddress = "0xf97f4df75117a78c1A5a0DBb814Af92458539FB4" +LogPollInterval = '1s' +# Arbitrum only emits blocks when a new tx is received, so this method of liveness detection is not useful +NoNewHeadsThreshold = '0' +OCR.ContractConfirmations = 1 + +[GasEstimator] +Mode = 'Arbitrum' +LimitMax = 1_000_000_000 +# Arbitrum uses the suggested gas price, so we don't want to place any limits on the minimum +PriceMin = '0' +PriceDefault = '0.1 gwei' +PriceMax = '115792089237316195423570985008687907853269984665.640564039457584007913129639935 tether' +FeeCapDefault = '1000 gwei' +BumpThreshold = 5 + +[GasEstimator.BlockHistory] +# Force an error if someone set GAS_UPDATER_ENABLED=true by accident; we never want to run the block history estimator on arbitrum +BlockHistorySize = 0 + +[NodePool] +SyncThreshold = 10 + +[OCR2.Automation] +GasLimit = 14500000 diff --git a/ccip/config/evm/Arbitrum_Sepolia.toml b/ccip/config/evm/Arbitrum_Sepolia.toml new file mode 100644 index 00000000000..ea994cf7c78 --- /dev/null +++ b/ccip/config/evm/Arbitrum_Sepolia.toml @@ -0,0 +1,27 @@ +ChainID = '421614' +ChainType = 'arbitrum' +FinalityTagEnabled = true +LinkContractAddress = '0xE4aB69C077896252FAFBD49EFD26B5D171A32410' +NoNewHeadsThreshold = '0' +OCR.ContractConfirmations = 1 +LogPollInterval = '1s' + +[GasEstimator] +Mode = 'Arbitrum' +LimitMax = 1_000_000_000 +# Arbitrum uses the suggested gas price, so we don't want to place any limits on the minimum +PriceMin = '0' +PriceDefault = '0.1 gwei' +PriceMax = '115792089237316195423570985008687907853269984665.640564039457584007913129639935 tether' +FeeCapDefault = '1000 gwei' +BumpThreshold = 5 + +[GasEstimator.BlockHistory] +# Force an error if someone set GAS_UPDATER_ENABLED=true by accident; we never want to run the block history estimator on arbitrum +BlockHistorySize = 0 + +[NodePool] +SyncThreshold = 10 + +[OCR2.Automation] +GasLimit = 14500000 diff --git a/ccip/config/evm/Astar_Mainnet.toml b/ccip/config/evm/Astar_Mainnet.toml new file mode 100644 index 00000000000..87808001eb7 --- /dev/null +++ b/ccip/config/evm/Astar_Mainnet.toml @@ -0,0 +1,9 @@ +ChainID = '592' +FinalityTagEnabled = true +FinalityDepth = 100 +LogPollInterval = '6s' + +[GasEstimator] +EIP1559DynamicFees = false +PriceMax = '100000 gwei' +LimitDefault = 8000000 \ No newline at end of file diff --git a/ccip/config/evm/Astar_Shibuya.toml b/ccip/config/evm/Astar_Shibuya.toml new file mode 100644 index 00000000000..5a5df06f6f0 --- /dev/null +++ b/ccip/config/evm/Astar_Shibuya.toml @@ -0,0 +1,9 @@ +ChainID = '81' +FinalityTagEnabled = true +FinalityDepth = 100 +LogPollInterval = '6s' + +[GasEstimator] +EIP1559DynamicFees = false +PriceMax = '100000 gwei' +LimitDefault = 8000000 \ No newline at end of file diff --git a/ccip/config/evm/Avalanche_ANZ_testnet.toml b/ccip/config/evm/Avalanche_ANZ_testnet.toml new file mode 100644 index 00000000000..1242e1ec06e --- /dev/null +++ b/ccip/config/evm/Avalanche_ANZ_testnet.toml @@ -0,0 +1,22 @@ +ChainID = '76578' +FinalityDepth = 1 +FinalityTagEnabled = false +LinkContractAddress = '0x779877A7B0D9E8603169DdbD7836e478b4624789' +LogPollInterval = '3s' +MinIncomingConfirmations = 1 +# Avax subnet only emits blocks when a new tx is received, so this method of liveness detection is not useful. +NoNewHeadsThreshold = '0' +OCR.ContractConfirmations = 1 +RPCBlockQueryDelay = 2 + +[GasEstimator] +Mode = 'BlockHistory' +PriceDefault = '25 gwei' +PriceMax = '115792089237316195423570985008687907853269984665.640564039457584007913129639935 tether' +PriceMin = '25 gwei' + +[GasEstimator.BlockHistory] +BlockHistorySize = 24 + +[HeadTracker] +PersistenceEnabled = false diff --git a/ccip/config/evm/Avalanche_Fuji.toml b/ccip/config/evm/Avalanche_Fuji.toml new file mode 100644 index 00000000000..91b8bf6bab8 --- /dev/null +++ b/ccip/config/evm/Avalanche_Fuji.toml @@ -0,0 +1,22 @@ +ChainID = '43113' +FinalityDepth = 1 +FinalityTagEnabled = true +LinkContractAddress = '0x0b9d5D9136855f6FEc3c0993feE6E9CE8a297846' +LogPollInterval = '3s' +MinIncomingConfirmations = 1 +NoNewHeadsThreshold = '30s' +OCR.ContractConfirmations = 1 +RPCBlockQueryDelay = 2 +NoNewFinalizedHeadsThreshold = '1m' + +[GasEstimator] +PriceDefault = '25 gwei' +PriceMax = '115792089237316195423570985008687907853269984665.640564039457584007913129639935 tether' +PriceMin = '25 gwei' + +[GasEstimator.BlockHistory] +BlockHistorySize = 24 + +[HeadTracker] +FinalityTagBypass = false +PersistenceEnabled = false diff --git a/ccip/config/evm/Avalanche_Mainnet.toml b/ccip/config/evm/Avalanche_Mainnet.toml new file mode 100644 index 00000000000..f51af60098d --- /dev/null +++ b/ccip/config/evm/Avalanche_Mainnet.toml @@ -0,0 +1,22 @@ +ChainID = '43114' +FinalityDepth = 1 +FinalityTagEnabled = true +LinkContractAddress = '0x5947BB275c521040051D82396192181b413227A3' +LogPollInterval = '3s' +MinIncomingConfirmations = 1 +NoNewHeadsThreshold = '30s' +OCR.ContractConfirmations = 1 +RPCBlockQueryDelay = 2 +NoNewFinalizedHeadsThreshold = '1m' + +[GasEstimator] +PriceDefault = '25 gwei' +PriceMax = '115792089237316195423570985008687907853269984665.640564039457584007913129639935 tether' +PriceMin = '25 gwei' + +[GasEstimator.BlockHistory] +# Average block time of 2s +BlockHistorySize = 24 + +[HeadTracker] +PersistenceEnabled = false diff --git a/ccip/config/evm/BSC_Mainnet.toml b/ccip/config/evm/BSC_Mainnet.toml new file mode 100644 index 00000000000..10f4c570bef --- /dev/null +++ b/ccip/config/evm/BSC_Mainnet.toml @@ -0,0 +1,28 @@ +# BSC uses Clique consensus with ~3s block times +# Clique offers finality within (N/2)+1 blocks where N is number of signers +# There are 21 BSC validators so theoretically finality should occur after 21/2+1 = 11 blocks +ChainID = '56' +# Keeping this >> 11 because it's not expensive and gives us a safety margin +FinalityDepth = 50 +FinalityTagEnabled = true +LinkContractAddress = '0x404460C6A5EdE2D891e8297795264fDe62ADBB75' +LogPollInterval = '3s' +NoNewHeadsThreshold = '30s' +RPCBlockQueryDelay = 2 +NoNewFinalizedHeadsThreshold = '45s' + +[GasEstimator] +PriceDefault = '5 gwei' +# 15s delay since feeds update every minute in volatile situations +BumpThreshold = 5 + +[GasEstimator.BlockHistory] +BlockHistorySize = 24 + +[OCR] +DatabaseTimeout = '2s' +ContractTransmitterTransmitTimeout = '2s' +ObservationGracePeriod = '500ms' + +[NodePool] +SyncThreshold = 10 diff --git a/ccip/config/evm/BSC_Testnet.toml b/ccip/config/evm/BSC_Testnet.toml new file mode 100644 index 00000000000..bb13501f1a2 --- /dev/null +++ b/ccip/config/evm/BSC_Testnet.toml @@ -0,0 +1,34 @@ +# BSC uses Clique consensus with ~3s block times +# Clique offers finality within (N/2)+1 blocks where N is number of signers +# There are 21 BSC validators so theoretically finality should occur after 21/2+1 = 11 blocks +ChainID = '97' +# Keeping this >> 11 because it's not expensive and gives us a safety margin +FinalityDepth = 50 +FinalityTagEnabled = true +LinkContractAddress = '0x84b9B910527Ad5C03A9Ca831909E21e236EA7b06' +LogPollInterval = '3s' +NoNewHeadsThreshold = '30s' +RPCBlockQueryDelay = 2 +NoNewFinalizedHeadsThreshold = '40s' + +[GasEstimator] +PriceDefault = '5 gwei' +# 15s delay since feeds update every minute in volatile situations +BumpThreshold = 5 + +[GasEstimator.BlockHistory] +BlockHistorySize = 24 + +[HeadTracker] +HistoryDepth = 100 +SamplingInterval = '1s' +FinalityTagBypass = false +PersistenceEnabled = false + +[OCR] +DatabaseTimeout = '2s' +ContractTransmitterTransmitTimeout = '2s' +ObservationGracePeriod = '500ms' + +[NodePool] +SyncThreshold = 10 diff --git a/ccip/config/evm/Base_Mainnet.toml b/ccip/config/evm/Base_Mainnet.toml new file mode 100644 index 00000000000..da38182b194 --- /dev/null +++ b/ccip/config/evm/Base_Mainnet.toml @@ -0,0 +1,31 @@ +ChainID = '8453' +ChainType = 'optimismBedrock' +FinalityDepth = 200 +FinalityTagEnabled = true +LogPollInterval = '2s' +NoNewHeadsThreshold = '40s' +MinIncomingConfirmations = 1 +NoNewFinalizedHeadsThreshold = '15m' + +[GasEstimator] +EIP1559DynamicFees = true +PriceMin = '1 wei' +BumpMin = '100 wei' + +[GasEstimator.BlockHistory] +BlockHistorySize = 24 + +[Transactions] +ResendAfterThreshold = '30s' + +[HeadTracker] +HistoryDepth = 300 + +[NodePool] +SyncThreshold = 10 + +[OCR] +ContractConfirmations = 1 + +[OCR2.Automation] +GasLimit = 6500000 diff --git a/ccip/config/evm/Base_Sepolia.toml b/ccip/config/evm/Base_Sepolia.toml new file mode 100644 index 00000000000..92f7717b27d --- /dev/null +++ b/ccip/config/evm/Base_Sepolia.toml @@ -0,0 +1,32 @@ +ChainID = '84532' +ChainType = 'optimismBedrock' +FinalityDepth = 200 +FinalityTagEnabled = true +LinkContractAddress = '0xE4aB69C077896252FAFBD49EFD26B5D171A32410' +LogPollInterval = '2s' +NoNewHeadsThreshold = '40s' +MinIncomingConfirmations = 1 +NoNewFinalizedHeadsThreshold = '12m' + +[GasEstimator] +EIP1559DynamicFees = true +PriceMin = '1 wei' +BumpMin = '100 wei' + +[GasEstimator.BlockHistory] +BlockHistorySize = 60 + +[Transactions] +ResendAfterThreshold = '30s' + +[HeadTracker] +HistoryDepth = 300 + +[NodePool] +SyncThreshold = 10 + +[OCR] +ContractConfirmations = 1 + +[OCR2.Automation] +GasLimit = 6500000 diff --git a/ccip/config/evm/Blast_Mainnet.toml b/ccip/config/evm/Blast_Mainnet.toml new file mode 100644 index 00000000000..f8b501723ff --- /dev/null +++ b/ccip/config/evm/Blast_Mainnet.toml @@ -0,0 +1,34 @@ +ChainID = '81457' +FinalityDepth = 200 +FinalityTagEnabled = true +ChainType = 'optimismBedrock' +# block rate is ~2sec, so this ensures blocks are polled correctly +LogPollInterval = '2s' + +[GasEstimator] +EIP1559DynamicFees = true +BumpThreshold = 60 +BumpPercent = 20 +BumpMin = '100 wei' +PriceMax = '120 gwei' +LimitDefault = 8000000 +FeeCapDefault = '120 gwei' + +[GasEstimator.BlockHistory] +# Default is 24, which leads to bumpy gas prices. In CCIP +# we want to smooth out the gas prices, so we increase the sample size. +BlockHistorySize = 200 +# The formula for FeeCap is (current block base fee * (1.125 ^ EIP1559FeeCapBufferBlocks) + tipcap) +# where tipcap is managed by the block history estimators. In the context of CCIP, +# the gas price is relayed to other changes for quotes so we want accurate/avg not pessimistic values. +# So we set this to zero so FeeCap = baseFee + tipcap. +EIP1559FeeCapBufferBlocks = 0 + +[HeadTracker] +HistoryDepth = 300 + +[NodePool] +# 4 block sync time between nodes to ensure they aren't labelled unreachable too soon +PollFailureThreshold = 4 +# polls every 4sec to check if there is a block produced, since blockRate is ~3sec +PollInterval = '4s' \ No newline at end of file diff --git a/ccip/config/evm/Blast_Sepolia.toml b/ccip/config/evm/Blast_Sepolia.toml new file mode 100644 index 00000000000..96dc5c67871 --- /dev/null +++ b/ccip/config/evm/Blast_Sepolia.toml @@ -0,0 +1,34 @@ +ChainID = '168587773' +FinalityDepth = 200 +FinalityTagEnabled = true +ChainType = 'optimismBedrock' +# block rate is ~2sec, so this ensures blocks are polled correctly +LogPollInterval = '2s' + +[GasEstimator] +EIP1559DynamicFees = true +BumpThreshold = 60 +BumpPercent = 20 +BumpMin = '100 wei' +PriceMax = '120 gwei' +LimitDefault = 8000000 +FeeCapDefault = '120 gwei' + +[GasEstimator.BlockHistory] +# Default is 24, which leads to bumpy gas prices. In CCIP +# we want to smooth out the gas prices, so we increase the sample size. +BlockHistorySize = 200 +# The formula for FeeCap is (current block base fee * (1.125 ^ EIP1559FeeCapBufferBlocks) + tipcap) +# where tipcap is managed by the block history estimators. In the context of CCIP, +# the gas price is relayed to other changes for quotes so we want accurate/avg not pessimistic values. +# So we set this to zero so FeeCap = baseFee + tipcap. +EIP1559FeeCapBufferBlocks = 0 + +[HeadTracker] +HistoryDepth = 300 + +[NodePool] +# 4 block sync time between nodes to ensure they aren't labelled unreachable too soon +PollFailureThreshold = 4 +# polls every 4sec to check if there is a block produced, since blockRate is ~3sec +PollInterval = '4s' \ No newline at end of file diff --git a/ccip/config/evm/Celo_Mainnet.toml b/ccip/config/evm/Celo_Mainnet.toml new file mode 100644 index 00000000000..0ed08986d32 --- /dev/null +++ b/ccip/config/evm/Celo_Mainnet.toml @@ -0,0 +1,21 @@ +ChainID = '42220' +ChainType = 'celo' +FinalityDepth = 10 +LogPollInterval = '5s' +MinIncomingConfirmations = 1 +NoNewHeadsThreshold = '1m' +OCR.ContractConfirmations = 1 +NoNewFinalizedHeadsThreshold = '1m' + +[GasEstimator] +PriceDefault = '5 gwei' +PriceMax = '500 gwei' +PriceMin = '5 gwei' +BumpMin = '2 gwei' + +[GasEstimator.BlockHistory] +BlockHistorySize = 12 + +[HeadTracker] +HistoryDepth = 50 +PersistenceEnabled = false diff --git a/ccip/config/evm/Celo_Testnet.toml b/ccip/config/evm/Celo_Testnet.toml new file mode 100644 index 00000000000..4f457b103e0 --- /dev/null +++ b/ccip/config/evm/Celo_Testnet.toml @@ -0,0 +1,21 @@ +ChainID = '44787' +ChainType = 'celo' +FinalityDepth = 10 +LogPollInterval = '5s' +MinIncomingConfirmations = 1 +NoNewHeadsThreshold = '1m' +OCR.ContractConfirmations = 1 +NoNewFinalizedHeadsThreshold = '1m' + +[GasEstimator] +PriceDefault = '5 gwei' +PriceMax = '500 gwei' +PriceMin = '5 gwei' +BumpMin = '2 gwei' + +[GasEstimator.BlockHistory] +BlockHistorySize = 24 + +[HeadTracker] +HistoryDepth = 50 +PersistenceEnabled = false diff --git a/ccip/config/evm/Ethereum_Mainnet.toml b/ccip/config/evm/Ethereum_Mainnet.toml new file mode 100644 index 00000000000..0bcaf35c648 --- /dev/null +++ b/ccip/config/evm/Ethereum_Mainnet.toml @@ -0,0 +1,17 @@ +ChainID = '1' +LinkContractAddress = '0x514910771AF9Ca656af840dff83E8264EcF986CA' +MinContractPayment = '0.1 link' +OperatorFactoryAddress = '0x3E64Cd889482443324F91bFA9c84fE72A511f48A' +FinalityTagEnabled = true +NoNewFinalizedHeadsThreshold = '9m' + +[GasEstimator] +EIP1559DynamicFees = true + +[GasEstimator.BlockHistory] +# EIP-1559 does well on a smaller block history size +BlockHistorySize = 4 +TransactionPercentile = 50 + +[OCR2.Automation] +GasLimit = 10500000 diff --git a/ccip/config/evm/Ethereum_Sepolia.toml b/ccip/config/evm/Ethereum_Sepolia.toml new file mode 100644 index 00000000000..24a0e68f77a --- /dev/null +++ b/ccip/config/evm/Ethereum_Sepolia.toml @@ -0,0 +1,17 @@ +ChainID = '11155111' +LinkContractAddress = '0x779877A7B0D9E8603169DdbD7836e478b4624789' +MinContractPayment = '0.1 link' +FinalityTagEnabled = true + +[GasEstimator] +EIP1559DynamicFees = true + +[GasEstimator.BlockHistory] +BlockHistorySize = 4 +TransactionPercentile = 50 + +[OCR2.Automation] +GasLimit = 10500000 + +[HeadTracker] +FinalityTagBypass = false diff --git a/ccip/config/evm/Fantom_Mainnet.toml b/ccip/config/evm/Fantom_Mainnet.toml new file mode 100644 index 00000000000..7e76d94278d --- /dev/null +++ b/ccip/config/evm/Fantom_Mainnet.toml @@ -0,0 +1,12 @@ +ChainID = '250' +LinkContractAddress = '0x6F43FF82CCA38001B6699a8AC47A2d0E66939407' +LogPollInterval = '1s' +NoNewHeadsThreshold = '30s' +RPCBlockQueryDelay = 2 + +[GasEstimator] +# Fantom network has been slow to include txs at times when using the BlockHistory estimator, and the recommendation is to use SuggestedPrice mode. +Mode = 'SuggestedPrice' + +[OCR2.Automation] +GasLimit = 3800000 \ No newline at end of file diff --git a/ccip/config/evm/Fantom_Testnet.toml b/ccip/config/evm/Fantom_Testnet.toml new file mode 100644 index 00000000000..5f24a76c2e7 --- /dev/null +++ b/ccip/config/evm/Fantom_Testnet.toml @@ -0,0 +1,12 @@ +ChainID = '4002' +LinkContractAddress = '0xfaFedb041c0DD4fA2Dc0d87a6B0979Ee6FA7af5F' +LogPollInterval = '1s' +# Fantom testnet only emits blocks when a new tx is received, so this method of liveness detection is not useful +NoNewHeadsThreshold = '0' +RPCBlockQueryDelay = 2 + +[GasEstimator] +Mode = 'SuggestedPrice' + +[OCR2.Automation] +GasLimit = 3800000 \ No newline at end of file diff --git a/ccip/config/evm/Gnosis_Chiado.toml b/ccip/config/evm/Gnosis_Chiado.toml new file mode 100644 index 00000000000..379377a2266 --- /dev/null +++ b/ccip/config/evm/Gnosis_Chiado.toml @@ -0,0 +1,10 @@ +ChainID = '10200' +# Gnoisis Finality is approx 8 minutes @ 12 blocks per minute, so 96 blocks +FinalityDepth = 100 +ChainType = 'gnosis' +LogPollInterval = '5s' +NoNewFinalizedHeadsThreshold = '2m' + +[GasEstimator] +EIP1559DynamicFees = true +PriceMax = '500 gwei' diff --git a/ccip/config/evm/Gnosis_Mainnet.toml b/ccip/config/evm/Gnosis_Mainnet.toml new file mode 100644 index 00000000000..628646364f5 --- /dev/null +++ b/ccip/config/evm/Gnosis_Mainnet.toml @@ -0,0 +1,18 @@ +# xDai currently uses AuRa (like Parity) consensus so finality rules will be similar to parity +# See: https://www.poa.network/for-users/whitepaper/poadao-v1/proof-of-authority +# NOTE: xDai is planning to move to Honeybadger BFT which might have different finality guarantees +# https://www.xdaichain.com/for-validators/consensus/honeybadger-bft-consensus +# For worst case re-org depth on AuRa, assume 2n+2 (see: https://github.com/poanetwork/wiki/wiki/Aura-Consensus-Protocol-Audit) +# With xDai's current maximum of 19 validators then 40 blocks is the maximum possible re-org) +# The mainnet default of 50 blocks is ok here +ChainID = '100' +ChainType = 'gnosis' +LinkContractAddress = '0xE2e73A1c69ecF83F464EFCE6A5be353a37cA09b2' +LogPollInterval = '5s' +NoNewFinalizedHeadsThreshold = '2m' + +[GasEstimator] +PriceDefault = '1 gwei' +PriceMax = '500 gwei' +# 1 Gwei is the minimum accepted by the validators (unless whitelisted) +PriceMin = '1 gwei' diff --git a/ccip/config/evm/Kroma_Mainnet.toml b/ccip/config/evm/Kroma_Mainnet.toml new file mode 100644 index 00000000000..3a48aa8ae1b --- /dev/null +++ b/ccip/config/evm/Kroma_Mainnet.toml @@ -0,0 +1,27 @@ +ChainID = '255' +ChainType = 'kroma' # Kroma is based on the Optimism Bedrock architechture +FinalityDepth = 400 +FinalityTagEnabled = true +LogPollInterval = '2s' +NoNewHeadsThreshold = '40s' +MinIncomingConfirmations = 1 + +[GasEstimator] +EIP1559DynamicFees = true +PriceMin = '1 wei' +BumpMin = '100 wei' + +[GasEstimator.BlockHistory] +BlockHistorySize = 24 + +[Transactions] +ResendAfterThreshold = '30s' + +[HeadTracker] +HistoryDepth = 400 + +[NodePool] +SyncThreshold = 10 + +[OCR] +ContractConfirmations = 1 diff --git a/ccip/config/evm/Kroma_Sepolia.toml b/ccip/config/evm/Kroma_Sepolia.toml new file mode 100644 index 00000000000..9609a09e076 --- /dev/null +++ b/ccip/config/evm/Kroma_Sepolia.toml @@ -0,0 +1,27 @@ +ChainID = '2358' +ChainType = 'kroma' # Kroma is based on the Optimism Bedrock architechture +FinalityDepth = 400 +FinalityTagEnabled = true +LogPollInterval = '2s' +NoNewHeadsThreshold = '40s' +MinIncomingConfirmations = 1 + +[GasEstimator] +EIP1559DynamicFees = true +PriceMin = '1 wei' +BumpMin = '100 wei' + +[GasEstimator.BlockHistory] +BlockHistorySize = 24 + +[Transactions] +ResendAfterThreshold = '30s' + +[HeadTracker] +HistoryDepth = 400 + +[NodePool] +SyncThreshold = 10 + +[OCR] +ContractConfirmations = 1 diff --git a/ccip/config/evm/L3X_Mainnet.toml b/ccip/config/evm/L3X_Mainnet.toml new file mode 100644 index 00000000000..1fbda42fd2a --- /dev/null +++ b/ccip/config/evm/L3X_Mainnet.toml @@ -0,0 +1,18 @@ +ChainID = '12324' +ChainType = 'arbitrum' +FinalityTagEnabled = true +FinalityDepth = 10 +LinkContractAddress = '0x79f531a3D07214304F259DC28c7191513223bcf3' +# Produces blocks on-demand +NoNewHeadsThreshold = '0' +OCR.ContractConfirmations = 1 +LogPollInterval = '10s' + +[GasEstimator] +Mode = 'Arbitrum' +LimitMax = 1_000_000_000 +# Arbitrum-based chains uses the suggested gas price, so we don't want to place any limits on the minimum +PriceMin = '0' +PriceDefault = '0.1 gwei' +FeeCapDefault = '1000 gwei' +BumpThreshold = 5 diff --git a/ccip/config/evm/L3X_Sepolia.toml b/ccip/config/evm/L3X_Sepolia.toml new file mode 100644 index 00000000000..ee515bb72ba --- /dev/null +++ b/ccip/config/evm/L3X_Sepolia.toml @@ -0,0 +1,18 @@ +ChainID = '12325' +ChainType = 'arbitrum' +FinalityTagEnabled = true +FinalityDepth = 10 +LinkContractAddress = '0xa71848C99155DA0b245981E5ebD1C94C4be51c43' +# Produces blocks on-demand +NoNewHeadsThreshold = '0' +OCR.ContractConfirmations = 1 +LogPollInterval = '10s' + +[GasEstimator] +Mode = 'Arbitrum' +LimitMax = 1_000_000_000 +# Arbitrum-based chains uses the suggested gas price, so we don't want to place any limits on the minimum +PriceMin = '0' +PriceDefault = '0.1 gwei' +FeeCapDefault = '1000 gwei' +BumpThreshold = 5 diff --git a/ccip/config/evm/Linea_Mainnet.toml b/ccip/config/evm/Linea_Mainnet.toml new file mode 100644 index 00000000000..94d8bedc44b --- /dev/null +++ b/ccip/config/evm/Linea_Mainnet.toml @@ -0,0 +1,17 @@ +ChainID = '59144' +# Block time 12s, finality < 60m +FinalityDepth = 300 +# Blocks are only emitted when a transaction happens / no empty blocks +NoNewHeadsThreshold = '0' + +[GasEstimator] +BumpPercent = 40 +PriceMin = '400 mwei' + +[Transactions] +# increase resend time to align with finality +ResendAfterThreshold = '3m' + +# set greater than finality depth +[HeadTracker] +HistoryDepth = 350 diff --git a/ccip/config/evm/Linea_Sepolia.toml b/ccip/config/evm/Linea_Sepolia.toml new file mode 100644 index 00000000000..ac5e18a09b6 --- /dev/null +++ b/ccip/config/evm/Linea_Sepolia.toml @@ -0,0 +1,13 @@ +ChainID = '59141' +FinalityDepth = 900 +NoNewHeadsThreshold = '0' + +[GasEstimator] +EIP1559DynamicFees = true +PriceMin = '1 wei' + +[Transactions] +ResendAfterThreshold = '3m' + +[HeadTracker] +HistoryDepth = 1000 \ No newline at end of file diff --git a/ccip/config/evm/Mantle_Sepolia.toml b/ccip/config/evm/Mantle_Sepolia.toml new file mode 100644 index 00000000000..ee994a71826 --- /dev/null +++ b/ccip/config/evm/Mantle_Sepolia.toml @@ -0,0 +1,19 @@ +ChainID = '5003' +ChainType = 'optimismBedrock' +FinalityDepth = 500 +LogPollInterval = '2s' +NoNewHeadsThreshold = '0' +MinIncomingConfirmations = 1 + +[HeadTracker] +HistoryDepth = 600 + +[GasEstimator] +Mode = 'L2Suggested' +PriceMax = '200 gwei' +LimitDefault = 100000000 +FeeCapDefault = '200 gwei' + +[GasEstimator.BlockHistory] +BlockHistorySize = 200 +EIP1559FeeCapBufferBlocks = 0 \ No newline at end of file diff --git a/ccip/config/evm/Metis_Mainnet.toml b/ccip/config/evm/Metis_Mainnet.toml new file mode 100644 index 00000000000..f057400d014 --- /dev/null +++ b/ccip/config/evm/Metis_Mainnet.toml @@ -0,0 +1,21 @@ +# Metis is an L2 chain based on Optimism. +ChainID = '1088' +ChainType = 'metis' +# Sequencer offers absolute finality +FinalityDepth = 10 +FinalityTagEnabled = true +MinIncomingConfirmations = 1 +NoNewHeadsThreshold = '0' +OCR.ContractConfirmations = 1 + +[GasEstimator] +Mode = 'SuggestedPrice' +# Metis uses the SuggestedPrice estimator; we don't want to place any limits on the minimum gas price +PriceMin = '0' + +[GasEstimator.BlockHistory] +# Force an error if someone enables the estimator by accident; we never want to run the block history estimator on metisaa +BlockHistorySize = 0 + +[NodePool] +SyncThreshold = 10 diff --git a/ccip/config/evm/Metis_Sepolia.toml b/ccip/config/evm/Metis_Sepolia.toml new file mode 100644 index 00000000000..4ff4056c75d --- /dev/null +++ b/ccip/config/evm/Metis_Sepolia.toml @@ -0,0 +1,17 @@ +ChainID = '59902' +ChainType = 'optimismBedrock' +FinalityDepth = 10 +FinalityTagEnabled = true +MinIncomingConfirmations = 1 +NoNewHeadsThreshold = '0' +OCR.ContractConfirmations = 1 + +[GasEstimator] +Mode = 'SuggestedPrice' +PriceMin = '0' + +[GasEstimator.BlockHistory] +BlockHistorySize = 0 + +[NodePool] +SyncThreshold = 10 diff --git a/ccip/config/evm/Mode_Mainnet.toml b/ccip/config/evm/Mode_Mainnet.toml new file mode 100644 index 00000000000..69a8e93fecd --- /dev/null +++ b/ccip/config/evm/Mode_Mainnet.toml @@ -0,0 +1,30 @@ +ChainID = '34443' +FinalityDepth = 200 +FinalityTagEnabled = true +ChainType = 'optimismBedrock' + +[GasEstimator] +EIP1559DynamicFees = true +BumpThreshold = 60 +BumpPercent = 20 +BumpMin = '100 wei' +PriceMax = '120 gwei' +LimitDefault = 8000000 +FeeCapDefault = '120 gwei' + +[GasEstimator.BlockHistory] +# Default is 24, which leads to bumpy gas prices. In CCIP +# we want to smooth out the gas prices, so we increase the sample size. +BlockHistorySize = 200 +# The formula for FeeCap is (current block base fee * (1.125 ^ EIP1559FeeCapBufferBlocks) + tipcap) +# where tipcap is managed by the block history estimators. In the context of CCIP, +# the gas price is relayed to other changes for quotes so we want accurate/avg not pessimistic values. +# So we set this to zero so FeeCap = baseFee + tipcap. +EIP1559FeeCapBufferBlocks = 0 + +[HeadTracker] +HistoryDepth = 300 + +[NodePool] +PollFailureThreshold = 2 +PollInterval = '3s' diff --git a/ccip/config/evm/Mode_Sepolia.toml b/ccip/config/evm/Mode_Sepolia.toml new file mode 100644 index 00000000000..f7398869beb --- /dev/null +++ b/ccip/config/evm/Mode_Sepolia.toml @@ -0,0 +1,30 @@ +ChainID = '919' +FinalityDepth = 200 +FinalityTagEnabled = true +ChainType = 'optimismBedrock' + +[GasEstimator] +EIP1559DynamicFees = true +BumpThreshold = 60 +BumpPercent = 20 +BumpMin = '100 wei' +PriceMax = '120 gwei' +LimitDefault = 8000000 +FeeCapDefault = '120 gwei' + +[GasEstimator.BlockHistory] +# Default is 24, which leads to bumpy gas prices. In CCIP +# we want to smooth out the gas prices, so we increase the sample size. +BlockHistorySize = 200 +# The formula for FeeCap is (current block base fee * (1.125 ^ EIP1559FeeCapBufferBlocks) + tipcap) +# where tipcap is managed by the block history estimators. In the context of CCIP, +# the gas price is relayed to other changes for quotes so we want accurate/avg not pessimistic values. +# So we set this to zero so FeeCap = baseFee + tipcap. +EIP1559FeeCapBufferBlocks = 0 + +[HeadTracker] +HistoryDepth = 300 + +[NodePool] +PollFailureThreshold = 2 +PollInterval = '3s' diff --git a/ccip/config/evm/OKX_Mainnet.toml b/ccip/config/evm/OKX_Mainnet.toml new file mode 100644 index 00000000000..d0b26ede2e3 --- /dev/null +++ b/ccip/config/evm/OKX_Mainnet.toml @@ -0,0 +1 @@ +ChainID = '66' diff --git a/ccip/config/evm/OKX_Testnet.toml b/ccip/config/evm/OKX_Testnet.toml new file mode 100644 index 00000000000..2587f010b18 --- /dev/null +++ b/ccip/config/evm/OKX_Testnet.toml @@ -0,0 +1 @@ +ChainID = '65' diff --git a/ccip/config/evm/Optimism_Mainnet.toml b/ccip/config/evm/Optimism_Mainnet.toml new file mode 100644 index 00000000000..b0f56a49d90 --- /dev/null +++ b/ccip/config/evm/Optimism_Mainnet.toml @@ -0,0 +1,32 @@ +ChainID = '10' +ChainType = 'optimismBedrock' +FinalityDepth = 200 +FinalityTagEnabled = true +LinkContractAddress = '0x350a791Bfc2C21F9Ed5d10980Dad2e2638ffa7f6' +LogPollInterval = '2s' +NoNewHeadsThreshold = '40s' +MinIncomingConfirmations = 1 +NoNewFinalizedHeadsThreshold = '13m' + +[GasEstimator] +EIP1559DynamicFees = true +PriceMin = '1 wei' +BumpMin = '100 wei' + +[GasEstimator.BlockHistory] +BlockHistorySize = 24 + +[Transactions] +ResendAfterThreshold = '30s' + +[HeadTracker] +HistoryDepth = 300 + +[NodePool] +SyncThreshold = 10 + +[OCR] +ContractConfirmations = 1 + +[OCR2.Automation] +GasLimit = 6500000 diff --git a/ccip/config/evm/Optimism_Sepolia.toml b/ccip/config/evm/Optimism_Sepolia.toml new file mode 100644 index 00000000000..1c71aa5dd83 --- /dev/null +++ b/ccip/config/evm/Optimism_Sepolia.toml @@ -0,0 +1,31 @@ +ChainID = '11155420' +ChainType = 'optimismBedrock' +FinalityDepth = 200 +FinalityTagEnabled = true +LogPollInterval = '2s' +NoNewHeadsThreshold = '40s' +MinIncomingConfirmations = 1 +NoNewFinalizedHeadsThreshold = '15m' + +[GasEstimator] +EIP1559DynamicFees = true +PriceMin = '1 wei' +BumpMin = '100 wei' + +[GasEstimator.BlockHistory] +BlockHistorySize = 60 + +[Transactions] +ResendAfterThreshold = '30s' + +[HeadTracker] +HistoryDepth = 300 + +[NodePool] +SyncThreshold = 10 + +[OCR] +ContractConfirmations = 1 + +[OCR2.Automation] +GasLimit = 6500000 diff --git a/ccip/config/evm/Polygon_Amoy.toml b/ccip/config/evm/Polygon_Amoy.toml new file mode 100644 index 00000000000..b05b3053a8e --- /dev/null +++ b/ccip/config/evm/Polygon_Amoy.toml @@ -0,0 +1,28 @@ +ChainID = '80002' +FinalityDepth = 500 +LogPollInterval = '1s' +MinIncomingConfirmations = 5 +NoNewHeadsThreshold = '30s' +RPCBlockQueryDelay = 10 +RPCDefaultBatchSize = 100 +NoNewFinalizedHeadsThreshold = '12m' + +[Transactions] +MaxQueued = 5000 + +[GasEstimator] +EIP1559DynamicFees = true +PriceMax = '115792089237316195423570985008687907853269984665.640564039457584007913129639935 tether' +PriceDefault = '25 gwei' +PriceMin = '25 gwei' +BumpMin = '20 gwei' +BumpThreshold = 5 + +[GasEstimator.BlockHistory] +BlockHistorySize = 24 + +[HeadTracker] +HistoryDepth = 2000 + +[NodePool] +SyncThreshold = 10 diff --git a/ccip/config/evm/Polygon_Mainnet.toml b/ccip/config/evm/Polygon_Mainnet.toml new file mode 100644 index 00000000000..bf605cab3c6 --- /dev/null +++ b/ccip/config/evm/Polygon_Mainnet.toml @@ -0,0 +1,38 @@ +# Polygon has a 1s block time and looser finality guarantees than ethereum. +ChainID = '137' +# It is quite common to see re-orgs on polygon go several hundred blocks deep. See: https://polygonscan.com/blocks_forked +FinalityDepth = 500 +FinalityTagEnabled = true +LinkContractAddress = '0xb0897686c545045aFc77CF20eC7A532E3120E0F1' +LogPollInterval = '1s' +MinIncomingConfirmations = 5 +NoNewHeadsThreshold = '30s' +# Must be set to something large here because Polygon has so many re-orgs that otherwise we are constantly refetching +RPCBlockQueryDelay = 10 +RPCDefaultBatchSize = 100 +NoNewFinalizedHeadsThreshold = '6m' + +[Transactions] +# Matic nodes under high mempool pressure are liable to drop txes, we need to ensure we keep sending them +# Since re-orgs on Polygon can be so large, we need a large safety buffer to allow time for the queue to clear down before we start dropping transactions +MaxQueued = 5000 + +[GasEstimator] +# Many Polygon RPC providers set a minimum of 30 GWei on mainnet to prevent spam +PriceDefault = '30 gwei' +PriceMax = '115792089237316195423570985008687907853269984665.640564039457584007913129639935 tether' +# Many Polygon RPC providers set a minimum of 30 GWei on mainnet to prevent spam +PriceMin = '30 gwei' +BumpMin = '20 gwei' +# 10s delay since feeds update every minute in volatile situations +BumpThreshold = 5 + +[GasEstimator.BlockHistory] +BlockHistorySize = 24 + +[HeadTracker] +# Polygon suffers from a tremendous number of re-orgs, we need to set this to something very large to be conservative enough +HistoryDepth = 2000 + +[NodePool] +SyncThreshold = 10 diff --git a/ccip/config/evm/Polygon_Zkevm_Cardona.toml b/ccip/config/evm/Polygon_Zkevm_Cardona.toml new file mode 100644 index 00000000000..cd91465dae6 --- /dev/null +++ b/ccip/config/evm/Polygon_Zkevm_Cardona.toml @@ -0,0 +1,24 @@ +ChainID = '2442' +ChainType = 'zkevm' +FinalityDepth = 500 +NoNewHeadsThreshold = '12m' +MinIncomingConfirmations = 1 +LogPollInterval = '30s' +RPCDefaultBatchSize = 100 + +[OCR] +ContractConfirmations = 1 + +[Transactions] +ResendAfterThreshold = '3m' + +[GasEstimator] +PriceMin = '1 mwei' +BumpPercent = 40 +BumpMin = '20 mwei' + +[GasEstimator.BlockHistory] +BlockHistorySize = 12 + +[HeadTracker] +HistoryDepth = 2000 diff --git a/ccip/config/evm/Polygon_Zkevm_Mainnet.toml b/ccip/config/evm/Polygon_Zkevm_Mainnet.toml new file mode 100644 index 00000000000..79e0cb0fce5 --- /dev/null +++ b/ccip/config/evm/Polygon_Zkevm_Mainnet.toml @@ -0,0 +1,26 @@ +ChainID = '1101' +ChainType = 'zkevm' +FinalityDepth = 500 +NoNewHeadsThreshold = '6m' +MinIncomingConfirmations = 1 +LogPollInterval = '30s' +RPCBlockQueryDelay = 15 +RPCDefaultBatchSize = 100 + +[OCR] +ContractConfirmations = 1 + +[Transactions] +ResendAfterThreshold = '3m' + +[GasEstimator] +PriceMin = '100 mwei' +BumpPercent = 40 +BumpMin = '100 mwei' + +[GasEstimator.BlockHistory] +BlockHistorySize = 12 + +[HeadTracker] +# Polygon suffers from a tremendous number of re-orgs, we need to set this to something very large to be conservative enough +HistoryDepth = 2000 diff --git a/ccip/config/evm/Scroll_Mainnet.toml b/ccip/config/evm/Scroll_Mainnet.toml new file mode 100644 index 00000000000..4a887b504df --- /dev/null +++ b/ccip/config/evm/Scroll_Mainnet.toml @@ -0,0 +1,22 @@ +ChainID = '534352' +FinalityDepth = 10 +FinalityTagEnabled = true +ChainType = 'scroll' +LogPollInterval = '5s' +MinIncomingConfirmations = 1 +# Scroll only emits blocks when a new tx is received, so this method of liveness detection is not useful +NoNewHeadsThreshold = '0' + +[GasEstimator] +EIP1559DynamicFees = true +PriceMin = '1 wei' +BumpMin = '1 gwei' + +[GasEstimator.BlockHistory] +BlockHistorySize = 24 + +[HeadTracker] +HistoryDepth = 50 + +[OCR] +ContractConfirmations = 1 diff --git a/ccip/config/evm/Scroll_Sepolia.toml b/ccip/config/evm/Scroll_Sepolia.toml new file mode 100644 index 00000000000..b2e1cfbd733 --- /dev/null +++ b/ccip/config/evm/Scroll_Sepolia.toml @@ -0,0 +1,22 @@ +ChainID = '534351' +FinalityDepth = 10 +FinalityTagEnabled = true +ChainType = 'scroll' +LogPollInterval = '5s' +MinIncomingConfirmations = 1 +# Scroll only emits blocks when a new tx is received, so this method of liveness detection is not useful +NoNewHeadsThreshold = '0' + +[GasEstimator] +EIP1559DynamicFees = true +PriceMin = '1 wei' +BumpMin = '1 gwei' + +[GasEstimator.BlockHistory] +BlockHistorySize = 24 + +[HeadTracker] +HistoryDepth = 50 + +[OCR] +ContractConfirmations = 1 diff --git a/ccip/config/evm/Simulated.toml b/ccip/config/evm/Simulated.toml new file mode 100644 index 00000000000..b3392a93363 --- /dev/null +++ b/ccip/config/evm/Simulated.toml @@ -0,0 +1,25 @@ +ChainID = '1337' +FinalityDepth = 10 +MinIncomingConfirmations = 1 +MinContractPayment = '100' +NoNewHeadsThreshold = '0s' + +[Transactions] +ReaperThreshold = '0s' +ResendAfterThreshold = '0s' + +[GasEstimator] +Mode = 'FixedPrice' +PriceMin = '0' +BumpThreshold = 0 +FeeCapDefault = '100 micro' +PriceMax = '100 micro' + +[HeadTracker] +HistoryDepth = 10 +MaxBufferSize = 100 +SamplingInterval = '0s' +PersistenceEnabled = false + +[OCR] +ContractConfirmations = 1 diff --git a/ccip/config/evm/WeMix_Mainnet.toml b/ccip/config/evm/WeMix_Mainnet.toml new file mode 100644 index 00000000000..be7c278f692 --- /dev/null +++ b/ccip/config/evm/WeMix_Mainnet.toml @@ -0,0 +1,19 @@ +ChainID = '1111' +ChainType = 'wemix' +FinalityDepth = 1 +FinalityTagEnabled = true +MinIncomingConfirmations = 1 +# WeMix emits a block every 1 second, regardless of transactions +LogPollInterval = '3s' +NoNewHeadsThreshold = '30s' +NoNewFinalizedHeadsThreshold = '40s' + +[OCR] +ContractConfirmations = 1 + +[GasEstimator] +EIP1559DynamicFees = true +TipCapDefault = '100 gwei' + +[HeadTracker] +PersistenceEnabled = false diff --git a/ccip/config/evm/WeMix_Testnet.toml b/ccip/config/evm/WeMix_Testnet.toml new file mode 100644 index 00000000000..4591fc4c572 --- /dev/null +++ b/ccip/config/evm/WeMix_Testnet.toml @@ -0,0 +1,20 @@ +ChainID = '1112' +ChainType = 'wemix' +FinalityDepth = 1 +FinalityTagEnabled = true +MinIncomingConfirmations = 1 +# WeMix emits a block every 1 second, regardless of transactions +LogPollInterval = '3s' +NoNewHeadsThreshold = '30s' +NoNewFinalizedHeadsThreshold = '40s' + +[OCR] +ContractConfirmations = 1 + +[GasEstimator] +EIP1559DynamicFees = true +TipCapDefault = '100 gwei' + +[HeadTracker] +FinalityTagBypass = false +PersistenceEnabled = false diff --git a/ccip/config/evm/XLayer_Mainnet.toml b/ccip/config/evm/XLayer_Mainnet.toml new file mode 100644 index 00000000000..4096a4db244 --- /dev/null +++ b/ccip/config/evm/XLayer_Mainnet.toml @@ -0,0 +1,25 @@ +ChainID = '196' +ChainType = 'xlayer' +FinalityDepth = 500 +NoNewHeadsThreshold = '6m' +MinIncomingConfirmations = 1 +LogPollInterval = '30s' +RPCBlockQueryDelay = 15 +RPCDefaultBatchSize = 100 + +[OCR] +ContractConfirmations = 1 + +[Transactions] +ResendAfterThreshold = '3m' + +[GasEstimator] +PriceMin = '100 mwei' +BumpPercent = 40 +BumpMin = '100 mwei' + +[GasEstimator.BlockHistory] +BlockHistorySize = 12 + +[HeadTracker] +HistoryDepth = 2000 diff --git a/ccip/config/evm/XLayer_Sepolia.toml b/ccip/config/evm/XLayer_Sepolia.toml new file mode 100644 index 00000000000..62e2c1e8ad0 --- /dev/null +++ b/ccip/config/evm/XLayer_Sepolia.toml @@ -0,0 +1,25 @@ +ChainID = '195' +ChainType = 'xlayer' +FinalityDepth = 500 +NoNewHeadsThreshold = '12m' +MinIncomingConfirmations = 1 +LogPollInterval = '30s' +RPCBlockQueryDelay = 15 +RPCDefaultBatchSize = 100 + +[OCR] +ContractConfirmations = 1 + +[Transactions] +ResendAfterThreshold = '3m' + +[GasEstimator] +PriceMin = '1 mwei' +BumpPercent = 40 +BumpMin = '20 mwei' + +[GasEstimator.BlockHistory] +BlockHistorySize = 12 + +[HeadTracker] +HistoryDepth = 2000 diff --git a/ccip/config/evm/zkSync_Mainnet.toml b/ccip/config/evm/zkSync_Mainnet.toml new file mode 100644 index 00000000000..a434cd38153 --- /dev/null +++ b/ccip/config/evm/zkSync_Mainnet.toml @@ -0,0 +1,28 @@ +ChainID = '324' +ChainType = 'zksync' +# 1200block ~ 20min concurrent with the l1_committed tag +FinalityDepth = 1200 +# block rate is ~2-5sec, so this ensures blocks are polled correctly +LogPollInterval = '5s' +# sufficient time for RPC to be labelled out of sync, since blockRate is pretty fast +NoNewHeadsThreshold = '1m' + +[GasEstimator] +# no EIP1559 to ensure our estimator doesnot estimate gas with MaxPriorityFee which will break minFunding requirement +EIP1559DynamicFees = false +# high LimitDefault for worst case pubdata bytes with BatchGasLimit reduced to 4M in OCR2Config +LimitDefault = 2_500_000_000 +FeeCapDefault = '500 mwei' +PriceDefault = '25 mwei' +# p999 value for gasPrice based on historical data +PriceMax = '500 mwei' +# avg gasPrices are at 0.025 gwei +PriceMin = '25 mwei' + +[GasEstimator.BlockHistory] +# increasing this to smooth out gas estimation +BlockHistorySize = 200 + +[HeadTracker] +# tracks top N blocks to keep in heads database table. Should store atleast the same # of blocks as finalityDepth +HistoryDepth = 1500 \ No newline at end of file diff --git a/ccip/config/evm/zkSync_Sepolia.toml b/ccip/config/evm/zkSync_Sepolia.toml new file mode 100644 index 00000000000..f3bc594886a --- /dev/null +++ b/ccip/config/evm/zkSync_Sepolia.toml @@ -0,0 +1,28 @@ +ChainID = '300' +ChainType = 'zksync' +# 200block ~ 20min concurrent with the l1_committed tag +FinalityDepth = 200 +# block rate is ~2-5sec, so this ensures blocks are polled correctly +LogPollInterval = '5s' +# sufficient time for RPC to be labelled out of sync, since blockRate is pretty fast +NoNewHeadsThreshold = '1m' + +[GasEstimator] +# no EIP1559 to ensure our estimator doesnot estimate gas with MaxPriorityFee which will break minFunding requirement +EIP1559DynamicFees = false +# high LimitDefault for worst case pubdata bytes with BatchGasLimit reduced to 4M in OCR2Config +LimitDefault = 2_500_000_000 +FeeCapDefault = '500 mwei' +PriceDefault = '25 mwei' +# p999 value for gasPrice based on historical data +PriceMax = '500 mwei' +# avg gasPrices are at 0.025 gwei +PriceMin = '25 mwei' + +[GasEstimator.BlockHistory] +# increasing this to smooth out gas estimation +BlockHistorySize = 200 + +[HeadTracker] +# tracks top N blocks to keep in heads database table. Should store atleast the same # of blocks as finalityDepth +HistoryDepth = 250 \ No newline at end of file diff --git a/common/client/mock_head_test.go b/common/client/mock_head_test.go index 64c6dbcb0a8..cd3fda8b8e0 100644 --- a/common/client/mock_head_test.go +++ b/common/client/mock_head_test.go @@ -13,6 +13,14 @@ type mockHead struct { mock.Mock } +type mockHead_Expecter struct { + mock *mock.Mock +} + +func (_m *mockHead) EXPECT() *mockHead_Expecter { + return &mockHead_Expecter{mock: &_m.Mock} +} + // BlockDifficulty provides a mock function with given fields: func (_m *mockHead) BlockDifficulty() *big.Int { ret := _m.Called() @@ -33,6 +41,33 @@ func (_m *mockHead) BlockDifficulty() *big.Int { return r0 } +// mockHead_BlockDifficulty_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BlockDifficulty' +type mockHead_BlockDifficulty_Call struct { + *mock.Call +} + +// BlockDifficulty is a helper method to define mock.On call +func (_e *mockHead_Expecter) BlockDifficulty() *mockHead_BlockDifficulty_Call { + return &mockHead_BlockDifficulty_Call{Call: _e.mock.On("BlockDifficulty")} +} + +func (_c *mockHead_BlockDifficulty_Call) Run(run func()) *mockHead_BlockDifficulty_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *mockHead_BlockDifficulty_Call) Return(_a0 *big.Int) *mockHead_BlockDifficulty_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *mockHead_BlockDifficulty_Call) RunAndReturn(run func() *big.Int) *mockHead_BlockDifficulty_Call { + _c.Call.Return(run) + return _c +} + // BlockNumber provides a mock function with given fields: func (_m *mockHead) BlockNumber() int64 { ret := _m.Called() @@ -51,6 +86,33 @@ func (_m *mockHead) BlockNumber() int64 { return r0 } +// mockHead_BlockNumber_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BlockNumber' +type mockHead_BlockNumber_Call struct { + *mock.Call +} + +// BlockNumber is a helper method to define mock.On call +func (_e *mockHead_Expecter) BlockNumber() *mockHead_BlockNumber_Call { + return &mockHead_BlockNumber_Call{Call: _e.mock.On("BlockNumber")} +} + +func (_c *mockHead_BlockNumber_Call) Run(run func()) *mockHead_BlockNumber_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *mockHead_BlockNumber_Call) Return(_a0 int64) *mockHead_BlockNumber_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *mockHead_BlockNumber_Call) RunAndReturn(run func() int64) *mockHead_BlockNumber_Call { + _c.Call.Return(run) + return _c +} + // IsValid provides a mock function with given fields: func (_m *mockHead) IsValid() bool { ret := _m.Called() @@ -69,6 +131,33 @@ func (_m *mockHead) IsValid() bool { return r0 } +// mockHead_IsValid_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsValid' +type mockHead_IsValid_Call struct { + *mock.Call +} + +// IsValid is a helper method to define mock.On call +func (_e *mockHead_Expecter) IsValid() *mockHead_IsValid_Call { + return &mockHead_IsValid_Call{Call: _e.mock.On("IsValid")} +} + +func (_c *mockHead_IsValid_Call) Run(run func()) *mockHead_IsValid_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *mockHead_IsValid_Call) Return(_a0 bool) *mockHead_IsValid_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *mockHead_IsValid_Call) RunAndReturn(run func() bool) *mockHead_IsValid_Call { + _c.Call.Return(run) + return _c +} + // newMockHead creates a new instance of mockHead. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func newMockHead(t interface { diff --git a/common/client/mock_node_client_test.go b/common/client/mock_node_client_test.go index a7c0e4dbdb8..5643dcde90e 100644 --- a/common/client/mock_node_client_test.go +++ b/common/client/mock_node_client_test.go @@ -14,6 +14,14 @@ type mockNodeClient[CHAIN_ID types.ID, HEAD Head] struct { mock.Mock } +type mockNodeClient_Expecter[CHAIN_ID types.ID, HEAD Head] struct { + mock *mock.Mock +} + +func (_m *mockNodeClient[CHAIN_ID, HEAD]) EXPECT() *mockNodeClient_Expecter[CHAIN_ID, HEAD] { + return &mockNodeClient_Expecter[CHAIN_ID, HEAD]{mock: &_m.Mock} +} + // ChainID provides a mock function with given fields: ctx func (_m *mockNodeClient[CHAIN_ID, HEAD]) ChainID(ctx context.Context) (CHAIN_ID, error) { ret := _m.Called(ctx) @@ -42,6 +50,34 @@ func (_m *mockNodeClient[CHAIN_ID, HEAD]) ChainID(ctx context.Context) (CHAIN_ID return r0, r1 } +// mockNodeClient_ChainID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ChainID' +type mockNodeClient_ChainID_Call[CHAIN_ID types.ID, HEAD Head] struct { + *mock.Call +} + +// ChainID is a helper method to define mock.On call +// - ctx context.Context +func (_e *mockNodeClient_Expecter[CHAIN_ID, HEAD]) ChainID(ctx interface{}) *mockNodeClient_ChainID_Call[CHAIN_ID, HEAD] { + return &mockNodeClient_ChainID_Call[CHAIN_ID, HEAD]{Call: _e.mock.On("ChainID", ctx)} +} + +func (_c *mockNodeClient_ChainID_Call[CHAIN_ID, HEAD]) Run(run func(ctx context.Context)) *mockNodeClient_ChainID_Call[CHAIN_ID, HEAD] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *mockNodeClient_ChainID_Call[CHAIN_ID, HEAD]) Return(_a0 CHAIN_ID, _a1 error) *mockNodeClient_ChainID_Call[CHAIN_ID, HEAD] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *mockNodeClient_ChainID_Call[CHAIN_ID, HEAD]) RunAndReturn(run func(context.Context) (CHAIN_ID, error)) *mockNodeClient_ChainID_Call[CHAIN_ID, HEAD] { + _c.Call.Return(run) + return _c +} + // ClientVersion provides a mock function with given fields: _a0 func (_m *mockNodeClient[CHAIN_ID, HEAD]) ClientVersion(_a0 context.Context) (string, error) { ret := _m.Called(_a0) @@ -70,11 +106,66 @@ func (_m *mockNodeClient[CHAIN_ID, HEAD]) ClientVersion(_a0 context.Context) (st return r0, r1 } +// mockNodeClient_ClientVersion_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ClientVersion' +type mockNodeClient_ClientVersion_Call[CHAIN_ID types.ID, HEAD Head] struct { + *mock.Call +} + +// ClientVersion is a helper method to define mock.On call +// - _a0 context.Context +func (_e *mockNodeClient_Expecter[CHAIN_ID, HEAD]) ClientVersion(_a0 interface{}) *mockNodeClient_ClientVersion_Call[CHAIN_ID, HEAD] { + return &mockNodeClient_ClientVersion_Call[CHAIN_ID, HEAD]{Call: _e.mock.On("ClientVersion", _a0)} +} + +func (_c *mockNodeClient_ClientVersion_Call[CHAIN_ID, HEAD]) Run(run func(_a0 context.Context)) *mockNodeClient_ClientVersion_Call[CHAIN_ID, HEAD] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *mockNodeClient_ClientVersion_Call[CHAIN_ID, HEAD]) Return(_a0 string, _a1 error) *mockNodeClient_ClientVersion_Call[CHAIN_ID, HEAD] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *mockNodeClient_ClientVersion_Call[CHAIN_ID, HEAD]) RunAndReturn(run func(context.Context) (string, error)) *mockNodeClient_ClientVersion_Call[CHAIN_ID, HEAD] { + _c.Call.Return(run) + return _c +} + // Close provides a mock function with given fields: func (_m *mockNodeClient[CHAIN_ID, HEAD]) Close() { _m.Called() } +// mockNodeClient_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close' +type mockNodeClient_Close_Call[CHAIN_ID types.ID, HEAD Head] struct { + *mock.Call +} + +// Close is a helper method to define mock.On call +func (_e *mockNodeClient_Expecter[CHAIN_ID, HEAD]) Close() *mockNodeClient_Close_Call[CHAIN_ID, HEAD] { + return &mockNodeClient_Close_Call[CHAIN_ID, HEAD]{Call: _e.mock.On("Close")} +} + +func (_c *mockNodeClient_Close_Call[CHAIN_ID, HEAD]) Run(run func()) *mockNodeClient_Close_Call[CHAIN_ID, HEAD] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *mockNodeClient_Close_Call[CHAIN_ID, HEAD]) Return() *mockNodeClient_Close_Call[CHAIN_ID, HEAD] { + _c.Call.Return() + return _c +} + +func (_c *mockNodeClient_Close_Call[CHAIN_ID, HEAD]) RunAndReturn(run func()) *mockNodeClient_Close_Call[CHAIN_ID, HEAD] { + _c.Call.Return(run) + return _c +} + // Dial provides a mock function with given fields: ctx func (_m *mockNodeClient[CHAIN_ID, HEAD]) Dial(ctx context.Context) error { ret := _m.Called(ctx) @@ -93,6 +184,34 @@ func (_m *mockNodeClient[CHAIN_ID, HEAD]) Dial(ctx context.Context) error { return r0 } +// mockNodeClient_Dial_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Dial' +type mockNodeClient_Dial_Call[CHAIN_ID types.ID, HEAD Head] struct { + *mock.Call +} + +// Dial is a helper method to define mock.On call +// - ctx context.Context +func (_e *mockNodeClient_Expecter[CHAIN_ID, HEAD]) Dial(ctx interface{}) *mockNodeClient_Dial_Call[CHAIN_ID, HEAD] { + return &mockNodeClient_Dial_Call[CHAIN_ID, HEAD]{Call: _e.mock.On("Dial", ctx)} +} + +func (_c *mockNodeClient_Dial_Call[CHAIN_ID, HEAD]) Run(run func(ctx context.Context)) *mockNodeClient_Dial_Call[CHAIN_ID, HEAD] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *mockNodeClient_Dial_Call[CHAIN_ID, HEAD]) Return(_a0 error) *mockNodeClient_Dial_Call[CHAIN_ID, HEAD] { + _c.Call.Return(_a0) + return _c +} + +func (_c *mockNodeClient_Dial_Call[CHAIN_ID, HEAD]) RunAndReturn(run func(context.Context) error) *mockNodeClient_Dial_Call[CHAIN_ID, HEAD] { + _c.Call.Return(run) + return _c +} + // DialHTTP provides a mock function with given fields: func (_m *mockNodeClient[CHAIN_ID, HEAD]) DialHTTP() error { ret := _m.Called() @@ -111,11 +230,65 @@ func (_m *mockNodeClient[CHAIN_ID, HEAD]) DialHTTP() error { return r0 } +// mockNodeClient_DialHTTP_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DialHTTP' +type mockNodeClient_DialHTTP_Call[CHAIN_ID types.ID, HEAD Head] struct { + *mock.Call +} + +// DialHTTP is a helper method to define mock.On call +func (_e *mockNodeClient_Expecter[CHAIN_ID, HEAD]) DialHTTP() *mockNodeClient_DialHTTP_Call[CHAIN_ID, HEAD] { + return &mockNodeClient_DialHTTP_Call[CHAIN_ID, HEAD]{Call: _e.mock.On("DialHTTP")} +} + +func (_c *mockNodeClient_DialHTTP_Call[CHAIN_ID, HEAD]) Run(run func()) *mockNodeClient_DialHTTP_Call[CHAIN_ID, HEAD] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *mockNodeClient_DialHTTP_Call[CHAIN_ID, HEAD]) Return(_a0 error) *mockNodeClient_DialHTTP_Call[CHAIN_ID, HEAD] { + _c.Call.Return(_a0) + return _c +} + +func (_c *mockNodeClient_DialHTTP_Call[CHAIN_ID, HEAD]) RunAndReturn(run func() error) *mockNodeClient_DialHTTP_Call[CHAIN_ID, HEAD] { + _c.Call.Return(run) + return _c +} + // DisconnectAll provides a mock function with given fields: func (_m *mockNodeClient[CHAIN_ID, HEAD]) DisconnectAll() { _m.Called() } +// mockNodeClient_DisconnectAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DisconnectAll' +type mockNodeClient_DisconnectAll_Call[CHAIN_ID types.ID, HEAD Head] struct { + *mock.Call +} + +// DisconnectAll is a helper method to define mock.On call +func (_e *mockNodeClient_Expecter[CHAIN_ID, HEAD]) DisconnectAll() *mockNodeClient_DisconnectAll_Call[CHAIN_ID, HEAD] { + return &mockNodeClient_DisconnectAll_Call[CHAIN_ID, HEAD]{Call: _e.mock.On("DisconnectAll")} +} + +func (_c *mockNodeClient_DisconnectAll_Call[CHAIN_ID, HEAD]) Run(run func()) *mockNodeClient_DisconnectAll_Call[CHAIN_ID, HEAD] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *mockNodeClient_DisconnectAll_Call[CHAIN_ID, HEAD]) Return() *mockNodeClient_DisconnectAll_Call[CHAIN_ID, HEAD] { + _c.Call.Return() + return _c +} + +func (_c *mockNodeClient_DisconnectAll_Call[CHAIN_ID, HEAD]) RunAndReturn(run func()) *mockNodeClient_DisconnectAll_Call[CHAIN_ID, HEAD] { + _c.Call.Return(run) + return _c +} + // GetInterceptedChainInfo provides a mock function with given fields: func (_m *mockNodeClient[CHAIN_ID, HEAD]) GetInterceptedChainInfo() (ChainInfo, ChainInfo) { ret := _m.Called() @@ -144,6 +317,33 @@ func (_m *mockNodeClient[CHAIN_ID, HEAD]) GetInterceptedChainInfo() (ChainInfo, return r0, r1 } +// mockNodeClient_GetInterceptedChainInfo_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetInterceptedChainInfo' +type mockNodeClient_GetInterceptedChainInfo_Call[CHAIN_ID types.ID, HEAD Head] struct { + *mock.Call +} + +// GetInterceptedChainInfo is a helper method to define mock.On call +func (_e *mockNodeClient_Expecter[CHAIN_ID, HEAD]) GetInterceptedChainInfo() *mockNodeClient_GetInterceptedChainInfo_Call[CHAIN_ID, HEAD] { + return &mockNodeClient_GetInterceptedChainInfo_Call[CHAIN_ID, HEAD]{Call: _e.mock.On("GetInterceptedChainInfo")} +} + +func (_c *mockNodeClient_GetInterceptedChainInfo_Call[CHAIN_ID, HEAD]) Run(run func()) *mockNodeClient_GetInterceptedChainInfo_Call[CHAIN_ID, HEAD] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *mockNodeClient_GetInterceptedChainInfo_Call[CHAIN_ID, HEAD]) Return(latest ChainInfo, highestUserObservations ChainInfo) *mockNodeClient_GetInterceptedChainInfo_Call[CHAIN_ID, HEAD] { + _c.Call.Return(latest, highestUserObservations) + return _c +} + +func (_c *mockNodeClient_GetInterceptedChainInfo_Call[CHAIN_ID, HEAD]) RunAndReturn(run func() (ChainInfo, ChainInfo)) *mockNodeClient_GetInterceptedChainInfo_Call[CHAIN_ID, HEAD] { + _c.Call.Return(run) + return _c +} + // IsSyncing provides a mock function with given fields: ctx func (_m *mockNodeClient[CHAIN_ID, HEAD]) IsSyncing(ctx context.Context) (bool, error) { ret := _m.Called(ctx) @@ -172,32 +372,32 @@ func (_m *mockNodeClient[CHAIN_ID, HEAD]) IsSyncing(ctx context.Context) (bool, return r0, r1 } -// LatestFinalizedBlock provides a mock function with given fields: ctx -func (_m *mockNodeClient[CHAIN_ID, HEAD]) LatestFinalizedBlock(ctx context.Context) (HEAD, error) { - ret := _m.Called(ctx) +// mockNodeClient_IsSyncing_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsSyncing' +type mockNodeClient_IsSyncing_Call[CHAIN_ID types.ID, HEAD Head] struct { + *mock.Call +} - if len(ret) == 0 { - panic("no return value specified for LatestFinalizedBlock") - } +// IsSyncing is a helper method to define mock.On call +// - ctx context.Context +func (_e *mockNodeClient_Expecter[CHAIN_ID, HEAD]) IsSyncing(ctx interface{}) *mockNodeClient_IsSyncing_Call[CHAIN_ID, HEAD] { + return &mockNodeClient_IsSyncing_Call[CHAIN_ID, HEAD]{Call: _e.mock.On("IsSyncing", ctx)} +} - var r0 HEAD - var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (HEAD, error)); ok { - return rf(ctx) - } - if rf, ok := ret.Get(0).(func(context.Context) HEAD); ok { - r0 = rf(ctx) - } else { - r0 = ret.Get(0).(HEAD) - } +func (_c *mockNodeClient_IsSyncing_Call[CHAIN_ID, HEAD]) Run(run func(ctx context.Context)) *mockNodeClient_IsSyncing_Call[CHAIN_ID, HEAD] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} - if rf, ok := ret.Get(1).(func(context.Context) error); ok { - r1 = rf(ctx) - } else { - r1 = ret.Error(1) - } +func (_c *mockNodeClient_IsSyncing_Call[CHAIN_ID, HEAD]) Return(_a0 bool, _a1 error) *mockNodeClient_IsSyncing_Call[CHAIN_ID, HEAD] { + _c.Call.Return(_a0, _a1) + return _c +} - return r0, r1 +func (_c *mockNodeClient_IsSyncing_Call[CHAIN_ID, HEAD]) RunAndReturn(run func(context.Context) (bool, error)) *mockNodeClient_IsSyncing_Call[CHAIN_ID, HEAD] { + _c.Call.Return(run) + return _c } // SetAliveLoopSub provides a mock function with given fields: _a0 @@ -205,6 +405,34 @@ func (_m *mockNodeClient[CHAIN_ID, HEAD]) SetAliveLoopSub(_a0 types.Subscription _m.Called(_a0) } +// mockNodeClient_SetAliveLoopSub_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetAliveLoopSub' +type mockNodeClient_SetAliveLoopSub_Call[CHAIN_ID types.ID, HEAD Head] struct { + *mock.Call +} + +// SetAliveLoopSub is a helper method to define mock.On call +// - _a0 types.Subscription +func (_e *mockNodeClient_Expecter[CHAIN_ID, HEAD]) SetAliveLoopSub(_a0 interface{}) *mockNodeClient_SetAliveLoopSub_Call[CHAIN_ID, HEAD] { + return &mockNodeClient_SetAliveLoopSub_Call[CHAIN_ID, HEAD]{Call: _e.mock.On("SetAliveLoopSub", _a0)} +} + +func (_c *mockNodeClient_SetAliveLoopSub_Call[CHAIN_ID, HEAD]) Run(run func(_a0 types.Subscription)) *mockNodeClient_SetAliveLoopSub_Call[CHAIN_ID, HEAD] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Subscription)) + }) + return _c +} + +func (_c *mockNodeClient_SetAliveLoopSub_Call[CHAIN_ID, HEAD]) Return() *mockNodeClient_SetAliveLoopSub_Call[CHAIN_ID, HEAD] { + _c.Call.Return() + return _c +} + +func (_c *mockNodeClient_SetAliveLoopSub_Call[CHAIN_ID, HEAD]) RunAndReturn(run func(types.Subscription)) *mockNodeClient_SetAliveLoopSub_Call[CHAIN_ID, HEAD] { + _c.Call.Return(run) + return _c +} + // SubscribeNewHead provides a mock function with given fields: ctx, channel func (_m *mockNodeClient[CHAIN_ID, HEAD]) SubscribeNewHead(ctx context.Context, channel chan<- HEAD) (types.Subscription, error) { ret := _m.Called(ctx, channel) @@ -235,6 +463,169 @@ func (_m *mockNodeClient[CHAIN_ID, HEAD]) SubscribeNewHead(ctx context.Context, return r0, r1 } +// mockNodeClient_SubscribeNewHead_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SubscribeNewHead' +type mockNodeClient_SubscribeNewHead_Call[CHAIN_ID types.ID, HEAD Head] struct { + *mock.Call +} + +// SubscribeNewHead is a helper method to define mock.On call +// - ctx context.Context +// - channel chan<- HEAD +func (_e *mockNodeClient_Expecter[CHAIN_ID, HEAD]) SubscribeNewHead(ctx interface{}, channel interface{}) *mockNodeClient_SubscribeNewHead_Call[CHAIN_ID, HEAD] { + return &mockNodeClient_SubscribeNewHead_Call[CHAIN_ID, HEAD]{Call: _e.mock.On("SubscribeNewHead", ctx, channel)} +} + +func (_c *mockNodeClient_SubscribeNewHead_Call[CHAIN_ID, HEAD]) Run(run func(ctx context.Context, channel chan<- HEAD)) *mockNodeClient_SubscribeNewHead_Call[CHAIN_ID, HEAD] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(chan<- HEAD)) + }) + return _c +} + +func (_c *mockNodeClient_SubscribeNewHead_Call[CHAIN_ID, HEAD]) Return(s types.Subscription, err error) *mockNodeClient_SubscribeNewHead_Call[CHAIN_ID, HEAD] { + _c.Call.Return(s, err) + return _c +} + +func (_c *mockNodeClient_SubscribeNewHead_Call[CHAIN_ID, HEAD]) RunAndReturn(run func(context.Context, chan<- HEAD) (types.Subscription, error)) *mockNodeClient_SubscribeNewHead_Call[CHAIN_ID, HEAD] { + _c.Call.Return(run) + return _c +} + +// SubscribeToFinalizedHeads provides a mock function with given fields: _a0 +func (_m *mockNodeClient[CHAIN_ID, HEAD]) SubscribeToFinalizedHeads(_a0 context.Context) (<-chan HEAD, types.Subscription, error) { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for SubscribeToFinalizedHeads") + } + + var r0 <-chan HEAD + var r1 types.Subscription + var r2 error + if rf, ok := ret.Get(0).(func(context.Context) (<-chan HEAD, types.Subscription, error)); ok { + return rf(_a0) + } + if rf, ok := ret.Get(0).(func(context.Context) <-chan HEAD); ok { + r0 = rf(_a0) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(<-chan HEAD) + } + } + + if rf, ok := ret.Get(1).(func(context.Context) types.Subscription); ok { + r1 = rf(_a0) + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).(types.Subscription) + } + } + + if rf, ok := ret.Get(2).(func(context.Context) error); ok { + r2 = rf(_a0) + } else { + r2 = ret.Error(2) + } + + return r0, r1, r2 +} + +// mockNodeClient_SubscribeToFinalizedHeads_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SubscribeToFinalizedHeads' +type mockNodeClient_SubscribeToFinalizedHeads_Call[CHAIN_ID types.ID, HEAD Head] struct { + *mock.Call +} + +// SubscribeToFinalizedHeads is a helper method to define mock.On call +// - _a0 context.Context +func (_e *mockNodeClient_Expecter[CHAIN_ID, HEAD]) SubscribeToFinalizedHeads(_a0 interface{}) *mockNodeClient_SubscribeToFinalizedHeads_Call[CHAIN_ID, HEAD] { + return &mockNodeClient_SubscribeToFinalizedHeads_Call[CHAIN_ID, HEAD]{Call: _e.mock.On("SubscribeToFinalizedHeads", _a0)} +} + +func (_c *mockNodeClient_SubscribeToFinalizedHeads_Call[CHAIN_ID, HEAD]) Run(run func(_a0 context.Context)) *mockNodeClient_SubscribeToFinalizedHeads_Call[CHAIN_ID, HEAD] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *mockNodeClient_SubscribeToFinalizedHeads_Call[CHAIN_ID, HEAD]) Return(_a0 <-chan HEAD, _a1 types.Subscription, _a2 error) *mockNodeClient_SubscribeToFinalizedHeads_Call[CHAIN_ID, HEAD] { + _c.Call.Return(_a0, _a1, _a2) + return _c +} + +func (_c *mockNodeClient_SubscribeToFinalizedHeads_Call[CHAIN_ID, HEAD]) RunAndReturn(run func(context.Context) (<-chan HEAD, types.Subscription, error)) *mockNodeClient_SubscribeToFinalizedHeads_Call[CHAIN_ID, HEAD] { + _c.Call.Return(run) + return _c +} + +// SubscribeToHeads provides a mock function with given fields: ctx +func (_m *mockNodeClient[CHAIN_ID, HEAD]) SubscribeToHeads(ctx context.Context) (<-chan HEAD, types.Subscription, error) { + ret := _m.Called(ctx) + + if len(ret) == 0 { + panic("no return value specified for SubscribeToHeads") + } + + var r0 <-chan HEAD + var r1 types.Subscription + var r2 error + if rf, ok := ret.Get(0).(func(context.Context) (<-chan HEAD, types.Subscription, error)); ok { + return rf(ctx) + } + if rf, ok := ret.Get(0).(func(context.Context) <-chan HEAD); ok { + r0 = rf(ctx) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(<-chan HEAD) + } + } + + if rf, ok := ret.Get(1).(func(context.Context) types.Subscription); ok { + r1 = rf(ctx) + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).(types.Subscription) + } + } + + if rf, ok := ret.Get(2).(func(context.Context) error); ok { + r2 = rf(ctx) + } else { + r2 = ret.Error(2) + } + + return r0, r1, r2 +} + +// mockNodeClient_SubscribeToHeads_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SubscribeToHeads' +type mockNodeClient_SubscribeToHeads_Call[CHAIN_ID types.ID, HEAD Head] struct { + *mock.Call +} + +// SubscribeToHeads is a helper method to define mock.On call +// - ctx context.Context +func (_e *mockNodeClient_Expecter[CHAIN_ID, HEAD]) SubscribeToHeads(ctx interface{}) *mockNodeClient_SubscribeToHeads_Call[CHAIN_ID, HEAD] { + return &mockNodeClient_SubscribeToHeads_Call[CHAIN_ID, HEAD]{Call: _e.mock.On("SubscribeToHeads", ctx)} +} + +func (_c *mockNodeClient_SubscribeToHeads_Call[CHAIN_ID, HEAD]) Run(run func(ctx context.Context)) *mockNodeClient_SubscribeToHeads_Call[CHAIN_ID, HEAD] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *mockNodeClient_SubscribeToHeads_Call[CHAIN_ID, HEAD]) Return(ch <-chan HEAD, sub types.Subscription, err error) *mockNodeClient_SubscribeToHeads_Call[CHAIN_ID, HEAD] { + _c.Call.Return(ch, sub, err) + return _c +} + +func (_c *mockNodeClient_SubscribeToHeads_Call[CHAIN_ID, HEAD]) RunAndReturn(run func(context.Context) (<-chan HEAD, types.Subscription, error)) *mockNodeClient_SubscribeToHeads_Call[CHAIN_ID, HEAD] { + _c.Call.Return(run) + return _c +} + // SubscribersCount provides a mock function with given fields: func (_m *mockNodeClient[CHAIN_ID, HEAD]) SubscribersCount() int32 { ret := _m.Called() @@ -253,11 +644,65 @@ func (_m *mockNodeClient[CHAIN_ID, HEAD]) SubscribersCount() int32 { return r0 } +// mockNodeClient_SubscribersCount_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SubscribersCount' +type mockNodeClient_SubscribersCount_Call[CHAIN_ID types.ID, HEAD Head] struct { + *mock.Call +} + +// SubscribersCount is a helper method to define mock.On call +func (_e *mockNodeClient_Expecter[CHAIN_ID, HEAD]) SubscribersCount() *mockNodeClient_SubscribersCount_Call[CHAIN_ID, HEAD] { + return &mockNodeClient_SubscribersCount_Call[CHAIN_ID, HEAD]{Call: _e.mock.On("SubscribersCount")} +} + +func (_c *mockNodeClient_SubscribersCount_Call[CHAIN_ID, HEAD]) Run(run func()) *mockNodeClient_SubscribersCount_Call[CHAIN_ID, HEAD] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *mockNodeClient_SubscribersCount_Call[CHAIN_ID, HEAD]) Return(_a0 int32) *mockNodeClient_SubscribersCount_Call[CHAIN_ID, HEAD] { + _c.Call.Return(_a0) + return _c +} + +func (_c *mockNodeClient_SubscribersCount_Call[CHAIN_ID, HEAD]) RunAndReturn(run func() int32) *mockNodeClient_SubscribersCount_Call[CHAIN_ID, HEAD] { + _c.Call.Return(run) + return _c +} + // UnsubscribeAllExceptAliveLoop provides a mock function with given fields: func (_m *mockNodeClient[CHAIN_ID, HEAD]) UnsubscribeAllExceptAliveLoop() { _m.Called() } +// mockNodeClient_UnsubscribeAllExceptAliveLoop_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UnsubscribeAllExceptAliveLoop' +type mockNodeClient_UnsubscribeAllExceptAliveLoop_Call[CHAIN_ID types.ID, HEAD Head] struct { + *mock.Call +} + +// UnsubscribeAllExceptAliveLoop is a helper method to define mock.On call +func (_e *mockNodeClient_Expecter[CHAIN_ID, HEAD]) UnsubscribeAllExceptAliveLoop() *mockNodeClient_UnsubscribeAllExceptAliveLoop_Call[CHAIN_ID, HEAD] { + return &mockNodeClient_UnsubscribeAllExceptAliveLoop_Call[CHAIN_ID, HEAD]{Call: _e.mock.On("UnsubscribeAllExceptAliveLoop")} +} + +func (_c *mockNodeClient_UnsubscribeAllExceptAliveLoop_Call[CHAIN_ID, HEAD]) Run(run func()) *mockNodeClient_UnsubscribeAllExceptAliveLoop_Call[CHAIN_ID, HEAD] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *mockNodeClient_UnsubscribeAllExceptAliveLoop_Call[CHAIN_ID, HEAD]) Return() *mockNodeClient_UnsubscribeAllExceptAliveLoop_Call[CHAIN_ID, HEAD] { + _c.Call.Return() + return _c +} + +func (_c *mockNodeClient_UnsubscribeAllExceptAliveLoop_Call[CHAIN_ID, HEAD]) RunAndReturn(run func()) *mockNodeClient_UnsubscribeAllExceptAliveLoop_Call[CHAIN_ID, HEAD] { + _c.Call.Return(run) + return _c +} + // newMockNodeClient creates a new instance of mockNodeClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func newMockNodeClient[CHAIN_ID types.ID, HEAD Head](t interface { diff --git a/common/client/mock_node_selector_test.go b/common/client/mock_node_selector_test.go index 783fc50c290..d05c2979fc1 100644 --- a/common/client/mock_node_selector_test.go +++ b/common/client/mock_node_selector_test.go @@ -12,6 +12,14 @@ type mockNodeSelector[CHAIN_ID types.ID, HEAD Head, RPC NodeClient[CHAIN_ID, HEA mock.Mock } +type mockNodeSelector_Expecter[CHAIN_ID types.ID, HEAD Head, RPC NodeClient[CHAIN_ID, HEAD]] struct { + mock *mock.Mock +} + +func (_m *mockNodeSelector[CHAIN_ID, HEAD, RPC]) EXPECT() *mockNodeSelector_Expecter[CHAIN_ID, HEAD, RPC] { + return &mockNodeSelector_Expecter[CHAIN_ID, HEAD, RPC]{mock: &_m.Mock} +} + // Name provides a mock function with given fields: func (_m *mockNodeSelector[CHAIN_ID, HEAD, RPC]) Name() string { ret := _m.Called() @@ -30,6 +38,33 @@ func (_m *mockNodeSelector[CHAIN_ID, HEAD, RPC]) Name() string { return r0 } +// mockNodeSelector_Name_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Name' +type mockNodeSelector_Name_Call[CHAIN_ID types.ID, HEAD Head, RPC NodeClient[CHAIN_ID, HEAD]] struct { + *mock.Call +} + +// Name is a helper method to define mock.On call +func (_e *mockNodeSelector_Expecter[CHAIN_ID, HEAD, RPC]) Name() *mockNodeSelector_Name_Call[CHAIN_ID, HEAD, RPC] { + return &mockNodeSelector_Name_Call[CHAIN_ID, HEAD, RPC]{Call: _e.mock.On("Name")} +} + +func (_c *mockNodeSelector_Name_Call[CHAIN_ID, HEAD, RPC]) Run(run func()) *mockNodeSelector_Name_Call[CHAIN_ID, HEAD, RPC] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *mockNodeSelector_Name_Call[CHAIN_ID, HEAD, RPC]) Return(_a0 string) *mockNodeSelector_Name_Call[CHAIN_ID, HEAD, RPC] { + _c.Call.Return(_a0) + return _c +} + +func (_c *mockNodeSelector_Name_Call[CHAIN_ID, HEAD, RPC]) RunAndReturn(run func() string) *mockNodeSelector_Name_Call[CHAIN_ID, HEAD, RPC] { + _c.Call.Return(run) + return _c +} + // Select provides a mock function with given fields: func (_m *mockNodeSelector[CHAIN_ID, HEAD, RPC]) Select() Node[CHAIN_ID, HEAD, RPC] { ret := _m.Called() @@ -50,6 +85,33 @@ func (_m *mockNodeSelector[CHAIN_ID, HEAD, RPC]) Select() Node[CHAIN_ID, HEAD, R return r0 } +// mockNodeSelector_Select_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Select' +type mockNodeSelector_Select_Call[CHAIN_ID types.ID, HEAD Head, RPC NodeClient[CHAIN_ID, HEAD]] struct { + *mock.Call +} + +// Select is a helper method to define mock.On call +func (_e *mockNodeSelector_Expecter[CHAIN_ID, HEAD, RPC]) Select() *mockNodeSelector_Select_Call[CHAIN_ID, HEAD, RPC] { + return &mockNodeSelector_Select_Call[CHAIN_ID, HEAD, RPC]{Call: _e.mock.On("Select")} +} + +func (_c *mockNodeSelector_Select_Call[CHAIN_ID, HEAD, RPC]) Run(run func()) *mockNodeSelector_Select_Call[CHAIN_ID, HEAD, RPC] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *mockNodeSelector_Select_Call[CHAIN_ID, HEAD, RPC]) Return(_a0 Node[CHAIN_ID, HEAD, RPC]) *mockNodeSelector_Select_Call[CHAIN_ID, HEAD, RPC] { + _c.Call.Return(_a0) + return _c +} + +func (_c *mockNodeSelector_Select_Call[CHAIN_ID, HEAD, RPC]) RunAndReturn(run func() Node[CHAIN_ID, HEAD, RPC]) *mockNodeSelector_Select_Call[CHAIN_ID, HEAD, RPC] { + _c.Call.Return(run) + return _c +} + // newMockNodeSelector creates a new instance of mockNodeSelector. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func newMockNodeSelector[CHAIN_ID types.ID, HEAD Head, RPC NodeClient[CHAIN_ID, HEAD]](t interface { diff --git a/common/client/mock_node_test.go b/common/client/mock_node_test.go index 5109eb6bb90..a342a533a7d 100644 --- a/common/client/mock_node_test.go +++ b/common/client/mock_node_test.go @@ -14,6 +14,14 @@ type mockNode[CHAIN_ID types.ID, HEAD Head, RPC NodeClient[CHAIN_ID, HEAD]] stru mock.Mock } +type mockNode_Expecter[CHAIN_ID types.ID, HEAD Head, RPC NodeClient[CHAIN_ID, HEAD]] struct { + mock *mock.Mock +} + +func (_m *mockNode[CHAIN_ID, HEAD, RPC]) EXPECT() *mockNode_Expecter[CHAIN_ID, HEAD, RPC] { + return &mockNode_Expecter[CHAIN_ID, HEAD, RPC]{mock: &_m.Mock} +} + // Close provides a mock function with given fields: func (_m *mockNode[CHAIN_ID, HEAD, RPC]) Close() error { ret := _m.Called() @@ -32,6 +40,33 @@ func (_m *mockNode[CHAIN_ID, HEAD, RPC]) Close() error { return r0 } +// mockNode_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close' +type mockNode_Close_Call[CHAIN_ID types.ID, HEAD Head, RPC NodeClient[CHAIN_ID, HEAD]] struct { + *mock.Call +} + +// Close is a helper method to define mock.On call +func (_e *mockNode_Expecter[CHAIN_ID, HEAD, RPC]) Close() *mockNode_Close_Call[CHAIN_ID, HEAD, RPC] { + return &mockNode_Close_Call[CHAIN_ID, HEAD, RPC]{Call: _e.mock.On("Close")} +} + +func (_c *mockNode_Close_Call[CHAIN_ID, HEAD, RPC]) Run(run func()) *mockNode_Close_Call[CHAIN_ID, HEAD, RPC] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *mockNode_Close_Call[CHAIN_ID, HEAD, RPC]) Return(_a0 error) *mockNode_Close_Call[CHAIN_ID, HEAD, RPC] { + _c.Call.Return(_a0) + return _c +} + +func (_c *mockNode_Close_Call[CHAIN_ID, HEAD, RPC]) RunAndReturn(run func() error) *mockNode_Close_Call[CHAIN_ID, HEAD, RPC] { + _c.Call.Return(run) + return _c +} + // ConfiguredChainID provides a mock function with given fields: func (_m *mockNode[CHAIN_ID, HEAD, RPC]) ConfiguredChainID() CHAIN_ID { ret := _m.Called() @@ -50,6 +85,33 @@ func (_m *mockNode[CHAIN_ID, HEAD, RPC]) ConfiguredChainID() CHAIN_ID { return r0 } +// mockNode_ConfiguredChainID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ConfiguredChainID' +type mockNode_ConfiguredChainID_Call[CHAIN_ID types.ID, HEAD Head, RPC NodeClient[CHAIN_ID, HEAD]] struct { + *mock.Call +} + +// ConfiguredChainID is a helper method to define mock.On call +func (_e *mockNode_Expecter[CHAIN_ID, HEAD, RPC]) ConfiguredChainID() *mockNode_ConfiguredChainID_Call[CHAIN_ID, HEAD, RPC] { + return &mockNode_ConfiguredChainID_Call[CHAIN_ID, HEAD, RPC]{Call: _e.mock.On("ConfiguredChainID")} +} + +func (_c *mockNode_ConfiguredChainID_Call[CHAIN_ID, HEAD, RPC]) Run(run func()) *mockNode_ConfiguredChainID_Call[CHAIN_ID, HEAD, RPC] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *mockNode_ConfiguredChainID_Call[CHAIN_ID, HEAD, RPC]) Return(_a0 CHAIN_ID) *mockNode_ConfiguredChainID_Call[CHAIN_ID, HEAD, RPC] { + _c.Call.Return(_a0) + return _c +} + +func (_c *mockNode_ConfiguredChainID_Call[CHAIN_ID, HEAD, RPC]) RunAndReturn(run func() CHAIN_ID) *mockNode_ConfiguredChainID_Call[CHAIN_ID, HEAD, RPC] { + _c.Call.Return(run) + return _c +} + // HighestUserObservations provides a mock function with given fields: func (_m *mockNode[CHAIN_ID, HEAD, RPC]) HighestUserObservations() ChainInfo { ret := _m.Called() @@ -68,6 +130,33 @@ func (_m *mockNode[CHAIN_ID, HEAD, RPC]) HighestUserObservations() ChainInfo { return r0 } +// mockNode_HighestUserObservations_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HighestUserObservations' +type mockNode_HighestUserObservations_Call[CHAIN_ID types.ID, HEAD Head, RPC NodeClient[CHAIN_ID, HEAD]] struct { + *mock.Call +} + +// HighestUserObservations is a helper method to define mock.On call +func (_e *mockNode_Expecter[CHAIN_ID, HEAD, RPC]) HighestUserObservations() *mockNode_HighestUserObservations_Call[CHAIN_ID, HEAD, RPC] { + return &mockNode_HighestUserObservations_Call[CHAIN_ID, HEAD, RPC]{Call: _e.mock.On("HighestUserObservations")} +} + +func (_c *mockNode_HighestUserObservations_Call[CHAIN_ID, HEAD, RPC]) Run(run func()) *mockNode_HighestUserObservations_Call[CHAIN_ID, HEAD, RPC] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *mockNode_HighestUserObservations_Call[CHAIN_ID, HEAD, RPC]) Return(_a0 ChainInfo) *mockNode_HighestUserObservations_Call[CHAIN_ID, HEAD, RPC] { + _c.Call.Return(_a0) + return _c +} + +func (_c *mockNode_HighestUserObservations_Call[CHAIN_ID, HEAD, RPC]) RunAndReturn(run func() ChainInfo) *mockNode_HighestUserObservations_Call[CHAIN_ID, HEAD, RPC] { + _c.Call.Return(run) + return _c +} + // Name provides a mock function with given fields: func (_m *mockNode[CHAIN_ID, HEAD, RPC]) Name() string { ret := _m.Called() @@ -86,6 +175,33 @@ func (_m *mockNode[CHAIN_ID, HEAD, RPC]) Name() string { return r0 } +// mockNode_Name_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Name' +type mockNode_Name_Call[CHAIN_ID types.ID, HEAD Head, RPC NodeClient[CHAIN_ID, HEAD]] struct { + *mock.Call +} + +// Name is a helper method to define mock.On call +func (_e *mockNode_Expecter[CHAIN_ID, HEAD, RPC]) Name() *mockNode_Name_Call[CHAIN_ID, HEAD, RPC] { + return &mockNode_Name_Call[CHAIN_ID, HEAD, RPC]{Call: _e.mock.On("Name")} +} + +func (_c *mockNode_Name_Call[CHAIN_ID, HEAD, RPC]) Run(run func()) *mockNode_Name_Call[CHAIN_ID, HEAD, RPC] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *mockNode_Name_Call[CHAIN_ID, HEAD, RPC]) Return(_a0 string) *mockNode_Name_Call[CHAIN_ID, HEAD, RPC] { + _c.Call.Return(_a0) + return _c +} + +func (_c *mockNode_Name_Call[CHAIN_ID, HEAD, RPC]) RunAndReturn(run func() string) *mockNode_Name_Call[CHAIN_ID, HEAD, RPC] { + _c.Call.Return(run) + return _c +} + // Order provides a mock function with given fields: func (_m *mockNode[CHAIN_ID, HEAD, RPC]) Order() int32 { ret := _m.Called() @@ -104,6 +220,33 @@ func (_m *mockNode[CHAIN_ID, HEAD, RPC]) Order() int32 { return r0 } +// mockNode_Order_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Order' +type mockNode_Order_Call[CHAIN_ID types.ID, HEAD Head, RPC NodeClient[CHAIN_ID, HEAD]] struct { + *mock.Call +} + +// Order is a helper method to define mock.On call +func (_e *mockNode_Expecter[CHAIN_ID, HEAD, RPC]) Order() *mockNode_Order_Call[CHAIN_ID, HEAD, RPC] { + return &mockNode_Order_Call[CHAIN_ID, HEAD, RPC]{Call: _e.mock.On("Order")} +} + +func (_c *mockNode_Order_Call[CHAIN_ID, HEAD, RPC]) Run(run func()) *mockNode_Order_Call[CHAIN_ID, HEAD, RPC] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *mockNode_Order_Call[CHAIN_ID, HEAD, RPC]) Return(_a0 int32) *mockNode_Order_Call[CHAIN_ID, HEAD, RPC] { + _c.Call.Return(_a0) + return _c +} + +func (_c *mockNode_Order_Call[CHAIN_ID, HEAD, RPC]) RunAndReturn(run func() int32) *mockNode_Order_Call[CHAIN_ID, HEAD, RPC] { + _c.Call.Return(run) + return _c +} + // RPC provides a mock function with given fields: func (_m *mockNode[CHAIN_ID, HEAD, RPC]) RPC() RPC { ret := _m.Called() @@ -122,11 +265,66 @@ func (_m *mockNode[CHAIN_ID, HEAD, RPC]) RPC() RPC { return r0 } +// mockNode_RPC_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RPC' +type mockNode_RPC_Call[CHAIN_ID types.ID, HEAD Head, RPC NodeClient[CHAIN_ID, HEAD]] struct { + *mock.Call +} + +// RPC is a helper method to define mock.On call +func (_e *mockNode_Expecter[CHAIN_ID, HEAD, RPC]) RPC() *mockNode_RPC_Call[CHAIN_ID, HEAD, RPC] { + return &mockNode_RPC_Call[CHAIN_ID, HEAD, RPC]{Call: _e.mock.On("RPC")} +} + +func (_c *mockNode_RPC_Call[CHAIN_ID, HEAD, RPC]) Run(run func()) *mockNode_RPC_Call[CHAIN_ID, HEAD, RPC] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *mockNode_RPC_Call[CHAIN_ID, HEAD, RPC]) Return(_a0 RPC) *mockNode_RPC_Call[CHAIN_ID, HEAD, RPC] { + _c.Call.Return(_a0) + return _c +} + +func (_c *mockNode_RPC_Call[CHAIN_ID, HEAD, RPC]) RunAndReturn(run func() RPC) *mockNode_RPC_Call[CHAIN_ID, HEAD, RPC] { + _c.Call.Return(run) + return _c +} + // SetPoolChainInfoProvider provides a mock function with given fields: _a0 func (_m *mockNode[CHAIN_ID, HEAD, RPC]) SetPoolChainInfoProvider(_a0 PoolChainInfoProvider) { _m.Called(_a0) } +// mockNode_SetPoolChainInfoProvider_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetPoolChainInfoProvider' +type mockNode_SetPoolChainInfoProvider_Call[CHAIN_ID types.ID, HEAD Head, RPC NodeClient[CHAIN_ID, HEAD]] struct { + *mock.Call +} + +// SetPoolChainInfoProvider is a helper method to define mock.On call +// - _a0 PoolChainInfoProvider +func (_e *mockNode_Expecter[CHAIN_ID, HEAD, RPC]) SetPoolChainInfoProvider(_a0 interface{}) *mockNode_SetPoolChainInfoProvider_Call[CHAIN_ID, HEAD, RPC] { + return &mockNode_SetPoolChainInfoProvider_Call[CHAIN_ID, HEAD, RPC]{Call: _e.mock.On("SetPoolChainInfoProvider", _a0)} +} + +func (_c *mockNode_SetPoolChainInfoProvider_Call[CHAIN_ID, HEAD, RPC]) Run(run func(_a0 PoolChainInfoProvider)) *mockNode_SetPoolChainInfoProvider_Call[CHAIN_ID, HEAD, RPC] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(PoolChainInfoProvider)) + }) + return _c +} + +func (_c *mockNode_SetPoolChainInfoProvider_Call[CHAIN_ID, HEAD, RPC]) Return() *mockNode_SetPoolChainInfoProvider_Call[CHAIN_ID, HEAD, RPC] { + _c.Call.Return() + return _c +} + +func (_c *mockNode_SetPoolChainInfoProvider_Call[CHAIN_ID, HEAD, RPC]) RunAndReturn(run func(PoolChainInfoProvider)) *mockNode_SetPoolChainInfoProvider_Call[CHAIN_ID, HEAD, RPC] { + _c.Call.Return(run) + return _c +} + // Start provides a mock function with given fields: _a0 func (_m *mockNode[CHAIN_ID, HEAD, RPC]) Start(_a0 context.Context) error { ret := _m.Called(_a0) @@ -145,6 +343,34 @@ func (_m *mockNode[CHAIN_ID, HEAD, RPC]) Start(_a0 context.Context) error { return r0 } +// mockNode_Start_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Start' +type mockNode_Start_Call[CHAIN_ID types.ID, HEAD Head, RPC NodeClient[CHAIN_ID, HEAD]] struct { + *mock.Call +} + +// Start is a helper method to define mock.On call +// - _a0 context.Context +func (_e *mockNode_Expecter[CHAIN_ID, HEAD, RPC]) Start(_a0 interface{}) *mockNode_Start_Call[CHAIN_ID, HEAD, RPC] { + return &mockNode_Start_Call[CHAIN_ID, HEAD, RPC]{Call: _e.mock.On("Start", _a0)} +} + +func (_c *mockNode_Start_Call[CHAIN_ID, HEAD, RPC]) Run(run func(_a0 context.Context)) *mockNode_Start_Call[CHAIN_ID, HEAD, RPC] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *mockNode_Start_Call[CHAIN_ID, HEAD, RPC]) Return(_a0 error) *mockNode_Start_Call[CHAIN_ID, HEAD, RPC] { + _c.Call.Return(_a0) + return _c +} + +func (_c *mockNode_Start_Call[CHAIN_ID, HEAD, RPC]) RunAndReturn(run func(context.Context) error) *mockNode_Start_Call[CHAIN_ID, HEAD, RPC] { + _c.Call.Return(run) + return _c +} + // State provides a mock function with given fields: func (_m *mockNode[CHAIN_ID, HEAD, RPC]) State() nodeState { ret := _m.Called() @@ -163,6 +389,33 @@ func (_m *mockNode[CHAIN_ID, HEAD, RPC]) State() nodeState { return r0 } +// mockNode_State_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'State' +type mockNode_State_Call[CHAIN_ID types.ID, HEAD Head, RPC NodeClient[CHAIN_ID, HEAD]] struct { + *mock.Call +} + +// State is a helper method to define mock.On call +func (_e *mockNode_Expecter[CHAIN_ID, HEAD, RPC]) State() *mockNode_State_Call[CHAIN_ID, HEAD, RPC] { + return &mockNode_State_Call[CHAIN_ID, HEAD, RPC]{Call: _e.mock.On("State")} +} + +func (_c *mockNode_State_Call[CHAIN_ID, HEAD, RPC]) Run(run func()) *mockNode_State_Call[CHAIN_ID, HEAD, RPC] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *mockNode_State_Call[CHAIN_ID, HEAD, RPC]) Return(_a0 nodeState) *mockNode_State_Call[CHAIN_ID, HEAD, RPC] { + _c.Call.Return(_a0) + return _c +} + +func (_c *mockNode_State_Call[CHAIN_ID, HEAD, RPC]) RunAndReturn(run func() nodeState) *mockNode_State_Call[CHAIN_ID, HEAD, RPC] { + _c.Call.Return(run) + return _c +} + // StateAndLatest provides a mock function with given fields: func (_m *mockNode[CHAIN_ID, HEAD, RPC]) StateAndLatest() (nodeState, ChainInfo) { ret := _m.Called() @@ -191,6 +444,33 @@ func (_m *mockNode[CHAIN_ID, HEAD, RPC]) StateAndLatest() (nodeState, ChainInfo) return r0, r1 } +// mockNode_StateAndLatest_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StateAndLatest' +type mockNode_StateAndLatest_Call[CHAIN_ID types.ID, HEAD Head, RPC NodeClient[CHAIN_ID, HEAD]] struct { + *mock.Call +} + +// StateAndLatest is a helper method to define mock.On call +func (_e *mockNode_Expecter[CHAIN_ID, HEAD, RPC]) StateAndLatest() *mockNode_StateAndLatest_Call[CHAIN_ID, HEAD, RPC] { + return &mockNode_StateAndLatest_Call[CHAIN_ID, HEAD, RPC]{Call: _e.mock.On("StateAndLatest")} +} + +func (_c *mockNode_StateAndLatest_Call[CHAIN_ID, HEAD, RPC]) Run(run func()) *mockNode_StateAndLatest_Call[CHAIN_ID, HEAD, RPC] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *mockNode_StateAndLatest_Call[CHAIN_ID, HEAD, RPC]) Return(_a0 nodeState, _a1 ChainInfo) *mockNode_StateAndLatest_Call[CHAIN_ID, HEAD, RPC] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *mockNode_StateAndLatest_Call[CHAIN_ID, HEAD, RPC]) RunAndReturn(run func() (nodeState, ChainInfo)) *mockNode_StateAndLatest_Call[CHAIN_ID, HEAD, RPC] { + _c.Call.Return(run) + return _c +} + // String provides a mock function with given fields: func (_m *mockNode[CHAIN_ID, HEAD, RPC]) String() string { ret := _m.Called() @@ -209,6 +489,33 @@ func (_m *mockNode[CHAIN_ID, HEAD, RPC]) String() string { return r0 } +// mockNode_String_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'String' +type mockNode_String_Call[CHAIN_ID types.ID, HEAD Head, RPC NodeClient[CHAIN_ID, HEAD]] struct { + *mock.Call +} + +// String is a helper method to define mock.On call +func (_e *mockNode_Expecter[CHAIN_ID, HEAD, RPC]) String() *mockNode_String_Call[CHAIN_ID, HEAD, RPC] { + return &mockNode_String_Call[CHAIN_ID, HEAD, RPC]{Call: _e.mock.On("String")} +} + +func (_c *mockNode_String_Call[CHAIN_ID, HEAD, RPC]) Run(run func()) *mockNode_String_Call[CHAIN_ID, HEAD, RPC] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *mockNode_String_Call[CHAIN_ID, HEAD, RPC]) Return(_a0 string) *mockNode_String_Call[CHAIN_ID, HEAD, RPC] { + _c.Call.Return(_a0) + return _c +} + +func (_c *mockNode_String_Call[CHAIN_ID, HEAD, RPC]) RunAndReturn(run func() string) *mockNode_String_Call[CHAIN_ID, HEAD, RPC] { + _c.Call.Return(run) + return _c +} + // SubscribersCount provides a mock function with given fields: func (_m *mockNode[CHAIN_ID, HEAD, RPC]) SubscribersCount() int32 { ret := _m.Called() @@ -227,11 +534,65 @@ func (_m *mockNode[CHAIN_ID, HEAD, RPC]) SubscribersCount() int32 { return r0 } +// mockNode_SubscribersCount_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SubscribersCount' +type mockNode_SubscribersCount_Call[CHAIN_ID types.ID, HEAD Head, RPC NodeClient[CHAIN_ID, HEAD]] struct { + *mock.Call +} + +// SubscribersCount is a helper method to define mock.On call +func (_e *mockNode_Expecter[CHAIN_ID, HEAD, RPC]) SubscribersCount() *mockNode_SubscribersCount_Call[CHAIN_ID, HEAD, RPC] { + return &mockNode_SubscribersCount_Call[CHAIN_ID, HEAD, RPC]{Call: _e.mock.On("SubscribersCount")} +} + +func (_c *mockNode_SubscribersCount_Call[CHAIN_ID, HEAD, RPC]) Run(run func()) *mockNode_SubscribersCount_Call[CHAIN_ID, HEAD, RPC] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *mockNode_SubscribersCount_Call[CHAIN_ID, HEAD, RPC]) Return(_a0 int32) *mockNode_SubscribersCount_Call[CHAIN_ID, HEAD, RPC] { + _c.Call.Return(_a0) + return _c +} + +func (_c *mockNode_SubscribersCount_Call[CHAIN_ID, HEAD, RPC]) RunAndReturn(run func() int32) *mockNode_SubscribersCount_Call[CHAIN_ID, HEAD, RPC] { + _c.Call.Return(run) + return _c +} + // UnsubscribeAllExceptAliveLoop provides a mock function with given fields: func (_m *mockNode[CHAIN_ID, HEAD, RPC]) UnsubscribeAllExceptAliveLoop() { _m.Called() } +// mockNode_UnsubscribeAllExceptAliveLoop_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UnsubscribeAllExceptAliveLoop' +type mockNode_UnsubscribeAllExceptAliveLoop_Call[CHAIN_ID types.ID, HEAD Head, RPC NodeClient[CHAIN_ID, HEAD]] struct { + *mock.Call +} + +// UnsubscribeAllExceptAliveLoop is a helper method to define mock.On call +func (_e *mockNode_Expecter[CHAIN_ID, HEAD, RPC]) UnsubscribeAllExceptAliveLoop() *mockNode_UnsubscribeAllExceptAliveLoop_Call[CHAIN_ID, HEAD, RPC] { + return &mockNode_UnsubscribeAllExceptAliveLoop_Call[CHAIN_ID, HEAD, RPC]{Call: _e.mock.On("UnsubscribeAllExceptAliveLoop")} +} + +func (_c *mockNode_UnsubscribeAllExceptAliveLoop_Call[CHAIN_ID, HEAD, RPC]) Run(run func()) *mockNode_UnsubscribeAllExceptAliveLoop_Call[CHAIN_ID, HEAD, RPC] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *mockNode_UnsubscribeAllExceptAliveLoop_Call[CHAIN_ID, HEAD, RPC]) Return() *mockNode_UnsubscribeAllExceptAliveLoop_Call[CHAIN_ID, HEAD, RPC] { + _c.Call.Return() + return _c +} + +func (_c *mockNode_UnsubscribeAllExceptAliveLoop_Call[CHAIN_ID, HEAD, RPC]) RunAndReturn(run func()) *mockNode_UnsubscribeAllExceptAliveLoop_Call[CHAIN_ID, HEAD, RPC] { + _c.Call.Return(run) + return _c +} + // newMockNode creates a new instance of mockNode. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func newMockNode[CHAIN_ID types.ID, HEAD Head, RPC NodeClient[CHAIN_ID, HEAD]](t interface { diff --git a/common/client/mock_pool_chain_info_provider_test.go b/common/client/mock_pool_chain_info_provider_test.go index 4e4955e7381..473041f9fab 100644 --- a/common/client/mock_pool_chain_info_provider_test.go +++ b/common/client/mock_pool_chain_info_provider_test.go @@ -9,6 +9,14 @@ type mockPoolChainInfoProvider struct { mock.Mock } +type mockPoolChainInfoProvider_Expecter struct { + mock *mock.Mock +} + +func (_m *mockPoolChainInfoProvider) EXPECT() *mockPoolChainInfoProvider_Expecter { + return &mockPoolChainInfoProvider_Expecter{mock: &_m.Mock} +} + // HighestUserObservations provides a mock function with given fields: func (_m *mockPoolChainInfoProvider) HighestUserObservations() ChainInfo { ret := _m.Called() @@ -27,6 +35,33 @@ func (_m *mockPoolChainInfoProvider) HighestUserObservations() ChainInfo { return r0 } +// mockPoolChainInfoProvider_HighestUserObservations_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HighestUserObservations' +type mockPoolChainInfoProvider_HighestUserObservations_Call struct { + *mock.Call +} + +// HighestUserObservations is a helper method to define mock.On call +func (_e *mockPoolChainInfoProvider_Expecter) HighestUserObservations() *mockPoolChainInfoProvider_HighestUserObservations_Call { + return &mockPoolChainInfoProvider_HighestUserObservations_Call{Call: _e.mock.On("HighestUserObservations")} +} + +func (_c *mockPoolChainInfoProvider_HighestUserObservations_Call) Run(run func()) *mockPoolChainInfoProvider_HighestUserObservations_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *mockPoolChainInfoProvider_HighestUserObservations_Call) Return(_a0 ChainInfo) *mockPoolChainInfoProvider_HighestUserObservations_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *mockPoolChainInfoProvider_HighestUserObservations_Call) RunAndReturn(run func() ChainInfo) *mockPoolChainInfoProvider_HighestUserObservations_Call { + _c.Call.Return(run) + return _c +} + // LatestChainInfo provides a mock function with given fields: func (_m *mockPoolChainInfoProvider) LatestChainInfo() (int, ChainInfo) { ret := _m.Called() @@ -55,6 +90,33 @@ func (_m *mockPoolChainInfoProvider) LatestChainInfo() (int, ChainInfo) { return r0, r1 } +// mockPoolChainInfoProvider_LatestChainInfo_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LatestChainInfo' +type mockPoolChainInfoProvider_LatestChainInfo_Call struct { + *mock.Call +} + +// LatestChainInfo is a helper method to define mock.On call +func (_e *mockPoolChainInfoProvider_Expecter) LatestChainInfo() *mockPoolChainInfoProvider_LatestChainInfo_Call { + return &mockPoolChainInfoProvider_LatestChainInfo_Call{Call: _e.mock.On("LatestChainInfo")} +} + +func (_c *mockPoolChainInfoProvider_LatestChainInfo_Call) Run(run func()) *mockPoolChainInfoProvider_LatestChainInfo_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *mockPoolChainInfoProvider_LatestChainInfo_Call) Return(_a0 int, _a1 ChainInfo) *mockPoolChainInfoProvider_LatestChainInfo_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *mockPoolChainInfoProvider_LatestChainInfo_Call) RunAndReturn(run func() (int, ChainInfo)) *mockPoolChainInfoProvider_LatestChainInfo_Call { + _c.Call.Return(run) + return _c +} + // newMockPoolChainInfoProvider creates a new instance of mockPoolChainInfoProvider. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func newMockPoolChainInfoProvider(t interface { diff --git a/common/client/mock_rpc_test.go b/common/client/mock_rpc_test.go index 81bac04547d..00473c66369 100644 --- a/common/client/mock_rpc_test.go +++ b/common/client/mock_rpc_test.go @@ -21,6 +21,14 @@ type mockRPC[CHAIN_ID types.ID, SEQ types.Sequence, ADDR types.Hashable, BLOCK_H mock.Mock } +type mockRPC_Expecter[CHAIN_ID types.ID, SEQ types.Sequence, ADDR types.Hashable, BLOCK_HASH types.Hashable, TX interface{}, TX_HASH types.Hashable, EVENT interface{}, EVENT_OPS interface{}, TX_RECEIPT types.Receipt[TX_HASH, BLOCK_HASH], FEE feetypes.Fee, HEAD types.Head[BLOCK_HASH], BATCH_ELEM interface{}] struct { + mock *mock.Mock +} + +func (_m *mockRPC[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) EXPECT() *mockRPC_Expecter[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + return &mockRPC_Expecter[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]{mock: &_m.Mock} +} + // BalanceAt provides a mock function with given fields: ctx, accountAddress, blockNumber func (_m *mockRPC[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) BalanceAt(ctx context.Context, accountAddress ADDR, blockNumber *big.Int) (*big.Int, error) { ret := _m.Called(ctx, accountAddress, blockNumber) @@ -51,6 +59,36 @@ func (_m *mockRPC[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS return r0, r1 } +// mockRPC_BalanceAt_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BalanceAt' +type mockRPC_BalanceAt_Call[CHAIN_ID types.ID, SEQ types.Sequence, ADDR types.Hashable, BLOCK_HASH types.Hashable, TX interface{}, TX_HASH types.Hashable, EVENT interface{}, EVENT_OPS interface{}, TX_RECEIPT types.Receipt[TX_HASH, BLOCK_HASH], FEE feetypes.Fee, HEAD types.Head[BLOCK_HASH], BATCH_ELEM interface{}] struct { + *mock.Call +} + +// BalanceAt is a helper method to define mock.On call +// - ctx context.Context +// - accountAddress ADDR +// - blockNumber *big.Int +func (_e *mockRPC_Expecter[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) BalanceAt(ctx interface{}, accountAddress interface{}, blockNumber interface{}) *mockRPC_BalanceAt_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + return &mockRPC_BalanceAt_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]{Call: _e.mock.On("BalanceAt", ctx, accountAddress, blockNumber)} +} + +func (_c *mockRPC_BalanceAt_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) Run(run func(ctx context.Context, accountAddress ADDR, blockNumber *big.Int)) *mockRPC_BalanceAt_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(ADDR), args[2].(*big.Int)) + }) + return _c +} + +func (_c *mockRPC_BalanceAt_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) Return(_a0 *big.Int, _a1 error) *mockRPC_BalanceAt_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *mockRPC_BalanceAt_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) RunAndReturn(run func(context.Context, ADDR, *big.Int) (*big.Int, error)) *mockRPC_BalanceAt_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + _c.Call.Return(run) + return _c +} + // BatchCallContext provides a mock function with given fields: ctx, b func (_m *mockRPC[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) BatchCallContext(ctx context.Context, b []BATCH_ELEM) error { ret := _m.Called(ctx, b) @@ -69,6 +107,35 @@ func (_m *mockRPC[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS return r0 } +// mockRPC_BatchCallContext_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BatchCallContext' +type mockRPC_BatchCallContext_Call[CHAIN_ID types.ID, SEQ types.Sequence, ADDR types.Hashable, BLOCK_HASH types.Hashable, TX interface{}, TX_HASH types.Hashable, EVENT interface{}, EVENT_OPS interface{}, TX_RECEIPT types.Receipt[TX_HASH, BLOCK_HASH], FEE feetypes.Fee, HEAD types.Head[BLOCK_HASH], BATCH_ELEM interface{}] struct { + *mock.Call +} + +// BatchCallContext is a helper method to define mock.On call +// - ctx context.Context +// - b []BATCH_ELEM +func (_e *mockRPC_Expecter[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) BatchCallContext(ctx interface{}, b interface{}) *mockRPC_BatchCallContext_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + return &mockRPC_BatchCallContext_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]{Call: _e.mock.On("BatchCallContext", ctx, b)} +} + +func (_c *mockRPC_BatchCallContext_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) Run(run func(ctx context.Context, b []BATCH_ELEM)) *mockRPC_BatchCallContext_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].([]BATCH_ELEM)) + }) + return _c +} + +func (_c *mockRPC_BatchCallContext_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) Return(_a0 error) *mockRPC_BatchCallContext_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + _c.Call.Return(_a0) + return _c +} + +func (_c *mockRPC_BatchCallContext_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) RunAndReturn(run func(context.Context, []BATCH_ELEM) error) *mockRPC_BatchCallContext_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + _c.Call.Return(run) + return _c +} + // BlockByHash provides a mock function with given fields: ctx, hash func (_m *mockRPC[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) BlockByHash(ctx context.Context, hash BLOCK_HASH) (HEAD, error) { ret := _m.Called(ctx, hash) @@ -97,6 +164,35 @@ func (_m *mockRPC[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS return r0, r1 } +// mockRPC_BlockByHash_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BlockByHash' +type mockRPC_BlockByHash_Call[CHAIN_ID types.ID, SEQ types.Sequence, ADDR types.Hashable, BLOCK_HASH types.Hashable, TX interface{}, TX_HASH types.Hashable, EVENT interface{}, EVENT_OPS interface{}, TX_RECEIPT types.Receipt[TX_HASH, BLOCK_HASH], FEE feetypes.Fee, HEAD types.Head[BLOCK_HASH], BATCH_ELEM interface{}] struct { + *mock.Call +} + +// BlockByHash is a helper method to define mock.On call +// - ctx context.Context +// - hash BLOCK_HASH +func (_e *mockRPC_Expecter[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) BlockByHash(ctx interface{}, hash interface{}) *mockRPC_BlockByHash_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + return &mockRPC_BlockByHash_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]{Call: _e.mock.On("BlockByHash", ctx, hash)} +} + +func (_c *mockRPC_BlockByHash_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) Run(run func(ctx context.Context, hash BLOCK_HASH)) *mockRPC_BlockByHash_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(BLOCK_HASH)) + }) + return _c +} + +func (_c *mockRPC_BlockByHash_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) Return(_a0 HEAD, _a1 error) *mockRPC_BlockByHash_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *mockRPC_BlockByHash_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) RunAndReturn(run func(context.Context, BLOCK_HASH) (HEAD, error)) *mockRPC_BlockByHash_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + _c.Call.Return(run) + return _c +} + // BlockByNumber provides a mock function with given fields: ctx, number func (_m *mockRPC[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) BlockByNumber(ctx context.Context, number *big.Int) (HEAD, error) { ret := _m.Called(ctx, number) @@ -125,6 +221,35 @@ func (_m *mockRPC[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS return r0, r1 } +// mockRPC_BlockByNumber_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BlockByNumber' +type mockRPC_BlockByNumber_Call[CHAIN_ID types.ID, SEQ types.Sequence, ADDR types.Hashable, BLOCK_HASH types.Hashable, TX interface{}, TX_HASH types.Hashable, EVENT interface{}, EVENT_OPS interface{}, TX_RECEIPT types.Receipt[TX_HASH, BLOCK_HASH], FEE feetypes.Fee, HEAD types.Head[BLOCK_HASH], BATCH_ELEM interface{}] struct { + *mock.Call +} + +// BlockByNumber is a helper method to define mock.On call +// - ctx context.Context +// - number *big.Int +func (_e *mockRPC_Expecter[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) BlockByNumber(ctx interface{}, number interface{}) *mockRPC_BlockByNumber_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + return &mockRPC_BlockByNumber_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]{Call: _e.mock.On("BlockByNumber", ctx, number)} +} + +func (_c *mockRPC_BlockByNumber_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) Run(run func(ctx context.Context, number *big.Int)) *mockRPC_BlockByNumber_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*big.Int)) + }) + return _c +} + +func (_c *mockRPC_BlockByNumber_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) Return(_a0 HEAD, _a1 error) *mockRPC_BlockByNumber_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *mockRPC_BlockByNumber_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) RunAndReturn(run func(context.Context, *big.Int) (HEAD, error)) *mockRPC_BlockByNumber_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + _c.Call.Return(run) + return _c +} + // CallContext provides a mock function with given fields: ctx, result, method, args func (_m *mockRPC[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) CallContext(ctx context.Context, result interface{}, method string, args ...interface{}) error { var _ca []interface{} @@ -146,6 +271,44 @@ func (_m *mockRPC[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS return r0 } +// mockRPC_CallContext_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CallContext' +type mockRPC_CallContext_Call[CHAIN_ID types.ID, SEQ types.Sequence, ADDR types.Hashable, BLOCK_HASH types.Hashable, TX interface{}, TX_HASH types.Hashable, EVENT interface{}, EVENT_OPS interface{}, TX_RECEIPT types.Receipt[TX_HASH, BLOCK_HASH], FEE feetypes.Fee, HEAD types.Head[BLOCK_HASH], BATCH_ELEM interface{}] struct { + *mock.Call +} + +// CallContext is a helper method to define mock.On call +// - ctx context.Context +// - result interface{} +// - method string +// - args ...interface{} +func (_e *mockRPC_Expecter[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) CallContext(ctx interface{}, result interface{}, method interface{}, args ...interface{}) *mockRPC_CallContext_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + return &mockRPC_CallContext_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]{Call: _e.mock.On("CallContext", + append([]interface{}{ctx, result, method}, args...)...)} +} + +func (_c *mockRPC_CallContext_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) Run(run func(ctx context.Context, result interface{}, method string, args ...interface{})) *mockRPC_CallContext_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-3) + for i, a := range args[3:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(args[0].(context.Context), args[1].(interface{}), args[2].(string), variadicArgs...) + }) + return _c +} + +func (_c *mockRPC_CallContext_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) Return(_a0 error) *mockRPC_CallContext_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + _c.Call.Return(_a0) + return _c +} + +func (_c *mockRPC_CallContext_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) RunAndReturn(run func(context.Context, interface{}, string, ...interface{}) error) *mockRPC_CallContext_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + _c.Call.Return(run) + return _c +} + // CallContract provides a mock function with given fields: ctx, msg, blockNumber func (_m *mockRPC[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) CallContract(ctx context.Context, msg interface{}, blockNumber *big.Int) ([]byte, error) { ret := _m.Called(ctx, msg, blockNumber) @@ -176,6 +339,36 @@ func (_m *mockRPC[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS return r0, r1 } +// mockRPC_CallContract_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CallContract' +type mockRPC_CallContract_Call[CHAIN_ID types.ID, SEQ types.Sequence, ADDR types.Hashable, BLOCK_HASH types.Hashable, TX interface{}, TX_HASH types.Hashable, EVENT interface{}, EVENT_OPS interface{}, TX_RECEIPT types.Receipt[TX_HASH, BLOCK_HASH], FEE feetypes.Fee, HEAD types.Head[BLOCK_HASH], BATCH_ELEM interface{}] struct { + *mock.Call +} + +// CallContract is a helper method to define mock.On call +// - ctx context.Context +// - msg interface{} +// - blockNumber *big.Int +func (_e *mockRPC_Expecter[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) CallContract(ctx interface{}, msg interface{}, blockNumber interface{}) *mockRPC_CallContract_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + return &mockRPC_CallContract_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]{Call: _e.mock.On("CallContract", ctx, msg, blockNumber)} +} + +func (_c *mockRPC_CallContract_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) Run(run func(ctx context.Context, msg interface{}, blockNumber *big.Int)) *mockRPC_CallContract_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(interface{}), args[2].(*big.Int)) + }) + return _c +} + +func (_c *mockRPC_CallContract_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) Return(rpcErr []byte, extractErr error) *mockRPC_CallContract_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + _c.Call.Return(rpcErr, extractErr) + return _c +} + +func (_c *mockRPC_CallContract_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) RunAndReturn(run func(context.Context, interface{}, *big.Int) ([]byte, error)) *mockRPC_CallContract_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + _c.Call.Return(run) + return _c +} + // ChainID provides a mock function with given fields: ctx func (_m *mockRPC[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) ChainID(ctx context.Context) (CHAIN_ID, error) { ret := _m.Called(ctx) @@ -204,6 +397,34 @@ func (_m *mockRPC[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS return r0, r1 } +// mockRPC_ChainID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ChainID' +type mockRPC_ChainID_Call[CHAIN_ID types.ID, SEQ types.Sequence, ADDR types.Hashable, BLOCK_HASH types.Hashable, TX interface{}, TX_HASH types.Hashable, EVENT interface{}, EVENT_OPS interface{}, TX_RECEIPT types.Receipt[TX_HASH, BLOCK_HASH], FEE feetypes.Fee, HEAD types.Head[BLOCK_HASH], BATCH_ELEM interface{}] struct { + *mock.Call +} + +// ChainID is a helper method to define mock.On call +// - ctx context.Context +func (_e *mockRPC_Expecter[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) ChainID(ctx interface{}) *mockRPC_ChainID_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + return &mockRPC_ChainID_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]{Call: _e.mock.On("ChainID", ctx)} +} + +func (_c *mockRPC_ChainID_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) Run(run func(ctx context.Context)) *mockRPC_ChainID_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *mockRPC_ChainID_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) Return(_a0 CHAIN_ID, _a1 error) *mockRPC_ChainID_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *mockRPC_ChainID_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) RunAndReturn(run func(context.Context) (CHAIN_ID, error)) *mockRPC_ChainID_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + _c.Call.Return(run) + return _c +} + // ClientVersion provides a mock function with given fields: _a0 func (_m *mockRPC[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) ClientVersion(_a0 context.Context) (string, error) { ret := _m.Called(_a0) @@ -232,11 +453,66 @@ func (_m *mockRPC[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS return r0, r1 } +// mockRPC_ClientVersion_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ClientVersion' +type mockRPC_ClientVersion_Call[CHAIN_ID types.ID, SEQ types.Sequence, ADDR types.Hashable, BLOCK_HASH types.Hashable, TX interface{}, TX_HASH types.Hashable, EVENT interface{}, EVENT_OPS interface{}, TX_RECEIPT types.Receipt[TX_HASH, BLOCK_HASH], FEE feetypes.Fee, HEAD types.Head[BLOCK_HASH], BATCH_ELEM interface{}] struct { + *mock.Call +} + +// ClientVersion is a helper method to define mock.On call +// - _a0 context.Context +func (_e *mockRPC_Expecter[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) ClientVersion(_a0 interface{}) *mockRPC_ClientVersion_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + return &mockRPC_ClientVersion_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]{Call: _e.mock.On("ClientVersion", _a0)} +} + +func (_c *mockRPC_ClientVersion_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) Run(run func(_a0 context.Context)) *mockRPC_ClientVersion_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *mockRPC_ClientVersion_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) Return(_a0 string, _a1 error) *mockRPC_ClientVersion_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *mockRPC_ClientVersion_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) RunAndReturn(run func(context.Context) (string, error)) *mockRPC_ClientVersion_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + _c.Call.Return(run) + return _c +} + // Close provides a mock function with given fields: func (_m *mockRPC[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) Close() { _m.Called() } +// mockRPC_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close' +type mockRPC_Close_Call[CHAIN_ID types.ID, SEQ types.Sequence, ADDR types.Hashable, BLOCK_HASH types.Hashable, TX interface{}, TX_HASH types.Hashable, EVENT interface{}, EVENT_OPS interface{}, TX_RECEIPT types.Receipt[TX_HASH, BLOCK_HASH], FEE feetypes.Fee, HEAD types.Head[BLOCK_HASH], BATCH_ELEM interface{}] struct { + *mock.Call +} + +// Close is a helper method to define mock.On call +func (_e *mockRPC_Expecter[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) Close() *mockRPC_Close_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + return &mockRPC_Close_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]{Call: _e.mock.On("Close")} +} + +func (_c *mockRPC_Close_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) Run(run func()) *mockRPC_Close_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *mockRPC_Close_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) Return() *mockRPC_Close_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + _c.Call.Return() + return _c +} + +func (_c *mockRPC_Close_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) RunAndReturn(run func()) *mockRPC_Close_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + _c.Call.Return(run) + return _c +} + // CodeAt provides a mock function with given fields: ctx, account, blockNumber func (_m *mockRPC[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) CodeAt(ctx context.Context, account ADDR, blockNumber *big.Int) ([]byte, error) { ret := _m.Called(ctx, account, blockNumber) @@ -267,6 +543,36 @@ func (_m *mockRPC[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS return r0, r1 } +// mockRPC_CodeAt_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CodeAt' +type mockRPC_CodeAt_Call[CHAIN_ID types.ID, SEQ types.Sequence, ADDR types.Hashable, BLOCK_HASH types.Hashable, TX interface{}, TX_HASH types.Hashable, EVENT interface{}, EVENT_OPS interface{}, TX_RECEIPT types.Receipt[TX_HASH, BLOCK_HASH], FEE feetypes.Fee, HEAD types.Head[BLOCK_HASH], BATCH_ELEM interface{}] struct { + *mock.Call +} + +// CodeAt is a helper method to define mock.On call +// - ctx context.Context +// - account ADDR +// - blockNumber *big.Int +func (_e *mockRPC_Expecter[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) CodeAt(ctx interface{}, account interface{}, blockNumber interface{}) *mockRPC_CodeAt_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + return &mockRPC_CodeAt_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]{Call: _e.mock.On("CodeAt", ctx, account, blockNumber)} +} + +func (_c *mockRPC_CodeAt_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) Run(run func(ctx context.Context, account ADDR, blockNumber *big.Int)) *mockRPC_CodeAt_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(ADDR), args[2].(*big.Int)) + }) + return _c +} + +func (_c *mockRPC_CodeAt_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) Return(_a0 []byte, _a1 error) *mockRPC_CodeAt_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *mockRPC_CodeAt_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) RunAndReturn(run func(context.Context, ADDR, *big.Int) ([]byte, error)) *mockRPC_CodeAt_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + _c.Call.Return(run) + return _c +} + // Dial provides a mock function with given fields: ctx func (_m *mockRPC[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) Dial(ctx context.Context) error { ret := _m.Called(ctx) @@ -285,6 +591,34 @@ func (_m *mockRPC[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS return r0 } +// mockRPC_Dial_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Dial' +type mockRPC_Dial_Call[CHAIN_ID types.ID, SEQ types.Sequence, ADDR types.Hashable, BLOCK_HASH types.Hashable, TX interface{}, TX_HASH types.Hashable, EVENT interface{}, EVENT_OPS interface{}, TX_RECEIPT types.Receipt[TX_HASH, BLOCK_HASH], FEE feetypes.Fee, HEAD types.Head[BLOCK_HASH], BATCH_ELEM interface{}] struct { + *mock.Call +} + +// Dial is a helper method to define mock.On call +// - ctx context.Context +func (_e *mockRPC_Expecter[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) Dial(ctx interface{}) *mockRPC_Dial_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + return &mockRPC_Dial_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]{Call: _e.mock.On("Dial", ctx)} +} + +func (_c *mockRPC_Dial_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) Run(run func(ctx context.Context)) *mockRPC_Dial_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *mockRPC_Dial_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) Return(_a0 error) *mockRPC_Dial_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + _c.Call.Return(_a0) + return _c +} + +func (_c *mockRPC_Dial_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) RunAndReturn(run func(context.Context) error) *mockRPC_Dial_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + _c.Call.Return(run) + return _c +} + // DialHTTP provides a mock function with given fields: func (_m *mockRPC[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) DialHTTP() error { ret := _m.Called() @@ -303,11 +637,65 @@ func (_m *mockRPC[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS return r0 } +// mockRPC_DialHTTP_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DialHTTP' +type mockRPC_DialHTTP_Call[CHAIN_ID types.ID, SEQ types.Sequence, ADDR types.Hashable, BLOCK_HASH types.Hashable, TX interface{}, TX_HASH types.Hashable, EVENT interface{}, EVENT_OPS interface{}, TX_RECEIPT types.Receipt[TX_HASH, BLOCK_HASH], FEE feetypes.Fee, HEAD types.Head[BLOCK_HASH], BATCH_ELEM interface{}] struct { + *mock.Call +} + +// DialHTTP is a helper method to define mock.On call +func (_e *mockRPC_Expecter[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) DialHTTP() *mockRPC_DialHTTP_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + return &mockRPC_DialHTTP_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]{Call: _e.mock.On("DialHTTP")} +} + +func (_c *mockRPC_DialHTTP_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) Run(run func()) *mockRPC_DialHTTP_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *mockRPC_DialHTTP_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) Return(_a0 error) *mockRPC_DialHTTP_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + _c.Call.Return(_a0) + return _c +} + +func (_c *mockRPC_DialHTTP_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) RunAndReturn(run func() error) *mockRPC_DialHTTP_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + _c.Call.Return(run) + return _c +} + // DisconnectAll provides a mock function with given fields: func (_m *mockRPC[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) DisconnectAll() { _m.Called() } +// mockRPC_DisconnectAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DisconnectAll' +type mockRPC_DisconnectAll_Call[CHAIN_ID types.ID, SEQ types.Sequence, ADDR types.Hashable, BLOCK_HASH types.Hashable, TX interface{}, TX_HASH types.Hashable, EVENT interface{}, EVENT_OPS interface{}, TX_RECEIPT types.Receipt[TX_HASH, BLOCK_HASH], FEE feetypes.Fee, HEAD types.Head[BLOCK_HASH], BATCH_ELEM interface{}] struct { + *mock.Call +} + +// DisconnectAll is a helper method to define mock.On call +func (_e *mockRPC_Expecter[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) DisconnectAll() *mockRPC_DisconnectAll_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + return &mockRPC_DisconnectAll_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]{Call: _e.mock.On("DisconnectAll")} +} + +func (_c *mockRPC_DisconnectAll_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) Run(run func()) *mockRPC_DisconnectAll_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *mockRPC_DisconnectAll_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) Return() *mockRPC_DisconnectAll_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + _c.Call.Return() + return _c +} + +func (_c *mockRPC_DisconnectAll_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) RunAndReturn(run func()) *mockRPC_DisconnectAll_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + _c.Call.Return(run) + return _c +} + // EstimateGas provides a mock function with given fields: ctx, call func (_m *mockRPC[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) EstimateGas(ctx context.Context, call interface{}) (uint64, error) { ret := _m.Called(ctx, call) @@ -336,6 +724,35 @@ func (_m *mockRPC[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS return r0, r1 } +// mockRPC_EstimateGas_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EstimateGas' +type mockRPC_EstimateGas_Call[CHAIN_ID types.ID, SEQ types.Sequence, ADDR types.Hashable, BLOCK_HASH types.Hashable, TX interface{}, TX_HASH types.Hashable, EVENT interface{}, EVENT_OPS interface{}, TX_RECEIPT types.Receipt[TX_HASH, BLOCK_HASH], FEE feetypes.Fee, HEAD types.Head[BLOCK_HASH], BATCH_ELEM interface{}] struct { + *mock.Call +} + +// EstimateGas is a helper method to define mock.On call +// - ctx context.Context +// - call interface{} +func (_e *mockRPC_Expecter[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) EstimateGas(ctx interface{}, call interface{}) *mockRPC_EstimateGas_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + return &mockRPC_EstimateGas_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]{Call: _e.mock.On("EstimateGas", ctx, call)} +} + +func (_c *mockRPC_EstimateGas_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) Run(run func(ctx context.Context, call interface{})) *mockRPC_EstimateGas_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(interface{})) + }) + return _c +} + +func (_c *mockRPC_EstimateGas_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) Return(gas uint64, err error) *mockRPC_EstimateGas_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + _c.Call.Return(gas, err) + return _c +} + +func (_c *mockRPC_EstimateGas_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) RunAndReturn(run func(context.Context, interface{}) (uint64, error)) *mockRPC_EstimateGas_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + _c.Call.Return(run) + return _c +} + // FilterEvents provides a mock function with given fields: ctx, query func (_m *mockRPC[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) FilterEvents(ctx context.Context, query EVENT_OPS) ([]EVENT, error) { ret := _m.Called(ctx, query) @@ -366,6 +783,35 @@ func (_m *mockRPC[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS return r0, r1 } +// mockRPC_FilterEvents_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterEvents' +type mockRPC_FilterEvents_Call[CHAIN_ID types.ID, SEQ types.Sequence, ADDR types.Hashable, BLOCK_HASH types.Hashable, TX interface{}, TX_HASH types.Hashable, EVENT interface{}, EVENT_OPS interface{}, TX_RECEIPT types.Receipt[TX_HASH, BLOCK_HASH], FEE feetypes.Fee, HEAD types.Head[BLOCK_HASH], BATCH_ELEM interface{}] struct { + *mock.Call +} + +// FilterEvents is a helper method to define mock.On call +// - ctx context.Context +// - query EVENT_OPS +func (_e *mockRPC_Expecter[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) FilterEvents(ctx interface{}, query interface{}) *mockRPC_FilterEvents_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + return &mockRPC_FilterEvents_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]{Call: _e.mock.On("FilterEvents", ctx, query)} +} + +func (_c *mockRPC_FilterEvents_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) Run(run func(ctx context.Context, query EVENT_OPS)) *mockRPC_FilterEvents_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(EVENT_OPS)) + }) + return _c +} + +func (_c *mockRPC_FilterEvents_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) Return(_a0 []EVENT, _a1 error) *mockRPC_FilterEvents_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *mockRPC_FilterEvents_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) RunAndReturn(run func(context.Context, EVENT_OPS) ([]EVENT, error)) *mockRPC_FilterEvents_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + _c.Call.Return(run) + return _c +} + // GetInterceptedChainInfo provides a mock function with given fields: func (_m *mockRPC[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) GetInterceptedChainInfo() (ChainInfo, ChainInfo) { ret := _m.Called() @@ -394,6 +840,33 @@ func (_m *mockRPC[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS return r0, r1 } +// mockRPC_GetInterceptedChainInfo_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetInterceptedChainInfo' +type mockRPC_GetInterceptedChainInfo_Call[CHAIN_ID types.ID, SEQ types.Sequence, ADDR types.Hashable, BLOCK_HASH types.Hashable, TX interface{}, TX_HASH types.Hashable, EVENT interface{}, EVENT_OPS interface{}, TX_RECEIPT types.Receipt[TX_HASH, BLOCK_HASH], FEE feetypes.Fee, HEAD types.Head[BLOCK_HASH], BATCH_ELEM interface{}] struct { + *mock.Call +} + +// GetInterceptedChainInfo is a helper method to define mock.On call +func (_e *mockRPC_Expecter[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) GetInterceptedChainInfo() *mockRPC_GetInterceptedChainInfo_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + return &mockRPC_GetInterceptedChainInfo_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]{Call: _e.mock.On("GetInterceptedChainInfo")} +} + +func (_c *mockRPC_GetInterceptedChainInfo_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) Run(run func()) *mockRPC_GetInterceptedChainInfo_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *mockRPC_GetInterceptedChainInfo_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) Return(latest ChainInfo, highestUserObservations ChainInfo) *mockRPC_GetInterceptedChainInfo_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + _c.Call.Return(latest, highestUserObservations) + return _c +} + +func (_c *mockRPC_GetInterceptedChainInfo_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) RunAndReturn(run func() (ChainInfo, ChainInfo)) *mockRPC_GetInterceptedChainInfo_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + _c.Call.Return(run) + return _c +} + // IsSyncing provides a mock function with given fields: ctx func (_m *mockRPC[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) IsSyncing(ctx context.Context) (bool, error) { ret := _m.Called(ctx) @@ -422,6 +895,34 @@ func (_m *mockRPC[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS return r0, r1 } +// mockRPC_IsSyncing_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsSyncing' +type mockRPC_IsSyncing_Call[CHAIN_ID types.ID, SEQ types.Sequence, ADDR types.Hashable, BLOCK_HASH types.Hashable, TX interface{}, TX_HASH types.Hashable, EVENT interface{}, EVENT_OPS interface{}, TX_RECEIPT types.Receipt[TX_HASH, BLOCK_HASH], FEE feetypes.Fee, HEAD types.Head[BLOCK_HASH], BATCH_ELEM interface{}] struct { + *mock.Call +} + +// IsSyncing is a helper method to define mock.On call +// - ctx context.Context +func (_e *mockRPC_Expecter[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) IsSyncing(ctx interface{}) *mockRPC_IsSyncing_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + return &mockRPC_IsSyncing_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]{Call: _e.mock.On("IsSyncing", ctx)} +} + +func (_c *mockRPC_IsSyncing_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) Run(run func(ctx context.Context)) *mockRPC_IsSyncing_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *mockRPC_IsSyncing_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) Return(_a0 bool, _a1 error) *mockRPC_IsSyncing_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *mockRPC_IsSyncing_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) RunAndReturn(run func(context.Context) (bool, error)) *mockRPC_IsSyncing_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + _c.Call.Return(run) + return _c +} + // LINKBalance provides a mock function with given fields: ctx, accountAddress, linkAddress func (_m *mockRPC[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) LINKBalance(ctx context.Context, accountAddress ADDR, linkAddress ADDR) (*assets.Link, error) { ret := _m.Called(ctx, accountAddress, linkAddress) @@ -452,6 +953,36 @@ func (_m *mockRPC[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS return r0, r1 } +// mockRPC_LINKBalance_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LINKBalance' +type mockRPC_LINKBalance_Call[CHAIN_ID types.ID, SEQ types.Sequence, ADDR types.Hashable, BLOCK_HASH types.Hashable, TX interface{}, TX_HASH types.Hashable, EVENT interface{}, EVENT_OPS interface{}, TX_RECEIPT types.Receipt[TX_HASH, BLOCK_HASH], FEE feetypes.Fee, HEAD types.Head[BLOCK_HASH], BATCH_ELEM interface{}] struct { + *mock.Call +} + +// LINKBalance is a helper method to define mock.On call +// - ctx context.Context +// - accountAddress ADDR +// - linkAddress ADDR +func (_e *mockRPC_Expecter[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) LINKBalance(ctx interface{}, accountAddress interface{}, linkAddress interface{}) *mockRPC_LINKBalance_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + return &mockRPC_LINKBalance_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]{Call: _e.mock.On("LINKBalance", ctx, accountAddress, linkAddress)} +} + +func (_c *mockRPC_LINKBalance_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) Run(run func(ctx context.Context, accountAddress ADDR, linkAddress ADDR)) *mockRPC_LINKBalance_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(ADDR), args[2].(ADDR)) + }) + return _c +} + +func (_c *mockRPC_LINKBalance_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) Return(_a0 *assets.Link, _a1 error) *mockRPC_LINKBalance_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *mockRPC_LINKBalance_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) RunAndReturn(run func(context.Context, ADDR, ADDR) (*assets.Link, error)) *mockRPC_LINKBalance_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + _c.Call.Return(run) + return _c +} + // LatestBlockHeight provides a mock function with given fields: _a0 func (_m *mockRPC[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) LatestBlockHeight(_a0 context.Context) (*big.Int, error) { ret := _m.Called(_a0) @@ -482,6 +1013,34 @@ func (_m *mockRPC[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS return r0, r1 } +// mockRPC_LatestBlockHeight_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LatestBlockHeight' +type mockRPC_LatestBlockHeight_Call[CHAIN_ID types.ID, SEQ types.Sequence, ADDR types.Hashable, BLOCK_HASH types.Hashable, TX interface{}, TX_HASH types.Hashable, EVENT interface{}, EVENT_OPS interface{}, TX_RECEIPT types.Receipt[TX_HASH, BLOCK_HASH], FEE feetypes.Fee, HEAD types.Head[BLOCK_HASH], BATCH_ELEM interface{}] struct { + *mock.Call +} + +// LatestBlockHeight is a helper method to define mock.On call +// - _a0 context.Context +func (_e *mockRPC_Expecter[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) LatestBlockHeight(_a0 interface{}) *mockRPC_LatestBlockHeight_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + return &mockRPC_LatestBlockHeight_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]{Call: _e.mock.On("LatestBlockHeight", _a0)} +} + +func (_c *mockRPC_LatestBlockHeight_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) Run(run func(_a0 context.Context)) *mockRPC_LatestBlockHeight_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *mockRPC_LatestBlockHeight_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) Return(_a0 *big.Int, _a1 error) *mockRPC_LatestBlockHeight_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *mockRPC_LatestBlockHeight_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) RunAndReturn(run func(context.Context) (*big.Int, error)) *mockRPC_LatestBlockHeight_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + _c.Call.Return(run) + return _c +} + // LatestFinalizedBlock provides a mock function with given fields: ctx func (_m *mockRPC[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) LatestFinalizedBlock(ctx context.Context) (HEAD, error) { ret := _m.Called(ctx) @@ -510,6 +1069,34 @@ func (_m *mockRPC[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS return r0, r1 } +// mockRPC_LatestFinalizedBlock_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LatestFinalizedBlock' +type mockRPC_LatestFinalizedBlock_Call[CHAIN_ID types.ID, SEQ types.Sequence, ADDR types.Hashable, BLOCK_HASH types.Hashable, TX interface{}, TX_HASH types.Hashable, EVENT interface{}, EVENT_OPS interface{}, TX_RECEIPT types.Receipt[TX_HASH, BLOCK_HASH], FEE feetypes.Fee, HEAD types.Head[BLOCK_HASH], BATCH_ELEM interface{}] struct { + *mock.Call +} + +// LatestFinalizedBlock is a helper method to define mock.On call +// - ctx context.Context +func (_e *mockRPC_Expecter[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) LatestFinalizedBlock(ctx interface{}) *mockRPC_LatestFinalizedBlock_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + return &mockRPC_LatestFinalizedBlock_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]{Call: _e.mock.On("LatestFinalizedBlock", ctx)} +} + +func (_c *mockRPC_LatestFinalizedBlock_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) Run(run func(ctx context.Context)) *mockRPC_LatestFinalizedBlock_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *mockRPC_LatestFinalizedBlock_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) Return(_a0 HEAD, _a1 error) *mockRPC_LatestFinalizedBlock_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *mockRPC_LatestFinalizedBlock_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) RunAndReturn(run func(context.Context) (HEAD, error)) *mockRPC_LatestFinalizedBlock_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + _c.Call.Return(run) + return _c +} + // PendingCallContract provides a mock function with given fields: ctx, msg func (_m *mockRPC[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) PendingCallContract(ctx context.Context, msg interface{}) ([]byte, error) { ret := _m.Called(ctx, msg) @@ -540,6 +1127,35 @@ func (_m *mockRPC[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS return r0, r1 } +// mockRPC_PendingCallContract_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PendingCallContract' +type mockRPC_PendingCallContract_Call[CHAIN_ID types.ID, SEQ types.Sequence, ADDR types.Hashable, BLOCK_HASH types.Hashable, TX interface{}, TX_HASH types.Hashable, EVENT interface{}, EVENT_OPS interface{}, TX_RECEIPT types.Receipt[TX_HASH, BLOCK_HASH], FEE feetypes.Fee, HEAD types.Head[BLOCK_HASH], BATCH_ELEM interface{}] struct { + *mock.Call +} + +// PendingCallContract is a helper method to define mock.On call +// - ctx context.Context +// - msg interface{} +func (_e *mockRPC_Expecter[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) PendingCallContract(ctx interface{}, msg interface{}) *mockRPC_PendingCallContract_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + return &mockRPC_PendingCallContract_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]{Call: _e.mock.On("PendingCallContract", ctx, msg)} +} + +func (_c *mockRPC_PendingCallContract_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) Run(run func(ctx context.Context, msg interface{})) *mockRPC_PendingCallContract_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(interface{})) + }) + return _c +} + +func (_c *mockRPC_PendingCallContract_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) Return(rpcErr []byte, extractErr error) *mockRPC_PendingCallContract_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + _c.Call.Return(rpcErr, extractErr) + return _c +} + +func (_c *mockRPC_PendingCallContract_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) RunAndReturn(run func(context.Context, interface{}) ([]byte, error)) *mockRPC_PendingCallContract_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + _c.Call.Return(run) + return _c +} + // PendingSequenceAt provides a mock function with given fields: ctx, addr func (_m *mockRPC[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) PendingSequenceAt(ctx context.Context, addr ADDR) (SEQ, error) { ret := _m.Called(ctx, addr) @@ -568,6 +1184,35 @@ func (_m *mockRPC[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS return r0, r1 } +// mockRPC_PendingSequenceAt_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PendingSequenceAt' +type mockRPC_PendingSequenceAt_Call[CHAIN_ID types.ID, SEQ types.Sequence, ADDR types.Hashable, BLOCK_HASH types.Hashable, TX interface{}, TX_HASH types.Hashable, EVENT interface{}, EVENT_OPS interface{}, TX_RECEIPT types.Receipt[TX_HASH, BLOCK_HASH], FEE feetypes.Fee, HEAD types.Head[BLOCK_HASH], BATCH_ELEM interface{}] struct { + *mock.Call +} + +// PendingSequenceAt is a helper method to define mock.On call +// - ctx context.Context +// - addr ADDR +func (_e *mockRPC_Expecter[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) PendingSequenceAt(ctx interface{}, addr interface{}) *mockRPC_PendingSequenceAt_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + return &mockRPC_PendingSequenceAt_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]{Call: _e.mock.On("PendingSequenceAt", ctx, addr)} +} + +func (_c *mockRPC_PendingSequenceAt_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) Run(run func(ctx context.Context, addr ADDR)) *mockRPC_PendingSequenceAt_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(ADDR)) + }) + return _c +} + +func (_c *mockRPC_PendingSequenceAt_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) Return(_a0 SEQ, _a1 error) *mockRPC_PendingSequenceAt_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *mockRPC_PendingSequenceAt_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) RunAndReturn(run func(context.Context, ADDR) (SEQ, error)) *mockRPC_PendingSequenceAt_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + _c.Call.Return(run) + return _c +} + // SendEmptyTransaction provides a mock function with given fields: ctx, newTxAttempt, seq, gasLimit, fee, fromAddress func (_m *mockRPC[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) SendEmptyTransaction(ctx context.Context, newTxAttempt func(SEQ, uint32, FEE, ADDR) (interface{}, error), seq SEQ, gasLimit uint32, fee FEE, fromAddress ADDR) (string, error) { ret := _m.Called(ctx, newTxAttempt, seq, gasLimit, fee, fromAddress) @@ -596,6 +1241,39 @@ func (_m *mockRPC[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS return r0, r1 } +// mockRPC_SendEmptyTransaction_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SendEmptyTransaction' +type mockRPC_SendEmptyTransaction_Call[CHAIN_ID types.ID, SEQ types.Sequence, ADDR types.Hashable, BLOCK_HASH types.Hashable, TX interface{}, TX_HASH types.Hashable, EVENT interface{}, EVENT_OPS interface{}, TX_RECEIPT types.Receipt[TX_HASH, BLOCK_HASH], FEE feetypes.Fee, HEAD types.Head[BLOCK_HASH], BATCH_ELEM interface{}] struct { + *mock.Call +} + +// SendEmptyTransaction is a helper method to define mock.On call +// - ctx context.Context +// - newTxAttempt func(SEQ , uint32 , FEE , ADDR)(interface{} , error) +// - seq SEQ +// - gasLimit uint32 +// - fee FEE +// - fromAddress ADDR +func (_e *mockRPC_Expecter[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) SendEmptyTransaction(ctx interface{}, newTxAttempt interface{}, seq interface{}, gasLimit interface{}, fee interface{}, fromAddress interface{}) *mockRPC_SendEmptyTransaction_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + return &mockRPC_SendEmptyTransaction_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]{Call: _e.mock.On("SendEmptyTransaction", ctx, newTxAttempt, seq, gasLimit, fee, fromAddress)} +} + +func (_c *mockRPC_SendEmptyTransaction_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) Run(run func(ctx context.Context, newTxAttempt func(SEQ, uint32, FEE, ADDR) (interface{}, error), seq SEQ, gasLimit uint32, fee FEE, fromAddress ADDR)) *mockRPC_SendEmptyTransaction_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(func(SEQ, uint32, FEE, ADDR) (interface{}, error)), args[2].(SEQ), args[3].(uint32), args[4].(FEE), args[5].(ADDR)) + }) + return _c +} + +func (_c *mockRPC_SendEmptyTransaction_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) Return(txhash string, err error) *mockRPC_SendEmptyTransaction_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + _c.Call.Return(txhash, err) + return _c +} + +func (_c *mockRPC_SendEmptyTransaction_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) RunAndReturn(run func(context.Context, func(SEQ, uint32, FEE, ADDR) (interface{}, error), SEQ, uint32, FEE, ADDR) (string, error)) *mockRPC_SendEmptyTransaction_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + _c.Call.Return(run) + return _c +} + // SendTransaction provides a mock function with given fields: ctx, tx func (_m *mockRPC[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) SendTransaction(ctx context.Context, tx TX) error { ret := _m.Called(ctx, tx) @@ -614,6 +1292,35 @@ func (_m *mockRPC[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS return r0 } +// mockRPC_SendTransaction_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SendTransaction' +type mockRPC_SendTransaction_Call[CHAIN_ID types.ID, SEQ types.Sequence, ADDR types.Hashable, BLOCK_HASH types.Hashable, TX interface{}, TX_HASH types.Hashable, EVENT interface{}, EVENT_OPS interface{}, TX_RECEIPT types.Receipt[TX_HASH, BLOCK_HASH], FEE feetypes.Fee, HEAD types.Head[BLOCK_HASH], BATCH_ELEM interface{}] struct { + *mock.Call +} + +// SendTransaction is a helper method to define mock.On call +// - ctx context.Context +// - tx TX +func (_e *mockRPC_Expecter[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) SendTransaction(ctx interface{}, tx interface{}) *mockRPC_SendTransaction_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + return &mockRPC_SendTransaction_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]{Call: _e.mock.On("SendTransaction", ctx, tx)} +} + +func (_c *mockRPC_SendTransaction_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) Run(run func(ctx context.Context, tx TX)) *mockRPC_SendTransaction_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(TX)) + }) + return _c +} + +func (_c *mockRPC_SendTransaction_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) Return(_a0 error) *mockRPC_SendTransaction_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + _c.Call.Return(_a0) + return _c +} + +func (_c *mockRPC_SendTransaction_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) RunAndReturn(run func(context.Context, TX) error) *mockRPC_SendTransaction_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + _c.Call.Return(run) + return _c +} + // SequenceAt provides a mock function with given fields: ctx, accountAddress, blockNumber func (_m *mockRPC[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) SequenceAt(ctx context.Context, accountAddress ADDR, blockNumber *big.Int) (SEQ, error) { ret := _m.Called(ctx, accountAddress, blockNumber) @@ -642,11 +1349,69 @@ func (_m *mockRPC[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS return r0, r1 } +// mockRPC_SequenceAt_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SequenceAt' +type mockRPC_SequenceAt_Call[CHAIN_ID types.ID, SEQ types.Sequence, ADDR types.Hashable, BLOCK_HASH types.Hashable, TX interface{}, TX_HASH types.Hashable, EVENT interface{}, EVENT_OPS interface{}, TX_RECEIPT types.Receipt[TX_HASH, BLOCK_HASH], FEE feetypes.Fee, HEAD types.Head[BLOCK_HASH], BATCH_ELEM interface{}] struct { + *mock.Call +} + +// SequenceAt is a helper method to define mock.On call +// - ctx context.Context +// - accountAddress ADDR +// - blockNumber *big.Int +func (_e *mockRPC_Expecter[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) SequenceAt(ctx interface{}, accountAddress interface{}, blockNumber interface{}) *mockRPC_SequenceAt_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + return &mockRPC_SequenceAt_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]{Call: _e.mock.On("SequenceAt", ctx, accountAddress, blockNumber)} +} + +func (_c *mockRPC_SequenceAt_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) Run(run func(ctx context.Context, accountAddress ADDR, blockNumber *big.Int)) *mockRPC_SequenceAt_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(ADDR), args[2].(*big.Int)) + }) + return _c +} + +func (_c *mockRPC_SequenceAt_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) Return(_a0 SEQ, _a1 error) *mockRPC_SequenceAt_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *mockRPC_SequenceAt_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) RunAndReturn(run func(context.Context, ADDR, *big.Int) (SEQ, error)) *mockRPC_SequenceAt_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + _c.Call.Return(run) + return _c +} + // SetAliveLoopSub provides a mock function with given fields: _a0 func (_m *mockRPC[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) SetAliveLoopSub(_a0 types.Subscription) { _m.Called(_a0) } +// mockRPC_SetAliveLoopSub_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetAliveLoopSub' +type mockRPC_SetAliveLoopSub_Call[CHAIN_ID types.ID, SEQ types.Sequence, ADDR types.Hashable, BLOCK_HASH types.Hashable, TX interface{}, TX_HASH types.Hashable, EVENT interface{}, EVENT_OPS interface{}, TX_RECEIPT types.Receipt[TX_HASH, BLOCK_HASH], FEE feetypes.Fee, HEAD types.Head[BLOCK_HASH], BATCH_ELEM interface{}] struct { + *mock.Call +} + +// SetAliveLoopSub is a helper method to define mock.On call +// - _a0 types.Subscription +func (_e *mockRPC_Expecter[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) SetAliveLoopSub(_a0 interface{}) *mockRPC_SetAliveLoopSub_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + return &mockRPC_SetAliveLoopSub_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]{Call: _e.mock.On("SetAliveLoopSub", _a0)} +} + +func (_c *mockRPC_SetAliveLoopSub_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) Run(run func(_a0 types.Subscription)) *mockRPC_SetAliveLoopSub_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Subscription)) + }) + return _c +} + +func (_c *mockRPC_SetAliveLoopSub_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) Return() *mockRPC_SetAliveLoopSub_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + _c.Call.Return() + return _c +} + +func (_c *mockRPC_SetAliveLoopSub_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) RunAndReturn(run func(types.Subscription)) *mockRPC_SetAliveLoopSub_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + _c.Call.Return(run) + return _c +} + // SimulateTransaction provides a mock function with given fields: ctx, tx func (_m *mockRPC[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) SimulateTransaction(ctx context.Context, tx TX) error { ret := _m.Called(ctx, tx) @@ -665,6 +1430,35 @@ func (_m *mockRPC[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS return r0 } +// mockRPC_SimulateTransaction_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SimulateTransaction' +type mockRPC_SimulateTransaction_Call[CHAIN_ID types.ID, SEQ types.Sequence, ADDR types.Hashable, BLOCK_HASH types.Hashable, TX interface{}, TX_HASH types.Hashable, EVENT interface{}, EVENT_OPS interface{}, TX_RECEIPT types.Receipt[TX_HASH, BLOCK_HASH], FEE feetypes.Fee, HEAD types.Head[BLOCK_HASH], BATCH_ELEM interface{}] struct { + *mock.Call +} + +// SimulateTransaction is a helper method to define mock.On call +// - ctx context.Context +// - tx TX +func (_e *mockRPC_Expecter[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) SimulateTransaction(ctx interface{}, tx interface{}) *mockRPC_SimulateTransaction_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + return &mockRPC_SimulateTransaction_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]{Call: _e.mock.On("SimulateTransaction", ctx, tx)} +} + +func (_c *mockRPC_SimulateTransaction_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) Run(run func(ctx context.Context, tx TX)) *mockRPC_SimulateTransaction_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(TX)) + }) + return _c +} + +func (_c *mockRPC_SimulateTransaction_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) Return(_a0 error) *mockRPC_SimulateTransaction_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + _c.Call.Return(_a0) + return _c +} + +func (_c *mockRPC_SimulateTransaction_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) RunAndReturn(run func(context.Context, TX) error) *mockRPC_SimulateTransaction_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + _c.Call.Return(run) + return _c +} + // SubscribeNewHead provides a mock function with given fields: ctx, channel func (_m *mockRPC[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) SubscribeNewHead(ctx context.Context, channel chan<- HEAD) (types.Subscription, error) { ret := _m.Called(ctx, channel) @@ -695,6 +1489,169 @@ func (_m *mockRPC[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS return r0, r1 } +// mockRPC_SubscribeNewHead_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SubscribeNewHead' +type mockRPC_SubscribeNewHead_Call[CHAIN_ID types.ID, SEQ types.Sequence, ADDR types.Hashable, BLOCK_HASH types.Hashable, TX interface{}, TX_HASH types.Hashable, EVENT interface{}, EVENT_OPS interface{}, TX_RECEIPT types.Receipt[TX_HASH, BLOCK_HASH], FEE feetypes.Fee, HEAD types.Head[BLOCK_HASH], BATCH_ELEM interface{}] struct { + *mock.Call +} + +// SubscribeNewHead is a helper method to define mock.On call +// - ctx context.Context +// - channel chan<- HEAD +func (_e *mockRPC_Expecter[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) SubscribeNewHead(ctx interface{}, channel interface{}) *mockRPC_SubscribeNewHead_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + return &mockRPC_SubscribeNewHead_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]{Call: _e.mock.On("SubscribeNewHead", ctx, channel)} +} + +func (_c *mockRPC_SubscribeNewHead_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) Run(run func(ctx context.Context, channel chan<- HEAD)) *mockRPC_SubscribeNewHead_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(chan<- HEAD)) + }) + return _c +} + +func (_c *mockRPC_SubscribeNewHead_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) Return(s types.Subscription, err error) *mockRPC_SubscribeNewHead_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + _c.Call.Return(s, err) + return _c +} + +func (_c *mockRPC_SubscribeNewHead_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) RunAndReturn(run func(context.Context, chan<- HEAD) (types.Subscription, error)) *mockRPC_SubscribeNewHead_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + _c.Call.Return(run) + return _c +} + +// SubscribeToFinalizedHeads provides a mock function with given fields: _a0 +func (_m *mockRPC[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) SubscribeToFinalizedHeads(_a0 context.Context) (<-chan HEAD, types.Subscription, error) { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for SubscribeToFinalizedHeads") + } + + var r0 <-chan HEAD + var r1 types.Subscription + var r2 error + if rf, ok := ret.Get(0).(func(context.Context) (<-chan HEAD, types.Subscription, error)); ok { + return rf(_a0) + } + if rf, ok := ret.Get(0).(func(context.Context) <-chan HEAD); ok { + r0 = rf(_a0) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(<-chan HEAD) + } + } + + if rf, ok := ret.Get(1).(func(context.Context) types.Subscription); ok { + r1 = rf(_a0) + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).(types.Subscription) + } + } + + if rf, ok := ret.Get(2).(func(context.Context) error); ok { + r2 = rf(_a0) + } else { + r2 = ret.Error(2) + } + + return r0, r1, r2 +} + +// mockRPC_SubscribeToFinalizedHeads_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SubscribeToFinalizedHeads' +type mockRPC_SubscribeToFinalizedHeads_Call[CHAIN_ID types.ID, SEQ types.Sequence, ADDR types.Hashable, BLOCK_HASH types.Hashable, TX interface{}, TX_HASH types.Hashable, EVENT interface{}, EVENT_OPS interface{}, TX_RECEIPT types.Receipt[TX_HASH, BLOCK_HASH], FEE feetypes.Fee, HEAD types.Head[BLOCK_HASH], BATCH_ELEM interface{}] struct { + *mock.Call +} + +// SubscribeToFinalizedHeads is a helper method to define mock.On call +// - _a0 context.Context +func (_e *mockRPC_Expecter[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) SubscribeToFinalizedHeads(_a0 interface{}) *mockRPC_SubscribeToFinalizedHeads_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + return &mockRPC_SubscribeToFinalizedHeads_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]{Call: _e.mock.On("SubscribeToFinalizedHeads", _a0)} +} + +func (_c *mockRPC_SubscribeToFinalizedHeads_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) Run(run func(_a0 context.Context)) *mockRPC_SubscribeToFinalizedHeads_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *mockRPC_SubscribeToFinalizedHeads_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) Return(_a0 <-chan HEAD, _a1 types.Subscription, _a2 error) *mockRPC_SubscribeToFinalizedHeads_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + _c.Call.Return(_a0, _a1, _a2) + return _c +} + +func (_c *mockRPC_SubscribeToFinalizedHeads_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) RunAndReturn(run func(context.Context) (<-chan HEAD, types.Subscription, error)) *mockRPC_SubscribeToFinalizedHeads_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + _c.Call.Return(run) + return _c +} + +// SubscribeToHeads provides a mock function with given fields: ctx +func (_m *mockRPC[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) SubscribeToHeads(ctx context.Context) (<-chan HEAD, types.Subscription, error) { + ret := _m.Called(ctx) + + if len(ret) == 0 { + panic("no return value specified for SubscribeToHeads") + } + + var r0 <-chan HEAD + var r1 types.Subscription + var r2 error + if rf, ok := ret.Get(0).(func(context.Context) (<-chan HEAD, types.Subscription, error)); ok { + return rf(ctx) + } + if rf, ok := ret.Get(0).(func(context.Context) <-chan HEAD); ok { + r0 = rf(ctx) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(<-chan HEAD) + } + } + + if rf, ok := ret.Get(1).(func(context.Context) types.Subscription); ok { + r1 = rf(ctx) + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).(types.Subscription) + } + } + + if rf, ok := ret.Get(2).(func(context.Context) error); ok { + r2 = rf(ctx) + } else { + r2 = ret.Error(2) + } + + return r0, r1, r2 +} + +// mockRPC_SubscribeToHeads_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SubscribeToHeads' +type mockRPC_SubscribeToHeads_Call[CHAIN_ID types.ID, SEQ types.Sequence, ADDR types.Hashable, BLOCK_HASH types.Hashable, TX interface{}, TX_HASH types.Hashable, EVENT interface{}, EVENT_OPS interface{}, TX_RECEIPT types.Receipt[TX_HASH, BLOCK_HASH], FEE feetypes.Fee, HEAD types.Head[BLOCK_HASH], BATCH_ELEM interface{}] struct { + *mock.Call +} + +// SubscribeToHeads is a helper method to define mock.On call +// - ctx context.Context +func (_e *mockRPC_Expecter[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) SubscribeToHeads(ctx interface{}) *mockRPC_SubscribeToHeads_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + return &mockRPC_SubscribeToHeads_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]{Call: _e.mock.On("SubscribeToHeads", ctx)} +} + +func (_c *mockRPC_SubscribeToHeads_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) Run(run func(ctx context.Context)) *mockRPC_SubscribeToHeads_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *mockRPC_SubscribeToHeads_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) Return(ch <-chan HEAD, sub types.Subscription, err error) *mockRPC_SubscribeToHeads_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + _c.Call.Return(ch, sub, err) + return _c +} + +func (_c *mockRPC_SubscribeToHeads_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) RunAndReturn(run func(context.Context) (<-chan HEAD, types.Subscription, error)) *mockRPC_SubscribeToHeads_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + _c.Call.Return(run) + return _c +} + // SubscribersCount provides a mock function with given fields: func (_m *mockRPC[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) SubscribersCount() int32 { ret := _m.Called() @@ -713,6 +1670,33 @@ func (_m *mockRPC[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS return r0 } +// mockRPC_SubscribersCount_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SubscribersCount' +type mockRPC_SubscribersCount_Call[CHAIN_ID types.ID, SEQ types.Sequence, ADDR types.Hashable, BLOCK_HASH types.Hashable, TX interface{}, TX_HASH types.Hashable, EVENT interface{}, EVENT_OPS interface{}, TX_RECEIPT types.Receipt[TX_HASH, BLOCK_HASH], FEE feetypes.Fee, HEAD types.Head[BLOCK_HASH], BATCH_ELEM interface{}] struct { + *mock.Call +} + +// SubscribersCount is a helper method to define mock.On call +func (_e *mockRPC_Expecter[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) SubscribersCount() *mockRPC_SubscribersCount_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + return &mockRPC_SubscribersCount_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]{Call: _e.mock.On("SubscribersCount")} +} + +func (_c *mockRPC_SubscribersCount_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) Run(run func()) *mockRPC_SubscribersCount_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *mockRPC_SubscribersCount_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) Return(_a0 int32) *mockRPC_SubscribersCount_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + _c.Call.Return(_a0) + return _c +} + +func (_c *mockRPC_SubscribersCount_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) RunAndReturn(run func() int32) *mockRPC_SubscribersCount_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + _c.Call.Return(run) + return _c +} + // TokenBalance provides a mock function with given fields: ctx, accountAddress, tokenAddress func (_m *mockRPC[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) TokenBalance(ctx context.Context, accountAddress ADDR, tokenAddress ADDR) (*big.Int, error) { ret := _m.Called(ctx, accountAddress, tokenAddress) @@ -743,6 +1727,36 @@ func (_m *mockRPC[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS return r0, r1 } +// mockRPC_TokenBalance_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TokenBalance' +type mockRPC_TokenBalance_Call[CHAIN_ID types.ID, SEQ types.Sequence, ADDR types.Hashable, BLOCK_HASH types.Hashable, TX interface{}, TX_HASH types.Hashable, EVENT interface{}, EVENT_OPS interface{}, TX_RECEIPT types.Receipt[TX_HASH, BLOCK_HASH], FEE feetypes.Fee, HEAD types.Head[BLOCK_HASH], BATCH_ELEM interface{}] struct { + *mock.Call +} + +// TokenBalance is a helper method to define mock.On call +// - ctx context.Context +// - accountAddress ADDR +// - tokenAddress ADDR +func (_e *mockRPC_Expecter[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) TokenBalance(ctx interface{}, accountAddress interface{}, tokenAddress interface{}) *mockRPC_TokenBalance_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + return &mockRPC_TokenBalance_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]{Call: _e.mock.On("TokenBalance", ctx, accountAddress, tokenAddress)} +} + +func (_c *mockRPC_TokenBalance_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) Run(run func(ctx context.Context, accountAddress ADDR, tokenAddress ADDR)) *mockRPC_TokenBalance_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(ADDR), args[2].(ADDR)) + }) + return _c +} + +func (_c *mockRPC_TokenBalance_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) Return(_a0 *big.Int, _a1 error) *mockRPC_TokenBalance_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *mockRPC_TokenBalance_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) RunAndReturn(run func(context.Context, ADDR, ADDR) (*big.Int, error)) *mockRPC_TokenBalance_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + _c.Call.Return(run) + return _c +} + // TransactionByHash provides a mock function with given fields: ctx, txHash func (_m *mockRPC[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) TransactionByHash(ctx context.Context, txHash TX_HASH) (TX, error) { ret := _m.Called(ctx, txHash) @@ -771,6 +1785,35 @@ func (_m *mockRPC[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS return r0, r1 } +// mockRPC_TransactionByHash_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TransactionByHash' +type mockRPC_TransactionByHash_Call[CHAIN_ID types.ID, SEQ types.Sequence, ADDR types.Hashable, BLOCK_HASH types.Hashable, TX interface{}, TX_HASH types.Hashable, EVENT interface{}, EVENT_OPS interface{}, TX_RECEIPT types.Receipt[TX_HASH, BLOCK_HASH], FEE feetypes.Fee, HEAD types.Head[BLOCK_HASH], BATCH_ELEM interface{}] struct { + *mock.Call +} + +// TransactionByHash is a helper method to define mock.On call +// - ctx context.Context +// - txHash TX_HASH +func (_e *mockRPC_Expecter[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) TransactionByHash(ctx interface{}, txHash interface{}) *mockRPC_TransactionByHash_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + return &mockRPC_TransactionByHash_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]{Call: _e.mock.On("TransactionByHash", ctx, txHash)} +} + +func (_c *mockRPC_TransactionByHash_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) Run(run func(ctx context.Context, txHash TX_HASH)) *mockRPC_TransactionByHash_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(TX_HASH)) + }) + return _c +} + +func (_c *mockRPC_TransactionByHash_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) Return(_a0 TX, _a1 error) *mockRPC_TransactionByHash_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *mockRPC_TransactionByHash_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) RunAndReturn(run func(context.Context, TX_HASH) (TX, error)) *mockRPC_TransactionByHash_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + _c.Call.Return(run) + return _c +} + // TransactionReceipt provides a mock function with given fields: ctx, txHash func (_m *mockRPC[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) TransactionReceipt(ctx context.Context, txHash TX_HASH) (TX_RECEIPT, error) { ret := _m.Called(ctx, txHash) @@ -799,11 +1842,67 @@ func (_m *mockRPC[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS return r0, r1 } +// mockRPC_TransactionReceipt_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TransactionReceipt' +type mockRPC_TransactionReceipt_Call[CHAIN_ID types.ID, SEQ types.Sequence, ADDR types.Hashable, BLOCK_HASH types.Hashable, TX interface{}, TX_HASH types.Hashable, EVENT interface{}, EVENT_OPS interface{}, TX_RECEIPT types.Receipt[TX_HASH, BLOCK_HASH], FEE feetypes.Fee, HEAD types.Head[BLOCK_HASH], BATCH_ELEM interface{}] struct { + *mock.Call +} + +// TransactionReceipt is a helper method to define mock.On call +// - ctx context.Context +// - txHash TX_HASH +func (_e *mockRPC_Expecter[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) TransactionReceipt(ctx interface{}, txHash interface{}) *mockRPC_TransactionReceipt_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + return &mockRPC_TransactionReceipt_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]{Call: _e.mock.On("TransactionReceipt", ctx, txHash)} +} + +func (_c *mockRPC_TransactionReceipt_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) Run(run func(ctx context.Context, txHash TX_HASH)) *mockRPC_TransactionReceipt_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(TX_HASH)) + }) + return _c +} + +func (_c *mockRPC_TransactionReceipt_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) Return(_a0 TX_RECEIPT, _a1 error) *mockRPC_TransactionReceipt_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *mockRPC_TransactionReceipt_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) RunAndReturn(run func(context.Context, TX_HASH) (TX_RECEIPT, error)) *mockRPC_TransactionReceipt_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + _c.Call.Return(run) + return _c +} + // UnsubscribeAllExceptAliveLoop provides a mock function with given fields: func (_m *mockRPC[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) UnsubscribeAllExceptAliveLoop() { _m.Called() } +// mockRPC_UnsubscribeAllExceptAliveLoop_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UnsubscribeAllExceptAliveLoop' +type mockRPC_UnsubscribeAllExceptAliveLoop_Call[CHAIN_ID types.ID, SEQ types.Sequence, ADDR types.Hashable, BLOCK_HASH types.Hashable, TX interface{}, TX_HASH types.Hashable, EVENT interface{}, EVENT_OPS interface{}, TX_RECEIPT types.Receipt[TX_HASH, BLOCK_HASH], FEE feetypes.Fee, HEAD types.Head[BLOCK_HASH], BATCH_ELEM interface{}] struct { + *mock.Call +} + +// UnsubscribeAllExceptAliveLoop is a helper method to define mock.On call +func (_e *mockRPC_Expecter[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) UnsubscribeAllExceptAliveLoop() *mockRPC_UnsubscribeAllExceptAliveLoop_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + return &mockRPC_UnsubscribeAllExceptAliveLoop_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]{Call: _e.mock.On("UnsubscribeAllExceptAliveLoop")} +} + +func (_c *mockRPC_UnsubscribeAllExceptAliveLoop_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) Run(run func()) *mockRPC_UnsubscribeAllExceptAliveLoop_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *mockRPC_UnsubscribeAllExceptAliveLoop_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) Return() *mockRPC_UnsubscribeAllExceptAliveLoop_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + _c.Call.Return() + return _c +} + +func (_c *mockRPC_UnsubscribeAllExceptAliveLoop_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM]) RunAndReturn(run func()) *mockRPC_UnsubscribeAllExceptAliveLoop_Call[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, BATCH_ELEM] { + _c.Call.Return(run) + return _c +} + // newMockRPC creates a new instance of mockRPC. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func newMockRPC[CHAIN_ID types.ID, SEQ types.Sequence, ADDR types.Hashable, BLOCK_HASH types.Hashable, TX interface{}, TX_HASH types.Hashable, EVENT interface{}, EVENT_OPS interface{}, TX_RECEIPT types.Receipt[TX_HASH, BLOCK_HASH], FEE feetypes.Fee, HEAD types.Head[BLOCK_HASH], BATCH_ELEM interface{}](t interface { diff --git a/common/client/mock_send_only_client_test.go b/common/client/mock_send_only_client_test.go index 606506e657a..a9c9f23b141 100644 --- a/common/client/mock_send_only_client_test.go +++ b/common/client/mock_send_only_client_test.go @@ -14,6 +14,14 @@ type mockSendOnlyClient[CHAIN_ID types.ID] struct { mock.Mock } +type mockSendOnlyClient_Expecter[CHAIN_ID types.ID] struct { + mock *mock.Mock +} + +func (_m *mockSendOnlyClient[CHAIN_ID]) EXPECT() *mockSendOnlyClient_Expecter[CHAIN_ID] { + return &mockSendOnlyClient_Expecter[CHAIN_ID]{mock: &_m.Mock} +} + // ChainID provides a mock function with given fields: _a0 func (_m *mockSendOnlyClient[CHAIN_ID]) ChainID(_a0 context.Context) (CHAIN_ID, error) { ret := _m.Called(_a0) @@ -42,11 +50,66 @@ func (_m *mockSendOnlyClient[CHAIN_ID]) ChainID(_a0 context.Context) (CHAIN_ID, return r0, r1 } +// mockSendOnlyClient_ChainID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ChainID' +type mockSendOnlyClient_ChainID_Call[CHAIN_ID types.ID] struct { + *mock.Call +} + +// ChainID is a helper method to define mock.On call +// - _a0 context.Context +func (_e *mockSendOnlyClient_Expecter[CHAIN_ID]) ChainID(_a0 interface{}) *mockSendOnlyClient_ChainID_Call[CHAIN_ID] { + return &mockSendOnlyClient_ChainID_Call[CHAIN_ID]{Call: _e.mock.On("ChainID", _a0)} +} + +func (_c *mockSendOnlyClient_ChainID_Call[CHAIN_ID]) Run(run func(_a0 context.Context)) *mockSendOnlyClient_ChainID_Call[CHAIN_ID] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *mockSendOnlyClient_ChainID_Call[CHAIN_ID]) Return(_a0 CHAIN_ID, _a1 error) *mockSendOnlyClient_ChainID_Call[CHAIN_ID] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *mockSendOnlyClient_ChainID_Call[CHAIN_ID]) RunAndReturn(run func(context.Context) (CHAIN_ID, error)) *mockSendOnlyClient_ChainID_Call[CHAIN_ID] { + _c.Call.Return(run) + return _c +} + // Close provides a mock function with given fields: func (_m *mockSendOnlyClient[CHAIN_ID]) Close() { _m.Called() } +// mockSendOnlyClient_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close' +type mockSendOnlyClient_Close_Call[CHAIN_ID types.ID] struct { + *mock.Call +} + +// Close is a helper method to define mock.On call +func (_e *mockSendOnlyClient_Expecter[CHAIN_ID]) Close() *mockSendOnlyClient_Close_Call[CHAIN_ID] { + return &mockSendOnlyClient_Close_Call[CHAIN_ID]{Call: _e.mock.On("Close")} +} + +func (_c *mockSendOnlyClient_Close_Call[CHAIN_ID]) Run(run func()) *mockSendOnlyClient_Close_Call[CHAIN_ID] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *mockSendOnlyClient_Close_Call[CHAIN_ID]) Return() *mockSendOnlyClient_Close_Call[CHAIN_ID] { + _c.Call.Return() + return _c +} + +func (_c *mockSendOnlyClient_Close_Call[CHAIN_ID]) RunAndReturn(run func()) *mockSendOnlyClient_Close_Call[CHAIN_ID] { + _c.Call.Return(run) + return _c +} + // DialHTTP provides a mock function with given fields: func (_m *mockSendOnlyClient[CHAIN_ID]) DialHTTP() error { ret := _m.Called() @@ -65,6 +128,33 @@ func (_m *mockSendOnlyClient[CHAIN_ID]) DialHTTP() error { return r0 } +// mockSendOnlyClient_DialHTTP_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DialHTTP' +type mockSendOnlyClient_DialHTTP_Call[CHAIN_ID types.ID] struct { + *mock.Call +} + +// DialHTTP is a helper method to define mock.On call +func (_e *mockSendOnlyClient_Expecter[CHAIN_ID]) DialHTTP() *mockSendOnlyClient_DialHTTP_Call[CHAIN_ID] { + return &mockSendOnlyClient_DialHTTP_Call[CHAIN_ID]{Call: _e.mock.On("DialHTTP")} +} + +func (_c *mockSendOnlyClient_DialHTTP_Call[CHAIN_ID]) Run(run func()) *mockSendOnlyClient_DialHTTP_Call[CHAIN_ID] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *mockSendOnlyClient_DialHTTP_Call[CHAIN_ID]) Return(_a0 error) *mockSendOnlyClient_DialHTTP_Call[CHAIN_ID] { + _c.Call.Return(_a0) + return _c +} + +func (_c *mockSendOnlyClient_DialHTTP_Call[CHAIN_ID]) RunAndReturn(run func() error) *mockSendOnlyClient_DialHTTP_Call[CHAIN_ID] { + _c.Call.Return(run) + return _c +} + // newMockSendOnlyClient creates a new instance of mockSendOnlyClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func newMockSendOnlyClient[CHAIN_ID types.ID](t interface { diff --git a/common/client/mock_send_only_node_test.go b/common/client/mock_send_only_node_test.go index a39df992aef..53077cd49db 100644 --- a/common/client/mock_send_only_node_test.go +++ b/common/client/mock_send_only_node_test.go @@ -14,6 +14,14 @@ type mockSendOnlyNode[CHAIN_ID types.ID, RPC sendOnlyClient[CHAIN_ID]] struct { mock.Mock } +type mockSendOnlyNode_Expecter[CHAIN_ID types.ID, RPC sendOnlyClient[CHAIN_ID]] struct { + mock *mock.Mock +} + +func (_m *mockSendOnlyNode[CHAIN_ID, RPC]) EXPECT() *mockSendOnlyNode_Expecter[CHAIN_ID, RPC] { + return &mockSendOnlyNode_Expecter[CHAIN_ID, RPC]{mock: &_m.Mock} +} + // Close provides a mock function with given fields: func (_m *mockSendOnlyNode[CHAIN_ID, RPC]) Close() error { ret := _m.Called() @@ -32,6 +40,33 @@ func (_m *mockSendOnlyNode[CHAIN_ID, RPC]) Close() error { return r0 } +// mockSendOnlyNode_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close' +type mockSendOnlyNode_Close_Call[CHAIN_ID types.ID, RPC sendOnlyClient[CHAIN_ID]] struct { + *mock.Call +} + +// Close is a helper method to define mock.On call +func (_e *mockSendOnlyNode_Expecter[CHAIN_ID, RPC]) Close() *mockSendOnlyNode_Close_Call[CHAIN_ID, RPC] { + return &mockSendOnlyNode_Close_Call[CHAIN_ID, RPC]{Call: _e.mock.On("Close")} +} + +func (_c *mockSendOnlyNode_Close_Call[CHAIN_ID, RPC]) Run(run func()) *mockSendOnlyNode_Close_Call[CHAIN_ID, RPC] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *mockSendOnlyNode_Close_Call[CHAIN_ID, RPC]) Return(_a0 error) *mockSendOnlyNode_Close_Call[CHAIN_ID, RPC] { + _c.Call.Return(_a0) + return _c +} + +func (_c *mockSendOnlyNode_Close_Call[CHAIN_ID, RPC]) RunAndReturn(run func() error) *mockSendOnlyNode_Close_Call[CHAIN_ID, RPC] { + _c.Call.Return(run) + return _c +} + // ConfiguredChainID provides a mock function with given fields: func (_m *mockSendOnlyNode[CHAIN_ID, RPC]) ConfiguredChainID() CHAIN_ID { ret := _m.Called() @@ -50,6 +85,33 @@ func (_m *mockSendOnlyNode[CHAIN_ID, RPC]) ConfiguredChainID() CHAIN_ID { return r0 } +// mockSendOnlyNode_ConfiguredChainID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ConfiguredChainID' +type mockSendOnlyNode_ConfiguredChainID_Call[CHAIN_ID types.ID, RPC sendOnlyClient[CHAIN_ID]] struct { + *mock.Call +} + +// ConfiguredChainID is a helper method to define mock.On call +func (_e *mockSendOnlyNode_Expecter[CHAIN_ID, RPC]) ConfiguredChainID() *mockSendOnlyNode_ConfiguredChainID_Call[CHAIN_ID, RPC] { + return &mockSendOnlyNode_ConfiguredChainID_Call[CHAIN_ID, RPC]{Call: _e.mock.On("ConfiguredChainID")} +} + +func (_c *mockSendOnlyNode_ConfiguredChainID_Call[CHAIN_ID, RPC]) Run(run func()) *mockSendOnlyNode_ConfiguredChainID_Call[CHAIN_ID, RPC] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *mockSendOnlyNode_ConfiguredChainID_Call[CHAIN_ID, RPC]) Return(_a0 CHAIN_ID) *mockSendOnlyNode_ConfiguredChainID_Call[CHAIN_ID, RPC] { + _c.Call.Return(_a0) + return _c +} + +func (_c *mockSendOnlyNode_ConfiguredChainID_Call[CHAIN_ID, RPC]) RunAndReturn(run func() CHAIN_ID) *mockSendOnlyNode_ConfiguredChainID_Call[CHAIN_ID, RPC] { + _c.Call.Return(run) + return _c +} + // Name provides a mock function with given fields: func (_m *mockSendOnlyNode[CHAIN_ID, RPC]) Name() string { ret := _m.Called() @@ -68,6 +130,33 @@ func (_m *mockSendOnlyNode[CHAIN_ID, RPC]) Name() string { return r0 } +// mockSendOnlyNode_Name_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Name' +type mockSendOnlyNode_Name_Call[CHAIN_ID types.ID, RPC sendOnlyClient[CHAIN_ID]] struct { + *mock.Call +} + +// Name is a helper method to define mock.On call +func (_e *mockSendOnlyNode_Expecter[CHAIN_ID, RPC]) Name() *mockSendOnlyNode_Name_Call[CHAIN_ID, RPC] { + return &mockSendOnlyNode_Name_Call[CHAIN_ID, RPC]{Call: _e.mock.On("Name")} +} + +func (_c *mockSendOnlyNode_Name_Call[CHAIN_ID, RPC]) Run(run func()) *mockSendOnlyNode_Name_Call[CHAIN_ID, RPC] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *mockSendOnlyNode_Name_Call[CHAIN_ID, RPC]) Return(_a0 string) *mockSendOnlyNode_Name_Call[CHAIN_ID, RPC] { + _c.Call.Return(_a0) + return _c +} + +func (_c *mockSendOnlyNode_Name_Call[CHAIN_ID, RPC]) RunAndReturn(run func() string) *mockSendOnlyNode_Name_Call[CHAIN_ID, RPC] { + _c.Call.Return(run) + return _c +} + // RPC provides a mock function with given fields: func (_m *mockSendOnlyNode[CHAIN_ID, RPC]) RPC() RPC { ret := _m.Called() @@ -86,6 +175,33 @@ func (_m *mockSendOnlyNode[CHAIN_ID, RPC]) RPC() RPC { return r0 } +// mockSendOnlyNode_RPC_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RPC' +type mockSendOnlyNode_RPC_Call[CHAIN_ID types.ID, RPC sendOnlyClient[CHAIN_ID]] struct { + *mock.Call +} + +// RPC is a helper method to define mock.On call +func (_e *mockSendOnlyNode_Expecter[CHAIN_ID, RPC]) RPC() *mockSendOnlyNode_RPC_Call[CHAIN_ID, RPC] { + return &mockSendOnlyNode_RPC_Call[CHAIN_ID, RPC]{Call: _e.mock.On("RPC")} +} + +func (_c *mockSendOnlyNode_RPC_Call[CHAIN_ID, RPC]) Run(run func()) *mockSendOnlyNode_RPC_Call[CHAIN_ID, RPC] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *mockSendOnlyNode_RPC_Call[CHAIN_ID, RPC]) Return(_a0 RPC) *mockSendOnlyNode_RPC_Call[CHAIN_ID, RPC] { + _c.Call.Return(_a0) + return _c +} + +func (_c *mockSendOnlyNode_RPC_Call[CHAIN_ID, RPC]) RunAndReturn(run func() RPC) *mockSendOnlyNode_RPC_Call[CHAIN_ID, RPC] { + _c.Call.Return(run) + return _c +} + // Start provides a mock function with given fields: _a0 func (_m *mockSendOnlyNode[CHAIN_ID, RPC]) Start(_a0 context.Context) error { ret := _m.Called(_a0) @@ -104,6 +220,34 @@ func (_m *mockSendOnlyNode[CHAIN_ID, RPC]) Start(_a0 context.Context) error { return r0 } +// mockSendOnlyNode_Start_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Start' +type mockSendOnlyNode_Start_Call[CHAIN_ID types.ID, RPC sendOnlyClient[CHAIN_ID]] struct { + *mock.Call +} + +// Start is a helper method to define mock.On call +// - _a0 context.Context +func (_e *mockSendOnlyNode_Expecter[CHAIN_ID, RPC]) Start(_a0 interface{}) *mockSendOnlyNode_Start_Call[CHAIN_ID, RPC] { + return &mockSendOnlyNode_Start_Call[CHAIN_ID, RPC]{Call: _e.mock.On("Start", _a0)} +} + +func (_c *mockSendOnlyNode_Start_Call[CHAIN_ID, RPC]) Run(run func(_a0 context.Context)) *mockSendOnlyNode_Start_Call[CHAIN_ID, RPC] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *mockSendOnlyNode_Start_Call[CHAIN_ID, RPC]) Return(_a0 error) *mockSendOnlyNode_Start_Call[CHAIN_ID, RPC] { + _c.Call.Return(_a0) + return _c +} + +func (_c *mockSendOnlyNode_Start_Call[CHAIN_ID, RPC]) RunAndReturn(run func(context.Context) error) *mockSendOnlyNode_Start_Call[CHAIN_ID, RPC] { + _c.Call.Return(run) + return _c +} + // State provides a mock function with given fields: func (_m *mockSendOnlyNode[CHAIN_ID, RPC]) State() nodeState { ret := _m.Called() @@ -122,6 +266,33 @@ func (_m *mockSendOnlyNode[CHAIN_ID, RPC]) State() nodeState { return r0 } +// mockSendOnlyNode_State_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'State' +type mockSendOnlyNode_State_Call[CHAIN_ID types.ID, RPC sendOnlyClient[CHAIN_ID]] struct { + *mock.Call +} + +// State is a helper method to define mock.On call +func (_e *mockSendOnlyNode_Expecter[CHAIN_ID, RPC]) State() *mockSendOnlyNode_State_Call[CHAIN_ID, RPC] { + return &mockSendOnlyNode_State_Call[CHAIN_ID, RPC]{Call: _e.mock.On("State")} +} + +func (_c *mockSendOnlyNode_State_Call[CHAIN_ID, RPC]) Run(run func()) *mockSendOnlyNode_State_Call[CHAIN_ID, RPC] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *mockSendOnlyNode_State_Call[CHAIN_ID, RPC]) Return(_a0 nodeState) *mockSendOnlyNode_State_Call[CHAIN_ID, RPC] { + _c.Call.Return(_a0) + return _c +} + +func (_c *mockSendOnlyNode_State_Call[CHAIN_ID, RPC]) RunAndReturn(run func() nodeState) *mockSendOnlyNode_State_Call[CHAIN_ID, RPC] { + _c.Call.Return(run) + return _c +} + // String provides a mock function with given fields: func (_m *mockSendOnlyNode[CHAIN_ID, RPC]) String() string { ret := _m.Called() @@ -140,6 +311,33 @@ func (_m *mockSendOnlyNode[CHAIN_ID, RPC]) String() string { return r0 } +// mockSendOnlyNode_String_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'String' +type mockSendOnlyNode_String_Call[CHAIN_ID types.ID, RPC sendOnlyClient[CHAIN_ID]] struct { + *mock.Call +} + +// String is a helper method to define mock.On call +func (_e *mockSendOnlyNode_Expecter[CHAIN_ID, RPC]) String() *mockSendOnlyNode_String_Call[CHAIN_ID, RPC] { + return &mockSendOnlyNode_String_Call[CHAIN_ID, RPC]{Call: _e.mock.On("String")} +} + +func (_c *mockSendOnlyNode_String_Call[CHAIN_ID, RPC]) Run(run func()) *mockSendOnlyNode_String_Call[CHAIN_ID, RPC] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *mockSendOnlyNode_String_Call[CHAIN_ID, RPC]) Return(_a0 string) *mockSendOnlyNode_String_Call[CHAIN_ID, RPC] { + _c.Call.Return(_a0) + return _c +} + +func (_c *mockSendOnlyNode_String_Call[CHAIN_ID, RPC]) RunAndReturn(run func() string) *mockSendOnlyNode_String_Call[CHAIN_ID, RPC] { + _c.Call.Return(run) + return _c +} + // newMockSendOnlyNode creates a new instance of mockSendOnlyNode. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func newMockSendOnlyNode[CHAIN_ID types.ID, RPC sendOnlyClient[CHAIN_ID]](t interface { diff --git a/common/client/mocks/config.go b/common/client/mocks/config.go index d1007f39f0f..95b57cce0c3 100644 --- a/common/client/mocks/config.go +++ b/common/client/mocks/config.go @@ -3,10 +3,11 @@ package mocks import "time" type ChainConfig struct { - IsFinalityTagEnabled bool - FinalityDepthVal uint32 - NoNewHeadsThresholdVal time.Duration - FinalizedBlockOffsetVal uint32 + IsFinalityTagEnabled bool + FinalityDepthVal uint32 + NoNewHeadsThresholdVal time.Duration + FinalizedBlockOffsetVal uint32 + NoNewFinalizedHeadsThresholdVal time.Duration } func (t ChainConfig) NodeNoNewHeadsThreshold() time.Duration { @@ -24,3 +25,7 @@ func (t ChainConfig) FinalityTagEnabled() bool { func (t ChainConfig) FinalizedBlockOffset() uint32 { return t.FinalizedBlockOffsetVal } + +func (t ChainConfig) NoNewFinalizedHeadsThreshold() time.Duration { + return t.NoNewFinalizedHeadsThresholdVal +} diff --git a/common/client/models.go b/common/client/models.go index 8b616137669..526bb25c887 100644 --- a/common/client/models.go +++ b/common/client/models.go @@ -1,6 +1,7 @@ package client import ( + "bytes" "fmt" ) @@ -74,3 +75,47 @@ func (n NodeTier) String() string { return fmt.Sprintf("NodeTier(%d)", n) } } + +// syncStatus - defines problems related to RPC's state synchronization. Can be used as a bitmask to define multiple issues +type syncStatus int + +const ( + // syncStatusSynced - RPC is fully synced + syncStatusSynced = 0 + // syncStatusNotInSyncWithPool - RPC is lagging behind the highest block observed within the pool of RPCs + syncStatusNotInSyncWithPool syncStatus = 1 << iota + // syncStatusNoNewHead - RPC failed to produce a new head for too long + syncStatusNoNewHead + // syncStatusNoNewFinalizedHead - RPC failed to produce a new finalized head for too long + syncStatusNoNewFinalizedHead + syncStatusLen +) + +func (s syncStatus) String() string { + if s == syncStatusSynced { + return "Synced" + } + var result bytes.Buffer + for i := syncStatusNotInSyncWithPool; i < syncStatusLen; i = i << 1 { + if i&s == 0 { + continue + } + result.WriteString(i.string()) + result.WriteString(",") + } + result.Truncate(result.Len() - 1) + return result.String() +} + +func (s syncStatus) string() string { + switch s { + case syncStatusNotInSyncWithPool: + return "NotInSyncWithRPCPool" + case syncStatusNoNewHead: + return "NoNewHead" + case syncStatusNoNewFinalizedHead: + return "NoNewFinalizedHead" + default: + return fmt.Sprintf("syncStatus(%d)", s) + } +} diff --git a/common/client/models_test.go b/common/client/models_test.go index 2d5dc31b373..a10592c3b68 100644 --- a/common/client/models_test.go +++ b/common/client/models_test.go @@ -3,6 +3,8 @@ package client import ( "strings" "testing" + + "github.com/stretchr/testify/assert" ) func TestSendTxReturnCode_String(t *testing.T) { @@ -14,3 +16,35 @@ func TestSendTxReturnCode_String(t *testing.T) { } } } + +func TestSyncStatus_String(t *testing.T) { + t.Run("All of the statuses have proper string representation", func(t *testing.T) { + for i := syncStatusNotInSyncWithPool; i < syncStatusLen; i <<= 1 { + // ensure that i's string representation is not equal to `syncStatus(%d)` + assert.NotContains(t, i.String(), "syncStatus(") + } + }) + t.Run("Unwraps mask", func(t *testing.T) { + testCases := []struct { + Mask syncStatus + ExpectedStr string + }{ + { + ExpectedStr: "Synced", + }, + { + Mask: syncStatusNotInSyncWithPool | syncStatusNoNewHead, + ExpectedStr: "NotInSyncWithRPCPool,NoNewHead", + }, + { + Mask: syncStatusNotInSyncWithPool | syncStatusNoNewHead | syncStatusNoNewFinalizedHead, + ExpectedStr: "NotInSyncWithRPCPool,NoNewHead,NoNewFinalizedHead", + }, + } + for _, testCase := range testCases { + t.Run(testCase.ExpectedStr, func(t *testing.T) { + assert.Equal(t, testCase.ExpectedStr, testCase.Mask.String()) + }) + } + }) +} diff --git a/common/client/multi_node.go b/common/client/multi_node.go index 4d4ea925fe8..c9250a1d620 100644 --- a/common/client/multi_node.go +++ b/common/client/multi_node.go @@ -15,6 +15,7 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/assets" "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink-common/pkg/services" + feetypes "github.com/smartcontractkit/chainlink/v2/common/fee/types" "github.com/smartcontractkit/chainlink/v2/common/types" ) @@ -821,6 +822,14 @@ func (c *multiNode[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OP return n.RPC().SubscribeNewHead(ctx, channel) } +func (c *multiNode[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, RPC_CLIENT, BATCH_ELEM]) SubscribeToHeads(ctx context.Context) (ch <-chan HEAD, sub types.Subscription, err error) { + n, err := c.selectNode() + if err != nil { + return nil, nil, err + } + return n.RPC().SubscribeToHeads(ctx) +} + func (c *multiNode[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, RPC_CLIENT, BATCH_ELEM]) TokenBalance(ctx context.Context, account ADDR, tokenAddr ADDR) (b *big.Int, err error) { n, err := c.selectNode() if err != nil { diff --git a/common/client/node.go b/common/client/node.go index 7871c622eb4..1f55e69cacc 100644 --- a/common/client/node.go +++ b/common/client/node.go @@ -45,16 +45,17 @@ type NodeConfig interface { FinalizedBlockPollInterval() time.Duration EnforceRepeatableRead() bool DeathDeclarationDelay() time.Duration + NewHeadsPollInterval() time.Duration } type ChainConfig interface { NodeNoNewHeadsThreshold() time.Duration + NoNewFinalizedHeadsThreshold() time.Duration FinalityDepth() uint32 FinalityTagEnabled() bool FinalizedBlockOffset() uint32 } -//go:generate mockery --quiet --name Node --structname mockNode --filename "mock_node_test.go" --inpackage --case=underscore type Node[ CHAIN_ID types.ID, HEAD Head, diff --git a/common/client/node_fsm.go b/common/client/node_fsm.go index 5a5e2554431..e58de071fbc 100644 --- a/common/client/node_fsm.go +++ b/common/client/node_fsm.go @@ -2,7 +2,6 @@ package client import ( "fmt" - "math/big" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promauto" @@ -240,11 +239,11 @@ func (n *node[CHAIN_ID, HEAD, RPC]) transitionToInSync(fn func()) { // declareOutOfSync puts a node into OutOfSync state, disconnecting all current // clients and making it unavailable for use until back in-sync. -func (n *node[CHAIN_ID, HEAD, RPC]) declareOutOfSync(isOutOfSync func(num int64, td *big.Int) bool) { +func (n *node[CHAIN_ID, HEAD, RPC]) declareOutOfSync(syncIssues syncStatus) { n.transitionToOutOfSync(func() { - n.lfcLog.Errorw("RPC Node is out of sync", "nodeState", n.state) + n.lfcLog.Errorw("RPC Node is out of sync", "nodeState", n.state, "syncIssues", syncIssues) n.wg.Add(1) - go n.outOfSyncLoop(isOutOfSync) + go n.outOfSyncLoop(syncIssues) }) } diff --git a/common/client/node_lifecycle.go b/common/client/node_lifecycle.go index 39e17bb4972..40d9a9ef6ef 100644 --- a/common/client/node_lifecycle.go +++ b/common/client/node_lifecycle.go @@ -7,6 +7,8 @@ import ( "math/big" "time" + "github.com/smartcontractkit/chainlink/v2/common/types" + "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promauto" @@ -86,33 +88,37 @@ func (n *node[CHAIN_ID, HEAD, RPC]) aliveLoop() { } noNewHeadsTimeoutThreshold := n.chainCfg.NodeNoNewHeadsThreshold() + noNewFinalizedBlocksTimeoutThreshold := n.chainCfg.NoNewFinalizedHeadsThreshold() pollFailureThreshold := n.nodePoolCfg.PollFailureThreshold() pollInterval := n.nodePoolCfg.PollInterval() lggr := logger.Sugared(n.lfcLog).Named("Alive").With("noNewHeadsTimeoutThreshold", noNewHeadsTimeoutThreshold, "pollInterval", pollInterval, "pollFailureThreshold", pollFailureThreshold) lggr.Tracew("Alive loop starting", "nodeState", n.getCachedState()) - headsC := make(chan HEAD) - sub, err := n.rpc.SubscribeNewHead(ctx, headsC) + headsSub, err := n.registerNewSubscription(ctx, lggr.With("subscriptionType", "heads"), + n.chainCfg.NodeNoNewHeadsThreshold(), n.rpc.SubscribeToHeads) if err != nil { - lggr.Errorw("Initial subscribe for heads failed", "nodeState", n.getCachedState()) + lggr.Errorw("Initial subscribe for heads failed", "nodeState", n.getCachedState(), "err", err) n.declareUnreachable() return } - // TODO: nit fix. If multinode switches primary node before we set sub as AliveSub, sub will be closed and we'll - // falsely transition this node to unreachable state - n.rpc.SetAliveLoopSub(sub) - defer sub.Unsubscribe() - - var outOfSyncT *time.Ticker - var outOfSyncTC <-chan time.Time - if noNewHeadsTimeoutThreshold > 0 { - lggr.Debugw("Head liveness checking enabled", "nodeState", n.getCachedState()) - outOfSyncT = time.NewTicker(noNewHeadsTimeoutThreshold) - defer outOfSyncT.Stop() - outOfSyncTC = outOfSyncT.C - } else { - lggr.Debug("Head liveness checking disabled") + + // TODO: will be removed as part of merging effort with BCI-2875 + n.rpc.SetAliveLoopSub(headsSub.sub) + + defer headsSub.Unsubscribe() + + var finalizedHeadsSub headSubscription[HEAD] + if n.chainCfg.FinalityTagEnabled() { + finalizedHeadsSub, err = n.registerNewSubscription(ctx, lggr.With("subscriptionType", "finalizedHeads"), + n.chainCfg.NoNewFinalizedHeadsThreshold(), n.rpc.SubscribeToFinalizedHeads) + if err != nil { + lggr.Errorw("Failed to subscribe to finalized heads", "err", err) + n.declareUnreachable() + return + } + + defer finalizedHeadsSub.Unsubscribe() } var pollCh <-chan time.Time @@ -131,14 +137,6 @@ func (n *node[CHAIN_ID, HEAD, RPC]) aliveLoop() { lggr.Debug("Polling disabled") } - var pollFinalizedHeadCh <-chan time.Time - if n.chainCfg.FinalityTagEnabled() && n.nodePoolCfg.FinalizedBlockPollInterval() > 0 { - lggr.Debugw("Finalized block polling enabled") - pollT := time.NewTicker(n.nodePoolCfg.FinalizedBlockPollInterval()) - defer pollT.Stop() - pollFinalizedHeadCh = pollT.C - } - localHighestChainInfo, _ := n.rpc.GetInterceptedChainInfo() var pollFailures uint32 @@ -149,7 +147,8 @@ func (n *node[CHAIN_ID, HEAD, RPC]) aliveLoop() { case <-pollCh: promPoolRPCNodePolls.WithLabelValues(n.chainID.String(), n.name).Inc() lggr.Tracew("Polling for version", "nodeState", n.getCachedState(), "pollFailures", pollFailures) - version, err := func(ctx context.Context) (string, error) { + var version string + version, err = func(ctx context.Context) (string, error) { ctx, cancel := context.WithTimeout(ctx, pollInterval) defer cancel() return n.RPC().ClientVersion(ctx) @@ -177,47 +176,33 @@ func (n *node[CHAIN_ID, HEAD, RPC]) aliveLoop() { n.declareUnreachable() return } - _, ci := n.StateAndLatest() - if outOfSync, liveNodes := n.syncStatus(ci.BlockNumber, ci.TotalDifficulty); outOfSync { + _, latestChainInfo := n.StateAndLatest() + if outOfSync, liveNodes := n.isOutOfSyncWithPool(latestChainInfo); outOfSync { // note: there must be another live node for us to be out of sync - lggr.Errorw("RPC endpoint has fallen behind", "blockNumber", ci.BlockNumber, "totalDifficulty", ci.TotalDifficulty, "nodeState", n.getCachedState()) + lggr.Errorw("RPC endpoint has fallen behind", "blockNumber", latestChainInfo.BlockNumber, "totalDifficulty", latestChainInfo.TotalDifficulty, "nodeState", n.getCachedState()) if liveNodes < 2 { lggr.Criticalf("RPC endpoint has fallen behind; %s %s", msgCannotDisable, msgDegradedState) continue } - n.declareOutOfSync(n.isOutOfSync) + n.declareOutOfSync(syncStatusNotInSyncWithPool) return } - case bh, open := <-headsC: + case bh, open := <-headsSub.Heads: if !open { lggr.Errorw("Subscription channel unexpectedly closed", "nodeState", n.getCachedState()) n.declareUnreachable() return } - promPoolRPCNodeNumSeenBlocks.WithLabelValues(n.chainID.String(), n.name).Inc() - lggr.Tracew("Got head", "head", bh) - if bh.BlockNumber() > localHighestChainInfo.BlockNumber { - promPoolRPCNodeHighestSeenBlock.WithLabelValues(n.chainID.String(), n.name).Set(float64(bh.BlockNumber())) - lggr.Tracew("Got higher block number, resetting timer", "latestReceivedBlockNumber", localHighestChainInfo.BlockNumber, "blockNumber", bh.BlockNumber(), "nodeState", n.getCachedState()) - localHighestChainInfo.BlockNumber = bh.BlockNumber() - } else { - lggr.Tracew("Ignoring previously seen block number", "latestReceivedBlockNumber", localHighestChainInfo.BlockNumber, "blockNumber", bh.BlockNumber(), "nodeState", n.getCachedState()) - } - if outOfSyncT != nil { - outOfSyncT.Reset(noNewHeadsTimeoutThreshold) - } - if !n.chainCfg.FinalityTagEnabled() { - latestFinalizedBN := max(bh.BlockNumber()-int64(n.chainCfg.FinalityDepth()), 0) - if latestFinalizedBN > localHighestChainInfo.FinalizedBlockNumber { - promPoolRPCNodeHighestFinalizedBlock.WithLabelValues(n.chainID.String(), n.name).Set(float64(latestFinalizedBN)) - localHighestChainInfo.FinalizedBlockNumber = latestFinalizedBN - } + + receivedNewHead := n.onNewHead(lggr, &localHighestChainInfo, bh) + if receivedNewHead && noNewHeadsTimeoutThreshold > 0 { + headsSub.ResetTimer(noNewHeadsTimeoutThreshold) } - case err := <-sub.Err(): + case err = <-headsSub.Errors: lggr.Errorw("Subscription was terminated", "err", err, "nodeState", n.getCachedState()) n.declareUnreachable() return - case <-outOfSyncTC: + case <-headsSub.NoNewHeads: // We haven't received a head on the channel for at least the // threshold amount of time, mark it broken lggr.Errorw(fmt.Sprintf("RPC endpoint detected out of sync; no new heads received for %s (last head received was %v)", noNewHeadsTimeoutThreshold, localHighestChainInfo.BlockNumber), "nodeState", n.getCachedState(), "latestReceivedBlockNumber", localHighestChainInfo.BlockNumber, "noNewHeadsTimeoutThreshold", noNewHeadsTimeoutThreshold) @@ -226,47 +211,151 @@ func (n *node[CHAIN_ID, HEAD, RPC]) aliveLoop() { lggr.Criticalf("RPC endpoint detected out of sync; %s %s", msgCannotDisable, msgDegradedState) // We don't necessarily want to wait the full timeout to check again, we should // check regularly and log noisily in this state - outOfSyncT.Reset(zombieNodeCheckInterval(noNewHeadsTimeoutThreshold)) + headsSub.ResetTimer(zombieNodeCheckInterval(noNewHeadsTimeoutThreshold)) continue } } - n.declareOutOfSync(func(num int64, td *big.Int) bool { return num < localHighestChainInfo.BlockNumber }) + n.declareOutOfSync(syncStatusNoNewHead) return - case <-pollFinalizedHeadCh: - latestFinalized, err := func(ctx context.Context) (HEAD, error) { - ctx, cancel := context.WithTimeout(ctx, n.nodePoolCfg.FinalizedBlockPollInterval()) - defer cancel() - return n.RPC().LatestFinalizedBlock(ctx) - }(ctx) - if err != nil { - lggr.Warnw("Failed to fetch latest finalized block", "err", err) - continue + case latestFinalized, open := <-finalizedHeadsSub.Heads: + if !open { + lggr.Errorw("Finalized heads subscription channel unexpectedly closed", "nodeState", n.getCachedState()) + n.declareUnreachable() + return } - if !latestFinalized.IsValid() { - lggr.Warn("Latest finalized block is not valid") - continue + receivedNewHead := n.onNewFinalizedHead(lggr, &localHighestChainInfo, latestFinalized) + if receivedNewHead && noNewFinalizedBlocksTimeoutThreshold > 0 { + finalizedHeadsSub.ResetTimer(noNewFinalizedBlocksTimeoutThreshold) } - - latestFinalizedBN := latestFinalized.BlockNumber() - if latestFinalizedBN > localHighestChainInfo.FinalizedBlockNumber { - promPoolRPCNodeHighestFinalizedBlock.WithLabelValues(n.chainID.String(), n.name).Set(float64(latestFinalizedBN)) - localHighestChainInfo.FinalizedBlockNumber = latestFinalizedBN + case <-finalizedHeadsSub.NoNewHeads: + // We haven't received a finalized head on the channel for at least the + // threshold amount of time, mark it broken + lggr.Errorw(fmt.Sprintf("RPC's finalized state is out of sync; no new finalized heads received for %s (last finalized head received was %v)", noNewFinalizedBlocksTimeoutThreshold, localHighestChainInfo.FinalizedBlockNumber), "latestReceivedBlockNumber", localHighestChainInfo.BlockNumber) + if n.poolInfoProvider != nil { + if l, _ := n.poolInfoProvider.LatestChainInfo(); l < 2 { + lggr.Criticalf("RPC's finalized state is out of sync; %s %s", msgCannotDisable, msgDegradedState) + // We don't necessarily want to wait the full timeout to check again, we should + // check regularly and log noisily in this state + finalizedHeadsSub.ResetTimer(zombieNodeCheckInterval(noNewFinalizedBlocksTimeoutThreshold)) + continue + } } + n.declareOutOfSync(syncStatusNoNewFinalizedHead) + return + case <-finalizedHeadsSub.Errors: + lggr.Errorw("Finalized heads subscription was terminated", "err", err) + n.declareUnreachable() + return } } } -func (n *node[CHAIN_ID, HEAD, RPC]) isOutOfSync(num int64, td *big.Int) (outOfSync bool) { - outOfSync, _ = n.syncStatus(num, td) - return +type headSubscription[HEAD any] struct { + Heads <-chan HEAD + Errors <-chan error + NoNewHeads <-chan time.Time + + noNewHeadsTicker *time.Ticker + sub types.Subscription + cleanUpTasks []func() +} + +func (sub *headSubscription[HEAD]) ResetTimer(duration time.Duration) { + sub.noNewHeadsTicker.Reset(duration) +} + +func (sub *headSubscription[HEAD]) Unsubscribe() { + for _, doCleanUp := range sub.cleanUpTasks { + doCleanUp() + } +} + +func (n *node[CHAIN_ID, HEAD, PRC]) registerNewSubscription(ctx context.Context, lggr logger.SugaredLogger, + noNewDataThreshold time.Duration, newSub func(ctx context.Context) (<-chan HEAD, types.Subscription, error)) (headSubscription[HEAD], error) { + result := headSubscription[HEAD]{} + var err error + var sub types.Subscription + result.Heads, sub, err = newSub(ctx) + if err != nil { + return result, err + } + + result.Errors = sub.Err() + lggr.Debug("Successfully subscribed") + + // TODO: will be removed as part of merging effort with BCI-2875 + result.sub = sub + //n.stateMu.Lock() + //n.healthCheckSubs = append(n.healthCheckSubs, sub) + //n.stateMu.Unlock() + + result.cleanUpTasks = append(result.cleanUpTasks, sub.Unsubscribe) + + if noNewDataThreshold > 0 { + lggr.Debugw("Subscription liveness checking enabled") + result.noNewHeadsTicker = time.NewTicker(noNewDataThreshold) + result.NoNewHeads = result.noNewHeadsTicker.C + result.cleanUpTasks = append(result.cleanUpTasks, result.noNewHeadsTicker.Stop) + } else { + lggr.Debug("Subscription liveness checking disabled") + } + + return result, nil } -// syncStatus returns outOfSync true if num or td is more than SyncThresold behind the best node. +func (n *node[CHAIN_ID, HEAD, RPC]) onNewFinalizedHead(lggr logger.SugaredLogger, chainInfo *ChainInfo, latestFinalized HEAD) bool { + if !latestFinalized.IsValid() { + lggr.Warn("Latest finalized block is not valid") + return false + } + + latestFinalizedBN := latestFinalized.BlockNumber() + lggr.Tracew("Got latest finalized head", "latestFinalized", latestFinalized) + if latestFinalizedBN <= chainInfo.FinalizedBlockNumber { + lggr.Tracew("Ignoring previously seen finalized block number") + return false + } + + promPoolRPCNodeHighestFinalizedBlock.WithLabelValues(n.chainID.String(), n.name).Set(float64(latestFinalizedBN)) + chainInfo.FinalizedBlockNumber = latestFinalizedBN + return true +} + +func (n *node[CHAIN_ID, HEAD, RPC]) onNewHead(lggr logger.SugaredLogger, chainInfo *ChainInfo, head HEAD) bool { + if !head.IsValid() { + lggr.Warn("Latest head is not valid") + return false + } + + promPoolRPCNodeNumSeenBlocks.WithLabelValues(n.chainID.String(), n.name).Inc() + lggr.Tracew("Got head", "head", head) + lggr = lggr.With("latestReceivedBlockNumber", chainInfo.BlockNumber, "blockNumber", head.BlockNumber(), "nodeState", n.getCachedState()) + if head.BlockNumber() <= chainInfo.BlockNumber { + lggr.Tracew("Ignoring previously seen block number") + return false + } + + promPoolRPCNodeHighestSeenBlock.WithLabelValues(n.chainID.String(), n.name).Set(float64(head.BlockNumber())) + chainInfo.BlockNumber = head.BlockNumber() + + if !n.chainCfg.FinalityTagEnabled() { + latestFinalizedBN := max(head.BlockNumber()-int64(n.chainCfg.FinalityDepth()), 0) + if latestFinalizedBN > chainInfo.FinalizedBlockNumber { + promPoolRPCNodeHighestFinalizedBlock.WithLabelValues(n.chainID.String(), n.name).Set(float64(latestFinalizedBN)) + chainInfo.FinalizedBlockNumber = latestFinalizedBN + } + } + + return true +} + +// isOutOfSyncWithPool returns outOfSync true if num or td is more than SyncThresold behind the best node. // Always returns outOfSync false for SyncThreshold 0. // liveNodes is only included when outOfSync is true. -func (n *node[CHAIN_ID, HEAD, RPC]) syncStatus(num int64, td *big.Int) (outOfSync bool, liveNodes int) { +func (n *node[CHAIN_ID, HEAD, RPC]) isOutOfSyncWithPool(localState ChainInfo) (outOfSync bool, liveNodes int) { if n.poolInfoProvider == nil { + n.lfcLog.Warn("skipping sync state against the pool - should only occur in tests") return // skip for tests } threshold := n.nodePoolCfg.SyncThreshold() @@ -278,22 +367,23 @@ func (n *node[CHAIN_ID, HEAD, RPC]) syncStatus(num int64, td *big.Int) (outOfSyn mode := n.nodePoolCfg.SelectionMode() switch mode { case NodeSelectionModeHighestHead, NodeSelectionModeRoundRobin, NodeSelectionModePriorityLevel: - return num < ci.BlockNumber-int64(threshold), ln + return localState.BlockNumber < ci.BlockNumber-int64(threshold), ln case NodeSelectionModeTotalDifficulty: bigThreshold := big.NewInt(int64(threshold)) - return td.Cmp(bigmath.Sub(ci.TotalDifficulty, bigThreshold)) < 0, ln + return localState.TotalDifficulty.Cmp(bigmath.Sub(ci.TotalDifficulty, bigThreshold)) < 0, ln default: panic("unrecognized NodeSelectionMode: " + mode) } } const ( - msgReceivedBlock = "Received block for RPC node, waiting until back in-sync to mark as live again" - msgInSync = "RPC node back in sync" + msgReceivedBlock = "Received block for RPC node, waiting until back in-sync to mark as live again" + msgReceivedFinalizedBlock = "Received new finalized block for RPC node, waiting until back in-sync to mark as live again" + msgInSync = "RPC node back in sync" ) // outOfSyncLoop takes an OutOfSync node and waits until isOutOfSync returns false to go back to live status -func (n *node[CHAIN_ID, HEAD, RPC]) outOfSyncLoop(isOutOfSync func(num int64, td *big.Int) bool) { +func (n *node[CHAIN_ID, HEAD, RPC]) outOfSyncLoop(syncIssues syncStatus) { defer n.wg.Done() ctx, cancel := n.newCtx() defer cancel() @@ -312,8 +402,9 @@ func (n *node[CHAIN_ID, HEAD, RPC]) outOfSyncLoop(isOutOfSync func(num int64, td outOfSyncAt := time.Now() - lggr := logger.Sugared(logger.Named(n.lfcLog, "OutOfSync")) - lggr.Debugw("Trying to revive out-of-sync RPC node", "nodeState", n.getCachedState()) + // set logger name to OutOfSync or FinalizedBlockOutOfSync + lggr := logger.Sugared(logger.Named(n.lfcLog, n.getCachedState().String())).With("nodeState", n.getCachedState()) + lggr.Debugw("Trying to revive out-of-sync RPC node") // Need to redial since out-of-sync nodes are automatically disconnected state := n.createVerifiedConn(ctx, lggr) @@ -322,46 +413,118 @@ func (n *node[CHAIN_ID, HEAD, RPC]) outOfSyncLoop(isOutOfSync func(num int64, td return } - lggr.Tracew("Successfully subscribed to heads feed on out-of-sync RPC node", "nodeState", n.getCachedState()) - - ch := make(chan HEAD) - sub, err := n.rpc.SubscribeNewHead(ctx, ch) + noNewHeadsTimeoutThreshold := n.chainCfg.NodeNoNewHeadsThreshold() + headsSub, err := n.registerNewSubscription(ctx, lggr.With("subscriptionType", "heads"), + noNewHeadsTimeoutThreshold, n.rpc.SubscribeToHeads) if err != nil { - lggr.Errorw("Failed to subscribe heads on out-of-sync RPC node", "nodeState", n.getCachedState(), "err", err) + lggr.Errorw("Failed to subscribe heads on out-of-sync RPC node", "err", err) n.declareUnreachable() return } - defer sub.Unsubscribe() + lggr.Tracew("Successfully subscribed to heads feed on out-of-sync RPC node") + defer headsSub.Unsubscribe() + + noNewFinalizedBlocksTimeoutThreshold := n.chainCfg.NoNewFinalizedHeadsThreshold() + var finalizedHeadsSub headSubscription[HEAD] + if n.chainCfg.FinalityTagEnabled() { + finalizedHeadsSub, err = n.registerNewSubscription(ctx, lggr.With("subscriptionType", "finalizedHeads"), + noNewFinalizedBlocksTimeoutThreshold, n.rpc.SubscribeToFinalizedHeads) + if err != nil { + lggr.Errorw("Subscribe to finalized heads failed on out-of-sync RPC node", "err", err) + n.declareUnreachable() + return + } + + lggr.Tracew("Successfully subscribed to finalized heads feed on out-of-sync RPC node") + defer finalizedHeadsSub.Unsubscribe() + } + + _, localHighestChainInfo := n.rpc.GetInterceptedChainInfo() for { + if syncIssues == syncStatusSynced { + // back in-sync! flip back into alive loop + lggr.Infow(fmt.Sprintf("%s: %s. Node was out-of-sync for %s", msgInSync, n.String(), time.Since(outOfSyncAt))) + n.declareInSync() + return + } + select { case <-ctx.Done(): return - case head, open := <-ch: + case head, open := <-headsSub.Heads: if !open { - lggr.Error("Subscription channel unexpectedly closed", "nodeState", n.getCachedState()) + lggr.Errorw("Subscription channel unexpectedly closed", "nodeState", n.getCachedState()) n.declareUnreachable() return } - if !isOutOfSync(head.BlockNumber(), head.BlockDifficulty()) { - // back in-sync! flip back into alive loop - lggr.Infow(fmt.Sprintf("%s: %s. Node was out-of-sync for %s", msgInSync, n.String(), time.Since(outOfSyncAt)), "blockNumber", head.BlockNumber(), "blockDifficulty", head.BlockDifficulty(), "nodeState", n.getCachedState()) - n.declareInSync() - return + + if !n.onNewHead(lggr, &localHighestChainInfo, head) { + continue + } + + // received a new head - clear NoNewHead flag + syncIssues &= ^syncStatusNoNewHead + if outOfSync, _ := n.isOutOfSyncWithPool(localHighestChainInfo); !outOfSync { + // we caught up with the pool - clear NotInSyncWithPool flag + syncIssues &= ^syncStatusNotInSyncWithPool + } else { + // we've received new head, but lagging behind the pool, add NotInSyncWithPool flag to prevent false transition to alive + syncIssues |= syncStatusNotInSyncWithPool + } + + if noNewHeadsTimeoutThreshold > 0 { + headsSub.ResetTimer(noNewHeadsTimeoutThreshold) } - lggr.Debugw(msgReceivedBlock, "blockNumber", head.BlockNumber(), "blockDifficulty", head.BlockDifficulty(), "nodeState", n.getCachedState()) - case <-time.After(zombieNodeCheckInterval(n.chainCfg.NodeNoNewHeadsThreshold())): + + lggr.Debugw(msgReceivedBlock, "blockNumber", head.BlockNumber(), "blockDifficulty", head.BlockDifficulty(), "syncIssues", syncIssues) + case <-time.After(zombieNodeCheckInterval(noNewHeadsTimeoutThreshold)): if n.poolInfoProvider != nil { if l, _ := n.poolInfoProvider.LatestChainInfo(); l < 1 { - lggr.Critical("RPC endpoint is still out of sync, but there are no other available nodes. This RPC node will be forcibly moved back into the live pool in a degraded state") + lggr.Criticalw("RPC endpoint is still out of sync, but there are no other available nodes. This RPC node will be forcibly moved back into the live pool in a degraded state", "syncIssues", syncIssues) n.declareInSync() return } } - case err := <-sub.Err(): - lggr.Errorw("Subscription was terminated", "nodeState", n.getCachedState(), "err", err) + case err := <-headsSub.Errors: + lggr.Errorw("Subscription was terminated", "err", err) + n.declareUnreachable() + return + case <-headsSub.NoNewHeads: + // we are not resetting the timer, as there is no need to add syncStatusNoNewHead until it's removed on new head. + syncIssues |= syncStatusNoNewHead + lggr.Debugw(fmt.Sprintf("No new heads received for %s. Node stays out-of-sync due to sync issues: %s", noNewHeadsTimeoutThreshold, syncIssues)) + case latestFinalized, open := <-finalizedHeadsSub.Heads: + if !open { + lggr.Errorw("Finalized heads subscription channel unexpectedly closed") + n.declareUnreachable() + return + } + if !latestFinalized.IsValid() { + lggr.Warn("Latest finalized block is not valid") + continue + } + + receivedNewHead := n.onNewFinalizedHead(lggr, &localHighestChainInfo, latestFinalized) + if !receivedNewHead { + continue + } + + // on new finalized head remove NoNewFinalizedHead flag from the mask + syncIssues &= ^syncStatusNoNewFinalizedHead + if noNewFinalizedBlocksTimeoutThreshold > 0 { + finalizedHeadsSub.ResetTimer(noNewFinalizedBlocksTimeoutThreshold) + } + + lggr.Debugw(msgReceivedFinalizedBlock, "blockNumber", latestFinalized.BlockNumber(), "syncIssues", syncIssues) + case err := <-finalizedHeadsSub.Errors: + lggr.Errorw("Finalized head subscription was terminated", "err", err) n.declareUnreachable() return + case <-finalizedHeadsSub.NoNewHeads: + // we are not resetting the timer, as there is no need to add syncStatusNoNewFinalizedHead until it's removed on new finalized head. + syncIssues |= syncStatusNoNewFinalizedHead + lggr.Debugw(fmt.Sprintf("No new finalized heads received for %s. Node stays out-of-sync due to sync issues: %s", noNewFinalizedBlocksTimeoutThreshold, syncIssues)) } } } diff --git a/common/client/node_lifecycle_test.go b/common/client/node_lifecycle_test.go index 863a15a1fad..833bccf7f29 100644 --- a/common/client/node_lifecycle_test.go +++ b/common/client/node_lifecycle_test.go @@ -4,6 +4,7 @@ import ( "errors" "fmt" "math/big" + "sync" "sync/atomic" "testing" @@ -49,7 +50,7 @@ func TestUnit_NodeLifecycle_aliveLoop(t *testing.T) { expectedError := errors.New("failed to subscribe to rpc") rpc.On("DisconnectAll").Once() - rpc.On("SubscribeNewHead", mock.Anything, mock.Anything).Return(nil, expectedError).Once() + rpc.On("SubscribeToHeads", mock.Anything).Return(nil, nil, expectedError).Once() // might be called in unreachable loop rpc.On("Dial", mock.Anything).Return(errors.New("failed to dial")).Maybe() node.declareAlive() @@ -74,7 +75,7 @@ func TestUnit_NodeLifecycle_aliveLoop(t *testing.T) { close(errChan) sub.On("Err").Return((<-chan error)(errChan)).Once() sub.On("Unsubscribe").Once() - rpc.On("SubscribeNewHead", mock.Anything, mock.Anything).Return(sub, nil).Once() + rpc.On("SubscribeToHeads", mock.Anything).Return(nil, sub, nil).Once() rpc.On("SetAliveLoopSub", sub).Once() // disconnects all on transfer to unreachable rpc.On("DisconnectAll").Once() @@ -89,7 +90,7 @@ func TestUnit_NodeLifecycle_aliveLoop(t *testing.T) { sub := mocks.NewSubscription(t) sub.On("Err").Return((<-chan error)(nil)) sub.On("Unsubscribe").Once() - opts.rpc.On("SubscribeNewHead", mock.Anything, mock.Anything).Return(sub, nil).Once() + opts.rpc.On("SubscribeToHeads", mock.Anything).Return(make(<-chan Head), sub, nil) opts.rpc.On("SetAliveLoopSub", sub).Once() return newDialedNode(t, opts) } @@ -105,7 +106,7 @@ func TestUnit_NodeLifecycle_aliveLoop(t *testing.T) { }) defer func() { assert.NoError(t, node.close()) }() node.declareAlive() - tests.AssertLogEventually(t, observedLogs, "Head liveness checking disabled") + tests.AssertLogEventually(t, observedLogs, "Subscription liveness checking disabled") tests.AssertLogEventually(t, observedLogs, "Polling disabled") assert.Equal(t, nodeStateAlive, node.State()) }) @@ -340,18 +341,21 @@ func TestUnit_NodeLifecycle_aliveLoop(t *testing.T) { tests.AssertLogEventually(t, observedLogs, fmt.Sprintf("RPC endpoint detected out of sync; %s %s", msgCannotDisable, msgDegradedState)) assert.Equal(t, nodeStateAlive, node.State()) }) - t.Run("rpc closed head channel", func(t *testing.T) { - t.Parallel() - rpc := newMockNodeClient[types.ID, Head](t) - rpc.On("GetInterceptedChainInfo").Return(ChainInfo{}, ChainInfo{}).Once() + newSub := func(t *testing.T) *mocks.Subscription { sub := mocks.NewSubscription(t) sub.On("Err").Return((<-chan error)(nil)) sub.On("Unsubscribe").Once() - rpc.On("SubscribeNewHead", mock.Anything, mock.Anything).Run(func(args mock.Arguments) { - ch := args.Get(1).(chan<- Head) + return sub + } + t.Run("rpc closed head channel", func(t *testing.T) { + t.Parallel() + rpc := newMockNodeClient[types.ID, Head](t) + ch := make(chan Head) + rpc.On("SubscribeToHeads", mock.Anything).Run(func(args mock.Arguments) { close(ch) - }).Return(sub, nil).Once() - rpc.On("SetAliveLoopSub", sub).Once() + }).Return((<-chan Head)(ch), newSub(t), nil).Once() + rpc.On("SetAliveLoopSub", mock.Anything).Once() + rpc.On("GetInterceptedChainInfo").Return(ChainInfo{}, ChainInfo{}).Once() lggr, observedLogs := logger.TestObserved(t, zap.ErrorLevel) node := newDialedNode(t, testNodeOpts{ lggr: lggr, @@ -380,10 +384,10 @@ func TestUnit_NodeLifecycle_aliveLoop(t *testing.T) { const finalityDepth = 10 const expectedBlock = 990 rpc.On("GetInterceptedChainInfo").Return(ChainInfo{}, ChainInfo{}).Once() - rpc.On("SubscribeNewHead", mock.Anything, mock.Anything).Run(func(args mock.Arguments) { - ch := args.Get(1).(chan<- Head) + ch := make(chan Head) + rpc.On("SubscribeToHeads", mock.Anything).Run(func(args mock.Arguments) { go writeHeads(t, ch, head{BlockNumber: blockNumber - 1}, head{BlockNumber: blockNumber}, head{BlockNumber: blockNumber - 1}) - }).Return(sub, nil).Once() + }).Return((<-chan Head)(ch), sub, nil).Once() rpc.On("SetAliveLoopSub", sub).Once() name := "node-" + rand.Str(5) node := newDialedNode(t, testNodeOpts{ @@ -403,18 +407,13 @@ func TestUnit_NodeLifecycle_aliveLoop(t *testing.T) { return float64(expectedBlock) == m.Gauge.GetValue() }) }) - t.Run("Logs warning if failed to get finalized block", func(t *testing.T) { + t.Run("If fails to subscribe to latest finalized blocks, transitions to unreachable ", func(t *testing.T) { t.Parallel() rpc := newMockNodeClient[types.ID, Head](t) - rpc.On("GetInterceptedChainInfo").Return(ChainInfo{}, ChainInfo{}).Once() - rpc.On("LatestFinalizedBlock", mock.Anything).Return(newMockHead(t), errors.New("failed to get finalized block")) - sub := mocks.NewSubscription(t) - sub.On("Err").Return((<-chan error)(nil)) - sub.On("Unsubscribe").Once() - rpc.On("SubscribeNewHead", mock.Anything, mock.Anything).Return(sub, nil).Once() - rpc.On("SetAliveLoopSub", sub).Once() + expectedError := errors.New("failed to subscribe to finalized heads") + rpc.On("SubscribeToFinalizedHeads", mock.Anything).Return(nil, mocks.NewSubscription(t), expectedError).Once() lggr, observedLogs := logger.TestObserved(t, zap.DebugLevel) - node := newDialedNode(t, testNodeOpts{ + node := newSubscribedNode(t, testNodeOpts{ config: testNodeConfig{ finalizedBlockPollInterval: tests.TestInterval, }, @@ -425,26 +424,31 @@ func TestUnit_NodeLifecycle_aliveLoop(t *testing.T) { lggr: lggr, }) defer func() { assert.NoError(t, node.close()) }() + // disconnects all on transfer to unreachable or outOfSync + rpc.On("DisconnectAll").Once() + // might be called in unreachable loop + rpc.On("Dial", mock.Anything).Return(errors.New("failed to dial")).Maybe() node.declareAlive() - tests.AssertLogEventually(t, observedLogs, "Failed to fetch latest finalized block") + tests.AssertLogEventually(t, observedLogs, "Failed to subscribe to finalized heads") + tests.AssertEventually(t, func() bool { + return nodeStateUnreachable == node.State() + }) }) t.Run("Logs warning if latest finalized block is not valid", func(t *testing.T) { t.Parallel() rpc := newMockNodeClient[types.ID, Head](t) + ch := make(chan Head, 1) head := newMockHead(t) head.On("IsValid").Return(false) - rpc.On("LatestFinalizedBlock", mock.Anything).Return(head, nil) + rpc.On("SubscribeToFinalizedHeads", mock.Anything).Run(func(args mock.Arguments) { + ch <- head + }).Return((<-chan Head)(ch), newSub(t), nil).Once() rpc.On("GetInterceptedChainInfo").Return(ChainInfo{}, ChainInfo{}).Once() - sub := mocks.NewSubscription(t) - sub.On("Err").Return((<-chan error)(nil)) - sub.On("Unsubscribe").Once() - rpc.On("SubscribeNewHead", mock.Anything, mock.Anything).Return(sub, nil).Once() - rpc.On("SetAliveLoopSub", sub).Once() + rpc.On("SubscribeToHeads", mock.Anything).Return(make(<-chan Head), newSub(t), nil).Once() + rpc.On("SetAliveLoopSub", mock.Anything).Once() lggr, observedLogs := logger.TestObserved(t, zap.DebugLevel) node := newDialedNode(t, testNodeOpts{ - config: testNodeConfig{ - finalizedBlockPollInterval: tests.TestInterval, - }, + config: testNodeConfig{}, chainConfig: clientMocks.ChainConfig{ IsFinalityTagEnabled: true, }, @@ -455,29 +459,17 @@ func TestUnit_NodeLifecycle_aliveLoop(t *testing.T) { node.declareAlive() tests.AssertLogEventually(t, observedLogs, "Latest finalized block is not valid") }) - t.Run("If finality tag and finalized block polling are enabled updates latest finalized block metric", func(t *testing.T) { + t.Run("On new finalized block updates corresponding metric", func(t *testing.T) { t.Parallel() rpc := newMockNodeClient[types.ID, Head](t) const expectedBlock = 1101 const finalityDepth = 10 - rpc.On("LatestFinalizedBlock", mock.Anything).Return(head{BlockNumber: expectedBlock - 1}.ToMockHead(t), nil).Once() - rpc.On("LatestFinalizedBlock", mock.Anything).Return(head{BlockNumber: expectedBlock}.ToMockHead(t), nil) - sub := mocks.NewSubscription(t) - sub.On("Err").Return((<-chan error)(nil)) - sub.On("Unsubscribe").Once() - rpc.On("SubscribeNewHead", mock.Anything, mock.Anything).Run(func(args mock.Arguments) { - ch := args.Get(1).(chan<- Head) - // ensure that "calculated" finalized head is larger than actual, to ensure we are correctly setting - // the metric - go writeHeads(t, ch, head{BlockNumber: expectedBlock*2 + finalityDepth}) - }).Return(sub, nil).Once() + ch := make(chan Head) + rpc.On("SubscribeToFinalizedHeads", mock.Anything).Return((<-chan Head)(ch), newSub(t), nil).Once() rpc.On("GetInterceptedChainInfo").Return(ChainInfo{}, ChainInfo{}).Once() - rpc.On("SetAliveLoopSub", sub).Once() name := "node-" + rand.Str(5) - node := newDialedNode(t, testNodeOpts{ - config: testNodeConfig{ - finalizedBlockPollInterval: tests.TestInterval, - }, + node := newSubscribedNode(t, testNodeOpts{ + config: testNodeConfig{}, chainConfig: clientMocks.ChainConfig{ FinalityDepthVal: finalityDepth, IsFinalityTagEnabled: true, @@ -488,6 +480,12 @@ func TestUnit_NodeLifecycle_aliveLoop(t *testing.T) { }) defer func() { assert.NoError(t, node.close()) }() node.declareAlive() + var wg sync.WaitGroup + wg.Add(1) + go func() { + defer wg.Done() + writeHeads(t, ch, head{BlockNumber: expectedBlock - 1}, head{BlockNumber: expectedBlock}, head{BlockNumber: expectedBlock - 1}) + }() tests.AssertEventually(t, func() bool { metric, err := promPoolRPCNodeHighestFinalizedBlock.GetMetricWithLabelValues(big.NewInt(1).String(), name) require.NoError(t, err) @@ -496,6 +494,123 @@ func TestUnit_NodeLifecycle_aliveLoop(t *testing.T) { return float64(expectedBlock) == m.Gauge.GetValue() }) }) + t.Run("If finalized heads channel is closed, transitions to unreachable", func(t *testing.T) { + t.Parallel() + rpc := newMockNodeClient[types.ID, Head](t) + rpc.On("GetInterceptedChainInfo").Return(ChainInfo{}, ChainInfo{}).Once() + ch := make(chan Head) + close(ch) + rpc.On("SubscribeToFinalizedHeads", mock.Anything).Return((<-chan Head)(ch), newSub(t), nil).Once() + lggr, observedLogs := logger.TestObserved(t, zap.DebugLevel) + node := newSubscribedNode(t, testNodeOpts{ + chainConfig: clientMocks.ChainConfig{ + IsFinalityTagEnabled: true, + }, + rpc: rpc, + lggr: lggr, + }) + defer func() { assert.NoError(t, node.close()) }() + // disconnects all on transfer to unreachable or outOfSync + rpc.On("DisconnectAll").Once() + // might be called in unreachable loop + rpc.On("Dial", mock.Anything).Return(errors.New("failed to dial")).Maybe() + node.declareAlive() + tests.AssertLogEventually(t, observedLogs, "Finalized heads subscription channel unexpectedly closed") + tests.AssertEventually(t, func() bool { + return nodeStateUnreachable == node.State() + }) + }) + t.Run("when no new finalized heads received for threshold, transitions to out of sync", func(t *testing.T) { + t.Parallel() + rpc := newMockNodeClient[types.ID, Head](t) + rpc.On("GetInterceptedChainInfo").Return(ChainInfo{}, ChainInfo{}).Once() + ch := make(chan Head, 1) + ch <- head{BlockNumber: 10}.ToMockHead(t) + rpc.On("SubscribeToFinalizedHeads", mock.Anything).Return((<-chan Head)(ch), newSub(t), nil).Once() + lggr, observed := logger.TestObserved(t, zap.DebugLevel) + noNewFinalizedHeadsThreshold := tests.TestInterval + node := newSubscribedNode(t, testNodeOpts{ + config: testNodeConfig{}, + chainConfig: clientMocks.ChainConfig{ + NoNewFinalizedHeadsThresholdVal: noNewFinalizedHeadsThreshold, + IsFinalityTagEnabled: true, + }, + rpc: rpc, + lggr: lggr, + }) + defer func() { assert.NoError(t, node.close()) }() + // tries to redial in outOfSync + rpc.On("Dial", mock.Anything).Return(errors.New("failed to dial")).Run(func(_ mock.Arguments) { + assert.Equal(t, nodeStateOutOfSync, node.State()) + }).Once() + // disconnects all on transfer to unreachable or outOfSync + rpc.On("DisconnectAll").Maybe() + // might be called in unreachable loop + rpc.On("Dial", mock.Anything).Return(errors.New("failed to dial")).Maybe() + node.declareAlive() + tests.AssertLogEventually(t, observed, fmt.Sprintf("RPC's finalized state is out of sync; no new finalized heads received for %s (last finalized head received was 10)", noNewFinalizedHeadsThreshold)) + tests.AssertEventually(t, func() bool { + // right after outOfSync we'll transfer to unreachable due to returned error on Dial + // we check that we were in out of sync state on first Dial call + return node.State() == nodeStateUnreachable + }) + }) + t.Run("when no new finalized heads received for threshold but we are the last live node, forcibly stays alive", func(t *testing.T) { + t.Parallel() + rpc := newMockNodeClient[types.ID, Head](t) + rpc.On("GetInterceptedChainInfo").Return(ChainInfo{}, ChainInfo{}).Once() + rpc.On("SubscribeToFinalizedHeads", mock.Anything).Return(make(<-chan Head), newSub(t), nil).Once() + lggr, observed := logger.TestObserved(t, zap.DebugLevel) + noNewFinalizedHeadsThreshold := tests.TestInterval + node := newSubscribedNode(t, testNodeOpts{ + config: testNodeConfig{}, + chainConfig: clientMocks.ChainConfig{ + NoNewFinalizedHeadsThresholdVal: noNewFinalizedHeadsThreshold, + IsFinalityTagEnabled: true, + }, + rpc: rpc, + lggr: lggr, + }) + defer func() { assert.NoError(t, node.close()) }() + poolInfo := newMockPoolChainInfoProvider(t) + poolInfo.On("LatestChainInfo").Return(1, ChainInfo{ + BlockNumber: 20, + TotalDifficulty: big.NewInt(10), + }).Once() + node.SetPoolChainInfoProvider(poolInfo) + node.declareAlive() + tests.AssertLogEventually(t, observed, fmt.Sprintf("RPC's finalized state is out of sync; %s %s", msgCannotDisable, msgDegradedState)) + assert.Equal(t, nodeStateAlive, node.State()) + }) + t.Run("If finalized subscription returns an error, transitions to unreachable", func(t *testing.T) { + t.Parallel() + rpc := newMockNodeClient[types.ID, Head](t) + rpc.On("DisconnectAll").Once() + rpc.On("GetInterceptedChainInfo").Return(ChainInfo{}, ChainInfo{}).Once() + sub := mocks.NewSubscription(t) + errCh := make(chan error, 1) + errCh <- errors.New("subscription failed") + sub.On("Err").Return((<-chan error)(errCh)) + sub.On("Unsubscribe").Once() + rpc.On("SubscribeToFinalizedHeads", mock.Anything).Return((<-chan Head)(nil), sub, nil).Once() + lggr, observedLogs := logger.TestObserved(t, zap.DebugLevel) + node := newSubscribedNode(t, testNodeOpts{ + chainConfig: clientMocks.ChainConfig{ + IsFinalityTagEnabled: true, + }, + rpc: rpc, + lggr: lggr, + }) + defer func() { assert.NoError(t, node.close()) }() + // disconnects all on transfer to unreachable or outOfSync + // might be called in unreachable loop + rpc.On("Dial", mock.Anything).Return(errors.New("failed to dial")).Maybe() + node.declareAlive() + tests.AssertLogEventually(t, observedLogs, "Finalized heads subscription was terminated") + tests.AssertEventually(t, func() bool { + return nodeStateUnreachable == node.State() + }) + }) } type head struct { @@ -525,9 +640,10 @@ func writeHeads(t *testing.T, ch chan<- Head, heads ...head) { func setupRPCForAliveLoop(t *testing.T, rpc *mockNodeClient[types.ID, Head]) { rpc.On("Dial", mock.Anything).Return(nil).Maybe() aliveSubscription := mocks.NewSubscription(t) - aliveSubscription.On("Err").Return((<-chan error)(nil)).Maybe() + aliveSubscription.On("Err").Return(nil).Maybe() aliveSubscription.On("Unsubscribe").Maybe() - rpc.On("SubscribeNewHead", mock.Anything, mock.Anything).Return(aliveSubscription, nil).Maybe() + rpc.On("SubscribeToHeads", mock.Anything).Return(make(<-chan Head), aliveSubscription, nil).Maybe() + rpc.On("SubscribeToFinalizedHeads", mock.Anything).Return(make(<-chan Head), aliveSubscription, nil).Maybe() rpc.On("SetAliveLoopSub", mock.Anything).Maybe() rpc.On("GetInterceptedChainInfo").Return(ChainInfo{}, ChainInfo{}).Maybe() } @@ -544,22 +660,18 @@ func TestUnit_NodeLifecycle_outOfSyncLoop(t *testing.T) { return node } - stubIsOutOfSync := func(num int64, td *big.Int) bool { - return false - } - t.Run("returns on closed", func(t *testing.T) { t.Parallel() node := newTestNode(t, testNodeOpts{}) node.setState(nodeStateClosed) node.wg.Add(1) - node.outOfSyncLoop(stubIsOutOfSync) + node.outOfSyncLoop(syncStatusNotInSyncWithPool) }) t.Run("on old blocks stays outOfSync and returns on close", func(t *testing.T) { t.Parallel() rpc := newMockNodeClient[types.ID, Head](t) nodeChainID := types.RandomID() - lggr, observedLogs := logger.TestObserved(t, zap.DebugLevel) + lggr := logger.Test(t) node := newAliveNode(t, testNodeOpts{ rpc: rpc, chainID: nodeChainID, @@ -569,21 +681,27 @@ func TestUnit_NodeLifecycle_outOfSyncLoop(t *testing.T) { rpc.On("Dial", mock.Anything).Return(nil).Once() rpc.On("ChainID", mock.Anything).Return(nodeChainID, nil).Once() + rpc.On("GetInterceptedChainInfo").Return(ChainInfo{BlockNumber: 0}, ChainInfo{BlockNumber: 13}).Once() outOfSyncSubscription := mocks.NewSubscription(t) outOfSyncSubscription.On("Err").Return((<-chan error)(nil)) outOfSyncSubscription.On("Unsubscribe").Once() heads := []head{{BlockNumber: 7}, {BlockNumber: 11}, {BlockNumber: 13}} - rpc.On("SubscribeNewHead", mock.Anything, mock.Anything).Run(func(args mock.Arguments) { - ch := args.Get(1).(chan<- Head) - go writeHeads(t, ch, heads...) - }).Return(outOfSyncSubscription, nil).Once() + ch := make(chan Head) + var wg sync.WaitGroup + wg.Add(1) + rpc.On("SubscribeToHeads", mock.Anything).Run(func(args mock.Arguments) { + go func() { + defer wg.Done() + writeHeads(t, ch, heads...) + }() + }).Return((<-chan Head)(ch), outOfSyncSubscription, nil).Once() + rpc.On("Dial", mock.Anything).Return(errors.New("failed to redial")).Maybe() - node.declareOutOfSync(func(num int64, td *big.Int) bool { - return true - }) - tests.AssertLogCountEventually(t, observedLogs, msgReceivedBlock, len(heads)) + node.declareOutOfSync(syncStatusNoNewHead) + // wait until all heads are consumed + wg.Wait() assert.Equal(t, nodeStateOutOfSync, node.State()) }) t.Run("if initial dial fails, transitions to unreachable", func(t *testing.T) { @@ -597,7 +715,7 @@ func TestUnit_NodeLifecycle_outOfSyncLoop(t *testing.T) { expectedError := errors.New("failed to dial rpc") // might be called again in unreachable loop, so no need to set once rpc.On("Dial", mock.Anything).Return(expectedError) - node.declareOutOfSync(stubIsOutOfSync) + node.declareOutOfSync(syncStatusNoNewHead) tests.AssertEventually(t, func() bool { return node.State() == nodeStateUnreachable }) @@ -617,7 +735,7 @@ func TestUnit_NodeLifecycle_outOfSyncLoop(t *testing.T) { expectedError := errors.New("failed to get chain ID") // might be called multiple times rpc.On("ChainID", mock.Anything).Return(types.NewIDFromInt(0), expectedError) - node.declareOutOfSync(stubIsOutOfSync) + node.declareOutOfSync(syncStatusNoNewHead) tests.AssertEventually(t, func() bool { return node.State() == nodeStateUnreachable }) @@ -637,7 +755,7 @@ func TestUnit_NodeLifecycle_outOfSyncLoop(t *testing.T) { rpc.On("Dial", mock.Anything).Return(nil).Twice() // might be called multiple times rpc.On("ChainID", mock.Anything).Return(rpcChainID, nil) - node.declareOutOfSync(stubIsOutOfSync) + node.declareOutOfSync(syncStatusNoNewHead) tests.AssertEventually(t, func() bool { return node.State() == nodeStateInvalidChainID }) @@ -657,7 +775,7 @@ func TestUnit_NodeLifecycle_outOfSyncLoop(t *testing.T) { rpc.On("ChainID", mock.Anything).Return(nodeChainID, nil) // might be called multiple times rpc.On("IsSyncing", mock.Anything).Return(true, nil) - node.declareOutOfSync(stubIsOutOfSync) + node.declareOutOfSync(syncStatusNoNewHead) tests.AssertEventually(t, func() bool { return node.State() == nodeStateSyncing }) @@ -680,7 +798,7 @@ func TestUnit_NodeLifecycle_outOfSyncLoop(t *testing.T) { rpc.On("ChainID", mock.Anything).Return(nodeChainID, nil).Once() // might be called multiple times rpc.On("IsSyncing", mock.Anything).Return(false, errors.New("failed to check syncing")) - node.declareOutOfSync(stubIsOutOfSync) + node.declareOutOfSync(syncStatusNoNewHead) tests.AssertEventually(t, func() bool { return node.State() == nodeStateUnreachable }) @@ -698,9 +816,9 @@ func TestUnit_NodeLifecycle_outOfSyncLoop(t *testing.T) { rpc.On("Dial", mock.Anything).Return(nil).Once() rpc.On("ChainID", mock.Anything).Return(nodeChainID, nil).Once() expectedError := errors.New("failed to subscribe") - rpc.On("SubscribeNewHead", mock.Anything, mock.Anything).Return(nil, expectedError) + rpc.On("SubscribeToHeads", mock.Anything).Return(nil, nil, expectedError).Once() rpc.On("Dial", mock.Anything).Return(errors.New("failed to redial")).Maybe() - node.declareOutOfSync(stubIsOutOfSync) + node.declareOutOfSync(syncStatusNoNewHead) tests.AssertEventually(t, func() bool { return node.State() == nodeStateUnreachable }) @@ -719,15 +837,15 @@ func TestUnit_NodeLifecycle_outOfSyncLoop(t *testing.T) { rpc.On("Dial", mock.Anything).Return(nil).Once() rpc.On("ChainID", mock.Anything).Return(nodeChainID, nil).Once() - + rpc.On("GetInterceptedChainInfo").Return(ChainInfo{}, ChainInfo{}).Once() sub := mocks.NewSubscription(t) errChan := make(chan error, 1) errChan <- errors.New("subscription was terminate") sub.On("Err").Return((<-chan error)(errChan)) sub.On("Unsubscribe").Once() - rpc.On("SubscribeNewHead", mock.Anything, mock.Anything).Return(sub, nil).Once() + rpc.On("SubscribeToHeads", mock.Anything).Return(make(<-chan Head), sub, nil).Once() rpc.On("Dial", mock.Anything).Return(errors.New("failed to redial")).Maybe() - node.declareOutOfSync(stubIsOutOfSync) + node.declareOutOfSync(syncStatusNoNewHead) tests.AssertLogEventually(t, observedLogs, "Subscription was terminated") tests.AssertEventually(t, func() bool { return node.State() == nodeStateUnreachable @@ -747,22 +865,22 @@ func TestUnit_NodeLifecycle_outOfSyncLoop(t *testing.T) { rpc.On("Dial", mock.Anything).Return(nil).Once() rpc.On("ChainID", mock.Anything).Return(nodeChainID, nil).Once() + rpc.On("GetInterceptedChainInfo").Return(ChainInfo{}, ChainInfo{}).Once() sub := mocks.NewSubscription(t) sub.On("Err").Return((<-chan error)(nil)) sub.On("Unsubscribe").Once() - rpc.On("SubscribeNewHead", mock.Anything, mock.Anything).Run(func(args mock.Arguments) { - ch := args.Get(1).(chan<- Head) + ch := make(chan Head) + rpc.On("SubscribeToHeads", mock.Anything).Run(func(args mock.Arguments) { close(ch) - }).Return(sub, nil).Once() + }).Return((<-chan Head)(ch), sub, nil).Once() rpc.On("Dial", mock.Anything).Return(errors.New("failed to redial")).Maybe() - node.declareOutOfSync(stubIsOutOfSync) + node.declareOutOfSync(syncStatusNoNewHead) tests.AssertLogEventually(t, observedLogs, "Subscription channel unexpectedly closed") tests.AssertEventually(t, func() bool { return node.State() == nodeStateUnreachable }) }) - t.Run("becomes alive if it receives a newer head", func(t *testing.T) { t.Parallel() rpc := newMockNodeClient[types.ID, Head](t) @@ -782,17 +900,14 @@ func TestUnit_NodeLifecycle_outOfSyncLoop(t *testing.T) { outOfSyncSubscription.On("Err").Return((<-chan error)(nil)) outOfSyncSubscription.On("Unsubscribe").Once() const highestBlock = 1000 - rpc.On("SubscribeNewHead", mock.Anything, mock.Anything).Run(func(args mock.Arguments) { - ch := args.Get(1).(chan<- Head) - go writeHeads(t, ch, head{BlockNumber: highestBlock - 1}, head{BlockNumber: highestBlock}) - }).Return(outOfSyncSubscription, nil).Once() + ch := make(chan Head) + rpc.On("SubscribeToHeads", mock.Anything).Run(func(args mock.Arguments) { + go writeHeads(t, ch, head{BlockNumber: highestBlock - 1}, head{BlockNumber: highestBlock}, head{BlockNumber: highestBlock + 1}) + }).Return((<-chan Head)(ch), outOfSyncSubscription, nil).Once() rpc.On("GetInterceptedChainInfo").Return(ChainInfo{BlockNumber: highestBlock}, ChainInfo{BlockNumber: highestBlock}) - setupRPCForAliveLoop(t, rpc) - node.declareOutOfSync(func(num int64, td *big.Int) bool { - return num < highestBlock - }) + node.declareOutOfSync(syncStatusNoNewHead) tests.AssertLogEventually(t, observedLogs, msgReceivedBlock) tests.AssertLogEventually(t, observedLogs, msgInSync) tests.AssertEventually(t, func() bool { @@ -819,7 +934,7 @@ func TestUnit_NodeLifecycle_outOfSyncLoop(t *testing.T) { TotalDifficulty: big.NewInt(200), }) node.SetPoolChainInfoProvider(poolInfo) - rpc.On("GetInterceptedChainInfo").Return(ChainInfo{BlockNumber: 0}, ChainInfo{BlockNumber: 0}) + rpc.On("GetInterceptedChainInfo").Return(ChainInfo{}, ChainInfo{}) rpc.On("Dial", mock.Anything).Return(nil).Once() rpc.On("ChainID", mock.Anything).Return(nodeChainID, nil).Once() @@ -827,16 +942,225 @@ func TestUnit_NodeLifecycle_outOfSyncLoop(t *testing.T) { outOfSyncSubscription := mocks.NewSubscription(t) outOfSyncSubscription.On("Err").Return((<-chan error)(nil)) outOfSyncSubscription.On("Unsubscribe").Once() - rpc.On("SubscribeNewHead", mock.Anything, mock.Anything).Return(outOfSyncSubscription, nil).Once() - + rpc.On("SubscribeToHeads", mock.Anything).Return(make(<-chan Head), outOfSyncSubscription, nil).Once() setupRPCForAliveLoop(t, rpc) - node.declareOutOfSync(stubIsOutOfSync) + node.declareOutOfSync(syncStatusNoNewHead) tests.AssertLogEventually(t, observedLogs, "RPC endpoint is still out of sync, but there are no other available nodes. This RPC node will be forcibly moved back into the live pool in a degraded state") tests.AssertEventually(t, func() bool { return node.State() == nodeStateAlive }) }) + t.Run("Stays out-of-sync if received new head, but lags behind pool", func(t *testing.T) { + t.Parallel() + rpc := newMockNodeClient[types.ID, Head](t) + nodeChainID := types.RandomID() + lggr, observedLogs := logger.TestObserved(t, zap.DebugLevel) + node := newAliveNode(t, testNodeOpts{ + chainConfig: clientMocks.ChainConfig{ + NoNewHeadsThresholdVal: tests.TestInterval, + }, + config: testNodeConfig{ + syncThreshold: 1, + selectionMode: NodeSelectionModeHighestHead, + }, + rpc: rpc, + chainID: nodeChainID, + lggr: lggr, + }) + defer func() { assert.NoError(t, node.close()) }() + poolInfo := newMockPoolChainInfoProvider(t) + const highestBlock = 20 + poolInfo.On("LatestChainInfo").Return(1, ChainInfo{ + BlockNumber: highestBlock * 2, + TotalDifficulty: big.NewInt(200), + }) + node.SetPoolChainInfoProvider(poolInfo) + rpc.On("GetInterceptedChainInfo").Return(ChainInfo{}, ChainInfo{BlockNumber: highestBlock}) + + rpc.On("Dial", mock.Anything).Return(nil).Once() + rpc.On("ChainID", mock.Anything).Return(nodeChainID, nil).Once() + + outOfSyncSubscription := mocks.NewSubscription(t) + outOfSyncSubscription.On("Err").Return((<-chan error)(nil)) + outOfSyncSubscription.On("Unsubscribe").Once() + ch := make(chan Head) + rpc.On("SubscribeToHeads", mock.Anything).Run(func(args mock.Arguments) { + go writeHeads(t, ch, head{BlockNumber: highestBlock - 1}, head{BlockNumber: highestBlock}, head{BlockNumber: highestBlock + 1}) + }).Return((<-chan Head)(ch), outOfSyncSubscription, nil).Once() + + node.declareOutOfSync(syncStatusNoNewHead) + tests.AssertLogEventually(t, observedLogs, msgReceivedBlock) + tests.AssertLogEventually(t, observedLogs, "No new heads received for") + tests.AssertEventually(t, func() bool { + return node.State() == nodeStateOutOfSync + }) + }) + + // creates RPC mock with all calls necessary to create heads subscription that won't produce any events + newRPCWithNoOpHeads := func(t *testing.T, chainID types.ID) *mockNodeClient[types.ID, Head] { + rpc := newMockNodeClient[types.ID, Head](t) + rpc.On("Dial", mock.Anything).Return(nil).Once() + rpc.On("ChainID", mock.Anything).Return(chainID, nil).Once() + sub := mocks.NewSubscription(t) + sub.On("Err").Return((<-chan error)(nil)) + sub.On("Unsubscribe").Once() + rpc.On("SubscribeToHeads", mock.Anything).Return(make(<-chan Head), sub, nil).Once() + return rpc + } + + t.Run("if fails to subscribe to finalized, becomes unreachable", func(t *testing.T) { + t.Parallel() + nodeChainID := types.RandomID() + rpc := newRPCWithNoOpHeads(t, nodeChainID) + node := newAliveNode(t, testNodeOpts{ + rpc: rpc, + chainID: nodeChainID, + chainConfig: clientMocks.ChainConfig{ + IsFinalityTagEnabled: true, + }, + }) + defer func() { assert.NoError(t, node.close()) }() + + rpc.On("SubscribeToFinalizedHeads", mock.Anything).Return((<-chan Head)(nil), nil, errors.New("failed to subscribe")).Once() + // unreachable + rpc.On("Dial", mock.Anything).Return(errors.New("failed to redial")).Maybe() + + node.declareOutOfSync(syncStatusNoNewHead) + tests.AssertEventually(t, func() bool { + return node.State() == nodeStateUnreachable + }) + }) + t.Run("on subscription termination becomes unreachable", func(t *testing.T) { + t.Parallel() + nodeChainID := types.RandomID() + rpc := newRPCWithNoOpHeads(t, nodeChainID) + lggr, observedLogs := logger.TestObserved(t, zap.ErrorLevel) + node := newAliveNode(t, testNodeOpts{ + rpc: rpc, + chainID: nodeChainID, + lggr: lggr, + chainConfig: clientMocks.ChainConfig{ + IsFinalityTagEnabled: true, + }, + }) + defer func() { assert.NoError(t, node.close()) }() + + sub := mocks.NewSubscription(t) + errChan := make(chan error, 1) + errChan <- errors.New("subscription was terminate") + sub.On("Err").Return((<-chan error)(errChan)) + sub.On("Unsubscribe").Once() + rpc.On("SubscribeToFinalizedHeads", mock.Anything).Return(make(<-chan Head), sub, nil).Once() + rpc.On("GetInterceptedChainInfo").Return(ChainInfo{}, ChainInfo{}).Once() + // unreachable + rpc.On("Dial", mock.Anything).Return(errors.New("failed to redial")).Maybe() + node.declareOutOfSync(syncStatusNoNewHead) + tests.AssertLogEventually(t, observedLogs, "Finalized head subscription was terminated") + tests.AssertEventually(t, func() bool { + return node.State() == nodeStateUnreachable + }) + }) + t.Run("becomes unreachable if head channel is closed", func(t *testing.T) { + t.Parallel() + nodeChainID := types.RandomID() + rpc := newRPCWithNoOpHeads(t, nodeChainID) + lggr, observedLogs := logger.TestObserved(t, zap.ErrorLevel) + node := newAliveNode(t, testNodeOpts{ + rpc: rpc, + chainID: nodeChainID, + lggr: lggr, + chainConfig: clientMocks.ChainConfig{ + IsFinalityTagEnabled: true, + }, + }) + defer func() { assert.NoError(t, node.close()) }() + + sub := mocks.NewSubscription(t) + sub.On("Err").Return((<-chan error)(nil)) + sub.On("Unsubscribe").Once() + ch := make(chan Head) + rpc.On("SubscribeToFinalizedHeads", mock.Anything).Run(func(args mock.Arguments) { + close(ch) + }).Return((<-chan Head)(ch), sub, nil).Once() + rpc.On("GetInterceptedChainInfo").Return(ChainInfo{}, ChainInfo{}).Once() + // unreachable + rpc.On("Dial", mock.Anything).Return(errors.New("failed to redial")).Maybe() + node.declareOutOfSync(syncStatusNoNewHead) + tests.AssertLogEventually(t, observedLogs, "Finalized heads subscription channel unexpectedly closed") + tests.AssertEventually(t, func() bool { + return node.State() == nodeStateUnreachable + }) + }) + t.Run("becomes alive on new finalized block", func(t *testing.T) { + t.Parallel() + nodeChainID := types.RandomID() + rpc := newRPCWithNoOpHeads(t, nodeChainID) + lggr := logger.Test(t) + node := newAliveNode(t, testNodeOpts{ + rpc: rpc, + chainID: nodeChainID, + lggr: lggr, + chainConfig: clientMocks.ChainConfig{ + IsFinalityTagEnabled: true, + NoNewFinalizedHeadsThresholdVal: tests.TestInterval, + }, + }) + defer func() { assert.NoError(t, node.close()) }() + + const highestBlock = 13 + rpc.On("GetInterceptedChainInfo").Return(ChainInfo{}, ChainInfo{FinalizedBlockNumber: highestBlock}).Once() + + outOfSyncSubscription := mocks.NewSubscription(t) + outOfSyncSubscription.On("Err").Return((<-chan error)(nil)) + outOfSyncSubscription.On("Unsubscribe").Once() + ch := make(chan Head) + rpc.On("SubscribeToFinalizedHeads", mock.Anything).Return((<-chan Head)(ch), outOfSyncSubscription, nil).Once() + + setupRPCForAliveLoop(t, rpc) + + node.declareOutOfSync(syncStatusNoNewFinalizedHead) + heads := []head{{BlockNumber: highestBlock - 1}, {BlockNumber: highestBlock}} + writeHeads(t, ch, heads...) + assert.Equal(t, nodeStateOutOfSync, node.State()) + writeHeads(t, ch, head{BlockNumber: highestBlock + 1}) + tests.AssertEventually(t, func() bool { + return node.State() == nodeStateAlive + }) + }) + t.Run("adds finalized block is not increasing flag, if there is no new finalized heads for too long", func(t *testing.T) { + t.Parallel() + nodeChainID := types.RandomID() + rpc := newRPCWithNoOpHeads(t, nodeChainID) + lggr, observed := logger.TestObserved(t, zap.DebugLevel) + const noNewFinalizedHeads = tests.TestInterval + node := newAliveNode(t, testNodeOpts{ + rpc: rpc, + chainID: nodeChainID, + lggr: lggr, + chainConfig: clientMocks.ChainConfig{ + IsFinalityTagEnabled: true, + NoNewFinalizedHeadsThresholdVal: noNewFinalizedHeads, + }, + }) + defer func() { assert.NoError(t, node.close()) }() + + const highestBlock = 13 + rpc.On("GetInterceptedChainInfo").Return(ChainInfo{}, ChainInfo{FinalizedBlockNumber: highestBlock}).Once() + + outOfSyncSubscription := mocks.NewSubscription(t) + outOfSyncSubscription.On("Err").Return((<-chan error)(nil)) + outOfSyncSubscription.On("Unsubscribe").Once() + ch := make(chan Head) + rpc.On("SubscribeToFinalizedHeads", mock.Anything).Return((<-chan Head)(ch), outOfSyncSubscription, nil).Once() + + node.declareOutOfSync(syncStatusNotInSyncWithPool) + heads := []head{{BlockNumber: highestBlock - 1}, {BlockNumber: highestBlock}} + writeHeads(t, ch, heads...) + assert.Equal(t, nodeStateOutOfSync, node.State()) + tests.AssertLogEventually(t, observed, fmt.Sprintf("No new finalized heads received for %s. Node stays "+ + "out-of-sync due to sync issues: NotInSyncWithRPCPool,NoNewFinalizedHead", noNewFinalizedHeads)) + }) } func TestUnit_NodeLifecycle_unreachableLoop(t *testing.T) { @@ -1296,11 +1620,11 @@ func TestUnit_NodeLifecycle_start(t *testing.T) { }) } -func TestUnit_NodeLifecycle_syncStatus(t *testing.T) { +func TestUnit_NodeLifecycle_outOfSyncWithPool(t *testing.T) { t.Parallel() t.Run("skip if nLiveNodes is not configured", func(t *testing.T) { node := newTestNode(t, testNodeOpts{}) - outOfSync, liveNodes := node.syncStatus(0, nil) + outOfSync, liveNodes := node.isOutOfSyncWithPool(ChainInfo{}) assert.Equal(t, false, outOfSync) assert.Equal(t, 0, liveNodes) }) @@ -1308,7 +1632,7 @@ func TestUnit_NodeLifecycle_syncStatus(t *testing.T) { node := newTestNode(t, testNodeOpts{}) poolInfo := newMockPoolChainInfoProvider(t) node.SetPoolChainInfoProvider(poolInfo) - outOfSync, liveNodes := node.syncStatus(0, nil) + outOfSync, liveNodes := node.isOutOfSyncWithPool(ChainInfo{}) assert.Equal(t, false, outOfSync) assert.Equal(t, 0, liveNodes) }) @@ -1320,7 +1644,7 @@ func TestUnit_NodeLifecycle_syncStatus(t *testing.T) { poolInfo.On("LatestChainInfo").Return(1, ChainInfo{}).Once() node.SetPoolChainInfoProvider(poolInfo) assert.Panics(t, func() { - _, _ = node.syncStatus(0, nil) + _, _ = node.isOutOfSyncWithPool(ChainInfo{}) }) }) t.Run("block height selection mode", func(t *testing.T) { @@ -1371,7 +1695,7 @@ func TestUnit_NodeLifecycle_syncStatus(t *testing.T) { for _, td := range []int64{totalDifficulty - syncThreshold - 1, totalDifficulty - syncThreshold, totalDifficulty, totalDifficulty + 1} { for _, testCase := range testCases { t.Run(fmt.Sprintf("%s: SelectionModeVal: %s: total difficulty: %d", testCase.name, selectionMode, td), func(t *testing.T) { - outOfSync, liveNodes := node.syncStatus(testCase.blockNumber, big.NewInt(td)) + outOfSync, liveNodes := node.isOutOfSyncWithPool(ChainInfo{BlockNumber: testCase.blockNumber, TotalDifficulty: big.NewInt(td)}) assert.Equal(t, nodesNum, liveNodes) assert.Equal(t, testCase.outOfSync, outOfSync) }) @@ -1427,7 +1751,7 @@ func TestUnit_NodeLifecycle_syncStatus(t *testing.T) { for _, hb := range []int64{highestBlock - syncThreshold - 1, highestBlock - syncThreshold, highestBlock, highestBlock + 1} { for _, testCase := range testCases { t.Run(fmt.Sprintf("%s: SelectionModeVal: %s: highest block: %d", testCase.name, NodeSelectionModeTotalDifficulty, hb), func(t *testing.T) { - outOfSync, liveNodes := node.syncStatus(hb, big.NewInt(testCase.totalDifficulty)) + outOfSync, liveNodes := node.isOutOfSyncWithPool(ChainInfo{BlockNumber: hb, TotalDifficulty: big.NewInt(testCase.totalDifficulty)}) assert.Equal(t, nodesNum, liveNodes) assert.Equal(t, testCase.outOfSync, outOfSync) }) diff --git a/common/client/node_selector.go b/common/client/node_selector.go index 45604ebe8d9..4aae3734eea 100644 --- a/common/client/node_selector.go +++ b/common/client/node_selector.go @@ -13,7 +13,6 @@ const ( NodeSelectionModePriorityLevel = "PriorityLevel" ) -//go:generate mockery --quiet --name NodeSelector --structname mockNodeSelector --filename "mock_node_selector_test.go" --inpackage --case=underscore type NodeSelector[ CHAIN_ID types.ID, HEAD Head, diff --git a/common/client/node_test.go b/common/client/node_test.go index 3b971e84902..66bb50fc94f 100644 --- a/common/client/node_test.go +++ b/common/client/node_test.go @@ -20,6 +20,11 @@ type testNodeConfig struct { enforceRepeatableRead bool finalizedBlockPollInterval time.Duration deathDeclarationDelay time.Duration + newHeadsPollInterval time.Duration +} + +func (n testNodeConfig) NewHeadsPollInterval() time.Duration { + return n.newHeadsPollInterval } func (n testNodeConfig) PollFailureThreshold() uint32 { diff --git a/common/client/poller.go b/common/client/poller.go index d6080722c5c..eeb6c3af576 100644 --- a/common/client/poller.go +++ b/common/client/poller.go @@ -2,7 +2,6 @@ package client import ( "context" - "sync" "time" "github.com/smartcontractkit/chainlink-common/pkg/logger" @@ -15,83 +14,80 @@ import ( // and delivers the result to a channel. It is used by multinode to poll // for new heads and implements the Subscription interface. type Poller[T any] struct { - services.StateMachine + services.Service + eng *services.Engine + pollingInterval time.Duration pollingFunc func(ctx context.Context) (T, error) pollingTimeout time.Duration - logger logger.Logger channel chan<- T errCh chan error - - stopCh services.StopChan - wg sync.WaitGroup } // NewPoller creates a new Poller instance and returns a channel to receive the polled data func NewPoller[ T any, -](pollingInterval time.Duration, pollingFunc func(ctx context.Context) (T, error), pollingTimeout time.Duration, logger logger.Logger) (Poller[T], <-chan T) { +](pollingInterval time.Duration, pollingFunc func(ctx context.Context) (T, error), pollingTimeout time.Duration, lggr logger.Logger) (Poller[T], <-chan T) { channel := make(chan T) - return Poller[T]{ + p := Poller[T]{ pollingInterval: pollingInterval, pollingFunc: pollingFunc, pollingTimeout: pollingTimeout, channel: channel, - logger: logger, errCh: make(chan error), - stopCh: make(chan struct{}), - }, channel + } + p.Service, p.eng = services.Config{ + Name: "Poller", + Start: p.start, + Close: p.close, + }.NewServiceEngine(lggr) + return p, channel } var _ types.Subscription = &Poller[any]{} -func (p *Poller[T]) Start() error { - return p.StartOnce("Poller", func() error { - p.wg.Add(1) - go p.pollingLoop() - return nil - }) +func (p *Poller[T]) start(ctx context.Context) error { + p.eng.Go(p.pollingLoop) + return nil } // Unsubscribe cancels the sending of events to the data channel func (p *Poller[T]) Unsubscribe() { - _ = p.StopOnce("Poller", func() error { - close(p.stopCh) - p.wg.Wait() - close(p.errCh) - close(p.channel) - return nil - }) + _ = p.Close() +} + +func (p *Poller[T]) close() error { + close(p.errCh) + close(p.channel) + return nil } func (p *Poller[T]) Err() <-chan error { return p.errCh } -func (p *Poller[T]) pollingLoop() { - defer p.wg.Done() - +func (p *Poller[T]) pollingLoop(ctx context.Context) { ticker := time.NewTicker(p.pollingInterval) defer ticker.Stop() for { select { - case <-p.stopCh: + case <-ctx.Done(): return case <-ticker.C: // Set polling timeout - pollingCtx, cancelPolling := p.stopCh.CtxCancel(context.WithTimeout(context.Background(), p.pollingTimeout)) + pollingCtx, cancelPolling := context.WithTimeout(ctx, p.pollingTimeout) // Execute polling function result, err := p.pollingFunc(pollingCtx) cancelPolling() if err != nil { - p.logger.Warnf("polling error: %v", err) + p.eng.Warnf("polling error: %v", err) continue } // Send result to channel or block if channel is full select { case p.channel <- result: - case <-p.stopCh: + case <-ctx.Done(): return } } diff --git a/common/client/poller_test.go b/common/client/poller_test.go index 91af579307b..930b101751c 100644 --- a/common/client/poller_test.go +++ b/common/client/poller_test.go @@ -20,20 +20,22 @@ func Test_Poller(t *testing.T) { lggr := logger.Test(t) t.Run("Test multiple start", func(t *testing.T) { + ctx := tests.Context(t) pollFunc := func(ctx context.Context) (Head, error) { return nil, nil } poller, _ := NewPoller[Head](time.Millisecond, pollFunc, time.Second, lggr) - err := poller.Start() + err := poller.Start(ctx) require.NoError(t, err) - err = poller.Start() + err = poller.Start(ctx) require.Error(t, err) poller.Unsubscribe() }) t.Run("Test polling for heads", func(t *testing.T) { + ctx := tests.Context(t) // Mock polling function that returns a new value every time it's called var pollNumber int pollLock := sync.Mutex{} @@ -50,7 +52,7 @@ func Test_Poller(t *testing.T) { // Create poller and start to receive data poller, channel := NewPoller[Head](time.Millisecond, pollFunc, time.Second, lggr) - require.NoError(t, poller.Start()) + require.NoError(t, poller.Start(ctx)) defer poller.Unsubscribe() // Receive updates from the poller @@ -63,6 +65,7 @@ func Test_Poller(t *testing.T) { }) t.Run("Test polling errors", func(t *testing.T) { + ctx := tests.Context(t) // Mock polling function that returns an error var pollNumber int pollLock := sync.Mutex{} @@ -77,7 +80,7 @@ func Test_Poller(t *testing.T) { // Create poller and subscribe to receive data poller, _ := NewPoller[Head](time.Millisecond, pollFunc, time.Second, olggr) - require.NoError(t, poller.Start()) + require.NoError(t, poller.Start(ctx)) defer poller.Unsubscribe() // Ensure that all errors were logged as expected @@ -94,6 +97,7 @@ func Test_Poller(t *testing.T) { }) t.Run("Test polling timeout", func(t *testing.T) { + ctx := tests.Context(t) pollFunc := func(ctx context.Context) (Head, error) { if <-ctx.Done(); true { return nil, ctx.Err() @@ -108,7 +112,7 @@ func Test_Poller(t *testing.T) { // Create poller and subscribe to receive data poller, _ := NewPoller[Head](time.Millisecond, pollFunc, pollingTimeout, olggr) - require.NoError(t, poller.Start()) + require.NoError(t, poller.Start(ctx)) defer poller.Unsubscribe() // Ensure that timeout errors were logged as expected @@ -119,6 +123,7 @@ func Test_Poller(t *testing.T) { }) t.Run("Test unsubscribe during polling", func(t *testing.T) { + ctx := tests.Context(t) wait := make(chan struct{}) closeOnce := sync.OnceFunc(func() { close(wait) }) pollFunc := func(ctx context.Context) (Head, error) { @@ -137,7 +142,7 @@ func Test_Poller(t *testing.T) { // Create poller and subscribe to receive data poller, _ := NewPoller[Head](time.Millisecond, pollFunc, pollingTimeout, olggr) - require.NoError(t, poller.Start()) + require.NoError(t, poller.Start(ctx)) // Unsubscribe while blocked in polling function <-wait @@ -167,8 +172,9 @@ func Test_Poller_Unsubscribe(t *testing.T) { } t.Run("Test multiple unsubscribe", func(t *testing.T) { + ctx := tests.Context(t) poller, channel := NewPoller[Head](time.Millisecond, pollFunc, time.Second, lggr) - err := poller.Start() + err := poller.Start(ctx) require.NoError(t, err) <-channel @@ -177,8 +183,9 @@ func Test_Poller_Unsubscribe(t *testing.T) { }) t.Run("Read channel after unsubscribe", func(t *testing.T) { + ctx := tests.Context(t) poller, channel := NewPoller[Head](time.Millisecond, pollFunc, time.Second, lggr) - err := poller.Start() + err := poller.Start(ctx) require.NoError(t, err) poller.Unsubscribe() diff --git a/common/client/send_only_node.go b/common/client/send_only_node.go index b63e93b703d..85e3a6fc2cc 100644 --- a/common/client/send_only_node.go +++ b/common/client/send_only_node.go @@ -12,7 +12,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/common/types" ) -//go:generate mockery --quiet --name sendOnlyClient --structname mockSendOnlyClient --filename "mock_send_only_client_test.go" --inpackage --case=underscore type sendOnlyClient[ CHAIN_ID types.ID, ] interface { @@ -22,8 +21,6 @@ type sendOnlyClient[ } // SendOnlyNode represents one node used as a sendonly -// -//go:generate mockery --quiet --name SendOnlyNode --structname mockSendOnlyNode --filename "mock_send_only_node_test.go" --inpackage --case=underscore type SendOnlyNode[ CHAIN_ID types.ID, RPC sendOnlyClient[CHAIN_ID], diff --git a/common/client/types.go b/common/client/types.go index 3d548b9deba..c9b6a3580eb 100644 --- a/common/client/types.go +++ b/common/client/types.go @@ -11,8 +11,6 @@ import ( ) // RPC includes all the necessary methods for a multi-node client to interact directly with any RPC endpoint. -// -//go:generate mockery --quiet --name RPC --structname mockRPC --inpackage --filename "mock_rpc_test.go" --case=underscore type RPC[ CHAIN_ID types.ID, SEQ types.Sequence, @@ -48,8 +46,6 @@ type RPC[ } // Head is the interface required by the NodeClient -// -//go:generate mockery --quiet --name Head --structname mockHead --filename "mock_head_test.go" --inpackage --case=underscore type Head interface { BlockNumber() int64 BlockDifficulty() *big.Int @@ -57,8 +53,6 @@ type Head interface { } // NodeClient includes all the necessary RPC methods required by a node. -// -//go:generate mockery --quiet --name NodeClient --structname mockNodeClient --filename "mock_node_client_test.go" --inpackage --case=underscore type NodeClient[ CHAIN_ID types.ID, HEAD Head, @@ -74,7 +68,7 @@ type NodeClient[ SetAliveLoopSub(types.Subscription) UnsubscribeAllExceptAliveLoop() IsSyncing(ctx context.Context) (bool, error) - LatestFinalizedBlock(ctx context.Context) (HEAD, error) + SubscribeToFinalizedHeads(_ context.Context) (<-chan HEAD, types.Subscription, error) // GetInterceptedChainInfo - returns latest and highest observed by application layer ChainInfo. // latest ChainInfo is the most recent value received within a NodeClient's current lifecycle between Dial and DisconnectAll. // highestUserObservations ChainInfo is the highest ChainInfo observed excluding health checks calls. @@ -157,12 +151,12 @@ type connection[ ] interface { ChainID(ctx context.Context) (CHAIN_ID, error) Dial(ctx context.Context) error - SubscribeNewHead(ctx context.Context, channel chan<- HEAD) (types.Subscription, error) + SubscribeToHeads(ctx context.Context) (ch <-chan HEAD, sub types.Subscription, err error) + // TODO: remove as part of merge with BCI-2875 + SubscribeNewHead(ctx context.Context, channel chan<- HEAD) (s types.Subscription, err error) } // PoolChainInfoProvider - provides aggregation of nodes pool ChainInfo -// -//go:generate mockery --quiet --name PoolChainInfoProvider --structname mockPoolChainInfoProvider --filename "mock_pool_chain_info_provider_test.go" --inpackage --case=underscore type PoolChainInfoProvider interface { // LatestChainInfo - returns number of live nodes available in the pool, so we can prevent the last alive node in a pool from being // moved to out-of-sync state. It is better to have one out-of-sync node than no nodes at all. diff --git a/common/fee/models.go b/common/fee/models.go index 0568a2f1433..0cc479d3560 100644 --- a/common/fee/models.go +++ b/common/fee/models.go @@ -14,6 +14,7 @@ var ( ErrBumpFeeExceedsLimit = errors.New("fee bump exceeds limit") ErrBump = errors.New("fee bump failed") ErrConnectivity = errors.New("transaction propagation issue: transactions are not being mined") + ErrFeeLimitTooLow = errors.New("provided fee limit too low") ) func IsBumpErr(err error) bool { @@ -63,7 +64,7 @@ func CalculateBumpedFee( // Returns highest bumped fee price of originalFeePrice bumped by fixed units or percentage. func MaxBumpedFee(originalFeePrice *big.Int, feeBumpPercent uint16, feeBumpUnits *big.Int) *big.Int { return bigmath.Max( - addPercentage(originalFeePrice, feeBumpPercent), + AddPercentage(originalFeePrice, feeBumpPercent), new(big.Int).Add(originalFeePrice, feeBumpUnits), ) } diff --git a/common/fee/utils.go b/common/fee/utils.go index 26323e11e26..3d4b001e839 100644 --- a/common/fee/utils.go +++ b/common/fee/utils.go @@ -18,7 +18,7 @@ func ApplyMultiplier(feeLimit uint64, multiplier float32) (uint64, error) { } // Returns the input value increased by the given percentage. -func addPercentage(value *big.Int, percentage uint16) *big.Int { +func AddPercentage(value *big.Int, percentage uint16) *big.Int { bumped := new(big.Int) bumped.Mul(value, big.NewInt(int64(100+percentage))) bumped.Div(bumped, big.NewInt(100)) diff --git a/common/headtracker/head_broadcaster.go b/common/headtracker/head_broadcaster.go index 0d5da434060..c81c61141f2 100644 --- a/common/headtracker/head_broadcaster.go +++ b/common/headtracker/head_broadcaster.go @@ -28,8 +28,6 @@ func (set callbackSet[H, BLOCK_HASH]) values() []HeadTrackable[H, BLOCK_HASH] { // HeadTrackable is implemented by the core txm to be able to receive head events from any chain. // Chain implementations should notify head events to the core txm via this interface. -// -//go:generate mockery --quiet --name HeadTrackable --output ./mocks/ --case=underscore type HeadTrackable[H types.Head[BLOCK_HASH], BLOCK_HASH types.Hashable] interface { // OnNewLongestChain sends a new head when it becomes available. Subscribers can recursively trace the parent // of the head to the finalized block back. @@ -37,8 +35,6 @@ type HeadTrackable[H types.Head[BLOCK_HASH], BLOCK_HASH types.Hashable] interfac } // HeadBroadcaster relays new Heads to all subscribers. -// -//go:generate mockery --quiet --name HeadBroadcaster --output ./mocks/ --case=underscore type HeadBroadcaster[H types.Head[BLOCK_HASH], BLOCK_HASH types.Hashable] interface { services.Service BroadcastNewLongestChain(H) @@ -46,13 +42,12 @@ type HeadBroadcaster[H types.Head[BLOCK_HASH], BLOCK_HASH types.Hashable] interf } type headBroadcaster[H types.Head[BLOCK_HASH], BLOCK_HASH types.Hashable] struct { - services.StateMachine - logger logger.Logger + services.Service + eng *services.Engine + callbacks callbackSet[H, BLOCK_HASH] mailbox *mailbox.Mailbox[H] mutex sync.Mutex - chClose services.StopChan - wgDone sync.WaitGroup latest H lastCallbackID int } @@ -64,41 +59,29 @@ func NewHeadBroadcaster[ ]( lggr logger.Logger, ) HeadBroadcaster[H, BLOCK_HASH] { - return &headBroadcaster[H, BLOCK_HASH]{ - logger: logger.Named(lggr, "HeadBroadcaster"), + hb := &headBroadcaster[H, BLOCK_HASH]{ callbacks: make(callbackSet[H, BLOCK_HASH]), mailbox: mailbox.NewSingle[H](), - chClose: make(chan struct{}), } + hb.Service, hb.eng = services.Config{ + Name: "HeadBroadcaster", + Start: hb.start, + Close: hb.close, + }.NewServiceEngine(lggr) + return hb } -func (hb *headBroadcaster[H, BLOCK_HASH]) Start(context.Context) error { - return hb.StartOnce("HeadBroadcaster", func() error { - hb.wgDone.Add(1) - go hb.run() - return nil - }) -} - -func (hb *headBroadcaster[H, BLOCK_HASH]) Close() error { - return hb.StopOnce("HeadBroadcaster", func() error { - hb.mutex.Lock() - // clear all callbacks - hb.callbacks = make(callbackSet[H, BLOCK_HASH]) - hb.mutex.Unlock() - - close(hb.chClose) - hb.wgDone.Wait() - return nil - }) +func (hb *headBroadcaster[H, BLOCK_HASH]) start(context.Context) error { + hb.eng.Go(hb.run) + return nil } -func (hb *headBroadcaster[H, BLOCK_HASH]) Name() string { - return hb.logger.Name() -} - -func (hb *headBroadcaster[H, BLOCK_HASH]) HealthReport() map[string]error { - return map[string]error{hb.Name(): hb.Healthy()} +func (hb *headBroadcaster[H, BLOCK_HASH]) close() error { + hb.mutex.Lock() + // clear all callbacks + hb.callbacks = make(callbackSet[H, BLOCK_HASH]) + hb.mutex.Unlock() + return nil } func (hb *headBroadcaster[H, BLOCK_HASH]) BroadcastNewLongestChain(head H) { @@ -125,15 +108,13 @@ func (hb *headBroadcaster[H, BLOCK_HASH]) Subscribe(callback HeadTrackable[H, BL return } -func (hb *headBroadcaster[H, BLOCK_HASH]) run() { - defer hb.wgDone.Done() - +func (hb *headBroadcaster[H, BLOCK_HASH]) run(ctx context.Context) { for { select { - case <-hb.chClose: + case <-ctx.Done(): return case <-hb.mailbox.Notify(): - hb.executeCallbacks() + hb.executeCallbacks(ctx) } } } @@ -141,10 +122,10 @@ func (hb *headBroadcaster[H, BLOCK_HASH]) run() { // DEV: the head relayer makes no promises about head delivery! Subscribing // Jobs should expect to the relayer to skip heads if there is a large number of listeners // and all callbacks cannot be completed in the allotted time. -func (hb *headBroadcaster[H, BLOCK_HASH]) executeCallbacks() { +func (hb *headBroadcaster[H, BLOCK_HASH]) executeCallbacks(ctx context.Context) { head, exists := hb.mailbox.Retrieve() if !exists { - hb.logger.Info("No head to retrieve. It might have been skipped") + hb.eng.Info("No head to retrieve. It might have been skipped") return } @@ -153,7 +134,7 @@ func (hb *headBroadcaster[H, BLOCK_HASH]) executeCallbacks() { hb.latest = head hb.mutex.Unlock() - hb.logger.Debugw("Initiating callbacks", + hb.eng.Debugw("Initiating callbacks", "headNum", head.BlockNumber(), "numCallbacks", len(callbacks), ) @@ -161,9 +142,6 @@ func (hb *headBroadcaster[H, BLOCK_HASH]) executeCallbacks() { wg := sync.WaitGroup{} wg.Add(len(callbacks)) - ctx, cancel := hb.chClose.NewCtx() - defer cancel() - for _, callback := range callbacks { go func(trackable HeadTrackable[H, BLOCK_HASH]) { defer wg.Done() @@ -172,7 +150,7 @@ func (hb *headBroadcaster[H, BLOCK_HASH]) executeCallbacks() { defer cancel() trackable.OnNewLongestChain(cctx, head) elapsed := time.Since(start) - hb.logger.Debugw(fmt.Sprintf("Finished callback in %s", elapsed), + hb.eng.Debugw(fmt.Sprintf("Finished callback in %s", elapsed), "callbackType", reflect.TypeOf(trackable), "blockNumber", head.BlockNumber(), "time", elapsed) }(callback) } diff --git a/common/headtracker/head_listener.go b/common/headtracker/head_listener.go index 25715b35280..d240caab3c3 100644 --- a/common/headtracker/head_listener.go +++ b/common/headtracker/head_listener.go @@ -29,14 +29,15 @@ var ( }, []string{"ChainID"}) ) -// headHandler is a callback that handles incoming heads -type headHandler[H types.Head[BLOCK_HASH], BLOCK_HASH types.Hashable] func(ctx context.Context, header H) error +// HeadHandler is a callback that handles incoming heads +type HeadHandler[H types.Head[BLOCK_HASH], BLOCK_HASH types.Hashable] func(ctx context.Context, header H) error // HeadListener is a chain agnostic interface that manages connection of Client that receives heads from the blockchain node type HeadListener[H types.Head[BLOCK_HASH], BLOCK_HASH types.Hashable] interface { - // ListenForNewHeads kicks off the listen loop (not thread safe) - // done() must be executed upon leaving ListenForNewHeads() - ListenForNewHeads(onSubscribe func(), handleNewHead headHandler[H, BLOCK_HASH], done func()) + services.Service + + // ListenForNewHeads runs the listen loop (not thread safe) + ListenForNewHeads(ctx context.Context) // ReceivingHeads returns true if the listener is receiving heads (thread safe) ReceivingHeads() bool @@ -54,10 +55,13 @@ type headListener[ ID types.ID, BLOCK_HASH types.Hashable, ] struct { + services.Service + eng *services.Engine + config htrktypes.Config client htrktypes.Client[HTH, S, ID, BLOCK_HASH] - logger logger.Logger - chStop services.StopChan + onSubscription func(context.Context) + handleNewHead HeadHandler[HTH, BLOCK_HASH] chHeaders chan HTH headSubscription types.Subscription connected atomic.Bool @@ -74,38 +78,43 @@ func NewHeadListener[ lggr logger.Logger, client CLIENT, config htrktypes.Config, - chStop chan struct{}, + onSubscription func(context.Context), + handleNewHead HeadHandler[HTH, BLOCK_HASH], ) HeadListener[HTH, BLOCK_HASH] { - return &headListener[HTH, S, ID, BLOCK_HASH]{ - config: config, - client: client, - logger: logger.Named(lggr, "HeadListener"), - chStop: chStop, + hl := &headListener[HTH, S, ID, BLOCK_HASH]{ + config: config, + client: client, + onSubscription: onSubscription, + handleNewHead: handleNewHead, } + hl.Service, hl.eng = services.Config{ + Name: "HeadListener", + Start: hl.start, + }.NewServiceEngine(lggr) + return hl } -func (hl *headListener[HTH, S, ID, BLOCK_HASH]) Name() string { - return hl.logger.Name() +func (hl *headListener[HTH, S, ID, BLOCK_HASH]) start(context.Context) error { + hl.eng.Go(hl.ListenForNewHeads) + return nil } -func (hl *headListener[HTH, S, ID, BLOCK_HASH]) ListenForNewHeads(onSubscription func(), handleNewHead headHandler[HTH, BLOCK_HASH], done func()) { - defer done() +func (hl *headListener[HTH, S, ID, BLOCK_HASH]) ListenForNewHeads(ctx context.Context) { defer hl.unsubscribe() - ctx, cancel := hl.chStop.NewCtx() - defer cancel() - for { if !hl.subscribe(ctx) { break } - onSubscription() - err := hl.receiveHeaders(ctx, handleNewHead) + if hl.onSubscription != nil { + hl.onSubscription(ctx) + } + err := hl.receiveHeaders(ctx, hl.handleNewHead) if ctx.Err() != nil { break } else if err != nil { - hl.logger.Errorw("Error in new head subscription, unsubscribed", "err", err) + hl.eng.Errorw("Error in new head subscription, unsubscribed", "err", err) continue } break @@ -131,7 +140,7 @@ func (hl *headListener[HTH, S, ID, BLOCK_HASH]) HealthReport() map[string]error return map[string]error{hl.Name(): err} } -func (hl *headListener[HTH, S, ID, BLOCK_HASH]) receiveHeaders(ctx context.Context, handleNewHead headHandler[HTH, BLOCK_HASH]) error { +func (hl *headListener[HTH, S, ID, BLOCK_HASH]) receiveHeaders(ctx context.Context, handleNewHead HeadHandler[HTH, BLOCK_HASH]) error { var noHeadsAlarmC <-chan time.Time var noHeadsAlarmT *time.Ticker noHeadsAlarmDuration := hl.config.BlockEmissionIdleWarningThreshold() @@ -142,7 +151,7 @@ func (hl *headListener[HTH, S, ID, BLOCK_HASH]) receiveHeaders(ctx context.Conte for { select { - case <-hl.chStop: + case <-ctx.Done(): return nil case blockHeader, open := <-hl.chHeaders: @@ -158,13 +167,13 @@ func (hl *headListener[HTH, S, ID, BLOCK_HASH]) receiveHeaders(ctx context.Conte return errors.New("head listener: chHeaders prematurely closed") } if !blockHeader.IsValid() { - hl.logger.Error("got nil block header") + hl.eng.Error("got nil block header") continue } // Compare the chain ID of the block header to the chain ID of the client if !blockHeader.HasChainID() || blockHeader.ChainID().String() != chainId.String() { - hl.logger.Panicf("head listener for %s received block header for %s", chainId, blockHeader.ChainID()) + hl.eng.Panicf("head listener for %s received block header for %s", chainId, blockHeader.ChainID()) } promNumHeadsReceived.WithLabelValues(chainId.String()).Inc() @@ -184,7 +193,7 @@ func (hl *headListener[HTH, S, ID, BLOCK_HASH]) receiveHeaders(ctx context.Conte case <-noHeadsAlarmC: // We haven't received a head on the channel for a long time, log a warning - hl.logger.Warnf("have not received a head for %v", noHeadsAlarmDuration) + hl.eng.Warnf("have not received a head for %v", noHeadsAlarmDuration) hl.receivingHeads.Store(false) } } @@ -198,19 +207,19 @@ func (hl *headListener[HTH, S, ID, BLOCK_HASH]) subscribe(ctx context.Context) b for { hl.unsubscribe() - hl.logger.Debugf("Subscribing to new heads on chain %s", chainId.String()) + hl.eng.Debugf("Subscribing to new heads on chain %s", chainId.String()) select { - case <-hl.chStop: + case <-ctx.Done(): return false case <-time.After(subscribeRetryBackoff.Duration()): err := hl.subscribeToHead(ctx) if err != nil { promEthConnectionErrors.WithLabelValues(chainId.String()).Inc() - hl.logger.Warnw("Failed to subscribe to heads on chain", "chainID", chainId.String(), "err", err) + hl.eng.Warnw("Failed to subscribe to heads on chain", "chainID", chainId.String(), "err", err) } else { - hl.logger.Debugf("Subscribed to heads on chain %s", chainId.String()) + hl.eng.Debugf("Subscribed to heads on chain %s", chainId.String()) return true } } diff --git a/common/headtracker/head_tracker.go b/common/headtracker/head_tracker.go index bc5f5274c0c..8546d856b67 100644 --- a/common/headtracker/head_tracker.go +++ b/common/headtracker/head_tracker.go @@ -5,7 +5,6 @@ import ( "errors" "fmt" "math/big" - "sync" "time" "github.com/prometheus/client_golang/prometheus" @@ -35,8 +34,6 @@ var ( const HeadsBufferSize = 10 // HeadTracker holds and stores the block experienced by a particular node in a thread safe manner. -// -//go:generate mockery --quiet --name HeadTracker --output ./mocks/ --case=underscore type HeadTracker[H types.Head[BLOCK_HASH], BLOCK_HASH types.Hashable] interface { services.Service // Backfill given a head will fill in any missing heads up to latestFinalized @@ -53,7 +50,9 @@ type headTracker[ ID types.ID, BLOCK_HASH types.Hashable, ] struct { - services.StateMachine + services.Service + eng *services.Engine + log logger.SugaredLogger headBroadcaster HeadBroadcaster[HTH, BLOCK_HASH] headSaver HeadSaver[HTH, BLOCK_HASH] @@ -66,8 +65,6 @@ type headTracker[ backfillMB *mailbox.Mailbox[HTH] broadcastMB *mailbox.Mailbox[HTH] headListener HeadListener[HTH, BLOCK_HASH] - chStop services.StopChan - wgDone sync.WaitGroup getNilHead func() HTH } @@ -87,52 +84,52 @@ func NewHeadTracker[ mailMon *mailbox.Monitor, getNilHead func() HTH, ) HeadTracker[HTH, BLOCK_HASH] { - chStop := make(chan struct{}) - lggr = logger.Named(lggr, "HeadTracker") - return &headTracker[HTH, S, ID, BLOCK_HASH]{ + ht := &headTracker[HTH, S, ID, BLOCK_HASH]{ headBroadcaster: headBroadcaster, client: client, chainID: client.ConfiguredChainID(), config: config, htConfig: htConfig, - log: logger.Sugared(lggr), backfillMB: mailbox.NewSingle[HTH](), broadcastMB: mailbox.New[HTH](HeadsBufferSize), - chStop: chStop, - headListener: NewHeadListener[HTH, S, ID, BLOCK_HASH](lggr, client, config, chStop), headSaver: headSaver, mailMon: mailMon, getNilHead: getNilHead, } + ht.Service, ht.eng = services.Config{ + Name: "HeadTracker", + NewSubServices: func(lggr logger.Logger) []services.Service { + ht.headListener = NewHeadListener[HTH, S, ID, BLOCK_HASH](lggr, client, config, + // NOTE: Always try to start the head tracker off with whatever the + // latest head is, without waiting for the subscription to send us one. + // + // In some cases the subscription will send us the most recent head + // anyway when we connect (but we should not rely on this because it is + // not specced). If it happens this is fine, and the head will be + // ignored as a duplicate. + func(ctx context.Context) { + err := ht.handleInitialHead(ctx) + if err != nil { + ht.log.Errorw("Error handling initial head", "err", err.Error()) + } + }, ht.handleNewHead) + return []services.Service{ht.headListener} + }, + Start: ht.start, + Close: ht.close, + }.NewServiceEngine(lggr) + ht.log = logger.Sugared(ht.eng) + return ht } // Start starts HeadTracker service. -func (ht *headTracker[HTH, S, ID, BLOCK_HASH]) Start(ctx context.Context) error { - return ht.StartOnce("HeadTracker", func() error { - ht.log.Debugw("Starting HeadTracker", "chainID", ht.chainID) - // NOTE: Always try to start the head tracker off with whatever the - // latest head is, without waiting for the subscription to send us one. - // - // In some cases the subscription will send us the most recent head - // anyway when we connect (but we should not rely on this because it is - // not specced). If it happens this is fine, and the head will be - // ignored as a duplicate. - onSubscribe := func() { - err := ht.handleInitialHead(ctx) - if err != nil { - ht.log.Errorw("Error handling initial head", "err", err.Error()) - } - } +func (ht *headTracker[HTH, S, ID, BLOCK_HASH]) start(context.Context) error { + ht.eng.Go(ht.backfillLoop) + ht.eng.Go(ht.broadcastLoop) - ht.wgDone.Add(3) - go ht.headListener.ListenForNewHeads(onSubscribe, ht.handleNewHead, ht.wgDone.Done) - go ht.backfillLoop() - go ht.broadcastLoop() + ht.mailMon.Monitor(ht.broadcastMB, "HeadTracker", "Broadcast", ht.chainID.String()) - ht.mailMon.Monitor(ht.broadcastMB, "HeadTracker", "Broadcast", ht.chainID.String()) - - return nil - }) + return nil } func (ht *headTracker[HTH, S, ID, BLOCK_HASH]) handleInitialHead(ctx context.Context) error { @@ -178,23 +175,8 @@ func (ht *headTracker[HTH, S, ID, BLOCK_HASH]) handleInitialHead(ctx context.Con return nil } -// Close stops HeadTracker service. -func (ht *headTracker[HTH, S, ID, BLOCK_HASH]) Close() error { - return ht.StopOnce("HeadTracker", func() error { - close(ht.chStop) - ht.wgDone.Wait() - return ht.broadcastMB.Close() - }) -} - -func (ht *headTracker[HTH, S, ID, BLOCK_HASH]) Name() string { - return ht.log.Name() -} - -func (ht *headTracker[HTH, S, ID, BLOCK_HASH]) HealthReport() map[string]error { - report := map[string]error{ht.Name(): ht.Healthy()} - services.CopyHealth(report, ht.headListener.HealthReport()) - return report +func (ht *headTracker[HTH, S, ID, BLOCK_HASH]) close() error { + return ht.broadcastMB.Close() } func (ht *headTracker[HTH, S, ID, BLOCK_HASH]) Backfill(ctx context.Context, headWithChain HTH) (err error) { @@ -238,8 +220,7 @@ func (ht *headTracker[HTH, S, ID, BLOCK_HASH]) handleNewHead(ctx context.Context "blockDifficulty", head.BlockDifficulty(), ) - err := ht.headSaver.Save(ctx, head) - if ctx.Err() != nil { + if err := ht.headSaver.Save(ctx, head); ctx.Err() != nil { return nil } else if err != nil { return fmt.Errorf("failed to save head: %#v: %w", head, err) @@ -266,16 +247,15 @@ func (ht *headTracker[HTH, S, ID, BLOCK_HASH]) handleNewHead(ctx context.Context if prevLatestFinalized != nil && head.BlockNumber() <= prevLatestFinalized.BlockNumber() { promOldHead.WithLabelValues(ht.chainID.String()).Inc() - ht.log.Criticalf("Got very old block with number %d (highest seen was %d). This is a problem and either means a very deep re-org occurred, one of the RPC nodes has gotten far out of sync, or the chain went backwards in block numbers. This node may not function correctly without manual intervention.", head.BlockNumber(), prevHead.BlockNumber()) - ht.SvcErrBuffer.Append(errors.New("got very old block")) + err := fmt.Errorf("got very old block with number %d (highest seen was %d)", head.BlockNumber(), prevHead.BlockNumber()) + ht.log.Critical("Got very old block. Either a very deep re-org occurred, one of the RPC nodes has gotten far out of sync, or the chain went backwards in block numbers. This node may not function correctly without manual intervention.", "err", err) + ht.eng.EmitHealthErr(err) } } return nil } -func (ht *headTracker[HTH, S, ID, BLOCK_HASH]) broadcastLoop() { - defer ht.wgDone.Done() - +func (ht *headTracker[HTH, S, ID, BLOCK_HASH]) broadcastLoop(ctx context.Context) { samplingInterval := ht.htConfig.SamplingInterval() if samplingInterval > 0 { ht.log.Debugf("Head sampling is enabled - sampling interval is set to: %v", samplingInterval) @@ -283,7 +263,7 @@ func (ht *headTracker[HTH, S, ID, BLOCK_HASH]) broadcastLoop() { defer debounceHead.Stop() for { select { - case <-ht.chStop: + case <-ctx.Done(): return case <-debounceHead.C: item := ht.broadcastMB.RetrieveLatestAndClear() @@ -297,7 +277,7 @@ func (ht *headTracker[HTH, S, ID, BLOCK_HASH]) broadcastLoop() { ht.log.Info("Head sampling is disabled - callback will be called on every head") for { select { - case <-ht.chStop: + case <-ctx.Done(): return case <-ht.broadcastMB.Notify(): for { @@ -312,15 +292,10 @@ func (ht *headTracker[HTH, S, ID, BLOCK_HASH]) broadcastLoop() { } } -func (ht *headTracker[HTH, S, ID, BLOCK_HASH]) backfillLoop() { - defer ht.wgDone.Done() - - ctx, cancel := ht.chStop.NewCtx() - defer cancel() - +func (ht *headTracker[HTH, S, ID, BLOCK_HASH]) backfillLoop(ctx context.Context) { for { select { - case <-ht.chStop: + case <-ctx.Done(): return case <-ht.backfillMB.Notify(): for { diff --git a/common/headtracker/mocks/head_broadcaster.go b/common/headtracker/mocks/head_broadcaster.go index e11adb715fd..83838ae6c10 100644 --- a/common/headtracker/mocks/head_broadcaster.go +++ b/common/headtracker/mocks/head_broadcaster.go @@ -16,11 +16,47 @@ type HeadBroadcaster[H types.Head[BLOCK_HASH], BLOCK_HASH types.Hashable] struct mock.Mock } +type HeadBroadcaster_Expecter[H types.Head[BLOCK_HASH], BLOCK_HASH types.Hashable] struct { + mock *mock.Mock +} + +func (_m *HeadBroadcaster[H, BLOCK_HASH]) EXPECT() *HeadBroadcaster_Expecter[H, BLOCK_HASH] { + return &HeadBroadcaster_Expecter[H, BLOCK_HASH]{mock: &_m.Mock} +} + // BroadcastNewLongestChain provides a mock function with given fields: _a0 func (_m *HeadBroadcaster[H, BLOCK_HASH]) BroadcastNewLongestChain(_a0 H) { _m.Called(_a0) } +// HeadBroadcaster_BroadcastNewLongestChain_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BroadcastNewLongestChain' +type HeadBroadcaster_BroadcastNewLongestChain_Call[H types.Head[BLOCK_HASH], BLOCK_HASH types.Hashable] struct { + *mock.Call +} + +// BroadcastNewLongestChain is a helper method to define mock.On call +// - _a0 H +func (_e *HeadBroadcaster_Expecter[H, BLOCK_HASH]) BroadcastNewLongestChain(_a0 interface{}) *HeadBroadcaster_BroadcastNewLongestChain_Call[H, BLOCK_HASH] { + return &HeadBroadcaster_BroadcastNewLongestChain_Call[H, BLOCK_HASH]{Call: _e.mock.On("BroadcastNewLongestChain", _a0)} +} + +func (_c *HeadBroadcaster_BroadcastNewLongestChain_Call[H, BLOCK_HASH]) Run(run func(_a0 H)) *HeadBroadcaster_BroadcastNewLongestChain_Call[H, BLOCK_HASH] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(H)) + }) + return _c +} + +func (_c *HeadBroadcaster_BroadcastNewLongestChain_Call[H, BLOCK_HASH]) Return() *HeadBroadcaster_BroadcastNewLongestChain_Call[H, BLOCK_HASH] { + _c.Call.Return() + return _c +} + +func (_c *HeadBroadcaster_BroadcastNewLongestChain_Call[H, BLOCK_HASH]) RunAndReturn(run func(H)) *HeadBroadcaster_BroadcastNewLongestChain_Call[H, BLOCK_HASH] { + _c.Call.Return(run) + return _c +} + // Close provides a mock function with given fields: func (_m *HeadBroadcaster[H, BLOCK_HASH]) Close() error { ret := _m.Called() @@ -39,6 +75,33 @@ func (_m *HeadBroadcaster[H, BLOCK_HASH]) Close() error { return r0 } +// HeadBroadcaster_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close' +type HeadBroadcaster_Close_Call[H types.Head[BLOCK_HASH], BLOCK_HASH types.Hashable] struct { + *mock.Call +} + +// Close is a helper method to define mock.On call +func (_e *HeadBroadcaster_Expecter[H, BLOCK_HASH]) Close() *HeadBroadcaster_Close_Call[H, BLOCK_HASH] { + return &HeadBroadcaster_Close_Call[H, BLOCK_HASH]{Call: _e.mock.On("Close")} +} + +func (_c *HeadBroadcaster_Close_Call[H, BLOCK_HASH]) Run(run func()) *HeadBroadcaster_Close_Call[H, BLOCK_HASH] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *HeadBroadcaster_Close_Call[H, BLOCK_HASH]) Return(_a0 error) *HeadBroadcaster_Close_Call[H, BLOCK_HASH] { + _c.Call.Return(_a0) + return _c +} + +func (_c *HeadBroadcaster_Close_Call[H, BLOCK_HASH]) RunAndReturn(run func() error) *HeadBroadcaster_Close_Call[H, BLOCK_HASH] { + _c.Call.Return(run) + return _c +} + // HealthReport provides a mock function with given fields: func (_m *HeadBroadcaster[H, BLOCK_HASH]) HealthReport() map[string]error { ret := _m.Called() @@ -59,6 +122,33 @@ func (_m *HeadBroadcaster[H, BLOCK_HASH]) HealthReport() map[string]error { return r0 } +// HeadBroadcaster_HealthReport_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HealthReport' +type HeadBroadcaster_HealthReport_Call[H types.Head[BLOCK_HASH], BLOCK_HASH types.Hashable] struct { + *mock.Call +} + +// HealthReport is a helper method to define mock.On call +func (_e *HeadBroadcaster_Expecter[H, BLOCK_HASH]) HealthReport() *HeadBroadcaster_HealthReport_Call[H, BLOCK_HASH] { + return &HeadBroadcaster_HealthReport_Call[H, BLOCK_HASH]{Call: _e.mock.On("HealthReport")} +} + +func (_c *HeadBroadcaster_HealthReport_Call[H, BLOCK_HASH]) Run(run func()) *HeadBroadcaster_HealthReport_Call[H, BLOCK_HASH] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *HeadBroadcaster_HealthReport_Call[H, BLOCK_HASH]) Return(_a0 map[string]error) *HeadBroadcaster_HealthReport_Call[H, BLOCK_HASH] { + _c.Call.Return(_a0) + return _c +} + +func (_c *HeadBroadcaster_HealthReport_Call[H, BLOCK_HASH]) RunAndReturn(run func() map[string]error) *HeadBroadcaster_HealthReport_Call[H, BLOCK_HASH] { + _c.Call.Return(run) + return _c +} + // Name provides a mock function with given fields: func (_m *HeadBroadcaster[H, BLOCK_HASH]) Name() string { ret := _m.Called() @@ -77,6 +167,33 @@ func (_m *HeadBroadcaster[H, BLOCK_HASH]) Name() string { return r0 } +// HeadBroadcaster_Name_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Name' +type HeadBroadcaster_Name_Call[H types.Head[BLOCK_HASH], BLOCK_HASH types.Hashable] struct { + *mock.Call +} + +// Name is a helper method to define mock.On call +func (_e *HeadBroadcaster_Expecter[H, BLOCK_HASH]) Name() *HeadBroadcaster_Name_Call[H, BLOCK_HASH] { + return &HeadBroadcaster_Name_Call[H, BLOCK_HASH]{Call: _e.mock.On("Name")} +} + +func (_c *HeadBroadcaster_Name_Call[H, BLOCK_HASH]) Run(run func()) *HeadBroadcaster_Name_Call[H, BLOCK_HASH] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *HeadBroadcaster_Name_Call[H, BLOCK_HASH]) Return(_a0 string) *HeadBroadcaster_Name_Call[H, BLOCK_HASH] { + _c.Call.Return(_a0) + return _c +} + +func (_c *HeadBroadcaster_Name_Call[H, BLOCK_HASH]) RunAndReturn(run func() string) *HeadBroadcaster_Name_Call[H, BLOCK_HASH] { + _c.Call.Return(run) + return _c +} + // Ready provides a mock function with given fields: func (_m *HeadBroadcaster[H, BLOCK_HASH]) Ready() error { ret := _m.Called() @@ -95,6 +212,33 @@ func (_m *HeadBroadcaster[H, BLOCK_HASH]) Ready() error { return r0 } +// HeadBroadcaster_Ready_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Ready' +type HeadBroadcaster_Ready_Call[H types.Head[BLOCK_HASH], BLOCK_HASH types.Hashable] struct { + *mock.Call +} + +// Ready is a helper method to define mock.On call +func (_e *HeadBroadcaster_Expecter[H, BLOCK_HASH]) Ready() *HeadBroadcaster_Ready_Call[H, BLOCK_HASH] { + return &HeadBroadcaster_Ready_Call[H, BLOCK_HASH]{Call: _e.mock.On("Ready")} +} + +func (_c *HeadBroadcaster_Ready_Call[H, BLOCK_HASH]) Run(run func()) *HeadBroadcaster_Ready_Call[H, BLOCK_HASH] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *HeadBroadcaster_Ready_Call[H, BLOCK_HASH]) Return(_a0 error) *HeadBroadcaster_Ready_Call[H, BLOCK_HASH] { + _c.Call.Return(_a0) + return _c +} + +func (_c *HeadBroadcaster_Ready_Call[H, BLOCK_HASH]) RunAndReturn(run func() error) *HeadBroadcaster_Ready_Call[H, BLOCK_HASH] { + _c.Call.Return(run) + return _c +} + // Start provides a mock function with given fields: _a0 func (_m *HeadBroadcaster[H, BLOCK_HASH]) Start(_a0 context.Context) error { ret := _m.Called(_a0) @@ -113,6 +257,34 @@ func (_m *HeadBroadcaster[H, BLOCK_HASH]) Start(_a0 context.Context) error { return r0 } +// HeadBroadcaster_Start_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Start' +type HeadBroadcaster_Start_Call[H types.Head[BLOCK_HASH], BLOCK_HASH types.Hashable] struct { + *mock.Call +} + +// Start is a helper method to define mock.On call +// - _a0 context.Context +func (_e *HeadBroadcaster_Expecter[H, BLOCK_HASH]) Start(_a0 interface{}) *HeadBroadcaster_Start_Call[H, BLOCK_HASH] { + return &HeadBroadcaster_Start_Call[H, BLOCK_HASH]{Call: _e.mock.On("Start", _a0)} +} + +func (_c *HeadBroadcaster_Start_Call[H, BLOCK_HASH]) Run(run func(_a0 context.Context)) *HeadBroadcaster_Start_Call[H, BLOCK_HASH] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *HeadBroadcaster_Start_Call[H, BLOCK_HASH]) Return(_a0 error) *HeadBroadcaster_Start_Call[H, BLOCK_HASH] { + _c.Call.Return(_a0) + return _c +} + +func (_c *HeadBroadcaster_Start_Call[H, BLOCK_HASH]) RunAndReturn(run func(context.Context) error) *HeadBroadcaster_Start_Call[H, BLOCK_HASH] { + _c.Call.Return(run) + return _c +} + // Subscribe provides a mock function with given fields: callback func (_m *HeadBroadcaster[H, BLOCK_HASH]) Subscribe(callback headtracker.HeadTrackable[H, BLOCK_HASH]) (H, func()) { ret := _m.Called(callback) @@ -143,6 +315,34 @@ func (_m *HeadBroadcaster[H, BLOCK_HASH]) Subscribe(callback headtracker.HeadTra return r0, r1 } +// HeadBroadcaster_Subscribe_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Subscribe' +type HeadBroadcaster_Subscribe_Call[H types.Head[BLOCK_HASH], BLOCK_HASH types.Hashable] struct { + *mock.Call +} + +// Subscribe is a helper method to define mock.On call +// - callback headtracker.HeadTrackable[H,BLOCK_HASH] +func (_e *HeadBroadcaster_Expecter[H, BLOCK_HASH]) Subscribe(callback interface{}) *HeadBroadcaster_Subscribe_Call[H, BLOCK_HASH] { + return &HeadBroadcaster_Subscribe_Call[H, BLOCK_HASH]{Call: _e.mock.On("Subscribe", callback)} +} + +func (_c *HeadBroadcaster_Subscribe_Call[H, BLOCK_HASH]) Run(run func(callback headtracker.HeadTrackable[H, BLOCK_HASH])) *HeadBroadcaster_Subscribe_Call[H, BLOCK_HASH] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(headtracker.HeadTrackable[H, BLOCK_HASH])) + }) + return _c +} + +func (_c *HeadBroadcaster_Subscribe_Call[H, BLOCK_HASH]) Return(currentLongestChain H, unsubscribe func()) *HeadBroadcaster_Subscribe_Call[H, BLOCK_HASH] { + _c.Call.Return(currentLongestChain, unsubscribe) + return _c +} + +func (_c *HeadBroadcaster_Subscribe_Call[H, BLOCK_HASH]) RunAndReturn(run func(headtracker.HeadTrackable[H, BLOCK_HASH]) (H, func())) *HeadBroadcaster_Subscribe_Call[H, BLOCK_HASH] { + _c.Call.Return(run) + return _c +} + // NewHeadBroadcaster creates a new instance of HeadBroadcaster. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewHeadBroadcaster[H types.Head[BLOCK_HASH], BLOCK_HASH types.Hashable](t interface { diff --git a/common/headtracker/mocks/head_trackable.go b/common/headtracker/mocks/head_trackable.go index 9b70938512c..feb2c3c6d3d 100644 --- a/common/headtracker/mocks/head_trackable.go +++ b/common/headtracker/mocks/head_trackable.go @@ -15,11 +15,48 @@ type HeadTrackable[H types.Head[BLOCK_HASH], BLOCK_HASH types.Hashable] struct { mock.Mock } +type HeadTrackable_Expecter[H types.Head[BLOCK_HASH], BLOCK_HASH types.Hashable] struct { + mock *mock.Mock +} + +func (_m *HeadTrackable[H, BLOCK_HASH]) EXPECT() *HeadTrackable_Expecter[H, BLOCK_HASH] { + return &HeadTrackable_Expecter[H, BLOCK_HASH]{mock: &_m.Mock} +} + // OnNewLongestChain provides a mock function with given fields: ctx, head func (_m *HeadTrackable[H, BLOCK_HASH]) OnNewLongestChain(ctx context.Context, head H) { _m.Called(ctx, head) } +// HeadTrackable_OnNewLongestChain_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OnNewLongestChain' +type HeadTrackable_OnNewLongestChain_Call[H types.Head[BLOCK_HASH], BLOCK_HASH types.Hashable] struct { + *mock.Call +} + +// OnNewLongestChain is a helper method to define mock.On call +// - ctx context.Context +// - head H +func (_e *HeadTrackable_Expecter[H, BLOCK_HASH]) OnNewLongestChain(ctx interface{}, head interface{}) *HeadTrackable_OnNewLongestChain_Call[H, BLOCK_HASH] { + return &HeadTrackable_OnNewLongestChain_Call[H, BLOCK_HASH]{Call: _e.mock.On("OnNewLongestChain", ctx, head)} +} + +func (_c *HeadTrackable_OnNewLongestChain_Call[H, BLOCK_HASH]) Run(run func(ctx context.Context, head H)) *HeadTrackable_OnNewLongestChain_Call[H, BLOCK_HASH] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(H)) + }) + return _c +} + +func (_c *HeadTrackable_OnNewLongestChain_Call[H, BLOCK_HASH]) Return() *HeadTrackable_OnNewLongestChain_Call[H, BLOCK_HASH] { + _c.Call.Return() + return _c +} + +func (_c *HeadTrackable_OnNewLongestChain_Call[H, BLOCK_HASH]) RunAndReturn(run func(context.Context, H)) *HeadTrackable_OnNewLongestChain_Call[H, BLOCK_HASH] { + _c.Call.Return(run) + return _c +} + // NewHeadTrackable creates a new instance of HeadTrackable. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewHeadTrackable[H types.Head[BLOCK_HASH], BLOCK_HASH types.Hashable](t interface { diff --git a/common/headtracker/mocks/head_tracker.go b/common/headtracker/mocks/head_tracker.go index b02c605f535..d7f8a5fc754 100644 --- a/common/headtracker/mocks/head_tracker.go +++ b/common/headtracker/mocks/head_tracker.go @@ -15,6 +15,14 @@ type HeadTracker[H types.Head[BLOCK_HASH], BLOCK_HASH types.Hashable] struct { mock.Mock } +type HeadTracker_Expecter[H types.Head[BLOCK_HASH], BLOCK_HASH types.Hashable] struct { + mock *mock.Mock +} + +func (_m *HeadTracker[H, BLOCK_HASH]) EXPECT() *HeadTracker_Expecter[H, BLOCK_HASH] { + return &HeadTracker_Expecter[H, BLOCK_HASH]{mock: &_m.Mock} +} + // Backfill provides a mock function with given fields: ctx, headWithChain func (_m *HeadTracker[H, BLOCK_HASH]) Backfill(ctx context.Context, headWithChain H) error { ret := _m.Called(ctx, headWithChain) @@ -33,6 +41,35 @@ func (_m *HeadTracker[H, BLOCK_HASH]) Backfill(ctx context.Context, headWithChai return r0 } +// HeadTracker_Backfill_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Backfill' +type HeadTracker_Backfill_Call[H types.Head[BLOCK_HASH], BLOCK_HASH types.Hashable] struct { + *mock.Call +} + +// Backfill is a helper method to define mock.On call +// - ctx context.Context +// - headWithChain H +func (_e *HeadTracker_Expecter[H, BLOCK_HASH]) Backfill(ctx interface{}, headWithChain interface{}) *HeadTracker_Backfill_Call[H, BLOCK_HASH] { + return &HeadTracker_Backfill_Call[H, BLOCK_HASH]{Call: _e.mock.On("Backfill", ctx, headWithChain)} +} + +func (_c *HeadTracker_Backfill_Call[H, BLOCK_HASH]) Run(run func(ctx context.Context, headWithChain H)) *HeadTracker_Backfill_Call[H, BLOCK_HASH] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(H)) + }) + return _c +} + +func (_c *HeadTracker_Backfill_Call[H, BLOCK_HASH]) Return(err error) *HeadTracker_Backfill_Call[H, BLOCK_HASH] { + _c.Call.Return(err) + return _c +} + +func (_c *HeadTracker_Backfill_Call[H, BLOCK_HASH]) RunAndReturn(run func(context.Context, H) error) *HeadTracker_Backfill_Call[H, BLOCK_HASH] { + _c.Call.Return(run) + return _c +} + // Close provides a mock function with given fields: func (_m *HeadTracker[H, BLOCK_HASH]) Close() error { ret := _m.Called() @@ -51,6 +88,33 @@ func (_m *HeadTracker[H, BLOCK_HASH]) Close() error { return r0 } +// HeadTracker_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close' +type HeadTracker_Close_Call[H types.Head[BLOCK_HASH], BLOCK_HASH types.Hashable] struct { + *mock.Call +} + +// Close is a helper method to define mock.On call +func (_e *HeadTracker_Expecter[H, BLOCK_HASH]) Close() *HeadTracker_Close_Call[H, BLOCK_HASH] { + return &HeadTracker_Close_Call[H, BLOCK_HASH]{Call: _e.mock.On("Close")} +} + +func (_c *HeadTracker_Close_Call[H, BLOCK_HASH]) Run(run func()) *HeadTracker_Close_Call[H, BLOCK_HASH] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *HeadTracker_Close_Call[H, BLOCK_HASH]) Return(_a0 error) *HeadTracker_Close_Call[H, BLOCK_HASH] { + _c.Call.Return(_a0) + return _c +} + +func (_c *HeadTracker_Close_Call[H, BLOCK_HASH]) RunAndReturn(run func() error) *HeadTracker_Close_Call[H, BLOCK_HASH] { + _c.Call.Return(run) + return _c +} + // HealthReport provides a mock function with given fields: func (_m *HeadTracker[H, BLOCK_HASH]) HealthReport() map[string]error { ret := _m.Called() @@ -71,6 +135,33 @@ func (_m *HeadTracker[H, BLOCK_HASH]) HealthReport() map[string]error { return r0 } +// HeadTracker_HealthReport_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HealthReport' +type HeadTracker_HealthReport_Call[H types.Head[BLOCK_HASH], BLOCK_HASH types.Hashable] struct { + *mock.Call +} + +// HealthReport is a helper method to define mock.On call +func (_e *HeadTracker_Expecter[H, BLOCK_HASH]) HealthReport() *HeadTracker_HealthReport_Call[H, BLOCK_HASH] { + return &HeadTracker_HealthReport_Call[H, BLOCK_HASH]{Call: _e.mock.On("HealthReport")} +} + +func (_c *HeadTracker_HealthReport_Call[H, BLOCK_HASH]) Run(run func()) *HeadTracker_HealthReport_Call[H, BLOCK_HASH] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *HeadTracker_HealthReport_Call[H, BLOCK_HASH]) Return(_a0 map[string]error) *HeadTracker_HealthReport_Call[H, BLOCK_HASH] { + _c.Call.Return(_a0) + return _c +} + +func (_c *HeadTracker_HealthReport_Call[H, BLOCK_HASH]) RunAndReturn(run func() map[string]error) *HeadTracker_HealthReport_Call[H, BLOCK_HASH] { + _c.Call.Return(run) + return _c +} + // LatestAndFinalizedBlock provides a mock function with given fields: ctx func (_m *HeadTracker[H, BLOCK_HASH]) LatestAndFinalizedBlock(ctx context.Context) (H, H, error) { ret := _m.Called(ctx) @@ -106,6 +197,34 @@ func (_m *HeadTracker[H, BLOCK_HASH]) LatestAndFinalizedBlock(ctx context.Contex return r0, r1, r2 } +// HeadTracker_LatestAndFinalizedBlock_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LatestAndFinalizedBlock' +type HeadTracker_LatestAndFinalizedBlock_Call[H types.Head[BLOCK_HASH], BLOCK_HASH types.Hashable] struct { + *mock.Call +} + +// LatestAndFinalizedBlock is a helper method to define mock.On call +// - ctx context.Context +func (_e *HeadTracker_Expecter[H, BLOCK_HASH]) LatestAndFinalizedBlock(ctx interface{}) *HeadTracker_LatestAndFinalizedBlock_Call[H, BLOCK_HASH] { + return &HeadTracker_LatestAndFinalizedBlock_Call[H, BLOCK_HASH]{Call: _e.mock.On("LatestAndFinalizedBlock", ctx)} +} + +func (_c *HeadTracker_LatestAndFinalizedBlock_Call[H, BLOCK_HASH]) Run(run func(ctx context.Context)) *HeadTracker_LatestAndFinalizedBlock_Call[H, BLOCK_HASH] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *HeadTracker_LatestAndFinalizedBlock_Call[H, BLOCK_HASH]) Return(latest H, finalized H, err error) *HeadTracker_LatestAndFinalizedBlock_Call[H, BLOCK_HASH] { + _c.Call.Return(latest, finalized, err) + return _c +} + +func (_c *HeadTracker_LatestAndFinalizedBlock_Call[H, BLOCK_HASH]) RunAndReturn(run func(context.Context) (H, H, error)) *HeadTracker_LatestAndFinalizedBlock_Call[H, BLOCK_HASH] { + _c.Call.Return(run) + return _c +} + // LatestChain provides a mock function with given fields: func (_m *HeadTracker[H, BLOCK_HASH]) LatestChain() H { ret := _m.Called() @@ -124,6 +243,33 @@ func (_m *HeadTracker[H, BLOCK_HASH]) LatestChain() H { return r0 } +// HeadTracker_LatestChain_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LatestChain' +type HeadTracker_LatestChain_Call[H types.Head[BLOCK_HASH], BLOCK_HASH types.Hashable] struct { + *mock.Call +} + +// LatestChain is a helper method to define mock.On call +func (_e *HeadTracker_Expecter[H, BLOCK_HASH]) LatestChain() *HeadTracker_LatestChain_Call[H, BLOCK_HASH] { + return &HeadTracker_LatestChain_Call[H, BLOCK_HASH]{Call: _e.mock.On("LatestChain")} +} + +func (_c *HeadTracker_LatestChain_Call[H, BLOCK_HASH]) Run(run func()) *HeadTracker_LatestChain_Call[H, BLOCK_HASH] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *HeadTracker_LatestChain_Call[H, BLOCK_HASH]) Return(_a0 H) *HeadTracker_LatestChain_Call[H, BLOCK_HASH] { + _c.Call.Return(_a0) + return _c +} + +func (_c *HeadTracker_LatestChain_Call[H, BLOCK_HASH]) RunAndReturn(run func() H) *HeadTracker_LatestChain_Call[H, BLOCK_HASH] { + _c.Call.Return(run) + return _c +} + // Name provides a mock function with given fields: func (_m *HeadTracker[H, BLOCK_HASH]) Name() string { ret := _m.Called() @@ -142,6 +288,33 @@ func (_m *HeadTracker[H, BLOCK_HASH]) Name() string { return r0 } +// HeadTracker_Name_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Name' +type HeadTracker_Name_Call[H types.Head[BLOCK_HASH], BLOCK_HASH types.Hashable] struct { + *mock.Call +} + +// Name is a helper method to define mock.On call +func (_e *HeadTracker_Expecter[H, BLOCK_HASH]) Name() *HeadTracker_Name_Call[H, BLOCK_HASH] { + return &HeadTracker_Name_Call[H, BLOCK_HASH]{Call: _e.mock.On("Name")} +} + +func (_c *HeadTracker_Name_Call[H, BLOCK_HASH]) Run(run func()) *HeadTracker_Name_Call[H, BLOCK_HASH] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *HeadTracker_Name_Call[H, BLOCK_HASH]) Return(_a0 string) *HeadTracker_Name_Call[H, BLOCK_HASH] { + _c.Call.Return(_a0) + return _c +} + +func (_c *HeadTracker_Name_Call[H, BLOCK_HASH]) RunAndReturn(run func() string) *HeadTracker_Name_Call[H, BLOCK_HASH] { + _c.Call.Return(run) + return _c +} + // Ready provides a mock function with given fields: func (_m *HeadTracker[H, BLOCK_HASH]) Ready() error { ret := _m.Called() @@ -160,6 +333,33 @@ func (_m *HeadTracker[H, BLOCK_HASH]) Ready() error { return r0 } +// HeadTracker_Ready_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Ready' +type HeadTracker_Ready_Call[H types.Head[BLOCK_HASH], BLOCK_HASH types.Hashable] struct { + *mock.Call +} + +// Ready is a helper method to define mock.On call +func (_e *HeadTracker_Expecter[H, BLOCK_HASH]) Ready() *HeadTracker_Ready_Call[H, BLOCK_HASH] { + return &HeadTracker_Ready_Call[H, BLOCK_HASH]{Call: _e.mock.On("Ready")} +} + +func (_c *HeadTracker_Ready_Call[H, BLOCK_HASH]) Run(run func()) *HeadTracker_Ready_Call[H, BLOCK_HASH] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *HeadTracker_Ready_Call[H, BLOCK_HASH]) Return(_a0 error) *HeadTracker_Ready_Call[H, BLOCK_HASH] { + _c.Call.Return(_a0) + return _c +} + +func (_c *HeadTracker_Ready_Call[H, BLOCK_HASH]) RunAndReturn(run func() error) *HeadTracker_Ready_Call[H, BLOCK_HASH] { + _c.Call.Return(run) + return _c +} + // Start provides a mock function with given fields: _a0 func (_m *HeadTracker[H, BLOCK_HASH]) Start(_a0 context.Context) error { ret := _m.Called(_a0) @@ -178,6 +378,34 @@ func (_m *HeadTracker[H, BLOCK_HASH]) Start(_a0 context.Context) error { return r0 } +// HeadTracker_Start_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Start' +type HeadTracker_Start_Call[H types.Head[BLOCK_HASH], BLOCK_HASH types.Hashable] struct { + *mock.Call +} + +// Start is a helper method to define mock.On call +// - _a0 context.Context +func (_e *HeadTracker_Expecter[H, BLOCK_HASH]) Start(_a0 interface{}) *HeadTracker_Start_Call[H, BLOCK_HASH] { + return &HeadTracker_Start_Call[H, BLOCK_HASH]{Call: _e.mock.On("Start", _a0)} +} + +func (_c *HeadTracker_Start_Call[H, BLOCK_HASH]) Run(run func(_a0 context.Context)) *HeadTracker_Start_Call[H, BLOCK_HASH] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *HeadTracker_Start_Call[H, BLOCK_HASH]) Return(_a0 error) *HeadTracker_Start_Call[H, BLOCK_HASH] { + _c.Call.Return(_a0) + return _c +} + +func (_c *HeadTracker_Start_Call[H, BLOCK_HASH]) RunAndReturn(run func(context.Context) error) *HeadTracker_Start_Call[H, BLOCK_HASH] { + _c.Call.Return(run) + return _c +} + // NewHeadTracker creates a new instance of HeadTracker. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewHeadTracker[H types.Head[BLOCK_HASH], BLOCK_HASH types.Hashable](t interface { diff --git a/common/headtracker/types/config.go b/common/headtracker/types/config.go index 06ad93d39d2..19ec519aa35 100644 --- a/common/headtracker/types/config.go +++ b/common/headtracker/types/config.go @@ -15,4 +15,5 @@ type HeadTrackerConfig interface { SamplingInterval() time.Duration FinalityTagBypass() bool MaxAllowedFinalityDepth() uint32 + PersistenceEnabled() bool } diff --git a/common/txmgr/broadcaster.go b/common/txmgr/broadcaster.go index 2a9c1231d7b..8ecd6dbf46b 100644 --- a/common/txmgr/broadcaster.go +++ b/common/txmgr/broadcaster.go @@ -20,6 +20,7 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/utils" "github.com/smartcontractkit/chainlink/v2/common/client" + commonfee "github.com/smartcontractkit/chainlink/v2/common/fee" feetypes "github.com/smartcontractkit/chainlink/v2/common/fee/types" txmgrtypes "github.com/smartcontractkit/chainlink/v2/common/txmgr/types" "github.com/smartcontractkit/chainlink/v2/common/types" @@ -34,6 +35,13 @@ const ( // TransmitCheckTimeout controls the maximum amount of time that will be // spent on the transmit check. TransmitCheckTimeout = 2 * time.Second + + // maxBroadcastRetries is the number of times a transaction broadcast is retried when the sequence fails to increment on Hedera + maxHederaBroadcastRetries = 3 + + // hederaChainType is the string representation of the Hedera chain type + // Temporary solution until the Broadcaster is moved to the EVM code base + hederaChainType = "hedera" ) var ( @@ -114,6 +122,7 @@ type Broadcaster[ sequenceTracker txmgrtypes.SequenceTracker[ADDR, SEQ] resumeCallback ResumeCallback chainID CHAIN_ID + chainType string config txmgrtypes.BroadcasterChainConfig feeConfig txmgrtypes.BroadcasterFeeConfig txConfig txmgrtypes.BroadcasterTransactionsConfig @@ -163,6 +172,7 @@ func NewBroadcaster[ lggr logger.Logger, checkerFactory TransmitCheckerFactory[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], autoSyncSequence bool, + chainType string, ) *Broadcaster[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { lggr = logger.Named(lggr, "Broadcaster") b := &Broadcaster[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]{ @@ -171,6 +181,7 @@ func NewBroadcaster[ client: client, TxAttemptBuilder: txAttemptBuilder, chainID: client.ConfiguredChainID(), + chainType: chainType, config: config, feeConfig: feeConfig, txConfig: txConfig, @@ -411,7 +422,7 @@ func (eb *Broadcaster[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) hand return fmt.Errorf("handleAnyInProgressTx failed: %w", err), true } if etx != nil { - if err, retryable := eb.handleInProgressTx(ctx, *etx, etx.TxAttempts[0], etx.CreatedAt); err != nil { + if err, retryable := eb.handleInProgressTx(ctx, *etx, etx.TxAttempts[0], etx.CreatedAt, 0); err != nil { return fmt.Errorf("handleAnyInProgressTx failed: %w", err), retryable } } @@ -424,7 +435,11 @@ func (eb *Broadcaster[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) hand } attempt, _, _, retryable, err := eb.NewTxAttempt(ctx, *etx, eb.lggr) - if err != nil { + // Mark transaction as fatal if provided gas limit is set too low + if errors.Is(err, commonfee.ErrFeeLimitTooLow) { + etx.Error = null.StringFrom(commonfee.ErrFeeLimitTooLow.Error()) + return eb.saveFatallyErroredTransaction(eb.lggr, etx), false + } else if err != nil { return fmt.Errorf("processUnstartedTxs failed on NewAttempt: %w", err), retryable } @@ -464,12 +479,12 @@ func (eb *Broadcaster[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) hand return fmt.Errorf("processUnstartedTxs failed on UpdateTxUnstartedToInProgress: %w", err), true } - return eb.handleInProgressTx(ctx, *etx, attempt, time.Now()) + return eb.handleInProgressTx(ctx, *etx, attempt, time.Now(), 0) } // There can be at most one in_progress transaction per address. // Here we complete the job that we didn't finish last time. -func (eb *Broadcaster[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) handleInProgressTx(ctx context.Context, etx txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], attempt txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], initialBroadcastAt time.Time) (error, bool) { +func (eb *Broadcaster[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) handleInProgressTx(ctx context.Context, etx txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], attempt txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], initialBroadcastAt time.Time, retryCount int) (error, bool) { if etx.State != TxInProgress { return fmt.Errorf("invariant violation: expected transaction %v to be in_progress, it was %s", etx.ID, etx.State), false } @@ -478,16 +493,21 @@ func (eb *Broadcaster[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) hand lgr.Infow("Sending transaction", "txAttemptID", attempt.ID, "txHash", attempt.Hash, "meta", etx.Meta, "feeLimit", attempt.ChainSpecificFeeLimit, "callerProvidedFeeLimit", etx.FeeLimit, "attempt", attempt, "etx", etx) errType, err := eb.client.SendTransactionReturnCode(ctx, etx, attempt, lgr) - if errType != client.Fatal { - etx.InitialBroadcastAt = &initialBroadcastAt - etx.BroadcastAt = &initialBroadcastAt + // The validation below is only applicable to Hedera because it has instant finality and a unique sequence behavior + if eb.chainType == hederaChainType { + errType, err = eb.validateOnChainSequence(ctx, lgr, errType, err, etx, retryCount) } - switch errType { - case client.Fatal: + if errType == client.Fatal || errType == client.TerminallyStuck { eb.SvcErrBuffer.Append(err) etx.Error = null.StringFrom(err.Error()) return eb.saveFatallyErroredTransaction(lgr, &etx), true + } + + etx.InitialBroadcastAt = &initialBroadcastAt + etx.BroadcastAt = &initialBroadcastAt + + switch errType { case client.TransactionAlreadyKnown: fallthrough case client.Successful: @@ -538,21 +558,33 @@ func (eb *Broadcaster[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) hand eb.sequenceTracker.GenerateNextSequence(etx.FromAddress, *etx.Sequence) return err, true case client.Underpriced: - return eb.tryAgainBumpingGas(ctx, lgr, err, etx, attempt, initialBroadcastAt) + bumpedAttempt, retryable, replaceErr := eb.replaceAttemptWithBumpedGas(ctx, lgr, err, etx, attempt) + if replaceErr != nil { + return replaceErr, retryable + } + + return eb.handleInProgressTx(ctx, etx, bumpedAttempt, initialBroadcastAt, retryCount+1) case client.InsufficientFunds: - // NOTE: This bails out of the entire cycle and essentially "blocks" on - // any transaction that gets insufficient_funds. This is OK if a - // transaction with a large VALUE blocks because this always comes last - // in the processing list. - // If it blocks because of a transaction that is expensive due to large - // gas limit, we could have smaller transactions "above" it that could - // theoretically be sent, but will instead be blocked. + // NOTE: This can occur due to either insufficient funds or a gas spike + // combined with a high gas limit. Regardless of the cause, we need to obtain a new estimate, + // replace the current attempt, and retry after the backoff duration. + // The new attempt must be replaced immediately because of a database constraint. eb.SvcErrBuffer.Append(err) - fallthrough + if _, _, replaceErr := eb.replaceAttemptWithNewEstimation(ctx, lgr, etx, attempt); replaceErr != nil { + return replaceErr, true + } + return err, true case client.Retryable: return err, true case client.FeeOutOfValidRange: - return eb.tryAgainWithNewEstimation(ctx, lgr, err, etx, attempt, initialBroadcastAt) + replacementAttempt, retryable, replaceErr := eb.replaceAttemptWithNewEstimation(ctx, lgr, etx, attempt) + if replaceErr != nil { + return replaceErr, retryable + } + + lgr.Warnw("L2 rejected transaction due to incorrect fee, re-estimated and will try again", + "etxID", etx.ID, "err", err, "newGasPrice", replacementAttempt.TxFee, "newGasLimit", replacementAttempt.ChainSpecificFeeLimit) + return eb.handleInProgressTx(ctx, etx, *replacementAttempt, initialBroadcastAt, 0) case client.Unsupported: return err, false case client.ExceedsMaxFee: @@ -600,6 +632,44 @@ func (eb *Broadcaster[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) hand } } +func (eb *Broadcaster[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) validateOnChainSequence(ctx context.Context, lgr logger.SugaredLogger, errType client.SendTxReturnCode, err error, etx txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], retryCount int) (client.SendTxReturnCode, error) { + // Only check if sequence was incremented if broadcast was successful, otherwise return the existing err type + if errType != client.Successful { + return errType, err + } + // Transaction sequence cannot be nil here since a sequence is required to broadcast + txSeq := *etx.Sequence + // Retrieve the latest mined sequence from on-chain + nextSeqOnChain, err := eb.client.SequenceAt(ctx, etx.FromAddress, nil) + if err != nil { + return errType, err + } + + // Check that the transaction count has incremented on-chain to include the broadcasted transaction + // Insufficient transaction fee is a common scenario in which the sequence is not incremented by the chain even though we got a successful response + // If the sequence failed to increment and hasn't reached the max retries, return the Underpriced error to try again with a bumped attempt + if nextSeqOnChain.Int64() == txSeq.Int64() && retryCount < maxHederaBroadcastRetries { + return client.Underpriced, nil + } + + // If the transaction reaches the retry limit and fails to get included, mark it as fatally errored + // Some unknown error other than insufficient tx fee could be the cause + if nextSeqOnChain.Int64() == txSeq.Int64() && retryCount >= maxHederaBroadcastRetries { + err := fmt.Errorf("failed to broadcast transaction on %s after %d retries", hederaChainType, retryCount) + lgr.Error(err.Error()) + return client.Fatal, err + } + + // Belts and braces approach to detect and handle sqeuence gaps if the broadcast is considered successful + if nextSeqOnChain.Int64() < txSeq.Int64() { + err := fmt.Errorf("next expected sequence on-chain (%s) is less than the broadcasted transaction's sequence (%s)", nextSeqOnChain.String(), txSeq.String()) + lgr.Criticalw("Sequence gap has been detected and needs to be filled", "error", err) + return client.Fatal, err + } + + return client.Successful, nil +} + // Finds next transaction in the queue, assigns a sequence, and moves it to "in_progress" state ready for broadcast. // Returns nil if no transactions are in queue func (eb *Broadcaster[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) nextUnstartedTransactionWithSequence(fromAddress ADDR) (*txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], error) { @@ -622,48 +692,47 @@ func (eb *Broadcaster[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) next return etx, nil } -func (eb *Broadcaster[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) tryAgainBumpingGas(ctx context.Context, lgr logger.Logger, txError error, etx txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], attempt txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], initialBroadcastAt time.Time) (err error, retryable bool) { - logger.With(lgr, - "sendError", txError, - "attemptFee", attempt.TxFee, - "maxGasPriceConfig", eb.feeConfig.MaxFeePrice(), - ).Errorf("attempt fee %v was rejected by the node for being too low. "+ - "Node returned: '%s'. "+ - "Will bump and retry. ACTION REQUIRED: This is a configuration error. "+ - "Consider increasing FeeEstimator.PriceDefault (current value: %s)", - attempt.TxFee, txError.Error(), eb.feeConfig.FeePriceDefault()) - - replacementAttempt, bumpedFee, bumpedFeeLimit, retryable, err := eb.NewBumpTxAttempt(ctx, etx, attempt, nil, lgr) +// replaceAttemptWithBumpedGas performs the replacement of the existing tx attempt with a new bumped fee attempt. +func (eb *Broadcaster[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) replaceAttemptWithBumpedGas(ctx context.Context, lgr logger.Logger, txError error, etx txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], attempt txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) (replacedAttempt txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], retryable bool, err error) { + // This log error is not applicable to Hedera since the action required would not be needed for its gas estimator + if eb.chainType != hederaChainType { + logger.With(lgr, + "sendError", txError, + "attemptFee", attempt.TxFee, + "maxGasPriceConfig", eb.feeConfig.MaxFeePrice(), + ).Errorf("attempt fee %v was rejected by the node for being too low. "+ + "Node returned: '%s'. "+ + "Will bump and retry. ACTION REQUIRED: This is a configuration error. "+ + "Consider increasing FeeEstimator.PriceDefault (current value: %s)", + attempt.TxFee, txError.Error(), eb.feeConfig.FeePriceDefault()) + } + + bumpedAttempt, bumpedFee, bumpedFeeLimit, retryable, err := eb.NewBumpTxAttempt(ctx, etx, attempt, nil, lgr) if err != nil { - return fmt.Errorf("tryAgainBumpFee failed: %w", err), retryable + return bumpedAttempt, retryable, err } - return eb.saveTryAgainAttempt(ctx, lgr, etx, attempt, replacementAttempt, initialBroadcastAt, bumpedFee, bumpedFeeLimit) -} - -func (eb *Broadcaster[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) tryAgainWithNewEstimation(ctx context.Context, lgr logger.Logger, txError error, etx txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], attempt txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], initialBroadcastAt time.Time) (err error, retryable bool) { - if attempt.TxType == 0x2 { - err = fmt.Errorf("re-estimation is not supported for EIP-1559 transactions. Node returned error: %v. This is a bug", txError.Error()) - logger.Sugared(eb.lggr).AssumptionViolation(err.Error()) - return err, false + if err = eb.txStore.SaveReplacementInProgressAttempt(ctx, attempt, &bumpedAttempt); err != nil { + return bumpedAttempt, true, err } - replacementAttempt, fee, feeLimit, retryable, err := eb.NewTxAttemptWithType(ctx, etx, lgr, attempt.TxType, feetypes.OptForceRefetch) + lgr.Debugw("Bumped fee on initial send", "oldFee", attempt.TxFee.String(), "newFee", bumpedFee.String(), "newFeeLimit", bumpedFeeLimit) + return bumpedAttempt, true, err +} + +// replaceAttemptWithNewEstimation performs the replacement of the existing tx attempt with a new estimated fee attempt. +func (eb *Broadcaster[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) replaceAttemptWithNewEstimation(ctx context.Context, lgr logger.Logger, etx txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], attempt txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) (updatedAttempt *txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], retryable bool, err error) { + newEstimatedAttempt, fee, feeLimit, retryable, err := eb.NewTxAttemptWithType(ctx, etx, lgr, attempt.TxType, feetypes.OptForceRefetch) if err != nil { - return fmt.Errorf("tryAgainWithNewEstimation failed to build new attempt: %w", err), retryable + return &newEstimatedAttempt, retryable, err } - lgr.Warnw("L2 rejected transaction due to incorrect fee, re-estimated and will try again", - "etxID", etx.ID, "err", err, "newGasPrice", fee, "newGasLimit", feeLimit) - - return eb.saveTryAgainAttempt(ctx, lgr, etx, attempt, replacementAttempt, initialBroadcastAt, fee, feeLimit) -} -func (eb *Broadcaster[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) saveTryAgainAttempt(ctx context.Context, lgr logger.Logger, etx txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], attempt txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], replacementAttempt txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], initialBroadcastAt time.Time, newFee FEE, newFeeLimit uint64) (err error, retyrable bool) { - if err = eb.txStore.SaveReplacementInProgressAttempt(ctx, attempt, &replacementAttempt); err != nil { - return fmt.Errorf("tryAgainWithNewFee failed: %w", err), true + if err = eb.txStore.SaveReplacementInProgressAttempt(ctx, attempt, &newEstimatedAttempt); err != nil { + return &newEstimatedAttempt, true, err } - lgr.Debugw("Bumped fee on initial send", "oldFee", attempt.TxFee.String(), "newFee", newFee.String(), "newFeeLimit", newFeeLimit) - return eb.handleInProgressTx(ctx, etx, replacementAttempt, initialBroadcastAt) + + lgr.Debugw("new estimated fee on initial send", "oldFee", attempt.TxFee.String(), "newFee", fee.String(), "newFeeLimit", feeLimit) + return &newEstimatedAttempt, true, err } func (eb *Broadcaster[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) saveFatallyErroredTransaction(lgr logger.Logger, etx *txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) error { @@ -687,7 +756,7 @@ func (eb *Broadcaster[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) save // Now we have an errored pipeline even though the tx succeeded. This case // is relatively benign and probably nobody will ever run into it in // practice, but something to be aware of. - if etx.PipelineTaskRunID.Valid && eb.resumeCallback != nil && etx.SignalCallback { + if etx.PipelineTaskRunID.Valid && eb.resumeCallback != nil && etx.SignalCallback && !etx.CallbackCompleted { err := eb.resumeCallback(ctx, etx.PipelineTaskRunID.UUID, nil, fmt.Errorf("fatal error while sending transaction: %s", etx.Error.String)) if errors.Is(err, sql.ErrNoRows) { lgr.Debugw("callback missing or already resumed", "etxID", etx.ID) diff --git a/common/txmgr/confirmer.go b/common/txmgr/confirmer.go index a9e30ffff1e..4eaa6739d58 100644 --- a/common/txmgr/confirmer.go +++ b/common/txmgr/confirmer.go @@ -2,6 +2,7 @@ package txmgr import ( "context" + "database/sql" "encoding/hex" "errors" "fmt" @@ -102,6 +103,10 @@ var ( }, []string{"chainID"}) ) +type confirmerHeadTracker[HEAD types.Head[BLOCK_HASH], BLOCK_HASH types.Hashable] interface { + LatestAndFinalizedBlock(ctx context.Context) (latest, finalized HEAD, err error) +} + // Confirmer is a broad service which performs four different tasks in sequence on every new longest chain // Step 1: Mark that all currently pending transaction attempts were broadcast before this block // Step 2: Check pending transactions for receipts @@ -133,14 +138,15 @@ type Confirmer[ ks txmgrtypes.KeyStore[ADDR, CHAIN_ID, SEQ] enabledAddresses []ADDR - mb *mailbox.Mailbox[HEAD] - stopCh services.StopChan - wg sync.WaitGroup - initSync sync.Mutex - isStarted bool - + mb *mailbox.Mailbox[HEAD] + stopCh services.StopChan + wg sync.WaitGroup + initSync sync.Mutex + isStarted bool nConsecutiveBlocksChainTooShort int isReceiptNil func(R) bool + + headTracker confirmerHeadTracker[HEAD, BLOCK_HASH] } func NewConfirmer[ @@ -164,6 +170,7 @@ func NewConfirmer[ lggr logger.Logger, isReceiptNil func(R) bool, stuckTxDetector txmgrtypes.StuckTxDetector[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], + headTracker confirmerHeadTracker[HEAD, BLOCK_HASH], ) *Confirmer[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { lggr = logger.Named(lggr, "Confirmer") return &Confirmer[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE]{ @@ -181,6 +188,7 @@ func NewConfirmer[ mb: mailbox.NewSingle[HEAD](), isReceiptNil: isReceiptNil, stuckTxDetector: stuckTxDetector, + headTracker: headTracker, } } @@ -297,7 +305,20 @@ func (ec *Confirmer[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) pro return fmt.Errorf("CheckConfirmedMissingReceipt failed: %w", err) } - if err := ec.CheckForReceipts(ctx, head.BlockNumber()); err != nil { + _, latestFinalizedHead, err := ec.headTracker.LatestAndFinalizedBlock(ctx) + if err != nil { + return fmt.Errorf("failed to retrieve latest finalized head: %w", err) + } + + if !latestFinalizedHead.IsValid() { + return fmt.Errorf("latest finalized head is not valid") + } + + if latestFinalizedHead.BlockNumber() > head.BlockNumber() { + ec.lggr.Debugw("processHead received old block", "latestFinalizedHead", latestFinalizedHead.BlockNumber(), "headNum", head.BlockNumber(), "time", time.Since(mark), "id", "confirmer") + } + + if err := ec.CheckForReceipts(ctx, head.BlockNumber(), latestFinalizedHead.BlockNumber()); err != nil { return fmt.Errorf("CheckForReceipts failed: %w", err) } @@ -318,7 +339,7 @@ func (ec *Confirmer[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) pro ec.lggr.Debugw("Finished RebroadcastWhereNecessary", "headNum", head.BlockNumber(), "time", time.Since(mark), "id", "confirmer") mark = time.Now() - if err := ec.EnsureConfirmedTransactionsInLongestChain(ctx, head); err != nil { + if err := ec.EnsureConfirmedTransactionsInLongestChain(ctx, head, latestFinalizedHead.BlockNumber()); err != nil { return fmt.Errorf("EnsureConfirmedTransactionsInLongestChain failed: %w", err) } @@ -395,8 +416,8 @@ func (ec *Confirmer[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Che return } -// CheckForReceipts finds attempts that are still pending and checks to see if a receipt is present for the given block number -func (ec *Confirmer[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) CheckForReceipts(ctx context.Context, blockNum int64) error { +// CheckForReceipts finds attempts that are still pending and checks to see if a receipt is present for the given block number. +func (ec *Confirmer[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) CheckForReceipts(ctx context.Context, blockNum int64, latestFinalizedBlockNum int64) error { attempts, err := ec.txStore.FindTxAttemptsRequiringReceiptFetch(ctx, ec.chainID) if err != nil { return fmt.Errorf("FindTxAttemptsRequiringReceiptFetch failed: %w", err) @@ -443,7 +464,7 @@ func (ec *Confirmer[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Che return fmt.Errorf("unable to mark txes as 'confirmed_missing_receipt': %w", err) } - if err := ec.txStore.MarkOldTxesMissingReceiptAsErrored(ctx, blockNum, ec.chainConfig.FinalityDepth(), ec.chainID); err != nil { + if err := ec.txStore.MarkOldTxesMissingReceiptAsErrored(ctx, blockNum, latestFinalizedBlockNum, ec.chainID); err != nil { return fmt.Errorf("unable to confirm buried unconfirmed txes': %w", err) } return nil @@ -471,7 +492,7 @@ func (ec *Confirmer[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Pro go func(tx txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) { defer wg.Done() lggr := tx.GetLogger(ec.lggr) - // Create an purge attempt for tx + // Create a purge attempt for tx purgeAttempt, err := ec.TxAttemptBuilder.NewPurgeTxAttempt(ctx, tx, lggr) if err != nil { errMu.Lock() @@ -494,6 +515,13 @@ func (ec *Confirmer[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Pro errMu.Unlock() return } + // Resume pending task runs with failure for stuck transactions + if err := ec.resumeFailedTaskRuns(ctx, tx); err != nil { + errMu.Lock() + errorList = append(errorList, fmt.Errorf("failed to resume pending task run for transaction: %w", err)) + errMu.Unlock() + return + } }(tx) } wg.Wait() @@ -564,7 +592,8 @@ func (ec *Confirmer[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) fet return fmt.Errorf("saveFetchedReceipts failed: %w", err) } // Save the receipts but mark the associated transactions as Fatal Error since the original transaction was purged - if err := ec.txStore.SaveFetchedReceipts(ctx, purgeReceipts, TxFatalError, ec.stuckTxDetector.StuckTxFatalError(), ec.chainID); err != nil { + stuckTxFatalErrMsg := ec.stuckTxDetector.StuckTxFatalError() + if err := ec.txStore.SaveFetchedReceipts(ctx, purgeReceipts, TxFatalError, &stuckTxFatalErrMsg, ec.chainID); err != nil { return fmt.Errorf("saveFetchedReceipts failed: %w", err) } promNumConfirmedTxs.WithLabelValues(ec.chainID.String()).Add(float64(len(receipts))) @@ -596,6 +625,24 @@ func (ec *Confirmer[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) sep return } +func (ec *Confirmer[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) resumeFailedTaskRuns(ctx context.Context, etx txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) error { + if !etx.PipelineTaskRunID.Valid || ec.resumeCallback == nil || !etx.SignalCallback || etx.CallbackCompleted { + return nil + } + err := ec.resumeCallback(ctx, etx.PipelineTaskRunID.UUID, nil, errors.New(ec.stuckTxDetector.StuckTxFatalError())) + if errors.Is(err, sql.ErrNoRows) { + ec.lggr.Debugw("callback missing or already resumed", "etxID", etx.ID) + } else if err != nil { + return fmt.Errorf("failed to resume pipeline: %w", err) + } else { + // Mark tx as having completed callback + if err = ec.txStore.UpdateTxCallbackCompleted(ctx, etx.PipelineTaskRunID.UUID, ec.chainID); err != nil { + return err + } + } + return nil +} + func (ec *Confirmer[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) getMinedSequenceForAddress(ctx context.Context, from ADDR) (SEQ, error) { return ec.client.SequenceAt(ctx, from, nil) } @@ -664,11 +711,15 @@ func (ec *Confirmer[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) bat } if receipt.GetStatus() == 0 { - rpcError, errExtract := ec.client.CallContract(ctx, attempt, receipt.GetBlockNumber()) - if errExtract == nil { - l.Warnw("transaction reverted on-chain", "hash", receipt.GetTxHash(), "rpcError", rpcError.String()) + if receipt.GetRevertReason() != nil { + l.Warnw("transaction reverted on-chain", "hash", receipt.GetTxHash(), "revertReason", *receipt.GetRevertReason()) } else { - l.Warnw("transaction reverted on-chain unable to extract revert reason", "hash", receipt.GetTxHash(), "err", err) + rpcError, errExtract := ec.client.CallContract(ctx, attempt, receipt.GetBlockNumber()) + if errExtract == nil { + l.Warnw("transaction reverted on-chain", "hash", receipt.GetTxHash(), "rpcError", rpcError.String()) + } else { + l.Warnw("transaction reverted on-chain unable to extract revert reason", "hash", receipt.GetTxHash(), "err", err) + } } // This might increment more than once e.g. in case of re-orgs going back and forth we might re-fetch the same receipt promRevertedTxCount.WithLabelValues(ec.chainID.String()).Add(1) @@ -975,6 +1026,21 @@ func (ec *Confirmer[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) han ec.SvcErrBuffer.Append(sendError) // This will loop continuously on every new head so it must be handled manually by the node operator! return ec.txStore.DeleteInProgressAttempt(ctx, attempt) + case client.TerminallyStuck: + // A transaction could broadcast successfully but then be considered terminally stuck on another attempt + // Even though the transaction can succeed under different circumstances, we want to purge this transaction as soon as we get this error + lggr.Warnw("terminally stuck transaction detected", "err", sendError.Error()) + ec.SvcErrBuffer.Append(sendError) + // Create a purge attempt for tx + purgeAttempt, err := ec.TxAttemptBuilder.NewPurgeTxAttempt(ctx, etx, lggr) + if err != nil { + return fmt.Errorf("NewPurgeTxAttempt failed: %w", err) + } + // Replace the in progress attempt with the purge attempt + if err := ec.txStore.SaveReplacementInProgressAttempt(ctx, attempt, &purgeAttempt); err != nil { + return fmt.Errorf("saveReplacementInProgressAttempt failed: %w", err) + } + return ec.handleInProgressAttempt(ctx, lggr, etx, purgeAttempt, blockHeight) case client.TransactionAlreadyKnown: // Sequence too low indicated that a transaction at this sequence was confirmed already. // Mark confirmed_missing_receipt and wait for the next cycle to try to get a receipt @@ -1000,22 +1066,30 @@ func (ec *Confirmer[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) han } } -// EnsureConfirmedTransactionsInLongestChain finds all confirmed txes up to the depth +// EnsureConfirmedTransactionsInLongestChain finds all confirmed txes up to the earliest head // of the given chain and ensures that every one has a receipt with a block hash that is // in the given chain. // // If any of the confirmed transactions does not have a receipt in the chain, it has been // re-org'd out and will be rebroadcast. -func (ec *Confirmer[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) EnsureConfirmedTransactionsInLongestChain(ctx context.Context, head types.Head[BLOCK_HASH]) error { - if head.ChainLength() < ec.chainConfig.FinalityDepth() { - logArgs := []interface{}{ - "chainLength", head.ChainLength(), "finalityDepth", ec.chainConfig.FinalityDepth(), - } +func (ec *Confirmer[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) EnsureConfirmedTransactionsInLongestChain(ctx context.Context, head types.Head[BLOCK_HASH], latestFinalizedHeadNumber int64) error { + logArgs := []interface{}{ + "chainLength", head.ChainLength(), "latestFinalizedHead number", latestFinalizedHeadNumber, + } + + if head.BlockNumber() < latestFinalizedHeadNumber { + errMsg := "current head is shorter than latest finalized head" + ec.lggr.Errorw(errMsg, append(logArgs, "head block number", head.BlockNumber())...) + return errors.New(errMsg) + } + + calculatedFinalityDepth := uint32(head.BlockNumber() - latestFinalizedHeadNumber) + if head.ChainLength() < calculatedFinalityDepth { if ec.nConsecutiveBlocksChainTooShort > logAfterNConsecutiveBlocksChainTooShort { - warnMsg := "Chain length supplied for re-org detection was shorter than FinalityDepth. Re-org protection is not working properly. This could indicate a problem with the remote RPC endpoint, a compatibility issue with a particular blockchain, a bug with this particular blockchain, heads table being truncated too early, remote node out of sync, or something else. If this happens a lot please raise a bug with the Chainlink team including a log output sample and details of the chain and RPC endpoint you are using." + warnMsg := "Chain length supplied for re-org detection was shorter than the depth from the latest head to the finalized head. Re-org protection is not working properly. This could indicate a problem with the remote RPC endpoint, a compatibility issue with a particular blockchain, a bug with this particular blockchain, heads table being truncated too early, remote node out of sync, or something else. If this happens a lot please raise a bug with the Chainlink team including a log output sample and details of the chain and RPC endpoint you are using." ec.lggr.Warnw(warnMsg, append(logArgs, "nConsecutiveBlocksChainTooShort", ec.nConsecutiveBlocksChainTooShort)...) } else { - logMsg := "Chain length supplied for re-org detection was shorter than FinalityDepth" + logMsg := "Chain length supplied for re-org detection was shorter than the depth from the latest head to the finalized head" ec.lggr.Debugw(logMsg, append(logArgs, "nConsecutiveBlocksChainTooShort", ec.nConsecutiveBlocksChainTooShort)...) } ec.nConsecutiveBlocksChainTooShort++ @@ -1074,10 +1148,11 @@ func hasReceiptInLongestChain[ } } } - if head.GetParent() == nil { + + head = head.GetParent() + if head == nil { return false } - head = head.GetParent() } } diff --git a/common/txmgr/mocks/tx_manager.go b/common/txmgr/mocks/tx_manager.go index c7380b76876..f2d04363993 100644 --- a/common/txmgr/mocks/tx_manager.go +++ b/common/txmgr/mocks/tx_manager.go @@ -25,6 +25,14 @@ type TxManager[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashab mock.Mock } +type TxManager_Expecter[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE feetypes.Fee] struct { + mock *mock.Mock +} + +func (_m *TxManager[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) EXPECT() *TxManager_Expecter[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + return &TxManager_Expecter[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]{mock: &_m.Mock} +} + // Close provides a mock function with given fields: func (_m *TxManager[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Close() error { ret := _m.Called() @@ -43,6 +51,33 @@ func (_m *TxManager[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Close( return r0 } +// TxManager_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close' +type TxManager_Close_Call[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE feetypes.Fee] struct { + *mock.Call +} + +// Close is a helper method to define mock.On call +func (_e *TxManager_Expecter[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Close() *TxManager_Close_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + return &TxManager_Close_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]{Call: _e.mock.On("Close")} +} + +func (_c *TxManager_Close_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Run(run func()) *TxManager_Close_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *TxManager_Close_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Return(_a0 error) *TxManager_Close_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + _c.Call.Return(_a0) + return _c +} + +func (_c *TxManager_Close_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) RunAndReturn(run func() error) *TxManager_Close_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + _c.Call.Return(run) + return _c +} + // CountTransactionsByState provides a mock function with given fields: ctx, state func (_m *TxManager[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) CountTransactionsByState(ctx context.Context, state txmgrtypes.TxState) (uint32, error) { ret := _m.Called(ctx, state) @@ -71,6 +106,35 @@ func (_m *TxManager[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) CountT return r0, r1 } +// TxManager_CountTransactionsByState_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CountTransactionsByState' +type TxManager_CountTransactionsByState_Call[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE feetypes.Fee] struct { + *mock.Call +} + +// CountTransactionsByState is a helper method to define mock.On call +// - ctx context.Context +// - state txmgrtypes.TxState +func (_e *TxManager_Expecter[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) CountTransactionsByState(ctx interface{}, state interface{}) *TxManager_CountTransactionsByState_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + return &TxManager_CountTransactionsByState_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]{Call: _e.mock.On("CountTransactionsByState", ctx, state)} +} + +func (_c *TxManager_CountTransactionsByState_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Run(run func(ctx context.Context, state txmgrtypes.TxState)) *TxManager_CountTransactionsByState_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(txmgrtypes.TxState)) + }) + return _c +} + +func (_c *TxManager_CountTransactionsByState_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Return(count uint32, err error) *TxManager_CountTransactionsByState_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + _c.Call.Return(count, err) + return _c +} + +func (_c *TxManager_CountTransactionsByState_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) RunAndReturn(run func(context.Context, txmgrtypes.TxState) (uint32, error)) *TxManager_CountTransactionsByState_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + _c.Call.Return(run) + return _c +} + // CreateTransaction provides a mock function with given fields: ctx, txRequest func (_m *TxManager[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) CreateTransaction(ctx context.Context, txRequest txmgrtypes.TxRequest[ADDR, TX_HASH]) (txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], error) { ret := _m.Called(ctx, txRequest) @@ -99,6 +163,35 @@ func (_m *TxManager[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Create return r0, r1 } +// TxManager_CreateTransaction_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateTransaction' +type TxManager_CreateTransaction_Call[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE feetypes.Fee] struct { + *mock.Call +} + +// CreateTransaction is a helper method to define mock.On call +// - ctx context.Context +// - txRequest txmgrtypes.TxRequest[ADDR,TX_HASH] +func (_e *TxManager_Expecter[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) CreateTransaction(ctx interface{}, txRequest interface{}) *TxManager_CreateTransaction_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + return &TxManager_CreateTransaction_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]{Call: _e.mock.On("CreateTransaction", ctx, txRequest)} +} + +func (_c *TxManager_CreateTransaction_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Run(run func(ctx context.Context, txRequest txmgrtypes.TxRequest[ADDR, TX_HASH])) *TxManager_CreateTransaction_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(txmgrtypes.TxRequest[ADDR, TX_HASH])) + }) + return _c +} + +func (_c *TxManager_CreateTransaction_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Return(etx txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], err error) *TxManager_CreateTransaction_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + _c.Call.Return(etx, err) + return _c +} + +func (_c *TxManager_CreateTransaction_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) RunAndReturn(run func(context.Context, txmgrtypes.TxRequest[ADDR, TX_HASH]) (txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], error)) *TxManager_CreateTransaction_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + _c.Call.Return(run) + return _c +} + // FindEarliestUnconfirmedBroadcastTime provides a mock function with given fields: ctx func (_m *TxManager[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) FindEarliestUnconfirmedBroadcastTime(ctx context.Context) (null.Time, error) { ret := _m.Called(ctx) @@ -127,6 +220,34 @@ func (_m *TxManager[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) FindEa return r0, r1 } +// TxManager_FindEarliestUnconfirmedBroadcastTime_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindEarliestUnconfirmedBroadcastTime' +type TxManager_FindEarliestUnconfirmedBroadcastTime_Call[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE feetypes.Fee] struct { + *mock.Call +} + +// FindEarliestUnconfirmedBroadcastTime is a helper method to define mock.On call +// - ctx context.Context +func (_e *TxManager_Expecter[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) FindEarliestUnconfirmedBroadcastTime(ctx interface{}) *TxManager_FindEarliestUnconfirmedBroadcastTime_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + return &TxManager_FindEarliestUnconfirmedBroadcastTime_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]{Call: _e.mock.On("FindEarliestUnconfirmedBroadcastTime", ctx)} +} + +func (_c *TxManager_FindEarliestUnconfirmedBroadcastTime_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Run(run func(ctx context.Context)) *TxManager_FindEarliestUnconfirmedBroadcastTime_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *TxManager_FindEarliestUnconfirmedBroadcastTime_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Return(_a0 null.Time, _a1 error) *TxManager_FindEarliestUnconfirmedBroadcastTime_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *TxManager_FindEarliestUnconfirmedBroadcastTime_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) RunAndReturn(run func(context.Context) (null.Time, error)) *TxManager_FindEarliestUnconfirmedBroadcastTime_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + _c.Call.Return(run) + return _c +} + // FindEarliestUnconfirmedTxAttemptBlock provides a mock function with given fields: ctx func (_m *TxManager[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) FindEarliestUnconfirmedTxAttemptBlock(ctx context.Context) (null.Int, error) { ret := _m.Called(ctx) @@ -155,6 +276,34 @@ func (_m *TxManager[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) FindEa return r0, r1 } +// TxManager_FindEarliestUnconfirmedTxAttemptBlock_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindEarliestUnconfirmedTxAttemptBlock' +type TxManager_FindEarliestUnconfirmedTxAttemptBlock_Call[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE feetypes.Fee] struct { + *mock.Call +} + +// FindEarliestUnconfirmedTxAttemptBlock is a helper method to define mock.On call +// - ctx context.Context +func (_e *TxManager_Expecter[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) FindEarliestUnconfirmedTxAttemptBlock(ctx interface{}) *TxManager_FindEarliestUnconfirmedTxAttemptBlock_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + return &TxManager_FindEarliestUnconfirmedTxAttemptBlock_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]{Call: _e.mock.On("FindEarliestUnconfirmedTxAttemptBlock", ctx)} +} + +func (_c *TxManager_FindEarliestUnconfirmedTxAttemptBlock_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Run(run func(ctx context.Context)) *TxManager_FindEarliestUnconfirmedTxAttemptBlock_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *TxManager_FindEarliestUnconfirmedTxAttemptBlock_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Return(_a0 null.Int, _a1 error) *TxManager_FindEarliestUnconfirmedTxAttemptBlock_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *TxManager_FindEarliestUnconfirmedTxAttemptBlock_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) RunAndReturn(run func(context.Context) (null.Int, error)) *TxManager_FindEarliestUnconfirmedTxAttemptBlock_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + _c.Call.Return(run) + return _c +} + // FindTxesByMetaFieldAndStates provides a mock function with given fields: ctx, metaField, metaValue, states, chainID func (_m *TxManager[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) FindTxesByMetaFieldAndStates(ctx context.Context, metaField string, metaValue string, states []txmgrtypes.TxState, chainID *big.Int) ([]*txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], error) { ret := _m.Called(ctx, metaField, metaValue, states, chainID) @@ -185,6 +334,38 @@ func (_m *TxManager[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) FindTx return r0, r1 } +// TxManager_FindTxesByMetaFieldAndStates_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindTxesByMetaFieldAndStates' +type TxManager_FindTxesByMetaFieldAndStates_Call[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE feetypes.Fee] struct { + *mock.Call +} + +// FindTxesByMetaFieldAndStates is a helper method to define mock.On call +// - ctx context.Context +// - metaField string +// - metaValue string +// - states []txmgrtypes.TxState +// - chainID *big.Int +func (_e *TxManager_Expecter[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) FindTxesByMetaFieldAndStates(ctx interface{}, metaField interface{}, metaValue interface{}, states interface{}, chainID interface{}) *TxManager_FindTxesByMetaFieldAndStates_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + return &TxManager_FindTxesByMetaFieldAndStates_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]{Call: _e.mock.On("FindTxesByMetaFieldAndStates", ctx, metaField, metaValue, states, chainID)} +} + +func (_c *TxManager_FindTxesByMetaFieldAndStates_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Run(run func(ctx context.Context, metaField string, metaValue string, states []txmgrtypes.TxState, chainID *big.Int)) *TxManager_FindTxesByMetaFieldAndStates_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string), args[3].([]txmgrtypes.TxState), args[4].(*big.Int)) + }) + return _c +} + +func (_c *TxManager_FindTxesByMetaFieldAndStates_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Return(txes []*txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], err error) *TxManager_FindTxesByMetaFieldAndStates_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + _c.Call.Return(txes, err) + return _c +} + +func (_c *TxManager_FindTxesByMetaFieldAndStates_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) RunAndReturn(run func(context.Context, string, string, []txmgrtypes.TxState, *big.Int) ([]*txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], error)) *TxManager_FindTxesByMetaFieldAndStates_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + _c.Call.Return(run) + return _c +} + // FindTxesWithAttemptsAndReceiptsByIdsAndState provides a mock function with given fields: ctx, ids, states, chainID func (_m *TxManager[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) FindTxesWithAttemptsAndReceiptsByIdsAndState(ctx context.Context, ids []int64, states []txmgrtypes.TxState, chainID *big.Int) ([]*txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], error) { ret := _m.Called(ctx, ids, states, chainID) @@ -215,6 +396,37 @@ func (_m *TxManager[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) FindTx return r0, r1 } +// TxManager_FindTxesWithAttemptsAndReceiptsByIdsAndState_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindTxesWithAttemptsAndReceiptsByIdsAndState' +type TxManager_FindTxesWithAttemptsAndReceiptsByIdsAndState_Call[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE feetypes.Fee] struct { + *mock.Call +} + +// FindTxesWithAttemptsAndReceiptsByIdsAndState is a helper method to define mock.On call +// - ctx context.Context +// - ids []int64 +// - states []txmgrtypes.TxState +// - chainID *big.Int +func (_e *TxManager_Expecter[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) FindTxesWithAttemptsAndReceiptsByIdsAndState(ctx interface{}, ids interface{}, states interface{}, chainID interface{}) *TxManager_FindTxesWithAttemptsAndReceiptsByIdsAndState_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + return &TxManager_FindTxesWithAttemptsAndReceiptsByIdsAndState_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]{Call: _e.mock.On("FindTxesWithAttemptsAndReceiptsByIdsAndState", ctx, ids, states, chainID)} +} + +func (_c *TxManager_FindTxesWithAttemptsAndReceiptsByIdsAndState_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Run(run func(ctx context.Context, ids []int64, states []txmgrtypes.TxState, chainID *big.Int)) *TxManager_FindTxesWithAttemptsAndReceiptsByIdsAndState_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].([]int64), args[2].([]txmgrtypes.TxState), args[3].(*big.Int)) + }) + return _c +} + +func (_c *TxManager_FindTxesWithAttemptsAndReceiptsByIdsAndState_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Return(txes []*txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], err error) *TxManager_FindTxesWithAttemptsAndReceiptsByIdsAndState_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + _c.Call.Return(txes, err) + return _c +} + +func (_c *TxManager_FindTxesWithAttemptsAndReceiptsByIdsAndState_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) RunAndReturn(run func(context.Context, []int64, []txmgrtypes.TxState, *big.Int) ([]*txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], error)) *TxManager_FindTxesWithAttemptsAndReceiptsByIdsAndState_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + _c.Call.Return(run) + return _c +} + // FindTxesWithMetaFieldByReceiptBlockNum provides a mock function with given fields: ctx, metaField, blockNum, chainID func (_m *TxManager[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) FindTxesWithMetaFieldByReceiptBlockNum(ctx context.Context, metaField string, blockNum int64, chainID *big.Int) ([]*txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], error) { ret := _m.Called(ctx, metaField, blockNum, chainID) @@ -245,6 +457,37 @@ func (_m *TxManager[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) FindTx return r0, r1 } +// TxManager_FindTxesWithMetaFieldByReceiptBlockNum_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindTxesWithMetaFieldByReceiptBlockNum' +type TxManager_FindTxesWithMetaFieldByReceiptBlockNum_Call[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE feetypes.Fee] struct { + *mock.Call +} + +// FindTxesWithMetaFieldByReceiptBlockNum is a helper method to define mock.On call +// - ctx context.Context +// - metaField string +// - blockNum int64 +// - chainID *big.Int +func (_e *TxManager_Expecter[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) FindTxesWithMetaFieldByReceiptBlockNum(ctx interface{}, metaField interface{}, blockNum interface{}, chainID interface{}) *TxManager_FindTxesWithMetaFieldByReceiptBlockNum_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + return &TxManager_FindTxesWithMetaFieldByReceiptBlockNum_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]{Call: _e.mock.On("FindTxesWithMetaFieldByReceiptBlockNum", ctx, metaField, blockNum, chainID)} +} + +func (_c *TxManager_FindTxesWithMetaFieldByReceiptBlockNum_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Run(run func(ctx context.Context, metaField string, blockNum int64, chainID *big.Int)) *TxManager_FindTxesWithMetaFieldByReceiptBlockNum_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(int64), args[3].(*big.Int)) + }) + return _c +} + +func (_c *TxManager_FindTxesWithMetaFieldByReceiptBlockNum_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Return(txes []*txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], err error) *TxManager_FindTxesWithMetaFieldByReceiptBlockNum_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + _c.Call.Return(txes, err) + return _c +} + +func (_c *TxManager_FindTxesWithMetaFieldByReceiptBlockNum_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) RunAndReturn(run func(context.Context, string, int64, *big.Int) ([]*txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], error)) *TxManager_FindTxesWithMetaFieldByReceiptBlockNum_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + _c.Call.Return(run) + return _c +} + // FindTxesWithMetaFieldByStates provides a mock function with given fields: ctx, metaField, states, chainID func (_m *TxManager[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) FindTxesWithMetaFieldByStates(ctx context.Context, metaField string, states []txmgrtypes.TxState, chainID *big.Int) ([]*txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], error) { ret := _m.Called(ctx, metaField, states, chainID) @@ -275,6 +518,37 @@ func (_m *TxManager[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) FindTx return r0, r1 } +// TxManager_FindTxesWithMetaFieldByStates_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindTxesWithMetaFieldByStates' +type TxManager_FindTxesWithMetaFieldByStates_Call[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE feetypes.Fee] struct { + *mock.Call +} + +// FindTxesWithMetaFieldByStates is a helper method to define mock.On call +// - ctx context.Context +// - metaField string +// - states []txmgrtypes.TxState +// - chainID *big.Int +func (_e *TxManager_Expecter[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) FindTxesWithMetaFieldByStates(ctx interface{}, metaField interface{}, states interface{}, chainID interface{}) *TxManager_FindTxesWithMetaFieldByStates_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + return &TxManager_FindTxesWithMetaFieldByStates_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]{Call: _e.mock.On("FindTxesWithMetaFieldByStates", ctx, metaField, states, chainID)} +} + +func (_c *TxManager_FindTxesWithMetaFieldByStates_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Run(run func(ctx context.Context, metaField string, states []txmgrtypes.TxState, chainID *big.Int)) *TxManager_FindTxesWithMetaFieldByStates_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].([]txmgrtypes.TxState), args[3].(*big.Int)) + }) + return _c +} + +func (_c *TxManager_FindTxesWithMetaFieldByStates_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Return(txes []*txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], err error) *TxManager_FindTxesWithMetaFieldByStates_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + _c.Call.Return(txes, err) + return _c +} + +func (_c *TxManager_FindTxesWithMetaFieldByStates_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) RunAndReturn(run func(context.Context, string, []txmgrtypes.TxState, *big.Int) ([]*txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], error)) *TxManager_FindTxesWithMetaFieldByStates_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + _c.Call.Return(run) + return _c +} + // GetForwarderForEOA provides a mock function with given fields: ctx, eoa func (_m *TxManager[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) GetForwarderForEOA(ctx context.Context, eoa ADDR) (ADDR, error) { ret := _m.Called(ctx, eoa) @@ -303,6 +577,35 @@ func (_m *TxManager[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) GetFor return r0, r1 } +// TxManager_GetForwarderForEOA_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetForwarderForEOA' +type TxManager_GetForwarderForEOA_Call[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE feetypes.Fee] struct { + *mock.Call +} + +// GetForwarderForEOA is a helper method to define mock.On call +// - ctx context.Context +// - eoa ADDR +func (_e *TxManager_Expecter[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) GetForwarderForEOA(ctx interface{}, eoa interface{}) *TxManager_GetForwarderForEOA_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + return &TxManager_GetForwarderForEOA_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]{Call: _e.mock.On("GetForwarderForEOA", ctx, eoa)} +} + +func (_c *TxManager_GetForwarderForEOA_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Run(run func(ctx context.Context, eoa ADDR)) *TxManager_GetForwarderForEOA_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(ADDR)) + }) + return _c +} + +func (_c *TxManager_GetForwarderForEOA_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Return(forwarder ADDR, err error) *TxManager_GetForwarderForEOA_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + _c.Call.Return(forwarder, err) + return _c +} + +func (_c *TxManager_GetForwarderForEOA_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) RunAndReturn(run func(context.Context, ADDR) (ADDR, error)) *TxManager_GetForwarderForEOA_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + _c.Call.Return(run) + return _c +} + // GetForwarderForEOAOCR2Feeds provides a mock function with given fields: ctx, eoa, ocr2AggregatorID func (_m *TxManager[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) GetForwarderForEOAOCR2Feeds(ctx context.Context, eoa ADDR, ocr2AggregatorID ADDR) (ADDR, error) { ret := _m.Called(ctx, eoa, ocr2AggregatorID) @@ -331,6 +634,36 @@ func (_m *TxManager[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) GetFor return r0, r1 } +// TxManager_GetForwarderForEOAOCR2Feeds_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetForwarderForEOAOCR2Feeds' +type TxManager_GetForwarderForEOAOCR2Feeds_Call[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE feetypes.Fee] struct { + *mock.Call +} + +// GetForwarderForEOAOCR2Feeds is a helper method to define mock.On call +// - ctx context.Context +// - eoa ADDR +// - ocr2AggregatorID ADDR +func (_e *TxManager_Expecter[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) GetForwarderForEOAOCR2Feeds(ctx interface{}, eoa interface{}, ocr2AggregatorID interface{}) *TxManager_GetForwarderForEOAOCR2Feeds_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + return &TxManager_GetForwarderForEOAOCR2Feeds_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]{Call: _e.mock.On("GetForwarderForEOAOCR2Feeds", ctx, eoa, ocr2AggregatorID)} +} + +func (_c *TxManager_GetForwarderForEOAOCR2Feeds_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Run(run func(ctx context.Context, eoa ADDR, ocr2AggregatorID ADDR)) *TxManager_GetForwarderForEOAOCR2Feeds_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(ADDR), args[2].(ADDR)) + }) + return _c +} + +func (_c *TxManager_GetForwarderForEOAOCR2Feeds_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Return(forwarder ADDR, err error) *TxManager_GetForwarderForEOAOCR2Feeds_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + _c.Call.Return(forwarder, err) + return _c +} + +func (_c *TxManager_GetForwarderForEOAOCR2Feeds_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) RunAndReturn(run func(context.Context, ADDR, ADDR) (ADDR, error)) *TxManager_GetForwarderForEOAOCR2Feeds_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + _c.Call.Return(run) + return _c +} + // GetTransactionStatus provides a mock function with given fields: ctx, transactionID func (_m *TxManager[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) GetTransactionStatus(ctx context.Context, transactionID string) (pkgtypes.TransactionStatus, error) { ret := _m.Called(ctx, transactionID) @@ -359,6 +692,35 @@ func (_m *TxManager[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) GetTra return r0, r1 } +// TxManager_GetTransactionStatus_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetTransactionStatus' +type TxManager_GetTransactionStatus_Call[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE feetypes.Fee] struct { + *mock.Call +} + +// GetTransactionStatus is a helper method to define mock.On call +// - ctx context.Context +// - transactionID string +func (_e *TxManager_Expecter[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) GetTransactionStatus(ctx interface{}, transactionID interface{}) *TxManager_GetTransactionStatus_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + return &TxManager_GetTransactionStatus_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]{Call: _e.mock.On("GetTransactionStatus", ctx, transactionID)} +} + +func (_c *TxManager_GetTransactionStatus_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Run(run func(ctx context.Context, transactionID string)) *TxManager_GetTransactionStatus_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *TxManager_GetTransactionStatus_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Return(state pkgtypes.TransactionStatus, err error) *TxManager_GetTransactionStatus_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + _c.Call.Return(state, err) + return _c +} + +func (_c *TxManager_GetTransactionStatus_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) RunAndReturn(run func(context.Context, string) (pkgtypes.TransactionStatus, error)) *TxManager_GetTransactionStatus_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + _c.Call.Return(run) + return _c +} + // HealthReport provides a mock function with given fields: func (_m *TxManager[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) HealthReport() map[string]error { ret := _m.Called() @@ -379,6 +741,33 @@ func (_m *TxManager[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Health return r0 } +// TxManager_HealthReport_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HealthReport' +type TxManager_HealthReport_Call[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE feetypes.Fee] struct { + *mock.Call +} + +// HealthReport is a helper method to define mock.On call +func (_e *TxManager_Expecter[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) HealthReport() *TxManager_HealthReport_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + return &TxManager_HealthReport_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]{Call: _e.mock.On("HealthReport")} +} + +func (_c *TxManager_HealthReport_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Run(run func()) *TxManager_HealthReport_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *TxManager_HealthReport_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Return(_a0 map[string]error) *TxManager_HealthReport_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + _c.Call.Return(_a0) + return _c +} + +func (_c *TxManager_HealthReport_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) RunAndReturn(run func() map[string]error) *TxManager_HealthReport_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + _c.Call.Return(run) + return _c +} + // Name provides a mock function with given fields: func (_m *TxManager[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Name() string { ret := _m.Called() @@ -397,11 +786,67 @@ func (_m *TxManager[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Name() return r0 } +// TxManager_Name_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Name' +type TxManager_Name_Call[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE feetypes.Fee] struct { + *mock.Call +} + +// Name is a helper method to define mock.On call +func (_e *TxManager_Expecter[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Name() *TxManager_Name_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + return &TxManager_Name_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]{Call: _e.mock.On("Name")} +} + +func (_c *TxManager_Name_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Run(run func()) *TxManager_Name_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *TxManager_Name_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Return(_a0 string) *TxManager_Name_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + _c.Call.Return(_a0) + return _c +} + +func (_c *TxManager_Name_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) RunAndReturn(run func() string) *TxManager_Name_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + _c.Call.Return(run) + return _c +} + // OnNewLongestChain provides a mock function with given fields: ctx, head func (_m *TxManager[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) OnNewLongestChain(ctx context.Context, head HEAD) { _m.Called(ctx, head) } +// TxManager_OnNewLongestChain_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OnNewLongestChain' +type TxManager_OnNewLongestChain_Call[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE feetypes.Fee] struct { + *mock.Call +} + +// OnNewLongestChain is a helper method to define mock.On call +// - ctx context.Context +// - head HEAD +func (_e *TxManager_Expecter[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) OnNewLongestChain(ctx interface{}, head interface{}) *TxManager_OnNewLongestChain_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + return &TxManager_OnNewLongestChain_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]{Call: _e.mock.On("OnNewLongestChain", ctx, head)} +} + +func (_c *TxManager_OnNewLongestChain_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Run(run func(ctx context.Context, head HEAD)) *TxManager_OnNewLongestChain_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(HEAD)) + }) + return _c +} + +func (_c *TxManager_OnNewLongestChain_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Return() *TxManager_OnNewLongestChain_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + _c.Call.Return() + return _c +} + +func (_c *TxManager_OnNewLongestChain_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) RunAndReturn(run func(context.Context, HEAD)) *TxManager_OnNewLongestChain_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + _c.Call.Return(run) + return _c +} + // Ready provides a mock function with given fields: func (_m *TxManager[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Ready() error { ret := _m.Called() @@ -420,11 +865,66 @@ func (_m *TxManager[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Ready( return r0 } +// TxManager_Ready_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Ready' +type TxManager_Ready_Call[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE feetypes.Fee] struct { + *mock.Call +} + +// Ready is a helper method to define mock.On call +func (_e *TxManager_Expecter[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Ready() *TxManager_Ready_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + return &TxManager_Ready_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]{Call: _e.mock.On("Ready")} +} + +func (_c *TxManager_Ready_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Run(run func()) *TxManager_Ready_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *TxManager_Ready_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Return(_a0 error) *TxManager_Ready_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + _c.Call.Return(_a0) + return _c +} + +func (_c *TxManager_Ready_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) RunAndReturn(run func() error) *TxManager_Ready_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + _c.Call.Return(run) + return _c +} + // RegisterResumeCallback provides a mock function with given fields: fn func (_m *TxManager[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) RegisterResumeCallback(fn txmgr.ResumeCallback) { _m.Called(fn) } +// TxManager_RegisterResumeCallback_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RegisterResumeCallback' +type TxManager_RegisterResumeCallback_Call[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE feetypes.Fee] struct { + *mock.Call +} + +// RegisterResumeCallback is a helper method to define mock.On call +// - fn txmgr.ResumeCallback +func (_e *TxManager_Expecter[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) RegisterResumeCallback(fn interface{}) *TxManager_RegisterResumeCallback_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + return &TxManager_RegisterResumeCallback_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]{Call: _e.mock.On("RegisterResumeCallback", fn)} +} + +func (_c *TxManager_RegisterResumeCallback_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Run(run func(fn txmgr.ResumeCallback)) *TxManager_RegisterResumeCallback_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(txmgr.ResumeCallback)) + }) + return _c +} + +func (_c *TxManager_RegisterResumeCallback_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Return() *TxManager_RegisterResumeCallback_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + _c.Call.Return() + return _c +} + +func (_c *TxManager_RegisterResumeCallback_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) RunAndReturn(run func(txmgr.ResumeCallback)) *TxManager_RegisterResumeCallback_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + _c.Call.Return(run) + return _c +} + // Reset provides a mock function with given fields: addr, abandon func (_m *TxManager[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Reset(addr ADDR, abandon bool) error { ret := _m.Called(addr, abandon) @@ -443,6 +943,35 @@ func (_m *TxManager[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Reset( return r0 } +// TxManager_Reset_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Reset' +type TxManager_Reset_Call[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE feetypes.Fee] struct { + *mock.Call +} + +// Reset is a helper method to define mock.On call +// - addr ADDR +// - abandon bool +func (_e *TxManager_Expecter[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Reset(addr interface{}, abandon interface{}) *TxManager_Reset_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + return &TxManager_Reset_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]{Call: _e.mock.On("Reset", addr, abandon)} +} + +func (_c *TxManager_Reset_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Run(run func(addr ADDR, abandon bool)) *TxManager_Reset_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(ADDR), args[1].(bool)) + }) + return _c +} + +func (_c *TxManager_Reset_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Return(_a0 error) *TxManager_Reset_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + _c.Call.Return(_a0) + return _c +} + +func (_c *TxManager_Reset_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) RunAndReturn(run func(ADDR, bool) error) *TxManager_Reset_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + _c.Call.Return(run) + return _c +} + // SendNativeToken provides a mock function with given fields: ctx, chainID, from, to, value, gasLimit func (_m *TxManager[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) SendNativeToken(ctx context.Context, chainID CHAIN_ID, from ADDR, to ADDR, value big.Int, gasLimit uint64) (txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], error) { ret := _m.Called(ctx, chainID, from, to, value, gasLimit) @@ -471,6 +1000,39 @@ func (_m *TxManager[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) SendNa return r0, r1 } +// TxManager_SendNativeToken_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SendNativeToken' +type TxManager_SendNativeToken_Call[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE feetypes.Fee] struct { + *mock.Call +} + +// SendNativeToken is a helper method to define mock.On call +// - ctx context.Context +// - chainID CHAIN_ID +// - from ADDR +// - to ADDR +// - value big.Int +// - gasLimit uint64 +func (_e *TxManager_Expecter[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) SendNativeToken(ctx interface{}, chainID interface{}, from interface{}, to interface{}, value interface{}, gasLimit interface{}) *TxManager_SendNativeToken_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + return &TxManager_SendNativeToken_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]{Call: _e.mock.On("SendNativeToken", ctx, chainID, from, to, value, gasLimit)} +} + +func (_c *TxManager_SendNativeToken_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Run(run func(ctx context.Context, chainID CHAIN_ID, from ADDR, to ADDR, value big.Int, gasLimit uint64)) *TxManager_SendNativeToken_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(CHAIN_ID), args[2].(ADDR), args[3].(ADDR), args[4].(big.Int), args[5].(uint64)) + }) + return _c +} + +func (_c *TxManager_SendNativeToken_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Return(etx txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], err error) *TxManager_SendNativeToken_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + _c.Call.Return(etx, err) + return _c +} + +func (_c *TxManager_SendNativeToken_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) RunAndReturn(run func(context.Context, CHAIN_ID, ADDR, ADDR, big.Int, uint64) (txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], error)) *TxManager_SendNativeToken_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + _c.Call.Return(run) + return _c +} + // Start provides a mock function with given fields: _a0 func (_m *TxManager[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Start(_a0 context.Context) error { ret := _m.Called(_a0) @@ -489,11 +1051,67 @@ func (_m *TxManager[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Start( return r0 } +// TxManager_Start_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Start' +type TxManager_Start_Call[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE feetypes.Fee] struct { + *mock.Call +} + +// Start is a helper method to define mock.On call +// - _a0 context.Context +func (_e *TxManager_Expecter[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Start(_a0 interface{}) *TxManager_Start_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + return &TxManager_Start_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]{Call: _e.mock.On("Start", _a0)} +} + +func (_c *TxManager_Start_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Run(run func(_a0 context.Context)) *TxManager_Start_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *TxManager_Start_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Return(_a0 error) *TxManager_Start_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + _c.Call.Return(_a0) + return _c +} + +func (_c *TxManager_Start_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) RunAndReturn(run func(context.Context) error) *TxManager_Start_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + _c.Call.Return(run) + return _c +} + // Trigger provides a mock function with given fields: addr func (_m *TxManager[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Trigger(addr ADDR) { _m.Called(addr) } +// TxManager_Trigger_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Trigger' +type TxManager_Trigger_Call[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE feetypes.Fee] struct { + *mock.Call +} + +// Trigger is a helper method to define mock.On call +// - addr ADDR +func (_e *TxManager_Expecter[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Trigger(addr interface{}) *TxManager_Trigger_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + return &TxManager_Trigger_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]{Call: _e.mock.On("Trigger", addr)} +} + +func (_c *TxManager_Trigger_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Run(run func(addr ADDR)) *TxManager_Trigger_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(ADDR)) + }) + return _c +} + +func (_c *TxManager_Trigger_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Return() *TxManager_Trigger_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + _c.Call.Return() + return _c +} + +func (_c *TxManager_Trigger_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) RunAndReturn(run func(ADDR)) *TxManager_Trigger_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + _c.Call.Return(run) + return _c +} + // NewTxManager creates a new instance of TxManager. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewTxManager[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE feetypes.Fee](t interface { diff --git a/common/txmgr/models.go b/common/txmgr/models.go index dd121a2c7c4..ca5e7d4f251 100644 --- a/common/txmgr/models.go +++ b/common/txmgr/models.go @@ -11,4 +11,5 @@ const ( TxUnconfirmed = txmgrtypes.TxState("unconfirmed") TxConfirmed = txmgrtypes.TxState("confirmed") TxConfirmedMissingReceipt = txmgrtypes.TxState("confirmed_missing_receipt") + TxFinalized = txmgrtypes.TxState("finalized") ) diff --git a/common/txmgr/reaper.go b/common/txmgr/reaper.go index 932b58f6430..0c797548b16 100644 --- a/common/txmgr/reaper.go +++ b/common/txmgr/reaper.go @@ -14,7 +14,6 @@ import ( // Reaper handles periodic database cleanup for Txm type Reaper[CHAIN_ID types.ID] struct { store txmgrtypes.TxHistoryReaper[CHAIN_ID] - config txmgrtypes.ReaperChainConfig txConfig txmgrtypes.ReaperTransactionsConfig chainID CHAIN_ID log logger.Logger @@ -25,10 +24,9 @@ type Reaper[CHAIN_ID types.ID] struct { } // NewReaper instantiates a new reaper object -func NewReaper[CHAIN_ID types.ID](lggr logger.Logger, store txmgrtypes.TxHistoryReaper[CHAIN_ID], config txmgrtypes.ReaperChainConfig, txConfig txmgrtypes.ReaperTransactionsConfig, chainID CHAIN_ID) *Reaper[CHAIN_ID] { +func NewReaper[CHAIN_ID types.ID](lggr logger.Logger, store txmgrtypes.TxHistoryReaper[CHAIN_ID], txConfig txmgrtypes.ReaperTransactionsConfig, chainID CHAIN_ID) *Reaper[CHAIN_ID] { r := &Reaper[CHAIN_ID]{ store, - config, txConfig, chainID, logger.Named(lggr, "Reaper"), @@ -103,13 +101,12 @@ func (r *Reaper[CHAIN_ID]) ReapTxes(headNum int64) error { r.log.Debug("Transactions.ReaperThreshold set to 0; skipping ReapTxes") return nil } - minBlockNumberToKeep := headNum - int64(r.config.FinalityDepth()) mark := time.Now() timeThreshold := mark.Add(-threshold) - r.log.Debugw(fmt.Sprintf("reaping old txes created before %s", timeThreshold.Format(time.RFC3339)), "ageThreshold", threshold, "timeThreshold", timeThreshold, "minBlockNumberToKeep", minBlockNumberToKeep) + r.log.Debugw(fmt.Sprintf("reaping old txes created before %s", timeThreshold.Format(time.RFC3339)), "ageThreshold", threshold, "timeThreshold", timeThreshold) - if err := r.store.ReapTxHistory(ctx, minBlockNumberToKeep, timeThreshold, r.chainID); err != nil { + if err := r.store.ReapTxHistory(ctx, timeThreshold, r.chainID); err != nil { return err } diff --git a/common/txmgr/txmgr.go b/common/txmgr/txmgr.go index 3ac0d2e1d68..28d505e5e05 100644 --- a/common/txmgr/txmgr.go +++ b/common/txmgr/txmgr.go @@ -33,8 +33,6 @@ type NewErrorClassifier func(err error) txmgrtypes.ErrorClassifier // TxManager is the main component of the transaction manager. // It is also the interface to external callers. -// -//go:generate mockery --quiet --recursive --name TxManager --output ./mocks/ --case=underscore --structname TxManager --filename tx_manager.go type TxManager[ CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], @@ -110,6 +108,7 @@ type Txm[ broadcaster *Broadcaster[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] confirmer *Confirmer[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE] tracker *Tracker[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE] + finalizer txmgrtypes.Finalizer[BLOCK_HASH, HEAD] fwdMgr txmgrtypes.ForwarderManager[ADDR] txAttemptBuilder txmgrtypes.TxAttemptBuilder[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] newErrorClassifier NewErrorClassifier @@ -145,6 +144,7 @@ func NewTxm[ confirmer *Confirmer[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE], resender *Resender[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE], tracker *Tracker[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE], + finalizer txmgrtypes.Finalizer[BLOCK_HASH, HEAD], newErrorClassifierFunc NewErrorClassifier, ) *Txm[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { b := Txm[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE]{ @@ -167,13 +167,14 @@ func NewTxm[ resender: resender, tracker: tracker, newErrorClassifier: newErrorClassifierFunc, + finalizer: finalizer, } if txCfg.ResendAfterThreshold() <= 0 { b.logger.Info("Resender: Disabled") } if txCfg.ReaperThreshold() > 0 && txCfg.ReaperInterval() > 0 { - b.reaper = NewReaper[CHAIN_ID](lggr, b.txStore, cfg, txCfg, chainId) + b.reaper = NewReaper[CHAIN_ID](lggr, b.txStore, txCfg, chainId) } else { b.logger.Info("TxReaper: Disabled") } @@ -201,6 +202,10 @@ func (b *Txm[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Start(ctx return fmt.Errorf("Txm: Tracker failed to start: %w", err) } + if err := ms.Start(ctx, b.finalizer); err != nil { + return fmt.Errorf("Txm: Finalizer failed to start: %w", err) + } + b.logger.Info("Txm starting runLoop") b.wg.Add(1) go b.runLoop() @@ -295,6 +300,7 @@ func (b *Txm[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) HealthRepo services.CopyHealth(report, b.broadcaster.HealthReport()) services.CopyHealth(report, b.confirmer.HealthReport()) services.CopyHealth(report, b.txAttemptBuilder.HealthReport()) + services.CopyHealth(report, b.finalizer.HealthReport()) }) if b.txConfig.ForwardersEnabled() { @@ -417,6 +423,7 @@ func (b *Txm[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) runLoop() case head := <-b.chHeads: b.confirmer.mb.Deliver(head) b.tracker.mb.Deliver(head.BlockNumber()) + b.finalizer.DeliverLatestHead(head) case reset := <-b.reset: // This check prevents the weird edge-case where you can select // into this block after chStop has already been closed and the @@ -448,6 +455,10 @@ func (b *Txm[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) runLoop() if err != nil && (!errors.Is(err, services.ErrAlreadyStopped) || !errors.Is(err, services.ErrCannotStopUnstarted)) { b.logger.Errorw(fmt.Sprintf("Failed to Close Tracker: %v", err), "err", err) } + err = b.finalizer.Close() + if err != nil && (!errors.Is(err, services.ErrAlreadyStopped) || !errors.Is(err, services.ErrCannotStopUnstarted)) { + b.logger.Errorw(fmt.Sprintf("Failed to Close Finalizer: %v", err), "err", err) + } return case <-keysChanged: // This check prevents the weird edge-case where you can select @@ -643,12 +654,13 @@ func (b *Txm[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) GetTransac } switch tx.State { case TxUnconfirmed, TxConfirmedMissingReceipt: - // Return unconfirmed for ConfirmedMissingReceipt since a receipt is required to determine if it is finalized - return commontypes.Unconfirmed, nil + // Return pending for ConfirmedMissingReceipt since a receipt is required to consider it as unconfirmed + return commontypes.Pending, nil case TxConfirmed: - // TODO: Check for finality and return finalized status - // Return unconfirmed if tx receipt's block is newer than the latest finalized block + // Return unconfirmed for confirmed transactions because they are not yet finalized return commontypes.Unconfirmed, nil + case TxFinalized: + return commontypes.Finalized, nil case TxFatalError: // Use an ErrorClassifier to determine if the transaction is considered Fatal txErr := b.newErrorClassifier(tx.GetError()) diff --git a/common/txmgr/types/config.go b/common/txmgr/types/config.go index 53e35cd4b6e..8b11a45d11d 100644 --- a/common/txmgr/types/config.go +++ b/common/txmgr/types/config.go @@ -5,7 +5,6 @@ import "time" type TransactionManagerChainConfig interface { BroadcasterChainConfig ConfirmerChainConfig - ReaperChainConfig } type TransactionManagerFeeConfig interface { @@ -74,13 +73,6 @@ type ResenderTransactionsConfig interface { MaxInFlight() uint32 } -// ReaperConfig is the config subset used by the reaper -// -//go:generate mockery --quiet --name ReaperChainConfig --structname ReaperConfig --output ./mocks/ --case=underscore -type ReaperChainConfig interface { - FinalityDepth() uint32 -} - type ReaperTransactionsConfig interface { ReaperInterval() time.Duration ReaperThreshold() time.Duration diff --git a/common/txmgr/types/finalizer.go b/common/txmgr/types/finalizer.go new file mode 100644 index 00000000000..be3c897d0e2 --- /dev/null +++ b/common/txmgr/types/finalizer.go @@ -0,0 +1,12 @@ +package types + +import ( + "github.com/smartcontractkit/chainlink-common/pkg/services" + "github.com/smartcontractkit/chainlink/v2/common/types" +) + +type Finalizer[BLOCK_HASH types.Hashable, HEAD types.Head[BLOCK_HASH]] interface { + // interfaces for running the underlying estimator + services.Service + DeliverLatestHead(head HEAD) bool +} diff --git a/common/txmgr/types/forwarder_manager.go b/common/txmgr/types/forwarder_manager.go index 6acb491a1fb..8f4089e2fb3 100644 --- a/common/txmgr/types/forwarder_manager.go +++ b/common/txmgr/types/forwarder_manager.go @@ -8,7 +8,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/common/types" ) -//go:generate mockery --quiet --name ForwarderManager --output ./mocks/ --case=underscore type ForwarderManager[ADDR types.Hashable] interface { services.Service ForwarderFor(ctx context.Context, addr ADDR) (forwarder ADDR, err error) diff --git a/common/txmgr/types/keystore.go b/common/txmgr/types/keystore.go index 0eecc49be70..1bcb9a5ce28 100644 --- a/common/txmgr/types/keystore.go +++ b/common/txmgr/types/keystore.go @@ -7,8 +7,6 @@ import ( ) // KeyStore encompasses the subset of keystore used by txmgr -// -//go:generate mockery --quiet --name KeyStore --output ./mocks/ --case=underscore type KeyStore[ // Account Address type. ADDR types.Hashable, diff --git a/common/txmgr/types/mocks/forwarder_manager.go b/common/txmgr/types/mocks/forwarder_manager.go index 366fd270151..00a7e6535f4 100644 --- a/common/txmgr/types/mocks/forwarder_manager.go +++ b/common/txmgr/types/mocks/forwarder_manager.go @@ -15,6 +15,14 @@ type ForwarderManager[ADDR types.Hashable] struct { mock.Mock } +type ForwarderManager_Expecter[ADDR types.Hashable] struct { + mock *mock.Mock +} + +func (_m *ForwarderManager[ADDR]) EXPECT() *ForwarderManager_Expecter[ADDR] { + return &ForwarderManager_Expecter[ADDR]{mock: &_m.Mock} +} + // Close provides a mock function with given fields: func (_m *ForwarderManager[ADDR]) Close() error { ret := _m.Called() @@ -33,6 +41,33 @@ func (_m *ForwarderManager[ADDR]) Close() error { return r0 } +// ForwarderManager_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close' +type ForwarderManager_Close_Call[ADDR types.Hashable] struct { + *mock.Call +} + +// Close is a helper method to define mock.On call +func (_e *ForwarderManager_Expecter[ADDR]) Close() *ForwarderManager_Close_Call[ADDR] { + return &ForwarderManager_Close_Call[ADDR]{Call: _e.mock.On("Close")} +} + +func (_c *ForwarderManager_Close_Call[ADDR]) Run(run func()) *ForwarderManager_Close_Call[ADDR] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ForwarderManager_Close_Call[ADDR]) Return(_a0 error) *ForwarderManager_Close_Call[ADDR] { + _c.Call.Return(_a0) + return _c +} + +func (_c *ForwarderManager_Close_Call[ADDR]) RunAndReturn(run func() error) *ForwarderManager_Close_Call[ADDR] { + _c.Call.Return(run) + return _c +} + // ConvertPayload provides a mock function with given fields: dest, origPayload func (_m *ForwarderManager[ADDR]) ConvertPayload(dest ADDR, origPayload []byte) ([]byte, error) { ret := _m.Called(dest, origPayload) @@ -63,6 +98,35 @@ func (_m *ForwarderManager[ADDR]) ConvertPayload(dest ADDR, origPayload []byte) return r0, r1 } +// ForwarderManager_ConvertPayload_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ConvertPayload' +type ForwarderManager_ConvertPayload_Call[ADDR types.Hashable] struct { + *mock.Call +} + +// ConvertPayload is a helper method to define mock.On call +// - dest ADDR +// - origPayload []byte +func (_e *ForwarderManager_Expecter[ADDR]) ConvertPayload(dest interface{}, origPayload interface{}) *ForwarderManager_ConvertPayload_Call[ADDR] { + return &ForwarderManager_ConvertPayload_Call[ADDR]{Call: _e.mock.On("ConvertPayload", dest, origPayload)} +} + +func (_c *ForwarderManager_ConvertPayload_Call[ADDR]) Run(run func(dest ADDR, origPayload []byte)) *ForwarderManager_ConvertPayload_Call[ADDR] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(ADDR), args[1].([]byte)) + }) + return _c +} + +func (_c *ForwarderManager_ConvertPayload_Call[ADDR]) Return(_a0 []byte, _a1 error) *ForwarderManager_ConvertPayload_Call[ADDR] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ForwarderManager_ConvertPayload_Call[ADDR]) RunAndReturn(run func(ADDR, []byte) ([]byte, error)) *ForwarderManager_ConvertPayload_Call[ADDR] { + _c.Call.Return(run) + return _c +} + // ForwarderFor provides a mock function with given fields: ctx, addr func (_m *ForwarderManager[ADDR]) ForwarderFor(ctx context.Context, addr ADDR) (ADDR, error) { ret := _m.Called(ctx, addr) @@ -91,6 +155,35 @@ func (_m *ForwarderManager[ADDR]) ForwarderFor(ctx context.Context, addr ADDR) ( return r0, r1 } +// ForwarderManager_ForwarderFor_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ForwarderFor' +type ForwarderManager_ForwarderFor_Call[ADDR types.Hashable] struct { + *mock.Call +} + +// ForwarderFor is a helper method to define mock.On call +// - ctx context.Context +// - addr ADDR +func (_e *ForwarderManager_Expecter[ADDR]) ForwarderFor(ctx interface{}, addr interface{}) *ForwarderManager_ForwarderFor_Call[ADDR] { + return &ForwarderManager_ForwarderFor_Call[ADDR]{Call: _e.mock.On("ForwarderFor", ctx, addr)} +} + +func (_c *ForwarderManager_ForwarderFor_Call[ADDR]) Run(run func(ctx context.Context, addr ADDR)) *ForwarderManager_ForwarderFor_Call[ADDR] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(ADDR)) + }) + return _c +} + +func (_c *ForwarderManager_ForwarderFor_Call[ADDR]) Return(forwarder ADDR, err error) *ForwarderManager_ForwarderFor_Call[ADDR] { + _c.Call.Return(forwarder, err) + return _c +} + +func (_c *ForwarderManager_ForwarderFor_Call[ADDR]) RunAndReturn(run func(context.Context, ADDR) (ADDR, error)) *ForwarderManager_ForwarderFor_Call[ADDR] { + _c.Call.Return(run) + return _c +} + // ForwarderForOCR2Feeds provides a mock function with given fields: ctx, eoa, ocr2Aggregator func (_m *ForwarderManager[ADDR]) ForwarderForOCR2Feeds(ctx context.Context, eoa ADDR, ocr2Aggregator ADDR) (ADDR, error) { ret := _m.Called(ctx, eoa, ocr2Aggregator) @@ -119,6 +212,36 @@ func (_m *ForwarderManager[ADDR]) ForwarderForOCR2Feeds(ctx context.Context, eoa return r0, r1 } +// ForwarderManager_ForwarderForOCR2Feeds_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ForwarderForOCR2Feeds' +type ForwarderManager_ForwarderForOCR2Feeds_Call[ADDR types.Hashable] struct { + *mock.Call +} + +// ForwarderForOCR2Feeds is a helper method to define mock.On call +// - ctx context.Context +// - eoa ADDR +// - ocr2Aggregator ADDR +func (_e *ForwarderManager_Expecter[ADDR]) ForwarderForOCR2Feeds(ctx interface{}, eoa interface{}, ocr2Aggregator interface{}) *ForwarderManager_ForwarderForOCR2Feeds_Call[ADDR] { + return &ForwarderManager_ForwarderForOCR2Feeds_Call[ADDR]{Call: _e.mock.On("ForwarderForOCR2Feeds", ctx, eoa, ocr2Aggregator)} +} + +func (_c *ForwarderManager_ForwarderForOCR2Feeds_Call[ADDR]) Run(run func(ctx context.Context, eoa ADDR, ocr2Aggregator ADDR)) *ForwarderManager_ForwarderForOCR2Feeds_Call[ADDR] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(ADDR), args[2].(ADDR)) + }) + return _c +} + +func (_c *ForwarderManager_ForwarderForOCR2Feeds_Call[ADDR]) Return(forwarder ADDR, err error) *ForwarderManager_ForwarderForOCR2Feeds_Call[ADDR] { + _c.Call.Return(forwarder, err) + return _c +} + +func (_c *ForwarderManager_ForwarderForOCR2Feeds_Call[ADDR]) RunAndReturn(run func(context.Context, ADDR, ADDR) (ADDR, error)) *ForwarderManager_ForwarderForOCR2Feeds_Call[ADDR] { + _c.Call.Return(run) + return _c +} + // HealthReport provides a mock function with given fields: func (_m *ForwarderManager[ADDR]) HealthReport() map[string]error { ret := _m.Called() @@ -139,6 +262,33 @@ func (_m *ForwarderManager[ADDR]) HealthReport() map[string]error { return r0 } +// ForwarderManager_HealthReport_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HealthReport' +type ForwarderManager_HealthReport_Call[ADDR types.Hashable] struct { + *mock.Call +} + +// HealthReport is a helper method to define mock.On call +func (_e *ForwarderManager_Expecter[ADDR]) HealthReport() *ForwarderManager_HealthReport_Call[ADDR] { + return &ForwarderManager_HealthReport_Call[ADDR]{Call: _e.mock.On("HealthReport")} +} + +func (_c *ForwarderManager_HealthReport_Call[ADDR]) Run(run func()) *ForwarderManager_HealthReport_Call[ADDR] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ForwarderManager_HealthReport_Call[ADDR]) Return(_a0 map[string]error) *ForwarderManager_HealthReport_Call[ADDR] { + _c.Call.Return(_a0) + return _c +} + +func (_c *ForwarderManager_HealthReport_Call[ADDR]) RunAndReturn(run func() map[string]error) *ForwarderManager_HealthReport_Call[ADDR] { + _c.Call.Return(run) + return _c +} + // Name provides a mock function with given fields: func (_m *ForwarderManager[ADDR]) Name() string { ret := _m.Called() @@ -157,6 +307,33 @@ func (_m *ForwarderManager[ADDR]) Name() string { return r0 } +// ForwarderManager_Name_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Name' +type ForwarderManager_Name_Call[ADDR types.Hashable] struct { + *mock.Call +} + +// Name is a helper method to define mock.On call +func (_e *ForwarderManager_Expecter[ADDR]) Name() *ForwarderManager_Name_Call[ADDR] { + return &ForwarderManager_Name_Call[ADDR]{Call: _e.mock.On("Name")} +} + +func (_c *ForwarderManager_Name_Call[ADDR]) Run(run func()) *ForwarderManager_Name_Call[ADDR] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ForwarderManager_Name_Call[ADDR]) Return(_a0 string) *ForwarderManager_Name_Call[ADDR] { + _c.Call.Return(_a0) + return _c +} + +func (_c *ForwarderManager_Name_Call[ADDR]) RunAndReturn(run func() string) *ForwarderManager_Name_Call[ADDR] { + _c.Call.Return(run) + return _c +} + // Ready provides a mock function with given fields: func (_m *ForwarderManager[ADDR]) Ready() error { ret := _m.Called() @@ -175,6 +352,33 @@ func (_m *ForwarderManager[ADDR]) Ready() error { return r0 } +// ForwarderManager_Ready_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Ready' +type ForwarderManager_Ready_Call[ADDR types.Hashable] struct { + *mock.Call +} + +// Ready is a helper method to define mock.On call +func (_e *ForwarderManager_Expecter[ADDR]) Ready() *ForwarderManager_Ready_Call[ADDR] { + return &ForwarderManager_Ready_Call[ADDR]{Call: _e.mock.On("Ready")} +} + +func (_c *ForwarderManager_Ready_Call[ADDR]) Run(run func()) *ForwarderManager_Ready_Call[ADDR] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ForwarderManager_Ready_Call[ADDR]) Return(_a0 error) *ForwarderManager_Ready_Call[ADDR] { + _c.Call.Return(_a0) + return _c +} + +func (_c *ForwarderManager_Ready_Call[ADDR]) RunAndReturn(run func() error) *ForwarderManager_Ready_Call[ADDR] { + _c.Call.Return(run) + return _c +} + // Start provides a mock function with given fields: _a0 func (_m *ForwarderManager[ADDR]) Start(_a0 context.Context) error { ret := _m.Called(_a0) @@ -193,6 +397,34 @@ func (_m *ForwarderManager[ADDR]) Start(_a0 context.Context) error { return r0 } +// ForwarderManager_Start_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Start' +type ForwarderManager_Start_Call[ADDR types.Hashable] struct { + *mock.Call +} + +// Start is a helper method to define mock.On call +// - _a0 context.Context +func (_e *ForwarderManager_Expecter[ADDR]) Start(_a0 interface{}) *ForwarderManager_Start_Call[ADDR] { + return &ForwarderManager_Start_Call[ADDR]{Call: _e.mock.On("Start", _a0)} +} + +func (_c *ForwarderManager_Start_Call[ADDR]) Run(run func(_a0 context.Context)) *ForwarderManager_Start_Call[ADDR] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *ForwarderManager_Start_Call[ADDR]) Return(_a0 error) *ForwarderManager_Start_Call[ADDR] { + _c.Call.Return(_a0) + return _c +} + +func (_c *ForwarderManager_Start_Call[ADDR]) RunAndReturn(run func(context.Context) error) *ForwarderManager_Start_Call[ADDR] { + _c.Call.Return(run) + return _c +} + // NewForwarderManager creates a new instance of ForwarderManager. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewForwarderManager[ADDR types.Hashable](t interface { diff --git a/common/txmgr/types/mocks/key_store.go b/common/txmgr/types/mocks/key_store.go index 0a14acfbeda..9b7993434cd 100644 --- a/common/txmgr/types/mocks/key_store.go +++ b/common/txmgr/types/mocks/key_store.go @@ -15,6 +15,14 @@ type KeyStore[ADDR types.Hashable, CHAIN_ID types.ID, SEQ types.Sequence] struct mock.Mock } +type KeyStore_Expecter[ADDR types.Hashable, CHAIN_ID types.ID, SEQ types.Sequence] struct { + mock *mock.Mock +} + +func (_m *KeyStore[ADDR, CHAIN_ID, SEQ]) EXPECT() *KeyStore_Expecter[ADDR, CHAIN_ID, SEQ] { + return &KeyStore_Expecter[ADDR, CHAIN_ID, SEQ]{mock: &_m.Mock} +} + // CheckEnabled provides a mock function with given fields: ctx, address, chainID func (_m *KeyStore[ADDR, CHAIN_ID, SEQ]) CheckEnabled(ctx context.Context, address ADDR, chainID CHAIN_ID) error { ret := _m.Called(ctx, address, chainID) @@ -33,6 +41,36 @@ func (_m *KeyStore[ADDR, CHAIN_ID, SEQ]) CheckEnabled(ctx context.Context, addre return r0 } +// KeyStore_CheckEnabled_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CheckEnabled' +type KeyStore_CheckEnabled_Call[ADDR types.Hashable, CHAIN_ID types.ID, SEQ types.Sequence] struct { + *mock.Call +} + +// CheckEnabled is a helper method to define mock.On call +// - ctx context.Context +// - address ADDR +// - chainID CHAIN_ID +func (_e *KeyStore_Expecter[ADDR, CHAIN_ID, SEQ]) CheckEnabled(ctx interface{}, address interface{}, chainID interface{}) *KeyStore_CheckEnabled_Call[ADDR, CHAIN_ID, SEQ] { + return &KeyStore_CheckEnabled_Call[ADDR, CHAIN_ID, SEQ]{Call: _e.mock.On("CheckEnabled", ctx, address, chainID)} +} + +func (_c *KeyStore_CheckEnabled_Call[ADDR, CHAIN_ID, SEQ]) Run(run func(ctx context.Context, address ADDR, chainID CHAIN_ID)) *KeyStore_CheckEnabled_Call[ADDR, CHAIN_ID, SEQ] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(ADDR), args[2].(CHAIN_ID)) + }) + return _c +} + +func (_c *KeyStore_CheckEnabled_Call[ADDR, CHAIN_ID, SEQ]) Return(_a0 error) *KeyStore_CheckEnabled_Call[ADDR, CHAIN_ID, SEQ] { + _c.Call.Return(_a0) + return _c +} + +func (_c *KeyStore_CheckEnabled_Call[ADDR, CHAIN_ID, SEQ]) RunAndReturn(run func(context.Context, ADDR, CHAIN_ID) error) *KeyStore_CheckEnabled_Call[ADDR, CHAIN_ID, SEQ] { + _c.Call.Return(run) + return _c +} + // EnabledAddressesForChain provides a mock function with given fields: ctx, chainId func (_m *KeyStore[ADDR, CHAIN_ID, SEQ]) EnabledAddressesForChain(ctx context.Context, chainId CHAIN_ID) ([]ADDR, error) { ret := _m.Called(ctx, chainId) @@ -63,6 +101,35 @@ func (_m *KeyStore[ADDR, CHAIN_ID, SEQ]) EnabledAddressesForChain(ctx context.Co return r0, r1 } +// KeyStore_EnabledAddressesForChain_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EnabledAddressesForChain' +type KeyStore_EnabledAddressesForChain_Call[ADDR types.Hashable, CHAIN_ID types.ID, SEQ types.Sequence] struct { + *mock.Call +} + +// EnabledAddressesForChain is a helper method to define mock.On call +// - ctx context.Context +// - chainId CHAIN_ID +func (_e *KeyStore_Expecter[ADDR, CHAIN_ID, SEQ]) EnabledAddressesForChain(ctx interface{}, chainId interface{}) *KeyStore_EnabledAddressesForChain_Call[ADDR, CHAIN_ID, SEQ] { + return &KeyStore_EnabledAddressesForChain_Call[ADDR, CHAIN_ID, SEQ]{Call: _e.mock.On("EnabledAddressesForChain", ctx, chainId)} +} + +func (_c *KeyStore_EnabledAddressesForChain_Call[ADDR, CHAIN_ID, SEQ]) Run(run func(ctx context.Context, chainId CHAIN_ID)) *KeyStore_EnabledAddressesForChain_Call[ADDR, CHAIN_ID, SEQ] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(CHAIN_ID)) + }) + return _c +} + +func (_c *KeyStore_EnabledAddressesForChain_Call[ADDR, CHAIN_ID, SEQ]) Return(_a0 []ADDR, _a1 error) *KeyStore_EnabledAddressesForChain_Call[ADDR, CHAIN_ID, SEQ] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *KeyStore_EnabledAddressesForChain_Call[ADDR, CHAIN_ID, SEQ]) RunAndReturn(run func(context.Context, CHAIN_ID) ([]ADDR, error)) *KeyStore_EnabledAddressesForChain_Call[ADDR, CHAIN_ID, SEQ] { + _c.Call.Return(run) + return _c +} + // SubscribeToKeyChanges provides a mock function with given fields: ctx func (_m *KeyStore[ADDR, CHAIN_ID, SEQ]) SubscribeToKeyChanges(ctx context.Context) (chan struct{}, func()) { ret := _m.Called(ctx) @@ -95,6 +162,34 @@ func (_m *KeyStore[ADDR, CHAIN_ID, SEQ]) SubscribeToKeyChanges(ctx context.Conte return r0, r1 } +// KeyStore_SubscribeToKeyChanges_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SubscribeToKeyChanges' +type KeyStore_SubscribeToKeyChanges_Call[ADDR types.Hashable, CHAIN_ID types.ID, SEQ types.Sequence] struct { + *mock.Call +} + +// SubscribeToKeyChanges is a helper method to define mock.On call +// - ctx context.Context +func (_e *KeyStore_Expecter[ADDR, CHAIN_ID, SEQ]) SubscribeToKeyChanges(ctx interface{}) *KeyStore_SubscribeToKeyChanges_Call[ADDR, CHAIN_ID, SEQ] { + return &KeyStore_SubscribeToKeyChanges_Call[ADDR, CHAIN_ID, SEQ]{Call: _e.mock.On("SubscribeToKeyChanges", ctx)} +} + +func (_c *KeyStore_SubscribeToKeyChanges_Call[ADDR, CHAIN_ID, SEQ]) Run(run func(ctx context.Context)) *KeyStore_SubscribeToKeyChanges_Call[ADDR, CHAIN_ID, SEQ] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *KeyStore_SubscribeToKeyChanges_Call[ADDR, CHAIN_ID, SEQ]) Return(ch chan struct{}, unsub func()) *KeyStore_SubscribeToKeyChanges_Call[ADDR, CHAIN_ID, SEQ] { + _c.Call.Return(ch, unsub) + return _c +} + +func (_c *KeyStore_SubscribeToKeyChanges_Call[ADDR, CHAIN_ID, SEQ]) RunAndReturn(run func(context.Context) (chan struct{}, func())) *KeyStore_SubscribeToKeyChanges_Call[ADDR, CHAIN_ID, SEQ] { + _c.Call.Return(run) + return _c +} + // NewKeyStore creates a new instance of KeyStore. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewKeyStore[ADDR types.Hashable, CHAIN_ID types.ID, SEQ types.Sequence](t interface { diff --git a/common/txmgr/types/mocks/reaper_chain_config.go b/common/txmgr/types/mocks/reaper_chain_config.go deleted file mode 100644 index 30f58c10003..00000000000 --- a/common/txmgr/types/mocks/reaper_chain_config.go +++ /dev/null @@ -1,42 +0,0 @@ -// Code generated by mockery v2.43.2. DO NOT EDIT. - -package mocks - -import mock "github.com/stretchr/testify/mock" - -// ReaperConfig is an autogenerated mock type for the ReaperChainConfig type -type ReaperConfig struct { - mock.Mock -} - -// FinalityDepth provides a mock function with given fields: -func (_m *ReaperConfig) FinalityDepth() uint32 { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for FinalityDepth") - } - - var r0 uint32 - if rf, ok := ret.Get(0).(func() uint32); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(uint32) - } - - return r0 -} - -// NewReaperConfig creates a new instance of ReaperConfig. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewReaperConfig(t interface { - mock.TestingT - Cleanup(func()) -}) *ReaperConfig { - mock := &ReaperConfig{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/common/txmgr/types/mocks/tx_attempt_builder.go b/common/txmgr/types/mocks/tx_attempt_builder.go index 692b71e739c..cac8135dfe8 100644 --- a/common/txmgr/types/mocks/tx_attempt_builder.go +++ b/common/txmgr/types/mocks/tx_attempt_builder.go @@ -20,6 +20,14 @@ type TxAttemptBuilder[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types mock.Mock } +type TxAttemptBuilder_Expecter[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE feetypes.Fee] struct { + mock *mock.Mock +} + +func (_m *TxAttemptBuilder[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) EXPECT() *TxAttemptBuilder_Expecter[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + return &TxAttemptBuilder_Expecter[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]{mock: &_m.Mock} +} + // Close provides a mock function with given fields: func (_m *TxAttemptBuilder[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Close() error { ret := _m.Called() @@ -38,6 +46,33 @@ func (_m *TxAttemptBuilder[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) return r0 } +// TxAttemptBuilder_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close' +type TxAttemptBuilder_Close_Call[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE feetypes.Fee] struct { + *mock.Call +} + +// Close is a helper method to define mock.On call +func (_e *TxAttemptBuilder_Expecter[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Close() *TxAttemptBuilder_Close_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + return &TxAttemptBuilder_Close_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]{Call: _e.mock.On("Close")} +} + +func (_c *TxAttemptBuilder_Close_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Run(run func()) *TxAttemptBuilder_Close_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *TxAttemptBuilder_Close_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Return(_a0 error) *TxAttemptBuilder_Close_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + _c.Call.Return(_a0) + return _c +} + +func (_c *TxAttemptBuilder_Close_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) RunAndReturn(run func() error) *TxAttemptBuilder_Close_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + _c.Call.Return(run) + return _c +} + // HealthReport provides a mock function with given fields: func (_m *TxAttemptBuilder[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) HealthReport() map[string]error { ret := _m.Called() @@ -58,6 +93,33 @@ func (_m *TxAttemptBuilder[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) return r0 } +// TxAttemptBuilder_HealthReport_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HealthReport' +type TxAttemptBuilder_HealthReport_Call[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE feetypes.Fee] struct { + *mock.Call +} + +// HealthReport is a helper method to define mock.On call +func (_e *TxAttemptBuilder_Expecter[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) HealthReport() *TxAttemptBuilder_HealthReport_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + return &TxAttemptBuilder_HealthReport_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]{Call: _e.mock.On("HealthReport")} +} + +func (_c *TxAttemptBuilder_HealthReport_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Run(run func()) *TxAttemptBuilder_HealthReport_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *TxAttemptBuilder_HealthReport_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Return(_a0 map[string]error) *TxAttemptBuilder_HealthReport_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + _c.Call.Return(_a0) + return _c +} + +func (_c *TxAttemptBuilder_HealthReport_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) RunAndReturn(run func() map[string]error) *TxAttemptBuilder_HealthReport_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + _c.Call.Return(run) + return _c +} + // Name provides a mock function with given fields: func (_m *TxAttemptBuilder[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Name() string { ret := _m.Called() @@ -76,6 +138,33 @@ func (_m *TxAttemptBuilder[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) return r0 } +// TxAttemptBuilder_Name_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Name' +type TxAttemptBuilder_Name_Call[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE feetypes.Fee] struct { + *mock.Call +} + +// Name is a helper method to define mock.On call +func (_e *TxAttemptBuilder_Expecter[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Name() *TxAttemptBuilder_Name_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + return &TxAttemptBuilder_Name_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]{Call: _e.mock.On("Name")} +} + +func (_c *TxAttemptBuilder_Name_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Run(run func()) *TxAttemptBuilder_Name_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *TxAttemptBuilder_Name_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Return(_a0 string) *TxAttemptBuilder_Name_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + _c.Call.Return(_a0) + return _c +} + +func (_c *TxAttemptBuilder_Name_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) RunAndReturn(run func() string) *TxAttemptBuilder_Name_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + _c.Call.Return(run) + return _c +} + // NewBumpTxAttempt provides a mock function with given fields: ctx, tx, previousAttempt, priorAttempts, lggr func (_m *TxAttemptBuilder[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) NewBumpTxAttempt(ctx context.Context, tx txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], previousAttempt txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], priorAttempts []txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], lggr logger.Logger) (txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], FEE, uint64, bool, error) { ret := _m.Called(ctx, tx, previousAttempt, priorAttempts, lggr) @@ -125,6 +214,38 @@ func (_m *TxAttemptBuilder[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) return r0, r1, r2, r3, r4 } +// TxAttemptBuilder_NewBumpTxAttempt_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NewBumpTxAttempt' +type TxAttemptBuilder_NewBumpTxAttempt_Call[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE feetypes.Fee] struct { + *mock.Call +} + +// NewBumpTxAttempt is a helper method to define mock.On call +// - ctx context.Context +// - tx txmgrtypes.Tx[CHAIN_ID,ADDR,TX_HASH,BLOCK_HASH,SEQ,FEE] +// - previousAttempt txmgrtypes.TxAttempt[CHAIN_ID,ADDR,TX_HASH,BLOCK_HASH,SEQ,FEE] +// - priorAttempts []txmgrtypes.TxAttempt[CHAIN_ID,ADDR,TX_HASH,BLOCK_HASH,SEQ,FEE] +// - lggr logger.Logger +func (_e *TxAttemptBuilder_Expecter[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) NewBumpTxAttempt(ctx interface{}, tx interface{}, previousAttempt interface{}, priorAttempts interface{}, lggr interface{}) *TxAttemptBuilder_NewBumpTxAttempt_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + return &TxAttemptBuilder_NewBumpTxAttempt_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]{Call: _e.mock.On("NewBumpTxAttempt", ctx, tx, previousAttempt, priorAttempts, lggr)} +} + +func (_c *TxAttemptBuilder_NewBumpTxAttempt_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Run(run func(ctx context.Context, tx txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], previousAttempt txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], priorAttempts []txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], lggr logger.Logger)) *TxAttemptBuilder_NewBumpTxAttempt_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]), args[2].(txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]), args[3].([]txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]), args[4].(logger.Logger)) + }) + return _c +} + +func (_c *TxAttemptBuilder_NewBumpTxAttempt_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Return(attempt txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], bumpedFee FEE, bumpedFeeLimit uint64, retryable bool, err error) *TxAttemptBuilder_NewBumpTxAttempt_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + _c.Call.Return(attempt, bumpedFee, bumpedFeeLimit, retryable, err) + return _c +} + +func (_c *TxAttemptBuilder_NewBumpTxAttempt_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) RunAndReturn(run func(context.Context, txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], []txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], logger.Logger) (txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], FEE, uint64, bool, error)) *TxAttemptBuilder_NewBumpTxAttempt_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + _c.Call.Return(run) + return _c +} + // NewCustomTxAttempt provides a mock function with given fields: ctx, tx, fee, gasLimit, txType, lggr func (_m *TxAttemptBuilder[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) NewCustomTxAttempt(ctx context.Context, tx txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], fee FEE, gasLimit uint64, txType int, lggr logger.Logger) (txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], bool, error) { ret := _m.Called(ctx, tx, fee, gasLimit, txType, lggr) @@ -160,6 +281,39 @@ func (_m *TxAttemptBuilder[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) return r0, r1, r2 } +// TxAttemptBuilder_NewCustomTxAttempt_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NewCustomTxAttempt' +type TxAttemptBuilder_NewCustomTxAttempt_Call[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE feetypes.Fee] struct { + *mock.Call +} + +// NewCustomTxAttempt is a helper method to define mock.On call +// - ctx context.Context +// - tx txmgrtypes.Tx[CHAIN_ID,ADDR,TX_HASH,BLOCK_HASH,SEQ,FEE] +// - fee FEE +// - gasLimit uint64 +// - txType int +// - lggr logger.Logger +func (_e *TxAttemptBuilder_Expecter[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) NewCustomTxAttempt(ctx interface{}, tx interface{}, fee interface{}, gasLimit interface{}, txType interface{}, lggr interface{}) *TxAttemptBuilder_NewCustomTxAttempt_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + return &TxAttemptBuilder_NewCustomTxAttempt_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]{Call: _e.mock.On("NewCustomTxAttempt", ctx, tx, fee, gasLimit, txType, lggr)} +} + +func (_c *TxAttemptBuilder_NewCustomTxAttempt_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Run(run func(ctx context.Context, tx txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], fee FEE, gasLimit uint64, txType int, lggr logger.Logger)) *TxAttemptBuilder_NewCustomTxAttempt_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]), args[2].(FEE), args[3].(uint64), args[4].(int), args[5].(logger.Logger)) + }) + return _c +} + +func (_c *TxAttemptBuilder_NewCustomTxAttempt_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Return(attempt txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], retryable bool, err error) *TxAttemptBuilder_NewCustomTxAttempt_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + _c.Call.Return(attempt, retryable, err) + return _c +} + +func (_c *TxAttemptBuilder_NewCustomTxAttempt_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) RunAndReturn(run func(context.Context, txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], FEE, uint64, int, logger.Logger) (txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], bool, error)) *TxAttemptBuilder_NewCustomTxAttempt_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + _c.Call.Return(run) + return _c +} + // NewEmptyTxAttempt provides a mock function with given fields: ctx, seq, feeLimit, fee, fromAddress func (_m *TxAttemptBuilder[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) NewEmptyTxAttempt(ctx context.Context, seq SEQ, feeLimit uint64, fee FEE, fromAddress ADDR) (txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], error) { ret := _m.Called(ctx, seq, feeLimit, fee, fromAddress) @@ -188,6 +342,38 @@ func (_m *TxAttemptBuilder[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) return r0, r1 } +// TxAttemptBuilder_NewEmptyTxAttempt_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NewEmptyTxAttempt' +type TxAttemptBuilder_NewEmptyTxAttempt_Call[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE feetypes.Fee] struct { + *mock.Call +} + +// NewEmptyTxAttempt is a helper method to define mock.On call +// - ctx context.Context +// - seq SEQ +// - feeLimit uint64 +// - fee FEE +// - fromAddress ADDR +func (_e *TxAttemptBuilder_Expecter[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) NewEmptyTxAttempt(ctx interface{}, seq interface{}, feeLimit interface{}, fee interface{}, fromAddress interface{}) *TxAttemptBuilder_NewEmptyTxAttempt_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + return &TxAttemptBuilder_NewEmptyTxAttempt_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]{Call: _e.mock.On("NewEmptyTxAttempt", ctx, seq, feeLimit, fee, fromAddress)} +} + +func (_c *TxAttemptBuilder_NewEmptyTxAttempt_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Run(run func(ctx context.Context, seq SEQ, feeLimit uint64, fee FEE, fromAddress ADDR)) *TxAttemptBuilder_NewEmptyTxAttempt_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(SEQ), args[2].(uint64), args[3].(FEE), args[4].(ADDR)) + }) + return _c +} + +func (_c *TxAttemptBuilder_NewEmptyTxAttempt_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Return(attempt txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], err error) *TxAttemptBuilder_NewEmptyTxAttempt_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + _c.Call.Return(attempt, err) + return _c +} + +func (_c *TxAttemptBuilder_NewEmptyTxAttempt_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) RunAndReturn(run func(context.Context, SEQ, uint64, FEE, ADDR) (txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], error)) *TxAttemptBuilder_NewEmptyTxAttempt_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + _c.Call.Return(run) + return _c +} + // NewPurgeTxAttempt provides a mock function with given fields: ctx, etx, lggr func (_m *TxAttemptBuilder[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) NewPurgeTxAttempt(ctx context.Context, etx txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], lggr logger.Logger) (txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], error) { ret := _m.Called(ctx, etx, lggr) @@ -216,6 +402,36 @@ func (_m *TxAttemptBuilder[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) return r0, r1 } +// TxAttemptBuilder_NewPurgeTxAttempt_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NewPurgeTxAttempt' +type TxAttemptBuilder_NewPurgeTxAttempt_Call[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE feetypes.Fee] struct { + *mock.Call +} + +// NewPurgeTxAttempt is a helper method to define mock.On call +// - ctx context.Context +// - etx txmgrtypes.Tx[CHAIN_ID,ADDR,TX_HASH,BLOCK_HASH,SEQ,FEE] +// - lggr logger.Logger +func (_e *TxAttemptBuilder_Expecter[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) NewPurgeTxAttempt(ctx interface{}, etx interface{}, lggr interface{}) *TxAttemptBuilder_NewPurgeTxAttempt_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + return &TxAttemptBuilder_NewPurgeTxAttempt_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]{Call: _e.mock.On("NewPurgeTxAttempt", ctx, etx, lggr)} +} + +func (_c *TxAttemptBuilder_NewPurgeTxAttempt_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Run(run func(ctx context.Context, etx txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], lggr logger.Logger)) *TxAttemptBuilder_NewPurgeTxAttempt_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]), args[2].(logger.Logger)) + }) + return _c +} + +func (_c *TxAttemptBuilder_NewPurgeTxAttempt_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Return(attempt txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], err error) *TxAttemptBuilder_NewPurgeTxAttempt_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + _c.Call.Return(attempt, err) + return _c +} + +func (_c *TxAttemptBuilder_NewPurgeTxAttempt_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) RunAndReturn(run func(context.Context, txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], logger.Logger) (txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], error)) *TxAttemptBuilder_NewPurgeTxAttempt_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + _c.Call.Return(run) + return _c +} + // NewTxAttempt provides a mock function with given fields: ctx, tx, lggr, opts func (_m *TxAttemptBuilder[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) NewTxAttempt(ctx context.Context, tx txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], lggr logger.Logger, opts ...feetypes.Opt) (txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], FEE, uint64, bool, error) { _va := make([]interface{}, len(opts)) @@ -272,6 +488,44 @@ func (_m *TxAttemptBuilder[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) return r0, r1, r2, r3, r4 } +// TxAttemptBuilder_NewTxAttempt_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NewTxAttempt' +type TxAttemptBuilder_NewTxAttempt_Call[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE feetypes.Fee] struct { + *mock.Call +} + +// NewTxAttempt is a helper method to define mock.On call +// - ctx context.Context +// - tx txmgrtypes.Tx[CHAIN_ID,ADDR,TX_HASH,BLOCK_HASH,SEQ,FEE] +// - lggr logger.Logger +// - opts ...feetypes.Opt +func (_e *TxAttemptBuilder_Expecter[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) NewTxAttempt(ctx interface{}, tx interface{}, lggr interface{}, opts ...interface{}) *TxAttemptBuilder_NewTxAttempt_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + return &TxAttemptBuilder_NewTxAttempt_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]{Call: _e.mock.On("NewTxAttempt", + append([]interface{}{ctx, tx, lggr}, opts...)...)} +} + +func (_c *TxAttemptBuilder_NewTxAttempt_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Run(run func(ctx context.Context, tx txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], lggr logger.Logger, opts ...feetypes.Opt)) *TxAttemptBuilder_NewTxAttempt_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]feetypes.Opt, len(args)-3) + for i, a := range args[3:] { + if a != nil { + variadicArgs[i] = a.(feetypes.Opt) + } + } + run(args[0].(context.Context), args[1].(txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]), args[2].(logger.Logger), variadicArgs...) + }) + return _c +} + +func (_c *TxAttemptBuilder_NewTxAttempt_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Return(attempt txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], fee FEE, feeLimit uint64, retryable bool, err error) *TxAttemptBuilder_NewTxAttempt_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + _c.Call.Return(attempt, fee, feeLimit, retryable, err) + return _c +} + +func (_c *TxAttemptBuilder_NewTxAttempt_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) RunAndReturn(run func(context.Context, txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], logger.Logger, ...feetypes.Opt) (txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], FEE, uint64, bool, error)) *TxAttemptBuilder_NewTxAttempt_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + _c.Call.Return(run) + return _c +} + // NewTxAttemptWithType provides a mock function with given fields: ctx, tx, lggr, txType, opts func (_m *TxAttemptBuilder[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) NewTxAttemptWithType(ctx context.Context, tx txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], lggr logger.Logger, txType int, opts ...feetypes.Opt) (txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], FEE, uint64, bool, error) { _va := make([]interface{}, len(opts)) @@ -328,11 +582,79 @@ func (_m *TxAttemptBuilder[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) return r0, r1, r2, r3, r4 } +// TxAttemptBuilder_NewTxAttemptWithType_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NewTxAttemptWithType' +type TxAttemptBuilder_NewTxAttemptWithType_Call[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE feetypes.Fee] struct { + *mock.Call +} + +// NewTxAttemptWithType is a helper method to define mock.On call +// - ctx context.Context +// - tx txmgrtypes.Tx[CHAIN_ID,ADDR,TX_HASH,BLOCK_HASH,SEQ,FEE] +// - lggr logger.Logger +// - txType int +// - opts ...feetypes.Opt +func (_e *TxAttemptBuilder_Expecter[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) NewTxAttemptWithType(ctx interface{}, tx interface{}, lggr interface{}, txType interface{}, opts ...interface{}) *TxAttemptBuilder_NewTxAttemptWithType_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + return &TxAttemptBuilder_NewTxAttemptWithType_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]{Call: _e.mock.On("NewTxAttemptWithType", + append([]interface{}{ctx, tx, lggr, txType}, opts...)...)} +} + +func (_c *TxAttemptBuilder_NewTxAttemptWithType_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Run(run func(ctx context.Context, tx txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], lggr logger.Logger, txType int, opts ...feetypes.Opt)) *TxAttemptBuilder_NewTxAttemptWithType_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]feetypes.Opt, len(args)-4) + for i, a := range args[4:] { + if a != nil { + variadicArgs[i] = a.(feetypes.Opt) + } + } + run(args[0].(context.Context), args[1].(txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]), args[2].(logger.Logger), args[3].(int), variadicArgs...) + }) + return _c +} + +func (_c *TxAttemptBuilder_NewTxAttemptWithType_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Return(attempt txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], fee FEE, feeLimit uint64, retryable bool, err error) *TxAttemptBuilder_NewTxAttemptWithType_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + _c.Call.Return(attempt, fee, feeLimit, retryable, err) + return _c +} + +func (_c *TxAttemptBuilder_NewTxAttemptWithType_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) RunAndReturn(run func(context.Context, txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], logger.Logger, int, ...feetypes.Opt) (txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], FEE, uint64, bool, error)) *TxAttemptBuilder_NewTxAttemptWithType_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + _c.Call.Return(run) + return _c +} + // OnNewLongestChain provides a mock function with given fields: ctx, head func (_m *TxAttemptBuilder[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) OnNewLongestChain(ctx context.Context, head HEAD) { _m.Called(ctx, head) } +// TxAttemptBuilder_OnNewLongestChain_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OnNewLongestChain' +type TxAttemptBuilder_OnNewLongestChain_Call[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE feetypes.Fee] struct { + *mock.Call +} + +// OnNewLongestChain is a helper method to define mock.On call +// - ctx context.Context +// - head HEAD +func (_e *TxAttemptBuilder_Expecter[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) OnNewLongestChain(ctx interface{}, head interface{}) *TxAttemptBuilder_OnNewLongestChain_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + return &TxAttemptBuilder_OnNewLongestChain_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]{Call: _e.mock.On("OnNewLongestChain", ctx, head)} +} + +func (_c *TxAttemptBuilder_OnNewLongestChain_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Run(run func(ctx context.Context, head HEAD)) *TxAttemptBuilder_OnNewLongestChain_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(HEAD)) + }) + return _c +} + +func (_c *TxAttemptBuilder_OnNewLongestChain_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Return() *TxAttemptBuilder_OnNewLongestChain_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + _c.Call.Return() + return _c +} + +func (_c *TxAttemptBuilder_OnNewLongestChain_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) RunAndReturn(run func(context.Context, HEAD)) *TxAttemptBuilder_OnNewLongestChain_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + _c.Call.Return(run) + return _c +} + // Ready provides a mock function with given fields: func (_m *TxAttemptBuilder[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Ready() error { ret := _m.Called() @@ -351,6 +673,33 @@ func (_m *TxAttemptBuilder[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) return r0 } +// TxAttemptBuilder_Ready_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Ready' +type TxAttemptBuilder_Ready_Call[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE feetypes.Fee] struct { + *mock.Call +} + +// Ready is a helper method to define mock.On call +func (_e *TxAttemptBuilder_Expecter[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Ready() *TxAttemptBuilder_Ready_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + return &TxAttemptBuilder_Ready_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]{Call: _e.mock.On("Ready")} +} + +func (_c *TxAttemptBuilder_Ready_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Run(run func()) *TxAttemptBuilder_Ready_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *TxAttemptBuilder_Ready_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Return(_a0 error) *TxAttemptBuilder_Ready_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + _c.Call.Return(_a0) + return _c +} + +func (_c *TxAttemptBuilder_Ready_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) RunAndReturn(run func() error) *TxAttemptBuilder_Ready_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + _c.Call.Return(run) + return _c +} + // Start provides a mock function with given fields: _a0 func (_m *TxAttemptBuilder[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Start(_a0 context.Context) error { ret := _m.Called(_a0) @@ -369,6 +718,34 @@ func (_m *TxAttemptBuilder[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) return r0 } +// TxAttemptBuilder_Start_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Start' +type TxAttemptBuilder_Start_Call[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE feetypes.Fee] struct { + *mock.Call +} + +// Start is a helper method to define mock.On call +// - _a0 context.Context +func (_e *TxAttemptBuilder_Expecter[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Start(_a0 interface{}) *TxAttemptBuilder_Start_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + return &TxAttemptBuilder_Start_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]{Call: _e.mock.On("Start", _a0)} +} + +func (_c *TxAttemptBuilder_Start_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Run(run func(_a0 context.Context)) *TxAttemptBuilder_Start_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *TxAttemptBuilder_Start_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Return(_a0 error) *TxAttemptBuilder_Start_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + _c.Call.Return(_a0) + return _c +} + +func (_c *TxAttemptBuilder_Start_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) RunAndReturn(run func(context.Context) error) *TxAttemptBuilder_Start_Call[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] { + _c.Call.Return(run) + return _c +} + // NewTxAttemptBuilder creates a new instance of TxAttemptBuilder. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewTxAttemptBuilder[CHAIN_ID types.ID, HEAD types.Head[BLOCK_HASH], ADDR types.Hashable, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, SEQ types.Sequence, FEE feetypes.Fee](t interface { diff --git a/common/txmgr/types/mocks/tx_store.go b/common/txmgr/types/mocks/tx_store.go index 9c2edfa963f..4467729e167 100644 --- a/common/txmgr/types/mocks/tx_store.go +++ b/common/txmgr/types/mocks/tx_store.go @@ -25,6 +25,14 @@ type TxStore[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLO mock.Mock } +type TxStore_Expecter[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE feetypes.Fee] struct { + mock *mock.Mock +} + +func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) EXPECT() *TxStore_Expecter[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + return &TxStore_Expecter[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]{mock: &_m.Mock} +} + // Abandon provides a mock function with given fields: ctx, id, addr func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Abandon(ctx context.Context, id CHAIN_ID, addr ADDR) error { ret := _m.Called(ctx, id, addr) @@ -43,6 +51,36 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Abandon(ctx return r0 } +// TxStore_Abandon_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Abandon' +type TxStore_Abandon_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE feetypes.Fee] struct { + *mock.Call +} + +// Abandon is a helper method to define mock.On call +// - ctx context.Context +// - id CHAIN_ID +// - addr ADDR +func (_e *TxStore_Expecter[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Abandon(ctx interface{}, id interface{}, addr interface{}) *TxStore_Abandon_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + return &TxStore_Abandon_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]{Call: _e.mock.On("Abandon", ctx, id, addr)} +} + +func (_c *TxStore_Abandon_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Run(run func(ctx context.Context, id CHAIN_ID, addr ADDR)) *TxStore_Abandon_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(CHAIN_ID), args[2].(ADDR)) + }) + return _c +} + +func (_c *TxStore_Abandon_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Return(_a0 error) *TxStore_Abandon_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Return(_a0) + return _c +} + +func (_c *TxStore_Abandon_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) RunAndReturn(run func(context.Context, CHAIN_ID, ADDR) error) *TxStore_Abandon_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Return(run) + return _c +} + // CheckTxQueueCapacity provides a mock function with given fields: ctx, fromAddress, maxQueuedTransactions, chainID func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) CheckTxQueueCapacity(ctx context.Context, fromAddress ADDR, maxQueuedTransactions uint64, chainID CHAIN_ID) error { ret := _m.Called(ctx, fromAddress, maxQueuedTransactions, chainID) @@ -61,11 +99,69 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) CheckTxQueu return r0 } +// TxStore_CheckTxQueueCapacity_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CheckTxQueueCapacity' +type TxStore_CheckTxQueueCapacity_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE feetypes.Fee] struct { + *mock.Call +} + +// CheckTxQueueCapacity is a helper method to define mock.On call +// - ctx context.Context +// - fromAddress ADDR +// - maxQueuedTransactions uint64 +// - chainID CHAIN_ID +func (_e *TxStore_Expecter[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) CheckTxQueueCapacity(ctx interface{}, fromAddress interface{}, maxQueuedTransactions interface{}, chainID interface{}) *TxStore_CheckTxQueueCapacity_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + return &TxStore_CheckTxQueueCapacity_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]{Call: _e.mock.On("CheckTxQueueCapacity", ctx, fromAddress, maxQueuedTransactions, chainID)} +} + +func (_c *TxStore_CheckTxQueueCapacity_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Run(run func(ctx context.Context, fromAddress ADDR, maxQueuedTransactions uint64, chainID CHAIN_ID)) *TxStore_CheckTxQueueCapacity_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(ADDR), args[2].(uint64), args[3].(CHAIN_ID)) + }) + return _c +} + +func (_c *TxStore_CheckTxQueueCapacity_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Return(err error) *TxStore_CheckTxQueueCapacity_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Return(err) + return _c +} + +func (_c *TxStore_CheckTxQueueCapacity_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) RunAndReturn(run func(context.Context, ADDR, uint64, CHAIN_ID) error) *TxStore_CheckTxQueueCapacity_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Return(run) + return _c +} + // Close provides a mock function with given fields: func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Close() { _m.Called() } +// TxStore_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close' +type TxStore_Close_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE feetypes.Fee] struct { + *mock.Call +} + +// Close is a helper method to define mock.On call +func (_e *TxStore_Expecter[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Close() *TxStore_Close_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + return &TxStore_Close_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]{Call: _e.mock.On("Close")} +} + +func (_c *TxStore_Close_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Run(run func()) *TxStore_Close_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *TxStore_Close_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Return() *TxStore_Close_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Return() + return _c +} + +func (_c *TxStore_Close_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) RunAndReturn(run func()) *TxStore_Close_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Return(run) + return _c +} + // CountTransactionsByState provides a mock function with given fields: ctx, state, chainID func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) CountTransactionsByState(ctx context.Context, state txmgrtypes.TxState, chainID CHAIN_ID) (uint32, error) { ret := _m.Called(ctx, state, chainID) @@ -94,6 +190,36 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) CountTransa return r0, r1 } +// TxStore_CountTransactionsByState_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CountTransactionsByState' +type TxStore_CountTransactionsByState_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE feetypes.Fee] struct { + *mock.Call +} + +// CountTransactionsByState is a helper method to define mock.On call +// - ctx context.Context +// - state txmgrtypes.TxState +// - chainID CHAIN_ID +func (_e *TxStore_Expecter[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) CountTransactionsByState(ctx interface{}, state interface{}, chainID interface{}) *TxStore_CountTransactionsByState_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + return &TxStore_CountTransactionsByState_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]{Call: _e.mock.On("CountTransactionsByState", ctx, state, chainID)} +} + +func (_c *TxStore_CountTransactionsByState_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Run(run func(ctx context.Context, state txmgrtypes.TxState, chainID CHAIN_ID)) *TxStore_CountTransactionsByState_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(txmgrtypes.TxState), args[2].(CHAIN_ID)) + }) + return _c +} + +func (_c *TxStore_CountTransactionsByState_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Return(count uint32, err error) *TxStore_CountTransactionsByState_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Return(count, err) + return _c +} + +func (_c *TxStore_CountTransactionsByState_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) RunAndReturn(run func(context.Context, txmgrtypes.TxState, CHAIN_ID) (uint32, error)) *TxStore_CountTransactionsByState_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Return(run) + return _c +} + // CountUnconfirmedTransactions provides a mock function with given fields: ctx, fromAddress, chainID func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) CountUnconfirmedTransactions(ctx context.Context, fromAddress ADDR, chainID CHAIN_ID) (uint32, error) { ret := _m.Called(ctx, fromAddress, chainID) @@ -122,6 +248,36 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) CountUnconf return r0, r1 } +// TxStore_CountUnconfirmedTransactions_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CountUnconfirmedTransactions' +type TxStore_CountUnconfirmedTransactions_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE feetypes.Fee] struct { + *mock.Call +} + +// CountUnconfirmedTransactions is a helper method to define mock.On call +// - ctx context.Context +// - fromAddress ADDR +// - chainID CHAIN_ID +func (_e *TxStore_Expecter[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) CountUnconfirmedTransactions(ctx interface{}, fromAddress interface{}, chainID interface{}) *TxStore_CountUnconfirmedTransactions_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + return &TxStore_CountUnconfirmedTransactions_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]{Call: _e.mock.On("CountUnconfirmedTransactions", ctx, fromAddress, chainID)} +} + +func (_c *TxStore_CountUnconfirmedTransactions_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Run(run func(ctx context.Context, fromAddress ADDR, chainID CHAIN_ID)) *TxStore_CountUnconfirmedTransactions_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(ADDR), args[2].(CHAIN_ID)) + }) + return _c +} + +func (_c *TxStore_CountUnconfirmedTransactions_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Return(count uint32, err error) *TxStore_CountUnconfirmedTransactions_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Return(count, err) + return _c +} + +func (_c *TxStore_CountUnconfirmedTransactions_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) RunAndReturn(run func(context.Context, ADDR, CHAIN_ID) (uint32, error)) *TxStore_CountUnconfirmedTransactions_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Return(run) + return _c +} + // CountUnstartedTransactions provides a mock function with given fields: ctx, fromAddress, chainID func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) CountUnstartedTransactions(ctx context.Context, fromAddress ADDR, chainID CHAIN_ID) (uint32, error) { ret := _m.Called(ctx, fromAddress, chainID) @@ -150,6 +306,36 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) CountUnstar return r0, r1 } +// TxStore_CountUnstartedTransactions_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CountUnstartedTransactions' +type TxStore_CountUnstartedTransactions_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE feetypes.Fee] struct { + *mock.Call +} + +// CountUnstartedTransactions is a helper method to define mock.On call +// - ctx context.Context +// - fromAddress ADDR +// - chainID CHAIN_ID +func (_e *TxStore_Expecter[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) CountUnstartedTransactions(ctx interface{}, fromAddress interface{}, chainID interface{}) *TxStore_CountUnstartedTransactions_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + return &TxStore_CountUnstartedTransactions_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]{Call: _e.mock.On("CountUnstartedTransactions", ctx, fromAddress, chainID)} +} + +func (_c *TxStore_CountUnstartedTransactions_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Run(run func(ctx context.Context, fromAddress ADDR, chainID CHAIN_ID)) *TxStore_CountUnstartedTransactions_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(ADDR), args[2].(CHAIN_ID)) + }) + return _c +} + +func (_c *TxStore_CountUnstartedTransactions_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Return(count uint32, err error) *TxStore_CountUnstartedTransactions_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Return(count, err) + return _c +} + +func (_c *TxStore_CountUnstartedTransactions_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) RunAndReturn(run func(context.Context, ADDR, CHAIN_ID) (uint32, error)) *TxStore_CountUnstartedTransactions_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Return(run) + return _c +} + // CreateTransaction provides a mock function with given fields: ctx, txRequest, chainID func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) CreateTransaction(ctx context.Context, txRequest txmgrtypes.TxRequest[ADDR, TX_HASH], chainID CHAIN_ID) (txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], error) { ret := _m.Called(ctx, txRequest, chainID) @@ -178,6 +364,36 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) CreateTrans return r0, r1 } +// TxStore_CreateTransaction_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateTransaction' +type TxStore_CreateTransaction_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE feetypes.Fee] struct { + *mock.Call +} + +// CreateTransaction is a helper method to define mock.On call +// - ctx context.Context +// - txRequest txmgrtypes.TxRequest[ADDR,TX_HASH] +// - chainID CHAIN_ID +func (_e *TxStore_Expecter[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) CreateTransaction(ctx interface{}, txRequest interface{}, chainID interface{}) *TxStore_CreateTransaction_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + return &TxStore_CreateTransaction_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]{Call: _e.mock.On("CreateTransaction", ctx, txRequest, chainID)} +} + +func (_c *TxStore_CreateTransaction_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Run(run func(ctx context.Context, txRequest txmgrtypes.TxRequest[ADDR, TX_HASH], chainID CHAIN_ID)) *TxStore_CreateTransaction_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(txmgrtypes.TxRequest[ADDR, TX_HASH]), args[2].(CHAIN_ID)) + }) + return _c +} + +func (_c *TxStore_CreateTransaction_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Return(tx txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], err error) *TxStore_CreateTransaction_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Return(tx, err) + return _c +} + +func (_c *TxStore_CreateTransaction_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) RunAndReturn(run func(context.Context, txmgrtypes.TxRequest[ADDR, TX_HASH], CHAIN_ID) (txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], error)) *TxStore_CreateTransaction_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Return(run) + return _c +} + // DeleteInProgressAttempt provides a mock function with given fields: ctx, attempt func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) DeleteInProgressAttempt(ctx context.Context, attempt txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) error { ret := _m.Called(ctx, attempt) @@ -196,6 +412,35 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) DeleteInPro return r0 } +// TxStore_DeleteInProgressAttempt_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteInProgressAttempt' +type TxStore_DeleteInProgressAttempt_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE feetypes.Fee] struct { + *mock.Call +} + +// DeleteInProgressAttempt is a helper method to define mock.On call +// - ctx context.Context +// - attempt txmgrtypes.TxAttempt[CHAIN_ID,ADDR,TX_HASH,BLOCK_HASH,SEQ,FEE] +func (_e *TxStore_Expecter[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) DeleteInProgressAttempt(ctx interface{}, attempt interface{}) *TxStore_DeleteInProgressAttempt_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + return &TxStore_DeleteInProgressAttempt_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]{Call: _e.mock.On("DeleteInProgressAttempt", ctx, attempt)} +} + +func (_c *TxStore_DeleteInProgressAttempt_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Run(run func(ctx context.Context, attempt txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE])) *TxStore_DeleteInProgressAttempt_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE])) + }) + return _c +} + +func (_c *TxStore_DeleteInProgressAttempt_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Return(_a0 error) *TxStore_DeleteInProgressAttempt_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Return(_a0) + return _c +} + +func (_c *TxStore_DeleteInProgressAttempt_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) RunAndReturn(run func(context.Context, txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) error) *TxStore_DeleteInProgressAttempt_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Return(run) + return _c +} + // FindEarliestUnconfirmedBroadcastTime provides a mock function with given fields: ctx, chainID func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) FindEarliestUnconfirmedBroadcastTime(ctx context.Context, chainID CHAIN_ID) (null.Time, error) { ret := _m.Called(ctx, chainID) @@ -224,6 +469,35 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) FindEarlies return r0, r1 } +// TxStore_FindEarliestUnconfirmedBroadcastTime_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindEarliestUnconfirmedBroadcastTime' +type TxStore_FindEarliestUnconfirmedBroadcastTime_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE feetypes.Fee] struct { + *mock.Call +} + +// FindEarliestUnconfirmedBroadcastTime is a helper method to define mock.On call +// - ctx context.Context +// - chainID CHAIN_ID +func (_e *TxStore_Expecter[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) FindEarliestUnconfirmedBroadcastTime(ctx interface{}, chainID interface{}) *TxStore_FindEarliestUnconfirmedBroadcastTime_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + return &TxStore_FindEarliestUnconfirmedBroadcastTime_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]{Call: _e.mock.On("FindEarliestUnconfirmedBroadcastTime", ctx, chainID)} +} + +func (_c *TxStore_FindEarliestUnconfirmedBroadcastTime_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Run(run func(ctx context.Context, chainID CHAIN_ID)) *TxStore_FindEarliestUnconfirmedBroadcastTime_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(CHAIN_ID)) + }) + return _c +} + +func (_c *TxStore_FindEarliestUnconfirmedBroadcastTime_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Return(_a0 null.Time, _a1 error) *TxStore_FindEarliestUnconfirmedBroadcastTime_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *TxStore_FindEarliestUnconfirmedBroadcastTime_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) RunAndReturn(run func(context.Context, CHAIN_ID) (null.Time, error)) *TxStore_FindEarliestUnconfirmedBroadcastTime_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Return(run) + return _c +} + // FindEarliestUnconfirmedTxAttemptBlock provides a mock function with given fields: ctx, chainID func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) FindEarliestUnconfirmedTxAttemptBlock(ctx context.Context, chainID CHAIN_ID) (null.Int, error) { ret := _m.Called(ctx, chainID) @@ -252,6 +526,35 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) FindEarlies return r0, r1 } +// TxStore_FindEarliestUnconfirmedTxAttemptBlock_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindEarliestUnconfirmedTxAttemptBlock' +type TxStore_FindEarliestUnconfirmedTxAttemptBlock_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE feetypes.Fee] struct { + *mock.Call +} + +// FindEarliestUnconfirmedTxAttemptBlock is a helper method to define mock.On call +// - ctx context.Context +// - chainID CHAIN_ID +func (_e *TxStore_Expecter[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) FindEarliestUnconfirmedTxAttemptBlock(ctx interface{}, chainID interface{}) *TxStore_FindEarliestUnconfirmedTxAttemptBlock_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + return &TxStore_FindEarliestUnconfirmedTxAttemptBlock_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]{Call: _e.mock.On("FindEarliestUnconfirmedTxAttemptBlock", ctx, chainID)} +} + +func (_c *TxStore_FindEarliestUnconfirmedTxAttemptBlock_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Run(run func(ctx context.Context, chainID CHAIN_ID)) *TxStore_FindEarliestUnconfirmedTxAttemptBlock_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(CHAIN_ID)) + }) + return _c +} + +func (_c *TxStore_FindEarliestUnconfirmedTxAttemptBlock_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Return(_a0 null.Int, _a1 error) *TxStore_FindEarliestUnconfirmedTxAttemptBlock_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *TxStore_FindEarliestUnconfirmedTxAttemptBlock_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) RunAndReturn(run func(context.Context, CHAIN_ID) (null.Int, error)) *TxStore_FindEarliestUnconfirmedTxAttemptBlock_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Return(run) + return _c +} + // FindLatestSequence provides a mock function with given fields: ctx, fromAddress, chainId func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) FindLatestSequence(ctx context.Context, fromAddress ADDR, chainId CHAIN_ID) (SEQ, error) { ret := _m.Called(ctx, fromAddress, chainId) @@ -280,6 +583,36 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) FindLatestS return r0, r1 } +// TxStore_FindLatestSequence_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindLatestSequence' +type TxStore_FindLatestSequence_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE feetypes.Fee] struct { + *mock.Call +} + +// FindLatestSequence is a helper method to define mock.On call +// - ctx context.Context +// - fromAddress ADDR +// - chainId CHAIN_ID +func (_e *TxStore_Expecter[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) FindLatestSequence(ctx interface{}, fromAddress interface{}, chainId interface{}) *TxStore_FindLatestSequence_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + return &TxStore_FindLatestSequence_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]{Call: _e.mock.On("FindLatestSequence", ctx, fromAddress, chainId)} +} + +func (_c *TxStore_FindLatestSequence_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Run(run func(ctx context.Context, fromAddress ADDR, chainId CHAIN_ID)) *TxStore_FindLatestSequence_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(ADDR), args[2].(CHAIN_ID)) + }) + return _c +} + +func (_c *TxStore_FindLatestSequence_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Return(_a0 SEQ, _a1 error) *TxStore_FindLatestSequence_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *TxStore_FindLatestSequence_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) RunAndReturn(run func(context.Context, ADDR, CHAIN_ID) (SEQ, error)) *TxStore_FindLatestSequence_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Return(run) + return _c +} + // FindNextUnstartedTransactionFromAddress provides a mock function with given fields: ctx, fromAddress, chainID func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) FindNextUnstartedTransactionFromAddress(ctx context.Context, fromAddress ADDR, chainID CHAIN_ID) (*txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], error) { ret := _m.Called(ctx, fromAddress, chainID) @@ -310,6 +643,36 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) FindNextUns return r0, r1 } +// TxStore_FindNextUnstartedTransactionFromAddress_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindNextUnstartedTransactionFromAddress' +type TxStore_FindNextUnstartedTransactionFromAddress_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE feetypes.Fee] struct { + *mock.Call +} + +// FindNextUnstartedTransactionFromAddress is a helper method to define mock.On call +// - ctx context.Context +// - fromAddress ADDR +// - chainID CHAIN_ID +func (_e *TxStore_Expecter[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) FindNextUnstartedTransactionFromAddress(ctx interface{}, fromAddress interface{}, chainID interface{}) *TxStore_FindNextUnstartedTransactionFromAddress_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + return &TxStore_FindNextUnstartedTransactionFromAddress_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]{Call: _e.mock.On("FindNextUnstartedTransactionFromAddress", ctx, fromAddress, chainID)} +} + +func (_c *TxStore_FindNextUnstartedTransactionFromAddress_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Run(run func(ctx context.Context, fromAddress ADDR, chainID CHAIN_ID)) *TxStore_FindNextUnstartedTransactionFromAddress_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(ADDR), args[2].(CHAIN_ID)) + }) + return _c +} + +func (_c *TxStore_FindNextUnstartedTransactionFromAddress_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Return(_a0 *txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], _a1 error) *TxStore_FindNextUnstartedTransactionFromAddress_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *TxStore_FindNextUnstartedTransactionFromAddress_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) RunAndReturn(run func(context.Context, ADDR, CHAIN_ID) (*txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], error)) *TxStore_FindNextUnstartedTransactionFromAddress_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Return(run) + return _c +} + // FindTransactionsConfirmedInBlockRange provides a mock function with given fields: ctx, highBlockNumber, lowBlockNumber, chainID func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) FindTransactionsConfirmedInBlockRange(ctx context.Context, highBlockNumber int64, lowBlockNumber int64, chainID CHAIN_ID) ([]*txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], error) { ret := _m.Called(ctx, highBlockNumber, lowBlockNumber, chainID) @@ -340,6 +703,37 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) FindTransac return r0, r1 } +// TxStore_FindTransactionsConfirmedInBlockRange_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindTransactionsConfirmedInBlockRange' +type TxStore_FindTransactionsConfirmedInBlockRange_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE feetypes.Fee] struct { + *mock.Call +} + +// FindTransactionsConfirmedInBlockRange is a helper method to define mock.On call +// - ctx context.Context +// - highBlockNumber int64 +// - lowBlockNumber int64 +// - chainID CHAIN_ID +func (_e *TxStore_Expecter[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) FindTransactionsConfirmedInBlockRange(ctx interface{}, highBlockNumber interface{}, lowBlockNumber interface{}, chainID interface{}) *TxStore_FindTransactionsConfirmedInBlockRange_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + return &TxStore_FindTransactionsConfirmedInBlockRange_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]{Call: _e.mock.On("FindTransactionsConfirmedInBlockRange", ctx, highBlockNumber, lowBlockNumber, chainID)} +} + +func (_c *TxStore_FindTransactionsConfirmedInBlockRange_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Run(run func(ctx context.Context, highBlockNumber int64, lowBlockNumber int64, chainID CHAIN_ID)) *TxStore_FindTransactionsConfirmedInBlockRange_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(int64), args[2].(int64), args[3].(CHAIN_ID)) + }) + return _c +} + +func (_c *TxStore_FindTransactionsConfirmedInBlockRange_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Return(etxs []*txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], err error) *TxStore_FindTransactionsConfirmedInBlockRange_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Return(etxs, err) + return _c +} + +func (_c *TxStore_FindTransactionsConfirmedInBlockRange_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) RunAndReturn(run func(context.Context, int64, int64, CHAIN_ID) ([]*txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], error)) *TxStore_FindTransactionsConfirmedInBlockRange_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Return(run) + return _c +} + // FindTxAttemptsConfirmedMissingReceipt provides a mock function with given fields: ctx, chainID func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) FindTxAttemptsConfirmedMissingReceipt(ctx context.Context, chainID CHAIN_ID) ([]txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], error) { ret := _m.Called(ctx, chainID) @@ -370,6 +764,35 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) FindTxAttem return r0, r1 } +// TxStore_FindTxAttemptsConfirmedMissingReceipt_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindTxAttemptsConfirmedMissingReceipt' +type TxStore_FindTxAttemptsConfirmedMissingReceipt_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE feetypes.Fee] struct { + *mock.Call +} + +// FindTxAttemptsConfirmedMissingReceipt is a helper method to define mock.On call +// - ctx context.Context +// - chainID CHAIN_ID +func (_e *TxStore_Expecter[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) FindTxAttemptsConfirmedMissingReceipt(ctx interface{}, chainID interface{}) *TxStore_FindTxAttemptsConfirmedMissingReceipt_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + return &TxStore_FindTxAttemptsConfirmedMissingReceipt_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]{Call: _e.mock.On("FindTxAttemptsConfirmedMissingReceipt", ctx, chainID)} +} + +func (_c *TxStore_FindTxAttemptsConfirmedMissingReceipt_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Run(run func(ctx context.Context, chainID CHAIN_ID)) *TxStore_FindTxAttemptsConfirmedMissingReceipt_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(CHAIN_ID)) + }) + return _c +} + +func (_c *TxStore_FindTxAttemptsConfirmedMissingReceipt_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Return(attempts []txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], err error) *TxStore_FindTxAttemptsConfirmedMissingReceipt_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Return(attempts, err) + return _c +} + +func (_c *TxStore_FindTxAttemptsConfirmedMissingReceipt_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) RunAndReturn(run func(context.Context, CHAIN_ID) ([]txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], error)) *TxStore_FindTxAttemptsConfirmedMissingReceipt_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Return(run) + return _c +} + // FindTxAttemptsRequiringReceiptFetch provides a mock function with given fields: ctx, chainID func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) FindTxAttemptsRequiringReceiptFetch(ctx context.Context, chainID CHAIN_ID) ([]txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], error) { ret := _m.Called(ctx, chainID) @@ -400,6 +823,35 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) FindTxAttem return r0, r1 } +// TxStore_FindTxAttemptsRequiringReceiptFetch_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindTxAttemptsRequiringReceiptFetch' +type TxStore_FindTxAttemptsRequiringReceiptFetch_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE feetypes.Fee] struct { + *mock.Call +} + +// FindTxAttemptsRequiringReceiptFetch is a helper method to define mock.On call +// - ctx context.Context +// - chainID CHAIN_ID +func (_e *TxStore_Expecter[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) FindTxAttemptsRequiringReceiptFetch(ctx interface{}, chainID interface{}) *TxStore_FindTxAttemptsRequiringReceiptFetch_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + return &TxStore_FindTxAttemptsRequiringReceiptFetch_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]{Call: _e.mock.On("FindTxAttemptsRequiringReceiptFetch", ctx, chainID)} +} + +func (_c *TxStore_FindTxAttemptsRequiringReceiptFetch_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Run(run func(ctx context.Context, chainID CHAIN_ID)) *TxStore_FindTxAttemptsRequiringReceiptFetch_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(CHAIN_ID)) + }) + return _c +} + +func (_c *TxStore_FindTxAttemptsRequiringReceiptFetch_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Return(attempts []txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], err error) *TxStore_FindTxAttemptsRequiringReceiptFetch_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Return(attempts, err) + return _c +} + +func (_c *TxStore_FindTxAttemptsRequiringReceiptFetch_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) RunAndReturn(run func(context.Context, CHAIN_ID) ([]txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], error)) *TxStore_FindTxAttemptsRequiringReceiptFetch_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Return(run) + return _c +} + // FindTxAttemptsRequiringResend provides a mock function with given fields: ctx, olderThan, maxInFlightTransactions, chainID, address func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) FindTxAttemptsRequiringResend(ctx context.Context, olderThan time.Time, maxInFlightTransactions uint32, chainID CHAIN_ID, address ADDR) ([]txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], error) { ret := _m.Called(ctx, olderThan, maxInFlightTransactions, chainID, address) @@ -430,6 +882,38 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) FindTxAttem return r0, r1 } +// TxStore_FindTxAttemptsRequiringResend_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindTxAttemptsRequiringResend' +type TxStore_FindTxAttemptsRequiringResend_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE feetypes.Fee] struct { + *mock.Call +} + +// FindTxAttemptsRequiringResend is a helper method to define mock.On call +// - ctx context.Context +// - olderThan time.Time +// - maxInFlightTransactions uint32 +// - chainID CHAIN_ID +// - address ADDR +func (_e *TxStore_Expecter[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) FindTxAttemptsRequiringResend(ctx interface{}, olderThan interface{}, maxInFlightTransactions interface{}, chainID interface{}, address interface{}) *TxStore_FindTxAttemptsRequiringResend_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + return &TxStore_FindTxAttemptsRequiringResend_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]{Call: _e.mock.On("FindTxAttemptsRequiringResend", ctx, olderThan, maxInFlightTransactions, chainID, address)} +} + +func (_c *TxStore_FindTxAttemptsRequiringResend_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Run(run func(ctx context.Context, olderThan time.Time, maxInFlightTransactions uint32, chainID CHAIN_ID, address ADDR)) *TxStore_FindTxAttemptsRequiringResend_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(time.Time), args[2].(uint32), args[3].(CHAIN_ID), args[4].(ADDR)) + }) + return _c +} + +func (_c *TxStore_FindTxAttemptsRequiringResend_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Return(attempts []txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], err error) *TxStore_FindTxAttemptsRequiringResend_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Return(attempts, err) + return _c +} + +func (_c *TxStore_FindTxAttemptsRequiringResend_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) RunAndReturn(run func(context.Context, time.Time, uint32, CHAIN_ID, ADDR) ([]txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], error)) *TxStore_FindTxAttemptsRequiringResend_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Return(run) + return _c +} + // FindTxWithIdempotencyKey provides a mock function with given fields: ctx, idempotencyKey, chainID func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) FindTxWithIdempotencyKey(ctx context.Context, idempotencyKey string, chainID CHAIN_ID) (*txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], error) { ret := _m.Called(ctx, idempotencyKey, chainID) @@ -460,6 +944,36 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) FindTxWithI return r0, r1 } +// TxStore_FindTxWithIdempotencyKey_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindTxWithIdempotencyKey' +type TxStore_FindTxWithIdempotencyKey_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE feetypes.Fee] struct { + *mock.Call +} + +// FindTxWithIdempotencyKey is a helper method to define mock.On call +// - ctx context.Context +// - idempotencyKey string +// - chainID CHAIN_ID +func (_e *TxStore_Expecter[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) FindTxWithIdempotencyKey(ctx interface{}, idempotencyKey interface{}, chainID interface{}) *TxStore_FindTxWithIdempotencyKey_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + return &TxStore_FindTxWithIdempotencyKey_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]{Call: _e.mock.On("FindTxWithIdempotencyKey", ctx, idempotencyKey, chainID)} +} + +func (_c *TxStore_FindTxWithIdempotencyKey_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Run(run func(ctx context.Context, idempotencyKey string, chainID CHAIN_ID)) *TxStore_FindTxWithIdempotencyKey_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(CHAIN_ID)) + }) + return _c +} + +func (_c *TxStore_FindTxWithIdempotencyKey_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Return(tx *txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], err error) *TxStore_FindTxWithIdempotencyKey_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Return(tx, err) + return _c +} + +func (_c *TxStore_FindTxWithIdempotencyKey_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) RunAndReturn(run func(context.Context, string, CHAIN_ID) (*txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], error)) *TxStore_FindTxWithIdempotencyKey_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Return(run) + return _c +} + // FindTxWithSequence provides a mock function with given fields: ctx, fromAddress, seq func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) FindTxWithSequence(ctx context.Context, fromAddress ADDR, seq SEQ) (*txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], error) { ret := _m.Called(ctx, fromAddress, seq) @@ -490,6 +1004,36 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) FindTxWithS return r0, r1 } +// TxStore_FindTxWithSequence_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindTxWithSequence' +type TxStore_FindTxWithSequence_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE feetypes.Fee] struct { + *mock.Call +} + +// FindTxWithSequence is a helper method to define mock.On call +// - ctx context.Context +// - fromAddress ADDR +// - seq SEQ +func (_e *TxStore_Expecter[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) FindTxWithSequence(ctx interface{}, fromAddress interface{}, seq interface{}) *TxStore_FindTxWithSequence_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + return &TxStore_FindTxWithSequence_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]{Call: _e.mock.On("FindTxWithSequence", ctx, fromAddress, seq)} +} + +func (_c *TxStore_FindTxWithSequence_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Run(run func(ctx context.Context, fromAddress ADDR, seq SEQ)) *TxStore_FindTxWithSequence_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(ADDR), args[2].(SEQ)) + }) + return _c +} + +func (_c *TxStore_FindTxWithSequence_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Return(etx *txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], err error) *TxStore_FindTxWithSequence_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Return(etx, err) + return _c +} + +func (_c *TxStore_FindTxWithSequence_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) RunAndReturn(run func(context.Context, ADDR, SEQ) (*txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], error)) *TxStore_FindTxWithSequence_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Return(run) + return _c +} + // FindTxesByMetaFieldAndStates provides a mock function with given fields: ctx, metaField, metaValue, states, chainID func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) FindTxesByMetaFieldAndStates(ctx context.Context, metaField string, metaValue string, states []txmgrtypes.TxState, chainID *big.Int) ([]*txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], error) { ret := _m.Called(ctx, metaField, metaValue, states, chainID) @@ -520,6 +1064,38 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) FindTxesByM return r0, r1 } +// TxStore_FindTxesByMetaFieldAndStates_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindTxesByMetaFieldAndStates' +type TxStore_FindTxesByMetaFieldAndStates_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE feetypes.Fee] struct { + *mock.Call +} + +// FindTxesByMetaFieldAndStates is a helper method to define mock.On call +// - ctx context.Context +// - metaField string +// - metaValue string +// - states []txmgrtypes.TxState +// - chainID *big.Int +func (_e *TxStore_Expecter[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) FindTxesByMetaFieldAndStates(ctx interface{}, metaField interface{}, metaValue interface{}, states interface{}, chainID interface{}) *TxStore_FindTxesByMetaFieldAndStates_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + return &TxStore_FindTxesByMetaFieldAndStates_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]{Call: _e.mock.On("FindTxesByMetaFieldAndStates", ctx, metaField, metaValue, states, chainID)} +} + +func (_c *TxStore_FindTxesByMetaFieldAndStates_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Run(run func(ctx context.Context, metaField string, metaValue string, states []txmgrtypes.TxState, chainID *big.Int)) *TxStore_FindTxesByMetaFieldAndStates_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string), args[3].([]txmgrtypes.TxState), args[4].(*big.Int)) + }) + return _c +} + +func (_c *TxStore_FindTxesByMetaFieldAndStates_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Return(tx []*txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], err error) *TxStore_FindTxesByMetaFieldAndStates_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Return(tx, err) + return _c +} + +func (_c *TxStore_FindTxesByMetaFieldAndStates_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) RunAndReturn(run func(context.Context, string, string, []txmgrtypes.TxState, *big.Int) ([]*txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], error)) *TxStore_FindTxesByMetaFieldAndStates_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Return(run) + return _c +} + // FindTxesPendingCallback provides a mock function with given fields: ctx, blockNum, chainID func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) FindTxesPendingCallback(ctx context.Context, blockNum int64, chainID CHAIN_ID) ([]txmgrtypes.ReceiptPlus[R], error) { ret := _m.Called(ctx, blockNum, chainID) @@ -550,6 +1126,36 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) FindTxesPen return r0, r1 } +// TxStore_FindTxesPendingCallback_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindTxesPendingCallback' +type TxStore_FindTxesPendingCallback_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE feetypes.Fee] struct { + *mock.Call +} + +// FindTxesPendingCallback is a helper method to define mock.On call +// - ctx context.Context +// - blockNum int64 +// - chainID CHAIN_ID +func (_e *TxStore_Expecter[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) FindTxesPendingCallback(ctx interface{}, blockNum interface{}, chainID interface{}) *TxStore_FindTxesPendingCallback_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + return &TxStore_FindTxesPendingCallback_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]{Call: _e.mock.On("FindTxesPendingCallback", ctx, blockNum, chainID)} +} + +func (_c *TxStore_FindTxesPendingCallback_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Run(run func(ctx context.Context, blockNum int64, chainID CHAIN_ID)) *TxStore_FindTxesPendingCallback_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(int64), args[2].(CHAIN_ID)) + }) + return _c +} + +func (_c *TxStore_FindTxesPendingCallback_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Return(receiptsPlus []txmgrtypes.ReceiptPlus[R], err error) *TxStore_FindTxesPendingCallback_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Return(receiptsPlus, err) + return _c +} + +func (_c *TxStore_FindTxesPendingCallback_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) RunAndReturn(run func(context.Context, int64, CHAIN_ID) ([]txmgrtypes.ReceiptPlus[R], error)) *TxStore_FindTxesPendingCallback_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Return(run) + return _c +} + // FindTxesWithAttemptsAndReceiptsByIdsAndState provides a mock function with given fields: ctx, ids, states, chainID func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) FindTxesWithAttemptsAndReceiptsByIdsAndState(ctx context.Context, ids []int64, states []txmgrtypes.TxState, chainID *big.Int) ([]*txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], error) { ret := _m.Called(ctx, ids, states, chainID) @@ -580,6 +1186,37 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) FindTxesWit return r0, r1 } +// TxStore_FindTxesWithAttemptsAndReceiptsByIdsAndState_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindTxesWithAttemptsAndReceiptsByIdsAndState' +type TxStore_FindTxesWithAttemptsAndReceiptsByIdsAndState_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE feetypes.Fee] struct { + *mock.Call +} + +// FindTxesWithAttemptsAndReceiptsByIdsAndState is a helper method to define mock.On call +// - ctx context.Context +// - ids []int64 +// - states []txmgrtypes.TxState +// - chainID *big.Int +func (_e *TxStore_Expecter[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) FindTxesWithAttemptsAndReceiptsByIdsAndState(ctx interface{}, ids interface{}, states interface{}, chainID interface{}) *TxStore_FindTxesWithAttemptsAndReceiptsByIdsAndState_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + return &TxStore_FindTxesWithAttemptsAndReceiptsByIdsAndState_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]{Call: _e.mock.On("FindTxesWithAttemptsAndReceiptsByIdsAndState", ctx, ids, states, chainID)} +} + +func (_c *TxStore_FindTxesWithAttemptsAndReceiptsByIdsAndState_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Run(run func(ctx context.Context, ids []int64, states []txmgrtypes.TxState, chainID *big.Int)) *TxStore_FindTxesWithAttemptsAndReceiptsByIdsAndState_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].([]int64), args[2].([]txmgrtypes.TxState), args[3].(*big.Int)) + }) + return _c +} + +func (_c *TxStore_FindTxesWithAttemptsAndReceiptsByIdsAndState_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Return(tx []*txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], err error) *TxStore_FindTxesWithAttemptsAndReceiptsByIdsAndState_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Return(tx, err) + return _c +} + +func (_c *TxStore_FindTxesWithAttemptsAndReceiptsByIdsAndState_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) RunAndReturn(run func(context.Context, []int64, []txmgrtypes.TxState, *big.Int) ([]*txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], error)) *TxStore_FindTxesWithAttemptsAndReceiptsByIdsAndState_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Return(run) + return _c +} + // FindTxesWithMetaFieldByReceiptBlockNum provides a mock function with given fields: ctx, metaField, blockNum, chainID func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) FindTxesWithMetaFieldByReceiptBlockNum(ctx context.Context, metaField string, blockNum int64, chainID *big.Int) ([]*txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], error) { ret := _m.Called(ctx, metaField, blockNum, chainID) @@ -610,6 +1247,37 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) FindTxesWit return r0, r1 } +// TxStore_FindTxesWithMetaFieldByReceiptBlockNum_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindTxesWithMetaFieldByReceiptBlockNum' +type TxStore_FindTxesWithMetaFieldByReceiptBlockNum_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE feetypes.Fee] struct { + *mock.Call +} + +// FindTxesWithMetaFieldByReceiptBlockNum is a helper method to define mock.On call +// - ctx context.Context +// - metaField string +// - blockNum int64 +// - chainID *big.Int +func (_e *TxStore_Expecter[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) FindTxesWithMetaFieldByReceiptBlockNum(ctx interface{}, metaField interface{}, blockNum interface{}, chainID interface{}) *TxStore_FindTxesWithMetaFieldByReceiptBlockNum_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + return &TxStore_FindTxesWithMetaFieldByReceiptBlockNum_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]{Call: _e.mock.On("FindTxesWithMetaFieldByReceiptBlockNum", ctx, metaField, blockNum, chainID)} +} + +func (_c *TxStore_FindTxesWithMetaFieldByReceiptBlockNum_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Run(run func(ctx context.Context, metaField string, blockNum int64, chainID *big.Int)) *TxStore_FindTxesWithMetaFieldByReceiptBlockNum_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(int64), args[3].(*big.Int)) + }) + return _c +} + +func (_c *TxStore_FindTxesWithMetaFieldByReceiptBlockNum_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Return(tx []*txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], err error) *TxStore_FindTxesWithMetaFieldByReceiptBlockNum_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Return(tx, err) + return _c +} + +func (_c *TxStore_FindTxesWithMetaFieldByReceiptBlockNum_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) RunAndReturn(run func(context.Context, string, int64, *big.Int) ([]*txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], error)) *TxStore_FindTxesWithMetaFieldByReceiptBlockNum_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Return(run) + return _c +} + // FindTxesWithMetaFieldByStates provides a mock function with given fields: ctx, metaField, states, chainID func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) FindTxesWithMetaFieldByStates(ctx context.Context, metaField string, states []txmgrtypes.TxState, chainID *big.Int) ([]*txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], error) { ret := _m.Called(ctx, metaField, states, chainID) @@ -640,6 +1308,37 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) FindTxesWit return r0, r1 } +// TxStore_FindTxesWithMetaFieldByStates_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindTxesWithMetaFieldByStates' +type TxStore_FindTxesWithMetaFieldByStates_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE feetypes.Fee] struct { + *mock.Call +} + +// FindTxesWithMetaFieldByStates is a helper method to define mock.On call +// - ctx context.Context +// - metaField string +// - states []txmgrtypes.TxState +// - chainID *big.Int +func (_e *TxStore_Expecter[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) FindTxesWithMetaFieldByStates(ctx interface{}, metaField interface{}, states interface{}, chainID interface{}) *TxStore_FindTxesWithMetaFieldByStates_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + return &TxStore_FindTxesWithMetaFieldByStates_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]{Call: _e.mock.On("FindTxesWithMetaFieldByStates", ctx, metaField, states, chainID)} +} + +func (_c *TxStore_FindTxesWithMetaFieldByStates_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Run(run func(ctx context.Context, metaField string, states []txmgrtypes.TxState, chainID *big.Int)) *TxStore_FindTxesWithMetaFieldByStates_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].([]txmgrtypes.TxState), args[3].(*big.Int)) + }) + return _c +} + +func (_c *TxStore_FindTxesWithMetaFieldByStates_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Return(tx []*txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], err error) *TxStore_FindTxesWithMetaFieldByStates_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Return(tx, err) + return _c +} + +func (_c *TxStore_FindTxesWithMetaFieldByStates_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) RunAndReturn(run func(context.Context, string, []txmgrtypes.TxState, *big.Int) ([]*txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], error)) *TxStore_FindTxesWithMetaFieldByStates_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Return(run) + return _c +} + // FindTxsRequiringGasBump provides a mock function with given fields: ctx, address, blockNum, gasBumpThreshold, depth, chainID func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) FindTxsRequiringGasBump(ctx context.Context, address ADDR, blockNum int64, gasBumpThreshold int64, depth int64, chainID CHAIN_ID) ([]*txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], error) { ret := _m.Called(ctx, address, blockNum, gasBumpThreshold, depth, chainID) @@ -670,6 +1369,39 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) FindTxsRequ return r0, r1 } +// TxStore_FindTxsRequiringGasBump_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindTxsRequiringGasBump' +type TxStore_FindTxsRequiringGasBump_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE feetypes.Fee] struct { + *mock.Call +} + +// FindTxsRequiringGasBump is a helper method to define mock.On call +// - ctx context.Context +// - address ADDR +// - blockNum int64 +// - gasBumpThreshold int64 +// - depth int64 +// - chainID CHAIN_ID +func (_e *TxStore_Expecter[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) FindTxsRequiringGasBump(ctx interface{}, address interface{}, blockNum interface{}, gasBumpThreshold interface{}, depth interface{}, chainID interface{}) *TxStore_FindTxsRequiringGasBump_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + return &TxStore_FindTxsRequiringGasBump_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]{Call: _e.mock.On("FindTxsRequiringGasBump", ctx, address, blockNum, gasBumpThreshold, depth, chainID)} +} + +func (_c *TxStore_FindTxsRequiringGasBump_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Run(run func(ctx context.Context, address ADDR, blockNum int64, gasBumpThreshold int64, depth int64, chainID CHAIN_ID)) *TxStore_FindTxsRequiringGasBump_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(ADDR), args[2].(int64), args[3].(int64), args[4].(int64), args[5].(CHAIN_ID)) + }) + return _c +} + +func (_c *TxStore_FindTxsRequiringGasBump_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Return(etxs []*txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], err error) *TxStore_FindTxsRequiringGasBump_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Return(etxs, err) + return _c +} + +func (_c *TxStore_FindTxsRequiringGasBump_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) RunAndReturn(run func(context.Context, ADDR, int64, int64, int64, CHAIN_ID) ([]*txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], error)) *TxStore_FindTxsRequiringGasBump_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Return(run) + return _c +} + // FindTxsRequiringResubmissionDueToInsufficientFunds provides a mock function with given fields: ctx, address, chainID func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) FindTxsRequiringResubmissionDueToInsufficientFunds(ctx context.Context, address ADDR, chainID CHAIN_ID) ([]*txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], error) { ret := _m.Called(ctx, address, chainID) @@ -700,6 +1432,36 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) FindTxsRequ return r0, r1 } +// TxStore_FindTxsRequiringResubmissionDueToInsufficientFunds_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindTxsRequiringResubmissionDueToInsufficientFunds' +type TxStore_FindTxsRequiringResubmissionDueToInsufficientFunds_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE feetypes.Fee] struct { + *mock.Call +} + +// FindTxsRequiringResubmissionDueToInsufficientFunds is a helper method to define mock.On call +// - ctx context.Context +// - address ADDR +// - chainID CHAIN_ID +func (_e *TxStore_Expecter[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) FindTxsRequiringResubmissionDueToInsufficientFunds(ctx interface{}, address interface{}, chainID interface{}) *TxStore_FindTxsRequiringResubmissionDueToInsufficientFunds_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + return &TxStore_FindTxsRequiringResubmissionDueToInsufficientFunds_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]{Call: _e.mock.On("FindTxsRequiringResubmissionDueToInsufficientFunds", ctx, address, chainID)} +} + +func (_c *TxStore_FindTxsRequiringResubmissionDueToInsufficientFunds_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Run(run func(ctx context.Context, address ADDR, chainID CHAIN_ID)) *TxStore_FindTxsRequiringResubmissionDueToInsufficientFunds_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(ADDR), args[2].(CHAIN_ID)) + }) + return _c +} + +func (_c *TxStore_FindTxsRequiringResubmissionDueToInsufficientFunds_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Return(etxs []*txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], err error) *TxStore_FindTxsRequiringResubmissionDueToInsufficientFunds_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Return(etxs, err) + return _c +} + +func (_c *TxStore_FindTxsRequiringResubmissionDueToInsufficientFunds_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) RunAndReturn(run func(context.Context, ADDR, CHAIN_ID) ([]*txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], error)) *TxStore_FindTxsRequiringResubmissionDueToInsufficientFunds_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Return(run) + return _c +} + // GetAbandonedTransactionsByBatch provides a mock function with given fields: ctx, chainID, enabledAddrs, offset, limit func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) GetAbandonedTransactionsByBatch(ctx context.Context, chainID CHAIN_ID, enabledAddrs []ADDR, offset uint, limit uint) ([]*txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], error) { ret := _m.Called(ctx, chainID, enabledAddrs, offset, limit) @@ -730,6 +1492,38 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) GetAbandone return r0, r1 } +// TxStore_GetAbandonedTransactionsByBatch_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAbandonedTransactionsByBatch' +type TxStore_GetAbandonedTransactionsByBatch_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE feetypes.Fee] struct { + *mock.Call +} + +// GetAbandonedTransactionsByBatch is a helper method to define mock.On call +// - ctx context.Context +// - chainID CHAIN_ID +// - enabledAddrs []ADDR +// - offset uint +// - limit uint +func (_e *TxStore_Expecter[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) GetAbandonedTransactionsByBatch(ctx interface{}, chainID interface{}, enabledAddrs interface{}, offset interface{}, limit interface{}) *TxStore_GetAbandonedTransactionsByBatch_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + return &TxStore_GetAbandonedTransactionsByBatch_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]{Call: _e.mock.On("GetAbandonedTransactionsByBatch", ctx, chainID, enabledAddrs, offset, limit)} +} + +func (_c *TxStore_GetAbandonedTransactionsByBatch_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Run(run func(ctx context.Context, chainID CHAIN_ID, enabledAddrs []ADDR, offset uint, limit uint)) *TxStore_GetAbandonedTransactionsByBatch_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(CHAIN_ID), args[2].([]ADDR), args[3].(uint), args[4].(uint)) + }) + return _c +} + +func (_c *TxStore_GetAbandonedTransactionsByBatch_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Return(txs []*txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], err error) *TxStore_GetAbandonedTransactionsByBatch_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Return(txs, err) + return _c +} + +func (_c *TxStore_GetAbandonedTransactionsByBatch_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) RunAndReturn(run func(context.Context, CHAIN_ID, []ADDR, uint, uint) ([]*txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], error)) *TxStore_GetAbandonedTransactionsByBatch_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Return(run) + return _c +} + // GetInProgressTxAttempts provides a mock function with given fields: ctx, address, chainID func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) GetInProgressTxAttempts(ctx context.Context, address ADDR, chainID CHAIN_ID) ([]txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], error) { ret := _m.Called(ctx, address, chainID) @@ -760,6 +1554,36 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) GetInProgre return r0, r1 } +// TxStore_GetInProgressTxAttempts_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetInProgressTxAttempts' +type TxStore_GetInProgressTxAttempts_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE feetypes.Fee] struct { + *mock.Call +} + +// GetInProgressTxAttempts is a helper method to define mock.On call +// - ctx context.Context +// - address ADDR +// - chainID CHAIN_ID +func (_e *TxStore_Expecter[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) GetInProgressTxAttempts(ctx interface{}, address interface{}, chainID interface{}) *TxStore_GetInProgressTxAttempts_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + return &TxStore_GetInProgressTxAttempts_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]{Call: _e.mock.On("GetInProgressTxAttempts", ctx, address, chainID)} +} + +func (_c *TxStore_GetInProgressTxAttempts_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Run(run func(ctx context.Context, address ADDR, chainID CHAIN_ID)) *TxStore_GetInProgressTxAttempts_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(ADDR), args[2].(CHAIN_ID)) + }) + return _c +} + +func (_c *TxStore_GetInProgressTxAttempts_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Return(attempts []txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], err error) *TxStore_GetInProgressTxAttempts_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Return(attempts, err) + return _c +} + +func (_c *TxStore_GetInProgressTxAttempts_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) RunAndReturn(run func(context.Context, ADDR, CHAIN_ID) ([]txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], error)) *TxStore_GetInProgressTxAttempts_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Return(run) + return _c +} + // GetTxByID provides a mock function with given fields: ctx, id func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) GetTxByID(ctx context.Context, id int64) (*txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], error) { ret := _m.Called(ctx, id) @@ -790,6 +1614,35 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) GetTxByID(c return r0, r1 } +// TxStore_GetTxByID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetTxByID' +type TxStore_GetTxByID_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE feetypes.Fee] struct { + *mock.Call +} + +// GetTxByID is a helper method to define mock.On call +// - ctx context.Context +// - id int64 +func (_e *TxStore_Expecter[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) GetTxByID(ctx interface{}, id interface{}) *TxStore_GetTxByID_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + return &TxStore_GetTxByID_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]{Call: _e.mock.On("GetTxByID", ctx, id)} +} + +func (_c *TxStore_GetTxByID_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Run(run func(ctx context.Context, id int64)) *TxStore_GetTxByID_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(int64)) + }) + return _c +} + +func (_c *TxStore_GetTxByID_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Return(tx *txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], err error) *TxStore_GetTxByID_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Return(tx, err) + return _c +} + +func (_c *TxStore_GetTxByID_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) RunAndReturn(run func(context.Context, int64) (*txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], error)) *TxStore_GetTxByID_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Return(run) + return _c +} + // GetTxInProgress provides a mock function with given fields: ctx, fromAddress func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) GetTxInProgress(ctx context.Context, fromAddress ADDR) (*txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], error) { ret := _m.Called(ctx, fromAddress) @@ -820,6 +1673,35 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) GetTxInProg return r0, r1 } +// TxStore_GetTxInProgress_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetTxInProgress' +type TxStore_GetTxInProgress_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE feetypes.Fee] struct { + *mock.Call +} + +// GetTxInProgress is a helper method to define mock.On call +// - ctx context.Context +// - fromAddress ADDR +func (_e *TxStore_Expecter[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) GetTxInProgress(ctx interface{}, fromAddress interface{}) *TxStore_GetTxInProgress_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + return &TxStore_GetTxInProgress_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]{Call: _e.mock.On("GetTxInProgress", ctx, fromAddress)} +} + +func (_c *TxStore_GetTxInProgress_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Run(run func(ctx context.Context, fromAddress ADDR)) *TxStore_GetTxInProgress_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(ADDR)) + }) + return _c +} + +func (_c *TxStore_GetTxInProgress_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Return(etx *txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], err error) *TxStore_GetTxInProgress_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Return(etx, err) + return _c +} + +func (_c *TxStore_GetTxInProgress_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) RunAndReturn(run func(context.Context, ADDR) (*txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], error)) *TxStore_GetTxInProgress_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Return(run) + return _c +} + // HasInProgressTransaction provides a mock function with given fields: ctx, account, chainID func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) HasInProgressTransaction(ctx context.Context, account ADDR, chainID CHAIN_ID) (bool, error) { ret := _m.Called(ctx, account, chainID) @@ -848,32 +1730,34 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) HasInProgre return r0, r1 } -// IsTxFinalized provides a mock function with given fields: ctx, blockHeight, txID, chainID -func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) IsTxFinalized(ctx context.Context, blockHeight int64, txID int64, chainID CHAIN_ID) (bool, error) { - ret := _m.Called(ctx, blockHeight, txID, chainID) +// TxStore_HasInProgressTransaction_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HasInProgressTransaction' +type TxStore_HasInProgressTransaction_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE feetypes.Fee] struct { + *mock.Call +} - if len(ret) == 0 { - panic("no return value specified for IsTxFinalized") - } +// HasInProgressTransaction is a helper method to define mock.On call +// - ctx context.Context +// - account ADDR +// - chainID CHAIN_ID +func (_e *TxStore_Expecter[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) HasInProgressTransaction(ctx interface{}, account interface{}, chainID interface{}) *TxStore_HasInProgressTransaction_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + return &TxStore_HasInProgressTransaction_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]{Call: _e.mock.On("HasInProgressTransaction", ctx, account, chainID)} +} - var r0 bool - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, int64, int64, CHAIN_ID) (bool, error)); ok { - return rf(ctx, blockHeight, txID, chainID) - } - if rf, ok := ret.Get(0).(func(context.Context, int64, int64, CHAIN_ID) bool); ok { - r0 = rf(ctx, blockHeight, txID, chainID) - } else { - r0 = ret.Get(0).(bool) - } +func (_c *TxStore_HasInProgressTransaction_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Run(run func(ctx context.Context, account ADDR, chainID CHAIN_ID)) *TxStore_HasInProgressTransaction_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(ADDR), args[2].(CHAIN_ID)) + }) + return _c +} - if rf, ok := ret.Get(1).(func(context.Context, int64, int64, CHAIN_ID) error); ok { - r1 = rf(ctx, blockHeight, txID, chainID) - } else { - r1 = ret.Error(1) - } +func (_c *TxStore_HasInProgressTransaction_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Return(exists bool, err error) *TxStore_HasInProgressTransaction_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Return(exists, err) + return _c +} - return r0, r1 +func (_c *TxStore_HasInProgressTransaction_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) RunAndReturn(run func(context.Context, ADDR, CHAIN_ID) (bool, error)) *TxStore_HasInProgressTransaction_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Return(run) + return _c } // LoadTxAttempts provides a mock function with given fields: ctx, etx @@ -894,6 +1778,35 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) LoadTxAttem return r0 } +// TxStore_LoadTxAttempts_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LoadTxAttempts' +type TxStore_LoadTxAttempts_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE feetypes.Fee] struct { + *mock.Call +} + +// LoadTxAttempts is a helper method to define mock.On call +// - ctx context.Context +// - etx *txmgrtypes.Tx[CHAIN_ID,ADDR,TX_HASH,BLOCK_HASH,SEQ,FEE] +func (_e *TxStore_Expecter[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) LoadTxAttempts(ctx interface{}, etx interface{}) *TxStore_LoadTxAttempts_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + return &TxStore_LoadTxAttempts_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]{Call: _e.mock.On("LoadTxAttempts", ctx, etx)} +} + +func (_c *TxStore_LoadTxAttempts_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Run(run func(ctx context.Context, etx *txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE])) *TxStore_LoadTxAttempts_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE])) + }) + return _c +} + +func (_c *TxStore_LoadTxAttempts_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Return(_a0 error) *TxStore_LoadTxAttempts_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Return(_a0) + return _c +} + +func (_c *TxStore_LoadTxAttempts_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) RunAndReturn(run func(context.Context, *txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) error) *TxStore_LoadTxAttempts_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Return(run) + return _c +} + // MarkAllConfirmedMissingReceipt provides a mock function with given fields: ctx, chainID func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) MarkAllConfirmedMissingReceipt(ctx context.Context, chainID CHAIN_ID) error { ret := _m.Called(ctx, chainID) @@ -912,17 +1825,46 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) MarkAllConf return r0 } -// MarkOldTxesMissingReceiptAsErrored provides a mock function with given fields: ctx, blockNum, finalityDepth, chainID -func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) MarkOldTxesMissingReceiptAsErrored(ctx context.Context, blockNum int64, finalityDepth uint32, chainID CHAIN_ID) error { - ret := _m.Called(ctx, blockNum, finalityDepth, chainID) +// TxStore_MarkAllConfirmedMissingReceipt_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MarkAllConfirmedMissingReceipt' +type TxStore_MarkAllConfirmedMissingReceipt_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE feetypes.Fee] struct { + *mock.Call +} + +// MarkAllConfirmedMissingReceipt is a helper method to define mock.On call +// - ctx context.Context +// - chainID CHAIN_ID +func (_e *TxStore_Expecter[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) MarkAllConfirmedMissingReceipt(ctx interface{}, chainID interface{}) *TxStore_MarkAllConfirmedMissingReceipt_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + return &TxStore_MarkAllConfirmedMissingReceipt_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]{Call: _e.mock.On("MarkAllConfirmedMissingReceipt", ctx, chainID)} +} + +func (_c *TxStore_MarkAllConfirmedMissingReceipt_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Run(run func(ctx context.Context, chainID CHAIN_ID)) *TxStore_MarkAllConfirmedMissingReceipt_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(CHAIN_ID)) + }) + return _c +} + +func (_c *TxStore_MarkAllConfirmedMissingReceipt_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Return(err error) *TxStore_MarkAllConfirmedMissingReceipt_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Return(err) + return _c +} + +func (_c *TxStore_MarkAllConfirmedMissingReceipt_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) RunAndReturn(run func(context.Context, CHAIN_ID) error) *TxStore_MarkAllConfirmedMissingReceipt_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Return(run) + return _c +} + +// MarkOldTxesMissingReceiptAsErrored provides a mock function with given fields: ctx, blockNum, latestFinalizedBlockNum, chainID +func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) MarkOldTxesMissingReceiptAsErrored(ctx context.Context, blockNum int64, latestFinalizedBlockNum int64, chainID CHAIN_ID) error { + ret := _m.Called(ctx, blockNum, latestFinalizedBlockNum, chainID) if len(ret) == 0 { panic("no return value specified for MarkOldTxesMissingReceiptAsErrored") } var r0 error - if rf, ok := ret.Get(0).(func(context.Context, int64, uint32, CHAIN_ID) error); ok { - r0 = rf(ctx, blockNum, finalityDepth, chainID) + if rf, ok := ret.Get(0).(func(context.Context, int64, int64, CHAIN_ID) error); ok { + r0 = rf(ctx, blockNum, latestFinalizedBlockNum, chainID) } else { r0 = ret.Error(0) } @@ -930,6 +1872,37 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) MarkOldTxes return r0 } +// TxStore_MarkOldTxesMissingReceiptAsErrored_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MarkOldTxesMissingReceiptAsErrored' +type TxStore_MarkOldTxesMissingReceiptAsErrored_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE feetypes.Fee] struct { + *mock.Call +} + +// MarkOldTxesMissingReceiptAsErrored is a helper method to define mock.On call +// - ctx context.Context +// - blockNum int64 +// - latestFinalizedBlockNum int64 +// - chainID CHAIN_ID +func (_e *TxStore_Expecter[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) MarkOldTxesMissingReceiptAsErrored(ctx interface{}, blockNum interface{}, latestFinalizedBlockNum interface{}, chainID interface{}) *TxStore_MarkOldTxesMissingReceiptAsErrored_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + return &TxStore_MarkOldTxesMissingReceiptAsErrored_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]{Call: _e.mock.On("MarkOldTxesMissingReceiptAsErrored", ctx, blockNum, latestFinalizedBlockNum, chainID)} +} + +func (_c *TxStore_MarkOldTxesMissingReceiptAsErrored_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Run(run func(ctx context.Context, blockNum int64, latestFinalizedBlockNum int64, chainID CHAIN_ID)) *TxStore_MarkOldTxesMissingReceiptAsErrored_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(int64), args[2].(int64), args[3].(CHAIN_ID)) + }) + return _c +} + +func (_c *TxStore_MarkOldTxesMissingReceiptAsErrored_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Return(_a0 error) *TxStore_MarkOldTxesMissingReceiptAsErrored_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Return(_a0) + return _c +} + +func (_c *TxStore_MarkOldTxesMissingReceiptAsErrored_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) RunAndReturn(run func(context.Context, int64, int64, CHAIN_ID) error) *TxStore_MarkOldTxesMissingReceiptAsErrored_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Return(run) + return _c +} + // PreloadTxes provides a mock function with given fields: ctx, attempts func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) PreloadTxes(ctx context.Context, attempts []txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) error { ret := _m.Called(ctx, attempts) @@ -948,6 +1921,35 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) PreloadTxes return r0 } +// TxStore_PreloadTxes_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PreloadTxes' +type TxStore_PreloadTxes_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE feetypes.Fee] struct { + *mock.Call +} + +// PreloadTxes is a helper method to define mock.On call +// - ctx context.Context +// - attempts []txmgrtypes.TxAttempt[CHAIN_ID,ADDR,TX_HASH,BLOCK_HASH,SEQ,FEE] +func (_e *TxStore_Expecter[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) PreloadTxes(ctx interface{}, attempts interface{}) *TxStore_PreloadTxes_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + return &TxStore_PreloadTxes_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]{Call: _e.mock.On("PreloadTxes", ctx, attempts)} +} + +func (_c *TxStore_PreloadTxes_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Run(run func(ctx context.Context, attempts []txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE])) *TxStore_PreloadTxes_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].([]txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE])) + }) + return _c +} + +func (_c *TxStore_PreloadTxes_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Return(_a0 error) *TxStore_PreloadTxes_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Return(_a0) + return _c +} + +func (_c *TxStore_PreloadTxes_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) RunAndReturn(run func(context.Context, []txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) error) *TxStore_PreloadTxes_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Return(run) + return _c +} + // PruneUnstartedTxQueue provides a mock function with given fields: ctx, queueSize, subject func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) PruneUnstartedTxQueue(ctx context.Context, queueSize uint32, subject uuid.UUID) ([]int64, error) { ret := _m.Called(ctx, queueSize, subject) @@ -978,17 +1980,47 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) PruneUnstar return r0, r1 } -// ReapTxHistory provides a mock function with given fields: ctx, minBlockNumberToKeep, timeThreshold, chainID -func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) ReapTxHistory(ctx context.Context, minBlockNumberToKeep int64, timeThreshold time.Time, chainID CHAIN_ID) error { - ret := _m.Called(ctx, minBlockNumberToKeep, timeThreshold, chainID) +// TxStore_PruneUnstartedTxQueue_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PruneUnstartedTxQueue' +type TxStore_PruneUnstartedTxQueue_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE feetypes.Fee] struct { + *mock.Call +} + +// PruneUnstartedTxQueue is a helper method to define mock.On call +// - ctx context.Context +// - queueSize uint32 +// - subject uuid.UUID +func (_e *TxStore_Expecter[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) PruneUnstartedTxQueue(ctx interface{}, queueSize interface{}, subject interface{}) *TxStore_PruneUnstartedTxQueue_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + return &TxStore_PruneUnstartedTxQueue_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]{Call: _e.mock.On("PruneUnstartedTxQueue", ctx, queueSize, subject)} +} + +func (_c *TxStore_PruneUnstartedTxQueue_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Run(run func(ctx context.Context, queueSize uint32, subject uuid.UUID)) *TxStore_PruneUnstartedTxQueue_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(uint32), args[2].(uuid.UUID)) + }) + return _c +} + +func (_c *TxStore_PruneUnstartedTxQueue_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Return(ids []int64, err error) *TxStore_PruneUnstartedTxQueue_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Return(ids, err) + return _c +} + +func (_c *TxStore_PruneUnstartedTxQueue_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) RunAndReturn(run func(context.Context, uint32, uuid.UUID) ([]int64, error)) *TxStore_PruneUnstartedTxQueue_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Return(run) + return _c +} + +// ReapTxHistory provides a mock function with given fields: ctx, timeThreshold, chainID +func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) ReapTxHistory(ctx context.Context, timeThreshold time.Time, chainID CHAIN_ID) error { + ret := _m.Called(ctx, timeThreshold, chainID) if len(ret) == 0 { panic("no return value specified for ReapTxHistory") } var r0 error - if rf, ok := ret.Get(0).(func(context.Context, int64, time.Time, CHAIN_ID) error); ok { - r0 = rf(ctx, minBlockNumberToKeep, timeThreshold, chainID) + if rf, ok := ret.Get(0).(func(context.Context, time.Time, CHAIN_ID) error); ok { + r0 = rf(ctx, timeThreshold, chainID) } else { r0 = ret.Error(0) } @@ -996,6 +2028,36 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) ReapTxHisto return r0 } +// TxStore_ReapTxHistory_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ReapTxHistory' +type TxStore_ReapTxHistory_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE feetypes.Fee] struct { + *mock.Call +} + +// ReapTxHistory is a helper method to define mock.On call +// - ctx context.Context +// - timeThreshold time.Time +// - chainID CHAIN_ID +func (_e *TxStore_Expecter[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) ReapTxHistory(ctx interface{}, timeThreshold interface{}, chainID interface{}) *TxStore_ReapTxHistory_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + return &TxStore_ReapTxHistory_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]{Call: _e.mock.On("ReapTxHistory", ctx, timeThreshold, chainID)} +} + +func (_c *TxStore_ReapTxHistory_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Run(run func(ctx context.Context, timeThreshold time.Time, chainID CHAIN_ID)) *TxStore_ReapTxHistory_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(time.Time), args[2].(CHAIN_ID)) + }) + return _c +} + +func (_c *TxStore_ReapTxHistory_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Return(_a0 error) *TxStore_ReapTxHistory_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Return(_a0) + return _c +} + +func (_c *TxStore_ReapTxHistory_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) RunAndReturn(run func(context.Context, time.Time, CHAIN_ID) error) *TxStore_ReapTxHistory_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Return(run) + return _c +} + // SaveConfirmedMissingReceiptAttempt provides a mock function with given fields: ctx, timeout, attempt, broadcastAt func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) SaveConfirmedMissingReceiptAttempt(ctx context.Context, timeout time.Duration, attempt *txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], broadcastAt time.Time) error { ret := _m.Called(ctx, timeout, attempt, broadcastAt) @@ -1014,6 +2076,37 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) SaveConfirm return r0 } +// TxStore_SaveConfirmedMissingReceiptAttempt_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SaveConfirmedMissingReceiptAttempt' +type TxStore_SaveConfirmedMissingReceiptAttempt_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE feetypes.Fee] struct { + *mock.Call +} + +// SaveConfirmedMissingReceiptAttempt is a helper method to define mock.On call +// - ctx context.Context +// - timeout time.Duration +// - attempt *txmgrtypes.TxAttempt[CHAIN_ID,ADDR,TX_HASH,BLOCK_HASH,SEQ,FEE] +// - broadcastAt time.Time +func (_e *TxStore_Expecter[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) SaveConfirmedMissingReceiptAttempt(ctx interface{}, timeout interface{}, attempt interface{}, broadcastAt interface{}) *TxStore_SaveConfirmedMissingReceiptAttempt_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + return &TxStore_SaveConfirmedMissingReceiptAttempt_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]{Call: _e.mock.On("SaveConfirmedMissingReceiptAttempt", ctx, timeout, attempt, broadcastAt)} +} + +func (_c *TxStore_SaveConfirmedMissingReceiptAttempt_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Run(run func(ctx context.Context, timeout time.Duration, attempt *txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], broadcastAt time.Time)) *TxStore_SaveConfirmedMissingReceiptAttempt_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(time.Duration), args[2].(*txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]), args[3].(time.Time)) + }) + return _c +} + +func (_c *TxStore_SaveConfirmedMissingReceiptAttempt_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Return(_a0 error) *TxStore_SaveConfirmedMissingReceiptAttempt_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Return(_a0) + return _c +} + +func (_c *TxStore_SaveConfirmedMissingReceiptAttempt_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) RunAndReturn(run func(context.Context, time.Duration, *txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], time.Time) error) *TxStore_SaveConfirmedMissingReceiptAttempt_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Return(run) + return _c +} + // SaveFetchedReceipts provides a mock function with given fields: ctx, r, state, errorMsg, chainID func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) SaveFetchedReceipts(ctx context.Context, r []R, state txmgrtypes.TxState, errorMsg *string, chainID CHAIN_ID) error { ret := _m.Called(ctx, r, state, errorMsg, chainID) @@ -1032,6 +2125,38 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) SaveFetched return r0 } +// TxStore_SaveFetchedReceipts_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SaveFetchedReceipts' +type TxStore_SaveFetchedReceipts_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE feetypes.Fee] struct { + *mock.Call +} + +// SaveFetchedReceipts is a helper method to define mock.On call +// - ctx context.Context +// - r []R +// - state txmgrtypes.TxState +// - errorMsg *string +// - chainID CHAIN_ID +func (_e *TxStore_Expecter[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) SaveFetchedReceipts(ctx interface{}, r interface{}, state interface{}, errorMsg interface{}, chainID interface{}) *TxStore_SaveFetchedReceipts_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + return &TxStore_SaveFetchedReceipts_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]{Call: _e.mock.On("SaveFetchedReceipts", ctx, r, state, errorMsg, chainID)} +} + +func (_c *TxStore_SaveFetchedReceipts_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Run(run func(ctx context.Context, r []R, state txmgrtypes.TxState, errorMsg *string, chainID CHAIN_ID)) *TxStore_SaveFetchedReceipts_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].([]R), args[2].(txmgrtypes.TxState), args[3].(*string), args[4].(CHAIN_ID)) + }) + return _c +} + +func (_c *TxStore_SaveFetchedReceipts_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Return(_a0 error) *TxStore_SaveFetchedReceipts_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Return(_a0) + return _c +} + +func (_c *TxStore_SaveFetchedReceipts_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) RunAndReturn(run func(context.Context, []R, txmgrtypes.TxState, *string, CHAIN_ID) error) *TxStore_SaveFetchedReceipts_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Return(run) + return _c +} + // SaveInProgressAttempt provides a mock function with given fields: ctx, attempt func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) SaveInProgressAttempt(ctx context.Context, attempt *txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) error { ret := _m.Called(ctx, attempt) @@ -1050,6 +2175,35 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) SaveInProgr return r0 } +// TxStore_SaveInProgressAttempt_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SaveInProgressAttempt' +type TxStore_SaveInProgressAttempt_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE feetypes.Fee] struct { + *mock.Call +} + +// SaveInProgressAttempt is a helper method to define mock.On call +// - ctx context.Context +// - attempt *txmgrtypes.TxAttempt[CHAIN_ID,ADDR,TX_HASH,BLOCK_HASH,SEQ,FEE] +func (_e *TxStore_Expecter[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) SaveInProgressAttempt(ctx interface{}, attempt interface{}) *TxStore_SaveInProgressAttempt_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + return &TxStore_SaveInProgressAttempt_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]{Call: _e.mock.On("SaveInProgressAttempt", ctx, attempt)} +} + +func (_c *TxStore_SaveInProgressAttempt_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Run(run func(ctx context.Context, attempt *txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE])) *TxStore_SaveInProgressAttempt_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE])) + }) + return _c +} + +func (_c *TxStore_SaveInProgressAttempt_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Return(_a0 error) *TxStore_SaveInProgressAttempt_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Return(_a0) + return _c +} + +func (_c *TxStore_SaveInProgressAttempt_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) RunAndReturn(run func(context.Context, *txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) error) *TxStore_SaveInProgressAttempt_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Return(run) + return _c +} + // SaveInsufficientFundsAttempt provides a mock function with given fields: ctx, timeout, attempt, broadcastAt func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) SaveInsufficientFundsAttempt(ctx context.Context, timeout time.Duration, attempt *txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], broadcastAt time.Time) error { ret := _m.Called(ctx, timeout, attempt, broadcastAt) @@ -1068,6 +2222,37 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) SaveInsuffi return r0 } +// TxStore_SaveInsufficientFundsAttempt_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SaveInsufficientFundsAttempt' +type TxStore_SaveInsufficientFundsAttempt_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE feetypes.Fee] struct { + *mock.Call +} + +// SaveInsufficientFundsAttempt is a helper method to define mock.On call +// - ctx context.Context +// - timeout time.Duration +// - attempt *txmgrtypes.TxAttempt[CHAIN_ID,ADDR,TX_HASH,BLOCK_HASH,SEQ,FEE] +// - broadcastAt time.Time +func (_e *TxStore_Expecter[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) SaveInsufficientFundsAttempt(ctx interface{}, timeout interface{}, attempt interface{}, broadcastAt interface{}) *TxStore_SaveInsufficientFundsAttempt_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + return &TxStore_SaveInsufficientFundsAttempt_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]{Call: _e.mock.On("SaveInsufficientFundsAttempt", ctx, timeout, attempt, broadcastAt)} +} + +func (_c *TxStore_SaveInsufficientFundsAttempt_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Run(run func(ctx context.Context, timeout time.Duration, attempt *txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], broadcastAt time.Time)) *TxStore_SaveInsufficientFundsAttempt_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(time.Duration), args[2].(*txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]), args[3].(time.Time)) + }) + return _c +} + +func (_c *TxStore_SaveInsufficientFundsAttempt_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Return(_a0 error) *TxStore_SaveInsufficientFundsAttempt_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Return(_a0) + return _c +} + +func (_c *TxStore_SaveInsufficientFundsAttempt_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) RunAndReturn(run func(context.Context, time.Duration, *txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], time.Time) error) *TxStore_SaveInsufficientFundsAttempt_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Return(run) + return _c +} + // SaveReplacementInProgressAttempt provides a mock function with given fields: ctx, oldAttempt, replacementAttempt func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) SaveReplacementInProgressAttempt(ctx context.Context, oldAttempt txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], replacementAttempt *txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) error { ret := _m.Called(ctx, oldAttempt, replacementAttempt) @@ -1086,6 +2271,36 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) SaveReplace return r0 } +// TxStore_SaveReplacementInProgressAttempt_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SaveReplacementInProgressAttempt' +type TxStore_SaveReplacementInProgressAttempt_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE feetypes.Fee] struct { + *mock.Call +} + +// SaveReplacementInProgressAttempt is a helper method to define mock.On call +// - ctx context.Context +// - oldAttempt txmgrtypes.TxAttempt[CHAIN_ID,ADDR,TX_HASH,BLOCK_HASH,SEQ,FEE] +// - replacementAttempt *txmgrtypes.TxAttempt[CHAIN_ID,ADDR,TX_HASH,BLOCK_HASH,SEQ,FEE] +func (_e *TxStore_Expecter[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) SaveReplacementInProgressAttempt(ctx interface{}, oldAttempt interface{}, replacementAttempt interface{}) *TxStore_SaveReplacementInProgressAttempt_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + return &TxStore_SaveReplacementInProgressAttempt_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]{Call: _e.mock.On("SaveReplacementInProgressAttempt", ctx, oldAttempt, replacementAttempt)} +} + +func (_c *TxStore_SaveReplacementInProgressAttempt_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Run(run func(ctx context.Context, oldAttempt txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], replacementAttempt *txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE])) *TxStore_SaveReplacementInProgressAttempt_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]), args[2].(*txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE])) + }) + return _c +} + +func (_c *TxStore_SaveReplacementInProgressAttempt_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Return(_a0 error) *TxStore_SaveReplacementInProgressAttempt_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Return(_a0) + return _c +} + +func (_c *TxStore_SaveReplacementInProgressAttempt_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) RunAndReturn(run func(context.Context, txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], *txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) error) *TxStore_SaveReplacementInProgressAttempt_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Return(run) + return _c +} + // SaveSentAttempt provides a mock function with given fields: ctx, timeout, attempt, broadcastAt func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) SaveSentAttempt(ctx context.Context, timeout time.Duration, attempt *txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], broadcastAt time.Time) error { ret := _m.Called(ctx, timeout, attempt, broadcastAt) @@ -1104,6 +2319,37 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) SaveSentAtt return r0 } +// TxStore_SaveSentAttempt_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SaveSentAttempt' +type TxStore_SaveSentAttempt_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE feetypes.Fee] struct { + *mock.Call +} + +// SaveSentAttempt is a helper method to define mock.On call +// - ctx context.Context +// - timeout time.Duration +// - attempt *txmgrtypes.TxAttempt[CHAIN_ID,ADDR,TX_HASH,BLOCK_HASH,SEQ,FEE] +// - broadcastAt time.Time +func (_e *TxStore_Expecter[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) SaveSentAttempt(ctx interface{}, timeout interface{}, attempt interface{}, broadcastAt interface{}) *TxStore_SaveSentAttempt_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + return &TxStore_SaveSentAttempt_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]{Call: _e.mock.On("SaveSentAttempt", ctx, timeout, attempt, broadcastAt)} +} + +func (_c *TxStore_SaveSentAttempt_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Run(run func(ctx context.Context, timeout time.Duration, attempt *txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], broadcastAt time.Time)) *TxStore_SaveSentAttempt_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(time.Duration), args[2].(*txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]), args[3].(time.Time)) + }) + return _c +} + +func (_c *TxStore_SaveSentAttempt_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Return(_a0 error) *TxStore_SaveSentAttempt_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Return(_a0) + return _c +} + +func (_c *TxStore_SaveSentAttempt_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) RunAndReturn(run func(context.Context, time.Duration, *txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], time.Time) error) *TxStore_SaveSentAttempt_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Return(run) + return _c +} + // SetBroadcastBeforeBlockNum provides a mock function with given fields: ctx, blockNum, chainID func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) SetBroadcastBeforeBlockNum(ctx context.Context, blockNum int64, chainID CHAIN_ID) error { ret := _m.Called(ctx, blockNum, chainID) @@ -1122,6 +2368,36 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) SetBroadcas return r0 } +// TxStore_SetBroadcastBeforeBlockNum_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetBroadcastBeforeBlockNum' +type TxStore_SetBroadcastBeforeBlockNum_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE feetypes.Fee] struct { + *mock.Call +} + +// SetBroadcastBeforeBlockNum is a helper method to define mock.On call +// - ctx context.Context +// - blockNum int64 +// - chainID CHAIN_ID +func (_e *TxStore_Expecter[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) SetBroadcastBeforeBlockNum(ctx interface{}, blockNum interface{}, chainID interface{}) *TxStore_SetBroadcastBeforeBlockNum_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + return &TxStore_SetBroadcastBeforeBlockNum_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]{Call: _e.mock.On("SetBroadcastBeforeBlockNum", ctx, blockNum, chainID)} +} + +func (_c *TxStore_SetBroadcastBeforeBlockNum_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Run(run func(ctx context.Context, blockNum int64, chainID CHAIN_ID)) *TxStore_SetBroadcastBeforeBlockNum_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(int64), args[2].(CHAIN_ID)) + }) + return _c +} + +func (_c *TxStore_SetBroadcastBeforeBlockNum_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Return(_a0 error) *TxStore_SetBroadcastBeforeBlockNum_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Return(_a0) + return _c +} + +func (_c *TxStore_SetBroadcastBeforeBlockNum_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) RunAndReturn(run func(context.Context, int64, CHAIN_ID) error) *TxStore_SetBroadcastBeforeBlockNum_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Return(run) + return _c +} + // UpdateBroadcastAts provides a mock function with given fields: ctx, now, etxIDs func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) UpdateBroadcastAts(ctx context.Context, now time.Time, etxIDs []int64) error { ret := _m.Called(ctx, now, etxIDs) @@ -1140,6 +2416,36 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) UpdateBroad return r0 } +// TxStore_UpdateBroadcastAts_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateBroadcastAts' +type TxStore_UpdateBroadcastAts_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE feetypes.Fee] struct { + *mock.Call +} + +// UpdateBroadcastAts is a helper method to define mock.On call +// - ctx context.Context +// - now time.Time +// - etxIDs []int64 +func (_e *TxStore_Expecter[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) UpdateBroadcastAts(ctx interface{}, now interface{}, etxIDs interface{}) *TxStore_UpdateBroadcastAts_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + return &TxStore_UpdateBroadcastAts_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]{Call: _e.mock.On("UpdateBroadcastAts", ctx, now, etxIDs)} +} + +func (_c *TxStore_UpdateBroadcastAts_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Run(run func(ctx context.Context, now time.Time, etxIDs []int64)) *TxStore_UpdateBroadcastAts_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(time.Time), args[2].([]int64)) + }) + return _c +} + +func (_c *TxStore_UpdateBroadcastAts_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Return(_a0 error) *TxStore_UpdateBroadcastAts_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Return(_a0) + return _c +} + +func (_c *TxStore_UpdateBroadcastAts_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) RunAndReturn(run func(context.Context, time.Time, []int64) error) *TxStore_UpdateBroadcastAts_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Return(run) + return _c +} + // UpdateTxAttemptInProgressToBroadcast provides a mock function with given fields: ctx, etx, attempt, NewAttemptState func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) UpdateTxAttemptInProgressToBroadcast(ctx context.Context, etx *txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], attempt txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], NewAttemptState txmgrtypes.TxAttemptState) error { ret := _m.Called(ctx, etx, attempt, NewAttemptState) @@ -1158,6 +2464,37 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) UpdateTxAtt return r0 } +// TxStore_UpdateTxAttemptInProgressToBroadcast_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateTxAttemptInProgressToBroadcast' +type TxStore_UpdateTxAttemptInProgressToBroadcast_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE feetypes.Fee] struct { + *mock.Call +} + +// UpdateTxAttemptInProgressToBroadcast is a helper method to define mock.On call +// - ctx context.Context +// - etx *txmgrtypes.Tx[CHAIN_ID,ADDR,TX_HASH,BLOCK_HASH,SEQ,FEE] +// - attempt txmgrtypes.TxAttempt[CHAIN_ID,ADDR,TX_HASH,BLOCK_HASH,SEQ,FEE] +// - NewAttemptState txmgrtypes.TxAttemptState +func (_e *TxStore_Expecter[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) UpdateTxAttemptInProgressToBroadcast(ctx interface{}, etx interface{}, attempt interface{}, NewAttemptState interface{}) *TxStore_UpdateTxAttemptInProgressToBroadcast_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + return &TxStore_UpdateTxAttemptInProgressToBroadcast_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]{Call: _e.mock.On("UpdateTxAttemptInProgressToBroadcast", ctx, etx, attempt, NewAttemptState)} +} + +func (_c *TxStore_UpdateTxAttemptInProgressToBroadcast_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Run(run func(ctx context.Context, etx *txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], attempt txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], NewAttemptState txmgrtypes.TxAttemptState)) *TxStore_UpdateTxAttemptInProgressToBroadcast_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]), args[2].(txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]), args[3].(txmgrtypes.TxAttemptState)) + }) + return _c +} + +func (_c *TxStore_UpdateTxAttemptInProgressToBroadcast_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Return(_a0 error) *TxStore_UpdateTxAttemptInProgressToBroadcast_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Return(_a0) + return _c +} + +func (_c *TxStore_UpdateTxAttemptInProgressToBroadcast_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) RunAndReturn(run func(context.Context, *txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], txmgrtypes.TxAttemptState) error) *TxStore_UpdateTxAttemptInProgressToBroadcast_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Return(run) + return _c +} + // UpdateTxCallbackCompleted provides a mock function with given fields: ctx, pipelineTaskRunRid, chainId func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) UpdateTxCallbackCompleted(ctx context.Context, pipelineTaskRunRid uuid.UUID, chainId CHAIN_ID) error { ret := _m.Called(ctx, pipelineTaskRunRid, chainId) @@ -1176,6 +2513,36 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) UpdateTxCal return r0 } +// TxStore_UpdateTxCallbackCompleted_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateTxCallbackCompleted' +type TxStore_UpdateTxCallbackCompleted_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE feetypes.Fee] struct { + *mock.Call +} + +// UpdateTxCallbackCompleted is a helper method to define mock.On call +// - ctx context.Context +// - pipelineTaskRunRid uuid.UUID +// - chainId CHAIN_ID +func (_e *TxStore_Expecter[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) UpdateTxCallbackCompleted(ctx interface{}, pipelineTaskRunRid interface{}, chainId interface{}) *TxStore_UpdateTxCallbackCompleted_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + return &TxStore_UpdateTxCallbackCompleted_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]{Call: _e.mock.On("UpdateTxCallbackCompleted", ctx, pipelineTaskRunRid, chainId)} +} + +func (_c *TxStore_UpdateTxCallbackCompleted_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Run(run func(ctx context.Context, pipelineTaskRunRid uuid.UUID, chainId CHAIN_ID)) *TxStore_UpdateTxCallbackCompleted_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(uuid.UUID), args[2].(CHAIN_ID)) + }) + return _c +} + +func (_c *TxStore_UpdateTxCallbackCompleted_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Return(_a0 error) *TxStore_UpdateTxCallbackCompleted_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Return(_a0) + return _c +} + +func (_c *TxStore_UpdateTxCallbackCompleted_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) RunAndReturn(run func(context.Context, uuid.UUID, CHAIN_ID) error) *TxStore_UpdateTxCallbackCompleted_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Return(run) + return _c +} + // UpdateTxFatalError provides a mock function with given fields: ctx, etx func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) UpdateTxFatalError(ctx context.Context, etx *txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) error { ret := _m.Called(ctx, etx) @@ -1194,6 +2561,35 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) UpdateTxFat return r0 } +// TxStore_UpdateTxFatalError_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateTxFatalError' +type TxStore_UpdateTxFatalError_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE feetypes.Fee] struct { + *mock.Call +} + +// UpdateTxFatalError is a helper method to define mock.On call +// - ctx context.Context +// - etx *txmgrtypes.Tx[CHAIN_ID,ADDR,TX_HASH,BLOCK_HASH,SEQ,FEE] +func (_e *TxStore_Expecter[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) UpdateTxFatalError(ctx interface{}, etx interface{}) *TxStore_UpdateTxFatalError_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + return &TxStore_UpdateTxFatalError_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]{Call: _e.mock.On("UpdateTxFatalError", ctx, etx)} +} + +func (_c *TxStore_UpdateTxFatalError_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Run(run func(ctx context.Context, etx *txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE])) *TxStore_UpdateTxFatalError_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE])) + }) + return _c +} + +func (_c *TxStore_UpdateTxFatalError_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Return(_a0 error) *TxStore_UpdateTxFatalError_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Return(_a0) + return _c +} + +func (_c *TxStore_UpdateTxFatalError_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) RunAndReturn(run func(context.Context, *txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) error) *TxStore_UpdateTxFatalError_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Return(run) + return _c +} + // UpdateTxForRebroadcast provides a mock function with given fields: ctx, etx, etxAttempt func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) UpdateTxForRebroadcast(ctx context.Context, etx txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], etxAttempt txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) error { ret := _m.Called(ctx, etx, etxAttempt) @@ -1212,6 +2608,36 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) UpdateTxFor return r0 } +// TxStore_UpdateTxForRebroadcast_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateTxForRebroadcast' +type TxStore_UpdateTxForRebroadcast_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE feetypes.Fee] struct { + *mock.Call +} + +// UpdateTxForRebroadcast is a helper method to define mock.On call +// - ctx context.Context +// - etx txmgrtypes.Tx[CHAIN_ID,ADDR,TX_HASH,BLOCK_HASH,SEQ,FEE] +// - etxAttempt txmgrtypes.TxAttempt[CHAIN_ID,ADDR,TX_HASH,BLOCK_HASH,SEQ,FEE] +func (_e *TxStore_Expecter[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) UpdateTxForRebroadcast(ctx interface{}, etx interface{}, etxAttempt interface{}) *TxStore_UpdateTxForRebroadcast_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + return &TxStore_UpdateTxForRebroadcast_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]{Call: _e.mock.On("UpdateTxForRebroadcast", ctx, etx, etxAttempt)} +} + +func (_c *TxStore_UpdateTxForRebroadcast_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Run(run func(ctx context.Context, etx txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], etxAttempt txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE])) *TxStore_UpdateTxForRebroadcast_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]), args[2].(txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE])) + }) + return _c +} + +func (_c *TxStore_UpdateTxForRebroadcast_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Return(_a0 error) *TxStore_UpdateTxForRebroadcast_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Return(_a0) + return _c +} + +func (_c *TxStore_UpdateTxForRebroadcast_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) RunAndReturn(run func(context.Context, txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) error) *TxStore_UpdateTxForRebroadcast_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Return(run) + return _c +} + // UpdateTxUnstartedToInProgress provides a mock function with given fields: ctx, etx, attempt func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) UpdateTxUnstartedToInProgress(ctx context.Context, etx *txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], attempt *txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) error { ret := _m.Called(ctx, etx, attempt) @@ -1230,6 +2656,36 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) UpdateTxUns return r0 } +// TxStore_UpdateTxUnstartedToInProgress_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateTxUnstartedToInProgress' +type TxStore_UpdateTxUnstartedToInProgress_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE feetypes.Fee] struct { + *mock.Call +} + +// UpdateTxUnstartedToInProgress is a helper method to define mock.On call +// - ctx context.Context +// - etx *txmgrtypes.Tx[CHAIN_ID,ADDR,TX_HASH,BLOCK_HASH,SEQ,FEE] +// - attempt *txmgrtypes.TxAttempt[CHAIN_ID,ADDR,TX_HASH,BLOCK_HASH,SEQ,FEE] +func (_e *TxStore_Expecter[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) UpdateTxUnstartedToInProgress(ctx interface{}, etx interface{}, attempt interface{}) *TxStore_UpdateTxUnstartedToInProgress_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + return &TxStore_UpdateTxUnstartedToInProgress_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]{Call: _e.mock.On("UpdateTxUnstartedToInProgress", ctx, etx, attempt)} +} + +func (_c *TxStore_UpdateTxUnstartedToInProgress_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Run(run func(ctx context.Context, etx *txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], attempt *txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE])) *TxStore_UpdateTxUnstartedToInProgress_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]), args[2].(*txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE])) + }) + return _c +} + +func (_c *TxStore_UpdateTxUnstartedToInProgress_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Return(_a0 error) *TxStore_UpdateTxUnstartedToInProgress_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Return(_a0) + return _c +} + +func (_c *TxStore_UpdateTxUnstartedToInProgress_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) RunAndReturn(run func(context.Context, *txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], *txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) error) *TxStore_UpdateTxUnstartedToInProgress_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Return(run) + return _c +} + // UpdateTxsUnconfirmed provides a mock function with given fields: ctx, ids func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) UpdateTxsUnconfirmed(ctx context.Context, ids []int64) error { ret := _m.Called(ctx, ids) @@ -1248,6 +2704,35 @@ func (_m *TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) UpdateTxsUn return r0 } +// TxStore_UpdateTxsUnconfirmed_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateTxsUnconfirmed' +type TxStore_UpdateTxsUnconfirmed_Call[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE feetypes.Fee] struct { + *mock.Call +} + +// UpdateTxsUnconfirmed is a helper method to define mock.On call +// - ctx context.Context +// - ids []int64 +func (_e *TxStore_Expecter[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) UpdateTxsUnconfirmed(ctx interface{}, ids interface{}) *TxStore_UpdateTxsUnconfirmed_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + return &TxStore_UpdateTxsUnconfirmed_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]{Call: _e.mock.On("UpdateTxsUnconfirmed", ctx, ids)} +} + +func (_c *TxStore_UpdateTxsUnconfirmed_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Run(run func(ctx context.Context, ids []int64)) *TxStore_UpdateTxsUnconfirmed_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].([]int64)) + }) + return _c +} + +func (_c *TxStore_UpdateTxsUnconfirmed_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Return(_a0 error) *TxStore_UpdateTxsUnconfirmed_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Return(_a0) + return _c +} + +func (_c *TxStore_UpdateTxsUnconfirmed_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) RunAndReturn(run func(context.Context, []int64) error) *TxStore_UpdateTxsUnconfirmed_Call[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE] { + _c.Call.Return(run) + return _c +} + // NewTxStore creates a new instance of TxStore. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewTxStore[ADDR types.Hashable, CHAIN_ID types.ID, TX_HASH types.Hashable, BLOCK_HASH types.Hashable, R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH], SEQ types.Sequence, FEE feetypes.Fee](t interface { diff --git a/common/txmgr/types/mocks/tx_strategy.go b/common/txmgr/types/mocks/tx_strategy.go index 1034e00e545..434b074caf2 100644 --- a/common/txmgr/types/mocks/tx_strategy.go +++ b/common/txmgr/types/mocks/tx_strategy.go @@ -16,6 +16,14 @@ type TxStrategy struct { mock.Mock } +type TxStrategy_Expecter struct { + mock *mock.Mock +} + +func (_m *TxStrategy) EXPECT() *TxStrategy_Expecter { + return &TxStrategy_Expecter{mock: &_m.Mock} +} + // PruneQueue provides a mock function with given fields: ctx, pruneService func (_m *TxStrategy) PruneQueue(ctx context.Context, pruneService types.UnstartedTxQueuePruner) ([]int64, error) { ret := _m.Called(ctx, pruneService) @@ -46,6 +54,35 @@ func (_m *TxStrategy) PruneQueue(ctx context.Context, pruneService types.Unstart return r0, r1 } +// TxStrategy_PruneQueue_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PruneQueue' +type TxStrategy_PruneQueue_Call struct { + *mock.Call +} + +// PruneQueue is a helper method to define mock.On call +// - ctx context.Context +// - pruneService types.UnstartedTxQueuePruner +func (_e *TxStrategy_Expecter) PruneQueue(ctx interface{}, pruneService interface{}) *TxStrategy_PruneQueue_Call { + return &TxStrategy_PruneQueue_Call{Call: _e.mock.On("PruneQueue", ctx, pruneService)} +} + +func (_c *TxStrategy_PruneQueue_Call) Run(run func(ctx context.Context, pruneService types.UnstartedTxQueuePruner)) *TxStrategy_PruneQueue_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(types.UnstartedTxQueuePruner)) + }) + return _c +} + +func (_c *TxStrategy_PruneQueue_Call) Return(ids []int64, err error) *TxStrategy_PruneQueue_Call { + _c.Call.Return(ids, err) + return _c +} + +func (_c *TxStrategy_PruneQueue_Call) RunAndReturn(run func(context.Context, types.UnstartedTxQueuePruner) ([]int64, error)) *TxStrategy_PruneQueue_Call { + _c.Call.Return(run) + return _c +} + // Subject provides a mock function with given fields: func (_m *TxStrategy) Subject() uuid.NullUUID { ret := _m.Called() @@ -64,6 +101,33 @@ func (_m *TxStrategy) Subject() uuid.NullUUID { return r0 } +// TxStrategy_Subject_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Subject' +type TxStrategy_Subject_Call struct { + *mock.Call +} + +// Subject is a helper method to define mock.On call +func (_e *TxStrategy_Expecter) Subject() *TxStrategy_Subject_Call { + return &TxStrategy_Subject_Call{Call: _e.mock.On("Subject")} +} + +func (_c *TxStrategy_Subject_Call) Run(run func()) *TxStrategy_Subject_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *TxStrategy_Subject_Call) Return(_a0 uuid.NullUUID) *TxStrategy_Subject_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *TxStrategy_Subject_Call) RunAndReturn(run func() uuid.NullUUID) *TxStrategy_Subject_Call { + _c.Call.Return(run) + return _c +} + // NewTxStrategy creates a new instance of TxStrategy. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewTxStrategy(t interface { diff --git a/common/txmgr/types/stuck_tx_detector.go b/common/txmgr/types/stuck_tx_detector.go index c4ca94b87f8..dc09eea9807 100644 --- a/common/txmgr/types/stuck_tx_detector.go +++ b/common/txmgr/types/stuck_tx_detector.go @@ -22,5 +22,5 @@ type StuckTxDetector[ // Sets the last purged block num after a transaction has been successfully purged with receipt SetPurgeBlockNum(fromAddress ADDR, blockNum int64) // Returns the error message to set in the transaction error field to mark it as terminally stuck - StuckTxFatalError() *string + StuckTxFatalError() string } diff --git a/common/txmgr/types/tx.go b/common/txmgr/types/tx.go index d2afbd209d8..b65f7edf6e5 100644 --- a/common/txmgr/types/tx.go +++ b/common/txmgr/types/tx.go @@ -22,8 +22,6 @@ import ( ) // TxStrategy controls how txes are queued and sent -// -//go:generate mockery --quiet --name TxStrategy --output ./mocks/ --case=underscore --structname TxStrategy --filename tx_strategy.go type TxStrategy interface { // Subject will be saved txes.subject if not null Subject() uuid.NullUUID diff --git a/common/txmgr/types/tx_attempt_builder.go b/common/txmgr/types/tx_attempt_builder.go index a9cbddfc2cf..44443e78211 100644 --- a/common/txmgr/types/tx_attempt_builder.go +++ b/common/txmgr/types/tx_attempt_builder.go @@ -13,8 +13,6 @@ import ( // TxAttemptBuilder takes the base unsigned transaction + optional parameters (tx type, gas parameters) // and returns a signed TxAttempt // it is able to estimate fees and sign transactions -// -//go:generate mockery --quiet --name TxAttemptBuilder --output ./mocks/ --case=underscore type TxAttemptBuilder[ CHAIN_ID types.ID, // CHAIN_ID - chain id type HEAD types.Head[BLOCK_HASH], // HEAD - chain head type diff --git a/common/txmgr/types/tx_store.go b/common/txmgr/types/tx_store.go index c102fb5912a..3d874cc4366 100644 --- a/common/txmgr/types/tx_store.go +++ b/common/txmgr/types/tx_store.go @@ -13,8 +13,6 @@ import ( ) // TxStore is a superset of all the needed persistence layer methods -// -//go:generate mockery --quiet --name TxStore --output ./mocks/ --case=underscore type TxStore[ // Represents an account address, in native chain format. ADDR types.Hashable, @@ -81,6 +79,8 @@ type TransactionStore[ // Search for Tx using the fromAddress and sequence FindTxWithSequence(ctx context.Context, fromAddress ADDR, seq SEQ) (etx *Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], err error) FindNextUnstartedTransactionFromAddress(ctx context.Context, fromAddress ADDR, chainID CHAIN_ID) (*Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], error) + + // FindTransactionsConfirmedInBlockRange retrieves tx with attempts and partial receipt values for optimization purpose FindTransactionsConfirmedInBlockRange(ctx context.Context, highBlockNumber, lowBlockNumber int64, chainID CHAIN_ID) (etxs []*Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], err error) FindEarliestUnconfirmedBroadcastTime(ctx context.Context, chainID CHAIN_ID) (null.Time, error) FindEarliestUnconfirmedTxAttemptBlock(ctx context.Context, chainID CHAIN_ID) (null.Int, error) @@ -91,7 +91,7 @@ type TransactionStore[ HasInProgressTransaction(ctx context.Context, account ADDR, chainID CHAIN_ID) (exists bool, err error) LoadTxAttempts(ctx context.Context, etx *Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) error MarkAllConfirmedMissingReceipt(ctx context.Context, chainID CHAIN_ID) (err error) - MarkOldTxesMissingReceiptAsErrored(ctx context.Context, blockNum int64, finalityDepth uint32, chainID CHAIN_ID) error + MarkOldTxesMissingReceiptAsErrored(ctx context.Context, blockNum int64, latestFinalizedBlockNum int64, chainID CHAIN_ID) error PreloadTxes(ctx context.Context, attempts []TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) error SaveConfirmedMissingReceiptAttempt(ctx context.Context, timeout time.Duration, attempt *TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], broadcastAt time.Time) error SaveInProgressAttempt(ctx context.Context, attempt *TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) error @@ -107,11 +107,10 @@ type TransactionStore[ UpdateTxUnstartedToInProgress(ctx context.Context, etx *Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], attempt *TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) error UpdateTxFatalError(ctx context.Context, etx *Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) error UpdateTxForRebroadcast(ctx context.Context, etx Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], etxAttempt TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) error - IsTxFinalized(ctx context.Context, blockHeight int64, txID int64, chainID CHAIN_ID) (finalized bool, err error) } type TxHistoryReaper[CHAIN_ID types.ID] interface { - ReapTxHistory(ctx context.Context, minBlockNumberToKeep int64, timeThreshold time.Time, chainID CHAIN_ID) error + ReapTxHistory(ctx context.Context, timeThreshold time.Time, chainID CHAIN_ID) error } type UnstartedTxQueuePruner interface { @@ -134,4 +133,5 @@ type ChainReceipt[TX_HASH, BLOCK_HASH types.Hashable] interface { GetFeeUsed() uint64 GetTransactionIndex() uint GetBlockHash() BLOCK_HASH + GetRevertReason() *string } diff --git a/common/types/head.go b/common/types/head.go index 77a2a7a0dcf..5252c8f75a1 100644 --- a/common/types/head.go +++ b/common/types/head.go @@ -7,8 +7,6 @@ import ( // Head provides access to a chain's head, as needed by the TxManager. // This is a generic interface which ALL chains will implement. -// -//go:generate mockery --quiet --name Head --output ./mocks/ --case=underscore type Head[BLOCK_HASH Hashable] interface { // BlockNumber is the head's block number BlockNumber() int64 diff --git a/common/types/mocks/head.go b/common/types/mocks/head.go index 102368199ae..407a6251a94 100644 --- a/common/types/mocks/head.go +++ b/common/types/mocks/head.go @@ -16,6 +16,14 @@ type Head[BLOCK_HASH types.Hashable] struct { mock.Mock } +type Head_Expecter[BLOCK_HASH types.Hashable] struct { + mock *mock.Mock +} + +func (_m *Head[BLOCK_HASH]) EXPECT() *Head_Expecter[BLOCK_HASH] { + return &Head_Expecter[BLOCK_HASH]{mock: &_m.Mock} +} + // BlockDifficulty provides a mock function with given fields: func (_m *Head[BLOCK_HASH]) BlockDifficulty() *big.Int { ret := _m.Called() @@ -36,6 +44,33 @@ func (_m *Head[BLOCK_HASH]) BlockDifficulty() *big.Int { return r0 } +// Head_BlockDifficulty_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BlockDifficulty' +type Head_BlockDifficulty_Call[BLOCK_HASH types.Hashable] struct { + *mock.Call +} + +// BlockDifficulty is a helper method to define mock.On call +func (_e *Head_Expecter[BLOCK_HASH]) BlockDifficulty() *Head_BlockDifficulty_Call[BLOCK_HASH] { + return &Head_BlockDifficulty_Call[BLOCK_HASH]{Call: _e.mock.On("BlockDifficulty")} +} + +func (_c *Head_BlockDifficulty_Call[BLOCK_HASH]) Run(run func()) *Head_BlockDifficulty_Call[BLOCK_HASH] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Head_BlockDifficulty_Call[BLOCK_HASH]) Return(_a0 *big.Int) *Head_BlockDifficulty_Call[BLOCK_HASH] { + _c.Call.Return(_a0) + return _c +} + +func (_c *Head_BlockDifficulty_Call[BLOCK_HASH]) RunAndReturn(run func() *big.Int) *Head_BlockDifficulty_Call[BLOCK_HASH] { + _c.Call.Return(run) + return _c +} + // BlockHash provides a mock function with given fields: func (_m *Head[BLOCK_HASH]) BlockHash() BLOCK_HASH { ret := _m.Called() @@ -54,6 +89,33 @@ func (_m *Head[BLOCK_HASH]) BlockHash() BLOCK_HASH { return r0 } +// Head_BlockHash_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BlockHash' +type Head_BlockHash_Call[BLOCK_HASH types.Hashable] struct { + *mock.Call +} + +// BlockHash is a helper method to define mock.On call +func (_e *Head_Expecter[BLOCK_HASH]) BlockHash() *Head_BlockHash_Call[BLOCK_HASH] { + return &Head_BlockHash_Call[BLOCK_HASH]{Call: _e.mock.On("BlockHash")} +} + +func (_c *Head_BlockHash_Call[BLOCK_HASH]) Run(run func()) *Head_BlockHash_Call[BLOCK_HASH] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Head_BlockHash_Call[BLOCK_HASH]) Return(_a0 BLOCK_HASH) *Head_BlockHash_Call[BLOCK_HASH] { + _c.Call.Return(_a0) + return _c +} + +func (_c *Head_BlockHash_Call[BLOCK_HASH]) RunAndReturn(run func() BLOCK_HASH) *Head_BlockHash_Call[BLOCK_HASH] { + _c.Call.Return(run) + return _c +} + // BlockNumber provides a mock function with given fields: func (_m *Head[BLOCK_HASH]) BlockNumber() int64 { ret := _m.Called() @@ -72,6 +134,33 @@ func (_m *Head[BLOCK_HASH]) BlockNumber() int64 { return r0 } +// Head_BlockNumber_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BlockNumber' +type Head_BlockNumber_Call[BLOCK_HASH types.Hashable] struct { + *mock.Call +} + +// BlockNumber is a helper method to define mock.On call +func (_e *Head_Expecter[BLOCK_HASH]) BlockNumber() *Head_BlockNumber_Call[BLOCK_HASH] { + return &Head_BlockNumber_Call[BLOCK_HASH]{Call: _e.mock.On("BlockNumber")} +} + +func (_c *Head_BlockNumber_Call[BLOCK_HASH]) Run(run func()) *Head_BlockNumber_Call[BLOCK_HASH] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Head_BlockNumber_Call[BLOCK_HASH]) Return(_a0 int64) *Head_BlockNumber_Call[BLOCK_HASH] { + _c.Call.Return(_a0) + return _c +} + +func (_c *Head_BlockNumber_Call[BLOCK_HASH]) RunAndReturn(run func() int64) *Head_BlockNumber_Call[BLOCK_HASH] { + _c.Call.Return(run) + return _c +} + // ChainLength provides a mock function with given fields: func (_m *Head[BLOCK_HASH]) ChainLength() uint32 { ret := _m.Called() @@ -90,6 +179,33 @@ func (_m *Head[BLOCK_HASH]) ChainLength() uint32 { return r0 } +// Head_ChainLength_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ChainLength' +type Head_ChainLength_Call[BLOCK_HASH types.Hashable] struct { + *mock.Call +} + +// ChainLength is a helper method to define mock.On call +func (_e *Head_Expecter[BLOCK_HASH]) ChainLength() *Head_ChainLength_Call[BLOCK_HASH] { + return &Head_ChainLength_Call[BLOCK_HASH]{Call: _e.mock.On("ChainLength")} +} + +func (_c *Head_ChainLength_Call[BLOCK_HASH]) Run(run func()) *Head_ChainLength_Call[BLOCK_HASH] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Head_ChainLength_Call[BLOCK_HASH]) Return(_a0 uint32) *Head_ChainLength_Call[BLOCK_HASH] { + _c.Call.Return(_a0) + return _c +} + +func (_c *Head_ChainLength_Call[BLOCK_HASH]) RunAndReturn(run func() uint32) *Head_ChainLength_Call[BLOCK_HASH] { + _c.Call.Return(run) + return _c +} + // EarliestHeadInChain provides a mock function with given fields: func (_m *Head[BLOCK_HASH]) EarliestHeadInChain() types.Head[BLOCK_HASH] { ret := _m.Called() @@ -110,6 +226,33 @@ func (_m *Head[BLOCK_HASH]) EarliestHeadInChain() types.Head[BLOCK_HASH] { return r0 } +// Head_EarliestHeadInChain_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EarliestHeadInChain' +type Head_EarliestHeadInChain_Call[BLOCK_HASH types.Hashable] struct { + *mock.Call +} + +// EarliestHeadInChain is a helper method to define mock.On call +func (_e *Head_Expecter[BLOCK_HASH]) EarliestHeadInChain() *Head_EarliestHeadInChain_Call[BLOCK_HASH] { + return &Head_EarliestHeadInChain_Call[BLOCK_HASH]{Call: _e.mock.On("EarliestHeadInChain")} +} + +func (_c *Head_EarliestHeadInChain_Call[BLOCK_HASH]) Run(run func()) *Head_EarliestHeadInChain_Call[BLOCK_HASH] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Head_EarliestHeadInChain_Call[BLOCK_HASH]) Return(_a0 types.Head[BLOCK_HASH]) *Head_EarliestHeadInChain_Call[BLOCK_HASH] { + _c.Call.Return(_a0) + return _c +} + +func (_c *Head_EarliestHeadInChain_Call[BLOCK_HASH]) RunAndReturn(run func() types.Head[BLOCK_HASH]) *Head_EarliestHeadInChain_Call[BLOCK_HASH] { + _c.Call.Return(run) + return _c +} + // GetParent provides a mock function with given fields: func (_m *Head[BLOCK_HASH]) GetParent() types.Head[BLOCK_HASH] { ret := _m.Called() @@ -130,6 +273,33 @@ func (_m *Head[BLOCK_HASH]) GetParent() types.Head[BLOCK_HASH] { return r0 } +// Head_GetParent_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetParent' +type Head_GetParent_Call[BLOCK_HASH types.Hashable] struct { + *mock.Call +} + +// GetParent is a helper method to define mock.On call +func (_e *Head_Expecter[BLOCK_HASH]) GetParent() *Head_GetParent_Call[BLOCK_HASH] { + return &Head_GetParent_Call[BLOCK_HASH]{Call: _e.mock.On("GetParent")} +} + +func (_c *Head_GetParent_Call[BLOCK_HASH]) Run(run func()) *Head_GetParent_Call[BLOCK_HASH] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Head_GetParent_Call[BLOCK_HASH]) Return(_a0 types.Head[BLOCK_HASH]) *Head_GetParent_Call[BLOCK_HASH] { + _c.Call.Return(_a0) + return _c +} + +func (_c *Head_GetParent_Call[BLOCK_HASH]) RunAndReturn(run func() types.Head[BLOCK_HASH]) *Head_GetParent_Call[BLOCK_HASH] { + _c.Call.Return(run) + return _c +} + // GetParentHash provides a mock function with given fields: func (_m *Head[BLOCK_HASH]) GetParentHash() BLOCK_HASH { ret := _m.Called() @@ -148,6 +318,33 @@ func (_m *Head[BLOCK_HASH]) GetParentHash() BLOCK_HASH { return r0 } +// Head_GetParentHash_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetParentHash' +type Head_GetParentHash_Call[BLOCK_HASH types.Hashable] struct { + *mock.Call +} + +// GetParentHash is a helper method to define mock.On call +func (_e *Head_Expecter[BLOCK_HASH]) GetParentHash() *Head_GetParentHash_Call[BLOCK_HASH] { + return &Head_GetParentHash_Call[BLOCK_HASH]{Call: _e.mock.On("GetParentHash")} +} + +func (_c *Head_GetParentHash_Call[BLOCK_HASH]) Run(run func()) *Head_GetParentHash_Call[BLOCK_HASH] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Head_GetParentHash_Call[BLOCK_HASH]) Return(_a0 BLOCK_HASH) *Head_GetParentHash_Call[BLOCK_HASH] { + _c.Call.Return(_a0) + return _c +} + +func (_c *Head_GetParentHash_Call[BLOCK_HASH]) RunAndReturn(run func() BLOCK_HASH) *Head_GetParentHash_Call[BLOCK_HASH] { + _c.Call.Return(run) + return _c +} + // GetTimestamp provides a mock function with given fields: func (_m *Head[BLOCK_HASH]) GetTimestamp() time.Time { ret := _m.Called() @@ -166,6 +363,33 @@ func (_m *Head[BLOCK_HASH]) GetTimestamp() time.Time { return r0 } +// Head_GetTimestamp_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetTimestamp' +type Head_GetTimestamp_Call[BLOCK_HASH types.Hashable] struct { + *mock.Call +} + +// GetTimestamp is a helper method to define mock.On call +func (_e *Head_Expecter[BLOCK_HASH]) GetTimestamp() *Head_GetTimestamp_Call[BLOCK_HASH] { + return &Head_GetTimestamp_Call[BLOCK_HASH]{Call: _e.mock.On("GetTimestamp")} +} + +func (_c *Head_GetTimestamp_Call[BLOCK_HASH]) Run(run func()) *Head_GetTimestamp_Call[BLOCK_HASH] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Head_GetTimestamp_Call[BLOCK_HASH]) Return(_a0 time.Time) *Head_GetTimestamp_Call[BLOCK_HASH] { + _c.Call.Return(_a0) + return _c +} + +func (_c *Head_GetTimestamp_Call[BLOCK_HASH]) RunAndReturn(run func() time.Time) *Head_GetTimestamp_Call[BLOCK_HASH] { + _c.Call.Return(run) + return _c +} + // HashAtHeight provides a mock function with given fields: blockNum func (_m *Head[BLOCK_HASH]) HashAtHeight(blockNum int64) BLOCK_HASH { ret := _m.Called(blockNum) @@ -184,6 +408,34 @@ func (_m *Head[BLOCK_HASH]) HashAtHeight(blockNum int64) BLOCK_HASH { return r0 } +// Head_HashAtHeight_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HashAtHeight' +type Head_HashAtHeight_Call[BLOCK_HASH types.Hashable] struct { + *mock.Call +} + +// HashAtHeight is a helper method to define mock.On call +// - blockNum int64 +func (_e *Head_Expecter[BLOCK_HASH]) HashAtHeight(blockNum interface{}) *Head_HashAtHeight_Call[BLOCK_HASH] { + return &Head_HashAtHeight_Call[BLOCK_HASH]{Call: _e.mock.On("HashAtHeight", blockNum)} +} + +func (_c *Head_HashAtHeight_Call[BLOCK_HASH]) Run(run func(blockNum int64)) *Head_HashAtHeight_Call[BLOCK_HASH] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(int64)) + }) + return _c +} + +func (_c *Head_HashAtHeight_Call[BLOCK_HASH]) Return(_a0 BLOCK_HASH) *Head_HashAtHeight_Call[BLOCK_HASH] { + _c.Call.Return(_a0) + return _c +} + +func (_c *Head_HashAtHeight_Call[BLOCK_HASH]) RunAndReturn(run func(int64) BLOCK_HASH) *Head_HashAtHeight_Call[BLOCK_HASH] { + _c.Call.Return(run) + return _c +} + // HeadAtHeight provides a mock function with given fields: blockNum func (_m *Head[BLOCK_HASH]) HeadAtHeight(blockNum int64) (types.Head[BLOCK_HASH], error) { ret := _m.Called(blockNum) @@ -214,6 +466,34 @@ func (_m *Head[BLOCK_HASH]) HeadAtHeight(blockNum int64) (types.Head[BLOCK_HASH] return r0, r1 } +// Head_HeadAtHeight_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HeadAtHeight' +type Head_HeadAtHeight_Call[BLOCK_HASH types.Hashable] struct { + *mock.Call +} + +// HeadAtHeight is a helper method to define mock.On call +// - blockNum int64 +func (_e *Head_Expecter[BLOCK_HASH]) HeadAtHeight(blockNum interface{}) *Head_HeadAtHeight_Call[BLOCK_HASH] { + return &Head_HeadAtHeight_Call[BLOCK_HASH]{Call: _e.mock.On("HeadAtHeight", blockNum)} +} + +func (_c *Head_HeadAtHeight_Call[BLOCK_HASH]) Run(run func(blockNum int64)) *Head_HeadAtHeight_Call[BLOCK_HASH] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(int64)) + }) + return _c +} + +func (_c *Head_HeadAtHeight_Call[BLOCK_HASH]) Return(_a0 types.Head[BLOCK_HASH], _a1 error) *Head_HeadAtHeight_Call[BLOCK_HASH] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Head_HeadAtHeight_Call[BLOCK_HASH]) RunAndReturn(run func(int64) (types.Head[BLOCK_HASH], error)) *Head_HeadAtHeight_Call[BLOCK_HASH] { + _c.Call.Return(run) + return _c +} + // IsValid provides a mock function with given fields: func (_m *Head[BLOCK_HASH]) IsValid() bool { ret := _m.Called() @@ -232,6 +512,33 @@ func (_m *Head[BLOCK_HASH]) IsValid() bool { return r0 } +// Head_IsValid_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsValid' +type Head_IsValid_Call[BLOCK_HASH types.Hashable] struct { + *mock.Call +} + +// IsValid is a helper method to define mock.On call +func (_e *Head_Expecter[BLOCK_HASH]) IsValid() *Head_IsValid_Call[BLOCK_HASH] { + return &Head_IsValid_Call[BLOCK_HASH]{Call: _e.mock.On("IsValid")} +} + +func (_c *Head_IsValid_Call[BLOCK_HASH]) Run(run func()) *Head_IsValid_Call[BLOCK_HASH] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Head_IsValid_Call[BLOCK_HASH]) Return(_a0 bool) *Head_IsValid_Call[BLOCK_HASH] { + _c.Call.Return(_a0) + return _c +} + +func (_c *Head_IsValid_Call[BLOCK_HASH]) RunAndReturn(run func() bool) *Head_IsValid_Call[BLOCK_HASH] { + _c.Call.Return(run) + return _c +} + // LatestFinalizedHead provides a mock function with given fields: func (_m *Head[BLOCK_HASH]) LatestFinalizedHead() types.Head[BLOCK_HASH] { ret := _m.Called() @@ -252,6 +559,33 @@ func (_m *Head[BLOCK_HASH]) LatestFinalizedHead() types.Head[BLOCK_HASH] { return r0 } +// Head_LatestFinalizedHead_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LatestFinalizedHead' +type Head_LatestFinalizedHead_Call[BLOCK_HASH types.Hashable] struct { + *mock.Call +} + +// LatestFinalizedHead is a helper method to define mock.On call +func (_e *Head_Expecter[BLOCK_HASH]) LatestFinalizedHead() *Head_LatestFinalizedHead_Call[BLOCK_HASH] { + return &Head_LatestFinalizedHead_Call[BLOCK_HASH]{Call: _e.mock.On("LatestFinalizedHead")} +} + +func (_c *Head_LatestFinalizedHead_Call[BLOCK_HASH]) Run(run func()) *Head_LatestFinalizedHead_Call[BLOCK_HASH] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Head_LatestFinalizedHead_Call[BLOCK_HASH]) Return(_a0 types.Head[BLOCK_HASH]) *Head_LatestFinalizedHead_Call[BLOCK_HASH] { + _c.Call.Return(_a0) + return _c +} + +func (_c *Head_LatestFinalizedHead_Call[BLOCK_HASH]) RunAndReturn(run func() types.Head[BLOCK_HASH]) *Head_LatestFinalizedHead_Call[BLOCK_HASH] { + _c.Call.Return(run) + return _c +} + // NewHead creates a new instance of Head. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewHead[BLOCK_HASH types.Hashable](t interface { diff --git a/common/types/mocks/monitoring_endpoint.go b/common/types/mocks/monitoring_endpoint.go new file mode 100644 index 00000000000..5afc04c9090 --- /dev/null +++ b/common/types/mocks/monitoring_endpoint.go @@ -0,0 +1,65 @@ +// Code generated by mockery v2.43.2. DO NOT EDIT. + +package mocks + +import mock "github.com/stretchr/testify/mock" + +// MonitoringEndpoint is an autogenerated mock type for the MonitoringEndpoint type +type MonitoringEndpoint struct { + mock.Mock +} + +type MonitoringEndpoint_Expecter struct { + mock *mock.Mock +} + +func (_m *MonitoringEndpoint) EXPECT() *MonitoringEndpoint_Expecter { + return &MonitoringEndpoint_Expecter{mock: &_m.Mock} +} + +// SendLog provides a mock function with given fields: log +func (_m *MonitoringEndpoint) SendLog(log []byte) { + _m.Called(log) +} + +// MonitoringEndpoint_SendLog_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SendLog' +type MonitoringEndpoint_SendLog_Call struct { + *mock.Call +} + +// SendLog is a helper method to define mock.On call +// - log []byte +func (_e *MonitoringEndpoint_Expecter) SendLog(log interface{}) *MonitoringEndpoint_SendLog_Call { + return &MonitoringEndpoint_SendLog_Call{Call: _e.mock.On("SendLog", log)} +} + +func (_c *MonitoringEndpoint_SendLog_Call) Run(run func(log []byte)) *MonitoringEndpoint_SendLog_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].([]byte)) + }) + return _c +} + +func (_c *MonitoringEndpoint_SendLog_Call) Return() *MonitoringEndpoint_SendLog_Call { + _c.Call.Return() + return _c +} + +func (_c *MonitoringEndpoint_SendLog_Call) RunAndReturn(run func([]byte)) *MonitoringEndpoint_SendLog_Call { + _c.Call.Return(run) + return _c +} + +// NewMonitoringEndpoint creates a new instance of MonitoringEndpoint. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewMonitoringEndpoint(t interface { + mock.TestingT + Cleanup(func()) +}) *MonitoringEndpoint { + mock := &MonitoringEndpoint{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/common/types/mocks/subscription.go b/common/types/mocks/subscription.go index 6abf2acdb52..9119936ec4f 100644 --- a/common/types/mocks/subscription.go +++ b/common/types/mocks/subscription.go @@ -9,6 +9,14 @@ type Subscription struct { mock.Mock } +type Subscription_Expecter struct { + mock *mock.Mock +} + +func (_m *Subscription) EXPECT() *Subscription_Expecter { + return &Subscription_Expecter{mock: &_m.Mock} +} + // Err provides a mock function with given fields: func (_m *Subscription) Err() <-chan error { ret := _m.Called() @@ -29,11 +37,65 @@ func (_m *Subscription) Err() <-chan error { return r0 } +// Subscription_Err_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Err' +type Subscription_Err_Call struct { + *mock.Call +} + +// Err is a helper method to define mock.On call +func (_e *Subscription_Expecter) Err() *Subscription_Err_Call { + return &Subscription_Err_Call{Call: _e.mock.On("Err")} +} + +func (_c *Subscription_Err_Call) Run(run func()) *Subscription_Err_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Subscription_Err_Call) Return(_a0 <-chan error) *Subscription_Err_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Subscription_Err_Call) RunAndReturn(run func() <-chan error) *Subscription_Err_Call { + _c.Call.Return(run) + return _c +} + // Unsubscribe provides a mock function with given fields: func (_m *Subscription) Unsubscribe() { _m.Called() } +// Subscription_Unsubscribe_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Unsubscribe' +type Subscription_Unsubscribe_Call struct { + *mock.Call +} + +// Unsubscribe is a helper method to define mock.On call +func (_e *Subscription_Expecter) Unsubscribe() *Subscription_Unsubscribe_Call { + return &Subscription_Unsubscribe_Call{Call: _e.mock.On("Unsubscribe")} +} + +func (_c *Subscription_Unsubscribe_Call) Run(run func()) *Subscription_Unsubscribe_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Subscription_Unsubscribe_Call) Return() *Subscription_Unsubscribe_Call { + _c.Call.Return() + return _c +} + +func (_c *Subscription_Unsubscribe_Call) RunAndReturn(run func()) *Subscription_Unsubscribe_Call { + _c.Call.Return(run) + return _c +} + // NewSubscription creates a new instance of Subscription. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewSubscription(t interface { diff --git a/common/types/subscription.go b/common/types/subscription.go index e0cd0a1660d..b9b44e41943 100644 --- a/common/types/subscription.go +++ b/common/types/subscription.go @@ -1,7 +1,5 @@ package types -//go:generate mockery --quiet --name Subscription --output ./mocks/ --case=underscore - // Subscription represents an event subscription where events are // delivered on a data channel. // This is a generic interface for Subscription to represent used by clients. diff --git a/contracts/.changeset/blue-onions-sleep.md b/contracts/.changeset/blue-onions-sleep.md deleted file mode 100644 index 35944a09606..00000000000 --- a/contracts/.changeset/blue-onions-sleep.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@chainlink/contracts': patch ---- - -capability registry internal review diff --git a/contracts/.changeset/brave-seahorses-shave.md b/contracts/.changeset/brave-seahorses-shave.md deleted file mode 100644 index 3f29e6aa4a4..00000000000 --- a/contracts/.changeset/brave-seahorses-shave.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@chainlink/contracts': patch ---- - -upgrade keystone contracts to 0.8.24 diff --git a/contracts/.changeset/calm-bikes-grin.md b/contracts/.changeset/calm-bikes-grin.md deleted file mode 100644 index 675d42ce4fe..00000000000 --- a/contracts/.changeset/calm-bikes-grin.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@chainlink/contracts": patch ---- - -add events, add getter and add comments #bugfix diff --git a/contracts/.changeset/chatty-feet-clean.md b/contracts/.changeset/chatty-feet-clean.md new file mode 100644 index 00000000000..161bfee8acd --- /dev/null +++ b/contracts/.changeset/chatty-feet-clean.md @@ -0,0 +1,5 @@ +--- +'@chainlink/contracts': patch +--- + +#internal address security vulnerabilities around updating nodes and node operators on capabilities registry diff --git a/contracts/.changeset/chilled-melons-warn.md b/contracts/.changeset/chilled-melons-warn.md new file mode 100644 index 00000000000..f94192bb60c --- /dev/null +++ b/contracts/.changeset/chilled-melons-warn.md @@ -0,0 +1,5 @@ +--- +'@chainlink/contracts': patch +--- + +#internal index don ID in ConfigSet event diff --git a/contracts/.changeset/chilly-rivers-study.md b/contracts/.changeset/chilly-rivers-study.md deleted file mode 100644 index 0bd5d713a1b..00000000000 --- a/contracts/.changeset/chilly-rivers-study.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@chainlink/contracts': patch ---- - -add capability registry comment explaining why we do not validate node operator name diff --git a/contracts/.changeset/cyan-apes-perform.md b/contracts/.changeset/cyan-apes-perform.md deleted file mode 100644 index b35f80a9814..00000000000 --- a/contracts/.changeset/cyan-apes-perform.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@chainlink/contracts': minor ---- - -#added EnumerableMapAddresses shared lib for AddressToAddress and AddressToBytes32 maps diff --git a/contracts/.changeset/dull-phones-retire.md b/contracts/.changeset/dull-phones-retire.md deleted file mode 100644 index be65a31fac4..00000000000 --- a/contracts/.changeset/dull-phones-retire.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@chainlink/contracts': patch ---- - -capability registry informational findings diff --git a/contracts/.changeset/eight-timers-sip.md b/contracts/.changeset/eight-timers-sip.md new file mode 100644 index 00000000000..3f81544e34f --- /dev/null +++ b/contracts/.changeset/eight-timers-sip.md @@ -0,0 +1,5 @@ +--- +'@chainlink/contracts': patch +--- + +Add new channel definitions config store contract for parallel compositions #added diff --git a/contracts/.changeset/eighty-ways-vanish.md b/contracts/.changeset/eighty-ways-vanish.md new file mode 100644 index 00000000000..3a48ca4e710 --- /dev/null +++ b/contracts/.changeset/eighty-ways-vanish.md @@ -0,0 +1,5 @@ +--- +'@chainlink/contracts': patch +--- + +Publish a comment in PR mentioning the actor and informing her about avilability of Slither reports. diff --git a/contracts/.changeset/empty-ants-suffer.md b/contracts/.changeset/empty-ants-suffer.md new file mode 100644 index 00000000000..8270da10f1e --- /dev/null +++ b/contracts/.changeset/empty-ants-suffer.md @@ -0,0 +1,5 @@ +--- +'@chainlink/contracts': patch +--- + +Added updateFromPrevious method to Functions ToS contract diff --git a/contracts/.changeset/few-camels-tan.md b/contracts/.changeset/few-camels-tan.md new file mode 100644 index 00000000000..ca2574171d5 --- /dev/null +++ b/contracts/.changeset/few-camels-tan.md @@ -0,0 +1,5 @@ +--- +'@chainlink/contracts': patch +--- + +bump dependencies diff --git a/contracts/.changeset/few-parents-punch.md b/contracts/.changeset/few-parents-punch.md new file mode 100644 index 00000000000..88a885606bf --- /dev/null +++ b/contracts/.changeset/few-parents-punch.md @@ -0,0 +1,8 @@ +--- +'@chainlink/contracts': patch +--- + +update comments + + +PR issue: SHIP-3557 diff --git a/contracts/.changeset/flat-turkeys-rule.md b/contracts/.changeset/flat-turkeys-rule.md new file mode 100644 index 00000000000..2dedbe653ed --- /dev/null +++ b/contracts/.changeset/flat-turkeys-rule.md @@ -0,0 +1,5 @@ +--- +'@chainlink/contracts': patch +--- + +#internal merge ccip contracts diff --git a/contracts/.changeset/fluffy-papayas-chew.md b/contracts/.changeset/fluffy-papayas-chew.md new file mode 100644 index 00000000000..aa7b145e8f6 --- /dev/null +++ b/contracts/.changeset/fluffy-papayas-chew.md @@ -0,0 +1,8 @@ +--- +'@chainlink/contracts': minor +--- + +#internal Change Chain Reader testing contract Triggered event for easier testing of filtering by non indexed evm data. + + +PR issue: BCFR-203 diff --git a/contracts/.changeset/forty-radios-brush.md b/contracts/.changeset/forty-radios-brush.md new file mode 100644 index 00000000000..5356ffedb1b --- /dev/null +++ b/contracts/.changeset/forty-radios-brush.md @@ -0,0 +1,8 @@ +--- +'@chainlink/contracts': patch +--- + +Add Configurator contract + + +PR issue: MERC-6185 diff --git a/contracts/.changeset/green-pigs-reflect.md b/contracts/.changeset/green-pigs-reflect.md deleted file mode 100644 index cb197a32bcf..00000000000 --- a/contracts/.changeset/green-pigs-reflect.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@chainlink/contracts": patch ---- - -add test for v23 #added diff --git a/contracts/.changeset/happy-plants-dance.md b/contracts/.changeset/happy-plants-dance.md deleted file mode 100644 index 1b8c7fcb669..00000000000 --- a/contracts/.changeset/happy-plants-dance.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@chainlink/contracts': patch ---- - -allow updating capabilities and to add/remove multiple capabilities at once from the capability registry diff --git a/contracts/.changeset/healthy-impalas-hammer.md b/contracts/.changeset/healthy-impalas-hammer.md deleted file mode 100644 index dbbef2fca28..00000000000 --- a/contracts/.changeset/healthy-impalas-hammer.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@chainlink/contracts': patch ---- - -remove tracking deprecated arrays diff --git a/contracts/.changeset/heavy-balloons-cheat.md b/contracts/.changeset/heavy-balloons-cheat.md new file mode 100644 index 00000000000..c0a39c5db7e --- /dev/null +++ b/contracts/.changeset/heavy-balloons-cheat.md @@ -0,0 +1,9 @@ +--- +"chainlink": patch +--- + +#added Add ZKSync L2EP SequencerUptimeFeed contract +#added Add ZKSync L2EP Validator contract + + +PR issue: SHIP-3004 diff --git a/contracts/.changeset/hip-comics-rhyme.md b/contracts/.changeset/hip-comics-rhyme.md deleted file mode 100644 index f1142821487..00000000000 --- a/contracts/.changeset/hip-comics-rhyme.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@chainlink/contracts": patch ---- - -track config count in DON struct diff --git a/contracts/.changeset/itchy-deers-deny.md b/contracts/.changeset/itchy-deers-deny.md new file mode 100644 index 00000000000..888d58ce311 --- /dev/null +++ b/contracts/.changeset/itchy-deers-deny.md @@ -0,0 +1,5 @@ +--- +"@chainlink/contracts": patch +--- + +More comprehensive & product-scoped Solidity Foundry pipeline diff --git a/contracts/.changeset/itchy-turtles-agree.md b/contracts/.changeset/itchy-turtles-agree.md new file mode 100644 index 00000000000..930ab850d9b --- /dev/null +++ b/contracts/.changeset/itchy-turtles-agree.md @@ -0,0 +1,5 @@ +--- +'@chainlink/contracts': minor +--- + +#internal Add an event with indexed topics that get hashed to Chain Reader Tester contract. diff --git a/contracts/.changeset/large-news-nail.md b/contracts/.changeset/large-news-nail.md deleted file mode 100644 index 016216426af..00000000000 --- a/contracts/.changeset/large-news-nail.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@chainlink/contracts": patch ---- - -Add Additional tests to the callWithExactGasLibrary to ensure proper gas usage diff --git a/contracts/.changeset/long-beans-turn.md b/contracts/.changeset/long-beans-turn.md deleted file mode 100644 index 3af5e4a2171..00000000000 --- a/contracts/.changeset/long-beans-turn.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@chainlink/contracts": patch ---- - -implement remove DONs in capability registry diff --git a/contracts/.changeset/long-jars-protect.md b/contracts/.changeset/long-jars-protect.md deleted file mode 100644 index 2e5a11e3c8b..00000000000 --- a/contracts/.changeset/long-jars-protect.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@chainlink/contracts': patch ---- - -update error message when node does not exist diff --git a/contracts/.changeset/loud-lobsters-guess.md b/contracts/.changeset/loud-lobsters-guess.md new file mode 100644 index 00000000000..e470267e4e4 --- /dev/null +++ b/contracts/.changeset/loud-lobsters-guess.md @@ -0,0 +1,5 @@ +--- +'@chainlink/contracts': patch +--- + +auto: create a replication from v2_3 to v2_3_zksync diff --git a/contracts/.changeset/mean-zoos-fly.md b/contracts/.changeset/mean-zoos-fly.md new file mode 100644 index 00000000000..72eb98198d0 --- /dev/null +++ b/contracts/.changeset/mean-zoos-fly.md @@ -0,0 +1,5 @@ +--- +'@chainlink/contracts': patch +--- + +add OZ v0.5 contracts diff --git a/contracts/.changeset/moody-days-share.md b/contracts/.changeset/moody-days-share.md deleted file mode 100644 index 6c0eb4780b4..00000000000 --- a/contracts/.changeset/moody-days-share.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@chainlink/contracts': patch ---- - -#internal stub of keystone feed consumer contract diff --git a/contracts/.changeset/nasty-llamas-prove.md b/contracts/.changeset/nasty-llamas-prove.md new file mode 100644 index 00000000000..dd344676808 --- /dev/null +++ b/contracts/.changeset/nasty-llamas-prove.md @@ -0,0 +1,7 @@ +--- +'@chainlink/contracts': patch +--- + +DEVSVCS-147: add a reentrancy guard for balance monitor + +PR issue: DEVSVCS-147 diff --git a/contracts/.changeset/nasty-tables-guess.md b/contracts/.changeset/nasty-tables-guess.md deleted file mode 100644 index c3c1df76cda..00000000000 --- a/contracts/.changeset/nasty-tables-guess.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@chainlink/contracts": patch ---- - -roundup #bugfix diff --git a/contracts/.changeset/neat-brooms-repeat.md b/contracts/.changeset/neat-brooms-repeat.md deleted file mode 100644 index 48188702bc3..00000000000 --- a/contracts/.changeset/neat-brooms-repeat.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@chainlink/contracts': minor ---- - -We have multiple validation use-cases on-chain which requires the inputs to be a set, sorted-set or we need to do subset checks.Adding a library for these validations diff --git a/contracts/.changeset/nice-planets-share.md b/contracts/.changeset/nice-planets-share.md new file mode 100644 index 00000000000..a8af56ac613 --- /dev/null +++ b/contracts/.changeset/nice-planets-share.md @@ -0,0 +1,5 @@ +--- +'@chainlink/contracts': minor +--- + +EnumerableMap Library for an Address to Bytes mapping diff --git a/contracts/.changeset/ninety-cobras-drive.md b/contracts/.changeset/ninety-cobras-drive.md deleted file mode 100644 index cd576624620..00000000000 --- a/contracts/.changeset/ninety-cobras-drive.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@chainlink/contracts": patch ---- - -relax pragma solidity version in VRF SubscriptionAPI.sol diff --git a/contracts/.changeset/ninety-wolves-sleep.md b/contracts/.changeset/ninety-wolves-sleep.md deleted file mode 100644 index 7b669388388..00000000000 --- a/contracts/.changeset/ninety-wolves-sleep.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@chainlink/contracts': patch ---- - -#internal internal-review-for-capability-registry diff --git a/contracts/.changeset/orange-plums-fold.md b/contracts/.changeset/orange-plums-fold.md new file mode 100644 index 00000000000..b6cf88c81b3 --- /dev/null +++ b/contracts/.changeset/orange-plums-fold.md @@ -0,0 +1,8 @@ +--- +'@chainlink/contracts': patch +--- + +Adding USDCReaderTester contract for CCIP integration tests #internal + + +CCIP-2881 \ No newline at end of file diff --git a/contracts/.changeset/orange-tips-attend.md b/contracts/.changeset/orange-tips-attend.md deleted file mode 100644 index 2b5fa8e88ed..00000000000 --- a/contracts/.changeset/orange-tips-attend.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@chainlink/contracts': patch ---- - -validate that a node is not part of a DON when removing diff --git a/contracts/.changeset/long-cups-perform.md b/contracts/.changeset/polite-masks-jog.md similarity index 100% rename from contracts/.changeset/long-cups-perform.md rename to contracts/.changeset/polite-masks-jog.md diff --git a/contracts/.changeset/new-bugs-draw.md b/contracts/.changeset/proud-pears-tie.md similarity index 100% rename from contracts/.changeset/new-bugs-draw.md rename to contracts/.changeset/proud-pears-tie.md diff --git a/contracts/.changeset/proud-seals-draw.md b/contracts/.changeset/proud-seals-draw.md deleted file mode 100644 index 6bda7ed255d..00000000000 --- a/contracts/.changeset/proud-seals-draw.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@chainlink/contracts": patch ---- - -move v23 contracts #bugfix diff --git a/contracts/.changeset/proud-turkeys-fold.md b/contracts/.changeset/proud-turkeys-fold.md deleted file mode 100644 index eab0c192497..00000000000 --- a/contracts/.changeset/proud-turkeys-fold.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@chainlink/contracts': patch ---- - -VRFV2Plus coordinator and wrapper split contracts between L1 and L2 chains #updated diff --git a/contracts/.changeset/quick-olives-accept.md b/contracts/.changeset/quick-olives-accept.md new file mode 100644 index 00000000000..31c59983e47 --- /dev/null +++ b/contracts/.changeset/quick-olives-accept.md @@ -0,0 +1,7 @@ +--- +'@chainlink/contracts': minor +--- + +#updated move latest ccip contracts code from ccip repo to chainlink repo + +PR issue: CCIP-2946 diff --git a/contracts/.changeset/quiet-crews-impress.md b/contracts/.changeset/quiet-crews-impress.md deleted file mode 100644 index 5310806f1c2..00000000000 --- a/contracts/.changeset/quiet-crews-impress.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@chainlink/contracts': patch ---- - -#internal Use audited version of OCR2Base.sol in OCR3Capability.sol diff --git a/contracts/.changeset/quiet-guests-march.md b/contracts/.changeset/quiet-guests-march.md deleted file mode 100644 index 40285829c1a..00000000000 --- a/contracts/.changeset/quiet-guests-march.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@chainlink/contracts": patch ---- - -Add update DON function to capability registry diff --git a/contracts/.changeset/odd-gorillas-develop.md b/contracts/.changeset/quiet-lamps-walk.md similarity index 100% rename from contracts/.changeset/odd-gorillas-develop.md rename to contracts/.changeset/quiet-lamps-walk.md diff --git a/contracts/.changeset/quiet-moles-retire.md b/contracts/.changeset/quiet-moles-retire.md new file mode 100644 index 00000000000..6351f36a16c --- /dev/null +++ b/contracts/.changeset/quiet-moles-retire.md @@ -0,0 +1,8 @@ +--- +'@chainlink/contracts': patch +--- + +Use reusable workflow for Solidity Artifacts pipeline, move some actions to chainlink-github-actions repository + + +PR issue: TT-1693 diff --git a/contracts/.changeset/rich-crabs-smoke.md b/contracts/.changeset/rich-crabs-smoke.md deleted file mode 100644 index fc33cf7d4e0..00000000000 --- a/contracts/.changeset/rich-crabs-smoke.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@chainlink/contracts': patch ---- - -#internal Keystone Forwarder and Feeds Consumer diff --git a/contracts/.changeset/rich-lamps-do.md b/contracts/.changeset/rich-lamps-do.md new file mode 100644 index 00000000000..3f432d3de6b --- /dev/null +++ b/contracts/.changeset/rich-lamps-do.md @@ -0,0 +1,5 @@ +--- +'@chainlink/contracts': patch +--- + +update zksync automation contract version and small fixes diff --git a/contracts/.changeset/selfish-files-learn.md b/contracts/.changeset/selfish-files-learn.md deleted file mode 100644 index 3d348d1d8d7..00000000000 --- a/contracts/.changeset/selfish-files-learn.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@chainlink/contracts": patch ---- - -add getters in capability registry diff --git a/contracts/.changeset/seven-apes-drop.md b/contracts/.changeset/seven-apes-drop.md deleted file mode 100644 index 2882975f663..00000000000 --- a/contracts/.changeset/seven-apes-drop.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@chainlink/contracts": patch ---- - -increase solhint max-warnings to 2 (from 0) to allow workflow to pass diff --git a/contracts/.changeset/seven-donkeys-live.md b/contracts/.changeset/seven-donkeys-live.md new file mode 100644 index 00000000000..141588f5b9f --- /dev/null +++ b/contracts/.changeset/seven-donkeys-live.md @@ -0,0 +1,5 @@ +--- +'@chainlink/contracts': patch +--- + +improve cron contracts imports diff --git a/contracts/.changeset/silent-ravens-lay.md b/contracts/.changeset/silent-ravens-lay.md deleted file mode 100644 index e987e9e0825..00000000000 --- a/contracts/.changeset/silent-ravens-lay.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@chainlink/contracts': patch ---- - -remove update capabilities from capability registry diff --git a/contracts/.changeset/red-wasps-behave.md b/contracts/.changeset/silver-pots-cover.md similarity index 100% rename from contracts/.changeset/red-wasps-behave.md rename to contracts/.changeset/silver-pots-cover.md diff --git a/contracts/.changeset/six-ears-sin.md b/contracts/.changeset/six-ears-sin.md deleted file mode 100644 index 186481a36e6..00000000000 --- a/contracts/.changeset/six-ears-sin.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@chainlink/contracts": patch ---- - -update ICapabilityConfiguration interface diff --git a/contracts/.changeset/slimy-pens-listen.md b/contracts/.changeset/slimy-pens-listen.md new file mode 100644 index 00000000000..ff81d222378 --- /dev/null +++ b/contracts/.changeset/slimy-pens-listen.md @@ -0,0 +1,5 @@ +--- +'@chainlink/contracts': patch +--- + +#internal prevent editing whether or not a DON accepts workflows diff --git a/contracts/.changeset/smart-rules-love.md b/contracts/.changeset/smart-rules-love.md deleted file mode 100644 index eb2542a6858..00000000000 --- a/contracts/.changeset/smart-rules-love.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@chainlink/contracts": patch ---- - -Added Base Sepolia to ChainUtils #changed diff --git a/contracts/.changeset/smart-trainers-begin.md b/contracts/.changeset/smart-trainers-begin.md deleted file mode 100644 index 5e76abd21ef..00000000000 --- a/contracts/.changeset/smart-trainers-begin.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@chainlink/contracts": patch ---- - -check data size #bugfix diff --git a/contracts/.changeset/smooth-years-reply.md b/contracts/.changeset/smooth-years-reply.md deleted file mode 100644 index 330310cb8d6..00000000000 --- a/contracts/.changeset/smooth-years-reply.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@chainlink/contracts": patch ---- - -link transfer status check #bugfix diff --git a/contracts/.changeset/sour-parents-explode.md b/contracts/.changeset/sour-parents-explode.md deleted file mode 100644 index ff5b52b98fe..00000000000 --- a/contracts/.changeset/sour-parents-explode.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@chainlink/contracts": patch ---- - -update node signer type diff --git a/contracts/.changeset/spicy-mirrors-care.md b/contracts/.changeset/spicy-mirrors-care.md deleted file mode 100644 index 93fba83b558..00000000000 --- a/contracts/.changeset/spicy-mirrors-care.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@chainlink/contracts': patch ---- - -#internal diff --git a/contracts/.changeset/strong-boats-brake.md b/contracts/.changeset/strong-boats-brake.md new file mode 100644 index 00000000000..4f1b780565f --- /dev/null +++ b/contracts/.changeset/strong-boats-brake.md @@ -0,0 +1,8 @@ +--- +'@chainlink/contracts': patch +--- + +Add linkage between PR and Jira's Solidity Review issue + + +PR issue: TT-1624 diff --git a/contracts/.changeset/stupid-lamps-sell.md b/contracts/.changeset/stupid-lamps-sell.md deleted file mode 100644 index ad5d70a04ab..00000000000 --- a/contracts/.changeset/stupid-lamps-sell.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@chainlink/contracts': patch ---- - -verify valid node operator when adding nodes to capability registry diff --git a/contracts/.changeset/sweet-geese-rescue.md b/contracts/.changeset/sweet-geese-rescue.md deleted file mode 100644 index ba0f2c916c4..00000000000 --- a/contracts/.changeset/sweet-geese-rescue.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@chainlink/contracts': patch ---- - -update uint256 to uint32 for donId declaration in capability config interface diff --git a/contracts/.changeset/swift-ads-stare.md b/contracts/.changeset/swift-ads-stare.md deleted file mode 100644 index 33a5d0cf16d..00000000000 --- a/contracts/.changeset/swift-ads-stare.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@chainlink/contracts': patch ---- - -return hashed capability ids diff --git a/contracts/.changeset/tall-donkeys-flow.md b/contracts/.changeset/tall-donkeys-flow.md new file mode 100644 index 00000000000..3753880baeb --- /dev/null +++ b/contracts/.changeset/tall-donkeys-flow.md @@ -0,0 +1,10 @@ +--- +'@chainlink/contracts': minor +--- + +#internal Updated ChainReaderTester to include dynamic and static nested structs in TestStruct + + +PR issue: BCFR-44 + +Solidity Review issue: BCFR-957 \ No newline at end of file diff --git a/contracts/.changeset/tender-comics-check.md b/contracts/.changeset/tender-comics-check.md new file mode 100644 index 00000000000..6ea48d92e4e --- /dev/null +++ b/contracts/.changeset/tender-comics-check.md @@ -0,0 +1,5 @@ +--- +'@chainlink/contracts': patch +--- + +#internal prevent reentrancy when configuring DON in capabilities registry diff --git a/contracts/.changeset/thirty-lamps-reply.md b/contracts/.changeset/thirty-lamps-reply.md new file mode 100644 index 00000000000..d8bcf8d4e83 --- /dev/null +++ b/contracts/.changeset/thirty-lamps-reply.md @@ -0,0 +1,5 @@ +--- +'@chainlink/contracts': patch +--- + +implement an auto registry for zksync with no forwarder interface change diff --git a/contracts/.changeset/three-stingrays-compete.md b/contracts/.changeset/three-stingrays-compete.md new file mode 100644 index 00000000000..613b2784657 --- /dev/null +++ b/contracts/.changeset/three-stingrays-compete.md @@ -0,0 +1,5 @@ +--- +'@chainlink/contracts': minor +--- + +add ccip contracts to the repo diff --git a/contracts/.changeset/tricky-comics-scream.md b/contracts/.changeset/tricky-comics-scream.md deleted file mode 100644 index f7cd1ceeab1..00000000000 --- a/contracts/.changeset/tricky-comics-scream.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@chainlink/contracts": patch ---- - -remove stale automation HH tests diff --git a/contracts/.changeset/tricky-meals-decide.md b/contracts/.changeset/tricky-meals-decide.md deleted file mode 100644 index afbb24ad9fd..00000000000 --- a/contracts/.changeset/tricky-meals-decide.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"@chainlink/contracts": patch ---- - -#bugfix -fix a funding bug in LinkAvailableBalanceMonitor diff --git a/contracts/.changeset/twenty-pears-battle.md b/contracts/.changeset/twenty-pears-battle.md new file mode 100644 index 00000000000..5a204f68891 --- /dev/null +++ b/contracts/.changeset/twenty-pears-battle.md @@ -0,0 +1,5 @@ +--- +'@chainlink/contracts': patch +--- + +update token transfer logic in weth9 diff --git a/contracts/.changeset/two-doors-dance.md b/contracts/.changeset/two-doors-dance.md deleted file mode 100644 index 93fba83b558..00000000000 --- a/contracts/.changeset/two-doors-dance.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@chainlink/contracts': patch ---- - -#internal diff --git a/contracts/.changeset/unlucky-rocks-marry.md b/contracts/.changeset/unlucky-rocks-marry.md new file mode 100644 index 00000000000..723bb1e130a --- /dev/null +++ b/contracts/.changeset/unlucky-rocks-marry.md @@ -0,0 +1,5 @@ +--- +'@chainlink/contracts': patch +--- + +#internal use ERC165Checker diff --git a/contracts/.changeset/witty-onions-relate.md b/contracts/.changeset/witty-onions-relate.md deleted file mode 100644 index 30d3da6df92..00000000000 --- a/contracts/.changeset/witty-onions-relate.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@chainlink/contracts': patch ---- - -#internal KeystoneFeedsConsumer bytes10 decoding bugfix diff --git a/contracts/.changeset/yellow-snails-wash.md b/contracts/.changeset/yellow-snails-wash.md deleted file mode 100644 index 479fedcbe4a..00000000000 --- a/contracts/.changeset/yellow-snails-wash.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@chainlink/contracts': patch ---- - -return don capability config contract config from capability registry diff --git a/contracts/.gas-snapshot b/contracts/.gas-snapshot new file mode 100644 index 00000000000..e793f8ce549 --- /dev/null +++ b/contracts/.gas-snapshot @@ -0,0 +1,142 @@ +ArbitrumCrossDomainForwarder_AcceptL1Ownership:test_CallableByPendingL1Owner() (gas: 37568) +ArbitrumCrossDomainForwarder_AcceptL1Ownership:test_NotCallableByNonPendingOwners() (gas: 12963) +ArbitrumCrossDomainForwarder_Constructor:test_InitialState() (gas: 22163) +ArbitrumCrossDomainForwarder_Forward:test_Forward() (gas: 47867) +ArbitrumCrossDomainForwarder_Forward:test_ForwardRevert() (gas: 22181) +ArbitrumCrossDomainForwarder_Forward:test_NotCallableByUnknownAddress() (gas: 16056) +ArbitrumCrossDomainForwarder_TransferL1Ownership:test_CallableByL1Owner() (gas: 41453) +ArbitrumCrossDomainForwarder_TransferL1Ownership:test_CallableByL1OwnerOrZeroAddress() (gas: 19290) +ArbitrumCrossDomainForwarder_TransferL1Ownership:test_NotCallableByL2Owner() (gas: 18637) +ArbitrumCrossDomainForwarder_TransferL1Ownership:test_NotCallableByNonOwners() (gas: 13242) +ArbitrumCrossDomainGovernor_AcceptL1Ownership:test_CallableByPendingL1Owner() (gas: 37568) +ArbitrumCrossDomainGovernor_AcceptL1Ownership:test_NotCallableByNonPendingOwners() (gas: 12963) +ArbitrumCrossDomainGovernor_Constructor:test_InitialState() (gas: 22186) +ArbitrumCrossDomainGovernor_Forward:test_CallableByL2Owner() (gas: 50003) +ArbitrumCrossDomainGovernor_Forward:test_Forward() (gas: 47896) +ArbitrumCrossDomainGovernor_Forward:test_ForwardRevert() (gas: 24326) +ArbitrumCrossDomainGovernor_Forward:test_NotCallableByUnknownAddress() (gas: 18233) +ArbitrumCrossDomainGovernor_ForwardDelegate:test_BubbleUpRevert() (gas: 19386) +ArbitrumCrossDomainGovernor_ForwardDelegate:test_CallableByCrossDomainMessengerAddressOrL1Owner() (gas: 60874) +ArbitrumCrossDomainGovernor_ForwardDelegate:test_CallableByL2Owner() (gas: 63003) +ArbitrumCrossDomainGovernor_ForwardDelegate:test_NotCallableByUnknownAddress() (gas: 18245) +ArbitrumCrossDomainGovernor_ForwardDelegate:test_RevertsBatchWhenOneCallFails() (gas: 64368) +ArbitrumCrossDomainGovernor_TransferL1Ownership:test_CallableByL1Owner() (gas: 41453) +ArbitrumCrossDomainGovernor_TransferL1Ownership:test_CallableByL1OwnerOrZeroAddress() (gas: 19290) +ArbitrumCrossDomainGovernor_TransferL1Ownership:test_NotCallableByL2Owner() (gas: 18637) +ArbitrumCrossDomainGovernor_TransferL1Ownership:test_NotCallableByNonOwners() (gas: 13242) +ArbitrumSequencerUptimeFeed_AggregatorV3Interface:test_AggregatorV3Interface() (gas: 104862) +ArbitrumSequencerUptimeFeed_AggregatorV3Interface:test_Return0WhenRoundDoesNotExistYet() (gas: 19967) +ArbitrumSequencerUptimeFeed_Constants:test_InitialState() (gas: 8518) +ArbitrumSequencerUptimeFeed_ProtectReadsOnAggregatorV2V3InterfaceFunctions:test_AggregatorV2V3InterfaceAllowReadsIfConsumingContractIsWhitelisted() (gas: 604370) +ArbitrumSequencerUptimeFeed_ProtectReadsOnAggregatorV2V3InterfaceFunctions:test_AggregatorV2V3InterfaceDisallowReadsIfConsumingContractIsNotWhitelisted() (gas: 574432) +ArbitrumSequencerUptimeFeed_UpdateStatus:test_IgnoreOutOfOrderUpdates() (gas: 99629) +ArbitrumSequencerUptimeFeed_UpdateStatus:test_RevertIfNotL2CrossDomainMessengerAddr() (gas: 15447) +ArbitrumSequencerUptimeFeed_UpdateStatus:test_UpdateStatusWhenStatusChangeAndNoTimeChange() (gas: 114625) +ArbitrumSequencerUptimeFeed_UpdateStatus:test_UpdateStatusWhenStatusChangeAndTimeChange() (gas: 114708) +ArbitrumValidator_Validate:test_PostSequencerOffline() (gas: 69086) +OptimismCrossDomainForwarder_AcceptL1Ownership:test_CallableByPendingL1Owner() (gas: 47160) +OptimismCrossDomainForwarder_AcceptL1Ownership:test_NotCallableByNonPendingOwners() (gas: 22160) +OptimismCrossDomainForwarder_Constructor:test_InitialState() (gas: 21998) +OptimismCrossDomainForwarder_Forward:test_Forward() (gas: 58281) +OptimismCrossDomainForwarder_Forward:test_ForwardRevert() (gas: 32560) +OptimismCrossDomainForwarder_Forward:test_NotCallableByUnknownAddress() (gas: 13867) +OptimismCrossDomainForwarder_TransferL1Ownership:test_CallableByL1Owner() (gas: 48933) +OptimismCrossDomainForwarder_TransferL1Ownership:test_CallableByL1OwnerOrZeroAddress() (gas: 28753) +OptimismCrossDomainForwarder_TransferL1Ownership:test_NotCallableByL2Owner() (gas: 16448) +OptimismCrossDomainForwarder_TransferL1Ownership:test_NotCallableByNonOwners() (gas: 11053) +OptimismCrossDomainGovernor_AcceptL1Ownership:test_CallableByPendingL1Owner() (gas: 47160) +OptimismCrossDomainGovernor_AcceptL1Ownership:test_NotCallableByNonPendingOwners() (gas: 22160) +OptimismCrossDomainGovernor_Constructor:test_InitialState() (gas: 22021) +OptimismCrossDomainGovernor_Forward:test_CallableByL2Owner() (gas: 47846) +OptimismCrossDomainGovernor_Forward:test_Forward() (gas: 58330) +OptimismCrossDomainGovernor_Forward:test_ForwardRevert() (gas: 32619) +OptimismCrossDomainGovernor_Forward:test_NotCallableByUnknownAddress() (gas: 16047) +OptimismCrossDomainGovernor_ForwardDelegate:test_BubbleUpRevert() (gas: 29189) +OptimismCrossDomainGovernor_ForwardDelegate:test_CallableByCrossDomainMessengerAddressOrL1Owner() (gas: 72942) +OptimismCrossDomainGovernor_ForwardDelegate:test_CallableByL2Owner() (gas: 72947) +OptimismCrossDomainGovernor_ForwardDelegate:test_NotCallableByUnknownAddress() (gas: 16059) +OptimismCrossDomainGovernor_ForwardDelegate:test_RevertsBatchWhenOneCallFails() (gas: 76156) +OptimismCrossDomainGovernor_TransferL1Ownership:test_CallableByL1Owner() (gas: 48933) +OptimismCrossDomainGovernor_TransferL1Ownership:test_CallableByL1OwnerOrZeroAddress() (gas: 28753) +OptimismCrossDomainGovernor_TransferL1Ownership:test_NotCallableByL2Owner() (gas: 16448) +OptimismCrossDomainGovernor_TransferL1Ownership:test_NotCallableByNonOwners() (gas: 11053) +OptimismSequencerUptimeFeed_AggregatorV3Interface:test_AggregatorV3Interface() (gas: 72400) +OptimismSequencerUptimeFeed_AggregatorV3Interface:test_RevertGetAnswerWhenRoundDoesNotExistYet() (gas: 17653) +OptimismSequencerUptimeFeed_AggregatorV3Interface:test_RevertGetRoundDataWhenRoundDoesNotExistYet() (gas: 17893) +OptimismSequencerUptimeFeed_AggregatorV3Interface:test_RevertGetTimestampWhenRoundDoesNotExistYet() (gas: 17642) +OptimismSequencerUptimeFeed_Constructor:test_InitialState() (gas: 22050) +OptimismSequencerUptimeFeed_ProtectReadsOnAggregatorV2V3InterfaceFunctions:test_AggregatorV2V3InterfaceAllowReadsIfConsumingContractIsWhitelisted() (gas: 601594) +OptimismSequencerUptimeFeed_ProtectReadsOnAggregatorV2V3InterfaceFunctions:test_AggregatorV2V3InterfaceDisallowReadsIfConsumingContractIsNotWhitelisted() (gas: 574437) +OptimismSequencerUptimeFeed_UpdateStatus:test_IgnoreOutOfOrderUpdates() (gas: 67873) +OptimismSequencerUptimeFeed_UpdateStatus:test_RevertIfNotL2CrossDomainMessengerAddr() (gas: 13079) +OptimismSequencerUptimeFeed_UpdateStatus:test_RevertIfNotL2CrossDomainMessengerAddrAndNotL1SenderAddr() (gas: 23542) +OptimismSequencerUptimeFeed_UpdateStatus:test_UpdateStatusWhenNoChange() (gas: 77322) +OptimismSequencerUptimeFeed_UpdateStatus:test_UpdateStatusWhenStatusChangeAndNoTimeChange() (gas: 96182) +OptimismSequencerUptimeFeed_UpdateStatus:test_UpdateStatusWhenStatusChangeAndTimeChange() (gas: 96265) +OptimismValidator_SetGasLimit:test_CorrectlyUpdatesTheGasLimit() (gas: 18671) +OptimismValidator_Validate:test_PostSequencerOffline() (gas: 74790) +OptimismValidator_Validate:test_PostSequencerStatusWhenThereIsNotStatusChange() (gas: 74869) +OptimismValidator_Validate:test_RevertsIfCalledByAnAccountWithNoAccess() (gas: 15571) +ScrollCrossDomainForwarder_AcceptL1Ownership:test_CallableByPendingL1Owner() (gas: 47255) +ScrollCrossDomainForwarder_AcceptL1Ownership:test_NotCallableByNonPendingOwners() (gas: 22212) +ScrollCrossDomainForwarder_Constructor:test_InitialState() (gas: 21674) +ScrollCrossDomainForwarder_Forward:test_Forward() (gas: 58348) +ScrollCrossDomainForwarder_Forward:test_ForwardRevert() (gas: 32618) +ScrollCrossDomainForwarder_Forward:test_NotCallableByUnknownAddress() (gas: 13867) +ScrollCrossDomainForwarder_TransferL1Ownership:test_CallableByL1Owner() (gas: 48999) +ScrollCrossDomainForwarder_TransferL1Ownership:test_CallableByL1OwnerOrZeroAddress() (gas: 28819) +ScrollCrossDomainForwarder_TransferL1Ownership:test_NotCallableByL2Owner() (gas: 16448) +ScrollCrossDomainForwarder_TransferL1Ownership:test_NotCallableByNonOwners() (gas: 11053) +ScrollCrossDomainGovernor_AcceptL1Ownership:test_CallableByPendingL1Owner() (gas: 47255) +ScrollCrossDomainGovernor_AcceptL1Ownership:test_NotCallableByNonPendingOwners() (gas: 22212) +ScrollCrossDomainGovernor_Constructor:test_InitialState() (gas: 21697) +ScrollCrossDomainGovernor_Forward:test_CallableByL2Owner() (gas: 47841) +ScrollCrossDomainGovernor_Forward:test_Forward() (gas: 58392) +ScrollCrossDomainGovernor_Forward:test_ForwardRevert() (gas: 32674) +ScrollCrossDomainGovernor_Forward:test_NotCallableByUnknownAddress() (gas: 16044) +ScrollCrossDomainGovernor_ForwardDelegate:test_BubbleUpRevert() (gas: 29250) +ScrollCrossDomainGovernor_ForwardDelegate:test_CallableByCrossDomainMessengerAddressOrL1Owner() (gas: 73009) +ScrollCrossDomainGovernor_ForwardDelegate:test_CallableByL2Owner() (gas: 73014) +ScrollCrossDomainGovernor_ForwardDelegate:test_NotCallableByUnknownAddress() (gas: 16056) +ScrollCrossDomainGovernor_ForwardDelegate:test_RevertsBatchWhenOneCallFails() (gas: 76224) +ScrollCrossDomainGovernor_TransferL1Ownership:test_CallableByL1Owner() (gas: 48999) +ScrollCrossDomainGovernor_TransferL1Ownership:test_CallableByL1OwnerOrZeroAddress() (gas: 28819) +ScrollCrossDomainGovernor_TransferL1Ownership:test_NotCallableByL2Owner() (gas: 16448) +ScrollCrossDomainGovernor_TransferL1Ownership:test_NotCallableByNonOwners() (gas: 11053) +ScrollSequencerUptimeFeed_AggregatorV3Interface:test_AggregatorV3Interface() (gas: 72423) +ScrollSequencerUptimeFeed_AggregatorV3Interface:test_RevertGetAnswerWhenRoundDoesNotExistYet() (gas: 17653) +ScrollSequencerUptimeFeed_AggregatorV3Interface:test_RevertGetRoundDataWhenRoundDoesNotExistYet() (gas: 17893) +ScrollSequencerUptimeFeed_AggregatorV3Interface:test_RevertGetTimestampWhenRoundDoesNotExistYet() (gas: 17642) +ScrollSequencerUptimeFeed_Constructor:test_InitialState() (gas: 173935) +ScrollSequencerUptimeFeed_ProtectReadsOnAggregatorV2V3InterfaceFunctions:test_AggregatorV2V3InterfaceAllowReadsIfConsumingContractIsWhitelisted() (gas: 601594) +ScrollSequencerUptimeFeed_ProtectReadsOnAggregatorV2V3InterfaceFunctions:test_AggregatorV2V3InterfaceDisallowReadsIfConsumingContractIsNotWhitelisted() (gas: 574437) +ScrollSequencerUptimeFeed_UpdateStatus:test_IgnoreOutOfOrderUpdates() (gas: 67919) +ScrollSequencerUptimeFeed_UpdateStatus:test_RevertIfNotL2CrossDomainMessengerAddr() (gas: 13079) +ScrollSequencerUptimeFeed_UpdateStatus:test_RevertIfNotL2CrossDomainMessengerAddrAndNotL1SenderAddr() (gas: 23542) +ScrollSequencerUptimeFeed_UpdateStatus:test_UpdateStatusWhenNoChange() (gas: 77368) +ScrollSequencerUptimeFeed_UpdateStatus:test_UpdateStatusWhenStatusChangeAndNoTimeChange() (gas: 96228) +ScrollSequencerUptimeFeed_UpdateStatus:test_UpdateStatusWhenStatusChangeAndTimeChange() (gas: 96311) +ScrollValidator_SetGasLimit:test_CorrectlyUpdatesTheGasLimit() (gas: 18805) +ScrollValidator_Validate:test_PostSequencerOffline() (gas: 78326) +ScrollValidator_Validate:test_PostSequencerStatusWhenThereIsNotStatusChange() (gas: 78411) +ScrollValidator_Validate:test_RevertsIfCalledByAnAccountWithNoAccess() (gas: 15571) +ZKSyncSequencerUptimeFeed_AggregatorV3Interface:test_AggregatorV3Interface() (gas: 67166) +ZKSyncSequencerUptimeFeed_AggregatorV3Interface:test_RevertGetAnswerWhenRoundDoesNotExistYet() (gas: 17653) +ZKSyncSequencerUptimeFeed_AggregatorV3Interface:test_RevertGetRoundDataWhenRoundDoesNotExistYet() (gas: 17893) +ZKSyncSequencerUptimeFeed_AggregatorV3Interface:test_RevertGetTimestampWhenRoundDoesNotExistYet() (gas: 17642) +ZKSyncSequencerUptimeFeed_Constructor:test_InitialState() (gas: 22054) +ZKSyncSequencerUptimeFeed_ProtectReadsOnAggregatorV2V3InterfaceFunctions:test_AggregatorV2V3InterfaceAllowReadsIfConsumingContractIsWhitelisted() (gas: 601614) +ZKSyncSequencerUptimeFeed_ProtectReadsOnAggregatorV2V3InterfaceFunctions:test_AggregatorV2V3InterfaceDisallowReadsIfConsumingContractIsNotWhitelisted() (gas: 574443) +ZKSyncSequencerUptimeFeed_UpdateStatus:test_IgnoreOutOfOrderUpdates() (gas: 61924) +ZKSyncSequencerUptimeFeed_UpdateStatus:test_RevertIfNotL2CrossDomainMessengerAddr() (gas: 13035) +ZKSyncSequencerUptimeFeed_UpdateStatus:test_UpdateStatusWhenNoChange() (gas: 71379) +ZKSyncSequencerUptimeFeed_UpdateStatus:test_UpdateStatusWhenStatusChangeAndNoTimeChange() (gas: 90241) +ZKSyncSequencerUptimeFeed_UpdateStatus:test_UpdateStatusWhenStatusChangeAndTimeChange() (gas: 90324) +ZKSyncValidator_Constructor:test_ConstructingRevertedWithInvalidChainId() (gas: 103725) +ZKSyncValidator_Constructor:test_ConstructingRevertedWithZeroL1BridgeAddress() (gas: 81440) +ZKSyncValidator_Constructor:test_ConstructingRevertedWithZeroL2UpdateFeedAddress() (gas: 81497) +ZKSyncValidator_GetChainId:test_CorrectlyGetsTheChainId() (gas: 8350) +ZKSyncValidator_GetSetL2GasPerPubdataByteLimit:test_CorrectlyGetsAndUpdatesTheGasPerPubdataByteLimit() (gas: 18915) +ZKSyncValidator_Validate:test_PostSequencerOffline() (gas: 52255) +ZKSyncValidator_Validate:test_PostSequencerStatusWhenThereIsNotStatusChange() (gas: 52355) +ZKSyncValidator_Validate:test_RevertsIfCalledByAnAccountWithNoAccess() (gas: 15644) \ No newline at end of file diff --git a/contracts/.husky/README.md b/contracts/.husky/README.md new file mode 100644 index 00000000000..846e5d3c3a3 --- /dev/null +++ b/contracts/.husky/README.md @@ -0,0 +1,37 @@ +# Husky git hooks +The folder contains [husky](https://github.com/typicode/husky) git hooks that automate pre-commit and pre-push commands. + +## Setup + +Create an `.env` file in this folder to enable hooks: + +```sh +# Can be left blank to compile everything +FOUNDRY_PROFILE=ccip +HUSKY_ENABLE_PUSH_HOOKS=true +HUSKY_ENABLE_COMMIT_HOOKS=true +UPSTREAM_BRANCH=origin/ccip-develop +``` + +```sh +# Automatically ran after pnpm install +pnpm prepare +``` + +### Script procedure + +The setup is done via the `prepare.sh` script, which installs husky and enables the hooks. + +The prepare step is skipped if we are in CI. This is checked via the `CI=true` flag, which is always set to true on GitHub actions. + +## Hooks & Scripts + +### Pre-commit +Runs [lint-staged](https://github.com/lint-staged/lint-staged), which automatically detects `.sol` file changes and applies `forge fmt` only on the changed files. + +Configured in `package.json` in the `lint-staged` field. + +### Pre-push +Runs forge build, test, solhint and optionally suggests to generate snapshots and wrappers. + +Due to a [git workflow limitation](https://stackoverflow.com/questions/21334493/git-commit-in-pre-push-hook), generating wrappers & snapshots requires resubmitting the push (via `--no-verify` or by skiping the snapshot / wrappers). diff --git a/contracts/.husky/pre-commit b/contracts/.husky/pre-commit new file mode 100644 index 00000000000..a411da15670 --- /dev/null +++ b/contracts/.husky/pre-commit @@ -0,0 +1,14 @@ +#!/bin/bash +set -e + +source contracts/.husky/.env + +# Only run hook on enabled +if ! [[ $HUSKY_ENABLE_COMMIT_HOOKS == "true" && -n $UPSTREAM_BRANCH ]]; then + exit 0 +fi + +cd contracts + +# Run lint steps +pnpm lint-staged -v diff --git a/contracts/.husky/pre-push b/contracts/.husky/pre-push new file mode 100644 index 00000000000..dfa33c39423 --- /dev/null +++ b/contracts/.husky/pre-push @@ -0,0 +1,47 @@ +#!/bin/bash +set -e + +source contracts/.husky/.env + +# Only run hook on enabled +if ! [[ $HUSKY_ENABLE_PUSH_HOOKS == "true" && -n $UPSTREAM_BRANCH ]]; then + exit 0 +fi + +# Skip on no changes +current_branch=$(git branch --show-current) +changes_root=$(git diff --name-only $UPSTREAM_BRANCH...$current_branch -- "contracts/") + +if ! [[ -n $changes_root ]]; then + echo "Pre-push hook for contracts skipped - no changes detected" + exit 0 +fi + +cd contracts + +FOUNDRY_PROFILE=$FOUNDRY_PROFILE forge build +FOUNDRY_PROFILE=$FOUNDRY_PROFILE forge test +pnpm solhint + +# Skip interactive commands if interactive mode (/dev/tty) is unavailable +# https://stackoverflow.com/a/69088164 +if sh -c ": >/dev/tty" >/dev/null 2>/dev/null; then + read -n1 -p "Re-generate snapshots & wrappers? (Y/n)" snapshot_answer < /dev/tty + echo $snapshot_answer + + if [ "$snapshot_answer" != "${snapshot_answer#[Yy]}" ] ;then + # Create gas snapshot & commit gas snapshot + make snapshot + make wrappers + + git add ./gas-snapshots + git add ../core/gethwrappers + + # Check if commit is successful (non-empty) + if git commit -m "chore: update gas snapshots and wrappers"; then + # The commit is not included - need to push again (https://stackoverflow.com/questions/21334493/git-commit-in-pre-push-hook) + printf "\033[0;31m Snapshot commit created - run git push again \033[1;33m(skip snapshot, or use the --no-verify push option)\n" + exit 1 + fi + fi +fi diff --git a/contracts/.husky/prepare.sh b/contracts/.husky/prepare.sh new file mode 100755 index 00000000000..ce10e6449e9 --- /dev/null +++ b/contracts/.husky/prepare.sh @@ -0,0 +1,19 @@ +#!/bin/bash +set -e + +# Detect if in CI to skip hooks +# https://docs.github.com/en/actions/learn-github-actions/variables#default-environment-variables +if [[ $CI == "true" ]]; then + exit 0 +fi + +# Skip hooks creation if unconfigured +if ! [ -f .husky/.env ]; then + printf "\033[1;33mNo .env file found in contracts/.husky, skipping hooks setup.\e[0m\n" + exit 0 +fi + +cd ../ +chmod +x ./contracts/.husky/*.sh +pnpm husky ./contracts/.husky +echo "Husky hooks prepared." diff --git a/contracts/.husky/verify-changeset.sh b/contracts/.husky/verify-changeset.sh new file mode 100755 index 00000000000..980b5e41823 --- /dev/null +++ b/contracts/.husky/verify-changeset.sh @@ -0,0 +1,20 @@ +#!/bin/bash +set -e + +# Determine the current branch +current_branch=$(git branch --show-current) +upstream_branch="origin/ccip-develop" + +# Compare the directory against the upstream branch +changes_root=$(git diff --name-only $upstream_branch...$current_branch -- ".changeset") + +if ! [ -n "$changes_root" ]; then + printf "\033[1;33mRoot changeset changes not found, Consider running pnpm changeset in the root directory if there is significant off-chain impact.\e[0m\n" +fi + +changes_contracts=$(git diff --name-only $upstream_branch...$current_branch -- "contracts/.changeset") + +if ! [ -n "$changes_contracts" ]; then + printf "\033[0;31mContracts changeset changes not found, Make sure to run & commit \033[1;33mpnpm changeset\033[0;31m in the contracts directory.\n" + exit 1 +fi diff --git a/contracts/.prettierignore b/contracts/.prettierignore index 7c3131db424..440cf95afa2 100644 --- a/contracts/.prettierignore +++ b/contracts/.prettierignore @@ -21,6 +21,7 @@ solc LinkToken.json typechain **/vendor +src/v0.8/ccip/** # Ignore TS definition and map files **/**.d.ts @@ -35,4 +36,4 @@ venv/ .solhint.json src/v0.8/mocks/FunctionsOracleEventsMock.sol -src/v0.8/mocks/FunctionsBillingRegistryEventsMock.sol \ No newline at end of file +src/v0.8/mocks/FunctionsBillingRegistryEventsMock.sol diff --git a/contracts/.prettierrc.js b/contracts/.prettierrc.js index 774a5e964e8..17662841223 100644 --- a/contracts/.prettierrc.js +++ b/contracts/.prettierrc.js @@ -5,6 +5,7 @@ module.exports = { endOfLine: 'auto', tabWidth: 2, trailingComma: 'all', + plugins: ['prettier-plugin-solidity'], overrides: [ { files: '*.sol', diff --git a/contracts/.solhintignore b/contracts/.solhintignore index bab41a57940..5ae38e28d96 100644 --- a/contracts/.solhintignore +++ b/contracts/.solhintignore @@ -1,6 +1,3 @@ -# 344 warnings -#./src/v0.8/automation - # Ignore frozen Automation code ./src/v0.8/automation/v1_2 ./src/v0.8/automation/interfaces/v1_2 @@ -39,7 +36,11 @@ ./src/v0.8/llo-feeds/test ./src/v0.8/vrf/testhelpers ./src/v0.8/functions/tests +./src/v0.8/ccip/test # Always ignore vendor ./src/v0.8/vendor ./node_modules/ + +# Ignore RMN contracts temporarily +./src/v0.8/ccip/rmn \ No newline at end of file diff --git a/contracts/.tool-versions b/contracts/.tool-versions new file mode 100644 index 00000000000..dfe63496b38 --- /dev/null +++ b/contracts/.tool-versions @@ -0,0 +1 @@ +nodejs 20.13.1 diff --git a/contracts/CHANGELOG.md b/contracts/CHANGELOG.md index ba6dabfeb05..01a9dd4b6c4 100644 --- a/contracts/CHANGELOG.md +++ b/contracts/CHANGELOG.md @@ -1,5 +1,106 @@ # @chainlink/contracts +## 1.2.0 - 2024-07-18 + +### Minor Changes + +- [#13428](https://github.com/smartcontractkit/chainlink/pull/13428) [`a02bb0a`](https://github.com/smartcontractkit/chainlink/commit/a02bb0a48cb78c815ec3a2f3bd351f2efc3869d7) Thanks [@elatoskinas](https://github.com/elatoskinas)! - #added EnumerableMapAddresses shared lib for AddressToAddress and AddressToBytes32 maps + +- [#13774](https://github.com/smartcontractkit/chainlink/pull/13774) [`b5c0ea9`](https://github.com/smartcontractkit/chainlink/commit/b5c0ea9f106ced6daf8e1f35e88bc39d7b82de28) Thanks [@0xsuryansh](https://github.com/0xsuryansh)! - We have multiple validation use-cases on-chain which requires the inputs to be a set, sorted-set or we need to do subset checks.Adding a library for these validations + +- [#13514](https://github.com/smartcontractkit/chainlink/pull/13514) [`f84a3f2`](https://github.com/smartcontractkit/chainlink/commit/f84a3f2f276847d26c94bf67215e2a3600951c9c) Thanks [@ilija42](https://github.com/ilija42)! - #internal Modify ChainReader tester contract. + +### Patch Changes + +- [#13368](https://github.com/smartcontractkit/chainlink/pull/13368) [`000f2cb`](https://github.com/smartcontractkit/chainlink/commit/000f2cb36b7d9b6d046d383c85996ae1ae7a606e) Thanks [@cds95](https://github.com/cds95)! - capability registry internal review + +- [#13546](https://github.com/smartcontractkit/chainlink/pull/13546) [`10ddafa`](https://github.com/smartcontractkit/chainlink/commit/10ddafaebedb94ad5a59968d19256b8c4592857f) Thanks [@cds95](https://github.com/cds95)! - upgrade keystone contracts to 0.8.24 + +- [#13376](https://github.com/smartcontractkit/chainlink/pull/13376) [`bb40d51`](https://github.com/smartcontractkit/chainlink/commit/bb40d51502487b010a1d6621db42458356dbbdc0) Thanks [@shileiwill](https://github.com/shileiwill)! - add events, add getter and add comments #bugfix + +- [#13368](https://github.com/smartcontractkit/chainlink/pull/13368) [`000f2cb`](https://github.com/smartcontractkit/chainlink/commit/000f2cb36b7d9b6d046d383c85996ae1ae7a606e) Thanks [@cds95](https://github.com/cds95)! - add capability registry comment explaining why we do not validate node operator name + +- [#13368](https://github.com/smartcontractkit/chainlink/pull/13368) [`000f2cb`](https://github.com/smartcontractkit/chainlink/commit/000f2cb36b7d9b6d046d383c85996ae1ae7a606e) Thanks [@cds95](https://github.com/cds95)! - capability registry informational findings + +- [#13644](https://github.com/smartcontractkit/chainlink/pull/13644) [`2ed4478`](https://github.com/smartcontractkit/chainlink/commit/2ed4478ecc7fa6bada1138d204c12236fe56a810) Thanks [@shileiwill](https://github.com/shileiwill)! - add test for v23 #added + +- [#13368](https://github.com/smartcontractkit/chainlink/pull/13368) [`000f2cb`](https://github.com/smartcontractkit/chainlink/commit/000f2cb36b7d9b6d046d383c85996ae1ae7a606e) Thanks [@cds95](https://github.com/cds95)! - allow updating capabilities and to add/remove multiple capabilities at once from the capability registry + +- [#13368](https://github.com/smartcontractkit/chainlink/pull/13368) [`000f2cb`](https://github.com/smartcontractkit/chainlink/commit/000f2cb36b7d9b6d046d383c85996ae1ae7a606e) Thanks [@cds95](https://github.com/cds95)! - remove tracking deprecated arrays + +- [#13183](https://github.com/smartcontractkit/chainlink/pull/13183) [`9630475`](https://github.com/smartcontractkit/chainlink/commit/96304756a77cdb2acf251d21d59b6aa8b55bf61a) Thanks [@cds95](https://github.com/cds95)! - track config count in DON struct + +- [#13326](https://github.com/smartcontractkit/chainlink/pull/13326) [`732eea0`](https://github.com/smartcontractkit/chainlink/commit/732eea0f834e1f84c3a7520e131698d38762c78b) Thanks [@jhweintraub](https://github.com/jhweintraub)! - Add Additional tests to the callWithExactGasLibrary to ensure proper gas usage + +- [#13183](https://github.com/smartcontractkit/chainlink/pull/13183) [`9630475`](https://github.com/smartcontractkit/chainlink/commit/96304756a77cdb2acf251d21d59b6aa8b55bf61a) Thanks [@cds95](https://github.com/cds95)! - implement remove DONs in capability registry + +- [#13425](https://github.com/smartcontractkit/chainlink/pull/13425) [`eeb363f`](https://github.com/smartcontractkit/chainlink/commit/eeb363f1230415dde573607a095b177c612d3bef) Thanks [@DeividasK](https://github.com/DeividasK)! - #internal + +- [#13453](https://github.com/smartcontractkit/chainlink/pull/13453) [`8c98c80`](https://github.com/smartcontractkit/chainlink/commit/8c98c80376c3b6d72bffeab62ee45a74449b6ef5) Thanks [@cds95](https://github.com/cds95)! - update error message when node does not exist + +- [#13366](https://github.com/smartcontractkit/chainlink/pull/13366) [`d53d6d0`](https://github.com/smartcontractkit/chainlink/commit/d53d6d08dac5d3ee27ae89012669c6c2455295c8) Thanks [@bolekk](https://github.com/bolekk)! - #internal stub of keystone feed consumer contract + +- [#13287](https://github.com/smartcontractkit/chainlink/pull/13287) [`8491b24`](https://github.com/smartcontractkit/chainlink/commit/8491b247cd5ff240d281ecfbabc0fe0fa19134f1) Thanks [@shileiwill](https://github.com/shileiwill)! - roundup #bugfix + +- [#13426](https://github.com/smartcontractkit/chainlink/pull/13426) [`592b2bb`](https://github.com/smartcontractkit/chainlink/commit/592b2bb5a84a0e8858f77c5faa99e881f911878c) Thanks [@archseer](https://github.com/archseer)! - #internal + +- [#13600](https://github.com/smartcontractkit/chainlink/pull/13600) [`4406364`](https://github.com/smartcontractkit/chainlink/commit/4406364702dd5af0b34c0397c00f8489510ecb11) Thanks [@jinhoonbang](https://github.com/jinhoonbang)! - relax pragma solidity version in VRF SubscriptionAPI.sol + +- [#13368](https://github.com/smartcontractkit/chainlink/pull/13368) [`000f2cb`](https://github.com/smartcontractkit/chainlink/commit/000f2cb36b7d9b6d046d383c85996ae1ae7a606e) Thanks [@cds95](https://github.com/cds95)! - #internal internal-review-for-capability-registry + +- [#13528](https://github.com/smartcontractkit/chainlink/pull/13528) [`95502ad`](https://github.com/smartcontractkit/chainlink/commit/95502ad2699d63891662594f70e82e76682f2ed8) Thanks [@DeividasK](https://github.com/DeividasK)! - #internal + +- [#13368](https://github.com/smartcontractkit/chainlink/pull/13368) [`000f2cb`](https://github.com/smartcontractkit/chainlink/commit/000f2cb36b7d9b6d046d383c85996ae1ae7a606e) Thanks [@cds95](https://github.com/cds95)! - validate that a node is not part of a DON when removing + +- [#13504](https://github.com/smartcontractkit/chainlink/pull/13504) [`815c5ea`](https://github.com/smartcontractkit/chainlink/commit/815c5ea8715462e00f6ea10cdc0b93ec3e1ba505) Thanks [@shileiwill](https://github.com/shileiwill)! - move v23 contracts #bugfix + +- [#13335](https://github.com/smartcontractkit/chainlink/pull/13335) [`697e469`](https://github.com/smartcontractkit/chainlink/commit/697e469e41e640c8c71214461426174340527b4b) Thanks [@ibrajer](https://github.com/ibrajer)! - VRFV2Plus coordinator and wrapper split contracts between L1 and L2 chains #updated + +- [#13487](https://github.com/smartcontractkit/chainlink/pull/13487) [`5e27da9`](https://github.com/smartcontractkit/chainlink/commit/5e27da95f09f21272e93f086bc2de5a9bc2ae399) Thanks [@bolekk](https://github.com/bolekk)! - #internal Use audited version of OCR2Base.sol in OCR3Capability.sol + +- [#13183](https://github.com/smartcontractkit/chainlink/pull/13183) [`9630475`](https://github.com/smartcontractkit/chainlink/commit/96304756a77cdb2acf251d21d59b6aa8b55bf61a) Thanks [@cds95](https://github.com/cds95)! - Add update DON function to capability registry + +- [#13566](https://github.com/smartcontractkit/chainlink/pull/13566) [`f1d478d`](https://github.com/smartcontractkit/chainlink/commit/f1d478d8bbba92f9753f7a1d6733ba4efd1f616a) Thanks [@DeividasK](https://github.com/DeividasK)! - #internal + +- [#13389](https://github.com/smartcontractkit/chainlink/pull/13389) [`3959091`](https://github.com/smartcontractkit/chainlink/commit/3959091d4f3925b64cb6b0b55b7f7c72a4f924b9) Thanks [@bolekk](https://github.com/bolekk)! - #internal Keystone Forwarder and Feeds Consumer + +- [#13183](https://github.com/smartcontractkit/chainlink/pull/13183) [`9630475`](https://github.com/smartcontractkit/chainlink/commit/96304756a77cdb2acf251d21d59b6aa8b55bf61a) Thanks [@cds95](https://github.com/cds95)! - add getters in capability registry + +- [#13815](https://github.com/smartcontractkit/chainlink/pull/13815) [`fb177f4`](https://github.com/smartcontractkit/chainlink/commit/fb177f4ee77898dd12e20499e421a4d591fb92ef) Thanks [@KuphJr](https://github.com/KuphJr)! - Implemented improved L1 fee calculation for L2 chains in Functions contracts + +- [#13237](https://github.com/smartcontractkit/chainlink/pull/13237) [`53312f0`](https://github.com/smartcontractkit/chainlink/commit/53312f01f3459408402ed97a9e3935ec63ccee7a) Thanks [@erikburt](https://github.com/erikburt)! - increase solhint max-warnings to 2 (from 0) to allow workflow to pass + +- [#13368](https://github.com/smartcontractkit/chainlink/pull/13368) [`000f2cb`](https://github.com/smartcontractkit/chainlink/commit/000f2cb36b7d9b6d046d383c85996ae1ae7a606e) Thanks [@cds95](https://github.com/cds95)! - remove update capabilities from capability registry + +- [#13183](https://github.com/smartcontractkit/chainlink/pull/13183) [`9630475`](https://github.com/smartcontractkit/chainlink/commit/96304756a77cdb2acf251d21d59b6aa8b55bf61a) Thanks [@cds95](https://github.com/cds95)! - update ICapabilityConfiguration interface + +- [#13216](https://github.com/smartcontractkit/chainlink/pull/13216) [`6099abb`](https://github.com/smartcontractkit/chainlink/commit/6099abbdbfb3ad396ca1ed5138ecd7a13159de19) Thanks [@ibrajer](https://github.com/ibrajer)! - Added Base Sepolia to ChainUtils #changed + +- [#13352](https://github.com/smartcontractkit/chainlink/pull/13352) [`33a9cdf`](https://github.com/smartcontractkit/chainlink/commit/33a9cdf8d7c42cab4682121b50d5fa12d9b5ff27) Thanks [@shileiwill](https://github.com/shileiwill)! - check data size #bugfix + +- [#13177](https://github.com/smartcontractkit/chainlink/pull/13177) [`0d58a8d`](https://github.com/smartcontractkit/chainlink/commit/0d58a8d5db24f42720226e73328e501637ba59c5) Thanks [@shileiwill](https://github.com/shileiwill)! - link transfer status check #bugfix + +- [#13183](https://github.com/smartcontractkit/chainlink/pull/13183) [`9630475`](https://github.com/smartcontractkit/chainlink/commit/96304756a77cdb2acf251d21d59b6aa8b55bf61a) Thanks [@cds95](https://github.com/cds95)! - update node signer type + +- [#13580](https://github.com/smartcontractkit/chainlink/pull/13580) [`0d4a3b2`](https://github.com/smartcontractkit/chainlink/commit/0d4a3b2cd8ff938ba018d982ef514c754a7df345) Thanks [@DeividasK](https://github.com/DeividasK)! - #internal + +- [#13368](https://github.com/smartcontractkit/chainlink/pull/13368) [`000f2cb`](https://github.com/smartcontractkit/chainlink/commit/000f2cb36b7d9b6d046d383c85996ae1ae7a606e) Thanks [@cds95](https://github.com/cds95)! - verify valid node operator when adding nodes to capability registry + +- [#13368](https://github.com/smartcontractkit/chainlink/pull/13368) [`000f2cb`](https://github.com/smartcontractkit/chainlink/commit/000f2cb36b7d9b6d046d383c85996ae1ae7a606e) Thanks [@cds95](https://github.com/cds95)! - update uint256 to uint32 for donId declaration in capability config interface + +- [#13453](https://github.com/smartcontractkit/chainlink/pull/13453) [`8c98c80`](https://github.com/smartcontractkit/chainlink/commit/8c98c80376c3b6d72bffeab62ee45a74449b6ef5) Thanks [@cds95](https://github.com/cds95)! - return hashed capability ids + +- [#13676](https://github.com/smartcontractkit/chainlink/pull/13676) [`ed6b9ad`](https://github.com/smartcontractkit/chainlink/commit/ed6b9ad7909e09d0ff9850b7a1e34a0137762642) Thanks [@RyanRHall](https://github.com/RyanRHall)! - remove stale automation HH tests + +- [#13364](https://github.com/smartcontractkit/chainlink/pull/13364) [`fc007a9`](https://github.com/smartcontractkit/chainlink/commit/fc007a94846c178bc9d5203dbff6b6b8c7546a71) Thanks [@FelixFan1992](https://github.com/FelixFan1992)! - #bugfix + fix a funding bug in LinkAvailableBalanceMonitor + +- [#13569](https://github.com/smartcontractkit/chainlink/pull/13569) [`f5a70eb`](https://github.com/smartcontractkit/chainlink/commit/f5a70eb09abc9a4d859442c9bd062a74a7ec9c54) Thanks [@DeividasK](https://github.com/DeividasK)! - #internal + +- [#13436](https://github.com/smartcontractkit/chainlink/pull/13436) [`f37afb9`](https://github.com/smartcontractkit/chainlink/commit/f37afb9ebaeda10f8b3873b069b8a824e60a81c3) Thanks [@bolekk](https://github.com/bolekk)! - #internal KeystoneFeedsConsumer bytes10 decoding bugfix + +- [#13368](https://github.com/smartcontractkit/chainlink/pull/13368) [`000f2cb`](https://github.com/smartcontractkit/chainlink/commit/000f2cb36b7d9b6d046d383c85996ae1ae7a606e) Thanks [@cds95](https://github.com/cds95)! - return don capability config contract config from capability registry + ## 1.1.1 - 2024-05-23 ### Patch Changes @@ -32,7 +133,6 @@ - [#13022](https://github.com/smartcontractkit/chainlink/pull/13022) [`2805fa6c9b`](https://github.com/smartcontractkit/chainlink/commit/2805fa6c9b469d535edcd3d66c08e1d22bbaa2d0) Thanks [@cds95](https://github.com/cds95)! - #internal - - [#12812](https://github.com/smartcontractkit/chainlink/pull/12812) [`5b33a3296f`](https://github.com/smartcontractkit/chainlink/commit/5b33a3296f895cec8a23ba2e235989868f398ddb) Thanks [@shileiwill](https://github.com/shileiwill)! - Support decimals #added - [#12979](https://github.com/smartcontractkit/chainlink/pull/12979) [`0c4c24ad8c`](https://github.com/smartcontractkit/chainlink/commit/0c4c24ad8c95e505cd2a29be711cc40e612658b0) Thanks [@cds95](https://github.com/cds95)! - Add function to remove node operators from capability registry diff --git a/contracts/GNUmakefile b/contracts/GNUmakefile index c3e69464698..862d75a432e 100644 --- a/contracts/GNUmakefile +++ b/contracts/GNUmakefile @@ -1,6 +1,6 @@ # ALL_FOUNDRY_PRODUCTS contains a list of all products that have a foundry -# profile defined and use the Foundry snapshots. -ALL_FOUNDRY_PRODUCTS = functions keystone l2ep llo-feeds operatorforwarder shared transmission +# profile defined and use the Foundry snapshots. +ALL_FOUNDRY_PRODUCTS = ccip functions keystone l2ep liquiditymanager llo-feeds operatorforwarder shared transmission # To make a snapshot for a specific product, either set the `FOUNDRY_PROFILE` env var # or call the target with `FOUNDRY_PROFILE=product` @@ -16,11 +16,11 @@ ALL_FOUNDRY_PRODUCTS = functions keystone l2ep llo-feeds operatorforwarder share # a static fuzz seed by default, flaky gas results per platform are still observed. .PHONY: snapshot snapshot: ## Make a snapshot for a specific product. - export FOUNDRY_PROFILE=$(FOUNDRY_PROFILE) && forge snapshot --nmt "testFuzz_\w{1,}?" --snap gas-snapshots/$(FOUNDRY_PROFILE).gas-snapshot + export FOUNDRY_PROFILE=$(FOUNDRY_PROFILE) && forge snapshot --nmt "test_?Fuzz_\w{1,}?" --snap gas-snapshots/$(FOUNDRY_PROFILE).gas-snapshot .PHONY: snapshot-diff snapshot-diff: ## Make a snapshot for a specific product. - export FOUNDRY_PROFILE=$(FOUNDRY_PROFILE) && forge snapshot --nmt "testFuzz_\w{1,}?" --diff gas-snapshots/$(FOUNDRY_PROFILE).gas-snapshot + export FOUNDRY_PROFILE=$(FOUNDRY_PROFILE) && forge snapshot --nmt "test_?Fuzz_\w{1,}?" --diff gas-snapshots/$(FOUNDRY_PROFILE).gas-snapshot .PHONY: snapshot-all @@ -43,13 +43,28 @@ mockery: $(mockery) ## Install mockery. .PHONY: foundry foundry: ## Install foundry. - foundryup --version nightly-de33b6af53005037b463318d2628b5cfcaf39916 + foundryup --version nightly-515a4cc8aba1627a717a1057ff4f09c8cd3bf51f .PHONY: foundry-refresh foundry-refresh: foundry git submodule deinit -f . git submodule update --init --recursive +ccip-precommit: export FOUNDRY_PROFILE=ccip +.PHONY: ccip-precommit +ccip-precommit: + forge test + make snapshot + forge fmt + pnpm solhint + +ccip-lcov: export FOUNDRY_PROFILE=ccip +.PHONY: ccip-lcov +ccip-lcov: + forge coverage --report lcov + ../tools/ci/ccip_lcov_prune ./lcov.info ./lcov.info.pruned + genhtml -o report lcov.info.pruned --branch-coverage + # To generate gethwrappers for a specific product, either set the `FOUNDRY_PROFILE` # env var or call the target with `FOUNDRY_PROFILE=product` # This uses FOUNDRY_PROFILE, even though it does support non-foundry products. This @@ -73,6 +88,16 @@ wrappers-all: pnpmdep mockery abigen ## Recompiles solidity contracts and their # go_generate contains a call to compile all contracts before generating wrappers go generate ../core/gethwrappers/go_generate.go +# Use this to generate compiled JSON artifacts for gauntlet-plus-plus. +# This is currently only used for CCIP. +# example: make artifact-generate contract=LockReleaseTokenPoolAndProxy solcversion=0.8.24 artifactpath=../../gauntlet-plus-plus/packages-ethereum/operations-ccip/src/artifacts/1.5.0/lock-release-token-pool-and-proxy.json +artifact-generate: export FOUNDRY_PROFILE=ccip +.PHONY: artifact-generate +artifact-generate: + chmod +x ./scripts/generate_compiled_json_ccip.sh + ./scripts/generate_compiled_json_ccip.sh $(contract) $(solcversion) $(artifactpath) + + help: @echo "" @echo " .__ .__ .__ .__ __" diff --git a/contracts/README.md b/contracts/README.md index 26b0a823298..182891ceef7 100644 --- a/contracts/README.md +++ b/contracts/README.md @@ -67,5 +67,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## License +Most of the contracts are licensed under the [MIT](https://choosealicense.com/licenses/mit/) license. +An exception to this is the ccip folder, which defaults to be licensed under the [BUSL-1.1](./src/v0.8/ccip/LICENSE.md) license, however, there are a few exceptions -[MIT](https://choosealicense.com/licenses/mit/) +- `src/v0.8/ccip/applications/*` is licensed under the [MIT](./src/v0.8/ccip/LICENSE-MIT.md) license +- `src/v0.8/ccip/interfaces/*` is licensed under the [MIT](./src/v0.8/ccip/LICENSE-MIT.md) license +- `src/v0.8/ccip/libraries/{Client.sol, Internal.sol}` is licensed under the [MIT](./src/v0.8/ccip/LICENSE-MIT.md) license \ No newline at end of file diff --git a/contracts/STYLE_GUIDE.md b/contracts/STYLE_GUIDE.md index b9294de5765..0f1370be3d7 100644 --- a/contracts/STYLE_GUIDE.md +++ b/contracts/STYLE_GUIDE.md @@ -1,7 +1,7 @@ # Structure -This guide is split into two sections: [Guidelines](#guidelines) and [Rules](#rules). -Guidelines are recommendations that should be followed but are hard to enforce in an automated way. +This guide is split into two sections: [Guidelines](#guidelines) and [Rules](#rules). +Guidelines are recommendations that should be followed but are hard to enforce in an automated way. Rules are all enforced through CI, this can be through Solhint rules or other tools. ## Background @@ -33,6 +33,7 @@ We will be looking into `forge fmt`, but for now, we still use `prettier`. This will help massively during audits and onboarding new team members. - Headers should be used to group functionality, the following header style and length are recommended. - Don’t use headers for a single function, or to say “getters”. Group by functionality e.g. the `Tokens and pools`, or `fees` logic within the CCIP OnRamp. +- Comments should start with a capital letter and end with a period. ```solidity // ================================================================ @@ -76,11 +77,11 @@ uint256 networkFeeUSDCents; // good struct FeeTokenConfigArgs { address token; // ────────────╮ Token address uint32 networkFeeUSD; // │ Flat network fee to charge for messages, multiples of 0.01 USD - // │ multiline comments should work like this. More fee info + // │ multiline comments should work like this. More fee info uint64 gasMultiplier; // ─────╯ Price multiplier for gas costs, 1e18 based so 11e17 = 10% extra cost uint64 premiumMultiplier; // ─╮ Multiplier for fee-token-specific premiums bool enabled; // ─────────────╯ Whether this fee token is enabled - uint256 fee; // The flat fee the user pays in juels + uint256 fee; // The flat fee the user pays in juels } ``` ## Functions @@ -132,7 +133,7 @@ assembly { // call and return whether we succeeded. ignore return data // call(gas,addr,value,argsOffset,argsLength,retOffset,retLength) success := call(gasLimit, target, 0, add(payload, 0x20), mload(payload), 0, 0) - + // limit our copy to maxReturnBytes bytes let toCopy := returndatasize() if gt(toCopy, maxReturnBytes) { @@ -219,7 +220,8 @@ The original error will not be human-readable in an off-chain explorer because i - Otherwise, Solidity contracts should have a pragma that is locked to a specific version. - Example: Most concrete contracts. - Avoid changing pragmas after the audit. Unless there is a bug that affects your contract, then you should try to stick to a known good pragma. In practice, this means we typically only support one (occasionally two) pragma for any “major”(minor by Semver naming) Solidity version. -- The current advised pragma is `0.8.19` or higher, lower versions should be avoided when starting a new project. Newer versions can be considered. +- The current advised pragma is `0.8.24`, lower versions should be avoided when starting a new project. Newer versions can be considered. + - Explicitly use the `Paris` hardfork when compiling with 0.8.24 to keep the bytecode compatible with all chains. - All contracts should have an SPDX license identifier. If unsure about which one to pick, please consult with legal. Most older contracts have been MIT, but some of the newer products have been using BUSL-1.1 @@ -242,7 +244,7 @@ contract AccessControlledFoo is Foo { contract OffchainAggregator is ITypeAndVersion { string public constant override typeAndVersion = "OffchainAggregator 1.0.0"; - + function getData() public returns(uint256) { return 4; } @@ -263,8 +265,8 @@ contract SuperDuperAggregator is ITypeAndVersion { All contracts will expose a `typeAndVersion` constant. The string has the following format: `-` with the `-dev` part only being applicable to contracts that have not been fully released. Try to fit it into 32 bytes to keep the impact on contract sizes minimal. -Solhint will complain about a public constant variable that isn’t FULL_CAPS without the solhint-disable comment. +Note that `ITypeAndVersion` should be used, not `TypeAndVersionInterface`. @@ -310,8 +312,8 @@ import {IPool} from "../interfaces/pools/IPool.sol"; import {AggregateRateLimiter} from "../AggregateRateLimiter.sol"; import {Client} from "../libraries/Client.sol"; -import {SafeERC20} from "../../vendor/openzeppelin-solidity/v4.8.0/contracts/token/ERC20/utils/SafeERC20.sol"; -import {IERC20} from "../../vendor/openzeppelin-solidity/v4.8.0/contracts/token/ERC20/IERC20.sol"; +import {SafeERC20} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/utils/SafeERC20.sol"; +import {IERC20} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/IERC20.sol"; ``` ## Variables @@ -418,4 +420,3 @@ function setConfig(uint64 _foo, uint64 _bar, uint64 _baz) external { ``` rule: `tbd` - diff --git a/contracts/configs/slither/.slither.config-artifacts.json b/contracts/configs/slither/.slither.config-artifacts.json new file mode 100644 index 00000000000..75071341f51 --- /dev/null +++ b/contracts/configs/slither/.slither.config-artifacts.json @@ -0,0 +1,3 @@ +{ + "filter_paths": "(openzeppelin|mocks/|test/|tests/|testhelpers)" +} diff --git a/contracts/configs/slither/.slither.config-ccip-pr.json b/contracts/configs/slither/.slither.config-ccip-pr.json new file mode 100644 index 00000000000..84d231ea07b --- /dev/null +++ b/contracts/configs/slither/.slither.config-ccip-pr.json @@ -0,0 +1,4 @@ +{ + "filter_paths": "(openzeppelin|mocks/|test/|tests/|testhelpers)", + "detectors_to_exclude": "pragma,solc-version,naming-convention,assembly,reentrancy-events,timestamp,calls-loop,unused-return" +} diff --git a/contracts/configs/slither/.slither.config-default-pr.json b/contracts/configs/slither/.slither.config-default-pr.json new file mode 100644 index 00000000000..1ef145a7954 --- /dev/null +++ b/contracts/configs/slither/.slither.config-default-pr.json @@ -0,0 +1,4 @@ +{ + "filter_paths": "(openzeppelin|mocks/|test/|tests/|testhelpers)", + "detectors_to_exclude": "pragma" +} diff --git a/contracts/foundry.toml b/contracts/foundry.toml index 08940b4e9ff..cab8b05ba92 100644 --- a/contracts/foundry.toml +++ b/contracts/foundry.toml @@ -16,6 +16,19 @@ gas_price = 1 block_timestamp = 1234567890 block_number = 12345 +[fmt] +tab_width = 2 +multiline_func_header = "params_first" +sort_imports = true +single_line_statement_blocks = "preserve" + +[profile.ccip] +solc_version = '0.8.24' +src = 'src/v0.8/ccip' +test = 'src/v0.8/ccip/test' +optimizer_runs = 3_600 +evm_version = 'paris' + [profile.functions] solc_version = '0.8.19' src = 'src/v0.8/functions/dev/v1_X' @@ -41,10 +54,10 @@ src = 'src/v0.8/automation' test = 'src/v0.8/automation/test' [profile.l2ep] +solc_version = '0.8.24' optimizer_runs = 1_000_000 src = 'src/v0.8/l2ep' test = 'src/v0.8/l2ep/test' -solc_version = '0.8.19' [profile.llo-feeds] optimizer_runs = 1_000_000 @@ -52,6 +65,13 @@ src = 'src/v0.8/llo-feeds' test = 'src/v0.8/llo-feeds/test' solc_version = '0.8.19' +[profile.liquiditymanager] +optimizer_runs = 1000000 +src = 'src/v0.8/liquiditymanager' +test = 'src/v0.8/liquiditymanager/test' +solc_version = '0.8.24' +evm_version = 'paris' + [profile.keystone] optimizer_runs = 1_000_000 solc_version = '0.8.24' diff --git a/contracts/gas-snapshots/ccip.gas-snapshot b/contracts/gas-snapshots/ccip.gas-snapshot new file mode 100644 index 00000000000..d6841850728 --- /dev/null +++ b/contracts/gas-snapshots/ccip.gas-snapshot @@ -0,0 +1,983 @@ +ARMProxyStandaloneTest:test_ARMCallEmptyContractRevert() (gas: 19600) +ARMProxyStandaloneTest:test_Constructor() (gas: 374544) +ARMProxyStandaloneTest:test_SetARM() (gas: 16494) +ARMProxyStandaloneTest:test_SetARMzero() (gas: 11216) +ARMProxyTest:test_ARMCallRevertReasonForwarded() (gas: 47793) +ARMProxyTest:test_ARMIsBlessed_Success() (gas: 36269) +ARMProxyTest:test_ARMIsCursed_Success() (gas: 49740) +AggregateTokenLimiter_constructor:test_Constructor_Success() (gas: 26920) +AggregateTokenLimiter_getTokenBucket:test_GetTokenBucket_Success() (gas: 19691) +AggregateTokenLimiter_getTokenBucket:test_Refill_Success() (gas: 40911) +AggregateTokenLimiter_getTokenBucket:test_TimeUnderflow_Revert() (gas: 15368) +AggregateTokenLimiter_getTokenLimitAdmin:test_GetTokenLimitAdmin_Success() (gas: 10531) +AggregateTokenLimiter_getTokenValue:test_GetTokenValue_Success() (gas: 19668) +AggregateTokenLimiter_getTokenValue:test_NoTokenPrice_Reverts() (gas: 21253) +AggregateTokenLimiter_rateLimitValue:test_AggregateValueMaxCapacityExceeded_Revert() (gas: 16418) +AggregateTokenLimiter_rateLimitValue:test_RateLimitValueSuccess_gas() (gas: 18306) +AggregateTokenLimiter_setAdmin:test_OnlyOwnerOrAdmin_Revert() (gas: 13048) +AggregateTokenLimiter_setAdmin:test_Owner_Success() (gas: 18989) +AggregateTokenLimiter_setRateLimiterConfig:test_OnlyOnlyCallableByAdminOrOwner_Revert() (gas: 17480) +AggregateTokenLimiter_setRateLimiterConfig:test_Owner_Success() (gas: 30062) +AggregateTokenLimiter_setRateLimiterConfig:test_TokenLimitAdmin_Success() (gas: 32071) +BurnFromMintTokenPool_lockOrBurn:test_ChainNotAllowed_Revert() (gas: 28773) +BurnFromMintTokenPool_lockOrBurn:test_PoolBurnRevertNotHealthy_Revert() (gas: 55115) +BurnFromMintTokenPool_lockOrBurn:test_PoolBurn_Success() (gas: 243529) +BurnFromMintTokenPool_lockOrBurn:test_Setup_Success() (gas: 23947) +BurnMintTokenPool_lockOrBurn:test_ChainNotAllowed_Revert() (gas: 27534) +BurnMintTokenPool_lockOrBurn:test_PoolBurnRevertNotHealthy_Revert() (gas: 55115) +BurnMintTokenPool_lockOrBurn:test_PoolBurn_Success() (gas: 241420) +BurnMintTokenPool_lockOrBurn:test_Setup_Success() (gas: 17677) +BurnMintTokenPool_releaseOrMint:test_ChainNotAllowed_Revert() (gas: 28757) +BurnMintTokenPool_releaseOrMint:test_PoolMintNotHealthy_Revert() (gas: 56190) +BurnMintTokenPool_releaseOrMint:test_PoolMint_Success() (gas: 112319) +BurnWithFromMintTokenPool_lockOrBurn:test_ChainNotAllowed_Revert() (gas: 28773) +BurnWithFromMintTokenPool_lockOrBurn:test_PoolBurnRevertNotHealthy_Revert() (gas: 55115) +BurnWithFromMintTokenPool_lockOrBurn:test_PoolBurn_Success() (gas: 243556) +BurnWithFromMintTokenPool_lockOrBurn:test_Setup_Success() (gas: 23951) +CCIPClientExample_sanity:test_ImmutableExamples_Success() (gas: 2132690) +CCIPConfigSetup:test_getCapabilityConfiguration_Success() (gas: 9539) +CCIPConfig_ConfigStateMachine:test__computeConfigDigest_Success() (gas: 66088) +CCIPConfig_ConfigStateMachine:test__computeNewConfigWithMeta_InitToRunning_Success() (gas: 357846) +CCIPConfig_ConfigStateMachine:test__computeNewConfigWithMeta_RunningToStaging_Success() (gas: 474512) +CCIPConfig_ConfigStateMachine:test__computeNewConfigWithMeta_StagingToRunning_Success() (gas: 441765) +CCIPConfig_ConfigStateMachine:test__groupByPluginType_TooManyOCR3Configs_Reverts() (gas: 33798) +CCIPConfig_ConfigStateMachine:test__groupByPluginType_threeCommitConfigs_Reverts() (gas: 56870) +CCIPConfig_ConfigStateMachine:test__groupByPluginType_threeExecutionConfigs_Reverts() (gas: 56790) +CCIPConfig_ConfigStateMachine:test__stateFromConfigLength_Success() (gas: 11701) +CCIPConfig_ConfigStateMachine:test__validateConfigStateTransition_Success() (gas: 8762) +CCIPConfig_ConfigStateMachine:test__validateConfigTransition_InitToRunning_Success() (gas: 309581) +CCIPConfig_ConfigStateMachine:test__validateConfigTransition_InitToRunning_WrongConfigCount_Reverts() (gas: 45877) +CCIPConfig_ConfigStateMachine:test__validateConfigTransition_NonExistentConfigTransition_Reverts() (gas: 29698) +CCIPConfig_ConfigStateMachine:test__validateConfigTransition_RunningToStaging_Success() (gas: 369916) +CCIPConfig_ConfigStateMachine:test__validateConfigTransition_RunningToStaging_WrongConfigCount_Reverts() (gas: 111436) +CCIPConfig_ConfigStateMachine:test__validateConfigTransition_RunningToStaging_WrongConfigDigestBlueGreen_Reverts() (gas: 145550) +CCIPConfig_ConfigStateMachine:test__validateConfigTransition_StagingToRunning_Success() (gas: 369692) +CCIPConfig_ConfigStateMachine:test__validateConfigTransition_StagingToRunning_WrongConfigDigest_Reverts() (gas: 145617) +CCIPConfig_ConfigStateMachine:test_getCapabilityConfiguration_Success() (gas: 9627) +CCIPConfig_beforeCapabilityConfigSet:test_beforeCapabilityConfigSet_CommitAndExecConfig_Success() (gas: 1752378) +CCIPConfig_beforeCapabilityConfigSet:test_beforeCapabilityConfigSet_CommitConfigOnly_Success() (gas: 1018901) +CCIPConfig_beforeCapabilityConfigSet:test_beforeCapabilityConfigSet_ExecConfigOnly_Success() (gas: 1018932) +CCIPConfig_beforeCapabilityConfigSet:test_beforeCapabilityConfigSet_OnlyCapabilitiesRegistryCanCall_Reverts() (gas: 9599) +CCIPConfig_beforeCapabilityConfigSet:test_beforeCapabilityConfigSet_ZeroLengthConfig_Success() (gas: 15984) +CCIPConfig_beforeCapabilityConfigSet:test_getCapabilityConfiguration_Success() (gas: 9627) +CCIPConfig_chainConfig:test__applyChainConfigUpdates_FChainNotPositive_Reverts() (gas: 184705) +CCIPConfig_chainConfig:test_applyChainConfigUpdates_addChainConfigs_Success() (gas: 344873) +CCIPConfig_chainConfig:test_applyChainConfigUpdates_nodeNotInRegistry_Reverts() (gas: 20307) +CCIPConfig_chainConfig:test_applyChainConfigUpdates_removeChainConfigs_Success() (gas: 267534) +CCIPConfig_chainConfig:test_applyChainConfigUpdates_selectorNotFound_Reverts() (gas: 14807) +CCIPConfig_chainConfig:test_getCapabilityConfiguration_Success() (gas: 9648) +CCIPConfig_chainConfig:test_getPaginatedCCIPConfigs_Success() (gas: 370227) +CCIPConfig_constructor:test_constructor_Success() (gas: 3397350) +CCIPConfig_constructor:test_constructor_ZeroAddressNotAllowed_Revert() (gas: 61507) +CCIPConfig_updatePluginConfig:test__updatePluginConfig_InitToRunning_Success() (gas: 1008218) +CCIPConfig_updatePluginConfig:test__updatePluginConfig_InvalidConfigLength_Reverts() (gas: 25563) +CCIPConfig_updatePluginConfig:test__updatePluginConfig_InvalidConfigStateTransition_Reverts() (gas: 21781) +CCIPConfig_updatePluginConfig:test__updatePluginConfig_RunningToStaging_Success() (gas: 1895343) +CCIPConfig_updatePluginConfig:test__updatePluginConfig_StagingToRunning_Success() (gas: 2464900) +CCIPConfig_updatePluginConfig:test_getCapabilityConfiguration_Success() (gas: 9627) +CCIPConfig_validateConfig:test__validateConfig_ABIEncodedAddress_OfframpAddressCannotBeZero_Reverts() (gas: 290657) +CCIPConfig_validateConfig:test__validateConfig_ChainSelectorNotFound_Reverts() (gas: 293370) +CCIPConfig_validateConfig:test__validateConfig_ChainSelectorNotSet_Reverts() (gas: 290290) +CCIPConfig_validateConfig:test__validateConfig_FMustBePositive_Reverts() (gas: 291497) +CCIPConfig_validateConfig:test__validateConfig_FTooHigh_Reverts() (gas: 291595) +CCIPConfig_validateConfig:test__validateConfig_NodeNotInRegistry_Reverts() (gas: 344569) +CCIPConfig_validateConfig:test__validateConfig_NotEnoughTransmitters_Reverts() (gas: 1207267) +CCIPConfig_validateConfig:test__validateConfig_OfframpAddressCannotBeZero_Reverts() (gas: 290373) +CCIPConfig_validateConfig:test__validateConfig_P2PIdsLengthNotMatching_Reverts() (gas: 292270) +CCIPConfig_validateConfig:test__validateConfig_Success() (gas: 299419) +CCIPConfig_validateConfig:test__validateConfig_TooManySigners_Reverts() (gas: 492913) +CCIPConfig_validateConfig:test_getCapabilityConfiguration_Success() (gas: 9606) +CommitStore_constructor:test_Constructor_Success() (gas: 3091326) +CommitStore_isUnpausedAndRMNHealthy:test_RMN_Success() (gas: 73420) +CommitStore_report:test_InvalidIntervalMinLargerThanMax_Revert() (gas: 28670) +CommitStore_report:test_InvalidInterval_Revert() (gas: 28610) +CommitStore_report:test_InvalidRootRevert() (gas: 27843) +CommitStore_report:test_OnlyGasPriceUpdates_Success() (gas: 53275) +CommitStore_report:test_OnlyPriceUpdateStaleReport_Revert() (gas: 59071) +CommitStore_report:test_OnlyTokenPriceUpdates_Success() (gas: 53273) +CommitStore_report:test_Paused_Revert() (gas: 21259) +CommitStore_report:test_ReportAndPriceUpdate_Success() (gas: 84264) +CommitStore_report:test_ReportOnlyRootSuccess_gas() (gas: 56249) +CommitStore_report:test_RootAlreadyCommitted_Revert() (gas: 63969) +CommitStore_report:test_StaleReportWithRoot_Success() (gas: 119364) +CommitStore_report:test_Unhealthy_Revert() (gas: 44751) +CommitStore_report:test_ValidPriceUpdateThenStaleReportWithRoot_Success() (gas: 100752) +CommitStore_report:test_ZeroEpochAndRound_Revert() (gas: 27626) +CommitStore_resetUnblessedRoots:test_OnlyOwner_Revert() (gas: 11325) +CommitStore_resetUnblessedRoots:test_ResetUnblessedRoots_Success() (gas: 143718) +CommitStore_setDynamicConfig:test_InvalidCommitStoreConfig_Revert() (gas: 37263) +CommitStore_setDynamicConfig:test_OnlyOwner_Revert() (gas: 37399) +CommitStore_setDynamicConfig:test_PriceEpochCleared_Success() (gas: 129098) +CommitStore_setLatestPriceEpochAndRound:test_OnlyOwner_Revert() (gas: 11048) +CommitStore_setLatestPriceEpochAndRound:test_SetLatestPriceEpochAndRound_Success() (gas: 20642) +CommitStore_setMinSeqNr:test_OnlyOwner_Revert() (gas: 11047) +CommitStore_verify:test_Blessed_Success() (gas: 96389) +CommitStore_verify:test_NotBlessed_Success() (gas: 61374) +CommitStore_verify:test_Paused_Revert() (gas: 18496) +CommitStore_verify:test_TooManyLeaves_Revert() (gas: 36785) +DefensiveExampleTest:test_HappyPath_Success() (gas: 200018) +DefensiveExampleTest:test_Recovery() (gas: 424256) +E2E:test_E2E_3MessagesSuccess_gas() (gas: 1100023) +EVM2EVMOffRamp__releaseOrMintToken:test__releaseOrMintToken_NotACompatiblePool_Revert() (gas: 37782) +EVM2EVMOffRamp__releaseOrMintToken:test__releaseOrMintToken_Success() (gas: 103730) +EVM2EVMOffRamp__releaseOrMintToken:test__releaseOrMintToken_TokenHandlingError_transfer_Revert() (gas: 85255) +EVM2EVMOffRamp__releaseOrMintToken:test_releaseOrMintToken_InvalidDataLength_Revert() (gas: 36789) +EVM2EVMOffRamp__releaseOrMintToken:test_releaseOrMintToken_ReleaseOrMintBalanceMismatch_Revert() (gas: 94299) +EVM2EVMOffRamp__releaseOrMintToken:test_releaseOrMintToken_TokenHandlingError_BalanceOf_Revert() (gas: 39765) +EVM2EVMOffRamp__releaseOrMintToken:test_releaseOrMintToken_skip_ReleaseOrMintBalanceMismatch_if_pool_Revert() (gas: 86559) +EVM2EVMOffRamp__releaseOrMintTokens:test_OverValueWithARLOff_Success() (gas: 385246) +EVM2EVMOffRamp__releaseOrMintTokens:test_PriceNotFoundForToken_Reverts() (gas: 141905) +EVM2EVMOffRamp__releaseOrMintTokens:test_RateLimitErrors_Reverts() (gas: 803071) +EVM2EVMOffRamp__releaseOrMintTokens:test_TokenHandlingError_Reverts() (gas: 179244) +EVM2EVMOffRamp__releaseOrMintTokens:test__releaseOrMintTokens_NotACompatiblePool_Reverts() (gas: 29243) +EVM2EVMOffRamp__releaseOrMintTokens:test_releaseOrMintTokens_InvalidDataLengthReturnData_Revert() (gas: 66444) +EVM2EVMOffRamp__releaseOrMintTokens:test_releaseOrMintTokens_InvalidEVMAddress_Revert() (gas: 43320) +EVM2EVMOffRamp__releaseOrMintTokens:test_releaseOrMintTokens_Success() (gas: 210968) +EVM2EVMOffRamp__releaseOrMintTokens:test_releaseOrMintTokens_destDenominatedDecimals_Success() (gas: 222232) +EVM2EVMOffRamp__report:test_Report_Success() (gas: 126640) +EVM2EVMOffRamp__trialExecute:test_RateLimitError_Success() (gas: 237791) +EVM2EVMOffRamp__trialExecute:test_TokenHandlingErrorIsCaught_Success() (gas: 246391) +EVM2EVMOffRamp__trialExecute:test_TokenPoolIsNotAContract_Success() (gas: 329828) +EVM2EVMOffRamp__trialExecute:test_trialExecute_Success() (gas: 312265) +EVM2EVMOffRamp_ccipReceive:test_Reverts() (gas: 17033) +EVM2EVMOffRamp_constructor:test_CommitStoreAlreadyInUse_Revert() (gas: 153727) +EVM2EVMOffRamp_constructor:test_Constructor_Success() (gas: 5665956) +EVM2EVMOffRamp_constructor:test_ZeroOnRampAddress_Revert() (gas: 144461) +EVM2EVMOffRamp_execute:test_EmptyReport_Revert() (gas: 21315) +EVM2EVMOffRamp_execute:test_InvalidMessageId_Revert() (gas: 36429) +EVM2EVMOffRamp_execute:test_InvalidSourceChain_Revert() (gas: 51598) +EVM2EVMOffRamp_execute:test_InvalidSourcePoolAddress_Success() (gas: 473329) +EVM2EVMOffRamp_execute:test_ManualExecutionNotYetEnabled_Revert() (gas: 47668) +EVM2EVMOffRamp_execute:test_MessageTooLarge_Revert() (gas: 152356) +EVM2EVMOffRamp_execute:test_Paused_Revert() (gas: 102842) +EVM2EVMOffRamp_execute:test_ReceiverError_Success() (gas: 163810) +EVM2EVMOffRamp_execute:test_RetryFailedMessageWithoutManualExecution_Success() (gas: 178205) +EVM2EVMOffRamp_execute:test_RootNotCommitted_Revert() (gas: 42539) +EVM2EVMOffRamp_execute:test_SingleMessageNoTokensUnordered_Success() (gas: 157347) +EVM2EVMOffRamp_execute:test_SingleMessageNoTokens_Success() (gas: 172692) +EVM2EVMOffRamp_execute:test_SingleMessageToNonCCIPReceiver_Success() (gas: 247069) +EVM2EVMOffRamp_execute:test_SingleMessagesNoTokensSuccess_gas() (gas: 113839) +EVM2EVMOffRamp_execute:test_SkippedIncorrectNonceStillExecutes_Success() (gas: 407451) +EVM2EVMOffRamp_execute:test_SkippedIncorrectNonce_Success() (gas: 54096) +EVM2EVMOffRamp_execute:test_StrictUntouchedToSuccess_Success() (gas: 131053) +EVM2EVMOffRamp_execute:test_TokenDataMismatch_Revert() (gas: 52087) +EVM2EVMOffRamp_execute:test_TwoMessagesWithTokensAndGE_Success() (gas: 563391) +EVM2EVMOffRamp_execute:test_TwoMessagesWithTokensSuccess_gas() (gas: 494179) +EVM2EVMOffRamp_execute:test_UnexpectedTokenData_Revert() (gas: 35380) +EVM2EVMOffRamp_execute:test_Unhealthy_Revert() (gas: 544641) +EVM2EVMOffRamp_execute:test_UnsupportedNumberOfTokens_Revert() (gas: 64323) +EVM2EVMOffRamp_execute:test__execute_SkippedAlreadyExecutedMessageUnordered_Success() (gas: 122322) +EVM2EVMOffRamp_execute:test__execute_SkippedAlreadyExecutedMessage_Success() (gas: 142532) +EVM2EVMOffRamp_execute:test_execute_RouterYULCall_Success() (gas: 427328) +EVM2EVMOffRamp_executeSingleMessage:test_MessageSender_Revert() (gas: 18502) +EVM2EVMOffRamp_executeSingleMessage:test_NonContractWithTokens_Success() (gas: 278106) +EVM2EVMOffRamp_executeSingleMessage:test_NonContract_Success() (gas: 18668) +EVM2EVMOffRamp_executeSingleMessage:test_TokenHandlingError_Revert() (gas: 223921) +EVM2EVMOffRamp_executeSingleMessage:test_ZeroGasDONExecution_Revert() (gas: 47881) +EVM2EVMOffRamp_executeSingleMessage:test_executeSingleMessage_NoTokens_Success() (gas: 47352) +EVM2EVMOffRamp_executeSingleMessage:test_executeSingleMessage_WithTokens_Success() (gas: 313917) +EVM2EVMOffRamp_executeSingleMessage:test_executeSingleMessage_ZeroGasZeroData_Success() (gas: 70008) +EVM2EVMOffRamp_execute_upgrade:test_V2NonceNewSenderStartsAtZero_Success() (gas: 229325) +EVM2EVMOffRamp_execute_upgrade:test_V2NonceStartsAtV1Nonce_Success() (gas: 276790) +EVM2EVMOffRamp_execute_upgrade:test_V2OffRampNonceSkipsIfMsgInFlight_Success() (gas: 258696) +EVM2EVMOffRamp_execute_upgrade:test_V2SenderNoncesReadsPreviousRamp_Success() (gas: 226253) +EVM2EVMOffRamp_execute_upgrade:test_V2_Success() (gas: 130745) +EVM2EVMOffRamp_getAllRateLimitTokens:test_GetAllRateLimitTokens_Success() (gas: 38446) +EVM2EVMOffRamp_getExecutionState:test_FillExecutionState_Success() (gas: 3251974) +EVM2EVMOffRamp_getExecutionState:test_GetExecutionState_Success() (gas: 83387) +EVM2EVMOffRamp_manuallyExecute:test_ManualExecFailedTx_Revert() (gas: 185829) +EVM2EVMOffRamp_manuallyExecute:test_ManualExecForkedChain_Revert() (gas: 27049) +EVM2EVMOffRamp_manuallyExecute:test_ManualExecGasLimitMismatch_Revert() (gas: 45155) +EVM2EVMOffRamp_manuallyExecute:test_ManualExecInvalidGasLimit_Revert() (gas: 27468) +EVM2EVMOffRamp_manuallyExecute:test_ManualExecWithMultipleMessagesAndSourceTokens_Success() (gas: 530151) +EVM2EVMOffRamp_manuallyExecute:test_ManualExecWithSourceTokens_Success() (gas: 345758) +EVM2EVMOffRamp_manuallyExecute:test_ManualExec_Success() (gas: 187324) +EVM2EVMOffRamp_manuallyExecute:test_ReentrancyManualExecuteFails_Success() (gas: 2321912) +EVM2EVMOffRamp_manuallyExecute:test_manuallyExecute_DestinationGasAmountCountMismatch_Revert() (gas: 362965) +EVM2EVMOffRamp_manuallyExecute:test_manuallyExecute_DoesNotRevertIfUntouched_Success() (gas: 143900) +EVM2EVMOffRamp_manuallyExecute:test_manuallyExecute_InvalidTokenGasOverride_Revert() (gas: 366104) +EVM2EVMOffRamp_manuallyExecute:test_manuallyExecute_LowGasLimitManualExec_Success() (gas: 482682) +EVM2EVMOffRamp_manuallyExecute:test_manuallyExecute_WithGasOverride_Success() (gas: 189727) +EVM2EVMOffRamp_manuallyExecute:test_manuallyExecute_WithInvalidReceiverExecutionGasOverride_Revert() (gas: 153641) +EVM2EVMOffRamp_manuallyExecute:test_manuallyExecute_WithInvalidSourceTokenDataCount_Revert() (gas: 59894) +EVM2EVMOffRamp_metadataHash:test_MetadataHash_Success() (gas: 8865) +EVM2EVMOffRamp_setDynamicConfig:test_NonOwner_Revert() (gas: 40156) +EVM2EVMOffRamp_setDynamicConfig:test_RouterZeroAddress_Revert() (gas: 38239) +EVM2EVMOffRamp_setDynamicConfig:test_SetDynamicConfig_Success() (gas: 141923) +EVM2EVMOffRamp_updateRateLimitTokens:test_updateRateLimitTokens_AddsAndRemoves_Success() (gas: 162528) +EVM2EVMOffRamp_updateRateLimitTokens:test_updateRateLimitTokens_NonOwner_Revert() (gas: 16693) +EVM2EVMOffRamp_updateRateLimitTokens:test_updateRateLimitTokens_Success() (gas: 197728) +EVM2EVMOnRamp_constructor:test_Constructor_Success() (gas: 5579757) +EVM2EVMOnRamp_forwardFromRouter:test_CannotSendZeroTokens_Revert() (gas: 35778) +EVM2EVMOnRamp_forwardFromRouter:test_EnforceOutOfOrder_Revert() (gas: 98446) +EVM2EVMOnRamp_forwardFromRouter:test_ForwardFromRouterExtraArgsV2AllowOutOfOrderTrue_Success() (gas: 114204) +EVM2EVMOnRamp_forwardFromRouter:test_ForwardFromRouterExtraArgsV2_Success() (gas: 114246) +EVM2EVMOnRamp_forwardFromRouter:test_ForwardFromRouterSuccessCustomExtraArgs() (gas: 130213) +EVM2EVMOnRamp_forwardFromRouter:test_ForwardFromRouterSuccessLegacyExtraArgs() (gas: 138659) +EVM2EVMOnRamp_forwardFromRouter:test_ForwardFromRouter_Success() (gas: 129838) +EVM2EVMOnRamp_forwardFromRouter:test_InvalidAddressEncodePacked_Revert() (gas: 38257) +EVM2EVMOnRamp_forwardFromRouter:test_InvalidAddress_Revert() (gas: 38440) +EVM2EVMOnRamp_forwardFromRouter:test_InvalidChainSelector_Revert() (gas: 25489) +EVM2EVMOnRamp_forwardFromRouter:test_InvalidExtraArgsTag_Revert() (gas: 25275) +EVM2EVMOnRamp_forwardFromRouter:test_MaxCapacityExceeded_Revert() (gas: 86013) +EVM2EVMOnRamp_forwardFromRouter:test_MaxFeeBalanceReached_Revert() (gas: 36457) +EVM2EVMOnRamp_forwardFromRouter:test_MessageGasLimitTooHigh_Revert() (gas: 29015) +EVM2EVMOnRamp_forwardFromRouter:test_MessageTooLarge_Revert() (gas: 107571) +EVM2EVMOnRamp_forwardFromRouter:test_OriginalSender_Revert() (gas: 22679) +EVM2EVMOnRamp_forwardFromRouter:test_OverValueWithARLOff_Success() (gas: 227119) +EVM2EVMOnRamp_forwardFromRouter:test_Paused_Revert() (gas: 53072) +EVM2EVMOnRamp_forwardFromRouter:test_Permissions_Revert() (gas: 25481) +EVM2EVMOnRamp_forwardFromRouter:test_PriceNotFoundForToken_Revert() (gas: 59341) +EVM2EVMOnRamp_forwardFromRouter:test_ShouldIncrementNonceOnlyOnOrdered_Success() (gas: 179148) +EVM2EVMOnRamp_forwardFromRouter:test_ShouldIncrementSeqNumAndNonce_Success() (gas: 177430) +EVM2EVMOnRamp_forwardFromRouter:test_ShouldStoreNonLinkFees() (gas: 137254) +EVM2EVMOnRamp_forwardFromRouter:test_SourceTokenDataTooLarge_Revert() (gas: 3825327) +EVM2EVMOnRamp_forwardFromRouter:test_TooManyTokens_Revert() (gas: 30187) +EVM2EVMOnRamp_forwardFromRouter:test_Unhealthy_Revert() (gas: 43300) +EVM2EVMOnRamp_forwardFromRouter:test_UnsupportedToken_Revert() (gas: 109305) +EVM2EVMOnRamp_forwardFromRouter:test_ZeroAddressReceiver_Revert() (gas: 312579) +EVM2EVMOnRamp_forwardFromRouter:test_forwardFromRouter_ShouldStoreLinkFees_Success() (gas: 112331) +EVM2EVMOnRamp_forwardFromRouter:test_forwardFromRouter_UnsupportedToken_Revert() (gas: 72206) +EVM2EVMOnRamp_forwardFromRouter:test_forwardFromRouter_correctSourceTokenData_Success() (gas: 712975) +EVM2EVMOnRamp_forwardFromRouter_upgrade:test_V2NonceNewSenderStartsAtZero_Success() (gas: 147664) +EVM2EVMOnRamp_forwardFromRouter_upgrade:test_V2NonceStartsAtV1Nonce_Success() (gas: 190529) +EVM2EVMOnRamp_forwardFromRouter_upgrade:test_V2SenderNoncesReadsPreviousRamp_Success() (gas: 121320) +EVM2EVMOnRamp_forwardFromRouter_upgrade:test_V2_Success() (gas: 95349) +EVM2EVMOnRamp_getDataAvailabilityCost:test_EmptyMessageCalculatesDataAvailabilityCost_Success() (gas: 20544) +EVM2EVMOnRamp_getDataAvailabilityCost:test_SimpleMessageCalculatesDataAvailabilityCost_Success() (gas: 20912) +EVM2EVMOnRamp_getFee:test_EmptyMessage_Success() (gas: 78233) +EVM2EVMOnRamp_getFee:test_GetFeeOfZeroForTokenMessage_Success() (gas: 81762) +EVM2EVMOnRamp_getFee:test_HighGasMessage_Success() (gas: 234081) +EVM2EVMOnRamp_getFee:test_MessageGasLimitTooHigh_Revert() (gas: 16715) +EVM2EVMOnRamp_getFee:test_MessageTooLarge_Revert() (gas: 95271) +EVM2EVMOnRamp_getFee:test_MessageWithDataAndTokenTransfer_Success() (gas: 159439) +EVM2EVMOnRamp_getFee:test_NotAFeeToken_Revert() (gas: 24089) +EVM2EVMOnRamp_getFee:test_SingleTokenMessage_Success() (gas: 117925) +EVM2EVMOnRamp_getFee:test_TooManyTokens_Revert() (gas: 19902) +EVM2EVMOnRamp_getFee:test_ZeroDataAvailabilityMultiplier_Success() (gas: 64648) +EVM2EVMOnRamp_getSupportedTokens:test_GetSupportedTokens_Revert() (gas: 10460) +EVM2EVMOnRamp_getTokenPool:test_GetTokenPool_Success() (gas: 35195) +EVM2EVMOnRamp_getTokenTransferCost:test_CustomTokenBpsFee_Success() (gas: 45120) +EVM2EVMOnRamp_getTokenTransferCost:test_FeeTokenBpsFee_Success() (gas: 33019) +EVM2EVMOnRamp_getTokenTransferCost:test_LargeTokenTransferChargesMaxFeeAndGas_Success() (gas: 28296) +EVM2EVMOnRamp_getTokenTransferCost:test_MixedTokenTransferFee_Success() (gas: 126453) +EVM2EVMOnRamp_getTokenTransferCost:test_NoTokenTransferChargesZeroFee_Success() (gas: 15238) +EVM2EVMOnRamp_getTokenTransferCost:test_SmallTokenTransferChargesMinFeeAndGas_Success() (gas: 28104) +EVM2EVMOnRamp_getTokenTransferCost:test_UnsupportedToken_Revert() (gas: 21248) +EVM2EVMOnRamp_getTokenTransferCost:test_ZeroAmountTokenTransferChargesMinFeeAndGas_Success() (gas: 28127) +EVM2EVMOnRamp_getTokenTransferCost:test_ZeroFeeConfigChargesMinFee_Success() (gas: 38599) +EVM2EVMOnRamp_getTokenTransferCost:test__getTokenTransferCost_selfServeUsesDefaults_Success() (gas: 29404) +EVM2EVMOnRamp_linkAvailableForPayment:test_InsufficientLinkBalance_Success() (gas: 32615) +EVM2EVMOnRamp_linkAvailableForPayment:test_LinkAvailableForPayment_Success() (gas: 134833) +EVM2EVMOnRamp_payNops:test_AdminPayNops_Success() (gas: 143159) +EVM2EVMOnRamp_payNops:test_InsufficientBalance_Revert() (gas: 29043) +EVM2EVMOnRamp_payNops:test_NoFeesToPay_Revert() (gas: 127367) +EVM2EVMOnRamp_payNops:test_NoNopsToPay_Revert() (gas: 133251) +EVM2EVMOnRamp_payNops:test_NopPayNops_Success() (gas: 146446) +EVM2EVMOnRamp_payNops:test_OwnerPayNops_Success() (gas: 141021) +EVM2EVMOnRamp_payNops:test_PayNopsSuccessAfterSetNops() (gas: 297519) +EVM2EVMOnRamp_payNops:test_WrongPermissions_Revert() (gas: 15294) +EVM2EVMOnRamp_setDynamicConfig:test_SetConfigInvalidConfig_Revert() (gas: 42365) +EVM2EVMOnRamp_setDynamicConfig:test_SetConfigOnlyOwner_Revert() (gas: 21246) +EVM2EVMOnRamp_setDynamicConfig:test_SetDynamicConfig_Success() (gas: 53764) +EVM2EVMOnRamp_setFeeTokenConfig:test_OnlyCallableByOwnerOrAdmin_Revert() (gas: 13464) +EVM2EVMOnRamp_setFeeTokenConfig:test_SetFeeTokenConfigByAdmin_Success() (gas: 16449) +EVM2EVMOnRamp_setFeeTokenConfig:test_SetFeeTokenConfig_Success() (gas: 13994) +EVM2EVMOnRamp_setNops:test_AdminCanSetNops_Success() (gas: 61759) +EVM2EVMOnRamp_setNops:test_IncludesPayment_Success() (gas: 469227) +EVM2EVMOnRamp_setNops:test_LinkTokenCannotBeNop_Revert() (gas: 57255) +EVM2EVMOnRamp_setNops:test_NonOwnerOrAdmin_Revert() (gas: 14665) +EVM2EVMOnRamp_setNops:test_NotEnoughFundsForPayout_Revert() (gas: 84480) +EVM2EVMOnRamp_setNops:test_SetNopsRemovesOldNopsCompletely_Success() (gas: 60637) +EVM2EVMOnRamp_setNops:test_SetNops_Success() (gas: 173782) +EVM2EVMOnRamp_setNops:test_TooManyNops_Revert() (gas: 190338) +EVM2EVMOnRamp_setNops:test_ZeroAddressCannotBeNop_Revert() (gas: 53596) +EVM2EVMOnRamp_setTokenTransferFeeConfig:test__setTokenTransferFeeConfig_InvalidDestBytesOverhead_Revert() (gas: 14499) +EVM2EVMOnRamp_setTokenTransferFeeConfig:test__setTokenTransferFeeConfig_OnlyCallableByOwnerOrAdmin_Revert() (gas: 14277) +EVM2EVMOnRamp_setTokenTransferFeeConfig:test__setTokenTransferFeeConfig_Success() (gas: 84029) +EVM2EVMOnRamp_setTokenTransferFeeConfig:test__setTokenTransferFeeConfig_byAdmin_Success() (gas: 17369) +EVM2EVMOnRamp_withdrawNonLinkFees:test_LinkBalanceNotSettled_Revert() (gas: 83005) +EVM2EVMOnRamp_withdrawNonLinkFees:test_NonOwnerOrAdmin_Revert() (gas: 15275) +EVM2EVMOnRamp_withdrawNonLinkFees:test_SettlingBalance_Success() (gas: 272035) +EVM2EVMOnRamp_withdrawNonLinkFees:test_WithdrawNonLinkFees_Success() (gas: 53446) +EVM2EVMOnRamp_withdrawNonLinkFees:test_WithdrawToZeroAddress_Revert() (gas: 12830) +EtherSenderReceiverTest_ccipReceive:test_ccipReceive_fallbackToWethTransfer() (gas: 96729) +EtherSenderReceiverTest_ccipReceive:test_ccipReceive_happyPath() (gas: 49688) +EtherSenderReceiverTest_ccipReceive:test_ccipReceive_wrongToken() (gas: 17384) +EtherSenderReceiverTest_ccipReceive:test_ccipReceive_wrongTokenAmount() (gas: 15677) +EtherSenderReceiverTest_ccipSend:test_ccipSend_reverts_insufficientFee_feeToken() (gas: 99741) +EtherSenderReceiverTest_ccipSend:test_ccipSend_reverts_insufficientFee_native() (gas: 76096) +EtherSenderReceiverTest_ccipSend:test_ccipSend_reverts_insufficientFee_weth() (gas: 99748) +EtherSenderReceiverTest_ccipSend:test_ccipSend_success_feeToken() (gas: 144569) +EtherSenderReceiverTest_ccipSend:test_ccipSend_success_native() (gas: 80259) +EtherSenderReceiverTest_ccipSend:test_ccipSend_success_nativeExcess() (gas: 80446) +EtherSenderReceiverTest_ccipSend:test_ccipSend_success_weth() (gas: 95713) +EtherSenderReceiverTest_constructor:test_constructor() (gas: 17511) +EtherSenderReceiverTest_getFee:test_getFee() (gas: 27289) +EtherSenderReceiverTest_validateFeeToken:test_validateFeeToken_reverts_feeToken_tokenAmountNotEqualToMsgValue() (gas: 20333) +EtherSenderReceiverTest_validateFeeToken:test_validateFeeToken_valid_feeToken() (gas: 16715) +EtherSenderReceiverTest_validateFeeToken:test_validateFeeToken_valid_native() (gas: 16654) +EtherSenderReceiverTest_validatedMessage:test_validatedMessage_dataOverwrittenToMsgSender() (gas: 25415) +EtherSenderReceiverTest_validatedMessage:test_validatedMessage_emptyDataOverwrittenToMsgSender() (gas: 25265) +EtherSenderReceiverTest_validatedMessage:test_validatedMessage_invalidTokenAmounts() (gas: 17895) +EtherSenderReceiverTest_validatedMessage:test_validatedMessage_tokenOverwrittenToWeth() (gas: 25287) +EtherSenderReceiverTest_validatedMessage:test_validatedMessage_validMessage_extraArgs() (gas: 26292) +FeeQuoter_applyDestChainConfigUpdates:test_InvalidChainFamilySelector_Revert() (gas: 16503) +FeeQuoter_applyDestChainConfigUpdates:test_InvalidDestChainConfigDestChainSelectorEqZero_Revert() (gas: 16417) +FeeQuoter_applyDestChainConfigUpdates:test_applyDestChainConfigUpdatesDefaultTxGasLimitEqZero_Revert() (gas: 16459) +FeeQuoter_applyDestChainConfigUpdates:test_applyDestChainConfigUpdatesDefaultTxGasLimitGtMaxPerMessageGasLimit_Revert() (gas: 39957) +FeeQuoter_applyDestChainConfigUpdates:test_applyDestChainConfigUpdatesZeroIntput_Success() (gas: 12342) +FeeQuoter_applyDestChainConfigUpdates:test_applyDestChainConfigUpdates_Success() (gas: 135870) +FeeQuoter_applyFeeTokensUpdates:test_ApplyFeeTokensUpdates_Success() (gas: 79896) +FeeQuoter_applyFeeTokensUpdates:test_OnlyCallableByOwner_Revert() (gas: 12603) +FeeQuoter_applyPremiumMultiplierWeiPerEthUpdates:test_OnlyCallableByOwnerOrAdmin_Revert() (gas: 11421) +FeeQuoter_applyPremiumMultiplierWeiPerEthUpdates:test_applyPremiumMultiplierWeiPerEthUpdatesMultipleTokens_Success() (gas: 54105) +FeeQuoter_applyPremiumMultiplierWeiPerEthUpdates:test_applyPremiumMultiplierWeiPerEthUpdatesSingleToken_Success() (gas: 44791) +FeeQuoter_applyPremiumMultiplierWeiPerEthUpdates:test_applyPremiumMultiplierWeiPerEthUpdatesZeroInput() (gas: 12257) +FeeQuoter_applyTokenTransferFeeConfigUpdates:test_ApplyTokenTransferFeeConfig_Success() (gas: 86926) +FeeQuoter_applyTokenTransferFeeConfigUpdates:test_ApplyTokenTransferFeeZeroInput() (gas: 13089) +FeeQuoter_applyTokenTransferFeeConfigUpdates:test_InvalidDestBytesOverhead_Revert() (gas: 17071) +FeeQuoter_applyTokenTransferFeeConfigUpdates:test_OnlyCallableByOwnerOrAdmin_Revert() (gas: 12240) +FeeQuoter_constructor:test_InvalidLinkTokenEqZeroAddress_Revert() (gas: 107046) +FeeQuoter_constructor:test_InvalidMaxFeeJuelsPerMsg_Revert() (gas: 111396) +FeeQuoter_constructor:test_InvalidStalenessThreshold_Revert() (gas: 111449) +FeeQuoter_constructor:test_Setup_Success() (gas: 5355882) +FeeQuoter_convertTokenAmount:test_ConvertTokenAmount_Success() (gas: 72739) +FeeQuoter_convertTokenAmount:test_LinkTokenNotSupported_Revert() (gas: 30963) +FeeQuoter_getDataAvailabilityCost:test_EmptyMessageCalculatesDataAvailabilityCost_Success() (gas: 94303) +FeeQuoter_getDataAvailabilityCost:test_SimpleMessageCalculatesDataAvailabilityCostUnsupportedDestChainSelector_Success() (gas: 14614) +FeeQuoter_getDataAvailabilityCost:test_SimpleMessageCalculatesDataAvailabilityCost_Success() (gas: 20410) +FeeQuoter_getTokenAndGasPrices:test_GetFeeTokenAndGasPrices_Success() (gas: 70458) +FeeQuoter_getTokenAndGasPrices:test_StaleGasPrice_Revert() (gas: 16838) +FeeQuoter_getTokenAndGasPrices:test_UnsupportedChain_Revert() (gas: 16140) +FeeQuoter_getTokenAndGasPrices:test_ZeroGasPrice_Success() (gas: 45765) +FeeQuoter_getTokenPrice:test_GetTokenPriceFromFeed_Success() (gas: 62252) +FeeQuoter_getTokenPrices:test_GetTokenPrices_Success() (gas: 84800) +FeeQuoter_getTokenTransferCost:test_CustomTokenBpsFee_Success() (gas: 41227) +FeeQuoter_getTokenTransferCost:test_FeeTokenBpsFee_Success() (gas: 34682) +FeeQuoter_getTokenTransferCost:test_LargeTokenTransferChargesMaxFeeAndGas_Success() (gas: 27756) +FeeQuoter_getTokenTransferCost:test_MixedTokenTransferFee_Success() (gas: 101624) +FeeQuoter_getTokenTransferCost:test_NoTokenTransferChargesZeroFee_Success() (gas: 20354) +FeeQuoter_getTokenTransferCost:test_SmallTokenTransferChargesMinFeeAndGas_Success() (gas: 27631) +FeeQuoter_getTokenTransferCost:test_ZeroAmountTokenTransferChargesMinFeeAndGas_Success() (gas: 27587) +FeeQuoter_getTokenTransferCost:test_ZeroFeeConfigChargesMinFee_Success() (gas: 40013) +FeeQuoter_getTokenTransferCost:test_getTokenTransferCost_selfServeUsesDefaults_Success() (gas: 29299) +FeeQuoter_getValidatedFee:test_DestinationChainNotEnabled_Revert() (gas: 18180) +FeeQuoter_getValidatedFee:test_EmptyMessage_Success() (gas: 85919) +FeeQuoter_getValidatedFee:test_EnforceOutOfOrder_Revert() (gas: 54345) +FeeQuoter_getValidatedFee:test_HighGasMessage_Success() (gas: 242337) +FeeQuoter_getValidatedFee:test_InvalidEVMAddress_Revert() (gas: 22390) +FeeQuoter_getValidatedFee:test_MessageGasLimitTooHigh_Revert() (gas: 31797) +FeeQuoter_getValidatedFee:test_MessageTooLarge_Revert() (gas: 100133) +FeeQuoter_getValidatedFee:test_MessageWithDataAndTokenTransfer_Success() (gas: 147680) +FeeQuoter_getValidatedFee:test_NotAFeeToken_Revert() (gas: 21043) +FeeQuoter_getValidatedFee:test_SingleTokenMessage_Success() (gas: 116708) +FeeQuoter_getValidatedFee:test_TooManyTokens_Revert() (gas: 22526) +FeeQuoter_getValidatedFee:test_ZeroDataAvailabilityMultiplier_Success() (gas: 64364) +FeeQuoter_getValidatedTokenPrice:test_GetValidatedTokenPriceFromFeedErc20Above18Decimals_Success() (gas: 2094539) +FeeQuoter_getValidatedTokenPrice:test_GetValidatedTokenPriceFromFeedErc20Below18Decimals_Success() (gas: 2094497) +FeeQuoter_getValidatedTokenPrice:test_GetValidatedTokenPriceFromFeedFeedAt0Decimals_Success() (gas: 2074616) +FeeQuoter_getValidatedTokenPrice:test_GetValidatedTokenPriceFromFeedFeedAt18Decimals_Success() (gas: 2094271) +FeeQuoter_getValidatedTokenPrice:test_GetValidatedTokenPriceFromFeedFlippedDecimals_Success() (gas: 2094475) +FeeQuoter_getValidatedTokenPrice:test_GetValidatedTokenPriceFromFeedMaxInt224Value_Success() (gas: 2094287) +FeeQuoter_getValidatedTokenPrice:test_GetValidatedTokenPriceFromFeedOverStalenessPeriod_Success() (gas: 62004) +FeeQuoter_getValidatedTokenPrice:test_GetValidatedTokenPriceFromFeed_Success() (gas: 61884) +FeeQuoter_getValidatedTokenPrice:test_GetValidatedTokenPrice_Success() (gas: 61036) +FeeQuoter_getValidatedTokenPrice:test_OverflowFeedPrice_Revert() (gas: 2093974) +FeeQuoter_getValidatedTokenPrice:test_StaleFeeToken_Success() (gas: 61563) +FeeQuoter_getValidatedTokenPrice:test_TokenNotSupportedFeed_Revert() (gas: 109120) +FeeQuoter_getValidatedTokenPrice:test_TokenNotSupported_Revert() (gas: 13857) +FeeQuoter_getValidatedTokenPrice:test_UnderflowFeedPrice_Revert() (gas: 2092636) +FeeQuoter_onReport:test_OnReport_StaleUpdate_Revert() (gas: 43334) +FeeQuoter_onReport:test_onReport_InvalidForwarder_Reverts() (gas: 23294) +FeeQuoter_onReport:test_onReport_Success() (gas: 80639) +FeeQuoter_onReport:test_onReport_UnsupportedToken_Reverts() (gas: 26677) +FeeQuoter_parseEVMExtraArgsFromBytes:test_EVMExtraArgsDefault_Success() (gas: 17185) +FeeQuoter_parseEVMExtraArgsFromBytes:test_EVMExtraArgsEnforceOutOfOrder_Revert() (gas: 21290) +FeeQuoter_parseEVMExtraArgsFromBytes:test_EVMExtraArgsGasLimitTooHigh_Revert() (gas: 18387) +FeeQuoter_parseEVMExtraArgsFromBytes:test_EVMExtraArgsInvalidExtraArgsTag_Revert() (gas: 17911) +FeeQuoter_parseEVMExtraArgsFromBytes:test_EVMExtraArgsV1_Success() (gas: 18285) +FeeQuoter_parseEVMExtraArgsFromBytes:test_EVMExtraArgsV2_Success() (gas: 18401) +FeeQuoter_processMessageArgs:test_InvalidExtraArgs_Revert() (gas: 18361) +FeeQuoter_processMessageArgs:test_MalformedEVMExtraArgs_Revert() (gas: 18907) +FeeQuoter_processMessageArgs:test_MessageFeeTooHigh_Revert() (gas: 16426) +FeeQuoter_processMessageArgs:test_WitEVMExtraArgsV2_Success() (gas: 26269) +FeeQuoter_processMessageArgs:test_WithConvertedTokenAmount_Success() (gas: 32441) +FeeQuoter_processMessageArgs:test_WithEVMExtraArgsV1_Success() (gas: 25881) +FeeQuoter_processMessageArgs:test_WithEmptyEVMExtraArgs_Success() (gas: 23696) +FeeQuoter_processMessageArgs:test_WithLinkTokenAmount_Success() (gas: 17375) +FeeQuoter_updatePrices:test_OnlyCallableByUpdater_Revert() (gas: 12102) +FeeQuoter_updatePrices:test_OnlyGasPrice_Success() (gas: 23599) +FeeQuoter_updatePrices:test_OnlyTokenPrice_Success() (gas: 30631) +FeeQuoter_updatePrices:test_UpdatableByAuthorizedCaller_Success() (gas: 76003) +FeeQuoter_updatePrices:test_UpdateMultiplePrices_Success() (gas: 151393) +FeeQuoter_updateTokenPriceFeeds:test_FeedNotUpdated() (gas: 50527) +FeeQuoter_updateTokenPriceFeeds:test_FeedUnset_Success() (gas: 63626) +FeeQuoter_updateTokenPriceFeeds:test_FeedUpdatedByNonOwner_Revert() (gas: 19932) +FeeQuoter_updateTokenPriceFeeds:test_MultipleFeedUpdate_Success() (gas: 88972) +FeeQuoter_updateTokenPriceFeeds:test_SingleFeedUpdate_Success() (gas: 50821) +FeeQuoter_updateTokenPriceFeeds:test_ZeroFeeds_Success() (gas: 12296) +FeeQuoter_validateDestFamilyAddress:test_InvalidEVMAddressEncodePacked_Revert() (gas: 10616) +FeeQuoter_validateDestFamilyAddress:test_InvalidEVMAddressPrecompiles_Revert() (gas: 3961646) +FeeQuoter_validateDestFamilyAddress:test_InvalidEVMAddress_Revert() (gas: 10800) +FeeQuoter_validateDestFamilyAddress:test_ValidEVMAddress_Success() (gas: 6704) +FeeQuoter_validateDestFamilyAddress:test_ValidNonEVMAddress_Success() (gas: 6484) +FeeQuoter_validatePoolReturnData:test_InvalidEVMAddressDestToken_Revert() (gas: 42748) +FeeQuoter_validatePoolReturnData:test_ProcessPoolReturnData_Success() (gas: 73252) +FeeQuoter_validatePoolReturnData:test_SourceTokenDataTooLarge_Revert() (gas: 107744) +FeeQuoter_validatePoolReturnData:test_TokenAmountArraysMismatching_Revert() (gas: 40091) +HybridUSDCTokenPoolMigrationTests:test_LockOrBurn_LocKReleaseMechanism_then_switchToPrimary_Success() (gas: 208156) +HybridUSDCTokenPoolMigrationTests:test_LockOrBurn_PrimaryMechanism_Success() (gas: 135401) +HybridUSDCTokenPoolMigrationTests:test_LockOrBurn_WhileMigrationPause_Revert() (gas: 106633) +HybridUSDCTokenPoolMigrationTests:test_LockOrBurn_onLockReleaseMechanism_Success() (gas: 143893) +HybridUSDCTokenPoolMigrationTests:test_MintOrRelease_OnLockReleaseMechanism_Success() (gas: 230396) +HybridUSDCTokenPoolMigrationTests:test_MintOrRelease_OnLockReleaseMechanism_then_switchToPrimary_Success() (gas: 438277) +HybridUSDCTokenPoolMigrationTests:test_MintOrRelease_incomingMessageWithPrimaryMechanism() (gas: 269985) +HybridUSDCTokenPoolMigrationTests:test_burnLockedUSDC_invalidPermissions_Revert() (gas: 39124) +HybridUSDCTokenPoolMigrationTests:test_cancelExistingCCTPMigrationProposal() (gas: 31124) +HybridUSDCTokenPoolMigrationTests:test_cannotCancelANonExistentMigrationProposal() (gas: 12628) +HybridUSDCTokenPoolMigrationTests:test_cannotModifyLiquidityWithoutPermissions_Revert() (gas: 17134) +HybridUSDCTokenPoolMigrationTests:test_lockOrBurn_then_BurnInCCTPMigration_Success() (gas: 252452) +HybridUSDCTokenPoolMigrationTests:test_transferLiquidity_Success() (gas: 157049) +HybridUSDCTokenPoolMigrationTests:test_withdrawLiquidity_Success() (gas: 140780) +HybridUSDCTokenPoolTests:test_LockOrBurn_LocKReleaseMechanism_then_switchToPrimary_Success() (gas: 208121) +HybridUSDCTokenPoolTests:test_LockOrBurn_PrimaryMechanism_Success() (gas: 135375) +HybridUSDCTokenPoolTests:test_LockOrBurn_WhileMigrationPause_Revert() (gas: 106610) +HybridUSDCTokenPoolTests:test_LockOrBurn_onLockReleaseMechanism_Success() (gas: 143841) +HybridUSDCTokenPoolTests:test_MintOrRelease_OnLockReleaseMechanism_Success() (gas: 230362) +HybridUSDCTokenPoolTests:test_MintOrRelease_OnLockReleaseMechanism_then_switchToPrimary_Success() (gas: 438237) +HybridUSDCTokenPoolTests:test_MintOrRelease_incomingMessageWithPrimaryMechanism() (gas: 269968) +HybridUSDCTokenPoolTests:test_withdrawLiquidity_Success() (gas: 140774) +LockReleaseTokenPoolAndProxy_setRebalancer:test_SetRebalancer_Revert() (gas: 10971) +LockReleaseTokenPoolAndProxy_setRebalancer:test_SetRebalancer_Success() (gas: 17992) +LockReleaseTokenPoolPoolAndProxy_canAcceptLiquidity:test_CanAcceptLiquidity_Success() (gas: 3368113) +LockReleaseTokenPoolPoolAndProxy_provideLiquidity:test_LiquidityNotAccepted_Revert() (gas: 3364513) +LockReleaseTokenPoolPoolAndProxy_provideLiquidity:test_Unauthorized_Revert() (gas: 11381) +LockReleaseTokenPoolPoolAndProxy_supportsInterface:test_SupportsInterface_Success() (gas: 9977) +LockReleaseTokenPoolPoolAndProxy_withdrawalLiquidity:test_InsufficientLiquidity_Revert() (gas: 60043) +LockReleaseTokenPoolPoolAndProxy_withdrawalLiquidity:test_Unauthorized_Revert() (gas: 11356) +LockReleaseTokenPool_canAcceptLiquidity:test_CanAcceptLiquidity_Success() (gas: 3124822) +LockReleaseTokenPool_lockOrBurn:test_LockOrBurnWithAllowList_Revert() (gas: 29954) +LockReleaseTokenPool_lockOrBurn:test_LockOrBurnWithAllowList_Success() (gas: 79844) +LockReleaseTokenPool_lockOrBurn:test_PoolBurnRevertNotHealthy_Revert() (gas: 59464) +LockReleaseTokenPool_provideLiquidity:test_LiquidityNotAccepted_Revert() (gas: 3121265) +LockReleaseTokenPool_provideLiquidity:test_Unauthorized_Revert() (gas: 11381) +LockReleaseTokenPool_releaseOrMint:test_ChainNotAllowed_Revert() (gas: 72654) +LockReleaseTokenPool_releaseOrMint:test_PoolMintNotHealthy_Revert() (gas: 56196) +LockReleaseTokenPool_releaseOrMint:test_ReleaseOrMint_Success() (gas: 225137) +LockReleaseTokenPool_setRebalancer:test_SetRebalancer_Revert() (gas: 10993) +LockReleaseTokenPool_setRebalancer:test_SetRebalancer_Success() (gas: 18058) +LockReleaseTokenPool_supportsInterface:test_SupportsInterface_Success() (gas: 9977) +LockReleaseTokenPool_transferLiquidity:test_transferLiquidity_Success() (gas: 83171) +LockReleaseTokenPool_transferLiquidity:test_transferLiquidity_transferTooMuch_Revert() (gas: 55878) +LockReleaseTokenPool_withdrawalLiquidity:test_InsufficientLiquidity_Revert() (gas: 60043) +LockReleaseTokenPool_withdrawalLiquidity:test_Unauthorized_Revert() (gas: 11356) +LockRelease_setRateLimitAdmin:test_SetRateLimitAdmin_Revert() (gas: 11030) +LockRelease_setRateLimitAdmin:test_SetRateLimitAdmin_Success() (gas: 35030) +MerkleMultiProofTest:test_CVE_2023_34459() (gas: 5451) +MerkleMultiProofTest:test_EmptyLeaf_Revert() (gas: 3552) +MerkleMultiProofTest:test_MerkleRoot256() (gas: 394876) +MerkleMultiProofTest:test_MerkleRootSingleLeaf_Success() (gas: 3649) +MerkleMultiProofTest:test_SpecSync_gas() (gas: 34123) +MockRouterTest:test_ccipSendWithInsufficientNativeTokens_Revert() (gas: 33965) +MockRouterTest:test_ccipSendWithInvalidMsgValue_Revert() (gas: 60758) +MockRouterTest:test_ccipSendWithLinkFeeTokenAndValidMsgValue_Success() (gas: 126306) +MockRouterTest:test_ccipSendWithLinkFeeTokenbutInsufficientAllowance_Revert() (gas: 63302) +MockRouterTest:test_ccipSendWithSufficientNativeFeeTokens_Success() (gas: 43853) +MultiAggregateRateLimiter_applyRateLimiterConfigUpdates:test_MultipleConfigsBothLanes_Success() (gas: 132031) +MultiAggregateRateLimiter_applyRateLimiterConfigUpdates:test_MultipleConfigs_Success() (gas: 312057) +MultiAggregateRateLimiter_applyRateLimiterConfigUpdates:test_OnlyCallableByOwner_Revert() (gas: 17717) +MultiAggregateRateLimiter_applyRateLimiterConfigUpdates:test_SingleConfigOutbound_Success() (gas: 75784) +MultiAggregateRateLimiter_applyRateLimiterConfigUpdates:test_SingleConfig_Success() (gas: 75700) +MultiAggregateRateLimiter_applyRateLimiterConfigUpdates:test_UpdateExistingConfigWithNoDifference_Success() (gas: 38133) +MultiAggregateRateLimiter_applyRateLimiterConfigUpdates:test_UpdateExistingConfig_Success() (gas: 53092) +MultiAggregateRateLimiter_applyRateLimiterConfigUpdates:test_ZeroChainSelector_Revert() (gas: 17019) +MultiAggregateRateLimiter_applyRateLimiterConfigUpdates:test_ZeroConfigs_Success() (gas: 12295) +MultiAggregateRateLimiter_constructor:test_ConstructorNoAuthorizedCallers_Success() (gas: 2149547) +MultiAggregateRateLimiter_constructor:test_Constructor_Success() (gas: 2265849) +MultiAggregateRateLimiter_getTokenBucket:test_GetTokenBucket_Success() (gas: 30248) +MultiAggregateRateLimiter_getTokenBucket:test_Refill_Success() (gas: 47358) +MultiAggregateRateLimiter_getTokenBucket:test_TimeUnderflow_Revert() (gas: 15821) +MultiAggregateRateLimiter_getTokenValue:test_GetTokenValue_Success() (gas: 19662) +MultiAggregateRateLimiter_getTokenValue:test_NoTokenPrice_Reverts() (gas: 21247) +MultiAggregateRateLimiter_onInboundMessage:test_ValidateMessageFromUnauthorizedCaller_Revert() (gas: 14527) +MultiAggregateRateLimiter_onInboundMessage:test_ValidateMessageWithDifferentTokensOnDifferentChains_Success() (gas: 213638) +MultiAggregateRateLimiter_onInboundMessage:test_ValidateMessageWithDisabledRateLimitToken_Success() (gas: 60437) +MultiAggregateRateLimiter_onInboundMessage:test_ValidateMessageWithNoTokens_Success() (gas: 17593) +MultiAggregateRateLimiter_onInboundMessage:test_ValidateMessageWithRateLimitDisabled_Success() (gas: 44895) +MultiAggregateRateLimiter_onInboundMessage:test_ValidateMessageWithRateLimitExceeded_Revert() (gas: 50542) +MultiAggregateRateLimiter_onInboundMessage:test_ValidateMessageWithRateLimitReset_Success() (gas: 78668) +MultiAggregateRateLimiter_onInboundMessage:test_ValidateMessageWithTokensOnDifferentChains_Success() (gas: 311927) +MultiAggregateRateLimiter_onInboundMessage:test_ValidateMessageWithTokens_Success() (gas: 54728) +MultiAggregateRateLimiter_onOutboundMessage:test_RateLimitValueDifferentLanes_Success() (gas: 1073667529) +MultiAggregateRateLimiter_onOutboundMessage:test_ValidateMessageWithNoTokens_Success() (gas: 19149) +MultiAggregateRateLimiter_onOutboundMessage:test_onOutboundMessage_ValidateMessageFromUnauthorizedCaller_Revert() (gas: 15823) +MultiAggregateRateLimiter_onOutboundMessage:test_onOutboundMessage_ValidateMessageWithDifferentTokensOnDifferentChains_Success() (gas: 213716) +MultiAggregateRateLimiter_onOutboundMessage:test_onOutboundMessage_ValidateMessageWithDisabledRateLimitToken_Success() (gas: 62217) +MultiAggregateRateLimiter_onOutboundMessage:test_onOutboundMessage_ValidateMessageWithRateLimitDisabled_Success() (gas: 46728) +MultiAggregateRateLimiter_onOutboundMessage:test_onOutboundMessage_ValidateMessageWithRateLimitExceeded_Revert() (gas: 52360) +MultiAggregateRateLimiter_onOutboundMessage:test_onOutboundMessage_ValidateMessageWithRateLimitReset_Success() (gas: 79913) +MultiAggregateRateLimiter_onOutboundMessage:test_onOutboundMessage_ValidateMessageWithTokensOnDifferentChains_Success() (gas: 312231) +MultiAggregateRateLimiter_onOutboundMessage:test_onOutboundMessage_ValidateMessageWithTokens_Success() (gas: 56530) +MultiAggregateRateLimiter_setFeeQuoter:test_OnlyOwner_Revert() (gas: 11313) +MultiAggregateRateLimiter_setFeeQuoter:test_Owner_Success() (gas: 19066) +MultiAggregateRateLimiter_setFeeQuoter:test_ZeroAddress_Revert() (gas: 10585) +MultiAggregateRateLimiter_updateRateLimitTokens:test_NonOwner_Revert() (gas: 18850) +MultiAggregateRateLimiter_updateRateLimitTokens:test_UpdateRateLimitTokensMultipleChains_Success() (gas: 279972) +MultiAggregateRateLimiter_updateRateLimitTokens:test_UpdateRateLimitTokensSingleChain_Success() (gas: 254523) +MultiAggregateRateLimiter_updateRateLimitTokens:test_UpdateRateLimitTokens_AddsAndRemoves_Success() (gas: 204488) +MultiAggregateRateLimiter_updateRateLimitTokens:test_UpdateRateLimitTokens_RemoveNonExistentToken_Success() (gas: 28703) +MultiAggregateRateLimiter_updateRateLimitTokens:test_ZeroDestToken_Revert() (gas: 18287) +MultiAggregateRateLimiter_updateRateLimitTokens:test_ZeroSourceToken_Revert() (gas: 18216) +MultiOCR3Base_setOCR3Configs:test_FMustBePositive_Revert() (gas: 59228) +MultiOCR3Base_setOCR3Configs:test_FTooHigh_Revert() (gas: 43602) +MultiOCR3Base_setOCR3Configs:test_RepeatSignerAddress_Revert() (gas: 283585) +MultiOCR3Base_setOCR3Configs:test_RepeatTransmitterAddress_Revert() (gas: 422210) +MultiOCR3Base_setOCR3Configs:test_SetConfigIgnoreSigners_Success() (gas: 511089) +MultiOCR3Base_setOCR3Configs:test_SetConfigWithSigners_Success() (gas: 828371) +MultiOCR3Base_setOCR3Configs:test_SetConfigWithoutSigners_Success() (gas: 456841) +MultiOCR3Base_setOCR3Configs:test_SetConfigsZeroInput_Success() (gas: 12376) +MultiOCR3Base_setOCR3Configs:test_SetMultipleConfigs_Success() (gas: 2139958) +MultiOCR3Base_setOCR3Configs:test_SignerCannotBeZeroAddress_Revert() (gas: 141702) +MultiOCR3Base_setOCR3Configs:test_StaticConfigChange_Revert() (gas: 807256) +MultiOCR3Base_setOCR3Configs:test_TooManySigners_Revert() (gas: 158772) +MultiOCR3Base_setOCR3Configs:test_TooManyTransmitters_Revert() (gas: 112266) +MultiOCR3Base_setOCR3Configs:test_TransmitterCannotBeZeroAddress_Revert() (gas: 254068) +MultiOCR3Base_setOCR3Configs:test_UpdateConfigSigners_Success() (gas: 859969) +MultiOCR3Base_setOCR3Configs:test_UpdateConfigTransmittersWithoutSigners_Success() (gas: 475059) +MultiOCR3Base_transmit:test_ConfigDigestMismatch_Revert() (gas: 42833) +MultiOCR3Base_transmit:test_ForkedChain_Revert() (gas: 48438) +MultiOCR3Base_transmit:test_InsufficientSignatures_Revert() (gas: 76928) +MultiOCR3Base_transmit:test_NonUniqueSignature_Revert() (gas: 65768) +MultiOCR3Base_transmit:test_SignatureOutOfRegistration_Revert() (gas: 33417) +MultiOCR3Base_transmit:test_TooManySignatures_Revert() (gas: 79519) +MultiOCR3Base_transmit:test_TransmitSigners_gas_Success() (gas: 33631) +MultiOCR3Base_transmit:test_TransmitWithExtraCalldataArgs_Revert() (gas: 47110) +MultiOCR3Base_transmit:test_TransmitWithLessCalldataArgs_Revert() (gas: 25678) +MultiOCR3Base_transmit:test_TransmitWithoutSignatureVerification_gas_Success() (gas: 18712) +MultiOCR3Base_transmit:test_UnAuthorizedTransmitter_Revert() (gas: 24189) +MultiOCR3Base_transmit:test_UnauthorizedSigner_Revert() (gas: 61131) +MultiOCR3Base_transmit:test_UnconfiguredPlugin_Revert() (gas: 39888) +MultiOCR3Base_transmit:test_ZeroSignatures_Revert() (gas: 32971) +MultiOnRampTokenPoolReentrancy:test_OnRampTokenPoolReentrancy_Success() (gas: 411393) +MultiRampsE2E:test_E2E_3MessagesMMultiOffRampSuccess_gas() (gas: 1526613) +NonceManager_NonceIncrementation:test_getIncrementedOutboundNonce_Success() (gas: 37907) +NonceManager_NonceIncrementation:test_incrementInboundNonce_Skip() (gas: 23703) +NonceManager_NonceIncrementation:test_incrementInboundNonce_Success() (gas: 38790) +NonceManager_NonceIncrementation:test_incrementNoncesInboundAndOutbound_Success() (gas: 71874) +NonceManager_OffRampUpgrade:test_NoPrevOffRampForChain_Success() (gas: 259788) +NonceManager_OffRampUpgrade:test_UpgradedNonceNewSenderStartsAtZero_Success() (gas: 263930) +NonceManager_OffRampUpgrade:test_UpgradedNonceStartsAtV1Nonce_Success() (gas: 326647) +NonceManager_OffRampUpgrade:test_UpgradedOffRampNonceSkipsIfMsgInFlight_Success() (gas: 298821) +NonceManager_OffRampUpgrade:test_UpgradedSenderNoncesReadsPreviousRampTransitive_Success() (gas: 244682) +NonceManager_OffRampUpgrade:test_UpgradedSenderNoncesReadsPreviousRamp_Success() (gas: 232797) +NonceManager_OffRampUpgrade:test_Upgraded_Success() (gas: 152756) +NonceManager_OnRampUpgrade:test_UpgradeNonceNewSenderStartsAtZero_Success() (gas: 168320) +NonceManager_OnRampUpgrade:test_UpgradeNonceStartsAtV1Nonce_Success() (gas: 220111) +NonceManager_OnRampUpgrade:test_UpgradeSenderNoncesReadsPreviousRamp_Success() (gas: 125079) +NonceManager_OnRampUpgrade:test_Upgrade_Success() (gas: 107546) +NonceManager_applyPreviousRampsUpdates:test_MultipleRampsUpdates() (gas: 122943) +NonceManager_applyPreviousRampsUpdates:test_PreviousRampAlreadySetOffRamp_Revert() (gas: 42959) +NonceManager_applyPreviousRampsUpdates:test_PreviousRampAlreadySetOnRampAndOffRamp_Revert() (gas: 64282) +NonceManager_applyPreviousRampsUpdates:test_PreviousRampAlreadySetOnRamp_Revert() (gas: 42823) +NonceManager_applyPreviousRampsUpdates:test_SingleRampUpdate() (gas: 66570) +NonceManager_applyPreviousRampsUpdates:test_ZeroInput() (gas: 12025) +NonceManager_typeAndVersion:test_typeAndVersion() (gas: 9675) +OCR2BaseNoChecks_setOCR2Config:test_FMustBePositive_Revert() (gas: 12171) +OCR2BaseNoChecks_setOCR2Config:test_RepeatAddress_Revert() (gas: 42233) +OCR2BaseNoChecks_setOCR2Config:test_SetConfigSuccess_gas() (gas: 84124) +OCR2BaseNoChecks_setOCR2Config:test_TooManyTransmitter_Revert() (gas: 36938) +OCR2BaseNoChecks_setOCR2Config:test_TransmitterCannotBeZeroAddress_Revert() (gas: 24158) +OCR2BaseNoChecks_transmit:test_ConfigDigestMismatch_Revert() (gas: 17448) +OCR2BaseNoChecks_transmit:test_ForkedChain_Revert() (gas: 26726) +OCR2BaseNoChecks_transmit:test_TransmitSuccess_gas() (gas: 27466) +OCR2BaseNoChecks_transmit:test_UnAuthorizedTransmitter_Revert() (gas: 21296) +OCR2Base_setOCR2Config:test_FMustBePositive_Revert() (gas: 12189) +OCR2Base_setOCR2Config:test_FTooHigh_Revert() (gas: 12345) +OCR2Base_setOCR2Config:test_OracleOutOfRegister_Revert() (gas: 14892) +OCR2Base_setOCR2Config:test_RepeatAddress_Revert() (gas: 45442) +OCR2Base_setOCR2Config:test_SetConfigSuccess_gas() (gas: 155192) +OCR2Base_setOCR2Config:test_SingerCannotBeZeroAddress_Revert() (gas: 24407) +OCR2Base_setOCR2Config:test_TooManySigners_Revert() (gas: 20508) +OCR2Base_setOCR2Config:test_TransmitterCannotBeZeroAddress_Revert() (gas: 47298) +OCR2Base_transmit:test_ConfigDigestMismatch_Revert() (gas: 19623) +OCR2Base_transmit:test_ForkedChain_Revert() (gas: 37683) +OCR2Base_transmit:test_NonUniqueSignature_Revert() (gas: 55309) +OCR2Base_transmit:test_SignatureOutOfRegistration_Revert() (gas: 20962) +OCR2Base_transmit:test_Transmit2SignersSuccess_gas() (gas: 51674) +OCR2Base_transmit:test_UnAuthorizedTransmitter_Revert() (gas: 23484) +OCR2Base_transmit:test_UnauthorizedSigner_Revert() (gas: 39665) +OCR2Base_transmit:test_WrongNumberOfSignatures_Revert() (gas: 20557) +OffRamp__releaseOrMintSingleToken:test__releaseOrMintSingleToken_NotACompatiblePool_Revert() (gas: 40170) +OffRamp__releaseOrMintSingleToken:test__releaseOrMintSingleToken_Success() (gas: 107133) +OffRamp__releaseOrMintSingleToken:test__releaseOrMintSingleToken_TokenHandlingError_transfer_Revert() (gas: 88356) +OffRamp__releaseOrMintSingleToken:test_releaseOrMintToken_InvalidDataLength_Revert() (gas: 39873) +OffRamp__releaseOrMintSingleToken:test_releaseOrMintToken_ReleaseOrMintBalanceMismatch_Revert() (gas: 97399) +OffRamp__releaseOrMintSingleToken:test_releaseOrMintToken_TokenHandlingError_BalanceOf_Revert() (gas: 42865) +OffRamp__releaseOrMintSingleToken:test_releaseOrMintToken_skip_ReleaseOrMintBalanceMismatch_if_pool_Revert() (gas: 89601) +OffRamp_applySourceChainConfigUpdates:test_AddMultipleChains_Success() (gas: 467980) +OffRamp_applySourceChainConfigUpdates:test_AddNewChain_Success() (gas: 99186) +OffRamp_applySourceChainConfigUpdates:test_ApplyZeroUpdates_Success() (gas: 12392) +OffRamp_applySourceChainConfigUpdates:test_ReplaceExistingChainOnRamp_Revert() (gas: 93184) +OffRamp_applySourceChainConfigUpdates:test_ReplaceExistingChain_Success() (gas: 109891) +OffRamp_applySourceChainConfigUpdates:test_RouterAddress_Revert() (gas: 13260) +OffRamp_applySourceChainConfigUpdates:test_ZeroOnRampAddress_Revert() (gas: 17994) +OffRamp_applySourceChainConfigUpdates:test_ZeroSourceChainSelector_Revert() (gas: 15349) +OffRamp_batchExecute:test_MultipleReportsDifferentChainsSkipCursedChain_Success() (gas: 176779) +OffRamp_batchExecute:test_MultipleReportsDifferentChains_Success() (gas: 332397) +OffRamp_batchExecute:test_MultipleReportsSameChain_Success() (gas: 275765) +OffRamp_batchExecute:test_MultipleReportsSkipDuplicate_Success() (gas: 167867) +OffRamp_batchExecute:test_OutOfBoundsGasLimitsAccess_Revert() (gas: 187343) +OffRamp_batchExecute:test_SingleReport_Success() (gas: 155847) +OffRamp_batchExecute:test_Unhealthy_Success() (gas: 572707) +OffRamp_batchExecute:test_ZeroReports_Revert() (gas: 10440) +OffRamp_ccipReceive:test_Reverts() (gas: 15705) +OffRamp_commit:test_FailedRMNVerification_Reverts() (gas: 64218) +OffRamp_commit:test_InvalidIntervalMinLargerThanMax_Revert() (gas: 67373) +OffRamp_commit:test_InvalidInterval_Revert() (gas: 59676) +OffRamp_commit:test_InvalidRootRevert() (gas: 58728) +OffRamp_commit:test_NoConfigWithOtherConfigPresent_Revert() (gas: 6572843) +OffRamp_commit:test_NoConfig_Revert() (gas: 6156722) +OffRamp_commit:test_OnlyGasPriceUpdates_Success() (gas: 113211) +OffRamp_commit:test_OnlyPriceUpdateStaleReport_Revert() (gas: 121156) +OffRamp_commit:test_OnlyTokenPriceUpdates_Success() (gas: 113232) +OffRamp_commit:test_PriceSequenceNumberCleared_Success() (gas: 354911) +OffRamp_commit:test_ReportAndPriceUpdate_Success() (gas: 166399) +OffRamp_commit:test_ReportOnlyRootSuccess_gas() (gas: 141496) +OffRamp_commit:test_RootAlreadyCommitted_Revert() (gas: 142440) +OffRamp_commit:test_SourceChainNotEnabled_Revert() (gas: 59004) +OffRamp_commit:test_StaleReportWithRoot_Success() (gas: 239068) +OffRamp_commit:test_UnauthorizedTransmitter_Revert() (gas: 122234) +OffRamp_commit:test_Unhealthy_Revert() (gas: 57761) +OffRamp_commit:test_ValidPriceUpdateThenStaleReportWithRoot_Success() (gas: 211577) +OffRamp_commit:test_WrongConfigWithoutSigners_Revert() (gas: 6569232) +OffRamp_commit:test_ZeroEpochAndRound_Revert() (gas: 51147) +OffRamp_constructor:test_Constructor_Success() (gas: 6157449) +OffRamp_constructor:test_SourceChainSelector_Revert() (gas: 137102) +OffRamp_constructor:test_ZeroChainSelector_Revert() (gas: 103831) +OffRamp_constructor:test_ZeroNonceManager_Revert() (gas: 101702) +OffRamp_constructor:test_ZeroOnRampAddress_Revert() (gas: 139743) +OffRamp_constructor:test_ZeroRMNRemote_Revert() (gas: 101631) +OffRamp_constructor:test_ZeroTokenAdminRegistry_Revert() (gas: 101646) +OffRamp_execute:test_IncorrectArrayType_Revert() (gas: 17281) +OffRamp_execute:test_LargeBatch_Success() (gas: 3374948) +OffRamp_execute:test_MultipleReportsWithPartialValidationFailures_Success() (gas: 372169) +OffRamp_execute:test_MultipleReports_Success() (gas: 298074) +OffRamp_execute:test_NoConfigWithOtherConfigPresent_Revert() (gas: 6620946) +OffRamp_execute:test_NoConfig_Revert() (gas: 6204499) +OffRamp_execute:test_NonArray_Revert() (gas: 27718) +OffRamp_execute:test_SingleReport_Success() (gas: 175099) +OffRamp_execute:test_UnauthorizedTransmitter_Revert() (gas: 147327) +OffRamp_execute:test_WrongConfigWithSigners_Revert() (gas: 6982447) +OffRamp_execute:test_ZeroReports_Revert() (gas: 17156) +OffRamp_executeSingleMessage:test_MessageSender_Revert() (gas: 18212) +OffRamp_executeSingleMessage:test_NonContractWithTokens_Success() (gas: 248992) +OffRamp_executeSingleMessage:test_NonContract_Success() (gas: 20494) +OffRamp_executeSingleMessage:test_TokenHandlingError_Revert() (gas: 210134) +OffRamp_executeSingleMessage:test_ZeroGasDONExecution_Revert() (gas: 48734) +OffRamp_executeSingleMessage:test_executeSingleMessage_NoTokens_Success() (gas: 48212) +OffRamp_executeSingleMessage:test_executeSingleMessage_WithFailingValidationNoRouterCall_Revert() (gas: 229531) +OffRamp_executeSingleMessage:test_executeSingleMessage_WithFailingValidation_Revert() (gas: 86169) +OffRamp_executeSingleMessage:test_executeSingleMessage_WithTokens_Success() (gas: 280811) +OffRamp_executeSingleMessage:test_executeSingleMessage_WithValidation_Success() (gas: 92403) +OffRamp_executeSingleReport:test_DisabledSourceChain_Revert() (gas: 28225) +OffRamp_executeSingleReport:test_EmptyReport_Revert() (gas: 21854) +OffRamp_executeSingleReport:test_InvalidSourcePoolAddress_Success() (gas: 501555) +OffRamp_executeSingleReport:test_ManualExecutionNotYetEnabled_Revert() (gas: 47569) +OffRamp_executeSingleReport:test_MismatchingDestChainSelector_Revert() (gas: 33855) +OffRamp_executeSingleReport:test_MismatchingOnRampRoot_Revert() (gas: 154807) +OffRamp_executeSingleReport:test_NonExistingSourceChain_Revert() (gas: 28459) +OffRamp_executeSingleReport:test_ReceiverError_Success() (gas: 187481) +OffRamp_executeSingleReport:test_RetryFailedMessageWithoutManualExecution_Revert() (gas: 197900) +OffRamp_executeSingleReport:test_RootNotCommitted_Revert() (gas: 40076) +OffRamp_executeSingleReport:test_RouterYULCall_Revert() (gas: 447326) +OffRamp_executeSingleReport:test_SingleMessageNoTokensOtherChain_Success() (gas: 247718) +OffRamp_executeSingleReport:test_SingleMessageNoTokensUnordered_Success() (gas: 191985) +OffRamp_executeSingleReport:test_SingleMessageNoTokens_Success() (gas: 211578) +OffRamp_executeSingleReport:test_SingleMessageToNonCCIPReceiver_Success() (gas: 259646) +OffRamp_executeSingleReport:test_SingleMessagesNoTokensSuccess_gas() (gas: 140761) +OffRamp_executeSingleReport:test_SkippedIncorrectNonceStillExecutes_Success() (gas: 424145) +OffRamp_executeSingleReport:test_SkippedIncorrectNonce_Success() (gas: 58992) +OffRamp_executeSingleReport:test_TokenDataMismatch_Revert() (gas: 74047) +OffRamp_executeSingleReport:test_TwoMessagesWithTokensAndGE_Success() (gas: 595794) +OffRamp_executeSingleReport:test_TwoMessagesWithTokensSuccess_gas() (gas: 543647) +OffRamp_executeSingleReport:test_UnexpectedTokenData_Revert() (gas: 33671) +OffRamp_executeSingleReport:test_UnhealthySingleChainCurse_Revert() (gas: 568625) +OffRamp_executeSingleReport:test_Unhealthy_Success() (gas: 568639) +OffRamp_executeSingleReport:test_WithCurseOnAnotherSourceChain_Success() (gas: 474070) +OffRamp_executeSingleReport:test__execute_SkippedAlreadyExecutedMessageUnordered_Success() (gas: 135265) +OffRamp_executeSingleReport:test__execute_SkippedAlreadyExecutedMessage_Success() (gas: 164484) +OffRamp_getExecutionState:test_FillExecutionState_Success() (gas: 3635486) +OffRamp_getExecutionState:test_GetDifferentChainExecutionState_Success() (gas: 118398) +OffRamp_getExecutionState:test_GetExecutionState_Success() (gas: 87417) +OffRamp_manuallyExecute:test_ManualExecGasLimitMismatchSingleReport_Revert() (gas: 75545) +OffRamp_manuallyExecute:test_ManualExecInvalidGasLimit_Revert() (gas: 26439) +OffRamp_manuallyExecute:test_manuallyExecute_DoesNotRevertIfUntouched_Success() (gas: 171175) +OffRamp_manuallyExecute:test_manuallyExecute_FailedTx_Revert() (gas: 210959) +OffRamp_manuallyExecute:test_manuallyExecute_ForkedChain_Revert() (gas: 25990) +OffRamp_manuallyExecute:test_manuallyExecute_GasLimitMismatchMultipleReports_Revert() (gas: 152828) +OffRamp_manuallyExecute:test_manuallyExecute_LowGasLimit_Success() (gas: 529679) +OffRamp_manuallyExecute:test_manuallyExecute_MultipleReportsWithSingleCursedLane_Revert() (gas: 310107) +OffRamp_manuallyExecute:test_manuallyExecute_ReentrancyFails_Success() (gas: 2389581) +OffRamp_manuallyExecute:test_manuallyExecute_Success() (gas: 223886) +OffRamp_manuallyExecute:test_manuallyExecute_WithGasOverride_Success() (gas: 224461) +OffRamp_manuallyExecute:test_manuallyExecute_WithMultiReportGasOverride_Success() (gas: 767127) +OffRamp_manuallyExecute:test_manuallyExecute_WithPartialMessages_Success() (gas: 342767) +OffRamp_releaseOrMintTokens:test_TokenHandlingError_Reverts() (gas: 165844) +OffRamp_releaseOrMintTokens:test__releaseOrMintTokens_PoolIsNotAPool_Reverts() (gas: 24622) +OffRamp_releaseOrMintTokens:test_releaseOrMintTokens_InvalidDataLengthReturnData_Revert() (gas: 66304) +OffRamp_releaseOrMintTokens:test_releaseOrMintTokens_InvalidEVMAddress_Revert() (gas: 41335) +OffRamp_releaseOrMintTokens:test_releaseOrMintTokens_PoolDoesNotSupportDest_Reverts() (gas: 83310) +OffRamp_releaseOrMintTokens:test_releaseOrMintTokens_Success() (gas: 177953) +OffRamp_releaseOrMintTokens:test_releaseOrMintTokens_destDenominatedDecimals_Success() (gas: 191164) +OffRamp_setDynamicConfig:test_FeeQuoterZeroAddress_Revert() (gas: 11604) +OffRamp_setDynamicConfig:test_NonOwner_Revert() (gas: 14171) +OffRamp_setDynamicConfig:test_SetDynamicConfigWithValidator_Success() (gas: 49156) +OffRamp_setDynamicConfig:test_SetDynamicConfig_Success() (gas: 27101) +OffRamp_trialExecute:test_RateLimitError_Success() (gas: 225708) +OffRamp_trialExecute:test_TokenHandlingErrorIsCaught_Success() (gas: 234329) +OffRamp_trialExecute:test_TokenPoolIsNotAContract_Success() (gas: 308936) +OffRamp_trialExecute:test_trialExecute_Success() (gas: 283904) +OnRampTokenPoolReentrancy:test_OnRampTokenPoolReentrancy_Success() (gas: 390336) +OnRamp_allowListConfigUpdates:test_applyAllowList_Revert() (gas: 66512) +OnRamp_allowListConfigUpdates:test_applyAllowList_Success() (gas: 323568) +OnRamp_applyDestChainConfigUpdates:test_ApplyDestChainConfigUpdates_Success() (gas: 64504) +OnRamp_applyDestChainConfigUpdates:test_ApplyDestChainConfigUpdates_WithInvalidChainSelector_Revert() (gas: 13242) +OnRamp_constructor:test_Constructor_InvalidConfigChainSelectorEqZero_Revert() (gas: 94851) +OnRamp_constructor:test_Constructor_InvalidConfigNonceManagerEqAddressZero_Revert() (gas: 92785) +OnRamp_constructor:test_Constructor_InvalidConfigRMNProxyEqAddressZero_Revert() (gas: 97811) +OnRamp_constructor:test_Constructor_InvalidConfigTokenAdminRegistryEqAddressZero_Revert() (gas: 92843) +OnRamp_constructor:test_Constructor_Success() (gas: 2852084) +OnRamp_forwardFromRouter:test_ForwardFromRouterExtraArgsV2AllowOutOfOrderTrue_Success() (gas: 114886) +OnRamp_forwardFromRouter:test_ForwardFromRouterExtraArgsV2_Success() (gas: 145654) +OnRamp_forwardFromRouter:test_ForwardFromRouterSuccessCustomExtraArgs() (gas: 145257) +OnRamp_forwardFromRouter:test_ForwardFromRouterSuccessEmptyExtraArgs() (gas: 143482) +OnRamp_forwardFromRouter:test_ForwardFromRouterSuccessLegacyExtraArgs() (gas: 145482) +OnRamp_forwardFromRouter:test_ForwardFromRouter_Success() (gas: 144861) +OnRamp_forwardFromRouter:test_ForwardFromRouter_Success_ConfigurableSourceRouter() (gas: 140001) +OnRamp_forwardFromRouter:test_InvalidExtraArgsTag_Revert() (gas: 28810) +OnRamp_forwardFromRouter:test_MessageValidationError_Revert() (gas: 138698) +OnRamp_forwardFromRouter:test_MesssageFeeTooHigh_Revert() (gas: 26910) +OnRamp_forwardFromRouter:test_MultiCannotSendZeroTokens_Revert() (gas: 74122) +OnRamp_forwardFromRouter:test_OriginalSender_Revert() (gas: 12918) +OnRamp_forwardFromRouter:test_Paused_Revert() (gas: 37224) +OnRamp_forwardFromRouter:test_Permissions_Revert() (gas: 18179) +OnRamp_forwardFromRouter:test_ShouldIncrementNonceOnlyOnOrdered_Success() (gas: 184142) +OnRamp_forwardFromRouter:test_ShouldIncrementSeqNumAndNonce_Success() (gas: 210451) +OnRamp_forwardFromRouter:test_ShouldStoreLinkFees() (gas: 124773) +OnRamp_forwardFromRouter:test_ShouldStoreNonLinkFees() (gas: 146166) +OnRamp_forwardFromRouter:test_SourceTokenDataTooLarge_Revert() (gas: 3882038) +OnRamp_forwardFromRouter:test_UnAllowedOriginalSender_Revert() (gas: 18609) +OnRamp_forwardFromRouter:test_UnsupportedToken_Revert() (gas: 110785) +OnRamp_forwardFromRouter:test_forwardFromRouter_UnsupportedToken_Revert() (gas: 76212) +OnRamp_forwardFromRouter:test_forwardFromRouter_WithValidation_Success() (gas: 280890) +OnRamp_getFee:test_EmptyMessage_Success() (gas: 102302) +OnRamp_getFee:test_EnforceOutOfOrder_Revert() (gas: 66336) +OnRamp_getFee:test_GetFeeOfZeroForTokenMessage_Success() (gas: 87668) +OnRamp_getFee:test_NotAFeeTokenButPricedToken_Revert() (gas: 34930) +OnRamp_getFee:test_SingleTokenMessage_Success() (gas: 117635) +OnRamp_getFee:test_Unhealthy_Revert() (gas: 17009) +OnRamp_getSupportedTokens:test_GetSupportedTokens_Revert() (gas: 10438) +OnRamp_getTokenPool:test_GetTokenPool_Success() (gas: 35204) +OnRamp_setDynamicConfig:test_SetConfigInvalidConfigFeeAggregatorEqAddressZero_Revert() (gas: 11402) +OnRamp_setDynamicConfig:test_SetConfigInvalidConfigFeeQuoterEqAddressZero_Revert() (gas: 13001) +OnRamp_setDynamicConfig:test_SetConfigInvalidConfig_Revert() (gas: 11359) +OnRamp_setDynamicConfig:test_SetConfigOnlyOwner_Revert() (gas: 16385) +OnRamp_setDynamicConfig:test_SetDynamicConfig_Success() (gas: 55321) +OnRamp_withdrawFeeTokens:test_WithdrawFeeTokens_Success() (gas: 97095) +PingPong_ccipReceive:test_CcipReceive_Success() (gas: 152669) +PingPong_plumbing:test_OutOfOrderExecution_Success() (gas: 20277) +PingPong_plumbing:test_Pausing_Success() (gas: 17777) +PingPong_startPingPong:test_StartPingPong_With_OOO_Success() (gas: 163187) +PingPong_startPingPong:test_StartPingPong_With_Sequenced_Ordered_Success() (gas: 182599) +RMNHome:test() (gas: 186) +RMN_constructor:test_Constructor_Success() (gas: 48838) +RMN_getRecordedCurseRelatedOps:test_OpsPostDeployment() (gas: 19666) +RMN_lazyVoteToCurseUpdate_Benchmark:test_VoteToCurseLazilyRetain3VotersUponConfigChange_gas() (gas: 152152) +RMN_ownerUnbless:test_Unbless_Success() (gas: 74699) +RMN_ownerUnvoteToCurse:test_CanBlessAndCurseAfterGlobalCurseIsLifted() (gas: 470965) +RMN_ownerUnvoteToCurse:test_IsIdempotent() (gas: 397532) +RMN_ownerUnvoteToCurse:test_NonOwner_Revert() (gas: 18591) +RMN_ownerUnvoteToCurse:test_OwnerUnvoteToCurseSuccess_gas() (gas: 357400) +RMN_ownerUnvoteToCurse:test_UnknownVoter_Revert() (gas: 32980) +RMN_ownerUnvoteToCurse_Benchmark:test_OwnerUnvoteToCurse_1Voter_LiftsCurse_gas() (gas: 261985) +RMN_permaBlessing:test_PermaBlessing() (gas: 202686) +RMN_setConfig:test_BlessVoterIsZeroAddress_Revert() (gas: 15494) +RMN_setConfig:test_EitherThresholdIsZero_Revert() (gas: 21095) +RMN_setConfig:test_NonOwner_Revert() (gas: 14713) +RMN_setConfig:test_RepeatedAddress_Revert() (gas: 18213) +RMN_setConfig:test_SetConfigSuccess_gas() (gas: 104022) +RMN_setConfig:test_TotalWeightsSmallerThanEachThreshold_Revert() (gas: 30173) +RMN_setConfig:test_VoteToBlessByEjectedVoter_Revert() (gas: 130303) +RMN_setConfig:test_VotersLengthIsZero_Revert() (gas: 12128) +RMN_setConfig:test_WeightIsZeroAddress_Revert() (gas: 15734) +RMN_setConfig_Benchmark_1:test_SetConfig_7Voters_gas() (gas: 659123) +RMN_setConfig_Benchmark_2:test_ResetConfig_7Voters_gas() (gas: 212156) +RMN_unvoteToCurse:test_InvalidCursesHash() (gas: 26364) +RMN_unvoteToCurse:test_OwnerSkips() (gas: 33753) +RMN_unvoteToCurse:test_OwnerSucceeds() (gas: 63909) +RMN_unvoteToCurse:test_UnauthorizedVoter() (gas: 47478) +RMN_unvoteToCurse:test_ValidCursesHash() (gas: 61067) +RMN_unvoteToCurse:test_VotersCantLiftCurseButOwnerCan() (gas: 627750) +RMN_voteToBless:test_Curse_Revert() (gas: 472823) +RMN_voteToBless:test_IsAlreadyBlessed_Revert() (gas: 114829) +RMN_voteToBless:test_RootSuccess() (gas: 555559) +RMN_voteToBless:test_SenderAlreadyVoted_Revert() (gas: 96730) +RMN_voteToBless:test_UnauthorizedVoter_Revert() (gas: 17087) +RMN_voteToBless_Benchmark:test_1RootSuccess_gas() (gas: 44667) +RMN_voteToBless_Benchmark:test_3RootSuccess_gas() (gas: 98565) +RMN_voteToBless_Benchmark:test_5RootSuccess_gas() (gas: 152401) +RMN_voteToBless_Blessed_Benchmark:test_1RootSuccessBecameBlessed_gas() (gas: 29619) +RMN_voteToBless_Blessed_Benchmark:test_1RootSuccess_gas() (gas: 27565) +RMN_voteToBless_Blessed_Benchmark:test_3RootSuccess_gas() (gas: 81485) +RMN_voteToBless_Blessed_Benchmark:test_5RootSuccess_gas() (gas: 135299) +RMN_voteToCurse:test_CurseOnlyWhenThresholdReached_Success() (gas: 1648701) +RMN_voteToCurse:test_EmptySubjects_Revert() (gas: 14019) +RMN_voteToCurse:test_EvenIfAlreadyCursed_Success() (gas: 534332) +RMN_voteToCurse:test_OwnerCanCurseAndUncurse() (gas: 399001) +RMN_voteToCurse:test_RepeatedSubject_Revert() (gas: 144225) +RMN_voteToCurse:test_ReusedCurseId_Revert() (gas: 146738) +RMN_voteToCurse:test_UnauthorizedVoter_Revert() (gas: 12600) +RMN_voteToCurse:test_VoteToCurse_NoCurse_Success() (gas: 187244) +RMN_voteToCurse:test_VoteToCurse_YesCurse_Success() (gas: 472452) +RMN_voteToCurse_2:test_VotesAreDroppedIfSubjectIsNotCursedDuringConfigChange() (gas: 370468) +RMN_voteToCurse_2:test_VotesAreRetainedIfSubjectIsCursedDuringConfigChange() (gas: 1151909) +RMN_voteToCurse_Benchmark_1:test_VoteToCurse_NewSubject_NewVoter_NoCurse_gas() (gas: 140968) +RMN_voteToCurse_Benchmark_1:test_VoteToCurse_NewSubject_NewVoter_YesCurse_gas() (gas: 165087) +RMN_voteToCurse_Benchmark_2:test_VoteToCurse_OldSubject_NewVoter_NoCurse_gas() (gas: 121305) +RMN_voteToCurse_Benchmark_2:test_VoteToCurse_OldSubject_OldVoter_NoCurse_gas() (gas: 98247) +RMN_voteToCurse_Benchmark_3:test_VoteToCurse_OldSubject_NewVoter_YesCurse_gas() (gas: 145631) +RateLimiter_constructor:test_Constructor_Success() (gas: 19650) +RateLimiter_consume:test_AggregateValueMaxCapacityExceeded_Revert() (gas: 15916) +RateLimiter_consume:test_AggregateValueRateLimitReached_Revert() (gas: 22222) +RateLimiter_consume:test_ConsumeAggregateValue_Success() (gas: 31353) +RateLimiter_consume:test_ConsumeTokens_Success() (gas: 20336) +RateLimiter_consume:test_ConsumeUnlimited_Success() (gas: 40285) +RateLimiter_consume:test_ConsumingMoreThanUint128_Revert() (gas: 15720) +RateLimiter_consume:test_RateLimitReachedOverConsecutiveBlocks_Revert() (gas: 25594) +RateLimiter_consume:test_Refill_Success() (gas: 37222) +RateLimiter_consume:test_TokenMaxCapacityExceeded_Revert() (gas: 18250) +RateLimiter_consume:test_TokenRateLimitReached_Revert() (gas: 24706) +RateLimiter_currentTokenBucketState:test_CurrentTokenBucketState_Success() (gas: 38647) +RateLimiter_currentTokenBucketState:test_Refill_Success() (gas: 46384) +RateLimiter_setTokenBucketConfig:test_SetRateLimiterConfig_Success() (gas: 38017) +RegistryModuleOwnerCustom_constructor:test_constructor_Revert() (gas: 36028) +RegistryModuleOwnerCustom_registerAdminViaGetCCIPAdmin:test_registerAdminViaGetCCIPAdmin_Revert() (gas: 19637) +RegistryModuleOwnerCustom_registerAdminViaGetCCIPAdmin:test_registerAdminViaGetCCIPAdmin_Success() (gas: 129918) +RegistryModuleOwnerCustom_registerAdminViaOwner:test_registerAdminViaOwner_Revert() (gas: 19451) +RegistryModuleOwnerCustom_registerAdminViaOwner:test_registerAdminViaOwner_Success() (gas: 129731) +Router_applyRampUpdates:test_OffRampMismatch_Revert() (gas: 89288) +Router_applyRampUpdates:test_OffRampUpdatesWithRouting() (gas: 10642128) +Router_applyRampUpdates:test_OnRampDisable() (gas: 55935) +Router_applyRampUpdates:test_OnlyOwner_Revert() (gas: 12311) +Router_ccipSend:test_CCIPSendLinkFeeNoTokenSuccess_gas() (gas: 113880) +Router_ccipSend:test_CCIPSendLinkFeeOneTokenSuccess_gas() (gas: 201336) +Router_ccipSend:test_CCIPSendNativeFeeNoTokenSuccess_gas() (gas: 128515) +Router_ccipSend:test_CCIPSendNativeFeeOneTokenSuccess_gas() (gas: 215973) +Router_ccipSend:test_FeeTokenAmountTooLow_Revert() (gas: 66281) +Router_ccipSend:test_InvalidMsgValue() (gas: 31963) +Router_ccipSend:test_NativeFeeTokenInsufficientValue() (gas: 68737) +Router_ccipSend:test_NativeFeeTokenOverpay_Success() (gas: 173606) +Router_ccipSend:test_NativeFeeTokenZeroValue() (gas: 56031) +Router_ccipSend:test_NativeFeeToken_Success() (gas: 172200) +Router_ccipSend:test_NonLinkFeeToken_Success() (gas: 242717) +Router_ccipSend:test_UnsupportedDestinationChain_Revert() (gas: 24749) +Router_ccipSend:test_WhenNotHealthy_Revert() (gas: 44724) +Router_ccipSend:test_WrappedNativeFeeToken_Success() (gas: 174386) +Router_ccipSend:test_ZeroFeeAndGasPrice_Success() (gas: 244854) +Router_constructor:test_Constructor_Success() (gas: 13070) +Router_getArmProxy:test_getArmProxy() (gas: 10561) +Router_getFee:test_GetFeeSupportedChain_Success() (gas: 46458) +Router_getFee:test_UnsupportedDestinationChain_Revert() (gas: 17138) +Router_getSupportedTokens:test_GetSupportedTokens_Revert() (gas: 10460) +Router_recoverTokens:test_RecoverTokensInvalidRecipient_Revert() (gas: 11316) +Router_recoverTokens:test_RecoverTokensNoFunds_Revert() (gas: 20261) +Router_recoverTokens:test_RecoverTokensNonOwner_Revert() (gas: 11159) +Router_recoverTokens:test_RecoverTokensValueReceiver_Revert() (gas: 422138) +Router_recoverTokens:test_RecoverTokens_Success() (gas: 52437) +Router_routeMessage:test_AutoExec_Success() (gas: 42684) +Router_routeMessage:test_ExecutionEvent_Success() (gas: 157989) +Router_routeMessage:test_ManualExec_Success() (gas: 35381) +Router_routeMessage:test_OnlyOffRamp_Revert() (gas: 25116) +Router_routeMessage:test_WhenNotHealthy_Revert() (gas: 44724) +Router_setWrappedNative:test_OnlyOwner_Revert() (gas: 10986) +SelfFundedPingPong_ccipReceive:test_FundingIfNotANop_Revert() (gas: 55531) +SelfFundedPingPong_ccipReceive:test_Funding_Success() (gas: 419466) +SelfFundedPingPong_setCountIncrBeforeFunding:test_setCountIncrBeforeFunding() (gas: 20151) +TokenAdminRegistry_acceptAdminRole:test_acceptAdminRole_OnlyPendingAdministrator_Revert() (gas: 51085) +TokenAdminRegistry_acceptAdminRole:test_acceptAdminRole_Success() (gas: 43947) +TokenAdminRegistry_addRegistryModule:test_addRegistryModule_OnlyOwner_Revert() (gas: 12629) +TokenAdminRegistry_addRegistryModule:test_addRegistryModule_Success() (gas: 67011) +TokenAdminRegistry_getAllConfiguredTokens:test_getAllConfiguredTokens_outOfBounds_Success() (gas: 11350) +TokenAdminRegistry_getPool:test_getPool_Success() (gas: 17581) +TokenAdminRegistry_getPools:test_getPools_Success() (gas: 39902) +TokenAdminRegistry_isAdministrator:test_isAdministrator_Success() (gas: 105922) +TokenAdminRegistry_proposeAdministrator:test_proposeAdministrator_AlreadyRegistered_Revert() (gas: 104037) +TokenAdminRegistry_proposeAdministrator:test_proposeAdministrator_OnlyRegistryModule_Revert() (gas: 15493) +TokenAdminRegistry_proposeAdministrator:test_proposeAdministrator_ZeroAddress_Revert() (gas: 15038) +TokenAdminRegistry_proposeAdministrator:test_proposeAdministrator_module_Success() (gas: 112548) +TokenAdminRegistry_proposeAdministrator:test_proposeAdministrator_owner_Success() (gas: 107668) +TokenAdminRegistry_proposeAdministrator:test_proposeAdministrator_reRegisterWhileUnclaimed_Success() (gas: 115698) +TokenAdminRegistry_removeRegistryModule:test_removeRegistryModule_OnlyOwner_Revert() (gas: 12585) +TokenAdminRegistry_removeRegistryModule:test_removeRegistryModule_Success() (gas: 54473) +TokenAdminRegistry_setPool:test_setPool_InvalidTokenPoolToken_Revert() (gas: 19154) +TokenAdminRegistry_setPool:test_setPool_OnlyAdministrator_Revert() (gas: 18020) +TokenAdminRegistry_setPool:test_setPool_Success() (gas: 35949) +TokenAdminRegistry_setPool:test_setPool_ZeroAddressRemovesPool_Success() (gas: 30623) +TokenAdminRegistry_transferAdminRole:test_transferAdminRole_OnlyAdministrator_Revert() (gas: 18043) +TokenAdminRegistry_transferAdminRole:test_transferAdminRole_Success() (gas: 49390) +TokenPoolAndProxy:test_lockOrBurn_burnMint_Success() (gas: 6070356) +TokenPoolAndProxy:test_lockOrBurn_burnWithFromMint_Success() (gas: 6101829) +TokenPoolAndProxy:test_lockOrBurn_lockRelease_Success() (gas: 6319597) +TokenPoolAndProxy:test_setPreviousPool_Success() (gas: 3387124) +TokenPoolAndProxyMigration:test_tokenPoolMigration_Success_1_2() (gas: 6916281) +TokenPoolAndProxyMigration:test_tokenPoolMigration_Success_1_4() (gas: 7100309) +TokenPoolWithAllowList_applyAllowListUpdates:test_AllowListNotEnabled_Revert() (gas: 2209840) +TokenPoolWithAllowList_applyAllowListUpdates:test_OnlyOwner_Revert() (gas: 12089) +TokenPoolWithAllowList_applyAllowListUpdates:test_SetAllowListSkipsZero_Success() (gas: 23464) +TokenPoolWithAllowList_applyAllowListUpdates:test_SetAllowList_Success() (gas: 177792) +TokenPoolWithAllowList_getAllowList:test_GetAllowList_Success() (gas: 23740) +TokenPoolWithAllowList_getAllowListEnabled:test_GetAllowListEnabled_Success() (gas: 8363) +TokenPoolWithAllowList_setRouter:test_SetRouter_Success() (gas: 24843) +TokenPool_applyChainUpdates:test_applyChainUpdates_DisabledNonZeroRateLimit_Revert() (gas: 271305) +TokenPool_applyChainUpdates:test_applyChainUpdates_InvalidRateLimitRate_Revert() (gas: 541162) +TokenPool_applyChainUpdates:test_applyChainUpdates_NonExistentChain_Revert() (gas: 18344) +TokenPool_applyChainUpdates:test_applyChainUpdates_OnlyCallableByOwner_Revert() (gas: 11385) +TokenPool_applyChainUpdates:test_applyChainUpdates_Success() (gas: 476468) +TokenPool_applyChainUpdates:test_applyChainUpdates_ZeroAddressNotAllowed_Revert() (gas: 157074) +TokenPool_constructor:test_ZeroAddressNotAllowed_Revert() (gas: 70721) +TokenPool_constructor:test_immutableFields_Success() (gas: 20544) +TokenPool_getRemotePool:test_getRemotePool_Success() (gas: 273962) +TokenPool_onlyOffRamp:test_CallerIsNotARampOnRouter_Revert() (gas: 276921) +TokenPool_onlyOffRamp:test_ChainNotAllowed_Revert() (gas: 289432) +TokenPool_onlyOffRamp:test_onlyOffRamp_Success() (gas: 349729) +TokenPool_onlyOnRamp:test_CallerIsNotARampOnRouter_Revert() (gas: 276655) +TokenPool_onlyOnRamp:test_ChainNotAllowed_Revert() (gas: 253458) +TokenPool_onlyOnRamp:test_onlyOnRamp_Success() (gas: 304770) +TokenPool_setChainRateLimiterConfig:test_NonExistentChain_Revert() (gas: 17073) +TokenPool_setChainRateLimiterConfig:test_OnlyOwnerOrRateLimitAdmin_Revert() (gas: 15074) +TokenPool_setRemotePool:test_setRemotePool_NonExistentChain_Reverts() (gas: 15620) +TokenPool_setRemotePool:test_setRemotePool_OnlyOwner_Reverts() (gas: 13195) +TokenPool_setRemotePool:test_setRemotePool_Success() (gas: 281912) +TokenProxy_ccipSend:test_CcipSendGasShouldBeZero_Revert() (gas: 17109) +TokenProxy_ccipSend:test_CcipSendInsufficientAllowance_Revert() (gas: 136222) +TokenProxy_ccipSend:test_CcipSendInvalidToken_Revert() (gas: 15919) +TokenProxy_ccipSend:test_CcipSendNative_Success() (gas: 245173) +TokenProxy_ccipSend:test_CcipSendNoDataAllowed_Revert() (gas: 16303) +TokenProxy_ccipSend:test_CcipSend_Success() (gas: 261558) +TokenProxy_constructor:test_Constructor() (gas: 13812) +TokenProxy_getFee:test_GetFeeGasShouldBeZero_Revert() (gas: 16827) +TokenProxy_getFee:test_GetFeeInvalidToken_Revert() (gas: 12658) +TokenProxy_getFee:test_GetFeeNoDataAllowed_Revert() (gas: 15852) +TokenProxy_getFee:test_GetFee_Success() (gas: 86690) +USDCTokenPool__validateMessage:test_ValidateInvalidMessage_Revert() (gas: 25338) +USDCTokenPool_lockOrBurn:test_CallerIsNotARampOnRouter_Revert() (gas: 35352) +USDCTokenPool_lockOrBurn:test_LockOrBurnWithAllowList_Revert() (gas: 30094) +USDCTokenPool_lockOrBurn:test_LockOrBurn_Success() (gas: 133112) +USDCTokenPool_lockOrBurn:test_UnknownDomain_Revert() (gas: 477240) +USDCTokenPool_releaseOrMint:test_ReleaseOrMintRealTx_Success() (gas: 268166) +USDCTokenPool_releaseOrMint:test_TokenMaxCapacityExceeded_Revert() (gas: 50700) +USDCTokenPool_releaseOrMint:test_UnlockingUSDCFailed_Revert() (gas: 98609) +USDCTokenPool_setDomains:test_InvalidDomain_Revert() (gas: 66174) +USDCTokenPool_setDomains:test_OnlyOwner_Revert() (gas: 11333) +USDCTokenPool_supportsInterface:test_SupportsInterface_Success() (gas: 9876) \ No newline at end of file diff --git a/contracts/gas-snapshots/functions.gas-snapshot b/contracts/gas-snapshots/functions.gas-snapshot index 53b34c786c9..69e02716846 100644 --- a/contracts/gas-snapshots/functions.gas-snapshot +++ b/contracts/gas-snapshots/functions.gas-snapshot @@ -1,21 +1,21 @@ -ChainSpecificUtil__getCurrentTxL1GasFees_Arbitrum:test__getCurrentTxL1GasFees_SuccessWhenArbitrumGoerli() (gas: 15910179) -ChainSpecificUtil__getCurrentTxL1GasFees_Arbitrum:test__getCurrentTxL1GasFees_SuccessWhenArbitrumMainnet() (gas: 15910157) -ChainSpecificUtil__getCurrentTxL1GasFees_Arbitrum:test__getCurrentTxL1GasFees_SuccessWhenArbitrumSepolia() (gas: 15910173) -ChainSpecificUtil__getCurrentTxL1GasFees_Base:test__getCurrentTxL1GasFees_SuccessWhenBaseGoerli() (gas: 15921621) -ChainSpecificUtil__getCurrentTxL1GasFees_Base:test__getCurrentTxL1GasFees_SuccessWhenBaseMainnet() (gas: 15921598) -ChainSpecificUtil__getCurrentTxL1GasFees_Base:test__getCurrentTxL1GasFees_SuccessWhenBaseSepolia() (gas: 15921570) -ChainSpecificUtil__getCurrentTxL1GasFees_Optimism:test__getCurrentTxL1GasFees_SuccessWhenOptimismGoerli() (gas: 15921521) -ChainSpecificUtil__getCurrentTxL1GasFees_Optimism:test__getCurrentTxL1GasFees_SuccessWhenOptimismMainnet() (gas: 15921510) -ChainSpecificUtil__getCurrentTxL1GasFees_Optimism:test__getCurrentTxL1GasFees_SuccessWhenOptimismSepolia() (gas: 15921554) +ChainSpecificUtil__getL1FeeUpperLimit_Arbitrum:test__getL1FeeUpperLimit_SuccessWhenArbitrumGoerli() (gas: 16076840) +ChainSpecificUtil__getL1FeeUpperLimit_Arbitrum:test__getL1FeeUpperLimit_SuccessWhenArbitrumMainnet() (gas: 16076819) +ChainSpecificUtil__getL1FeeUpperLimit_Arbitrum:test__getL1FeeUpperLimit_SuccessWhenArbitrumSepolia() (gas: 16076888) +ChainSpecificUtil__getL1FeeUpperLimit_Base:test__getL1FeeUpperLimit_SuccessWhenBaseGoerli() (gas: 16076608) +ChainSpecificUtil__getL1FeeUpperLimit_Base:test__getL1FeeUpperLimit_SuccessWhenBaseMainnet() (gas: 16076564) +ChainSpecificUtil__getL1FeeUpperLimit_Base:test__getL1FeeUpperLimit_SuccessWhenBaseSepolia() (gas: 16076635) +ChainSpecificUtil__getL1FeeUpperLimit_Optimism:test__getL1FeeUpperLimit_SuccessWhenOptimismGoerli() (gas: 16076521) +ChainSpecificUtil__getL1FeeUpperLimit_Optimism:test__getL1FeeUpperLimit_SuccessWhenOptimismMainnet() (gas: 16076543) +ChainSpecificUtil__getL1FeeUpperLimit_Optimism:test__getL1FeeUpperLimit_SuccessWhenOptimismSepolia() (gas: 16076586) FunctionsBilling_Constructor:test_Constructor_Success() (gas: 17982) -FunctionsBilling_DeleteCommitment:test_DeleteCommitment_RevertIfNotRouter() (gas: 13260) -FunctionsBilling_DeleteCommitment:test_DeleteCommitment_Success() (gas: 15875) +FunctionsBilling_DeleteCommitment:test_DeleteCommitment_RevertIfNotRouter() (gas: 13283) +FunctionsBilling_DeleteCommitment:test_DeleteCommitment_Success() (gas: 15853) FunctionsBilling_EstimateCost:test_EstimateCost_RevertsIfGasPriceAboveCeiling() (gas: 32450) -FunctionsBilling_EstimateCost:test_EstimateCost_Success() (gas: 91058) -FunctionsBilling_EstimateCost:test_EstimateCost_SuccessLowGasPrice() (gas: 91161) +FunctionsBilling_EstimateCost:test_EstimateCost_Success() (gas: 90977) +FunctionsBilling_EstimateCost:test_EstimateCost_SuccessLowGasPrice() (gas: 91102) FunctionsBilling_GetAdminFeeJuels:test_GetAdminFeeJuels_Success() (gas: 18671) -FunctionsBilling_GetConfig:test_GetConfig_Success() (gas: 30213) -FunctionsBilling_GetDONFeeJuels:test_GetDONFeeJuels_Success() (gas: 41128) +FunctionsBilling_GetConfig:test_GetConfig_Success() (gas: 30750) +FunctionsBilling_GetDONFeeJuels:test_GetDONFeeJuels_Success() (gas: 41151) FunctionsBilling_GetOperationFee:test_GetOperationFeeJuels_Success() (gas: 40548) FunctionsBilling_GetWeiPerUnitLink:test_GetWeiPerUnitLink_Success() (gas: 29751) FunctionsBilling_OracleWithdraw:test_OracleWithdraw_RevertIfInsufficientBalance() (gas: 70136) @@ -23,217 +23,219 @@ FunctionsBilling_OracleWithdraw:test_OracleWithdraw_RevertWithNoBalance() (gas: FunctionsBilling_OracleWithdraw:test_OracleWithdraw_SuccessCoordinatorOwner() (gas: 129908) FunctionsBilling_OracleWithdraw:test_OracleWithdraw_SuccessTransmitterWithBalanceNoAmountGiven() (gas: 171930) FunctionsBilling_OracleWithdraw:test_OracleWithdraw_SuccessTransmitterWithBalanceValidAmountGiven() (gas: 145165) -FunctionsBilling_OracleWithdrawAll:test_OracleWithdrawAll_RevertIfNotOwner() (gas: 13297) +FunctionsBilling_OracleWithdrawAll:test_OracleWithdrawAll_RevertIfNotOwner() (gas: 13320) FunctionsBilling_OracleWithdrawAll:test_OracleWithdrawAll_SuccessPaysTransmittersWithBalance() (gas: 222357) -FunctionsBilling_UpdateConfig:test_UpdateConfig_RevertIfNotOwner() (gas: 21521) -FunctionsBilling_UpdateConfig:test_UpdateConfig_Success() (gas: 53173) +FunctionsBilling_UpdateConfig:test_UpdateConfig_RevertIfNotOwner() (gas: 21632) +FunctionsBilling_UpdateConfig:test_UpdateConfig_Success() (gas: 54099) FunctionsBilling__DisperseFeePool:test__DisperseFeePool_RevertIfNotSet() (gas: 8810) -FunctionsBilling__FulfillAndBill:test__FulfillAndBill_RevertIfInvalidCommitment() (gas: 13375) -FunctionsBilling__FulfillAndBill:test__FulfillAndBill_Success() (gas: 186305) -FunctionsBilling__StartBilling:test__FulfillAndBill_HasUniqueGlobalRequestId() (gas: 524688) +FunctionsBilling__FulfillAndBill:test__FulfillAndBill_RevertIfInvalidCommitment() (gas: 13353) +FunctionsBilling__FulfillAndBill:test__FulfillAndBill_Success() (gas: 185976) +FunctionsBilling__StartBilling:test__FulfillAndBill_HasUniqueGlobalRequestId() (gas: 524582) FunctionsClient_Constructor:test_Constructor_Success() (gas: 10407) -FunctionsClient_HandleOracleFulfillment:test_HandleOracleFulfillment_RevertIfNotRouter() (gas: 14617) -FunctionsClient_HandleOracleFulfillment:test_HandleOracleFulfillment_Success() (gas: 22917) +FunctionsClient_HandleOracleFulfillment:test_HandleOracleFulfillment_RevertIfNotRouter() (gas: 14595) +FunctionsClient_HandleOracleFulfillment:test_HandleOracleFulfillment_Success() (gas: 22983) FunctionsClient__SendRequest:test__SendRequest_RevertIfInvalidCallbackGasLimit() (gas: 55069) -FunctionsCoordinator_Constructor:test_Constructor_Success() (gas: 15107) -FunctionsCoordinator_GetDONPublicKey:test_GetDONPublicKey_RevertIfEmpty() (gas: 15378) -FunctionsCoordinator_GetDONPublicKey:test_GetDONPublicKey_Success() (gas: 91701) -FunctionsCoordinator_GetThresholdPublicKey:test_GetThresholdPublicKey_RevertIfEmpty() (gas: 15356) -FunctionsCoordinator_GetThresholdPublicKey:test_GetThresholdPublicKey_Success() (gas: 515779) -FunctionsCoordinator_SetDONPublicKey:test_SetDONPublicKey_RevertNotOwner() (gas: 20365) -FunctionsCoordinator_SetDONPublicKey:test_SetDONPublicKey_Success() (gas: 88980) -FunctionsCoordinator_SetThresholdPublicKey:test_SetThresholdPublicKey_RevertNotOwner() (gas: 13892) -FunctionsCoordinator_SetThresholdPublicKey:test_SetThresholdPublicKey_Success() (gas: 512971) -FunctionsCoordinator_StartRequest:test_StartRequest_RevertIfNotRouter() (gas: 22736) -FunctionsCoordinator_StartRequest:test_StartRequest_Success() (gas: 150175) +FunctionsCoordinator_Constructor:test_Constructor_Success() (gas: 15085) +FunctionsCoordinator_GetDONPublicKey:test_GetDONPublicKey_RevertIfEmpty() (gas: 15356) +FunctionsCoordinator_GetDONPublicKey:test_GetDONPublicKey_Success() (gas: 91691) +FunctionsCoordinator_GetThresholdPublicKey:test_GetThresholdPublicKey_RevertIfEmpty() (gas: 15334) +FunctionsCoordinator_GetThresholdPublicKey:test_GetThresholdPublicKey_Success() (gas: 515951) +FunctionsCoordinator_SetDONPublicKey:test_SetDONPublicKey_RevertNotOwner() (gas: 20409) +FunctionsCoordinator_SetDONPublicKey:test_SetDONPublicKey_Success() (gas: 88970) +FunctionsCoordinator_SetThresholdPublicKey:test_SetThresholdPublicKey_RevertNotOwner() (gas: 13915) +FunctionsCoordinator_SetThresholdPublicKey:test_SetThresholdPublicKey_Success() (gas: 513165) +FunctionsCoordinator_StartRequest:test_StartRequest_RevertIfNotRouter() (gas: 22802) +FunctionsCoordinator_StartRequest:test_StartRequest_Success() (gas: 152650) FunctionsCoordinator__IsTransmitter:test__IsTransmitter_SuccessFound() (gas: 15106) -FunctionsCoordinator__IsTransmitter:test__IsTransmitter_SuccessNotFound() (gas: 22938) +FunctionsCoordinator__IsTransmitter:test__IsTransmitter_SuccessNotFound() (gas: 22916) FunctionsRequest_DEFAULT_BUFFER_SIZE:test_DEFAULT_BUFFER_SIZE() (gas: 3089) FunctionsRequest_EncodeCBOR:test_EncodeCBOR_Success() (gas: 3066) FunctionsRequest_REQUEST_DATA_VERSION:test_REQUEST_DATA_VERSION() (gas: 3068) FunctionsRouter_Constructor:test_Constructor_Success() (gas: 15107) -FunctionsRouter_Fulfill:test_Fulfill_RequestNotProcessedCostExceedsCommitment() (gas: 173017) -FunctionsRouter_Fulfill:test_Fulfill_RequestNotProcessedInsufficientGas() (gas: 163489) +FunctionsRouter_Fulfill:test_Fulfill_RequestNotProcessedCostExceedsCommitment() (gas: 172475) +FunctionsRouter_Fulfill:test_Fulfill_RequestNotProcessedInsufficientGas() (gas: 163010) FunctionsRouter_Fulfill:test_Fulfill_RequestNotProcessedInvalidCommitment() (gas: 38777) FunctionsRouter_Fulfill:test_Fulfill_RequestNotProcessedInvalidRequestId() (gas: 35900) -FunctionsRouter_Fulfill:test_Fulfill_RequestNotProcessedSubscriptionBalanceInvariant() (gas: 181496) -FunctionsRouter_Fulfill:test_Fulfill_RevertIfNotCommittedCoordinator() (gas: 28086) -FunctionsRouter_Fulfill:test_Fulfill_RevertIfPaused() (gas: 157055) -FunctionsRouter_Fulfill:test_Fulfill_SuccessClientNoLongerExists() (gas: 335507) -FunctionsRouter_Fulfill:test_Fulfill_SuccessFulfilled() (gas: 349131) -FunctionsRouter_Fulfill:test_Fulfill_SuccessUserCallbackReverts() (gas: 2628028) -FunctionsRouter_Fulfill:test_Fulfill_SuccessUserCallbackRunsOutOfGas() (gas: 658973) +FunctionsRouter_Fulfill:test_Fulfill_RequestNotProcessedSubscriptionBalanceInvariant() (gas: 180976) +FunctionsRouter_Fulfill:test_Fulfill_RevertIfNotCommittedCoordinator() (gas: 28152) +FunctionsRouter_Fulfill:test_Fulfill_RevertIfPaused() (gas: 156535) +FunctionsRouter_Fulfill:test_Fulfill_SuccessClientNoLongerExists() (gas: 335070) +FunctionsRouter_Fulfill:test_Fulfill_SuccessFulfilled() (gas: 348695) +FunctionsRouter_Fulfill:test_Fulfill_SuccessUserCallbackReverts() (gas: 2627478) +FunctionsRouter_Fulfill:test_Fulfill_SuccessUserCallbackRunsOutOfGas() (gas: 658423) FunctionsRouter_GetAdminFee:test_GetAdminFee_Success() (gas: 18323) FunctionsRouter_GetAllowListId:test_GetAllowListId_Success() (gas: 13241) -FunctionsRouter_GetConfig:test_GetConfig_Success() (gas: 40170) -FunctionsRouter_GetContractById:test_GetContractById_RevertIfRouteDoesNotExist() (gas: 13839) +FunctionsRouter_GetConfig:test_GetConfig_Success() (gas: 40193) +FunctionsRouter_GetContractById:test_GetContractById_RevertIfRouteDoesNotExist() (gas: 13862) FunctionsRouter_GetContractById:test_GetContractById_SuccessIfRouteExists() (gas: 17704) -FunctionsRouter_GetProposedContractById:test_GetProposedContractById_RevertIfRouteDoesNotExist() (gas: 16373) -FunctionsRouter_GetProposedContractById:test_GetProposedContractById_SuccessIfRouteExists() (gas: 24266) +FunctionsRouter_GetProposedContractById:test_GetProposedContractById_RevertIfRouteDoesNotExist() (gas: 16417) +FunctionsRouter_GetProposedContractById:test_GetProposedContractById_SuccessIfRouteExists() (gas: 24289) FunctionsRouter_GetProposedContractSet:test_GetProposedContractSet_Success() (gas: 27289) FunctionsRouter_IsValidCallbackGasLimit:test_IsValidCallbackGasLimit_RevertGasLimitTooBig() (gas: 28087) FunctionsRouter_IsValidCallbackGasLimit:test_IsValidCallbackGasLimit_RevertInvalidConfig() (gas: 41095) FunctionsRouter_IsValidCallbackGasLimit:test_IsValidCallbackGasLimit_Success() (gas: 24632) -FunctionsRouter_Pause:test_Pause_RevertIfNotOwner() (gas: 13338) -FunctionsRouter_Pause:test_Pause_Success() (gas: 20669) -FunctionsRouter_ProposeContractsUpdate:test_ProposeContractsUpdate_RevertIfEmptyAddress() (gas: 14791) -FunctionsRouter_ProposeContractsUpdate:test_ProposeContractsUpdate_RevertIfExceedsMaxProposal() (gas: 21693) +FunctionsRouter_Pause:test_Pause_RevertIfNotOwner() (gas: 13361) +FunctionsRouter_Pause:test_Pause_Success() (gas: 20647) +FunctionsRouter_ProposeContractsUpdate:test_ProposeContractsUpdate_RevertIfEmptyAddress() (gas: 14769) +FunctionsRouter_ProposeContractsUpdate:test_ProposeContractsUpdate_RevertIfExceedsMaxProposal() (gas: 21716) FunctionsRouter_ProposeContractsUpdate:test_ProposeContractsUpdate_RevertIfLengthMismatch() (gas: 14670) FunctionsRouter_ProposeContractsUpdate:test_ProposeContractsUpdate_RevertIfNotNewContract() (gas: 19048) FunctionsRouter_ProposeContractsUpdate:test_ProposeContractsUpdate_RevertIfNotOwner() (gas: 23392) FunctionsRouter_ProposeContractsUpdate:test_ProposeContractsUpdate_Success() (gas: 118479) FunctionsRouter_SendRequest:test_SendRequest_RevertIfConsumerNotAllowed() (gas: 59400) -FunctionsRouter_SendRequest:test_SendRequest_RevertIfDuplicateRequestId() (gas: 217990) +FunctionsRouter_SendRequest:test_SendRequest_RevertIfDuplicateRequestId() (gas: 217996) FunctionsRouter_SendRequest:test_SendRequest_RevertIfEmptyData() (gas: 29426) -FunctionsRouter_SendRequest:test_SendRequest_RevertIfIncorrectDonId() (gas: 57904) -FunctionsRouter_SendRequest:test_SendRequest_RevertIfInsufficientSubscriptionBalance() (gas: 208562) +FunctionsRouter_SendRequest:test_SendRequest_RevertIfIncorrectDonId() (gas: 57882) +FunctionsRouter_SendRequest:test_SendRequest_RevertIfInsufficientSubscriptionBalance() (gas: 208451) FunctionsRouter_SendRequest:test_SendRequest_RevertIfInvalidCallbackGasLimit() (gas: 50953) FunctionsRouter_SendRequest:test_SendRequest_RevertIfInvalidDonId() (gas: 25082) -FunctionsRouter_SendRequest:test_SendRequest_RevertIfNoSubscription() (gas: 29132) +FunctionsRouter_SendRequest:test_SendRequest_RevertIfNoSubscription() (gas: 29177) FunctionsRouter_SendRequest:test_SendRequest_RevertIfPaused() (gas: 34291) -FunctionsRouter_SendRequest:test_SendRequest_Success() (gas: 226521) -FunctionsRouter_SendRequestToProposed:test_SendRequestToProposed_RevertIfConsumerNotAllowed() (gas: 65896) +FunctionsRouter_SendRequest:test_SendRequest_Success() (gas: 226324) +FunctionsRouter_SendRequestToProposed:test_SendRequestToProposed_RevertIfConsumerNotAllowed() (gas: 65918) FunctionsRouter_SendRequestToProposed:test_SendRequestToProposed_RevertIfEmptyData() (gas: 36012) FunctionsRouter_SendRequestToProposed:test_SendRequestToProposed_RevertIfIncorrectDonId() (gas: 29896) FunctionsRouter_SendRequestToProposed:test_SendRequestToProposed_RevertIfInvalidCallbackGasLimit() (gas: 57539) FunctionsRouter_SendRequestToProposed:test_SendRequestToProposed_RevertIfInvalidDonId() (gas: 27503) -FunctionsRouter_SendRequestToProposed:test_SendRequestToProposed_RevertIfNoSubscription() (gas: 35717) +FunctionsRouter_SendRequestToProposed:test_SendRequestToProposed_RevertIfNoSubscription() (gas: 35672) FunctionsRouter_SendRequestToProposed:test_SendRequestToProposed_RevertIfPaused() (gas: 40810) -FunctionsRouter_SendRequestToProposed:test_SendRequestToProposed_Success() (gas: 232958) -FunctionsRouter_SendRequestToProposed:test_SendRequest_RevertIfInsufficientSubscriptionBalance() (gas: 215010) +FunctionsRouter_SendRequestToProposed:test_SendRequestToProposed_Success() (gas: 232783) +FunctionsRouter_SendRequestToProposed:test_SendRequest_RevertIfInsufficientSubscriptionBalance() (gas: 214899) FunctionsRouter_SetAllowListId:test_SetAllowListId_Success() (gas: 33531) -FunctionsRouter_SetAllowListId:test_UpdateConfig_RevertIfNotOwner() (gas: 13403) -FunctionsRouter_Unpause:test_Unpause_RevertIfNotOwner() (gas: 13293) -FunctionsRouter_Unpause:test_Unpause_Success() (gas: 77725) -FunctionsRouter_UpdateConfig:test_UpdateConfig_RevertIfNotOwner() (gas: 24437) -FunctionsRouter_UpdateConfig:test_UpdateConfig_Success() (gas: 63353) -FunctionsRouter_UpdateContracts:test_UpdateContracts_RevertIfNotOwner() (gas: 13336) +FunctionsRouter_SetAllowListId:test_UpdateConfig_RevertIfNotOwner() (gas: 13381) +FunctionsRouter_Unpause:test_Unpause_RevertIfNotOwner() (gas: 13337) +FunctionsRouter_Unpause:test_Unpause_Success() (gas: 77748) +FunctionsRouter_UpdateConfig:test_UpdateConfig_RevertIfNotOwner() (gas: 24415) +FunctionsRouter_UpdateConfig:test_UpdateConfig_Success() (gas: 63331) +FunctionsRouter_UpdateContracts:test_UpdateContracts_RevertIfNotOwner() (gas: 13314) FunctionsRouter_UpdateContracts:test_UpdateContracts_Success() (gas: 39269) FunctionsSubscriptions_AcceptSubscriptionOwnerTransfer:test_AcceptSubscriptionOwnerTransfer_RevertIfNotAllowedSender() (gas: 60413) FunctionsSubscriptions_AcceptSubscriptionOwnerTransfer:test_AcceptSubscriptionOwnerTransfer_RevertIfPaused() (gas: 61040) FunctionsSubscriptions_AcceptSubscriptionOwnerTransfer:test_AcceptSubscriptionOwnerTransfer_RevertIfSenderBecomesBlocked() (gas: 139706) FunctionsSubscriptions_AcceptSubscriptionOwnerTransfer:test_AcceptSubscriptionOwnerTransfer_RevertIfSenderIsNotNewOwner() (gas: 62780) -FunctionsSubscriptions_AcceptSubscriptionOwnerTransfer:test_AcceptSubscriptionOwnerTransfer_Success() (gas: 240035) +FunctionsSubscriptions_AcceptSubscriptionOwnerTransfer:test_AcceptSubscriptionOwnerTransfer_Success() (gas: 239919) FunctionsSubscriptions_AddConsumer:test_AddConsumer_RevertIfMaximumConsumers() (gas: 138033) FunctionsSubscriptions_AddConsumer:test_AddConsumer_RevertIfMaximumConsumersAfterConfigUpdate() (gas: 164977) -FunctionsSubscriptions_AddConsumer:test_AddConsumer_RevertIfNoSubscription() (gas: 12955) -FunctionsSubscriptions_AddConsumer:test_AddConsumer_RevertIfNotAllowedSender() (gas: 102450) -FunctionsSubscriptions_AddConsumer:test_AddConsumer_RevertIfNotSubscriptionOwner() (gas: 87205) +FunctionsSubscriptions_AddConsumer:test_AddConsumer_RevertIfNoSubscription() (gas: 12933) +FunctionsSubscriptions_AddConsumer:test_AddConsumer_RevertIfNotAllowedSender() (gas: 102428) +FunctionsSubscriptions_AddConsumer:test_AddConsumer_RevertIfNotSubscriptionOwner() (gas: 87272) FunctionsSubscriptions_AddConsumer:test_AddConsumer_RevertIfPaused() (gas: 18100) FunctionsSubscriptions_AddConsumer:test_AddConsumer_Success() (gas: 96221) FunctionsSubscriptions_CancelSubscription:test_CancelSubscription_RevertIfNoSubscription() (gas: 15053) -FunctionsSubscriptions_CancelSubscription:test_CancelSubscription_RevertIfNotAllowedSender() (gas: 102529) -FunctionsSubscriptions_CancelSubscription:test_CancelSubscription_RevertIfNotSubscriptionOwner() (gas: 89318) +FunctionsSubscriptions_CancelSubscription:test_CancelSubscription_RevertIfNotAllowedSender() (gas: 102507) +FunctionsSubscriptions_CancelSubscription:test_CancelSubscription_RevertIfNotSubscriptionOwner() (gas: 89341) FunctionsSubscriptions_CancelSubscription:test_CancelSubscription_RevertIfPaused() (gas: 20157) -FunctionsSubscriptions_CancelSubscription:test_CancelSubscription_RevertIfPendingRequests() (gas: 218446) +FunctionsSubscriptions_CancelSubscription:test_CancelSubscription_RevertIfPendingRequests() (gas: 218308) FunctionsSubscriptions_CancelSubscription:test_CancelSubscription_SuccessForfeitAllBalanceAsDeposit() (gas: 115656) FunctionsSubscriptions_CancelSubscription:test_CancelSubscription_SuccessForfeitSomeBalanceAsDeposit() (gas: 126964) FunctionsSubscriptions_CancelSubscription_ReceiveDeposit:test_CancelSubscription_SuccessRecieveDeposit() (gas: 75369) FunctionsSubscriptions_Constructor:test_Constructor_Success() (gas: 10488) FunctionsSubscriptions_CreateSubscriptionWithConsumer:test_CreateSubscriptionWithConsumer_RevertIfNotAllowedSender() (gas: 28688) -FunctionsSubscriptions_CreateSubscriptionWithConsumer:test_CreateSubscriptionWithConsumer_RevertIfPaused() (gas: 17994) +FunctionsSubscriptions_CreateSubscriptionWithConsumer:test_CreateSubscriptionWithConsumer_RevertIfPaused() (gas: 18038) FunctionsSubscriptions_CreateSubscriptionWithConsumer:test_CreateSubscriptionWithConsumer_Success() (gas: 353899) -FunctionsSubscriptions_GetConsumer:test_GetConsumer_Success() (gas: 17256) -FunctionsSubscriptions_GetFlags:test_GetFlags_SuccessInvalidSubscription() (gas: 13438) -FunctionsSubscriptions_GetFlags:test_GetFlags_SuccessValidSubscription() (gas: 41243) +FunctionsSubscriptions_GetConsumer:test_GetConsumer_Success() (gas: 17279) +FunctionsSubscriptions_GetFlags:test_GetFlags_SuccessInvalidSubscription() (gas: 13504) +FunctionsSubscriptions_GetFlags:test_GetFlags_SuccessValidSubscription() (gas: 41221) FunctionsSubscriptions_GetSubscription:test_GetSubscription_Success() (gas: 32968) FunctionsSubscriptions_GetSubscriptionCount:test_GetSubscriptionCount_Success() (gas: 13305) -FunctionsSubscriptions_GetSubscriptionsInRange:test_GetSubscriptionsInRange_RevertIfEndIsAfterLastSubscription() (gas: 16547) +FunctionsSubscriptions_GetSubscriptionsInRange:test_GetSubscriptionsInRange_RevertIfEndIsAfterLastSubscription() (gas: 16570) FunctionsSubscriptions_GetSubscriptionsInRange:test_GetSubscriptionsInRange_RevertIfStartIsAfterEnd() (gas: 13465) -FunctionsSubscriptions_GetSubscriptionsInRange:test_GetSubscriptionsInRange_Success() (gas: 65990) -FunctionsSubscriptions_GetTotalBalance:test_GetTotalBalance_Success() (gas: 15347) +FunctionsSubscriptions_GetSubscriptionsInRange:test_GetSubscriptionsInRange_Success() (gas: 65968) +FunctionsSubscriptions_GetTotalBalance:test_GetTotalBalance_Success() (gas: 15370) FunctionsSubscriptions_OnTokenTransfer:test_OnTokenTransfer_RevertIfCallerIsNoCalldata() (gas: 39908) FunctionsSubscriptions_OnTokenTransfer:test_OnTokenTransfer_RevertIfCallerIsNoSubscription() (gas: 42382) FunctionsSubscriptions_OnTokenTransfer:test_OnTokenTransfer_RevertIfCallerIsNotLink() (gas: 13419) FunctionsSubscriptions_OnTokenTransfer:test_OnTokenTransfer_RevertIfPaused() (gas: 47325) FunctionsSubscriptions_OnTokenTransfer:test_OnTokenTransfer_Success() (gas: 84314) -FunctionsSubscriptions_OracleWithdraw:test_OracleWithdraw_RevertIfAmountMoreThanBalance() (gas: 20766) +FunctionsSubscriptions_OracleWithdraw:test_OracleWithdraw_RevertIfAmountMoreThanBalance() (gas: 20744) FunctionsSubscriptions_OracleWithdraw:test_OracleWithdraw_RevertIfBalanceInvariant() (gas: 189) -FunctionsSubscriptions_OracleWithdraw:test_OracleWithdraw_RevertIfNoAmount() (gas: 15641) +FunctionsSubscriptions_OracleWithdraw:test_OracleWithdraw_RevertIfNoAmount() (gas: 15686) FunctionsSubscriptions_OracleWithdraw:test_OracleWithdraw_RevertIfPaused() (gas: 20859) -FunctionsSubscriptions_OracleWithdraw:test_OracleWithdraw_SuccessPaysRecipient() (gas: 60075) +FunctionsSubscriptions_OracleWithdraw:test_OracleWithdraw_SuccessPaysRecipient() (gas: 60119) FunctionsSubscriptions_OracleWithdraw:test_OracleWithdraw_SuccessSetsBalanceToZero() (gas: 57716) -FunctionsSubscriptions_OwnerCancelSubscription:test_OwnerCancelSubscription_RevertIfNoSubscription() (gas: 12818) -FunctionsSubscriptions_OwnerCancelSubscription:test_OwnerCancelSubscription_RevertIfNotOwner() (gas: 15549) -FunctionsSubscriptions_OwnerCancelSubscription:test_OwnerCancelSubscription_Success() (gas: 55141) +FunctionsSubscriptions_OwnerCancelSubscription:test_OwnerCancelSubscription_RevertIfNoSubscription() (gas: 12796) +FunctionsSubscriptions_OwnerCancelSubscription:test_OwnerCancelSubscription_RevertIfNotOwner() (gas: 15594) +FunctionsSubscriptions_OwnerCancelSubscription:test_OwnerCancelSubscription_Success() (gas: 55177) FunctionsSubscriptions_OwnerCancelSubscription:test_OwnerCancelSubscription_SuccessDeletesSubscription() (gas: 49607) FunctionsSubscriptions_OwnerCancelSubscription:test_OwnerCancelSubscription_SuccessSubOwnerRefunded() (gas: 53166) -FunctionsSubscriptions_OwnerCancelSubscription:test_OwnerCancelSubscription_SuccessWhenRequestInFlight() (gas: 186649) -FunctionsSubscriptions_OwnerWithdraw:test_OwnerWithdraw_RevertIfAmountMoreThanBalance() (gas: 17945) +FunctionsSubscriptions_OwnerCancelSubscription:test_OwnerCancelSubscription_SuccessWhenRequestInFlight() (gas: 186511) +FunctionsSubscriptions_OwnerWithdraw:test_OwnerWithdraw_RevertIfAmountMoreThanBalance() (gas: 17923) FunctionsSubscriptions_OwnerWithdraw:test_OwnerWithdraw_RevertIfBalanceInvariant() (gas: 210) -FunctionsSubscriptions_OwnerWithdraw:test_OwnerWithdraw_RevertIfNotOwner() (gas: 15555) +FunctionsSubscriptions_OwnerWithdraw:test_OwnerWithdraw_RevertIfNotOwner() (gas: 15600) FunctionsSubscriptions_OwnerWithdraw:test_OwnerWithdraw_SuccessIfNoAmount() (gas: 33839) -FunctionsSubscriptions_OwnerWithdraw:test_OwnerWithdraw_SuccessIfRecipientAddressZero() (gas: 31649) +FunctionsSubscriptions_OwnerWithdraw:test_OwnerWithdraw_SuccessIfRecipientAddressZero() (gas: 31627) FunctionsSubscriptions_OwnerWithdraw:test_OwnerWithdraw_SuccessPaysRecipient() (gas: 33935) FunctionsSubscriptions_OwnerWithdraw:test_OwnerWithdraw_SuccessSetsBalanceToZero() (gas: 31584) -FunctionsSubscriptions_PendingRequestExists:test_PendingRequestExists_SuccessFalseIfNoPendingRequests() (gas: 17818) -FunctionsSubscriptions_PendingRequestExists:test_PendingRequestExists_SuccessTrueIfPendingRequests() (gas: 203449) -FunctionsSubscriptions_ProposeSubscriptionOwnerTransfer:test_ProposeSubscriptionOwnerTransfer_RevertIfEmptyNewOwner() (gas: 27664) -FunctionsSubscriptions_ProposeSubscriptionOwnerTransfer:test_ProposeSubscriptionOwnerTransfer_RevertIfInvalidNewOwner() (gas: 57815) +FunctionsSubscriptions_PendingRequestExists:test_PendingRequestExists_SuccessFalseIfNoPendingRequests() (gas: 17796) +FunctionsSubscriptions_PendingRequestExists:test_PendingRequestExists_SuccessTrueIfPendingRequests() (gas: 203311) +FunctionsSubscriptions_ProposeSubscriptionOwnerTransfer:test_ProposeSubscriptionOwnerTransfer_RevertIfEmptyNewOwner() (gas: 27642) +FunctionsSubscriptions_ProposeSubscriptionOwnerTransfer:test_ProposeSubscriptionOwnerTransfer_RevertIfInvalidNewOwner() (gas: 57793) FunctionsSubscriptions_ProposeSubscriptionOwnerTransfer:test_ProposeSubscriptionOwnerTransfer_RevertIfNoSubscription() (gas: 15013) -FunctionsSubscriptions_ProposeSubscriptionOwnerTransfer:test_ProposeSubscriptionOwnerTransfer_RevertIfNotAllowedSender() (gas: 119775) -FunctionsSubscriptions_ProposeSubscriptionOwnerTransfer:test_ProposeSubscriptionOwnerTransfer_RevertIfNotSubscriptionOwner() (gas: 17969) -FunctionsSubscriptions_ProposeSubscriptionOwnerTransfer:test_ProposeSubscriptionOwnerTransfer_RevertIfPaused() (gas: 20137) -FunctionsSubscriptions_ProposeSubscriptionOwnerTransfer:test_ProposeSubscriptionOwnerTransfer_Success() (gas: 68596) -FunctionsSubscriptions_ProposeSubscriptionOwnerTransfer:test_ProposeSubscriptionOwnerTransfer_SuccessChangeProposedOwner() (gas: 83539) -FunctionsSubscriptions_RecoverFunds:test_OwnerCancelSubscription_RevertIfNotOwner() (gas: 15554) -FunctionsSubscriptions_RecoverFunds:test_RecoverFunds_Success() (gas: 41376) +FunctionsSubscriptions_ProposeSubscriptionOwnerTransfer:test_ProposeSubscriptionOwnerTransfer_RevertIfNotAllowedSender() (gas: 119820) +FunctionsSubscriptions_ProposeSubscriptionOwnerTransfer:test_ProposeSubscriptionOwnerTransfer_RevertIfNotSubscriptionOwner() (gas: 17947) +FunctionsSubscriptions_ProposeSubscriptionOwnerTransfer:test_ProposeSubscriptionOwnerTransfer_RevertIfPaused() (gas: 20181) +FunctionsSubscriptions_ProposeSubscriptionOwnerTransfer:test_ProposeSubscriptionOwnerTransfer_Success() (gas: 68574) +FunctionsSubscriptions_ProposeSubscriptionOwnerTransfer:test_ProposeSubscriptionOwnerTransfer_SuccessChangeProposedOwner() (gas: 83582) +FunctionsSubscriptions_RecoverFunds:test_OwnerCancelSubscription_RevertIfNotOwner() (gas: 15577) +FunctionsSubscriptions_RecoverFunds:test_RecoverFunds_Success() (gas: 41358) FunctionsSubscriptions_RemoveConsumer:test_RemoveConsumer_RevertIfInvalidConsumer() (gas: 30310) FunctionsSubscriptions_RemoveConsumer:test_RemoveConsumer_RevertIfNoSubscription() (gas: 15031) FunctionsSubscriptions_RemoveConsumer:test_RemoveConsumer_RevertIfNotAllowedSender() (gas: 102444) -FunctionsSubscriptions_RemoveConsumer:test_RemoveConsumer_RevertIfNotSubscriptionOwner() (gas: 87254) -FunctionsSubscriptions_RemoveConsumer:test_RemoveConsumer_RevertIfPaused() (gas: 18058) -FunctionsSubscriptions_RemoveConsumer:test_RemoveConsumer_RevertIfPendingRequests() (gas: 215971) -FunctionsSubscriptions_RemoveConsumer:test_RemoveConsumer_Success() (gas: 42088) +FunctionsSubscriptions_RemoveConsumer:test_RemoveConsumer_RevertIfNotSubscriptionOwner() (gas: 87277) +FunctionsSubscriptions_RemoveConsumer:test_RemoveConsumer_RevertIfPaused() (gas: 18103) +FunctionsSubscriptions_RemoveConsumer:test_RemoveConsumer_RevertIfPendingRequests() (gas: 215863) +FunctionsSubscriptions_RemoveConsumer:test_RemoveConsumer_Success() (gas: 42066) FunctionsSubscriptions_SetFlags:test_SetFlags_RevertIfNoSubscription() (gas: 12888) FunctionsSubscriptions_SetFlags:test_SetFlags_RevertIfNotOwner() (gas: 15684) FunctionsSubscriptions_SetFlags:test_SetFlags_Success() (gas: 38434) FunctionsSubscriptions_TimeoutRequests:test_TimeoutRequests_RevertIfPaused() (gas: 25955) FunctionsSubscriptions_TimeoutRequests:test_TimeoutRequests_RevertIfTimeoutNotExceeded() (gas: 25261) -FunctionsSubscriptions_TimeoutRequests:test_TimeoutRequests_RevertInvalidRequest() (gas: 28242) -FunctionsSubscriptions_TimeoutRequests:test_TimeoutRequests_Success() (gas: 58416) -FunctionsSubscriptions_createSubscription:test_CreateSubscription_RevertIfNotAllowedSender() (gas: 26418) +FunctionsSubscriptions_TimeoutRequests:test_TimeoutRequests_RevertInvalidRequest() (gas: 28220) +FunctionsSubscriptions_TimeoutRequests:test_TimeoutRequests_Success() (gas: 58394) +FunctionsSubscriptions_createSubscription:test_CreateSubscription_RevertIfNotAllowedSender() (gas: 26462) FunctionsSubscriptions_createSubscription:test_CreateSubscription_RevertIfPaused() (gas: 15759) FunctionsSubscriptions_createSubscription:test_CreateSubscription_Success() (gas: 153701) -FunctionsTermsOfServiceAllowList_AcceptTermsOfService:testAcceptTermsOfService_InvalidSigner_vuln() (gas: 94913) -FunctionsTermsOfServiceAllowList_AcceptTermsOfService:test_AcceptTermsOfService_RevertIfAcceptorIsNotSender() (gas: 25859) -FunctionsTermsOfServiceAllowList_AcceptTermsOfService:test_AcceptTermsOfService_RevertIfBlockedSender() (gas: 88990) -FunctionsTermsOfServiceAllowList_AcceptTermsOfService:test_AcceptTermsOfService_RevertIfInvalidSigner() (gas: 23619) -FunctionsTermsOfServiceAllowList_AcceptTermsOfService:test_AcceptTermsOfService_RevertIfRecipientContractIsNotSender() (gas: 1866552) -FunctionsTermsOfServiceAllowList_AcceptTermsOfService:test_AcceptTermsOfService_RevertIfRecipientIsNotSender() (gas: 26025) -FunctionsTermsOfServiceAllowList_AcceptTermsOfService:test_AcceptTermsOfService_SuccessIfAcceptingForContract() (gas: 1946965) -FunctionsTermsOfServiceAllowList_AcceptTermsOfService:test_AcceptTermsOfService_SuccessIfAcceptingForSelf() (gas: 104509) -FunctionsTermsOfServiceAllowList_BlockSender:test_BlockSender_RevertIfNotOwner() (gas: 15491) -FunctionsTermsOfServiceAllowList_BlockSender:test_BlockSender_Success() (gas: 97541) +FunctionsTermsOfServiceAllowList_AcceptTermsOfService:testAcceptTermsOfService_InvalidSigner_vuln() (gas: 94943) +FunctionsTermsOfServiceAllowList_AcceptTermsOfService:test_AcceptTermsOfService_RevertIfAcceptorIsNotSender() (gas: 25925) +FunctionsTermsOfServiceAllowList_AcceptTermsOfService:test_AcceptTermsOfService_RevertIfBlockedSender() (gas: 89013) +FunctionsTermsOfServiceAllowList_AcceptTermsOfService:test_AcceptTermsOfService_RevertIfInvalidSigner() (gas: 23620) +FunctionsTermsOfServiceAllowList_AcceptTermsOfService:test_AcceptTermsOfService_RevertIfRecipientContractIsNotSender() (gas: 1866619) +FunctionsTermsOfServiceAllowList_AcceptTermsOfService:test_AcceptTermsOfService_RevertIfRecipientIsNotSender() (gas: 28526) +FunctionsTermsOfServiceAllowList_AcceptTermsOfService:test_AcceptTermsOfService_SuccessIfAcceptingForContract() (gas: 1946966) +FunctionsTermsOfServiceAllowList_AcceptTermsOfService:test_AcceptTermsOfService_SuccessIfAcceptingForSelf() (gas: 104555) +FunctionsTermsOfServiceAllowList_BlockSender:test_BlockSender_RevertIfNotOwner() (gas: 15535) +FunctionsTermsOfServiceAllowList_BlockSender:test_BlockSender_Success() (gas: 97587) FunctionsTermsOfServiceAllowList_Constructor:test_Constructor_Success() (gas: 15345) FunctionsTermsOfServiceAllowList_GetAllAllowedSenders:test_GetAllAllowedSenders_Success() (gas: 19243) FunctionsTermsOfServiceAllowList_GetAllowedSendersCount:test_GetAllowedSendersCount_Success() (gas: 13332) -FunctionsTermsOfServiceAllowList_GetAllowedSendersInRange:test_GetAllowedSendersInRange_RevertIfAllowedSendersIsEmpty() (gas: 13161056) -FunctionsTermsOfServiceAllowList_GetAllowedSendersInRange:test_GetAllowedSendersInRange_RevertIfEndIsAfterLastAllowedSender() (gas: 16554) -FunctionsTermsOfServiceAllowList_GetAllowedSendersInRange:test_GetAllowedSendersInRange_RevertIfStartIsAfterEnd() (gas: 13284) -FunctionsTermsOfServiceAllowList_GetAllowedSendersInRange:test_GetAllowedSendersInRange_Success() (gas: 20312) +FunctionsTermsOfServiceAllowList_GetAllowedSendersInRange:test_GetAllowedSendersInRange_RevertIfAllowedSendersIsEmpty() (gas: 13326576) +FunctionsTermsOfServiceAllowList_GetAllowedSendersInRange:test_GetAllowedSendersInRange_RevertIfEndIsAfterLastAllowedSender() (gas: 16532) +FunctionsTermsOfServiceAllowList_GetAllowedSendersInRange:test_GetAllowedSendersInRange_RevertIfStartIsAfterEnd() (gas: 13307) +FunctionsTermsOfServiceAllowList_GetAllowedSendersInRange:test_GetAllowedSendersInRange_Success() (gas: 20335) FunctionsTermsOfServiceAllowList_GetBlockedSendersCount:test_GetBlockedSendersCount_Success() (gas: 13268) -FunctionsTermsOfServiceAllowList_GetBlockedSendersInRange:test_GetBlockedSendersInRange_RevertIfAllowedSendersIsEmpty() (gas: 13161066) +FunctionsTermsOfServiceAllowList_GetBlockedSendersInRange:test_GetBlockedSendersInRange_RevertIfAllowedSendersIsEmpty() (gas: 13326564) FunctionsTermsOfServiceAllowList_GetBlockedSendersInRange:test_GetBlockedSendersInRange_RevertIfEndIsAfterLastAllowedSender() (gas: 16549) -FunctionsTermsOfServiceAllowList_GetBlockedSendersInRange:test_GetBlockedSendersInRange_RevertIfStartIsAfterEnd() (gas: 13367) -FunctionsTermsOfServiceAllowList_GetBlockedSendersInRange:test_GetBlockedSendersInRange_Success() (gas: 18537) -FunctionsTermsOfServiceAllowList_GetConfig:test_GetConfig_Success() (gas: 16388) +FunctionsTermsOfServiceAllowList_GetBlockedSendersInRange:test_GetBlockedSendersInRange_RevertIfStartIsAfterEnd() (gas: 13345) +FunctionsTermsOfServiceAllowList_GetBlockedSendersInRange:test_GetBlockedSendersInRange_Success() (gas: 18580) +FunctionsTermsOfServiceAllowList_GetConfig:test_GetConfig_Success() (gas: 16411) FunctionsTermsOfServiceAllowList_GetMessage:test_GetMessage_Success() (gas: 11918) -FunctionsTermsOfServiceAllowList_HasAccess:test_HasAccess_FalseWhenEnabled() (gas: 16257) -FunctionsTermsOfServiceAllowList_HasAccess:test_HasAccess_TrueWhenDisabled() (gas: 23848) +FunctionsTermsOfServiceAllowList_HasAccess:test_HasAccess_FalseWhenEnabled() (gas: 16235) +FunctionsTermsOfServiceAllowList_HasAccess:test_HasAccess_TrueWhenDisabled() (gas: 23877) FunctionsTermsOfServiceAllowList_IsBlockedSender:test_IsBlockedSender_SuccessFalse() (gas: 15776) FunctionsTermsOfServiceAllowList_IsBlockedSender:test_IsBlockedSender_SuccessTrue() (gas: 86974) -FunctionsTermsOfServiceAllowList_UnblockSender:test_UnblockSender_RevertIfNotOwner() (gas: 13502) -FunctionsTermsOfServiceAllowList_UnblockSender:test_UnblockSender_Success() (gas: 96216) -FunctionsTermsOfServiceAllowList_UpdateConfig:test_UpdateConfig_RevertIfNotOwner() (gas: 13812) -FunctionsTermsOfServiceAllowList_UpdateConfig:test_UpdateConfig_Success() (gas: 22817) -Gas_AcceptTermsOfService:test_AcceptTermsOfService_Gas() (gas: 84702) +FunctionsTermsOfServiceAllowList_MigratePreviouslyAllowedSenders:test_MigratePreviouslyAllowedSenders_RevertIfNotOwner() (gas: 13987) +FunctionsTermsOfServiceAllowList_MigratePreviouslyAllowedSenders:test_MigratePreviouslyAllowedSenders_Success() (gas: 210636) +FunctionsTermsOfServiceAllowList_UnblockSender:test_UnblockSender_RevertIfNotOwner() (gas: 13548) +FunctionsTermsOfServiceAllowList_UnblockSender:test_UnblockSender_Success() (gas: 96240) +FunctionsTermsOfServiceAllowList_UpdateConfig:test_UpdateConfig_RevertIfNotOwner() (gas: 13819) +FunctionsTermsOfServiceAllowList_UpdateConfig:test_UpdateConfig_Success() (gas: 22824) +Gas_AcceptTermsOfService:test_AcceptTermsOfService_Gas() (gas: 84725) Gas_AddConsumer:test_AddConsumer_Gas() (gas: 79140) Gas_CreateSubscription:test_CreateSubscription_Gas() (gas: 73419) -Gas_FulfillRequest_DuplicateRequestID:test_FulfillRequest_DuplicateRequestID_MaximumGas() (gas: 20717) -Gas_FulfillRequest_DuplicateRequestID:test_FulfillRequest_DuplicateRequestID_MinimumGas() (gas: 20157) -Gas_FulfillRequest_Success:test_FulfillRequest_Success_MaximumGas() (gas: 501825) -Gas_FulfillRequest_Success:test_FulfillRequest_Success_MinimumGas() (gas: 203029) -Gas_FundSubscription:test_FundSubscription_Gas() (gas: 38524) -Gas_SendRequest:test_SendRequest_MaximumGas() (gas: 1003809) -Gas_SendRequest:test_SendRequest_MinimumGas() (gas: 181701) \ No newline at end of file +Gas_FulfillRequest_DuplicateRequestID:test_FulfillRequest_DuplicateRequestID_MaximumGas() (gas: 20562) +Gas_FulfillRequest_DuplicateRequestID:test_FulfillRequest_DuplicateRequestID_MinimumGas() (gas: 20024) +Gas_FulfillRequest_Success:test_FulfillRequest_Success_MaximumGas() (gas: 501184) +Gas_FulfillRequest_Success:test_FulfillRequest_Success_MinimumGas() (gas: 202376) +Gas_FundSubscription:test_FundSubscription_Gas() (gas: 38518) +Gas_SendRequest:test_SendRequest_MaximumGas() (gas: 984338) +Gas_SendRequest:test_SendRequest_MinimumGas() (gas: 181561) \ No newline at end of file diff --git a/contracts/gas-snapshots/keystone.gas-snapshot b/contracts/gas-snapshots/keystone.gas-snapshot index 2880e4c0e31..3768721ab42 100644 --- a/contracts/gas-snapshots/keystone.gas-snapshot +++ b/contracts/gas-snapshots/keystone.gas-snapshot @@ -1,107 +1,114 @@ -CapabilitiesRegistry_AddCapabilitiesTest:test_AddCapability_NoConfigurationContract() (gas: 154832) -CapabilitiesRegistry_AddCapabilitiesTest:test_AddCapability_WithConfiguration() (gas: 178813) -CapabilitiesRegistry_AddCapabilitiesTest:test_RevertWhen_CalledByNonAdmin() (gas: 24723) -CapabilitiesRegistry_AddCapabilitiesTest:test_RevertWhen_CapabilityExists() (gas: 145703) -CapabilitiesRegistry_AddCapabilitiesTest:test_RevertWhen_ConfigurationContractDoesNotMatchInterface() (gas: 94606) -CapabilitiesRegistry_AddCapabilitiesTest:test_RevertWhen_ConfigurationContractNotDeployed() (gas: 92961) -CapabilitiesRegistry_AddDONTest:test_AddDON() (gas: 372302) -CapabilitiesRegistry_AddDONTest:test_RevertWhen_CalledByNonAdmin() (gas: 19273) -CapabilitiesRegistry_AddDONTest:test_RevertWhen_CapabilityDoesNotExist() (gas: 169752) -CapabilitiesRegistry_AddDONTest:test_RevertWhen_DeprecatedCapabilityAdded() (gas: 239789) -CapabilitiesRegistry_AddDONTest:test_RevertWhen_DuplicateCapabilityAdded() (gas: 249596) -CapabilitiesRegistry_AddDONTest:test_RevertWhen_DuplicateNodeAdded() (gas: 116890) -CapabilitiesRegistry_AddDONTest:test_RevertWhen_FaultToleranceIsZero() (gas: 43358) -CapabilitiesRegistry_AddDONTest:test_RevertWhen_NodeAlreadyBelongsToWorkflowDON() (gas: 343924) -CapabilitiesRegistry_AddDONTest:test_RevertWhen_NodeDoesNotSupportCapability() (gas: 180150) -CapabilitiesRegistry_AddNodeOperatorsTest:test_AddNodeOperators() (gas: 184135) -CapabilitiesRegistry_AddNodeOperatorsTest:test_RevertWhen_CalledByNonAdmin() (gas: 17602) -CapabilitiesRegistry_AddNodeOperatorsTest:test_RevertWhen_NodeOperatorAdminAddressZero() (gas: 18498) -CapabilitiesRegistry_AddNodesTest:test_AddsNodeParams() (gas: 358448) -CapabilitiesRegistry_AddNodesTest:test_OwnerCanAddNodes() (gas: 358414) -CapabilitiesRegistry_AddNodesTest:test_RevertWhen_AddingDuplicateP2PId() (gas: 301229) -CapabilitiesRegistry_AddNodesTest:test_RevertWhen_AddingNodeWithInvalidCapability() (gas: 55174) -CapabilitiesRegistry_AddNodesTest:test_RevertWhen_AddingNodeWithInvalidNodeOperator() (gas: 24895) -CapabilitiesRegistry_AddNodesTest:test_RevertWhen_AddingNodeWithoutCapabilities() (gas: 27669) -CapabilitiesRegistry_AddNodesTest:test_RevertWhen_CalledByNonNodeOperatorAdminAndNonOwner() (gas: 25108) -CapabilitiesRegistry_AddNodesTest:test_RevertWhen_P2PIDEmpty() (gas: 27408) -CapabilitiesRegistry_AddNodesTest:test_RevertWhen_SignerAddressEmpty() (gas: 27047) -CapabilitiesRegistry_AddNodesTest:test_RevertWhen_SignerAddressNotUnique() (gas: 309679) -CapabilitiesRegistry_DeprecateCapabilitiesTest:test_DeprecatesCapability() (gas: 89807) -CapabilitiesRegistry_DeprecateCapabilitiesTest:test_EmitsEvent() (gas: 89935) -CapabilitiesRegistry_DeprecateCapabilitiesTest:test_RevertWhen_CalledByNonAdmin() (gas: 22944) -CapabilitiesRegistry_DeprecateCapabilitiesTest:test_RevertWhen_CapabilityDoesNotExist() (gas: 16231) -CapabilitiesRegistry_DeprecateCapabilitiesTest:test_RevertWhen_CapabilityIsDeprecated() (gas: 91264) -CapabilitiesRegistry_GetCapabilitiesTest:test_ReturnsCapabilities() (gas: 135553) +CapabilitiesRegistry_AddCapabilitiesTest:test_AddCapability_NoConfigurationContract() (gas: 154809) +CapabilitiesRegistry_AddCapabilitiesTest:test_AddCapability_WithConfiguration() (gas: 180379) +CapabilitiesRegistry_AddCapabilitiesTest:test_RevertWhen_CalledByNonAdmin() (gas: 24678) +CapabilitiesRegistry_AddCapabilitiesTest:test_RevertWhen_CapabilityExists() (gas: 145613) +CapabilitiesRegistry_AddCapabilitiesTest:test_RevertWhen_ConfigurationContractDoesNotMatchInterface() (gas: 94543) +CapabilitiesRegistry_AddCapabilitiesTest:test_RevertWhen_ConfigurationContractNotDeployed() (gas: 96326) +CapabilitiesRegistry_AddDONTest:test_AddDON() (gas: 373893) +CapabilitiesRegistry_AddDONTest:test_RevertWhen_CalledByNonAdmin() (gas: 19288) +CapabilitiesRegistry_AddDONTest:test_RevertWhen_CapabilityDoesNotExist() (gas: 169767) +CapabilitiesRegistry_AddDONTest:test_RevertWhen_DeprecatedCapabilityAdded() (gas: 239739) +CapabilitiesRegistry_AddDONTest:test_RevertWhen_DuplicateCapabilityAdded() (gas: 250950) +CapabilitiesRegistry_AddDONTest:test_RevertWhen_DuplicateNodeAdded() (gas: 116905) +CapabilitiesRegistry_AddDONTest:test_RevertWhen_FaultToleranceIsZero() (gas: 43373) +CapabilitiesRegistry_AddDONTest:test_RevertWhen_NodeAlreadyBelongsToWorkflowDON() (gas: 344037) +CapabilitiesRegistry_AddDONTest:test_RevertWhen_NodeDoesNotSupportCapability() (gas: 180165) +CapabilitiesRegistry_AddDONTest_WhenMaliciousCapabilityConfigurationConfigured:test_RevertWhen_MaliciousCapabilitiesConfigContractTriesToRemoveCapabilitiesFromDONNodes() (gas: 340514) +CapabilitiesRegistry_AddNodeOperatorsTest:test_AddNodeOperators() (gas: 184157) +CapabilitiesRegistry_AddNodeOperatorsTest:test_RevertWhen_CalledByNonAdmin() (gas: 17624) +CapabilitiesRegistry_AddNodeOperatorsTest:test_RevertWhen_NodeOperatorAdminAddressZero() (gas: 18520) +CapabilitiesRegistry_AddNodesTest:test_AddsNodeParams() (gas: 358492) +CapabilitiesRegistry_AddNodesTest:test_OwnerCanAddNodes() (gas: 358458) +CapabilitiesRegistry_AddNodesTest:test_RevertWhen_AddingDuplicateP2PId() (gas: 301273) +CapabilitiesRegistry_AddNodesTest:test_RevertWhen_AddingNodeWithInvalidCapability() (gas: 55196) +CapabilitiesRegistry_AddNodesTest:test_RevertWhen_AddingNodeWithInvalidNodeOperator() (gas: 24917) +CapabilitiesRegistry_AddNodesTest:test_RevertWhen_AddingNodeWithoutCapabilities() (gas: 27691) +CapabilitiesRegistry_AddNodesTest:test_RevertWhen_CalledByNonNodeOperatorAdminAndNonOwner() (gas: 25130) +CapabilitiesRegistry_AddNodesTest:test_RevertWhen_P2PIDEmpty() (gas: 27430) +CapabilitiesRegistry_AddNodesTest:test_RevertWhen_SignerAddressEmpty() (gas: 27069) +CapabilitiesRegistry_AddNodesTest:test_RevertWhen_SignerAddressNotUnique() (gas: 309723) +CapabilitiesRegistry_DeprecateCapabilitiesTest:test_DeprecatesCapability() (gas: 89742) +CapabilitiesRegistry_DeprecateCapabilitiesTest:test_EmitsEvent() (gas: 89870) +CapabilitiesRegistry_DeprecateCapabilitiesTest:test_RevertWhen_CalledByNonAdmin() (gas: 22879) +CapabilitiesRegistry_DeprecateCapabilitiesTest:test_RevertWhen_CapabilityDoesNotExist() (gas: 16166) +CapabilitiesRegistry_DeprecateCapabilitiesTest:test_RevertWhen_CapabilityIsDeprecated() (gas: 91134) +CapabilitiesRegistry_GetCapabilitiesTest:test_ReturnsCapabilities() (gas: 135488) CapabilitiesRegistry_GetDONsTest:test_CorrectlyFetchesDONs() (gas: 65468) -CapabilitiesRegistry_GetDONsTest:test_DoesNotIncludeRemovedDONs() (gas: 64924) +CapabilitiesRegistry_GetDONsTest:test_DoesNotIncludeRemovedDONs() (gas: 65016) CapabilitiesRegistry_GetHashedCapabilityTest:test_CorrectlyGeneratesHashedCapabilityId() (gas: 11428) CapabilitiesRegistry_GetHashedCapabilityTest:test_DoesNotCauseIncorrectClashes() (gas: 13087) -CapabilitiesRegistry_GetNodeOperatorsTest:test_CorrectlyFetchesNodeOperators() (gas: 36407) -CapabilitiesRegistry_GetNodeOperatorsTest:test_DoesNotIncludeRemovedNodeOperators() (gas: 38692) +CapabilitiesRegistry_GetNodeOperatorsTest:test_CorrectlyFetchesNodeOperators() (gas: 36429) +CapabilitiesRegistry_GetNodeOperatorsTest:test_DoesNotIncludeRemovedNodeOperators() (gas: 38714) CapabilitiesRegistry_GetNodesTest:test_CorrectlyFetchesNodes() (gas: 65288) -CapabilitiesRegistry_GetNodesTest:test_DoesNotIncludeRemovedNodes() (gas: 73533) -CapabilitiesRegistry_RemoveDONsTest:test_RemovesDON() (gas: 54761) +CapabilitiesRegistry_GetNodesTest:test_DoesNotIncludeRemovedNodes() (gas: 73497) +CapabilitiesRegistry_RemoveDONsTest:test_RemovesDON() (gas: 54982) CapabilitiesRegistry_RemoveDONsTest:test_RevertWhen_CalledByNonAdmin() (gas: 15647) CapabilitiesRegistry_RemoveDONsTest:test_RevertWhen_DONDoesNotExist() (gas: 16550) CapabilitiesRegistry_RemoveNodeOperatorsTest:test_RemovesNodeOperator() (gas: 36122) CapabilitiesRegistry_RemoveNodeOperatorsTest:test_RevertWhen_CalledByNonOwner() (gas: 15816) -CapabilitiesRegistry_RemoveNodesTest:test_CanAddNodeWithSameSignerAddressAfterRemoving() (gas: 115151) -CapabilitiesRegistry_RemoveNodesTest:test_CanRemoveWhenDONDeleted() (gas: 287716) -CapabilitiesRegistry_RemoveNodesTest:test_CanRemoveWhenNodeNoLongerPartOfDON() (gas: 561023) -CapabilitiesRegistry_RemoveNodesTest:test_OwnerCanRemoveNodes() (gas: 73376) -CapabilitiesRegistry_RemoveNodesTest:test_RemovesNode() (gas: 75211) -CapabilitiesRegistry_RemoveNodesTest:test_RevertWhen_CalledByNonNodeOperatorAdminAndNonOwner() (gas: 25053) -CapabilitiesRegistry_RemoveNodesTest:test_RevertWhen_NodeDoesNotExist() (gas: 18418) -CapabilitiesRegistry_RemoveNodesTest:test_RevertWhen_NodePartOfCapabilitiesDON() (gas: 385369) -CapabilitiesRegistry_RemoveNodesTest:test_RevertWhen_P2PIDEmpty() (gas: 18408) +CapabilitiesRegistry_RemoveNodesTest:test_CanAddNodeWithSameSignerAddressAfterRemoving() (gas: 115150) +CapabilitiesRegistry_RemoveNodesTest:test_CanRemoveWhenDONDeleted() (gas: 287838) +CapabilitiesRegistry_RemoveNodesTest:test_CanRemoveWhenNodeNoLongerPartOfDON() (gas: 561183) +CapabilitiesRegistry_RemoveNodesTest:test_OwnerCanRemoveNodes() (gas: 73358) +CapabilitiesRegistry_RemoveNodesTest:test_RemovesNode() (gas: 75192) +CapabilitiesRegistry_RemoveNodesTest:test_RevertWhen_CalledByNonNodeOperatorAdminAndNonOwner() (gas: 25008) +CapabilitiesRegistry_RemoveNodesTest:test_RevertWhen_NodeDoesNotExist() (gas: 18373) +CapabilitiesRegistry_RemoveNodesTest:test_RevertWhen_NodePartOfCapabilitiesDON() (gas: 385422) +CapabilitiesRegistry_RemoveNodesTest:test_RevertWhen_P2PIDEmpty() (gas: 18363) CapabilitiesRegistry_TypeAndVersionTest:test_TypeAndVersion() (gas: 9796) -CapabilitiesRegistry_UpdateDONTest:test_RevertWhen_CalledByNonAdmin() (gas: 19415) -CapabilitiesRegistry_UpdateDONTest:test_RevertWhen_CapabilityDoesNotExist() (gas: 152914) -CapabilitiesRegistry_UpdateDONTest:test_RevertWhen_DONDoesNotExist() (gas: 17835) -CapabilitiesRegistry_UpdateDONTest:test_RevertWhen_DeprecatedCapabilityAdded() (gas: 222996) -CapabilitiesRegistry_UpdateDONTest:test_RevertWhen_DuplicateCapabilityAdded() (gas: 232804) -CapabilitiesRegistry_UpdateDONTest:test_RevertWhen_DuplicateNodeAdded() (gas: 107643) -CapabilitiesRegistry_UpdateDONTest:test_RevertWhen_NodeDoesNotSupportCapability() (gas: 163357) -CapabilitiesRegistry_UpdateDONTest:test_UpdatesDON() (gas: 371909) -CapabilitiesRegistry_UpdateNodeOperatorTest:test_RevertWhen_CalledByNonAdminAndNonOwner() (gas: 20631) -CapabilitiesRegistry_UpdateNodeOperatorTest:test_RevertWhen_NodeOperatorAdminIsZeroAddress() (gas: 20052) -CapabilitiesRegistry_UpdateNodeOperatorTest:test_RevertWhen_NodeOperatorDoesNotExist() (gas: 19790) -CapabilitiesRegistry_UpdateNodeOperatorTest:test_RevertWhen_NodeOperatorIdAndParamLengthsMismatch() (gas: 15430) -CapabilitiesRegistry_UpdateNodeOperatorTest:test_UpdatesNodeOperator() (gas: 36937) -CapabilitiesRegistry_UpdateNodesTest:test_CanUpdateParamsIfNodeSignerAddressNoLongerUsed() (gas: 256157) -CapabilitiesRegistry_UpdateNodesTest:test_OwnerCanUpdateNodes() (gas: 162059) -CapabilitiesRegistry_UpdateNodesTest:test_RevertWhen_AddingNodeWithInvalidCapability() (gas: 35766) -CapabilitiesRegistry_UpdateNodesTest:test_RevertWhen_CalledByNonNodeOperatorAdminAndNonOwner() (gas: 25069) -CapabilitiesRegistry_UpdateNodesTest:test_RevertWhen_NodeDoesNotExist() (gas: 27308) -CapabilitiesRegistry_UpdateNodesTest:test_RevertWhen_NodeSignerAlreadyAssignedToAnotherNode() (gas: 29219) -CapabilitiesRegistry_UpdateNodesTest:test_RevertWhen_P2PIDEmpty() (gas: 27296) -CapabilitiesRegistry_UpdateNodesTest:test_RevertWhen_RemovingCapabilityRequiredByCapabilityDON() (gas: 470803) -CapabilitiesRegistry_UpdateNodesTest:test_RevertWhen_RemovingCapabilityRequiredByWorkflowDON() (gas: 341084) -CapabilitiesRegistry_UpdateNodesTest:test_RevertWhen_SignerAddressEmpty() (gas: 26951) -CapabilitiesRegistry_UpdateNodesTest:test_RevertWhen_UpdatingNodeWithoutCapabilities() (gas: 25480) -CapabilitiesRegistry_UpdateNodesTest:test_UpdatesNodeParams() (gas: 162113) -KeystoneForwarder_ReportTest:test_Report_ConfigVersion() (gas: 1797755) -KeystoneForwarder_ReportTest:test_Report_FailedDeliveryWhenReceiverInterfaceNotSupported() (gas: 125910) -KeystoneForwarder_ReportTest:test_Report_FailedDeliveryWhenReceiverNotContract() (gas: 127403) -KeystoneForwarder_ReportTest:test_Report_SuccessfulDelivery() (gas: 155928) -KeystoneForwarder_ReportTest:test_RevertWhen_AlreadyAttempted() (gas: 152358) -KeystoneForwarder_ReportTest:test_RevertWhen_AnySignatureIsInvalid() (gas: 86348) -KeystoneForwarder_ReportTest:test_RevertWhen_AnySignerIsInvalid() (gas: 118486) +CapabilitiesRegistry_UpdateDONTest:test_RevertWhen_CalledByNonAdmin() (gas: 19323) +CapabilitiesRegistry_UpdateDONTest:test_RevertWhen_CapabilityDoesNotExist() (gas: 152958) +CapabilitiesRegistry_UpdateDONTest:test_RevertWhen_DONDoesNotExist() (gas: 17749) +CapabilitiesRegistry_UpdateDONTest:test_RevertWhen_DeprecatedCapabilityAdded() (gas: 222975) +CapabilitiesRegistry_UpdateDONTest:test_RevertWhen_DuplicateCapabilityAdded() (gas: 236986) +CapabilitiesRegistry_UpdateDONTest:test_RevertWhen_DuplicateNodeAdded() (gas: 107687) +CapabilitiesRegistry_UpdateDONTest:test_RevertWhen_NodeDoesNotSupportCapability() (gas: 163401) +CapabilitiesRegistry_UpdateDONTest:test_UpdatesDON() (gas: 373510) +CapabilitiesRegistry_UpdateNodeOperatorTest:test_RevertWhen_CalledByNonAdminAndNonOwner() (gas: 20684) +CapabilitiesRegistry_UpdateNodeOperatorTest:test_RevertWhen_NodeOperatorAdminIsZeroAddress() (gas: 20008) +CapabilitiesRegistry_UpdateNodeOperatorTest:test_RevertWhen_NodeOperatorDoesNotExist() (gas: 19746) +CapabilitiesRegistry_UpdateNodeOperatorTest:test_RevertWhen_NodeOperatorIdAndParamLengthsMismatch() (gas: 15386) +CapabilitiesRegistry_UpdateNodeOperatorTest:test_UpdatesNodeOperator() (gas: 36990) +CapabilitiesRegistry_UpdateNodesTest:test_CanUpdateParamsIfNodeSignerAddressNoLongerUsed() (gas: 256437) +CapabilitiesRegistry_UpdateNodesTest:test_OwnerCanUpdateNodes() (gas: 162210) +CapabilitiesRegistry_UpdateNodesTest:test_RevertWhen_AddingNodeWithInvalidCapability() (gas: 35895) +CapabilitiesRegistry_UpdateNodesTest:test_RevertWhen_CalledByAnotherNodeOperatorAdmin() (gas: 29222) +CapabilitiesRegistry_UpdateNodesTest:test_RevertWhen_CalledByNonNodeOperatorAdminAndNonOwner() (gas: 29399) +CapabilitiesRegistry_UpdateNodesTest:test_RevertWhen_NodeDoesNotExist() (gas: 29221) +CapabilitiesRegistry_UpdateNodesTest:test_RevertWhen_NodeSignerAlreadyAssignedToAnotherNode() (gas: 31348) +CapabilitiesRegistry_UpdateNodesTest:test_RevertWhen_P2PIDEmpty() (gas: 29187) +CapabilitiesRegistry_UpdateNodesTest:test_RevertWhen_RemovingCapabilityRequiredByCapabilityDON() (gas: 471030) +CapabilitiesRegistry_UpdateNodesTest:test_RevertWhen_RemovingCapabilityRequiredByWorkflowDON() (gas: 341311) +CapabilitiesRegistry_UpdateNodesTest:test_RevertWhen_SignerAddressEmpty() (gas: 29080) +CapabilitiesRegistry_UpdateNodesTest:test_RevertWhen_UpdatingNodeWithoutCapabilities() (gas: 27609) +CapabilitiesRegistry_UpdateNodesTest:test_UpdatesNodeParams() (gas: 162264) +KeystoneForwarder_ReportTest:test_Report_ConfigVersion() (gas: 2006044) +KeystoneForwarder_ReportTest:test_Report_FailedDeliveryWhenReceiverInterfaceNotSupported() (gas: 124668) +KeystoneForwarder_ReportTest:test_Report_FailedDeliveryWhenReceiverNotContract() (gas: 126927) +KeystoneForwarder_ReportTest:test_Report_SuccessfulDelivery() (gas: 362419) +KeystoneForwarder_ReportTest:test_Report_SuccessfulRetryWithMoreGas() (gas: 483436) +KeystoneForwarder_ReportTest:test_RevertWhen_AnySignatureIsInvalid() (gas: 86326) +KeystoneForwarder_ReportTest:test_RevertWhen_AnySignerIsInvalid() (gas: 118521) +KeystoneForwarder_ReportTest:test_RevertWhen_AttemptingTransmissionWithInsufficientGas() (gas: 96279) KeystoneForwarder_ReportTest:test_RevertWhen_ReportHasDuplicateSignatures() (gas: 94516) KeystoneForwarder_ReportTest:test_RevertWhen_ReportHasIncorrectDON() (gas: 75930) KeystoneForwarder_ReportTest:test_RevertWhen_ReportHasInexistentConfigVersion() (gas: 76298) -KeystoneForwarder_ReportTest:test_RevertWhen_ReportIsMalformed() (gas: 45585) +KeystoneForwarder_ReportTest:test_RevertWhen_ReportIsMalformed() (gas: 45563) +KeystoneForwarder_ReportTest:test_RevertWhen_RetryingInvalidContractTransmission() (gas: 143591) +KeystoneForwarder_ReportTest:test_RevertWhen_RetryingSuccessfulTransmission() (gas: 355218) KeystoneForwarder_ReportTest:test_RevertWhen_TooFewSignatures() (gas: 55292) KeystoneForwarder_ReportTest:test_RevertWhen_TooManySignatures() (gas: 56050) KeystoneForwarder_SetConfigTest:test_RevertWhen_ExcessSigners() (gas: 20184) KeystoneForwarder_SetConfigTest:test_RevertWhen_FaultToleranceIsZero() (gas: 88057) KeystoneForwarder_SetConfigTest:test_RevertWhen_InsufficientSigners() (gas: 14533) -KeystoneForwarder_SetConfigTest:test_RevertWhen_NotOwner() (gas: 88788) -KeystoneForwarder_SetConfigTest:test_RevertWhen_ProvidingDuplicateSigners() (gas: 114507) -KeystoneForwarder_SetConfigTest:test_SetConfig_FirstTime() (gas: 1539921) -KeystoneForwarder_SetConfigTest:test_SetConfig_WhenSignersAreRemoved() (gas: 1534476) +KeystoneForwarder_SetConfigTest:test_RevertWhen_NotOwner() (gas: 88766) +KeystoneForwarder_SetConfigTest:test_RevertWhen_ProvidingDuplicateSigners() (gas: 114578) +KeystoneForwarder_SetConfigTest:test_RevertWhen_ProvidingZeroAddressSigner() (gas: 114233) +KeystoneForwarder_SetConfigTest:test_SetConfig_FirstTime() (gas: 1540665) +KeystoneForwarder_SetConfigTest:test_SetConfig_WhenSignersAreRemoved() (gas: 1535361) KeystoneForwarder_TypeAndVersionTest:test_TypeAndVersion() (gas: 9641) -KeystoneRouter_SetConfigTest:test_AddForwarder_RevertWhen_NotOwner() (gas: 10978) -KeystoneRouter_SetConfigTest:test_RemoveForwarder_RevertWhen_NotOwner() (gas: 10923) -KeystoneRouter_SetConfigTest:test_Route_RevertWhen_UnauthorizedForwarder() (gas: 18553) -KeystoneRouter_SetConfigTest:test_Route_Success() (gas: 75629) \ No newline at end of file +KeystoneRouter_SetConfigTest:test_AddForwarder_RevertWhen_NotOwner() (gas: 10982) +KeystoneRouter_SetConfigTest:test_RemoveForwarder_RevertWhen_NotOwner() (gas: 10927) +KeystoneRouter_SetConfigTest:test_RemoveForwarder_Success() (gas: 17603) +KeystoneRouter_SetConfigTest:test_Route_RevertWhen_UnauthorizedForwarder() (gas: 18552) +KeystoneRouter_SetConfigTest:test_Route_Success() (gas: 80568) \ No newline at end of file diff --git a/contracts/gas-snapshots/l2ep.gas-snapshot b/contracts/gas-snapshots/l2ep.gas-snapshot index 324cacfc024..e793f8ce549 100644 --- a/contracts/gas-snapshots/l2ep.gas-snapshot +++ b/contracts/gas-snapshots/l2ep.gas-snapshot @@ -1,146 +1,142 @@ -ArbitrumCrossDomainForwarder_AcceptL1Ownership:test_CallableByPendingL1Owner() (gas: 37613) +ArbitrumCrossDomainForwarder_AcceptL1Ownership:test_CallableByPendingL1Owner() (gas: 37568) ArbitrumCrossDomainForwarder_AcceptL1Ownership:test_NotCallableByNonPendingOwners() (gas: 12963) -ArbitrumCrossDomainForwarder_Constructor:test_InitialState() (gas: 22196) +ArbitrumCrossDomainForwarder_Constructor:test_InitialState() (gas: 22163) ArbitrumCrossDomainForwarder_Forward:test_Forward() (gas: 47867) ArbitrumCrossDomainForwarder_Forward:test_ForwardRevert() (gas: 22181) ArbitrumCrossDomainForwarder_Forward:test_NotCallableByUnknownAddress() (gas: 16056) -ArbitrumCrossDomainForwarder_TransferL1Ownership:test_CallableByL1Owner() (gas: 41430) -ArbitrumCrossDomainForwarder_TransferL1Ownership:test_CallableByL1OwnerOrZeroAddress() (gas: 19312) -ArbitrumCrossDomainForwarder_TransferL1Ownership:test_NotCallableByL2Owner() (gas: 18671) -ArbitrumCrossDomainForwarder_TransferL1Ownership:test_NotCallableByNonOwners() (gas: 13219) -ArbitrumCrossDomainGovernor_AcceptL1Ownership:test_CallableByPendingL1Owner() (gas: 37613) +ArbitrumCrossDomainForwarder_TransferL1Ownership:test_CallableByL1Owner() (gas: 41453) +ArbitrumCrossDomainForwarder_TransferL1Ownership:test_CallableByL1OwnerOrZeroAddress() (gas: 19290) +ArbitrumCrossDomainForwarder_TransferL1Ownership:test_NotCallableByL2Owner() (gas: 18637) +ArbitrumCrossDomainForwarder_TransferL1Ownership:test_NotCallableByNonOwners() (gas: 13242) +ArbitrumCrossDomainGovernor_AcceptL1Ownership:test_CallableByPendingL1Owner() (gas: 37568) ArbitrumCrossDomainGovernor_AcceptL1Ownership:test_NotCallableByNonPendingOwners() (gas: 12963) -ArbitrumCrossDomainGovernor_Constructor:test_InitialState() (gas: 22219) -ArbitrumCrossDomainGovernor_Forward:test_CallableByL2Owner() (gas: 49980) -ArbitrumCrossDomainGovernor_Forward:test_Forward() (gas: 47918) -ArbitrumCrossDomainGovernor_Forward:test_ForwardRevert() (gas: 24348) -ArbitrumCrossDomainGovernor_Forward:test_NotCallableByUnknownAddress() (gas: 18255) +ArbitrumCrossDomainGovernor_Constructor:test_InitialState() (gas: 22186) +ArbitrumCrossDomainGovernor_Forward:test_CallableByL2Owner() (gas: 50003) +ArbitrumCrossDomainGovernor_Forward:test_Forward() (gas: 47896) +ArbitrumCrossDomainGovernor_Forward:test_ForwardRevert() (gas: 24326) +ArbitrumCrossDomainGovernor_Forward:test_NotCallableByUnknownAddress() (gas: 18233) ArbitrumCrossDomainGovernor_ForwardDelegate:test_BubbleUpRevert() (gas: 19386) ArbitrumCrossDomainGovernor_ForwardDelegate:test_CallableByCrossDomainMessengerAddressOrL1Owner() (gas: 60874) -ArbitrumCrossDomainGovernor_ForwardDelegate:test_CallableByL2Owner() (gas: 62980) +ArbitrumCrossDomainGovernor_ForwardDelegate:test_CallableByL2Owner() (gas: 63003) ArbitrumCrossDomainGovernor_ForwardDelegate:test_NotCallableByUnknownAddress() (gas: 18245) -ArbitrumCrossDomainGovernor_ForwardDelegate:test_RevertsBatchWhenOneCallFails() (gas: 64379) -ArbitrumCrossDomainGovernor_TransferL1Ownership:test_CallableByL1Owner() (gas: 41430) -ArbitrumCrossDomainGovernor_TransferL1Ownership:test_CallableByL1OwnerOrZeroAddress() (gas: 19312) -ArbitrumCrossDomainGovernor_TransferL1Ownership:test_NotCallableByL2Owner() (gas: 18671) -ArbitrumCrossDomainGovernor_TransferL1Ownership:test_NotCallableByNonOwners() (gas: 13219) -ArbitrumSequencerUptimeFeed_AggregatorInterfaceGasCosts:test_GasUsageForGetAnswer() (gas: 92790) -ArbitrumSequencerUptimeFeed_AggregatorInterfaceGasCosts:test_GasUsageForGetRoundData() (gas: 93351) -ArbitrumSequencerUptimeFeed_AggregatorInterfaceGasCosts:test_GasUsageForGetTimestamp() (gas: 92711) -ArbitrumSequencerUptimeFeed_AggregatorInterfaceGasCosts:test_GasUsageForLatestAnswer() (gas: 90485) -ArbitrumSequencerUptimeFeed_AggregatorInterfaceGasCosts:test_GasUsageForLatestRound() (gas: 90377) -ArbitrumSequencerUptimeFeed_AggregatorInterfaceGasCosts:test_GasUsageForLatestRoundData() (gas: 90924) -ArbitrumSequencerUptimeFeed_AggregatorInterfaceGasCosts:test_GasUsageForLatestTimestamp() (gas: 90362) -ArbitrumSequencerUptimeFeed_AggregatorV3Interface:test_AggregatorV3Interface() (gas: 104994) -ArbitrumSequencerUptimeFeed_AggregatorV3Interface:test_Return0WhenRoundDoesNotExistYet() (gas: 20033) -ArbitrumSequencerUptimeFeed_Constants:test_InitialState() (gas: 8530) -ArbitrumSequencerUptimeFeed_GasCosts:test_GasCosts() (gas: 99865) -ArbitrumSequencerUptimeFeed_ProtectReadsOnAggregatorV2V3InterfaceFunctions:test_AggregatorV2V3InterfaceAllowReadsIfConsumingContractIsWhitelisted() (gas: 604414) -ArbitrumSequencerUptimeFeed_ProtectReadsOnAggregatorV2V3InterfaceFunctions:test_AggregatorV2V3InterfaceDisallowReadsIfConsumingContractIsNotWhitelisted() (gas: 574476) -ArbitrumSequencerUptimeFeed_UpdateStatus:test_IgnoreOutOfOrderUpdates() (gas: 99662) -ArbitrumSequencerUptimeFeed_UpdateStatus:test_RevertIfNotL2CrossDomainMessengerAddr() (gas: 15424) -ArbitrumSequencerUptimeFeed_UpdateStatus:test_UpdateStatusWhenStatusChangeAndNoTimeChange() (gas: 114647) -ArbitrumSequencerUptimeFeed_UpdateStatus:test_UpdateStatusWhenStatusChangeAndTimeChange() (gas: 114707) +ArbitrumCrossDomainGovernor_ForwardDelegate:test_RevertsBatchWhenOneCallFails() (gas: 64368) +ArbitrumCrossDomainGovernor_TransferL1Ownership:test_CallableByL1Owner() (gas: 41453) +ArbitrumCrossDomainGovernor_TransferL1Ownership:test_CallableByL1OwnerOrZeroAddress() (gas: 19290) +ArbitrumCrossDomainGovernor_TransferL1Ownership:test_NotCallableByL2Owner() (gas: 18637) +ArbitrumCrossDomainGovernor_TransferL1Ownership:test_NotCallableByNonOwners() (gas: 13242) +ArbitrumSequencerUptimeFeed_AggregatorV3Interface:test_AggregatorV3Interface() (gas: 104862) +ArbitrumSequencerUptimeFeed_AggregatorV3Interface:test_Return0WhenRoundDoesNotExistYet() (gas: 19967) +ArbitrumSequencerUptimeFeed_Constants:test_InitialState() (gas: 8518) +ArbitrumSequencerUptimeFeed_ProtectReadsOnAggregatorV2V3InterfaceFunctions:test_AggregatorV2V3InterfaceAllowReadsIfConsumingContractIsWhitelisted() (gas: 604370) +ArbitrumSequencerUptimeFeed_ProtectReadsOnAggregatorV2V3InterfaceFunctions:test_AggregatorV2V3InterfaceDisallowReadsIfConsumingContractIsNotWhitelisted() (gas: 574432) +ArbitrumSequencerUptimeFeed_UpdateStatus:test_IgnoreOutOfOrderUpdates() (gas: 99629) +ArbitrumSequencerUptimeFeed_UpdateStatus:test_RevertIfNotL2CrossDomainMessengerAddr() (gas: 15447) +ArbitrumSequencerUptimeFeed_UpdateStatus:test_UpdateStatusWhenStatusChangeAndNoTimeChange() (gas: 114625) +ArbitrumSequencerUptimeFeed_UpdateStatus:test_UpdateStatusWhenStatusChangeAndTimeChange() (gas: 114708) ArbitrumValidator_Validate:test_PostSequencerOffline() (gas: 69086) -OptimismCrossDomainForwarder_AcceptL1Ownership:test_CallableByPendingL1Owner() (gas: 47206) +OptimismCrossDomainForwarder_AcceptL1Ownership:test_CallableByPendingL1Owner() (gas: 47160) OptimismCrossDomainForwarder_AcceptL1Ownership:test_NotCallableByNonPendingOwners() (gas: 22160) -OptimismCrossDomainForwarder_Constructor:test_InitialState() (gas: 22031) +OptimismCrossDomainForwarder_Constructor:test_InitialState() (gas: 21998) OptimismCrossDomainForwarder_Forward:test_Forward() (gas: 58281) OptimismCrossDomainForwarder_Forward:test_ForwardRevert() (gas: 32560) OptimismCrossDomainForwarder_Forward:test_NotCallableByUnknownAddress() (gas: 13867) -OptimismCrossDomainForwarder_TransferL1Ownership:test_CallableByL1Owner() (gas: 48910) -OptimismCrossDomainForwarder_TransferL1Ownership:test_CallableByL1OwnerOrZeroAddress() (gas: 28775) -OptimismCrossDomainForwarder_TransferL1Ownership:test_NotCallableByL2Owner() (gas: 16482) -OptimismCrossDomainForwarder_TransferL1Ownership:test_NotCallableByNonOwners() (gas: 11030) -OptimismCrossDomainGovernor_AcceptL1Ownership:test_CallableByPendingL1Owner() (gas: 47206) +OptimismCrossDomainForwarder_TransferL1Ownership:test_CallableByL1Owner() (gas: 48933) +OptimismCrossDomainForwarder_TransferL1Ownership:test_CallableByL1OwnerOrZeroAddress() (gas: 28753) +OptimismCrossDomainForwarder_TransferL1Ownership:test_NotCallableByL2Owner() (gas: 16448) +OptimismCrossDomainForwarder_TransferL1Ownership:test_NotCallableByNonOwners() (gas: 11053) +OptimismCrossDomainGovernor_AcceptL1Ownership:test_CallableByPendingL1Owner() (gas: 47160) OptimismCrossDomainGovernor_AcceptL1Ownership:test_NotCallableByNonPendingOwners() (gas: 22160) -OptimismCrossDomainGovernor_Constructor:test_InitialState() (gas: 22054) -OptimismCrossDomainGovernor_Forward:test_CallableByL2Owner() (gas: 47823) -OptimismCrossDomainGovernor_Forward:test_Forward() (gas: 58352) -OptimismCrossDomainGovernor_Forward:test_ForwardRevert() (gas: 32641) -OptimismCrossDomainGovernor_Forward:test_NotCallableByUnknownAddress() (gas: 16069) +OptimismCrossDomainGovernor_Constructor:test_InitialState() (gas: 22021) +OptimismCrossDomainGovernor_Forward:test_CallableByL2Owner() (gas: 47846) +OptimismCrossDomainGovernor_Forward:test_Forward() (gas: 58330) +OptimismCrossDomainGovernor_Forward:test_ForwardRevert() (gas: 32619) +OptimismCrossDomainGovernor_Forward:test_NotCallableByUnknownAddress() (gas: 16047) OptimismCrossDomainGovernor_ForwardDelegate:test_BubbleUpRevert() (gas: 29189) OptimismCrossDomainGovernor_ForwardDelegate:test_CallableByCrossDomainMessengerAddressOrL1Owner() (gas: 72942) -OptimismCrossDomainGovernor_ForwardDelegate:test_CallableByL2Owner() (gas: 72924) +OptimismCrossDomainGovernor_ForwardDelegate:test_CallableByL2Owner() (gas: 72947) OptimismCrossDomainGovernor_ForwardDelegate:test_NotCallableByUnknownAddress() (gas: 16059) -OptimismCrossDomainGovernor_ForwardDelegate:test_RevertsBatchWhenOneCallFails() (gas: 76167) -OptimismCrossDomainGovernor_TransferL1Ownership:test_CallableByL1Owner() (gas: 48910) -OptimismCrossDomainGovernor_TransferL1Ownership:test_CallableByL1OwnerOrZeroAddress() (gas: 28775) -OptimismCrossDomainGovernor_TransferL1Ownership:test_NotCallableByL2Owner() (gas: 16482) -OptimismCrossDomainGovernor_TransferL1Ownership:test_NotCallableByNonOwners() (gas: 11030) -OptimismSequencerUptimeFeed_AggregatorInterfaceGasCosts:test_GasUsageForGetAnswer() (gas: 59785) -OptimismSequencerUptimeFeed_AggregatorInterfaceGasCosts:test_GasUsageForGetRoundData() (gas: 60331) -OptimismSequencerUptimeFeed_AggregatorInterfaceGasCosts:test_GasUsageForGetTimestamp() (gas: 59640) -OptimismSequencerUptimeFeed_AggregatorInterfaceGasCosts:test_GasUsageForLatestAnswer() (gas: 57577) -OptimismSequencerUptimeFeed_AggregatorInterfaceGasCosts:test_GasUsageForLatestRound() (gas: 57463) -OptimismSequencerUptimeFeed_AggregatorInterfaceGasCosts:test_GasUsageForLatestRoundData() (gas: 58005) -OptimismSequencerUptimeFeed_AggregatorInterfaceGasCosts:test_GasUsageForLatestTimestamp() (gas: 57430) -OptimismSequencerUptimeFeed_AggregatorV3Interface:test_AggregatorV3Interface() (gas: 71804) -OptimismSequencerUptimeFeed_AggregatorV3Interface:test_RevertGetAnswerWhenRoundDoesNotExistYet() (gas: 17679) -OptimismSequencerUptimeFeed_AggregatorV3Interface:test_RevertGetRoundDataWhenRoundDoesNotExistYet() (gas: 17897) -OptimismSequencerUptimeFeed_AggregatorV3Interface:test_RevertGetTimestampWhenRoundDoesNotExistYet() (gas: 17603) -OptimismSequencerUptimeFeed_Constructor:test_InitialState() (gas: 22110) -OptimismSequencerUptimeFeed_GasCosts:test_GasCosts() (gas: 69567) -OptimismSequencerUptimeFeed_ProtectReadsOnAggregatorV2V3InterfaceFunctions:test_AggregatorV2V3InterfaceAllowReadsIfConsumingContractIsWhitelisted() (gas: 601843) -OptimismSequencerUptimeFeed_ProtectReadsOnAggregatorV2V3InterfaceFunctions:test_AggregatorV2V3InterfaceDisallowReadsIfConsumingContractIsNotWhitelisted() (gas: 574481) -OptimismSequencerUptimeFeed_UpdateStatus:test_IgnoreOutOfOrderUpdates() (gas: 67230) -OptimismSequencerUptimeFeed_UpdateStatus:test_RevertIfNotL2CrossDomainMessengerAddr() (gas: 13214) -OptimismSequencerUptimeFeed_UpdateStatus:test_RevertIfNotL2CrossDomainMessengerAddrAndNotL1SenderAddr() (gas: 23632) -OptimismSequencerUptimeFeed_UpdateStatus:test_UpdateStatusWhenNoChange() (gas: 77137) -OptimismSequencerUptimeFeed_UpdateStatus:test_UpdateStatusWhenStatusChangeAndNoTimeChange() (gas: 97545) -OptimismSequencerUptimeFeed_UpdateStatus:test_UpdateStatusWhenStatusChangeAndTimeChange() (gas: 97605) -OptimismValidator_SetGasLimit:test_CorrectlyUpdatesTheGasLimit() (gas: 18695) -OptimismValidator_Validate:test_PostSequencerOffline() (gas: 74813) +OptimismCrossDomainGovernor_ForwardDelegate:test_RevertsBatchWhenOneCallFails() (gas: 76156) +OptimismCrossDomainGovernor_TransferL1Ownership:test_CallableByL1Owner() (gas: 48933) +OptimismCrossDomainGovernor_TransferL1Ownership:test_CallableByL1OwnerOrZeroAddress() (gas: 28753) +OptimismCrossDomainGovernor_TransferL1Ownership:test_NotCallableByL2Owner() (gas: 16448) +OptimismCrossDomainGovernor_TransferL1Ownership:test_NotCallableByNonOwners() (gas: 11053) +OptimismSequencerUptimeFeed_AggregatorV3Interface:test_AggregatorV3Interface() (gas: 72400) +OptimismSequencerUptimeFeed_AggregatorV3Interface:test_RevertGetAnswerWhenRoundDoesNotExistYet() (gas: 17653) +OptimismSequencerUptimeFeed_AggregatorV3Interface:test_RevertGetRoundDataWhenRoundDoesNotExistYet() (gas: 17893) +OptimismSequencerUptimeFeed_AggregatorV3Interface:test_RevertGetTimestampWhenRoundDoesNotExistYet() (gas: 17642) +OptimismSequencerUptimeFeed_Constructor:test_InitialState() (gas: 22050) +OptimismSequencerUptimeFeed_ProtectReadsOnAggregatorV2V3InterfaceFunctions:test_AggregatorV2V3InterfaceAllowReadsIfConsumingContractIsWhitelisted() (gas: 601594) +OptimismSequencerUptimeFeed_ProtectReadsOnAggregatorV2V3InterfaceFunctions:test_AggregatorV2V3InterfaceDisallowReadsIfConsumingContractIsNotWhitelisted() (gas: 574437) +OptimismSequencerUptimeFeed_UpdateStatus:test_IgnoreOutOfOrderUpdates() (gas: 67873) +OptimismSequencerUptimeFeed_UpdateStatus:test_RevertIfNotL2CrossDomainMessengerAddr() (gas: 13079) +OptimismSequencerUptimeFeed_UpdateStatus:test_RevertIfNotL2CrossDomainMessengerAddrAndNotL1SenderAddr() (gas: 23542) +OptimismSequencerUptimeFeed_UpdateStatus:test_UpdateStatusWhenNoChange() (gas: 77322) +OptimismSequencerUptimeFeed_UpdateStatus:test_UpdateStatusWhenStatusChangeAndNoTimeChange() (gas: 96182) +OptimismSequencerUptimeFeed_UpdateStatus:test_UpdateStatusWhenStatusChangeAndTimeChange() (gas: 96265) +OptimismValidator_SetGasLimit:test_CorrectlyUpdatesTheGasLimit() (gas: 18671) +OptimismValidator_Validate:test_PostSequencerOffline() (gas: 74790) OptimismValidator_Validate:test_PostSequencerStatusWhenThereIsNotStatusChange() (gas: 74869) OptimismValidator_Validate:test_RevertsIfCalledByAnAccountWithNoAccess() (gas: 15571) -ScrollCrossDomainForwarder_AcceptL1Ownership:test_CallableByPendingL1Owner() (gas: 47300) +ScrollCrossDomainForwarder_AcceptL1Ownership:test_CallableByPendingL1Owner() (gas: 47255) ScrollCrossDomainForwarder_AcceptL1Ownership:test_NotCallableByNonPendingOwners() (gas: 22212) -ScrollCrossDomainForwarder_Constructor:test_InitialState() (gas: 21707) +ScrollCrossDomainForwarder_Constructor:test_InitialState() (gas: 21674) ScrollCrossDomainForwarder_Forward:test_Forward() (gas: 58348) ScrollCrossDomainForwarder_Forward:test_ForwardRevert() (gas: 32618) ScrollCrossDomainForwarder_Forward:test_NotCallableByUnknownAddress() (gas: 13867) -ScrollCrossDomainForwarder_TransferL1Ownership:test_CallableByL1Owner() (gas: 48976) -ScrollCrossDomainForwarder_TransferL1Ownership:test_CallableByL1OwnerOrZeroAddress() (gas: 28841) -ScrollCrossDomainForwarder_TransferL1Ownership:test_NotCallableByL2Owner() (gas: 16482) -ScrollCrossDomainForwarder_TransferL1Ownership:test_NotCallableByNonOwners() (gas: 11030) -ScrollCrossDomainGovernor_AcceptL1Ownership:test_CallableByPendingL1Owner() (gas: 47300) +ScrollCrossDomainForwarder_TransferL1Ownership:test_CallableByL1Owner() (gas: 48999) +ScrollCrossDomainForwarder_TransferL1Ownership:test_CallableByL1OwnerOrZeroAddress() (gas: 28819) +ScrollCrossDomainForwarder_TransferL1Ownership:test_NotCallableByL2Owner() (gas: 16448) +ScrollCrossDomainForwarder_TransferL1Ownership:test_NotCallableByNonOwners() (gas: 11053) +ScrollCrossDomainGovernor_AcceptL1Ownership:test_CallableByPendingL1Owner() (gas: 47255) ScrollCrossDomainGovernor_AcceptL1Ownership:test_NotCallableByNonPendingOwners() (gas: 22212) -ScrollCrossDomainGovernor_Constructor:test_InitialState() (gas: 21730) -ScrollCrossDomainGovernor_Forward:test_CallableByL2Owner() (gas: 47818) -ScrollCrossDomainGovernor_Forward:test_Forward() (gas: 58414) -ScrollCrossDomainGovernor_Forward:test_ForwardRevert() (gas: 32696) -ScrollCrossDomainGovernor_Forward:test_NotCallableByUnknownAddress() (gas: 16066) +ScrollCrossDomainGovernor_Constructor:test_InitialState() (gas: 21697) +ScrollCrossDomainGovernor_Forward:test_CallableByL2Owner() (gas: 47841) +ScrollCrossDomainGovernor_Forward:test_Forward() (gas: 58392) +ScrollCrossDomainGovernor_Forward:test_ForwardRevert() (gas: 32674) +ScrollCrossDomainGovernor_Forward:test_NotCallableByUnknownAddress() (gas: 16044) ScrollCrossDomainGovernor_ForwardDelegate:test_BubbleUpRevert() (gas: 29250) ScrollCrossDomainGovernor_ForwardDelegate:test_CallableByCrossDomainMessengerAddressOrL1Owner() (gas: 73009) -ScrollCrossDomainGovernor_ForwardDelegate:test_CallableByL2Owner() (gas: 72991) +ScrollCrossDomainGovernor_ForwardDelegate:test_CallableByL2Owner() (gas: 73014) ScrollCrossDomainGovernor_ForwardDelegate:test_NotCallableByUnknownAddress() (gas: 16056) -ScrollCrossDomainGovernor_ForwardDelegate:test_RevertsBatchWhenOneCallFails() (gas: 76235) -ScrollCrossDomainGovernor_TransferL1Ownership:test_CallableByL1Owner() (gas: 48976) -ScrollCrossDomainGovernor_TransferL1Ownership:test_CallableByL1OwnerOrZeroAddress() (gas: 28841) -ScrollCrossDomainGovernor_TransferL1Ownership:test_NotCallableByL2Owner() (gas: 16482) -ScrollCrossDomainGovernor_TransferL1Ownership:test_NotCallableByNonOwners() (gas: 11030) -ScrollSequencerUptimeFeed_AggregatorInterfaceGasCosts:test_GasUsageForGetAnswer() (gas: 57940) -ScrollSequencerUptimeFeed_AggregatorInterfaceGasCosts:test_GasUsageForGetRoundData() (gas: 58476) -ScrollSequencerUptimeFeed_AggregatorInterfaceGasCosts:test_GasUsageForGetTimestamp() (gas: 57795) -ScrollSequencerUptimeFeed_AggregatorInterfaceGasCosts:test_GasUsageForLatestAnswer() (gas: 55578) -ScrollSequencerUptimeFeed_AggregatorInterfaceGasCosts:test_GasUsageForLatestRound() (gas: 55458) -ScrollSequencerUptimeFeed_AggregatorInterfaceGasCosts:test_GasUsageForLatestRoundData() (gas: 56169) -ScrollSequencerUptimeFeed_AggregatorInterfaceGasCosts:test_GasUsageForLatestTimestamp() (gas: 55448) -ScrollSequencerUptimeFeed_AggregatorV3Interface:test_AggregatorV3Interface() (gas: 70090) -ScrollSequencerUptimeFeed_AggregatorV3Interface:test_RevertGetAnswerWhenRoundDoesNotExistYet() (gas: 17675) +ScrollCrossDomainGovernor_ForwardDelegate:test_RevertsBatchWhenOneCallFails() (gas: 76224) +ScrollCrossDomainGovernor_TransferL1Ownership:test_CallableByL1Owner() (gas: 48999) +ScrollCrossDomainGovernor_TransferL1Ownership:test_CallableByL1OwnerOrZeroAddress() (gas: 28819) +ScrollCrossDomainGovernor_TransferL1Ownership:test_NotCallableByL2Owner() (gas: 16448) +ScrollCrossDomainGovernor_TransferL1Ownership:test_NotCallableByNonOwners() (gas: 11053) +ScrollSequencerUptimeFeed_AggregatorV3Interface:test_AggregatorV3Interface() (gas: 72423) +ScrollSequencerUptimeFeed_AggregatorV3Interface:test_RevertGetAnswerWhenRoundDoesNotExistYet() (gas: 17653) ScrollSequencerUptimeFeed_AggregatorV3Interface:test_RevertGetRoundDataWhenRoundDoesNotExistYet() (gas: 17893) -ScrollSequencerUptimeFeed_AggregatorV3Interface:test_RevertGetTimestampWhenRoundDoesNotExistYet() (gas: 17599) -ScrollSequencerUptimeFeed_Constructor:test_InitialState() (gas: 103508) -ScrollSequencerUptimeFeed_GasCosts:test_GasCosts() (gas: 67258) -ScrollSequencerUptimeFeed_ProtectReadsOnAggregatorV2V3InterfaceFunctions:test_AggregatorV2V3InterfaceAllowReadsIfConsumingContractIsWhitelisted() (gas: 601694) -ScrollSequencerUptimeFeed_ProtectReadsOnAggregatorV2V3InterfaceFunctions:test_AggregatorV2V3InterfaceDisallowReadsIfConsumingContractIsNotWhitelisted() (gas: 574481) -ScrollSequencerUptimeFeed_UpdateStatus:test_IgnoreOutOfOrderUpdates() (gas: 65115) -ScrollSequencerUptimeFeed_UpdateStatus:test_RevertIfNotL2CrossDomainMessengerAddr() (gas: 13214) -ScrollSequencerUptimeFeed_UpdateStatus:test_RevertIfNotL2CrossDomainMessengerAddrAndNotL1SenderAddr() (gas: 23632) -ScrollSequencerUptimeFeed_UpdateStatus:test_UpdateStatusWhenNoChange() (gas: 74720) -ScrollSequencerUptimeFeed_UpdateStatus:test_UpdateStatusWhenStatusChangeAndNoTimeChange() (gas: 93408) -ScrollSequencerUptimeFeed_UpdateStatus:test_UpdateStatusWhenStatusChangeAndTimeChange() (gas: 93468) -ScrollValidator_SetGasLimit:test_CorrectlyUpdatesTheGasLimit() (gas: 18829) -ScrollValidator_Validate:test_PostSequencerOffline() (gas: 78349) +ScrollSequencerUptimeFeed_AggregatorV3Interface:test_RevertGetTimestampWhenRoundDoesNotExistYet() (gas: 17642) +ScrollSequencerUptimeFeed_Constructor:test_InitialState() (gas: 173935) +ScrollSequencerUptimeFeed_ProtectReadsOnAggregatorV2V3InterfaceFunctions:test_AggregatorV2V3InterfaceAllowReadsIfConsumingContractIsWhitelisted() (gas: 601594) +ScrollSequencerUptimeFeed_ProtectReadsOnAggregatorV2V3InterfaceFunctions:test_AggregatorV2V3InterfaceDisallowReadsIfConsumingContractIsNotWhitelisted() (gas: 574437) +ScrollSequencerUptimeFeed_UpdateStatus:test_IgnoreOutOfOrderUpdates() (gas: 67919) +ScrollSequencerUptimeFeed_UpdateStatus:test_RevertIfNotL2CrossDomainMessengerAddr() (gas: 13079) +ScrollSequencerUptimeFeed_UpdateStatus:test_RevertIfNotL2CrossDomainMessengerAddrAndNotL1SenderAddr() (gas: 23542) +ScrollSequencerUptimeFeed_UpdateStatus:test_UpdateStatusWhenNoChange() (gas: 77368) +ScrollSequencerUptimeFeed_UpdateStatus:test_UpdateStatusWhenStatusChangeAndNoTimeChange() (gas: 96228) +ScrollSequencerUptimeFeed_UpdateStatus:test_UpdateStatusWhenStatusChangeAndTimeChange() (gas: 96311) +ScrollValidator_SetGasLimit:test_CorrectlyUpdatesTheGasLimit() (gas: 18805) +ScrollValidator_Validate:test_PostSequencerOffline() (gas: 78326) ScrollValidator_Validate:test_PostSequencerStatusWhenThereIsNotStatusChange() (gas: 78411) -ScrollValidator_Validate:test_RevertsIfCalledByAnAccountWithNoAccess() (gas: 15571) \ No newline at end of file +ScrollValidator_Validate:test_RevertsIfCalledByAnAccountWithNoAccess() (gas: 15571) +ZKSyncSequencerUptimeFeed_AggregatorV3Interface:test_AggregatorV3Interface() (gas: 67166) +ZKSyncSequencerUptimeFeed_AggregatorV3Interface:test_RevertGetAnswerWhenRoundDoesNotExistYet() (gas: 17653) +ZKSyncSequencerUptimeFeed_AggregatorV3Interface:test_RevertGetRoundDataWhenRoundDoesNotExistYet() (gas: 17893) +ZKSyncSequencerUptimeFeed_AggregatorV3Interface:test_RevertGetTimestampWhenRoundDoesNotExistYet() (gas: 17642) +ZKSyncSequencerUptimeFeed_Constructor:test_InitialState() (gas: 22054) +ZKSyncSequencerUptimeFeed_ProtectReadsOnAggregatorV2V3InterfaceFunctions:test_AggregatorV2V3InterfaceAllowReadsIfConsumingContractIsWhitelisted() (gas: 601614) +ZKSyncSequencerUptimeFeed_ProtectReadsOnAggregatorV2V3InterfaceFunctions:test_AggregatorV2V3InterfaceDisallowReadsIfConsumingContractIsNotWhitelisted() (gas: 574443) +ZKSyncSequencerUptimeFeed_UpdateStatus:test_IgnoreOutOfOrderUpdates() (gas: 61924) +ZKSyncSequencerUptimeFeed_UpdateStatus:test_RevertIfNotL2CrossDomainMessengerAddr() (gas: 13035) +ZKSyncSequencerUptimeFeed_UpdateStatus:test_UpdateStatusWhenNoChange() (gas: 71379) +ZKSyncSequencerUptimeFeed_UpdateStatus:test_UpdateStatusWhenStatusChangeAndNoTimeChange() (gas: 90241) +ZKSyncSequencerUptimeFeed_UpdateStatus:test_UpdateStatusWhenStatusChangeAndTimeChange() (gas: 90324) +ZKSyncValidator_Constructor:test_ConstructingRevertedWithInvalidChainId() (gas: 103725) +ZKSyncValidator_Constructor:test_ConstructingRevertedWithZeroL1BridgeAddress() (gas: 81440) +ZKSyncValidator_Constructor:test_ConstructingRevertedWithZeroL2UpdateFeedAddress() (gas: 81497) +ZKSyncValidator_GetChainId:test_CorrectlyGetsTheChainId() (gas: 8350) +ZKSyncValidator_GetSetL2GasPerPubdataByteLimit:test_CorrectlyGetsAndUpdatesTheGasPerPubdataByteLimit() (gas: 18915) +ZKSyncValidator_Validate:test_PostSequencerOffline() (gas: 52255) +ZKSyncValidator_Validate:test_PostSequencerStatusWhenThereIsNotStatusChange() (gas: 52355) +ZKSyncValidator_Validate:test_RevertsIfCalledByAnAccountWithNoAccess() (gas: 15644) \ No newline at end of file diff --git a/contracts/gas-snapshots/liquiditymanager.gas-snapshot b/contracts/gas-snapshots/liquiditymanager.gas-snapshot new file mode 100644 index 00000000000..6f67684cfc0 --- /dev/null +++ b/contracts/gas-snapshots/liquiditymanager.gas-snapshot @@ -0,0 +1,48 @@ +LiquidityManager__report:test_EmptyReportReverts() (gas: 11181) +LiquidityManager_addLiquidity:test_addLiquiditySuccess() (gas: 279154) +LiquidityManager_rebalanceLiquidity:test_InsufficientLiquidityReverts() (gas: 206745) +LiquidityManager_rebalanceLiquidity:test_InvalidRemoteChainReverts() (gas: 192319) +LiquidityManager_rebalanceLiquidity:test_rebalanceBetweenPoolsSuccess() (gas: 9141768) +LiquidityManager_rebalanceLiquidity:test_rebalanceBetweenPoolsSuccess_AlreadyFinalized() (gas: 8960797) +LiquidityManager_rebalanceLiquidity:test_rebalanceBetweenPools_MultiStageFinalization() (gas: 8956003) +LiquidityManager_rebalanceLiquidity:test_rebalanceBetweenPools_NativeRewrap() (gas: 8883801) +LiquidityManager_rebalanceLiquidity:test_rebalanceLiquiditySuccess() (gas: 382897) +LiquidityManager_receive:test_receive_success() (gas: 21182) +LiquidityManager_removeLiquidity:test_InsufficientLiquidityReverts() (gas: 184869) +LiquidityManager_removeLiquidity:test_OnlyFinanceRoleReverts() (gas: 10872) +LiquidityManager_removeLiquidity:test_removeLiquiditySuccess() (gas: 236342) +LiquidityManager_setCrossChainRebalancer:test_OnlyOwnerReverts() (gas: 17005) +LiquidityManager_setCrossChainRebalancer:test_ZeroAddressReverts() (gas: 21624) +LiquidityManager_setCrossChainRebalancer:test_ZeroChainSelectorReverts() (gas: 13099) +LiquidityManager_setCrossChainRebalancer:test_setCrossChainRebalancerSuccess() (gas: 162186) +LiquidityManager_setFinanceRole:test_OnlyOwnerReverts() (gas: 10987) +LiquidityManager_setFinanceRole:test_setFinanceRoleSuccess() (gas: 21836) +LiquidityManager_setLocalLiquidityContainer:test_OnlyOwnerReverts() (gas: 11052) +LiquidityManager_setLocalLiquidityContainer:test_ReverstWhen_CalledWithTheZeroAddress() (gas: 10643) +LiquidityManager_setLocalLiquidityContainer:test_setLocalLiquidityContainerSuccess() (gas: 3498806) +LiquidityManager_setMinimumLiquidity:test_OnlyOwnerReverts() (gas: 10925) +LiquidityManager_setMinimumLiquidity:test_setMinimumLiquiditySuccess() (gas: 36389) +LiquidityManager_withdrawERC20:test_withdrawERC20Reverts() (gas: 180359) +LiquidityManager_withdrawERC20:test_withdrawERC20Success() (gas: 205858) +LiquidityManager_withdrawNative:test_OnlyFinanceRoleReverts() (gas: 13046) +LiquidityManager_withdrawNative:test_withdrawNative_success() (gas: 51398) +OCR3Base_setOCR3Config:testFMustBePositiveReverts() (gas: 12245) +OCR3Base_setOCR3Config:testFTooHighReverts() (gas: 12429) +OCR3Base_setOCR3Config:testOracleOutOfRegisterReverts() (gas: 14847) +OCR3Base_setOCR3Config:testRepeatAddressReverts() (gas: 44932) +OCR3Base_setOCR3Config:testSetConfigSuccess() (gas: 154642) +OCR3Base_setOCR3Config:testSignerCannotBeZeroAddressReverts() (gas: 23712) +OCR3Base_setOCR3Config:testTooManySignersReverts() (gas: 19832) +OCR3Base_setOCR3Config:testTransmitterCannotBeZeroAddressReverts() (gas: 46539) +OCR3Base_transmit:testConfigDigestMismatchReverts() (gas: 24827) +OCR3Base_transmit:testForkedChainReverts() (gas: 42846) +OCR3Base_transmit:testNonIncreasingSequenceNumberReverts() (gas: 30522) +OCR3Base_transmit:testNonUniqueSignatureReverts() (gas: 60370) +OCR3Base_transmit:testSignatureOutOfRegistrationReverts() (gas: 26128) +OCR3Base_transmit:testTransmit2SignersSuccess_gas() (gas: 56771) +OCR3Base_transmit:testUnAuthorizedTransmitterReverts() (gas: 28618) +OCR3Base_transmit:testUnauthorizedSignerReverts() (gas: 44759) +OCR3Base_transmit:testWrongNumberOfSignaturesReverts() (gas: 25678) +OptimismL1BridgeAdapter_finalizeWithdrawERC20:testFinalizeWithdrawERC20Reverts() (gas: 12932) +OptimismL1BridgeAdapter_finalizeWithdrawERC20:testfinalizeWithdrawERC20FinalizeSuccess() (gas: 16972) +OptimismL1BridgeAdapter_finalizeWithdrawERC20:testfinalizeWithdrawERC20proveWithdrawalSuccess() (gas: 20758) \ No newline at end of file diff --git a/contracts/gas-snapshots/llo-feeds.gas-snapshot b/contracts/gas-snapshots/llo-feeds.gas-snapshot index 0162809e90d..231bff7c9d0 100644 --- a/contracts/gas-snapshots/llo-feeds.gas-snapshot +++ b/contracts/gas-snapshots/llo-feeds.gas-snapshot @@ -18,6 +18,233 @@ ByteUtilTest:test_readUint32MultiWord() (gas: 3393) ByteUtilTest:test_readUint32WithEmptyArray() (gas: 3253) ByteUtilTest:test_readUint32WithNotEnoughBytes() (gas: 3272) ByteUtilTest:test_readZeroAddress() (gas: 3365) +ChannelConfigStoreTest:testSetChannelDefinitions() (gas: 46927) +ChannelConfigStoreTest:testSupportsInterface() (gas: 8367) +ChannelConfigStoreTest:testTypeAndVersion() (gas: 9621) +DestinationFeeManagerProcessFeeTest:test_DiscountIsAppliedForNative() (gas: 52717) +DestinationFeeManagerProcessFeeTest:test_DiscountIsReturnedForNative() (gas: 52645) +DestinationFeeManagerProcessFeeTest:test_DiscountIsReturnedForNativeWithSurcharge() (gas: 78879) +DestinationFeeManagerProcessFeeTest:test_GlobalDiscountCantBeSetToMoreThanMaximum() (gas: 19544) +DestinationFeeManagerProcessFeeTest:test_GlobalDiscountIsOverridenByIndividualDiscountLink() (gas: 79509) +DestinationFeeManagerProcessFeeTest:test_GlobalDiscountIsOverridenByIndividualDiscountNative() (gas: 82523) +DestinationFeeManagerProcessFeeTest:test_GlobalDiscountIsUpdatedAfterBeingSetToZeroLink() (gas: 48409) +DestinationFeeManagerProcessFeeTest:test_GlobalDiscountIsUpdatedAfterBeingSetToZeroNative() (gas: 51589) +DestinationFeeManagerProcessFeeTest:test_GlobalDiscountWithLink() (gas: 51902) +DestinationFeeManagerProcessFeeTest:test_GlobalDiscountWithNative() (gas: 54892) +DestinationFeeManagerProcessFeeTest:test_GlobalDiscountWithNativeAndLink() (gas: 83739) +DestinationFeeManagerProcessFeeTest:test_V1PayloadVerifies() (gas: 29280) +DestinationFeeManagerProcessFeeTest:test_V1PayloadVerifiesAndReturnsChange() (gas: 61209) +DestinationFeeManagerProcessFeeTest:test_V2PayloadVerifies() (gas: 123469) +DestinationFeeManagerProcessFeeTest:test_V2PayloadWithoutQuoteFails() (gas: 29691) +DestinationFeeManagerProcessFeeTest:test_V2PayloadWithoutZeroFee() (gas: 77080) +DestinationFeeManagerProcessFeeTest:test_WithdrawERC20() (gas: 72819) +DestinationFeeManagerProcessFeeTest:test_WithdrawNonAdminAddr() (gas: 56357) +DestinationFeeManagerProcessFeeTest:test_WithdrawUnwrappedNative() (gas: 26434) +DestinationFeeManagerProcessFeeTest:test_addVerifier() (gas: 128899) +DestinationFeeManagerProcessFeeTest:test_addVerifierExistingAddress() (gas: 34192) +DestinationFeeManagerProcessFeeTest:test_baseFeeIsAppliedForLink() (gas: 19497) +DestinationFeeManagerProcessFeeTest:test_baseFeeIsAppliedForNative() (gas: 22502) +DestinationFeeManagerProcessFeeTest:test_correctDiscountIsAppliedWhenBothTokensAreDiscounted() (gas: 91133) +DestinationFeeManagerProcessFeeTest:test_discountAIsNotAppliedWhenSetForOtherUsers() (gas: 58864) +DestinationFeeManagerProcessFeeTest:test_discountFeeRoundsDownWhenUneven() (gas: 52919) +DestinationFeeManagerProcessFeeTest:test_discountIsAppliedForLink() (gas: 49730) +DestinationFeeManagerProcessFeeTest:test_discountIsAppliedWith100PercentSurcharge() (gas: 78908) +DestinationFeeManagerProcessFeeTest:test_discountIsNoLongerAppliedAfterRemoving() (gas: 48362) +DestinationFeeManagerProcessFeeTest:test_discountIsNotAppliedForInvalidTokenAddress() (gas: 17516) +DestinationFeeManagerProcessFeeTest:test_discountIsNotAppliedToOtherFeeds() (gas: 56912) +DestinationFeeManagerProcessFeeTest:test_discountIsReturnedForLink() (gas: 49657) +DestinationFeeManagerProcessFeeTest:test_emptyQuoteRevertsWithError() (gas: 12253) +DestinationFeeManagerProcessFeeTest:test_eventIsEmittedAfterSurchargeIsSet() (gas: 41379) +DestinationFeeManagerProcessFeeTest:test_eventIsEmittedIfNotEnoughLink() (gas: 182671) +DestinationFeeManagerProcessFeeTest:test_eventIsEmittedUponWithdraw() (gas: 69080) +DestinationFeeManagerProcessFeeTest:test_feeIsUpdatedAfterDiscountIsRemoved() (gas: 51626) +DestinationFeeManagerProcessFeeTest:test_feeIsUpdatedAfterNewDiscountIsApplied() (gas: 67777) +DestinationFeeManagerProcessFeeTest:test_feeIsUpdatedAfterNewSurchargeIsApplied() (gas: 66960) +DestinationFeeManagerProcessFeeTest:test_feeIsZeroWith100PercentDiscount() (gas: 52073) +DestinationFeeManagerProcessFeeTest:test_getBaseRewardWithLinkQuote() (gas: 19495) +DestinationFeeManagerProcessFeeTest:test_getLinkFeeIsRoundedUp() (gas: 49857) +DestinationFeeManagerProcessFeeTest:test_getLinkRewardIsSameAsFee() (gas: 55762) +DestinationFeeManagerProcessFeeTest:test_getLinkRewardWithNativeQuoteAndSurchargeWithLinkDiscount() (gas: 85050) +DestinationFeeManagerProcessFeeTest:test_getRewardWithLinkDiscount() (gas: 49726) +DestinationFeeManagerProcessFeeTest:test_getRewardWithLinkQuoteAndLinkDiscount() (gas: 49685) +DestinationFeeManagerProcessFeeTest:test_getRewardWithNativeQuote() (gas: 22456) +DestinationFeeManagerProcessFeeTest:test_getRewardWithNativeQuoteAndSurcharge() (gas: 53190) +DestinationFeeManagerProcessFeeTest:test_linkAvailableForPaymentReturnsLinkBalance() (gas: 53194) +DestinationFeeManagerProcessFeeTest:test_nativeSurcharge0Percent() (gas: 33198) +DestinationFeeManagerProcessFeeTest:test_nativeSurcharge100Percent() (gas: 53170) +DestinationFeeManagerProcessFeeTest:test_nativeSurchargeCannotExceed100Percent() (gas: 17152) +DestinationFeeManagerProcessFeeTest:test_nativeSurchargeEventIsEmittedOnUpdate() (gas: 41357) +DestinationFeeManagerProcessFeeTest:test_noFeeIsAppliedWhenReportHasZeroFee() (gas: 51918) +DestinationFeeManagerProcessFeeTest:test_noFeeIsAppliedWhenReportHasZeroFeeAndDiscountAndSurchargeIsSet() (gas: 78108) +DestinationFeeManagerProcessFeeTest:test_nonAdminProxyUserCannotProcessFee() (gas: 24141) +DestinationFeeManagerProcessFeeTest:test_nonAdminUserCanNotSetDiscount() (gas: 19784) +DestinationFeeManagerProcessFeeTest:test_onlyCallableByOwnerReverts() (gas: 15475) +DestinationFeeManagerProcessFeeTest:test_onlyOwnerCanSetGlobalDiscount() (gas: 19929) +DestinationFeeManagerProcessFeeTest:test_payLinkDeficit() (gas: 199884) +DestinationFeeManagerProcessFeeTest:test_payLinkDeficitOnlyCallableByAdmin() (gas: 17348) +DestinationFeeManagerProcessFeeTest:test_payLinkDeficitPaysAllFeesProcessed() (gas: 221262) +DestinationFeeManagerProcessFeeTest:test_payLinkDeficitTwice() (gas: 204204) +DestinationFeeManagerProcessFeeTest:test_poolIdsCannotBeZeroAddress() (gas: 117907) +DestinationFeeManagerProcessFeeTest:test_processFeeAsProxy() (gas: 123807) +DestinationFeeManagerProcessFeeTest:test_processFeeDefaultReportsStillVerifiesWithEmptyQuote() (gas: 29767) +DestinationFeeManagerProcessFeeTest:test_processFeeEmitsEventIfNotEnoughLink() (gas: 167721) +DestinationFeeManagerProcessFeeTest:test_processFeeIfSubscriberIsSelf() (gas: 32607) +DestinationFeeManagerProcessFeeTest:test_processFeeNative() (gas: 180514) +DestinationFeeManagerProcessFeeTest:test_processFeeUsesCorrectDigest() (gas: 125076) +DestinationFeeManagerProcessFeeTest:test_processFeeWithDefaultReportPayloadAndQuoteStillVerifies() (gas: 31844) +DestinationFeeManagerProcessFeeTest:test_processFeeWithDiscountEmitsEvent() (gas: 245978) +DestinationFeeManagerProcessFeeTest:test_processFeeWithInvalidReportVersionFailsToDecode() (gas: 30814) +DestinationFeeManagerProcessFeeTest:test_processFeeWithNoDiscountDoesNotEmitEvent() (gas: 173419) +DestinationFeeManagerProcessFeeTest:test_processFeeWithUnwrappedNative() (gas: 188379) +DestinationFeeManagerProcessFeeTest:test_processFeeWithUnwrappedNativeLinkAddress() (gas: 138180) +DestinationFeeManagerProcessFeeTest:test_processFeeWithUnwrappedNativeLinkAddressExcessiveFee() (gas: 163791) +DestinationFeeManagerProcessFeeTest:test_processFeeWithUnwrappedNativeShortFunds() (gas: 97147) +DestinationFeeManagerProcessFeeTest:test_processFeeWithUnwrappedNativeWithExcessiveFee() (gas: 195364) +DestinationFeeManagerProcessFeeTest:test_processFeeWithWithCorruptQuotePayload() (gas: 77390) +DestinationFeeManagerProcessFeeTest:test_processFeeWithWithEmptyQuotePayload() (gas: 30028) +DestinationFeeManagerProcessFeeTest:test_processFeeWithWithZeroQuotePayload() (gas: 30078) +DestinationFeeManagerProcessFeeTest:test_processFeeWithZeroLinkNonZeroNativeWithLinkQuote() (gas: 37626) +DestinationFeeManagerProcessFeeTest:test_processFeeWithZeroLinkNonZeroNativeWithNativeQuote() (gas: 160391) +DestinationFeeManagerProcessFeeTest:test_processFeeWithZeroNativeNonZeroLinkReturnsChange() (gas: 58387) +DestinationFeeManagerProcessFeeTest:test_processFeeWithZeroNativeNonZeroLinkWithLinkQuote() (gas: 123718) +DestinationFeeManagerProcessFeeTest:test_processFeeWithZeroNativeNonZeroLinkWithNativeQuote() (gas: 40330) +DestinationFeeManagerProcessFeeTest:test_processMultipleLinkReports() (gas: 233880) +DestinationFeeManagerProcessFeeTest:test_processMultipleUnwrappedNativeReports() (gas: 267669) +DestinationFeeManagerProcessFeeTest:test_processMultipleV1Reports() (gas: 81177) +DestinationFeeManagerProcessFeeTest:test_processMultipleWrappedNativeReports() (gas: 250518) +DestinationFeeManagerProcessFeeTest:test_processPoolIdsPassedMismatched() (gas: 98815) +DestinationFeeManagerProcessFeeTest:test_processV1V2V3Reports() (gas: 218585) +DestinationFeeManagerProcessFeeTest:test_processV1V2V3ReportsWithUnwrapped() (gas: 260249) +DestinationFeeManagerProcessFeeTest:test_removeVerifierNonExistentAddress() (gas: 12822) +DestinationFeeManagerProcessFeeTest:test_removeVerifierZeroAaddress() (gas: 10700) +DestinationFeeManagerProcessFeeTest:test_reportWithNoExpiryOrFeeReturnsZero() (gas: 13682) +DestinationFeeManagerProcessFeeTest:test_revertOnSettingAnAddressZeroVerifier() (gas: 10636) +DestinationFeeManagerProcessFeeTest:test_rewardsAreCorrectlySentToEachAssociatedPoolWhenVerifyingInBulk() (gas: 266627) +DestinationFeeManagerProcessFeeTest:test_setDiscountOver100Percent() (gas: 19540) +DestinationFeeManagerProcessFeeTest:test_setRewardManagerZeroAddress() (gas: 10626) +DestinationFeeManagerProcessFeeTest:test_subscriberDiscountEventIsEmittedOnUpdate() (gas: 46285) +DestinationFeeManagerProcessFeeTest:test_surchargeFeeRoundsUpWhenUneven() (gas: 53501) +DestinationFeeManagerProcessFeeTest:test_surchargeIsApplied() (gas: 53426) +DestinationFeeManagerProcessFeeTest:test_surchargeIsAppliedForNativeFeeWithDiscount() (gas: 79315) +DestinationFeeManagerProcessFeeTest:test_surchargeIsNoLongerAppliedAfterRemoving() (gas: 49149) +DestinationFeeManagerProcessFeeTest:test_surchargeIsNotAppliedForLinkFee() (gas: 52223) +DestinationFeeManagerProcessFeeTest:test_surchargeIsNotAppliedWith100PercentDiscount() (gas: 78311) +DestinationFeeManagerProcessFeeTest:test_testRevertIfReportHasExpired() (gas: 14987) +DestinationRewardManagerClaimTest:test_claimAllRecipients() (gas: 277223) +DestinationRewardManagerClaimTest:test_claimMultipleRecipients() (gas: 154387) +DestinationRewardManagerClaimTest:test_claimRewardsWithDuplicatePoolIdsDoesNotPayoutTwice() (gas: 330244) +DestinationRewardManagerClaimTest:test_claimSingleRecipient() (gas: 89047) +DestinationRewardManagerClaimTest:test_claimUnevenAmountRoundsDown() (gas: 315447) +DestinationRewardManagerClaimTest:test_claimUnregisteredPoolId() (gas: 35168) +DestinationRewardManagerClaimTest:test_claimUnregisteredRecipient() (gas: 41205) +DestinationRewardManagerClaimTest:test_eventIsEmittedUponClaim() (gas: 86092) +DestinationRewardManagerClaimTest:test_eventIsNotEmittedUponUnsuccessfulClaim() (gas: 25054) +DestinationRewardManagerClaimTest:test_recipientsClaimMultipleDeposits() (gas: 386925) +DestinationRewardManagerClaimTest:test_singleRecipientClaimMultipleDeposits() (gas: 137797) +DestinationRewardManagerNoRecipientSet:test_claimAllRecipientsAfterRecipientsSet() (gas: 494460) +DestinationRewardManagerPayRecipientsTest:test_addFundsToPoolAsNonOwnerOrFeeManager() (gas: 11503) +DestinationRewardManagerPayRecipientsTest:test_addFundsToPoolAsOwner() (gas: 53947) +DestinationRewardManagerPayRecipientsTest:test_payAllRecipients() (gas: 253082) +DestinationRewardManagerPayRecipientsTest:test_payAllRecipientsFromNonAdminUser() (gas: 20472) +DestinationRewardManagerPayRecipientsTest:test_payAllRecipientsFromRecipientInPool() (gas: 248964) +DestinationRewardManagerPayRecipientsTest:test_payAllRecipientsWithAdditionalInvalidRecipient() (gas: 264532) +DestinationRewardManagerPayRecipientsTest:test_payAllRecipientsWithAdditionalUnregisteredRecipient() (gas: 268017) +DestinationRewardManagerPayRecipientsTest:test_payRecipientWithInvalidPool() (gas: 31133) +DestinationRewardManagerPayRecipientsTest:test_payRecipientsEmptyRecipientList() (gas: 27554) +DestinationRewardManagerPayRecipientsTest:test_payRecipientsWithInvalidPoolId() (gas: 33639) +DestinationRewardManagerPayRecipientsTest:test_paySingleRecipient() (gas: 86938) +DestinationRewardManagerPayRecipientsTest:test_paySubsetOfRecipientsInPool() (gas: 200719) +DestinationRewardManagerRecipientClaimDifferentWeightsTest:test_allRecipientsClaimingReceiveExpectedAmount() (gas: 280885) +DestinationRewardManagerRecipientClaimMultiplePoolsTest:test_claimAllRecipientsMultiplePools() (gas: 512553) +DestinationRewardManagerRecipientClaimMultiplePoolsTest:test_claimAllRecipientsSinglePool() (gas: 283681) +DestinationRewardManagerRecipientClaimMultiplePoolsTest:test_claimEmptyPoolWhenSecondPoolContainsFunds() (gas: 293533) +DestinationRewardManagerRecipientClaimMultiplePoolsTest:test_claimMultipleRecipientsMultiplePools() (gas: 263107) +DestinationRewardManagerRecipientClaimMultiplePoolsTest:test_claimMultipleRecipientsSinglePool() (gas: 154553) +DestinationRewardManagerRecipientClaimMultiplePoolsTest:test_claimSingleRecipientMultiplePools() (gas: 132669) +DestinationRewardManagerRecipientClaimMultiplePoolsTest:test_claimSingleUniqueRecipient() (gas: 106068) +DestinationRewardManagerRecipientClaimMultiplePoolsTest:test_claimUnevenAmountRoundsDown() (gas: 579848) +DestinationRewardManagerRecipientClaimMultiplePoolsTest:test_claimUnregisteredRecipient() (gas: 64672) +DestinationRewardManagerRecipientClaimMultiplePoolsTest:test_getAvailableRewardsCursorAndTotalPoolsEqual() (gas: 13074) +DestinationRewardManagerRecipientClaimMultiplePoolsTest:test_getAvailableRewardsCursorCannotBeGreaterThanTotalPools() (gas: 12703) +DestinationRewardManagerRecipientClaimMultiplePoolsTest:test_getAvailableRewardsCursorSingleResult() (gas: 22471) +DestinationRewardManagerRecipientClaimMultiplePoolsTest:test_getRewardsAvailableToRecipientInBothPools() (gas: 32248) +DestinationRewardManagerRecipientClaimMultiplePoolsTest:test_getRewardsAvailableToRecipientInBothPoolsWhereAlreadyClaimed() (gas: 148645) +DestinationRewardManagerRecipientClaimMultiplePoolsTest:test_getRewardsAvailableToRecipientInNoPools() (gas: 21728) +DestinationRewardManagerRecipientClaimMultiplePoolsTest:test_getRewardsAvailableToRecipientInSinglePool() (gas: 27765) +DestinationRewardManagerRecipientClaimMultiplePoolsTest:test_recipientsClaimMultipleDeposits() (gas: 391495) +DestinationRewardManagerRecipientClaimMultiplePoolsTest:test_singleRecipientClaimMultipleDeposits() (gas: 137882) +DestinationRewardManagerRecipientClaimUnevenWeightTest:test_allRecipientsClaimingReceiveExpectedAmount() (gas: 199566) +DestinationRewardManagerRecipientClaimUnevenWeightTest:test_allRecipientsClaimingReceiveExpectedAmountWithSmallDeposit() (gas: 219439) +DestinationRewardManagerSetRecipientsTest:test_eventIsEmittedUponSetRecipients() (gas: 193892) +DestinationRewardManagerSetRecipientsTest:test_setRecipientContainsDuplicateRecipients() (gas: 128245) +DestinationRewardManagerSetRecipientsTest:test_setRewardRecipientFromManagerAddress() (gas: 213998) +DestinationRewardManagerSetRecipientsTest:test_setRewardRecipientFromNonOwnerOrFeeManagerAddress() (gas: 21496) +DestinationRewardManagerSetRecipientsTest:test_setRewardRecipientTwice() (gas: 195650) +DestinationRewardManagerSetRecipientsTest:test_setRewardRecipientWeights() (gas: 182793) +DestinationRewardManagerSetRecipientsTest:test_setRewardRecipientWithZeroAddress() (gas: 92387) +DestinationRewardManagerSetRecipientsTest:test_setRewardRecipientWithZeroWeight() (gas: 193497) +DestinationRewardManagerSetRecipientsTest:test_setRewardRecipients() (gas: 187752) +DestinationRewardManagerSetRecipientsTest:test_setRewardRecipientsIsEmpty() (gas: 89276) +DestinationRewardManagerSetRecipientsTest:test_setSingleRewardRecipient() (gas: 112534) +DestinationRewardManagerSetupTest:test_addFeeManagerExistingAddress() (gas: 35281) +DestinationRewardManagerSetupTest:test_addFeeManagerZeroAddress() (gas: 10580) +DestinationRewardManagerSetupTest:test_addRemoveFeeManager() (gas: 48248) +DestinationRewardManagerSetupTest:test_eventEmittedUponFeeManagerUpdate() (gas: 41581) +DestinationRewardManagerSetupTest:test_eventEmittedUponFeePaid() (gas: 261361) +DestinationRewardManagerSetupTest:test_rejectsZeroLinkAddressOnConstruction() (gas: 59481) +DestinationRewardManagerSetupTest:test_removeFeeManagerNonExistentAddress() (gas: 12778) +DestinationRewardManagerSetupTest:test_setFeeManagerZeroAddress() (gas: 17084) +DestinationRewardManagerUpdateRewardRecipientsMultiplePoolsTest:test_updatePrimaryRecipientWeights() (gas: 376742) +DestinationRewardManagerUpdateRewardRecipientsTest:test_eventIsEmittedUponUpdateRecipients() (gas: 280443) +DestinationRewardManagerUpdateRewardRecipientsTest:test_onlyAdminCanUpdateRecipients() (gas: 19705) +DestinationRewardManagerUpdateRewardRecipientsTest:test_partialUpdateRecipientWeights() (gas: 221040) +DestinationRewardManagerUpdateRewardRecipientsTest:test_updateAllRecipientsWithSameAddressAndWeight() (gas: 274265) +DestinationRewardManagerUpdateRewardRecipientsTest:test_updatePartialRecipientsToSubset() (gas: 254188) +DestinationRewardManagerUpdateRewardRecipientsTest:test_updatePartialRecipientsWithExcessiveWeight() (gas: 259175) +DestinationRewardManagerUpdateRewardRecipientsTest:test_updatePartialRecipientsWithSameAddressAndWeight() (gas: 149872) +DestinationRewardManagerUpdateRewardRecipientsTest:test_updatePartialRecipientsWithUnderWeightSet() (gas: 259249) +DestinationRewardManagerUpdateRewardRecipientsTest:test_updateRecipientWeights() (gas: 372223) +DestinationRewardManagerUpdateRewardRecipientsTest:test_updateRecipientWithNewZeroAddress() (gas: 270736) +DestinationRewardManagerUpdateRewardRecipientsTest:test_updateRecipientsContainsDuplicateRecipients() (gas: 288531) +DestinationRewardManagerUpdateRewardRecipientsTest:test_updateRecipientsToDifferentLargerSet() (gas: 407832) +DestinationRewardManagerUpdateRewardRecipientsTest:test_updateRecipientsToDifferentPartialSet() (gas: 317985) +DestinationRewardManagerUpdateRewardRecipientsTest:test_updateRecipientsToDifferentSet() (gas: 377740) +DestinationRewardManagerUpdateRewardRecipientsTest:test_updateRecipientsToDifferentSetWithInvalidWeights() (gas: 312078) +DestinationRewardManagerUpdateRewardRecipientsTest:test_updateRecipientsUpdateAndRemoveExistingForLargerSet() (gas: 399655) +DestinationRewardManagerUpdateRewardRecipientsTest:test_updateRecipientsUpdateAndRemoveExistingForSmallerSet() (gas: 289469) +DestinationVerifierBulkVerifyBillingReport:test_verifyWithBulkLink() (gas: 642599) +DestinationVerifierBulkVerifyBillingReport:test_verifyWithBulkNative() (gas: 643674) +DestinationVerifierBulkVerifyBillingReport:test_verifyWithBulkNativeUnwrapped() (gas: 665238) +DestinationVerifierBulkVerifyBillingReport:test_verifyWithBulkNativeUnwrappedReturnsChange() (gas: 665193) +DestinationVerifierConstructorTest:test_falseIfIsNotCorrectInterface() (gas: 8481) +DestinationVerifierConstructorTest:test_revertsIfInitializedWithEmptyVerifierProxy() (gas: 60885) +DestinationVerifierConstructorTest:test_trueIfIsCorrectInterface() (gas: 9383) +DestinationVerifierConstructorTest:test_typeAndVersion() (gas: 2624729) +DestinationVerifierProxyInitializeVerifierTest:test_correctlySetsTheOwner() (gas: 862226) +DestinationVerifierProxyInitializeVerifierTest:test_correctlySetsVersion() (gas: 9841) +DestinationVerifierProxyInitializeVerifierTest:test_setVerifierCalledByNoOwner() (gas: 17483) +DestinationVerifierProxyInitializeVerifierTest:test_setVerifierOk() (gas: 27727) +DestinationVerifierProxyInitializeVerifierTest:test_setVerifierWhichDoesntHonourInterface() (gas: 16535) +DestinationVerifierSetAccessControllerTest:test_emitsTheCorrectEvent() (gas: 35391) +DestinationVerifierSetAccessControllerTest:test_revertsIfCalledByNonOwner() (gas: 15089) +DestinationVerifierSetAccessControllerTest:test_successfullySetsNewAccessController() (gas: 34885) +DestinationVerifierSetAccessControllerTest:test_successfullySetsNewAccessControllerIsEmpty() (gas: 15007) +DestinationVerifierSetConfigTest:test_NoDonConfigAlreadyExists() (gas: 2877761) +DestinationVerifierSetConfigTest:test_addressesAndWeightsDoNotProduceSideEffectsInDonConfigIds() (gas: 1323254) +DestinationVerifierSetConfigTest:test_donConfigIdIsSameForSignersInDifferentOrder() (gas: 1290451) +DestinationVerifierSetConfigTest:test_removeLatestConfig() (gas: 786161) +DestinationVerifierSetConfigTest:test_removeLatestConfigWhenNoConfigShouldFail() (gas: 12870) +DestinationVerifierSetConfigTest:test_revertsIfCalledByNonOwner() (gas: 174936) +DestinationVerifierSetConfigTest:test_revertsIfDuplicateSigners() (gas: 171299) +DestinationVerifierSetConfigTest:test_revertsIfFaultToleranceIsZero() (gas: 168506) +DestinationVerifierSetConfigTest:test_revertsIfNotEnoughSigners() (gas: 11571) +DestinationVerifierSetConfigTest:test_revertsIfSetWithTooManySigners() (gas: 17943) +DestinationVerifierSetConfigTest:test_revertsIfSignerContainsZeroAddress() (gas: 324006) +DestinationVerifierSetConfigTest:test_setConfigActiveUnknownDonConfigId() (gas: 13124) +DestinationVerifierSetConfigTest:test_setConfigWithActivationTime() (gas: 1088159) +DestinationVerifierSetConfigTest:test_setConfigWithActivationTimeEarlierThanLatestConfigShouldFail() (gas: 1963073) +DestinationVerifierSetConfigTest:test_setConfigWithActivationTimeNoFutureTimeShouldFail() (gas: 259470) +DestinationVerifierSetConfigTest:test_setConfigWithActivationTimeTheSameAsLatestConfigShouldFail() (gas: 1283783) FeeManagerProcessFeeTest:test_DiscountIsAppliedForNative() (gas: 52645) FeeManagerProcessFeeTest:test_DiscountIsReturnedForNative() (gas: 52595) FeeManagerProcessFeeTest:test_DiscountIsReturnedForNativeWithSurcharge() (gas: 78808) @@ -72,7 +299,7 @@ FeeManagerProcessFeeTest:test_payLinkDeficitTwice() (gas: 198803) FeeManagerProcessFeeTest:test_processFeeAsProxy() (gas: 117088) FeeManagerProcessFeeTest:test_processFeeDefaultReportsStillVerifiesWithEmptyQuote() (gas: 27462) FeeManagerProcessFeeTest:test_processFeeEmitsEventIfNotEnoughLink() (gas: 163205) -FeeManagerProcessFeeTest:test_processFeeIfSubscriberIsSelf() (gas: 27827) +FeeManagerProcessFeeTest:test_processFeeIfSubscriberIsSelf() (gas: 30327) FeeManagerProcessFeeTest:test_processFeeNative() (gas: 173826) FeeManagerProcessFeeTest:test_processFeeUsesCorrectDigest() (gas: 118379) FeeManagerProcessFeeTest:test_processFeeWithDefaultReportPayloadAndQuoteStillVerifies() (gas: 29536) @@ -108,6 +335,7 @@ FeeManagerProcessFeeTest:test_surchargeIsNoLongerAppliedAfterRemoving() (gas: 47 FeeManagerProcessFeeTest:test_surchargeIsNotAppliedForLinkFee() (gas: 49938) FeeManagerProcessFeeTest:test_surchargeIsNotAppliedWith100PercentDiscount() (gas: 78261) FeeManagerProcessFeeTest:test_testRevertIfReportHasExpired() (gas: 14919) +MultiVerifierBillingTests:test_multipleFeeManagersAndVerifiers() (gas: 4598487) RewardManagerClaimTest:test_claimAllRecipients() (gas: 277131) RewardManagerClaimTest:test_claimMultipleRecipients() (gas: 154341) RewardManagerClaimTest:test_claimRewardsWithDuplicatePoolIdsDoesNotPayoutTwice() (gas: 330086) @@ -200,6 +428,13 @@ VerifierActivateFeedTest:test_revertsIfNoFeedExistsActivate() (gas: 13179) VerifierActivateFeedTest:test_revertsIfNoFeedExistsDeactivate() (gas: 13157) VerifierActivateFeedTest:test_revertsIfNotOwnerActivateFeed() (gas: 17109) VerifierActivateFeedTest:test_revertsIfNotOwnerDeactivateFeed() (gas: 17164) +VerifierBillingTests:test_rewardsAreDistributedAccordingToWeights() (gas: 1736216) +VerifierBillingTests:test_rewardsAreDistributedAccordingToWeightsMultipleWeigths() (gas: 4468029) +VerifierBillingTests:test_rewardsAreDistributedAccordingToWeightsUsingHistoricalConfigs() (gas: 2106504) +VerifierBillingTests:test_verifyWithLinkV3Report() (gas: 1593617) +VerifierBillingTests:test_verifyWithNativeERC20() (gas: 1467526) +VerifierBillingTests:test_verifyWithNativeUnwrapped() (gas: 1378718) +VerifierBillingTests:test_verifyWithNativeUnwrappedReturnsChange() (gas: 1385764) VerifierBulkVerifyBillingReport:test_verifyMultiVersions() (gas: 476595) VerifierBulkVerifyBillingReport:test_verifyMultiVersionsReturnsVerifiedReports() (gas: 474853) VerifierBulkVerifyBillingReport:test_verifyWithBulkLink() (gas: 557541) @@ -212,6 +447,7 @@ VerifierDeactivateFeedWithVerifyTest:test_currentReportAllowsVerification() (gas VerifierDeactivateFeedWithVerifyTest:test_currentReportFailsVerification() (gas: 113388) VerifierDeactivateFeedWithVerifyTest:test_previousReportAllowsVerification() (gas: 99624) VerifierDeactivateFeedWithVerifyTest:test_previousReportFailsVerification() (gas: 69943) +VerifierInterfacesTest:test_DestinationContractInterfaces() (gas: 628127) VerifierProxyAccessControlledVerificationTest:test_proxiesToTheVerifierIfHasAccess() (gas: 208529) VerifierProxyAccessControlledVerificationTest:test_revertsIfNoAccess() (gas: 112345) VerifierProxyConstructorTest:test_correctlySetsTheCorrectAccessControllerInterface() (gas: 1485359) @@ -236,6 +472,9 @@ VerifierProxyUnsetVerifierWithPreviouslySetVerifierTest:test_correctlyUnsetsVeri VerifierProxyUnsetVerifierWithPreviouslySetVerifierTest:test_emitsAnEventAfterUnsettingVerifier() (gas: 17961) VerifierProxyVerifyTest:test_proxiesToTheCorrectVerifier() (gas: 204342) VerifierProxyVerifyTest:test_revertsIfNoVerifierConfigured() (gas: 117264) +VerifierSetAccessControllerTest:test_revertsIfCalledByNonOwner() (gas: 17196) +VerifierSetAccessControllerTest:test_setFeeManagerWhichDoesntHonourInterface() (gas: 16272) +VerifierSetAccessControllerTest:test_successfullySetsNewFeeManager() (gas: 42226) VerifierSetConfigFromSourceMultipleDigestsTest:test_correctlySetsConfigWhenDigestsAreRemoved() (gas: 542302) VerifierSetConfigFromSourceMultipleDigestsTest:test_correctlyUpdatesDigestsOnMultipleVerifiersInTheProxy() (gas: 967768) VerifierSetConfigFromSourceMultipleDigestsTest:test_correctlyUpdatesTheDigestInTheProxy() (gas: 523251) @@ -256,6 +495,9 @@ VerifierTestBillingReport:test_verifyWithLink() (gas: 275293) VerifierTestBillingReport:test_verifyWithNative() (gas: 316326) VerifierTestBillingReport:test_verifyWithNativeUnwrapped() (gas: 318574) VerifierTestBillingReport:test_verifyWithNativeUnwrappedReturnsChange() (gas: 325642) +VerifierVerifyBulkTest:test_revertsVerifyBulkIfNoAccess() (gas: 112867) +VerifierVerifyBulkTest:test_verifyBulkSingleCaseWithSingleConfig() (gas: 745006) +VerifierVerifyBulkTest:test_verifyBulkWithSingleConfigOneVerifyFails() (gas: 698163) VerifierVerifyMultipleConfigDigestTest:test_canVerifyNewerReportsWithNewerConfigs() (gas: 133961) VerifierVerifyMultipleConfigDigestTest:test_canVerifyOlderReportsWithOlderConfigs() (gas: 189865) VerifierVerifyMultipleConfigDigestTest:test_revertsIfAReportIsVerifiedWithAnExistingButIncorrectDigest() (gas: 88216) @@ -270,6 +512,18 @@ VerifierVerifySingleConfigDigestTest:test_revertsIfVerifiedByNonProxy() (gas: 10 VerifierVerifySingleConfigDigestTest:test_revertsIfVerifiedWithIncorrectAddresses() (gas: 184077) VerifierVerifySingleConfigDigestTest:test_revertsIfWrongNumberOfSigners() (gas: 110042) VerifierVerifySingleConfigDigestTest:test_setsTheCorrectEpoch() (gas: 194592) +VerifierVerifyTest:test_canVerifyNewerReportsWithNewerConfigs() (gas: 862947) +VerifierVerifyTest:test_canVerifyOlderV3ReportsWithOlderConfigs() (gas: 815907) +VerifierVerifyTest:test_failToVerifyReportIfDupSigners() (gas: 450675) +VerifierVerifyTest:test_failToVerifyReportIfNoSigners() (gas: 426452) +VerifierVerifyTest:test_failToVerifyReportIfNotEnoughSigners() (gas: 434774) +VerifierVerifyTest:test_failToVerifyReportIfSignerNotInConfig() (gas: 456826) +VerifierVerifyTest:test_revertsVerifyIfNoAccess() (gas: 109465) +VerifierVerifyTest:test_rollingOutConfiguration() (gas: 1497140) +VerifierVerifyTest:test_scenarioRollingNewChainWithHistoricConfigs() (gas: 976048) +VerifierVerifyTest:test_verifyFailsWhenReportIsOlderThanConfig() (gas: 2303291) +VerifierVerifyTest:test_verifyReport() (gas: 1434772) +VerifierVerifyTest:test_verifyTooglingActiveFlagsDonConfigs() (gas: 1918758) Verifier_accessControlledVerify:testVerifyWithAccessControl_gas() (gas: 212077) Verifier_bulkVerifyWithFee:testBulkVerifyProxyWithLinkFeeSuccess_gas() (gas: 519389) Verifier_bulkVerifyWithFee:testBulkVerifyProxyWithNativeFeeSuccess_gas() (gas: 542808) diff --git a/contracts/gas-snapshots/operatorforwarder.gas-snapshot b/contracts/gas-snapshots/operatorforwarder.gas-snapshot index 7cfc963f74e..551fde38f35 100644 --- a/contracts/gas-snapshots/operatorforwarder.gas-snapshot +++ b/contracts/gas-snapshots/operatorforwarder.gas-snapshot @@ -2,8 +2,8 @@ FactoryTest:test_DeployNewForwarderAndTransferOwnership_Success() (gas: 1059722) FactoryTest:test_DeployNewForwarder_Success() (gas: 1048209) FactoryTest:test_DeployNewOperatorAndForwarder_Success() (gas: 4069305) FactoryTest:test_DeployNewOperator_Success() (gas: 3020464) -ForwarderTest:test_Forward_Success(uint256) (runs: 256, μ: 226200, ~: 227289) -ForwarderTest:test_MultiForward_Success(uint256,uint256) (runs: 256, μ: 257876, ~: 259120) +ForwarderTest:test_Forward_Success(uint256) (runs: 256, μ: 226978, ~: 227289) +ForwarderTest:test_MultiForward_Success(uint256,uint256) (runs: 256, μ: 258575, ~: 259120) ForwarderTest:test_OwnerForward_Success() (gas: 30118) ForwarderTest:test_SetAuthorizedSenders_Success() (gas: 160524) ForwarderTest:test_TransferOwnershipWithMessage_Success() (gas: 35123) @@ -11,5 +11,5 @@ OperatorTest:test_CancelOracleRequest_Success() (gas: 274436) OperatorTest:test_FulfillOracleRequest_Success() (gas: 330603) OperatorTest:test_NotAuthorizedSender_Revert() (gas: 246716) OperatorTest:test_OracleRequest_Success() (gas: 250019) -OperatorTest:test_SendRequestAndCancelRequest_Success(uint96) (runs: 256, μ: 387120, ~: 387124) -OperatorTest:test_SendRequest_Success(uint96) (runs: 256, μ: 303611, ~: 303615) \ No newline at end of file +OperatorTest:test_SendRequestAndCancelRequest_Success(uint96) (runs: 256, μ: 387121, ~: 387124) +OperatorTest:test_SendRequest_Success(uint96) (runs: 256, μ: 303612, ~: 303615) \ No newline at end of file diff --git a/contracts/gas-snapshots/shared.gas-snapshot b/contracts/gas-snapshots/shared.gas-snapshot index 0419c42a6aa..dda850089c7 100644 --- a/contracts/gas-snapshots/shared.gas-snapshot +++ b/contracts/gas-snapshots/shared.gas-snapshot @@ -39,33 +39,41 @@ CallWithExactGas__callWithExactGas:test_CallWithExactGasSafeReturnDataExactGas() CallWithExactGas__callWithExactGas:test_NoContractReverts() (gas: 11559) CallWithExactGas__callWithExactGas:test_NoGasForCallExactCheckReverts() (gas: 15788) CallWithExactGas__callWithExactGas:test_NotEnoughGasForCallReverts() (gas: 16241) -CallWithExactGas__callWithExactGas:test_callWithExactGasSuccess(bytes,bytes4) (runs: 256, μ: 15811, ~: 15752) +CallWithExactGas__callWithExactGas:test_callWithExactGasSuccess(bytes,bytes4) (runs: 256, μ: 15766, ~: 15719) CallWithExactGas__callWithExactGasEvenIfTargetIsNoContract:test_CallWithExactGasEvenIfTargetIsNoContractExactGasSuccess() (gas: 20116) CallWithExactGas__callWithExactGasEvenIfTargetIsNoContract:test_CallWithExactGasEvenIfTargetIsNoContractReceiverErrorSuccess() (gas: 67721) -CallWithExactGas__callWithExactGasEvenIfTargetIsNoContract:test_CallWithExactGasEvenIfTargetIsNoContractSuccess(bytes,bytes4) (runs: 256, μ: 16321, ~: 16262) +CallWithExactGas__callWithExactGasEvenIfTargetIsNoContract:test_CallWithExactGasEvenIfTargetIsNoContractSuccess(bytes,bytes4) (runs: 256, μ: 16276, ~: 16229) CallWithExactGas__callWithExactGasEvenIfTargetIsNoContract:test_NoContractSuccess() (gas: 12962) CallWithExactGas__callWithExactGasEvenIfTargetIsNoContract:test_NoGasForCallExactCheckReturnFalseSuccess() (gas: 13005) CallWithExactGas__callWithExactGasEvenIfTargetIsNoContract:test_NotEnoughGasForCallReturnsFalseSuccess() (gas: 13317) CallWithExactGas__callWithExactGasSafeReturnData:test_CallWithExactGasSafeReturnDataExactGas() (gas: 20331) CallWithExactGas__callWithExactGasSafeReturnData:test_NoContractReverts() (gas: 13917) CallWithExactGas__callWithExactGasSafeReturnData:test_NoGasForCallExactCheckReverts() (gas: 16139) -CallWithExactGas__callWithExactGasSafeReturnData:test_NotEnoughGasForCallReverts() (gas: 16547) -CallWithExactGas__callWithExactGasSafeReturnData:test_callWithExactGasSafeReturnData_ThrowOOGError_Revert() (gas: 36752) -EnumerableMapAddresses_at:testAtSuccess() (gas: 95001) -EnumerableMapAddresses_at:testBytes32AtSuccess() (gas: 94770) +CallWithExactGas__callWithExactGasSafeReturnData:test_NotEnoughGasForCallReverts() (gas: 16569) +CallWithExactGas__callWithExactGasSafeReturnData:test_callWithExactGasSafeReturnData_ThrowOOGError_Revert() (gas: 36708) +EnumerableMapAddresses_at:testAtSuccess() (gas: 95086) +EnumerableMapAddresses_at:testBytes32AtSuccess() (gas: 94877) +EnumerableMapAddresses_at:testBytesAtSuccess() (gas: 96564) EnumerableMapAddresses_contains:testBytes32ContainsSuccess() (gas: 93518) +EnumerableMapAddresses_contains:testBytesContainsSuccess() (gas: 94012) EnumerableMapAddresses_contains:testContainsSuccess() (gas: 93696) -EnumerableMapAddresses_get:testBytes32GetSuccess() (gas: 94249) -EnumerableMapAddresses_get:testGetSuccess() (gas: 94436) -EnumerableMapAddresses_get_errorMessage:testGetErrorMessageSuccess() (gas: 94477) -EnumerableMapAddresses_length:testBytes32LengthSuccess() (gas: 72404) -EnumerableMapAddresses_length:testLengthSuccess() (gas: 72582) -EnumerableMapAddresses_remove:testBytes32RemoveSuccess() (gas: 73408) +EnumerableMapAddresses_get:testBytes32GetSuccess() (gas: 94278) +EnumerableMapAddresses_get:testBytesGetSuccess() (gas: 95879) +EnumerableMapAddresses_get:testGetSuccess() (gas: 94453) +EnumerableMapAddresses_get_errorMessage:testBytesGetErrorMessageSuccess() (gas: 95878) +EnumerableMapAddresses_get_errorMessage:testGetErrorMessageSuccess() (gas: 94489) +EnumerableMapAddresses_length:testBytes32LengthSuccess() (gas: 72445) +EnumerableMapAddresses_length:testBytesLengthSuccess() (gas: 73011) +EnumerableMapAddresses_length:testLengthSuccess() (gas: 72640) +EnumerableMapAddresses_remove:testBytes32RemoveSuccess() (gas: 73462) +EnumerableMapAddresses_remove:testBytesRemoveSuccess() (gas: 74249) EnumerableMapAddresses_remove:testRemoveSuccess() (gas: 73686) EnumerableMapAddresses_set:testBytes32SetSuccess() (gas: 94496) +EnumerableMapAddresses_set:testBytesSetSuccess() (gas: 95428) EnumerableMapAddresses_set:testSetSuccess() (gas: 94685) -EnumerableMapAddresses_tryGet:testBytes32TryGetSuccess() (gas: 94604) -EnumerableMapAddresses_tryGet:testTryGetSuccess() (gas: 94864) +EnumerableMapAddresses_tryGet:testBytes32TryGetSuccess() (gas: 94622) +EnumerableMapAddresses_tryGet:testBytesTryGetSuccess() (gas: 96279) +EnumerableMapAddresses_tryGet:testTryGetSuccess() (gas: 94893) OpStackBurnMintERC677_constructor:testConstructorSuccess() (gas: 1743649) OpStackBurnMintERC677_interfaceCompatibility:testBurnCompatibility() (gas: 298649) OpStackBurnMintERC677_interfaceCompatibility:testMintCompatibility() (gas: 137957) diff --git a/contracts/hardhat.config.ts b/contracts/hardhat.config.ts index 1b2ac1bdf19..73e70081e9a 100644 --- a/contracts/hardhat.config.ts +++ b/contracts/hardhat.config.ts @@ -21,7 +21,8 @@ subtask(TASK_COMPILE_SOLIDITY_GET_SOURCE_PATHS).setAction( async (_, __, runSuper) => { const paths = await runSuper() const noTests = paths.filter((p: string) => !p.endsWith('.t.sol')) - return noTests.filter( + const noCCIP = noTests.filter((p: string) => !p.includes('/v0.8/ccip')) + return noCCIP.filter( (p: string) => !p.includes('src/v0.8/vendor/forge-std'), ) }, diff --git a/contracts/package.json b/contracts/package.json index 247bb92303e..d80e94159a9 100644 --- a/contracts/package.json +++ b/contracts/package.json @@ -1,6 +1,6 @@ { "name": "@chainlink/contracts", - "version": "1.1.1", + "version": "1.2.0", "description": "Chainlink smart contracts", "author": "Chainlink devs", "license": "MIT", @@ -18,7 +18,7 @@ "prepublishOnly": "pnpm compile && ./scripts/prepublish_generate_abi_folder", "publish-beta": "pnpm publish --tag beta", "publish-prod": "pnpm publish --tag latest", - "solhint": "solhint --max-warnings 2 \"./src/v0.8/**/*.sol\"" + "solhint": "solhint --max-warnings 0 \"./src/v0.8/**/*.sol\"" }, "files": [ "src/v0.8", @@ -43,47 +43,50 @@ "@ethersproject/providers": "~5.7.2", "@nomicfoundation/hardhat-chai-matchers": "^1.0.6", "@nomicfoundation/hardhat-ethers": "^3.0.6", - "@nomicfoundation/hardhat-network-helpers": "^1.0.9", - "@nomicfoundation/hardhat-verify": "^2.0.7", + "@nomicfoundation/hardhat-network-helpers": "^1.0.11", + "@nomicfoundation/hardhat-verify": "^2.0.9", "@typechain/ethers-v5": "^7.2.0", "@typechain/hardhat": "^7.0.0", "@types/cbor": "~5.0.1", - "@types/chai": "^4.3.16", + "@types/chai": "^4.3.17", "@types/debug": "^4.1.12", "@types/deep-equal-in-any-order": "^1.0.3", - "@types/mocha": "^10.0.6", - "@types/node": "^20.12.12", - "@typescript-eslint/eslint-plugin": "^7.10.0", - "@typescript-eslint/parser": "^7.10.0", + "@types/mocha": "^10.0.7", + "@types/node": "^20.14.15", + "@typescript-eslint/eslint-plugin": "^7.18.0", + "@typescript-eslint/parser": "^7.18.0", "abi-to-sol": "^0.6.6", "cbor": "^5.2.0", - "chai": "^4.3.10", - "debug": "^4.3.4", + "chai": "^4.5.0", + "debug": "^4.3.6", "deep-equal-in-any-order": "^2.0.6", "eslint": "^8.57.0", "eslint-config-prettier": "^9.1.0", - "eslint-plugin-prettier": "^5.1.3", + "eslint-plugin-prettier": "^5.2.1", "ethers": "~5.7.2", "hardhat": "~2.20.1", "hardhat-abi-exporter": "^2.10.1", "hardhat-ignore-warnings": "^0.2.6", "moment": "^2.30.1", - "prettier": "^3.2.5", + "prettier": "^3.3.3", "prettier-plugin-solidity": "^1.3.1", "solhint": "^5.0.1", "solhint-plugin-chainlink-solidity": "git+https://github.com/smartcontractkit/chainlink-solhint-rules.git#v1.2.1", "solhint-plugin-prettier": "^0.1.0", "ts-node": "^10.9.2", "typechain": "^8.2.1", - "typescript": "^5.4.5" + "typescript": "^5.5.4" }, "dependencies": { + "@arbitrum/nitro-contracts": "1.1.1", + "@arbitrum/token-bridge-contracts": "1.1.2", "@changesets/changelog-github": "^0.5.0", - "@changesets/cli": "~2.27.3", + "@changesets/cli": "~2.27.7", "@eth-optimism/contracts": "0.6.0", "@openzeppelin/contracts": "4.9.3", "@openzeppelin/contracts-upgradeable": "4.9.3", "@scroll-tech/contracts": "0.1.0", - "semver": "^7.6.2" + "@zksync/contracts": "git+https://github.com/matter-labs/era-contracts.git#446d391d34bdb48255d5f8fef8a8248925fc98b9", + "semver": "^7.6.3" } } diff --git a/contracts/pnpm-lock.yaml b/contracts/pnpm-lock.yaml index 4ad8deda991..f087dd7cd47 100644 --- a/contracts/pnpm-lock.yaml +++ b/contracts/pnpm-lock.yaml @@ -11,12 +11,18 @@ importers: .: dependencies: + '@arbitrum/nitro-contracts': + specifier: 1.1.1 + version: 1.1.1 + '@arbitrum/token-bridge-contracts': + specifier: 1.1.2 + version: 1.1.2 '@changesets/changelog-github': specifier: ^0.5.0 version: 0.5.0 '@changesets/cli': - specifier: ~2.27.3 - version: 2.27.3 + specifier: ~2.27.7 + version: 2.27.7 '@eth-optimism/contracts': specifier: 0.6.0 version: 0.6.0(ethers@5.7.2) @@ -29,9 +35,12 @@ importers: '@scroll-tech/contracts': specifier: 0.1.0 version: 0.1.0 + '@zksync/contracts': + specifier: git+https://github.com/matter-labs/era-contracts.git#446d391d34bdb48255d5f8fef8a8248925fc98b9 + version: era-contracts@https://codeload.github.com/matter-labs/era-contracts/tar.gz/446d391d34bdb48255d5f8fef8a8248925fc98b9 semver: - specifier: ^7.6.2 - version: 7.6.2 + specifier: ^7.6.3 + version: 7.6.3 devDependencies: '@ethereum-waffle/mock-contract': specifier: ^3.4.4 @@ -50,28 +59,28 @@ importers: version: 5.7.2 '@nomicfoundation/hardhat-chai-matchers': specifier: ^1.0.6 - version: 1.0.6(@nomiclabs/hardhat-ethers@2.2.3)(chai@4.4.1)(ethers@5.7.2)(hardhat@2.20.1) + version: 1.0.6(@nomiclabs/hardhat-ethers@2.2.3(ethers@5.7.2)(hardhat@2.20.1(ts-node@10.9.2(@types/node@20.14.15)(typescript@5.5.4))(typescript@5.5.4)))(chai@4.5.0)(ethers@5.7.2)(hardhat@2.20.1(ts-node@10.9.2(@types/node@20.14.15)(typescript@5.5.4))(typescript@5.5.4)) '@nomicfoundation/hardhat-ethers': specifier: ^3.0.6 - version: 3.0.6(ethers@5.7.2)(hardhat@2.20.1) + version: 3.0.6(ethers@5.7.2)(hardhat@2.20.1(ts-node@10.9.2(@types/node@20.14.15)(typescript@5.5.4))(typescript@5.5.4)) '@nomicfoundation/hardhat-network-helpers': - specifier: ^1.0.9 - version: 1.0.10(hardhat@2.20.1) + specifier: ^1.0.11 + version: 1.0.11(hardhat@2.20.1(ts-node@10.9.2(@types/node@20.14.15)(typescript@5.5.4))(typescript@5.5.4)) '@nomicfoundation/hardhat-verify': - specifier: ^2.0.7 - version: 2.0.7(hardhat@2.20.1) + specifier: ^2.0.9 + version: 2.0.9(hardhat@2.20.1(ts-node@10.9.2(@types/node@20.14.15)(typescript@5.5.4))(typescript@5.5.4)) '@typechain/ethers-v5': specifier: ^7.2.0 - version: 7.2.0(@ethersproject/abi@5.7.0)(@ethersproject/bytes@5.7.0)(@ethersproject/providers@5.7.2)(ethers@5.7.2)(typechain@8.3.2)(typescript@5.4.5) + version: 7.2.0(@ethersproject/abi@5.7.0)(@ethersproject/bytes@5.7.0)(@ethersproject/providers@5.7.2)(ethers@5.7.2)(typechain@8.3.2(typescript@5.5.4))(typescript@5.5.4) '@typechain/hardhat': specifier: ^7.0.0 - version: 7.0.0(@ethersproject/abi@5.7.0)(@ethersproject/providers@5.7.2)(@typechain/ethers-v5@7.2.0)(ethers@5.7.2)(hardhat@2.20.1)(typechain@8.3.2) + version: 7.0.0(@ethersproject/abi@5.7.0)(@ethersproject/providers@5.7.2)(@typechain/ethers-v5@7.2.0(@ethersproject/abi@5.7.0)(@ethersproject/bytes@5.7.0)(@ethersproject/providers@5.7.2)(ethers@5.7.2)(typechain@8.3.2(typescript@5.5.4))(typescript@5.5.4))(ethers@5.7.2)(hardhat@2.20.1(ts-node@10.9.2(@types/node@20.14.15)(typescript@5.5.4))(typescript@5.5.4))(typechain@8.3.2(typescript@5.5.4)) '@types/cbor': specifier: ~5.0.1 version: 5.0.1 '@types/chai': - specifier: ^4.3.16 - version: 4.3.16 + specifier: ^4.3.17 + version: 4.3.17 '@types/debug': specifier: ^4.1.12 version: 4.1.12 @@ -79,17 +88,17 @@ importers: specifier: ^1.0.3 version: 1.0.3 '@types/mocha': - specifier: ^10.0.6 - version: 10.0.6 + specifier: ^10.0.7 + version: 10.0.7 '@types/node': - specifier: ^20.12.12 - version: 20.12.12 + specifier: ^20.14.15 + version: 20.14.15 '@typescript-eslint/eslint-plugin': - specifier: ^7.10.0 - version: 7.10.0(@typescript-eslint/parser@7.10.0)(eslint@8.57.0)(typescript@5.4.5) + specifier: ^7.18.0 + version: 7.18.0(@typescript-eslint/parser@7.18.0(eslint@8.57.0)(typescript@5.5.4))(eslint@8.57.0)(typescript@5.5.4) '@typescript-eslint/parser': - specifier: ^7.10.0 - version: 7.10.0(eslint@8.57.0)(typescript@5.4.5) + specifier: ^7.18.0 + version: 7.18.0(eslint@8.57.0)(typescript@5.5.4) abi-to-sol: specifier: ^0.6.6 version: 0.6.6 @@ -97,11 +106,11 @@ importers: specifier: ^5.2.0 version: 5.2.0 chai: - specifier: ^4.3.10 - version: 4.4.1 + specifier: ^4.5.0 + version: 4.5.0 debug: - specifier: ^4.3.4 - version: 4.3.4(supports-color@8.1.1) + specifier: ^4.3.6 + version: 4.3.6 deep-equal-in-any-order: specifier: ^2.0.6 version: 2.0.6 @@ -112,17 +121,17 @@ importers: specifier: ^9.1.0 version: 9.1.0(eslint@8.57.0) eslint-plugin-prettier: - specifier: ^5.1.3 - version: 5.1.3(eslint-config-prettier@9.1.0)(eslint@8.57.0)(prettier@3.2.5) + specifier: ^5.2.1 + version: 5.2.1(eslint-config-prettier@9.1.0(eslint@8.57.0))(eslint@8.57.0)(prettier@3.3.3) ethers: specifier: ~5.7.2 version: 5.7.2 hardhat: specifier: ~2.20.1 - version: 2.20.1(ts-node@10.9.2)(typescript@5.4.5) + version: 2.20.1(ts-node@10.9.2(@types/node@20.14.15)(typescript@5.5.4))(typescript@5.5.4) hardhat-abi-exporter: specifier: ^2.10.1 - version: 2.10.1(hardhat@2.20.1) + version: 2.10.1(hardhat@2.20.1(ts-node@10.9.2(@types/node@20.14.15)(typescript@5.5.4))(typescript@5.5.4)) hardhat-ignore-warnings: specifier: ^0.2.6 version: 0.2.11 @@ -130,11 +139,11 @@ importers: specifier: ^2.30.1 version: 2.30.1 prettier: - specifier: ^3.2.5 - version: 3.2.5 + specifier: ^3.3.3 + version: 3.3.3 prettier-plugin-solidity: specifier: ^1.3.1 - version: 1.3.1(prettier@3.2.5) + version: 1.3.1(prettier@3.3.3) solhint: specifier: ^5.0.1 version: 5.0.1 @@ -143,16 +152,16 @@ importers: version: '@chainlink/solhint-plugin-chainlink-solidity@https://codeload.github.com/smartcontractkit/chainlink-solhint-rules/tar.gz/1b4c0c2663fcd983589d4f33a2e73908624ed43c' solhint-plugin-prettier: specifier: ^0.1.0 - version: 0.1.0(prettier-plugin-solidity@1.3.1)(prettier@3.2.5) + version: 0.1.0(prettier-plugin-solidity@1.3.1(prettier@3.3.3))(prettier@3.3.3) ts-node: specifier: ^10.9.2 - version: 10.9.2(@types/node@20.12.12)(typescript@5.4.5) + version: 10.9.2(@types/node@20.14.15)(typescript@5.5.4) typechain: specifier: ^8.2.1 - version: 8.3.2(typescript@5.4.5) + version: 8.3.2(typescript@5.5.4) typescript: - specifier: ^5.4.5 - version: 5.4.5 + specifier: ^5.5.4 + version: 5.5.4 packages: @@ -160,6 +169,12 @@ packages: resolution: {integrity: sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==} engines: {node: '>=0.10.0'} + '@arbitrum/nitro-contracts@1.1.1': + resolution: {integrity: sha512-4Tyk3XVHz+bm8UujUC78LYSw3xAxyYvBCxfEX4z3qE4/ww7Qck/rmce5gbHMzQjArEAzAP2YSfYIFuIFuRXtfg==} + + '@arbitrum/token-bridge-contracts@1.1.2': + resolution: {integrity: sha512-k7AZXiB2HFecJ1KfaDBqgOKe3Loo1ttGLC7hUOVB+0YrihIR6cYpJRuqKSKK4YCy+FF21AUDtaG3x57OFM667Q==} + '@babel/code-frame@7.18.6': resolution: {integrity: sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q==} engines: {node: '>=6.9.0'} @@ -178,14 +193,13 @@ packages: '@chainlink/solhint-plugin-chainlink-solidity@https://codeload.github.com/smartcontractkit/chainlink-solhint-rules/tar.gz/1b4c0c2663fcd983589d4f33a2e73908624ed43c': resolution: {tarball: https://codeload.github.com/smartcontractkit/chainlink-solhint-rules/tar.gz/1b4c0c2663fcd983589d4f33a2e73908624ed43c} - name: '@chainlink/solhint-plugin-chainlink-solidity' version: 1.2.0 - '@changesets/apply-release-plan@7.0.1': - resolution: {integrity: sha512-aPdSq/R++HOyfEeBGjEe6LNG8gs0KMSyRETD/J2092OkNq8mOioAxyKjMbvVUdzgr/HTawzMOz7lfw339KnsCA==} + '@changesets/apply-release-plan@7.0.4': + resolution: {integrity: sha512-HLFwhKWayKinWAul0Vj+76jVx1Pc2v55MGPVjZ924Y/ROeSsBMFutv9heHmCUj48lJyRfOTJG5+ar+29FUky/A==} - '@changesets/assemble-release-plan@6.0.0': - resolution: {integrity: sha512-4QG7NuisAjisbW4hkLCmGW2lRYdPrKzro+fCtZaILX+3zdUELSvYjpL4GTv0E4aM9Mef3PuIQp89VmHJ4y2bfw==} + '@changesets/assemble-release-plan@6.0.3': + resolution: {integrity: sha512-bLNh9/Lgl1VwkjWZTq8JmRqH+hj7/Yzfz0jsQ/zJJ+FTmVqmqPj3szeKOri8O/hEM8JmHW019vh2gTO9iq5Cuw==} '@changesets/changelog-git@0.2.0': resolution: {integrity: sha512-bHOx97iFI4OClIT35Lok3sJAwM31VbUM++gnMBV16fdbtBhgYu4dxsphBF/0AZZsyAHMrnM0yFcj5gZM1py6uQ==} @@ -193,24 +207,24 @@ packages: '@changesets/changelog-github@0.5.0': resolution: {integrity: sha512-zoeq2LJJVcPJcIotHRJEEA2qCqX0AQIeFE+L21L8sRLPVqDhSXY8ZWAt2sohtBpFZkBwu+LUwMSKRr2lMy3LJA==} - '@changesets/cli@2.27.3': - resolution: {integrity: sha512-ve/VpWApILlSs8cr0okNx5C2LKRawI9XZgvfmf58S8sar2nhx5DPJREFXYZBahs0FeTfvH0rdVl+nGe8QF45Ig==} + '@changesets/cli@2.27.7': + resolution: {integrity: sha512-6lr8JltiiXPIjDeYg4iM2MeePP6VN/JkmqBsVA5XRiy01hGS3y629LtSDvKcycj/w/5Eur1rEwby/MjcYS+e2A==} hasBin: true - '@changesets/config@3.0.0': - resolution: {integrity: sha512-o/rwLNnAo/+j9Yvw9mkBQOZySDYyOr/q+wptRLcAVGlU6djOeP9v1nlalbL9MFsobuBVQbZCTp+dIzdq+CLQUA==} + '@changesets/config@3.0.2': + resolution: {integrity: sha512-cdEhS4t8woKCX2M8AotcV2BOWnBp09sqICxKapgLHf9m5KdENpWjyrFNMjkLqGJtUys9U+w93OxWT0czorVDfw==} '@changesets/errors@0.2.0': resolution: {integrity: sha512-6BLOQUscTpZeGljvyQXlWOItQyU71kCdGz7Pi8H8zdw6BI0g3m43iL4xKUVPWtG+qrrL9DTjpdn8eYuCQSRpow==} - '@changesets/get-dependents-graph@2.0.0': - resolution: {integrity: sha512-cafUXponivK4vBgZ3yLu944mTvam06XEn2IZGjjKc0antpenkYANXiiE6GExV/yKdsCnE8dXVZ25yGqLYZmScA==} + '@changesets/get-dependents-graph@2.1.1': + resolution: {integrity: sha512-LRFjjvigBSzfnPU2n/AhFsuWR5DK++1x47aq6qZ8dzYsPtS/I5mNhIGAS68IAxh1xjO9BTtz55FwefhANZ+FCA==} '@changesets/get-github-info@0.6.0': resolution: {integrity: sha512-v/TSnFVXI8vzX9/w3DU2Ol+UlTZcu3m0kXTjTT4KlAdwSvwutcByYwyYn9hwerPWfPkT2JfpoX0KgvCEi8Q/SA==} - '@changesets/get-release-plan@4.0.0': - resolution: {integrity: sha512-9L9xCUeD/Tb6L/oKmpm8nyzsOzhdNBBbt/ZNcjynbHC07WW4E1eX8NMGC5g5SbM5z/V+MOrYsJ4lRW41GCbg3w==} + '@changesets/get-release-plan@4.0.3': + resolution: {integrity: sha512-6PLgvOIwTSdJPTtpdcr3sLtGatT+Jr22+cQwEBJBy6wP0rjB4yJ9lv583J9fVpn1bfQlBkDa8JxbS2g/n9lIyA==} '@changesets/get-version-range-type@0.4.0': resolution: {integrity: sha512-hwawtob9DryoGTpixy1D3ZXbGgJu1Rhr+ySH2PvTLHvkZuQ7sRT4oQwMh0hbqZH1weAooedEjRsbrWcGLCeyVQ==} @@ -230,6 +244,9 @@ packages: '@changesets/read@0.6.0': resolution: {integrity: sha512-ZypqX8+/im1Fm98K4YcZtmLKgjs1kDQ5zHpc2U1qdtNBmZZfo/IBiG162RoP0CUF05tvp2y4IspH11PLnPxuuw==} + '@changesets/should-skip-package@0.1.0': + resolution: {integrity: sha512-FxG6Mhjw7yFStlSM7Z0Gmg3RiyQ98d/9VpQAZ3Fzr59dCOM9G6ZdYbjiSAt0XtFr9JR5U2tBaJWPjrkGGc618g==} + '@changesets/types@4.1.0': resolution: {integrity: sha512-LDQvVDv5Kb50ny2s25Fhm3d9QSZimsoUGBsUioj6MC3qbMUCuC8GPIvk/M6IvXx3lYhAs0lwWUQLb+VIEUCECw==} @@ -492,15 +509,15 @@ packages: ethers: ^6.1.0 hardhat: ^2.0.0 - '@nomicfoundation/hardhat-network-helpers@1.0.10': - resolution: {integrity: sha512-R35/BMBlx7tWN5V6d/8/19QCwEmIdbnA4ZrsuXgvs8i2qFx5i7h6mH5pBS4Pwi4WigLH+upl6faYusrNPuzMrQ==} + '@nomicfoundation/hardhat-network-helpers@1.0.11': + resolution: {integrity: sha512-uGPL7QSKvxrHRU69dx8jzoBvuztlLCtyFsbgfXIwIjnO3dqZRz2GNMHJoO3C3dIiUNM6jdNF4AUnoQKDscdYrA==} peerDependencies: hardhat: ^2.9.5 - '@nomicfoundation/hardhat-verify@2.0.7': - resolution: {integrity: sha512-jiYHBX+K6bBN0YhwFHQ5SWWc3dQZliM3pdgpH33C7tnsVACsX1ubZn6gZ9hfwlzG0tyjFM72XQhpaXQ56cE6Ew==} + '@nomicfoundation/hardhat-verify@2.0.9': + resolution: {integrity: sha512-7kD8hu1+zlnX87gC+UN4S0HTKBnIsDfXZ/pproq1gYsK94hgCk+exvzXbwR0X2giiY/RZPkqY9oKRi0Uev91hQ==} peerDependencies: - hardhat: ^2.0.4 + hardhat: ^2.22.72.0.4 '@nomicfoundation/solidity-analyzer-darwin-arm64@0.1.0': resolution: {integrity: sha512-vEF3yKuuzfMHsZecHQcnkUrqm8mnTWfJeEVFHpg+cO+le96xQA4lAJYdUan8pXZohQxv1fSReQsn4QGNuBNuCw==} @@ -572,12 +589,37 @@ packages: ethers: ^5.0.0 hardhat: ^2.0.0 + '@offchainlabs/upgrade-executor@1.1.0-beta.0': + resolution: {integrity: sha512-mpn6PHjH/KDDjNX0pXHEKdyv8m6DVGQiI2nGzQn0JbM1nOSHJpWx6fvfjtH7YxHJ6zBZTcsKkqGkFKDtCfoSLw==} + + '@openzeppelin/contracts-upgradeable@4.5.2': + resolution: {integrity: sha512-xgWZYaPlrEOQo3cBj97Ufiuv79SPd8Brh4GcFYhPgb6WvAq4ppz8dWKL6h+jLAK01rUqMRp/TS9AdXgAeNvCLA==} + + '@openzeppelin/contracts-upgradeable@4.7.3': + resolution: {integrity: sha512-+wuegAMaLcZnLCJIvrVUDzA9z/Wp93f0Dla/4jJvIhijRrPabjQbZe6fWiECLaJyfn5ci9fqf9vTw3xpQOad2A==} + + '@openzeppelin/contracts-upgradeable@4.8.3': + resolution: {integrity: sha512-SXDRl7HKpl2WDoJpn7CK/M9U4Z8gNXDHHChAKh0Iz+Wew3wu6CmFYBeie3je8V0GSXZAIYYwUktSrnW/kwVPtg==} + '@openzeppelin/contracts-upgradeable@4.9.3': resolution: {integrity: sha512-jjaHAVRMrE4UuZNfDwjlLGDxTHWIOwTJS2ldnc278a0gevfXfPr8hxKEVBGFBE96kl2G3VHDZhUimw/+G3TG2A==} + '@openzeppelin/contracts@4.5.0': + resolution: {integrity: sha512-fdkzKPYMjrRiPK6K4y64e6GzULR7R7RwxSigHS8DDp7aWDeoReqsQI+cxHV1UuhAqX69L1lAaWDxenfP+xiqzA==} + + '@openzeppelin/contracts@4.7.3': + resolution: {integrity: sha512-dGRS0agJzu8ybo44pCIf3xBaPQN/65AIXNgK8+4gzKd5kbvlqyxryUYVLJv7fK98Seyd2hDZzVEHSWAh0Bt1Yw==} + + '@openzeppelin/contracts@4.8.3': + resolution: {integrity: sha512-bQHV8R9Me8IaJoJ2vPG4rXcL7seB7YVuskr4f+f5RyOStSZetwzkWtoqDMl5erkBJy0lDRUnIR2WIkPiC0GJlg==} + '@openzeppelin/contracts@4.9.3': resolution: {integrity: sha512-He3LieZ1pP2TNt5JbkPA4PNT9WC3gOTOlDcFGJW4Le4QKqwmiNJCRt44APfxMxvq7OugU/cqYuPcSBzOw38DAg==} + '@openzeppelin/upgrades-core@1.34.4': + resolution: {integrity: sha512-iGN3StqYHYVqqSKs8hWY+Gz6VkiEqOkQccBhHl7lHLGBJF91QUZ8wNMZ59SA5Usg1Fstu/HurvZTCEshPJAZ8w==} + hasBin: true + '@pkgr/core@0.1.1': resolution: {integrity: sha512-cq8o4cWH0ibXh9VGi5P20Tu9XF/0fFXl9EUinr9QfTM7a7p0oTA4iJRCQWppXR1Pg8dSM0UCItCkPwsk9qWWYA==} engines: {node: ^12.20.0 || ^14.18.0 || >=16.0.0} @@ -706,8 +748,8 @@ packages: '@types/chai-as-promised@7.1.8': resolution: {integrity: sha512-ThlRVIJhr69FLlh6IctTXFkmhtP3NpMZ2QGq69StYLyKZFp/HOp1VdKZj7RvfNWYYcJ1xlbLGLLWj1UvP5u/Gw==} - '@types/chai@4.3.16': - resolution: {integrity: sha512-PatH4iOdyh3MyWtmHVFXLWCCIhUbopaltqddG9BzB+gMIzee2MJrvd+jouii9Z3wzQJruGWAm7WOMjgfG8hQlQ==} + '@types/chai@4.3.17': + resolution: {integrity: sha512-zmZ21EWzR71B4Sscphjief5djsLre50M6lI622OSySTmn9DB3j+C3kWroHfBQWXbOBwbgg/M8CG/hUxDLIloow==} '@types/debug@4.1.12': resolution: {integrity: sha512-vIChWdVG3LG1SMxEvI/AK+FWJthlrqlTu7fbrlywTkkaONwk/UAGaULXRlf8vkzFBLVm0zkMdCquhL5aOjhXPQ==} @@ -724,11 +766,8 @@ packages: '@types/lru-cache@5.1.1': resolution: {integrity: sha512-ssE3Vlrys7sdIzs5LOxCzTVMsU7i9oa/IaW92wF32JFb3CVczqOkru2xspuKczHEbG3nvmPY7IFqVmGGHdNbYw==} - '@types/minimist@1.2.5': - resolution: {integrity: sha512-hov8bUuiLiyFPGyFPE1lwWhmzYbirOXQNNo40+y3zow8aFVTeyn3VWL0VFFfdNddA8S4Vf0Tc062rzyNr7Paag==} - - '@types/mocha@10.0.6': - resolution: {integrity: sha512-dJvrYWxP/UcXm36Qn36fxhUKu8A/xMRXVT2cliFF1Z7UA9liG5Psj3ezNSZw+5puH2czDXRLcXQxf8JbJt0ejg==} + '@types/mocha@10.0.7': + resolution: {integrity: sha512-GN8yJ1mNTcFcah/wKEFIJckJx9iJLoMSzWcfRRuxz/Jk+U6KQNnml+etbtxFK8lPjzOw3zp4Ha/kjSst9fsHYw==} '@types/ms@0.7.31': resolution: {integrity: sha512-iiUgKzV9AuaEkZqkOLDIvlQiL6ltuZd9tGcW3gwpnX8JbuiuhFlEGmmFXEXkN50Cvq7Os88IY2v0dkDqXYWVgA==} @@ -736,11 +775,8 @@ packages: '@types/node@12.19.16': resolution: {integrity: sha512-7xHmXm/QJ7cbK2laF+YYD7gb5MggHIIQwqyjin3bpEGiSuvScMQ5JZZXPvRipi1MwckTQbJZROMns/JxdnIL1Q==} - '@types/node@20.12.12': - resolution: {integrity: sha512-eWLDGF/FOSPtAvEqeRAQ4C8LSA7M1I7i0ky1I8U7kD1J5ITyW3AsRhQrKVoWf5pFKZ2kILsEGJhsI9r93PYnOw==} - - '@types/normalize-package-data@2.4.4': - resolution: {integrity: sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA==} + '@types/node@20.14.15': + resolution: {integrity: sha512-Fz1xDMCF/B00/tYSVMlmK7hVeLh7jE5f3B7X1/hmV0MJBwE27KlS7EvD/Yp+z1lm8mVhwV5w+n8jOZG8AfTlKw==} '@types/pbkdf2@3.1.0': resolution: {integrity: sha512-Cf63Rv7jCQ0LaL8tNXmEyqTHuIJxRdlS5vMh1mj5voN4+QFhVZnlZruezqpWYDiJ8UTzhP0VmeLXCmBk66YrMQ==} @@ -760,8 +796,8 @@ packages: '@types/semver@7.5.0': resolution: {integrity: sha512-G8hZ6XJiHnuhQKR7ZmysCeJWE08o8T0AXtk5darsCaTVsYZhhgUrq53jizaR2FvsoeCwJhlmwTjkXBY5Pn/ZHw==} - '@typescript-eslint/eslint-plugin@7.10.0': - resolution: {integrity: sha512-PzCr+a/KAef5ZawX7nbyNwBDtM1HdLIT53aSA2DDlxmxMngZ43O8SIePOeX8H5S+FHXeI6t97mTt/dDdzY4Fyw==} + '@typescript-eslint/eslint-plugin@7.18.0': + resolution: {integrity: sha512-94EQTWZ40mzBc42ATNIBimBEDltSJ9RQHCC8vc/PDbxi4k8dVwUAv4o98dk50M1zB+JGFxp43FP7f8+FP8R6Sw==} engines: {node: ^18.18.0 || >=20.0.0} peerDependencies: '@typescript-eslint/parser': ^7.0.0 @@ -771,8 +807,8 @@ packages: typescript: optional: true - '@typescript-eslint/parser@7.10.0': - resolution: {integrity: sha512-2EjZMA0LUW5V5tGQiaa2Gys+nKdfrn2xiTIBLR4fxmPmVSvgPcKNW+AE/ln9k0A4zDUti0J/GZXMDupQoI+e1w==} + '@typescript-eslint/parser@7.18.0': + resolution: {integrity: sha512-4Z+L8I2OqhZV8qA132M4wNL30ypZGYOQVBfMgxDH/K5UX0PNqTu1c6za9ST5r9+tavvHiTWmBnKzpCJ/GlVFtg==} engines: {node: ^18.18.0 || >=20.0.0} peerDependencies: eslint: ^8.56.0 @@ -781,12 +817,12 @@ packages: typescript: optional: true - '@typescript-eslint/scope-manager@7.10.0': - resolution: {integrity: sha512-7L01/K8W/VGl7noe2mgH0K7BE29Sq6KAbVmxurj8GGaPDZXPr8EEQ2seOeAS+mEV9DnzxBQB6ax6qQQ5C6P4xg==} + '@typescript-eslint/scope-manager@7.18.0': + resolution: {integrity: sha512-jjhdIE/FPF2B7Z1uzc6i3oWKbGcHb87Qw7AWj6jmEqNOfDFbJWtjt/XfwCpvNkpGWlcJaog5vTR+VV8+w9JflA==} engines: {node: ^18.18.0 || >=20.0.0} - '@typescript-eslint/type-utils@7.10.0': - resolution: {integrity: sha512-D7tS4WDkJWrVkuzgm90qYw9RdgBcrWmbbRkrLA4d7Pg3w0ttVGDsvYGV19SH8gPR5L7OtcN5J1hTtyenO9xE9g==} + '@typescript-eslint/type-utils@7.18.0': + resolution: {integrity: sha512-XL0FJXuCLaDuX2sYqZUUSOJ2sG5/i1AAze+axqmLnSkNEVMVYLF+cbwlB2w8D1tinFuSikHmFta+P+HOofrLeA==} engines: {node: ^18.18.0 || >=20.0.0} peerDependencies: eslint: ^8.56.0 @@ -795,12 +831,12 @@ packages: typescript: optional: true - '@typescript-eslint/types@7.10.0': - resolution: {integrity: sha512-7fNj+Ya35aNyhuqrA1E/VayQX9Elwr8NKZ4WueClR3KwJ7Xx9jcCdOrLW04h51de/+gNbyFMs+IDxh5xIwfbNg==} + '@typescript-eslint/types@7.18.0': + resolution: {integrity: sha512-iZqi+Ds1y4EDYUtlOOC+aUmxnE9xS/yCigkjA7XpTKV6nCBd3Hp/PRGGmdwnfkV2ThMyYldP1wRpm/id99spTQ==} engines: {node: ^18.18.0 || >=20.0.0} - '@typescript-eslint/typescript-estree@7.10.0': - resolution: {integrity: sha512-LXFnQJjL9XIcxeVfqmNj60YhatpRLt6UhdlFwAkjNc6jSUlK8zQOl1oktAP8PlWFzPQC1jny/8Bai3/HPuvN5g==} + '@typescript-eslint/typescript-estree@7.18.0': + resolution: {integrity: sha512-aP1v/BSPnnyhMHts8cf1qQ6Q1IFwwRvAQGRvBFkWlo3/lH29OXA3Pts+c10nxRxIBrDnoMqzhgdwVe5f2D6OzA==} engines: {node: ^18.18.0 || >=20.0.0} peerDependencies: typescript: '*' @@ -808,19 +844,22 @@ packages: typescript: optional: true - '@typescript-eslint/utils@7.10.0': - resolution: {integrity: sha512-olzif1Fuo8R8m/qKkzJqT7qwy16CzPRWBvERS0uvyc+DHd8AKbO4Jb7kpAvVzMmZm8TrHnI7hvjN4I05zow+tg==} + '@typescript-eslint/utils@7.18.0': + resolution: {integrity: sha512-kK0/rNa2j74XuHVcoCZxdFBMF+aq/vH83CXAOHieC+2Gis4mF8jJXT5eAfyD3K0sAxtPuwxaIOIOvhwzVDt/kw==} engines: {node: ^18.18.0 || >=20.0.0} peerDependencies: eslint: ^8.56.0 - '@typescript-eslint/visitor-keys@7.10.0': - resolution: {integrity: sha512-9ntIVgsi6gg6FIq9xjEO4VQJvwOqA3jaBFQJ/6TK5AvEup2+cECI6Fh7QiBxmfMHXU0V0J4RyPeOU1VDNzl9cg==} + '@typescript-eslint/visitor-keys@7.18.0': + resolution: {integrity: sha512-cDF0/Gf81QpY3xYyJKDV14Zwdmid5+uuENhjH2EqFaF0ni+yAyq/LzMaIJdhNJXZI7uLzwIlA+V7oWoyn6Curg==} engines: {node: ^18.18.0 || >=20.0.0} '@ungap/structured-clone@1.2.0': resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==} + '@yarnpkg/lockfile@1.1.0': + resolution: {integrity: sha512-GpSwvyXOcOOlV70vbnzjj4fW5xW/FdUF6nQEt1ENy7m4ZCczi1+/buVUPAqmGfqznsORNFzUMjctTIp8a9tuCQ==} + abi-to-sol@0.6.6: resolution: {integrity: sha512-PRn81rSpv6NXFPYQSw7ujruqIP6UkwZ/XoFldtiqCX8+2kHVc73xVaUVvdbro06vvBVZiwnxhEIGdI4BRMwGHw==} hasBin: true @@ -924,21 +963,25 @@ packages: array-buffer-byte-length@1.0.0: resolution: {integrity: sha512-LPuwb2P+NrQw3XhxGc36+XSvuBPopovXYTR9Ew++Du9Yb/bx5AzBfrIsBoj0EZUifjQU+sHL21sseZ3jerWO/A==} + array-buffer-byte-length@1.0.1: + resolution: {integrity: sha512-ahC5W1xgou+KTXix4sAO8Ki12Q+jf4i0+tmk3sC+zgcynshkHxzpXdImBehiUYKKKDwvfFiJl1tZt6ewscS1Mg==} + engines: {node: '>= 0.4'} + array-union@2.1.0: resolution: {integrity: sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==} engines: {node: '>=8'} - array.prototype.flat@1.3.2: - resolution: {integrity: sha512-djYB+Zx2vLewY8RWlNCUdHjDXs2XOgm602S9E7P/UpHgfeHL00cRiIF+IN/G/aUJ7kGPb6yO/ErDI5V2s8iycA==} + array.prototype.findlast@1.2.5: + resolution: {integrity: sha512-CVvd6FHg1Z3POpBLxO6E6zr+rSKEQ9L6rZHAaY7lLfhKsWYUBBOuMs0e9o24oopj6H+geRCX0YJ+TJLBK2eHyQ==} engines: {node: '>= 0.4'} arraybuffer.prototype.slice@1.0.2: resolution: {integrity: sha512-yMBKppFur/fbHu9/6USUe03bZ4knMYiwFBcyiaXB8Go0qNehwX6inYPzK9U0NeQvGxKthcmHcaR8P5MStSRBAw==} engines: {node: '>= 0.4'} - arrify@1.0.1: - resolution: {integrity: sha512-3CYzex9M9FGQjCGMGyi6/31c8GJbgb0qGyrx5HWxPd0aCwh4cB2YjMb2Xf9UuoogrMrlO9cTqnB5rI5GHZTcUA==} - engines: {node: '>=0.10.0'} + arraybuffer.prototype.slice@1.0.3: + resolution: {integrity: sha512-bMxMKAjg13EBSVscxTaYA4mRc5t1UAXa2kXiGTNfZ079HIWXEkKmkgFrh/nJqamaLSrXO5H4WFFkPEaLJWbs3A==} + engines: {node: '>= 0.4'} assertion-error@1.1.0: resolution: {integrity: sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==} @@ -958,6 +1001,10 @@ packages: resolution: {integrity: sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==} engines: {node: '>= 0.4'} + available-typed-arrays@1.0.7: + resolution: {integrity: sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==} + engines: {node: '>= 0.4'} + balanced-match@1.0.0: resolution: {integrity: sha512-9Y0g0Q8rmSt+H33DfKv7FOc3v+iRI+o1lbzt8jGcIosYW37IIW/2XVYq5NPdmaD5NQ59Nk26Kl/vZbwW9Fr8vg==} @@ -1013,9 +1060,6 @@ packages: resolution: {integrity: sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==} engines: {node: '>=8'} - breakword@1.0.6: - resolution: {integrity: sha512-yjxDAYyK/pBvws9H4xKYpLDpYKEH6CzrBPAuXq3x18I+c/2MkVtT3qAr7Oloi6Dss9qNhPVueAAVU1CSeNDIXw==} - brorand@1.1.0: resolution: {integrity: sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w==} @@ -1056,6 +1100,10 @@ packages: call-bind@1.0.5: resolution: {integrity: sha512-C3nQxfFZxFRVoJoGKKI8y3MOEo129NQ+FgQ08iye+Mk4zNZZGdjfs06bVTr+DBSlA66Q2VEcMki/cUCP4SercQ==} + call-bind@1.0.7: + resolution: {integrity: sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==} + engines: {node: '>= 0.4'} + callsites@3.1.0: resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} engines: {node: '>=6'} @@ -1063,14 +1111,6 @@ packages: camel-case@3.0.0: resolution: {integrity: sha512-+MbKztAYHXPr1jNTSKQF52VpcFjwY5RkR7fxksV8Doo4KAYc5Fl4UJRgthBbTmEx8C54DqahhbLJkDwjI3PI/w==} - camelcase-keys@6.2.2: - resolution: {integrity: sha512-YrwaA0vEKazPBkn0ipTiMpSajYDSe+KjQfrjhcBMxJt/znbvlHd8Pw/Vamaz5EB4Wfhs3SUR3Z9mwRu/P3s3Yg==} - engines: {node: '>=8'} - - camelcase@5.3.1: - resolution: {integrity: sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==} - engines: {node: '>=6'} - camelcase@6.3.0: resolution: {integrity: sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==} engines: {node: '>=10'} @@ -1083,13 +1123,17 @@ packages: resolution: {integrity: sha512-DwGjNW9omn6EwP70aXsn7FQJx5kO12tX0bZkaTjzdVFM6/7nhA4t0EENocKGx6D2Bch9PE2KzCUf5SceBdeijg==} engines: {node: '>=12.19'} + cbor@9.0.2: + resolution: {integrity: sha512-JPypkxsB10s9QOWwa6zwPzqE1Md3vqpPc+cai4sAecuCsRyAtAl/pMyhPlMbT/xtPnm2dznJZYRLui57qiRhaQ==} + engines: {node: '>=16'} + chai-as-promised@7.1.1: resolution: {integrity: sha512-azL6xMoi+uxu6z4rhWQ1jbdUhOMhis2PvscD/xjLqNMkv3BPPp2JyyuTHOrf9BOosGpNQ11v6BKv/g57RXbiaA==} peerDependencies: chai: '>= 2.1.2 < 5' - chai@4.4.1: - resolution: {integrity: sha512-13sOfMv2+DWduEU+/xbun3LScLoqN17nBeTLUsmDfKdoiC1fr0n9PU4guu4AhRcOVFk/sW8LyZWHuhWtQZiF+g==} + chai@4.5.0: + resolution: {integrity: sha512-RITGBfijLkBddZvnn8jdqoTypxvqbOLYQkGGxXzeFjVHvudaPw0HNFD9x928/eUwYWd2dPCugVqspGALTZZQKw==} engines: {node: '>=4'} chalk@2.4.2: @@ -1131,23 +1175,12 @@ packages: resolution: {integrity: sha512-y4coMcylgSCdVinjiDBuR8PCC2bLjyGTwEmPb9NHR/QaNU6EUOXcTY/s6VjGMD6ENSEaeQYHCY0GNGS5jfMwPw==} engines: {node: '>=6'} - cliui@6.0.0: - resolution: {integrity: sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==} - cliui@7.0.4: resolution: {integrity: sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==} - cliui@8.0.1: - resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} - engines: {node: '>=12'} - clone-response@1.0.2: resolution: {integrity: sha512-yjLXh88P599UOyPTFX0POsd7WxnbsVsGohcwzHOLspIhhpalPw1BcqED8NblyZLKcGrL8dTgMlcaZxV2jAD41Q==} - clone@1.0.4: - resolution: {integrity: sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==} - engines: {node: '>=0.8'} - code-error-fragment@0.0.230: resolution: {integrity: sha512-cadkfKp6932H8UkhzE/gcUqhRMNf8jHzkAN7+5Myabswaghu4xABTgPHDCjW+dBAJxj/SpkTYokpzDqY4pCzQw==} engines: {node: '>= 4'} @@ -1183,6 +1216,9 @@ packages: commander@3.0.2: resolution: {integrity: sha512-Gar0ASD4BDyKC4hl4DwHqDrmvjoxWKZigVnAbn5H1owvm4CxCPdb0HQDehwNYMJpla5+M2tPmPARzhtYuwpHow==} + compare-versions@6.1.1: + resolution: {integrity: sha512-4hm4VPpIecmlg59CHXnRDnqGplJFrbLG4aFEl5vl6cK1u76ws3LLvX7ikFnTDl5vo39sjWD6AaDPYodJp/NNHg==} + concat-map@0.0.1: resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} @@ -1215,22 +1251,25 @@ packages: cross-spawn@5.1.0: resolution: {integrity: sha512-pTgQJ5KC0d2hcY8eyL1IzlBPYjTkyH72XRZPnLyKus2mBfNjQs3klqbJU2VILqZryAZUt9JOb3h/mWMy23/f5A==} + cross-spawn@6.0.5: + resolution: {integrity: sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==} + engines: {node: '>=4.8'} + cross-spawn@7.0.3: resolution: {integrity: sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==} engines: {node: '>= 8'} - csv-generate@3.4.3: - resolution: {integrity: sha512-w/T+rqR0vwvHqWs/1ZyMDWtHHSJaN06klRqJXBEpDJaM/+dZkso0OKh1VcuuYvK3XM53KysVNq8Ko/epCK8wOw==} - - csv-parse@4.16.3: - resolution: {integrity: sha512-cO1I/zmz4w2dcKHVvpCr7JVRu8/FymG5OEpmvsZYlccYolPBLoVGKUHgNoc4ZGkFeFlWGEDmMyBM+TTqRdW/wg==} + data-view-buffer@1.0.1: + resolution: {integrity: sha512-0lht7OugA5x3iJLOWFhWK/5ehONdprk0ISXqVFn/NFrDu+cuc8iADFrGQz5BnRK7LLU3JmkbXSxaqX+/mXYtUA==} + engines: {node: '>= 0.4'} - csv-stringify@5.6.5: - resolution: {integrity: sha512-PjiQ659aQ+fUTQqSrd1XEDnOr52jh30RBurfzkscaE2tPaFsDH5wOAHJiw8XAHphRknCwMUE9KRayc4K/NbO8A==} + data-view-byte-length@1.0.1: + resolution: {integrity: sha512-4J7wRJD3ABAzr8wP+OcIcqq2dlUKp4DVflx++hs5h5ZKydWMI6/D/fAot+yh6g2tHh8fLFTvNOaVN357NvSrOQ==} + engines: {node: '>= 0.4'} - csv@5.5.3: - resolution: {integrity: sha512-QTaY0XjjhTQOdguARF0lGKm5/mEq9PD9/VhZZegHDIBq2tQwgNpHc3dneD4mGo2iJs+fTKv5Bp0fZ+BRuY3Z0g==} - engines: {node: '>= 0.1.90'} + data-view-byte-offset@1.0.0: + resolution: {integrity: sha512-t/Ygsytq+R995EJ5PZlD4Cu56sWa8InXySaViRzw9apusqsOO2bQP+SbYzAhR0pFKoB+43lYy8rWban9JSuXnA==} + engines: {node: '>= 0.4'} dataloader@1.4.0: resolution: {integrity: sha512-68s5jYdlvasItOJnCuI2Q9s4q98g0pCyL3HrcKJu8KNugUl8ahgmZYg38ysLTgQjjXX3H8CJLkAvWrclWfcalw==} @@ -1244,13 +1283,14 @@ packages: supports-color: optional: true - decamelize-keys@1.1.1: - resolution: {integrity: sha512-WiPxgEirIV0/eIOMcnFBA3/IJZAZqKnwAwWyvvdi4lsr1WCN22nhdf/3db3DoZcUjTV2SqfzIwNyp6y2xs3nmg==} - engines: {node: '>=0.10.0'} - - decamelize@1.2.0: - resolution: {integrity: sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==} - engines: {node: '>=0.10.0'} + debug@4.3.6: + resolution: {integrity: sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==} + engines: {node: '>=6.0'} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true decamelize@4.0.0: resolution: {integrity: sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==} @@ -1274,9 +1314,6 @@ packages: deep-is@0.1.4: resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==} - defaults@1.0.4: - resolution: {integrity: sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==} - defer-to-connect@2.0.1: resolution: {integrity: sha512-4tvttepXG1VaYGrRibk5EwJd1t4udunSOVMdLSAL6mId1ix438oPwPZMALY41FCijukO1L0twNcGsdzS7dHgDg==} engines: {node: '>=10'} @@ -1285,6 +1322,10 @@ packages: resolution: {integrity: sha512-E7uGkTzkk1d0ByLeSc6ZsFS79Axg+m1P/VsgYsxHgiuc3tFSj+MjMIwe90FC4lOAZzNBdY7kkO2P2wKdsQ1vgQ==} engines: {node: '>= 0.4'} + define-data-property@1.1.4: + resolution: {integrity: sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==} + engines: {node: '>= 0.4'} + define-properties@1.2.1: resolution: {integrity: sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==} engines: {node: '>= 0.4'} @@ -1342,6 +1383,10 @@ packages: resolution: {integrity: sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==} engines: {node: '>=6'} + era-contracts@https://codeload.github.com/matter-labs/era-contracts/tar.gz/446d391d34bdb48255d5f8fef8a8248925fc98b9: + resolution: {tarball: https://codeload.github.com/matter-labs/era-contracts/tar.gz/446d391d34bdb48255d5f8fef8a8248925fc98b9} + version: 0.1.0 + error-ex@1.3.2: resolution: {integrity: sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==} @@ -1349,10 +1394,30 @@ packages: resolution: {integrity: sha512-eiiY8HQeYfYH2Con2berK+To6GrK2RxbPawDkGq4UiCQQfZHb6wX9qQqkbpPqaxQFcl8d9QzZqo0tGE0VcrdwA==} engines: {node: '>= 0.4'} + es-abstract@1.23.3: + resolution: {integrity: sha512-e+HfNH61Bj1X9/jLc5v1owaLYuHdeHHSQlkhCBiTK8rBvKaULl/beGMxwrMXjpYrv4pz22BlY570vVePA2ho4A==} + engines: {node: '>= 0.4'} + + es-define-property@1.0.0: + resolution: {integrity: sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==} + engines: {node: '>= 0.4'} + + es-errors@1.3.0: + resolution: {integrity: sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==} + engines: {node: '>= 0.4'} + + es-object-atoms@1.0.0: + resolution: {integrity: sha512-MZ4iQ6JwHOBQjahnjwaC1ZtIBH+2ohjamzAO3oaHcXYup7qxjF2fixyH+Q71voWHeOkI2q/TnJao/KfXYIZWbw==} + engines: {node: '>= 0.4'} + es-set-tostringtag@2.0.2: resolution: {integrity: sha512-BuDyupZt65P9D2D2vA/zqcI3G5xRsklm5N3xCwuiy+/vKy8i0ifdsQP1sLgO4tZDSCaQUSnmC48khknGMV3D2Q==} engines: {node: '>= 0.4'} + es-set-tostringtag@2.0.3: + resolution: {integrity: sha512-3T8uNMC3OQTHkFUsFq8r/BwAXLHvU/9O9mE0fBc/MY5iq/8H7ncvO947LmYA6ldWw9Uh8Yhf25zu6n7nML5QWQ==} + engines: {node: '>= 0.4'} + es-shim-unscopables@1.0.2: resolution: {integrity: sha512-J3yBRXCzDu4ULnQwxyToo/OjdMx6akgVC7K6few0a7F/0wLtmKKN7I73AH5T2836UuXRqN7Qg+IIUw/+YJksRw==} @@ -1378,8 +1443,8 @@ packages: peerDependencies: eslint: '>=7.0.0' - eslint-plugin-prettier@5.1.3: - resolution: {integrity: sha512-C9GCVAs4Eq7ZC/XFQHITLiHJxQngdtraXaM+LoUFoFp/lHNl2Zn8f3WQbe9HvTBBQ9YnKFB0/2Ajdqwo5D1EAw==} + eslint-plugin-prettier@5.2.1: + resolution: {integrity: sha512-gH3iR3g4JfF+yYPaJYkN7jEl9QbweL/YfkoRlNnuIEHEz1vHVlCmWOS+eGGiRuzHQXdJFCOTxRgvju9b8VUmrw==} engines: {node: ^14.18.0 || >=16.0.0} peerDependencies: '@types/eslint': '>=8.0.0' @@ -1520,6 +1585,9 @@ packages: find-yarn-workspace-root2@1.2.16: resolution: {integrity: sha512-hr6hb1w8ePMpPVUK39S4RlwJzi+xPLuVuG8XlwXU3KD5Yn3qgBWVfy3AzNlDhWvE1EORCE65/Qm26rFQt3VLVA==} + find-yarn-workspace-root@2.0.0: + resolution: {integrity: sha512-1IMnbjt4KzsQfnhnzNd8wUEgXZ44IzZaZmnLYx7D5FZlaHt2gW20Cri8Q+E/t5tIj4+epTBub+2Zxu/vNILzqQ==} + flat-cache@3.2.0: resolution: {integrity: sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==} engines: {node: ^10.12.0 || >=12.0.0} @@ -1592,6 +1660,10 @@ packages: get-intrinsic@1.2.2: resolution: {integrity: sha512-0gSo4ml/0j98Y3lngkFEot/zhiCeWsbYIlZ+uZOVgzLyLaUw7wxUL+nCTP0XJvJg1AXulJRI3UJi8GsbDuxdGA==} + get-intrinsic@1.2.4: + resolution: {integrity: sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==} + engines: {node: '>= 0.4'} + get-stream@5.1.0: resolution: {integrity: sha512-EXr1FOzrzTfGeL0gQdeFEvOMm2mzMOglyiOXSTpPC+iAjAKftbr3jpCMWynogwYnM+eSj9sHGc6wjIcDvYiygw==} engines: {node: '>=8'} @@ -1604,6 +1676,10 @@ packages: resolution: {integrity: sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw==} engines: {node: '>= 0.4'} + get-symbol-description@1.0.2: + resolution: {integrity: sha512-g0QYk1dZBxGwk+Ngc+ltRH2IBp2f7zBkBMBJZCDerh6EhlhSR6+9irMCuT/09zD6qkarHUSn529sK/yL4S27mg==} + engines: {node: '>= 0.4'} + glob-parent@5.1.2: resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} engines: {node: '>= 6'} @@ -1653,10 +1729,6 @@ packages: graphemer@1.4.0: resolution: {integrity: sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==} - hard-rejection@2.1.0: - resolution: {integrity: sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA==} - engines: {node: '>=6'} - hardhat-abi-exporter@2.10.1: resolution: {integrity: sha512-X8GRxUTtebMAd2k4fcPyVnCdPa6dYK4lBsrwzKP5yiSq4i+WadWPIumaLfce53TUf/o2TnLpLOduyO1ylE2NHQ==} engines: {node: '>=14.14.0'} @@ -1692,10 +1764,17 @@ packages: has-property-descriptors@1.0.0: resolution: {integrity: sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==} + has-property-descriptors@1.0.2: + resolution: {integrity: sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==} + has-proto@1.0.1: resolution: {integrity: sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==} engines: {node: '>= 0.4'} + has-proto@1.0.3: + resolution: {integrity: sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==} + engines: {node: '>= 0.4'} + has-symbols@1.0.3: resolution: {integrity: sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==} engines: {node: '>= 0.4'} @@ -1704,9 +1783,9 @@ packages: resolution: {integrity: sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==} engines: {node: '>= 0.4'} - has@1.0.3: - resolution: {integrity: sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==} - engines: {node: '>= 0.4.0'} + has-tostringtag@1.0.2: + resolution: {integrity: sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==} + engines: {node: '>= 0.4'} hash-base@3.1.0: resolution: {integrity: sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==} @@ -1719,6 +1798,10 @@ packages: resolution: {integrity: sha512-vUptKVTpIJhcczKBbgnS+RtcuYMB8+oNzPK2/Hp3hanz8JmpATdmmgLgSaadVREkDm+e2giHwY3ZRkyjSIDDFA==} engines: {node: '>= 0.4'} + hasown@2.0.2: + resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==} + engines: {node: '>= 0.4'} + he@1.2.0: resolution: {integrity: sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==} hasBin: true @@ -1729,9 +1812,6 @@ packages: hmac-drbg@1.0.1: resolution: {integrity: sha512-Tti3gMqLdZfhOQY1Mzf/AanLiqh1WTiJgEj26ZuYQ9fbkLomzGchCws4FyrSd4VkpBfiNhaE1On+lOz894jvXg==} - hosted-git-info@2.8.9: - resolution: {integrity: sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==} - http-cache-semantics@4.0.3: resolution: {integrity: sha512-TcIMG3qeVLgDr1TEd2XvHaTnMPwYQUQMIBLy+5pLSDKYFc7UIqj39w8EGzZkaxoLv/l2K8HaI0t5AVA+YYgUew==} @@ -1790,12 +1870,20 @@ packages: resolution: {integrity: sha512-Xj6dv+PsbtwyPpEflsejS+oIZxmMlV44zAhG479uYu89MsjcYOhCFnNyKrkJrihbsiasQyY0afoCl/9BLR65bg==} engines: {node: '>= 0.4'} + internal-slot@1.0.7: + resolution: {integrity: sha512-NGnrKwXzSms2qUUih/ILZ5JBqNTSa1+ZmP6flaIp6KmSElgE9qdndzS3cqjrDovwFdmwsGsLdeFgB6suw+1e9g==} + engines: {node: '>= 0.4'} + io-ts@1.10.4: resolution: {integrity: sha512-b23PteSnYXSONJ6JQXRAlvJhuw8KOtkqa87W4wDtvMrud/DTJd5X+NpOOI+O/zZwVq6v0VLAaJ+1EDViKEuN9g==} is-array-buffer@3.0.2: resolution: {integrity: sha512-y+FyyR/w8vfIRq4eQcM1EYgSTnmHXPqaF+IgzgraytCFq5Xh8lllDVmAZolPJiZttZLeFSINPYMaEJ7/vWUa1w==} + is-array-buffer@3.0.4: + resolution: {integrity: sha512-wcjaerHw0ydZwfhiKbXJWLDY8A7yV7KhjQOpb83hGgGfId/aQa4TOvwyzn2PuswW2gPCYEL/nEAiSVpdOj1lXw==} + engines: {node: '>= 0.4'} + is-arrayish@0.2.1: resolution: {integrity: sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==} @@ -1814,13 +1902,23 @@ packages: resolution: {integrity: sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==} engines: {node: '>= 0.4'} - is-core-module@2.10.0: - resolution: {integrity: sha512-Erxj2n/LDAZ7H8WNJXd9tw38GYM3dv8rk8Zcs+jJuxYTW7sozH+SS8NtrSjVL1/vpLvWi1hxy96IzjJ3EHTJJg==} + is-ci@2.0.0: + resolution: {integrity: sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w==} + hasBin: true + + is-data-view@1.0.1: + resolution: {integrity: sha512-AHkaJrsUVW6wq6JS8y3JnM/GJF/9cf+k20+iDzlSaJrinEo5+7vRiteOSwBhHRiAyQATN1AmY4hwzxJKPmYf+w==} + engines: {node: '>= 0.4'} is-date-object@1.0.2: resolution: {integrity: sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g==} engines: {node: '>= 0.4'} + is-docker@2.2.1: + resolution: {integrity: sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==} + engines: {node: '>=8'} + hasBin: true + is-extglob@2.1.1: resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} engines: {node: '>=0.10.0'} @@ -1844,6 +1942,10 @@ packages: resolution: {integrity: sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA==} engines: {node: '>= 0.4'} + is-negative-zero@2.0.3: + resolution: {integrity: sha512-5KoIu2Ngpyek75jXodFvnafB6DJgr3u8uuK0LEZJjrU19DrMD3EVERaR8sjz8CCGgpZvxPl9SuE1GMVPFHx1mw==} + engines: {node: '>= 0.4'} + is-number-object@1.0.7: resolution: {integrity: sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==} engines: {node: '>= 0.4'} @@ -1856,10 +1958,6 @@ packages: resolution: {integrity: sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==} engines: {node: '>=8'} - is-plain-obj@1.1.0: - resolution: {integrity: sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg==} - engines: {node: '>=0.10.0'} - is-plain-obj@2.1.0: resolution: {integrity: sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==} engines: {node: '>=8'} @@ -1871,6 +1969,10 @@ packages: is-shared-array-buffer@1.0.2: resolution: {integrity: sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA==} + is-shared-array-buffer@1.0.3: + resolution: {integrity: sha512-nA2hv5XIhLR3uVzDDfCIknerhx8XUKnstuOERPNNIinXG7v9u+ohXF67vxm4TPTEPU6lm61ZkwP3c9PCB97rhg==} + engines: {node: '>= 0.4'} + is-string@1.0.7: resolution: {integrity: sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==} engines: {node: '>= 0.4'} @@ -1887,6 +1989,10 @@ packages: resolution: {integrity: sha512-Z14TF2JNG8Lss5/HMqt0//T9JeHXttXy5pH/DBU4vi98ozO2btxzq9MwYDZYnKwU8nRsz/+GVFVRDq3DkVuSPg==} engines: {node: '>= 0.4'} + is-typed-array@1.1.13: + resolution: {integrity: sha512-uZ25/bUAlUY5fR4OKT4rZQEBrzQWYV9ZJYGGsUmEJ6thodVJ1HX64ePQ6Z0qPWP+m+Uq6e9UugrE38jeYsDSMw==} + engines: {node: '>= 0.4'} + is-unicode-supported@0.1.0: resolution: {integrity: sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==} engines: {node: '>=10'} @@ -1901,6 +2007,10 @@ packages: resolution: {integrity: sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==} engines: {node: '>=0.10.0'} + is-wsl@2.2.0: + resolution: {integrity: sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==} + engines: {node: '>=8'} + isarray@2.0.5: resolution: {integrity: sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==} @@ -1966,17 +2076,12 @@ packages: keyv@4.5.4: resolution: {integrity: sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==} - kind-of@6.0.3: - resolution: {integrity: sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==} - engines: {node: '>=0.10.0'} + klaw-sync@6.0.0: + resolution: {integrity: sha512-nIeuVSzdCCs6TDPTqI8w1Yre34sSq7AkZ4B3sfOBbI2CgVSB4Du4aLQijFU2+lhAFCwt9+42Hel6lQNIv6AntQ==} klaw@1.3.1: resolution: {integrity: sha512-TED5xi9gGQjGpNnvRWknrwAB1eL5GciPfVFOt3Vk1OJCVDQbzuSfrF3hkUQKlsgKrG1F+0t5W0m+Fje1jIt8rw==} - kleur@4.1.5: - resolution: {integrity: sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ==} - engines: {node: '>=6'} - latest-version@7.0.0: resolution: {integrity: sha512-KvNT4XqAMzdcL6ka6Tl3i2lYeFDgXNCuIX+xNx6ZMVR1dFq+idXd9FLKNMOIx0t9mJ9/HudyX4oZWXZQ0UJHeg==} engines: {node: '>=14.16'} @@ -2066,14 +2171,6 @@ packages: make-error@1.3.6: resolution: {integrity: sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==} - map-obj@1.0.1: - resolution: {integrity: sha512-7N/q3lyZ+LVCp7PzuxrJr4KMbBE2hW7BT7YNia330OFxIf4d3r5zVpicP2650l7CPN6RM9zOJRl3NGpqSiw3Eg==} - engines: {node: '>=0.10.0'} - - map-obj@4.3.0: - resolution: {integrity: sha512-hdN1wVrZbb29eBGiGjJbeP8JbKjq1urkHJ/LIP/NY48MZ1QVXUsQBV1G1zvYFHn1XE06cwjBsOI2K3Ulnj1YXQ==} - engines: {node: '>=8'} - md5.js@1.3.5: resolution: {integrity: sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==} @@ -2081,10 +2178,6 @@ packages: resolution: {integrity: sha512-S3UwM3yj5mtUSEfP41UZmt/0SCoVYUcU1rkXv+BQ5Ig8ndL4sPoJNBUJERafdPb5jjHJGuMgytgKvKIf58XNBw==} engines: {node: '>= 0.10.0'} - meow@6.1.1: - resolution: {integrity: sha512-3YffViIt2QWgTy6Pale5QpopX/IvU3LPL03jOTqp6pGj3VjesdO/U8CuHMKpnQr4shCNCM5fd5XFFvIIl6JBHg==} - engines: {node: '>=8'} - merge2@1.4.1: resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} engines: {node: '>= 8'} @@ -2101,10 +2194,6 @@ packages: resolution: {integrity: sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==} engines: {node: '>=10'} - min-indent@1.0.1: - resolution: {integrity: sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==} - engines: {node: '>=4'} - minimalistic-assert@1.0.1: resolution: {integrity: sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==} @@ -2126,17 +2215,9 @@ packages: resolution: {integrity: sha512-KqWh+VchfxcMNRAJjj2tnsSJdNbHsVgnkBhTNrW7AjVo6OvLtxw8zfT9oLw1JSohlFzJ8jCoTgaoXvJ+kHt6fw==} engines: {node: '>=16 || 14 >=14.17'} - minimist-options@4.1.0: - resolution: {integrity: sha512-Q4r8ghd80yhO/0j1O3B2BjweX3fiHg9cdOwjJd2J76Q135c+NDxGCqdYKQ1SKBuFfgWbAUzBfvYjPUEeNgqN1A==} - engines: {node: '>= 6'} - minimist@1.2.8: resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==} - mixme@0.5.10: - resolution: {integrity: sha512-5H76ANWinB1H3twpJ6JY8uvAtpmFvHNArpilJAjXRKXSDDLPIMoZArw5SH0q9z+lLs8IrMw7Q2VWpWimFKFT1Q==} - engines: {node: '>= 8.0.0'} - mkdirp@1.0.4: resolution: {integrity: sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==} engines: {node: '>=10'} @@ -2153,6 +2234,10 @@ packages: moment@2.30.1: resolution: {integrity: sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how==} + mri@1.2.0: + resolution: {integrity: sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==} + engines: {node: '>=4'} + ms@2.1.2: resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} @@ -2170,6 +2255,9 @@ packages: neodoc@2.0.2: resolution: {integrity: sha512-NAppJ0YecKWdhSXFYCHbo6RutiX8vOt/Jo3l46mUg6pQlpJNaqc5cGxdrW2jITQm5JIYySbFVPDl3RrREXNyPw==} + nice-try@1.0.5: + resolution: {integrity: sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==} + no-case@2.3.2: resolution: {integrity: sha512-rmTZ9kz+f3rCvK2TD1Ue/oZlns7OGoIWP4fc3llxxRXlOkHKoWPPWJOfFYpITabSow43QJbRIoHQXtt10VldyQ==} @@ -2201,9 +2289,6 @@ packages: resolution: {integrity: sha512-l2NNj07e9afPnhAhvgVrCD/oy2Ai1yfLpuo3EpiO1jFTsB4sFz6oIfAfSZyQzVpkZQ9xS8ZS5g1jCBgq4Hwo0g==} engines: {node: '>=12.19'} - normalize-package-data@2.5.0: - resolution: {integrity: sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==} - normalize-path@3.0.0: resolution: {integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==} engines: {node: '>=0.10.0'} @@ -2227,12 +2312,20 @@ packages: resolution: {integrity: sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ==} engines: {node: '>= 0.4'} + object.assign@4.1.5: + resolution: {integrity: sha512-byy+U7gp+FVwmyzKPYhW2h5l3crpmGsxl7X2s8y43IgxvG4g3QZ6CffDtsNQy1WsmZpQbO+ybo0AlW7TY6DcBQ==} + engines: {node: '>= 0.4'} + obliterator@2.0.4: resolution: {integrity: sha512-lgHwxlxV1qIg1Eap7LgIeoBWIMFibOjbrYPIPJZcI1mmGAI2m3lNYpK12Y+GBdPQ0U1hRwSord7GIaawz962qQ==} once@1.4.0: resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} + open@7.4.2: + resolution: {integrity: sha512-MVHddDVweXZF3awtlAS+6pgKLlm/JgxZ90+/NBurBoQctVOOB/zDdVjcyPzQ+0laDGbsWgrRkflI65sQeOgT9Q==} + engines: {node: '>=8'} + optionator@0.9.3: resolution: {integrity: sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==} engines: {node: '>= 0.8.0'} @@ -2313,6 +2406,11 @@ packages: pascal-case@2.0.1: resolution: {integrity: sha512-qjS4s8rBOJa2Xm0jmxXiyh1+OFf6ekCWOvUaRgAQSktzlTbMotS0nmG9gyYAybCWBcuP4fsBeRCKNwGBnMe2OQ==} + patch-package@6.5.1: + resolution: {integrity: sha512-I/4Zsalfhc6bphmJTlrLoOcAF87jcxko4q0qsv4bGcurbr8IskEOtdnt9iCmsQVGL1B+iUhSQqweyTLJfCF9rA==} + engines: {node: '>=10', npm: '>5'} + hasBin: true + path-case@2.1.1: resolution: {integrity: sha512-Ou0N05MioItesaLr9q8TtHVWmJ6fxWdqKB2RohFmNWVyJ+2zeKIeDNWAN6B/Pe7wpzWChhZX6nONYmOnMeJQ/Q==} @@ -2328,6 +2426,10 @@ packages: resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} engines: {node: '>=0.10.0'} + path-key@2.0.1: + resolution: {integrity: sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw==} + engines: {node: '>=4'} + path-key@3.1.1: resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} engines: {node: '>=8'} @@ -2366,6 +2468,10 @@ packages: resolution: {integrity: sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==} engines: {node: '>=4'} + possible-typed-array-names@1.0.0: + resolution: {integrity: sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q==} + engines: {node: '>= 0.4'} + preferred-pm@3.1.3: resolution: {integrity: sha512-MkXsENfftWSRpzCzImcp4FRsCc3y1opwB73CfCNWyzMqArju2CrlMHlqB7VexKiPEOjGMbttv1r9fSCn5S610w==} engines: {node: '>=10'} @@ -2389,11 +2495,14 @@ packages: engines: {node: '>=10.13.0'} hasBin: true - prettier@3.2.5: - resolution: {integrity: sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==} + prettier@3.3.3: + resolution: {integrity: sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==} engines: {node: '>=14'} hasBin: true + proper-lockfile@4.1.2: + resolution: {integrity: sha512-TjNPblN4BwAWMXU8s9AEz4JmQxnD1NNL7bNOY/AKUzyamc379FWASUhc/K1pL2noVb+XmZKLL68cjzLsiOAMaA==} + proto-list@1.2.4: resolution: {integrity: sha512-vtK/94akxsTMhe0/cbfpR+syPuszcuwhqVjJq26CuNDgFGj682oRBXOP5MJpv2r7JtE8MsiepGIqvvOTBwn2vA==} @@ -2410,10 +2519,6 @@ packages: pure-rand@5.0.3: resolution: {integrity: sha512-9N8x1h8dptBQpHyC7aZMS+iNOAm97WMGY0AFrguU1cpfW3I5jINkWe5BIY5md0ofy+1TCIELsVcm/GJXZSaPbw==} - quick-lru@4.0.1: - resolution: {integrity: sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g==} - engines: {node: '>=8'} - quick-lru@5.1.1: resolution: {integrity: sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA==} engines: {node: '>=10'} @@ -2429,14 +2534,6 @@ packages: resolution: {integrity: sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==} hasBin: true - read-pkg-up@7.0.1: - resolution: {integrity: sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==} - engines: {node: '>=8'} - - read-pkg@5.2.0: - resolution: {integrity: sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==} - engines: {node: '>=8'} - read-yaml-file@1.1.0: resolution: {integrity: sha512-VIMnQi/Z4HT2Fxuwg5KrY174U1VdUIASQVWXXyqtNRtxSr9IYkn1rsI6Tb6HsrHCmB7gVpNwX6JxPTHcH6IoTA==} engines: {node: '>=6'} @@ -2449,10 +2546,6 @@ packages: resolution: {integrity: sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==} engines: {node: '>=8.10.0'} - redent@3.0.0: - resolution: {integrity: sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==} - engines: {node: '>=8'} - reduce-flatten@2.0.0: resolution: {integrity: sha512-EJ4UNY/U1t2P/2k6oqotuX2Cc3T6nxJwsM0N0asT7dhrtH1ltUxDn4NalSYmPE2rCkVpcf/X6R0wDwcFpzhd4w==} engines: {node: '>=6'} @@ -2464,6 +2557,10 @@ packages: resolution: {integrity: sha512-sy6TXMN+hnP/wMy+ISxg3krXx7BAtWVO4UouuCN/ziM9UEne0euamVNafDfvC83bRNr95y0V5iijeDQFUNpvrg==} engines: {node: '>= 0.4'} + regexp.prototype.flags@1.5.2: + resolution: {integrity: sha512-NcDiDkTLuPR+++OCKB0nWafEmhg/Da8aUPLPMQbK+bxKKCm1/S5he+AqYa4PlMCVBalb4/yxIRub6qkEx5yJbw==} + engines: {node: '>= 0.4'} + registry-auth-token@5.0.2: resolution: {integrity: sha512-o/3ikDxtXaA59BmZuZrJZDJv8NMDGSj+6j6XaeBmHw8eY1i1qd9+6H+LjVvQXx3HN6aRCGa1cUdJ9RaJZUugnQ==} engines: {node: '>=14'} @@ -2480,9 +2577,6 @@ packages: resolution: {integrity: sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==} engines: {node: '>=0.10.0'} - require-main-filename@2.0.0: - resolution: {integrity: sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==} - resolve-alpn@1.2.1: resolution: {integrity: sha512-0a1F4l73/ZFZOakJnQ3FvkJ2+gSTQWz/r2KE5OdDY0TxPm5h4GkqkWWfM47T7HsbnOtcJVEF4epCVy6u7Q3K+g==} @@ -2497,13 +2591,13 @@ packages: resolve@1.17.0: resolution: {integrity: sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==} - resolve@1.22.1: - resolution: {integrity: sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==} - hasBin: true - responselike@2.0.1: resolution: {integrity: sha512-4gl03wn3hj1HP3yzgdI7d3lCkF95F21Pz4BPGvKHinyQzALR5CapwC8yIi0Rh58DEMQ/SguC03wFj2k0M/mHhw==} + retry@0.12.0: + resolution: {integrity: sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow==} + engines: {node: '>= 4'} + reusify@1.0.4: resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} engines: {iojs: '>=1.0.0', node: '>=0.10.0'} @@ -2536,6 +2630,10 @@ packages: resolution: {integrity: sha512-6XbUAseYE2KtOuGueyeobCySj9L4+66Tn6KQMOPQJrAJEowYKW/YR/MGJZl7FdydUdaFu4LYyDZjxf4/Nmo23Q==} engines: {node: '>=0.4'} + safe-array-concat@1.1.2: + resolution: {integrity: sha512-vj6RsCsWBCf19jIeHEfkRMw8DPiBb+DMXklQ/1SGDHOMlHdPUkZXFQ2YdplS23zESTijAcurb1aSgJA3AgMu1Q==} + engines: {node: '>=0.4'} + safe-buffer@5.1.2: resolution: {integrity: sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==} @@ -2545,6 +2643,10 @@ packages: safe-regex-test@1.0.0: resolution: {integrity: sha512-JBUUzyOgEwXQY1NuPtvcj/qcBDbDmEvWufhlnXZIm75DEHp+afM1r1ujJpJsV/gSM4t59tpDyPi1sd6ZaPFfsA==} + safe-regex-test@1.0.3: + resolution: {integrity: sha512-CdASjNJPvRa7roO6Ra/gLYBTzYzzPyyBXxIMdGW3USQLyjWEls2RgW5UBTXaQVp+OrpeCK3bLem8smtmheoRuw==} + engines: {node: '>= 0.4'} + safer-buffer@2.1.2: resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} @@ -2563,8 +2665,8 @@ packages: resolution: {integrity: sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==} hasBin: true - semver@7.6.2: - resolution: {integrity: sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==} + semver@7.6.3: + resolution: {integrity: sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==} engines: {node: '>=10'} hasBin: true @@ -2574,13 +2676,14 @@ packages: serialize-javascript@6.0.0: resolution: {integrity: sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==} - set-blocking@2.0.0: - resolution: {integrity: sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==} - set-function-length@1.1.1: resolution: {integrity: sha512-VoaqjbBJKiWtg4yRcKBQ7g7wnGnLV3M8oLvVWwOk2PdYY6PEFegR1vezXR0tw6fZGF9csVakIRjrJiy2veSBFQ==} engines: {node: '>= 0.4'} + set-function-length@1.2.2: + resolution: {integrity: sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==} + engines: {node: '>= 0.4'} + set-function-name@2.0.1: resolution: {integrity: sha512-tMNCiqYVkXIZgc2Hnoy2IvC/f8ezc5koaRFkCjrpWzGpCd3qbZXPzVy9MAZzK1ch/X0jvSkojys3oqJN0qCmdA==} engines: {node: '>= 0.4'} @@ -2620,6 +2723,10 @@ packages: signal-exit@3.0.7: resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} + slash@2.0.0: + resolution: {integrity: sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==} + engines: {node: '>=6'} + slash@3.0.0: resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==} engines: {node: '>=8'} @@ -2628,11 +2735,6 @@ packages: resolution: {integrity: sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==} engines: {node: '>=10'} - smartwrap@2.0.2: - resolution: {integrity: sha512-vCsKNQxb7PnCNd2wY1WClWifAc2lwqsG8OaswpJkVJsvMGcnEntdTCDajZCkk93Ay1U3t/9puJmb525Rg5MZBA==} - engines: {node: '>=6'} - hasBin: true - snake-case@2.1.0: resolution: {integrity: sha512-FMR5YoPFwOLuh4rRz92dywJjyKYZNLpMn1R5ujVpIYkbA9p01fq8RMg0FkO4M+Yobt4MjHeLTJVm5xFFBHSV2Q==} @@ -2651,6 +2753,9 @@ packages: resolution: {integrity: sha512-QeQLS9HGCnIiibt+xiOa/+MuP7BWz9N7C5+Mj9pLHshdkNhuo3AzCpWmjfWVZBUuwIUO3YyCRVIcYLR3YOKGfg==} hasBin: true + solidity-ast@0.4.56: + resolution: {integrity: sha512-HgmsA/Gfklm/M8GFbCX/J1qkVH0spXHgALCNZ8fA8x5X+MFdn/8CP2gr5OVyXjXw6RZTPC/Sxl2RUDQOXyNMeA==} + solidity-comments-darwin-arm64@0.0.2: resolution: {integrity: sha512-HidWkVLSh7v+Vu0CA7oI21GWP/ZY7ro8g8OmIxE8oTqyMwgMbE8F1yc58Sj682Hj199HCZsjmtn1BE4PCbLiGA==} engines: {node: '>= 10'} @@ -2731,18 +2836,6 @@ packages: spawndamnit@2.0.0: resolution: {integrity: sha512-j4JKEcncSjFlqIwU5L/rp2N5SIPsdxaRsIv678+TZxZ0SRDJTm8JrxJMjE/XuiEZNEir3S8l0Fa3Ke339WI4qA==} - spdx-correct@3.1.1: - resolution: {integrity: sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==} - - spdx-exceptions@2.3.0: - resolution: {integrity: sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==} - - spdx-expression-parse@3.0.1: - resolution: {integrity: sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==} - - spdx-license-ids@3.0.12: - resolution: {integrity: sha512-rr+VVSXtRhO4OHbXUiAF7xW3Bo9DuuF6C5jH+q/x15j2jniycgKbxU09Hr0WqlSLUs4i4ltHGXqTe7VHclYWyA==} - sprintf-js@1.0.3: resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} @@ -2754,9 +2847,6 @@ packages: resolution: {integrity: sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==} engines: {node: '>= 0.8'} - stream-transform@2.1.3: - resolution: {integrity: sha512-9GHUiM5hMiCi6Y03jD2ARC1ettBXkQBoQAe7nJsPknnI0ow10aXjTnew8QtYQmLjzn974BnmWEAJgCY6ZP1DeQ==} - string-format@2.0.0: resolution: {integrity: sha512-bbEs3scLeYNXLecRRuk6uJxdXUSj6le/8rNPHChIJTn2V79aXVTR1EH2OH5zLKKoz0V02fOUKZZcw01pLUShZA==} @@ -2768,12 +2858,23 @@ packages: resolution: {integrity: sha512-lfjY4HcixfQXOfaqCvcBuOIapyaroTXhbkfJN3gcB1OtyupngWK4sEET9Knd0cXd28kTUqu/kHoV4HKSJdnjiQ==} engines: {node: '>= 0.4'} + string.prototype.trim@1.2.9: + resolution: {integrity: sha512-klHuCNxiMZ8MlsOihJhJEBJAiMVqU3Z2nEXWfWnIqjN0gEFS9J9+IxKozWWtQGcgoa1WUZzLjKPTr4ZHNFTFxw==} + engines: {node: '>= 0.4'} + string.prototype.trimend@1.0.7: resolution: {integrity: sha512-Ni79DqeB72ZFq1uH/L6zJ+DKZTkOtPIHovb3YZHQViE+HDouuU4mBrLOLDn5Dde3RF8qw5qVETEjhu9locMLvA==} + string.prototype.trimend@1.0.8: + resolution: {integrity: sha512-p73uL5VCHCO2BZZ6krwwQE3kCzM7NKmis8S//xEC6fQonchbum4eP6kR4DLEjQFO3Wnj3Fuo8NM0kOSjVdHjZQ==} + string.prototype.trimstart@1.0.7: resolution: {integrity: sha512-NGhtDFu3jCEm7B4Fy0DpLewdJQOZcQ0rGbwQ/+stjnrp2i+rlKeCvos9hOIeCmqwratM47OBxY7uFZzjxHXmrg==} + string.prototype.trimstart@1.0.8: + resolution: {integrity: sha512-UXSH262CSZY1tfu3G3Secr6uGLCFVPMhIqHjlgCUtCCcgihYc/xKs9djMTMUOb2j1mVSeU8EU6NWc/iQKU6Gfg==} + engines: {node: '>= 0.4'} + string_decoder@1.3.0: resolution: {integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==} @@ -2789,10 +2890,6 @@ packages: resolution: {integrity: sha1-DF8VX+8RUTczd96du1iNoFUA428=} engines: {node: '>=6.5.0', npm: '>=3'} - strip-indent@3.0.0: - resolution: {integrity: sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==} - engines: {node: '>=8'} - strip-json-comments@2.0.1: resolution: {integrity: sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==} engines: {node: '>=0.10.0'} @@ -2813,15 +2910,11 @@ packages: resolution: {integrity: sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==} engines: {node: '>=10'} - supports-preserve-symlinks-flag@1.0.0: - resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} - engines: {node: '>= 0.4'} - swap-case@1.1.2: resolution: {integrity: sha512-BAmWG6/bx8syfc6qXPprof3Mn5vQgf5dwdUNJhsNqU9WdPt5P+ES/wQ5bxfijy8zwZgZZHslC3iAsxsuQMCzJQ==} - synckit@0.8.8: - resolution: {integrity: sha512-HwOKAP7Wc5aRGYdKH+dw0PRRpbO841v2DENBtjnR5HFWoiNByAl7vrx3p0G/rCyYXQsrxqtX48TImFtPcIHSpQ==} + synckit@0.9.1: + resolution: {integrity: sha512-7gr8p9TQP6RAHusBOSLs46F4564ZrjV8xFmw5zCmgmhGUcw2hxsShhJ6CEiHQMgPDwAQ1fWHPM0ypc4RMAig4A==} engines: {node: ^14.18.0 || >=16.0.0} table-layout@1.0.2: @@ -2857,10 +2950,6 @@ packages: tr46@0.0.3: resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} - trim-newlines@3.0.1: - resolution: {integrity: sha512-c1PTsA3tYrIsLGkJkzHF+w9F2EyxfXGo4UyJc4pFL++FMjnq0HJS69T3M7d//gKrFKwy429bouPescbjecU+Zw==} - engines: {node: '>=8'} - ts-api-utils@1.3.0: resolution: {integrity: sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ==} engines: {node: '>=16'} @@ -2899,11 +2988,6 @@ packages: tsort@0.0.1: resolution: {integrity: sha512-Tyrf5mxF8Ofs1tNoxA13lFeZ2Zrbd6cKbuH3V+MQ5sb6DtBj5FjrXVsRWT8YvNAQTqNoz66dz1WsbigI22aEnw==} - tty-table@4.2.3: - resolution: {integrity: sha512-Fs15mu0vGzCrj8fmJNP7Ynxt5J7praPXqFN0leZeZBXJwkMxv9cb2D454k1ltrtUSJbZ4yH4e0CynsHLxmUfFA==} - engines: {node: '>=8.0.0'} - hasBin: true - tweetnacl-util@0.15.1: resolution: {integrity: sha512-RKJBIj8lySrShN4w6i/BonWp2Z/uxwC3h4y7xsRrpP59ZboCd0GpEVsOnMDYLMmKBpYhb5TgHzZXy7wTfYFBRw==} @@ -2918,9 +3002,9 @@ packages: resolution: {integrity: sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==} engines: {node: '>=4'} - type-fest@0.13.1: - resolution: {integrity: sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==} - engines: {node: '>=10'} + type-detect@4.1.0: + resolution: {integrity: sha512-Acylog8/luQ8L7il+geoSxhEkazvkslg7PSNKOX59mbB9cOveP5aq9h74Y7YU8yDpJwetzQQrfIwtf4Wp4LKcw==} + engines: {node: '>=4'} type-fest@0.20.2: resolution: {integrity: sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==} @@ -2930,18 +3014,10 @@ packages: resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==} engines: {node: '>=10'} - type-fest@0.6.0: - resolution: {integrity: sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==} - engines: {node: '>=8'} - type-fest@0.7.1: resolution: {integrity: sha512-Ne2YiiGN8bmrmJJEuTWTLJR32nh/JdL1+PSicowtNb0WFpn59GK8/lfD61bVtzguz7b3PBt74nxpv/Pw5po5Rg==} engines: {node: '>=8'} - type-fest@0.8.1: - resolution: {integrity: sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==} - engines: {node: '>=8'} - typechain@8.3.2: resolution: {integrity: sha512-x/sQYr5w9K7yv3es7jo4KTX05CLxOf7TRWwoHlrjRh8H82G64g+k7VuWPJlgMo6qrjfCulOdfBjiaDtmhFYD/Q==} hasBin: true @@ -2952,19 +3028,35 @@ packages: resolution: {integrity: sha512-Y8KTSIglk9OZEr8zywiIHG/kmQ7KWyjseXs1CbSo8vC42w7hg2HgYTxSWwP0+is7bWDc1H+Fo026CpHFwm8tkw==} engines: {node: '>= 0.4'} + typed-array-buffer@1.0.2: + resolution: {integrity: sha512-gEymJYKZtKXzzBzM4jqa9w6Q1Jjm7x2d+sh19AdsD4wqnMPDYyvwpsIc2Q/835kHuo3BEQ7CjelGhfTsoBb2MQ==} + engines: {node: '>= 0.4'} + typed-array-byte-length@1.0.0: resolution: {integrity: sha512-Or/+kvLxNpeQ9DtSydonMxCx+9ZXOswtwJn17SNLvhptaXYDJvkFFP5zbfU/uLmvnBJlI4yrnXRxpdWH/M5tNA==} engines: {node: '>= 0.4'} + typed-array-byte-length@1.0.1: + resolution: {integrity: sha512-3iMJ9q0ao7WE9tWcaYKIptkNBuOIcZCCT0d4MRvuuH88fEoEH62IuQe0OtraD3ebQEoTRk8XCBoknUNc1Y67pw==} + engines: {node: '>= 0.4'} + typed-array-byte-offset@1.0.0: resolution: {integrity: sha512-RD97prjEt9EL8YgAgpOkf3O4IF9lhJFr9g0htQkm0rchFp/Vx7LW5Q8fSXXub7BXAODyUQohRMyOc3faCPd0hg==} engines: {node: '>= 0.4'} + typed-array-byte-offset@1.0.2: + resolution: {integrity: sha512-Ous0vodHa56FviZucS2E63zkgtgrACj7omjwd/8lTEMEPFFyjfixMZ1ZXenpgCFBBt4EC1J2XsyVS2gkG0eTFA==} + engines: {node: '>= 0.4'} + typed-array-length@1.0.4: resolution: {integrity: sha512-KjZypGq+I/H7HI5HlOoGHkWUUGq+Q0TPhQurLbyrVrvnKTBgzLhIJ7j6J/XTQOi0d1RjyZ0wdas8bKs2p0x3Ng==} - typescript@5.4.5: - resolution: {integrity: sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==} + typed-array-length@1.0.6: + resolution: {integrity: sha512-/OxDN6OtAk5KBpGb28T+HZc2M+ADtvRxXrKKbUwtsLgdoxgX13hyy7ek6bFRl5+aBs2yZzB0c4CnQfAtVypW/g==} + engines: {node: '>= 0.4'} + + typescript@5.5.4: + resolution: {integrity: sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q==} engines: {node: '>=14.17'} hasBin: true @@ -3020,12 +3112,6 @@ packages: v8-compile-cache-lib@3.0.1: resolution: {integrity: sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==} - validate-npm-package-license@3.0.4: - resolution: {integrity: sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==} - - wcwidth@1.0.1: - resolution: {integrity: sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==} - web3-utils@1.7.4: resolution: {integrity: sha512-acBdm6Evd0TEZRnChM/MCvGsMwYKmSh7OaUfNf5OKG0CIeGWD/6gqLOWIwmwSnre/2WrA1nKGId5uW2e5EfluA==} engines: {node: '>=8.0.0'} @@ -3039,9 +3125,6 @@ packages: which-boxed-primitive@1.0.2: resolution: {integrity: sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==} - which-module@2.0.0: - resolution: {integrity: sha512-B+enWhmw6cjfVC7kS8Pj9pCrKSc5txArRyaYGe088shv/FGWH+0Rjx/xPgtsWfsUtS27FkP697E4DDhgrgoc0Q==} - which-pm@2.0.0: resolution: {integrity: sha512-Lhs9Pmyph0p5n5Z3mVnN0yWcbQYUAD7rbQUiMsQxOJ3T57k7RFe35SUwWMf7dsbDZks1uOmw4AecB/JMDj3v/w==} engines: {node: '>=8.15'} @@ -3050,6 +3133,10 @@ packages: resolution: {integrity: sha512-P5Nra0qjSncduVPEAr7xhoF5guty49ArDTwzJ/yNuPIbZppyRxFQsRCWrocxIY+CnMVG+qfbU2FmDKyvSGClow==} engines: {node: '>= 0.4'} + which-typed-array@1.1.15: + resolution: {integrity: sha512-oV0jmFtUky6CXfkqehVvBP/LSWJ2sy4vWMioiENyJLePrBO/yKyV9OyJySfAKosh+RYkIl5zJCNZ8/4JncrpdA==} + engines: {node: '>= 0.4'} + which@1.3.1: resolution: {integrity: sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==} hasBin: true @@ -3070,10 +3157,6 @@ packages: workerpool@6.2.1: resolution: {integrity: sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw==} - wrap-ansi@6.2.0: - resolution: {integrity: sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==} - engines: {node: '>=8'} - wrap-ansi@7.0.0: resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} engines: {node: '>=10'} @@ -3105,9 +3188,6 @@ packages: utf-8-validate: optional: true - y18n@4.0.3: - resolution: {integrity: sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==} - y18n@5.0.8: resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} engines: {node: '>=10'} @@ -3115,34 +3195,22 @@ packages: yallist@2.1.2: resolution: {integrity: sha512-ncTzHV7NvsQZkYe1DW7cbDLm0YpzHmZF5r/iyP3ZnQtMiJ+pjzisCiMNI+Sj+xQF5pXhSHxSB3uDbsBTzY/c2A==} - yargs-parser@18.1.3: - resolution: {integrity: sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==} - engines: {node: '>=6'} + yaml@1.10.2: + resolution: {integrity: sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==} + engines: {node: '>= 6'} yargs-parser@20.2.4: resolution: {integrity: sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==} engines: {node: '>=10'} - yargs-parser@21.1.1: - resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} - engines: {node: '>=12'} - yargs-unparser@2.0.0: resolution: {integrity: sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==} engines: {node: '>=10'} - yargs@15.4.1: - resolution: {integrity: sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==} - engines: {node: '>=8'} - yargs@16.2.0: resolution: {integrity: sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==} engines: {node: '>=10'} - yargs@17.7.2: - resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==} - engines: {node: '>=12'} - yn@3.1.1: resolution: {integrity: sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==} engines: {node: '>=6'} @@ -3155,6 +3223,24 @@ snapshots: '@aashutoshrathi/word-wrap@1.2.6': {} + '@arbitrum/nitro-contracts@1.1.1': + dependencies: + '@offchainlabs/upgrade-executor': 1.1.0-beta.0 + '@openzeppelin/contracts': 4.5.0 + '@openzeppelin/contracts-upgradeable': 4.5.2 + patch-package: 6.5.1 + + '@arbitrum/token-bridge-contracts@1.1.2': + dependencies: + '@arbitrum/nitro-contracts': 1.1.1 + '@offchainlabs/upgrade-executor': 1.1.0-beta.0 + '@openzeppelin/contracts': 4.8.3 + '@openzeppelin/contracts-upgradeable': 4.8.3 + optionalDependencies: + '@openzeppelin/upgrades-core': 1.34.4 + transitivePeerDependencies: + - supports-color + '@babel/code-frame@7.18.6': dependencies: '@babel/highlight': 7.18.6 @@ -3173,12 +3259,13 @@ snapshots: '@chainlink/solhint-plugin-chainlink-solidity@https://codeload.github.com/smartcontractkit/chainlink-solhint-rules/tar.gz/1b4c0c2663fcd983589d4f33a2e73908624ed43c': {} - '@changesets/apply-release-plan@7.0.1': + '@changesets/apply-release-plan@7.0.4': dependencies: '@babel/runtime': 7.24.0 - '@changesets/config': 3.0.0 + '@changesets/config': 3.0.2 '@changesets/get-version-range-type': 0.4.0 '@changesets/git': 3.0.0 + '@changesets/should-skip-package': 0.1.0 '@changesets/types': 6.0.0 '@manypkg/get-packages': 1.1.3 detect-indent: 6.1.0 @@ -3187,16 +3274,17 @@ snapshots: outdent: 0.5.0 prettier: 2.8.8 resolve-from: 5.0.0 - semver: 7.6.2 + semver: 7.6.3 - '@changesets/assemble-release-plan@6.0.0': + '@changesets/assemble-release-plan@6.0.3': dependencies: '@babel/runtime': 7.24.0 '@changesets/errors': 0.2.0 - '@changesets/get-dependents-graph': 2.0.0 + '@changesets/get-dependents-graph': 2.1.1 + '@changesets/should-skip-package': 0.1.0 '@changesets/types': 6.0.0 '@manypkg/get-packages': 1.1.3 - semver: 7.6.2 + semver: 7.6.3 '@changesets/changelog-git@0.2.0': dependencies: @@ -3210,20 +3298,21 @@ snapshots: transitivePeerDependencies: - encoding - '@changesets/cli@2.27.3': + '@changesets/cli@2.27.7': dependencies: '@babel/runtime': 7.24.0 - '@changesets/apply-release-plan': 7.0.1 - '@changesets/assemble-release-plan': 6.0.0 + '@changesets/apply-release-plan': 7.0.4 + '@changesets/assemble-release-plan': 6.0.3 '@changesets/changelog-git': 0.2.0 - '@changesets/config': 3.0.0 + '@changesets/config': 3.0.2 '@changesets/errors': 0.2.0 - '@changesets/get-dependents-graph': 2.0.0 - '@changesets/get-release-plan': 4.0.0 + '@changesets/get-dependents-graph': 2.1.1 + '@changesets/get-release-plan': 4.0.3 '@changesets/git': 3.0.0 '@changesets/logger': 0.1.0 '@changesets/pre': 2.0.0 '@changesets/read': 0.6.0 + '@changesets/should-skip-package': 0.1.0 '@changesets/types': 6.0.0 '@changesets/write': 0.3.1 '@manypkg/get-packages': 1.1.3 @@ -3235,20 +3324,19 @@ snapshots: external-editor: 3.1.0 fs-extra: 7.0.1 human-id: 1.0.2 - meow: 6.1.1 + mri: 1.2.0 outdent: 0.5.0 p-limit: 2.3.0 preferred-pm: 3.1.3 resolve-from: 5.0.0 - semver: 7.6.2 + semver: 7.6.3 spawndamnit: 2.0.0 term-size: 2.2.1 - tty-table: 4.2.3 - '@changesets/config@3.0.0': + '@changesets/config@3.0.2': dependencies: '@changesets/errors': 0.2.0 - '@changesets/get-dependents-graph': 2.0.0 + '@changesets/get-dependents-graph': 2.1.1 '@changesets/logger': 0.1.0 '@changesets/types': 6.0.0 '@manypkg/get-packages': 1.1.3 @@ -3259,13 +3347,13 @@ snapshots: dependencies: extendable-error: 0.1.7 - '@changesets/get-dependents-graph@2.0.0': + '@changesets/get-dependents-graph@2.1.1': dependencies: '@changesets/types': 6.0.0 '@manypkg/get-packages': 1.1.3 chalk: 2.4.2 fs-extra: 7.0.1 - semver: 7.6.2 + semver: 7.6.3 '@changesets/get-github-info@0.6.0': dependencies: @@ -3274,11 +3362,11 @@ snapshots: transitivePeerDependencies: - encoding - '@changesets/get-release-plan@4.0.0': + '@changesets/get-release-plan@4.0.3': dependencies: '@babel/runtime': 7.24.0 - '@changesets/assemble-release-plan': 6.0.0 - '@changesets/config': 3.0.0 + '@changesets/assemble-release-plan': 6.0.3 + '@changesets/config': 3.0.2 '@changesets/pre': 2.0.0 '@changesets/read': 0.6.0 '@changesets/types': 6.0.0 @@ -3324,6 +3412,12 @@ snapshots: fs-extra: 7.0.1 p-filter: 2.1.0 + '@changesets/should-skip-package@0.1.0': + dependencies: + '@babel/runtime': 7.24.0 + '@changesets/types': 6.0.0 + '@manypkg/get-packages': 1.1.3 + '@changesets/types@4.1.0': {} '@changesets/types@6.0.0': {} @@ -3350,7 +3444,7 @@ snapshots: '@eslint/eslintrc@2.1.4': dependencies: ajv: 6.12.6 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.6 espree: 9.6.1 globals: 13.24.0 ignore: 5.3.1 @@ -3390,7 +3484,7 @@ snapshots: '@ethersproject/transactions': 5.7.0 '@ethersproject/web': 5.7.1 bufio: 1.0.7 - chai: 4.4.1 + chai: 4.5.0 transitivePeerDependencies: - bufferutil - utf-8-validate @@ -3663,7 +3757,7 @@ snapshots: '@humanwhocodes/config-array@0.11.14': dependencies: '@humanwhocodes/object-schema': 2.0.3 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.6 minimatch: 3.1.2 transitivePeerDependencies: - supports-color @@ -3741,7 +3835,7 @@ snapshots: '@nomicfoundation/ethereumjs-trie': 6.0.4 '@nomicfoundation/ethereumjs-tx': 5.0.4 '@nomicfoundation/ethereumjs-util': 9.0.4 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.6 ethereum-cryptography: 0.1.3 lru-cache: 10.2.2 transitivePeerDependencies: @@ -3771,7 +3865,7 @@ snapshots: '@nomicfoundation/ethereumjs-tx': 5.0.4 '@nomicfoundation/ethereumjs-util': 9.0.4 '@types/debug': 4.1.12 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.6 ethereum-cryptography: 0.1.3 rustbn-wasm: 0.2.0 transitivePeerDependencies: @@ -3787,11 +3881,12 @@ snapshots: '@nomicfoundation/ethereumjs-rlp': 5.0.4 '@nomicfoundation/ethereumjs-trie': 6.0.4 '@nomicfoundation/ethereumjs-util': 9.0.4 - '@nomicfoundation/ethereumjs-verkle': 0.0.2 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.6 ethereum-cryptography: 0.1.3 js-sdsl: 4.4.2 lru-cache: 10.2.2 + optionalDependencies: + '@nomicfoundation/ethereumjs-verkle': 0.0.2 transitivePeerDependencies: - c-kzg - supports-color @@ -3839,47 +3934,47 @@ snapshots: '@nomicfoundation/ethereumjs-trie': 6.0.4 '@nomicfoundation/ethereumjs-tx': 5.0.4 '@nomicfoundation/ethereumjs-util': 9.0.4 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.6 ethereum-cryptography: 0.1.3 transitivePeerDependencies: - '@nomicfoundation/ethereumjs-verkle' - c-kzg - supports-color - '@nomicfoundation/hardhat-chai-matchers@1.0.6(@nomiclabs/hardhat-ethers@2.2.3)(chai@4.4.1)(ethers@5.7.2)(hardhat@2.20.1)': + '@nomicfoundation/hardhat-chai-matchers@1.0.6(@nomiclabs/hardhat-ethers@2.2.3(ethers@5.7.2)(hardhat@2.20.1(ts-node@10.9.2(@types/node@20.14.15)(typescript@5.5.4))(typescript@5.5.4)))(chai@4.5.0)(ethers@5.7.2)(hardhat@2.20.1(ts-node@10.9.2(@types/node@20.14.15)(typescript@5.5.4))(typescript@5.5.4))': dependencies: '@ethersproject/abi': 5.7.0 - '@nomiclabs/hardhat-ethers': 2.2.3(ethers@5.7.2)(hardhat@2.20.1) + '@nomiclabs/hardhat-ethers': 2.2.3(ethers@5.7.2)(hardhat@2.20.1(ts-node@10.9.2(@types/node@20.14.15)(typescript@5.5.4))(typescript@5.5.4)) '@types/chai-as-promised': 7.1.8 - chai: 4.4.1 - chai-as-promised: 7.1.1(chai@4.4.1) + chai: 4.5.0 + chai-as-promised: 7.1.1(chai@4.5.0) deep-eql: 4.1.3 ethers: 5.7.2 - hardhat: 2.20.1(ts-node@10.9.2)(typescript@5.4.5) + hardhat: 2.20.1(ts-node@10.9.2(@types/node@20.14.15)(typescript@5.5.4))(typescript@5.5.4) ordinal: 1.0.3 - '@nomicfoundation/hardhat-ethers@3.0.6(ethers@5.7.2)(hardhat@2.20.1)': + '@nomicfoundation/hardhat-ethers@3.0.6(ethers@5.7.2)(hardhat@2.20.1(ts-node@10.9.2(@types/node@20.14.15)(typescript@5.5.4))(typescript@5.5.4))': dependencies: - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.6 ethers: 5.7.2 - hardhat: 2.20.1(ts-node@10.9.2)(typescript@5.4.5) + hardhat: 2.20.1(ts-node@10.9.2(@types/node@20.14.15)(typescript@5.5.4))(typescript@5.5.4) lodash.isequal: 4.5.0 transitivePeerDependencies: - supports-color - '@nomicfoundation/hardhat-network-helpers@1.0.10(hardhat@2.20.1)': + '@nomicfoundation/hardhat-network-helpers@1.0.11(hardhat@2.20.1(ts-node@10.9.2(@types/node@20.14.15)(typescript@5.5.4))(typescript@5.5.4))': dependencies: ethereumjs-util: 7.1.5 - hardhat: 2.20.1(ts-node@10.9.2)(typescript@5.4.5) + hardhat: 2.20.1(ts-node@10.9.2(@types/node@20.14.15)(typescript@5.5.4))(typescript@5.5.4) - '@nomicfoundation/hardhat-verify@2.0.7(hardhat@2.20.1)': + '@nomicfoundation/hardhat-verify@2.0.9(hardhat@2.20.1(ts-node@10.9.2(@types/node@20.14.15)(typescript@5.5.4))(typescript@5.5.4))': dependencies: '@ethersproject/abi': 5.7.0 '@ethersproject/address': 5.7.0 cbor: 8.1.0 chalk: 2.4.2 - debug: 4.3.4(supports-color@8.1.1) - hardhat: 2.20.1(ts-node@10.9.2)(typescript@5.4.5) + debug: 4.3.6 + hardhat: 2.20.1(ts-node@10.9.2(@types/node@20.14.15)(typescript@5.5.4))(typescript@5.5.4) lodash.clonedeep: 4.5.0 semver: 6.3.0 table: 6.8.1 @@ -3930,15 +4025,46 @@ snapshots: '@nomicfoundation/solidity-analyzer-win32-ia32-msvc': 0.1.0 '@nomicfoundation/solidity-analyzer-win32-x64-msvc': 0.1.0 - '@nomiclabs/hardhat-ethers@2.2.3(ethers@5.7.2)(hardhat@2.20.1)': + '@nomiclabs/hardhat-ethers@2.2.3(ethers@5.7.2)(hardhat@2.20.1(ts-node@10.9.2(@types/node@20.14.15)(typescript@5.5.4))(typescript@5.5.4))': dependencies: ethers: 5.7.2 - hardhat: 2.20.1(ts-node@10.9.2)(typescript@5.4.5) + hardhat: 2.20.1(ts-node@10.9.2(@types/node@20.14.15)(typescript@5.5.4))(typescript@5.5.4) + + '@offchainlabs/upgrade-executor@1.1.0-beta.0': + dependencies: + '@openzeppelin/contracts': 4.7.3 + '@openzeppelin/contracts-upgradeable': 4.7.3 + + '@openzeppelin/contracts-upgradeable@4.5.2': {} + + '@openzeppelin/contracts-upgradeable@4.7.3': {} + + '@openzeppelin/contracts-upgradeable@4.8.3': {} '@openzeppelin/contracts-upgradeable@4.9.3': {} + '@openzeppelin/contracts@4.5.0': {} + + '@openzeppelin/contracts@4.7.3': {} + + '@openzeppelin/contracts@4.8.3': {} + '@openzeppelin/contracts@4.9.3': {} + '@openzeppelin/upgrades-core@1.34.4': + dependencies: + cbor: 9.0.2 + chalk: 4.1.2 + compare-versions: 6.1.1 + debug: 4.3.6 + ethereumjs-util: 7.1.5 + minimist: 1.2.8 + proper-lockfile: 4.1.2 + solidity-ast: 0.4.56 + transitivePeerDependencies: + - supports-color + optional: true + '@pkgr/core@0.1.1': {} '@pnpm/config.env-replace@1.1.0': {} @@ -3953,9 +4079,9 @@ snapshots: '@pnpm/network.ca-file': 1.0.2 config-chain: 1.1.13 - '@prettier/sync@0.3.0(prettier@3.2.5)': + '@prettier/sync@0.3.0(prettier@3.3.3)': dependencies: - prettier: 3.2.5 + prettier: 3.3.3 '@scroll-tech/contracts@0.1.0': {} @@ -4040,7 +4166,7 @@ snapshots: '@truffle/contract-schema@3.4.10': dependencies: ajv: 6.12.6 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.6 transitivePeerDependencies: - supports-color @@ -4052,51 +4178,51 @@ snapshots: '@tsconfig/node16@1.0.3': {} - '@typechain/ethers-v5@7.2.0(@ethersproject/abi@5.7.0)(@ethersproject/bytes@5.7.0)(@ethersproject/providers@5.7.2)(ethers@5.7.2)(typechain@8.3.2)(typescript@5.4.5)': + '@typechain/ethers-v5@7.2.0(@ethersproject/abi@5.7.0)(@ethersproject/bytes@5.7.0)(@ethersproject/providers@5.7.2)(ethers@5.7.2)(typechain@8.3.2(typescript@5.5.4))(typescript@5.5.4)': dependencies: '@ethersproject/abi': 5.7.0 '@ethersproject/bytes': 5.7.0 '@ethersproject/providers': 5.7.2 ethers: 5.7.2 lodash: 4.17.21 - ts-essentials: 7.0.3(typescript@5.4.5) - typechain: 8.3.2(typescript@5.4.5) - typescript: 5.4.5 + ts-essentials: 7.0.3(typescript@5.5.4) + typechain: 8.3.2(typescript@5.5.4) + typescript: 5.5.4 - '@typechain/hardhat@7.0.0(@ethersproject/abi@5.7.0)(@ethersproject/providers@5.7.2)(@typechain/ethers-v5@7.2.0)(ethers@5.7.2)(hardhat@2.20.1)(typechain@8.3.2)': + '@typechain/hardhat@7.0.0(@ethersproject/abi@5.7.0)(@ethersproject/providers@5.7.2)(@typechain/ethers-v5@7.2.0(@ethersproject/abi@5.7.0)(@ethersproject/bytes@5.7.0)(@ethersproject/providers@5.7.2)(ethers@5.7.2)(typechain@8.3.2(typescript@5.5.4))(typescript@5.5.4))(ethers@5.7.2)(hardhat@2.20.1(ts-node@10.9.2(@types/node@20.14.15)(typescript@5.5.4))(typescript@5.5.4))(typechain@8.3.2(typescript@5.5.4))': dependencies: '@ethersproject/abi': 5.7.0 '@ethersproject/providers': 5.7.2 - '@typechain/ethers-v5': 7.2.0(@ethersproject/abi@5.7.0)(@ethersproject/bytes@5.7.0)(@ethersproject/providers@5.7.2)(ethers@5.7.2)(typechain@8.3.2)(typescript@5.4.5) + '@typechain/ethers-v5': 7.2.0(@ethersproject/abi@5.7.0)(@ethersproject/bytes@5.7.0)(@ethersproject/providers@5.7.2)(ethers@5.7.2)(typechain@8.3.2(typescript@5.5.4))(typescript@5.5.4) ethers: 5.7.2 fs-extra: 9.1.0 - hardhat: 2.20.1(ts-node@10.9.2)(typescript@5.4.5) - typechain: 8.3.2(typescript@5.4.5) + hardhat: 2.20.1(ts-node@10.9.2(@types/node@20.14.15)(typescript@5.5.4))(typescript@5.5.4) + typechain: 8.3.2(typescript@5.5.4) '@types/bn.js@4.11.6': dependencies: - '@types/node': 20.12.12 + '@types/node': 20.14.15 '@types/bn.js@5.1.1': dependencies: - '@types/node': 20.12.12 + '@types/node': 20.14.15 '@types/cacheable-request@6.0.2': dependencies: '@types/http-cache-semantics': 4.0.1 '@types/keyv': 3.1.4 - '@types/node': 20.12.12 + '@types/node': 20.14.15 '@types/responselike': 1.0.0 '@types/cbor@5.0.1': dependencies: - '@types/node': 20.12.12 + '@types/node': 20.14.15 '@types/chai-as-promised@7.1.8': dependencies: - '@types/chai': 4.3.16 + '@types/chai': 4.3.17 - '@types/chai@4.3.16': {} + '@types/chai@4.3.17': {} '@types/debug@4.1.12': dependencies: @@ -4108,124 +4234,126 @@ snapshots: '@types/keyv@3.1.4': dependencies: - '@types/node': 20.12.12 + '@types/node': 20.14.15 '@types/lru-cache@5.1.1': {} - '@types/minimist@1.2.5': {} - - '@types/mocha@10.0.6': {} + '@types/mocha@10.0.7': {} '@types/ms@0.7.31': {} '@types/node@12.19.16': {} - '@types/node@20.12.12': + '@types/node@20.14.15': dependencies: undici-types: 5.26.5 - '@types/normalize-package-data@2.4.4': {} - '@types/pbkdf2@3.1.0': dependencies: - '@types/node': 20.12.12 + '@types/node': 20.14.15 '@types/prettier@2.7.1': {} '@types/readable-stream@2.3.15': dependencies: - '@types/node': 20.12.12 + '@types/node': 20.14.15 safe-buffer: 5.1.2 '@types/responselike@1.0.0': dependencies: - '@types/node': 20.12.12 + '@types/node': 20.14.15 '@types/secp256k1@4.0.3': dependencies: - '@types/node': 20.12.12 + '@types/node': 20.14.15 '@types/semver@7.5.0': {} - '@typescript-eslint/eslint-plugin@7.10.0(@typescript-eslint/parser@7.10.0)(eslint@8.57.0)(typescript@5.4.5)': + '@typescript-eslint/eslint-plugin@7.18.0(@typescript-eslint/parser@7.18.0(eslint@8.57.0)(typescript@5.5.4))(eslint@8.57.0)(typescript@5.5.4)': dependencies: '@eslint-community/regexpp': 4.10.0 - '@typescript-eslint/parser': 7.10.0(eslint@8.57.0)(typescript@5.4.5) - '@typescript-eslint/scope-manager': 7.10.0 - '@typescript-eslint/type-utils': 7.10.0(eslint@8.57.0)(typescript@5.4.5) - '@typescript-eslint/utils': 7.10.0(eslint@8.57.0)(typescript@5.4.5) - '@typescript-eslint/visitor-keys': 7.10.0 + '@typescript-eslint/parser': 7.18.0(eslint@8.57.0)(typescript@5.5.4) + '@typescript-eslint/scope-manager': 7.18.0 + '@typescript-eslint/type-utils': 7.18.0(eslint@8.57.0)(typescript@5.5.4) + '@typescript-eslint/utils': 7.18.0(eslint@8.57.0)(typescript@5.5.4) + '@typescript-eslint/visitor-keys': 7.18.0 eslint: 8.57.0 graphemer: 1.4.0 ignore: 5.3.1 natural-compare: 1.4.0 - ts-api-utils: 1.3.0(typescript@5.4.5) - typescript: 5.4.5 + ts-api-utils: 1.3.0(typescript@5.5.4) + optionalDependencies: + typescript: 5.5.4 transitivePeerDependencies: - supports-color - '@typescript-eslint/parser@7.10.0(eslint@8.57.0)(typescript@5.4.5)': + '@typescript-eslint/parser@7.18.0(eslint@8.57.0)(typescript@5.5.4)': dependencies: - '@typescript-eslint/scope-manager': 7.10.0 - '@typescript-eslint/types': 7.10.0 - '@typescript-eslint/typescript-estree': 7.10.0(typescript@5.4.5) - '@typescript-eslint/visitor-keys': 7.10.0 - debug: 4.3.4(supports-color@8.1.1) + '@typescript-eslint/scope-manager': 7.18.0 + '@typescript-eslint/types': 7.18.0 + '@typescript-eslint/typescript-estree': 7.18.0(typescript@5.5.4) + '@typescript-eslint/visitor-keys': 7.18.0 + debug: 4.3.6 eslint: 8.57.0 - typescript: 5.4.5 + optionalDependencies: + typescript: 5.5.4 transitivePeerDependencies: - supports-color - '@typescript-eslint/scope-manager@7.10.0': + '@typescript-eslint/scope-manager@7.18.0': dependencies: - '@typescript-eslint/types': 7.10.0 - '@typescript-eslint/visitor-keys': 7.10.0 + '@typescript-eslint/types': 7.18.0 + '@typescript-eslint/visitor-keys': 7.18.0 - '@typescript-eslint/type-utils@7.10.0(eslint@8.57.0)(typescript@5.4.5)': + '@typescript-eslint/type-utils@7.18.0(eslint@8.57.0)(typescript@5.5.4)': dependencies: - '@typescript-eslint/typescript-estree': 7.10.0(typescript@5.4.5) - '@typescript-eslint/utils': 7.10.0(eslint@8.57.0)(typescript@5.4.5) - debug: 4.3.4(supports-color@8.1.1) + '@typescript-eslint/typescript-estree': 7.18.0(typescript@5.5.4) + '@typescript-eslint/utils': 7.18.0(eslint@8.57.0)(typescript@5.5.4) + debug: 4.3.6 eslint: 8.57.0 - ts-api-utils: 1.3.0(typescript@5.4.5) - typescript: 5.4.5 + ts-api-utils: 1.3.0(typescript@5.5.4) + optionalDependencies: + typescript: 5.5.4 transitivePeerDependencies: - supports-color - '@typescript-eslint/types@7.10.0': {} + '@typescript-eslint/types@7.18.0': {} - '@typescript-eslint/typescript-estree@7.10.0(typescript@5.4.5)': + '@typescript-eslint/typescript-estree@7.18.0(typescript@5.5.4)': dependencies: - '@typescript-eslint/types': 7.10.0 - '@typescript-eslint/visitor-keys': 7.10.0 - debug: 4.3.4(supports-color@8.1.1) + '@typescript-eslint/types': 7.18.0 + '@typescript-eslint/visitor-keys': 7.18.0 + debug: 4.3.6 globby: 11.1.0 is-glob: 4.0.3 minimatch: 9.0.4 - semver: 7.6.2 - ts-api-utils: 1.3.0(typescript@5.4.5) - typescript: 5.4.5 + semver: 7.6.3 + ts-api-utils: 1.3.0(typescript@5.5.4) + optionalDependencies: + typescript: 5.5.4 transitivePeerDependencies: - supports-color - '@typescript-eslint/utils@7.10.0(eslint@8.57.0)(typescript@5.4.5)': + '@typescript-eslint/utils@7.18.0(eslint@8.57.0)(typescript@5.5.4)': dependencies: '@eslint-community/eslint-utils': 4.4.0(eslint@8.57.0) - '@typescript-eslint/scope-manager': 7.10.0 - '@typescript-eslint/types': 7.10.0 - '@typescript-eslint/typescript-estree': 7.10.0(typescript@5.4.5) + '@typescript-eslint/scope-manager': 7.18.0 + '@typescript-eslint/types': 7.18.0 + '@typescript-eslint/typescript-estree': 7.18.0(typescript@5.5.4) eslint: 8.57.0 transitivePeerDependencies: - supports-color - typescript - '@typescript-eslint/visitor-keys@7.10.0': + '@typescript-eslint/visitor-keys@7.18.0': dependencies: - '@typescript-eslint/types': 7.10.0 + '@typescript-eslint/types': 7.18.0 eslint-visitor-keys: 3.4.3 '@ungap/structured-clone@1.2.0': {} + '@yarnpkg/lockfile@1.1.0': {} + abi-to-sol@0.6.6: dependencies: '@truffle/abi-utils': 0.3.2 @@ -4233,7 +4361,7 @@ snapshots: ajv: 6.12.6 better-ajv-errors: 0.8.2(ajv@6.12.6) neodoc: 2.0.2 - semver: 7.6.2 + semver: 7.6.3 source-map-support: 0.5.21 optionalDependencies: prettier: 2.8.8 @@ -4257,7 +4385,7 @@ snapshots: agent-base@6.0.2: dependencies: - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.6 transitivePeerDependencies: - supports-color @@ -4327,15 +4455,25 @@ snapshots: dependencies: call-bind: 1.0.5 is-array-buffer: 3.0.2 + optional: true - array-union@2.1.0: {} + array-buffer-byte-length@1.0.1: + dependencies: + call-bind: 1.0.7 + is-array-buffer: 3.0.4 + optional: true + + array-union@2.1.0: {} - array.prototype.flat@1.3.2: + array.prototype.findlast@1.2.5: dependencies: - call-bind: 1.0.5 + call-bind: 1.0.7 define-properties: 1.2.1 - es-abstract: 1.22.3 + es-abstract: 1.23.3 + es-errors: 1.3.0 + es-object-atoms: 1.0.0 es-shim-unscopables: 1.0.2 + optional: true arraybuffer.prototype.slice@1.0.2: dependencies: @@ -4346,8 +4484,19 @@ snapshots: get-intrinsic: 1.2.2 is-array-buffer: 3.0.2 is-shared-array-buffer: 1.0.2 + optional: true - arrify@1.0.1: {} + arraybuffer.prototype.slice@1.0.3: + dependencies: + array-buffer-byte-length: 1.0.1 + call-bind: 1.0.7 + define-properties: 1.2.1 + es-abstract: 1.23.3 + es-errors: 1.3.0 + get-intrinsic: 1.2.4 + is-array-buffer: 3.0.4 + is-shared-array-buffer: 1.0.3 + optional: true assertion-error@1.1.0: {} @@ -4357,7 +4506,13 @@ snapshots: at-least-node@1.0.0: {} - available-typed-arrays@1.0.5: {} + available-typed-arrays@1.0.5: + optional: true + + available-typed-arrays@1.0.7: + dependencies: + possible-typed-array-names: 1.0.0 + optional: true balanced-match@1.0.0: {} @@ -4420,10 +4575,6 @@ snapshots: dependencies: fill-range: 7.0.1 - breakword@1.0.6: - dependencies: - wcwidth: 1.0.1 - brorand@1.1.0: {} browser-stdout@1.3.1: {} @@ -4472,6 +4623,16 @@ snapshots: function-bind: 1.1.2 get-intrinsic: 1.2.2 set-function-length: 1.1.1 + optional: true + + call-bind@1.0.7: + dependencies: + es-define-property: 1.0.0 + es-errors: 1.3.0 + function-bind: 1.1.2 + get-intrinsic: 1.2.4 + set-function-length: 1.2.2 + optional: true callsites@3.1.0: {} @@ -4480,14 +4641,6 @@ snapshots: no-case: 2.3.2 upper-case: 1.1.3 - camelcase-keys@6.2.2: - dependencies: - camelcase: 5.3.1 - map-obj: 4.3.0 - quick-lru: 4.0.1 - - camelcase@5.3.1: {} - camelcase@6.3.0: {} cbor@5.2.0: @@ -4499,12 +4652,17 @@ snapshots: dependencies: nofilter: 3.1.0 - chai-as-promised@7.1.1(chai@4.4.1): + cbor@9.0.2: + dependencies: + nofilter: 3.1.0 + optional: true + + chai-as-promised@7.1.1(chai@4.5.0): dependencies: - chai: 4.4.1 + chai: 4.5.0 check-error: 1.0.3 - chai@4.4.1: + chai@4.5.0: dependencies: assertion-error: 1.1.0 check-error: 1.0.3 @@ -4512,7 +4670,7 @@ snapshots: get-func-name: 2.0.2 loupe: 2.3.7 pathval: 1.1.1 - type-detect: 4.0.8 + type-detect: 4.1.0 chalk@2.4.2: dependencies: @@ -4577,30 +4735,16 @@ snapshots: cli-boxes@2.2.1: {} - cliui@6.0.0: - dependencies: - string-width: 4.2.3 - strip-ansi: 6.0.1 - wrap-ansi: 6.2.0 - cliui@7.0.4: dependencies: string-width: 4.2.3 strip-ansi: 6.0.1 wrap-ansi: 7.0.0 - cliui@8.0.1: - dependencies: - string-width: 4.2.3 - strip-ansi: 6.0.1 - wrap-ansi: 7.0.0 - clone-response@1.0.2: dependencies: mimic-response: 1.0.1 - clone@1.0.4: {} - code-error-fragment@0.0.230: {} color-convert@1.9.3: @@ -4635,6 +4779,9 @@ snapshots: commander@3.0.2: {} + compare-versions@6.1.1: + optional: true + concat-map@0.0.1: {} config-chain@1.1.13: @@ -4683,38 +4830,52 @@ snapshots: shebang-command: 1.2.0 which: 1.3.1 + cross-spawn@6.0.5: + dependencies: + nice-try: 1.0.5 + path-key: 2.0.1 + semver: 5.7.1 + shebang-command: 1.2.0 + which: 1.3.1 + cross-spawn@7.0.3: dependencies: path-key: 3.1.1 shebang-command: 2.0.0 which: 2.0.2 - csv-generate@3.4.3: {} - - csv-parse@4.16.3: {} + data-view-buffer@1.0.1: + dependencies: + call-bind: 1.0.7 + es-errors: 1.3.0 + is-data-view: 1.0.1 + optional: true - csv-stringify@5.6.5: {} + data-view-byte-length@1.0.1: + dependencies: + call-bind: 1.0.7 + es-errors: 1.3.0 + is-data-view: 1.0.1 + optional: true - csv@5.5.3: + data-view-byte-offset@1.0.0: dependencies: - csv-generate: 3.4.3 - csv-parse: 4.16.3 - csv-stringify: 5.6.5 - stream-transform: 2.1.3 + call-bind: 1.0.7 + es-errors: 1.3.0 + is-data-view: 1.0.1 + optional: true dataloader@1.4.0: {} debug@4.3.4(supports-color@8.1.1): dependencies: ms: 2.1.2 + optionalDependencies: supports-color: 8.1.1 - decamelize-keys@1.1.1: + debug@4.3.6: dependencies: - decamelize: 1.2.0 - map-obj: 1.0.1 - - decamelize@1.2.0: {} + ms: 2.1.2 decamelize@4.0.0: {} @@ -4735,10 +4896,6 @@ snapshots: deep-is@0.1.4: {} - defaults@1.0.4: - dependencies: - clone: 1.0.4 - defer-to-connect@2.0.1: {} define-data-property@1.1.1: @@ -4746,12 +4903,21 @@ snapshots: get-intrinsic: 1.2.2 gopd: 1.0.1 has-property-descriptors: 1.0.0 + optional: true + + define-data-property@1.1.4: + dependencies: + es-define-property: 1.0.0 + es-errors: 1.3.0 + gopd: 1.0.1 + optional: true define-properties@1.2.1: dependencies: define-data-property: 1.1.1 has-property-descriptors: 1.0.0 object-keys: 1.1.1 + optional: true delete-empty@3.0.0: dependencies: @@ -4804,6 +4970,8 @@ snapshots: env-paths@2.2.1: {} + era-contracts@https://codeload.github.com/matter-labs/era-contracts/tar.gz/446d391d34bdb48255d5f8fef8a8248925fc98b9: {} + error-ex@1.3.2: dependencies: is-arrayish: 0.2.1 @@ -4849,22 +5017,96 @@ snapshots: typed-array-length: 1.0.4 unbox-primitive: 1.0.2 which-typed-array: 1.1.13 + optional: true + + es-abstract@1.23.3: + dependencies: + array-buffer-byte-length: 1.0.1 + arraybuffer.prototype.slice: 1.0.3 + available-typed-arrays: 1.0.7 + call-bind: 1.0.7 + data-view-buffer: 1.0.1 + data-view-byte-length: 1.0.1 + data-view-byte-offset: 1.0.0 + es-define-property: 1.0.0 + es-errors: 1.3.0 + es-object-atoms: 1.0.0 + es-set-tostringtag: 2.0.3 + es-to-primitive: 1.2.1 + function.prototype.name: 1.1.6 + get-intrinsic: 1.2.4 + get-symbol-description: 1.0.2 + globalthis: 1.0.3 + gopd: 1.0.1 + has-property-descriptors: 1.0.2 + has-proto: 1.0.3 + has-symbols: 1.0.3 + hasown: 2.0.2 + internal-slot: 1.0.7 + is-array-buffer: 3.0.4 + is-callable: 1.2.7 + is-data-view: 1.0.1 + is-negative-zero: 2.0.3 + is-regex: 1.1.4 + is-shared-array-buffer: 1.0.3 + is-string: 1.0.7 + is-typed-array: 1.1.13 + is-weakref: 1.0.2 + object-inspect: 1.13.1 + object-keys: 1.1.1 + object.assign: 4.1.5 + regexp.prototype.flags: 1.5.2 + safe-array-concat: 1.1.2 + safe-regex-test: 1.0.3 + string.prototype.trim: 1.2.9 + string.prototype.trimend: 1.0.8 + string.prototype.trimstart: 1.0.8 + typed-array-buffer: 1.0.2 + typed-array-byte-length: 1.0.1 + typed-array-byte-offset: 1.0.2 + typed-array-length: 1.0.6 + unbox-primitive: 1.0.2 + which-typed-array: 1.1.15 + optional: true + + es-define-property@1.0.0: + dependencies: + get-intrinsic: 1.2.4 + optional: true + + es-errors@1.3.0: + optional: true + + es-object-atoms@1.0.0: + dependencies: + es-errors: 1.3.0 + optional: true es-set-tostringtag@2.0.2: dependencies: get-intrinsic: 1.2.2 has-tostringtag: 1.0.0 hasown: 2.0.0 + optional: true + + es-set-tostringtag@2.0.3: + dependencies: + get-intrinsic: 1.2.4 + has-tostringtag: 1.0.2 + hasown: 2.0.2 + optional: true es-shim-unscopables@1.0.2: dependencies: hasown: 2.0.0 + optional: true es-to-primitive@1.2.1: dependencies: is-callable: 1.2.7 is-date-object: 1.0.2 is-symbol: 1.0.3 + optional: true escalade@3.1.1: {} @@ -4876,13 +5118,14 @@ snapshots: dependencies: eslint: 8.57.0 - eslint-plugin-prettier@5.1.3(eslint-config-prettier@9.1.0)(eslint@8.57.0)(prettier@3.2.5): + eslint-plugin-prettier@5.2.1(eslint-config-prettier@9.1.0(eslint@8.57.0))(eslint@8.57.0)(prettier@3.3.3): dependencies: eslint: 8.57.0 - eslint-config-prettier: 9.1.0(eslint@8.57.0) - prettier: 3.2.5 + prettier: 3.3.3 prettier-linter-helpers: 1.0.0 - synckit: 0.8.8 + synckit: 0.9.1 + optionalDependencies: + eslint-config-prettier: 9.1.0(eslint@8.57.0) eslint-scope@7.2.2: dependencies: @@ -4904,7 +5147,7 @@ snapshots: ajv: 6.12.6 chalk: 4.1.2 cross-spawn: 7.0.3 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.6 doctrine: 3.0.0 escape-string-regexp: 4.0.0 eslint-scope: 7.2.2 @@ -5120,6 +5363,10 @@ snapshots: micromatch: 4.0.5 pkg-dir: 4.2.0 + find-yarn-workspace-root@2.0.0: + dependencies: + micromatch: 4.0.5 + flat-cache@3.2.0: dependencies: flatted: 3.3.1 @@ -5130,13 +5377,14 @@ snapshots: flatted@3.3.1: {} - follow-redirects@1.15.6(debug@4.3.4): - dependencies: - debug: 4.3.4(supports-color@8.1.1) + follow-redirects@1.15.6(debug@4.3.6): + optionalDependencies: + debug: 4.3.6 for-each@0.3.3: dependencies: is-callable: 1.2.7 + optional: true form-data-encoder@1.7.1: {} @@ -5174,7 +5422,8 @@ snapshots: fsevents@2.3.2: optional: true - function-bind@1.1.2: {} + function-bind@1.1.2: + optional: true function.prototype.name@1.1.6: dependencies: @@ -5182,8 +5431,10 @@ snapshots: define-properties: 1.2.1 es-abstract: 1.22.3 functions-have-names: 1.2.3 + optional: true - functions-have-names@1.2.3: {} + functions-have-names@1.2.3: + optional: true get-caller-file@2.0.5: {} @@ -5195,6 +5446,16 @@ snapshots: has-proto: 1.0.1 has-symbols: 1.0.3 hasown: 2.0.0 + optional: true + + get-intrinsic@1.2.4: + dependencies: + es-errors: 1.3.0 + function-bind: 1.1.2 + has-proto: 1.0.1 + has-symbols: 1.0.3 + hasown: 2.0.0 + optional: true get-stream@5.1.0: dependencies: @@ -5206,6 +5467,14 @@ snapshots: dependencies: call-bind: 1.0.5 get-intrinsic: 1.2.2 + optional: true + + get-symbol-description@1.0.2: + dependencies: + call-bind: 1.0.7 + es-errors: 1.3.0 + get-intrinsic: 1.2.4 + optional: true glob-parent@5.1.2: dependencies: @@ -5257,6 +5526,7 @@ snapshots: globalthis@1.0.3: dependencies: define-properties: 1.2.1 + optional: true globby@11.1.0: dependencies: @@ -5270,6 +5540,7 @@ snapshots: gopd@1.0.1: dependencies: get-intrinsic: 1.2.2 + optional: true got@12.1.0: dependencies: @@ -5293,13 +5564,11 @@ snapshots: graphemer@1.4.0: {} - hard-rejection@2.1.0: {} - - hardhat-abi-exporter@2.10.1(hardhat@2.20.1): + hardhat-abi-exporter@2.10.1(hardhat@2.20.1(ts-node@10.9.2(@types/node@20.14.15)(typescript@5.5.4))(typescript@5.5.4)): dependencies: '@ethersproject/abi': 5.7.0 delete-empty: 3.0.0 - hardhat: 2.20.1(ts-node@10.9.2)(typescript@5.4.5) + hardhat: 2.20.1(ts-node@10.9.2(@types/node@20.14.15)(typescript@5.5.4))(typescript@5.5.4) hardhat-ignore-warnings@0.2.11: dependencies: @@ -5307,7 +5576,7 @@ snapshots: node-interval-tree: 2.1.2 solidity-comments: 0.0.2 - hardhat@2.20.1(ts-node@10.9.2)(typescript@5.4.5): + hardhat@2.20.1(ts-node@10.9.2(@types/node@20.14.15)(typescript@5.5.4))(typescript@5.5.4): dependencies: '@ethersproject/abi': 5.7.0 '@metamask/eth-sig-util': 4.0.1 @@ -5333,7 +5602,7 @@ snapshots: chalk: 2.4.2 chokidar: 3.5.3 ci-info: 2.0.0 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.6 enquirer: 2.3.6 env-paths: 2.2.1 ethereum-cryptography: 1.1.2 @@ -5352,22 +5621,24 @@ snapshots: raw-body: 2.5.1 resolve: 1.17.0 semver: 6.3.0 - solc: 0.7.3(debug@4.3.4) + solc: 0.7.3(debug@4.3.6) source-map-support: 0.5.21 stacktrace-parser: 0.1.10 - ts-node: 10.9.2(@types/node@20.12.12)(typescript@5.4.5) tsort: 0.0.1 - typescript: 5.4.5 undici: 5.28.4 uuid: 8.3.2 ws: 7.5.9 + optionalDependencies: + ts-node: 10.9.2(@types/node@20.14.15)(typescript@5.5.4) + typescript: 5.5.4 transitivePeerDependencies: - bufferutil - c-kzg - supports-color - utf-8-validate - has-bigints@1.0.2: {} + has-bigints@1.0.2: + optional: true has-flag@3.0.0: {} @@ -5376,18 +5647,31 @@ snapshots: has-property-descriptors@1.0.0: dependencies: get-intrinsic: 1.2.2 + optional: true - has-proto@1.0.1: {} + has-property-descriptors@1.0.2: + dependencies: + es-define-property: 1.0.0 + optional: true + + has-proto@1.0.1: + optional: true - has-symbols@1.0.3: {} + has-proto@1.0.3: + optional: true + + has-symbols@1.0.3: + optional: true has-tostringtag@1.0.0: dependencies: has-symbols: 1.0.3 + optional: true - has@1.0.3: + has-tostringtag@1.0.2: dependencies: - function-bind: 1.1.2 + has-symbols: 1.0.3 + optional: true hash-base@3.1.0: dependencies: @@ -5403,6 +5687,12 @@ snapshots: hasown@2.0.0: dependencies: function-bind: 1.1.2 + optional: true + + hasown@2.0.2: + dependencies: + function-bind: 1.1.2 + optional: true he@1.2.0: {} @@ -5417,8 +5707,6 @@ snapshots: minimalistic-assert: 1.0.1 minimalistic-crypto-utils: 1.0.1 - hosted-git-info@2.8.9: {} - http-cache-semantics@4.0.3: {} http-errors@2.0.0: @@ -5437,7 +5725,7 @@ snapshots: https-proxy-agent@5.0.1: dependencies: agent-base: 6.0.2 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.6 transitivePeerDependencies: - supports-color @@ -5476,6 +5764,14 @@ snapshots: get-intrinsic: 1.2.2 hasown: 2.0.0 side-channel: 1.0.4 + optional: true + + internal-slot@1.0.7: + dependencies: + es-errors: 1.3.0 + hasown: 2.0.2 + side-channel: 1.0.4 + optional: true io-ts@1.10.4: dependencies: @@ -5486,12 +5782,20 @@ snapshots: call-bind: 1.0.5 get-intrinsic: 1.2.2 is-typed-array: 1.1.12 + optional: true + + is-array-buffer@3.0.4: + dependencies: + call-bind: 1.0.7 + get-intrinsic: 1.2.4 + optional: true is-arrayish@0.2.1: {} is-bigint@1.0.4: dependencies: has-bigints: 1.0.2 + optional: true is-binary-path@2.1.0: dependencies: @@ -5501,14 +5805,24 @@ snapshots: dependencies: call-bind: 1.0.5 has-tostringtag: 1.0.0 + optional: true - is-callable@1.2.7: {} + is-callable@1.2.7: + optional: true - is-core-module@2.10.0: + is-ci@2.0.0: dependencies: - has: 1.0.3 + ci-info: 2.0.0 - is-date-object@1.0.2: {} + is-data-view@1.0.1: + dependencies: + is-typed-array: 1.1.13 + optional: true + + is-date-object@1.0.2: + optional: true + + is-docker@2.2.1: {} is-extglob@2.1.1: {} @@ -5524,32 +5838,43 @@ snapshots: dependencies: lower-case: 1.1.4 - is-negative-zero@2.0.2: {} + is-negative-zero@2.0.2: + optional: true + + is-negative-zero@2.0.3: + optional: true is-number-object@1.0.7: dependencies: has-tostringtag: 1.0.0 + optional: true is-number@7.0.0: {} is-path-inside@3.0.3: {} - is-plain-obj@1.1.0: {} - is-plain-obj@2.1.0: {} is-regex@1.1.4: dependencies: call-bind: 1.0.5 has-tostringtag: 1.0.0 + optional: true is-shared-array-buffer@1.0.2: dependencies: call-bind: 1.0.5 + optional: true + + is-shared-array-buffer@1.0.3: + dependencies: + call-bind: 1.0.7 + optional: true is-string@1.0.7: dependencies: has-tostringtag: 1.0.0 + optional: true is-subdir@1.2.0: dependencies: @@ -5558,10 +5883,17 @@ snapshots: is-symbol@1.0.3: dependencies: has-symbols: 1.0.3 + optional: true is-typed-array@1.1.12: dependencies: which-typed-array: 1.1.13 + optional: true + + is-typed-array@1.1.13: + dependencies: + which-typed-array: 1.1.15 + optional: true is-unicode-supported@0.1.0: {} @@ -5572,10 +5904,16 @@ snapshots: is-weakref@1.0.2: dependencies: call-bind: 1.0.5 + optional: true is-windows@1.0.2: {} - isarray@2.0.5: {} + is-wsl@2.2.0: + dependencies: + is-docker: 2.2.1 + + isarray@2.0.5: + optional: true isexe@2.0.0: {} @@ -5639,14 +5977,14 @@ snapshots: dependencies: json-buffer: 3.0.1 - kind-of@6.0.3: {} + klaw-sync@6.0.0: + dependencies: + graceful-fs: 4.2.10 klaw@1.3.1: optionalDependencies: graceful-fs: 4.2.10 - kleur@4.1.5: {} - latest-version@7.0.0: dependencies: package-json: 8.1.1 @@ -5726,10 +6064,6 @@ snapshots: make-error@1.3.6: {} - map-obj@1.0.1: {} - - map-obj@4.3.0: {} - md5.js@1.3.5: dependencies: hash-base: 3.1.0 @@ -5738,20 +6072,6 @@ snapshots: memorystream@0.3.1: {} - meow@6.1.1: - dependencies: - '@types/minimist': 1.2.5 - camelcase-keys: 6.2.2 - decamelize-keys: 1.1.1 - hard-rejection: 2.1.0 - minimist-options: 4.1.0 - normalize-package-data: 2.5.0 - read-pkg-up: 7.0.1 - redent: 3.0.0 - trim-newlines: 3.0.1 - type-fest: 0.13.1 - yargs-parser: 18.1.3 - merge2@1.4.1: {} micromatch@4.0.5: @@ -5763,8 +6083,6 @@ snapshots: mimic-response@3.1.0: {} - min-indent@1.0.1: {} - minimalistic-assert@1.0.1: {} minimalistic-crypto-utils@1.0.1: {} @@ -5785,16 +6103,8 @@ snapshots: dependencies: brace-expansion: 2.0.1 - minimist-options@4.1.0: - dependencies: - arrify: 1.0.1 - is-plain-obj: 1.1.0 - kind-of: 6.0.3 - minimist@1.2.8: {} - mixme@0.5.10: {} - mkdirp@1.0.4: {} mnemonist@0.38.5: @@ -5827,6 +6137,8 @@ snapshots: moment@2.30.1: {} + mri@1.2.0: {} + ms@2.1.2: {} ms@2.1.3: {} @@ -5839,6 +6151,8 @@ snapshots: dependencies: ansi-regex: 2.1.1 + nice-try@1.0.5: {} + no-case@2.3.2: dependencies: lower-case: 1.1.4 @@ -5859,13 +6173,6 @@ snapshots: nofilter@3.1.0: {} - normalize-package-data@2.5.0: - dependencies: - hosted-git-info: 2.8.9 - resolve: 1.22.1 - semver: 5.7.1 - validate-npm-package-license: 3.0.4 - normalize-path@3.0.0: {} normalize-url@6.1.0: {} @@ -5875,9 +6182,11 @@ snapshots: bn.js: 4.11.6 strip-hex-prefix: 1.0.0 - object-inspect@1.13.1: {} + object-inspect@1.13.1: + optional: true - object-keys@1.1.1: {} + object-keys@1.1.1: + optional: true object.assign@4.1.4: dependencies: @@ -5885,6 +6194,15 @@ snapshots: define-properties: 1.2.1 has-symbols: 1.0.3 object-keys: 1.1.1 + optional: true + + object.assign@4.1.5: + dependencies: + call-bind: 1.0.7 + define-properties: 1.2.1 + has-symbols: 1.0.3 + object-keys: 1.1.1 + optional: true obliterator@2.0.4: {} @@ -5892,6 +6210,11 @@ snapshots: dependencies: wrappy: 1.0.2 + open@7.4.2: + dependencies: + is-docker: 2.2.1 + is-wsl: 2.2.0 + optionator@0.9.3: dependencies: '@aashutoshrathi/word-wrap': 1.2.6 @@ -5952,7 +6275,7 @@ snapshots: got: 12.1.0 registry-auth-token: 5.0.2 registry-url: 6.0.1 - semver: 7.6.2 + semver: 7.6.3 param-case@2.1.1: dependencies: @@ -5974,6 +6297,23 @@ snapshots: camel-case: 3.0.0 upper-case-first: 1.1.2 + patch-package@6.5.1: + dependencies: + '@yarnpkg/lockfile': 1.1.0 + chalk: 4.1.2 + cross-spawn: 6.0.5 + find-yarn-workspace-root: 2.0.0 + fs-extra: 9.1.0 + is-ci: 2.0.0 + klaw-sync: 6.0.0 + minimist: 1.2.8 + open: 7.4.2 + rimraf: 2.7.1 + semver: 5.7.1 + slash: 2.0.0 + tmp: 0.0.33 + yaml: 1.10.2 + path-case@2.1.1: dependencies: no-case: 2.3.2 @@ -5984,6 +6324,8 @@ snapshots: path-is-absolute@1.0.1: {} + path-key@2.0.1: {} + path-key@3.1.1: {} path-parse@1.0.7: {} @@ -6012,6 +6354,9 @@ snapshots: pluralize@8.0.0: {} + possible-typed-array-names@1.0.0: + optional: true + preferred-pm@3.1.3: dependencies: find-up: 5.0.0 @@ -6029,20 +6374,27 @@ snapshots: dependencies: '@solidity-parser/parser': 0.17.0 prettier: 2.8.8 - semver: 7.6.2 + semver: 7.6.3 solidity-comments-extractor: 0.0.8 optional: true - prettier-plugin-solidity@1.3.1(prettier@3.2.5): + prettier-plugin-solidity@1.3.1(prettier@3.3.3): dependencies: '@solidity-parser/parser': 0.17.0 - prettier: 3.2.5 - semver: 7.6.2 + prettier: 3.3.3 + semver: 7.6.3 solidity-comments-extractor: 0.0.8 prettier@2.8.8: {} - prettier@3.2.5: {} + prettier@3.3.3: {} + + proper-lockfile@4.1.2: + dependencies: + graceful-fs: 4.2.10 + retry: 0.12.0 + signal-exit: 3.0.7 + optional: true proto-list@1.2.4: {} @@ -6057,8 +6409,6 @@ snapshots: pure-rand@5.0.3: {} - quick-lru@4.0.1: {} - quick-lru@5.1.1: {} randombytes@2.1.0: @@ -6079,19 +6429,6 @@ snapshots: minimist: 1.2.8 strip-json-comments: 2.0.1 - read-pkg-up@7.0.1: - dependencies: - find-up: 4.1.0 - read-pkg: 5.2.0 - type-fest: 0.8.1 - - read-pkg@5.2.0: - dependencies: - '@types/normalize-package-data': 2.4.4 - normalize-package-data: 2.5.0 - parse-json: 5.2.0 - type-fest: 0.6.0 - read-yaml-file@1.1.0: dependencies: graceful-fs: 4.2.10 @@ -6109,11 +6446,6 @@ snapshots: dependencies: picomatch: 2.3.1 - redent@3.0.0: - dependencies: - indent-string: 4.0.0 - strip-indent: 3.0.0 - reduce-flatten@2.0.0: {} regenerator-runtime@0.14.1: {} @@ -6123,6 +6455,15 @@ snapshots: call-bind: 1.0.5 define-properties: 1.2.1 set-function-name: 2.0.1 + optional: true + + regexp.prototype.flags@1.5.2: + dependencies: + call-bind: 1.0.7 + define-properties: 1.2.1 + es-errors: 1.3.0 + set-function-name: 2.0.1 + optional: true registry-auth-token@5.0.2: dependencies: @@ -6136,8 +6477,6 @@ snapshots: require-from-string@2.0.2: {} - require-main-filename@2.0.0: {} - resolve-alpn@1.2.1: {} resolve-from@4.0.0: {} @@ -6148,16 +6487,13 @@ snapshots: dependencies: path-parse: 1.0.7 - resolve@1.22.1: - dependencies: - is-core-module: 2.10.0 - path-parse: 1.0.7 - supports-preserve-symlinks-flag: 1.0.0 - responselike@2.0.1: dependencies: lowercase-keys: 2.0.0 + retry@0.12.0: + optional: true + reusify@1.0.4: {} rimraf@2.7.1: @@ -6191,6 +6527,15 @@ snapshots: get-intrinsic: 1.2.2 has-symbols: 1.0.3 isarray: 2.0.5 + optional: true + + safe-array-concat@1.1.2: + dependencies: + call-bind: 1.0.7 + get-intrinsic: 1.2.4 + has-symbols: 1.0.3 + isarray: 2.0.5 + optional: true safe-buffer@5.1.2: {} @@ -6201,6 +6546,14 @@ snapshots: call-bind: 1.0.5 get-intrinsic: 1.2.2 is-regex: 1.1.4 + optional: true + + safe-regex-test@1.0.3: + dependencies: + call-bind: 1.0.7 + es-errors: 1.3.0 + is-regex: 1.1.4 + optional: true safer-buffer@2.1.2: {} @@ -6216,7 +6569,7 @@ snapshots: semver@6.3.0: {} - semver@7.6.2: {} + semver@7.6.3: {} sentence-case@2.1.1: dependencies: @@ -6227,20 +6580,30 @@ snapshots: dependencies: randombytes: 2.1.0 - set-blocking@2.0.0: {} - set-function-length@1.1.1: dependencies: define-data-property: 1.1.1 get-intrinsic: 1.2.2 gopd: 1.0.1 has-property-descriptors: 1.0.0 + optional: true + + set-function-length@1.2.2: + dependencies: + define-data-property: 1.1.4 + es-errors: 1.3.0 + function-bind: 1.1.2 + get-intrinsic: 1.2.4 + gopd: 1.0.1 + has-property-descriptors: 1.0.2 + optional: true set-function-name@2.0.1: dependencies: define-data-property: 1.1.1 functions-have-names: 1.2.3 has-property-descriptors: 1.0.0 + optional: true setimmediate@1.0.5: {} @@ -6270,9 +6633,12 @@ snapshots: call-bind: 1.0.5 get-intrinsic: 1.2.2 object-inspect: 1.13.1 + optional: true signal-exit@3.0.7: {} + slash@2.0.0: {} + slash@3.0.0: {} slice-ansi@4.0.0: @@ -6281,24 +6647,15 @@ snapshots: astral-regex: 2.0.0 is-fullwidth-code-point: 3.0.0 - smartwrap@2.0.2: - dependencies: - array.prototype.flat: 1.3.2 - breakword: 1.0.6 - grapheme-splitter: 1.0.4 - strip-ansi: 6.0.1 - wcwidth: 1.0.1 - yargs: 15.4.1 - snake-case@2.1.0: dependencies: no-case: 2.3.2 - solc@0.7.3(debug@4.3.4): + solc@0.7.3(debug@4.3.6): dependencies: command-exists: 1.2.9 commander: 3.0.2 - follow-redirects: 1.15.6(debug@4.3.4) + follow-redirects: 1.15.6(debug@4.3.6) fs-extra: 0.30.0 js-sha3: 0.8.0 memorystream: 0.3.1 @@ -6308,12 +6665,12 @@ snapshots: transitivePeerDependencies: - debug - solhint-plugin-prettier@0.1.0(prettier-plugin-solidity@1.3.1)(prettier@3.2.5): + solhint-plugin-prettier@0.1.0(prettier-plugin-solidity@1.3.1(prettier@3.3.3))(prettier@3.3.3): dependencies: - '@prettier/sync': 0.3.0(prettier@3.2.5) - prettier: 3.2.5 + '@prettier/sync': 0.3.0(prettier@3.3.3) + prettier: 3.3.3 prettier-linter-helpers: 1.0.0 - prettier-plugin-solidity: 1.3.1(prettier@3.2.5) + prettier-plugin-solidity: 1.3.1(prettier@3.3.3) solhint@5.0.1: dependencies: @@ -6331,13 +6688,18 @@ snapshots: latest-version: 7.0.0 lodash: 4.17.21 pluralize: 8.0.0 - semver: 7.6.2 + semver: 7.6.3 strip-ansi: 6.0.1 table: 6.8.1 text-table: 0.2.0 optionalDependencies: prettier: 2.8.8 + solidity-ast@0.4.56: + dependencies: + array.prototype.findlast: 1.2.5 + optional: true + solidity-comments-darwin-arm64@0.0.2: optional: true @@ -6399,20 +6761,6 @@ snapshots: cross-spawn: 5.1.0 signal-exit: 3.0.7 - spdx-correct@3.1.1: - dependencies: - spdx-expression-parse: 3.0.1 - spdx-license-ids: 3.0.12 - - spdx-exceptions@2.3.0: {} - - spdx-expression-parse@3.0.1: - dependencies: - spdx-exceptions: 2.3.0 - spdx-license-ids: 3.0.12 - - spdx-license-ids@3.0.12: {} - sprintf-js@1.0.3: {} stacktrace-parser@0.1.10: @@ -6421,10 +6769,6 @@ snapshots: statuses@2.0.1: {} - stream-transform@2.1.3: - dependencies: - mixme: 0.5.10 - string-format@2.0.0: {} string-width@4.2.3: @@ -6438,18 +6782,43 @@ snapshots: call-bind: 1.0.5 define-properties: 1.2.1 es-abstract: 1.22.3 + optional: true + + string.prototype.trim@1.2.9: + dependencies: + call-bind: 1.0.7 + define-properties: 1.2.1 + es-abstract: 1.23.3 + es-object-atoms: 1.0.0 + optional: true string.prototype.trimend@1.0.7: dependencies: call-bind: 1.0.5 define-properties: 1.2.1 es-abstract: 1.22.3 + optional: true + + string.prototype.trimend@1.0.8: + dependencies: + call-bind: 1.0.7 + define-properties: 1.2.1 + es-object-atoms: 1.0.0 + optional: true string.prototype.trimstart@1.0.7: dependencies: call-bind: 1.0.5 define-properties: 1.2.1 es-abstract: 1.22.3 + optional: true + + string.prototype.trimstart@1.0.8: + dependencies: + call-bind: 1.0.7 + define-properties: 1.2.1 + es-object-atoms: 1.0.0 + optional: true string_decoder@1.3.0: dependencies: @@ -6465,10 +6834,6 @@ snapshots: dependencies: is-hex-prefixed: 1.0.0 - strip-indent@3.0.0: - dependencies: - min-indent: 1.0.1 - strip-json-comments@2.0.1: {} strip-json-comments@3.1.1: {} @@ -6485,14 +6850,12 @@ snapshots: dependencies: has-flag: 4.0.0 - supports-preserve-symlinks-flag@1.0.0: {} - swap-case@1.1.2: dependencies: lower-case: 1.1.4 upper-case: 1.1.3 - synckit@0.8.8: + synckit@0.9.1: dependencies: '@pkgr/core': 0.1.1 tslib: 2.6.2 @@ -6533,11 +6896,9 @@ snapshots: tr46@0.0.3: {} - trim-newlines@3.0.1: {} - - ts-api-utils@1.3.0(typescript@5.4.5): + ts-api-utils@1.3.0(typescript@5.5.4): dependencies: - typescript: 5.4.5 + typescript: 5.5.4 ts-command-line-args@2.5.1: dependencies: @@ -6546,25 +6907,25 @@ snapshots: command-line-usage: 6.1.3 string-format: 2.0.0 - ts-essentials@7.0.3(typescript@5.4.5): + ts-essentials@7.0.3(typescript@5.5.4): dependencies: - typescript: 5.4.5 + typescript: 5.5.4 - ts-node@10.9.2(@types/node@20.12.12)(typescript@5.4.5): + ts-node@10.9.2(@types/node@20.14.15)(typescript@5.5.4): dependencies: '@cspotcode/source-map-support': 0.8.1 '@tsconfig/node10': 1.0.9 '@tsconfig/node12': 1.0.11 '@tsconfig/node14': 1.0.3 '@tsconfig/node16': 1.0.3 - '@types/node': 20.12.12 + '@types/node': 20.14.15 acorn: 8.10.0 acorn-walk: 8.2.0 arg: 4.1.3 create-require: 1.1.1 diff: 4.0.2 make-error: 1.3.6 - typescript: 5.4.5 + typescript: 5.5.4 v8-compile-cache-lib: 3.0.1 yn: 3.1.1 @@ -6574,16 +6935,6 @@ snapshots: tsort@0.0.1: {} - tty-table@4.2.3: - dependencies: - chalk: 4.1.2 - csv: 5.5.3 - kleur: 4.1.5 - smartwrap: 2.0.2 - strip-ansi: 6.0.1 - wcwidth: 1.0.1 - yargs: 17.7.2 - tweetnacl-util@0.15.1: {} tweetnacl@1.0.3: {} @@ -6594,22 +6945,18 @@ snapshots: type-detect@4.0.8: {} - type-fest@0.13.1: {} + type-detect@4.1.0: {} type-fest@0.20.2: {} type-fest@0.21.3: {} - type-fest@0.6.0: {} - type-fest@0.7.1: {} - type-fest@0.8.1: {} - - typechain@8.3.2(typescript@5.4.5): + typechain@8.3.2(typescript@5.5.4): dependencies: '@types/prettier': 2.7.1 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.6 fs-extra: 7.0.1 glob: 7.1.7 js-sha3: 0.8.0 @@ -6617,8 +6964,8 @@ snapshots: mkdirp: 1.0.4 prettier: 2.8.8 ts-command-line-args: 2.5.1 - ts-essentials: 7.0.3(typescript@5.4.5) - typescript: 5.4.5 + ts-essentials: 7.0.3(typescript@5.5.4) + typescript: 5.5.4 transitivePeerDependencies: - supports-color @@ -6627,6 +6974,14 @@ snapshots: call-bind: 1.0.5 get-intrinsic: 1.2.2 is-typed-array: 1.1.12 + optional: true + + typed-array-buffer@1.0.2: + dependencies: + call-bind: 1.0.7 + es-errors: 1.3.0 + is-typed-array: 1.1.13 + optional: true typed-array-byte-length@1.0.0: dependencies: @@ -6634,6 +6989,16 @@ snapshots: for-each: 0.3.3 has-proto: 1.0.1 is-typed-array: 1.1.12 + optional: true + + typed-array-byte-length@1.0.1: + dependencies: + call-bind: 1.0.7 + for-each: 0.3.3 + gopd: 1.0.1 + has-proto: 1.0.3 + is-typed-array: 1.1.13 + optional: true typed-array-byte-offset@1.0.0: dependencies: @@ -6642,14 +7007,36 @@ snapshots: for-each: 0.3.3 has-proto: 1.0.1 is-typed-array: 1.1.12 + optional: true + + typed-array-byte-offset@1.0.2: + dependencies: + available-typed-arrays: 1.0.7 + call-bind: 1.0.7 + for-each: 0.3.3 + gopd: 1.0.1 + has-proto: 1.0.3 + is-typed-array: 1.1.13 + optional: true typed-array-length@1.0.4: dependencies: call-bind: 1.0.5 for-each: 0.3.3 is-typed-array: 1.1.12 + optional: true + + typed-array-length@1.0.6: + dependencies: + call-bind: 1.0.7 + for-each: 0.3.3 + gopd: 1.0.1 + has-proto: 1.0.3 + is-typed-array: 1.1.13 + possible-typed-array-names: 1.0.0 + optional: true - typescript@5.4.5: {} + typescript@5.5.4: {} typical@4.0.0: {} @@ -6661,6 +7048,7 @@ snapshots: has-bigints: 1.0.2 has-symbols: 1.0.3 which-boxed-primitive: 1.0.2 + optional: true undici-types@5.26.5: {} @@ -6692,15 +7080,6 @@ snapshots: v8-compile-cache-lib@3.0.1: {} - validate-npm-package-license@3.0.4: - dependencies: - spdx-correct: 3.1.1 - spdx-expression-parse: 3.0.1 - - wcwidth@1.0.1: - dependencies: - defaults: 1.0.4 - web3-utils@1.7.4: dependencies: bn.js: 5.2.1 @@ -6725,8 +7104,7 @@ snapshots: is-number-object: 1.0.7 is-string: 1.0.7 is-symbol: 1.0.3 - - which-module@2.0.0: {} + optional: true which-pm@2.0.0: dependencies: @@ -6740,6 +7118,16 @@ snapshots: for-each: 0.3.3 gopd: 1.0.1 has-tostringtag: 1.0.0 + optional: true + + which-typed-array@1.1.15: + dependencies: + available-typed-arrays: 1.0.7 + call-bind: 1.0.7 + for-each: 0.3.3 + gopd: 1.0.1 + has-tostringtag: 1.0.2 + optional: true which@1.3.1: dependencies: @@ -6760,12 +7148,6 @@ snapshots: workerpool@6.2.1: {} - wrap-ansi@6.2.0: - dependencies: - ansi-styles: 4.3.0 - string-width: 4.2.3 - strip-ansi: 6.0.1 - wrap-ansi@7.0.0: dependencies: ansi-styles: 4.3.0 @@ -6778,21 +7160,14 @@ snapshots: ws@7.5.9: {} - y18n@4.0.3: {} - y18n@5.0.8: {} yallist@2.1.2: {} - yargs-parser@18.1.3: - dependencies: - camelcase: 5.3.1 - decamelize: 1.2.0 + yaml@1.10.2: {} yargs-parser@20.2.4: {} - yargs-parser@21.1.1: {} - yargs-unparser@2.0.0: dependencies: camelcase: 6.3.0 @@ -6800,20 +7175,6 @@ snapshots: flat: 5.0.2 is-plain-obj: 2.1.0 - yargs@15.4.1: - dependencies: - cliui: 6.0.0 - decamelize: 1.2.0 - find-up: 4.1.0 - get-caller-file: 2.0.5 - require-directory: 2.1.1 - require-main-filename: 2.0.0 - set-blocking: 2.0.0 - string-width: 4.2.3 - which-module: 2.0.0 - y18n: 4.0.3 - yargs-parser: 18.1.3 - yargs@16.2.0: dependencies: cliui: 7.0.4 @@ -6824,16 +7185,6 @@ snapshots: y18n: 5.0.8 yargs-parser: 20.2.4 - yargs@17.7.2: - dependencies: - cliui: 8.0.1 - escalade: 3.1.1 - get-caller-file: 2.0.5 - require-directory: 2.1.1 - string-width: 4.2.3 - y18n: 5.0.8 - yargs-parser: 21.1.1 - yn@3.1.1: {} yocto-queue@0.1.0: {} diff --git a/contracts/remappings.txt b/contracts/remappings.txt index 1428f50b316..4ed0fcfd9a2 100644 --- a/contracts/remappings.txt +++ b/contracts/remappings.txt @@ -1,6 +1,8 @@ forge-std/=src/v0.8/vendor/forge-std/src/ @openzeppelin/=node_modules/@openzeppelin/ +@arbitrum/=node_modules/@arbitrum/ hardhat/=node_modules/hardhat/ @eth-optimism/=node_modules/@eth-optimism/ @scroll-tech/=node_modules/@scroll-tech/ +@zksync/=node_modules/@zksync/ diff --git a/contracts/scripts/ci/find_slither_report_diff.sh b/contracts/scripts/ci/find_slither_report_diff.sh new file mode 100755 index 00000000000..d0b5238a1ac --- /dev/null +++ b/contracts/scripts/ci/find_slither_report_diff.sh @@ -0,0 +1,94 @@ +#!/usr/bin/env bash + +set -euo pipefail + +if [[ "$#" -lt 4 ]]; then + >&2 echo "Generates a markdown file with diff in new issues detected by ChatGPT between two Slither reports." + >&2 echo "Usage: $0 [path-to-validation-prompt]" + exit 1 +fi + +if [[ -z "${OPEN_API_KEY+x}" ]]; then + >&2 echo "OPEN_API_KEY is not set." + exit 1 +fi + +first_report_path=$1 +second_report_path=$2 +new_issues_report_path=$3 +report_prompt_path=$4 +if [[ "$#" -eq 5 ]]; then + validation_prompt_path=$5 +else + validation_prompt_path="" +fi + +first_report_content=$(cat "$first_report_path" | sed 's/"//g' | sed -E 's/\\+$//g' | sed -E 's/\\+ //g') +second_report_content=$(cat "$second_report_path" | sed 's/"//g' | sed -E 's/\\+$//g' | sed -E 's/\\+ //g') +openai_prompt=$(cat "$report_prompt_path" | sed 's/"/\\"/g' | sed -E 's/\\+$//g' | sed -E 's/\\+ //g') +openai_model="gpt-4o-2024-05-13" +openai_result=$(echo '{ + "model": "'$openai_model'", + "temperature": 0.01, + "messages": [ + { + "role": "system", + "content": "'$openai_prompt' \nreport1:\n```'$first_report_content'```\nreport2:\n```'$second_report_content'```" + } + ] +}' | envsubst | curl https://api.openai.com/v1/chat/completions \ + -w "%{http_code}" \ + -o prompt_response.json \ + -H "Content-Type: application/json" \ + -H "Authorization: Bearer $OPEN_API_KEY" \ + -d @- +) + +# throw error openai_result when is not 200 +if [ "$openai_result" != '200' ]; then + echo "::error::OpenAI API call failed with status $openai_result: $(cat prompt_response.json)" + exit 1 +fi + +# replace lines starting with ' -' (1space) with ' -' (2spaces) +response_content=$(cat prompt_response.json | jq -r '.choices[0].message.content') +new_issues_report_content=$(echo "$response_content" | sed -e 's/^ -/ -/g') +echo "$new_issues_report_content" > "$new_issues_report_path" + +if [[ -n "$validation_prompt_path" ]]; then + echo "::debug::Validating the diff report using the validation prompt" + openai_model="gpt-4-turbo-2024-04-09" + report_input=$(echo "$new_issues_report_content" | sed 's/"//g' | sed -E 's/\\+$//g' | sed -E 's/\\+ //g') + validation_prompt_content=$(cat "$validation_prompt_path" | sed 's/"/\\"/g' | sed -E 's/\\+$//g' | sed -E 's/\\+ //g') + validation_result=$(echo '{ + "model": "'$openai_model'", + "temperature": 0.01, + "messages": [ + { + "role": "system", + "content": "'$validation_prompt_content' \nreport1:\n```'$first_report_content'```\nreport2:\n```'$second_report_content'```\nnew_issues:\n```'$report_input'```" + } + ] + }' | envsubst | curl https://api.openai.com/v1/chat/completions \ + -w "%{http_code}" \ + -o prompt_validation_response.json \ + -H "Content-Type: application/json" \ + -H "Authorization: Bearer $OPEN_API_KEY" \ + -d @- + ) + + # throw error openai_result when is not 200 + if [ "$validation_result" != '200' ]; then + echo "::error::OpenAI API call failed with status $validation_result: $(cat prompt_validation_response.json)" + exit 1 + fi + + # replace lines starting with ' -' (1space) with ' -' (2spaces) + response_content=$(cat prompt_validation_response.json | jq -r '.choices[0].message.content') + + echo "$response_content" | sed -e 's/^ -/ -/g' >> "$new_issues_report_path" + echo "" >> "$new_issues_report_path" + echo "*Confidence rating presented above is an automatic validation (self-check) of the differences between two reports generated by ChatGPT ${openai_model} model. It has a scale of 1 to 5, where 1 means that all new issues are missing and 5 that all new issues are present*." >> "$new_issues_report_path" + echo "" >> "$new_issues_report_path" + echo "*If confidence rating is low it's advised to look for differences manually by downloading Slither reports for base reference and current commit from job's artifacts*." >> "$new_issues_report_path" +fi diff --git a/contracts/scripts/ci/prompt-difference.md b/contracts/scripts/ci/prompt-difference.md new file mode 100644 index 00000000000..b7603c97482 --- /dev/null +++ b/contracts/scripts/ci/prompt-difference.md @@ -0,0 +1,21 @@ +You are a helpful expert data engineer with expertise in Blockchain and Decentralized Oracle Networks. + +Given two reports generated by Slither - a Solidity static analysis tool - provided at the bottom of the reply, your task is to help create a report for your peers with new issues introduced in the second report in order to decrease noise resulting from irrelevant changes to the report, by focusing on a single topic: **New Issues**. + +First report is provided under Heading 2 (##) called `report1` and is surrounded by triple backticks (```) to indicate the beginning and end of the report. +Second report is provided under Heading 2 (##) called `report2` and is surrounded by triple backticks (```) to indicate the beginning and end of the report. + +First report is report generated by Slither using default branch of the code repository. Second report is report generated by Slither using a feature branch of the code repository. You want to help your peers understand the impact of changes they introduced in the pull request on the codebase and whether they introduced any new issues. + +**New Issues** + +Provide a bullet point summary of new issues that were introduced in the second report. If a given issue is not present in first report, but is present in the second one, it is considered a new issue. If the count for given issue type is higher in the second report than in the first one, it is considered a new issue. +For each issue include original description text from the report together with severity level, issue ID, line number and a link to problematic line in the code. +Group the issues by their type, which is defined as Heading 2 (##). + +Output your response starting from**New Issues** in escaped, markdown text that can be sent as http body to API. Do not wrap output in code blocks. +Extract the name of the file from the first line of the report and title the new report with it in a following way: "# Slither's new issues in: " + +Remember that it might be possible that second report does not introduce any new issues. In such case, provide an empty report. + +Format **New Issues** as Heading 2 using double sharp characters (##). Otherwise, do not include any another preamble and postamble to your answer. diff --git a/contracts/scripts/ci/prompt-validation.md b/contracts/scripts/ci/prompt-validation.md new file mode 100644 index 00000000000..5fcf08e1462 --- /dev/null +++ b/contracts/scripts/ci/prompt-validation.md @@ -0,0 +1,33 @@ +You are a helpful expert data engineer with expertise in Blockchain and Decentralized Oracle Networks. + +At the bottom of the reply you will find two reports generated by Slither - a Solidity static analysis tool - and another report that contains new issues found in the second report. +Your task is to evaluate how well that new issues report shows all new issues mentioned in the second Slither report and assert its completeness. +Rate your confidence in the completeness of the new issues report on a scale from 1 to 5, where 1 means it's missing all new issues and 5 means that all new issues are present. + +First report is provided under Heading 2 (##) called `report1` and is surrounded by triple backticks (```) to indicate the beginning and end of the report. +Second report is provided under Heading 2 (##) called `report2` and is surrounded by triple backticks (```) to indicate the beginning and end of the report. +New issues report is provided under Heading 2 (##) called `new_issues` and is surrounded by triple backticks (```) to indicate the beginning and end of the report. + +Use the following steps to evaluate the new issues report: +* each report begins with a summary with types of issues found and number of issues found for each type, called "# Summary for " +* group issues by type and count for each report and calculate the expected difference in number of issues for each type for each report +* exclude all issue types, for which the count for is higher in the first report than in the second one +* for each remaining issue type, compare the number of issues found in the new issues report with the expected difference +* evaluate if the new issues report captures all new issues introduced in the second report + +Do not focus on: +* the quality of the Slither reports themselves, but rather on whether all new issues from the second report are present in the new issues report +* how well the new issues report is structured or written and how well it presents new issues + +It is crucial that you ignore all differences in the reports that are not related to new issues, such as resolved issues or issues, which count has decreased. + +If a given issue is not present in first report, but is present in the second one, it is considered a new issue. Similar behaviour is expected from the new issues report. +If the count for given issue type is higher in the second report than in the first one, it is considered a new issue. + +Your report should include only a single section titled "Confidence level". +Your evaluation of the completeness of the new issues report should be displayed as a Heading 3 using triple sharp characters (###). In a new line a brief explanation of the scale used, with minimum and maximum possible values. + +Remember that it might be possible that second report does not introduce any new issues. In such case, confidence rating should be 5. + +Output your response as escaped, markdown text that can be sent as http body to API. Do not wrap output in code blocks. Do not include any partial results or statistics regarding the number of new and resolved issues in any of the reports. +Format **Confidence level** as Heading 2 using double sharp characters (##). Otherwise, do not include any another preamble and postamble to your answer. diff --git a/contracts/scripts/generate-zksync-automation-master-interface-v2_3.ts b/contracts/scripts/generate-zksync-automation-master-interface-v2_3.ts new file mode 100644 index 00000000000..385d1fb45b7 --- /dev/null +++ b/contracts/scripts/generate-zksync-automation-master-interface-v2_3.ts @@ -0,0 +1,58 @@ +/** + * @description this script generates a master interface for interacting with the automation registry + * @notice run this script with pnpm ts-node ./scripts/generate-zksync-automation-master-interface-v2_3.ts + */ +import { ZKSyncAutomationRegistry2_3__factory as Registry } from '../typechain/factories/ZKSyncAutomationRegistry2_3__factory' +import { ZKSyncAutomationRegistryLogicA2_3__factory as RegistryLogicA } from '../typechain/factories/ZKSyncAutomationRegistryLogicA2_3__factory' +import { ZKSyncAutomationRegistryLogicB2_3__factory as RegistryLogicB } from '../typechain/factories/ZKSyncAutomationRegistryLogicB2_3__factory' +import { ZKSyncAutomationRegistryLogicC2_3__factory as RegistryLogicC } from '../typechain/factories/ZKSyncAutomationRegistryLogicC2_3__factory' +import { utils } from 'ethers' +import fs from 'fs' +import { exec } from 'child_process' + +const dest = 'src/v0.8/automation/interfaces/zksync' +const srcDest = `${dest}/IZKSyncAutomationRegistryMaster2_3.sol` +const tmpDest = `${dest}/tmp.txt` + +const combinedABI = [] +const abiSet = new Set() +const abis = [ + Registry.abi, + RegistryLogicA.abi, + RegistryLogicB.abi, + RegistryLogicC.abi, +] + +for (const abi of abis) { + for (const entry of abi) { + const id = utils.id(JSON.stringify(entry)) + if (!abiSet.has(id)) { + abiSet.add(id) + if ( + entry.type === 'function' && + (entry.name === 'checkUpkeep' || + entry.name === 'checkCallback' || + entry.name === 'simulatePerformUpkeep') + ) { + entry.stateMutability = 'view' // override stateMutability for check / callback / simulate functions + } + combinedABI.push(entry) + } + } +} + +const checksum = utils.id(abis.join('')) + +fs.writeFileSync(`${tmpDest}`, JSON.stringify(combinedABI)) + +const cmd = ` +cat ${tmpDest} | pnpm abi-to-sol --solidity-version ^0.8.19 --license MIT > ${srcDest} IZKSyncAutomationRegistryMaster2_3; +echo "// solhint-disable \n// abi-checksum: ${checksum}" | cat - ${srcDest} > ${tmpDest} && mv ${tmpDest} ${srcDest}; +pnpm prettier --write ${srcDest}; +` + +exec(cmd) + +console.log( + 'generated new master interface for zksync automation registry v2_3', +) diff --git a/contracts/scripts/lcov_prune b/contracts/scripts/lcov_prune new file mode 100755 index 00000000000..0f16715cb2e --- /dev/null +++ b/contracts/scripts/lcov_prune @@ -0,0 +1,77 @@ +#!/bin/bash + +if [ "$#" -ne 3 ]; then + >&2 echo "Usage: $0 " + exit 1 +fi + +set -e + +product_name=$1 +input_coverage_file=$2 +output_coverage_file=$3 + +# src/v0.8/ccip/libraries/Internal.sol +# src/v0.8/ccip/libraries/RateLimiter.sol +# src/v0.8/ccip/libraries/USDPriceWith18Decimals.sol +# src/v0.8/ccip/libraries/MerkleMultiProof.sol +# src/v0.8/ccip/libraries/Pool.sol +# excluded because Foundry doesn't support coverage on library files + +# BurnWithFromMintTokenPool is excluded because Forge doesn't seem to +# register coverage, even though it is 100% covered. +exclusion_list_ccip=( + "src/v0.8/ccip/ocr/OCR2Abstract.sol" + "src/v0.8/ccip/libraries/Internal.sol" + "src/v0.8/ccip/libraries/RateLimiter.sol" + "src/v0.8/ccip/libraries/USDPriceWith18Decimals.sol" + "src/v0.8/ccip/libraries/MerkleMultiProof.sol" + "src/v0.8/ccip/libraries/Pool.sol" + "src/v0.8/ConfirmedOwnerWithProposal.sol" + "src/v0.8/tests/MockV3Aggregator.sol" + "src/v0.8/ccip/applications/CCIPClientExample.sol" + "src/v0.8/ccip/pools/BurnWithFromMintTokenPool.sol" +) + +exclusion_list_shared=( + "*/shared/*" +) + +exclusion_list_common=( + "*/$product_name/test/*" + "*/vendor/*" +) + +all_exclusions=() + +case "$product_name" in + "ccip") + all_exclusions+=("${exclusion_list_ccip[@]}") + ;; + "shared") + # No product-specific exclusions for shared + ;; + *) + ;; +esac + +all_exclusions+=("${exclusion_list_common[@]}") + +if [ "$product_name" != "shared" ]; then + all_exclusions+=("${exclusion_list_shared[@]}") +fi + +echo "Excluding the following files for product $product_name:" +for exclusion in "${all_exclusions[@]}"; do + echo "$exclusion" +done + +lcov_command="lcov --remove $input_coverage_file -o $output_coverage_file" + +for exclusion in "${all_exclusions[@]}"; do + lcov_command+=" \"$exclusion\"" +done + +lcov_command+=" --rc lcov_branch_coverage=1" + +eval $lcov_command diff --git a/contracts/scripts/native_solc_compile_all b/contracts/scripts/native_solc_compile_all index 542337a191a..6e9f17561dd 100755 --- a/contracts/scripts/native_solc_compile_all +++ b/contracts/scripts/native_solc_compile_all @@ -12,7 +12,7 @@ python3 -m pip install --require-hashes -r $SCRIPTPATH/requirements.txt # 6 and 7 are legacy contracts, for each other product we have a native_solc_compile_all_$product script # These scripts can be run individually, or all together with this script. # To add new CL products, simply write a native_solc_compile_all_$product script and add it to the list below. -for product in automation events_mock feeds functions keystone llo-feeds logpoller operatorforwarder shared transmission vrf +for product in automation events_mock feeds functions keystone llo-feeds logpoller operatorforwarder shared transmission vrf ccip liquiditymanager do $SCRIPTPATH/native_solc_compile_all_$product done diff --git a/contracts/scripts/native_solc_compile_all_automation b/contracts/scripts/native_solc_compile_all_automation index f144e4f7dc8..e189e78cb0f 100755 --- a/contracts/scripts/native_solc_compile_all_automation +++ b/contracts/scripts/native_solc_compile_all_automation @@ -93,7 +93,7 @@ compileContract automation/v2_2/AutomationUtils2_2.sol compileContract automation/interfaces/v2_2/IAutomationRegistryMaster.sol compileContract automation/chains/ArbitrumModule.sol compileContract automation/chains/ChainModuleBase.sol -compileContract automation/chains/OptimismModule.sol +compileContract automation/chains/OptimismModuleV2.sol compileContract automation/chains/ScrollModule.sol compileContract automation/interfaces/IChainModule.sol compileContract automation/interfaces/IAutomationV21PlusCommon.sol @@ -108,4 +108,4 @@ compileContract automation/v2_3/AutomationUtils2_3.sol compileContract automation/interfaces/v2_3/IAutomationRegistryMaster2_3.sol compileContract automation/testhelpers/MockETHUSDAggregator.sol -compileContract automation/test/v2_3/WETH9.sol +compileContract automation/test/WETH9.sol diff --git a/contracts/scripts/native_solc_compile_all_ccip b/contracts/scripts/native_solc_compile_all_ccip new file mode 100755 index 00000000000..6a6226a4ad1 --- /dev/null +++ b/contracts/scripts/native_solc_compile_all_ccip @@ -0,0 +1,105 @@ +#!/usr/bin/env bash + +set -e + +echo " ┌──────────────────────────────────────────────┐" +echo " │ Compiling CCIP contracts... │" +echo " └──────────────────────────────────────────────┘" + +SOLC_VERSION="0.8.24" +OPTIMIZE_RUNS=26000 +OPTIMIZE_RUNS_OFFRAMP=18000 +OPTIMIZE_RUNS_ONRAMP=4100 +OPTIMIZE_RUNS_MULTI_OFFRAMP=1999 + + +SCRIPTPATH="$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )" +python3 -m pip install --require-hashes -r "$SCRIPTPATH"/requirements.txt +solc-select install $SOLC_VERSION +solc-select use $SOLC_VERSION +export SOLC_VERSION=$SOLC_VERSION + +ROOT="$( cd "$(dirname "$0")" >/dev/null 2>&1 ; cd ../../ && pwd -P )" + +compileContract () { + local contract + contract=$(basename "$1" ".sol") + + local optimize_runs=$OPTIMIZE_RUNS + + case $1 in + "ccip/offRamp/EVM2EVMOffRamp.sol") + echo "OffRamp uses $OPTIMIZE_RUNS_OFFRAMP optimizer runs." + optimize_runs=$OPTIMIZE_RUNS_OFFRAMP + ;; + "ccip/offRamp/OffRamp.sol") + echo "MultiOffRamp uses $OPTIMIZE_RUNS_MULTI_OFFRAMP optimizer runs." + optimize_runs=$OPTIMIZE_RUNS_MULTI_OFFRAMP + ;; + "ccip/onRamp/EVM2EVMOnRamp.sol") + echo "OnRamp uses $OPTIMIZE_RUNS_ONRAMP optimizer runs." + optimize_runs=$OPTIMIZE_RUNS_ONRAMP + ;; + esac + + solc --overwrite --optimize --optimize-runs $optimize_runs --metadata-hash none \ + -o "$ROOT"/contracts/solc/v$SOLC_VERSION/"$contract" \ + --abi --bin --allow-paths "$ROOT"/contracts/src/v0.8 \ + --bin-runtime --hashes --metadata --metadata-literal --combined-json abi,hashes,metadata,srcmap,srcmap-runtime \ + --evm-version paris \ + "$ROOT"/contracts/src/v0.8/"$1" +} + + +# Solc produces and overwrites intermediary contracts. +# Contracts should be ordered in reverse-import-complexity-order to minimize overwrite risks. +compileContract ccip/offRamp/EVM2EVMOffRamp.sol +compileContract ccip/offRamp/OffRamp.sol +compileContract ccip/rmn/RMNRemote.sol +compileContract ccip/applications/PingPongDemo.sol +compileContract ccip/applications/SelfFundedPingPong.sol +compileContract ccip/applications/EtherSenderReceiver.sol +compileContract ccip/onRamp/OnRamp.sol +compileContract ccip/onRamp/EVM2EVMOnRamp.sol +compileContract ccip/CommitStore.sol +compileContract ccip/MultiAggregateRateLimiter.sol +compileContract ccip/Router.sol +compileContract ccip/FeeQuoter.sol +compileContract ccip/RMN.sol +compileContract ccip/ARMProxy.sol +compileContract ccip/tokenAdminRegistry/TokenAdminRegistry.sol +compileContract ccip/tokenAdminRegistry/RegistryModuleOwnerCustom.sol +compileContract ccip/capability/CCIPConfig.sol +compileContract ccip/capability/interfaces/IOCR3ConfigEncoder.sol +compileContract ccip/NonceManager.sol +compileContract shared/token/ERC677/BurnMintERC677.sol + + +# Pools +compileContract ccip/pools/LockReleaseTokenPool.sol +compileContract ccip/pools/BurnMintTokenPool.sol +compileContract ccip/pools/BurnFromMintTokenPool.sol +compileContract ccip/pools/BurnWithFromMintTokenPool.sol +compileContract ccip/pools/LockReleaseTokenPoolAndProxy.sol +compileContract ccip/pools/BurnMintTokenPoolAndProxy.sol +compileContract ccip/pools/BurnWithFromMintTokenPoolAndProxy.sol +compileContract ccip/pools/TokenPool.sol + + +# Test helpers +compileContract ccip/test/helpers/BurnMintERC677Helper.sol +compileContract ccip/test/helpers/CommitStoreHelper.sol +compileContract ccip/test/helpers/MessageHasher.sol +compileContract ccip/test/helpers/CCIPReaderTester.sol +compileContract ccip/test/helpers/USDCReaderTester.sol +compileContract ccip/test/helpers/ReportCodec.sol +compileContract ccip/test/helpers/receivers/MaybeRevertMessageReceiver.sol +compileContract ccip/test/helpers/MultiOCR3Helper.sol +compileContract ccip/test/mocks/MockE2EUSDCTokenMessenger.sol +compileContract ccip/test/mocks/MockE2EUSDCTransmitter.sol +compileContract ccip/test/WETH9.sol + +# Customer contracts +compileContract ccip/pools/USDC/USDCTokenPool.sol + +compileContract tests/MockV3Aggregator.sol diff --git a/contracts/scripts/native_solc_compile_all_keystone b/contracts/scripts/native_solc_compile_all_keystone index 0516b2aedb0..a42b06b8f67 100755 --- a/contracts/scripts/native_solc_compile_all_keystone +++ b/contracts/scripts/native_solc_compile_all_keystone @@ -32,3 +32,4 @@ compileContract () { compileContract keystone/CapabilitiesRegistry.sol compileContract keystone/KeystoneForwarder.sol compileContract keystone/OCR3Capability.sol +compileContract keystone/KeystoneFeedsConsumer.sol diff --git a/contracts/scripts/native_solc_compile_all_l2ep b/contracts/scripts/native_solc_compile_all_l2ep index 1b9f5fb611d..1f671158068 100755 --- a/contracts/scripts/native_solc_compile_all_l2ep +++ b/contracts/scripts/native_solc_compile_all_l2ep @@ -1,59 +1,38 @@ #!/usr/bin/env bash -########### -# Logging # -########### - set -e echo " ┌──────────────────────────────────────────────┐" echo " │ Compiling L2EP contracts... │" echo " └──────────────────────────────────────────────┘" -###################### -# Helper Variable(s) # -###################### - -export SOLC_VERSION="0.8.19" +SOLC_VERSION="0.8.24" +OPTIMIZE_RUNS=1000000 -SCRIPTPATH="$( - cd "$(dirname "$0")" >/dev/null 2>&1 - pwd -P -)" +SCRIPTPATH="$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )" +python3 -m pip install --require-hashes -r $SCRIPTPATH/requirements.txt +solc-select install $SOLC_VERSION +solc-select use $SOLC_VERSION ROOT="$( cd "$(dirname "$0")" >/dev/null 2>&1 cd ../ && pwd -P )" -###################### -# Helper Function(s) # -###################### - compileContract() { - local optimize_runs=1000000 local version="$1" local srcpath="$2" solc \ @openzeppelin/=$ROOT/node_modules/@openzeppelin/ \ @eth-optimism/=$ROOT/node_modules/@eth-optimism/ \ @scroll-tech/=$ROOT/node_modules/@scroll-tech/ \ - --overwrite --optimize --optimize-runs $optimize_runs --metadata-hash none \ + --overwrite --optimize --optimize-runs $OPTIMIZE_RUNS --metadata-hash none \ -o $ROOT/solc/v$SOLC_VERSION/l2ep/"$version" \ - --abi --bin \ - --allow-paths $ROOT/src/v0.8,$ROOT/node_modules \ + --abi --bin --allow-paths $ROOT/src/v0.8,$ROOT/node_modules \ + --evm-version paris \ $ROOT/src/v0.8/l2ep/"$srcpath" } -################# -# Version 1.0.0 # -################# - -python3 -m pip install --require-hashes -r $SCRIPTPATH/requirements.txt - -solc-select install $SOLC_VERSION -solc-select use $SOLC_VERSION - compileContract v1_0_0 dev/arbitrum/ArbitrumValidator.sol compileContract v1_0_0 dev/arbitrum/ArbitrumSequencerUptimeFeed.sol compileContract v1_0_0 dev/arbitrum/ArbitrumCrossDomainForwarder.sol diff --git a/contracts/scripts/native_solc_compile_all_liquiditymanager b/contracts/scripts/native_solc_compile_all_liquiditymanager new file mode 100755 index 00000000000..a29f041c77b --- /dev/null +++ b/contracts/scripts/native_solc_compile_all_liquiditymanager @@ -0,0 +1,67 @@ +#!/usr/bin/env bash + +set -e + +echo " ┌──────────────────────────────────────────────┐" +echo " │ Compiling LiquidityManager contracts... │" +echo " └──────────────────────────────────────────────┘" + +SOLC_VERSION="0.8.24" +OPTIMIZE_RUNS=1000000 + + +SCRIPTPATH="$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )" +python3 -m pip install --require-hashes -r "$SCRIPTPATH"/requirements.txt +solc-select install $SOLC_VERSION +solc-select use $SOLC_VERSION +export SOLC_VERSION=$SOLC_VERSION + +ROOT="$( cd "$(dirname "$0")" >/dev/null 2>&1 ; cd ../../ && pwd -P )" + +compileContract () { + local contract + contract=$(basename "$1" ".sol") + + solc @arbitrum/="$ROOT"/contracts/node_modules/@arbitrum/ \ + @eth-optimism/="$ROOT"/contracts/node_modules/@eth-optimism/ \ + @openzeppelin/="$ROOT"/contracts/node_modules/@openzeppelin/ \ + --overwrite --optimize --optimize-runs $OPTIMIZE_RUNS --metadata-hash none \ + -o "$ROOT"/contracts/solc/v$SOLC_VERSION/"$contract" \ + --abi --bin --allow-paths "$ROOT"/contracts/src/v0.8,"$ROOT"/contracts/node_modules \ + --evm-version paris \ + "$ROOT"/contracts/src/v0.8/"$1" +} + + +# Liquidity Management +compileContract liquiditymanager/LiquidityManager.sol +compileContract liquiditymanager/bridge-adapters/ArbitrumL1BridgeAdapter.sol +compileContract liquiditymanager/bridge-adapters/ArbitrumL2BridgeAdapter.sol +compileContract liquiditymanager/bridge-adapters/OptimismL1BridgeAdapter.sol +compileContract liquiditymanager/bridge-adapters/OptimismL2BridgeAdapter.sol +compileContract liquiditymanager/test/mocks/NoOpOCR3.sol +compileContract liquiditymanager/test/mocks/MockBridgeAdapter.sol +compileContract liquiditymanager/test/helpers/ReportEncoder.sol + +# Arbitrum helpers +compileContract liquiditymanager/interfaces/arbitrum/IArbSys.sol +compileContract liquiditymanager/interfaces/arbitrum/INodeInterface.sol +compileContract liquiditymanager/interfaces/arbitrum/IL2ArbitrumGateway.sol +compileContract liquiditymanager/interfaces/arbitrum/IL2ArbitrumMessenger.sol +compileContract liquiditymanager/interfaces/arbitrum/IArbRollupCore.sol +compileContract liquiditymanager/interfaces/arbitrum/IArbitrumL1GatewayRouter.sol +compileContract liquiditymanager/interfaces/arbitrum/IArbitrumInbox.sol +compileContract liquiditymanager/interfaces/arbitrum/IArbitrumGatewayRouter.sol +compileContract liquiditymanager/interfaces/arbitrum/IArbitrumTokenGateway.sol +compileContract liquiditymanager/interfaces/arbitrum/IAbstractArbitrumTokenGateway.sol + +# Optimism helpers +compileContract liquiditymanager/interfaces/optimism/IOptimismPortal.sol +compileContract liquiditymanager/interfaces/optimism/IOptimismL2OutputOracle.sol +compileContract liquiditymanager/interfaces/optimism/IOptimismL2ToL1MessagePasser.sol +compileContract liquiditymanager/interfaces/optimism/IOptimismCrossDomainMessenger.sol +compileContract liquiditymanager/interfaces/optimism/IOptimismPortal2.sol +compileContract liquiditymanager/interfaces/optimism/IOptimismDisputeGameFactory.sol +compileContract liquiditymanager/interfaces/optimism/IOptimismStandardBridge.sol +compileContract liquiditymanager/interfaces/optimism/IOptimismL1StandardBridge.sol +compileContract liquiditymanager/encoders/OptimismL1BridgeAdapterEncoder.sol diff --git a/contracts/scripts/native_solc_compile_all_llo-feeds b/contracts/scripts/native_solc_compile_all_llo-feeds index eb17f93b0de..ba5e6a4c8b9 100755 --- a/contracts/scripts/native_solc_compile_all_llo-feeds +++ b/contracts/scripts/native_solc_compile_all_llo-feeds @@ -28,17 +28,17 @@ compileContract () { "$ROOT"/contracts/src/v0.8/"$1" } -compileContract llo-feeds/Verifier.sol -compileContract llo-feeds/VerifierProxy.sol -compileContract llo-feeds/FeeManager.sol -compileContract llo-feeds/RewardManager.sol - +compileContract llo-feeds/v0.3.0/Verifier.sol +compileContract llo-feeds/v0.3.0/VerifierProxy.sol +compileContract llo-feeds/v0.3.0/FeeManager.sol +compileContract llo-feeds/v0.3.0/RewardManager.sol +compileContract llo-feeds/v0.4.0/DestinationVerifier.sol +compileContract llo-feeds/v0.4.0/DestinationVerifierProxy.sol +compileContract llo-feeds/v0.4.0/DestinationFeeManager.sol +compileContract llo-feeds/v0.4.0/DestinationRewardManager.sol +compileContract llo-feeds/v0.5.0/configuration/ChannelConfigStore.sol +compileContract llo-feeds/v0.5.0/configuration/Configurator.sol # Test | Mocks -compileContract llo-feeds/test/mocks/ErroredVerifier.sol -compileContract llo-feeds/test/mocks/ExposedVerifier.sol - -# LLO -compileContract llo-feeds/dev/ChannelConfigStore.sol -compileContract llo-feeds/dev/ChannelVerifier.sol -compileContract llo-feeds/dev/test/mocks/ExposedChannelVerifier.sol +compileContract llo-feeds/v0.3.0/test/mocks/ErroredVerifier.sol +compileContract llo-feeds/v0.3.0/test/mocks/ExposedVerifier.sol diff --git a/contracts/scripts/native_solc_compile_all_vrf b/contracts/scripts/native_solc_compile_all_vrf index 4bfd4ecac72..88e7b3e1471 100755 --- a/contracts/scripts/native_solc_compile_all_vrf +++ b/contracts/scripts/native_solc_compile_all_vrf @@ -114,6 +114,7 @@ compileContract vrf/dev/testhelpers/VRFV2PlusWrapperConsumerExample.sol compileContract vrf/dev/testhelpers/VRFV2PlusRevertingExample.sol compileContract vrf/dev/testhelpers/VRFConsumerV2PlusUpgradeableExample.sol compileContract vrf/dev/testhelpers/VRFV2PlusMaliciousMigrator.sol +compileContractAltOpts vrf/dev/testhelpers/VRFCoordinatorTestV2_5.sol 500 compileContract vrf/dev/libraries/VRFV2PlusClient.sol compileContract vrf/dev/testhelpers/VRFCoordinatorV2Plus_V2Example.sol compileContract vrf/dev/TrustedBlockhashStore.sol diff --git a/contracts/src/v0.8/automation/ZKSyncAutomationForwarder.sol b/contracts/src/v0.8/automation/ZKSyncAutomationForwarder.sol new file mode 100644 index 00000000000..f4616ba1322 --- /dev/null +++ b/contracts/src/v0.8/automation/ZKSyncAutomationForwarder.sol @@ -0,0 +1,107 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.19; + +import {IAutomationRegistryConsumer} from "./interfaces/IAutomationRegistryConsumer.sol"; +import {GAS_BOUND_CALLER, IGasBoundCaller} from "./interfaces/zksync/IGasBoundCaller.sol"; + +uint256 constant PERFORM_GAS_CUSHION = 50_000; + +/** + * @title ZKSyncAutomationForwarder is a relayer that sits between the registry and the customer's target contract + * @dev The purpose of the forwarder is to give customers a consistent address to authorize against, + * which stays consistent between migrations. The Forwarder also exposes the registry address, so that users who + * want to programmatically interact with the registry (ie top up funds) can do so. + */ +contract ZKSyncAutomationForwarder { + error InvalidCaller(address); + + /// @notice the user's target contract address + address private immutable i_target; + + /// @notice the shared logic address + address private immutable i_logic; + + IAutomationRegistryConsumer private s_registry; + + constructor(address target, address registry, address logic) { + s_registry = IAutomationRegistryConsumer(registry); + i_target = target; + i_logic = logic; + } + + /** + * @notice forward is called by the registry and forwards the call to the target + * @param gasAmount is the amount of gas to use in the call + * @param data is the 4 bytes function selector + arbitrary function data + * @return success indicating whether the target call succeeded or failed + * @return gasUsed the total gas used from this forwarding call + */ + function forward(uint256 gasAmount, bytes memory data) external returns (bool success, uint256 gasUsed) { + if (msg.sender != address(s_registry)) revert InvalidCaller(msg.sender); + + uint256 g1 = gasleft(); + address target = i_target; + + assembly { + let g := gas() + // Compute g -= PERFORM_GAS_CUSHION and check for underflow + if lt(g, PERFORM_GAS_CUSHION) { + revert(0, 0) + } + g := sub(g, PERFORM_GAS_CUSHION) + // if g - g//64 <= gasAmount, revert + // (we subtract g//64 because of EIP-150) + if iszero(gt(sub(g, div(g, 64)), gasAmount)) { + revert(0, 0) + } + // solidity calls check that a contract actually exists at the destination, so we do the same + if iszero(extcodesize(target)) { + revert(0, 0) + } + } + + bytes memory returnData; + // solhint-disable-next-line avoid-low-level-calls + (success, returnData) = GAS_BOUND_CALLER.delegatecall{gas: gasAmount}( + abi.encodeWithSelector(IGasBoundCaller.gasBoundCall.selector, target, gasAmount, data) + ); + uint256 pubdataGasSpent; + if (success) { + (, pubdataGasSpent) = abi.decode(returnData, (bytes, uint256)); + } + gasUsed = g1 - gasleft() + pubdataGasSpent; + return (success, gasUsed); + } + + function getTarget() external view returns (address) { + return i_target; + } + + // solhint-disable-next-line no-complex-fallback + fallback() external payable { + // copy to memory for assembly access + address logic = i_logic; + // copied directly from OZ's Proxy contract + assembly { + // Copy msg.data. We take full control of memory in this inline assembly + // block because it will not return to Solidity code. We overwrite the + // Solidity scratch pad at memory position 0. + calldatacopy(0, 0, calldatasize()) + + // out and outsize are 0 because we don't know the size yet. + let result := delegatecall(gas(), logic, 0, calldatasize(), 0, 0) + + // Copy the returned data. + returndatacopy(0, 0, returndatasize()) + + switch result + // delegatecall returns 0 on error. + case 0 { + revert(0, returndatasize()) + } + default { + return(0, returndatasize()) + } + } + } +} diff --git a/contracts/src/v0.8/automation/chains/ArbitrumModule.sol b/contracts/src/v0.8/automation/chains/ArbitrumModule.sol index e27a0809b7e..2ad6fdddc8c 100644 --- a/contracts/src/v0.8/automation/chains/ArbitrumModule.sol +++ b/contracts/src/v0.8/automation/chains/ArbitrumModule.sol @@ -31,7 +31,7 @@ contract ArbitrumModule is ChainModuleBase { return ARB_SYS.arbBlockNumber(); } - function getCurrentL1Fee() external view override returns (uint256) { + function getCurrentL1Fee(uint256) external view override returns (uint256) { return ARB_GAS.getCurrentTxL1GasFees(); } diff --git a/contracts/src/v0.8/automation/chains/ChainModuleBase.sol b/contracts/src/v0.8/automation/chains/ChainModuleBase.sol index e9b082063bb..c595dbd6408 100644 --- a/contracts/src/v0.8/automation/chains/ChainModuleBase.sol +++ b/contracts/src/v0.8/automation/chains/ChainModuleBase.sol @@ -18,11 +18,11 @@ contract ChainModuleBase is IChainModule { return blockhash(n); } - function getCurrentL1Fee() external view virtual returns (uint256) { + function getCurrentL1Fee(uint256) external view virtual returns (uint256 l1Fee) { return 0; } - function getMaxL1Fee(uint256) external view virtual returns (uint256) { + function getMaxL1Fee(uint256) external view virtual returns (uint256 maxL1Fee) { return 0; } diff --git a/contracts/src/v0.8/automation/chains/OptimismModule.sol b/contracts/src/v0.8/automation/chains/OptimismModule.sol index 91c1c0ed968..7a464294963 100644 --- a/contracts/src/v0.8/automation/chains/OptimismModule.sol +++ b/contracts/src/v0.8/automation/chains/OptimismModule.sol @@ -4,6 +4,10 @@ pragma solidity 0.8.19; import {OVM_GasPriceOracle} from "../../vendor/@eth-optimism/contracts/v0.8.9/contracts/L2/predeploys/OVM_GasPriceOracle.sol"; import {ChainModuleBase} from "./ChainModuleBase.sol"; +/** + * @notice This contract is deprecated. Please use OptimismModuleV2 which utilizes the most recent offerings from OP + * and can estimate L1 fee with much lower cost. + */ contract OptimismModule is ChainModuleBase { /// @dev OP_L1_DATA_FEE_PADDING includes 80 bytes for L1 data padding for Optimism and BASE bytes private constant OP_L1_DATA_FEE_PADDING = @@ -16,11 +20,22 @@ contract OptimismModule is ChainModuleBase { uint256 private constant FIXED_GAS_OVERHEAD = 60_000; uint256 private constant PER_CALLDATA_BYTE_GAS_OVERHEAD = 270; - function getCurrentL1Fee() external view override returns (uint256) { - return OVM_GASPRICEORACLE.getL1Fee(bytes.concat(msg.data, OP_L1_DATA_FEE_PADDING)); + // @dev This will be updated to use the new function introduced by OP team + function getCurrentL1Fee(uint256 dataSize) external view override returns (uint256) { + return _getL1Fee(dataSize); } function getMaxL1Fee(uint256 dataSize) external view override returns (uint256) { + return _getL1Fee(dataSize); + } + + /* @notice this function provides an estimation for L1 fee incurred by calldata of a certain size + * @dev this function uses the getL1Fee function in OP gas price oracle. it estimates the exact L1 fee but it costs + * a lot of gas to call. + * @param dataSize the size of calldata + * @return l1Fee the L1 fee + */ + function _getL1Fee(uint256 dataSize) internal view returns (uint256) { // fee is 4 per 0 byte, 16 per non-zero byte. Worst case we can have all non zero-bytes. // Instead of setting bytes to non-zero, we initialize 'new bytes' of length 4*dataSize to cover for zero bytes. bytes memory txCallData = new bytes(4 * dataSize); diff --git a/contracts/src/v0.8/automation/chains/OptimismModuleV2.sol b/contracts/src/v0.8/automation/chains/OptimismModuleV2.sol new file mode 100644 index 00000000000..772b66cdf99 --- /dev/null +++ b/contracts/src/v0.8/automation/chains/OptimismModuleV2.sol @@ -0,0 +1,78 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.19; + +import {GasPriceOracle as OVM_GasPriceOracle} from "../../vendor/@eth-optimism/contracts-bedrock/v0.17.3/src/L2/GasPriceOracle.sol"; +import {ChainModuleBase} from "./ChainModuleBase.sol"; +import {ConfirmedOwner} from "../../shared/access/ConfirmedOwner.sol"; + +/** + * @notice OptimismModuleV2 provides a cost-efficient way to get L1 fee on OP stack. + * After EIP-4844 is implemented in OP stack, the new OP upgrade includes a new function getL1FeeUpperBound to estimate + * the upper bound of current transaction's L1 fee. + */ +contract OptimismModuleV2 is ChainModuleBase, ConfirmedOwner { + error InvalidL1FeeCoefficient(uint8 coefficient); + event L1FeeCoefficientSet(uint8 coefficient); + + /// @dev OVM_GASPRICEORACLE_ADDR is the address of the OVM_GasPriceOracle precompile on Optimism. + /// @dev reference: https://community.optimism.io/docs/developers/build/transaction-fees/#estimating-the-l1-data-fee + address private constant OVM_GASPRICEORACLE_ADDR = address(0x420000000000000000000000000000000000000F); + OVM_GasPriceOracle private constant OVM_GASPRICEORACLE = OVM_GasPriceOracle(OVM_GASPRICEORACLE_ADDR); + + /// @dev L1 fee coefficient is used to account for the impact of data compression on the l1 fee + /// getL1FeeUpperBound returns the upper bound of l1 fee so this configurable coefficient will help + /// charge a predefined percentage of the upper bound. + uint8 private s_l1FeeCoefficient = 100; + uint256 private constant FIXED_GAS_OVERHEAD = 28_000; + uint256 private constant PER_CALLDATA_BYTE_GAS_OVERHEAD = 0; + + constructor() ConfirmedOwner(msg.sender) {} + + function getCurrentL1Fee(uint256 dataSize) external view override returns (uint256) { + return (s_l1FeeCoefficient * _getL1Fee(dataSize)) / 100; + } + + function getMaxL1Fee(uint256 dataSize) external view override returns (uint256) { + return _getL1Fee(dataSize); + } + + /* @notice this function provides an estimation for L1 fee incurred by calldata of a certain size + * @dev this function uses the newly provided getL1FeeUpperBound function in OP gas price oracle. this helps + * estimate L1 fee with much lower cost + * @param dataSize the size of calldata + * @return l1Fee the L1 fee + */ + function _getL1Fee(uint256 dataSize) internal view returns (uint256) { + return OVM_GASPRICEORACLE.getL1FeeUpperBound(dataSize); + } + + function getGasOverhead() + external + pure + override + returns (uint256 chainModuleFixedOverhead, uint256 chainModulePerByteOverhead) + { + return (FIXED_GAS_OVERHEAD, PER_CALLDATA_BYTE_GAS_OVERHEAD); + } + + /* @notice this function sets a new coefficient for L1 fee estimation. + * @dev this function can only be invoked by contract owner + * @param coefficient the new coefficient + */ + function setL1FeeCalculation(uint8 coefficient) external onlyOwner { + if (coefficient > 100) { + revert InvalidL1FeeCoefficient(coefficient); + } + + s_l1FeeCoefficient = coefficient; + + emit L1FeeCoefficientSet(coefficient); + } + + /* @notice this function returns the s_l1FeeCoefficient + * @return coefficient the current s_l1FeeCoefficient in effect + */ + function getL1FeeCoefficient() public view returns (uint256 coefficient) { + return s_l1FeeCoefficient; + } +} diff --git a/contracts/src/v0.8/automation/chains/ScrollModule.sol b/contracts/src/v0.8/automation/chains/ScrollModule.sol index 1e41ed3805f..30fdc908d49 100644 --- a/contracts/src/v0.8/automation/chains/ScrollModule.sol +++ b/contracts/src/v0.8/automation/chains/ScrollModule.sol @@ -3,8 +3,12 @@ pragma solidity 0.8.19; import {IScrollL1GasPriceOracle} from "../../vendor/@scroll-tech/contracts/src/L2/predeploys/IScrollL1GasPriceOracle.sol"; import {ChainModuleBase} from "./ChainModuleBase.sol"; +import {ConfirmedOwner} from "../../shared/access/ConfirmedOwner.sol"; + +contract ScrollModule is ChainModuleBase, ConfirmedOwner { + error InvalidL1FeeCoefficient(uint8 coefficient); + event L1FeeCoefficientSet(uint8 coefficient); -contract ScrollModule is ChainModuleBase { /// @dev SCROLL_L1_FEE_DATA_PADDING includes 140 bytes for L1 data padding for Scroll /// @dev according to testing, this padding allows automation registry to properly estimates L1 data fee with 3-5% buffer /// @dev this MAY NOT work for a different product and this may get out of date if transmit function is changed @@ -15,14 +19,26 @@ contract ScrollModule is ChainModuleBase { address private constant SCROLL_ORACLE_ADDR = 0x5300000000000000000000000000000000000002; IScrollL1GasPriceOracle private constant SCROLL_ORACLE = IScrollL1GasPriceOracle(SCROLL_ORACLE_ADDR); + /// @dev L1 fee coefficient can be applied to reduce possibly inflated gas cost + uint8 private s_l1FeeCoefficient = 100; uint256 private constant FIXED_GAS_OVERHEAD = 45_000; uint256 private constant PER_CALLDATA_BYTE_GAS_OVERHEAD = 170; - function getCurrentL1Fee() external view override returns (uint256) { - return SCROLL_ORACLE.getL1Fee(bytes.concat(msg.data, SCROLL_L1_FEE_DATA_PADDING)); + constructor() ConfirmedOwner(msg.sender) {} + + function getCurrentL1Fee(uint256 dataSize) external view override returns (uint256) { + return (s_l1FeeCoefficient * _getL1Fee(dataSize)) / 100; } function getMaxL1Fee(uint256 dataSize) external view override returns (uint256) { + return _getL1Fee(dataSize); + } + + /* @notice this function provides an estimation for L1 fee incurred by calldata of a certain size + * @param dataSize the size of calldata + * @return l1Fee the L1 fee + */ + function _getL1Fee(uint256 dataSize) internal view returns (uint256 l1Fee) { // fee is 4 per 0 byte, 16 per non-zero byte. Worst case we can have all non zero-bytes. // Instead of setting bytes to non-zero, we initialize 'new bytes' of length 4*dataSize to cover for zero bytes. // this is the same as OP. @@ -38,4 +54,25 @@ contract ScrollModule is ChainModuleBase { { return (FIXED_GAS_OVERHEAD, PER_CALLDATA_BYTE_GAS_OVERHEAD); } + + /* @notice this function sets a new coefficient for L1 fee estimation. + * @dev this function can only be invoked by contract owner + * @param coefficient the new coefficient + */ + function setL1FeeCalculation(uint8 coefficient) external onlyOwner { + if (coefficient > 100) { + revert InvalidL1FeeCoefficient(coefficient); + } + + s_l1FeeCoefficient = coefficient; + + emit L1FeeCoefficientSet(coefficient); + } + + /* @notice this function returns the s_l1FeeCoefficient + * @return coefficient the current s_l1FeeCoefficient in effect + */ + function getL1FeeCoefficient() public view returns (uint256 coefficient) { + return s_l1FeeCoefficient; + } } diff --git a/contracts/src/v0.8/automation/interfaces/IChainModule.sol b/contracts/src/v0.8/automation/interfaces/IChainModule.sol index e3a4b32c9b1..15e84f79848 100644 --- a/contracts/src/v0.8/automation/interfaces/IChainModule.sol +++ b/contracts/src/v0.8/automation/interfaces/IChainModule.sol @@ -2,26 +2,39 @@ pragma solidity ^0.8.0; interface IChainModule { - // retrieve the native block number of a chain. e.g. L2 block number on Arbitrum - function blockNumber() external view returns (uint256); + /* @notice this function provides the block number of current chain. + * @dev certain chains have its own function to retrieve block number, e.g. Arbitrum + * @return blockNumber the block number of the current chain. + */ + function blockNumber() external view returns (uint256 blockNumber); - // retrieve the native block hash of a chain. - function blockHash(uint256) external view returns (bytes32); + /* @notice this function provides the block hash of a block number. + * @dev this function can usually look back 256 blocks at most, unless otherwise specified + * @param blockNumber the block number + * @return blockHash the block hash of the input block number + */ + function blockHash(uint256 blockNumber) external view returns (bytes32 blockHash); - // retrieve the L1 data fee for a L2 transaction. it should return 0 for L1 chains and - // L2 chains which don't have L1 fee component. it uses msg.data to estimate L1 data so - // it must be used with a transaction. Return value in wei. - function getCurrentL1Fee() external view returns (uint256); + /* @notice this function provides the L1 fee of current transaction. + * @dev retrieve the L1 data fee for a L2 transaction. it should return 0 for L1 chains. it should + * return 0 for L2 chains if they don't have L1 fee component. + * @param dataSize the calldata size of the current transaction + * @return l1Fee the L1 fee in wei incurred by calldata of this data size + */ + function getCurrentL1Fee(uint256 dataSize) external view returns (uint256 l1Fee); - // retrieve the L1 data fee for a L2 simulation. it should return 0 for L1 chains and - // L2 chains which don't have L1 fee component. Return value in wei. - function getMaxL1Fee(uint256 dataSize) external view returns (uint256); + /* @notice this function provides the max possible L1 fee of current transaction. + * @dev retrieve the max possible L1 data fee for a L2 transaction. it should return 0 for L1 chains. it should + * return 0 for L2 chains if they don't have L1 fee component. + * @param dataSize the calldata size of the current transaction + * @return maxL1Fee the max possible L1 fee in wei incurred by calldata of this data size + */ + function getMaxL1Fee(uint256 dataSize) external view returns (uint256 maxL1Fee); - // Returns an upper bound on execution gas cost for one invocation of blockNumber(), - // one invocation of blockHash() and one invocation of getCurrentL1Fee(). - // Returns two values, first value indicates a fixed cost and the second value is - // the cost per msg.data byte (As some chain module's getCurrentL1Fee execution cost - // scales with calldata size) + /* @notice this function provides the overheads of calling this chain module. + * @return chainModuleFixedOverhead the fixed overhead incurred by calling this chain module + * @return chainModulePerByteOverhead the fixed overhead per byte incurred by calling this chain module with calldata + */ function getGasOverhead() external view diff --git a/contracts/src/v0.8/automation/interfaces/zksync/IGasBoundCaller.sol b/contracts/src/v0.8/automation/interfaces/zksync/IGasBoundCaller.sol new file mode 100644 index 00000000000..9edb541f9aa --- /dev/null +++ b/contracts/src/v0.8/automation/interfaces/zksync/IGasBoundCaller.sol @@ -0,0 +1,8 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.19; + +address constant GAS_BOUND_CALLER = address(0xc706EC7dfA5D4Dc87f29f859094165E8290530f5); + +interface IGasBoundCaller { + function gasBoundCall(address _to, uint256 _maxTotalGas, bytes calldata _data) external payable; +} diff --git a/contracts/src/v0.8/automation/interfaces/zksync/ISystemContext.sol b/contracts/src/v0.8/automation/interfaces/zksync/ISystemContext.sol new file mode 100644 index 00000000000..c8f480065c4 --- /dev/null +++ b/contracts/src/v0.8/automation/interfaces/zksync/ISystemContext.sol @@ -0,0 +1,10 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.19; + +ISystemContext constant SYSTEM_CONTEXT_CONTRACT = ISystemContext(address(0x800b)); + +interface ISystemContext { + function gasPrice() external view returns (uint256); + function gasPerPubdataByte() external view returns (uint256 gasPerPubdataByte); + function getCurrentPubdataSpent() external view returns (uint256 currentPubdataSpent); +} diff --git a/contracts/src/v0.8/automation/interfaces/zksync/IZKSyncAutomationRegistryMaster2_3.sol b/contracts/src/v0.8/automation/interfaces/zksync/IZKSyncAutomationRegistryMaster2_3.sol new file mode 100644 index 00000000000..89437215598 --- /dev/null +++ b/contracts/src/v0.8/automation/interfaces/zksync/IZKSyncAutomationRegistryMaster2_3.sol @@ -0,0 +1,441 @@ +// solhint-disable +// abi-checksum: 0x5857a77a981fcb60dbdac0700e68420cbe544249b20d9326d51c5ef8584c5dd7 +// SPDX-License-Identifier: MIT +// !! THIS FILE WAS AUTOGENERATED BY abi-to-sol v0.6.6. SEE SOURCE BELOW. !! +pragma solidity ^0.8.19; + +interface IZKSyncAutomationRegistryMaster2_3 { + error ArrayHasNoEntries(); + error CannotCancel(); + error CheckDataExceedsLimit(); + error ConfigDigestMismatch(); + error DuplicateEntry(); + error DuplicateSigners(); + error GasLimitCanOnlyIncrease(); + error GasLimitOutsideRange(); + error IncorrectNumberOfFaultyOracles(); + error IncorrectNumberOfSignatures(); + error IncorrectNumberOfSigners(); + error IndexOutOfRange(); + error InsufficientBalance(uint256 available, uint256 requested); + error InsufficientLinkLiquidity(); + error InvalidDataLength(); + error InvalidFeed(); + error InvalidPayee(); + error InvalidRecipient(); + error InvalidReport(); + error InvalidSigner(); + error InvalidToken(); + error InvalidTransmitter(); + error InvalidTrigger(); + error InvalidTriggerType(); + error MigrationNotPermitted(); + error MustSettleOffchain(); + error MustSettleOnchain(); + error NotAContract(); + error OnlyActiveSigners(); + error OnlyActiveTransmitters(); + error OnlyCallableByAdmin(); + error OnlyCallableByLINKToken(); + error OnlyCallableByOwnerOrAdmin(); + error OnlyCallableByOwnerOrRegistrar(); + error OnlyCallableByPayee(); + error OnlyCallableByProposedAdmin(); + error OnlyCallableByProposedPayee(); + error OnlyCallableByUpkeepPrivilegeManager(); + error OnlyFinanceAdmin(); + error OnlyPausedUpkeep(); + error OnlySimulatedBackend(); + error OnlyUnpausedUpkeep(); + error ParameterLengthError(); + error ReentrantCall(); + error RegistryPaused(); + error RepeatedSigner(); + error RepeatedTransmitter(); + error TargetCheckReverted(bytes reason); + error TooManyOracles(); + error TranscoderNotSet(); + error TransferFailed(); + error UpkeepAlreadyExists(); + error UpkeepCancelled(); + error UpkeepNotCanceled(); + error UpkeepNotNeeded(); + error ValueNotChanged(); + error ZeroAddressNotAllowed(); + event AdminPrivilegeConfigSet(address indexed admin, bytes privilegeConfig); + event BillingConfigOverridden(uint256 indexed id, ZKSyncAutomationRegistryBase2_3.BillingOverrides overrides); + event BillingConfigOverrideRemoved(uint256 indexed id); + event BillingConfigSet(address indexed token, ZKSyncAutomationRegistryBase2_3.BillingConfig config); + event CancelledUpkeepReport(uint256 indexed id, bytes trigger); + event ChainSpecificModuleUpdated(address newModule); + event ConfigSet( + uint32 previousConfigBlockNumber, + bytes32 configDigest, + uint64 configCount, + address[] signers, + address[] transmitters, + uint8 f, + bytes onchainConfig, + uint64 offchainConfigVersion, + bytes offchainConfig + ); + event DedupKeyAdded(bytes32 indexed dedupKey); + event FeesWithdrawn(address indexed assetAddress, address indexed recipient, uint256 amount); + event FundsAdded(uint256 indexed id, address indexed from, uint96 amount); + event FundsWithdrawn(uint256 indexed id, uint256 amount, address to); + event InsufficientFundsUpkeepReport(uint256 indexed id, bytes trigger); + event NOPsSettledOffchain(address[] payees, uint256[] payments); + event OwnershipTransferRequested(address indexed from, address indexed to); + event OwnershipTransferred(address indexed from, address indexed to); + event Paused(address account); + event PayeesUpdated(address[] transmitters, address[] payees); + event PayeeshipTransferRequested(address indexed transmitter, address indexed from, address indexed to); + event PayeeshipTransferred(address indexed transmitter, address indexed from, address indexed to); + event PaymentWithdrawn(address indexed transmitter, uint256 indexed amount, address indexed to, address payee); + event ReorgedUpkeepReport(uint256 indexed id, bytes trigger); + event StaleUpkeepReport(uint256 indexed id, bytes trigger); + event Transmitted(bytes32 configDigest, uint32 epoch); + event Unpaused(address account); + event UpkeepAdminTransferRequested(uint256 indexed id, address indexed from, address indexed to); + event UpkeepAdminTransferred(uint256 indexed id, address indexed from, address indexed to); + event UpkeepCanceled(uint256 indexed id, uint64 indexed atBlockHeight); + event UpkeepCharged(uint256 indexed id, ZKSyncAutomationRegistryBase2_3.PaymentReceipt receipt); + event UpkeepCheckDataSet(uint256 indexed id, bytes newCheckData); + event UpkeepGasLimitSet(uint256 indexed id, uint96 gasLimit); + event UpkeepMigrated(uint256 indexed id, uint256 remainingBalance, address destination); + event UpkeepOffchainConfigSet(uint256 indexed id, bytes offchainConfig); + event UpkeepPaused(uint256 indexed id); + event UpkeepPerformed( + uint256 indexed id, + bool indexed success, + uint96 totalPayment, + uint256 gasUsed, + uint256 gasOverhead, + bytes trigger + ); + event UpkeepPrivilegeConfigSet(uint256 indexed id, bytes privilegeConfig); + event UpkeepReceived(uint256 indexed id, uint256 startingBalance, address importedFrom); + event UpkeepRegistered(uint256 indexed id, uint32 performGas, address admin); + event UpkeepTriggerConfigSet(uint256 indexed id, bytes triggerConfig); + event UpkeepUnpaused(uint256 indexed id); + fallback() external payable; + function acceptOwnership() external; + function fallbackTo() external view returns (address); + function latestConfigDetails() external view returns (uint32 configCount, uint32 blockNumber, bytes32 configDigest); + function latestConfigDigestAndEpoch() external view returns (bool scanLogs, bytes32 configDigest, uint32 epoch); + function owner() external view returns (address); + function setConfig( + address[] memory signers, + address[] memory transmitters, + uint8 f, + bytes memory onchainConfigBytes, + uint64 offchainConfigVersion, + bytes memory offchainConfig + ) external; + function setConfigTypeSafe( + address[] memory signers, + address[] memory transmitters, + uint8 f, + ZKSyncAutomationRegistryBase2_3.OnchainConfig memory onchainConfig, + uint64 offchainConfigVersion, + bytes memory offchainConfig, + address[] memory billingTokens, + ZKSyncAutomationRegistryBase2_3.BillingConfig[] memory billingConfigs + ) external; + function transferOwnership(address to) external; + function transmit( + bytes32[3] memory reportContext, + bytes memory rawReport, + bytes32[] memory rs, + bytes32[] memory ss, + bytes32 rawVs + ) external; + function typeAndVersion() external view returns (string memory); + + function cancelUpkeep(uint256 id) external; + function migrateUpkeeps(uint256[] memory ids, address destination) external; + function onTokenTransfer(address sender, uint256 amount, bytes memory data) external; + function receiveUpkeeps(bytes memory encodedUpkeeps) external; + function registerUpkeep( + address target, + uint32 gasLimit, + address admin, + uint8 triggerType, + address billingToken, + bytes memory checkData, + bytes memory triggerConfig, + bytes memory offchainConfig + ) external returns (uint256 id); + + function acceptUpkeepAdmin(uint256 id) external; + function addFunds(uint256 id, uint96 amount) external payable; + function checkCallback( + uint256 id, + bytes[] memory values, + bytes memory extraData + ) external view returns (bool upkeepNeeded, bytes memory performData, uint8 upkeepFailureReason, uint256 gasUsed); + function checkUpkeep( + uint256 id, + bytes memory triggerData + ) + external + view + returns ( + bool upkeepNeeded, + bytes memory performData, + uint8 upkeepFailureReason, + uint256 gasUsed, + uint256 gasLimit, + uint256 fastGasWei, + uint256 linkUSD + ); + function checkUpkeep( + uint256 id + ) + external + view + returns ( + bool upkeepNeeded, + bytes memory performData, + uint8 upkeepFailureReason, + uint256 gasUsed, + uint256 gasLimit, + uint256 fastGasWei, + uint256 linkUSD + ); + function executeCallback( + uint256 id, + bytes memory payload + ) external returns (bool upkeepNeeded, bytes memory performData, uint8 upkeepFailureReason, uint256 gasUsed); + function pauseUpkeep(uint256 id) external; + function removeBillingOverrides(uint256 id) external; + function setBillingOverrides( + uint256 id, + ZKSyncAutomationRegistryBase2_3.BillingOverrides memory billingOverrides + ) external; + function setUpkeepCheckData(uint256 id, bytes memory newCheckData) external; + function setUpkeepGasLimit(uint256 id, uint32 gasLimit) external; + function setUpkeepOffchainConfig(uint256 id, bytes memory config) external; + function setUpkeepTriggerConfig(uint256 id, bytes memory triggerConfig) external; + function simulatePerformUpkeep( + uint256 id, + bytes memory performData + ) external view returns (bool success, uint256 gasUsed); + function transferUpkeepAdmin(uint256 id, address proposed) external; + function unpauseUpkeep(uint256 id) external; + function withdrawERC20Fees(address asset, address to, uint256 amount) external; + function withdrawFunds(uint256 id, address to) external; + function withdrawLink(address to, uint256 amount) external; + + function acceptPayeeship(address transmitter) external; + function disableOffchainPayments() external; + function getActiveUpkeepIDs(uint256 startIndex, uint256 maxCount) external view returns (uint256[] memory); + function getAdminPrivilegeConfig(address admin) external view returns (bytes memory); + function getAllowedReadOnlyAddress() external view returns (address); + function getAutomationForwarderLogic() external view returns (address); + function getAvailableERC20ForPayment(address billingToken) external view returns (uint256); + function getBalance(uint256 id) external view returns (uint96 balance); + function getBillingConfig( + address billingToken + ) external view returns (ZKSyncAutomationRegistryBase2_3.BillingConfig memory); + function getBillingOverrides( + uint256 upkeepID + ) external view returns (ZKSyncAutomationRegistryBase2_3.BillingOverrides memory); + function getBillingOverridesEnabled(uint256 upkeepID) external view returns (bool); + function getBillingToken(uint256 upkeepID) external view returns (address); + function getBillingTokenConfig( + address token + ) external view returns (ZKSyncAutomationRegistryBase2_3.BillingConfig memory); + function getBillingTokens() external view returns (address[] memory); + function getCancellationDelay() external pure returns (uint256); + function getChainModule() external view returns (address chainModule); + function getConditionalGasOverhead() external pure returns (uint256); + function getConfig() external view returns (ZKSyncAutomationRegistryBase2_3.OnchainConfig memory); + function getFallbackNativePrice() external view returns (uint256); + function getFastGasFeedAddress() external view returns (address); + function getForwarder(uint256 upkeepID) external view returns (address); + function getHotVars() external view returns (ZKSyncAutomationRegistryBase2_3.HotVars memory); + function getLinkAddress() external view returns (address); + function getLinkUSDFeedAddress() external view returns (address); + function getLogGasOverhead() external pure returns (uint256); + function getMaxPaymentForGas( + uint256 id, + uint8 triggerType, + uint32 gasLimit, + address billingToken + ) external view returns (uint96 maxPayment); + function getMinBalance(uint256 id) external view returns (uint96); + function getMinBalanceForUpkeep(uint256 id) external view returns (uint96 minBalance); + function getNativeUSDFeedAddress() external view returns (address); + function getNumUpkeeps() external view returns (uint256); + function getPayoutMode() external view returns (uint8); + function getPeerRegistryMigrationPermission(address peer) external view returns (uint8); + function getPerSignerGasOverhead() external pure returns (uint256); + function getReorgProtectionEnabled() external view returns (bool reorgProtectionEnabled); + function getReserveAmount(address billingToken) external view returns (uint256); + function getSignerInfo(address query) external view returns (bool active, uint8 index); + function getState() + external + view + returns ( + IAutomationV21PlusCommon.StateLegacy memory state, + IAutomationV21PlusCommon.OnchainConfigLegacy memory config, + address[] memory signers, + address[] memory transmitters, + uint8 f + ); + function getStorage() external view returns (ZKSyncAutomationRegistryBase2_3.Storage memory); + function getTransmitterInfo( + address query + ) external view returns (bool active, uint8 index, uint96 balance, uint96 lastCollected, address payee); + function getTransmittersWithPayees() + external + view + returns (ZKSyncAutomationRegistryBase2_3.TransmitterPayeeInfo[] memory); + function getTriggerType(uint256 upkeepId) external pure returns (uint8); + function getUpkeep(uint256 id) external view returns (IAutomationV21PlusCommon.UpkeepInfoLegacy memory upkeepInfo); + function getUpkeepPrivilegeConfig(uint256 upkeepId) external view returns (bytes memory); + function getUpkeepTriggerConfig(uint256 upkeepId) external view returns (bytes memory); + function getWrappedNativeTokenAddress() external view returns (address); + function hasDedupKey(bytes32 dedupKey) external view returns (bool); + function linkAvailableForPayment() external view returns (int256); + function pause() external; + function setAdminPrivilegeConfig(address admin, bytes memory newPrivilegeConfig) external; + function setPayees(address[] memory payees) external; + function setPeerRegistryMigrationPermission(address peer, uint8 permission) external; + function setUpkeepPrivilegeConfig(uint256 upkeepId, bytes memory newPrivilegeConfig) external; + function settleNOPsOffchain() external; + function supportsBillingToken(address token) external view returns (bool); + function transferPayeeship(address transmitter, address proposed) external; + function unpause() external; + function upkeepVersion() external pure returns (uint8); + function withdrawPayment(address from, address to) external; +} + +interface ZKSyncAutomationRegistryBase2_3 { + struct BillingOverrides { + uint32 gasFeePPB; + uint24 flatFeeMilliCents; + } + + struct BillingConfig { + uint32 gasFeePPB; + uint24 flatFeeMilliCents; + address priceFeed; + uint8 decimals; + uint256 fallbackPrice; + uint96 minSpend; + } + + struct PaymentReceipt { + uint96 gasChargeInBillingToken; + uint96 premiumInBillingToken; + uint96 gasReimbursementInJuels; + uint96 premiumInJuels; + address billingToken; + uint96 linkUSD; + uint96 nativeUSD; + uint96 billingUSD; + } + + struct OnchainConfig { + uint32 checkGasLimit; + uint32 maxPerformGas; + uint32 maxCheckDataSize; + address transcoder; + bool reorgProtectionEnabled; + uint24 stalenessSeconds; + uint32 maxPerformDataSize; + uint32 maxRevertDataSize; + address upkeepPrivilegeManager; + uint16 gasCeilingMultiplier; + address financeAdmin; + uint256 fallbackGasPrice; + uint256 fallbackLinkPrice; + uint256 fallbackNativePrice; + address[] registrars; + address chainModule; + } + + struct HotVars { + uint96 totalPremium; + uint32 latestEpoch; + uint24 stalenessSeconds; + uint16 gasCeilingMultiplier; + uint8 f; + bool paused; + bool reentrancyGuard; + bool reorgProtectionEnabled; + address chainModule; + } + + struct Storage { + address transcoder; + uint32 checkGasLimit; + uint32 maxPerformGas; + uint32 nonce; + address upkeepPrivilegeManager; + uint32 configCount; + uint32 latestConfigBlockNumber; + uint32 maxCheckDataSize; + address financeAdmin; + uint32 maxPerformDataSize; + uint32 maxRevertDataSize; + } + + struct TransmitterPayeeInfo { + address transmitterAddress; + address payeeAddress; + } +} + +interface IAutomationV21PlusCommon { + struct StateLegacy { + uint32 nonce; + uint96 ownerLinkBalance; + uint256 expectedLinkBalance; + uint96 totalPremium; + uint256 numUpkeeps; + uint32 configCount; + uint32 latestConfigBlockNumber; + bytes32 latestConfigDigest; + uint32 latestEpoch; + bool paused; + } + + struct OnchainConfigLegacy { + uint32 paymentPremiumPPB; + uint32 flatFeeMicroLink; + uint32 checkGasLimit; + uint24 stalenessSeconds; + uint16 gasCeilingMultiplier; + uint96 minUpkeepSpend; + uint32 maxPerformGas; + uint32 maxCheckDataSize; + uint32 maxPerformDataSize; + uint32 maxRevertDataSize; + uint256 fallbackGasPrice; + uint256 fallbackLinkPrice; + address transcoder; + address[] registrars; + address upkeepPrivilegeManager; + } + + struct UpkeepInfoLegacy { + address target; + uint32 performGas; + bytes checkData; + uint96 balance; + address admin; + uint64 maxValidBlocknumber; + uint32 lastPerformedBlockNumber; + uint96 amountSpent; + bool paused; + bytes offchainConfig; + } +} + +// THIS FILE WAS AUTOGENERATED FROM THE FOLLOWING ABI JSON: +/* +[{"inputs":[{"internalType":"contract ZKSyncAutomationRegistryLogicA2_3","name":"logicA","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ArrayHasNoEntries","type":"error"},{"inputs":[],"name":"CannotCancel","type":"error"},{"inputs":[],"name":"CheckDataExceedsLimit","type":"error"},{"inputs":[],"name":"ConfigDigestMismatch","type":"error"},{"inputs":[],"name":"DuplicateEntry","type":"error"},{"inputs":[],"name":"DuplicateSigners","type":"error"},{"inputs":[],"name":"GasLimitCanOnlyIncrease","type":"error"},{"inputs":[],"name":"GasLimitOutsideRange","type":"error"},{"inputs":[],"name":"IncorrectNumberOfFaultyOracles","type":"error"},{"inputs":[],"name":"IncorrectNumberOfSignatures","type":"error"},{"inputs":[],"name":"IncorrectNumberOfSigners","type":"error"},{"inputs":[],"name":"IndexOutOfRange","type":"error"},{"inputs":[{"internalType":"uint256","name":"available","type":"uint256"},{"internalType":"uint256","name":"requested","type":"uint256"}],"name":"InsufficientBalance","type":"error"},{"inputs":[],"name":"InsufficientLinkLiquidity","type":"error"},{"inputs":[],"name":"InvalidDataLength","type":"error"},{"inputs":[],"name":"InvalidFeed","type":"error"},{"inputs":[],"name":"InvalidPayee","type":"error"},{"inputs":[],"name":"InvalidRecipient","type":"error"},{"inputs":[],"name":"InvalidReport","type":"error"},{"inputs":[],"name":"InvalidSigner","type":"error"},{"inputs":[],"name":"InvalidToken","type":"error"},{"inputs":[],"name":"InvalidTransmitter","type":"error"},{"inputs":[],"name":"InvalidTrigger","type":"error"},{"inputs":[],"name":"InvalidTriggerType","type":"error"},{"inputs":[],"name":"MigrationNotPermitted","type":"error"},{"inputs":[],"name":"MustSettleOffchain","type":"error"},{"inputs":[],"name":"MustSettleOnchain","type":"error"},{"inputs":[],"name":"NotAContract","type":"error"},{"inputs":[],"name":"OnlyActiveSigners","type":"error"},{"inputs":[],"name":"OnlyActiveTransmitters","type":"error"},{"inputs":[],"name":"OnlyCallableByAdmin","type":"error"},{"inputs":[],"name":"OnlyCallableByLINKToken","type":"error"},{"inputs":[],"name":"OnlyCallableByOwnerOrAdmin","type":"error"},{"inputs":[],"name":"OnlyCallableByOwnerOrRegistrar","type":"error"},{"inputs":[],"name":"OnlyCallableByPayee","type":"error"},{"inputs":[],"name":"OnlyCallableByProposedAdmin","type":"error"},{"inputs":[],"name":"OnlyCallableByProposedPayee","type":"error"},{"inputs":[],"name":"OnlyCallableByUpkeepPrivilegeManager","type":"error"},{"inputs":[],"name":"OnlyFinanceAdmin","type":"error"},{"inputs":[],"name":"OnlyPausedUpkeep","type":"error"},{"inputs":[],"name":"OnlySimulatedBackend","type":"error"},{"inputs":[],"name":"OnlyUnpausedUpkeep","type":"error"},{"inputs":[],"name":"ParameterLengthError","type":"error"},{"inputs":[],"name":"ReentrantCall","type":"error"},{"inputs":[],"name":"RegistryPaused","type":"error"},{"inputs":[],"name":"RepeatedSigner","type":"error"},{"inputs":[],"name":"RepeatedTransmitter","type":"error"},{"inputs":[{"internalType":"bytes","name":"reason","type":"bytes"}],"name":"TargetCheckReverted","type":"error"},{"inputs":[],"name":"TooManyOracles","type":"error"},{"inputs":[],"name":"TranscoderNotSet","type":"error"},{"inputs":[],"name":"TransferFailed","type":"error"},{"inputs":[],"name":"UpkeepAlreadyExists","type":"error"},{"inputs":[],"name":"UpkeepCancelled","type":"error"},{"inputs":[],"name":"UpkeepNotCanceled","type":"error"},{"inputs":[],"name":"UpkeepNotNeeded","type":"error"},{"inputs":[],"name":"ValueNotChanged","type":"error"},{"inputs":[],"name":"ZeroAddressNotAllowed","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"admin","type":"address"},{"indexed":false,"internalType":"bytes","name":"privilegeConfig","type":"bytes"}],"name":"AdminPrivilegeConfigSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"components":[{"internalType":"uint32","name":"gasFeePPB","type":"uint32"},{"internalType":"uint24","name":"flatFeeMilliCents","type":"uint24"}],"indexed":false,"internalType":"struct ZKSyncAutomationRegistryBase2_3.BillingOverrides","name":"overrides","type":"tuple"}],"name":"BillingConfigOverridden","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"}],"name":"BillingConfigOverrideRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IERC20Metadata","name":"token","type":"address"},{"components":[{"internalType":"uint32","name":"gasFeePPB","type":"uint32"},{"internalType":"uint24","name":"flatFeeMilliCents","type":"uint24"},{"internalType":"contract AggregatorV3Interface","name":"priceFeed","type":"address"},{"internalType":"uint8","name":"decimals","type":"uint8"},{"internalType":"uint256","name":"fallbackPrice","type":"uint256"},{"internalType":"uint96","name":"minSpend","type":"uint96"}],"indexed":false,"internalType":"struct ZKSyncAutomationRegistryBase2_3.BillingConfig","name":"config","type":"tuple"}],"name":"BillingConfigSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"trigger","type":"bytes"}],"name":"CancelledUpkeepReport","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newModule","type":"address"}],"name":"ChainSpecificModuleUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint32","name":"previousConfigBlockNumber","type":"uint32"},{"indexed":false,"internalType":"bytes32","name":"configDigest","type":"bytes32"},{"indexed":false,"internalType":"uint64","name":"configCount","type":"uint64"},{"indexed":false,"internalType":"address[]","name":"signers","type":"address[]"},{"indexed":false,"internalType":"address[]","name":"transmitters","type":"address[]"},{"indexed":false,"internalType":"uint8","name":"f","type":"uint8"},{"indexed":false,"internalType":"bytes","name":"onchainConfig","type":"bytes"},{"indexed":false,"internalType":"uint64","name":"offchainConfigVersion","type":"uint64"},{"indexed":false,"internalType":"bytes","name":"offchainConfig","type":"bytes"}],"name":"ConfigSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"dedupKey","type":"bytes32"}],"name":"DedupKeyAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"assetAddress","type":"address"},{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"FeesWithdrawn","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"uint96","name":"amount","type":"uint96"}],"name":"FundsAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"address","name":"to","type":"address"}],"name":"FundsWithdrawn","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"trigger","type":"bytes"}],"name":"InsufficientFundsUpkeepReport","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address[]","name":"payees","type":"address[]"},{"indexed":false,"internalType":"uint256[]","name":"payments","type":"uint256[]"}],"name":"NOPsSettledOffchain","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"OwnershipTransferRequested","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address[]","name":"transmitters","type":"address[]"},{"indexed":false,"internalType":"address[]","name":"payees","type":"address[]"}],"name":"PayeesUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"transmitter","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"PayeeshipTransferRequested","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"transmitter","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"PayeeshipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"transmitter","type":"address"},{"indexed":true,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"address","name":"payee","type":"address"}],"name":"PaymentWithdrawn","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"trigger","type":"bytes"}],"name":"ReorgedUpkeepReport","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"trigger","type":"bytes"}],"name":"StaleUpkeepReport","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"configDigest","type":"bytes32"},{"indexed":false,"internalType":"uint32","name":"epoch","type":"uint32"}],"name":"Transmitted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"UpkeepAdminTransferRequested","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"UpkeepAdminTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":true,"internalType":"uint64","name":"atBlockHeight","type":"uint64"}],"name":"UpkeepCanceled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"components":[{"internalType":"uint96","name":"gasChargeInBillingToken","type":"uint96"},{"internalType":"uint96","name":"premiumInBillingToken","type":"uint96"},{"internalType":"uint96","name":"gasReimbursementInJuels","type":"uint96"},{"internalType":"uint96","name":"premiumInJuels","type":"uint96"},{"internalType":"contract IERC20Metadata","name":"billingToken","type":"address"},{"internalType":"uint96","name":"linkUSD","type":"uint96"},{"internalType":"uint96","name":"nativeUSD","type":"uint96"},{"internalType":"uint96","name":"billingUSD","type":"uint96"}],"indexed":false,"internalType":"struct ZKSyncAutomationRegistryBase2_3.PaymentReceipt","name":"receipt","type":"tuple"}],"name":"UpkeepCharged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"newCheckData","type":"bytes"}],"name":"UpkeepCheckDataSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint96","name":"gasLimit","type":"uint96"}],"name":"UpkeepGasLimitSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"remainingBalance","type":"uint256"},{"indexed":false,"internalType":"address","name":"destination","type":"address"}],"name":"UpkeepMigrated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"offchainConfig","type":"bytes"}],"name":"UpkeepOffchainConfigSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"}],"name":"UpkeepPaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":true,"internalType":"bool","name":"success","type":"bool"},{"indexed":false,"internalType":"uint96","name":"totalPayment","type":"uint96"},{"indexed":false,"internalType":"uint256","name":"gasUsed","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"gasOverhead","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"trigger","type":"bytes"}],"name":"UpkeepPerformed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"privilegeConfig","type":"bytes"}],"name":"UpkeepPrivilegeConfigSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"startingBalance","type":"uint256"},{"indexed":false,"internalType":"address","name":"importedFrom","type":"address"}],"name":"UpkeepReceived","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint32","name":"performGas","type":"uint32"},{"indexed":false,"internalType":"address","name":"admin","type":"address"}],"name":"UpkeepRegistered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"triggerConfig","type":"bytes"}],"name":"UpkeepTriggerConfigSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"}],"name":"UpkeepUnpaused","type":"event"},{"stateMutability":"payable","type":"fallback"},{"inputs":[],"name":"acceptOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"fallbackTo","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"latestConfigDetails","outputs":[{"internalType":"uint32","name":"configCount","type":"uint32"},{"internalType":"uint32","name":"blockNumber","type":"uint32"},{"internalType":"bytes32","name":"configDigest","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"latestConfigDigestAndEpoch","outputs":[{"internalType":"bool","name":"scanLogs","type":"bool"},{"internalType":"bytes32","name":"configDigest","type":"bytes32"},{"internalType":"uint32","name":"epoch","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"signers","type":"address[]"},{"internalType":"address[]","name":"transmitters","type":"address[]"},{"internalType":"uint8","name":"f","type":"uint8"},{"internalType":"bytes","name":"onchainConfigBytes","type":"bytes"},{"internalType":"uint64","name":"offchainConfigVersion","type":"uint64"},{"internalType":"bytes","name":"offchainConfig","type":"bytes"}],"name":"setConfig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"signers","type":"address[]"},{"internalType":"address[]","name":"transmitters","type":"address[]"},{"internalType":"uint8","name":"f","type":"uint8"},{"components":[{"internalType":"uint32","name":"checkGasLimit","type":"uint32"},{"internalType":"uint32","name":"maxPerformGas","type":"uint32"},{"internalType":"uint32","name":"maxCheckDataSize","type":"uint32"},{"internalType":"address","name":"transcoder","type":"address"},{"internalType":"bool","name":"reorgProtectionEnabled","type":"bool"},{"internalType":"uint24","name":"stalenessSeconds","type":"uint24"},{"internalType":"uint32","name":"maxPerformDataSize","type":"uint32"},{"internalType":"uint32","name":"maxRevertDataSize","type":"uint32"},{"internalType":"address","name":"upkeepPrivilegeManager","type":"address"},{"internalType":"uint16","name":"gasCeilingMultiplier","type":"uint16"},{"internalType":"address","name":"financeAdmin","type":"address"},{"internalType":"uint256","name":"fallbackGasPrice","type":"uint256"},{"internalType":"uint256","name":"fallbackLinkPrice","type":"uint256"},{"internalType":"uint256","name":"fallbackNativePrice","type":"uint256"},{"internalType":"address[]","name":"registrars","type":"address[]"},{"internalType":"contract IChainModule","name":"chainModule","type":"address"}],"internalType":"struct ZKSyncAutomationRegistryBase2_3.OnchainConfig","name":"onchainConfig","type":"tuple"},{"internalType":"uint64","name":"offchainConfigVersion","type":"uint64"},{"internalType":"bytes","name":"offchainConfig","type":"bytes"},{"internalType":"contract IERC20Metadata[]","name":"billingTokens","type":"address[]"},{"components":[{"internalType":"uint32","name":"gasFeePPB","type":"uint32"},{"internalType":"uint24","name":"flatFeeMilliCents","type":"uint24"},{"internalType":"contract AggregatorV3Interface","name":"priceFeed","type":"address"},{"internalType":"uint8","name":"decimals","type":"uint8"},{"internalType":"uint256","name":"fallbackPrice","type":"uint256"},{"internalType":"uint96","name":"minSpend","type":"uint96"}],"internalType":"struct ZKSyncAutomationRegistryBase2_3.BillingConfig[]","name":"billingConfigs","type":"tuple[]"}],"name":"setConfigTypeSafe","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32[3]","name":"reportContext","type":"bytes32[3]"},{"internalType":"bytes","name":"rawReport","type":"bytes"},{"internalType":"bytes32[]","name":"rs","type":"bytes32[]"},{"internalType":"bytes32[]","name":"ss","type":"bytes32[]"},{"internalType":"bytes32","name":"rawVs","type":"bytes32"}],"name":"transmit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"typeAndVersion","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract ZKSyncAutomationRegistryLogicB2_3","name":"logicB","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"cancelUpkeep","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"address","name":"destination","type":"address"}],"name":"migrateUpkeeps","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"onTokenTransfer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"encodedUpkeeps","type":"bytes"}],"name":"receiveUpkeeps","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"target","type":"address"},{"internalType":"uint32","name":"gasLimit","type":"uint32"},{"internalType":"address","name":"admin","type":"address"},{"internalType":"enum ZKSyncAutomationRegistryBase2_3.Trigger","name":"triggerType","type":"uint8"},{"internalType":"contract IERC20Metadata","name":"billingToken","type":"address"},{"internalType":"bytes","name":"checkData","type":"bytes"},{"internalType":"bytes","name":"triggerConfig","type":"bytes"},{"internalType":"bytes","name":"offchainConfig","type":"bytes"}],"name":"registerUpkeep","outputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ZKSyncAutomationRegistryLogicC2_3","name":"logicC","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"acceptUpkeepAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint96","name":"amount","type":"uint96"}],"name":"addFunds","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"bytes[]","name":"values","type":"bytes[]"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"name":"checkCallback","outputs":[{"internalType":"bool","name":"upkeepNeeded","type":"bool"},{"internalType":"bytes","name":"performData","type":"bytes"},{"internalType":"enum ZKSyncAutomationRegistryBase2_3.UpkeepFailureReason","name":"upkeepFailureReason","type":"uint8"},{"internalType":"uint256","name":"gasUsed","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"bytes","name":"triggerData","type":"bytes"}],"name":"checkUpkeep","outputs":[{"internalType":"bool","name":"upkeepNeeded","type":"bool"},{"internalType":"bytes","name":"performData","type":"bytes"},{"internalType":"enum ZKSyncAutomationRegistryBase2_3.UpkeepFailureReason","name":"upkeepFailureReason","type":"uint8"},{"internalType":"uint256","name":"gasUsed","type":"uint256"},{"internalType":"uint256","name":"gasLimit","type":"uint256"},{"internalType":"uint256","name":"fastGasWei","type":"uint256"},{"internalType":"uint256","name":"linkUSD","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"checkUpkeep","outputs":[{"internalType":"bool","name":"upkeepNeeded","type":"bool"},{"internalType":"bytes","name":"performData","type":"bytes"},{"internalType":"enum ZKSyncAutomationRegistryBase2_3.UpkeepFailureReason","name":"upkeepFailureReason","type":"uint8"},{"internalType":"uint256","name":"gasUsed","type":"uint256"},{"internalType":"uint256","name":"gasLimit","type":"uint256"},{"internalType":"uint256","name":"fastGasWei","type":"uint256"},{"internalType":"uint256","name":"linkUSD","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"bytes","name":"payload","type":"bytes"}],"name":"executeCallback","outputs":[{"internalType":"bool","name":"upkeepNeeded","type":"bool"},{"internalType":"bytes","name":"performData","type":"bytes"},{"internalType":"enum ZKSyncAutomationRegistryBase2_3.UpkeepFailureReason","name":"upkeepFailureReason","type":"uint8"},{"internalType":"uint256","name":"gasUsed","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"pauseUpkeep","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"removeBillingOverrides","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"components":[{"internalType":"uint32","name":"gasFeePPB","type":"uint32"},{"internalType":"uint24","name":"flatFeeMilliCents","type":"uint24"}],"internalType":"struct ZKSyncAutomationRegistryBase2_3.BillingOverrides","name":"billingOverrides","type":"tuple"}],"name":"setBillingOverrides","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"bytes","name":"newCheckData","type":"bytes"}],"name":"setUpkeepCheckData","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint32","name":"gasLimit","type":"uint32"}],"name":"setUpkeepGasLimit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"bytes","name":"config","type":"bytes"}],"name":"setUpkeepOffchainConfig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"bytes","name":"triggerConfig","type":"bytes"}],"name":"setUpkeepTriggerConfig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"bytes","name":"performData","type":"bytes"}],"name":"simulatePerformUpkeep","outputs":[{"internalType":"bool","name":"success","type":"bool"},{"internalType":"uint256","name":"gasUsed","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"address","name":"proposed","type":"address"}],"name":"transferUpkeepAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"unpauseUpkeep","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20Metadata","name":"asset","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdrawERC20Fees","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"address","name":"to","type":"address"}],"name":"withdrawFunds","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdrawLink","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"link","type":"address"},{"internalType":"address","name":"linkUSDFeed","type":"address"},{"internalType":"address","name":"nativeUSDFeed","type":"address"},{"internalType":"address","name":"fastGasFeed","type":"address"},{"internalType":"address","name":"automationForwarderLogic","type":"address"},{"internalType":"address","name":"allowedReadOnlyAddress","type":"address"},{"internalType":"enum ZKSyncAutomationRegistryBase2_3.PayoutMode","name":"payoutMode","type":"uint8"},{"internalType":"address","name":"wrappedNativeTokenAddress","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"transmitter","type":"address"}],"name":"acceptPayeeship","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"disableOffchainPayments","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"startIndex","type":"uint256"},{"internalType":"uint256","name":"maxCount","type":"uint256"}],"name":"getActiveUpkeepIDs","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"admin","type":"address"}],"name":"getAdminPrivilegeConfig","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getAllowedReadOnlyAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getAutomationForwarderLogic","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC20Metadata","name":"billingToken","type":"address"}],"name":"getAvailableERC20ForPayment","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"getBalance","outputs":[{"internalType":"uint96","name":"balance","type":"uint96"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC20Metadata","name":"billingToken","type":"address"}],"name":"getBillingConfig","outputs":[{"components":[{"internalType":"uint32","name":"gasFeePPB","type":"uint32"},{"internalType":"uint24","name":"flatFeeMilliCents","type":"uint24"},{"internalType":"contract AggregatorV3Interface","name":"priceFeed","type":"address"},{"internalType":"uint8","name":"decimals","type":"uint8"},{"internalType":"uint256","name":"fallbackPrice","type":"uint256"},{"internalType":"uint96","name":"minSpend","type":"uint96"}],"internalType":"struct ZKSyncAutomationRegistryBase2_3.BillingConfig","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"upkeepID","type":"uint256"}],"name":"getBillingOverrides","outputs":[{"components":[{"internalType":"uint32","name":"gasFeePPB","type":"uint32"},{"internalType":"uint24","name":"flatFeeMilliCents","type":"uint24"}],"internalType":"struct ZKSyncAutomationRegistryBase2_3.BillingOverrides","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"upkeepID","type":"uint256"}],"name":"getBillingOverridesEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"upkeepID","type":"uint256"}],"name":"getBillingToken","outputs":[{"internalType":"contract IERC20Metadata","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC20Metadata","name":"token","type":"address"}],"name":"getBillingTokenConfig","outputs":[{"components":[{"internalType":"uint32","name":"gasFeePPB","type":"uint32"},{"internalType":"uint24","name":"flatFeeMilliCents","type":"uint24"},{"internalType":"contract AggregatorV3Interface","name":"priceFeed","type":"address"},{"internalType":"uint8","name":"decimals","type":"uint8"},{"internalType":"uint256","name":"fallbackPrice","type":"uint256"},{"internalType":"uint96","name":"minSpend","type":"uint96"}],"internalType":"struct ZKSyncAutomationRegistryBase2_3.BillingConfig","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getBillingTokens","outputs":[{"internalType":"contract IERC20Metadata[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getCancellationDelay","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"getChainModule","outputs":[{"internalType":"contract IChainModule","name":"chainModule","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getConditionalGasOverhead","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"getConfig","outputs":[{"components":[{"internalType":"uint32","name":"checkGasLimit","type":"uint32"},{"internalType":"uint32","name":"maxPerformGas","type":"uint32"},{"internalType":"uint32","name":"maxCheckDataSize","type":"uint32"},{"internalType":"address","name":"transcoder","type":"address"},{"internalType":"bool","name":"reorgProtectionEnabled","type":"bool"},{"internalType":"uint24","name":"stalenessSeconds","type":"uint24"},{"internalType":"uint32","name":"maxPerformDataSize","type":"uint32"},{"internalType":"uint32","name":"maxRevertDataSize","type":"uint32"},{"internalType":"address","name":"upkeepPrivilegeManager","type":"address"},{"internalType":"uint16","name":"gasCeilingMultiplier","type":"uint16"},{"internalType":"address","name":"financeAdmin","type":"address"},{"internalType":"uint256","name":"fallbackGasPrice","type":"uint256"},{"internalType":"uint256","name":"fallbackLinkPrice","type":"uint256"},{"internalType":"uint256","name":"fallbackNativePrice","type":"uint256"},{"internalType":"address[]","name":"registrars","type":"address[]"},{"internalType":"contract IChainModule","name":"chainModule","type":"address"}],"internalType":"struct ZKSyncAutomationRegistryBase2_3.OnchainConfig","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getFallbackNativePrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getFastGasFeedAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"upkeepID","type":"uint256"}],"name":"getForwarder","outputs":[{"internalType":"contract IAutomationForwarder","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getHotVars","outputs":[{"components":[{"internalType":"uint96","name":"totalPremium","type":"uint96"},{"internalType":"uint32","name":"latestEpoch","type":"uint32"},{"internalType":"uint24","name":"stalenessSeconds","type":"uint24"},{"internalType":"uint16","name":"gasCeilingMultiplier","type":"uint16"},{"internalType":"uint8","name":"f","type":"uint8"},{"internalType":"bool","name":"paused","type":"bool"},{"internalType":"bool","name":"reentrancyGuard","type":"bool"},{"internalType":"bool","name":"reorgProtectionEnabled","type":"bool"},{"internalType":"contract IChainModule","name":"chainModule","type":"address"}],"internalType":"struct ZKSyncAutomationRegistryBase2_3.HotVars","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getLinkAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getLinkUSDFeedAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getLogGasOverhead","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"enum ZKSyncAutomationRegistryBase2_3.Trigger","name":"triggerType","type":"uint8"},{"internalType":"uint32","name":"gasLimit","type":"uint32"},{"internalType":"contract IERC20Metadata","name":"billingToken","type":"address"}],"name":"getMaxPaymentForGas","outputs":[{"internalType":"uint96","name":"maxPayment","type":"uint96"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"getMinBalance","outputs":[{"internalType":"uint96","name":"","type":"uint96"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"getMinBalanceForUpkeep","outputs":[{"internalType":"uint96","name":"minBalance","type":"uint96"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getNativeUSDFeedAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getNumUpkeeps","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPayoutMode","outputs":[{"internalType":"enum ZKSyncAutomationRegistryBase2_3.PayoutMode","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"peer","type":"address"}],"name":"getPeerRegistryMigrationPermission","outputs":[{"internalType":"enum ZKSyncAutomationRegistryBase2_3.MigrationPermission","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPerSignerGasOverhead","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"getReorgProtectionEnabled","outputs":[{"internalType":"bool","name":"reorgProtectionEnabled","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC20Metadata","name":"billingToken","type":"address"}],"name":"getReserveAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"query","type":"address"}],"name":"getSignerInfo","outputs":[{"internalType":"bool","name":"active","type":"bool"},{"internalType":"uint8","name":"index","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getState","outputs":[{"components":[{"internalType":"uint32","name":"nonce","type":"uint32"},{"internalType":"uint96","name":"ownerLinkBalance","type":"uint96"},{"internalType":"uint256","name":"expectedLinkBalance","type":"uint256"},{"internalType":"uint96","name":"totalPremium","type":"uint96"},{"internalType":"uint256","name":"numUpkeeps","type":"uint256"},{"internalType":"uint32","name":"configCount","type":"uint32"},{"internalType":"uint32","name":"latestConfigBlockNumber","type":"uint32"},{"internalType":"bytes32","name":"latestConfigDigest","type":"bytes32"},{"internalType":"uint32","name":"latestEpoch","type":"uint32"},{"internalType":"bool","name":"paused","type":"bool"}],"internalType":"struct IAutomationV21PlusCommon.StateLegacy","name":"state","type":"tuple"},{"components":[{"internalType":"uint32","name":"paymentPremiumPPB","type":"uint32"},{"internalType":"uint32","name":"flatFeeMicroLink","type":"uint32"},{"internalType":"uint32","name":"checkGasLimit","type":"uint32"},{"internalType":"uint24","name":"stalenessSeconds","type":"uint24"},{"internalType":"uint16","name":"gasCeilingMultiplier","type":"uint16"},{"internalType":"uint96","name":"minUpkeepSpend","type":"uint96"},{"internalType":"uint32","name":"maxPerformGas","type":"uint32"},{"internalType":"uint32","name":"maxCheckDataSize","type":"uint32"},{"internalType":"uint32","name":"maxPerformDataSize","type":"uint32"},{"internalType":"uint32","name":"maxRevertDataSize","type":"uint32"},{"internalType":"uint256","name":"fallbackGasPrice","type":"uint256"},{"internalType":"uint256","name":"fallbackLinkPrice","type":"uint256"},{"internalType":"address","name":"transcoder","type":"address"},{"internalType":"address[]","name":"registrars","type":"address[]"},{"internalType":"address","name":"upkeepPrivilegeManager","type":"address"}],"internalType":"struct IAutomationV21PlusCommon.OnchainConfigLegacy","name":"config","type":"tuple"},{"internalType":"address[]","name":"signers","type":"address[]"},{"internalType":"address[]","name":"transmitters","type":"address[]"},{"internalType":"uint8","name":"f","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getStorage","outputs":[{"components":[{"internalType":"address","name":"transcoder","type":"address"},{"internalType":"uint32","name":"checkGasLimit","type":"uint32"},{"internalType":"uint32","name":"maxPerformGas","type":"uint32"},{"internalType":"uint32","name":"nonce","type":"uint32"},{"internalType":"address","name":"upkeepPrivilegeManager","type":"address"},{"internalType":"uint32","name":"configCount","type":"uint32"},{"internalType":"uint32","name":"latestConfigBlockNumber","type":"uint32"},{"internalType":"uint32","name":"maxCheckDataSize","type":"uint32"},{"internalType":"address","name":"financeAdmin","type":"address"},{"internalType":"uint32","name":"maxPerformDataSize","type":"uint32"},{"internalType":"uint32","name":"maxRevertDataSize","type":"uint32"}],"internalType":"struct ZKSyncAutomationRegistryBase2_3.Storage","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"query","type":"address"}],"name":"getTransmitterInfo","outputs":[{"internalType":"bool","name":"active","type":"bool"},{"internalType":"uint8","name":"index","type":"uint8"},{"internalType":"uint96","name":"balance","type":"uint96"},{"internalType":"uint96","name":"lastCollected","type":"uint96"},{"internalType":"address","name":"payee","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTransmittersWithPayees","outputs":[{"components":[{"internalType":"address","name":"transmitterAddress","type":"address"},{"internalType":"address","name":"payeeAddress","type":"address"}],"internalType":"struct ZKSyncAutomationRegistryBase2_3.TransmitterPayeeInfo[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"upkeepId","type":"uint256"}],"name":"getTriggerType","outputs":[{"internalType":"enum ZKSyncAutomationRegistryBase2_3.Trigger","name":"","type":"uint8"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"getUpkeep","outputs":[{"components":[{"internalType":"address","name":"target","type":"address"},{"internalType":"uint32","name":"performGas","type":"uint32"},{"internalType":"bytes","name":"checkData","type":"bytes"},{"internalType":"uint96","name":"balance","type":"uint96"},{"internalType":"address","name":"admin","type":"address"},{"internalType":"uint64","name":"maxValidBlocknumber","type":"uint64"},{"internalType":"uint32","name":"lastPerformedBlockNumber","type":"uint32"},{"internalType":"uint96","name":"amountSpent","type":"uint96"},{"internalType":"bool","name":"paused","type":"bool"},{"internalType":"bytes","name":"offchainConfig","type":"bytes"}],"internalType":"struct IAutomationV21PlusCommon.UpkeepInfoLegacy","name":"upkeepInfo","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"upkeepId","type":"uint256"}],"name":"getUpkeepPrivilegeConfig","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"upkeepId","type":"uint256"}],"name":"getUpkeepTriggerConfig","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getWrappedNativeTokenAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"dedupKey","type":"bytes32"}],"name":"hasDedupKey","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"linkAvailableForPayment","outputs":[{"internalType":"int256","name":"","type":"int256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"admin","type":"address"},{"internalType":"bytes","name":"newPrivilegeConfig","type":"bytes"}],"name":"setAdminPrivilegeConfig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"payees","type":"address[]"}],"name":"setPayees","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"peer","type":"address"},{"internalType":"enum ZKSyncAutomationRegistryBase2_3.MigrationPermission","name":"permission","type":"uint8"}],"name":"setPeerRegistryMigrationPermission","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"upkeepId","type":"uint256"},{"internalType":"bytes","name":"newPrivilegeConfig","type":"bytes"}],"name":"setUpkeepPrivilegeConfig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"settleNOPsOffchain","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20Metadata","name":"token","type":"address"}],"name":"supportsBillingToken","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"transmitter","type":"address"},{"internalType":"address","name":"proposed","type":"address"}],"name":"transferPayeeship","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"upkeepVersion","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"}],"name":"withdrawPayment","outputs":[],"stateMutability":"nonpayable","type":"function"}] +*/ diff --git a/contracts/src/v0.8/automation/test/WETH9.sol b/contracts/src/v0.8/automation/test/WETH9.sol new file mode 100644 index 00000000000..1225e6e39a8 --- /dev/null +++ b/contracts/src/v0.8/automation/test/WETH9.sol @@ -0,0 +1,93 @@ +// Submitted for verification at Etherscan.io on 2017-12-12 + +// Copyright (C) 2015, 2016, 2017 Dapphub + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +pragma solidity 0.8.19; + +contract WETH9 { + string public name = "Wrapped Ether"; + string public symbol = "WETH"; + uint8 public decimals = 18; + + event Approval(address indexed src, address indexed guy, uint256 wad); + event Transfer(address indexed src, address indexed dst, uint256 wad); + event Deposit(address indexed dst, uint256 wad); + event Withdrawal(address indexed src, uint256 wad); + + error InsufficientBalance(); + + mapping(address => uint256) public balanceOf; + mapping(address => mapping(address => uint256)) public allowance; + + receive() external payable { + _deposit(); + } + + function _deposit() internal { + balanceOf[msg.sender] += msg.value; + emit Deposit(msg.sender, msg.value); + } + + function deposit() external payable { + _deposit(); + } + + function mint(address account, uint256 amount) public { + balanceOf[account] += amount; + } + + function withdraw(uint256 wad) external { + if (balanceOf[msg.sender] < wad) { + revert InsufficientBalance(); + } + balanceOf[msg.sender] -= wad; + payable(msg.sender).call{value: wad}(""); + emit Withdrawal(msg.sender, wad); + } + + function totalSupply() public view returns (uint256) { + return address(this).balance; + } + + function approve(address guy, uint256 wad) public returns (bool) { + allowance[msg.sender][guy] = wad; + emit Approval(msg.sender, guy, wad); + return true; + } + + function transfer(address dst, uint256 wad) public returns (bool) { + return transferFrom(msg.sender, dst, wad); + } + + function transferFrom(address src, address dst, uint256 wad) public returns (bool) { + if (balanceOf[src] < wad) { + revert InsufficientBalance(); + } + + if (src != msg.sender && allowance[src][msg.sender] != type(uint128).max) { + if (allowance[src][msg.sender] < wad) { + revert InsufficientBalance(); + } + allowance[src][msg.sender] -= wad; + } + + balanceOf[src] -= wad; + balanceOf[dst] += wad; + + emit Transfer(src, dst, wad); + + return true; + } +} diff --git a/contracts/src/v0.8/automation/test/v2_3/AutomationRegistry2_3.t.sol b/contracts/src/v0.8/automation/test/v2_3/AutomationRegistry2_3.t.sol index dbc0c203c07..41aabf1bbe2 100644 --- a/contracts/src/v0.8/automation/test/v2_3/AutomationRegistry2_3.t.sol +++ b/contracts/src/v0.8/automation/test/v2_3/AutomationRegistry2_3.t.sol @@ -22,11 +22,11 @@ contract SetUp is BaseTest { AutomationRegistryBase2_3.OnchainConfig internal config; bytes internal constant offchainConfigBytes = abi.encode(1234, ZERO_ADDRESS); - uint256 linkUpkeepID; - uint256 linkUpkeepID2; // 2 upkeeps use the same billing token (LINK) to test migration scenario - uint256 usdUpkeepID18; // 1 upkeep uses ERC20 token with 18 decimals - uint256 usdUpkeepID6; // 1 upkeep uses ERC20 token with 6 decimals - uint256 nativeUpkeepID; + uint256 internal linkUpkeepID; + uint256 internal linkUpkeepID2; // 2 upkeeps use the same billing token (LINK) to test migration scenario + uint256 internal usdUpkeepID18; // 1 upkeep uses ERC20 token with 18 decimals + uint256 internal usdUpkeepID6; // 1 upkeep uses ERC20 token with 6 decimals + uint256 internal nativeUpkeepID; function setUp() public virtual override { super.setUp(); @@ -790,6 +790,7 @@ contract SetConfig is SetUp { } function testSetConfigOnTransmittersAndPayees() public { + registry.setPayees(PAYEES); AutomationRegistryBase2_3.TransmitterPayeeInfo[] memory transmitterPayeeInfos = registry .getTransmittersWithPayees(); assertEq(transmitterPayeeInfos.length, TRANSMITTERS.length); @@ -975,6 +976,7 @@ contract NOPsSettlement is SetUp { function testSettleNOPsOffchainSuccess() public { // deploy and configure a registry with OFF_CHAIN payout (Registry registry, ) = deployAndConfigureRegistryAndRegistrar(AutoBase.PayoutMode.OFF_CHAIN); + registry.setPayees(PAYEES); uint256[] memory payments = new uint256[](TRANSMITTERS.length); for (uint256 i = 0; i < TRANSMITTERS.length; i++) { @@ -991,6 +993,7 @@ contract NOPsSettlement is SetUp { function testSettleNOPsOffchainSuccessWithERC20MultiSteps() public { // deploy and configure a registry with OFF_CHAIN payout (Registry registry, ) = deployAndConfigureRegistryAndRegistrar(AutoBase.PayoutMode.OFF_CHAIN); + registry.setPayees(PAYEES); // register an upkeep and add funds uint256 id = registry.registerUpkeep(address(TARGET1), 1000000, UPKEEP_ADMIN, 0, address(usdToken18), "", "", ""); @@ -1186,6 +1189,7 @@ contract NOPsSettlement is SetUp { function testSinglePerformAndNodesCanWithdrawOnchain() public { // deploy and configure a registry with OFF_CHAIN payout (Registry registry, ) = deployAndConfigureRegistryAndRegistrar(AutoBase.PayoutMode.OFF_CHAIN); + registry.setPayees(PAYEES); // register an upkeep and add funds uint256 id = registry.registerUpkeep(address(TARGET1), 1000000, UPKEEP_ADMIN, 0, address(usdToken18), "", "", ""); @@ -1224,6 +1228,7 @@ contract NOPsSettlement is SetUp { function testMultiplePerformsAndNodesCanWithdrawOnchain() public { // deploy and configure a registry with OFF_CHAIN payout (Registry registry, ) = deployAndConfigureRegistryAndRegistrar(AutoBase.PayoutMode.OFF_CHAIN); + registry.setPayees(PAYEES); // register an upkeep and add funds uint256 id = registry.registerUpkeep(address(TARGET1), 1000000, UPKEEP_ADMIN, 0, address(usdToken18), "", "", ""); @@ -1977,3 +1982,772 @@ contract MigrateReceive is SetUp { vm.stopPrank(); } } + +contract Pause is SetUp { + function test_RevertsWhen_CalledByNonOwner() external { + vm.expectRevert(bytes("Only callable by owner")); + vm.prank(STRANGER); + registry.pause(); + } + + function test_CalledByOwner_success() external { + vm.startPrank(registry.owner()); + registry.pause(); + + (IAutomationV21PlusCommon.StateLegacy memory state, , , , ) = registry.getState(); + assertTrue(state.paused); + } + + function test_revertsWhen_transmitInPausedRegistry() external { + vm.startPrank(registry.owner()); + registry.pause(); + + _transmitAndExpectRevert(usdUpkeepID18, registry, Registry.RegistryPaused.selector); + } +} + +contract Unpause is SetUp { + function test_RevertsWhen_CalledByNonOwner() external { + vm.startPrank(registry.owner()); + registry.pause(); + + vm.expectRevert(bytes("Only callable by owner")); + vm.startPrank(STRANGER); + registry.unpause(); + } + + function test_CalledByOwner_success() external { + vm.startPrank(registry.owner()); + registry.pause(); + (IAutomationV21PlusCommon.StateLegacy memory state1, , , , ) = registry.getState(); + assertTrue(state1.paused); + + registry.unpause(); + (IAutomationV21PlusCommon.StateLegacy memory state2, , , , ) = registry.getState(); + assertFalse(state2.paused); + } +} + +contract CancelUpkeep is SetUp { + event UpkeepCanceled(uint256 indexed id, uint64 indexed atBlockHeight); + + function test_RevertsWhen_IdIsInvalid_CalledByAdmin() external { + vm.startPrank(UPKEEP_ADMIN); + vm.expectRevert(Registry.CannotCancel.selector); + registry.cancelUpkeep(1111111); + } + + function test_RevertsWhen_IdIsInvalid_CalledByOwner() external { + vm.startPrank(registry.owner()); + vm.expectRevert(Registry.CannotCancel.selector); + registry.cancelUpkeep(1111111); + } + + function test_RevertsWhen_NotCalledByOwnerOrAdmin() external { + vm.startPrank(STRANGER); + vm.expectRevert(Registry.OnlyCallableByOwnerOrAdmin.selector); + registry.cancelUpkeep(linkUpkeepID); + } + + function test_RevertsWhen_UpkeepAlreadyCanceledByAdmin_CalledByOwner() external { + uint256 bn = block.number; + vm.startPrank(UPKEEP_ADMIN); + registry.cancelUpkeep(linkUpkeepID); + + vm.startPrank(registry.owner()); + vm.expectRevert(Registry.UpkeepCancelled.selector); + registry.cancelUpkeep(linkUpkeepID); + } + + function test_RevertsWhen_UpkeepAlreadyCanceledByOwner_CalledByAdmin() external { + uint256 bn = block.number; + vm.startPrank(registry.owner()); + registry.cancelUpkeep(linkUpkeepID); + + vm.startPrank(UPKEEP_ADMIN); + vm.expectRevert(Registry.UpkeepCancelled.selector); + registry.cancelUpkeep(linkUpkeepID); + } + + function test_RevertsWhen_UpkeepAlreadyCanceledByAdmin_CalledByAdmin() external { + uint256 bn = block.number; + vm.startPrank(UPKEEP_ADMIN); + registry.cancelUpkeep(linkUpkeepID); + + vm.expectRevert(Registry.UpkeepCancelled.selector); + registry.cancelUpkeep(linkUpkeepID); + } + + function test_RevertsWhen_UpkeepAlreadyCanceledByOwner_CalledByOwner() external { + uint256 bn = block.number; + vm.startPrank(registry.owner()); + registry.cancelUpkeep(linkUpkeepID); + + vm.expectRevert(Registry.UpkeepCancelled.selector); + registry.cancelUpkeep(linkUpkeepID); + } + + function test_CancelUpkeep_SetMaxValidBlockNumber_CalledByAdmin() external { + uint256 bn = block.number; + vm.startPrank(UPKEEP_ADMIN); + registry.cancelUpkeep(linkUpkeepID); + + uint256 maxValidBlocknumber = uint256(registry.getUpkeep(linkUpkeepID).maxValidBlocknumber); + + // 50 is the cancellation delay + assertEq(bn + 50, maxValidBlocknumber); + } + + function test_CancelUpkeep_SetMaxValidBlockNumber_CalledByOwner() external { + uint256 bn = block.number; + vm.startPrank(registry.owner()); + registry.cancelUpkeep(linkUpkeepID); + + uint256 maxValidBlocknumber = uint256(registry.getUpkeep(linkUpkeepID).maxValidBlocknumber); + + // cancellation by registry owner is immediate and no cancellation delay is applied + assertEq(bn, maxValidBlocknumber); + } + + function test_CancelUpkeep_EmitEvent_CalledByAdmin() external { + uint256 bn = block.number; + vm.startPrank(UPKEEP_ADMIN); + + vm.expectEmit(); + emit UpkeepCanceled(linkUpkeepID, uint64(bn + 50)); + registry.cancelUpkeep(linkUpkeepID); + } + + function test_CancelUpkeep_EmitEvent_CalledByOwner() external { + uint256 bn = block.number; + vm.startPrank(registry.owner()); + + vm.expectEmit(); + emit UpkeepCanceled(linkUpkeepID, uint64(bn)); + registry.cancelUpkeep(linkUpkeepID); + } +} + +contract SetPeerRegistryMigrationPermission is SetUp { + function test_SetPeerRegistryMigrationPermission_CalledByOwner() external { + address peer = randomAddress(); + vm.startPrank(registry.owner()); + + uint8 permission = registry.getPeerRegistryMigrationPermission(peer); + assertEq(0, permission); + + registry.setPeerRegistryMigrationPermission(peer, 1); + permission = registry.getPeerRegistryMigrationPermission(peer); + assertEq(1, permission); + + registry.setPeerRegistryMigrationPermission(peer, 2); + permission = registry.getPeerRegistryMigrationPermission(peer); + assertEq(2, permission); + + registry.setPeerRegistryMigrationPermission(peer, 0); + permission = registry.getPeerRegistryMigrationPermission(peer); + assertEq(0, permission); + } + + function test_RevertsWhen_InvalidPermission_CalledByOwner() external { + address peer = randomAddress(); + vm.startPrank(registry.owner()); + + vm.expectRevert(); + registry.setPeerRegistryMigrationPermission(peer, 100); + } + + function test_RevertsWhen_CalledByNonOwner() external { + address peer = randomAddress(); + vm.startPrank(STRANGER); + + vm.expectRevert(bytes("Only callable by owner")); + registry.setPeerRegistryMigrationPermission(peer, 1); + } +} + +contract SetUpkeepPrivilegeConfig is SetUp { + function test_RevertsWhen_CalledByNonManager() external { + vm.startPrank(STRANGER); + + vm.expectRevert(Registry.OnlyCallableByUpkeepPrivilegeManager.selector); + registry.setUpkeepPrivilegeConfig(linkUpkeepID, hex"1233"); + } + + function test_UpkeepHasEmptyConfig() external { + bytes memory cfg = registry.getUpkeepPrivilegeConfig(linkUpkeepID); + assertEq(cfg, bytes("")); + } + + function test_SetUpkeepPrivilegeConfig_CalledByManager() external { + vm.startPrank(PRIVILEGE_MANAGER); + + registry.setUpkeepPrivilegeConfig(linkUpkeepID, hex"1233"); + + bytes memory cfg = registry.getUpkeepPrivilegeConfig(linkUpkeepID); + assertEq(cfg, hex"1233"); + } +} + +contract SetAdminPrivilegeConfig is SetUp { + function test_RevertsWhen_CalledByNonManager() external { + vm.startPrank(STRANGER); + + vm.expectRevert(Registry.OnlyCallableByUpkeepPrivilegeManager.selector); + registry.setAdminPrivilegeConfig(randomAddress(), hex"1233"); + } + + function test_UpkeepHasEmptyConfig() external { + bytes memory cfg = registry.getAdminPrivilegeConfig(randomAddress()); + assertEq(cfg, bytes("")); + } + + function test_SetAdminPrivilegeConfig_CalledByManager() external { + vm.startPrank(PRIVILEGE_MANAGER); + address admin = randomAddress(); + + registry.setAdminPrivilegeConfig(admin, hex"1233"); + + bytes memory cfg = registry.getAdminPrivilegeConfig(admin); + assertEq(cfg, hex"1233"); + } +} + +contract TransferUpkeepAdmin is SetUp { + event UpkeepAdminTransferRequested(uint256 indexed id, address indexed from, address indexed to); + + function test_RevertsWhen_NotCalledByAdmin() external { + vm.startPrank(STRANGER); + + vm.expectRevert(Registry.OnlyCallableByAdmin.selector); + registry.transferUpkeepAdmin(linkUpkeepID, randomAddress()); + } + + function test_RevertsWhen_TransferToSelf() external { + vm.startPrank(UPKEEP_ADMIN); + + vm.expectRevert(Registry.ValueNotChanged.selector); + registry.transferUpkeepAdmin(linkUpkeepID, UPKEEP_ADMIN); + } + + function test_RevertsWhen_UpkeepCanceled() external { + vm.startPrank(UPKEEP_ADMIN); + + registry.cancelUpkeep(linkUpkeepID); + + vm.expectRevert(Registry.UpkeepCancelled.selector); + registry.transferUpkeepAdmin(linkUpkeepID, randomAddress()); + } + + function test_DoesNotChangeUpkeepAdmin() external { + vm.startPrank(UPKEEP_ADMIN); + registry.transferUpkeepAdmin(linkUpkeepID, randomAddress()); + + assertEq(registry.getUpkeep(linkUpkeepID).admin, UPKEEP_ADMIN); + } + + function test_EmitEvent_CalledByAdmin() external { + vm.startPrank(UPKEEP_ADMIN); + address newAdmin = randomAddress(); + + vm.expectEmit(); + emit UpkeepAdminTransferRequested(linkUpkeepID, UPKEEP_ADMIN, newAdmin); + registry.transferUpkeepAdmin(linkUpkeepID, newAdmin); + + // transferring to the same propose admin won't yield another event + vm.recordLogs(); + registry.transferUpkeepAdmin(linkUpkeepID, newAdmin); + Vm.Log[] memory entries = vm.getRecordedLogs(); + assertEq(0, entries.length); + } + + function test_CancelTransfer_ByTransferToEmptyAddress() external { + vm.startPrank(UPKEEP_ADMIN); + address newAdmin = randomAddress(); + + vm.expectEmit(); + emit UpkeepAdminTransferRequested(linkUpkeepID, UPKEEP_ADMIN, newAdmin); + registry.transferUpkeepAdmin(linkUpkeepID, newAdmin); + + vm.expectEmit(); + emit UpkeepAdminTransferRequested(linkUpkeepID, UPKEEP_ADMIN, address(0)); + registry.transferUpkeepAdmin(linkUpkeepID, address(0)); + } +} + +contract AcceptUpkeepAdmin is SetUp { + event UpkeepAdminTransferred(uint256 indexed id, address indexed from, address indexed to); + + function test_RevertsWhen_NotCalledByProposedAdmin() external { + vm.startPrank(UPKEEP_ADMIN); + address newAdmin = randomAddress(); + registry.transferUpkeepAdmin(linkUpkeepID, newAdmin); + + vm.startPrank(STRANGER); + vm.expectRevert(Registry.OnlyCallableByProposedAdmin.selector); + registry.acceptUpkeepAdmin(linkUpkeepID); + } + + function test_RevertsWhen_UpkeepCanceled() external { + vm.startPrank(UPKEEP_ADMIN); + address newAdmin = randomAddress(); + registry.transferUpkeepAdmin(linkUpkeepID, newAdmin); + + registry.cancelUpkeep(linkUpkeepID); + + vm.startPrank(newAdmin); + vm.expectRevert(Registry.UpkeepCancelled.selector); + registry.acceptUpkeepAdmin(linkUpkeepID); + } + + function test_UpkeepAdminChanged() external { + vm.startPrank(UPKEEP_ADMIN); + address newAdmin = randomAddress(); + registry.transferUpkeepAdmin(linkUpkeepID, newAdmin); + + vm.startPrank(newAdmin); + vm.expectEmit(); + emit UpkeepAdminTransferred(linkUpkeepID, UPKEEP_ADMIN, newAdmin); + registry.acceptUpkeepAdmin(linkUpkeepID); + + assertEq(newAdmin, registry.getUpkeep(linkUpkeepID).admin); + } +} + +contract PauseUpkeep is SetUp { + event UpkeepPaused(uint256 indexed id); + + function test_RevertsWhen_NotCalledByUpkeepAdmin() external { + vm.startPrank(STRANGER); + + vm.expectRevert(Registry.OnlyCallableByAdmin.selector); + registry.pauseUpkeep(linkUpkeepID); + } + + function test_RevertsWhen_InvalidUpkeepId() external { + vm.startPrank(UPKEEP_ADMIN); + + vm.expectRevert(Registry.OnlyCallableByAdmin.selector); + registry.pauseUpkeep(linkUpkeepID + 1); + } + + function test_RevertsWhen_UpkeepAlreadyCanceled() external { + vm.startPrank(UPKEEP_ADMIN); + registry.cancelUpkeep(linkUpkeepID); + + vm.expectRevert(Registry.UpkeepCancelled.selector); + registry.pauseUpkeep(linkUpkeepID); + } + + function test_RevertsWhen_UpkeepAlreadyPaused() external { + vm.startPrank(UPKEEP_ADMIN); + registry.pauseUpkeep(linkUpkeepID); + + vm.expectRevert(Registry.OnlyUnpausedUpkeep.selector); + registry.pauseUpkeep(linkUpkeepID); + } + + function test_EmitEvent_CalledByAdmin() external { + vm.startPrank(UPKEEP_ADMIN); + + vm.expectEmit(); + emit UpkeepPaused(linkUpkeepID); + registry.pauseUpkeep(linkUpkeepID); + } +} + +contract UnpauseUpkeep is SetUp { + event UpkeepUnpaused(uint256 indexed id); + + function test_RevertsWhen_InvalidUpkeepId() external { + vm.startPrank(UPKEEP_ADMIN); + + vm.expectRevert(Registry.OnlyCallableByAdmin.selector); + registry.unpauseUpkeep(linkUpkeepID + 1); + } + + function test_RevertsWhen_UpkeepIsNotPaused() external { + vm.startPrank(UPKEEP_ADMIN); + + vm.expectRevert(Registry.OnlyPausedUpkeep.selector); + registry.unpauseUpkeep(linkUpkeepID); + } + + function test_RevertsWhen_UpkeepAlreadyCanceled() external { + vm.startPrank(UPKEEP_ADMIN); + registry.pauseUpkeep(linkUpkeepID); + + registry.cancelUpkeep(linkUpkeepID); + + vm.expectRevert(Registry.UpkeepCancelled.selector); + registry.unpauseUpkeep(linkUpkeepID); + } + + function test_RevertsWhen_NotCalledByUpkeepAdmin() external { + vm.startPrank(UPKEEP_ADMIN); + registry.pauseUpkeep(linkUpkeepID); + + vm.startPrank(STRANGER); + vm.expectRevert(Registry.OnlyCallableByAdmin.selector); + registry.unpauseUpkeep(linkUpkeepID); + } + + function test_UnpauseUpkeep_CalledByUpkeepAdmin() external { + vm.startPrank(UPKEEP_ADMIN); + registry.pauseUpkeep(linkUpkeepID); + + uint256[] memory ids1 = registry.getActiveUpkeepIDs(0, 0); + + vm.expectEmit(); + emit UpkeepUnpaused(linkUpkeepID); + registry.unpauseUpkeep(linkUpkeepID); + + uint256[] memory ids2 = registry.getActiveUpkeepIDs(0, 0); + assertEq(ids1.length + 1, ids2.length); + } +} + +contract SetUpkeepCheckData is SetUp { + event UpkeepCheckDataSet(uint256 indexed id, bytes newCheckData); + + function test_RevertsWhen_InvalidUpkeepId() external { + vm.startPrank(UPKEEP_ADMIN); + + vm.expectRevert(Registry.OnlyCallableByAdmin.selector); + registry.setUpkeepCheckData(linkUpkeepID + 1, hex"1234"); + } + + function test_RevertsWhen_UpkeepAlreadyCanceled() external { + vm.startPrank(UPKEEP_ADMIN); + registry.cancelUpkeep(linkUpkeepID); + + vm.expectRevert(Registry.UpkeepCancelled.selector); + registry.setUpkeepCheckData(linkUpkeepID, hex"1234"); + } + + function test_RevertsWhen_NewCheckDataTooLarge() external { + vm.startPrank(UPKEEP_ADMIN); + + vm.expectRevert(Registry.CheckDataExceedsLimit.selector); + registry.setUpkeepCheckData(linkUpkeepID, new bytes(10_000)); + } + + function test_RevertsWhen_NotCalledByAdmin() external { + vm.startPrank(STRANGER); + + vm.expectRevert(Registry.OnlyCallableByAdmin.selector); + registry.setUpkeepCheckData(linkUpkeepID, hex"1234"); + } + + function test_UpdateOffchainConfig_CalledByAdmin() external { + vm.startPrank(UPKEEP_ADMIN); + + vm.expectEmit(); + emit UpkeepCheckDataSet(linkUpkeepID, hex"1234"); + registry.setUpkeepCheckData(linkUpkeepID, hex"1234"); + + assertEq(registry.getUpkeep(linkUpkeepID).checkData, hex"1234"); + } + + function test_UpdateOffchainConfigOnPausedUpkeep_CalledByAdmin() external { + vm.startPrank(UPKEEP_ADMIN); + + registry.pauseUpkeep(linkUpkeepID); + + vm.expectEmit(); + emit UpkeepCheckDataSet(linkUpkeepID, hex"1234"); + registry.setUpkeepCheckData(linkUpkeepID, hex"1234"); + + assertTrue(registry.getUpkeep(linkUpkeepID).paused); + assertEq(registry.getUpkeep(linkUpkeepID).checkData, hex"1234"); + } +} + +contract SetUpkeepGasLimit is SetUp { + event UpkeepGasLimitSet(uint256 indexed id, uint96 gasLimit); + + function test_RevertsWhen_InvalidUpkeepId() external { + vm.startPrank(UPKEEP_ADMIN); + + vm.expectRevert(Registry.OnlyCallableByAdmin.selector); + registry.setUpkeepGasLimit(linkUpkeepID + 1, 1230000); + } + + function test_RevertsWhen_UpkeepAlreadyCanceled() external { + vm.startPrank(UPKEEP_ADMIN); + registry.cancelUpkeep(linkUpkeepID); + + vm.expectRevert(Registry.UpkeepCancelled.selector); + registry.setUpkeepGasLimit(linkUpkeepID, 1230000); + } + + function test_RevertsWhen_NewGasLimitOutOfRange() external { + vm.startPrank(UPKEEP_ADMIN); + + vm.expectRevert(Registry.GasLimitOutsideRange.selector); + registry.setUpkeepGasLimit(linkUpkeepID, 300); + + vm.expectRevert(Registry.GasLimitOutsideRange.selector); + registry.setUpkeepGasLimit(linkUpkeepID, 3000000000); + } + + function test_RevertsWhen_NotCalledByAdmin() external { + vm.startPrank(STRANGER); + + vm.expectRevert(Registry.OnlyCallableByAdmin.selector); + registry.setUpkeepGasLimit(linkUpkeepID, 1230000); + } + + function test_UpdateGasLimit_CalledByAdmin() external { + vm.startPrank(UPKEEP_ADMIN); + + vm.expectEmit(); + emit UpkeepGasLimitSet(linkUpkeepID, 1230000); + registry.setUpkeepGasLimit(linkUpkeepID, 1230000); + + assertEq(registry.getUpkeep(linkUpkeepID).performGas, 1230000); + } +} + +contract SetUpkeepOffchainConfig is SetUp { + event UpkeepOffchainConfigSet(uint256 indexed id, bytes offchainConfig); + + function test_RevertsWhen_InvalidUpkeepId() external { + vm.startPrank(UPKEEP_ADMIN); + + vm.expectRevert(Registry.OnlyCallableByAdmin.selector); + registry.setUpkeepOffchainConfig(linkUpkeepID + 1, hex"1233"); + } + + function test_RevertsWhen_UpkeepAlreadyCanceled() external { + vm.startPrank(UPKEEP_ADMIN); + registry.cancelUpkeep(linkUpkeepID); + + vm.expectRevert(Registry.UpkeepCancelled.selector); + registry.setUpkeepOffchainConfig(linkUpkeepID, hex"1234"); + } + + function test_RevertsWhen_NotCalledByAdmin() external { + vm.startPrank(STRANGER); + + vm.expectRevert(Registry.OnlyCallableByAdmin.selector); + registry.setUpkeepOffchainConfig(linkUpkeepID, hex"1234"); + } + + function test_UpdateOffchainConfig_CalledByAdmin() external { + vm.startPrank(UPKEEP_ADMIN); + + vm.expectEmit(); + emit UpkeepOffchainConfigSet(linkUpkeepID, hex"1234"); + registry.setUpkeepOffchainConfig(linkUpkeepID, hex"1234"); + + assertEq(registry.getUpkeep(linkUpkeepID).offchainConfig, hex"1234"); + } +} + +contract SetUpkeepTriggerConfig is SetUp { + event UpkeepTriggerConfigSet(uint256 indexed id, bytes triggerConfig); + + function test_RevertsWhen_InvalidUpkeepId() external { + vm.startPrank(UPKEEP_ADMIN); + + vm.expectRevert(Registry.OnlyCallableByAdmin.selector); + registry.setUpkeepTriggerConfig(linkUpkeepID + 1, hex"1233"); + } + + function test_RevertsWhen_UpkeepAlreadyCanceled() external { + vm.startPrank(UPKEEP_ADMIN); + registry.cancelUpkeep(linkUpkeepID); + + vm.expectRevert(Registry.UpkeepCancelled.selector); + registry.setUpkeepTriggerConfig(linkUpkeepID, hex"1234"); + } + + function test_RevertsWhen_NotCalledByAdmin() external { + vm.startPrank(STRANGER); + + vm.expectRevert(Registry.OnlyCallableByAdmin.selector); + registry.setUpkeepTriggerConfig(linkUpkeepID, hex"1234"); + } + + function test_UpdateTriggerConfig_CalledByAdmin() external { + vm.startPrank(UPKEEP_ADMIN); + + vm.expectEmit(); + emit UpkeepTriggerConfigSet(linkUpkeepID, hex"1234"); + registry.setUpkeepTriggerConfig(linkUpkeepID, hex"1234"); + + assertEq(registry.getUpkeepTriggerConfig(linkUpkeepID), hex"1234"); + } +} + +contract TransferPayeeship is SetUp { + event PayeeshipTransferRequested(address indexed transmitter, address indexed from, address indexed to); + + function test_RevertsWhen_NotCalledByPayee() external { + vm.startPrank(STRANGER); + + vm.expectRevert(Registry.OnlyCallableByPayee.selector); + registry.transferPayeeship(TRANSMITTERS[0], randomAddress()); + } + + function test_RevertsWhen_TransferToSelf() external { + registry.setPayees(PAYEES); + vm.startPrank(PAYEES[0]); + + vm.expectRevert(Registry.ValueNotChanged.selector); + registry.transferPayeeship(TRANSMITTERS[0], PAYEES[0]); + } + + function test_Transfer_DoesNotChangePayee() external { + registry.setPayees(PAYEES); + + vm.startPrank(PAYEES[0]); + + registry.transferPayeeship(TRANSMITTERS[0], randomAddress()); + + (, , , , address payee) = registry.getTransmitterInfo(TRANSMITTERS[0]); + assertEq(PAYEES[0], payee); + } + + function test_EmitEvent_CalledByPayee() external { + registry.setPayees(PAYEES); + + vm.startPrank(PAYEES[0]); + address newPayee = randomAddress(); + + vm.expectEmit(); + emit PayeeshipTransferRequested(TRANSMITTERS[0], PAYEES[0], newPayee); + registry.transferPayeeship(TRANSMITTERS[0], newPayee); + + // transferring to the same propose payee won't yield another event + vm.recordLogs(); + registry.transferPayeeship(TRANSMITTERS[0], newPayee); + Vm.Log[] memory entries = vm.getRecordedLogs(); + assertEq(0, entries.length); + } +} + +contract AcceptPayeeship is SetUp { + event PayeeshipTransferred(address indexed transmitter, address indexed from, address indexed to); + + function test_RevertsWhen_NotCalledByProposedPayee() external { + registry.setPayees(PAYEES); + + vm.startPrank(PAYEES[0]); + address newPayee = randomAddress(); + registry.transferPayeeship(TRANSMITTERS[0], newPayee); + + vm.startPrank(STRANGER); + vm.expectRevert(Registry.OnlyCallableByProposedPayee.selector); + registry.acceptPayeeship(TRANSMITTERS[0]); + } + + function test_PayeeChanged() external { + registry.setPayees(PAYEES); + + vm.startPrank(PAYEES[0]); + address newPayee = randomAddress(); + registry.transferPayeeship(TRANSMITTERS[0], newPayee); + + vm.startPrank(newPayee); + vm.expectEmit(); + emit PayeeshipTransferred(TRANSMITTERS[0], PAYEES[0], newPayee); + registry.acceptPayeeship(TRANSMITTERS[0]); + + (, , , , address payee) = registry.getTransmitterInfo(TRANSMITTERS[0]); + assertEq(newPayee, payee); + } +} + +contract SetPayees is SetUp { + event PayeesUpdated(address[] transmitters, address[] payees); + + function test_RevertsWhen_NotCalledByOwner() external { + vm.startPrank(STRANGER); + + vm.expectRevert(bytes("Only callable by owner")); + registry.setPayees(NEW_PAYEES); + } + + function test_RevertsWhen_PayeesLengthError() external { + vm.startPrank(registry.owner()); + + address[] memory payees = new address[](5); + vm.expectRevert(Registry.ParameterLengthError.selector); + registry.setPayees(payees); + } + + function test_RevertsWhen_InvalidPayee() external { + vm.startPrank(registry.owner()); + + NEW_PAYEES[0] = address(0); + vm.expectRevert(Registry.InvalidPayee.selector); + registry.setPayees(NEW_PAYEES); + } + + function test_SetPayees_WhenExistingPayeesAreEmpty() external { + (registry, ) = deployAndConfigureRegistryAndRegistrar(AutoBase.PayoutMode.ON_CHAIN); + + for (uint256 i = 0; i < TRANSMITTERS.length; i++) { + (, , , , address payee) = registry.getTransmitterInfo(TRANSMITTERS[i]); + assertEq(address(0), payee); + } + + vm.startPrank(registry.owner()); + + vm.expectEmit(); + emit PayeesUpdated(TRANSMITTERS, PAYEES); + registry.setPayees(PAYEES); + for (uint256 i = 0; i < TRANSMITTERS.length; i++) { + (bool active, , , , address payee) = registry.getTransmitterInfo(TRANSMITTERS[i]); + assertTrue(active); + assertEq(PAYEES[i], payee); + } + } + + function test_DotNotSetPayeesToIgnoredAddress() external { + address IGNORE_ADDRESS = 0xFFfFfFffFFfffFFfFFfFFFFFffFFFffffFfFFFfF; + (registry, ) = deployAndConfigureRegistryAndRegistrar(AutoBase.PayoutMode.ON_CHAIN); + PAYEES[0] = IGNORE_ADDRESS; + + registry.setPayees(PAYEES); + (bool active, , , , address payee) = registry.getTransmitterInfo(TRANSMITTERS[0]); + assertTrue(active); + assertEq(address(0), payee); + + (active, , , , payee) = registry.getTransmitterInfo(TRANSMITTERS[1]); + assertTrue(active); + assertEq(PAYEES[1], payee); + } +} + +contract GetActiveUpkeepIDs is SetUp { + function test_RevertsWhen_IndexOutOfRange() external { + vm.expectRevert(Registry.IndexOutOfRange.selector); + registry.getActiveUpkeepIDs(5, 0); + + vm.expectRevert(Registry.IndexOutOfRange.selector); + registry.getActiveUpkeepIDs(6, 0); + } + + function test_ReturnsAllUpkeeps_WhenMaxCountIsZero() external { + uint256[] memory uids = registry.getActiveUpkeepIDs(0, 0); + assertEq(5, uids.length); + + uids = registry.getActiveUpkeepIDs(2, 0); + assertEq(3, uids.length); + } + + function test_ReturnsAllRemainingUpkeeps_WhenMaxCountIsTooLarge() external { + uint256[] memory uids = registry.getActiveUpkeepIDs(2, 20); + assertEq(3, uids.length); + } + + function test_ReturnsUpkeeps_BoundByMaxCount() external { + uint256[] memory uids = registry.getActiveUpkeepIDs(1, 2); + assertEq(2, uids.length); + assertEq(uids[0], linkUpkeepID2); + assertEq(uids[1], usdUpkeepID18); + } +} diff --git a/contracts/src/v0.8/automation/test/v2_3/BaseTest.t.sol b/contracts/src/v0.8/automation/test/v2_3/BaseTest.t.sol index 9016f52c55d..e0d15daab6c 100644 --- a/contracts/src/v0.8/automation/test/v2_3/BaseTest.t.sol +++ b/contracts/src/v0.8/automation/test/v2_3/BaseTest.t.sol @@ -20,14 +20,14 @@ import {ChainModuleBase} from "../../chains/ChainModuleBase.sol"; import {IERC20Metadata as IERC20} from "../../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/extensions/IERC20Metadata.sol"; import {MockUpkeep} from "../../mocks/MockUpkeep.sol"; import {IWrappedNative} from "../../interfaces/v2_3/IWrappedNative.sol"; -import {WETH9} from "./WETH9.sol"; +import {WETH9} from "../WETH9.sol"; /** * @title BaseTest provides basic test setup procedures and dependencies for use by other * unit tests */ contract BaseTest is Test { - // test state (not exposed to derrived tests) + // test state (not exposed to derived tests) uint256 private nonce; // constants @@ -283,7 +283,6 @@ contract BaseTest is Test { billingTokenAddresses, billingTokenConfigs ); - registry.setPayees(PAYEES); return (registry, registrar); } @@ -356,40 +355,58 @@ contract BaseTest is Test { ); } + // tests single upkeep, expects success function _transmit(uint256 id, Registry registry) internal { uint256[] memory ids = new uint256[](1); ids[0] = id; - _transmit(ids, registry); + _handleTransmit(ids, registry, bytes4(0)); } + // tests multiple upkeeps, expects success function _transmit(uint256[] memory ids, Registry registry) internal { - uint256[] memory upkeepIds = new uint256[](ids.length); - uint256[] memory gasLimits = new uint256[](ids.length); - bytes[] memory performDatas = new bytes[](ids.length); - bytes[] memory triggers = new bytes[](ids.length); - for (uint256 i = 0; i < ids.length; i++) { - upkeepIds[i] = ids[i]; - gasLimits[i] = registry.getUpkeep(ids[i]).performGas; - performDatas[i] = new bytes(0); - uint8 triggerType = registry.getTriggerType(ids[i]); - if (triggerType == 0) { - triggers[i] = _encodeConditionalTrigger( - AutoBase.ConditionalTrigger(uint32(block.number - 1), blockhash(block.number - 1)) - ); - } else { - revert("not implemented"); + _handleTransmit(ids, registry, bytes4(0)); + } + + // tests single upkeep, expects revert + function _transmitAndExpectRevert(uint256 id, Registry registry, bytes4 selector) internal { + uint256[] memory ids = new uint256[](1); + ids[0] = id; + _handleTransmit(ids, registry, selector); + } + + // private function not exposed to actual testing contract + function _handleTransmit(uint256[] memory ids, Registry registry, bytes4 selector) private { + bytes memory reportBytes; + { + uint256[] memory upkeepIds = new uint256[](ids.length); + uint256[] memory gasLimits = new uint256[](ids.length); + bytes[] memory performDatas = new bytes[](ids.length); + bytes[] memory triggers = new bytes[](ids.length); + for (uint256 i = 0; i < ids.length; i++) { + upkeepIds[i] = ids[i]; + gasLimits[i] = registry.getUpkeep(ids[i]).performGas; + performDatas[i] = new bytes(0); + uint8 triggerType = registry.getTriggerType(ids[i]); + if (triggerType == 0) { + triggers[i] = _encodeConditionalTrigger( + AutoBase.ConditionalTrigger(uint32(block.number - 1), blockhash(block.number - 1)) + ); + } else { + revert("not implemented"); + } } - } - AutoBase.Report memory report = AutoBase.Report( - uint256(1000000000), - uint256(2000000000), - upkeepIds, - gasLimits, - triggers, - performDatas - ); - bytes memory reportBytes = _encodeReport(report); + AutoBase.Report memory report = AutoBase.Report( + uint256(1000000000), + uint256(2000000000), + upkeepIds, + gasLimits, + triggers, + performDatas + ); + + reportBytes = _encodeReport(report); + } (, , bytes32 configDigest) = registry.latestConfigDetails(); bytes32[3] memory reportContext = [configDigest, configDigest, configDigest]; uint256[] memory signerPKs = new uint256[](2); @@ -398,6 +415,9 @@ contract BaseTest is Test { (bytes32[] memory rs, bytes32[] memory ss, bytes32 vs) = _signReport(reportBytes, reportContext, signerPKs); vm.startPrank(TRANSMITTERS[0]); + if (selector != bytes4(0)) { + vm.expectRevert(selector); + } registry.transmit(reportContext, reportBytes, rs, ss, vs); vm.stopPrank(); } diff --git a/contracts/src/v0.8/automation/test/v2_3/WETH9.sol b/contracts/src/v0.8/automation/test/v2_3/WETH9.sol deleted file mode 100644 index b8452d832b0..00000000000 --- a/contracts/src/v0.8/automation/test/v2_3/WETH9.sol +++ /dev/null @@ -1,93 +0,0 @@ -// Submitted for verification at Etherscan.io on 2017-12-12 - -// Copyright (C) 2015, 2016, 2017 Dapphub - -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . -pragma solidity 0.8.19; - -contract WETH9 { - string public name = "Wrapped Ether"; - string public symbol = "WETH"; - uint8 public decimals = 18; - - event Approval(address indexed src, address indexed guy, uint256 wad); - event Transfer(address indexed src, address indexed dst, uint256 wad); - event Deposit(address indexed dst, uint256 wad); - event Withdrawal(address indexed src, uint256 wad); - - error InsufficientBalance(); - - mapping(address => uint256) public balanceOf; - mapping(address => mapping(address => uint256)) public allowance; - - receive() external payable { - _deposit(); - } - - function _deposit() internal { - balanceOf[msg.sender] += msg.value; - emit Deposit(msg.sender, msg.value); - } - - function deposit() external payable { - _deposit(); - } - - function mint(address account, uint256 amount) public { - balanceOf[account] += amount; - } - - function withdraw(uint256 wad) external { - if (balanceOf[msg.sender] < wad) { - revert InsufficientBalance(); - } - balanceOf[msg.sender] -= wad; - payable(msg.sender).transfer(wad); - emit Withdrawal(msg.sender, wad); - } - - function totalSupply() public view returns (uint256) { - return address(this).balance; - } - - function approve(address guy, uint256 wad) public returns (bool) { - allowance[msg.sender][guy] = wad; - emit Approval(msg.sender, guy, wad); - return true; - } - - function transfer(address dst, uint256 wad) public returns (bool) { - return transferFrom(msg.sender, dst, wad); - } - - function transferFrom(address src, address dst, uint256 wad) public returns (bool) { - if (balanceOf[src] < wad) { - revert InsufficientBalance(); - } - - if (src != msg.sender && allowance[src][msg.sender] != type(uint128).max) { - if (allowance[src][msg.sender] < wad) { - revert InsufficientBalance(); - } - allowance[src][msg.sender] -= wad; - } - - balanceOf[src] -= wad; - balanceOf[dst] += wad; - - emit Transfer(src, dst, wad); - - return true; - } -} diff --git a/contracts/src/v0.8/automation/test/v2_3_zksync/BaseTest.t.sol b/contracts/src/v0.8/automation/test/v2_3_zksync/BaseTest.t.sol new file mode 100644 index 00000000000..cde05ab3a22 --- /dev/null +++ b/contracts/src/v0.8/automation/test/v2_3_zksync/BaseTest.t.sol @@ -0,0 +1,500 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.19; + +import "forge-std/Test.sol"; + +import {LinkToken} from "../../../shared/token/ERC677/LinkToken.sol"; +import {ERC20Mock} from "../../../vendor/openzeppelin-solidity/v4.8.3/contracts/mocks/ERC20Mock.sol"; +import {ERC20Mock6Decimals} from "../../mocks/ERC20Mock6Decimals.sol"; +import {MockV3Aggregator} from "../../../tests/MockV3Aggregator.sol"; +import {AutomationForwarderLogic} from "../../AutomationForwarderLogic.sol"; +import {UpkeepTranscoder5_0 as Transcoder} from "../../v2_3/UpkeepTranscoder5_0.sol"; +import {ZKSyncAutomationRegistry2_3} from "../../v2_3_zksync/ZKSyncAutomationRegistry2_3.sol"; +import {ZKSyncAutomationRegistryLogicA2_3} from "../../v2_3_zksync/ZKSyncAutomationRegistryLogicA2_3.sol"; +import {ZKSyncAutomationRegistryLogicB2_3} from "../../v2_3_zksync/ZKSyncAutomationRegistryLogicB2_3.sol"; +import {ZKSyncAutomationRegistryLogicC2_3} from "../../v2_3_zksync/ZKSyncAutomationRegistryLogicC2_3.sol"; +import {ZKSyncAutomationRegistryBase2_3 as ZKSyncAutoBase} from "../../v2_3_zksync/ZKSyncAutomationRegistryBase2_3.sol"; +import {IAutomationRegistryMaster2_3 as Registry, AutomationRegistryBase2_3} from "../../interfaces/v2_3/IAutomationRegistryMaster2_3.sol"; +import {AutomationRegistrar2_3} from "../../v2_3/AutomationRegistrar2_3.sol"; +import {ChainModuleBase} from "../../chains/ChainModuleBase.sol"; +import {IERC20Metadata as IERC20} from "../../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/extensions/IERC20Metadata.sol"; +import {MockUpkeep} from "../../mocks/MockUpkeep.sol"; +import {IWrappedNative} from "../../interfaces/v2_3/IWrappedNative.sol"; +import {WETH9} from "../WETH9.sol"; +import {MockGasBoundCaller} from "../../../tests/MockGasBoundCaller.sol"; +import {MockZKSyncSystemContext} from "../../../tests/MockZKSyncSystemContext.sol"; + +/** + * @title BaseTest provides basic test setup procedures and dependencies for use by other + * unit tests + */ +contract BaseTest is Test { + // test state (not exposed to derived tests) + uint256 private nonce; + + // constants + address internal constant ZERO_ADDRESS = address(0); + uint32 internal constant DEFAULT_GAS_FEE_PPB = 10_000_000; + uint24 internal constant DEFAULT_FLAT_FEE_MILLI_CENTS = 2_000; + + // config + uint8 internal constant F = 1; // number of faulty nodes + uint64 internal constant OFFCHAIN_CONFIG_VERSION = 30; // 2 for OCR2 + + // contracts + LinkToken internal linkToken; + ERC20Mock6Decimals internal usdToken6; + ERC20Mock internal usdToken18; + ERC20Mock internal usdToken18_2; + WETH9 internal weth; + MockV3Aggregator internal LINK_USD_FEED; + MockV3Aggregator internal NATIVE_USD_FEED; + MockV3Aggregator internal USDTOKEN_USD_FEED; + MockV3Aggregator internal FAST_GAS_FEED; + MockUpkeep internal TARGET1; + MockUpkeep internal TARGET2; + Transcoder internal TRANSCODER; + MockGasBoundCaller internal GAS_BOUND_CALLER; + MockZKSyncSystemContext internal SYSTEM_CONTEXT; + + // roles + address internal constant OWNER = address(uint160(uint256(keccak256("OWNER")))); + address internal constant UPKEEP_ADMIN = address(uint160(uint256(keccak256("UPKEEP_ADMIN")))); + address internal constant FINANCE_ADMIN = address(uint160(uint256(keccak256("FINANCE_ADMIN")))); + address internal constant STRANGER = address(uint160(uint256(keccak256("STRANGER")))); + address internal constant BROKE_USER = address(uint160(uint256(keccak256("BROKE_USER")))); // do not mint to this address + address internal constant PRIVILEGE_MANAGER = address(uint160(uint256(keccak256("PRIVILEGE_MANAGER")))); + + // nodes + uint256 internal constant SIGNING_KEY0 = 0x7b2e97fe057e6de99d6872a2ef2abf52c9b4469bc848c2465ac3fcd8d336e81d; + uint256 internal constant SIGNING_KEY1 = 0xab56160806b05ef1796789248e1d7f34a6465c5280899159d645218cd216cee6; + uint256 internal constant SIGNING_KEY2 = 0x6ec7caa8406a49b76736602810e0a2871959fbbb675e23a8590839e4717f1f7f; + uint256 internal constant SIGNING_KEY3 = 0x80f14b11da94ae7f29d9a7713ea13dc838e31960a5c0f2baf45ed458947b730a; + address[] internal SIGNERS = new address[](4); + address[] internal TRANSMITTERS = new address[](4); + address[] internal NEW_TRANSMITTERS = new address[](4); + address[] internal PAYEES = new address[](4); + address[] internal NEW_PAYEES = new address[](4); + + function setUp() public virtual { + vm.startPrank(OWNER); + linkToken = new LinkToken(); + linkToken.grantMintRole(OWNER); + usdToken18 = new ERC20Mock("MOCK_ERC20_18Decimals", "MOCK_ERC20_18Decimals", OWNER, 0); + usdToken18_2 = new ERC20Mock("Second_MOCK_ERC20_18Decimals", "Second_MOCK_ERC20_18Decimals", OWNER, 0); + usdToken6 = new ERC20Mock6Decimals("MOCK_ERC20_6Decimals", "MOCK_ERC20_6Decimals", OWNER, 0); + weth = new WETH9(); + + LINK_USD_FEED = new MockV3Aggregator(8, 2_000_000_000); // $20 + NATIVE_USD_FEED = new MockV3Aggregator(8, 400_000_000_000); // $4,000 + USDTOKEN_USD_FEED = new MockV3Aggregator(8, 100_000_000); // $1 + FAST_GAS_FEED = new MockV3Aggregator(0, 1_000_000_000); // 1 gwei + + TARGET1 = new MockUpkeep(); + TARGET2 = new MockUpkeep(); + + TRANSCODER = new Transcoder(); + GAS_BOUND_CALLER = new MockGasBoundCaller(); + SYSTEM_CONTEXT = new MockZKSyncSystemContext(); + + bytes memory callerCode = address(GAS_BOUND_CALLER).code; + vm.etch(0xc706EC7dfA5D4Dc87f29f859094165E8290530f5, callerCode); + + bytes memory contextCode = address(SYSTEM_CONTEXT).code; + vm.etch(0x000000000000000000000000000000000000800B, contextCode); + + SIGNERS[0] = vm.addr(SIGNING_KEY0); //0xc110458BE52CaA6bB68E66969C3218A4D9Db0211 + SIGNERS[1] = vm.addr(SIGNING_KEY1); //0xc110a19c08f1da7F5FfB281dc93630923F8E3719 + SIGNERS[2] = vm.addr(SIGNING_KEY2); //0xc110fdF6e8fD679C7Cc11602d1cd829211A18e9b + SIGNERS[3] = vm.addr(SIGNING_KEY3); //0xc11028017c9b445B6bF8aE7da951B5cC28B326C0 + + TRANSMITTERS[0] = address(uint160(uint256(keccak256("TRANSMITTER1")))); + TRANSMITTERS[1] = address(uint160(uint256(keccak256("TRANSMITTER2")))); + TRANSMITTERS[2] = address(uint160(uint256(keccak256("TRANSMITTER3")))); + TRANSMITTERS[3] = address(uint160(uint256(keccak256("TRANSMITTER4")))); + NEW_TRANSMITTERS[0] = address(uint160(uint256(keccak256("TRANSMITTER1")))); + NEW_TRANSMITTERS[1] = address(uint160(uint256(keccak256("TRANSMITTER2")))); + NEW_TRANSMITTERS[2] = address(uint160(uint256(keccak256("TRANSMITTER5")))); + NEW_TRANSMITTERS[3] = address(uint160(uint256(keccak256("TRANSMITTER6")))); + + PAYEES[0] = address(100); + PAYEES[1] = address(101); + PAYEES[2] = address(102); + PAYEES[3] = address(103); + NEW_PAYEES[0] = address(100); + NEW_PAYEES[1] = address(101); + NEW_PAYEES[2] = address(106); + NEW_PAYEES[3] = address(107); + + // mint funds + vm.deal(OWNER, 100 ether); + vm.deal(UPKEEP_ADMIN, 100 ether); + vm.deal(FINANCE_ADMIN, 100 ether); + vm.deal(STRANGER, 100 ether); + + linkToken.mint(OWNER, 1000e18); + linkToken.mint(UPKEEP_ADMIN, 1000e18); + linkToken.mint(FINANCE_ADMIN, 1000e18); + linkToken.mint(STRANGER, 1000e18); + + usdToken18.mint(OWNER, 1000e18); + usdToken18.mint(UPKEEP_ADMIN, 1000e18); + usdToken18.mint(FINANCE_ADMIN, 1000e18); + usdToken18.mint(STRANGER, 1000e18); + + usdToken18_2.mint(UPKEEP_ADMIN, 1000e18); + + usdToken6.mint(OWNER, 1000e6); + usdToken6.mint(UPKEEP_ADMIN, 1000e6); + usdToken6.mint(FINANCE_ADMIN, 1000e6); + usdToken6.mint(STRANGER, 1000e6); + + weth.mint(OWNER, 1000e18); + weth.mint(UPKEEP_ADMIN, 1000e18); + weth.mint(FINANCE_ADMIN, 1000e18); + weth.mint(STRANGER, 1000e18); + + vm.stopPrank(); + } + + /// @notice deploys the component parts of a registry, but nothing more + function deployZKSyncRegistry(ZKSyncAutoBase.PayoutMode payoutMode) internal returns (Registry) { + AutomationForwarderLogic forwarderLogic = new AutomationForwarderLogic(); + ZKSyncAutomationRegistryLogicC2_3 logicC2_3 = new ZKSyncAutomationRegistryLogicC2_3( + address(linkToken), + address(LINK_USD_FEED), + address(NATIVE_USD_FEED), + address(FAST_GAS_FEED), + address(forwarderLogic), + ZERO_ADDRESS, + payoutMode, + address(weth) + ); + ZKSyncAutomationRegistryLogicB2_3 logicB2_3 = new ZKSyncAutomationRegistryLogicB2_3(logicC2_3); + ZKSyncAutomationRegistryLogicA2_3 logicA2_3 = new ZKSyncAutomationRegistryLogicA2_3(logicB2_3); + return Registry(payable(address(new ZKSyncAutomationRegistry2_3(logicA2_3)))); + } + + /// @notice deploys and configures a registry, registrar, and everything needed for most tests + function deployAndConfigureZKSyncRegistryAndRegistrar( + ZKSyncAutoBase.PayoutMode payoutMode + ) internal returns (Registry, AutomationRegistrar2_3) { + Registry registry = deployZKSyncRegistry(payoutMode); + + IERC20[] memory billingTokens = new IERC20[](4); + billingTokens[0] = IERC20(address(usdToken18)); + billingTokens[1] = IERC20(address(weth)); + billingTokens[2] = IERC20(address(linkToken)); + billingTokens[3] = IERC20(address(usdToken6)); + uint256[] memory minRegistrationFees = new uint256[](billingTokens.length); + minRegistrationFees[0] = 100e18; // 100 USD + minRegistrationFees[1] = 5e18; // 5 Native + minRegistrationFees[2] = 5e18; // 5 LINK + minRegistrationFees[3] = 100e6; // 100 USD + address[] memory billingTokenAddresses = new address[](billingTokens.length); + for (uint256 i = 0; i < billingTokens.length; i++) { + billingTokenAddresses[i] = address(billingTokens[i]); + } + AutomationRegistryBase2_3.BillingConfig[] + memory billingTokenConfigs = new AutomationRegistryBase2_3.BillingConfig[](billingTokens.length); + billingTokenConfigs[0] = AutomationRegistryBase2_3.BillingConfig({ + gasFeePPB: DEFAULT_GAS_FEE_PPB, // 15% + flatFeeMilliCents: DEFAULT_FLAT_FEE_MILLI_CENTS, // 2 cents + priceFeed: address(USDTOKEN_USD_FEED), + fallbackPrice: 100_000_000, // $1 + minSpend: 1e18, // 1 USD + decimals: 18 + }); + billingTokenConfigs[1] = AutomationRegistryBase2_3.BillingConfig({ + gasFeePPB: DEFAULT_GAS_FEE_PPB, // 15% + flatFeeMilliCents: DEFAULT_FLAT_FEE_MILLI_CENTS, // 2 cents + priceFeed: address(NATIVE_USD_FEED), + fallbackPrice: 100_000_000, // $1 + minSpend: 5e18, // 5 Native + decimals: 18 + }); + billingTokenConfigs[2] = AutomationRegistryBase2_3.BillingConfig({ + gasFeePPB: DEFAULT_GAS_FEE_PPB, // 10% + flatFeeMilliCents: DEFAULT_FLAT_FEE_MILLI_CENTS, // 2 cents + priceFeed: address(LINK_USD_FEED), + fallbackPrice: 1_000_000_000, // $10 + minSpend: 1e18, // 1 LINK + decimals: 18 + }); + billingTokenConfigs[3] = AutomationRegistryBase2_3.BillingConfig({ + gasFeePPB: DEFAULT_GAS_FEE_PPB, // 15% + flatFeeMilliCents: DEFAULT_FLAT_FEE_MILLI_CENTS, // 2 cents + priceFeed: address(USDTOKEN_USD_FEED), + fallbackPrice: 1e8, // $1 + minSpend: 1e6, // 1 USD + decimals: 6 + }); + + if (payoutMode == ZKSyncAutoBase.PayoutMode.OFF_CHAIN) { + // remove LINK as a payment method if we are settling offchain + assembly { + mstore(billingTokens, 2) + mstore(minRegistrationFees, 2) + mstore(billingTokenAddresses, 2) + mstore(billingTokenConfigs, 2) + } + } + + // deploy registrar + AutomationRegistrar2_3.InitialTriggerConfig[] + memory triggerConfigs = new AutomationRegistrar2_3.InitialTriggerConfig[](2); + triggerConfigs[0] = AutomationRegistrar2_3.InitialTriggerConfig({ + triggerType: 0, // condition + autoApproveType: AutomationRegistrar2_3.AutoApproveType.DISABLED, + autoApproveMaxAllowed: 0 + }); + triggerConfigs[1] = AutomationRegistrar2_3.InitialTriggerConfig({ + triggerType: 1, // log + autoApproveType: AutomationRegistrar2_3.AutoApproveType.DISABLED, + autoApproveMaxAllowed: 0 + }); + AutomationRegistrar2_3 registrar = new AutomationRegistrar2_3( + address(linkToken), + registry, + triggerConfigs, + billingTokens, + minRegistrationFees, + IWrappedNative(address(weth)) + ); + + address[] memory registrars; + registrars = new address[](1); + registrars[0] = address(registrar); + + AutomationRegistryBase2_3.OnchainConfig memory cfg = AutomationRegistryBase2_3.OnchainConfig({ + checkGasLimit: 5_000_000, + stalenessSeconds: 90_000, + gasCeilingMultiplier: 2, + maxPerformGas: 10_000_000, + maxCheckDataSize: 5_000, + maxPerformDataSize: 5_000, + maxRevertDataSize: 5_000, + fallbackGasPrice: 20_000_000_000, + fallbackLinkPrice: 2_000_000_000, // $20 + fallbackNativePrice: 400_000_000_000, // $4,000 + transcoder: address(TRANSCODER), + registrars: registrars, + upkeepPrivilegeManager: PRIVILEGE_MANAGER, + chainModule: address(new ChainModuleBase()), + reorgProtectionEnabled: true, + financeAdmin: FINANCE_ADMIN + }); + + registry.setConfigTypeSafe( + SIGNERS, + TRANSMITTERS, + F, + cfg, + OFFCHAIN_CONFIG_VERSION, + "", + billingTokenAddresses, + billingTokenConfigs + ); + return (registry, registrar); + } + + /// @notice this function updates the billing config for the provided token on the provided registry, + /// and throws an error if the token is not found + function _updateBillingTokenConfig( + Registry registry, + address billingToken, + AutomationRegistryBase2_3.BillingConfig memory newConfig + ) internal { + (, , address[] memory signers, address[] memory transmitters, uint8 f) = registry.getState(); + AutomationRegistryBase2_3.OnchainConfig memory config = registry.getConfig(); + address[] memory billingTokens = registry.getBillingTokens(); + + AutomationRegistryBase2_3.BillingConfig[] + memory billingTokenConfigs = new AutomationRegistryBase2_3.BillingConfig[](billingTokens.length); + + bool found = false; + for (uint256 i = 0; i < billingTokens.length; i++) { + if (billingTokens[i] == billingToken) { + found = true; + billingTokenConfigs[i] = newConfig; + } else { + billingTokenConfigs[i] = registry.getBillingTokenConfig(billingTokens[i]); + } + } + require(found, "could not find billing token provided on registry"); + + registry.setConfigTypeSafe( + signers, + transmitters, + f, + config, + OFFCHAIN_CONFIG_VERSION, + "", + billingTokens, + billingTokenConfigs + ); + } + + /// @notice this function removes a billing token from the registry + function _removeBillingTokenConfig(Registry registry, address billingToken) internal { + (, , address[] memory signers, address[] memory transmitters, uint8 f) = registry.getState(); + AutomationRegistryBase2_3.OnchainConfig memory config = registry.getConfig(); + address[] memory billingTokens = registry.getBillingTokens(); + + address[] memory newBillingTokens = new address[](billingTokens.length - 1); + AutomationRegistryBase2_3.BillingConfig[] + memory billingTokenConfigs = new AutomationRegistryBase2_3.BillingConfig[](billingTokens.length - 1); + + uint256 j = 0; + for (uint256 i = 0; i < billingTokens.length; i++) { + if (billingTokens[i] != billingToken) { + if (j == newBillingTokens.length) revert("could not find billing token provided on registry"); + newBillingTokens[j] = billingTokens[i]; + billingTokenConfigs[j] = registry.getBillingTokenConfig(billingTokens[i]); + j++; + } + } + + registry.setConfigTypeSafe( + signers, + transmitters, + f, + config, + OFFCHAIN_CONFIG_VERSION, + "", + newBillingTokens, + billingTokenConfigs + ); + } + + function _transmit(uint256 id, Registry registry, bytes4 selector) internal { + uint256[] memory ids = new uint256[](1); + ids[0] = id; + _transmit(ids, registry, selector); + } + + function _transmit(uint256[] memory ids, Registry registry, bytes4 selector) internal { + bytes memory reportBytes; + { + uint256[] memory upkeepIds = new uint256[](ids.length); + uint256[] memory gasLimits = new uint256[](ids.length); + bytes[] memory performDatas = new bytes[](ids.length); + bytes[] memory triggers = new bytes[](ids.length); + for (uint256 i = 0; i < ids.length; i++) { + upkeepIds[i] = ids[i]; + gasLimits[i] = registry.getUpkeep(ids[i]).performGas; + performDatas[i] = new bytes(0); + uint8 triggerType = registry.getTriggerType(ids[i]); + if (triggerType == 0) { + triggers[i] = _encodeConditionalTrigger( + ZKSyncAutoBase.ConditionalTrigger(uint32(block.number - 1), blockhash(block.number - 1)) + ); + } else { + revert("not implemented"); + } + } + ZKSyncAutoBase.Report memory report = ZKSyncAutoBase.Report( + uint256(1000000000), + uint256(2000000000), + upkeepIds, + gasLimits, + triggers, + performDatas + ); + + reportBytes = _encodeReport(report); + } + (, , bytes32 configDigest) = registry.latestConfigDetails(); + bytes32[3] memory reportContext = [configDigest, configDigest, configDigest]; + uint256[] memory signerPKs = new uint256[](2); + signerPKs[0] = SIGNING_KEY0; + signerPKs[1] = SIGNING_KEY1; + (bytes32[] memory rs, bytes32[] memory ss, bytes32 vs) = _signReport(reportBytes, reportContext, signerPKs); + + vm.startPrank(TRANSMITTERS[0]); + if (selector != bytes4(0)) { + vm.expectRevert(selector); + } + registry.transmit(reportContext, reportBytes, rs, ss, vs); + vm.stopPrank(); + } + + /// @notice Gather signatures on report data + /// @param report - Report bytes generated from `_buildReport` + /// @param reportContext - Report context bytes32 generated from `_buildReport` + /// @param signerPrivateKeys - One or more addresses that will sign the report data + /// @return rawRs - Signature rs + /// @return rawSs - Signature ss + /// @return rawVs - Signature vs + function _signReport( + bytes memory report, + bytes32[3] memory reportContext, + uint256[] memory signerPrivateKeys + ) internal pure returns (bytes32[] memory, bytes32[] memory, bytes32) { + bytes32[] memory rs = new bytes32[](signerPrivateKeys.length); + bytes32[] memory ss = new bytes32[](signerPrivateKeys.length); + bytes memory vs = new bytes(signerPrivateKeys.length); + + bytes32 reportDigest = keccak256(abi.encodePacked(keccak256(report), reportContext)); + + for (uint256 i = 0; i < signerPrivateKeys.length; i++) { + (uint8 v, bytes32 r, bytes32 s) = vm.sign(signerPrivateKeys[i], reportDigest); + rs[i] = r; + ss[i] = s; + vs[i] = bytes1(v - 27); + } + + return (rs, ss, bytes32(vs)); + } + + function _encodeReport(ZKSyncAutoBase.Report memory report) internal pure returns (bytes memory reportBytes) { + return abi.encode(report); + } + + function _encodeConditionalTrigger( + ZKSyncAutoBase.ConditionalTrigger memory trigger + ) internal pure returns (bytes memory triggerBytes) { + return abi.encode(trigger.blockNum, trigger.blockHash); + } + + /// @dev mints LINK to the recipient + function _mintLink(address recipient, uint256 amount) internal { + vm.prank(OWNER); + linkToken.mint(recipient, amount); + } + + /// @dev mints USDToken with 18 decimals to the recipient + function _mintERC20_18Decimals(address recipient, uint256 amount) internal { + vm.prank(OWNER); + usdToken18.mint(recipient, amount); + } + + /// @dev returns a pseudo-random 32 bytes + function _random() private returns (bytes32) { + nonce++; + return keccak256(abi.encode(block.timestamp, nonce)); + } + + /// @dev returns a pseudo-random number + function randomNumber() internal returns (uint256) { + return uint256(_random()); + } + + /// @dev returns a pseudo-random address + function randomAddress() internal returns (address) { + return address(uint160(randomNumber())); + } + + /// @dev returns a pseudo-random byte array + function randomBytes(uint256 length) internal returns (bytes memory) { + bytes memory result = new bytes(length); + bytes32 entropy; + for (uint256 i = 0; i < length; i++) { + if (i % 32 == 0) { + entropy = _random(); + } + result[i] = entropy[i % 32]; + } + return result; + } +} diff --git a/contracts/src/v0.8/automation/test/v2_3_zksync/ZKSyncAutomationRegistry2_3.t.sol b/contracts/src/v0.8/automation/test/v2_3_zksync/ZKSyncAutomationRegistry2_3.t.sol new file mode 100644 index 00000000000..7098d9f38fa --- /dev/null +++ b/contracts/src/v0.8/automation/test/v2_3_zksync/ZKSyncAutomationRegistry2_3.t.sol @@ -0,0 +1,2772 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.19; + +import {Vm} from "forge-std/Test.sol"; +import {BaseTest} from "./BaseTest.t.sol"; +import {ZKSyncAutomationRegistryBase2_3 as AutoBase} from "../../v2_3_zksync/ZKSyncAutomationRegistryBase2_3.sol"; +import {AutomationRegistrar2_3 as Registrar} from "../../v2_3/AutomationRegistrar2_3.sol"; +import {IAutomationRegistryMaster2_3 as Registry, AutomationRegistryBase2_3, IAutomationV21PlusCommon} from "../../interfaces/v2_3/IAutomationRegistryMaster2_3.sol"; +import {ChainModuleBase} from "../../chains/ChainModuleBase.sol"; +import {IERC20Metadata as IERC20} from "../../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/extensions/IERC20Metadata.sol"; +import {IWrappedNative} from "../../interfaces/v2_3/IWrappedNative.sol"; + +// forge test --match-path src/v0.8/automation/test/v2_3_zksync/ZKSyncAutomationRegistry2_3.t.sol --match-test + +enum Trigger { + CONDITION, + LOG +} + +contract SetUp is BaseTest { + Registry internal registry; + AutomationRegistryBase2_3.OnchainConfig internal config; + bytes internal constant offchainConfigBytes = abi.encode(1234, ZERO_ADDRESS); + + uint256 linkUpkeepID; + uint256 linkUpkeepID2; // 2 upkeeps use the same billing token (LINK) to test migration scenario + uint256 usdUpkeepID18; // 1 upkeep uses ERC20 token with 18 decimals + uint256 usdUpkeepID6; // 1 upkeep uses ERC20 token with 6 decimals + uint256 nativeUpkeepID; + + function setUp() public virtual override { + super.setUp(); + (registry, ) = deployAndConfigureZKSyncRegistryAndRegistrar(AutoBase.PayoutMode.ON_CHAIN); + config = registry.getConfig(); + + vm.startPrank(OWNER); + linkToken.approve(address(registry), type(uint256).max); + usdToken6.approve(address(registry), type(uint256).max); + usdToken18.approve(address(registry), type(uint256).max); + weth.approve(address(registry), type(uint256).max); + vm.startPrank(UPKEEP_ADMIN); + linkToken.approve(address(registry), type(uint256).max); + usdToken6.approve(address(registry), type(uint256).max); + usdToken18.approve(address(registry), type(uint256).max); + weth.approve(address(registry), type(uint256).max); + vm.startPrank(STRANGER); + linkToken.approve(address(registry), type(uint256).max); + usdToken6.approve(address(registry), type(uint256).max); + usdToken18.approve(address(registry), type(uint256).max); + weth.approve(address(registry), type(uint256).max); + vm.stopPrank(); + + linkUpkeepID = registry.registerUpkeep( + address(TARGET1), + config.maxPerformGas, + UPKEEP_ADMIN, + uint8(Trigger.CONDITION), + address(linkToken), + "", + "", + "" + ); + + linkUpkeepID2 = registry.registerUpkeep( + address(TARGET1), + config.maxPerformGas, + UPKEEP_ADMIN, + uint8(Trigger.CONDITION), + address(linkToken), + "", + "", + "" + ); + + usdUpkeepID18 = registry.registerUpkeep( + address(TARGET1), + config.maxPerformGas, + UPKEEP_ADMIN, + uint8(Trigger.CONDITION), + address(usdToken18), + "", + "", + "" + ); + + usdUpkeepID6 = registry.registerUpkeep( + address(TARGET1), + config.maxPerformGas, + UPKEEP_ADMIN, + uint8(Trigger.CONDITION), + address(usdToken6), + "", + "", + "" + ); + + nativeUpkeepID = registry.registerUpkeep( + address(TARGET1), + config.maxPerformGas, + UPKEEP_ADMIN, + uint8(Trigger.CONDITION), + address(weth), + "", + "", + "" + ); + + vm.startPrank(OWNER); + registry.addFunds(linkUpkeepID, registry.getMinBalanceForUpkeep(linkUpkeepID)); + registry.addFunds(linkUpkeepID2, registry.getMinBalanceForUpkeep(linkUpkeepID2)); + registry.addFunds(usdUpkeepID18, registry.getMinBalanceForUpkeep(usdUpkeepID18)); + registry.addFunds(usdUpkeepID6, registry.getMinBalanceForUpkeep(usdUpkeepID6)); + registry.addFunds(nativeUpkeepID, registry.getMinBalanceForUpkeep(nativeUpkeepID)); + vm.stopPrank(); + } +} + +contract LatestConfigDetails is SetUp { + function testGet() public { + (uint32 configCount, uint32 blockNumber, bytes32 configDigest) = registry.latestConfigDetails(); + assertEq(configCount, 1); + assertTrue(blockNumber > 0); + assertNotEq(configDigest, ""); + } +} + +contract CheckUpkeep is SetUp { + function testPreventExecutionOnCheckUpkeep() public { + uint256 id = 1; + bytes memory triggerData = abi.encodePacked("trigger_data"); + + // The tx.origin is the DEFAULT_SENDER (0x1804c8AB1F12E6bbf3894d4083f33e07309d1f38) of foundry + // Expecting a revert since the tx.origin is not address(0) + vm.expectRevert(abi.encodeWithSelector(Registry.OnlySimulatedBackend.selector)); + registry.checkUpkeep(id, triggerData); + } +} + +contract WithdrawFunds is SetUp { + event FundsWithdrawn(uint256 indexed id, uint256 amount, address to); + + function test_RevertsWhen_CalledByNonAdmin() external { + vm.expectRevert(Registry.OnlyCallableByAdmin.selector); + vm.prank(STRANGER); + registry.withdrawFunds(linkUpkeepID, STRANGER); + } + + function test_RevertsWhen_InvalidRecipient() external { + vm.expectRevert(Registry.InvalidRecipient.selector); + vm.prank(UPKEEP_ADMIN); + registry.withdrawFunds(linkUpkeepID, ZERO_ADDRESS); + } + + function test_RevertsWhen_UpkeepNotCanceled() external { + vm.expectRevert(Registry.UpkeepNotCanceled.selector); + vm.prank(UPKEEP_ADMIN); + registry.withdrawFunds(linkUpkeepID, UPKEEP_ADMIN); + } + + function test_Happy_Link() external { + vm.startPrank(UPKEEP_ADMIN); + registry.cancelUpkeep(linkUpkeepID); + vm.roll(100 + block.number); + + uint256 startUpkeepAdminBalance = linkToken.balanceOf(UPKEEP_ADMIN); + uint256 startLinkReserveAmountBalance = registry.getReserveAmount(address(linkToken)); + + uint256 upkeepBalance = registry.getBalance(linkUpkeepID); + vm.expectEmit(); + emit FundsWithdrawn(linkUpkeepID, upkeepBalance, address(UPKEEP_ADMIN)); + registry.withdrawFunds(linkUpkeepID, UPKEEP_ADMIN); + + assertEq(registry.getBalance(linkUpkeepID), 0); + assertEq(linkToken.balanceOf(UPKEEP_ADMIN), startUpkeepAdminBalance + upkeepBalance); + assertEq(registry.getReserveAmount(address(linkToken)), startLinkReserveAmountBalance - upkeepBalance); + } + + function test_Happy_USDToken() external { + vm.startPrank(UPKEEP_ADMIN); + registry.cancelUpkeep(usdUpkeepID6); + vm.roll(100 + block.number); + + uint256 startUpkeepAdminBalance = usdToken6.balanceOf(UPKEEP_ADMIN); + uint256 startUSDToken6ReserveAmountBalance = registry.getReserveAmount(address(usdToken6)); + + uint256 upkeepBalance = registry.getBalance(usdUpkeepID6); + vm.expectEmit(); + emit FundsWithdrawn(usdUpkeepID6, upkeepBalance, address(UPKEEP_ADMIN)); + registry.withdrawFunds(usdUpkeepID6, UPKEEP_ADMIN); + + assertEq(registry.getBalance(usdUpkeepID6), 0); + assertEq(usdToken6.balanceOf(UPKEEP_ADMIN), startUpkeepAdminBalance + upkeepBalance); + assertEq(registry.getReserveAmount(address(usdToken6)), startUSDToken6ReserveAmountBalance - upkeepBalance); + } +} + +contract AddFunds is SetUp { + event FundsAdded(uint256 indexed id, address indexed from, uint96 amount); + + // when msg.value is 0, it uses the ERC20 payment path + function test_HappyWhen_NativeUpkeep_WithMsgValue0() external { + vm.startPrank(OWNER); + uint256 startRegistryBalance = registry.getBalance(nativeUpkeepID); + uint256 startTokenBalance = registry.getBalance(nativeUpkeepID); + registry.addFunds(nativeUpkeepID, 1); + assertEq(registry.getBalance(nativeUpkeepID), startRegistryBalance + 1); + assertEq(weth.balanceOf(address(registry)), startTokenBalance + 1); + assertEq(registry.getAvailableERC20ForPayment(address(weth)), 0); + } + + // when msg.value is not 0, it uses the native payment path + function test_HappyWhen_NativeUpkeep_WithMsgValueNot0() external { + uint256 startRegistryBalance = registry.getBalance(nativeUpkeepID); + uint256 startTokenBalance = registry.getBalance(nativeUpkeepID); + registry.addFunds{value: 1}(nativeUpkeepID, 1000); // parameter amount should be ignored + assertEq(registry.getBalance(nativeUpkeepID), startRegistryBalance + 1); + assertEq(weth.balanceOf(address(registry)), startTokenBalance + 1); + assertEq(registry.getAvailableERC20ForPayment(address(weth)), 0); + } + + // it fails when the billing token is not native, but trying to pay with native + function test_RevertsWhen_NativePaymentDoesntMatchBillingToken() external { + vm.expectRevert(abi.encodeWithSelector(Registry.InvalidToken.selector)); + registry.addFunds{value: 1}(linkUpkeepID, 0); + } + + function test_RevertsWhen_UpkeepDoesNotExist() public { + vm.expectRevert(Registry.UpkeepCancelled.selector); + registry.addFunds(randomNumber(), 1); + } + + function test_RevertsWhen_UpkeepIsCanceled() public { + registry.cancelUpkeep(linkUpkeepID); + vm.expectRevert(Registry.UpkeepCancelled.selector); + registry.addFunds(linkUpkeepID, 1); + } + + function test_anyoneCanAddFunds() public { + uint256 startAmount = registry.getBalance(linkUpkeepID); + vm.prank(UPKEEP_ADMIN); + registry.addFunds(linkUpkeepID, 1); + assertEq(registry.getBalance(linkUpkeepID), startAmount + 1); + vm.prank(STRANGER); + registry.addFunds(linkUpkeepID, 1); + assertEq(registry.getBalance(linkUpkeepID), startAmount + 2); + } + + function test_movesFundFromCorrectToken() public { + vm.startPrank(UPKEEP_ADMIN); + + uint256 startLINKRegistryBalance = linkToken.balanceOf(address(registry)); + uint256 startUSDRegistryBalance = usdToken18.balanceOf(address(registry)); + uint256 startLinkUpkeepBalance = registry.getBalance(linkUpkeepID); + uint256 startUSDUpkeepBalance = registry.getBalance(usdUpkeepID18); + + registry.addFunds(linkUpkeepID, 1); + assertEq(registry.getBalance(linkUpkeepID), startLinkUpkeepBalance + 1); + assertEq(registry.getBalance(usdUpkeepID18), startUSDRegistryBalance); + assertEq(linkToken.balanceOf(address(registry)), startLINKRegistryBalance + 1); + assertEq(usdToken18.balanceOf(address(registry)), startUSDUpkeepBalance); + + registry.addFunds(usdUpkeepID18, 2); + assertEq(registry.getBalance(linkUpkeepID), startLinkUpkeepBalance + 1); + assertEq(registry.getBalance(usdUpkeepID18), startUSDRegistryBalance + 2); + assertEq(linkToken.balanceOf(address(registry)), startLINKRegistryBalance + 1); + assertEq(usdToken18.balanceOf(address(registry)), startUSDUpkeepBalance + 2); + } + + function test_emitsAnEvent() public { + vm.startPrank(UPKEEP_ADMIN); + vm.expectEmit(); + emit FundsAdded(linkUpkeepID, address(UPKEEP_ADMIN), 100); + registry.addFunds(linkUpkeepID, 100); + } +} + +contract Withdraw is SetUp { + address internal aMockAddress = randomAddress(); + + function testLinkAvailableForPaymentReturnsLinkBalance() public { + uint256 startBalance = linkToken.balanceOf(address(registry)); + int256 startLinkAvailable = registry.linkAvailableForPayment(); + + //simulate a deposit of link to the liquidity pool + _mintLink(address(registry), 1e10); + + //check there's a balance + assertEq(linkToken.balanceOf(address(registry)), startBalance + 1e10); + + //check the link available has increased by the same amount + assertEq(uint256(registry.linkAvailableForPayment()), uint256(startLinkAvailable) + 1e10); + } + + function testWithdrawLinkRevertsBecauseOnlyFinanceAdminAllowed() public { + vm.expectRevert(abi.encodeWithSelector(Registry.OnlyFinanceAdmin.selector)); + registry.withdrawLink(aMockAddress, 1); + } + + function testWithdrawLinkRevertsBecauseOfInsufficientBalance() public { + vm.startPrank(FINANCE_ADMIN); + + // try to withdraw 1 link while there is 0 balance + vm.expectRevert(abi.encodeWithSelector(Registry.InsufficientBalance.selector, 0, 1)); + registry.withdrawLink(aMockAddress, 1); + + vm.stopPrank(); + } + + function testWithdrawLinkRevertsBecauseOfInvalidRecipient() public { + vm.startPrank(FINANCE_ADMIN); + + // try to withdraw 1 link while there is 0 balance + vm.expectRevert(abi.encodeWithSelector(Registry.InvalidRecipient.selector)); + registry.withdrawLink(ZERO_ADDRESS, 1); + + vm.stopPrank(); + } + + function testWithdrawLinkSuccess() public { + //simulate a deposit of link to the liquidity pool + _mintLink(address(registry), 1e10); + uint256 startBalance = linkToken.balanceOf(address(registry)); + + vm.startPrank(FINANCE_ADMIN); + + // try to withdraw 1 link while there is a ton of link available + registry.withdrawLink(aMockAddress, 1); + + vm.stopPrank(); + + assertEq(linkToken.balanceOf(address(aMockAddress)), 1); + assertEq(linkToken.balanceOf(address(registry)), startBalance - 1); + } + + function test_WithdrawERC20Fees_RespectsReserveAmount() public { + assertEq(registry.getBalance(usdUpkeepID18), registry.getReserveAmount(address(usdToken18))); + vm.startPrank(FINANCE_ADMIN); + vm.expectRevert(abi.encodeWithSelector(Registry.InsufficientBalance.selector, 0, 1)); + registry.withdrawERC20Fees(address(usdToken18), FINANCE_ADMIN, 1); + } + + function test_WithdrawERC20Fees_RevertsWhen_AttemptingToWithdrawLINK() public { + _mintLink(address(registry), 1e10); + vm.startPrank(FINANCE_ADMIN); + vm.expectRevert(Registry.InvalidToken.selector); + registry.withdrawERC20Fees(address(linkToken), FINANCE_ADMIN, 1); // should revert + registry.withdrawLink(FINANCE_ADMIN, 1); // but using link withdraw functions succeeds + } + + // default is ON_CHAIN mode + function test_WithdrawERC20Fees_RevertsWhen_LinkAvailableForPaymentIsNegative() public { + _transmit(usdUpkeepID18, registry, bytes4(0)); // adds USD token to finance withdrawable, and gives NOPs a LINK balance + require(registry.linkAvailableForPayment() < 0, "linkAvailableForPayment should be negative"); + require( + registry.getAvailableERC20ForPayment(address(usdToken18)) > 0, + "ERC20AvailableForPayment should be positive" + ); + vm.expectRevert(Registry.InsufficientLinkLiquidity.selector); + vm.prank(FINANCE_ADMIN); + registry.withdrawERC20Fees(address(usdToken18), FINANCE_ADMIN, 1); // should revert + _mintLink(address(registry), uint256(registry.linkAvailableForPayment() * -10)); // top up LINK liquidity pool + vm.prank(FINANCE_ADMIN); + registry.withdrawERC20Fees(address(usdToken18), FINANCE_ADMIN, 1); // now finance can withdraw + } + + function test_WithdrawERC20Fees_InOffChainMode_Happy() public { + // deploy and configure a registry with OFF_CHAIN payout + (Registry registry, ) = deployAndConfigureZKSyncRegistryAndRegistrar(AutoBase.PayoutMode.OFF_CHAIN); + + // register an upkeep and add funds + uint256 id = registry.registerUpkeep(address(TARGET1), 1000000, UPKEEP_ADMIN, 0, address(usdToken18), "", "", ""); + _mintERC20_18Decimals(UPKEEP_ADMIN, 1e20); + vm.startPrank(UPKEEP_ADMIN); + usdToken18.approve(address(registry), 1e20); + registry.addFunds(id, 1e20); + + // manually create a transmit so transmitters earn some rewards + _transmit(id, registry, bytes4(0)); + require(registry.linkAvailableForPayment() < 0, "linkAvailableForPayment should be negative"); + vm.prank(FINANCE_ADMIN); + registry.withdrawERC20Fees(address(usdToken18), aMockAddress, 1); // finance can withdraw + + // recipient should get the funds + assertEq(usdToken18.balanceOf(address(aMockAddress)), 1); + } + + function testWithdrawERC20FeeSuccess() public { + // deposit excess USDToken to the registry (this goes to the "finance withdrawable" pool be default) + uint256 startReserveAmount = registry.getReserveAmount(address(usdToken18)); + uint256 startAmount = usdToken18.balanceOf(address(registry)); + _mintERC20_18Decimals(address(registry), 1e10); + + // depositing shouldn't change reserve amount + assertEq(registry.getReserveAmount(address(usdToken18)), startReserveAmount); + + vm.startPrank(FINANCE_ADMIN); + + // try to withdraw 1 USDToken + registry.withdrawERC20Fees(address(usdToken18), aMockAddress, 1); + + vm.stopPrank(); + + assertEq(usdToken18.balanceOf(address(aMockAddress)), 1); + assertEq(usdToken18.balanceOf(address(registry)), startAmount + 1e10 - 1); + assertEq(registry.getReserveAmount(address(usdToken18)), startReserveAmount); + } +} + +contract SetConfig is SetUp { + event ConfigSet( + uint32 previousConfigBlockNumber, + bytes32 configDigest, + uint64 configCount, + address[] signers, + address[] transmitters, + uint8 f, + bytes onchainConfig, + uint64 offchainConfigVersion, + bytes offchainConfig + ); + + address module = address(new ChainModuleBase()); + + AutomationRegistryBase2_3.OnchainConfig cfg = + AutomationRegistryBase2_3.OnchainConfig({ + checkGasLimit: 5_000_000, + stalenessSeconds: 90_000, + gasCeilingMultiplier: 0, + maxPerformGas: 10_000_000, + maxCheckDataSize: 5_000, + maxPerformDataSize: 5_000, + maxRevertDataSize: 5_000, + fallbackGasPrice: 20_000_000_000, + fallbackLinkPrice: 2_000_000_000, // $20 + fallbackNativePrice: 400_000_000_000, // $4,000 + transcoder: 0xB1e66855FD67f6e85F0f0fA38cd6fBABdf00923c, + registrars: _getRegistrars(), + upkeepPrivilegeManager: PRIVILEGE_MANAGER, + chainModule: module, + reorgProtectionEnabled: true, + financeAdmin: FINANCE_ADMIN + }); + + function testSetConfigSuccess() public { + (uint32 configCount, uint32 blockNumber, ) = registry.latestConfigDetails(); + assertEq(configCount, 1); + + address billingTokenAddress = address(usdToken18); + address[] memory billingTokens = new address[](1); + billingTokens[0] = billingTokenAddress; + + AutomationRegistryBase2_3.BillingConfig[] memory billingConfigs = new AutomationRegistryBase2_3.BillingConfig[](1); + billingConfigs[0] = AutomationRegistryBase2_3.BillingConfig({ + gasFeePPB: 5_000, + flatFeeMilliCents: 20_000, + priceFeed: address(USDTOKEN_USD_FEED), + fallbackPrice: 2_000_000_000, // $20 + minSpend: 100_000, + decimals: 18 + }); + + bytes memory onchainConfigBytes = abi.encode(cfg); + bytes memory onchainConfigBytesWithBilling = abi.encode(cfg, billingTokens, billingConfigs); + + bytes32 configDigest = _configDigestFromConfigData( + block.chainid, + address(registry), + ++configCount, + SIGNERS, + TRANSMITTERS, + F, + onchainConfigBytes, + OFFCHAIN_CONFIG_VERSION, + offchainConfigBytes + ); + + vm.expectEmit(); + emit ConfigSet( + blockNumber, + configDigest, + configCount, + SIGNERS, + TRANSMITTERS, + F, + onchainConfigBytes, + OFFCHAIN_CONFIG_VERSION, + offchainConfigBytes + ); + + registry.setConfig( + SIGNERS, + TRANSMITTERS, + F, + onchainConfigBytesWithBilling, + OFFCHAIN_CONFIG_VERSION, + offchainConfigBytes + ); + + (, , address[] memory signers, address[] memory transmitters, uint8 f) = registry.getState(); + + assertEq(signers, SIGNERS); + assertEq(transmitters, TRANSMITTERS); + assertEq(f, F); + + AutomationRegistryBase2_3.BillingConfig memory config = registry.getBillingTokenConfig(billingTokenAddress); + assertEq(config.gasFeePPB, 5_000); + assertEq(config.flatFeeMilliCents, 20_000); + assertEq(config.priceFeed, address(USDTOKEN_USD_FEED)); + assertEq(config.minSpend, 100_000); + + address[] memory tokens = registry.getBillingTokens(); + assertEq(tokens.length, 1); + } + + function testSetConfigMultipleBillingConfigsSuccess() public { + (uint32 configCount, , ) = registry.latestConfigDetails(); + assertEq(configCount, 1); + + address billingTokenAddress1 = address(linkToken); + address billingTokenAddress2 = address(usdToken18); + address[] memory billingTokens = new address[](2); + billingTokens[0] = billingTokenAddress1; + billingTokens[1] = billingTokenAddress2; + + AutomationRegistryBase2_3.BillingConfig[] memory billingConfigs = new AutomationRegistryBase2_3.BillingConfig[](2); + billingConfigs[0] = AutomationRegistryBase2_3.BillingConfig({ + gasFeePPB: 5_001, + flatFeeMilliCents: 20_001, + priceFeed: address(USDTOKEN_USD_FEED), + fallbackPrice: 100, + minSpend: 100, + decimals: 18 + }); + billingConfigs[1] = AutomationRegistryBase2_3.BillingConfig({ + gasFeePPB: 5_002, + flatFeeMilliCents: 20_002, + priceFeed: address(USDTOKEN_USD_FEED), + fallbackPrice: 200, + minSpend: 200, + decimals: 18 + }); + + bytes memory onchainConfigBytesWithBilling = abi.encode(cfg, billingTokens, billingConfigs); + + registry.setConfig( + SIGNERS, + TRANSMITTERS, + F, + onchainConfigBytesWithBilling, + OFFCHAIN_CONFIG_VERSION, + offchainConfigBytes + ); + + (, , address[] memory signers, address[] memory transmitters, uint8 f) = registry.getState(); + + assertEq(signers, SIGNERS); + assertEq(transmitters, TRANSMITTERS); + assertEq(f, F); + + AutomationRegistryBase2_3.BillingConfig memory config1 = registry.getBillingTokenConfig(billingTokenAddress1); + assertEq(config1.gasFeePPB, 5_001); + assertEq(config1.flatFeeMilliCents, 20_001); + assertEq(config1.priceFeed, address(USDTOKEN_USD_FEED)); + assertEq(config1.fallbackPrice, 100); + assertEq(config1.minSpend, 100); + + AutomationRegistryBase2_3.BillingConfig memory config2 = registry.getBillingTokenConfig(billingTokenAddress2); + assertEq(config2.gasFeePPB, 5_002); + assertEq(config2.flatFeeMilliCents, 20_002); + assertEq(config2.priceFeed, address(USDTOKEN_USD_FEED)); + assertEq(config2.fallbackPrice, 200); + assertEq(config2.minSpend, 200); + + address[] memory tokens = registry.getBillingTokens(); + assertEq(tokens.length, 2); + } + + function testSetConfigTwiceAndLastSetOverwrites() public { + (uint32 configCount, , ) = registry.latestConfigDetails(); + assertEq(configCount, 1); + + // BillingConfig1 + address billingTokenAddress1 = address(usdToken18); + address[] memory billingTokens1 = new address[](1); + billingTokens1[0] = billingTokenAddress1; + + AutomationRegistryBase2_3.BillingConfig[] memory billingConfigs1 = new AutomationRegistryBase2_3.BillingConfig[](1); + billingConfigs1[0] = AutomationRegistryBase2_3.BillingConfig({ + gasFeePPB: 5_001, + flatFeeMilliCents: 20_001, + priceFeed: address(USDTOKEN_USD_FEED), + fallbackPrice: 100, + minSpend: 100, + decimals: 18 + }); + + // the first time uses the default onchain config with 2 registrars + bytes memory onchainConfigBytesWithBilling1 = abi.encode(cfg, billingTokens1, billingConfigs1); + + // set config once + registry.setConfig( + SIGNERS, + TRANSMITTERS, + F, + onchainConfigBytesWithBilling1, + OFFCHAIN_CONFIG_VERSION, + offchainConfigBytes + ); + + (, IAutomationV21PlusCommon.OnchainConfigLegacy memory onchainConfig1, , , ) = registry.getState(); + assertEq(onchainConfig1.registrars.length, 2); + + // BillingConfig2 + address billingTokenAddress2 = address(usdToken18); + address[] memory billingTokens2 = new address[](1); + billingTokens2[0] = billingTokenAddress2; + + AutomationRegistryBase2_3.BillingConfig[] memory billingConfigs2 = new AutomationRegistryBase2_3.BillingConfig[](1); + billingConfigs2[0] = AutomationRegistryBase2_3.BillingConfig({ + gasFeePPB: 5_002, + flatFeeMilliCents: 20_002, + priceFeed: address(USDTOKEN_USD_FEED), + fallbackPrice: 200, + minSpend: 200, + decimals: 18 + }); + + address[] memory newRegistrars = new address[](3); + newRegistrars[0] = address(uint160(uint256(keccak256("newRegistrar1")))); + newRegistrars[1] = address(uint160(uint256(keccak256("newRegistrar2")))); + newRegistrars[2] = address(uint160(uint256(keccak256("newRegistrar3")))); + + // new onchain config with 3 new registrars, all other fields stay the same as the default + AutomationRegistryBase2_3.OnchainConfig memory cfg2 = AutomationRegistryBase2_3.OnchainConfig({ + checkGasLimit: 5_000_000, + stalenessSeconds: 90_000, + gasCeilingMultiplier: 0, + maxPerformGas: 10_000_000, + maxCheckDataSize: 5_000, + maxPerformDataSize: 5_000, + maxRevertDataSize: 5_000, + fallbackGasPrice: 20_000_000_000, + fallbackLinkPrice: 2_000_000_000, // $20 + fallbackNativePrice: 400_000_000_000, // $4,000 + transcoder: 0xB1e66855FD67f6e85F0f0fA38cd6fBABdf00923c, + registrars: newRegistrars, + upkeepPrivilegeManager: PRIVILEGE_MANAGER, + chainModule: module, + reorgProtectionEnabled: true, + financeAdmin: FINANCE_ADMIN + }); + + // the second time uses the new onchain config with 3 new registrars and also new billing tokens/configs + bytes memory onchainConfigBytesWithBilling2 = abi.encode(cfg2, billingTokens2, billingConfigs2); + + // set config twice + registry.setConfig( + SIGNERS, + TRANSMITTERS, + F, + onchainConfigBytesWithBilling2, + OFFCHAIN_CONFIG_VERSION, + offchainConfigBytes + ); + + ( + , + IAutomationV21PlusCommon.OnchainConfigLegacy memory onchainConfig2, + address[] memory signers, + address[] memory transmitters, + uint8 f + ) = registry.getState(); + + assertEq(onchainConfig2.registrars.length, 3); + for (uint256 i = 0; i < newRegistrars.length; i++) { + assertEq(newRegistrars[i], onchainConfig2.registrars[i]); + } + assertEq(signers, SIGNERS); + assertEq(transmitters, TRANSMITTERS); + assertEq(f, F); + + AutomationRegistryBase2_3.BillingConfig memory config2 = registry.getBillingTokenConfig(billingTokenAddress2); + assertEq(config2.gasFeePPB, 5_002); + assertEq(config2.flatFeeMilliCents, 20_002); + assertEq(config2.priceFeed, address(USDTOKEN_USD_FEED)); + assertEq(config2.fallbackPrice, 200); + assertEq(config2.minSpend, 200); + + address[] memory tokens = registry.getBillingTokens(); + assertEq(tokens.length, 1); + } + + function testSetConfigDuplicateBillingConfigFailure() public { + (uint32 configCount, , ) = registry.latestConfigDetails(); + assertEq(configCount, 1); + + address billingTokenAddress1 = address(linkToken); + address billingTokenAddress2 = address(linkToken); + address[] memory billingTokens = new address[](2); + billingTokens[0] = billingTokenAddress1; + billingTokens[1] = billingTokenAddress2; + + AutomationRegistryBase2_3.BillingConfig[] memory billingConfigs = new AutomationRegistryBase2_3.BillingConfig[](2); + billingConfigs[0] = AutomationRegistryBase2_3.BillingConfig({ + gasFeePPB: 5_001, + flatFeeMilliCents: 20_001, + priceFeed: address(USDTOKEN_USD_FEED), + fallbackPrice: 100, + minSpend: 100, + decimals: 18 + }); + billingConfigs[1] = AutomationRegistryBase2_3.BillingConfig({ + gasFeePPB: 5_002, + flatFeeMilliCents: 20_002, + priceFeed: address(USDTOKEN_USD_FEED), + fallbackPrice: 200, + minSpend: 200, + decimals: 18 + }); + + bytes memory onchainConfigBytesWithBilling = abi.encode(cfg, billingTokens, billingConfigs); + + // expect revert because of duplicate tokens + vm.expectRevert(abi.encodeWithSelector(Registry.DuplicateEntry.selector)); + registry.setConfig( + SIGNERS, + TRANSMITTERS, + F, + onchainConfigBytesWithBilling, + OFFCHAIN_CONFIG_VERSION, + offchainConfigBytes + ); + } + + function testSetConfigRevertDueToInvalidToken() public { + address[] memory billingTokens = new address[](1); + billingTokens[0] = address(linkToken); + + AutomationRegistryBase2_3.BillingConfig[] memory billingConfigs = new AutomationRegistryBase2_3.BillingConfig[](1); + billingConfigs[0] = AutomationRegistryBase2_3.BillingConfig({ + gasFeePPB: 5_000, + flatFeeMilliCents: 20_000, + priceFeed: address(USDTOKEN_USD_FEED), + fallbackPrice: 2_000_000_000, // $20 + minSpend: 100_000, + decimals: 18 + }); + + // deploy registry with OFF_CHAIN payout mode + registry = deployZKSyncRegistry(AutoBase.PayoutMode.OFF_CHAIN); + + vm.expectRevert(abi.encodeWithSelector(Registry.InvalidToken.selector)); + registry.setConfigTypeSafe( + SIGNERS, + TRANSMITTERS, + F, + cfg, + OFFCHAIN_CONFIG_VERSION, + offchainConfigBytes, + billingTokens, + billingConfigs + ); + } + + function testSetConfigRevertDueToInvalidDecimals() public { + address[] memory billingTokens = new address[](1); + billingTokens[0] = address(linkToken); + + AutomationRegistryBase2_3.BillingConfig[] memory billingConfigs = new AutomationRegistryBase2_3.BillingConfig[](1); + billingConfigs[0] = AutomationRegistryBase2_3.BillingConfig({ + gasFeePPB: 5_000, + flatFeeMilliCents: 20_000, + priceFeed: address(USDTOKEN_USD_FEED), + fallbackPrice: 2_000_000_000, // $20 + minSpend: 100_000, + decimals: 6 // link token should have 18 decimals + }); + + vm.expectRevert(abi.encodeWithSelector(Registry.InvalidToken.selector)); + registry.setConfigTypeSafe( + SIGNERS, + TRANSMITTERS, + F, + cfg, + OFFCHAIN_CONFIG_VERSION, + offchainConfigBytes, + billingTokens, + billingConfigs + ); + } + + function testSetConfigOnTransmittersAndPayees() public { + registry.setPayees(PAYEES); + AutomationRegistryBase2_3.TransmitterPayeeInfo[] memory transmitterPayeeInfos = registry + .getTransmittersWithPayees(); + assertEq(transmitterPayeeInfos.length, TRANSMITTERS.length); + + for (uint256 i = 0; i < transmitterPayeeInfos.length; i++) { + address transmitterAddress = transmitterPayeeInfos[i].transmitterAddress; + address payeeAddress = transmitterPayeeInfos[i].payeeAddress; + + address expectedTransmitter = TRANSMITTERS[i]; + address expectedPayee = PAYEES[i]; + + assertEq(transmitterAddress, expectedTransmitter); + assertEq(payeeAddress, expectedPayee); + } + } + + function testSetConfigWithNewTransmittersSuccess() public { + registry = deployZKSyncRegistry(AutoBase.PayoutMode.OFF_CHAIN); + + (uint32 configCount, uint32 blockNumber, ) = registry.latestConfigDetails(); + assertEq(configCount, 0); + + address billingTokenAddress = address(usdToken18); + address[] memory billingTokens = new address[](1); + billingTokens[0] = billingTokenAddress; + + AutomationRegistryBase2_3.BillingConfig[] memory billingConfigs = new AutomationRegistryBase2_3.BillingConfig[](1); + billingConfigs[0] = AutomationRegistryBase2_3.BillingConfig({ + gasFeePPB: 5_000, + flatFeeMilliCents: 20_000, + priceFeed: address(USDTOKEN_USD_FEED), + fallbackPrice: 2_000_000_000, // $20 + minSpend: 100_000, + decimals: 18 + }); + + bytes memory onchainConfigBytes = abi.encode(cfg); + + bytes32 configDigest = _configDigestFromConfigData( + block.chainid, + address(registry), + ++configCount, + SIGNERS, + TRANSMITTERS, + F, + onchainConfigBytes, + OFFCHAIN_CONFIG_VERSION, + offchainConfigBytes + ); + + vm.expectEmit(); + emit ConfigSet( + blockNumber, + configDigest, + configCount, + SIGNERS, + TRANSMITTERS, + F, + onchainConfigBytes, + OFFCHAIN_CONFIG_VERSION, + offchainConfigBytes + ); + + registry.setConfigTypeSafe( + SIGNERS, + TRANSMITTERS, + F, + cfg, + OFFCHAIN_CONFIG_VERSION, + offchainConfigBytes, + billingTokens, + billingConfigs + ); + + (, , address[] memory signers, address[] memory transmitters, ) = registry.getState(); + assertEq(signers, SIGNERS); + assertEq(transmitters, TRANSMITTERS); + + (configCount, blockNumber, ) = registry.latestConfigDetails(); + configDigest = _configDigestFromConfigData( + block.chainid, + address(registry), + ++configCount, + SIGNERS, + NEW_TRANSMITTERS, + F, + onchainConfigBytes, + OFFCHAIN_CONFIG_VERSION, + offchainConfigBytes + ); + + vm.expectEmit(); + emit ConfigSet( + blockNumber, + configDigest, + configCount, + SIGNERS, + NEW_TRANSMITTERS, + F, + onchainConfigBytes, + OFFCHAIN_CONFIG_VERSION, + offchainConfigBytes + ); + + registry.setConfigTypeSafe( + SIGNERS, + NEW_TRANSMITTERS, + F, + cfg, + OFFCHAIN_CONFIG_VERSION, + offchainConfigBytes, + billingTokens, + billingConfigs + ); + + (, , signers, transmitters, ) = registry.getState(); + assertEq(signers, SIGNERS); + assertEq(transmitters, NEW_TRANSMITTERS); + } + + function _getRegistrars() private pure returns (address[] memory) { + address[] memory registrars = new address[](2); + registrars[0] = address(uint160(uint256(keccak256("registrar1")))); + registrars[1] = address(uint160(uint256(keccak256("registrar2")))); + return registrars; + } + + function _configDigestFromConfigData( + uint256 chainId, + address contractAddress, + uint64 configCount, + address[] memory signers, + address[] memory transmitters, + uint8 f, + bytes memory onchainConfig, + uint64 offchainConfigVersion, + bytes memory offchainConfig + ) internal pure returns (bytes32) { + uint256 h = uint256( + keccak256( + abi.encode( + chainId, + contractAddress, + configCount, + signers, + transmitters, + f, + onchainConfig, + offchainConfigVersion, + offchainConfig + ) + ) + ); + uint256 prefixMask = type(uint256).max << (256 - 16); // 0xFFFF00..00 + uint256 prefix = 0x0001 << (256 - 16); // 0x000100..00 + return bytes32((prefix & prefixMask) | (h & ~prefixMask)); + } +} + +contract NOPsSettlement is SetUp { + event NOPsSettledOffchain(address[] payees, uint256[] payments); + event FundsWithdrawn(uint256 indexed id, uint256 amount, address to); + event PaymentWithdrawn(address indexed transmitter, uint256 indexed amount, address indexed to, address payee); + + function testSettleNOPsOffchainRevertDueToUnauthorizedCaller() public { + (Registry registry, ) = deployAndConfigureZKSyncRegistryAndRegistrar(AutoBase.PayoutMode.ON_CHAIN); + + vm.expectRevert(abi.encodeWithSelector(Registry.OnlyFinanceAdmin.selector)); + registry.settleNOPsOffchain(); + } + + function testSettleNOPsOffchainRevertDueToOffchainSettlementDisabled() public { + (Registry registry, ) = deployAndConfigureZKSyncRegistryAndRegistrar(AutoBase.PayoutMode.OFF_CHAIN); + + vm.prank(registry.owner()); + registry.disableOffchainPayments(); + + vm.prank(FINANCE_ADMIN); + vm.expectRevert(abi.encodeWithSelector(Registry.MustSettleOnchain.selector)); + registry.settleNOPsOffchain(); + } + + function testSettleNOPsOffchainSuccess() public { + // deploy and configure a registry with OFF_CHAIN payout + (Registry registry, ) = deployAndConfigureZKSyncRegistryAndRegistrar(AutoBase.PayoutMode.OFF_CHAIN); + registry.setPayees(PAYEES); + + uint256[] memory payments = new uint256[](TRANSMITTERS.length); + for (uint256 i = 0; i < TRANSMITTERS.length; i++) { + payments[i] = 0; + } + + vm.startPrank(FINANCE_ADMIN); + vm.expectEmit(); + emit NOPsSettledOffchain(PAYEES, payments); + registry.settleNOPsOffchain(); + } + + // 1. transmitter balance zeroed after settlement, 2. admin can withdraw ERC20, 3. switch to onchain mode, 4. link amount owed to NOPs stays the same + function testSettleNOPsOffchainSuccessWithERC20MultiSteps() public { + // deploy and configure a registry with OFF_CHAIN payout + (Registry registry, ) = deployAndConfigureZKSyncRegistryAndRegistrar(AutoBase.PayoutMode.OFF_CHAIN); + registry.setPayees(PAYEES); + + // register an upkeep and add funds + uint256 id = registry.registerUpkeep(address(TARGET1), 1000000, UPKEEP_ADMIN, 0, address(usdToken18), "", "", ""); + _mintERC20_18Decimals(UPKEEP_ADMIN, 1e20); + vm.startPrank(UPKEEP_ADMIN); + usdToken18.approve(address(registry), 1e20); + registry.addFunds(id, 1e20); + + // manually create a transmit so transmitters earn some rewards + _transmit(id, registry, bytes4(0)); + + // verify transmitters have positive balances + uint256[] memory payments = new uint256[](TRANSMITTERS.length); + for (uint256 i = 0; i < TRANSMITTERS.length; i++) { + (bool active, uint8 index, uint96 balance, uint96 lastCollected, ) = registry.getTransmitterInfo(TRANSMITTERS[i]); + assertTrue(active); + assertEq(i, index); + assertTrue(balance > 0); + assertEq(0, lastCollected); + + payments[i] = balance; + } + + // verify offchain settlement will emit NOPs' balances + vm.startPrank(FINANCE_ADMIN); + vm.expectEmit(); + emit NOPsSettledOffchain(PAYEES, payments); + registry.settleNOPsOffchain(); + + // verify that transmitters balance has been zeroed out + for (uint256 i = 0; i < TRANSMITTERS.length; i++) { + (bool active, uint8 index, uint96 balance, , ) = registry.getTransmitterInfo(TRANSMITTERS[i]); + assertTrue(active); + assertEq(i, index); + assertEq(0, balance); + } + + // after the offchain settlement, the total reserve amount of LINK should be 0 + assertEq(registry.getReserveAmount(address(linkToken)), 0); + // should have some ERC20s in registry after transmit + uint256 erc20ForPayment1 = registry.getAvailableERC20ForPayment(address(usdToken18)); + require(erc20ForPayment1 > 0, "ERC20AvailableForPayment should be positive"); + + vm.startPrank(UPKEEP_ADMIN); + vm.roll(100 + block.number); + // manually create a transmit so transmitters earn some rewards + _transmit(id, registry, bytes4(0)); + + uint256 erc20ForPayment2 = registry.getAvailableERC20ForPayment(address(usdToken18)); + require(erc20ForPayment2 > erc20ForPayment1, "ERC20AvailableForPayment should be greater after another transmit"); + + // finance admin comes to withdraw all available ERC20s + vm.startPrank(FINANCE_ADMIN); + registry.withdrawERC20Fees(address(usdToken18), FINANCE_ADMIN, erc20ForPayment2); + + uint256 erc20ForPayment3 = registry.getAvailableERC20ForPayment(address(usdToken18)); + require(erc20ForPayment3 == 0, "ERC20AvailableForPayment should be 0 now after withdrawal"); + + uint256 reservedLink = registry.getReserveAmount(address(linkToken)); + require(reservedLink > 0, "Reserve amount of LINK should be positive since there was another transmit"); + + // owner comes to disable offchain mode + vm.startPrank(registry.owner()); + registry.disableOffchainPayments(); + + // finance admin comes to withdraw all available ERC20s, should revert bc of insufficient link liquidity + vm.startPrank(FINANCE_ADMIN); + uint256 erc20ForPayment4 = registry.getAvailableERC20ForPayment(address(usdToken18)); + vm.expectRevert(abi.encodeWithSelector(Registry.InsufficientLinkLiquidity.selector)); + registry.withdrawERC20Fees(address(usdToken18), FINANCE_ADMIN, erc20ForPayment4); + + // reserved link amount to NOPs should stay the same after switching to onchain mode + assertEq(registry.getReserveAmount(address(linkToken)), reservedLink); + // available ERC20 for payment should be 0 since finance admin withdrew all already + assertEq(erc20ForPayment4, 0); + } + + function testSettleNOPsOffchainForDeactivatedTransmittersSuccess() public { + // deploy and configure a registry with OFF_CHAIN payout + (Registry registry, Registrar registrar) = deployAndConfigureZKSyncRegistryAndRegistrar( + AutoBase.PayoutMode.OFF_CHAIN + ); + + // register an upkeep and add funds + uint256 id = registry.registerUpkeep(address(TARGET1), 1000000, UPKEEP_ADMIN, 0, address(usdToken18), "", "", ""); + _mintERC20_18Decimals(UPKEEP_ADMIN, 1e20); + vm.startPrank(UPKEEP_ADMIN); + usdToken18.approve(address(registry), 1e20); + registry.addFunds(id, 1e20); + + // manually create a transmit so TRANSMITTERS earn some rewards + _transmit(id, registry, bytes4(0)); + + // TRANSMITTERS have positive balance now + // configure the registry to use NEW_TRANSMITTERS + _configureWithNewTransmitters(registry, registrar); + + _transmit(id, registry, bytes4(0)); + + // verify all transmitters have positive balances + address[] memory expectedPayees = new address[](6); + uint256[] memory expectedPayments = new uint256[](6); + for (uint256 i = 0; i < NEW_TRANSMITTERS.length; i++) { + (bool active, uint8 index, uint96 balance, uint96 lastCollected, address payee) = registry.getTransmitterInfo( + NEW_TRANSMITTERS[i] + ); + assertTrue(active); + assertEq(i, index); + assertTrue(lastCollected > 0); + expectedPayments[i] = balance; + expectedPayees[i] = payee; + } + for (uint256 i = 2; i < TRANSMITTERS.length; i++) { + (bool active, uint8 index, uint96 balance, uint96 lastCollected, address payee) = registry.getTransmitterInfo( + TRANSMITTERS[i] + ); + assertFalse(active); + assertEq(i, index); + assertTrue(balance > 0); + assertTrue(lastCollected > 0); + expectedPayments[2 + i] = balance; + expectedPayees[2 + i] = payee; + } + + // verify offchain settlement will emit NOPs' balances + vm.startPrank(FINANCE_ADMIN); + + // simply expectEmit won't work here because s_deactivatedTransmitters is an enumerable set so the order of these + // deactivated transmitters is not guaranteed. To handle this, we record logs and decode data field manually. + vm.recordLogs(); + registry.settleNOPsOffchain(); + Vm.Log[] memory entries = vm.getRecordedLogs(); + + assertEq(entries.length, 1); + Vm.Log memory l = entries[0]; + assertEq(l.topics[0], keccak256("NOPsSettledOffchain(address[],uint256[])")); + (address[] memory actualPayees, uint256[] memory actualPayments) = abi.decode(l.data, (address[], uint256[])); + assertEq(actualPayees.length, 6); + assertEq(actualPayments.length, 6); + + // first 4 payees and payments are for NEW_TRANSMITTERS and they are ordered. + for (uint256 i = 0; i < NEW_TRANSMITTERS.length; i++) { + assertEq(actualPayees[i], expectedPayees[i]); + assertEq(actualPayments[i], expectedPayments[i]); + } + + // the last 2 payees and payments for TRANSMITTERS[2] and TRANSMITTERS[3] and they are not ordered + assertTrue( + (actualPayments[5] == expectedPayments[5] && + actualPayees[5] == expectedPayees[5] && + actualPayments[4] == expectedPayments[4] && + actualPayees[4] == expectedPayees[4]) || + (actualPayments[5] == expectedPayments[4] && + actualPayees[5] == expectedPayees[4] && + actualPayments[4] == expectedPayments[5] && + actualPayees[4] == expectedPayees[5]) + ); + + // verify that new transmitters balance has been zeroed out + for (uint256 i = 0; i < NEW_TRANSMITTERS.length; i++) { + (bool active, uint8 index, uint96 balance, , ) = registry.getTransmitterInfo(NEW_TRANSMITTERS[i]); + assertTrue(active); + assertEq(i, index); + assertEq(0, balance); + } + // verify that deactivated transmitters (TRANSMITTERS[2] and TRANSMITTERS[3]) balance has been zeroed out + for (uint256 i = 2; i < TRANSMITTERS.length; i++) { + (bool active, uint8 index, uint96 balance, , ) = registry.getTransmitterInfo(TRANSMITTERS[i]); + assertFalse(active); + assertEq(i, index); + assertEq(0, balance); + } + + // after the offchain settlement, the total reserve amount of LINK should be 0 + assertEq(registry.getReserveAmount(address(linkToken)), 0); + } + + function testDisableOffchainPaymentsRevertDueToUnauthorizedCaller() public { + (Registry registry, ) = deployAndConfigureZKSyncRegistryAndRegistrar(AutoBase.PayoutMode.OFF_CHAIN); + + vm.startPrank(FINANCE_ADMIN); + vm.expectRevert(bytes("Only callable by owner")); + registry.disableOffchainPayments(); + } + + function testDisableOffchainPaymentsSuccess() public { + (Registry registry, ) = deployAndConfigureZKSyncRegistryAndRegistrar(AutoBase.PayoutMode.OFF_CHAIN); + + vm.startPrank(registry.owner()); + registry.disableOffchainPayments(); + + assertEq(uint8(AutoBase.PayoutMode.ON_CHAIN), registry.getPayoutMode()); + } + + function testSinglePerformAndNodesCanWithdrawOnchain() public { + // deploy and configure a registry with OFF_CHAIN payout + (Registry registry, ) = deployAndConfigureZKSyncRegistryAndRegistrar(AutoBase.PayoutMode.OFF_CHAIN); + registry.setPayees(PAYEES); + + // register an upkeep and add funds + uint256 id = registry.registerUpkeep(address(TARGET1), 1000000, UPKEEP_ADMIN, 0, address(usdToken18), "", "", ""); + _mintERC20_18Decimals(UPKEEP_ADMIN, 1e20); + vm.startPrank(UPKEEP_ADMIN); + usdToken18.approve(address(registry), 1e20); + registry.addFunds(id, 1e20); + + // manually create a transmit so transmitters earn some rewards + _transmit(id, registry, bytes4(0)); + + // disable offchain payments + _mintLink(address(registry), 1e19); + vm.prank(registry.owner()); + registry.disableOffchainPayments(); + + // payees should be able to withdraw onchain + for (uint256 i = 0; i < TRANSMITTERS.length; i++) { + (, , uint96 balance, , address payee) = registry.getTransmitterInfo(TRANSMITTERS[i]); + vm.prank(payee); + vm.expectEmit(); + emit PaymentWithdrawn(TRANSMITTERS[i], balance, payee, payee); + registry.withdrawPayment(TRANSMITTERS[i], payee); + } + + // allow upkeep admin to withdraw funds + vm.startPrank(UPKEEP_ADMIN); + registry.cancelUpkeep(id); + vm.roll(100 + block.number); + vm.expectEmit(); + // the upkeep spent less than minimum spending limit so upkeep admin can only withdraw upkeep balance - min spend value + emit FundsWithdrawn(id, 9.9e19, UPKEEP_ADMIN); + registry.withdrawFunds(id, UPKEEP_ADMIN); + } + + function testMultiplePerformsAndNodesCanWithdrawOnchain() public { + // deploy and configure a registry with OFF_CHAIN payout + (Registry registry, ) = deployAndConfigureZKSyncRegistryAndRegistrar(AutoBase.PayoutMode.OFF_CHAIN); + registry.setPayees(PAYEES); + + // register an upkeep and add funds + uint256 id = registry.registerUpkeep(address(TARGET1), 1000000, UPKEEP_ADMIN, 0, address(usdToken18), "", "", ""); + _mintERC20_18Decimals(UPKEEP_ADMIN, 1e20); + vm.startPrank(UPKEEP_ADMIN); + usdToken18.approve(address(registry), 1e20); + registry.addFunds(id, 1e20); + + // manually call transmit so transmitters earn some rewards + for (uint256 i = 0; i < 50; i++) { + vm.roll(100 + block.number); + _transmit(id, registry, bytes4(0)); + } + + // disable offchain payments + _mintLink(address(registry), 1e19); + vm.prank(registry.owner()); + registry.disableOffchainPayments(); + + // manually call transmit after offchain payment is disabled + for (uint256 i = 0; i < 50; i++) { + vm.roll(100 + block.number); + _transmit(id, registry, bytes4(0)); + } + + // payees should be able to withdraw onchain + for (uint256 i = 0; i < TRANSMITTERS.length; i++) { + (, , uint96 balance, , address payee) = registry.getTransmitterInfo(TRANSMITTERS[i]); + vm.prank(payee); + vm.expectEmit(); + emit PaymentWithdrawn(TRANSMITTERS[i], balance, payee, payee); + registry.withdrawPayment(TRANSMITTERS[i], payee); + } + + // allow upkeep admin to withdraw funds + vm.startPrank(UPKEEP_ADMIN); + registry.cancelUpkeep(id); + vm.roll(100 + block.number); + uint256 balance = registry.getBalance(id); + vm.expectEmit(); + emit FundsWithdrawn(id, balance, UPKEEP_ADMIN); + registry.withdrawFunds(id, UPKEEP_ADMIN); + } + + function _configureWithNewTransmitters(Registry registry, Registrar registrar) internal { + IERC20[] memory billingTokens = new IERC20[](1); + billingTokens[0] = IERC20(address(usdToken18)); + + uint256[] memory minRegistrationFees = new uint256[](billingTokens.length); + minRegistrationFees[0] = 100e18; // 100 USD + + address[] memory billingTokenAddresses = new address[](billingTokens.length); + for (uint256 i = 0; i < billingTokens.length; i++) { + billingTokenAddresses[i] = address(billingTokens[i]); + } + + AutomationRegistryBase2_3.BillingConfig[] + memory billingTokenConfigs = new AutomationRegistryBase2_3.BillingConfig[](billingTokens.length); + billingTokenConfigs[0] = AutomationRegistryBase2_3.BillingConfig({ + gasFeePPB: 10_000_000, // 15% + flatFeeMilliCents: 2_000, // 2 cents + priceFeed: address(USDTOKEN_USD_FEED), + fallbackPrice: 1e8, // $1 + minSpend: 1e18, // 1 USD + decimals: 18 + }); + + address[] memory registrars = new address[](1); + registrars[0] = address(registrar); + + AutomationRegistryBase2_3.OnchainConfig memory cfg = AutomationRegistryBase2_3.OnchainConfig({ + checkGasLimit: 5_000_000, + stalenessSeconds: 90_000, + gasCeilingMultiplier: 2, + maxPerformGas: 10_000_000, + maxCheckDataSize: 5_000, + maxPerformDataSize: 5_000, + maxRevertDataSize: 5_000, + fallbackGasPrice: 20_000_000_000, + fallbackLinkPrice: 2_000_000_000, // $20 + fallbackNativePrice: 400_000_000_000, // $4,000 + transcoder: 0xB1e66855FD67f6e85F0f0fA38cd6fBABdf00923c, + registrars: registrars, + upkeepPrivilegeManager: PRIVILEGE_MANAGER, + chainModule: address(new ChainModuleBase()), + reorgProtectionEnabled: true, + financeAdmin: FINANCE_ADMIN + }); + + registry.setConfigTypeSafe( + SIGNERS, + NEW_TRANSMITTERS, + F, + cfg, + OFFCHAIN_CONFIG_VERSION, + "", + billingTokenAddresses, + billingTokenConfigs + ); + + registry.setPayees(NEW_PAYEES); + } +} + +contract WithdrawPayment is SetUp { + function testWithdrawPaymentRevertDueToOffchainPayoutMode() public { + registry = deployZKSyncRegistry(AutoBase.PayoutMode.OFF_CHAIN); + vm.expectRevert(abi.encodeWithSelector(Registry.MustSettleOffchain.selector)); + vm.prank(TRANSMITTERS[0]); + registry.withdrawPayment(TRANSMITTERS[0], TRANSMITTERS[0]); + } +} + +contract RegisterUpkeep is SetUp { + function test_RevertsWhen_Paused() public { + registry.pause(); + vm.expectRevert(Registry.RegistryPaused.selector); + registry.registerUpkeep( + address(TARGET1), + config.maxPerformGas, + UPKEEP_ADMIN, + uint8(Trigger.CONDITION), + address(linkToken), + "", + "", + "" + ); + } + + function test_RevertsWhen_TargetIsNotAContract() public { + vm.expectRevert(Registry.NotAContract.selector); + registry.registerUpkeep( + randomAddress(), + config.maxPerformGas, + UPKEEP_ADMIN, + uint8(Trigger.CONDITION), + address(linkToken), + "", + "", + "" + ); + } + + function test_RevertsWhen_CalledByNonOwner() public { + vm.prank(STRANGER); + vm.expectRevert(Registry.OnlyCallableByOwnerOrRegistrar.selector); + registry.registerUpkeep( + address(TARGET1), + config.maxPerformGas, + UPKEEP_ADMIN, + uint8(Trigger.CONDITION), + address(linkToken), + "", + "", + "" + ); + } + + function test_RevertsWhen_ExecuteGasIsTooLow() public { + vm.expectRevert(Registry.GasLimitOutsideRange.selector); + registry.registerUpkeep( + address(TARGET1), + 2299, // 1 less than min + UPKEEP_ADMIN, + uint8(Trigger.CONDITION), + address(linkToken), + "", + "", + "" + ); + } + + function test_RevertsWhen_ExecuteGasIsTooHigh() public { + vm.expectRevert(Registry.GasLimitOutsideRange.selector); + registry.registerUpkeep( + address(TARGET1), + config.maxPerformGas + 1, + UPKEEP_ADMIN, + uint8(Trigger.CONDITION), + address(linkToken), + "", + "", + "" + ); + } + + function test_RevertsWhen_TheBillingTokenIsNotConfigured() public { + vm.expectRevert(Registry.InvalidToken.selector); + registry.registerUpkeep( + address(TARGET1), + config.maxPerformGas, + UPKEEP_ADMIN, + uint8(Trigger.CONDITION), + randomAddress(), + "", + "", + "" + ); + } + + function test_RevertsWhen_CheckDataIsTooLarge() public { + vm.expectRevert(Registry.CheckDataExceedsLimit.selector); + registry.registerUpkeep( + address(TARGET1), + config.maxPerformGas, + UPKEEP_ADMIN, + uint8(Trigger.CONDITION), + address(linkToken), + randomBytes(config.maxCheckDataSize + 1), + "", + "" + ); + } + + function test_Happy() public { + bytes memory checkData = randomBytes(config.maxCheckDataSize); + bytes memory trigggerConfig = randomBytes(100); + bytes memory offchainConfig = randomBytes(100); + + uint256 upkeepCount = registry.getNumUpkeeps(); + + uint256 upkeepID = registry.registerUpkeep( + address(TARGET1), + config.maxPerformGas, + UPKEEP_ADMIN, + uint8(Trigger.LOG), + address(linkToken), + checkData, + trigggerConfig, + offchainConfig + ); + + assertEq(registry.getNumUpkeeps(), upkeepCount + 1); + assertEq(registry.getUpkeep(upkeepID).target, address(TARGET1)); + assertEq(registry.getUpkeep(upkeepID).performGas, config.maxPerformGas); + assertEq(registry.getUpkeep(upkeepID).checkData, checkData); + assertEq(registry.getUpkeep(upkeepID).balance, 0); + assertEq(registry.getUpkeep(upkeepID).admin, UPKEEP_ADMIN); + assertEq(registry.getUpkeep(upkeepID).offchainConfig, offchainConfig); + assertEq(registry.getUpkeepTriggerConfig(upkeepID), trigggerConfig); + assertEq(uint8(registry.getTriggerType(upkeepID)), uint8(Trigger.LOG)); + } +} + +contract OnTokenTransfer is SetUp { + function test_RevertsWhen_NotCalledByTheLinkToken() public { + vm.expectRevert(Registry.OnlyCallableByLINKToken.selector); + registry.onTokenTransfer(UPKEEP_ADMIN, 100, abi.encode(linkUpkeepID)); + } + + function test_RevertsWhen_NotCalledWithExactly32Bytes() public { + vm.startPrank(address(linkToken)); + vm.expectRevert(Registry.InvalidDataLength.selector); + registry.onTokenTransfer(UPKEEP_ADMIN, 100, randomBytes(31)); + vm.expectRevert(Registry.InvalidDataLength.selector); + registry.onTokenTransfer(UPKEEP_ADMIN, 100, randomBytes(33)); + } + + function test_RevertsWhen_TheUpkeepIsCancelledOrDNE() public { + vm.startPrank(address(linkToken)); + vm.expectRevert(Registry.UpkeepCancelled.selector); + registry.onTokenTransfer(UPKEEP_ADMIN, 100, abi.encode(randomNumber())); + } + + function test_RevertsWhen_TheUpkeepDoesNotUseLINKAsItsBillingToken() public { + vm.startPrank(address(linkToken)); + vm.expectRevert(Registry.InvalidToken.selector); + registry.onTokenTransfer(UPKEEP_ADMIN, 100, abi.encode(usdUpkeepID18)); + } + + function test_Happy() public { + vm.startPrank(address(linkToken)); + uint256 beforeBalance = registry.getBalance(linkUpkeepID); + registry.onTokenTransfer(UPKEEP_ADMIN, 100, abi.encode(linkUpkeepID)); + assertEq(registry.getBalance(linkUpkeepID), beforeBalance + 100); + } +} + +contract GetMinBalanceForUpkeep is SetUp { + function test_accountsForFlatFee_with18Decimals() public { + // set fee to 0 + AutomationRegistryBase2_3.BillingConfig memory usdTokenConfig = registry.getBillingTokenConfig(address(usdToken18)); + usdTokenConfig.flatFeeMilliCents = 0; + _updateBillingTokenConfig(registry, address(usdToken18), usdTokenConfig); + + uint256 minBalanceBefore = registry.getMinBalanceForUpkeep(usdUpkeepID18); + + // set fee to non-zero + usdTokenConfig.flatFeeMilliCents = 100; + _updateBillingTokenConfig(registry, address(usdToken18), usdTokenConfig); + + uint256 minBalanceAfter = registry.getMinBalanceForUpkeep(usdUpkeepID18); + assertEq( + minBalanceAfter, + minBalanceBefore + ((uint256(usdTokenConfig.flatFeeMilliCents) * 1e13) / 10 ** (18 - usdTokenConfig.decimals)) + ); + } + + function test_accountsForFlatFee_with6Decimals() public { + // set fee to 0 + AutomationRegistryBase2_3.BillingConfig memory usdTokenConfig = registry.getBillingTokenConfig(address(usdToken6)); + usdTokenConfig.flatFeeMilliCents = 0; + _updateBillingTokenConfig(registry, address(usdToken6), usdTokenConfig); + + uint256 minBalanceBefore = registry.getMinBalanceForUpkeep(usdUpkeepID6); + + // set fee to non-zero + usdTokenConfig.flatFeeMilliCents = 100; + _updateBillingTokenConfig(registry, address(usdToken6), usdTokenConfig); + + uint256 minBalanceAfter = registry.getMinBalanceForUpkeep(usdUpkeepID6); + assertEq( + minBalanceAfter, + minBalanceBefore + ((uint256(usdTokenConfig.flatFeeMilliCents) * 1e13) / 10 ** (18 - usdTokenConfig.decimals)) + ); + } +} + +contract BillingOverrides is SetUp { + event BillingConfigOverridden(uint256 indexed id, AutomationRegistryBase2_3.BillingOverrides overrides); + event BillingConfigOverrideRemoved(uint256 indexed id); + + function test_RevertsWhen_NotPrivilegeManager() public { + AutomationRegistryBase2_3.BillingOverrides memory billingOverrides = AutomationRegistryBase2_3.BillingOverrides({ + gasFeePPB: 5_000, + flatFeeMilliCents: 20_000 + }); + + vm.expectRevert(Registry.OnlyCallableByUpkeepPrivilegeManager.selector); + registry.setBillingOverrides(linkUpkeepID, billingOverrides); + } + + function test_RevertsWhen_UpkeepCancelled() public { + AutomationRegistryBase2_3.BillingOverrides memory billingOverrides = AutomationRegistryBase2_3.BillingOverrides({ + gasFeePPB: 5_000, + flatFeeMilliCents: 20_000 + }); + + registry.cancelUpkeep(linkUpkeepID); + + vm.startPrank(PRIVILEGE_MANAGER); + vm.expectRevert(Registry.UpkeepCancelled.selector); + registry.setBillingOverrides(linkUpkeepID, billingOverrides); + } + + function test_Happy_SetBillingOverrides() public { + AutomationRegistryBase2_3.BillingOverrides memory billingOverrides = AutomationRegistryBase2_3.BillingOverrides({ + gasFeePPB: 5_000, + flatFeeMilliCents: 20_000 + }); + + vm.startPrank(PRIVILEGE_MANAGER); + + vm.expectEmit(); + emit BillingConfigOverridden(linkUpkeepID, billingOverrides); + registry.setBillingOverrides(linkUpkeepID, billingOverrides); + } + + function test_Happy_RemoveBillingOverrides() public { + vm.startPrank(PRIVILEGE_MANAGER); + + vm.expectEmit(); + emit BillingConfigOverrideRemoved(linkUpkeepID); + registry.removeBillingOverrides(linkUpkeepID); + } + + function test_Happy_MaxGasPayment_WithBillingOverrides() public { + uint96 maxPayment1 = registry.getMaxPaymentForGas(linkUpkeepID, 0, 5_000_000, address(linkToken)); + + // Double the two billing values + AutomationRegistryBase2_3.BillingOverrides memory billingOverrides = AutomationRegistryBase2_3.BillingOverrides({ + gasFeePPB: DEFAULT_GAS_FEE_PPB * 2, + flatFeeMilliCents: DEFAULT_FLAT_FEE_MILLI_CENTS * 2 + }); + + vm.startPrank(PRIVILEGE_MANAGER); + registry.setBillingOverrides(linkUpkeepID, billingOverrides); + + // maxPayment2 should be greater than maxPayment1 after the overrides + // The 2 numbers should follow this: maxPayment2 - maxPayment1 == 2 * recepit.premium + // We do not apply the exact equation since we couldn't get the receipt.premium value + uint96 maxPayment2 = registry.getMaxPaymentForGas(linkUpkeepID, 0, 5_000_000, address(linkToken)); + assertGt(maxPayment2, maxPayment1); + } +} + +contract Transmit is SetUp { + function test_transmitRevertWithExtraBytes() external { + bytes32[3] memory exampleReportContext = [ + bytes32(0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef), + bytes32(0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890), + bytes32(0x7890abcdef1234567890abcdef1234567890abcdef1234567890abcdef123456) + ]; + + bytes memory exampleRawReport = hex"deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef"; + + bytes32[] memory exampleRs = new bytes32[](3); + exampleRs[0] = bytes32(0x1234561234561234561234561234561234561234561234561234561234561234); + exampleRs[1] = bytes32(0x1234561234561234561234561234561234561234561234561234561234561234); + exampleRs[2] = bytes32(0x7890789078907890789078907890789078907890789078907890789078907890); + + bytes32[] memory exampleSs = new bytes32[](3); + exampleSs[0] = bytes32(0x1234561234561234561234561234561234561234561234561234561234561234); + exampleSs[1] = bytes32(0x1234561234561234561234561234561234561234561234561234561234561234); + exampleSs[2] = bytes32(0x1234561234561234561234561234561234561234561234561234561234561234); + + bytes32 exampleRawVs = bytes32(0x1234561234561234561234561234561234561234561234561234561234561234); + + bytes memory transmitData = abi.encodeWithSelector( + registry.transmit.selector, + exampleReportContext, + exampleRawReport, + exampleRs, + exampleSs, + exampleRawVs + ); + bytes memory badTransmitData = bytes.concat(transmitData, bytes1(0x00)); // add extra data + vm.startPrank(TRANSMITTERS[0]); + (bool success, bytes memory returnData) = address(registry).call(badTransmitData); // send the bogus transmit + assertFalse(success, "Call did not revert as expected"); + assertEq(returnData, abi.encodePacked(Registry.InvalidDataLength.selector)); + vm.stopPrank(); + } + + function test_handlesMixedBatchOfBillingTokens() external { + uint256[] memory prevUpkeepBalances = new uint256[](3); + prevUpkeepBalances[0] = registry.getBalance(linkUpkeepID); + prevUpkeepBalances[1] = registry.getBalance(usdUpkeepID18); + prevUpkeepBalances[2] = registry.getBalance(nativeUpkeepID); + uint256[] memory prevTokenBalances = new uint256[](3); + prevTokenBalances[0] = linkToken.balanceOf(address(registry)); + prevTokenBalances[1] = usdToken18.balanceOf(address(registry)); + prevTokenBalances[2] = weth.balanceOf(address(registry)); + uint256[] memory prevReserveBalances = new uint256[](3); + prevReserveBalances[0] = registry.getReserveAmount(address(linkToken)); + prevReserveBalances[1] = registry.getReserveAmount(address(usdToken18)); + prevReserveBalances[2] = registry.getReserveAmount(address(weth)); + uint256[] memory upkeepIDs = new uint256[](3); + upkeepIDs[0] = linkUpkeepID; + upkeepIDs[1] = usdUpkeepID18; + upkeepIDs[2] = nativeUpkeepID; + + // withdraw-able by finance team should be 0 + require(registry.getAvailableERC20ForPayment(address(usdToken18)) == 0, "ERC20AvailableForPayment should be 0"); + require(registry.getAvailableERC20ForPayment(address(weth)) == 0, "ERC20AvailableForPayment should be 0"); + + // do the thing + _transmit(upkeepIDs, registry, bytes4(0)); + + // withdraw-able by the finance team should be positive + require( + registry.getAvailableERC20ForPayment(address(usdToken18)) > 0, + "ERC20AvailableForPayment should be positive" + ); + require(registry.getAvailableERC20ForPayment(address(weth)) > 0, "ERC20AvailableForPayment should be positive"); + + // assert upkeep balances have decreased + require(prevUpkeepBalances[0] > registry.getBalance(linkUpkeepID), "link upkeep balance should have decreased"); + require(prevUpkeepBalances[1] > registry.getBalance(usdUpkeepID18), "usd upkeep balance should have decreased"); + require(prevUpkeepBalances[2] > registry.getBalance(nativeUpkeepID), "native upkeep balance should have decreased"); + // assert token balances have not changed + assertEq(prevTokenBalances[0], linkToken.balanceOf(address(registry))); + assertEq(prevTokenBalances[1], usdToken18.balanceOf(address(registry))); + assertEq(prevTokenBalances[2], weth.balanceOf(address(registry))); + // assert reserve amounts have adjusted accordingly + require( + prevReserveBalances[0] < registry.getReserveAmount(address(linkToken)), + "usd reserve amount should have increased" + ); // link reserve amount increases in value equal to the decrease of the other reserve amounts + require( + prevReserveBalances[1] > registry.getReserveAmount(address(usdToken18)), + "usd reserve amount should have decreased" + ); + require( + prevReserveBalances[2] > registry.getReserveAmount(address(weth)), + "native reserve amount should have decreased" + ); + } + + function test_handlesInsufficientBalanceWithUSDToken18() external { + // deploy and configure a registry with ON_CHAIN payout + (Registry registry, ) = deployAndConfigureZKSyncRegistryAndRegistrar(AutoBase.PayoutMode.ON_CHAIN); + + // register an upkeep and add funds + uint256 upkeepID = registry.registerUpkeep( + address(TARGET1), + 1000000, + UPKEEP_ADMIN, + 0, + address(usdToken18), + "", + "", + "" + ); + _mintERC20_18Decimals(UPKEEP_ADMIN, 1e20); + vm.startPrank(UPKEEP_ADMIN); + usdToken18.approve(address(registry), 1e20); + registry.addFunds(upkeepID, 1); // smaller than gasCharge + uint256 balance = registry.getBalance(upkeepID); + + // manually create a transmit + vm.recordLogs(); + _transmit(upkeepID, registry, bytes4(0)); + Vm.Log[] memory entries = vm.getRecordedLogs(); + + assertEq(entries.length, 3); + Vm.Log memory l1 = entries[1]; + assertEq( + l1.topics[0], + keccak256("UpkeepCharged(uint256,(uint96,uint96,uint96,uint96,address,uint96,uint96,uint96))") + ); + ( + uint96 gasChargeInBillingToken, + uint96 premiumInBillingToken, + uint96 gasReimbursementInJuels, + uint96 premiumInJuels, + address billingToken, + uint96 linkUSD, + uint96 nativeUSD, + uint96 billingUSD + ) = abi.decode(l1.data, (uint96, uint96, uint96, uint96, address, uint96, uint96, uint96)); + + assertEq(gasChargeInBillingToken, balance); + assertEq(gasReimbursementInJuels, (balance * billingUSD) / linkUSD); + assertEq(premiumInJuels, 0); + assertEq(premiumInBillingToken, 0); + } + + function test_handlesInsufficientBalanceWithUSDToken6() external { + // deploy and configure a registry with ON_CHAIN payout + (Registry registry, ) = deployAndConfigureZKSyncRegistryAndRegistrar(AutoBase.PayoutMode.ON_CHAIN); + + // register an upkeep and add funds + uint256 upkeepID = registry.registerUpkeep( + address(TARGET1), + 1000000, + UPKEEP_ADMIN, + 0, + address(usdToken6), + "", + "", + "" + ); + vm.prank(OWNER); + usdToken6.mint(UPKEEP_ADMIN, 1e20); + + vm.startPrank(UPKEEP_ADMIN); + usdToken6.approve(address(registry), 1e20); + registry.addFunds(upkeepID, 100); // this is greater than gasCharge but less than (gasCharge + premium) + uint256 balance = registry.getBalance(upkeepID); + + // manually create a transmit + vm.recordLogs(); + _transmit(upkeepID, registry, bytes4(0)); + Vm.Log[] memory entries = vm.getRecordedLogs(); + + assertEq(entries.length, 3); + Vm.Log memory l1 = entries[1]; + assertEq( + l1.topics[0], + keccak256("UpkeepCharged(uint256,(uint96,uint96,uint96,uint96,address,uint96,uint96,uint96))") + ); + ( + uint96 gasChargeInBillingToken, + uint96 premiumInBillingToken, + uint96 gasReimbursementInJuels, + uint96 premiumInJuels, + address billingToken, + uint96 linkUSD, + uint96 nativeUSD, + uint96 billingUSD + ) = abi.decode(l1.data, (uint96, uint96, uint96, uint96, address, uint96, uint96, uint96)); + + assertEq(premiumInJuels, (balance * billingUSD * 1e12) / linkUSD - gasReimbursementInJuels); // scale to 18 decimals + assertEq(premiumInBillingToken, (premiumInJuels * linkUSD + (billingUSD * 1e12 - 1)) / (billingUSD * 1e12)); + } +} + +contract MigrateReceive is SetUp { + event UpkeepMigrated(uint256 indexed id, uint256 remainingBalance, address destination); + event UpkeepReceived(uint256 indexed id, uint256 startingBalance, address importedFrom); + + Registry newRegistry; + uint256[] idsToMigrate; + + function setUp() public override { + super.setUp(); + (newRegistry, ) = deployAndConfigureZKSyncRegistryAndRegistrar(AutoBase.PayoutMode.ON_CHAIN); + idsToMigrate.push(linkUpkeepID); + idsToMigrate.push(linkUpkeepID2); + idsToMigrate.push(usdUpkeepID18); + idsToMigrate.push(nativeUpkeepID); + registry.setPeerRegistryMigrationPermission(address(newRegistry), 1); + newRegistry.setPeerRegistryMigrationPermission(address(registry), 2); + } + + function test_RevertsWhen_PermissionsNotSet() external { + // no permissions + registry.setPeerRegistryMigrationPermission(address(newRegistry), 0); + newRegistry.setPeerRegistryMigrationPermission(address(registry), 0); + vm.expectRevert(Registry.MigrationNotPermitted.selector); + vm.prank(UPKEEP_ADMIN); + registry.migrateUpkeeps(idsToMigrate, address(newRegistry)); + + // only outgoing permissions + registry.setPeerRegistryMigrationPermission(address(newRegistry), 1); + newRegistry.setPeerRegistryMigrationPermission(address(registry), 0); + vm.expectRevert(Registry.MigrationNotPermitted.selector); + vm.prank(UPKEEP_ADMIN); + registry.migrateUpkeeps(idsToMigrate, address(newRegistry)); + + // only incoming permissions + registry.setPeerRegistryMigrationPermission(address(newRegistry), 0); + newRegistry.setPeerRegistryMigrationPermission(address(registry), 2); + vm.expectRevert(Registry.MigrationNotPermitted.selector); + vm.prank(UPKEEP_ADMIN); + registry.migrateUpkeeps(idsToMigrate, address(newRegistry)); + + // permissions opposite direction + registry.setPeerRegistryMigrationPermission(address(newRegistry), 2); + newRegistry.setPeerRegistryMigrationPermission(address(registry), 1); + vm.expectRevert(Registry.MigrationNotPermitted.selector); + vm.prank(UPKEEP_ADMIN); + registry.migrateUpkeeps(idsToMigrate, address(newRegistry)); + } + + function test_RevertsWhen_ReceivingRegistryDoesNotSupportToken() external { + _removeBillingTokenConfig(newRegistry, address(weth)); + vm.expectRevert(Registry.InvalidToken.selector); + vm.prank(UPKEEP_ADMIN); + registry.migrateUpkeeps(idsToMigrate, address(newRegistry)); + idsToMigrate.pop(); // remove native upkeep id + vm.prank(UPKEEP_ADMIN); + registry.migrateUpkeeps(idsToMigrate, address(newRegistry)); // should succeed now + } + + function test_RevertsWhen_CalledByNonAdmin() external { + vm.expectRevert(Registry.OnlyCallableByAdmin.selector); + vm.prank(STRANGER); + registry.migrateUpkeeps(idsToMigrate, address(newRegistry)); + } + + function test_Success() external { + vm.startPrank(UPKEEP_ADMIN); + + // add some changes in upkeep data to the mix + registry.pauseUpkeep(usdUpkeepID18); + registry.setUpkeepTriggerConfig(linkUpkeepID, randomBytes(100)); + registry.setUpkeepCheckData(nativeUpkeepID, randomBytes(25)); + + // record previous state + uint256[] memory prevUpkeepBalances = new uint256[](4); + prevUpkeepBalances[0] = registry.getBalance(linkUpkeepID); + prevUpkeepBalances[1] = registry.getBalance(linkUpkeepID2); + prevUpkeepBalances[2] = registry.getBalance(usdUpkeepID18); + prevUpkeepBalances[3] = registry.getBalance(nativeUpkeepID); + uint256[] memory prevReserveBalances = new uint256[](3); + prevReserveBalances[0] = registry.getReserveAmount(address(linkToken)); + prevReserveBalances[1] = registry.getReserveAmount(address(usdToken18)); + prevReserveBalances[2] = registry.getReserveAmount(address(weth)); + uint256[] memory prevTokenBalances = new uint256[](3); + prevTokenBalances[0] = linkToken.balanceOf(address(registry)); + prevTokenBalances[1] = usdToken18.balanceOf(address(registry)); + prevTokenBalances[2] = weth.balanceOf(address(registry)); + bytes[] memory prevUpkeepData = new bytes[](4); + prevUpkeepData[0] = abi.encode(registry.getUpkeep(linkUpkeepID)); + prevUpkeepData[1] = abi.encode(registry.getUpkeep(linkUpkeepID2)); + prevUpkeepData[2] = abi.encode(registry.getUpkeep(usdUpkeepID18)); + prevUpkeepData[3] = abi.encode(registry.getUpkeep(nativeUpkeepID)); + bytes[] memory prevUpkeepTriggerData = new bytes[](4); + prevUpkeepTriggerData[0] = registry.getUpkeepTriggerConfig(linkUpkeepID); + prevUpkeepTriggerData[1] = registry.getUpkeepTriggerConfig(linkUpkeepID2); + prevUpkeepTriggerData[2] = registry.getUpkeepTriggerConfig(usdUpkeepID18); + prevUpkeepTriggerData[3] = registry.getUpkeepTriggerConfig(nativeUpkeepID); + + // event expectations + vm.expectEmit(address(registry)); + emit UpkeepMigrated(linkUpkeepID, prevUpkeepBalances[0], address(newRegistry)); + vm.expectEmit(address(registry)); + emit UpkeepMigrated(linkUpkeepID2, prevUpkeepBalances[1], address(newRegistry)); + vm.expectEmit(address(registry)); + emit UpkeepMigrated(usdUpkeepID18, prevUpkeepBalances[2], address(newRegistry)); + vm.expectEmit(address(registry)); + emit UpkeepMigrated(nativeUpkeepID, prevUpkeepBalances[3], address(newRegistry)); + vm.expectEmit(address(newRegistry)); + emit UpkeepReceived(linkUpkeepID, prevUpkeepBalances[0], address(registry)); + vm.expectEmit(address(newRegistry)); + emit UpkeepReceived(linkUpkeepID2, prevUpkeepBalances[1], address(registry)); + vm.expectEmit(address(newRegistry)); + emit UpkeepReceived(usdUpkeepID18, prevUpkeepBalances[2], address(registry)); + vm.expectEmit(address(newRegistry)); + emit UpkeepReceived(nativeUpkeepID, prevUpkeepBalances[3], address(registry)); + + // do the thing + registry.migrateUpkeeps(idsToMigrate, address(newRegistry)); + + // assert upkeep balances have been migrated + assertEq(registry.getBalance(linkUpkeepID), 0); + assertEq(registry.getBalance(linkUpkeepID2), 0); + assertEq(registry.getBalance(usdUpkeepID18), 0); + assertEq(registry.getBalance(nativeUpkeepID), 0); + assertEq(newRegistry.getBalance(linkUpkeepID), prevUpkeepBalances[0]); + assertEq(newRegistry.getBalance(linkUpkeepID2), prevUpkeepBalances[1]); + assertEq(newRegistry.getBalance(usdUpkeepID18), prevUpkeepBalances[2]); + assertEq(newRegistry.getBalance(nativeUpkeepID), prevUpkeepBalances[3]); + + // assert reserve balances have been adjusted + assertEq( + newRegistry.getReserveAmount(address(linkToken)), + newRegistry.getBalance(linkUpkeepID) + newRegistry.getBalance(linkUpkeepID2) + ); + assertEq(newRegistry.getReserveAmount(address(usdToken18)), newRegistry.getBalance(usdUpkeepID18)); + assertEq(newRegistry.getReserveAmount(address(weth)), newRegistry.getBalance(nativeUpkeepID)); + assertEq( + newRegistry.getReserveAmount(address(linkToken)), + prevReserveBalances[0] - registry.getReserveAmount(address(linkToken)) + ); + assertEq( + newRegistry.getReserveAmount(address(usdToken18)), + prevReserveBalances[1] - registry.getReserveAmount(address(usdToken18)) + ); + assertEq( + newRegistry.getReserveAmount(address(weth)), + prevReserveBalances[2] - registry.getReserveAmount(address(weth)) + ); + + // assert token have been transferred + assertEq( + linkToken.balanceOf(address(newRegistry)), + newRegistry.getBalance(linkUpkeepID) + newRegistry.getBalance(linkUpkeepID2) + ); + assertEq(usdToken18.balanceOf(address(newRegistry)), newRegistry.getBalance(usdUpkeepID18)); + assertEq(weth.balanceOf(address(newRegistry)), newRegistry.getBalance(nativeUpkeepID)); + assertEq(linkToken.balanceOf(address(registry)), prevTokenBalances[0] - linkToken.balanceOf(address(newRegistry))); + assertEq( + usdToken18.balanceOf(address(registry)), + prevTokenBalances[1] - usdToken18.balanceOf(address(newRegistry)) + ); + assertEq(weth.balanceOf(address(registry)), prevTokenBalances[2] - weth.balanceOf(address(newRegistry))); + + // assert upkeep data matches + assertEq(prevUpkeepData[0], abi.encode(newRegistry.getUpkeep(linkUpkeepID))); + assertEq(prevUpkeepData[1], abi.encode(newRegistry.getUpkeep(linkUpkeepID2))); + assertEq(prevUpkeepData[2], abi.encode(newRegistry.getUpkeep(usdUpkeepID18))); + assertEq(prevUpkeepData[3], abi.encode(newRegistry.getUpkeep(nativeUpkeepID))); + assertEq(prevUpkeepTriggerData[0], newRegistry.getUpkeepTriggerConfig(linkUpkeepID)); + assertEq(prevUpkeepTriggerData[1], newRegistry.getUpkeepTriggerConfig(linkUpkeepID2)); + assertEq(prevUpkeepTriggerData[2], newRegistry.getUpkeepTriggerConfig(usdUpkeepID18)); + assertEq(prevUpkeepTriggerData[3], newRegistry.getUpkeepTriggerConfig(nativeUpkeepID)); + + vm.stopPrank(); + } +} + +contract Pause is SetUp { + function test_RevertsWhen_CalledByNonOwner() external { + vm.expectRevert(bytes("Only callable by owner")); + vm.prank(STRANGER); + registry.pause(); + } + + function test_CalledByOwner_success() external { + vm.startPrank(registry.owner()); + registry.pause(); + + (IAutomationV21PlusCommon.StateLegacy memory state, , , , ) = registry.getState(); + assertTrue(state.paused); + } + + function test_revertsWhen_registerUpkeepInPausedRegistry() external { + vm.startPrank(registry.owner()); + registry.pause(); + + vm.expectRevert(Registry.RegistryPaused.selector); + uint256 id = registry.registerUpkeep( + address(TARGET1), + config.maxPerformGas, + UPKEEP_ADMIN, + uint8(Trigger.CONDITION), + address(linkToken), + "", + "", + "" + ); + } + + function test_revertsWhen_transmitInPausedRegistry() external { + vm.startPrank(registry.owner()); + registry.pause(); + + _transmit(usdUpkeepID18, registry, Registry.RegistryPaused.selector); + } +} + +contract Unpause is SetUp { + function test_RevertsWhen_CalledByNonOwner() external { + vm.startPrank(registry.owner()); + registry.pause(); + + vm.expectRevert(bytes("Only callable by owner")); + vm.startPrank(STRANGER); + registry.unpause(); + } + + function test_CalledByOwner_success() external { + vm.startPrank(registry.owner()); + registry.pause(); + (IAutomationV21PlusCommon.StateLegacy memory state1, , , , ) = registry.getState(); + assertTrue(state1.paused); + + registry.unpause(); + (IAutomationV21PlusCommon.StateLegacy memory state2, , , , ) = registry.getState(); + assertFalse(state2.paused); + } +} + +contract CancelUpkeep is SetUp { + event UpkeepCanceled(uint256 indexed id, uint64 indexed atBlockHeight); + + function test_RevertsWhen_IdIsInvalid_CalledByAdmin() external { + vm.startPrank(UPKEEP_ADMIN); + vm.expectRevert(Registry.CannotCancel.selector); + registry.cancelUpkeep(1111111); + } + + function test_RevertsWhen_IdIsInvalid_CalledByOwner() external { + vm.startPrank(registry.owner()); + vm.expectRevert(Registry.CannotCancel.selector); + registry.cancelUpkeep(1111111); + } + + function test_RevertsWhen_NotCalledByOwnerOrAdmin() external { + vm.startPrank(STRANGER); + vm.expectRevert(Registry.OnlyCallableByOwnerOrAdmin.selector); + registry.cancelUpkeep(linkUpkeepID); + } + + function test_RevertsWhen_UpkeepAlreadyCanceledByAdmin_CalledByOwner() external { + uint256 bn = block.number; + vm.startPrank(UPKEEP_ADMIN); + registry.cancelUpkeep(linkUpkeepID); + + vm.startPrank(registry.owner()); + vm.expectRevert(Registry.UpkeepCancelled.selector); + registry.cancelUpkeep(linkUpkeepID); + } + + function test_RevertsWhen_UpkeepAlreadyCanceledByOwner_CalledByAdmin() external { + uint256 bn = block.number; + vm.startPrank(registry.owner()); + registry.cancelUpkeep(linkUpkeepID); + + vm.startPrank(UPKEEP_ADMIN); + vm.expectRevert(Registry.UpkeepCancelled.selector); + registry.cancelUpkeep(linkUpkeepID); + } + + function test_RevertsWhen_UpkeepAlreadyCanceledByAdmin_CalledByAdmin() external { + uint256 bn = block.number; + vm.startPrank(UPKEEP_ADMIN); + registry.cancelUpkeep(linkUpkeepID); + + vm.expectRevert(Registry.UpkeepCancelled.selector); + registry.cancelUpkeep(linkUpkeepID); + } + + function test_RevertsWhen_UpkeepAlreadyCanceledByOwner_CalledByOwner() external { + uint256 bn = block.number; + vm.startPrank(registry.owner()); + registry.cancelUpkeep(linkUpkeepID); + + vm.expectRevert(Registry.UpkeepCancelled.selector); + registry.cancelUpkeep(linkUpkeepID); + } + + function test_CancelUpkeep_SetMaxValidBlockNumber_CalledByAdmin() external { + uint256 bn = block.number; + vm.startPrank(UPKEEP_ADMIN); + registry.cancelUpkeep(linkUpkeepID); + + uint256 maxValidBlocknumber = uint256(registry.getUpkeep(linkUpkeepID).maxValidBlocknumber); + + // 50 is the cancellation delay + assertEq(bn + 50, maxValidBlocknumber); + } + + function test_CancelUpkeep_SetMaxValidBlockNumber_CalledByOwner() external { + uint256 bn = block.number; + vm.startPrank(registry.owner()); + registry.cancelUpkeep(linkUpkeepID); + + uint256 maxValidBlocknumber = uint256(registry.getUpkeep(linkUpkeepID).maxValidBlocknumber); + + // cancellation by registry owner is immediate and no cancellation delay is applied + assertEq(bn, maxValidBlocknumber); + } + + function test_CancelUpkeep_EmitEvent_CalledByAdmin() external { + uint256 bn = block.number; + vm.startPrank(UPKEEP_ADMIN); + + vm.expectEmit(); + emit UpkeepCanceled(linkUpkeepID, uint64(bn + 50)); + registry.cancelUpkeep(linkUpkeepID); + } + + function test_CancelUpkeep_EmitEvent_CalledByOwner() external { + uint256 bn = block.number; + vm.startPrank(registry.owner()); + + vm.expectEmit(); + emit UpkeepCanceled(linkUpkeepID, uint64(bn)); + registry.cancelUpkeep(linkUpkeepID); + } +} + +contract SetPeerRegistryMigrationPermission is SetUp { + function test_SetPeerRegistryMigrationPermission_CalledByOwner() external { + address peer = randomAddress(); + vm.startPrank(registry.owner()); + + uint8 permission = registry.getPeerRegistryMigrationPermission(peer); + assertEq(0, permission); + + registry.setPeerRegistryMigrationPermission(peer, 1); + permission = registry.getPeerRegistryMigrationPermission(peer); + assertEq(1, permission); + + registry.setPeerRegistryMigrationPermission(peer, 2); + permission = registry.getPeerRegistryMigrationPermission(peer); + assertEq(2, permission); + + registry.setPeerRegistryMigrationPermission(peer, 0); + permission = registry.getPeerRegistryMigrationPermission(peer); + assertEq(0, permission); + } + + function test_RevertsWhen_InvalidPermission_CalledByOwner() external { + address peer = randomAddress(); + vm.startPrank(registry.owner()); + + vm.expectRevert(); + registry.setPeerRegistryMigrationPermission(peer, 100); + } + + function test_RevertsWhen_CalledByNonOwner() external { + address peer = randomAddress(); + vm.startPrank(STRANGER); + + vm.expectRevert(bytes("Only callable by owner")); + registry.setPeerRegistryMigrationPermission(peer, 1); + } +} + +contract SetUpkeepPrivilegeConfig is SetUp { + function test_RevertsWhen_CalledByNonManager() external { + vm.startPrank(STRANGER); + + vm.expectRevert(Registry.OnlyCallableByUpkeepPrivilegeManager.selector); + registry.setUpkeepPrivilegeConfig(linkUpkeepID, hex"1233"); + } + + function test_UpkeepHasEmptyConfig() external { + bytes memory cfg = registry.getUpkeepPrivilegeConfig(linkUpkeepID); + assertEq(cfg, bytes("")); + } + + function test_SetUpkeepPrivilegeConfig_CalledByManager() external { + vm.startPrank(PRIVILEGE_MANAGER); + + registry.setUpkeepPrivilegeConfig(linkUpkeepID, hex"1233"); + + bytes memory cfg = registry.getUpkeepPrivilegeConfig(linkUpkeepID); + assertEq(cfg, hex"1233"); + } +} + +contract SetAdminPrivilegeConfig is SetUp { + function test_RevertsWhen_CalledByNonManager() external { + vm.startPrank(STRANGER); + + vm.expectRevert(Registry.OnlyCallableByUpkeepPrivilegeManager.selector); + registry.setAdminPrivilegeConfig(randomAddress(), hex"1233"); + } + + function test_UpkeepHasEmptyConfig() external { + bytes memory cfg = registry.getAdminPrivilegeConfig(randomAddress()); + assertEq(cfg, bytes("")); + } + + function test_SetAdminPrivilegeConfig_CalledByManager() external { + vm.startPrank(PRIVILEGE_MANAGER); + address admin = randomAddress(); + + registry.setAdminPrivilegeConfig(admin, hex"1233"); + + bytes memory cfg = registry.getAdminPrivilegeConfig(admin); + assertEq(cfg, hex"1233"); + } +} + +contract TransferUpkeepAdmin is SetUp { + event UpkeepAdminTransferRequested(uint256 indexed id, address indexed from, address indexed to); + + function test_RevertsWhen_NotCalledByAdmin() external { + vm.startPrank(STRANGER); + + vm.expectRevert(Registry.OnlyCallableByAdmin.selector); + registry.transferUpkeepAdmin(linkUpkeepID, randomAddress()); + } + + function test_RevertsWhen_TransferToSelf() external { + vm.startPrank(UPKEEP_ADMIN); + + vm.expectRevert(Registry.ValueNotChanged.selector); + registry.transferUpkeepAdmin(linkUpkeepID, UPKEEP_ADMIN); + } + + function test_RevertsWhen_UpkeepCanceled() external { + vm.startPrank(UPKEEP_ADMIN); + + registry.cancelUpkeep(linkUpkeepID); + + vm.expectRevert(Registry.UpkeepCancelled.selector); + registry.transferUpkeepAdmin(linkUpkeepID, randomAddress()); + } + + function test_DoesNotChangeUpkeepAdmin() external { + vm.startPrank(UPKEEP_ADMIN); + registry.transferUpkeepAdmin(linkUpkeepID, randomAddress()); + + assertEq(registry.getUpkeep(linkUpkeepID).admin, UPKEEP_ADMIN); + } + + function test_EmitEvent_CalledByAdmin() external { + vm.startPrank(UPKEEP_ADMIN); + address newAdmin = randomAddress(); + + vm.expectEmit(); + emit UpkeepAdminTransferRequested(linkUpkeepID, UPKEEP_ADMIN, newAdmin); + registry.transferUpkeepAdmin(linkUpkeepID, newAdmin); + + // transferring to the same propose admin won't yield another event + vm.recordLogs(); + registry.transferUpkeepAdmin(linkUpkeepID, newAdmin); + Vm.Log[] memory entries = vm.getRecordedLogs(); + assertEq(0, entries.length); + } + + function test_CancelTransfer_ByTransferToEmptyAddress() external { + vm.startPrank(UPKEEP_ADMIN); + address newAdmin = randomAddress(); + + vm.expectEmit(); + emit UpkeepAdminTransferRequested(linkUpkeepID, UPKEEP_ADMIN, newAdmin); + registry.transferUpkeepAdmin(linkUpkeepID, newAdmin); + + vm.expectEmit(); + emit UpkeepAdminTransferRequested(linkUpkeepID, UPKEEP_ADMIN, address(0)); + registry.transferUpkeepAdmin(linkUpkeepID, address(0)); + } +} + +contract AcceptUpkeepAdmin is SetUp { + event UpkeepAdminTransferred(uint256 indexed id, address indexed from, address indexed to); + + function test_RevertsWhen_NotCalledByProposedAdmin() external { + vm.startPrank(UPKEEP_ADMIN); + address newAdmin = randomAddress(); + registry.transferUpkeepAdmin(linkUpkeepID, newAdmin); + + vm.startPrank(STRANGER); + vm.expectRevert(Registry.OnlyCallableByProposedAdmin.selector); + registry.acceptUpkeepAdmin(linkUpkeepID); + } + + function test_RevertsWhen_UpkeepCanceled() external { + vm.startPrank(UPKEEP_ADMIN); + address newAdmin = randomAddress(); + registry.transferUpkeepAdmin(linkUpkeepID, newAdmin); + + registry.cancelUpkeep(linkUpkeepID); + + vm.startPrank(newAdmin); + vm.expectRevert(Registry.UpkeepCancelled.selector); + registry.acceptUpkeepAdmin(linkUpkeepID); + } + + function test_UpkeepAdminChanged() external { + vm.startPrank(UPKEEP_ADMIN); + address newAdmin = randomAddress(); + registry.transferUpkeepAdmin(linkUpkeepID, newAdmin); + + vm.startPrank(newAdmin); + vm.expectEmit(); + emit UpkeepAdminTransferred(linkUpkeepID, UPKEEP_ADMIN, newAdmin); + registry.acceptUpkeepAdmin(linkUpkeepID); + + assertEq(newAdmin, registry.getUpkeep(linkUpkeepID).admin); + } +} + +contract PauseUpkeep is SetUp { + event UpkeepPaused(uint256 indexed id); + + function test_RevertsWhen_NotCalledByUpkeepAdmin() external { + vm.startPrank(STRANGER); + + vm.expectRevert(Registry.OnlyCallableByAdmin.selector); + registry.pauseUpkeep(linkUpkeepID); + } + + function test_RevertsWhen_InvalidUpkeepId() external { + vm.startPrank(UPKEEP_ADMIN); + + vm.expectRevert(Registry.OnlyCallableByAdmin.selector); + registry.pauseUpkeep(linkUpkeepID + 1); + } + + function test_RevertsWhen_UpkeepAlreadyCanceled() external { + vm.startPrank(UPKEEP_ADMIN); + registry.cancelUpkeep(linkUpkeepID); + + vm.expectRevert(Registry.UpkeepCancelled.selector); + registry.pauseUpkeep(linkUpkeepID); + } + + function test_RevertsWhen_UpkeepAlreadyPaused() external { + vm.startPrank(UPKEEP_ADMIN); + registry.pauseUpkeep(linkUpkeepID); + + vm.expectRevert(Registry.OnlyUnpausedUpkeep.selector); + registry.pauseUpkeep(linkUpkeepID); + } + + function test_EmitEvent_CalledByAdmin() external { + vm.startPrank(UPKEEP_ADMIN); + + vm.expectEmit(); + emit UpkeepPaused(linkUpkeepID); + registry.pauseUpkeep(linkUpkeepID); + } +} + +contract UnpauseUpkeep is SetUp { + event UpkeepUnpaused(uint256 indexed id); + + function test_RevertsWhen_InvalidUpkeepId() external { + vm.startPrank(UPKEEP_ADMIN); + + vm.expectRevert(Registry.OnlyCallableByAdmin.selector); + registry.unpauseUpkeep(linkUpkeepID + 1); + } + + function test_RevertsWhen_UpkeepIsNotPaused() external { + vm.startPrank(UPKEEP_ADMIN); + + vm.expectRevert(Registry.OnlyPausedUpkeep.selector); + registry.unpauseUpkeep(linkUpkeepID); + } + + function test_RevertsWhen_UpkeepAlreadyCanceled() external { + vm.startPrank(UPKEEP_ADMIN); + registry.pauseUpkeep(linkUpkeepID); + + registry.cancelUpkeep(linkUpkeepID); + + vm.expectRevert(Registry.UpkeepCancelled.selector); + registry.unpauseUpkeep(linkUpkeepID); + } + + function test_RevertsWhen_NotCalledByUpkeepAdmin() external { + vm.startPrank(UPKEEP_ADMIN); + registry.pauseUpkeep(linkUpkeepID); + + vm.startPrank(STRANGER); + vm.expectRevert(Registry.OnlyCallableByAdmin.selector); + registry.unpauseUpkeep(linkUpkeepID); + } + + function test_UnpauseUpkeep_CalledByUpkeepAdmin() external { + vm.startPrank(UPKEEP_ADMIN); + registry.pauseUpkeep(linkUpkeepID); + + uint256[] memory ids1 = registry.getActiveUpkeepIDs(0, 0); + + vm.expectEmit(); + emit UpkeepUnpaused(linkUpkeepID); + registry.unpauseUpkeep(linkUpkeepID); + + uint256[] memory ids2 = registry.getActiveUpkeepIDs(0, 0); + assertEq(ids1.length + 1, ids2.length); + } +} + +contract SetUpkeepCheckData is SetUp { + event UpkeepCheckDataSet(uint256 indexed id, bytes newCheckData); + + function test_RevertsWhen_InvalidUpkeepId() external { + vm.startPrank(UPKEEP_ADMIN); + + vm.expectRevert(Registry.OnlyCallableByAdmin.selector); + registry.setUpkeepCheckData(linkUpkeepID + 1, hex"1234"); + } + + function test_RevertsWhen_UpkeepAlreadyCanceled() external { + vm.startPrank(UPKEEP_ADMIN); + registry.cancelUpkeep(linkUpkeepID); + + vm.expectRevert(Registry.UpkeepCancelled.selector); + registry.setUpkeepCheckData(linkUpkeepID, hex"1234"); + } + + function test_RevertsWhen_NewCheckDataTooLarge() external { + vm.startPrank(UPKEEP_ADMIN); + + vm.expectRevert(Registry.CheckDataExceedsLimit.selector); + registry.setUpkeepCheckData(linkUpkeepID, new bytes(10_000)); + } + + function test_RevertsWhen_NotCalledByAdmin() external { + vm.startPrank(STRANGER); + + vm.expectRevert(Registry.OnlyCallableByAdmin.selector); + registry.setUpkeepCheckData(linkUpkeepID, hex"1234"); + } + + function test_UpdateOffchainConfig_CalledByAdmin() external { + vm.startPrank(UPKEEP_ADMIN); + + vm.expectEmit(); + emit UpkeepCheckDataSet(linkUpkeepID, hex"1234"); + registry.setUpkeepCheckData(linkUpkeepID, hex"1234"); + + assertEq(registry.getUpkeep(linkUpkeepID).checkData, hex"1234"); + } + + function test_UpdateOffchainConfigOnPausedUpkeep_CalledByAdmin() external { + vm.startPrank(UPKEEP_ADMIN); + + registry.pauseUpkeep(linkUpkeepID); + + vm.expectEmit(); + emit UpkeepCheckDataSet(linkUpkeepID, hex"1234"); + registry.setUpkeepCheckData(linkUpkeepID, hex"1234"); + + assertTrue(registry.getUpkeep(linkUpkeepID).paused); + assertEq(registry.getUpkeep(linkUpkeepID).checkData, hex"1234"); + } +} + +contract SetUpkeepGasLimit is SetUp { + event UpkeepGasLimitSet(uint256 indexed id, uint96 gasLimit); + + function test_RevertsWhen_InvalidUpkeepId() external { + vm.startPrank(UPKEEP_ADMIN); + + vm.expectRevert(Registry.OnlyCallableByAdmin.selector); + registry.setUpkeepGasLimit(linkUpkeepID + 1, 1230000); + } + + function test_RevertsWhen_UpkeepAlreadyCanceled() external { + vm.startPrank(UPKEEP_ADMIN); + registry.cancelUpkeep(linkUpkeepID); + + vm.expectRevert(Registry.UpkeepCancelled.selector); + registry.setUpkeepGasLimit(linkUpkeepID, 1230000); + } + + function test_RevertsWhen_NewGasLimitOutOfRange() external { + vm.startPrank(UPKEEP_ADMIN); + + vm.expectRevert(Registry.GasLimitOutsideRange.selector); + registry.setUpkeepGasLimit(linkUpkeepID, 300); + + vm.expectRevert(Registry.GasLimitOutsideRange.selector); + registry.setUpkeepGasLimit(linkUpkeepID, 3000000000); + } + + function test_RevertsWhen_NotCalledByAdmin() external { + vm.startPrank(STRANGER); + + vm.expectRevert(Registry.OnlyCallableByAdmin.selector); + registry.setUpkeepGasLimit(linkUpkeepID, 1230000); + } + + function test_UpdateGasLimit_CalledByAdmin() external { + vm.startPrank(UPKEEP_ADMIN); + + vm.expectEmit(); + emit UpkeepGasLimitSet(linkUpkeepID, 1230000); + registry.setUpkeepGasLimit(linkUpkeepID, 1230000); + + assertEq(registry.getUpkeep(linkUpkeepID).performGas, 1230000); + } +} + +contract SetUpkeepOffchainConfig is SetUp { + event UpkeepOffchainConfigSet(uint256 indexed id, bytes offchainConfig); + + function test_RevertsWhen_InvalidUpkeepId() external { + vm.startPrank(UPKEEP_ADMIN); + + vm.expectRevert(Registry.OnlyCallableByAdmin.selector); + registry.setUpkeepOffchainConfig(linkUpkeepID + 1, hex"1233"); + } + + function test_RevertsWhen_UpkeepAlreadyCanceled() external { + vm.startPrank(UPKEEP_ADMIN); + registry.cancelUpkeep(linkUpkeepID); + + vm.expectRevert(Registry.UpkeepCancelled.selector); + registry.setUpkeepOffchainConfig(linkUpkeepID, hex"1234"); + } + + function test_RevertsWhen_NotCalledByAdmin() external { + vm.startPrank(STRANGER); + + vm.expectRevert(Registry.OnlyCallableByAdmin.selector); + registry.setUpkeepOffchainConfig(linkUpkeepID, hex"1234"); + } + + function test_UpdateOffchainConfig_CalledByAdmin() external { + vm.startPrank(UPKEEP_ADMIN); + + vm.expectEmit(); + emit UpkeepOffchainConfigSet(linkUpkeepID, hex"1234"); + registry.setUpkeepOffchainConfig(linkUpkeepID, hex"1234"); + + assertEq(registry.getUpkeep(linkUpkeepID).offchainConfig, hex"1234"); + } +} + +contract SetUpkeepTriggerConfig is SetUp { + event UpkeepTriggerConfigSet(uint256 indexed id, bytes triggerConfig); + + function test_RevertsWhen_InvalidUpkeepId() external { + vm.startPrank(UPKEEP_ADMIN); + + vm.expectRevert(Registry.OnlyCallableByAdmin.selector); + registry.setUpkeepTriggerConfig(linkUpkeepID + 1, hex"1233"); + } + + function test_RevertsWhen_UpkeepAlreadyCanceled() external { + vm.startPrank(UPKEEP_ADMIN); + registry.cancelUpkeep(linkUpkeepID); + + vm.expectRevert(Registry.UpkeepCancelled.selector); + registry.setUpkeepTriggerConfig(linkUpkeepID, hex"1234"); + } + + function test_RevertsWhen_NotCalledByAdmin() external { + vm.startPrank(STRANGER); + + vm.expectRevert(Registry.OnlyCallableByAdmin.selector); + registry.setUpkeepTriggerConfig(linkUpkeepID, hex"1234"); + } + + function test_UpdateTriggerConfig_CalledByAdmin() external { + vm.startPrank(UPKEEP_ADMIN); + + vm.expectEmit(); + emit UpkeepTriggerConfigSet(linkUpkeepID, hex"1234"); + registry.setUpkeepTriggerConfig(linkUpkeepID, hex"1234"); + + assertEq(registry.getUpkeepTriggerConfig(linkUpkeepID), hex"1234"); + } +} + +contract TransferPayeeship is SetUp { + event PayeeshipTransferRequested(address indexed transmitter, address indexed from, address indexed to); + + function test_RevertsWhen_NotCalledByPayee() external { + vm.startPrank(STRANGER); + + vm.expectRevert(Registry.OnlyCallableByPayee.selector); + registry.transferPayeeship(TRANSMITTERS[0], randomAddress()); + } + + function test_RevertsWhen_TransferToSelf() external { + registry.setPayees(PAYEES); + vm.startPrank(PAYEES[0]); + + vm.expectRevert(Registry.ValueNotChanged.selector); + registry.transferPayeeship(TRANSMITTERS[0], PAYEES[0]); + } + + function test_Transfer_DoesNotChangePayee() external { + registry.setPayees(PAYEES); + + vm.startPrank(PAYEES[0]); + + registry.transferPayeeship(TRANSMITTERS[0], randomAddress()); + + (, , , , address payee) = registry.getTransmitterInfo(TRANSMITTERS[0]); + assertEq(PAYEES[0], payee); + } + + function test_EmitEvent_CalledByPayee() external { + registry.setPayees(PAYEES); + + vm.startPrank(PAYEES[0]); + address newPayee = randomAddress(); + + vm.expectEmit(); + emit PayeeshipTransferRequested(TRANSMITTERS[0], PAYEES[0], newPayee); + registry.transferPayeeship(TRANSMITTERS[0], newPayee); + + // transferring to the same propose payee won't yield another event + vm.recordLogs(); + registry.transferPayeeship(TRANSMITTERS[0], newPayee); + Vm.Log[] memory entries = vm.getRecordedLogs(); + assertEq(0, entries.length); + } +} + +contract AcceptPayeeship is SetUp { + event PayeeshipTransferred(address indexed transmitter, address indexed from, address indexed to); + + function test_RevertsWhen_NotCalledByProposedPayee() external { + registry.setPayees(PAYEES); + + vm.startPrank(PAYEES[0]); + address newPayee = randomAddress(); + registry.transferPayeeship(TRANSMITTERS[0], newPayee); + + vm.startPrank(STRANGER); + vm.expectRevert(Registry.OnlyCallableByProposedPayee.selector); + registry.acceptPayeeship(TRANSMITTERS[0]); + } + + function test_PayeeChanged() external { + registry.setPayees(PAYEES); + + vm.startPrank(PAYEES[0]); + address newPayee = randomAddress(); + registry.transferPayeeship(TRANSMITTERS[0], newPayee); + + vm.startPrank(newPayee); + vm.expectEmit(); + emit PayeeshipTransferred(TRANSMITTERS[0], PAYEES[0], newPayee); + registry.acceptPayeeship(TRANSMITTERS[0]); + + (, , , , address payee) = registry.getTransmitterInfo(TRANSMITTERS[0]); + assertEq(newPayee, payee); + } +} + +contract SetPayees is SetUp { + event PayeesUpdated(address[] transmitters, address[] payees); + + function test_RevertsWhen_NotCalledByOwner() external { + vm.startPrank(STRANGER); + + vm.expectRevert(bytes("Only callable by owner")); + registry.setPayees(NEW_PAYEES); + } + + function test_RevertsWhen_PayeesLengthError() external { + vm.startPrank(registry.owner()); + + address[] memory payees = new address[](5); + vm.expectRevert(Registry.ParameterLengthError.selector); + registry.setPayees(payees); + } + + function test_RevertsWhen_InvalidPayee() external { + vm.startPrank(registry.owner()); + + NEW_PAYEES[0] = address(0); + vm.expectRevert(Registry.InvalidPayee.selector); + registry.setPayees(NEW_PAYEES); + } + + function test_SetPayees_WhenExistingPayeesAreEmpty() external { + (registry, ) = deployAndConfigureZKSyncRegistryAndRegistrar(AutoBase.PayoutMode.ON_CHAIN); + + for (uint256 i = 0; i < TRANSMITTERS.length; i++) { + (, , , , address payee) = registry.getTransmitterInfo(TRANSMITTERS[i]); + assertEq(address(0), payee); + } + + vm.startPrank(registry.owner()); + + vm.expectEmit(); + emit PayeesUpdated(TRANSMITTERS, PAYEES); + registry.setPayees(PAYEES); + for (uint256 i = 0; i < TRANSMITTERS.length; i++) { + (bool active, , , , address payee) = registry.getTransmitterInfo(TRANSMITTERS[i]); + assertTrue(active); + assertEq(PAYEES[i], payee); + } + } + + function test_DotNotSetPayeesToIgnoredAddress() external { + address IGNORE_ADDRESS = 0xFFfFfFffFFfffFFfFFfFFFFFffFFFffffFfFFFfF; + (registry, ) = deployAndConfigureZKSyncRegistryAndRegistrar(AutoBase.PayoutMode.ON_CHAIN); + PAYEES[0] = IGNORE_ADDRESS; + + registry.setPayees(PAYEES); + (bool active, , , , address payee) = registry.getTransmitterInfo(TRANSMITTERS[0]); + assertTrue(active); + assertEq(address(0), payee); + + (active, , , , payee) = registry.getTransmitterInfo(TRANSMITTERS[1]); + assertTrue(active); + assertEq(PAYEES[1], payee); + } +} + +contract GetActiveUpkeepIDs is SetUp { + function test_RevertsWhen_IndexOutOfRange() external { + vm.expectRevert(Registry.IndexOutOfRange.selector); + registry.getActiveUpkeepIDs(5, 0); + + vm.expectRevert(Registry.IndexOutOfRange.selector); + registry.getActiveUpkeepIDs(6, 0); + } + + function test_ReturnsAllUpkeeps_WhenMaxCountIsZero() external { + uint256[] memory uids = registry.getActiveUpkeepIDs(0, 0); + assertEq(5, uids.length); + + uids = registry.getActiveUpkeepIDs(2, 0); + assertEq(3, uids.length); + } + + function test_ReturnsAllRemainingUpkeeps_WhenMaxCountIsTooLarge() external { + uint256[] memory uids = registry.getActiveUpkeepIDs(2, 20); + assertEq(3, uids.length); + } + + function test_ReturnsUpkeeps_BoundByMaxCount() external { + uint256[] memory uids = registry.getActiveUpkeepIDs(1, 2); + assertEq(2, uids.length); + assertEq(uids[0], linkUpkeepID2); + assertEq(uids[1], usdUpkeepID18); + } +} diff --git a/contracts/src/v0.8/automation/testhelpers/UpkeepCounterNew.sol b/contracts/src/v0.8/automation/testhelpers/UpkeepCounterNew.sol new file mode 100644 index 00000000000..76b38776893 --- /dev/null +++ b/contracts/src/v0.8/automation/testhelpers/UpkeepCounterNew.sol @@ -0,0 +1,126 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.16; + +contract UpkeepCounterNew { + event PerformingUpkeep( + address indexed from, + uint256 initialTimestamp, + uint256 lastTimestamp, + uint256 previousBlock, + uint256 counter + ); + error InvalidCaller(address caller, address forwarder); + + uint256 public testRange; + uint256 public interval; + uint256 public lastTimestamp; + uint256 public previousPerformBlock; + uint256 public initialTimestamp; + uint256 public counter; + bool public useMoreCheckGas; + bool public useMorePerformGas; + bool public useMorePerformData; + uint256 public checkGasToBurn; + uint256 public performGasToBurn; + bytes public data; + bytes public dataCopy; + bool public trickSimulation = false; + address public forwarder; + + constructor() { + testRange = 1000000; + interval = 40; + previousPerformBlock = 0; + lastTimestamp = block.timestamp; + initialTimestamp = 0; + counter = 0; + useMoreCheckGas = false; + useMorePerformData = false; + useMorePerformGas = false; + checkGasToBurn = 9700000; + performGasToBurn = 7700000; + } + + function setPerformGasToBurn(uint256 _performGasToBurn) external { + performGasToBurn = _performGasToBurn; + } + + function setCheckGasToBurn(uint256 _checkGasToBurn) external { + checkGasToBurn = _checkGasToBurn; + } + + function setUseMoreCheckGas(bool _useMoreCheckGas) external { + useMoreCheckGas = _useMoreCheckGas; + } + + function setUseMorePerformGas(bool _useMorePerformGas) external { + useMorePerformGas = _useMorePerformGas; + } + + function setUseMorePerformData(bool _useMorePerformData) external { + useMorePerformData = _useMorePerformData; + } + + function setData(bytes calldata _data) external { + data = _data; + } + + function checkUpkeep(bytes calldata) external view returns (bool, bytes memory) { + if (useMoreCheckGas) { + uint256 startGas = gasleft(); + while (startGas - gasleft() < checkGasToBurn) {} // burn gas + } + + if (useMorePerformData) { + return (eligible(), data); + } + return (eligible(), ""); + } + + function setTrickSimulation(bool _trickSimulation) external { + trickSimulation = _trickSimulation; + } + + function performUpkeep(bytes calldata performData) external { + if (trickSimulation && tx.origin == address(0)) { + return; + } + + if (msg.sender != forwarder) { + revert InvalidCaller(msg.sender, forwarder); + } + + if (useMorePerformGas) { + uint256 startGas = gasleft(); + while (startGas - gasleft() < performGasToBurn) {} // burn gas + } + + if (initialTimestamp == 0) { + initialTimestamp = block.timestamp; + } + lastTimestamp = block.timestamp; + counter = counter + 1; + dataCopy = performData; + emit PerformingUpkeep(tx.origin, initialTimestamp, lastTimestamp, previousPerformBlock, counter); + previousPerformBlock = lastTimestamp; + } + + function eligible() public view returns (bool) { + if (initialTimestamp == 0) { + return true; + } + + return (block.timestamp - initialTimestamp) < testRange && (block.timestamp - lastTimestamp) >= interval; + } + + function setSpread(uint256 _testRange, uint256 _interval) external { + testRange = _testRange; + interval = _interval; + initialTimestamp = 0; + counter = 0; + } + + function setForwarder(address _forwarder) external { + forwarder = _forwarder; + } +} diff --git a/contracts/src/v0.8/automation/upkeeps/CronUpkeep.sol b/contracts/src/v0.8/automation/upkeeps/CronUpkeep.sol index 614b84635ab..b9eda1f4001 100644 --- a/contracts/src/v0.8/automation/upkeeps/CronUpkeep.sol +++ b/contracts/src/v0.8/automation/upkeeps/CronUpkeep.sol @@ -18,12 +18,12 @@ pragma solidity 0.8.6; -import "@openzeppelin/contracts/security/Pausable.sol"; -import "@openzeppelin/contracts/proxy/Proxy.sol"; -import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; -import "../../shared/access/ConfirmedOwner.sol"; -import "../KeeperBase.sol"; -import "../interfaces/KeeperCompatibleInterface.sol"; +import {Pausable} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/security/Pausable.sol"; +import {Proxy} from "../../vendor/openzeppelin-solidity/v4.7.3/contracts/proxy/Proxy.sol"; +import {EnumerableSet} from "../../vendor/openzeppelin-solidity/v4.7.3/contracts/utils/structs/EnumerableSet.sol"; +import {ConfirmedOwner} from "../../shared/access/ConfirmedOwner.sol"; +import {KeeperBase as KeeperBase} from "../KeeperBase.sol"; +import {KeeperCompatibleInterface as KeeperCompatibleInterface} from "../interfaces/KeeperCompatibleInterface.sol"; import {Cron as CronInternal, Spec} from "../libraries/internal/Cron.sol"; import {Cron as CronExternal} from "../libraries/external/Cron.sol"; diff --git a/contracts/src/v0.8/automation/upkeeps/CronUpkeepDelegate.sol b/contracts/src/v0.8/automation/upkeeps/CronUpkeepDelegate.sol index ec2c2a0fd91..ed8d031c86f 100644 --- a/contracts/src/v0.8/automation/upkeeps/CronUpkeepDelegate.sol +++ b/contracts/src/v0.8/automation/upkeeps/CronUpkeepDelegate.sol @@ -2,7 +2,7 @@ pragma solidity 0.8.6; -import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; +import {EnumerableSet} from "../../vendor/openzeppelin-solidity/v4.7.3/contracts/utils/structs/EnumerableSet.sol"; import {Cron, Spec} from "../libraries/internal/Cron.sol"; /** diff --git a/contracts/src/v0.8/automation/upkeeps/CronUpkeepFactory.sol b/contracts/src/v0.8/automation/upkeeps/CronUpkeepFactory.sol index cd9ae5d7a92..2b6e97e4d03 100644 --- a/contracts/src/v0.8/automation/upkeeps/CronUpkeepFactory.sol +++ b/contracts/src/v0.8/automation/upkeeps/CronUpkeepFactory.sol @@ -2,9 +2,9 @@ pragma solidity 0.8.6; -import "./CronUpkeep.sol"; -import "./CronUpkeepDelegate.sol"; -import "../../shared/access/ConfirmedOwner.sol"; +import {CronUpkeep} from "./CronUpkeep.sol"; +import {CronUpkeepDelegate} from "./CronUpkeepDelegate.sol"; +import {ConfirmedOwner} from "../../shared/access/ConfirmedOwner.sol"; import {Spec, Cron as CronExternal} from "../libraries/external/Cron.sol"; /** diff --git a/contracts/src/v0.8/automation/upkeeps/LinkAvailableBalanceMonitor.sol b/contracts/src/v0.8/automation/upkeeps/LinkAvailableBalanceMonitor.sol index 5d8a8d58c8d..824bce711bf 100644 --- a/contracts/src/v0.8/automation/upkeeps/LinkAvailableBalanceMonitor.sol +++ b/contracts/src/v0.8/automation/upkeeps/LinkAvailableBalanceMonitor.sol @@ -61,6 +61,7 @@ contract LinkAvailableBalanceMonitor is AccessControl, AutomationCompatibleInter error InvalidWatchList(); error InvalidChainSelector(); error DuplicateAddress(address duplicate); + error ReentrantCall(); struct MonitoredAddress { uint96 minBalance; @@ -94,6 +95,8 @@ contract LinkAvailableBalanceMonitor is AccessControl, AutomationCompatibleInter /// whenever a new one is deployed with the same dstChainSelector. EnumerableMap.UintToAddressMap private s_onRampAddresses; + bool private reentrancyGuard; + /// @param admin is the administrator address of this contract /// @param linkToken the LINK token address /// @param minWaitPeriodSeconds represents the amount of time that has to wait a contract to be funded @@ -116,6 +119,7 @@ contract LinkAvailableBalanceMonitor is AccessControl, AutomationCompatibleInter setMaxPerform(maxPerform); setMaxCheck(maxCheck); setUpkeepInterval(upkeepInterval); + reentrancyGuard = false; } /// @notice Sets the list of subscriptions to watch and their funding parameters @@ -259,7 +263,7 @@ contract LinkAvailableBalanceMonitor is AccessControl, AutomationCompatibleInter /// @notice tries to fund an array of target addresses, checking if they're underfunded in the process /// @param targetAddresses is an array of contract addresses to be funded in case they're underfunded - function topUp(address[] memory targetAddresses) public whenNotPaused { + function topUp(address[] memory targetAddresses) public whenNotPaused nonReentrant { MonitoredAddress memory contractToFund; uint256 minWaitPeriod = s_minWaitPeriodSeconds; uint256 localBalance = i_linkToken.balanceOf(address(this)); @@ -457,6 +461,13 @@ contract LinkAvailableBalanceMonitor is AccessControl, AutomationCompatibleInter _; } + modifier nonReentrant() { + if (reentrancyGuard) revert ReentrantCall(); + reentrancyGuard = true; + _; + reentrancyGuard = false; + } + /// @notice Pause the contract, which prevents executing performUpkeep function pause() external onlyRole(ADMIN_ROLE) { _pause(); diff --git a/contracts/src/v0.8/automation/v2_2/AutomationRegistry2_2.sol b/contracts/src/v0.8/automation/v2_2/AutomationRegistry2_2.sol index f0c703679ca..464e8746398 100644 --- a/contracts/src/v0.8/automation/v2_2/AutomationRegistry2_2.sol +++ b/contracts/src/v0.8/automation/v2_2/AutomationRegistry2_2.sol @@ -115,7 +115,7 @@ contract AutomationRegistry2_2 is AutomationRegistryBase2_2, OCR2Abstract, Chain }); uint256 blocknumber = hotVars.chainModule.blockNumber(); - uint256 l1Fee = hotVars.chainModule.getCurrentL1Fee(); + uint256 l1Fee = hotVars.chainModule.getCurrentL1Fee(msg.data.length); for (uint256 i = 0; i < report.upkeepIds.length; i++) { upkeepTransmitInfo[i].upkeep = s_upkeep[report.upkeepIds[i]]; diff --git a/contracts/src/v0.8/automation/v2_3/AutomationRegistry2_3.sol b/contracts/src/v0.8/automation/v2_3/AutomationRegistry2_3.sol index 6113cbf9fd1..031d7b5dfb8 100644 --- a/contracts/src/v0.8/automation/v2_3/AutomationRegistry2_3.sol +++ b/contracts/src/v0.8/automation/v2_3/AutomationRegistry2_3.sol @@ -136,7 +136,7 @@ contract AutomationRegistry2_3 is AutomationRegistryBase2_3, OCR2Abstract, Chain }); uint256 blocknumber = hotVars.chainModule.blockNumber(); - uint256 l1Fee = hotVars.chainModule.getCurrentL1Fee(); + uint256 l1Fee = hotVars.chainModule.getCurrentL1Fee(msg.data.length); for (uint256 i = 0; i < report.upkeepIds.length; i++) { upkeepTransmitInfo[i].upkeep = s_upkeep[report.upkeepIds[i]]; diff --git a/contracts/src/v0.8/automation/v2_3/AutomationRegistryBase2_3.sol b/contracts/src/v0.8/automation/v2_3/AutomationRegistryBase2_3.sol index fa8f06ffc02..354a6a9b475 100644 --- a/contracts/src/v0.8/automation/v2_3/AutomationRegistryBase2_3.sol +++ b/contracts/src/v0.8/automation/v2_3/AutomationRegistryBase2_3.sol @@ -45,7 +45,7 @@ abstract contract AutomationRegistryBase2_3 is ConfirmedOwner { // These values are calibrated using hardhat tests which simulate various cases and verify that // the variables result in accurate estimation uint256 internal constant REGISTRY_CONDITIONAL_OVERHEAD = 98_200; // Fixed gas overhead for conditional upkeeps - uint256 internal constant REGISTRY_LOG_OVERHEAD = 122_500; // Fixed gas overhead for log upkeeps + uint256 internal constant REGISTRY_LOG_OVERHEAD = 123_500; // Fixed gas overhead for log upkeeps uint256 internal constant REGISTRY_PER_SIGNER_GAS_OVERHEAD = 5_600; // Value scales with f uint256 internal constant REGISTRY_PER_PERFORM_BYTE_GAS_OVERHEAD = 24; // Per perform data byte overhead diff --git a/contracts/src/v0.8/automation/v2_3_zksync/ZKSyncAutomationRegistry2_3.sol b/contracts/src/v0.8/automation/v2_3_zksync/ZKSyncAutomationRegistry2_3.sol new file mode 100644 index 00000000000..5d5bf23aa26 --- /dev/null +++ b/contracts/src/v0.8/automation/v2_3_zksync/ZKSyncAutomationRegistry2_3.sol @@ -0,0 +1,386 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.19; + +import {EnumerableSet} from "../../vendor/openzeppelin-solidity/v4.7.3/contracts/utils/structs/EnumerableSet.sol"; +import {Address} from "../../vendor/openzeppelin-solidity/v4.7.3/contracts/utils/Address.sol"; +import {ZKSyncAutomationRegistryBase2_3} from "./ZKSyncAutomationRegistryBase2_3.sol"; +import {ZKSyncAutomationRegistryLogicA2_3} from "./ZKSyncAutomationRegistryLogicA2_3.sol"; +import {ZKSyncAutomationRegistryLogicC2_3} from "./ZKSyncAutomationRegistryLogicC2_3.sol"; +import {Chainable} from "../Chainable.sol"; +import {OCR2Abstract} from "../../shared/ocr2/OCR2Abstract.sol"; +import {IERC20Metadata as IERC20} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/extensions/IERC20Metadata.sol"; + +/** + * @notice Registry for adding work for Chainlink nodes to perform on client + * contracts. Clients must support the AutomationCompatibleInterface interface. + */ +contract ZKSyncAutomationRegistry2_3 is ZKSyncAutomationRegistryBase2_3, OCR2Abstract, Chainable { + using Address for address; + using EnumerableSet for EnumerableSet.UintSet; + using EnumerableSet for EnumerableSet.AddressSet; + + /** + * @notice versions: + * AutomationRegistry 2.3.0: supports native and ERC20 billing + * changes flat fee to USD-denominated + * adds support for custom billing overrides + * AutomationRegistry 2.2.0: moves chain-specific integration code into a separate module + * KeeperRegistry 2.1.0: introduces support for log triggers + * removes the need for "wrapped perform data" + * KeeperRegistry 2.0.2: pass revert bytes as performData when target contract reverts + * fixes issue with arbitrum block number + * does an early return in case of stale report instead of revert + * KeeperRegistry 2.0.1: implements workaround for buggy migrate function in 1.X + * KeeperRegistry 2.0.0: implement OCR interface + * KeeperRegistry 1.3.0: split contract into Proxy and Logic + * account for Arbitrum and Optimism L1 gas fee + * allow users to configure upkeeps + * KeeperRegistry 1.2.0: allow funding within performUpkeep + * allow configurable registry maxPerformGas + * add function to let admin change upkeep gas limit + * add minUpkeepSpend requirement + * upgrade to solidity v0.8 + * KeeperRegistry 1.1.0: added flatFeeMicroLink + * KeeperRegistry 1.0.0: initial release + */ + string public constant override typeAndVersion = "AutomationRegistry 2.3.0"; + + /** + * @param logicA the address of the first logic contract + * @dev we cast the contract to logicC in order to call logicC functions (via fallback) + */ + constructor( + ZKSyncAutomationRegistryLogicA2_3 logicA + ) + ZKSyncAutomationRegistryBase2_3( + ZKSyncAutomationRegistryLogicC2_3(address(logicA)).getLinkAddress(), + ZKSyncAutomationRegistryLogicC2_3(address(logicA)).getLinkUSDFeedAddress(), + ZKSyncAutomationRegistryLogicC2_3(address(logicA)).getNativeUSDFeedAddress(), + ZKSyncAutomationRegistryLogicC2_3(address(logicA)).getFastGasFeedAddress(), + ZKSyncAutomationRegistryLogicC2_3(address(logicA)).getAutomationForwarderLogic(), + ZKSyncAutomationRegistryLogicC2_3(address(logicA)).getAllowedReadOnlyAddress(), + ZKSyncAutomationRegistryLogicC2_3(address(logicA)).getPayoutMode(), + ZKSyncAutomationRegistryLogicC2_3(address(logicA)).getWrappedNativeTokenAddress() + ) + Chainable(address(logicA)) + {} + + /** + * @notice holds the variables used in the transmit function, necessary to avoid stack too deep errors + */ + struct TransmitVars { + uint16 numUpkeepsPassedChecks; + uint96 totalReimbursement; + uint96 totalPremium; + } + + // ================================================================ + // | HOT PATH ACTIONS | + // ================================================================ + + /** + * @inheritdoc OCR2Abstract + */ + function transmit( + bytes32[3] calldata reportContext, + bytes calldata rawReport, + bytes32[] calldata rs, + bytes32[] calldata ss, + bytes32 rawVs + ) external override { + // use this msg.data length check to ensure no extra data is included in the call + // 4 is first 4 bytes of the keccak-256 hash of the function signature. ss.length == rs.length so use one of them + // 4 + (32 * 3) + (rawReport.length + 32 + 32) + (32 * rs.length + 32 + 32) + (32 * ss.length + 32 + 32) + 32 + uint256 requiredLength = 324 + rawReport.length + 64 * rs.length; + if (msg.data.length != requiredLength) revert InvalidDataLength(); + HotVars memory hotVars = s_hotVars; + + if (hotVars.paused) revert RegistryPaused(); + if (!s_transmitters[msg.sender].active) revert OnlyActiveTransmitters(); + + // Verify signatures + if (s_latestConfigDigest != reportContext[0]) revert ConfigDigestMismatch(); + if (rs.length != hotVars.f + 1 || rs.length != ss.length) revert IncorrectNumberOfSignatures(); + _verifyReportSignature(reportContext, rawReport, rs, ss, rawVs); + + Report memory report = _decodeReport(rawReport); + + uint40 epochAndRound = uint40(uint256(reportContext[1])); + uint32 epoch = uint32(epochAndRound >> 8); + + _handleReport(hotVars, report); + + if (epoch > hotVars.latestEpoch) { + s_hotVars.latestEpoch = epoch; + } + } + + /** + * @notice handles the report by performing the upkeeps and updating the state + * @param hotVars the hot variables of the registry + * @param report the report to be handled (already verified and decoded) + * @dev had to split this function from transmit() to avoid stack too deep errors + * @dev all other internal / private functions are generally defined in the Base contract + * we leave this here because it is essentially a continuation of the transmit() function, + */ + function _handleReport(HotVars memory hotVars, Report memory report) private { + UpkeepTransmitInfo[] memory upkeepTransmitInfo = new UpkeepTransmitInfo[](report.upkeepIds.length); + TransmitVars memory transmitVars = TransmitVars({ + numUpkeepsPassedChecks: 0, + totalReimbursement: 0, + totalPremium: 0 + }); + + uint256 blocknumber = hotVars.chainModule.blockNumber(); + uint256 gasOverhead; + + for (uint256 i = 0; i < report.upkeepIds.length; i++) { + upkeepTransmitInfo[i].upkeep = s_upkeep[report.upkeepIds[i]]; + upkeepTransmitInfo[i].triggerType = _getTriggerType(report.upkeepIds[i]); + + (upkeepTransmitInfo[i].earlyChecksPassed, upkeepTransmitInfo[i].dedupID) = _prePerformChecks( + report.upkeepIds[i], + blocknumber, + report.triggers[i], + upkeepTransmitInfo[i], + hotVars + ); + + if (upkeepTransmitInfo[i].earlyChecksPassed) { + transmitVars.numUpkeepsPassedChecks += 1; + } else { + continue; + } + + // Actually perform the target upkeep + (upkeepTransmitInfo[i].performSuccess, upkeepTransmitInfo[i].gasUsed) = _performUpkeep( + upkeepTransmitInfo[i].upkeep.forwarder, + report.gasLimits[i], + report.performDatas[i] + ); + + // Store last perform block number / deduping key for upkeep + _updateTriggerMarker(report.upkeepIds[i], blocknumber, upkeepTransmitInfo[i]); + + if (upkeepTransmitInfo[i].triggerType == Trigger.CONDITION) { + gasOverhead += REGISTRY_CONDITIONAL_OVERHEAD; + } else if (upkeepTransmitInfo[i].triggerType == Trigger.LOG) { + gasOverhead += REGISTRY_LOG_OVERHEAD; + } else { + revert InvalidTriggerType(); + } + } + // No upkeeps to be performed in this report + if (transmitVars.numUpkeepsPassedChecks == 0) { + return; + } + + gasOverhead += + 16 * + msg.data.length + + ACCOUNTING_FIXED_GAS_OVERHEAD + + (REGISTRY_PER_SIGNER_GAS_OVERHEAD * (hotVars.f + 1)); + gasOverhead = gasOverhead / transmitVars.numUpkeepsPassedChecks + ACCOUNTING_PER_UPKEEP_GAS_OVERHEAD; + + { + BillingTokenPaymentParams memory billingTokenParams; + uint256 nativeUSD = _getNativeUSD(hotVars); + for (uint256 i = 0; i < report.upkeepIds.length; i++) { + if (upkeepTransmitInfo[i].earlyChecksPassed) { + if (i == 0 || upkeepTransmitInfo[i].upkeep.billingToken != upkeepTransmitInfo[i - 1].upkeep.billingToken) { + billingTokenParams = _getBillingTokenPaymentParams(hotVars, upkeepTransmitInfo[i].upkeep.billingToken); + } + PaymentReceipt memory receipt = _handlePayment( + hotVars, + PaymentParams({ + gasLimit: upkeepTransmitInfo[i].gasUsed, + gasOverhead: gasOverhead, + l1CostWei: 0, + fastGasWei: report.fastGasWei, + linkUSD: report.linkUSD, + nativeUSD: nativeUSD, + billingToken: upkeepTransmitInfo[i].upkeep.billingToken, + billingTokenParams: billingTokenParams, + isTransaction: true + }), + report.upkeepIds[i], + upkeepTransmitInfo[i].upkeep + ); + transmitVars.totalPremium += receipt.premiumInJuels; + transmitVars.totalReimbursement += receipt.gasReimbursementInJuels; + + emit UpkeepPerformed( + report.upkeepIds[i], + upkeepTransmitInfo[i].performSuccess, + receipt.gasChargeInBillingToken + receipt.premiumInBillingToken, + upkeepTransmitInfo[i].gasUsed, + gasOverhead, + report.triggers[i] + ); + } + } + } + // record payments to NOPs, all in LINK + s_transmitters[msg.sender].balance += transmitVars.totalReimbursement; + s_hotVars.totalPremium += transmitVars.totalPremium; + s_reserveAmounts[IERC20(address(i_link))] += transmitVars.totalReimbursement + transmitVars.totalPremium; + } + + // ================================================================ + // | OCR2ABSTRACT | + // ================================================================ + + /** + * @inheritdoc OCR2Abstract + * @dev prefer the type-safe version of setConfig (below) whenever possible. The OnchainConfig could differ between registry versions + * @dev this function takes up precious space on the root contract, but must be implemented to conform to the OCR2Abstract interface + */ + function setConfig( + address[] memory signers, + address[] memory transmitters, + uint8 f, + bytes memory onchainConfigBytes, + uint64 offchainConfigVersion, + bytes memory offchainConfig + ) external override { + (OnchainConfig memory config, IERC20[] memory billingTokens, BillingConfig[] memory billingConfigs) = abi.decode( + onchainConfigBytes, + (OnchainConfig, IERC20[], BillingConfig[]) + ); + + setConfigTypeSafe( + signers, + transmitters, + f, + config, + offchainConfigVersion, + offchainConfig, + billingTokens, + billingConfigs + ); + } + + /** + * @notice sets the configuration for the registry + * @param signers the list of permitted signers + * @param transmitters the list of permitted transmitters + * @param f the maximum tolerance for faulty nodes + * @param onchainConfig configuration values that are used on-chain + * @param offchainConfigVersion the version of the offchainConfig + * @param offchainConfig configuration values that are used off-chain + * @param billingTokens the list of valid billing tokens + * @param billingConfigs the configurations for each billing token + */ + function setConfigTypeSafe( + address[] memory signers, + address[] memory transmitters, + uint8 f, + OnchainConfig memory onchainConfig, + uint64 offchainConfigVersion, + bytes memory offchainConfig, + IERC20[] memory billingTokens, + BillingConfig[] memory billingConfigs + ) public onlyOwner { + if (signers.length > MAX_NUM_ORACLES) revert TooManyOracles(); + if (f == 0) revert IncorrectNumberOfFaultyOracles(); + if (signers.length != transmitters.length || signers.length <= 3 * f) revert IncorrectNumberOfSigners(); + if (billingTokens.length != billingConfigs.length) revert ParameterLengthError(); + // set billing config for tokens + _setBillingConfig(billingTokens, billingConfigs); + + _updateTransmitters(signers, transmitters); + + s_hotVars = HotVars({ + f: f, + stalenessSeconds: onchainConfig.stalenessSeconds, + gasCeilingMultiplier: onchainConfig.gasCeilingMultiplier, + paused: s_hotVars.paused, + reentrancyGuard: s_hotVars.reentrancyGuard, + totalPremium: s_hotVars.totalPremium, + latestEpoch: 0, // DON restarts epoch + reorgProtectionEnabled: onchainConfig.reorgProtectionEnabled, + chainModule: onchainConfig.chainModule + }); + + uint32 previousConfigBlockNumber = s_storage.latestConfigBlockNumber; + uint32 newLatestConfigBlockNumber = uint32(onchainConfig.chainModule.blockNumber()); + uint32 newConfigCount = s_storage.configCount + 1; + + s_storage = Storage({ + checkGasLimit: onchainConfig.checkGasLimit, + maxPerformGas: onchainConfig.maxPerformGas, + transcoder: onchainConfig.transcoder, + maxCheckDataSize: onchainConfig.maxCheckDataSize, + maxPerformDataSize: onchainConfig.maxPerformDataSize, + maxRevertDataSize: onchainConfig.maxRevertDataSize, + upkeepPrivilegeManager: onchainConfig.upkeepPrivilegeManager, + financeAdmin: onchainConfig.financeAdmin, + nonce: s_storage.nonce, + configCount: newConfigCount, + latestConfigBlockNumber: newLatestConfigBlockNumber + }); + s_fallbackGasPrice = onchainConfig.fallbackGasPrice; + s_fallbackLinkPrice = onchainConfig.fallbackLinkPrice; + s_fallbackNativePrice = onchainConfig.fallbackNativePrice; + + bytes memory onchainConfigBytes = abi.encode(onchainConfig); + + s_latestConfigDigest = _configDigestFromConfigData( + block.chainid, + address(this), + s_storage.configCount, + signers, + transmitters, + f, + onchainConfigBytes, + offchainConfigVersion, + offchainConfig + ); + + for (uint256 idx = s_registrars.length(); idx > 0; idx--) { + s_registrars.remove(s_registrars.at(idx - 1)); + } + + for (uint256 idx = 0; idx < onchainConfig.registrars.length; idx++) { + s_registrars.add(onchainConfig.registrars[idx]); + } + + emit ConfigSet( + previousConfigBlockNumber, + s_latestConfigDigest, + s_storage.configCount, + signers, + transmitters, + f, + onchainConfigBytes, + offchainConfigVersion, + offchainConfig + ); + } + + /** + * @inheritdoc OCR2Abstract + * @dev this function takes up precious space on the root contract, but must be implemented to conform to the OCR2Abstract interface + */ + function latestConfigDetails() + external + view + override + returns (uint32 configCount, uint32 blockNumber, bytes32 configDigest) + { + return (s_storage.configCount, s_storage.latestConfigBlockNumber, s_latestConfigDigest); + } + + /** + * @inheritdoc OCR2Abstract + * @dev this function takes up precious space on the root contract, but must be implemented to conform to the OCR2Abstract interface + */ + function latestConfigDigestAndEpoch() + external + view + override + returns (bool scanLogs, bytes32 configDigest, uint32 epoch) + { + return (false, s_latestConfigDigest, s_hotVars.latestEpoch); + } +} diff --git a/contracts/src/v0.8/automation/v2_3_zksync/ZKSyncAutomationRegistryBase2_3.sol b/contracts/src/v0.8/automation/v2_3_zksync/ZKSyncAutomationRegistryBase2_3.sol new file mode 100644 index 00000000000..41097af7f26 --- /dev/null +++ b/contracts/src/v0.8/automation/v2_3_zksync/ZKSyncAutomationRegistryBase2_3.sol @@ -0,0 +1,1197 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.19; + +import {EnumerableSet} from "../../vendor/openzeppelin-solidity/v4.7.3/contracts/utils/structs/EnumerableSet.sol"; +import {Address} from "../../vendor/openzeppelin-solidity/v4.7.3/contracts/utils/Address.sol"; +import {StreamsLookupCompatibleInterface} from "../interfaces/StreamsLookupCompatibleInterface.sol"; +import {ILogAutomation, Log} from "../interfaces/ILogAutomation.sol"; +import {IAutomationForwarder} from "../interfaces/IAutomationForwarder.sol"; +import {ConfirmedOwner} from "../../shared/access/ConfirmedOwner.sol"; +import {AggregatorV3Interface} from "../../shared/interfaces/AggregatorV3Interface.sol"; +import {LinkTokenInterface} from "../../shared/interfaces/LinkTokenInterface.sol"; +import {KeeperCompatibleInterface} from "../interfaces/KeeperCompatibleInterface.sol"; +import {IChainModule} from "../interfaces/IChainModule.sol"; +import {IERC20Metadata as IERC20} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/extensions/IERC20Metadata.sol"; +import {SafeCast} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/utils/math/SafeCast.sol"; +import {IWrappedNative} from "../interfaces/v2_3/IWrappedNative.sol"; + +/** + * @notice Base Keeper Registry contract, contains shared logic between + * AutomationRegistry and AutomationRegistryLogic + * @dev all errors, events, and internal functions should live here + */ +// solhint-disable-next-line max-states-count +abstract contract ZKSyncAutomationRegistryBase2_3 is ConfirmedOwner { + using Address for address; + using EnumerableSet for EnumerableSet.UintSet; + using EnumerableSet for EnumerableSet.AddressSet; + + address internal constant ZERO_ADDRESS = address(0); + address internal constant IGNORE_ADDRESS = 0xFFfFfFffFFfffFFfFFfFFFFFffFFFffffFfFFFfF; + bytes4 internal constant CHECK_SELECTOR = KeeperCompatibleInterface.checkUpkeep.selector; + bytes4 internal constant PERFORM_SELECTOR = KeeperCompatibleInterface.performUpkeep.selector; + bytes4 internal constant CHECK_CALLBACK_SELECTOR = StreamsLookupCompatibleInterface.checkCallback.selector; + bytes4 internal constant CHECK_LOG_SELECTOR = ILogAutomation.checkLog.selector; + uint256 internal constant PERFORM_GAS_MIN = 2_300; + uint256 internal constant CANCELLATION_DELAY = 50; + uint32 internal constant UINT32_MAX = type(uint32).max; + // The first byte of the mask can be 0, because we only ever have 31 oracles + uint256 internal constant ORACLE_MASK = 0x0001010101010101010101010101010101010101010101010101010101010101; + uint8 internal constant UPKEEP_VERSION_BASE = 4; + + // Next block of constants are only used in maxPayment estimation during checkUpkeep simulation + // These values are calibrated using hardhat tests which simulate various cases and verify that + // the variables result in accurate estimation + uint256 internal constant REGISTRY_CONDITIONAL_OVERHEAD = 98_200; // Fixed gas overhead for conditional upkeeps + uint256 internal constant REGISTRY_LOG_OVERHEAD = 122_500; // Fixed gas overhead for log upkeeps + uint256 internal constant REGISTRY_PER_SIGNER_GAS_OVERHEAD = 5_600; // Value scales with f + + // Next block of constants are used in actual payment calculation. We calculate the exact gas used within the + // tx itself, but since payment processing itself takes gas, and it needs the overhead as input, we use fixed constants + // to account for gas used in payment processing. These values are calibrated using hardhat tests which simulates various cases and verifies that + // the variables result in accurate estimation + uint256 internal constant ACCOUNTING_FIXED_GAS_OVERHEAD = 51_000; // Fixed overhead per tx + uint256 internal constant ACCOUNTING_PER_UPKEEP_GAS_OVERHEAD = 20_000; // Overhead per upkeep performed in batch + + LinkTokenInterface internal immutable i_link; + AggregatorV3Interface internal immutable i_linkUSDFeed; + AggregatorV3Interface internal immutable i_nativeUSDFeed; + AggregatorV3Interface internal immutable i_fastGasFeed; + address internal immutable i_automationForwarderLogic; + address internal immutable i_allowedReadOnlyAddress; + IWrappedNative internal immutable i_wrappedNativeToken; + + /** + * @dev - The storage is gas optimised for one and only one function - transmit. All the storage accessed in transmit + * is stored compactly. Rest of the storage layout is not of much concern as transmit is the only hot path + */ + + // Upkeep storage + EnumerableSet.UintSet internal s_upkeepIDs; + mapping(uint256 => Upkeep) internal s_upkeep; // accessed during transmit + mapping(uint256 => address) internal s_upkeepAdmin; + mapping(uint256 => address) internal s_proposedAdmin; + mapping(uint256 => bytes) internal s_checkData; + mapping(bytes32 => bool) internal s_dedupKeys; + // Registry config and state + EnumerableSet.AddressSet internal s_registrars; + mapping(address => Transmitter) internal s_transmitters; + mapping(address => Signer) internal s_signers; + address[] internal s_signersList; // s_signersList contains the signing address of each oracle + address[] internal s_transmittersList; // s_transmittersList contains the transmission address of each oracle + EnumerableSet.AddressSet internal s_deactivatedTransmitters; + mapping(address => address) internal s_transmitterPayees; // s_payees contains the mapping from transmitter to payee. + mapping(address => address) internal s_proposedPayee; // proposed payee for a transmitter + bytes32 internal s_latestConfigDigest; // Read on transmit path in case of signature verification + HotVars internal s_hotVars; // Mixture of config and state, used in transmit + Storage internal s_storage; // Mixture of config and state, not used in transmit + uint256 internal s_fallbackGasPrice; + uint256 internal s_fallbackLinkPrice; + uint256 internal s_fallbackNativePrice; + mapping(address => MigrationPermission) internal s_peerRegistryMigrationPermission; // Permissions for migration to and fro + mapping(uint256 => bytes) internal s_upkeepTriggerConfig; // upkeep triggers + mapping(uint256 => bytes) internal s_upkeepOffchainConfig; // general config set by users for each upkeep + mapping(uint256 => bytes) internal s_upkeepPrivilegeConfig; // general config set by an administrative role for an upkeep + mapping(address => bytes) internal s_adminPrivilegeConfig; // general config set by an administrative role for an admin + // billing + mapping(IERC20 billingToken => uint256 reserveAmount) internal s_reserveAmounts; // unspent user deposits + unwithdrawn NOP payments + mapping(IERC20 billingToken => BillingConfig billingConfig) internal s_billingConfigs; // billing configurations for different tokens + mapping(uint256 upkeepID => BillingOverrides billingOverrides) internal s_billingOverrides; // billing overrides for specific upkeeps + IERC20[] internal s_billingTokens; // list of billing tokens + PayoutMode internal s_payoutMode; + + error ArrayHasNoEntries(); + error CannotCancel(); + error CheckDataExceedsLimit(); + error ConfigDigestMismatch(); + error DuplicateEntry(); + error DuplicateSigners(); + error GasLimitCanOnlyIncrease(); + error GasLimitOutsideRange(); + error IncorrectNumberOfFaultyOracles(); + error IncorrectNumberOfSignatures(); + error IncorrectNumberOfSigners(); + error IndexOutOfRange(); + error InsufficientBalance(uint256 available, uint256 requested); + error InsufficientLinkLiquidity(); + error InvalidDataLength(); + error InvalidFeed(); + error InvalidTrigger(); + error InvalidPayee(); + error InvalidRecipient(); + error InvalidReport(); + error InvalidSigner(); + error InvalidToken(); + error InvalidTransmitter(); + error InvalidTriggerType(); + error MigrationNotPermitted(); + error MustSettleOffchain(); + error MustSettleOnchain(); + error NotAContract(); + error OnlyActiveSigners(); + error OnlyActiveTransmitters(); + error OnlyCallableByAdmin(); + error OnlyCallableByLINKToken(); + error OnlyCallableByOwnerOrAdmin(); + error OnlyCallableByOwnerOrRegistrar(); + error OnlyCallableByPayee(); + error OnlyCallableByProposedAdmin(); + error OnlyCallableByProposedPayee(); + error OnlyCallableByUpkeepPrivilegeManager(); + error OnlyFinanceAdmin(); + error OnlyPausedUpkeep(); + error OnlySimulatedBackend(); + error OnlyUnpausedUpkeep(); + error ParameterLengthError(); + error ReentrantCall(); + error RegistryPaused(); + error RepeatedSigner(); + error RepeatedTransmitter(); + error TargetCheckReverted(bytes reason); + error TooManyOracles(); + error TranscoderNotSet(); + error TransferFailed(); + error UpkeepAlreadyExists(); + error UpkeepCancelled(); + error UpkeepNotCanceled(); + error UpkeepNotNeeded(); + error ValueNotChanged(); + error ZeroAddressNotAllowed(); + + enum MigrationPermission { + NONE, + OUTGOING, + INCOMING, + BIDIRECTIONAL + } + + enum Trigger { + CONDITION, + LOG + } + + enum UpkeepFailureReason { + NONE, + UPKEEP_CANCELLED, + UPKEEP_PAUSED, + TARGET_CHECK_REVERTED, + UPKEEP_NOT_NEEDED, + PERFORM_DATA_EXCEEDS_LIMIT, + INSUFFICIENT_BALANCE, + CALLBACK_REVERTED, + REVERT_DATA_EXCEEDS_LIMIT, + REGISTRY_PAUSED + } + + enum PayoutMode { + ON_CHAIN, + OFF_CHAIN + } + + /** + * @notice OnchainConfig of the registry + * @dev used only in setConfig() + * @member checkGasLimit gas limit when checking for upkeep + * @member stalenessSeconds number of seconds that is allowed for feed data to + * be stale before switching to the fallback pricing + * @member gasCeilingMultiplier multiplier to apply to the fast gas feed price + * when calculating the payment ceiling for keepers + * @member maxPerformGas max performGas allowed for an upkeep on this registry + * @member maxCheckDataSize max length of checkData bytes + * @member maxPerformDataSize max length of performData bytes + * @member maxRevertDataSize max length of revertData bytes + * @member fallbackGasPrice gas price used if the gas price feed is stale + * @member fallbackLinkPrice LINK price used if the LINK price feed is stale + * @member transcoder address of the transcoder contract + * @member registrars addresses of the registrar contracts + * @member upkeepPrivilegeManager address which can set privilege for upkeeps + * @member reorgProtectionEnabled if this registry enables re-org protection checks + * @member chainModule the chain specific module + */ + struct OnchainConfig { + uint32 checkGasLimit; + uint32 maxPerformGas; + uint32 maxCheckDataSize; + address transcoder; + // 1 word full + bool reorgProtectionEnabled; + uint24 stalenessSeconds; + uint32 maxPerformDataSize; + uint32 maxRevertDataSize; + address upkeepPrivilegeManager; + // 2 words full + uint16 gasCeilingMultiplier; + address financeAdmin; + // 3 words + uint256 fallbackGasPrice; + uint256 fallbackLinkPrice; + uint256 fallbackNativePrice; + address[] registrars; + IChainModule chainModule; + } + + /** + * @notice relevant state of an upkeep which is used in transmit function + * @member paused if this upkeep has been paused + * @member overridesEnabled if this upkeep has overrides enabled + * @member performGas the gas limit of upkeep execution + * @member maxValidBlocknumber until which block this upkeep is valid + * @member forwarder the forwarder contract to use for this upkeep + * @member amountSpent the amount this upkeep has spent, in the upkeep's billing token + * @member balance the balance of this upkeep + * @member lastPerformedBlockNumber the last block number when this upkeep was performed + */ + struct Upkeep { + bool paused; + bool overridesEnabled; + uint32 performGas; + uint32 maxValidBlocknumber; + IAutomationForwarder forwarder; + // 2 bytes left in 1st EVM word - read in transmit path + uint128 amountSpent; + uint96 balance; + uint32 lastPerformedBlockNumber; + // 0 bytes left in 2nd EVM word - written in transmit path + IERC20 billingToken; + // 12 bytes left in 3rd EVM word - read in transmit path + } + + /// @dev Config + State storage struct which is on hot transmit path + struct HotVars { + uint96 totalPremium; // ─────────╮ total historical payment to oracles for premium + uint32 latestEpoch; // │ latest epoch for which a report was transmitted + uint24 stalenessSeconds; // │ Staleness tolerance for feeds + uint16 gasCeilingMultiplier; // │ multiplier on top of fast gas feed for upper bound + uint8 f; // │ maximum number of faulty oracles + bool paused; // │ pause switch for all upkeeps in the registry + bool reentrancyGuard; // | guard against reentrancy + bool reorgProtectionEnabled; // ─╯ if this registry should enable the re-org protection mechanism + IChainModule chainModule; // the interface of chain specific module + } + + /// @dev Config + State storage struct which is not on hot transmit path + struct Storage { + address transcoder; // Address of transcoder contract used in migrations + uint32 checkGasLimit; // Gas limit allowed in checkUpkeep + uint32 maxPerformGas; // Max gas an upkeep can use on this registry + uint32 nonce; // Nonce for each upkeep created + // 1 EVM word full + address upkeepPrivilegeManager; // address which can set privilege for upkeeps + uint32 configCount; // incremented each time a new config is posted, The count is incorporated into the config digest to prevent replay attacks. + uint32 latestConfigBlockNumber; // makes it easier for offchain systems to extract config from logs + uint32 maxCheckDataSize; // max length of checkData bytes + // 2 EVM word full + address financeAdmin; // address which can withdraw funds from the contract + uint32 maxPerformDataSize; // max length of performData bytes + uint32 maxRevertDataSize; // max length of revertData bytes + // 4 bytes left in 3rd EVM word + } + + /// @dev Report transmitted by OCR to transmit function + struct Report { + uint256 fastGasWei; + uint256 linkUSD; + uint256[] upkeepIds; + uint256[] gasLimits; + bytes[] triggers; + bytes[] performDatas; + } + + /** + * @dev This struct is used to maintain run time information about an upkeep in transmit function + * @member upkeep the upkeep struct + * @member earlyChecksPassed whether the upkeep passed early checks before perform + * @member performSuccess whether the perform was successful + * @member triggerType the type of trigger + * @member gasUsed gasUsed by this upkeep in perform + * @member dedupID unique ID used to dedup an upkeep/trigger combo + */ + struct UpkeepTransmitInfo { + Upkeep upkeep; + bool earlyChecksPassed; + bool performSuccess; + Trigger triggerType; + uint256 gasUsed; + bytes32 dedupID; + } + + /** + * @notice holds information about a transmiter / node in the DON + * @member active can this transmitter submit reports + * @member index of oracle in s_signersList/s_transmittersList + * @member balance a node's balance in LINK + * @member lastCollected the total balance at which the node last withdrew + * @dev uint96 is safe for balance / last collected because transmitters are only ever paid in LINK + */ + struct Transmitter { + bool active; + uint8 index; + uint96 balance; + uint96 lastCollected; + } + + struct TransmitterPayeeInfo { + address transmitterAddress; + address payeeAddress; + } + + struct Signer { + bool active; + // Index of oracle in s_signersList/s_transmittersList + uint8 index; + } + + /** + * @notice the trigger structure conditional trigger type + */ + struct ConditionalTrigger { + uint32 blockNum; + bytes32 blockHash; + } + + /** + * @notice the trigger structure of log upkeeps + * @dev NOTE that blockNum / blockHash describe the block used for the callback, + * not necessarily the block number that the log was emitted in!!!! + */ + struct LogTrigger { + bytes32 logBlockHash; + bytes32 txHash; + uint32 logIndex; + uint32 blockNum; + bytes32 blockHash; + } + + /** + * @notice the billing config of a token + * @dev this is a storage struct + */ + // solhint-disable-next-line gas-struct-packing + struct BillingConfig { + uint32 gasFeePPB; + uint24 flatFeeMilliCents; // min fee is $0.00001, max fee is $167 + AggregatorV3Interface priceFeed; + uint8 decimals; + // 1st word, read in calculating BillingTokenPaymentParams + uint256 fallbackPrice; + // 2nd word only read if stale + uint96 minSpend; + // 3rd word only read during cancellation + } + + /** + * @notice override-able billing params of a billing token + */ + struct BillingOverrides { + uint32 gasFeePPB; + uint24 flatFeeMilliCents; + } + + /** + * @notice pricing params for a billing token + * @dev this is a memory-only struct, so struct packing is less important + */ + struct BillingTokenPaymentParams { + uint8 decimals; + uint32 gasFeePPB; + uint24 flatFeeMilliCents; + uint256 priceUSD; + } + + /** + * @notice struct containing price & payment information used in calculating payment amount + * @member gasLimit the amount of gas used + * @member gasOverhead the amount of gas overhead + * @member l1CostWei the amount to be charged for L1 fee in wei + * @member fastGasWei the fast gas price + * @member linkUSD the exchange ratio between LINK and USD + * @member nativeUSD the exchange ratio between the chain's native token and USD + * @member billingToken the billing token + * @member billingTokenParams the payment params specific to a particular payment token + * @member isTransaction is this an eth_call or a transaction + */ + struct PaymentParams { + uint256 gasLimit; + uint256 gasOverhead; + uint256 l1CostWei; + uint256 fastGasWei; + uint256 linkUSD; + uint256 nativeUSD; + IERC20 billingToken; + BillingTokenPaymentParams billingTokenParams; + bool isTransaction; + } + + /** + * @notice struct containing receipt information about a payment or cost estimation + * @member gasChargeInBillingToken the amount to charge a user for gas spent using the billing token's native decimals + * @member premiumInBillingToken the premium charged to the user, shared between all nodes, using the billing token's native decimals + * @member gasReimbursementInJuels the amount to reimburse a node for gas spent + * @member premiumInJuels the premium paid to NOPs, shared between all nodes + */ + // solhint-disable-next-line gas-struct-packing + struct PaymentReceipt { + uint96 gasChargeInBillingToken; + uint96 premiumInBillingToken; + // one word ends + uint96 gasReimbursementInJuels; + uint96 premiumInJuels; + // second word ends + IERC20 billingToken; + uint96 linkUSD; + // third word ends + uint96 nativeUSD; + uint96 billingUSD; + // fourth word ends + } + + event AdminPrivilegeConfigSet(address indexed admin, bytes privilegeConfig); + event BillingConfigOverridden(uint256 indexed id, BillingOverrides overrides); + event BillingConfigOverrideRemoved(uint256 indexed id); + event BillingConfigSet(IERC20 indexed token, BillingConfig config); + event CancelledUpkeepReport(uint256 indexed id, bytes trigger); + event ChainSpecificModuleUpdated(address newModule); + event DedupKeyAdded(bytes32 indexed dedupKey); + event FeesWithdrawn(address indexed assetAddress, address indexed recipient, uint256 amount); + event FundsAdded(uint256 indexed id, address indexed from, uint96 amount); + event FundsWithdrawn(uint256 indexed id, uint256 amount, address to); + event InsufficientFundsUpkeepReport(uint256 indexed id, bytes trigger); + event NOPsSettledOffchain(address[] payees, uint256[] payments); + event Paused(address account); + event PayeesUpdated(address[] transmitters, address[] payees); + event PayeeshipTransferRequested(address indexed transmitter, address indexed from, address indexed to); + event PayeeshipTransferred(address indexed transmitter, address indexed from, address indexed to); + event PaymentWithdrawn(address indexed transmitter, uint256 indexed amount, address indexed to, address payee); + event ReorgedUpkeepReport(uint256 indexed id, bytes trigger); + event StaleUpkeepReport(uint256 indexed id, bytes trigger); + event UpkeepAdminTransferred(uint256 indexed id, address indexed from, address indexed to); + event UpkeepAdminTransferRequested(uint256 indexed id, address indexed from, address indexed to); + event UpkeepCanceled(uint256 indexed id, uint64 indexed atBlockHeight); + event UpkeepCheckDataSet(uint256 indexed id, bytes newCheckData); + event UpkeepGasLimitSet(uint256 indexed id, uint96 gasLimit); + event UpkeepMigrated(uint256 indexed id, uint256 remainingBalance, address destination); + event UpkeepOffchainConfigSet(uint256 indexed id, bytes offchainConfig); + event UpkeepPaused(uint256 indexed id); + event UpkeepPerformed( + uint256 indexed id, + bool indexed success, + uint96 totalPayment, + uint256 gasUsed, + uint256 gasOverhead, + bytes trigger + ); + event UpkeepCharged(uint256 indexed id, PaymentReceipt receipt); + event UpkeepPrivilegeConfigSet(uint256 indexed id, bytes privilegeConfig); + event UpkeepReceived(uint256 indexed id, uint256 startingBalance, address importedFrom); + event UpkeepRegistered(uint256 indexed id, uint32 performGas, address admin); + event UpkeepTriggerConfigSet(uint256 indexed id, bytes triggerConfig); + event UpkeepUnpaused(uint256 indexed id); + event Unpaused(address account); + + /** + * @param link address of the LINK Token + * @param linkUSDFeed address of the LINK/USD price feed + * @param nativeUSDFeed address of the Native/USD price feed + * @param fastGasFeed address of the Fast Gas price feed + * @param automationForwarderLogic the address of automation forwarder logic + * @param allowedReadOnlyAddress the address of the allowed read only address + * @param payoutMode the payout mode + */ + constructor( + address link, + address linkUSDFeed, + address nativeUSDFeed, + address fastGasFeed, + address automationForwarderLogic, + address allowedReadOnlyAddress, + PayoutMode payoutMode, + address wrappedNativeTokenAddress + ) ConfirmedOwner(msg.sender) { + i_link = LinkTokenInterface(link); + i_linkUSDFeed = AggregatorV3Interface(linkUSDFeed); + i_nativeUSDFeed = AggregatorV3Interface(nativeUSDFeed); + i_fastGasFeed = AggregatorV3Interface(fastGasFeed); + i_automationForwarderLogic = automationForwarderLogic; + i_allowedReadOnlyAddress = allowedReadOnlyAddress; + s_payoutMode = payoutMode; + i_wrappedNativeToken = IWrappedNative(wrappedNativeTokenAddress); + if (i_linkUSDFeed.decimals() != i_nativeUSDFeed.decimals()) { + revert InvalidFeed(); + } + } + + // ================================================================ + // | INTERNAL FUNCTIONS ONLY | + // ================================================================ + + /** + * @dev creates a new upkeep with the given fields + * @param id the id of the upkeep + * @param upkeep the upkeep to create + * @param admin address to cancel upkeep and withdraw remaining funds + * @param checkData data which is passed to user's checkUpkeep + * @param triggerConfig the trigger config for this upkeep + * @param offchainConfig the off-chain config of this upkeep + */ + function _createUpkeep( + uint256 id, + Upkeep memory upkeep, + address admin, + bytes memory checkData, + bytes memory triggerConfig, + bytes memory offchainConfig + ) internal { + if (s_hotVars.paused) revert RegistryPaused(); + if (checkData.length > s_storage.maxCheckDataSize) revert CheckDataExceedsLimit(); + if (upkeep.performGas < PERFORM_GAS_MIN || upkeep.performGas > s_storage.maxPerformGas) + revert GasLimitOutsideRange(); + if (address(s_upkeep[id].forwarder) != address(0)) revert UpkeepAlreadyExists(); + if (address(s_billingConfigs[upkeep.billingToken].priceFeed) == address(0)) revert InvalidToken(); + s_upkeep[id] = upkeep; + s_upkeepAdmin[id] = admin; + s_checkData[id] = checkData; + s_reserveAmounts[upkeep.billingToken] = s_reserveAmounts[upkeep.billingToken] + upkeep.balance; + s_upkeepTriggerConfig[id] = triggerConfig; + s_upkeepOffchainConfig[id] = offchainConfig; + s_upkeepIDs.add(id); + } + + /** + * @dev creates an ID for the upkeep based on the upkeep's type + * @dev the format of the ID looks like this: + * ****00000000000X**************** + * 4 bytes of entropy + * 11 bytes of zeros + * 1 identifying byte for the trigger type + * 16 bytes of entropy + * @dev this maintains the same level of entropy as eth addresses, so IDs will still be unique + * @dev we add the "identifying" part in the middle so that it is mostly hidden from users who usually only + * see the first 4 and last 4 hex values ex 0x1234...ABCD + */ + function _createID(Trigger triggerType) internal view returns (uint256) { + bytes1 empty; + IChainModule chainModule = s_hotVars.chainModule; + bytes memory idBytes = abi.encodePacked( + keccak256(abi.encode(chainModule.blockHash((chainModule.blockNumber() - 1)), address(this), s_storage.nonce)) + ); + for (uint256 idx = 4; idx < 15; idx++) { + idBytes[idx] = empty; + } + idBytes[15] = bytes1(uint8(triggerType)); + return uint256(bytes32(idBytes)); + } + + /** + * @dev retrieves feed data for fast gas/native and link/native prices. if the feed + * data is stale it uses the configured fallback price. Once a price is picked + * for gas it takes the min of gas price in the transaction or the fast gas + * price in order to reduce costs for the upkeep clients. + */ + function _getFeedData( + HotVars memory hotVars + ) internal view returns (uint256 gasWei, uint256 linkUSD, uint256 nativeUSD) { + uint32 stalenessSeconds = hotVars.stalenessSeconds; + bool staleFallback = stalenessSeconds > 0; + uint256 timestamp; + int256 feedValue; + (, feedValue, , timestamp, ) = i_fastGasFeed.latestRoundData(); + if ( + feedValue <= 0 || block.timestamp < timestamp || (staleFallback && stalenessSeconds < block.timestamp - timestamp) + ) { + gasWei = s_fallbackGasPrice; + } else { + gasWei = uint256(feedValue); + } + (, feedValue, , timestamp, ) = i_linkUSDFeed.latestRoundData(); + if ( + feedValue <= 0 || block.timestamp < timestamp || (staleFallback && stalenessSeconds < block.timestamp - timestamp) + ) { + linkUSD = s_fallbackLinkPrice; + } else { + linkUSD = uint256(feedValue); + } + return (gasWei, linkUSD, _getNativeUSD(hotVars)); + } + + /** + * @dev this price has it's own getter for use in the transmit() hot path + * in the future, all price data should be included in the report instead of + * getting read during execution + */ + function _getNativeUSD(HotVars memory hotVars) internal view returns (uint256) { + (, int256 feedValue, , uint256 timestamp, ) = i_nativeUSDFeed.latestRoundData(); + if ( + feedValue <= 0 || + block.timestamp < timestamp || + (hotVars.stalenessSeconds > 0 && hotVars.stalenessSeconds < block.timestamp - timestamp) + ) { + return s_fallbackNativePrice; + } else { + return uint256(feedValue); + } + } + + /** + * @dev gets the price and billing params for a specific billing token + */ + function _getBillingTokenPaymentParams( + HotVars memory hotVars, + IERC20 billingToken + ) internal view returns (BillingTokenPaymentParams memory paymentParams) { + BillingConfig storage config = s_billingConfigs[billingToken]; + paymentParams.flatFeeMilliCents = config.flatFeeMilliCents; + paymentParams.gasFeePPB = config.gasFeePPB; + paymentParams.decimals = config.decimals; + (, int256 feedValue, , uint256 timestamp, ) = config.priceFeed.latestRoundData(); + if ( + feedValue <= 0 || + block.timestamp < timestamp || + (hotVars.stalenessSeconds > 0 && hotVars.stalenessSeconds < block.timestamp - timestamp) + ) { + paymentParams.priceUSD = config.fallbackPrice; + } else { + paymentParams.priceUSD = uint256(feedValue); + } + return paymentParams; + } + + /** + * @param hotVars the hot path variables + * @param paymentParams the pricing data and gas usage data + * @return receipt the receipt of payment with pricing breakdown + * @dev use of PaymentParams struct is necessary to avoid stack too deep errors + * @dev calculates LINK paid for gas spent plus a configure premium percentage + * @dev 1 USD = 1e18 attoUSD + * @dev 1 USD = 1e26 hexaicosaUSD (had to borrow this prefix from geometry because there is no metric prefix for 1e-26) + * @dev 1 millicent = 1e-5 USD = 1e13 attoUSD + */ + function _calculatePaymentAmount( + HotVars memory hotVars, + PaymentParams memory paymentParams + ) internal view returns (PaymentReceipt memory receipt) { + uint256 decimals = paymentParams.billingTokenParams.decimals; + uint256 gasWei = paymentParams.fastGasWei * hotVars.gasCeilingMultiplier; + // in case it's actual execution use actual gas price, capped by fastGasWei * gasCeilingMultiplier + if (paymentParams.isTransaction && tx.gasprice < gasWei) { + gasWei = tx.gasprice; + } + + // scaling factor is based on decimals of billing token, and applies to premium and gasCharge + uint256 numeratorScalingFactor = decimals > 18 ? 10 ** (decimals - 18) : 1; + uint256 denominatorScalingFactor = decimals < 18 ? 10 ** (18 - decimals) : 1; + + // gas calculation + uint256 gasPaymentHexaicosaUSD = (gasWei * + (paymentParams.gasLimit + paymentParams.gasOverhead) + + paymentParams.l1CostWei) * paymentParams.nativeUSD; // gasPaymentHexaicosaUSD has an extra 8 zeros because of decimals on nativeUSD feed + // gasChargeInBillingToken is scaled by the billing token's decimals. Round up to ensure a minimum billing token is charged for gas + receipt.gasChargeInBillingToken = SafeCast.toUint96( + ((gasPaymentHexaicosaUSD * numeratorScalingFactor) + + (paymentParams.billingTokenParams.priceUSD * denominatorScalingFactor - 1)) / + (paymentParams.billingTokenParams.priceUSD * denominatorScalingFactor) + ); + // 18 decimals: 26 decimals / 8 decimals + receipt.gasReimbursementInJuels = SafeCast.toUint96(gasPaymentHexaicosaUSD / paymentParams.linkUSD); + + // premium calculation + uint256 flatFeeHexaicosaUSD = uint256(paymentParams.billingTokenParams.flatFeeMilliCents) * 1e21; // 1e13 for milliCents to attoUSD and 1e8 for attoUSD to hexaicosaUSD + uint256 premiumHexaicosaUSD = ((((gasWei * paymentParams.gasLimit) + paymentParams.l1CostWei) * + paymentParams.billingTokenParams.gasFeePPB * + paymentParams.nativeUSD) / 1e9) + flatFeeHexaicosaUSD; + // premium is scaled by the billing token's decimals. Round up to ensure at least minimum charge + receipt.premiumInBillingToken = SafeCast.toUint96( + ((premiumHexaicosaUSD * numeratorScalingFactor) + + (paymentParams.billingTokenParams.priceUSD * denominatorScalingFactor - 1)) / + (paymentParams.billingTokenParams.priceUSD * denominatorScalingFactor) + ); + receipt.premiumInJuels = SafeCast.toUint96(premiumHexaicosaUSD / paymentParams.linkUSD); + + receipt.billingToken = paymentParams.billingToken; + receipt.linkUSD = SafeCast.toUint96(paymentParams.linkUSD); + receipt.nativeUSD = SafeCast.toUint96(paymentParams.nativeUSD); + receipt.billingUSD = SafeCast.toUint96(paymentParams.billingTokenParams.priceUSD); + + return receipt; + } + + /** + * @dev calculates the max payment for an upkeep. Called during checkUpkeep simulation and assumes + * maximum gas overhead, L1 fee + */ + function _getMaxPayment( + uint256 upkeepId, + HotVars memory hotVars, + Trigger triggerType, + uint32 performGas, + uint256 fastGasWei, + uint256 linkUSD, + uint256 nativeUSD, + IERC20 billingToken + ) internal view returns (uint96) { + uint256 maxGasOverhead; + + { + if (triggerType == Trigger.CONDITION) { + maxGasOverhead = REGISTRY_CONDITIONAL_OVERHEAD; + } else if (triggerType == Trigger.LOG) { + maxGasOverhead = REGISTRY_LOG_OVERHEAD; + } else { + revert InvalidTriggerType(); + } + (uint256 chainModuleFixedOverhead, ) = s_hotVars.chainModule.getGasOverhead(); + maxGasOverhead += (REGISTRY_PER_SIGNER_GAS_OVERHEAD * (hotVars.f + 1)) + chainModuleFixedOverhead; + } + + BillingTokenPaymentParams memory paymentParams = _getBillingTokenPaymentParams(hotVars, billingToken); + if (s_upkeep[upkeepId].overridesEnabled) { + BillingOverrides memory billingOverrides = s_billingOverrides[upkeepId]; + // use the overridden configs + paymentParams.gasFeePPB = billingOverrides.gasFeePPB; + paymentParams.flatFeeMilliCents = billingOverrides.flatFeeMilliCents; + } + + PaymentReceipt memory receipt = _calculatePaymentAmount( + hotVars, + PaymentParams({ + gasLimit: performGas, + gasOverhead: maxGasOverhead, + l1CostWei: 0, + fastGasWei: fastGasWei, + linkUSD: linkUSD, + nativeUSD: nativeUSD, + billingToken: billingToken, + billingTokenParams: paymentParams, + isTransaction: false + }) + ); + + return receipt.gasChargeInBillingToken + receipt.premiumInBillingToken; + } + + /** + * @dev move a transmitter's balance from total pool to withdrawable balance + */ + function _updateTransmitterBalanceFromPool( + address transmitterAddress, + uint96 totalPremium, + uint96 payeeCount + ) internal returns (uint96) { + Transmitter memory transmitter = s_transmitters[transmitterAddress]; + + if (transmitter.active) { + uint96 uncollected = totalPremium - transmitter.lastCollected; + uint96 due = uncollected / payeeCount; + transmitter.balance += due; + transmitter.lastCollected += due * payeeCount; + s_transmitters[transmitterAddress] = transmitter; + } + + return transmitter.balance; + } + + /** + * @dev gets the trigger type from an upkeepID (trigger type is encoded in the middle of the ID) + */ + function _getTriggerType(uint256 upkeepId) internal pure returns (Trigger) { + bytes32 rawID = bytes32(upkeepId); + bytes1 empty = bytes1(0); + for (uint256 idx = 4; idx < 15; idx++) { + if (rawID[idx] != empty) { + // old IDs that were created before this standard and migrated to this registry + return Trigger.CONDITION; + } + } + return Trigger(uint8(rawID[15])); + } + + function _checkPayload( + uint256 upkeepId, + Trigger triggerType, + bytes memory triggerData + ) internal view returns (bytes memory) { + if (triggerType == Trigger.CONDITION) { + return abi.encodeWithSelector(CHECK_SELECTOR, s_checkData[upkeepId]); + } else if (triggerType == Trigger.LOG) { + Log memory log = abi.decode(triggerData, (Log)); + return abi.encodeWithSelector(CHECK_LOG_SELECTOR, log, s_checkData[upkeepId]); + } + revert InvalidTriggerType(); + } + + /** + * @dev _decodeReport decodes a serialized report into a Report struct + */ + function _decodeReport(bytes calldata rawReport) internal pure returns (Report memory) { + Report memory report = abi.decode(rawReport, (Report)); + uint256 expectedLength = report.upkeepIds.length; + if ( + report.gasLimits.length != expectedLength || + report.triggers.length != expectedLength || + report.performDatas.length != expectedLength + ) { + revert InvalidReport(); + } + return report; + } + + /** + * @dev Does some early sanity checks before actually performing an upkeep + * @return bool whether the upkeep should be performed + * @return bytes32 dedupID for preventing duplicate performances of this trigger + */ + function _prePerformChecks( + uint256 upkeepId, + uint256 blocknumber, + bytes memory rawTrigger, + UpkeepTransmitInfo memory transmitInfo, + HotVars memory hotVars + ) internal returns (bool, bytes32) { + bytes32 dedupID; + if (transmitInfo.triggerType == Trigger.CONDITION) { + if (!_validateConditionalTrigger(upkeepId, blocknumber, rawTrigger, transmitInfo, hotVars)) + return (false, dedupID); + } else if (transmitInfo.triggerType == Trigger.LOG) { + bool valid; + (valid, dedupID) = _validateLogTrigger(upkeepId, blocknumber, rawTrigger, hotVars); + if (!valid) return (false, dedupID); + } else { + revert InvalidTriggerType(); + } + if (transmitInfo.upkeep.maxValidBlocknumber <= blocknumber) { + // Can happen when an upkeep got cancelled after report was generated. + // However we have a CANCELLATION_DELAY of 50 blocks so shouldn't happen in practice + emit CancelledUpkeepReport(upkeepId, rawTrigger); + return (false, dedupID); + } + return (true, dedupID); + } + + /** + * @dev Does some early sanity checks before actually performing an upkeep + */ + function _validateConditionalTrigger( + uint256 upkeepId, + uint256 blocknumber, + bytes memory rawTrigger, + UpkeepTransmitInfo memory transmitInfo, + HotVars memory hotVars + ) internal returns (bool) { + ConditionalTrigger memory trigger = abi.decode(rawTrigger, (ConditionalTrigger)); + if (trigger.blockNum < transmitInfo.upkeep.lastPerformedBlockNumber) { + // Can happen when another report performed this upkeep after this report was generated + emit StaleUpkeepReport(upkeepId, rawTrigger); + return false; + } + if ( + (hotVars.reorgProtectionEnabled && + (trigger.blockHash != bytes32("") && hotVars.chainModule.blockHash(trigger.blockNum) != trigger.blockHash)) || + trigger.blockNum >= blocknumber + ) { + // There are two cases of reorged report + // 1. trigger block number is in future: this is an edge case during extreme deep reorgs of chain + // which is always protected against + // 2. blockHash at trigger block number was same as trigger time. This is an optional check which is + // applied if DON sends non empty trigger.blockHash. Note: It only works for last 256 blocks on chain + // when it is sent + emit ReorgedUpkeepReport(upkeepId, rawTrigger); + return false; + } + return true; + } + + function _validateLogTrigger( + uint256 upkeepId, + uint256 blocknumber, + bytes memory rawTrigger, + HotVars memory hotVars + ) internal returns (bool, bytes32) { + LogTrigger memory trigger = abi.decode(rawTrigger, (LogTrigger)); + bytes32 dedupID = keccak256(abi.encodePacked(upkeepId, trigger.logBlockHash, trigger.txHash, trigger.logIndex)); + if ( + (hotVars.reorgProtectionEnabled && + (trigger.blockHash != bytes32("") && hotVars.chainModule.blockHash(trigger.blockNum) != trigger.blockHash)) || + trigger.blockNum >= blocknumber + ) { + // Reorg protection is same as conditional trigger upkeeps + emit ReorgedUpkeepReport(upkeepId, rawTrigger); + return (false, dedupID); + } + if (s_dedupKeys[dedupID]) { + emit StaleUpkeepReport(upkeepId, rawTrigger); + return (false, dedupID); + } + return (true, dedupID); + } + + /** + * @dev Verify signatures attached to report + */ + function _verifyReportSignature( + bytes32[3] calldata reportContext, + bytes calldata report, + bytes32[] calldata rs, + bytes32[] calldata ss, + bytes32 rawVs + ) internal view { + bytes32 h = keccak256(abi.encode(keccak256(report), reportContext)); + // i-th byte counts number of sigs made by i-th signer + uint256 signedCount = 0; + + Signer memory signer; + address signerAddress; + for (uint256 i = 0; i < rs.length; i++) { + signerAddress = ecrecover(h, uint8(rawVs[i]) + 27, rs[i], ss[i]); + signer = s_signers[signerAddress]; + if (!signer.active) revert OnlyActiveSigners(); + unchecked { + signedCount += 1 << (8 * signer.index); + } + } + + if (signedCount & ORACLE_MASK != signedCount) revert DuplicateSigners(); + } + + /** + * @dev updates a storage marker for this upkeep to prevent duplicate and out of order performances + * @dev for conditional triggers we set the latest block number, for log triggers we store a dedupID + */ + function _updateTriggerMarker( + uint256 upkeepID, + uint256 blocknumber, + UpkeepTransmitInfo memory upkeepTransmitInfo + ) internal { + if (upkeepTransmitInfo.triggerType == Trigger.CONDITION) { + s_upkeep[upkeepID].lastPerformedBlockNumber = uint32(blocknumber); + } else if (upkeepTransmitInfo.triggerType == Trigger.LOG) { + s_dedupKeys[upkeepTransmitInfo.dedupID] = true; + emit DedupKeyAdded(upkeepTransmitInfo.dedupID); + } + } + + /** + * @dev calls the Upkeep target with the performData param passed in by the + * transmitter and the exact gas required by the Upkeep + */ + function _performUpkeep( + IAutomationForwarder forwarder, + uint256 performGas, + bytes memory performData + ) internal nonReentrant returns (bool success, uint256 gasUsed) { + performData = abi.encodeWithSelector(PERFORM_SELECTOR, performData); + return forwarder.forward(performGas, performData); + } + + /** + * @dev handles the payment processing after an upkeep has been performed. + * Deducts an upkeep's balance and increases the amount spent. + */ + function _handlePayment( + HotVars memory hotVars, + PaymentParams memory paymentParams, + uint256 upkeepId, + Upkeep memory upkeep + ) internal returns (PaymentReceipt memory) { + if (upkeep.overridesEnabled) { + BillingOverrides memory billingOverrides = s_billingOverrides[upkeepId]; + // use the overridden configs + paymentParams.billingTokenParams.gasFeePPB = billingOverrides.gasFeePPB; + paymentParams.billingTokenParams.flatFeeMilliCents = billingOverrides.flatFeeMilliCents; + } + + PaymentReceipt memory receipt = _calculatePaymentAmount(hotVars, paymentParams); + + // balance is in the token's native decimals + uint96 balance = upkeep.balance; + // payment is in the token's native decimals + uint96 payment = receipt.gasChargeInBillingToken + receipt.premiumInBillingToken; + + // scaling factors to adjust decimals between billing token and LINK + uint256 decimals = paymentParams.billingTokenParams.decimals; + uint256 scalingFactor1 = decimals < 18 ? 10 ** (18 - decimals) : 1; + uint256 scalingFactor2 = decimals > 18 ? 10 ** (decimals - 18) : 1; + + // this shouldn't happen, but in rare edge cases, we charge the full balance in case the user + // can't cover the amount owed + if (balance < receipt.gasChargeInBillingToken) { + // if the user can't cover the gas fee, then direct all of the payment to the transmitter and distribute no premium to the DON + payment = balance; + receipt.gasReimbursementInJuels = SafeCast.toUint96( + (balance * paymentParams.billingTokenParams.priceUSD * scalingFactor1) / + (paymentParams.linkUSD * scalingFactor2) + ); + receipt.premiumInJuels = 0; + receipt.premiumInBillingToken = 0; + receipt.gasChargeInBillingToken = balance; + } else if (balance < payment) { + // if the user can cover the gas fee, but not the premium, then reduce the premium + payment = balance; + receipt.premiumInJuels = SafeCast.toUint96( + ((balance * paymentParams.billingTokenParams.priceUSD * scalingFactor1) / + (paymentParams.linkUSD * scalingFactor2)) - receipt.gasReimbursementInJuels + ); + // round up + receipt.premiumInBillingToken = SafeCast.toUint96( + ((receipt.premiumInJuels * paymentParams.linkUSD * scalingFactor2) + + (paymentParams.billingTokenParams.priceUSD * scalingFactor1 - 1)) / + (paymentParams.billingTokenParams.priceUSD * scalingFactor1) + ); + } + + s_upkeep[upkeepId].balance -= payment; + s_upkeep[upkeepId].amountSpent += payment; + s_reserveAmounts[paymentParams.billingToken] -= payment; + + emit UpkeepCharged(upkeepId, receipt); + return receipt; + } + + /** + * @dev ensures the upkeep is not cancelled and the caller is the upkeep admin + */ + function _requireAdminAndNotCancelled(uint256 upkeepId) internal view { + if (msg.sender != s_upkeepAdmin[upkeepId]) revert OnlyCallableByAdmin(); + if (s_upkeep[upkeepId].maxValidBlocknumber != UINT32_MAX) revert UpkeepCancelled(); + } + + /** + * @dev replicates Open Zeppelin's ReentrancyGuard but optimized to fit our storage + */ + modifier nonReentrant() { + if (s_hotVars.reentrancyGuard) revert ReentrantCall(); + s_hotVars.reentrancyGuard = true; + _; + s_hotVars.reentrancyGuard = false; + } + + /** + * @notice only allows a pre-configured address to initiate offchain read + */ + function _preventExecution() internal view { + // solhint-disable-next-line avoid-tx-origin + if (tx.origin != i_allowedReadOnlyAddress) { + revert OnlySimulatedBackend(); + } + } + + /** + * @notice only allows finance admin to call the function + */ + function _onlyFinanceAdminAllowed() internal view { + if (msg.sender != s_storage.financeAdmin) { + revert OnlyFinanceAdmin(); + } + } + + /** + * @notice only allows privilege manager to call the function + */ + function _onlyPrivilegeManagerAllowed() internal view { + if (msg.sender != s_storage.upkeepPrivilegeManager) { + revert OnlyCallableByUpkeepPrivilegeManager(); + } + } + + /** + * @notice sets billing configuration for a token + * @param billingTokens the addresses of tokens + * @param billingConfigs the configs for tokens + */ + function _setBillingConfig(IERC20[] memory billingTokens, BillingConfig[] memory billingConfigs) internal { + // Clear existing data + for (uint256 i = 0; i < s_billingTokens.length; i++) { + delete s_billingConfigs[s_billingTokens[i]]; + } + delete s_billingTokens; + + PayoutMode mode = s_payoutMode; + for (uint256 i = 0; i < billingTokens.length; i++) { + IERC20 token = billingTokens[i]; + BillingConfig memory config = billingConfigs[i]; + + // most ERC20 tokens are 18 decimals, priceFeed must be 8 decimals + if (config.decimals != token.decimals() || config.priceFeed.decimals() != 8) { + revert InvalidToken(); + } + + // if LINK is a billing option, payout mode must be ON_CHAIN + if (address(token) == address(i_link) && mode == PayoutMode.OFF_CHAIN) { + revert InvalidToken(); + } + if (address(token) == ZERO_ADDRESS || address(config.priceFeed) == ZERO_ADDRESS) { + revert ZeroAddressNotAllowed(); + } + + // if this is a new token, add it to tokens list. Otherwise revert + if (address(s_billingConfigs[token].priceFeed) != ZERO_ADDRESS) { + revert DuplicateEntry(); + } + s_billingTokens.push(token); + + // update the billing config for an existing token or add a new one + s_billingConfigs[token] = config; + + emit BillingConfigSet(token, config); + } + } + + /** + * @notice updates the signers and transmitters lists + */ + function _updateTransmitters(address[] memory signers, address[] memory transmitters) internal { + uint96 transmittersListLength = uint96(s_transmittersList.length); + uint96 totalPremium = s_hotVars.totalPremium; + + // move all pooled payments out of the pool to each transmitter's balance + for (uint256 i = 0; i < s_transmittersList.length; i++) { + _updateTransmitterBalanceFromPool(s_transmittersList[i], totalPremium, transmittersListLength); + } + + // remove any old signer/transmitter addresses + address transmitterAddress; + PayoutMode mode = s_payoutMode; + for (uint256 i = 0; i < s_transmittersList.length; i++) { + transmitterAddress = s_transmittersList[i]; + delete s_signers[s_signersList[i]]; + // Do not delete the whole transmitter struct as it has balance information stored + s_transmitters[transmitterAddress].active = false; + if (mode == PayoutMode.OFF_CHAIN && s_transmitters[transmitterAddress].balance > 0) { + s_deactivatedTransmitters.add(transmitterAddress); + } + } + delete s_signersList; + delete s_transmittersList; + + // add new signer/transmitter addresses + Transmitter memory transmitter; + for (uint256 i = 0; i < signers.length; i++) { + if (s_signers[signers[i]].active) revert RepeatedSigner(); + if (signers[i] == ZERO_ADDRESS) revert InvalidSigner(); + s_signers[signers[i]] = Signer({active: true, index: uint8(i)}); + + transmitterAddress = transmitters[i]; + if (transmitterAddress == ZERO_ADDRESS) revert InvalidTransmitter(); + transmitter = s_transmitters[transmitterAddress]; + if (transmitter.active) revert RepeatedTransmitter(); + transmitter.active = true; + transmitter.index = uint8(i); + // new transmitters start afresh from current totalPremium + // some spare change of premium from previous pool will be forfeited + transmitter.lastCollected = s_hotVars.totalPremium; + s_transmitters[transmitterAddress] = transmitter; + if (mode == PayoutMode.OFF_CHAIN) { + s_deactivatedTransmitters.remove(transmitterAddress); + } + } + + s_signersList = signers; + s_transmittersList = transmitters; + } + + /** + * @notice returns the size of the LINK liquidity pool + # @dev LINK max supply < 2^96, so casting to int256 is safe + */ + function _linkAvailableForPayment() internal view returns (int256) { + return int256(i_link.balanceOf(address(this))) - int256(s_reserveAmounts[IERC20(address(i_link))]); + } +} diff --git a/contracts/src/v0.8/automation/v2_3_zksync/ZKSyncAutomationRegistryLogicA2_3.sol b/contracts/src/v0.8/automation/v2_3_zksync/ZKSyncAutomationRegistryLogicA2_3.sol new file mode 100644 index 00000000000..64d697c70f9 --- /dev/null +++ b/contracts/src/v0.8/automation/v2_3_zksync/ZKSyncAutomationRegistryLogicA2_3.sol @@ -0,0 +1,283 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.19; + +import {EnumerableSet} from "../../vendor/openzeppelin-solidity/v4.7.3/contracts/utils/structs/EnumerableSet.sol"; +import {Address} from "../../vendor/openzeppelin-solidity/v4.7.3/contracts/utils/Address.sol"; +import {ZKSyncAutomationRegistryBase2_3} from "./ZKSyncAutomationRegistryBase2_3.sol"; +import {ZKSyncAutomationRegistryLogicC2_3} from "./ZKSyncAutomationRegistryLogicC2_3.sol"; +import {ZKSyncAutomationRegistryLogicB2_3} from "./ZKSyncAutomationRegistryLogicB2_3.sol"; +import {Chainable} from "../Chainable.sol"; +import {ZKSyncAutomationForwarder} from "../ZKSyncAutomationForwarder.sol"; +import {IAutomationForwarder} from "../interfaces/IAutomationForwarder.sol"; +import {UpkeepTranscoderInterfaceV2} from "../interfaces/UpkeepTranscoderInterfaceV2.sol"; +import {MigratableKeeperRegistryInterfaceV2} from "../interfaces/MigratableKeeperRegistryInterfaceV2.sol"; +import {IERC20Metadata as IERC20} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/extensions/IERC20Metadata.sol"; +import {SafeERC20} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/utils/SafeERC20.sol"; +import {IERC677Receiver} from "../../shared/interfaces/IERC677Receiver.sol"; + +/** + * @notice Logic contract, works in tandem with AutomationRegistry as a proxy + */ +contract ZKSyncAutomationRegistryLogicA2_3 is ZKSyncAutomationRegistryBase2_3, Chainable, IERC677Receiver { + using Address for address; + using EnumerableSet for EnumerableSet.UintSet; + using EnumerableSet for EnumerableSet.AddressSet; + using SafeERC20 for IERC20; + + /** + * @param logicB the address of the second logic contract + * @dev we cast the contract to logicC in order to call logicC functions (via fallback) + */ + constructor( + ZKSyncAutomationRegistryLogicB2_3 logicB + ) + ZKSyncAutomationRegistryBase2_3( + ZKSyncAutomationRegistryLogicC2_3(address(logicB)).getLinkAddress(), + ZKSyncAutomationRegistryLogicC2_3(address(logicB)).getLinkUSDFeedAddress(), + ZKSyncAutomationRegistryLogicC2_3(address(logicB)).getNativeUSDFeedAddress(), + ZKSyncAutomationRegistryLogicC2_3(address(logicB)).getFastGasFeedAddress(), + ZKSyncAutomationRegistryLogicC2_3(address(logicB)).getAutomationForwarderLogic(), + ZKSyncAutomationRegistryLogicC2_3(address(logicB)).getAllowedReadOnlyAddress(), + ZKSyncAutomationRegistryLogicC2_3(address(logicB)).getPayoutMode(), + ZKSyncAutomationRegistryLogicC2_3(address(logicB)).getWrappedNativeTokenAddress() + ) + Chainable(address(logicB)) + {} + + /** + * @notice uses LINK's transferAndCall to LINK and add funding to an upkeep + * @dev safe to cast uint256 to uint96 as total LINK supply is under UINT96MAX + * @param sender the account which transferred the funds + * @param amount number of LINK transfer + */ + function onTokenTransfer(address sender, uint256 amount, bytes calldata data) external override { + if (msg.sender != address(i_link)) revert OnlyCallableByLINKToken(); + if (data.length != 32) revert InvalidDataLength(); + uint256 id = abi.decode(data, (uint256)); + if (s_upkeep[id].maxValidBlocknumber != UINT32_MAX) revert UpkeepCancelled(); + if (address(s_upkeep[id].billingToken) != address(i_link)) revert InvalidToken(); + s_upkeep[id].balance = s_upkeep[id].balance + uint96(amount); + s_reserveAmounts[IERC20(address(i_link))] = s_reserveAmounts[IERC20(address(i_link))] + amount; + emit FundsAdded(id, sender, uint96(amount)); + } + + // ================================================================ + // | UPKEEP MANAGEMENT | + // ================================================================ + + /** + * @notice adds a new upkeep + * @param target address to perform upkeep on + * @param gasLimit amount of gas to provide the target contract when + * performing upkeep + * @param admin address to cancel upkeep and withdraw remaining funds + * @param triggerType the trigger for the upkeep + * @param billingToken the billing token for the upkeep + * @param checkData data passed to the contract when checking for upkeep + * @param triggerConfig the config for the trigger + * @param offchainConfig arbitrary offchain config for the upkeep + */ + function registerUpkeep( + address target, + uint32 gasLimit, + address admin, + Trigger triggerType, + IERC20 billingToken, + bytes calldata checkData, + bytes memory triggerConfig, + bytes memory offchainConfig + ) public returns (uint256 id) { + if (msg.sender != owner() && !s_registrars.contains(msg.sender)) revert OnlyCallableByOwnerOrRegistrar(); + if (!target.isContract()) revert NotAContract(); + id = _createID(triggerType); + IAutomationForwarder forwarder = IAutomationForwarder( + address(new ZKSyncAutomationForwarder(target, address(this), i_automationForwarderLogic)) + ); + _createUpkeep( + id, + Upkeep({ + overridesEnabled: false, + performGas: gasLimit, + balance: 0, + maxValidBlocknumber: UINT32_MAX, + lastPerformedBlockNumber: 0, + amountSpent: 0, + paused: false, + forwarder: forwarder, + billingToken: billingToken + }), + admin, + checkData, + triggerConfig, + offchainConfig + ); + s_storage.nonce++; + emit UpkeepRegistered(id, gasLimit, admin); + emit UpkeepCheckDataSet(id, checkData); + emit UpkeepTriggerConfigSet(id, triggerConfig); + emit UpkeepOffchainConfigSet(id, offchainConfig); + return (id); + } + + /** + * @notice cancels an upkeep + * @param id the upkeepID to cancel + * @dev if a user cancels an upkeep, their funds are locked for CANCELLATION_DELAY blocks to + * allow any pending performUpkeep txs time to get confirmed + */ + function cancelUpkeep(uint256 id) external { + Upkeep memory upkeep = s_upkeep[id]; + bool isOwner = msg.sender == owner(); + uint96 minSpend = s_billingConfigs[upkeep.billingToken].minSpend; + + uint256 height = s_hotVars.chainModule.blockNumber(); + if (upkeep.maxValidBlocknumber == 0) revert CannotCancel(); + if (upkeep.maxValidBlocknumber != UINT32_MAX) revert UpkeepCancelled(); + if (!isOwner && msg.sender != s_upkeepAdmin[id]) revert OnlyCallableByOwnerOrAdmin(); + + if (!isOwner) { + height = height + CANCELLATION_DELAY; + } + s_upkeep[id].maxValidBlocknumber = uint32(height); + s_upkeepIDs.remove(id); + + // charge the cancellation fee if the minSpend is not met + uint96 cancellationFee = 0; + // cancellationFee is min(max(minSpend - amountSpent, 0), amountLeft) + if (upkeep.amountSpent < minSpend) { + cancellationFee = minSpend - uint96(upkeep.amountSpent); + if (cancellationFee > upkeep.balance) { + cancellationFee = upkeep.balance; + } + } + s_upkeep[id].balance = upkeep.balance - cancellationFee; + s_reserveAmounts[upkeep.billingToken] = s_reserveAmounts[upkeep.billingToken] - cancellationFee; + + emit UpkeepCanceled(id, uint64(height)); + } + + /** + * @notice migrates upkeeps from one registry to another. + * @param ids the upkeepIDs to migrate + * @param destination the destination registry address + * @dev a transcoder must be set in order to enable migration + * @dev migration permissions must be set on *both* sending and receiving registries + * @dev only an upkeep admin can migrate their upkeeps + * @dev this function is most gas-efficient if upkeepIDs are sorted by billing token + * @dev s_billingOverrides and s_upkeepPrivilegeConfig are not migrated in this function + */ + function migrateUpkeeps(uint256[] calldata ids, address destination) external { + if ( + s_peerRegistryMigrationPermission[destination] != MigrationPermission.OUTGOING && + s_peerRegistryMigrationPermission[destination] != MigrationPermission.BIDIRECTIONAL + ) revert MigrationNotPermitted(); + if (s_storage.transcoder == ZERO_ADDRESS) revert TranscoderNotSet(); + if (ids.length == 0) revert ArrayHasNoEntries(); + + IERC20 billingToken; + uint256 balanceToTransfer; + uint256 id; + Upkeep memory upkeep; + address[] memory admins = new address[](ids.length); + Upkeep[] memory upkeeps = new Upkeep[](ids.length); + bytes[] memory checkDatas = new bytes[](ids.length); + bytes[] memory triggerConfigs = new bytes[](ids.length); + bytes[] memory offchainConfigs = new bytes[](ids.length); + + for (uint256 idx = 0; idx < ids.length; idx++) { + id = ids[idx]; + upkeep = s_upkeep[id]; + + if (idx == 0) { + billingToken = upkeep.billingToken; + balanceToTransfer = upkeep.balance; + } + + // if we encounter a new billing token, send the sum from the last billing token to the destination registry + if (upkeep.billingToken != billingToken) { + s_reserveAmounts[billingToken] = s_reserveAmounts[billingToken] - balanceToTransfer; + billingToken.safeTransfer(destination, balanceToTransfer); + billingToken = upkeep.billingToken; + balanceToTransfer = upkeep.balance; + } else if (idx != 0) { + balanceToTransfer += upkeep.balance; + } + + _requireAdminAndNotCancelled(id); + upkeep.forwarder.updateRegistry(destination); + + upkeeps[idx] = upkeep; + admins[idx] = s_upkeepAdmin[id]; + checkDatas[idx] = s_checkData[id]; + triggerConfigs[idx] = s_upkeepTriggerConfig[id]; + offchainConfigs[idx] = s_upkeepOffchainConfig[id]; + delete s_upkeep[id]; + delete s_checkData[id]; + delete s_upkeepTriggerConfig[id]; + delete s_upkeepOffchainConfig[id]; + // nullify existing proposed admin change if an upkeep is being migrated + delete s_proposedAdmin[id]; + delete s_upkeepAdmin[id]; + s_upkeepIDs.remove(id); + emit UpkeepMigrated(id, upkeep.balance, destination); + } + // always transfer the rolling sum in the end + s_reserveAmounts[billingToken] = s_reserveAmounts[billingToken] - balanceToTransfer; + billingToken.safeTransfer(destination, balanceToTransfer); + + bytes memory encodedUpkeeps = abi.encode( + ids, + upkeeps, + new address[](ids.length), + admins, + checkDatas, + triggerConfigs, + offchainConfigs + ); + MigratableKeeperRegistryInterfaceV2(destination).receiveUpkeeps( + UpkeepTranscoderInterfaceV2(s_storage.transcoder).transcodeUpkeeps( + UPKEEP_VERSION_BASE, + MigratableKeeperRegistryInterfaceV2(destination).upkeepVersion(), + encodedUpkeeps + ) + ); + } + + /** + * @notice received upkeeps migrated from another registry + * @param encodedUpkeeps the raw upkeep data to import + * @dev this function is never called directly, it is only called by another registry's migrate function + * @dev s_billingOverrides and s_upkeepPrivilegeConfig are not handled in this function + */ + function receiveUpkeeps(bytes calldata encodedUpkeeps) external { + if ( + s_peerRegistryMigrationPermission[msg.sender] != MigrationPermission.INCOMING && + s_peerRegistryMigrationPermission[msg.sender] != MigrationPermission.BIDIRECTIONAL + ) revert MigrationNotPermitted(); + ( + uint256[] memory ids, + Upkeep[] memory upkeeps, + address[] memory targets, + address[] memory upkeepAdmins, + bytes[] memory checkDatas, + bytes[] memory triggerConfigs, + bytes[] memory offchainConfigs + ) = abi.decode(encodedUpkeeps, (uint256[], Upkeep[], address[], address[], bytes[], bytes[], bytes[])); + for (uint256 idx = 0; idx < ids.length; idx++) { + if (address(upkeeps[idx].forwarder) == ZERO_ADDRESS) { + upkeeps[idx].forwarder = IAutomationForwarder( + address(new ZKSyncAutomationForwarder(targets[idx], address(this), i_automationForwarderLogic)) + ); + } + _createUpkeep( + ids[idx], + upkeeps[idx], + upkeepAdmins[idx], + checkDatas[idx], + triggerConfigs[idx], + offchainConfigs[idx] + ); + emit UpkeepReceived(ids[idx], upkeeps[idx].balance, msg.sender); + } + } +} diff --git a/contracts/src/v0.8/automation/v2_3_zksync/ZKSyncAutomationRegistryLogicB2_3.sol b/contracts/src/v0.8/automation/v2_3_zksync/ZKSyncAutomationRegistryLogicB2_3.sol new file mode 100644 index 00000000000..55af99fde87 --- /dev/null +++ b/contracts/src/v0.8/automation/v2_3_zksync/ZKSyncAutomationRegistryLogicB2_3.sol @@ -0,0 +1,449 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.19; + +import {ZKSyncAutomationRegistryBase2_3} from "./ZKSyncAutomationRegistryBase2_3.sol"; +import {EnumerableSet} from "../../vendor/openzeppelin-solidity/v4.7.3/contracts/utils/structs/EnumerableSet.sol"; +import {Address} from "../../vendor/openzeppelin-solidity/v4.7.3/contracts/utils/Address.sol"; +import {ZKSyncAutomationRegistryLogicC2_3} from "./ZKSyncAutomationRegistryLogicC2_3.sol"; +import {Chainable} from "../Chainable.sol"; +import {IERC20Metadata as IERC20} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/extensions/IERC20Metadata.sol"; +import {SafeERC20} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/utils/SafeERC20.sol"; +import {SafeCast} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/utils/math/SafeCast.sol"; + +contract ZKSyncAutomationRegistryLogicB2_3 is ZKSyncAutomationRegistryBase2_3, Chainable { + using Address for address; + using EnumerableSet for EnumerableSet.UintSet; + using EnumerableSet for EnumerableSet.AddressSet; + using SafeERC20 for IERC20; + + /** + * @param logicC the address of the third logic contract + */ + constructor( + ZKSyncAutomationRegistryLogicC2_3 logicC + ) + ZKSyncAutomationRegistryBase2_3( + logicC.getLinkAddress(), + logicC.getLinkUSDFeedAddress(), + logicC.getNativeUSDFeedAddress(), + logicC.getFastGasFeedAddress(), + logicC.getAutomationForwarderLogic(), + logicC.getAllowedReadOnlyAddress(), + logicC.getPayoutMode(), + logicC.getWrappedNativeTokenAddress() + ) + Chainable(address(logicC)) + {} + + // ================================================================ + // | PIPELINE FUNCTIONS | + // ================================================================ + + /** + * @notice called by the automation DON to check if work is needed + * @param id the upkeep ID to check for work needed + * @param triggerData extra contextual data about the trigger (not used in all code paths) + * @dev this one of the core functions called in the hot path + * @dev there is a 2nd checkUpkeep function (below) that is being maintained for backwards compatibility + * @dev there is an incongruency on what gets returned during failure modes + * ex sometimes we include price data, sometimes we omit it depending on the failure + */ + function checkUpkeep( + uint256 id, + bytes memory triggerData + ) + public + returns ( + bool upkeepNeeded, + bytes memory performData, + UpkeepFailureReason upkeepFailureReason, + uint256 gasUsed, + uint256 gasLimit, + uint256 fastGasWei, + uint256 linkUSD + ) + { + _preventExecution(); + + Trigger triggerType = _getTriggerType(id); + HotVars memory hotVars = s_hotVars; + Upkeep memory upkeep = s_upkeep[id]; + + { + uint256 nativeUSD; + uint96 maxPayment; + if (hotVars.paused) return (false, bytes(""), UpkeepFailureReason.REGISTRY_PAUSED, 0, upkeep.performGas, 0, 0); + if (upkeep.maxValidBlocknumber != UINT32_MAX) + return (false, bytes(""), UpkeepFailureReason.UPKEEP_CANCELLED, 0, upkeep.performGas, 0, 0); + if (upkeep.paused) return (false, bytes(""), UpkeepFailureReason.UPKEEP_PAUSED, 0, upkeep.performGas, 0, 0); + (fastGasWei, linkUSD, nativeUSD) = _getFeedData(hotVars); + maxPayment = _getMaxPayment( + id, + hotVars, + triggerType, + upkeep.performGas, + fastGasWei, + linkUSD, + nativeUSD, + upkeep.billingToken + ); + if (upkeep.balance < maxPayment) { + return (false, bytes(""), UpkeepFailureReason.INSUFFICIENT_BALANCE, 0, upkeep.performGas, 0, 0); + } + } + + bytes memory callData = _checkPayload(id, triggerType, triggerData); + + gasUsed = gasleft(); + // solhint-disable-next-line avoid-low-level-calls + (bool success, bytes memory result) = upkeep.forwarder.getTarget().call{gas: s_storage.checkGasLimit}(callData); + gasUsed = gasUsed - gasleft(); + + if (!success) { + // User's target check reverted. We capture the revert data here and pass it within performData + if (result.length > s_storage.maxRevertDataSize) { + return ( + false, + bytes(""), + UpkeepFailureReason.REVERT_DATA_EXCEEDS_LIMIT, + gasUsed, + upkeep.performGas, + fastGasWei, + linkUSD + ); + } + return ( + upkeepNeeded, + result, + UpkeepFailureReason.TARGET_CHECK_REVERTED, + gasUsed, + upkeep.performGas, + fastGasWei, + linkUSD + ); + } + + (upkeepNeeded, performData) = abi.decode(result, (bool, bytes)); + if (!upkeepNeeded) + return (false, bytes(""), UpkeepFailureReason.UPKEEP_NOT_NEEDED, gasUsed, upkeep.performGas, fastGasWei, linkUSD); + + if (performData.length > s_storage.maxPerformDataSize) + return ( + false, + bytes(""), + UpkeepFailureReason.PERFORM_DATA_EXCEEDS_LIMIT, + gasUsed, + upkeep.performGas, + fastGasWei, + linkUSD + ); + + return (upkeepNeeded, performData, upkeepFailureReason, gasUsed, upkeep.performGas, fastGasWei, linkUSD); + } + + /** + * @notice see other checkUpkeep function for description + * @dev this function may be deprecated in a future version of chainlink automation + */ + function checkUpkeep( + uint256 id + ) + external + returns ( + bool upkeepNeeded, + bytes memory performData, + UpkeepFailureReason upkeepFailureReason, + uint256 gasUsed, + uint256 gasLimit, + uint256 fastGasWei, + uint256 linkUSD + ) + { + return checkUpkeep(id, bytes("")); + } + + /** + * @dev checkCallback is used specifically for automation data streams lookups (see StreamsLookupCompatibleInterface.sol) + * @param id the upkeepID to execute a callback for + * @param values the values returned from the data streams lookup + * @param extraData the user-provided extra context data + */ + function checkCallback( + uint256 id, + bytes[] memory values, + bytes calldata extraData + ) + external + returns (bool upkeepNeeded, bytes memory performData, UpkeepFailureReason upkeepFailureReason, uint256 gasUsed) + { + bytes memory payload = abi.encodeWithSelector(CHECK_CALLBACK_SELECTOR, values, extraData); + return executeCallback(id, payload); + } + + /** + * @notice this is a generic callback executor that forwards a call to a user's contract with the configured + * gas limit + * @param id the upkeepID to execute a callback for + * @param payload the data (including function selector) to call on the upkeep target contract + */ + function executeCallback( + uint256 id, + bytes memory payload + ) + public + returns (bool upkeepNeeded, bytes memory performData, UpkeepFailureReason upkeepFailureReason, uint256 gasUsed) + { + _preventExecution(); + + Upkeep memory upkeep = s_upkeep[id]; + gasUsed = gasleft(); + // solhint-disable-next-line avoid-low-level-calls + (bool success, bytes memory result) = upkeep.forwarder.getTarget().call{gas: s_storage.checkGasLimit}(payload); + gasUsed = gasUsed - gasleft(); + if (!success) { + return (false, bytes(""), UpkeepFailureReason.CALLBACK_REVERTED, gasUsed); + } + (upkeepNeeded, performData) = abi.decode(result, (bool, bytes)); + if (!upkeepNeeded) { + return (false, bytes(""), UpkeepFailureReason.UPKEEP_NOT_NEEDED, gasUsed); + } + if (performData.length > s_storage.maxPerformDataSize) { + return (false, bytes(""), UpkeepFailureReason.PERFORM_DATA_EXCEEDS_LIMIT, gasUsed); + } + return (upkeepNeeded, performData, upkeepFailureReason, gasUsed); + } + + /** + * @notice simulates the upkeep with the perform data returned from checkUpkeep + * @param id identifier of the upkeep to execute the data with. + * @param performData calldata parameter to be passed to the target upkeep. + * @return success whether the call reverted or not + * @return gasUsed the amount of gas the target contract consumed + */ + function simulatePerformUpkeep( + uint256 id, + bytes calldata performData + ) external returns (bool success, uint256 gasUsed) { + _preventExecution(); + + if (s_hotVars.paused) revert RegistryPaused(); + Upkeep memory upkeep = s_upkeep[id]; + (success, gasUsed) = _performUpkeep(upkeep.forwarder, upkeep.performGas, performData); + return (success, gasUsed); + } + + // ================================================================ + // | UPKEEP MANAGEMENT | + // ================================================================ + + /** + * @notice adds fund to an upkeep + * @param id the upkeepID + * @param amount the amount of funds to add, in the upkeep's billing token + */ + function addFunds(uint256 id, uint96 amount) external payable { + Upkeep memory upkeep = s_upkeep[id]; + if (upkeep.maxValidBlocknumber != UINT32_MAX) revert UpkeepCancelled(); + + if (msg.value != 0) { + if (upkeep.billingToken != IERC20(i_wrappedNativeToken)) { + revert InvalidToken(); + } + amount = SafeCast.toUint96(msg.value); + } + + s_upkeep[id].balance = upkeep.balance + amount; + s_reserveAmounts[upkeep.billingToken] = s_reserveAmounts[upkeep.billingToken] + amount; + + if (msg.value == 0) { + // ERC20 payment + upkeep.billingToken.safeTransferFrom(msg.sender, address(this), amount); + } else { + // native payment + i_wrappedNativeToken.deposit{value: amount}(); + } + + emit FundsAdded(id, msg.sender, amount); + } + + /** + * @notice overrides the billing config for an upkeep + * @param id the upkeepID + * @param billingOverrides the override-able billing config + */ + function setBillingOverrides(uint256 id, BillingOverrides calldata billingOverrides) external { + _onlyPrivilegeManagerAllowed(); + if (s_upkeep[id].maxValidBlocknumber != UINT32_MAX) revert UpkeepCancelled(); + + s_upkeep[id].overridesEnabled = true; + s_billingOverrides[id] = billingOverrides; + emit BillingConfigOverridden(id, billingOverrides); + } + + /** + * @notice remove the overridden billing config for an upkeep + * @param id the upkeepID + */ + function removeBillingOverrides(uint256 id) external { + _onlyPrivilegeManagerAllowed(); + + s_upkeep[id].overridesEnabled = false; + delete s_billingOverrides[id]; + emit BillingConfigOverrideRemoved(id); + } + + /** + * @notice transfers the address of an admin for an upkeep + */ + function transferUpkeepAdmin(uint256 id, address proposed) external { + _requireAdminAndNotCancelled(id); + if (proposed == msg.sender) revert ValueNotChanged(); + + if (s_proposedAdmin[id] != proposed) { + s_proposedAdmin[id] = proposed; + emit UpkeepAdminTransferRequested(id, msg.sender, proposed); + } + } + + /** + * @notice accepts the transfer of an upkeep admin + */ + function acceptUpkeepAdmin(uint256 id) external { + Upkeep memory upkeep = s_upkeep[id]; + if (upkeep.maxValidBlocknumber != UINT32_MAX) revert UpkeepCancelled(); + if (s_proposedAdmin[id] != msg.sender) revert OnlyCallableByProposedAdmin(); + address past = s_upkeepAdmin[id]; + s_upkeepAdmin[id] = msg.sender; + s_proposedAdmin[id] = ZERO_ADDRESS; + + emit UpkeepAdminTransferred(id, past, msg.sender); + } + + /** + * @notice pauses an upkeep - an upkeep will be neither checked nor performed while paused + */ + function pauseUpkeep(uint256 id) external { + _requireAdminAndNotCancelled(id); + Upkeep memory upkeep = s_upkeep[id]; + if (upkeep.paused) revert OnlyUnpausedUpkeep(); + s_upkeep[id].paused = true; + s_upkeepIDs.remove(id); + emit UpkeepPaused(id); + } + + /** + * @notice unpauses an upkeep + */ + function unpauseUpkeep(uint256 id) external { + _requireAdminAndNotCancelled(id); + Upkeep memory upkeep = s_upkeep[id]; + if (!upkeep.paused) revert OnlyPausedUpkeep(); + s_upkeep[id].paused = false; + s_upkeepIDs.add(id); + emit UpkeepUnpaused(id); + } + + /** + * @notice updates the checkData for an upkeep + */ + function setUpkeepCheckData(uint256 id, bytes calldata newCheckData) external { + _requireAdminAndNotCancelled(id); + if (newCheckData.length > s_storage.maxCheckDataSize) revert CheckDataExceedsLimit(); + s_checkData[id] = newCheckData; + emit UpkeepCheckDataSet(id, newCheckData); + } + + /** + * @notice updates the gas limit for an upkeep + */ + function setUpkeepGasLimit(uint256 id, uint32 gasLimit) external { + if (gasLimit < PERFORM_GAS_MIN || gasLimit > s_storage.maxPerformGas) revert GasLimitOutsideRange(); + _requireAdminAndNotCancelled(id); + s_upkeep[id].performGas = gasLimit; + + emit UpkeepGasLimitSet(id, gasLimit); + } + + /** + * @notice updates the offchain config for an upkeep + */ + function setUpkeepOffchainConfig(uint256 id, bytes calldata config) external { + _requireAdminAndNotCancelled(id); + s_upkeepOffchainConfig[id] = config; + emit UpkeepOffchainConfigSet(id, config); + } + + /** + * @notice sets the upkeep trigger config + * @param id the upkeepID to change the trigger for + * @param triggerConfig the new trigger config + */ + function setUpkeepTriggerConfig(uint256 id, bytes calldata triggerConfig) external { + _requireAdminAndNotCancelled(id); + s_upkeepTriggerConfig[id] = triggerConfig; + emit UpkeepTriggerConfigSet(id, triggerConfig); + } + + /** + * @notice withdraws an upkeep's funds from an upkeep + * @dev note that an upkeep must be cancelled first!! + */ + function withdrawFunds(uint256 id, address to) external nonReentrant { + if (to == ZERO_ADDRESS) revert InvalidRecipient(); + Upkeep memory upkeep = s_upkeep[id]; + if (s_upkeepAdmin[id] != msg.sender) revert OnlyCallableByAdmin(); + if (upkeep.maxValidBlocknumber > s_hotVars.chainModule.blockNumber()) revert UpkeepNotCanceled(); + uint96 amountToWithdraw = s_upkeep[id].balance; + s_reserveAmounts[upkeep.billingToken] = s_reserveAmounts[upkeep.billingToken] - amountToWithdraw; + s_upkeep[id].balance = 0; + upkeep.billingToken.safeTransfer(to, amountToWithdraw); + emit FundsWithdrawn(id, amountToWithdraw, to); + } + + // ================================================================ + // | FINANCE ACTIONS | + // ================================================================ + + /** + * @notice withdraws excess LINK from the liquidity pool + * @param to the address to send the fees to + * @param amount the amount to withdraw + */ + function withdrawLink(address to, uint256 amount) external { + _onlyFinanceAdminAllowed(); + if (to == ZERO_ADDRESS) revert InvalidRecipient(); + + int256 available = _linkAvailableForPayment(); + if (available < 0) { + revert InsufficientBalance(0, amount); + } else if (amount > uint256(available)) { + revert InsufficientBalance(uint256(available), amount); + } + + bool transferStatus = i_link.transfer(to, amount); + if (!transferStatus) { + revert TransferFailed(); + } + emit FeesWithdrawn(address(i_link), to, amount); + } + + /** + * @notice withdraws non-LINK fees earned by the contract + * @param asset the asset to withdraw + * @param to the address to send the fees to + * @param amount the amount to withdraw + * @dev in ON_CHAIN mode, we prevent withdrawing non-LINK fees unless there is sufficient LINK liquidity + * to cover all outstanding debts on the registry + */ + function withdrawERC20Fees(IERC20 asset, address to, uint256 amount) external { + _onlyFinanceAdminAllowed(); + if (to == ZERO_ADDRESS) revert InvalidRecipient(); + if (address(asset) == address(i_link)) revert InvalidToken(); + if (_linkAvailableForPayment() < 0 && s_payoutMode == PayoutMode.ON_CHAIN) revert InsufficientLinkLiquidity(); + uint256 available = asset.balanceOf(address(this)) - s_reserveAmounts[asset]; + if (amount > available) revert InsufficientBalance(available, amount); + + asset.safeTransfer(to, amount); + emit FeesWithdrawn(address(asset), to, amount); + } +} diff --git a/contracts/src/v0.8/automation/v2_3_zksync/ZKSyncAutomationRegistryLogicC2_3.sol b/contracts/src/v0.8/automation/v2_3_zksync/ZKSyncAutomationRegistryLogicC2_3.sol new file mode 100644 index 00000000000..3b4b023c7a2 --- /dev/null +++ b/contracts/src/v0.8/automation/v2_3_zksync/ZKSyncAutomationRegistryLogicC2_3.sol @@ -0,0 +1,626 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.19; + +import {ZKSyncAutomationRegistryBase2_3} from "./ZKSyncAutomationRegistryBase2_3.sol"; +import {EnumerableSet} from "../../vendor/openzeppelin-solidity/v4.7.3/contracts/utils/structs/EnumerableSet.sol"; +import {Address} from "../../vendor/openzeppelin-solidity/v4.7.3/contracts/utils/Address.sol"; +import {IAutomationForwarder} from "../interfaces/IAutomationForwarder.sol"; +import {IChainModule} from "../interfaces/IChainModule.sol"; +import {IERC20Metadata as IERC20} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/extensions/IERC20Metadata.sol"; +import {IAutomationV21PlusCommon} from "../interfaces/IAutomationV21PlusCommon.sol"; + +contract ZKSyncAutomationRegistryLogicC2_3 is ZKSyncAutomationRegistryBase2_3 { + using Address for address; + using EnumerableSet for EnumerableSet.UintSet; + using EnumerableSet for EnumerableSet.AddressSet; + + /** + * @dev see AutomationRegistry master contract for constructor description + */ + constructor( + address link, + address linkUSDFeed, + address nativeUSDFeed, + address fastGasFeed, + address automationForwarderLogic, + address allowedReadOnlyAddress, + PayoutMode payoutMode, + address wrappedNativeTokenAddress + ) + ZKSyncAutomationRegistryBase2_3( + link, + linkUSDFeed, + nativeUSDFeed, + fastGasFeed, + automationForwarderLogic, + allowedReadOnlyAddress, + payoutMode, + wrappedNativeTokenAddress + ) + {} + + // ================================================================ + // | NODE ACTIONS | + // ================================================================ + + /** + * @notice transfers the address of payee for a transmitter + */ + function transferPayeeship(address transmitter, address proposed) external { + if (s_transmitterPayees[transmitter] != msg.sender) revert OnlyCallableByPayee(); + if (proposed == msg.sender) revert ValueNotChanged(); + + if (s_proposedPayee[transmitter] != proposed) { + s_proposedPayee[transmitter] = proposed; + emit PayeeshipTransferRequested(transmitter, msg.sender, proposed); + } + } + + /** + * @notice accepts the transfer of the payee + */ + function acceptPayeeship(address transmitter) external { + if (s_proposedPayee[transmitter] != msg.sender) revert OnlyCallableByProposedPayee(); + address past = s_transmitterPayees[transmitter]; + s_transmitterPayees[transmitter] = msg.sender; + s_proposedPayee[transmitter] = ZERO_ADDRESS; + + emit PayeeshipTransferred(transmitter, past, msg.sender); + } + + /** + * @notice this is for NOPs to withdraw LINK received as payment for work performed + */ + function withdrawPayment(address from, address to) external { + if (to == ZERO_ADDRESS) revert InvalidRecipient(); + if (s_payoutMode == PayoutMode.OFF_CHAIN) revert MustSettleOffchain(); + if (s_transmitterPayees[from] != msg.sender) revert OnlyCallableByPayee(); + uint96 balance = _updateTransmitterBalanceFromPool(from, s_hotVars.totalPremium, uint96(s_transmittersList.length)); + s_transmitters[from].balance = 0; + s_reserveAmounts[IERC20(address(i_link))] = s_reserveAmounts[IERC20(address(i_link))] - balance; + bool transferStatus = i_link.transfer(to, balance); + if (!transferStatus) { + revert TransferFailed(); + } + emit PaymentWithdrawn(from, balance, to, msg.sender); + } + + // ================================================================ + // | OWNER / MANAGER ACTIONS | + // ================================================================ + + /** + * @notice sets the privilege config for an upkeep + */ + function setUpkeepPrivilegeConfig(uint256 upkeepId, bytes calldata newPrivilegeConfig) external { + _onlyPrivilegeManagerAllowed(); + s_upkeepPrivilegeConfig[upkeepId] = newPrivilegeConfig; + emit UpkeepPrivilegeConfigSet(upkeepId, newPrivilegeConfig); + } + + /** + * @notice this is used by the owner to set the initial payees for newly added transmitters. The owner is not allowed to change payees for existing transmitters. + * @dev the IGNORE_ADDRESS is a "helper" that makes it easier to construct a list of payees when you only care about setting the payee for a small number of transmitters. + */ + function setPayees(address[] calldata payees) external onlyOwner { + if (s_transmittersList.length != payees.length) revert ParameterLengthError(); + for (uint256 i = 0; i < s_transmittersList.length; i++) { + address transmitter = s_transmittersList[i]; + address oldPayee = s_transmitterPayees[transmitter]; + address newPayee = payees[i]; + + if ( + (newPayee == ZERO_ADDRESS) || (oldPayee != ZERO_ADDRESS && oldPayee != newPayee && newPayee != IGNORE_ADDRESS) + ) { + revert InvalidPayee(); + } + + if (newPayee != IGNORE_ADDRESS) { + s_transmitterPayees[transmitter] = newPayee; + } + } + emit PayeesUpdated(s_transmittersList, payees); + } + + /** + * @notice sets the migration permission for a peer registry + * @dev this must be done before upkeeps can be migrated to/from another registry + */ + function setPeerRegistryMigrationPermission(address peer, MigrationPermission permission) external onlyOwner { + s_peerRegistryMigrationPermission[peer] = permission; + } + + /** + * @notice pauses the entire registry + */ + function pause() external onlyOwner { + s_hotVars.paused = true; + emit Paused(msg.sender); + } + + /** + * @notice unpauses the entire registry + */ + function unpause() external onlyOwner { + s_hotVars.paused = false; + emit Unpaused(msg.sender); + } + + /** + * @notice sets a generic bytes field used to indicate the privilege that this admin address had + * @param admin the address to set privilege for + * @param newPrivilegeConfig the privileges that this admin has + */ + function setAdminPrivilegeConfig(address admin, bytes calldata newPrivilegeConfig) external { + _onlyPrivilegeManagerAllowed(); + s_adminPrivilegeConfig[admin] = newPrivilegeConfig; + emit AdminPrivilegeConfigSet(admin, newPrivilegeConfig); + } + + /** + * @notice settles NOPs' LINK payment offchain + */ + function settleNOPsOffchain() external { + _onlyFinanceAdminAllowed(); + if (s_payoutMode == PayoutMode.ON_CHAIN) revert MustSettleOnchain(); + + uint96 totalPremium = s_hotVars.totalPremium; + uint256 activeTransmittersLength = s_transmittersList.length; + uint256 deactivatedTransmittersLength = s_deactivatedTransmitters.length(); + uint256 length = activeTransmittersLength + deactivatedTransmittersLength; + uint256[] memory payments = new uint256[](length); + address[] memory payees = new address[](length); + + for (uint256 i = 0; i < activeTransmittersLength; i++) { + address transmitterAddr = s_transmittersList[i]; + uint96 balance = _updateTransmitterBalanceFromPool( + transmitterAddr, + totalPremium, + uint96(activeTransmittersLength) + ); + + payments[i] = balance; + payees[i] = s_transmitterPayees[transmitterAddr]; + s_transmitters[transmitterAddr].balance = 0; + } + + for (uint256 i = 0; i < deactivatedTransmittersLength; i++) { + address deactivatedAddr = s_deactivatedTransmitters.at(i); + Transmitter memory transmitter = s_transmitters[deactivatedAddr]; + + payees[i + activeTransmittersLength] = s_transmitterPayees[deactivatedAddr]; + payments[i + activeTransmittersLength] = transmitter.balance; + s_transmitters[deactivatedAddr].balance = 0; + } + + // reserve amount of LINK is reset to 0 since no user deposits of LINK are expected in offchain mode + s_reserveAmounts[IERC20(address(i_link))] = 0; + + for (uint256 idx = s_deactivatedTransmitters.length(); idx > 0; idx--) { + s_deactivatedTransmitters.remove(s_deactivatedTransmitters.at(idx - 1)); + } + + emit NOPsSettledOffchain(payees, payments); + } + + /** + * @notice disables offchain payment for NOPs + */ + function disableOffchainPayments() external onlyOwner { + s_payoutMode = PayoutMode.ON_CHAIN; + } + + // ================================================================ + // | GETTERS | + // ================================================================ + + function getConditionalGasOverhead() external pure returns (uint256) { + return REGISTRY_CONDITIONAL_OVERHEAD; + } + + function getLogGasOverhead() external pure returns (uint256) { + return REGISTRY_LOG_OVERHEAD; + } + + function getPerSignerGasOverhead() external pure returns (uint256) { + return REGISTRY_PER_SIGNER_GAS_OVERHEAD; + } + + function getCancellationDelay() external pure returns (uint256) { + return CANCELLATION_DELAY; + } + + function getLinkAddress() external view returns (address) { + return address(i_link); + } + + function getLinkUSDFeedAddress() external view returns (address) { + return address(i_linkUSDFeed); + } + + function getNativeUSDFeedAddress() external view returns (address) { + return address(i_nativeUSDFeed); + } + + function getFastGasFeedAddress() external view returns (address) { + return address(i_fastGasFeed); + } + + function getAutomationForwarderLogic() external view returns (address) { + return i_automationForwarderLogic; + } + + function getAllowedReadOnlyAddress() external view returns (address) { + return i_allowedReadOnlyAddress; + } + + function getWrappedNativeTokenAddress() external view returns (address) { + return address(i_wrappedNativeToken); + } + + function getBillingToken(uint256 upkeepID) external view returns (IERC20) { + return s_upkeep[upkeepID].billingToken; + } + + function getBillingTokens() external view returns (IERC20[] memory) { + return s_billingTokens; + } + + function supportsBillingToken(IERC20 token) external view returns (bool) { + return address(s_billingConfigs[token].priceFeed) != address(0); + } + + function getBillingTokenConfig(IERC20 token) external view returns (BillingConfig memory) { + return s_billingConfigs[token]; + } + + function getBillingOverridesEnabled(uint256 upkeepID) external view returns (bool) { + return s_upkeep[upkeepID].overridesEnabled; + } + + function getPayoutMode() external view returns (PayoutMode) { + return s_payoutMode; + } + + function upkeepVersion() public pure returns (uint8) { + return UPKEEP_VERSION_BASE; + } + + /** + * @notice gets the number of upkeeps on the registry + */ + function getNumUpkeeps() external view returns (uint256) { + return s_upkeepIDs.length(); + } + + /** + * @notice read all of the details about an upkeep + * @dev this function may be deprecated in a future version of automation in favor of individual + * getters for each field + */ + function getUpkeep(uint256 id) external view returns (IAutomationV21PlusCommon.UpkeepInfoLegacy memory upkeepInfo) { + Upkeep memory reg = s_upkeep[id]; + address target = address(reg.forwarder) == address(0) ? address(0) : reg.forwarder.getTarget(); + upkeepInfo = IAutomationV21PlusCommon.UpkeepInfoLegacy({ + target: target, + performGas: reg.performGas, + checkData: s_checkData[id], + balance: reg.balance, + admin: s_upkeepAdmin[id], + maxValidBlocknumber: reg.maxValidBlocknumber, + lastPerformedBlockNumber: reg.lastPerformedBlockNumber, + amountSpent: uint96(reg.amountSpent), // force casting to uint96 for backwards compatibility. Not an issue if it overflows. + paused: reg.paused, + offchainConfig: s_upkeepOffchainConfig[id] + }); + return upkeepInfo; + } + + /** + * @notice retrieve active upkeep IDs. Active upkeep is defined as an upkeep which is not paused and not canceled. + * @param startIndex starting index in list + * @param maxCount max count to retrieve (0 = unlimited) + * @dev the order of IDs in the list is **not guaranteed**, therefore, if making successive calls, one + * should consider keeping the blockheight constant to ensure a holistic picture of the contract state + */ + function getActiveUpkeepIDs(uint256 startIndex, uint256 maxCount) external view returns (uint256[] memory) { + uint256 numUpkeeps = s_upkeepIDs.length(); + if (startIndex >= numUpkeeps) revert IndexOutOfRange(); + uint256 endIndex = startIndex + maxCount; + endIndex = endIndex > numUpkeeps || maxCount == 0 ? numUpkeeps : endIndex; + uint256[] memory ids = new uint256[](endIndex - startIndex); + for (uint256 idx = 0; idx < ids.length; idx++) { + ids[idx] = s_upkeepIDs.at(idx + startIndex); + } + return ids; + } + + /** + * @notice returns the upkeep's trigger type + */ + function getTriggerType(uint256 upkeepId) external pure returns (Trigger) { + return _getTriggerType(upkeepId); + } + + /** + * @notice returns the trigger config for an upkeeep + */ + function getUpkeepTriggerConfig(uint256 upkeepId) public view returns (bytes memory) { + return s_upkeepTriggerConfig[upkeepId]; + } + + /** + * @notice read the current info about any transmitter address + */ + function getTransmitterInfo( + address query + ) external view returns (bool active, uint8 index, uint96 balance, uint96 lastCollected, address payee) { + Transmitter memory transmitter = s_transmitters[query]; + + uint96 pooledShare = 0; + if (transmitter.active) { + uint96 totalDifference = s_hotVars.totalPremium - transmitter.lastCollected; + pooledShare = totalDifference / uint96(s_transmittersList.length); + } + + return ( + transmitter.active, + transmitter.index, + (transmitter.balance + pooledShare), + transmitter.lastCollected, + s_transmitterPayees[query] + ); + } + + /** + * @notice read the current info about any signer address + */ + function getSignerInfo(address query) external view returns (bool active, uint8 index) { + Signer memory signer = s_signers[query]; + return (signer.active, signer.index); + } + + /** + * @notice read the current on-chain config of the registry + * @dev this function will change between versions, it should never be used where + * backwards compatibility matters! + */ + function getConfig() external view returns (OnchainConfig memory) { + return + OnchainConfig({ + checkGasLimit: s_storage.checkGasLimit, + stalenessSeconds: s_hotVars.stalenessSeconds, + gasCeilingMultiplier: s_hotVars.gasCeilingMultiplier, + maxPerformGas: s_storage.maxPerformGas, + maxCheckDataSize: s_storage.maxCheckDataSize, + maxPerformDataSize: s_storage.maxPerformDataSize, + maxRevertDataSize: s_storage.maxRevertDataSize, + fallbackGasPrice: s_fallbackGasPrice, + fallbackLinkPrice: s_fallbackLinkPrice, + fallbackNativePrice: s_fallbackNativePrice, + transcoder: s_storage.transcoder, + registrars: s_registrars.values(), + upkeepPrivilegeManager: s_storage.upkeepPrivilegeManager, + chainModule: s_hotVars.chainModule, + reorgProtectionEnabled: s_hotVars.reorgProtectionEnabled, + financeAdmin: s_storage.financeAdmin + }); + } + + /** + * @notice read the current state of the registry + * @dev this function is deprecated + */ + function getState() + external + view + returns ( + IAutomationV21PlusCommon.StateLegacy memory state, + IAutomationV21PlusCommon.OnchainConfigLegacy memory config, + address[] memory signers, + address[] memory transmitters, + uint8 f + ) + { + state = IAutomationV21PlusCommon.StateLegacy({ + nonce: s_storage.nonce, + ownerLinkBalance: 0, // deprecated + expectedLinkBalance: 0, // deprecated + totalPremium: s_hotVars.totalPremium, + numUpkeeps: s_upkeepIDs.length(), + configCount: s_storage.configCount, + latestConfigBlockNumber: s_storage.latestConfigBlockNumber, + latestConfigDigest: s_latestConfigDigest, + latestEpoch: s_hotVars.latestEpoch, + paused: s_hotVars.paused + }); + + config = IAutomationV21PlusCommon.OnchainConfigLegacy({ + paymentPremiumPPB: 0, // deprecated + flatFeeMicroLink: 0, // deprecated + checkGasLimit: s_storage.checkGasLimit, + stalenessSeconds: s_hotVars.stalenessSeconds, + gasCeilingMultiplier: s_hotVars.gasCeilingMultiplier, + minUpkeepSpend: 0, // deprecated + maxPerformGas: s_storage.maxPerformGas, + maxCheckDataSize: s_storage.maxCheckDataSize, + maxPerformDataSize: s_storage.maxPerformDataSize, + maxRevertDataSize: s_storage.maxRevertDataSize, + fallbackGasPrice: s_fallbackGasPrice, + fallbackLinkPrice: s_fallbackLinkPrice, + transcoder: s_storage.transcoder, + registrars: s_registrars.values(), + upkeepPrivilegeManager: s_storage.upkeepPrivilegeManager + }); + + return (state, config, s_signersList, s_transmittersList, s_hotVars.f); + } + + /** + * @notice read the Storage data + * @dev this function signature will change with each version of automation + * this should not be treated as a stable function + */ + function getStorage() external view returns (Storage memory) { + return s_storage; + } + + /** + * @notice read the HotVars data + * @dev this function signature will change with each version of automation + * this should not be treated as a stable function + */ + function getHotVars() external view returns (HotVars memory) { + return s_hotVars; + } + + /** + * @notice get the chain module + */ + function getChainModule() external view returns (IChainModule chainModule) { + return s_hotVars.chainModule; + } + + /** + * @notice if this registry has reorg protection enabled + */ + function getReorgProtectionEnabled() external view returns (bool reorgProtectionEnabled) { + return s_hotVars.reorgProtectionEnabled; + } + + /** + * @notice calculates the minimum balance required for an upkeep to remain eligible + * @param id the upkeep id to calculate minimum balance for + */ + function getBalance(uint256 id) external view returns (uint96 balance) { + return s_upkeep[id].balance; + } + + /** + * @notice calculates the minimum balance required for an upkeep to remain eligible + * @param id the upkeep id to calculate minimum balance for + */ + function getMinBalance(uint256 id) external view returns (uint96) { + return getMinBalanceForUpkeep(id); + } + + /** + * @notice calculates the minimum balance required for an upkeep to remain eligible + * @param id the upkeep id to calculate minimum balance for + * @dev this will be deprecated in a future version in favor of getMinBalance + */ + function getMinBalanceForUpkeep(uint256 id) public view returns (uint96 minBalance) { + Upkeep memory upkeep = s_upkeep[id]; + return getMaxPaymentForGas(id, _getTriggerType(id), upkeep.performGas, upkeep.billingToken); + } + + /** + * @notice calculates the maximum payment for a given gas limit + * @param gasLimit the gas to calculate payment for + */ + function getMaxPaymentForGas( + uint256 id, + Trigger triggerType, + uint32 gasLimit, + IERC20 billingToken + ) public view returns (uint96 maxPayment) { + HotVars memory hotVars = s_hotVars; + (uint256 fastGasWei, uint256 linkUSD, uint256 nativeUSD) = _getFeedData(hotVars); + return _getMaxPayment(id, hotVars, triggerType, gasLimit, fastGasWei, linkUSD, nativeUSD, billingToken); + } + + /** + * @notice retrieves the migration permission for a peer registry + */ + function getPeerRegistryMigrationPermission(address peer) external view returns (MigrationPermission) { + return s_peerRegistryMigrationPermission[peer]; + } + + /** + * @notice returns the upkeep privilege config + */ + function getUpkeepPrivilegeConfig(uint256 upkeepId) external view returns (bytes memory) { + return s_upkeepPrivilegeConfig[upkeepId]; + } + + /** + * @notice returns the admin's privilege config + */ + function getAdminPrivilegeConfig(address admin) external view returns (bytes memory) { + return s_adminPrivilegeConfig[admin]; + } + + /** + * @notice returns the upkeep's forwarder contract + */ + function getForwarder(uint256 upkeepID) external view returns (IAutomationForwarder) { + return s_upkeep[upkeepID].forwarder; + } + + /** + * @notice returns if the dedupKey exists or not + */ + function hasDedupKey(bytes32 dedupKey) external view returns (bool) { + return s_dedupKeys[dedupKey]; + } + + /** + * @notice returns the fallback native price + */ + function getFallbackNativePrice() external view returns (uint256) { + return s_fallbackNativePrice; + } + + /** + * @notice returns the amount of a particular token that is reserved as + * user deposits / NOP payments + */ + function getReserveAmount(IERC20 billingToken) external view returns (uint256) { + return s_reserveAmounts[billingToken]; + } + + /** + * @notice returns the amount of a particular token that is withdraw-able by finance admin + */ + function getAvailableERC20ForPayment(IERC20 billingToken) external view returns (uint256) { + return billingToken.balanceOf(address(this)) - s_reserveAmounts[IERC20(address(billingToken))]; + } + + /** + * @notice returns the size of the LINK liquidity pool + */ + function linkAvailableForPayment() public view returns (int256) { + return _linkAvailableForPayment(); + } + + /** + * @notice returns the BillingOverrides config for a given upkeep + */ + function getBillingOverrides(uint256 upkeepID) external view returns (BillingOverrides memory) { + return s_billingOverrides[upkeepID]; + } + + /** + * @notice returns the BillingConfig for a given billing token, this includes decimals and price feed etc + */ + function getBillingConfig(IERC20 billingToken) external view returns (BillingConfig memory) { + return s_billingConfigs[billingToken]; + } + + /** + * @notice returns all active transmitters with their associated payees + */ + function getTransmittersWithPayees() external view returns (TransmitterPayeeInfo[] memory) { + uint256 transmitterCount = s_transmittersList.length; + TransmitterPayeeInfo[] memory transmitters = new TransmitterPayeeInfo[](transmitterCount); + + for (uint256 i = 0; i < transmitterCount; i++) { + address transmitterAddress = s_transmittersList[i]; + address payeeAddress = s_transmitterPayees[transmitterAddress]; + + transmitters[i] = TransmitterPayeeInfo(transmitterAddress, payeeAddress); + } + + return transmitters; + } +} diff --git a/contracts/src/v0.8/ccip/ARMProxy.sol b/contracts/src/v0.8/ccip/ARMProxy.sol new file mode 100644 index 00000000000..e9ccde8680b --- /dev/null +++ b/contracts/src/v0.8/ccip/ARMProxy.sol @@ -0,0 +1,74 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {ITypeAndVersion} from "../shared/interfaces/ITypeAndVersion.sol"; + +import {OwnerIsCreator} from "./../shared/access/OwnerIsCreator.sol"; + +/// @notice The ARMProxy serves to allow CCIP contracts +/// to point to a static address for ARM queries, which saves gas +/// since each contract need not store an ARM address in storage. That way +/// we can add ARM queries along many code paths for increased defense in depth +/// with minimal additional cost. +contract ARMProxy is OwnerIsCreator, ITypeAndVersion { + error ZeroAddressNotAllowed(); + + event ARMSet(address arm); + + // STATIC CONFIG + // solhint-disable-next-line chainlink-solidity/all-caps-constant-storage-variables + string public constant override typeAndVersion = "ARMProxy 1.0.0"; + + // DYNAMIC CONFIG + address private s_arm; + + constructor(address arm) { + setARM(arm); + } + + /// @notice SetARM sets the ARM implementation contract address. + /// @param arm The address of the arm implementation contract. + function setARM(address arm) public onlyOwner { + if (arm == address(0)) revert ZeroAddressNotAllowed(); + s_arm = arm; + emit ARMSet(arm); + } + + /// @notice getARM gets the ARM implementation contract address. + /// @return arm The address of the arm implementation contract. + function getARM() external view returns (address) { + return s_arm; + } + + // We use a fallback function instead of explicit implementations of the functions + // defined in IRMN.sol to preserve compatibility with future additions to the IRMN + // interface. Calling IRMN interface methods in ARMProxy should be transparent, i.e. + // their input/output behaviour should be identical to calling the proxied s_arm + // contract directly. (If s_arm doesn't point to a contract, we always revert.) + // solhint-disable-next-line payable-fallback, no-complex-fallback + fallback() external { + address arm = s_arm; + // solhint-disable-next-line no-inline-assembly + assembly { + // Revert if no contract present at destination address, otherwise call + // might succeed unintentionally. + if iszero(extcodesize(arm)) { revert(0, 0) } + // We use memory starting at zero, overwriting anything that might already + // be stored there. This messes with Solidity's expectations around memory + // layout, but it's fine because we always exit execution of this contract + // inside this assembly block, i.e. we don't cede control to code generated + // by the Solidity compiler that might have expectations around memory + // layout. + // Copy calldatasize() bytes from calldata offset 0 to memory offset 0. + calldatacopy(0, 0, calldatasize()) + // Call the underlying ARM implementation. out and outsize are 0 because + // we don't know the size yet. We hardcode value to zero. + let success := call(gas(), arm, 0, 0, calldatasize(), 0, 0) + // Copy the returned data. + returndatacopy(0, 0, returndatasize()) + // Pass through successful return or revert and associated data. + if success { return(0, returndatasize()) } + revert(0, returndatasize()) + } + } +} diff --git a/contracts/src/v0.8/ccip/AggregateRateLimiter.sol b/contracts/src/v0.8/ccip/AggregateRateLimiter.sol new file mode 100644 index 00000000000..7401df2ed49 --- /dev/null +++ b/contracts/src/v0.8/ccip/AggregateRateLimiter.sol @@ -0,0 +1,92 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {IPriceRegistry} from "./interfaces/IPriceRegistry.sol"; + +import {OwnerIsCreator} from "./../shared/access/OwnerIsCreator.sol"; +import {Client} from "./libraries/Client.sol"; +import {RateLimiter} from "./libraries/RateLimiter.sol"; +import {USDPriceWith18Decimals} from "./libraries/USDPriceWith18Decimals.sol"; + +/// @notice The aggregate rate limiter is a wrapper of the token bucket rate limiter +/// which permits rate limiting based on the aggregate value of a group of +/// token transfers, using a price registry to convert to a numeraire asset (e.g. USD). +contract AggregateRateLimiter is OwnerIsCreator { + using RateLimiter for RateLimiter.TokenBucket; + using USDPriceWith18Decimals for uint224; + + error PriceNotFoundForToken(address token); + + event AdminSet(address newAdmin); + + // The address of the token limit admin that has the same permissions as the owner. + address internal s_admin; + + // The token bucket object that contains the bucket state. + RateLimiter.TokenBucket private s_rateLimiter; + + /// @param config The RateLimiter.Config + constructor(RateLimiter.Config memory config) { + s_rateLimiter = RateLimiter.TokenBucket({ + rate: config.rate, + capacity: config.capacity, + tokens: config.capacity, + lastUpdated: uint32(block.timestamp), + isEnabled: config.isEnabled + }); + } + + /// @notice Consumes value from the rate limiter bucket based on the token value given. + function _rateLimitValue(uint256 value) internal { + s_rateLimiter._consume(value, address(0)); + } + + function _getTokenValue( + Client.EVMTokenAmount memory tokenAmount, + IPriceRegistry priceRegistry + ) internal view returns (uint256) { + // not fetching validated price, as price staleness is not important for value-based rate limiting + // we only need to verify the price is not 0 + uint224 pricePerToken = priceRegistry.getTokenPrice(tokenAmount.token).value; + if (pricePerToken == 0) revert PriceNotFoundForToken(tokenAmount.token); + return pricePerToken._calcUSDValueFromTokenAmount(tokenAmount.amount); + } + + /// @notice Gets the token bucket with its values for the block it was requested at. + /// @return The token bucket. + function currentRateLimiterState() external view returns (RateLimiter.TokenBucket memory) { + return s_rateLimiter._currentTokenBucketState(); + } + + /// @notice Sets the rate limited config. + /// @param config The new rate limiter config. + /// @dev should only be callable by the owner or token limit admin. + function setRateLimiterConfig(RateLimiter.Config memory config) external onlyAdminOrOwner { + s_rateLimiter._setTokenBucketConfig(config); + } + + // ================================================================ + // │ Access │ + // ================================================================ + + /// @notice Gets the token limit admin address. + /// @return the token limit admin address. + function getTokenLimitAdmin() external view returns (address) { + return s_admin; + } + + /// @notice Sets the token limit admin address. + /// @param newAdmin the address of the new admin. + /// @dev setting this to address(0) indicates there is no active admin. + function setAdmin(address newAdmin) external onlyAdminOrOwner { + s_admin = newAdmin; + emit AdminSet(newAdmin); + } + + /// @notice a modifier that allows the owner or the s_tokenLimitAdmin call the functions + /// it is applied to. + modifier onlyAdminOrOwner() { + if (msg.sender != owner() && msg.sender != s_admin) revert RateLimiter.OnlyCallableByAdminOrOwner(); + _; + } +} diff --git a/contracts/src/v0.8/ccip/CommitStore.sol b/contracts/src/v0.8/ccip/CommitStore.sol new file mode 100644 index 00000000000..77c2864d4fe --- /dev/null +++ b/contracts/src/v0.8/ccip/CommitStore.sol @@ -0,0 +1,314 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {ITypeAndVersion} from "../shared/interfaces/ITypeAndVersion.sol"; +import {ICommitStore} from "./interfaces/ICommitStore.sol"; +import {IPriceRegistry} from "./interfaces/IPriceRegistry.sol"; +import {IRMN} from "./interfaces/IRMN.sol"; + +import {Internal} from "./libraries/Internal.sol"; +import {MerkleMultiProof} from "./libraries/MerkleMultiProof.sol"; +import {OCR2Base} from "./ocr/OCR2Base.sol"; + +contract CommitStore is ICommitStore, ITypeAndVersion, OCR2Base { + error StaleReport(); + error PausedError(); + error InvalidInterval(Interval interval); + error InvalidRoot(); + error InvalidCommitStoreConfig(); + error CursedByRMN(); + error RootAlreadyCommitted(); + + event Paused(address account); + event Unpaused(address account); + /// @dev RMN depends on this event, if changing, please notify the RMN maintainers. + event ReportAccepted(CommitReport report); + event ConfigSet(StaticConfig staticConfig, DynamicConfig dynamicConfig); + event RootRemoved(bytes32 root); + event SequenceNumberSet(uint64 oldSeqNum, uint64 newSeqNum); + event LatestPriceEpochAndRoundSet(uint40 oldEpochAndRound, uint40 newEpochAndRound); + + /// @notice Static commit store config + /// @dev RMN depends on this struct, if changing, please notify the RMN maintainers. + //solhint-disable gas-struct-packing + struct StaticConfig { + uint64 chainSelector; // ───────╮ Destination chainSelector + uint64 sourceChainSelector; // ─╯ Source chainSelector + address onRamp; // OnRamp address on the source chain + address rmnProxy; // RMN proxy address + } + + /// @notice Dynamic commit store config + struct DynamicConfig { + address priceRegistry; // Price registry address on the destination chain + } + + /// @notice a sequenceNumber interval + /// @dev RMN depends on this struct, if changing, please notify the RMN maintainers. + struct Interval { + uint64 min; // ───╮ Minimum sequence number, inclusive + uint64 max; // ───╯ Maximum sequence number, inclusive + } + + /// @notice Report that is committed by the observing DON at the committing phase + /// @dev RMN depends on this struct, if changing, please notify the RMN maintainers. + struct CommitReport { + Internal.PriceUpdates priceUpdates; + Interval interval; + bytes32 merkleRoot; + } + + // STATIC CONFIG + string public constant override typeAndVersion = "CommitStore 1.5.0"; + // Chain ID of this chain + uint64 internal immutable i_chainSelector; + // Chain ID of the source chain + uint64 internal immutable i_sourceChainSelector; + // The onRamp address on the source chain + address internal immutable i_onRamp; + // The address of the rmn proxy + address internal immutable i_rmnProxy; + + // DYNAMIC CONFIG + // The dynamic commitStore config + DynamicConfig internal s_dynamicConfig; + + // STATE + // The min sequence number expected for future messages + uint64 private s_minSeqNr = 1; + /// @dev The epoch and round of the last report + uint40 private s_latestPriceEpochAndRound; + /// @dev Whether this CommitStore is paused or not + bool private s_paused = false; + // merkleRoot => timestamp when received + mapping(bytes32 merkleRoot => uint256 timestamp) private s_roots; + + /// @param staticConfig Containing the static part of the commitStore config + /// @dev When instantiating OCR2Base we set UNIQUE_REPORTS to false, which means + /// that we do not require 2f+1 signatures on a report, only f+1 to save gas. 2f+1 is required + /// only if one must strictly ensure that for a given round there is only one valid report ever generated by + /// the DON. In our case additional valid reports (i.e. approved by >= f+1 oracles) are not a problem, as they will + /// will either be ignored (reverted as an invalid interval) or will be accepted as an additional valid price update. + constructor(StaticConfig memory staticConfig) OCR2Base(false) { + if ( + staticConfig.onRamp == address(0) || staticConfig.chainSelector == 0 || staticConfig.sourceChainSelector == 0 + || staticConfig.rmnProxy == address(0) + ) revert InvalidCommitStoreConfig(); + + i_chainSelector = staticConfig.chainSelector; + i_sourceChainSelector = staticConfig.sourceChainSelector; + i_onRamp = staticConfig.onRamp; + i_rmnProxy = staticConfig.rmnProxy; + } + + // ================================================================ + // │ Verification │ + // ================================================================ + + /// @notice Returns the next expected sequence number. + /// @return the next expected sequenceNumber. + function getExpectedNextSequenceNumber() external view returns (uint64) { + return s_minSeqNr; + } + + /// @notice Sets the minimum sequence number. + /// @param minSeqNr The new minimum sequence number. + function setMinSeqNr(uint64 minSeqNr) external onlyOwner { + uint64 oldSeqNum = s_minSeqNr; + + s_minSeqNr = minSeqNr; + + emit SequenceNumberSet(oldSeqNum, minSeqNr); + } + + /// @notice Returns the epoch and round of the last price update. + /// @return the latest price epoch and round. + function getLatestPriceEpochAndRound() external view returns (uint64) { + return s_latestPriceEpochAndRound; + } + + /// @notice Sets the latest epoch and round for price update. + /// @param latestPriceEpochAndRound The new epoch and round for prices. + function setLatestPriceEpochAndRound(uint40 latestPriceEpochAndRound) external onlyOwner { + uint40 oldEpochAndRound = s_latestPriceEpochAndRound; + + s_latestPriceEpochAndRound = latestPriceEpochAndRound; + + emit LatestPriceEpochAndRoundSet(oldEpochAndRound, latestPriceEpochAndRound); + } + + /// @notice Returns the timestamp of a potentially previously committed merkle root. + /// If the root was never committed 0 will be returned. + /// @param root The merkle root to check the commit status for. + /// @return the timestamp of the committed root or zero in the case that it was never + /// committed. + function getMerkleRoot(bytes32 root) external view returns (uint256) { + return s_roots[root]; + } + + /// @notice Returns if a root is blessed or not. + /// @param root The merkle root to check the blessing status for. + /// @return whether the root is blessed or not. + function isBlessed(bytes32 root) public view returns (bool) { + return IRMN(i_rmnProxy).isBlessed(IRMN.TaggedRoot({commitStore: address(this), root: root})); + } + + /// @notice Used by the owner in case an invalid sequence of roots has been + /// posted and needs to be removed. The interval in the report is trusted. + /// @param rootToReset The roots that will be reset. This function will only + /// reset roots that are not blessed. + function resetUnblessedRoots(bytes32[] calldata rootToReset) external onlyOwner { + for (uint256 i = 0; i < rootToReset.length; ++i) { + bytes32 root = rootToReset[i]; + if (!isBlessed(root)) { + delete s_roots[root]; + emit RootRemoved(root); + } + } + } + + /// @inheritdoc ICommitStore + function verify( + bytes32[] calldata hashedLeaves, + bytes32[] calldata proofs, + uint256 proofFlagBits + ) external view override whenNotPaused returns (uint256 timestamp) { + bytes32 root = MerkleMultiProof.merkleRoot(hashedLeaves, proofs, proofFlagBits); + // Only return non-zero if present and blessed. + if (!isBlessed(root)) { + return 0; + } + return s_roots[root]; + } + + /// @inheritdoc OCR2Base + /// @dev A commitReport can have two distinct parts (batched together to amortize the cost of checking sigs): + /// 1. Price updates + /// 2. A merkle root and sequence number interval + /// Both have their own, separate, staleness checks, with price updates using the epoch and round + /// number of the latest price update. The merkle root checks for staleness based on the seqNums. + /// They need to be separate because a price report for round t+2 might be included before a report + /// containing a merkle root for round t+1. This merkle root report for round t+1 is still valid + /// and should not be rejected. When a report with a stale root but valid price updates is submitted, + /// we are OK to revert to preserve the invariant that we always revert on invalid sequence number ranges. + /// If that happens, prices will be updates in later rounds. + function _report(bytes calldata encodedReport, uint40 epochAndRound) internal override whenNotPaused { + if (IRMN(i_rmnProxy).isCursed(bytes16(uint128(i_sourceChainSelector)))) revert CursedByRMN(); + + CommitReport memory report = abi.decode(encodedReport, (CommitReport)); + + // Check if the report contains price updates + if (report.priceUpdates.tokenPriceUpdates.length > 0 || report.priceUpdates.gasPriceUpdates.length > 0) { + // Check for price staleness based on the epoch and round + if (s_latestPriceEpochAndRound < epochAndRound) { + // If prices are not stale, update the latest epoch and round + s_latestPriceEpochAndRound = epochAndRound; + // And update the prices in the price registry + IPriceRegistry(s_dynamicConfig.priceRegistry).updatePrices(report.priceUpdates); + + // If there is no root, the report only contained fee updated and + // we return to not revert on the empty root check below. + if (report.merkleRoot == bytes32(0)) return; + } else { + // If prices are stale and the report doesn't contain a root, this report + // does not have any valid information and we revert. + // If it does contain a merkle root, continue to the root checking section. + if (report.merkleRoot == bytes32(0)) revert StaleReport(); + } + } + + // If we reached this section, the report should contain a valid root + if (s_minSeqNr != report.interval.min || report.interval.min > report.interval.max) { + revert InvalidInterval(report.interval); + } + + if (report.merkleRoot == bytes32(0)) revert InvalidRoot(); + // Disallow duplicate roots as that would reset the timestamp and + // delay potential manual execution. + if (s_roots[report.merkleRoot] != 0) revert RootAlreadyCommitted(); + + s_minSeqNr = report.interval.max + 1; + s_roots[report.merkleRoot] = block.timestamp; + emit ReportAccepted(report); + } + + // ================================================================ + // │ Config │ + // ================================================================ + + /// @notice Returns the static commit store config. + /// @dev RMN depends on this function, if changing, please notify the RMN maintainers. + /// @return the configuration. + function getStaticConfig() external view returns (StaticConfig memory) { + return StaticConfig({ + chainSelector: i_chainSelector, + sourceChainSelector: i_sourceChainSelector, + onRamp: i_onRamp, + rmnProxy: i_rmnProxy + }); + } + + /// @notice Returns the dynamic commit store config. + /// @return the configuration. + function getDynamicConfig() external view returns (DynamicConfig memory) { + return s_dynamicConfig; + } + + /// @notice Sets the dynamic config. This function is called during `setOCR2Config` flow + function _beforeSetConfig(bytes memory onchainConfig) internal override { + DynamicConfig memory dynamicConfig = abi.decode(onchainConfig, (DynamicConfig)); + + if (dynamicConfig.priceRegistry == address(0)) revert InvalidCommitStoreConfig(); + + s_dynamicConfig = dynamicConfig; + // When the OCR config changes, we reset the price epoch and round + // since epoch and rounds are scoped per config digest. + // Note that s_minSeqNr/roots do not need to be reset as the roots persist + // across reconfigurations and are de-duplicated separately. + s_latestPriceEpochAndRound = 0; + + emit ConfigSet( + StaticConfig({ + chainSelector: i_chainSelector, + sourceChainSelector: i_sourceChainSelector, + onRamp: i_onRamp, + rmnProxy: i_rmnProxy + }), + dynamicConfig + ); + } + + // ================================================================ + // │ Access and RMN │ + // ================================================================ + + /// @notice Single function to check the status of the commitStore. + function isUnpausedAndNotCursed() external view returns (bool) { + return !IRMN(i_rmnProxy).isCursed(bytes16(uint128(i_sourceChainSelector))) && !s_paused; + } + + /// @notice Modifier to make a function callable only when the contract is not paused. + modifier whenNotPaused() { + if (paused()) revert PausedError(); + _; + } + + /// @notice Returns true if the contract is paused, and false otherwise. + function paused() public view returns (bool) { + return s_paused; + } + + /// @notice Pause the contract + /// @dev only callable by the owner + function pause() external onlyOwner { + s_paused = true; + emit Paused(msg.sender); + } + + /// @notice Unpause the contract + /// @dev only callable by the owner + function unpause() external onlyOwner { + s_paused = false; + emit Unpaused(msg.sender); + } +} diff --git a/contracts/src/v0.8/ccip/FeeQuoter.sol b/contracts/src/v0.8/ccip/FeeQuoter.sol new file mode 100644 index 00000000000..957d146f45a --- /dev/null +++ b/contracts/src/v0.8/ccip/FeeQuoter.sol @@ -0,0 +1,941 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {ITypeAndVersion} from "../shared/interfaces/ITypeAndVersion.sol"; +import {IFeeQuoter} from "./interfaces/IFeeQuoter.sol"; +import {IPriceRegistry} from "./interfaces/IPriceRegistry.sol"; + +import {AuthorizedCallers} from "../shared/access/AuthorizedCallers.sol"; +import {AggregatorV3Interface} from "./../shared/interfaces/AggregatorV3Interface.sol"; +import {Client} from "./libraries/Client.sol"; +import {Internal} from "./libraries/Internal.sol"; +import {Pool} from "./libraries/Pool.sol"; +import {USDPriceWith18Decimals} from "./libraries/USDPriceWith18Decimals.sol"; + +import {KeystoneFeedsPermissionHandler} from "../keystone/KeystoneFeedsPermissionHandler.sol"; +import {IReceiver} from "../keystone/interfaces/IReceiver.sol"; +import {KeystoneFeedDefaultMetadataLib} from "../keystone/lib/KeystoneFeedDefaultMetadataLib.sol"; +import {EnumerableSet} from "../vendor/openzeppelin-solidity/v5.0.2/contracts/utils/structs/EnumerableSet.sol"; + +/// @notice The FeeQuoter contract responsibility is to: +/// - Store the current gas price in USD for a given destination chain, +/// - Store the price of a token in USD allowing the owner or priceUpdater to update this value. +/// - Manage chain specific fee calculations. +/// The authorized callers in the contract represent the fee price updaters. +contract FeeQuoter is AuthorizedCallers, IFeeQuoter, ITypeAndVersion, IReceiver, KeystoneFeedsPermissionHandler { + using EnumerableSet for EnumerableSet.AddressSet; + using USDPriceWith18Decimals for uint224; + using KeystoneFeedDefaultMetadataLib for bytes; + + error TokenNotSupported(address token); + error FeeTokenNotSupported(address token); + error ChainNotSupported(uint64 chain); + error StaleGasPrice(uint64 destChainSelector, uint256 threshold, uint256 timePassed); + error StaleKeystoneUpdate(address token, uint256 feedTimestamp, uint256 storedTimeStamp); + error DataFeedValueOutOfUint224Range(); + error InvalidDestBytesOverhead(address token, uint32 destBytesOverhead); + error MessageGasLimitTooHigh(); + error DestinationChainNotEnabled(uint64 destChainSelector); + error ExtraArgOutOfOrderExecutionMustBeTrue(); + error InvalidExtraArgsTag(); + error SourceTokenDataTooLarge(address token); + error InvalidDestChainConfig(uint64 destChainSelector); + error MessageFeeTooHigh(uint256 msgFeeJuels, uint256 maxFeeJuelsPerMsg); + error InvalidStaticConfig(); + error MessageTooLarge(uint256 maxSize, uint256 actualSize); + error UnsupportedNumberOfTokens(); + + event FeeTokenAdded(address indexed feeToken); + event FeeTokenRemoved(address indexed feeToken); + event UsdPerUnitGasUpdated(uint64 indexed destChain, uint256 value, uint256 timestamp); + event UsdPerTokenUpdated(address indexed token, uint256 value, uint256 timestamp); + event PriceFeedPerTokenUpdated(address indexed token, IFeeQuoter.TokenPriceFeedConfig priceFeedConfig); + event TokenTransferFeeConfigUpdated( + uint64 indexed destChainSelector, address indexed token, TokenTransferFeeConfig tokenTransferFeeConfig + ); + event TokenTransferFeeConfigDeleted(uint64 indexed destChainSelector, address indexed token); + event PremiumMultiplierWeiPerEthUpdated(address indexed token, uint64 premiumMultiplierWeiPerEth); + event DestChainConfigUpdated(uint64 indexed destChainSelector, DestChainConfig destChainConfig); + event DestChainAdded(uint64 indexed destChainSelector, DestChainConfig destChainConfig); + + /// @notice Token price data feed update + struct TokenPriceFeedUpdate { + address sourceToken; // Source token to update feed for + IFeeQuoter.TokenPriceFeedConfig feedConfig; // Feed config update data + } + + /// @dev Struct that contains the static configuration + /// RMN depends on this struct, if changing, please notify the RMN maintainers. + // solhint-disable-next-line gas-struct-packing + struct StaticConfig { + uint96 maxFeeJuelsPerMsg; // ─╮ Maximum fee that can be charged for a message + address linkToken; // ────────╯ LINK token address + uint32 stalenessThreshold; // The amount of time a gas price can be stale before it is considered invalid. + } + + /// @notice The struct representing the received CCIP feed report from keystone IReceiver.onReport() + struct ReceivedCCIPFeedReport { + address token; // Token address + uint224 price; // ─────────╮ Price of the token in USD with 18 decimals + uint32 timestamp; // ──────╯ Timestamp of the price update + } + + /// @dev Struct to hold the fee & validation configs for a destination chain + struct DestChainConfig { + bool isEnabled; // ──────────────────────────╮ Whether this destination chain is enabled + uint16 maxNumberOfTokensPerMsg; // │ Maximum number of distinct ERC20 token transferred per message + uint32 maxDataBytes; // │ Maximum payload data size in bytes + uint32 maxPerMsgGasLimit; // │ Maximum gas limit for messages targeting EVMs + uint32 destGasOverhead; // │ Gas charged on top of the gasLimit to cover destination chain costs + uint16 destGasPerPayloadByte; // │ Destination chain gas charged for passing each byte of `data` payload to receiver + uint32 destDataAvailabilityOverheadGas; // | Extra data availability gas charged on top of the message, e.g. for OCR + uint16 destGasPerDataAvailabilityByte; // | Amount of gas to charge per byte of message data that needs availability + uint16 destDataAvailabilityMultiplierBps; // │ Multiplier for data availability gas, multiples of bps, or 0.0001 + // The following three properties are defaults, they can be overridden by setting the TokenTransferFeeConfig for a token + uint16 defaultTokenFeeUSDCents; // │ Default token fee charged per token transfer + uint32 defaultTokenDestGasOverhead; // ──────╯ Default gas charged to execute the token transfer on the destination chain + uint32 defaultTxGasLimit; //─────────────────╮ Default gas limit for a tx + uint64 gasMultiplierWeiPerEth; // │ Multiplier for gas costs, 1e18 based so 11e17 = 10% extra cost. + uint32 networkFeeUSDCents; // │ Flat network fee to charge for messages, multiples of 0.01 USD + bool enforceOutOfOrder; // │ Whether to enforce the allowOutOfOrderExecution extraArg value to be true. + bytes4 chainFamilySelector; // ──────────────╯ Selector that identifies the destination chain's family. Used to determine the correct validations to perform for the dest chain. + } + + /// @dev Struct to hold the configs and its destination chain selector + /// Same as DestChainConfig but with the destChainSelector so that an array of these + /// can be passed in the constructor and the applyDestChainConfigUpdates function + //solhint-disable gas-struct-packing + struct DestChainConfigArgs { + uint64 destChainSelector; // Destination chain selector + DestChainConfig destChainConfig; // Config to update for the chain selector + } + + /// @dev Struct to hold the transfer fee configuration for token transfers + struct TokenTransferFeeConfig { + uint32 minFeeUSDCents; // ──────────╮ Minimum fee to charge per token transfer, multiples of 0.01 USD + uint32 maxFeeUSDCents; // │ Maximum fee to charge per token transfer, multiples of 0.01 USD + uint16 deciBps; // │ Basis points charged on token transfers, multiples of 0.1bps, or 1e-5 + uint32 destGasOverhead; // │ Gas charged to execute the token transfer on the destination chain + // │ Extra data availability bytes that are returned from the source pool and sent + uint32 destBytesOverhead; // │ to the destination pool. Must be >= Pool.CCIP_LOCK_OR_BURN_V1_RET_BYTES + bool isEnabled; // ─────────────────╯ Whether this token has custom transfer fees + } + + /// @dev Struct to hold the token transfer fee configurations for a token, same as TokenTransferFeeConfig but with the token address included so + /// that an array of these can be passed in the TokenTransferFeeConfigArgs struct to set the mapping + struct TokenTransferFeeConfigSingleTokenArgs { + address token; // Token address + TokenTransferFeeConfig tokenTransferFeeConfig; // Struct to hold the transfer fee configuration for token transfers + } + + /// @dev Struct to hold the token transfer fee configurations for a destination chain and a set of tokens. Same as TokenTransferFeeConfigSingleTokenArgs + /// but with the destChainSelector and an array of TokenTransferFeeConfigSingleTokenArgs included so that an array of these can be passed in the constructor + /// and the applyTokenTransferFeeConfigUpdates function + struct TokenTransferFeeConfigArgs { + uint64 destChainSelector; // Destination chain selector + TokenTransferFeeConfigSingleTokenArgs[] tokenTransferFeeConfigs; // Array of token transfer fee configurations + } + + /// @dev Struct to hold a pair of destination chain selector and token address so that an array of these can be passed in the + /// applyTokenTransferFeeConfigUpdates function to remove the token transfer fee configuration for a token + struct TokenTransferFeeConfigRemoveArgs { + uint64 destChainSelector; // ─╮ Destination chain selector + address token; // ────────────╯ Token address + } + + /// @dev Struct to hold the fee token configuration for a token, same as the s_premiumMultiplierWeiPerEth but with + /// the token address included so that an array of these can be passed in the constructor and + /// applyPremiumMultiplierWeiPerEthUpdates to set the mapping + struct PremiumMultiplierWeiPerEthArgs { + address token; // // ───────────────────╮ Token address + uint64 premiumMultiplierWeiPerEth; // ──╯ Multiplier for destination chain specific premiums. + } + + string public constant override typeAndVersion = "FeeQuoter 1.6.0-dev"; + + /// @dev The gas price per unit of gas for a given destination chain, in USD with 18 decimals. + /// Multiple gas prices can be encoded into the same value. Each price takes {Internal.GAS_PRICE_BITS} bits. + /// For example, if Optimism is the destination chain, gas price can include L1 base fee and L2 gas price. + /// Logic to parse the price components is chain-specific, and should live in OnRamp. + /// @dev Price of 1e18 is 1 USD. Examples: + /// Very Expensive: 1 unit of gas costs 1 USD -> 1e18 + /// Expensive: 1 unit of gas costs 0.1 USD -> 1e17 + /// Cheap: 1 unit of gas costs 0.000001 USD -> 1e12 + mapping(uint64 destChainSelector => Internal.TimestampedPackedUint224 price) private + s_usdPerUnitGasByDestChainSelector; + + /// @dev The price, in USD with 18 decimals, per 1e18 of the smallest token denomination. + /// @dev Price of 1e18 represents 1 USD per 1e18 token amount. + /// 1 USDC = 1.00 USD per full token, each full token is 1e6 units -> 1 * 1e18 * 1e18 / 1e6 = 1e30 + /// 1 ETH = 2,000 USD per full token, each full token is 1e18 units -> 2000 * 1e18 * 1e18 / 1e18 = 2_000e18 + /// 1 LINK = 5.00 USD per full token, each full token is 1e18 units -> 5 * 1e18 * 1e18 / 1e18 = 5e18 + mapping(address token => Internal.TimestampedPackedUint224 price) private s_usdPerToken; + + /// @dev Stores the price data feed configurations per token. + mapping(address token => IFeeQuoter.TokenPriceFeedConfig dataFeedAddress) private s_usdPriceFeedsPerToken; + + /// @dev The multiplier for destination chain specific premiums that can be set by the owner or fee admin + mapping(address token => uint64 premiumMultiplierWeiPerEth) internal s_premiumMultiplierWeiPerEth; + + /// @dev The destination chain specific fee configs + mapping(uint64 destChainSelector => DestChainConfig destChainConfig) internal s_destChainConfigs; + + /// @dev The token transfer fee config that can be set by the owner or fee admin + mapping(uint64 destChainSelector => mapping(address token => TokenTransferFeeConfig tranferFeeConfig)) internal + s_tokenTransferFeeConfig; + + /// @dev Maximum fee that can be charged for a message. This is a guard to prevent massively overcharging due to misconfiguation. + uint96 internal immutable i_maxFeeJuelsPerMsg; + /// @dev The link token address + address internal immutable i_linkToken; + + /// @dev Subset of tokens which prices tracked by this registry which are fee tokens. + EnumerableSet.AddressSet private s_feeTokens; + /// @dev The amount of time a gas price can be stale before it is considered invalid. + uint32 private immutable i_stalenessThreshold; + + constructor( + StaticConfig memory staticConfig, + address[] memory priceUpdaters, + address[] memory feeTokens, + TokenPriceFeedUpdate[] memory tokenPriceFeeds, + TokenTransferFeeConfigArgs[] memory tokenTransferFeeConfigArgs, + PremiumMultiplierWeiPerEthArgs[] memory premiumMultiplierWeiPerEthArgs, + DestChainConfigArgs[] memory destChainConfigArgs + ) AuthorizedCallers(priceUpdaters) { + if ( + staticConfig.linkToken == address(0) || staticConfig.maxFeeJuelsPerMsg == 0 + || staticConfig.stalenessThreshold == 0 + ) { + revert InvalidStaticConfig(); + } + + i_linkToken = staticConfig.linkToken; + i_maxFeeJuelsPerMsg = staticConfig.maxFeeJuelsPerMsg; + i_stalenessThreshold = staticConfig.stalenessThreshold; + + _applyFeeTokensUpdates(feeTokens, new address[](0)); + _updateTokenPriceFeeds(tokenPriceFeeds); + _applyDestChainConfigUpdates(destChainConfigArgs); + _applyPremiumMultiplierWeiPerEthUpdates(premiumMultiplierWeiPerEthArgs); + _applyTokenTransferFeeConfigUpdates(tokenTransferFeeConfigArgs, new TokenTransferFeeConfigRemoveArgs[](0)); + } + + // ================================================================ + // │ Price calculations │ + // ================================================================ + + /// @inheritdoc IPriceRegistry + function getTokenPrice(address token) public view override returns (Internal.TimestampedPackedUint224 memory) { + IFeeQuoter.TokenPriceFeedConfig memory priceFeedConfig = s_usdPriceFeedsPerToken[token]; + if (priceFeedConfig.dataFeedAddress == address(0)) { + return s_usdPerToken[token]; + } + + return _getTokenPriceFromDataFeed(priceFeedConfig); + } + + /// @inheritdoc IPriceRegistry + function getValidatedTokenPrice(address token) external view override returns (uint224) { + return _getValidatedTokenPrice(token); + } + + /// @inheritdoc IPriceRegistry + function getTokenPrices( + address[] calldata tokens + ) external view override returns (Internal.TimestampedPackedUint224[] memory) { + uint256 length = tokens.length; + Internal.TimestampedPackedUint224[] memory tokenPrices = new Internal.TimestampedPackedUint224[](length); + for (uint256 i = 0; i < length; ++i) { + tokenPrices[i] = getTokenPrice(tokens[i]); + } + return tokenPrices; + } + + /// @inheritdoc IFeeQuoter + function getTokenPriceFeedConfig( + address token + ) external view override returns (IFeeQuoter.TokenPriceFeedConfig memory) { + return s_usdPriceFeedsPerToken[token]; + } + + /// @inheritdoc IPriceRegistry + function getDestinationChainGasPrice( + uint64 destChainSelector + ) external view override returns (Internal.TimestampedPackedUint224 memory) { + return s_usdPerUnitGasByDestChainSelector[destChainSelector]; + } + + /// @inheritdoc IPriceRegistry + function getTokenAndGasPrices( + address token, + uint64 destChainSelector + ) public view override returns (uint224 tokenPrice, uint224 gasPriceValue) { + Internal.TimestampedPackedUint224 memory gasPrice = s_usdPerUnitGasByDestChainSelector[destChainSelector]; + // We do allow a gas price of 0, but no stale or unset gas prices + if (gasPrice.timestamp == 0) revert ChainNotSupported(destChainSelector); + uint256 timePassed = block.timestamp - gasPrice.timestamp; + if (timePassed > i_stalenessThreshold) revert StaleGasPrice(destChainSelector, i_stalenessThreshold, timePassed); + + return (_getValidatedTokenPrice(token), gasPrice.value); + } + + /// @inheritdoc IPriceRegistry + /// @dev this function assumes that no more than 1e59 dollars are sent as payment. + /// If more is sent, the multiplication of feeTokenAmount and feeTokenValue will overflow. + /// Since there isn't even close to 1e59 dollars in the world economy this is safe. + function convertTokenAmount( + address fromToken, + uint256 fromTokenAmount, + address toToken + ) public view override returns (uint256) { + /// Example: + /// fromTokenAmount: 1e18 // 1 ETH + /// ETH: 2_000e18 + /// LINK: 5e18 + /// return: 1e18 * 2_000e18 / 5e18 = 400e18 (400 LINK) + return (fromTokenAmount * _getValidatedTokenPrice(fromToken)) / _getValidatedTokenPrice(toToken); + } + + /// @notice Gets the token price for a given token and reverts if the token is not supported + /// @param token The address of the token to get the price for + /// @return tokenPriceValue The token price + function _getValidatedTokenPrice(address token) internal view returns (uint224) { + Internal.TimestampedPackedUint224 memory tokenPrice = getTokenPrice(token); + // Token price must be set at least once + if (tokenPrice.timestamp == 0 || tokenPrice.value == 0) revert TokenNotSupported(token); + return tokenPrice.value; + } + + /// @notice Gets the token price from a data feed address, rebased to the same units as s_usdPerToken + /// @param priceFeedConfig token data feed configuration with valid data feed address (used to retrieve price & timestamp) + /// @return tokenPrice data feed price answer rebased to s_usdPerToken units, with latest block timestamp + function _getTokenPriceFromDataFeed( + IFeeQuoter.TokenPriceFeedConfig memory priceFeedConfig + ) internal view returns (Internal.TimestampedPackedUint224 memory tokenPrice) { + AggregatorV3Interface dataFeedContract = AggregatorV3Interface(priceFeedConfig.dataFeedAddress); + ( + /* uint80 roundID */ + , + int256 dataFeedAnswer, + /* uint startedAt */ + , + /* uint256 updatedAt */ + , + /* uint80 answeredInRound */ + ) = dataFeedContract.latestRoundData(); + + if (dataFeedAnswer < 0) { + revert DataFeedValueOutOfUint224Range(); + } + uint224 rebasedValue = + _calculateRebasedValue(dataFeedContract.decimals(), priceFeedConfig.tokenDecimals, uint256(dataFeedAnswer)); + + // Data feed staleness is unchecked to decouple the FeeQuoter from data feed delay issues + return Internal.TimestampedPackedUint224({value: rebasedValue, timestamp: uint32(block.timestamp)}); + } + + // ================================================================ + // │ Fee tokens │ + // ================================================================ + + /// @inheritdoc IPriceRegistry + function getFeeTokens() external view returns (address[] memory) { + return s_feeTokens.values(); + } + + /// @notice Add and remove tokens from feeTokens set. + /// @param feeTokensToRemove The addresses of the tokens which are no longer considered feeTokens. + /// @param feeTokensToAdd The addresses of the tokens which are now considered fee tokens + /// and can be used to calculate fees. + function applyFeeTokensUpdates( + address[] memory feeTokensToAdd, + address[] memory feeTokensToRemove + ) external onlyOwner { + _applyFeeTokensUpdates(feeTokensToAdd, feeTokensToRemove); + } + + /// @notice Add and remove tokens from feeTokens set. + /// @param feeTokensToRemove The addresses of the tokens which are no longer considered feeTokens. + /// @param feeTokensToAdd The addresses of the tokens which are now considered fee tokens + /// and can be used to calculate fees. + function _applyFeeTokensUpdates(address[] memory feeTokensToAdd, address[] memory feeTokensToRemove) private { + for (uint256 i = 0; i < feeTokensToAdd.length; ++i) { + if (s_feeTokens.add(feeTokensToAdd[i])) { + emit FeeTokenAdded(feeTokensToAdd[i]); + } + } + for (uint256 i = 0; i < feeTokensToRemove.length; ++i) { + if (s_feeTokens.remove(feeTokensToRemove[i])) { + emit FeeTokenRemoved(feeTokensToRemove[i]); + } + } + } + + // ================================================================ + // │ Price updates │ + // ================================================================ + + /// @inheritdoc IPriceRegistry + function updatePrices(Internal.PriceUpdates calldata priceUpdates) external override { + // The caller must be the fee updater + _validateCaller(); + + uint256 tokenUpdatesLength = priceUpdates.tokenPriceUpdates.length; + + for (uint256 i = 0; i < tokenUpdatesLength; ++i) { + Internal.TokenPriceUpdate memory update = priceUpdates.tokenPriceUpdates[i]; + s_usdPerToken[update.sourceToken] = + Internal.TimestampedPackedUint224({value: update.usdPerToken, timestamp: uint32(block.timestamp)}); + emit UsdPerTokenUpdated(update.sourceToken, update.usdPerToken, block.timestamp); + } + + uint256 gasUpdatesLength = priceUpdates.gasPriceUpdates.length; + + for (uint256 i = 0; i < gasUpdatesLength; ++i) { + Internal.GasPriceUpdate memory update = priceUpdates.gasPriceUpdates[i]; + s_usdPerUnitGasByDestChainSelector[update.destChainSelector] = + Internal.TimestampedPackedUint224({value: update.usdPerUnitGas, timestamp: uint32(block.timestamp)}); + emit UsdPerUnitGasUpdated(update.destChainSelector, update.usdPerUnitGas, block.timestamp); + } + } + + /// @notice Updates the USD token price feeds for given tokens + /// @param tokenPriceFeedUpdates Token price feed updates to apply + function updateTokenPriceFeeds(TokenPriceFeedUpdate[] memory tokenPriceFeedUpdates) external onlyOwner { + _updateTokenPriceFeeds(tokenPriceFeedUpdates); + } + + /// @notice Updates the USD token price feeds for given tokens + /// @param tokenPriceFeedUpdates Token price feed updates to apply + function _updateTokenPriceFeeds(TokenPriceFeedUpdate[] memory tokenPriceFeedUpdates) private { + for (uint256 i; i < tokenPriceFeedUpdates.length; ++i) { + TokenPriceFeedUpdate memory update = tokenPriceFeedUpdates[i]; + address sourceToken = update.sourceToken; + IFeeQuoter.TokenPriceFeedConfig memory tokenPriceFeedConfig = update.feedConfig; + + s_usdPriceFeedsPerToken[sourceToken] = tokenPriceFeedConfig; + emit PriceFeedPerTokenUpdated(sourceToken, tokenPriceFeedConfig); + } + } + + /// @notice Handles the report containing price feeds and updates the internal price storage + /// @inheritdoc IReceiver + /// @dev This function is called to process incoming price feed data. + /// @param metadata Arbitrary metadata associated with the report (not used in this implementation). + /// @param report Encoded report containing an array of `ReceivedCCIPFeedReport` structs. + function onReport(bytes calldata metadata, bytes calldata report) external { + (bytes10 workflowName, address workflowOwner, bytes2 reportName) = metadata._extractMetadataInfo(); + + _validateReportPermission(msg.sender, workflowOwner, workflowName, reportName); + + ReceivedCCIPFeedReport[] memory feeds = abi.decode(report, (ReceivedCCIPFeedReport[])); + + for (uint256 i = 0; i < feeds.length; ++i) { + uint8 tokenDecimals = s_usdPriceFeedsPerToken[feeds[i].token].tokenDecimals; + if (tokenDecimals == 0) { + revert TokenNotSupported(feeds[i].token); + } + // Keystone reports prices in USD with 18 decimals, so we passing it as 18 in the _calculateRebasedValue function + uint224 rebasedValue = _calculateRebasedValue(18, tokenDecimals, feeds[i].price); + + //if stale update then revert + if (feeds[i].timestamp < s_usdPerToken[feeds[i].token].timestamp) { + revert StaleKeystoneUpdate(feeds[i].token, feeds[i].timestamp, s_usdPerToken[feeds[i].token].timestamp); + } + + s_usdPerToken[feeds[i].token] = + Internal.TimestampedPackedUint224({value: rebasedValue, timestamp: feeds[i].timestamp}); + emit UsdPerTokenUpdated(feeds[i].token, rebasedValue, feeds[i].timestamp); + } + } + + // ================================================================ + // │ Fee quoting │ + // ================================================================ + + /// @inheritdoc IFeeQuoter + /// @dev The function should always validate message.extraArgs, message.receiver and family-specific configs + function getValidatedFee( + uint64 destChainSelector, + Client.EVM2AnyMessage calldata message + ) external view returns (uint256 feeTokenAmount) { + DestChainConfig memory destChainConfig = s_destChainConfigs[destChainSelector]; + if (!destChainConfig.isEnabled) revert DestinationChainNotEnabled(destChainSelector); + if (!s_feeTokens.contains(message.feeToken)) revert FeeTokenNotSupported(message.feeToken); + + uint256 numberOfTokens = message.tokenAmounts.length; + _validateMessage(destChainConfig, message.data.length, numberOfTokens, message.receiver); + + // The below call asserts that feeToken is a supported token + (uint224 feeTokenPrice, uint224 packedGasPrice) = getTokenAndGasPrices(message.feeToken, destChainSelector); + + // Calculate premiumFee in USD with 18 decimals precision first. + // If message-only and no token transfers, a flat network fee is charged. + // If there are token transfers, premiumFee is calculated from token transfer fee. + // If there are both token transfers and message, premiumFee is only calculated from token transfer fee. + uint256 premiumFee = 0; + uint32 tokenTransferGas = 0; + uint32 tokenTransferBytesOverhead = 0; + if (numberOfTokens > 0) { + (premiumFee, tokenTransferGas, tokenTransferBytesOverhead) = + _getTokenTransferCost(destChainConfig, destChainSelector, message.feeToken, feeTokenPrice, message.tokenAmounts); + } else { + // Convert USD cents with 2 decimals to 18 decimals. + premiumFee = uint256(destChainConfig.networkFeeUSDCents) * 1e16; + } + + // Calculate data availability cost in USD with 36 decimals. Data availability cost exists on rollups that need to post + // transaction calldata onto another storage layer, e.g. Eth mainnet, incurring additional storage gas costs. + uint256 dataAvailabilityCost = 0; + + // Only calculate data availability cost if data availability multiplier is non-zero. + // The multiplier should be set to 0 if destination chain does not charge data availability cost. + if (destChainConfig.destDataAvailabilityMultiplierBps > 0) { + dataAvailabilityCost = _getDataAvailabilityCost( + destChainConfig, + // Parse the data availability gas price stored in the higher-order 112 bits of the encoded gas price. + uint112(packedGasPrice >> Internal.GAS_PRICE_BITS), + message.data.length, + numberOfTokens, + tokenTransferBytesOverhead + ); + } + + // Calculate execution gas fee on destination chain in USD with 36 decimals. + // We add the message gas limit, the overhead gas, the gas of passing message data to receiver, and token transfer gas together. + // We then multiply this gas total with the gas multiplier and gas price, converting it into USD with 36 decimals. + // uint112(packedGasPrice) = executionGasPrice + + // NOTE: when supporting non-EVM chains, revisit how generic this fee logic can be + // NOTE: revisit parsing non-EVM args + uint256 executionCost = uint112(packedGasPrice) + * ( + destChainConfig.destGasOverhead + (message.data.length * destChainConfig.destGasPerPayloadByte) + tokenTransferGas + + _parseEVMExtraArgsFromBytes(message.extraArgs, destChainConfig).gasLimit + ) * destChainConfig.gasMultiplierWeiPerEth; + + // Calculate number of fee tokens to charge. + // Total USD fee is in 36 decimals, feeTokenPrice is in 18 decimals USD for 1e18 smallest token denominations. + // Result of the division is the number of smallest token denominations. + return ((premiumFee * s_premiumMultiplierWeiPerEth[message.feeToken]) + executionCost + dataAvailabilityCost) + / feeTokenPrice; + } + + /// @notice Sets the fee configuration for a token. + /// @param premiumMultiplierWeiPerEthArgs Array of PremiumMultiplierWeiPerEthArgs structs. + function applyPremiumMultiplierWeiPerEthUpdates( + PremiumMultiplierWeiPerEthArgs[] memory premiumMultiplierWeiPerEthArgs + ) external onlyOwner { + _applyPremiumMultiplierWeiPerEthUpdates(premiumMultiplierWeiPerEthArgs); + } + + /// @dev Set the fee config. + /// @param premiumMultiplierWeiPerEthArgs The multiplier for destination chain specific premiums. + function _applyPremiumMultiplierWeiPerEthUpdates( + PremiumMultiplierWeiPerEthArgs[] memory premiumMultiplierWeiPerEthArgs + ) internal { + for (uint256 i = 0; i < premiumMultiplierWeiPerEthArgs.length; ++i) { + address token = premiumMultiplierWeiPerEthArgs[i].token; + uint64 premiumMultiplierWeiPerEth = premiumMultiplierWeiPerEthArgs[i].premiumMultiplierWeiPerEth; + s_premiumMultiplierWeiPerEth[token] = premiumMultiplierWeiPerEth; + + emit PremiumMultiplierWeiPerEthUpdated(token, premiumMultiplierWeiPerEth); + } + } + + /// @notice Gets the fee configuration for a token. + /// @param token The token to get the fee configuration for. + /// @return premiumMultiplierWeiPerEth The multiplier for destination chain specific premiums. + function getPremiumMultiplierWeiPerEth(address token) external view returns (uint64 premiumMultiplierWeiPerEth) { + return s_premiumMultiplierWeiPerEth[token]; + } + + /// @notice Returns the token transfer cost parameters. + /// A basis point fee is calculated from the USD value of each token transfer. + /// For each individual transfer, this fee is between [minFeeUSD, maxFeeUSD]. + /// Total transfer fee is the sum of each individual token transfer fee. + /// @dev Assumes that tokenAmounts are validated to be listed tokens elsewhere. + /// @dev Splitting one token transfer into multiple transfers is discouraged, + /// as it will result in a transferFee equal or greater than the same amount aggregated/de-duped. + /// @param destChainConfig the config configured for the destination chain selector. + /// @param destChainSelector the destination chain selector. + /// @param feeToken address of the feeToken. + /// @param feeTokenPrice price of feeToken in USD with 18 decimals. + /// @param tokenAmounts token transfers in the message. + /// @return tokenTransferFeeUSDWei total token transfer bps fee in USD with 18 decimals. + /// @return tokenTransferGas total execution gas of the token transfers. + /// @return tokenTransferBytesOverhead additional token transfer data passed to destination, e.g. USDC attestation. + function _getTokenTransferCost( + DestChainConfig memory destChainConfig, + uint64 destChainSelector, + address feeToken, + uint224 feeTokenPrice, + Client.EVMTokenAmount[] calldata tokenAmounts + ) internal view returns (uint256 tokenTransferFeeUSDWei, uint32 tokenTransferGas, uint32 tokenTransferBytesOverhead) { + uint256 numberOfTokens = tokenAmounts.length; + + for (uint256 i = 0; i < numberOfTokens; ++i) { + Client.EVMTokenAmount memory tokenAmount = tokenAmounts[i]; + TokenTransferFeeConfig memory transferFeeConfig = s_tokenTransferFeeConfig[destChainSelector][tokenAmount.token]; + + // If the token has no specific overrides configured, we use the global defaults. + if (!transferFeeConfig.isEnabled) { + tokenTransferFeeUSDWei += uint256(destChainConfig.defaultTokenFeeUSDCents) * 1e16; + tokenTransferGas += destChainConfig.defaultTokenDestGasOverhead; + tokenTransferBytesOverhead += Pool.CCIP_LOCK_OR_BURN_V1_RET_BYTES; + continue; + } + + uint256 bpsFeeUSDWei = 0; + // Only calculate bps fee if ratio is greater than 0. Ratio of 0 means no bps fee for a token. + // Useful for when the FeeQuoter cannot return a valid price for the token. + if (transferFeeConfig.deciBps > 0) { + uint224 tokenPrice = 0; + if (tokenAmount.token != feeToken) { + tokenPrice = _getValidatedTokenPrice(tokenAmount.token); + } else { + tokenPrice = feeTokenPrice; + } + + // Calculate token transfer value, then apply fee ratio + // ratio represents multiples of 0.1bps, or 1e-5 + bpsFeeUSDWei = (tokenPrice._calcUSDValueFromTokenAmount(tokenAmount.amount) * transferFeeConfig.deciBps) / 1e5; + } + + tokenTransferGas += transferFeeConfig.destGasOverhead; + tokenTransferBytesOverhead += transferFeeConfig.destBytesOverhead; + + // Bps fees should be kept within range of [minFeeUSD, maxFeeUSD]. + // Convert USD values with 2 decimals to 18 decimals. + uint256 minFeeUSDWei = uint256(transferFeeConfig.minFeeUSDCents) * 1e16; + if (bpsFeeUSDWei < minFeeUSDWei) { + tokenTransferFeeUSDWei += minFeeUSDWei; + continue; + } + + uint256 maxFeeUSDWei = uint256(transferFeeConfig.maxFeeUSDCents) * 1e16; + if (bpsFeeUSDWei > maxFeeUSDWei) { + tokenTransferFeeUSDWei += maxFeeUSDWei; + continue; + } + + tokenTransferFeeUSDWei += bpsFeeUSDWei; + } + + return (tokenTransferFeeUSDWei, tokenTransferGas, tokenTransferBytesOverhead); + } + + /// @notice calculates the rebased value for 1e18 smallest token denomination + /// @param dataFeedDecimal decimal of the data feed + /// @param tokenDecimal decimal of the token + /// @param feedValue value of the data feed + /// @return rebasedValue rebased value + function _calculateRebasedValue( + uint8 dataFeedDecimal, + uint8 tokenDecimal, + uint256 feedValue + ) internal pure returns (uint224 rebasedValue) { + // Rebase formula for units in smallest token denomination: usdValue * (1e18 * 1e18) / 1eTokenDecimals + // feedValue * (10 ** (18 - feedDecimals)) * (10 ** (18 - erc20Decimals)) + // feedValue * (10 ** ((18 - feedDecimals) + (18 - erc20Decimals))) + // feedValue * (10 ** (36 - feedDecimals - erc20Decimals)) + // feedValue * (10 ** (36 - (feedDecimals + erc20Decimals))) + // feedValue * (10 ** (36 - excessDecimals)) + // If excessDecimals > 36 => flip it to feedValue / (10 ** (excessDecimals - 36)) + uint8 excessDecimals = dataFeedDecimal + tokenDecimal; + uint256 rebasedVal; + + if (excessDecimals > 36) { + rebasedVal = feedValue / (10 ** (excessDecimals - 36)); + } else { + rebasedVal = feedValue * (10 ** (36 - excessDecimals)); + } + + if (rebasedVal > type(uint224).max) { + revert DataFeedValueOutOfUint224Range(); + } + + return uint224(rebasedVal); + } + + /// @notice Returns the estimated data availability cost of the message. + /// @dev To save on gas, we use a single destGasPerDataAvailabilityByte value for both zero and non-zero bytes. + /// @param destChainConfig the config configured for the destination chain selector. + /// @param dataAvailabilityGasPrice USD per data availability gas in 18 decimals. + /// @param messageDataLength length of the data field in the message. + /// @param numberOfTokens number of distinct token transfers in the message. + /// @param tokenTransferBytesOverhead additional token transfer data passed to destination, e.g. USDC attestation. + /// @return dataAvailabilityCostUSD36Decimal total data availability cost in USD with 36 decimals. + function _getDataAvailabilityCost( + DestChainConfig memory destChainConfig, + uint112 dataAvailabilityGasPrice, + uint256 messageDataLength, + uint256 numberOfTokens, + uint32 tokenTransferBytesOverhead + ) internal pure returns (uint256 dataAvailabilityCostUSD36Decimal) { + // dataAvailabilityLengthBytes sums up byte lengths of fixed message fields and dynamic message fields. + // Fixed message fields do account for the offset and length slot of the dynamic fields. + uint256 dataAvailabilityLengthBytes = Internal.ANY_2_EVM_MESSAGE_FIXED_BYTES + messageDataLength + + (numberOfTokens * Internal.ANY_2_EVM_MESSAGE_FIXED_BYTES_PER_TOKEN) + tokenTransferBytesOverhead; + + // destDataAvailabilityOverheadGas is a separate config value for flexibility to be updated independently of message cost. + // Its value is determined by CCIP lane implementation, e.g. the overhead data posted for OCR. + uint256 dataAvailabilityGas = (dataAvailabilityLengthBytes * destChainConfig.destGasPerDataAvailabilityByte) + + destChainConfig.destDataAvailabilityOverheadGas; + + // dataAvailabilityGasPrice is in 18 decimals, destDataAvailabilityMultiplierBps is in 4 decimals + // We pad 14 decimals to bring the result to 36 decimals, in line with token bps and execution fee. + return ((dataAvailabilityGas * dataAvailabilityGasPrice) * destChainConfig.destDataAvailabilityMultiplierBps) * 1e14; + } + + /// @notice Gets the transfer fee config for a given token. + /// @param destChainSelector The destination chain selector. + /// @param token The token address. + /// @return tokenTransferFeeConfig The transfer fee config for the token. + function getTokenTransferFeeConfig( + uint64 destChainSelector, + address token + ) external view returns (TokenTransferFeeConfig memory tokenTransferFeeConfig) { + return s_tokenTransferFeeConfig[destChainSelector][token]; + } + + /// @notice Sets the transfer fee config. + /// @dev only callable by the owner or admin. + function applyTokenTransferFeeConfigUpdates( + TokenTransferFeeConfigArgs[] memory tokenTransferFeeConfigArgs, + TokenTransferFeeConfigRemoveArgs[] memory tokensToUseDefaultFeeConfigs + ) external onlyOwner { + _applyTokenTransferFeeConfigUpdates(tokenTransferFeeConfigArgs, tokensToUseDefaultFeeConfigs); + } + + /// @notice internal helper to set the token transfer fee config. + function _applyTokenTransferFeeConfigUpdates( + TokenTransferFeeConfigArgs[] memory tokenTransferFeeConfigArgs, + TokenTransferFeeConfigRemoveArgs[] memory tokensToUseDefaultFeeConfigs + ) internal { + for (uint256 i = 0; i < tokenTransferFeeConfigArgs.length; ++i) { + TokenTransferFeeConfigArgs memory tokenTransferFeeConfigArg = tokenTransferFeeConfigArgs[i]; + uint64 destChainSelector = tokenTransferFeeConfigArg.destChainSelector; + + for (uint256 j = 0; j < tokenTransferFeeConfigArg.tokenTransferFeeConfigs.length; ++j) { + TokenTransferFeeConfig memory tokenTransferFeeConfig = + tokenTransferFeeConfigArg.tokenTransferFeeConfigs[j].tokenTransferFeeConfig; + address token = tokenTransferFeeConfigArg.tokenTransferFeeConfigs[j].token; + + if (tokenTransferFeeConfig.destBytesOverhead < Pool.CCIP_LOCK_OR_BURN_V1_RET_BYTES) { + revert InvalidDestBytesOverhead(token, tokenTransferFeeConfig.destBytesOverhead); + } + + s_tokenTransferFeeConfig[destChainSelector][token] = tokenTransferFeeConfig; + + emit TokenTransferFeeConfigUpdated(destChainSelector, token, tokenTransferFeeConfig); + } + } + + // Remove the custom fee configs for the tokens that are in the tokensToUseDefaultFeeConfigs array + for (uint256 i = 0; i < tokensToUseDefaultFeeConfigs.length; ++i) { + uint64 destChainSelector = tokensToUseDefaultFeeConfigs[i].destChainSelector; + address token = tokensToUseDefaultFeeConfigs[i].token; + delete s_tokenTransferFeeConfig[destChainSelector][token]; + emit TokenTransferFeeConfigDeleted(destChainSelector, token); + } + } + + // ================================================================ + // │ Validations & message processing │ + // ================================================================ + + /// @notice Validates that the destAddress matches the expected format of the family. + /// @param chainFamilySelector Tag to identify the target family. + /// @param destAddress Dest address to validate. + /// @dev precondition - assumes the family tag is correct and validated. + function _validateDestFamilyAddress(bytes4 chainFamilySelector, bytes memory destAddress) internal pure { + if (chainFamilySelector == Internal.CHAIN_FAMILY_SELECTOR_EVM) { + Internal._validateEVMAddress(destAddress); + } + } + + /// @dev Convert the extra args bytes into a struct with validations against the dest chain config. + /// @param extraArgs The extra args bytes. + /// @param destChainConfig Dest chain config to validate against. + /// @return evmExtraArgs The EVMExtraArgs struct (latest version). + function _parseEVMExtraArgsFromBytes( + bytes calldata extraArgs, + DestChainConfig memory destChainConfig + ) internal pure returns (Client.EVMExtraArgsV2 memory) { + Client.EVMExtraArgsV2 memory evmExtraArgs = + _parseUnvalidatedEVMExtraArgsFromBytes(extraArgs, destChainConfig.defaultTxGasLimit); + + if (evmExtraArgs.gasLimit > uint256(destChainConfig.maxPerMsgGasLimit)) revert MessageGasLimitTooHigh(); + if (destChainConfig.enforceOutOfOrder && !evmExtraArgs.allowOutOfOrderExecution) { + revert ExtraArgOutOfOrderExecutionMustBeTrue(); + } + + return evmExtraArgs; + } + + /// @dev Convert the extra args bytes into a struct. + /// @param extraArgs The extra args bytes. + /// @param defaultTxGasLimit default tx gas limit to use in the absence of extra args. + /// @return EVMExtraArgs the extra args struct (latest version) + function _parseUnvalidatedEVMExtraArgsFromBytes( + bytes calldata extraArgs, + uint64 defaultTxGasLimit + ) private pure returns (Client.EVMExtraArgsV2 memory) { + if (extraArgs.length == 0) { + // If extra args are empty, generate default values + return Client.EVMExtraArgsV2({gasLimit: defaultTxGasLimit, allowOutOfOrderExecution: false}); + } + + bytes4 extraArgsTag = bytes4(extraArgs); + bytes memory argsData = extraArgs[4:]; + + if (extraArgsTag == Client.EVM_EXTRA_ARGS_V2_TAG) { + return abi.decode(argsData, (Client.EVMExtraArgsV2)); + } else if (extraArgsTag == Client.EVM_EXTRA_ARGS_V1_TAG) { + // EVMExtraArgsV1 originally included a second boolean (strict) field which has been deprecated. + // Clients may still include it but it will be ignored. + return Client.EVMExtraArgsV2({gasLimit: abi.decode(argsData, (uint256)), allowOutOfOrderExecution: false}); + } + + revert InvalidExtraArgsTag(); + } + + /// @notice Validate the forwarded message to ensure it matches the configuration limits (message length, number of tokens) + /// and family-specific expectations (address format). + /// @param destChainConfig The destination chain config. + /// @param dataLength The length of the data field of the message. + /// @param numberOfTokens The number of tokens to be sent. + /// @param receiver Message receiver on the dest chain. + function _validateMessage( + DestChainConfig memory destChainConfig, + uint256 dataLength, + uint256 numberOfTokens, + bytes memory receiver + ) internal pure { + // Check that payload is formed correctly + if (dataLength > uint256(destChainConfig.maxDataBytes)) { + revert MessageTooLarge(uint256(destChainConfig.maxDataBytes), dataLength); + } + if (numberOfTokens > uint256(destChainConfig.maxNumberOfTokensPerMsg)) revert UnsupportedNumberOfTokens(); + _validateDestFamilyAddress(destChainConfig.chainFamilySelector, receiver); + } + + /// @inheritdoc IFeeQuoter + function processMessageArgs( + uint64 destChainSelector, + address feeToken, + uint256 feeTokenAmount, + bytes calldata extraArgs + ) external view returns (uint256 msgFeeJuels, bool isOutOfOrderExecution, bytes memory convertedExtraArgs) { + // Convert feeToken to link if not already in link + if (feeToken == i_linkToken) { + msgFeeJuels = feeTokenAmount; + } else { + msgFeeJuels = convertTokenAmount(feeToken, feeTokenAmount, i_linkToken); + } + + if (msgFeeJuels > i_maxFeeJuelsPerMsg) revert MessageFeeTooHigh(msgFeeJuels, i_maxFeeJuelsPerMsg); + + uint64 defaultTxGasLimit = s_destChainConfigs[destChainSelector].defaultTxGasLimit; + // NOTE: when supporting non-EVM chains, revisit this and parse non-EVM args. + // We can parse unvalidated args since this message is called after getFee (which will already validate the params) + Client.EVMExtraArgsV2 memory parsedExtraArgs = _parseUnvalidatedEVMExtraArgsFromBytes(extraArgs, defaultTxGasLimit); + isOutOfOrderExecution = parsedExtraArgs.allowOutOfOrderExecution; + + return (msgFeeJuels, isOutOfOrderExecution, Client._argsToBytes(parsedExtraArgs)); + } + + /// @inheritdoc IFeeQuoter + /// @dev precondition - rampTokenAmounts and sourceTokenAmounts lengths must be equal + function processPoolReturnData( + uint64 destChainSelector, + Internal.RampTokenAmount[] calldata rampTokenAmounts, + Client.EVMTokenAmount[] calldata sourceTokenAmounts + ) external view returns (bytes[] memory destExecDataPerToken) { + bytes4 chainFamilySelector = s_destChainConfigs[destChainSelector].chainFamilySelector; + destExecDataPerToken = new bytes[](rampTokenAmounts.length); + for (uint256 i = 0; i < rampTokenAmounts.length; ++i) { + address sourceToken = sourceTokenAmounts[i].token; + + // Since the DON has to pay for the extraData to be included on the destination chain, we cap the length of the + // extraData. This prevents gas bomb attacks on the NOPs. As destBytesOverhead accounts for both + // extraData and offchainData, this caps the worst case abuse to the number of bytes reserved for offchainData. + uint256 destPoolDataLength = rampTokenAmounts[i].extraData.length; + if (destPoolDataLength > Pool.CCIP_LOCK_OR_BURN_V1_RET_BYTES) { + if (destPoolDataLength > s_tokenTransferFeeConfig[destChainSelector][sourceToken].destBytesOverhead) { + revert SourceTokenDataTooLarge(sourceToken); + } + } + + _validateDestFamilyAddress(chainFamilySelector, rampTokenAmounts[i].destTokenAddress); + FeeQuoter.TokenTransferFeeConfig memory tokenTransferFeeConfig = + s_tokenTransferFeeConfig[destChainSelector][sourceToken]; + uint32 defaultGasOverhead = s_destChainConfigs[destChainSelector].defaultTokenDestGasOverhead; + // NOTE: Revisit this when adding new non-EVM chain family selector support + uint32 destGasAmount = + tokenTransferFeeConfig.isEnabled ? tokenTransferFeeConfig.destGasOverhead : defaultGasOverhead; + + // The user will be billed either the default or the override, so we send the exact amount that we billed for + // to the destination chain to be used for the token releaseOrMint and transfer. + destExecDataPerToken[i] = abi.encode(destGasAmount); + } + return destExecDataPerToken; + } + + // ================================================================ + // │ Configs │ + // ================================================================ + + /// @notice Returns the configured config for the dest chain selector. + /// @param destChainSelector Destination chain selector to fetch config for. + /// @return destChainConfig Config for the destination chain. + function getDestChainConfig(uint64 destChainSelector) external view returns (DestChainConfig memory) { + return s_destChainConfigs[destChainSelector]; + } + + /// @notice Updates the destination chain specific config. + /// @param destChainConfigArgs Array of source chain specific configs. + function applyDestChainConfigUpdates(DestChainConfigArgs[] memory destChainConfigArgs) external onlyOwner { + _applyDestChainConfigUpdates(destChainConfigArgs); + } + + /// @notice Internal version of applyDestChainConfigUpdates. + function _applyDestChainConfigUpdates(DestChainConfigArgs[] memory destChainConfigArgs) internal { + for (uint256 i = 0; i < destChainConfigArgs.length; ++i) { + DestChainConfigArgs memory destChainConfigArg = destChainConfigArgs[i]; + uint64 destChainSelector = destChainConfigArgs[i].destChainSelector; + DestChainConfig memory destChainConfig = destChainConfigArg.destChainConfig; + + // NOTE: when supporting non-EVM chains, update chainFamilySelector validations + if ( + destChainSelector == 0 || destChainConfig.defaultTxGasLimit == 0 + || destChainConfig.chainFamilySelector != Internal.CHAIN_FAMILY_SELECTOR_EVM + || destChainConfig.defaultTxGasLimit > destChainConfig.maxPerMsgGasLimit + ) { + revert InvalidDestChainConfig(destChainSelector); + } + + // The chain family selector cannot be zero - indicates that it is a new chain + if (s_destChainConfigs[destChainSelector].chainFamilySelector == 0) { + emit DestChainAdded(destChainSelector, destChainConfig); + } else { + emit DestChainConfigUpdated(destChainSelector, destChainConfig); + } + + s_destChainConfigs[destChainSelector] = destChainConfig; + } + } + + /// @notice Returns the static FeeQuoter config. + /// @dev RMN depends on this function, if updated, please notify the RMN maintainers. + /// @return staticConfig The static configuration. + function getStaticConfig() external view returns (StaticConfig memory) { + return StaticConfig({ + maxFeeJuelsPerMsg: i_maxFeeJuelsPerMsg, + linkToken: i_linkToken, + stalenessThreshold: i_stalenessThreshold + }); + } +} diff --git a/contracts/src/v0.8/ccip/LICENSE-MIT.md b/contracts/src/v0.8/ccip/LICENSE-MIT.md new file mode 100644 index 00000000000..812debd8e9b --- /dev/null +++ b/contracts/src/v0.8/ccip/LICENSE-MIT.md @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2018 SmartContract ChainLink, Ltd. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/contracts/src/v0.8/ccip/LICENSE.md b/contracts/src/v0.8/ccip/LICENSE.md new file mode 100644 index 00000000000..b2e82483e93 --- /dev/null +++ b/contracts/src/v0.8/ccip/LICENSE.md @@ -0,0 +1,56 @@ +Business Source License 1.1 + +License text copyright (c) 2017 MariaDB Corporation Ab, All Rights Reserved. +"Business Source License" is a trademark of MariaDB Corporation Ab. + +----------------------------------------------------------------------------- + +Parameters + +Licensor: SmartContract Chainlink Limited SEZC + +Licensed Work: Cross-Chain Interoperability Protocol v1.5 +The Licensed Work is (c) 2023 SmartContract Chainlink Limited SEZC + +Additional Use Grant: Any uses listed and defined at [v1.5-CCIP-License-grants]( +./v1.5-CCIP-License-grants.md) + +Change Date: Aug 16, 2028 + +Change License: MIT + +----------------------------------------------------------------------------- + +Terms + +The Licensor hereby grants you the right to copy, modify, create derivative works, redistribute, and make non-production use of the Licensed Work. The Licensor may make an Additional Use Grant, above, permitting limited production use. + +Effective on the Change Date, or the fourth anniversary of the first publicly available distribution of a specific version of the Licensed Work under this License, whichever comes first, the Licensor hereby grants you rights under the terms of the Change License, and the rights granted in the paragraph above terminate. + +If your use of the Licensed Work does not comply with the requirements currently in effect as described in this License, you must purchase a commercial license from the Licensor, its affiliated entities, or authorized resellers, or you must refrain from using the Licensed Work. + +All copies of the original and modified Licensed Work, and derivative works of the Licensed Work, are subject to this License. This License applies separately for each version of the Licensed Work and the Change Date may vary for each version of the Licensed Work released by Licensor. + +You must conspicuously display this License on each original or modified copy of the Licensed Work. If you receive the Licensed Work in original or modified form from a third party, the terms and conditions set forth in this License apply to your use of that work. + +Any use of the Licensed Work in violation of this License will automatically terminate your rights under this License for the current and all other versions of the Licensed Work. + +This License does not grant you any right in any trademark or logo of Licensor or its affiliates (provided that you may use a trademark or logo of Licensor as expressly required by this License). + +TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON AN "AS IS" BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS, EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND TITLE. + +MariaDB hereby grants you permission to use this License’s text to license your works, and to refer to it using the trademark "Business Source License", as long as you comply with the Covenants of Licensor below. + +----------------------------------------------------------------------------- + +Covenants of Licensor + +In consideration of the right to use this License’s text and the "Business Source License" name and trademark, Licensor covenants to MariaDB, and to all other recipients of the licensed work to be provided by Licensor: + +1. To specify as the Change License the GPL Version 2.0 or any later version, or a license that is compatible with GPL Version 2.0 or a later version, where "compatible" means that software provided under the Change License can be included in a program with software provided under GPL Version 2.0 or a later version. Licensor may specify additional Change Licenses without limitation. + +2. To either: (a) specify an additional grant of rights to use that does not impose any additional restriction on the right granted in this License, as the Additional Use Grant; or (b) insert the text "None". + +3. To specify a Change Date. + +4. Not to modify this License in any other way. \ No newline at end of file diff --git a/contracts/src/v0.8/ccip/MultiAggregateRateLimiter.sol b/contracts/src/v0.8/ccip/MultiAggregateRateLimiter.sol new file mode 100644 index 00000000000..1fbfd22d1c0 --- /dev/null +++ b/contracts/src/v0.8/ccip/MultiAggregateRateLimiter.sol @@ -0,0 +1,271 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {ITypeAndVersion} from "../shared/interfaces/ITypeAndVersion.sol"; +import {IFeeQuoter} from "./interfaces/IFeeQuoter.sol"; +import {IMessageInterceptor} from "./interfaces/IMessageInterceptor.sol"; + +import {AuthorizedCallers} from "../shared/access/AuthorizedCallers.sol"; +import {EnumerableMapAddresses} from "./../shared/enumerable/EnumerableMapAddresses.sol"; +import {Client} from "./libraries/Client.sol"; +import {RateLimiter} from "./libraries/RateLimiter.sol"; +import {USDPriceWith18Decimals} from "./libraries/USDPriceWith18Decimals.sol"; + +/// @notice The aggregate rate limiter is a wrapper of the token bucket rate limiter +/// which permits rate limiting based on the aggregate value of a group of +/// token transfers, using a fee quoter to convert to a numeraire asset (e.g. USD). +/// The contract is a standalone multi-lane message validator contract, which can be called by authorized +/// ramp contracts to apply rate limit changes to lanes, and revert when the rate limits get breached. +contract MultiAggregateRateLimiter is IMessageInterceptor, AuthorizedCallers, ITypeAndVersion { + using RateLimiter for RateLimiter.TokenBucket; + using USDPriceWith18Decimals for uint224; + using EnumerableMapAddresses for EnumerableMapAddresses.AddressToBytesMap; + + error PriceNotFoundForToken(address token); + error ZeroChainSelectorNotAllowed(); + + event RateLimiterConfigUpdated(uint64 indexed remoteChainSelector, bool isOutboundLane, RateLimiter.Config config); + event FeeQuoterSet(address newFeeQuoter); + event TokenAggregateRateLimitAdded(uint64 remoteChainSelector, bytes remoteToken, address localToken); + event TokenAggregateRateLimitRemoved(uint64 remoteChainSelector, address localToken); + + /// @notice LocalRateLimitToken struct containing the local token address with the remote chain selector. + /// The struct is used for removals and updates, since the local -> remote token mappings are scoped per-chain. + struct LocalRateLimitToken { + uint64 remoteChainSelector; // ────╮ Remote chain selector for which to update the rate limit token mapping + address localToken; // ────────────╯ Token on the chain on which the multi-ARL is deployed + } + + /// @notice RateLimitTokenArgs struct containing both the local and remote token addresses. + struct RateLimitTokenArgs { + LocalRateLimitToken localTokenArgs; // Local token update args scoped to one remote chain + bytes remoteToken; // Token on the remote chain (for OnRamp - dest, of OffRamp - source) + } + + /// @notice Update args for a single rate limiter config update. + struct RateLimiterConfigArgs { + uint64 remoteChainSelector; // ────╮ Remote chain selector to set config for + bool isOutboundLane; // ───────────╯ If set to true, represents the outbound message lane (OnRamp), and the inbound message lane otherwise (OffRamp) + RateLimiter.Config rateLimiterConfig; // Rate limiter config to set + } + + /// @notice Struct to store rate limit token buckets for both lane directions. + struct RateLimiterBuckets { + RateLimiter.TokenBucket inboundLaneBucket; // Bucket for the inbound lane (remote -> local) + RateLimiter.TokenBucket outboundLaneBucket; // Bucket for the outbound lane (local -> remote) + } + + string public constant override typeAndVersion = "MultiAggregateRateLimiter 1.6.0-dev"; + + /// @dev Tokens that should be included in Aggregate Rate Limiting (from local chain (this chain) -> remote), + /// grouped per-remote chain. + mapping(uint64 remoteChainSelector => EnumerableMapAddresses.AddressToBytesMap tokensLocalToRemote) internal + s_rateLimitedTokensLocalToRemote; + + /// @notice The address of the FeeQuoter used to query token values for ratelimiting. + address internal s_feeQuoter; + + /// @notice Rate limiter token bucket states per chain, with separate buckets for inbound and outbound lanes. + mapping(uint64 remoteChainSelector => RateLimiterBuckets buckets) internal s_rateLimitersByChainSelector; + + /// @param feeQuoter the fee quoter to set. + /// @param authorizedCallers the authorized callers to set. + constructor(address feeQuoter, address[] memory authorizedCallers) AuthorizedCallers(authorizedCallers) { + _setFeeQuoter(feeQuoter); + } + + /// @inheritdoc IMessageInterceptor + function onInboundMessage(Client.Any2EVMMessage memory message) external onlyAuthorizedCallers { + _applyRateLimit(message.sourceChainSelector, message.destTokenAmounts, false); + } + + /// @inheritdoc IMessageInterceptor + function onOutboundMessage( + uint64 destChainSelector, + Client.EVM2AnyMessage calldata message + ) external onlyAuthorizedCallers { + _applyRateLimit(destChainSelector, message.tokenAmounts, true); + } + + /// @notice Applies the rate limit to the token bucket if enabled. + /// @param remoteChainSelector The remote chain selector. + /// @param tokenAmounts The tokens and amounts to rate limit. + /// @param isOutgoingLane if set to true, fetches the bucket for the outgoing message lane (OnRamp). + function _applyRateLimit( + uint64 remoteChainSelector, + Client.EVMTokenAmount[] memory tokenAmounts, + bool isOutgoingLane + ) private { + RateLimiter.TokenBucket storage tokenBucket = _getTokenBucket(remoteChainSelector, isOutgoingLane); + + // Skip rate limiting if it is disabled + if (tokenBucket.isEnabled) { + uint256 value; + for (uint256 i = 0; i < tokenAmounts.length; ++i) { + if (s_rateLimitedTokensLocalToRemote[remoteChainSelector].contains(tokenAmounts[i].token)) { + value += _getTokenValue(tokenAmounts[i]); + } + } + // Rate limit on aggregated token value + if (value > 0) tokenBucket._consume(value, address(0)); + } + } + + /// @param remoteChainSelector chain selector to retrieve token bucket for. + /// @param isOutboundLane if set to true, fetches the bucket for the outbound message lane (OnRamp). + /// Otherwise fetches for the inbound message lane (OffRamp). + /// @return bucket Storage pointer to the token bucket representing a specific lane. + function _getTokenBucket( + uint64 remoteChainSelector, + bool isOutboundLane + ) internal view returns (RateLimiter.TokenBucket storage) { + RateLimiterBuckets storage rateLimiterBuckets = s_rateLimitersByChainSelector[remoteChainSelector]; + if (isOutboundLane) { + return rateLimiterBuckets.outboundLaneBucket; + } else { + return rateLimiterBuckets.inboundLaneBucket; + } + } + + /// @notice Retrieves the token value for a token using the FeeQuoter. + /// @param tokenAmount The token and amount to get the value for. + /// @return tokenValue USD value in 18 decimals. + function _getTokenValue(Client.EVMTokenAmount memory tokenAmount) internal view returns (uint256) { + // not fetching validated price, as price staleness is not important for value-based rate limiting + // we only need to verify the price is not 0 + uint224 pricePerToken = IFeeQuoter(s_feeQuoter).getTokenPrice(tokenAmount.token).value; + if (pricePerToken == 0) revert PriceNotFoundForToken(tokenAmount.token); + return pricePerToken._calcUSDValueFromTokenAmount(tokenAmount.amount); + } + + /// @notice Gets the token bucket with its values for the block it was requested at. + /// @param remoteChainSelector chain selector to retrieve state for + /// @param isOutboundLane if set to true, fetches the rate limit state for the outbound message lane (OnRamp). + /// Otherwise fetches for the inbound message lane (OffRamp). + /// The outbound and inbound message rate limit state is completely separated. + /// @return tokenBucket The token bucket. + function currentRateLimiterState( + uint64 remoteChainSelector, + bool isOutboundLane + ) external view returns (RateLimiter.TokenBucket memory) { + return _getTokenBucket(remoteChainSelector, isOutboundLane)._currentTokenBucketState(); + } + + /// @notice Applies the provided rate limiter config updates. + /// @param rateLimiterUpdates Rate limiter updates. + /// @dev Only callable by the owner. + function applyRateLimiterConfigUpdates(RateLimiterConfigArgs[] memory rateLimiterUpdates) external onlyOwner { + for (uint256 i = 0; i < rateLimiterUpdates.length; ++i) { + RateLimiterConfigArgs memory updateArgs = rateLimiterUpdates[i]; + RateLimiter.Config memory configUpdate = updateArgs.rateLimiterConfig; + uint64 remoteChainSelector = updateArgs.remoteChainSelector; + + if (remoteChainSelector == 0) { + revert ZeroChainSelectorNotAllowed(); + } + + bool isOutboundLane = updateArgs.isOutboundLane; + + RateLimiter.TokenBucket storage tokenBucket = _getTokenBucket(remoteChainSelector, isOutboundLane); + + if (tokenBucket.lastUpdated == 0) { + // Token bucket needs to be newly added + RateLimiter.TokenBucket memory newTokenBucket = RateLimiter.TokenBucket({ + rate: configUpdate.rate, + capacity: configUpdate.capacity, + tokens: configUpdate.capacity, + lastUpdated: uint32(block.timestamp), + isEnabled: configUpdate.isEnabled + }); + + if (isOutboundLane) { + s_rateLimitersByChainSelector[remoteChainSelector].outboundLaneBucket = newTokenBucket; + } else { + s_rateLimitersByChainSelector[remoteChainSelector].inboundLaneBucket = newTokenBucket; + } + } else { + tokenBucket._setTokenBucketConfig(configUpdate); + } + emit RateLimiterConfigUpdated(remoteChainSelector, isOutboundLane, configUpdate); + } + } + + /// @notice Gets all tokens which are included in Aggregate Rate Limiting. + /// @dev the order of IDs in the list is **not guaranteed**, therefore, if ordering matters when + /// making successive calls, one should keep the block height constant to ensure a consistent result. + /// @param remoteChainSelector chain selector to get rate limit tokens for. + /// @return localTokens The local chain representation of the tokens that are rate limited. + /// @return remoteTokens The remote representation of the tokens that are rate limited. + function getAllRateLimitTokens( + uint64 remoteChainSelector + ) external view returns (address[] memory localTokens, bytes[] memory remoteTokens) { + uint256 tokenCount = s_rateLimitedTokensLocalToRemote[remoteChainSelector].length(); + + localTokens = new address[](tokenCount); + remoteTokens = new bytes[](tokenCount); + + for (uint256 i = 0; i < tokenCount; ++i) { + (address localToken, bytes memory remoteToken) = s_rateLimitedTokensLocalToRemote[remoteChainSelector].at(i); + localTokens[i] = localToken; + remoteTokens[i] = remoteToken; + } + return (localTokens, remoteTokens); + } + + /// @notice Adds or removes tokens from being used in Aggregate Rate Limiting. + /// @param removes - A list of one or more tokens to be removed. + /// @param adds - A list of one or more tokens to be added. + function updateRateLimitTokens( + LocalRateLimitToken[] memory removes, + RateLimitTokenArgs[] memory adds + ) external onlyOwner { + for (uint256 i = 0; i < removes.length; ++i) { + address localToken = removes[i].localToken; + uint64 remoteChainSelector = removes[i].remoteChainSelector; + + if (s_rateLimitedTokensLocalToRemote[remoteChainSelector].remove(localToken)) { + emit TokenAggregateRateLimitRemoved(remoteChainSelector, localToken); + } + } + + for (uint256 i = 0; i < adds.length; ++i) { + LocalRateLimitToken memory localTokenArgs = adds[i].localTokenArgs; + bytes memory remoteToken = adds[i].remoteToken; + address localToken = localTokenArgs.localToken; + + if (localToken == address(0) || remoteToken.length == 0) { + revert ZeroAddressNotAllowed(); + } + + uint64 remoteChainSelector = localTokenArgs.remoteChainSelector; + + if (s_rateLimitedTokensLocalToRemote[remoteChainSelector].set(localToken, remoteToken)) { + emit TokenAggregateRateLimitAdded(remoteChainSelector, remoteToken, localToken); + } + } + } + + /// @return feeQuoter The configured FeeQuoter address. + function getFeeQuoter() external view returns (address feeQuoter) { + return s_feeQuoter; + } + + /// @notice Sets the FeeQuoter address. + /// @param newFeeQuoter the address of the new FeeQuoter. + /// @dev precondition The address must be a non-zero address. + function setFeeQuoter(address newFeeQuoter) external onlyOwner { + _setFeeQuoter(newFeeQuoter); + } + + /// @notice Sets the FeeQuoter address. + /// @param newFeeQuoter the address of the new FeeQuoter. + /// @dev precondition The address must be a non-zero address. + function _setFeeQuoter(address newFeeQuoter) internal { + if (newFeeQuoter == address(0)) { + revert ZeroAddressNotAllowed(); + } + + s_feeQuoter = newFeeQuoter; + emit FeeQuoterSet(newFeeQuoter); + } +} diff --git a/contracts/src/v0.8/ccip/NonceManager.sol b/contracts/src/v0.8/ccip/NonceManager.sol new file mode 100644 index 00000000000..38212e1d5fa --- /dev/null +++ b/contracts/src/v0.8/ccip/NonceManager.sol @@ -0,0 +1,150 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {ITypeAndVersion} from "../shared/interfaces/ITypeAndVersion.sol"; +import {IEVM2AnyOnRamp} from "./interfaces/IEVM2AnyOnRamp.sol"; +import {INonceManager} from "./interfaces/INonceManager.sol"; + +import {AuthorizedCallers} from "../shared/access/AuthorizedCallers.sol"; + +/// @title NonceManager +/// @notice NonceManager contract that manages sender nonces for the on/off ramps +contract NonceManager is INonceManager, AuthorizedCallers, ITypeAndVersion { + error PreviousRampAlreadySet(); + + event PreviousRampsUpdated(uint64 indexed remoteChainSelector, PreviousRamps prevRamp); + event SkippedIncorrectNonce(uint64 sourceChainSelector, uint64 nonce, bytes sender); + + /// @dev Struct that contains the previous on/off ramp addresses + struct PreviousRamps { + address prevOnRamp; // Previous onRamp + address prevOffRamp; // Previous offRamp + } + + /// @dev Struct that contains the chain selector and the previous on/off ramps, same as PreviousRamps but with the chain selector + /// so that an array of these can be passed to the applyPreviousRampsUpdates function + struct PreviousRampsArgs { + uint64 remoteChainSelector; // Chain selector + PreviousRamps prevRamps; // Previous on/off ramps + } + + string public constant override typeAndVersion = "NonceManager 1.6.0-dev"; + + /// @dev The previous on/off ramps per chain selector + mapping(uint64 chainSelector => PreviousRamps previousRamps) private s_previousRamps; + /// @dev The current outbound nonce per sender used on the onramp + mapping(uint64 destChainSelector => mapping(address sender => uint64 outboundNonce)) private s_outboundNonces; + /// @dev The current inbound nonce per sender used on the offramp + /// Eventually in sync with the outbound nonce in the remote source chain NonceManager, used to enforce that messages are + /// executed in the same order they are sent (assuming they are DON) + mapping(uint64 sourceChainSelector => mapping(bytes sender => uint64 inboundNonce)) private s_inboundNonces; + + constructor(address[] memory authorizedCallers) AuthorizedCallers(authorizedCallers) {} + + /// @inheritdoc INonceManager + function getIncrementedOutboundNonce( + uint64 destChainSelector, + address sender + ) external onlyAuthorizedCallers returns (uint64) { + uint64 outboundNonce = _getOutboundNonce(destChainSelector, sender) + 1; + s_outboundNonces[destChainSelector][sender] = outboundNonce; + + return outboundNonce; + } + + /// @notice Returns the outbound nonce for a given sender on a given destination chain. + /// @param destChainSelector The destination chain selector. + /// @param sender The sender address. + /// @return outboundNonce The outbound nonce. + function getOutboundNonce(uint64 destChainSelector, address sender) external view returns (uint64) { + return _getOutboundNonce(destChainSelector, sender); + } + + function _getOutboundNonce(uint64 destChainSelector, address sender) private view returns (uint64) { + uint64 outboundNonce = s_outboundNonces[destChainSelector][sender]; + + // When introducing the NonceManager with existing lanes, we still want to have sequential nonces. + // Referencing the old onRamp preserves sequencing between updates. + if (outboundNonce == 0) { + address prevOnRamp = s_previousRamps[destChainSelector].prevOnRamp; + if (prevOnRamp != address(0)) { + return IEVM2AnyOnRamp(prevOnRamp).getSenderNonce(sender); + } + } + + return outboundNonce; + } + + /// @inheritdoc INonceManager + function incrementInboundNonce( + uint64 sourceChainSelector, + uint64 expectedNonce, + bytes calldata sender + ) external onlyAuthorizedCallers returns (bool) { + uint64 inboundNonce = _getInboundNonce(sourceChainSelector, sender) + 1; + + if (inboundNonce != expectedNonce) { + // If the nonce is not the expected one, this means that there are still messages in flight so we skip + // the nonce increment + emit SkippedIncorrectNonce(sourceChainSelector, expectedNonce, sender); + return false; + } + + s_inboundNonces[sourceChainSelector][sender] = inboundNonce; + + return true; + } + + /// @notice Returns the inbound nonce for a given sender on a given source chain. + /// @param sourceChainSelector The source chain selector. + /// @param sender The encoded sender address. + /// @return inboundNonce The inbound nonce. + function getInboundNonce(uint64 sourceChainSelector, bytes calldata sender) external view returns (uint64) { + return _getInboundNonce(sourceChainSelector, sender); + } + + function _getInboundNonce(uint64 sourceChainSelector, bytes calldata sender) private view returns (uint64) { + uint64 inboundNonce = s_inboundNonces[sourceChainSelector][sender]; + + // When introducing the NonceManager with existing lanes, we still want to have sequential nonces. + // Referencing the old offRamp to check the expected nonce if none is set for a + // given sender allows us to skip the current message in the current offRamp if it would not be the next according + // to the old offRamp. This preserves sequencing between updates. + if (inboundNonce == 0) { + address prevOffRamp = s_previousRamps[sourceChainSelector].prevOffRamp; + if (prevOffRamp != address(0)) { + // We only expect EVM previous offRamps here so we can safely decode the sender + return IEVM2AnyOnRamp(prevOffRamp).getSenderNonce(abi.decode(sender, (address))); + } + } + + return inboundNonce; + } + + /// @notice Updates the previous ramps addresses. + /// @param previousRampsArgs The previous on/off ramps addresses. + function applyPreviousRampsUpdates(PreviousRampsArgs[] calldata previousRampsArgs) external onlyOwner { + for (uint256 i = 0; i < previousRampsArgs.length; ++i) { + PreviousRampsArgs calldata previousRampsArg = previousRampsArgs[i]; + + PreviousRamps storage prevRamps = s_previousRamps[previousRampsArg.remoteChainSelector]; + + // If the previous ramps are already set then they should not be updated + if (prevRamps.prevOnRamp != address(0) || prevRamps.prevOffRamp != address(0)) { + revert PreviousRampAlreadySet(); + } + + prevRamps.prevOnRamp = previousRampsArg.prevRamps.prevOnRamp; + prevRamps.prevOffRamp = previousRampsArg.prevRamps.prevOffRamp; + + emit PreviousRampsUpdated(previousRampsArg.remoteChainSelector, previousRampsArg.prevRamps); + } + } + + /// @notice Gets the previous onRamp address for the given chain selector + /// @param chainSelector The chain selector + /// @return previousRamps The previous on/offRamp addresses + function getPreviousRamps(uint64 chainSelector) external view returns (PreviousRamps memory) { + return s_previousRamps[chainSelector]; + } +} diff --git a/contracts/src/v0.8/ccip/RMN.sol b/contracts/src/v0.8/ccip/RMN.sol new file mode 100644 index 00000000000..3b9af7e0ce7 --- /dev/null +++ b/contracts/src/v0.8/ccip/RMN.sol @@ -0,0 +1,964 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {ITypeAndVersion} from "../shared/interfaces/ITypeAndVersion.sol"; +import {IRMN} from "./interfaces/IRMN.sol"; + +import {OwnerIsCreator} from "./../shared/access/OwnerIsCreator.sol"; + +import {EnumerableSet} from "../vendor/openzeppelin-solidity/v5.0.2/contracts/utils/structs/EnumerableSet.sol"; + +// An active curse on this subject will cause isCursed() to return true. Use this subject if there is an issue with a +// remote chain, for which there exists a legacy lane contract deployed on the same chain as this RMN contract is +// deployed, relying on isCursed(). +bytes16 constant LEGACY_CURSE_SUBJECT = 0x01000000000000000000000000000000; + +// An active curse on this subject will cause isCursed() and isCursed(bytes16) to return true. Use this subject for +// issues affecting all of CCIP chains, or pertaining to the chain that this contract is deployed on, instead of using +// the local chain selector as a subject. +bytes16 constant GLOBAL_CURSE_SUBJECT = 0x01000000000000000000000000000001; + +// The curse vote address representing the owner in data structures, events and recorded votes. Remains constant, even +// if the owner changes. +address constant OWNER_CURSE_VOTE_ADDR = address(~uint160(0)); // 0xff...ff + +// The curse vote address used in an OwnerUnvoteToCurseRequest to lift a curse, if there is no active curse votes for +// the subject that we are able to unvote, but the conditions for an active curse no longer hold. +address constant LIFT_CURSE_VOTE_ADDR = address(0); + +/// @dev This contract is owned by RMN, if changing, please notify the RMN maintainers. +// solhint-disable chainlink-solidity/explicit-returns +contract RMN is IRMN, OwnerIsCreator, ITypeAndVersion { + using EnumerableSet for EnumerableSet.AddressSet; + + // STATIC CONFIG + string public constant override typeAndVersion = "RMN 1.5.0"; + + uint256 private constant MAX_NUM_VOTERS = 16; + + // MAGIC VALUES + bytes28 private constant NO_VOTES_CURSES_HASH = bytes28(0); + + // DYNAMIC CONFIG + /// @notice blessVoteAddr and curseVoteAddr can't be 0. Additionally curseVoteAddr can't be LIFT_CURSE_VOTE_ADDR or + /// OWNER_CURSE_VOTE_ADDR. At least one of blessWeight & curseWeight must be non-zero, i.e., a voter could only vote + /// to bless, or only vote to curse, or both vote to bless and vote to curse. + struct Voter { + // This is the address the voter should use to call voteToBless. + address blessVoteAddr; + // This is the address the voter should use to call voteToCurse. + address curseVoteAddr; + // The weight of this voter's vote for blessing. + uint8 blessWeight; + // The weight of this voter's vote for cursing. + uint8 curseWeight; + } + + struct Config { + Voter[] voters; + // When the total weight of voters that have voted to bless a tagged root reaches + // or exceeds blessWeightThreshold, the tagged root becomes blessed. + uint16 blessWeightThreshold; + // When the total weight of voters that have voted to curse a subject reaches or + // exceeds curseWeightThreshold, the subject becomes cursed. + uint16 curseWeightThreshold; + } + + struct VersionedConfig { + Config config; + // The version is incremented every time the config changes. + // The initial configuration on the contract will have configVersion == 1. + uint32 configVersion; + // The block number at which the config was last set. Helps the offchain + // code check that the config was set in a stable block or double-check + // that it has the correct config by querying logs at that block number. + uint32 blockNumber; + } + + VersionedConfig private s_versionedConfig; + + // STATE + struct BlesserRecord { + // The config version at which this BlesserRecord was last set. A blesser + // is considered active iff this configVersion equals + // s_versionedConfig.configVersion. + uint32 configVersion; + uint8 weight; + uint8 index; + } + + mapping(address blessVoteAddr => BlesserRecord blesserRecord) private s_blesserRecords; + + struct BlessVoteProgress { + // This particular ordering saves us ~400 gas per voteToBless call, compared to the bool being at the bottom, even + // though the size of the struct is the same. + bool weightThresholdMet; + // A BlessVoteProgress is considered invalid if weightThresholdMet is false when + // s_versionedConfig.configVersion changes. we don't want old in-progress + // votes to continue when we set a new config! + // The config version at which the bless vote for a tagged root was initiated. + uint32 configVersion; + uint16 accumulatedWeight; + // Care must be taken that the bitmap has at least as many bits as MAX_NUM_VOTERS. + // uint200 is much larger than we need, but it saves us ~100 gas per voteToBless call to fill the word instead of + // using a smaller type. + // _bitmapGet(voterBitmap, i) = true indicates that the i-th voter has voted to bless + uint200 voterBitmap; + } + + mapping(bytes32 taggedRootHash => BlessVoteProgress blessVoteProgress) private s_blessVoteProgressByTaggedRootHash; + + // Any tagged root with a commit store included in s_permaBlessedCommitStores will be considered automatically + // blessed. + EnumerableSet.AddressSet private s_permaBlessedCommitStores; + + struct CurserRecord { + bool active; + uint8 weight; + mapping(bytes16 curseId => bool used) usedCurseIds; // retained across config changes + } + + mapping(address curseVoteAddr => CurserRecord curserRecord) private s_curserRecords; + + struct ConfigVersionAndCursesHash { + uint32 configVersion; // configVersion != s_versionedConfig.configVersion means no active vote + bytes28 cursesHash; // bytes28(0) means no active vote; truncated so that ConfigVersionAndCursesHash fits in a word + } + + struct CurseVoteProgress { + uint32 configVersion; // upon config change, lazy set to new config version + uint16 curseWeightThreshold; // upon config change, lazy set to new config value + uint16 accumulatedWeight; // upon config change, lazy set to 0 + // A curse becomes active after either: + // - sum([voter.weight for voter who voted in current config]) >= curseWeightThreshold + // - ownerCurse is invoked + // Once a curse is active, only the owner can lift it. + bool curseActive; // retained across config changes + mapping(address => ConfigVersionAndCursesHash) latestVoteToCurseByCurseVoteAddr; // retained across config changes + } + + mapping(bytes16 subject => CurseVoteProgress curseVoteProgress) private + s_potentiallyOutdatedCurseVoteProgressBySubject; + + // We intentionally use a struct here, even though it contains a single field, to make it obvious to future editors + // that there is space for more fields. + struct CurseHotVars { + uint64 numSubjectsCursed; // incremented by voteToCurse, ownerCurse; decremented by ownerUnvoteToCurse + } + + CurseHotVars private s_curseHotVars; + + enum RecordedCurseRelatedOpTag { + // A vote to curse, through either voteToCurse or ownerCurse. + VoteToCurse, + // An unvote to curse, through unvoteToCurse. + UnvoteToCurse, + // An unvote to curse, through ownerUnvoteToCurse, which was not forced (forceUnvote=false). + OwnerUnvoteToCurseUnforced, + // An unvote to curse, through ownerUnvoteToCurse, which was forced (forceUnvote=true). + OwnerUnvoteToCurseForced, + // A configuration change. + // + // For subjects that are not cursed when this happens, past votes do not get accounted for in the new configuration. + // If a voter votes during the new configuration, their curses hash will restart from NO_VOTES_CURSES_HASH. + // + // For subjects that are cursed when this happens, past votes get accounted for. + // If a voter votes during the new configuration, their curses hash will continue from its old value. + SetConfig + } + + /// @notice Provides the ability to quickly reconstruct the curse-related state of the contract offchain, without + /// having to replay all past events. Replaying past events often takes long, and in some cases might even be + /// infeasible due to log pruning. + /// + /// @dev We could save some gas by omitting some fields and instead using them as mapping keys, but we would lose the + /// cross-voter ordering, or cross-subject ordering, or cross-vote/unvote ordering. + struct RecordedCurseRelatedOp { + RecordedCurseRelatedOpTag tag; + uint64 blockTimestamp; + bool cursed; // whether the subject is cursed after this op; if tag in {SetConfig}, will be false + address curseVoteAddr; // if tag in {SetConfig}, will be address(0) + bytes16 subject; // if tag in {SetConfig}, will be bytes16(0) + bytes16 curseId; // if tag in {SetConfig, UnvoteToCurse, OwnerUnvoteToCurseUnforced, OwnerUnvoteToCurseForced}, will be bytes16(0) + } + + RecordedCurseRelatedOp[] private s_recordedCurseRelatedOps; + + /// @dev This function is to _ONLY_ be called in order to determine if a curse should become active upon a + /// vote-to-curse, or a curse should be deactivated upon an owner-unvote-to-curse. + /// Other reasons for a curse to be active, which are not covered here: + /// 1. Cursedness is retained from a prior config. + /// 2. The curse weight threshold was met at some point, which activated a curse, and enough voters unvoted to curse + /// such that the curse weight threshold is no longer met. + function _shouldCurseBeActive(CurseVoteProgress storage sptr_upToDateCurseVoteProgress) internal view returns (bool) { + return sptr_upToDateCurseVoteProgress.latestVoteToCurseByCurseVoteAddr[OWNER_CURSE_VOTE_ADDR].cursesHash + != NO_VOTES_CURSES_HASH + || sptr_upToDateCurseVoteProgress.accumulatedWeight >= sptr_upToDateCurseVoteProgress.curseWeightThreshold; + } + + /// @dev It might be the case that due to the lazy update of curseVoteProgress, a curse is active even though + /// _shouldCurseBeActive(curseVoteProgress) is false, i.e., the owner has no active vote to curse and the curse + /// weight threshold has not been met. + function _getUpToDateCurseVoteProgress( + uint32 configVersion, + bytes16 subject + ) internal returns (CurseVoteProgress storage) { + CurseVoteProgress storage sptr_curseVoteProgress = s_potentiallyOutdatedCurseVoteProgressBySubject[subject]; + if (configVersion != sptr_curseVoteProgress.configVersion) { + sptr_curseVoteProgress.configVersion = configVersion; + sptr_curseVoteProgress.curseWeightThreshold = s_versionedConfig.config.curseWeightThreshold; + sptr_curseVoteProgress.accumulatedWeight = 0; + + if (sptr_curseVoteProgress.curseActive) { + // If a curse was active, count past votes to curse and retain the curses hash for cursers who are part of the + // new config. + Config storage sptr_config = s_versionedConfig.config; + for (uint256 i = 0; i < sptr_config.voters.length; ++i) { + Voter storage sptr_voter = sptr_config.voters[i]; + ConfigVersionAndCursesHash storage sptr_cvch = + sptr_curseVoteProgress.latestVoteToCurseByCurseVoteAddr[sptr_voter.curseVoteAddr]; + if (sptr_cvch.configVersion < configVersion && sptr_cvch.cursesHash != NO_VOTES_CURSES_HASH) { + // `< configVersion` instead of `== configVersion-1`, because there might have been multiple config changes + // without a lazy update of our subject. This has the side effect of retaining votes from very old configs + // that we might not really intend to retain, but these can be removed by the owner later. + sptr_cvch.configVersion = configVersion; + sptr_curseVoteProgress.accumulatedWeight += sptr_voter.curseWeight; + } + } + // We don't need to think about OWNER_CURSE_VOTE_ADDR here, because its ConfigVersionAndCursesHash counts even + // if the configVersion is not the current config version, in contrast to regular voters. + // It's an irregularity, but it saves us > 5k gas (if the owner had previously voted) for the unlucky voter who + // enters this branch. + } else { + // If a curse was not active, we don't count past votes to curse for voters who are part of the new config. + // Their curses hash will be restart from NO_VOTES_CURSES_HASH when they vote to curse again. + // We expect that the offchain code will revote to curse in case it voted to curse, and the vote to curse was + // lost due to any reason, including a config change when the curse was not yet active. + } + } + return sptr_curseVoteProgress; + } + + // EVENTS, ERRORS + + event ConfigSet(uint32 indexed configVersion, Config config); + + error InvalidConfig(); + + event TaggedRootBlessed(uint32 indexed configVersion, IRMN.TaggedRoot taggedRoot, uint16 accumulatedWeight); + event TaggedRootBlessVotesReset(uint32 indexed configVersion, IRMN.TaggedRoot taggedRoot, bool wasBlessed); + event VotedToBless(uint32 indexed configVersion, address indexed voter, IRMN.TaggedRoot taggedRoot, uint8 weight); + + event VotedToCurse( + uint32 indexed configVersion, + address indexed voter, + bytes16 subject, + bytes16 curseId, + uint8 weight, + uint64 blockTimestamp, + bytes28 cursesHash, + uint16 accumulatedWeight + ); + event UnvotedToCurse( + uint32 indexed configVersion, + address indexed voter, + bytes16 subject, + uint8 weight, + bytes28 cursesHash, + uint16 remainingAccumulatedWeight + ); + event SkippedUnvoteToCurse(address indexed voter, bytes16 subject, bytes28 onchainCursesHash, bytes28 cursesHash); + event Cursed(uint32 indexed configVersion, bytes16 subject, uint64 blockTimestamp); + event CurseLifted(bytes16 subject); + + // These events make it easier for offchain logic to discover that it performs + // the same actions multiple times. + event AlreadyVotedToBless(uint32 indexed configVersion, address indexed voter, IRMN.TaggedRoot taggedRoot); + event AlreadyBlessed(uint32 indexed configVersion, address indexed voter, IRMN.TaggedRoot taggedRoot); + + // Emitted by ownerRemoveThenAddPermaBlessedCommitStores. + event PermaBlessedCommitStoreAdded(address commitStore); + event PermaBlessedCommitStoreRemoved(address commitStore); + + error ReusedCurseId(address voter, bytes16 curseId); + error UnauthorizedVoter(address voter); + error VoteToBlessNoop(); + error VoteToCurseNoop(); + error UnvoteToCurseNoop(); + error VoteToBlessForbiddenDuringActiveGlobalCurse(); + + /// @notice Thrown when subjects are not a strictly increasing monotone sequence. + // Prevents a subject from receiving multiple votes to curse with the same curse id. + error SubjectsMustBeStrictlyIncreasing(); + + constructor(Config memory config) { + { + // Ensure that the bitmap is large enough to hold MAX_NUM_VOTERS. + // We do this in the constructor because MAX_NUM_VOTERS is constant. + BlessVoteProgress memory vp = BlessVoteProgress({ + configVersion: 0, + voterBitmap: type(uint200).max, // will not compile if it doesn't fit + accumulatedWeight: 0, + weightThresholdMet: false + }); + assert(vp.voterBitmap >> (MAX_NUM_VOTERS - 1) >= 1); + } + _setConfig(config); + } + + function _bitmapGet(uint200 bitmap, uint8 index) internal pure returns (bool) { + assert(index < MAX_NUM_VOTERS); + return bitmap & (uint200(1) << index) != 0; + } + + function _bitmapSet(uint200 bitmap, uint8 index) internal pure returns (uint200) { + assert(index < MAX_NUM_VOTERS); + return bitmap | (uint200(1) << index); + } + + function _bitmapCount(uint200 bitmap) internal pure returns (uint8 oneBits) { + assert(bitmap < 1 << MAX_NUM_VOTERS); + // https://graphics.stanford.edu/~seander/bithacks.html#CountBitsSetKernighan + for (; bitmap != 0; ++oneBits) { + bitmap &= bitmap - 1; + } + } + + function _taggedRootHash(IRMN.TaggedRoot memory taggedRoot) internal pure returns (bytes32) { + return keccak256(abi.encode(taggedRoot.commitStore, taggedRoot.root)); + } + + function _cursesHash(bytes28 prevCursesHash, bytes16 curseId) internal pure returns (bytes28) { + return bytes28(keccak256(abi.encode(prevCursesHash, curseId))); + } + + function _blockTimestamp() internal view returns (uint64) { + return uint64(block.timestamp); + } + + /// @param taggedRoots A tagged root is hashed as `keccak256(abi.encode(taggedRoot.commitStore + /// /* address */, taggedRoot.root /* bytes32 */))`. + /// @notice Tagged roots which are already (voted to be) blessed are skipped and emit corresponding events. In case + /// the call has no effect, i.e., all passed tagged roots are skipped, the function reverts with a `VoteToBlessNoop`. + function voteToBless(IRMN.TaggedRoot[] calldata taggedRoots) external { + // If we have an active global curse, something is really wrong. Let's err on the + // side of caution and not accept further blessings during this time of + // uncertainty. + if (isCursed(GLOBAL_CURSE_SUBJECT)) revert VoteToBlessForbiddenDuringActiveGlobalCurse(); + + uint32 configVersion = s_versionedConfig.configVersion; + BlesserRecord memory blesserRecord = s_blesserRecords[msg.sender]; + if (blesserRecord.configVersion != configVersion) revert UnauthorizedVoter(msg.sender); + + bool noop = true; + for (uint256 i = 0; i < taggedRoots.length; ++i) { + IRMN.TaggedRoot memory taggedRoot = taggedRoots[i]; + bytes32 taggedRootHash = _taggedRootHash(taggedRoot); + BlessVoteProgress memory voteProgress = s_blessVoteProgressByTaggedRootHash[taggedRootHash]; + if (voteProgress.weightThresholdMet) { + // We don't revert here because it's unreasonable to expect from the + // voter to know exactly when to stop voting. Most likely when they + // voted they didn't realize the threshold would be reached by the time + // their vote was counted. + // Additionally, there might be other tagged roots for which votes might + // count, and we want to allow that to happen. + emit AlreadyBlessed(configVersion, msg.sender, taggedRoot); + continue; + } else if (voteProgress.configVersion != configVersion) { + // Note that voteProgress.weightThresholdMet must be false at this point + + // If votes were received while an older config was in effect, + // invalidate them and start from scratch. + // If votes were never received, set the current config version. + voteProgress = BlessVoteProgress({ + configVersion: configVersion, + voterBitmap: 0, + accumulatedWeight: 0, + weightThresholdMet: false + }); + } else if (_bitmapGet(voteProgress.voterBitmap, blesserRecord.index)) { + // We don't revert here because there might be other tagged roots for + // which votes might count, and we want to allow that to happen. + emit AlreadyVotedToBless(configVersion, msg.sender, taggedRoot); + continue; + } + noop = false; + voteProgress.voterBitmap = _bitmapSet(voteProgress.voterBitmap, blesserRecord.index); + voteProgress.accumulatedWeight += blesserRecord.weight; + emit VotedToBless(configVersion, msg.sender, taggedRoot, blesserRecord.weight); + if (voteProgress.accumulatedWeight >= s_versionedConfig.config.blessWeightThreshold) { + voteProgress.weightThresholdMet = true; + emit TaggedRootBlessed(configVersion, taggedRoot, voteProgress.accumulatedWeight); + } + s_blessVoteProgressByTaggedRootHash[taggedRootHash] = voteProgress; + } + + if (noop) { + revert VoteToBlessNoop(); + } + } + + /// @notice Can be called by the owner to remove unintentionally voted or even blessed tagged roots in a recovery + /// scenario. The owner must ensure that there are no in-flight transactions by RMN nodes voting for any of the + /// taggedRoots before calling this function, as such in-flight transactions could lead to the roots becoming + /// re-blessed shortly after the call to this function, contrary to the original intention. + function ownerResetBlessVotes(IRMN.TaggedRoot[] calldata taggedRoots) external onlyOwner { + uint32 configVersion = s_versionedConfig.configVersion; + for (uint256 i = 0; i < taggedRoots.length; ++i) { + IRMN.TaggedRoot memory taggedRoot = taggedRoots[i]; + bytes32 taggedRootHash = _taggedRootHash(taggedRoot); + BlessVoteProgress memory voteProgress = s_blessVoteProgressByTaggedRootHash[taggedRootHash]; + delete s_blessVoteProgressByTaggedRootHash[taggedRootHash]; + bool wasBlessed = voteProgress.weightThresholdMet; + if (voteProgress.configVersion == configVersion || wasBlessed) { + emit TaggedRootBlessVotesReset(configVersion, taggedRoot, wasBlessed); + } + } + } + + struct UnvoteToCurseRequest { + bytes16 subject; + bytes28 cursesHash; + } + + // For use in internal calls. + enum Privilege { + Owner, + Voter + } + + function _authorizedUnvoteToCurse( + Privilege priv, // Privilege.Owner during an ownerUnvoteToCurse call, Privilege.Voter during a unvoteToCurse call + uint32 configVersion, + address curseVoteAddr, + UnvoteToCurseRequest memory req, + bool forceUnvote, // true only during an ownerUnvoteToCurse call, when OwnerUnvoteToCurseRequest.forceUnvote is true + CurserRecord storage sptr_curserRecord, + CurseVoteProgress storage sptr_curseVoteProgress + ) internal returns (bool unvoted, bool curseLifted) { + { + assert(priv == Privilege.Voter || priv == Privilege.Owner); // sanity check + // Check that the supplied arguments are feasible for our privilege. + if (forceUnvote || curseVoteAddr == OWNER_CURSE_VOTE_ADDR || curseVoteAddr == LIFT_CURSE_VOTE_ADDR) { + assert(priv == Privilege.Owner); + } + } + + ConfigVersionAndCursesHash memory cvch = sptr_curseVoteProgress.latestVoteToCurseByCurseVoteAddr[curseVoteAddr]; + + // First, try to unvote. + if ( + sptr_curserRecord.active && (curseVoteAddr == OWNER_CURSE_VOTE_ADDR || cvch.configVersion == configVersion) + && cvch.cursesHash != NO_VOTES_CURSES_HASH && (cvch.cursesHash == req.cursesHash || forceUnvote) + ) { + unvoted = true; + delete sptr_curseVoteProgress.latestVoteToCurseByCurseVoteAddr[curseVoteAddr]; + // Assumes: s_curserRecords[OWNER_CURSE_VOTE_ADDR].weight == 0, enforced by _setConfig + sptr_curseVoteProgress.accumulatedWeight -= sptr_curserRecord.weight; + + emit UnvotedToCurse( + configVersion, + curseVoteAddr, + req.subject, + sptr_curserRecord.weight, + req.cursesHash, + sptr_curseVoteProgress.accumulatedWeight + ); + } + + // If we have owner privilege, and the conditions for the curse to be active no longer hold, we are able to lift the + // curse. + bool shouldTryToLiftCurse = priv == Privilege.Owner && (unvoted || curseVoteAddr == LIFT_CURSE_VOTE_ADDR); + + if (shouldTryToLiftCurse && sptr_curseVoteProgress.curseActive && !_shouldCurseBeActive(sptr_curseVoteProgress)) { + curseLifted = true; + sptr_curseVoteProgress.curseActive = false; + --s_curseHotVars.numSubjectsCursed; + emit CurseLifted(req.subject); + } + + if (unvoted || curseLifted) { + RecordedCurseRelatedOpTag tag; + if (priv == Privilege.Owner) { + if (forceUnvote) { + tag = RecordedCurseRelatedOpTag.OwnerUnvoteToCurseForced; + } else { + tag = RecordedCurseRelatedOpTag.OwnerUnvoteToCurseUnforced; + } + } else if (priv == Privilege.Voter) { + tag = RecordedCurseRelatedOpTag.UnvoteToCurse; + } else { + // solhint-disable-next-line gas-custom-errors, reason-string + revert(); // assumption violation + } + s_recordedCurseRelatedOps.push( + RecordedCurseRelatedOp({ + tag: tag, + cursed: sptr_curseVoteProgress.curseActive, + curseVoteAddr: curseVoteAddr, + curseId: bytes16(0), + subject: req.subject, + blockTimestamp: _blockTimestamp() + }) + ); + } else { + emit SkippedUnvoteToCurse(curseVoteAddr, req.subject, cvch.cursesHash, req.cursesHash); + } + } + + /// @notice Can be called by a curser to remove unintentional votes to curse. + /// We expect this to be called very rarely, e.g. in case of a bug in the + /// offchain code causing false voteToCurse calls. + /// @notice Should be called from curser's corresponding curseVoteAddr. + function unvoteToCurse(UnvoteToCurseRequest[] memory unvoteToCurseRequests) external { + address curseVoteAddr = msg.sender; + CurserRecord storage sptr_curserRecord = s_curserRecords[curseVoteAddr]; + + if (!sptr_curserRecord.active) revert UnauthorizedVoter(curseVoteAddr); + + uint32 configVersion = s_versionedConfig.configVersion; + bool anyVoteWasUnvoted = false; + for (uint256 i = 0; i < unvoteToCurseRequests.length; ++i) { + UnvoteToCurseRequest memory req = unvoteToCurseRequests[i]; + CurseVoteProgress storage sptr_curseVoteProgress = _getUpToDateCurseVoteProgress(configVersion, req.subject); + (bool unvoted, bool curseLifted) = _authorizedUnvoteToCurse( + Privilege.Voter, configVersion, curseVoteAddr, req, false, sptr_curserRecord, sptr_curseVoteProgress + ); + assert(!curseLifted); // assumption violation: voters can't lift curses + anyVoteWasUnvoted = anyVoteWasUnvoted || unvoted; + } + + if (!anyVoteWasUnvoted) { + revert UnvoteToCurseNoop(); + } + } + + /// @notice A vote to curse is appropriate during unhealthy blockchain conditions + /// (eg. finality violations). + function voteToCurse(bytes16 curseId, bytes16[] memory subjects) external { + address curseVoteAddr = msg.sender; + assert(curseVoteAddr != OWNER_CURSE_VOTE_ADDR); + CurserRecord storage sptr_curserRecord = s_curserRecords[curseVoteAddr]; + if (!sptr_curserRecord.active) revert UnauthorizedVoter(curseVoteAddr); + _authorizedVoteToCurse(curseVoteAddr, curseId, subjects, sptr_curserRecord); + } + + function _authorizedVoteToCurse( + address curseVoteAddr, + bytes16 curseId, + bytes16[] memory subjects, + CurserRecord storage sptr_curserRecord + ) internal { + if (subjects.length == 0) revert VoteToCurseNoop(); + + if (sptr_curserRecord.usedCurseIds[curseId]) revert ReusedCurseId(curseVoteAddr, curseId); + sptr_curserRecord.usedCurseIds[curseId] = true; + + // NOTE: We could pack configVersion into CurserRecord that we already load in the beginning of this function to + // avoid the following extra storage read for it, but since voteToCurse is not on the hot path we'd rather keep + // things simple. + uint32 configVersion = s_versionedConfig.configVersion; + for (uint256 i = 0; i < subjects.length; ++i) { + if (i >= 1 && !(subjects[i - 1] < subjects[i])) { + // Prevents a subject from receiving multiple votes to curse with the same curse id. + revert SubjectsMustBeStrictlyIncreasing(); + } + + bytes16 subject = subjects[i]; + CurseVoteProgress storage sptr_curseVoteProgress = _getUpToDateCurseVoteProgress(configVersion, subject); + ConfigVersionAndCursesHash memory cvch = sptr_curseVoteProgress.latestVoteToCurseByCurseVoteAddr[curseVoteAddr]; + bytes28 prevCursesHash; + if ( + (curseVoteAddr != OWNER_CURSE_VOTE_ADDR && cvch.configVersion < configVersion) + || cvch.cursesHash == NO_VOTES_CURSES_HASH + ) { + // if owner's first vote, or if voter's first vote in this config version + prevCursesHash = NO_VOTES_CURSES_HASH; // start hashchain from scratch, explicit + sptr_curseVoteProgress.accumulatedWeight += sptr_curserRecord.weight; + } else { + // we've already accounted for the weight + prevCursesHash = cvch.cursesHash; + } + sptr_curseVoteProgress.latestVoteToCurseByCurseVoteAddr[curseVoteAddr] = cvch = + ConfigVersionAndCursesHash({configVersion: configVersion, cursesHash: _cursesHash(prevCursesHash, curseId)}); + emit VotedToCurse( + configVersion, + curseVoteAddr, + subject, + curseId, + sptr_curserRecord.weight, + _blockTimestamp(), + cvch.cursesHash, + sptr_curseVoteProgress.accumulatedWeight + ); + + if ( + prevCursesHash == NO_VOTES_CURSES_HASH && !sptr_curseVoteProgress.curseActive + && _shouldCurseBeActive(sptr_curseVoteProgress) + ) { + sptr_curseVoteProgress.curseActive = true; + ++s_curseHotVars.numSubjectsCursed; + emit Cursed(configVersion, subject, _blockTimestamp()); + } + + s_recordedCurseRelatedOps.push( + RecordedCurseRelatedOp({ + tag: RecordedCurseRelatedOpTag.VoteToCurse, + cursed: sptr_curseVoteProgress.curseActive, + curseVoteAddr: curseVoteAddr, + curseId: curseId, + subject: subject, + blockTimestamp: _blockTimestamp() + }) + ); + } + } + + /// @notice Enables the owner to immediately have the system enter the cursed state. + function ownerCurse(bytes16 curseId, bytes16[] memory subjects) external onlyOwner { + address curseVoteAddr = OWNER_CURSE_VOTE_ADDR; + CurserRecord storage sptr_curserRecord = s_curserRecords[curseVoteAddr]; + // no need to check if sptr_curserRecord.active, we must have the onlyOwner modifier + _authorizedVoteToCurse(curseVoteAddr, curseId, subjects, sptr_curserRecord); + } + + // Set curseVoteAddr=LIFT_CURSE_VOTE_ADDR, cursesHash=bytes28(0), to reset curseActive if it can be reset. Useful if + // all voters have unvoted to curse on their own and the curse can now be lifted without any individual votes that can + // be unvoted. + // solhint-disable-next-line gas-struct-packing + struct OwnerUnvoteToCurseRequest { + address curseVoteAddr; + UnvoteToCurseRequest unit; + bool forceUnvote; + } + + /// @notice Enables the owner to remove curse votes. After the curse votes are removed, + /// this function will check whether the curse is still valid and restore the uncursed state if possible. + /// This function also enables the owner to lift a curse created through ownerCurse. + function ownerUnvoteToCurse(OwnerUnvoteToCurseRequest[] memory ownerUnvoteToCurseRequests) external onlyOwner { + bool anyCurseWasLifted = false; + bool anyVoteWasUnvoted = false; + uint32 configVersion = s_versionedConfig.configVersion; + for (uint256 i = 0; i < ownerUnvoteToCurseRequests.length; ++i) { + OwnerUnvoteToCurseRequest memory req = ownerUnvoteToCurseRequests[i]; + CurseVoteProgress storage sptr_curseVoteProgress = _getUpToDateCurseVoteProgress(configVersion, req.unit.subject); + (bool unvoted, bool curseLifted) = _authorizedUnvoteToCurse( + Privilege.Owner, + configVersion, + req.curseVoteAddr, + req.unit, + req.forceUnvote, + s_curserRecords[req.curseVoteAddr], + sptr_curseVoteProgress + ); + anyVoteWasUnvoted = anyVoteWasUnvoted || unvoted; + anyCurseWasLifted = anyCurseWasLifted || curseLifted; + } + + if (anyCurseWasLifted) { + // Invalidate all in-progress votes to bless or curse by bumping the config version. + // They might have been based on false information about the source chain + // (e.g. in case of a finality violation). + _setConfig(s_versionedConfig.config); + } + + if (!(anyVoteWasUnvoted || anyCurseWasLifted)) { + revert UnvoteToCurseNoop(); + } + } + + function setConfig(Config memory config) external onlyOwner { + _setConfig(config); + } + + /// @notice Any tagged root with a commit store included in this array will be considered automatically blessed. + function getPermaBlessedCommitStores() external view returns (address[] memory) { + return s_permaBlessedCommitStores.values(); + } + + /// @notice The ordering of parameters is important. First come the commit stores to remove, then the commit stores to + /// add. + function ownerRemoveThenAddPermaBlessedCommitStores( + address[] memory removes, + address[] memory adds + ) external onlyOwner { + for (uint256 i = 0; i < removes.length; ++i) { + if (s_permaBlessedCommitStores.remove(removes[i])) { + emit PermaBlessedCommitStoreRemoved(removes[i]); + } + } + for (uint256 i = 0; i < adds.length; ++i) { + if (s_permaBlessedCommitStores.add(adds[i])) { + emit PermaBlessedCommitStoreAdded(adds[i]); + } + } + } + + /// @inheritdoc IRMN + function isBlessed(IRMN.TaggedRoot calldata taggedRoot) external view returns (bool) { + return s_blessVoteProgressByTaggedRootHash[_taggedRootHash(taggedRoot)].weightThresholdMet + || s_permaBlessedCommitStores.contains(taggedRoot.commitStore); + } + + /// @inheritdoc IRMN + function isCursed() external view returns (bool) { + if (s_curseHotVars.numSubjectsCursed == 0) { + return false; // happy path costs a single SLOAD + } else { + return s_potentiallyOutdatedCurseVoteProgressBySubject[GLOBAL_CURSE_SUBJECT].curseActive + || s_potentiallyOutdatedCurseVoteProgressBySubject[LEGACY_CURSE_SUBJECT].curseActive; + } + } + + /// @inheritdoc IRMN + function isCursed(bytes16 subject) public view returns (bool) { + if (s_curseHotVars.numSubjectsCursed == 0) { + return false; // happy path costs a single SLOAD + } else { + return s_potentiallyOutdatedCurseVoteProgressBySubject[GLOBAL_CURSE_SUBJECT].curseActive + || s_potentiallyOutdatedCurseVoteProgressBySubject[subject].curseActive; + } + } + + /// @notice Config version might be incremented for many reasons, including + /// the lifting of a curse, or a regular config change. + function getConfigDetails() external view returns (uint32 version, uint32 blockNumber, Config memory config) { + version = s_versionedConfig.configVersion; + blockNumber = s_versionedConfig.blockNumber; + config = s_versionedConfig.config; + } + + /// @return blessVoteAddrs addresses of voters, will be empty if voting took place with an older config version + /// @return accumulatedWeight sum of weights of voters, will be zero if voting took place with an older config version + /// @return blessed will be accurate regardless of when voting took place + /// @dev This is a helper method for offchain code so efficiency is not really a concern. + function getBlessProgress( + IRMN.TaggedRoot calldata taggedRoot + ) external view returns (address[] memory blessVoteAddrs, uint16 accumulatedWeight, bool blessed) { + bytes32 taggedRootHash = _taggedRootHash(taggedRoot); + BlessVoteProgress memory progress = s_blessVoteProgressByTaggedRootHash[taggedRootHash]; + blessed = progress.weightThresholdMet; + if (progress.configVersion == s_versionedConfig.configVersion) { + accumulatedWeight = progress.accumulatedWeight; + uint200 bitmap = progress.voterBitmap; + blessVoteAddrs = new address[](_bitmapCount(bitmap)); + Voter[] memory voters = s_versionedConfig.config.voters; + uint256 j = 0; + for (uint8 i = 0; i < voters.length; ++i) { + if (_bitmapGet(bitmap, i)) { + blessVoteAddrs[j] = voters[i].blessVoteAddr; + ++j; + } + } + } + } + + /// @return curseVoteAddrs the curseVoteAddr of each voter with an active vote to curse + /// @return cursesHashes the i-th value is the curses hash of curseVoteAddrs[i] + /// @return accumulatedWeight the accumulated weight of all voters with an active vote to curse who are part of the + /// current config + /// @return cursed might be true even if the owner has no active vote and accumulatedWeight < curseWeightThreshold, + /// due to a retained curse from a prior config + /// @dev This is a helper method for offchain code so efficiency is not really a concern. + function getCurseProgress( + bytes16 subject + ) + external + view + returns (address[] memory curseVoteAddrs, bytes28[] memory cursesHashes, uint16 accumulatedWeight, bool cursed) + { + uint32 configVersion = s_versionedConfig.configVersion; + Config memory config = s_versionedConfig.config; + // Can't use _getUpToDateCurseVoteProgress here because we can't call a non-view function from within a view. + // So we get to repeat some accounting. + CurseVoteProgress storage outdatedCurseVoteProgress = s_potentiallyOutdatedCurseVoteProgressBySubject[subject]; + + cursed = outdatedCurseVoteProgress.curseActive; + + // See _getUpToDateCurseVoteProgress for more context. + bool shouldCountVotesFromOlderConfigs = outdatedCurseVoteProgress.configVersion < configVersion && cursed; + + // A play in two acts, because we can't push to arrays in memory, so we need to precompute the array's length. + // First act: we count the number of cursers, i.e., voters with active vote. + // Second act: push the cursers to the arrays, sum their weights. + + uint256 numCursers = 0; // we reuse this variable for writing to perserve stack space + accumulatedWeight = 0; + for (uint256 act = 1; act <= 2; ++act) { + uint256 i = config.voters.length; // not config.voters.length-1 to account for the owner + while (true) { + address curseVoteAddr; + uint8 weight; + if (i < config.voters.length) { + curseVoteAddr = config.voters[i].curseVoteAddr; + weight = config.voters[i].curseWeight; + } else { + // Allows us to include the owner's vote and curses hash in the result. + curseVoteAddr = OWNER_CURSE_VOTE_ADDR; + weight = 0; + } + + ConfigVersionAndCursesHash memory cvch = + outdatedCurseVoteProgress.latestVoteToCurseByCurseVoteAddr[curseVoteAddr]; + bool hasActiveVote = ( + shouldCountVotesFromOlderConfigs || cvch.configVersion == configVersion + || curseVoteAddr == OWNER_CURSE_VOTE_ADDR + ) && cvch.cursesHash != NO_VOTES_CURSES_HASH; + if (hasActiveVote) { + if (act == 1) { + ++numCursers; + } else if (act == 2) { + accumulatedWeight += weight; + --numCursers; + curseVoteAddrs[numCursers] = curseVoteAddr; + cursesHashes[numCursers] = cvch.cursesHash; + } else { + // solhint-disable-next-line gas-custom-errors, reason-string + revert(); // assumption violation + } + } + + if (i > 0) { + --i; + } else { + break; + } + } + + if (act == 1) { + // We are done counting at this point, initialize the arrays for the second act that follows immediately after. + curseVoteAddrs = new address[](numCursers); + cursesHashes = new bytes28[](numCursers); + } + } + } + + /// @notice Returns the number of subjects that are currently cursed. + function getCursedSubjectsCount() external view returns (uint256) { + return s_curseHotVars.numSubjectsCursed; + } + + /// @dev This is a helper method for offchain code to know what arguments to use for getRecordedCurseRelatedOps. + function getRecordedCurseRelatedOpsCount() external view returns (uint256) { + return s_recordedCurseRelatedOps.length; + } + + /// @dev This is a helper method for offchain code so efficiency is not really a concern. + /// @dev Returns s_recordedCurseRelatedOps[offset:offset+limit]. + function getRecordedCurseRelatedOps( + uint256 offset, + uint256 limit + ) external view returns (RecordedCurseRelatedOp[] memory) { + uint256 pageLen; + if (offset + limit <= s_recordedCurseRelatedOps.length) { + pageLen = limit; + } else if (offset < s_recordedCurseRelatedOps.length) { + pageLen = s_recordedCurseRelatedOps.length - offset; + } else { + pageLen = 0; + } + RecordedCurseRelatedOp[] memory page = new RecordedCurseRelatedOp[](pageLen); + for (uint256 i = 0; i < pageLen; ++i) { + page[i] = s_recordedCurseRelatedOps[offset + i]; + } + return page; + } + + function _validateConfig(Config memory config) internal pure returns (bool) { + if ( + config.voters.length == 0 || config.voters.length > MAX_NUM_VOTERS || config.blessWeightThreshold == 0 + || config.curseWeightThreshold == 0 + ) { + return false; + } + + uint256 totalBlessWeight = 0; + uint256 totalCurseWeight = 0; + address[] memory allAddrs = new address[](2 * config.voters.length); + for (uint256 i = 0; i < config.voters.length; ++i) { + Voter memory voter = config.voters[i]; + // The owner can always curse using the ownerCurse method, and is not supposed to be included in the voters list. + // Even though the intent is for the actual owner address to NOT be included in the voters list, we don't + // explicitly disallow curseVoteAddr == owner() here. Even if we did, the owner could transfer ownership of the + // contract, and so we couldn't guarantee that the owner is not eventually included in the voters list. + if ( + voter.blessVoteAddr == address(0) || voter.curseVoteAddr == address(0) + || voter.curseVoteAddr == LIFT_CURSE_VOTE_ADDR || voter.curseVoteAddr == OWNER_CURSE_VOTE_ADDR + || (voter.blessWeight == 0 && voter.curseWeight == 0) + ) { + return false; + } + allAddrs[2 * i + 0] = voter.blessVoteAddr; + allAddrs[2 * i + 1] = voter.curseVoteAddr; + totalBlessWeight += voter.blessWeight; + totalCurseWeight += voter.curseWeight; + } + for (uint256 i = 0; i < allAddrs.length; ++i) { + address allAddrs_i = allAddrs[i]; + for (uint256 j = i + 1; j < allAddrs.length; ++j) { + if (allAddrs_i == allAddrs[j]) { + return false; + } + } + } + + return totalBlessWeight >= config.blessWeightThreshold && totalCurseWeight >= config.curseWeightThreshold; + } + + function _setConfig(Config memory config) private { + if (!_validateConfig(config)) revert InvalidConfig(); + + // We can't directly assign s_versionedConfig.config to config + // because copying a memory array into storage is not supported. + { + s_versionedConfig.config.blessWeightThreshold = config.blessWeightThreshold; + s_versionedConfig.config.curseWeightThreshold = config.curseWeightThreshold; + while (s_versionedConfig.config.voters.length != 0) { + Voter memory voter = s_versionedConfig.config.voters[s_versionedConfig.config.voters.length - 1]; + delete s_blesserRecords[voter.blessVoteAddr]; + delete s_curserRecords[voter.curseVoteAddr]; // usedCurseIds mapping is retained, as intended + s_versionedConfig.config.voters.pop(); + } + for (uint256 i = 0; i < config.voters.length; ++i) { + s_versionedConfig.config.voters.push(config.voters[i]); + } + } + + ++s_versionedConfig.configVersion; + uint32 configVersion = s_versionedConfig.configVersion; + + for (uint8 i = 0; i < config.voters.length; ++i) { + Voter memory voter = config.voters[i]; + s_blesserRecords[voter.blessVoteAddr] = + BlesserRecord({configVersion: configVersion, index: i, weight: voter.blessWeight}); + { + CurserRecord storage sptr_curserRecord = s_curserRecords[voter.curseVoteAddr]; + // Solidity will not let us initialize as CurserRecord({...}) due to the nested mapping + sptr_curserRecord.active = true; + sptr_curserRecord.weight = voter.curseWeight; + } + } + { + // Initialize the owner's CurserRecord + // We could in principle perform this initialization once in the constructor instead, and save a small bit of gas. + // But configuration changes are relatively infrequent, and keeping the initialization here makes the contract's + // correctness easier to reason about. + CurserRecord storage sptr_ownerCurserRecord = s_curserRecords[OWNER_CURSE_VOTE_ADDR]; + sptr_ownerCurserRecord.active = true; // Assumed by vote/unvote-to-curse logic + sptr_ownerCurserRecord.weight = 0; // Assumed by vote/unvote-to-curse logic + } + s_versionedConfig.blockNumber = uint32(block.number); + emit ConfigSet(configVersion, config); + + s_recordedCurseRelatedOps.push( + RecordedCurseRelatedOp({ + tag: RecordedCurseRelatedOpTag.SetConfig, + blockTimestamp: _blockTimestamp(), + cursed: false, + curseVoteAddr: address(0), + curseId: bytes16(0), + subject: bytes16(0) + }) + ); + } +} diff --git a/contracts/src/v0.8/ccip/Router.sol b/contracts/src/v0.8/ccip/Router.sol new file mode 100644 index 00000000000..a5474fdd042 --- /dev/null +++ b/contracts/src/v0.8/ccip/Router.sol @@ -0,0 +1,290 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {ITypeAndVersion} from "../shared/interfaces/ITypeAndVersion.sol"; +import {IAny2EVMMessageReceiver} from "./interfaces/IAny2EVMMessageReceiver.sol"; +import {IEVM2AnyOnRamp} from "./interfaces/IEVM2AnyOnRamp.sol"; +import {IRMN} from "./interfaces/IRMN.sol"; +import {IRouter} from "./interfaces/IRouter.sol"; +import {IRouterClient} from "./interfaces/IRouterClient.sol"; +import {IWrappedNative} from "./interfaces/IWrappedNative.sol"; + +import {OwnerIsCreator} from "../shared/access/OwnerIsCreator.sol"; +import {CallWithExactGas} from "../shared/call/CallWithExactGas.sol"; +import {Client} from "./libraries/Client.sol"; +import {Internal} from "./libraries/Internal.sol"; + +import {IERC20} from "../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/IERC20.sol"; +import {SafeERC20} from "../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/utils/SafeERC20.sol"; +import {EnumerableSet} from "../vendor/openzeppelin-solidity/v5.0.2/contracts/utils/structs/EnumerableSet.sol"; + +/// @title Router +/// @notice This is the entry point for the end user wishing to send data across chains. +/// @dev This contract is used as a router for both on-ramps and off-ramps +contract Router is IRouter, IRouterClient, ITypeAndVersion, OwnerIsCreator { + using SafeERC20 for IERC20; + using EnumerableSet for EnumerableSet.UintSet; + + error FailedToSendValue(); + error InvalidRecipientAddress(address to); + error OffRampMismatch(uint64 chainSelector, address offRamp); + error BadARMSignal(); + + event OnRampSet(uint64 indexed destChainSelector, address onRamp); + event OffRampAdded(uint64 indexed sourceChainSelector, address offRamp); + event OffRampRemoved(uint64 indexed sourceChainSelector, address offRamp); + event MessageExecuted(bytes32 messageId, uint64 sourceChainSelector, address offRamp, bytes32 calldataHash); + + struct OnRamp { + uint64 destChainSelector; + address onRamp; + } + + struct OffRamp { + uint64 sourceChainSelector; + address offRamp; + } + + string public constant override typeAndVersion = "Router 1.2.0"; + // We limit return data to a selector plus 4 words. This is to avoid + // malicious contracts from returning large amounts of data and causing + // repeated out-of-gas scenarios. + uint16 public constant MAX_RET_BYTES = 4 + 4 * 32; + // STATIC CONFIG + // Address of RMN proxy contract (formerly known as ARM) + address private immutable i_armProxy; + + // DYNAMIC CONFIG + address private s_wrappedNative; + // destChainSelector => onRamp address + // Only ever one onRamp enabled at a time for a given destChainSelector. + mapping(uint256 destChainSelector => address onRamp) private s_onRamps; + // Stores [sourceChainSelector << 160 + offramp] as a pair to allow for + // lookups for specific chain/offramp pairs. + EnumerableSet.UintSet private s_chainSelectorAndOffRamps; + + constructor(address wrappedNative, address armProxy) { + // Zero address indicates unsupported auto-wrapping, therefore, unsupported + // native fee token payments. + s_wrappedNative = wrappedNative; + i_armProxy = armProxy; + } + + // ================================================================ + // │ Message sending │ + // ================================================================ + + /// @inheritdoc IRouterClient + function getFee( + uint64 destinationChainSelector, + Client.EVM2AnyMessage memory message + ) external view returns (uint256 fee) { + if (message.feeToken == address(0)) { + // For empty feeToken return native quote. + message.feeToken = address(s_wrappedNative); + } + address onRamp = s_onRamps[destinationChainSelector]; + if (onRamp == address(0)) revert UnsupportedDestinationChain(destinationChainSelector); + return IEVM2AnyOnRamp(onRamp).getFee(destinationChainSelector, message); + } + + /// @notice This functionality has been removed and will revert when called. + function getSupportedTokens(uint64 chainSelector) external view returns (address[] memory) { + if (!isChainSupported(chainSelector)) { + return new address[](0); + } + return IEVM2AnyOnRamp(s_onRamps[uint256(chainSelector)]).getSupportedTokens(chainSelector); + } + + /// @inheritdoc IRouterClient + function isChainSupported(uint64 chainSelector) public view returns (bool) { + return s_onRamps[chainSelector] != address(0); + } + + /// @inheritdoc IRouterClient + function ccipSend( + uint64 destinationChainSelector, + Client.EVM2AnyMessage memory message + ) external payable whenNotCursed returns (bytes32) { + address onRamp = s_onRamps[destinationChainSelector]; + if (onRamp == address(0)) revert UnsupportedDestinationChain(destinationChainSelector); + uint256 feeTokenAmount; + // address(0) signals payment in true native + if (message.feeToken == address(0)) { + // for fee calculation we check the wrapped native price as we wrap + // as part of the native fee coin payment. + message.feeToken = s_wrappedNative; + // We rely on getFee to validate that the feeToken is whitelisted. + feeTokenAmount = IEVM2AnyOnRamp(onRamp).getFee(destinationChainSelector, message); + // Ensure sufficient native. + if (msg.value < feeTokenAmount) revert InsufficientFeeTokenAmount(); + // Wrap and send native payment. + // Note we take the whole msg.value regardless if its larger. + feeTokenAmount = msg.value; + IWrappedNative(message.feeToken).deposit{value: feeTokenAmount}(); + IERC20(message.feeToken).safeTransfer(onRamp, feeTokenAmount); + } else { + if (msg.value > 0) revert InvalidMsgValue(); + // We rely on getFee to validate that the feeToken is whitelisted. + feeTokenAmount = IEVM2AnyOnRamp(onRamp).getFee(destinationChainSelector, message); + IERC20(message.feeToken).safeTransferFrom(msg.sender, onRamp, feeTokenAmount); + } + + // Transfer the tokens to the token pools. + for (uint256 i = 0; i < message.tokenAmounts.length; ++i) { + IERC20 token = IERC20(message.tokenAmounts[i].token); + // We rely on getPoolBySourceToken to validate that the token is whitelisted. + token.safeTransferFrom( + msg.sender, + address(IEVM2AnyOnRamp(onRamp).getPoolBySourceToken(destinationChainSelector, token)), + message.tokenAmounts[i].amount + ); + } + + return IEVM2AnyOnRamp(onRamp).forwardFromRouter(destinationChainSelector, message, feeTokenAmount, msg.sender); + } + + // ================================================================ + // │ Message execution │ + // ================================================================ + + /// @inheritdoc IRouter + /// @dev _callWithExactGas protects against return data bombs by capping the return data size at MAX_RET_BYTES. + function routeMessage( + Client.Any2EVMMessage calldata message, + uint16 gasForCallExactCheck, + uint256 gasLimit, + address receiver + ) external override whenNotCursed returns (bool success, bytes memory retData, uint256 gasUsed) { + // We only permit offRamps to call this function. + if (!isOffRamp(message.sourceChainSelector, msg.sender)) revert OnlyOffRamp(); + + // We encode here instead of the offRamps to constrain specifically what functions + // can be called from the router. + bytes memory data = abi.encodeWithSelector(IAny2EVMMessageReceiver.ccipReceive.selector, message); + + (success, retData, gasUsed) = CallWithExactGas._callWithExactGasSafeReturnData( + data, receiver, gasLimit, gasForCallExactCheck, Internal.MAX_RET_BYTES + ); + + emit MessageExecuted(message.messageId, message.sourceChainSelector, msg.sender, keccak256(data)); + return (success, retData, gasUsed); + } + + // @notice Merges a chain selector and offRamp address into a single uint256 by shifting the + // chain selector 160 bits to the left. + function _mergeChainSelectorAndOffRamp( + uint64 sourceChainSelector, + address offRampAddress + ) internal pure returns (uint256) { + return (uint256(sourceChainSelector) << 160) + uint160(offRampAddress); + } + + // ================================================================ + // │ Config │ + // ================================================================ + + /// @notice Gets the wrapped representation of the native fee coin. + /// @return The address of the ERC20 wrapped native. + function getWrappedNative() external view returns (address) { + return s_wrappedNative; + } + + /// @notice Sets a new wrapped native token. + /// @param wrappedNative The address of the new wrapped native ERC20 token. + function setWrappedNative(address wrappedNative) external onlyOwner { + s_wrappedNative = wrappedNative; + } + + /// @notice Gets the RMN address, formerly known as ARM + /// @return The address of the RMN proxy contract, formerly known as ARM + function getArmProxy() external view returns (address) { + return i_armProxy; + } + + /// @inheritdoc IRouter + function getOnRamp(uint64 destChainSelector) external view returns (address) { + return s_onRamps[destChainSelector]; + } + + function getOffRamps() external view returns (OffRamp[] memory) { + uint256[] memory encodedOffRamps = s_chainSelectorAndOffRamps.values(); + OffRamp[] memory offRamps = new OffRamp[](encodedOffRamps.length); + for (uint256 i = 0; i < encodedOffRamps.length; ++i) { + uint256 encodedOffRamp = encodedOffRamps[i]; + offRamps[i] = + OffRamp({sourceChainSelector: uint64(encodedOffRamp >> 160), offRamp: address(uint160(encodedOffRamp))}); + } + return offRamps; + } + + /// @inheritdoc IRouter + function isOffRamp(uint64 sourceChainSelector, address offRamp) public view returns (bool) { + // We have to encode the sourceChainSelector and offRamp into a uint256 to use as a key in the set. + return s_chainSelectorAndOffRamps.contains(_mergeChainSelectorAndOffRamp(sourceChainSelector, offRamp)); + } + + /// @notice applyRampUpdates applies a set of ramp changes which provides + /// the ability to add new chains and upgrade ramps. + function applyRampUpdates( + OnRamp[] calldata onRampUpdates, + OffRamp[] calldata offRampRemoves, + OffRamp[] calldata offRampAdds + ) external onlyOwner { + // Apply egress updates. + // We permit zero address as way to disable egress. + for (uint256 i = 0; i < onRampUpdates.length; ++i) { + OnRamp memory onRampUpdate = onRampUpdates[i]; + s_onRamps[onRampUpdate.destChainSelector] = onRampUpdate.onRamp; + emit OnRampSet(onRampUpdate.destChainSelector, onRampUpdate.onRamp); + } + + // Apply ingress updates. + for (uint256 i = 0; i < offRampRemoves.length; ++i) { + uint64 sourceChainSelector = offRampRemoves[i].sourceChainSelector; + address offRampAddress = offRampRemoves[i].offRamp; + + // If the selector-offRamp pair does not exist, revert. + if (!s_chainSelectorAndOffRamps.remove(_mergeChainSelectorAndOffRamp(sourceChainSelector, offRampAddress))) { + revert OffRampMismatch(sourceChainSelector, offRampAddress); + } + + emit OffRampRemoved(sourceChainSelector, offRampAddress); + } + + for (uint256 i = 0; i < offRampAdds.length; ++i) { + uint64 sourceChainSelector = offRampAdds[i].sourceChainSelector; + address offRampAddress = offRampAdds[i].offRamp; + + if (s_chainSelectorAndOffRamps.add(_mergeChainSelectorAndOffRamp(sourceChainSelector, offRampAddress))) { + emit OffRampAdded(sourceChainSelector, offRampAddress); + } + } + } + + /// @notice Provides the ability for the owner to recover any tokens accidentally + /// sent to this contract. + /// @dev Must be onlyOwner to avoid malicious token contract calls. + /// @param tokenAddress ERC20-token to recover + /// @param to Destination address to send the tokens to. + function recoverTokens(address tokenAddress, address to, uint256 amount) external onlyOwner { + if (to == address(0)) revert InvalidRecipientAddress(to); + + if (tokenAddress == address(0)) { + (bool success,) = to.call{value: amount}(""); + if (!success) revert FailedToSendValue(); + return; + } + IERC20(tokenAddress).safeTransfer(to, amount); + } + + // ================================================================ + // │ Access │ + // ================================================================ + + /// @notice Ensure that the RMN has not cursed the network. + modifier whenNotCursed() { + if (IRMN(i_armProxy).isCursed()) revert BadARMSignal(); + _; + } +} diff --git a/contracts/src/v0.8/ccip/applications/CCIPClientExample.sol b/contracts/src/v0.8/ccip/applications/CCIPClientExample.sol new file mode 100644 index 00000000000..77816ceadbd --- /dev/null +++ b/contracts/src/v0.8/ccip/applications/CCIPClientExample.sol @@ -0,0 +1,169 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {IRouterClient} from "../interfaces/IRouterClient.sol"; + +import {OwnerIsCreator} from "../../shared/access/OwnerIsCreator.sol"; +import {Client} from "../libraries/Client.sol"; +import {CCIPReceiver} from "./CCIPReceiver.sol"; + +import {IERC20} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/IERC20.sol"; + +// @notice Example of a client which supports EVM/non-EVM chains +// @dev If chain specific logic is required for different chain families (e.g. particular +// decoding the bytes sender for authorization checks), it may be required to point to a helper +// authorization contract unless all chain families are known up front. +// @dev If contract does not implement IAny2EVMMessageReceiver and IERC165, +// and tokens are sent to it, ccipReceive will not be called but tokens will be transferred. +// @dev If the client is upgradeable you have significantly more flexibility and +// can avoid storage based options like the below contract uses. However it's +// worth carefully considering how the trust assumptions of your client dapp will +// change if you introduce upgradeability. An immutable dapp building on top of CCIP +// like the example below will inherit the trust properties of CCIP (i.e. the oracle network). +// @dev The receiver's are encoded offchain and passed as direct arguments to permit supporting +// new chain family receivers (e.g. a Solana encoded receiver address) without upgrading. +contract CCIPClientExample is CCIPReceiver, OwnerIsCreator { + error InvalidChain(uint64 chainSelector); + + event MessageSent(bytes32 messageId); + event MessageReceived(bytes32 messageId); + + // Current feeToken + IERC20 public s_feeToken; + // Below is a simplistic example (same params for all messages) of using storage to allow for new options without + // upgrading the dapp. Note that extra args are chain family specific (e.g. gasLimit is EVM specific etc.). + // and will always be backwards compatible i.e. upgrades are opt-in. + // Offchain we can compute the V1 extraArgs: + // Client.EVMExtraArgsV1 memory extraArgs = Client.EVMExtraArgsV1({gasLimit: 300_000}); + // bytes memory encodedV1ExtraArgs = Client._argsToBytes(extraArgs); + // Then later compute V2 extraArgs, for example if a refund feature was added: + // Client.EVMExtraArgsV2 memory extraArgs = Client.EVMExtraArgsV2({gasLimit: 300_000, destRefundAddress: 0x1234}); + // bytes memory encodedV2ExtraArgs = Client._argsToBytes(extraArgs); + // and update storage with the new args. + // If different options are required for different messages, for example different gas limits, + // one can simply key based on (chainSelector, messageType) instead of only chainSelector. + mapping(uint64 destChainSelector => bytes extraArgsBytes) public s_chains; + + constructor(IRouterClient router, IERC20 feeToken) CCIPReceiver(address(router)) { + s_feeToken = feeToken; + s_feeToken.approve(address(router), type(uint256).max); + } + + function enableChain(uint64 chainSelector, bytes memory extraArgs) external onlyOwner { + s_chains[chainSelector] = extraArgs; + } + + function disableChain(uint64 chainSelector) external onlyOwner { + delete s_chains[chainSelector]; + } + + function ccipReceive( + Client.Any2EVMMessage calldata message + ) external virtual override onlyRouter validChain(message.sourceChainSelector) { + // Extremely important to ensure only router calls this. + // Tokens in message if any will be transferred to this contract + // TODO: Validate sender/origin chain and process message and/or tokens. + _ccipReceive(message); + } + + function _ccipReceive(Client.Any2EVMMessage memory message) internal override { + emit MessageReceived(message.messageId); + } + + /// @notice sends data to receiver on dest chain. Assumes address(this) has sufficient native asset. + function sendDataPayNative( + uint64 destChainSelector, + bytes memory receiver, + bytes memory data + ) external validChain(destChainSelector) { + Client.EVMTokenAmount[] memory tokenAmounts = new Client.EVMTokenAmount[](0); + Client.EVM2AnyMessage memory message = Client.EVM2AnyMessage({ + receiver: receiver, + data: data, + tokenAmounts: tokenAmounts, + extraArgs: s_chains[destChainSelector], + feeToken: address(0) // We leave the feeToken empty indicating we'll pay raw native. + }); + bytes32 messageId = IRouterClient(i_ccipRouter).ccipSend{ + value: IRouterClient(i_ccipRouter).getFee(destChainSelector, message) + }(destChainSelector, message); + emit MessageSent(messageId); + } + + /// @notice sends data to receiver on dest chain. Assumes address(this) has sufficient feeToken. + function sendDataPayFeeToken( + uint64 destChainSelector, + bytes memory receiver, + bytes memory data + ) external validChain(destChainSelector) { + Client.EVMTokenAmount[] memory tokenAmounts = new Client.EVMTokenAmount[](0); + Client.EVM2AnyMessage memory message = Client.EVM2AnyMessage({ + receiver: receiver, + data: data, + tokenAmounts: tokenAmounts, + extraArgs: s_chains[destChainSelector], + feeToken: address(s_feeToken) + }); + // Optional uint256 fee = i_ccipRouter.getFee(destChainSelector, message); + // Can decide if fee is acceptable. + // address(this) must have sufficient feeToken or the send will revert. + bytes32 messageId = IRouterClient(i_ccipRouter).ccipSend(destChainSelector, message); + emit MessageSent(messageId); + } + + /// @notice sends data to receiver on dest chain. Assumes address(this) has sufficient native token. + function sendDataAndTokens( + uint64 destChainSelector, + bytes memory receiver, + bytes memory data, + Client.EVMTokenAmount[] memory tokenAmounts + ) external validChain(destChainSelector) { + for (uint256 i = 0; i < tokenAmounts.length; ++i) { + IERC20(tokenAmounts[i].token).transferFrom(msg.sender, address(this), tokenAmounts[i].amount); + IERC20(tokenAmounts[i].token).approve(i_ccipRouter, tokenAmounts[i].amount); + } + Client.EVM2AnyMessage memory message = Client.EVM2AnyMessage({ + receiver: receiver, + data: data, + tokenAmounts: tokenAmounts, + extraArgs: s_chains[destChainSelector], + feeToken: address(s_feeToken) + }); + // Optional uint256 fee = i_ccipRouter.getFee(destChainSelector, message); + // Can decide if fee is acceptable. + // address(this) must have sufficient feeToken or the send will revert. + bytes32 messageId = IRouterClient(i_ccipRouter).ccipSend(destChainSelector, message); + emit MessageSent(messageId); + } + + // @notice user sends tokens to a receiver + // Approvals can be optimized with a whitelist of tokens and inf approvals if desired. + function sendTokens( + uint64 destChainSelector, + bytes memory receiver, + Client.EVMTokenAmount[] memory tokenAmounts + ) external validChain(destChainSelector) { + for (uint256 i = 0; i < tokenAmounts.length; ++i) { + IERC20(tokenAmounts[i].token).transferFrom(msg.sender, address(this), tokenAmounts[i].amount); + IERC20(tokenAmounts[i].token).approve(i_ccipRouter, tokenAmounts[i].amount); + } + bytes memory data; + Client.EVM2AnyMessage memory message = Client.EVM2AnyMessage({ + receiver: receiver, + data: data, + tokenAmounts: tokenAmounts, + extraArgs: s_chains[destChainSelector], + feeToken: address(s_feeToken) + }); + // Optional uint256 fee = i_ccipRouter.getFee(destChainSelector, message); + // Can decide if fee is acceptable. + // address(this) must have sufficient feeToken or the send will revert. + bytes32 messageId = IRouterClient(i_ccipRouter).ccipSend(destChainSelector, message); + emit MessageSent(messageId); + } + + modifier validChain(uint64 chainSelector) { + if (s_chains[chainSelector].length == 0) revert InvalidChain(chainSelector); + _; + } +} diff --git a/contracts/src/v0.8/ccip/applications/CCIPReceiver.sol b/contracts/src/v0.8/ccip/applications/CCIPReceiver.sol new file mode 100644 index 00000000000..1d4937c77a8 --- /dev/null +++ b/contracts/src/v0.8/ccip/applications/CCIPReceiver.sol @@ -0,0 +1,59 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {IAny2EVMMessageReceiver} from "../interfaces/IAny2EVMMessageReceiver.sol"; + +import {Client} from "../libraries/Client.sol"; + +import {IERC165} from "../../vendor/openzeppelin-solidity/v5.0.2/contracts/utils/introspection/IERC165.sol"; + +/// @title CCIPReceiver - Base contract for CCIP applications that can receive messages. +abstract contract CCIPReceiver is IAny2EVMMessageReceiver, IERC165 { + address internal immutable i_ccipRouter; + + constructor(address router) { + if (router == address(0)) revert InvalidRouter(address(0)); + i_ccipRouter = router; + } + + /// @notice IERC165 supports an interfaceId + /// @param interfaceId The interfaceId to check + /// @return true if the interfaceId is supported + /// @dev Should indicate whether the contract implements IAny2EVMMessageReceiver + /// e.g. return interfaceId == type(IAny2EVMMessageReceiver).interfaceId || interfaceId == type(IERC165).interfaceId + /// This allows CCIP to check if ccipReceive is available before calling it. + /// If this returns false or reverts, only tokens are transferred to the receiver. + /// If this returns true, tokens are transferred and ccipReceive is called atomically. + /// Additionally, if the receiver address does not have code associated with + /// it at the time of execution (EXTCODESIZE returns 0), only tokens will be transferred. + function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { + return interfaceId == type(IAny2EVMMessageReceiver).interfaceId || interfaceId == type(IERC165).interfaceId; + } + + /// @inheritdoc IAny2EVMMessageReceiver + function ccipReceive(Client.Any2EVMMessage calldata message) external virtual override onlyRouter { + _ccipReceive(message); + } + + /// @notice Override this function in your implementation. + /// @param message Any2EVMMessage + function _ccipReceive(Client.Any2EVMMessage memory message) internal virtual; + + ///////////////////////////////////////////////////////////////////// + // Plumbing + ///////////////////////////////////////////////////////////////////// + + /// @notice Return the current router + /// @return CCIP router address + function getRouter() public view virtual returns (address) { + return address(i_ccipRouter); + } + + error InvalidRouter(address router); + + /// @dev only calls from the set router are accepted. + modifier onlyRouter() { + if (msg.sender != getRouter()) revert InvalidRouter(msg.sender); + _; + } +} diff --git a/contracts/src/v0.8/ccip/applications/DefensiveExample.sol b/contracts/src/v0.8/ccip/applications/DefensiveExample.sol new file mode 100644 index 00000000000..89435ccbf1c --- /dev/null +++ b/contracts/src/v0.8/ccip/applications/DefensiveExample.sol @@ -0,0 +1,112 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {IRouterClient} from "../interfaces/IRouterClient.sol"; + +import {Client} from "../libraries/Client.sol"; +import {CCIPClientExample} from "./CCIPClientExample.sol"; + +import {IERC20} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/IERC20.sol"; +import {SafeERC20} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/utils/SafeERC20.sol"; +import {EnumerableMap} from "../../vendor/openzeppelin-solidity/v5.0.2/contracts/utils/structs/EnumerableMap.sol"; + +contract DefensiveExample is CCIPClientExample { + using EnumerableMap for EnumerableMap.Bytes32ToUintMap; + using SafeERC20 for IERC20; + + error OnlySelf(); + error ErrorCase(); + error MessageNotFailed(bytes32 messageId); + + event MessageFailed(bytes32 indexed messageId, bytes reason); + event MessageSucceeded(bytes32 indexed messageId); + event MessageRecovered(bytes32 indexed messageId); + + // Example error code, could have many different error codes. + enum ErrorCode { + // RESOLVED is first so that the default value is resolved. + RESOLVED, + // Could have any number of error codes here. + BASIC + } + + // The message contents of failed messages are stored here. + mapping(bytes32 messageId => Client.Any2EVMMessage contents) public s_messageContents; + + // Contains failed messages and their state. + EnumerableMap.Bytes32ToUintMap internal s_failedMessages; + + // This is used to simulate a revert in the processMessage function. + bool internal s_simRevert = false; + + constructor(IRouterClient router, IERC20 feeToken) CCIPClientExample(router, feeToken) {} + + /// @notice The entrypoint for the CCIP router to call. This function should + /// never revert, all errors should be handled internally in this contract. + /// @param message The message to process. + /// @dev Extremely important to ensure only router calls this. + function ccipReceive( + Client.Any2EVMMessage calldata message + ) external override onlyRouter validChain(message.sourceChainSelector) { + try this.processMessage(message) {} + catch (bytes memory err) { + // Could set different error codes based on the caught error. Each could be + // handled differently. + s_failedMessages.set(message.messageId, uint256(ErrorCode.BASIC)); + s_messageContents[message.messageId] = message; + // Don't revert so CCIP doesn't revert. Emit event instead. + // The message can be retried later without having to do manual execution of CCIP. + emit MessageFailed(message.messageId, err); + return; + } + emit MessageSucceeded(message.messageId); + } + + /// @notice This function the entrypoint for this contract to process messages. + /// @param message The message to process. + /// @dev This example just sends the tokens to the owner of this contracts. More + /// interesting functions could be implemented. + /// @dev It has to be external because of the try/catch. + function processMessage( + Client.Any2EVMMessage calldata message + ) external onlySelf validChain(message.sourceChainSelector) { + // Simulate a revert + if (s_simRevert) revert ErrorCase(); + + // Send tokens to the owner + for (uint256 i = 0; i < message.destTokenAmounts.length; ++i) { + IERC20(message.destTokenAmounts[i].token).safeTransfer(owner(), message.destTokenAmounts[i].amount); + } + // Do other things that might revert + } + + /// @notice This function is callable by the owner when a message has failed + /// to unblock the tokens that are associated with that message. + /// @dev This function is only callable by the owner. + function retryFailedMessage(bytes32 messageId, address tokenReceiver) external onlyOwner { + if (s_failedMessages.get(messageId) != uint256(ErrorCode.BASIC)) revert MessageNotFailed(messageId); + // Set the error code to 0 to disallow reentry and retry the same failed message + // multiple times. + s_failedMessages.set(messageId, uint256(ErrorCode.RESOLVED)); + + // Do stuff to retry message, potentially just releasing the associated tokens + Client.Any2EVMMessage memory message = s_messageContents[messageId]; + + // send the tokens to the receiver as escape hatch + for (uint256 i = 0; i < message.destTokenAmounts.length; ++i) { + IERC20(message.destTokenAmounts[i].token).safeTransfer(tokenReceiver, message.destTokenAmounts[i].amount); + } + + emit MessageRecovered(messageId); + } + + // An example function to demonstrate recovery + function setSimRevert(bool simRevert) external onlyOwner { + s_simRevert = simRevert; + } + + modifier onlySelf() { + if (msg.sender != address(this)) revert OnlySelf(); + _; + } +} diff --git a/contracts/src/v0.8/ccip/applications/EtherSenderReceiver.sol b/contracts/src/v0.8/ccip/applications/EtherSenderReceiver.sol new file mode 100644 index 00000000000..05d604d9c1c --- /dev/null +++ b/contracts/src/v0.8/ccip/applications/EtherSenderReceiver.sol @@ -0,0 +1,178 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {ITypeAndVersion} from "../../shared/interfaces/ITypeAndVersion.sol"; + +import {IRouterClient} from "../interfaces/IRouterClient.sol"; +import {IWrappedNative} from "../interfaces/IWrappedNative.sol"; + +import {Client} from "./../libraries/Client.sol"; +import {CCIPReceiver} from "./CCIPReceiver.sol"; + +import {IERC20} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/IERC20.sol"; +import {SafeERC20} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/utils/SafeERC20.sol"; + +//solhint-disable interface-starts-with-i +interface CCIPRouter { + function getWrappedNative() external view returns (address); +} + +/// @notice A contract that can send raw ether cross-chain using CCIP. +/// Since CCIP only supports ERC-20 token transfers, this contract accepts +/// normal ether, wraps it, and uses CCIP to send it cross-chain. +/// On the receiving side, the wrapped ether is unwrapped and sent to the final receiver. +/// @notice This contract only supports chains where the wrapped native contract +/// is the WETH contract (i.e not WMATIC, or WAVAX, etc.). This is because the +/// receiving contract will always unwrap the ether using it's local wrapped native contract. +/// @dev This contract is both a sender and a receiver. This same contract can be +/// deployed on source and destination chains to facilitate cross-chain ether transfers +/// and act as a sender and a receiver. +/// @dev This contract is intentionally ownerless and permissionless. This contract +/// will never hold any excess funds, native or otherwise, when used correctly. +contract EtherSenderReceiver is CCIPReceiver, ITypeAndVersion { + using SafeERC20 for IERC20; + + error InvalidTokenAmounts(uint256 gotAmounts); + error InvalidToken(address gotToken, address expectedToken); + error TokenAmountNotEqualToMsgValue(uint256 gotAmount, uint256 msgValue); + + string public constant override typeAndVersion = "EtherSenderReceiver 1.5.0"; + + /// @notice The wrapped native token address. + /// @dev If the wrapped native token address changes on the router, this contract will need to be redeployed. + IWrappedNative public immutable i_weth; + + /// @param router The CCIP router address. + constructor(address router) CCIPReceiver(router) { + i_weth = IWrappedNative(CCIPRouter(router).getWrappedNative()); + i_weth.approve(router, type(uint256).max); + } + + /// @notice Need this in order to unwrap correctly. + receive() external payable {} + + /// @notice Get the fee for sending a message to a destination chain. + /// This is mirrored from the router for convenience, construct the appropriate + /// message and get it's fee. + /// @param destinationChainSelector The destination chainSelector + /// @param message The cross-chain CCIP message including data and/or tokens + /// @return fee returns execution fee for the message + /// delivery to destination chain, denominated in the feeToken specified in the message. + /// @dev Reverts with appropriate reason upon invalid message. + function getFee( + uint64 destinationChainSelector, + Client.EVM2AnyMessage calldata message + ) external view returns (uint256 fee) { + Client.EVM2AnyMessage memory validatedMessage = _validatedMessage(message); + + return IRouterClient(getRouter()).getFee(destinationChainSelector, validatedMessage); + } + + /// @notice Send raw native tokens cross-chain. + /// @param destinationChainSelector The destination chain selector. + /// @param message The CCIP message with the following fields correctly set: + /// - bytes receiver: The _contract_ address on the destination chain that will receive the wrapped ether. + /// The caller must ensure that this contract address is correct, otherwise funds may be lost forever. + /// - address feeToken: The fee token address. Must be address(0) for native tokens, or a supported CCIP fee token otherwise (i.e, LINK token). + /// In the event a feeToken is set, we will transferFrom the caller the fee amount before sending the message, in order to forward them to the router. + /// - EVMTokenAmount[] tokenAmounts: The tokenAmounts array must contain a single element with the following fields: + /// - uint256 amount: The amount of ether to send. + /// There are a couple of cases here that depend on the fee token specified: + /// 1. If feeToken == address(0), the fee must be included in msg.value. Therefore tokenAmounts[0].amount must be less than msg.value, + /// and the difference will be used as the fee. + /// 2. If feeToken != address(0), the fee is not included in msg.value, and tokenAmounts[0].amount must be equal to msg.value. + /// these fees to the CCIP router. + /// @return messageId The CCIP message ID. + function ccipSend( + uint64 destinationChainSelector, + Client.EVM2AnyMessage calldata message + ) external payable returns (bytes32) { + _validateFeeToken(message); + Client.EVM2AnyMessage memory validatedMessage = _validatedMessage(message); + + i_weth.deposit{value: validatedMessage.tokenAmounts[0].amount}(); + + uint256 fee = IRouterClient(getRouter()).getFee(destinationChainSelector, validatedMessage); + if (validatedMessage.feeToken != address(0)) { + // If the fee token is not native, we need to transfer the fee to this contract and re-approve it to the router. + // Its not possible to have any leftover tokens in this path because we transferFrom the exact fee that CCIP + // requires from the caller. + IERC20(validatedMessage.feeToken).safeTransferFrom(msg.sender, address(this), fee); + + // We gave an infinite approval of weth to the router in the constructor. + if (validatedMessage.feeToken != address(i_weth)) { + IERC20(validatedMessage.feeToken).approve(getRouter(), fee); + } + + return IRouterClient(getRouter()).ccipSend(destinationChainSelector, validatedMessage); + } + + // We don't want to keep any excess ether in this contract, so we send over the entire address(this).balance as the fee. + // CCIP will revert if the fee is insufficient, so we don't need to check here. + return IRouterClient(getRouter()).ccipSend{value: address(this).balance}(destinationChainSelector, validatedMessage); + } + + /// @notice Validate the message content. + /// @dev Only allows a single token to be sent. Always overwritten to be address(i_weth) + /// and receiver is always msg.sender. + function _validatedMessage( + Client.EVM2AnyMessage calldata message + ) internal view returns (Client.EVM2AnyMessage memory) { + Client.EVM2AnyMessage memory validatedMessage = message; + + if (validatedMessage.tokenAmounts.length != 1) { + revert InvalidTokenAmounts(validatedMessage.tokenAmounts.length); + } + + validatedMessage.data = abi.encode(msg.sender); + validatedMessage.tokenAmounts[0].token = address(i_weth); + + return validatedMessage; + } + + function _validateFeeToken(Client.EVM2AnyMessage calldata message) internal view { + uint256 tokenAmount = message.tokenAmounts[0].amount; + + if (message.feeToken != address(0)) { + // If the fee token is NOT native, then the token amount must be equal to msg.value. + // This is done to ensure that there is no leftover ether in this contract. + if (msg.value != tokenAmount) { + revert TokenAmountNotEqualToMsgValue(tokenAmount, msg.value); + } + } + } + + /// @notice Receive the wrapped ether, unwrap it, and send it to the specified EOA in the data field. + /// @param message The CCIP message containing the wrapped ether amount and the final receiver. + /// @dev The code below should never revert if the message being is valid according + /// to the above _validatedMessage and _validateFeeToken functions. + function _ccipReceive(Client.Any2EVMMessage memory message) internal override { + address receiver = abi.decode(message.data, (address)); + + if (message.destTokenAmounts.length != 1) { + revert InvalidTokenAmounts(message.destTokenAmounts.length); + } + + if (message.destTokenAmounts[0].token != address(i_weth)) { + revert InvalidToken(message.destTokenAmounts[0].token, address(i_weth)); + } + + uint256 tokenAmount = message.destTokenAmounts[0].amount; + i_weth.withdraw(tokenAmount); + + // it is possible that the below call may fail if receiver.code.length > 0 and the contract + // doesn't e.g have a receive() or a fallback() function. + (bool success,) = payable(receiver).call{value: tokenAmount}(""); + if (!success) { + // We have a few options here: + // 1. Revert: this is bad generally because it may mean that these tokens are stuck. + // 2. Store the tokens in a mapping and allow the user to withdraw them with another tx. + // 3. Send WETH to the receiver address. + // We opt for (3) here because at least the receiver will have the funds and can unwrap them if needed. + // However it is worth noting that if receiver is actually a contract AND the contract _cannot_ withdraw + // the WETH, then the WETH will be stuck in this contract. + i_weth.deposit{value: tokenAmount}(); + i_weth.transfer(receiver, tokenAmount); + } + } +} diff --git a/contracts/src/v0.8/ccip/applications/PingPongDemo.sol b/contracts/src/v0.8/ccip/applications/PingPongDemo.sol new file mode 100644 index 00000000000..b902c476185 --- /dev/null +++ b/contracts/src/v0.8/ccip/applications/PingPongDemo.sol @@ -0,0 +1,118 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {ITypeAndVersion} from "../../shared/interfaces/ITypeAndVersion.sol"; +import {IRouterClient} from "../interfaces/IRouterClient.sol"; + +import {OwnerIsCreator} from "../../shared/access/OwnerIsCreator.sol"; +import {Client} from "../libraries/Client.sol"; +import {CCIPReceiver} from "./CCIPReceiver.sol"; + +import {IERC20} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/IERC20.sol"; + +/// @title PingPongDemo - A simple ping-pong contract for demonstrating cross-chain communication +contract PingPongDemo is CCIPReceiver, OwnerIsCreator, ITypeAndVersion { + event Ping(uint256 pingPongCount); + event Pong(uint256 pingPongCount); + event OutOfOrderExecutionChange(bool isOutOfOrder); + + // Default gas limit used for EVMExtraArgsV2 construction + uint64 private constant DEFAULT_GAS_LIMIT = 200_000; + + // The chain ID of the counterpart ping pong contract + uint64 internal s_counterpartChainSelector; + // The contract address of the counterpart ping pong contract + address internal s_counterpartAddress; + // Pause ping-ponging + bool private s_isPaused; + // The fee token used to pay for CCIP transactions + IERC20 internal s_feeToken; + // Allowing out of order execution + bool private s_outOfOrderExecution; + + constructor(address router, IERC20 feeToken) CCIPReceiver(router) { + s_isPaused = false; + s_feeToken = feeToken; + s_feeToken.approve(address(router), type(uint256).max); + } + + function typeAndVersion() external pure virtual returns (string memory) { + return "PingPongDemo 1.5.0"; + } + + function setCounterpart(uint64 counterpartChainSelector, address counterpartAddress) external onlyOwner { + s_counterpartChainSelector = counterpartChainSelector; + s_counterpartAddress = counterpartAddress; + } + + function startPingPong() external onlyOwner { + s_isPaused = false; + _respond(1); + } + + function _respond(uint256 pingPongCount) internal virtual { + if (pingPongCount & 1 == 1) { + emit Ping(pingPongCount); + } else { + emit Pong(pingPongCount); + } + Client.EVM2AnyMessage memory message = Client.EVM2AnyMessage({ + receiver: abi.encode(s_counterpartAddress), + data: abi.encode(pingPongCount), + tokenAmounts: new Client.EVMTokenAmount[](0), + extraArgs: Client._argsToBytes( + Client.EVMExtraArgsV2({gasLimit: uint256(DEFAULT_GAS_LIMIT), allowOutOfOrderExecution: s_outOfOrderExecution}) + ), + feeToken: address(s_feeToken) + }); + IRouterClient(getRouter()).ccipSend(s_counterpartChainSelector, message); + } + + function _ccipReceive(Client.Any2EVMMessage memory message) internal override { + uint256 pingPongCount = abi.decode(message.data, (uint256)); + if (!s_isPaused) { + _respond(pingPongCount + 1); + } + } + + ///////////////////////////////////////////////////////////////////// + // Plumbing + ///////////////////////////////////////////////////////////////////// + + function getCounterpartChainSelector() external view returns (uint64) { + return s_counterpartChainSelector; + } + + function setCounterpartChainSelector(uint64 chainSelector) external onlyOwner { + s_counterpartChainSelector = chainSelector; + } + + function getCounterpartAddress() external view returns (address) { + return s_counterpartAddress; + } + + function getFeeToken() external view returns (IERC20) { + return s_feeToken; + } + + function setCounterpartAddress(address addr) external onlyOwner { + s_counterpartAddress = addr; + } + + function isPaused() external view returns (bool) { + return s_isPaused; + } + + function setPaused(bool pause) external onlyOwner { + s_isPaused = pause; + } + + function getOutOfOrderExecution() external view returns (bool) { + return s_outOfOrderExecution; + } + + function setOutOfOrderExecution(bool outOfOrderExecution) external onlyOwner { + s_outOfOrderExecution = outOfOrderExecution; + emit OutOfOrderExecutionChange(outOfOrderExecution); + } +} diff --git a/contracts/src/v0.8/ccip/applications/SelfFundedPingPong.sol b/contracts/src/v0.8/ccip/applications/SelfFundedPingPong.sol new file mode 100644 index 00000000000..f9e4fd0aa6e --- /dev/null +++ b/contracts/src/v0.8/ccip/applications/SelfFundedPingPong.sol @@ -0,0 +1,67 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {Router} from "../Router.sol"; +import {Client} from "../libraries/Client.sol"; +import {EVM2EVMOnRamp} from "../onRamp/EVM2EVMOnRamp.sol"; +import {PingPongDemo} from "./PingPongDemo.sol"; + +import {IERC20} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/IERC20.sol"; + +contract SelfFundedPingPong is PingPongDemo { + string public constant override typeAndVersion = "SelfFundedPingPong 1.5.0"; + + event Funded(); + event CountIncrBeforeFundingSet(uint8 countIncrBeforeFunding); + + // Defines the increase in ping pong count before self-funding is attempted. + // Set to 0 to disable auto-funding, auto-funding only works for ping-pongs that are set as NOPs in the onRamp. + uint8 private s_countIncrBeforeFunding; + + constructor(address router, IERC20 feeToken, uint8 roundTripsBeforeFunding) PingPongDemo(router, feeToken) { + // PingPong count increases by 2 for each round trip. + s_countIncrBeforeFunding = roundTripsBeforeFunding * 2; + } + + function _respond(uint256 pingPongCount) internal override { + if (pingPongCount & 1 == 1) { + emit Ping(pingPongCount); + } else { + emit Pong(pingPongCount); + } + + fundPingPong(pingPongCount); + + Client.EVM2AnyMessage memory message = Client.EVM2AnyMessage({ + receiver: abi.encode(s_counterpartAddress), + data: abi.encode(pingPongCount), + tokenAmounts: new Client.EVMTokenAmount[](0), + extraArgs: "", + feeToken: address(s_feeToken) + }); + Router(getRouter()).ccipSend(s_counterpartChainSelector, message); + } + + /// @notice A function that is responsible for funding this contract. + /// The contract can only be funded if it is set as a nop in the target onRamp. + /// In case your contract is not a nop you can prevent this function from being called by setting s_countIncrBeforeFunding=0. + function fundPingPong(uint256 pingPongCount) public { + // If selfFunding is disabled, or ping pong count has not reached s_countIncrPerFunding, do not attempt funding. + if (s_countIncrBeforeFunding == 0 || pingPongCount < s_countIncrBeforeFunding) return; + + // Ping pong on one side will always be even, one side will always to odd. + if (pingPongCount % s_countIncrBeforeFunding <= 1) { + EVM2EVMOnRamp(Router(getRouter()).getOnRamp(s_counterpartChainSelector)).payNops(); + emit Funded(); + } + } + + function getCountIncrBeforeFunding() external view returns (uint8) { + return s_countIncrBeforeFunding; + } + + function setCountIncrBeforeFunding(uint8 countIncrBeforeFunding) external onlyOwner { + s_countIncrBeforeFunding = countIncrBeforeFunding; + emit CountIncrBeforeFundingSet(countIncrBeforeFunding); + } +} diff --git a/contracts/src/v0.8/ccip/applications/TokenProxy.sol b/contracts/src/v0.8/ccip/applications/TokenProxy.sol new file mode 100644 index 00000000000..6fd26c076bc --- /dev/null +++ b/contracts/src/v0.8/ccip/applications/TokenProxy.sol @@ -0,0 +1,87 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.24; + +import {IRouterClient} from "../interfaces/IRouterClient.sol"; + +import {OwnerIsCreator} from "../../shared/access/OwnerIsCreator.sol"; +import {Client} from "../libraries/Client.sol"; + +import {IERC20} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/IERC20.sol"; +import {SafeERC20} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/utils/SafeERC20.sol"; + +contract TokenProxy is OwnerIsCreator { + using SafeERC20 for IERC20; + + error InvalidToken(); + error NoDataAllowed(); + error GasShouldBeZero(); + + /// @notice The CCIP router contract + IRouterClient internal immutable i_ccipRouter; + /// @notice Only this token is allowed to be sent using this proxy + address internal immutable i_token; + + constructor(address router, address token) OwnerIsCreator() { + i_ccipRouter = IRouterClient(router); + i_token = token; + // Approve the router to spend an unlimited amount of tokens to reduce + // gas cost per tx. + IERC20(token).approve(router, type(uint256).max); + } + + /// @notice Simply forwards the request to the CCIP router and returns the result. + /// @param destinationChainSelector The destination chainSelector + /// @param message The cross-chain CCIP message including data and/or tokens + /// @return fee returns execution fee for the message delivery to destination chain, + /// denominated in the feeToken specified in the message. + /// @dev Reverts with appropriate reason upon invalid message. + function getFee( + uint64 destinationChainSelector, + Client.EVM2AnyMessage calldata message + ) external view returns (uint256 fee) { + _validateMessage(message); + return i_ccipRouter.getFee(destinationChainSelector, message); + } + + /// @notice Validates the message content, forwards it to the CCIP router and returns the result. + function ccipSend( + uint64 destinationChainSelector, + Client.EVM2AnyMessage calldata message + ) external payable returns (bytes32 messageId) { + _validateMessage(message); + if (message.feeToken != address(0)) { + // This path is probably warmed up already so the extra cost isn't too bad. + uint256 feeAmount = i_ccipRouter.getFee(destinationChainSelector, message); + IERC20(message.feeToken).safeTransferFrom(msg.sender, address(this), feeAmount); + IERC20(message.feeToken).approve(address(i_ccipRouter), feeAmount); + } + + // Transfer the tokens from the sender to this contract. + IERC20(message.tokenAmounts[0].token).transferFrom(msg.sender, address(this), message.tokenAmounts[0].amount); + + return i_ccipRouter.ccipSend{value: msg.value}(destinationChainSelector, message); + } + + /// @notice Validates the message content. + /// @dev Only allows a single token to be sent, and no data. + function _validateMessage(Client.EVM2AnyMessage calldata message) internal view { + if (message.tokenAmounts.length != 1 || message.tokenAmounts[0].token != i_token) revert InvalidToken(); + if (message.data.length > 0) revert NoDataAllowed(); + + if (message.extraArgs.length == 0 || bytes4(message.extraArgs) != Client.EVM_EXTRA_ARGS_V1_TAG) { + revert GasShouldBeZero(); + } + + if (abi.decode(message.extraArgs[4:], (Client.EVMExtraArgsV1)).gasLimit != 0) revert GasShouldBeZero(); + } + + /// @notice Returns the CCIP router contract. + function getRouter() external view returns (IRouterClient) { + return i_ccipRouter; + } + + /// @notice Returns the token that this proxy is allowed to send. + function getToken() external view returns (address) { + return i_token; + } +} diff --git a/contracts/src/v0.8/ccip/capability/CCIPConfig.sol b/contracts/src/v0.8/ccip/capability/CCIPConfig.sol new file mode 100644 index 00000000000..463a7103351 --- /dev/null +++ b/contracts/src/v0.8/ccip/capability/CCIPConfig.sol @@ -0,0 +1,501 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {ICapabilityConfiguration} from "../../keystone/interfaces/ICapabilityConfiguration.sol"; +import {ITypeAndVersion} from "../../shared/interfaces/ITypeAndVersion.sol"; +import {ICapabilitiesRegistry} from "./interfaces/ICapabilitiesRegistry.sol"; + +import {OwnerIsCreator} from "../../shared/access/OwnerIsCreator.sol"; +import {Internal} from "../libraries/Internal.sol"; +import {CCIPConfigTypes} from "./libraries/CCIPConfigTypes.sol"; + +import {IERC165} from "../../vendor/openzeppelin-solidity/v5.0.2/contracts/interfaces/IERC165.sol"; +import {EnumerableSet} from "../../vendor/openzeppelin-solidity/v5.0.2/contracts/utils/structs/EnumerableSet.sol"; + +/// @notice CCIPConfig stores the configuration for the CCIP capability. +/// We have two classes of configuration: chain configuration and DON (in the CapabilitiesRegistry sense) configuration. +/// Each chain will have a single configuration which includes information like the router address. +/// Each CR DON will have up to four configurations: for each of (commit, exec), one blue and one green configuration. +/// This is done in order to achieve "blue-green" deployments. +contract CCIPConfig is ITypeAndVersion, ICapabilityConfiguration, OwnerIsCreator, IERC165 { + using EnumerableSet for EnumerableSet.UintSet; + + /// @notice Emitted when a chain's configuration is set. + /// @param chainSelector The chain selector. + /// @param chainConfig The chain configuration. + event ChainConfigSet(uint64 chainSelector, CCIPConfigTypes.ChainConfig chainConfig); + /// @notice Emitted when a chain's configuration is removed. + /// @param chainSelector The chain selector. + event ChainConfigRemoved(uint64 chainSelector); + + error NodeNotInRegistry(bytes32 p2pId); + error OnlyCapabilitiesRegistryCanCall(); + error ChainSelectorNotFound(uint64 chainSelector); + error ChainSelectorNotSet(); + error TooManyOCR3Configs(); + error TooManySigners(); + error P2PIdsLengthNotMatching(uint256 p2pIdsLength, uint256 signersLength, uint256 transmittersLength); + error NotEnoughTransmitters(uint256 got, uint256 minimum); + error FMustBePositive(); + error FChainMustBePositive(); + error FTooHigh(); + error InvalidPluginType(); + error OfframpAddressCannotBeZero(); + error InvalidConfigLength(uint256 length); + error InvalidConfigStateTransition( + CCIPConfigTypes.ConfigState currentState, CCIPConfigTypes.ConfigState proposedState + ); + error NonExistentConfigTransition(); + error WrongConfigCount(uint64 got, uint64 expected); + error WrongConfigDigest(bytes32 got, bytes32 expected); + error WrongConfigDigestBlueGreen(bytes32 got, bytes32 expected); + error ZeroAddressNotAllowed(); + + /// @notice Type and version override. + string public constant override typeAndVersion = "CCIPConfig 1.6.0-dev"; + + /// @notice The canonical capabilities registry address. + address internal immutable i_capabilitiesRegistry; + + uint8 internal constant MAX_OCR3_CONFIGS_PER_PLUGIN = 2; + uint8 internal constant MAX_OCR3_CONFIGS_PER_DON = 4; + uint256 internal constant CONFIG_DIGEST_PREFIX_MASK = type(uint256).max << (256 - 16); // 0xFFFF00..0 + /// @dev must be equal to libocr multi role: https://github.com/smartcontractkit/libocr/blob/ae747ca5b81236ffdbf1714318c652e923a5ff4d/offchainreporting2plus/types/config_digest.go#L28 + uint256 internal constant CONFIG_DIGEST_PREFIX = 0x000a << (256 - 16); // 0x000a00..00 + bytes32 internal constant EMPTY_ENCODED_ADDRESS_HASH = keccak256(abi.encode(address(0))); + /// @dev 256 is the hard limit due to the bit encoding of their indexes into a uint256. + uint256 internal constant MAX_NUM_ORACLES = 256; + + /// @notice chain configuration for each chain that CCIP is deployed on. + mapping(uint64 chainSelector => CCIPConfigTypes.ChainConfig chainConfig) internal s_chainConfigurations; + + /// @notice All chains that are configured. + EnumerableSet.UintSet internal s_remoteChainSelectors; + + /// @notice OCR3 configurations for each DON. + /// Each CR DON will have a commit and execution configuration. + /// This means that a DON can have up to 4 configurations, since we are implementing blue/green deployments. + mapping( + uint32 donId => mapping(Internal.OCRPluginType pluginType => CCIPConfigTypes.OCR3ConfigWithMeta[] ocr3Configs) + ) internal s_ocr3Configs; + + /// @param capabilitiesRegistry the canonical capabilities registry address. + constructor(address capabilitiesRegistry) { + if (capabilitiesRegistry == address(0)) { + revert ZeroAddressNotAllowed(); + } + i_capabilitiesRegistry = capabilitiesRegistry; + } + + /// @inheritdoc IERC165 + function supportsInterface(bytes4 interfaceId) external pure override returns (bool) { + return interfaceId == type(ICapabilityConfiguration).interfaceId || interfaceId == type(IERC165).interfaceId; + } + + // ================================================================ + // │ Config Getters │ + // ================================================================ + /// @notice Returns the capabilities registry address. + /// @return The capabilities registry address. + function getCapabilityRegistry() external view returns (address) { + return i_capabilitiesRegistry; + } + + /// @notice Returns all the chain configurations. + /// @param pageIndex The page index. + /// @param pageSize The page size. + /// @return paginatedChainConfigs chain configurations. + function getAllChainConfigs( + uint256 pageIndex, + uint256 pageSize + ) external view returns (CCIPConfigTypes.ChainConfigInfo[] memory) { + uint256 totalItems = s_remoteChainSelectors.length(); // Total number of chain selectors + uint256 startIndex = pageIndex * pageSize; + + if (pageSize == 0 || startIndex >= totalItems) { + return new CCIPConfigTypes.ChainConfigInfo[](0); // Return an empty array if pageSize is 0 or pageIndex is out of bounds + } + + uint256 endIndex = startIndex + pageSize; + if (endIndex > totalItems) { + endIndex = totalItems; + } + + CCIPConfigTypes.ChainConfigInfo[] memory paginatedChainConfigs = + new CCIPConfigTypes.ChainConfigInfo[](endIndex - startIndex); + + uint256[] memory chainSelectors = s_remoteChainSelectors.values(); + for (uint256 i = startIndex; i < endIndex; ++i) { + uint64 chainSelector = uint64(chainSelectors[i]); + paginatedChainConfigs[i - startIndex] = CCIPConfigTypes.ChainConfigInfo({ + chainSelector: chainSelector, + chainConfig: s_chainConfigurations[chainSelector] + }); + } + + return paginatedChainConfigs; + } + + /// @notice Returns the OCR configuration for the given don ID and plugin type. + /// @param donId The DON ID. + /// @param pluginType The plugin type. + /// @return The OCR3 configurations, up to 2 (blue and green). + function getOCRConfig( + uint32 donId, + Internal.OCRPluginType pluginType + ) external view returns (CCIPConfigTypes.OCR3ConfigWithMeta[] memory) { + return s_ocr3Configs[donId][pluginType]; + } + + // ================================================================ + // │ Capability Configuration │ + // ================================================================ + + /// @inheritdoc ICapabilityConfiguration + /// @dev The CCIP capability will fetch the configuration needed directly from this contract. + /// The offchain syncer will call this function, however, so its important that it doesn't revert. + function getCapabilityConfiguration(uint32 /* donId */ ) external pure override returns (bytes memory configuration) { + return bytes(""); + } + + /// @notice Called by the registry prior to the config being set for a particular DON. + function beforeCapabilityConfigSet( + bytes32[] calldata, /* nodes */ + bytes calldata config, + uint64, /* configCount */ + uint32 donId + ) external override { + if (msg.sender != i_capabilitiesRegistry) { + revert OnlyCapabilitiesRegistryCanCall(); + } + + (CCIPConfigTypes.OCR3Config[] memory commitConfigs, CCIPConfigTypes.OCR3Config[] memory execConfigs) = + _groupByPluginType(abi.decode(config, (CCIPConfigTypes.OCR3Config[]))); + if (commitConfigs.length > 0) { + _updatePluginConfig(donId, Internal.OCRPluginType.Commit, commitConfigs); + } + if (execConfigs.length > 0) { + _updatePluginConfig(donId, Internal.OCRPluginType.Execution, execConfigs); + } + } + + /// @notice Sets a new OCR3 config for a specific plugin type for a DON. + /// @param donId The DON ID. + /// @param pluginType The plugin type. + /// @param newConfig The new configuration. + function _updatePluginConfig( + uint32 donId, + Internal.OCRPluginType pluginType, + CCIPConfigTypes.OCR3Config[] memory newConfig + ) internal { + CCIPConfigTypes.OCR3ConfigWithMeta[] memory currentConfig = s_ocr3Configs[donId][pluginType]; + + // Validate the state transition being proposed, which is implicitly defined by the combination + // of lengths of the current and new configurations. + CCIPConfigTypes.ConfigState currentState = _stateFromConfigLength(currentConfig.length); + CCIPConfigTypes.ConfigState proposedState = _stateFromConfigLength(newConfig.length); + _validateConfigStateTransition(currentState, proposedState); + + // Build the new configuration with metadata and validate that the transition is valid. + CCIPConfigTypes.OCR3ConfigWithMeta[] memory newConfigWithMeta = + _computeNewConfigWithMeta(donId, currentConfig, newConfig, currentState, proposedState); + _validateConfigTransition(currentConfig, newConfigWithMeta); + + // Update contract state with new configuration if its valid. + // We won't run out of gas from this delete since the array is at most 2 elements long. + delete s_ocr3Configs[donId][pluginType]; + for (uint256 i = 0; i < newConfigWithMeta.length; ++i) { + s_ocr3Configs[donId][pluginType].push(newConfigWithMeta[i]); + } + } + + // ================================================================ + // │ Config State Machine │ + // ================================================================ + + /// @notice Determine the config state of the configuration from the length of the config. + /// @param configLen The length of the configuration. + /// @return The config state. + function _stateFromConfigLength(uint256 configLen) internal pure returns (CCIPConfigTypes.ConfigState) { + if (configLen > 2) { + revert InvalidConfigLength(configLen); + } + return CCIPConfigTypes.ConfigState(configLen); + } + + /// @notice Validates the state transition between two config states. + /// The only valid state transitions are the following: + /// Init -> Running (first ever config) + /// Running -> Staging (blue/green proposal) + /// Staging -> Running (promotion) + /// Everything else is invalid and should revert. + /// @param currentState The current state. + /// @param newState The new state. + function _validateConfigStateTransition( + CCIPConfigTypes.ConfigState currentState, + CCIPConfigTypes.ConfigState newState + ) internal pure { + // Calculate the difference between the new state and the current state + int256 stateDiff = int256(uint256(newState)) - int256(uint256(currentState)); + + // Check if the state transition is valid: + // Valid transitions: + // 1. currentState -> newState (where stateDiff == 1) + // e.g., init -> running or running -> staging + // 2. staging -> running (where stateDiff == -1) + if (stateDiff == 1 || (stateDiff == -1 && currentState == CCIPConfigTypes.ConfigState.Staging)) { + return; + } + revert InvalidConfigStateTransition(currentState, newState); + } + + /// @notice Validates the transition between two OCR3 configurations. + /// @param currentConfig The current configuration with metadata. + /// @param newConfigWithMeta The new configuration with metadata. + function _validateConfigTransition( + CCIPConfigTypes.OCR3ConfigWithMeta[] memory currentConfig, + CCIPConfigTypes.OCR3ConfigWithMeta[] memory newConfigWithMeta + ) internal pure { + uint256 currentConfigLen = currentConfig.length; + uint256 newConfigLen = newConfigWithMeta.length; + if (currentConfigLen == 0 && newConfigLen == 1) { + // Config counts always must start at 1 for the first ever config. + if (newConfigWithMeta[0].configCount != 1) { + revert WrongConfigCount(newConfigWithMeta[0].configCount, 1); + } + return; + } + + if (currentConfigLen == 1 && newConfigLen == 2) { + // On a blue/green proposal: + // * the config digest of the blue config must remain unchanged. + // * the green config count must be the blue config count + 1. + if (newConfigWithMeta[0].configDigest != currentConfig[0].configDigest) { + revert WrongConfigDigestBlueGreen(newConfigWithMeta[0].configDigest, currentConfig[0].configDigest); + } + if (newConfigWithMeta[1].configCount != currentConfig[0].configCount + 1) { + revert WrongConfigCount(newConfigWithMeta[1].configCount, currentConfig[0].configCount + 1); + } + return; + } + + if (currentConfigLen == 2 && newConfigLen == 1) { + // On a promotion, the green config digest must become the blue config digest. + if (newConfigWithMeta[0].configDigest != currentConfig[1].configDigest) { + revert WrongConfigDigest(newConfigWithMeta[0].configDigest, currentConfig[1].configDigest); + } + return; + } + + revert NonExistentConfigTransition(); + } + + /// @notice Computes a new configuration with metadata based on the current configuration and the new configuration. + /// @param donId The DON ID. + /// @param currentConfig The current configuration, including metadata. + /// @param newConfig The new configuration, without metadata. + /// @param currentState The current state of the configuration. + /// @param newState The new state of the configuration. + /// @return The new configuration with metadata. + function _computeNewConfigWithMeta( + uint32 donId, + CCIPConfigTypes.OCR3ConfigWithMeta[] memory currentConfig, + CCIPConfigTypes.OCR3Config[] memory newConfig, + CCIPConfigTypes.ConfigState currentState, + CCIPConfigTypes.ConfigState newState + ) internal view returns (CCIPConfigTypes.OCR3ConfigWithMeta[] memory) { + uint64[] memory configCounts = new uint64[](newConfig.length); + + // Set config counts based on the only valid state transitions. + // Init -> Running (first ever config) + // Running -> Staging (blue/green proposal) + // Staging -> Running (promotion) + if (currentState == CCIPConfigTypes.ConfigState.Init && newState == CCIPConfigTypes.ConfigState.Running) { + // First ever config starts with config count == 1. + configCounts[0] = 1; + } else if (currentState == CCIPConfigTypes.ConfigState.Running && newState == CCIPConfigTypes.ConfigState.Staging) { + // On a blue/green proposal, the config count of the green config is the blue config count + 1. + configCounts[0] = currentConfig[0].configCount; + configCounts[1] = currentConfig[0].configCount + 1; + } else if (currentState == CCIPConfigTypes.ConfigState.Staging && newState == CCIPConfigTypes.ConfigState.Running) { + // On a promotion, the config count of the green config becomes the blue config count. + configCounts[0] = currentConfig[1].configCount; + } else { + revert InvalidConfigStateTransition(currentState, newState); + } + + CCIPConfigTypes.OCR3ConfigWithMeta[] memory newConfigWithMeta = + new CCIPConfigTypes.OCR3ConfigWithMeta[](newConfig.length); + for (uint256 i = 0; i < configCounts.length; ++i) { + _validateConfig(newConfig[i]); + newConfigWithMeta[i] = CCIPConfigTypes.OCR3ConfigWithMeta({ + config: newConfig[i], + configCount: configCounts[i], + configDigest: _computeConfigDigest(donId, configCounts[i], newConfig[i]) + }); + } + + return newConfigWithMeta; + } + + /// @notice Group the OCR3 configurations by plugin type for further processing. + /// @param ocr3Configs The OCR3 configurations to group. + /// @return commitConfigs The commit configurations. + /// @return execConfigs The execution configurations. + function _groupByPluginType( + CCIPConfigTypes.OCR3Config[] memory ocr3Configs + ) + internal + pure + returns (CCIPConfigTypes.OCR3Config[] memory commitConfigs, CCIPConfigTypes.OCR3Config[] memory execConfigs) + { + if (ocr3Configs.length > MAX_OCR3_CONFIGS_PER_DON) { + revert TooManyOCR3Configs(); + } + + // Declare with size 2 since we have a maximum of two configs per plugin type (blue, green). + // If we have less we will adjust the length later using mstore. + // If the caller provides more than 2 configs per plugin type, we will revert due to out of bounds + // access in the for loop below. + commitConfigs = new CCIPConfigTypes.OCR3Config[](MAX_OCR3_CONFIGS_PER_PLUGIN); + execConfigs = new CCIPConfigTypes.OCR3Config[](MAX_OCR3_CONFIGS_PER_PLUGIN); + uint256 commitCount = 0; + uint256 execCount = 0; + for (uint256 i = 0; i < ocr3Configs.length; ++i) { + if (ocr3Configs[i].pluginType == Internal.OCRPluginType.Commit) { + commitConfigs[commitCount] = ocr3Configs[i]; + ++commitCount; + } else { + execConfigs[execCount] = ocr3Configs[i]; + ++execCount; + } + } + + // Adjust the length of the arrays to the actual number of configs. + assembly { + mstore(commitConfigs, commitCount) + mstore(execConfigs, execCount) + } + + return (commitConfigs, execConfigs); + } + + /// @notice Validates an OCR3 configuration. + /// @param cfg The OCR3 configuration. + function _validateConfig(CCIPConfigTypes.OCR3Config memory cfg) internal view { + if (cfg.chainSelector == 0) revert ChainSelectorNotSet(); + if (cfg.pluginType != Internal.OCRPluginType.Commit && cfg.pluginType != Internal.OCRPluginType.Execution) { + revert InvalidPluginType(); + } + if (cfg.offrampAddress.length == 0 || keccak256(cfg.offrampAddress) == EMPTY_ENCODED_ADDRESS_HASH) { + revert OfframpAddressCannotBeZero(); + } + if (!s_remoteChainSelectors.contains(cfg.chainSelector)) revert ChainSelectorNotFound(cfg.chainSelector); + + // We check for chain config presence above, so fChain here must be non-zero. + uint256 minTransmittersLength = 3 * s_chainConfigurations[cfg.chainSelector].fChain + 1; + if (cfg.transmitters.length < minTransmittersLength) { + revert NotEnoughTransmitters(cfg.transmitters.length, minTransmittersLength); + } + uint256 numberOfSigners = cfg.signers.length; + if (numberOfSigners > MAX_NUM_ORACLES) revert TooManySigners(); + if (numberOfSigners != cfg.p2pIds.length || numberOfSigners != cfg.transmitters.length) { + revert P2PIdsLengthNotMatching(cfg.p2pIds.length, cfg.signers.length, cfg.transmitters.length); + } + if (cfg.F == 0) revert FMustBePositive(); + if (numberOfSigners <= 3 * cfg.F) revert FTooHigh(); + + // Check that the readers are in the capabilities registry. + _ensureInRegistry(cfg.p2pIds); + } + + /// @notice Computes the digest of the provided configuration. + /// @dev In traditional OCR config digest computation, block.chainid and address(this) are used + /// in order to further domain separate the digest. We can't do that here since the digest will + /// be used on remote chains; so we use the chain selector instead of block.chainid. The don ID + /// replaces the address(this) in the traditional computation. + /// @param donId The DON ID. + /// @param configCount The configuration count. + /// @param ocr3Config The OCR3 configuration. + /// @return The computed digest. + function _computeConfigDigest( + uint32 donId, + uint64 configCount, + CCIPConfigTypes.OCR3Config memory ocr3Config + ) internal pure returns (bytes32) { + uint256 h = uint256( + keccak256( + abi.encode( + ocr3Config.chainSelector, + donId, + ocr3Config.pluginType, + ocr3Config.offrampAddress, + configCount, + ocr3Config.p2pIds, + ocr3Config.signers, + ocr3Config.transmitters, + ocr3Config.F, + ocr3Config.offchainConfigVersion, + ocr3Config.offchainConfig + ) + ) + ); + + return bytes32((CONFIG_DIGEST_PREFIX & CONFIG_DIGEST_PREFIX_MASK) | (h & ~CONFIG_DIGEST_PREFIX_MASK)); + } + + // ================================================================ + // │ Chain Configuration │ + // ================================================================ + + /// @notice Sets and/or removes chain configurations. + /// @param chainSelectorRemoves The chain configurations to remove. + /// @param chainConfigAdds The chain configurations to add. + function applyChainConfigUpdates( + uint64[] calldata chainSelectorRemoves, + CCIPConfigTypes.ChainConfigInfo[] calldata chainConfigAdds + ) external onlyOwner { + // Process removals first. + for (uint256 i = 0; i < chainSelectorRemoves.length; ++i) { + // check if the chain selector is in s_remoteChainSelectors first. + if (!s_remoteChainSelectors.contains(chainSelectorRemoves[i])) { + revert ChainSelectorNotFound(chainSelectorRemoves[i]); + } + + delete s_chainConfigurations[chainSelectorRemoves[i]]; + s_remoteChainSelectors.remove(chainSelectorRemoves[i]); + + emit ChainConfigRemoved(chainSelectorRemoves[i]); + } + + // Process additions next. + for (uint256 i = 0; i < chainConfigAdds.length; ++i) { + CCIPConfigTypes.ChainConfig memory chainConfig = chainConfigAdds[i].chainConfig; + uint64 chainSelector = chainConfigAdds[i].chainSelector; + + // Verify that the provided readers are present in the capabilities registry. + _ensureInRegistry(chainConfig.readers); + + // Verify that fChain is positive. + if (chainConfig.fChain == 0) { + revert FChainMustBePositive(); + } + + s_chainConfigurations[chainSelector] = chainConfig; + s_remoteChainSelectors.add(chainSelector); + + emit ChainConfigSet(chainSelector, chainConfig); + } + } + + /// @notice Helper function to ensure that a node is in the capabilities registry. + /// @param p2pIds The P2P IDs of the node to check. + function _ensureInRegistry(bytes32[] memory p2pIds) internal view { + for (uint256 i = 0; i < p2pIds.length; ++i) { + // TODO add a method that does the validation in the ICapabilitiesRegistry contract + if (ICapabilitiesRegistry(i_capabilitiesRegistry).getNode(p2pIds[i]).p2pId == bytes32("")) { + revert NodeNotInRegistry(p2pIds[i]); + } + } + } +} diff --git a/contracts/src/v0.8/ccip/capability/interfaces/ICapabilitiesRegistry.sol b/contracts/src/v0.8/ccip/capability/interfaces/ICapabilitiesRegistry.sol new file mode 100644 index 00000000000..621c3686cfa --- /dev/null +++ b/contracts/src/v0.8/ccip/capability/interfaces/ICapabilitiesRegistry.sol @@ -0,0 +1,31 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.24; + +interface ICapabilitiesRegistry { + struct NodeInfo { + /// @notice The id of the node operator that manages this node + uint32 nodeOperatorId; + /// @notice The number of times the node's configuration has been updated + uint32 configCount; + /// @notice The ID of the Workflow DON that the node belongs to. A node can + /// only belong to one DON that accepts Workflows. + uint32 workflowDONId; + /// @notice The signer address for application-layer message verification. + bytes32 signer; + /// @notice This is an Ed25519 public key that is used to identify a node. + /// This key is guaranteed to be unique in the CapabilitiesRegistry. It is + /// used to identify a node in the the P2P network. + bytes32 p2pId; + /// @notice The list of hashed capability IDs supported by the node + bytes32[] hashedCapabilityIds; + /// @notice The list of capabilities DON Ids supported by the node. A node + /// can belong to multiple capabilities DONs. This list does not include a + /// Workflow DON id if the node belongs to one. + uint256[] capabilitiesDONIds; + } + + /// @notice Gets a node's data + /// @param p2pId The P2P ID of the node to query for + /// @return NodeInfo The node data + function getNode(bytes32 p2pId) external view returns (NodeInfo memory); +} diff --git a/contracts/src/v0.8/ccip/capability/interfaces/IOCR3ConfigEncoder.sol b/contracts/src/v0.8/ccip/capability/interfaces/IOCR3ConfigEncoder.sol new file mode 100644 index 00000000000..6d0b0f72a5a --- /dev/null +++ b/contracts/src/v0.8/ccip/capability/interfaces/IOCR3ConfigEncoder.sol @@ -0,0 +1,11 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.0; + +import {CCIPConfigTypes} from "../libraries/CCIPConfigTypes.sol"; + +/// @dev This is so that we can generate gethwrappers and easily encode/decode OCR3Config +/// in the offchain integration tests. +interface IOCR3ConfigEncoder { + /// @dev Encodes an array of OCR3Config into a bytes array. For test usage only. + function exposeOCR3Config(CCIPConfigTypes.OCR3Config[] calldata config) external view returns (bytes memory); +} diff --git a/contracts/src/v0.8/ccip/capability/libraries/CCIPConfigTypes.sol b/contracts/src/v0.8/ccip/capability/libraries/CCIPConfigTypes.sol new file mode 100644 index 00000000000..2148f991c8f --- /dev/null +++ b/contracts/src/v0.8/ccip/capability/libraries/CCIPConfigTypes.sol @@ -0,0 +1,55 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.0; + +import {Internal} from "../../libraries/Internal.sol"; + +library CCIPConfigTypes { + /// @notice ConfigState indicates the state of the configuration. + /// A DON's configuration always starts out in the "Init" state - this is the starting state. + /// The only valid transition from "Init" is to the "Running" state - this is the first ever configuration. + /// The only valid transition from "Running" is to the "Staging" state - this is a blue/green proposal. + /// The only valid transition from "Staging" is back to the "Running" state - this is a promotion. + /// TODO: explain rollbacks? + enum ConfigState { + Init, + Running, + Staging + } + + /// @notice Chain configuration. + /// Changes to chain configuration are detected out-of-band in plugins and decoded offchain. + struct ChainConfig { + bytes32[] readers; // The P2P IDs of the readers for the chain. These IDs must be registered in the capabilities registry. + uint8 fChain; // The fault tolerance parameter of the chain. + bytes config; // The chain configuration. This is kept intentionally opaque so as to add fields in the future if needed. + } + + /// @notice Chain configuration information struct used in applyChainConfigUpdates and getAllChainConfigs. + struct ChainConfigInfo { + uint64 chainSelector; + ChainConfig chainConfig; + } + + /// @notice OCR3 configuration. + struct OCR3Config { + Internal.OCRPluginType pluginType; // ────────╮ The plugin that the configuration is for. + uint64 chainSelector; // | The (remote) chain that the configuration is for. + uint8 F; // | The "big F" parameter for the role DON. + uint64 offchainConfigVersion; // ─────────────╯ The version of the offchain configuration. + bytes offrampAddress; // The remote chain offramp address. + // len(p2pIds) == len(signers) == len(transmitters) == 3 * F + 1 + // NOTE: indexes matter here! The p2p ID at index i corresponds to the signer at index i and the transmitter at index i. + // This is crucial in order to build the oracle ID <-> peer ID mapping offchain. + bytes32[] p2pIds; // The P2P IDs of the oracles that are part of the role DON. + bytes[] signers; // The onchain signing keys of nodes in the don. + bytes[] transmitters; // The onchain transmitter keys of nodes in the don. + bytes offchainConfig; // The offchain configuration for the OCR3 protocol. Protobuf encoded. + } + + /// @notice OCR3 configuration with metadata, specifically the config count and the config digest. + struct OCR3ConfigWithMeta { + OCR3Config config; // The OCR3 configuration. + uint64 configCount; // The config count used to compute the config digest. + bytes32 configDigest; // The config digest of the OCR3 configuration. + } +} diff --git a/contracts/src/v0.8/ccip/docs/multi-chain-overview-ocr3.png b/contracts/src/v0.8/ccip/docs/multi-chain-overview-ocr3.png new file mode 100644 index 00000000000..39302619cb4 Binary files /dev/null and b/contracts/src/v0.8/ccip/docs/multi-chain-overview-ocr3.png differ diff --git a/contracts/src/v0.8/ccip/docs/multi-chain-overview.drawio b/contracts/src/v0.8/ccip/docs/multi-chain-overview.drawio new file mode 100644 index 00000000000..5743bf5182e --- /dev/null +++ b/contracts/src/v0.8/ccip/docs/multi-chain-overview.drawio @@ -0,0 +1,2060 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/contracts/src/v0.8/ccip/interfaces/IAny2EVMMessageReceiver.sol b/contracts/src/v0.8/ccip/interfaces/IAny2EVMMessageReceiver.sol new file mode 100644 index 00000000000..6305311050d --- /dev/null +++ b/contracts/src/v0.8/ccip/interfaces/IAny2EVMMessageReceiver.sol @@ -0,0 +1,15 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {Client} from "../libraries/Client.sol"; + +/// @notice Application contracts that intend to receive messages from +/// the router should implement this interface. +interface IAny2EVMMessageReceiver { + /// @notice Called by the Router to deliver a message. + /// If this reverts, any token transfers also revert. The message + /// will move to a FAILED state and become available for manual execution. + /// @param message CCIP Message + /// @dev Note ensure you check the msg.sender is the OffRampRouter + function ccipReceive(Client.Any2EVMMessage calldata message) external; +} diff --git a/contracts/src/v0.8/ccip/interfaces/IAny2EVMOffRamp.sol b/contracts/src/v0.8/ccip/interfaces/IAny2EVMOffRamp.sol new file mode 100644 index 00000000000..1881dede2ee --- /dev/null +++ b/contracts/src/v0.8/ccip/interfaces/IAny2EVMOffRamp.sol @@ -0,0 +1,9 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +interface IAny2EVMOffRamp { + /// @notice Returns the the current nonce for a receiver. + /// @param sender The sender address + /// @return nonce The nonce value belonging to the sender address. + function getSenderNonce(address sender) external view returns (uint64 nonce); +} diff --git a/contracts/src/v0.8/ccip/interfaces/ICommitStore.sol b/contracts/src/v0.8/ccip/interfaces/ICommitStore.sol new file mode 100644 index 00000000000..1183eb277b8 --- /dev/null +++ b/contracts/src/v0.8/ccip/interfaces/ICommitStore.sol @@ -0,0 +1,17 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +interface ICommitStore { + /// @notice Returns timestamp of when root was accepted or 0 if verification fails. + /// @dev This method uses a merkle tree within a merkle tree, with the hashedLeaves, + /// proofs and proofFlagBits being used to get the root of the inner tree. + /// This root is then used as the singular leaf of the outer tree. + function verify( + bytes32[] calldata hashedLeaves, + bytes32[] calldata proofs, + uint256 proofFlagBits + ) external view returns (uint256 timestamp); + + /// @notice Returns the expected next sequence number + function getExpectedNextSequenceNumber() external view returns (uint64 sequenceNumber); +} diff --git a/contracts/src/v0.8/ccip/interfaces/IEVM2AnyOnRamp.sol b/contracts/src/v0.8/ccip/interfaces/IEVM2AnyOnRamp.sol new file mode 100644 index 00000000000..d657e148cb2 --- /dev/null +++ b/contracts/src/v0.8/ccip/interfaces/IEVM2AnyOnRamp.sol @@ -0,0 +1,15 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {IEVM2AnyOnRampClient} from "./IEVM2AnyOnRampClient.sol"; + +interface IEVM2AnyOnRamp is IEVM2AnyOnRampClient { + /// @notice Gets the next sequence number to be used in the onRamp + /// @return the next sequence number to be used + function getExpectedNextSequenceNumber() external view returns (uint64); + + /// @notice Get the next nonce for a given sender + /// @param sender The sender to get the nonce for + /// @return nonce The next nonce for the sender + function getSenderNonce(address sender) external view returns (uint64 nonce); +} diff --git a/contracts/src/v0.8/ccip/interfaces/IEVM2AnyOnRampClient.sol b/contracts/src/v0.8/ccip/interfaces/IEVM2AnyOnRampClient.sol new file mode 100644 index 00000000000..1dfae1abbc3 --- /dev/null +++ b/contracts/src/v0.8/ccip/interfaces/IEVM2AnyOnRampClient.sol @@ -0,0 +1,43 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {IPoolV1} from "./IPool.sol"; + +import {Client} from "../libraries/Client.sol"; + +import {IERC20} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/IERC20.sol"; + +interface IEVM2AnyOnRampClient { + /// @notice Get the fee for a given ccip message + /// @param destChainSelector The destination chain selector + /// @param message The message to calculate the cost for + /// @return fee The calculated fee + function getFee(uint64 destChainSelector, Client.EVM2AnyMessage calldata message) external view returns (uint256 fee); + + /// @notice Get the pool for a specific token + /// @param destChainSelector The destination chain selector + /// @param sourceToken The source chain token to get the pool for + /// @return pool Token pool + function getPoolBySourceToken(uint64 destChainSelector, IERC20 sourceToken) external view returns (IPoolV1); + + /// @notice Gets a list of all supported source chain tokens. + /// @param destChainSelector The destination chain selector + /// @return tokens The addresses of all tokens that this onRamp supports the given destination chain + function getSupportedTokens(uint64 destChainSelector) external view returns (address[] memory tokens); + + /// @notice Send a message to the remote chain + /// @dev only callable by the Router + /// @dev approve() must have already been called on the token using the this ramp address as the spender. + /// @dev if the contract is paused, this function will revert. + /// @param destChainSelector The destination chain selector + /// @param message Message struct to send + /// @param feeTokenAmount Amount of fee tokens for payment + /// @param originalSender The original initiator of the CCIP request + /// @return messageId The message id + function forwardFromRouter( + uint64 destChainSelector, + Client.EVM2AnyMessage memory message, + uint256 feeTokenAmount, + address originalSender + ) external returns (bytes32); +} diff --git a/contracts/src/v0.8/ccip/interfaces/IFeeQuoter.sol b/contracts/src/v0.8/ccip/interfaces/IFeeQuoter.sol new file mode 100644 index 00000000000..fdea4538b6e --- /dev/null +++ b/contracts/src/v0.8/ccip/interfaces/IFeeQuoter.sol @@ -0,0 +1,54 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {Client} from "../libraries/Client.sol"; +import {Internal} from "../libraries/Internal.sol"; +import {IPriceRegistry} from "./IPriceRegistry.sol"; + +interface IFeeQuoter is IPriceRegistry { + /// @notice Token price data feed configuration + struct TokenPriceFeedConfig { + address dataFeedAddress; // ──╮ AggregatorV3Interface contract (0 - feed is unset) + uint8 tokenDecimals; // ──────╯ Decimals of the token that the feed represents + } + + /// @notice Returns the token price data feed configuration + /// @param token The token to retrieve the feed config for + /// @return tokenPriceFeedConfig The token price data feed config (if feed address is 0, the feed config is disabled) + function getTokenPriceFeedConfig(address token) external view returns (TokenPriceFeedConfig memory); + + /// @notice Validates the ccip message & returns the fee + /// @param destChainSelector The destination chain selector. + /// @param message The message to get quote for. + /// @return feeTokenAmount The amount of fee token needed for the fee, in smallest denomination of the fee token. + function getValidatedFee( + uint64 destChainSelector, + Client.EVM2AnyMessage calldata message + ) external view returns (uint256 feeTokenAmount); + + /// @notice Converts the extraArgs to the latest version and returns the converted message fee in juels + /// @param destChainSelector destination chain selector to process + /// @param feeToken Fee token address used to pay for message fees + /// @param feeTokenAmount Fee token amount + /// @param extraArgs Message extra args that were passed in by the client + /// @return msgFeeJuels message fee in juels + /// @return isOutOfOrderExecution true if the message should be executed out of order + /// @return convertedExtraArgs extra args converted to the latest family-specific args version + function processMessageArgs( + uint64 destChainSelector, + address feeToken, + uint256 feeTokenAmount, + bytes memory extraArgs + ) external view returns (uint256 msgFeeJuels, bool isOutOfOrderExecution, bytes memory convertedExtraArgs); + + /// @notice Validates pool return data + /// @param destChainSelector Destination chain selector to which the token amounts are sent to + /// @param rampTokenAmounts Token amounts with populated pool return data + /// @param sourceTokenAmounts Token amounts originally sent in a Client.EVM2AnyMessage message + /// @return destExecData Destination chain execution data + function processPoolReturnData( + uint64 destChainSelector, + Internal.RampTokenAmount[] memory rampTokenAmounts, + Client.EVMTokenAmount[] calldata sourceTokenAmounts + ) external view returns (bytes[] memory); +} diff --git a/contracts/src/v0.8/ccip/interfaces/IGetCCIPAdmin.sol b/contracts/src/v0.8/ccip/interfaces/IGetCCIPAdmin.sol new file mode 100644 index 00000000000..d83a1f34e89 --- /dev/null +++ b/contracts/src/v0.8/ccip/interfaces/IGetCCIPAdmin.sol @@ -0,0 +1,8 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +interface IGetCCIPAdmin { + /// @notice Returns the admin of the token. + /// @dev This method is named to never conflict with existing methods. + function getCCIPAdmin() external view returns (address); +} diff --git a/contracts/src/v0.8/ccip/interfaces/IMessageInterceptor.sol b/contracts/src/v0.8/ccip/interfaces/IMessageInterceptor.sol new file mode 100644 index 00000000000..c2b432426b6 --- /dev/null +++ b/contracts/src/v0.8/ccip/interfaces/IMessageInterceptor.sol @@ -0,0 +1,22 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {Client} from "../libraries/Client.sol"; + +/// @notice Interface for plug-in message hook contracts that intercept OffRamp & OnRamp messages +/// and perform validations / state changes on top of the messages. The interceptor functions are expected to +/// revert on validation failures. +interface IMessageInterceptor { + /// @notice Common error that can be thrown on validation failures and used by consumers + /// @param errorReason abi encoded revert reason + error MessageValidationError(bytes errorReason); + + /// @notice Intercepts & validates the given OffRamp message. Reverts on validation failure + /// @param message to validate + function onInboundMessage(Client.Any2EVMMessage memory message) external; + + /// @notice Intercepts & validates the given OnRamp message. Reverts on validation failure + /// @param destChainSelector remote destination chain selector where the message is being sent to + /// @param message to validate + function onOutboundMessage(uint64 destChainSelector, Client.EVM2AnyMessage memory message) external; +} diff --git a/contracts/src/v0.8/ccip/interfaces/INonceManager.sol b/contracts/src/v0.8/ccip/interfaces/INonceManager.sol new file mode 100644 index 00000000000..3a6eff65c77 --- /dev/null +++ b/contracts/src/v0.8/ccip/interfaces/INonceManager.sol @@ -0,0 +1,23 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +/// @notice Contract interface that allows managing sender nonces +interface INonceManager { + /// @notice Increments the outbound nonce for a given sender on a given destination chain. + /// @param destChainSelector The destination chain selector. + /// @param sender The sender address. + /// @return incrementedOutboundNonce The new outbound nonce. + function getIncrementedOutboundNonce(uint64 destChainSelector, address sender) external returns (uint64); + + /// @notice Increments the inbound nonce for a given sender on a given source chain. + /// @notice The increment is only applied if the resulting nonce matches the expectedNonce. + /// @param sourceChainSelector The destination chain selector. + /// @param expectedNonce The expected inbound nonce. + /// @param sender The encoded sender address. + /// @return incremented True if the nonce was incremented, false otherwise. + function incrementInboundNonce( + uint64 sourceChainSelector, + uint64 expectedNonce, + bytes calldata sender + ) external returns (bool); +} diff --git a/contracts/src/v0.8/ccip/interfaces/IOwner.sol b/contracts/src/v0.8/ccip/interfaces/IOwner.sol new file mode 100644 index 00000000000..ccb1039e555 --- /dev/null +++ b/contracts/src/v0.8/ccip/interfaces/IOwner.sol @@ -0,0 +1,8 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +interface IOwner { + /// @notice Returns the owner of the contract. + /// @dev This method is named to match with the OpenZeppelin Ownable contract. + function owner() external view returns (address); +} diff --git a/contracts/src/v0.8/ccip/interfaces/IPool.sol b/contracts/src/v0.8/ccip/interfaces/IPool.sol new file mode 100644 index 00000000000..a2b9281228e --- /dev/null +++ b/contracts/src/v0.8/ccip/interfaces/IPool.sol @@ -0,0 +1,37 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {Pool} from "../libraries/Pool.sol"; + +import {IERC165} from "../../vendor/openzeppelin-solidity/v5.0.2/contracts/utils/introspection/IERC165.sol"; + +/// @notice Shared public interface for multiple V1 pool types. +/// Each pool type handles a different child token model (lock/unlock, mint/burn.) +interface IPoolV1 is IERC165 { + /// @notice Lock tokens into the pool or burn the tokens. + /// @param lockOrBurnIn Encoded data fields for the processing of tokens on the source chain. + /// @return lockOrBurnOut Encoded data fields for the processing of tokens on the destination chain. + function lockOrBurn( + Pool.LockOrBurnInV1 calldata lockOrBurnIn + ) external returns (Pool.LockOrBurnOutV1 memory lockOrBurnOut); + + /// @notice Releases or mints tokens to the receiver address. + /// @param releaseOrMintIn All data required to release or mint tokens. + /// @return releaseOrMintOut The amount of tokens released or minted on the local chain, denominated + /// in the local token's decimals. + /// @dev The offramp asserts that the balanceOf of the receiver has been incremented by exactly the number + /// of tokens that is returned in ReleaseOrMintOutV1.destinationAmount. If the amounts do not match, the tx reverts. + function releaseOrMint( + Pool.ReleaseOrMintInV1 calldata releaseOrMintIn + ) external returns (Pool.ReleaseOrMintOutV1 memory); + + /// @notice Checks whether a remote chain is supported in the token pool. + /// @param remoteChainSelector The selector of the remote chain. + /// @return true if the given chain is a permissioned remote chain. + function isSupportedChain(uint64 remoteChainSelector) external view returns (bool); + + /// @notice Returns if the token pool supports the given token. + /// @param token The address of the token. + /// @return true if the token is supported by the pool. + function isSupportedToken(address token) external view returns (bool); +} diff --git a/contracts/src/v0.8/ccip/interfaces/IPoolPriorTo1_5.sol b/contracts/src/v0.8/ccip/interfaces/IPoolPriorTo1_5.sol new file mode 100644 index 00000000000..d8a2f15fd29 --- /dev/null +++ b/contracts/src/v0.8/ccip/interfaces/IPoolPriorTo1_5.sol @@ -0,0 +1,46 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {IERC20} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/IERC20.sol"; + +// Shared public interface for multiple pool types. +// Each pool type handles a different child token model (lock/unlock, mint/burn.) +interface IPoolPriorTo1_5 { + /// @notice Lock tokens into the pool or burn the tokens. + /// @param originalSender Original sender of the tokens. + /// @param receiver Receiver of the tokens on destination chain. + /// @param amount Amount to lock or burn. + /// @param remoteChainSelector Destination chain Id. + /// @param extraArgs Additional data passed in by sender for lockOrBurn processing + /// in custom pools on source chain. + /// @return retData Optional field that contains bytes. Unused for now but already + /// implemented to allow future upgrades while preserving the interface. + function lockOrBurn( + address originalSender, + bytes calldata receiver, + uint256 amount, + uint64 remoteChainSelector, + bytes calldata extraArgs + ) external returns (bytes memory); + + /// @notice Releases or mints tokens to the receiver address. + /// @param originalSender Original sender of the tokens. + /// @param receiver Receiver of the tokens. + /// @param amount Amount to release or mint. + /// @param remoteChainSelector Source chain Id. + /// @param extraData Additional data supplied offchain for releaseOrMint processing in + /// custom pools on dest chain. This could be an attestation that was retrieved through a + /// third party API. + /// @dev offchainData can come from any untrusted source. + function releaseOrMint( + bytes memory originalSender, + address receiver, + uint256 amount, + uint64 remoteChainSelector, + bytes memory extraData + ) external; + + /// @notice Gets the IERC20 token that this pool can lock or burn. + /// @return token The IERC20 token representation. + function getToken() external view returns (IERC20 token); +} diff --git a/contracts/src/v0.8/ccip/interfaces/IPriceRegistry.sol b/contracts/src/v0.8/ccip/interfaces/IPriceRegistry.sol new file mode 100644 index 00000000000..757ef09b0c5 --- /dev/null +++ b/contracts/src/v0.8/ccip/interfaces/IPriceRegistry.sol @@ -0,0 +1,98 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {Client} from "../libraries/Client.sol"; +import {Internal} from "../libraries/Internal.sol"; + +interface IPriceRegistry { + /// @notice Update the price for given tokens and gas prices for given chains. + /// @param priceUpdates The price updates to apply. + function updatePrices(Internal.PriceUpdates memory priceUpdates) external; + + /// @notice Get the `tokenPrice` for a given token. + /// @param token The token to get the price for. + /// @return tokenPrice The tokenPrice for the given token. + function getTokenPrice(address token) external view returns (Internal.TimestampedPackedUint224 memory); + + /// @notice Get the `tokenPrice` for a given token, checks if the price is valid. + /// @param token The token to get the price for. + /// @return tokenPrice The tokenPrice for the given token if it exists and is valid. + function getValidatedTokenPrice(address token) external view returns (uint224); + + /// @notice Get the `tokenPrice` for an array of tokens. + /// @param tokens The tokens to get prices for. + /// @return tokenPrices The tokenPrices for the given tokens. + function getTokenPrices(address[] calldata tokens) external view returns (Internal.TimestampedPackedUint224[] memory); + + /// @notice Get an encoded `gasPrice` for a given destination chain ID. + /// The 224-bit result encodes necessary gas price components. + /// On L1 chains like Ethereum or Avax, the only component is the gas price. + /// On Optimistic Rollups, there are two components - the L2 gas price, and L1 base fee for data availability. + /// On future chains, there could be more or differing price components. + /// PriceRegistry does not contain chain-specific logic to parse destination chain price components. + /// @param destChainSelector The destination chain to get the price for. + /// @return gasPrice The encoded gasPrice for the given destination chain ID. + function getDestinationChainGasPrice( + uint64 destChainSelector + ) external view returns (Internal.TimestampedPackedUint224 memory); + + /// @notice Gets the fee token price and the gas price, both denominated in dollars. + /// @param token The source token to get the price for. + /// @param destChainSelector The destination chain to get the gas price for. + /// @return tokenPrice The price of the feeToken in 1e18 dollars per base unit. + /// @return gasPrice The price of gas in 1e18 dollars per base unit. + function getTokenAndGasPrices( + address token, + uint64 destChainSelector + ) external view returns (uint224 tokenPrice, uint224 gasPrice); + + /// @notice Convert a given token amount to target token amount. + /// @param fromToken The given token address. + /// @param fromTokenAmount The given token amount. + /// @param toToken The target token address. + /// @return toTokenAmount The target token amount. + function convertTokenAmount( + address fromToken, + uint256 fromTokenAmount, + address toToken + ) external view returns (uint256 toTokenAmount); + + /// @notice Get the list of fee tokens. + /// @return feeTokens The tokens set as fee tokens. + function getFeeTokens() external view returns (address[] memory); + + /// @notice Validates the ccip message & returns the fee + /// @param destChainSelector The destination chain selector. + /// @param message The message to get quote for. + /// @return feeTokenAmount The amount of fee token needed for the fee, in smallest denomination of the fee token. + function getValidatedFee( + uint64 destChainSelector, + Client.EVM2AnyMessage calldata message + ) external view returns (uint256 feeTokenAmount); + + /// @notice Converts the extraArgs to the latest version and returns the converted message fee in juels + /// @param destChainSelector destination chain selector to process + /// @param feeToken Fee token address used to pay for message fees + /// @param feeTokenAmount Fee token amount + /// @param extraArgs Message extra args that were passed in by the client + /// @return msgFeeJuels message fee in juels + /// @return isOutOfOrderExecution true if the message should be executed out of order + /// @return convertedExtraArgs extra args converted to the latest family-specific args version + function processMessageArgs( + uint64 destChainSelector, + address feeToken, + uint256 feeTokenAmount, + bytes memory extraArgs + ) external view returns (uint256 msgFeeJuels, bool isOutOfOrderExecution, bytes memory convertedExtraArgs); + + /// @notice Validates pool return data + /// @param destChainSelector Destination chain selector to which the token amounts are sent to + /// @param rampTokenAmounts Token amounts with populated pool return data + /// @param sourceTokenAmounts Token amounts originally sent in a Client.EVM2AnyMessage message + /// @return destExecData Destination chain execution data + function processPoolReturnData( + uint64 destChainSelector, + Internal.RampTokenAmount[] memory rampTokenAmounts, + Client.EVMTokenAmount[] calldata sourceTokenAmounts + ) external view returns (bytes[] memory); +} diff --git a/contracts/src/v0.8/ccip/interfaces/IRMN.sol b/contracts/src/v0.8/ccip/interfaces/IRMN.sol new file mode 100644 index 00000000000..a409731549f --- /dev/null +++ b/contracts/src/v0.8/ccip/interfaces/IRMN.sol @@ -0,0 +1,21 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +/// @notice This interface contains the only RMN-related functions that might be used on-chain by other CCIP contracts. +interface IRMN { + /// @notice A Merkle root tagged with the address of the commit store contract it is destined for. + struct TaggedRoot { + address commitStore; + bytes32 root; + } + + /// @notice Callers MUST NOT cache the return value as a blessed tagged root could become unblessed. + function isBlessed(TaggedRoot calldata taggedRoot) external view returns (bool); + + /// @notice Iff there is an active global or legacy curse, this function returns true. + function isCursed() external view returns (bool); + + /// @notice Iff there is an active global curse, or an active curse for `subject`, this function returns true. + /// @param subject To check whether a particular chain is cursed, set to bytes16(uint128(chainSelector)). + function isCursed(bytes16 subject) external view returns (bool); +} diff --git a/contracts/src/v0.8/ccip/interfaces/IRMNV2.sol b/contracts/src/v0.8/ccip/interfaces/IRMNV2.sol new file mode 100644 index 00000000000..9af3de6cab6 --- /dev/null +++ b/contracts/src/v0.8/ccip/interfaces/IRMNV2.sol @@ -0,0 +1,22 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {Internal} from "../libraries/Internal.sol"; + +/// @notice This interface contains the only RMN-related functions that might be used on-chain by other CCIP contracts. +interface IRMNV2 { + /// @notice signature components from RMN nodes + struct Signature { + bytes32 r; + bytes32 s; + } + + function verify(Internal.MerkleRoot[] memory merkleRoots, Signature[] memory signatures) external view; + + /// @notice If there is an active global or legacy curse, this function returns true. + function isCursed() external view returns (bool); + + /// @notice If there is an active global curse, or an active curse for `subject`, this function returns true. + /// @param subject To check whether a particular chain is cursed, set to bytes16(uint128(chainSelector)). + function isCursed(bytes16 subject) external view returns (bool); +} diff --git a/contracts/src/v0.8/ccip/interfaces/IRouter.sol b/contracts/src/v0.8/ccip/interfaces/IRouter.sol new file mode 100644 index 00000000000..7f4544fd0fa --- /dev/null +++ b/contracts/src/v0.8/ccip/interfaces/IRouter.sol @@ -0,0 +1,35 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {Client} from "../libraries/Client.sol"; + +interface IRouter { + error OnlyOffRamp(); + + /// @notice Route the message to its intended receiver contract. + /// @param message Client.Any2EVMMessage struct. + /// @param gasForCallExactCheck of params for exec + /// @param gasLimit set of params for exec + /// @param receiver set of params for exec + /// @dev if the receiver is a contracts that signals support for CCIP execution through EIP-165. + /// the contract is called. If not, only tokens are transferred. + /// @return success A boolean value indicating whether the ccip message was received without errors. + /// @return retBytes A bytes array containing return data form CCIP receiver. + /// @return gasUsed the gas used by the external customer call. Does not include any overhead. + function routeMessage( + Client.Any2EVMMessage calldata message, + uint16 gasForCallExactCheck, + uint256 gasLimit, + address receiver + ) external returns (bool success, bytes memory retBytes, uint256 gasUsed); + + /// @notice Returns the configured onramp for a specific destination chain. + /// @param destChainSelector The destination chain Id to get the onRamp for. + /// @return onRampAddress The address of the onRamp. + function getOnRamp(uint64 destChainSelector) external view returns (address onRampAddress); + + /// @notice Return true if the given offRamp is a configured offRamp for the given source chain. + /// @param sourceChainSelector The source chain selector to check. + /// @param offRamp The address of the offRamp to check. + function isOffRamp(uint64 sourceChainSelector, address offRamp) external view returns (bool isOffRamp); +} diff --git a/contracts/src/v0.8/ccip/interfaces/IRouterClient.sol b/contracts/src/v0.8/ccip/interfaces/IRouterClient.sol new file mode 100644 index 00000000000..9805a41bbdc --- /dev/null +++ b/contracts/src/v0.8/ccip/interfaces/IRouterClient.sol @@ -0,0 +1,37 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {Client} from "../libraries/Client.sol"; + +interface IRouterClient { + error UnsupportedDestinationChain(uint64 destChainSelector); + error InsufficientFeeTokenAmount(); + error InvalidMsgValue(); + + /// @notice Checks if the given chain ID is supported for sending/receiving. + /// @param destChainSelector The chain to check. + /// @return supported is true if it is supported, false if not. + function isChainSupported(uint64 destChainSelector) external view returns (bool supported); + + /// @param destinationChainSelector The destination chainSelector + /// @param message The cross-chain CCIP message including data and/or tokens + /// @return fee returns execution fee for the message + /// delivery to destination chain, denominated in the feeToken specified in the message. + /// @dev Reverts with appropriate reason upon invalid message. + function getFee( + uint64 destinationChainSelector, + Client.EVM2AnyMessage memory message + ) external view returns (uint256 fee); + + /// @notice Request a message to be sent to the destination chain + /// @param destinationChainSelector The destination chain ID + /// @param message The cross-chain CCIP message including data and/or tokens + /// @return messageId The message ID + /// @dev Note if msg.value is larger than the required fee (from getFee) we accept + /// the overpayment with no refund. + /// @dev Reverts with appropriate reason upon invalid message. + function ccipSend( + uint64 destinationChainSelector, + Client.EVM2AnyMessage calldata message + ) external payable returns (bytes32); +} diff --git a/contracts/src/v0.8/ccip/interfaces/ITokenAdminRegistry.sol b/contracts/src/v0.8/ccip/interfaces/ITokenAdminRegistry.sol new file mode 100644 index 00000000000..0e441229011 --- /dev/null +++ b/contracts/src/v0.8/ccip/interfaces/ITokenAdminRegistry.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.0; + +interface ITokenAdminRegistry { + /// @notice Returns the pool for the given token. + function getPool(address token) external view returns (address); + + /// @notice Proposes an administrator for the given token as pending administrator. + /// @param localToken The token to register the administrator for. + /// @param administrator The administrator to register. + function proposeAdministrator(address localToken, address administrator) external; +} diff --git a/contracts/src/v0.8/ccip/interfaces/IWrappedNative.sol b/contracts/src/v0.8/ccip/interfaces/IWrappedNative.sol new file mode 100644 index 00000000000..4225827a612 --- /dev/null +++ b/contracts/src/v0.8/ccip/interfaces/IWrappedNative.sol @@ -0,0 +1,10 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {IERC20} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/IERC20.sol"; + +interface IWrappedNative is IERC20 { + function deposit() external payable; + + function withdraw(uint256 wad) external; +} diff --git a/contracts/src/v0.8/ccip/interfaces/automation/ILinkAvailable.sol b/contracts/src/v0.8/ccip/interfaces/automation/ILinkAvailable.sol new file mode 100644 index 00000000000..b0dad9a5e70 --- /dev/null +++ b/contracts/src/v0.8/ccip/interfaces/automation/ILinkAvailable.sol @@ -0,0 +1,8 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +/// @notice Implement this contract so that a keeper-compatible contract can monitor +/// and fund the implementation contract with LINK if it falls below a defined threshold. +interface ILinkAvailable { + function linkAvailableForPayment() external view returns (int256 availableBalance); +} diff --git a/contracts/src/v0.8/ccip/libraries/Client.sol b/contracts/src/v0.8/ccip/libraries/Client.sol new file mode 100644 index 00000000000..a985371bef1 --- /dev/null +++ b/contracts/src/v0.8/ccip/libraries/Client.sol @@ -0,0 +1,55 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +// End consumer library. +library Client { + /// @dev RMN depends on this struct, if changing, please notify the RMN maintainers. + struct EVMTokenAmount { + address token; // token address on the local chain. + uint256 amount; // Amount of tokens. + } + + struct Any2EVMMessage { + bytes32 messageId; // MessageId corresponding to ccipSend on source. + uint64 sourceChainSelector; // Source chain selector. + bytes sender; // abi.decode(sender) if coming from an EVM chain. + bytes data; // payload sent in original message. + EVMTokenAmount[] destTokenAmounts; // Tokens and their amounts in their destination chain representation. + } + + // If extraArgs is empty bytes, the default is 200k gas limit. + struct EVM2AnyMessage { + bytes receiver; // abi.encode(receiver address) for dest EVM chains + bytes data; // Data payload + EVMTokenAmount[] tokenAmounts; // Token transfers + address feeToken; // Address of feeToken. address(0) means you will send msg.value. + bytes extraArgs; // Populate this with _argsToBytes(EVMExtraArgsV2) + } + + // bytes4(keccak256("CCIP EVMExtraArgsV1")); + bytes4 public constant EVM_EXTRA_ARGS_V1_TAG = 0x97a657c9; + + struct EVMExtraArgsV1 { + uint256 gasLimit; + } + + function _argsToBytes(EVMExtraArgsV1 memory extraArgs) internal pure returns (bytes memory bts) { + return abi.encodeWithSelector(EVM_EXTRA_ARGS_V1_TAG, extraArgs); + } + + // bytes4(keccak256("CCIP EVMExtraArgsV2")); + bytes4 public constant EVM_EXTRA_ARGS_V2_TAG = 0x181dcf10; + + /// @param gasLimit: gas limit for the callback on the destination chain. + /// @param allowOutOfOrderExecution: if true, it indicates that the message can be executed in any order relative to other messages from the same sender. + /// This value's default varies by chain. On some chains, a particular value is enforced, meaning if the expected value + /// is not set, the message request will revert. + struct EVMExtraArgsV2 { + uint256 gasLimit; + bool allowOutOfOrderExecution; + } + + function _argsToBytes(EVMExtraArgsV2 memory extraArgs) internal pure returns (bytes memory bts) { + return abi.encodeWithSelector(EVM_EXTRA_ARGS_V2_TAG, extraArgs); + } +} diff --git a/contracts/src/v0.8/ccip/libraries/Internal.sol b/contracts/src/v0.8/ccip/libraries/Internal.sol new file mode 100644 index 00000000000..58ae6279b80 --- /dev/null +++ b/contracts/src/v0.8/ccip/libraries/Internal.sol @@ -0,0 +1,351 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {MerkleMultiProof} from "../libraries/MerkleMultiProof.sol"; +import {Client} from "./Client.sol"; + +// Library for CCIP internal definitions common to multiple contracts. +library Internal { + error InvalidEVMAddress(bytes encodedAddress); + + /// @dev The minimum amount of gas to perform the call with exact gas. + /// We include this in the offramp so that we can redeploy to adjust it + /// should a hardfork change the gas costs of relevant opcodes in callWithExactGas. + uint16 internal constant GAS_FOR_CALL_EXACT_CHECK = 5_000; + // @dev We limit return data to a selector plus 4 words. This is to avoid + // malicious contracts from returning large amounts of data and causing + // repeated out-of-gas scenarios. + uint16 internal constant MAX_RET_BYTES = 4 + 4 * 32; + /// @dev The expected number of bytes returned by the balanceOf function. + uint256 internal constant MAX_BALANCE_OF_RET_BYTES = 32; + + /// @notice A collection of token price and gas price updates. + /// @dev RMN depends on this struct, if changing, please notify the RMN maintainers. + struct PriceUpdates { + TokenPriceUpdate[] tokenPriceUpdates; + GasPriceUpdate[] gasPriceUpdates; + } + + /// @notice Token price in USD. + /// @dev RMN depends on this struct, if changing, please notify the RMN maintainers. + struct TokenPriceUpdate { + address sourceToken; // Source token + uint224 usdPerToken; // 1e18 USD per 1e18 of the smallest token denomination. + } + + /// @notice Gas price for a given chain in USD, its value may contain tightly packed fields. + /// @dev RMN depends on this struct, if changing, please notify the RMN maintainers. + struct GasPriceUpdate { + uint64 destChainSelector; // Destination chain selector + uint224 usdPerUnitGas; // 1e18 USD per smallest unit (e.g. wei) of destination chain gas + } + + /// @notice A timestamped uint224 value that can contain several tightly packed fields. + struct TimestampedPackedUint224 { + uint224 value; // ───────╮ Value in uint224, packed. + uint32 timestamp; // ────╯ Timestamp of the most recent price update. + } + + /// @dev Gas price is stored in 112-bit unsigned int. uint224 can pack 2 prices. + /// When packing L1 and L2 gas prices, L1 gas price is left-shifted to the higher-order bits. + /// Using uint8 type, which cannot be higher than other bit shift operands, to avoid shift operand type warning. + uint8 public constant GAS_PRICE_BITS = 112; + + struct PoolUpdate { + address token; // The IERC20 token address + address pool; // The token pool address + } + + struct SourceTokenData { + // The source pool address, abi encoded. This value is trusted as it was obtained through the onRamp. It can be + // relied upon by the destination pool to validate the source pool. + bytes sourcePoolAddress; + // The address of the destination token, abi encoded in the case of EVM chains + // This value is UNTRUSTED as any pool owner can return whatever value they want. + bytes destTokenAddress; + // Optional pool data to be transferred to the destination chain. Be default this is capped at + // CCIP_LOCK_OR_BURN_V1_RET_BYTES bytes. If more data is required, the TokenTransferFeeConfig.destBytesOverhead + // has to be set for the specific token. + bytes extraData; + uint32 destGasAmount; // The amount of gas available for the releaseOrMint and balanceOf calls on the offRamp + } + + /// @notice Report that is submitted by the execution DON at the execution phase. (including chain selector data) + /// @dev RMN depends on this struct, if changing, please notify the RMN maintainers. + struct ExecutionReportSingleChain { + uint64 sourceChainSelector; // Source chain selector for which the report is submitted + Any2EVMRampMessage[] messages; + // Contains a bytes array for each message, each inner bytes array contains bytes per transferred token + bytes[][] offchainTokenData; + bytes32[] proofs; + uint256 proofFlagBits; + } + + /// @notice Report that is submitted by the execution DON at the execution phase. + /// @dev RMN depends on this struct, if changing, please notify the RMN maintainers. + struct ExecutionReport { + EVM2EVMMessage[] messages; + // Contains a bytes array for each message, each inner bytes array contains bytes per transferred token + bytes[][] offchainTokenData; + bytes32[] proofs; + uint256 proofFlagBits; + } + + /// @notice The cross chain message that gets committed to EVM chains. + /// @dev RMN depends on this struct, if changing, please notify the RMN maintainers. + struct EVM2EVMMessage { + uint64 sourceChainSelector; // ────────╮ the chain selector of the source chain, note: not chainId + address sender; // ────────────────────╯ sender address on the source chain + address receiver; // ──────────────────╮ receiver address on the destination chain + uint64 sequenceNumber; // ─────────────╯ sequence number, not unique across lanes + uint256 gasLimit; // user supplied maximum gas amount available for dest chain execution + bool strict; // ───────────────────────╮ DEPRECATED + uint64 nonce; // │ nonce for this lane for this sender, not unique across senders/lanes + address feeToken; // ──────────────────╯ fee token + uint256 feeTokenAmount; // fee token amount + bytes data; // arbitrary data payload supplied by the message sender + Client.EVMTokenAmount[] tokenAmounts; // array of tokens and amounts to transfer + bytes[] sourceTokenData; // array of token data, one per token + bytes32 messageId; // a hash of the message data + } + + /// @dev EVM2EVMMessage struct has 13 fields, including 3 variable arrays. + /// Each variable array takes 1 more slot to store its length. + /// When abi encoded, excluding array contents, + /// EVM2EVMMessage takes up a fixed number of 16 lots, 32 bytes each. + /// For structs that contain arrays, 1 more slot is added to the front, reaching a total of 17. + uint256 public constant MESSAGE_FIXED_BYTES = 32 * 17; + + /// @dev Each token transfer adds 1 EVMTokenAmount and 3 bytes at 3 slots each and one slot for the destGasAmount. + /// When abi encoded, each EVMTokenAmount takes 2 slots, each bytes takes 1 slot for length, one slot of data and one + /// slot for the offset. This results in effectively 3*3 slots per SourceTokenData. + /// 0x20 + /// destGasAmount + /// sourcePoolAddress_offset + /// destTokenAddress_offset + /// extraData_offset + /// sourcePoolAddress_length + /// sourcePoolAddress_content // assume 1 slot + /// destTokenAddress_length + /// destTokenAddress_content // assume 1 slot + /// extraData_length // contents billed separately + uint256 public constant MESSAGE_FIXED_BYTES_PER_TOKEN = 32 * ((1 + 3 * 3) + 2); + + /// @dev Any2EVMRampMessage struct has 10 fields, including 3 variable unnested arrays (data, receiver and tokenAmounts). + /// Each variable array takes 1 more slot to store its length. + /// When abi encoded, excluding array contents, + /// Any2EVMMessage takes up a fixed number of 13 slots, 32 bytes each. + /// For structs that contain arrays, 1 more slot is added to the front, reaching a total of 14. + /// The fixed bytes does not cover struct data (this is represented by ANY_2_EVM_MESSAGE_FIXED_BYTES_PER_TOKEN) + uint256 public constant ANY_2_EVM_MESSAGE_FIXED_BYTES = 32 * 14; + + /// @dev Each token transfer adds 1 RampTokenAmount + /// RampTokenAmount has 5 fields, 3 of which are bytes type, 1 uint256 and 1 uint32. + /// Each bytes type takes 1 slot for length, 1 slot for data and 1 slot for the offset. + /// uint256 amount takes 1 slot. + /// uint32 destGasAmount takes 1 slot. + uint256 public constant ANY_2_EVM_MESSAGE_FIXED_BYTES_PER_TOKEN = 32 * ((3 * 3) + 2); + + bytes32 internal constant EVM_2_EVM_MESSAGE_HASH = keccak256("EVM2EVMMessageHashV2"); + + /// @dev Used to hash messages for single-lane ramps. + /// OnRamp hash(EVM2EVMMessage) = OffRamp hash(EVM2EVMMessage) + /// The EVM2EVMMessage's messageId is expected to be the output of this hash function + /// @param original Message to hash + /// @param metadataHash Immutable metadata hash representing a lane with a fixed OnRamp + /// @return hashedMessage hashed message as a keccak256 + function _hash(EVM2EVMMessage memory original, bytes32 metadataHash) internal pure returns (bytes32) { + // Fixed-size message fields are included in nested hash to reduce stack pressure. + // This hashing scheme is also used by RMN. If changing it, please notify the RMN maintainers. + return keccak256( + abi.encode( + MerkleMultiProof.LEAF_DOMAIN_SEPARATOR, + metadataHash, + keccak256( + abi.encode( + original.sender, + original.receiver, + original.sequenceNumber, + original.gasLimit, + original.strict, + original.nonce, + original.feeToken, + original.feeTokenAmount + ) + ), + keccak256(original.data), + keccak256(abi.encode(original.tokenAmounts)), + keccak256(abi.encode(original.sourceTokenData)) + ) + ); + } + + bytes32 internal constant ANY_2_EVM_MESSAGE_HASH = keccak256("Any2EVMMessageHashV1"); + bytes32 internal constant EVM_2_ANY_MESSAGE_HASH = keccak256("EVM2AnyMessageHashV1"); + + /// @dev Used to hash messages for multi-lane family-agnostic OffRamps. + /// OnRamp hash(EVM2AnyMessage) != Any2EVMRampMessage.messageId + /// OnRamp hash(EVM2AnyMessage) != OffRamp hash(Any2EVMRampMessage) + /// @param original OffRamp message to hash + /// @param onRamp OnRamp to hash the message with - used to compute the metadataHash + /// @return hashedMessage hashed message as a keccak256 + function _hash(Any2EVMRampMessage memory original, bytes memory onRamp) internal pure returns (bytes32) { + // Fixed-size message fields are included in nested hash to reduce stack pressure. + // This hashing scheme is also used by RMN. If changing it, please notify the RMN maintainers. + return keccak256( + abi.encode( + MerkleMultiProof.LEAF_DOMAIN_SEPARATOR, + // Implicit metadata hash + keccak256( + abi.encode( + ANY_2_EVM_MESSAGE_HASH, original.header.sourceChainSelector, original.header.destChainSelector, onRamp + ) + ), + keccak256( + abi.encode( + original.header.messageId, + original.sender, + original.receiver, + original.header.sequenceNumber, + original.gasLimit, + original.header.nonce + ) + ), + keccak256(original.data), + keccak256(abi.encode(original.tokenAmounts)) + ) + ); + } + + function _hash(EVM2AnyRampMessage memory original, bytes32 metadataHash) internal pure returns (bytes32) { + // Fixed-size message fields are included in nested hash to reduce stack pressure. + // This hashing scheme is also used by RMN. If changing it, please notify the RMN maintainers. + return keccak256( + abi.encode( + MerkleMultiProof.LEAF_DOMAIN_SEPARATOR, + metadataHash, + keccak256( + abi.encode( + original.sender, + original.receiver, + original.header.sequenceNumber, + original.header.nonce, + original.feeToken, + original.feeTokenAmount + ) + ), + keccak256(original.data), + keccak256(abi.encode(original.tokenAmounts)), + keccak256(original.extraArgs) + ) + ); + } + + /// @dev We disallow the first 1024 addresses to avoid calling into a range known for hosting precompiles. Calling + /// into precompiles probably won't cause any issues, but to be safe we can disallow this range. It is extremely + /// unlikely that anyone would ever be able to generate an address in this range. There is no official range of + /// precompiles, but EIP-7587 proposes to reserve the range 0x100 to 0x1ff. Our range is more conservative, even + /// though it might not be exhaustive for all chains, which is OK. We also disallow the zero address, which is a + /// common practice. + uint256 public constant PRECOMPILE_SPACE = 1024; + + /// @notice This methods provides validation for parsing abi encoded addresses by ensuring the + /// address is within the EVM address space. If it isn't it will revert with an InvalidEVMAddress error, which + /// we can catch and handle more gracefully than a revert from abi.decode. + /// @return The address if it is valid, the function will revert otherwise. + function _validateEVMAddress(bytes memory encodedAddress) internal pure returns (address) { + if (encodedAddress.length != 32) revert InvalidEVMAddress(encodedAddress); + uint256 encodedAddressUint = abi.decode(encodedAddress, (uint256)); + if (encodedAddressUint > type(uint160).max || encodedAddressUint < PRECOMPILE_SPACE) { + revert InvalidEVMAddress(encodedAddress); + } + return address(uint160(encodedAddressUint)); + } + + /// @notice Enum listing the possible message execution states within + /// the offRamp contract. + /// UNTOUCHED never executed + /// IN_PROGRESS currently being executed, used a replay protection + /// SUCCESS successfully executed. End state + /// FAILURE unsuccessfully executed, manual execution is now enabled. + /// @dev RMN depends on this enum, if changing, please notify the RMN maintainers. + enum MessageExecutionState { + UNTOUCHED, + IN_PROGRESS, + SUCCESS, + FAILURE + } + + /// @notice CCIP OCR plugin type, used to separate execution & commit transmissions and configs + enum OCRPluginType { + Commit, + Execution + } + + /// @notice Family-agnostic token amounts used for both OnRamp & OffRamp messages + struct RampTokenAmount { + // The source pool address, abi encoded. This value is trusted as it was obtained through the onRamp. It can be + // relied upon by the destination pool to validate the source pool. + bytes sourcePoolAddress; + // The address of the destination token, abi encoded in the case of EVM chains + // This value is UNTRUSTED as any pool owner can return whatever value they want. + bytes destTokenAddress; + // Optional pool data to be transferred to the destination chain. Be default this is capped at + // CCIP_LOCK_OR_BURN_V1_RET_BYTES bytes. If more data is required, the TokenTransferFeeConfig.destBytesOverhead + // has to be set for the specific token. + bytes extraData; + uint256 amount; // Amount of tokens. + // Destination chain specific execution data encoded in bytes + //(for EVM destination it consists of the amount of gas available for the releaseOrMint and transfer calls on the offRamp + bytes destExecData; + } + + /// @notice Family-agnostic header for OnRamp & OffRamp messages. + /// The messageId is not expected to match hash(message), since it may originate from another ramp family + struct RampMessageHeader { + bytes32 messageId; // Unique identifier for the message, generated with the source chain's encoding scheme (i.e. not necessarily abi.encoded) + uint64 sourceChainSelector; // ──╮ the chain selector of the source chain, note: not chainId + uint64 destChainSelector; // | the chain selector of the destination chain, note: not chainId + uint64 sequenceNumber; // │ sequence number, not unique across lanes + uint64 nonce; // ────────────────╯ nonce for this lane for this sender, not unique across senders/lanes + } + + /// @notice Family-agnostic message routed to an OffRamp + /// Note: hash(Any2EVMRampMessage) != hash(EVM2AnyRampMessage), hash(Any2EVMRampMessage) != messageId + /// due to encoding & parameter differences + struct Any2EVMRampMessage { + RampMessageHeader header; // Message header + bytes sender; // sender address on the source chain + bytes data; // arbitrary data payload supplied by the message sender + address receiver; // receiver address on the destination chain + uint256 gasLimit; // user supplied maximum gas amount available for dest chain execution + RampTokenAmount[] tokenAmounts; // array of tokens and amounts to transfer + } + + /// @notice Family-agnostic message emitted from the OnRamp + /// Note: hash(Any2EVMRampMessage) != hash(EVM2AnyRampMessage) due to encoding & parameter differences + /// messageId = hash(EVM2AnyRampMessage) using the source EVM chain's encoding format + struct EVM2AnyRampMessage { + RampMessageHeader header; // Message header + address sender; // sender address on the source chain + bytes data; // arbitrary data payload supplied by the message sender + bytes receiver; // receiver address on the destination chain + bytes extraArgs; // destination-chain specific extra args, such as the gasLimit for EVM chains + address feeToken; // fee token + uint256 feeTokenAmount; // fee token amount + RampTokenAmount[] tokenAmounts; // array of tokens and amounts to transfer + } + + // bytes4(keccak256("CCIP ChainFamilySelector EVM")) + bytes4 public constant CHAIN_FAMILY_SELECTOR_EVM = 0x2812d52c; + + /// @dev Struct to hold a merkle root and an interval for a source chain so that an array of these can be passed in the CommitReport. + /// @dev RMN depends on this struct, if changing, please notify the RMN maintainers. + struct MerkleRoot { + uint64 sourceChainSelector; // ──╮ Remote source chain selector that the Merkle Root is scoped to + uint64 minSeqNr; // | Minimum sequence number, inclusive + uint64 maxSeqNr; // ─────────────╯ Maximum sequence number, inclusive + bytes32 merkleRoot; // Merkle root covering the interval & source chain messages + bytes onRampAddress; // Generic onramp address, to support arbitrary sources; for EVM, use abi.encode + } +} diff --git a/contracts/src/v0.8/ccip/libraries/MerkleMultiProof.sol b/contracts/src/v0.8/ccip/libraries/MerkleMultiProof.sol new file mode 100644 index 00000000000..fed8a1165bb --- /dev/null +++ b/contracts/src/v0.8/ccip/libraries/MerkleMultiProof.sol @@ -0,0 +1,113 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.0; + +library MerkleMultiProof { + /// @notice Leaf domain separator, should be used as the first 32 bytes of a leaf's preimage. + bytes32 internal constant LEAF_DOMAIN_SEPARATOR = 0x0000000000000000000000000000000000000000000000000000000000000000; + /// @notice Internal domain separator, should be used as the first 32 bytes of an internal node's preiimage. + bytes32 internal constant INTERNAL_DOMAIN_SEPARATOR = + 0x0000000000000000000000000000000000000000000000000000000000000001; + + uint256 internal constant MAX_NUM_HASHES = 256; + + error InvalidProof(); + error LeavesCannotBeEmpty(); + + /// @notice Computes the root based on provided pre-hashed leaf nodes in + /// leaves, internal nodes in proofs, and using proofFlagBits' i-th bit to + /// determine if an element of proofs or one of the previously computed leafs + /// or internal nodes will be used for the i-th hash. + /// @param leaves Should be pre-hashed and the first 32 bytes of a leaf's + /// preimage should match LEAF_DOMAIN_SEPARATOR. + /// @param proofs The hashes to be used instead of a leaf hash when the proofFlagBits + /// indicates a proof should be used. + /// @param proofFlagBits A single uint256 of which each bit indicates whether a leaf or + /// a proof needs to be used in a hash operation. + /// @dev the maximum number of hash operations it set to 256. Any input that would require + /// more than 256 hashes to get to a root will revert. + /// @dev For given input `leaves` = [a,b,c] `proofs` = [D] and `proofFlagBits` = 5 + /// totalHashes = 3 + 1 - 1 = 3 + /// ** round 1 ** + /// proofFlagBits = (5 >> 0) & 1 = true + /// hashes[0] = hashPair(a, b) + /// (leafPos, hashPos, proofPos) = (2, 0, 0); + /// + /// ** round 2 ** + /// proofFlagBits = (5 >> 1) & 1 = false + /// hashes[1] = hashPair(D, c) + /// (leafPos, hashPos, proofPos) = (3, 0, 1); + /// + /// ** round 3 ** + /// proofFlagBits = (5 >> 2) & 1 = true + /// hashes[2] = hashPair(hashes[0], hashes[1]) + /// (leafPos, hashPos, proofPos) = (3, 2, 1); + /// + /// i = 3 and no longer < totalHashes. The algorithm is done + /// return hashes[totalHashes - 1] = hashes[2]; the last hash we computed. + // We mark this function as internal to force it to be inlined in contracts + // that use it, but semantically it is public. + // solhint-disable-next-line chainlink-solidity/prefix-internal-functions-with-underscore + function merkleRoot( + bytes32[] memory leaves, + bytes32[] memory proofs, + uint256 proofFlagBits + ) internal pure returns (bytes32) { + unchecked { + uint256 leavesLen = leaves.length; + uint256 proofsLen = proofs.length; + if (leavesLen == 0) revert LeavesCannotBeEmpty(); + if (!(leavesLen <= MAX_NUM_HASHES + 1 && proofsLen <= MAX_NUM_HASHES + 1)) revert InvalidProof(); + uint256 totalHashes = leavesLen + proofsLen - 1; + if (!(totalHashes <= MAX_NUM_HASHES)) revert InvalidProof(); + if (totalHashes == 0) { + return leaves[0]; + } + bytes32[] memory hashes = new bytes32[](totalHashes); + (uint256 leafPos, uint256 hashPos, uint256 proofPos) = (0, 0, 0); + + for (uint256 i = 0; i < totalHashes; ++i) { + // Checks if the bit flag signals the use of a supplied proof or a leaf/previous hash. + bytes32 a; + if (proofFlagBits & (1 << i) == (1 << i)) { + // Use a leaf or a previously computed hash. + if (leafPos < leavesLen) { + a = leaves[leafPos++]; + } else { + a = hashes[hashPos++]; + } + } else { + // Use a supplied proof. + a = proofs[proofPos++]; + } + + // The second part of the hashed pair is never a proof as hashing two proofs would result in a + // hash that can already be computed offchain. + bytes32 b; + if (leafPos < leavesLen) { + b = leaves[leafPos++]; + } else { + b = hashes[hashPos++]; + } + + if (!(hashPos <= i)) revert InvalidProof(); + + hashes[i] = _hashPair(a, b); + } + if (!(hashPos == totalHashes - 1 && leafPos == leavesLen && proofPos == proofsLen)) revert InvalidProof(); + // Return the last hash. + return hashes[totalHashes - 1]; + } + } + + /// @notice Hashes two bytes32 objects in their given order, prepended by the + /// INTERNAL_DOMAIN_SEPARATOR. + function _hashInternalNode(bytes32 left, bytes32 right) private pure returns (bytes32 hash) { + return keccak256(abi.encode(INTERNAL_DOMAIN_SEPARATOR, left, right)); + } + + /// @notice Hashes two bytes32 objects. The order is taken into account, + /// using the lower value first. + function _hashPair(bytes32 a, bytes32 b) private pure returns (bytes32) { + return a < b ? _hashInternalNode(a, b) : _hashInternalNode(b, a); + } +} diff --git a/contracts/src/v0.8/ccip/libraries/Pool.sol b/contracts/src/v0.8/ccip/libraries/Pool.sol new file mode 100644 index 00000000000..391beb00c18 --- /dev/null +++ b/contracts/src/v0.8/ccip/libraries/Pool.sol @@ -0,0 +1,57 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +/// @notice This library contains various token pool functions to aid constructing the return data. +library Pool { + // The tag used to signal support for the pool v1 standard + // bytes4(keccak256("CCIP_POOL_V1")) + bytes4 public constant CCIP_POOL_V1 = 0xaff2afbf; + + // The number of bytes in the return data for a pool v1 releaseOrMint call. + // This should match the size of the ReleaseOrMintOutV1 struct. + uint16 public constant CCIP_POOL_V1_RET_BYTES = 32; + + // The default max number of bytes in the return data for a pool v1 lockOrBurn call. + // This data can be used to send information to the destination chain token pool. Can be overwritten + // in the TokenTransferFeeConfig.destBytesOverhead if more data is required. + uint32 public constant CCIP_LOCK_OR_BURN_V1_RET_BYTES = 32; + + struct LockOrBurnInV1 { + bytes receiver; // The recipient of the tokens on the destination chain, abi encoded + uint64 remoteChainSelector; // ─╮ The chain ID of the destination chain + address originalSender; // ─────╯ The original sender of the tx on the source chain + uint256 amount; // The amount of tokens to lock or burn, denominated in the source token's decimals + address localToken; // The address on this chain of the token to lock or burn + } + + struct LockOrBurnOutV1 { + // The address of the destination token, abi encoded in the case of EVM chains + // This value is UNTRUSTED as any pool owner can return whatever value they want. + bytes destTokenAddress; + // Optional pool data to be transferred to the destination chain. Be default this is capped at + // CCIP_LOCK_OR_BURN_V1_RET_BYTES bytes. If more data is required, the TokenTransferFeeConfig.destBytesOverhead + // has to be set for the specific token. + bytes destPoolData; + } + + struct ReleaseOrMintInV1 { + bytes originalSender; // The original sender of the tx on the source chain + uint64 remoteChainSelector; // ─╮ The chain ID of the source chain + address receiver; // ───────────╯ The recipient of the tokens on the destination chain. + uint256 amount; // The amount of tokens to release or mint, denominated in the source token's decimals + address localToken; // The address on this chain of the token to release or mint + /// @dev WARNING: sourcePoolAddress should be checked prior to any processing of funds. Make sure it matches the + /// expected pool address for the given remoteChainSelector. + bytes sourcePoolAddress; // The address of the source pool, abi encoded in the case of EVM chains + bytes sourcePoolData; // The data received from the source pool to process the release or mint + /// @dev WARNING: offchainTokenData is untrusted data. + bytes offchainTokenData; // The offchain data to process the release or mint + } + + struct ReleaseOrMintOutV1 { + // The number of tokens released or minted on the destination chain, denominated in the local token's decimals. + // This value is expected to be equal to the ReleaseOrMintInV1.amount in the case where the source and destination + // chain have the same number of decimals. + uint256 destinationAmount; + } +} diff --git a/contracts/src/v0.8/ccip/libraries/RateLimiter.sol b/contracts/src/v0.8/ccip/libraries/RateLimiter.sol new file mode 100644 index 00000000000..40ac3ca213e --- /dev/null +++ b/contracts/src/v0.8/ccip/libraries/RateLimiter.sol @@ -0,0 +1,157 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.0; + +/// @notice Implements Token Bucket rate limiting. +/// @dev uint128 is safe for rate limiter state. +/// For USD value rate limiting, it can adequately store USD value in 18 decimals. +/// For ERC20 token amount rate limiting, all tokens that will be listed will have at most +/// a supply of uint128.max tokens, and it will therefore not overflow the bucket. +/// In exceptional scenarios where tokens consumed may be larger than uint128, +/// e.g. compromised issuer, an enabled RateLimiter will check and revert. +library RateLimiter { + error BucketOverfilled(); + error OnlyCallableByAdminOrOwner(); + error TokenMaxCapacityExceeded(uint256 capacity, uint256 requested, address tokenAddress); + error TokenRateLimitReached(uint256 minWaitInSeconds, uint256 available, address tokenAddress); + error AggregateValueMaxCapacityExceeded(uint256 capacity, uint256 requested); + error AggregateValueRateLimitReached(uint256 minWaitInSeconds, uint256 available); + error InvalidRateLimitRate(Config rateLimiterConfig); + error DisabledNonZeroRateLimit(Config config); + error RateLimitMustBeDisabled(); + + event TokensConsumed(uint256 tokens); + event ConfigChanged(Config config); + + struct TokenBucket { + uint128 tokens; // ──────╮ Current number of tokens that are in the bucket. + uint32 lastUpdated; // │ Timestamp in seconds of the last token refill, good for 100+ years. + bool isEnabled; // ──────╯ Indication whether the rate limiting is enabled or not + uint128 capacity; // ────╮ Maximum number of tokens that can be in the bucket. + uint128 rate; // ────────╯ Number of tokens per second that the bucket is refilled. + } + + struct Config { + bool isEnabled; // Indication whether the rate limiting should be enabled + uint128 capacity; // ────╮ Specifies the capacity of the rate limiter + uint128 rate; // ───────╯ Specifies the rate of the rate limiter + } + + /// @notice _consume removes the given tokens from the pool, lowering the + /// rate tokens allowed to be consumed for subsequent calls. + /// @param requestTokens The total tokens to be consumed from the bucket. + /// @param tokenAddress The token to consume capacity for, use 0x0 to indicate aggregate value capacity. + /// @dev Reverts when requestTokens exceeds bucket capacity or available tokens in the bucket + /// @dev emits removal of requestTokens if requestTokens is > 0 + function _consume(TokenBucket storage s_bucket, uint256 requestTokens, address tokenAddress) internal { + // If there is no value to remove or rate limiting is turned off, skip this step to reduce gas usage + if (!s_bucket.isEnabled || requestTokens == 0) { + return; + } + + uint256 tokens = s_bucket.tokens; + uint256 capacity = s_bucket.capacity; + uint256 timeDiff = block.timestamp - s_bucket.lastUpdated; + + if (timeDiff != 0) { + if (tokens > capacity) revert BucketOverfilled(); + + // Refill tokens when arriving at a new block time + tokens = _calculateRefill(capacity, tokens, timeDiff, s_bucket.rate); + + s_bucket.lastUpdated = uint32(block.timestamp); + } + + if (capacity < requestTokens) { + // Token address 0 indicates consuming aggregate value rate limit capacity. + if (tokenAddress == address(0)) revert AggregateValueMaxCapacityExceeded(capacity, requestTokens); + revert TokenMaxCapacityExceeded(capacity, requestTokens, tokenAddress); + } + if (tokens < requestTokens) { + uint256 rate = s_bucket.rate; + // Wait required until the bucket is refilled enough to accept this value, round up to next higher second + // Consume is not guaranteed to succeed after wait time passes if there is competing traffic. + // This acts as a lower bound of wait time. + uint256 minWaitInSeconds = ((requestTokens - tokens) + (rate - 1)) / rate; + + if (tokenAddress == address(0)) revert AggregateValueRateLimitReached(minWaitInSeconds, tokens); + revert TokenRateLimitReached(minWaitInSeconds, tokens, tokenAddress); + } + tokens -= requestTokens; + + // Downcast is safe here, as tokens is not larger than capacity + s_bucket.tokens = uint128(tokens); + emit TokensConsumed(requestTokens); + } + + /// @notice Gets the token bucket with its values for the block it was requested at. + /// @return The token bucket. + function _currentTokenBucketState(TokenBucket memory bucket) internal view returns (TokenBucket memory) { + // We update the bucket to reflect the status at the exact time of the + // call. This means we might need to refill a part of the bucket based + // on the time that has passed since the last update. + bucket.tokens = + uint128(_calculateRefill(bucket.capacity, bucket.tokens, block.timestamp - bucket.lastUpdated, bucket.rate)); + bucket.lastUpdated = uint32(block.timestamp); + return bucket; + } + + /// @notice Sets the rate limited config. + /// @param s_bucket The token bucket + /// @param config The new config + function _setTokenBucketConfig(TokenBucket storage s_bucket, Config memory config) internal { + // First update the bucket to make sure the proper rate is used for all the time + // up until the config change. + uint256 timeDiff = block.timestamp - s_bucket.lastUpdated; + if (timeDiff != 0) { + s_bucket.tokens = uint128(_calculateRefill(s_bucket.capacity, s_bucket.tokens, timeDiff, s_bucket.rate)); + + s_bucket.lastUpdated = uint32(block.timestamp); + } + + s_bucket.tokens = uint128(_min(config.capacity, s_bucket.tokens)); + s_bucket.isEnabled = config.isEnabled; + s_bucket.capacity = config.capacity; + s_bucket.rate = config.rate; + + emit ConfigChanged(config); + } + + /// @notice Validates the token bucket config + function _validateTokenBucketConfig(Config memory config, bool mustBeDisabled) internal pure { + if (config.isEnabled) { + if (config.rate >= config.capacity || config.rate == 0) { + revert InvalidRateLimitRate(config); + } + if (mustBeDisabled) { + revert RateLimitMustBeDisabled(); + } + } else { + if (config.rate != 0 || config.capacity != 0) { + revert DisabledNonZeroRateLimit(config); + } + } + } + + /// @notice Calculate refilled tokens + /// @param capacity bucket capacity + /// @param tokens current bucket tokens + /// @param timeDiff block time difference since last refill + /// @param rate bucket refill rate + /// @return the value of tokens after refill + function _calculateRefill( + uint256 capacity, + uint256 tokens, + uint256 timeDiff, + uint256 rate + ) private pure returns (uint256) { + return _min(capacity, tokens + timeDiff * rate); + } + + /// @notice Return the smallest of two integers + /// @param a first int + /// @param b second int + /// @return smallest + function _min(uint256 a, uint256 b) internal pure returns (uint256) { + return a < b ? a : b; + } +} diff --git a/contracts/src/v0.8/ccip/libraries/USDPriceWith18Decimals.sol b/contracts/src/v0.8/ccip/libraries/USDPriceWith18Decimals.sol new file mode 100644 index 00000000000..3508276d769 --- /dev/null +++ b/contracts/src/v0.8/ccip/libraries/USDPriceWith18Decimals.sol @@ -0,0 +1,45 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.0; + +library USDPriceWith18Decimals { + /// @notice Takes a price in USD, with 18 decimals per 1e18 token amount, + /// and amount of the smallest token denomination, + /// calculates the value in USD with 18 decimals. + /// @param tokenPrice The USD price of the token. + /// @param tokenAmount Amount of the smallest token denomination. + /// @return USD value with 18 decimals. + /// @dev this function assumes that no more than 1e59 US dollar worth of token is passed in. + /// If more is sent, this function will overflow and revert. + /// Since there isn't even close to 1e59 dollars, this is ok for all legit tokens. + function _calcUSDValueFromTokenAmount(uint224 tokenPrice, uint256 tokenAmount) internal pure returns (uint256) { + /// LINK Example: + /// tokenPrice: 8e18 -> $8/LINK, as 1e18 token amount is 1 LINK, worth 8 USD, or 8e18 with 18 decimals + /// tokenAmount: 2e18 -> 2 LINK + /// result: 8e18 * 2e18 / 1e18 -> 16e18 with 18 decimals = $16 + + /// USDC Example: + /// tokenPrice: 1e30 -> $1/USDC, as 1e18 token amount is 1e12 USDC, worth 1e12 USD, or 1e30 with 18 decimals + /// tokenAmount: 5e6 -> 5 USDC + /// result: 1e30 * 5e6 / 1e18 -> 5e18 with 18 decimals = $5 + return (tokenPrice * tokenAmount) / 1e18; + } + + /// @notice Takes a price in USD, with 18 decimals per 1e18 token amount, + /// and USD value with 18 decimals, + /// calculates amount of the smallest token denomination. + /// @param tokenPrice The USD price of the token. + /// @param usdValue USD value with 18 decimals. + /// @return Amount of the smallest token denomination. + function _calcTokenAmountFromUSDValue(uint224 tokenPrice, uint256 usdValue) internal pure returns (uint256) { + /// LINK Example: + /// tokenPrice: 8e18 -> $8/LINK, as 1e18 token amount is 1 LINK, worth 8 USD, or 8e18 with 18 decimals + /// usdValue: 16e18 -> $16 + /// result: 16e18 * 1e18 / 8e18 -> 2e18 = 2 LINK + + /// USDC Example: + /// tokenPrice: 1e30 -> $1/USDC, as 1e18 token amount is 1e12 USDC, worth 1e12 USD, or 1e30 with 18 decimals + /// usdValue: 5e18 -> $5 + /// result: 5e18 * 1e18 / 1e30 -> 5e6 = 5 USDC + return (usdValue * 1e18) / tokenPrice; + } +} diff --git a/contracts/src/v0.8/ccip/ocr/MultiOCR3Base.sol b/contracts/src/v0.8/ccip/ocr/MultiOCR3Base.sol new file mode 100644 index 00000000000..c9fff4d6248 --- /dev/null +++ b/contracts/src/v0.8/ccip/ocr/MultiOCR3Base.sol @@ -0,0 +1,318 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.0; + +import {OwnerIsCreator} from "../../shared/access/OwnerIsCreator.sol"; +import {ITypeAndVersion} from "../../shared/interfaces/ITypeAndVersion.sol"; + +/// @notice Onchain verification of reports from the offchain reporting protocol +/// with multiple OCR plugin support. +abstract contract MultiOCR3Base is ITypeAndVersion, OwnerIsCreator { + // Maximum number of oracles the offchain reporting protocol is designed for + uint256 internal constant MAX_NUM_ORACLES = 256; + + /// @notice Triggers a new run of the offchain reporting protocol + /// @param ocrPluginType OCR plugin type for which the config was set + /// @param configDigest configDigest of this configuration + /// @param signers ith element is address ith oracle uses to sign a report + /// @param transmitters ith element is address ith oracle uses to transmit a report via the transmit method + /// @param F maximum number of faulty/dishonest oracles the protocol can tolerate while still working correctly + event ConfigSet(uint8 ocrPluginType, bytes32 configDigest, address[] signers, address[] transmitters, uint8 F); + + /// @notice Optionally emitted to indicate the latest configDigest and sequence number + /// for which a report was successfully transmitted. Alternatively, the contract may + /// use latestConfigDigestAndEpoch with scanLogs set to false. + event Transmitted(uint8 indexed ocrPluginType, bytes32 configDigest, uint64 sequenceNumber); + + enum InvalidConfigErrorType { + F_MUST_BE_POSITIVE, + TOO_MANY_TRANSMITTERS, + TOO_MANY_SIGNERS, + F_TOO_HIGH, + REPEATED_ORACLE_ADDRESS + } + + error InvalidConfig(InvalidConfigErrorType errorType); + error WrongMessageLength(uint256 expected, uint256 actual); + error ConfigDigestMismatch(bytes32 expected, bytes32 actual); + error ForkedChain(uint256 expected, uint256 actual); + error WrongNumberOfSignatures(); + error SignaturesOutOfRegistration(); + error UnauthorizedTransmitter(); + error UnauthorizedSigner(); + error NonUniqueSignatures(); + error OracleCannotBeZeroAddress(); + error StaticConfigCannotBeChanged(uint8 ocrPluginType); + + /// @dev Packing these fields used on the hot path in a ConfigInfo variable reduces the + /// retrieval of all of them to a minimum number of SLOADs. + struct ConfigInfo { + bytes32 configDigest; + uint8 F; // ──────────────────────────────╮ maximum number of faulty/dishonest oracles the system can tolerate + uint8 n; // │ number of signers / transmitters + bool isSignatureVerificationEnabled; // ──╯ if true, requires signers and verifies signatures on transmission verification + } + + /// @notice Used for s_oracles[a].role, where a is an address, to track the purpose + /// of the address, or to indicate that the address is unset. + enum Role { + // No oracle role has been set for address a + Unset, + // Signing address for the s_oracles[a].index'th oracle. I.e., report + // signatures from this oracle should ecrecover back to address a. + Signer, + // Transmission address for the s_oracles[a].index'th oracle. I.e., if a + // report is received by OCR2Aggregator.transmit in which msg.sender is + // a, it is attributed to the s_oracles[a].index'th oracle. + Transmitter + } + + struct Oracle { + uint8 index; // ───╮ Index of oracle in s_signers/s_transmitters + Role role; // ─────╯ Role of the address which mapped to this struct + } + + /// @notice OCR configuration for a single OCR plugin within a DON. + struct OCRConfig { + ConfigInfo configInfo; // latest OCR config + address[] signers; // addresses oracles use to sign the reports + address[] transmitters; // addresses oracles use to transmit the reports + } + + /// @notice Args to update an OCR Config. + struct OCRConfigArgs { + bytes32 configDigest; // Config digest to update to + uint8 ocrPluginType; // ──────────────────╮ OCR plugin type to update config for + uint8 F; // │ maximum number of faulty/dishonest oracles + bool isSignatureVerificationEnabled; // ──╯ if true, requires signers and verifies signatures on transmission verification + address[] signers; // signing address of each oracle + address[] transmitters; // transmission address of each oracle (i.e. the address the oracle actually sends transactions to the contract from) + } + + /// @notice mapping of OCR plugin type -> DON config + mapping(uint8 ocrPluginType => OCRConfig config) internal s_ocrConfigs; + + /// @notice OCR plugin type => signer OR transmitter address mapping + mapping(uint8 ocrPluginType => mapping(address signerOrTransmiter => Oracle oracle)) internal s_oracles; + + // Constant-length components of the msg.data sent to transmit. + // See the "If we wanted to call sam" example on for example reasoning + // https://solidity.readthedocs.io/en/v0.7.2/abi-spec.html + + /// @notice Constant length component for transmit functions with no signatures. + /// The signatures are expected to match transmitPlugin(reportContext, report). + uint16 private constant TRANSMIT_MSGDATA_CONSTANT_LENGTH_COMPONENT_NO_SIGNATURES = 4 // function selector + + 3 * 32 // 3 words containing reportContext + + 32 // word containing start location of abiencoded report value + + 32; // word containing length of report + + /// @notice Extra constant length component for transmit functions with signatures (relative to no signatures). + /// The signatures are expected to match transmitPlugin(reportContext, report, rs, ss, rawVs). + uint16 private constant TRANSMIT_MSGDATA_EXTRA_CONSTANT_LENGTH_COMPONENT_FOR_SIGNATURES = 32 // word containing location start of abiencoded rs value + + 32 // word containing start location of abiencoded ss value + + 32 // rawVs value + + 32 // word containing length rs + + 32; // word containing length of ss + + uint256 internal immutable i_chainID; + + constructor() { + i_chainID = block.chainid; + } + + /// @notice Sets offchain reporting protocol configuration incl. participating oracles. + /// NOTE: The OCR3 config must be sanity-checked against the home-chain registry configuration, to ensure + /// home-chain and remote-chain parity! + /// @param ocrConfigArgs OCR config update args. + function setOCR3Configs(OCRConfigArgs[] memory ocrConfigArgs) external onlyOwner { + for (uint256 i; i < ocrConfigArgs.length; ++i) { + _setOCR3Config(ocrConfigArgs[i]); + } + } + + /// @notice Sets offchain reporting protocol configuration incl. participating oracles for a single OCR plugin type. + /// @param ocrConfigArgs OCR config update args. + function _setOCR3Config(OCRConfigArgs memory ocrConfigArgs) internal { + if (ocrConfigArgs.F == 0) revert InvalidConfig(InvalidConfigErrorType.F_MUST_BE_POSITIVE); + + uint8 ocrPluginType = ocrConfigArgs.ocrPluginType; + OCRConfig storage ocrConfig = s_ocrConfigs[ocrPluginType]; + ConfigInfo storage configInfo = ocrConfig.configInfo; + + // If F is 0, then the config is not yet set + if (configInfo.F == 0) { + configInfo.isSignatureVerificationEnabled = ocrConfigArgs.isSignatureVerificationEnabled; + } else if (configInfo.isSignatureVerificationEnabled != ocrConfigArgs.isSignatureVerificationEnabled) { + revert StaticConfigCannotBeChanged(ocrPluginType); + } + + address[] memory transmitters = ocrConfigArgs.transmitters; + if (transmitters.length > MAX_NUM_ORACLES) revert InvalidConfig(InvalidConfigErrorType.TOO_MANY_TRANSMITTERS); + + _clearOracleRoles(ocrPluginType, ocrConfig.transmitters); + + if (ocrConfigArgs.isSignatureVerificationEnabled) { + _clearOracleRoles(ocrPluginType, ocrConfig.signers); + + address[] memory signers = ocrConfigArgs.signers; + + if (signers.length > MAX_NUM_ORACLES) revert InvalidConfig(InvalidConfigErrorType.TOO_MANY_SIGNERS); + if (signers.length <= 3 * ocrConfigArgs.F) revert InvalidConfig(InvalidConfigErrorType.F_TOO_HIGH); + + configInfo.n = uint8(signers.length); + ocrConfig.signers = signers; + + _assignOracleRoles(ocrPluginType, signers, Role.Signer); + } + + _assignOracleRoles(ocrPluginType, transmitters, Role.Transmitter); + + ocrConfig.transmitters = transmitters; + configInfo.F = ocrConfigArgs.F; + configInfo.configDigest = ocrConfigArgs.configDigest; + + emit ConfigSet( + ocrPluginType, ocrConfigArgs.configDigest, ocrConfig.signers, ocrConfigArgs.transmitters, ocrConfigArgs.F + ); + _afterOCR3ConfigSet(ocrPluginType); + } + + /// @notice Hook that is called after a plugin's OCR3 config changes. + /// @param ocrPluginType Plugin type for which the config changed. + function _afterOCR3ConfigSet(uint8 ocrPluginType) internal virtual; + + /// @notice Clears oracle roles for the provided oracle addresses. + /// @param ocrPluginType OCR plugin type to clear roles for. + /// @param oracleAddresses Oracle addresses to clear roles for. + function _clearOracleRoles(uint8 ocrPluginType, address[] memory oracleAddresses) internal { + for (uint256 i = 0; i < oracleAddresses.length; ++i) { + delete s_oracles[ocrPluginType][oracleAddresses[i]]; + } + } + + /// @notice Assigns oracles roles for the provided oracle addresses with uniqueness verification. + /// @param ocrPluginType OCR plugin type to assign roles for. + /// @param oracleAddresses Oracle addresses to assign roles to. + /// @param role Role to assign. + function _assignOracleRoles(uint8 ocrPluginType, address[] memory oracleAddresses, Role role) internal { + for (uint256 i = 0; i < oracleAddresses.length; ++i) { + address oracle = oracleAddresses[i]; + if (s_oracles[ocrPluginType][oracle].role != Role.Unset) { + revert InvalidConfig(InvalidConfigErrorType.REPEATED_ORACLE_ADDRESS); + } + if (oracle == address(0)) revert OracleCannotBeZeroAddress(); + s_oracles[ocrPluginType][oracle] = Oracle(uint8(i), role); + } + } + + /// @notice _transmit is called to post a new report to the contract. + /// The function should be called after the per-DON reporting logic is completed. + /// @param ocrPluginType OCR plugin type to transmit report for + /// @param report serialized report, which the signatures are signing. + /// @param rs ith element is the R components of the ith signature on report. Must have at most MAX_NUM_ORACLES entries. + /// @param ss ith element is the S components of the ith signature on report. Must have at most MAX_NUM_ORACLES entries. + /// @param rawVs ith element is the the V component of the ith signature. + function _transmit( + uint8 ocrPluginType, + // NOTE: If these parameters are changed, expectedMsgDataLength and/or + // TRANSMIT_MSGDATA_CONSTANT_LENGTH_COMPONENT need to be changed accordingly + bytes32[3] calldata reportContext, + bytes calldata report, + bytes32[] memory rs, + bytes32[] memory ss, + bytes32 rawVs // signatures + ) internal { + // reportContext consists of: + // reportContext[0]: ConfigDigest + // reportContext[1]: 24 byte padding, 8 byte sequence number + // reportContext[2]: ExtraHash + ConfigInfo memory configInfo = s_ocrConfigs[ocrPluginType].configInfo; + bytes32 configDigest = reportContext[0]; + + // Scoping this reduces stack pressure and gas usage + { + uint256 expectedDataLength = uint256(TRANSMIT_MSGDATA_CONSTANT_LENGTH_COMPONENT_NO_SIGNATURES) + report.length; // one byte pure entry in _report + + if (configInfo.isSignatureVerificationEnabled) { + expectedDataLength += TRANSMIT_MSGDATA_EXTRA_CONSTANT_LENGTH_COMPONENT_FOR_SIGNATURES + rs.length * 32 // 32 bytes per entry in _rs + + ss.length * 32; // 32 bytes per entry in _ss) + } + + if (msg.data.length != expectedDataLength) revert WrongMessageLength(expectedDataLength, msg.data.length); + } + + if (configInfo.configDigest != configDigest) { + revert ConfigDigestMismatch(configInfo.configDigest, configDigest); + } + // If the cached chainID at time of deployment doesn't match the current chainID, we reject all signed reports. + // This avoids a (rare) scenario where chain A forks into chain A and A', A' still has configDigest + // calculated from chain A and so OCR reports will be valid on both forks. + _whenChainNotForked(); + + // Scoping this reduces stack pressure and gas usage + { + Oracle memory transmitter = s_oracles[ocrPluginType][msg.sender]; + // Check that sender is authorized to report + if ( + !( + transmitter.role == Role.Transmitter + && msg.sender == s_ocrConfigs[ocrPluginType].transmitters[transmitter.index] + ) + ) { + revert UnauthorizedTransmitter(); + } + } + + if (configInfo.isSignatureVerificationEnabled) { + // Scoping to reduce stack pressure + { + if (rs.length != configInfo.F + 1) revert WrongNumberOfSignatures(); + if (rs.length != ss.length) revert SignaturesOutOfRegistration(); + } + + bytes32 h = keccak256(abi.encodePacked(keccak256(report), reportContext)); + _verifySignatures(ocrPluginType, h, rs, ss, rawVs); + } + + emit Transmitted(ocrPluginType, configDigest, uint64(uint256(reportContext[1]))); + } + + /// @notice Verifies the signatures of a hashed report value for one OCR plugin type. + /// @param ocrPluginType OCR plugin type to transmit report for. + /// @param hashedReport hashed encoded packing of report + reportContext. + /// @param rs ith element is the R components of the ith signature on report. Must have at most MAX_NUM_ORACLES entries. + /// @param ss ith element is the S components of the ith signature on report. Must have at most MAX_NUM_ORACLES entries. + /// @param rawVs ith element is the the V component of the ith signature. + function _verifySignatures( + uint8 ocrPluginType, + bytes32 hashedReport, + bytes32[] memory rs, + bytes32[] memory ss, + bytes32 rawVs + ) internal view { + // Verify signatures attached to report. Using a uint256 means we can only verify up to 256 oracles. + uint256 signed = 0; + + uint256 numberOfSignatures = rs.length; + for (uint256 i; i < numberOfSignatures; ++i) { + // Safe from ECDSA malleability here since we check for duplicate signers. + address signer = ecrecover(hashedReport, uint8(rawVs[i]) + 27, rs[i], ss[i]); + // Since we disallow address(0) as a valid signer address, it can never have a signer role. + Oracle memory oracle = s_oracles[ocrPluginType][signer]; + if (oracle.role != Role.Signer) revert UnauthorizedSigner(); + if (signed & (0x1 << oracle.index) != 0) revert NonUniqueSignatures(); + signed |= 0x1 << oracle.index; + } + } + + /// @notice Validates that the chain ID has not diverged after deployment. Reverts if the chain IDs do not match. + function _whenChainNotForked() internal view { + if (i_chainID != block.chainid) revert ForkedChain(i_chainID, block.chainid); + } + + /// @notice Information about current offchain reporting protocol configuration. + /// @param ocrPluginType OCR plugin type to return config details for. + /// @return ocrConfig OCR config for the plugin type. + function latestConfigDetails(uint8 ocrPluginType) external view returns (OCRConfig memory ocrConfig) { + return s_ocrConfigs[ocrPluginType]; + } +} diff --git a/contracts/src/v0.8/ccip/ocr/OCR2Abstract.sol b/contracts/src/v0.8/ccip/ocr/OCR2Abstract.sol new file mode 100644 index 00000000000..741433bd5ad --- /dev/null +++ b/contracts/src/v0.8/ccip/ocr/OCR2Abstract.sol @@ -0,0 +1,122 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.0; + +import {ITypeAndVersion} from "../../shared/interfaces/ITypeAndVersion.sol"; + +abstract contract OCR2Abstract is ITypeAndVersion { + // Maximum number of oracles the offchain reporting protocol is designed for + uint256 internal constant MAX_NUM_ORACLES = 31; + + /// @notice triggers a new run of the offchain reporting protocol + /// @param previousConfigBlockNumber block in which the previous config was set, to simplify historic analysis + /// @param configDigest configDigest of this configuration + /// @param configCount ordinal number of this config setting among all config settings over the life of this contract + /// @param signers ith element is address ith oracle uses to sign a report + /// @param transmitters ith element is address ith oracle uses to transmit a report via the transmit method + /// @param f maximum number of faulty/dishonest oracles the protocol can tolerate while still working correctly + /// @param onchainConfig serialized configuration used by the contract (and possibly oracles) + /// @param offchainConfigVersion version of the serialization format used for "offchainConfig" parameter + /// @param offchainConfig serialized configuration used by the oracles exclusively and only passed through the contract + event ConfigSet( + uint32 previousConfigBlockNumber, + bytes32 configDigest, + uint64 configCount, + address[] signers, + address[] transmitters, + uint8 f, + bytes onchainConfig, + uint64 offchainConfigVersion, + bytes offchainConfig + ); + + /// @notice sets offchain reporting protocol configuration incl. participating oracles + /// @param signers addresses with which oracles sign the reports + /// @param transmitters addresses oracles use to transmit the reports + /// @param f number of faulty oracles the system can tolerate + /// @param onchainConfig serialized configuration used by the contract (and possibly oracles) + /// @param offchainConfigVersion version number for offchainEncoding schema + /// @param offchainConfig serialized configuration used by the oracles exclusively and only passed through the contract + function setOCR2Config( + address[] memory signers, + address[] memory transmitters, + uint8 f, + bytes memory onchainConfig, + uint64 offchainConfigVersion, + bytes memory offchainConfig + ) external virtual; + + /// @notice information about current offchain reporting protocol configuration + /// @return configCount ordinal number of current config, out of all configs applied to this contract so far + /// @return blockNumber block at which this config was set + /// @return configDigest domain-separation tag for current config (see _configDigestFromConfigData) + function latestConfigDetails() + external + view + virtual + returns (uint32 configCount, uint32 blockNumber, bytes32 configDigest); + + function _configDigestFromConfigData( + uint256 chainId, + address contractAddress, + uint64 configCount, + address[] memory signers, + address[] memory transmitters, + uint8 f, + bytes memory onchainConfig, + uint64 offchainConfigVersion, + bytes memory offchainConfig + ) internal pure returns (bytes32) { + uint256 h = uint256( + keccak256( + abi.encode( + chainId, + contractAddress, + configCount, + signers, + transmitters, + f, + onchainConfig, + offchainConfigVersion, + offchainConfig + ) + ) + ); + uint256 prefixMask = type(uint256).max << (256 - 16); // 0xFFFF00..00 + uint256 prefix = 0x0001 << (256 - 16); // 0x000100..00 + return bytes32((prefix & prefixMask) | (h & ~prefixMask)); + } + + /// @notice optionally emitted to indicate the latest configDigest and epoch for + /// which a report was successfully transmitted. Alternatively, the contract may + /// use latestConfigDigestAndEpoch with scanLogs set to false. + event Transmitted(bytes32 configDigest, uint32 epoch); + + /// @notice optionally returns the latest configDigest and epoch for which a + /// report was successfully transmitted. Alternatively, the contract may return + /// scanLogs set to true and use Transmitted events to provide this information + /// to offchain watchers. + /// @return scanLogs indicates whether to rely on the configDigest and epoch + /// returned or whether to scan logs for the Transmitted event instead. + /// @return configDigest + /// @return epoch + function latestConfigDigestAndEpoch() + external + view + virtual + returns (bool scanLogs, bytes32 configDigest, uint32 epoch); + + /// @notice transmit is called to post a new report to the contract + /// @param report serialized report, which the signatures are signing. + /// @param rs ith element is the R components of the ith signature on report. Must have at most MAX_NUM_ORACLES entries + /// @param ss ith element is the S components of the ith signature on report. Must have at most MAX_NUM_ORACLES entries + /// @param rawVs ith element is the the V component of the ith signature + function transmit( + // NOTE: If these parameters are changed, expectedMsgDataLength and/or + // TRANSMIT_MSGDATA_CONSTANT_LENGTH_COMPONENT need to be changed accordingly + bytes32[3] calldata reportContext, + bytes calldata report, + bytes32[] calldata rs, + bytes32[] calldata ss, + bytes32 rawVs // signatures + ) external virtual; +} diff --git a/contracts/src/v0.8/ccip/ocr/OCR2Base.sol b/contracts/src/v0.8/ccip/ocr/OCR2Base.sol new file mode 100644 index 00000000000..52a6df2f3a2 --- /dev/null +++ b/contracts/src/v0.8/ccip/ocr/OCR2Base.sol @@ -0,0 +1,291 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.0; + +import {OwnerIsCreator} from "../../shared/access/OwnerIsCreator.sol"; +import {OCR2Abstract} from "./OCR2Abstract.sol"; + +/// @notice Onchain verification of reports from the offchain reporting protocol +/// @dev For details on its operation, see the offchain reporting protocol design +/// doc, which refers to this contract as simply the "contract". +abstract contract OCR2Base is OwnerIsCreator, OCR2Abstract { + error InvalidConfig(InvalidConfigErrorType errorType); + error WrongMessageLength(uint256 expected, uint256 actual); + error ConfigDigestMismatch(bytes32 expected, bytes32 actual); + error ForkedChain(uint256 expected, uint256 actual); + error WrongNumberOfSignatures(); + error SignaturesOutOfRegistration(); + error UnauthorizedTransmitter(); + error UnauthorizedSigner(); + error NonUniqueSignatures(); + error OracleCannotBeZeroAddress(); + + enum InvalidConfigErrorType { + F_MUST_BE_POSITIVE, + TOO_MANY_SIGNERS, + F_TOO_HIGH, + REPEATED_ORACLE_ADDRESS, + NUM_SIGNERS_NOT_NUM_TRANSMITTERS + } + + // Packing these fields used on the hot path in a ConfigInfo variable reduces the + // retrieval of all of them to a minimum number of SLOADs. + struct ConfigInfo { + bytes32 latestConfigDigest; + uint8 f; + uint8 n; + } + + // Used for s_oracles[a].role, where a is an address, to track the purpose + // of the address, or to indicate that the address is unset. + enum Role { + // No oracle role has been set for address a + Unset, + // Signing address for the s_oracles[a].index'th oracle. I.e., report + // signatures from this oracle should ecrecover back to address a. + Signer, + // Transmission address for the s_oracles[a].index'th oracle. I.e., if a + // report is received by OCR2Aggregator.transmit in which msg.sender is + // a, it is attributed to the s_oracles[a].index'th oracle. + Transmitter + } + + struct Oracle { + uint8 index; // Index of oracle in s_signers/s_transmitters + Role role; // Role of the address which mapped to this struct + } + + // The current config + ConfigInfo internal s_configInfo; + + // incremented each time a new config is posted. This count is incorporated + // into the config digest, to prevent replay attacks. + uint32 internal s_configCount; + // makes it easier for offchain systems to extract config from logs. + uint32 internal s_latestConfigBlockNumber; + + // signer OR transmitter address + mapping(address signerOrTransmitter => Oracle oracle) internal s_oracles; + + // s_signers contains the signing address of each oracle + address[] internal s_signers; + + // s_transmitters contains the transmission address of each oracle, + // i.e. the address the oracle actually sends transactions to the contract from + address[] internal s_transmitters; + + // The constant-length components of the msg.data sent to transmit. + // See the "If we wanted to call sam" example on for example reasoning + // https://solidity.readthedocs.io/en/v0.7.2/abi-spec.html + uint16 private constant TRANSMIT_MSGDATA_CONSTANT_LENGTH_COMPONENT = 4 // function selector + + 32 * 3 // 3 words containing reportContext + + 32 // word containing start location of abiencoded report value + + 32 // word containing location start of abiencoded rs value + + 32 // word containing start location of abiencoded ss value + + 32 // rawVs value + + 32 // word containing length of report + + 32 // word containing length rs + + 32; // word containing length of ss + + bool internal immutable i_uniqueReports; + uint256 internal immutable i_chainID; + + constructor(bool uniqueReports) { + i_uniqueReports = uniqueReports; + i_chainID = block.chainid; + } + + // Reverts transaction if config args are invalid + modifier checkConfigValid(uint256 numSigners, uint256 numTransmitters, uint256 f) { + if (numSigners > MAX_NUM_ORACLES) revert InvalidConfig(InvalidConfigErrorType.TOO_MANY_SIGNERS); + if (f == 0) revert InvalidConfig(InvalidConfigErrorType.F_MUST_BE_POSITIVE); + if (numSigners != numTransmitters) revert InvalidConfig(InvalidConfigErrorType.NUM_SIGNERS_NOT_NUM_TRANSMITTERS); + if (numSigners <= 3 * f) revert InvalidConfig(InvalidConfigErrorType.F_TOO_HIGH); + _; + } + + /// @notice sets offchain reporting protocol configuration incl. participating oracles + /// @param signers addresses with which oracles sign the reports + /// @param transmitters addresses oracles use to transmit the reports + /// @param f number of faulty oracles the system can tolerate + /// @param onchainConfig encoded on-chain contract configuration + /// @param offchainConfigVersion version number for offchainEncoding schema + /// @param offchainConfig encoded off-chain oracle configuration + function setOCR2Config( + address[] memory signers, + address[] memory transmitters, + uint8 f, + bytes memory onchainConfig, + uint64 offchainConfigVersion, + bytes memory offchainConfig + ) external override checkConfigValid(signers.length, transmitters.length, f) onlyOwner { + _beforeSetConfig(onchainConfig); + uint256 oldSignerLength = s_signers.length; + for (uint256 i = 0; i < oldSignerLength; ++i) { + delete s_oracles[s_signers[i]]; + delete s_oracles[s_transmitters[i]]; + } + + uint256 newSignersLength = signers.length; + for (uint256 i = 0; i < newSignersLength; ++i) { + // add new signer/transmitter addresses + address signer = signers[i]; + if (s_oracles[signer].role != Role.Unset) revert InvalidConfig(InvalidConfigErrorType.REPEATED_ORACLE_ADDRESS); + if (signer == address(0)) revert OracleCannotBeZeroAddress(); + s_oracles[signer] = Oracle(uint8(i), Role.Signer); + + address transmitter = transmitters[i]; + if (s_oracles[transmitter].role != Role.Unset) { + revert InvalidConfig(InvalidConfigErrorType.REPEATED_ORACLE_ADDRESS); + } + if (transmitter == address(0)) revert OracleCannotBeZeroAddress(); + s_oracles[transmitter] = Oracle(uint8(i), Role.Transmitter); + } + + s_signers = signers; + s_transmitters = transmitters; + + s_configInfo.f = f; + s_configInfo.n = uint8(newSignersLength); + s_configInfo.latestConfigDigest = _configDigestFromConfigData( + block.chainid, + address(this), + ++s_configCount, + signers, + transmitters, + f, + onchainConfig, + offchainConfigVersion, + offchainConfig + ); + + uint32 previousConfigBlockNumber = s_latestConfigBlockNumber; + s_latestConfigBlockNumber = uint32(block.number); + + emit ConfigSet( + previousConfigBlockNumber, + s_configInfo.latestConfigDigest, + s_configCount, + signers, + transmitters, + f, + onchainConfig, + offchainConfigVersion, + offchainConfig + ); + } + + /// @dev Hook that is run from setOCR2Config() right after validating configuration. + /// Empty by default, please provide an implementation in a child contract if you need additional configuration processing + function _beforeSetConfig(bytes memory _onchainConfig) internal virtual; + + /// @return list of addresses permitted to transmit reports to this contract + /// @dev The list will match the order used to specify the transmitter during setConfig + function getTransmitters() external view returns (address[] memory) { + return s_transmitters; + } + + /// @notice transmit is called to post a new report to the contract + /// @param report serialized report, which the signatures are signing. + /// @param rs ith element is the R components of the ith signature on report. Must have at most MAX_NUM_ORACLES entries + /// @param ss ith element is the S components of the ith signature on report. Must have at most MAX_NUM_ORACLES entries + /// @param rawVs ith element is the the V component of the ith signature + function transmit( + // NOTE: If these parameters are changed, expectedMsgDataLength and/or + // TRANSMIT_MSGDATA_CONSTANT_LENGTH_COMPONENT need to be changed accordingly + bytes32[3] calldata reportContext, + bytes calldata report, + bytes32[] calldata rs, + bytes32[] calldata ss, + bytes32 rawVs // signatures + ) external override { + // Scoping this reduces stack pressure and gas usage + { + // report and epochAndRound + _report(report, uint40(uint256(reportContext[1]))); + } + + // reportContext consists of: + // reportContext[0]: ConfigDigest + // reportContext[1]: 27 byte padding, 4-byte epoch and 1-byte round + // reportContext[2]: ExtraHash + bytes32 configDigest = reportContext[0]; + ConfigInfo memory configInfo = s_configInfo; + + if (configInfo.latestConfigDigest != configDigest) { + revert ConfigDigestMismatch(configInfo.latestConfigDigest, configDigest); + } + // If the cached chainID at time of deployment doesn't match the current chainID, we reject all signed reports. + // This avoids a (rare) scenario where chain A forks into chain A and A', A' still has configDigest + // calculated from chain A and so OCR reports will be valid on both forks. + if (i_chainID != block.chainid) revert ForkedChain(i_chainID, block.chainid); + + emit Transmitted(configDigest, uint32(uint256(reportContext[1]) >> 8)); + + uint256 expectedNumSignatures; + if (i_uniqueReports) { + expectedNumSignatures = (configInfo.n + configInfo.f) / 2 + 1; + } else { + expectedNumSignatures = configInfo.f + 1; + } + if (rs.length != expectedNumSignatures) revert WrongNumberOfSignatures(); + if (rs.length != ss.length) revert SignaturesOutOfRegistration(); + + // Scoping this reduces stack pressure and gas usage + { + Oracle memory transmitter = s_oracles[msg.sender]; + // Check that sender is authorized to report + if (!(transmitter.role == Role.Transmitter && msg.sender == s_transmitters[transmitter.index])) { + revert UnauthorizedTransmitter(); + } + } + // Scoping this reduces stack pressure and gas usage + { + uint256 expectedDataLength = uint256(TRANSMIT_MSGDATA_CONSTANT_LENGTH_COMPONENT) + report.length // one byte pure entry in _report + + rs.length * 32 // 32 bytes per entry in _rs + + ss.length * 32; // 32 bytes per entry in _ss) + if (msg.data.length != expectedDataLength) revert WrongMessageLength(expectedDataLength, msg.data.length); + } + + // Verify signatures attached to report + bytes32 h = keccak256(abi.encodePacked(keccak256(report), reportContext)); + bool[MAX_NUM_ORACLES] memory signed; + + uint256 numberOfSignatures = rs.length; + for (uint256 i = 0; i < numberOfSignatures; ++i) { + // Safe from ECDSA malleability here since we check for duplicate signers. + address signer = ecrecover(h, uint8(rawVs[i]) + 27, rs[i], ss[i]); + // Since we disallow address(0) as a valid signer address, it can + // never have a signer role. + Oracle memory oracle = s_oracles[signer]; + if (oracle.role != Role.Signer) revert UnauthorizedSigner(); + if (signed[oracle.index]) revert NonUniqueSignatures(); + signed[oracle.index] = true; + } + } + + /// @notice information about current offchain reporting protocol configuration + /// @return configCount ordinal number of current config, out of all configs applied to this contract so far + /// @return blockNumber block at which this config was set + /// @return configDigest domain-separation tag for current config (see _configDigestFromConfigData) + function latestConfigDetails() + external + view + override + returns (uint32 configCount, uint32 blockNumber, bytes32 configDigest) + { + return (s_configCount, s_latestConfigBlockNumber, s_configInfo.latestConfigDigest); + } + + /// @inheritdoc OCR2Abstract + function latestConfigDigestAndEpoch() + external + view + virtual + override + returns (bool scanLogs, bytes32 configDigest, uint32 epoch) + { + return (true, bytes32(0), uint32(0)); + } + + function _report(bytes calldata report, uint40 epochAndRound) internal virtual; +} diff --git a/contracts/src/v0.8/ccip/ocr/OCR2BaseNoChecks.sol b/contracts/src/v0.8/ccip/ocr/OCR2BaseNoChecks.sol new file mode 100644 index 00000000000..a79df8d589a --- /dev/null +++ b/contracts/src/v0.8/ccip/ocr/OCR2BaseNoChecks.sol @@ -0,0 +1,242 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.0; + +import {OwnerIsCreator} from "../../shared/access/OwnerIsCreator.sol"; +import {OCR2Abstract} from "./OCR2Abstract.sol"; + +/// @notice Onchain verification of reports from the offchain reporting protocol +/// @dev For details on its operation, see the offchain reporting protocol design +/// doc, which refers to this contract as simply the "contract". +/// @dev This contract does ***NOT*** check the supplied signatures on `transmit` +/// This is intentional. +abstract contract OCR2BaseNoChecks is OwnerIsCreator, OCR2Abstract { + error InvalidConfig(InvalidConfigErrorType errorType); + error WrongMessageLength(uint256 expected, uint256 actual); + error ConfigDigestMismatch(bytes32 expected, bytes32 actual); + error ForkedChain(uint256 expected, uint256 actual); + error UnauthorizedTransmitter(); + error OracleCannotBeZeroAddress(); + + enum InvalidConfigErrorType { + F_MUST_BE_POSITIVE, + TOO_MANY_TRANSMITTERS, + REPEATED_ORACLE_ADDRESS + } + + // Packing these fields used on the hot path in a ConfigInfo variable reduces the + // retrieval of all of them to a minimum number of SLOADs. + struct ConfigInfo { + bytes32 latestConfigDigest; + uint8 f; + uint8 n; + } + + // Used for s_oracles[a].role, where a is an address, to track the purpose + // of the address, or to indicate that the address is unset. + enum Role { + // No oracle role has been set for address a + Unset, + // Unused + Signer, + // Transmission address for the s_oracles[a].index'th oracle. I.e., if a + // report is received by OCR2Aggregator.transmit in which msg.sender is + // a, it is attributed to the s_oracles[a].index'th oracle. + Transmitter + } + + struct Oracle { + uint8 index; // Index of oracle in s_transmitters + Role role; // Role of the address which mapped to this struct + } + + // The current config + ConfigInfo internal s_configInfo; + + // incremented each time a new config is posted. This count is incorporated + // into the config digest, to prevent replay attacks. + uint32 internal s_configCount; + // makes it easier for offchain systems to extract config from logs. + uint32 internal s_latestConfigBlockNumber; + + // Transmitter address + mapping(address transmitter => Oracle oracle) internal s_oracles; + + // s_transmitters contains the transmission address of each oracle, + // i.e. the address the oracle actually sends transactions to the contract from + address[] internal s_transmitters; + + // The constant-length components of the msg.data sent to transmit. + // See the "If we wanted to call sam" example on for example reasoning + // https://solidity.readthedocs.io/en/v0.7.2/abi-spec.html + uint16 private constant TRANSMIT_MSGDATA_CONSTANT_LENGTH_COMPONENT = 4 // function selector + + 32 * 3 // 3 words containing reportContext + + 32 // word containing start location of abiencoded report value + + 32 // word containing location start of abiencoded rs value + + 32 // word containing start location of abiencoded ss value + + 32 // rawVs value + + 32 // word containing length of report + + 32 // word containing length rs + + 32; // word containing length of ss + + uint256 internal immutable i_chainID; + + // Reverts transaction if config args are invalid + modifier checkConfigValid(uint256 numTransmitters, uint256 f) { + if (numTransmitters > MAX_NUM_ORACLES) revert InvalidConfig(InvalidConfigErrorType.TOO_MANY_TRANSMITTERS); + if (f == 0) revert InvalidConfig(InvalidConfigErrorType.F_MUST_BE_POSITIVE); + _; + } + + constructor() { + i_chainID = block.chainid; + } + + /// @notice sets offchain reporting protocol configuration incl. participating oracles + /// @param signers addresses with which oracles sign the reports + /// @param transmitters addresses oracles use to transmit the reports + /// @param f number of faulty oracles the system can tolerate + /// @param onchainConfig encoded on-chain contract configuration + /// @param offchainConfigVersion version number for offchainEncoding schema + /// @param offchainConfig encoded off-chain oracle configuration + function setOCR2Config( + address[] memory signers, + address[] memory transmitters, + uint8 f, + bytes memory onchainConfig, + uint64 offchainConfigVersion, + bytes memory offchainConfig + ) external override checkConfigValid(transmitters.length, f) onlyOwner { + _beforeSetConfig(onchainConfig); + // Scoped to reduce contract size + { + uint256 oldTransmitterLength = s_transmitters.length; + for (uint256 i = 0; i < oldTransmitterLength; ++i) { + delete s_oracles[s_transmitters[i]]; + } + } + uint256 newTransmitterLength = transmitters.length; + for (uint256 i = 0; i < newTransmitterLength; ++i) { + address transmitter = transmitters[i]; + if (s_oracles[transmitter].role != Role.Unset) { + revert InvalidConfig(InvalidConfigErrorType.REPEATED_ORACLE_ADDRESS); + } + if (transmitter == address(0)) revert OracleCannotBeZeroAddress(); + s_oracles[transmitter] = Oracle(uint8(i), Role.Transmitter); + } + + s_transmitters = transmitters; + + s_configInfo.f = f; + s_configInfo.n = uint8(newTransmitterLength); + s_configInfo.latestConfigDigest = _configDigestFromConfigData( + block.chainid, + address(this), + ++s_configCount, + signers, + transmitters, + f, + onchainConfig, + offchainConfigVersion, + offchainConfig + ); + + uint32 previousConfigBlockNumber = s_latestConfigBlockNumber; + s_latestConfigBlockNumber = uint32(block.number); + + emit ConfigSet( + previousConfigBlockNumber, + s_configInfo.latestConfigDigest, + s_configCount, + signers, + transmitters, + f, + onchainConfig, + offchainConfigVersion, + offchainConfig + ); + } + + /// @dev Hook that is run from setOCR2Config() right after validating configuration. + /// Empty by default, please provide an implementation in a child contract if you need additional configuration processing + function _beforeSetConfig(bytes memory _onchainConfig) internal virtual; + + /// @return list of addresses permitted to transmit reports to this contract + /// @dev The list will match the order used to specify the transmitter during setConfig + function getTransmitters() external view returns (address[] memory) { + return s_transmitters; + } + + /// @notice transmit is called to post a new report to the contract + /// @param report serialized report, which the signatures are signing. + /// @param rs ith element is the R components of the ith signature on report. Must have at most MAX_NUM_ORACLES entries + /// @param ss ith element is the S components of the ith signature on report. Must have at most MAX_NUM_ORACLES entries + function transmit( + // NOTE: If these parameters are changed, expectedMsgDataLength and/or + // TRANSMIT_MSGDATA_CONSTANT_LENGTH_COMPONENT need to be changed accordingly + bytes32[3] calldata reportContext, + bytes calldata report, + bytes32[] calldata rs, + bytes32[] calldata ss, + bytes32 // signatures + ) external override { + _report(report); + + // reportContext consists of: + // reportContext[0]: ConfigDigest + // reportContext[1]: 27 byte padding, 4-byte epoch and 1-byte round + // reportContext[2]: ExtraHash + bytes32 configDigest = reportContext[0]; + bytes32 latestConfigDigest = s_configInfo.latestConfigDigest; + if (latestConfigDigest != configDigest) revert ConfigDigestMismatch(latestConfigDigest, configDigest); + _checkChainForked(); + + emit Transmitted(configDigest, uint32(uint256(reportContext[1]) >> 8)); + + // Scoping this reduces stack pressure and gas usage + { + Oracle memory transmitter = s_oracles[msg.sender]; + // Check that sender is authorized to report + if (!(transmitter.role == Role.Transmitter && msg.sender == s_transmitters[transmitter.index])) { + revert UnauthorizedTransmitter(); + } + } + + uint256 expectedDataLength = uint256(TRANSMIT_MSGDATA_CONSTANT_LENGTH_COMPONENT) + report.length // one byte pure entry in _report + + rs.length * 32 // 32 bytes per entry in _rs + + ss.length * 32; // 32 bytes per entry in _ss) + if (msg.data.length != expectedDataLength) revert WrongMessageLength(expectedDataLength, msg.data.length); + } + + function _checkChainForked() internal view { + // If the cached chainID at time of deployment doesn't match the current chainID, we reject all signed reports. + // This avoids a (rare) scenario where chain A forks into chain A and A', A' still has configDigest + // calculated from chain A and so OCR reports will be valid on both forks. + if (i_chainID != block.chainid) revert ForkedChain(i_chainID, block.chainid); + } + + /// @notice information about current offchain reporting protocol configuration + /// @return configCount ordinal number of current config, out of all configs applied to this contract so far + /// @return blockNumber block at which this config was set + /// @return configDigest domain-separation tag for current config (see _configDigestFromConfigData) + function latestConfigDetails() + external + view + override + returns (uint32 configCount, uint32 blockNumber, bytes32 configDigest) + { + return (s_configCount, s_latestConfigBlockNumber, s_configInfo.latestConfigDigest); + } + + /// @inheritdoc OCR2Abstract + function latestConfigDigestAndEpoch() + external + view + virtual + override + returns (bool scanLogs, bytes32 configDigest, uint32 epoch) + { + return (true, bytes32(0), uint32(0)); + } + + function _report(bytes calldata report) internal virtual; +} diff --git a/contracts/src/v0.8/ccip/offRamp/EVM2EVMOffRamp.sol b/contracts/src/v0.8/ccip/offRamp/EVM2EVMOffRamp.sol new file mode 100644 index 00000000000..0be7fe75119 --- /dev/null +++ b/contracts/src/v0.8/ccip/offRamp/EVM2EVMOffRamp.sol @@ -0,0 +1,796 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {ITypeAndVersion} from "../../shared/interfaces/ITypeAndVersion.sol"; +import {IAny2EVMMessageReceiver} from "../interfaces/IAny2EVMMessageReceiver.sol"; +import {IAny2EVMOffRamp} from "../interfaces/IAny2EVMOffRamp.sol"; +import {ICommitStore} from "../interfaces/ICommitStore.sol"; +import {IPoolV1} from "../interfaces/IPool.sol"; +import {IPriceRegistry} from "../interfaces/IPriceRegistry.sol"; +import {IRMN} from "../interfaces/IRMN.sol"; +import {IRouter} from "../interfaces/IRouter.sol"; +import {ITokenAdminRegistry} from "../interfaces/ITokenAdminRegistry.sol"; + +import {CallWithExactGas} from "../../shared/call/CallWithExactGas.sol"; +import {EnumerableMapAddresses} from "../../shared/enumerable/EnumerableMapAddresses.sol"; +import {AggregateRateLimiter} from "../AggregateRateLimiter.sol"; +import {Client} from "../libraries/Client.sol"; +import {Internal} from "../libraries/Internal.sol"; +import {Pool} from "../libraries/Pool.sol"; +import {RateLimiter} from "../libraries/RateLimiter.sol"; +import {OCR2BaseNoChecks} from "../ocr/OCR2BaseNoChecks.sol"; + +import {IERC20} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/IERC20.sol"; +import {ERC165Checker} from "../../vendor/openzeppelin-solidity/v5.0.2/contracts/utils/introspection/ERC165Checker.sol"; + +/// @notice EVM2EVMOffRamp enables OCR networks to execute multiple messages +/// in an OffRamp in a single transaction. +/// @dev The EVM2EVMOnRamp, CommitStore and EVM2EVMOffRamp form an xchain upgradeable unit. Any change to one of them +/// results an onchain upgrade of all 3. +/// @dev OCR2BaseNoChecks is used to save gas, signatures are not required as the offramp can only execute +/// messages which are committed in the commitStore. We still make use of OCR2 as an executor whitelist +/// and turn-taking mechanism. +contract EVM2EVMOffRamp is IAny2EVMOffRamp, AggregateRateLimiter, ITypeAndVersion, OCR2BaseNoChecks { + using ERC165Checker for address; + using EnumerableMapAddresses for EnumerableMapAddresses.AddressToAddressMap; + + error ZeroAddressNotAllowed(); + error CommitStoreAlreadyInUse(); + error ExecutionError(bytes err); + error InvalidSourceChain(uint64 sourceChainSelector); + error MessageTooLarge(uint256 maxSize, uint256 actualSize); + error TokenDataMismatch(uint64 sequenceNumber); + error UnexpectedTokenData(); + error UnsupportedNumberOfTokens(uint64 sequenceNumber); + error ManualExecutionNotYetEnabled(); + error ManualExecutionGasLimitMismatch(); + error DestinationGasAmountCountMismatch(bytes32 messageId, uint64 sequenceNumber); + error InvalidManualExecutionGasLimit(bytes32 messageId, uint256 oldLimit, uint256 newLimit); + error InvalidTokenGasOverride(bytes32 messageId, uint256 tokenIndex, uint256 oldLimit, uint256 tokenGasOverride); + error RootNotCommitted(); + error CanOnlySelfCall(); + error ReceiverError(bytes err); + error TokenHandlingError(bytes err); + error ReleaseOrMintBalanceMismatch(uint256 amountReleased, uint256 balancePre, uint256 balancePost); + error EmptyReport(); + error CursedByRMN(); + error InvalidMessageId(); + error NotACompatiblePool(address notPool); + error InvalidDataLength(uint256 expected, uint256 got); + error InvalidNewState(uint64 sequenceNumber, Internal.MessageExecutionState newState); + + /// @dev Atlas depends on this event, if changing, please notify Atlas. + event ConfigSet(StaticConfig staticConfig, DynamicConfig dynamicConfig); + event SkippedIncorrectNonce(uint64 indexed nonce, address indexed sender); + event SkippedSenderWithPreviousRampMessageInflight(uint64 indexed nonce, address indexed sender); + /// @dev RMN depends on this event, if changing, please notify the RMN maintainers. + event ExecutionStateChanged( + uint64 indexed sequenceNumber, bytes32 indexed messageId, Internal.MessageExecutionState state, bytes returnData + ); + event TokenAggregateRateLimitAdded(address sourceToken, address destToken); + event TokenAggregateRateLimitRemoved(address sourceToken, address destToken); + event SkippedAlreadyExecutedMessage(uint64 indexed sequenceNumber); + event AlreadyAttempted(uint64 sequenceNumber); + + /// @notice Static offRamp config + /// @dev RMN depends on this struct, if changing, please notify the RMN maintainers. + //solhint-disable gas-struct-packing + struct StaticConfig { + address commitStore; // ────────╮ CommitStore address on the destination chain + uint64 chainSelector; // ───────╯ Destination chainSelector + uint64 sourceChainSelector; // ─╮ Source chainSelector + address onRamp; // ─────────────╯ OnRamp address on the source chain + address prevOffRamp; // Address of previous-version OffRamp + address rmnProxy; // RMN proxy address + address tokenAdminRegistry; // Token admin registry address + } + + /// @notice Dynamic offRamp config + /// @dev since OffRampConfig is part of OffRampConfigChanged event, if changing it, we should update the ABI on Atlas + struct DynamicConfig { + uint32 permissionLessExecutionThresholdSeconds; // ─╮ Waiting time before manual execution is enabled + uint32 maxDataBytes; // │ Maximum payload data size in bytes + uint16 maxNumberOfTokensPerMsg; // │ Maximum number of ERC20 token transfers that can be included per message + address router; // ─────────────────────────────────╯ Router address + address priceRegistry; // Price registry address + } + + /// @notice RateLimitToken struct containing both the source and destination token addresses + struct RateLimitToken { + address sourceToken; + address destToken; + } + + /// @notice Gas overrides for manual exec, the number of token overrides must match the number of tokens in the msg. + struct GasLimitOverride { + /// @notice Overrides EVM2EVMMessage.gasLimit. A value of zero indicates no override and is valid. + uint256 receiverExecutionGasLimit; + /// @notice Overrides EVM2EVMMessage.sourceTokenData.destGasAmount. Must be same length as tokenAmounts. A value + /// of zero indicates no override and is valid. + uint32[] tokenGasOverrides; + } + + // STATIC CONFIG + string public constant override typeAndVersion = "EVM2EVMOffRamp 1.5.0"; + + /// @dev Commit store address on the destination chain + address internal immutable i_commitStore; + /// @dev ChainSelector of the source chain + uint64 internal immutable i_sourceChainSelector; + /// @dev ChainSelector of this chain + uint64 internal immutable i_chainSelector; + /// @dev OnRamp address on the source chain + address internal immutable i_onRamp; + /// @dev metadataHash is a lane-specific prefix for a message hash preimage which ensures global uniqueness. + /// Ensures that 2 identical messages sent to 2 different lanes will have a distinct hash. + /// Must match the metadataHash used in computing leaf hashes offchain for the root committed in + /// the commitStore and i_metadataHash in the onRamp. + bytes32 internal immutable i_metadataHash; + /// @dev The address of previous-version OffRamp for this lane. + /// Used to be able to provide sequencing continuity during a zero downtime upgrade. + address internal immutable i_prevOffRamp; + /// @dev The address of the RMN proxy + address internal immutable i_rmnProxy; + /// @dev The address of the token admin registry + address internal immutable i_tokenAdminRegistry; + + // DYNAMIC CONFIG + DynamicConfig internal s_dynamicConfig; + /// @dev Tokens that should be included in Aggregate Rate Limiting + /// An (address => address) map is used for backwards compatability of offchain code + EnumerableMapAddresses.AddressToAddressMap internal s_rateLimitedTokensDestToSource; + + // STATE + /// @dev The expected nonce for a given sender. + /// Corresponds to s_senderNonce in the OnRamp, used to enforce that messages are + /// executed in the same order they are sent (assuming they are DON). Note that re-execution + /// of FAILED messages however, can be out of order. + mapping(address sender => uint64 nonce) internal s_senderNonce; + /// @dev A mapping of sequence numbers to execution state using a bitmap with each execution + /// state only taking up 2 bits of the uint256, packing 128 states into a single slot. + /// Message state is tracked to ensure message can only be executed successfully once. + mapping(uint64 seqNum => uint256 executionStateBitmap) internal s_executionStates; + + constructor( + StaticConfig memory staticConfig, + RateLimiter.Config memory rateLimiterConfig + ) OCR2BaseNoChecks() AggregateRateLimiter(rateLimiterConfig) { + if ( + staticConfig.onRamp == address(0) || staticConfig.commitStore == address(0) + || staticConfig.tokenAdminRegistry == address(0) + ) revert ZeroAddressNotAllowed(); + // Ensures we can never deploy a new offRamp that points to a commitStore that + // already has roots committed. + if (ICommitStore(staticConfig.commitStore).getExpectedNextSequenceNumber() != 1) revert CommitStoreAlreadyInUse(); + + i_commitStore = staticConfig.commitStore; + i_sourceChainSelector = staticConfig.sourceChainSelector; + i_chainSelector = staticConfig.chainSelector; + i_onRamp = staticConfig.onRamp; + i_prevOffRamp = staticConfig.prevOffRamp; + i_rmnProxy = staticConfig.rmnProxy; + i_tokenAdminRegistry = staticConfig.tokenAdminRegistry; + + i_metadataHash = _metadataHash(Internal.EVM_2_EVM_MESSAGE_HASH); + } + + // ================================================================ + // │ Messaging │ + // ================================================================ + + // The size of the execution state in bits + uint256 private constant MESSAGE_EXECUTION_STATE_BIT_WIDTH = 2; + // The mask for the execution state bits + uint256 private constant MESSAGE_EXECUTION_STATE_MASK = (1 << MESSAGE_EXECUTION_STATE_BIT_WIDTH) - 1; + + /// @notice Returns the current execution state of a message based on its sequenceNumber. + /// @param sequenceNumber The sequence number of the message to get the execution state for. + /// @return The current execution state of the message. + /// @dev we use the literal number 128 because using a constant increased gas usage. + function getExecutionState(uint64 sequenceNumber) public view returns (Internal.MessageExecutionState) { + return Internal.MessageExecutionState( + (s_executionStates[sequenceNumber / 128] >> ((sequenceNumber % 128) * MESSAGE_EXECUTION_STATE_BIT_WIDTH)) + & MESSAGE_EXECUTION_STATE_MASK + ); + } + + /// @notice Sets a new execution state for a given sequence number. It will overwrite any existing state. + /// @param sequenceNumber The sequence number for which the state will be saved. + /// @param newState The new value the state will be in after this function is called. + /// @dev we use the literal number 128 because using a constant increased gas usage. + function _setExecutionState(uint64 sequenceNumber, Internal.MessageExecutionState newState) internal { + uint256 offset = (sequenceNumber % 128) * MESSAGE_EXECUTION_STATE_BIT_WIDTH; + uint256 bitmap = s_executionStates[sequenceNumber / 128]; + // to unset any potential existing state we zero the bits of the section the state occupies, + // then we do an AND operation to blank out any existing state for the section. + bitmap &= ~(MESSAGE_EXECUTION_STATE_MASK << offset); + // Set the new state + bitmap |= uint256(newState) << offset; + + s_executionStates[sequenceNumber / 128] = bitmap; + } + + /// @inheritdoc IAny2EVMOffRamp + function getSenderNonce(address sender) external view returns (uint64 nonce) { + uint256 senderNonce = s_senderNonce[sender]; + + if (senderNonce == 0) { + if (i_prevOffRamp != address(0)) { + // If OffRamp was upgraded, check if sender has a nonce from the previous OffRamp. + return IAny2EVMOffRamp(i_prevOffRamp).getSenderNonce(sender); + } + } + return uint64(senderNonce); + } + + /// @notice Manually execute a message. + /// @param report Internal.ExecutionReport. + /// @param gasLimitOverrides New gasLimit for each message in the report. + /// @dev We permit gas limit overrides so that users may manually execute messages which failed due to + /// insufficient gas provided. + function manuallyExecute( + Internal.ExecutionReport memory report, + GasLimitOverride[] memory gasLimitOverrides + ) external { + // We do this here because the other _execute path is already covered OCR2BaseXXX. + _checkChainForked(); + + uint256 numMsgs = report.messages.length; + if (numMsgs != gasLimitOverrides.length) revert ManualExecutionGasLimitMismatch(); + for (uint256 i = 0; i < numMsgs; ++i) { + Internal.EVM2EVMMessage memory message = report.messages[i]; + GasLimitOverride memory gasLimitOverride = gasLimitOverrides[i]; + + uint256 newLimit = gasLimitOverride.receiverExecutionGasLimit; + // Checks to ensure message cannot be executed with less gas than specified. + if (newLimit != 0) { + if (newLimit < message.gasLimit) { + revert InvalidManualExecutionGasLimit(message.messageId, message.gasLimit, newLimit); + } + } + + if (message.tokenAmounts.length != gasLimitOverride.tokenGasOverrides.length) { + revert DestinationGasAmountCountMismatch(message.messageId, message.sequenceNumber); + } + + bytes[] memory encodedSourceTokenData = message.sourceTokenData; + + for (uint256 j = 0; j < message.tokenAmounts.length; ++j) { + Internal.SourceTokenData memory sourceTokenData = + abi.decode(encodedSourceTokenData[i], (Internal.SourceTokenData)); + uint256 tokenGasOverride = gasLimitOverride.tokenGasOverrides[j]; + + // The gas limit can not be lowered as that could cause the message to fail. If manual execution is done + // from an UNTOUCHED state and we would allow lower gas limit, anyone could grief by executing the message with + // lower gas limit than the DON would have used. This results in the message being marked FAILURE and the DON + // would not attempt it with the correct gas limit. + if (tokenGasOverride != 0 && tokenGasOverride < sourceTokenData.destGasAmount) { + revert InvalidTokenGasOverride(message.messageId, j, sourceTokenData.destGasAmount, tokenGasOverride); + } + } + } + + _execute(report, gasLimitOverrides); + } + + /// @notice Entrypoint for execution, called by the OCR network + /// @dev Expects an encoded ExecutionReport + /// @dev Supplies no GasLimitOverrides as the DON will only execute with the original gas limits. + function _report(bytes calldata report) internal override { + _execute(abi.decode(report, (Internal.ExecutionReport)), new GasLimitOverride[](0)); + } + + /// @notice Executes a report, executing each message in order. + /// @param report The execution report containing the messages and proofs. + /// @param manualExecGasOverrides An array of gas limits to use for manual execution. + /// @dev If called from the DON, this array is always empty. + /// @dev If called from manual execution, this array is always same length as messages. + function _execute(Internal.ExecutionReport memory report, GasLimitOverride[] memory manualExecGasOverrides) internal { + if (IRMN(i_rmnProxy).isCursed(bytes16(uint128(i_sourceChainSelector)))) revert CursedByRMN(); + + uint256 numMsgs = report.messages.length; + if (numMsgs == 0) revert EmptyReport(); + if (numMsgs != report.offchainTokenData.length) revert UnexpectedTokenData(); + + bytes32[] memory hashedLeaves = new bytes32[](numMsgs); + + for (uint256 i = 0; i < numMsgs; ++i) { + Internal.EVM2EVMMessage memory message = report.messages[i]; + // We do this hash here instead of in _verifyMessages to avoid two separate loops + // over the same data, which increases gas cost + hashedLeaves[i] = Internal._hash(message, i_metadataHash); + // For EVM2EVM offramps, the messageID is the leaf hash. + // Asserting that this is true ensures we don't accidentally commit and then execute + // a message with an unexpected hash. + if (hashedLeaves[i] != message.messageId) revert InvalidMessageId(); + } + bool manualExecution = manualExecGasOverrides.length != 0; + + // SECURITY CRITICAL CHECK + uint256 timestampCommitted = ICommitStore(i_commitStore).verify(hashedLeaves, report.proofs, report.proofFlagBits); + if (timestampCommitted == 0) revert RootNotCommitted(); + + // Execute messages + for (uint256 i = 0; i < numMsgs; ++i) { + Internal.EVM2EVMMessage memory message = report.messages[i]; + Internal.MessageExecutionState originalState = getExecutionState(message.sequenceNumber); + // Two valid cases here, we either have never touched this message before, or we tried to execute + // and failed. This check protects against reentry and re-execution because the other state is + // IN_PROGRESS which should not be allowed to execute. + if ( + !( + originalState == Internal.MessageExecutionState.UNTOUCHED + || originalState == Internal.MessageExecutionState.FAILURE + ) + ) { + // If the message has already been executed, we skip it. We want to not revert on race conditions between + // executing parties. This will allow us to open up manual exec while also attempting with the DON, without + // reverting an entire DON batch when a user manually executes while the tx is inflight. + emit SkippedAlreadyExecutedMessage(message.sequenceNumber); + continue; + } + uint32[] memory tokenGasOverrides; + + if (manualExecution) { + tokenGasOverrides = manualExecGasOverrides[i].tokenGasOverrides; + bool isOldCommitReport = + (block.timestamp - timestampCommitted) > s_dynamicConfig.permissionLessExecutionThresholdSeconds; + // Manually execution is fine if we previously failed or if the commit report is just too old + // Acceptable state transitions: FAILURE->SUCCESS, UNTOUCHED->SUCCESS, FAILURE->FAILURE + if (!(isOldCommitReport || originalState == Internal.MessageExecutionState.FAILURE)) { + revert ManualExecutionNotYetEnabled(); + } + + // Manual execution gas limit can override gas limit specified in the message. Value of 0 indicates no override. + if (manualExecGasOverrides[i].receiverExecutionGasLimit != 0) { + message.gasLimit = manualExecGasOverrides[i].receiverExecutionGasLimit; + } + } else { + // DON can only execute a message once + // Acceptable state transitions: UNTOUCHED->SUCCESS, UNTOUCHED->FAILURE + if (originalState != Internal.MessageExecutionState.UNTOUCHED) { + emit AlreadyAttempted(message.sequenceNumber); + continue; + } + } + + if (message.nonce != 0) { + // In the scenario where we upgrade offRamps, we still want to have sequential nonces. + // Referencing the old offRamp to check the expected nonce if none is set for a + // given sender allows us to skip the current message if it would not be the next according + // to the old offRamp. This preserves sequencing between updates. + uint64 prevNonce = s_senderNonce[message.sender]; + if (prevNonce == 0) { + if (i_prevOffRamp != address(0)) { + prevNonce = IAny2EVMOffRamp(i_prevOffRamp).getSenderNonce(message.sender); + if (prevNonce + 1 != message.nonce) { + // the starting v2 onramp nonce, i.e. the 1st message nonce v2 offramp is expected to receive, + // is guaranteed to equal (largest v1 onramp nonce + 1). + // if this message's nonce isn't (v1 offramp nonce + 1), then v1 offramp nonce != largest v1 onramp nonce, + // it tells us there are still messages inflight for v1 offramp + emit SkippedSenderWithPreviousRampMessageInflight(message.nonce, message.sender); + continue; + } + // Otherwise this nonce is indeed the "transitional nonce", that is + // all messages sent to v1 ramp have been executed by the DON and the sequence can resume in V2. + // Note if first time user in V2, then prevNonce will be 0, and message.nonce = 1, so this will be a no-op. + s_senderNonce[message.sender] = prevNonce; + } + } + + // UNTOUCHED messages MUST be executed in order always IF message.nonce > 0. + if (originalState == Internal.MessageExecutionState.UNTOUCHED) { + if (prevNonce + 1 != message.nonce) { + // We skip the message if the nonce is incorrect, since message.nonce > 0. + emit SkippedIncorrectNonce(message.nonce, message.sender); + continue; + } + } + } + + // Although we expect only valid messages will be committed, we check again + // when executing as a defense in depth measure. + bytes[] memory offchainTokenData = report.offchainTokenData[i]; + _isWellFormed( + message.sequenceNumber, + message.sourceChainSelector, + message.tokenAmounts.length, + message.data.length, + offchainTokenData.length + ); + + _setExecutionState(message.sequenceNumber, Internal.MessageExecutionState.IN_PROGRESS); + (Internal.MessageExecutionState newState, bytes memory returnData) = + _trialExecute(message, offchainTokenData, tokenGasOverrides); + _setExecutionState(message.sequenceNumber, newState); + + // Since it's hard to estimate whether manual execution will succeed, we + // revert the entire transaction if it fails. This will show the user if + // their manual exec will fail before they submit it. + if (manualExecution) { + if (newState == Internal.MessageExecutionState.FAILURE) { + if (originalState != Internal.MessageExecutionState.UNTOUCHED) { + // If manual execution fails, we revert the entire transaction, unless the originalState is UNTOUCHED as we + // would still be making progress by changing the state from UNTOUCHED to FAILURE. + revert ExecutionError(returnData); + } + } + } + + // The only valid prior states are UNTOUCHED and FAILURE (checked above) + // The only valid post states are SUCCESS and FAILURE (checked below) + if (newState != Internal.MessageExecutionState.SUCCESS) { + if (newState != Internal.MessageExecutionState.FAILURE) { + revert InvalidNewState(message.sequenceNumber, newState); + } + } + + // Nonce changes per state transition. + // These only apply for ordered messages. + // UNTOUCHED -> FAILURE nonce bump + // UNTOUCHED -> SUCCESS nonce bump + // FAILURE -> FAILURE no nonce bump + // FAILURE -> SUCCESS no nonce bump + if (message.nonce != 0) { + if (originalState == Internal.MessageExecutionState.UNTOUCHED) { + s_senderNonce[message.sender]++; + } + } + + emit ExecutionStateChanged(message.sequenceNumber, message.messageId, newState, returnData); + } + } + + /// @notice Does basic message validation. Should never fail. + /// @param sequenceNumber Sequence number of the message. + /// @param sourceChainSelector SourceChainSelector of the message. + /// @param numberOfTokens Length of tokenAmounts array in the message. + /// @param dataLength Length of data field in the message. + /// @param offchainTokenDataLength Length of offchainTokenData array. + /// @dev reverts on validation failures. + function _isWellFormed( + uint64 sequenceNumber, + uint64 sourceChainSelector, + uint256 numberOfTokens, + uint256 dataLength, + uint256 offchainTokenDataLength + ) private view { + if (sourceChainSelector != i_sourceChainSelector) revert InvalidSourceChain(sourceChainSelector); + if (numberOfTokens > uint256(s_dynamicConfig.maxNumberOfTokensPerMsg)) { + revert UnsupportedNumberOfTokens(sequenceNumber); + } + if (numberOfTokens != offchainTokenDataLength) revert TokenDataMismatch(sequenceNumber); + if (dataLength > uint256(s_dynamicConfig.maxDataBytes)) { + revert MessageTooLarge(uint256(s_dynamicConfig.maxDataBytes), dataLength); + } + } + + /// @notice Try executing a message. + /// @param message Internal.EVM2EVMMessage memory message. + /// @param offchainTokenData Data provided by the DON for token transfers. + /// @return the new state of the message, being either SUCCESS or FAILURE. + /// @return revert data in bytes if CCIP receiver reverted during execution. + function _trialExecute( + Internal.EVM2EVMMessage memory message, + bytes[] memory offchainTokenData, + uint32[] memory tokenGasOverrides + ) internal returns (Internal.MessageExecutionState, bytes memory) { + try this.executeSingleMessage(message, offchainTokenData, tokenGasOverrides) {} + catch (bytes memory err) { + // return the message execution state as FAILURE and the revert data + // Max length of revert data is Router.MAX_RET_BYTES, max length of err is 4 + Router.MAX_RET_BYTES + return (Internal.MessageExecutionState.FAILURE, err); + } + // If message execution succeeded, no CCIP receiver return data is expected, return with empty bytes. + return (Internal.MessageExecutionState.SUCCESS, ""); + } + + /// @notice Execute a single message. + /// @param message The message that will be executed. + /// @param offchainTokenData Token transfer data to be passed to TokenPool. + /// @dev We make this external and callable by the contract itself, in order to try/catch + /// its execution and enforce atomicity among successful message processing and token transfer. + /// @dev We use ERC-165 to check for the ccipReceive interface to permit sending tokens to contracts + /// (for example smart contract wallets) without an associated message. + function executeSingleMessage( + Internal.EVM2EVMMessage calldata message, + bytes[] calldata offchainTokenData, + uint32[] memory tokenGasOverrides + ) external { + if (msg.sender != address(this)) revert CanOnlySelfCall(); + Client.EVMTokenAmount[] memory destTokenAmounts = new Client.EVMTokenAmount[](0); + if (message.tokenAmounts.length > 0) { + destTokenAmounts = _releaseOrMintTokens( + message.tokenAmounts, + abi.encode(message.sender), + message.receiver, + message.sourceTokenData, + offchainTokenData, + tokenGasOverrides + ); + } + // There are three cases in which we skip calling the receiver: + // 1. If the message data is empty AND the gas limit is 0. + // This indicates a message that only transfers tokens. It is valid to only send tokens to a contract + // that supports the IAny2EVMMessageReceiver interface, but without this first check we would call the + // receiver without any gas, which would revert the transaction. + // 2. If the receiver is not a contract. + // 3. If the receiver is a contract but it does not support the IAny2EVMMessageReceiver interface. + // + // The ordering of these checks is important, as the first check is the cheapest to execute. + if ( + (message.data.length == 0 && message.gasLimit == 0) || message.receiver.code.length == 0 + || !message.receiver.supportsInterface(type(IAny2EVMMessageReceiver).interfaceId) + ) return; + + (bool success, bytes memory returnData,) = IRouter(s_dynamicConfig.router).routeMessage( + Client.Any2EVMMessage({ + messageId: message.messageId, + sourceChainSelector: message.sourceChainSelector, + sender: abi.encode(message.sender), + data: message.data, + destTokenAmounts: destTokenAmounts + }), + Internal.GAS_FOR_CALL_EXACT_CHECK, + message.gasLimit, + message.receiver + ); + // If CCIP receiver execution is not successful, revert the call including token transfers + if (!success) revert ReceiverError(returnData); + } + + /// @notice creates a unique hash to be used in message hashing. + function _metadataHash(bytes32 prefix) internal view returns (bytes32) { + return keccak256(abi.encode(prefix, i_sourceChainSelector, i_chainSelector, i_onRamp)); + } + + // ================================================================ + // │ Config │ + // ================================================================ + + /// @notice Returns the static config. + /// @dev This function will always return the same struct as the contents is static and can never change. + /// RMN depends on this function, if changing, please notify the RMN maintainers. + function getStaticConfig() external view returns (StaticConfig memory) { + return StaticConfig({ + commitStore: i_commitStore, + chainSelector: i_chainSelector, + sourceChainSelector: i_sourceChainSelector, + onRamp: i_onRamp, + prevOffRamp: i_prevOffRamp, + rmnProxy: i_rmnProxy, + tokenAdminRegistry: i_tokenAdminRegistry + }); + } + + /// @notice Returns the current dynamic config. + /// @return The current config. + function getDynamicConfig() external view returns (DynamicConfig memory) { + return s_dynamicConfig; + } + + /// @notice Sets the dynamic config. This function is called during `setOCR2Config` flow + function _beforeSetConfig(bytes memory onchainConfig) internal override { + DynamicConfig memory dynamicConfig = abi.decode(onchainConfig, (DynamicConfig)); + + if (dynamicConfig.router == address(0)) revert ZeroAddressNotAllowed(); + + s_dynamicConfig = dynamicConfig; + + emit ConfigSet( + StaticConfig({ + commitStore: i_commitStore, + chainSelector: i_chainSelector, + sourceChainSelector: i_sourceChainSelector, + onRamp: i_onRamp, + prevOffRamp: i_prevOffRamp, + rmnProxy: i_rmnProxy, + tokenAdminRegistry: i_tokenAdminRegistry + }), + dynamicConfig + ); + } + + /// @notice Get all tokens which are included in Aggregate Rate Limiting. + /// @return sourceTokens The source representation of the tokens that are rate limited. + /// @return destTokens The destination representation of the tokens that are rate limited. + /// @dev the order of IDs in the list is **not guaranteed**, therefore, if ordering matters when + /// making successive calls, one should keep the block height constant to ensure a consistent result. + function getAllRateLimitTokens() external view returns (address[] memory sourceTokens, address[] memory destTokens) { + uint256 numRateLimitedTokens = s_rateLimitedTokensDestToSource.length(); + sourceTokens = new address[](numRateLimitedTokens); + destTokens = new address[](numRateLimitedTokens); + + for (uint256 i = 0; i < numRateLimitedTokens; ++i) { + (address destToken, address sourceToken) = s_rateLimitedTokensDestToSource.at(i); + sourceTokens[i] = sourceToken; + destTokens[i] = destToken; + } + return (sourceTokens, destTokens); + } + + /// @notice Adds or removes tokens from being used in Aggregate Rate Limiting. + /// @param removes - A list of one or more tokens to be removed. + /// @param adds - A list of one or more tokens to be added. + function updateRateLimitTokens(RateLimitToken[] memory removes, RateLimitToken[] memory adds) external onlyOwner { + for (uint256 i = 0; i < removes.length; ++i) { + if (s_rateLimitedTokensDestToSource.remove(removes[i].destToken)) { + emit TokenAggregateRateLimitRemoved(removes[i].sourceToken, removes[i].destToken); + } + } + + for (uint256 i = 0; i < adds.length; ++i) { + if (s_rateLimitedTokensDestToSource.set(adds[i].destToken, adds[i].sourceToken)) { + emit TokenAggregateRateLimitAdded(adds[i].sourceToken, adds[i].destToken); + } + } + } + + // ================================================================ + // │ Tokens and pools │ + // ================================================================ + + /// @notice Uses a pool to release or mint a token to a receiver address, with balance checks before and after the + /// transfer. This is done to ensure the exact number of tokens the pool claims to release are actually transferred. + /// @dev The local token address is validated through the TokenAdminRegistry. If, due to some misconfiguration, the + /// token is unknown to the registry, the offRamp will revert. The tx, and the tokens, can be retrieved by + /// registering the token on this chain, and re-trying the msg. + /// @param sourceAmount The amount of tokens to be released/minted. + /// @param originalSender The message sender on the source chain. + /// @param receiver The address that will receive the tokens. + /// @param sourceTokenData A struct containing the local token address, the source pool address and optional data + /// returned from the source pool. + /// @param offchainTokenData Data fetched offchain by the DON. + function _releaseOrMintToken( + uint256 sourceAmount, + bytes memory originalSender, + address receiver, + Internal.SourceTokenData memory sourceTokenData, + bytes memory offchainTokenData + ) internal returns (Client.EVMTokenAmount memory destTokenAmount) { + // We need to safely decode the token address from the sourceTokenData, as it could be wrong, + // in which case it doesn't have to be a valid EVM address. + address localToken = Internal._validateEVMAddress(sourceTokenData.destTokenAddress); + // We check with the token admin registry if the token has a pool on this chain. + address localPoolAddress = ITokenAdminRegistry(i_tokenAdminRegistry).getPool(localToken); + // This will call the supportsInterface through the ERC165Checker, and not directly on the pool address. + // This is done to prevent a pool from reverting the entire transaction if it doesn't support the interface. + // The call gets a max or 30k gas per instance, of which there are three. This means gas estimations should + // account for 90k gas overhead due to the interface check. + if (localPoolAddress == address(0) || !localPoolAddress.supportsInterface(Pool.CCIP_POOL_V1)) { + revert NotACompatiblePool(localPoolAddress); + } + + // We retrieve the local token balance of the receiver before the pool call. + (uint256 balancePre, uint256 gasLeft) = _getBalanceOfReceiver(receiver, localToken, sourceTokenData.destGasAmount); + + // We determined that the pool address is a valid EVM address, but that does not mean the code at this + // address is a (compatible) pool contract. _callWithExactGasSafeReturnData will check if the location + // contains a contract. If it doesn't it reverts with a known error, which we catch gracefully. + // We call the pool with exact gas to increase resistance against malicious tokens or token pools. + // We protects against return data bombs by capping the return data size at MAX_RET_BYTES. + (bool success, bytes memory returnData, uint256 gasUsedReleaseOrMint) = CallWithExactGas + ._callWithExactGasSafeReturnData( + abi.encodeCall( + IPoolV1.releaseOrMint, + Pool.ReleaseOrMintInV1({ + originalSender: originalSender, + receiver: receiver, + amount: sourceAmount, + localToken: localToken, + remoteChainSelector: i_sourceChainSelector, + sourcePoolAddress: sourceTokenData.sourcePoolAddress, + sourcePoolData: sourceTokenData.extraData, + offchainTokenData: offchainTokenData + }) + ), + localPoolAddress, + gasLeft, + Internal.GAS_FOR_CALL_EXACT_CHECK, + Internal.MAX_RET_BYTES + ); + + // wrap and rethrow the error so we can catch it lower in the stack + if (!success) revert TokenHandlingError(returnData); + // If the call was successful, the returnData should contain only the local token amount. + if (returnData.length != Pool.CCIP_POOL_V1_RET_BYTES) { + revert InvalidDataLength(Pool.CCIP_POOL_V1_RET_BYTES, returnData.length); + } + + uint256 localAmount = abi.decode(returnData, (uint256)); + // We don't need to do balance checks if the pool is the receiver, as they would always fail in the case + // of a lockRelease pool. + if (receiver != localPoolAddress) { + (uint256 balancePost,) = _getBalanceOfReceiver(receiver, localToken, gasLeft - gasUsedReleaseOrMint); + + // First we check if the subtraction would result in an underflow to ensure we revert with a clear error + if (balancePost < balancePre || balancePost - balancePre != localAmount) { + revert ReleaseOrMintBalanceMismatch(localAmount, balancePre, balancePost); + } + } + + return Client.EVMTokenAmount({token: localToken, amount: localAmount}); + } + + function _getBalanceOfReceiver( + address receiver, + address token, + uint256 gasLimit + ) internal returns (uint256 balance, uint256 gasLeft) { + (bool success, bytes memory returnData, uint256 gasUsed) = CallWithExactGas._callWithExactGasSafeReturnData( + abi.encodeCall(IERC20.balanceOf, (receiver)), + token, + gasLimit, + Internal.GAS_FOR_CALL_EXACT_CHECK, + Internal.MAX_RET_BYTES + ); + if (!success) revert TokenHandlingError(returnData); + + // If the call was successful, the returnData should contain only the balance. + if (returnData.length != Internal.MAX_BALANCE_OF_RET_BYTES) { + revert InvalidDataLength(Internal.MAX_BALANCE_OF_RET_BYTES, returnData.length); + } + + // Return the decoded balance, which cannot fail as we checked the length, and the gas that is left + // after this call. + return (abi.decode(returnData, (uint256)), gasLimit - gasUsed); + } + + /// @notice Uses pools to release or mint a number of different tokens to a receiver address. + /// @param sourceTokenAmounts List of tokens and amount values to be released/minted. + /// @param originalSender The message sender. + /// @param receiver The address that will receive the tokens. + /// @param encodedSourceTokenData Array of token data returned by token pools on the source chain. + /// @param offchainTokenData Array of token data fetched offchain by the DON. + /// @dev This function wrappes the token pool call in a try catch block to gracefully handle + /// any non-rate limiting errors that may occur. If we encounter a rate limiting related error + /// we bubble it up. If we encounter a non-rate limiting error we wrap it in a TokenHandlingError. + function _releaseOrMintTokens( + Client.EVMTokenAmount[] calldata sourceTokenAmounts, + bytes memory originalSender, + address receiver, + bytes[] calldata encodedSourceTokenData, + bytes[] calldata offchainTokenData, + uint32[] memory tokenGasOverrides + ) internal returns (Client.EVMTokenAmount[] memory destTokenAmounts) { + // Creating a copy is more gas efficient than initializing a new array. + destTokenAmounts = sourceTokenAmounts; + uint256 value = 0; + for (uint256 i = 0; i < sourceTokenAmounts.length; ++i) { + Internal.SourceTokenData memory sourceTokenData = + abi.decode(encodedSourceTokenData[i], (Internal.SourceTokenData)); + if (tokenGasOverrides.length != 0) { + if (tokenGasOverrides[i] != 0) { + sourceTokenData.destGasAmount = tokenGasOverrides[i]; + } + } + destTokenAmounts[i] = _releaseOrMintToken( + sourceTokenAmounts[i].amount, + originalSender, + receiver, + // This should never revert as the onRamp encodes the sourceTokenData struct. Only the inner components from + // this struct come from untrusted sources. + sourceTokenData, + offchainTokenData[i] + ); + + if (s_rateLimitedTokensDestToSource.contains(destTokenAmounts[i].token)) { + value += _getTokenValue(destTokenAmounts[i], IPriceRegistry(s_dynamicConfig.priceRegistry)); + } + } + + if (value > 0) _rateLimitValue(value); + + return destTokenAmounts; + } + + // ================================================================ + // │ Access │ + // ================================================================ + + /// @notice Reverts as this contract should not access CCIP messages + function ccipReceive(Client.Any2EVMMessage calldata) external pure { + // solhint-disable-next-line + revert(); + } +} diff --git a/contracts/src/v0.8/ccip/offRamp/OffRamp.sol b/contracts/src/v0.8/ccip/offRamp/OffRamp.sol new file mode 100644 index 00000000000..10bde4c251e --- /dev/null +++ b/contracts/src/v0.8/ccip/offRamp/OffRamp.sol @@ -0,0 +1,935 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {ITypeAndVersion} from "../../shared/interfaces/ITypeAndVersion.sol"; +import {IAny2EVMMessageReceiver} from "../interfaces/IAny2EVMMessageReceiver.sol"; +import {IFeeQuoter} from "../interfaces/IFeeQuoter.sol"; +import {IMessageInterceptor} from "../interfaces/IMessageInterceptor.sol"; +import {INonceManager} from "../interfaces/INonceManager.sol"; +import {IPoolV1} from "../interfaces/IPool.sol"; +import {IRMNV2} from "../interfaces/IRMNV2.sol"; +import {IRouter} from "../interfaces/IRouter.sol"; +import {ITokenAdminRegistry} from "../interfaces/ITokenAdminRegistry.sol"; + +import {CallWithExactGas} from "../../shared/call/CallWithExactGas.sol"; +import {EnumerableMapAddresses} from "../../shared/enumerable/EnumerableMapAddresses.sol"; +import {Client} from "../libraries/Client.sol"; +import {Internal} from "../libraries/Internal.sol"; +import {MerkleMultiProof} from "../libraries/MerkleMultiProof.sol"; +import {Pool} from "../libraries/Pool.sol"; +import {MultiOCR3Base} from "../ocr/MultiOCR3Base.sol"; + +import {IERC20} from "../../vendor/openzeppelin-solidity/v5.0.2/contracts/token/ERC20/IERC20.sol"; +import {ERC165Checker} from "../../vendor/openzeppelin-solidity/v5.0.2/contracts/utils/introspection/ERC165Checker.sol"; + +/// @notice OffRamp enables OCR networks to execute multiple messages +/// in an OffRamp in a single transaction. +/// @dev The OnRamp and OffRamp form an xchain upgradeable unit. Any change to one of them +/// results an onchain upgrade of both contracts. +/// @dev MultiOCR3Base is used to store multiple OCR configs for the OffRamp. +/// The execution plugin type has to be configured without signature verification, and the commit +/// plugin type with verification. +contract OffRamp is ITypeAndVersion, MultiOCR3Base { + using ERC165Checker for address; + using EnumerableMapAddresses for EnumerableMapAddresses.AddressToAddressMap; + + error ZeroChainSelectorNotAllowed(); + error ExecutionError(bytes32 messageId, bytes err); + error SourceChainNotEnabled(uint64 sourceChainSelector); + error TokenDataMismatch(uint64 sourceChainSelector, uint64 sequenceNumber); + error UnexpectedTokenData(); + error ManualExecutionNotYetEnabled(uint64 sourceChainSelector); + error ManualExecutionGasLimitMismatch(); + error InvalidManualExecutionGasLimit(uint64 sourceChainSelector, uint256 index, uint256 newLimit); + error RootNotCommitted(uint64 sourceChainSelector); + error RootAlreadyCommitted(uint64 sourceChainSelector, bytes32 merkleRoot); + error InvalidRoot(); + error CanOnlySelfCall(); + error ReceiverError(bytes err); + error TokenHandlingError(bytes err); + error ReleaseOrMintBalanceMismatch(uint256 amountReleased, uint256 balancePre, uint256 balancePost); + error EmptyReport(); + error CursedByRMN(uint64 sourceChainSelector); + error NotACompatiblePool(address notPool); + error InvalidDataLength(uint256 expected, uint256 got); + error InvalidNewState(uint64 sourceChainSelector, uint64 sequenceNumber, Internal.MessageExecutionState newState); + error InvalidStaticConfig(uint64 sourceChainSelector); + error StaleCommitReport(); + error InvalidInterval(uint64 sourceChainSelector, uint64 min, uint64 max); + error ZeroAddressNotAllowed(); + error InvalidMessageDestChainSelector(uint64 messageDestChainSelector); + + /// @dev Atlas depends on this event, if changing, please notify Atlas. + event StaticConfigSet(StaticConfig staticConfig); + event DynamicConfigSet(DynamicConfig dynamicConfig); + /// @dev RMN depends on this event, if changing, please notify the RMN maintainers. + event ExecutionStateChanged( + uint64 indexed sourceChainSelector, + uint64 indexed sequenceNumber, + bytes32 indexed messageId, + bytes32 messageHash, + Internal.MessageExecutionState state, + bytes returnData, + uint256 gasUsed + ); + event SourceChainSelectorAdded(uint64 sourceChainSelector); + event SourceChainConfigSet(uint64 indexed sourceChainSelector, SourceChainConfig sourceConfig); + event SkippedAlreadyExecutedMessage(uint64 sourceChainSelector, uint64 sequenceNumber); + event AlreadyAttempted(uint64 sourceChainSelector, uint64 sequenceNumber); + /// @dev RMN depends on this event, if changing, please notify the RMN maintainers. + event CommitReportAccepted(CommitReport report); + event RootRemoved(bytes32 root); + event SkippedReportExecution(uint64 sourceChainSelector); + + /// @notice Struct that contains the static configuration + /// @dev RMN depends on this struct, if changing, please notify the RMN maintainers. + /// @dev not sure why solhint complains about this, seems like a buggy detector + /// https://github.com/protofire/solhint/issues/597 + // solhint-disable-next-line gas-struct-packing + struct StaticConfig { + uint64 chainSelector; // ───╮ Destination chainSelector + IRMNV2 rmn; // ─────────────╯ RMN Verification Contract + address tokenAdminRegistry; // Token admin registry address + address nonceManager; // Nonce manager address + } + + /// @notice Per-chain source config (defining a lane from a Source Chain -> Dest OffRamp) + struct SourceChainConfig { + IRouter router; // ──────────╮ Local router to use for messages coming from this source chain + bool isEnabled; // | Flag whether the source chain is enabled or not + uint64 minSeqNr; // ─────────╯ The min sequence number expected for future messages + bytes onRamp; // OnRamp address on the source chain + } + + /// @notice Same as SourceChainConfig but with source chain selector so that an array of these + /// can be passed in the constructor and the applySourceChainConfigUpdates function. + struct SourceChainConfigArgs { + IRouter router; // ────────────────╮ Local router to use for messages coming from this source chain + uint64 sourceChainSelector; // | Source chain selector of the config to update + bool isEnabled; // ────────────────╯ Flag whether the source chain is enabled or not + bytes onRamp; // OnRamp address on the source chain + } + + /// @notice Dynamic offRamp config + /// @dev Since DynamicConfig is part of DynamicConfigSet event, if changing it, we should update the ABI on Atlas + struct DynamicConfig { + address feeQuoter; // ──────────────────────────────╮ FeeQuoter address on the local chain + uint32 permissionLessExecutionThresholdSeconds; // │ Waiting time before manual execution is enabled + uint32 maxTokenTransferGas; // │ Maximum amount of gas passed on to token `transfer` call + uint32 maxPoolReleaseOrMintGas; // ─────────────────╯ Maximum amount of gas passed on to token pool when calling releaseOrMint + address messageValidator; // Optional message validator to validate incoming messages (zero address = no validator) + } + + /// @notice Report that is committed by the observing DON at the committing phase + /// @dev RMN depends on this struct, if changing, please notify the RMN maintainers. + struct CommitReport { + Internal.PriceUpdates priceUpdates; // Collection of gas and price updates to commit + Internal.MerkleRoot[] merkleRoots; // Collection of merkle roots per source chain to commit + IRMNV2.Signature[] rmnSignatures; // RMN signatures on the merkle roots + } + + // STATIC CONFIG + string public constant override typeAndVersion = "OffRamp 1.6.0-dev"; + /// @dev ChainSelector of this chain + uint64 internal immutable i_chainSelector; + /// @dev The RMN verification contract + IRMNV2 internal immutable i_rmn; + /// @dev The address of the token admin registry + address internal immutable i_tokenAdminRegistry; + /// @dev The address of the nonce manager + address internal immutable i_nonceManager; + + // DYNAMIC CONFIG + DynamicConfig internal s_dynamicConfig; + + /// @notice SourceChainConfig per chain + /// (forms lane configurations from sourceChainSelector => StaticConfig.chainSelector) + mapping(uint64 sourceChainSelector => SourceChainConfig sourceChainConfig) internal s_sourceChainConfigs; + + // STATE + /// @dev A mapping of sequence numbers (per source chain) to execution state using a bitmap with each execution + /// state only taking up 2 bits of the uint256, packing 128 states into a single slot. + /// Message state is tracked to ensure message can only be executed successfully once. + mapping(uint64 sourceChainSelector => mapping(uint64 seqNum => uint256 executionStateBitmap)) internal + s_executionStates; + + /// @notice Commit timestamp of merkle roots per source chain + mapping(uint64 sourceChainSelector => mapping(bytes32 merkleRoot => uint256 timestamp)) internal s_roots; + /// @dev The sequence number of the last price update + uint64 private s_latestPriceSequenceNumber; + + constructor( + StaticConfig memory staticConfig, + DynamicConfig memory dynamicConfig, + SourceChainConfigArgs[] memory sourceChainConfigs + ) MultiOCR3Base() { + if ( + address(staticConfig.rmn) == address(0) || staticConfig.tokenAdminRegistry == address(0) + || staticConfig.nonceManager == address(0) + ) { + revert ZeroAddressNotAllowed(); + } + + if (staticConfig.chainSelector == 0) { + revert ZeroChainSelectorNotAllowed(); + } + + i_chainSelector = staticConfig.chainSelector; + i_rmn = staticConfig.rmn; + i_tokenAdminRegistry = staticConfig.tokenAdminRegistry; + i_nonceManager = staticConfig.nonceManager; + emit StaticConfigSet(staticConfig); + + _setDynamicConfig(dynamicConfig); + _applySourceChainConfigUpdates(sourceChainConfigs); + } + + // ================================================================ + // │ Messaging │ + // ================================================================ + + // The size of the execution state in bits + uint256 private constant MESSAGE_EXECUTION_STATE_BIT_WIDTH = 2; + // The mask for the execution state bits + uint256 private constant MESSAGE_EXECUTION_STATE_MASK = (1 << MESSAGE_EXECUTION_STATE_BIT_WIDTH) - 1; + + // ================================================================ + // │ Execution │ + // ================================================================ + + /// @notice Returns the current execution state of a message based on its sequenceNumber. + /// @param sourceChainSelector The source chain to get the execution state for + /// @param sequenceNumber The sequence number of the message to get the execution state for. + /// @return executionState The current execution state of the message. + /// @dev We use the literal number 128 because using a constant increased gas usage. + function getExecutionState( + uint64 sourceChainSelector, + uint64 sequenceNumber + ) public view returns (Internal.MessageExecutionState) { + return Internal.MessageExecutionState( + ( + _getSequenceNumberBitmap(sourceChainSelector, sequenceNumber) + >> ((sequenceNumber % 128) * MESSAGE_EXECUTION_STATE_BIT_WIDTH) + ) & MESSAGE_EXECUTION_STATE_MASK + ); + } + + /// @notice Sets a new execution state for a given sequence number. It will overwrite any existing state. + /// @param sourceChainSelector The source chain to set the execution state for + /// @param sequenceNumber The sequence number for which the state will be saved. + /// @param newState The new value the state will be in after this function is called. + /// @dev We use the literal number 128 because using a constant increased gas usage. + function _setExecutionState( + uint64 sourceChainSelector, + uint64 sequenceNumber, + Internal.MessageExecutionState newState + ) internal { + uint256 offset = (sequenceNumber % 128) * MESSAGE_EXECUTION_STATE_BIT_WIDTH; + uint256 bitmap = _getSequenceNumberBitmap(sourceChainSelector, sequenceNumber); + // To unset any potential existing state we zero the bits of the section the state occupies, + // then we do an AND operation to blank out any existing state for the section. + bitmap &= ~(MESSAGE_EXECUTION_STATE_MASK << offset); + // Set the new state + bitmap |= uint256(newState) << offset; + + s_executionStates[sourceChainSelector][sequenceNumber / 128] = bitmap; + } + + /// @param sourceChainSelector remote source chain selector to get sequence number bitmap for + /// @param sequenceNumber sequence number to get bitmap for + /// @return bitmap Bitmap of the given sequence number for the provided source chain selector. One bitmap represents 128 sequence numbers + function _getSequenceNumberBitmap( + uint64 sourceChainSelector, + uint64 sequenceNumber + ) internal view returns (uint256 bitmap) { + return s_executionStates[sourceChainSelector][sequenceNumber / 128]; + } + + /// @notice Manually executes a set of reports. + /// @param reports Internal.ExecutionReportSingleChain[] - list of reports to execute + /// @param gasLimitOverrides New gasLimit for each message per report + // The outer array represents each report, inner array represents each message in the report. + // i.e. gasLimitOverrides[report1][report1Message1] -> access message1 from report1 + /// @dev We permit gas limit overrides so that users may manually execute messages which failed due to + /// insufficient gas provided. + /// The reports do not have to contain all the messages (they can be omitted). Multiple reports can be passed in simultaneously. + function manuallyExecute( + Internal.ExecutionReportSingleChain[] memory reports, + uint256[][] memory gasLimitOverrides + ) external { + // We do this here because the other _execute path is already covered by MultiOCR3Base. + _whenChainNotForked(); + + uint256 numReports = reports.length; + if (numReports != gasLimitOverrides.length) revert ManualExecutionGasLimitMismatch(); + + for (uint256 reportIndex = 0; reportIndex < numReports; ++reportIndex) { + Internal.ExecutionReportSingleChain memory report = reports[reportIndex]; + + uint256 numMsgs = report.messages.length; + uint256[] memory msgGasLimitOverrides = gasLimitOverrides[reportIndex]; + if (numMsgs != msgGasLimitOverrides.length) revert ManualExecutionGasLimitMismatch(); + + for (uint256 msgIndex = 0; msgIndex < numMsgs; ++msgIndex) { + uint256 newLimit = msgGasLimitOverrides[msgIndex]; + // Checks to ensure message cannot be executed with less gas than specified. + if (newLimit != 0) { + if (newLimit < report.messages[msgIndex].gasLimit) { + revert InvalidManualExecutionGasLimit(report.sourceChainSelector, msgIndex, newLimit); + } + } + } + } + + _batchExecute(reports, gasLimitOverrides); + } + + /// @notice Transmit function for execution reports. The function takes no signatures, + /// and expects the exec plugin type to be configured with no signatures. + /// @param report serialized execution report + function execute(bytes32[3] calldata reportContext, bytes calldata report) external { + _batchExecute(abi.decode(report, (Internal.ExecutionReportSingleChain[])), new uint256[][](0)); + + bytes32[] memory emptySigs = new bytes32[](0); + _transmit(uint8(Internal.OCRPluginType.Execution), reportContext, report, emptySigs, emptySigs, bytes32("")); + } + + /// @notice Batch executes a set of reports, each report matching one single source chain + /// @param reports Set of execution reports (one per chain) containing the messages and proofs + /// @param manualExecGasLimits An array of gas limits to use for manual execution + // The outer array represents each report, inner array represents each message in the report. + // i.e. gasLimitOverrides[report1][report1Message1] -> access message1 from report1 + /// @dev The manualExecGasLimits array should either be empty, or match the length of the reports array + /// @dev If called from manual execution, each inner array's length has to match the number of messages. + function _batchExecute( + Internal.ExecutionReportSingleChain[] memory reports, + uint256[][] memory manualExecGasLimits + ) internal { + if (reports.length == 0) revert EmptyReport(); + + bool areManualGasLimitsEmpty = manualExecGasLimits.length == 0; + // Cache array for gas savings in the loop's condition + uint256[] memory emptyGasLimits = new uint256[](0); + + for (uint256 i = 0; i < reports.length; ++i) { + _executeSingleReport(reports[i], areManualGasLimitsEmpty ? emptyGasLimits : manualExecGasLimits[i]); + } + } + + /// @notice Executes a report, executing each message in order. + /// @param report The execution report containing the messages and proofs. + /// @param manualExecGasLimits An array of gas limits to use for manual execution. + /// @dev If called from the DON, this array is always empty. + /// @dev If called from manual execution, this array is always same length as messages. + function _executeSingleReport( + Internal.ExecutionReportSingleChain memory report, + uint256[] memory manualExecGasLimits + ) internal { + uint64 sourceChainSelector = report.sourceChainSelector; + bool manualExecution = manualExecGasLimits.length != 0; + if (i_rmn.isCursed(bytes16(uint128(sourceChainSelector)))) { + if (manualExecution) { + // For manual execution we don't want to silently fail so we revert + revert CursedByRMN(sourceChainSelector); + } + // For DON execution we do not revert as a single lane curse can revert the entire batch + emit SkippedReportExecution(sourceChainSelector); + return; + } + + bytes memory onRamp = _getEnabledSourceChainConfig(sourceChainSelector).onRamp; + + uint256 numMsgs = report.messages.length; + if (numMsgs == 0) revert EmptyReport(); + if (numMsgs != report.offchainTokenData.length) revert UnexpectedTokenData(); + + bytes32[] memory hashedLeaves = new bytes32[](numMsgs); + + for (uint256 i = 0; i < numMsgs; ++i) { + Internal.Any2EVMRampMessage memory message = report.messages[i]; + + // Commits do not verify the destChainSelector in the message, since only the root is committed, + // so we have to check it explicitly + if (message.header.destChainSelector != i_chainSelector) { + revert InvalidMessageDestChainSelector(message.header.destChainSelector); + } + + // We do this hash here instead of in _verify to avoid two separate loops + // over the same data, which increases gas cost. + // Hashing all of the message fields ensures that the message being executed is correct and not tampered with. + // Including the known OnRamp ensures that the message originates from the correct on ramp version + hashedLeaves[i] = Internal._hash(message, onRamp); + } + + // SECURITY CRITICAL CHECK + // NOTE: This check also verifies that all messages match the report's sourceChainSelector + uint256 timestampCommitted = _verify(sourceChainSelector, hashedLeaves, report.proofs, report.proofFlagBits); + if (timestampCommitted == 0) revert RootNotCommitted(sourceChainSelector); + + // Execute messages + for (uint256 i = 0; i < numMsgs; ++i) { + uint256 gasStart = gasleft(); + Internal.Any2EVMRampMessage memory message = report.messages[i]; + + Internal.MessageExecutionState originalState = + getExecutionState(sourceChainSelector, message.header.sequenceNumber); + // Two valid cases here, we either have never touched this message before, or we tried to execute + // and failed. This check protects against reentry and re-execution because the other state is + // IN_PROGRESS which should not be allowed to execute. + if ( + !( + originalState == Internal.MessageExecutionState.UNTOUCHED + || originalState == Internal.MessageExecutionState.FAILURE + ) + ) { + // If the message has already been executed, we skip it. We want to not revert on race conditions between + // executing parties. This will allow us to open up manual exec while also attempting with the DON, without + // reverting an entire DON batch when a user manually executes while the tx is inflight. + emit SkippedAlreadyExecutedMessage(sourceChainSelector, message.header.sequenceNumber); + continue; + } + + if (manualExecution) { + bool isOldCommitReport = + (block.timestamp - timestampCommitted) > s_dynamicConfig.permissionLessExecutionThresholdSeconds; + // Manually execution is fine if we previously failed or if the commit report is just too old + // Acceptable state transitions: FAILURE->SUCCESS, UNTOUCHED->SUCCESS, FAILURE->FAILURE + if (!(isOldCommitReport || originalState == Internal.MessageExecutionState.FAILURE)) { + revert ManualExecutionNotYetEnabled(sourceChainSelector); + } + + // Manual execution gas limit can override gas limit specified in the message. Value of 0 indicates no override. + if (manualExecGasLimits[i] != 0) { + message.gasLimit = manualExecGasLimits[i]; + } + } else { + // DON can only execute a message once + // Acceptable state transitions: UNTOUCHED->SUCCESS, UNTOUCHED->FAILURE + if (originalState != Internal.MessageExecutionState.UNTOUCHED) { + emit AlreadyAttempted(sourceChainSelector, message.header.sequenceNumber); + continue; + } + } + + // Nonce changes per state transition (these only apply for ordered messages): + // UNTOUCHED -> FAILURE nonce bump + // UNTOUCHED -> SUCCESS nonce bump + // FAILURE -> FAILURE no nonce bump + // FAILURE -> SUCCESS no nonce bump + // UNTOUCHED messages MUST be executed in order always + // If nonce == 0 then out of order execution is allowed + if (message.header.nonce != 0) { + if (originalState == Internal.MessageExecutionState.UNTOUCHED) { + // If a nonce is not incremented, that means it was skipped, and we can ignore the message + if ( + !INonceManager(i_nonceManager).incrementInboundNonce( + sourceChainSelector, message.header.nonce, message.sender + ) + ) continue; + } + } + + // Although we expect only valid messages will be committed, we check again + // when executing as a defense in depth measure. + bytes[] memory offchainTokenData = report.offchainTokenData[i]; + if (message.tokenAmounts.length != offchainTokenData.length) { + revert TokenDataMismatch(sourceChainSelector, message.header.sequenceNumber); + } + + _setExecutionState(sourceChainSelector, message.header.sequenceNumber, Internal.MessageExecutionState.IN_PROGRESS); + (Internal.MessageExecutionState newState, bytes memory returnData) = _trialExecute(message, offchainTokenData); + _setExecutionState(sourceChainSelector, message.header.sequenceNumber, newState); + + // Since it's hard to estimate whether manual execution will succeed, we + // revert the entire transaction if it fails. This will show the user if + // their manual exec will fail before they submit it. + if (manualExecution) { + if (newState == Internal.MessageExecutionState.FAILURE) { + if (originalState != Internal.MessageExecutionState.UNTOUCHED) { + // If manual execution fails, we revert the entire transaction, unless the originalState is UNTOUCHED as we + // would still be making progress by changing the state from UNTOUCHED to FAILURE. + revert ExecutionError(message.header.messageId, returnData); + } + } + } + + // The only valid prior states are UNTOUCHED and FAILURE (checked above) + // The only valid post states are FAILURE and SUCCESS (checked below) + if (newState != Internal.MessageExecutionState.SUCCESS) { + if (newState != Internal.MessageExecutionState.FAILURE) { + revert InvalidNewState(sourceChainSelector, message.header.sequenceNumber, newState); + } + } + + emit ExecutionStateChanged( + sourceChainSelector, + message.header.sequenceNumber, + message.header.messageId, + hashedLeaves[i], + newState, + returnData, + // This emit covers not only the execution through the router, but also all of the overhead in executing the + // message. This gives the most accurate representation of the gas used in the execution. + gasStart - gasleft() + ); + } + } + + /// @notice Try executing a message. + /// @param message Internal.Any2EVMRampMessage memory message. + /// @param offchainTokenData Data provided by the DON for token transfers. + /// @return executionState The new state of the message, being either SUCCESS or FAILURE. + /// @return errData Revert data in bytes if CCIP receiver reverted during execution. + function _trialExecute( + Internal.Any2EVMRampMessage memory message, + bytes[] memory offchainTokenData + ) internal returns (Internal.MessageExecutionState executionState, bytes memory) { + try this.executeSingleMessage(message, offchainTokenData) {} + catch (bytes memory err) { + // return the message execution state as FAILURE and the revert data + // Max length of revert data is Router.MAX_RET_BYTES, max length of err is 4 + Router.MAX_RET_BYTES + return (Internal.MessageExecutionState.FAILURE, err); + } + // If message execution succeeded, no CCIP receiver return data is expected, return with empty bytes. + return (Internal.MessageExecutionState.SUCCESS, ""); + } + + /// @notice Executes a single message. + /// @param message The message that will be executed. + /// @param offchainTokenData Token transfer data to be passed to TokenPool. + /// @dev We make this external and callable by the contract itself, in order to try/catch + /// its execution and enforce atomicity among successful message processing and token transfer. + /// @dev We use ERC-165 to check for the ccipReceive interface to permit sending tokens to contracts + /// (for example smart contract wallets) without an associated message. + function executeSingleMessage( + Internal.Any2EVMRampMessage memory message, + bytes[] calldata offchainTokenData + ) external { + if (msg.sender != address(this)) revert CanOnlySelfCall(); + Client.EVMTokenAmount[] memory destTokenAmounts = new Client.EVMTokenAmount[](0); + if (message.tokenAmounts.length > 0) { + destTokenAmounts = _releaseOrMintTokens( + message.tokenAmounts, message.sender, message.receiver, message.header.sourceChainSelector, offchainTokenData + ); + } + + Client.Any2EVMMessage memory any2EvmMessage = Client.Any2EVMMessage({ + messageId: message.header.messageId, + sourceChainSelector: message.header.sourceChainSelector, + sender: abi.encode(message.sender), + data: message.data, + destTokenAmounts: destTokenAmounts + }); + + address messageValidator = s_dynamicConfig.messageValidator; + if (messageValidator != address(0)) { + try IMessageInterceptor(messageValidator).onInboundMessage(any2EvmMessage) {} + catch (bytes memory err) { + revert IMessageInterceptor.MessageValidationError(err); + } + } + + // There are three cases in which we skip calling the receiver: + // 1. If the message data is empty AND the gas limit is 0. + // This indicates a message that only transfers tokens. It is valid to only send tokens to a contract + // that supports the IAny2EVMMessageReceiver interface, but without this first check we would call the + // receiver without any gas, which would revert the transaction. + // 2. If the receiver is not a contract. + // 3. If the receiver is a contract but it does not support the IAny2EVMMessageReceiver interface. + // + // The ordering of these checks is important, as the first check is the cheapest to execute. + if ( + (message.data.length == 0 && message.gasLimit == 0) || message.receiver.code.length == 0 + || !message.receiver.supportsInterface(type(IAny2EVMMessageReceiver).interfaceId) + ) return; + + (bool success, bytes memory returnData,) = s_sourceChainConfigs[message.header.sourceChainSelector] + .router + .routeMessage(any2EvmMessage, Internal.GAS_FOR_CALL_EXACT_CHECK, message.gasLimit, message.receiver); + // If CCIP receiver execution is not successful, revert the call including token transfers + if (!success) revert ReceiverError(returnData); + } + + // ================================================================ + // │ Commit │ + // ================================================================ + + /// @notice Transmit function for commit reports. The function requires signatures, + /// and expects the commit plugin type to be configured with signatures. + /// @param report serialized commit report + /// @dev A commitReport can have two distinct parts (batched together to amortize the cost of checking sigs): + /// 1. Price updates + /// 2. A batch of merkle root and sequence number intervals (per-source) + /// Both have their own, separate, staleness checks, with price updates using the epoch and round + /// number of the latest price update. The merkle root checks for staleness are based on the seqNums. + /// They need to be separate because a price report for round t+2 might be included before a report + /// containing a merkle root for round t+1. This merkle root report for round t+1 is still valid + /// and should not be rejected. When a report with a stale root but valid price updates is submitted, + /// we are OK to revert to preserve the invariant that we always revert on invalid sequence number ranges. + /// If that happens, prices will be updated in later rounds. + function commit( + bytes32[3] calldata reportContext, + bytes calldata report, + bytes32[] calldata rs, + bytes32[] calldata ss, + bytes32 rawVs // signatures + ) external { + CommitReport memory commitReport = abi.decode(report, (CommitReport)); + + // Verify RMN signatures + if (commitReport.merkleRoots.length > 0) { + i_rmn.verify(commitReport.merkleRoots, commitReport.rmnSignatures); + } + + // Check if the report contains price updates + if (commitReport.priceUpdates.tokenPriceUpdates.length > 0 || commitReport.priceUpdates.gasPriceUpdates.length > 0) + { + uint64 ocrSequenceNumber = uint64(uint256(reportContext[1])); + + // Check for price staleness based on the epoch and round + if (s_latestPriceSequenceNumber < ocrSequenceNumber) { + // If prices are not stale, update the latest epoch and round + s_latestPriceSequenceNumber = ocrSequenceNumber; + // And update the prices in the fee quoter + IFeeQuoter(s_dynamicConfig.feeQuoter).updatePrices(commitReport.priceUpdates); + } else { + // If prices are stale and the report doesn't contain a root, this report + // does not have any valid information and we revert. + // If it does contain a merkle root, continue to the root checking section. + if (commitReport.merkleRoots.length == 0) revert StaleCommitReport(); + } + } + + for (uint256 i = 0; i < commitReport.merkleRoots.length; ++i) { + Internal.MerkleRoot memory root = commitReport.merkleRoots[i]; + uint64 sourceChainSelector = root.sourceChainSelector; + + if (i_rmn.isCursed(bytes16(uint128(sourceChainSelector)))) { + revert CursedByRMN(sourceChainSelector); + } + + SourceChainConfig storage sourceChainConfig = _getEnabledSourceChainConfig(sourceChainSelector); + + if (sourceChainConfig.minSeqNr != root.minSeqNr || root.minSeqNr > root.maxSeqNr) { + revert InvalidInterval(root.sourceChainSelector, root.minSeqNr, root.maxSeqNr); + } + + bytes32 merkleRoot = root.merkleRoot; + if (merkleRoot == bytes32(0)) revert InvalidRoot(); + // If we reached this section, the report should contain a valid root + // We disallow duplicate roots as that would reset the timestamp and + // delay potential manual execution. + if (s_roots[root.sourceChainSelector][merkleRoot] != 0) { + revert RootAlreadyCommitted(root.sourceChainSelector, merkleRoot); + } + + sourceChainConfig.minSeqNr = root.maxSeqNr + 1; + s_roots[root.sourceChainSelector][merkleRoot] = block.timestamp; + } + + emit CommitReportAccepted(commitReport); + + _transmit(uint8(Internal.OCRPluginType.Commit), reportContext, report, rs, ss, rawVs); + } + + /// @notice Returns the sequence number of the last price update. + /// @return sequenceNumber The latest price update sequence number. + function getLatestPriceSequenceNumber() external view returns (uint64) { + return s_latestPriceSequenceNumber; + } + + /// @notice Returns the timestamp of a potentially previously committed merkle root. + /// If the root was never committed 0 will be returned. + /// @param sourceChainSelector The source chain selector. + /// @param root The merkle root to check the commit status for. + /// @return timestamp The timestamp of the committed root or zero in the case that it was never + /// committed. + function getMerkleRoot(uint64 sourceChainSelector, bytes32 root) external view returns (uint256) { + return s_roots[sourceChainSelector][root]; + } + + /// @notice Returns timestamp of when root was accepted or 0 if verification fails. + /// @dev This method uses a merkle tree within a merkle tree, with the hashedLeaves, + /// proofs and proofFlagBits being used to get the root of the inner tree. + /// This root is then used as the singular leaf of the outer tree. + /// @return timestamp The commit timestamp of the root + function _verify( + uint64 sourceChainSelector, + bytes32[] memory hashedLeaves, + bytes32[] memory proofs, + uint256 proofFlagBits + ) internal view virtual returns (uint256 timestamp) { + bytes32 root = MerkleMultiProof.merkleRoot(hashedLeaves, proofs, proofFlagBits); + return s_roots[sourceChainSelector][root]; + } + + /// @inheritdoc MultiOCR3Base + function _afterOCR3ConfigSet(uint8 ocrPluginType) internal override { + if (ocrPluginType == uint8(Internal.OCRPluginType.Commit)) { + // When the OCR config changes, we reset the sequence number + // since it is scoped per config digest. + // Note that s_minSeqNr/roots do not need to be reset as the roots persist + // across reconfigurations and are de-duplicated separately. + s_latestPriceSequenceNumber = 0; + } + } + + // ================================================================ + // │ Config │ + // ================================================================ + + /// @notice Returns the static config. + /// @dev This function will always return the same struct as the contents is static and can never change. + /// RMN depends on this function, if changing, please notify the RMN maintainers. + /// @return staticConfig The static config. + function getStaticConfig() external view returns (StaticConfig memory) { + return StaticConfig({ + chainSelector: i_chainSelector, + rmn: i_rmn, + tokenAdminRegistry: i_tokenAdminRegistry, + nonceManager: i_nonceManager + }); + } + + /// @notice Returns the current dynamic config. + /// @return dynamicConfig The current dynamic config. + function getDynamicConfig() external view returns (DynamicConfig memory) { + return s_dynamicConfig; + } + + /// @notice Returns the source chain config for the provided source chain selector + /// @param sourceChainSelector chain to retrieve configuration for + /// @return sourceChainConfig The config for the source chain + function getSourceChainConfig(uint64 sourceChainSelector) external view returns (SourceChainConfig memory) { + return s_sourceChainConfigs[sourceChainSelector]; + } + + /// @notice Updates source configs + /// @param sourceChainConfigUpdates Source chain configs + function applySourceChainConfigUpdates(SourceChainConfigArgs[] memory sourceChainConfigUpdates) external onlyOwner { + _applySourceChainConfigUpdates(sourceChainConfigUpdates); + } + + /// @notice Updates source configs + /// @param sourceChainConfigUpdates Source chain configs + function _applySourceChainConfigUpdates(SourceChainConfigArgs[] memory sourceChainConfigUpdates) internal { + for (uint256 i = 0; i < sourceChainConfigUpdates.length; ++i) { + SourceChainConfigArgs memory sourceConfigUpdate = sourceChainConfigUpdates[i]; + uint64 sourceChainSelector = sourceConfigUpdate.sourceChainSelector; + + if (sourceChainSelector == 0) { + revert ZeroChainSelectorNotAllowed(); + } + + if (address(sourceConfigUpdate.router) == address(0)) { + revert ZeroAddressNotAllowed(); + } + + SourceChainConfig storage currentConfig = s_sourceChainConfigs[sourceChainSelector]; + bytes memory currentOnRamp = currentConfig.onRamp; + bytes memory newOnRamp = sourceConfigUpdate.onRamp; + + // OnRamp can never be zero - if it is, then the source chain has been added for the first time + if (currentOnRamp.length == 0) { + if (newOnRamp.length == 0) { + revert ZeroAddressNotAllowed(); + } + + currentConfig.onRamp = newOnRamp; + currentConfig.minSeqNr = 1; + emit SourceChainSelectorAdded(sourceChainSelector); + } else if (keccak256(currentOnRamp) != keccak256(newOnRamp)) { + revert InvalidStaticConfig(sourceChainSelector); + } + + currentConfig.isEnabled = sourceConfigUpdate.isEnabled; + currentConfig.router = sourceConfigUpdate.router; + emit SourceChainConfigSet(sourceChainSelector, currentConfig); + } + } + + /// @notice Sets the dynamic config. + /// @param dynamicConfig The new dynamic config. + function setDynamicConfig(DynamicConfig memory dynamicConfig) external onlyOwner { + _setDynamicConfig(dynamicConfig); + } + + /// @notice Sets the dynamic config. + /// @param dynamicConfig The dynamic config. + function _setDynamicConfig(DynamicConfig memory dynamicConfig) internal { + if (dynamicConfig.feeQuoter == address(0)) { + revert ZeroAddressNotAllowed(); + } + + s_dynamicConfig = dynamicConfig; + + emit DynamicConfigSet(dynamicConfig); + } + + /// @notice Returns a source chain config with a check that the config is enabled + /// @param sourceChainSelector Source chain selector to check for cursing + /// @return sourceChainConfig The source chain config storage pointer + function _getEnabledSourceChainConfig(uint64 sourceChainSelector) internal view returns (SourceChainConfig storage) { + SourceChainConfig storage sourceChainConfig = s_sourceChainConfigs[sourceChainSelector]; + if (!sourceChainConfig.isEnabled) { + revert SourceChainNotEnabled(sourceChainSelector); + } + + return sourceChainConfig; + } + + // ================================================================ + // │ Tokens and pools │ + // ================================================================ + + /// @notice Uses a pool to release or mint a token to a receiver address, with balance checks before and after the + /// transfer. This is done to ensure the exact number of tokens the pool claims to release are actually transferred. + /// @dev The local token address is validated through the TokenAdminRegistry. If, due to some misconfiguration, the + /// token is unknown to the registry, the offRamp will revert. The tx, and the tokens, can be retrieved by + /// registering the token on this chain, and re-trying the msg. + /// @param sourceTokenAmount Amount and source data of the token to be released/minted. + /// @param originalSender The message sender on the source chain. + /// @param receiver The address that will receive the tokens. + /// @param sourceChainSelector The remote source chain selector + /// @param offchainTokenData Data fetched offchain by the DON. + /// @return destTokenAmount local token address with amount + function _releaseOrMintSingleToken( + Internal.RampTokenAmount memory sourceTokenAmount, + bytes memory originalSender, + address receiver, + uint64 sourceChainSelector, + bytes memory offchainTokenData + ) internal returns (Client.EVMTokenAmount memory destTokenAmount) { + // We need to safely decode the token address from the sourceTokenData, as it could be wrong, + // in which case it doesn't have to be a valid EVM address. + address localToken = Internal._validateEVMAddress(sourceTokenAmount.destTokenAddress); + // We check with the token admin registry if the token has a pool on this chain. + address localPoolAddress = ITokenAdminRegistry(i_tokenAdminRegistry).getPool(localToken); + // This will call the supportsInterface through the ERC165Checker, and not directly on the pool address. + // This is done to prevent a pool from reverting the entire transaction if it doesn't support the interface. + // The call gets a max or 30k gas per instance, of which there are three. This means gas estimations should + // account for 90k gas overhead due to the interface check. + if (localPoolAddress == address(0) || !localPoolAddress.supportsInterface(Pool.CCIP_POOL_V1)) { + revert NotACompatiblePool(localPoolAddress); + } + + // We retrieve the local token balance of the receiver before the pool call. + (uint256 balancePre, uint256 gasLeft) = + _getBalanceOfReceiver(receiver, localToken, s_dynamicConfig.maxPoolReleaseOrMintGas); + + // We determined that the pool address is a valid EVM address, but that does not mean the code at this + // address is a (compatible) pool contract. _callWithExactGasSafeReturnData will check if the location + // contains a contract. If it doesn't it reverts with a known error, which we catch gracefully. + // We call the pool with exact gas to increase resistance against malicious tokens or token pools. + // We protect against return data bombs by capping the return data size at MAX_RET_BYTES. + (bool success, bytes memory returnData, uint256 gasUsedReleaseOrMint) = CallWithExactGas + ._callWithExactGasSafeReturnData( + abi.encodeCall( + IPoolV1.releaseOrMint, + Pool.ReleaseOrMintInV1({ + originalSender: originalSender, + receiver: receiver, + amount: sourceTokenAmount.amount, + localToken: localToken, + remoteChainSelector: sourceChainSelector, + sourcePoolAddress: sourceTokenAmount.sourcePoolAddress, + sourcePoolData: sourceTokenAmount.extraData, + offchainTokenData: offchainTokenData + }) + ), + localPoolAddress, + gasLeft, + Internal.GAS_FOR_CALL_EXACT_CHECK, + Internal.MAX_RET_BYTES + ); + + // Wrap and rethrow the error so we can catch it lower in the stack + if (!success) revert TokenHandlingError(returnData); + + // If the call was successful, the returnData should be the local token address. + if (returnData.length != Pool.CCIP_POOL_V1_RET_BYTES) { + revert InvalidDataLength(Pool.CCIP_POOL_V1_RET_BYTES, returnData.length); + } + + uint256 localAmount = abi.decode(returnData, (uint256)); + // We don't need to do balance checks if the pool is the receiver, as they would always fail in the case + // of a lockRelease pool. + if (receiver != localPoolAddress) { + (uint256 balancePost,) = _getBalanceOfReceiver(receiver, localToken, gasLeft - gasUsedReleaseOrMint); + + // First we check if the subtraction would result in an underflow to ensure we revert with a clear error + if (balancePost < balancePre || balancePost - balancePre != localAmount) { + revert ReleaseOrMintBalanceMismatch(localAmount, balancePre, balancePost); + } + } + + return Client.EVMTokenAmount({token: localToken, amount: localAmount}); + } + + /// @notice Retrieves the balance of a receiver address for a given token. + /// @param receiver The address to check the balance of. + /// @param token The token address. + /// @param gasLimit The gas limit to use for the call. + /// @return balance The balance of the receiver. + /// @return gasLeft The gas left after the call. + function _getBalanceOfReceiver( + address receiver, + address token, + uint256 gasLimit + ) internal returns (uint256 balance, uint256 gasLeft) { + (bool success, bytes memory returnData, uint256 gasUsed) = CallWithExactGas._callWithExactGasSafeReturnData( + abi.encodeCall(IERC20.balanceOf, (receiver)), + token, + gasLimit, + Internal.GAS_FOR_CALL_EXACT_CHECK, + Internal.MAX_RET_BYTES + ); + if (!success) revert TokenHandlingError(returnData); + + // If the call was successful, the returnData should contain only the balance. + if (returnData.length != Internal.MAX_BALANCE_OF_RET_BYTES) { + revert InvalidDataLength(Internal.MAX_BALANCE_OF_RET_BYTES, returnData.length); + } + + // Return the decoded balance, which cannot fail as we checked the length, and the gas that is left + // after this call. + return (abi.decode(returnData, (uint256)), gasLimit - gasUsed); + } + + /// @notice Uses pools to release or mint a number of different tokens to a receiver address. + /// @param sourceTokenAmounts List of token amounts with source data of the tokens to be released/minted. + /// @param originalSender The message sender on the source chain. + /// @param receiver The address that will receive the tokens. + /// @param sourceChainSelector The remote source chain selector. + /// @param offchainTokenData Array of token data fetched offchain by the DON. + /// @return destTokenAmounts local token addresses with amounts + /// @dev This function wraps the token pool call in a try catch block to gracefully handle + /// any non-rate limiting errors that may occur. If we encounter a rate limiting related error + /// we bubble it up. If we encounter a non-rate limiting error we wrap it in a TokenHandlingError. + function _releaseOrMintTokens( + Internal.RampTokenAmount[] memory sourceTokenAmounts, + bytes memory originalSender, + address receiver, + uint64 sourceChainSelector, + bytes[] calldata offchainTokenData + ) internal returns (Client.EVMTokenAmount[] memory destTokenAmounts) { + destTokenAmounts = new Client.EVMTokenAmount[](sourceTokenAmounts.length); + for (uint256 i = 0; i < sourceTokenAmounts.length; ++i) { + destTokenAmounts[i] = _releaseOrMintSingleToken( + sourceTokenAmounts[i], originalSender, receiver, sourceChainSelector, offchainTokenData[i] + ); + } + + return destTokenAmounts; + } + + // ================================================================ + // │ Access and RMN │ + // ================================================================ + + /// @notice Reverts as this contract should not access CCIP messages + function ccipReceive(Client.Any2EVMMessage calldata) external pure { + // solhint-disable-next-line + revert(); + } +} diff --git a/contracts/src/v0.8/ccip/onRamp/EVM2EVMOnRamp.sol b/contracts/src/v0.8/ccip/onRamp/EVM2EVMOnRamp.sol new file mode 100644 index 00000000000..0c48b10e64d --- /dev/null +++ b/contracts/src/v0.8/ccip/onRamp/EVM2EVMOnRamp.sol @@ -0,0 +1,921 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {ITypeAndVersion} from "../../shared/interfaces/ITypeAndVersion.sol"; +import {IEVM2AnyOnRamp} from "../interfaces/IEVM2AnyOnRamp.sol"; +import {IEVM2AnyOnRampClient} from "../interfaces/IEVM2AnyOnRampClient.sol"; +import {IPoolV1} from "../interfaces/IPool.sol"; +import {IPriceRegistry} from "../interfaces/IPriceRegistry.sol"; +import {IRMN} from "../interfaces/IRMN.sol"; +import {ITokenAdminRegistry} from "../interfaces/ITokenAdminRegistry.sol"; +import {ILinkAvailable} from "../interfaces/automation/ILinkAvailable.sol"; + +import {AggregateRateLimiter} from "../AggregateRateLimiter.sol"; +import {Client} from "../libraries/Client.sol"; +import {Internal} from "../libraries/Internal.sol"; +import {Pool} from "../libraries/Pool.sol"; +import {RateLimiter} from "../libraries/RateLimiter.sol"; +import {USDPriceWith18Decimals} from "../libraries/USDPriceWith18Decimals.sol"; + +import {IERC20} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/IERC20.sol"; +import {SafeERC20} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/utils/SafeERC20.sol"; +import {EnumerableMap} from "../../vendor/openzeppelin-solidity/v5.0.2/contracts/utils/structs/EnumerableMap.sol"; + +/// @notice The onRamp is a contract that handles lane-specific fee logic, NOP payments and +/// bridgeable token support. +/// @dev The EVM2EVMOnRamp, CommitStore and EVM2EVMOffRamp form an xchain upgradeable unit. Any change to one of them +/// results an onchain upgrade of all 3. +contract EVM2EVMOnRamp is IEVM2AnyOnRamp, ILinkAvailable, AggregateRateLimiter, ITypeAndVersion { + using SafeERC20 for IERC20; + using EnumerableMap for EnumerableMap.AddressToUintMap; + using USDPriceWith18Decimals for uint224; + + error InvalidExtraArgsTag(); + error ExtraArgOutOfOrderExecutionMustBeTrue(); + error OnlyCallableByOwnerOrAdmin(); + error OnlyCallableByOwnerOrAdminOrNop(); + error InvalidWithdrawParams(); + error NoFeesToPay(); + error NoNopsToPay(); + error InsufficientBalance(); + error TooManyNops(); + error MaxFeeBalanceReached(); + error MessageTooLarge(uint256 maxSize, uint256 actualSize); + error MessageGasLimitTooHigh(); + error UnsupportedNumberOfTokens(); + error UnsupportedToken(address token); + error MustBeCalledByRouter(); + error RouterMustSetOriginalSender(); + error InvalidConfig(); + error CursedByRMN(); + error LinkBalanceNotSettled(); + error InvalidNopAddress(address nop); + error NotAFeeToken(address token); + error CannotSendZeroTokens(); + error SourceTokenDataTooLarge(address token); + error InvalidChainSelector(uint64 chainSelector); + error GetSupportedTokensFunctionalityRemovedCheckAdminRegistry(); + error InvalidDestBytesOverhead(address token, uint32 destBytesOverhead); + + event ConfigSet(StaticConfig staticConfig, DynamicConfig dynamicConfig); + event NopPaid(address indexed nop, uint256 amount); + event FeeConfigSet(FeeTokenConfigArgs[] feeConfig); + event TokenTransferFeeConfigSet(TokenTransferFeeConfigArgs[] transferFeeConfig); + event TokenTransferFeeConfigDeleted(address[] tokens); + /// RMN depends on this event, if changing, please notify the RMN maintainers. + event CCIPSendRequested(Internal.EVM2EVMMessage message); + event NopsSet(uint256 nopWeightsTotal, NopAndWeight[] nopsAndWeights); + + /// @dev Struct that contains the static configuration + /// RMN depends on this struct, if changing, please notify the RMN maintainers. + //solhint-disable gas-struct-packing + struct StaticConfig { + address linkToken; // ────────╮ Link token address + uint64 chainSelector; // ─────╯ Source chainSelector + uint64 destChainSelector; // ─╮ Destination chainSelector + uint64 defaultTxGasLimit; // │ Default gas limit for a tx + uint96 maxNopFeesJuels; // ───╯ Max nop fee balance onramp can have + address prevOnRamp; // Address of previous-version OnRamp + address rmnProxy; // Address of RMN proxy + address tokenAdminRegistry; // Address of the token admin registry + } + + /// @dev Struct to contains the dynamic configuration + struct DynamicConfig { + address router; // ──────────────────────────╮ Router address + uint16 maxNumberOfTokensPerMsg; // │ Maximum number of distinct ERC20 token transferred per message + uint32 destGasOverhead; // │ Gas charged on top of the gasLimit to cover destination chain costs + uint16 destGasPerPayloadByte; // │ Destination chain gas charged for passing each byte of `data` payload to receiver + uint32 destDataAvailabilityOverheadGas; // ──╯ Extra data availability gas charged on top of the message, e.g. for OCR + uint16 destGasPerDataAvailabilityByte; // ───╮ Amount of gas to charge per byte of message data that needs availability + uint16 destDataAvailabilityMultiplierBps; // │ Multiplier for data availability gas, multiples of bps, or 0.0001 + address priceRegistry; // │ Price registry address + uint32 maxDataBytes; // │ Maximum payload data size in bytes + uint32 maxPerMsgGasLimit; // ────────────────╯ Maximum gas limit for messages targeting EVMs + // │ + // The following three properties are defaults, they can be overridden by setting the TokenTransferFeeConfig for a token + uint16 defaultTokenFeeUSDCents; // ──────────╮ Default token fee charged per token transfer + uint32 defaultTokenDestGasOverhead; // │ Default gas charged to execute the token transfer on the destination chain + bool enforceOutOfOrder; // ──────────────────╯ Whether to enforce the allowOutOfOrderExecution extraArg value to be true. + } + + /// @dev Struct to hold the execution fee configuration for a fee token + struct FeeTokenConfig { + uint32 networkFeeUSDCents; // ─────────╮ Flat network fee to charge for messages, multiples of 0.01 USD + uint64 gasMultiplierWeiPerEth; // │ Multiplier for gas costs, 1e18 based so 11e17 = 10% extra cost. + uint64 premiumMultiplierWeiPerEth; // │ Multiplier for fee-token-specific premiums + bool enabled; // ──────────────────────╯ Whether this fee token is enabled + } + + /// @dev Struct to hold the fee configuration for a fee token, same as the FeeTokenConfig but with + /// token included so that an array of these can be passed in to setFeeTokenConfig to set the mapping + struct FeeTokenConfigArgs { + address token; // ─────────────────────╮ Token address + uint32 networkFeeUSDCents; // │ Flat network fee to charge for messages, multiples of 0.01 USD + uint64 gasMultiplierWeiPerEth; // ─────╯ Multiplier for gas costs, 1e18 based so 11e17 = 10% extra cost + uint64 premiumMultiplierWeiPerEth; // ─╮ Multiplier for fee-token-specific premiums, 1e18 based + bool enabled; // ──────────────────────╯ Whether this fee token is enabled + } + + /// @dev Struct to hold the transfer fee configuration for token transfers + struct TokenTransferFeeConfig { + uint32 minFeeUSDCents; // ──────────╮ Minimum fee to charge per token transfer, multiples of 0.01 USD + uint32 maxFeeUSDCents; // │ Maximum fee to charge per token transfer, multiples of 0.01 USD + uint16 deciBps; // │ Basis points charged on token transfers, multiples of 0.1bps, or 1e-5 + uint32 destGasOverhead; // │ Gas charged to execute the token transfer on the destination chain + // │ Extra data availability bytes that are returned from the source pool and sent + uint32 destBytesOverhead; // │ to the destination pool. Must be >= Pool.CCIP_LOCK_OR_BURN_V1_RET_BYTES + bool aggregateRateLimitEnabled; // │ Whether this transfer token is to be included in Aggregate Rate Limiting + bool isEnabled; // ─────────────────╯ Whether this token has custom transfer fees + } + + /// @dev Same as TokenTransferFeeConfig + /// token included so that an array of these can be passed in to setTokenTransferFeeConfig + struct TokenTransferFeeConfigArgs { + address token; // ──────────────────╮ Token address + uint32 minFeeUSDCents; // │ Minimum fee to charge per token transfer, multiples of 0.01 USD + uint32 maxFeeUSDCents; // │ Maximum fee to charge per token transfer, multiples of 0.01 USD + uint16 deciBps; // ─────────────────╯ Basis points charged on token transfers, multiples of 0.1bps, or 1e-5 + uint32 destGasOverhead; // ─────────╮ Gas charged to execute the token transfer on the destination chain + // │ Extra data availability bytes that are returned from the source pool and sent + uint32 destBytesOverhead; // │ to the destination pool. Must be >= Pool.CCIP_LOCK_OR_BURN_V1_RET_BYTES + bool aggregateRateLimitEnabled; // ─╯ Whether this transfer token is to be included in Aggregate Rate Limiting + } + + /// @dev Nop address and weight, used to set the nops and their weights + struct NopAndWeight { + address nop; // ────╮ Address of the node operator + uint16 weight; // ──╯ Weight for nop rewards + } + + // STATIC CONFIG + string public constant override typeAndVersion = "EVM2EVMOnRamp 1.5.0"; + /// @dev metadataHash is a lane-specific prefix for a message hash preimage which ensures global uniqueness + /// Ensures that 2 identical messages sent to 2 different lanes will have a distinct hash. + /// Must match the metadataHash used in computing leaf hashes offchain for the root committed in + /// the commitStore and i_metadataHash in the offRamp. + bytes32 internal immutable i_metadataHash; + /// @dev Default gas limit for a transactions that did not specify + /// a gas limit in the extraArgs. + uint64 internal immutable i_defaultTxGasLimit; + /// @dev Maximum nop fee that can accumulate in this onramp + uint96 internal immutable i_maxNopFeesJuels; + /// @dev The link token address - known to pay nops for their work + address internal immutable i_linkToken; + /// @dev The chain ID of the source chain that this contract is deployed to + uint64 internal immutable i_chainSelector; + /// @dev The chain ID of the destination chain + uint64 internal immutable i_destChainSelector; + /// @dev The address of previous-version OnRamp for this lane + /// Used to be able to provide sequencing continuity during a zero downtime upgrade. + address internal immutable i_prevOnRamp; + /// @dev The address of the RMN proxy + address internal immutable i_rmnProxy; + /// @dev The address of the token admin registry + address internal immutable i_tokenAdminRegistry; + /// @dev the maximum number of nops that can be configured at the same time. + /// Used to bound gas for loops over nops. + uint256 private constant MAX_NUMBER_OF_NOPS = 64; + + // DYNAMIC CONFIG + /// @dev The config for the onRamp + DynamicConfig internal s_dynamicConfig; + /// @dev (address nop => uint256 weight) + EnumerableMap.AddressToUintMap internal s_nops; + + /// @dev The execution fee token config that can be set by the owner or fee admin + mapping(address token => FeeTokenConfig feeTokenConfig) internal s_feeTokenConfig; + /// @dev The token transfer fee config that can be set by the owner or fee admin + mapping(address token => TokenTransferFeeConfig tranferFeeConfig) internal s_tokenTransferFeeConfig; + + // STATE + /// @dev The current nonce per sender. + /// The offramp has a corresponding s_senderNonce mapping to ensure messages + /// are executed in the same order they are sent. + mapping(address sender => uint64 nonce) internal s_senderNonce; + /// @dev The amount of LINK available to pay NOPS + uint96 internal s_nopFeesJuels; + /// @dev The combined weight of all NOPs weights + uint32 internal s_nopWeightsTotal; + /// @dev The last used sequence number. This is zero in the case where no + /// messages has been sent yet. 0 is not a valid sequence number for any + /// real transaction. + uint64 internal s_sequenceNumber; + + constructor( + StaticConfig memory staticConfig, + DynamicConfig memory dynamicConfig, + RateLimiter.Config memory rateLimiterConfig, + FeeTokenConfigArgs[] memory feeTokenConfigs, + TokenTransferFeeConfigArgs[] memory tokenTransferFeeConfigArgs, + NopAndWeight[] memory nopsAndWeights + ) AggregateRateLimiter(rateLimiterConfig) { + if ( + staticConfig.linkToken == address(0) || staticConfig.chainSelector == 0 || staticConfig.destChainSelector == 0 + || staticConfig.defaultTxGasLimit == 0 || staticConfig.rmnProxy == address(0) + || staticConfig.tokenAdminRegistry == address(0) + ) revert InvalidConfig(); + + i_metadataHash = keccak256( + abi.encode( + Internal.EVM_2_EVM_MESSAGE_HASH, staticConfig.chainSelector, staticConfig.destChainSelector, address(this) + ) + ); + i_linkToken = staticConfig.linkToken; + i_chainSelector = staticConfig.chainSelector; + i_destChainSelector = staticConfig.destChainSelector; + i_defaultTxGasLimit = staticConfig.defaultTxGasLimit; + i_maxNopFeesJuels = staticConfig.maxNopFeesJuels; + i_prevOnRamp = staticConfig.prevOnRamp; + i_rmnProxy = staticConfig.rmnProxy; + i_tokenAdminRegistry = staticConfig.tokenAdminRegistry; + + _setDynamicConfig(dynamicConfig); + _setFeeTokenConfig(feeTokenConfigs); + _setTokenTransferFeeConfig(tokenTransferFeeConfigArgs, new address[](0)); + _setNops(nopsAndWeights); + } + + // ================================================================ + // │ Messaging │ + // ================================================================ + + /// @inheritdoc IEVM2AnyOnRamp + function getExpectedNextSequenceNumber() external view returns (uint64) { + return s_sequenceNumber + 1; + } + + /// @inheritdoc IEVM2AnyOnRamp + function getSenderNonce(address sender) external view returns (uint64) { + uint256 senderNonce = s_senderNonce[sender]; + + if (i_prevOnRamp != address(0)) { + if (senderNonce == 0) { + // If OnRamp was upgraded, check if sender has a nonce from the previous OnRamp. + return IEVM2AnyOnRamp(i_prevOnRamp).getSenderNonce(sender); + } + } + return uint64(senderNonce); + } + + /// @inheritdoc IEVM2AnyOnRampClient + function forwardFromRouter( + uint64 destChainSelector, + Client.EVM2AnyMessage calldata message, + uint256 feeTokenAmount, + address originalSender + ) external returns (bytes32) { + if (IRMN(i_rmnProxy).isCursed(bytes16(uint128(destChainSelector)))) revert CursedByRMN(); + // Validate message sender is set and allowed. Not validated in `getFee` since it is not user-driven. + if (originalSender == address(0)) revert RouterMustSetOriginalSender(); + // Router address may be zero intentionally to pause. + if (msg.sender != s_dynamicConfig.router) revert MustBeCalledByRouter(); + if (destChainSelector != i_destChainSelector) revert InvalidChainSelector(destChainSelector); + + Client.EVMExtraArgsV2 memory extraArgs = _fromBytes(message.extraArgs); + // Validate the message with various checks + uint256 numberOfTokens = message.tokenAmounts.length; + _validateMessage(message.data.length, extraArgs.gasLimit, numberOfTokens, extraArgs.allowOutOfOrderExecution); + + // Only check token value if there are tokens + if (numberOfTokens > 0) { + uint256 value; + for (uint256 i = 0; i < numberOfTokens; ++i) { + if (message.tokenAmounts[i].amount == 0) revert CannotSendZeroTokens(); + if (s_tokenTransferFeeConfig[message.tokenAmounts[i].token].aggregateRateLimitEnabled) { + value += _getTokenValue(message.tokenAmounts[i], IPriceRegistry(s_dynamicConfig.priceRegistry)); + } + } + // Rate limit on aggregated token value + if (value > 0) _rateLimitValue(value); + } + + // Convert feeToken to link if not already in link + if (message.feeToken == i_linkToken) { + // Since there is only 1b link this is safe + s_nopFeesJuels += uint96(feeTokenAmount); + } else { + // the cast from uint256 to uint96 is considered safe, uint96 can store more than max supply of link token + s_nopFeesJuels += uint96( + IPriceRegistry(s_dynamicConfig.priceRegistry).convertTokenAmount(message.feeToken, feeTokenAmount, i_linkToken) + ); + } + if (s_nopFeesJuels > i_maxNopFeesJuels) revert MaxFeeBalanceReached(); + + // Get the current nonce if the message is an ordered message. If it's not ordered, we don't have to make the + // external call. + if (!extraArgs.allowOutOfOrderExecution) { + if (i_prevOnRamp != address(0)) { + if (s_senderNonce[originalSender] == 0) { + // If this is first time send for a sender in new OnRamp, check if they have a nonce + // from the previous OnRamp and start from there instead of zero. + s_senderNonce[originalSender] = IEVM2AnyOnRamp(i_prevOnRamp).getSenderNonce(originalSender); + } + } + } + + // We need the next available sequence number so we increment before we use the value + Internal.EVM2EVMMessage memory newMessage = Internal.EVM2EVMMessage({ + sourceChainSelector: i_chainSelector, + sender: originalSender, + // EVM destination addresses should be abi encoded and therefore always 32 bytes long + // Not duplicately validated in `getFee`. Invalid address is uncommon, gas cost outweighs UX gain. + receiver: Internal._validateEVMAddress(message.receiver), + sequenceNumber: ++s_sequenceNumber, + gasLimit: extraArgs.gasLimit, + strict: false, + // Only bump nonce for messages that specify allowOutOfOrderExecution == false. Otherwise, we + // may block ordered message nonces, which is not what we want. + nonce: extraArgs.allowOutOfOrderExecution ? 0 : ++s_senderNonce[originalSender], + feeToken: message.feeToken, + feeTokenAmount: feeTokenAmount, + data: message.data, + tokenAmounts: message.tokenAmounts, + sourceTokenData: new bytes[](numberOfTokens), // will be populated below + messageId: "" + }); + + // Lock the tokens as last step. TokenPools may not always be trusted. + // There should be no state changes after external call to TokenPools. + for (uint256 i = 0; i < numberOfTokens; ++i) { + Client.EVMTokenAmount memory tokenAndAmount = message.tokenAmounts[i]; + IPoolV1 sourcePool = getPoolBySourceToken(destChainSelector, IERC20(tokenAndAmount.token)); + // We don't have to check if it supports the pool version in a non-reverting way here because + // if we revert here, there is no effect on CCIP. Therefore we directly call the supportsInterface + // function and not through the ERC165Checker. + if (address(sourcePool) == address(0) || !sourcePool.supportsInterface(Pool.CCIP_POOL_V1)) { + revert UnsupportedToken(tokenAndAmount.token); + } + + Pool.LockOrBurnOutV1 memory poolReturnData = sourcePool.lockOrBurn( + Pool.LockOrBurnInV1({ + receiver: message.receiver, + remoteChainSelector: i_destChainSelector, + originalSender: originalSender, + amount: tokenAndAmount.amount, + localToken: tokenAndAmount.token + }) + ); + + // Since the DON has to pay for the extraData to be included on the destination chain, we cap the length of the + // extraData. This prevents gas bomb attacks on the NOPs. As destBytesOverhead accounts for both + // extraData and offchainData, this caps the worst case abuse to the number of bytes reserved for offchainData. + if (poolReturnData.destPoolData.length > Pool.CCIP_LOCK_OR_BURN_V1_RET_BYTES) { + // If TokenTransferFeeConfig.enabled is false, there is no config. That means destBytesOverhead is zero and + // this check is always true. That ensures that a pool without config cannot send more than + // Pool.CCIP_LOCK_OR_BURN_V1_RET_BYTES bytes of data. + if (poolReturnData.destPoolData.length > s_tokenTransferFeeConfig[tokenAndAmount.token].destBytesOverhead) { + revert SourceTokenDataTooLarge(tokenAndAmount.token); + } + } + + // We validate the token address to ensure it is a valid EVM address + Internal._validateEVMAddress(poolReturnData.destTokenAddress); + + newMessage.sourceTokenData[i] = abi.encode( + Internal.SourceTokenData({ + sourcePoolAddress: abi.encode(sourcePool), + destTokenAddress: poolReturnData.destTokenAddress, + extraData: poolReturnData.destPoolData, + // The user will be billed either the default or the override, so we send the exact amount that we billed for + // to the destination chain to be used for the token releaseOrMint and transfer. + destGasAmount: s_tokenTransferFeeConfig[tokenAndAmount.token].isEnabled + ? s_tokenTransferFeeConfig[tokenAndAmount.token].destGasOverhead + : s_dynamicConfig.defaultTokenDestGasOverhead + }) + ); + } + + // Hash only after the sourceTokenData has been set + newMessage.messageId = Internal._hash(newMessage, i_metadataHash); + + // Emit message request + // This must happen after any pool events as some tokens (e.g. USDC) emit events that we expect to precede this + // event in the offchain code. + emit CCIPSendRequested(newMessage); + return newMessage.messageId; + } + + /// @dev Convert the extra args bytes into a struct + /// @param extraArgs The extra args bytes + /// @return The extra args struct + function _fromBytes(bytes calldata extraArgs) internal view returns (Client.EVMExtraArgsV2 memory) { + if (extraArgs.length == 0) { + return Client.EVMExtraArgsV2({gasLimit: i_defaultTxGasLimit, allowOutOfOrderExecution: false}); + } + + bytes4 extraArgsTag = bytes4(extraArgs); + if (extraArgsTag == Client.EVM_EXTRA_ARGS_V2_TAG) { + return abi.decode(extraArgs[4:], (Client.EVMExtraArgsV2)); + } else if (extraArgsTag == Client.EVM_EXTRA_ARGS_V1_TAG) { + // EVMExtraArgsV1 originally included a second boolean (strict) field which has been deprecated. + // Clients may still include it but it will be ignored. + return Client.EVMExtraArgsV2({gasLimit: abi.decode(extraArgs[4:], (uint256)), allowOutOfOrderExecution: false}); + } + + revert InvalidExtraArgsTag(); + } + + /// @notice Validate the forwarded message with various checks. + /// @dev This function can be called multiple times during a CCIPSend, + /// only common user-driven mistakes are validated here to minimize duplicate validation cost. + /// @param dataLength The length of the data field of the message. + /// @param gasLimit The gasLimit set in message for destination execution. + /// @param numberOfTokens The number of tokens to be sent. + function _validateMessage( + uint256 dataLength, + uint256 gasLimit, + uint256 numberOfTokens, + bool allowOutOfOrderExecution + ) internal view { + uint256 maxDataBytes = uint256(s_dynamicConfig.maxDataBytes); + if (dataLength > maxDataBytes) revert MessageTooLarge(maxDataBytes, dataLength); + if (gasLimit > uint256(s_dynamicConfig.maxPerMsgGasLimit)) revert MessageGasLimitTooHigh(); + if (numberOfTokens > uint256(s_dynamicConfig.maxNumberOfTokensPerMsg)) revert UnsupportedNumberOfTokens(); + if (!allowOutOfOrderExecution) { + if (s_dynamicConfig.enforceOutOfOrder) { + revert ExtraArgOutOfOrderExecutionMustBeTrue(); + } + } + } + + // ================================================================ + // │ Config │ + // ================================================================ + + /// @notice Returns the static onRamp config. + /// @dev RMN depends on this function, if changing, please notify the RMN maintainers. + /// @return the configuration. + function getStaticConfig() external view returns (StaticConfig memory) { + return StaticConfig({ + linkToken: i_linkToken, + chainSelector: i_chainSelector, + destChainSelector: i_destChainSelector, + defaultTxGasLimit: i_defaultTxGasLimit, + maxNopFeesJuels: i_maxNopFeesJuels, + prevOnRamp: i_prevOnRamp, + rmnProxy: i_rmnProxy, + tokenAdminRegistry: i_tokenAdminRegistry + }); + } + + /// @notice Returns the dynamic onRamp config. + /// @return dynamicConfig the configuration. + function getDynamicConfig() external view returns (DynamicConfig memory dynamicConfig) { + return s_dynamicConfig; + } + + /// @notice Sets the dynamic configuration. + /// @param dynamicConfig The configuration. + function setDynamicConfig(DynamicConfig memory dynamicConfig) external onlyOwner { + _setDynamicConfig(dynamicConfig); + } + + /// @notice Internal version of setDynamicConfig to allow for reuse in the constructor. + function _setDynamicConfig(DynamicConfig memory dynamicConfig) internal { + // We permit router to be set to zero as a way to pause the contract. + if (dynamicConfig.priceRegistry == address(0)) revert InvalidConfig(); + s_dynamicConfig = dynamicConfig; + + emit ConfigSet( + StaticConfig({ + linkToken: i_linkToken, + chainSelector: i_chainSelector, + destChainSelector: i_destChainSelector, + defaultTxGasLimit: i_defaultTxGasLimit, + maxNopFeesJuels: i_maxNopFeesJuels, + prevOnRamp: i_prevOnRamp, + rmnProxy: i_rmnProxy, + tokenAdminRegistry: i_tokenAdminRegistry + }), + dynamicConfig + ); + } + + // ================================================================ + // │ Tokens and pools │ + // ================================================================ + + /// @inheritdoc IEVM2AnyOnRampClient + function getPoolBySourceToken(uint64, /*destChainSelector*/ IERC20 sourceToken) public view returns (IPoolV1) { + return IPoolV1(ITokenAdminRegistry(i_tokenAdminRegistry).getPool(address(sourceToken))); + } + + /// @inheritdoc IEVM2AnyOnRampClient + function getSupportedTokens(uint64) external pure returns (address[] memory) { + revert GetSupportedTokensFunctionalityRemovedCheckAdminRegistry(); + } + + // ================================================================ + // │ Fees │ + // ================================================================ + + /// @inheritdoc IEVM2AnyOnRampClient + /// @dev getFee MUST revert if the feeToken is not listed in the fee token config, as the router assumes it does. + /// @param destChainSelector The destination chain selector. + /// @param message The message to get quote for. + /// @return feeTokenAmount The amount of fee token needed for the fee, in smallest denomination of the fee token. + function getFee( + uint64 destChainSelector, + Client.EVM2AnyMessage calldata message + ) external view returns (uint256 feeTokenAmount) { + if (destChainSelector != i_destChainSelector) revert InvalidChainSelector(destChainSelector); + + Client.EVMExtraArgsV2 memory extraArgs = _fromBytes(message.extraArgs); + // Validate the message with various checks + _validateMessage( + message.data.length, extraArgs.gasLimit, message.tokenAmounts.length, extraArgs.allowOutOfOrderExecution + ); + + FeeTokenConfig memory feeTokenConfig = s_feeTokenConfig[message.feeToken]; + if (!feeTokenConfig.enabled) revert NotAFeeToken(message.feeToken); + + (uint224 feeTokenPrice, uint224 packedGasPrice) = + IPriceRegistry(s_dynamicConfig.priceRegistry).getTokenAndGasPrices(message.feeToken, destChainSelector); + + // Calculate premiumFee in USD with 18 decimals precision first. + // If message-only and no token transfers, a flat network fee is charged. + // If there are token transfers, premiumFee is calculated from token transfer fee. + // If there are both token transfers and message, premiumFee is only calculated from token transfer fee. + uint256 premiumFee = 0; + uint32 tokenTransferGas = 0; + uint32 tokenTransferBytesOverhead = 0; + if (message.tokenAmounts.length > 0) { + (premiumFee, tokenTransferGas, tokenTransferBytesOverhead) = + _getTokenTransferCost(message.feeToken, feeTokenPrice, message.tokenAmounts); + } else { + // Convert USD cents with 2 decimals to 18 decimals. + premiumFee = uint256(feeTokenConfig.networkFeeUSDCents) * 1e16; + } + + // Calculate data availability cost in USD with 36 decimals. Data availability cost exists on rollups that need to post + // transaction calldata onto another storage layer, e.g. Eth mainnet, incurring additional storage gas costs. + uint256 dataAvailabilityCost = 0; + // Only calculate data availability cost if data availability multiplier is non-zero. + // The multiplier should be set to 0 if destination chain does not charge data availability cost. + if (s_dynamicConfig.destDataAvailabilityMultiplierBps > 0) { + dataAvailabilityCost = _getDataAvailabilityCost( + // Parse the data availability gas price stored in the higher-order 112 bits of the encoded gas price. + uint112(packedGasPrice >> Internal.GAS_PRICE_BITS), + message.data.length, + message.tokenAmounts.length, + tokenTransferBytesOverhead + ); + } + + // Calculate execution gas fee on destination chain in USD with 36 decimals. + // We add the message gas limit, the overhead gas, the gas of passing message data to receiver, and token transfer gas together. + // We then multiply this gas total with the gas multiplier and gas price, converting it into USD with 36 decimals. + // uint112(packedGasPrice) = executionGasPrice + uint256 executionCost = uint112(packedGasPrice) + * ( + extraArgs.gasLimit + s_dynamicConfig.destGasOverhead + + (message.data.length * s_dynamicConfig.destGasPerPayloadByte) + tokenTransferGas + ) * feeTokenConfig.gasMultiplierWeiPerEth; + + // Calculate number of fee tokens to charge. + // Total USD fee is in 36 decimals, feeTokenPrice is in 18 decimals USD for 1e18 smallest token denominations. + // Result of the division is the number of smallest token denominations. + return + ((premiumFee * feeTokenConfig.premiumMultiplierWeiPerEth) + executionCost + dataAvailabilityCost) / feeTokenPrice; + } + + /// @notice Returns the estimated data availability cost of the message. + /// @dev To save on gas, we use a single destGasPerDataAvailabilityByte value for both zero and non-zero bytes. + /// @param dataAvailabilityGasPrice USD per data availability gas in 18 decimals. + /// @param messageDataLength length of the data field in the message. + /// @param numberOfTokens number of distinct token transfers in the message. + /// @param tokenTransferBytesOverhead additional token transfer data passed to destination, e.g. USDC attestation. + /// @return dataAvailabilityCostUSD36Decimal total data availability cost in USD with 36 decimals. + function _getDataAvailabilityCost( + uint112 dataAvailabilityGasPrice, + uint256 messageDataLength, + uint256 numberOfTokens, + uint32 tokenTransferBytesOverhead + ) internal view returns (uint256 dataAvailabilityCostUSD36Decimal) { + // dataAvailabilityLengthBytes sums up byte lengths of fixed message fields and dynamic message fields. + // Fixed message fields do account for the offset and length slot of the dynamic fields. + uint256 dataAvailabilityLengthBytes = Internal.MESSAGE_FIXED_BYTES + messageDataLength + + (numberOfTokens * Internal.MESSAGE_FIXED_BYTES_PER_TOKEN) + tokenTransferBytesOverhead; + + // destDataAvailabilityOverheadGas is a separate config value for flexibility to be updated independently of message cost. + // Its value is determined by CCIP lane implementation, e.g. the overhead data posted for OCR. + uint256 dataAvailabilityGas = (dataAvailabilityLengthBytes * s_dynamicConfig.destGasPerDataAvailabilityByte) + + s_dynamicConfig.destDataAvailabilityOverheadGas; + + // dataAvailabilityGasPrice is in 18 decimals, destDataAvailabilityMultiplierBps is in 4 decimals + // We pad 14 decimals to bring the result to 36 decimals, in line with token bps and execution fee. + return ((dataAvailabilityGas * dataAvailabilityGasPrice) * s_dynamicConfig.destDataAvailabilityMultiplierBps) * 1e14; + } + + /// @notice Returns the token transfer cost parameters. + /// A basis point fee is calculated from the USD value of each token transfer. + /// For each individual transfer, this fee is between [minFeeUSD, maxFeeUSD]. + /// Total transfer fee is the sum of each individual token transfer fee. + /// @dev Assumes that tokenAmounts are validated to be listed tokens elsewhere. + /// @dev Splitting one token transfer into multiple transfers is discouraged, + /// as it will result in a transferFee equal or greater than the same amount aggregated/de-duped. + /// @param feeToken address of the feeToken. + /// @param feeTokenPrice price of feeToken in USD with 18 decimals. + /// @param tokenAmounts token transfers in the message. + /// @return tokenTransferFeeUSDWei total token transfer bps fee in USD with 18 decimals. + /// @return tokenTransferGas total execution gas of the token transfers. + /// @return tokenTransferBytesOverhead additional token transfer data passed to destination, e.g. USDC attestation. + function _getTokenTransferCost( + address feeToken, + uint224 feeTokenPrice, + Client.EVMTokenAmount[] calldata tokenAmounts + ) internal view returns (uint256 tokenTransferFeeUSDWei, uint32 tokenTransferGas, uint32 tokenTransferBytesOverhead) { + uint256 numberOfTokens = tokenAmounts.length; + + for (uint256 i = 0; i < numberOfTokens; ++i) { + Client.EVMTokenAmount memory tokenAmount = tokenAmounts[i]; + + // Validate if the token is supported, do not calculate fee for unsupported tokens. + if (address(getPoolBySourceToken(i_destChainSelector, IERC20(tokenAmount.token))) == address(0)) { + revert UnsupportedToken(tokenAmount.token); + } + + TokenTransferFeeConfig memory transferFeeConfig = s_tokenTransferFeeConfig[tokenAmount.token]; + + // If the token has no specific overrides configured, we use the global defaults. + if (!transferFeeConfig.isEnabled) { + tokenTransferFeeUSDWei += uint256(s_dynamicConfig.defaultTokenFeeUSDCents) * 1e16; + tokenTransferGas += s_dynamicConfig.defaultTokenDestGasOverhead; + tokenTransferBytesOverhead += Pool.CCIP_POOL_V1_RET_BYTES; + continue; + } + + uint256 bpsFeeUSDWei = 0; + // Only calculate bps fee if ratio is greater than 0. Ratio of 0 means no bps fee for a token. + // Useful for when the PriceRegistry cannot return a valid price for the token. + if (transferFeeConfig.deciBps > 0) { + uint224 tokenPrice = 0; + if (tokenAmount.token != feeToken) { + tokenPrice = IPriceRegistry(s_dynamicConfig.priceRegistry).getValidatedTokenPrice(tokenAmount.token); + } else { + tokenPrice = feeTokenPrice; + } + + // Calculate token transfer value, then apply fee ratio + // ratio represents multiples of 0.1bps, or 1e-5 + bpsFeeUSDWei = (tokenPrice._calcUSDValueFromTokenAmount(tokenAmount.amount) * transferFeeConfig.deciBps) / 1e5; + } + + tokenTransferGas += transferFeeConfig.destGasOverhead; + tokenTransferBytesOverhead += transferFeeConfig.destBytesOverhead; + + // Bps fees should be kept within range of [minFeeUSD, maxFeeUSD]. + // Convert USD values with 2 decimals to 18 decimals. + uint256 minFeeUSDWei = uint256(transferFeeConfig.minFeeUSDCents) * 1e16; + if (bpsFeeUSDWei < minFeeUSDWei) { + tokenTransferFeeUSDWei += minFeeUSDWei; + continue; + } + + uint256 maxFeeUSDWei = uint256(transferFeeConfig.maxFeeUSDCents) * 1e16; + if (bpsFeeUSDWei > maxFeeUSDWei) { + tokenTransferFeeUSDWei += maxFeeUSDWei; + continue; + } + + tokenTransferFeeUSDWei += bpsFeeUSDWei; + } + + return (tokenTransferFeeUSDWei, tokenTransferGas, tokenTransferBytesOverhead); + } + + /// @notice Gets the fee configuration for a token + /// @param token The token to get the fee configuration for + /// @return feeTokenConfig FeeTokenConfig struct + function getFeeTokenConfig(address token) external view returns (FeeTokenConfig memory feeTokenConfig) { + return s_feeTokenConfig[token]; + } + + /// @notice Sets the fee configuration for a token + /// @param feeTokenConfigArgs Array of FeeTokenConfigArgs structs. + function setFeeTokenConfig(FeeTokenConfigArgs[] memory feeTokenConfigArgs) external { + _onlyOwnerOrAdmin(); + _setFeeTokenConfig(feeTokenConfigArgs); + } + + /// @dev Set the fee config + /// @param feeTokenConfigArgs The fee token configs. + function _setFeeTokenConfig(FeeTokenConfigArgs[] memory feeTokenConfigArgs) internal { + for (uint256 i = 0; i < feeTokenConfigArgs.length; ++i) { + FeeTokenConfigArgs memory configArg = feeTokenConfigArgs[i]; + + s_feeTokenConfig[configArg.token] = FeeTokenConfig({ + networkFeeUSDCents: configArg.networkFeeUSDCents, + gasMultiplierWeiPerEth: configArg.gasMultiplierWeiPerEth, + premiumMultiplierWeiPerEth: configArg.premiumMultiplierWeiPerEth, + enabled: configArg.enabled + }); + } + emit FeeConfigSet(feeTokenConfigArgs); + } + + /// @notice Gets the transfer fee config for a given token. + function getTokenTransferFeeConfig( + address token + ) external view returns (TokenTransferFeeConfig memory tokenTransferFeeConfig) { + return s_tokenTransferFeeConfig[token]; + } + + /// @notice Sets the transfer fee config. + /// @dev only callable by the owner or admin. + function setTokenTransferFeeConfig( + TokenTransferFeeConfigArgs[] memory tokenTransferFeeConfigArgs, + address[] memory tokensToUseDefaultFeeConfigs + ) external { + _onlyOwnerOrAdmin(); + _setTokenTransferFeeConfig(tokenTransferFeeConfigArgs, tokensToUseDefaultFeeConfigs); + } + + /// @notice internal helper to set the token transfer fee config. + function _setTokenTransferFeeConfig( + TokenTransferFeeConfigArgs[] memory tokenTransferFeeConfigArgs, + address[] memory tokensToUseDefaultFeeConfigs + ) internal { + for (uint256 i = 0; i < tokenTransferFeeConfigArgs.length; ++i) { + TokenTransferFeeConfigArgs memory configArg = tokenTransferFeeConfigArgs[i]; + + if (configArg.destBytesOverhead < Pool.CCIP_LOCK_OR_BURN_V1_RET_BYTES) { + revert InvalidDestBytesOverhead(configArg.token, configArg.destBytesOverhead); + } + + s_tokenTransferFeeConfig[configArg.token] = TokenTransferFeeConfig({ + minFeeUSDCents: configArg.minFeeUSDCents, + maxFeeUSDCents: configArg.maxFeeUSDCents, + deciBps: configArg.deciBps, + destGasOverhead: configArg.destGasOverhead, + destBytesOverhead: configArg.destBytesOverhead, + aggregateRateLimitEnabled: configArg.aggregateRateLimitEnabled, + isEnabled: true + }); + } + emit TokenTransferFeeConfigSet(tokenTransferFeeConfigArgs); + + // Remove the custom fee configs for the tokens that are in the tokensToUseDefaultFeeConfigs array + for (uint256 i = 0; i < tokensToUseDefaultFeeConfigs.length; ++i) { + delete s_tokenTransferFeeConfig[tokensToUseDefaultFeeConfigs[i]]; + } + if (tokensToUseDefaultFeeConfigs.length > 0) { + emit TokenTransferFeeConfigDeleted(tokensToUseDefaultFeeConfigs); + } + } + + // ================================================================ + // │ NOP payments │ + // ================================================================ + + /// @notice Get the total amount of fees to be paid to the Nops (in LINK) + /// @return totalNopFees + function getNopFeesJuels() external view returns (uint96) { + return s_nopFeesJuels; + } + + /// @notice Gets the Nops and their weights + /// @return nopsAndWeights Array of NopAndWeight structs + /// @return weightsTotal The sum weight of all Nops + function getNops() external view returns (NopAndWeight[] memory nopsAndWeights, uint256 weightsTotal) { + uint256 length = s_nops.length(); + nopsAndWeights = new NopAndWeight[](length); + for (uint256 i = 0; i < length; ++i) { + (address nopAddress, uint256 nopWeight) = s_nops.at(i); + nopsAndWeights[i] = NopAndWeight({nop: nopAddress, weight: uint16(nopWeight)}); + } + weightsTotal = s_nopWeightsTotal; + return (nopsAndWeights, weightsTotal); + } + + /// @notice Sets the Nops and their weights + /// @param nopsAndWeights Array of NopAndWeight structs + function setNops(NopAndWeight[] calldata nopsAndWeights) external { + _onlyOwnerOrAdmin(); + _setNops(nopsAndWeights); + } + + /// @param nopsAndWeights New set of nops and weights + /// @dev Clears existing nops, sets new nops and weights + /// @dev We permit fees to accrue before nops are configured, in which case + /// they will go to the first set of configured nops. + function _setNops(NopAndWeight[] memory nopsAndWeights) internal { + uint256 numberOfNops = nopsAndWeights.length; + if (numberOfNops > MAX_NUMBER_OF_NOPS) revert TooManyNops(); + + // Make sure all nops have been paid before removing nops + // We only have to pay when there are nops and there is enough + // outstanding NOP balance to trigger a payment. + if (s_nopWeightsTotal > 0) { + if (s_nopFeesJuels >= s_nopWeightsTotal) { + payNops(); + } + } + + // Remove all previous nops, move from end to start to avoid shifting + for (uint256 i = s_nops.length(); i > 0; --i) { + (address nop,) = s_nops.at(i - 1); + s_nops.remove(nop); + } + + // Add new + uint32 nopWeightsTotal = 0; + // nopWeightsTotal is bounded by the MAX_NUMBER_OF_NOPS and the weight of + // a single nop being of type uint16. This ensures nopWeightsTotal will + // always fit into the uint32 type. + for (uint256 i = 0; i < numberOfNops; ++i) { + // Make sure the LINK token is not a nop because the link token doesn't allow + // self transfers. If set as nop, payNops would always revert. Since setNops + // calls payNops, we can never remove the LINK token as a nop. + address nop = nopsAndWeights[i].nop; + uint16 weight = nopsAndWeights[i].weight; + if (nop == i_linkToken || nop == address(0)) revert InvalidNopAddress(nop); + s_nops.set(nop, weight); + nopWeightsTotal += weight; + } + s_nopWeightsTotal = nopWeightsTotal; + emit NopsSet(nopWeightsTotal, nopsAndWeights); + } + + /// @notice Pays the Node Ops their outstanding balances. + /// @dev some balance can remain after payments are done. This is at most the sum + /// of the weight of all nops. Since nop weights are uint16s and we can have at + /// most MAX_NUMBER_OF_NOPS NOPs, the highest possible value is 2**22 or 0.04 gjuels. + function payNops() public { + if (msg.sender != owner()) { + if (msg.sender != s_admin) { + if (!s_nops.contains(msg.sender)) { + revert OnlyCallableByOwnerOrAdminOrNop(); + } + } + } + uint256 weightsTotal = s_nopWeightsTotal; + if (weightsTotal == 0) revert NoNopsToPay(); + + uint96 totalFeesToPay = s_nopFeesJuels; + if (totalFeesToPay < weightsTotal) revert NoFeesToPay(); + if (linkAvailableForPayment() < 0) revert InsufficientBalance(); + + uint96 fundsLeft = totalFeesToPay; + uint256 numberOfNops = s_nops.length(); + for (uint256 i = 0; i < numberOfNops; ++i) { + (address nop, uint256 weight) = s_nops.at(i); + // amount can never be higher than totalFeesToPay so the cast to uint96 is safe + uint96 amount = uint96((totalFeesToPay * weight) / weightsTotal); + fundsLeft -= amount; + IERC20(i_linkToken).safeTransfer(nop, amount); + emit NopPaid(nop, amount); + } + // Some funds can remain, since this is an incredibly small + // amount we consider this OK. + s_nopFeesJuels = fundsLeft; + } + + /// @notice Allows the owner to withdraw any ERC20 token from the contract. + /// The NOP link balance is not withdrawable. + /// @param feeToken The token to withdraw + /// @param to The address to send the tokens to + function withdrawNonLinkFees(address feeToken, address to) external { + _onlyOwnerOrAdmin(); + if (to == address(0)) revert InvalidWithdrawParams(); + + // We require the link balance to be settled before allowing withdrawal of non-link fees. + int256 linkAfterNopFees = linkAvailableForPayment(); + if (linkAfterNopFees < 0) revert LinkBalanceNotSettled(); + + if (feeToken == i_linkToken) { + // Withdraw only the left over link balance + IERC20(feeToken).safeTransfer(to, uint256(linkAfterNopFees)); + } else { + // Withdrawal all non-link tokens in the contract + IERC20(feeToken).safeTransfer(to, IERC20(feeToken).balanceOf(address(this))); + } + } + + // ================================================================ + // │ Link monitoring │ + // ================================================================ + + /// @notice Calculate remaining LINK balance after paying nops + /// @dev Allow keeper to monitor funds available for paying nops + /// @return balance if nops were to be paid + function linkAvailableForPayment() public view returns (int256) { + // Since LINK caps at uint96, casting to int256 is safe + return int256(IERC20(i_linkToken).balanceOf(address(this))) - int256(uint256(s_nopFeesJuels)); + } + + // ================================================================ + // │ Access │ + // ================================================================ + + /// @dev Require that the sender is the owner or the fee admin + /// Not a modifier to save on contract size + function _onlyOwnerOrAdmin() internal view { + if (msg.sender != owner()) { + if (msg.sender != s_admin) { + revert OnlyCallableByOwnerOrAdmin(); + } + } + } +} diff --git a/contracts/src/v0.8/ccip/onRamp/OnRamp.sol b/contracts/src/v0.8/ccip/onRamp/OnRamp.sol new file mode 100644 index 00000000000..cc449feaed6 --- /dev/null +++ b/contracts/src/v0.8/ccip/onRamp/OnRamp.sol @@ -0,0 +1,486 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {ITypeAndVersion} from "../../shared/interfaces/ITypeAndVersion.sol"; +import {IEVM2AnyOnRampClient} from "../interfaces/IEVM2AnyOnRampClient.sol"; +import {IFeeQuoter} from "../interfaces/IFeeQuoter.sol"; +import {IMessageInterceptor} from "../interfaces/IMessageInterceptor.sol"; +import {INonceManager} from "../interfaces/INonceManager.sol"; +import {IPoolV1} from "../interfaces/IPool.sol"; +import {IRMNV2} from "../interfaces/IRMNV2.sol"; +import {IRouter} from "../interfaces/IRouter.sol"; +import {ITokenAdminRegistry} from "../interfaces/ITokenAdminRegistry.sol"; + +import {OwnerIsCreator} from "../../shared/access/OwnerIsCreator.sol"; +import {Client} from "../libraries/Client.sol"; +import {Internal} from "../libraries/Internal.sol"; +import {Pool} from "../libraries/Pool.sol"; +import {USDPriceWith18Decimals} from "../libraries/USDPriceWith18Decimals.sol"; + +import {IERC20} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/IERC20.sol"; +import {SafeERC20} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/utils/SafeERC20.sol"; +import {EnumerableSet} from "../../vendor/openzeppelin-solidity/v5.0.2/contracts/utils/structs/EnumerableSet.sol"; + +/// @notice The OnRamp is a contract that handles lane-specific fee logic +/// @dev The OnRamp and OffRamp form an xchain upgradeable unit. Any change to one of them +/// results in an onchain upgrade of all 3. +contract OnRamp is IEVM2AnyOnRampClient, ITypeAndVersion, OwnerIsCreator { + using SafeERC20 for IERC20; + using EnumerableSet for EnumerableSet.AddressSet; + using USDPriceWith18Decimals for uint224; + + error CannotSendZeroTokens(); + error UnsupportedToken(address token); + error MustBeCalledByRouter(); + error RouterMustSetOriginalSender(); + error InvalidConfig(); + error CursedByRMN(uint64 sourceChainSelector); + error GetSupportedTokensFunctionalityRemovedCheckAdminRegistry(); + error InvalidDestChainConfig(uint64 sourceChainSelector); + error OnlyCallableByOwnerOrAllowlistAdmin(); + error SenderNotAllowed(address sender); + error InvalidAllowListRequest(uint64 destChainSelector); + + event ConfigSet(StaticConfig staticConfig, DynamicConfig dynamicConfig); + event DestChainConfigSet( + uint64 indexed destChainSelector, uint64 sequenceNumber, IRouter router, bool allowListEnabled + ); + event FeePaid(address indexed feeToken, uint256 feeValueJuels); + event FeeTokenWithdrawn(address indexed feeAggregator, address indexed feeToken, uint256 amount); + /// RMN depends on this event, if changing, please notify the RMN maintainers. + event CCIPMessageSent(uint64 indexed destChainSelector, Internal.EVM2AnyRampMessage message); + event AllowListAdminSet(address indexed allowListAdmin); + event AllowListSendersAdded(uint64 indexed destChainSelector, address[] senders); + event AllowListSendersRemoved(uint64 indexed destChainSelector, address[] senders); + + /// @dev Struct that contains the static configuration + /// RMN depends on this struct, if changing, please notify the RMN maintainers. + // solhint-disable-next-line gas-struct-packing + struct StaticConfig { + uint64 chainSelector; // ─────╮ Source chain selector + IRMNV2 rmn; // ───────────────╯ RMN remote address + address nonceManager; // Nonce manager address + address tokenAdminRegistry; // Token admin registry address + } + + /// @dev Struct that contains the dynamic configuration + // solhint-disable-next-line gas-struct-packing + struct DynamicConfig { + address feeQuoter; // FeeQuoter address + address messageValidator; // Optional message validator to validate outbound messages (zero address = no validator) + address feeAggregator; // Fee aggregator address + address allowListAdmin; // authorized admin to add or remove allowed senders + } + + /// @dev Struct to hold the configs for a destination chain + /// @dev sequenceNumber, allowListEnabled, router will all be packed in 1 slot + struct DestChainConfig { + // The last used sequence number. This is zero in the case where no messages have yet been sent. + // 0 is not a valid sequence number for any real transaction. + uint64 sequenceNumber; // ──────╮ The last used sequence number + bool allowListEnabled; // │ boolean indicator to specify if allowList check is enabled + IRouter router; // ─────────────╯ Local router address that is allowed to send messages to the destination chain. + // This is the list of addresses allowed to send messages from onRamp + EnumerableSet.AddressSet allowedSendersList; + } + + /// @dev Same as DestChainConfig but with the destChainSelector so that an array of these + /// can be passed in the constructor and the applyDestChainConfigUpdates function + //solhint-disable gas-struct-packing + struct DestChainConfigArgs { + uint64 destChainSelector; // Destination chain selector + IRouter router; // Source router address + } + + /// @dev Struct used to apply AllowList Senders for multiple destChainSelectors + /// @dev the senders in the AllowlistedSenders here is the user that sends the message + /// @dev the config restricts the chain to allow only allowedList of senders to send message from this chain to a destChainSelector + /// @dev destChainSelector, allowListEnabled will be packed in 1 slot + //solhint-disable gas-struct-packing + struct AllowListConfigArgs { + uint64 destChainSelector; // ─────────────╮ Destination chain selector + // │ destChainSelector and allowListEnabled are packed in the same slot + bool allowListEnabled; // ────────────────╯ boolean indicator to specify if allowList check is enabled. + address[] addedAllowlistedSenders; // list of senders to be added to the allowedSendersList + address[] removedAllowlistedSenders; // list of senders to be removed from the allowedSendersList + } + + // STATIC CONFIG + string public constant override typeAndVersion = "OnRamp 1.6.0-dev"; + /// @dev The chain ID of the source chain that this contract is deployed to + uint64 internal immutable i_chainSelector; + /// @dev The rmn contract + IRMNV2 internal immutable i_rmn; + /// @dev The address of the nonce manager + address internal immutable i_nonceManager; + /// @dev The address of the token admin registry + address internal immutable i_tokenAdminRegistry; + + // DYNAMIC CONFIG + /// @dev The dynamic config for the onRamp + DynamicConfig internal s_dynamicConfig; + + /// @dev The destination chain specific configs + mapping(uint64 destChainSelector => DestChainConfig destChainConfig) internal s_destChainConfigs; + + constructor( + StaticConfig memory staticConfig, + DynamicConfig memory dynamicConfig, + DestChainConfigArgs[] memory destChainConfigArgs + ) { + if ( + staticConfig.chainSelector == 0 || address(staticConfig.rmn) == address(0) + || staticConfig.nonceManager == address(0) || staticConfig.tokenAdminRegistry == address(0) + ) { + revert InvalidConfig(); + } + + i_chainSelector = staticConfig.chainSelector; + i_rmn = staticConfig.rmn; + i_nonceManager = staticConfig.nonceManager; + i_tokenAdminRegistry = staticConfig.tokenAdminRegistry; + + _setDynamicConfig(dynamicConfig); + _applyDestChainConfigUpdates(destChainConfigArgs); + } + + // ================================================================ + // │ Messaging │ + // ================================================================ + + /// @notice Gets the next sequence number to be used in the onRamp + /// @param destChainSelector The destination chain selector + /// @return nextSequenceNumber The next sequence number to be used + function getExpectedNextSequenceNumber(uint64 destChainSelector) external view returns (uint64) { + return s_destChainConfigs[destChainSelector].sequenceNumber + 1; + } + + /// @inheritdoc IEVM2AnyOnRampClient + function forwardFromRouter( + uint64 destChainSelector, + Client.EVM2AnyMessage calldata message, + uint256 feeTokenAmount, + address originalSender + ) external returns (bytes32) { + DestChainConfig storage destChainConfig = s_destChainConfigs[destChainSelector]; + + // NOTE: assumes the message has already been validated through the getFee call + // Validate message sender is set and allowed. Not validated in `getFee` since it is not user-driven. + if (originalSender == address(0)) revert RouterMustSetOriginalSender(); + + if (destChainConfig.allowListEnabled) { + if (!destChainConfig.allowedSendersList.contains(originalSender)) { + revert SenderNotAllowed(originalSender); + } + } + + // Router address may be zero intentionally to pause. + if (msg.sender != address(destChainConfig.router)) revert MustBeCalledByRouter(); + + { + // scoped to reduce stack usage + address messageValidator = s_dynamicConfig.messageValidator; + if (messageValidator != address(0)) { + IMessageInterceptor(messageValidator).onOutboundMessage(destChainSelector, message); + } + } + + // Convert message fee to juels and retrieve converted args + (uint256 msgFeeJuels, bool isOutOfOrderExecution, bytes memory convertedExtraArgs) = IFeeQuoter( + s_dynamicConfig.feeQuoter + ).processMessageArgs(destChainSelector, message.feeToken, feeTokenAmount, message.extraArgs); + + emit FeePaid(message.feeToken, msgFeeJuels); + + Internal.EVM2AnyRampMessage memory newMessage = Internal.EVM2AnyRampMessage({ + header: Internal.RampMessageHeader({ + // Should be generated after the message is complete + messageId: "", + sourceChainSelector: i_chainSelector, + destChainSelector: destChainSelector, + // We need the next available sequence number so we increment before we use the value + sequenceNumber: ++destChainConfig.sequenceNumber, + // Only bump nonce for messages that specify allowOutOfOrderExecution == false. Otherwise, we + // may block ordered message nonces, which is not what we want. + nonce: isOutOfOrderExecution + ? 0 + : INonceManager(i_nonceManager).getIncrementedOutboundNonce(destChainSelector, originalSender) + }), + sender: originalSender, + data: message.data, + extraArgs: convertedExtraArgs, + receiver: message.receiver, + feeToken: message.feeToken, + feeTokenAmount: feeTokenAmount, + // Should be populated via lock / burn pool calls + tokenAmounts: new Internal.RampTokenAmount[](message.tokenAmounts.length) + }); + + // Lock / burn the tokens as last step. TokenPools may not always be trusted. + // There should be no state changes after external call to TokenPools. + for (uint256 i = 0; i < message.tokenAmounts.length; ++i) { + newMessage.tokenAmounts[i] = + _lockOrBurnSingleToken(message.tokenAmounts[i], destChainSelector, message.receiver, originalSender); + } + + // Validate pool return data after it is populated (view function - no state changes) + bytes[] memory destExecDataPerToken = IFeeQuoter(s_dynamicConfig.feeQuoter).processPoolReturnData( + destChainSelector, newMessage.tokenAmounts, message.tokenAmounts + ); + + for (uint256 i = 0; i < newMessage.tokenAmounts.length; ++i) { + newMessage.tokenAmounts[i].destExecData = destExecDataPerToken[i]; + } + + // Hash only after all fields have been set + newMessage.header.messageId = Internal._hash( + newMessage, + // Metadata hash preimage to ensure global uniqueness, ensuring 2 identical messages sent to 2 different + // lanes will have a distinct hash. + keccak256(abi.encode(Internal.EVM_2_ANY_MESSAGE_HASH, i_chainSelector, destChainSelector, address(this))) + ); + + // Emit message request + // This must happen after any pool events as some tokens (e.g. USDC) emit events that we expect to precede this + // event in the offchain code. + emit CCIPMessageSent(destChainSelector, newMessage); + return newMessage.header.messageId; + } + + /// @notice Uses a pool to lock or burn a token + /// @param tokenAndAmount Token address and amount to lock or burn + /// @param destChainSelector Target destination chain selector of the message + /// @param receiver Message receiver + /// @param originalSender Message sender + /// @return rampTokenAmount Ramp token and amount data + function _lockOrBurnSingleToken( + Client.EVMTokenAmount memory tokenAndAmount, + uint64 destChainSelector, + bytes memory receiver, + address originalSender + ) internal returns (Internal.RampTokenAmount memory) { + if (tokenAndAmount.amount == 0) revert CannotSendZeroTokens(); + + IPoolV1 sourcePool = getPoolBySourceToken(destChainSelector, IERC20(tokenAndAmount.token)); + // We don't have to check if it supports the pool version in a non-reverting way here because + // if we revert here, there is no effect on CCIP. Therefore we directly call the supportsInterface + // function and not through the ERC165Checker. + if (address(sourcePool) == address(0) || !sourcePool.supportsInterface(Pool.CCIP_POOL_V1)) { + revert UnsupportedToken(tokenAndAmount.token); + } + + Pool.LockOrBurnOutV1 memory poolReturnData = sourcePool.lockOrBurn( + Pool.LockOrBurnInV1({ + receiver: receiver, + remoteChainSelector: destChainSelector, + originalSender: originalSender, + amount: tokenAndAmount.amount, + localToken: tokenAndAmount.token + }) + ); + + // NOTE: pool data validations are outsourced to the FeeQuoter to handle family-specific logic handling + return Internal.RampTokenAmount({ + sourcePoolAddress: abi.encode(sourcePool), + destTokenAddress: poolReturnData.destTokenAddress, + extraData: poolReturnData.destPoolData, + amount: tokenAndAmount.amount, + destExecData: "" // This is set in the processPoolReturnData function + }); + } + + // ================================================================ + // │ Config │ + // ================================================================ + + /// @notice Returns the static onRamp config. + /// @dev RMN depends on this function, if modified, please notify the RMN maintainers. + /// @return staticConfig the static configuration. + function getStaticConfig() external view returns (StaticConfig memory) { + return StaticConfig({ + chainSelector: i_chainSelector, + rmn: i_rmn, + nonceManager: i_nonceManager, + tokenAdminRegistry: i_tokenAdminRegistry + }); + } + + /// @notice Returns the dynamic onRamp config. + /// @return dynamicConfig the dynamic configuration. + function getDynamicConfig() external view returns (DynamicConfig memory dynamicConfig) { + return s_dynamicConfig; + } + + /// @notice Sets the dynamic configuration. + /// @param dynamicConfig The configuration. + function setDynamicConfig(DynamicConfig memory dynamicConfig) external onlyOwner { + _setDynamicConfig(dynamicConfig); + } + + /// @notice Gets the source router for a destination chain + /// @param destChainSelector The destination chain selector + /// @return router the router for the provided destination chain + function getRouter(uint64 destChainSelector) external view returns (IRouter) { + return s_destChainConfigs[destChainSelector].router; + } + + /// @notice Internal version of setDynamicConfig to allow for reuse in the constructor. + function _setDynamicConfig(DynamicConfig memory dynamicConfig) internal { + if (dynamicConfig.feeQuoter == address(0) || dynamicConfig.feeAggregator == address(0)) revert InvalidConfig(); + + s_dynamicConfig = dynamicConfig; + + emit ConfigSet( + StaticConfig({ + chainSelector: i_chainSelector, + rmn: i_rmn, + nonceManager: i_nonceManager, + tokenAdminRegistry: i_tokenAdminRegistry + }), + dynamicConfig + ); + } + + /// @notice Updates destination chains specific configs. + /// @param destChainConfigArgs Array of destination chain specific configs. + function applyDestChainConfigUpdates(DestChainConfigArgs[] memory destChainConfigArgs) external onlyOwner { + _applyDestChainConfigUpdates(destChainConfigArgs); + } + + /// @notice Internal version of applyDestChainConfigUpdates. + function _applyDestChainConfigUpdates(DestChainConfigArgs[] memory destChainConfigArgs) internal { + for (uint256 i = 0; i < destChainConfigArgs.length; ++i) { + DestChainConfigArgs memory destChainConfigArg = destChainConfigArgs[i]; + uint64 destChainSelector = destChainConfigArgs[i].destChainSelector; + + if (destChainSelector == 0) { + revert InvalidDestChainConfig(destChainSelector); + } + + DestChainConfig storage destChainConfig = s_destChainConfigs[destChainSelector]; + destChainConfig.router = destChainConfigArg.router; + + emit DestChainConfigSet( + destChainSelector, destChainConfig.sequenceNumber, destChainConfigArg.router, destChainConfig.allowListEnabled + ); + } + } + + /// @notice get ChainConfig configured for the DestinationChainSelector + /// @param destChainSelector The destination chain selector + /// @return sequenceNumber The last used sequence number + /// @return allowListEnabled boolean indicator to specify if allowList check is enabled + /// @return router address of the router + function getDestChainConfig( + uint64 destChainSelector + ) public view returns (uint64 sequenceNumber, bool allowListEnabled, address router) { + DestChainConfig storage config = s_destChainConfigs[destChainSelector]; + sequenceNumber = config.sequenceNumber; + allowListEnabled = config.allowListEnabled; + router = address(config.router); + return (sequenceNumber, allowListEnabled, router); + } + + /// @notice get allowedSenders List configured for the DestinationChainSelector + /// @param destChainSelector The destination chain selector + /// @return array of allowedList of Senders + function getAllowedSendersList(uint64 destChainSelector) public view returns (address[] memory) { + return s_destChainConfigs[destChainSelector].allowedSendersList.values(); + } + + // ================================================================ + // │ Allowlist │ + // ================================================================ + + /// @notice Updates allowListConfig for Senders + /// @dev configuration used to set the list of senders who are authorized to send messages + /// @param allowListConfigArgsItems Array of AllowListConfigArguments where each item is for a destChainSelector + function applyAllowListUpdates(AllowListConfigArgs[] calldata allowListConfigArgsItems) external { + if (msg.sender != owner()) { + if (msg.sender != s_dynamicConfig.allowListAdmin) { + revert OnlyCallableByOwnerOrAllowlistAdmin(); + } + } + + for (uint256 i = 0; i < allowListConfigArgsItems.length; ++i) { + AllowListConfigArgs memory allowListConfigArgs = allowListConfigArgsItems[i]; + + DestChainConfig storage destChainConfig = s_destChainConfigs[allowListConfigArgs.destChainSelector]; + destChainConfig.allowListEnabled = allowListConfigArgs.allowListEnabled; + + if (allowListConfigArgs.allowListEnabled) { + for (uint256 j = 0; j < allowListConfigArgs.addedAllowlistedSenders.length; ++j) { + address toAdd = allowListConfigArgs.addedAllowlistedSenders[j]; + if (toAdd == address(0)) { + revert InvalidAllowListRequest(allowListConfigArgs.destChainSelector); + } + destChainConfig.allowedSendersList.add(toAdd); + } + + if (allowListConfigArgs.addedAllowlistedSenders.length > 0) { + emit AllowListSendersAdded(allowListConfigArgs.destChainSelector, allowListConfigArgs.addedAllowlistedSenders); + } + } + + for (uint256 j = 0; j < allowListConfigArgs.removedAllowlistedSenders.length; ++j) { + destChainConfig.allowedSendersList.remove(allowListConfigArgs.removedAllowlistedSenders[j]); + } + + if (allowListConfigArgs.removedAllowlistedSenders.length > 0) { + emit AllowListSendersRemoved( + allowListConfigArgs.destChainSelector, allowListConfigArgs.removedAllowlistedSenders + ); + } + } + } + + // ================================================================ + // │ Tokens and pools │ + // ================================================================ + + /// @inheritdoc IEVM2AnyOnRampClient + function getPoolBySourceToken(uint64, /*destChainSelector*/ IERC20 sourceToken) public view returns (IPoolV1) { + return IPoolV1(ITokenAdminRegistry(i_tokenAdminRegistry).getPool(address(sourceToken))); + } + + /// @inheritdoc IEVM2AnyOnRampClient + function getSupportedTokens(uint64 /*destChainSelector*/ ) external pure returns (address[] memory) { + revert GetSupportedTokensFunctionalityRemovedCheckAdminRegistry(); + } + + // ================================================================ + // │ Fees │ + // ================================================================ + + /// @inheritdoc IEVM2AnyOnRampClient + /// @dev getFee MUST revert if the feeToken is not listed in the fee token config, as the router assumes it does. + /// @param destChainSelector The destination chain selector. + /// @param message The message to get quote for. + /// @return feeTokenAmount The amount of fee token needed for the fee, in smallest denomination of the fee token. + function getFee( + uint64 destChainSelector, + Client.EVM2AnyMessage calldata message + ) external view returns (uint256 feeTokenAmount) { + if (i_rmn.isCursed(bytes16(uint128(destChainSelector)))) revert CursedByRMN(destChainSelector); + + return IFeeQuoter(s_dynamicConfig.feeQuoter).getValidatedFee(destChainSelector, message); + } + + /// @notice Withdraws the outstanding fee token balances to the fee aggregator. + /// @dev This function can be permissionless as it only transfers accepted fee tokens to the fee aggregator which is a trusted address. + function withdrawFeeTokens() external { + address[] memory feeTokens = IFeeQuoter(s_dynamicConfig.feeQuoter).getFeeTokens(); + address feeAggregator = s_dynamicConfig.feeAggregator; + + for (uint256 i = 0; i < feeTokens.length; ++i) { + IERC20 feeToken = IERC20(feeTokens[i]); + uint256 feeTokenBalance = feeToken.balanceOf(address(this)); + + if (feeTokenBalance > 0) { + feeToken.safeTransfer(feeAggregator, feeTokenBalance); + + emit FeeTokenWithdrawn(feeAggregator, address(feeToken), feeTokenBalance); + } + } + } +} diff --git a/contracts/src/v0.8/ccip/pools/BurnFromMintTokenPool.sol b/contracts/src/v0.8/ccip/pools/BurnFromMintTokenPool.sol new file mode 100644 index 00000000000..4ea6664a5c5 --- /dev/null +++ b/contracts/src/v0.8/ccip/pools/BurnFromMintTokenPool.sol @@ -0,0 +1,38 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {ITypeAndVersion} from "../../shared/interfaces/ITypeAndVersion.sol"; +import {IBurnMintERC20} from "../../shared/token/ERC20/IBurnMintERC20.sol"; + +import {BurnMintTokenPoolAbstract} from "./BurnMintTokenPoolAbstract.sol"; +import {TokenPool} from "./TokenPool.sol"; + +import {SafeERC20} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/utils/SafeERC20.sol"; + +/// @notice This pool mints and burns a 3rd-party token. +/// @dev Pool whitelisting mode is set in the constructor and cannot be modified later. +/// It either accepts any address as originalSender, or only accepts whitelisted originalSender. +/// The only way to change whitelisting mode is to deploy a new pool. +/// If that is expected, please make sure the token's burner/minter roles are adjustable. +/// @dev This contract is a variant of BurnMintTokenPool that uses `burnFrom(from, amount)`. +contract BurnFromMintTokenPool is BurnMintTokenPoolAbstract, ITypeAndVersion { + using SafeERC20 for IBurnMintERC20; + + string public constant override typeAndVersion = "BurnFromMintTokenPool 1.5.0"; + + constructor( + IBurnMintERC20 token, + address[] memory allowlist, + address rmnProxy, + address router + ) TokenPool(token, allowlist, rmnProxy, router) { + // Some tokens allow burning from the sender without approval, but not all do. + // To be safe, we approve the pool to burn from the pool. + token.safeIncreaseAllowance(address(this), type(uint256).max); + } + + /// @inheritdoc BurnMintTokenPoolAbstract + function _burn(uint256 amount) internal virtual override { + IBurnMintERC20(address(i_token)).burnFrom(address(this), amount); + } +} diff --git a/contracts/src/v0.8/ccip/pools/BurnMintTokenPool.sol b/contracts/src/v0.8/ccip/pools/BurnMintTokenPool.sol new file mode 100644 index 00000000000..c48c8e51fbc --- /dev/null +++ b/contracts/src/v0.8/ccip/pools/BurnMintTokenPool.sol @@ -0,0 +1,30 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {ITypeAndVersion} from "../../shared/interfaces/ITypeAndVersion.sol"; +import {IBurnMintERC20} from "../../shared/token/ERC20/IBurnMintERC20.sol"; + +import {BurnMintTokenPoolAbstract} from "./BurnMintTokenPoolAbstract.sol"; +import {TokenPool} from "./TokenPool.sol"; + +/// @notice This pool mints and burns a 3rd-party token. +/// @dev Pool whitelisting mode is set in the constructor and cannot be modified later. +/// It either accepts any address as originalSender, or only accepts whitelisted originalSender. +/// The only way to change whitelisting mode is to deploy a new pool. +/// If that is expected, please make sure the token's burner/minter roles are adjustable. +/// @dev This contract is a variant of BurnMintTokenPool that uses `burn(amount)`. +contract BurnMintTokenPool is BurnMintTokenPoolAbstract, ITypeAndVersion { + string public constant override typeAndVersion = "BurnMintTokenPool 1.5.0"; + + constructor( + IBurnMintERC20 token, + address[] memory allowlist, + address rmnProxy, + address router + ) TokenPool(token, allowlist, rmnProxy, router) {} + + /// @inheritdoc BurnMintTokenPoolAbstract + function _burn(uint256 amount) internal virtual override { + IBurnMintERC20(address(i_token)).burn(amount); + } +} diff --git a/contracts/src/v0.8/ccip/pools/BurnMintTokenPoolAbstract.sol b/contracts/src/v0.8/ccip/pools/BurnMintTokenPoolAbstract.sol new file mode 100644 index 00000000000..99908c91d02 --- /dev/null +++ b/contracts/src/v0.8/ccip/pools/BurnMintTokenPoolAbstract.sol @@ -0,0 +1,43 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {IBurnMintERC20} from "../../shared/token/ERC20/IBurnMintERC20.sol"; + +import {Pool} from "../libraries/Pool.sol"; +import {TokenPool} from "./TokenPool.sol"; + +abstract contract BurnMintTokenPoolAbstract is TokenPool { + /// @notice Contains the specific burn call for a pool. + /// @dev overriding this method allows us to create pools with different burn signatures + /// without duplicating the underlying logic. + function _burn(uint256 amount) internal virtual; + + /// @notice Burn the token in the pool + /// @dev The _validateLockOrBurn check is an essential security check + function lockOrBurn( + Pool.LockOrBurnInV1 calldata lockOrBurnIn + ) external virtual override returns (Pool.LockOrBurnOutV1 memory) { + _validateLockOrBurn(lockOrBurnIn); + + _burn(lockOrBurnIn.amount); + + emit Burned(msg.sender, lockOrBurnIn.amount); + + return Pool.LockOrBurnOutV1({destTokenAddress: getRemoteToken(lockOrBurnIn.remoteChainSelector), destPoolData: ""}); + } + + /// @notice Mint tokens from the pool to the recipient + /// @dev The _validateReleaseOrMint check is an essential security check + function releaseOrMint( + Pool.ReleaseOrMintInV1 calldata releaseOrMintIn + ) external virtual override returns (Pool.ReleaseOrMintOutV1 memory) { + _validateReleaseOrMint(releaseOrMintIn); + + // Mint to the receiver + IBurnMintERC20(address(i_token)).mint(releaseOrMintIn.receiver, releaseOrMintIn.amount); + + emit Minted(msg.sender, releaseOrMintIn.receiver, releaseOrMintIn.amount); + + return Pool.ReleaseOrMintOutV1({destinationAmount: releaseOrMintIn.amount}); + } +} diff --git a/contracts/src/v0.8/ccip/pools/BurnMintTokenPoolAndProxy.sol b/contracts/src/v0.8/ccip/pools/BurnMintTokenPoolAndProxy.sol new file mode 100644 index 00000000000..6e3fb0f479a --- /dev/null +++ b/contracts/src/v0.8/ccip/pools/BurnMintTokenPoolAndProxy.sol @@ -0,0 +1,55 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {ITypeAndVersion} from "../../shared/interfaces/ITypeAndVersion.sol"; +import {IBurnMintERC20} from "../../shared/token/ERC20/IBurnMintERC20.sol"; + +import {Pool} from "../libraries/Pool.sol"; +import {LegacyPoolWrapper} from "./LegacyPoolWrapper.sol"; + +contract BurnMintTokenPoolAndProxy is ITypeAndVersion, LegacyPoolWrapper { + string public constant override typeAndVersion = "BurnMintTokenPoolAndProxy 1.5.0"; + + constructor( + IBurnMintERC20 token, + address[] memory allowlist, + address rmnProxy, + address router + ) LegacyPoolWrapper(token, allowlist, rmnProxy, router) {} + + /// @notice Burn the token in the pool + /// @dev The _validateLockOrBurn check is an essential security check + function lockOrBurn( + Pool.LockOrBurnInV1 calldata lockOrBurnIn + ) external virtual override returns (Pool.LockOrBurnOutV1 memory) { + _validateLockOrBurn(lockOrBurnIn); + + if (!_hasLegacyPool()) { + IBurnMintERC20(address(i_token)).burn(lockOrBurnIn.amount); + } else { + _lockOrBurnLegacy(lockOrBurnIn); + } + + emit Burned(msg.sender, lockOrBurnIn.amount); + + return Pool.LockOrBurnOutV1({destTokenAddress: getRemoteToken(lockOrBurnIn.remoteChainSelector), destPoolData: ""}); + } + + /// @notice Mint tokens from the pool to the recipient + /// @dev The _validateReleaseOrMint check is an essential security check + function releaseOrMint( + Pool.ReleaseOrMintInV1 calldata releaseOrMintIn + ) external virtual override returns (Pool.ReleaseOrMintOutV1 memory) { + _validateReleaseOrMint(releaseOrMintIn); + + if (!_hasLegacyPool()) { + IBurnMintERC20(address(i_token)).mint(releaseOrMintIn.receiver, releaseOrMintIn.amount); + } else { + _releaseOrMintLegacy(releaseOrMintIn); + } + + emit Minted(msg.sender, releaseOrMintIn.receiver, releaseOrMintIn.amount); + + return Pool.ReleaseOrMintOutV1({destinationAmount: releaseOrMintIn.amount}); + } +} diff --git a/contracts/src/v0.8/ccip/pools/BurnWithFromMintTokenPool.sol b/contracts/src/v0.8/ccip/pools/BurnWithFromMintTokenPool.sol new file mode 100644 index 00000000000..56e0ab1b251 --- /dev/null +++ b/contracts/src/v0.8/ccip/pools/BurnWithFromMintTokenPool.sol @@ -0,0 +1,38 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {ITypeAndVersion} from "../../shared/interfaces/ITypeAndVersion.sol"; +import {IBurnMintERC20} from "../../shared/token/ERC20/IBurnMintERC20.sol"; + +import {BurnMintTokenPoolAbstract} from "./BurnMintTokenPoolAbstract.sol"; +import {TokenPool} from "./TokenPool.sol"; + +import {SafeERC20} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/utils/SafeERC20.sol"; + +/// @notice This pool mints and burns a 3rd-party token. +/// @dev Pool whitelisting mode is set in the constructor and cannot be modified later. +/// It either accepts any address as originalSender, or only accepts whitelisted originalSender. +/// The only way to change whitelisting mode is to deploy a new pool. +/// If that is expected, please make sure the token's burner/minter roles are adjustable. +/// @dev This contract is a variant of BurnMintTokenPool that uses `burn(from, amount)`. +contract BurnWithFromMintTokenPool is BurnMintTokenPoolAbstract, ITypeAndVersion { + using SafeERC20 for IBurnMintERC20; + + string public constant override typeAndVersion = "BurnWithFromMintTokenPool 1.5.0"; + + constructor( + IBurnMintERC20 token, + address[] memory allowlist, + address rmnProxy, + address router + ) TokenPool(token, allowlist, rmnProxy, router) { + // Some tokens allow burning from the sender without approval, but not all do. + // To be safe, we approve the pool to burn from the pool. + token.safeIncreaseAllowance(address(this), type(uint256).max); + } + + /// @inheritdoc BurnMintTokenPoolAbstract + function _burn(uint256 amount) internal virtual override { + IBurnMintERC20(address(i_token)).burn(address(this), amount); + } +} diff --git a/contracts/src/v0.8/ccip/pools/BurnWithFromMintTokenPoolAndProxy.sol b/contracts/src/v0.8/ccip/pools/BurnWithFromMintTokenPoolAndProxy.sol new file mode 100644 index 00000000000..324fd484a7f --- /dev/null +++ b/contracts/src/v0.8/ccip/pools/BurnWithFromMintTokenPoolAndProxy.sol @@ -0,0 +1,63 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {ITypeAndVersion} from "../../shared/interfaces/ITypeAndVersion.sol"; +import {IBurnMintERC20} from "../../shared/token/ERC20/IBurnMintERC20.sol"; + +import {Pool} from "../libraries/Pool.sol"; +import {LegacyPoolWrapper} from "./LegacyPoolWrapper.sol"; + +import {SafeERC20} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/utils/SafeERC20.sol"; + +contract BurnWithFromMintTokenPoolAndProxy is ITypeAndVersion, LegacyPoolWrapper { + using SafeERC20 for IBurnMintERC20; + + string public constant override typeAndVersion = "BurnFromMintTokenPoolAndProxy 1.5.0"; + + constructor( + IBurnMintERC20 token, + address[] memory allowlist, + address rmnProxy, + address router + ) LegacyPoolWrapper(token, allowlist, rmnProxy, router) { + // Some tokens allow burning from the sender without approval, but not all do. + // To be safe, we approve the pool to burn from the pool. + token.safeIncreaseAllowance(address(this), type(uint256).max); + } + + /// @notice Burn the token in the pool + /// @dev The _validateLockOrBurn check is an essential security check + function lockOrBurn( + Pool.LockOrBurnInV1 calldata lockOrBurnIn + ) external virtual override returns (Pool.LockOrBurnOutV1 memory) { + _validateLockOrBurn(lockOrBurnIn); + + if (!_hasLegacyPool()) { + IBurnMintERC20(address(i_token)).burnFrom(address(this), lockOrBurnIn.amount); + } else { + _lockOrBurnLegacy(lockOrBurnIn); + } + + emit Burned(msg.sender, lockOrBurnIn.amount); + + return Pool.LockOrBurnOutV1({destTokenAddress: getRemoteToken(lockOrBurnIn.remoteChainSelector), destPoolData: ""}); + } + + /// @notice Mint tokens from the pool to the recipient + /// @dev The _validateReleaseOrMint check is an essential security check + function releaseOrMint( + Pool.ReleaseOrMintInV1 calldata releaseOrMintIn + ) external virtual override returns (Pool.ReleaseOrMintOutV1 memory) { + _validateReleaseOrMint(releaseOrMintIn); + + if (!_hasLegacyPool()) { + IBurnMintERC20(address(i_token)).mint(releaseOrMintIn.receiver, releaseOrMintIn.amount); + } else { + _releaseOrMintLegacy(releaseOrMintIn); + } + + emit Minted(msg.sender, releaseOrMintIn.receiver, releaseOrMintIn.amount); + + return Pool.ReleaseOrMintOutV1({destinationAmount: releaseOrMintIn.amount}); + } +} diff --git a/contracts/src/v0.8/ccip/pools/LegacyPoolWrapper.sol b/contracts/src/v0.8/ccip/pools/LegacyPoolWrapper.sol new file mode 100644 index 00000000000..bc5adb0b2dd --- /dev/null +++ b/contracts/src/v0.8/ccip/pools/LegacyPoolWrapper.sol @@ -0,0 +1,90 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.0; + +import {IPoolPriorTo1_5} from "../interfaces/IPoolPriorTo1_5.sol"; + +import {Pool} from "../libraries/Pool.sol"; +import {TokenPool} from "./TokenPool.sol"; + +import {IERC20} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/IERC20.sol"; +import {SafeERC20} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/utils/SafeERC20.sol"; + +abstract contract LegacyPoolWrapper is TokenPool { + using SafeERC20 for IERC20; + + event LegacyPoolChanged(IPoolPriorTo1_5 oldPool, IPoolPriorTo1_5 newPool); + + /// @dev The previous pool, if there is any. This is a property to make the older 1.0-1.4 pools + /// compatible with the current 1.5 pool. To achieve this, we set the previous pool address to the + /// currently deployed legacy pool. Then we configure this new pool as onRamp and offRamp on the legacy pools. + /// In the case of a 1.4 pool, this new pool contract has to be set to the Router as well, as it validates + /// who can call it through the router calls. This contract will always return itself as the only allowed ramp. + /// @dev Can be address(0), this would indicate that this pool is operating as a normal pool as opposed to + /// a proxy pool. + IPoolPriorTo1_5 internal s_previousPool; + + constructor( + IERC20 token, + address[] memory allowlist, + address rmnProxy, + address router + ) TokenPool(token, allowlist, rmnProxy, router) {} + + // ================================================================ + // │ Legacy Fallbacks │ + // ================================================================ + // Legacy fallbacks for older token pools that do not implement the new interface. + + /// @notice Legacy fallback for the 1.4 token pools. + function getOnRamp(uint64) external view returns (address onRampAddress) { + return address(this); + } + + /// @notice Return true if the given offRamp is a configured offRamp for the given source chain. + function isOffRamp(uint64 sourceChainSelector, address offRamp) external view returns (bool) { + return offRamp == address(this) || s_router.isOffRamp(sourceChainSelector, offRamp); + } + + /// @notice Configures the legacy fallback option. If the previous pool is set, this pool will act as a proxy for + /// the legacy pool. + /// @param prevPool The address of the previous pool. + function setPreviousPool(IPoolPriorTo1_5 prevPool) external onlyOwner { + IPoolPriorTo1_5 oldPrevPool = s_previousPool; + s_previousPool = prevPool; + + emit LegacyPoolChanged(oldPrevPool, prevPool); + } + + /// @notice Returns the address of the previous pool. + function getPreviousPool() external view returns (address) { + return address(s_previousPool); + } + + function _hasLegacyPool() internal view returns (bool) { + return address(s_previousPool) != address(0); + } + + function _lockOrBurnLegacy(Pool.LockOrBurnInV1 memory lockOrBurnIn) internal { + i_token.safeTransfer(address(s_previousPool), lockOrBurnIn.amount); + s_previousPool.lockOrBurn( + lockOrBurnIn.originalSender, lockOrBurnIn.receiver, lockOrBurnIn.amount, lockOrBurnIn.remoteChainSelector, "" + ); + } + + /// @notice This call converts the arguments from a >=1.5 pool call to those of a <1.5 pool call, and uses these + /// to call the previous pool. + /// @param releaseOrMintIn The 1.5 style release or mint arguments. + /// @dev Overwrites the receiver so the previous pool sends the tokens to the sender of this call, which is the + /// offRamp. This is due to the older pools sending funds directly to the receiver, while the new pools do a hop + /// through the offRamp to ensure the correct tokens are sent. + /// @dev Since extraData has never been used in LockRelease or MintBurn token pools, we can safely ignore it. + function _releaseOrMintLegacy(Pool.ReleaseOrMintInV1 memory releaseOrMintIn) internal { + s_previousPool.releaseOrMint( + releaseOrMintIn.originalSender, + releaseOrMintIn.receiver, + releaseOrMintIn.amount, + releaseOrMintIn.remoteChainSelector, + "" + ); + } +} diff --git a/contracts/src/v0.8/ccip/pools/LockReleaseTokenPool.sol b/contracts/src/v0.8/ccip/pools/LockReleaseTokenPool.sol new file mode 100644 index 00000000000..3a4a4aef6d5 --- /dev/null +++ b/contracts/src/v0.8/ccip/pools/LockReleaseTokenPool.sol @@ -0,0 +1,131 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {ILiquidityContainer} from "../../liquiditymanager/interfaces/ILiquidityContainer.sol"; +import {ITypeAndVersion} from "../../shared/interfaces/ITypeAndVersion.sol"; + +import {Pool} from "../libraries/Pool.sol"; +import {TokenPool} from "./TokenPool.sol"; + +import {IERC20} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/IERC20.sol"; +import {SafeERC20} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/utils/SafeERC20.sol"; + +/// @notice Token pool used for tokens on their native chain. This uses a lock and release mechanism. +/// Because of lock/unlock requiring liquidity, this pool contract also has function to add and remove +/// liquidity. This allows for proper bookkeeping for both user and liquidity provider balances. +/// @dev One token per LockReleaseTokenPool. +contract LockReleaseTokenPool is TokenPool, ILiquidityContainer, ITypeAndVersion { + using SafeERC20 for IERC20; + + error InsufficientLiquidity(); + error LiquidityNotAccepted(); + + event LiquidityTransferred(address indexed from, uint256 amount); + + string public constant override typeAndVersion = "LockReleaseTokenPool 1.5.0"; + + /// @dev Whether or not the pool accepts liquidity. + /// External liquidity is not required when there is one canonical token deployed to a chain, + /// and CCIP is facilitating mint/burn on all the other chains, in which case the invariant + /// balanceOf(pool) on home chain >= sum(totalSupply(mint/burn "wrapped" token) on all remote chains) should always hold + bool internal immutable i_acceptLiquidity; + /// @notice The address of the rebalancer. + address internal s_rebalancer; + + constructor( + IERC20 token, + address[] memory allowlist, + address rmnProxy, + bool acceptLiquidity, + address router + ) TokenPool(token, allowlist, rmnProxy, router) { + i_acceptLiquidity = acceptLiquidity; + } + + /// @notice Locks the token in the pool + /// @dev The _validateLockOrBurn check is an essential security check + function lockOrBurn( + Pool.LockOrBurnInV1 calldata lockOrBurnIn + ) external virtual override returns (Pool.LockOrBurnOutV1 memory) { + _validateLockOrBurn(lockOrBurnIn); + + emit Locked(msg.sender, lockOrBurnIn.amount); + + return Pool.LockOrBurnOutV1({destTokenAddress: getRemoteToken(lockOrBurnIn.remoteChainSelector), destPoolData: ""}); + } + + /// @notice Release tokens from the pool to the recipient + /// @dev The _validateReleaseOrMint check is an essential security check + function releaseOrMint( + Pool.ReleaseOrMintInV1 calldata releaseOrMintIn + ) external virtual override returns (Pool.ReleaseOrMintOutV1 memory) { + _validateReleaseOrMint(releaseOrMintIn); + + // Release to the recipient + getToken().safeTransfer(releaseOrMintIn.receiver, releaseOrMintIn.amount); + + emit Released(msg.sender, releaseOrMintIn.receiver, releaseOrMintIn.amount); + + return Pool.ReleaseOrMintOutV1({destinationAmount: releaseOrMintIn.amount}); + } + + // @inheritdoc IERC165 + function supportsInterface(bytes4 interfaceId) public pure virtual override returns (bool) { + return interfaceId == type(ILiquidityContainer).interfaceId || super.supportsInterface(interfaceId); + } + + /// @notice Gets LiquidityManager, can be address(0) if none is configured. + /// @return The current liquidity manager. + function getRebalancer() external view returns (address) { + return s_rebalancer; + } + + /// @notice Sets the LiquidityManager address. + /// @dev Only callable by the owner. + function setRebalancer(address rebalancer) external onlyOwner { + s_rebalancer = rebalancer; + } + + /// @notice Checks if the pool can accept liquidity. + /// @return true if the pool can accept liquidity, false otherwise. + function canAcceptLiquidity() external view returns (bool) { + return i_acceptLiquidity; + } + + /// @notice Adds liquidity to the pool. The tokens should be approved first. + /// @param amount The amount of liquidity to provide. + function provideLiquidity(uint256 amount) external { + if (!i_acceptLiquidity) revert LiquidityNotAccepted(); + if (s_rebalancer != msg.sender) revert Unauthorized(msg.sender); + + i_token.safeTransferFrom(msg.sender, address(this), amount); + emit LiquidityAdded(msg.sender, amount); + } + + /// @notice Removed liquidity to the pool. The tokens will be sent to msg.sender. + /// @param amount The amount of liquidity to remove. + function withdrawLiquidity(uint256 amount) external { + if (s_rebalancer != msg.sender) revert Unauthorized(msg.sender); + + if (i_token.balanceOf(address(this)) < amount) revert InsufficientLiquidity(); + i_token.safeTransfer(msg.sender, amount); + emit LiquidityRemoved(msg.sender, amount); + } + + /// @notice This function can be used to transfer liquidity from an older version of the pool to this pool. To do so + /// this pool will have to be set as the rebalancer in the older version of the pool. This allows it to transfer the + /// funds in the old pool to the new pool. + /// @dev When upgrading a LockRelease pool, this function can be called at the same time as the pool is changed in the + /// TokenAdminRegistry. This allows for a smooth transition of both liquidity and transactions to the new pool. + /// Alternatively, when no multicall is available, a portion of the funds can be transferred to the new pool before + /// changing which pool CCIP uses, to ensure both pools can operate. Then the pool should be changed in the + /// TokenAdminRegistry, which will activate the new pool. All new transactions will use the new pool and its + /// liquidity. Finally, the remaining liquidity can be transferred to the new pool using this function one more time. + /// @param from The address of the old pool. + /// @param amount The amount of liquidity to transfer. + function transferLiquidity(address from, uint256 amount) external onlyOwner { + LockReleaseTokenPool(from).withdrawLiquidity(amount); + + emit LiquidityTransferred(from, amount); + } +} diff --git a/contracts/src/v0.8/ccip/pools/LockReleaseTokenPoolAndProxy.sol b/contracts/src/v0.8/ccip/pools/LockReleaseTokenPoolAndProxy.sol new file mode 100644 index 00000000000..e8c39127de1 --- /dev/null +++ b/contracts/src/v0.8/ccip/pools/LockReleaseTokenPoolAndProxy.sol @@ -0,0 +1,135 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {ILiquidityContainer} from "../../liquiditymanager/interfaces/ILiquidityContainer.sol"; +import {ITypeAndVersion} from "../../shared/interfaces/ITypeAndVersion.sol"; + +import {Pool} from "../libraries/Pool.sol"; +import {LegacyPoolWrapper} from "./LegacyPoolWrapper.sol"; + +import {IERC20} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/IERC20.sol"; +import {SafeERC20} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/utils/SafeERC20.sol"; + +/// @notice Token pool used for tokens on their native chain. This uses a lock and release mechanism. +/// Because of lock/unlock requiring liquidity, this pool contract also has function to add and remove +/// liquidity. This allows for proper bookkeeping for both user and liquidity provider balances. +/// @dev One token per LockReleaseTokenPool. +contract LockReleaseTokenPoolAndProxy is LegacyPoolWrapper, ILiquidityContainer, ITypeAndVersion { + using SafeERC20 for IERC20; + + error InsufficientLiquidity(); + error LiquidityNotAccepted(); + + string public constant override typeAndVersion = "LockReleaseTokenPoolAndProxy 1.5.0"; + + /// @dev Whether or not the pool accepts liquidity. + /// External liquidity is not required when there is one canonical token deployed to a chain, + /// and CCIP is facilitating mint/burn on all the other chains, in which case the invariant + /// balanceOf(pool) on home chain >= sum(totalSupply(mint/burn "wrapped" token) on all remote chains) should always hold + bool internal immutable i_acceptLiquidity; + /// @notice The address of the rebalancer. + address internal s_rebalancer; + + constructor( + IERC20 token, + address[] memory allowlist, + address rmnProxy, + bool acceptLiquidity, + address router + ) LegacyPoolWrapper(token, allowlist, rmnProxy, router) { + i_acceptLiquidity = acceptLiquidity; + } + + /// @notice Locks the token in the pool + /// @dev The _validateLockOrBurn check is an essential security check + function lockOrBurn( + Pool.LockOrBurnInV1 calldata lockOrBurnIn + ) external virtual override returns (Pool.LockOrBurnOutV1 memory) { + _validateLockOrBurn(lockOrBurnIn); + + if (_hasLegacyPool()) { + _lockOrBurnLegacy(lockOrBurnIn); + } + + emit Locked(msg.sender, lockOrBurnIn.amount); + + return Pool.LockOrBurnOutV1({destTokenAddress: getRemoteToken(lockOrBurnIn.remoteChainSelector), destPoolData: ""}); + } + + /// @notice Release tokens from the pool to the recipient + /// @dev The _validateReleaseOrMint check is an essential security check + function releaseOrMint( + Pool.ReleaseOrMintInV1 calldata releaseOrMintIn + ) external virtual override returns (Pool.ReleaseOrMintOutV1 memory) { + _validateReleaseOrMint(releaseOrMintIn); + + if (!_hasLegacyPool()) { + // Release to the recipient + getToken().safeTransfer(releaseOrMintIn.receiver, releaseOrMintIn.amount); + } else { + _releaseOrMintLegacy(releaseOrMintIn); + } + + emit Released(msg.sender, releaseOrMintIn.receiver, releaseOrMintIn.amount); + + return Pool.ReleaseOrMintOutV1({destinationAmount: releaseOrMintIn.amount}); + } + + // @inheritdoc IERC165 + function supportsInterface(bytes4 interfaceId) public pure virtual override returns (bool) { + return interfaceId == type(ILiquidityContainer).interfaceId || super.supportsInterface(interfaceId); + } + + /// @notice Gets LiquidityManager, can be address(0) if none is configured. + /// @return The current liquidity manager. + function getRebalancer() external view returns (address) { + return s_rebalancer; + } + + /// @notice Sets the LiquidityManager address. + /// @dev Only callable by the owner. + function setRebalancer(address rebalancer) external onlyOwner { + s_rebalancer = rebalancer; + } + + /// @notice Checks if the pool can accept liquidity. + /// @return true if the pool can accept liquidity, false otherwise. + function canAcceptLiquidity() external view returns (bool) { + return i_acceptLiquidity; + } + + /// @notice Adds liquidity to the pool. The tokens should be approved first. + /// @param amount The amount of liquidity to provide. + function provideLiquidity(uint256 amount) external { + if (!i_acceptLiquidity) revert LiquidityNotAccepted(); + if (s_rebalancer != msg.sender) revert Unauthorized(msg.sender); + + i_token.safeTransferFrom(msg.sender, address(this), amount); + emit LiquidityAdded(msg.sender, amount); + } + + /// @notice Removed liquidity to the pool. The tokens will be sent to msg.sender. + /// @param amount The amount of liquidity to remove. + function withdrawLiquidity(uint256 amount) external { + if (s_rebalancer != msg.sender) revert Unauthorized(msg.sender); + + if (i_token.balanceOf(address(this)) < amount) revert InsufficientLiquidity(); + i_token.safeTransfer(msg.sender, amount); + emit LiquidityRemoved(msg.sender, amount); + } + + /// @notice This function can be used to transfer liquidity from an older version of the pool to this pool. To do so + /// this pool will have to be set as the rebalancer in the older version of the pool. This allows it to transfer the + /// funds in the old pool to the new pool. + /// @dev When upgrading a LockRelease pool, this function can be called at the same time as the pool is changed in the + /// TokenAdminRegistry. This allows for a smooth transition of both liquidity and transactions to the new pool. + /// Alternatively, when no multicall is available, a portion of the funds can be transferred to the new pool before + /// changing which pool CCIP uses, to ensure both pools can operate. Then the pool should be changed in the + /// TokenAdminRegistry, which will activate the new pool. All new transactions will use the new pool and its + /// liquidity. Finally, the remaining liquidity can be transferred to the new pool using this function one more time. + /// @param from The address of the old pool. + /// @param amount The amount of liquidity to transfer. + function transferLiquidity(address from, uint256 amount) external onlyOwner { + LockReleaseTokenPoolAndProxy(from).withdrawLiquidity(amount); + } +} diff --git a/contracts/src/v0.8/ccip/pools/TokenPool.sol b/contracts/src/v0.8/ccip/pools/TokenPool.sol new file mode 100644 index 00000000000..b12a12ca7a1 --- /dev/null +++ b/contracts/src/v0.8/ccip/pools/TokenPool.sol @@ -0,0 +1,438 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {IPoolV1} from "../interfaces/IPool.sol"; +import {IRMN} from "../interfaces/IRMN.sol"; +import {IRouter} from "../interfaces/IRouter.sol"; + +import {OwnerIsCreator} from "../../shared/access/OwnerIsCreator.sol"; +import {Pool} from "../libraries/Pool.sol"; +import {RateLimiter} from "../libraries/RateLimiter.sol"; + +import {IERC20} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/IERC20.sol"; +import {IERC165} from "../../vendor/openzeppelin-solidity/v5.0.2/contracts/utils/introspection/IERC165.sol"; +import {EnumerableSet} from "../../vendor/openzeppelin-solidity/v5.0.2/contracts/utils/structs/EnumerableSet.sol"; + +/// @notice Base abstract class with common functions for all token pools. +/// A token pool serves as isolated place for holding tokens and token specific logic +/// that may execute as tokens move across the bridge. +abstract contract TokenPool is IPoolV1, OwnerIsCreator { + using EnumerableSet for EnumerableSet.AddressSet; + using EnumerableSet for EnumerableSet.UintSet; + using RateLimiter for RateLimiter.TokenBucket; + + error CallerIsNotARampOnRouter(address caller); + error ZeroAddressNotAllowed(); + error SenderNotAllowed(address sender); + error AllowListNotEnabled(); + error NonExistentChain(uint64 remoteChainSelector); + error ChainNotAllowed(uint64 remoteChainSelector); + error CursedByRMN(); + error ChainAlreadyExists(uint64 chainSelector); + error InvalidSourcePoolAddress(bytes sourcePoolAddress); + error InvalidToken(address token); + error Unauthorized(address caller); + + event Locked(address indexed sender, uint256 amount); + event Burned(address indexed sender, uint256 amount); + event Released(address indexed sender, address indexed recipient, uint256 amount); + event Minted(address indexed sender, address indexed recipient, uint256 amount); + event ChainAdded( + uint64 remoteChainSelector, + bytes remoteToken, + RateLimiter.Config outboundRateLimiterConfig, + RateLimiter.Config inboundRateLimiterConfig + ); + event ChainConfigured( + uint64 remoteChainSelector, + RateLimiter.Config outboundRateLimiterConfig, + RateLimiter.Config inboundRateLimiterConfig + ); + event ChainRemoved(uint64 remoteChainSelector); + event RemotePoolSet(uint64 indexed remoteChainSelector, bytes previousPoolAddress, bytes remotePoolAddress); + event AllowListAdd(address sender); + event AllowListRemove(address sender); + event RouterUpdated(address oldRouter, address newRouter); + + struct ChainUpdate { + uint64 remoteChainSelector; // ──╮ Remote chain selector + bool allowed; // ────────────────╯ Whether the chain should be enabled + bytes remotePoolAddress; // Address of the remote pool, ABI encoded in the case of a remove EVM chain. + bytes remoteTokenAddress; // Address of the remote token, ABI encoded in the case of a remote EVM chain. + RateLimiter.Config outboundRateLimiterConfig; // Outbound rate limited config, meaning the rate limits for all of the onRamps for the given chain + RateLimiter.Config inboundRateLimiterConfig; // Inbound rate limited config, meaning the rate limits for all of the offRamps for the given chain + } + + struct RemoteChainConfig { + RateLimiter.TokenBucket outboundRateLimiterConfig; // Outbound rate limited config, meaning the rate limits for all of the onRamps for the given chain + RateLimiter.TokenBucket inboundRateLimiterConfig; // Inbound rate limited config, meaning the rate limits for all of the offRamps for the given chain + bytes remotePoolAddress; // Address of the remote pool, ABI encoded in the case of a remote EVM chain. + bytes remoteTokenAddress; // Address of the remote token, ABI encoded in the case of a remote EVM chain. + } + + /// @dev The bridgeable token that is managed by this pool. + IERC20 internal immutable i_token; + /// @dev The address of the RMN proxy + address internal immutable i_rmnProxy; + /// @dev The immutable flag that indicates if the pool is access-controlled. + bool internal immutable i_allowlistEnabled; + /// @dev A set of addresses allowed to trigger lockOrBurn as original senders. + /// Only takes effect if i_allowlistEnabled is true. + /// This can be used to ensure only token-issuer specified addresses can + /// move tokens. + EnumerableSet.AddressSet internal s_allowList; + /// @dev The address of the router + IRouter internal s_router; + /// @dev A set of allowed chain selectors. We want the allowlist to be enumerable to + /// be able to quickly determine (without parsing logs) who can access the pool. + /// @dev The chain selectors are in uint256 format because of the EnumerableSet implementation. + EnumerableSet.UintSet internal s_remoteChainSelectors; + mapping(uint64 remoteChainSelector => RemoteChainConfig) internal s_remoteChainConfigs; + /// @notice The address of the rate limiter admin. + /// @dev Can be address(0) if none is configured. + address internal s_rateLimitAdmin; + + constructor(IERC20 token, address[] memory allowlist, address rmnProxy, address router) { + if (address(token) == address(0) || router == address(0) || rmnProxy == address(0)) revert ZeroAddressNotAllowed(); + i_token = token; + i_rmnProxy = rmnProxy; + s_router = IRouter(router); + + // Pool can be set as permissioned or permissionless at deployment time only to save hot-path gas. + i_allowlistEnabled = allowlist.length > 0; + if (i_allowlistEnabled) { + _applyAllowListUpdates(new address[](0), allowlist); + } + } + + /// @notice Get RMN proxy address + /// @return rmnProxy Address of RMN proxy + function getRmnProxy() public view returns (address rmnProxy) { + return i_rmnProxy; + } + + /// @inheritdoc IPoolV1 + function isSupportedToken(address token) public view virtual returns (bool) { + return token == address(i_token); + } + + /// @notice Gets the IERC20 token that this pool can lock or burn. + /// @return token The IERC20 token representation. + function getToken() public view returns (IERC20 token) { + return i_token; + } + + /// @notice Gets the pool's Router + /// @return router The pool's Router + function getRouter() public view returns (address router) { + return address(s_router); + } + + /// @notice Sets the pool's Router + /// @param newRouter The new Router + function setRouter(address newRouter) public onlyOwner { + if (newRouter == address(0)) revert ZeroAddressNotAllowed(); + address oldRouter = address(s_router); + s_router = IRouter(newRouter); + + emit RouterUpdated(oldRouter, newRouter); + } + + /// @notice Signals which version of the pool interface is supported + function supportsInterface(bytes4 interfaceId) public pure virtual override returns (bool) { + return interfaceId == Pool.CCIP_POOL_V1 || interfaceId == type(IPoolV1).interfaceId + || interfaceId == type(IERC165).interfaceId; + } + + // ================================================================ + // │ Validation │ + // ================================================================ + + /// @notice Validates the lock or burn input for correctness on + /// - token to be locked or burned + /// - RMN curse status + /// - allowlist status + /// - if the sender is a valid onRamp + /// - rate limit status + /// @param lockOrBurnIn The input to validate. + /// @dev This function should always be called before executing a lock or burn. Not doing so would allow + /// for various exploits. + function _validateLockOrBurn(Pool.LockOrBurnInV1 memory lockOrBurnIn) internal { + if (!isSupportedToken(lockOrBurnIn.localToken)) revert InvalidToken(lockOrBurnIn.localToken); + if (IRMN(i_rmnProxy).isCursed(bytes16(uint128(lockOrBurnIn.remoteChainSelector)))) revert CursedByRMN(); + _checkAllowList(lockOrBurnIn.originalSender); + + _onlyOnRamp(lockOrBurnIn.remoteChainSelector); + _consumeOutboundRateLimit(lockOrBurnIn.remoteChainSelector, lockOrBurnIn.amount); + } + + /// @notice Validates the release or mint input for correctness on + /// - token to be released or minted + /// - RMN curse status + /// - if the sender is a valid offRamp + /// - if the source pool is valid + /// - rate limit status + /// @param releaseOrMintIn The input to validate. + /// @dev This function should always be called before executing a release or mint. Not doing so would allow + /// for various exploits. + function _validateReleaseOrMint(Pool.ReleaseOrMintInV1 memory releaseOrMintIn) internal { + if (!isSupportedToken(releaseOrMintIn.localToken)) revert InvalidToken(releaseOrMintIn.localToken); + if (IRMN(i_rmnProxy).isCursed(bytes16(uint128(releaseOrMintIn.remoteChainSelector)))) revert CursedByRMN(); + _onlyOffRamp(releaseOrMintIn.remoteChainSelector); + + // Validates that the source pool address is configured on this pool. + bytes memory configuredRemotePool = getRemotePool(releaseOrMintIn.remoteChainSelector); + if ( + configuredRemotePool.length == 0 + || keccak256(releaseOrMintIn.sourcePoolAddress) != keccak256(configuredRemotePool) + ) { + revert InvalidSourcePoolAddress(releaseOrMintIn.sourcePoolAddress); + } + _consumeInboundRateLimit(releaseOrMintIn.remoteChainSelector, releaseOrMintIn.amount); + } + + // ================================================================ + // │ Chain permissions │ + // ================================================================ + + /// @notice Gets the pool address on the remote chain. + /// @param remoteChainSelector Remote chain selector. + /// @dev To support non-evm chains, this value is encoded into bytes + function getRemotePool(uint64 remoteChainSelector) public view returns (bytes memory) { + return s_remoteChainConfigs[remoteChainSelector].remotePoolAddress; + } + + /// @notice Gets the token address on the remote chain. + /// @param remoteChainSelector Remote chain selector. + /// @dev To support non-evm chains, this value is encoded into bytes + function getRemoteToken(uint64 remoteChainSelector) public view returns (bytes memory) { + return s_remoteChainConfigs[remoteChainSelector].remoteTokenAddress; + } + + /// @notice Sets the remote pool address for a given chain selector. + /// @param remoteChainSelector The remote chain selector for which the remote pool address is being set. + /// @param remotePoolAddress The address of the remote pool. + function setRemotePool(uint64 remoteChainSelector, bytes calldata remotePoolAddress) external onlyOwner { + if (!isSupportedChain(remoteChainSelector)) revert NonExistentChain(remoteChainSelector); + + bytes memory prevAddress = s_remoteChainConfigs[remoteChainSelector].remotePoolAddress; + s_remoteChainConfigs[remoteChainSelector].remotePoolAddress = remotePoolAddress; + + emit RemotePoolSet(remoteChainSelector, prevAddress, remotePoolAddress); + } + + /// @inheritdoc IPoolV1 + function isSupportedChain(uint64 remoteChainSelector) public view returns (bool) { + return s_remoteChainSelectors.contains(remoteChainSelector); + } + + /// @notice Get list of allowed chains + /// @return list of chains. + function getSupportedChains() public view returns (uint64[] memory) { + uint256[] memory uint256ChainSelectors = s_remoteChainSelectors.values(); + uint64[] memory chainSelectors = new uint64[](uint256ChainSelectors.length); + for (uint256 i = 0; i < uint256ChainSelectors.length; ++i) { + chainSelectors[i] = uint64(uint256ChainSelectors[i]); + } + + return chainSelectors; + } + + /// @notice Sets the permissions for a list of chains selectors. Actual senders for these chains + /// need to be allowed on the Router to interact with this pool. + /// @dev Only callable by the owner + /// @param chains A list of chains and their new permission status & rate limits. Rate limits + /// are only used when the chain is being added through `allowed` being true. + function applyChainUpdates(ChainUpdate[] calldata chains) external virtual onlyOwner { + for (uint256 i = 0; i < chains.length; ++i) { + ChainUpdate memory update = chains[i]; + RateLimiter._validateTokenBucketConfig(update.outboundRateLimiterConfig, !update.allowed); + RateLimiter._validateTokenBucketConfig(update.inboundRateLimiterConfig, !update.allowed); + + if (update.allowed) { + // If the chain already exists, revert + if (!s_remoteChainSelectors.add(update.remoteChainSelector)) { + revert ChainAlreadyExists(update.remoteChainSelector); + } + + if (update.remotePoolAddress.length == 0 || update.remoteTokenAddress.length == 0) { + revert ZeroAddressNotAllowed(); + } + + s_remoteChainConfigs[update.remoteChainSelector] = RemoteChainConfig({ + outboundRateLimiterConfig: RateLimiter.TokenBucket({ + rate: update.outboundRateLimiterConfig.rate, + capacity: update.outboundRateLimiterConfig.capacity, + tokens: update.outboundRateLimiterConfig.capacity, + lastUpdated: uint32(block.timestamp), + isEnabled: update.outboundRateLimiterConfig.isEnabled + }), + inboundRateLimiterConfig: RateLimiter.TokenBucket({ + rate: update.inboundRateLimiterConfig.rate, + capacity: update.inboundRateLimiterConfig.capacity, + tokens: update.inboundRateLimiterConfig.capacity, + lastUpdated: uint32(block.timestamp), + isEnabled: update.inboundRateLimiterConfig.isEnabled + }), + remotePoolAddress: update.remotePoolAddress, + remoteTokenAddress: update.remoteTokenAddress + }); + + emit ChainAdded( + update.remoteChainSelector, + update.remoteTokenAddress, + update.outboundRateLimiterConfig, + update.inboundRateLimiterConfig + ); + } else { + // If the chain doesn't exist, revert + if (!s_remoteChainSelectors.remove(update.remoteChainSelector)) { + revert NonExistentChain(update.remoteChainSelector); + } + + delete s_remoteChainConfigs[update.remoteChainSelector]; + + emit ChainRemoved(update.remoteChainSelector); + } + } + } + + // ================================================================ + // │ Rate limiting │ + // ================================================================ + + /// @notice Sets the rate limiter admin address. + /// @dev Only callable by the owner. + /// @param rateLimitAdmin The new rate limiter admin address. + function setRateLimitAdmin(address rateLimitAdmin) external onlyOwner { + s_rateLimitAdmin = rateLimitAdmin; + } + + /// @notice Gets the rate limiter admin address. + function getRateLimitAdmin() external view returns (address) { + return s_rateLimitAdmin; + } + + /// @notice Consumes outbound rate limiting capacity in this pool + function _consumeOutboundRateLimit(uint64 remoteChainSelector, uint256 amount) internal { + s_remoteChainConfigs[remoteChainSelector].outboundRateLimiterConfig._consume(amount, address(i_token)); + } + + /// @notice Consumes inbound rate limiting capacity in this pool + function _consumeInboundRateLimit(uint64 remoteChainSelector, uint256 amount) internal { + s_remoteChainConfigs[remoteChainSelector].inboundRateLimiterConfig._consume(amount, address(i_token)); + } + + /// @notice Gets the token bucket with its values for the block it was requested at. + /// @return The token bucket. + function getCurrentOutboundRateLimiterState( + uint64 remoteChainSelector + ) external view returns (RateLimiter.TokenBucket memory) { + return s_remoteChainConfigs[remoteChainSelector].outboundRateLimiterConfig._currentTokenBucketState(); + } + + /// @notice Gets the token bucket with its values for the block it was requested at. + /// @return The token bucket. + function getCurrentInboundRateLimiterState( + uint64 remoteChainSelector + ) external view returns (RateLimiter.TokenBucket memory) { + return s_remoteChainConfigs[remoteChainSelector].inboundRateLimiterConfig._currentTokenBucketState(); + } + + /// @notice Sets the chain rate limiter config. + /// @param remoteChainSelector The remote chain selector for which the rate limits apply. + /// @param outboundConfig The new outbound rate limiter config, meaning the onRamp rate limits for the given chain. + /// @param inboundConfig The new inbound rate limiter config, meaning the offRamp rate limits for the given chain. + function setChainRateLimiterConfig( + uint64 remoteChainSelector, + RateLimiter.Config memory outboundConfig, + RateLimiter.Config memory inboundConfig + ) external { + if (msg.sender != s_rateLimitAdmin && msg.sender != owner()) revert Unauthorized(msg.sender); + + _setRateLimitConfig(remoteChainSelector, outboundConfig, inboundConfig); + } + + function _setRateLimitConfig( + uint64 remoteChainSelector, + RateLimiter.Config memory outboundConfig, + RateLimiter.Config memory inboundConfig + ) internal { + if (!isSupportedChain(remoteChainSelector)) revert NonExistentChain(remoteChainSelector); + RateLimiter._validateTokenBucketConfig(outboundConfig, false); + s_remoteChainConfigs[remoteChainSelector].outboundRateLimiterConfig._setTokenBucketConfig(outboundConfig); + RateLimiter._validateTokenBucketConfig(inboundConfig, false); + s_remoteChainConfigs[remoteChainSelector].inboundRateLimiterConfig._setTokenBucketConfig(inboundConfig); + emit ChainConfigured(remoteChainSelector, outboundConfig, inboundConfig); + } + + // ================================================================ + // │ Access │ + // ================================================================ + + /// @notice Checks whether remote chain selector is configured on this contract, and if the msg.sender + /// is a permissioned onRamp for the given chain on the Router. + function _onlyOnRamp(uint64 remoteChainSelector) internal view { + if (!isSupportedChain(remoteChainSelector)) revert ChainNotAllowed(remoteChainSelector); + if (!(msg.sender == s_router.getOnRamp(remoteChainSelector))) revert CallerIsNotARampOnRouter(msg.sender); + } + + /// @notice Checks whether remote chain selector is configured on this contract, and if the msg.sender + /// is a permissioned offRamp for the given chain on the Router. + function _onlyOffRamp(uint64 remoteChainSelector) internal view { + if (!isSupportedChain(remoteChainSelector)) revert ChainNotAllowed(remoteChainSelector); + if (!s_router.isOffRamp(remoteChainSelector, msg.sender)) revert CallerIsNotARampOnRouter(msg.sender); + } + + // ================================================================ + // │ Allowlist │ + // ================================================================ + + function _checkAllowList(address sender) internal view { + if (i_allowlistEnabled) { + if (!s_allowList.contains(sender)) { + revert SenderNotAllowed(sender); + } + } + } + + /// @notice Gets whether the allowList functionality is enabled. + /// @return true is enabled, false if not. + function getAllowListEnabled() external view returns (bool) { + return i_allowlistEnabled; + } + + /// @notice Gets the allowed addresses. + /// @return The allowed addresses. + function getAllowList() external view returns (address[] memory) { + return s_allowList.values(); + } + + /// @notice Apply updates to the allow list. + /// @param removes The addresses to be removed. + /// @param adds The addresses to be added. + function applyAllowListUpdates(address[] calldata removes, address[] calldata adds) external onlyOwner { + _applyAllowListUpdates(removes, adds); + } + + /// @notice Internal version of applyAllowListUpdates to allow for reuse in the constructor. + function _applyAllowListUpdates(address[] memory removes, address[] memory adds) internal { + if (!i_allowlistEnabled) revert AllowListNotEnabled(); + + for (uint256 i = 0; i < removes.length; ++i) { + address toRemove = removes[i]; + if (s_allowList.remove(toRemove)) { + emit AllowListRemove(toRemove); + } + } + for (uint256 i = 0; i < adds.length; ++i) { + address toAdd = adds[i]; + if (toAdd == address(0)) { + continue; + } + if (s_allowList.add(toAdd)) { + emit AllowListAdd(toAdd); + } + } + } +} diff --git a/contracts/src/v0.8/ccip/pools/USDC/HybridLockReleaseUSDCTokenPool.sol b/contracts/src/v0.8/ccip/pools/USDC/HybridLockReleaseUSDCTokenPool.sol new file mode 100644 index 00000000000..49cdeafcbcd --- /dev/null +++ b/contracts/src/v0.8/ccip/pools/USDC/HybridLockReleaseUSDCTokenPool.sol @@ -0,0 +1,210 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {ILiquidityContainer} from "../../../liquiditymanager/interfaces/ILiquidityContainer.sol"; +import {ITokenMessenger} from "../USDC/ITokenMessenger.sol"; + +import {Pool} from "../../libraries/Pool.sol"; +import {TokenPool} from "../TokenPool.sol"; +import {USDCTokenPool} from "../USDC/USDCTokenPool.sol"; +import {USDCBridgeMigrator} from "./USDCBridgeMigrator.sol"; + +import {IERC20} from "../../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/IERC20.sol"; +import {SafeERC20} from "../../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/utils/SafeERC20.sol"; +import {EnumerableSet} from "../../../vendor/openzeppelin-solidity/v4.8.3/contracts/utils/structs/EnumerableSet.sol"; + +/// @notice A token pool for USDC which uses CCTP for supported chains and Lock/Release for all others +/// @dev The functionality from LockReleaseTokenPool.sol has been duplicated due to lack of compiler support for shared +/// constructors between parents +/// @dev The primary token mechanism in this pool is Burn/Mint with CCTP, with Lock/Release as the +/// secondary, opt in mechanism for chains not currently supporting CCTP. +contract HybridLockReleaseUSDCTokenPool is USDCTokenPool, USDCBridgeMigrator { + using SafeERC20 for IERC20; + using EnumerableSet for EnumerableSet.UintSet; + + event LiquidityTransferred(address indexed from, uint64 indexed remoteChainSelector, uint256 amount); + event LiquidityProviderSet( + address indexed oldProvider, address indexed newProvider, uint64 indexed remoteChainSelector + ); + + event LockReleaseEnabled(uint64 indexed remoteChainSelector); + event LockReleaseDisabled(uint64 indexed remoteChainSelector); + + error LanePausedForCCTPMigration(uint64 remoteChainSelector); + error TokenLockingNotAllowedAfterMigration(uint64 remoteChainSelector); + + /// @notice The address of the liquidity provider for a specific chain. + /// External liquidity is not required when there is one canonical token deployed to a chain, + /// and CCIP is facilitating mint/burn on all the other chains, in which case the invariant + /// balanceOf(pool) on home chain >= sum(totalSupply(mint/burn "wrapped" token) on all remote chains) should always hold + mapping(uint64 remoteChainSelector => address liquidityProvider) internal s_liquidityProvider; + + constructor( + ITokenMessenger tokenMessenger, + IERC20 token, + address[] memory allowlist, + address rmnProxy, + address router + ) USDCTokenPool(tokenMessenger, token, allowlist, rmnProxy, router) USDCBridgeMigrator(address(token), router) {} + + // ================================================================ + // │ Incoming/Outgoing Mechanisms | + // ================================================================ + + /// @notice Locks the token in the pool + /// @dev The _validateLockOrBurn check is an essential security check + function lockOrBurn( + Pool.LockOrBurnInV1 calldata lockOrBurnIn + ) public virtual override returns (Pool.LockOrBurnOutV1 memory) { + // // If the alternative mechanism (L/R) for chains which have it enabled + if (!shouldUseLockRelease(lockOrBurnIn.remoteChainSelector)) { + return super.lockOrBurn(lockOrBurnIn); + } + + // Circle requires a supply-lock to prevent outgoing messages once the migration process begins. + // This prevents new outgoing messages once the migration has begun to ensure any the procedure runs as expected + if (s_proposedUSDCMigrationChain == lockOrBurnIn.remoteChainSelector) { + revert LanePausedForCCTPMigration(s_proposedUSDCMigrationChain); + } + + return _lockReleaseOutgoingMessage(lockOrBurnIn); + } + + /// @notice Release tokens from the pool to the recipient + /// @dev The _validateReleaseOrMint check is an essential security check + function releaseOrMint( + Pool.ReleaseOrMintInV1 calldata releaseOrMintIn + ) public virtual override returns (Pool.ReleaseOrMintOutV1 memory) { + if (!shouldUseLockRelease(releaseOrMintIn.remoteChainSelector)) { + return super.releaseOrMint(releaseOrMintIn); + } + return _lockReleaseIncomingMessage(releaseOrMintIn); + } + + /// @notice Contains the alternative mechanism for incoming tokens, in this implementation is "Release" incoming tokens + function _lockReleaseIncomingMessage( + Pool.ReleaseOrMintInV1 calldata releaseOrMintIn + ) internal virtual returns (Pool.ReleaseOrMintOutV1 memory) { + _validateReleaseOrMint(releaseOrMintIn); + + // Decrease internal tracking of locked tokens to ensure accurate accounting for burnLockedUSDC() migration + s_lockedTokensByChainSelector[releaseOrMintIn.remoteChainSelector] -= releaseOrMintIn.amount; + + // Release to the offRamp, which forwards it to the recipient + getToken().safeTransfer(releaseOrMintIn.receiver, releaseOrMintIn.amount); + + emit Released(msg.sender, releaseOrMintIn.receiver, releaseOrMintIn.amount); + + return Pool.ReleaseOrMintOutV1({destinationAmount: releaseOrMintIn.amount}); + } + + /// @notice Contains the alternative mechanism, in this implementation is "Lock" on outgoing tokens + function _lockReleaseOutgoingMessage( + Pool.LockOrBurnInV1 calldata lockOrBurnIn + ) internal virtual returns (Pool.LockOrBurnOutV1 memory) { + _validateLockOrBurn(lockOrBurnIn); + + // Increase internal accounting of locked tokens for burnLockedUSDC() migration + s_lockedTokensByChainSelector[lockOrBurnIn.remoteChainSelector] += lockOrBurnIn.amount; + + emit Locked(msg.sender, lockOrBurnIn.amount); + + return Pool.LockOrBurnOutV1({destTokenAddress: getRemoteToken(lockOrBurnIn.remoteChainSelector), destPoolData: ""}); + } + + // ================================================================ + // │ Liquidity Management | + // ================================================================ + + /// @notice Gets LiquidityManager, can be address(0) if none is configured. + /// @return The current liquidity manager for the given chain selector + function getLiquidityProvider(uint64 remoteChainSelector) external view returns (address) { + return s_liquidityProvider[remoteChainSelector]; + } + + /// @notice Sets the LiquidityManager address. + /// @dev Only callable by the owner. + function setLiquidityProvider(uint64 remoteChainSelector, address liquidityProvider) external onlyOwner { + address oldProvider = s_liquidityProvider[remoteChainSelector]; + + s_liquidityProvider[remoteChainSelector] = liquidityProvider; + + emit LiquidityProviderSet(oldProvider, liquidityProvider, remoteChainSelector); + } + + /// @notice Adds liquidity to the pool for a specific chain. The tokens should be approved first. + /// @dev Liquidity is expected to be added on a per chain basis. Parties are expected to provide liquidity for their + /// own chain which implements non canonical USDC and liquidity is not shared across lanes. + /// @param amount The amount of liquidity to provide. + /// @param remoteChainSelector The chain for which liquidity is provided to. Necessary to ensure there's accurate + /// parity between locked USDC in this contract and the circulating supply on the remote chain + function provideLiquidity(uint64 remoteChainSelector, uint256 amount) external { + if (s_liquidityProvider[remoteChainSelector] != msg.sender) revert TokenPool.Unauthorized(msg.sender); + + s_lockedTokensByChainSelector[remoteChainSelector] += amount; + + i_token.safeTransferFrom(msg.sender, address(this), amount); + + emit ILiquidityContainer.LiquidityAdded(msg.sender, amount); + } + + /// @notice Removed liquidity to the pool. The tokens will be sent to msg.sender. + /// @param remoteChainSelector The chain where liquidity is being released. + /// @param amount The amount of liquidity to remove. + /// @dev The function should only be called if non canonical USDC on the remote chain has been burned and is not being + /// withdrawn on this chain, otherwise a mismatch may occur between locked token balance and remote circulating supply + /// which may block a potential future migration of the chain to CCTP. + function withdrawLiquidity(uint64 remoteChainSelector, uint256 amount) external { + if (s_liquidityProvider[remoteChainSelector] != msg.sender) revert TokenPool.Unauthorized(msg.sender); + + s_lockedTokensByChainSelector[remoteChainSelector] -= amount; + + i_token.safeTransfer(msg.sender, amount); + emit ILiquidityContainer.LiquidityRemoved(msg.sender, amount); + } + + /// @notice This function can be used to transfer liquidity from an older version of the pool to this pool. To do so + /// this pool will have to be set as the liquidity provider in the older version of the pool. This allows it to transfer the + /// funds in the old pool to the new pool. + /// @dev When upgrading a LockRelease pool, this function can be called at the same time as the pool is changed in the + /// TokenAdminRegistry. This allows for a smooth transition of both liquidity and transactions to the new pool. + /// Alternatively, when no multicall is available, a portion of the funds can be transferred to the new pool before + /// changing which pool CCIP uses, to ensure both pools can operate. Then the pool should be changed in the + /// TokenAdminRegistry, which will activate the new pool. All new transactions will use the new pool and its + /// liquidity. Finally, the remaining liquidity can be transferred to the new pool using this function one more time. + /// @param from The address of the old pool. + /// @param amount The amount of liquidity to transfer. + function transferLiquidity(address from, uint64 remoteChainSelector, uint256 amount) external onlyOwner { + HybridLockReleaseUSDCTokenPool(from).withdrawLiquidity(remoteChainSelector, amount); + + s_lockedTokensByChainSelector[remoteChainSelector] += amount; + + emit LiquidityTransferred(from, remoteChainSelector, amount); + } + + // ================================================================ + // │ Alt Mechanism Logic | + // ================================================================ + + /// @notice Return whether a lane should use the alternative L/R mechanism in the token pool. + /// @param remoteChainSelector the remote chain the lane is interacting with + /// @return bool Return true if the alternative L/R mechanism should be used + function shouldUseLockRelease(uint64 remoteChainSelector) public view virtual returns (bool) { + return s_shouldUseLockRelease[remoteChainSelector]; + } + + /// @notice Updates Updates designations for chains on whether to use primary or alt mechanism on CCIP messages + /// @param removes A list of chain selectors to disable Lock-Release, and enforce BM + /// @param adds A list of chain selectors to enable LR instead of BM + function updateChainSelectorMechanisms(uint64[] calldata removes, uint64[] calldata adds) external onlyOwner { + for (uint256 i = 0; i < removes.length; ++i) { + delete s_shouldUseLockRelease[removes[i]]; + emit LockReleaseDisabled(removes[i]); + } + + for (uint256 i = 0; i < adds.length; ++i) { + s_shouldUseLockRelease[adds[i]] = true; + emit LockReleaseEnabled(adds[i]); + } + } +} diff --git a/contracts/src/v0.8/ccip/pools/USDC/IMessageTransmitter.sol b/contracts/src/v0.8/ccip/pools/USDC/IMessageTransmitter.sol new file mode 100644 index 00000000000..1b2a0f90210 --- /dev/null +++ b/contracts/src/v0.8/ccip/pools/USDC/IMessageTransmitter.sol @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2022, Circle Internet Financial Limited. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +pragma solidity ^0.8.0; + +interface IMessageTransmitter { + /// @notice Unlocks USDC tokens on the destination chain + /// @param message The original message on the source chain + /// * Message format: + /// * Field Bytes Type Index + /// * version 4 uint32 0 + /// * sourceDomain 4 uint32 4 + /// * destinationDomain 4 uint32 8 + /// * nonce 8 uint64 12 + /// * sender 32 bytes32 20 + /// * recipient 32 bytes32 52 + /// * destinationCaller 32 bytes32 84 + /// * messageBody dynamic bytes 116 + /// param attestation A valid attestation is the concatenated 65-byte signature(s) of + /// exactly `thresholdSignature` signatures, in increasing order of attester address. + /// ***If the attester addresses recovered from signatures are not in increasing order, + /// signature verification will fail.*** + /// If incorrect number of signatures or duplicate signatures are supplied, + /// signature verification will fail. + function receiveMessage(bytes calldata message, bytes calldata attestation) external returns (bool success); + + /// Returns domain of chain on which the contract is deployed. + /// @dev immutable + function localDomain() external view returns (uint32); + + /// Returns message format version. + /// @dev immutable + function version() external view returns (uint32); +} diff --git a/contracts/src/v0.8/ccip/pools/USDC/ITokenMessenger.sol b/contracts/src/v0.8/ccip/pools/USDC/ITokenMessenger.sol new file mode 100644 index 00000000000..ce5923cfdcd --- /dev/null +++ b/contracts/src/v0.8/ccip/pools/USDC/ITokenMessenger.sol @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2022, Circle Internet Financial Limited. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +pragma solidity ^0.8.0; + +interface ITokenMessenger { + /// @notice Emitted when a DepositForBurn message is sent + /// @param nonce Unique nonce reserved by message + /// @param burnToken Address of token burnt on source domain + /// @param amount Deposit amount + /// @param depositor Address where deposit is transferred from + /// @param mintRecipient Address receiving minted tokens on destination domain as bytes32 + /// @param destinationDomain Destination domain + /// @param destinationTokenMessenger Address of TokenMessenger on destination domain as bytes32 + /// @param destinationCaller Authorized caller as bytes32 of receiveMessage() on destination domain, + /// if not equal to bytes32(0). If equal to bytes32(0), any address can call receiveMessage(). + event DepositForBurn( + uint64 indexed nonce, + address indexed burnToken, + uint256 amount, + address indexed depositor, + bytes32 mintRecipient, + uint32 destinationDomain, + bytes32 destinationTokenMessenger, + bytes32 destinationCaller + ); + + /// @notice Burns the tokens on the source side to produce a nonce through + /// Circles Cross Chain Transfer Protocol. + /// @param amount Amount of tokens to deposit and burn. + /// @param destinationDomain Destination domain identifier. + /// @param mintRecipient Address of mint recipient on destination domain. + /// @param burnToken Address of contract to burn deposited tokens, on local domain. + /// @param destinationCaller Caller on the destination domain, as bytes32. + /// @return nonce The unique nonce used in unlocking the funds on the destination chain. + /// @dev emits DepositForBurn + function depositForBurnWithCaller( + uint256 amount, + uint32 destinationDomain, + bytes32 mintRecipient, + address burnToken, + bytes32 destinationCaller + ) external returns (uint64 nonce); + + /// Returns the version of the message body format. + /// @dev immutable + function messageBodyVersion() external view returns (uint32); + + /// Returns local Message Transmitter responsible for sending and receiving messages + /// to/from remote domainsmessage transmitter for this token messenger. + /// @dev immutable + function localMessageTransmitter() external view returns (address); +} diff --git a/contracts/src/v0.8/ccip/pools/USDC/USDCBridgeMigrator.sol b/contracts/src/v0.8/ccip/pools/USDC/USDCBridgeMigrator.sol new file mode 100644 index 00000000000..827787f4cf2 --- /dev/null +++ b/contracts/src/v0.8/ccip/pools/USDC/USDCBridgeMigrator.sol @@ -0,0 +1,119 @@ +pragma solidity ^0.8.24; + +import {OwnerIsCreator} from "../../../shared/access/OwnerIsCreator.sol"; +import {IBurnMintERC20} from "../../../shared/token/ERC20/IBurnMintERC20.sol"; + +import {EnumerableSet} from "../../../vendor/openzeppelin-solidity/v4.8.3/contracts/utils/structs/EnumerableSet.sol"; + +import {Router} from "../../Router.sol"; + +/// @notice Allows migration of a lane in a token pool from Lock/Release to CCTP supported Burn/Mint. Contract +/// functionality is based on hard requirements defined by Circle to allow future CCTP compatibility +/// @dev Once a migration for a lane has occured, it can never be reversed, and CCTP will be the mechanism forever. This makes the assumption that Circle will continue to support that lane indefinitely. +abstract contract USDCBridgeMigrator is OwnerIsCreator { + using EnumerableSet for EnumerableSet.UintSet; + + event CCTPMigrationProposed(uint64 remoteChainSelector); + event CCTPMigrationExecuted(uint64 remoteChainSelector, uint256 USDCBurned); + event CCTPMigrationCancelled(uint64 existingProposalSelector); + event CircleMigratorAddressSet(address migratorAddress); + + error onlyCircle(); + error ExistingMigrationProposal(); + error NoExistingMigrationProposal(); + error NoMigrationProposalPending(); + error InvalidChainSelector(uint64 remoteChainSelector); + + IBurnMintERC20 internal immutable i_USDC; + Router internal immutable i_router; + + address internal s_circleUSDCMigrator; + uint64 internal s_proposedUSDCMigrationChain; + + mapping(uint64 chainSelector => uint256 lockedBalance) internal s_lockedTokensByChainSelector; + + mapping(uint64 chainSelector => bool shouldUseLockRelease) internal s_shouldUseLockRelease; + + constructor(address token, address router) { + i_USDC = IBurnMintERC20(token); + i_router = Router(router); + } + + /// @notice Burn USDC locked for a specific lane so that destination USDC can be converted from + /// non-canonical to canonical USDC. + /// @dev This function can only be called by an address specified by the owner to be controlled by circle + /// @dev proposeCCTPMigration must be called first on an approved lane to execute properly. + /// @dev This function signature should NEVER be overwritten, otherwise it will be unable to be called by + /// circle to properly migrate USDC over to CCTP. + function burnLockedUSDC() public { + if (msg.sender != s_circleUSDCMigrator) revert onlyCircle(); + if (s_proposedUSDCMigrationChain == 0) revert ExistingMigrationProposal(); + + uint64 burnChainSelector = s_proposedUSDCMigrationChain; + uint256 tokensToBurn = s_lockedTokensByChainSelector[burnChainSelector]; + + // Even though USDC is a trusted call, ensure CEI by updating state first + delete s_lockedTokensByChainSelector[burnChainSelector]; + delete s_proposedUSDCMigrationChain; + + // This should only be called after this contract has been granted a "zero allowance minter role" on USDC by Circle, + // otherwise the call will revert. Executing this burn will functionally convert all USDC on the destination chain + // to canonical USDC by removing the canonical USDC backing it from circulation. + i_USDC.burn(tokensToBurn); + + // Disable L/R automatically on burned chain and enable CCTP + delete s_shouldUseLockRelease[burnChainSelector]; + + emit CCTPMigrationExecuted(burnChainSelector, tokensToBurn); + } + + /// @notice Propose a destination chain to migrate from lock/release mechanism to CCTP enabled burn/mint + /// through a Circle controlled burn. + /// @param remoteChainSelector the CCIP specific selector for the remote chain currently using a + /// non-canonical form of USDC which they wish to update to canonical. Function will revert if the chain + /// selector is zero, or if a migration has already occured for the specified selector. + /// @dev This function can only be called by the owner + function proposeCCTPMigration(uint64 remoteChainSelector) external onlyOwner { + // Prevent overwriting existing migration proposals until the current one is finished + if (s_proposedUSDCMigrationChain != 0) revert ExistingMigrationProposal(); + + s_proposedUSDCMigrationChain = remoteChainSelector; + + emit CCTPMigrationProposed(remoteChainSelector); + } + + /// @notice Cancel an existing proposal to migrate a lane to CCTP. + function cancelExistingCCTPMigrationProposal() external onlyOwner { + if (s_proposedUSDCMigrationChain == 0) revert NoExistingMigrationProposal(); + + uint64 currentProposalChainSelector = s_proposedUSDCMigrationChain; + delete s_proposedUSDCMigrationChain; + + emit CCTPMigrationCancelled(currentProposalChainSelector); + } + + /// @notice retrieve the chain selector for an ongoing CCTP migration in progress. + /// @return uint64 the chain selector of the lane to be migrated. Will be zero if no proposal currently + /// exists + function getCurrentProposedCCTPChainMigration() public view returns (uint64) { + return s_proposedUSDCMigrationChain; + } + + /// @notice Set the address of the circle-controlled wallet which will execute a CCTP lane migration + /// @dev The function should only be invoked once the address has been confirmed by Circle prior to + /// chain expansion. + function setCircleMigratorAddress(address migrator) external onlyOwner { + s_circleUSDCMigrator = migrator; + + emit CircleMigratorAddressSet(migrator); + } + + /// @notice Retrieve the amount of canonical USDC locked into this lane and minted on the destination + /// @param remoteChainSelector the CCIP specific destination chain implementing a mintable and + /// non-canonical form of USDC at present. + /// @return uint256 the amount of USDC locked into the specified lane. If non-zero, the number + /// should match the current circulating supply of USDC on the destination chain + function getLockedTokensForChain(uint64 remoteChainSelector) public view returns (uint256) { + return s_lockedTokensByChainSelector[remoteChainSelector]; + } +} diff --git a/contracts/src/v0.8/ccip/pools/USDC/USDCTokenPool.sol b/contracts/src/v0.8/ccip/pools/USDC/USDCTokenPool.sol new file mode 100644 index 00000000000..56ab40c9b5c --- /dev/null +++ b/contracts/src/v0.8/ccip/pools/USDC/USDCTokenPool.sol @@ -0,0 +1,228 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {ITypeAndVersion} from "../../../shared/interfaces/ITypeAndVersion.sol"; +import {IMessageTransmitter} from "./IMessageTransmitter.sol"; +import {ITokenMessenger} from "./ITokenMessenger.sol"; + +import {Pool} from "../../libraries/Pool.sol"; +import {TokenPool} from "../TokenPool.sol"; + +import {IERC20} from "../../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/IERC20.sol"; +import {SafeERC20} from "../../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/utils/SafeERC20.sol"; + +/// @notice This pool mints and burns USDC tokens through the Cross Chain Transfer +/// Protocol (CCTP). +contract USDCTokenPool is TokenPool, ITypeAndVersion { + using SafeERC20 for IERC20; + + event DomainsSet(DomainUpdate[]); + event ConfigSet(address tokenMessenger); + + error UnknownDomain(uint64 domain); + error UnlockingUSDCFailed(); + error InvalidConfig(); + error InvalidDomain(DomainUpdate domain); + error InvalidMessageVersion(uint32 version); + error InvalidTokenMessengerVersion(uint32 version); + error InvalidNonce(uint64 expected, uint64 got); + error InvalidSourceDomain(uint32 expected, uint32 got); + error InvalidDestinationDomain(uint32 expected, uint32 got); + error InvalidReceiver(bytes receiver); + + // This data is supplied from offchain and contains everything needed + // to receive the USDC tokens. + struct MessageAndAttestation { + bytes message; + bytes attestation; + } + + // A domain is a USDC representation of a chain. + struct DomainUpdate { + bytes32 allowedCaller; // Address allowed to mint on the domain + uint32 domainIdentifier; // ──╮ Unique domain ID + uint64 destChainSelector; // │ The destination chain for this domain + bool enabled; // ─────────────╯ Whether the domain is enabled + } + + struct SourceTokenDataPayload { + uint64 nonce; + uint32 sourceDomain; + } + + string public constant override typeAndVersion = "USDCTokenPool 1.5.0"; + + // We restrict to the first version. New pool may be required for subsequent versions. + uint32 public constant SUPPORTED_USDC_VERSION = 0; + + // The local USDC config + ITokenMessenger public immutable i_tokenMessenger; + IMessageTransmitter public immutable i_messageTransmitter; + uint32 public immutable i_localDomainIdentifier; + + /// A domain is a USDC representation of a destination chain. + /// @dev Zero is a valid domain identifier. + /// @dev The address to mint on the destination chain is the corresponding USDC pool. + struct Domain { + bytes32 allowedCaller; // Address allowed to mint on the domain + uint32 domainIdentifier; // ─╮ Unique domain ID + bool enabled; // ────────────╯ Whether the domain is enabled + } + + // A mapping of CCIP chain identifiers to destination domains + mapping(uint64 chainSelector => Domain CCTPDomain) private s_chainToDomain; + + constructor( + ITokenMessenger tokenMessenger, + IERC20 token, + address[] memory allowlist, + address rmnProxy, + address router + ) TokenPool(token, allowlist, rmnProxy, router) { + if (address(tokenMessenger) == address(0)) revert InvalidConfig(); + IMessageTransmitter transmitter = IMessageTransmitter(tokenMessenger.localMessageTransmitter()); + uint32 transmitterVersion = transmitter.version(); + if (transmitterVersion != SUPPORTED_USDC_VERSION) revert InvalidMessageVersion(transmitterVersion); + uint32 tokenMessengerVersion = tokenMessenger.messageBodyVersion(); + if (tokenMessengerVersion != SUPPORTED_USDC_VERSION) revert InvalidTokenMessengerVersion(tokenMessengerVersion); + + i_tokenMessenger = tokenMessenger; + i_messageTransmitter = transmitter; + i_localDomainIdentifier = transmitter.localDomain(); + i_token.safeIncreaseAllowance(address(i_tokenMessenger), type(uint256).max); + emit ConfigSet(address(tokenMessenger)); + } + + /// @notice Burn the token in the pool + /// @dev emits ITokenMessenger.DepositForBurn + /// @dev Assumes caller has validated destinationReceiver + function lockOrBurn( + Pool.LockOrBurnInV1 calldata lockOrBurnIn + ) public virtual override returns (Pool.LockOrBurnOutV1 memory) { + _validateLockOrBurn(lockOrBurnIn); + + Domain memory domain = s_chainToDomain[lockOrBurnIn.remoteChainSelector]; + if (!domain.enabled) revert UnknownDomain(lockOrBurnIn.remoteChainSelector); + + if (lockOrBurnIn.receiver.length != 32) { + revert InvalidReceiver(lockOrBurnIn.receiver); + } + bytes32 decodedReceiver = abi.decode(lockOrBurnIn.receiver, (bytes32)); + + // Since this pool is the msg sender of the CCTP transaction, only this contract + // is able to call replaceDepositForBurn. Since this contract does not implement + // replaceDepositForBurn, the tokens cannot be maliciously re-routed to another address. + uint64 nonce = i_tokenMessenger.depositForBurnWithCaller( + lockOrBurnIn.amount, domain.domainIdentifier, decodedReceiver, address(i_token), domain.allowedCaller + ); + + emit Burned(msg.sender, lockOrBurnIn.amount); + + return Pool.LockOrBurnOutV1({ + destTokenAddress: getRemoteToken(lockOrBurnIn.remoteChainSelector), + destPoolData: abi.encode(SourceTokenDataPayload({nonce: nonce, sourceDomain: i_localDomainIdentifier})) + }); + } + + /// @notice Mint tokens from the pool to the recipient + /// * sourceTokenData is part of the verified message and passed directly from + /// the offramp so it is guaranteed to be what the lockOrBurn pool released on the + /// source chain. It contains (nonce, sourceDomain) which is guaranteed by CCTP + /// to be unique. + /// * offchainTokenData is untrusted (can be supplied by manual execution), but we assert + /// that (nonce, sourceDomain) is equal to the message's (nonce, sourceDomain) and + /// receiveMessage will assert that Attestation contains a valid attestation signature + /// for that message, including its (nonce, sourceDomain). This way, the only + /// non-reverting offchainTokenData that can be supplied is a valid attestation for the + /// specific message that was sent on source. + function releaseOrMint( + Pool.ReleaseOrMintInV1 calldata releaseOrMintIn + ) public virtual override returns (Pool.ReleaseOrMintOutV1 memory) { + _validateReleaseOrMint(releaseOrMintIn); + SourceTokenDataPayload memory sourceTokenDataPayload = + abi.decode(releaseOrMintIn.sourcePoolData, (SourceTokenDataPayload)); + MessageAndAttestation memory msgAndAttestation = + abi.decode(releaseOrMintIn.offchainTokenData, (MessageAndAttestation)); + + _validateMessage(msgAndAttestation.message, sourceTokenDataPayload); + + if (!i_messageTransmitter.receiveMessage(msgAndAttestation.message, msgAndAttestation.attestation)) { + revert UnlockingUSDCFailed(); + } + + emit Minted(msg.sender, releaseOrMintIn.receiver, releaseOrMintIn.amount); + return Pool.ReleaseOrMintOutV1({destinationAmount: releaseOrMintIn.amount}); + } + + /// @notice Validates the USDC encoded message against the given parameters. + /// @param usdcMessage The USDC encoded message + /// @param sourceTokenData The expected source chain token data to check against + /// @dev Only supports version SUPPORTED_USDC_VERSION of the CCTP message format + /// @dev Message format for USDC: + /// * Field Bytes Type Index + /// * version 4 uint32 0 + /// * sourceDomain 4 uint32 4 + /// * destinationDomain 4 uint32 8 + /// * nonce 8 uint64 12 + /// * sender 32 bytes32 20 + /// * recipient 32 bytes32 52 + /// * destinationCaller 32 bytes32 84 + /// * messageBody dynamic bytes 116 + function _validateMessage(bytes memory usdcMessage, SourceTokenDataPayload memory sourceTokenData) internal view { + uint32 version; + // solhint-disable-next-line no-inline-assembly + assembly { + // We truncate using the datatype of the version variable, meaning + // we will only be left with the first 4 bytes of the message. + version := mload(add(usdcMessage, 4)) // 0 + 4 = 4 + } + // This token pool only supports version 0 of the CCTP message format + // We check the version prior to loading the rest of the message + // to avoid unexpected reverts due to out-of-bounds reads. + if (version != SUPPORTED_USDC_VERSION) revert InvalidMessageVersion(version); + + uint32 sourceDomain; + uint32 destinationDomain; + uint64 nonce; + + // solhint-disable-next-line no-inline-assembly + assembly { + sourceDomain := mload(add(usdcMessage, 8)) // 4 + 4 = 8 + destinationDomain := mload(add(usdcMessage, 12)) // 8 + 4 = 12 + nonce := mload(add(usdcMessage, 20)) // 12 + 8 = 20 + } + + if (sourceDomain != sourceTokenData.sourceDomain) { + revert InvalidSourceDomain(sourceTokenData.sourceDomain, sourceDomain); + } + if (destinationDomain != i_localDomainIdentifier) { + revert InvalidDestinationDomain(i_localDomainIdentifier, destinationDomain); + } + if (nonce != sourceTokenData.nonce) revert InvalidNonce(sourceTokenData.nonce, nonce); + } + + // ================================================================ + // │ Config │ + // ================================================================ + + /// @notice Gets the CCTP domain for a given CCIP chain selector. + function getDomain(uint64 chainSelector) external view returns (Domain memory) { + return s_chainToDomain[chainSelector]; + } + + /// @notice Sets the CCTP domain for a CCIP chain selector. + /// @dev Must verify mapping of selectors -> (domain, caller) offchain. + function setDomains(DomainUpdate[] calldata domains) external onlyOwner { + for (uint256 i = 0; i < domains.length; ++i) { + DomainUpdate memory domain = domains[i]; + if (domain.allowedCaller == bytes32(0) || domain.destChainSelector == 0) revert InvalidDomain(domain); + + s_chainToDomain[domain.destChainSelector] = Domain({ + domainIdentifier: domain.domainIdentifier, + allowedCaller: domain.allowedCaller, + enabled: domain.enabled + }); + } + emit DomainsSet(domains); + } +} diff --git a/contracts/src/v0.8/ccip/rmn/RMNHome.sol b/contracts/src/v0.8/ccip/rmn/RMNHome.sol new file mode 100644 index 00000000000..0d3d7d98036 --- /dev/null +++ b/contracts/src/v0.8/ccip/rmn/RMNHome.sol @@ -0,0 +1,164 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.24; + +import "@openzeppelin/contracts/access/Ownable2Step.sol"; + +import {ITypeAndVersion} from "../../shared/interfaces/ITypeAndVersion.sol"; + +/// @notice Stores the home configuration for RMN, that is referenced by CCIP oracles, RMN nodes, and the RMNRemote +/// contracts. +contract RMNHome is Ownable2Step, ITypeAndVersion { + /// @dev temp placeholder to exclude this contract from coverage + function test() public {} + + string public constant override typeAndVersion = "RMNHome 1.6.0-dev"; + uint256 public constant CONFIG_RING_BUFFER_SIZE = 2; + + struct Node { + string peerId; // used for p2p communication, base58 encoded + bytes32 offchainPublicKey; // observations are signed with this public key, and are only verified offchain + } + + struct SourceChain { + uint64 chainSelector; + uint64[] observerNodeIndices; // indices into Config.nodes, strictly increasing + uint64 minObservers; // required to agree on an observation for this source chain + } + + struct Config { + // No sorting requirement for nodes, but ensure that SourceChain.observerNodeIndices in the home chain config & + // Signer.nodeIndex in the remote chain configs are appropriately updated when changing this field + Node[] nodes; + // Should be in ascending order of chainSelector + SourceChain[] sourceChains; + } + + struct VersionedConfig { + uint32 version; + Config config; + } + + function _configDigest(VersionedConfig memory versionedConfig) internal pure returns (bytes32) { + uint256 h = uint256(keccak256(abi.encode(versionedConfig))); + uint256 prefixMask = type(uint256).max << (256 - 16); // 0xFFFF00..00 + uint256 prefix = 0x000b << (256 - 16); // 0x000b00..00 + return bytes32((prefix & prefixMask) | (h & ~prefixMask)); + } + + // if we were to have VersionedConfig instead of Config in the ring buffer, we couldn't assign directly to it in + // setConfig without via-ir + uint32[CONFIG_RING_BUFFER_SIZE] s_configCounts; // s_configCounts[i] == 0 iff s_configs[i] is unusable + Config[CONFIG_RING_BUFFER_SIZE] s_configs; + uint256 s_latestConfigIndex; + bytes32 s_latestConfigDigest; + + /// @param revokePastConfigs if one wants to revoke all past configs, because some past config is faulty + function setConfig(Config calldata newConfig, bool revokePastConfigs) external onlyOwner { + // sanity checks + { + // no peerId or offchainPublicKey is duplicated + for (uint256 i = 0; i < newConfig.nodes.length; ++i) { + for (uint256 j = i + 1; j < newConfig.nodes.length; ++j) { + if (keccak256(abi.encode(newConfig.nodes[i].peerId)) == keccak256(abi.encode(newConfig.nodes[j].peerId))) { + revert DuplicatePeerId(); + } + if (newConfig.nodes[i].offchainPublicKey == newConfig.nodes[j].offchainPublicKey) { + revert DuplicateOffchainPublicKey(); + } + } + } + + for (uint256 i = 0; i < newConfig.sourceChains.length; ++i) { + // source chains are in strictly increasing order of chain selectors + if (i > 0 && !(newConfig.sourceChains[i - 1].chainSelector < newConfig.sourceChains[i].chainSelector)) { + revert OutOfOrderSourceChains(); + } + + // all observerNodeIndices are valid + for (uint256 j = 0; j < newConfig.sourceChains[i].observerNodeIndices.length; ++j) { + if ( + j > 0 + && !(newConfig.sourceChains[i].observerNodeIndices[j - 1] < newConfig.sourceChains[i].observerNodeIndices[j]) + ) { + revert OutOfOrderObserverNodeIndices(); + } + if (!(newConfig.sourceChains[i].observerNodeIndices[j] < newConfig.nodes.length)) { + revert OutOfBoundsObserverNodeIndex(); + } + } + + // minObservers are tenable + if (!(newConfig.sourceChains[i].minObservers <= newConfig.sourceChains[i].observerNodeIndices.length)) { + revert MinObserversTooHigh(); + } + } + } + + uint256 oldConfigIndex = s_latestConfigIndex; + uint32 oldConfigCount = s_configCounts[oldConfigIndex]; + uint256 newConfigIndex = (oldConfigIndex + 1) % CONFIG_RING_BUFFER_SIZE; + + for (uint256 i = 0; i < CONFIG_RING_BUFFER_SIZE; ++i) { + if ((i == newConfigIndex || revokePastConfigs) && s_configCounts[i] > 0) { + emit ConfigRevoked(_configDigest(VersionedConfig({version: s_configCounts[i], config: s_configs[i]}))); + delete s_configCounts[i]; + } + } + + uint32 newConfigCount = oldConfigCount + 1; + VersionedConfig memory newVersionedConfig = VersionedConfig({version: newConfigCount, config: newConfig}); + bytes32 newConfigDigest = _configDigest(newVersionedConfig); + s_configs[newConfigIndex] = newConfig; + s_configCounts[newConfigIndex] = newConfigCount; + s_latestConfigIndex = newConfigIndex; + s_latestConfigDigest = newConfigDigest; + emit ConfigSet(newConfigDigest, newVersionedConfig); + } + + /// @return configDigest will be zero in case no config has been set + function getLatestConfigDigestAndVersionedConfig() + external + view + returns (bytes32 configDigest, VersionedConfig memory) + { + return ( + s_latestConfigDigest, + VersionedConfig({version: s_configCounts[s_latestConfigIndex], config: s_configs[s_latestConfigIndex]}) + ); + } + + /// @notice The offchain code can use this to fetch an old config which might still be in use by some remotes + /// @dev Only to be called by offchain code, efficiency is not a concern + function getConfig(bytes32 configDigest) external view returns (VersionedConfig memory versionedConfig, bool ok) { + for (uint256 i = 0; i < CONFIG_RING_BUFFER_SIZE; ++i) { + if (s_configCounts[i] == 0) { + // unset config + continue; + } + VersionedConfig memory vc = VersionedConfig({version: s_configCounts[i], config: s_configs[i]}); + if (_configDigest(vc) == configDigest) { + versionedConfig = vc; + ok = true; + break; + } + } + } + + /// + /// Events + /// + + event ConfigSet(bytes32 configDigest, VersionedConfig versionedConfig); + event ConfigRevoked(bytes32 configDigest); + + /// + /// Errors + /// + + error DuplicatePeerId(); + error DuplicateOffchainPublicKey(); + error OutOfOrderSourceChains(); + error OutOfOrderObserverNodeIndices(); + error OutOfBoundsObserverNodeIndex(); + error MinObserversTooHigh(); +} diff --git a/contracts/src/v0.8/ccip/rmn/RMNRemote.sol b/contracts/src/v0.8/ccip/rmn/RMNRemote.sol new file mode 100644 index 00000000000..3ebbf4af801 --- /dev/null +++ b/contracts/src/v0.8/ccip/rmn/RMNRemote.sol @@ -0,0 +1,168 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.24; + +import {OwnerIsCreator} from "../../shared/access/OwnerIsCreator.sol"; +import {ITypeAndVersion} from "../../shared/interfaces/ITypeAndVersion.sol"; +import {IRMNV2} from "../interfaces/IRMNV2.sol"; +import {Internal} from "../libraries/Internal.sol"; + +bytes32 constant RMN_V1_6_ANY2EVM_REPORT = keccak256("RMN_V1_6_ANY2EVM_REPORT"); + +/// @dev XXX DO NOT USE THIS CONTRACT, NOT PRODUCTION READY XXX +/// @notice This contract supports verification of RMN reports for any Any2EVM OffRamp. +contract RMNRemote is OwnerIsCreator, ITypeAndVersion, IRMNV2 { + /// @dev temp placeholder to exclude this contract from coverage + function test() public {} + + string public constant override typeAndVersion = "RMNRemote 1.6.0-dev"; + + uint64 internal immutable i_chainSelector; + + constructor(uint64 chainSelector) { + i_chainSelector = chainSelector; + } + + struct Signer { + address onchainPublicKey; // for signing reports + uint64 nodeIndex; // maps to nodes in home chain config, should be strictly increasing + } + + struct Config { + bytes32 rmnHomeContractConfigDigest; + Signer[] signers; + uint64 minSigners; + } + + struct VersionedConfig { + uint32 version; + Config config; + } + + Config s_config; + uint32 s_configCount; + + mapping(address signer => bool exists) s_signers; // for more gas efficient verify + + function setConfig(Config calldata newConfig) external onlyOwner { + // sanity checks + { + // signers are in ascending order of nodeIndex + for (uint256 i = 1; i < newConfig.signers.length; ++i) { + if (!(newConfig.signers[i - 1].nodeIndex < newConfig.signers[i].nodeIndex)) { + revert InvalidSignerOrder(); + } + } + + // minSigners is tenable + if (!(newConfig.minSigners <= newConfig.signers.length)) { + revert MinSignersTooHigh(); + } + } + + // clear the old signers + { + Config storage oldConfig = s_config; + while (oldConfig.signers.length > 0) { + delete s_signers[oldConfig.signers[oldConfig.signers.length - 1].onchainPublicKey]; + oldConfig.signers.pop(); + } + } + + // set the new signers + { + for (uint256 i = 0; i < newConfig.signers.length; ++i) { + if (s_signers[newConfig.signers[i].onchainPublicKey]) { + revert DuplicateOnchainPublicKey(); + } + s_signers[newConfig.signers[i].onchainPublicKey] = true; + } + } + + s_config = newConfig; + uint32 newConfigCount = ++s_configCount; + emit ConfigSet(VersionedConfig({version: newConfigCount, config: newConfig})); + } + + function getVersionedConfig() external view returns (VersionedConfig memory) { + return VersionedConfig({version: s_configCount, config: s_config}); + } + + struct Report { + uint256 destChainId; // to guard against chain selector misconfiguration + uint64 destChainSelector; + address rmnRemoteContractAddress; + address offrampAddress; + bytes32 rmnHomeContractConfigDigest; + Internal.MerkleRoot[] destLaneUpdates; + } + + /// @notice Verifies signatures of RMN nodes, on dest lane updates as provided in the CommitReport + /// @param destLaneUpdates must be well formed, and is a representation of the CommitReport received from the oracles + /// @param signatures must be sorted in ascending order by signer address + /// @dev Will revert if verification fails. Needs to be called by the OffRamp for which the signatures are produced, + /// otherwise verification will fail. + function verify(Internal.MerkleRoot[] memory destLaneUpdates, Signature[] memory signatures) external view { + return; // XXX temporary workaround to fix integration tests while we wait to productionize this contract + + if (s_configCount == 0) { + revert ConfigNotSet(); + } + + bytes32 signedHash = keccak256( + abi.encode( + RMN_V1_6_ANY2EVM_REPORT, + Report({ + destChainId: block.chainid, + destChainSelector: i_chainSelector, + rmnRemoteContractAddress: address(this), + offrampAddress: msg.sender, + rmnHomeContractConfigDigest: s_config.rmnHomeContractConfigDigest, + destLaneUpdates: destLaneUpdates + }) + ) + ); + + uint256 numSigners = 0; + address prevAddress = address(0); + for (uint256 i = 0; i < signatures.length; ++i) { + Signature memory sig = signatures[i]; + address signerAddress = ecrecover(signedHash, 27, sig.r, sig.s); + if (signerAddress == address(0)) revert InvalidSignature(); + if (!(prevAddress < signerAddress)) revert OutOfOrderSignatures(); + if (!s_signers[signerAddress]) revert UnexpectedSigner(); + prevAddress = signerAddress; + ++numSigners; + } + if (numSigners < s_config.minSigners) revert ThresholdNotMet(); + } + + /// @notice If there is an active global or legacy curse, this function returns true. + function isCursed() external view returns (bool) { + return false; // XXX temporary workaround + } + + /// @notice If there is an active global curse, or an active curse for `subject`, this function returns true. + /// @param subject To check whether a particular chain is cursed, set to bytes16(uint128(chainSelector)). + function isCursed(bytes16 subject) external view returns (bool) { + return false; // XXX temporary workaround + } + + /// + /// Events + /// + + event ConfigSet(VersionedConfig versionedConfig); + + /// + /// Errors + /// + + error InvalidSignature(); + error OutOfOrderSignatures(); + error UnexpectedSigner(); + error ThresholdNotMet(); + error ConfigNotSet(); + error InvalidSignerOrder(); + error MinSignersTooHigh(); + error DuplicateOnchainPublicKey(); +} diff --git a/contracts/src/v0.8/ccip/test/BaseTest.t.sol b/contracts/src/v0.8/ccip/test/BaseTest.t.sol new file mode 100644 index 00000000000..e8003cab15b --- /dev/null +++ b/contracts/src/v0.8/ccip/test/BaseTest.t.sol @@ -0,0 +1,131 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +// Imports to any non-library are not allowed due to the significant cascading +// compile time increase they cause when imported into this base test. + +import {IRMNV2} from "../interfaces/IRMNV2.sol"; +import {Internal} from "../libraries/Internal.sol"; +import {RateLimiter} from "../libraries/RateLimiter.sol"; +import {MockRMN} from "./mocks/MockRMN.sol"; +import {Test} from "forge-std/Test.sol"; + +contract BaseTest is Test { + // Addresses + address internal constant OWNER = 0x00007e64E1fB0C487F25dd6D3601ff6aF8d32e4e; + address internal constant STRANGER = address(999999); + address internal constant DUMMY_CONTRACT_ADDRESS = 0x1111111111111111111111111111111111111112; + address internal constant ON_RAMP_ADDRESS = 0x11118e64e1FB0c487f25dD6D3601FF6aF8d32E4e; + address internal constant ZERO_ADDRESS = address(0); + address internal constant FEE_AGGREGATOR = 0xa33CDB32eAEce34F6affEfF4899cef45744EDea3; + + address internal constant USER_1 = address(1); + address internal constant USER_2 = address(2); + address internal constant USER_3 = address(3); + address internal constant USER_4 = address(4); + + // Message info + uint64 internal constant SOURCE_CHAIN_SELECTOR = 1; + uint64 internal constant DEST_CHAIN_SELECTOR = 2; + uint32 internal constant GAS_LIMIT = 200_000; + + // Timing + uint256 internal constant BLOCK_TIME = 1234567890; + uint32 internal constant TWELVE_HOURS = 60 * 60 * 12; + + // Onramp + uint96 internal constant MAX_NOP_FEES_JUELS = 1e27; + uint96 internal constant MAX_MSG_FEES_JUELS = 1e18; + uint32 internal constant DEST_GAS_OVERHEAD = 300_000; + uint16 internal constant DEST_GAS_PER_PAYLOAD_BYTE = 16; + + uint16 internal constant DEFAULT_TOKEN_FEE_USD_CENTS = 50; + uint32 internal constant DEFAULT_TOKEN_DEST_GAS_OVERHEAD = 90_000; + uint32 internal constant DEFAULT_TOKEN_BYTES_OVERHEAD = 32; + + bool private s_baseTestInitialized; + + // Use 16 gas per data availability byte in our tests. + // This is an overestimation in OP stack, it ignores 4 gas per 0 byte rule. + // Arbitrum on the other hand, does always use 16 gas per data availability byte. + // This value may be substantially decreased after EIP 4844. + uint16 internal constant DEST_GAS_PER_DATA_AVAILABILITY_BYTE = 16; + + // Total L1 data availability overhead estimate is 33_596 gas. + // This value includes complete CommitStore and OffRamp call data. + uint32 internal constant DEST_DATA_AVAILABILITY_OVERHEAD_GAS = 188 // Fixed data availability overhead in OP stack. + + (32 * 31 + 4) * DEST_GAS_PER_DATA_AVAILABILITY_BYTE // CommitStore single-root transmission takes up about 31 slots, plus selector. + + (32 * 34 + 4) * DEST_GAS_PER_DATA_AVAILABILITY_BYTE; // OffRamp transmission excluding EVM2EVMMessage takes up about 34 slots, plus selector. + + // Multiples of bps, or 0.0001, use 6840 to be same as OP mainnet compression factor of 0.684. + uint16 internal constant DEST_GAS_DATA_AVAILABILITY_MULTIPLIER_BPS = 6840; + + // OffRamp + uint32 internal constant MAX_DATA_SIZE = 30_000; + uint16 internal constant MAX_TOKENS_LENGTH = 5; + uint16 internal constant GAS_FOR_CALL_EXACT_CHECK = 5000; + uint32 internal constant PERMISSION_LESS_EXECUTION_THRESHOLD_SECONDS = 500; + uint32 internal constant MAX_GAS_LIMIT = 4_000_000; + + // Rate limiter + address internal constant ADMIN = 0x11118e64e1FB0c487f25dD6D3601FF6aF8d32E4e; + + MockRMN internal s_mockRMN; + IRMNV2 internal s_mockRMNRemote; + + function setUp() public virtual { + // BaseTest.setUp is often called multiple times from tests' setUp due to inheritance. + if (s_baseTestInitialized) return; + s_baseTestInitialized = true; + + // Set the sender to OWNER permanently + vm.startPrank(OWNER); + deal(OWNER, 1e20); + vm.label(OWNER, "Owner"); + vm.label(STRANGER, "Stranger"); + + // Set the block time to a constant known value + vm.warp(BLOCK_TIME); + + // setup mock RMN & RMNRemote + s_mockRMN = new MockRMN(); + s_mockRMNRemote = IRMNV2(makeAddr("MOCK RMN REMOTE")); + vm.etch(address(s_mockRMNRemote), bytes("fake bytecode")); + vm.mockCall(address(s_mockRMNRemote), abi.encodeWithSelector(IRMNV2.verify.selector), bytes("")); + _setMockRMNGlobalCurse(false); + vm.mockCall(address(s_mockRMNRemote), abi.encodeWithSignature("isCursed(bytes16)"), abi.encode(false)); // no curses by defaule + } + + function _setMockRMNGlobalCurse(bool isCursed) internal { + vm.mockCall(address(s_mockRMNRemote), abi.encodeWithSignature("isCursed()"), abi.encode(isCursed)); + } + + function _setMockRMNChainCurse(uint64 chainSelector, bool isCursed) internal { + vm.mockCall( + address(s_mockRMNRemote), + abi.encodeWithSignature("isCursed(bytes16)", bytes16(uint128(chainSelector))), + abi.encode(isCursed) + ); + } + + function _getOutboundRateLimiterConfig() internal pure returns (RateLimiter.Config memory) { + return RateLimiter.Config({isEnabled: true, capacity: 100e28, rate: 1e15}); + } + + function _getInboundRateLimiterConfig() internal pure returns (RateLimiter.Config memory) { + return RateLimiter.Config({isEnabled: true, capacity: 222e30, rate: 1e18}); + } + + function _getSingleTokenPriceUpdateStruct( + address token, + uint224 price + ) internal pure returns (Internal.PriceUpdates memory) { + Internal.TokenPriceUpdate[] memory tokenPriceUpdates = new Internal.TokenPriceUpdate[](1); + tokenPriceUpdates[0] = Internal.TokenPriceUpdate({sourceToken: token, usdPerToken: price}); + + Internal.PriceUpdates memory priceUpdates = + Internal.PriceUpdates({tokenPriceUpdates: tokenPriceUpdates, gasPriceUpdates: new Internal.GasPriceUpdate[](0)}); + + return priceUpdates; + } +} diff --git a/contracts/src/v0.8/ccip/test/NonceManager.t.sol b/contracts/src/v0.8/ccip/test/NonceManager.t.sol new file mode 100644 index 00000000000..8c61ba5d217 --- /dev/null +++ b/contracts/src/v0.8/ccip/test/NonceManager.t.sol @@ -0,0 +1,673 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {NonceManager} from "../NonceManager.sol"; +import {ICommitStore} from "../interfaces/ICommitStore.sol"; +import {Client} from "../libraries/Client.sol"; +import {Internal} from "../libraries/Internal.sol"; +import {Pool} from "../libraries/Pool.sol"; +import {RateLimiter} from "../libraries/RateLimiter.sol"; +import {OffRamp} from "../offRamp/OffRamp.sol"; +import {EVM2EVMOnRamp} from "../onRamp/EVM2EVMOnRamp.sol"; +import {OnRamp} from "../onRamp/OnRamp.sol"; +import {BaseTest} from "./BaseTest.t.sol"; +import {EVM2EVMOffRampHelper} from "./helpers/EVM2EVMOffRampHelper.sol"; +import {EVM2EVMOnRampHelper} from "./helpers/EVM2EVMOnRampHelper.sol"; +import {MockCommitStore} from "./mocks/MockCommitStore.sol"; +import {OffRampSetup} from "./offRamp/OffRampSetup.t.sol"; +import {OnRampSetup} from "./onRamp/OnRampSetup.t.sol"; +import {Test} from "forge-std/Test.sol"; + +contract NonceManager_typeAndVersion is Test { + NonceManager private s_nonceManager; + + function setUp() public { + s_nonceManager = new NonceManager(new address[](0)); + } + + function test_typeAndVersion() public view { + assertEq(s_nonceManager.typeAndVersion(), "NonceManager 1.6.0-dev"); + } +} + +contract NonceManager_NonceIncrementation is BaseTest { + NonceManager private s_nonceManager; + + function setUp() public override { + address[] memory authorizedCallers = new address[](1); + authorizedCallers[0] = address(this); + s_nonceManager = new NonceManager(authorizedCallers); + } + + function test_getIncrementedOutboundNonce_Success() public { + address sender = address(this); + + assertEq(s_nonceManager.getOutboundNonce(DEST_CHAIN_SELECTOR, sender), 0); + + uint64 outboundNonce = s_nonceManager.getIncrementedOutboundNonce(DEST_CHAIN_SELECTOR, sender); + assertEq(outboundNonce, 1); + } + + function test_incrementInboundNonce_Success() public { + address sender = address(this); + + s_nonceManager.incrementInboundNonce(SOURCE_CHAIN_SELECTOR, 1, abi.encode(sender)); + + assertEq(s_nonceManager.getInboundNonce(SOURCE_CHAIN_SELECTOR, abi.encode(sender)), 1); + } + + function test_incrementInboundNonce_Skip() public { + address sender = address(this); + uint64 expectedNonce = 2; + + vm.expectEmit(); + emit NonceManager.SkippedIncorrectNonce(SOURCE_CHAIN_SELECTOR, expectedNonce, abi.encode(sender)); + + s_nonceManager.incrementInboundNonce(SOURCE_CHAIN_SELECTOR, expectedNonce, abi.encode(sender)); + + assertEq(s_nonceManager.getInboundNonce(SOURCE_CHAIN_SELECTOR, abi.encode(sender)), 0); + } + + function test_incrementNoncesInboundAndOutbound_Success() public { + address sender = address(this); + + assertEq(s_nonceManager.getOutboundNonce(DEST_CHAIN_SELECTOR, sender), 0); + uint64 outboundNonce = s_nonceManager.getIncrementedOutboundNonce(DEST_CHAIN_SELECTOR, sender); + assertEq(outboundNonce, 1); + + // Inbound nonce unchanged + assertEq(s_nonceManager.getInboundNonce(DEST_CHAIN_SELECTOR, abi.encode(sender)), 0); + + s_nonceManager.incrementInboundNonce(DEST_CHAIN_SELECTOR, 1, abi.encode(sender)); + assertEq(s_nonceManager.getInboundNonce(DEST_CHAIN_SELECTOR, abi.encode(sender)), 1); + + // Outbound nonce unchanged + assertEq(s_nonceManager.getOutboundNonce(DEST_CHAIN_SELECTOR, sender), 1); + } +} + +contract NonceManager_applyPreviousRampsUpdates is OnRampSetup { + function test_SingleRampUpdate() public { + address prevOnRamp = makeAddr("prevOnRamp"); + address prevOffRamp = makeAddr("prevOffRamp"); + NonceManager.PreviousRampsArgs[] memory previousRamps = new NonceManager.PreviousRampsArgs[](1); + previousRamps[0] = + NonceManager.PreviousRampsArgs(DEST_CHAIN_SELECTOR, NonceManager.PreviousRamps(prevOnRamp, prevOffRamp)); + + vm.expectEmit(); + emit NonceManager.PreviousRampsUpdated(DEST_CHAIN_SELECTOR, previousRamps[0].prevRamps); + + s_outboundNonceManager.applyPreviousRampsUpdates(previousRamps); + + _assertPreviousRampsEqual(s_outboundNonceManager.getPreviousRamps(DEST_CHAIN_SELECTOR), previousRamps[0].prevRamps); + } + + function test_MultipleRampsUpdates() public { + address prevOnRamp1 = makeAddr("prevOnRamp1"); + address prevOnRamp2 = makeAddr("prevOnRamp2"); + address prevOffRamp1 = makeAddr("prevOffRamp1"); + address prevOffRamp2 = makeAddr("prevOffRamp2"); + NonceManager.PreviousRampsArgs[] memory previousRamps = new NonceManager.PreviousRampsArgs[](2); + previousRamps[0] = + NonceManager.PreviousRampsArgs(DEST_CHAIN_SELECTOR, NonceManager.PreviousRamps(prevOnRamp1, prevOffRamp1)); + previousRamps[1] = + NonceManager.PreviousRampsArgs(DEST_CHAIN_SELECTOR + 1, NonceManager.PreviousRamps(prevOnRamp2, prevOffRamp2)); + + vm.expectEmit(); + emit NonceManager.PreviousRampsUpdated(DEST_CHAIN_SELECTOR, previousRamps[0].prevRamps); + vm.expectEmit(); + emit NonceManager.PreviousRampsUpdated(DEST_CHAIN_SELECTOR + 1, previousRamps[1].prevRamps); + + s_outboundNonceManager.applyPreviousRampsUpdates(previousRamps); + + _assertPreviousRampsEqual(s_outboundNonceManager.getPreviousRamps(DEST_CHAIN_SELECTOR), previousRamps[0].prevRamps); + _assertPreviousRampsEqual( + s_outboundNonceManager.getPreviousRamps(DEST_CHAIN_SELECTOR + 1), previousRamps[1].prevRamps + ); + } + + function test_ZeroInput() public { + vm.recordLogs(); + s_outboundNonceManager.applyPreviousRampsUpdates(new NonceManager.PreviousRampsArgs[](0)); + + assertEq(vm.getRecordedLogs().length, 0); + } + + function test_PreviousRampAlreadySetOnRamp_Revert() public { + NonceManager.PreviousRampsArgs[] memory previousRamps = new NonceManager.PreviousRampsArgs[](1); + address prevOnRamp = makeAddr("prevOnRamp"); + previousRamps[0] = + NonceManager.PreviousRampsArgs(DEST_CHAIN_SELECTOR, NonceManager.PreviousRamps(prevOnRamp, address(0))); + + s_outboundNonceManager.applyPreviousRampsUpdates(previousRamps); + + previousRamps[0] = + NonceManager.PreviousRampsArgs(DEST_CHAIN_SELECTOR, NonceManager.PreviousRamps(prevOnRamp, address(0))); + + vm.expectRevert(NonceManager.PreviousRampAlreadySet.selector); + s_outboundNonceManager.applyPreviousRampsUpdates(previousRamps); + } + + function test_PreviousRampAlreadySetOffRamp_Revert() public { + NonceManager.PreviousRampsArgs[] memory previousRamps = new NonceManager.PreviousRampsArgs[](1); + address prevOffRamp = makeAddr("prevOffRamp"); + previousRamps[0] = + NonceManager.PreviousRampsArgs(DEST_CHAIN_SELECTOR, NonceManager.PreviousRamps(address(0), prevOffRamp)); + + s_outboundNonceManager.applyPreviousRampsUpdates(previousRamps); + + previousRamps[0] = + NonceManager.PreviousRampsArgs(DEST_CHAIN_SELECTOR, NonceManager.PreviousRamps(address(0), prevOffRamp)); + + vm.expectRevert(NonceManager.PreviousRampAlreadySet.selector); + s_outboundNonceManager.applyPreviousRampsUpdates(previousRamps); + } + + function test_PreviousRampAlreadySetOnRampAndOffRamp_Revert() public { + NonceManager.PreviousRampsArgs[] memory previousRamps = new NonceManager.PreviousRampsArgs[](1); + address prevOnRamp = makeAddr("prevOnRamp"); + address prevOffRamp = makeAddr("prevOffRamp"); + previousRamps[0] = + NonceManager.PreviousRampsArgs(DEST_CHAIN_SELECTOR, NonceManager.PreviousRamps(prevOnRamp, prevOffRamp)); + + s_outboundNonceManager.applyPreviousRampsUpdates(previousRamps); + + previousRamps[0] = + NonceManager.PreviousRampsArgs(DEST_CHAIN_SELECTOR, NonceManager.PreviousRamps(prevOnRamp, prevOffRamp)); + + vm.expectRevert(NonceManager.PreviousRampAlreadySet.selector); + s_outboundNonceManager.applyPreviousRampsUpdates(previousRamps); + } + + function _assertPreviousRampsEqual( + NonceManager.PreviousRamps memory a, + NonceManager.PreviousRamps memory b + ) internal pure { + assertEq(a.prevOnRamp, b.prevOnRamp); + assertEq(a.prevOffRamp, b.prevOffRamp); + } +} + +contract NonceManager_OnRampUpgrade is OnRampSetup { + uint256 internal constant FEE_AMOUNT = 1234567890; + EVM2EVMOnRampHelper internal s_prevOnRamp; + + function setUp() public virtual override { + super.setUp(); + + EVM2EVMOnRamp.FeeTokenConfigArgs[] memory feeTokenConfigArgs = new EVM2EVMOnRamp.FeeTokenConfigArgs[](1); + feeTokenConfigArgs[0] = EVM2EVMOnRamp.FeeTokenConfigArgs({ + token: s_sourceFeeToken, + networkFeeUSDCents: 1_00, // 1 USD + gasMultiplierWeiPerEth: 1e18, // 1x + premiumMultiplierWeiPerEth: 5e17, // 0.5x + enabled: true + }); + + EVM2EVMOnRamp.TokenTransferFeeConfigArgs[] memory tokenTransferFeeConfig = + new EVM2EVMOnRamp.TokenTransferFeeConfigArgs[](1); + + tokenTransferFeeConfig[0] = EVM2EVMOnRamp.TokenTransferFeeConfigArgs({ + token: s_sourceFeeToken, + minFeeUSDCents: 1_00, // 1 USD + maxFeeUSDCents: 1000_00, // 1,000 USD + deciBps: 2_5, // 2.5 bps, or 0.025% + destGasOverhead: 140_000, + destBytesOverhead: uint32(Pool.CCIP_LOCK_OR_BURN_V1_RET_BYTES), + aggregateRateLimitEnabled: true + }); + + s_prevOnRamp = new EVM2EVMOnRampHelper( + EVM2EVMOnRamp.StaticConfig({ + linkToken: s_sourceTokens[0], + chainSelector: SOURCE_CHAIN_SELECTOR, + destChainSelector: DEST_CHAIN_SELECTOR, + defaultTxGasLimit: GAS_LIMIT, + maxNopFeesJuels: MAX_NOP_FEES_JUELS, + prevOnRamp: address(0), + rmnProxy: address(s_mockRMN), + tokenAdminRegistry: address(s_tokenAdminRegistry) + }), + EVM2EVMOnRamp.DynamicConfig({ + router: address(s_sourceRouter), + maxNumberOfTokensPerMsg: MAX_TOKENS_LENGTH, + destGasOverhead: DEST_GAS_OVERHEAD, + destGasPerPayloadByte: DEST_GAS_PER_PAYLOAD_BYTE, + destDataAvailabilityOverheadGas: DEST_DATA_AVAILABILITY_OVERHEAD_GAS, + destGasPerDataAvailabilityByte: DEST_GAS_PER_DATA_AVAILABILITY_BYTE, + destDataAvailabilityMultiplierBps: DEST_GAS_DATA_AVAILABILITY_MULTIPLIER_BPS, + priceRegistry: address(s_feeQuoter), + maxDataBytes: MAX_DATA_SIZE, + maxPerMsgGasLimit: MAX_GAS_LIMIT, + defaultTokenFeeUSDCents: DEFAULT_TOKEN_FEE_USD_CENTS, + defaultTokenDestGasOverhead: DEFAULT_TOKEN_DEST_GAS_OVERHEAD, + enforceOutOfOrder: false + }), + RateLimiter.Config({isEnabled: true, capacity: 100e28, rate: 1e15}), + feeTokenConfigArgs, + tokenTransferFeeConfig, + new EVM2EVMOnRamp.NopAndWeight[](0) + ); + + NonceManager.PreviousRampsArgs[] memory previousRamps = new NonceManager.PreviousRampsArgs[](1); + previousRamps[0] = + NonceManager.PreviousRampsArgs(DEST_CHAIN_SELECTOR, NonceManager.PreviousRamps(address(s_prevOnRamp), address(0))); + s_outboundNonceManager.applyPreviousRampsUpdates(previousRamps); + + (s_onRamp, s_metadataHash) = _deployOnRamp( + SOURCE_CHAIN_SELECTOR, s_sourceRouter, address(s_outboundNonceManager), address(s_tokenAdminRegistry) + ); + + vm.startPrank(address(s_sourceRouter)); + } + + function test_Upgrade_Success() public { + Client.EVM2AnyMessage memory message = _generateEmptyMessage(); + + vm.expectEmit(); + emit OnRamp.CCIPMessageSent(DEST_CHAIN_SELECTOR, _messageToEvent(message, 1, 1, FEE_AMOUNT, OWNER)); + s_onRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, message, FEE_AMOUNT, OWNER); + } + + function test_UpgradeSenderNoncesReadsPreviousRamp_Success() public { + Client.EVM2AnyMessage memory message = _generateEmptyMessage(); + uint64 startNonce = s_outboundNonceManager.getOutboundNonce(DEST_CHAIN_SELECTOR, OWNER); + + for (uint64 i = 1; i < 4; ++i) { + s_prevOnRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, message, 0, OWNER); + + assertEq(startNonce + i, s_outboundNonceManager.getOutboundNonce(DEST_CHAIN_SELECTOR, OWNER)); + } + } + + function test_UpgradeNonceStartsAtV1Nonce_Success() public { + Client.EVM2AnyMessage memory message = _generateEmptyMessage(); + + uint64 startNonce = s_outboundNonceManager.getOutboundNonce(DEST_CHAIN_SELECTOR, OWNER); + + // send 1 message from previous onramp + s_prevOnRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, message, FEE_AMOUNT, OWNER); + + assertEq(startNonce + 1, s_outboundNonceManager.getOutboundNonce(DEST_CHAIN_SELECTOR, OWNER)); + + // new onramp nonce should start from 2, while sequence number start from 1 + vm.expectEmit(); + emit OnRamp.CCIPMessageSent(DEST_CHAIN_SELECTOR, _messageToEvent(message, 1, startNonce + 2, FEE_AMOUNT, OWNER)); + s_onRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, message, FEE_AMOUNT, OWNER); + + assertEq(startNonce + 2, s_outboundNonceManager.getOutboundNonce(DEST_CHAIN_SELECTOR, OWNER)); + + // after another send, nonce should be 3, and sequence number be 2 + vm.expectEmit(); + emit OnRamp.CCIPMessageSent(DEST_CHAIN_SELECTOR, _messageToEvent(message, 2, startNonce + 3, FEE_AMOUNT, OWNER)); + s_onRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, message, FEE_AMOUNT, OWNER); + + assertEq(startNonce + 3, s_outboundNonceManager.getOutboundNonce(DEST_CHAIN_SELECTOR, OWNER)); + } + + function test_UpgradeNonceNewSenderStartsAtZero_Success() public { + Client.EVM2AnyMessage memory message = _generateEmptyMessage(); + + // send 1 message from previous onramp from OWNER + s_prevOnRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, message, FEE_AMOUNT, OWNER); + + address newSender = address(1234567); + // new onramp nonce should start from 1 for new sender + vm.expectEmit(); + emit OnRamp.CCIPMessageSent(DEST_CHAIN_SELECTOR, _messageToEvent(message, 1, 1, FEE_AMOUNT, newSender)); + s_onRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, message, FEE_AMOUNT, newSender); + } +} + +contract NonceManager_OffRampUpgrade is OffRampSetup { + EVM2EVMOffRampHelper internal s_prevOffRamp; + EVM2EVMOffRampHelper[] internal s_nestedPrevOffRamps; + + address internal constant SINGLE_LANE_ON_RAMP_ADDRESS_1 = abi.decode(ON_RAMP_ADDRESS_1, (address)); + address internal constant SINGLE_LANE_ON_RAMP_ADDRESS_2 = abi.decode(ON_RAMP_ADDRESS_2, (address)); + address internal constant SINGLE_LANE_ON_RAMP_ADDRESS_3 = abi.decode(ON_RAMP_ADDRESS_3, (address)); + + function setUp() public virtual override { + super.setUp(); + + ICommitStore mockPrevCommitStore = new MockCommitStore(); + s_prevOffRamp = _deploySingleLaneOffRamp( + mockPrevCommitStore, s_destRouter, address(0), SOURCE_CHAIN_SELECTOR_1, SINGLE_LANE_ON_RAMP_ADDRESS_1 + ); + + s_nestedPrevOffRamps = new EVM2EVMOffRampHelper[](2); + s_nestedPrevOffRamps[0] = _deploySingleLaneOffRamp( + mockPrevCommitStore, s_destRouter, address(0), SOURCE_CHAIN_SELECTOR_2, SINGLE_LANE_ON_RAMP_ADDRESS_2 + ); + s_nestedPrevOffRamps[1] = _deploySingleLaneOffRamp( + mockPrevCommitStore, + s_destRouter, + address(s_nestedPrevOffRamps[0]), + SOURCE_CHAIN_SELECTOR_2, + SINGLE_LANE_ON_RAMP_ADDRESS_2 + ); + + NonceManager.PreviousRampsArgs[] memory previousRamps = new NonceManager.PreviousRampsArgs[](3); + previousRamps[0] = NonceManager.PreviousRampsArgs( + SOURCE_CHAIN_SELECTOR_1, NonceManager.PreviousRamps(address(0), address(s_prevOffRamp)) + ); + previousRamps[1] = NonceManager.PreviousRampsArgs( + SOURCE_CHAIN_SELECTOR_2, NonceManager.PreviousRamps(address(0), address(s_nestedPrevOffRamps[1])) + ); + previousRamps[2] = NonceManager.PreviousRampsArgs( + SOURCE_CHAIN_SELECTOR_3, NonceManager.PreviousRamps(SINGLE_LANE_ON_RAMP_ADDRESS_3, address(0)) + ); + s_inboundNonceManager.applyPreviousRampsUpdates(previousRamps); + + OffRamp.SourceChainConfigArgs[] memory sourceChainConfigs = new OffRamp.SourceChainConfigArgs[](3); + sourceChainConfigs[0] = OffRamp.SourceChainConfigArgs({ + router: s_destRouter, + sourceChainSelector: SOURCE_CHAIN_SELECTOR_1, + isEnabled: true, + onRamp: ON_RAMP_ADDRESS_1 + }); + sourceChainConfigs[1] = OffRamp.SourceChainConfigArgs({ + router: s_destRouter, + sourceChainSelector: SOURCE_CHAIN_SELECTOR_2, + isEnabled: true, + onRamp: ON_RAMP_ADDRESS_2 + }); + sourceChainConfigs[2] = OffRamp.SourceChainConfigArgs({ + router: s_destRouter, + sourceChainSelector: SOURCE_CHAIN_SELECTOR_3, + isEnabled: true, + onRamp: ON_RAMP_ADDRESS_3 + }); + + _setupMultipleOffRampsFromConfigs(sourceChainConfigs); + + s_offRamp.setVerifyOverrideResult(SOURCE_CHAIN_SELECTOR_1, 1); + s_offRamp.setVerifyOverrideResult(SOURCE_CHAIN_SELECTOR_3, 1); + } + + function test_Upgraded_Success() public { + Internal.Any2EVMRampMessage[] memory messages = + _generateSingleBasicMessage(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1); + + vm.recordLogs(); + s_offRamp.executeSingleReport(_generateReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messages), new uint256[](0)); + assertExecutionStateChangedEventLogs( + SOURCE_CHAIN_SELECTOR_1, + messages[0].header.sequenceNumber, + messages[0].header.messageId, + Internal._hash(messages[0], ON_RAMP_ADDRESS_1), + Internal.MessageExecutionState.SUCCESS, + "" + ); + } + + function test_NoPrevOffRampForChain_Success() public { + Internal.EVM2EVMMessage[] memory messages = + _generateSingleLaneSingleBasicMessage(SOURCE_CHAIN_SELECTOR_1, SINGLE_LANE_ON_RAMP_ADDRESS_1); + uint64 startNonceChain3 = + s_inboundNonceManager.getInboundNonce(SOURCE_CHAIN_SELECTOR_3, abi.encode(messages[0].sender)); + s_prevOffRamp.execute( + _generateSingleLaneRampReportFromMessages(messages), new EVM2EVMOffRampHelper.GasLimitOverride[](0) + ); + + // Nonce unchanged for chain 3 + assertEq( + startNonceChain3, s_inboundNonceManager.getInboundNonce(SOURCE_CHAIN_SELECTOR_3, abi.encode(messages[0].sender)) + ); + + Internal.Any2EVMRampMessage[] memory messagesChain3 = + _generateSingleBasicMessage(SOURCE_CHAIN_SELECTOR_3, ON_RAMP_ADDRESS_3); + + vm.recordLogs(); + + s_offRamp.executeSingleReport( + _generateReportFromMessages(SOURCE_CHAIN_SELECTOR_3, messagesChain3), new uint256[](0) + ); + assertExecutionStateChangedEventLogs( + SOURCE_CHAIN_SELECTOR_3, + messagesChain3[0].header.sequenceNumber, + messagesChain3[0].header.messageId, + Internal._hash(messagesChain3[0], ON_RAMP_ADDRESS_3), + Internal.MessageExecutionState.SUCCESS, + "" + ); + + assertEq( + startNonceChain3 + 1, s_inboundNonceManager.getInboundNonce(SOURCE_CHAIN_SELECTOR_3, messagesChain3[0].sender) + ); + } + + function test_UpgradedSenderNoncesReadsPreviousRamp_Success() public { + Internal.EVM2EVMMessage[] memory messages = + _generateSingleLaneSingleBasicMessage(SOURCE_CHAIN_SELECTOR_1, SINGLE_LANE_ON_RAMP_ADDRESS_1); + uint64 startNonce = s_inboundNonceManager.getInboundNonce(SOURCE_CHAIN_SELECTOR_1, abi.encode(messages[0].sender)); + + for (uint64 i = 1; i < 4; ++i) { + s_prevOffRamp.execute( + _generateSingleLaneRampReportFromMessages(messages), new EVM2EVMOffRampHelper.GasLimitOverride[](0) + ); + + // messages contains a single message - update for the next execution + messages[0].nonce++; + messages[0].sequenceNumber++; + messages[0].messageId = Internal._hash(messages[0], s_prevOffRamp.metadataHash()); + + assertEq( + startNonce + i, s_inboundNonceManager.getInboundNonce(SOURCE_CHAIN_SELECTOR_1, abi.encode(messages[0].sender)) + ); + } + } + + function test_UpgradedSenderNoncesReadsPreviousRampTransitive_Success() public { + Internal.EVM2EVMMessage[] memory messages = + _generateSingleLaneSingleBasicMessage(SOURCE_CHAIN_SELECTOR_2, SINGLE_LANE_ON_RAMP_ADDRESS_2); + uint64 startNonce = s_inboundNonceManager.getInboundNonce(SOURCE_CHAIN_SELECTOR_2, abi.encode(messages[0].sender)); + + for (uint64 i = 1; i < 4; ++i) { + s_nestedPrevOffRamps[0].execute( + _generateSingleLaneRampReportFromMessages(messages), new EVM2EVMOffRampHelper.GasLimitOverride[](0) + ); + + // messages contains a single message - update for the next execution + messages[0].nonce++; + messages[0].sequenceNumber++; + messages[0].messageId = Internal._hash(messages[0], s_nestedPrevOffRamps[0].metadataHash()); + + // Read through prev sender nonce through prevOffRamp -> prevPrevOffRamp + assertEq( + startNonce + i, s_inboundNonceManager.getInboundNonce(SOURCE_CHAIN_SELECTOR_2, abi.encode(messages[0].sender)) + ); + } + } + + function test_UpgradedNonceStartsAtV1Nonce_Success() public { + Internal.EVM2EVMMessage[] memory messages = + _generateSingleLaneSingleBasicMessage(SOURCE_CHAIN_SELECTOR_1, SINGLE_LANE_ON_RAMP_ADDRESS_1); + + uint64 startNonce = s_inboundNonceManager.getInboundNonce(SOURCE_CHAIN_SELECTOR_1, abi.encode(messages[0].sender)); + s_prevOffRamp.execute( + _generateSingleLaneRampReportFromMessages(messages), new EVM2EVMOffRampHelper.GasLimitOverride[](0) + ); + + assertEq( + startNonce + 1, s_inboundNonceManager.getInboundNonce(SOURCE_CHAIN_SELECTOR_1, abi.encode(messages[0].sender)) + ); + + Internal.Any2EVMRampMessage[] memory messagesMultiRamp = + _generateSingleBasicMessage(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1); + + messagesMultiRamp[0].header.nonce++; + messagesMultiRamp[0].header.messageId = Internal._hash(messagesMultiRamp[0], ON_RAMP_ADDRESS_1); + + vm.recordLogs(); + + s_offRamp.executeSingleReport( + _generateReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messagesMultiRamp), new uint256[](0) + ); + + assertExecutionStateChangedEventLogs( + SOURCE_CHAIN_SELECTOR_1, + messagesMultiRamp[0].header.sequenceNumber, + messagesMultiRamp[0].header.messageId, + Internal._hash(messagesMultiRamp[0], ON_RAMP_ADDRESS_1), + Internal.MessageExecutionState.SUCCESS, + "" + ); + + assertEq( + startNonce + 2, s_inboundNonceManager.getInboundNonce(SOURCE_CHAIN_SELECTOR_1, messagesMultiRamp[0].sender) + ); + + messagesMultiRamp[0].header.nonce++; + messagesMultiRamp[0].header.sequenceNumber++; + messagesMultiRamp[0].header.messageId = Internal._hash(messagesMultiRamp[0], ON_RAMP_ADDRESS_1); + + vm.recordLogs(); + s_offRamp.executeSingleReport( + _generateReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messagesMultiRamp), new uint256[](0) + ); + assertExecutionStateChangedEventLogs( + SOURCE_CHAIN_SELECTOR_1, + messagesMultiRamp[0].header.sequenceNumber, + messagesMultiRamp[0].header.messageId, + Internal._hash(messagesMultiRamp[0], ON_RAMP_ADDRESS_1), + Internal.MessageExecutionState.SUCCESS, + "" + ); + + assertEq( + startNonce + 3, s_inboundNonceManager.getInboundNonce(SOURCE_CHAIN_SELECTOR_1, messagesMultiRamp[0].sender) + ); + } + + function test_UpgradedNonceNewSenderStartsAtZero_Success() public { + Internal.EVM2EVMMessage[] memory messages = + _generateSingleLaneSingleBasicMessage(SOURCE_CHAIN_SELECTOR_1, SINGLE_LANE_ON_RAMP_ADDRESS_1); + + s_prevOffRamp.execute( + _generateSingleLaneRampReportFromMessages(messages), new EVM2EVMOffRampHelper.GasLimitOverride[](0) + ); + + Internal.Any2EVMRampMessage[] memory messagesMultiRamp = + _generateSingleBasicMessage(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1); + + bytes memory newSender = abi.encode(address(1234567)); + messagesMultiRamp[0].sender = newSender; + messagesMultiRamp[0].header.messageId = Internal._hash(messagesMultiRamp[0], ON_RAMP_ADDRESS_1); + + // new sender nonce in new offramp should go from 0 -> 1 + assertEq(s_inboundNonceManager.getInboundNonce(SOURCE_CHAIN_SELECTOR_1, newSender), 0); + vm.recordLogs(); + s_offRamp.executeSingleReport( + _generateReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messagesMultiRamp), new uint256[](0) + ); + assertExecutionStateChangedEventLogs( + SOURCE_CHAIN_SELECTOR_1, + messagesMultiRamp[0].header.sequenceNumber, + messagesMultiRamp[0].header.messageId, + Internal._hash(messagesMultiRamp[0], ON_RAMP_ADDRESS_1), + Internal.MessageExecutionState.SUCCESS, + "" + ); + assertEq(s_inboundNonceManager.getInboundNonce(SOURCE_CHAIN_SELECTOR_1, newSender), 1); + } + + function test_UpgradedOffRampNonceSkipsIfMsgInFlight_Success() public { + Internal.Any2EVMRampMessage[] memory messages = + _generateSingleBasicMessage(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1); + + address newSender = address(1234567); + messages[0].sender = abi.encode(newSender); + messages[0].header.nonce = 2; + messages[0].header.messageId = Internal._hash(messages[0], ON_RAMP_ADDRESS_1); + + uint64 startNonce = s_inboundNonceManager.getInboundNonce(SOURCE_CHAIN_SELECTOR_1, messages[0].sender); + + // new offramp sees msg nonce higher than senderNonce + // it waits for previous offramp to execute + vm.expectEmit(); + emit NonceManager.SkippedIncorrectNonce(SOURCE_CHAIN_SELECTOR_1, messages[0].header.nonce, messages[0].sender); + s_offRamp.executeSingleReport(_generateReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messages), new uint256[](0)); + assertEq(startNonce, s_inboundNonceManager.getInboundNonce(SOURCE_CHAIN_SELECTOR_1, messages[0].sender)); + + Internal.EVM2EVMMessage[] memory messagesSingleLane = + _generateSingleLaneSingleBasicMessage(SOURCE_CHAIN_SELECTOR_1, SINGLE_LANE_ON_RAMP_ADDRESS_1); + + messagesSingleLane[0].nonce = 1; + messagesSingleLane[0].sender = newSender; + messagesSingleLane[0].messageId = Internal._hash(messagesSingleLane[0], s_prevOffRamp.metadataHash()); + + // previous offramp executes msg and increases nonce + s_prevOffRamp.execute( + _generateSingleLaneRampReportFromMessages(messagesSingleLane), new EVM2EVMOffRampHelper.GasLimitOverride[](0) + ); + assertEq( + startNonce + 1, + s_inboundNonceManager.getInboundNonce(SOURCE_CHAIN_SELECTOR_1, abi.encode(messagesSingleLane[0].sender)) + ); + + messages[0].header.nonce = 2; + messages[0].header.messageId = Internal._hash(messages[0], ON_RAMP_ADDRESS_1); + + // new offramp is able to execute + vm.recordLogs(); + s_offRamp.executeSingleReport(_generateReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messages), new uint256[](0)); + assertExecutionStateChangedEventLogs( + SOURCE_CHAIN_SELECTOR_1, + messages[0].header.sequenceNumber, + messages[0].header.messageId, + Internal._hash(messages[0], ON_RAMP_ADDRESS_1), + Internal.MessageExecutionState.SUCCESS, + "" + ); + assertEq(startNonce + 2, s_inboundNonceManager.getInboundNonce(SOURCE_CHAIN_SELECTOR_1, messages[0].sender)); + } + + function _generateSingleLaneRampReportFromMessages( + Internal.EVM2EVMMessage[] memory messages + ) internal pure returns (Internal.ExecutionReport memory) { + bytes[][] memory offchainTokenData = new bytes[][](messages.length); + + for (uint256 i = 0; i < messages.length; ++i) { + offchainTokenData[i] = new bytes[](messages[i].tokenAmounts.length); + } + + return Internal.ExecutionReport({ + proofs: new bytes32[](0), + proofFlagBits: 2 ** 256 - 1, + messages: messages, + offchainTokenData: offchainTokenData + }); + } + + function _generateSingleLaneSingleBasicMessage( + uint64 sourceChainSelector, + address onRamp + ) internal view returns (Internal.EVM2EVMMessage[] memory) { + Internal.EVM2EVMMessage[] memory messages = new Internal.EVM2EVMMessage[](1); + + bytes memory data = abi.encode(0); + messages[0] = Internal.EVM2EVMMessage({ + sequenceNumber: 1, + sender: OWNER, + nonce: 1, + gasLimit: GAS_LIMIT, + strict: false, + sourceChainSelector: sourceChainSelector, + receiver: address(s_receiver), + data: data, + tokenAmounts: new Client.EVMTokenAmount[](0), + sourceTokenData: new bytes[](0), + feeToken: s_destFeeToken, + feeTokenAmount: uint256(0), + messageId: "" + }); + + messages[0].messageId = Internal._hash( + messages[0], + keccak256(abi.encode(Internal.EVM_2_EVM_MESSAGE_HASH, sourceChainSelector, DEST_CHAIN_SELECTOR, onRamp)) + ); + + return messages; + } +} diff --git a/contracts/src/v0.8/ccip/test/README.md b/contracts/src/v0.8/ccip/test/README.md new file mode 100644 index 00000000000..99223e1a63d --- /dev/null +++ b/contracts/src/v0.8/ccip/test/README.md @@ -0,0 +1,89 @@ +# Foundry Test Guidelines + +We're using Foundry to test our CCIP smart contracts here. This enables us to test in Solidity. If you need to add tests for anything outside the CCIP contracts, please write them in hardhat (for the time being). + +## Directory Structure + +The test directory structure mimics the source contract file structure as closely as possible. Example: + +`./offRamp/SomeOffRamp.sol` should have a test contract `./test/offRamp/SomeOffRamp.t.sol`. + +## Test File Structure + +Break the test file down into multiple contracts, each contract testing a specific function inside the source contract. + +For Example, here's a source contract `SomeOffRamp`: + +``` +contract SomeOffRamp { + + constructor() { + ... set some state + } + + function firstFunction() public { + ... + } + + function theNextFunction() public { + ... + } + + function _anInternalFunction() internal { + ... + } +} +``` + +Our test file `SomeOffRamp.t.sol` should be structured like this: + +``` +contract SomeOffRamp_constructor { + // constructor state setup tests here +} + +contract SomeOffRamp_firstFunction { + // first function tests here +} + +contract SomeOffRamp_theNextFunction { + // tests here too... +} + +contract SomeOffRamp_anInternalFunction { + // This function will require a helper contract to expose it. +} +``` + +## Test Structure + +Inside each test contract, group tests into `Success` and `Reverts` by starting with all the success cases and then adding a `// Reverts` comments to indicate the failure cases below. + +``` +contract SomeOffRamp_firstFunction { + function testZeroValueSuccess() public { + ... + } + + ... + + + // Reverts + + function testOwnerReverts() public { + // test that an ownable function reverts when not called by the owner + ... + } + + ... + +} +``` + +Function naming should follow this structure, where the `_fuzz_` section denotes whether it's a fuzz test. Do not write tests that are named `testSuccess`, always include the description of the test, even if it's just the name of the function that is being called. + +`test{_fuzz_}{description of test}[Success|Reverts]` + +Try to cover all the code paths present in each function being tested. In most cases, this will result in many more failure tests than success tests. + +If a test file requires a complicated setUp, or if it requires many helper functions (like `_generateAMessageWithNoTokensStruct()`), create a separate file to perform this setup in. Using the example above, `SomeOffRampSetup.t.sol`. Inherit this and call the setUp function in the test file. diff --git a/contracts/src/v0.8/ccip/test/TokenSetup.t.sol b/contracts/src/v0.8/ccip/test/TokenSetup.t.sol new file mode 100644 index 00000000000..203145881e3 --- /dev/null +++ b/contracts/src/v0.8/ccip/test/TokenSetup.t.sol @@ -0,0 +1,178 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {BurnMintERC677} from "../../shared/token/ERC677/BurnMintERC677.sol"; +import {Client} from "../libraries/Client.sol"; +import {BurnMintTokenPool} from "../pools/BurnMintTokenPool.sol"; +import {LockReleaseTokenPool} from "../pools/LockReleaseTokenPool.sol"; +import {TokenPool} from "../pools/TokenPool.sol"; +import {TokenAdminRegistry} from "../tokenAdminRegistry/TokenAdminRegistry.sol"; +import {MaybeRevertingBurnMintTokenPool} from "./helpers/MaybeRevertingBurnMintTokenPool.sol"; +import {RouterSetup} from "./router/RouterSetup.t.sol"; + +import {IERC20} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/IERC20.sol"; + +contract TokenSetup is RouterSetup { + address[] internal s_sourceTokens; + address[] internal s_destTokens; + + address internal s_sourceFeeToken; + address internal s_destFeeToken; + + TokenAdminRegistry internal s_tokenAdminRegistry; + + mapping(address sourceToken => address sourcePool) internal s_sourcePoolByToken; + mapping(address sourceToken => address destPool) internal s_destPoolBySourceToken; + mapping(address destToken => address destPool) internal s_destPoolByToken; + mapping(address sourceToken => address destToken) internal s_destTokenBySourceToken; + + function _deploySourceToken(string memory tokenName, uint256 dealAmount, uint8 decimals) internal returns (address) { + BurnMintERC677 token = new BurnMintERC677(tokenName, tokenName, decimals, 0); + s_sourceTokens.push(address(token)); + deal(address(token), OWNER, dealAmount); + return address(token); + } + + function _deployDestToken(string memory tokenName, uint256 dealAmount) internal returns (address) { + BurnMintERC677 token = new BurnMintERC677(tokenName, tokenName, 18, 0); + s_destTokens.push(address(token)); + deal(address(token), OWNER, dealAmount); + return address(token); + } + + function _deployLockReleasePool(address token, bool isSourcePool) internal { + address router = address(s_sourceRouter); + if (!isSourcePool) { + router = address(s_destRouter); + } + + LockReleaseTokenPool pool = + new LockReleaseTokenPool(IERC20(token), new address[](0), address(s_mockRMN), true, router); + + if (isSourcePool) { + s_sourcePoolByToken[address(token)] = address(pool); + } else { + s_destPoolByToken[address(token)] = address(pool); + s_destPoolBySourceToken[s_sourceTokens[s_destTokens.length - 1]] = address(pool); + } + } + + function _deployTokenAndBurnMintPool(address token, bool isSourcePool) internal { + address router = address(s_sourceRouter); + if (!isSourcePool) { + router = address(s_destRouter); + } + + BurnMintTokenPool pool = + new MaybeRevertingBurnMintTokenPool(BurnMintERC677(token), new address[](0), address(s_mockRMN), router); + BurnMintERC677(token).grantMintAndBurnRoles(address(pool)); + + if (isSourcePool) { + s_sourcePoolByToken[address(token)] = address(pool); + } else { + s_destPoolByToken[address(token)] = address(pool); + s_destPoolBySourceToken[s_sourceTokens[s_destTokens.length - 1]] = address(pool); + } + } + + function setUp() public virtual override { + RouterSetup.setUp(); + + bool isSetup = s_sourceTokens.length != 0; + if (isSetup) { + return; + } + + // Source tokens & pools + address sourceLink = _deploySourceToken("sLINK", type(uint256).max, 18); + _deployLockReleasePool(sourceLink, true); + s_sourceFeeToken = sourceLink; + + address sourceEth = _deploySourceToken("sETH", 2 ** 128, 18); + _deployTokenAndBurnMintPool(sourceEth, true); + + // Destination tokens & pools + address destLink = _deployDestToken("dLINK", type(uint256).max); + _deployLockReleasePool(destLink, false); + s_destFeeToken = destLink; + + s_destTokenBySourceToken[sourceLink] = destLink; + + address destEth = _deployDestToken("dETH", 2 ** 128); + _deployTokenAndBurnMintPool(destEth, false); + + s_destTokenBySourceToken[sourceEth] = destEth; + + // Float the dest link lock release pool with funds + IERC20(destLink).transfer(s_destPoolByToken[destLink], 1000 ether); + + s_tokenAdminRegistry = new TokenAdminRegistry(); + + // Set pools in the registry + for (uint256 i = 0; i < s_sourceTokens.length; ++i) { + address token = s_sourceTokens[i]; + address pool = s_sourcePoolByToken[token]; + + _setPool( + s_tokenAdminRegistry, token, pool, DEST_CHAIN_SELECTOR, s_destPoolByToken[s_destTokens[i]], s_destTokens[i] + ); + } + + for (uint256 i = 0; i < s_destTokens.length; ++i) { + address token = s_destTokens[i]; + address pool = s_destPoolByToken[token]; + s_tokenAdminRegistry.proposeAdministrator(token, OWNER); + s_tokenAdminRegistry.acceptAdminRole(token); + s_tokenAdminRegistry.setPool(token, pool); + + _setPool( + s_tokenAdminRegistry, + token, + pool, + SOURCE_CHAIN_SELECTOR, + s_sourcePoolByToken[s_sourceTokens[i]], + s_sourceTokens[i] + ); + } + } + + function _getCastedSourceEVMTokenAmountsWithZeroAmounts() + internal + view + returns (Client.EVMTokenAmount[] memory tokenAmounts) + { + tokenAmounts = new Client.EVMTokenAmount[](s_sourceTokens.length); + for (uint256 i = 0; i < tokenAmounts.length; ++i) { + tokenAmounts[i].token = s_sourceTokens[i]; + } + return tokenAmounts; + } + + function _setPool( + TokenAdminRegistry tokenAdminRegistry, + address token, + address pool, + uint64 remoteChainSelector, + address remotePoolAddress, + address remoteToken + ) internal { + if (!tokenAdminRegistry.isAdministrator(token, OWNER)) { + tokenAdminRegistry.proposeAdministrator(token, OWNER); + tokenAdminRegistry.acceptAdminRole(token); + } + + tokenAdminRegistry.setPool(token, pool); + + TokenPool.ChainUpdate[] memory chainUpdates = new TokenPool.ChainUpdate[](1); + chainUpdates[0] = TokenPool.ChainUpdate({ + remoteChainSelector: remoteChainSelector, + remotePoolAddress: abi.encode(remotePoolAddress), + remoteTokenAddress: abi.encode(remoteToken), + allowed: true, + outboundRateLimiterConfig: _getOutboundRateLimiterConfig(), + inboundRateLimiterConfig: _getInboundRateLimiterConfig() + }); + + TokenPool(pool).applyChainUpdates(chainUpdates); + } +} diff --git a/contracts/src/v0.8/ccip/test/WETH9.sol b/contracts/src/v0.8/ccip/test/WETH9.sol new file mode 100644 index 00000000000..fbc19ee2c4d --- /dev/null +++ b/contracts/src/v0.8/ccip/test/WETH9.sol @@ -0,0 +1,82 @@ +// Submitted for verification at Etherscan.io on 2017-12-12 + +// Copyright (C) 2015, 2016, 2017 Dapphub + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +pragma solidity 0.8.24; + +// solhint-disable +contract WETH9 { + string public name = "Wrapped Ether"; + string public symbol = "WETH"; + uint8 public decimals = 18; + + event Approval(address indexed src, address indexed guy, uint256 wad); + event Transfer(address indexed src, address indexed dst, uint256 wad); + event Deposit(address indexed dst, uint256 wad); + event Withdrawal(address indexed src, uint256 wad); + + mapping(address => uint256) public balanceOf; + mapping(address => mapping(address => uint256)) public allowance; + + receive() external payable { + _deposit(); + } + + function _deposit() internal { + balanceOf[msg.sender] += msg.value; + emit Deposit(msg.sender, msg.value); + } + + function deposit() external payable { + _deposit(); + } + + function withdraw(uint256 wad) external { + require(balanceOf[msg.sender] >= wad); + balanceOf[msg.sender] -= wad; + payable(msg.sender).transfer(wad); + emit Withdrawal(msg.sender, wad); + } + + function totalSupply() public view returns (uint256) { + return address(this).balance; + } + + function approve(address guy, uint256 wad) public returns (bool) { + allowance[msg.sender][guy] = wad; + emit Approval(msg.sender, guy, wad); + return true; + } + + function transfer(address dst, uint256 wad) public returns (bool) { + return transferFrom(msg.sender, dst, wad); + } + + function transferFrom(address src, address dst, uint256 wad) public returns (bool) { + require(balanceOf[src] >= wad); + + if (src != msg.sender && allowance[src][msg.sender] != type(uint128).max) { + require(allowance[src][msg.sender] >= wad); + allowance[src][msg.sender] -= wad; + } + + balanceOf[src] -= wad; + balanceOf[dst] += wad; + + emit Transfer(src, dst, wad); + + return true; + } +} diff --git a/contracts/src/v0.8/ccip/test/applications/DefensiveExample.t.sol b/contracts/src/v0.8/ccip/test/applications/DefensiveExample.t.sol new file mode 100644 index 00000000000..18453f9f525 --- /dev/null +++ b/contracts/src/v0.8/ccip/test/applications/DefensiveExample.t.sol @@ -0,0 +1,97 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {DefensiveExample} from "../../applications/DefensiveExample.sol"; +import {Client} from "../../libraries/Client.sol"; +import {EVM2EVMOnRampSetup} from "../onRamp/EVM2EVMOnRampSetup.t.sol"; + +import {IERC20} from "../../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/IERC20.sol"; + +contract DefensiveExampleTest is EVM2EVMOnRampSetup { + event MessageFailed(bytes32 indexed messageId, bytes reason); + event MessageSucceeded(bytes32 indexed messageId); + event MessageRecovered(bytes32 indexed messageId); + + DefensiveExample internal s_receiver; + uint64 internal sourceChainSelector = 7331; + + function setUp() public virtual override { + EVM2EVMOnRampSetup.setUp(); + + s_receiver = new DefensiveExample(s_destRouter, IERC20(s_destFeeToken)); + s_receiver.enableChain(sourceChainSelector, abi.encode("")); + } + + function test_Recovery() public { + bytes32 messageId = keccak256("messageId"); + address token = address(s_destFeeToken); + uint256 amount = 111333333777; + Client.EVMTokenAmount[] memory destTokenAmounts = new Client.EVMTokenAmount[](1); + destTokenAmounts[0] = Client.EVMTokenAmount({token: token, amount: amount}); + + // Make sure we give the receiver contract enough tokens like CCIP would. + deal(token, address(s_receiver), amount); + + // Make sure the contract call reverts so we can test recovery. + s_receiver.setSimRevert(true); + + // The receiver contract will revert if the router is not the sender. + vm.startPrank(address(s_destRouter)); + + vm.expectEmit(); + emit MessageFailed(messageId, abi.encodeWithSelector(DefensiveExample.ErrorCase.selector)); + + s_receiver.ccipReceive( + Client.Any2EVMMessage({ + messageId: messageId, + sourceChainSelector: sourceChainSelector, + sender: abi.encode(address(0)), // wrong sender, will revert internally + data: "", + destTokenAmounts: destTokenAmounts + }) + ); + + address tokenReceiver = address(0x000001337); + uint256 tokenReceiverBalancePre = IERC20(token).balanceOf(tokenReceiver); + uint256 receiverBalancePre = IERC20(token).balanceOf(address(s_receiver)); + + // Recovery can only be done by the owner. + vm.startPrank(OWNER); + + vm.expectEmit(); + emit MessageRecovered(messageId); + + s_receiver.retryFailedMessage(messageId, tokenReceiver); + + // Assert the tokens have successfully been rescued from the contract. + assertEq(IERC20(token).balanceOf(tokenReceiver), tokenReceiverBalancePre + amount); + assertEq(IERC20(token).balanceOf(address(s_receiver)), receiverBalancePre - amount); + } + + function test_HappyPath_Success() public { + bytes32 messageId = keccak256("messageId"); + address token = address(s_destFeeToken); + uint256 amount = 111333333777; + Client.EVMTokenAmount[] memory destTokenAmounts = new Client.EVMTokenAmount[](1); + destTokenAmounts[0] = Client.EVMTokenAmount({token: token, amount: amount}); + + // Make sure we give the receiver contract enough tokens like CCIP would. + deal(token, address(s_receiver), amount); + + // The receiver contract will revert if the router is not the sender. + vm.startPrank(address(s_destRouter)); + + vm.expectEmit(); + emit MessageSucceeded(messageId); + + s_receiver.ccipReceive( + Client.Any2EVMMessage({ + messageId: messageId, + sourceChainSelector: sourceChainSelector, + sender: abi.encode(address(s_receiver)), // correct sender + data: "", + destTokenAmounts: destTokenAmounts + }) + ); + } +} diff --git a/contracts/src/v0.8/ccip/test/applications/EtherSenderReceiver.t.sol b/contracts/src/v0.8/ccip/test/applications/EtherSenderReceiver.t.sol new file mode 100644 index 00000000000..cfd402d9106 --- /dev/null +++ b/contracts/src/v0.8/ccip/test/applications/EtherSenderReceiver.t.sol @@ -0,0 +1,718 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {Test} from "forge-std/Test.sol"; + +import {CCIPRouter} from "../../applications/EtherSenderReceiver.sol"; + +import {IRouterClient} from "../../interfaces/IRouterClient.sol"; +import {Client} from "../../libraries/Client.sol"; +import {WETH9} from "../WETH9.sol"; +import {EtherSenderReceiverHelper} from "./../helpers/EtherSenderReceiverHelper.sol"; + +import {ERC20} from "../../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/ERC20.sol"; + +contract EtherSenderReceiverTest is Test { + EtherSenderReceiverHelper internal s_etherSenderReceiver; + WETH9 internal s_weth; + WETH9 internal s_someOtherWeth; + ERC20 internal s_linkToken; + + address internal constant OWNER = 0x00007e64E1fB0C487F25dd6D3601ff6aF8d32e4e; + address internal constant ROUTER = 0x0F3779ee3a832D10158073ae2F5e61ac7FBBF880; + address internal constant XCHAIN_RECEIVER = 0xBd91b2073218AF872BF73b65e2e5950ea356d147; + + function setUp() public { + vm.startPrank(OWNER); + + s_linkToken = new ERC20("Chainlink Token", "LINK"); + s_someOtherWeth = new WETH9(); + s_weth = new WETH9(); + vm.mockCall(ROUTER, abi.encodeWithSelector(CCIPRouter.getWrappedNative.selector), abi.encode(address(s_weth))); + s_etherSenderReceiver = new EtherSenderReceiverHelper(ROUTER); + + deal(OWNER, 1_000_000 ether); + deal(address(s_linkToken), OWNER, 1_000_000 ether); + + // deposit some eth into the weth contract. + s_weth.deposit{value: 10 ether}(); + uint256 wethSupply = s_weth.totalSupply(); + assertEq(wethSupply, 10 ether, "total weth supply must be 10 ether"); + } +} + +contract EtherSenderReceiverTest_constructor is EtherSenderReceiverTest { + function test_constructor() public view { + assertEq(s_etherSenderReceiver.getRouter(), ROUTER, "router must be set correctly"); + uint256 allowance = s_weth.allowance(address(s_etherSenderReceiver), ROUTER); + assertEq(allowance, type(uint256).max, "allowance must be set infinite"); + } +} + +contract EtherSenderReceiverTest_validateFeeToken is EtherSenderReceiverTest { + uint256 internal constant amount = 100; + + error InsufficientMsgValue(uint256 gotAmount, uint256 msgValue); + error TokenAmountNotEqualToMsgValue(uint256 gotAmount, uint256 msgValue); + + function test_validateFeeToken_valid_native() public { + Client.EVMTokenAmount[] memory tokenAmount = new Client.EVMTokenAmount[](1); + tokenAmount[0] = Client.EVMTokenAmount({token: address(s_weth), amount: amount}); + Client.EVM2AnyMessage memory message = Client.EVM2AnyMessage({ + receiver: abi.encode(XCHAIN_RECEIVER), + data: "", + tokenAmounts: tokenAmount, + feeToken: address(0), + extraArgs: "" + }); + + s_etherSenderReceiver.validateFeeToken{value: amount + 1}(message); + } + + function test_validateFeeToken_valid_feeToken() public { + Client.EVMTokenAmount[] memory tokenAmount = new Client.EVMTokenAmount[](1); + tokenAmount[0] = Client.EVMTokenAmount({token: address(s_weth), amount: amount}); + Client.EVM2AnyMessage memory message = Client.EVM2AnyMessage({ + receiver: abi.encode(XCHAIN_RECEIVER), + data: "", + tokenAmounts: tokenAmount, + feeToken: address(s_weth), + extraArgs: "" + }); + + s_etherSenderReceiver.validateFeeToken{value: amount}(message); + } + + function test_validateFeeToken_reverts_feeToken_tokenAmountNotEqualToMsgValue() public { + Client.EVMTokenAmount[] memory tokenAmount = new Client.EVMTokenAmount[](1); + tokenAmount[0] = Client.EVMTokenAmount({token: address(s_weth), amount: amount}); + Client.EVM2AnyMessage memory message = Client.EVM2AnyMessage({ + receiver: abi.encode(XCHAIN_RECEIVER), + data: "", + tokenAmounts: tokenAmount, + feeToken: address(s_weth), + extraArgs: "" + }); + + vm.expectRevert(abi.encodeWithSelector(TokenAmountNotEqualToMsgValue.selector, amount, amount + 1)); + s_etherSenderReceiver.validateFeeToken{value: amount + 1}(message); + } +} + +contract EtherSenderReceiverTest_validatedMessage is EtherSenderReceiverTest { + error InvalidDestinationReceiver(bytes destReceiver); + error InvalidTokenAmounts(uint256 gotAmounts); + error InvalidWethAddress(address want, address got); + error GasLimitTooLow(uint256 minLimit, uint256 gotLimit); + + uint256 internal constant amount = 100; + + function test_Fuzz_validatedMessage_msgSenderOverwrite(bytes memory data) public view { + Client.EVMTokenAmount[] memory tokenAmounts = new Client.EVMTokenAmount[](1); + tokenAmounts[0] = Client.EVMTokenAmount({ + token: address(0), // callers may not specify this. + amount: amount + }); + Client.EVM2AnyMessage memory message = Client.EVM2AnyMessage({ + receiver: abi.encode(XCHAIN_RECEIVER), + data: data, + tokenAmounts: tokenAmounts, + feeToken: address(0), + extraArgs: "" + }); + + Client.EVM2AnyMessage memory validatedMessage = s_etherSenderReceiver.validatedMessage(message); + assertEq(validatedMessage.receiver, abi.encode(XCHAIN_RECEIVER), "receiver must be XCHAIN_RECEIVER"); + assertEq(validatedMessage.data, abi.encode(OWNER), "data must be msg.sender"); + assertEq(validatedMessage.tokenAmounts[0].token, address(s_weth), "token must be weth"); + assertEq(validatedMessage.tokenAmounts[0].amount, amount, "amount must be correct"); + assertEq(validatedMessage.feeToken, address(0), "feeToken must be 0"); + assertEq(validatedMessage.extraArgs, bytes(""), "extraArgs must be empty"); + } + + function test_Fuzz_validatedMessage_tokenAddressOverwrite(address token) public view { + Client.EVMTokenAmount[] memory tokenAmounts = new Client.EVMTokenAmount[](1); + tokenAmounts[0] = Client.EVMTokenAmount({token: token, amount: amount}); + Client.EVM2AnyMessage memory message = Client.EVM2AnyMessage({ + receiver: abi.encode(XCHAIN_RECEIVER), + data: "", + tokenAmounts: tokenAmounts, + feeToken: address(0), + extraArgs: "" + }); + + Client.EVM2AnyMessage memory validatedMessage = s_etherSenderReceiver.validatedMessage(message); + assertEq(validatedMessage.receiver, abi.encode(XCHAIN_RECEIVER), "receiver must be XCHAIN_RECEIVER"); + assertEq(validatedMessage.data, abi.encode(OWNER), "data must be msg.sender"); + assertEq(validatedMessage.tokenAmounts[0].token, address(s_weth), "token must be weth"); + assertEq(validatedMessage.tokenAmounts[0].amount, amount, "amount must be correct"); + assertEq(validatedMessage.feeToken, address(0), "feeToken must be 0"); + assertEq(validatedMessage.extraArgs, bytes(""), "extraArgs must be empty"); + } + + function test_validatedMessage_emptyDataOverwrittenToMsgSender() public view { + Client.EVMTokenAmount[] memory tokenAmounts = new Client.EVMTokenAmount[](1); + tokenAmounts[0] = Client.EVMTokenAmount({ + token: address(0), // callers may not specify this. + amount: amount + }); + Client.EVM2AnyMessage memory message = Client.EVM2AnyMessage({ + receiver: abi.encode(XCHAIN_RECEIVER), + data: "", + tokenAmounts: tokenAmounts, + feeToken: address(0), + extraArgs: "" + }); + + Client.EVM2AnyMessage memory validatedMessage = s_etherSenderReceiver.validatedMessage(message); + assertEq(validatedMessage.receiver, abi.encode(XCHAIN_RECEIVER), "receiver must be XCHAIN_RECEIVER"); + assertEq(validatedMessage.data, abi.encode(OWNER), "data must be msg.sender"); + assertEq(validatedMessage.tokenAmounts[0].token, address(s_weth), "token must be weth"); + assertEq(validatedMessage.tokenAmounts[0].amount, amount, "amount must be correct"); + assertEq(validatedMessage.feeToken, address(0), "feeToken must be 0"); + assertEq(validatedMessage.extraArgs, bytes(""), "extraArgs must be empty"); + } + + function test_validatedMessage_dataOverwrittenToMsgSender() public view { + Client.EVMTokenAmount[] memory tokenAmounts = new Client.EVMTokenAmount[](1); + tokenAmounts[0] = Client.EVMTokenAmount({ + token: address(0), // callers may not specify this. + amount: amount + }); + Client.EVM2AnyMessage memory message = Client.EVM2AnyMessage({ + receiver: abi.encode(XCHAIN_RECEIVER), + data: abi.encode(address(42)), + tokenAmounts: tokenAmounts, + feeToken: address(0), + extraArgs: "" + }); + + Client.EVM2AnyMessage memory validatedMessage = s_etherSenderReceiver.validatedMessage(message); + assertEq(validatedMessage.receiver, abi.encode(XCHAIN_RECEIVER), "receiver must be XCHAIN_RECEIVER"); + assertEq(validatedMessage.data, abi.encode(OWNER), "data must be msg.sender"); + assertEq(validatedMessage.tokenAmounts[0].token, address(s_weth), "token must be weth"); + assertEq(validatedMessage.tokenAmounts[0].amount, amount, "amount must be correct"); + assertEq(validatedMessage.feeToken, address(0), "feeToken must be 0"); + assertEq(validatedMessage.extraArgs, bytes(""), "extraArgs must be empty"); + } + + function test_validatedMessage_tokenOverwrittenToWeth() public view { + Client.EVMTokenAmount[] memory tokenAmounts = new Client.EVMTokenAmount[](1); + tokenAmounts[0] = Client.EVMTokenAmount({ + token: address(42), // incorrect token. + amount: amount + }); + Client.EVM2AnyMessage memory message = Client.EVM2AnyMessage({ + receiver: abi.encode(XCHAIN_RECEIVER), + data: "", + tokenAmounts: tokenAmounts, + feeToken: address(0), + extraArgs: "" + }); + + Client.EVM2AnyMessage memory validatedMessage = s_etherSenderReceiver.validatedMessage(message); + assertEq(validatedMessage.receiver, abi.encode(XCHAIN_RECEIVER), "receiver must be XCHAIN_RECEIVER"); + assertEq(validatedMessage.data, abi.encode(OWNER), "data must be msg.sender"); + assertEq(validatedMessage.tokenAmounts[0].token, address(s_weth), "token must be weth"); + assertEq(validatedMessage.tokenAmounts[0].amount, amount, "amount must be correct"); + assertEq(validatedMessage.feeToken, address(0), "feeToken must be 0"); + assertEq(validatedMessage.extraArgs, bytes(""), "extraArgs must be empty"); + } + + function test_validatedMessage_validMessage_extraArgs() public view { + Client.EVMTokenAmount[] memory tokenAmounts = new Client.EVMTokenAmount[](1); + tokenAmounts[0] = Client.EVMTokenAmount({ + token: address(0), // callers may not specify this. + amount: amount + }); + Client.EVM2AnyMessage memory message = Client.EVM2AnyMessage({ + receiver: abi.encode(XCHAIN_RECEIVER), + data: "", + tokenAmounts: tokenAmounts, + feeToken: address(0), + extraArgs: Client._argsToBytes(Client.EVMExtraArgsV1({gasLimit: 200_000})) + }); + + Client.EVM2AnyMessage memory validatedMessage = s_etherSenderReceiver.validatedMessage(message); + assertEq(validatedMessage.receiver, abi.encode(XCHAIN_RECEIVER), "receiver must be XCHAIN_RECEIVER"); + assertEq(validatedMessage.data, abi.encode(OWNER), "data must be msg.sender"); + assertEq(validatedMessage.tokenAmounts[0].token, address(s_weth), "token must be weth"); + assertEq(validatedMessage.tokenAmounts[0].amount, amount, "amount must be correct"); + assertEq(validatedMessage.feeToken, address(0), "feeToken must be 0"); + assertEq( + validatedMessage.extraArgs, + Client._argsToBytes(Client.EVMExtraArgsV1({gasLimit: 200_000})), + "extraArgs must be correct" + ); + } + + function test_validatedMessage_invalidTokenAmounts() public { + Client.EVMTokenAmount[] memory tokenAmounts = new Client.EVMTokenAmount[](2); + tokenAmounts[0] = Client.EVMTokenAmount({token: address(0), amount: amount}); + tokenAmounts[1] = Client.EVMTokenAmount({token: address(0), amount: amount}); + Client.EVM2AnyMessage memory message = Client.EVM2AnyMessage({ + receiver: abi.encode(XCHAIN_RECEIVER), + data: "", + tokenAmounts: tokenAmounts, + feeToken: address(0), + extraArgs: "" + }); + + vm.expectRevert(abi.encodeWithSelector(InvalidTokenAmounts.selector, uint256(2))); + s_etherSenderReceiver.validatedMessage(message); + } +} + +contract EtherSenderReceiverTest_getFee is EtherSenderReceiverTest { + uint64 internal constant destinationChainSelector = 424242; + uint256 internal constant feeWei = 121212; + uint256 internal constant amount = 100; + + function test_getFee() public { + Client.EVMTokenAmount[] memory tokenAmounts = new Client.EVMTokenAmount[](1); + tokenAmounts[0] = Client.EVMTokenAmount({token: address(0), amount: amount}); + Client.EVM2AnyMessage memory message = Client.EVM2AnyMessage({ + receiver: abi.encode(XCHAIN_RECEIVER), + data: "", + tokenAmounts: tokenAmounts, + feeToken: address(0), + extraArgs: "" + }); + + Client.EVM2AnyMessage memory validatedMessage = s_etherSenderReceiver.validatedMessage(message); + + vm.mockCall( + ROUTER, + abi.encodeWithSelector(IRouterClient.getFee.selector, destinationChainSelector, validatedMessage), + abi.encode(feeWei) + ); + + uint256 fee = s_etherSenderReceiver.getFee(destinationChainSelector, message); + assertEq(fee, feeWei, "fee must be feeWei"); + } +} + +contract EtherSenderReceiverTest_ccipReceive is EtherSenderReceiverTest { + uint256 internal constant amount = 100; + uint64 internal constant sourceChainSelector = 424242; + address internal constant XCHAIN_SENDER = 0x9951529C13B01E542f7eE3b6D6665D292e9BA2E0; + + error InvalidTokenAmounts(uint256 gotAmounts); + error InvalidToken(address gotToken, address expectedToken); + + function test_Fuzz_ccipReceive(uint256 tokenAmount) public { + // cap to 10 ether because OWNER only has 10 ether. + if (tokenAmount > 10 ether) { + return; + } + + Client.EVMTokenAmount[] memory destTokenAmounts = new Client.EVMTokenAmount[](1); + destTokenAmounts[0] = Client.EVMTokenAmount({token: address(s_weth), amount: tokenAmount}); + Client.Any2EVMMessage memory message = Client.Any2EVMMessage({ + messageId: keccak256(abi.encode("ccip send")), + sourceChainSelector: sourceChainSelector, + sender: abi.encode(XCHAIN_SENDER), + data: abi.encode(OWNER), + destTokenAmounts: destTokenAmounts + }); + + // simulate a cross-chain token transfer, just transfer the weth to s_etherSenderReceiver. + s_weth.transfer(address(s_etherSenderReceiver), tokenAmount); + + uint256 balanceBefore = OWNER.balance; + s_etherSenderReceiver.publicCcipReceive(message); + uint256 balanceAfter = OWNER.balance; + assertEq(balanceAfter, balanceBefore + tokenAmount, "balance must be correct"); + } + + function test_ccipReceive_happyPath() public { + Client.EVMTokenAmount[] memory destTokenAmounts = new Client.EVMTokenAmount[](1); + destTokenAmounts[0] = Client.EVMTokenAmount({token: address(s_weth), amount: amount}); + Client.Any2EVMMessage memory message = Client.Any2EVMMessage({ + messageId: keccak256(abi.encode("ccip send")), + sourceChainSelector: 424242, + sender: abi.encode(XCHAIN_SENDER), + data: abi.encode(OWNER), + destTokenAmounts: destTokenAmounts + }); + + // simulate a cross-chain token transfer, just transfer the weth to s_etherSenderReceiver. + s_weth.transfer(address(s_etherSenderReceiver), amount); + + uint256 balanceBefore = OWNER.balance; + s_etherSenderReceiver.publicCcipReceive(message); + uint256 balanceAfter = OWNER.balance; + assertEq(balanceAfter, balanceBefore + amount, "balance must be correct"); + } + + function test_ccipReceive_fallbackToWethTransfer() public { + Client.EVMTokenAmount[] memory destTokenAmounts = new Client.EVMTokenAmount[](1); + destTokenAmounts[0] = Client.EVMTokenAmount({token: address(s_weth), amount: amount}); + Client.Any2EVMMessage memory message = Client.Any2EVMMessage({ + messageId: keccak256(abi.encode("ccip send")), + sourceChainSelector: 424242, + sender: abi.encode(XCHAIN_SENDER), + data: abi.encode(address(s_linkToken)), // ERC20 cannot receive() ether. + destTokenAmounts: destTokenAmounts + }); + + // simulate a cross-chain token transfer, just transfer the weth to s_etherSenderReceiver. + s_weth.transfer(address(s_etherSenderReceiver), amount); + + uint256 balanceBefore = address(s_linkToken).balance; + s_etherSenderReceiver.publicCcipReceive(message); + uint256 balanceAfter = address(s_linkToken).balance; + assertEq(balanceAfter, balanceBefore, "balance must be unchanged"); + uint256 wethBalance = s_weth.balanceOf(address(s_linkToken)); + assertEq(wethBalance, amount, "weth balance must be correct"); + } + + function test_ccipReceive_wrongTokenAmount() public { + Client.EVMTokenAmount[] memory destTokenAmounts = new Client.EVMTokenAmount[](2); + destTokenAmounts[0] = Client.EVMTokenAmount({token: address(s_weth), amount: amount}); + destTokenAmounts[1] = Client.EVMTokenAmount({token: address(s_weth), amount: amount}); + Client.Any2EVMMessage memory message = Client.Any2EVMMessage({ + messageId: keccak256(abi.encode("ccip send")), + sourceChainSelector: 424242, + sender: abi.encode(XCHAIN_SENDER), + data: abi.encode(OWNER), + destTokenAmounts: destTokenAmounts + }); + + vm.expectRevert(abi.encodeWithSelector(InvalidTokenAmounts.selector, uint256(2))); + s_etherSenderReceiver.publicCcipReceive(message); + } + + function test_ccipReceive_wrongToken() public { + Client.EVMTokenAmount[] memory destTokenAmounts = new Client.EVMTokenAmount[](1); + destTokenAmounts[0] = Client.EVMTokenAmount({token: address(s_someOtherWeth), amount: amount}); + Client.Any2EVMMessage memory message = Client.Any2EVMMessage({ + messageId: keccak256(abi.encode("ccip send")), + sourceChainSelector: 424242, + sender: abi.encode(XCHAIN_SENDER), + data: abi.encode(OWNER), + destTokenAmounts: destTokenAmounts + }); + + vm.expectRevert(abi.encodeWithSelector(InvalidToken.selector, address(s_someOtherWeth), address(s_weth))); + s_etherSenderReceiver.publicCcipReceive(message); + } +} + +contract EtherSenderReceiverTest_ccipSend is EtherSenderReceiverTest { + error InsufficientFee(uint256 gotFee, uint256 fee); + + uint256 internal constant amount = 100; + uint64 internal constant destinationChainSelector = 424242; + uint256 internal constant feeWei = 121212; + uint256 internal constant feeJuels = 232323; + + function test_Fuzz_ccipSend(uint256 feeFromRouter, uint256 feeSupplied) public { + // cap the fuzzer because OWNER only has a million ether. + vm.assume(feeSupplied < 1_000_000 ether - amount); + + Client.EVMTokenAmount[] memory tokenAmounts = new Client.EVMTokenAmount[](1); + tokenAmounts[0] = Client.EVMTokenAmount({ + token: address(0), // callers may not specify this. + amount: amount + }); + Client.EVM2AnyMessage memory message = Client.EVM2AnyMessage({ + receiver: abi.encode(XCHAIN_RECEIVER), + data: "", + tokenAmounts: tokenAmounts, + feeToken: address(0), + extraArgs: "" + }); + + Client.EVM2AnyMessage memory validatedMessage = s_etherSenderReceiver.validatedMessage(message); + + vm.mockCall( + ROUTER, + abi.encodeWithSelector(IRouterClient.getFee.selector, destinationChainSelector, validatedMessage), + abi.encode(feeFromRouter) + ); + + if (feeSupplied < feeFromRouter) { + vm.expectRevert(); + s_etherSenderReceiver.ccipSend{value: amount + feeSupplied}(destinationChainSelector, message); + } else { + bytes32 expectedMsgId = keccak256(abi.encode("ccip send")); + vm.mockCall( + ROUTER, + feeSupplied, + abi.encodeWithSelector(IRouterClient.ccipSend.selector, destinationChainSelector, validatedMessage), + abi.encode(expectedMsgId) + ); + + bytes32 actualMsgId = + s_etherSenderReceiver.ccipSend{value: amount + feeSupplied}(destinationChainSelector, message); + assertEq(actualMsgId, expectedMsgId, "message id must be correct"); + } + } + + function test_Fuzz_ccipSend_feeToken(uint256 feeFromRouter, uint256 feeSupplied) public { + // cap the fuzzer because OWNER only has a million LINK. + vm.assume(feeSupplied < 1_000_000 ether - amount); + + Client.EVMTokenAmount[] memory tokenAmounts = new Client.EVMTokenAmount[](1); + tokenAmounts[0] = Client.EVMTokenAmount({ + token: address(0), // callers may not specify this. + amount: amount + }); + Client.EVM2AnyMessage memory message = Client.EVM2AnyMessage({ + receiver: abi.encode(XCHAIN_RECEIVER), + data: "", + tokenAmounts: tokenAmounts, + feeToken: address(s_linkToken), + extraArgs: "" + }); + + Client.EVM2AnyMessage memory validatedMessage = s_etherSenderReceiver.validatedMessage(message); + + vm.mockCall( + ROUTER, + abi.encodeWithSelector(IRouterClient.getFee.selector, destinationChainSelector, validatedMessage), + abi.encode(feeFromRouter) + ); + + s_linkToken.approve(address(s_etherSenderReceiver), feeSupplied); + + if (feeSupplied < feeFromRouter) { + vm.expectRevert(); + s_etherSenderReceiver.ccipSend{value: amount}(destinationChainSelector, message); + } else { + bytes32 expectedMsgId = keccak256(abi.encode("ccip send")); + vm.mockCall( + ROUTER, + abi.encodeWithSelector(IRouterClient.ccipSend.selector, destinationChainSelector, validatedMessage), + abi.encode(expectedMsgId) + ); + + bytes32 actualMsgId = s_etherSenderReceiver.ccipSend{value: amount}(destinationChainSelector, message); + assertEq(actualMsgId, expectedMsgId, "message id must be correct"); + } + } + + function test_ccipSend_reverts_insufficientFee_weth() public { + Client.EVMTokenAmount[] memory tokenAmounts = new Client.EVMTokenAmount[](1); + tokenAmounts[0] = Client.EVMTokenAmount({ + token: address(0), // callers may not specify this. + amount: amount + }); + Client.EVM2AnyMessage memory message = Client.EVM2AnyMessage({ + receiver: abi.encode(XCHAIN_RECEIVER), + data: "", + tokenAmounts: tokenAmounts, + feeToken: address(s_weth), + extraArgs: "" + }); + + Client.EVM2AnyMessage memory validatedMessage = s_etherSenderReceiver.validatedMessage(message); + + vm.mockCall( + ROUTER, + abi.encodeWithSelector(IRouterClient.getFee.selector, destinationChainSelector, validatedMessage), + abi.encode(feeWei) + ); + + s_weth.approve(address(s_etherSenderReceiver), feeWei - 1); + + vm.expectRevert("SafeERC20: low-level call failed"); + s_etherSenderReceiver.ccipSend{value: amount}(destinationChainSelector, message); + } + + function test_ccipSend_reverts_insufficientFee_feeToken() public { + Client.EVMTokenAmount[] memory tokenAmounts = new Client.EVMTokenAmount[](1); + tokenAmounts[0] = Client.EVMTokenAmount({ + token: address(0), // callers may not specify this. + amount: amount + }); + Client.EVM2AnyMessage memory message = Client.EVM2AnyMessage({ + receiver: abi.encode(XCHAIN_RECEIVER), + data: "", + tokenAmounts: tokenAmounts, + feeToken: address(s_linkToken), + extraArgs: "" + }); + + Client.EVM2AnyMessage memory validatedMessage = s_etherSenderReceiver.validatedMessage(message); + + vm.mockCall( + ROUTER, + abi.encodeWithSelector(IRouterClient.getFee.selector, destinationChainSelector, validatedMessage), + abi.encode(feeJuels) + ); + + s_linkToken.approve(address(s_etherSenderReceiver), feeJuels - 1); + + vm.expectRevert("ERC20: insufficient allowance"); + s_etherSenderReceiver.ccipSend{value: amount}(destinationChainSelector, message); + } + + function test_ccipSend_reverts_insufficientFee_native() public { + Client.EVMTokenAmount[] memory tokenAmounts = new Client.EVMTokenAmount[](1); + tokenAmounts[0] = Client.EVMTokenAmount({ + token: address(0), // callers may not specify this. + amount: amount + }); + Client.EVM2AnyMessage memory message = Client.EVM2AnyMessage({ + receiver: abi.encode(XCHAIN_RECEIVER), + data: "", + tokenAmounts: tokenAmounts, + feeToken: address(0), + extraArgs: "" + }); + + Client.EVM2AnyMessage memory validatedMessage = s_etherSenderReceiver.validatedMessage(message); + + vm.mockCall( + ROUTER, + abi.encodeWithSelector(IRouterClient.getFee.selector, destinationChainSelector, validatedMessage), + abi.encode(feeWei) + ); + + vm.expectRevert(); + s_etherSenderReceiver.ccipSend{value: amount + feeWei - 1}(destinationChainSelector, message); + } + + function test_ccipSend_success_nativeExcess() public { + Client.EVMTokenAmount[] memory tokenAmounts = new Client.EVMTokenAmount[](1); + tokenAmounts[0] = Client.EVMTokenAmount({ + token: address(0), // callers may not specify this. + amount: amount + }); + Client.EVM2AnyMessage memory message = Client.EVM2AnyMessage({ + receiver: abi.encode(XCHAIN_RECEIVER), + data: "", + tokenAmounts: tokenAmounts, + feeToken: address(0), + extraArgs: "" + }); + + Client.EVM2AnyMessage memory validatedMessage = s_etherSenderReceiver.validatedMessage(message); + + bytes32 expectedMsgId = keccak256(abi.encode("ccip send")); + vm.mockCall( + ROUTER, + abi.encodeWithSelector(IRouterClient.getFee.selector, destinationChainSelector, validatedMessage), + abi.encode(feeWei) + ); + + // we assert that the correct value is sent to the router call, which should be + // the msg.value - feeWei. + vm.mockCall( + ROUTER, + feeWei + 1, + abi.encodeWithSelector(IRouterClient.ccipSend.selector, destinationChainSelector, validatedMessage), + abi.encode(expectedMsgId) + ); + + bytes32 actualMsgId = s_etherSenderReceiver.ccipSend{value: amount + feeWei + 1}(destinationChainSelector, message); + assertEq(actualMsgId, expectedMsgId, "message id must be correct"); + } + + function test_ccipSend_success_native() public { + Client.EVMTokenAmount[] memory tokenAmounts = new Client.EVMTokenAmount[](1); + tokenAmounts[0] = Client.EVMTokenAmount({ + token: address(0), // callers may not specify this. + amount: amount + }); + Client.EVM2AnyMessage memory message = Client.EVM2AnyMessage({ + receiver: abi.encode(XCHAIN_RECEIVER), + data: "", + tokenAmounts: tokenAmounts, + feeToken: address(0), + extraArgs: "" + }); + + Client.EVM2AnyMessage memory validatedMessage = s_etherSenderReceiver.validatedMessage(message); + + bytes32 expectedMsgId = keccak256(abi.encode("ccip send")); + vm.mockCall( + ROUTER, + abi.encodeWithSelector(IRouterClient.getFee.selector, destinationChainSelector, validatedMessage), + abi.encode(feeWei) + ); + vm.mockCall( + ROUTER, + feeWei, + abi.encodeWithSelector(IRouterClient.ccipSend.selector, destinationChainSelector, validatedMessage), + abi.encode(expectedMsgId) + ); + + bytes32 actualMsgId = s_etherSenderReceiver.ccipSend{value: amount + feeWei}(destinationChainSelector, message); + assertEq(actualMsgId, expectedMsgId, "message id must be correct"); + } + + function test_ccipSend_success_feeToken() public { + Client.EVMTokenAmount[] memory tokenAmounts = new Client.EVMTokenAmount[](1); + tokenAmounts[0] = Client.EVMTokenAmount({ + token: address(0), // callers may not specify this. + amount: amount + }); + Client.EVM2AnyMessage memory message = Client.EVM2AnyMessage({ + receiver: abi.encode(XCHAIN_RECEIVER), + data: "", + tokenAmounts: tokenAmounts, + feeToken: address(s_linkToken), + extraArgs: "" + }); + + Client.EVM2AnyMessage memory validatedMessage = s_etherSenderReceiver.validatedMessage(message); + + bytes32 expectedMsgId = keccak256(abi.encode("ccip send")); + vm.mockCall( + ROUTER, + abi.encodeWithSelector(IRouterClient.getFee.selector, destinationChainSelector, validatedMessage), + abi.encode(feeJuels) + ); + vm.mockCall( + ROUTER, + abi.encodeWithSelector(IRouterClient.ccipSend.selector, destinationChainSelector, validatedMessage), + abi.encode(expectedMsgId) + ); + + s_linkToken.approve(address(s_etherSenderReceiver), feeJuels); + + bytes32 actualMsgId = s_etherSenderReceiver.ccipSend{value: amount}(destinationChainSelector, message); + assertEq(actualMsgId, expectedMsgId, "message id must be correct"); + uint256 routerAllowance = s_linkToken.allowance(address(s_etherSenderReceiver), ROUTER); + assertEq(routerAllowance, feeJuels, "router allowance must be feeJuels"); + } + + function test_ccipSend_success_weth() public { + Client.EVMTokenAmount[] memory tokenAmounts = new Client.EVMTokenAmount[](1); + tokenAmounts[0] = Client.EVMTokenAmount({ + token: address(0), // callers may not specify this. + amount: amount + }); + Client.EVM2AnyMessage memory message = Client.EVM2AnyMessage({ + receiver: abi.encode(XCHAIN_RECEIVER), + data: "", + tokenAmounts: tokenAmounts, + feeToken: address(s_weth), + extraArgs: "" + }); + + Client.EVM2AnyMessage memory validatedMessage = s_etherSenderReceiver.validatedMessage(message); + + bytes32 expectedMsgId = keccak256(abi.encode("ccip send")); + vm.mockCall( + ROUTER, + abi.encodeWithSelector(IRouterClient.getFee.selector, destinationChainSelector, validatedMessage), + abi.encode(feeWei) + ); + vm.mockCall( + ROUTER, + abi.encodeWithSelector(IRouterClient.ccipSend.selector, destinationChainSelector, validatedMessage), + abi.encode(expectedMsgId) + ); + + s_weth.approve(address(s_etherSenderReceiver), feeWei); + + bytes32 actualMsgId = s_etherSenderReceiver.ccipSend{value: amount}(destinationChainSelector, message); + assertEq(actualMsgId, expectedMsgId, "message id must be correct"); + uint256 routerAllowance = s_weth.allowance(address(s_etherSenderReceiver), ROUTER); + assertEq(routerAllowance, type(uint256).max, "router allowance must be max for weth"); + } +} diff --git a/contracts/src/v0.8/ccip/test/applications/ImmutableExample.t.sol b/contracts/src/v0.8/ccip/test/applications/ImmutableExample.t.sol new file mode 100644 index 00000000000..0fb47b1f9b5 --- /dev/null +++ b/contracts/src/v0.8/ccip/test/applications/ImmutableExample.t.sol @@ -0,0 +1,61 @@ +pragma solidity ^0.8.0; + +import {IAny2EVMMessageReceiver} from "../../interfaces/IAny2EVMMessageReceiver.sol"; + +import {CCIPClientExample} from "../../applications/CCIPClientExample.sol"; +import {Client} from "../../libraries/Client.sol"; +import {EVM2EVMOnRampSetup} from "../onRamp/EVM2EVMOnRampSetup.t.sol"; + +import {IERC20} from "../../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/IERC20.sol"; +import {ERC165Checker} from + "../../../vendor/openzeppelin-solidity/v5.0.2/contracts/utils/introspection/ERC165Checker.sol"; + +contract CCIPClientExample_sanity is EVM2EVMOnRampSetup { + function test_ImmutableExamples_Success() public { + CCIPClientExample exampleContract = new CCIPClientExample(s_sourceRouter, IERC20(s_sourceFeeToken)); + deal(address(exampleContract), 100 ether); + deal(s_sourceFeeToken, address(exampleContract), 100 ether); + + // feeToken approval works + assertEq(IERC20(s_sourceFeeToken).allowance(address(exampleContract), address(s_sourceRouter)), 2 ** 256 - 1); + + // Can set chain + Client.EVMExtraArgsV1 memory extraArgs = Client.EVMExtraArgsV1({gasLimit: 300_000}); + bytes memory encodedExtraArgs = Client._argsToBytes(extraArgs); + exampleContract.enableChain(DEST_CHAIN_SELECTOR, encodedExtraArgs); + assertEq(exampleContract.s_chains(DEST_CHAIN_SELECTOR), encodedExtraArgs); + + address toAddress = makeAddr("toAddress"); + + // Can send data pay native + exampleContract.sendDataPayNative(DEST_CHAIN_SELECTOR, abi.encode(toAddress), bytes("hello")); + + // Can send data pay feeToken + exampleContract.sendDataPayFeeToken(DEST_CHAIN_SELECTOR, abi.encode(toAddress), bytes("hello")); + + // Can send data tokens + address sourceToken = s_sourceTokens[1]; + assertEq( + address(s_onRamp.getPoolBySourceToken(DEST_CHAIN_SELECTOR, IERC20(sourceToken))), + address(s_sourcePoolByToken[sourceToken]) + ); + deal(sourceToken, OWNER, 100 ether); + IERC20(sourceToken).approve(address(exampleContract), 1 ether); + Client.EVMTokenAmount[] memory tokenAmounts = new Client.EVMTokenAmount[](1); + tokenAmounts[0] = Client.EVMTokenAmount({token: sourceToken, amount: 1 ether}); + exampleContract.sendDataAndTokens(DEST_CHAIN_SELECTOR, abi.encode(toAddress), bytes("hello"), tokenAmounts); + // Tokens transferred from owner to router then burned in pool. + assertEq(IERC20(sourceToken).balanceOf(OWNER), 99 ether); + assertEq(IERC20(sourceToken).balanceOf(address(s_sourceRouter)), 0); + + // Can send just tokens + IERC20(sourceToken).approve(address(exampleContract), 1 ether); + exampleContract.sendTokens(DEST_CHAIN_SELECTOR, abi.encode(toAddress), tokenAmounts); + + // Can receive + assertTrue(ERC165Checker.supportsInterface(address(exampleContract), type(IAny2EVMMessageReceiver).interfaceId)); + + // Can disable chain + exampleContract.disableChain(DEST_CHAIN_SELECTOR); + } +} diff --git a/contracts/src/v0.8/ccip/test/applications/PingPongDemo.t.sol b/contracts/src/v0.8/ccip/test/applications/PingPongDemo.t.sol new file mode 100644 index 00000000000..f253a72fcb3 --- /dev/null +++ b/contracts/src/v0.8/ccip/test/applications/PingPongDemo.t.sol @@ -0,0 +1,170 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {PingPongDemo} from "../../applications/PingPongDemo.sol"; +import {Client} from "../../libraries/Client.sol"; +import "../onRamp/EVM2EVMOnRampSetup.t.sol"; + +// setup +contract PingPongDappSetup is EVM2EVMOnRampSetup { + PingPongDemo internal s_pingPong; + IERC20 internal s_feeToken; + + address internal immutable i_pongContract = makeAddr("ping_pong_counterpart"); + + function setUp() public virtual override { + EVM2EVMOnRampSetup.setUp(); + + s_feeToken = IERC20(s_sourceTokens[0]); + s_pingPong = new PingPongDemo(address(s_sourceRouter), s_feeToken); + s_pingPong.setCounterpart(DEST_CHAIN_SELECTOR, i_pongContract); + + uint256 fundingAmount = 1e18; + + // Fund the contract with LINK tokens + s_feeToken.transfer(address(s_pingPong), fundingAmount); + } +} + +contract PingPong_startPingPong is PingPongDappSetup { + uint256 internal pingPongNumber = 1; + + function test_StartPingPong_With_Sequenced_Ordered_Success() public { + Client.EVM2AnyMessage memory sentMessage = Client.EVM2AnyMessage({ + receiver: abi.encode(i_pongContract), + data: abi.encode(pingPongNumber), + tokenAmounts: new Client.EVMTokenAmount[](0), + feeToken: s_sourceFeeToken, + extraArgs: Client._argsToBytes(Client.EVMExtraArgsV1({gasLimit: 200_000})) + }); + + uint256 expectedFee = s_sourceRouter.getFee(DEST_CHAIN_SELECTOR, sentMessage); + + Internal.EVM2EVMMessage memory message = Internal.EVM2EVMMessage({ + sequenceNumber: 1, + feeTokenAmount: expectedFee, + sourceChainSelector: SOURCE_CHAIN_SELECTOR, + sender: address(s_pingPong), + receiver: i_pongContract, + nonce: 1, + data: abi.encode(pingPongNumber), + tokenAmounts: sentMessage.tokenAmounts, + sourceTokenData: new bytes[](sentMessage.tokenAmounts.length), + gasLimit: 200_000, + feeToken: sentMessage.feeToken, + strict: false, + messageId: "" + }); + + _assertPingPongSuccess(message); + } + + function test_StartPingPong_With_OOO_Success() public { + s_pingPong.setOutOfOrderExecution(true); + + Client.EVM2AnyMessage memory sentMessage = Client.EVM2AnyMessage({ + receiver: abi.encode(i_pongContract), + data: abi.encode(pingPongNumber), + tokenAmounts: new Client.EVMTokenAmount[](0), + feeToken: s_sourceFeeToken, + extraArgs: Client._argsToBytes(Client.EVMExtraArgsV2({gasLimit: 200_000, allowOutOfOrderExecution: true})) + }); + + uint256 expectedFee = s_sourceRouter.getFee(DEST_CHAIN_SELECTOR, sentMessage); + + Internal.EVM2EVMMessage memory message = Internal.EVM2EVMMessage({ + sequenceNumber: 1, + feeTokenAmount: expectedFee, + sourceChainSelector: SOURCE_CHAIN_SELECTOR, + sender: address(s_pingPong), + receiver: i_pongContract, + nonce: 0, + data: abi.encode(pingPongNumber), + tokenAmounts: sentMessage.tokenAmounts, + sourceTokenData: new bytes[](sentMessage.tokenAmounts.length), + gasLimit: 200_000, + feeToken: sentMessage.feeToken, + strict: false, + messageId: "" + }); + + _assertPingPongSuccess(message); + } + + function _assertPingPongSuccess(Internal.EVM2EVMMessage memory message) internal { + message.messageId = Internal._hash(message, s_metadataHash); + + vm.expectEmit(); + emit PingPongDemo.Ping(pingPongNumber); + + vm.expectEmit(); + emit EVM2EVMOnRamp.CCIPSendRequested(message); + + s_pingPong.startPingPong(); + } +} + +contract PingPong_ccipReceive is PingPongDappSetup { + function test_CcipReceive_Success() public { + Client.EVMTokenAmount[] memory tokenAmounts = new Client.EVMTokenAmount[](0); + + uint256 pingPongNumber = 5; + + Client.Any2EVMMessage memory message = Client.Any2EVMMessage({ + messageId: bytes32("a"), + sourceChainSelector: DEST_CHAIN_SELECTOR, + sender: abi.encode(i_pongContract), + data: abi.encode(pingPongNumber), + destTokenAmounts: tokenAmounts + }); + + vm.startPrank(address(s_sourceRouter)); + + vm.expectEmit(); + emit PingPongDemo.Pong(pingPongNumber + 1); + + s_pingPong.ccipReceive(message); + } +} + +contract PingPong_plumbing is PingPongDappSetup { + function test_Fuzz_CounterPartChainSelector_Success(uint64 chainSelector) public { + s_pingPong.setCounterpartChainSelector(chainSelector); + + assertEq(s_pingPong.getCounterpartChainSelector(), chainSelector); + } + + function test_Fuzz_CounterPartAddress_Success(address counterpartAddress) public { + s_pingPong.setCounterpartAddress(counterpartAddress); + + assertEq(s_pingPong.getCounterpartAddress(), counterpartAddress); + } + + function test_Fuzz_CounterPartAddress_Success(uint64 chainSelector, address counterpartAddress) public { + s_pingPong.setCounterpartChainSelector(chainSelector); + + s_pingPong.setCounterpart(chainSelector, counterpartAddress); + + assertEq(s_pingPong.getCounterpartAddress(), counterpartAddress); + assertEq(s_pingPong.getCounterpartChainSelector(), chainSelector); + } + + function test_Pausing_Success() public { + assertFalse(s_pingPong.isPaused()); + + s_pingPong.setPaused(true); + + assertTrue(s_pingPong.isPaused()); + } + + function test_OutOfOrderExecution_Success() public { + assertFalse(s_pingPong.getOutOfOrderExecution()); + + vm.expectEmit(); + emit PingPongDemo.OutOfOrderExecutionChange(true); + + s_pingPong.setOutOfOrderExecution(true); + + assertTrue(s_pingPong.getOutOfOrderExecution()); + } +} diff --git a/contracts/src/v0.8/ccip/test/applications/SelfFundedPingPong.t.sol b/contracts/src/v0.8/ccip/test/applications/SelfFundedPingPong.t.sol new file mode 100644 index 00000000000..d5db9d1f9d0 --- /dev/null +++ b/contracts/src/v0.8/ccip/test/applications/SelfFundedPingPong.t.sol @@ -0,0 +1,99 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {SelfFundedPingPong} from "../../applications/SelfFundedPingPong.sol"; +import {Client} from "../../libraries/Client.sol"; +import {EVM2EVMOnRamp} from "../../onRamp/EVM2EVMOnRamp.sol"; +import {EVM2EVMOnRampSetup} from "../onRamp/EVM2EVMOnRampSetup.t.sol"; + +import {IERC20} from "../../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/IERC20.sol"; + +contract SelfFundedPingPongDappSetup is EVM2EVMOnRampSetup { + SelfFundedPingPong internal s_pingPong; + IERC20 internal s_feeToken; + uint8 internal constant s_roundTripsBeforeFunding = 0; + + address internal immutable i_pongContract = makeAddr("ping_pong_counterpart"); + + function setUp() public virtual override { + EVM2EVMOnRampSetup.setUp(); + + s_feeToken = IERC20(s_sourceTokens[0]); + s_pingPong = new SelfFundedPingPong(address(s_sourceRouter), s_feeToken, s_roundTripsBeforeFunding); + s_pingPong.setCounterpart(DEST_CHAIN_SELECTOR, i_pongContract); + + uint256 fundingAmount = 5e18; + + // set ping pong as an onRamp nop to make sure that funding runs + EVM2EVMOnRamp.NopAndWeight[] memory nopsAndWeights = new EVM2EVMOnRamp.NopAndWeight[](1); + nopsAndWeights[0] = EVM2EVMOnRamp.NopAndWeight({nop: address(s_pingPong), weight: 1}); + s_onRamp.setNops(nopsAndWeights); + + // Fund the contract with LINK tokens + s_feeToken.transfer(address(s_pingPong), fundingAmount); + } +} + +contract SelfFundedPingPong_ccipReceive is SelfFundedPingPongDappSetup { + function test_Funding_Success() public { + Client.Any2EVMMessage memory message = Client.Any2EVMMessage({ + messageId: keccak256("msg id"), + sourceChainSelector: DEST_CHAIN_SELECTOR, + sender: abi.encode(i_pongContract), + data: "", + destTokenAmounts: new Client.EVMTokenAmount[](0) + }); + + uint8 countIncrBeforeFunding = 5; + + vm.expectEmit(); + emit SelfFundedPingPong.CountIncrBeforeFundingSet(countIncrBeforeFunding); + + s_pingPong.setCountIncrBeforeFunding(countIncrBeforeFunding); + + vm.startPrank(address(s_sourceRouter)); + for (uint256 pingPongNumber = 0; pingPongNumber <= countIncrBeforeFunding; ++pingPongNumber) { + message.data = abi.encode(pingPongNumber); + if (pingPongNumber == countIncrBeforeFunding - 1) { + vm.expectEmit(); + emit SelfFundedPingPong.Funded(); + vm.expectCall(address(s_onRamp), ""); + } + s_pingPong.ccipReceive(message); + } + } + + function test_FundingIfNotANop_Revert() public { + EVM2EVMOnRamp.NopAndWeight[] memory nopsAndWeights = new EVM2EVMOnRamp.NopAndWeight[](0); + s_onRamp.setNops(nopsAndWeights); + + uint8 countIncrBeforeFunding = 3; + s_pingPong.setCountIncrBeforeFunding(countIncrBeforeFunding); + + vm.startPrank(address(s_sourceRouter)); + Client.Any2EVMMessage memory message = Client.Any2EVMMessage({ + messageId: bytes32("a"), + sourceChainSelector: DEST_CHAIN_SELECTOR, + sender: abi.encode(i_pongContract), + data: abi.encode(countIncrBeforeFunding), + destTokenAmounts: new Client.EVMTokenAmount[](0) + }); + + // because pingPong is not set as a nop + vm.expectRevert(EVM2EVMOnRamp.OnlyCallableByOwnerOrAdminOrNop.selector); + s_pingPong.ccipReceive(message); + } +} + +contract SelfFundedPingPong_setCountIncrBeforeFunding is SelfFundedPingPongDappSetup { + function test_setCountIncrBeforeFunding() public { + uint8 c = s_pingPong.getCountIncrBeforeFunding(); + + vm.expectEmit(); + emit SelfFundedPingPong.CountIncrBeforeFundingSet(c + 1); + + s_pingPong.setCountIncrBeforeFunding(c + 1); + uint8 c2 = s_pingPong.getCountIncrBeforeFunding(); + assertEq(c2, c + 1); + } +} diff --git a/contracts/src/v0.8/ccip/test/applications/TokenProxy.t.sol b/contracts/src/v0.8/ccip/test/applications/TokenProxy.t.sol new file mode 100644 index 00000000000..9e78f6e369f --- /dev/null +++ b/contracts/src/v0.8/ccip/test/applications/TokenProxy.t.sol @@ -0,0 +1,211 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.24; + +import {TokenProxy} from "../../applications/TokenProxy.sol"; +import {Client} from "../../libraries/Client.sol"; +import {Internal} from "../../libraries/Internal.sol"; +import {EVM2EVMOnRamp} from "../../onRamp/EVM2EVMOnRamp.sol"; +import {EVM2EVMOnRampSetup} from "../onRamp/EVM2EVMOnRampSetup.t.sol"; + +import {IERC20} from "../../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/IERC20.sol"; + +contract TokenProxySetup is EVM2EVMOnRampSetup { + TokenProxy internal s_tokenProxy; + IERC20 internal s_feeToken; + IERC20 internal s_transferToken; + + function setUp() public virtual override { + EVM2EVMOnRampSetup.setUp(); + + s_feeToken = IERC20(s_sourceTokens[0]); + s_transferToken = IERC20(s_sourceTokens[1]); + s_tokenProxy = new TokenProxy(address(s_sourceRouter), address(s_transferToken)); + + s_transferToken.approve(address(s_tokenProxy), type(uint256).max); + s_feeToken.approve(address(s_tokenProxy), type(uint256).max); + } +} + +contract TokenProxy_constructor is TokenProxySetup { + function test_Constructor() public view { + assertEq(address(s_tokenProxy.getRouter()), address(s_sourceRouter)); + assertEq(address(s_tokenProxy.getToken()), address(s_transferToken)); + } +} + +contract TokenProxy_getFee is TokenProxySetup { + function test_GetFee_Success() public view { + Client.EVMTokenAmount[] memory tokens = new Client.EVMTokenAmount[](1); + tokens[0] = Client.EVMTokenAmount({token: address(s_transferToken), amount: 1e18}); + + Client.EVM2AnyMessage memory message = Client.EVM2AnyMessage({ + receiver: abi.encode(s_tokenProxy), + data: "", + tokenAmounts: tokens, + feeToken: s_sourceFeeToken, + extraArgs: Client._argsToBytes(Client.EVMExtraArgsV1({gasLimit: 0})) + }); + + uint256 expectedFee = s_sourceRouter.getFee(DEST_CHAIN_SELECTOR, message); + uint256 actualFee = s_tokenProxy.getFee(DEST_CHAIN_SELECTOR, message); + assertEq(expectedFee, actualFee); + } + + // Reverts + + function test_GetFeeInvalidToken_Revert() public { + Client.EVM2AnyMessage memory message = Client.EVM2AnyMessage({ + receiver: abi.encode(s_tokenProxy), + data: "", + tokenAmounts: new Client.EVMTokenAmount[](0), + feeToken: s_sourceFeeToken, + extraArgs: Client._argsToBytes(Client.EVMExtraArgsV1({gasLimit: 0})) + }); + + vm.expectRevert(TokenProxy.InvalidToken.selector); + + s_tokenProxy.getFee(DEST_CHAIN_SELECTOR, message); + } + + function test_GetFeeNoDataAllowed_Revert() public { + Client.EVMTokenAmount[] memory tokens = new Client.EVMTokenAmount[](1); + tokens[0] = Client.EVMTokenAmount({token: address(s_transferToken), amount: 1e18}); + + Client.EVM2AnyMessage memory message = Client.EVM2AnyMessage({ + receiver: abi.encode(s_tokenProxy), + data: "not empty", + tokenAmounts: tokens, + feeToken: s_sourceFeeToken, + extraArgs: Client._argsToBytes(Client.EVMExtraArgsV1({gasLimit: 0})) + }); + + vm.expectRevert(TokenProxy.NoDataAllowed.selector); + + s_tokenProxy.getFee(DEST_CHAIN_SELECTOR, message); + } + + function test_GetFeeGasShouldBeZero_Revert() public { + Client.EVMTokenAmount[] memory tokens = new Client.EVMTokenAmount[](1); + tokens[0] = Client.EVMTokenAmount({token: address(s_transferToken), amount: 1e18}); + + Client.EVM2AnyMessage memory message = Client.EVM2AnyMessage({ + receiver: abi.encode(s_tokenProxy), + data: "", + tokenAmounts: tokens, + feeToken: s_sourceFeeToken, + extraArgs: Client._argsToBytes(Client.EVMExtraArgsV1({gasLimit: 10})) + }); + + vm.expectRevert(TokenProxy.GasShouldBeZero.selector); + + s_tokenProxy.getFee(DEST_CHAIN_SELECTOR, message); + } +} + +contract TokenProxy_ccipSend is TokenProxySetup { + function test_CcipSend_Success() public { + vm.pauseGasMetering(); + Client.EVMTokenAmount[] memory tokens = new Client.EVMTokenAmount[](1); + tokens[0] = Client.EVMTokenAmount({token: address(s_transferToken), amount: 1e18}); + + Client.EVM2AnyMessage memory message = _generateEmptyMessage(); + message.tokenAmounts = tokens; + message.extraArgs = Client._argsToBytes(Client.EVMExtraArgsV1({gasLimit: 0})); + + uint256 expectedFee = s_sourceRouter.getFee(DEST_CHAIN_SELECTOR, message); + + s_feeToken.approve(address(s_tokenProxy), expectedFee); + + Internal.EVM2EVMMessage memory msgEvent = _messageToEvent(message, 1, 1, expectedFee, OWNER); + msgEvent.sender = address(s_tokenProxy); + msgEvent.messageId = Internal._hash(msgEvent, s_metadataHash); + + vm.expectEmit(); + emit EVM2EVMOnRamp.CCIPSendRequested(msgEvent); + + vm.resumeGasMetering(); + s_tokenProxy.ccipSend(DEST_CHAIN_SELECTOR, message); + } + + function test_CcipSendNative_Success() public { + vm.pauseGasMetering(); + Client.EVMTokenAmount[] memory tokens = new Client.EVMTokenAmount[](1); + tokens[0] = Client.EVMTokenAmount({token: address(s_transferToken), amount: 1e18}); + + Client.EVM2AnyMessage memory message = _generateEmptyMessage(); + message.tokenAmounts = tokens; + message.feeToken = address(0); + message.extraArgs = Client._argsToBytes(Client.EVMExtraArgsV1({gasLimit: 0})); + + uint256 expectedFee = s_sourceRouter.getFee(DEST_CHAIN_SELECTOR, message); + + Internal.EVM2EVMMessage memory msgEvent = _messageToEvent(message, 1, 1, expectedFee, OWNER); + msgEvent.sender = address(s_tokenProxy); + msgEvent.feeToken = s_sourceRouter.getWrappedNative(); + msgEvent.messageId = Internal._hash(msgEvent, s_metadataHash); + + vm.expectEmit(); + emit EVM2EVMOnRamp.CCIPSendRequested(msgEvent); + + vm.resumeGasMetering(); + s_tokenProxy.ccipSend{value: expectedFee}(DEST_CHAIN_SELECTOR, message); + } + + // Reverts + + function test_CcipSendInsufficientAllowance_Revert() public { + Client.EVMTokenAmount[] memory tokens = new Client.EVMTokenAmount[](1); + tokens[0] = Client.EVMTokenAmount({token: address(s_transferToken), amount: 1e18}); + + Client.EVM2AnyMessage memory message = _generateEmptyMessage(); + message.tokenAmounts = tokens; + message.extraArgs = Client._argsToBytes(Client.EVMExtraArgsV1({gasLimit: 0})); + + // Revoke allowance + s_transferToken.approve(address(s_tokenProxy), 0); + + vm.expectRevert("ERC20: insufficient allowance"); + + s_tokenProxy.ccipSend(DEST_CHAIN_SELECTOR, message); + } + + function test_CcipSendInvalidToken_Revert() public { + Client.EVMTokenAmount[] memory tokens = new Client.EVMTokenAmount[](1); + tokens[0] = Client.EVMTokenAmount({token: address(s_feeToken), amount: 1e18}); + + Client.EVM2AnyMessage memory message = _generateEmptyMessage(); + message.tokenAmounts = tokens; + message.extraArgs = Client._argsToBytes(Client.EVMExtraArgsV1({gasLimit: 0})); + + vm.expectRevert(TokenProxy.InvalidToken.selector); + + s_tokenProxy.ccipSend(DEST_CHAIN_SELECTOR, message); + } + + function test_CcipSendNoDataAllowed_Revert() public { + Client.EVMTokenAmount[] memory tokens = new Client.EVMTokenAmount[](1); + tokens[0] = Client.EVMTokenAmount({token: address(s_transferToken), amount: 1e18}); + + Client.EVM2AnyMessage memory message = _generateEmptyMessage(); + message.tokenAmounts = tokens; + message.data = "not empty"; + message.extraArgs = Client._argsToBytes(Client.EVMExtraArgsV1({gasLimit: 0})); + + vm.expectRevert(TokenProxy.NoDataAllowed.selector); + + s_tokenProxy.ccipSend(DEST_CHAIN_SELECTOR, message); + } + + function test_CcipSendGasShouldBeZero_Revert() public { + Client.EVMTokenAmount[] memory tokens = new Client.EVMTokenAmount[](1); + tokens[0] = Client.EVMTokenAmount({token: address(s_transferToken), amount: 1e18}); + + Client.EVM2AnyMessage memory message = _generateEmptyMessage(); + message.tokenAmounts = tokens; + message.extraArgs = Client._argsToBytes(Client.EVMExtraArgsV1({gasLimit: 1})); + + vm.expectRevert(TokenProxy.GasShouldBeZero.selector); + + s_tokenProxy.ccipSend(DEST_CHAIN_SELECTOR, message); + } +} diff --git a/contracts/src/v0.8/ccip/test/arm/ARMProxy.t.sol b/contracts/src/v0.8/ccip/test/arm/ARMProxy.t.sol new file mode 100644 index 00000000000..f1889fae755 --- /dev/null +++ b/contracts/src/v0.8/ccip/test/arm/ARMProxy.t.sol @@ -0,0 +1,42 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {IRMN} from "../../interfaces/IRMN.sol"; + +import {ARMProxy} from "../../ARMProxy.sol"; +import {MockRMN} from "../mocks/MockRMN.sol"; +import {RMNSetup} from "./RMNSetup.t.sol"; + +contract ARMProxyTest is RMNSetup { + MockRMN internal s_mockRMN; + ARMProxy internal s_armProxy; + + function setUp() public virtual override { + RMNSetup.setUp(); + s_mockRMN = new MockRMN(); + s_armProxy = new ARMProxy(address(s_rmn)); + } + + function test_ARMIsCursed_Success() public { + s_armProxy.setARM(address(s_mockRMN)); + assertFalse(IRMN(address(s_armProxy)).isCursed()); + s_mockRMN.setGlobalCursed(true); + assertTrue(IRMN(address(s_armProxy)).isCursed()); + } + + function test_ARMIsBlessed_Success() public { + s_armProxy.setARM(address(s_mockRMN)); + s_mockRMN.setTaggedRootBlessed(IRMN.TaggedRoot({commitStore: address(0), root: bytes32(0)}), true); + assertTrue(IRMN(address(s_armProxy)).isBlessed(IRMN.TaggedRoot({commitStore: address(0), root: bytes32(0)}))); + s_mockRMN.setTaggedRootBlessed(IRMN.TaggedRoot({commitStore: address(0), root: bytes32(0)}), false); + assertFalse(IRMN(address(s_armProxy)).isBlessed(IRMN.TaggedRoot({commitStore: address(0), root: bytes32(0)}))); + } + + function test_ARMCallRevertReasonForwarded() public { + bytes memory err = bytes("revert"); + s_mockRMN.setIsCursedRevert(err); + s_armProxy.setARM(address(s_mockRMN)); + vm.expectRevert(abi.encodeWithSelector(MockRMN.CustomError.selector, err)); + IRMN(address(s_armProxy)).isCursed(); + } +} diff --git a/contracts/src/v0.8/ccip/test/arm/ARMProxy_standalone.t.sol b/contracts/src/v0.8/ccip/test/arm/ARMProxy_standalone.t.sol new file mode 100644 index 00000000000..4f3e96fafa2 --- /dev/null +++ b/contracts/src/v0.8/ccip/test/arm/ARMProxy_standalone.t.sol @@ -0,0 +1,78 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {ARMProxy} from "../../ARMProxy.sol"; +import {Test} from "forge-std/Test.sol"; + +contract ARMProxyStandaloneTest is Test { + address internal constant EMPTY_ADDRESS = address(0x1); + address internal constant OWNER_ADDRESS = 0xC0ffeeEeC0fFeeeEc0ffeEeEc0ffEEEEC0FfEEee; + address internal constant MOCK_RMN_ADDRESS = 0x1337133713371337133713371337133713371337; + + ARMProxy internal s_armProxy; + + function setUp() public virtual { + // needed so that the extcodesize check in ARMProxy.fallback doesn't revert + vm.etch(MOCK_RMN_ADDRESS, bytes("fake bytecode")); + + vm.prank(OWNER_ADDRESS); + s_armProxy = new ARMProxy(MOCK_RMN_ADDRESS); + } + + function test_Constructor() public { + vm.expectEmit(); + emit ARMProxy.ARMSet(MOCK_RMN_ADDRESS); + ARMProxy proxy = new ARMProxy(MOCK_RMN_ADDRESS); + assertEq(proxy.getARM(), MOCK_RMN_ADDRESS); + } + + function test_SetARM() public { + vm.expectEmit(); + emit ARMProxy.ARMSet(MOCK_RMN_ADDRESS); + vm.prank(OWNER_ADDRESS); + s_armProxy.setARM(MOCK_RMN_ADDRESS); + assertEq(s_armProxy.getARM(), MOCK_RMN_ADDRESS); + } + + function test_SetARMzero() public { + vm.expectRevert(abi.encodeWithSelector(ARMProxy.ZeroAddressNotAllowed.selector)); + vm.prank(OWNER_ADDRESS); + s_armProxy.setARM(address(0x0)); + } + + /* + function test_Fuzz_ARMCall(bool expectedSuccess, bytes memory call, bytes memory ret) public { + // filter out calls to functions that will be handled on the ARMProxy instead + // of the underlying ARM contract + vm.assume( + call.length < 4 || + (bytes4(call) != s_armProxy.getARM.selector && + bytes4(call) != s_armProxy.setARM.selector && + bytes4(call) != s_armProxy.owner.selector && + bytes4(call) != s_armProxy.acceptOwnership.selector && + bytes4(call) != s_armProxy.transferOwnership.selector && + bytes4(call) != s_armProxy.typeAndVersion.selector) + ); + + if (expectedSuccess) { + vm.mockCall(MOCK_RMN_ADDRESS, 0, call, ret); + } else { + vm.mockCallRevert(MOCK_RMN_ADDRESS, 0, call, ret); + } + (bool actualSuccess, bytes memory result) = address(s_armProxy).call(call); + vm.clearMockedCalls(); + + assertEq(result, ret); + assertEq(expectedSuccess, actualSuccess); + } + */ + + function test_ARMCallEmptyContractRevert() public { + vm.prank(OWNER_ADDRESS); + s_armProxy.setARM(EMPTY_ADDRESS); // No code at address 1, should revert. + vm.expectRevert(); + bytes memory b = new bytes(0); + (bool success,) = address(s_armProxy).call(b); + success; + } +} diff --git a/contracts/src/v0.8/ccip/test/arm/RMN.t.sol b/contracts/src/v0.8/ccip/test/arm/RMN.t.sol new file mode 100644 index 00000000000..85501170e35 --- /dev/null +++ b/contracts/src/v0.8/ccip/test/arm/RMN.t.sol @@ -0,0 +1,1068 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {IRMN} from "../../interfaces/IRMN.sol"; + +import {GLOBAL_CURSE_SUBJECT, LIFT_CURSE_VOTE_ADDR, OWNER_CURSE_VOTE_ADDR, RMN} from "../../RMN.sol"; +import {RMNSetup, makeCursesHash, makeSubjects} from "./RMNSetup.t.sol"; + +import {Test} from "forge-std/Test.sol"; + +bytes28 constant GARBAGE_CURSES_HASH = bytes28(keccak256("GARBAGE_CURSES_HASH")); + +contract ConfigCompare is Test { + function assertConfigEq(RMN.Config memory actualConfig, RMN.Config memory expectedConfig) public pure { + assertEq(actualConfig.voters.length, expectedConfig.voters.length); + for (uint256 i = 0; i < expectedConfig.voters.length; ++i) { + RMN.Voter memory expectedVoter = expectedConfig.voters[i]; + RMN.Voter memory actualVoter = actualConfig.voters[i]; + assertEq(actualVoter.blessVoteAddr, expectedVoter.blessVoteAddr); + assertEq(actualVoter.curseVoteAddr, expectedVoter.curseVoteAddr); + assertEq(actualVoter.blessWeight, expectedVoter.blessWeight); + assertEq(actualVoter.curseWeight, expectedVoter.curseWeight); + } + assertEq(actualConfig.blessWeightThreshold, expectedConfig.blessWeightThreshold); + assertEq(actualConfig.curseWeightThreshold, expectedConfig.curseWeightThreshold); + } +} + +contract RMN_constructor is ConfigCompare, RMNSetup { + function test_Constructor_Success() public view { + RMN.Config memory expectedConfig = rmnConstructorArgs(); + (uint32 actualVersion,, RMN.Config memory actualConfig) = s_rmn.getConfigDetails(); + assertEq(actualVersion, 1); + assertConfigEq(actualConfig, expectedConfig); + } +} + +contract RMN_voteToBless is RMNSetup { + function _getFirstBlessVoterAndWeight() internal pure returns (address, uint8) { + RMN.Config memory cfg = rmnConstructorArgs(); + return (cfg.voters[0].blessVoteAddr, cfg.voters[0].blessWeight); + } + + // Success + + function test_RootSuccess() public { + uint256 numRoots = 10; + + (address voter, uint8 voterWeight) = _getFirstBlessVoterAndWeight(); + + for (uint256 i = 1; i <= numRoots; ++i) { + vm.expectEmit(); + emit RMN.VotedToBless(1, voter, makeTaggedRoot(i), voterWeight); + } + + vm.prank(voter); + s_rmn.voteToBless(makeTaggedRootsInclusive(1, numRoots)); + + for (uint256 i = 1; i <= numRoots; ++i) { + assertFalse(s_rmn.isBlessed(makeTaggedRoot(i))); + assertEq(voterWeight, getWeightOfVotesToBlessRoot(makeTaggedRoot(i))); + assertTrue(hasVotedToBlessRoot(voter, makeTaggedRoot(1))); + } + } + + // Reverts + + function test_SenderAlreadyVoted_Revert() public { + (address voter,) = _getFirstBlessVoterAndWeight(); + + vm.startPrank(voter); + s_rmn.voteToBless(makeTaggedRootSingleton(1)); + assertTrue(hasVotedToBlessRoot(voter, makeTaggedRoot(1))); + + uint256 votesToBlessBefore = getWeightOfVotesToBlessRoot(makeTaggedRoot(1)); + vm.expectRevert(RMN.VoteToBlessNoop.selector); + s_rmn.voteToBless(makeTaggedRootSingleton(1)); + assertEq(votesToBlessBefore, getWeightOfVotesToBlessRoot(makeTaggedRoot(1))); + } + + function test_IsAlreadyBlessed_Revert() public { + RMN.Config memory cfg = rmnConstructorArgs(); + + // Bless voters 2,3,4 vote to bless + for (uint256 i = 1; i < cfg.voters.length; i++) { + vm.startPrank(cfg.voters[i].blessVoteAddr); + s_rmn.voteToBless(makeTaggedRootSingleton(1)); + } + + uint256 votesToBlessBefore = getWeightOfVotesToBlessRoot(makeTaggedRoot(1)); + vm.startPrank(cfg.voters[0].blessVoteAddr); + vm.expectRevert(RMN.VoteToBlessNoop.selector); + s_rmn.voteToBless(makeTaggedRootSingleton(1)); + assertEq(votesToBlessBefore, getWeightOfVotesToBlessRoot(makeTaggedRoot(1))); + } + + function test_Curse_Revert() public { + RMN.Config memory cfg = rmnConstructorArgs(); + + for (uint256 i = 0; i < cfg.voters.length; i++) { + vm.startPrank(cfg.voters[i].curseVoteAddr); + s_rmn.voteToCurse(makeCurseId(i), makeSubjects(GLOBAL_CURSE_SUBJECT)); + } + + vm.startPrank(cfg.voters[0].blessVoteAddr); + vm.expectRevert(RMN.VoteToBlessForbiddenDuringActiveGlobalCurse.selector); + s_rmn.voteToBless(makeTaggedRootSingleton(12903)); + } + + function test_UnauthorizedVoter_Revert() public { + vm.startPrank(STRANGER); + vm.expectRevert(abi.encodeWithSelector(RMN.UnauthorizedVoter.selector, STRANGER)); + s_rmn.voteToBless(makeTaggedRootSingleton(12321)); + } +} + +contract RMN_ownerUnbless is RMNSetup { + function test_Unbless_Success() public { + RMN.Config memory cfg = rmnConstructorArgs(); + for (uint256 i = 0; i < cfg.voters.length; ++i) { + vm.startPrank(cfg.voters[i].blessVoteAddr); + s_rmn.voteToBless(makeTaggedRootSingleton(1)); + } + assertTrue(s_rmn.isBlessed(makeTaggedRoot(1))); + + vm.startPrank(OWNER); + s_rmn.ownerResetBlessVotes(makeTaggedRootSingleton(1)); + assertFalse(s_rmn.isBlessed(makeTaggedRoot(1))); + } +} + +contract RMN_unvoteToCurse is RMNSetup { + uint256 internal s_curser; + bytes28 internal s_cursesHash; + + function setUp() public override { + RMNSetup.setUp(); + RMN.Config memory cfg = rmnConstructorArgs(); + + s_curser = 0; + vm.startPrank(cfg.voters[s_curser].curseVoteAddr); + s_rmn.voteToCurse(makeCurseId(1), makeSubjects(0)); + bytes28 expectedCursesHash = makeCursesHash(makeCurseId(1)); + assertFalse(s_rmn.isCursed()); + (address[] memory cursers, bytes28[] memory cursesHashes, uint16 weight, bool cursed) = s_rmn.getCurseProgress(0); + assertEq(1, cursers.length); + assertEq(cfg.voters[s_curser].curseVoteAddr, cursers[0]); + assertEq(cfg.voters[s_curser].curseWeight, weight); + assertEq(1, cursesHashes.length); + assertEq(expectedCursesHash, cursesHashes[0]); + assertFalse(cursed); + + s_cursesHash = expectedCursesHash; + } + + function test_UnauthorizedVoter() public { + RMN.Config memory cfg = rmnConstructorArgs(); + // Someone else cannot unvote to curse on the curser's behalf. + address[] memory unauthorized = new address[](3); + unauthorized[0] = cfg.voters[s_curser].blessVoteAddr; + unauthorized[1] = cfg.voters[s_curser ^ 1].blessVoteAddr; + unauthorized[2] = OWNER; + + for (uint256 i = 0; i < unauthorized.length; ++i) { + bytes memory expectedRevert = abi.encodeWithSelector(RMN.UnauthorizedVoter.selector, unauthorized[i]); + vm.startPrank(unauthorized[i]); + { + // should fail when using the correct curses hash + RMN.UnvoteToCurseRequest[] memory reqs = new RMN.UnvoteToCurseRequest[](1); + reqs[0] = RMN.UnvoteToCurseRequest({subject: 0, cursesHash: s_cursesHash}); + vm.expectRevert(expectedRevert); + s_rmn.unvoteToCurse(reqs); + } + { + // should fail when using garbage curses hash + RMN.UnvoteToCurseRequest[] memory reqs = new RMN.UnvoteToCurseRequest[](1); + reqs[0] = RMN.UnvoteToCurseRequest({subject: 0, cursesHash: GARBAGE_CURSES_HASH}); + vm.expectRevert(expectedRevert); + s_rmn.unvoteToCurse(reqs); + } + } + } + + function test_InvalidCursesHash() public { + RMN.Config memory cfg = rmnConstructorArgs(); + vm.startPrank(cfg.voters[s_curser].curseVoteAddr); + RMN.UnvoteToCurseRequest[] memory reqs = new RMN.UnvoteToCurseRequest[](1); + reqs[0] = RMN.UnvoteToCurseRequest({subject: 0, cursesHash: GARBAGE_CURSES_HASH}); + vm.expectRevert(RMN.UnvoteToCurseNoop.selector); + s_rmn.unvoteToCurse(reqs); + } + + function test_ValidCursesHash() public { + RMN.Config memory cfg = rmnConstructorArgs(); + vm.startPrank(cfg.voters[s_curser].curseVoteAddr); + RMN.UnvoteToCurseRequest[] memory reqs = new RMN.UnvoteToCurseRequest[](1); + reqs[0] = RMN.UnvoteToCurseRequest({subject: 0, cursesHash: s_cursesHash}); + s_rmn.unvoteToCurse(reqs); // succeeds + } + + function test_OwnerSucceeds() public { + RMN.Config memory cfg = rmnConstructorArgs(); + vm.startPrank(OWNER); + RMN.OwnerUnvoteToCurseRequest[] memory reqs = new RMN.OwnerUnvoteToCurseRequest[](1); + reqs[0] = RMN.OwnerUnvoteToCurseRequest({ + curseVoteAddr: cfg.voters[s_curser].curseVoteAddr, + unit: RMN.UnvoteToCurseRequest({subject: 0, cursesHash: s_cursesHash}), + forceUnvote: false + }); + s_rmn.ownerUnvoteToCurse(reqs); + } + + function test_OwnerSkips() public { + RMN.Config memory cfg = rmnConstructorArgs(); + vm.startPrank(OWNER); + RMN.OwnerUnvoteToCurseRequest[] memory reqs = new RMN.OwnerUnvoteToCurseRequest[](1); + reqs[0] = RMN.OwnerUnvoteToCurseRequest({ + curseVoteAddr: cfg.voters[s_curser].curseVoteAddr, + unit: RMN.UnvoteToCurseRequest({subject: 0, cursesHash: GARBAGE_CURSES_HASH}), + forceUnvote: false + }); + + vm.expectEmit(); + emit RMN.SkippedUnvoteToCurse(cfg.voters[s_curser].curseVoteAddr, 0, s_cursesHash, GARBAGE_CURSES_HASH); + vm.expectRevert(RMN.UnvoteToCurseNoop.selector); + s_rmn.ownerUnvoteToCurse(reqs); + } + + function test_VotersCantLiftCurseButOwnerCan() public { + vm.stopPrank(); + RMN.Config memory cfg = rmnConstructorArgs(); + // s_curser has voted to curse during setUp + { + (address[] memory voters, bytes28[] memory cursesHashes, uint16 accWeight, bool cursed) = + s_rmn.getCurseProgress(0); + assertEq(accWeight, cfg.voters[s_curser].curseWeight); + assertFalse(cursed); + assertEq(voters.length, 1); + assertEq(cursesHashes.length, 1); + assertEq(voters[0], cfg.voters[s_curser].curseVoteAddr); + assertEq(cursesHashes[0], makeCursesHash(makeCurseId(1))); + } + // everyone else votes now, same curse id, same subject + { + for (uint256 i = 0; i < cfg.voters.length; ++i) { + if (i == s_curser) continue; // already voted to curse + vm.prank(cfg.voters[i].curseVoteAddr); + s_rmn.voteToCurse(makeCurseId(1), makeSubjects(0)); + } + } + // subject must be cursed now + { + assertTrue(s_rmn.isCursed(0)); + } + // curse progress should be as full as it can get + { + (address[] memory voters, bytes28[] memory cursesHashes, uint16 accWeight, bool cursed) = + s_rmn.getCurseProgress(0); + uint256 allWeights; + for (uint256 i = 0; i < cfg.voters.length; i++) { + allWeights += cfg.voters[i].curseWeight; + } + assertEq(accWeight, allWeights); + assertTrue(cursed); + assertEq(voters.length, cfg.voters.length); + assertEq(cursesHashes.length, cfg.voters.length); + for (uint256 i = 0; i < cfg.voters.length; ++i) { + assertEq(voters[i], cfg.voters[i].curseVoteAddr); + assertEq(cursesHashes[i], makeCursesHash(makeCurseId(1))); + } + } + // everyone unvotes to curse, successfully + { + for (uint256 i = 0; i < cfg.voters.length; ++i) { + vm.prank(cfg.voters[i].curseVoteAddr); + RMN.UnvoteToCurseRequest[] memory reqs = new RMN.UnvoteToCurseRequest[](1); + reqs[0] = RMN.UnvoteToCurseRequest({subject: 0, cursesHash: makeCursesHash(makeCurseId(1))}); + s_rmn.unvoteToCurse(reqs); + } + } + // curse should still be in place as only the owner can lift it + { + assertTrue(s_rmn.isCursed(0)); + } + // curse progress should be empty, expect for the cursed flag + { + (address[] memory voters, bytes28[] memory cursesHashes, uint16 accWeight, bool cursed) = + s_rmn.getCurseProgress(0); + assertEq(accWeight, 0); + assertTrue(cursed); + assertEq(voters.length, 0); + assertEq(cursesHashes.length, 0); + } + // owner lifts curse + { + RMN.OwnerUnvoteToCurseRequest[] memory ownerReq = new RMN.OwnerUnvoteToCurseRequest[](1); + ownerReq[0] = RMN.OwnerUnvoteToCurseRequest({ + curseVoteAddr: LIFT_CURSE_VOTE_ADDR, + unit: RMN.UnvoteToCurseRequest({subject: 0, cursesHash: 0}), + forceUnvote: false + }); + vm.prank(OWNER); + s_rmn.ownerUnvoteToCurse(ownerReq); + } + // curse should now be lifted + { + assertFalse(s_rmn.isCursed(0)); + } + } +} + +contract RMN_voteToCurse_2 is RMNSetup { + function initialConfig() internal pure returns (RMN.Config memory) { + RMN.Config memory cfg = RMN.Config({voters: new RMN.Voter[](3), blessWeightThreshold: 1, curseWeightThreshold: 3}); + cfg.voters[0] = + RMN.Voter({blessVoteAddr: BLESS_VOTER_1, curseVoteAddr: CURSE_VOTER_1, blessWeight: 1, curseWeight: 1}); + cfg.voters[1] = + RMN.Voter({blessVoteAddr: BLESS_VOTER_2, curseVoteAddr: CURSE_VOTER_2, blessWeight: 1, curseWeight: 1}); + cfg.voters[2] = + RMN.Voter({blessVoteAddr: BLESS_VOTER_3, curseVoteAddr: CURSE_VOTER_3, blessWeight: 1, curseWeight: 1}); + return cfg; + } + + function setUp() public override { + vm.prank(OWNER); + s_rmn = new RMN(initialConfig()); + } + + function test_VotesAreDroppedIfSubjectIsNotCursedDuringConfigChange() public { + // vote to curse the subject from an insufficient number of voters, one voter + { + RMN.Config memory cfg = initialConfig(); + vm.prank(cfg.voters[0].curseVoteAddr); + s_rmn.voteToCurse(makeCurseId(1), makeSubjects(0)); + } + // vote must be in place + { + (address[] memory voters, bytes28[] memory cursesHashes, uint16 accWeight, bool cursed) = + s_rmn.getCurseProgress(0); + assertEq(voters.length, 1); + assertEq(cursesHashes.length, 1); + assertEq(accWeight, 1); + assertFalse(cursed); + } + // change config to include only the first voter, i.e., initialConfig().voters[0] + { + RMN.Config memory cfg = initialConfig(); + RMN.Voter[] memory voters = cfg.voters; + assembly { + mstore(voters, 1) + } + cfg.curseWeightThreshold = 1; + vm.prank(OWNER); + s_rmn.setConfig(cfg); + } + // vote must be dropped + { + (address[] memory voters, bytes28[] memory cursesHashes, uint16 accWeight, bool cursed) = + s_rmn.getCurseProgress(0); + assertEq(voters.length, 0); + assertEq(cursesHashes.length, 0); + assertEq(accWeight, 0); + assertFalse(cursed); + } + // cause an owner curse now + { + vm.prank(OWNER); + s_rmn.ownerCurse(makeCurseId(1), makeSubjects(0)); + } + // only the owner curse must be visible + { + (address[] memory voters, bytes28[] memory cursesHashes, uint16 accWeight, bool cursed) = + s_rmn.getCurseProgress(0); + assertEq(voters.length, 1); + assertEq(voters[0], OWNER_CURSE_VOTE_ADDR); + assertEq(cursesHashes.length, 1); + assertEq(cursesHashes[0], makeCursesHash(makeCurseId(1))); + assertEq(accWeight, 0); + assertTrue(cursed); + } + } + + function test_VotesAreRetainedIfSubjectIsCursedDuringConfigChange() public { + uint256 numVotersInitially = initialConfig().voters.length; + // curse the subject with votes from all voters + { + RMN.Config memory cfg = initialConfig(); + for (uint256 i = 0; i < cfg.voters.length; ++i) { + vm.prank(cfg.voters[i].curseVoteAddr); + s_rmn.voteToCurse(makeCurseId(1), makeSubjects(0)); + } + } + // subject is now cursed + { + assertTrue(s_rmn.isCursed(0)); + } + // throw in an owner curse + { + vm.prank(OWNER); + s_rmn.ownerCurse(makeCurseId(1), makeSubjects(0)); + } + + uint256 snapshot = vm.snapshot(); + + for (uint256 keepVoters = 1; keepVoters <= numVotersInitially; ++keepVoters) { + vm.revertTo(snapshot); + + // change config to include only the first #keepVoters voters, i.e., initialConfig().voters[0..keepVoters] + { + RMN.Config memory cfg = initialConfig(); + RMN.Voter[] memory voters = cfg.voters; + assembly { + mstore(voters, keepVoters) + } + cfg.curseWeightThreshold = uint16(keepVoters); + vm.prank(OWNER); + s_rmn.setConfig(cfg); + } + // subject is still cursed + { + assertTrue(s_rmn.isCursed(0)); + } + // all votes from the first keepVoters & owner must be present + { + (address[] memory voters, bytes28[] memory cursesHashes, uint16 accWeight, bool cursed) = + s_rmn.getCurseProgress(0); + assertEq(voters.length, keepVoters + 1 /* owner */ ); + assertEq(cursesHashes.length, keepVoters + 1 /* owner */ ); + assertEq(accWeight, keepVoters /* 1 per voter */ ); + assertTrue(cursed); + for (uint256 i = 0; i < keepVoters; ++i) { + assertEq(voters[i], initialConfig().voters[i].curseVoteAddr); + assertEq(cursesHashes[i], makeCursesHash(makeCurseId(1))); + } + assertEq(voters[voters.length - 1], OWNER_CURSE_VOTE_ADDR); + assertEq(cursesHashes[cursesHashes.length - 1], makeCursesHash(makeCurseId(1))); + } + // the owner unvoting for all is not enough to lift the curse, because remember that the owner has an active vote + // also + { + for (uint256 i = 0; i < keepVoters; ++i) { + RMN.OwnerUnvoteToCurseRequest[] memory ownerReq = new RMN.OwnerUnvoteToCurseRequest[](1); + ownerReq[0] = RMN.OwnerUnvoteToCurseRequest({ + curseVoteAddr: initialConfig().voters[i].curseVoteAddr, + unit: RMN.UnvoteToCurseRequest({subject: 0, cursesHash: makeCursesHash(makeCurseId(1))}), + forceUnvote: false + }); + vm.prank(OWNER); + s_rmn.ownerUnvoteToCurse(ownerReq); + + assertTrue(s_rmn.isCursed(0)); + } + } + // after owner unvotes for themselves, finally, the curse will be lifted + { + RMN.OwnerUnvoteToCurseRequest[] memory ownerReq = new RMN.OwnerUnvoteToCurseRequest[](1); + ownerReq[0] = RMN.OwnerUnvoteToCurseRequest({ + curseVoteAddr: OWNER_CURSE_VOTE_ADDR, + unit: RMN.UnvoteToCurseRequest({subject: 0, cursesHash: makeCursesHash(makeCurseId(1))}), + forceUnvote: false + }); + vm.prank(OWNER); + s_rmn.ownerUnvoteToCurse(ownerReq); + + assertFalse(s_rmn.isCursed(0)); + } + } + } +} + +contract RMN_voteToCurse is RMNSetup { + function _getFirstCurseVoterAndWeight() internal pure returns (address, uint8) { + RMN.Config memory cfg = rmnConstructorArgs(); + return (cfg.voters[0].curseVoteAddr, cfg.voters[0].curseWeight); + } + + // Success + + function test_CurseOnlyWhenThresholdReached_Success() public { + uint256 numSubjects = 3; + uint256 maxNumRevotes = 2; + + RMN.Config memory cfg = rmnConstructorArgs(); + bytes16[] memory subjects = new bytes16[](numSubjects); + for (uint256 i = 0; i < numSubjects; ++i) { + subjects[i] = bytes16(uint128(i)); + } + for (uint256 numRevotes = 1; numRevotes <= maxNumRevotes; ++numRevotes) { + // all voters but the last vote, but can't surpass the curse weight threshold + for (uint256 i = 0; i < cfg.voters.length - 1; ++i) { + vm.prank(cfg.voters[i].curseVoteAddr); + s_rmn.voteToCurse(makeCurseId(numRevotes), subjects); + } + // no curse is yet active, last voter also needs to vote for any curse to be active + { + // ensure every subject is not cursed + for (uint256 i = 0; i < numSubjects; ++i) { + assertFalse(s_rmn.isCursed(subjects[i])); + } + // ensure every vote has been recorded + assertEq( + s_rmn.getRecordedCurseRelatedOpsCount(), + 1 /* setConfig */ + (cfg.voters.length - 1) * numRevotes * numSubjects + ); + } + } + + // last voter now votes + vm.prank(cfg.voters[cfg.voters.length - 1].curseVoteAddr); + s_rmn.voteToCurse(makeCurseId(0), subjects); + // curses should be now active + { + // ensure every subject is now cursed + for (uint256 i = 0; i < numSubjects; ++i) { + assertTrue(s_rmn.isCursed(subjects[i])); + } + // ensure every vote has been recorded + assertEq( + s_rmn.getRecordedCurseRelatedOpsCount(), + 1 /* setConfig */ + ((cfg.voters.length - 1) * maxNumRevotes + 1) * numSubjects + ); + } + } + + function test_VoteToCurse_NoCurse_Success() public { + (address voter, uint8 weight) = _getFirstCurseVoterAndWeight(); + vm.startPrank(voter); + vm.expectEmit(); + emit RMN.VotedToCurse( + 1, // configVersion + voter, + GLOBAL_CURSE_SUBJECT, + makeCurseId(123), + weight, + 1234567890, // blockTimestamp + makeCursesHash(makeCurseId(123)), // cursesHash + weight + ); + + s_rmn.voteToCurse(makeCurseId(123), makeSubjects(GLOBAL_CURSE_SUBJECT)); + + (address[] memory voters,, uint16 votes, bool cursed) = s_rmn.getCurseProgress(GLOBAL_CURSE_SUBJECT); + assertEq(1, voters.length); + assertEq(voter, voters[0]); + assertEq(weight, votes); + assertFalse(cursed); + } + + function test_VoteToCurse_YesCurse_Success() public { + RMN.Config memory cfg = rmnConstructorArgs(); + for (uint256 i = 0; i < cfg.voters.length - 1; ++i) { + vm.startPrank(cfg.voters[i].curseVoteAddr); + s_rmn.voteToCurse(makeCurseId(1), makeSubjects(0)); + } + + vm.expectEmit(); + emit RMN.Cursed(1, 0, uint64(block.timestamp)); + + vm.startPrank(cfg.voters[cfg.voters.length - 1].curseVoteAddr); + vm.resumeGasMetering(); + s_rmn.voteToCurse(makeCurseId(1), makeSubjects(0)); + } + + function test_EvenIfAlreadyCursed_Success() public { + RMN.Config memory cfg = rmnConstructorArgs(); + uint16 weightSum = 0; + for (uint256 i = 0; i < cfg.voters.length; ++i) { + vm.startPrank(cfg.voters[i].curseVoteAddr); + s_rmn.voteToCurse(makeCurseId(i), makeSubjects(0)); + weightSum += cfg.voters[i].curseWeight; + } + + // Not part of the assertion of this test but good to have as a sanity + // check. We want a curse to be active in order for the ultimate assertion + // to make sense. + assert(s_rmn.isCursed(0)); + + vm.expectEmit(); + emit RMN.VotedToCurse( + 1, // configVersion + cfg.voters[cfg.voters.length - 1].curseVoteAddr, + 0, // subject + makeCurseId(cfg.voters.length + 1), // this curse id + cfg.voters[cfg.voters.length - 1].curseWeight, + uint64(block.timestamp), // blockTimestamp + makeCursesHash(makeCurseId(cfg.voters.length - 1), makeCurseId(cfg.voters.length + 1)), // cursesHash + weightSum // accumulatedWeight + ); + // Asserts that this call to vote with a new curse id goes through with no + // reverts even when the RMN contract is cursed. + s_rmn.voteToCurse(makeCurseId(cfg.voters.length + 1), makeSubjects(0)); + } + + function test_OwnerCanCurseAndUncurse() public { + vm.startPrank(OWNER); + bytes28 expectedCursesHash = makeCursesHash(makeCurseId(0)); + vm.expectEmit(); + emit RMN.VotedToCurse( + 1, // configVersion + OWNER_CURSE_VOTE_ADDR, // owner + 0, // subject + makeCurseId(0), // curse id + 0, // weight + uint64(block.timestamp), // blockTimestamp + expectedCursesHash, // cursesHash + 0 // accumulatedWeight + ); + vm.expectEmit(); + emit RMN.Cursed( + 1, // configVersion + 0, // subject + uint64(block.timestamp) // blockTimestamp + ); + s_rmn.ownerCurse(makeCurseId(0), makeSubjects(0)); + + { + (address[] memory voters, bytes28[] memory cursesHashes, uint24 accWeight, bool cursed) = + s_rmn.getCurseProgress(0); + assertEq(voters.length, 1); + assertEq(voters[0], OWNER_CURSE_VOTE_ADDR /* owner */ ); + assertEq(cursesHashes.length, 1); + assertEq(cursesHashes[0], expectedCursesHash); + assertEq(accWeight, 0); + assertTrue(cursed); + } + + // ownerCurse again, should cause a vote to appear and a change in curses hash + expectedCursesHash = makeCursesHash(makeCurseId(0), makeCurseId(1)); + vm.expectEmit(); + emit RMN.VotedToCurse( + 1, // configVersion + OWNER_CURSE_VOTE_ADDR, // owner + 0, // subject + makeCurseId(1), // curse id + 0, // weight + uint64(block.timestamp), // blockTimestamp + expectedCursesHash, // cursesHash + 0 // accumulatedWeight + ); + s_rmn.ownerCurse(makeCurseId(1), makeSubjects(0)); + + { + (address[] memory voters, bytes28[] memory cursesHashes, uint24 accWeight, bool cursed) = + s_rmn.getCurseProgress(0); + assertEq(voters.length, 1); + assertEq(voters[0], OWNER_CURSE_VOTE_ADDR /* owner */ ); + assertEq(cursesHashes.length, 1); + assertEq(cursesHashes[0], expectedCursesHash); + assertEq(accWeight, 0); + assertTrue(cursed); + } + + RMN.OwnerUnvoteToCurseRequest[] memory unvoteReqs = new RMN.OwnerUnvoteToCurseRequest[](1); + unvoteReqs[0] = RMN.OwnerUnvoteToCurseRequest({ + curseVoteAddr: OWNER_CURSE_VOTE_ADDR, + unit: RMN.UnvoteToCurseRequest({subject: 0, cursesHash: 0}), + forceUnvote: true // TODO: test with forceUnvote false also + }); + vm.expectEmit(); + emit RMN.CurseLifted(0); + s_rmn.ownerUnvoteToCurse(unvoteReqs); + { + (address[] memory voters, bytes28[] memory cursesHashes, uint24 accWeight, bool cursed) = + s_rmn.getCurseProgress(0); + assertEq(voters.length, 0); + assertEq(cursesHashes.length, 0); + assertEq(accWeight, 0); + assertFalse(cursed); + } + } + + // Reverts + + function test_UnauthorizedVoter_Revert() public { + vm.startPrank(STRANGER); + + vm.expectRevert(abi.encodeWithSelector(RMN.UnauthorizedVoter.selector, STRANGER)); + s_rmn.voteToCurse(makeCurseId(12312), makeSubjects(0)); + } + + function test_ReusedCurseId_Revert() public { + (address voter,) = _getFirstCurseVoterAndWeight(); + vm.startPrank(voter); + s_rmn.voteToCurse(makeCurseId(1), makeSubjects(0)); + + vm.expectRevert(abi.encodeWithSelector(RMN.ReusedCurseId.selector, voter, makeCurseId(1))); + s_rmn.voteToCurse(makeCurseId(1), makeSubjects(0)); + } + + function test_RepeatedSubject_Revert() public { + (address voter,) = _getFirstCurseVoterAndWeight(); + vm.prank(voter); + + bytes16 subject = bytes16(uint128(1)); + + vm.expectRevert(RMN.SubjectsMustBeStrictlyIncreasing.selector); + s_rmn.voteToCurse(makeCurseId(1), makeSubjects(subject, subject)); + } + + function test_EmptySubjects_Revert() public { + (address voter,) = _getFirstCurseVoterAndWeight(); + vm.prank(voter); + + vm.expectRevert(RMN.VoteToCurseNoop.selector); + s_rmn.voteToCurse(makeCurseId(1), new bytes16[](0)); + } +} + +contract RMN_ownerUnvoteToCurse is RMNSetup { + // These cursers are going to curse in setUp curseCount times. + function getCursersAndCurseCounts() internal pure returns (address[] memory cursers, uint32[] memory curseCounts) { + // NOTE: Change this when changing setUp or rmnConstructorArgs. + // This is a bit ugly and error prone but if we read from storage we would + // not get an accurate gas reading for ownerUnvoteToCurse when we need it. + cursers = new address[](4); + cursers[0] = CURSE_VOTER_1; + cursers[1] = CURSE_VOTER_2; + cursers[2] = CURSE_VOTER_3; + cursers[3] = CURSE_VOTER_4; + curseCounts = new uint32[](cursers.length); + for (uint256 i = 0; i < cursers.length; ++i) { + curseCounts[i] = 1; + } + } + + function setUp() public virtual override { + RMNSetup.setUp(); + (address[] memory cursers, uint32[] memory curseCounts) = getCursersAndCurseCounts(); + for (uint256 i = 0; i < cursers.length; ++i) { + vm.startPrank(cursers[i]); + for (uint256 j = 0; j < curseCounts[i]; ++j) { + s_rmn.voteToCurse(makeCurseId(j), makeSubjects(GLOBAL_CURSE_SUBJECT)); + } + } + } + + function ownerUnvoteToCurse() internal { + s_rmn.ownerUnvoteToCurse(makeOwnerUnvoteToCurseRequests()); + } + + function makeOwnerUnvoteToCurseRequests() internal pure returns (RMN.OwnerUnvoteToCurseRequest[] memory) { + (address[] memory cursers,) = getCursersAndCurseCounts(); + RMN.OwnerUnvoteToCurseRequest[] memory reqs = new RMN.OwnerUnvoteToCurseRequest[](cursers.length); + for (uint256 i = 0; i < cursers.length; ++i) { + reqs[i] = RMN.OwnerUnvoteToCurseRequest({ + curseVoteAddr: cursers[i], + unit: RMN.UnvoteToCurseRequest({subject: GLOBAL_CURSE_SUBJECT, cursesHash: bytes28(0)}), + forceUnvote: true + }); + } + return reqs; + } + + // Success + + function test_OwnerUnvoteToCurseSuccess_gas() public { + vm.pauseGasMetering(); + vm.startPrank(OWNER); + + vm.expectEmit(); + emit RMN.CurseLifted(GLOBAL_CURSE_SUBJECT); + + vm.resumeGasMetering(); + ownerUnvoteToCurse(); + vm.pauseGasMetering(); + + assertFalse(s_rmn.isCursed()); + (address[] memory voters, bytes28[] memory cursesHashes, uint256 weight, bool cursed) = + s_rmn.getCurseProgress(GLOBAL_CURSE_SUBJECT); + assertEq(voters.length, 0); + assertEq(cursesHashes.length, 0); + assertEq(weight, 0); + assertFalse(cursed); + vm.resumeGasMetering(); + } + + function test_IsIdempotent() public { + vm.startPrank(OWNER); + ownerUnvoteToCurse(); + vm.expectRevert(RMN.UnvoteToCurseNoop.selector); + ownerUnvoteToCurse(); + + assertFalse(s_rmn.isCursed()); + (address[] memory voters, bytes28[] memory cursesHashes, uint256 weight, bool cursed) = + s_rmn.getCurseProgress(GLOBAL_CURSE_SUBJECT); + assertEq(voters.length, 0); + assertEq(cursesHashes.length, 0); + assertEq(weight, 0); + assertFalse(cursed); + } + + function test_CanBlessAndCurseAfterGlobalCurseIsLifted() public { + // Contract is already cursed due to setUp. + + // Owner unvotes to curse. + vm.startPrank(OWNER); + vm.expectEmit(); + emit RMN.CurseLifted(GLOBAL_CURSE_SUBJECT); + ownerUnvoteToCurse(); + + // Contract is now uncursed. + assertFalse(s_rmn.isCursed()); + + // Vote to bless should go through. + vm.startPrank(BLESS_VOTER_1); + s_rmn.voteToBless(makeTaggedRootSingleton(2387489729)); + + // Vote to curse should go through. + vm.startPrank(CURSE_VOTER_1); + s_rmn.voteToCurse(makeCurseId(73894728973), makeSubjects(GLOBAL_CURSE_SUBJECT)); + } + + // Reverts + + function test_NonOwner_Revert() public { + vm.startPrank(STRANGER); + vm.expectRevert("Only callable by owner"); + ownerUnvoteToCurse(); + } + + function test_UnknownVoter_Revert() public { + vm.stopPrank(); + RMN.OwnerUnvoteToCurseRequest[] memory reqs = new RMN.OwnerUnvoteToCurseRequest[](1); + reqs[0] = RMN.OwnerUnvoteToCurseRequest({ + curseVoteAddr: STRANGER, + unit: RMN.UnvoteToCurseRequest({subject: GLOBAL_CURSE_SUBJECT, cursesHash: bytes28(0)}), + forceUnvote: true + }); + + vm.prank(OWNER); + vm.expectEmit(); + emit RMN.SkippedUnvoteToCurse(STRANGER, GLOBAL_CURSE_SUBJECT, bytes28(0), bytes28(0)); + vm.expectRevert(RMN.UnvoteToCurseNoop.selector); + s_rmn.ownerUnvoteToCurse(reqs); + + // no effect on cursedness + assertTrue(s_rmn.isCursed(GLOBAL_CURSE_SUBJECT)); + } +} + +contract RMN_setConfig is ConfigCompare, RMNSetup { + /// @notice Test-specific function to use only in setConfig tests + function getDifferentConfigArgs() private pure returns (RMN.Config memory) { + RMN.Voter[] memory voters = new RMN.Voter[](2); + voters[0] = RMN.Voter({ + blessVoteAddr: BLESS_VOTER_1, + curseVoteAddr: CURSE_VOTER_1, + blessWeight: WEIGHT_1, + curseWeight: WEIGHT_1 + }); + voters[1] = RMN.Voter({ + blessVoteAddr: BLESS_VOTER_2, + curseVoteAddr: CURSE_VOTER_2, + blessWeight: WEIGHT_10, + curseWeight: WEIGHT_10 + }); + return RMN.Config({ + voters: voters, + blessWeightThreshold: WEIGHT_1 + WEIGHT_10, + curseWeightThreshold: WEIGHT_1 + WEIGHT_10 + }); + } + + function setUp() public virtual override { + RMNSetup.setUp(); + RMN.Config memory cfg = rmnConstructorArgs(); + + // Setup some partial state + vm.startPrank(cfg.voters[0].blessVoteAddr); + s_rmn.voteToBless(makeTaggedRootSingleton(1)); + vm.startPrank(cfg.voters[1].blessVoteAddr); + s_rmn.voteToBless(makeTaggedRootSingleton(1)); + vm.startPrank(cfg.voters[1].curseVoteAddr); + s_rmn.voteToCurse(makeCurseId(1), makeSubjects(0)); + } + + // Success + + event ConfigSet(uint32 indexed configVersion, RMN.Config config); + + function test_VoteToBlessByEjectedVoter_Revert() public { + // Previous config included BLESS_VOTER_4. Change to new config that doesn't. + RMN.Config memory cfg = getDifferentConfigArgs(); + vm.startPrank(OWNER); + s_rmn.setConfig(cfg); + + // BLESS_VOTER_4 is not part of cfg anymore, vote to bless should revert. + vm.startPrank(BLESS_VOTER_4); + vm.expectRevert(abi.encodeWithSelector(RMN.UnauthorizedVoter.selector, BLESS_VOTER_4)); + s_rmn.voteToBless(makeTaggedRootSingleton(2)); + } + + function test_SetConfigSuccess_gas() public { + vm.pauseGasMetering(); + RMN.Config memory cfg = getDifferentConfigArgs(); + + vm.startPrank(OWNER); + vm.expectEmit(); + emit ConfigSet(2, cfg); + + (uint32 configVersionBefore,,) = s_rmn.getConfigDetails(); + vm.resumeGasMetering(); + s_rmn.setConfig(cfg); + vm.pauseGasMetering(); + // Assert VersionedConfig has changed correctly + (uint32 configVersionAfter,, RMN.Config memory configAfter) = s_rmn.getConfigDetails(); + assertEq(configVersionBefore + 1, configVersionAfter); + assertConfigEq(configAfter, cfg); + + // Assert that curse votes have been cleared + + (address[] memory curseVoters, bytes28[] memory cursesHashes, uint256 curseWeight, bool cursed) = + s_rmn.getCurseProgress(0); + assertEq(0, curseVoters.length); + assertEq(0, cursesHashes.length); + assertEq(0, curseWeight); + assertFalse(cursed); + + // Assert that good votes have been cleared + uint256 votesToBlessRoot = getWeightOfVotesToBlessRoot(makeTaggedRoot(1)); + assertEq(ZERO, votesToBlessRoot); + assertFalse(hasVotedToBlessRoot(cfg.voters[0].blessVoteAddr, makeTaggedRoot(1))); + assertFalse(hasVotedToBlessRoot(cfg.voters[1].blessVoteAddr, makeTaggedRoot(1))); + vm.resumeGasMetering(); + } + + // Reverts + + function test_NonOwner_Revert() public { + RMN.Config memory cfg = getDifferentConfigArgs(); + + vm.startPrank(STRANGER); + vm.expectRevert("Only callable by owner"); + s_rmn.setConfig(cfg); + } + + function test_VotersLengthIsZero_Revert() public { + vm.startPrank(OWNER); + vm.expectRevert(RMN.InvalidConfig.selector); + s_rmn.setConfig(RMN.Config({voters: new RMN.Voter[](0), blessWeightThreshold: 1, curseWeightThreshold: 1})); + } + + function test_EitherThresholdIsZero_Revert() public { + RMN.Config memory cfg = getDifferentConfigArgs(); + + vm.startPrank(OWNER); + vm.expectRevert(RMN.InvalidConfig.selector); + s_rmn.setConfig( + RMN.Config({voters: cfg.voters, blessWeightThreshold: ZERO, curseWeightThreshold: cfg.curseWeightThreshold}) + ); + vm.expectRevert(RMN.InvalidConfig.selector); + s_rmn.setConfig( + RMN.Config({voters: cfg.voters, blessWeightThreshold: cfg.blessWeightThreshold, curseWeightThreshold: ZERO}) + ); + } + + function test_BlessVoterIsZeroAddress_Revert() public { + RMN.Config memory cfg = getDifferentConfigArgs(); + + vm.startPrank(OWNER); + cfg.voters[0].blessVoteAddr = ZERO_ADDRESS; + vm.expectRevert(RMN.InvalidConfig.selector); + s_rmn.setConfig(cfg); + } + + function test_WeightIsZeroAddress_Revert() public { + RMN.Config memory cfg = getDifferentConfigArgs(); + + vm.startPrank(OWNER); + cfg.voters[0].blessWeight = ZERO; + cfg.voters[0].curseWeight = ZERO; + vm.expectRevert(RMN.InvalidConfig.selector); + s_rmn.setConfig(cfg); + } + + function test_TotalWeightsSmallerThanEachThreshold_Revert() public { + RMN.Config memory cfg = getDifferentConfigArgs(); + + vm.startPrank(OWNER); + vm.expectRevert(RMN.InvalidConfig.selector); + s_rmn.setConfig( + RMN.Config({voters: cfg.voters, blessWeightThreshold: WEIGHT_40, curseWeightThreshold: cfg.curseWeightThreshold}) + ); + vm.expectRevert(RMN.InvalidConfig.selector); + s_rmn.setConfig( + RMN.Config({voters: cfg.voters, blessWeightThreshold: cfg.blessWeightThreshold, curseWeightThreshold: WEIGHT_40}) + ); + } + + function test_RepeatedAddress_Revert() public { + RMN.Config memory cfg = getDifferentConfigArgs(); + + vm.startPrank(OWNER); + cfg.voters[0].blessVoteAddr = cfg.voters[1].curseVoteAddr; + vm.expectRevert(RMN.InvalidConfig.selector); + s_rmn.setConfig(cfg); + } +} + +contract RMN_permaBlessing is RMNSetup { + function addresses() private pure returns (address[] memory) { + return new address[](0); + } + + function addresses(address a) private pure returns (address[] memory) { + address[] memory arr = new address[](1); + arr[0] = a; + return arr; + } + + function addresses(address a, address b) private pure returns (address[] memory) { + address[] memory arr = new address[](2); + arr[0] = a; + arr[1] = b; + return arr; + } + + function test_PermaBlessing() public { + bytes32 SOME_ROOT = bytes32(~uint256(0)); + address COMMIT_STORE_1 = makeAddr("COMMIT_STORE_1"); + address COMMIT_STORE_2 = makeAddr("COMMIT_STORE_2"); + IRMN.TaggedRoot memory taggedRootCommitStore1 = IRMN.TaggedRoot({root: SOME_ROOT, commitStore: COMMIT_STORE_1}); + IRMN.TaggedRoot memory taggedRootCommitStore2 = IRMN.TaggedRoot({root: SOME_ROOT, commitStore: COMMIT_STORE_2}); + + assertFalse(s_rmn.isBlessed(taggedRootCommitStore1)); + assertFalse(s_rmn.isBlessed(taggedRootCommitStore2)); + assertEq(s_rmn.getPermaBlessedCommitStores(), addresses()); + + // only owner can mutate permaBlessedCommitStores + vm.prank(STRANGER); + vm.expectRevert("Only callable by owner"); + s_rmn.ownerRemoveThenAddPermaBlessedCommitStores(addresses(), addresses(COMMIT_STORE_1)); + + vm.prank(OWNER); + s_rmn.ownerRemoveThenAddPermaBlessedCommitStores(addresses(), addresses(COMMIT_STORE_1)); + assertTrue(s_rmn.isBlessed(taggedRootCommitStore1)); + assertFalse(s_rmn.isBlessed(taggedRootCommitStore2)); + assertEq(s_rmn.getPermaBlessedCommitStores(), addresses(COMMIT_STORE_1)); + + vm.prank(OWNER); + s_rmn.ownerRemoveThenAddPermaBlessedCommitStores(addresses(COMMIT_STORE_1), addresses(COMMIT_STORE_2)); + assertFalse(s_rmn.isBlessed(taggedRootCommitStore1)); + assertTrue(s_rmn.isBlessed(taggedRootCommitStore2)); + assertEq(s_rmn.getPermaBlessedCommitStores(), addresses(COMMIT_STORE_2)); + + vm.prank(OWNER); + s_rmn.ownerRemoveThenAddPermaBlessedCommitStores(addresses(), addresses(COMMIT_STORE_1)); + assertTrue(s_rmn.isBlessed(taggedRootCommitStore1)); + assertTrue(s_rmn.isBlessed(taggedRootCommitStore2)); + assertEq(s_rmn.getPermaBlessedCommitStores(), addresses(COMMIT_STORE_2, COMMIT_STORE_1)); + + vm.prank(OWNER); + s_rmn.ownerRemoveThenAddPermaBlessedCommitStores(addresses(COMMIT_STORE_1, COMMIT_STORE_2), addresses()); + assertFalse(s_rmn.isBlessed(taggedRootCommitStore1)); + assertFalse(s_rmn.isBlessed(taggedRootCommitStore2)); + assertEq(s_rmn.getPermaBlessedCommitStores(), addresses()); + } +} + +contract RMN_getRecordedCurseRelatedOps is RMNSetup { + function test_OpsPostDeployment() public view { + // The constructor call includes a setConfig, so that's the only thing we should expect to find. + assertEq(s_rmn.getRecordedCurseRelatedOpsCount(), 1); + RMN.RecordedCurseRelatedOp[] memory recordedCurseRelatedOps = s_rmn.getRecordedCurseRelatedOps(0, type(uint256).max); + assertEq(recordedCurseRelatedOps.length, 1); + assertEq(uint8(recordedCurseRelatedOps[0].tag), uint8(RMN.RecordedCurseRelatedOpTag.SetConfig)); + } +} diff --git a/contracts/src/v0.8/ccip/test/arm/RMNSetup.t.sol b/contracts/src/v0.8/ccip/test/arm/RMNSetup.t.sol new file mode 100644 index 00000000000..8feacb95f45 --- /dev/null +++ b/contracts/src/v0.8/ccip/test/arm/RMNSetup.t.sol @@ -0,0 +1,144 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {RMN} from "../../RMN.sol"; +import {IRMN} from "../../interfaces/IRMN.sol"; + +import {Test} from "forge-std/Test.sol"; + +function makeSubjects(bytes16 a) pure returns (bytes16[] memory) { + bytes16[] memory subjects = new bytes16[](1); + subjects[0] = a; + return subjects; +} + +function makeSubjects(bytes16 a, bytes16 b) pure returns (bytes16[] memory) { + bytes16[] memory subjects = new bytes16[](2); + subjects[0] = a; + subjects[1] = b; + return subjects; +} + +// in order from earliest to latest curse ids +function makeCursesHashFromList(bytes32[] memory curseIds) pure returns (bytes28 cursesHash) { + for (uint256 i = 0; i < curseIds.length; ++i) { + cursesHash = bytes28(keccak256(abi.encode(cursesHash, curseIds[i]))); + } +} + +// hides the ugliness from tests +function makeCursesHash(bytes32 a) pure returns (bytes28) { + bytes32[] memory curseIds = new bytes32[](1); + curseIds[0] = a; + return makeCursesHashFromList(curseIds); +} + +function makeCursesHash(bytes32 a, bytes32 b) pure returns (bytes28) { + bytes32[] memory curseIds = new bytes32[](2); + curseIds[0] = a; + curseIds[1] = b; + return makeCursesHashFromList(curseIds); +} + +contract RMNSetup is Test { + // Addresses + address internal constant OWNER = 0x00007e64E1fB0C487F25dd6D3601ff6aF8d32e4e; + address internal constant STRANGER = address(999999); + address internal constant ZERO_ADDRESS = address(0); + address internal constant BLESS_VOTER_1 = address(1); + address internal constant CURSE_VOTER_1 = address(10); + address internal constant BLESS_VOTER_2 = address(2); + address internal constant CURSE_VOTER_2 = address(12); + address internal constant BLESS_VOTER_3 = address(3); + address internal constant CURSE_VOTER_3 = address(13); + address internal constant BLESS_VOTER_4 = address(4); + address internal constant CURSE_VOTER_4 = address(14); + + // Arm + function rmnConstructorArgs() internal pure returns (RMN.Config memory) { + RMN.Voter[] memory voters = new RMN.Voter[](4); + voters[0] = RMN.Voter({ + blessVoteAddr: BLESS_VOTER_1, + curseVoteAddr: CURSE_VOTER_1, + blessWeight: WEIGHT_1, + curseWeight: WEIGHT_1 + }); + voters[1] = RMN.Voter({ + blessVoteAddr: BLESS_VOTER_2, + curseVoteAddr: CURSE_VOTER_2, + blessWeight: WEIGHT_10, + curseWeight: WEIGHT_10 + }); + voters[2] = RMN.Voter({ + blessVoteAddr: BLESS_VOTER_3, + curseVoteAddr: CURSE_VOTER_3, + blessWeight: WEIGHT_20, + curseWeight: WEIGHT_20 + }); + voters[3] = RMN.Voter({ + blessVoteAddr: BLESS_VOTER_4, + curseVoteAddr: CURSE_VOTER_4, + blessWeight: WEIGHT_40, + curseWeight: WEIGHT_40 + }); + return RMN.Config({ + voters: voters, + blessWeightThreshold: WEIGHT_10 + WEIGHT_20 + WEIGHT_40, + curseWeightThreshold: WEIGHT_1 + WEIGHT_10 + WEIGHT_20 + WEIGHT_40 + }); + } + + uint8 internal constant ZERO = 0; + uint8 internal constant WEIGHT_1 = 1; + uint8 internal constant WEIGHT_10 = 10; + uint8 internal constant WEIGHT_20 = 20; + uint8 internal constant WEIGHT_40 = 40; + + function makeTaggedRootsInclusive(uint256 from, uint256 to) internal pure returns (IRMN.TaggedRoot[] memory) { + IRMN.TaggedRoot[] memory votes = new IRMN.TaggedRoot[](to - from + 1); + for (uint256 i = from; i <= to; ++i) { + votes[i - from] = IRMN.TaggedRoot({commitStore: address(1), root: bytes32(uint256(i))}); + } + return votes; + } + + function makeTaggedRootSingleton(uint256 index) internal pure returns (IRMN.TaggedRoot[] memory) { + return makeTaggedRootsInclusive(index, index); + } + + function makeTaggedRoot(uint256 index) internal pure returns (IRMN.TaggedRoot memory) { + return makeTaggedRootSingleton(index)[0]; + } + + function makeTaggedRootHash(uint256 index) internal pure returns (bytes32) { + IRMN.TaggedRoot memory taggedRoot = makeTaggedRootSingleton(index)[0]; + return keccak256(abi.encode(taggedRoot.commitStore, taggedRoot.root)); + } + + function makeCurseId(uint256 index) internal pure returns (bytes16) { + return bytes16(uint128(index)); + } + + RMN internal s_rmn; + + function setUp() public virtual { + vm.startPrank(OWNER); + s_rmn = new RMN(rmnConstructorArgs()); + vm.stopPrank(); + } + + function hasVotedToBlessRoot(address voter, IRMN.TaggedRoot memory taggedRoot_) internal view returns (bool) { + (address[] memory voters,,) = s_rmn.getBlessProgress(taggedRoot_); + for (uint256 i = 0; i < voters.length; ++i) { + if (voters[i] == voter) { + return true; + } + } + return false; + } + + function getWeightOfVotesToBlessRoot(IRMN.TaggedRoot memory taggedRoot_) internal view returns (uint16) { + (, uint16 weight,) = s_rmn.getBlessProgress(taggedRoot_); + return weight; + } +} diff --git a/contracts/src/v0.8/ccip/test/arm/RMN_benchmark.t.sol b/contracts/src/v0.8/ccip/test/arm/RMN_benchmark.t.sol new file mode 100644 index 00000000000..8564614a748 --- /dev/null +++ b/contracts/src/v0.8/ccip/test/arm/RMN_benchmark.t.sol @@ -0,0 +1,217 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {GLOBAL_CURSE_SUBJECT, OWNER_CURSE_VOTE_ADDR, RMN} from "../../RMN.sol"; +import {RMNSetup, makeCursesHash, makeSubjects} from "./RMNSetup.t.sol"; + +contract RMN_voteToBless_Benchmark is RMNSetup { + function test_RootSuccess_gas(uint256 n) internal { + vm.prank(BLESS_VOTER_1); + s_rmn.voteToBless(makeTaggedRootsInclusive(1, n)); + } + + function test_1RootSuccess_gas() public { + test_RootSuccess_gas(1); + } + + function test_3RootSuccess_gas() public { + test_RootSuccess_gas(3); + } + + function test_5RootSuccess_gas() public { + test_RootSuccess_gas(5); + } +} + +contract RMN_voteToBless_Blessed_Benchmark is RMN_voteToBless_Benchmark { + function setUp() public virtual override { + RMNSetup.setUp(); + vm.prank(BLESS_VOTER_2); + s_rmn.voteToBless(makeTaggedRootsInclusive(1, 1)); + vm.prank(BLESS_VOTER_3); + s_rmn.voteToBless(makeTaggedRootsInclusive(1, 1)); + } + + function test_1RootSuccessBecameBlessed_gas() public { + vm.prank(BLESS_VOTER_4); + s_rmn.voteToBless(makeTaggedRootsInclusive(1, 1)); + } +} + +abstract contract RMN_voteToCurse_Benchmark is RMNSetup { + struct PreVote { + address voter; + bytes16 subject; + } + + PreVote[] internal s_preVotes; + + function setUp() public virtual override { + // Intentionally does not inherit RMNSetup setUp(), because we set up a simpler config here. + // The only way to ensure that storage slots are cold for the actual functions to be benchmarked is to perform the + // setup in setUp(). + + RMN.Config memory cfg = RMN.Config({voters: new RMN.Voter[](3), blessWeightThreshold: 3, curseWeightThreshold: 3}); + cfg.voters[0] = + RMN.Voter({blessVoteAddr: BLESS_VOTER_1, curseVoteAddr: CURSE_VOTER_1, blessWeight: 1, curseWeight: 1}); + cfg.voters[1] = + RMN.Voter({blessVoteAddr: BLESS_VOTER_2, curseVoteAddr: CURSE_VOTER_2, blessWeight: 1, curseWeight: 1}); + cfg.voters[2] = + RMN.Voter({blessVoteAddr: BLESS_VOTER_3, curseVoteAddr: CURSE_VOTER_3, blessWeight: 1, curseWeight: 1}); + vm.prank(OWNER); + s_rmn = new RMN(cfg); + + for (uint256 i = 0; i < s_preVotes.length; ++i) { + vm.prank(s_preVotes[i].voter); + s_rmn.voteToCurse(makeCurseId(i), makeSubjects(s_preVotes[i].subject)); + } + } +} + +contract RMN_voteToCurse_Benchmark_1 is RMN_voteToCurse_Benchmark { + constructor() { + // some irrelevant subject & voter so that we don't pay for the nonzero->zero SSTORE of + // s_recordedVotesToCurse.length in the benchmark below + s_preVotes.push(PreVote({voter: CURSE_VOTER_3, subject: bytes16(~uint128(0))})); + } + + function test_VoteToCurse_NewSubject_NewVoter_NoCurse_gas() public { + vm.prank(CURSE_VOTER_1); + s_rmn.voteToCurse(makeCurseId(0xffff), makeSubjects(GLOBAL_CURSE_SUBJECT)); + } + + function test_VoteToCurse_NewSubject_NewVoter_YesCurse_gas() public { + vm.prank(OWNER); + s_rmn.ownerCurse(makeCurseId(0xffff), makeSubjects(GLOBAL_CURSE_SUBJECT)); + } +} + +contract RMN_voteToCurse_Benchmark_2 is RMN_voteToCurse_Benchmark { + constructor() { + s_preVotes.push(PreVote({voter: CURSE_VOTER_1, subject: GLOBAL_CURSE_SUBJECT})); + } + + function test_VoteToCurse_OldSubject_OldVoter_NoCurse_gas() public { + vm.prank(CURSE_VOTER_1); + s_rmn.voteToCurse(makeCurseId(0xffff), makeSubjects(GLOBAL_CURSE_SUBJECT)); + } + + function test_VoteToCurse_OldSubject_NewVoter_NoCurse_gas() public { + vm.prank(CURSE_VOTER_2); + s_rmn.voteToCurse(makeCurseId(0xffff), makeSubjects(GLOBAL_CURSE_SUBJECT)); + } +} + +contract RMN_voteToCurse_Benchmark_3 is RMN_voteToCurse_Benchmark { + constructor() { + s_preVotes.push(PreVote({voter: CURSE_VOTER_1, subject: GLOBAL_CURSE_SUBJECT})); + s_preVotes.push(PreVote({voter: CURSE_VOTER_2, subject: GLOBAL_CURSE_SUBJECT})); + } + + function test_VoteToCurse_OldSubject_NewVoter_YesCurse_gas() public { + vm.prank(CURSE_VOTER_3); + s_rmn.voteToCurse(makeCurseId(0xffff), makeSubjects(GLOBAL_CURSE_SUBJECT)); + } +} + +contract RMN_lazyVoteToCurseUpdate_Benchmark is RMN_voteToCurse_Benchmark { + constructor() { + s_preVotes.push(PreVote({voter: CURSE_VOTER_1, subject: GLOBAL_CURSE_SUBJECT})); + s_preVotes.push(PreVote({voter: CURSE_VOTER_2, subject: GLOBAL_CURSE_SUBJECT})); + s_preVotes.push(PreVote({voter: CURSE_VOTER_3, subject: GLOBAL_CURSE_SUBJECT})); + } + + function setUp() public override { + RMN_voteToCurse_Benchmark.setUp(); // sends the prevotes + // initial config includes voters CURSE_VOTER_1, CURSE_VOTER_2, CURSE_VOTER_3 + // include a new voter in the config + { + (,, RMN.Config memory cfg) = s_rmn.getConfigDetails(); + RMN.Voter[] memory newVoters = new RMN.Voter[](cfg.voters.length + 1); + for (uint256 i = 0; i < cfg.voters.length; ++i) { + newVoters[i] = cfg.voters[i]; + } + newVoters[newVoters.length - 1] = + RMN.Voter({blessVoteAddr: BLESS_VOTER_4, curseVoteAddr: CURSE_VOTER_4, blessWeight: 1, curseWeight: 1}); + cfg.voters = newVoters; + + vm.prank(OWNER); + s_rmn.setConfig(cfg); + } + } + + function test_VoteToCurseLazilyRetain3VotersUponConfigChange_gas() public { + // send a vote as the new voter, should cause a lazy update and votes from CURSE_VOTER_1, CURSE_VOTER_2, + // CURSE_VOTER_3 to be retained, which is the worst case for the prior config + vm.prank(CURSE_VOTER_4); + s_rmn.voteToCurse(makeCurseId(0xffff), makeSubjects(GLOBAL_CURSE_SUBJECT)); + } +} + +contract RMN_setConfig_Benchmark is RMNSetup { + uint256 s_numVoters; + + function configWithVoters(uint256 numVoters) internal pure returns (RMN.Config memory) { + RMN.Config memory cfg = + RMN.Config({voters: new RMN.Voter[](numVoters), blessWeightThreshold: 1, curseWeightThreshold: 1}); + for (uint256 i = 1; i <= numVoters; ++i) { + cfg.voters[i - 1] = RMN.Voter({ + blessVoteAddr: address(uint160(2 * i)), + curseVoteAddr: address(uint160(2 * i + 1)), + blessWeight: 1, + curseWeight: 1 + }); + } + return cfg; + } + + function setUp() public virtual override { + vm.prank(OWNER); + s_rmn = new RMN(configWithVoters(s_numVoters)); + } +} + +contract RMN_setConfig_Benchmark_1 is RMN_setConfig_Benchmark { + constructor() { + s_numVoters = 1; + } + + function test_SetConfig_7Voters_gas() public { + vm.prank(OWNER); + s_rmn.setConfig(configWithVoters(7)); + } +} + +contract RMN_setConfig_Benchmark_2 is RMN_setConfig_Benchmark { + constructor() { + s_numVoters = 7; + } + + function test_ResetConfig_7Voters_gas() public { + vm.prank(OWNER); + s_rmn.setConfig(configWithVoters(7)); + } +} + +contract RMN_ownerUnvoteToCurse_Benchmark is RMN_setConfig_Benchmark { + constructor() { + s_numVoters = 7; + } + + function setUp() public override { + RMN_setConfig_Benchmark.setUp(); + vm.prank(OWNER); + s_rmn.ownerCurse(makeCurseId(0xffff), makeSubjects(GLOBAL_CURSE_SUBJECT)); + } + + function test_OwnerUnvoteToCurse_1Voter_LiftsCurse_gas() public { + RMN.OwnerUnvoteToCurseRequest[] memory reqs = new RMN.OwnerUnvoteToCurseRequest[](1); + reqs[0] = RMN.OwnerUnvoteToCurseRequest({ + curseVoteAddr: OWNER_CURSE_VOTE_ADDR, + unit: RMN.UnvoteToCurseRequest({cursesHash: makeCursesHash(makeCurseId(0xffff)), subject: GLOBAL_CURSE_SUBJECT}), + forceUnvote: false + }); + vm.prank(OWNER); + s_rmn.ownerUnvoteToCurse(reqs); + } +} diff --git a/contracts/src/v0.8/ccip/test/attacks/onRamp/FacadeClient.sol b/contracts/src/v0.8/ccip/test/attacks/onRamp/FacadeClient.sol new file mode 100644 index 00000000000..ad549e6ccc2 --- /dev/null +++ b/contracts/src/v0.8/ccip/test/attacks/onRamp/FacadeClient.sol @@ -0,0 +1,54 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {IRouterClient} from "../../../interfaces/IRouterClient.sol"; + +import {Client} from "../../../libraries/Client.sol"; + +import {IERC20} from "../../../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/IERC20.sol"; + +/// @title FacadeClient - A simple proxy for calling Router +contract FacadeClient { + address private immutable i_router; + uint64 private immutable i_destChainSelector; + IERC20 private immutable i_sourceToken; + IERC20 private immutable i_feeToken; + address private immutable i_receiver; + + uint256 private s_msg_sequence = 1; + + constructor(address router, uint64 destChainSelector, IERC20 sourceToken, IERC20 feeToken, address receiver) { + i_router = router; + i_destChainSelector = destChainSelector; + i_sourceToken = sourceToken; + i_feeToken = feeToken; + i_receiver = receiver; + + sourceToken.approve(address(router), 2 ** 256 - 1); + feeToken.approve(address(router), 2 ** 256 - 1); + } + + /// @dev Calls Router to initiate CCIP send. + /// The expectation is that s_msg_sequence will always match the sequence in emitted CCIP messages. + function send(uint256 amount) public { + Client.EVMTokenAmount[] memory tokenAmounts = new Client.EVMTokenAmount[](1); + tokenAmounts[0].token = address(i_sourceToken); + tokenAmounts[0].amount = amount; + + Client.EVM2AnyMessage memory message = Client.EVM2AnyMessage({ + receiver: abi.encode(i_receiver), + data: abi.encodePacked(s_msg_sequence), + tokenAmounts: tokenAmounts, + extraArgs: "", + feeToken: address(i_feeToken) + }); + + s_msg_sequence++; + + IRouterClient(i_router).ccipSend(i_destChainSelector, message); + } + + function getSequence() public view returns (uint256) { + return s_msg_sequence; + } +} diff --git a/contracts/src/v0.8/ccip/test/attacks/onRamp/MultiOnRampTokenPoolReentrancy.t.sol b/contracts/src/v0.8/ccip/test/attacks/onRamp/MultiOnRampTokenPoolReentrancy.t.sol new file mode 100644 index 00000000000..5161aba8837 --- /dev/null +++ b/contracts/src/v0.8/ccip/test/attacks/onRamp/MultiOnRampTokenPoolReentrancy.t.sol @@ -0,0 +1,116 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {Client} from "../../../libraries/Client.sol"; +import {Internal} from "../../../libraries/Internal.sol"; +import {OnRamp} from "../../../onRamp/OnRamp.sol"; +import {TokenPool} from "../../../pools/TokenPool.sol"; +import {OnRampSetup} from "../../onRamp/OnRampSetup.t.sol"; +import {FacadeClient} from "./FacadeClient.sol"; +import {ReentrantMaliciousTokenPool} from "./ReentrantMaliciousTokenPool.sol"; + +import {IERC20} from "../../../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/IERC20.sol"; + +/// @title MultiOnRampTokenPoolReentrancy +/// Attempts to perform a reentrancy exploit on Onramp with a malicious TokenPool +contract MultiOnRampTokenPoolReentrancy is OnRampSetup { + FacadeClient internal s_facadeClient; + ReentrantMaliciousTokenPool internal s_maliciousTokenPool; + IERC20 internal s_sourceToken; + IERC20 internal s_feeToken; + address internal immutable i_receiver = makeAddr("receiver"); + + function setUp() public virtual override { + OnRampSetup.setUp(); + + s_sourceToken = IERC20(s_sourceTokens[0]); + s_feeToken = IERC20(s_sourceTokens[0]); + + s_facadeClient = + new FacadeClient(address(s_sourceRouter), DEST_CHAIN_SELECTOR, s_sourceToken, s_feeToken, i_receiver); + + s_maliciousTokenPool = new ReentrantMaliciousTokenPool( + address(s_facadeClient), s_sourceToken, address(s_mockRMN), address(s_sourceRouter) + ); + + TokenPool.ChainUpdate[] memory chainUpdates = new TokenPool.ChainUpdate[](1); + chainUpdates[0] = TokenPool.ChainUpdate({ + remoteChainSelector: DEST_CHAIN_SELECTOR, + remotePoolAddress: abi.encode(s_destPoolBySourceToken[s_sourceTokens[0]]), + remoteTokenAddress: abi.encode(s_destTokens[0]), + allowed: true, + outboundRateLimiterConfig: _getOutboundRateLimiterConfig(), + inboundRateLimiterConfig: _getInboundRateLimiterConfig() + }); + s_maliciousTokenPool.applyChainUpdates(chainUpdates); + s_sourcePoolByToken[address(s_sourceToken)] = address(s_maliciousTokenPool); + + Internal.PoolUpdate[] memory removes = new Internal.PoolUpdate[](1); + removes[0].token = address(s_sourceToken); + removes[0].pool = address(s_sourcePoolByToken[address(s_sourceToken)]); + Internal.PoolUpdate[] memory adds = new Internal.PoolUpdate[](1); + adds[0].token = address(s_sourceToken); + adds[0].pool = address(s_maliciousTokenPool); + + s_tokenAdminRegistry.setPool(address(s_sourceToken), address(s_maliciousTokenPool)); + + s_sourceToken.transfer(address(s_facadeClient), 1e18); + s_feeToken.transfer(address(s_facadeClient), 1e18); + } + + /// @dev This test was used to showcase a reentrancy exploit on OnRamp with malicious TokenPool. + /// How it worked: OnRamp used to construct EVM2Any messages after calling TokenPool's lockOrBurn. + /// This allowed the malicious TokenPool to break message sequencing expectations as follows: + /// Any user -> Facade -> 1st call to ccipSend -> pool’s lockOrBurn —> + /// (reenter)-> Facade -> 2nd call to ccipSend + /// In this case, Facade's second call would produce an EVM2Any msg with a lower sequence number. + /// The issue was fixed by moving state updates and event construction to before TokenPool calls. + /// This test is kept to verify message sequence expectations are not broken. + function test_OnRampTokenPoolReentrancy_Success() public { + uint256 amount = 1; + + Client.EVMTokenAmount[] memory tokenAmounts = new Client.EVMTokenAmount[](1); + tokenAmounts[0].token = address(s_sourceToken); + tokenAmounts[0].amount = amount; + + Client.EVM2AnyMessage memory message1 = Client.EVM2AnyMessage({ + receiver: abi.encode(i_receiver), + data: abi.encodePacked(uint256(1)), // message 1 contains data 1 + tokenAmounts: tokenAmounts, + extraArgs: Client._argsToBytes(Client.EVMExtraArgsV1({gasLimit: 200_000})), + feeToken: address(s_feeToken) + }); + + Client.EVM2AnyMessage memory message2 = Client.EVM2AnyMessage({ + receiver: abi.encode(i_receiver), + data: abi.encodePacked(uint256(2)), // message 2 contains data 2 + tokenAmounts: tokenAmounts, + extraArgs: Client._argsToBytes(Client.EVMExtraArgsV1({gasLimit: 200_000})), + feeToken: address(s_feeToken) + }); + + uint256 expectedFee = s_sourceRouter.getFee(DEST_CHAIN_SELECTOR, message1); + assertGt(expectedFee, 0); + + // Outcome of a successful exploit: + // Message 1 event from OnRamp contains sequence/nonce 2, message 2 contains sequence/nonce 1 + // Internal.EVM2EVMMessage memory msgEvent1 = _messageToEvent(message1, 2, 2, expectedFee, address(s_facadeClient)); + // Internal.EVM2EVMMessage memory msgEvent2 = _messageToEvent(message2, 1, 1, expectedFee, address(s_facadeClient)); + + // vm.expectEmit(); + // emit CCIPSendRequested(msgEvent2); + // vm.expectEmit(); + // emit CCIPSendRequested(msgEvent1); + + // After issue is fixed, sequence now increments as expected + Internal.EVM2AnyRampMessage memory msgEvent1 = _messageToEvent(message1, 1, 1, expectedFee, address(s_facadeClient)); + Internal.EVM2AnyRampMessage memory msgEvent2 = _messageToEvent(message2, 2, 2, expectedFee, address(s_facadeClient)); + + vm.expectEmit(); + emit OnRamp.CCIPMessageSent(DEST_CHAIN_SELECTOR, msgEvent2); + vm.expectEmit(); + emit OnRamp.CCIPMessageSent(DEST_CHAIN_SELECTOR, msgEvent1); + + s_facadeClient.send(amount); + } +} diff --git a/contracts/src/v0.8/ccip/test/attacks/onRamp/OnRampTokenPoolReentrancy.t.sol b/contracts/src/v0.8/ccip/test/attacks/onRamp/OnRampTokenPoolReentrancy.t.sol new file mode 100644 index 00000000000..03db40a2931 --- /dev/null +++ b/contracts/src/v0.8/ccip/test/attacks/onRamp/OnRampTokenPoolReentrancy.t.sol @@ -0,0 +1,116 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {Client} from "../../../libraries/Client.sol"; +import {Internal} from "../../../libraries/Internal.sol"; +import {EVM2EVMOnRamp} from "../../../onRamp/EVM2EVMOnRamp.sol"; +import {TokenPool} from "../../../pools/TokenPool.sol"; +import {EVM2EVMOnRampSetup} from "../../onRamp/EVM2EVMOnRampSetup.t.sol"; +import {FacadeClient} from "./FacadeClient.sol"; +import {ReentrantMaliciousTokenPool} from "./ReentrantMaliciousTokenPool.sol"; + +import {IERC20} from "../../../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/IERC20.sol"; + +/// @title OnRampTokenPoolReentrancy +/// Attempts to perform a reentrancy exploit on Onramp with a malicious TokenPool +contract OnRampTokenPoolReentrancy is EVM2EVMOnRampSetup { + FacadeClient internal s_facadeClient; + ReentrantMaliciousTokenPool internal s_maliciousTokenPool; + IERC20 internal s_sourceToken; + IERC20 internal s_feeToken; + address internal immutable i_receiver = makeAddr("receiver"); + + function setUp() public virtual override { + EVM2EVMOnRampSetup.setUp(); + + s_sourceToken = IERC20(s_sourceTokens[0]); + s_feeToken = IERC20(s_sourceTokens[0]); + + s_facadeClient = + new FacadeClient(address(s_sourceRouter), DEST_CHAIN_SELECTOR, s_sourceToken, s_feeToken, i_receiver); + + s_maliciousTokenPool = new ReentrantMaliciousTokenPool( + address(s_facadeClient), s_sourceToken, address(s_mockRMN), address(s_sourceRouter) + ); + + TokenPool.ChainUpdate[] memory chainUpdates = new TokenPool.ChainUpdate[](1); + chainUpdates[0] = TokenPool.ChainUpdate({ + remoteChainSelector: DEST_CHAIN_SELECTOR, + remotePoolAddress: abi.encode(s_destPoolBySourceToken[s_sourceTokens[0]]), + remoteTokenAddress: abi.encode(s_destTokens[0]), + allowed: true, + outboundRateLimiterConfig: _getOutboundRateLimiterConfig(), + inboundRateLimiterConfig: _getInboundRateLimiterConfig() + }); + s_maliciousTokenPool.applyChainUpdates(chainUpdates); + s_sourcePoolByToken[address(s_sourceToken)] = address(s_maliciousTokenPool); + + Internal.PoolUpdate[] memory removes = new Internal.PoolUpdate[](1); + removes[0].token = address(s_sourceToken); + removes[0].pool = address(s_sourcePoolByToken[address(s_sourceToken)]); + Internal.PoolUpdate[] memory adds = new Internal.PoolUpdate[](1); + adds[0].token = address(s_sourceToken); + adds[0].pool = address(s_maliciousTokenPool); + + s_tokenAdminRegistry.setPool(address(s_sourceToken), address(s_maliciousTokenPool)); + + s_sourceToken.transfer(address(s_facadeClient), 1e18); + s_feeToken.transfer(address(s_facadeClient), 1e18); + } + + /// @dev This test was used to showcase a reentrancy exploit on OnRamp with malicious TokenPool. + /// How it worked: OnRamp used to construct EVM2EVM messages after calling TokenPool's lockOrBurn. + /// This allowed the malicious TokenPool to break message sequencing expectations as follows: + /// Any user -> Facade -> 1st call to ccipSend -> pool’s lockOrBurn —> + /// (reenter)-> Facade -> 2nd call to ccipSend + /// In this case, Facade's second call would produce an EVM2EVM msg with a lower sequence number. + /// The issue was fixed by moving state updates and event construction to before TokenPool calls. + /// This test is kept to verify message sequence expectations are not broken. + function test_OnRampTokenPoolReentrancy_Success() public { + uint256 amount = 1; + + Client.EVMTokenAmount[] memory tokenAmounts = new Client.EVMTokenAmount[](1); + tokenAmounts[0].token = address(s_sourceToken); + tokenAmounts[0].amount = amount; + + Client.EVM2AnyMessage memory message1 = Client.EVM2AnyMessage({ + receiver: abi.encode(i_receiver), + data: abi.encodePacked(uint256(1)), // message 1 contains data 1 + tokenAmounts: tokenAmounts, + extraArgs: Client._argsToBytes(Client.EVMExtraArgsV1({gasLimit: 200_000})), + feeToken: address(s_feeToken) + }); + + Client.EVM2AnyMessage memory message2 = Client.EVM2AnyMessage({ + receiver: abi.encode(i_receiver), + data: abi.encodePacked(uint256(2)), // message 2 contains data 2 + tokenAmounts: tokenAmounts, + extraArgs: Client._argsToBytes(Client.EVMExtraArgsV1({gasLimit: 200_000})), + feeToken: address(s_feeToken) + }); + + uint256 expectedFee = s_sourceRouter.getFee(DEST_CHAIN_SELECTOR, message1); + assertGt(expectedFee, 0); + + // Outcome of a successful exploit: + // Message 1 event from OnRamp contains sequence/nonce 2, message 2 contains sequence/nonce 1 + // Internal.EVM2EVMMessage memory msgEvent1 = _messageToEvent(message1, 2, 2, expectedFee, address(s_facadeClient)); + // Internal.EVM2EVMMessage memory msgEvent2 = _messageToEvent(message2, 1, 1, expectedFee, address(s_facadeClient)); + + // vm.expectEmit(); + // emit CCIPSendRequested(msgEvent2); + // vm.expectEmit(); + // emit CCIPSendRequested(msgEvent1); + + // After issue is fixed, sequence now increments as expected + Internal.EVM2EVMMessage memory msgEvent1 = _messageToEvent(message1, 1, 1, expectedFee, address(s_facadeClient)); + Internal.EVM2EVMMessage memory msgEvent2 = _messageToEvent(message2, 2, 2, expectedFee, address(s_facadeClient)); + + vm.expectEmit(); + emit EVM2EVMOnRamp.CCIPSendRequested(msgEvent2); + vm.expectEmit(); + emit EVM2EVMOnRamp.CCIPSendRequested(msgEvent1); + + s_facadeClient.send(amount); + } +} diff --git a/contracts/src/v0.8/ccip/test/attacks/onRamp/ReentrantMaliciousTokenPool.sol b/contracts/src/v0.8/ccip/test/attacks/onRamp/ReentrantMaliciousTokenPool.sol new file mode 100644 index 00000000000..5b6b3679848 --- /dev/null +++ b/contracts/src/v0.8/ccip/test/attacks/onRamp/ReentrantMaliciousTokenPool.sol @@ -0,0 +1,45 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {Pool} from "../../../libraries/Pool.sol"; +import {TokenPool} from "../../../pools/TokenPool.sol"; +import {FacadeClient} from "./FacadeClient.sol"; + +import {IERC20} from "../../../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/IERC20.sol"; + +contract ReentrantMaliciousTokenPool is TokenPool { + address private i_facade; + + bool private s_attacked; + + constructor( + address facade, + IERC20 token, + address rmnProxy, + address router + ) TokenPool(token, new address[](0), rmnProxy, router) { + i_facade = facade; + } + + /// @dev Calls into Facade to reenter Router exactly 1 time + function lockOrBurn( + Pool.LockOrBurnInV1 calldata lockOrBurnIn + ) external override returns (Pool.LockOrBurnOutV1 memory) { + if (s_attacked) { + return + Pool.LockOrBurnOutV1({destTokenAddress: getRemoteToken(lockOrBurnIn.remoteChainSelector), destPoolData: ""}); + } + + s_attacked = true; + + FacadeClient(i_facade).send(lockOrBurnIn.amount); + emit Burned(msg.sender, lockOrBurnIn.amount); + return Pool.LockOrBurnOutV1({destTokenAddress: getRemoteToken(lockOrBurnIn.remoteChainSelector), destPoolData: ""}); + } + + function releaseOrMint( + Pool.ReleaseOrMintInV1 calldata releaseOrMintIn + ) external pure override returns (Pool.ReleaseOrMintOutV1 memory) { + return Pool.ReleaseOrMintOutV1({destinationAmount: releaseOrMintIn.amount}); + } +} diff --git a/contracts/src/v0.8/ccip/test/capability/CCIPConfig.t.sol b/contracts/src/v0.8/ccip/test/capability/CCIPConfig.t.sol new file mode 100644 index 00000000000..721f5d34637 --- /dev/null +++ b/contracts/src/v0.8/ccip/test/capability/CCIPConfig.t.sol @@ -0,0 +1,1443 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.24; + +import {SortedSetValidationUtil} from "../../../shared/util/SortedSetValidationUtil.sol"; +import {CCIPConfig} from "../../capability/CCIPConfig.sol"; +import {ICapabilitiesRegistry} from "../../capability/interfaces/ICapabilitiesRegistry.sol"; +import {CCIPConfigTypes} from "../../capability/libraries/CCIPConfigTypes.sol"; +import {Internal} from "../../libraries/Internal.sol"; +import {CCIPConfigHelper} from "../helpers/CCIPConfigHelper.sol"; +import {Test} from "forge-std/Test.sol"; + +contract CCIPConfigSetup is Test { + address public constant OWNER = 0x82ae2B4F57CA5C1CBF8f744ADbD3697aD1a35AFe; + address public constant CAPABILITIES_REGISTRY = 0x272aF4BF7FBFc4944Ed59F914Cd864DfD912D55e; + + CCIPConfigHelper public s_ccipCC; + + function setUp() public { + changePrank(OWNER); + s_ccipCC = new CCIPConfigHelper(CAPABILITIES_REGISTRY); + } + + function _makeBytes32Array(uint256 length, uint256 seed) internal pure returns (bytes32[] memory arr) { + arr = new bytes32[](length); + for (uint256 i = 0; i < length; i++) { + arr[i] = keccak256(abi.encode(i, 1, seed)); + } + return arr; + } + + function _makeBytesArray(uint256 length, uint256 seed) internal pure returns (bytes[] memory arr) { + arr = new bytes[](length); + for (uint256 i = 0; i < length; i++) { + arr[i] = abi.encodePacked(keccak256(abi.encode(i, 1, seed))); + } + return arr; + } + + function _subset(bytes32[] memory arr, uint256 start, uint256 end) internal pure returns (bytes32[] memory) { + bytes32[] memory subset = new bytes32[](end - start); + for (uint256 i = start; i < end; i++) { + subset[i - start] = arr[i]; + } + return subset; + } + + //TODO: Use OZ's Arrays.sort when we upgrade to OZ v5 + function _sort(bytes32[] memory arr, int256 left, int256 right) private pure { + int256 i = left; + int256 j = right; + if (i == j) return; + bytes32 pivot = arr[uint256(left + (right - left) / 2)]; + while (i <= j) { + while (arr[uint256(i)] < pivot) i++; + while (pivot < arr[uint256(j)]) j--; + if (i <= j) { + (arr[uint256(i)], arr[uint256(j)]) = (arr[uint256(j)], arr[uint256(i)]); + i++; + j--; + } + } + if (left < j) _sort(arr, left, j); + if (i < right) _sort(arr, i, right); + } + + function _addChainConfig( + uint256 numNodes + ) internal returns (bytes32[] memory p2pIds, bytes[] memory signers, bytes[] memory transmitters) { + p2pIds = _makeBytes32Array(numNodes, 0); + _sort(p2pIds, 0, int256(numNodes - 1)); + signers = _makeBytesArray(numNodes, 10); + transmitters = _makeBytesArray(numNodes, 20); + for (uint256 i = 0; i < numNodes; i++) { + vm.mockCall( + CAPABILITIES_REGISTRY, + abi.encodeWithSelector(ICapabilitiesRegistry.getNode.selector, p2pIds[i]), + abi.encode( + ICapabilitiesRegistry.NodeInfo({ + nodeOperatorId: 1, + signer: bytes32(signers[i]), + p2pId: p2pIds[i], + hashedCapabilityIds: new bytes32[](0), + configCount: uint32(1), + workflowDONId: uint32(1), + capabilitiesDONIds: new uint256[](0) + }) + ) + ); + } + // Add chain selector for chain 1. + CCIPConfigTypes.ChainConfigInfo[] memory adds = new CCIPConfigTypes.ChainConfigInfo[](1); + adds[0] = CCIPConfigTypes.ChainConfigInfo({ + chainSelector: 1, + chainConfig: CCIPConfigTypes.ChainConfig({readers: p2pIds, fChain: 1, config: bytes("config1")}) + }); + + vm.expectEmit(); + emit CCIPConfig.ChainConfigSet(1, adds[0].chainConfig); + s_ccipCC.applyChainConfigUpdates(new uint64[](0), adds); + + return (p2pIds, signers, transmitters); + } + + function test_getCapabilityConfiguration_Success() public view { + bytes memory capConfig = s_ccipCC.getCapabilityConfiguration(42 /* doesn't matter, not used */ ); + assertEq(capConfig.length, 0, "capability config length must be 0"); + } +} + +contract CCIPConfig_constructor is Test { + // Successes. + + function test_constructor_Success() public { + address capabilitiesRegistry = makeAddr("capabilitiesRegistry"); + CCIPConfigHelper ccipCC = new CCIPConfigHelper(capabilitiesRegistry); + assertEq(address(ccipCC.getCapabilityRegistry()), capabilitiesRegistry); + assertEq(ccipCC.typeAndVersion(), "CCIPConfig 1.6.0-dev"); + } + + // Reverts. + + function test_constructor_ZeroAddressNotAllowed_Revert() public { + vm.expectRevert(CCIPConfig.ZeroAddressNotAllowed.selector); + new CCIPConfigHelper(address(0)); + } +} + +contract CCIPConfig_chainConfig is CCIPConfigSetup { + // Successes. + function test_applyChainConfigUpdates_addChainConfigs_Success() public { + bytes32[] memory chainReaders = new bytes32[](1); + chainReaders[0] = keccak256(abi.encode(1)); + CCIPConfigTypes.ChainConfigInfo[] memory adds = new CCIPConfigTypes.ChainConfigInfo[](2); + adds[0] = CCIPConfigTypes.ChainConfigInfo({ + chainSelector: 1, + chainConfig: CCIPConfigTypes.ChainConfig({readers: chainReaders, fChain: 1, config: bytes("config1")}) + }); + adds[1] = CCIPConfigTypes.ChainConfigInfo({ + chainSelector: 2, + chainConfig: CCIPConfigTypes.ChainConfig({readers: chainReaders, fChain: 1, config: bytes("config2")}) + }); + vm.mockCall( + CAPABILITIES_REGISTRY, + abi.encodeWithSelector(ICapabilitiesRegistry.getNode.selector, chainReaders[0]), + abi.encode( + ICapabilitiesRegistry.NodeInfo({ + nodeOperatorId: 1, + signer: bytes32(uint256(1)), + p2pId: chainReaders[0], + hashedCapabilityIds: new bytes32[](0), + configCount: uint32(1), + workflowDONId: uint32(1), + capabilitiesDONIds: new uint256[](0) + }) + ) + ); + vm.expectEmit(); + emit CCIPConfig.ChainConfigSet(1, adds[0].chainConfig); + vm.expectEmit(); + emit CCIPConfig.ChainConfigSet(2, adds[1].chainConfig); + s_ccipCC.applyChainConfigUpdates(new uint64[](0), adds); + + CCIPConfigTypes.ChainConfigInfo[] memory configs = s_ccipCC.getAllChainConfigs(0, 2); + assertEq(configs.length, 2, "chain configs length must be 2"); + assertEq(configs[0].chainSelector, 1, "chain selector must match"); + assertEq(configs[1].chainSelector, 2, "chain selector must match"); + } + + function test_getPaginatedCCIPConfigs_Success() public { + bytes32[] memory chainReaders = new bytes32[](1); + chainReaders[0] = keccak256(abi.encode(1)); + CCIPConfigTypes.ChainConfigInfo[] memory adds = new CCIPConfigTypes.ChainConfigInfo[](2); + adds[0] = CCIPConfigTypes.ChainConfigInfo({ + chainSelector: 1, + chainConfig: CCIPConfigTypes.ChainConfig({readers: chainReaders, fChain: 1, config: bytes("config1")}) + }); + adds[1] = CCIPConfigTypes.ChainConfigInfo({ + chainSelector: 2, + chainConfig: CCIPConfigTypes.ChainConfig({readers: chainReaders, fChain: 1, config: bytes("config2")}) + }); + vm.mockCall( + CAPABILITIES_REGISTRY, + abi.encodeWithSelector(ICapabilitiesRegistry.getNode.selector, chainReaders[0]), + abi.encode( + ICapabilitiesRegistry.NodeInfo({ + nodeOperatorId: 1, + signer: bytes32(uint256(1)), + p2pId: chainReaders[0], + hashedCapabilityIds: new bytes32[](0), + configCount: uint32(1), + workflowDONId: uint32(1), + capabilitiesDONIds: new uint256[](0) + }) + ) + ); + + s_ccipCC.applyChainConfigUpdates(new uint64[](0), adds); + + CCIPConfigTypes.ChainConfigInfo[] memory configs = s_ccipCC.getAllChainConfigs(0, 2); + assertEq(configs.length, 2, "chain configs length must be 2"); + assertEq(configs[0].chainSelector, 1, "chain selector must match"); + assertEq(configs[1].chainSelector, 2, "chain selector must match"); + + configs = s_ccipCC.getAllChainConfigs(0, 1); + assertEq(configs.length, 1, "chain configs length must be 1"); + assertEq(configs[0].chainSelector, 1, "chain selector must match"); + + configs = s_ccipCC.getAllChainConfigs(0, 10); + assertEq(configs.length, 2, "chain configs length must be 2"); + assertEq(configs[0].chainSelector, 1, "chain selector must match"); + assertEq(configs[1].chainSelector, 2, "chain selector must match"); + + configs = s_ccipCC.getAllChainConfigs(1, 1); + assertEq(configs.length, 1, "chain configs length must be 1"); + + configs = s_ccipCC.getAllChainConfigs(1, 2); + assertEq(configs.length, 0, "chain configs length must be 0"); + } + + function test_applyChainConfigUpdates_removeChainConfigs_Success() public { + bytes32[] memory chainReaders = new bytes32[](1); + chainReaders[0] = keccak256(abi.encode(1)); + CCIPConfigTypes.ChainConfigInfo[] memory adds = new CCIPConfigTypes.ChainConfigInfo[](2); + adds[0] = CCIPConfigTypes.ChainConfigInfo({ + chainSelector: 1, + chainConfig: CCIPConfigTypes.ChainConfig({readers: chainReaders, fChain: 1, config: bytes("config1")}) + }); + adds[1] = CCIPConfigTypes.ChainConfigInfo({ + chainSelector: 2, + chainConfig: CCIPConfigTypes.ChainConfig({readers: chainReaders, fChain: 1, config: bytes("config2")}) + }); + + vm.mockCall( + CAPABILITIES_REGISTRY, + abi.encodeWithSelector(ICapabilitiesRegistry.getNode.selector, chainReaders[0]), + abi.encode( + ICapabilitiesRegistry.NodeInfo({ + nodeOperatorId: 1, + signer: bytes32(uint256(1)), + p2pId: chainReaders[0], + hashedCapabilityIds: new bytes32[](0), + configCount: uint32(1), + workflowDONId: uint32(1), + capabilitiesDONIds: new uint256[](0) + }) + ) + ); + + vm.expectEmit(); + emit CCIPConfig.ChainConfigSet(1, adds[0].chainConfig); + vm.expectEmit(); + emit CCIPConfig.ChainConfigSet(2, adds[1].chainConfig); + s_ccipCC.applyChainConfigUpdates(new uint64[](0), adds); + + uint64[] memory removes = new uint64[](1); + removes[0] = uint64(1); + + vm.expectEmit(); + emit CCIPConfig.ChainConfigRemoved(1); + s_ccipCC.applyChainConfigUpdates(removes, new CCIPConfigTypes.ChainConfigInfo[](0)); + } + + // Reverts. + + function test_applyChainConfigUpdates_selectorNotFound_Reverts() public { + uint64[] memory removes = new uint64[](1); + removes[0] = uint64(1); + + vm.expectRevert(abi.encodeWithSelector(CCIPConfig.ChainSelectorNotFound.selector, 1)); + s_ccipCC.applyChainConfigUpdates(removes, new CCIPConfigTypes.ChainConfigInfo[](0)); + } + + function test_applyChainConfigUpdates_nodeNotInRegistry_Reverts() public { + bytes32[] memory chainReaders = new bytes32[](1); + chainReaders[0] = keccak256(abi.encode(1)); + CCIPConfigTypes.ChainConfigInfo[] memory adds = new CCIPConfigTypes.ChainConfigInfo[](1); + adds[0] = CCIPConfigTypes.ChainConfigInfo({ + chainSelector: 1, + chainConfig: CCIPConfigTypes.ChainConfig({readers: chainReaders, fChain: 1, config: abi.encode(1, 2, 3)}) + }); + + vm.mockCall( + CAPABILITIES_REGISTRY, + abi.encodeWithSelector(ICapabilitiesRegistry.getNode.selector, chainReaders[0]), + abi.encode( + ICapabilitiesRegistry.NodeInfo({ + nodeOperatorId: 0, + signer: bytes32(0), + p2pId: bytes32(uint256(0)), + hashedCapabilityIds: new bytes32[](0), + configCount: uint32(1), + workflowDONId: uint32(1), + capabilitiesDONIds: new uint256[](0) + }) + ) + ); + + vm.expectRevert(abi.encodeWithSelector(CCIPConfig.NodeNotInRegistry.selector, chainReaders[0])); + s_ccipCC.applyChainConfigUpdates(new uint64[](0), adds); + } + + function test__applyChainConfigUpdates_FChainNotPositive_Reverts() public { + bytes32[] memory chainReaders = new bytes32[](1); + chainReaders[0] = keccak256(abi.encode(1)); + CCIPConfigTypes.ChainConfigInfo[] memory adds = new CCIPConfigTypes.ChainConfigInfo[](2); + adds[0] = CCIPConfigTypes.ChainConfigInfo({ + chainSelector: 1, + chainConfig: CCIPConfigTypes.ChainConfig({readers: chainReaders, fChain: 1, config: bytes("config1")}) + }); + adds[1] = CCIPConfigTypes.ChainConfigInfo({ + chainSelector: 2, + chainConfig: CCIPConfigTypes.ChainConfig({readers: chainReaders, fChain: 0, config: bytes("config2")}) // bad fChain + }); + + vm.mockCall( + CAPABILITIES_REGISTRY, + abi.encodeWithSelector(ICapabilitiesRegistry.getNode.selector, chainReaders[0]), + abi.encode( + ICapabilitiesRegistry.NodeInfo({ + nodeOperatorId: 1, + signer: bytes32(uint256(1)), + p2pId: chainReaders[0], + hashedCapabilityIds: new bytes32[](0), + configCount: uint32(1), + workflowDONId: uint32(1), + capabilitiesDONIds: new uint256[](0) + }) + ) + ); + + vm.expectRevert(CCIPConfig.FChainMustBePositive.selector); + s_ccipCC.applyChainConfigUpdates(new uint64[](0), adds); + } +} + +contract CCIPConfig_validateConfig is CCIPConfigSetup { + function _getCorrectOCR3Config() internal returns (CCIPConfigTypes.OCR3Config memory) { + (bytes32[] memory p2pIds, bytes[] memory signers, bytes[] memory transmitters) = _addChainConfig(4); + + return CCIPConfigTypes.OCR3Config({ + pluginType: Internal.OCRPluginType.Commit, + offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), + chainSelector: 1, + p2pIds: p2pIds, + signers: signers, + transmitters: transmitters, + F: 1, + offchainConfigVersion: 30, + offchainConfig: bytes("offchainConfig") + }); + } + + // Successes. + + function test__validateConfig_Success() public { + s_ccipCC.validateConfig(_getCorrectOCR3Config()); + } + + // Reverts. + + function test__validateConfig_ChainSelectorNotSet_Reverts() public { + CCIPConfigTypes.OCR3Config memory config = _getCorrectOCR3Config(); + config.chainSelector = 0; // invalid + + vm.expectRevert(CCIPConfig.ChainSelectorNotSet.selector); + s_ccipCC.validateConfig(config); + } + + function test__validateConfig_OfframpAddressCannotBeZero_Reverts() public { + CCIPConfigTypes.OCR3Config memory config = _getCorrectOCR3Config(); + config.offrampAddress = ""; // invalid + + vm.expectRevert(CCIPConfig.OfframpAddressCannotBeZero.selector); + s_ccipCC.validateConfig(config); + } + + function test__validateConfig_ABIEncodedAddress_OfframpAddressCannotBeZero_Reverts() public { + CCIPConfigTypes.OCR3Config memory config = _getCorrectOCR3Config(); + config.offrampAddress = abi.encode(address(0)); // invalid + + vm.expectRevert(CCIPConfig.OfframpAddressCannotBeZero.selector); + s_ccipCC.validateConfig(config); + } + + function test__validateConfig_ChainSelectorNotFound_Reverts() public { + CCIPConfigTypes.OCR3Config memory config = _getCorrectOCR3Config(); + config.chainSelector = 2; // not set + + vm.expectRevert(abi.encodeWithSelector(CCIPConfig.ChainSelectorNotFound.selector, 2)); + s_ccipCC.validateConfig(config); + } + + function test__validateConfig_NotEnoughTransmitters_Reverts() public { + CCIPConfigTypes.OCR3Config memory config = _getCorrectOCR3Config(); + uint256 numberOfTransmitters = 3; + + // 32 > 31 (max num oracles) + (bytes32[] memory p2pIds, bytes[] memory signers, bytes[] memory transmitters) = _addChainConfig(31); + + // truncate transmitters to < 3 * fChain + 1 + // since fChain is 1 in this case, we need to truncate to 3 transmitters. + assembly { + mstore(transmitters, numberOfTransmitters) + } + + config.transmitters = transmitters; + config.p2pIds = p2pIds; + config.signers = signers; + + vm.expectRevert(abi.encodeWithSelector(CCIPConfig.NotEnoughTransmitters.selector, numberOfTransmitters, 4)); + s_ccipCC.validateConfig(config); + } + + function test__validateConfig_TooManySigners_Reverts() public { + CCIPConfigTypes.OCR3Config memory config = _getCorrectOCR3Config(); + config.signers = new bytes[](257); + + vm.expectRevert(CCIPConfig.TooManySigners.selector); + s_ccipCC.validateConfig(config); + } + + function test__validateConfig_FMustBePositive_Reverts() public { + CCIPConfigTypes.OCR3Config memory config = _getCorrectOCR3Config(); + config.F = 0; // not positive + + vm.expectRevert(CCIPConfig.FMustBePositive.selector); + s_ccipCC.validateConfig(config); + } + + function test__validateConfig_FTooHigh_Reverts() public { + CCIPConfigTypes.OCR3Config memory config = _getCorrectOCR3Config(); + config.F = 2; // too high + + vm.expectRevert(CCIPConfig.FTooHigh.selector); + s_ccipCC.validateConfig(config); + } + + function test__validateConfig_P2PIdsLengthNotMatching_Reverts() public { + CCIPConfigTypes.OCR3Config memory config = _getCorrectOCR3Config(); + + uint256 expectedNumberOfP2pIds = config.signers.length; + uint256 wrongNumberOfP2pIds = expectedNumberOfP2pIds - 1; + config.p2pIds = new bytes32[](wrongNumberOfP2pIds); // Not enough + + vm.expectRevert( + abi.encodeWithSelector( + CCIPConfig.P2PIdsLengthNotMatching.selector, wrongNumberOfP2pIds, expectedNumberOfP2pIds, expectedNumberOfP2pIds + ) + ); + s_ccipCC.validateConfig(config); + } + + function test__validateConfig_NodeNotInRegistry_Reverts() public { + (bytes32[] memory p2pIds,,) = _addChainConfig(4); + bytes32 nonExistentP2PId = keccak256("notInRegistry"); + p2pIds[0] = nonExistentP2PId; + + vm.mockCall( + CAPABILITIES_REGISTRY, + abi.encodeWithSelector(ICapabilitiesRegistry.getNode.selector, nonExistentP2PId), + abi.encode( + ICapabilitiesRegistry.NodeInfo({ + nodeOperatorId: 0, + signer: bytes32(0), + p2pId: bytes32(uint256(0)), + hashedCapabilityIds: new bytes32[](0), + configCount: uint32(1), + workflowDONId: uint32(1), + capabilitiesDONIds: new uint256[](0) + }) + ) + ); + CCIPConfigTypes.OCR3Config memory config = _getCorrectOCR3Config(); + config.p2pIds = p2pIds; + + vm.expectRevert(abi.encodeWithSelector(CCIPConfig.NodeNotInRegistry.selector, nonExistentP2PId)); + s_ccipCC.validateConfig(config); + } +} + +contract CCIPConfig_ConfigStateMachine is CCIPConfigSetup { + // Successful cases. + + function test__stateFromConfigLength_Success() public view { + uint256 configLen = 0; + CCIPConfigTypes.ConfigState state = s_ccipCC.stateFromConfigLength(configLen); + assertEq(uint256(state), uint256(CCIPConfigTypes.ConfigState.Init)); + + configLen = 1; + state = s_ccipCC.stateFromConfigLength(configLen); + assertEq(uint256(state), uint256(CCIPConfigTypes.ConfigState.Running)); + + configLen = 2; + state = s_ccipCC.stateFromConfigLength(configLen); + assertEq(uint256(state), uint256(CCIPConfigTypes.ConfigState.Staging)); + } + + function test__validateConfigStateTransition_Success() public view { + s_ccipCC.validateConfigStateTransition(CCIPConfigTypes.ConfigState.Init, CCIPConfigTypes.ConfigState.Running); + + s_ccipCC.validateConfigStateTransition(CCIPConfigTypes.ConfigState.Running, CCIPConfigTypes.ConfigState.Staging); + + s_ccipCC.validateConfigStateTransition(CCIPConfigTypes.ConfigState.Staging, CCIPConfigTypes.ConfigState.Running); + } + + function test__computeConfigDigest_Success() public view { + // config digest must change upon: + // - ocr config change (e.g plugin type, chain selector, etc.) + // - don id change + // - config count change + bytes32[] memory p2pIds = _makeBytes32Array(4, 0); + bytes[] memory signers = _makeBytesArray(2, 10); + bytes[] memory transmitters = _makeBytesArray(2, 20); + CCIPConfigTypes.OCR3Config memory config = CCIPConfigTypes.OCR3Config({ + pluginType: Internal.OCRPluginType.Commit, + offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), + chainSelector: 1, + p2pIds: p2pIds, + signers: signers, + transmitters: transmitters, + F: 1, + offchainConfigVersion: 30, + offchainConfig: bytes("offchainConfig") + }); + uint32 donId = 1; + uint32 configCount = 1; + + bytes32 configDigest1 = s_ccipCC.computeConfigDigest(donId, configCount, config); + + donId = 2; + bytes32 configDigest2 = s_ccipCC.computeConfigDigest(donId, configCount, config); + + donId = 1; + configCount = 2; + bytes32 configDigest3 = s_ccipCC.computeConfigDigest(donId, configCount, config); + + configCount = 1; + config.pluginType = Internal.OCRPluginType.Execution; + bytes32 configDigest4 = s_ccipCC.computeConfigDigest(donId, configCount, config); + + assertNotEq(configDigest1, configDigest2, "config digests 1 and 2 must not match"); + assertNotEq(configDigest1, configDigest3, "config digests 1 and 3 must not match"); + assertNotEq(configDigest1, configDigest4, "config digests 1 and 4 must not match"); + + assertNotEq(configDigest2, configDigest3, "config digests 2 and 3 must not match"); + assertNotEq(configDigest2, configDigest4, "config digests 2 and 4 must not match"); + } + + function test_Fuzz__groupByPluginType_Success(uint256 numCommitCfgs, uint256 numExecCfgs) public view { + numCommitCfgs = bound(numCommitCfgs, 0, 2); + numExecCfgs = bound(numExecCfgs, 0, 2); + + bytes32[] memory p2pIds = _makeBytes32Array(4, 0); + bytes[] memory signers = _makeBytesArray(4, 10); + bytes[] memory transmitters = _makeBytesArray(4, 20); + CCIPConfigTypes.OCR3Config[] memory cfgs = new CCIPConfigTypes.OCR3Config[](numCommitCfgs + numExecCfgs); + for (uint256 i = 0; i < numCommitCfgs; i++) { + cfgs[i] = CCIPConfigTypes.OCR3Config({ + pluginType: Internal.OCRPluginType.Commit, + offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), + chainSelector: 1, + p2pIds: p2pIds, + signers: signers, + transmitters: transmitters, + F: 1, + offchainConfigVersion: 30, + offchainConfig: abi.encode("commit", i) + }); + } + for (uint256 i = 0; i < numExecCfgs; i++) { + cfgs[numCommitCfgs + i] = CCIPConfigTypes.OCR3Config({ + pluginType: Internal.OCRPluginType.Execution, + offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), + chainSelector: 1, + p2pIds: p2pIds, + signers: signers, + transmitters: transmitters, + F: 1, + offchainConfigVersion: 30, + offchainConfig: abi.encode("exec", numCommitCfgs + i) + }); + } + (CCIPConfigTypes.OCR3Config[] memory commitCfgs, CCIPConfigTypes.OCR3Config[] memory execCfgs) = + s_ccipCC.groupByPluginType(cfgs); + + assertEq(commitCfgs.length, numCommitCfgs, "commitCfgs length must match"); + assertEq(execCfgs.length, numExecCfgs, "execCfgs length must match"); + for (uint256 i = 0; i < commitCfgs.length; i++) { + assertEq(uint8(commitCfgs[i].pluginType), uint8(Internal.OCRPluginType.Commit), "plugin type must be commit"); + assertEq(commitCfgs[i].offchainConfig, abi.encode("commit", i), "offchain config must match"); + } + for (uint256 i = 0; i < execCfgs.length; i++) { + assertEq(uint8(execCfgs[i].pluginType), uint8(Internal.OCRPluginType.Execution), "plugin type must be execution"); + assertEq(execCfgs[i].offchainConfig, abi.encode("exec", numCommitCfgs + i), "offchain config must match"); + } + } + + function test__computeNewConfigWithMeta_InitToRunning_Success() public { + (bytes32[] memory p2pIds, bytes[] memory signers, bytes[] memory transmitters) = _addChainConfig(4); + uint32 donId = 1; + CCIPConfigTypes.OCR3ConfigWithMeta[] memory currentConfig = new CCIPConfigTypes.OCR3ConfigWithMeta[](0); + CCIPConfigTypes.OCR3Config[] memory newConfig = new CCIPConfigTypes.OCR3Config[](1); + newConfig[0] = CCIPConfigTypes.OCR3Config({ + pluginType: Internal.OCRPluginType.Commit, + offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), + chainSelector: 1, + p2pIds: p2pIds, + signers: signers, + transmitters: transmitters, + F: 1, + offchainConfigVersion: 30, + offchainConfig: bytes("commit") + }); + CCIPConfigTypes.ConfigState currentState = CCIPConfigTypes.ConfigState.Init; + CCIPConfigTypes.ConfigState newState = CCIPConfigTypes.ConfigState.Running; + CCIPConfigTypes.OCR3ConfigWithMeta[] memory newConfigWithMeta = + s_ccipCC.computeNewConfigWithMeta(donId, currentConfig, newConfig, currentState, newState); + assertEq(newConfigWithMeta.length, 1, "new config with meta length must be 1"); + assertEq(newConfigWithMeta[0].configCount, uint64(1), "config count must be 1"); + assertEq(uint8(newConfigWithMeta[0].config.pluginType), uint8(newConfig[0].pluginType), "plugin type must match"); + assertEq(newConfigWithMeta[0].config.offchainConfig, newConfig[0].offchainConfig, "offchain config must match"); + assertEq( + newConfigWithMeta[0].configDigest, + s_ccipCC.computeConfigDigest(donId, 1, newConfig[0]), + "config digest must match" + ); + + // This ensures that the test case is using correct inputs. + s_ccipCC.validateConfigTransition(currentConfig, newConfigWithMeta); + } + + function test__computeNewConfigWithMeta_RunningToStaging_Success() public { + (bytes32[] memory p2pIds, bytes[] memory signers, bytes[] memory transmitters) = _addChainConfig(4); + uint32 donId = 1; + CCIPConfigTypes.OCR3Config memory blueConfig = CCIPConfigTypes.OCR3Config({ + pluginType: Internal.OCRPluginType.Commit, + offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), + chainSelector: 1, + p2pIds: p2pIds, + signers: signers, + transmitters: transmitters, + F: 1, + offchainConfigVersion: 30, + offchainConfig: bytes("commit") + }); + CCIPConfigTypes.OCR3Config memory greenConfig = CCIPConfigTypes.OCR3Config({ + pluginType: Internal.OCRPluginType.Commit, + offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), + chainSelector: 1, + p2pIds: p2pIds, + signers: signers, + transmitters: transmitters, + F: 1, + offchainConfigVersion: 30, + offchainConfig: bytes("commit-new") + }); + + CCIPConfigTypes.OCR3ConfigWithMeta[] memory currentConfig = new CCIPConfigTypes.OCR3ConfigWithMeta[](1); + currentConfig[0] = CCIPConfigTypes.OCR3ConfigWithMeta({ + configCount: 1, + config: blueConfig, + configDigest: s_ccipCC.computeConfigDigest(donId, 1, blueConfig) + }); + + CCIPConfigTypes.OCR3Config[] memory newConfig = new CCIPConfigTypes.OCR3Config[](2); + // existing blue config first. + newConfig[0] = blueConfig; + // green config next. + newConfig[1] = greenConfig; + + CCIPConfigTypes.ConfigState currentState = CCIPConfigTypes.ConfigState.Running; + CCIPConfigTypes.ConfigState newState = CCIPConfigTypes.ConfigState.Staging; + + CCIPConfigTypes.OCR3ConfigWithMeta[] memory newConfigWithMeta = + s_ccipCC.computeNewConfigWithMeta(donId, currentConfig, newConfig, currentState, newState); + assertEq(newConfigWithMeta.length, 2, "new config with meta length must be 2"); + + assertEq(newConfigWithMeta[0].configCount, uint64(1), "config count of blue must be 1"); + assertEq( + uint8(newConfigWithMeta[0].config.pluginType), uint8(blueConfig.pluginType), "plugin type of blue must match" + ); + assertEq( + newConfigWithMeta[0].config.offchainConfig, blueConfig.offchainConfig, "offchain config of blue must match" + ); + assertEq( + newConfigWithMeta[0].configDigest, + s_ccipCC.computeConfigDigest(donId, 1, blueConfig), + "config digest of blue must match" + ); + + assertEq(newConfigWithMeta[1].configCount, uint64(2), "config count of green must be 2"); + assertEq( + uint8(newConfigWithMeta[1].config.pluginType), uint8(greenConfig.pluginType), "plugin type of green must match" + ); + assertEq( + newConfigWithMeta[1].config.offchainConfig, greenConfig.offchainConfig, "offchain config of green must match" + ); + assertEq( + newConfigWithMeta[1].configDigest, + s_ccipCC.computeConfigDigest(donId, 2, greenConfig), + "config digest of green must match" + ); + + // This ensures that the test case is using correct inputs. + s_ccipCC.validateConfigTransition(currentConfig, newConfigWithMeta); + } + + function test__computeNewConfigWithMeta_StagingToRunning_Success() public { + (bytes32[] memory p2pIds, bytes[] memory signers, bytes[] memory transmitters) = _addChainConfig(4); + uint32 donId = 1; + CCIPConfigTypes.OCR3Config memory blueConfig = CCIPConfigTypes.OCR3Config({ + pluginType: Internal.OCRPluginType.Commit, + offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), + chainSelector: 1, + p2pIds: p2pIds, + signers: signers, + transmitters: transmitters, + F: 1, + offchainConfigVersion: 30, + offchainConfig: bytes("commit") + }); + CCIPConfigTypes.OCR3Config memory greenConfig = CCIPConfigTypes.OCR3Config({ + pluginType: Internal.OCRPluginType.Commit, + offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), + chainSelector: 1, + p2pIds: p2pIds, + signers: signers, + transmitters: transmitters, + F: 1, + offchainConfigVersion: 30, + offchainConfig: bytes("commit-new") + }); + + CCIPConfigTypes.OCR3ConfigWithMeta[] memory currentConfig = new CCIPConfigTypes.OCR3ConfigWithMeta[](2); + currentConfig[0] = CCIPConfigTypes.OCR3ConfigWithMeta({ + configCount: 1, + config: blueConfig, + configDigest: s_ccipCC.computeConfigDigest(donId, 1, blueConfig) + }); + currentConfig[1] = CCIPConfigTypes.OCR3ConfigWithMeta({ + configCount: 2, + config: greenConfig, + configDigest: s_ccipCC.computeConfigDigest(donId, 2, greenConfig) + }); + CCIPConfigTypes.OCR3Config[] memory newConfig = new CCIPConfigTypes.OCR3Config[](1); + newConfig[0] = greenConfig; + + CCIPConfigTypes.ConfigState currentState = CCIPConfigTypes.ConfigState.Staging; + CCIPConfigTypes.ConfigState newState = CCIPConfigTypes.ConfigState.Running; + + CCIPConfigTypes.OCR3ConfigWithMeta[] memory newConfigWithMeta = + s_ccipCC.computeNewConfigWithMeta(donId, currentConfig, newConfig, currentState, newState); + + assertEq(newConfigWithMeta.length, 1, "new config with meta length must be 1"); + assertEq(newConfigWithMeta[0].configCount, uint64(2), "config count must be 2"); + assertEq(uint8(newConfigWithMeta[0].config.pluginType), uint8(greenConfig.pluginType), "plugin type must match"); + assertEq(newConfigWithMeta[0].config.offchainConfig, greenConfig.offchainConfig, "offchain config must match"); + assertEq( + newConfigWithMeta[0].configDigest, s_ccipCC.computeConfigDigest(donId, 2, greenConfig), "config digest must match" + ); + + // This ensures that the test case is using correct inputs. + s_ccipCC.validateConfigTransition(currentConfig, newConfigWithMeta); + } + + function test__validateConfigTransition_InitToRunning_Success() public { + (bytes32[] memory p2pIds, bytes[] memory signers, bytes[] memory transmitters) = _addChainConfig(4); + uint32 donId = 1; + CCIPConfigTypes.OCR3Config memory blueConfig = CCIPConfigTypes.OCR3Config({ + pluginType: Internal.OCRPluginType.Commit, + offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), + chainSelector: 1, + p2pIds: p2pIds, + signers: signers, + transmitters: transmitters, + F: 1, + offchainConfigVersion: 30, + offchainConfig: bytes("commit") + }); + + CCIPConfigTypes.OCR3ConfigWithMeta[] memory newConfig = new CCIPConfigTypes.OCR3ConfigWithMeta[](1); + newConfig[0] = CCIPConfigTypes.OCR3ConfigWithMeta({ + configCount: 1, + config: blueConfig, + configDigest: s_ccipCC.computeConfigDigest(donId, 1, blueConfig) + }); + CCIPConfigTypes.OCR3ConfigWithMeta[] memory currentConfig = new CCIPConfigTypes.OCR3ConfigWithMeta[](0); + + s_ccipCC.validateConfigTransition(currentConfig, newConfig); + } + + function test__validateConfigTransition_RunningToStaging_Success() public { + (bytes32[] memory p2pIds, bytes[] memory signers, bytes[] memory transmitters) = _addChainConfig(4); + uint32 donId = 1; + CCIPConfigTypes.OCR3Config memory blueConfig = CCIPConfigTypes.OCR3Config({ + pluginType: Internal.OCRPluginType.Commit, + offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), + chainSelector: 1, + p2pIds: p2pIds, + signers: signers, + transmitters: transmitters, + F: 1, + offchainConfigVersion: 30, + offchainConfig: bytes("commit") + }); + CCIPConfigTypes.OCR3Config memory greenConfig = CCIPConfigTypes.OCR3Config({ + pluginType: Internal.OCRPluginType.Commit, + offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), + chainSelector: 1, + p2pIds: p2pIds, + signers: signers, + transmitters: transmitters, + F: 1, + offchainConfigVersion: 30, + offchainConfig: bytes("commit-new") + }); + + CCIPConfigTypes.OCR3ConfigWithMeta[] memory newConfig = new CCIPConfigTypes.OCR3ConfigWithMeta[](2); + newConfig[0] = CCIPConfigTypes.OCR3ConfigWithMeta({ + configCount: 1, + config: blueConfig, + configDigest: s_ccipCC.computeConfigDigest(donId, 1, blueConfig) + }); + newConfig[1] = CCIPConfigTypes.OCR3ConfigWithMeta({ + configCount: 2, + config: greenConfig, + configDigest: s_ccipCC.computeConfigDigest(donId, 2, greenConfig) + }); + + CCIPConfigTypes.OCR3ConfigWithMeta[] memory currentConfig = new CCIPConfigTypes.OCR3ConfigWithMeta[](1); + currentConfig[0] = CCIPConfigTypes.OCR3ConfigWithMeta({ + configCount: 1, + config: blueConfig, + configDigest: s_ccipCC.computeConfigDigest(donId, 1, blueConfig) + }); + + s_ccipCC.validateConfigTransition(currentConfig, newConfig); + } + + function test__validateConfigTransition_StagingToRunning_Success() public { + (bytes32[] memory p2pIds, bytes[] memory signers, bytes[] memory transmitters) = _addChainConfig(4); + uint32 donId = 1; + CCIPConfigTypes.OCR3Config memory blueConfig = CCIPConfigTypes.OCR3Config({ + pluginType: Internal.OCRPluginType.Commit, + offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), + chainSelector: 1, + p2pIds: p2pIds, + signers: signers, + transmitters: transmitters, + F: 1, + offchainConfigVersion: 30, + offchainConfig: bytes("commit") + }); + CCIPConfigTypes.OCR3Config memory greenConfig = CCIPConfigTypes.OCR3Config({ + pluginType: Internal.OCRPluginType.Commit, + offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), + chainSelector: 1, + p2pIds: p2pIds, + signers: signers, + transmitters: transmitters, + F: 1, + offchainConfigVersion: 30, + offchainConfig: bytes("commit-new") + }); + + CCIPConfigTypes.OCR3ConfigWithMeta[] memory currentConfig = new CCIPConfigTypes.OCR3ConfigWithMeta[](2); + currentConfig[0] = CCIPConfigTypes.OCR3ConfigWithMeta({ + configCount: 1, + config: blueConfig, + configDigest: s_ccipCC.computeConfigDigest(donId, 1, blueConfig) + }); + currentConfig[1] = CCIPConfigTypes.OCR3ConfigWithMeta({ + configCount: 2, + config: greenConfig, + configDigest: s_ccipCC.computeConfigDigest(donId, 2, greenConfig) + }); + + CCIPConfigTypes.OCR3ConfigWithMeta[] memory newConfig = new CCIPConfigTypes.OCR3ConfigWithMeta[](1); + newConfig[0] = CCIPConfigTypes.OCR3ConfigWithMeta({ + configCount: 2, + config: greenConfig, + configDigest: s_ccipCC.computeConfigDigest(donId, 2, greenConfig) + }); + + s_ccipCC.validateConfigTransition(currentConfig, newConfig); + } + + // Reverts. + + function test_Fuzz__stateFromConfigLength_Reverts(uint256 configLen) public { + vm.assume(configLen > 2); + vm.expectRevert(abi.encodeWithSelector(CCIPConfig.InvalidConfigLength.selector, configLen)); + s_ccipCC.stateFromConfigLength(configLen); + } + + function test__groupByPluginType_threeCommitConfigs_Reverts() public { + bytes32[] memory p2pIds = _makeBytes32Array(4, 0); + bytes[] memory signers = _makeBytesArray(4, 10); + bytes[] memory transmitters = _makeBytesArray(4, 20); + CCIPConfigTypes.OCR3Config[] memory cfgs = new CCIPConfigTypes.OCR3Config[](3); + for (uint256 i = 0; i < 3; i++) { + cfgs[i] = CCIPConfigTypes.OCR3Config({ + pluginType: Internal.OCRPluginType.Commit, + offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), + chainSelector: 1, + p2pIds: p2pIds, + signers: signers, + transmitters: transmitters, + F: 1, + offchainConfigVersion: 30, + offchainConfig: abi.encode("commit", i) + }); + } + vm.expectRevert(); + s_ccipCC.groupByPluginType(cfgs); + } + + function test__groupByPluginType_threeExecutionConfigs_Reverts() public { + bytes32[] memory p2pIds = _makeBytes32Array(4, 0); + bytes[] memory signers = _makeBytesArray(4, 10); + bytes[] memory transmitters = _makeBytesArray(4, 20); + CCIPConfigTypes.OCR3Config[] memory cfgs = new CCIPConfigTypes.OCR3Config[](3); + for (uint256 i = 0; i < 3; i++) { + cfgs[i] = CCIPConfigTypes.OCR3Config({ + pluginType: Internal.OCRPluginType.Execution, + offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), + chainSelector: 1, + p2pIds: p2pIds, + signers: signers, + transmitters: transmitters, + F: 1, + offchainConfigVersion: 30, + offchainConfig: abi.encode("exec", i) + }); + } + vm.expectRevert(); + s_ccipCC.groupByPluginType(cfgs); + } + + function test__groupByPluginType_TooManyOCR3Configs_Reverts() public { + CCIPConfigTypes.OCR3Config[] memory cfgs = new CCIPConfigTypes.OCR3Config[](5); + vm.expectRevert(CCIPConfig.TooManyOCR3Configs.selector); + s_ccipCC.groupByPluginType(cfgs); + } + + function test__validateConfigTransition_InitToRunning_WrongConfigCount_Reverts() public { + uint32 donId = 1; + CCIPConfigTypes.OCR3Config memory blueConfig = CCIPConfigTypes.OCR3Config({ + pluginType: Internal.OCRPluginType.Commit, + offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), + chainSelector: 1, + p2pIds: _makeBytes32Array(4, 0), + signers: _makeBytesArray(4, 10), + transmitters: _makeBytesArray(4, 20), + F: 1, + offchainConfigVersion: 30, + offchainConfig: bytes("commit") + }); + + CCIPConfigTypes.OCR3ConfigWithMeta[] memory newConfig = new CCIPConfigTypes.OCR3ConfigWithMeta[](1); + newConfig[0] = CCIPConfigTypes.OCR3ConfigWithMeta({ + configCount: 0, + config: blueConfig, + configDigest: s_ccipCC.computeConfigDigest(donId, 1, blueConfig) + }); + CCIPConfigTypes.OCR3ConfigWithMeta[] memory currentConfig = new CCIPConfigTypes.OCR3ConfigWithMeta[](0); + + vm.expectRevert(abi.encodeWithSelector(CCIPConfig.WrongConfigCount.selector, 0, 1)); + s_ccipCC.validateConfigTransition(currentConfig, newConfig); + } + + function test__validateConfigTransition_RunningToStaging_WrongConfigDigestBlueGreen_Reverts() public { + uint32 donId = 1; + CCIPConfigTypes.OCR3Config memory blueConfig = CCIPConfigTypes.OCR3Config({ + pluginType: Internal.OCRPluginType.Commit, + offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), + chainSelector: 1, + p2pIds: _makeBytes32Array(4, 0), + signers: _makeBytesArray(4, 10), + transmitters: _makeBytesArray(4, 20), + F: 1, + offchainConfigVersion: 30, + offchainConfig: bytes("commit") + }); + CCIPConfigTypes.OCR3Config memory greenConfig = CCIPConfigTypes.OCR3Config({ + pluginType: Internal.OCRPluginType.Commit, + offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), + chainSelector: 1, + p2pIds: _makeBytes32Array(4, 0), + signers: _makeBytesArray(4, 10), + transmitters: _makeBytesArray(4, 20), + F: 1, + offchainConfigVersion: 30, + offchainConfig: bytes("commit-new") + }); + + CCIPConfigTypes.OCR3ConfigWithMeta[] memory currentConfig = new CCIPConfigTypes.OCR3ConfigWithMeta[](1); + currentConfig[0] = CCIPConfigTypes.OCR3ConfigWithMeta({ + configCount: 1, + config: blueConfig, + configDigest: s_ccipCC.computeConfigDigest(donId, 1, blueConfig) + }); + + CCIPConfigTypes.OCR3ConfigWithMeta[] memory newConfig = new CCIPConfigTypes.OCR3ConfigWithMeta[](2); + newConfig[0] = CCIPConfigTypes.OCR3ConfigWithMeta({ + configCount: 1, + config: blueConfig, + configDigest: s_ccipCC.computeConfigDigest(donId, 3, blueConfig) // wrong config digest (due to diff config count) + }); + newConfig[1] = CCIPConfigTypes.OCR3ConfigWithMeta({ + configCount: 2, + config: greenConfig, + configDigest: s_ccipCC.computeConfigDigest(donId, 2, greenConfig) + }); + + vm.expectRevert( + abi.encodeWithSelector( + CCIPConfig.WrongConfigDigestBlueGreen.selector, + s_ccipCC.computeConfigDigest(donId, 3, blueConfig), + s_ccipCC.computeConfigDigest(donId, 1, blueConfig) + ) + ); + s_ccipCC.validateConfigTransition(currentConfig, newConfig); + } + + function test__validateConfigTransition_RunningToStaging_WrongConfigCount_Reverts() public { + uint32 donId = 1; + CCIPConfigTypes.OCR3Config memory blueConfig = CCIPConfigTypes.OCR3Config({ + pluginType: Internal.OCRPluginType.Commit, + offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), + chainSelector: 1, + p2pIds: _makeBytes32Array(4, 0), + signers: _makeBytesArray(4, 10), + transmitters: _makeBytesArray(4, 20), + F: 1, + offchainConfigVersion: 30, + offchainConfig: bytes("commit") + }); + CCIPConfigTypes.OCR3Config memory greenConfig = CCIPConfigTypes.OCR3Config({ + pluginType: Internal.OCRPluginType.Commit, + offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), + chainSelector: 1, + p2pIds: _makeBytes32Array(4, 0), + signers: _makeBytesArray(4, 10), + transmitters: _makeBytesArray(4, 20), + F: 1, + offchainConfigVersion: 30, + offchainConfig: bytes("commit-new") + }); + + CCIPConfigTypes.OCR3ConfigWithMeta[] memory currentConfig = new CCIPConfigTypes.OCR3ConfigWithMeta[](1); + currentConfig[0] = CCIPConfigTypes.OCR3ConfigWithMeta({ + configCount: 1, + config: blueConfig, + configDigest: s_ccipCC.computeConfigDigest(donId, 1, blueConfig) + }); + + CCIPConfigTypes.OCR3ConfigWithMeta[] memory newConfig = new CCIPConfigTypes.OCR3ConfigWithMeta[](2); + newConfig[0] = CCIPConfigTypes.OCR3ConfigWithMeta({ + configCount: 1, + config: blueConfig, + configDigest: s_ccipCC.computeConfigDigest(donId, 1, blueConfig) + }); + newConfig[1] = CCIPConfigTypes.OCR3ConfigWithMeta({ + configCount: 3, // wrong config count + config: greenConfig, + configDigest: s_ccipCC.computeConfigDigest(donId, 3, greenConfig) + }); + + vm.expectRevert(abi.encodeWithSelector(CCIPConfig.WrongConfigCount.selector, 3, 2)); + s_ccipCC.validateConfigTransition(currentConfig, newConfig); + } + + function test__validateConfigTransition_StagingToRunning_WrongConfigDigest_Reverts() public { + uint32 donId = 1; + CCIPConfigTypes.OCR3Config memory blueConfig = CCIPConfigTypes.OCR3Config({ + pluginType: Internal.OCRPluginType.Commit, + offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), + chainSelector: 1, + p2pIds: _makeBytes32Array(4, 0), + signers: _makeBytesArray(4, 10), + transmitters: _makeBytesArray(4, 20), + F: 1, + offchainConfigVersion: 30, + offchainConfig: bytes("commit") + }); + CCIPConfigTypes.OCR3Config memory greenConfig = CCIPConfigTypes.OCR3Config({ + pluginType: Internal.OCRPluginType.Commit, + offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), + chainSelector: 1, + p2pIds: _makeBytes32Array(4, 0), + signers: _makeBytesArray(4, 10), + transmitters: _makeBytesArray(4, 20), + F: 1, + offchainConfigVersion: 30, + offchainConfig: bytes("commit-new") + }); + + CCIPConfigTypes.OCR3ConfigWithMeta[] memory currentConfig = new CCIPConfigTypes.OCR3ConfigWithMeta[](2); + currentConfig[0] = CCIPConfigTypes.OCR3ConfigWithMeta({ + configCount: 1, + config: blueConfig, + configDigest: s_ccipCC.computeConfigDigest(donId, 1, blueConfig) + }); + currentConfig[1] = CCIPConfigTypes.OCR3ConfigWithMeta({ + configCount: 2, + config: greenConfig, + configDigest: s_ccipCC.computeConfigDigest(donId, 2, greenConfig) + }); + + CCIPConfigTypes.OCR3ConfigWithMeta[] memory newConfig = new CCIPConfigTypes.OCR3ConfigWithMeta[](1); + newConfig[0] = CCIPConfigTypes.OCR3ConfigWithMeta({ + configCount: 2, + config: greenConfig, + configDigest: s_ccipCC.computeConfigDigest(donId, 3, greenConfig) // wrong config digest + }); + + vm.expectRevert( + abi.encodeWithSelector( + CCIPConfig.WrongConfigDigest.selector, + s_ccipCC.computeConfigDigest(donId, 3, greenConfig), + s_ccipCC.computeConfigDigest(donId, 2, greenConfig) + ) + ); + s_ccipCC.validateConfigTransition(currentConfig, newConfig); + } + + function test__validateConfigTransition_NonExistentConfigTransition_Reverts() public { + CCIPConfigTypes.OCR3ConfigWithMeta[] memory currentConfig = new CCIPConfigTypes.OCR3ConfigWithMeta[](3); + CCIPConfigTypes.OCR3ConfigWithMeta[] memory newConfig = new CCIPConfigTypes.OCR3ConfigWithMeta[](1); + vm.expectRevert(CCIPConfig.NonExistentConfigTransition.selector); + s_ccipCC.validateConfigTransition(currentConfig, newConfig); + } +} + +contract CCIPConfig_updatePluginConfig is CCIPConfigSetup { + // Successes. + + function test__updatePluginConfig_InitToRunning_Success() public { + (bytes32[] memory p2pIds, bytes[] memory signers, bytes[] memory transmitters) = _addChainConfig(4); + uint32 donId = 1; + CCIPConfigTypes.OCR3Config memory blueConfig = CCIPConfigTypes.OCR3Config({ + pluginType: Internal.OCRPluginType.Commit, + offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), + chainSelector: 1, + p2pIds: p2pIds, + signers: signers, + transmitters: transmitters, + F: 1, + offchainConfigVersion: 30, + offchainConfig: bytes("commit") + }); + CCIPConfigTypes.OCR3Config[] memory configs = new CCIPConfigTypes.OCR3Config[](1); + configs[0] = blueConfig; + + s_ccipCC.updatePluginConfig(donId, Internal.OCRPluginType.Commit, configs); + + // should see the updated config in the contract state. + CCIPConfigTypes.OCR3ConfigWithMeta[] memory storedConfig = + s_ccipCC.getOCRConfig(donId, Internal.OCRPluginType.Commit); + assertEq(storedConfig.length, 1, "don config length must be 1"); + assertEq(storedConfig[0].configCount, uint64(1), "config count must be 1"); + assertEq(uint256(storedConfig[0].config.pluginType), uint256(blueConfig.pluginType), "plugin type must match"); + } + + function test__updatePluginConfig_RunningToStaging_Success() public { + (bytes32[] memory p2pIds, bytes[] memory signers, bytes[] memory transmitters) = _addChainConfig(4); + // add blue config. + uint32 donId = 1; + CCIPConfigTypes.OCR3Config memory blueConfig = CCIPConfigTypes.OCR3Config({ + pluginType: Internal.OCRPluginType.Commit, + offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), + chainSelector: 1, + p2pIds: p2pIds, + signers: signers, + transmitters: transmitters, + F: 1, + offchainConfigVersion: 30, + offchainConfig: bytes("commit") + }); + CCIPConfigTypes.OCR3Config[] memory startConfigs = new CCIPConfigTypes.OCR3Config[](1); + startConfigs[0] = blueConfig; + + // add blue AND green config to indicate an update. + s_ccipCC.updatePluginConfig(donId, Internal.OCRPluginType.Commit, startConfigs); + CCIPConfigTypes.OCR3Config memory greenConfig = CCIPConfigTypes.OCR3Config({ + pluginType: Internal.OCRPluginType.Commit, + offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), + chainSelector: 1, + p2pIds: p2pIds, + signers: signers, + transmitters: transmitters, + F: 1, + offchainConfigVersion: 30, + offchainConfig: bytes("commit-new") + }); + CCIPConfigTypes.OCR3Config[] memory blueAndGreen = new CCIPConfigTypes.OCR3Config[](2); + blueAndGreen[0] = blueConfig; + blueAndGreen[1] = greenConfig; + + s_ccipCC.updatePluginConfig(donId, Internal.OCRPluginType.Commit, blueAndGreen); + + // should see the updated config in the contract state. + CCIPConfigTypes.OCR3ConfigWithMeta[] memory storedConfig = + s_ccipCC.getOCRConfig(donId, Internal.OCRPluginType.Commit); + assertEq(storedConfig.length, 2, "don config length must be 2"); + // 0 index is blue config, 1 index is green config. + assertEq(storedConfig[1].configCount, uint64(2), "config count must be 2"); + assertEq( + uint256(storedConfig[0].config.pluginType), uint256(Internal.OCRPluginType.Commit), "plugin type must match" + ); + assertEq( + uint256(storedConfig[1].config.pluginType), uint256(Internal.OCRPluginType.Commit), "plugin type must match" + ); + assertEq(storedConfig[0].config.offchainConfig, bytes("commit"), "blue offchain config must match"); + assertEq(storedConfig[1].config.offchainConfig, bytes("commit-new"), "green offchain config must match"); + } + + function test__updatePluginConfig_StagingToRunning_Success() public { + (bytes32[] memory p2pIds, bytes[] memory signers, bytes[] memory transmitters) = _addChainConfig(4); + // add blue config. + uint32 donId = 1; + CCIPConfigTypes.OCR3Config memory blueConfig = CCIPConfigTypes.OCR3Config({ + pluginType: Internal.OCRPluginType.Commit, + offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), + chainSelector: 1, + p2pIds: p2pIds, + signers: signers, + transmitters: transmitters, + F: 1, + offchainConfigVersion: 30, + offchainConfig: bytes("commit") + }); + CCIPConfigTypes.OCR3Config[] memory startConfigs = new CCIPConfigTypes.OCR3Config[](1); + startConfigs[0] = blueConfig; + + // add blue AND green config to indicate an update. + s_ccipCC.updatePluginConfig(donId, Internal.OCRPluginType.Commit, startConfigs); + CCIPConfigTypes.OCR3Config memory greenConfig = CCIPConfigTypes.OCR3Config({ + pluginType: Internal.OCRPluginType.Commit, + offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), + chainSelector: 1, + p2pIds: p2pIds, + signers: signers, + transmitters: transmitters, + F: 1, + offchainConfigVersion: 30, + offchainConfig: bytes("commit-new") + }); + CCIPConfigTypes.OCR3Config[] memory blueAndGreen = new CCIPConfigTypes.OCR3Config[](2); + blueAndGreen[0] = blueConfig; + blueAndGreen[1] = greenConfig; + + s_ccipCC.updatePluginConfig(donId, Internal.OCRPluginType.Commit, blueAndGreen); + + // should see the updated config in the contract state. + CCIPConfigTypes.OCR3ConfigWithMeta[] memory storedConfig = + s_ccipCC.getOCRConfig(donId, Internal.OCRPluginType.Commit); + assertEq(storedConfig.length, 2, "don config length must be 2"); + // 0 index is blue config, 1 index is green config. + assertEq(storedConfig[1].configCount, uint64(2), "config count must be 2"); + assertEq( + uint256(storedConfig[0].config.pluginType), uint256(Internal.OCRPluginType.Commit), "plugin type must match" + ); + assertEq( + uint256(storedConfig[1].config.pluginType), uint256(Internal.OCRPluginType.Commit), "plugin type must match" + ); + assertEq(storedConfig[0].config.offchainConfig, bytes("commit"), "blue offchain config must match"); + assertEq(storedConfig[1].config.offchainConfig, bytes("commit-new"), "green offchain config must match"); + + // promote green to blue. + CCIPConfigTypes.OCR3Config[] memory promote = new CCIPConfigTypes.OCR3Config[](1); + promote[0] = greenConfig; + + s_ccipCC.updatePluginConfig(donId, Internal.OCRPluginType.Commit, promote); + + // should see the updated config in the contract state. + storedConfig = s_ccipCC.getOCRConfig(donId, Internal.OCRPluginType.Commit); + assertEq(storedConfig.length, 1, "don config length must be 1"); + assertEq(storedConfig[0].configCount, uint64(2), "config count must be 2"); + assertEq( + uint256(storedConfig[0].config.pluginType), uint256(Internal.OCRPluginType.Commit), "plugin type must match" + ); + assertEq(storedConfig[0].config.offchainConfig, bytes("commit-new"), "green offchain config must match"); + } + + // Reverts. + function test__updatePluginConfig_InvalidConfigLength_Reverts() public { + uint32 donId = 1; + CCIPConfigTypes.OCR3Config[] memory newConfig = new CCIPConfigTypes.OCR3Config[](3); + vm.expectRevert(abi.encodeWithSelector(CCIPConfig.InvalidConfigLength.selector, uint256(3))); + s_ccipCC.updatePluginConfig(donId, Internal.OCRPluginType.Commit, newConfig); + } + + function test__updatePluginConfig_InvalidConfigStateTransition_Reverts() public { + uint32 donId = 1; + CCIPConfigTypes.OCR3Config[] memory newConfig = new CCIPConfigTypes.OCR3Config[](2); + // 0 -> 2 is an invalid state transition. + vm.expectRevert(abi.encodeWithSelector(CCIPConfig.InvalidConfigStateTransition.selector, 0, 2)); + s_ccipCC.updatePluginConfig(donId, Internal.OCRPluginType.Commit, newConfig); + } +} + +contract CCIPConfig_beforeCapabilityConfigSet is CCIPConfigSetup { + // Successes. + function test_beforeCapabilityConfigSet_ZeroLengthConfig_Success() public { + changePrank(CAPABILITIES_REGISTRY); + + CCIPConfigTypes.OCR3Config[] memory configs = new CCIPConfigTypes.OCR3Config[](0); + bytes memory encodedConfigs = abi.encode(configs); + s_ccipCC.beforeCapabilityConfigSet(new bytes32[](0), encodedConfigs, 1, 1); + } + + function test_beforeCapabilityConfigSet_CommitConfigOnly_Success() public { + (bytes32[] memory p2pIds, bytes[] memory signers, bytes[] memory transmitters) = _addChainConfig(4); + changePrank(CAPABILITIES_REGISTRY); + + uint32 donId = 1; + CCIPConfigTypes.OCR3Config memory blueConfig = CCIPConfigTypes.OCR3Config({ + pluginType: Internal.OCRPluginType.Commit, + offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), + chainSelector: 1, + p2pIds: p2pIds, + signers: signers, + transmitters: transmitters, + F: 1, + offchainConfigVersion: 30, + offchainConfig: bytes("commit") + }); + CCIPConfigTypes.OCR3Config[] memory configs = new CCIPConfigTypes.OCR3Config[](1); + configs[0] = blueConfig; + + bytes memory encoded = abi.encode(configs); + s_ccipCC.beforeCapabilityConfigSet(new bytes32[](0), encoded, 1, donId); + + CCIPConfigTypes.OCR3ConfigWithMeta[] memory storedConfigs = + s_ccipCC.getOCRConfig(donId, Internal.OCRPluginType.Commit); + assertEq(storedConfigs.length, 1, "config length must be 1"); + assertEq(storedConfigs[0].configCount, uint64(1), "config count must be 1"); + assertEq( + uint256(storedConfigs[0].config.pluginType), uint256(Internal.OCRPluginType.Commit), "plugin type must be commit" + ); + } + + function test_beforeCapabilityConfigSet_ExecConfigOnly_Success() public { + (bytes32[] memory p2pIds, bytes[] memory signers, bytes[] memory transmitters) = _addChainConfig(4); + changePrank(CAPABILITIES_REGISTRY); + + uint32 donId = 1; + CCIPConfigTypes.OCR3Config memory blueConfig = CCIPConfigTypes.OCR3Config({ + pluginType: Internal.OCRPluginType.Execution, + offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), + chainSelector: 1, + p2pIds: p2pIds, + signers: signers, + transmitters: transmitters, + F: 1, + offchainConfigVersion: 30, + offchainConfig: bytes("exec") + }); + CCIPConfigTypes.OCR3Config[] memory configs = new CCIPConfigTypes.OCR3Config[](1); + configs[0] = blueConfig; + + bytes memory encoded = abi.encode(configs); + s_ccipCC.beforeCapabilityConfigSet(new bytes32[](0), encoded, 1, donId); + + CCIPConfigTypes.OCR3ConfigWithMeta[] memory storedConfigs = + s_ccipCC.getOCRConfig(donId, Internal.OCRPluginType.Execution); + assertEq(storedConfigs.length, 1, "config length must be 1"); + assertEq(storedConfigs[0].configCount, uint64(1), "config count must be 1"); + assertEq( + uint256(storedConfigs[0].config.pluginType), + uint256(Internal.OCRPluginType.Execution), + "plugin type must be execution" + ); + } + + function test_beforeCapabilityConfigSet_CommitAndExecConfig_Success() public { + (bytes32[] memory p2pIds, bytes[] memory signers, bytes[] memory transmitters) = _addChainConfig(4); + changePrank(CAPABILITIES_REGISTRY); + + uint32 donId = 1; + CCIPConfigTypes.OCR3Config memory blueCommitConfig = CCIPConfigTypes.OCR3Config({ + pluginType: Internal.OCRPluginType.Commit, + offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), + chainSelector: 1, + p2pIds: p2pIds, + signers: signers, + transmitters: transmitters, + F: 1, + offchainConfigVersion: 30, + offchainConfig: bytes("commit") + }); + CCIPConfigTypes.OCR3Config memory blueExecConfig = CCIPConfigTypes.OCR3Config({ + pluginType: Internal.OCRPluginType.Execution, + offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), + chainSelector: 1, + p2pIds: p2pIds, + signers: signers, + transmitters: transmitters, + F: 1, + offchainConfigVersion: 30, + offchainConfig: bytes("exec") + }); + CCIPConfigTypes.OCR3Config[] memory configs = new CCIPConfigTypes.OCR3Config[](2); + configs[0] = blueExecConfig; + configs[1] = blueCommitConfig; + + bytes memory encoded = abi.encode(configs); + s_ccipCC.beforeCapabilityConfigSet(new bytes32[](0), encoded, 1, donId); + + CCIPConfigTypes.OCR3ConfigWithMeta[] memory storedExecConfigs = + s_ccipCC.getOCRConfig(donId, Internal.OCRPluginType.Execution); + assertEq(storedExecConfigs.length, 1, "config length must be 1"); + assertEq(storedExecConfigs[0].configCount, uint64(1), "config count must be 1"); + assertEq( + uint256(storedExecConfigs[0].config.pluginType), + uint256(Internal.OCRPluginType.Execution), + "plugin type must be execution" + ); + + CCIPConfigTypes.OCR3ConfigWithMeta[] memory storedCommitConfigs = + s_ccipCC.getOCRConfig(donId, Internal.OCRPluginType.Commit); + assertEq(storedCommitConfigs.length, 1, "config length must be 1"); + assertEq(storedCommitConfigs[0].configCount, uint64(1), "config count must be 1"); + assertEq( + uint256(storedCommitConfigs[0].config.pluginType), + uint256(Internal.OCRPluginType.Commit), + "plugin type must be commit" + ); + } + + // Reverts. + + function test_beforeCapabilityConfigSet_OnlyCapabilitiesRegistryCanCall_Reverts() public { + bytes32[] memory nodes = new bytes32[](0); + bytes memory config = bytes(""); + uint64 configCount = 1; + uint32 donId = 1; + vm.expectRevert(CCIPConfig.OnlyCapabilitiesRegistryCanCall.selector); + s_ccipCC.beforeCapabilityConfigSet(nodes, config, configCount, donId); + } +} diff --git a/contracts/src/v0.8/ccip/test/commitStore/CommitStore.t.sol b/contracts/src/v0.8/ccip/test/commitStore/CommitStore.t.sol new file mode 100644 index 00000000000..0976ab96c5e --- /dev/null +++ b/contracts/src/v0.8/ccip/test/commitStore/CommitStore.t.sol @@ -0,0 +1,615 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {IPriceRegistry} from "../../interfaces/IPriceRegistry.sol"; +import {IRMN} from "../../interfaces/IRMN.sol"; + +import {AuthorizedCallers} from "../../../shared/access/AuthorizedCallers.sol"; +import {CommitStore} from "../../CommitStore.sol"; +import {FeeQuoter} from "../../FeeQuoter.sol"; +import {RMN} from "../../RMN.sol"; +import {MerkleMultiProof} from "../../libraries/MerkleMultiProof.sol"; +import {OCR2Abstract} from "../../ocr/OCR2Abstract.sol"; +import {FeeQuoterSetup} from "../feeQuoter/FeeQuoterSetup.t.sol"; +import {CommitStoreHelper} from "../helpers/CommitStoreHelper.sol"; +import {OCR2BaseSetup} from "../ocr/OCR2Base.t.sol"; + +contract CommitStoreSetup is FeeQuoterSetup, OCR2BaseSetup { + CommitStoreHelper internal s_commitStore; + + function setUp() public virtual override(FeeQuoterSetup, OCR2BaseSetup) { + FeeQuoterSetup.setUp(); + OCR2BaseSetup.setUp(); + + s_commitStore = new CommitStoreHelper( + CommitStore.StaticConfig({ + chainSelector: DEST_CHAIN_SELECTOR, + sourceChainSelector: SOURCE_CHAIN_SELECTOR, + onRamp: ON_RAMP_ADDRESS, + rmnProxy: address(s_mockRMN) + }) + ); + CommitStore.DynamicConfig memory dynamicConfig = CommitStore.DynamicConfig({priceRegistry: address(s_feeQuoter)}); + s_commitStore.setOCR2Config( + s_valid_signers, s_valid_transmitters, s_f, abi.encode(dynamicConfig), s_offchainConfigVersion, abi.encode("") + ); + + address[] memory priceUpdaters = new address[](1); + priceUpdaters[0] = address(s_commitStore); + s_feeQuoter.applyAuthorizedCallerUpdates( + AuthorizedCallers.AuthorizedCallerArgs({addedCallers: priceUpdaters, removedCallers: new address[](0)}) + ); + } +} + +contract CommitStoreRealRMNSetup is FeeQuoterSetup, OCR2BaseSetup { + CommitStoreHelper internal s_commitStore; + + RMN internal s_rmn; + + address internal constant BLESS_VOTE_ADDR = address(8888); + + function setUp() public virtual override(FeeQuoterSetup, OCR2BaseSetup) { + FeeQuoterSetup.setUp(); + OCR2BaseSetup.setUp(); + + RMN.Voter[] memory voters = new RMN.Voter[](1); + voters[0] = + RMN.Voter({blessVoteAddr: BLESS_VOTE_ADDR, curseVoteAddr: address(9999), blessWeight: 1, curseWeight: 1}); + // Overwrite base mock rmn with real. + s_rmn = new RMN(RMN.Config({voters: voters, blessWeightThreshold: 1, curseWeightThreshold: 1})); + s_commitStore = new CommitStoreHelper( + CommitStore.StaticConfig({ + chainSelector: DEST_CHAIN_SELECTOR, + sourceChainSelector: SOURCE_CHAIN_SELECTOR, + onRamp: ON_RAMP_ADDRESS, + rmnProxy: address(s_rmn) + }) + ); + CommitStore.DynamicConfig memory dynamicConfig = CommitStore.DynamicConfig({priceRegistry: address(s_feeQuoter)}); + s_commitStore.setOCR2Config( + s_valid_signers, s_valid_transmitters, s_f, abi.encode(dynamicConfig), s_offchainConfigVersion, abi.encode("") + ); + } +} + +contract CommitStore_constructor is FeeQuoterSetup, OCR2BaseSetup { + function setUp() public virtual override(FeeQuoterSetup, OCR2BaseSetup) { + FeeQuoterSetup.setUp(); + OCR2BaseSetup.setUp(); + } + + function test_Constructor_Success() public { + CommitStore.StaticConfig memory staticConfig = CommitStore.StaticConfig({ + chainSelector: DEST_CHAIN_SELECTOR, + sourceChainSelector: SOURCE_CHAIN_SELECTOR, + onRamp: 0x2C44CDDdB6a900Fa2B585dd299E03D12Fa4293Bc, + rmnProxy: address(s_mockRMN) + }); + CommitStore.DynamicConfig memory dynamicConfig = CommitStore.DynamicConfig({priceRegistry: address(s_feeQuoter)}); + + vm.expectEmit(); + emit CommitStore.ConfigSet(staticConfig, dynamicConfig); + + CommitStore commitStore = new CommitStore(staticConfig); + commitStore.setOCR2Config( + s_valid_signers, s_valid_transmitters, s_f, abi.encode(dynamicConfig), s_offchainConfigVersion, abi.encode("") + ); + + CommitStore.StaticConfig memory gotStaticConfig = commitStore.getStaticConfig(); + + assertEq(staticConfig.chainSelector, gotStaticConfig.chainSelector); + assertEq(staticConfig.sourceChainSelector, gotStaticConfig.sourceChainSelector); + assertEq(staticConfig.onRamp, gotStaticConfig.onRamp); + assertEq(staticConfig.rmnProxy, gotStaticConfig.rmnProxy); + + CommitStore.DynamicConfig memory gotDynamicConfig = commitStore.getDynamicConfig(); + + assertEq(dynamicConfig.priceRegistry, gotDynamicConfig.priceRegistry); + + // CommitStore initial values + assertEq(0, commitStore.getLatestPriceEpochAndRound()); + assertEq(1, commitStore.getExpectedNextSequenceNumber()); + assertEq(commitStore.typeAndVersion(), "CommitStore 1.5.0"); + assertEq(OWNER, commitStore.owner()); + assertTrue(commitStore.isUnpausedAndNotCursed()); + } +} + +contract CommitStore_setMinSeqNr is CommitStoreSetup { + function test_Fuzz_SetMinSeqNr_Success(uint64 minSeqNr) public { + vm.expectEmit(); + emit CommitStore.SequenceNumberSet(s_commitStore.getExpectedNextSequenceNumber(), minSeqNr); + + s_commitStore.setMinSeqNr(minSeqNr); + + assertEq(s_commitStore.getExpectedNextSequenceNumber(), minSeqNr); + } + + // Reverts + function test_OnlyOwner_Revert() public { + vm.stopPrank(); + vm.expectRevert("Only callable by owner"); + s_commitStore.setMinSeqNr(6723); + } +} + +contract CommitStore_setDynamicConfig is CommitStoreSetup { + function test_Fuzz_SetDynamicConfig_Success(address priceRegistry) public { + vm.assume(priceRegistry != address(0)); + CommitStore.StaticConfig memory staticConfig = s_commitStore.getStaticConfig(); + CommitStore.DynamicConfig memory dynamicConfig = CommitStore.DynamicConfig({priceRegistry: priceRegistry}); + bytes memory onchainConfig = abi.encode(dynamicConfig); + + vm.expectEmit(); + emit CommitStore.ConfigSet(staticConfig, dynamicConfig); + + uint32 configCount = 1; + + vm.expectEmit(); + emit OCR2Abstract.ConfigSet( + uint32(block.number), + getBasicConfigDigest(address(s_commitStore), s_f, configCount, onchainConfig), + configCount + 1, + s_valid_signers, + s_valid_transmitters, + s_f, + onchainConfig, + s_offchainConfigVersion, + abi.encode("") + ); + + s_commitStore.setOCR2Config( + s_valid_signers, s_valid_transmitters, s_f, onchainConfig, s_offchainConfigVersion, abi.encode("") + ); + + CommitStore.DynamicConfig memory gotDynamicConfig = s_commitStore.getDynamicConfig(); + assertEq(gotDynamicConfig.priceRegistry, dynamicConfig.priceRegistry); + } + + function test_PriceEpochCleared_Success() public { + // Set latest price epoch and round to non-zero. + uint40 latestEpochAndRound = 1782155; + s_commitStore.setLatestPriceEpochAndRound(latestEpochAndRound); + assertEq(latestEpochAndRound, s_commitStore.getLatestPriceEpochAndRound()); + + CommitStore.DynamicConfig memory dynamicConfig = CommitStore.DynamicConfig({priceRegistry: address(1)}); + // New config should clear it. + s_commitStore.setOCR2Config( + s_valid_signers, s_valid_transmitters, s_f, abi.encode(dynamicConfig), s_offchainConfigVersion, abi.encode("") + ); + // Assert cleared. + assertEq(0, s_commitStore.getLatestPriceEpochAndRound()); + } + + // Reverts + function test_OnlyOwner_Revert() public { + CommitStore.DynamicConfig memory dynamicConfig = CommitStore.DynamicConfig({priceRegistry: address(23784264)}); + + vm.stopPrank(); + vm.expectRevert("Only callable by owner"); + s_commitStore.setOCR2Config( + s_valid_signers, s_valid_transmitters, s_f, abi.encode(dynamicConfig), s_offchainConfigVersion, abi.encode("") + ); + } + + function test_InvalidCommitStoreConfig_Revert() public { + CommitStore.DynamicConfig memory dynamicConfig = CommitStore.DynamicConfig({priceRegistry: address(0)}); + + vm.expectRevert(CommitStore.InvalidCommitStoreConfig.selector); + s_commitStore.setOCR2Config( + s_valid_signers, s_valid_transmitters, s_f, abi.encode(dynamicConfig), s_offchainConfigVersion, abi.encode("") + ); + } +} + +contract CommitStore_resetUnblessedRoots is CommitStoreRealRMNSetup { + function test_ResetUnblessedRoots_Success() public { + bytes32[] memory rootsToReset = new bytes32[](3); + rootsToReset[0] = "1"; + rootsToReset[1] = "2"; + rootsToReset[2] = "3"; + + CommitStore.CommitReport memory report = CommitStore.CommitReport({ + priceUpdates: _getEmptyPriceUpdates(), + interval: CommitStore.Interval(1, 2), + merkleRoot: rootsToReset[0] + }); + + s_commitStore.report(abi.encode(report), ++s_latestEpochAndRound); + + report = CommitStore.CommitReport({ + priceUpdates: _getEmptyPriceUpdates(), + interval: CommitStore.Interval(3, 4), + merkleRoot: rootsToReset[1] + }); + + s_commitStore.report(abi.encode(report), ++s_latestEpochAndRound); + + report = CommitStore.CommitReport({ + priceUpdates: _getEmptyPriceUpdates(), + interval: CommitStore.Interval(5, 5), + merkleRoot: rootsToReset[2] + }); + + s_commitStore.report(abi.encode(report), ++s_latestEpochAndRound); + + IRMN.TaggedRoot[] memory blessedTaggedRoots = new IRMN.TaggedRoot[](1); + blessedTaggedRoots[0] = IRMN.TaggedRoot({commitStore: address(s_commitStore), root: rootsToReset[1]}); + + vm.startPrank(BLESS_VOTE_ADDR); + s_rmn.voteToBless(blessedTaggedRoots); + + vm.expectEmit(false, false, false, true); + emit CommitStore.RootRemoved(rootsToReset[0]); + + vm.expectEmit(false, false, false, true); + emit CommitStore.RootRemoved(rootsToReset[2]); + + vm.startPrank(OWNER); + s_commitStore.resetUnblessedRoots(rootsToReset); + + assertEq(0, s_commitStore.getMerkleRoot(rootsToReset[0])); + assertEq(BLOCK_TIME, s_commitStore.getMerkleRoot(rootsToReset[1])); + assertEq(0, s_commitStore.getMerkleRoot(rootsToReset[2])); + } + + // Reverts + + function test_OnlyOwner_Revert() public { + vm.stopPrank(); + vm.expectRevert("Only callable by owner"); + bytes32[] memory rootToReset; + s_commitStore.resetUnblessedRoots(rootToReset); + } +} + +contract CommitStore_report is CommitStoreSetup { + function test_ReportOnlyRootSuccess_gas() public { + vm.pauseGasMetering(); + uint64 max1 = 931; + bytes32 root = "Only a single root"; + CommitStore.CommitReport memory report = CommitStore.CommitReport({ + priceUpdates: _getEmptyPriceUpdates(), + interval: CommitStore.Interval(1, max1), + merkleRoot: root + }); + + vm.expectEmit(); + emit CommitStore.ReportAccepted(report); + + bytes memory encodedReport = abi.encode(report); + + vm.resumeGasMetering(); + s_commitStore.report(encodedReport, ++s_latestEpochAndRound); + vm.pauseGasMetering(); + + assertEq(max1 + 1, s_commitStore.getExpectedNextSequenceNumber()); + assertEq(block.timestamp, s_commitStore.getMerkleRoot(root)); + vm.resumeGasMetering(); + } + + function test_ReportAndPriceUpdate_Success() public { + uint64 max1 = 12; + + CommitStore.CommitReport memory report = CommitStore.CommitReport({ + priceUpdates: _getSingleTokenPriceUpdateStruct(s_sourceFeeToken, 4e18), + interval: CommitStore.Interval(1, max1), + merkleRoot: "test #2" + }); + + vm.expectEmit(); + emit CommitStore.ReportAccepted(report); + + s_commitStore.report(abi.encode(report), ++s_latestEpochAndRound); + + assertEq(max1 + 1, s_commitStore.getExpectedNextSequenceNumber()); + assertEq(s_latestEpochAndRound, s_commitStore.getLatestPriceEpochAndRound()); + } + + function test_StaleReportWithRoot_Success() public { + uint64 maxSeq = 12; + uint224 tokenStartPrice = + IPriceRegistry(s_commitStore.getDynamicConfig().priceRegistry).getTokenPrice(s_sourceFeeToken).value; + + CommitStore.CommitReport memory report = CommitStore.CommitReport({ + priceUpdates: _getSingleTokenPriceUpdateStruct(s_sourceFeeToken, 4e18), + interval: CommitStore.Interval(1, maxSeq), + merkleRoot: "stale report 1" + }); + + vm.expectEmit(); + emit CommitStore.ReportAccepted(report); + + s_commitStore.report(abi.encode(report), s_latestEpochAndRound); + assertEq(maxSeq + 1, s_commitStore.getExpectedNextSequenceNumber()); + assertEq(s_latestEpochAndRound, s_commitStore.getLatestPriceEpochAndRound()); + + report = CommitStore.CommitReport({ + priceUpdates: _getEmptyPriceUpdates(), + interval: CommitStore.Interval(maxSeq + 1, maxSeq * 2), + merkleRoot: "stale report 2" + }); + + vm.expectEmit(); + emit CommitStore.ReportAccepted(report); + + s_commitStore.report(abi.encode(report), s_latestEpochAndRound); + assertEq(maxSeq * 2 + 1, s_commitStore.getExpectedNextSequenceNumber()); + assertEq(s_latestEpochAndRound, s_commitStore.getLatestPriceEpochAndRound()); + assertEq( + tokenStartPrice, + IPriceRegistry(s_commitStore.getDynamicConfig().priceRegistry).getTokenPrice(s_sourceFeeToken).value + ); + } + + function test_OnlyTokenPriceUpdates_Success() public { + CommitStore.CommitReport memory report = CommitStore.CommitReport({ + priceUpdates: _getSingleTokenPriceUpdateStruct(s_sourceFeeToken, 4e18), + interval: CommitStore.Interval(0, 0), + merkleRoot: "" + }); + + vm.expectEmit(); + emit FeeQuoter.UsdPerTokenUpdated(s_sourceFeeToken, 4e18, block.timestamp); + + s_commitStore.report(abi.encode(report), ++s_latestEpochAndRound); + assertEq(s_latestEpochAndRound, s_commitStore.getLatestPriceEpochAndRound()); + } + + function test_OnlyGasPriceUpdates_Success() public { + CommitStore.CommitReport memory report = CommitStore.CommitReport({ + priceUpdates: _getSingleTokenPriceUpdateStruct(s_sourceFeeToken, 4e18), + interval: CommitStore.Interval(0, 0), + merkleRoot: "" + }); + + vm.expectEmit(); + emit FeeQuoter.UsdPerTokenUpdated(s_sourceFeeToken, 4e18, block.timestamp); + + s_commitStore.report(abi.encode(report), ++s_latestEpochAndRound); + assertEq(s_latestEpochAndRound, s_commitStore.getLatestPriceEpochAndRound()); + } + + function test_ValidPriceUpdateThenStaleReportWithRoot_Success() public { + uint64 maxSeq = 12; + uint224 tokenPrice1 = 4e18; + uint224 tokenPrice2 = 5e18; + + CommitStore.CommitReport memory report = CommitStore.CommitReport({ + priceUpdates: _getSingleTokenPriceUpdateStruct(s_sourceFeeToken, tokenPrice1), + interval: CommitStore.Interval(0, 0), + merkleRoot: "" + }); + + vm.expectEmit(); + emit FeeQuoter.UsdPerTokenUpdated(s_sourceFeeToken, tokenPrice1, block.timestamp); + + s_commitStore.report(abi.encode(report), ++s_latestEpochAndRound); + assertEq(s_latestEpochAndRound, s_commitStore.getLatestPriceEpochAndRound()); + + report = CommitStore.CommitReport({ + priceUpdates: _getSingleTokenPriceUpdateStruct(s_sourceFeeToken, tokenPrice2), + interval: CommitStore.Interval(1, maxSeq), + merkleRoot: "stale report" + }); + + vm.expectEmit(); + emit CommitStore.ReportAccepted(report); + + s_commitStore.report(abi.encode(report), s_latestEpochAndRound); + + assertEq(maxSeq + 1, s_commitStore.getExpectedNextSequenceNumber()); + assertEq( + tokenPrice1, IPriceRegistry(s_commitStore.getDynamicConfig().priceRegistry).getTokenPrice(s_sourceFeeToken).value + ); + assertEq(s_latestEpochAndRound, s_commitStore.getLatestPriceEpochAndRound()); + } + + // Reverts + + function test_Paused_Revert() public { + s_commitStore.pause(); + bytes memory report; + vm.expectRevert(CommitStore.PausedError.selector); + s_commitStore.report(report, ++s_latestEpochAndRound); + } + + function test_Unhealthy_Revert() public { + s_mockRMN.setGlobalCursed(true); + vm.expectRevert(CommitStore.CursedByRMN.selector); + bytes memory report; + s_commitStore.report(report, ++s_latestEpochAndRound); + } + + function test_InvalidRootRevert() public { + CommitStore.CommitReport memory report = CommitStore.CommitReport({ + priceUpdates: _getEmptyPriceUpdates(), + interval: CommitStore.Interval(1, 4), + merkleRoot: bytes32(0) + }); + + vm.expectRevert(CommitStore.InvalidRoot.selector); + s_commitStore.report(abi.encode(report), ++s_latestEpochAndRound); + } + + function test_InvalidInterval_Revert() public { + CommitStore.Interval memory interval = CommitStore.Interval(2, 2); + CommitStore.CommitReport memory report = + CommitStore.CommitReport({priceUpdates: _getEmptyPriceUpdates(), interval: interval, merkleRoot: bytes32(0)}); + + vm.expectRevert(abi.encodeWithSelector(CommitStore.InvalidInterval.selector, interval)); + + s_commitStore.report(abi.encode(report), ++s_latestEpochAndRound); + } + + function test_InvalidIntervalMinLargerThanMax_Revert() public { + CommitStore.Interval memory interval = CommitStore.Interval(1, 0); + CommitStore.CommitReport memory report = + CommitStore.CommitReport({priceUpdates: _getEmptyPriceUpdates(), interval: interval, merkleRoot: bytes32(0)}); + + vm.expectRevert(abi.encodeWithSelector(CommitStore.InvalidInterval.selector, interval)); + + s_commitStore.report(abi.encode(report), ++s_latestEpochAndRound); + } + + function test_ZeroEpochAndRound_Revert() public { + CommitStore.CommitReport memory report = CommitStore.CommitReport({ + priceUpdates: _getSingleTokenPriceUpdateStruct(s_sourceFeeToken, 4e18), + interval: CommitStore.Interval(0, 0), + merkleRoot: bytes32(0) + }); + + vm.expectRevert(CommitStore.StaleReport.selector); + + s_commitStore.report(abi.encode(report), 0); + } + + function test_OnlyPriceUpdateStaleReport_Revert() public { + CommitStore.CommitReport memory report = CommitStore.CommitReport({ + priceUpdates: _getSingleTokenPriceUpdateStruct(s_sourceFeeToken, 4e18), + interval: CommitStore.Interval(0, 0), + merkleRoot: bytes32(0) + }); + + vm.expectEmit(); + emit FeeQuoter.UsdPerTokenUpdated(s_sourceFeeToken, 4e18, block.timestamp); + s_commitStore.report(abi.encode(report), ++s_latestEpochAndRound); + + vm.expectRevert(CommitStore.StaleReport.selector); + s_commitStore.report(abi.encode(report), s_latestEpochAndRound); + } + + function test_RootAlreadyCommitted_Revert() public { + CommitStore.CommitReport memory report = CommitStore.CommitReport({ + priceUpdates: _getEmptyPriceUpdates(), + interval: CommitStore.Interval(1, 2), + merkleRoot: "Only a single root" + }); + s_commitStore.report(abi.encode(report), ++s_latestEpochAndRound); + + report = CommitStore.CommitReport({ + priceUpdates: _getEmptyPriceUpdates(), + interval: CommitStore.Interval(3, 3), + merkleRoot: "Only a single root" + }); + + vm.expectRevert(CommitStore.RootAlreadyCommitted.selector); + + s_commitStore.report(abi.encode(report), ++s_latestEpochAndRound); + } +} + +contract CommitStore_verify is CommitStoreRealRMNSetup { + function test_NotBlessed_Success() public { + bytes32[] memory leaves = new bytes32[](1); + leaves[0] = "root"; + s_commitStore.report( + abi.encode( + CommitStore.CommitReport({ + priceUpdates: _getEmptyPriceUpdates(), + interval: CommitStore.Interval(1, 2), + merkleRoot: leaves[0] + }) + ), + ++s_latestEpochAndRound + ); + bytes32[] memory proofs = new bytes32[](0); + // We have not blessed this root, should return 0. + uint256 timestamp = s_commitStore.verify(leaves, proofs, 0); + assertEq(uint256(0), timestamp); + } + + function test_Blessed_Success() public { + bytes32[] memory leaves = new bytes32[](1); + leaves[0] = "root"; + s_commitStore.report( + abi.encode( + CommitStore.CommitReport({ + priceUpdates: _getEmptyPriceUpdates(), + interval: CommitStore.Interval(1, 2), + merkleRoot: leaves[0] + }) + ), + ++s_latestEpochAndRound + ); + // Bless that root. + IRMN.TaggedRoot[] memory taggedRoots = new IRMN.TaggedRoot[](1); + taggedRoots[0] = IRMN.TaggedRoot({commitStore: address(s_commitStore), root: leaves[0]}); + vm.startPrank(BLESS_VOTE_ADDR); + s_rmn.voteToBless(taggedRoots); + bytes32[] memory proofs = new bytes32[](0); + uint256 timestamp = s_commitStore.verify(leaves, proofs, 0); + assertEq(BLOCK_TIME, timestamp); + } + + // Reverts + + function test_Paused_Revert() public { + s_commitStore.pause(); + + bytes32[] memory hashedLeaves = new bytes32[](0); + bytes32[] memory proofs = new bytes32[](0); + uint256 proofFlagBits = 0; + + vm.expectRevert(CommitStore.PausedError.selector); + s_commitStore.verify(hashedLeaves, proofs, proofFlagBits); + } + + function test_TooManyLeaves_Revert() public { + bytes32[] memory leaves = new bytes32[](258); + bytes32[] memory proofs = new bytes32[](0); + + vm.expectRevert(MerkleMultiProof.InvalidProof.selector); + + s_commitStore.verify(leaves, proofs, 0); + } +} + +contract CommitStore_isUnpausedAndRMNHealthy is CommitStoreSetup { + function test_RMN_Success() public { + // Test pausing + assertFalse(s_commitStore.paused()); + assertTrue(s_commitStore.isUnpausedAndNotCursed()); + s_commitStore.pause(); + assertTrue(s_commitStore.paused()); + assertFalse(s_commitStore.isUnpausedAndNotCursed()); + s_commitStore.unpause(); + assertFalse(s_commitStore.paused()); + assertTrue(s_commitStore.isUnpausedAndNotCursed()); + + // Test rmn + s_mockRMN.setGlobalCursed(true); + assertFalse(s_commitStore.isUnpausedAndNotCursed()); + s_mockRMN.setGlobalCursed(false); + // TODO: also test with s_mockRMN.setChainCursed(sourceChainSelector), + // also for other similar tests (e.g., OffRamp, OnRamp) + assertTrue(s_commitStore.isUnpausedAndNotCursed()); + + s_mockRMN.setGlobalCursed(true); + s_commitStore.pause(); + assertFalse(s_commitStore.isUnpausedAndNotCursed()); + } +} + +contract CommitStore_setLatestPriceEpochAndRound is CommitStoreSetup { + function test_SetLatestPriceEpochAndRound_Success() public { + uint40 latestRoundAndEpoch = 1782155; + + vm.expectEmit(); + emit CommitStore.LatestPriceEpochAndRoundSet( + uint40(s_commitStore.getLatestPriceEpochAndRound()), latestRoundAndEpoch + ); + + s_commitStore.setLatestPriceEpochAndRound(latestRoundAndEpoch); + + assertEq(uint40(s_commitStore.getLatestPriceEpochAndRound()), latestRoundAndEpoch); + } + + // Reverts + function test_OnlyOwner_Revert() public { + vm.stopPrank(); + vm.expectRevert("Only callable by owner"); + s_commitStore.setLatestPriceEpochAndRound(6723); + } +} diff --git a/contracts/src/v0.8/ccip/test/e2e/End2End.t.sol b/contracts/src/v0.8/ccip/test/e2e/End2End.t.sol new file mode 100644 index 00000000000..114265a2481 --- /dev/null +++ b/contracts/src/v0.8/ccip/test/e2e/End2End.t.sol @@ -0,0 +1,116 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import "../commitStore/CommitStore.t.sol"; +import "../helpers/MerkleHelper.sol"; +import "../offRamp/EVM2EVMOffRampSetup.t.sol"; +import "../onRamp/EVM2EVMOnRampSetup.t.sol"; + +contract E2E is EVM2EVMOnRampSetup, CommitStoreSetup, EVM2EVMOffRampSetup { + using Internal for Internal.EVM2EVMMessage; + + function setUp() public virtual override(EVM2EVMOnRampSetup, CommitStoreSetup, EVM2EVMOffRampSetup) { + EVM2EVMOnRampSetup.setUp(); + CommitStoreSetup.setUp(); + EVM2EVMOffRampSetup.setUp(); + + deployOffRamp(s_commitStore, s_destRouter, address(0)); + } + + function test_E2E_3MessagesSuccess_gas() public { + vm.pauseGasMetering(); + IERC20 token0 = IERC20(s_sourceTokens[0]); + IERC20 token1 = IERC20(s_sourceTokens[1]); + uint256 balance0Pre = token0.balanceOf(OWNER); + uint256 balance1Pre = token1.balanceOf(OWNER); + + Internal.EVM2EVMMessage[] memory messages = new Internal.EVM2EVMMessage[](3); + messages[0] = sendRequest(1); + messages[1] = sendRequest(2); + messages[2] = sendRequest(3); + + uint256 expectedFee = s_sourceRouter.getFee(DEST_CHAIN_SELECTOR, _generateTokenMessage()); + // Asserts that the tokens have been sent and the fee has been paid. + assertEq(balance0Pre - messages.length * (i_tokenAmount0 + expectedFee), token0.balanceOf(OWNER)); + assertEq(balance1Pre - messages.length * i_tokenAmount1, token1.balanceOf(OWNER)); + + bytes32 metaDataHash = s_offRamp.metadataHash(); + + bytes32[] memory hashedMessages = new bytes32[](3); + hashedMessages[0] = messages[0]._hash(metaDataHash); + messages[0].messageId = hashedMessages[0]; + hashedMessages[1] = messages[1]._hash(metaDataHash); + messages[1].messageId = hashedMessages[1]; + hashedMessages[2] = messages[2]._hash(metaDataHash); + messages[2].messageId = hashedMessages[2]; + + bytes32[] memory merkleRoots = new bytes32[](1); + merkleRoots[0] = MerkleHelper.getMerkleRoot(hashedMessages); + + address[] memory onRamps = new address[](1); + onRamps[0] = ON_RAMP_ADDRESS; + + bytes memory commitReport = abi.encode( + CommitStore.CommitReport({ + priceUpdates: _getEmptyPriceUpdates(), + interval: CommitStore.Interval(messages[0].sequenceNumber, messages[2].sequenceNumber), + merkleRoot: merkleRoots[0] + }) + ); + + vm.resumeGasMetering(); + s_commitStore.report(commitReport, ++s_latestEpochAndRound); + vm.pauseGasMetering(); + + s_mockRMN.setTaggedRootBlessed(IRMN.TaggedRoot({commitStore: address(s_commitStore), root: merkleRoots[0]}), true); + + bytes32[] memory proofs = new bytes32[](0); + uint256 timestamp = s_commitStore.verify(merkleRoots, proofs, 2 ** 2 - 1); + assertEq(BLOCK_TIME, timestamp); + + // We change the block time so when execute would e.g. use the current + // block time instead of the committed block time the value would be + // incorrect in the checks below. + vm.warp(BLOCK_TIME + 2000); + + vm.expectEmit(); + emit EVM2EVMOffRamp.ExecutionStateChanged( + messages[0].sequenceNumber, messages[0].messageId, Internal.MessageExecutionState.SUCCESS, "" + ); + + vm.expectEmit(); + emit EVM2EVMOffRamp.ExecutionStateChanged( + messages[1].sequenceNumber, messages[1].messageId, Internal.MessageExecutionState.SUCCESS, "" + ); + + vm.expectEmit(); + emit EVM2EVMOffRamp.ExecutionStateChanged( + messages[2].sequenceNumber, messages[2].messageId, Internal.MessageExecutionState.SUCCESS, "" + ); + + Internal.ExecutionReport memory execReport = _generateReportFromMessages(messages); + vm.resumeGasMetering(); + s_offRamp.execute(execReport, new EVM2EVMOffRamp.GasLimitOverride[](0)); + } + + function sendRequest(uint64 expectedSeqNum) public returns (Internal.EVM2EVMMessage memory) { + Client.EVM2AnyMessage memory message = _generateTokenMessage(); + uint256 expectedFee = s_sourceRouter.getFee(DEST_CHAIN_SELECTOR, message); + + IERC20(s_sourceTokens[0]).approve(address(s_sourceRouter), i_tokenAmount0 + expectedFee); + IERC20(s_sourceTokens[1]).approve(address(s_sourceRouter), i_tokenAmount1); + + message.receiver = abi.encode(address(s_receiver)); + Internal.EVM2EVMMessage memory msgEvent = + _messageToEvent(message, expectedSeqNum, expectedSeqNum, expectedFee, OWNER); + + vm.expectEmit(); + emit EVM2EVMOnRamp.CCIPSendRequested(msgEvent); + + vm.resumeGasMetering(); + s_sourceRouter.ccipSend(DEST_CHAIN_SELECTOR, message); + vm.pauseGasMetering(); + + return msgEvent; + } +} diff --git a/contracts/src/v0.8/ccip/test/e2e/MultiRampsEnd2End.sol b/contracts/src/v0.8/ccip/test/e2e/MultiRampsEnd2End.sol new file mode 100644 index 00000000000..39a80808a3e --- /dev/null +++ b/contracts/src/v0.8/ccip/test/e2e/MultiRampsEnd2End.sol @@ -0,0 +1,283 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {AuthorizedCallers} from "../../../shared/access/AuthorizedCallers.sol"; +import {NonceManager} from "../../NonceManager.sol"; +import {IRMNV2} from "../../interfaces/IRMNV2.sol"; +import {LockReleaseTokenPool} from "../../pools/LockReleaseTokenPool.sol"; +import {TokenAdminRegistry} from "../../tokenAdminRegistry/TokenAdminRegistry.sol"; +import "../helpers/MerkleHelper.sol"; +import "../offRamp/OffRampSetup.t.sol"; +import "../onRamp/OnRampSetup.t.sol"; + +/// @notice This E2E test implements the following scenario: +/// 1. Send multiple messages from multiple source chains to a single destination chain (2 messages from source chain 1 and 1 from +/// source chain 2). +/// 2. Commit multiple merkle roots (1 for each source chain). +/// 3. Batch execute all the committed messages. +contract MultiRampsE2E is OnRampSetup, OffRampSetup { + using Internal for Internal.Any2EVMRampMessage; + + Router internal s_sourceRouter2; + OnRampHelper internal s_onRamp2; + TokenAdminRegistry internal s_tokenAdminRegistry2; + NonceManager internal s_nonceManager2; + + bytes32 internal s_metadataHash2; + + mapping(address destPool => address sourcePool) internal s_sourcePoolByDestPool; + + function setUp() public virtual override(OnRampSetup, OffRampSetup) { + OnRampSetup.setUp(); + OffRampSetup.setUp(); + + // Deploy new source router for the new source chain + s_sourceRouter2 = new Router(s_sourceRouter.getWrappedNative(), address(s_mockRMN)); + + // Deploy new TokenAdminRegistry for the new source chain + s_tokenAdminRegistry2 = new TokenAdminRegistry(); + + // Deploy new token pools and set them on the new TokenAdminRegistry + for (uint256 i = 0; i < s_sourceTokens.length; ++i) { + address token = s_sourceTokens[i]; + address pool = address( + new LockReleaseTokenPool(IERC20(token), new address[](0), address(s_mockRMN), true, address(s_sourceRouter2)) + ); + + s_sourcePoolByDestPool[s_destPoolBySourceToken[token]] = pool; + + _setPool( + s_tokenAdminRegistry2, token, pool, DEST_CHAIN_SELECTOR, s_destPoolByToken[s_destTokens[i]], s_destTokens[i] + ); + } + + for (uint256 i = 0; i < s_destTokens.length; ++i) { + address token = s_destTokens[i]; + address pool = s_destPoolByToken[token]; + + _setPool( + s_tokenAdminRegistry2, token, pool, SOURCE_CHAIN_SELECTOR + 1, s_sourcePoolByDestPool[pool], s_sourceTokens[i] + ); + } + + s_nonceManager2 = new NonceManager(new address[](0)); + + ( + // Deploy the new source chain onramp + // Outsource to shared helper function with OnRampSetup + s_onRamp2, + s_metadataHash2 + ) = _deployOnRamp( + SOURCE_CHAIN_SELECTOR + 1, s_sourceRouter2, address(s_nonceManager2), address(s_tokenAdminRegistry2) + ); + + address[] memory authorizedCallers = new address[](1); + authorizedCallers[0] = address(s_onRamp2); + s_nonceManager2.applyAuthorizedCallerUpdates( + AuthorizedCallers.AuthorizedCallerArgs({addedCallers: authorizedCallers, removedCallers: new address[](0)}) + ); + + // Enable destination chain on new source chain router + Router.OnRamp[] memory onRampUpdates = new Router.OnRamp[](1); + onRampUpdates[0] = Router.OnRamp({destChainSelector: DEST_CHAIN_SELECTOR, onRamp: address(s_onRamp2)}); + s_sourceRouter2.applyRampUpdates(onRampUpdates, new Router.OffRamp[](0), new Router.OffRamp[](0)); + + // Deploy offramp + _deployOffRamp(s_mockRMNRemote, s_inboundNonceManager); + + // Enable source chains on offramp + OffRamp.SourceChainConfigArgs[] memory sourceChainConfigs = new OffRamp.SourceChainConfigArgs[](2); + sourceChainConfigs[0] = OffRamp.SourceChainConfigArgs({ + router: s_destRouter, + sourceChainSelector: SOURCE_CHAIN_SELECTOR, + isEnabled: true, + // Must match OnRamp address + onRamp: abi.encode(address(s_onRamp)) + }); + sourceChainConfigs[1] = OffRamp.SourceChainConfigArgs({ + router: s_destRouter, + sourceChainSelector: SOURCE_CHAIN_SELECTOR + 1, + isEnabled: true, + onRamp: abi.encode(address(s_onRamp2)) + }); + + _setupMultipleOffRampsFromConfigs(sourceChainConfigs); + } + + function test_E2E_3MessagesMMultiOffRampSuccess_gas() public { + vm.pauseGasMetering(); + + Internal.Any2EVMRampMessage[] memory messages1 = new Internal.Any2EVMRampMessage[](2); + Internal.Any2EVMRampMessage[] memory messages2 = new Internal.Any2EVMRampMessage[](1); + + // Scoped to sending to reduce stack pressure + { + IERC20 token0 = IERC20(s_sourceTokens[0]); + IERC20 token1 = IERC20(s_sourceTokens[1]); + + uint256 balance0Pre = token0.balanceOf(OWNER); + uint256 balance1Pre = token1.balanceOf(OWNER); + + // Send messages + messages1[0] = _sendRequest(1, SOURCE_CHAIN_SELECTOR, 1, s_metadataHash, s_sourceRouter, s_tokenAdminRegistry); + messages1[1] = _sendRequest(2, SOURCE_CHAIN_SELECTOR, 2, s_metadataHash, s_sourceRouter, s_tokenAdminRegistry); + messages2[0] = + _sendRequest(1, SOURCE_CHAIN_SELECTOR + 1, 1, s_metadataHash2, s_sourceRouter2, s_tokenAdminRegistry2); + + uint256 expectedFee = s_sourceRouter.getFee(DEST_CHAIN_SELECTOR, _generateTokenMessage()); + // Asserts that the tokens have been sent and the fee has been paid. + assertEq( + balance0Pre - (messages1.length + messages2.length) * (i_tokenAmount0 + expectedFee), token0.balanceOf(OWNER) + ); + assertEq(balance1Pre - (messages1.length + messages2.length) * i_tokenAmount1, token1.balanceOf(OWNER)); + } + + // Commit + + bytes32[] memory merkleRoots = new bytes32[](2); + + // Scoped to commit to reduce stack pressure + { + bytes32[] memory hashedMessages1 = new bytes32[](2); + hashedMessages1[0] = messages1[0]._hash(abi.encode(address(s_onRamp))); + hashedMessages1[1] = messages1[1]._hash(abi.encode(address(s_onRamp))); + bytes32[] memory hashedMessages2 = new bytes32[](1); + hashedMessages2[0] = messages2[0]._hash(abi.encode(address(s_onRamp2))); + + merkleRoots[0] = MerkleHelper.getMerkleRoot(hashedMessages1); + merkleRoots[1] = MerkleHelper.getMerkleRoot(hashedMessages2); + + // TODO make these real sigs :) + IRMNV2.Signature[] memory rmnSignatures = new IRMNV2.Signature[](0); + + Internal.MerkleRoot[] memory roots = new Internal.MerkleRoot[](2); + roots[0] = Internal.MerkleRoot({ + sourceChainSelector: SOURCE_CHAIN_SELECTOR, + minSeqNr: messages1[0].header.sequenceNumber, + maxSeqNr: messages1[1].header.sequenceNumber, + merkleRoot: merkleRoots[0], + onRampAddress: abi.encode(address(s_onRamp)) + }); + roots[1] = Internal.MerkleRoot({ + sourceChainSelector: SOURCE_CHAIN_SELECTOR + 1, + minSeqNr: messages2[0].header.sequenceNumber, + maxSeqNr: messages2[0].header.sequenceNumber, + merkleRoot: merkleRoots[1], + onRampAddress: abi.encode(address(s_onRamp)) + }); + + OffRamp.CommitReport memory report = + OffRamp.CommitReport({priceUpdates: _getEmptyPriceUpdates(), merkleRoots: roots, rmnSignatures: rmnSignatures}); + + vm.resumeGasMetering(); + _commit(report, ++s_latestSequenceNumber); + vm.pauseGasMetering(); + } + + // Scoped to RMN and verify to reduce stack pressure + { + s_mockRMN.setTaggedRootBlessed(IRMN.TaggedRoot({commitStore: address(s_offRamp), root: merkleRoots[0]}), true); + s_mockRMN.setTaggedRootBlessed(IRMN.TaggedRoot({commitStore: address(s_offRamp), root: merkleRoots[1]}), true); + + bytes32[] memory proofs = new bytes32[](0); + bytes32[] memory hashedLeaves = new bytes32[](1); + hashedLeaves[0] = merkleRoots[0]; + + uint256 timestamp = s_offRamp.verify(SOURCE_CHAIN_SELECTOR, hashedLeaves, proofs, 2 ** 2 - 1); + assertEq(BLOCK_TIME, timestamp); + hashedLeaves[0] = merkleRoots[1]; + timestamp = s_offRamp.verify(SOURCE_CHAIN_SELECTOR + 1, hashedLeaves, proofs, 2 ** 2 - 1); + assertEq(BLOCK_TIME, timestamp); + + // We change the block time so when execute would e.g. use the current + // block time instead of the committed block time the value would be + // incorrect in the checks below. + vm.warp(BLOCK_TIME + 2000); + } + + // Execute + + Internal.ExecutionReportSingleChain[] memory reports = new Internal.ExecutionReportSingleChain[](2); + reports[0] = _generateReportFromMessages(SOURCE_CHAIN_SELECTOR, messages1); + reports[1] = _generateReportFromMessages(SOURCE_CHAIN_SELECTOR + 1, messages2); + + vm.resumeGasMetering(); + vm.recordLogs(); + _execute(reports); + + assertExecutionStateChangedEventLogs( + SOURCE_CHAIN_SELECTOR, + messages1[0].header.sequenceNumber, + messages1[0].header.messageId, + messages1[0]._hash(abi.encode(address(s_onRamp))), + Internal.MessageExecutionState.SUCCESS, + "" + ); + + assertExecutionStateChangedEventLogs( + SOURCE_CHAIN_SELECTOR, + messages1[1].header.sequenceNumber, + messages1[1].header.messageId, + messages1[1]._hash(abi.encode(address(s_onRamp))), + Internal.MessageExecutionState.SUCCESS, + "" + ); + + assertExecutionStateChangedEventLogs( + SOURCE_CHAIN_SELECTOR + 1, + messages2[0].header.sequenceNumber, + messages2[0].header.messageId, + messages2[0]._hash(abi.encode(address(s_onRamp2))), + Internal.MessageExecutionState.SUCCESS, + "" + ); + } + + function _sendRequest( + uint64 expectedSeqNum, + uint64 sourceChainSelector, + uint64 nonce, + bytes32 metadataHash, + Router router, + TokenAdminRegistry tokenAdminRegistry + ) public returns (Internal.Any2EVMRampMessage memory) { + Client.EVM2AnyMessage memory message = _generateTokenMessage(); + IERC20(s_sourceTokens[0]).approve(address(router), i_tokenAmount0 + router.getFee(DEST_CHAIN_SELECTOR, message)); + IERC20(s_sourceTokens[1]).approve(address(router), i_tokenAmount1); + + message.receiver = abi.encode(address(s_receiver)); + Internal.EVM2AnyRampMessage memory msgEvent = _messageToEvent( + message, + sourceChainSelector, + DEST_CHAIN_SELECTOR, + expectedSeqNum, + nonce, + router.getFee(DEST_CHAIN_SELECTOR, message), + OWNER, + metadataHash, + tokenAdminRegistry + ); + + vm.expectEmit(); + emit OnRamp.CCIPMessageSent(DEST_CHAIN_SELECTOR, msgEvent); + + vm.resumeGasMetering(); + router.ccipSend(DEST_CHAIN_SELECTOR, message); + vm.pauseGasMetering(); + + return Internal.Any2EVMRampMessage({ + header: Internal.RampMessageHeader({ + messageId: msgEvent.header.messageId, + sourceChainSelector: sourceChainSelector, + destChainSelector: DEST_CHAIN_SELECTOR, + sequenceNumber: msgEvent.header.sequenceNumber, + nonce: msgEvent.header.nonce + }), + sender: abi.encode(msgEvent.sender), + data: msgEvent.data, + receiver: abi.decode(msgEvent.receiver, (address)), + gasLimit: s_feeQuoter.parseEVMExtraArgsFromBytes(msgEvent.extraArgs, DEST_CHAIN_SELECTOR).gasLimit, + tokenAmounts: msgEvent.tokenAmounts + }); + } +} diff --git a/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.t.sol b/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.t.sol new file mode 100644 index 00000000000..f6dc8c25bf5 --- /dev/null +++ b/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.t.sol @@ -0,0 +1,2174 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {IFeeQuoter} from "../../interfaces/IFeeQuoter.sol"; + +import {KeystoneFeedsPermissionHandler} from "../../../keystone/KeystoneFeedsPermissionHandler.sol"; +import {AuthorizedCallers} from "../../../shared/access/AuthorizedCallers.sol"; +import {MockV3Aggregator} from "../../../tests/MockV3Aggregator.sol"; +import {FeeQuoter} from "../../FeeQuoter.sol"; +import {Client} from "../../libraries/Client.sol"; +import {Internal} from "../../libraries/Internal.sol"; +import {Pool} from "../../libraries/Pool.sol"; +import {USDPriceWith18Decimals} from "../../libraries/USDPriceWith18Decimals.sol"; +import {FeeQuoterHelper} from "../helpers/FeeQuoterHelper.sol"; +import {FeeQuoterFeeSetup, FeeQuoterSetup} from "./FeeQuoterSetup.t.sol"; + +import {Vm} from "forge-std/Vm.sol"; + +contract FeeQuoter_constructor is FeeQuoterSetup { + function test_Setup_Success() public virtual { + address[] memory priceUpdaters = new address[](2); + priceUpdaters[0] = STRANGER; + priceUpdaters[1] = OWNER; + address[] memory feeTokens = new address[](2); + feeTokens[0] = s_sourceTokens[0]; + feeTokens[1] = s_sourceTokens[1]; + FeeQuoter.TokenPriceFeedUpdate[] memory tokenPriceFeedUpdates = new FeeQuoter.TokenPriceFeedUpdate[](2); + tokenPriceFeedUpdates[0] = + _getSingleTokenPriceFeedUpdateStruct(s_sourceTokens[0], s_dataFeedByToken[s_sourceTokens[0]], 18); + tokenPriceFeedUpdates[1] = + _getSingleTokenPriceFeedUpdateStruct(s_sourceTokens[1], s_dataFeedByToken[s_sourceTokens[1]], 6); + + FeeQuoter.DestChainConfigArgs[] memory destChainConfigArgs = _generateFeeQuoterDestChainConfigArgs(); + + FeeQuoter.StaticConfig memory staticConfig = FeeQuoter.StaticConfig({ + linkToken: s_sourceTokens[0], + maxFeeJuelsPerMsg: MAX_MSG_FEES_JUELS, + stalenessThreshold: uint32(TWELVE_HOURS) + }); + s_feeQuoter = new FeeQuoterHelper( + staticConfig, + priceUpdaters, + feeTokens, + tokenPriceFeedUpdates, + s_feeQuoterTokenTransferFeeConfigArgs, + s_feeQuoterPremiumMultiplierWeiPerEthArgs, + destChainConfigArgs + ); + + _assertFeeQuoterStaticConfigsEqual(s_feeQuoter.getStaticConfig(), staticConfig); + assertEq(feeTokens, s_feeQuoter.getFeeTokens()); + assertEq(priceUpdaters, s_feeQuoter.getAllAuthorizedCallers()); + assertEq(s_feeQuoter.typeAndVersion(), "FeeQuoter 1.6.0-dev"); + + _assertTokenPriceFeedConfigEquality( + tokenPriceFeedUpdates[0].feedConfig, s_feeQuoter.getTokenPriceFeedConfig(s_sourceTokens[0]) + ); + + _assertTokenPriceFeedConfigEquality( + tokenPriceFeedUpdates[1].feedConfig, s_feeQuoter.getTokenPriceFeedConfig(s_sourceTokens[1]) + ); + + assertEq( + s_feeQuoterPremiumMultiplierWeiPerEthArgs[0].premiumMultiplierWeiPerEth, + s_feeQuoter.getPremiumMultiplierWeiPerEth(s_feeQuoterPremiumMultiplierWeiPerEthArgs[0].token) + ); + + assertEq( + s_feeQuoterPremiumMultiplierWeiPerEthArgs[1].premiumMultiplierWeiPerEth, + s_feeQuoter.getPremiumMultiplierWeiPerEth(s_feeQuoterPremiumMultiplierWeiPerEthArgs[1].token) + ); + + FeeQuoter.TokenTransferFeeConfigArgs memory tokenTransferFeeConfigArg = s_feeQuoterTokenTransferFeeConfigArgs[0]; + for (uint256 i = 0; i < tokenTransferFeeConfigArg.tokenTransferFeeConfigs.length; ++i) { + FeeQuoter.TokenTransferFeeConfigSingleTokenArgs memory tokenFeeArgs = + s_feeQuoterTokenTransferFeeConfigArgs[0].tokenTransferFeeConfigs[i]; + + _assertTokenTransferFeeConfigEqual( + tokenFeeArgs.tokenTransferFeeConfig, + s_feeQuoter.getTokenTransferFeeConfig(tokenTransferFeeConfigArg.destChainSelector, tokenFeeArgs.token) + ); + } + + for (uint256 i = 0; i < destChainConfigArgs.length; ++i) { + FeeQuoter.DestChainConfig memory expectedConfig = destChainConfigArgs[i].destChainConfig; + uint64 destChainSelector = destChainConfigArgs[i].destChainSelector; + + _assertFeeQuoterDestChainConfigsEqual(expectedConfig, s_feeQuoter.getDestChainConfig(destChainSelector)); + } + } + + function test_InvalidStalenessThreshold_Revert() public { + FeeQuoter.StaticConfig memory staticConfig = FeeQuoter.StaticConfig({ + linkToken: s_sourceTokens[0], + maxFeeJuelsPerMsg: MAX_MSG_FEES_JUELS, + stalenessThreshold: 0 + }); + + vm.expectRevert(FeeQuoter.InvalidStaticConfig.selector); + + s_feeQuoter = new FeeQuoterHelper( + staticConfig, + new address[](0), + new address[](0), + new FeeQuoter.TokenPriceFeedUpdate[](0), + s_feeQuoterTokenTransferFeeConfigArgs, + s_feeQuoterPremiumMultiplierWeiPerEthArgs, + new FeeQuoter.DestChainConfigArgs[](0) + ); + } + + function test_InvalidLinkTokenEqZeroAddress_Revert() public { + FeeQuoter.StaticConfig memory staticConfig = FeeQuoter.StaticConfig({ + linkToken: address(0), + maxFeeJuelsPerMsg: MAX_MSG_FEES_JUELS, + stalenessThreshold: uint32(TWELVE_HOURS) + }); + + vm.expectRevert(FeeQuoter.InvalidStaticConfig.selector); + + s_feeQuoter = new FeeQuoterHelper( + staticConfig, + new address[](0), + new address[](0), + new FeeQuoter.TokenPriceFeedUpdate[](0), + s_feeQuoterTokenTransferFeeConfigArgs, + s_feeQuoterPremiumMultiplierWeiPerEthArgs, + new FeeQuoter.DestChainConfigArgs[](0) + ); + } + + function test_InvalidMaxFeeJuelsPerMsg_Revert() public { + FeeQuoter.StaticConfig memory staticConfig = FeeQuoter.StaticConfig({ + linkToken: s_sourceTokens[0], + maxFeeJuelsPerMsg: 0, + stalenessThreshold: uint32(TWELVE_HOURS) + }); + + vm.expectRevert(FeeQuoter.InvalidStaticConfig.selector); + + s_feeQuoter = new FeeQuoterHelper( + staticConfig, + new address[](0), + new address[](0), + new FeeQuoter.TokenPriceFeedUpdate[](0), + s_feeQuoterTokenTransferFeeConfigArgs, + s_feeQuoterPremiumMultiplierWeiPerEthArgs, + new FeeQuoter.DestChainConfigArgs[](0) + ); + } +} + +contract FeeQuoter_getTokenPrices is FeeQuoterSetup { + function test_GetTokenPrices_Success() public view { + Internal.PriceUpdates memory priceUpdates = abi.decode(s_encodedInitialPriceUpdates, (Internal.PriceUpdates)); + + address[] memory tokens = new address[](3); + tokens[0] = s_sourceTokens[0]; + tokens[1] = s_sourceTokens[1]; + tokens[2] = s_weth; + + Internal.TimestampedPackedUint224[] memory tokenPrices = s_feeQuoter.getTokenPrices(tokens); + + assertEq(tokenPrices.length, 3); + assertEq(tokenPrices[0].value, priceUpdates.tokenPriceUpdates[0].usdPerToken); + assertEq(tokenPrices[1].value, priceUpdates.tokenPriceUpdates[1].usdPerToken); + assertEq(tokenPrices[2].value, priceUpdates.tokenPriceUpdates[2].usdPerToken); + } +} + +contract FeeQuoter_getTokenPrice is FeeQuoterSetup { + function test_GetTokenPriceFromFeed_Success() public { + uint256 originalTimestampValue = block.timestamp; + + // Below staleness threshold + vm.warp(originalTimestampValue + 1 hours); + + address sourceToken = _initialiseSingleTokenPriceFeed(); + Internal.TimestampedPackedUint224 memory tokenPriceAnswer = s_feeQuoter.getTokenPrice(sourceToken); + + // Price answer is 1e8 (18 decimal token) - unit is (1e18 * 1e18 / 1e18) -> expected 1e18 + assertEq(tokenPriceAnswer.value, uint224(1e18)); + assertEq(tokenPriceAnswer.timestamp, uint32(block.timestamp)); + } +} + +contract FeeQuoter_getValidatedTokenPrice is FeeQuoterSetup { + function test_GetValidatedTokenPrice_Success() public view { + Internal.PriceUpdates memory priceUpdates = abi.decode(s_encodedInitialPriceUpdates, (Internal.PriceUpdates)); + address token = priceUpdates.tokenPriceUpdates[0].sourceToken; + + uint224 tokenPrice = s_feeQuoter.getValidatedTokenPrice(token); + + assertEq(priceUpdates.tokenPriceUpdates[0].usdPerToken, tokenPrice); + } + + function test_GetValidatedTokenPriceFromFeed_Success() public { + uint256 originalTimestampValue = block.timestamp; + + // Right below staleness threshold + vm.warp(originalTimestampValue + TWELVE_HOURS); + + address sourceToken = _initialiseSingleTokenPriceFeed(); + uint224 tokenPriceAnswer = s_feeQuoter.getValidatedTokenPrice(sourceToken); + + // Price answer is 1e8 (18 decimal token) - unit is (1e18 * 1e18 / 1e18) -> expected 1e18 + assertEq(tokenPriceAnswer, uint224(1e18)); + } + + function test_GetValidatedTokenPriceFromFeedOverStalenessPeriod_Success() public { + uint256 originalTimestampValue = block.timestamp; + + // Right above staleness threshold + vm.warp(originalTimestampValue + TWELVE_HOURS + 1); + + address sourceToken = _initialiseSingleTokenPriceFeed(); + uint224 tokenPriceAnswer = s_feeQuoter.getValidatedTokenPrice(sourceToken); + + // Price answer is 1e8 (18 decimal token) - unit is (1e18 * 1e18 / 1e18) -> expected 1e18 + assertEq(tokenPriceAnswer, uint224(1e18)); + } + + function test_GetValidatedTokenPriceFromFeedMaxInt224Value_Success() public { + address tokenAddress = _deploySourceToken("testToken", 0, 18); + address feedAddress = _deployTokenPriceDataFeed(tokenAddress, 18, int256(uint256(type(uint224).max))); + + FeeQuoter.TokenPriceFeedUpdate[] memory tokenPriceFeedUpdates = new FeeQuoter.TokenPriceFeedUpdate[](1); + tokenPriceFeedUpdates[0] = _getSingleTokenPriceFeedUpdateStruct(tokenAddress, feedAddress, 18); + s_feeQuoter.updateTokenPriceFeeds(tokenPriceFeedUpdates); + + uint224 tokenPriceAnswer = s_feeQuoter.getValidatedTokenPrice(tokenAddress); + + // Price answer is: uint224.MAX_VALUE * (10 ** (36 - 18 - 18)) + assertEq(tokenPriceAnswer, uint224(type(uint224).max)); + } + + function test_GetValidatedTokenPriceFromFeedErc20Below18Decimals_Success() public { + address tokenAddress = _deploySourceToken("testToken", 0, 6); + address feedAddress = _deployTokenPriceDataFeed(tokenAddress, 8, 1e8); + + FeeQuoter.TokenPriceFeedUpdate[] memory tokenPriceFeedUpdates = new FeeQuoter.TokenPriceFeedUpdate[](1); + tokenPriceFeedUpdates[0] = _getSingleTokenPriceFeedUpdateStruct(tokenAddress, feedAddress, 6); + s_feeQuoter.updateTokenPriceFeeds(tokenPriceFeedUpdates); + + uint224 tokenPriceAnswer = s_feeQuoter.getValidatedTokenPrice(tokenAddress); + + // Price answer is 1e8 (6 decimal token) - unit is (1e18 * 1e18 / 1e6) -> expected 1e30 + assertEq(tokenPriceAnswer, uint224(1e30)); + } + + function test_GetValidatedTokenPriceFromFeedErc20Above18Decimals_Success() public { + address tokenAddress = _deploySourceToken("testToken", 0, 24); + address feedAddress = _deployTokenPriceDataFeed(tokenAddress, 8, 1e8); + + FeeQuoter.TokenPriceFeedUpdate[] memory tokenPriceFeedUpdates = new FeeQuoter.TokenPriceFeedUpdate[](1); + tokenPriceFeedUpdates[0] = _getSingleTokenPriceFeedUpdateStruct(tokenAddress, feedAddress, 24); + s_feeQuoter.updateTokenPriceFeeds(tokenPriceFeedUpdates); + + uint224 tokenPriceAnswer = s_feeQuoter.getValidatedTokenPrice(tokenAddress); + + // Price answer is 1e8 (6 decimal token) - unit is (1e18 * 1e18 / 1e24) -> expected 1e12 + assertEq(tokenPriceAnswer, uint224(1e12)); + } + + function test_GetValidatedTokenPriceFromFeedFeedAt18Decimals_Success() public { + address tokenAddress = _deploySourceToken("testToken", 0, 18); + address feedAddress = _deployTokenPriceDataFeed(tokenAddress, 18, 1e18); + + FeeQuoter.TokenPriceFeedUpdate[] memory tokenPriceFeedUpdates = new FeeQuoter.TokenPriceFeedUpdate[](1); + tokenPriceFeedUpdates[0] = _getSingleTokenPriceFeedUpdateStruct(tokenAddress, feedAddress, 18); + s_feeQuoter.updateTokenPriceFeeds(tokenPriceFeedUpdates); + + uint224 tokenPriceAnswer = s_feeQuoter.getValidatedTokenPrice(tokenAddress); + + // Price answer is 1e8 (6 decimal token) - unit is (1e18 * 1e18 / 1e18) -> expected 1e18 + assertEq(tokenPriceAnswer, uint224(1e18)); + } + + function test_GetValidatedTokenPriceFromFeedFeedAt0Decimals_Success() public { + address tokenAddress = _deploySourceToken("testToken", 0, 0); + address feedAddress = _deployTokenPriceDataFeed(tokenAddress, 0, 1e31); + + FeeQuoter.TokenPriceFeedUpdate[] memory tokenPriceFeedUpdates = new FeeQuoter.TokenPriceFeedUpdate[](1); + tokenPriceFeedUpdates[0] = _getSingleTokenPriceFeedUpdateStruct(tokenAddress, feedAddress, 0); + s_feeQuoter.updateTokenPriceFeeds(tokenPriceFeedUpdates); + + uint224 tokenPriceAnswer = s_feeQuoter.getValidatedTokenPrice(tokenAddress); + + // Price answer is 1e31 (0 decimal token) - unit is (1e18 * 1e18 / 1e0) -> expected 1e36 + assertEq(tokenPriceAnswer, uint224(1e67)); + } + + function test_GetValidatedTokenPriceFromFeedFlippedDecimals_Success() public { + address tokenAddress = _deploySourceToken("testToken", 0, 20); + address feedAddress = _deployTokenPriceDataFeed(tokenAddress, 20, 1e18); + + FeeQuoter.TokenPriceFeedUpdate[] memory tokenPriceFeedUpdates = new FeeQuoter.TokenPriceFeedUpdate[](1); + tokenPriceFeedUpdates[0] = _getSingleTokenPriceFeedUpdateStruct(tokenAddress, feedAddress, 20); + s_feeQuoter.updateTokenPriceFeeds(tokenPriceFeedUpdates); + + uint224 tokenPriceAnswer = s_feeQuoter.getValidatedTokenPrice(tokenAddress); + + // Price answer is 1e8 (6 decimal token) - unit is (1e18 * 1e18 / 1e20) -> expected 1e14 + assertEq(tokenPriceAnswer, uint224(1e14)); + } + + function test_StaleFeeToken_Success() public { + vm.warp(block.timestamp + TWELVE_HOURS + 1); + + Internal.PriceUpdates memory priceUpdates = abi.decode(s_encodedInitialPriceUpdates, (Internal.PriceUpdates)); + address token = priceUpdates.tokenPriceUpdates[0].sourceToken; + + uint224 tokenPrice = s_feeQuoter.getValidatedTokenPrice(token); + + assertEq(priceUpdates.tokenPriceUpdates[0].usdPerToken, tokenPrice); + } + + // Reverts + + function test_OverflowFeedPrice_Revert() public { + address tokenAddress = _deploySourceToken("testToken", 0, 18); + address feedAddress = _deployTokenPriceDataFeed(tokenAddress, 18, int256(uint256(type(uint224).max) + 1)); + + FeeQuoter.TokenPriceFeedUpdate[] memory tokenPriceFeedUpdates = new FeeQuoter.TokenPriceFeedUpdate[](1); + tokenPriceFeedUpdates[0] = _getSingleTokenPriceFeedUpdateStruct(tokenAddress, feedAddress, 18); + s_feeQuoter.updateTokenPriceFeeds(tokenPriceFeedUpdates); + + vm.expectRevert(FeeQuoter.DataFeedValueOutOfUint224Range.selector); + s_feeQuoter.getValidatedTokenPrice(tokenAddress); + } + + function test_UnderflowFeedPrice_Revert() public { + address tokenAddress = _deploySourceToken("testToken", 0, 18); + address feedAddress = _deployTokenPriceDataFeed(tokenAddress, 18, -1); + + FeeQuoter.TokenPriceFeedUpdate[] memory tokenPriceFeedUpdates = new FeeQuoter.TokenPriceFeedUpdate[](1); + tokenPriceFeedUpdates[0] = _getSingleTokenPriceFeedUpdateStruct(tokenAddress, feedAddress, 18); + s_feeQuoter.updateTokenPriceFeeds(tokenPriceFeedUpdates); + + vm.expectRevert(FeeQuoter.DataFeedValueOutOfUint224Range.selector); + s_feeQuoter.getValidatedTokenPrice(tokenAddress); + } + + function test_TokenNotSupported_Revert() public { + vm.expectRevert(abi.encodeWithSelector(FeeQuoter.TokenNotSupported.selector, DUMMY_CONTRACT_ADDRESS)); + s_feeQuoter.getValidatedTokenPrice(DUMMY_CONTRACT_ADDRESS); + } + + function test_TokenNotSupportedFeed_Revert() public { + address sourceToken = _initialiseSingleTokenPriceFeed(); + MockV3Aggregator(s_dataFeedByToken[sourceToken]).updateAnswer(0); + + vm.expectRevert(abi.encodeWithSelector(FeeQuoter.TokenNotSupported.selector, sourceToken)); + s_feeQuoter.getValidatedTokenPrice(sourceToken); + } +} + +contract FeeQuoter_applyFeeTokensUpdates is FeeQuoterSetup { + function test_ApplyFeeTokensUpdates_Success() public { + address[] memory feeTokens = new address[](1); + feeTokens[0] = s_sourceTokens[1]; + + vm.expectEmit(); + emit FeeQuoter.FeeTokenAdded(feeTokens[0]); + + s_feeQuoter.applyFeeTokensUpdates(feeTokens, new address[](0)); + assertEq(s_feeQuoter.getFeeTokens().length, 3); + assertEq(s_feeQuoter.getFeeTokens()[2], feeTokens[0]); + + // add same feeToken is no-op + s_feeQuoter.applyFeeTokensUpdates(feeTokens, new address[](0)); + assertEq(s_feeQuoter.getFeeTokens().length, 3); + assertEq(s_feeQuoter.getFeeTokens()[2], feeTokens[0]); + + vm.expectEmit(); + emit FeeQuoter.FeeTokenRemoved(feeTokens[0]); + + s_feeQuoter.applyFeeTokensUpdates(new address[](0), feeTokens); + assertEq(s_feeQuoter.getFeeTokens().length, 2); + + // removing already removed feeToken is no-op + s_feeQuoter.applyFeeTokensUpdates(new address[](0), feeTokens); + assertEq(s_feeQuoter.getFeeTokens().length, 2); + } + + function test_OnlyCallableByOwner_Revert() public { + address[] memory feeTokens = new address[](1); + feeTokens[0] = STRANGER; + vm.startPrank(STRANGER); + vm.expectRevert("Only callable by owner"); + s_feeQuoter.applyFeeTokensUpdates(feeTokens, new address[](0)); + } +} + +contract FeeQuoter_updatePrices is FeeQuoterSetup { + function test_OnlyTokenPrice_Success() public { + Internal.PriceUpdates memory update = Internal.PriceUpdates({ + tokenPriceUpdates: new Internal.TokenPriceUpdate[](1), + gasPriceUpdates: new Internal.GasPriceUpdate[](0) + }); + update.tokenPriceUpdates[0] = Internal.TokenPriceUpdate({sourceToken: s_sourceTokens[0], usdPerToken: 4e18}); + + vm.expectEmit(); + emit FeeQuoter.UsdPerTokenUpdated( + update.tokenPriceUpdates[0].sourceToken, update.tokenPriceUpdates[0].usdPerToken, block.timestamp + ); + + s_feeQuoter.updatePrices(update); + + assertEq(s_feeQuoter.getTokenPrice(s_sourceTokens[0]).value, update.tokenPriceUpdates[0].usdPerToken); + } + + function test_OnlyGasPrice_Success() public { + Internal.PriceUpdates memory update = Internal.PriceUpdates({ + tokenPriceUpdates: new Internal.TokenPriceUpdate[](0), + gasPriceUpdates: new Internal.GasPriceUpdate[](1) + }); + update.gasPriceUpdates[0] = + Internal.GasPriceUpdate({destChainSelector: DEST_CHAIN_SELECTOR, usdPerUnitGas: 2000e18}); + + vm.expectEmit(); + emit FeeQuoter.UsdPerUnitGasUpdated( + update.gasPriceUpdates[0].destChainSelector, update.gasPriceUpdates[0].usdPerUnitGas, block.timestamp + ); + + s_feeQuoter.updatePrices(update); + + assertEq( + s_feeQuoter.getDestinationChainGasPrice(DEST_CHAIN_SELECTOR).value, update.gasPriceUpdates[0].usdPerUnitGas + ); + } + + function test_UpdateMultiplePrices_Success() public { + Internal.TokenPriceUpdate[] memory tokenPriceUpdates = new Internal.TokenPriceUpdate[](3); + tokenPriceUpdates[0] = Internal.TokenPriceUpdate({sourceToken: s_sourceTokens[0], usdPerToken: 4e18}); + tokenPriceUpdates[1] = Internal.TokenPriceUpdate({sourceToken: s_sourceTokens[1], usdPerToken: 1800e18}); + tokenPriceUpdates[2] = Internal.TokenPriceUpdate({sourceToken: address(12345), usdPerToken: 1e18}); + + Internal.GasPriceUpdate[] memory gasPriceUpdates = new Internal.GasPriceUpdate[](3); + gasPriceUpdates[0] = Internal.GasPriceUpdate({destChainSelector: DEST_CHAIN_SELECTOR, usdPerUnitGas: 2e6}); + gasPriceUpdates[1] = Internal.GasPriceUpdate({destChainSelector: SOURCE_CHAIN_SELECTOR, usdPerUnitGas: 2000e18}); + gasPriceUpdates[2] = Internal.GasPriceUpdate({destChainSelector: 12345, usdPerUnitGas: 1e18}); + + Internal.PriceUpdates memory update = + Internal.PriceUpdates({tokenPriceUpdates: tokenPriceUpdates, gasPriceUpdates: gasPriceUpdates}); + + for (uint256 i = 0; i < tokenPriceUpdates.length; ++i) { + vm.expectEmit(); + emit FeeQuoter.UsdPerTokenUpdated( + update.tokenPriceUpdates[i].sourceToken, update.tokenPriceUpdates[i].usdPerToken, block.timestamp + ); + } + for (uint256 i = 0; i < gasPriceUpdates.length; ++i) { + vm.expectEmit(); + emit FeeQuoter.UsdPerUnitGasUpdated( + update.gasPriceUpdates[i].destChainSelector, update.gasPriceUpdates[i].usdPerUnitGas, block.timestamp + ); + } + + s_feeQuoter.updatePrices(update); + + for (uint256 i = 0; i < tokenPriceUpdates.length; ++i) { + assertEq( + s_feeQuoter.getTokenPrice(update.tokenPriceUpdates[i].sourceToken).value, tokenPriceUpdates[i].usdPerToken + ); + } + for (uint256 i = 0; i < gasPriceUpdates.length; ++i) { + assertEq( + s_feeQuoter.getDestinationChainGasPrice(update.gasPriceUpdates[i].destChainSelector).value, + gasPriceUpdates[i].usdPerUnitGas + ); + } + } + + function test_UpdatableByAuthorizedCaller_Success() public { + Internal.PriceUpdates memory priceUpdates = Internal.PriceUpdates({ + tokenPriceUpdates: new Internal.TokenPriceUpdate[](1), + gasPriceUpdates: new Internal.GasPriceUpdate[](0) + }); + priceUpdates.tokenPriceUpdates[0] = Internal.TokenPriceUpdate({sourceToken: s_sourceTokens[0], usdPerToken: 4e18}); + + // Revert when caller is not authorized + vm.startPrank(STRANGER); + vm.expectRevert(abi.encodeWithSelector(AuthorizedCallers.UnauthorizedCaller.selector, STRANGER)); + s_feeQuoter.updatePrices(priceUpdates); + + address[] memory priceUpdaters = new address[](1); + priceUpdaters[0] = STRANGER; + vm.startPrank(OWNER); + s_feeQuoter.applyAuthorizedCallerUpdates( + AuthorizedCallers.AuthorizedCallerArgs({addedCallers: priceUpdaters, removedCallers: new address[](0)}) + ); + + // Stranger is now an authorized caller to update prices + vm.expectEmit(); + emit FeeQuoter.UsdPerTokenUpdated( + priceUpdates.tokenPriceUpdates[0].sourceToken, priceUpdates.tokenPriceUpdates[0].usdPerToken, block.timestamp + ); + s_feeQuoter.updatePrices(priceUpdates); + + assertEq(s_feeQuoter.getTokenPrice(s_sourceTokens[0]).value, priceUpdates.tokenPriceUpdates[0].usdPerToken); + + vm.startPrank(OWNER); + s_feeQuoter.applyAuthorizedCallerUpdates( + AuthorizedCallers.AuthorizedCallerArgs({addedCallers: new address[](0), removedCallers: priceUpdaters}) + ); + + // Revert when authorized caller is removed + vm.startPrank(STRANGER); + vm.expectRevert(abi.encodeWithSelector(AuthorizedCallers.UnauthorizedCaller.selector, STRANGER)); + s_feeQuoter.updatePrices(priceUpdates); + } + + // Reverts + + function test_OnlyCallableByUpdater_Revert() public { + Internal.PriceUpdates memory priceUpdates = Internal.PriceUpdates({ + tokenPriceUpdates: new Internal.TokenPriceUpdate[](0), + gasPriceUpdates: new Internal.GasPriceUpdate[](0) + }); + + vm.startPrank(STRANGER); + vm.expectRevert(abi.encodeWithSelector(AuthorizedCallers.UnauthorizedCaller.selector, STRANGER)); + s_feeQuoter.updatePrices(priceUpdates); + } +} + +contract FeeQuoter_convertTokenAmount is FeeQuoterSetup { + function test_ConvertTokenAmount_Success() public view { + Internal.PriceUpdates memory initialPriceUpdates = abi.decode(s_encodedInitialPriceUpdates, (Internal.PriceUpdates)); + uint256 amount = 3e16; + uint256 conversionRate = (uint256(initialPriceUpdates.tokenPriceUpdates[2].usdPerToken) * 1e18) + / uint256(initialPriceUpdates.tokenPriceUpdates[0].usdPerToken); + uint256 expected = (amount * conversionRate) / 1e18; + assertEq(s_feeQuoter.convertTokenAmount(s_weth, amount, s_sourceTokens[0]), expected); + } + + function test_Fuzz_ConvertTokenAmount_Success( + uint256 feeTokenAmount, + uint224 usdPerFeeToken, + uint160 usdPerLinkToken, + uint224 usdPerUnitGas + ) public { + vm.assume(usdPerFeeToken > 0); + vm.assume(usdPerLinkToken > 0); + // We bound the max fees to be at most uint96.max link. + feeTokenAmount = bound(feeTokenAmount, 0, (uint256(type(uint96).max) * usdPerLinkToken) / usdPerFeeToken); + + address feeToken = address(1); + address linkToken = address(2); + address[] memory feeTokens = new address[](1); + feeTokens[0] = feeToken; + s_feeQuoter.applyFeeTokensUpdates(feeTokens, new address[](0)); + + Internal.TokenPriceUpdate[] memory tokenPriceUpdates = new Internal.TokenPriceUpdate[](2); + tokenPriceUpdates[0] = Internal.TokenPriceUpdate({sourceToken: feeToken, usdPerToken: usdPerFeeToken}); + tokenPriceUpdates[1] = Internal.TokenPriceUpdate({sourceToken: linkToken, usdPerToken: usdPerLinkToken}); + + Internal.GasPriceUpdate[] memory gasPriceUpdates = new Internal.GasPriceUpdate[](1); + gasPriceUpdates[0] = Internal.GasPriceUpdate({destChainSelector: DEST_CHAIN_SELECTOR, usdPerUnitGas: usdPerUnitGas}); + + Internal.PriceUpdates memory priceUpdates = + Internal.PriceUpdates({tokenPriceUpdates: tokenPriceUpdates, gasPriceUpdates: gasPriceUpdates}); + + s_feeQuoter.updatePrices(priceUpdates); + + uint256 linkFee = s_feeQuoter.convertTokenAmount(feeToken, feeTokenAmount, linkToken); + assertEq(linkFee, (feeTokenAmount * usdPerFeeToken) / usdPerLinkToken); + } + + // Reverts + + function test_LinkTokenNotSupported_Revert() public { + vm.expectRevert(abi.encodeWithSelector(FeeQuoter.TokenNotSupported.selector, DUMMY_CONTRACT_ADDRESS)); + s_feeQuoter.convertTokenAmount(DUMMY_CONTRACT_ADDRESS, 3e16, s_sourceTokens[0]); + + vm.expectRevert(abi.encodeWithSelector(FeeQuoter.TokenNotSupported.selector, DUMMY_CONTRACT_ADDRESS)); + s_feeQuoter.convertTokenAmount(s_sourceTokens[0], 3e16, DUMMY_CONTRACT_ADDRESS); + } +} + +contract FeeQuoter_getTokenAndGasPrices is FeeQuoterSetup { + function test_GetFeeTokenAndGasPrices_Success() public view { + (uint224 feeTokenPrice, uint224 gasPrice) = s_feeQuoter.getTokenAndGasPrices(s_sourceFeeToken, DEST_CHAIN_SELECTOR); + + Internal.PriceUpdates memory priceUpdates = abi.decode(s_encodedInitialPriceUpdates, (Internal.PriceUpdates)); + + assertEq(feeTokenPrice, s_sourceTokenPrices[0]); + assertEq(gasPrice, priceUpdates.gasPriceUpdates[0].usdPerUnitGas); + } + + function test_ZeroGasPrice_Success() public { + uint64 zeroGasDestChainSelector = 345678; + Internal.GasPriceUpdate[] memory gasPriceUpdates = new Internal.GasPriceUpdate[](1); + gasPriceUpdates[0] = Internal.GasPriceUpdate({destChainSelector: zeroGasDestChainSelector, usdPerUnitGas: 0}); + + Internal.PriceUpdates memory priceUpdates = + Internal.PriceUpdates({tokenPriceUpdates: new Internal.TokenPriceUpdate[](0), gasPriceUpdates: gasPriceUpdates}); + s_feeQuoter.updatePrices(priceUpdates); + + (, uint224 gasPrice) = s_feeQuoter.getTokenAndGasPrices(s_sourceFeeToken, zeroGasDestChainSelector); + + assertEq(gasPrice, priceUpdates.gasPriceUpdates[0].usdPerUnitGas); + } + + function test_UnsupportedChain_Revert() public { + vm.expectRevert(abi.encodeWithSelector(FeeQuoter.ChainNotSupported.selector, DEST_CHAIN_SELECTOR + 1)); + s_feeQuoter.getTokenAndGasPrices(s_sourceTokens[0], DEST_CHAIN_SELECTOR + 1); + } + + function test_StaleGasPrice_Revert() public { + uint256 diff = TWELVE_HOURS + 1; + vm.warp(block.timestamp + diff); + vm.expectRevert(abi.encodeWithSelector(FeeQuoter.StaleGasPrice.selector, DEST_CHAIN_SELECTOR, TWELVE_HOURS, diff)); + s_feeQuoter.getTokenAndGasPrices(s_sourceTokens[0], DEST_CHAIN_SELECTOR); + } +} + +contract FeeQuoter_updateTokenPriceFeeds is FeeQuoterSetup { + function test_ZeroFeeds_Success() public { + Vm.Log[] memory logEntries = vm.getRecordedLogs(); + + FeeQuoter.TokenPriceFeedUpdate[] memory tokenPriceFeedUpdates = new FeeQuoter.TokenPriceFeedUpdate[](0); + vm.recordLogs(); + s_feeQuoter.updateTokenPriceFeeds(tokenPriceFeedUpdates); + + // Verify no log emissions + assertEq(logEntries.length, 0); + } + + function test_SingleFeedUpdate_Success() public { + FeeQuoter.TokenPriceFeedUpdate[] memory tokenPriceFeedUpdates = new FeeQuoter.TokenPriceFeedUpdate[](1); + tokenPriceFeedUpdates[0] = + _getSingleTokenPriceFeedUpdateStruct(s_sourceTokens[0], s_dataFeedByToken[s_sourceTokens[0]], 18); + + _assertTokenPriceFeedConfigUnconfigured(s_feeQuoter.getTokenPriceFeedConfig(tokenPriceFeedUpdates[0].sourceToken)); + + vm.expectEmit(); + emit FeeQuoter.PriceFeedPerTokenUpdated(tokenPriceFeedUpdates[0].sourceToken, tokenPriceFeedUpdates[0].feedConfig); + + s_feeQuoter.updateTokenPriceFeeds(tokenPriceFeedUpdates); + + _assertTokenPriceFeedConfigEquality( + s_feeQuoter.getTokenPriceFeedConfig(tokenPriceFeedUpdates[0].sourceToken), tokenPriceFeedUpdates[0].feedConfig + ); + } + + function test_MultipleFeedUpdate_Success() public { + FeeQuoter.TokenPriceFeedUpdate[] memory tokenPriceFeedUpdates = new FeeQuoter.TokenPriceFeedUpdate[](2); + + for (uint256 i = 0; i < 2; ++i) { + tokenPriceFeedUpdates[i] = + _getSingleTokenPriceFeedUpdateStruct(s_sourceTokens[i], s_dataFeedByToken[s_sourceTokens[i]], 18); + + _assertTokenPriceFeedConfigUnconfigured(s_feeQuoter.getTokenPriceFeedConfig(tokenPriceFeedUpdates[i].sourceToken)); + + vm.expectEmit(); + emit FeeQuoter.PriceFeedPerTokenUpdated(tokenPriceFeedUpdates[i].sourceToken, tokenPriceFeedUpdates[i].feedConfig); + } + + s_feeQuoter.updateTokenPriceFeeds(tokenPriceFeedUpdates); + + _assertTokenPriceFeedConfigEquality( + s_feeQuoter.getTokenPriceFeedConfig(tokenPriceFeedUpdates[0].sourceToken), tokenPriceFeedUpdates[0].feedConfig + ); + _assertTokenPriceFeedConfigEquality( + s_feeQuoter.getTokenPriceFeedConfig(tokenPriceFeedUpdates[1].sourceToken), tokenPriceFeedUpdates[1].feedConfig + ); + } + + function test_FeedUnset_Success() public { + Internal.TimestampedPackedUint224 memory priceQueryInitial = s_feeQuoter.getTokenPrice(s_sourceTokens[0]); + assertFalse(priceQueryInitial.value == 0); + assertFalse(priceQueryInitial.timestamp == 0); + + FeeQuoter.TokenPriceFeedUpdate[] memory tokenPriceFeedUpdates = new FeeQuoter.TokenPriceFeedUpdate[](1); + tokenPriceFeedUpdates[0] = + _getSingleTokenPriceFeedUpdateStruct(s_sourceTokens[0], s_dataFeedByToken[s_sourceTokens[0]], 18); + + s_feeQuoter.updateTokenPriceFeeds(tokenPriceFeedUpdates); + _assertTokenPriceFeedConfigEquality( + s_feeQuoter.getTokenPriceFeedConfig(tokenPriceFeedUpdates[0].sourceToken), tokenPriceFeedUpdates[0].feedConfig + ); + + tokenPriceFeedUpdates[0].feedConfig.dataFeedAddress = address(0); + vm.expectEmit(); + emit FeeQuoter.PriceFeedPerTokenUpdated(tokenPriceFeedUpdates[0].sourceToken, tokenPriceFeedUpdates[0].feedConfig); + + s_feeQuoter.updateTokenPriceFeeds(tokenPriceFeedUpdates); + _assertTokenPriceFeedConfigEquality( + s_feeQuoter.getTokenPriceFeedConfig(tokenPriceFeedUpdates[0].sourceToken), tokenPriceFeedUpdates[0].feedConfig + ); + + // Price data should remain after a feed has been set->unset + Internal.TimestampedPackedUint224 memory priceQueryPostUnsetFeed = s_feeQuoter.getTokenPrice(s_sourceTokens[0]); + assertEq(priceQueryPostUnsetFeed.value, priceQueryInitial.value); + assertEq(priceQueryPostUnsetFeed.timestamp, priceQueryInitial.timestamp); + } + + function test_FeedNotUpdated() public { + FeeQuoter.TokenPriceFeedUpdate[] memory tokenPriceFeedUpdates = new FeeQuoter.TokenPriceFeedUpdate[](1); + tokenPriceFeedUpdates[0] = + _getSingleTokenPriceFeedUpdateStruct(s_sourceTokens[0], s_dataFeedByToken[s_sourceTokens[0]], 18); + + s_feeQuoter.updateTokenPriceFeeds(tokenPriceFeedUpdates); + s_feeQuoter.updateTokenPriceFeeds(tokenPriceFeedUpdates); + + _assertTokenPriceFeedConfigEquality( + s_feeQuoter.getTokenPriceFeedConfig(tokenPriceFeedUpdates[0].sourceToken), tokenPriceFeedUpdates[0].feedConfig + ); + } + + // Reverts + + function test_FeedUpdatedByNonOwner_Revert() public { + FeeQuoter.TokenPriceFeedUpdate[] memory tokenPriceFeedUpdates = new FeeQuoter.TokenPriceFeedUpdate[](1); + tokenPriceFeedUpdates[0] = + _getSingleTokenPriceFeedUpdateStruct(s_sourceTokens[0], s_dataFeedByToken[s_sourceTokens[0]], 18); + + vm.startPrank(STRANGER); + vm.expectRevert("Only callable by owner"); + + s_feeQuoter.updateTokenPriceFeeds(tokenPriceFeedUpdates); + } +} + +contract FeeQuoter_applyDestChainConfigUpdates is FeeQuoterSetup { + function test_Fuzz_applyDestChainConfigUpdates_Success( + FeeQuoter.DestChainConfigArgs memory destChainConfigArgs + ) public { + vm.assume(destChainConfigArgs.destChainSelector != 0); + vm.assume(destChainConfigArgs.destChainConfig.maxPerMsgGasLimit != 0); + destChainConfigArgs.destChainConfig.defaultTxGasLimit = uint32( + bound( + destChainConfigArgs.destChainConfig.defaultTxGasLimit, 1, destChainConfigArgs.destChainConfig.maxPerMsgGasLimit + ) + ); + destChainConfigArgs.destChainConfig.chainFamilySelector = Internal.CHAIN_FAMILY_SELECTOR_EVM; + + bool isNewChain = destChainConfigArgs.destChainSelector != DEST_CHAIN_SELECTOR; + + FeeQuoter.DestChainConfigArgs[] memory newDestChainConfigArgs = new FeeQuoter.DestChainConfigArgs[](1); + newDestChainConfigArgs[0] = destChainConfigArgs; + + if (isNewChain) { + vm.expectEmit(); + emit FeeQuoter.DestChainAdded(destChainConfigArgs.destChainSelector, destChainConfigArgs.destChainConfig); + } else { + vm.expectEmit(); + emit FeeQuoter.DestChainConfigUpdated(destChainConfigArgs.destChainSelector, destChainConfigArgs.destChainConfig); + } + + s_feeQuoter.applyDestChainConfigUpdates(newDestChainConfigArgs); + + _assertFeeQuoterDestChainConfigsEqual( + destChainConfigArgs.destChainConfig, s_feeQuoter.getDestChainConfig(destChainConfigArgs.destChainSelector) + ); + } + + function test_applyDestChainConfigUpdates_Success() public { + FeeQuoter.DestChainConfigArgs[] memory destChainConfigArgs = new FeeQuoter.DestChainConfigArgs[](2); + destChainConfigArgs[0] = _generateFeeQuoterDestChainConfigArgs()[0]; + destChainConfigArgs[0].destChainConfig.isEnabled = false; + destChainConfigArgs[1] = _generateFeeQuoterDestChainConfigArgs()[0]; + destChainConfigArgs[1].destChainSelector = DEST_CHAIN_SELECTOR + 1; + + vm.expectEmit(); + emit FeeQuoter.DestChainConfigUpdated(DEST_CHAIN_SELECTOR, destChainConfigArgs[0].destChainConfig); + vm.expectEmit(); + emit FeeQuoter.DestChainAdded(DEST_CHAIN_SELECTOR + 1, destChainConfigArgs[1].destChainConfig); + + vm.recordLogs(); + s_feeQuoter.applyDestChainConfigUpdates(destChainConfigArgs); + + FeeQuoter.DestChainConfig memory gotDestChainConfig0 = s_feeQuoter.getDestChainConfig(DEST_CHAIN_SELECTOR); + FeeQuoter.DestChainConfig memory gotDestChainConfig1 = s_feeQuoter.getDestChainConfig(DEST_CHAIN_SELECTOR + 1); + + assertEq(vm.getRecordedLogs().length, 2); + _assertFeeQuoterDestChainConfigsEqual(destChainConfigArgs[0].destChainConfig, gotDestChainConfig0); + _assertFeeQuoterDestChainConfigsEqual(destChainConfigArgs[1].destChainConfig, gotDestChainConfig1); + } + + function test_applyDestChainConfigUpdatesZeroIntput_Success() public { + FeeQuoter.DestChainConfigArgs[] memory destChainConfigArgs = new FeeQuoter.DestChainConfigArgs[](0); + + vm.recordLogs(); + s_feeQuoter.applyDestChainConfigUpdates(destChainConfigArgs); + + assertEq(vm.getRecordedLogs().length, 0); + } + + // Reverts + + function test_applyDestChainConfigUpdatesDefaultTxGasLimitEqZero_Revert() public { + FeeQuoter.DestChainConfigArgs[] memory destChainConfigArgs = _generateFeeQuoterDestChainConfigArgs(); + FeeQuoter.DestChainConfigArgs memory destChainConfigArg = destChainConfigArgs[0]; + + destChainConfigArg.destChainConfig.defaultTxGasLimit = 0; + vm.expectRevert( + abi.encodeWithSelector(FeeQuoter.InvalidDestChainConfig.selector, destChainConfigArg.destChainSelector) + ); + s_feeQuoter.applyDestChainConfigUpdates(destChainConfigArgs); + } + + function test_applyDestChainConfigUpdatesDefaultTxGasLimitGtMaxPerMessageGasLimit_Revert() public { + FeeQuoter.DestChainConfigArgs[] memory destChainConfigArgs = _generateFeeQuoterDestChainConfigArgs(); + FeeQuoter.DestChainConfigArgs memory destChainConfigArg = destChainConfigArgs[0]; + + // Allow setting to the max value + destChainConfigArg.destChainConfig.defaultTxGasLimit = destChainConfigArg.destChainConfig.maxPerMsgGasLimit; + s_feeQuoter.applyDestChainConfigUpdates(destChainConfigArgs); + + // Revert when exceeding max value + destChainConfigArg.destChainConfig.defaultTxGasLimit = destChainConfigArg.destChainConfig.maxPerMsgGasLimit + 1; + vm.expectRevert( + abi.encodeWithSelector(FeeQuoter.InvalidDestChainConfig.selector, destChainConfigArg.destChainSelector) + ); + s_feeQuoter.applyDestChainConfigUpdates(destChainConfigArgs); + } + + function test_InvalidDestChainConfigDestChainSelectorEqZero_Revert() public { + FeeQuoter.DestChainConfigArgs[] memory destChainConfigArgs = _generateFeeQuoterDestChainConfigArgs(); + FeeQuoter.DestChainConfigArgs memory destChainConfigArg = destChainConfigArgs[0]; + + destChainConfigArg.destChainSelector = 0; + vm.expectRevert( + abi.encodeWithSelector(FeeQuoter.InvalidDestChainConfig.selector, destChainConfigArg.destChainSelector) + ); + s_feeQuoter.applyDestChainConfigUpdates(destChainConfigArgs); + } + + function test_InvalidChainFamilySelector_Revert() public { + FeeQuoter.DestChainConfigArgs[] memory destChainConfigArgs = _generateFeeQuoterDestChainConfigArgs(); + FeeQuoter.DestChainConfigArgs memory destChainConfigArg = destChainConfigArgs[0]; + + destChainConfigArg.destChainConfig.chainFamilySelector = bytes4(uint32(1)); + + vm.expectRevert( + abi.encodeWithSelector(FeeQuoter.InvalidDestChainConfig.selector, destChainConfigArg.destChainSelector) + ); + s_feeQuoter.applyDestChainConfigUpdates(destChainConfigArgs); + } +} + +contract FeeQuoter_getDataAvailabilityCost is FeeQuoterSetup { + function test_EmptyMessageCalculatesDataAvailabilityCost_Success() public { + uint256 dataAvailabilityCostUSD = + s_feeQuoter.getDataAvailabilityCost(DEST_CHAIN_SELECTOR, USD_PER_DATA_AVAILABILITY_GAS, 0, 0, 0); + + FeeQuoter.DestChainConfig memory destChainConfig = s_feeQuoter.getDestChainConfig(DEST_CHAIN_SELECTOR); + + uint256 dataAvailabilityGas = destChainConfig.destDataAvailabilityOverheadGas + + destChainConfig.destGasPerDataAvailabilityByte * Internal.ANY_2_EVM_MESSAGE_FIXED_BYTES; + uint256 expectedDataAvailabilityCostUSD = + USD_PER_DATA_AVAILABILITY_GAS * dataAvailabilityGas * destChainConfig.destDataAvailabilityMultiplierBps * 1e14; + + assertEq(expectedDataAvailabilityCostUSD, dataAvailabilityCostUSD); + + // Test that the cost is destnation chain specific + FeeQuoter.DestChainConfigArgs[] memory destChainConfigArgs = _generateFeeQuoterDestChainConfigArgs(); + destChainConfigArgs[0].destChainSelector = DEST_CHAIN_SELECTOR + 1; + destChainConfigArgs[0].destChainConfig.destDataAvailabilityOverheadGas = + destChainConfig.destDataAvailabilityOverheadGas * 2; + destChainConfigArgs[0].destChainConfig.destGasPerDataAvailabilityByte = + destChainConfig.destGasPerDataAvailabilityByte * 2; + destChainConfigArgs[0].destChainConfig.destDataAvailabilityMultiplierBps = + destChainConfig.destDataAvailabilityMultiplierBps * 2; + s_feeQuoter.applyDestChainConfigUpdates(destChainConfigArgs); + + destChainConfig = s_feeQuoter.getDestChainConfig(DEST_CHAIN_SELECTOR + 1); + uint256 dataAvailabilityCostUSD2 = + s_feeQuoter.getDataAvailabilityCost(DEST_CHAIN_SELECTOR + 1, USD_PER_DATA_AVAILABILITY_GAS, 0, 0, 0); + dataAvailabilityGas = destChainConfig.destDataAvailabilityOverheadGas + + destChainConfig.destGasPerDataAvailabilityByte * Internal.ANY_2_EVM_MESSAGE_FIXED_BYTES; + expectedDataAvailabilityCostUSD = + USD_PER_DATA_AVAILABILITY_GAS * dataAvailabilityGas * destChainConfig.destDataAvailabilityMultiplierBps * 1e14; + + assertEq(expectedDataAvailabilityCostUSD, dataAvailabilityCostUSD2); + assertFalse(dataAvailabilityCostUSD == dataAvailabilityCostUSD2); + } + + function test_SimpleMessageCalculatesDataAvailabilityCost_Success() public view { + uint256 dataAvailabilityCostUSD = + s_feeQuoter.getDataAvailabilityCost(DEST_CHAIN_SELECTOR, USD_PER_DATA_AVAILABILITY_GAS, 100, 5, 50); + + FeeQuoter.DestChainConfig memory destChainConfig = s_feeQuoter.getDestChainConfig(DEST_CHAIN_SELECTOR); + + uint256 dataAvailabilityLengthBytes = + Internal.ANY_2_EVM_MESSAGE_FIXED_BYTES + 100 + (5 * Internal.ANY_2_EVM_MESSAGE_FIXED_BYTES_PER_TOKEN) + 50; + uint256 dataAvailabilityGas = destChainConfig.destDataAvailabilityOverheadGas + + destChainConfig.destGasPerDataAvailabilityByte * dataAvailabilityLengthBytes; + uint256 expectedDataAvailabilityCostUSD = + USD_PER_DATA_AVAILABILITY_GAS * dataAvailabilityGas * destChainConfig.destDataAvailabilityMultiplierBps * 1e14; + + assertEq(expectedDataAvailabilityCostUSD, dataAvailabilityCostUSD); + } + + function test_SimpleMessageCalculatesDataAvailabilityCostUnsupportedDestChainSelector_Success() public view { + uint256 dataAvailabilityCostUSD = s_feeQuoter.getDataAvailabilityCost(0, USD_PER_DATA_AVAILABILITY_GAS, 100, 5, 50); + + assertEq(dataAvailabilityCostUSD, 0); + } + + function test_Fuzz_ZeroDataAvailabilityGasPriceAlwaysCalculatesZeroDataAvailabilityCost_Success( + uint64 messageDataLength, + uint32 numberOfTokens, + uint32 tokenTransferBytesOverhead + ) public view { + uint256 dataAvailabilityCostUSD = s_feeQuoter.getDataAvailabilityCost( + DEST_CHAIN_SELECTOR, 0, messageDataLength, numberOfTokens, tokenTransferBytesOverhead + ); + + assertEq(0, dataAvailabilityCostUSD); + } + + function test_Fuzz_CalculateDataAvailabilityCost_Success( + uint64 destChainSelector, + uint32 destDataAvailabilityOverheadGas, + uint16 destGasPerDataAvailabilityByte, + uint16 destDataAvailabilityMultiplierBps, + uint112 dataAvailabilityGasPrice, + uint64 messageDataLength, + uint32 numberOfTokens, + uint32 tokenTransferBytesOverhead + ) public { + vm.assume(destChainSelector != 0); + FeeQuoter.DestChainConfigArgs[] memory destChainConfigArgs = new FeeQuoter.DestChainConfigArgs[](1); + FeeQuoter.DestChainConfig memory destChainConfig = s_feeQuoter.getDestChainConfig(destChainSelector); + destChainConfigArgs[0] = + FeeQuoter.DestChainConfigArgs({destChainSelector: destChainSelector, destChainConfig: destChainConfig}); + destChainConfigArgs[0].destChainConfig.destDataAvailabilityOverheadGas = destDataAvailabilityOverheadGas; + destChainConfigArgs[0].destChainConfig.destGasPerDataAvailabilityByte = destGasPerDataAvailabilityByte; + destChainConfigArgs[0].destChainConfig.destDataAvailabilityMultiplierBps = destDataAvailabilityMultiplierBps; + destChainConfigArgs[0].destChainConfig.defaultTxGasLimit = GAS_LIMIT; + destChainConfigArgs[0].destChainConfig.maxPerMsgGasLimit = GAS_LIMIT; + destChainConfigArgs[0].destChainConfig.chainFamilySelector = Internal.CHAIN_FAMILY_SELECTOR_EVM; + + s_feeQuoter.applyDestChainConfigUpdates(destChainConfigArgs); + + uint256 dataAvailabilityCostUSD = s_feeQuoter.getDataAvailabilityCost( + destChainConfigArgs[0].destChainSelector, + dataAvailabilityGasPrice, + messageDataLength, + numberOfTokens, + tokenTransferBytesOverhead + ); + + uint256 dataAvailabilityLengthBytes = Internal.ANY_2_EVM_MESSAGE_FIXED_BYTES + messageDataLength + + (numberOfTokens * Internal.ANY_2_EVM_MESSAGE_FIXED_BYTES_PER_TOKEN) + tokenTransferBytesOverhead; + + uint256 dataAvailabilityGas = + destDataAvailabilityOverheadGas + destGasPerDataAvailabilityByte * dataAvailabilityLengthBytes; + uint256 expectedDataAvailabilityCostUSD = + dataAvailabilityGasPrice * dataAvailabilityGas * destDataAvailabilityMultiplierBps * 1e14; + + assertEq(expectedDataAvailabilityCostUSD, dataAvailabilityCostUSD); + } +} + +contract FeeQuoter_applyPremiumMultiplierWeiPerEthUpdates is FeeQuoterSetup { + function test_Fuzz_applyPremiumMultiplierWeiPerEthUpdates_Success( + FeeQuoter.PremiumMultiplierWeiPerEthArgs memory premiumMultiplierWeiPerEthArg + ) public { + FeeQuoter.PremiumMultiplierWeiPerEthArgs[] memory premiumMultiplierWeiPerEthArgs = + new FeeQuoter.PremiumMultiplierWeiPerEthArgs[](1); + premiumMultiplierWeiPerEthArgs[0] = premiumMultiplierWeiPerEthArg; + + vm.expectEmit(); + emit FeeQuoter.PremiumMultiplierWeiPerEthUpdated( + premiumMultiplierWeiPerEthArg.token, premiumMultiplierWeiPerEthArg.premiumMultiplierWeiPerEth + ); + + s_feeQuoter.applyPremiumMultiplierWeiPerEthUpdates(premiumMultiplierWeiPerEthArgs); + + assertEq( + premiumMultiplierWeiPerEthArg.premiumMultiplierWeiPerEth, + s_feeQuoter.getPremiumMultiplierWeiPerEth(premiumMultiplierWeiPerEthArg.token) + ); + } + + function test_applyPremiumMultiplierWeiPerEthUpdatesSingleToken_Success() public { + FeeQuoter.PremiumMultiplierWeiPerEthArgs[] memory premiumMultiplierWeiPerEthArgs = + new FeeQuoter.PremiumMultiplierWeiPerEthArgs[](1); + premiumMultiplierWeiPerEthArgs[0] = s_feeQuoterPremiumMultiplierWeiPerEthArgs[0]; + premiumMultiplierWeiPerEthArgs[0].token = vm.addr(1); + + vm.expectEmit(); + emit FeeQuoter.PremiumMultiplierWeiPerEthUpdated( + vm.addr(1), premiumMultiplierWeiPerEthArgs[0].premiumMultiplierWeiPerEth + ); + + s_feeQuoter.applyPremiumMultiplierWeiPerEthUpdates(premiumMultiplierWeiPerEthArgs); + + assertEq( + s_feeQuoterPremiumMultiplierWeiPerEthArgs[0].premiumMultiplierWeiPerEth, + s_feeQuoter.getPremiumMultiplierWeiPerEth(vm.addr(1)) + ); + } + + function test_applyPremiumMultiplierWeiPerEthUpdatesMultipleTokens_Success() public { + FeeQuoter.PremiumMultiplierWeiPerEthArgs[] memory premiumMultiplierWeiPerEthArgs = + new FeeQuoter.PremiumMultiplierWeiPerEthArgs[](2); + premiumMultiplierWeiPerEthArgs[0] = s_feeQuoterPremiumMultiplierWeiPerEthArgs[0]; + premiumMultiplierWeiPerEthArgs[0].token = vm.addr(1); + premiumMultiplierWeiPerEthArgs[1].token = vm.addr(2); + + vm.expectEmit(); + emit FeeQuoter.PremiumMultiplierWeiPerEthUpdated( + vm.addr(1), premiumMultiplierWeiPerEthArgs[0].premiumMultiplierWeiPerEth + ); + vm.expectEmit(); + emit FeeQuoter.PremiumMultiplierWeiPerEthUpdated( + vm.addr(2), premiumMultiplierWeiPerEthArgs[1].premiumMultiplierWeiPerEth + ); + + s_feeQuoter.applyPremiumMultiplierWeiPerEthUpdates(premiumMultiplierWeiPerEthArgs); + + assertEq( + premiumMultiplierWeiPerEthArgs[0].premiumMultiplierWeiPerEth, + s_feeQuoter.getPremiumMultiplierWeiPerEth(vm.addr(1)) + ); + assertEq( + premiumMultiplierWeiPerEthArgs[1].premiumMultiplierWeiPerEth, + s_feeQuoter.getPremiumMultiplierWeiPerEth(vm.addr(2)) + ); + } + + function test_applyPremiumMultiplierWeiPerEthUpdatesZeroInput() public { + vm.recordLogs(); + s_feeQuoter.applyPremiumMultiplierWeiPerEthUpdates(new FeeQuoter.PremiumMultiplierWeiPerEthArgs[](0)); + + assertEq(vm.getRecordedLogs().length, 0); + } + + // Reverts + + function test_OnlyCallableByOwnerOrAdmin_Revert() public { + FeeQuoter.PremiumMultiplierWeiPerEthArgs[] memory premiumMultiplierWeiPerEthArgs; + vm.startPrank(STRANGER); + + vm.expectRevert("Only callable by owner"); + + s_feeQuoter.applyPremiumMultiplierWeiPerEthUpdates(premiumMultiplierWeiPerEthArgs); + } +} + +contract FeeQuoter_applyTokenTransferFeeConfigUpdates is FeeQuoterSetup { + function test_Fuzz_ApplyTokenTransferFeeConfig_Success( + FeeQuoter.TokenTransferFeeConfig[2] memory tokenTransferFeeConfigs + ) public { + FeeQuoter.TokenTransferFeeConfigArgs[] memory tokenTransferFeeConfigArgs = _generateTokenTransferFeeConfigArgs(2, 2); + tokenTransferFeeConfigArgs[0].destChainSelector = DEST_CHAIN_SELECTOR; + tokenTransferFeeConfigArgs[1].destChainSelector = DEST_CHAIN_SELECTOR + 1; + + for (uint256 i = 0; i < tokenTransferFeeConfigArgs.length; ++i) { + for (uint256 j = 0; j < tokenTransferFeeConfigs.length; ++j) { + tokenTransferFeeConfigs[j].destBytesOverhead = uint32( + bound(tokenTransferFeeConfigs[j].destBytesOverhead, Pool.CCIP_LOCK_OR_BURN_V1_RET_BYTES, type(uint32).max) + ); + address feeToken = s_sourceTokens[j]; + tokenTransferFeeConfigArgs[i].tokenTransferFeeConfigs[j].token = feeToken; + tokenTransferFeeConfigArgs[i].tokenTransferFeeConfigs[j].tokenTransferFeeConfig = tokenTransferFeeConfigs[j]; + + vm.expectEmit(); + emit FeeQuoter.TokenTransferFeeConfigUpdated( + tokenTransferFeeConfigArgs[i].destChainSelector, feeToken, tokenTransferFeeConfigs[j] + ); + } + } + + s_feeQuoter.applyTokenTransferFeeConfigUpdates( + tokenTransferFeeConfigArgs, new FeeQuoter.TokenTransferFeeConfigRemoveArgs[](0) + ); + + for (uint256 i = 0; i < tokenTransferFeeConfigs.length; ++i) { + _assertTokenTransferFeeConfigEqual( + tokenTransferFeeConfigs[i], + s_feeQuoter.getTokenTransferFeeConfig( + tokenTransferFeeConfigArgs[0].destChainSelector, + tokenTransferFeeConfigArgs[0].tokenTransferFeeConfigs[i].token + ) + ); + } + } + + function test_ApplyTokenTransferFeeConfig_Success() public { + FeeQuoter.TokenTransferFeeConfigArgs[] memory tokenTransferFeeConfigArgs = _generateTokenTransferFeeConfigArgs(1, 2); + tokenTransferFeeConfigArgs[0].destChainSelector = DEST_CHAIN_SELECTOR; + tokenTransferFeeConfigArgs[0].tokenTransferFeeConfigs[0].token = address(5); + tokenTransferFeeConfigArgs[0].tokenTransferFeeConfigs[0].tokenTransferFeeConfig = FeeQuoter.TokenTransferFeeConfig({ + minFeeUSDCents: 6, + maxFeeUSDCents: 7, + deciBps: 8, + destGasOverhead: 9, + destBytesOverhead: 312, + isEnabled: true + }); + tokenTransferFeeConfigArgs[0].tokenTransferFeeConfigs[1].token = address(11); + tokenTransferFeeConfigArgs[0].tokenTransferFeeConfigs[1].tokenTransferFeeConfig = FeeQuoter.TokenTransferFeeConfig({ + minFeeUSDCents: 12, + maxFeeUSDCents: 13, + deciBps: 14, + destGasOverhead: 15, + destBytesOverhead: 394, + isEnabled: true + }); + + vm.expectEmit(); + emit FeeQuoter.TokenTransferFeeConfigUpdated( + tokenTransferFeeConfigArgs[0].destChainSelector, + tokenTransferFeeConfigArgs[0].tokenTransferFeeConfigs[0].token, + tokenTransferFeeConfigArgs[0].tokenTransferFeeConfigs[0].tokenTransferFeeConfig + ); + vm.expectEmit(); + emit FeeQuoter.TokenTransferFeeConfigUpdated( + tokenTransferFeeConfigArgs[0].destChainSelector, + tokenTransferFeeConfigArgs[0].tokenTransferFeeConfigs[1].token, + tokenTransferFeeConfigArgs[0].tokenTransferFeeConfigs[1].tokenTransferFeeConfig + ); + + FeeQuoter.TokenTransferFeeConfigRemoveArgs[] memory tokensToRemove = + new FeeQuoter.TokenTransferFeeConfigRemoveArgs[](0); + s_feeQuoter.applyTokenTransferFeeConfigUpdates(tokenTransferFeeConfigArgs, tokensToRemove); + + FeeQuoter.TokenTransferFeeConfig memory config0 = s_feeQuoter.getTokenTransferFeeConfig( + tokenTransferFeeConfigArgs[0].destChainSelector, tokenTransferFeeConfigArgs[0].tokenTransferFeeConfigs[0].token + ); + FeeQuoter.TokenTransferFeeConfig memory config1 = s_feeQuoter.getTokenTransferFeeConfig( + tokenTransferFeeConfigArgs[0].destChainSelector, tokenTransferFeeConfigArgs[0].tokenTransferFeeConfigs[1].token + ); + + _assertTokenTransferFeeConfigEqual( + tokenTransferFeeConfigArgs[0].tokenTransferFeeConfigs[0].tokenTransferFeeConfig, config0 + ); + _assertTokenTransferFeeConfigEqual( + tokenTransferFeeConfigArgs[0].tokenTransferFeeConfigs[1].tokenTransferFeeConfig, config1 + ); + + // Remove only the first token and validate only the first token is removed + tokensToRemove = new FeeQuoter.TokenTransferFeeConfigRemoveArgs[](1); + tokensToRemove[0] = FeeQuoter.TokenTransferFeeConfigRemoveArgs({ + destChainSelector: tokenTransferFeeConfigArgs[0].destChainSelector, + token: tokenTransferFeeConfigArgs[0].tokenTransferFeeConfigs[0].token + }); + + vm.expectEmit(); + emit FeeQuoter.TokenTransferFeeConfigDeleted( + tokenTransferFeeConfigArgs[0].destChainSelector, tokenTransferFeeConfigArgs[0].tokenTransferFeeConfigs[0].token + ); + + s_feeQuoter.applyTokenTransferFeeConfigUpdates(new FeeQuoter.TokenTransferFeeConfigArgs[](0), tokensToRemove); + + config0 = s_feeQuoter.getTokenTransferFeeConfig( + tokenTransferFeeConfigArgs[0].destChainSelector, tokenTransferFeeConfigArgs[0].tokenTransferFeeConfigs[0].token + ); + config1 = s_feeQuoter.getTokenTransferFeeConfig( + tokenTransferFeeConfigArgs[0].destChainSelector, tokenTransferFeeConfigArgs[0].tokenTransferFeeConfigs[1].token + ); + + FeeQuoter.TokenTransferFeeConfig memory emptyConfig; + + _assertTokenTransferFeeConfigEqual(emptyConfig, config0); + _assertTokenTransferFeeConfigEqual( + tokenTransferFeeConfigArgs[0].tokenTransferFeeConfigs[1].tokenTransferFeeConfig, config1 + ); + } + + function test_ApplyTokenTransferFeeZeroInput() public { + vm.recordLogs(); + s_feeQuoter.applyTokenTransferFeeConfigUpdates( + new FeeQuoter.TokenTransferFeeConfigArgs[](0), new FeeQuoter.TokenTransferFeeConfigRemoveArgs[](0) + ); + + assertEq(vm.getRecordedLogs().length, 0); + } + + // Reverts + + function test_OnlyCallableByOwnerOrAdmin_Revert() public { + vm.startPrank(STRANGER); + FeeQuoter.TokenTransferFeeConfigArgs[] memory tokenTransferFeeConfigArgs; + + vm.expectRevert("Only callable by owner"); + + s_feeQuoter.applyTokenTransferFeeConfigUpdates( + tokenTransferFeeConfigArgs, new FeeQuoter.TokenTransferFeeConfigRemoveArgs[](0) + ); + } + + function test_InvalidDestBytesOverhead_Revert() public { + FeeQuoter.TokenTransferFeeConfigArgs[] memory tokenTransferFeeConfigArgs = _generateTokenTransferFeeConfigArgs(1, 1); + tokenTransferFeeConfigArgs[0].destChainSelector = DEST_CHAIN_SELECTOR; + tokenTransferFeeConfigArgs[0].tokenTransferFeeConfigs[0].token = address(5); + tokenTransferFeeConfigArgs[0].tokenTransferFeeConfigs[0].tokenTransferFeeConfig = FeeQuoter.TokenTransferFeeConfig({ + minFeeUSDCents: 6, + maxFeeUSDCents: 7, + deciBps: 8, + destGasOverhead: 9, + destBytesOverhead: uint32(Pool.CCIP_LOCK_OR_BURN_V1_RET_BYTES - 1), + isEnabled: true + }); + + vm.expectRevert( + abi.encodeWithSelector( + FeeQuoter.InvalidDestBytesOverhead.selector, + tokenTransferFeeConfigArgs[0].tokenTransferFeeConfigs[0].token, + tokenTransferFeeConfigArgs[0].tokenTransferFeeConfigs[0].tokenTransferFeeConfig.destBytesOverhead + ) + ); + + s_feeQuoter.applyTokenTransferFeeConfigUpdates( + tokenTransferFeeConfigArgs, new FeeQuoter.TokenTransferFeeConfigRemoveArgs[](0) + ); + } +} + +contract FeeQuoter_getTokenTransferCost is FeeQuoterFeeSetup { + using USDPriceWith18Decimals for uint224; + + function test_NoTokenTransferChargesZeroFee_Success() public view { + Client.EVM2AnyMessage memory message = _generateEmptyMessage(); + (uint256 feeUSDWei, uint32 destGasOverhead, uint32 destBytesOverhead) = + s_feeQuoter.getTokenTransferCost(DEST_CHAIN_SELECTOR, message.feeToken, s_feeTokenPrice, message.tokenAmounts); + + assertEq(0, feeUSDWei); + assertEq(0, destGasOverhead); + assertEq(0, destBytesOverhead); + } + + function test_getTokenTransferCost_selfServeUsesDefaults_Success() public view { + Client.EVM2AnyMessage memory message = _generateSingleTokenMessage(s_selfServeTokenDefaultPricing, 1000); + + // Get config to assert it isn't set + FeeQuoter.TokenTransferFeeConfig memory transferFeeConfig = + s_feeQuoter.getTokenTransferFeeConfig(DEST_CHAIN_SELECTOR, message.tokenAmounts[0].token); + + assertFalse(transferFeeConfig.isEnabled); + + (uint256 feeUSDWei, uint32 destGasOverhead, uint32 destBytesOverhead) = + s_feeQuoter.getTokenTransferCost(DEST_CHAIN_SELECTOR, message.feeToken, s_feeTokenPrice, message.tokenAmounts); + + // Assert that the default values are used + assertEq(uint256(DEFAULT_TOKEN_FEE_USD_CENTS) * 1e16, feeUSDWei); + assertEq(DEFAULT_TOKEN_DEST_GAS_OVERHEAD, destGasOverhead); + assertEq(DEFAULT_TOKEN_BYTES_OVERHEAD, destBytesOverhead); + } + + function test_SmallTokenTransferChargesMinFeeAndGas_Success() public view { + Client.EVM2AnyMessage memory message = _generateSingleTokenMessage(s_sourceFeeToken, 1000); + FeeQuoter.TokenTransferFeeConfig memory transferFeeConfig = + s_feeQuoter.getTokenTransferFeeConfig(DEST_CHAIN_SELECTOR, message.tokenAmounts[0].token); + + (uint256 feeUSDWei, uint32 destGasOverhead, uint32 destBytesOverhead) = + s_feeQuoter.getTokenTransferCost(DEST_CHAIN_SELECTOR, message.feeToken, s_feeTokenPrice, message.tokenAmounts); + + assertEq(_configUSDCentToWei(transferFeeConfig.minFeeUSDCents), feeUSDWei); + assertEq(transferFeeConfig.destGasOverhead, destGasOverhead); + assertEq(transferFeeConfig.destBytesOverhead, destBytesOverhead); + } + + function test_ZeroAmountTokenTransferChargesMinFeeAndGas_Success() public view { + Client.EVM2AnyMessage memory message = _generateSingleTokenMessage(s_sourceFeeToken, 0); + FeeQuoter.TokenTransferFeeConfig memory transferFeeConfig = + s_feeQuoter.getTokenTransferFeeConfig(DEST_CHAIN_SELECTOR, message.tokenAmounts[0].token); + + (uint256 feeUSDWei, uint32 destGasOverhead, uint32 destBytesOverhead) = + s_feeQuoter.getTokenTransferCost(DEST_CHAIN_SELECTOR, message.feeToken, s_feeTokenPrice, message.tokenAmounts); + + assertEq(_configUSDCentToWei(transferFeeConfig.minFeeUSDCents), feeUSDWei); + assertEq(transferFeeConfig.destGasOverhead, destGasOverhead); + assertEq(transferFeeConfig.destBytesOverhead, destBytesOverhead); + } + + function test_LargeTokenTransferChargesMaxFeeAndGas_Success() public view { + Client.EVM2AnyMessage memory message = _generateSingleTokenMessage(s_sourceFeeToken, 1e36); + FeeQuoter.TokenTransferFeeConfig memory transferFeeConfig = + s_feeQuoter.getTokenTransferFeeConfig(DEST_CHAIN_SELECTOR, message.tokenAmounts[0].token); + + (uint256 feeUSDWei, uint32 destGasOverhead, uint32 destBytesOverhead) = + s_feeQuoter.getTokenTransferCost(DEST_CHAIN_SELECTOR, message.feeToken, s_feeTokenPrice, message.tokenAmounts); + + assertEq(_configUSDCentToWei(transferFeeConfig.maxFeeUSDCents), feeUSDWei); + assertEq(transferFeeConfig.destGasOverhead, destGasOverhead); + assertEq(transferFeeConfig.destBytesOverhead, destBytesOverhead); + } + + function test_FeeTokenBpsFee_Success() public view { + uint256 tokenAmount = 10000e18; + + Client.EVM2AnyMessage memory message = _generateSingleTokenMessage(s_sourceFeeToken, tokenAmount); + FeeQuoter.TokenTransferFeeConfig memory transferFeeConfig = + s_feeQuoter.getTokenTransferFeeConfig(DEST_CHAIN_SELECTOR, message.tokenAmounts[0].token); + + (uint256 feeUSDWei, uint32 destGasOverhead, uint32 destBytesOverhead) = + s_feeQuoter.getTokenTransferCost(DEST_CHAIN_SELECTOR, message.feeToken, s_feeTokenPrice, message.tokenAmounts); + + uint256 usdWei = _calcUSDValueFromTokenAmount(s_feeTokenPrice, tokenAmount); + uint256 bpsUSDWei = _applyBpsRatio( + usdWei, s_feeQuoterTokenTransferFeeConfigArgs[0].tokenTransferFeeConfigs[0].tokenTransferFeeConfig.deciBps + ); + + assertEq(bpsUSDWei, feeUSDWei); + assertEq(transferFeeConfig.destGasOverhead, destGasOverhead); + assertEq(transferFeeConfig.destBytesOverhead, destBytesOverhead); + } + + function test_CustomTokenBpsFee_Success() public view { + uint256 tokenAmount = 200000e18; + + Client.EVM2AnyMessage memory message = Client.EVM2AnyMessage({ + receiver: abi.encode(OWNER), + data: "", + tokenAmounts: new Client.EVMTokenAmount[](1), + feeToken: s_sourceFeeToken, + extraArgs: Client._argsToBytes(Client.EVMExtraArgsV1({gasLimit: GAS_LIMIT})) + }); + message.tokenAmounts[0] = Client.EVMTokenAmount({token: CUSTOM_TOKEN, amount: tokenAmount}); + + FeeQuoter.TokenTransferFeeConfig memory transferFeeConfig = + s_feeQuoter.getTokenTransferFeeConfig(DEST_CHAIN_SELECTOR, message.tokenAmounts[0].token); + + (uint256 feeUSDWei, uint32 destGasOverhead, uint32 destBytesOverhead) = + s_feeQuoter.getTokenTransferCost(DEST_CHAIN_SELECTOR, message.feeToken, s_feeTokenPrice, message.tokenAmounts); + + uint256 usdWei = _calcUSDValueFromTokenAmount(s_customTokenPrice, tokenAmount); + uint256 bpsUSDWei = _applyBpsRatio( + usdWei, s_feeQuoterTokenTransferFeeConfigArgs[0].tokenTransferFeeConfigs[1].tokenTransferFeeConfig.deciBps + ); + + assertEq(bpsUSDWei, feeUSDWei); + assertEq(transferFeeConfig.destGasOverhead, destGasOverhead); + assertEq(transferFeeConfig.destBytesOverhead, destBytesOverhead); + } + + function test_ZeroFeeConfigChargesMinFee_Success() public { + FeeQuoter.TokenTransferFeeConfigArgs[] memory tokenTransferFeeConfigArgs = _generateTokenTransferFeeConfigArgs(1, 1); + tokenTransferFeeConfigArgs[0].destChainSelector = DEST_CHAIN_SELECTOR; + tokenTransferFeeConfigArgs[0].tokenTransferFeeConfigs[0].token = s_sourceFeeToken; + tokenTransferFeeConfigArgs[0].tokenTransferFeeConfigs[0].tokenTransferFeeConfig = FeeQuoter.TokenTransferFeeConfig({ + minFeeUSDCents: 1, + maxFeeUSDCents: 0, + deciBps: 0, + destGasOverhead: 0, + destBytesOverhead: uint32(Pool.CCIP_LOCK_OR_BURN_V1_RET_BYTES), + isEnabled: true + }); + s_feeQuoter.applyTokenTransferFeeConfigUpdates( + tokenTransferFeeConfigArgs, new FeeQuoter.TokenTransferFeeConfigRemoveArgs[](0) + ); + + Client.EVM2AnyMessage memory message = _generateSingleTokenMessage(s_sourceFeeToken, 1e36); + (uint256 feeUSDWei, uint32 destGasOverhead, uint32 destBytesOverhead) = + s_feeQuoter.getTokenTransferCost(DEST_CHAIN_SELECTOR, message.feeToken, s_feeTokenPrice, message.tokenAmounts); + + // if token charges 0 bps, it should cost minFee to transfer + assertEq( + _configUSDCentToWei( + tokenTransferFeeConfigArgs[0].tokenTransferFeeConfigs[0].tokenTransferFeeConfig.minFeeUSDCents + ), + feeUSDWei + ); + assertEq(0, destGasOverhead); + assertEq(Pool.CCIP_LOCK_OR_BURN_V1_RET_BYTES, destBytesOverhead); + } + + function test_Fuzz_TokenTransferFeeDuplicateTokens_Success(uint256 transfers, uint256 amount) public view { + // It shouldn't be possible to pay materially lower fees by splitting up the transfers. + // Note it is possible to pay higher fees since the minimum fees are added. + FeeQuoter.DestChainConfig memory destChainConfig = s_feeQuoter.getDestChainConfig(DEST_CHAIN_SELECTOR); + transfers = bound(transfers, 1, destChainConfig.maxNumberOfTokensPerMsg); + // Cap amount to avoid overflow + amount = bound(amount, 0, 1e36); + Client.EVMTokenAmount[] memory multiple = new Client.EVMTokenAmount[](transfers); + for (uint256 i = 0; i < transfers; ++i) { + multiple[i] = Client.EVMTokenAmount({token: s_sourceTokens[0], amount: amount}); + } + Client.EVMTokenAmount[] memory single = new Client.EVMTokenAmount[](1); + single[0] = Client.EVMTokenAmount({token: s_sourceTokens[0], amount: amount * transfers}); + + address feeToken = s_sourceRouter.getWrappedNative(); + + (uint256 feeSingleUSDWei, uint32 gasOverheadSingle, uint32 bytesOverheadSingle) = + s_feeQuoter.getTokenTransferCost(DEST_CHAIN_SELECTOR, feeToken, s_wrappedTokenPrice, single); + (uint256 feeMultipleUSDWei, uint32 gasOverheadMultiple, uint32 bytesOverheadMultiple) = + s_feeQuoter.getTokenTransferCost(DEST_CHAIN_SELECTOR, feeToken, s_wrappedTokenPrice, multiple); + + // Note that there can be a rounding error once per split. + assertGe(feeMultipleUSDWei, (feeSingleUSDWei - destChainConfig.maxNumberOfTokensPerMsg)); + assertEq(gasOverheadMultiple, gasOverheadSingle * transfers); + assertEq(bytesOverheadMultiple, bytesOverheadSingle * transfers); + } + + function test_MixedTokenTransferFee_Success() public view { + address[3] memory testTokens = [s_sourceFeeToken, s_sourceRouter.getWrappedNative(), CUSTOM_TOKEN]; + uint224[3] memory tokenPrices = [s_feeTokenPrice, s_wrappedTokenPrice, s_customTokenPrice]; + FeeQuoter.TokenTransferFeeConfig[3] memory tokenTransferFeeConfigs = [ + s_feeQuoter.getTokenTransferFeeConfig(DEST_CHAIN_SELECTOR, testTokens[0]), + s_feeQuoter.getTokenTransferFeeConfig(DEST_CHAIN_SELECTOR, testTokens[1]), + s_feeQuoter.getTokenTransferFeeConfig(DEST_CHAIN_SELECTOR, testTokens[2]) + ]; + + Client.EVM2AnyMessage memory message = Client.EVM2AnyMessage({ + receiver: abi.encode(OWNER), + data: "", + tokenAmounts: new Client.EVMTokenAmount[](3), + feeToken: s_sourceRouter.getWrappedNative(), + extraArgs: Client._argsToBytes(Client.EVMExtraArgsV1({gasLimit: GAS_LIMIT})) + }); + uint256 expectedTotalGas = 0; + uint256 expectedTotalBytes = 0; + + // Start with small token transfers, total bps fee is lower than min token transfer fee + for (uint256 i = 0; i < testTokens.length; ++i) { + message.tokenAmounts[i] = Client.EVMTokenAmount({token: testTokens[i], amount: 1e14}); + FeeQuoter.TokenTransferFeeConfig memory tokenTransferFeeConfig = + s_feeQuoter.getTokenTransferFeeConfig(DEST_CHAIN_SELECTOR, testTokens[i]); + + expectedTotalGas += tokenTransferFeeConfig.destGasOverhead == 0 + ? DEFAULT_TOKEN_DEST_GAS_OVERHEAD + : tokenTransferFeeConfig.destGasOverhead; + expectedTotalBytes += tokenTransferFeeConfig.destBytesOverhead == 0 + ? DEFAULT_TOKEN_BYTES_OVERHEAD + : tokenTransferFeeConfig.destBytesOverhead; + } + (uint256 feeUSDWei, uint32 destGasOverhead, uint32 destBytesOverhead) = + s_feeQuoter.getTokenTransferCost(DEST_CHAIN_SELECTOR, message.feeToken, s_wrappedTokenPrice, message.tokenAmounts); + + uint256 expectedFeeUSDWei = 0; + for (uint256 i = 0; i < testTokens.length; ++i) { + expectedFeeUSDWei += _configUSDCentToWei( + tokenTransferFeeConfigs[i].minFeeUSDCents == 0 + ? DEFAULT_TOKEN_FEE_USD_CENTS + : tokenTransferFeeConfigs[i].minFeeUSDCents + ); + } + + assertEq(expectedFeeUSDWei, feeUSDWei, "wrong feeUSDWei 1"); + assertEq(expectedTotalGas, destGasOverhead, "wrong destGasOverhead 1"); + assertEq(expectedTotalBytes, destBytesOverhead, "wrong destBytesOverhead 1"); + + // Set 1st token transfer to a meaningful amount so its bps fee is now between min and max fee + message.tokenAmounts[0] = Client.EVMTokenAmount({token: testTokens[0], amount: 10000e18}); + + uint256 token0USDWei = _applyBpsRatio( + _calcUSDValueFromTokenAmount(tokenPrices[0], message.tokenAmounts[0].amount), tokenTransferFeeConfigs[0].deciBps + ); + uint256 token1USDWei = _configUSDCentToWei(DEFAULT_TOKEN_FEE_USD_CENTS); + + (feeUSDWei, destGasOverhead, destBytesOverhead) = + s_feeQuoter.getTokenTransferCost(DEST_CHAIN_SELECTOR, message.feeToken, s_wrappedTokenPrice, message.tokenAmounts); + expectedFeeUSDWei = token0USDWei + token1USDWei + _configUSDCentToWei(tokenTransferFeeConfigs[2].minFeeUSDCents); + + assertEq(expectedFeeUSDWei, feeUSDWei, "wrong feeUSDWei 2"); + assertEq(expectedTotalGas, destGasOverhead, "wrong destGasOverhead 2"); + assertEq(expectedTotalBytes, destBytesOverhead, "wrong destBytesOverhead 2"); + + // Set 2nd token transfer to a large amount that is higher than maxFeeUSD + message.tokenAmounts[2] = Client.EVMTokenAmount({token: testTokens[2], amount: 1e36}); + + (feeUSDWei, destGasOverhead, destBytesOverhead) = + s_feeQuoter.getTokenTransferCost(DEST_CHAIN_SELECTOR, message.feeToken, s_wrappedTokenPrice, message.tokenAmounts); + expectedFeeUSDWei = token0USDWei + token1USDWei + _configUSDCentToWei(tokenTransferFeeConfigs[2].maxFeeUSDCents); + + assertEq(expectedFeeUSDWei, feeUSDWei, "wrong feeUSDWei 3"); + assertEq(expectedTotalGas, destGasOverhead, "wrong destGasOverhead 3"); + assertEq(expectedTotalBytes, destBytesOverhead, "wrong destBytesOverhead 3"); + } +} + +contract FeeQuoter_getValidatedFee is FeeQuoterFeeSetup { + using USDPriceWith18Decimals for uint224; + + function test_EmptyMessage_Success() public view { + address[2] memory testTokens = [s_sourceFeeToken, s_sourceRouter.getWrappedNative()]; + uint224[2] memory feeTokenPrices = [s_feeTokenPrice, s_wrappedTokenPrice]; + + for (uint256 i = 0; i < feeTokenPrices.length; ++i) { + Client.EVM2AnyMessage memory message = _generateEmptyMessage(); + message.feeToken = testTokens[i]; + uint64 premiumMultiplierWeiPerEth = s_feeQuoter.getPremiumMultiplierWeiPerEth(message.feeToken); + FeeQuoter.DestChainConfig memory destChainConfig = s_feeQuoter.getDestChainConfig(DEST_CHAIN_SELECTOR); + + uint256 feeAmount = s_feeQuoter.getValidatedFee(DEST_CHAIN_SELECTOR, message); + + uint256 gasUsed = GAS_LIMIT + DEST_GAS_OVERHEAD; + uint256 gasFeeUSD = (gasUsed * destChainConfig.gasMultiplierWeiPerEth * USD_PER_GAS); + uint256 messageFeeUSD = (_configUSDCentToWei(destChainConfig.networkFeeUSDCents) * premiumMultiplierWeiPerEth); + uint256 dataAvailabilityFeeUSD = s_feeQuoter.getDataAvailabilityCost( + DEST_CHAIN_SELECTOR, USD_PER_DATA_AVAILABILITY_GAS, message.data.length, message.tokenAmounts.length, 0 + ); + + uint256 totalPriceInFeeToken = (gasFeeUSD + messageFeeUSD + dataAvailabilityFeeUSD) / feeTokenPrices[i]; + assertEq(totalPriceInFeeToken, feeAmount); + } + } + + function test_ZeroDataAvailabilityMultiplier_Success() public { + FeeQuoter.DestChainConfigArgs[] memory destChainConfigArgs = new FeeQuoter.DestChainConfigArgs[](1); + FeeQuoter.DestChainConfig memory destChainConfig = s_feeQuoter.getDestChainConfig(DEST_CHAIN_SELECTOR); + destChainConfigArgs[0] = + FeeQuoter.DestChainConfigArgs({destChainSelector: DEST_CHAIN_SELECTOR, destChainConfig: destChainConfig}); + destChainConfigArgs[0].destChainConfig.destDataAvailabilityMultiplierBps = 0; + s_feeQuoter.applyDestChainConfigUpdates(destChainConfigArgs); + + Client.EVM2AnyMessage memory message = _generateEmptyMessage(); + uint64 premiumMultiplierWeiPerEth = s_feeQuoter.getPremiumMultiplierWeiPerEth(message.feeToken); + + uint256 feeAmount = s_feeQuoter.getValidatedFee(DEST_CHAIN_SELECTOR, message); + + uint256 gasUsed = GAS_LIMIT + DEST_GAS_OVERHEAD; + uint256 gasFeeUSD = (gasUsed * destChainConfig.gasMultiplierWeiPerEth * USD_PER_GAS); + uint256 messageFeeUSD = (_configUSDCentToWei(destChainConfig.networkFeeUSDCents) * premiumMultiplierWeiPerEth); + + uint256 totalPriceInFeeToken = (gasFeeUSD + messageFeeUSD) / s_feeTokenPrice; + assertEq(totalPriceInFeeToken, feeAmount); + } + + function test_HighGasMessage_Success() public view { + address[2] memory testTokens = [s_sourceFeeToken, s_sourceRouter.getWrappedNative()]; + uint224[2] memory feeTokenPrices = [s_feeTokenPrice, s_wrappedTokenPrice]; + + uint256 customGasLimit = MAX_GAS_LIMIT; + uint256 customDataSize = MAX_DATA_SIZE; + for (uint256 i = 0; i < feeTokenPrices.length; ++i) { + Client.EVM2AnyMessage memory message = Client.EVM2AnyMessage({ + receiver: abi.encode(OWNER), + data: new bytes(customDataSize), + tokenAmounts: new Client.EVMTokenAmount[](0), + feeToken: testTokens[i], + extraArgs: Client._argsToBytes(Client.EVMExtraArgsV1({gasLimit: customGasLimit})) + }); + + uint64 premiumMultiplierWeiPerEth = s_feeQuoter.getPremiumMultiplierWeiPerEth(message.feeToken); + FeeQuoter.DestChainConfig memory destChainConfig = s_feeQuoter.getDestChainConfig(DEST_CHAIN_SELECTOR); + + uint256 feeAmount = s_feeQuoter.getValidatedFee(DEST_CHAIN_SELECTOR, message); + uint256 gasUsed = customGasLimit + DEST_GAS_OVERHEAD + customDataSize * DEST_GAS_PER_PAYLOAD_BYTE; + uint256 gasFeeUSD = (gasUsed * destChainConfig.gasMultiplierWeiPerEth * USD_PER_GAS); + uint256 messageFeeUSD = (_configUSDCentToWei(destChainConfig.networkFeeUSDCents) * premiumMultiplierWeiPerEth); + uint256 dataAvailabilityFeeUSD = s_feeQuoter.getDataAvailabilityCost( + DEST_CHAIN_SELECTOR, USD_PER_DATA_AVAILABILITY_GAS, message.data.length, message.tokenAmounts.length, 0 + ); + + uint256 totalPriceInFeeToken = (gasFeeUSD + messageFeeUSD + dataAvailabilityFeeUSD) / feeTokenPrices[i]; + assertEq(totalPriceInFeeToken, feeAmount); + } + } + + function test_SingleTokenMessage_Success() public view { + address[2] memory testTokens = [s_sourceFeeToken, s_sourceRouter.getWrappedNative()]; + uint224[2] memory feeTokenPrices = [s_feeTokenPrice, s_wrappedTokenPrice]; + + uint256 tokenAmount = 10000e18; + for (uint256 i = 0; i < feeTokenPrices.length; ++i) { + Client.EVM2AnyMessage memory message = _generateSingleTokenMessage(s_sourceFeeToken, tokenAmount); + message.feeToken = testTokens[i]; + FeeQuoter.DestChainConfig memory destChainConfig = s_feeQuoter.getDestChainConfig(DEST_CHAIN_SELECTOR); + uint32 destBytesOverhead = + s_feeQuoter.getTokenTransferFeeConfig(DEST_CHAIN_SELECTOR, message.tokenAmounts[0].token).destBytesOverhead; + uint32 tokenBytesOverhead = + destBytesOverhead == 0 ? uint32(Pool.CCIP_LOCK_OR_BURN_V1_RET_BYTES) : destBytesOverhead; + + uint256 feeAmount = s_feeQuoter.getValidatedFee(DEST_CHAIN_SELECTOR, message); + + uint256 gasUsed = GAS_LIMIT + DEST_GAS_OVERHEAD + + s_feeQuoter.getTokenTransferFeeConfig(DEST_CHAIN_SELECTOR, message.tokenAmounts[0].token).destGasOverhead; + uint256 gasFeeUSD = (gasUsed * destChainConfig.gasMultiplierWeiPerEth * USD_PER_GAS); + (uint256 transferFeeUSD,,) = + s_feeQuoter.getTokenTransferCost(DEST_CHAIN_SELECTOR, message.feeToken, feeTokenPrices[i], message.tokenAmounts); + uint256 messageFeeUSD = (transferFeeUSD * s_feeQuoter.getPremiumMultiplierWeiPerEth(message.feeToken)); + uint256 dataAvailabilityFeeUSD = s_feeQuoter.getDataAvailabilityCost( + DEST_CHAIN_SELECTOR, + USD_PER_DATA_AVAILABILITY_GAS, + message.data.length, + message.tokenAmounts.length, + tokenBytesOverhead + ); + + uint256 totalPriceInFeeToken = (gasFeeUSD + messageFeeUSD + dataAvailabilityFeeUSD) / feeTokenPrices[i]; + assertEq(totalPriceInFeeToken, feeAmount); + } + } + + function test_MessageWithDataAndTokenTransfer_Success() public view { + address[2] memory testTokens = [s_sourceFeeToken, s_sourceRouter.getWrappedNative()]; + uint224[2] memory feeTokenPrices = [s_feeTokenPrice, s_wrappedTokenPrice]; + + uint256 customGasLimit = 1_000_000; + for (uint256 i = 0; i < feeTokenPrices.length; ++i) { + Client.EVM2AnyMessage memory message = Client.EVM2AnyMessage({ + receiver: abi.encode(OWNER), + data: "", + tokenAmounts: new Client.EVMTokenAmount[](2), + feeToken: testTokens[i], + extraArgs: Client._argsToBytes(Client.EVMExtraArgsV1({gasLimit: customGasLimit})) + }); + uint64 premiumMultiplierWeiPerEth = s_feeQuoter.getPremiumMultiplierWeiPerEth(message.feeToken); + FeeQuoter.DestChainConfig memory destChainConfig = s_feeQuoter.getDestChainConfig(DEST_CHAIN_SELECTOR); + + message.tokenAmounts[0] = Client.EVMTokenAmount({token: s_sourceFeeToken, amount: 10000e18}); // feeTokenAmount + message.tokenAmounts[1] = Client.EVMTokenAmount({token: CUSTOM_TOKEN, amount: 200000e18}); // customTokenAmount + message.data = "random bits and bytes that should be factored into the cost of the message"; + + uint32 tokenGasOverhead = 0; + uint32 tokenBytesOverhead = 0; + for (uint256 j = 0; j < message.tokenAmounts.length; ++j) { + tokenGasOverhead += + s_feeQuoter.getTokenTransferFeeConfig(DEST_CHAIN_SELECTOR, message.tokenAmounts[j].token).destGasOverhead; + uint32 destBytesOverhead = + s_feeQuoter.getTokenTransferFeeConfig(DEST_CHAIN_SELECTOR, message.tokenAmounts[j].token).destBytesOverhead; + tokenBytesOverhead += destBytesOverhead == 0 ? uint32(Pool.CCIP_LOCK_OR_BURN_V1_RET_BYTES) : destBytesOverhead; + } + + uint256 gasUsed = + customGasLimit + DEST_GAS_OVERHEAD + message.data.length * DEST_GAS_PER_PAYLOAD_BYTE + tokenGasOverhead; + uint256 gasFeeUSD = (gasUsed * destChainConfig.gasMultiplierWeiPerEth * USD_PER_GAS); + (uint256 transferFeeUSD,,) = + s_feeQuoter.getTokenTransferCost(DEST_CHAIN_SELECTOR, message.feeToken, feeTokenPrices[i], message.tokenAmounts); + uint256 messageFeeUSD = (transferFeeUSD * premiumMultiplierWeiPerEth); + uint256 dataAvailabilityFeeUSD = s_feeQuoter.getDataAvailabilityCost( + DEST_CHAIN_SELECTOR, + USD_PER_DATA_AVAILABILITY_GAS, + message.data.length, + message.tokenAmounts.length, + tokenBytesOverhead + ); + + uint256 totalPriceInFeeToken = (gasFeeUSD + messageFeeUSD + dataAvailabilityFeeUSD) / feeTokenPrices[i]; + assertEq(totalPriceInFeeToken, s_feeQuoter.getValidatedFee(DEST_CHAIN_SELECTOR, message)); + } + } + + function test_Fuzz_EnforceOutOfOrder(bool enforce, bool allowOutOfOrderExecution) public { + // Update config to enforce allowOutOfOrderExecution = defaultVal. + vm.stopPrank(); + vm.startPrank(OWNER); + + FeeQuoter.DestChainConfigArgs[] memory destChainConfigArgs = _generateFeeQuoterDestChainConfigArgs(); + destChainConfigArgs[0].destChainConfig.enforceOutOfOrder = enforce; + s_feeQuoter.applyDestChainConfigUpdates(destChainConfigArgs); + + Client.EVM2AnyMessage memory message = _generateEmptyMessage(); + message.extraArgs = abi.encodeWithSelector( + Client.EVM_EXTRA_ARGS_V2_TAG, + Client.EVMExtraArgsV2({gasLimit: GAS_LIMIT * 2, allowOutOfOrderExecution: allowOutOfOrderExecution}) + ); + + // If enforcement is on, only true should be allowed. + if (enforce && !allowOutOfOrderExecution) { + vm.expectRevert(FeeQuoter.ExtraArgOutOfOrderExecutionMustBeTrue.selector); + } + s_feeQuoter.getValidatedFee(DEST_CHAIN_SELECTOR, message); + } + + // Reverts + + function test_DestinationChainNotEnabled_Revert() public { + vm.expectRevert(abi.encodeWithSelector(FeeQuoter.DestinationChainNotEnabled.selector, DEST_CHAIN_SELECTOR + 1)); + s_feeQuoter.getValidatedFee(DEST_CHAIN_SELECTOR + 1, _generateEmptyMessage()); + } + + function test_EnforceOutOfOrder_Revert() public { + // Update config to enforce allowOutOfOrderExecution = true. + vm.stopPrank(); + vm.startPrank(OWNER); + + FeeQuoter.DestChainConfigArgs[] memory destChainConfigArgs = _generateFeeQuoterDestChainConfigArgs(); + destChainConfigArgs[0].destChainConfig.enforceOutOfOrder = true; + s_feeQuoter.applyDestChainConfigUpdates(destChainConfigArgs); + vm.stopPrank(); + + Client.EVM2AnyMessage memory message = _generateEmptyMessage(); + // Empty extraArgs to should revert since it enforceOutOfOrder is true. + message.extraArgs = ""; + + vm.expectRevert(FeeQuoter.ExtraArgOutOfOrderExecutionMustBeTrue.selector); + s_feeQuoter.getValidatedFee(DEST_CHAIN_SELECTOR, message); + } + + function test_MessageTooLarge_Revert() public { + Client.EVM2AnyMessage memory message = _generateEmptyMessage(); + message.data = new bytes(MAX_DATA_SIZE + 1); + vm.expectRevert(abi.encodeWithSelector(FeeQuoter.MessageTooLarge.selector, MAX_DATA_SIZE, message.data.length)); + + s_feeQuoter.getValidatedFee(DEST_CHAIN_SELECTOR, message); + } + + function test_TooManyTokens_Revert() public { + Client.EVM2AnyMessage memory message = _generateEmptyMessage(); + uint256 tooMany = MAX_TOKENS_LENGTH + 1; + message.tokenAmounts = new Client.EVMTokenAmount[](tooMany); + vm.expectRevert(FeeQuoter.UnsupportedNumberOfTokens.selector); + s_feeQuoter.getValidatedFee(DEST_CHAIN_SELECTOR, message); + } + + // Asserts gasLimit must be <=maxGasLimit + function test_MessageGasLimitTooHigh_Revert() public { + Client.EVM2AnyMessage memory message = _generateEmptyMessage(); + message.extraArgs = Client._argsToBytes(Client.EVMExtraArgsV1({gasLimit: MAX_GAS_LIMIT + 1})); + vm.expectRevert(abi.encodeWithSelector(FeeQuoter.MessageGasLimitTooHigh.selector)); + s_feeQuoter.getValidatedFee(DEST_CHAIN_SELECTOR, message); + } + + function test_NotAFeeToken_Revert() public { + address notAFeeToken = address(0x111111); + Client.EVM2AnyMessage memory message = _generateSingleTokenMessage(notAFeeToken, 1); + message.feeToken = notAFeeToken; + + vm.expectRevert(abi.encodeWithSelector(FeeQuoter.FeeTokenNotSupported.selector, notAFeeToken)); + + s_feeQuoter.getValidatedFee(DEST_CHAIN_SELECTOR, message); + } + + function test_InvalidEVMAddress_Revert() public { + Client.EVM2AnyMessage memory message = _generateEmptyMessage(); + message.receiver = abi.encode(type(uint208).max); + + vm.expectRevert(abi.encodeWithSelector(Internal.InvalidEVMAddress.selector, message.receiver)); + + s_feeQuoter.getValidatedFee(DEST_CHAIN_SELECTOR, message); + } +} + +contract FeeQuoter_processMessageArgs is FeeQuoterFeeSetup { + using USDPriceWith18Decimals for uint224; + + function setUp() public virtual override { + super.setUp(); + } + + function test_WithLinkTokenAmount_Success() public view { + ( + uint256 msgFeeJuels, + /* bool isOutOfOrderExecution */ + , + /* bytes memory convertedExtraArgs */ + ) = s_feeQuoter.processMessageArgs( + DEST_CHAIN_SELECTOR, + // LINK + s_sourceTokens[0], + MAX_MSG_FEES_JUELS, + "" + ); + + assertEq(msgFeeJuels, MAX_MSG_FEES_JUELS); + } + + function test_WithConvertedTokenAmount_Success() public view { + address feeToken = s_sourceTokens[1]; + uint256 feeTokenAmount = 10_000 gwei; + uint256 expectedConvertedAmount = s_feeQuoter.convertTokenAmount(feeToken, feeTokenAmount, s_sourceTokens[0]); + + ( + uint256 msgFeeJuels, + /* bool isOutOfOrderExecution */ + , + /* bytes memory convertedExtraArgs */ + ) = s_feeQuoter.processMessageArgs(DEST_CHAIN_SELECTOR, feeToken, feeTokenAmount, ""); + + assertEq(msgFeeJuels, expectedConvertedAmount); + } + + function test_WithEmptyEVMExtraArgs_Success() public view { + ( + /* uint256 msgFeeJuels */ + , + bool isOutOfOrderExecution, + bytes memory convertedExtraArgs + ) = s_feeQuoter.processMessageArgs(DEST_CHAIN_SELECTOR, s_sourceTokens[0], 0, ""); + + assertEq(isOutOfOrderExecution, false); + assertEq(convertedExtraArgs, Client._argsToBytes(s_feeQuoter.parseEVMExtraArgsFromBytes("", DEST_CHAIN_SELECTOR))); + } + + function test_WithEVMExtraArgsV1_Success() public view { + bytes memory extraArgs = Client._argsToBytes(Client.EVMExtraArgsV1({gasLimit: 1000})); + + ( + /* uint256 msgFeeJuels */ + , + bool isOutOfOrderExecution, + bytes memory convertedExtraArgs + ) = s_feeQuoter.processMessageArgs(DEST_CHAIN_SELECTOR, s_sourceTokens[0], 0, extraArgs); + + assertEq(isOutOfOrderExecution, false); + assertEq( + convertedExtraArgs, Client._argsToBytes(s_feeQuoter.parseEVMExtraArgsFromBytes(extraArgs, DEST_CHAIN_SELECTOR)) + ); + } + + function test_WitEVMExtraArgsV2_Success() public view { + bytes memory extraArgs = Client._argsToBytes(Client.EVMExtraArgsV2({gasLimit: 0, allowOutOfOrderExecution: true})); + + ( + /* uint256 msgFeeJuels */ + , + bool isOutOfOrderExecution, + bytes memory convertedExtraArgs + ) = s_feeQuoter.processMessageArgs(DEST_CHAIN_SELECTOR, s_sourceTokens[0], 0, extraArgs); + + assertEq(isOutOfOrderExecution, true); + assertEq( + convertedExtraArgs, Client._argsToBytes(s_feeQuoter.parseEVMExtraArgsFromBytes(extraArgs, DEST_CHAIN_SELECTOR)) + ); + } + + // Reverts + + function test_MessageFeeTooHigh_Revert() public { + vm.expectRevert( + abi.encodeWithSelector(FeeQuoter.MessageFeeTooHigh.selector, MAX_MSG_FEES_JUELS + 1, MAX_MSG_FEES_JUELS) + ); + + s_feeQuoter.processMessageArgs(DEST_CHAIN_SELECTOR, s_sourceTokens[0], MAX_MSG_FEES_JUELS + 1, ""); + } + + function test_InvalidExtraArgs_Revert() public { + vm.expectRevert(FeeQuoter.InvalidExtraArgsTag.selector); + + s_feeQuoter.processMessageArgs(DEST_CHAIN_SELECTOR, s_sourceTokens[0], 0, "abcde"); + } + + function test_MalformedEVMExtraArgs_Revert() public { + // abi.decode error + vm.expectRevert(); + + s_feeQuoter.processMessageArgs( + DEST_CHAIN_SELECTOR, + s_sourceTokens[0], + 0, + abi.encodeWithSelector(Client.EVM_EXTRA_ARGS_V2_TAG, Client.EVMExtraArgsV1({gasLimit: 100})) + ); + } +} + +contract FeeQuoter_validatePoolReturnData is FeeQuoterFeeSetup { + function test_ProcessPoolReturnData_Success() public view { + Client.EVMTokenAmount[] memory sourceTokenAmounts = new Client.EVMTokenAmount[](2); + sourceTokenAmounts[0].amount = 1e18; + sourceTokenAmounts[0].token = s_sourceTokens[0]; + sourceTokenAmounts[1].amount = 1e18; + sourceTokenAmounts[1].token = CUSTOM_TOKEN_2; + + Internal.RampTokenAmount[] memory rampTokenAmounts = new Internal.RampTokenAmount[](2); + rampTokenAmounts[0] = _getSourceTokenData(sourceTokenAmounts[0], s_tokenAdminRegistry, DEST_CHAIN_SELECTOR); + rampTokenAmounts[1] = _getSourceTokenData(sourceTokenAmounts[1], s_tokenAdminRegistry, DEST_CHAIN_SELECTOR); + bytes[] memory expectedDestExecData = new bytes[](2); + expectedDestExecData[0] = abi.encode( + s_feeQuoterTokenTransferFeeConfigArgs[0].tokenTransferFeeConfigs[0].tokenTransferFeeConfig.destGasOverhead + ); + expectedDestExecData[1] = abi.encode(DEFAULT_TOKEN_DEST_GAS_OVERHEAD); //expected return data should be abi.encoded default as isEnabled is false + + // No revert - successful + bytes[] memory destExecData = + s_feeQuoter.processPoolReturnData(DEST_CHAIN_SELECTOR, rampTokenAmounts, sourceTokenAmounts); + + for (uint256 i = 0; i < destExecData.length; ++i) { + assertEq(destExecData[i], expectedDestExecData[i]); + } + } + + function test_TokenAmountArraysMismatching_Revert() public { + Client.EVMTokenAmount[] memory sourceTokenAmounts = new Client.EVMTokenAmount[](2); + sourceTokenAmounts[0].amount = 1e18; + sourceTokenAmounts[0].token = s_sourceTokens[0]; + + Internal.RampTokenAmount[] memory rampTokenAmounts = new Internal.RampTokenAmount[](1); + rampTokenAmounts[0] = _getSourceTokenData(sourceTokenAmounts[0], s_tokenAdminRegistry, DEST_CHAIN_SELECTOR); + + // Revert due to index out of bounds access + vm.expectRevert(); + + s_feeQuoter.processPoolReturnData( + DEST_CHAIN_SELECTOR, new Internal.RampTokenAmount[](1), new Client.EVMTokenAmount[](0) + ); + } + + function test_SourceTokenDataTooLarge_Revert() public { + address sourceETH = s_sourceTokens[1]; + + Client.EVMTokenAmount[] memory sourceTokenAmounts = new Client.EVMTokenAmount[](1); + sourceTokenAmounts[0].amount = 1000; + sourceTokenAmounts[0].token = sourceETH; + + Internal.RampTokenAmount[] memory rampTokenAmounts = new Internal.RampTokenAmount[](1); + rampTokenAmounts[0] = _getSourceTokenData(sourceTokenAmounts[0], s_tokenAdminRegistry, DEST_CHAIN_SELECTOR); + + // No data set, should succeed + s_feeQuoter.processPoolReturnData(DEST_CHAIN_SELECTOR, rampTokenAmounts, sourceTokenAmounts); + + // Set max data length, should succeed + rampTokenAmounts[0].extraData = new bytes(Pool.CCIP_LOCK_OR_BURN_V1_RET_BYTES); + s_feeQuoter.processPoolReturnData(DEST_CHAIN_SELECTOR, rampTokenAmounts, sourceTokenAmounts); + + // Set data to max length +1, should revert + rampTokenAmounts[0].extraData = new bytes(Pool.CCIP_LOCK_OR_BURN_V1_RET_BYTES + 1); + vm.expectRevert(abi.encodeWithSelector(FeeQuoter.SourceTokenDataTooLarge.selector, sourceETH)); + s_feeQuoter.processPoolReturnData(DEST_CHAIN_SELECTOR, rampTokenAmounts, sourceTokenAmounts); + + // Set token config to allow larger data + FeeQuoter.TokenTransferFeeConfigArgs[] memory tokenTransferFeeConfigArgs = _generateTokenTransferFeeConfigArgs(1, 1); + tokenTransferFeeConfigArgs[0].destChainSelector = DEST_CHAIN_SELECTOR; + tokenTransferFeeConfigArgs[0].tokenTransferFeeConfigs[0].token = sourceETH; + tokenTransferFeeConfigArgs[0].tokenTransferFeeConfigs[0].tokenTransferFeeConfig = FeeQuoter.TokenTransferFeeConfig({ + minFeeUSDCents: 1, + maxFeeUSDCents: 0, + deciBps: 0, + destGasOverhead: 0, + destBytesOverhead: uint32(Pool.CCIP_LOCK_OR_BURN_V1_RET_BYTES) + 32, + isEnabled: true + }); + s_feeQuoter.applyTokenTransferFeeConfigUpdates( + tokenTransferFeeConfigArgs, new FeeQuoter.TokenTransferFeeConfigRemoveArgs[](0) + ); + + s_feeQuoter.processPoolReturnData(DEST_CHAIN_SELECTOR, rampTokenAmounts, sourceTokenAmounts); + + // Set the token data larger than the configured token data, should revert + rampTokenAmounts[0].extraData = new bytes(Pool.CCIP_LOCK_OR_BURN_V1_RET_BYTES + 32 + 1); + + vm.expectRevert(abi.encodeWithSelector(FeeQuoter.SourceTokenDataTooLarge.selector, sourceETH)); + s_feeQuoter.processPoolReturnData(DEST_CHAIN_SELECTOR, rampTokenAmounts, sourceTokenAmounts); + } + + function test_InvalidEVMAddressDestToken_Revert() public { + bytes memory nonEvmAddress = abi.encode(type(uint208).max); + + Client.EVMTokenAmount[] memory sourceTokenAmounts = new Client.EVMTokenAmount[](1); + sourceTokenAmounts[0].amount = 1e18; + sourceTokenAmounts[0].token = s_sourceTokens[0]; + + Internal.RampTokenAmount[] memory rampTokenAmounts = new Internal.RampTokenAmount[](1); + rampTokenAmounts[0] = _getSourceTokenData(sourceTokenAmounts[0], s_tokenAdminRegistry, DEST_CHAIN_SELECTOR); + rampTokenAmounts[0].destTokenAddress = nonEvmAddress; + + vm.expectRevert(abi.encodeWithSelector(Internal.InvalidEVMAddress.selector, nonEvmAddress)); + s_feeQuoter.processPoolReturnData(DEST_CHAIN_SELECTOR, rampTokenAmounts, sourceTokenAmounts); + } +} + +contract FeeQuoter_validateDestFamilyAddress is FeeQuoterSetup { + function test_ValidEVMAddress_Success() public view { + bytes memory encodedAddress = abi.encode(address(10000)); + s_feeQuoter.validateDestFamilyAddress(Internal.CHAIN_FAMILY_SELECTOR_EVM, encodedAddress); + } + + function test_ValidNonEVMAddress_Success() public view { + s_feeQuoter.validateDestFamilyAddress(bytes4(uint32(1)), abi.encode(type(uint208).max)); + } + + // Reverts + + function test_InvalidEVMAddress_Revert() public { + bytes memory invalidAddress = abi.encode(type(uint208).max); + vm.expectRevert(abi.encodeWithSelector(Internal.InvalidEVMAddress.selector, invalidAddress)); + s_feeQuoter.validateDestFamilyAddress(Internal.CHAIN_FAMILY_SELECTOR_EVM, invalidAddress); + } + + function test_InvalidEVMAddressEncodePacked_Revert() public { + bytes memory invalidAddress = abi.encodePacked(address(234)); + vm.expectRevert(abi.encodeWithSelector(Internal.InvalidEVMAddress.selector, invalidAddress)); + s_feeQuoter.validateDestFamilyAddress(Internal.CHAIN_FAMILY_SELECTOR_EVM, invalidAddress); + } + + function test_InvalidEVMAddressPrecompiles_Revert() public { + for (uint160 i = 0; i < Internal.PRECOMPILE_SPACE; ++i) { + bytes memory invalidAddress = abi.encode(address(i)); + vm.expectRevert(abi.encodeWithSelector(Internal.InvalidEVMAddress.selector, invalidAddress)); + s_feeQuoter.validateDestFamilyAddress(Internal.CHAIN_FAMILY_SELECTOR_EVM, invalidAddress); + } + + s_feeQuoter.validateDestFamilyAddress( + Internal.CHAIN_FAMILY_SELECTOR_EVM, abi.encode(address(uint160(Internal.PRECOMPILE_SPACE))) + ); + } +} + +contract FeeQuoter_parseEVMExtraArgsFromBytes is FeeQuoterSetup { + FeeQuoter.DestChainConfig private s_destChainConfig; + + function setUp() public virtual override { + super.setUp(); + s_destChainConfig = _generateFeeQuoterDestChainConfigArgs()[0].destChainConfig; + } + + function test_EVMExtraArgsV1_Success() public view { + Client.EVMExtraArgsV1 memory inputArgs = Client.EVMExtraArgsV1({gasLimit: GAS_LIMIT}); + bytes memory inputExtraArgs = Client._argsToBytes(inputArgs); + Client.EVMExtraArgsV2 memory expectedOutputArgs = + Client.EVMExtraArgsV2({gasLimit: GAS_LIMIT, allowOutOfOrderExecution: false}); + + vm.assertEq( + abi.encode(s_feeQuoter.parseEVMExtraArgsFromBytes(inputExtraArgs, s_destChainConfig)), + abi.encode(expectedOutputArgs) + ); + } + + function test_EVMExtraArgsV2_Success() public view { + Client.EVMExtraArgsV2 memory inputArgs = + Client.EVMExtraArgsV2({gasLimit: GAS_LIMIT, allowOutOfOrderExecution: true}); + bytes memory inputExtraArgs = Client._argsToBytes(inputArgs); + + vm.assertEq( + abi.encode(s_feeQuoter.parseEVMExtraArgsFromBytes(inputExtraArgs, s_destChainConfig)), abi.encode(inputArgs) + ); + } + + function test_EVMExtraArgsDefault_Success() public view { + Client.EVMExtraArgsV2 memory expectedOutputArgs = + Client.EVMExtraArgsV2({gasLimit: s_destChainConfig.defaultTxGasLimit, allowOutOfOrderExecution: false}); + + vm.assertEq( + abi.encode(s_feeQuoter.parseEVMExtraArgsFromBytes("", s_destChainConfig)), abi.encode(expectedOutputArgs) + ); + } + + // Reverts + + function test_EVMExtraArgsInvalidExtraArgsTag_Revert() public { + Client.EVMExtraArgsV2 memory inputArgs = + Client.EVMExtraArgsV2({gasLimit: GAS_LIMIT, allowOutOfOrderExecution: true}); + bytes memory inputExtraArgs = Client._argsToBytes(inputArgs); + // Invalidate selector + inputExtraArgs[0] = bytes1(uint8(0)); + + vm.expectRevert(FeeQuoter.InvalidExtraArgsTag.selector); + s_feeQuoter.parseEVMExtraArgsFromBytes(inputExtraArgs, s_destChainConfig); + } + + function test_EVMExtraArgsEnforceOutOfOrder_Revert() public { + Client.EVMExtraArgsV2 memory inputArgs = + Client.EVMExtraArgsV2({gasLimit: GAS_LIMIT, allowOutOfOrderExecution: false}); + bytes memory inputExtraArgs = Client._argsToBytes(inputArgs); + s_destChainConfig.enforceOutOfOrder = true; + + vm.expectRevert(FeeQuoter.ExtraArgOutOfOrderExecutionMustBeTrue.selector); + s_feeQuoter.parseEVMExtraArgsFromBytes(inputExtraArgs, s_destChainConfig); + } + + function test_EVMExtraArgsGasLimitTooHigh_Revert() public { + Client.EVMExtraArgsV2 memory inputArgs = + Client.EVMExtraArgsV2({gasLimit: s_destChainConfig.maxPerMsgGasLimit + 1, allowOutOfOrderExecution: true}); + bytes memory inputExtraArgs = Client._argsToBytes(inputArgs); + + vm.expectRevert(FeeQuoter.MessageGasLimitTooHigh.selector); + s_feeQuoter.parseEVMExtraArgsFromBytes(inputExtraArgs, s_destChainConfig); + } +} + +contract FeeQuoter_KeystoneSetup is FeeQuoterSetup { + address internal constant FORWARDER_1 = address(0x1); + address internal constant WORKFLOW_OWNER_1 = address(0x3); + bytes10 internal constant WORKFLOW_NAME_1 = "workflow1"; + bytes2 internal constant REPORT_NAME_1 = "01"; + address internal onReportTestToken1; + address internal onReportTestToken2; + + function setUp() public virtual override { + super.setUp(); + onReportTestToken1 = s_sourceTokens[0]; + onReportTestToken2 = _deploySourceToken("onReportTestToken2", 0, 20); + + KeystoneFeedsPermissionHandler.Permission[] memory permissions = new KeystoneFeedsPermissionHandler.Permission[](1); + permissions[0] = KeystoneFeedsPermissionHandler.Permission({ + forwarder: FORWARDER_1, + workflowOwner: WORKFLOW_OWNER_1, + workflowName: WORKFLOW_NAME_1, + reportName: REPORT_NAME_1, + isAllowed: true + }); + FeeQuoter.TokenPriceFeedUpdate[] memory tokenPriceFeeds = new FeeQuoter.TokenPriceFeedUpdate[](2); + tokenPriceFeeds[0] = FeeQuoter.TokenPriceFeedUpdate({ + sourceToken: onReportTestToken1, + feedConfig: IFeeQuoter.TokenPriceFeedConfig({dataFeedAddress: address(0x0), tokenDecimals: 18}) + }); + tokenPriceFeeds[1] = FeeQuoter.TokenPriceFeedUpdate({ + sourceToken: onReportTestToken2, + feedConfig: IFeeQuoter.TokenPriceFeedConfig({dataFeedAddress: address(0x0), tokenDecimals: 20}) + }); + s_feeQuoter.setReportPermissions(permissions); + s_feeQuoter.updateTokenPriceFeeds(tokenPriceFeeds); + } +} + +contract FeeQuoter_onReport is FeeQuoter_KeystoneSetup { + function test_onReport_Success() public { + bytes memory encodedPermissionsMetadata = + abi.encodePacked(keccak256(abi.encode("workflowCID")), WORKFLOW_NAME_1, WORKFLOW_OWNER_1, REPORT_NAME_1); + + FeeQuoter.ReceivedCCIPFeedReport[] memory report = new FeeQuoter.ReceivedCCIPFeedReport[](2); + report[0] = + FeeQuoter.ReceivedCCIPFeedReport({token: onReportTestToken1, price: 4e18, timestamp: uint32(block.timestamp)}); + report[1] = + FeeQuoter.ReceivedCCIPFeedReport({token: onReportTestToken2, price: 4e18, timestamp: uint32(block.timestamp)}); + + uint224 expectedStoredToken1Price = s_feeQuoter.calculateRebasedValue(18, 18, report[0].price); + uint224 expectedStoredToken2Price = s_feeQuoter.calculateRebasedValue(18, 20, report[1].price); + vm.expectEmit(); + emit FeeQuoter.UsdPerTokenUpdated(onReportTestToken1, expectedStoredToken1Price, block.timestamp); + vm.expectEmit(); + emit FeeQuoter.UsdPerTokenUpdated(onReportTestToken2, expectedStoredToken2Price, block.timestamp); + + changePrank(FORWARDER_1); + s_feeQuoter.onReport(encodedPermissionsMetadata, abi.encode(report)); + + vm.assertEq(s_feeQuoter.getTokenPrice(report[0].token).value, expectedStoredToken1Price); + vm.assertEq(s_feeQuoter.getTokenPrice(report[0].token).timestamp, report[0].timestamp); + + vm.assertEq(s_feeQuoter.getTokenPrice(report[1].token).value, expectedStoredToken2Price); + vm.assertEq(s_feeQuoter.getTokenPrice(report[1].token).timestamp, report[1].timestamp); + } + + function test_onReport_InvalidForwarder_Reverts() public { + bytes memory encodedPermissionsMetadata = + abi.encodePacked(keccak256(abi.encode("workflowCID")), WORKFLOW_NAME_1, WORKFLOW_OWNER_1, REPORT_NAME_1); + FeeQuoter.ReceivedCCIPFeedReport[] memory report = new FeeQuoter.ReceivedCCIPFeedReport[](1); + report[0] = + FeeQuoter.ReceivedCCIPFeedReport({token: s_sourceTokens[0], price: 4e18, timestamp: uint32(block.timestamp)}); + + vm.expectRevert( + abi.encodeWithSelector( + KeystoneFeedsPermissionHandler.ReportForwarderUnauthorized.selector, + STRANGER, + WORKFLOW_OWNER_1, + WORKFLOW_NAME_1, + REPORT_NAME_1 + ) + ); + changePrank(STRANGER); + s_feeQuoter.onReport(encodedPermissionsMetadata, abi.encode(report)); + } + + function test_onReport_UnsupportedToken_Reverts() public { + bytes memory encodedPermissionsMetadata = + abi.encodePacked(keccak256(abi.encode("workflowCID")), WORKFLOW_NAME_1, WORKFLOW_OWNER_1, REPORT_NAME_1); + FeeQuoter.ReceivedCCIPFeedReport[] memory report = new FeeQuoter.ReceivedCCIPFeedReport[](1); + report[0] = + FeeQuoter.ReceivedCCIPFeedReport({token: s_sourceTokens[1], price: 4e18, timestamp: uint32(block.timestamp)}); + + vm.expectRevert(abi.encodeWithSelector(FeeQuoter.TokenNotSupported.selector, s_sourceTokens[1])); + changePrank(FORWARDER_1); + s_feeQuoter.onReport(encodedPermissionsMetadata, abi.encode(report)); + } + + function test_OnReport_StaleUpdate_Revert() public { + //Creating a correct report + bytes memory encodedPermissionsMetadata = + abi.encodePacked(keccak256(abi.encode("workflowCID")), WORKFLOW_NAME_1, WORKFLOW_OWNER_1, REPORT_NAME_1); + + FeeQuoter.ReceivedCCIPFeedReport[] memory report = new FeeQuoter.ReceivedCCIPFeedReport[](1); + report[0] = + FeeQuoter.ReceivedCCIPFeedReport({token: onReportTestToken1, price: 4e18, timestamp: uint32(block.timestamp)}); + + uint224 expectedStoredTokenPrice = s_feeQuoter.calculateRebasedValue(18, 18, report[0].price); + + vm.expectEmit(); + emit FeeQuoter.UsdPerTokenUpdated(onReportTestToken1, expectedStoredTokenPrice, block.timestamp); + + changePrank(FORWARDER_1); + //setting the correct price and time with the correct report + s_feeQuoter.onReport(encodedPermissionsMetadata, abi.encode(report)); + + //create a stale report + report[0] = + FeeQuoter.ReceivedCCIPFeedReport({token: onReportTestToken1, price: 4e18, timestamp: uint32(block.timestamp - 1)}); + //expecting a revert + vm.expectRevert( + abi.encodeWithSelector( + FeeQuoter.StaleKeystoneUpdate.selector, onReportTestToken1, block.timestamp - 1, block.timestamp + ) + ); + s_feeQuoter.onReport(encodedPermissionsMetadata, abi.encode(report)); + } +} diff --git a/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoterSetup.t.sol b/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoterSetup.t.sol new file mode 100644 index 00000000000..124980bc81a --- /dev/null +++ b/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoterSetup.t.sol @@ -0,0 +1,436 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {IFeeQuoter} from "../../interfaces/IFeeQuoter.sol"; + +import {MockV3Aggregator} from "../../../tests/MockV3Aggregator.sol"; +import {FeeQuoter} from "../../FeeQuoter.sol"; +import {Client} from "../../libraries/Client.sol"; +import {Internal} from "../../libraries/Internal.sol"; +import {TokenAdminRegistry} from "../../tokenAdminRegistry/TokenAdminRegistry.sol"; +import {TokenSetup} from "../TokenSetup.t.sol"; +import {FeeQuoterHelper} from "../helpers/FeeQuoterHelper.sol"; + +contract FeeQuoterSetup is TokenSetup { + uint112 internal constant USD_PER_GAS = 1e6; // 0.001 gwei + uint112 internal constant USD_PER_DATA_AVAILABILITY_GAS = 1e9; // 1 gwei + + address internal constant CUSTOM_TOKEN = address(12345); + address internal constant CUSTOM_TOKEN_2 = address(bytes20(keccak256("CUSTOM_TOKEN_2"))); + + uint224 internal constant CUSTOM_TOKEN_PRICE = 1e17; // $0.1 CUSTOM + uint224 internal constant CUSTOM_TOKEN_PRICE_2 = 1e18; // $1 CUSTOM + + // Encode L1 gas price and L2 gas price into a packed price. + // L1 gas price is left-shifted to the higher-order bits. + uint224 internal constant PACKED_USD_PER_GAS = + (uint224(USD_PER_DATA_AVAILABILITY_GAS) << Internal.GAS_PRICE_BITS) + USD_PER_GAS; + + FeeQuoterHelper internal s_feeQuoter; + // Cheat to store the price updates in storage since struct arrays aren't supported. + bytes internal s_encodedInitialPriceUpdates; + address internal s_weth; + + address[] internal s_sourceFeeTokens; + uint224[] internal s_sourceTokenPrices; + address[] internal s_destFeeTokens; + uint224[] internal s_destTokenPrices; + + FeeQuoter.PremiumMultiplierWeiPerEthArgs[] internal s_feeQuoterPremiumMultiplierWeiPerEthArgs; + FeeQuoter.TokenTransferFeeConfigArgs[] internal s_feeQuoterTokenTransferFeeConfigArgs; + + mapping(address token => address dataFeedAddress) internal s_dataFeedByToken; + + function setUp() public virtual override { + TokenSetup.setUp(); + + _deployTokenPriceDataFeed(s_sourceFeeToken, 8, 1e8); + + s_weth = s_sourceRouter.getWrappedNative(); + _deployTokenPriceDataFeed(s_weth, 8, 1e11); + + address[] memory sourceFeeTokens = new address[](3); + sourceFeeTokens[0] = s_sourceTokens[0]; + sourceFeeTokens[1] = s_sourceTokens[1]; + sourceFeeTokens[2] = s_sourceRouter.getWrappedNative(); + s_sourceFeeTokens = sourceFeeTokens; + + uint224[] memory sourceTokenPrices = new uint224[](3); + sourceTokenPrices[0] = 5e18; + sourceTokenPrices[1] = 2000e18; + sourceTokenPrices[2] = 2000e18; + s_sourceTokenPrices = sourceTokenPrices; + + address[] memory destFeeTokens = new address[](3); + destFeeTokens[0] = s_destTokens[0]; + destFeeTokens[1] = s_destTokens[1]; + destFeeTokens[2] = s_destRouter.getWrappedNative(); + s_destFeeTokens = destFeeTokens; + + uint224[] memory destTokenPrices = new uint224[](3); + destTokenPrices[0] = 5e18; + destTokenPrices[1] = 2000e18; + destTokenPrices[2] = 2000e18; + s_destTokenPrices = destTokenPrices; + + uint256 sourceTokenCount = sourceFeeTokens.length; + uint256 destTokenCount = destFeeTokens.length; + address[] memory pricedTokens = new address[](sourceTokenCount + destTokenCount); + uint224[] memory tokenPrices = new uint224[](sourceTokenCount + destTokenCount); + for (uint256 i = 0; i < sourceTokenCount; ++i) { + pricedTokens[i] = sourceFeeTokens[i]; + tokenPrices[i] = sourceTokenPrices[i]; + } + for (uint256 i = 0; i < destTokenCount; ++i) { + pricedTokens[i + sourceTokenCount] = destFeeTokens[i]; + tokenPrices[i + sourceTokenCount] = destTokenPrices[i]; + } + + Internal.PriceUpdates memory priceUpdates = _getPriceUpdatesStruct(pricedTokens, tokenPrices); + priceUpdates.gasPriceUpdates = new Internal.GasPriceUpdate[](1); + priceUpdates.gasPriceUpdates[0] = + Internal.GasPriceUpdate({destChainSelector: DEST_CHAIN_SELECTOR, usdPerUnitGas: PACKED_USD_PER_GAS}); + + s_encodedInitialPriceUpdates = abi.encode(priceUpdates); + + address[] memory priceUpdaters = new address[](1); + priceUpdaters[0] = OWNER; + address[] memory feeTokens = new address[](2); + feeTokens[0] = s_sourceTokens[0]; + feeTokens[1] = s_weth; + FeeQuoter.TokenPriceFeedUpdate[] memory tokenPriceFeedUpdates = new FeeQuoter.TokenPriceFeedUpdate[](0); + + s_feeQuoterPremiumMultiplierWeiPerEthArgs.push( + FeeQuoter.PremiumMultiplierWeiPerEthArgs({ + token: s_sourceFeeToken, + premiumMultiplierWeiPerEth: 5e17 // 0.5x + }) + ); + s_feeQuoterPremiumMultiplierWeiPerEthArgs.push( + FeeQuoter.PremiumMultiplierWeiPerEthArgs({ + token: s_sourceRouter.getWrappedNative(), + premiumMultiplierWeiPerEth: 2e18 // 2x + }) + ); + + s_feeQuoterTokenTransferFeeConfigArgs.push(); + s_feeQuoterTokenTransferFeeConfigArgs[0].destChainSelector = DEST_CHAIN_SELECTOR; + s_feeQuoterTokenTransferFeeConfigArgs[0].tokenTransferFeeConfigs.push( + FeeQuoter.TokenTransferFeeConfigSingleTokenArgs({ + token: s_sourceFeeToken, + tokenTransferFeeConfig: FeeQuoter.TokenTransferFeeConfig({ + minFeeUSDCents: 1_00, // 1 USD + maxFeeUSDCents: 1000_00, // 1,000 USD + deciBps: 2_5, // 2.5 bps, or 0.025% + destGasOverhead: 40_000, + destBytesOverhead: 32, + isEnabled: true + }) + }) + ); + s_feeQuoterTokenTransferFeeConfigArgs[0].tokenTransferFeeConfigs.push( + FeeQuoter.TokenTransferFeeConfigSingleTokenArgs({ + token: CUSTOM_TOKEN, + tokenTransferFeeConfig: FeeQuoter.TokenTransferFeeConfig({ + minFeeUSDCents: 2_00, // 1 USD + maxFeeUSDCents: 2000_00, // 1,000 USD + deciBps: 10_0, // 10 bps, or 0.1% + destGasOverhead: 1, + destBytesOverhead: 200, + isEnabled: true + }) + }) + ); + s_feeQuoterTokenTransferFeeConfigArgs[0].tokenTransferFeeConfigs.push( + FeeQuoter.TokenTransferFeeConfigSingleTokenArgs({ + token: CUSTOM_TOKEN_2, + tokenTransferFeeConfig: FeeQuoter.TokenTransferFeeConfig({ + minFeeUSDCents: 2_00, // 1 USD + maxFeeUSDCents: 2000_00, // 1,000 USD + deciBps: 10_0, // 10 bps, or 0.1% + destGasOverhead: 1, + destBytesOverhead: 200, + isEnabled: false + }) + }) + ); + + //setting up the destination token for CUSTOM_TOKEN_2 here as it is specific to these tests + s_destTokenBySourceToken[CUSTOM_TOKEN_2] = address(bytes20(keccak256("CUSTOM_TOKEN_2_DEST"))); + + s_feeQuoter = new FeeQuoterHelper( + FeeQuoter.StaticConfig({ + linkToken: s_sourceTokens[0], + maxFeeJuelsPerMsg: MAX_MSG_FEES_JUELS, + stalenessThreshold: uint32(TWELVE_HOURS) + }), + priceUpdaters, + feeTokens, + tokenPriceFeedUpdates, + s_feeQuoterTokenTransferFeeConfigArgs, + s_feeQuoterPremiumMultiplierWeiPerEthArgs, + _generateFeeQuoterDestChainConfigArgs() + ); + s_feeQuoter.updatePrices(priceUpdates); + } + + function _deployTokenPriceDataFeed(address token, uint8 decimals, int256 initialAnswer) internal returns (address) { + MockV3Aggregator dataFeed = new MockV3Aggregator(decimals, initialAnswer); + s_dataFeedByToken[token] = address(dataFeed); + return address(dataFeed); + } + + function _getPriceUpdatesStruct( + address[] memory tokens, + uint224[] memory prices + ) internal pure returns (Internal.PriceUpdates memory) { + uint256 length = tokens.length; + + Internal.TokenPriceUpdate[] memory tokenPriceUpdates = new Internal.TokenPriceUpdate[](length); + for (uint256 i = 0; i < length; ++i) { + tokenPriceUpdates[i] = Internal.TokenPriceUpdate({sourceToken: tokens[i], usdPerToken: prices[i]}); + } + Internal.PriceUpdates memory priceUpdates = + Internal.PriceUpdates({tokenPriceUpdates: tokenPriceUpdates, gasPriceUpdates: new Internal.GasPriceUpdate[](0)}); + + return priceUpdates; + } + + function _getEmptyPriceUpdates() internal pure returns (Internal.PriceUpdates memory priceUpdates) { + return Internal.PriceUpdates({ + tokenPriceUpdates: new Internal.TokenPriceUpdate[](0), + gasPriceUpdates: new Internal.GasPriceUpdate[](0) + }); + } + + function _getSingleTokenPriceFeedUpdateStruct( + address sourceToken, + address dataFeedAddress, + uint8 tokenDecimals + ) internal pure returns (FeeQuoter.TokenPriceFeedUpdate memory) { + return FeeQuoter.TokenPriceFeedUpdate({ + sourceToken: sourceToken, + feedConfig: IFeeQuoter.TokenPriceFeedConfig({dataFeedAddress: dataFeedAddress, tokenDecimals: tokenDecimals}) + }); + } + + function _initialiseSingleTokenPriceFeed() internal returns (address) { + FeeQuoter.TokenPriceFeedUpdate[] memory tokenPriceFeedUpdates = new FeeQuoter.TokenPriceFeedUpdate[](1); + tokenPriceFeedUpdates[0] = + _getSingleTokenPriceFeedUpdateStruct(s_sourceTokens[0], s_dataFeedByToken[s_sourceTokens[0]], 18); + s_feeQuoter.updateTokenPriceFeeds(tokenPriceFeedUpdates); + return s_sourceTokens[0]; + } + + function _generateTokenTransferFeeConfigArgs( + uint256 destChainSelectorLength, + uint256 tokenLength + ) internal pure returns (FeeQuoter.TokenTransferFeeConfigArgs[] memory) { + FeeQuoter.TokenTransferFeeConfigArgs[] memory tokenTransferFeeConfigArgs = + new FeeQuoter.TokenTransferFeeConfigArgs[](destChainSelectorLength); + for (uint256 i = 0; i < destChainSelectorLength; ++i) { + tokenTransferFeeConfigArgs[i].tokenTransferFeeConfigs = + new FeeQuoter.TokenTransferFeeConfigSingleTokenArgs[](tokenLength); + } + return tokenTransferFeeConfigArgs; + } + + function _generateFeeQuoterDestChainConfigArgs() internal pure returns (FeeQuoter.DestChainConfigArgs[] memory) { + FeeQuoter.DestChainConfigArgs[] memory destChainConfigs = new FeeQuoter.DestChainConfigArgs[](1); + destChainConfigs[0] = FeeQuoter.DestChainConfigArgs({ + destChainSelector: DEST_CHAIN_SELECTOR, + destChainConfig: FeeQuoter.DestChainConfig({ + isEnabled: true, + maxNumberOfTokensPerMsg: MAX_TOKENS_LENGTH, + destGasOverhead: DEST_GAS_OVERHEAD, + destGasPerPayloadByte: DEST_GAS_PER_PAYLOAD_BYTE, + destDataAvailabilityOverheadGas: DEST_DATA_AVAILABILITY_OVERHEAD_GAS, + destGasPerDataAvailabilityByte: DEST_GAS_PER_DATA_AVAILABILITY_BYTE, + destDataAvailabilityMultiplierBps: DEST_GAS_DATA_AVAILABILITY_MULTIPLIER_BPS, + maxDataBytes: MAX_DATA_SIZE, + maxPerMsgGasLimit: MAX_GAS_LIMIT, + defaultTokenFeeUSDCents: DEFAULT_TOKEN_FEE_USD_CENTS, + defaultTokenDestGasOverhead: DEFAULT_TOKEN_DEST_GAS_OVERHEAD, + defaultTxGasLimit: GAS_LIMIT, + gasMultiplierWeiPerEth: 5e17, + networkFeeUSDCents: 1_00, + enforceOutOfOrder: false, + chainFamilySelector: Internal.CHAIN_FAMILY_SELECTOR_EVM + }) + }); + return destChainConfigs; + } + + function _assertTokenPriceFeedConfigEquality( + IFeeQuoter.TokenPriceFeedConfig memory config1, + IFeeQuoter.TokenPriceFeedConfig memory config2 + ) internal pure virtual { + assertEq(config1.dataFeedAddress, config2.dataFeedAddress); + assertEq(config1.tokenDecimals, config2.tokenDecimals); + } + + function _assertTokenPriceFeedConfigUnconfigured(IFeeQuoter.TokenPriceFeedConfig memory config) internal pure virtual { + _assertTokenPriceFeedConfigEquality( + config, IFeeQuoter.TokenPriceFeedConfig({dataFeedAddress: address(0), tokenDecimals: 0}) + ); + } + + function _assertTokenTransferFeeConfigEqual( + FeeQuoter.TokenTransferFeeConfig memory a, + FeeQuoter.TokenTransferFeeConfig memory b + ) internal pure { + assertEq(a.minFeeUSDCents, b.minFeeUSDCents); + assertEq(a.maxFeeUSDCents, b.maxFeeUSDCents); + assertEq(a.deciBps, b.deciBps); + assertEq(a.destGasOverhead, b.destGasOverhead); + assertEq(a.destBytesOverhead, b.destBytesOverhead); + assertEq(a.isEnabled, b.isEnabled); + } + + function _assertFeeQuoterStaticConfigsEqual( + FeeQuoter.StaticConfig memory a, + FeeQuoter.StaticConfig memory b + ) internal pure { + assertEq(a.linkToken, b.linkToken); + assertEq(a.maxFeeJuelsPerMsg, b.maxFeeJuelsPerMsg); + } + + function _assertFeeQuoterDestChainConfigsEqual( + FeeQuoter.DestChainConfig memory a, + FeeQuoter.DestChainConfig memory b + ) internal pure { + assertEq(a.isEnabled, b.isEnabled); + assertEq(a.maxNumberOfTokensPerMsg, b.maxNumberOfTokensPerMsg); + assertEq(a.maxDataBytes, b.maxDataBytes); + assertEq(a.maxPerMsgGasLimit, b.maxPerMsgGasLimit); + assertEq(a.destGasOverhead, b.destGasOverhead); + assertEq(a.destGasPerPayloadByte, b.destGasPerPayloadByte); + assertEq(a.destDataAvailabilityOverheadGas, b.destDataAvailabilityOverheadGas); + assertEq(a.destGasPerDataAvailabilityByte, b.destGasPerDataAvailabilityByte); + assertEq(a.destDataAvailabilityMultiplierBps, b.destDataAvailabilityMultiplierBps); + assertEq(a.defaultTokenFeeUSDCents, b.defaultTokenFeeUSDCents); + assertEq(a.defaultTokenDestGasOverhead, b.defaultTokenDestGasOverhead); + assertEq(a.defaultTxGasLimit, b.defaultTxGasLimit); + } +} + +contract FeeQuoterFeeSetup is FeeQuoterSetup { + uint224 internal s_feeTokenPrice; + uint224 internal s_wrappedTokenPrice; + uint224 internal s_customTokenPrice; + + address internal s_selfServeTokenDefaultPricing = makeAddr("self-serve-token-default-pricing"); + + address internal s_destTokenPool = makeAddr("destTokenPool"); + address internal s_destToken = makeAddr("destToken"); + + function setUp() public virtual override { + super.setUp(); + + s_feeTokenPrice = s_sourceTokenPrices[0]; + s_wrappedTokenPrice = s_sourceTokenPrices[2]; + s_customTokenPrice = CUSTOM_TOKEN_PRICE; + + s_feeQuoter.updatePrices(_getSingleTokenPriceUpdateStruct(CUSTOM_TOKEN, CUSTOM_TOKEN_PRICE)); + } + + function _generateEmptyMessage() public view returns (Client.EVM2AnyMessage memory) { + return Client.EVM2AnyMessage({ + receiver: abi.encode(OWNER), + data: "", + tokenAmounts: new Client.EVMTokenAmount[](0), + feeToken: s_sourceFeeToken, + extraArgs: Client._argsToBytes(Client.EVMExtraArgsV1({gasLimit: GAS_LIMIT})) + }); + } + + function _generateSingleTokenMessage( + address token, + uint256 amount + ) public view returns (Client.EVM2AnyMessage memory) { + Client.EVMTokenAmount[] memory tokenAmounts = new Client.EVMTokenAmount[](1); + tokenAmounts[0] = Client.EVMTokenAmount({token: token, amount: amount}); + + return Client.EVM2AnyMessage({ + receiver: abi.encode(OWNER), + data: "", + tokenAmounts: tokenAmounts, + feeToken: s_sourceFeeToken, + extraArgs: Client._argsToBytes(Client.EVMExtraArgsV1({gasLimit: GAS_LIMIT})) + }); + } + + function _messageToEvent( + Client.EVM2AnyMessage memory message, + uint64 sourceChainSelector, + uint64 destChainSelector, + uint64 seqNum, + uint64 nonce, + uint256 feeTokenAmount, + address originalSender, + bytes32 metadataHash, + TokenAdminRegistry tokenAdminRegistry + ) internal view returns (Internal.EVM2AnyRampMessage memory) { + Client.EVMExtraArgsV2 memory extraArgs = + s_feeQuoter.parseEVMExtraArgsFromBytes(message.extraArgs, destChainSelector); + + Internal.EVM2AnyRampMessage memory messageEvent = Internal.EVM2AnyRampMessage({ + header: Internal.RampMessageHeader({ + messageId: "", + sourceChainSelector: sourceChainSelector, + destChainSelector: destChainSelector, + sequenceNumber: seqNum, + nonce: extraArgs.allowOutOfOrderExecution ? 0 : nonce + }), + sender: originalSender, + data: message.data, + receiver: message.receiver, + extraArgs: Client._argsToBytes(extraArgs), + feeToken: message.feeToken, + feeTokenAmount: feeTokenAmount, + tokenAmounts: new Internal.RampTokenAmount[](message.tokenAmounts.length) + }); + + for (uint256 i = 0; i < message.tokenAmounts.length; ++i) { + messageEvent.tokenAmounts[i] = + _getSourceTokenData(message.tokenAmounts[i], tokenAdminRegistry, DEST_CHAIN_SELECTOR); + } + + messageEvent.header.messageId = Internal._hash(messageEvent, metadataHash); + return messageEvent; + } + + function _getSourceTokenData( + Client.EVMTokenAmount memory tokenAmount, + TokenAdminRegistry tokenAdminRegistry, + uint64 destChainSelector + ) internal view returns (Internal.RampTokenAmount memory) { + address destToken = s_destTokenBySourceToken[tokenAmount.token]; + + uint32 expectedDestGasAmount; + FeeQuoter.TokenTransferFeeConfig memory tokenTransferFeeConfig = + FeeQuoter(s_feeQuoter).getTokenTransferFeeConfig(destChainSelector, tokenAmount.token); + expectedDestGasAmount = + tokenTransferFeeConfig.isEnabled ? tokenTransferFeeConfig.destGasOverhead : DEFAULT_TOKEN_DEST_GAS_OVERHEAD; + + return Internal.RampTokenAmount({ + sourcePoolAddress: abi.encode(tokenAdminRegistry.getTokenConfig(tokenAmount.token).tokenPool), + destTokenAddress: abi.encode(destToken), + extraData: "", + amount: tokenAmount.amount, + destExecData: abi.encode(expectedDestGasAmount) + }); + } + + function _calcUSDValueFromTokenAmount(uint224 tokenPrice, uint256 tokenAmount) internal pure returns (uint256) { + return (tokenPrice * tokenAmount) / 1e18; + } + + function _applyBpsRatio(uint256 tokenAmount, uint16 ratio) internal pure returns (uint256) { + return (tokenAmount * ratio) / 1e5; + } + + function _configUSDCentToWei(uint256 usdCent) internal pure returns (uint256) { + return usdCent * 1e16; + } +} diff --git a/contracts/src/v0.8/ccip/test/helpers/AggregateRateLimiterHelper.sol b/contracts/src/v0.8/ccip/test/helpers/AggregateRateLimiterHelper.sol new file mode 100644 index 00000000000..ced605a7524 --- /dev/null +++ b/contracts/src/v0.8/ccip/test/helpers/AggregateRateLimiterHelper.sol @@ -0,0 +1,19 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import "../../AggregateRateLimiter.sol"; + +contract AggregateRateLimiterHelper is AggregateRateLimiter { + constructor(RateLimiter.Config memory config) AggregateRateLimiter(config) {} + + function rateLimitValue(uint256 value) public { + _rateLimitValue(value); + } + + function getTokenValue( + Client.EVMTokenAmount memory tokenAmount, + IPriceRegistry priceRegistry + ) public view returns (uint256) { + return _getTokenValue(tokenAmount, priceRegistry); + } +} diff --git a/contracts/src/v0.8/ccip/test/helpers/BurnMintERC677Helper.sol b/contracts/src/v0.8/ccip/test/helpers/BurnMintERC677Helper.sol new file mode 100644 index 00000000000..9d2346996ae --- /dev/null +++ b/contracts/src/v0.8/ccip/test/helpers/BurnMintERC677Helper.sol @@ -0,0 +1,18 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {BurnMintERC677} from "../../../shared/token/ERC677/BurnMintERC677.sol"; +import {IGetCCIPAdmin} from "../../interfaces/IGetCCIPAdmin.sol"; + +contract BurnMintERC677Helper is BurnMintERC677, IGetCCIPAdmin { + constructor(string memory name, string memory symbol) BurnMintERC677(name, symbol, 18, 0) {} + + // Gives one full token to any given address. + function drip(address to) external { + _mint(to, 1e18); + } + + function getCCIPAdmin() external view override returns (address) { + return owner(); + } +} diff --git a/contracts/src/v0.8/ccip/test/helpers/BurnMintMultiTokenPool.sol b/contracts/src/v0.8/ccip/test/helpers/BurnMintMultiTokenPool.sol new file mode 100644 index 00000000000..bb1d4c9af36 --- /dev/null +++ b/contracts/src/v0.8/ccip/test/helpers/BurnMintMultiTokenPool.sol @@ -0,0 +1,50 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {IBurnMintERC20} from "../../../shared/token/ERC20/IBurnMintERC20.sol"; + +import {Pool} from "../../libraries/Pool.sol"; +import {MultiTokenPool} from "./MultiTokenPool.sol"; + +import {IERC20} from "../../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/IERC20.sol"; + +contract BurnMintMultiTokenPool is MultiTokenPool { + constructor( + IERC20[] memory tokens, + address[] memory allowlist, + address rmnProxy, + address router + ) MultiTokenPool(tokens, allowlist, rmnProxy, router) {} + + /// @notice Burn the token in the pool + /// @dev The _validateLockOrBurn check is an essential security check + function lockOrBurn( + Pool.LockOrBurnInV1 calldata lockOrBurnIn + ) external virtual override returns (Pool.LockOrBurnOutV1 memory) { + _validateLockOrBurn(lockOrBurnIn); + + IBurnMintERC20(lockOrBurnIn.localToken).burn(lockOrBurnIn.amount); + + emit Burned(msg.sender, lockOrBurnIn.amount); + + return Pool.LockOrBurnOutV1({ + destTokenAddress: getRemoteToken(lockOrBurnIn.localToken, lockOrBurnIn.remoteChainSelector), + destPoolData: "" + }); + } + + /// @notice Mint tokens from the pool to the recipient + /// @dev The _validateReleaseOrMint check is an essential security check + function releaseOrMint( + Pool.ReleaseOrMintInV1 calldata releaseOrMintIn + ) external virtual override returns (Pool.ReleaseOrMintOutV1 memory) { + _validateReleaseOrMint(releaseOrMintIn); + + // Mint to the receiver + IBurnMintERC20(releaseOrMintIn.localToken).mint(msg.sender, releaseOrMintIn.amount); + + emit Minted(msg.sender, releaseOrMintIn.receiver, releaseOrMintIn.amount); + + return Pool.ReleaseOrMintOutV1({destinationAmount: releaseOrMintIn.amount}); + } +} diff --git a/contracts/src/v0.8/ccip/test/helpers/CCIPConfigHelper.sol b/contracts/src/v0.8/ccip/test/helpers/CCIPConfigHelper.sol new file mode 100644 index 00000000000..efade5190b0 --- /dev/null +++ b/contracts/src/v0.8/ccip/test/helpers/CCIPConfigHelper.sol @@ -0,0 +1,68 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.24; + +import {CCIPConfig} from "../../capability/CCIPConfig.sol"; +import {CCIPConfigTypes} from "../../capability/libraries/CCIPConfigTypes.sol"; +import {Internal} from "../../libraries/Internal.sol"; + +contract CCIPConfigHelper is CCIPConfig { + constructor(address capabilitiesRegistry) CCIPConfig(capabilitiesRegistry) {} + + function stateFromConfigLength(uint256 configLength) public pure returns (CCIPConfigTypes.ConfigState) { + return _stateFromConfigLength(configLength); + } + + function validateConfigStateTransition( + CCIPConfigTypes.ConfigState currentState, + CCIPConfigTypes.ConfigState newState + ) public pure { + _validateConfigStateTransition(currentState, newState); + } + + function validateConfigTransition( + CCIPConfigTypes.OCR3ConfigWithMeta[] memory currentConfig, + CCIPConfigTypes.OCR3ConfigWithMeta[] memory newConfigWithMeta + ) public pure { + _validateConfigTransition(currentConfig, newConfigWithMeta); + } + + function computeNewConfigWithMeta( + uint32 donId, + CCIPConfigTypes.OCR3ConfigWithMeta[] memory currentConfig, + CCIPConfigTypes.OCR3Config[] memory newConfig, + CCIPConfigTypes.ConfigState currentState, + CCIPConfigTypes.ConfigState newState + ) public view returns (CCIPConfigTypes.OCR3ConfigWithMeta[] memory) { + return _computeNewConfigWithMeta(donId, currentConfig, newConfig, currentState, newState); + } + + function groupByPluginType( + CCIPConfigTypes.OCR3Config[] memory ocr3Configs + ) + public + pure + returns (CCIPConfigTypes.OCR3Config[] memory commitConfigs, CCIPConfigTypes.OCR3Config[] memory execConfigs) + { + return _groupByPluginType(ocr3Configs); + } + + function computeConfigDigest( + uint32 donId, + uint64 configCount, + CCIPConfigTypes.OCR3Config memory ocr3Config + ) public pure returns (bytes32) { + return _computeConfigDigest(donId, configCount, ocr3Config); + } + + function validateConfig(CCIPConfigTypes.OCR3Config memory cfg) public view { + _validateConfig(cfg); + } + + function updatePluginConfig( + uint32 donId, + Internal.OCRPluginType pluginType, + CCIPConfigTypes.OCR3Config[] memory newConfig + ) public { + _updatePluginConfig(donId, pluginType, newConfig); + } +} diff --git a/contracts/src/v0.8/ccip/test/helpers/CCIPReaderTester.sol b/contracts/src/v0.8/ccip/test/helpers/CCIPReaderTester.sol new file mode 100644 index 00000000000..be3aa9f4b32 --- /dev/null +++ b/contracts/src/v0.8/ccip/test/helpers/CCIPReaderTester.sol @@ -0,0 +1,78 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {Internal} from "../../libraries/Internal.sol"; +import {OffRamp} from "../../offRamp/OffRamp.sol"; + +contract CCIPReaderTester { + event CCIPMessageSent(uint64 indexed destChainSelector, Internal.EVM2AnyRampMessage message); + + mapping(uint64 sourceChainSelector => OffRamp.SourceChainConfig sourceChainConfig) internal s_sourceChainConfigs; + mapping(uint64 destChainSelector => uint64 sequenceNumber) internal s_destChainSeqNrs; + mapping(uint64 sourceChainSelector => mapping(bytes sender => uint64 nonce)) internal s_senderNonce; + + /// @notice Gets the next sequence number to be used in the onRamp + /// @param destChainSelector The destination chain selector + /// @return nextSequenceNumber The next sequence number to be used + function getExpectedNextSequenceNumber(uint64 destChainSelector) external view returns (uint64) { + return s_destChainSeqNrs[destChainSelector] + 1; + } + + /// @notice Sets the sequence number in the onRamp + /// @param destChainSelector The destination chain selector + /// @param sequenceNumber The sequence number + function setDestChainSeqNr(uint64 destChainSelector, uint64 sequenceNumber) external { + s_destChainSeqNrs[destChainSelector] = sequenceNumber; + } + + /// @notice Returns the inbound nonce for a given sender on a given source chain. + /// @param sourceChainSelector The source chain selector. + /// @param sender The encoded sender address. + /// @return inboundNonce The inbound nonce. + function getInboundNonce(uint64 sourceChainSelector, bytes calldata sender) external view returns (uint64) { + return s_senderNonce[sourceChainSelector][sender]; + } + + function setInboundNonce(uint64 sourceChainSelector, uint64 testNonce, bytes calldata sender) external { + s_senderNonce[sourceChainSelector][sender] = testNonce; + } + + function getSourceChainConfig(uint64 sourceChainSelector) external view returns (OffRamp.SourceChainConfig memory) { + return s_sourceChainConfigs[sourceChainSelector]; + } + + function setSourceChainConfig( + uint64 sourceChainSelector, + OffRamp.SourceChainConfig memory sourceChainConfig + ) external { + s_sourceChainConfigs[sourceChainSelector] = sourceChainConfig; + } + + function emitCCIPMessageSent(uint64 destChainSelector, Internal.EVM2AnyRampMessage memory message) external { + emit CCIPMessageSent(destChainSelector, message); + } + + event ExecutionStateChanged( + uint64 indexed sourceChainSelector, + uint64 indexed sequenceNumber, + bytes32 indexed messageId, + Internal.MessageExecutionState state, + bytes returnData + ); + + function emitExecutionStateChanged( + uint64 sourceChainSelector, + uint64 sequenceNumber, + bytes32 messageId, + Internal.MessageExecutionState state, + bytes memory returnData + ) external { + emit ExecutionStateChanged(sourceChainSelector, sequenceNumber, messageId, state, returnData); + } + + event CommitReportAccepted(OffRamp.CommitReport report); + + function emitCommitReportAccepted(OffRamp.CommitReport memory report) external { + emit CommitReportAccepted(report); + } +} diff --git a/contracts/src/v0.8/ccip/test/helpers/CommitStoreHelper.sol b/contracts/src/v0.8/ccip/test/helpers/CommitStoreHelper.sol new file mode 100644 index 00000000000..c8d66b8d72f --- /dev/null +++ b/contracts/src/v0.8/ccip/test/helpers/CommitStoreHelper.sol @@ -0,0 +1,13 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import "../../CommitStore.sol"; + +contract CommitStoreHelper is CommitStore { + constructor(StaticConfig memory staticConfig) CommitStore(staticConfig) {} + + /// @dev Expose _report for tests + function report(bytes calldata commitReport, uint40 epochAndRound) external { + _report(commitReport, epochAndRound); + } +} diff --git a/contracts/src/v0.8/ccip/test/helpers/EVM2EVMOffRampHelper.sol b/contracts/src/v0.8/ccip/test/helpers/EVM2EVMOffRampHelper.sol new file mode 100644 index 00000000000..1b537702be1 --- /dev/null +++ b/contracts/src/v0.8/ccip/test/helpers/EVM2EVMOffRampHelper.sol @@ -0,0 +1,63 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import "../../offRamp/EVM2EVMOffRamp.sol"; +import {IgnoreContractSize} from "./IgnoreContractSize.sol"; + +contract EVM2EVMOffRampHelper is EVM2EVMOffRamp, IgnoreContractSize { + constructor( + StaticConfig memory staticConfig, + RateLimiter.Config memory rateLimiterConfig + ) EVM2EVMOffRamp(staticConfig, rateLimiterConfig) {} + + function setExecutionStateHelper(uint64 sequenceNumber, Internal.MessageExecutionState state) public { + _setExecutionState(sequenceNumber, state); + } + + function getExecutionStateBitMap(uint64 bitmapIndex) public view returns (uint256) { + return s_executionStates[bitmapIndex]; + } + + function releaseOrMintToken( + uint256 sourceTokenAmount, + bytes calldata originalSender, + address receiver, + Internal.SourceTokenData calldata sourceTokenData, + bytes calldata offchainTokenData + ) external returns (Client.EVMTokenAmount memory) { + return _releaseOrMintToken(sourceTokenAmount, originalSender, receiver, sourceTokenData, offchainTokenData); + } + + function releaseOrMintTokens( + Client.EVMTokenAmount[] calldata sourceTokenAmounts, + bytes calldata originalSender, + address receiver, + bytes[] calldata sourceTokenData, + bytes[] calldata offchainTokenData, + uint32[] memory tokenGasOverrides + ) external returns (Client.EVMTokenAmount[] memory) { + return _releaseOrMintTokens( + sourceTokenAmounts, originalSender, receiver, sourceTokenData, offchainTokenData, tokenGasOverrides + ); + } + + function trialExecute( + Internal.EVM2EVMMessage memory message, + bytes[] memory offchainTokenData, + uint32[] memory tokenGasOverrides + ) external returns (Internal.MessageExecutionState, bytes memory) { + return _trialExecute(message, offchainTokenData, tokenGasOverrides); + } + + function report(bytes calldata executableMessages) external { + _report(executableMessages); + } + + function execute(Internal.ExecutionReport memory rep, GasLimitOverride[] memory gasLimitOverrides) external { + _execute(rep, gasLimitOverrides); + } + + function metadataHash() external view returns (bytes32) { + return _metadataHash(Internal.EVM_2_EVM_MESSAGE_HASH); + } +} diff --git a/contracts/src/v0.8/ccip/test/helpers/EVM2EVMOnRampHelper.sol b/contracts/src/v0.8/ccip/test/helpers/EVM2EVMOnRampHelper.sol new file mode 100644 index 00000000000..5cce6aaa445 --- /dev/null +++ b/contracts/src/v0.8/ccip/test/helpers/EVM2EVMOnRampHelper.sol @@ -0,0 +1,47 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import "../../onRamp/EVM2EVMOnRamp.sol"; +import {IgnoreContractSize} from "./IgnoreContractSize.sol"; + +contract EVM2EVMOnRampHelper is EVM2EVMOnRamp, IgnoreContractSize { + constructor( + StaticConfig memory staticConfig, + DynamicConfig memory dynamicConfig, + RateLimiter.Config memory rateLimiterConfig, + FeeTokenConfigArgs[] memory feeTokenConfigs, + TokenTransferFeeConfigArgs[] memory tokenTransferFeeConfigArgs, + NopAndWeight[] memory nopsAndWeights + ) + EVM2EVMOnRamp( + staticConfig, + dynamicConfig, + rateLimiterConfig, + feeTokenConfigs, + tokenTransferFeeConfigArgs, + nopsAndWeights + ) + {} + + function getDataAvailabilityCost( + uint112 dataAvailabilityGasPrice, + uint256 messageDataLength, + uint256 numberOfTokens, + uint32 tokenTransferBytesOverhead + ) external view returns (uint256) { + return + _getDataAvailabilityCost(dataAvailabilityGasPrice, messageDataLength, numberOfTokens, tokenTransferBytesOverhead); + } + + function getTokenTransferCost( + address feeToken, + uint224 feeTokenPrice, + Client.EVMTokenAmount[] calldata tokenAmounts + ) external view returns (uint256, uint32, uint32) { + return _getTokenTransferCost(feeToken, feeTokenPrice, tokenAmounts); + } + + function getSequenceNumber() external view returns (uint64) { + return s_sequenceNumber; + } +} diff --git a/contracts/src/v0.8/ccip/test/helpers/EtherSenderReceiverHelper.sol b/contracts/src/v0.8/ccip/test/helpers/EtherSenderReceiverHelper.sol new file mode 100644 index 00000000000..71a5cdc7ab6 --- /dev/null +++ b/contracts/src/v0.8/ccip/test/helpers/EtherSenderReceiverHelper.sol @@ -0,0 +1,21 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {EtherSenderReceiver} from "../../applications/EtherSenderReceiver.sol"; +import {Client} from "../../libraries/Client.sol"; + +contract EtherSenderReceiverHelper is EtherSenderReceiver { + constructor(address router) EtherSenderReceiver(router) {} + + function validatedMessage(Client.EVM2AnyMessage calldata message) public view returns (Client.EVM2AnyMessage memory) { + return _validatedMessage(message); + } + + function validateFeeToken(Client.EVM2AnyMessage calldata message) public payable { + _validateFeeToken(message); + } + + function publicCcipReceive(Client.Any2EVMMessage memory message) public { + _ccipReceive(message); + } +} diff --git a/contracts/src/v0.8/ccip/test/helpers/FeeQuoterHelper.sol b/contracts/src/v0.8/ccip/test/helpers/FeeQuoterHelper.sol new file mode 100644 index 00000000000..e392ba05589 --- /dev/null +++ b/contracts/src/v0.8/ccip/test/helpers/FeeQuoterHelper.sol @@ -0,0 +1,80 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {FeeQuoter} from "../../FeeQuoter.sol"; +import {Client} from "../../libraries/Client.sol"; + +contract FeeQuoterHelper is FeeQuoter { + constructor( + StaticConfig memory staticConfig, + address[] memory priceUpdaters, + address[] memory feeTokens, + TokenPriceFeedUpdate[] memory tokenPriceFeeds, + TokenTransferFeeConfigArgs[] memory tokenTransferFeeConfigArgs, + PremiumMultiplierWeiPerEthArgs[] memory premiumMultiplierWeiPerEthArgs, + DestChainConfigArgs[] memory destChainConfigArgs + ) + FeeQuoter( + staticConfig, + priceUpdaters, + feeTokens, + tokenPriceFeeds, + tokenTransferFeeConfigArgs, + premiumMultiplierWeiPerEthArgs, + destChainConfigArgs + ) + {} + + function getDataAvailabilityCost( + uint64 destChainSelector, + uint112 dataAvailabilityGasPrice, + uint256 messageDataLength, + uint256 numberOfTokens, + uint32 tokenTransferBytesOverhead + ) external view returns (uint256) { + return _getDataAvailabilityCost( + s_destChainConfigs[destChainSelector], + dataAvailabilityGasPrice, + messageDataLength, + numberOfTokens, + tokenTransferBytesOverhead + ); + } + + function getTokenTransferCost( + uint64 destChainSelector, + address feeToken, + uint224 feeTokenPrice, + Client.EVMTokenAmount[] calldata tokenAmounts + ) external view returns (uint256, uint32, uint32) { + return _getTokenTransferCost( + s_destChainConfigs[destChainSelector], destChainSelector, feeToken, feeTokenPrice, tokenAmounts + ); + } + + function parseEVMExtraArgsFromBytes( + bytes calldata extraArgs, + uint64 destChainSelector + ) external view returns (Client.EVMExtraArgsV2 memory) { + return _parseEVMExtraArgsFromBytes(extraArgs, s_destChainConfigs[destChainSelector]); + } + + function parseEVMExtraArgsFromBytes( + bytes calldata extraArgs, + DestChainConfig memory destChainConfig + ) external pure returns (Client.EVMExtraArgsV2 memory) { + return _parseEVMExtraArgsFromBytes(extraArgs, destChainConfig); + } + + function validateDestFamilyAddress(bytes4 chainFamilySelector, bytes memory destAddress) external pure { + _validateDestFamilyAddress(chainFamilySelector, destAddress); + } + + function calculateRebasedValue( + uint8 dataFeedDecimal, + uint8 tokenDecimal, + uint256 feedValue + ) external pure returns (uint224) { + return _calculateRebasedValue(dataFeedDecimal, tokenDecimal, feedValue); + } +} diff --git a/contracts/src/v0.8/ccip/test/helpers/IgnoreContractSize.sol b/contracts/src/v0.8/ccip/test/helpers/IgnoreContractSize.sol new file mode 100644 index 00000000000..b30124069f2 --- /dev/null +++ b/contracts/src/v0.8/ccip/test/helpers/IgnoreContractSize.sol @@ -0,0 +1,10 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +contract IgnoreContractSize { + // test contracts are excluded from forge build --sizes by default + // --sizes exits with code 1 if any contract is over limit, which fails CI + // for helper contracts that are not explicit test contracts + // use this flag to exclude from --sizes + bool public IS_SCRIPT = true; +} diff --git a/contracts/src/v0.8/ccip/test/helpers/MaybeRevertingBurnMintTokenPool.sol b/contracts/src/v0.8/ccip/test/helpers/MaybeRevertingBurnMintTokenPool.sol new file mode 100644 index 00000000000..73e764ae038 --- /dev/null +++ b/contracts/src/v0.8/ccip/test/helpers/MaybeRevertingBurnMintTokenPool.sol @@ -0,0 +1,71 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {IBurnMintERC20} from "../../../shared/token/ERC20/IBurnMintERC20.sol"; + +import {Pool} from "../../libraries/Pool.sol"; +import {BurnMintTokenPool} from "../../pools/BurnMintTokenPool.sol"; + +contract MaybeRevertingBurnMintTokenPool is BurnMintTokenPool { + bytes public s_revertReason = ""; + bytes public s_sourceTokenData = ""; + uint256 public s_releaseOrMintMultiplier = 1; + + constructor( + IBurnMintERC20 token, + address[] memory allowlist, + address rmnProxy, + address router + ) BurnMintTokenPool(token, allowlist, rmnProxy, router) {} + + function setShouldRevert(bytes calldata revertReason) external { + s_revertReason = revertReason; + } + + function setSourceTokenData(bytes calldata sourceTokenData) external { + s_sourceTokenData = sourceTokenData; + } + + function setReleaseOrMintMultiplier(uint256 multiplier) external { + s_releaseOrMintMultiplier = multiplier; + } + + function lockOrBurn( + Pool.LockOrBurnInV1 calldata lockOrBurnIn + ) external virtual override returns (Pool.LockOrBurnOutV1 memory) { + _validateLockOrBurn(lockOrBurnIn); + + bytes memory revertReason = s_revertReason; + if (revertReason.length != 0) { + assembly { + revert(add(32, revertReason), mload(revertReason)) + } + } + + IBurnMintERC20(address(i_token)).burn(lockOrBurnIn.amount); + emit Burned(msg.sender, lockOrBurnIn.amount); + return Pool.LockOrBurnOutV1({ + destTokenAddress: getRemoteToken(lockOrBurnIn.remoteChainSelector), + destPoolData: s_sourceTokenData + }); + } + + /// @notice Reverts depending on the value of `s_revertReason` + function releaseOrMint( + Pool.ReleaseOrMintInV1 calldata releaseOrMintIn + ) external virtual override returns (Pool.ReleaseOrMintOutV1 memory) { + _validateReleaseOrMint(releaseOrMintIn); + + bytes memory revertReason = s_revertReason; + if (revertReason.length != 0) { + assembly { + revert(add(32, revertReason), mload(revertReason)) + } + } + uint256 amount = releaseOrMintIn.amount * s_releaseOrMintMultiplier; + IBurnMintERC20(address(i_token)).mint(releaseOrMintIn.receiver, amount); + + emit Minted(msg.sender, releaseOrMintIn.receiver, amount); + return Pool.ReleaseOrMintOutV1({destinationAmount: amount}); + } +} diff --git a/contracts/src/v0.8/ccip/test/helpers/MerkleHelper.sol b/contracts/src/v0.8/ccip/test/helpers/MerkleHelper.sol new file mode 100644 index 00000000000..ccb05681f1c --- /dev/null +++ b/contracts/src/v0.8/ccip/test/helpers/MerkleHelper.sol @@ -0,0 +1,52 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {MerkleMultiProof} from "../../libraries/MerkleMultiProof.sol"; + +library MerkleHelper { + /// @notice Generate a Merkle Root from a full set of leaves. When a tree is unbalanced + /// the value is brought up in the tree. For example consider (a,b,c) as leaves. This would + /// result in the following tree with d being computed from hash(a,c) and the root r from + /// hash(d,c). Notice c is not being rehashed when it is brought up in the tree, so the + /// root is NOT hash(d,hash(c)) but instead hash(d,c) == hash(hash(a,b),c). + /// r + /// / \ + /// d c + /// / \ + /// a b + function getMerkleRoot(bytes32[] memory hashedLeaves) public pure returns (bytes32) { + require(hashedLeaves.length <= 256); + while (hashedLeaves.length > 1) { + hashedLeaves = computeNextLayer(hashedLeaves); + } + return hashedLeaves[0]; + } + + /// @notice Computes a single layer of a merkle proof by hashing each pair (i, i+1) for + /// each i, i+2, i+4.. n. When an uneven number of leaves is supplied the last item + /// is simply included as the last element in the result set and not hashed. + function computeNextLayer(bytes32[] memory layer) public pure returns (bytes32[] memory) { + uint256 leavesLen = layer.length; + if (leavesLen == 1) return layer; + + unchecked { + bytes32[] memory nextLayer = new bytes32[]((leavesLen + 1) / 2); + for (uint256 i = 0; i < leavesLen; i += 2) { + if (i == leavesLen - 1) { + nextLayer[i / 2] = layer[i]; + } else { + nextLayer[i / 2] = hashPair(layer[i], layer[i + 1]); + } + } + return nextLayer; + } + } + + function hashPair(bytes32 a, bytes32 b) public pure returns (bytes32) { + return a < b ? hashInternalNode(a, b) : hashInternalNode(b, a); + } + + function hashInternalNode(bytes32 left, bytes32 right) public pure returns (bytes32 hash) { + return keccak256(abi.encode(MerkleMultiProof.INTERNAL_DOMAIN_SEPARATOR, left, right)); + } +} diff --git a/contracts/src/v0.8/ccip/test/helpers/MessageHasher.sol b/contracts/src/v0.8/ccip/test/helpers/MessageHasher.sol new file mode 100644 index 00000000000..d56cf8949a3 --- /dev/null +++ b/contracts/src/v0.8/ccip/test/helpers/MessageHasher.sol @@ -0,0 +1,69 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {Client} from "../../libraries/Client.sol"; +import {Internal} from "../../libraries/Internal.sol"; + +/// @notice MessageHasher is a contract that utility functions to hash an Any2EVMRampMessage +/// and encode various preimages for the final hash of the message. +/// @dev This is only deployed in tests and is not part of the production contracts. +contract MessageHasher { + function hash(Internal.Any2EVMRampMessage memory message, bytes memory onRamp) public pure returns (bytes32) { + return Internal._hash(message, onRamp); + } + + function encodeTokenAmountsHashPreimage( + Internal.RampTokenAmount[] memory rampTokenAmounts + ) public pure returns (bytes memory) { + return abi.encode(rampTokenAmounts); + } + + function encodeMetadataHashPreimage( + bytes32 any2EVMMessageHash, + uint64 sourceChainSelector, + uint64 destChainSelector, + bytes memory onRamp + ) public pure returns (bytes memory) { + return abi.encode(any2EVMMessageHash, sourceChainSelector, destChainSelector, onRamp); + } + + function encodeFixedSizeFieldsHashPreimage( + bytes32 messageId, + bytes memory sender, + address receiver, + uint64 sequenceNumber, + uint256 gasLimit, + uint64 nonce + ) public pure returns (bytes memory) { + return abi.encode(messageId, sender, receiver, sequenceNumber, gasLimit, nonce); + } + + function encodeFinalHashPreimage( + bytes32 leafDomainSeparator, + bytes32 implicitMetadataHash, + bytes32 fixedSizeFieldsHash, + bytes32 dataHash, + bytes32 tokenAmountsHash + ) public pure returns (bytes memory) { + return abi.encode(leafDomainSeparator, implicitMetadataHash, fixedSizeFieldsHash, dataHash, tokenAmountsHash); + } + + function encodeEVMExtraArgsV1(Client.EVMExtraArgsV1 memory extraArgs) public pure returns (bytes memory) { + return Client._argsToBytes(extraArgs); + } + + function encodeEVMExtraArgsV2(Client.EVMExtraArgsV2 memory extraArgs) public pure returns (bytes memory) { + return Client._argsToBytes(extraArgs); + } + + function decodeEVMExtraArgsV1(uint256 gasLimit) public pure returns (Client.EVMExtraArgsV1 memory) { + return Client.EVMExtraArgsV1(gasLimit); + } + + function decodeEVMExtraArgsV2( + uint256 gasLimit, + bool allowOutOfOrderExecution + ) public pure returns (Client.EVMExtraArgsV2 memory) { + return Client.EVMExtraArgsV2(gasLimit, allowOutOfOrderExecution); + } +} diff --git a/contracts/src/v0.8/ccip/test/helpers/MessageInterceptorHelper.sol b/contracts/src/v0.8/ccip/test/helpers/MessageInterceptorHelper.sol new file mode 100644 index 00000000000..a54145da84e --- /dev/null +++ b/contracts/src/v0.8/ccip/test/helpers/MessageInterceptorHelper.sol @@ -0,0 +1,30 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {IMessageInterceptor} from "../../interfaces/IMessageInterceptor.sol"; +import {Client} from "../../libraries/Client.sol"; + +contract MessageInterceptorHelper is IMessageInterceptor { + mapping(bytes32 messageId => bool isInvalid) internal s_invalidMessageIds; + + constructor() {} + + function setMessageIdValidationState(bytes32 messageId, bool isInvalid) external { + s_invalidMessageIds[messageId] = isInvalid; + } + + /// @inheritdoc IMessageInterceptor + function onInboundMessage(Client.Any2EVMMessage memory message) external view { + if (s_invalidMessageIds[message.messageId]) { + revert MessageValidationError(bytes("Invalid message")); + } + } + + /// @inheritdoc IMessageInterceptor + function onOutboundMessage(uint64, Client.EVM2AnyMessage calldata message) external view { + if (s_invalidMessageIds[keccak256(abi.encode(message))]) { + revert MessageValidationError(bytes("Invalid message")); + } + return; + } +} diff --git a/contracts/src/v0.8/ccip/test/helpers/MultiAggregateRateLimiterHelper.sol b/contracts/src/v0.8/ccip/test/helpers/MultiAggregateRateLimiterHelper.sol new file mode 100644 index 00000000000..d011ba0685f --- /dev/null +++ b/contracts/src/v0.8/ccip/test/helpers/MultiAggregateRateLimiterHelper.sol @@ -0,0 +1,16 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {MultiAggregateRateLimiter} from "../../MultiAggregateRateLimiter.sol"; +import {Client} from "../../libraries/Client.sol"; + +contract MultiAggregateRateLimiterHelper is MultiAggregateRateLimiter { + constructor( + address feeQuoter, + address[] memory authorizedCallers + ) MultiAggregateRateLimiter(feeQuoter, authorizedCallers) {} + + function getTokenValue(Client.EVMTokenAmount memory tokenAmount) public view returns (uint256) { + return _getTokenValue(tokenAmount); + } +} diff --git a/contracts/src/v0.8/ccip/test/helpers/MultiOCR3Helper.sol b/contracts/src/v0.8/ccip/test/helpers/MultiOCR3Helper.sol new file mode 100644 index 00000000000..003a5326b89 --- /dev/null +++ b/contracts/src/v0.8/ccip/test/helpers/MultiOCR3Helper.sol @@ -0,0 +1,45 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {MultiOCR3Base} from "../../ocr/MultiOCR3Base.sol"; + +contract MultiOCR3Helper is MultiOCR3Base { + event AfterConfigSet(uint8 ocrPluginType); + + /// @dev OCR plugin type used for transmit. + /// Defined in storage since it cannot be passed as calldata due to strict transmit checks + uint8 internal s_transmitOcrPluginType; + + function setTransmitOcrPluginType(uint8 ocrPluginType) external { + s_transmitOcrPluginType = ocrPluginType; + } + + /// @dev transmit function with signatures + function transmitWithSignatures( + bytes32[3] calldata reportContext, + bytes calldata report, + bytes32[] calldata rs, + bytes32[] calldata ss, + bytes32 rawVs + ) external { + _transmit(s_transmitOcrPluginType, reportContext, report, rs, ss, rawVs); + } + + /// @dev transmit function with no signatures + function transmitWithoutSignatures(bytes32[3] calldata reportContext, bytes calldata report) external { + bytes32[] memory emptySigs = new bytes32[](0); + _transmit(s_transmitOcrPluginType, reportContext, report, emptySigs, emptySigs, bytes32("")); + } + + function getOracle(uint8 ocrPluginType, address oracleAddress) external view returns (Oracle memory) { + return s_oracles[ocrPluginType][oracleAddress]; + } + + function typeAndVersion() public pure override returns (string memory) { + return "MultiOCR3BaseHelper 1.0.0"; + } + + function _afterOCR3ConfigSet(uint8 ocrPluginType) internal virtual override { + emit AfterConfigSet(ocrPluginType); + } +} diff --git a/contracts/src/v0.8/ccip/test/helpers/MultiTokenPool.sol b/contracts/src/v0.8/ccip/test/helpers/MultiTokenPool.sol new file mode 100644 index 00000000000..3aaacfe22ae --- /dev/null +++ b/contracts/src/v0.8/ccip/test/helpers/MultiTokenPool.sol @@ -0,0 +1,420 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {IPoolV1} from "../../interfaces/IPool.sol"; +import {IRMN} from "../../interfaces/IRMN.sol"; +import {IRouter} from "../../interfaces/IRouter.sol"; + +import {OwnerIsCreator} from "../../../shared/access/OwnerIsCreator.sol"; +import {Pool} from "../../libraries/Pool.sol"; +import {RateLimiter} from "../../libraries/RateLimiter.sol"; + +import {IERC20} from "../../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/IERC20.sol"; +import {IERC165} from "../../../vendor/openzeppelin-solidity/v5.0.2/contracts/utils/introspection/IERC165.sol"; +import {EnumerableSet} from "../../../vendor/openzeppelin-solidity/v5.0.2/contracts/utils/structs/EnumerableSet.sol"; + +/// @notice This contract is a proof of concept and should NOT be used in production. +abstract contract MultiTokenPool is IPoolV1, OwnerIsCreator { + using EnumerableSet for EnumerableSet.AddressSet; + using EnumerableSet for EnumerableSet.UintSet; + using RateLimiter for RateLimiter.TokenBucket; + + error CallerIsNotARampOnRouter(address caller); + error ZeroAddressNotAllowed(); + error SenderNotAllowed(address sender); + error AllowListNotEnabled(); + error NonExistentChain(uint64 remoteChainSelector); + error ChainNotAllowed(uint64 remoteChainSelector); + error CursedByRMN(); + error ChainAlreadyExists(uint64 chainSelector); + error InvalidSourcePoolAddress(bytes sourcePoolAddress); + error InvalidToken(address token); + + event Locked(address indexed sender, uint256 amount); + event Burned(address indexed sender, uint256 amount); + event Released(address indexed sender, address indexed recipient, uint256 amount); + event Minted(address indexed sender, address indexed recipient, uint256 amount); + event ChainAdded( + uint64 remoteChainSelector, + bytes remoteToken, + RateLimiter.Config outboundRateLimiterConfig, + RateLimiter.Config inboundRateLimiterConfig + ); + event ChainConfigured( + uint64 remoteChainSelector, + RateLimiter.Config outboundRateLimiterConfig, + RateLimiter.Config inboundRateLimiterConfig + ); + event ChainRemoved(uint64 remoteChainSelector); + event RemotePoolSet(uint64 indexed remoteChainSelector, bytes previousPoolAddress, bytes remotePoolAddress); + event AllowListAdd(address sender); + event AllowListRemove(address sender); + event RouterUpdated(address oldRouter, address newRouter); + + struct ChainUpdate { + uint64 remoteChainSelector; // ──╮ Remote chain selector + bool allowed; // ────────────────╯ Whether the chain is allowed + bytes remotePoolAddress; // Address of the remote pool, ABI encoded in the case of a remove EVM chain. + bytes remoteTokenAddress; // Address of the remote token, ABI encoded in the case of a remote EVM chain. + RateLimiter.Config outboundRateLimiterConfig; // Outbound rate limited config, meaning the rate limits for all of the onRamps for the given chain + RateLimiter.Config inboundRateLimiterConfig; // Inbound rate limited config, meaning the rate limits for all of the offRamps for the given chain + } + + struct RemoteChainConfig { + RateLimiter.TokenBucket outboundRateLimiterConfig; // Outbound rate limited config, meaning the rate limits for all of the onRamps for the given chain + RateLimiter.TokenBucket inboundRateLimiterConfig; // Inbound rate limited config, meaning the rate limits for all of the offRamps for the given chain + bytes remotePoolAddress; // Address of the remote pool, ABI encoded in the case of a remote EVM chain. + bytes remoteTokenAddress; // Address of the remote token, ABI encoded in the case of a remote EVM chain. + } + + /// @dev The IERC20 token that this pool supports + EnumerableSet.AddressSet internal s_tokens; + /// @dev The address of the RMN proxy + address internal immutable i_rmnProxy; + /// @dev The immutable flag that indicates if the pool is access-controlled. + bool internal immutable i_allowlistEnabled; + /// @dev A set of addresses allowed to trigger lockOrBurn as original senders. + /// Only takes effect if i_allowlistEnabled is true. + /// This can be used to ensure only token-issuer specified addresses can + /// move tokens. + EnumerableSet.AddressSet internal s_allowList; + /// @dev The address of the router + IRouter internal s_router; + /// @dev A set of allowed chain selectors. We want the allowlist to be enumerable to + /// be able to quickly determine (without parsing logs) who can access the pool. + /// @dev The chain selectors are in uin256 format because of the EnumerableSet implementation. + EnumerableSet.UintSet internal s_remoteChainSelectors; + mapping(address token => mapping(uint64 remoteChainSelector => RemoteChainConfig)) internal s_remoteChainConfigs; + + constructor(IERC20[] memory token, address[] memory allowlist, address rmnProxy, address router) { + if (router == address(0) || rmnProxy == address(0)) revert ZeroAddressNotAllowed(); + for (uint256 i = 0; i < token.length; ++i) { + s_tokens.add(address(token[i])); + } + i_rmnProxy = rmnProxy; + s_router = IRouter(router); + + // Pool can be set as permissioned or permissionless at deployment time only to save hot-path gas. + i_allowlistEnabled = allowlist.length > 0; + if (i_allowlistEnabled) { + _applyAllowListUpdates(new address[](0), allowlist); + } + } + + /// @notice Get RMN proxy address + /// @return rmnProxy Address of RMN proxy + function getRmnProxy() public view returns (address rmnProxy) { + return i_rmnProxy; + } + + /// @inheritdoc IPoolV1 + function isSupportedToken(address token) public view virtual returns (bool) { + return s_tokens.contains(token); + } + + /// @notice Gets the IERC20 token that this pool can lock or burn. + /// @return tokens The IERC20 token representation. + function getTokens() public view returns (IERC20[] memory tokens) { + tokens = new IERC20[](s_tokens.length()); + for (uint256 i = 0; i < s_tokens.length(); ++i) { + tokens[i] = IERC20(s_tokens.at(i)); + } + return tokens; + } + + /// @notice Gets the pool's Router + /// @return router The pool's Router + function getRouter() public view returns (address router) { + return address(s_router); + } + + /// @notice Sets the pool's Router + /// @param newRouter The new Router + function setRouter(address newRouter) public onlyOwner { + if (newRouter == address(0)) revert ZeroAddressNotAllowed(); + address oldRouter = address(s_router); + s_router = IRouter(newRouter); + + emit RouterUpdated(oldRouter, newRouter); + } + + /// @notice Signals which version of the pool interface is supported + function supportsInterface(bytes4 interfaceId) public pure virtual override returns (bool) { + return interfaceId == Pool.CCIP_POOL_V1 || interfaceId == type(IPoolV1).interfaceId + || interfaceId == type(IERC165).interfaceId; + } + + // ================================================================ + // │ Validation │ + // ================================================================ + + /// @notice Validates the lock or burn input for correctness on + /// - token to be locked or burned + /// - RMN curse status + /// - allowlist status + /// - if the sender is a valid onRamp + /// - rate limit status + /// @param lockOrBurnIn The input to validate. + /// @dev This function should always be called before executing a lock or burn. Not doing so would allow + /// for various exploits. + function _validateLockOrBurn(Pool.LockOrBurnInV1 memory lockOrBurnIn) internal { + if (!isSupportedToken(lockOrBurnIn.localToken)) revert InvalidToken(lockOrBurnIn.localToken); + if (IRMN(i_rmnProxy).isCursed(bytes16(uint128(lockOrBurnIn.remoteChainSelector)))) revert CursedByRMN(); + _checkAllowList(lockOrBurnIn.originalSender); + + _onlyOnRamp(lockOrBurnIn.remoteChainSelector); + _consumeOutboundRateLimit(lockOrBurnIn.localToken, lockOrBurnIn.remoteChainSelector, lockOrBurnIn.amount); + } + + /// @notice Validates the release or mint input for correctness on + /// - token to be released or minted + /// - RMN curse status + /// - if the sender is a valid offRamp + /// - if the source pool is valid + /// - rate limit status + /// @param releaseOrMintIn The input to validate. + /// @dev This function should always be called before executing a lock or burn. Not doing so would allow + /// for various exploits. + function _validateReleaseOrMint(Pool.ReleaseOrMintInV1 memory releaseOrMintIn) internal { + if (!isSupportedToken(releaseOrMintIn.localToken)) revert InvalidToken(releaseOrMintIn.localToken); + if (IRMN(i_rmnProxy).isCursed(bytes16(uint128(releaseOrMintIn.remoteChainSelector)))) revert CursedByRMN(); + _onlyOffRamp(releaseOrMintIn.remoteChainSelector); + + // Validates that the source pool address is configured on this pool. + bytes memory configuredRemotePool = getRemotePool(releaseOrMintIn.localToken, releaseOrMintIn.remoteChainSelector); + if ( + configuredRemotePool.length == 0 + || keccak256(releaseOrMintIn.sourcePoolAddress) != keccak256(configuredRemotePool) + ) { + revert InvalidSourcePoolAddress(releaseOrMintIn.sourcePoolAddress); + } + _consumeInboundRateLimit(releaseOrMintIn.localToken, releaseOrMintIn.remoteChainSelector, releaseOrMintIn.amount); + } + + // ================================================================ + // │ Chain permissions │ + // ================================================================ + + /// @notice Gets the pool address on the remote chain. + /// @param remoteChainSelector Remote chain selector. + /// @dev To support non-evm chains, this value is encoded into bytes + function getRemotePool(address token, uint64 remoteChainSelector) public view returns (bytes memory) { + return s_remoteChainConfigs[token][remoteChainSelector].remotePoolAddress; + } + + /// @notice Gets the token address on the remote chain. + /// @param remoteChainSelector Remote chain selector. + /// @dev To support non-evm chains, this value is encoded into bytes + function getRemoteToken(address token, uint64 remoteChainSelector) public view returns (bytes memory) { + return s_remoteChainConfigs[token][remoteChainSelector].remoteTokenAddress; + } + + /// @notice Sets the remote pool address for a given chain selector. + /// @param remoteChainSelector The remote chain selector for which the remote pool address is being set. + /// @param remotePoolAddress The address of the remote pool. + function setRemotePool( + address token, + uint64 remoteChainSelector, + bytes calldata remotePoolAddress + ) external onlyOwner { + if (!isSupportedChain(remoteChainSelector)) revert NonExistentChain(remoteChainSelector); + + bytes memory prevAddress = s_remoteChainConfigs[token][remoteChainSelector].remotePoolAddress; + s_remoteChainConfigs[token][remoteChainSelector].remotePoolAddress = remotePoolAddress; + + emit RemotePoolSet(remoteChainSelector, prevAddress, remotePoolAddress); + } + + /// @inheritdoc IPoolV1 + function isSupportedChain(uint64 remoteChainSelector) public view returns (bool) { + return s_remoteChainSelectors.contains(remoteChainSelector); + } + + /// @notice Get list of allowed chains + /// @return list of chains. + function getSupportedChains() public view returns (uint64[] memory) { + uint256[] memory uint256ChainSelectors = s_remoteChainSelectors.values(); + uint64[] memory chainSelectors = new uint64[](uint256ChainSelectors.length); + for (uint256 i = 0; i < uint256ChainSelectors.length; ++i) { + chainSelectors[i] = uint64(uint256ChainSelectors[i]); + } + + return chainSelectors; + } + + /// @notice Sets the permissions for a list of chains selectors. Actual senders for these chains + /// need to be allowed on the Router to interact with this pool. + /// @dev Only callable by the owner + /// @param chains A list of chains and their new permission status & rate limits. Rate limits + /// are only used when the chain is being added through `allowed` being true. + function applyChainUpdates(address token, ChainUpdate[] calldata chains) external virtual onlyOwner { + for (uint256 i = 0; i < chains.length; ++i) { + ChainUpdate memory update = chains[i]; + RateLimiter._validateTokenBucketConfig(update.outboundRateLimiterConfig, !update.allowed); + RateLimiter._validateTokenBucketConfig(update.inboundRateLimiterConfig, !update.allowed); + + if (update.allowed) { + // If the chain already exists, revert + if (!s_remoteChainSelectors.add(update.remoteChainSelector)) { + revert ChainAlreadyExists(update.remoteChainSelector); + } + + if (update.remotePoolAddress.length == 0 || update.remoteTokenAddress.length == 0) { + revert ZeroAddressNotAllowed(); + } + + s_remoteChainConfigs[token][update.remoteChainSelector] = RemoteChainConfig({ + outboundRateLimiterConfig: RateLimiter.TokenBucket({ + rate: update.outboundRateLimiterConfig.rate, + capacity: update.outboundRateLimiterConfig.capacity, + tokens: update.outboundRateLimiterConfig.capacity, + lastUpdated: uint32(block.timestamp), + isEnabled: update.outboundRateLimiterConfig.isEnabled + }), + inboundRateLimiterConfig: RateLimiter.TokenBucket({ + rate: update.inboundRateLimiterConfig.rate, + capacity: update.inboundRateLimiterConfig.capacity, + tokens: update.inboundRateLimiterConfig.capacity, + lastUpdated: uint32(block.timestamp), + isEnabled: update.inboundRateLimiterConfig.isEnabled + }), + remotePoolAddress: update.remotePoolAddress, + remoteTokenAddress: update.remoteTokenAddress + }); + + emit ChainAdded( + update.remoteChainSelector, + update.remoteTokenAddress, + update.outboundRateLimiterConfig, + update.inboundRateLimiterConfig + ); + } else { + // If the chain doesn't exist, revert + if (!s_remoteChainSelectors.remove(update.remoteChainSelector)) { + revert NonExistentChain(update.remoteChainSelector); + } + + delete s_remoteChainConfigs[token][update.remoteChainSelector]; + + emit ChainRemoved(update.remoteChainSelector); + } + } + } + + // ================================================================ + // │ Rate limiting │ + // ================================================================ + + /// @notice Consumes outbound rate limiting capacity in this pool + function _consumeOutboundRateLimit(address token, uint64 remoteChainSelector, uint256 amount) internal { + s_remoteChainConfigs[token][remoteChainSelector].outboundRateLimiterConfig._consume(amount, token); + } + + /// @notice Consumes inbound rate limiting capacity in this pool + function _consumeInboundRateLimit(address token, uint64 remoteChainSelector, uint256 amount) internal { + s_remoteChainConfigs[token][remoteChainSelector].inboundRateLimiterConfig._consume(amount, token); + } + + /// @notice Gets the token bucket with its values for the block it was requested at. + /// @return The token bucket. + function getCurrentOutboundRateLimiterState( + address token, + uint64 remoteChainSelector + ) external view returns (RateLimiter.TokenBucket memory) { + return s_remoteChainConfigs[token][remoteChainSelector].outboundRateLimiterConfig._currentTokenBucketState(); + } + + /// @notice Gets the token bucket with its values for the block it was requested at. + /// @return The token bucket. + function getCurrentInboundRateLimiterState( + address token, + uint64 remoteChainSelector + ) external view returns (RateLimiter.TokenBucket memory) { + return s_remoteChainConfigs[token][remoteChainSelector].inboundRateLimiterConfig._currentTokenBucketState(); + } + + /// @notice Sets the chain rate limiter config. + /// @param remoteChainSelector The remote chain selector for which the rate limits apply. + /// @param outboundConfig The new outbound rate limiter config, meaning the onRamp rate limits for the given chain. + /// @param inboundConfig The new inbound rate limiter config, meaning the offRamp rate limits for the given chain. + function setChainRateLimiterConfig( + address token, + uint64 remoteChainSelector, + RateLimiter.Config memory outboundConfig, + RateLimiter.Config memory inboundConfig + ) internal { + if (!isSupportedChain(remoteChainSelector)) revert NonExistentChain(remoteChainSelector); + RateLimiter._validateTokenBucketConfig(outboundConfig, false); + s_remoteChainConfigs[token][remoteChainSelector].outboundRateLimiterConfig._setTokenBucketConfig(outboundConfig); + RateLimiter._validateTokenBucketConfig(inboundConfig, false); + s_remoteChainConfigs[token][remoteChainSelector].inboundRateLimiterConfig._setTokenBucketConfig(inboundConfig); + emit ChainConfigured(remoteChainSelector, outboundConfig, inboundConfig); + } + + // ================================================================ + // │ Access │ + // ================================================================ + + /// @notice Checks whether remote chain selector is configured on this contract, and if the msg.sender + /// is a permissioned onRamp for the given chain on the Router. + function _onlyOnRamp(uint64 remoteChainSelector) internal view { + if (!isSupportedChain(remoteChainSelector)) revert ChainNotAllowed(remoteChainSelector); + if (!(msg.sender == s_router.getOnRamp(remoteChainSelector))) revert CallerIsNotARampOnRouter(msg.sender); + } + + /// @notice Checks whether remote chain selector is configured on this contract, and if the msg.sender + /// is a permissioned offRamp for the given chain on the Router. + function _onlyOffRamp(uint64 remoteChainSelector) internal view { + if (!isSupportedChain(remoteChainSelector)) revert ChainNotAllowed(remoteChainSelector); + if (!s_router.isOffRamp(remoteChainSelector, msg.sender)) revert CallerIsNotARampOnRouter(msg.sender); + } + + // ================================================================ + // │ Allowlist │ + // ================================================================ + + function _checkAllowList(address sender) internal view { + if (i_allowlistEnabled && !s_allowList.contains(sender)) revert SenderNotAllowed(sender); + } + + /// @notice Gets whether the allowList functionality is enabled. + /// @return true is enabled, false if not. + function getAllowListEnabled() external view returns (bool) { + return i_allowlistEnabled; + } + + /// @notice Gets the allowed addresses. + /// @return The allowed addresses. + function getAllowList() external view returns (address[] memory) { + return s_allowList.values(); + } + + /// @notice Apply updates to the allow list. + /// @param removes The addresses to be removed. + /// @param adds The addresses to be added. + /// @dev allowListing will be removed before public launch + function applyAllowListUpdates(address[] calldata removes, address[] calldata adds) external onlyOwner { + _applyAllowListUpdates(removes, adds); + } + + /// @notice Internal version of applyAllowListUpdates to allow for reuse in the constructor. + function _applyAllowListUpdates(address[] memory removes, address[] memory adds) internal { + if (!i_allowlistEnabled) revert AllowListNotEnabled(); + + for (uint256 i = 0; i < removes.length; ++i) { + address toRemove = removes[i]; + if (s_allowList.remove(toRemove)) { + emit AllowListRemove(toRemove); + } + } + for (uint256 i = 0; i < adds.length; ++i) { + address toAdd = adds[i]; + if (toAdd == address(0)) { + continue; + } + if (s_allowList.add(toAdd)) { + emit AllowListAdd(toAdd); + } + } + } +} diff --git a/contracts/src/v0.8/ccip/test/helpers/OCR2Helper.sol b/contracts/src/v0.8/ccip/test/helpers/OCR2Helper.sol new file mode 100644 index 00000000000..cb66352ff65 --- /dev/null +++ b/contracts/src/v0.8/ccip/test/helpers/OCR2Helper.sol @@ -0,0 +1,38 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {OCR2Base} from "../../ocr/OCR2Base.sol"; + +contract OCR2Helper is OCR2Base(false) { + function configDigestFromConfigData( + uint256 chainSelector, + address contractAddress, + uint64 configCount, + address[] memory signers, + address[] memory transmitters, + uint8 f, + bytes memory onchainConfig, + uint64 offchainConfigVersion, + bytes memory offchainConfig + ) public pure returns (bytes32) { + return _configDigestFromConfigData( + chainSelector, + contractAddress, + configCount, + signers, + transmitters, + f, + onchainConfig, + offchainConfigVersion, + offchainConfig + ); + } + + function _report(bytes calldata report, uint40 epochAndRound) internal override {} + + function typeAndVersion() public pure override returns (string memory) { + return "OCR2BaseHelper 1.0.0"; + } + + function _beforeSetConfig(bytes memory _onchainConfig) internal override {} +} diff --git a/contracts/src/v0.8/ccip/test/helpers/OCR2NoChecksHelper.sol b/contracts/src/v0.8/ccip/test/helpers/OCR2NoChecksHelper.sol new file mode 100644 index 00000000000..a1ececa326f --- /dev/null +++ b/contracts/src/v0.8/ccip/test/helpers/OCR2NoChecksHelper.sol @@ -0,0 +1,38 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {OCR2BaseNoChecks} from "../../ocr/OCR2BaseNoChecks.sol"; + +contract OCR2NoChecksHelper is OCR2BaseNoChecks { + function configDigestFromConfigData( + uint256 chainSelector, + address contractAddress, + uint64 configCount, + address[] memory signers, + address[] memory transmitters, + uint8 f, + bytes memory onchainConfig, + uint64 offchainConfigVersion, + bytes memory offchainConfig + ) public pure returns (bytes32) { + return _configDigestFromConfigData( + chainSelector, + contractAddress, + configCount, + signers, + transmitters, + f, + onchainConfig, + offchainConfigVersion, + offchainConfig + ); + } + + function _report(bytes calldata report) internal override {} + + function typeAndVersion() public pure override returns (string memory) { + return "OCR2BaseHelper 1.0.0"; + } + + function _beforeSetConfig(bytes memory _onchainConfig) internal override {} +} diff --git a/contracts/src/v0.8/ccip/test/helpers/OffRampHelper.sol b/contracts/src/v0.8/ccip/test/helpers/OffRampHelper.sol new file mode 100644 index 00000000000..e5cf6332d9d --- /dev/null +++ b/contracts/src/v0.8/ccip/test/helpers/OffRampHelper.sol @@ -0,0 +1,103 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {Client} from "../../libraries/Client.sol"; +import {Internal} from "../../libraries/Internal.sol"; +import {OffRamp} from "../../offRamp/OffRamp.sol"; +import {IgnoreContractSize} from "./IgnoreContractSize.sol"; + +contract OffRampHelper is OffRamp, IgnoreContractSize { + mapping(uint64 sourceChainSelector => uint256 overrideTimestamp) private s_sourceChainVerificationOverride; + + constructor( + StaticConfig memory staticConfig, + DynamicConfig memory dynamicConfig, + SourceChainConfigArgs[] memory sourceChainConfigs + ) OffRamp(staticConfig, dynamicConfig, sourceChainConfigs) {} + + function setExecutionStateHelper( + uint64 sourceChainSelector, + uint64 sequenceNumber, + Internal.MessageExecutionState state + ) public { + _setExecutionState(sourceChainSelector, sequenceNumber, state); + } + + function getExecutionStateBitMap(uint64 sourceChainSelector, uint64 bitmapIndex) public view returns (uint256) { + return s_executionStates[sourceChainSelector][bitmapIndex]; + } + + function releaseOrMintSingleToken( + Internal.RampTokenAmount calldata sourceTokenAmount, + bytes calldata originalSender, + address receiver, + uint64 sourceChainSelector, + bytes calldata offchainTokenData + ) external returns (Client.EVMTokenAmount memory) { + return + _releaseOrMintSingleToken(sourceTokenAmount, originalSender, receiver, sourceChainSelector, offchainTokenData); + } + + function releaseOrMintTokens( + Internal.RampTokenAmount[] calldata sourceTokenAmounts, + bytes calldata originalSender, + address receiver, + uint64 sourceChainSelector, + bytes[] calldata offchainTokenData + ) external returns (Client.EVMTokenAmount[] memory) { + return _releaseOrMintTokens(sourceTokenAmounts, originalSender, receiver, sourceChainSelector, offchainTokenData); + } + + function trialExecute( + Internal.Any2EVMRampMessage memory message, + bytes[] memory offchainTokenData + ) external returns (Internal.MessageExecutionState, bytes memory) { + return _trialExecute(message, offchainTokenData); + } + + function executeSingleReport( + Internal.ExecutionReportSingleChain memory rep, + uint256[] memory manualExecGasLimits + ) external { + _executeSingleReport(rep, manualExecGasLimits); + } + + function batchExecute( + Internal.ExecutionReportSingleChain[] memory reports, + uint256[][] memory manualExecGasLimits + ) external { + _batchExecute(reports, manualExecGasLimits); + } + + function verify( + uint64 sourceChainSelector, + bytes32[] memory hashedLeaves, + bytes32[] memory proofs, + uint256 proofFlagBits + ) external view returns (uint256 timestamp) { + return super._verify(sourceChainSelector, hashedLeaves, proofs, proofFlagBits); + } + + function _verify( + uint64 sourceChainSelector, + bytes32[] memory hashedLeaves, + bytes32[] memory proofs, + uint256 proofFlagBits + ) internal view override returns (uint256 timestamp) { + uint256 overrideTimestamp = s_sourceChainVerificationOverride[sourceChainSelector]; + + return overrideTimestamp == 0 + ? super._verify(sourceChainSelector, hashedLeaves, proofs, proofFlagBits) + : overrideTimestamp; + } + + /// @dev Test helper to override _verify result for easier exec testing + function setVerifyOverrideResult(uint64 sourceChainSelector, uint256 overrideTimestamp) external { + s_sourceChainVerificationOverride[sourceChainSelector] = overrideTimestamp; + } + + /// @dev Test helper to directly set a root's timestamp + function setRootTimestamp(uint64 sourceChainSelector, bytes32 root, uint256 timestamp) external { + s_roots[sourceChainSelector][root] = timestamp; + } +} diff --git a/contracts/src/v0.8/ccip/test/helpers/OnRampHelper.sol b/contracts/src/v0.8/ccip/test/helpers/OnRampHelper.sol new file mode 100644 index 00000000000..57397f040a5 --- /dev/null +++ b/contracts/src/v0.8/ccip/test/helpers/OnRampHelper.sol @@ -0,0 +1,13 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import "../../onRamp/OnRamp.sol"; +import {IgnoreContractSize} from "./IgnoreContractSize.sol"; + +contract OnRampHelper is OnRamp, IgnoreContractSize { + constructor( + StaticConfig memory staticConfig, + DynamicConfig memory dynamicConfig, + DestChainConfigArgs[] memory destChainConfigArgs + ) OnRamp(staticConfig, dynamicConfig, destChainConfigArgs) {} +} diff --git a/contracts/src/v0.8/ccip/test/helpers/RateLimiterHelper.sol b/contracts/src/v0.8/ccip/test/helpers/RateLimiterHelper.sol new file mode 100644 index 00000000000..8fb96a0c1c3 --- /dev/null +++ b/contracts/src/v0.8/ccip/test/helpers/RateLimiterHelper.sol @@ -0,0 +1,36 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {RateLimiter} from "../../libraries/RateLimiter.sol"; + +contract RateLimiterHelper { + using RateLimiter for RateLimiter.TokenBucket; + + RateLimiter.TokenBucket internal s_rateLimiter; + + constructor(RateLimiter.Config memory config) { + s_rateLimiter = RateLimiter.TokenBucket({ + rate: config.rate, + capacity: config.capacity, + tokens: config.capacity, + lastUpdated: uint32(block.timestamp), + isEnabled: config.isEnabled + }); + } + + function consume(uint256 requestTokens, address tokenAddress) external { + s_rateLimiter._consume(requestTokens, tokenAddress); + } + + function currentTokenBucketState() external view returns (RateLimiter.TokenBucket memory) { + return s_rateLimiter._currentTokenBucketState(); + } + + function setTokenBucketConfig(RateLimiter.Config memory config) external { + s_rateLimiter._setTokenBucketConfig(config); + } + + function getRateLimiter() external view returns (RateLimiter.TokenBucket memory) { + return s_rateLimiter; + } +} diff --git a/contracts/src/v0.8/ccip/test/helpers/ReportCodec.sol b/contracts/src/v0.8/ccip/test/helpers/ReportCodec.sol new file mode 100644 index 00000000000..73962fb91f0 --- /dev/null +++ b/contracts/src/v0.8/ccip/test/helpers/ReportCodec.sol @@ -0,0 +1,18 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {Internal} from "../../libraries/Internal.sol"; +import {OffRamp} from "../../offRamp/OffRamp.sol"; + +contract ReportCodec { + event ExecuteReportDecoded(Internal.ExecutionReportSingleChain[] report); + event CommitReportDecoded(OffRamp.CommitReport report); + + function decodeExecuteReport(bytes memory report) public pure returns (Internal.ExecutionReportSingleChain[] memory) { + return abi.decode(report, (Internal.ExecutionReportSingleChain[])); + } + + function decodeCommitReport(bytes memory report) public pure returns (OffRamp.CommitReport memory) { + return abi.decode(report, (OffRamp.CommitReport)); + } +} diff --git a/contracts/src/v0.8/ccip/test/helpers/TokenPoolHelper.sol b/contracts/src/v0.8/ccip/test/helpers/TokenPoolHelper.sol new file mode 100644 index 00000000000..4965d1ed2f9 --- /dev/null +++ b/contracts/src/v0.8/ccip/test/helpers/TokenPoolHelper.sol @@ -0,0 +1,36 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {Pool} from "../../libraries/Pool.sol"; +import {TokenPool} from "../../pools/TokenPool.sol"; + +import {IERC20} from "../../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/IERC20.sol"; + +contract TokenPoolHelper is TokenPool { + constructor( + IERC20 token, + address[] memory allowlist, + address rmnProxy, + address router + ) TokenPool(token, allowlist, rmnProxy, router) {} + + function lockOrBurn( + Pool.LockOrBurnInV1 calldata lockOrBurnIn + ) external view override returns (Pool.LockOrBurnOutV1 memory) { + return Pool.LockOrBurnOutV1({destTokenAddress: getRemoteToken(lockOrBurnIn.remoteChainSelector), destPoolData: ""}); + } + + function releaseOrMint( + Pool.ReleaseOrMintInV1 calldata releaseOrMintIn + ) external pure override returns (Pool.ReleaseOrMintOutV1 memory) { + return Pool.ReleaseOrMintOutV1({destinationAmount: releaseOrMintIn.amount}); + } + + function onlyOnRampModifier(uint64 remoteChainSelector) external view { + _onlyOnRamp(remoteChainSelector); + } + + function onlyOffRampModifier(uint64 remoteChainSelector) external view { + _onlyOffRamp(remoteChainSelector); + } +} diff --git a/contracts/src/v0.8/ccip/test/helpers/USDCReaderTester.sol b/contracts/src/v0.8/ccip/test/helpers/USDCReaderTester.sol new file mode 100644 index 00000000000..d1baa22de1b --- /dev/null +++ b/contracts/src/v0.8/ccip/test/helpers/USDCReaderTester.sol @@ -0,0 +1,62 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +contract USDCReaderTester { + event MessageSent(bytes); + + // emitMessageSent reflects the logic from Circle's MessageTransmitter emitting MeseageSent(bytes) events + // https://github.com/circlefin/evm-cctp-contracts/blob/377c9bd813fb86a42d900ae4003599d82aef635a/src/MessageTransmitter.sol#L41 + // https://github.com/circlefin/evm-cctp-contracts/blob/377c9bd813fb86a42d900ae4003599d82aef635a/src/MessageTransmitter.sol#L365 + function emitMessageSent( + uint32 version, + uint32 sourceDomain, + uint32 destinationDomain, + bytes32 recipient, + bytes32 destinationCaller, + bytes32 sender, + uint64 nonce, + bytes calldata messageBody + ) external { + bytes memory _message = + _formatMessage(version, sourceDomain, destinationDomain, nonce, sender, recipient, destinationCaller, messageBody); + emit MessageSent(_message); + } + + /** + * @notice Returns formatted (packed) message with provided fields + * It's a copy paste of the Message._formatMessage() call in MessageTransmitter.sol + * https://github.com/circlefin/evm-cctp-contracts/blob/377c9bd813fb86a42d900ae4003599d82aef635a/src/messages/Message.sol#L54C1-L65C9 + * Check the chainlink-ccip repo for the offchain implementation of matching this format + * @param _msgVersion the version of the message format + * @param _msgSourceDomain Domain of home chain + * @param _msgDestinationDomain Domain of destination chain + * @param _msgNonce Destination-specific nonce + * @param _msgSender Address of sender on source chain as bytes32 + * @param _msgRecipient Address of recipient on destination chain as bytes32 + * @param _msgDestinationCaller Address of caller on destination chain as bytes32 + * @param _msgRawBody Raw bytes of message body + * @return Formatted message + * + */ + function _formatMessage( + uint32 _msgVersion, + uint32 _msgSourceDomain, + uint32 _msgDestinationDomain, + uint64 _msgNonce, + bytes32 _msgSender, + bytes32 _msgRecipient, + bytes32 _msgDestinationCaller, + bytes memory _msgRawBody + ) internal pure returns (bytes memory) { + return abi.encodePacked( + _msgVersion, + _msgSourceDomain, + _msgDestinationDomain, + _msgNonce, + _msgSender, + _msgRecipient, + _msgDestinationCaller, + _msgRawBody + ); + } +} diff --git a/contracts/src/v0.8/ccip/test/helpers/USDCTokenPoolHelper.sol b/contracts/src/v0.8/ccip/test/helpers/USDCTokenPoolHelper.sol new file mode 100644 index 00000000000..7a3400588a8 --- /dev/null +++ b/contracts/src/v0.8/ccip/test/helpers/USDCTokenPoolHelper.sol @@ -0,0 +1,21 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {IBurnMintERC20} from "../../../shared/token/ERC20/IBurnMintERC20.sol"; + +import {ITokenMessenger} from "../../pools/USDC/ITokenMessenger.sol"; +import {USDCTokenPool} from "../../pools/USDC/USDCTokenPool.sol"; + +contract USDCTokenPoolHelper is USDCTokenPool { + constructor( + ITokenMessenger tokenMessenger, + IBurnMintERC20 token, + address[] memory allowlist, + address rmnProxy, + address router + ) USDCTokenPool(tokenMessenger, token, allowlist, rmnProxy, router) {} + + function validateMessage(bytes memory usdcMessage, SourceTokenDataPayload memory sourceTokenData) external view { + return _validateMessage(usdcMessage, sourceTokenData); + } +} diff --git a/contracts/src/v0.8/ccip/test/helpers/receivers/ConformingReceiver.sol b/contracts/src/v0.8/ccip/test/helpers/receivers/ConformingReceiver.sol new file mode 100644 index 00000000000..159cd7a8514 --- /dev/null +++ b/contracts/src/v0.8/ccip/test/helpers/receivers/ConformingReceiver.sol @@ -0,0 +1,15 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {CCIPReceiver} from "../../../applications/CCIPReceiver.sol"; +import {Client} from "../../../libraries/Client.sol"; + +contract ConformingReceiver is CCIPReceiver { + event MessageReceived(); + + constructor(address router, address feeToken) CCIPReceiver(router) {} + + function _ccipReceive(Client.Any2EVMMessage memory) internal virtual override { + emit MessageReceived(); + } +} diff --git a/contracts/src/v0.8/ccip/test/helpers/receivers/MaybeRevertMessageReceiver.sol b/contracts/src/v0.8/ccip/test/helpers/receivers/MaybeRevertMessageReceiver.sol new file mode 100644 index 00000000000..01b9b77d376 --- /dev/null +++ b/contracts/src/v0.8/ccip/test/helpers/receivers/MaybeRevertMessageReceiver.sol @@ -0,0 +1,54 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {IAny2EVMMessageReceiver} from "../../../interfaces/IAny2EVMMessageReceiver.sol"; +import {Client} from "../../../libraries/Client.sol"; + +import {IERC165} from "../../../../vendor/openzeppelin-solidity/v5.0.2/contracts/utils/introspection/IERC165.sol"; + +contract MaybeRevertMessageReceiver is IAny2EVMMessageReceiver, IERC165 { + error ReceiveRevert(); + error CustomError(bytes err); + + event ValueReceived(uint256 amount); + event MessageReceived(); + + address private s_manager; + bool public s_toRevert; + bytes private s_err; + + constructor(bool toRevert) { + s_manager = msg.sender; + s_toRevert = toRevert; + } + + function setRevert(bool toRevert) external { + s_toRevert = toRevert; + } + + function setErr(bytes memory err) external { + s_err = err; + } + + /// @notice IERC165 supports an interfaceId + /// @param interfaceId The interfaceId to check + /// @return true if the interfaceId is supported + function supportsInterface(bytes4 interfaceId) public pure override returns (bool) { + return interfaceId == type(IAny2EVMMessageReceiver).interfaceId || interfaceId == type(IERC165).interfaceId; + } + + function ccipReceive(Client.Any2EVMMessage calldata) external override { + if (s_toRevert) { + revert CustomError(s_err); + } + emit MessageReceived(); + } + + receive() external payable { + if (s_toRevert) { + revert ReceiveRevert(); + } + + emit ValueReceived(msg.value); + } +} diff --git a/contracts/src/v0.8/ccip/test/helpers/receivers/MaybeRevertMessageReceiverNo165.sol b/contracts/src/v0.8/ccip/test/helpers/receivers/MaybeRevertMessageReceiverNo165.sol new file mode 100644 index 00000000000..4f56394c4e5 --- /dev/null +++ b/contracts/src/v0.8/ccip/test/helpers/receivers/MaybeRevertMessageReceiverNo165.sol @@ -0,0 +1,27 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import "../../../interfaces/IAny2EVMMessageReceiver.sol"; + +contract MaybeRevertMessageReceiverNo165 is IAny2EVMMessageReceiver { + address private s_manager; + bool public s_toRevert; + + event MessageReceived(); + + constructor(bool toRevert) { + s_manager = msg.sender; + s_toRevert = toRevert; + } + + function setRevert(bool toRevert) external { + s_toRevert = toRevert; + } + + function ccipReceive(Client.Any2EVMMessage calldata) external override { + if (s_toRevert) { + revert(); + } + emit MessageReceived(); + } +} diff --git a/contracts/src/v0.8/ccip/test/helpers/receivers/ReentrancyAbuser.sol b/contracts/src/v0.8/ccip/test/helpers/receivers/ReentrancyAbuser.sol new file mode 100644 index 00000000000..b69bbcaa438 --- /dev/null +++ b/contracts/src/v0.8/ccip/test/helpers/receivers/ReentrancyAbuser.sol @@ -0,0 +1,54 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {CCIPReceiver} from "../../../applications/CCIPReceiver.sol"; +import {Client} from "../../../libraries/Client.sol"; +import {Internal} from "../../../libraries/Internal.sol"; +import {EVM2EVMOffRamp} from "../../../offRamp/EVM2EVMOffRamp.sol"; + +contract ReentrancyAbuser is CCIPReceiver { + event ReentrancySucceeded(); + + uint32 internal constant DEFAULT_TOKEN_DEST_GAS_OVERHEAD = 144_000; + + bool internal s_ReentrancyDone = false; + Internal.ExecutionReport internal s_payload; + EVM2EVMOffRamp internal s_offRamp; + + constructor(address router, EVM2EVMOffRamp offRamp) CCIPReceiver(router) { + s_offRamp = offRamp; + } + + function setPayload(Internal.ExecutionReport calldata payload) public { + s_payload = payload; + } + + function _ccipReceive(Client.Any2EVMMessage memory) internal override { + // Use original message gas limits in manual execution + EVM2EVMOffRamp.GasLimitOverride[] memory gasOverrides = _getGasLimitsFromMessages(s_payload.messages); + + if (!s_ReentrancyDone) { + // Could do more rounds but a PoC one is enough + s_ReentrancyDone = true; + s_offRamp.manuallyExecute(s_payload, gasOverrides); + } else { + emit ReentrancySucceeded(); + } + } + + function _getGasLimitsFromMessages( + Internal.EVM2EVMMessage[] memory messages + ) internal pure returns (EVM2EVMOffRamp.GasLimitOverride[] memory) { + EVM2EVMOffRamp.GasLimitOverride[] memory gasLimitOverrides = new EVM2EVMOffRamp.GasLimitOverride[](messages.length); + for (uint256 i = 0; i < messages.length; ++i) { + gasLimitOverrides[i].receiverExecutionGasLimit = messages[i].gasLimit; + gasLimitOverrides[i].tokenGasOverrides = new uint32[](messages[i].tokenAmounts.length); + + for (uint256 j = 0; j < messages[i].tokenAmounts.length; ++j) { + gasLimitOverrides[i].tokenGasOverrides[j] = DEFAULT_TOKEN_DEST_GAS_OVERHEAD + 1; + } + } + + return gasLimitOverrides; + } +} diff --git a/contracts/src/v0.8/ccip/test/helpers/receivers/ReentrancyAbuserMultiRamp.sol b/contracts/src/v0.8/ccip/test/helpers/receivers/ReentrancyAbuserMultiRamp.sol new file mode 100644 index 00000000000..667fbc13e51 --- /dev/null +++ b/contracts/src/v0.8/ccip/test/helpers/receivers/ReentrancyAbuserMultiRamp.sol @@ -0,0 +1,44 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.19; + +import {CCIPReceiver} from "../../../applications/CCIPReceiver.sol"; +import {Client} from "../../../libraries/Client.sol"; +import {Internal} from "../../../libraries/Internal.sol"; +import {OffRamp} from "../../../offRamp/OffRamp.sol"; + +contract ReentrancyAbuserMultiRamp is CCIPReceiver { + event ReentrancySucceeded(); + + bool internal s_ReentrancyDone = false; + Internal.ExecutionReportSingleChain internal s_payload; + OffRamp internal s_offRamp; + + constructor(address router, OffRamp offRamp) CCIPReceiver(router) { + s_offRamp = offRamp; + } + + function setPayload(Internal.ExecutionReportSingleChain calldata payload) public { + s_payload = payload; + } + + function _ccipReceive(Client.Any2EVMMessage memory) internal override { + // Use original message gas limits in manual execution + uint256 numMsgs = s_payload.messages.length; + uint256[][] memory gasOverrides = new uint256[][](1); + gasOverrides[0] = new uint256[](numMsgs); + for (uint256 i = 0; i < numMsgs; ++i) { + gasOverrides[0][i] = 0; + } + + Internal.ExecutionReportSingleChain[] memory batchPayload = new Internal.ExecutionReportSingleChain[](1); + batchPayload[0] = s_payload; + + if (!s_ReentrancyDone) { + // Could do more rounds but a PoC one is enough + s_ReentrancyDone = true; + s_offRamp.manuallyExecute(batchPayload, gasOverrides); + } else { + emit ReentrancySucceeded(); + } + } +} diff --git a/contracts/src/v0.8/ccip/test/legacy/BurnMintTokenPool1_2.sol b/contracts/src/v0.8/ccip/test/legacy/BurnMintTokenPool1_2.sol new file mode 100644 index 00000000000..444e488b3c4 --- /dev/null +++ b/contracts/src/v0.8/ccip/test/legacy/BurnMintTokenPool1_2.sol @@ -0,0 +1,353 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.0; + +import {ITypeAndVersion} from "../../../shared/interfaces/ITypeAndVersion.sol"; +import {IPoolPriorTo1_5} from "../../interfaces/IPoolPriorTo1_5.sol"; +import {IRMN} from "../../interfaces/IRMN.sol"; + +import {OwnerIsCreator} from "../../../shared/access/OwnerIsCreator.sol"; +import {IBurnMintERC20} from "../../../shared/token/ERC20/IBurnMintERC20.sol"; +import {RateLimiter} from "../../libraries/RateLimiter.sol"; + +import {IERC20} from "../../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/IERC20.sol"; +import {IERC165} from "../../../vendor/openzeppelin-solidity/v5.0.2/contracts/utils/introspection/IERC165.sol"; +import {EnumerableSet} from "../../../vendor/openzeppelin-solidity/v5.0.2/contracts/utils/structs/EnumerableSet.sol"; + +/// @notice Base abstract class with common functions for all token pools. +/// A token pool serves as isolated place for holding tokens and token specific logic +/// that may execute as tokens move across the bridge. +abstract contract TokenPool1_2 is IPoolPriorTo1_5, OwnerIsCreator, IERC165 { + using EnumerableSet for EnumerableSet.AddressSet; + using RateLimiter for RateLimiter.TokenBucket; + + error PermissionsError(); + error ZeroAddressNotAllowed(); + error SenderNotAllowed(address sender); + error AllowListNotEnabled(); + error NonExistentRamp(address ramp); + error BadARMSignal(); + error RampAlreadyExists(address ramp); + + event Locked(address indexed sender, uint256 amount); + event Burned(address indexed sender, uint256 amount); + event Released(address indexed sender, address indexed recipient, uint256 amount); + event Minted(address indexed sender, address indexed recipient, uint256 amount); + event OnRampAdded(address onRamp, RateLimiter.Config rateLimiterConfig); + event OnRampConfigured(address onRamp, RateLimiter.Config rateLimiterConfig); + event OnRampRemoved(address onRamp); + event OffRampAdded(address offRamp, RateLimiter.Config rateLimiterConfig); + event OffRampConfigured(address offRamp, RateLimiter.Config rateLimiterConfig); + event OffRampRemoved(address offRamp); + event AllowListAdd(address sender); + event AllowListRemove(address sender); + + struct RampUpdate { + address ramp; + bool allowed; + RateLimiter.Config rateLimiterConfig; + } + + /// @dev The bridgeable token that is managed by this pool. + IERC20 internal immutable i_token; + /// @dev The address of the arm proxy + address internal immutable i_armProxy; + /// @dev The immutable flag that indicates if the pool is access-controlled. + bool internal immutable i_allowlistEnabled; + /// @dev A set of addresses allowed to trigger lockOrBurn as original senders. + /// Only takes effect if i_allowlistEnabled is true. + /// This can be used to ensure only token-issuer specified addresses can + /// move tokens. + EnumerableSet.AddressSet internal s_allowList; + + /// @dev A set of allowed onRamps. We want the whitelist to be enumerable to + /// be able to quickly determine (without parsing logs) who can access the pool. + EnumerableSet.AddressSet internal s_onRamps; + /// @dev Inbound rate limits. This allows per destination chain + /// token issuer specified rate limiting (e.g. issuers may trust chains to varying + /// degrees and prefer different limits) + mapping(address => RateLimiter.TokenBucket) internal s_onRampRateLimits; + /// @dev A set of allowed offRamps. + EnumerableSet.AddressSet internal s_offRamps; + /// @dev Outbound rate limits. Corresponds to the inbound rate limit for the pool + /// on the remote chain. + mapping(address => RateLimiter.TokenBucket) internal s_offRampRateLimits; + + constructor(IERC20 token, address[] memory allowlist, address armProxy) { + if (address(token) == address(0)) revert ZeroAddressNotAllowed(); + i_token = token; + i_armProxy = armProxy; + + // Pool can be set as permissioned or permissionless at deployment time only to save hot-path gas. + i_allowlistEnabled = allowlist.length > 0; + if (i_allowlistEnabled) { + _applyAllowListUpdates(new address[](0), allowlist); + } + } + + /// @notice Get ARM proxy address + /// @return armProxy Address of arm proxy + function getArmProxy() public view returns (address armProxy) { + return i_armProxy; + } + + /// @inheritdoc IPoolPriorTo1_5 + function getToken() public view override returns (IERC20 token) { + return i_token; + } + + /// @inheritdoc IERC165 + function supportsInterface(bytes4 interfaceId) public pure virtual override returns (bool) { + return interfaceId == type(IPoolPriorTo1_5).interfaceId || interfaceId == type(IERC165).interfaceId; + } + + // ================================================================ + // │ Ramp permissions │ + // ================================================================ + + /// @notice Checks whether something is a permissioned onRamp on this contract. + /// @return true if the given address is a permissioned onRamp. + function isOnRamp(address onRamp) public view returns (bool) { + return s_onRamps.contains(onRamp); + } + + /// @notice Checks whether something is a permissioned offRamp on this contract. + /// @return true if the given address is a permissioned offRamp. + function isOffRamp(address offRamp) public view returns (bool) { + return s_offRamps.contains(offRamp); + } + + /// @notice Get onRamp whitelist + /// @return list of onRamps. + function getOnRamps() public view returns (address[] memory) { + return s_onRamps.values(); + } + + /// @notice Get offRamp whitelist + /// @return list of offramps + function getOffRamps() public view returns (address[] memory) { + return s_offRamps.values(); + } + + /// @notice Sets permissions for all on and offRamps. + /// @dev Only callable by the owner + /// @param onRamps A list of onRamps and their new permission status/rate limits + /// @param offRamps A list of offRamps and their new permission status/rate limits + function applyRampUpdates(RampUpdate[] calldata onRamps, RampUpdate[] calldata offRamps) external virtual onlyOwner { + _applyRampUpdates(onRamps, offRamps); + } + + function _applyRampUpdates(RampUpdate[] calldata onRamps, RampUpdate[] calldata offRamps) internal onlyOwner { + for (uint256 i = 0; i < onRamps.length; ++i) { + RampUpdate memory update = onRamps[i]; + if (update.allowed) { + if (s_onRamps.add(update.ramp)) { + s_onRampRateLimits[update.ramp] = RateLimiter.TokenBucket({ + rate: update.rateLimiterConfig.rate, + capacity: update.rateLimiterConfig.capacity, + tokens: update.rateLimiterConfig.capacity, + lastUpdated: uint32(block.timestamp), + isEnabled: update.rateLimiterConfig.isEnabled + }); + emit OnRampAdded(update.ramp, update.rateLimiterConfig); + } else { + revert RampAlreadyExists(update.ramp); + } + } else { + if (s_onRamps.remove(update.ramp)) { + delete s_onRampRateLimits[update.ramp]; + emit OnRampRemoved(update.ramp); + } else { + // Cannot remove a non-existent onRamp. + revert NonExistentRamp(update.ramp); + } + } + } + + for (uint256 i = 0; i < offRamps.length; ++i) { + RampUpdate memory update = offRamps[i]; + if (update.allowed) { + if (s_offRamps.add(update.ramp)) { + s_offRampRateLimits[update.ramp] = RateLimiter.TokenBucket({ + rate: update.rateLimiterConfig.rate, + capacity: update.rateLimiterConfig.capacity, + tokens: update.rateLimiterConfig.capacity, + lastUpdated: uint32(block.timestamp), + isEnabled: update.rateLimiterConfig.isEnabled + }); + emit OffRampAdded(update.ramp, update.rateLimiterConfig); + } else { + revert RampAlreadyExists(update.ramp); + } + } else { + if (s_offRamps.remove(update.ramp)) { + delete s_offRampRateLimits[update.ramp]; + emit OffRampRemoved(update.ramp); + } else { + // Cannot remove a non-existent offRamp. + revert NonExistentRamp(update.ramp); + } + } + } + } + + // ================================================================ + // │ Rate limiting │ + // ================================================================ + + /// @notice Consumes outbound rate limiting capacity in this pool + function _consumeOnRampRateLimit(uint256 amount) internal { + s_onRampRateLimits[msg.sender]._consume(amount, address(i_token)); + } + + /// @notice Consumes inbound rate limiting capacity in this pool + function _consumeOffRampRateLimit(uint256 amount) internal { + s_offRampRateLimits[msg.sender]._consume(amount, address(i_token)); + } + + /// @notice Gets the token bucket with its values for the block it was requested at. + /// @return The token bucket. + function currentOnRampRateLimiterState(address onRamp) external view returns (RateLimiter.TokenBucket memory) { + return s_onRampRateLimits[onRamp]._currentTokenBucketState(); + } + + /// @notice Gets the token bucket with its values for the block it was requested at. + /// @return The token bucket. + function currentOffRampRateLimiterState(address offRamp) external view returns (RateLimiter.TokenBucket memory) { + return s_offRampRateLimits[offRamp]._currentTokenBucketState(); + } + + /// @notice Sets the onramp rate limited config. + /// @param config The new rate limiter config. + function setOnRampRateLimiterConfig(address onRamp, RateLimiter.Config memory config) external onlyOwner { + if (!isOnRamp(onRamp)) revert NonExistentRamp(onRamp); + s_onRampRateLimits[onRamp]._setTokenBucketConfig(config); + emit OnRampConfigured(onRamp, config); + } + + /// @notice Sets the offramp rate limited config. + /// @param config The new rate limiter config. + function setOffRampRateLimiterConfig(address offRamp, RateLimiter.Config memory config) external onlyOwner { + if (!isOffRamp(offRamp)) revert NonExistentRamp(offRamp); + s_offRampRateLimits[offRamp]._setTokenBucketConfig(config); + emit OffRampConfigured(offRamp, config); + } + + // ================================================================ + // │ Access │ + // ================================================================ + + /// @notice Checks whether the msg.sender is a permissioned onRamp on this contract + /// @dev Reverts with a PermissionsError if check fails + modifier onlyOnRamp() { + if (!isOnRamp(msg.sender)) revert PermissionsError(); + _; + } + + /// @notice Checks whether the msg.sender is a permissioned offRamp on this contract + /// @dev Reverts with a PermissionsError if check fails + modifier onlyOffRamp() { + if (!isOffRamp(msg.sender)) revert PermissionsError(); + _; + } + + // ================================================================ + // │ Allowlist │ + // ================================================================ + + modifier checkAllowList(address sender) { + if (i_allowlistEnabled && !s_allowList.contains(sender)) revert SenderNotAllowed(sender); + _; + } + + /// @notice Gets whether the allowList functionality is enabled. + /// @return true is enabled, false if not. + function getAllowListEnabled() external view returns (bool) { + return i_allowlistEnabled; + } + + /// @notice Gets the allowed addresses. + /// @return The allowed addresses. + function getAllowList() external view returns (address[] memory) { + return s_allowList.values(); + } + + /// @notice Apply updates to the allow list. + /// @param removes The addresses to be removed. + /// @param adds The addresses to be added. + /// @dev allowListing will be removed before public launch + function applyAllowListUpdates(address[] calldata removes, address[] calldata adds) external onlyOwner { + _applyAllowListUpdates(removes, adds); + } + + /// @notice Internal version of applyAllowListUpdates to allow for reuse in the constructor. + function _applyAllowListUpdates(address[] memory removes, address[] memory adds) internal { + if (!i_allowlistEnabled) revert AllowListNotEnabled(); + + for (uint256 i = 0; i < removes.length; ++i) { + address toRemove = removes[i]; + if (s_allowList.remove(toRemove)) { + emit AllowListRemove(toRemove); + } + } + for (uint256 i = 0; i < adds.length; ++i) { + address toAdd = adds[i]; + if (toAdd == address(0)) { + continue; + } + if (s_allowList.add(toAdd)) { + emit AllowListAdd(toAdd); + } + } + } + + /// @notice Ensure that there is no active curse. + modifier whenHealthy() { + if (IRMN(i_armProxy).isCursed()) revert BadARMSignal(); + _; + } +} + +contract BurnMintTokenPool1_2 is ITypeAndVersion, TokenPool1_2 { + // solhint-disable-next-line chainlink-solidity/all-caps-constant-storage-variables + string public constant override typeAndVersion = "BurnMintTokenPool 1.2.0"; + + constructor( + IBurnMintERC20 token, + address[] memory allowlist, + address armProxy + ) TokenPool1_2(token, allowlist, armProxy) {} + + /// @notice Burn the token in the pool + /// @param amount Amount to burn + /// @dev The whenHealthy check is important to ensure that even if a ramp is compromised + /// we're able to stop token movement via ARM. + function lockOrBurn( + address originalSender, + bytes calldata, + uint256 amount, + uint64, + bytes calldata + ) external virtual override onlyOnRamp checkAllowList(originalSender) whenHealthy returns (bytes memory) { + _consumeOnRampRateLimit(amount); + IBurnMintERC20(address(i_token)).burn(amount); + emit Burned(msg.sender, amount); + return ""; + } + + /// @notice Mint tokens from the pool to the recipient + /// @param receiver Recipient address + /// @param amount Amount to mint + /// @dev The whenHealthy check is important to ensure that even if a ramp is compromised + /// we're able to stop token movement via ARM. + function releaseOrMint( + bytes memory, + address receiver, + uint256 amount, + uint64, + bytes memory + ) external virtual override whenHealthy onlyOffRamp { + _consumeOffRampRateLimit(amount); + IBurnMintERC20(address(i_token)).mint(receiver, amount); + emit Minted(msg.sender, receiver, amount); + } +} diff --git a/contracts/src/v0.8/ccip/test/legacy/BurnMintTokenPool1_4.sol b/contracts/src/v0.8/ccip/test/legacy/BurnMintTokenPool1_4.sol new file mode 100644 index 00000000000..168afee4f06 --- /dev/null +++ b/contracts/src/v0.8/ccip/test/legacy/BurnMintTokenPool1_4.sol @@ -0,0 +1,398 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {ITypeAndVersion} from "../../../shared/interfaces/ITypeAndVersion.sol"; +import {IBurnMintERC20} from "../../../shared/token/ERC20/IBurnMintERC20.sol"; +import {IPoolPriorTo1_5} from "../../interfaces/IPoolPriorTo1_5.sol"; +import {IRMN} from "../../interfaces/IRMN.sol"; +import {IRouter} from "../../interfaces/IRouter.sol"; + +import {OwnerIsCreator} from "../../../shared/access/OwnerIsCreator.sol"; +import {RateLimiter} from "../../libraries/RateLimiter.sol"; + +import {IERC20} from "../../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/IERC20.sol"; +import {IERC165} from "../../../vendor/openzeppelin-solidity/v5.0.2/contracts/utils/introspection/IERC165.sol"; +import {EnumerableSet} from "../../../vendor/openzeppelin-solidity/v5.0.2/contracts/utils/structs/EnumerableSet.sol"; + +/// @notice Base abstract class with common functions for all token pools. +/// A token pool serves as isolated place for holding tokens and token specific logic +/// that may execute as tokens move across the bridge. +abstract contract TokenPool1_4 is IPoolPriorTo1_5, OwnerIsCreator, IERC165 { + using EnumerableSet for EnumerableSet.AddressSet; + using EnumerableSet for EnumerableSet.UintSet; + using RateLimiter for RateLimiter.TokenBucket; + + error CallerIsNotARampOnRouter(address caller); + error ZeroAddressNotAllowed(); + error SenderNotAllowed(address sender); + error AllowListNotEnabled(); + error NonExistentChain(uint64 remoteChainSelector); + error ChainNotAllowed(uint64 remoteChainSelector); + error BadARMSignal(); + error ChainAlreadyExists(uint64 chainSelector); + + event Locked(address indexed sender, uint256 amount); + event Burned(address indexed sender, uint256 amount); + event Released(address indexed sender, address indexed recipient, uint256 amount); + event Minted(address indexed sender, address indexed recipient, uint256 amount); + event ChainAdded( + uint64 remoteChainSelector, + RateLimiter.Config outboundRateLimiterConfig, + RateLimiter.Config inboundRateLimiterConfig + ); + event ChainConfigured( + uint64 remoteChainSelector, + RateLimiter.Config outboundRateLimiterConfig, + RateLimiter.Config inboundRateLimiterConfig + ); + event ChainRemoved(uint64 remoteChainSelector); + event AllowListAdd(address sender); + event AllowListRemove(address sender); + event RouterUpdated(address oldRouter, address newRouter); + + struct ChainUpdate { + uint64 remoteChainSelector; // ──╮ Remote chain selector + bool allowed; // ────────────────╯ Whether the chain is allowed + RateLimiter.Config outboundRateLimiterConfig; // Outbound rate limited config, meaning the rate limits for all of the onRamps for the given chain + RateLimiter.Config inboundRateLimiterConfig; // Inbound rate limited config, meaning the rate limits for all of the offRamps for the given chain + } + + /// @dev The bridgeable token that is managed by this pool. + IERC20 internal immutable i_token; + /// @dev The address of the arm proxy + address internal immutable i_armProxy; + /// @dev The immutable flag that indicates if the pool is access-controlled. + bool internal immutable i_allowlistEnabled; + /// @dev A set of addresses allowed to trigger lockOrBurn as original senders. + /// Only takes effect if i_allowlistEnabled is true. + /// This can be used to ensure only token-issuer specified addresses can + /// move tokens. + EnumerableSet.AddressSet internal s_allowList; + /// @dev The address of the router + IRouter internal s_router; + /// @dev A set of allowed chain selectors. We want the allowlist to be enumerable to + /// be able to quickly determine (without parsing logs) who can access the pool. + /// @dev The chain selectors are in uin256 format because of the EnumerableSet implementation. + EnumerableSet.UintSet internal s_remoteChainSelectors; + /// @dev Outbound rate limits. Corresponds to the inbound rate limit for the pool + /// on the remote chain. + mapping(uint64 remoteChainSelector => RateLimiter.TokenBucket) internal s_outboundRateLimits; + /// @dev Inbound rate limits. This allows per destination chain + /// token issuer specified rate limiting (e.g. issuers may trust chains to varying + /// degrees and prefer different limits) + mapping(uint64 remoteChainSelector => RateLimiter.TokenBucket) internal s_inboundRateLimits; + + constructor(IERC20 token, address[] memory allowlist, address armProxy, address router) { + if (address(token) == address(0) || router == address(0)) revert ZeroAddressNotAllowed(); + i_token = token; + i_armProxy = armProxy; + s_router = IRouter(router); + + // Pool can be set as permissioned or permissionless at deployment time only to save hot-path gas. + i_allowlistEnabled = allowlist.length > 0; + if (i_allowlistEnabled) { + _applyAllowListUpdates(new address[](0), allowlist); + } + } + + /// @notice Get ARM proxy address + /// @return armProxy Address of arm proxy + function getArmProxy() public view returns (address armProxy) { + return i_armProxy; + } + + /// @inheritdoc IPoolPriorTo1_5 + function getToken() public view override returns (IERC20 token) { + return i_token; + } + + /// @notice Gets the pool's Router + /// @return router The pool's Router + function getRouter() public view returns (address router) { + return address(s_router); + } + + /// @notice Sets the pool's Router + /// @param newRouter The new Router + function setRouter(address newRouter) public onlyOwner { + if (newRouter == address(0)) revert ZeroAddressNotAllowed(); + address oldRouter = address(s_router); + s_router = IRouter(newRouter); + + emit RouterUpdated(oldRouter, newRouter); + } + + /// @inheritdoc IERC165 + function supportsInterface(bytes4 interfaceId) public pure virtual override returns (bool) { + return interfaceId == type(IPoolPriorTo1_5).interfaceId || interfaceId == type(IERC165).interfaceId; + } + + // ================================================================ + // │ Chain permissions │ + // ================================================================ + + /// @notice Checks whether a chain selector is permissioned on this contract. + /// @return true if the given chain selector is a permissioned remote chain. + function isSupportedChain(uint64 remoteChainSelector) public view returns (bool) { + return s_remoteChainSelectors.contains(remoteChainSelector); + } + + /// @notice Get list of allowed chains + /// @return list of chains. + function getSupportedChains() public view returns (uint64[] memory) { + uint256[] memory uint256ChainSelectors = s_remoteChainSelectors.values(); + uint64[] memory chainSelectors = new uint64[](uint256ChainSelectors.length); + for (uint256 i = 0; i < uint256ChainSelectors.length; ++i) { + chainSelectors[i] = uint64(uint256ChainSelectors[i]); + } + + return chainSelectors; + } + + /// @notice Sets the permissions for a list of chains selectors. Actual senders for these chains + /// need to be allowed on the Router to interact with this pool. + /// @dev Only callable by the owner + /// @param chains A list of chains and their new permission status & rate limits. Rate limits + /// are only used when the chain is being added through `allowed` being true. + function applyChainUpdates(ChainUpdate[] calldata chains) external virtual onlyOwner { + for (uint256 i = 0; i < chains.length; ++i) { + ChainUpdate memory update = chains[i]; + RateLimiter._validateTokenBucketConfig(update.outboundRateLimiterConfig, !update.allowed); + RateLimiter._validateTokenBucketConfig(update.inboundRateLimiterConfig, !update.allowed); + + if (update.allowed) { + // If the chain already exists, revert + if (!s_remoteChainSelectors.add(update.remoteChainSelector)) { + revert ChainAlreadyExists(update.remoteChainSelector); + } + + s_outboundRateLimits[update.remoteChainSelector] = RateLimiter.TokenBucket({ + rate: update.outboundRateLimiterConfig.rate, + capacity: update.outboundRateLimiterConfig.capacity, + tokens: update.outboundRateLimiterConfig.capacity, + lastUpdated: uint32(block.timestamp), + isEnabled: update.outboundRateLimiterConfig.isEnabled + }); + + s_inboundRateLimits[update.remoteChainSelector] = RateLimiter.TokenBucket({ + rate: update.inboundRateLimiterConfig.rate, + capacity: update.inboundRateLimiterConfig.capacity, + tokens: update.inboundRateLimiterConfig.capacity, + lastUpdated: uint32(block.timestamp), + isEnabled: update.inboundRateLimiterConfig.isEnabled + }); + emit ChainAdded(update.remoteChainSelector, update.outboundRateLimiterConfig, update.inboundRateLimiterConfig); + } else { + // If the chain doesn't exist, revert + if (!s_remoteChainSelectors.remove(update.remoteChainSelector)) { + revert NonExistentChain(update.remoteChainSelector); + } + + delete s_inboundRateLimits[update.remoteChainSelector]; + delete s_outboundRateLimits[update.remoteChainSelector]; + emit ChainRemoved(update.remoteChainSelector); + } + } + } + + // ================================================================ + // │ Rate limiting │ + // ================================================================ + + /// @notice Consumes outbound rate limiting capacity in this pool + function _consumeOutboundRateLimit(uint64 remoteChainSelector, uint256 amount) internal { + s_outboundRateLimits[remoteChainSelector]._consume(amount, address(i_token)); + } + + /// @notice Consumes inbound rate limiting capacity in this pool + function _consumeInboundRateLimit(uint64 remoteChainSelector, uint256 amount) internal { + s_inboundRateLimits[remoteChainSelector]._consume(amount, address(i_token)); + } + + /// @notice Gets the token bucket with its values for the block it was requested at. + /// @return The token bucket. + function getCurrentOutboundRateLimiterState( + uint64 remoteChainSelector + ) external view returns (RateLimiter.TokenBucket memory) { + return s_outboundRateLimits[remoteChainSelector]._currentTokenBucketState(); + } + + /// @notice Gets the token bucket with its values for the block it was requested at. + /// @return The token bucket. + function getCurrentInboundRateLimiterState( + uint64 remoteChainSelector + ) external view returns (RateLimiter.TokenBucket memory) { + return s_inboundRateLimits[remoteChainSelector]._currentTokenBucketState(); + } + + /// @notice Sets the chain rate limiter config. + /// @param remoteChainSelector The remote chain selector for which the rate limits apply. + /// @param outboundConfig The new outbound rate limiter config, meaning the onRamp rate limits for the given chain. + /// @param inboundConfig The new inbound rate limiter config, meaning the offRamp rate limits for the given chain. + function setChainRateLimiterConfig( + uint64 remoteChainSelector, + RateLimiter.Config memory outboundConfig, + RateLimiter.Config memory inboundConfig + ) external virtual onlyOwner { + _setRateLimitConfig(remoteChainSelector, outboundConfig, inboundConfig); + } + + function _setRateLimitConfig( + uint64 remoteChainSelector, + RateLimiter.Config memory outboundConfig, + RateLimiter.Config memory inboundConfig + ) internal { + if (!isSupportedChain(remoteChainSelector)) revert NonExistentChain(remoteChainSelector); + RateLimiter._validateTokenBucketConfig(outboundConfig, false); + s_outboundRateLimits[remoteChainSelector]._setTokenBucketConfig(outboundConfig); + RateLimiter._validateTokenBucketConfig(inboundConfig, false); + s_inboundRateLimits[remoteChainSelector]._setTokenBucketConfig(inboundConfig); + emit ChainConfigured(remoteChainSelector, outboundConfig, inboundConfig); + } + + // ================================================================ + // │ Access │ + // ================================================================ + + /// @notice Checks whether remote chain selector is configured on this contract, and if the msg.sender + /// is a permissioned onRamp for the given chain on the Router. + modifier onlyOnRamp(uint64 remoteChainSelector) { + if (!isSupportedChain(remoteChainSelector)) revert ChainNotAllowed(remoteChainSelector); + if (!(msg.sender == s_router.getOnRamp(remoteChainSelector))) revert CallerIsNotARampOnRouter(msg.sender); + _; + } + + /// @notice Checks whether remote chain selector is configured on this contract, and if the msg.sender + /// is a permissioned offRamp for the given chain on the Router. + modifier onlyOffRamp(uint64 remoteChainSelector) { + if (!isSupportedChain(remoteChainSelector)) revert ChainNotAllowed(remoteChainSelector); + if (!s_router.isOffRamp(remoteChainSelector, msg.sender)) revert CallerIsNotARampOnRouter(msg.sender); + _; + } + + // ================================================================ + // │ Allowlist │ + // ================================================================ + + modifier checkAllowList(address sender) { + if (i_allowlistEnabled && !s_allowList.contains(sender)) revert SenderNotAllowed(sender); + _; + } + + /// @notice Gets whether the allowList functionality is enabled. + /// @return true is enabled, false if not. + function getAllowListEnabled() external view returns (bool) { + return i_allowlistEnabled; + } + + /// @notice Gets the allowed addresses. + /// @return The allowed addresses. + function getAllowList() external view returns (address[] memory) { + return s_allowList.values(); + } + + /// @notice Apply updates to the allow list. + /// @param removes The addresses to be removed. + /// @param adds The addresses to be added. + /// @dev allowListing will be removed before public launch + function applyAllowListUpdates(address[] calldata removes, address[] calldata adds) external onlyOwner { + _applyAllowListUpdates(removes, adds); + } + + /// @notice Internal version of applyAllowListUpdates to allow for reuse in the constructor. + function _applyAllowListUpdates(address[] memory removes, address[] memory adds) internal { + if (!i_allowlistEnabled) revert AllowListNotEnabled(); + + for (uint256 i = 0; i < removes.length; ++i) { + address toRemove = removes[i]; + if (s_allowList.remove(toRemove)) { + emit AllowListRemove(toRemove); + } + } + for (uint256 i = 0; i < adds.length; ++i) { + address toAdd = adds[i]; + if (toAdd == address(0)) { + continue; + } + if (s_allowList.add(toAdd)) { + emit AllowListAdd(toAdd); + } + } + } + + /// @notice Ensure that there is no active curse. + modifier whenHealthy() { + if (IRMN(i_armProxy).isCursed()) revert BadARMSignal(); + _; + } +} + +abstract contract BurnMintTokenPoolAbstract is TokenPool1_4 { + /// @notice Contains the specific burn call for a pool. + /// @dev overriding this method allows us to create pools with different burn signatures + /// without duplicating the underlying logic. + function _burn(uint256 amount) internal virtual; + + /// @notice Burn the token in the pool + /// @param amount Amount to burn + /// @dev The whenHealthy check is important to ensure that even if a ramp is compromised + /// we're able to stop token movement via ARM. + function lockOrBurn( + address originalSender, + bytes calldata, + uint256 amount, + uint64 remoteChainSelector, + bytes calldata + ) + external + virtual + override + onlyOnRamp(remoteChainSelector) + checkAllowList(originalSender) + whenHealthy + returns (bytes memory) + { + _consumeOutboundRateLimit(remoteChainSelector, amount); + _burn(amount); + emit Burned(msg.sender, amount); + return ""; + } + + /// @notice Mint tokens from the pool to the recipient + /// @param receiver Recipient address + /// @param amount Amount to mint + /// @dev The whenHealthy check is important to ensure that even if a ramp is compromised + /// we're able to stop token movement via ARM. + function releaseOrMint( + bytes memory, + address receiver, + uint256 amount, + uint64 remoteChainSelector, + bytes memory + ) external virtual override whenHealthy onlyOffRamp(remoteChainSelector) { + _consumeInboundRateLimit(remoteChainSelector, amount); + IBurnMintERC20(address(i_token)).mint(receiver, amount); + emit Minted(msg.sender, receiver, amount); + } +} + +/// @notice This pool mints and burns a 3rd-party token. +/// @dev Pool whitelisting mode is set in the constructor and cannot be modified later. +/// It either accepts any address as originalSender, or only accepts whitelisted originalSender. +/// The only way to change whitelisting mode is to deploy a new pool. +/// If that is expected, please make sure the token's burner/minter roles are adjustable. +contract BurnMintTokenPool1_4 is BurnMintTokenPoolAbstract, ITypeAndVersion { + string public constant override typeAndVersion = "BurnMintTokenPool 1.4.0"; + + constructor( + IBurnMintERC20 token, + address[] memory allowlist, + address armProxy, + address router + ) TokenPool1_4(token, allowlist, armProxy, router) {} + + /// @inheritdoc BurnMintTokenPoolAbstract + function _burn(uint256 amount) internal virtual override { + IBurnMintERC20(address(i_token)).burn(amount); + } +} diff --git a/contracts/src/v0.8/ccip/test/legacy/TokenPoolAndProxy.t.sol b/contracts/src/v0.8/ccip/test/legacy/TokenPoolAndProxy.t.sol new file mode 100644 index 00000000000..9645d70b7a6 --- /dev/null +++ b/contracts/src/v0.8/ccip/test/legacy/TokenPoolAndProxy.t.sol @@ -0,0 +1,671 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.0; + +import {IPoolV1} from "../../interfaces/IPool.sol"; +import {IPoolPriorTo1_5} from "../../interfaces/IPoolPriorTo1_5.sol"; + +import {BurnMintERC677} from "../../../shared/token/ERC677/BurnMintERC677.sol"; +import {Router} from "../../Router.sol"; +import {Client} from "../../libraries/Client.sol"; +import {Pool} from "../../libraries/Pool.sol"; +import {RateLimiter} from "../../libraries/RateLimiter.sol"; +import {BurnMintTokenPoolAndProxy} from "../../pools/BurnMintTokenPoolAndProxy.sol"; +import {BurnWithFromMintTokenPoolAndProxy} from "../../pools/BurnWithFromMintTokenPoolAndProxy.sol"; +import {LockReleaseTokenPoolAndProxy} from "../../pools/LockReleaseTokenPoolAndProxy.sol"; +import {TokenPool} from "../../pools/TokenPool.sol"; +import {EVM2EVMOnRampSetup} from "../onRamp/EVM2EVMOnRampSetup.t.sol"; +import {RouterSetup} from "../router/RouterSetup.t.sol"; +import {BurnMintTokenPool1_2, TokenPool1_2} from "./BurnMintTokenPool1_2.sol"; +import {BurnMintTokenPool1_4, TokenPool1_4} from "./BurnMintTokenPool1_4.sol"; + +import {IERC20} from "../../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/IERC20.sol"; +import {IERC165} from "../../../vendor/openzeppelin-solidity/v5.0.2/contracts/utils/introspection/IERC165.sol"; + +contract TokenPoolAndProxyMigration is EVM2EVMOnRampSetup { + BurnMintTokenPoolAndProxy internal s_newPool; + IPoolPriorTo1_5 internal s_legacyPool; + BurnMintERC677 internal s_token; + + address internal s_offRamp; + address internal s_sourcePool = makeAddr("source_pool"); + address internal s_sourceToken = makeAddr("source_token"); + uint256 internal constant AMOUNT = 1; + + function setUp() public virtual override { + super.setUp(); + // Create a system with a token and a legacy pool + s_token = new BurnMintERC677("Test", "TEST", 18, type(uint256).max); + // dealing doesn't update the total supply, meaning the first time we burn a token we underflow, which isn't + // guarded against. Then, when we mint a token, we overflow, which is guarded against and will revert. + s_token.grantMintAndBurnRoles(OWNER); + s_token.mint(OWNER, 1e18); + + s_offRamp = s_offRamps[0]; + // Approve enough for a few calls + s_token.approve(address(s_sourceRouter), AMOUNT * 100); + + // Approve infinite fee tokens + IERC20(s_sourceFeeToken).approve(address(s_sourceRouter), type(uint256).max); + } + + /// @notice This test covers the entire migration plan for 1.0-1.2 pools to 1.5 pools. For simplicity + /// we will refer to the 1.0/1.2 pools as 1.2 pools, as they are functionally the same. + function test_tokenPoolMigration_Success_1_2() public { + // ================================================================ + // | 1 1.2 prior to upgrade | + // ================================================================ + _deployPool1_2(); + + // Ensure everything works on the 1.2 pool + _ccipSend_OLD(); + _fakeReleaseOrMintFromOffRamp_OLD(); + + // ================================================================ + // | 2 Deploy self serve | + // ================================================================ + _deploySelfServe(); + + // This doesn't impact the 1.2 pool, so it should still be functional + _ccipSend_OLD(); + _fakeReleaseOrMintFromOffRamp_OLD(); + + // ================================================================ + // | 3 Configure new pool on old pool | + // ================================================================ + // In the 1.2 case, everything keeps working on both the 1.2 and 1.5 pools. This config can be + // done in advance of the actual swap to 1.5 lanes. + vm.startPrank(OWNER); + TokenPool1_2.RampUpdate[] memory rampUpdates = new TokenPool1_2.RampUpdate[](1); + rampUpdates[0] = TokenPool1_2.RampUpdate({ + ramp: address(s_newPool), + allowed: true, + // The rate limits should be turned off for this fake ramp, as the 1.5 pool will handle all the + // rate limiting for us. + rateLimiterConfig: RateLimiter.Config({isEnabled: false, capacity: 0, rate: 0}) + }); + // Since this call doesn't impact the usability of the old pool, we can do it whenever we want + BurnMintTokenPool1_2(address(s_legacyPool)).applyRampUpdates(rampUpdates, rampUpdates); + + // Assert the 1.2 lanes still work + _ccipSend_OLD(); + _fakeReleaseOrMintFromOffRamp_OLD(); + + // ================================================================ + // | 4 Update the router with to 1.5 | + // ================================================================ + + // This will stop any new messages entering the old lanes, and will direct all traffic to the + // new 1.5 lanes, and therefore to the 1.5 pools. Note that the old pools will still receive + // inflight messages, and will need to continue functioning until all of those are processed. + _fakeReleaseOrMintFromOffRamp_OLD(); + + // Everything is configured, we can now send a ccip tx to the new pool + _ccipSend1_5(); + _fakeReleaseOrMintFromOffRamp1_5(); + + // ================================================================ + // | 5 Migrate to using 1.5 the pool | + // ================================================================ + // Turn off the legacy pool, this enabled the 1.5 pool logic. This should be done AFTER the new pool + // has gotten permissions to mint/burn. We see the case where that isn't done below. + vm.startPrank(OWNER); + s_newPool.setPreviousPool(IPoolPriorTo1_5(address(0))); + + // The new pool is now active, but is has not been given permissions to burn/mint yet + vm.expectRevert(abi.encodeWithSelector(BurnMintERC677.SenderNotBurner.selector, address(s_newPool))); + _ccipSend1_5(); + vm.expectRevert(abi.encodeWithSelector(BurnMintERC677.SenderNotMinter.selector, address(s_newPool))); + _fakeReleaseOrMintFromOffRamp1_5(); + + // When we do give burn/mint, the new pool is fully active + vm.startPrank(OWNER); + s_token.grantMintAndBurnRoles(address(s_newPool)); + _ccipSend1_5(); + _fakeReleaseOrMintFromOffRamp1_5(); + + // Even after the pool has taken over as primary, the old pool can still process messages from the old lane + _fakeReleaseOrMintFromOffRamp_OLD(); + } + + function test_tokenPoolMigration_Success_1_4() public { + // ================================================================ + // | 1 1.4 prior to upgrade | + // ================================================================ + _deployPool1_4(); + + // Ensure everything works on the 1.4 pool + _ccipSend_OLD(); + _fakeReleaseOrMintFromOffRamp_OLD(); + + // ================================================================ + // | 2 Deploy self serve | + // ================================================================ + _deploySelfServe(); + + // This doesn't impact the 1.4 pool, so it should still be functional + _ccipSend_OLD(); + _fakeReleaseOrMintFromOffRamp_OLD(); + + // ================================================================ + // | 3 Configure new pool on old pool | + // | AND | + // | Update the router with to 1.5 | + // ================================================================ + // NOTE: when this call is made, the SENDING SIDE of old lanes stop working. + vm.startPrank(OWNER); + BurnMintTokenPool1_4(address(s_legacyPool)).setRouter(address(s_newPool)); + + // This will stop any new messages entering the old lanes, and will direct all traffic to the + // new 1.5 lanes, and therefore to the 1.5 pools. Note that the old pools will still receive + // inflight messages, and will need to continue functioning until all of those are processed. + _fakeReleaseOrMintFromOffRamp_OLD(); + + // Sending to the old 1.4 pool no longer works + _ccipSend_OLD_Reverts(); + + // Everything is configured, we can now send a ccip tx + _ccipSend1_5(); + _fakeReleaseOrMintFromOffRamp1_5(); + + // ================================================================ + // | 4 Migrate to using 1.5 the pool | + // ================================================================ + // Turn off the legacy pool, this enabled the 1.5 pool logic. This should be done AFTER the new pool + // has gotten permissions to mint/burn. We see the case where that isn't done below. + vm.startPrank(OWNER); + s_newPool.setPreviousPool(IPoolPriorTo1_5(address(0))); + + // The new pool is now active, but is has not been given permissions to burn/mint yet + vm.expectRevert(abi.encodeWithSelector(BurnMintERC677.SenderNotBurner.selector, address(s_newPool))); + _ccipSend1_5(); + vm.expectRevert(abi.encodeWithSelector(BurnMintERC677.SenderNotMinter.selector, address(s_newPool))); + _fakeReleaseOrMintFromOffRamp1_5(); + + // When we do give burn/mint, the new pool is fully active + vm.startPrank(OWNER); + s_token.grantMintAndBurnRoles(address(s_newPool)); + _ccipSend1_5(); + _fakeReleaseOrMintFromOffRamp1_5(); + + // Even after the pool has taken over as primary, the old pool can still process messages from the old lane + _fakeReleaseOrMintFromOffRamp_OLD(); + } + + function _ccipSend_OLD() internal { + // We send the funds to the pool manually, as the ramp normally does that + deal(address(s_token), address(s_legacyPool), AMOUNT); + vm.startPrank(address(s_onRamp)); + s_legacyPool.lockOrBurn(OWNER, abi.encode(OWNER), AMOUNT, DEST_CHAIN_SELECTOR, ""); + } + + function _ccipSend_OLD_Reverts() internal { + // We send the funds to the pool manually, as the ramp normally does that + deal(address(s_token), address(s_legacyPool), AMOUNT); + vm.startPrank(address(s_onRamp)); + + vm.expectRevert(abi.encodeWithSelector(TokenPool1_4.CallerIsNotARampOnRouter.selector, address(s_onRamp))); + + s_legacyPool.lockOrBurn(OWNER, abi.encode(OWNER), AMOUNT, DEST_CHAIN_SELECTOR, ""); + } + + function _ccipSend1_5() internal { + vm.startPrank(address(OWNER)); + Client.EVMTokenAmount[] memory tokenAmounts = new Client.EVMTokenAmount[](1); + tokenAmounts[0] = Client.EVMTokenAmount({token: address(s_token), amount: AMOUNT}); + + s_sourceRouter.ccipSend( + DEST_CHAIN_SELECTOR, + Client.EVM2AnyMessage({ + receiver: abi.encode(OWNER), + data: "", + tokenAmounts: tokenAmounts, + feeToken: s_sourceFeeToken, + extraArgs: "" + }) + ); + } + + function _fakeReleaseOrMintFromOffRamp1_5() internal { + // This is a fake call to simulate the release or mint from the "offRamp" + vm.startPrank(s_offRamp); + s_newPool.releaseOrMint( + Pool.ReleaseOrMintInV1({ + originalSender: abi.encode(OWNER), + remoteChainSelector: SOURCE_CHAIN_SELECTOR, + receiver: OWNER, + amount: AMOUNT, + localToken: address(s_token), + sourcePoolAddress: abi.encode(s_sourcePool), + sourcePoolData: "", + offchainTokenData: "" + }) + ); + } + + function _fakeReleaseOrMintFromOffRamp_OLD() internal { + // This is a fake call to simulate the release or mint from the "offRamp" + vm.startPrank(s_offRamp); + s_legacyPool.releaseOrMint(abi.encode(OWNER), OWNER, AMOUNT, SOURCE_CHAIN_SELECTOR, ""); + } + + function _deployPool1_2() internal { + vm.startPrank(OWNER); + s_legacyPool = new BurnMintTokenPool1_2(s_token, new address[](0), address(s_mockRMN)); + s_token.grantMintAndBurnRoles(address(s_legacyPool)); + + TokenPool1_2.RampUpdate[] memory onRampUpdates = new TokenPool1_2.RampUpdate[](1); + onRampUpdates[0] = TokenPool1_2.RampUpdate({ + ramp: address(s_onRamp), + allowed: true, + rateLimiterConfig: _getInboundRateLimiterConfig() + }); + TokenPool1_2.RampUpdate[] memory offRampUpdates = new TokenPool1_2.RampUpdate[](1); + offRampUpdates[0] = TokenPool1_2.RampUpdate({ + ramp: address(s_offRamp), + allowed: true, + rateLimiterConfig: _getInboundRateLimiterConfig() + }); + BurnMintTokenPool1_2(address(s_legacyPool)).applyRampUpdates(onRampUpdates, offRampUpdates); + } + + function _deployPool1_4() internal { + vm.startPrank(OWNER); + s_legacyPool = new BurnMintTokenPool1_4(s_token, new address[](0), address(s_mockRMN), address(s_sourceRouter)); + s_token.grantMintAndBurnRoles(address(s_legacyPool)); + + TokenPool1_4.ChainUpdate[] memory legacyChainUpdates = new TokenPool1_4.ChainUpdate[](2); + legacyChainUpdates[0] = TokenPool1_4.ChainUpdate({ + remoteChainSelector: DEST_CHAIN_SELECTOR, + allowed: true, + outboundRateLimiterConfig: _getOutboundRateLimiterConfig(), + inboundRateLimiterConfig: _getInboundRateLimiterConfig() + }); + legacyChainUpdates[1] = TokenPool1_4.ChainUpdate({ + remoteChainSelector: SOURCE_CHAIN_SELECTOR, + allowed: true, + outboundRateLimiterConfig: _getOutboundRateLimiterConfig(), + inboundRateLimiterConfig: _getInboundRateLimiterConfig() + }); + BurnMintTokenPool1_4(address(s_legacyPool)).applyChainUpdates(legacyChainUpdates); + } + + function _deploySelfServe() internal { + vm.startPrank(OWNER); + // Deploy the new pool + s_newPool = new BurnMintTokenPoolAndProxy(s_token, new address[](0), address(s_mockRMN), address(s_sourceRouter)); + // Set the previous pool on the new pool + s_newPool.setPreviousPool(s_legacyPool); + + // Configure the lanes just like the legacy pool + TokenPool.ChainUpdate[] memory chainUpdates = new TokenPool.ChainUpdate[](2); + chainUpdates[0] = TokenPool.ChainUpdate({ + remoteChainSelector: DEST_CHAIN_SELECTOR, + remotePoolAddress: abi.encode(s_destTokenPool), + remoteTokenAddress: abi.encode(s_destToken), + allowed: true, + outboundRateLimiterConfig: _getOutboundRateLimiterConfig(), + inboundRateLimiterConfig: _getInboundRateLimiterConfig() + }); + chainUpdates[1] = TokenPool.ChainUpdate({ + remoteChainSelector: SOURCE_CHAIN_SELECTOR, + remotePoolAddress: abi.encode(s_sourcePool), + remoteTokenAddress: abi.encode(s_sourceToken), + allowed: true, + outboundRateLimiterConfig: _getOutboundRateLimiterConfig(), + inboundRateLimiterConfig: _getInboundRateLimiterConfig() + }); + s_newPool.applyChainUpdates(chainUpdates); + + // Register the token on the token admin registry + s_tokenAdminRegistry.proposeAdministrator(address(s_token), OWNER); + // Accept ownership of the token + s_tokenAdminRegistry.acceptAdminRole(address(s_token)); + // Set the pool on the admin registry + s_tokenAdminRegistry.setPool(address(s_token), address(s_newPool)); + } +} + +contract TokenPoolAndProxy is EVM2EVMOnRampSetup { + event Burned(address indexed sender, uint256 amount); + event Minted(address indexed sender, address indexed recipient, uint256 amount); + + IPoolV1 internal s_pool; + BurnMintERC677 internal s_token; + IPoolPriorTo1_5 internal s_legacyPool; + address internal s_fakeOffRamp = makeAddr("off_ramp"); + + address internal s_destPool = makeAddr("dest_pool"); + + function setUp() public virtual override { + super.setUp(); + s_token = BurnMintERC677(s_sourceFeeToken); + + Router.OffRamp[] memory fakeOffRamps = new Router.OffRamp[](1); + fakeOffRamps[0] = Router.OffRamp({sourceChainSelector: DEST_CHAIN_SELECTOR, offRamp: s_fakeOffRamp}); + s_sourceRouter.applyRampUpdates(new Router.OnRamp[](0), new Router.OffRamp[](0), fakeOffRamps); + + s_token.grantMintAndBurnRoles(OWNER); + s_token.mint(OWNER, 1e18); + } + + function test_lockOrBurn_burnMint_Success() public { + s_pool = new BurnMintTokenPoolAndProxy(s_token, new address[](0), address(s_mockRMN), address(s_sourceRouter)); + _configurePool(); + _deployOldPool(); + _assertLockOrBurnCorrect(); + + vm.startPrank(OWNER); + BurnMintTokenPoolAndProxy(address(s_pool)).setPreviousPool(IPoolPriorTo1_5(address(0))); + + _assertReleaseOrMintCorrect(); + } + + function test_lockOrBurn_burnWithFromMint_Success() public { + s_pool = + new BurnWithFromMintTokenPoolAndProxy(s_token, new address[](0), address(s_mockRMN), address(s_sourceRouter)); + _configurePool(); + _deployOldPool(); + _assertLockOrBurnCorrect(); + + vm.startPrank(OWNER); + BurnMintTokenPoolAndProxy(address(s_pool)).setPreviousPool(IPoolPriorTo1_5(address(0))); + + _assertReleaseOrMintCorrect(); + } + + function test_lockOrBurn_lockRelease_Success() public { + s_pool = + new LockReleaseTokenPoolAndProxy(s_token, new address[](0), address(s_mockRMN), false, address(s_sourceRouter)); + _configurePool(); + _deployOldPool(); + _assertLockOrBurnCorrect(); + + vm.startPrank(OWNER); + BurnMintTokenPoolAndProxy(address(s_pool)).setPreviousPool(IPoolPriorTo1_5(address(0))); + + _assertReleaseOrMintCorrect(); + } + + function _deployOldPool() internal { + s_legacyPool = new BurnMintTokenPool1_2(s_token, new address[](0), address(s_mockRMN)); + s_token.grantMintAndBurnRoles(address(s_legacyPool)); + + TokenPool1_2.RampUpdate[] memory onRampUpdates = new TokenPool1_2.RampUpdate[](1); + onRampUpdates[0] = + TokenPool1_2.RampUpdate({ramp: address(s_pool), allowed: true, rateLimiterConfig: _getInboundRateLimiterConfig()}); + TokenPool1_2.RampUpdate[] memory offRampUpdates = new TokenPool1_2.RampUpdate[](1); + offRampUpdates[0] = + TokenPool1_2.RampUpdate({ramp: address(s_pool), allowed: true, rateLimiterConfig: _getInboundRateLimiterConfig()}); + BurnMintTokenPool1_2(address(s_legacyPool)).applyRampUpdates(onRampUpdates, offRampUpdates); + } + + function _configurePool() internal { + TokenPool.ChainUpdate[] memory chains = new TokenPool.ChainUpdate[](1); + chains[0] = TokenPool.ChainUpdate({ + remoteChainSelector: DEST_CHAIN_SELECTOR, + remotePoolAddress: abi.encode(s_destPool), + remoteTokenAddress: abi.encode(s_destToken), + allowed: true, + outboundRateLimiterConfig: _getOutboundRateLimiterConfig(), + inboundRateLimiterConfig: _getInboundRateLimiterConfig() + }); + + BurnMintTokenPoolAndProxy(address(s_pool)).applyChainUpdates(chains); + + // CCIP Token Admin has already been registered from TokenSetup + s_tokenAdminRegistry.setPool(address(s_token), address(s_pool)); + + s_token.grantMintAndBurnRoles(address(s_pool)); + } + + function _assertLockOrBurnCorrect() internal { + uint256 amount = 1234; + vm.startPrank(address(s_onRamp)); + + // lockOrBurn, assert normal path is taken + deal(address(s_token), address(s_pool), amount); + + s_pool.lockOrBurn( + Pool.LockOrBurnInV1({ + receiver: abi.encode(OWNER), + remoteChainSelector: DEST_CHAIN_SELECTOR, + originalSender: OWNER, + amount: amount, + localToken: address(s_token) + }) + ); + + // set legacy pool + + vm.startPrank(OWNER); + BurnMintTokenPoolAndProxy(address(s_pool)).setPreviousPool(s_legacyPool); + + // lockOrBurn, assert legacy pool is called + + vm.startPrank(address(s_onRamp)); + deal(address(s_token), address(s_pool), amount); + + vm.expectEmit(address(s_legacyPool)); + emit Burned(address(s_pool), amount); + + s_pool.lockOrBurn( + Pool.LockOrBurnInV1({ + receiver: abi.encode(OWNER), + remoteChainSelector: DEST_CHAIN_SELECTOR, + originalSender: OWNER, + amount: amount, + localToken: address(s_token) + }) + ); + } + + function _assertReleaseOrMintCorrect() internal { + uint256 amount = 1234; + vm.startPrank(s_fakeOffRamp); + + // releaseOrMint, assert normal path is taken + deal(address(s_token), address(s_pool), amount); + + s_pool.releaseOrMint( + Pool.ReleaseOrMintInV1({ + receiver: OWNER, + remoteChainSelector: DEST_CHAIN_SELECTOR, + originalSender: abi.encode(OWNER), + amount: amount, + localToken: address(s_token), + sourcePoolAddress: abi.encode(s_destPool), + sourcePoolData: "", + offchainTokenData: "" + }) + ); + + // set legacy pool + + vm.startPrank(OWNER); + BurnMintTokenPoolAndProxy(address(s_pool)).setPreviousPool(s_legacyPool); + + // releaseOrMint, assert legacy pool is called + + vm.startPrank(address(s_fakeOffRamp)); + + vm.expectEmit(address(s_legacyPool)); + emit Minted(address(s_pool), address(OWNER), amount); + + s_pool.releaseOrMint( + Pool.ReleaseOrMintInV1({ + receiver: OWNER, + remoteChainSelector: DEST_CHAIN_SELECTOR, + originalSender: abi.encode(OWNER), + amount: amount, + localToken: address(s_token), + sourcePoolAddress: abi.encode(s_destPool), + sourcePoolData: "", + offchainTokenData: "" + }) + ); + } + + function test_setPreviousPool_Success() public { + LockReleaseTokenPoolAndProxy pool = + new LockReleaseTokenPoolAndProxy(s_token, new address[](0), address(s_mockRMN), true, address(s_sourceRouter)); + + assertEq(pool.getPreviousPool(), address(0)); + + address newLegacyPool = makeAddr("new_legacy_pool"); + + vm.startPrank(OWNER); + pool.setPreviousPool(IPoolPriorTo1_5(newLegacyPool)); + assertEq(pool.getPreviousPool(), address(newLegacyPool)); + } +} + +//// +/// Duplicated tests from LockReleaseTokenPool.t.sol +/// + +contract LockReleaseTokenPoolAndProxySetup is RouterSetup { + IERC20 internal s_token; + LockReleaseTokenPoolAndProxy internal s_lockReleaseTokenPoolAndProxy; + LockReleaseTokenPoolAndProxy internal s_lockReleaseTokenPoolAndProxyWithAllowList; + address[] internal s_allowedList; + + address internal s_allowedOnRamp = address(123); + address internal s_allowedOffRamp = address(234); + + address internal s_destPoolAddress = address(2736782345); + address internal s_sourcePoolAddress = address(53852352095); + + function setUp() public virtual override { + RouterSetup.setUp(); + s_token = new BurnMintERC677("LINK", "LNK", 18, 0); + deal(address(s_token), OWNER, type(uint256).max); + s_lockReleaseTokenPoolAndProxy = + new LockReleaseTokenPoolAndProxy(s_token, new address[](0), address(s_mockRMN), true, address(s_sourceRouter)); + + s_allowedList.push(USER_1); + s_allowedList.push(DUMMY_CONTRACT_ADDRESS); + s_lockReleaseTokenPoolAndProxyWithAllowList = + new LockReleaseTokenPoolAndProxy(s_token, s_allowedList, address(s_mockRMN), true, address(s_sourceRouter)); + + TokenPool.ChainUpdate[] memory chainUpdate = new TokenPool.ChainUpdate[](1); + chainUpdate[0] = TokenPool.ChainUpdate({ + remoteChainSelector: DEST_CHAIN_SELECTOR, + remotePoolAddress: abi.encode(s_destPoolAddress), + remoteTokenAddress: abi.encode(address(s_token)), + allowed: true, + outboundRateLimiterConfig: _getOutboundRateLimiterConfig(), + inboundRateLimiterConfig: _getInboundRateLimiterConfig() + }); + + s_lockReleaseTokenPoolAndProxy.applyChainUpdates(chainUpdate); + s_lockReleaseTokenPoolAndProxyWithAllowList.applyChainUpdates(chainUpdate); + s_lockReleaseTokenPoolAndProxy.setRebalancer(OWNER); + + Router.OnRamp[] memory onRampUpdates = new Router.OnRamp[](1); + Router.OffRamp[] memory offRampUpdates = new Router.OffRamp[](1); + onRampUpdates[0] = Router.OnRamp({destChainSelector: DEST_CHAIN_SELECTOR, onRamp: s_allowedOnRamp}); + offRampUpdates[0] = Router.OffRamp({sourceChainSelector: SOURCE_CHAIN_SELECTOR, offRamp: s_allowedOffRamp}); + s_sourceRouter.applyRampUpdates(onRampUpdates, new Router.OffRamp[](0), offRampUpdates); + } +} + +contract LockReleaseTokenPoolAndProxy_setRebalancer is LockReleaseTokenPoolAndProxySetup { + function test_SetRebalancer_Success() public { + assertEq(address(s_lockReleaseTokenPoolAndProxy.getRebalancer()), OWNER); + s_lockReleaseTokenPoolAndProxy.setRebalancer(STRANGER); + assertEq(address(s_lockReleaseTokenPoolAndProxy.getRebalancer()), STRANGER); + } + + function test_SetRebalancer_Revert() public { + vm.startPrank(STRANGER); + + vm.expectRevert("Only callable by owner"); + s_lockReleaseTokenPoolAndProxy.setRebalancer(STRANGER); + } +} + +contract LockReleaseTokenPoolPoolAndProxy_canAcceptLiquidity is LockReleaseTokenPoolAndProxySetup { + function test_CanAcceptLiquidity_Success() public { + assertEq(true, s_lockReleaseTokenPoolAndProxy.canAcceptLiquidity()); + + s_lockReleaseTokenPoolAndProxy = + new LockReleaseTokenPoolAndProxy(s_token, new address[](0), address(s_mockRMN), false, address(s_sourceRouter)); + assertEq(false, s_lockReleaseTokenPoolAndProxy.canAcceptLiquidity()); + } +} + +contract LockReleaseTokenPoolPoolAndProxy_provideLiquidity is LockReleaseTokenPoolAndProxySetup { + function test_Fuzz_ProvideLiquidity_Success(uint256 amount) public { + uint256 balancePre = s_token.balanceOf(OWNER); + s_token.approve(address(s_lockReleaseTokenPoolAndProxy), amount); + + s_lockReleaseTokenPoolAndProxy.provideLiquidity(amount); + + assertEq(s_token.balanceOf(OWNER), balancePre - amount); + assertEq(s_token.balanceOf(address(s_lockReleaseTokenPoolAndProxy)), amount); + } + + // Reverts + + function test_Unauthorized_Revert() public { + vm.startPrank(STRANGER); + vm.expectRevert(abi.encodeWithSelector(TokenPool.Unauthorized.selector, STRANGER)); + + s_lockReleaseTokenPoolAndProxy.provideLiquidity(1); + } + + function test_Fuzz_ExceedsAllowance(uint256 amount) public { + vm.assume(amount > 0); + vm.expectRevert("ERC20: insufficient allowance"); + s_lockReleaseTokenPoolAndProxy.provideLiquidity(amount); + } + + function test_LiquidityNotAccepted_Revert() public { + s_lockReleaseTokenPoolAndProxy = + new LockReleaseTokenPoolAndProxy(s_token, new address[](0), address(s_mockRMN), false, address(s_sourceRouter)); + + vm.expectRevert(LockReleaseTokenPoolAndProxy.LiquidityNotAccepted.selector); + s_lockReleaseTokenPoolAndProxy.provideLiquidity(1); + } +} + +contract LockReleaseTokenPoolPoolAndProxy_withdrawalLiquidity is LockReleaseTokenPoolAndProxySetup { + function test_Fuzz_WithdrawalLiquidity_Success(uint256 amount) public { + uint256 balancePre = s_token.balanceOf(OWNER); + s_token.approve(address(s_lockReleaseTokenPoolAndProxy), amount); + s_lockReleaseTokenPoolAndProxy.provideLiquidity(amount); + + s_lockReleaseTokenPoolAndProxy.withdrawLiquidity(amount); + + assertEq(s_token.balanceOf(OWNER), balancePre); + } + + // Reverts + + function test_Unauthorized_Revert() public { + vm.startPrank(STRANGER); + vm.expectRevert(abi.encodeWithSelector(TokenPool.Unauthorized.selector, STRANGER)); + + s_lockReleaseTokenPoolAndProxy.withdrawLiquidity(1); + } + + function test_InsufficientLiquidity_Revert() public { + uint256 maxUint256 = 2 ** 256 - 1; + s_token.approve(address(s_lockReleaseTokenPoolAndProxy), maxUint256); + s_lockReleaseTokenPoolAndProxy.provideLiquidity(maxUint256); + + vm.startPrank(address(s_lockReleaseTokenPoolAndProxy)); + s_token.transfer(OWNER, maxUint256); + vm.startPrank(OWNER); + + vm.expectRevert(LockReleaseTokenPoolAndProxy.InsufficientLiquidity.selector); + s_lockReleaseTokenPoolAndProxy.withdrawLiquidity(1); + } +} + +contract LockReleaseTokenPoolPoolAndProxy_supportsInterface is LockReleaseTokenPoolAndProxySetup { + function test_SupportsInterface_Success() public view { + assertTrue(s_lockReleaseTokenPoolAndProxy.supportsInterface(type(IPoolV1).interfaceId)); + assertTrue(s_lockReleaseTokenPoolAndProxy.supportsInterface(type(IERC165).interfaceId)); + } +} diff --git a/contracts/src/v0.8/ccip/test/libraries/MerkleMultiProof.t.sol b/contracts/src/v0.8/ccip/test/libraries/MerkleMultiProof.t.sol new file mode 100644 index 00000000000..e2fc9814d07 --- /dev/null +++ b/contracts/src/v0.8/ccip/test/libraries/MerkleMultiProof.t.sol @@ -0,0 +1,196 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {MerkleMultiProof} from "../../libraries/MerkleMultiProof.sol"; +import {MerkleHelper} from "../helpers/MerkleHelper.sol"; +import {Test} from "forge-std/Test.sol"; + +contract MerkleMultiProofTest is Test { + // This must match the spec + function test_SpecSync_gas() public pure { + bytes32 expectedRoot = 0xd4f0f3c40a4d583d98c17d89e550b1143fe4d3d759f25ccc63131c90b183928e; + + bytes32[] memory leaves = new bytes32[](10); + leaves[0] = 0xa20c0244af79697a4ef4e2378c9d5d14cbd49ddab3427b12594c7cfa67a7f240; + leaves[1] = 0x3de96afb24ce2ac45a5595aa13d1a5163ae0b3c94cef6b2dc306b5966f32dfa5; + leaves[2] = 0xacadf7b4d13cd57c5d25f1d27be39b656347fe8f8e0de8db9c76d979dff57736; + leaves[3] = 0xc21c26a709802fe1ae52a9cd8ad94d15bf142ded26314339cd87a13e5b468165; + leaves[4] = 0x55f6df03562738c9a6437cd9ad221c52b76906a175ae96188cff60e0a2a59933; + leaves[5] = 0x2dbbe66452e43fec839dc65d5945aad6433d410c65863eaf1d876e1e0b06343c; + leaves[6] = 0x8beab00297b94bf079fcd5893b0a33ebf6b0ce862cd06be07c87d3c63e1c4acf; + leaves[7] = 0xcabdd3ad25daeb1e0541042f2ea4cd177f54e67aa4a2c697acd4bb682e94de59; + leaves[8] = 0x7e01d497203685e99e34df33d55465c66b2253fa1630ee2fe5c4997968e4a6fa; + leaves[9] = 0x1a03d013f1e2fa9cc04f89c7528ac3216e3e096a1185d7247304e97c59f9661f; + + bytes32[] memory proofs = new bytes32[](33); + proofs[0] = 0xde96f24fcf9ddd20c803dc9c5fba7c478a5598a08a0faa5f032c65823b8e26a3; + proofs[1] = 0xe1303cffc3958a6b93e2dc04caf21f200ff5aa5be090c5013f37804b91488bc2; + proofs[2] = 0x90d80c76bccb44a91f4e16604976163aaa39e9a1588b0b24b33a61f1d4ba7bb5; + proofs[3] = 0x012a299b25539d513c8677ecf37968774e9e4b045e79737f48defd350224cdfd; + proofs[4] = 0x420a36c5a73f87d8fb98e70c48d0d6f9dd83f50b7b91416a6f5f91fac4db800f; + proofs[5] = 0x5857d8d1b56abcd7f863cedd3c3f8677256f54d675be61f05efa45d6495fc30a; + proofs[6] = 0xbf176d20166fdeb72593ff97efec1ce6244af41ca46cf0bc902d19d50c446f7b; + proofs[7] = 0xa9221608e4380250a1815fb308632bce99f611a673d2e17fc617123fdc6afcd2; + proofs[8] = 0xbd14f3366c73186314f182027217d0f70eba55817561de9e9a1f2c78bf5cbead; + proofs[9] = 0x2f9aa48c0c9f82aaac65d7a9374a52d9dc138ed100a5809ede57e70697f48b56; + proofs[10] = 0x2ae60afa54271cb421c12e4441c2dac0a25f25c9433a6d07cb32419e993fe344; + proofs[11] = 0xc765c091680f0434b74c44507b932e5c80f6e995a975a275e5b130af1de1064c; + proofs[12] = 0x59d2d6e0c4a5d07b169dbcdfa39dad7aea7b7783a814399f4f44c4a36b6336d3; + proofs[13] = 0xdd14d1387d10740187d71ad9500475399559c0922dbe2576882e61f1edd84692; + proofs[14] = 0x5412b8395509935406811ab3da43ab80be7acd8ffb5f398ab70f056ff3740f46; + proofs[15] = 0xeadab258ae7d779ce5f10fbb1bb0273116b8eccbf738ed878db570de78bed1e4; + proofs[16] = 0x6133aa40e6db75373b7cfc79e6f8b8ce80e441e6c1f98b85a593464dda3cf9c0; + proofs[17] = 0x5418948467112660639b932af9b1b212e40d71b24326b4606679d168a765af4f; + proofs[18] = 0x44f618505355c7e4e7c0f81d6bb15d2ec9cf9b366f9e1dc37db52745486e6b0f; + proofs[19] = 0xa410ee174a66a4d64f3c000b93efe15b5b1f3e39e962af2580fcd30bce07d039; + proofs[20] = 0x09c3eb05ac9552022a45c00d01a47cd56f95f94afdd4402299dba1291a17f976; + proofs[21] = 0x0e780f6acd081b07320a55208fa3e1d884e2e95cb13d1c98c74b7e853372c813; + proofs[22] = 0x2b60e8c21f78ef22fa4297f28f1d8c747181edfc465121b39c16be97d4fb8a04; + proofs[23] = 0xf24da95060a8598c06e9dfb3926e1a8c8bd8ec2c65be10e69323442840724888; + proofs[24] = 0x7e220fc095bcd2b0f5ef134d9620d89f6d7a1e8719ce8893bb9aff15e847578f; + proofs[25] = 0xcfe9e475c4bd32f1e36b2cc65a959c403c59979ff914fb629a64385b0c680a71; + proofs[26] = 0x25237fb8d1bfdc01ca5363ec3166a2b40789e38d5adcc8627801da683d2e1d76; + proofs[27] = 0x42647949fed0250139c01212d739d8c83d2852589ebc892d3490ae52e411432c; + proofs[28] = 0x34397a30930e6dd4fb5af48084afc5cfbe02c18dd9544b3faff4e2e90bf00cb9; + proofs[29] = 0xa028f33226adc3d1cb72b19eb6808dab9190b25066a45cacb5dfe5d640e57cf2; + proofs[30] = 0x7cff66ba47a05f932d06d168c294266dcb0d3943a4f2a4a75c860b9fd6e53092; + proofs[31] = 0x5ca1b32f1dbfadd83205882be5eb76f34c49e834726f5239905a0e70d0a5e0eb; + proofs[32] = 0x1b4b087a89e4eca6cdd237210932559dc8fd167d5f4f2d9acb13264e1e305479; + + uint256 flagsUint256 = 0x2f3c0000000; + + bytes32 root = MerkleMultiProof.merkleRoot(leaves, proofs, flagsUint256); + + assertEq(expectedRoot, root); + } + + function test_Fuzz_MerkleRoot2(bytes32 left, bytes32 right) public pure { + bytes32[] memory leaves = new bytes32[](2); + leaves[0] = left; + leaves[1] = right; + bytes32[] memory proofs = new bytes32[](0); + + bytes32 expectedRoot = MerkleHelper.hashPair(left, right); + + bytes32 root = MerkleMultiProof.merkleRoot(leaves, proofs, 2 ** 2 - 1); + + assertEq(root, expectedRoot); + } + + function test_MerkleRoot256() public pure { + bytes32[] memory leaves = new bytes32[](256); + for (uint256 i = 0; i < leaves.length; ++i) { + leaves[i] = keccak256("a"); + } + bytes32[] memory proofs = new bytes32[](0); + + bytes32 expectedRoot = MerkleHelper.getMerkleRoot(leaves); + + bytes32 root = MerkleMultiProof.merkleRoot(leaves, proofs, 2 ** 256 - 1); + + assertEq(root, expectedRoot); + } + + function test_Fuzz_MerkleMulti1of4(bytes32 leaf1, bytes32 proof1, bytes32 proof2) public pure { + bytes32[] memory leaves = new bytes32[](1); + leaves[0] = leaf1; + bytes32[] memory proofs = new bytes32[](2); + proofs[0] = proof1; + proofs[1] = proof2; + + // Proof flag = false + bytes32 result = MerkleHelper.hashPair(leaves[0], proofs[0]); + // Proof flag = false + result = MerkleHelper.hashPair(result, proofs[1]); + + assertEq(MerkleMultiProof.merkleRoot(leaves, proofs, 0), result); + } + + function test_Fuzz_MerkleMulti2of4(bytes32 leaf1, bytes32 leaf2, bytes32 proof1, bytes32 proof2) public pure { + bytes32[] memory leaves = new bytes32[](2); + leaves[0] = leaf1; + leaves[1] = leaf2; + bytes32[] memory proofs = new bytes32[](2); + proofs[0] = proof1; + proofs[1] = proof2; + + // Proof flag = false + bytes32 result1 = MerkleHelper.hashPair(leaves[0], proofs[0]); + // Proof flag = false + bytes32 result2 = MerkleHelper.hashPair(leaves[1], proofs[1]); + // Proof flag = true + bytes32 finalResult = MerkleHelper.hashPair(result1, result2); + + assertEq(MerkleMultiProof.merkleRoot(leaves, proofs, 4), finalResult); + } + + function test_Fuzz_MerkleMulti3of4(bytes32 leaf1, bytes32 leaf2, bytes32 leaf3, bytes32 proof) public pure { + bytes32[] memory leaves = new bytes32[](3); + leaves[0] = leaf1; + leaves[1] = leaf2; + leaves[2] = leaf3; + bytes32[] memory proofs = new bytes32[](1); + proofs[0] = proof; + + // Proof flag = true + bytes32 result1 = MerkleHelper.hashPair(leaves[0], leaves[1]); + // Proof flag = false + bytes32 result2 = MerkleHelper.hashPair(leaves[2], proofs[0]); + // Proof flag = true + bytes32 finalResult = MerkleHelper.hashPair(result1, result2); + + assertEq(MerkleMultiProof.merkleRoot(leaves, proofs, 5), finalResult); + } + + function test_Fuzz_MerkleMulti4of4(bytes32 leaf1, bytes32 leaf2, bytes32 leaf3, bytes32 leaf4) public pure { + bytes32[] memory leaves = new bytes32[](4); + leaves[0] = leaf1; + leaves[1] = leaf2; + leaves[2] = leaf3; + leaves[3] = leaf4; + bytes32[] memory proofs = new bytes32[](0); + + // Proof flag = true + bytes32 result1 = MerkleHelper.hashPair(leaves[0], leaves[1]); + // Proof flag = true + bytes32 result2 = MerkleHelper.hashPair(leaves[2], leaves[3]); + // Proof flag = true + bytes32 finalResult = MerkleHelper.hashPair(result1, result2); + + assertEq(MerkleMultiProof.merkleRoot(leaves, proofs, 7), finalResult); + } + + function test_MerkleRootSingleLeaf_Success() public pure { + bytes32[] memory leaves = new bytes32[](1); + leaves[0] = "root"; + bytes32[] memory proofs = new bytes32[](0); + assertEq(MerkleMultiProof.merkleRoot(leaves, proofs, 0), leaves[0]); + } + + function test_EmptyLeaf_Revert() public { + bytes32[] memory leaves = new bytes32[](0); + bytes32[] memory proofs = new bytes32[](0); + + vm.expectRevert(abi.encodeWithSelector(MerkleMultiProof.LeavesCannotBeEmpty.selector)); + MerkleMultiProof.merkleRoot(leaves, proofs, 0); + } + + function test_CVE_2023_34459() public { + bytes32[] memory leaves = new bytes32[](2); + // leaves[0] stays uninitialized, i.e., 0x000...0 + leaves[1] = "leaf"; + + bytes32[] memory proof = new bytes32[](2); + proof[0] = leaves[1]; + proof[1] = "will never be used"; + + bytes32[] memory malicious = new bytes32[](2); + malicious[0] = "malicious leaf"; + malicious[1] = "another malicious leaf"; + + vm.expectRevert(abi.encodeWithSelector(MerkleMultiProof.InvalidProof.selector)); + MerkleMultiProof.merkleRoot(malicious, proof, 3); + // Note, that without the revert the above computed root + // would equal MerkleHelper.hashPair(leaves[0], leaves[1]). + } +} diff --git a/contracts/src/v0.8/ccip/test/libraries/RateLimiter.t.sol b/contracts/src/v0.8/ccip/test/libraries/RateLimiter.t.sol new file mode 100644 index 00000000000..da6a6f9ada7 --- /dev/null +++ b/contracts/src/v0.8/ccip/test/libraries/RateLimiter.t.sol @@ -0,0 +1,297 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {RateLimiter} from "../../libraries/RateLimiter.sol"; +import {RateLimiterHelper} from "../helpers/RateLimiterHelper.sol"; +import {Test} from "forge-std/Test.sol"; + +contract RateLimiterSetup is Test { + RateLimiterHelper internal s_helper; + RateLimiter.Config internal s_config; + + uint256 internal constant BLOCK_TIME = 1234567890; + + function setUp() public virtual { + s_config = RateLimiter.Config({isEnabled: true, rate: 5, capacity: 100}); + s_helper = new RateLimiterHelper(s_config); + } +} + +contract RateLimiter_constructor is RateLimiterSetup { + function test_Constructor_Success() public view { + RateLimiter.TokenBucket memory rateLimiter = s_helper.getRateLimiter(); + assertEq(s_config.rate, rateLimiter.rate); + assertEq(s_config.capacity, rateLimiter.capacity); + assertEq(s_config.capacity, rateLimiter.tokens); + assertEq(s_config.isEnabled, rateLimiter.isEnabled); + assertEq(BLOCK_TIME, rateLimiter.lastUpdated); + } +} + +contract RateLimiter_setTokenBucketConfig is RateLimiterSetup { + function test_SetRateLimiterConfig_Success() public { + RateLimiter.TokenBucket memory rateLimiter = s_helper.getRateLimiter(); + assertEq(s_config.rate, rateLimiter.rate); + assertEq(s_config.capacity, rateLimiter.capacity); + + s_config = + RateLimiter.Config({isEnabled: true, rate: uint128(rateLimiter.rate * 2), capacity: rateLimiter.capacity * 8}); + + vm.expectEmit(); + emit RateLimiter.ConfigChanged(s_config); + + s_helper.setTokenBucketConfig(s_config); + + rateLimiter = s_helper.getRateLimiter(); + assertEq(s_config.rate, rateLimiter.rate); + assertEq(s_config.capacity, rateLimiter.capacity); + assertEq(s_config.capacity / 8, rateLimiter.tokens); + assertEq(s_config.isEnabled, rateLimiter.isEnabled); + assertEq(BLOCK_TIME, rateLimiter.lastUpdated); + } +} + +contract RateLimiter_currentTokenBucketState is RateLimiterSetup { + function test_CurrentTokenBucketState_Success() public { + RateLimiter.TokenBucket memory bucket = s_helper.currentTokenBucketState(); + assertEq(s_config.rate, bucket.rate); + assertEq(s_config.capacity, bucket.capacity); + assertEq(s_config.capacity, bucket.tokens); + assertEq(s_config.isEnabled, bucket.isEnabled); + assertEq(BLOCK_TIME, bucket.lastUpdated); + + s_config = RateLimiter.Config({isEnabled: true, rate: uint128(bucket.rate * 2), capacity: bucket.capacity * 8}); + + s_helper.setTokenBucketConfig(s_config); + + bucket = s_helper.currentTokenBucketState(); + assertEq(s_config.rate, bucket.rate); + assertEq(s_config.capacity, bucket.capacity); + assertEq(s_config.capacity / 8, bucket.tokens); + assertEq(s_config.isEnabled, bucket.isEnabled); + assertEq(BLOCK_TIME, bucket.lastUpdated); + } + + function test_Refill_Success() public { + RateLimiter.TokenBucket memory bucket = s_helper.currentTokenBucketState(); + assertEq(s_config.rate, bucket.rate); + assertEq(s_config.capacity, bucket.capacity); + assertEq(s_config.capacity, bucket.tokens); + assertEq(s_config.isEnabled, bucket.isEnabled); + assertEq(BLOCK_TIME, bucket.lastUpdated); + + s_config = RateLimiter.Config({isEnabled: true, rate: uint128(bucket.rate * 2), capacity: bucket.capacity * 8}); + + s_helper.setTokenBucketConfig(s_config); + + bucket = s_helper.currentTokenBucketState(); + assertEq(s_config.rate, bucket.rate); + assertEq(s_config.capacity, bucket.capacity); + assertEq(s_config.capacity / 8, bucket.tokens); + assertEq(s_config.isEnabled, bucket.isEnabled); + assertEq(BLOCK_TIME, bucket.lastUpdated); + + uint256 warpTime = 4; + vm.warp(BLOCK_TIME + warpTime); + + bucket = s_helper.currentTokenBucketState(); + + assertEq(s_config.capacity / 8 + warpTime * s_config.rate, bucket.tokens); + + vm.warp(BLOCK_TIME + warpTime * 100); + + // Bucket overflow + bucket = s_helper.currentTokenBucketState(); + assertEq(s_config.capacity, bucket.tokens); + } +} + +contract RateLimiter_consume is RateLimiterSetup { + address internal s_token = address(100); + + function test_ConsumeAggregateValue_Success() public { + RateLimiter.TokenBucket memory rateLimiter = s_helper.getRateLimiter(); + assertEq(s_config.rate, rateLimiter.rate); + assertEq(s_config.capacity, rateLimiter.capacity); + assertEq(s_config.capacity, rateLimiter.tokens); + assertEq(s_config.isEnabled, rateLimiter.isEnabled); + assertEq(BLOCK_TIME, rateLimiter.lastUpdated); + + uint256 requestTokens = 50; + + vm.expectEmit(); + emit RateLimiter.TokensConsumed(requestTokens); + + s_helper.consume(requestTokens, address(0)); + + rateLimiter = s_helper.getRateLimiter(); + assertEq(s_config.rate, rateLimiter.rate); + assertEq(s_config.capacity, rateLimiter.capacity); + assertEq(s_config.capacity - requestTokens, rateLimiter.tokens); + assertEq(s_config.isEnabled, rateLimiter.isEnabled); + assertEq(BLOCK_TIME, rateLimiter.lastUpdated); + } + + function test_ConsumeTokens_Success() public { + uint256 requestTokens = 50; + + vm.expectEmit(); + emit RateLimiter.TokensConsumed(requestTokens); + + s_helper.consume(requestTokens, s_token); + } + + function test_Refill_Success() public { + uint256 requestTokens = 50; + + vm.expectEmit(); + emit RateLimiter.TokensConsumed(requestTokens); + + s_helper.consume(requestTokens, address(0)); + + RateLimiter.TokenBucket memory rateLimiter = s_helper.getRateLimiter(); + assertEq(s_config.rate, rateLimiter.rate); + assertEq(s_config.capacity, rateLimiter.capacity); + assertEq(s_config.capacity - requestTokens, rateLimiter.tokens); + assertEq(s_config.isEnabled, rateLimiter.isEnabled); + assertEq(BLOCK_TIME, rateLimiter.lastUpdated); + + uint256 warpTime = 4; + vm.warp(BLOCK_TIME + warpTime); + + vm.expectEmit(); + emit RateLimiter.TokensConsumed(requestTokens); + + s_helper.consume(requestTokens, address(0)); + + rateLimiter = s_helper.getRateLimiter(); + assertEq(s_config.rate, rateLimiter.rate); + assertEq(s_config.capacity, rateLimiter.capacity); + assertEq(s_config.capacity - requestTokens * 2 + warpTime * s_config.rate, rateLimiter.tokens); + assertEq(s_config.isEnabled, rateLimiter.isEnabled); + assertEq(BLOCK_TIME + warpTime, rateLimiter.lastUpdated); + } + + function test_ConsumeUnlimited_Success() public { + s_helper.consume(0, address(0)); + + RateLimiter.TokenBucket memory rateLimiter = s_helper.getRateLimiter(); + assertEq(s_config.capacity, rateLimiter.tokens); + assertEq(s_config.isEnabled, rateLimiter.isEnabled); + + RateLimiter.Config memory disableConfig = RateLimiter.Config({isEnabled: false, rate: 0, capacity: 0}); + + s_helper.setTokenBucketConfig(disableConfig); + + uint256 requestTokens = 50; + s_helper.consume(requestTokens, address(0)); + + rateLimiter = s_helper.getRateLimiter(); + assertEq(disableConfig.capacity, rateLimiter.tokens); + assertEq(disableConfig.isEnabled, rateLimiter.isEnabled); + + s_helper.setTokenBucketConfig(s_config); + + vm.expectRevert(abi.encodeWithSelector(RateLimiter.AggregateValueRateLimitReached.selector, 10, 0)); + s_helper.consume(requestTokens, address(0)); + + rateLimiter = s_helper.getRateLimiter(); + assertEq(s_config.rate, rateLimiter.rate); + assertEq(s_config.capacity, rateLimiter.capacity); + assertEq(0, rateLimiter.tokens); + assertEq(s_config.isEnabled, rateLimiter.isEnabled); + } + + // Reverts + + function test_AggregateValueMaxCapacityExceeded_Revert() public { + RateLimiter.TokenBucket memory rateLimiter = s_helper.getRateLimiter(); + + vm.expectRevert( + abi.encodeWithSelector( + RateLimiter.AggregateValueMaxCapacityExceeded.selector, rateLimiter.capacity, rateLimiter.capacity + 1 + ) + ); + s_helper.consume(rateLimiter.capacity + 1, address(0)); + } + + function test_TokenMaxCapacityExceeded_Revert() public { + RateLimiter.TokenBucket memory rateLimiter = s_helper.getRateLimiter(); + + vm.expectRevert( + abi.encodeWithSelector( + RateLimiter.TokenMaxCapacityExceeded.selector, rateLimiter.capacity, rateLimiter.capacity + 1, s_token + ) + ); + s_helper.consume(rateLimiter.capacity + 1, s_token); + } + + function test_ConsumingMoreThanUint128_Revert() public { + RateLimiter.TokenBucket memory rateLimiter = s_helper.getRateLimiter(); + + uint256 request = uint256(type(uint128).max) + 1; + + vm.expectRevert( + abi.encodeWithSelector(RateLimiter.AggregateValueMaxCapacityExceeded.selector, rateLimiter.capacity, request) + ); + s_helper.consume(request, address(0)); + } + + function test_AggregateValueRateLimitReached_Revert() public { + RateLimiter.TokenBucket memory rateLimiter = s_helper.getRateLimiter(); + + uint256 overLimit = 20; + uint256 requestTokens1 = rateLimiter.capacity / 2; + uint256 requestTokens2 = rateLimiter.capacity / 2 + overLimit; + + uint256 waitInSeconds = overLimit / rateLimiter.rate; + + s_helper.consume(requestTokens1, address(0)); + + vm.expectRevert( + abi.encodeWithSelector( + RateLimiter.AggregateValueRateLimitReached.selector, waitInSeconds, rateLimiter.capacity - requestTokens1 + ) + ); + s_helper.consume(requestTokens2, address(0)); + } + + function test_TokenRateLimitReached_Revert() public { + RateLimiter.TokenBucket memory rateLimiter = s_helper.getRateLimiter(); + + uint256 overLimit = 20; + uint256 requestTokens1 = rateLimiter.capacity / 2; + uint256 requestTokens2 = rateLimiter.capacity / 2 + overLimit; + + uint256 waitInSeconds = overLimit / rateLimiter.rate; + + s_helper.consume(requestTokens1, s_token); + + vm.expectRevert( + abi.encodeWithSelector( + RateLimiter.TokenRateLimitReached.selector, waitInSeconds, rateLimiter.capacity - requestTokens1, s_token + ) + ); + s_helper.consume(requestTokens2, s_token); + } + + function test_RateLimitReachedOverConsecutiveBlocks_Revert() public { + uint256 initBlockTime = BLOCK_TIME + 10000; + vm.warp(initBlockTime); + + RateLimiter.TokenBucket memory rateLimiter = s_helper.getRateLimiter(); + + vm.expectEmit(); + emit RateLimiter.TokensConsumed(rateLimiter.capacity); + + s_helper.consume(rateLimiter.capacity, address(0)); + + vm.warp(initBlockTime + 1); + + // Over rate limit by 1, force 1 second wait + uint256 overLimit = 1; + + vm.expectRevert(abi.encodeWithSelector(RateLimiter.AggregateValueRateLimitReached.selector, 1, rateLimiter.rate)); + s_helper.consume(rateLimiter.rate + overLimit, address(0)); + } +} diff --git a/contracts/src/v0.8/ccip/test/mocks/MockCommitStore.sol b/contracts/src/v0.8/ccip/test/mocks/MockCommitStore.sol new file mode 100644 index 00000000000..aff06016fa5 --- /dev/null +++ b/contracts/src/v0.8/ccip/test/mocks/MockCommitStore.sol @@ -0,0 +1,42 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {ICommitStore} from "../../interfaces/ICommitStore.sol"; + +contract MockCommitStore is ICommitStore { + error PausedError(); + + uint64 private s_expectedNextSequenceNumber = 1; + + bool private s_paused = false; + + /// @inheritdoc ICommitStore + function verify( + bytes32[] calldata, + bytes32[] calldata, + uint256 + ) external view whenNotPaused returns (uint256 timestamp) { + return 1; + } + + function getExpectedNextSequenceNumber() external view returns (uint64) { + return s_expectedNextSequenceNumber; + } + + function setExpectedNextSequenceNumber(uint64 nextSeqNum) external { + s_expectedNextSequenceNumber = nextSeqNum; + } + + modifier whenNotPaused() { + if (paused()) revert PausedError(); + _; + } + + function paused() public view returns (bool) { + return s_paused; + } + + function pause() external { + s_paused = true; + } +} diff --git a/contracts/src/v0.8/ccip/test/mocks/MockE2EUSDCTokenMessenger.sol b/contracts/src/v0.8/ccip/test/mocks/MockE2EUSDCTokenMessenger.sol new file mode 100644 index 00000000000..1b6c9c750dd --- /dev/null +++ b/contracts/src/v0.8/ccip/test/mocks/MockE2EUSDCTokenMessenger.sol @@ -0,0 +1,127 @@ +/* + * Copyright (c) 2022, Circle Internet Financial Limited. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +pragma solidity 0.8.24; + +import {IBurnMintERC20} from "../../../shared/token/ERC20/IBurnMintERC20.sol"; +import {ITokenMessenger} from "../../pools/USDC/ITokenMessenger.sol"; +import {IMessageTransmitterWithRelay} from "./interfaces/IMessageTransmitterWithRelay.sol"; + +// This contract mocks both the ITokenMessenger and IMessageTransmitter +// contracts involved with the Cross Chain Token Protocol. +contract MockE2EUSDCTokenMessenger is ITokenMessenger { + uint32 private immutable i_messageBodyVersion; + address private immutable i_transmitter; + + bytes32 public constant DESTINATION_TOKEN_MESSENGER = keccak256("i_destinationTokenMessenger"); + + uint64 public s_nonce; + + // Local Message Transmitter responsible for sending and receiving messages to/from remote domains + IMessageTransmitterWithRelay public immutable localMessageTransmitterWithRelay; + + constructor(uint32 version, address transmitter) { + i_messageBodyVersion = version; + s_nonce = 1; + i_transmitter = transmitter; + localMessageTransmitterWithRelay = IMessageTransmitterWithRelay(transmitter); + } + + // The mock function is based on the same function in https://github.com/circlefin/evm-cctp-contracts/blob/master/src/TokenMessenger.sol + function depositForBurnWithCaller( + uint256 amount, + uint32 destinationDomain, + bytes32 mintRecipient, + address burnToken, + bytes32 destinationCaller + ) external returns (uint64) { + IBurnMintERC20(burnToken).transferFrom(msg.sender, address(this), amount); + IBurnMintERC20(burnToken).burn(amount); + // Format message body + bytes memory _burnMessage = _formatMessage( + i_messageBodyVersion, + bytes32(uint256(uint160(burnToken))), + mintRecipient, + amount, + bytes32(uint256(uint160(msg.sender))) + ); + s_nonce = + _sendDepositForBurnMessage(destinationDomain, DESTINATION_TOKEN_MESSENGER, destinationCaller, _burnMessage); + emit DepositForBurn( + s_nonce, + burnToken, + amount, + msg.sender, + mintRecipient, + destinationDomain, + DESTINATION_TOKEN_MESSENGER, + destinationCaller + ); + return s_nonce; + } + + function messageBodyVersion() external view returns (uint32) { + return i_messageBodyVersion; + } + + function localMessageTransmitter() external view returns (address) { + return i_transmitter; + } + + /** + * @notice Sends a BurnMessage through the local message transmitter + * @dev calls local message transmitter's sendMessage() function if `_destinationCaller` == bytes32(0), + * or else calls sendMessageWithCaller(). + * @param _destinationDomain destination domain + * @param _destinationTokenMessenger address of registered TokenMessenger contract on destination domain, as bytes32 + * @param _destinationCaller caller on the destination domain, as bytes32. If `_destinationCaller` == bytes32(0), + * any address can call receiveMessage() on destination domain. + * @param _burnMessage formatted BurnMessage bytes (message body) + * @return nonce unique nonce reserved by message + */ + function _sendDepositForBurnMessage( + uint32 _destinationDomain, + bytes32 _destinationTokenMessenger, + bytes32 _destinationCaller, + bytes memory _burnMessage + ) internal returns (uint64 nonce) { + if (_destinationCaller == bytes32(0)) { + return localMessageTransmitterWithRelay.sendMessage(_destinationDomain, _destinationTokenMessenger, _burnMessage); + } else { + return localMessageTransmitterWithRelay.sendMessageWithCaller( + _destinationDomain, _destinationTokenMessenger, _destinationCaller, _burnMessage + ); + } + } + + /** + * @notice Formats Burn message + * @param _version The message body version + * @param _burnToken The burn token address on source domain as bytes32 + * @param _mintRecipient The mint recipient address as bytes32 + * @param _amount The burn amount + * @param _messageSender The message sender + * @return Burn formatted message. + */ + function _formatMessage( + uint32 _version, + bytes32 _burnToken, + bytes32 _mintRecipient, + uint256 _amount, + bytes32 _messageSender + ) internal pure returns (bytes memory) { + return abi.encodePacked(_version, _burnToken, _mintRecipient, _amount, _messageSender); + } +} diff --git a/contracts/src/v0.8/ccip/test/mocks/MockE2EUSDCTransmitter.sol b/contracts/src/v0.8/ccip/test/mocks/MockE2EUSDCTransmitter.sol new file mode 100644 index 00000000000..bbd9c7dcc66 --- /dev/null +++ b/contracts/src/v0.8/ccip/test/mocks/MockE2EUSDCTransmitter.sol @@ -0,0 +1,177 @@ +/* + * Copyright (c) 2022, Circle Internet Financial Limited. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +pragma solidity ^0.8.0; + +import {IMessageTransmitterWithRelay} from "./interfaces/IMessageTransmitterWithRelay.sol"; + +import {BurnMintERC677} from "../../../shared/token/ERC677/BurnMintERC677.sol"; + +contract MockE2EUSDCTransmitter is IMessageTransmitterWithRelay { + // Indicated whether the receiveMessage() call should succeed. + bool public s_shouldSucceed; + uint32 private immutable i_version; + uint32 private immutable i_localDomain; + // Next available nonce from this source domain + uint64 public nextAvailableNonce; + + BurnMintERC677 internal immutable i_token; + + /** + * @notice Emitted when a new message is dispatched + * @param message Raw bytes of message + */ + event MessageSent(bytes message); + + constructor(uint32 _version, uint32 _localDomain, address token) { + i_version = _version; + i_localDomain = _localDomain; + s_shouldSucceed = true; + + i_token = BurnMintERC677(token); + } + + /// @param message The original message on the source chain + /// * Message format: + /// * Field Bytes Type Index + /// * version 4 uint32 0 + /// * sourceDomain 4 uint32 4 + /// * destinationDomain 4 uint32 8 + /// * nonce 8 uint64 12 + /// * sender 32 bytes32 20 + /// * recipient 32 bytes32 52 + /// * destinationCaller 32 bytes32 84 + /// * messageBody dynamic bytes 116 + function receiveMessage(bytes calldata message, bytes calldata) external returns (bool success) { + // The receiver of the funds is the _mintRecipient in the following encoded format + // function _formatMessage( + // uint32 _version, 4 + // bytes32 _burnToken, 32 + // bytes32 _mintRecipient, 32, first 12 empty for EVM addresses + // uint256 _amount, + // bytes32 _messageSender + // ) internal pure returns (bytes memory) { + // return abi.encodePacked(_version, _burnToken, _mintRecipient, _amount, _messageSender); + // } + address recipient = address(bytes20(message[116 + 36 + 12:116 + 36 + 12 + 20])); + // We always mint 1 token to not complicate the test. + i_token.mint(recipient, 1); + + return s_shouldSucceed; + } + + function setShouldSucceed(bool shouldSucceed) external { + s_shouldSucceed = shouldSucceed; + } + + function version() external view returns (uint32) { + return i_version; + } + + function localDomain() external view returns (uint32) { + return i_localDomain; + } + + /** + * This is based on similar function in https://github.com/circlefin/evm-cctp-contracts/blob/master/src/MessageTransmitter.sol + * @notice Send the message to the destination domain and recipient + * @dev Increment nonce, format the message, and emit `MessageSent` event with message information. + * @param destinationDomain Domain of destination chain + * @param recipient Address of message recipient on destination chain as bytes32 + * @param messageBody Raw bytes content of message + * @return nonce reserved by message + */ + function sendMessage( + uint32 destinationDomain, + bytes32 recipient, + bytes calldata messageBody + ) external returns (uint64) { + bytes32 _emptyDestinationCaller = bytes32(0); + uint64 _nonce = _reserveAndIncrementNonce(); + bytes32 _messageSender = bytes32(uint256(uint160((msg.sender)))); + + _sendMessage(destinationDomain, recipient, _emptyDestinationCaller, _messageSender, _nonce, messageBody); + + return _nonce; + } + + /** + * @notice Send the message to the destination domain and recipient, for a specified `destinationCaller` on the + * destination domain. + * @dev Increment nonce, format the message, and emit `MessageSent` event with message information. + * WARNING: if the `destinationCaller` does not represent a valid address, then it will not be possible + * to broadcast the message on the destination domain. This is an advanced feature, and the standard + * sendMessage() should be preferred for use cases where a specific destination caller is not required. + * @param destinationDomain Domain of destination chain + * @param recipient Address of message recipient on destination domain as bytes32 + * @param destinationCaller caller on the destination domain, as bytes32 + * @param messageBody Raw bytes content of message + * @return nonce reserved by message + */ + function sendMessageWithCaller( + uint32 destinationDomain, + bytes32 recipient, + bytes32 destinationCaller, + bytes calldata messageBody + ) external returns (uint64) { + require(destinationCaller != bytes32(0), "Destination caller must be nonzero"); + + uint64 _nonce = _reserveAndIncrementNonce(); + bytes32 _messageSender = bytes32(uint256(uint160((msg.sender)))); + + _sendMessage(destinationDomain, recipient, destinationCaller, _messageSender, _nonce, messageBody); + + return _nonce; + } + + /** + * Reserve and increment next available nonce + * @return nonce reserved + */ + function _reserveAndIncrementNonce() internal returns (uint64) { + uint64 _nonceReserved = nextAvailableNonce; + nextAvailableNonce = nextAvailableNonce + 1; + return _nonceReserved; + } + + /** + * @notice Send the message to the destination domain and recipient. If `_destinationCaller` is not equal to bytes32(0), + * the message can only be received on the destination chain when called by `_destinationCaller`. + * @dev Format the message and emit `MessageSent` event with message information. + * @param _destinationDomain Domain of destination chain + * @param _recipient Address of message recipient on destination domain as bytes32 + * @param _destinationCaller caller on the destination domain, as bytes32 + * @param _sender message sender, as bytes32 + * @param _nonce nonce reserved for message + * @param _messageBody Raw bytes content of message + */ + function _sendMessage( + uint32 _destinationDomain, + bytes32 _recipient, + bytes32 _destinationCaller, + bytes32 _sender, + uint64 _nonce, + bytes calldata _messageBody + ) internal { + require(_recipient != bytes32(0), "Recipient must be nonzero"); + // serialize message + bytes memory _message = abi.encodePacked( + i_version, i_localDomain, _destinationDomain, _nonce, _sender, _recipient, _destinationCaller, _messageBody + ); + + // Emit MessageSent event + emit MessageSent(_message); + } +} diff --git a/contracts/src/v0.8/ccip/test/mocks/MockRMN.sol b/contracts/src/v0.8/ccip/test/mocks/MockRMN.sol new file mode 100644 index 00000000000..343078cc37c --- /dev/null +++ b/contracts/src/v0.8/ccip/test/mocks/MockRMN.sol @@ -0,0 +1,53 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {IRMN} from "../../interfaces/IRMN.sol"; + +/// @notice WARNING: This contract is to be only used for testing, all methods are unprotected. +contract MockRMN is IRMN { + error CustomError(bytes err); + + bytes private s_isCursedRevert; + + bool private s_globalCursed; + mapping(bytes16 subject => bool cursed) private s_cursedBySubject; + mapping(address commitStore => mapping(bytes32 root => bool blessed)) private s_blessedByRoot; + + function setTaggedRootBlessed(IRMN.TaggedRoot calldata taggedRoot, bool blessed) external { + s_blessedByRoot[taggedRoot.commitStore][taggedRoot.root] = blessed; + } + + function setGlobalCursed(bool cursed) external { + s_globalCursed = cursed; + } + + function setChainCursed(uint64 chainSelector, bool cursed) external { + s_cursedBySubject[bytes16(uint128(chainSelector))] = cursed; + } + + /// @notice Setting a revert error with length of 0 will disable reverts + /// @dev Useful to test revert handling of ARMProxy + function setIsCursedRevert(bytes calldata revertErr) external { + s_isCursedRevert = revertErr; + } + + // IRMN implementation follows + + function isCursed() external view returns (bool) { + if (s_isCursedRevert.length > 0) { + revert CustomError(s_isCursedRevert); + } + return s_globalCursed; + } + + function isCursed(bytes16 subject) external view returns (bool) { + if (s_isCursedRevert.length > 0) { + revert CustomError(s_isCursedRevert); + } + return s_globalCursed || s_cursedBySubject[subject]; + } + + function isBlessed(IRMN.TaggedRoot calldata taggedRoot) external view returns (bool) { + return s_blessedByRoot[taggedRoot.commitStore][taggedRoot.root]; + } +} diff --git a/contracts/src/v0.8/ccip/test/mocks/MockRMN1_0.sol b/contracts/src/v0.8/ccip/test/mocks/MockRMN1_0.sol new file mode 100644 index 00000000000..d1a488d5577 --- /dev/null +++ b/contracts/src/v0.8/ccip/test/mocks/MockRMN1_0.sol @@ -0,0 +1,91 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {IRMN} from "../../interfaces/IRMN.sol"; +import {OwnerIsCreator} from "./../../../shared/access/OwnerIsCreator.sol"; + +// Inlined from RMN 1.0 contract. +// solhint-disable gas-struct-packing +contract OldRMN { + struct Voter { + address blessVoteAddr; + address curseVoteAddr; + address curseUnvoteAddr; + uint8 blessWeight; + uint8 curseWeight; + } + + struct Config { + Voter[] voters; + uint16 blessWeightThreshold; + uint16 curseWeightThreshold; + } + + struct VersionedConfig { + Config config; + uint32 configVersion; + uint32 blockNumber; + } + + struct UnvoteToCurseRecord { + address curseVoteAddr; + bytes32 cursesHash; + bool forceUnvote; + } +} + +/// @dev Retained almost as-is from commit 88f285b94c23d0c684d337064758a5edde380fe2 for compatibility with offchain +/// tests and scripts. Internal structs of the RMN 1.0 contract that were depended on have been inlined. +/// @dev This contract should no longer be used for any new tests or scripts. +/// @notice WARNING: This contract is to be only used for testing, all methods are unprotected. +// TODO: remove this contract when tests and scripts are updated +contract MockRMN is IRMN, OwnerIsCreator { + error CustomError(bytes err); + + bool private s_curse; + bytes private s_err; + OldRMN.VersionedConfig private s_versionedConfig; + mapping(bytes16 subject => bool cursed) private s_curseBySubject; + + function isCursed() external view override returns (bool) { + if (s_err.length != 0) { + revert CustomError(s_err); + } + return s_curse; + } + + function isCursed(bytes16 subject) external view override returns (bool) { + if (s_err.length != 0) { + revert CustomError(s_err); + } + return s_curse || s_curseBySubject[subject]; + } + + function voteToCurse(bytes32) external { + s_curse = true; + } + + function voteToCurse(bytes32, bytes16 subject) external { + s_curseBySubject[subject] = true; + } + + function ownerUnvoteToCurse(OldRMN.UnvoteToCurseRecord[] memory) external { + s_curse = false; + } + + function ownerUnvoteToCurse(OldRMN.UnvoteToCurseRecord[] memory, bytes16 subject) external { + s_curseBySubject[subject] = false; + } + + function setRevert(bytes memory err) external { + s_err = err; + } + + function isBlessed(IRMN.TaggedRoot calldata) external view override returns (bool) { + return !s_curse; + } + + function getConfigDetails() external view returns (uint32 version, uint32 blockNumber, OldRMN.Config memory config) { + return (s_versionedConfig.configVersion, s_versionedConfig.blockNumber, s_versionedConfig.config); + } +} diff --git a/contracts/src/v0.8/ccip/test/mocks/MockRouter.sol b/contracts/src/v0.8/ccip/test/mocks/MockRouter.sol new file mode 100644 index 00000000000..050cd6d4579 --- /dev/null +++ b/contracts/src/v0.8/ccip/test/mocks/MockRouter.sol @@ -0,0 +1,148 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {IAny2EVMMessageReceiver} from "../../interfaces/IAny2EVMMessageReceiver.sol"; +import {IRouter} from "../../interfaces/IRouter.sol"; +import {IRouterClient} from "../../interfaces/IRouterClient.sol"; + +import {CallWithExactGas} from "../../../shared/call/CallWithExactGas.sol"; +import {Client} from "../../libraries/Client.sol"; +import {Internal} from "../../libraries/Internal.sol"; + +import {IERC20} from "../../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/IERC20.sol"; +import {SafeERC20} from "../../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/utils/SafeERC20.sol"; +import {ERC165Checker} from + "../../../vendor/openzeppelin-solidity/v5.0.2/contracts/utils/introspection/ERC165Checker.sol"; + +contract MockCCIPRouter is IRouter, IRouterClient { + using SafeERC20 for IERC20; + using ERC165Checker for address; + + error InvalidAddress(bytes encodedAddress); + error InvalidExtraArgsTag(); + error ReceiverError(bytes err); + + event MessageExecuted(bytes32 messageId, uint64 sourceChainSelector, address offRamp, bytes32 calldataHash); + event MsgExecuted(bool success, bytes retData, uint256 gasUsed); + + uint16 public constant GAS_FOR_CALL_EXACT_CHECK = 5_000; + uint32 public constant DEFAULT_GAS_LIMIT = 200_000; + + uint256 internal s_mockFeeTokenAmount; //use setFee() to change to non-zero to test fees + + function routeMessage( + Client.Any2EVMMessage calldata message, + uint16 gasForCallExactCheck, + uint256 gasLimit, + address receiver + ) external returns (bool success, bytes memory retData, uint256 gasUsed) { + return _routeMessage(message, gasForCallExactCheck, gasLimit, receiver); + } + + function _routeMessage( + Client.Any2EVMMessage memory message, + uint16 gasForCallExactCheck, + uint256 gasLimit, + address receiver + ) internal returns (bool success, bytes memory retData, uint256 gasUsed) { + // Only send through the router if the receiver is a contract and implements the IAny2EVMMessageReceiver interface. + if (receiver.code.length == 0 || !receiver.supportsInterface(type(IAny2EVMMessageReceiver).interfaceId)) { + return (true, "", 0); + } + + bytes memory data = abi.encodeWithSelector(IAny2EVMMessageReceiver.ccipReceive.selector, message); + + (success, retData, gasUsed) = CallWithExactGas._callWithExactGasSafeReturnData( + data, receiver, gasLimit, gasForCallExactCheck, Internal.MAX_RET_BYTES + ); + + // Event to assist testing, does not exist on real deployments + emit MsgExecuted(success, retData, gasUsed); + + // Real router event + emit MessageExecuted(message.messageId, message.sourceChainSelector, msg.sender, keccak256(data)); + return (success, retData, gasUsed); + } + + /// @notice Sends the tx locally to the receiver instead of on the destination chain. + /// @dev Ignores destinationChainSelector + /// @dev Returns a mock message ID, which is not calculated from the message contents in the + /// same way as the real message ID. + function ccipSend( + uint64 destinationChainSelector, + Client.EVM2AnyMessage calldata message + ) external payable returns (bytes32) { + if (message.receiver.length != 32) revert InvalidAddress(message.receiver); + uint256 decodedReceiver = abi.decode(message.receiver, (uint256)); + // We want to disallow sending to address(0) and to precompiles, which exist on address(1) through address(9). + if (decodedReceiver > type(uint160).max || decodedReceiver < 10) revert InvalidAddress(message.receiver); + + uint256 feeTokenAmount = getFee(destinationChainSelector, message); + if (message.feeToken == address(0)) { + if (msg.value < feeTokenAmount) revert InsufficientFeeTokenAmount(); + } else { + if (msg.value > 0) revert InvalidMsgValue(); + IERC20(message.feeToken).safeTransferFrom(msg.sender, address(this), feeTokenAmount); + } + + address receiver = address(uint160(decodedReceiver)); + uint256 gasLimit = _fromBytes(message.extraArgs).gasLimit; + bytes32 mockMsgId = keccak256(abi.encode(message)); + + Client.Any2EVMMessage memory executableMsg = Client.Any2EVMMessage({ + messageId: mockMsgId, + sourceChainSelector: 16015286601757825753, // Sepolia + sender: abi.encode(msg.sender), + data: message.data, + destTokenAmounts: message.tokenAmounts + }); + + for (uint256 i = 0; i < message.tokenAmounts.length; ++i) { + IERC20(message.tokenAmounts[i].token).safeTransferFrom(msg.sender, receiver, message.tokenAmounts[i].amount); + } + + (bool success, bytes memory retData,) = _routeMessage(executableMsg, GAS_FOR_CALL_EXACT_CHECK, gasLimit, receiver); + + if (!success) revert ReceiverError(retData); + + return mockMsgId; + } + + function _fromBytes(bytes calldata extraArgs) internal pure returns (Client.EVMExtraArgsV1 memory) { + if (extraArgs.length == 0) { + return Client.EVMExtraArgsV1({gasLimit: DEFAULT_GAS_LIMIT}); + } + if (bytes4(extraArgs) != Client.EVM_EXTRA_ARGS_V1_TAG) revert InvalidExtraArgsTag(); + return abi.decode(extraArgs[4:], (Client.EVMExtraArgsV1)); + } + + /// @notice Always returns true to make sure this check can be performed on any chain. + function isChainSupported(uint64) external pure returns (bool supported) { + return true; + } + + /// @notice Returns an empty array. + function getSupportedTokens(uint64) external pure returns (address[] memory tokens) { + return new address[](0); + } + + /// @notice Returns 0 as the fee is not supported in this mock contract. + function getFee(uint64, Client.EVM2AnyMessage memory) public view returns (uint256) { + return s_mockFeeTokenAmount; + } + + /// @notice Sets the fees returned by getFee but is only checked when using native fee tokens + function setFee(uint256 feeAmount) external { + s_mockFeeTokenAmount = feeAmount; + } + + /// @notice Always returns address(1234567890) + function getOnRamp(uint64 /* destChainSelector */ ) external pure returns (address onRampAddress) { + return address(1234567890); + } + + /// @notice Always returns true + function isOffRamp(uint64, /* sourceChainSelector */ address /* offRamp */ ) external pure returns (bool) { + return true; + } +} diff --git a/contracts/src/v0.8/ccip/test/mocks/MockUSDCTokenMessenger.sol b/contracts/src/v0.8/ccip/test/mocks/MockUSDCTokenMessenger.sol new file mode 100644 index 00000000000..562a9f467ff --- /dev/null +++ b/contracts/src/v0.8/ccip/test/mocks/MockUSDCTokenMessenger.sol @@ -0,0 +1,52 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {IBurnMintERC20} from "../../../shared/token/ERC20/IBurnMintERC20.sol"; +import {ITokenMessenger} from "../../pools/USDC/ITokenMessenger.sol"; + +// This contract mocks both the ITokenMessenger and IMessageTransmitter +// contracts involved with the Cross Chain Token Protocol. +contract MockUSDCTokenMessenger is ITokenMessenger { + uint32 private immutable i_messageBodyVersion; + address private immutable i_transmitter; + + bytes32 public constant DESTINATION_TOKEN_MESSENGER = keccak256("i_destinationTokenMessenger"); + + uint64 public s_nonce; + + constructor(uint32 version, address transmitter) { + i_messageBodyVersion = version; + s_nonce = 1; + i_transmitter = transmitter; + } + + function depositForBurnWithCaller( + uint256 amount, + uint32 destinationDomain, + bytes32 mintRecipient, + address burnToken, + bytes32 destinationCaller + ) external returns (uint64) { + IBurnMintERC20(burnToken).transferFrom(msg.sender, address(this), amount); + IBurnMintERC20(burnToken).burn(amount); + emit DepositForBurn( + s_nonce, + burnToken, + amount, + msg.sender, + mintRecipient, + destinationDomain, + DESTINATION_TOKEN_MESSENGER, + destinationCaller + ); + return s_nonce++; + } + + function messageBodyVersion() external view returns (uint32) { + return i_messageBodyVersion; + } + + function localMessageTransmitter() external view returns (address) { + return i_transmitter; + } +} diff --git a/contracts/src/v0.8/ccip/test/mocks/interfaces/IMessageTransmitterWithRelay.sol b/contracts/src/v0.8/ccip/test/mocks/interfaces/IMessageTransmitterWithRelay.sol new file mode 100644 index 00000000000..dc9c644e07a --- /dev/null +++ b/contracts/src/v0.8/ccip/test/mocks/interfaces/IMessageTransmitterWithRelay.sol @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2022, Circle Internet Financial Limited. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +pragma solidity ^0.8.0; + +import {IMessageTransmitter} from "../../../pools/USDC/IMessageTransmitter.sol"; + +// This follows https://github.com/circlefin/evm-cctp-contracts/blob/master/src/interfaces/IMessageTransmitter.sol +interface IMessageTransmitterWithRelay is IMessageTransmitter { + /** + * @notice Sends an outgoing message from the source domain. + * @dev Increment nonce, format the message, and emit `MessageSent` event with message information. + * @param destinationDomain Domain of destination chain + * @param recipient Address of message recipient on destination domain as bytes32 + * @param messageBody Raw bytes content of message + * @return nonce reserved by message + */ + function sendMessage( + uint32 destinationDomain, + bytes32 recipient, + bytes calldata messageBody + ) external returns (uint64); + + /** + * @notice Sends an outgoing message from the source domain, with a specified caller on the + * destination domain. + * @dev Increment nonce, format the message, and emit `MessageSent` event with message information. + * WARNING: if the `destinationCaller` does not represent a valid address as bytes32, then it will not be possible + * to broadcast the message on the destination domain. This is an advanced feature, and the standard + * sendMessage() should be preferred for use cases where a specific destination caller is not required. + * @param destinationDomain Domain of destination chain + * @param recipient Address of message recipient on destination domain as bytes32 + * @param destinationCaller caller on the destination domain, as bytes32 + * @param messageBody Raw bytes content of message + * @return nonce reserved by message + */ + function sendMessageWithCaller( + uint32 destinationDomain, + bytes32 recipient, + bytes32 destinationCaller, + bytes calldata messageBody + ) external returns (uint64); +} diff --git a/contracts/src/v0.8/ccip/test/mocks/test/MockRouterTest.t.sol b/contracts/src/v0.8/ccip/test/mocks/test/MockRouterTest.t.sol new file mode 100644 index 00000000000..6cbe7bf58f4 --- /dev/null +++ b/contracts/src/v0.8/ccip/test/mocks/test/MockRouterTest.t.sol @@ -0,0 +1,68 @@ +pragma solidity ^0.8.0; + +import {Client} from "../../../libraries/Client.sol"; + +import {TokenSetup} from "../../TokenSetup.t.sol"; +import {IRouterClient, MockCCIPRouter} from "../MockRouter.sol"; + +import {IERC20} from "../../../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/IERC20.sol"; +import {SafeERC20} from "../../../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/utils/SafeERC20.sol"; + +contract MockRouterTest is TokenSetup { + using SafeERC20 for IERC20; + + MockCCIPRouter public mockRouter; + + uint64 public constant mockChainSelector = 123456; + + Client.EVM2AnyMessage public message; + + function setUp() public override { + mockRouter = new MockCCIPRouter(); + + //Configure the Fee to 0.1 ether for native token fees + mockRouter.setFee(0.1 ether); + + deal(address(this), 100 ether); + + message.receiver = abi.encode(address(0x12345)); + message.data = abi.encode("Hello World"); + + s_sourceFeeToken = _deploySourceToken("sLINK", type(uint256).max, 18); + } + + function test_ccipSendWithInsufficientNativeTokens_Revert() public { + //Should revert because did not include sufficient eth to pay for fees + vm.expectRevert(IRouterClient.InsufficientFeeTokenAmount.selector); + mockRouter.ccipSend(mockChainSelector, message); + } + + function test_ccipSendWithSufficientNativeFeeTokens_Success() public { + //ccipSend with sufficient native tokens for fees + mockRouter.ccipSend{value: 0.1 ether}(mockChainSelector, message); + } + + function test_ccipSendWithInvalidMsgValue_Revert() public { + message.feeToken = address(1); //Set to non native-token fees + + vm.expectRevert(IRouterClient.InvalidMsgValue.selector); + mockRouter.ccipSend{value: 0.1 ether}(mockChainSelector, message); + } + + function test_ccipSendWithLinkFeeTokenbutInsufficientAllowance_Revert() public { + message.feeToken = s_sourceFeeToken; + + vm.expectRevert(bytes("ERC20: insufficient allowance")); + mockRouter.ccipSend(mockChainSelector, message); + } + + function test_ccipSendWithLinkFeeTokenAndValidMsgValue_Success() public { + message.feeToken = s_sourceFeeToken; + + vm.startPrank(OWNER, OWNER); + + IERC20(s_sourceFeeToken).safeApprove(address(mockRouter), type(uint256).max); + + mockRouter.ccipSend(mockChainSelector, message); + } +} diff --git a/contracts/src/v0.8/ccip/test/ocr/MultiOCR3Base.t.sol b/contracts/src/v0.8/ccip/test/ocr/MultiOCR3Base.t.sol new file mode 100644 index 00000000000..8867d1b1278 --- /dev/null +++ b/contracts/src/v0.8/ccip/test/ocr/MultiOCR3Base.t.sol @@ -0,0 +1,921 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {MultiOCR3Base} from "../../ocr/MultiOCR3Base.sol"; +import {MultiOCR3Helper} from "../helpers/MultiOCR3Helper.sol"; +import {MultiOCR3BaseSetup} from "./MultiOCR3BaseSetup.t.sol"; + +import {Vm} from "forge-std/Vm.sol"; + +contract MultiOCR3Base_transmit is MultiOCR3BaseSetup { + bytes32 internal s_configDigest1; + bytes32 internal s_configDigest2; + bytes32 internal s_configDigest3; + + function setUp() public virtual override { + super.setUp(); + + s_configDigest1 = _getBasicConfigDigest(1, s_validSigners, s_validTransmitters); + s_configDigest2 = _getBasicConfigDigest(1, s_validSigners, s_validTransmitters); + s_configDigest3 = _getBasicConfigDigest(2, s_emptySigners, s_validTransmitters); + + MultiOCR3Base.OCRConfigArgs[] memory ocrConfigs = new MultiOCR3Base.OCRConfigArgs[](3); + ocrConfigs[0] = MultiOCR3Base.OCRConfigArgs({ + ocrPluginType: 0, + configDigest: s_configDigest1, + F: 1, + isSignatureVerificationEnabled: true, + signers: s_validSigners, + transmitters: s_validTransmitters + }); + ocrConfigs[1] = MultiOCR3Base.OCRConfigArgs({ + ocrPluginType: 1, + configDigest: s_configDigest2, + F: 2, + isSignatureVerificationEnabled: true, + signers: s_validSigners, + transmitters: s_validTransmitters + }); + ocrConfigs[2] = MultiOCR3Base.OCRConfigArgs({ + ocrPluginType: 2, + configDigest: s_configDigest3, + F: 1, + isSignatureVerificationEnabled: false, + signers: s_emptySigners, + transmitters: s_validTransmitters + }); + + s_multiOCR3.setOCR3Configs(ocrConfigs); + } + + function test_TransmitSigners_gas_Success() public { + vm.pauseGasMetering(); + bytes32[3] memory reportContext = [s_configDigest1, s_configDigest1, s_configDigest1]; + + // F = 2, need 2 signatures + (bytes32[] memory rs, bytes32[] memory ss,, bytes32 rawVs) = + _getSignaturesForDigest(s_validSignerKeys, REPORT, reportContext, 2); + + s_multiOCR3.setTransmitOcrPluginType(0); + + vm.expectEmit(); + emit MultiOCR3Base.Transmitted(0, s_configDigest1, uint64(uint256(s_configDigest1))); + + vm.startPrank(s_validTransmitters[1]); + vm.resumeGasMetering(); + s_multiOCR3.transmitWithSignatures(reportContext, REPORT, rs, ss, rawVs); + } + + function test_TransmitWithoutSignatureVerification_gas_Success() public { + vm.pauseGasMetering(); + bytes32[3] memory reportContext = [s_configDigest3, s_configDigest3, s_configDigest3]; + + s_multiOCR3.setTransmitOcrPluginType(2); + + vm.expectEmit(); + emit MultiOCR3Base.Transmitted(2, s_configDigest3, uint64(uint256(s_configDigest3))); + + vm.startPrank(s_validTransmitters[0]); + vm.resumeGasMetering(); + s_multiOCR3.transmitWithoutSignatures(reportContext, REPORT); + } + + function test_Fuzz_TransmitSignersWithSignatures_Success(uint8 F, uint64 randomAddressOffset) public { + vm.pauseGasMetering(); + + F = uint8(bound(F, 1, 3)); + + // condition: signers.length > 3F + uint8 signersLength = 3 * F + 1; + address[] memory signers = new address[](signersLength); + address[] memory transmitters = new address[](signersLength); + uint256[] memory signerKeys = new uint256[](signersLength); + + // Force addresses to be unique (with a random offset for broader testing) + for (uint160 i = 0; i < signersLength; ++i) { + transmitters[i] = vm.addr(PRIVATE0 + randomAddressOffset + i); + // condition: non-zero oracle address + vm.assume(transmitters[i] != address(0)); + + // condition: non-repeating addresses (no clashes with transmitters) + signerKeys[i] = PRIVATE0 + randomAddressOffset + i + signersLength; + signers[i] = vm.addr(signerKeys[i]); + vm.assume(signers[i] != address(0)); + } + + MultiOCR3Base.OCRConfigArgs[] memory ocrConfigs = new MultiOCR3Base.OCRConfigArgs[](1); + ocrConfigs[0] = MultiOCR3Base.OCRConfigArgs({ + ocrPluginType: 3, + configDigest: s_configDigest1, + F: F, + isSignatureVerificationEnabled: true, + signers: signers, + transmitters: transmitters + }); + s_multiOCR3.setOCR3Configs(ocrConfigs); + s_multiOCR3.setTransmitOcrPluginType(3); + + // Randomise picked transmitter with random offset + vm.startPrank(transmitters[randomAddressOffset % signersLength]); + + bytes32[3] memory reportContext = [s_configDigest1, s_configDigest1, s_configDigest1]; + + // condition: matches signature expectation for transmit + uint8 numSignatures = F + 1; + uint256[] memory pickedSignerKeys = new uint256[](numSignatures); + + // Randomise picked signers with random offset + for (uint256 i; i < numSignatures; ++i) { + pickedSignerKeys[i] = signerKeys[(i + randomAddressOffset) % numSignatures]; + } + + (bytes32[] memory rs, bytes32[] memory ss,, bytes32 rawVs) = + _getSignaturesForDigest(pickedSignerKeys, REPORT, reportContext, numSignatures); + + vm.expectEmit(); + emit MultiOCR3Base.Transmitted(3, s_configDigest1, uint64(uint256(s_configDigest1))); + + vm.resumeGasMetering(); + s_multiOCR3.transmitWithSignatures(reportContext, REPORT, rs, ss, rawVs); + } + + // Reverts + function test_ForkedChain_Revert() public { + bytes32[3] memory reportContext = [s_configDigest1, s_configDigest1, s_configDigest1]; + + (bytes32[] memory rs, bytes32[] memory ss,, bytes32 rawVs) = + _getSignaturesForDigest(s_validSignerKeys, REPORT, reportContext, 2); + + s_multiOCR3.setTransmitOcrPluginType(0); + + uint256 chain1 = block.chainid; + uint256 chain2 = chain1 + 1; + vm.chainId(chain2); + vm.expectRevert(abi.encodeWithSelector(MultiOCR3Base.ForkedChain.selector, chain1, chain2)); + + vm.startPrank(s_validTransmitters[0]); + s_multiOCR3.transmitWithSignatures(reportContext, REPORT, rs, ss, rawVs); + } + + function test_ZeroSignatures_Revert() public { + bytes32[3] memory reportContext = [s_configDigest1, s_configDigest1, s_configDigest1]; + + s_multiOCR3.setTransmitOcrPluginType(0); + + vm.startPrank(s_validTransmitters[0]); + vm.expectRevert(MultiOCR3Base.WrongNumberOfSignatures.selector); + s_multiOCR3.transmitWithSignatures(reportContext, REPORT, new bytes32[](0), new bytes32[](0), bytes32("")); + } + + function test_TooManySignatures_Revert() public { + bytes32[3] memory reportContext = [s_configDigest1, s_configDigest1, s_configDigest1]; + + // 1 signature too many + (bytes32[] memory rs, bytes32[] memory ss,, bytes32 rawVs) = + _getSignaturesForDigest(s_validSignerKeys, REPORT, reportContext, 6); + + s_multiOCR3.setTransmitOcrPluginType(1); + + vm.startPrank(s_validTransmitters[0]); + vm.expectRevert(MultiOCR3Base.WrongNumberOfSignatures.selector); + s_multiOCR3.transmitWithSignatures(reportContext, REPORT, rs, ss, rawVs); + } + + function test_InsufficientSignatures_Revert() public { + bytes32[3] memory reportContext = [s_configDigest1, s_configDigest1, s_configDigest1]; + + // Missing 1 signature for unique report + (bytes32[] memory rs, bytes32[] memory ss,, bytes32 rawVs) = + _getSignaturesForDigest(s_validSignerKeys, REPORT, reportContext, 4); + + s_multiOCR3.setTransmitOcrPluginType(1); + + vm.startPrank(s_validTransmitters[0]); + vm.expectRevert(MultiOCR3Base.WrongNumberOfSignatures.selector); + s_multiOCR3.transmitWithSignatures(reportContext, REPORT, rs, ss, rawVs); + } + + function test_ConfigDigestMismatch_Revert() public { + bytes32 configDigest; + bytes32[3] memory reportContext = [configDigest, configDigest, configDigest]; + + (,,, bytes32 rawVs) = _getSignaturesForDigest(s_validSignerKeys, REPORT, reportContext, 2); + + s_multiOCR3.setTransmitOcrPluginType(0); + + vm.expectRevert(abi.encodeWithSelector(MultiOCR3Base.ConfigDigestMismatch.selector, s_configDigest1, configDigest)); + s_multiOCR3.transmitWithSignatures(reportContext, REPORT, new bytes32[](0), new bytes32[](0), rawVs); + } + + function test_SignatureOutOfRegistration_Revert() public { + bytes32[3] memory reportContext = [s_configDigest1, s_configDigest1, s_configDigest1]; + + bytes32[] memory rs = new bytes32[](2); + bytes32[] memory ss = new bytes32[](1); + + s_multiOCR3.setTransmitOcrPluginType(0); + + vm.startPrank(s_validTransmitters[0]); + vm.expectRevert(MultiOCR3Base.SignaturesOutOfRegistration.selector); + s_multiOCR3.transmitWithSignatures(reportContext, REPORT, rs, ss, bytes32("")); + } + + function test_UnAuthorizedTransmitter_Revert() public { + bytes32[3] memory reportContext = [s_configDigest1, s_configDigest1, s_configDigest1]; + bytes32[] memory rs = new bytes32[](2); + bytes32[] memory ss = new bytes32[](2); + + s_multiOCR3.setTransmitOcrPluginType(0); + + vm.expectRevert(MultiOCR3Base.UnauthorizedTransmitter.selector); + s_multiOCR3.transmitWithSignatures(reportContext, REPORT, rs, ss, bytes32("")); + } + + function test_NonUniqueSignature_Revert() public { + bytes32[3] memory reportContext = [s_configDigest1, s_configDigest1, s_configDigest1]; + + (bytes32[] memory rs, bytes32[] memory ss, uint8[] memory vs, bytes32 rawVs) = + _getSignaturesForDigest(s_validSignerKeys, REPORT, reportContext, 2); + + rs[1] = rs[0]; + ss[1] = ss[0]; + // Need to reset the rawVs to be valid + rawVs = bytes32(bytes1(vs[0] - 27)) | (bytes32(bytes1(vs[0] - 27)) >> 8); + + s_multiOCR3.setTransmitOcrPluginType(0); + + vm.startPrank(s_validTransmitters[0]); + vm.expectRevert(MultiOCR3Base.NonUniqueSignatures.selector); + s_multiOCR3.transmitWithSignatures(reportContext, REPORT, rs, ss, rawVs); + } + + function test_UnauthorizedSigner_Revert() public { + bytes32[3] memory reportContext = [s_configDigest1, s_configDigest1, s_configDigest1]; + + (bytes32[] memory rs, bytes32[] memory ss,, bytes32 rawVs) = + _getSignaturesForDigest(s_validSignerKeys, REPORT, reportContext, 2); + + rs[0] = s_configDigest1; + ss = rs; + + s_multiOCR3.setTransmitOcrPluginType(0); + + vm.startPrank(s_validTransmitters[0]); + vm.expectRevert(MultiOCR3Base.UnauthorizedSigner.selector); + s_multiOCR3.transmitWithSignatures(reportContext, REPORT, rs, ss, rawVs); + } + + function test_UnconfiguredPlugin_Revert() public { + bytes32 configDigest; + bytes32[3] memory reportContext = [configDigest, configDigest, configDigest]; + + s_multiOCR3.setTransmitOcrPluginType(42); + + vm.expectRevert(MultiOCR3Base.UnauthorizedTransmitter.selector); + s_multiOCR3.transmitWithoutSignatures(reportContext, REPORT); + } + + function test_TransmitWithLessCalldataArgs_Revert() public { + bytes32[3] memory reportContext = [s_configDigest1, s_configDigest1, s_configDigest1]; + + s_multiOCR3.setTransmitOcrPluginType(0); + + // The transmit should fail, since we are trying to transmit without signatures when signatures are enabled + vm.startPrank(s_validTransmitters[1]); + + // report length + function selector + report length + abiencoded location of report value + report context words + uint256 receivedLength = REPORT.length + 4 + 5 * 32; + vm.expectRevert( + abi.encodeWithSelector( + MultiOCR3Base.WrongMessageLength.selector, + // Expecting inclusion of signature constant length components + receivedLength + 5 * 32, + receivedLength + ) + ); + s_multiOCR3.transmitWithoutSignatures(reportContext, REPORT); + } + + function test_TransmitWithExtraCalldataArgs_Revert() public { + bytes32[3] memory reportContext = [s_configDigest1, s_configDigest1, s_configDigest1]; + bytes32[] memory rs = new bytes32[](2); + bytes32[] memory ss = new bytes32[](2); + + s_multiOCR3.setTransmitOcrPluginType(2); + + // The transmit should fail, since we are trying to transmit with signatures when signatures are disabled + vm.startPrank(s_validTransmitters[1]); + + // dynamic length + function selector + report length + abiencoded location of report value + report context words + // rawVs value, lengths of rs, ss, and start locations of rs & ss -> 5 words + uint256 receivedLength = REPORT.length + 4 + (5 * 32) + (5 * 32) + (2 * 32) + (2 * 32); + vm.expectRevert( + abi.encodeWithSelector( + MultiOCR3Base.WrongMessageLength.selector, + // Expecting exclusion of signature constant length components and rs, ss words + receivedLength - (5 * 32) - (4 * 32), + receivedLength + ) + ); + s_multiOCR3.transmitWithSignatures(reportContext, REPORT, rs, ss, bytes32("")); + } +} + +contract MultiOCR3Base_setOCR3Configs is MultiOCR3BaseSetup { + function test_SetConfigsZeroInput_Success() public { + vm.recordLogs(); + s_multiOCR3.setOCR3Configs(new MultiOCR3Base.OCRConfigArgs[](0)); + + // No logs emitted + Vm.Log[] memory logEntries = vm.getRecordedLogs(); + assertEq(logEntries.length, 0); + } + + function test_SetConfigWithSigners_Success() public { + uint8 F = 2; + + _assertOCRConfigUnconfigured(s_multiOCR3.latestConfigDetails(0)); + + MultiOCR3Base.OCRConfigArgs[] memory ocrConfigs = new MultiOCR3Base.OCRConfigArgs[](1); + ocrConfigs[0] = MultiOCR3Base.OCRConfigArgs({ + ocrPluginType: 0, + configDigest: _getBasicConfigDigest(F, s_validSigners, s_validTransmitters), + F: F, + isSignatureVerificationEnabled: true, + signers: s_validSigners, + transmitters: s_validTransmitters + }); + + vm.expectEmit(); + emit MultiOCR3Base.ConfigSet( + ocrConfigs[0].ocrPluginType, + ocrConfigs[0].configDigest, + ocrConfigs[0].signers, + ocrConfigs[0].transmitters, + ocrConfigs[0].F + ); + + vm.expectEmit(); + emit MultiOCR3Helper.AfterConfigSet(ocrConfigs[0].ocrPluginType); + + s_multiOCR3.setOCR3Configs(ocrConfigs); + + MultiOCR3Base.OCRConfig memory expectedConfig = MultiOCR3Base.OCRConfig({ + configInfo: MultiOCR3Base.ConfigInfo({ + configDigest: ocrConfigs[0].configDigest, + F: ocrConfigs[0].F, + n: uint8(ocrConfigs[0].signers.length), + isSignatureVerificationEnabled: ocrConfigs[0].isSignatureVerificationEnabled + }), + signers: s_validSigners, + transmitters: s_validTransmitters + }); + _assertOCRConfigEquality(s_multiOCR3.latestConfigDetails(0), expectedConfig); + } + + function test_SetConfigWithoutSigners_Success() public { + uint8 F = 1; + address[] memory signers = new address[](0); + + _assertOCRConfigUnconfigured(s_multiOCR3.latestConfigDetails(0)); + + MultiOCR3Base.OCRConfigArgs[] memory ocrConfigs = new MultiOCR3Base.OCRConfigArgs[](1); + ocrConfigs[0] = MultiOCR3Base.OCRConfigArgs({ + ocrPluginType: 0, + configDigest: _getBasicConfigDigest(F, signers, s_validTransmitters), + F: F, + isSignatureVerificationEnabled: false, + signers: signers, + transmitters: s_validTransmitters + }); + + vm.expectEmit(); + emit MultiOCR3Base.ConfigSet( + ocrConfigs[0].ocrPluginType, + ocrConfigs[0].configDigest, + ocrConfigs[0].signers, + ocrConfigs[0].transmitters, + ocrConfigs[0].F + ); + + vm.expectEmit(); + emit MultiOCR3Helper.AfterConfigSet(ocrConfigs[0].ocrPluginType); + + s_multiOCR3.setOCR3Configs(ocrConfigs); + + MultiOCR3Base.OCRConfig memory expectedConfig = MultiOCR3Base.OCRConfig({ + configInfo: MultiOCR3Base.ConfigInfo({ + configDigest: ocrConfigs[0].configDigest, + F: ocrConfigs[0].F, + n: uint8(ocrConfigs[0].signers.length), + isSignatureVerificationEnabled: ocrConfigs[0].isSignatureVerificationEnabled + }), + signers: signers, + transmitters: s_validTransmitters + }); + _assertOCRConfigEquality(s_multiOCR3.latestConfigDetails(0), expectedConfig); + } + + function test_SetConfigIgnoreSigners_Success() public { + uint8 F = 1; + + _assertOCRConfigUnconfigured(s_multiOCR3.latestConfigDetails(0)); + + MultiOCR3Base.OCRConfigArgs[] memory ocrConfigs = new MultiOCR3Base.OCRConfigArgs[](1); + ocrConfigs[0] = MultiOCR3Base.OCRConfigArgs({ + ocrPluginType: 0, + configDigest: _getBasicConfigDigest(F, new address[](0), s_validTransmitters), + F: F, + isSignatureVerificationEnabled: false, + signers: s_validSigners, + transmitters: s_validTransmitters + }); + + vm.expectEmit(); + emit MultiOCR3Base.ConfigSet( + ocrConfigs[0].ocrPluginType, + ocrConfigs[0].configDigest, + s_emptySigners, + ocrConfigs[0].transmitters, + ocrConfigs[0].F + ); + + vm.expectEmit(); + emit MultiOCR3Helper.AfterConfigSet(ocrConfigs[0].ocrPluginType); + + s_multiOCR3.setOCR3Configs(ocrConfigs); + + MultiOCR3Base.OCRConfig memory expectedConfig = MultiOCR3Base.OCRConfig({ + configInfo: MultiOCR3Base.ConfigInfo({ + configDigest: ocrConfigs[0].configDigest, + F: ocrConfigs[0].F, + n: 0, + isSignatureVerificationEnabled: ocrConfigs[0].isSignatureVerificationEnabled + }), + signers: s_emptySigners, + transmitters: s_validTransmitters + }); + _assertOCRConfigEquality(s_multiOCR3.latestConfigDetails(0), expectedConfig); + + // Verify no signer role is set + for (uint256 i = 0; i < s_validSigners.length; ++i) { + MultiOCR3Base.Oracle memory signerOracle = s_multiOCR3.getOracle(0, s_validSigners[i]); + assertEq(uint8(signerOracle.role), uint8(MultiOCR3Base.Role.Unset)); + } + } + + function test_SetMultipleConfigs_Success() public { + _assertOCRConfigUnconfigured(s_multiOCR3.latestConfigDetails(0)); + _assertOCRConfigUnconfigured(s_multiOCR3.latestConfigDetails(1)); + _assertOCRConfigUnconfigured(s_multiOCR3.latestConfigDetails(2)); + + MultiOCR3Base.OCRConfigArgs[] memory ocrConfigs = new MultiOCR3Base.OCRConfigArgs[](3); + ocrConfigs[0] = MultiOCR3Base.OCRConfigArgs({ + ocrPluginType: 0, + configDigest: _getBasicConfigDigest(2, s_validSigners, s_validTransmitters), + F: 2, + isSignatureVerificationEnabled: true, + signers: s_validSigners, + transmitters: s_validTransmitters + }); + ocrConfigs[1] = MultiOCR3Base.OCRConfigArgs({ + ocrPluginType: 1, + configDigest: _getBasicConfigDigest(1, s_validSigners, s_validTransmitters), + F: 1, + isSignatureVerificationEnabled: true, + signers: s_validSigners, + transmitters: s_validTransmitters + }); + ocrConfigs[2] = MultiOCR3Base.OCRConfigArgs({ + ocrPluginType: 2, + configDigest: _getBasicConfigDigest(1, s_partialSigners, s_partialTransmitters), + F: 1, + isSignatureVerificationEnabled: true, + signers: s_partialSigners, + transmitters: s_partialTransmitters + }); + + for (uint256 i; i < ocrConfigs.length; ++i) { + vm.expectEmit(); + emit MultiOCR3Base.ConfigSet( + ocrConfigs[i].ocrPluginType, + ocrConfigs[i].configDigest, + ocrConfigs[i].signers, + ocrConfigs[i].transmitters, + ocrConfigs[i].F + ); + + vm.expectEmit(); + emit MultiOCR3Helper.AfterConfigSet(ocrConfigs[i].ocrPluginType); + } + s_multiOCR3.setOCR3Configs(ocrConfigs); + + for (uint256 i; i < ocrConfigs.length; ++i) { + MultiOCR3Base.OCRConfig memory expectedConfig = MultiOCR3Base.OCRConfig({ + configInfo: MultiOCR3Base.ConfigInfo({ + configDigest: ocrConfigs[i].configDigest, + F: ocrConfigs[i].F, + n: uint8(ocrConfigs[i].signers.length), + isSignatureVerificationEnabled: ocrConfigs[i].isSignatureVerificationEnabled + }), + signers: ocrConfigs[i].signers, + transmitters: ocrConfigs[i].transmitters + }); + _assertOCRConfigEquality(s_multiOCR3.latestConfigDetails(ocrConfigs[i].ocrPluginType), expectedConfig); + } + + // pluginType 3 remains unconfigured + _assertOCRConfigUnconfigured(s_multiOCR3.latestConfigDetails(3)); + } + + function test_Fuzz_SetConfig_Success(MultiOCR3Base.OCRConfigArgs memory ocrConfig, uint64 randomAddressOffset) public { + // condition: cannot assume max oracle count + vm.assume(ocrConfig.transmitters.length <= 31); + vm.assume(ocrConfig.signers.length <= 31); + + // condition: F > 0 + ocrConfig.F = uint8(bound(ocrConfig.F, 1, 3)); + + uint256 transmittersLength = ocrConfig.transmitters.length; + + // Force addresses to be unique (with a random offset for broader testing) + for (uint160 i = 0; i < transmittersLength; ++i) { + ocrConfig.transmitters[i] = vm.addr(PRIVATE0 + randomAddressOffset + i); + // condition: non-zero oracle address + vm.assume(ocrConfig.transmitters[i] != address(0)); + } + + if (ocrConfig.signers.length == 0) { + ocrConfig.isSignatureVerificationEnabled = false; + } else { + ocrConfig.isSignatureVerificationEnabled = true; + + // condition: number of signers > 3F + vm.assume(ocrConfig.signers.length > 3 * ocrConfig.F); + + uint256 signersLength = ocrConfig.signers.length; + + // Force addresses to be unique - continuing generation with an offset after the transmitter addresses + for (uint160 i = 0; i < signersLength; ++i) { + ocrConfig.signers[i] = vm.addr(PRIVATE0 + randomAddressOffset + i + transmittersLength); + // condition: non-zero oracle address + vm.assume(ocrConfig.signers[i] != address(0)); + } + } + + _assertOCRConfigUnconfigured(s_multiOCR3.latestConfigDetails(ocrConfig.ocrPluginType)); + + MultiOCR3Base.OCRConfigArgs[] memory ocrConfigs = new MultiOCR3Base.OCRConfigArgs[](1); + ocrConfigs[0] = ocrConfig; + + vm.expectEmit(); + emit MultiOCR3Base.ConfigSet( + ocrConfig.ocrPluginType, ocrConfig.configDigest, ocrConfig.signers, ocrConfig.transmitters, ocrConfig.F + ); + vm.expectEmit(); + emit MultiOCR3Helper.AfterConfigSet(ocrConfig.ocrPluginType); + s_multiOCR3.setOCR3Configs(ocrConfigs); + + MultiOCR3Base.OCRConfig memory expectedConfig = MultiOCR3Base.OCRConfig({ + configInfo: MultiOCR3Base.ConfigInfo({ + configDigest: ocrConfig.configDigest, + F: ocrConfig.F, + n: ocrConfig.isSignatureVerificationEnabled ? uint8(ocrConfig.signers.length) : 0, + isSignatureVerificationEnabled: ocrConfig.isSignatureVerificationEnabled + }), + signers: ocrConfig.signers, + transmitters: ocrConfig.transmitters + }); + _assertOCRConfigEquality(s_multiOCR3.latestConfigDetails(ocrConfig.ocrPluginType), expectedConfig); + } + + function test_UpdateConfigTransmittersWithoutSigners_Success() public { + _assertOCRConfigUnconfigured(s_multiOCR3.latestConfigDetails(0)); + + MultiOCR3Base.OCRConfigArgs[] memory ocrConfigs = new MultiOCR3Base.OCRConfigArgs[](1); + ocrConfigs[0] = MultiOCR3Base.OCRConfigArgs({ + ocrPluginType: 0, + configDigest: _getBasicConfigDigest(1, s_emptySigners, s_validTransmitters), + F: 1, + isSignatureVerificationEnabled: false, + signers: s_emptySigners, + transmitters: s_validTransmitters + }); + s_multiOCR3.setOCR3Configs(ocrConfigs); + + address[] memory newTransmitters = s_partialSigners; + + ocrConfigs[0].F = 2; + ocrConfigs[0].configDigest = _getBasicConfigDigest(2, s_emptySigners, newTransmitters); + ocrConfigs[0].transmitters = newTransmitters; + + vm.expectEmit(); + emit MultiOCR3Base.ConfigSet( + ocrConfigs[0].ocrPluginType, + ocrConfigs[0].configDigest, + ocrConfigs[0].signers, + ocrConfigs[0].transmitters, + ocrConfigs[0].F + ); + vm.expectEmit(); + emit MultiOCR3Helper.AfterConfigSet(ocrConfigs[0].ocrPluginType); + + s_multiOCR3.setOCR3Configs(ocrConfigs); + + MultiOCR3Base.OCRConfig memory expectedConfig = MultiOCR3Base.OCRConfig({ + configInfo: MultiOCR3Base.ConfigInfo({ + configDigest: ocrConfigs[0].configDigest, + F: ocrConfigs[0].F, + n: uint8(ocrConfigs[0].signers.length), + isSignatureVerificationEnabled: ocrConfigs[0].isSignatureVerificationEnabled + }), + signers: s_emptySigners, + transmitters: newTransmitters + }); + _assertOCRConfigEquality(s_multiOCR3.latestConfigDetails(0), expectedConfig); + + // Verify oracle roles get correctly re-assigned + for (uint256 i; i < newTransmitters.length; ++i) { + MultiOCR3Base.Oracle memory transmitterOracle = s_multiOCR3.getOracle(0, newTransmitters[i]); + assertEq(transmitterOracle.index, i); + assertEq(uint8(transmitterOracle.role), uint8(MultiOCR3Base.Role.Transmitter)); + } + + // Verify old transmitters get correctly unset + for (uint256 i = newTransmitters.length; i < s_validTransmitters.length; ++i) { + MultiOCR3Base.Oracle memory transmitterOracle = s_multiOCR3.getOracle(0, s_validTransmitters[i]); + assertEq(uint8(transmitterOracle.role), uint8(MultiOCR3Base.Role.Unset)); + } + } + + function test_UpdateConfigSigners_Success() public { + _assertOCRConfigUnconfigured(s_multiOCR3.latestConfigDetails(0)); + + MultiOCR3Base.OCRConfigArgs[] memory ocrConfigs = new MultiOCR3Base.OCRConfigArgs[](1); + ocrConfigs[0] = MultiOCR3Base.OCRConfigArgs({ + ocrPluginType: 0, + configDigest: _getBasicConfigDigest(2, s_validSigners, s_validTransmitters), + F: 2, + isSignatureVerificationEnabled: true, + signers: s_validSigners, + transmitters: s_validTransmitters + }); + s_multiOCR3.setOCR3Configs(ocrConfigs); + + address[] memory newSigners = s_partialTransmitters; + address[] memory newTransmitters = s_partialSigners; + + ocrConfigs[0].F = 1; + ocrConfigs[0].configDigest = _getBasicConfigDigest(1, newSigners, newTransmitters); + ocrConfigs[0].signers = newSigners; + ocrConfigs[0].transmitters = newTransmitters; + + vm.expectEmit(); + emit MultiOCR3Base.ConfigSet( + ocrConfigs[0].ocrPluginType, + ocrConfigs[0].configDigest, + ocrConfigs[0].signers, + ocrConfigs[0].transmitters, + ocrConfigs[0].F + ); + vm.expectEmit(); + emit MultiOCR3Helper.AfterConfigSet(ocrConfigs[0].ocrPluginType); + + s_multiOCR3.setOCR3Configs(ocrConfigs); + + MultiOCR3Base.OCRConfig memory expectedConfig = MultiOCR3Base.OCRConfig({ + configInfo: MultiOCR3Base.ConfigInfo({ + configDigest: ocrConfigs[0].configDigest, + F: ocrConfigs[0].F, + n: uint8(ocrConfigs[0].signers.length), + isSignatureVerificationEnabled: ocrConfigs[0].isSignatureVerificationEnabled + }), + signers: newSigners, + transmitters: newTransmitters + }); + _assertOCRConfigEquality(s_multiOCR3.latestConfigDetails(0), expectedConfig); + + // Verify oracle roles get correctly re-assigned + for (uint256 i; i < newSigners.length; ++i) { + MultiOCR3Base.Oracle memory signerOracle = s_multiOCR3.getOracle(0, newSigners[i]); + assertEq(signerOracle.index, i); + assertEq(uint8(signerOracle.role), uint8(MultiOCR3Base.Role.Signer)); + + MultiOCR3Base.Oracle memory transmitterOracle = s_multiOCR3.getOracle(0, newTransmitters[i]); + assertEq(transmitterOracle.index, i); + assertEq(uint8(transmitterOracle.role), uint8(MultiOCR3Base.Role.Transmitter)); + } + + // Verify old signers / transmitters get correctly unset + for (uint256 i = newSigners.length; i < s_validSigners.length; ++i) { + MultiOCR3Base.Oracle memory signerOracle = s_multiOCR3.getOracle(0, s_validSigners[i]); + assertEq(uint8(signerOracle.role), uint8(MultiOCR3Base.Role.Unset)); + + MultiOCR3Base.Oracle memory transmitterOracle = s_multiOCR3.getOracle(0, s_validTransmitters[i]); + assertEq(uint8(transmitterOracle.role), uint8(MultiOCR3Base.Role.Unset)); + } + } + + // Reverts + + function test_RepeatTransmitterAddress_Revert() public { + address[] memory signers = s_validSigners; + address[] memory transmitters = s_validTransmitters; + transmitters[0] = signers[0]; + + MultiOCR3Base.OCRConfigArgs[] memory ocrConfigs = new MultiOCR3Base.OCRConfigArgs[](1); + ocrConfigs[0] = MultiOCR3Base.OCRConfigArgs({ + ocrPluginType: 0, + configDigest: _getBasicConfigDigest(1, signers, transmitters), + F: 1, + isSignatureVerificationEnabled: true, + signers: signers, + transmitters: transmitters + }); + + vm.expectRevert( + abi.encodeWithSelector( + MultiOCR3Base.InvalidConfig.selector, MultiOCR3Base.InvalidConfigErrorType.REPEATED_ORACLE_ADDRESS + ) + ); + s_multiOCR3.setOCR3Configs(ocrConfigs); + } + + function test_RepeatSignerAddress_Revert() public { + address[] memory signers = s_validSigners; + address[] memory transmitters = s_validTransmitters; + signers[1] = signers[0]; + + MultiOCR3Base.OCRConfigArgs[] memory ocrConfigs = new MultiOCR3Base.OCRConfigArgs[](1); + ocrConfigs[0] = MultiOCR3Base.OCRConfigArgs({ + ocrPluginType: 0, + configDigest: _getBasicConfigDigest(1, signers, transmitters), + F: 1, + isSignatureVerificationEnabled: true, + signers: signers, + transmitters: transmitters + }); + + vm.expectRevert( + abi.encodeWithSelector( + MultiOCR3Base.InvalidConfig.selector, MultiOCR3Base.InvalidConfigErrorType.REPEATED_ORACLE_ADDRESS + ) + ); + s_multiOCR3.setOCR3Configs(ocrConfigs); + } + + function test_SignerCannotBeZeroAddress_Revert() public { + uint8 F = 1; + address[] memory signers = new address[](3 * F + 1); + address[] memory transmitters = new address[](3 * F + 1); + for (uint160 i = 0; i < 3 * F + 1; ++i) { + signers[i] = address(i + 1); + transmitters[i] = address(i + 1000); + } + + signers[0] = address(0); + + MultiOCR3Base.OCRConfigArgs[] memory ocrConfigs = new MultiOCR3Base.OCRConfigArgs[](1); + ocrConfigs[0] = MultiOCR3Base.OCRConfigArgs({ + ocrPluginType: 0, + configDigest: _getBasicConfigDigest(F, signers, transmitters), + F: F, + isSignatureVerificationEnabled: true, + signers: signers, + transmitters: transmitters + }); + + vm.expectRevert(MultiOCR3Base.OracleCannotBeZeroAddress.selector); + s_multiOCR3.setOCR3Configs(ocrConfigs); + } + + function test_TransmitterCannotBeZeroAddress_Revert() public { + uint8 F = 1; + address[] memory signers = new address[](3 * F + 1); + address[] memory transmitters = new address[](3 * F + 1); + for (uint160 i = 0; i < 3 * F + 1; ++i) { + signers[i] = address(i + 1); + transmitters[i] = address(i + 1000); + } + + transmitters[0] = address(0); + + MultiOCR3Base.OCRConfigArgs[] memory ocrConfigs = new MultiOCR3Base.OCRConfigArgs[](1); + ocrConfigs[0] = MultiOCR3Base.OCRConfigArgs({ + ocrPluginType: 0, + configDigest: _getBasicConfigDigest(F, signers, transmitters), + F: F, + isSignatureVerificationEnabled: true, + signers: signers, + transmitters: transmitters + }); + + vm.expectRevert(MultiOCR3Base.OracleCannotBeZeroAddress.selector); + s_multiOCR3.setOCR3Configs(ocrConfigs); + } + + function test_StaticConfigChange_Revert() public { + uint8 F = 1; + + _assertOCRConfigUnconfigured(s_multiOCR3.latestConfigDetails(0)); + + MultiOCR3Base.OCRConfigArgs[] memory ocrConfigs = new MultiOCR3Base.OCRConfigArgs[](1); + ocrConfigs[0] = MultiOCR3Base.OCRConfigArgs({ + ocrPluginType: 0, + configDigest: _getBasicConfigDigest(F, s_validSigners, s_validTransmitters), + F: F, + isSignatureVerificationEnabled: true, + signers: s_validSigners, + transmitters: s_validTransmitters + }); + + s_multiOCR3.setOCR3Configs(ocrConfigs); + + // signature verification cannot change + ocrConfigs[0].isSignatureVerificationEnabled = false; + vm.expectRevert(abi.encodeWithSelector(MultiOCR3Base.StaticConfigCannotBeChanged.selector, 0)); + s_multiOCR3.setOCR3Configs(ocrConfigs); + } + + function test_FTooHigh_Revert() public { + address[] memory signers = new address[](0); + address[] memory transmitters = new address[](0); + + MultiOCR3Base.OCRConfigArgs[] memory ocrConfigs = new MultiOCR3Base.OCRConfigArgs[](1); + ocrConfigs[0] = MultiOCR3Base.OCRConfigArgs({ + ocrPluginType: 0, + configDigest: _getBasicConfigDigest(1, signers, transmitters), + F: 1, + isSignatureVerificationEnabled: true, + signers: signers, + transmitters: transmitters + }); + + vm.expectRevert( + abi.encodeWithSelector(MultiOCR3Base.InvalidConfig.selector, MultiOCR3Base.InvalidConfigErrorType.F_TOO_HIGH) + ); + s_multiOCR3.setOCR3Configs(ocrConfigs); + } + + function test_FMustBePositive_Revert() public { + MultiOCR3Base.OCRConfigArgs[] memory ocrConfigs = new MultiOCR3Base.OCRConfigArgs[](1); + ocrConfigs[0] = MultiOCR3Base.OCRConfigArgs({ + ocrPluginType: 0, + configDigest: _getBasicConfigDigest(0, s_validSigners, s_validTransmitters), + F: 0, + isSignatureVerificationEnabled: true, + signers: s_validSigners, + transmitters: s_validTransmitters + }); + + vm.expectRevert( + abi.encodeWithSelector( + MultiOCR3Base.InvalidConfig.selector, MultiOCR3Base.InvalidConfigErrorType.F_MUST_BE_POSITIVE + ) + ); + s_multiOCR3.setOCR3Configs(ocrConfigs); + } + + function test_TooManyTransmitters_Revert() public { + address[] memory signers = new address[](0); + address[] memory transmitters = new address[](257); + + MultiOCR3Base.OCRConfigArgs[] memory ocrConfigs = new MultiOCR3Base.OCRConfigArgs[](1); + ocrConfigs[0] = MultiOCR3Base.OCRConfigArgs({ + ocrPluginType: 0, + configDigest: _getBasicConfigDigest(10, signers, transmitters), + F: 10, + isSignatureVerificationEnabled: false, + signers: signers, + transmitters: transmitters + }); + + vm.expectRevert( + abi.encodeWithSelector( + MultiOCR3Base.InvalidConfig.selector, MultiOCR3Base.InvalidConfigErrorType.TOO_MANY_TRANSMITTERS + ) + ); + s_multiOCR3.setOCR3Configs(ocrConfigs); + } + + function test_TooManySigners_Revert() public { + address[] memory signers = new address[](257); + + MultiOCR3Base.OCRConfigArgs[] memory ocrConfigs = new MultiOCR3Base.OCRConfigArgs[](1); + ocrConfigs[0] = MultiOCR3Base.OCRConfigArgs({ + ocrPluginType: 0, + configDigest: _getBasicConfigDigest(1, signers, s_validTransmitters), + F: 1, + isSignatureVerificationEnabled: true, + signers: signers, + transmitters: s_validTransmitters + }); + + vm.expectRevert( + abi.encodeWithSelector( + MultiOCR3Base.InvalidConfig.selector, MultiOCR3Base.InvalidConfigErrorType.TOO_MANY_SIGNERS + ) + ); + s_multiOCR3.setOCR3Configs(ocrConfigs); + } +} diff --git a/contracts/src/v0.8/ccip/test/ocr/MultiOCR3BaseSetup.t.sol b/contracts/src/v0.8/ccip/test/ocr/MultiOCR3BaseSetup.t.sol new file mode 100644 index 00000000000..6f6219bc9b0 --- /dev/null +++ b/contracts/src/v0.8/ccip/test/ocr/MultiOCR3BaseSetup.t.sol @@ -0,0 +1,113 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {MultiOCR3Base} from "../../ocr/MultiOCR3Base.sol"; +import {BaseTest} from "../BaseTest.t.sol"; +import {MultiOCR3Helper} from "../helpers/MultiOCR3Helper.sol"; + +contract MultiOCR3BaseSetup is BaseTest { + // Signer private keys used for these test + uint256 internal constant PRIVATE0 = 0x7b2e97fe057e6de99d6872a2ef2abf52c9b4469bc848c2465ac3fcd8d336e81d; + + address[] internal s_validSigners; + address[] internal s_validTransmitters; + uint256[] internal s_validSignerKeys; + + address[] internal s_partialSigners; + address[] internal s_partialTransmitters; + uint256[] internal s_partialSignerKeys; + + address[] internal s_emptySigners; + + bytes internal constant REPORT = abi.encode("testReport"); + MultiOCR3Helper internal s_multiOCR3; + + function setUp() public virtual override { + BaseTest.setUp(); + + uint160 numSigners = 7; + s_validSignerKeys = new uint256[](numSigners); + s_validSigners = new address[](numSigners); + s_validTransmitters = new address[](numSigners); + + for (uint160 i; i < numSigners; ++i) { + s_validTransmitters[i] = address(4 + i); + s_validSignerKeys[i] = PRIVATE0 + i; + s_validSigners[i] = vm.addr(s_validSignerKeys[i]); + } + + s_partialSigners = new address[](4); + s_partialSignerKeys = new uint256[](4); + s_partialTransmitters = new address[](4); + for (uint256 i; i < s_partialSigners.length; ++i) { + s_partialSigners[i] = s_validSigners[i]; + s_partialSignerKeys[i] = s_validSignerKeys[i]; + s_partialTransmitters[i] = s_validTransmitters[i]; + } + + s_emptySigners = new address[](0); + + s_multiOCR3 = new MultiOCR3Helper(); + } + + /// @dev returns a mock config digest with config digest computation logic similar to OCR2Base + function _getBasicConfigDigest( + uint8 F, + address[] memory signers, + address[] memory transmitters + ) internal view returns (bytes32) { + bytes memory configBytes = abi.encode(""); + uint256 configVersion = 1; + + uint256 h = uint256( + keccak256( + abi.encode( + block.chainid, address(s_multiOCR3), signers, transmitters, F, configBytes, configVersion, configBytes + ) + ) + ); + uint256 prefixMask = type(uint256).max << (256 - 16); // 0xFFFF00..00 + uint256 prefix = 0x0001 << (256 - 16); // 0x000100..00 + return bytes32((prefix & prefixMask) | (h & ~prefixMask)); + } + + function _assertOCRConfigEquality( + MultiOCR3Base.OCRConfig memory configA, + MultiOCR3Base.OCRConfig memory configB + ) internal pure { + vm.assertEq(configA.configInfo.configDigest, configB.configInfo.configDigest); + vm.assertEq(configA.configInfo.F, configB.configInfo.F); + vm.assertEq(configA.configInfo.n, configB.configInfo.n); + vm.assertEq(configA.configInfo.isSignatureVerificationEnabled, configB.configInfo.isSignatureVerificationEnabled); + + vm.assertEq(configA.signers, configB.signers); + vm.assertEq(configA.transmitters, configB.transmitters); + } + + function _assertOCRConfigUnconfigured(MultiOCR3Base.OCRConfig memory config) internal pure { + assertEq(config.configInfo.configDigest, bytes32("")); + assertEq(config.signers.length, 0); + assertEq(config.transmitters.length, 0); + } + + function _getSignaturesForDigest( + uint256[] memory signerPrivateKeys, + bytes memory report, + bytes32[3] memory reportContext, + uint8 signatureCount + ) internal pure returns (bytes32[] memory rs, bytes32[] memory ss, uint8[] memory vs, bytes32 rawVs) { + rs = new bytes32[](signatureCount); + ss = new bytes32[](signatureCount); + vs = new uint8[](signatureCount); + + bytes32 reportDigest = keccak256(abi.encodePacked(keccak256(report), reportContext)); + + // Calculate signatures + for (uint256 i; i < signatureCount; ++i) { + (vs[i], rs[i], ss[i]) = vm.sign(signerPrivateKeys[i], reportDigest); + rawVs = rawVs | (bytes32(bytes1(vs[i] - 27)) >> (8 * i)); + } + + return (rs, ss, vs, rawVs); + } +} diff --git a/contracts/src/v0.8/ccip/test/ocr/OCR2Base.t.sol b/contracts/src/v0.8/ccip/test/ocr/OCR2Base.t.sol new file mode 100644 index 00000000000..7511ebdffae --- /dev/null +++ b/contracts/src/v0.8/ccip/test/ocr/OCR2Base.t.sol @@ -0,0 +1,305 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {OCR2Abstract} from "../../ocr/OCR2Abstract.sol"; +import {OCR2Base} from "../../ocr/OCR2Base.sol"; +import {OCR2Helper} from "../helpers/OCR2Helper.sol"; +import {OCR2Setup} from "./OCR2Setup.t.sol"; + +contract OCR2BaseSetup is OCR2Setup { + OCR2Helper internal s_OCR2Base; + + bytes32[] internal s_rs; + bytes32[] internal s_ss; + bytes32 internal s_rawVs; + + uint40 internal s_latestEpochAndRound; + + function setUp() public virtual override { + OCR2Setup.setUp(); + s_OCR2Base = new OCR2Helper(); + + bytes32 testReportDigest = getTestReportDigest(); + + bytes32[] memory rs = new bytes32[](2); + bytes32[] memory ss = new bytes32[](2); + uint8[] memory vs = new uint8[](2); + + // Calculate signatures + (vs[0], rs[0], ss[0]) = vm.sign(PRIVATE0, testReportDigest); + (vs[1], rs[1], ss[1]) = vm.sign(PRIVATE1, testReportDigest); + + s_rs = rs; + s_ss = ss; + s_rawVs = bytes32(bytes1(vs[0] - 27)) | (bytes32(bytes1(vs[1] - 27)) >> 8); + } + + function getBasicConfigDigest(uint8 f, uint64 currentConfigCount) internal view returns (bytes32) { + bytes memory configBytes = abi.encode(""); + return s_OCR2Base.configDigestFromConfigData( + block.chainid, + address(s_OCR2Base), + currentConfigCount + 1, + s_valid_signers, + s_valid_transmitters, + f, + configBytes, + s_offchainConfigVersion, + configBytes + ); + } + + function getTestReportDigest() internal view returns (bytes32) { + bytes32 configDigest = getBasicConfigDigest(s_f, 0); + bytes32[3] memory reportContext = [configDigest, configDigest, configDigest]; + return keccak256(abi.encodePacked(keccak256(REPORT), reportContext)); + } + + function getBasicConfigDigest( + address contractAddress, + uint8 f, + uint64 currentConfigCount, + bytes memory onchainConfig + ) internal view returns (bytes32) { + return s_OCR2Base.configDigestFromConfigData( + block.chainid, + contractAddress, + currentConfigCount + 1, + s_valid_signers, + s_valid_transmitters, + f, + onchainConfig, + s_offchainConfigVersion, + abi.encode("") + ); + } +} + +contract OCR2Base_transmit is OCR2BaseSetup { + bytes32 internal s_configDigest; + + function setUp() public virtual override { + OCR2BaseSetup.setUp(); + bytes memory configBytes = abi.encode(""); + + s_configDigest = getBasicConfigDigest(s_f, 0); + s_OCR2Base.setOCR2Config( + s_valid_signers, s_valid_transmitters, s_f, configBytes, s_offchainConfigVersion, configBytes + ); + } + + function test_Transmit2SignersSuccess_gas() public { + vm.pauseGasMetering(); + bytes32[3] memory reportContext = [s_configDigest, s_configDigest, s_configDigest]; + + vm.startPrank(s_valid_transmitters[0]); + vm.resumeGasMetering(); + s_OCR2Base.transmit(reportContext, REPORT, s_rs, s_ss, s_rawVs); + } + + // Reverts + + function test_ForkedChain_Revert() public { + bytes32[3] memory reportContext = [s_configDigest, s_configDigest, s_configDigest]; + + uint256 chain1 = block.chainid; + uint256 chain2 = chain1 + 1; + vm.chainId(chain2); + vm.expectRevert(abi.encodeWithSelector(OCR2Base.ForkedChain.selector, chain1, chain2)); + vm.startPrank(s_valid_transmitters[0]); + s_OCR2Base.transmit(reportContext, REPORT, s_rs, s_ss, s_rawVs); + } + + function test_WrongNumberOfSignatures_Revert() public { + bytes32[3] memory reportContext = [s_configDigest, s_configDigest, s_configDigest]; + + vm.expectRevert(OCR2Base.WrongNumberOfSignatures.selector); + s_OCR2Base.transmit(reportContext, REPORT, new bytes32[](0), new bytes32[](0), s_rawVs); + } + + function test_ConfigDigestMismatch_Revert() public { + bytes32 configDigest; + bytes32[3] memory reportContext = [configDigest, configDigest, configDigest]; + + vm.expectRevert(abi.encodeWithSelector(OCR2Base.ConfigDigestMismatch.selector, s_configDigest, configDigest)); + s_OCR2Base.transmit(reportContext, REPORT, new bytes32[](0), new bytes32[](0), s_rawVs); + } + + function test_SignatureOutOfRegistration_Revert() public { + bytes32[3] memory reportContext = [s_configDigest, s_configDigest, s_configDigest]; + + bytes32[] memory rs = new bytes32[](2); + bytes32[] memory ss = new bytes32[](1); + + vm.expectRevert(OCR2Base.SignaturesOutOfRegistration.selector); + s_OCR2Base.transmit(reportContext, REPORT, rs, ss, s_rawVs); + } + + function test_UnAuthorizedTransmitter_Revert() public { + bytes32[3] memory reportContext = [s_configDigest, s_configDigest, s_configDigest]; + bytes32[] memory rs = new bytes32[](2); + bytes32[] memory ss = new bytes32[](2); + + vm.expectRevert(OCR2Base.UnauthorizedTransmitter.selector); + s_OCR2Base.transmit(reportContext, REPORT, rs, ss, s_rawVs); + } + + function test_NonUniqueSignature_Revert() public { + bytes32[3] memory reportContext = [s_configDigest, s_configDigest, s_configDigest]; + bytes32[] memory rs = s_rs; + bytes32[] memory ss = s_ss; + + rs[1] = rs[0]; + ss[1] = ss[0]; + // Need to reset the rawVs to be valid + bytes32 rawVs = bytes32(bytes1(uint8(28) - 27)) | (bytes32(bytes1(uint8(28) - 27)) >> 8); + + vm.startPrank(s_valid_transmitters[0]); + vm.expectRevert(OCR2Base.NonUniqueSignatures.selector); + s_OCR2Base.transmit(reportContext, REPORT, rs, ss, rawVs); + } + + function test_UnauthorizedSigner_Revert() public { + bytes32[3] memory reportContext = [s_configDigest, s_configDigest, s_configDigest]; + bytes32[] memory rs = new bytes32[](2); + rs[0] = s_configDigest; + bytes32[] memory ss = rs; + + vm.startPrank(s_valid_transmitters[0]); + vm.expectRevert(OCR2Base.UnauthorizedSigner.selector); + s_OCR2Base.transmit(reportContext, REPORT, rs, ss, s_rawVs); + } +} + +contract OCR2Base_setOCR2Config is OCR2BaseSetup { + function test_SetConfigSuccess_gas() public { + vm.pauseGasMetering(); + bytes memory configBytes = abi.encode(""); + uint32 configCount = 0; + + bytes32 configDigest = getBasicConfigDigest(s_f, configCount++); + + address[] memory transmitters = s_OCR2Base.getTransmitters(); + assertEq(0, transmitters.length); + + vm.expectEmit(); + emit OCR2Abstract.ConfigSet( + 0, + configDigest, + configCount, + s_valid_signers, + s_valid_transmitters, + s_f, + configBytes, + s_offchainConfigVersion, + configBytes + ); + + s_OCR2Base.setOCR2Config( + s_valid_signers, s_valid_transmitters, s_f, configBytes, s_offchainConfigVersion, configBytes + ); + + transmitters = s_OCR2Base.getTransmitters(); + assertEq(s_valid_transmitters, transmitters); + + configDigest = getBasicConfigDigest(s_f, configCount++); + + vm.expectEmit(); + emit OCR2Abstract.ConfigSet( + uint32(block.number), + configDigest, + configCount, + s_valid_signers, + s_valid_transmitters, + s_f, + configBytes, + s_offchainConfigVersion, + configBytes + ); + vm.resumeGasMetering(); + s_OCR2Base.setOCR2Config( + s_valid_signers, s_valid_transmitters, s_f, configBytes, s_offchainConfigVersion, configBytes + ); + } + + // Reverts + function test_RepeatAddress_Revert() public { + address[] memory signers = new address[](10); + signers[0] = address(1245678); + address[] memory transmitters = new address[](10); + transmitters[0] = signers[0]; + + vm.expectRevert( + abi.encodeWithSelector(OCR2Base.InvalidConfig.selector, OCR2Base.InvalidConfigErrorType.REPEATED_ORACLE_ADDRESS) + ); + s_OCR2Base.setOCR2Config(signers, transmitters, 2, abi.encode(""), 100, abi.encode("")); + } + + function test_SingerCannotBeZeroAddress_Revert() public { + uint256 f = 1; + address[] memory signers = new address[](3 * f + 1); + address[] memory transmitters = new address[](3 * f + 1); + for (uint160 i = 0; i < 3 * f + 1; ++i) { + signers[i] = address(i + 1); + transmitters[i] = address(i + 1000); + } + + signers[0] = address(0); + + vm.expectRevert(OCR2Base.OracleCannotBeZeroAddress.selector); + s_OCR2Base.setOCR2Config(signers, transmitters, uint8(f), abi.encode(""), 100, abi.encode("")); + } + + function test_TransmitterCannotBeZeroAddress_Revert() public { + uint256 f = 1; + address[] memory signers = new address[](3 * f + 1); + address[] memory transmitters = new address[](3 * f + 1); + for (uint160 i = 0; i < 3 * f + 1; ++i) { + signers[i] = address(i + 1); + transmitters[i] = address(i + 1000); + } + + transmitters[0] = address(0); + + vm.expectRevert(OCR2Base.OracleCannotBeZeroAddress.selector); + s_OCR2Base.setOCR2Config(signers, transmitters, uint8(f), abi.encode(""), 100, abi.encode("")); + } + + function test_OracleOutOfRegister_Revert() public { + address[] memory signers = new address[](10); + address[] memory transmitters = new address[](0); + + vm.expectRevert( + abi.encodeWithSelector( + OCR2Base.InvalidConfig.selector, OCR2Base.InvalidConfigErrorType.NUM_SIGNERS_NOT_NUM_TRANSMITTERS + ) + ); + s_OCR2Base.setOCR2Config(signers, transmitters, 2, abi.encode(""), 100, abi.encode("")); + } + + function test_FTooHigh_Revert() public { + address[] memory signers = new address[](0); + uint8 f = 1; + + vm.expectRevert(abi.encodeWithSelector(OCR2Base.InvalidConfig.selector, OCR2Base.InvalidConfigErrorType.F_TOO_HIGH)); + s_OCR2Base.setOCR2Config(signers, new address[](0), f, abi.encode(""), 100, abi.encode("")); + } + + function test_FMustBePositive_Revert() public { + uint8 f = 0; + + vm.expectRevert( + abi.encodeWithSelector(OCR2Base.InvalidConfig.selector, OCR2Base.InvalidConfigErrorType.F_MUST_BE_POSITIVE) + ); + s_OCR2Base.setOCR2Config(new address[](0), new address[](0), f, abi.encode(""), 100, abi.encode("")); + } + + function test_TooManySigners_Revert() public { + address[] memory signers = new address[](32); + + vm.expectRevert( + abi.encodeWithSelector(OCR2Base.InvalidConfig.selector, OCR2Base.InvalidConfigErrorType.TOO_MANY_SIGNERS) + ); + s_OCR2Base.setOCR2Config(signers, new address[](0), 0, abi.encode(""), 100, abi.encode("")); + } +} diff --git a/contracts/src/v0.8/ccip/test/ocr/OCR2BaseNoChecks.t.sol b/contracts/src/v0.8/ccip/test/ocr/OCR2BaseNoChecks.t.sol new file mode 100644 index 00000000000..fd4cf3fc9e7 --- /dev/null +++ b/contracts/src/v0.8/ccip/test/ocr/OCR2BaseNoChecks.t.sol @@ -0,0 +1,208 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {OCR2BaseNoChecks} from "../../ocr/OCR2BaseNoChecks.sol"; +import {OCR2NoChecksHelper} from "../helpers/OCR2NoChecksHelper.sol"; +import {OCR2Setup} from "./OCR2Setup.t.sol"; + +contract OCR2BaseNoChecksSetup is OCR2Setup { + OCR2NoChecksHelper internal s_OCR2Base; + + bytes32[] internal s_rs; + bytes32[] internal s_ss; + bytes32 internal s_rawVs; + + function setUp() public virtual override { + OCR2Setup.setUp(); + s_OCR2Base = new OCR2NoChecksHelper(); + } + + function getBasicConfigDigest(uint8 f, uint64 currentConfigCount) internal view returns (bytes32) { + bytes memory configBytes = abi.encode(""); + return s_OCR2Base.configDigestFromConfigData( + block.chainid, + address(s_OCR2Base), + currentConfigCount + 1, + s_valid_signers, + s_valid_transmitters, + f, + configBytes, + s_offchainConfigVersion, + configBytes + ); + } +} + +contract OCR2BaseNoChecks_transmit is OCR2BaseNoChecksSetup { + bytes32 internal s_configDigest; + + function setUp() public virtual override { + OCR2BaseNoChecksSetup.setUp(); + bytes memory configBytes = abi.encode(""); + + s_configDigest = getBasicConfigDigest(s_f, 0); + s_OCR2Base.setOCR2Config( + s_valid_signers, s_valid_transmitters, s_f, configBytes, s_offchainConfigVersion, configBytes + ); + } + + function test_TransmitSuccess_gas() public { + vm.pauseGasMetering(); + bytes32[3] memory reportContext = [s_configDigest, s_configDigest, s_configDigest]; + + vm.startPrank(s_valid_transmitters[0]); + vm.resumeGasMetering(); + s_OCR2Base.transmit(reportContext, REPORT, s_rs, s_ss, s_rawVs); + } + + // Reverts + + function test_ForkedChain_Revert() public { + bytes32[3] memory reportContext = [s_configDigest, s_configDigest, s_configDigest]; + + uint256 chain1 = block.chainid; + uint256 chain2 = chain1 + 1; + vm.chainId(chain2); + vm.expectRevert(abi.encodeWithSelector(OCR2BaseNoChecks.ForkedChain.selector, chain1, chain2)); + vm.startPrank(s_valid_transmitters[0]); + s_OCR2Base.transmit(reportContext, REPORT, s_rs, s_ss, s_rawVs); + } + + function test_ConfigDigestMismatch_Revert() public { + bytes32 configDigest; + + bytes32[3] memory reportContext = [configDigest, configDigest, configDigest]; + + vm.expectRevert( + abi.encodeWithSelector(OCR2BaseNoChecks.ConfigDigestMismatch.selector, s_configDigest, configDigest) + ); + s_OCR2Base.transmit(reportContext, REPORT, new bytes32[](0), new bytes32[](0), s_rawVs); + } + + function test_UnAuthorizedTransmitter_Revert() public { + bytes32[3] memory reportContext = [s_configDigest, s_configDigest, s_configDigest]; + bytes32[] memory rs = new bytes32[](3); + bytes32[] memory ss = new bytes32[](3); + + vm.expectRevert(OCR2BaseNoChecks.UnauthorizedTransmitter.selector); + s_OCR2Base.transmit(reportContext, REPORT, rs, ss, s_rawVs); + } +} + +contract OCR2BaseNoChecks_setOCR2Config is OCR2BaseNoChecksSetup { + event ConfigSet( + uint32 previousConfigBlockNumber, + bytes32 configDigest, + uint64 configCount, + address[] signers, + address[] transmitters, + uint8 f, + bytes onchainConfig, + uint64 offchainConfigVersion, + bytes offchainConfig + ); + + function test_SetConfigSuccess_gas() public { + vm.pauseGasMetering(); + bytes memory configBytes = abi.encode(""); + uint32 configCount = 0; + + bytes32 configDigest = getBasicConfigDigest(s_f, configCount++); + + address[] memory transmitters = s_OCR2Base.getTransmitters(); + assertEq(0, transmitters.length); + + vm.expectEmit(); + emit ConfigSet( + 0, + configDigest, + configCount, + s_valid_signers, + s_valid_transmitters, + s_f, + configBytes, + s_offchainConfigVersion, + configBytes + ); + + s_OCR2Base.setOCR2Config( + s_valid_signers, s_valid_transmitters, s_f, configBytes, s_offchainConfigVersion, configBytes + ); + + transmitters = s_OCR2Base.getTransmitters(); + assertEq(s_valid_transmitters, transmitters); + + configDigest = getBasicConfigDigest(s_f, configCount++); + + vm.expectEmit(); + emit ConfigSet( + uint32(block.number), + configDigest, + configCount, + s_valid_signers, + s_valid_transmitters, + s_f, + configBytes, + s_offchainConfigVersion, + configBytes + ); + vm.resumeGasMetering(); + s_OCR2Base.setOCR2Config( + s_valid_signers, s_valid_transmitters, s_f, configBytes, s_offchainConfigVersion, configBytes + ); + } + + // Reverts + function test_RepeatAddress_Revert() public { + address[] memory signers = new address[](4); + address[] memory transmitters = new address[](4); + transmitters[0] = address(1245678); + transmitters[1] = address(1245678); + transmitters[2] = address(1245678); + transmitters[3] = address(1245678); + + vm.expectRevert( + abi.encodeWithSelector( + OCR2BaseNoChecks.InvalidConfig.selector, OCR2BaseNoChecks.InvalidConfigErrorType.REPEATED_ORACLE_ADDRESS + ) + ); + s_OCR2Base.setOCR2Config(signers, transmitters, 1, abi.encode(""), 100, abi.encode("")); + } + + function test_FMustBePositive_Revert() public { + uint8 f = 0; + + vm.expectRevert( + abi.encodeWithSelector( + OCR2BaseNoChecks.InvalidConfig.selector, OCR2BaseNoChecks.InvalidConfigErrorType.F_MUST_BE_POSITIVE + ) + ); + s_OCR2Base.setOCR2Config(new address[](0), new address[](0), f, abi.encode(""), 100, abi.encode("")); + } + + function test_TransmitterCannotBeZeroAddress_Revert() public { + uint256 f = 1; + address[] memory signers = new address[](3 * f + 1); + address[] memory transmitters = new address[](3 * f + 1); + for (uint160 i = 0; i < 3 * f + 1; ++i) { + signers[i] = address(i + 1); + transmitters[i] = address(i + 1000); + } + + transmitters[0] = address(0); + + vm.expectRevert(OCR2BaseNoChecks.OracleCannotBeZeroAddress.selector); + s_OCR2Base.setOCR2Config(signers, transmitters, uint8(f), abi.encode(""), 100, abi.encode("")); + } + + function test_TooManyTransmitter_Revert() public { + address[] memory transmitters = new address[](100); + + vm.expectRevert( + abi.encodeWithSelector( + OCR2BaseNoChecks.InvalidConfig.selector, OCR2BaseNoChecks.InvalidConfigErrorType.TOO_MANY_TRANSMITTERS + ) + ); + s_OCR2Base.setOCR2Config(new address[](0), transmitters, 0, abi.encode(""), 100, abi.encode("")); + } +} diff --git a/contracts/src/v0.8/ccip/test/ocr/OCR2Setup.t.sol b/contracts/src/v0.8/ccip/test/ocr/OCR2Setup.t.sol new file mode 100644 index 00000000000..e4be8ffa29b --- /dev/null +++ b/contracts/src/v0.8/ccip/test/ocr/OCR2Setup.t.sol @@ -0,0 +1,31 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {Test} from "forge-std/Test.sol"; + +contract OCR2Setup is Test { + uint256 internal constant PRIVATE0 = 0x7b2e97fe057e6de99d6872a2ef2abf52c9b4469bc848c2465ac3fcd8d336e81d; + uint256 internal constant PRIVATE1 = 0xab56160806b05ef1796789248e1d7f34a6465c5280899159d645218cd216cee6; + uint256 internal constant PRIVATE2 = 0x6ec7caa8406a49b76736602810e0a2871959fbbb675e23a8590839e4717f1f7f; + uint256 internal constant PRIVATE3 = 0x80f14b11da94ae7f29d9a7713ea13dc838e31960a5c0f2baf45ed458947b730a; + + address[] internal s_valid_signers; + address[] internal s_valid_transmitters; + + uint64 internal constant s_offchainConfigVersion = 3; + uint8 internal constant s_f = 1; + bytes internal constant REPORT = abi.encode("testReport"); + + function setUp() public virtual { + s_valid_transmitters = new address[](4); + for (uint160 i = 0; i < 4; ++i) { + s_valid_transmitters[i] = address(4 + i); + } + + s_valid_signers = new address[](4); + s_valid_signers[0] = vm.addr(PRIVATE0); //0xc110458BE52CaA6bB68E66969C3218A4D9Db0211 + s_valid_signers[1] = vm.addr(PRIVATE1); //0xc110a19c08f1da7F5FfB281dc93630923F8E3719 + s_valid_signers[2] = vm.addr(PRIVATE2); //0xc110fdF6e8fD679C7Cc11602d1cd829211A18e9b + s_valid_signers[3] = vm.addr(PRIVATE3); //0xc11028017c9b445B6bF8aE7da951B5cC28B326C0 + } +} diff --git a/contracts/src/v0.8/ccip/test/offRamp/EVM2EVMOffRamp.t.sol b/contracts/src/v0.8/ccip/test/offRamp/EVM2EVMOffRamp.t.sol new file mode 100644 index 00000000000..493d02c7c21 --- /dev/null +++ b/contracts/src/v0.8/ccip/test/offRamp/EVM2EVMOffRamp.t.sol @@ -0,0 +1,2235 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {ICommitStore} from "../../interfaces/ICommitStore.sol"; +import {ITokenAdminRegistry} from "../../interfaces/ITokenAdminRegistry.sol"; + +import {CallWithExactGas} from "../../../shared/call/CallWithExactGas.sol"; + +import {GenericReceiver} from "../../../shared/test/testhelpers/GenericReceiver.sol"; +import {AggregateRateLimiter} from "../../AggregateRateLimiter.sol"; +import {Router} from "../../Router.sol"; +import {Client} from "../../libraries/Client.sol"; +import {Internal} from "../../libraries/Internal.sol"; +import {Pool} from "../../libraries/Pool.sol"; +import {RateLimiter} from "../../libraries/RateLimiter.sol"; +import {OCR2Abstract} from "../../ocr/OCR2Abstract.sol"; +import {EVM2EVMOffRamp} from "../../offRamp/EVM2EVMOffRamp.sol"; +import {LockReleaseTokenPool} from "../../pools/LockReleaseTokenPool.sol"; +import {TokenPool} from "../../pools/TokenPool.sol"; +import {EVM2EVMOffRampHelper} from "../helpers/EVM2EVMOffRampHelper.sol"; +import {MaybeRevertingBurnMintTokenPool} from "../helpers/MaybeRevertingBurnMintTokenPool.sol"; +import {ConformingReceiver} from "../helpers/receivers/ConformingReceiver.sol"; +import {MaybeRevertMessageReceiver} from "../helpers/receivers/MaybeRevertMessageReceiver.sol"; +import {MaybeRevertMessageReceiverNo165} from "../helpers/receivers/MaybeRevertMessageReceiverNo165.sol"; +import {ReentrancyAbuser} from "../helpers/receivers/ReentrancyAbuser.sol"; +import {OCR2BaseNoChecks} from "../ocr/OCR2BaseNoChecks.t.sol"; +import {EVM2EVMOffRampSetup} from "./EVM2EVMOffRampSetup.t.sol"; +import {stdError} from "forge-std/Test.sol"; + +import {IERC20} from "../../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/IERC20.sol"; + +contract EVM2EVMOffRamp_constructor is EVM2EVMOffRampSetup { + function test_Constructor_Success() public { + EVM2EVMOffRamp.StaticConfig memory staticConfig = EVM2EVMOffRamp.StaticConfig({ + commitStore: address(s_mockCommitStore), + chainSelector: DEST_CHAIN_SELECTOR, + sourceChainSelector: SOURCE_CHAIN_SELECTOR, + onRamp: ON_RAMP_ADDRESS, + prevOffRamp: address(0), + rmnProxy: address(s_mockRMN), + tokenAdminRegistry: address(s_tokenAdminRegistry) + }); + EVM2EVMOffRamp.DynamicConfig memory dynamicConfig = + generateDynamicOffRampConfig(address(s_destRouter), address(s_feeQuoter)); + + s_offRamp = new EVM2EVMOffRampHelper(staticConfig, _getInboundRateLimiterConfig()); + + s_offRamp.setOCR2Config( + s_valid_signers, s_valid_transmitters, s_f, abi.encode(dynamicConfig), s_offchainConfigVersion, abi.encode("") + ); + + // Static config + EVM2EVMOffRamp.StaticConfig memory gotStaticConfig = s_offRamp.getStaticConfig(); + assertEq(staticConfig.commitStore, gotStaticConfig.commitStore); + assertEq(staticConfig.sourceChainSelector, gotStaticConfig.sourceChainSelector); + assertEq(staticConfig.chainSelector, gotStaticConfig.chainSelector); + assertEq(staticConfig.onRamp, gotStaticConfig.onRamp); + assertEq(staticConfig.prevOffRamp, gotStaticConfig.prevOffRamp); + assertEq(staticConfig.tokenAdminRegistry, gotStaticConfig.tokenAdminRegistry); + + // Dynamic config + EVM2EVMOffRamp.DynamicConfig memory gotDynamicConfig = s_offRamp.getDynamicConfig(); + _assertSameConfig(dynamicConfig, gotDynamicConfig); + + (uint32 configCount, uint32 blockNumber,) = s_offRamp.latestConfigDetails(); + assertEq(1, configCount); + assertEq(block.number, blockNumber); + + // OffRamp initial values + assertEq("EVM2EVMOffRamp 1.5.0", s_offRamp.typeAndVersion()); + assertEq(OWNER, s_offRamp.owner()); + } + + // Revert + function test_ZeroOnRampAddress_Revert() public { + vm.expectRevert(EVM2EVMOffRamp.ZeroAddressNotAllowed.selector); + + s_offRamp = new EVM2EVMOffRampHelper( + EVM2EVMOffRamp.StaticConfig({ + commitStore: address(s_mockCommitStore), + chainSelector: DEST_CHAIN_SELECTOR, + sourceChainSelector: SOURCE_CHAIN_SELECTOR, + onRamp: ZERO_ADDRESS, + prevOffRamp: address(0), + rmnProxy: address(s_mockRMN), + tokenAdminRegistry: address(s_tokenAdminRegistry) + }), + RateLimiter.Config({isEnabled: true, rate: 1e20, capacity: 1e20}) + ); + } + + function test_CommitStoreAlreadyInUse_Revert() public { + s_mockCommitStore.setExpectedNextSequenceNumber(2); + + vm.expectRevert(EVM2EVMOffRamp.CommitStoreAlreadyInUse.selector); + + s_offRamp = new EVM2EVMOffRampHelper( + EVM2EVMOffRamp.StaticConfig({ + commitStore: address(s_mockCommitStore), + chainSelector: DEST_CHAIN_SELECTOR, + sourceChainSelector: SOURCE_CHAIN_SELECTOR, + onRamp: ON_RAMP_ADDRESS, + prevOffRamp: address(0), + rmnProxy: address(s_mockRMN), + tokenAdminRegistry: address(s_tokenAdminRegistry) + }), + _getInboundRateLimiterConfig() + ); + } +} + +contract EVM2EVMOffRamp_setDynamicConfig is EVM2EVMOffRampSetup { + function test_SetDynamicConfig_Success() public { + EVM2EVMOffRamp.StaticConfig memory staticConfig = s_offRamp.getStaticConfig(); + EVM2EVMOffRamp.DynamicConfig memory dynamicConfig = generateDynamicOffRampConfig(USER_3, address(s_feeQuoter)); + bytes memory onchainConfig = abi.encode(dynamicConfig); + + vm.expectEmit(); + emit EVM2EVMOffRamp.ConfigSet(staticConfig, dynamicConfig); + + vm.expectEmit(); + uint32 configCount = 1; + emit OCR2Abstract.ConfigSet( + uint32(block.number), + getBasicConfigDigest(address(s_offRamp), s_f, configCount, onchainConfig), + configCount + 1, + s_valid_signers, + s_valid_transmitters, + s_f, + onchainConfig, + s_offchainConfigVersion, + abi.encode("") + ); + + s_offRamp.setOCR2Config( + s_valid_signers, s_valid_transmitters, s_f, onchainConfig, s_offchainConfigVersion, abi.encode("") + ); + + EVM2EVMOffRamp.DynamicConfig memory newConfig = s_offRamp.getDynamicConfig(); + _assertSameConfig(dynamicConfig, newConfig); + } + + function test_NonOwner_Revert() public { + vm.startPrank(STRANGER); + EVM2EVMOffRamp.DynamicConfig memory dynamicConfig = generateDynamicOffRampConfig(USER_3, address(s_feeQuoter)); + + vm.expectRevert("Only callable by owner"); + + s_offRamp.setOCR2Config( + s_valid_signers, s_valid_transmitters, s_f, abi.encode(dynamicConfig), s_offchainConfigVersion, abi.encode("") + ); + } + + function test_RouterZeroAddress_Revert() public { + EVM2EVMOffRamp.DynamicConfig memory dynamicConfig = generateDynamicOffRampConfig(ZERO_ADDRESS, ZERO_ADDRESS); + + vm.expectRevert(EVM2EVMOffRamp.ZeroAddressNotAllowed.selector); + + s_offRamp.setOCR2Config( + s_valid_signers, s_valid_transmitters, s_f, abi.encode(dynamicConfig), s_offchainConfigVersion, abi.encode("") + ); + } +} + +contract EVM2EVMOffRamp_metadataHash is EVM2EVMOffRampSetup { + function test_MetadataHash_Success() public view { + bytes32 h = s_offRamp.metadataHash(); + assertEq( + h, + keccak256( + abi.encode(Internal.EVM_2_EVM_MESSAGE_HASH, SOURCE_CHAIN_SELECTOR, DEST_CHAIN_SELECTOR, ON_RAMP_ADDRESS) + ) + ); + } +} + +contract EVM2EVMOffRamp_ccipReceive is EVM2EVMOffRampSetup { + // Reverts + + function test_Reverts() public { + Client.Any2EVMMessage memory message = _convertToGeneralMessage(_generateAny2EVMMessageNoTokens(1)); + vm.expectRevert(); + s_offRamp.ccipReceive(message); + } +} + +contract EVM2EVMOffRamp_execute is EVM2EVMOffRampSetup { + error PausedError(); + + function _generateMsgWithoutTokens( + uint256 gasLimit, + bytes memory messageData + ) internal view returns (Internal.EVM2EVMMessage memory) { + Internal.EVM2EVMMessage memory message = _generateAny2EVMMessageNoTokens(1); + message.gasLimit = gasLimit; + message.data = messageData; + message.messageId = Internal._hash( + message, + keccak256( + abi.encode(Internal.EVM_2_EVM_MESSAGE_HASH, SOURCE_CHAIN_SELECTOR, DEST_CHAIN_SELECTOR, ON_RAMP_ADDRESS) + ) + ); + return message; + } + + function test_Fuzz_trialExecuteWithoutTokens_Success(bytes4 funcSelector, bytes memory messageData) public { + vm.assume( + funcSelector != GenericReceiver.setRevert.selector && funcSelector != GenericReceiver.setErr.selector + && funcSelector != 0x5100fc21 && funcSelector != 0x00000000 // s_toRevert(), which is public and therefore has a function selector + ); + + // Convert bytes4 into bytes memory to use in the message + Internal.EVM2EVMMessage memory message = _generateMsgWithoutTokens(GAS_LIMIT, messageData); + + // Convert an Internal.EVM2EVMMessage into a Client.Any2EVMMessage digestable by the client + Client.Any2EVMMessage memory receivedMessage = _convertToGeneralMessage(message); + bytes memory expectedCallData = + abi.encodeWithSelector(MaybeRevertMessageReceiver.ccipReceive.selector, receivedMessage); + + vm.expectCall(address(s_receiver), expectedCallData); + (Internal.MessageExecutionState newState, bytes memory err) = + s_offRamp.trialExecute(message, new bytes[](message.tokenAmounts.length), new uint32[](0)); + assertEq(uint256(Internal.MessageExecutionState.SUCCESS), uint256(newState)); + assertEq("", err); + } + + function test_Fuzz_trialExecuteWithTokens_Success(uint16 tokenAmount, bytes calldata messageData) public { + vm.assume(tokenAmount != 0); + + uint256[] memory amounts = new uint256[](2); + amounts[0] = uint256(tokenAmount); + amounts[1] = uint256(tokenAmount); + + Internal.EVM2EVMMessage memory message = _generateAny2EVMMessageWithTokens(1, amounts); + message.data = messageData; + + IERC20 dstToken0 = IERC20(s_destTokens[0]); + uint256 startingBalance = dstToken0.balanceOf(message.receiver); + + vm.expectCall(address(dstToken0), abi.encodeWithSelector(IERC20.transfer.selector, address(s_receiver), amounts[0])); + + (Internal.MessageExecutionState newState, bytes memory err) = + s_offRamp.trialExecute(message, new bytes[](message.tokenAmounts.length), new uint32[](0)); + assertEq(uint256(Internal.MessageExecutionState.SUCCESS), uint256(newState)); + assertEq("", err); + + // Check that the tokens were transferred + assertEq(startingBalance + amounts[0], dstToken0.balanceOf(message.receiver)); + } + + function test_Fuzz_getSenderNonce(uint8 trialExecutions) public { + vm.assume(trialExecutions > 1); + + Internal.EVM2EVMMessage[] memory messages; + + if (trialExecutions == 1) { + messages = new Internal.EVM2EVMMessage[](1); + messages[0] = _generateAny2EVMMessageNoTokens(0); + } else { + messages = _generateSingleBasicMessage(); + } + + // Fuzz the number of calls from the sender to ensure that getSenderNonce works + for (uint256 i = 1; i < trialExecutions; ++i) { + s_offRamp.execute(_generateReportFromMessages(messages), new EVM2EVMOffRamp.GasLimitOverride[](0)); + + messages[0].nonce++; + messages[0].sequenceNumber++; + messages[0].messageId = Internal._hash(messages[0], s_offRamp.metadataHash()); + } + + messages[0].nonce = 0; + messages[0].sequenceNumber = 0; + messages[0].messageId = Internal._hash(messages[0], s_offRamp.metadataHash()); + s_offRamp.execute(_generateReportFromMessages(messages), new EVM2EVMOffRamp.GasLimitOverride[](0)); + + uint64 nonceBefore = s_offRamp.getSenderNonce(messages[0].sender); + s_offRamp.execute(_generateReportFromMessages(messages), new EVM2EVMOffRamp.GasLimitOverride[](0)); + assertEq(s_offRamp.getSenderNonce(messages[0].sender), nonceBefore, "sender nonce is not as expected"); + } + + function test_Fuzz_getSenderNonceWithPrevOffRamp_Success(uint8 trialExecutions) public { + vm.assume(trialExecutions > 1); + // Fuzz a random nonce for getSenderNonce + test_Fuzz_getSenderNonce(trialExecutions); + + address prevOffRamp = address(s_offRamp); + deployOffRamp(s_mockCommitStore, s_destRouter, prevOffRamp); + + // Make sure the off-ramp address has changed by querying the static config + assertNotEq(address(s_offRamp), prevOffRamp); + EVM2EVMOffRamp.StaticConfig memory staticConfig = s_offRamp.getStaticConfig(); + assertEq(staticConfig.prevOffRamp, prevOffRamp, "Previous offRamp does not match expected address"); + + // Since i_prevOffRamp != address(0) and senderNonce == 0, there should be a call to the previous offRamp + vm.expectCall(prevOffRamp, abi.encodeWithSelector(s_offRamp.getSenderNonce.selector, OWNER)); + uint256 currentSenderNonce = s_offRamp.getSenderNonce(OWNER); + assertNotEq(currentSenderNonce, 0, "Sender nonce should not be zero"); + assertEq(currentSenderNonce, trialExecutions - 1, "Sender Nonce does not match expected trial executions"); + + Internal.EVM2EVMMessage[] memory messages = _generateSingleBasicMessage(); + s_offRamp.execute(_generateReportFromMessages(messages), new EVM2EVMOffRamp.GasLimitOverride[](0)); + + currentSenderNonce = s_offRamp.getSenderNonce(OWNER); + assertEq(currentSenderNonce, trialExecutions - 1, "Sender Nonce on new offramp does not match expected executions"); + } + + function test_SingleMessageNoTokens_Success() public { + Internal.EVM2EVMMessage[] memory messages = _generateSingleBasicMessage(); + vm.expectEmit(); + emit EVM2EVMOffRamp.ExecutionStateChanged( + messages[0].sequenceNumber, messages[0].messageId, Internal.MessageExecutionState.SUCCESS, "" + ); + + s_offRamp.execute(_generateReportFromMessages(messages), new EVM2EVMOffRamp.GasLimitOverride[](0)); + + messages[0].nonce++; + messages[0].sequenceNumber++; + messages[0].messageId = Internal._hash(messages[0], s_offRamp.metadataHash()); + + vm.expectEmit(); + emit EVM2EVMOffRamp.ExecutionStateChanged( + messages[0].sequenceNumber, messages[0].messageId, Internal.MessageExecutionState.SUCCESS, "" + ); + + uint64 nonceBefore = s_offRamp.getSenderNonce(messages[0].sender); + s_offRamp.execute(_generateReportFromMessages(messages), new EVM2EVMOffRamp.GasLimitOverride[](0)); + assertGt(s_offRamp.getSenderNonce(messages[0].sender), nonceBefore); + } + + function test_SingleMessageNoTokensUnordered_Success() public { + Internal.EVM2EVMMessage[] memory messages = _generateSingleBasicMessage(); + messages[0].nonce = 0; + messages[0].messageId = Internal._hash(messages[0], s_offRamp.metadataHash()); + + vm.expectEmit(); + emit EVM2EVMOffRamp.ExecutionStateChanged( + messages[0].sequenceNumber, messages[0].messageId, Internal.MessageExecutionState.SUCCESS, "" + ); + + // Nonce never increments on unordered messages. + uint64 nonceBefore = s_offRamp.getSenderNonce(messages[0].sender); + s_offRamp.execute(_generateReportFromMessages(messages), new EVM2EVMOffRamp.GasLimitOverride[](0)); + assertEq( + s_offRamp.getSenderNonce(messages[0].sender), nonceBefore, "nonce must remain unchanged on unordered messages" + ); + + messages[0].sequenceNumber++; + messages[0].messageId = Internal._hash(messages[0], s_offRamp.metadataHash()); + + vm.expectEmit(); + emit EVM2EVMOffRamp.ExecutionStateChanged( + messages[0].sequenceNumber, messages[0].messageId, Internal.MessageExecutionState.SUCCESS, "" + ); + + // Nonce never increments on unordered messages. + nonceBefore = s_offRamp.getSenderNonce(messages[0].sender); + s_offRamp.execute(_generateReportFromMessages(messages), new EVM2EVMOffRamp.GasLimitOverride[](0)); + assertEq( + s_offRamp.getSenderNonce(messages[0].sender), nonceBefore, "nonce must remain unchanged on unordered messages" + ); + } + + function test_ReceiverError_Success() public { + Internal.EVM2EVMMessage[] memory messages = _generateSingleBasicMessage(); + + bytes memory realError1 = new bytes(2); + realError1[0] = 0xbe; + realError1[1] = 0xef; + s_reverting_receiver.setErr(realError1); + + messages[0].receiver = address(s_reverting_receiver); + messages[0].messageId = Internal._hash(messages[0], s_offRamp.metadataHash()); + + vm.expectEmit(); + emit EVM2EVMOffRamp.ExecutionStateChanged( + messages[0].sequenceNumber, + messages[0].messageId, + Internal.MessageExecutionState.FAILURE, + abi.encodeWithSelector( + EVM2EVMOffRamp.ReceiverError.selector, + abi.encodeWithSelector(MaybeRevertMessageReceiver.CustomError.selector, realError1) + ) + ); + // Nonce should increment on non-strict + assertEq(uint64(0), s_offRamp.getSenderNonce(address(OWNER))); + s_offRamp.execute(_generateReportFromMessages(messages), new EVM2EVMOffRamp.GasLimitOverride[](0)); + assertEq(uint64(1), s_offRamp.getSenderNonce(address(OWNER))); + } + + function test_StrictUntouchedToSuccess_Success() public { + Internal.EVM2EVMMessage[] memory messages = _generateSingleBasicMessage(); + + messages[0].strict = true; + messages[0].receiver = address(s_receiver); + messages[0].messageId = Internal._hash(messages[0], s_offRamp.metadataHash()); + + vm.expectEmit(); + emit EVM2EVMOffRamp.ExecutionStateChanged( + messages[0].sequenceNumber, messages[0].messageId, Internal.MessageExecutionState.SUCCESS, "" + ); + // Nonce should increment on a strict untouched -> success. + assertEq(uint64(0), s_offRamp.getSenderNonce(address(OWNER))); + s_offRamp.execute(_generateReportFromMessages(messages), new EVM2EVMOffRamp.GasLimitOverride[](0)); + assertEq(uint64(1), s_offRamp.getSenderNonce(address(OWNER))); + } + + function test_SkippedIncorrectNonce_Success() public { + Internal.EVM2EVMMessage[] memory messages = _generateSingleBasicMessage(); + + messages[0].nonce++; + messages[0].messageId = Internal._hash(messages[0], s_offRamp.metadataHash()); + + vm.expectEmit(); + emit EVM2EVMOffRamp.SkippedIncorrectNonce(messages[0].nonce, messages[0].sender); + + s_offRamp.execute(_generateReportFromMessages(messages), new EVM2EVMOffRamp.GasLimitOverride[](0)); + } + + function test_SkippedIncorrectNonceStillExecutes_Success() public { + Internal.EVM2EVMMessage[] memory messages = _generateMessagesWithTokens(); + + messages[1].nonce++; + messages[1].messageId = Internal._hash(messages[1], s_offRamp.metadataHash()); + + vm.expectEmit(); + emit EVM2EVMOffRamp.ExecutionStateChanged( + messages[0].sequenceNumber, messages[0].messageId, Internal.MessageExecutionState.SUCCESS, "" + ); + + vm.expectEmit(); + emit EVM2EVMOffRamp.SkippedIncorrectNonce(messages[1].nonce, messages[1].sender); + + s_offRamp.execute(_generateReportFromMessages(messages), new EVM2EVMOffRamp.GasLimitOverride[](0)); + } + + function test__execute_SkippedAlreadyExecutedMessage_Success() public { + Internal.EVM2EVMMessage[] memory messages = _generateSingleBasicMessage(); + + vm.expectEmit(); + emit EVM2EVMOffRamp.ExecutionStateChanged( + messages[0].sequenceNumber, messages[0].messageId, Internal.MessageExecutionState.SUCCESS, "" + ); + + s_offRamp.execute(_generateReportFromMessages(messages), new EVM2EVMOffRamp.GasLimitOverride[](0)); + + vm.expectEmit(); + emit EVM2EVMOffRamp.SkippedAlreadyExecutedMessage(messages[0].sequenceNumber); + + s_offRamp.execute(_generateReportFromMessages(messages), new EVM2EVMOffRamp.GasLimitOverride[](0)); + } + + function test__execute_SkippedAlreadyExecutedMessageUnordered_Success() public { + Internal.EVM2EVMMessage[] memory messages = _generateSingleBasicMessage(); + messages[0].nonce = 0; + messages[0].messageId = Internal._hash(messages[0], s_offRamp.metadataHash()); + + vm.expectEmit(); + emit EVM2EVMOffRamp.ExecutionStateChanged( + messages[0].sequenceNumber, messages[0].messageId, Internal.MessageExecutionState.SUCCESS, "" + ); + + s_offRamp.execute(_generateReportFromMessages(messages), new EVM2EVMOffRamp.GasLimitOverride[](0)); + + vm.expectEmit(); + emit EVM2EVMOffRamp.SkippedAlreadyExecutedMessage(messages[0].sequenceNumber); + + s_offRamp.execute(_generateReportFromMessages(messages), new EVM2EVMOffRamp.GasLimitOverride[](0)); + } + + // Send a message to a contract that does not implement the CCIPReceiver interface + // This should execute successfully. + function test_SingleMessageToNonCCIPReceiver_Success() public { + Internal.EVM2EVMMessage[] memory messages = _generateSingleBasicMessage(); + MaybeRevertMessageReceiverNo165 newReceiver = new MaybeRevertMessageReceiverNo165(true); + messages[0].receiver = address(newReceiver); + messages[0].messageId = Internal._hash(messages[0], s_offRamp.metadataHash()); + + vm.expectEmit(); + emit EVM2EVMOffRamp.ExecutionStateChanged( + messages[0].sequenceNumber, messages[0].messageId, Internal.MessageExecutionState.SUCCESS, "" + ); + + s_offRamp.execute(_generateReportFromMessages(messages), new EVM2EVMOffRamp.GasLimitOverride[](0)); + } + + function test_SingleMessagesNoTokensSuccess_gas() public { + vm.pauseGasMetering(); + Internal.EVM2EVMMessage[] memory messages = _generateSingleBasicMessage(); + + vm.expectEmit(); + emit EVM2EVMOffRamp.ExecutionStateChanged( + messages[0].sequenceNumber, messages[0].messageId, Internal.MessageExecutionState.SUCCESS, "" + ); + + Internal.ExecutionReport memory report = _generateReportFromMessages(messages); + + vm.resumeGasMetering(); + s_offRamp.execute(report, new EVM2EVMOffRamp.GasLimitOverride[](0)); + } + + function test_TwoMessagesWithTokensSuccess_gas() public { + vm.pauseGasMetering(); + Internal.EVM2EVMMessage[] memory messages = _generateMessagesWithTokens(); + // Set message 1 to use another receiver to simulate more fair gas costs + messages[1].receiver = address(s_secondary_receiver); + messages[1].messageId = Internal._hash(messages[1], s_offRamp.metadataHash()); + + vm.expectEmit(); + emit EVM2EVMOffRamp.ExecutionStateChanged( + messages[0].sequenceNumber, messages[0].messageId, Internal.MessageExecutionState.SUCCESS, "" + ); + + vm.expectEmit(); + emit EVM2EVMOffRamp.ExecutionStateChanged( + messages[1].sequenceNumber, messages[1].messageId, Internal.MessageExecutionState.SUCCESS, "" + ); + + Internal.ExecutionReport memory report = _generateReportFromMessages(messages); + + vm.resumeGasMetering(); + s_offRamp.execute(report, new EVM2EVMOffRamp.GasLimitOverride[](0)); + } + + function test_TwoMessagesWithTokensAndGE_Success() public { + Internal.EVM2EVMMessage[] memory messages = _generateMessagesWithTokens(); + // Set message 1 to use another receiver to simulate more fair gas costs + messages[1].receiver = address(s_secondary_receiver); + messages[1].messageId = Internal._hash(messages[1], s_offRamp.metadataHash()); + + vm.expectEmit(); + emit EVM2EVMOffRamp.ExecutionStateChanged( + messages[0].sequenceNumber, messages[0].messageId, Internal.MessageExecutionState.SUCCESS, "" + ); + + vm.expectEmit(); + emit EVM2EVMOffRamp.ExecutionStateChanged( + messages[1].sequenceNumber, messages[1].messageId, Internal.MessageExecutionState.SUCCESS, "" + ); + + assertEq(uint64(0), s_offRamp.getSenderNonce(OWNER)); + s_offRamp.execute(_generateReportFromMessages(messages), _getGasLimitsFromMessages(messages)); + assertEq(uint64(2), s_offRamp.getSenderNonce(OWNER)); + } + + function test_Fuzz_InterleavingOrderedAndUnorderedMessages_Success(bool[7] memory orderings) public { + Internal.EVM2EVMMessage[] memory messages = new Internal.EVM2EVMMessage[](orderings.length); + // number of tokens needs to be capped otherwise we hit UnsupportedNumberOfTokens. + Client.EVMTokenAmount[] memory tokenAmounts = new Client.EVMTokenAmount[](3); + for (uint256 i = 0; i < 3; ++i) { + tokenAmounts[i].token = s_sourceTokens[i % s_sourceTokens.length]; + tokenAmounts[i].amount = 1e18; + } + uint64 expectedNonce = 0; + for (uint256 i = 0; i < orderings.length; ++i) { + messages[i] = _generateAny2EVMMessage(uint64(i + 1), tokenAmounts, !orderings[i]); + if (orderings[i]) { + messages[i].nonce = ++expectedNonce; + } + messages[i].messageId = Internal._hash(messages[i], s_offRamp.metadataHash()); + + vm.expectEmit(); + emit EVM2EVMOffRamp.ExecutionStateChanged( + messages[i].sequenceNumber, messages[i].messageId, Internal.MessageExecutionState.SUCCESS, "" + ); + } + + uint64 nonceBefore = s_offRamp.getSenderNonce(OWNER); + assertEq(uint64(0), nonceBefore, "nonce before exec should be 0"); + s_offRamp.execute(_generateReportFromMessages(messages), _getGasLimitsFromMessages(messages)); + // all executions should succeed. + for (uint256 i = 0; i < orderings.length; ++i) { + assertEq( + uint256(s_offRamp.getExecutionState(messages[i].sequenceNumber)), + uint256(Internal.MessageExecutionState.SUCCESS) + ); + } + assertEq(nonceBefore + expectedNonce, s_offRamp.getSenderNonce(OWNER)); + } + + function test_InvalidSourcePoolAddress_Success() public { + address fakePoolAddress = address(0x0000000000333333); + + Internal.EVM2EVMMessage[] memory messages = _generateMessagesWithTokens(); + messages[0].sourceTokenData[0] = abi.encode( + Internal.SourceTokenData({ + sourcePoolAddress: abi.encode(fakePoolAddress), + destTokenAddress: abi.encode(s_destTokenBySourceToken[messages[0].tokenAmounts[0].token]), + extraData: "", + destGasAmount: DEFAULT_TOKEN_DEST_GAS_OVERHEAD + }) + ); + + messages[0].messageId = Internal._hash(messages[0], s_offRamp.metadataHash()); + messages[1].messageId = Internal._hash(messages[1], s_offRamp.metadataHash()); + + vm.expectEmit(); + emit EVM2EVMOffRamp.ExecutionStateChanged( + messages[0].sequenceNumber, + messages[0].messageId, + Internal.MessageExecutionState.FAILURE, + abi.encodeWithSelector( + EVM2EVMOffRamp.TokenHandlingError.selector, + abi.encodeWithSelector(TokenPool.InvalidSourcePoolAddress.selector, abi.encode(fakePoolAddress)) + ) + ); + + s_offRamp.execute(_generateReportFromMessages(messages), new EVM2EVMOffRamp.GasLimitOverride[](0)); + } + + function test_execute_RouterYULCall_Success() public { + Internal.EVM2EVMMessage[] memory messages = _generateSingleBasicMessage(); + + // gas limit too high, Router's external call should revert + messages[0].gasLimit = 1e36; + messages[0].receiver = address(new ConformingReceiver(address(s_destRouter), s_destFeeToken)); + messages[0].messageId = Internal._hash(messages[0], s_offRamp.metadataHash()); + + Internal.ExecutionReport memory executionReport = _generateReportFromMessages(messages); + + vm.expectEmit(); + emit EVM2EVMOffRamp.ExecutionStateChanged( + messages[0].sequenceNumber, + messages[0].messageId, + Internal.MessageExecutionState.FAILURE, + abi.encodeWithSelector(CallWithExactGas.NotEnoughGasForCall.selector) + ); + + s_offRamp.execute(executionReport, new EVM2EVMOffRamp.GasLimitOverride[](0)); + } + + function test_RetryFailedMessageWithoutManualExecution_Success() public { + Internal.EVM2EVMMessage[] memory messages = _generateSingleBasicMessage(); + + bytes memory realError1 = new bytes(2); + realError1[0] = 0xbe; + realError1[1] = 0xef; + s_reverting_receiver.setErr(realError1); + + messages[0].receiver = address(s_reverting_receiver); + messages[0].messageId = Internal._hash(messages[0], s_offRamp.metadataHash()); + + vm.expectEmit(); + emit EVM2EVMOffRamp.ExecutionStateChanged( + messages[0].sequenceNumber, + messages[0].messageId, + Internal.MessageExecutionState.FAILURE, + abi.encodeWithSelector( + EVM2EVMOffRamp.ReceiverError.selector, + abi.encodeWithSelector(MaybeRevertMessageReceiver.CustomError.selector, realError1) + ) + ); + s_offRamp.execute(_generateReportFromMessages(messages), new EVM2EVMOffRamp.GasLimitOverride[](0)); + + // The second time should skip the msg + vm.expectEmit(); + emit EVM2EVMOffRamp.AlreadyAttempted(messages[0].sequenceNumber); + + s_offRamp.execute(_generateReportFromMessages(messages), new EVM2EVMOffRamp.GasLimitOverride[](0)); + } + + // Reverts + + function test_InvalidMessageId_Revert() public { + Internal.EVM2EVMMessage[] memory messages = _generateSingleBasicMessage(); + messages[0].nonce++; + // MessageID no longer matches hash. + Internal.ExecutionReport memory executionReport = _generateReportFromMessages(messages); + vm.expectRevert(EVM2EVMOffRamp.InvalidMessageId.selector); + s_offRamp.execute(executionReport, new EVM2EVMOffRamp.GasLimitOverride[](0)); + } + + function test_Paused_Revert() public { + s_mockCommitStore.pause(); + vm.expectRevert(PausedError.selector); + s_offRamp.execute( + _generateReportFromMessages(_generateMessagesWithTokens()), new EVM2EVMOffRamp.GasLimitOverride[](0) + ); + } + + function test_Unhealthy_Revert() public { + s_mockRMN.setGlobalCursed(true); + vm.expectRevert(EVM2EVMOffRamp.CursedByRMN.selector); + s_offRamp.execute( + _generateReportFromMessages(_generateMessagesWithTokens()), new EVM2EVMOffRamp.GasLimitOverride[](0) + ); + // Uncurse should succeed + s_mockRMN.setGlobalCursed(false); + s_offRamp.execute( + _generateReportFromMessages(_generateMessagesWithTokens()), new EVM2EVMOffRamp.GasLimitOverride[](0) + ); + } + + function test_UnexpectedTokenData_Revert() public { + Internal.ExecutionReport memory report = _generateReportFromMessages(_generateSingleBasicMessage()); + report.offchainTokenData = new bytes[][](report.messages.length + 1); + + vm.expectRevert(EVM2EVMOffRamp.UnexpectedTokenData.selector); + + s_offRamp.execute(report, new EVM2EVMOffRamp.GasLimitOverride[](0)); + } + + function test_EmptyReport_Revert() public { + vm.expectRevert(EVM2EVMOffRamp.EmptyReport.selector); + s_offRamp.execute( + Internal.ExecutionReport({ + proofs: new bytes32[](0), + proofFlagBits: 0, + messages: new Internal.EVM2EVMMessage[](0), + offchainTokenData: new bytes[][](0) + }), + new EVM2EVMOffRamp.GasLimitOverride[](0) + ); + } + + function test_RootNotCommitted_Revert() public { + vm.mockCall(address(s_mockCommitStore), abi.encodeWithSelector(ICommitStore.verify.selector), abi.encode(0)); + vm.expectRevert(EVM2EVMOffRamp.RootNotCommitted.selector); + + Internal.EVM2EVMMessage[] memory messages = _generateSingleBasicMessage(); + s_offRamp.execute(_generateReportFromMessages(messages), _getGasLimitsFromMessages(messages)); + vm.clearMockedCalls(); + } + + function test_ManualExecutionNotYetEnabled_Revert() public { + vm.mockCall( + address(s_mockCommitStore), abi.encodeWithSelector(ICommitStore.verify.selector), abi.encode(BLOCK_TIME) + ); + vm.expectRevert(EVM2EVMOffRamp.ManualExecutionNotYetEnabled.selector); + + Internal.EVM2EVMMessage[] memory messages = _generateSingleBasicMessage(); + s_offRamp.execute(_generateReportFromMessages(messages), _getGasLimitsFromMessages(messages)); + vm.clearMockedCalls(); + } + + function test_InvalidSourceChain_Revert() public { + Internal.EVM2EVMMessage[] memory messages = _generateSingleBasicMessage(); + messages[0].sourceChainSelector = SOURCE_CHAIN_SELECTOR + 1; + messages[0].messageId = Internal._hash(messages[0], s_offRamp.metadataHash()); + + vm.expectRevert(abi.encodeWithSelector(EVM2EVMOffRamp.InvalidSourceChain.selector, SOURCE_CHAIN_SELECTOR + 1)); + s_offRamp.execute(_generateReportFromMessages(messages), new EVM2EVMOffRamp.GasLimitOverride[](0)); + } + + function test_UnsupportedNumberOfTokens_Revert() public { + Internal.EVM2EVMMessage[] memory messages = _generateSingleBasicMessage(); + Client.EVMTokenAmount[] memory newTokens = new Client.EVMTokenAmount[](MAX_TOKENS_LENGTH + 1); + messages[0].tokenAmounts = newTokens; + messages[0].messageId = Internal._hash(messages[0], s_offRamp.metadataHash()); + Internal.ExecutionReport memory report = _generateReportFromMessages(messages); + + vm.expectRevert( + abi.encodeWithSelector(EVM2EVMOffRamp.UnsupportedNumberOfTokens.selector, messages[0].sequenceNumber) + ); + s_offRamp.execute(report, new EVM2EVMOffRamp.GasLimitOverride[](0)); + } + + function test_TokenDataMismatch_Revert() public { + Internal.EVM2EVMMessage[] memory messages = _generateSingleBasicMessage(); + Internal.ExecutionReport memory report = _generateReportFromMessages(messages); + + report.offchainTokenData[0] = new bytes[](messages[0].tokenAmounts.length + 1); + + vm.expectRevert(abi.encodeWithSelector(EVM2EVMOffRamp.TokenDataMismatch.selector, messages[0].sequenceNumber)); + s_offRamp.execute(report, new EVM2EVMOffRamp.GasLimitOverride[](0)); + } + + function test_MessageTooLarge_Revert() public { + Internal.EVM2EVMMessage[] memory messages = _generateSingleBasicMessage(); + messages[0].data = new bytes(MAX_DATA_SIZE + 1); + messages[0].messageId = Internal._hash(messages[0], s_offRamp.metadataHash()); + + Internal.ExecutionReport memory executionReport = _generateReportFromMessages(messages); + vm.expectRevert( + abi.encodeWithSelector(EVM2EVMOffRamp.MessageTooLarge.selector, MAX_DATA_SIZE, messages[0].data.length) + ); + s_offRamp.execute(executionReport, new EVM2EVMOffRamp.GasLimitOverride[](0)); + } +} + +contract EVM2EVMOffRamp_execute_upgrade is EVM2EVMOffRampSetup { + EVM2EVMOffRampHelper internal s_prevOffRamp; + + function setUp() public virtual override { + super.setUp(); + + s_prevOffRamp = s_offRamp; + + deployOffRamp(s_mockCommitStore, s_destRouter, address(s_prevOffRamp)); + } + + function test_V2_Success() public { + Internal.EVM2EVMMessage[] memory messages = _generateSingleBasicMessage(); + vm.expectEmit(); + emit EVM2EVMOffRamp.ExecutionStateChanged( + messages[0].sequenceNumber, messages[0].messageId, Internal.MessageExecutionState.SUCCESS, "" + ); + + s_offRamp.execute(_generateReportFromMessages(messages), new EVM2EVMOffRamp.GasLimitOverride[](0)); + } + + function test_V2SenderNoncesReadsPreviousRamp_Success() public { + Internal.EVM2EVMMessage[] memory messages = _generateSingleBasicMessage(); + uint64 startNonce = s_offRamp.getSenderNonce(messages[0].sender); + + for (uint64 i = 1; i < 4; ++i) { + s_prevOffRamp.execute(_generateReportFromMessages(messages), new EVM2EVMOffRamp.GasLimitOverride[](0)); + + messages[0].nonce++; + messages[0].sequenceNumber++; + messages[0].messageId = Internal._hash(messages[0], s_offRamp.metadataHash()); + + assertEq(startNonce + i, s_offRamp.getSenderNonce(messages[0].sender)); + } + } + + function test_V2NonceStartsAtV1Nonce_Success() public { + Internal.EVM2EVMMessage[] memory messages = _generateSingleBasicMessage(); + vm.expectEmit(); + emit EVM2EVMOffRamp.ExecutionStateChanged( + messages[0].sequenceNumber, messages[0].messageId, Internal.MessageExecutionState.SUCCESS, "" + ); + + uint64 startNonce = s_offRamp.getSenderNonce(messages[0].sender); + + s_prevOffRamp.execute(_generateReportFromMessages(messages), new EVM2EVMOffRamp.GasLimitOverride[](0)); + + assertEq(startNonce + 1, s_offRamp.getSenderNonce(messages[0].sender)); + + messages[0].nonce++; + messages[0].messageId = Internal._hash(messages[0], s_offRamp.metadataHash()); + + vm.expectEmit(); + emit EVM2EVMOffRamp.ExecutionStateChanged( + messages[0].sequenceNumber, messages[0].messageId, Internal.MessageExecutionState.SUCCESS, "" + ); + + s_offRamp.execute(_generateReportFromMessages(messages), new EVM2EVMOffRamp.GasLimitOverride[](0)); + assertEq(startNonce + 2, s_offRamp.getSenderNonce(messages[0].sender)); + + messages[0].nonce++; + messages[0].sequenceNumber++; + messages[0].messageId = Internal._hash(messages[0], s_offRamp.metadataHash()); + + vm.expectEmit(); + emit EVM2EVMOffRamp.ExecutionStateChanged( + messages[0].sequenceNumber, messages[0].messageId, Internal.MessageExecutionState.SUCCESS, "" + ); + + s_offRamp.execute(_generateReportFromMessages(messages), new EVM2EVMOffRamp.GasLimitOverride[](0)); + assertEq(startNonce + 3, s_offRamp.getSenderNonce(messages[0].sender)); + } + + function test_V2NonceNewSenderStartsAtZero_Success() public { + Internal.EVM2EVMMessage[] memory messages = _generateSingleBasicMessage(); + vm.expectEmit(); + emit EVM2EVMOffRamp.ExecutionStateChanged( + messages[0].sequenceNumber, messages[0].messageId, Internal.MessageExecutionState.SUCCESS, "" + ); + + s_prevOffRamp.execute(_generateReportFromMessages(messages), new EVM2EVMOffRamp.GasLimitOverride[](0)); + + address newSender = address(1234567); + messages[0].sender = newSender; + messages[0].messageId = Internal._hash(messages[0], s_offRamp.metadataHash()); + + vm.expectEmit(); + emit EVM2EVMOffRamp.ExecutionStateChanged( + messages[0].sequenceNumber, messages[0].messageId, Internal.MessageExecutionState.SUCCESS, "" + ); + + // new sender nonce in new offramp should go from 0 -> 1 + assertEq(s_offRamp.getSenderNonce(newSender), 0); + s_offRamp.execute(_generateReportFromMessages(messages), new EVM2EVMOffRamp.GasLimitOverride[](0)); + assertEq(s_offRamp.getSenderNonce(newSender), 1); + } + + function test_V2OffRampNonceSkipsIfMsgInFlight_Success() public { + Internal.EVM2EVMMessage[] memory messages = _generateSingleBasicMessage(); + + address newSender = address(1234567); + messages[0].sender = newSender; + messages[0].nonce = 2; + messages[0].messageId = Internal._hash(messages[0], s_offRamp.metadataHash()); + + uint64 startNonce = s_offRamp.getSenderNonce(messages[0].sender); + + // new offramp sees msg nonce higher than senderNonce + // it waits for previous offramp to execute + vm.expectEmit(); + emit EVM2EVMOffRamp.SkippedSenderWithPreviousRampMessageInflight(messages[0].nonce, newSender); + s_offRamp.execute(_generateReportFromMessages(messages), new EVM2EVMOffRamp.GasLimitOverride[](0)); + assertEq(startNonce, s_offRamp.getSenderNonce(messages[0].sender)); + + messages[0].nonce = 1; + messages[0].messageId = Internal._hash(messages[0], s_offRamp.metadataHash()); + + // previous offramp executes msg and increases nonce + vm.expectEmit(); + emit EVM2EVMOffRamp.ExecutionStateChanged( + messages[0].sequenceNumber, messages[0].messageId, Internal.MessageExecutionState.SUCCESS, "" + ); + s_prevOffRamp.execute(_generateReportFromMessages(messages), new EVM2EVMOffRamp.GasLimitOverride[](0)); + assertEq(startNonce + 1, s_offRamp.getSenderNonce(messages[0].sender)); + + messages[0].nonce = 2; + messages[0].messageId = Internal._hash(messages[0], s_offRamp.metadataHash()); + + // new offramp is able to execute + vm.expectEmit(); + emit EVM2EVMOffRamp.ExecutionStateChanged( + messages[0].sequenceNumber, messages[0].messageId, Internal.MessageExecutionState.SUCCESS, "" + ); + + s_offRamp.execute(_generateReportFromMessages(messages), new EVM2EVMOffRamp.GasLimitOverride[](0)); + assertEq(startNonce + 2, s_offRamp.getSenderNonce(messages[0].sender)); + } +} + +contract EVM2EVMOffRamp_executeSingleMessage is EVM2EVMOffRampSetup { + function setUp() public virtual override { + super.setUp(); + vm.startPrank(address(s_offRamp)); + } + + function test_executeSingleMessage_NoTokens_Success() public { + Internal.EVM2EVMMessage memory message = _generateAny2EVMMessageNoTokens(1); + s_offRamp.executeSingleMessage(message, new bytes[](message.tokenAmounts.length), new uint32[](0)); + } + + function test_executeSingleMessage_WithTokens_Success() public { + Internal.EVM2EVMMessage memory message = _generateMessagesWithTokens()[0]; + bytes[] memory offchainTokenData = new bytes[](message.tokenAmounts.length); + Internal.SourceTokenData memory sourceTokenData = abi.decode(message.sourceTokenData[0], (Internal.SourceTokenData)); + + vm.expectCall( + s_destPoolByToken[s_destTokens[0]], + abi.encodeWithSelector( + LockReleaseTokenPool.releaseOrMint.selector, + Pool.ReleaseOrMintInV1({ + originalSender: abi.encode(message.sender), + receiver: message.receiver, + amount: message.tokenAmounts[0].amount, + localToken: s_destTokenBySourceToken[message.tokenAmounts[0].token], + remoteChainSelector: SOURCE_CHAIN_SELECTOR, + sourcePoolAddress: sourceTokenData.sourcePoolAddress, + sourcePoolData: sourceTokenData.extraData, + offchainTokenData: "" + }) + ) + ); + + s_offRamp.executeSingleMessage(message, offchainTokenData, new uint32[](0)); + } + + function test_executeSingleMessage_ZeroGasZeroData_Success() public { + uint256 gasLimit = 0; + Internal.EVM2EVMMessage memory message = _generateMsgWithoutTokens(gasLimit); + Client.Any2EVMMessage memory receiverMsg = _convertToGeneralMessage(message); + + // expect 0 calls to be made as no gas is provided + vm.expectCall( + address(s_destRouter), + abi.encodeCall(Router.routeMessage, (receiverMsg, Internal.GAS_FOR_CALL_EXACT_CHECK, gasLimit, message.receiver)), + 0 + ); + + s_offRamp.executeSingleMessage(message, new bytes[](message.tokenAmounts.length), new uint32[](0)); + + // Ensure we encoded it properly, and didn't simply expect the wrong call + gasLimit = 200_000; + message = _generateMsgWithoutTokens(gasLimit); + receiverMsg = _convertToGeneralMessage(message); + + vm.expectCall( + address(s_destRouter), + abi.encodeCall(Router.routeMessage, (receiverMsg, Internal.GAS_FOR_CALL_EXACT_CHECK, gasLimit, message.receiver)), + 1 + ); + + s_offRamp.executeSingleMessage(message, new bytes[](message.tokenAmounts.length), new uint32[](0)); + } + + function _generateMsgWithoutTokens(uint256 gasLimit) internal view returns (Internal.EVM2EVMMessage memory) { + Internal.EVM2EVMMessage memory message = _generateAny2EVMMessageNoTokens(1); + message.gasLimit = gasLimit; + message.data = ""; + message.messageId = Internal._hash( + message, + keccak256( + abi.encode(Internal.EVM_2_EVM_MESSAGE_HASH, SOURCE_CHAIN_SELECTOR, DEST_CHAIN_SELECTOR, ON_RAMP_ADDRESS) + ) + ); + return message; + } + + function test_NonContract_Success() public { + Internal.EVM2EVMMessage memory message = _generateAny2EVMMessageNoTokens(1); + message.receiver = STRANGER; + s_offRamp.executeSingleMessage(message, new bytes[](message.tokenAmounts.length), new uint32[](0)); + } + + function test_NonContractWithTokens_Success() public { + uint256[] memory amounts = new uint256[](2); + amounts[0] = 1000; + amounts[1] = 50; + vm.expectEmit(); + emit TokenPool.Released(address(s_offRamp), STRANGER, amounts[0]); + vm.expectEmit(); + emit TokenPool.Minted(address(s_offRamp), STRANGER, amounts[1]); + Internal.EVM2EVMMessage memory message = _generateAny2EVMMessageWithTokens(1, amounts); + message.receiver = STRANGER; + s_offRamp.executeSingleMessage(message, new bytes[](message.tokenAmounts.length), new uint32[](0)); + } + + // Reverts + + function test_TokenHandlingError_Revert() public { + uint256[] memory amounts = new uint256[](2); + amounts[0] = 1000; + amounts[1] = 50; + + bytes memory errorMessage = "Random token pool issue"; + + Internal.EVM2EVMMessage memory message = _generateAny2EVMMessageWithTokens(1, amounts); + s_maybeRevertingPool.setShouldRevert(errorMessage); + + vm.expectRevert(abi.encodeWithSelector(EVM2EVMOffRamp.TokenHandlingError.selector, errorMessage)); + + s_offRamp.executeSingleMessage(message, new bytes[](message.tokenAmounts.length), new uint32[](0)); + } + + function test_ZeroGasDONExecution_Revert() public { + Internal.EVM2EVMMessage memory message = _generateAny2EVMMessageNoTokens(1); + message.gasLimit = 0; + + vm.expectRevert(abi.encodeWithSelector(EVM2EVMOffRamp.ReceiverError.selector, "")); + + s_offRamp.executeSingleMessage(message, new bytes[](message.tokenAmounts.length), new uint32[](0)); + } + + function test_MessageSender_Revert() public { + vm.stopPrank(); + Internal.EVM2EVMMessage memory message = _generateAny2EVMMessageNoTokens(1); + vm.expectRevert(EVM2EVMOffRamp.CanOnlySelfCall.selector); + s_offRamp.executeSingleMessage(message, new bytes[](message.tokenAmounts.length), new uint32[](0)); + } +} + +contract EVM2EVMOffRamp__report is EVM2EVMOffRampSetup { + // Asserts that execute completes + function test_Report_Success() public { + Internal.EVM2EVMMessage[] memory messages = _generateSingleBasicMessage(); + Internal.ExecutionReport memory report = _generateReportFromMessages(messages); + + vm.expectEmit(); + emit EVM2EVMOffRamp.ExecutionStateChanged( + messages[0].sequenceNumber, messages[0].messageId, Internal.MessageExecutionState.SUCCESS, "" + ); + s_offRamp.report(abi.encode(report)); + } +} + +contract EVM2EVMOffRamp_manuallyExecute is EVM2EVMOffRampSetup { + function test_ManualExec_Success() public { + Internal.EVM2EVMMessage[] memory messages = _generateSingleBasicMessage(); + messages[0].receiver = address(s_reverting_receiver); + messages[0].messageId = Internal._hash(messages[0], s_offRamp.metadataHash()); + s_offRamp.execute(_generateReportFromMessages(messages), new EVM2EVMOffRamp.GasLimitOverride[](0)); + + s_reverting_receiver.setRevert(false); + + vm.expectEmit(); + emit EVM2EVMOffRamp.ExecutionStateChanged( + messages[0].sequenceNumber, messages[0].messageId, Internal.MessageExecutionState.SUCCESS, "" + ); + s_offRamp.manuallyExecute( + _generateReportFromMessages(messages), new EVM2EVMOffRamp.GasLimitOverride[](messages.length) + ); + } + + function test_ManualExecWithSourceTokens_Success() public { + Internal.EVM2EVMMessage[] memory messages = _generateSingleBasicMessageWithTokens(); + messages[0].receiver = address(s_reverting_receiver); + messages[0].messageId = Internal._hash(messages[0], s_offRamp.metadataHash()); + + s_reverting_receiver.setRevert(false); + + vm.expectEmit(); + emit EVM2EVMOffRamp.ExecutionStateChanged( + messages[0].sequenceNumber, messages[0].messageId, Internal.MessageExecutionState.SUCCESS, "" + ); + EVM2EVMOffRamp.GasLimitOverride[] memory gasLimitOverrides = _getGasLimitsFromMessages(messages); + s_offRamp.manuallyExecute(_generateReportFromMessages(messages), gasLimitOverrides); + } + + function test_ManualExecWithMultipleMessagesAndSourceTokens_Success() public { + Internal.EVM2EVMMessage[] memory messages = _generateMessagesWithTokens(); + messages[0].receiver = address(s_reverting_receiver); + messages[0].messageId = Internal._hash(messages[0], s_offRamp.metadataHash()); + messages[1].receiver = address(s_reverting_receiver); + messages[1].messageId = Internal._hash(messages[1], s_offRamp.metadataHash()); + + s_reverting_receiver.setRevert(false); + + vm.expectEmit(); + emit EVM2EVMOffRamp.ExecutionStateChanged( + messages[0].sequenceNumber, messages[0].messageId, Internal.MessageExecutionState.SUCCESS, "" + ); + emit EVM2EVMOffRamp.ExecutionStateChanged( + messages[1].sequenceNumber, messages[1].messageId, Internal.MessageExecutionState.SUCCESS, "" + ); + EVM2EVMOffRamp.GasLimitOverride[] memory gasLimitOverrides = _getGasLimitsFromMessages(messages); + s_offRamp.manuallyExecute(_generateReportFromMessages(messages), gasLimitOverrides); + } + + function test_manuallyExecute_DoesNotRevertIfUntouched_Success() public { + Internal.EVM2EVMMessage[] memory messages = _generateSingleBasicMessage(); + messages[0].receiver = address(s_reverting_receiver); + messages[0].messageId = Internal._hash(messages[0], s_offRamp.metadataHash()); + + assertEq(messages[0].nonce - 1, s_offRamp.getSenderNonce(messages[0].sender)); + + s_reverting_receiver.setRevert(true); + + vm.expectEmit(); + emit EVM2EVMOffRamp.ExecutionStateChanged( + messages[0].sequenceNumber, + messages[0].messageId, + Internal.MessageExecutionState.FAILURE, + abi.encodeWithSelector( + EVM2EVMOffRamp.ReceiverError.selector, + abi.encodeWithSelector(MaybeRevertMessageReceiver.CustomError.selector, "") + ) + ); + + s_offRamp.manuallyExecute( + _generateReportFromMessages(messages), new EVM2EVMOffRamp.GasLimitOverride[](messages.length) + ); + + assertEq(messages[0].nonce, s_offRamp.getSenderNonce(messages[0].sender)); + } + + function test_manuallyExecute_WithGasOverride_Success() public { + Internal.EVM2EVMMessage[] memory messages = _generateSingleBasicMessage(); + messages[0].receiver = address(s_reverting_receiver); + messages[0].messageId = Internal._hash(messages[0], s_offRamp.metadataHash()); + s_offRamp.execute(_generateReportFromMessages(messages), new EVM2EVMOffRamp.GasLimitOverride[](messages.length)); + + s_reverting_receiver.setRevert(false); + + vm.expectEmit(); + emit EVM2EVMOffRamp.ExecutionStateChanged( + messages[0].sequenceNumber, messages[0].messageId, Internal.MessageExecutionState.SUCCESS, "" + ); + + EVM2EVMOffRamp.GasLimitOverride[] memory gasLimitOverrides = _getGasLimitsFromMessages(messages); + gasLimitOverrides[0].receiverExecutionGasLimit += 1; + + s_offRamp.manuallyExecute(_generateReportFromMessages(messages), gasLimitOverrides); + } + + function test_manuallyExecute_WithInvalidSourceTokenDataCount_Revert() public { + uint256 messageIndex = 0; + + Internal.EVM2EVMMessage[] memory messages = _generateSingleBasicMessageWithTokens(); + messages[messageIndex].receiver = address(s_reverting_receiver); + messages[messageIndex].messageId = Internal._hash(messages[messageIndex], s_offRamp.metadataHash()); + + EVM2EVMOffRamp.GasLimitOverride[] memory gasLimitOverrides = _getGasLimitsFromMessages(messages); + + messages[messageIndex].sourceTokenData = new bytes[](0); + + vm.expectRevert(stdError.indexOOBError); + s_offRamp.manuallyExecute(_generateReportFromMessages(messages), gasLimitOverrides); + } + + function test_manuallyExecute_WithInvalidReceiverExecutionGasOverride_Revert() public { + uint256 messageIndex = 0; + + Internal.EVM2EVMMessage[] memory messages = _generateSingleBasicMessage(); + messages[messageIndex].receiver = address(s_reverting_receiver); + messages[messageIndex].messageId = Internal._hash(messages[messageIndex], s_offRamp.metadataHash()); + s_offRamp.execute(_generateReportFromMessages(messages), new EVM2EVMOffRamp.GasLimitOverride[](messages.length)); + + s_reverting_receiver.setRevert(false); + EVM2EVMOffRamp.GasLimitOverride[] memory gasLimitOverrides = _getGasLimitsFromMessages(messages); + gasLimitOverrides[messageIndex].receiverExecutionGasLimit -= 1; + + vm.expectRevert( + abi.encodeWithSelector( + EVM2EVMOffRamp.InvalidManualExecutionGasLimit.selector, + messages[messageIndex].messageId, + messages[messageIndex].gasLimit, + gasLimitOverrides[messageIndex].receiverExecutionGasLimit + ) + ); + + s_offRamp.manuallyExecute(_generateReportFromMessages(messages), gasLimitOverrides); + } + + function test_manuallyExecute_LowGasLimitManualExec_Success() public { + uint256 messageIndex = 0; + + Internal.EVM2EVMMessage[] memory messages = _generateSingleBasicMessage(); + messages[messageIndex].gasLimit = 1; + messages[messageIndex].receiver = address(new ConformingReceiver(address(s_destRouter), s_destFeeToken)); + messages[messageIndex].messageId = Internal._hash(messages[messageIndex], s_offRamp.metadataHash()); + + vm.expectEmit(); + emit EVM2EVMOffRamp.ExecutionStateChanged( + messages[messageIndex].sequenceNumber, + messages[messageIndex].messageId, + Internal.MessageExecutionState.FAILURE, + abi.encodeWithSelector(EVM2EVMOffRamp.ReceiverError.selector, "") + ); + s_offRamp.execute(_generateReportFromMessages(messages), new EVM2EVMOffRamp.GasLimitOverride[](0)); + + EVM2EVMOffRamp.GasLimitOverride[] memory gasLimitOverrides = new EVM2EVMOffRamp.GasLimitOverride[](1); + gasLimitOverrides[messageIndex].receiverExecutionGasLimit = 100_000; + + vm.expectEmit(); + emit MaybeRevertMessageReceiver.MessageReceived(); + + vm.expectEmit(); + emit EVM2EVMOffRamp.ExecutionStateChanged( + messages[messageIndex].sequenceNumber, + messages[messageIndex].messageId, + Internal.MessageExecutionState.SUCCESS, + "" + ); + s_offRamp.manuallyExecute(_generateReportFromMessages(messages), gasLimitOverrides); + } + + function test_ReentrancyManualExecuteFails_Success() public { + uint256 tokenAmount = 1e9; + IERC20 tokenToAbuse = IERC20(s_destFeeToken); + + // This needs to be deployed before the source chain message is sent + // because we need the address for the receiver. + ReentrancyAbuser receiver = new ReentrancyAbuser(address(s_destRouter), s_offRamp); + uint256 balancePre = tokenToAbuse.balanceOf(address(receiver)); + + // For this test any message will be flagged as correct by the + // commitStore. In a real scenario the abuser would have to actually + // send the message that they want to replay. + Internal.EVM2EVMMessage[] memory messages = _generateSingleBasicMessage(); + messages[0].tokenAmounts = new Client.EVMTokenAmount[](1); + messages[0].tokenAmounts[0] = Client.EVMTokenAmount({token: s_sourceFeeToken, amount: tokenAmount}); + messages[0].receiver = address(receiver); + messages[0].sourceTokenData = new bytes[](1); + messages[0].sourceTokenData[0] = abi.encode( + Internal.SourceTokenData({ + sourcePoolAddress: abi.encode(s_sourcePoolByToken[s_sourceFeeToken]), + destTokenAddress: abi.encode(s_destTokenBySourceToken[s_sourceFeeToken]), + extraData: "", + destGasAmount: DEFAULT_TOKEN_DEST_GAS_OVERHEAD + }) + ); + + messages[0].messageId = Internal._hash(messages[0], s_offRamp.metadataHash()); + + Internal.ExecutionReport memory report = _generateReportFromMessages(messages); + + // sets the report to be repeated on the ReentrancyAbuser to be able to replay + receiver.setPayload(report); + + // The first entry should be fine and triggers the second entry which is skipped. Due to the reentrancy + // the second completes first, so we expect the skip event before the success event. + vm.expectEmit(); + emit EVM2EVMOffRamp.SkippedAlreadyExecutedMessage(messages[0].sequenceNumber); + + vm.expectEmit(); + emit EVM2EVMOffRamp.ExecutionStateChanged( + messages[0].sequenceNumber, messages[0].messageId, Internal.MessageExecutionState.SUCCESS, "" + ); + + EVM2EVMOffRamp.GasLimitOverride[] memory gasLimits = _getGasLimitsFromMessages(messages); + s_offRamp.manuallyExecute(report, gasLimits); + + // Assert that they only got the tokens once, not twice + assertEq(tokenToAbuse.balanceOf(address(receiver)), balancePre + tokenAmount); + } + + function test_manuallyExecute_InvalidTokenGasOverride_Revert() public { + uint256 failingMessageIndex = 0; + uint256 failingTokenIndex = 0; + + Internal.EVM2EVMMessage[] memory messages = _generateSingleBasicMessageWithTokens(); + messages[failingMessageIndex].receiver = address(s_reverting_receiver); + messages[failingMessageIndex].messageId = Internal._hash(messages[failingMessageIndex], s_offRamp.metadataHash()); + s_offRamp.execute(_generateReportFromMessages(messages), new EVM2EVMOffRamp.GasLimitOverride[](messages.length)); + + s_reverting_receiver.setRevert(false); + EVM2EVMOffRamp.GasLimitOverride[] memory gasLimitOverrides = _getGasLimitsFromMessages(messages); + gasLimitOverrides[failingMessageIndex].tokenGasOverrides[failingTokenIndex] -= 2; + + vm.expectRevert( + abi.encodeWithSelector( + EVM2EVMOffRamp.InvalidTokenGasOverride.selector, + messages[failingMessageIndex].messageId, + failingTokenIndex, + DEFAULT_TOKEN_DEST_GAS_OVERHEAD, + gasLimitOverrides[failingMessageIndex].tokenGasOverrides[failingTokenIndex] + ) + ); + + s_offRamp.manuallyExecute(_generateReportFromMessages(messages), gasLimitOverrides); + } + + function test_manuallyExecute_DestinationGasAmountCountMismatch_Revert() public { + Internal.EVM2EVMMessage[] memory messages = _generateSingleBasicMessageWithTokens(); + messages[0].receiver = address(s_reverting_receiver); + messages[0].messageId = Internal._hash(messages[0], s_offRamp.metadataHash()); + s_offRamp.execute(_generateReportFromMessages(messages), new EVM2EVMOffRamp.GasLimitOverride[](messages.length)); + + s_reverting_receiver.setRevert(false); + EVM2EVMOffRamp.GasLimitOverride[] memory gasLimitOverrides = _getGasLimitsFromMessages(messages); + gasLimitOverrides[0].tokenGasOverrides = new uint32[](0); + + vm.expectRevert( + abi.encodeWithSelector(EVM2EVMOffRamp.DestinationGasAmountCountMismatch.selector, messages[0].messageId, 1) + ); + + s_offRamp.manuallyExecute(_generateReportFromMessages(messages), gasLimitOverrides); + } + + function test_ManualExecForkedChain_Revert() public { + Internal.EVM2EVMMessage[] memory messages = _generateSingleBasicMessage(); + + Internal.ExecutionReport memory report = _generateReportFromMessages(messages); + uint256 chain1 = block.chainid; + uint256 chain2 = chain1 + 1; + vm.chainId(chain2); + vm.expectRevert(abi.encodeWithSelector(OCR2BaseNoChecks.ForkedChain.selector, chain1, chain2)); + + s_offRamp.manuallyExecute(report, _getGasLimitsFromMessages(messages)); + } + + function test_ManualExecGasLimitMismatch_Revert() public { + Internal.EVM2EVMMessage[] memory messages = _generateSingleBasicMessage(); + + vm.expectRevert(EVM2EVMOffRamp.ManualExecutionGasLimitMismatch.selector); + s_offRamp.manuallyExecute(_generateReportFromMessages(messages), new EVM2EVMOffRamp.GasLimitOverride[](0)); + + vm.expectRevert(EVM2EVMOffRamp.ManualExecutionGasLimitMismatch.selector); + s_offRamp.manuallyExecute( + _generateReportFromMessages(messages), new EVM2EVMOffRamp.GasLimitOverride[](messages.length - 1) + ); + + vm.expectRevert(EVM2EVMOffRamp.ManualExecutionGasLimitMismatch.selector); + s_offRamp.manuallyExecute( + _generateReportFromMessages(messages), new EVM2EVMOffRamp.GasLimitOverride[](messages.length + 1) + ); + } + + function test_ManualExecInvalidGasLimit_Revert() public { + uint256 messageIndex = 0; + + Internal.EVM2EVMMessage[] memory messages = _generateSingleBasicMessage(); + EVM2EVMOffRamp.GasLimitOverride[] memory gasLimits = _getGasLimitsFromMessages(messages); + gasLimits[messageIndex].receiverExecutionGasLimit -= 1; + + vm.expectRevert( + abi.encodeWithSelector( + EVM2EVMOffRamp.InvalidManualExecutionGasLimit.selector, + messages[messageIndex].messageId, + messages[messageIndex].gasLimit, + gasLimits[messageIndex].receiverExecutionGasLimit + ) + ); + s_offRamp.manuallyExecute(_generateReportFromMessages(messages), gasLimits); + } + + function test_ManualExecFailedTx_Revert() public { + Internal.EVM2EVMMessage[] memory messages = _generateSingleBasicMessage(); + + messages[0].receiver = address(s_reverting_receiver); + messages[0].messageId = Internal._hash(messages[0], s_offRamp.metadataHash()); + + s_offRamp.execute(_generateReportFromMessages(messages), new EVM2EVMOffRamp.GasLimitOverride[](0)); + + s_reverting_receiver.setRevert(true); + + vm.expectRevert( + abi.encodeWithSelector( + EVM2EVMOffRamp.ExecutionError.selector, + abi.encodeWithSelector( + EVM2EVMOffRamp.ReceiverError.selector, + abi.encodeWithSelector(MaybeRevertMessageReceiver.CustomError.selector, bytes("")) + ) + ) + ); + s_offRamp.manuallyExecute(_generateReportFromMessages(messages), _getGasLimitsFromMessages(messages)); + } +} + +contract EVM2EVMOffRamp_getExecutionState is EVM2EVMOffRampSetup { + mapping(uint64 seqNum => Internal.MessageExecutionState state) internal s_differentialExecutionState; + + /// forge-config: default.fuzz.runs = 32 + /// forge-config: ccip.fuzz.runs = 32 + function test_Fuzz_Differential_Success(uint16[500] memory seqNums, uint8[500] memory values) public { + for (uint256 i = 0; i < seqNums.length; ++i) { + // Only use the first three slots. This makes sure existing slots get overwritten + // as the tests uses 500 sequence numbers. + uint16 seqNum = seqNums[i] % 386; + Internal.MessageExecutionState state = Internal.MessageExecutionState(values[i] % 4); + s_differentialExecutionState[seqNum] = state; + s_offRamp.setExecutionStateHelper(seqNum, state); + assertEq(uint256(state), uint256(s_offRamp.getExecutionState(seqNum))); + } + + for (uint256 i = 0; i < seqNums.length; ++i) { + uint16 seqNum = seqNums[i] % 386; + Internal.MessageExecutionState expectedState = s_differentialExecutionState[seqNum]; + assertEq(uint256(expectedState), uint256(s_offRamp.getExecutionState(seqNum))); + } + } + + function test_GetExecutionState_Success() public { + s_offRamp.setExecutionStateHelper(0, Internal.MessageExecutionState.FAILURE); + assertEq(s_offRamp.getExecutionStateBitMap(0), 3); + + s_offRamp.setExecutionStateHelper(1, Internal.MessageExecutionState.FAILURE); + assertEq(s_offRamp.getExecutionStateBitMap(0), 3 + (3 << 2)); + + s_offRamp.setExecutionStateHelper(1, Internal.MessageExecutionState.IN_PROGRESS); + assertEq(s_offRamp.getExecutionStateBitMap(0), 3 + (1 << 2)); + + s_offRamp.setExecutionStateHelper(2, Internal.MessageExecutionState.FAILURE); + assertEq(s_offRamp.getExecutionStateBitMap(0), 3 + (1 << 2) + (3 << 4)); + + s_offRamp.setExecutionStateHelper(127, Internal.MessageExecutionState.IN_PROGRESS); + assertEq(s_offRamp.getExecutionStateBitMap(0), 3 + (1 << 2) + (3 << 4) + (1 << 254)); + + s_offRamp.setExecutionStateHelper(128, Internal.MessageExecutionState.SUCCESS); + assertEq(s_offRamp.getExecutionStateBitMap(0), 3 + (1 << 2) + (3 << 4) + (1 << 254)); + assertEq(s_offRamp.getExecutionStateBitMap(1), 2); + + assertEq(uint256(Internal.MessageExecutionState.FAILURE), uint256(s_offRamp.getExecutionState(0))); + assertEq(uint256(Internal.MessageExecutionState.IN_PROGRESS), uint256(s_offRamp.getExecutionState(1))); + assertEq(uint256(Internal.MessageExecutionState.FAILURE), uint256(s_offRamp.getExecutionState(2))); + assertEq(uint256(Internal.MessageExecutionState.IN_PROGRESS), uint256(s_offRamp.getExecutionState(127))); + assertEq(uint256(Internal.MessageExecutionState.SUCCESS), uint256(s_offRamp.getExecutionState(128))); + } + + function test_FillExecutionState_Success() public { + for (uint64 i = 0; i < 384; ++i) { + s_offRamp.setExecutionStateHelper(i, Internal.MessageExecutionState.FAILURE); + } + + for (uint64 i = 0; i < 384; ++i) { + assertEq(uint256(Internal.MessageExecutionState.FAILURE), uint256(s_offRamp.getExecutionState(i))); + } + + for (uint64 i = 0; i < 3; ++i) { + assertEq(type(uint256).max, s_offRamp.getExecutionStateBitMap(i)); + } + + for (uint64 i = 0; i < 384; ++i) { + s_offRamp.setExecutionStateHelper(i, Internal.MessageExecutionState.IN_PROGRESS); + } + + for (uint64 i = 0; i < 384; ++i) { + assertEq(uint256(Internal.MessageExecutionState.IN_PROGRESS), uint256(s_offRamp.getExecutionState(i))); + } + + for (uint64 i = 0; i < 3; ++i) { + // 0x555... == 0b101010101010..... + assertEq(0x5555555555555555555555555555555555555555555555555555555555555555, s_offRamp.getExecutionStateBitMap(i)); + } + } +} + +contract EVM2EVMOffRamp__trialExecute is EVM2EVMOffRampSetup { + function test_trialExecute_Success() public { + uint256[] memory amounts = new uint256[](2); + amounts[0] = 1000; + amounts[1] = 50; + + Internal.EVM2EVMMessage memory message = _generateAny2EVMMessageWithTokens(1, amounts); + IERC20 dstToken0 = IERC20(s_destTokens[0]); + uint256 startingBalance = dstToken0.balanceOf(message.receiver); + + (Internal.MessageExecutionState newState, bytes memory err) = + s_offRamp.trialExecute(message, new bytes[](message.tokenAmounts.length), new uint32[](0)); + assertEq(uint256(Internal.MessageExecutionState.SUCCESS), uint256(newState)); + assertEq("", err); + + // Check that the tokens were transferred + assertEq(startingBalance + amounts[0], dstToken0.balanceOf(message.receiver)); + } + + function test_TokenHandlingErrorIsCaught_Success() public { + uint256[] memory amounts = new uint256[](2); + amounts[0] = 1000; + amounts[1] = 50; + + IERC20 dstToken0 = IERC20(s_destTokens[0]); + uint256 startingBalance = dstToken0.balanceOf(OWNER); + + bytes memory errorMessage = "Random token pool issue"; + + Internal.EVM2EVMMessage memory message = _generateAny2EVMMessageWithTokens(1, amounts); + s_maybeRevertingPool.setShouldRevert(errorMessage); + + (Internal.MessageExecutionState newState, bytes memory err) = + s_offRamp.trialExecute(message, new bytes[](message.tokenAmounts.length), new uint32[](0)); + assertEq(uint256(Internal.MessageExecutionState.FAILURE), uint32(newState)); + assertEq(abi.encodeWithSelector(EVM2EVMOffRamp.TokenHandlingError.selector, errorMessage), err); + + // Expect the balance to remain the same + assertEq(startingBalance, dstToken0.balanceOf(OWNER)); + } + + function test_RateLimitError_Success() public { + uint256[] memory amounts = new uint256[](2); + amounts[0] = 1000; + amounts[1] = 50; + + bytes memory errorMessage = abi.encodeWithSelector(RateLimiter.BucketOverfilled.selector); + + Internal.EVM2EVMMessage memory message = _generateAny2EVMMessageWithTokens(1, amounts); + s_maybeRevertingPool.setShouldRevert(errorMessage); + + (Internal.MessageExecutionState newState, bytes memory err) = + s_offRamp.trialExecute(message, new bytes[](message.tokenAmounts.length), new uint32[](0)); + assertEq(uint256(Internal.MessageExecutionState.FAILURE), uint256(newState)); + assertEq(abi.encodeWithSelector(EVM2EVMOffRamp.TokenHandlingError.selector, errorMessage), err); + } + + function test_TokenPoolIsNotAContract_Success() public { + uint256[] memory amounts = new uint256[](2); + amounts[0] = 10000; + Internal.EVM2EVMMessage memory message = _generateAny2EVMMessageWithTokens(1, amounts); + + // Happy path, pool is correct + (Internal.MessageExecutionState newState, bytes memory err) = + s_offRamp.trialExecute(message, new bytes[](message.tokenAmounts.length), new uint32[](0)); + + assertEq(uint256(Internal.MessageExecutionState.SUCCESS), uint256(newState)); + assertEq("", err); + + // address 0 has no contract + assertEq(address(0).code.length, 0); + message.sourceTokenData[0] = abi.encode( + Internal.SourceTokenData({ + sourcePoolAddress: abi.encode(address(0)), + destTokenAddress: abi.encode(address(0)), + extraData: "", + destGasAmount: DEFAULT_TOKEN_DEST_GAS_OVERHEAD + }) + ); + + message.messageId = Internal._hash( + message, + keccak256( + abi.encode(Internal.EVM_2_EVM_MESSAGE_HASH, SOURCE_CHAIN_SELECTOR, DEST_CHAIN_SELECTOR, ON_RAMP_ADDRESS) + ) + ); + + // Unhappy path, no revert but marked as failed. + (newState, err) = s_offRamp.trialExecute(message, new bytes[](message.tokenAmounts.length), new uint32[](0)); + + assertEq(uint256(Internal.MessageExecutionState.FAILURE), uint256(newState)); + assertEq(abi.encodeWithSelector(Internal.InvalidEVMAddress.selector, abi.encode(address(0))), err); + + address notAContract = makeAddr("not_a_contract"); + + message.sourceTokenData[0] = abi.encode( + Internal.SourceTokenData({ + sourcePoolAddress: abi.encode(address(0)), + destTokenAddress: abi.encode(notAContract), + extraData: "", + destGasAmount: DEFAULT_TOKEN_DEST_GAS_OVERHEAD + }) + ); + + message.messageId = Internal._hash( + message, + keccak256( + abi.encode(Internal.EVM_2_EVM_MESSAGE_HASH, SOURCE_CHAIN_SELECTOR, DEST_CHAIN_SELECTOR, ON_RAMP_ADDRESS) + ) + ); + + (newState, err) = s_offRamp.trialExecute(message, new bytes[](message.tokenAmounts.length), new uint32[](0)); + + assertEq(uint256(Internal.MessageExecutionState.FAILURE), uint256(newState)); + assertEq(abi.encodeWithSelector(EVM2EVMOffRamp.NotACompatiblePool.selector, address(0)), err); + } +} + +contract EVM2EVMOffRamp__releaseOrMintToken is EVM2EVMOffRampSetup { + function test__releaseOrMintToken_Success() public { + uint256 amount = 123123; + address token = s_sourceTokens[0]; + bytes memory originalSender = abi.encode(OWNER); + bytes memory offchainTokenData = ""; + + IERC20 dstToken1 = IERC20(s_destTokenBySourceToken[token]); + uint256 startingBalance = dstToken1.balanceOf(OWNER); + + Internal.SourceTokenData memory sourceTokenData = Internal.SourceTokenData({ + sourcePoolAddress: abi.encode(s_sourcePoolByToken[token]), + destTokenAddress: abi.encode(s_destTokenBySourceToken[token]), + extraData: "", + destGasAmount: DEFAULT_TOKEN_DEST_GAS_OVERHEAD + }); + + vm.expectCall( + s_destPoolBySourceToken[token], + abi.encodeWithSelector( + LockReleaseTokenPool.releaseOrMint.selector, + Pool.ReleaseOrMintInV1({ + originalSender: originalSender, + receiver: OWNER, + amount: amount, + localToken: s_destTokenBySourceToken[token], + remoteChainSelector: SOURCE_CHAIN_SELECTOR, + sourcePoolAddress: sourceTokenData.sourcePoolAddress, + sourcePoolData: sourceTokenData.extraData, + offchainTokenData: offchainTokenData + }) + ) + ); + + s_offRamp.releaseOrMintToken(amount, originalSender, OWNER, sourceTokenData, offchainTokenData); + + assertEq(startingBalance + amount, dstToken1.balanceOf(OWNER)); + } + + function test_releaseOrMintToken_InvalidDataLength_Revert() public { + uint256 amount = 123123; + address token = s_sourceTokens[0]; + + Internal.SourceTokenData memory sourceTokenData = Internal.SourceTokenData({ + sourcePoolAddress: abi.encode(s_sourcePoolByToken[token]), + destTokenAddress: abi.encode(s_destTokenBySourceToken[token]), + extraData: "", + destGasAmount: DEFAULT_TOKEN_DEST_GAS_OVERHEAD + }); + + // Mock the call so returns 2 slots of data + vm.mockCall( + s_destTokenBySourceToken[token], abi.encodeWithSelector(IERC20.balanceOf.selector, OWNER), abi.encode(0, 0) + ); + + vm.expectRevert( + abi.encodeWithSelector(EVM2EVMOffRamp.InvalidDataLength.selector, Internal.MAX_BALANCE_OF_RET_BYTES, 64) + ); + + s_offRamp.releaseOrMintToken(amount, abi.encode(OWNER), OWNER, sourceTokenData, ""); + } + + function test_releaseOrMintToken_TokenHandlingError_BalanceOf_Revert() public { + uint256 amount = 123123; + address token = s_sourceTokens[0]; + + Internal.SourceTokenData memory sourceTokenData = Internal.SourceTokenData({ + sourcePoolAddress: abi.encode(s_sourcePoolByToken[token]), + destTokenAddress: abi.encode(s_destTokenBySourceToken[token]), + extraData: "", + destGasAmount: DEFAULT_TOKEN_DEST_GAS_OVERHEAD + }); + + bytes memory revertData = "failed to balanceOf"; + + // Mock the call so returns 2 slots of data + vm.mockCallRevert( + s_destTokenBySourceToken[token], abi.encodeWithSelector(IERC20.balanceOf.selector, OWNER), revertData + ); + + vm.expectRevert(abi.encodeWithSelector(EVM2EVMOffRamp.TokenHandlingError.selector, revertData)); + + s_offRamp.releaseOrMintToken(amount, abi.encode(OWNER), OWNER, sourceTokenData, ""); + } + + function test_releaseOrMintToken_ReleaseOrMintBalanceMismatch_Revert() public { + uint256 amount = 123123; + address token = s_sourceTokens[0]; + uint256 mockedStaticBalance = 50000; + + Internal.SourceTokenData memory sourceTokenData = Internal.SourceTokenData({ + sourcePoolAddress: abi.encode(s_sourcePoolByToken[token]), + destTokenAddress: abi.encode(s_destTokenBySourceToken[token]), + extraData: "", + destGasAmount: DEFAULT_TOKEN_DEST_GAS_OVERHEAD + }); + + vm.mockCall( + s_destTokenBySourceToken[token], + abi.encodeWithSelector(IERC20.balanceOf.selector, OWNER), + abi.encode(mockedStaticBalance) + ); + + vm.expectRevert( + abi.encodeWithSelector( + EVM2EVMOffRamp.ReleaseOrMintBalanceMismatch.selector, amount, mockedStaticBalance, mockedStaticBalance + ) + ); + + s_offRamp.releaseOrMintToken(amount, abi.encode(OWNER), OWNER, sourceTokenData, ""); + } + + function test_releaseOrMintToken_skip_ReleaseOrMintBalanceMismatch_if_pool_Revert() public { + uint256 amount = 123123; + address token = s_sourceTokens[0]; + uint256 mockedStaticBalance = 50000; + + Internal.SourceTokenData memory sourceTokenData = Internal.SourceTokenData({ + sourcePoolAddress: abi.encode(s_sourcePoolByToken[token]), + destTokenAddress: abi.encode(s_destTokenBySourceToken[token]), + extraData: "", + destGasAmount: DEFAULT_TOKEN_DEST_GAS_OVERHEAD + }); + + // This should make the call fail if it does not skip the check + vm.mockCall( + s_destTokenBySourceToken[token], + abi.encodeWithSelector(IERC20.balanceOf.selector, OWNER), + abi.encode(mockedStaticBalance) + ); + + s_offRamp.releaseOrMintToken(amount, abi.encode(OWNER), s_destPoolBySourceToken[token], sourceTokenData, ""); + } + + function test__releaseOrMintToken_NotACompatiblePool_Revert() public { + uint256 amount = 123123; + address token = s_sourceTokens[0]; + address destToken = s_destTokenBySourceToken[token]; + vm.label(destToken, "destToken"); + bytes memory originalSender = abi.encode(OWNER); + + Internal.SourceTokenData memory sourceTokenData = Internal.SourceTokenData({ + sourcePoolAddress: abi.encode(s_sourcePoolByToken[token]), + destTokenAddress: abi.encode(destToken), + extraData: "", + destGasAmount: DEFAULT_TOKEN_DEST_GAS_OVERHEAD + }); + + // Address(0) should always revert + address returnedPool = address(0); + + vm.mockCall( + address(s_tokenAdminRegistry), + abi.encodeWithSelector(ITokenAdminRegistry.getPool.selector, destToken), + abi.encode(returnedPool) + ); + + vm.expectRevert(abi.encodeWithSelector(EVM2EVMOffRamp.NotACompatiblePool.selector, returnedPool)); + + s_offRamp.releaseOrMintToken(amount, originalSender, OWNER, sourceTokenData, ""); + + // A contract that doesn't support the interface should also revert + returnedPool = address(s_offRamp); + + vm.mockCall( + address(s_tokenAdminRegistry), + abi.encodeWithSelector(ITokenAdminRegistry.getPool.selector, destToken), + abi.encode(returnedPool) + ); + + vm.expectRevert(abi.encodeWithSelector(EVM2EVMOffRamp.NotACompatiblePool.selector, returnedPool)); + + s_offRamp.releaseOrMintToken(amount, originalSender, OWNER, sourceTokenData, ""); + } + + function test__releaseOrMintToken_TokenHandlingError_transfer_Revert() public { + address receiver = makeAddr("receiver"); + uint256 amount = 123123; + address token = s_sourceTokens[0]; + address destToken = s_destTokenBySourceToken[token]; + bytes memory originalSender = abi.encode(OWNER); + bytes memory offchainTokenData = abi.encode(keccak256("offchainTokenData")); + + Internal.SourceTokenData memory sourceTokenData = Internal.SourceTokenData({ + sourcePoolAddress: abi.encode(s_sourcePoolByToken[token]), + destTokenAddress: abi.encode(destToken), + extraData: "", + destGasAmount: DEFAULT_TOKEN_DEST_GAS_OVERHEAD + }); + + bytes memory revertData = "call reverted :o"; + + vm.mockCallRevert(destToken, abi.encodeWithSelector(IERC20.transfer.selector, receiver, amount), revertData); + + vm.expectRevert(abi.encodeWithSelector(EVM2EVMOffRamp.TokenHandlingError.selector, revertData)); + s_offRamp.releaseOrMintToken(amount, originalSender, receiver, sourceTokenData, offchainTokenData); + } +} + +contract EVM2EVMOffRamp__releaseOrMintTokens is EVM2EVMOffRampSetup { + function test_releaseOrMintTokens_Success() public { + Client.EVMTokenAmount[] memory srcTokenAmounts = _getCastedSourceEVMTokenAmountsWithZeroAmounts(); + IERC20 dstToken1 = IERC20(s_destFeeToken); + uint256 startingBalance = dstToken1.balanceOf(OWNER); + uint256 amount1 = 100; + srcTokenAmounts[0].amount = amount1; + + bytes memory originalSender = abi.encode(OWNER); + + bytes[] memory offchainTokenData = new bytes[](srcTokenAmounts.length); + offchainTokenData[0] = abi.encode(0x12345678); + + bytes[] memory encodedSourceTokenData = _getDefaultSourceTokenData(srcTokenAmounts); + Internal.SourceTokenData memory sourceTokenData = abi.decode(encodedSourceTokenData[0], (Internal.SourceTokenData)); + + vm.expectCall( + s_destPoolBySourceToken[srcTokenAmounts[0].token], + abi.encodeWithSelector( + LockReleaseTokenPool.releaseOrMint.selector, + Pool.ReleaseOrMintInV1({ + originalSender: originalSender, + receiver: OWNER, + amount: srcTokenAmounts[0].amount, + localToken: s_destTokenBySourceToken[srcTokenAmounts[0].token], + remoteChainSelector: SOURCE_CHAIN_SELECTOR, + sourcePoolAddress: sourceTokenData.sourcePoolAddress, + sourcePoolData: sourceTokenData.extraData, + offchainTokenData: offchainTokenData[0] + }) + ) + ); + + s_offRamp.releaseOrMintTokens( + srcTokenAmounts, originalSender, OWNER, encodedSourceTokenData, offchainTokenData, new uint32[](0) + ); + + assertEq(startingBalance + amount1, dstToken1.balanceOf(OWNER)); + } + + function test_releaseOrMintTokens_destDenominatedDecimals_Success() public { + Client.EVMTokenAmount[] memory srcTokenAmounts = _getCastedSourceEVMTokenAmountsWithZeroAmounts(); + uint256 amount = 100; + uint256 destinationDenominationMultiplier = 1000; + srcTokenAmounts[1].amount = amount; + + bytes memory originalSender = abi.encode(OWNER); + bytes[] memory offchainTokenData = new bytes[](srcTokenAmounts.length); + bytes[] memory encodedSourceTokenData = _getDefaultSourceTokenData(srcTokenAmounts); + address pool = s_destPoolBySourceToken[srcTokenAmounts[1].token]; + address destToken = s_destTokenBySourceToken[srcTokenAmounts[1].token]; + + MaybeRevertingBurnMintTokenPool(pool).setReleaseOrMintMultiplier(destinationDenominationMultiplier); + + Client.EVMTokenAmount[] memory destTokenAmounts = s_offRamp.releaseOrMintTokens( + srcTokenAmounts, originalSender, OWNER, encodedSourceTokenData, offchainTokenData, new uint32[](0) + ); + + assertEq(destTokenAmounts[1].amount, amount * destinationDenominationMultiplier); + assertEq(destTokenAmounts[1].token, destToken); + } + + function test_OverValueWithARLOff_Success() public { + // Set a high price to trip the ARL + uint224 tokenPrice = 3 ** 128; + Internal.PriceUpdates memory priceUpdates = _getSingleTokenPriceUpdateStruct(s_destFeeToken, tokenPrice); + s_feeQuoter.updatePrices(priceUpdates); + + Client.EVMTokenAmount[] memory srcTokenAmounts = _getCastedSourceEVMTokenAmountsWithZeroAmounts(); + uint256 amount1 = 100; + srcTokenAmounts[0].amount = amount1; + + bytes memory originalSender = abi.encode(OWNER); + + bytes[] memory offchainTokenData = new bytes[](srcTokenAmounts.length); + offchainTokenData[0] = abi.encode(0x12345678); + + bytes[] memory sourceTokenData = _getDefaultSourceTokenData(srcTokenAmounts); + + vm.expectRevert( + abi.encodeWithSelector( + RateLimiter.AggregateValueMaxCapacityExceeded.selector, + _getInboundRateLimiterConfig().capacity, + (amount1 * tokenPrice) / 1e18 + ) + ); + + // // Expect to fail from ARL + s_offRamp.releaseOrMintTokens( + srcTokenAmounts, originalSender, OWNER, sourceTokenData, offchainTokenData, new uint32[](0) + ); + + // Configure ARL off for token + EVM2EVMOffRamp.RateLimitToken[] memory removes = new EVM2EVMOffRamp.RateLimitToken[](1); + removes[0] = EVM2EVMOffRamp.RateLimitToken({sourceToken: s_sourceFeeToken, destToken: s_destFeeToken}); + s_offRamp.updateRateLimitTokens(removes, new EVM2EVMOffRamp.RateLimitToken[](0)); + + // Expect the call now succeeds + s_offRamp.releaseOrMintTokens( + srcTokenAmounts, originalSender, OWNER, sourceTokenData, offchainTokenData, new uint32[](0) + ); + } + + // Revert + + function test_TokenHandlingError_Reverts() public { + Client.EVMTokenAmount[] memory srcTokenAmounts = _getCastedSourceEVMTokenAmountsWithZeroAmounts(); + + bytes memory unknownError = bytes("unknown error"); + s_maybeRevertingPool.setShouldRevert(unknownError); + + vm.expectRevert(abi.encodeWithSelector(EVM2EVMOffRamp.TokenHandlingError.selector, unknownError)); + + s_offRamp.releaseOrMintTokens( + srcTokenAmounts, + abi.encode(OWNER), + OWNER, + _getDefaultSourceTokenData(srcTokenAmounts), + new bytes[](srcTokenAmounts.length), + new uint32[](0) + ); + } + + function test_releaseOrMintTokens_InvalidDataLengthReturnData_Revert() public { + uint256 amount = 100; + Client.EVMTokenAmount[] memory srcTokenAmounts = _getCastedSourceEVMTokenAmountsWithZeroAmounts(); + srcTokenAmounts[0].amount = amount; + + bytes memory originalSender = abi.encode(OWNER); + bytes[] memory offchainTokenData = new bytes[](srcTokenAmounts.length); + bytes[] memory encodedSourceTokenData = _getDefaultSourceTokenData(srcTokenAmounts); + Internal.SourceTokenData memory sourceTokenData = abi.decode(encodedSourceTokenData[0], (Internal.SourceTokenData)); + + vm.mockCall( + s_destPoolBySourceToken[srcTokenAmounts[0].token], + abi.encodeWithSelector( + LockReleaseTokenPool.releaseOrMint.selector, + Pool.ReleaseOrMintInV1({ + originalSender: originalSender, + receiver: OWNER, + amount: amount, + localToken: s_destTokenBySourceToken[srcTokenAmounts[0].token], + remoteChainSelector: SOURCE_CHAIN_SELECTOR, + sourcePoolAddress: sourceTokenData.sourcePoolAddress, + sourcePoolData: sourceTokenData.extraData, + offchainTokenData: offchainTokenData[0] + }) + ), + // Includes the amount twice, this will revert due to the return data being to long + abi.encode(amount, amount) + ); + + vm.expectRevert( + abi.encodeWithSelector(EVM2EVMOffRamp.InvalidDataLength.selector, Pool.CCIP_LOCK_OR_BURN_V1_RET_BYTES, 64) + ); + + s_offRamp.releaseOrMintTokens( + srcTokenAmounts, originalSender, OWNER, encodedSourceTokenData, offchainTokenData, new uint32[](0) + ); + } + + function test_releaseOrMintTokens_InvalidEVMAddress_Revert() public { + Client.EVMTokenAmount[] memory srcTokenAmounts = _getCastedSourceEVMTokenAmountsWithZeroAmounts(); + + bytes memory originalSender = abi.encode(OWNER); + bytes[] memory offchainTokenData = new bytes[](srcTokenAmounts.length); + bytes[] memory sourceTokenData = _getDefaultSourceTokenData(srcTokenAmounts); + bytes memory wrongAddress = abi.encode(address(1000), address(10000), address(10000)); + + sourceTokenData[0] = abi.encode( + Internal.SourceTokenData({ + sourcePoolAddress: abi.encode(s_sourcePoolByToken[srcTokenAmounts[0].token]), + destTokenAddress: wrongAddress, + extraData: "", + destGasAmount: DEFAULT_TOKEN_DEST_GAS_OVERHEAD + }) + ); + + vm.expectRevert(abi.encodeWithSelector(Internal.InvalidEVMAddress.selector, wrongAddress)); + + s_offRamp.releaseOrMintTokens( + srcTokenAmounts, originalSender, OWNER, sourceTokenData, offchainTokenData, new uint32[](0) + ); + } + + function test_RateLimitErrors_Reverts() public { + Client.EVMTokenAmount[] memory srcTokenAmounts = _getCastedSourceEVMTokenAmountsWithZeroAmounts(); + + bytes[] memory rateLimitErrors = new bytes[](5); + rateLimitErrors[0] = abi.encodeWithSelector(RateLimiter.BucketOverfilled.selector); + rateLimitErrors[1] = + abi.encodeWithSelector(RateLimiter.AggregateValueMaxCapacityExceeded.selector, uint256(100), uint256(1000)); + rateLimitErrors[2] = + abi.encodeWithSelector(RateLimiter.AggregateValueRateLimitReached.selector, uint256(42), 1, s_sourceTokens[0]); + rateLimitErrors[3] = abi.encodeWithSelector( + RateLimiter.TokenMaxCapacityExceeded.selector, uint256(100), uint256(1000), s_sourceTokens[0] + ); + rateLimitErrors[4] = + abi.encodeWithSelector(RateLimiter.TokenRateLimitReached.selector, uint256(42), 1, s_sourceTokens[0]); + + for (uint256 i = 0; i < rateLimitErrors.length; ++i) { + s_maybeRevertingPool.setShouldRevert(rateLimitErrors[i]); + + vm.expectRevert(abi.encodeWithSelector(EVM2EVMOffRamp.TokenHandlingError.selector, rateLimitErrors[i])); + + s_offRamp.releaseOrMintTokens( + srcTokenAmounts, + abi.encode(OWNER), + OWNER, + _getDefaultSourceTokenData(srcTokenAmounts), + new bytes[](srcTokenAmounts.length), + new uint32[](0) + ); + } + } + + function test__releaseOrMintTokens_NotACompatiblePool_Reverts() public { + address fakePoolAddress = makeAddr("Doesn't exist"); + + bytes[] memory sourceTokenData = new bytes[](1); + sourceTokenData[0] = abi.encode( + Internal.SourceTokenData({ + sourcePoolAddress: abi.encode(fakePoolAddress), + destTokenAddress: abi.encode(fakePoolAddress), + extraData: "", + destGasAmount: DEFAULT_TOKEN_DEST_GAS_OVERHEAD + }) + ); + + vm.expectRevert(abi.encodeWithSelector(EVM2EVMOffRamp.NotACompatiblePool.selector, address(0))); + s_offRamp.releaseOrMintTokens( + new Client.EVMTokenAmount[](1), + abi.encode(makeAddr("original_sender")), + OWNER, + sourceTokenData, + new bytes[](1), + new uint32[](0) + ); + } + + function test_PriceNotFoundForToken_Reverts() public { + // Set token price to 0 + s_feeQuoter.updatePrices(_getSingleTokenPriceUpdateStruct(s_destFeeToken, 0)); + + Client.EVMTokenAmount[] memory srcTokenAmounts = _getCastedSourceEVMTokenAmountsWithZeroAmounts(); + uint256 amount1 = 100; + srcTokenAmounts[0].amount = amount1; + + bytes memory originalSender = abi.encode(OWNER); + + bytes[] memory offchainTokenData = new bytes[](srcTokenAmounts.length); + offchainTokenData[0] = abi.encode(0x12345678); + + bytes[] memory sourceTokenData = _getDefaultSourceTokenData(srcTokenAmounts); + + vm.expectRevert(abi.encodeWithSelector(AggregateRateLimiter.PriceNotFoundForToken.selector, s_destFeeToken)); + + s_offRamp.releaseOrMintTokens( + srcTokenAmounts, originalSender, OWNER, sourceTokenData, offchainTokenData, new uint32[](0) + ); + } + + /// forge-config: default.fuzz.runs = 32 + /// forge-config: ccip.fuzz.runs = 1024 + // Uint256 gives a good range of values to test, both inside and outside of the eth address space. + function test_Fuzz__releaseOrMintTokens_AnyRevertIsCaught_Success(uint256 destPool) public { + // Input 447301751254033913445893214690834296930546521452, which is 0x4E59B44847B379578588920CA78FBF26C0B4956C + // triggers some Create2Deployer and causes it to fail + vm.assume(destPool != 447301751254033913445893214690834296930546521452); + bytes memory unusedVar = abi.encode(makeAddr("unused")); + bytes[] memory sourceTokenData = new bytes[](1); + sourceTokenData[0] = abi.encode( + Internal.SourceTokenData({ + sourcePoolAddress: unusedVar, + destTokenAddress: abi.encode(destPool), + extraData: unusedVar, + destGasAmount: DEFAULT_TOKEN_DEST_GAS_OVERHEAD + }) + ); + + try s_offRamp.releaseOrMintTokens( + new Client.EVMTokenAmount[](1), unusedVar, OWNER, sourceTokenData, new bytes[](1), new uint32[](0) + ) {} catch (bytes memory reason) { + // Any revert should be a TokenHandlingError, InvalidEVMAddress, InvalidDataLength or NoContract as those are caught by the offramp + assertTrue( + bytes4(reason) == EVM2EVMOffRamp.TokenHandlingError.selector + || bytes4(reason) == Internal.InvalidEVMAddress.selector + || bytes4(reason) == EVM2EVMOffRamp.InvalidDataLength.selector + || bytes4(reason) == CallWithExactGas.NoContract.selector + || bytes4(reason) == EVM2EVMOffRamp.NotACompatiblePool.selector, + "Expected TokenHandlingError or InvalidEVMAddress" + ); + + if (destPool > type(uint160).max) { + assertEq(reason, abi.encodeWithSelector(Internal.InvalidEVMAddress.selector, abi.encode(destPool))); + } + } + } +} + +contract EVM2EVMOffRamp_getAllRateLimitTokens is EVM2EVMOffRampSetup { + function test_GetAllRateLimitTokens_Success() public view { + (address[] memory sourceTokens, address[] memory destTokens) = s_offRamp.getAllRateLimitTokens(); + + for (uint256 i = 0; i < s_sourceTokens.length; ++i) { + assertEq(s_sourceTokens[i], sourceTokens[i]); + assertEq(s_destTokens[i], destTokens[i]); + } + } +} + +contract EVM2EVMOffRamp_updateRateLimitTokens is EVM2EVMOffRampSetup { + function setUp() public virtual override { + super.setUp(); + // Clear rate limit tokens state + EVM2EVMOffRamp.RateLimitToken[] memory remove = new EVM2EVMOffRamp.RateLimitToken[](s_sourceTokens.length); + for (uint256 i = 0; i < s_sourceTokens.length; ++i) { + remove[i] = EVM2EVMOffRamp.RateLimitToken({sourceToken: s_sourceTokens[i], destToken: s_destTokens[i]}); + } + s_offRamp.updateRateLimitTokens(remove, new EVM2EVMOffRamp.RateLimitToken[](0)); + } + + function test_updateRateLimitTokens_Success() public { + EVM2EVMOffRamp.RateLimitToken[] memory adds = new EVM2EVMOffRamp.RateLimitToken[](2); + adds[0] = EVM2EVMOffRamp.RateLimitToken({sourceToken: s_sourceTokens[0], destToken: s_destTokens[0]}); + adds[1] = EVM2EVMOffRamp.RateLimitToken({sourceToken: s_sourceTokens[1], destToken: s_destTokens[1]}); + + for (uint256 i = 0; i < adds.length; ++i) { + vm.expectEmit(); + emit EVM2EVMOffRamp.TokenAggregateRateLimitAdded(adds[i].sourceToken, adds[i].destToken); + } + + s_offRamp.updateRateLimitTokens(new EVM2EVMOffRamp.RateLimitToken[](0), adds); + + (address[] memory sourceTokens, address[] memory destTokens) = s_offRamp.getAllRateLimitTokens(); + + for (uint256 i = 0; i < adds.length; ++i) { + assertEq(adds[i].sourceToken, sourceTokens[i]); + assertEq(adds[i].destToken, destTokens[i]); + } + } + + function test_updateRateLimitTokens_AddsAndRemoves_Success() public { + EVM2EVMOffRamp.RateLimitToken[] memory adds = new EVM2EVMOffRamp.RateLimitToken[](3); + adds[0] = EVM2EVMOffRamp.RateLimitToken({sourceToken: s_sourceTokens[0], destToken: s_destTokens[0]}); + adds[1] = EVM2EVMOffRamp.RateLimitToken({sourceToken: s_sourceTokens[1], destToken: s_destTokens[1]}); + // Add a duplicate, this should not revert the tx + adds[2] = EVM2EVMOffRamp.RateLimitToken({sourceToken: s_sourceTokens[1], destToken: s_destTokens[1]}); + + EVM2EVMOffRamp.RateLimitToken[] memory removes = new EVM2EVMOffRamp.RateLimitToken[](1); + removes[0] = adds[0]; + + for (uint256 i = 0; i < adds.length - 1; ++i) { + vm.expectEmit(); + emit EVM2EVMOffRamp.TokenAggregateRateLimitAdded(adds[i].sourceToken, adds[i].destToken); + } + + s_offRamp.updateRateLimitTokens(removes, adds); + + for (uint256 i = 0; i < removes.length; ++i) { + vm.expectEmit(); + emit EVM2EVMOffRamp.TokenAggregateRateLimitRemoved(removes[i].sourceToken, removes[i].destToken); + } + + s_offRamp.updateRateLimitTokens(removes, new EVM2EVMOffRamp.RateLimitToken[](0)); + + (address[] memory sourceTokens, address[] memory destTokens) = s_offRamp.getAllRateLimitTokens(); + + assertEq(1, sourceTokens.length); + assertEq(adds[1].sourceToken, sourceTokens[0]); + + assertEq(1, destTokens.length); + assertEq(adds[1].destToken, destTokens[0]); + } + + function test_Fuzz_UpdateRateLimitTokens(uint8 numTokens) public { + // Needs to be more than 1 so that the division doesn't round down and the even makes the comparisons simpler + vm.assume(numTokens > 1 && numTokens % 2 == 0); + + // Clear the Rate limit tokens array so the test can start from a baseline + (address[] memory sourceTokens, address[] memory destTokens) = s_offRamp.getAllRateLimitTokens(); + EVM2EVMOffRamp.RateLimitToken[] memory removes = new EVM2EVMOffRamp.RateLimitToken[](sourceTokens.length); + for (uint256 x = 0; x < removes.length; x++) { + removes[x] = EVM2EVMOffRamp.RateLimitToken({sourceToken: sourceTokens[x], destToken: destTokens[x]}); + } + s_offRamp.updateRateLimitTokens(removes, new EVM2EVMOffRamp.RateLimitToken[](0)); + + // Sanity check that the rateLimitTokens were successfully cleared + (sourceTokens, destTokens) = s_offRamp.getAllRateLimitTokens(); + assertEq(sourceTokens.length, 0, "sourceTokenLength should be zero"); + + EVM2EVMOffRamp.RateLimitToken[] memory adds = new EVM2EVMOffRamp.RateLimitToken[](numTokens); + + for (uint256 x = 0; x < numTokens; x++) { + address tokenAddr = vm.addr(x + 1); + + // Create an array of several fake tokens to add which are deployed on the same address on both chains for simplicity + adds[x] = EVM2EVMOffRamp.RateLimitToken({sourceToken: tokenAddr, destToken: tokenAddr}); + } + + // Attempt to add the tokens to the RateLimitToken Array + s_offRamp.updateRateLimitTokens(new EVM2EVMOffRamp.RateLimitToken[](0), adds); + + // Retrieve them from storage and make sure that they all match the expected adds + (sourceTokens, destTokens) = s_offRamp.getAllRateLimitTokens(); + + for (uint256 x = 0; x < sourceTokens.length; x++) { + // Check that the tokens match the ones we generated earlier + assertEq(sourceTokens[x], adds[x].sourceToken, "Source token doesn't match add"); + assertEq(destTokens[x], adds[x].sourceToken, "dest Token doesn't match add"); + } + + // Attempt to remove half of the numTokens by removing the second half of the list and copying it to a removes array + removes = new EVM2EVMOffRamp.RateLimitToken[](adds.length / 2); + + for (uint256 x = 0; x < adds.length / 2; x++) { + removes[x] = adds[x + (adds.length / 2)]; + } + + // Attempt to update again, this time adding nothing and removing the second half of the tokens + s_offRamp.updateRateLimitTokens(removes, new EVM2EVMOffRamp.RateLimitToken[](0)); + + (sourceTokens, destTokens) = s_offRamp.getAllRateLimitTokens(); + assertEq(sourceTokens.length, adds.length / 2, "Current Rate limit token length is not half of the original adds"); + for (uint256 x = 0; x < sourceTokens.length; x++) { + // Check that the tokens match the ones we generated earlier and didn't remove in the previous step + assertEq(sourceTokens[x], adds[x].sourceToken, "Source token doesn't match add after removes"); + assertEq(destTokens[x], adds[x].destToken, "dest Token doesn't match add after removes"); + } + } + + // Reverts + + function test_updateRateLimitTokens_NonOwner_Revert() public { + EVM2EVMOffRamp.RateLimitToken[] memory addsAndRemoves = new EVM2EVMOffRamp.RateLimitToken[](4); + + vm.startPrank(STRANGER); + + vm.expectRevert("Only callable by owner"); + + s_offRamp.updateRateLimitTokens(addsAndRemoves, addsAndRemoves); + } +} diff --git a/contracts/src/v0.8/ccip/test/offRamp/EVM2EVMOffRampSetup.t.sol b/contracts/src/v0.8/ccip/test/offRamp/EVM2EVMOffRampSetup.t.sol new file mode 100644 index 00000000000..8399637718c --- /dev/null +++ b/contracts/src/v0.8/ccip/test/offRamp/EVM2EVMOffRampSetup.t.sol @@ -0,0 +1,262 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {IAny2EVMMessageReceiver} from "../../interfaces/IAny2EVMMessageReceiver.sol"; +import {ICommitStore} from "../../interfaces/ICommitStore.sol"; + +import {Router} from "../../Router.sol"; +import {Client} from "../../libraries/Client.sol"; +import {Internal} from "../../libraries/Internal.sol"; +import {EVM2EVMOffRamp} from "../../offRamp/EVM2EVMOffRamp.sol"; +import {TokenPool} from "../../pools/TokenPool.sol"; +import {TokenSetup} from "../TokenSetup.t.sol"; + +import {FeeQuoterSetup} from "../feeQuoter/FeeQuoterSetup.t.sol"; +import {EVM2EVMOffRampHelper} from "../helpers/EVM2EVMOffRampHelper.sol"; +import {MaybeRevertingBurnMintTokenPool} from "../helpers/MaybeRevertingBurnMintTokenPool.sol"; +import {MaybeRevertMessageReceiver} from "../helpers/receivers/MaybeRevertMessageReceiver.sol"; +import {MockCommitStore} from "../mocks/MockCommitStore.sol"; +import {OCR2BaseSetup} from "../ocr/OCR2Base.t.sol"; + +contract EVM2EVMOffRampSetup is TokenSetup, FeeQuoterSetup, OCR2BaseSetup { + MockCommitStore internal s_mockCommitStore; + IAny2EVMMessageReceiver internal s_receiver; + IAny2EVMMessageReceiver internal s_secondary_receiver; + MaybeRevertMessageReceiver internal s_reverting_receiver; + + MaybeRevertingBurnMintTokenPool internal s_maybeRevertingPool; + + EVM2EVMOffRampHelper internal s_offRamp; + address internal s_sourceTokenPool = makeAddr("sourceTokenPool"); + + function setUp() public virtual override(TokenSetup, FeeQuoterSetup, OCR2BaseSetup) { + TokenSetup.setUp(); + FeeQuoterSetup.setUp(); + OCR2BaseSetup.setUp(); + + s_mockCommitStore = new MockCommitStore(); + s_receiver = new MaybeRevertMessageReceiver(false); + s_secondary_receiver = new MaybeRevertMessageReceiver(false); + s_reverting_receiver = new MaybeRevertMessageReceiver(true); + + s_maybeRevertingPool = MaybeRevertingBurnMintTokenPool(s_destPoolByToken[s_destTokens[1]]); + + deployOffRamp(s_mockCommitStore, s_destRouter, address(0)); + } + + function deployOffRamp(ICommitStore commitStore, Router router, address prevOffRamp) internal { + s_offRamp = new EVM2EVMOffRampHelper( + EVM2EVMOffRamp.StaticConfig({ + commitStore: address(commitStore), + chainSelector: DEST_CHAIN_SELECTOR, + sourceChainSelector: SOURCE_CHAIN_SELECTOR, + onRamp: ON_RAMP_ADDRESS, + prevOffRamp: prevOffRamp, + rmnProxy: address(s_mockRMN), + tokenAdminRegistry: address(s_tokenAdminRegistry) + }), + _getInboundRateLimiterConfig() + ); + s_offRamp.setOCR2Config( + s_valid_signers, + s_valid_transmitters, + s_f, + abi.encode(generateDynamicOffRampConfig(address(router), address(s_feeQuoter))), + s_offchainConfigVersion, + abi.encode("") + ); + + Router.OnRamp[] memory onRampUpdates = new Router.OnRamp[](0); + Router.OffRamp[] memory offRampUpdates = new Router.OffRamp[](2); + offRampUpdates[0] = Router.OffRamp({sourceChainSelector: SOURCE_CHAIN_SELECTOR, offRamp: address(s_offRamp)}); + offRampUpdates[1] = Router.OffRamp({sourceChainSelector: SOURCE_CHAIN_SELECTOR, offRamp: address(prevOffRamp)}); + s_destRouter.applyRampUpdates(onRampUpdates, new Router.OffRamp[](0), offRampUpdates); + EVM2EVMOffRamp.RateLimitToken[] memory tokensToAdd = new EVM2EVMOffRamp.RateLimitToken[](s_sourceTokens.length); + for (uint256 i = 0; i < s_sourceTokens.length; ++i) { + tokensToAdd[i] = EVM2EVMOffRamp.RateLimitToken({sourceToken: s_sourceTokens[i], destToken: s_destTokens[i]}); + } + s_offRamp.updateRateLimitTokens(new EVM2EVMOffRamp.RateLimitToken[](0), tokensToAdd); + } + + function generateDynamicOffRampConfig( + address router, + address priceRegistry + ) internal pure returns (EVM2EVMOffRamp.DynamicConfig memory) { + return EVM2EVMOffRamp.DynamicConfig({ + permissionLessExecutionThresholdSeconds: PERMISSION_LESS_EXECUTION_THRESHOLD_SECONDS, + router: router, + priceRegistry: priceRegistry, + maxNumberOfTokensPerMsg: MAX_TOKENS_LENGTH, + maxDataBytes: MAX_DATA_SIZE + }); + } + + function _convertToGeneralMessage( + Internal.EVM2EVMMessage memory original + ) internal view returns (Client.Any2EVMMessage memory message) { + uint256 numberOfTokens = original.tokenAmounts.length; + Client.EVMTokenAmount[] memory destTokenAmounts = new Client.EVMTokenAmount[](numberOfTokens); + + for (uint256 i = 0; i < numberOfTokens; ++i) { + Internal.SourceTokenData memory sourceTokenData = + abi.decode(original.sourceTokenData[i], (Internal.SourceTokenData)); + + address destPoolAddress = abi.decode(sourceTokenData.destTokenAddress, (address)); + TokenPool pool = TokenPool(destPoolAddress); + destTokenAmounts[i].token = address(pool.getToken()); + destTokenAmounts[i].amount = original.tokenAmounts[i].amount; + } + + return Client.Any2EVMMessage({ + messageId: original.messageId, + sourceChainSelector: original.sourceChainSelector, + sender: abi.encode(original.sender), + data: original.data, + destTokenAmounts: destTokenAmounts + }); + } + + function _generateAny2EVMMessageNoTokens( + uint64 sequenceNumber + ) internal view returns (Internal.EVM2EVMMessage memory) { + return _generateAny2EVMMessage(sequenceNumber, new Client.EVMTokenAmount[](0), false); + } + + function _generateAny2EVMMessageWithTokens( + uint64 sequenceNumber, + uint256[] memory amounts + ) internal view returns (Internal.EVM2EVMMessage memory) { + Client.EVMTokenAmount[] memory tokenAmounts = _getCastedSourceEVMTokenAmountsWithZeroAmounts(); + for (uint256 i = 0; i < tokenAmounts.length; ++i) { + tokenAmounts[i].amount = amounts[i]; + } + return _generateAny2EVMMessage(sequenceNumber, tokenAmounts, false); + } + + function _generateAny2EVMMessage( + uint64 sequenceNumber, + Client.EVMTokenAmount[] memory tokenAmounts, + bool allowOutOfOrderExecution + ) internal view returns (Internal.EVM2EVMMessage memory) { + bytes memory data = abi.encode(0); + Internal.EVM2EVMMessage memory message = Internal.EVM2EVMMessage({ + sequenceNumber: sequenceNumber, + sender: OWNER, + nonce: allowOutOfOrderExecution ? 0 : sequenceNumber, + gasLimit: GAS_LIMIT, + strict: false, + sourceChainSelector: SOURCE_CHAIN_SELECTOR, + receiver: address(s_receiver), + data: data, + tokenAmounts: tokenAmounts, + sourceTokenData: new bytes[](tokenAmounts.length), + feeToken: s_destFeeToken, + feeTokenAmount: uint256(0), + messageId: "" + }); + + // Correctly set the TokenDataPayload for each token. Tokens have to be set up in the TokenSetup. + for (uint256 i = 0; i < tokenAmounts.length; ++i) { + message.sourceTokenData[i] = abi.encode( + Internal.SourceTokenData({ + sourcePoolAddress: abi.encode(s_sourcePoolByToken[tokenAmounts[i].token]), + destTokenAddress: abi.encode(s_destTokenBySourceToken[tokenAmounts[i].token]), + extraData: "", + destGasAmount: DEFAULT_TOKEN_DEST_GAS_OVERHEAD + }) + ); + } + + message.messageId = Internal._hash( + message, + keccak256( + abi.encode(Internal.EVM_2_EVM_MESSAGE_HASH, SOURCE_CHAIN_SELECTOR, DEST_CHAIN_SELECTOR, ON_RAMP_ADDRESS) + ) + ); + + return message; + } + + function _generateSingleBasicMessage() internal view returns (Internal.EVM2EVMMessage[] memory) { + Internal.EVM2EVMMessage[] memory messages = new Internal.EVM2EVMMessage[](1); + messages[0] = _generateAny2EVMMessageNoTokens(1); + return messages; + } + + function _generateSingleBasicMessageWithTokens() internal view returns (Internal.EVM2EVMMessage[] memory) { + Internal.EVM2EVMMessage[] memory messages = new Internal.EVM2EVMMessage[](1); + Client.EVMTokenAmount[] memory tokenAmounts = _getCastedSourceEVMTokenAmountsWithZeroAmounts(); + tokenAmounts[0].amount = 1e18; + messages[0] = _generateAny2EVMMessage(1, tokenAmounts, false); + return messages; + } + + function _generateMessagesWithTokens() internal view returns (Internal.EVM2EVMMessage[] memory) { + Internal.EVM2EVMMessage[] memory messages = new Internal.EVM2EVMMessage[](2); + Client.EVMTokenAmount[] memory tokenAmounts = _getCastedSourceEVMTokenAmountsWithZeroAmounts(); + tokenAmounts[0].amount = 1e18; + tokenAmounts[1].amount = 5e18; + messages[0] = _generateAny2EVMMessage(1, tokenAmounts, false); + messages[1] = _generateAny2EVMMessage(2, tokenAmounts, false); + + return messages; + } + + function _generateReportFromMessages( + Internal.EVM2EVMMessage[] memory messages + ) internal pure returns (Internal.ExecutionReport memory) { + bytes[][] memory offchainTokenData = new bytes[][](messages.length); + + for (uint256 i = 0; i < messages.length; ++i) { + offchainTokenData[i] = new bytes[](messages[i].tokenAmounts.length); + } + + return Internal.ExecutionReport({ + proofs: new bytes32[](0), + proofFlagBits: 2 ** 256 - 1, + messages: messages, + offchainTokenData: offchainTokenData + }); + } + + function _getGasLimitsFromMessages( + Internal.EVM2EVMMessage[] memory messages + ) internal pure returns (EVM2EVMOffRamp.GasLimitOverride[] memory) { + EVM2EVMOffRamp.GasLimitOverride[] memory gasLimitOverrides = new EVM2EVMOffRamp.GasLimitOverride[](messages.length); + for (uint256 i = 0; i < messages.length; ++i) { + gasLimitOverrides[i].receiverExecutionGasLimit = messages[i].gasLimit; + gasLimitOverrides[i].tokenGasOverrides = new uint32[](messages[i].tokenAmounts.length); + + for (uint256 j = 0; j < messages[i].tokenAmounts.length; ++j) { + gasLimitOverrides[i].tokenGasOverrides[j] = DEFAULT_TOKEN_DEST_GAS_OVERHEAD + 1; + } + } + + return gasLimitOverrides; + } + + function _assertSameConfig(EVM2EVMOffRamp.DynamicConfig memory a, EVM2EVMOffRamp.DynamicConfig memory b) public pure { + assertEq(a.permissionLessExecutionThresholdSeconds, b.permissionLessExecutionThresholdSeconds); + assertEq(a.router, b.router); + assertEq(a.priceRegistry, b.priceRegistry); + assertEq(a.maxNumberOfTokensPerMsg, b.maxNumberOfTokensPerMsg); + assertEq(a.maxDataBytes, b.maxDataBytes); + } + + function _getDefaultSourceTokenData( + Client.EVMTokenAmount[] memory srcTokenAmounts + ) internal view returns (bytes[] memory) { + bytes[] memory sourceTokenData = new bytes[](srcTokenAmounts.length); + for (uint256 i = 0; i < srcTokenAmounts.length; ++i) { + sourceTokenData[i] = abi.encode( + Internal.SourceTokenData({ + sourcePoolAddress: abi.encode(s_sourcePoolByToken[srcTokenAmounts[i].token]), + destTokenAddress: abi.encode(s_destTokenBySourceToken[srcTokenAmounts[i].token]), + extraData: "", + destGasAmount: DEFAULT_TOKEN_DEST_GAS_OVERHEAD + }) + ); + } + return sourceTokenData; + } +} diff --git a/contracts/src/v0.8/ccip/test/offRamp/OffRamp.t.sol b/contracts/src/v0.8/ccip/test/offRamp/OffRamp.t.sol new file mode 100644 index 00000000000..8db8be3d116 --- /dev/null +++ b/contracts/src/v0.8/ccip/test/offRamp/OffRamp.t.sol @@ -0,0 +1,3563 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {IFeeQuoter} from "../../interfaces/IFeeQuoter.sol"; +import {IMessageInterceptor} from "../../interfaces/IMessageInterceptor.sol"; +import {IPriceRegistry} from "../../interfaces/IPriceRegistry.sol"; +import {IRMNV2} from "../../interfaces/IRMNV2.sol"; +import {IRouter} from "../../interfaces/IRouter.sol"; +import {ITokenAdminRegistry} from "../../interfaces/ITokenAdminRegistry.sol"; + +import {CallWithExactGas} from "../../../shared/call/CallWithExactGas.sol"; +import {FeeQuoter} from "../../FeeQuoter.sol"; +import {NonceManager} from "../../NonceManager.sol"; +import {Client} from "../../libraries/Client.sol"; +import {Internal} from "../../libraries/Internal.sol"; +import {MerkleMultiProof} from "../../libraries/MerkleMultiProof.sol"; +import {Pool} from "../../libraries/Pool.sol"; +import {RateLimiter} from "../../libraries/RateLimiter.sol"; +import {MultiOCR3Base} from "../../ocr/MultiOCR3Base.sol"; +import {OffRamp} from "../../offRamp/OffRamp.sol"; +import {LockReleaseTokenPool} from "../../pools/LockReleaseTokenPool.sol"; +import {TokenPool} from "../../pools/TokenPool.sol"; +import {MaybeRevertingBurnMintTokenPool} from "../helpers/MaybeRevertingBurnMintTokenPool.sol"; +import {OffRampHelper} from "../helpers/OffRampHelper.sol"; +import {ConformingReceiver} from "../helpers/receivers/ConformingReceiver.sol"; +import {MaybeRevertMessageReceiver} from "../helpers/receivers/MaybeRevertMessageReceiver.sol"; +import {MaybeRevertMessageReceiverNo165} from "../helpers/receivers/MaybeRevertMessageReceiverNo165.sol"; +import {ReentrancyAbuserMultiRamp} from "../helpers/receivers/ReentrancyAbuserMultiRamp.sol"; +import {OffRampSetup} from "./OffRampSetup.t.sol"; +import {Vm} from "forge-std/Vm.sol"; + +import {IERC20} from "../../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/IERC20.sol"; + +contract OffRamp_constructor is OffRampSetup { + function test_Constructor_Success() public { + OffRamp.StaticConfig memory staticConfig = OffRamp.StaticConfig({ + chainSelector: DEST_CHAIN_SELECTOR, + rmn: s_mockRMNRemote, + tokenAdminRegistry: address(s_tokenAdminRegistry), + nonceManager: address(s_inboundNonceManager) + }); + OffRamp.DynamicConfig memory dynamicConfig = _generateDynamicOffRampConfig(address(s_feeQuoter)); + + OffRamp.SourceChainConfigArgs[] memory sourceChainConfigs = new OffRamp.SourceChainConfigArgs[](2); + sourceChainConfigs[0] = OffRamp.SourceChainConfigArgs({ + router: s_destRouter, + sourceChainSelector: SOURCE_CHAIN_SELECTOR_1, + onRamp: ON_RAMP_ADDRESS_1, + isEnabled: true + }); + sourceChainConfigs[1] = OffRamp.SourceChainConfigArgs({ + router: s_destRouter, + sourceChainSelector: SOURCE_CHAIN_SELECTOR_1 + 1, + onRamp: ON_RAMP_ADDRESS_2, + isEnabled: true + }); + + OffRamp.SourceChainConfig memory expectedSourceChainConfig1 = OffRamp.SourceChainConfig({ + router: s_destRouter, + isEnabled: true, + minSeqNr: 1, + onRamp: sourceChainConfigs[0].onRamp + }); + + OffRamp.SourceChainConfig memory expectedSourceChainConfig2 = OffRamp.SourceChainConfig({ + router: s_destRouter, + isEnabled: true, + minSeqNr: 1, + onRamp: sourceChainConfigs[1].onRamp + }); + + vm.expectEmit(); + emit OffRamp.StaticConfigSet(staticConfig); + + vm.expectEmit(); + emit OffRamp.DynamicConfigSet(dynamicConfig); + + vm.expectEmit(); + emit OffRamp.SourceChainSelectorAdded(SOURCE_CHAIN_SELECTOR_1); + + vm.expectEmit(); + emit OffRamp.SourceChainConfigSet(SOURCE_CHAIN_SELECTOR_1, expectedSourceChainConfig1); + + vm.expectEmit(); + emit OffRamp.SourceChainSelectorAdded(SOURCE_CHAIN_SELECTOR_1 + 1); + + vm.expectEmit(); + emit OffRamp.SourceChainConfigSet(SOURCE_CHAIN_SELECTOR_1 + 1, expectedSourceChainConfig2); + + s_offRamp = new OffRampHelper(staticConfig, dynamicConfig, sourceChainConfigs); + + MultiOCR3Base.OCRConfigArgs[] memory ocrConfigs = new MultiOCR3Base.OCRConfigArgs[](1); + ocrConfigs[0] = MultiOCR3Base.OCRConfigArgs({ + ocrPluginType: uint8(Internal.OCRPluginType.Execution), + configDigest: s_configDigestExec, + F: s_F, + isSignatureVerificationEnabled: false, + signers: s_emptySigners, + transmitters: s_validTransmitters + }); + + s_offRamp.setOCR3Configs(ocrConfigs); + + // Static config + OffRamp.StaticConfig memory gotStaticConfig = s_offRamp.getStaticConfig(); + assertEq(staticConfig.chainSelector, gotStaticConfig.chainSelector); + assertEq(address(staticConfig.rmn), address(gotStaticConfig.rmn)); + assertEq(staticConfig.tokenAdminRegistry, gotStaticConfig.tokenAdminRegistry); + + // Dynamic config + OffRamp.DynamicConfig memory gotDynamicConfig = s_offRamp.getDynamicConfig(); + _assertSameConfig(dynamicConfig, gotDynamicConfig); + + // OCR Config + MultiOCR3Base.OCRConfig memory expectedOCRConfig = MultiOCR3Base.OCRConfig({ + configInfo: MultiOCR3Base.ConfigInfo({ + configDigest: ocrConfigs[0].configDigest, + F: ocrConfigs[0].F, + n: 0, + isSignatureVerificationEnabled: ocrConfigs[0].isSignatureVerificationEnabled + }), + signers: s_emptySigners, + transmitters: s_validTransmitters + }); + MultiOCR3Base.OCRConfig memory gotOCRConfig = s_offRamp.latestConfigDetails(uint8(Internal.OCRPluginType.Execution)); + _assertOCRConfigEquality(expectedOCRConfig, gotOCRConfig); + + _assertSourceChainConfigEquality( + s_offRamp.getSourceChainConfig(SOURCE_CHAIN_SELECTOR_1), expectedSourceChainConfig1 + ); + _assertSourceChainConfigEquality( + s_offRamp.getSourceChainConfig(SOURCE_CHAIN_SELECTOR_1 + 1), expectedSourceChainConfig2 + ); + + // OffRamp initial values + assertEq("OffRamp 1.6.0-dev", s_offRamp.typeAndVersion()); + assertEq(OWNER, s_offRamp.owner()); + assertEq(0, s_offRamp.getLatestPriceSequenceNumber()); + } + + // Revert + function test_ZeroOnRampAddress_Revert() public { + uint64[] memory sourceChainSelectors = new uint64[](1); + sourceChainSelectors[0] = SOURCE_CHAIN_SELECTOR_1; + + OffRamp.SourceChainConfigArgs[] memory sourceChainConfigs = new OffRamp.SourceChainConfigArgs[](1); + sourceChainConfigs[0] = OffRamp.SourceChainConfigArgs({ + router: s_destRouter, + sourceChainSelector: SOURCE_CHAIN_SELECTOR_1, + onRamp: new bytes(0), + isEnabled: true + }); + + vm.expectRevert(OffRamp.ZeroAddressNotAllowed.selector); + + s_offRamp = new OffRampHelper( + OffRamp.StaticConfig({ + chainSelector: DEST_CHAIN_SELECTOR, + rmn: s_mockRMNRemote, + tokenAdminRegistry: address(s_tokenAdminRegistry), + nonceManager: address(s_inboundNonceManager) + }), + _generateDynamicOffRampConfig(address(s_feeQuoter)), + sourceChainConfigs + ); + } + + function test_SourceChainSelector_Revert() public { + uint64[] memory sourceChainSelectors = new uint64[](1); + sourceChainSelectors[0] = SOURCE_CHAIN_SELECTOR_1; + + OffRamp.SourceChainConfigArgs[] memory sourceChainConfigs = new OffRamp.SourceChainConfigArgs[](1); + sourceChainConfigs[0] = OffRamp.SourceChainConfigArgs({ + router: s_destRouter, + sourceChainSelector: 0, + onRamp: ON_RAMP_ADDRESS_1, + isEnabled: true + }); + + vm.expectRevert(OffRamp.ZeroChainSelectorNotAllowed.selector); + + s_offRamp = new OffRampHelper( + OffRamp.StaticConfig({ + chainSelector: DEST_CHAIN_SELECTOR, + rmn: s_mockRMNRemote, + tokenAdminRegistry: address(s_tokenAdminRegistry), + nonceManager: address(s_inboundNonceManager) + }), + _generateDynamicOffRampConfig(address(s_feeQuoter)), + sourceChainConfigs + ); + } + + function test_ZeroRMNRemote_Revert() public { + uint64[] memory sourceChainSelectors = new uint64[](1); + sourceChainSelectors[0] = SOURCE_CHAIN_SELECTOR_1; + + OffRamp.SourceChainConfigArgs[] memory sourceChainConfigs = new OffRamp.SourceChainConfigArgs[](0); + + vm.expectRevert(OffRamp.ZeroAddressNotAllowed.selector); + + s_offRamp = new OffRampHelper( + OffRamp.StaticConfig({ + chainSelector: DEST_CHAIN_SELECTOR, + rmn: IRMNV2(ZERO_ADDRESS), + tokenAdminRegistry: address(s_tokenAdminRegistry), + nonceManager: address(s_inboundNonceManager) + }), + _generateDynamicOffRampConfig(address(s_feeQuoter)), + sourceChainConfigs + ); + } + + function test_ZeroChainSelector_Revert() public { + uint64[] memory sourceChainSelectors = new uint64[](1); + sourceChainSelectors[0] = SOURCE_CHAIN_SELECTOR_1; + + OffRamp.SourceChainConfigArgs[] memory sourceChainConfigs = new OffRamp.SourceChainConfigArgs[](0); + + vm.expectRevert(OffRamp.ZeroChainSelectorNotAllowed.selector); + + s_offRamp = new OffRampHelper( + OffRamp.StaticConfig({ + chainSelector: 0, + rmn: s_mockRMNRemote, + tokenAdminRegistry: address(s_tokenAdminRegistry), + nonceManager: address(s_inboundNonceManager) + }), + _generateDynamicOffRampConfig(address(s_feeQuoter)), + sourceChainConfigs + ); + } + + function test_ZeroTokenAdminRegistry_Revert() public { + uint64[] memory sourceChainSelectors = new uint64[](1); + sourceChainSelectors[0] = SOURCE_CHAIN_SELECTOR_1; + + OffRamp.SourceChainConfigArgs[] memory sourceChainConfigs = new OffRamp.SourceChainConfigArgs[](0); + + vm.expectRevert(OffRamp.ZeroAddressNotAllowed.selector); + + s_offRamp = new OffRampHelper( + OffRamp.StaticConfig({ + chainSelector: DEST_CHAIN_SELECTOR, + rmn: s_mockRMNRemote, + tokenAdminRegistry: ZERO_ADDRESS, + nonceManager: address(s_inboundNonceManager) + }), + _generateDynamicOffRampConfig(address(s_feeQuoter)), + sourceChainConfigs + ); + } + + function test_ZeroNonceManager_Revert() public { + uint64[] memory sourceChainSelectors = new uint64[](1); + sourceChainSelectors[0] = SOURCE_CHAIN_SELECTOR_1; + + OffRamp.SourceChainConfigArgs[] memory sourceChainConfigs = new OffRamp.SourceChainConfigArgs[](0); + + vm.expectRevert(OffRamp.ZeroAddressNotAllowed.selector); + + s_offRamp = new OffRampHelper( + OffRamp.StaticConfig({ + chainSelector: DEST_CHAIN_SELECTOR, + rmn: s_mockRMNRemote, + tokenAdminRegistry: address(s_tokenAdminRegistry), + nonceManager: ZERO_ADDRESS + }), + _generateDynamicOffRampConfig(address(s_feeQuoter)), + sourceChainConfigs + ); + } +} + +contract OffRamp_setDynamicConfig is OffRampSetup { + function test_SetDynamicConfig_Success() public { + OffRamp.DynamicConfig memory dynamicConfig = _generateDynamicOffRampConfig(address(s_feeQuoter)); + + vm.expectEmit(); + emit OffRamp.DynamicConfigSet(dynamicConfig); + + s_offRamp.setDynamicConfig(dynamicConfig); + + OffRamp.DynamicConfig memory newConfig = s_offRamp.getDynamicConfig(); + _assertSameConfig(dynamicConfig, newConfig); + } + + function test_SetDynamicConfigWithValidator_Success() public { + OffRamp.DynamicConfig memory dynamicConfig = _generateDynamicOffRampConfig(address(s_feeQuoter)); + dynamicConfig.messageValidator = address(s_inboundMessageValidator); + + vm.expectEmit(); + emit OffRamp.DynamicConfigSet(dynamicConfig); + + s_offRamp.setDynamicConfig(dynamicConfig); + + OffRamp.DynamicConfig memory newConfig = s_offRamp.getDynamicConfig(); + _assertSameConfig(dynamicConfig, newConfig); + } + + // Reverts + + function test_NonOwner_Revert() public { + vm.startPrank(STRANGER); + OffRamp.DynamicConfig memory dynamicConfig = _generateDynamicOffRampConfig(address(s_feeQuoter)); + + vm.expectRevert("Only callable by owner"); + + s_offRamp.setDynamicConfig(dynamicConfig); + } + + function test_FeeQuoterZeroAddress_Revert() public { + OffRamp.DynamicConfig memory dynamicConfig = _generateDynamicOffRampConfig(ZERO_ADDRESS); + + vm.expectRevert(OffRamp.ZeroAddressNotAllowed.selector); + + s_offRamp.setDynamicConfig(dynamicConfig); + } +} + +contract OffRamp_ccipReceive is OffRampSetup { + // Reverts + + function test_Reverts() public { + Client.Any2EVMMessage memory message = + _convertToGeneralMessage(_generateAny2EVMMessageNoTokens(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1, 1)); + vm.expectRevert(); + s_offRamp.ccipReceive(message); + } +} + +contract OffRamp_executeSingleReport is OffRampSetup { + function setUp() public virtual override { + super.setUp(); + _setupMultipleOffRamps(); + s_offRamp.setVerifyOverrideResult(SOURCE_CHAIN_SELECTOR_1, 1); + s_offRamp.setVerifyOverrideResult(SOURCE_CHAIN_SELECTOR_3, 1); + } + + function test_SingleMessageNoTokens_Success() public { + Internal.Any2EVMRampMessage[] memory messages = + _generateSingleBasicMessage(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1); + + vm.recordLogs(); + s_offRamp.executeSingleReport(_generateReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messages), new uint256[](0)); + assertExecutionStateChangedEventLogs( + messages[0].header.sourceChainSelector, + messages[0].header.sequenceNumber, + messages[0].header.messageId, + Internal._hash(messages[0], ON_RAMP_ADDRESS_1), + Internal.MessageExecutionState.SUCCESS, + "" + ); + + messages[0].header.nonce++; + messages[0].header.sequenceNumber++; + messages[0].header.messageId = Internal._hash(messages[0], ON_RAMP_ADDRESS_1); + + uint64 nonceBefore = s_inboundNonceManager.getInboundNonce(SOURCE_CHAIN_SELECTOR_1, messages[0].sender); + vm.recordLogs(); + s_offRamp.executeSingleReport(_generateReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messages), new uint256[](0)); + assertExecutionStateChangedEventLogs( + messages[0].header.sourceChainSelector, + messages[0].header.sequenceNumber, + messages[0].header.messageId, + Internal._hash(messages[0], ON_RAMP_ADDRESS_1), + Internal.MessageExecutionState.SUCCESS, + "" + ); + assertGt(s_inboundNonceManager.getInboundNonce(SOURCE_CHAIN_SELECTOR_1, messages[0].sender), nonceBefore); + } + + function test_SingleMessageNoTokensUnordered_Success() public { + Internal.Any2EVMRampMessage[] memory messages = + _generateSingleBasicMessage(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1); + messages[0].header.nonce = 0; + messages[0].header.messageId = Internal._hash(messages[0], ON_RAMP_ADDRESS_1); + + // Nonce never increments on unordered messages. + uint64 nonceBefore = s_inboundNonceManager.getInboundNonce(SOURCE_CHAIN_SELECTOR_1, messages[0].sender); + vm.recordLogs(); + s_offRamp.executeSingleReport(_generateReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messages), new uint256[](0)); + assertExecutionStateChangedEventLogs( + messages[0].header.sourceChainSelector, + messages[0].header.sequenceNumber, + messages[0].header.messageId, + Internal._hash(messages[0], ON_RAMP_ADDRESS_1), + Internal.MessageExecutionState.SUCCESS, + "" + ); + + assertEq( + s_inboundNonceManager.getInboundNonce(SOURCE_CHAIN_SELECTOR_1, messages[0].sender), + nonceBefore, + "nonce must remain unchanged on unordered messages" + ); + + messages[0].header.sequenceNumber++; + messages[0].header.messageId = Internal._hash(messages[0], ON_RAMP_ADDRESS_1); + + // Nonce never increments on unordered messages. + nonceBefore = s_inboundNonceManager.getInboundNonce(SOURCE_CHAIN_SELECTOR_1, messages[0].sender); + vm.recordLogs(); + s_offRamp.executeSingleReport(_generateReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messages), new uint256[](0)); + assertExecutionStateChangedEventLogs( + messages[0].header.sourceChainSelector, + messages[0].header.sequenceNumber, + messages[0].header.messageId, + Internal._hash(messages[0], ON_RAMP_ADDRESS_1), + Internal.MessageExecutionState.SUCCESS, + "" + ); + assertEq( + s_inboundNonceManager.getInboundNonce(SOURCE_CHAIN_SELECTOR_1, messages[0].sender), + nonceBefore, + "nonce must remain unchanged on unordered messages" + ); + } + + function test_SingleMessageNoTokensOtherChain_Success() public { + Internal.Any2EVMRampMessage[] memory messagesChain1 = + _generateSingleBasicMessage(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1); + s_offRamp.executeSingleReport( + _generateReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messagesChain1), new uint256[](0) + ); + + uint64 nonceChain1 = s_inboundNonceManager.getInboundNonce(SOURCE_CHAIN_SELECTOR_1, messagesChain1[0].sender); + assertGt(nonceChain1, 0); + + Internal.Any2EVMRampMessage[] memory messagesChain2 = + _generateSingleBasicMessage(SOURCE_CHAIN_SELECTOR_3, ON_RAMP_ADDRESS_3); + assertEq(s_inboundNonceManager.getInboundNonce(SOURCE_CHAIN_SELECTOR_3, messagesChain2[0].sender), 0); + + s_offRamp.executeSingleReport( + _generateReportFromMessages(SOURCE_CHAIN_SELECTOR_3, messagesChain2), new uint256[](0) + ); + assertGt(s_inboundNonceManager.getInboundNonce(SOURCE_CHAIN_SELECTOR_3, messagesChain2[0].sender), 0); + + // Other chain's nonce is unaffected + assertEq(s_inboundNonceManager.getInboundNonce(SOURCE_CHAIN_SELECTOR_1, messagesChain1[0].sender), nonceChain1); + } + + function test_ReceiverError_Success() public { + Internal.Any2EVMRampMessage[] memory messages = + _generateSingleBasicMessage(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1); + + bytes memory realError1 = new bytes(2); + realError1[0] = 0xbe; + realError1[1] = 0xef; + s_reverting_receiver.setErr(realError1); + + messages[0].receiver = address(s_reverting_receiver); + messages[0].header.messageId = Internal._hash(messages[0], ON_RAMP_ADDRESS_1); + + // Nonce should increment on non-strict + assertEq(uint64(0), s_inboundNonceManager.getInboundNonce(SOURCE_CHAIN_SELECTOR_1, abi.encode(OWNER))); + vm.recordLogs(); + s_offRamp.executeSingleReport(_generateReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messages), new uint256[](0)); + assertExecutionStateChangedEventLogs( + messages[0].header.sourceChainSelector, + messages[0].header.sequenceNumber, + messages[0].header.messageId, + Internal._hash(messages[0], ON_RAMP_ADDRESS_1), + Internal.MessageExecutionState.FAILURE, + abi.encodeWithSelector( + OffRamp.ReceiverError.selector, + abi.encodeWithSelector(MaybeRevertMessageReceiver.CustomError.selector, realError1) + ) + ); + assertEq(uint64(1), s_inboundNonceManager.getInboundNonce(SOURCE_CHAIN_SELECTOR_1, abi.encode(OWNER))); + } + + function test_SkippedIncorrectNonce_Success() public { + Internal.Any2EVMRampMessage[] memory messages = + _generateSingleBasicMessage(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1); + + messages[0].header.nonce++; + messages[0].header.messageId = Internal._hash(messages[0], ON_RAMP_ADDRESS_1); + + vm.expectEmit(); + emit NonceManager.SkippedIncorrectNonce( + messages[0].header.sourceChainSelector, messages[0].header.nonce, messages[0].sender + ); + + s_offRamp.executeSingleReport(_generateReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messages), new uint256[](0)); + } + + function test_SkippedIncorrectNonceStillExecutes_Success() public { + Internal.Any2EVMRampMessage[] memory messages = + _generateMessagesWithTokens(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1); + + messages[1].header.nonce++; + messages[1].header.messageId = Internal._hash(messages[1], ON_RAMP_ADDRESS_1); + + vm.expectEmit(); + emit NonceManager.SkippedIncorrectNonce(SOURCE_CHAIN_SELECTOR_1, messages[1].header.nonce, messages[1].sender); + + vm.recordLogs(); + s_offRamp.executeSingleReport(_generateReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messages), new uint256[](0)); + assertExecutionStateChangedEventLogs( + messages[0].header.sourceChainSelector, + messages[0].header.sequenceNumber, + messages[0].header.messageId, + Internal._hash(messages[0], ON_RAMP_ADDRESS_1), + Internal.MessageExecutionState.SUCCESS, + "" + ); + } + + function test__execute_SkippedAlreadyExecutedMessage_Success() public { + Internal.Any2EVMRampMessage[] memory messages = + _generateSingleBasicMessage(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1); + + vm.recordLogs(); + s_offRamp.executeSingleReport(_generateReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messages), new uint256[](0)); + assertExecutionStateChangedEventLogs( + SOURCE_CHAIN_SELECTOR_1, + messages[0].header.sequenceNumber, + messages[0].header.messageId, + Internal._hash(messages[0], ON_RAMP_ADDRESS_1), + Internal.MessageExecutionState.SUCCESS, + "" + ); + + vm.expectEmit(); + emit OffRamp.SkippedAlreadyExecutedMessage(SOURCE_CHAIN_SELECTOR_1, messages[0].header.sequenceNumber); + + s_offRamp.executeSingleReport(_generateReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messages), new uint256[](0)); + } + + function test__execute_SkippedAlreadyExecutedMessageUnordered_Success() public { + Internal.Any2EVMRampMessage[] memory messages = + _generateSingleBasicMessage(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1); + messages[0].header.nonce = 0; + messages[0].header.messageId = Internal._hash(messages[0], ON_RAMP_ADDRESS_1); + + vm.recordLogs(); + s_offRamp.executeSingleReport(_generateReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messages), new uint256[](0)); + assertExecutionStateChangedEventLogs( + SOURCE_CHAIN_SELECTOR_1, + messages[0].header.sequenceNumber, + messages[0].header.messageId, + Internal._hash(messages[0], ON_RAMP_ADDRESS_1), + Internal.MessageExecutionState.SUCCESS, + "" + ); + + vm.expectEmit(); + emit OffRamp.SkippedAlreadyExecutedMessage(SOURCE_CHAIN_SELECTOR_1, messages[0].header.sequenceNumber); + + s_offRamp.executeSingleReport(_generateReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messages), new uint256[](0)); + } + + // Send a message to a contract that does not implement the CCIPReceiver interface + // This should execute successfully. + function test_SingleMessageToNonCCIPReceiver_Success() public { + Internal.Any2EVMRampMessage[] memory messages = + _generateSingleBasicMessage(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1); + MaybeRevertMessageReceiverNo165 newReceiver = new MaybeRevertMessageReceiverNo165(true); + messages[0].receiver = address(newReceiver); + messages[0].header.messageId = Internal._hash(messages[0], ON_RAMP_ADDRESS_1); + + vm.recordLogs(); + s_offRamp.executeSingleReport(_generateReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messages), new uint256[](0)); + assertExecutionStateChangedEventLogs( + messages[0].header.sourceChainSelector, + messages[0].header.sequenceNumber, + messages[0].header.messageId, + Internal._hash(messages[0], ON_RAMP_ADDRESS_1), + Internal.MessageExecutionState.SUCCESS, + "" + ); + } + + function test_SingleMessagesNoTokensSuccess_gas() public { + vm.pauseGasMetering(); + Internal.Any2EVMRampMessage[] memory messages = + _generateSingleBasicMessage(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1); + + Internal.ExecutionReportSingleChain memory report = _generateReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messages); + + vm.resumeGasMetering(); + vm.recordLogs(); + s_offRamp.executeSingleReport(report, new uint256[](0)); + assertExecutionStateChangedEventLogs( + messages[0].header.sourceChainSelector, + messages[0].header.sequenceNumber, + messages[0].header.messageId, + Internal._hash(messages[0], ON_RAMP_ADDRESS_1), + Internal.MessageExecutionState.SUCCESS, + "" + ); + } + + function test_TwoMessagesWithTokensSuccess_gas() public { + vm.pauseGasMetering(); + Internal.Any2EVMRampMessage[] memory messages = + _generateMessagesWithTokens(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1); + // Set message 1 to use another receiver to simulate more fair gas costs + messages[1].receiver = address(s_secondary_receiver); + messages[1].header.messageId = Internal._hash(messages[1], ON_RAMP_ADDRESS_1); + + Internal.ExecutionReportSingleChain memory report = _generateReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messages); + + vm.resumeGasMetering(); + vm.recordLogs(); + s_offRamp.executeSingleReport(report, new uint256[](0)); + + Vm.Log[] memory logs = vm.getRecordedLogs(); + + assertExecutionStateChangedEventLogs( + logs, + SOURCE_CHAIN_SELECTOR_1, + messages[0].header.sequenceNumber, + messages[0].header.messageId, + Internal._hash(messages[0], ON_RAMP_ADDRESS_1), + Internal.MessageExecutionState.SUCCESS, + "" + ); + + assertExecutionStateChangedEventLogs( + logs, + SOURCE_CHAIN_SELECTOR_1, + messages[1].header.sequenceNumber, + messages[1].header.messageId, + Internal._hash(messages[1], ON_RAMP_ADDRESS_1), + Internal.MessageExecutionState.SUCCESS, + "" + ); + } + + function test_TwoMessagesWithTokensAndGE_Success() public { + Internal.Any2EVMRampMessage[] memory messages = + _generateMessagesWithTokens(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1); + // Set message 1 to use another receiver to simulate more fair gas costs + messages[1].receiver = address(s_secondary_receiver); + messages[1].header.messageId = Internal._hash(messages[1], ON_RAMP_ADDRESS_1); + + assertEq(uint64(0), s_inboundNonceManager.getInboundNonce(SOURCE_CHAIN_SELECTOR_1, abi.encode(OWNER))); + + vm.recordLogs(); + s_offRamp.executeSingleReport( + _generateReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messages), _getGasLimitsFromMessages(messages) + ); + + Vm.Log[] memory logs = vm.getRecordedLogs(); + + assertExecutionStateChangedEventLogs( + logs, + SOURCE_CHAIN_SELECTOR_1, + messages[0].header.sequenceNumber, + messages[0].header.messageId, + Internal._hash(messages[0], ON_RAMP_ADDRESS_1), + Internal.MessageExecutionState.SUCCESS, + "" + ); + assertExecutionStateChangedEventLogs( + logs, + SOURCE_CHAIN_SELECTOR_1, + messages[1].header.sequenceNumber, + messages[1].header.messageId, + Internal._hash(messages[1], ON_RAMP_ADDRESS_1), + Internal.MessageExecutionState.SUCCESS, + "" + ); + assertEq(uint64(2), s_inboundNonceManager.getInboundNonce(SOURCE_CHAIN_SELECTOR_1, abi.encode(OWNER))); + } + + function test_Fuzz_InterleavingOrderedAndUnorderedMessages_Success(bool[7] memory orderings) public { + Internal.Any2EVMRampMessage[] memory messages = new Internal.Any2EVMRampMessage[](orderings.length); + // number of tokens needs to be capped otherwise we hit UnsupportedNumberOfTokens. + Client.EVMTokenAmount[] memory tokenAmounts = new Client.EVMTokenAmount[](3); + for (uint256 i = 0; i < 3; ++i) { + tokenAmounts[i].token = s_sourceTokens[i % s_sourceTokens.length]; + tokenAmounts[i].amount = 1e18; + } + uint64 expectedNonce = 0; + + for (uint256 i = 0; i < orderings.length; ++i) { + messages[i] = + _generateAny2EVMMessage(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1, uint64(i + 1), tokenAmounts, !orderings[i]); + if (orderings[i]) { + messages[i].header.nonce = ++expectedNonce; + } + messages[i].header.messageId = Internal._hash(messages[i], ON_RAMP_ADDRESS_1); + } + + uint64 nonceBefore = s_inboundNonceManager.getInboundNonce(SOURCE_CHAIN_SELECTOR_1, abi.encode(OWNER)); + assertEq(uint64(0), nonceBefore, "nonce before exec should be 0"); + s_offRamp.executeSingleReport( + _generateReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messages), _getGasLimitsFromMessages(messages) + ); + + Vm.Log[] memory logs = vm.getRecordedLogs(); + + // all executions should succeed. + for (uint256 i = 0; i < orderings.length; ++i) { + assertEq( + uint256(s_offRamp.getExecutionState(SOURCE_CHAIN_SELECTOR_1, messages[i].header.sequenceNumber)), + uint256(Internal.MessageExecutionState.SUCCESS) + ); + + assertExecutionStateChangedEventLogs( + logs, + SOURCE_CHAIN_SELECTOR_1, + messages[i].header.sequenceNumber, + messages[i].header.messageId, + Internal._hash(messages[i], ON_RAMP_ADDRESS_1), + Internal.MessageExecutionState.SUCCESS, + "" + ); + } + assertEq( + nonceBefore + expectedNonce, s_inboundNonceManager.getInboundNonce(SOURCE_CHAIN_SELECTOR_1, abi.encode(OWNER)) + ); + } + + function test_InvalidSourcePoolAddress_Success() public { + address fakePoolAddress = address(0x0000000000333333); + + Internal.Any2EVMRampMessage[] memory messages = + _generateMessagesWithTokens(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1); + messages[0].tokenAmounts[0].sourcePoolAddress = abi.encode(fakePoolAddress); + + messages[0].header.messageId = Internal._hash(messages[0], ON_RAMP_ADDRESS_1); + messages[1].header.messageId = Internal._hash(messages[1], ON_RAMP_ADDRESS_1); + + vm.recordLogs(); + + s_offRamp.executeSingleReport(_generateReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messages), new uint256[](0)); + assertExecutionStateChangedEventLogs( + SOURCE_CHAIN_SELECTOR_1, + messages[0].header.sequenceNumber, + messages[0].header.messageId, + Internal._hash(messages[0], ON_RAMP_ADDRESS_1), + Internal.MessageExecutionState.FAILURE, + abi.encodeWithSelector( + OffRamp.TokenHandlingError.selector, + abi.encodeWithSelector(TokenPool.InvalidSourcePoolAddress.selector, abi.encode(fakePoolAddress)) + ) + ); + } + + function test_WithCurseOnAnotherSourceChain_Success() public { + _setMockRMNChainCurse(SOURCE_CHAIN_SELECTOR_2, true); + s_offRamp.executeSingleReport( + _generateReportFromMessages( + SOURCE_CHAIN_SELECTOR_1, _generateMessagesWithTokens(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1) + ), + new uint256[](0) + ); + } + + function test_Unhealthy_Success() public { + _setMockRMNChainCurse(SOURCE_CHAIN_SELECTOR_1, true); + + vm.expectEmit(); + emit OffRamp.SkippedReportExecution(SOURCE_CHAIN_SELECTOR_1); + s_offRamp.executeSingleReport( + _generateReportFromMessages( + SOURCE_CHAIN_SELECTOR_1, _generateMessagesWithTokens(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1) + ), + new uint256[](0) + ); + + _setMockRMNChainCurse(SOURCE_CHAIN_SELECTOR_1, false); + vm.recordLogs(); + s_offRamp.executeSingleReport( + _generateReportFromMessages( + SOURCE_CHAIN_SELECTOR_1, _generateMessagesWithTokens(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1) + ), + new uint256[](0) + ); + + _assertNoEmit(OffRamp.SkippedReportExecution.selector); + } + + // Reverts + + function test_MismatchingDestChainSelector_Revert() public { + Internal.Any2EVMRampMessage[] memory messages = + _generateSingleBasicMessage(SOURCE_CHAIN_SELECTOR_3, ON_RAMP_ADDRESS_3); + messages[0].header.destChainSelector = DEST_CHAIN_SELECTOR + 1; + + Internal.ExecutionReportSingleChain memory executionReport = + _generateReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messages); + + vm.expectRevert( + abi.encodeWithSelector(OffRamp.InvalidMessageDestChainSelector.selector, messages[0].header.destChainSelector) + ); + s_offRamp.executeSingleReport(executionReport, new uint256[](0)); + } + + function test_MismatchingOnRampRoot_Revert() public { + s_offRamp.setVerifyOverrideResult(SOURCE_CHAIN_SELECTOR_1, 0); + + Internal.Any2EVMRampMessage[] memory messages = + _generateSingleBasicMessage(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1); + + OffRamp.CommitReport memory commitReport = _constructCommitReport( + // Root against mismatching on ramp + Internal._hash(messages[0], ON_RAMP_ADDRESS_3) + ); + _commit(commitReport, s_latestSequenceNumber); + + Internal.ExecutionReportSingleChain memory executionReport = + _generateReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messages); + vm.expectRevert(abi.encodeWithSelector(OffRamp.RootNotCommitted.selector, SOURCE_CHAIN_SELECTOR_1)); + s_offRamp.executeSingleReport(executionReport, new uint256[](0)); + } + + function test_UnhealthySingleChainCurse_Revert() public { + _setMockRMNChainCurse(SOURCE_CHAIN_SELECTOR_1, true); + vm.expectEmit(); + emit OffRamp.SkippedReportExecution(SOURCE_CHAIN_SELECTOR_1); + s_offRamp.executeSingleReport( + _generateReportFromMessages( + SOURCE_CHAIN_SELECTOR_1, _generateMessagesWithTokens(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1) + ), + new uint256[](0) + ); + vm.recordLogs(); + // Uncurse should succeed + _setMockRMNChainCurse(SOURCE_CHAIN_SELECTOR_1, false); + s_offRamp.executeSingleReport( + _generateReportFromMessages( + SOURCE_CHAIN_SELECTOR_1, _generateMessagesWithTokens(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1) + ), + new uint256[](0) + ); + _assertNoEmit(OffRamp.SkippedReportExecution.selector); + } + + function test_UnexpectedTokenData_Revert() public { + Internal.ExecutionReportSingleChain memory report = _generateReportFromMessages( + SOURCE_CHAIN_SELECTOR_1, _generateSingleBasicMessage(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1) + ); + report.offchainTokenData = new bytes[][](report.messages.length + 1); + + vm.expectRevert(OffRamp.UnexpectedTokenData.selector); + + s_offRamp.executeSingleReport(report, new uint256[](0)); + } + + function test_EmptyReport_Revert() public { + vm.expectRevert(OffRamp.EmptyReport.selector); + s_offRamp.executeSingleReport( + Internal.ExecutionReportSingleChain({ + sourceChainSelector: SOURCE_CHAIN_SELECTOR_1, + proofs: new bytes32[](0), + proofFlagBits: 0, + messages: new Internal.Any2EVMRampMessage[](0), + offchainTokenData: new bytes[][](0) + }), + new uint256[](0) + ); + } + + function test_RootNotCommitted_Revert() public { + s_offRamp.setVerifyOverrideResult(SOURCE_CHAIN_SELECTOR_1, 0); + vm.expectRevert(abi.encodeWithSelector(OffRamp.RootNotCommitted.selector, SOURCE_CHAIN_SELECTOR_1)); + + Internal.Any2EVMRampMessage[] memory messages = + _generateSingleBasicMessage(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1); + s_offRamp.executeSingleReport( + _generateReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messages), _getGasLimitsFromMessages(messages) + ); + } + + function test_ManualExecutionNotYetEnabled_Revert() public { + s_offRamp.setVerifyOverrideResult(SOURCE_CHAIN_SELECTOR_1, BLOCK_TIME); + + vm.expectRevert(abi.encodeWithSelector(OffRamp.ManualExecutionNotYetEnabled.selector, SOURCE_CHAIN_SELECTOR_1)); + + Internal.Any2EVMRampMessage[] memory messages = + _generateSingleBasicMessage(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1); + s_offRamp.executeSingleReport( + _generateReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messages), _getGasLimitsFromMessages(messages) + ); + } + + function test_NonExistingSourceChain_Revert() public { + uint64 newSourceChainSelector = SOURCE_CHAIN_SELECTOR_1 + 1; + bytes memory newOnRamp = abi.encode(ON_RAMP_ADDRESS, 1); + + Internal.Any2EVMRampMessage[] memory messages = _generateSingleBasicMessage(newSourceChainSelector, newOnRamp); + + vm.expectRevert(abi.encodeWithSelector(OffRamp.SourceChainNotEnabled.selector, newSourceChainSelector)); + s_offRamp.executeSingleReport(_generateReportFromMessages(newSourceChainSelector, messages), new uint256[](0)); + } + + function test_DisabledSourceChain_Revert() public { + Internal.Any2EVMRampMessage[] memory messages = + _generateSingleBasicMessage(SOURCE_CHAIN_SELECTOR_2, ON_RAMP_ADDRESS_2); + + vm.expectRevert(abi.encodeWithSelector(OffRamp.SourceChainNotEnabled.selector, SOURCE_CHAIN_SELECTOR_2)); + s_offRamp.executeSingleReport(_generateReportFromMessages(SOURCE_CHAIN_SELECTOR_2, messages), new uint256[](0)); + } + + function test_TokenDataMismatch_Revert() public { + Internal.Any2EVMRampMessage[] memory messages = + _generateSingleBasicMessage(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1); + Internal.ExecutionReportSingleChain memory report = _generateReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messages); + + report.offchainTokenData[0] = new bytes[](messages[0].tokenAmounts.length + 1); + + vm.expectRevert( + abi.encodeWithSelector( + OffRamp.TokenDataMismatch.selector, SOURCE_CHAIN_SELECTOR_1, messages[0].header.sequenceNumber + ) + ); + s_offRamp.executeSingleReport(report, new uint256[](0)); + } + + function test_RouterYULCall_Revert() public { + Internal.Any2EVMRampMessage[] memory messages = + _generateSingleBasicMessage(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1); + + // gas limit too high, Router's external call should revert + messages[0].gasLimit = 1e36; + messages[0].receiver = address(new ConformingReceiver(address(s_destRouter), s_destFeeToken)); + messages[0].header.messageId = Internal._hash(messages[0], ON_RAMP_ADDRESS_1); + + Internal.ExecutionReportSingleChain memory executionReport = + _generateReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messages); + + vm.recordLogs(); + s_offRamp.executeSingleReport(executionReport, new uint256[](0)); + assertExecutionStateChangedEventLogs( + messages[0].header.sourceChainSelector, + messages[0].header.sequenceNumber, + messages[0].header.messageId, + Internal._hash(messages[0], ON_RAMP_ADDRESS_1), + Internal.MessageExecutionState.FAILURE, + abi.encodeWithSelector(CallWithExactGas.NotEnoughGasForCall.selector) + ); + } + + function test_RetryFailedMessageWithoutManualExecution_Revert() public { + Internal.Any2EVMRampMessage[] memory messages = + _generateSingleBasicMessage(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1); + + bytes memory realError1 = new bytes(2); + realError1[0] = 0xbe; + realError1[1] = 0xef; + s_reverting_receiver.setErr(realError1); + + messages[0].receiver = address(s_reverting_receiver); + messages[0].header.messageId = Internal._hash(messages[0], ON_RAMP_ADDRESS_1); + + vm.recordLogs(); + s_offRamp.executeSingleReport(_generateReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messages), new uint256[](0)); + assertExecutionStateChangedEventLogs( + messages[0].header.sourceChainSelector, + messages[0].header.sequenceNumber, + messages[0].header.messageId, + Internal._hash(messages[0], ON_RAMP_ADDRESS_1), + Internal.MessageExecutionState.FAILURE, + abi.encodeWithSelector( + OffRamp.ReceiverError.selector, + abi.encodeWithSelector(MaybeRevertMessageReceiver.CustomError.selector, realError1) + ) + ); + + // The second time should skip the msg + vm.expectEmit(); + emit OffRamp.AlreadyAttempted(SOURCE_CHAIN_SELECTOR_1, messages[0].header.sequenceNumber); + + s_offRamp.executeSingleReport(_generateReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messages), new uint256[](0)); + } + + function _constructCommitReport(bytes32 merkleRoot) internal view returns (OffRamp.CommitReport memory) { + Internal.MerkleRoot[] memory roots = new Internal.MerkleRoot[](1); + roots[0] = Internal.MerkleRoot({ + sourceChainSelector: SOURCE_CHAIN_SELECTOR_1, + minSeqNr: 1, + maxSeqNr: 2, + merkleRoot: merkleRoot, + onRampAddress: abi.encode(ON_RAMP_ADDRESS_1) + }); + + return OffRamp.CommitReport({ + priceUpdates: _getSingleTokenPriceUpdateStruct(s_sourceFeeToken, 4e18), + merkleRoots: roots, + rmnSignatures: s_rmnSignatures + }); + } +} + +contract OffRamp_executeSingleMessage is OffRampSetup { + function setUp() public virtual override { + super.setUp(); + _setupMultipleOffRamps(); + vm.startPrank(address(s_offRamp)); + } + + function test_executeSingleMessage_NoTokens_Success() public { + Internal.Any2EVMRampMessage memory message = + _generateAny2EVMMessageNoTokens(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1, 1); + s_offRamp.executeSingleMessage(message, new bytes[](message.tokenAmounts.length)); + } + + function test_executeSingleMessage_WithTokens_Success() public { + Internal.Any2EVMRampMessage memory message = + _generateMessagesWithTokens(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1)[0]; + bytes[] memory offchainTokenData = new bytes[](message.tokenAmounts.length); + + vm.expectCall( + s_destPoolByToken[s_destTokens[0]], + abi.encodeWithSelector( + LockReleaseTokenPool.releaseOrMint.selector, + Pool.ReleaseOrMintInV1({ + originalSender: message.sender, + receiver: message.receiver, + amount: message.tokenAmounts[0].amount, + localToken: abi.decode(message.tokenAmounts[0].destTokenAddress, (address)), + remoteChainSelector: SOURCE_CHAIN_SELECTOR_1, + sourcePoolAddress: message.tokenAmounts[0].sourcePoolAddress, + sourcePoolData: message.tokenAmounts[0].extraData, + offchainTokenData: offchainTokenData[0] + }) + ) + ); + + s_offRamp.executeSingleMessage(message, offchainTokenData); + } + + function test_executeSingleMessage_WithValidation_Success() public { + vm.stopPrank(); + vm.startPrank(OWNER); + _enableInboundMessageValidator(); + vm.startPrank(address(s_offRamp)); + Internal.Any2EVMRampMessage memory message = + _generateAny2EVMMessageNoTokens(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1, 1); + s_offRamp.executeSingleMessage(message, new bytes[](message.tokenAmounts.length)); + } + + function test_NonContract_Success() public { + Internal.Any2EVMRampMessage memory message = + _generateAny2EVMMessageNoTokens(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1, 1); + message.receiver = STRANGER; + s_offRamp.executeSingleMessage(message, new bytes[](message.tokenAmounts.length)); + } + + function test_NonContractWithTokens_Success() public { + uint256[] memory amounts = new uint256[](2); + amounts[0] = 1000; + amounts[1] = 50; + vm.expectEmit(); + emit TokenPool.Released(address(s_offRamp), STRANGER, amounts[0]); + vm.expectEmit(); + emit TokenPool.Minted(address(s_offRamp), STRANGER, amounts[1]); + Internal.Any2EVMRampMessage memory message = + _generateAny2EVMMessageWithTokens(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1, 1, amounts); + message.receiver = STRANGER; + s_offRamp.executeSingleMessage(message, new bytes[](message.tokenAmounts.length)); + } + + // Reverts + + function test_TokenHandlingError_Revert() public { + uint256[] memory amounts = new uint256[](2); + amounts[0] = 1000; + amounts[1] = 50; + + bytes memory errorMessage = "Random token pool issue"; + + Internal.Any2EVMRampMessage memory message = + _generateAny2EVMMessageWithTokens(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1, 1, amounts); + s_maybeRevertingPool.setShouldRevert(errorMessage); + + vm.expectRevert(abi.encodeWithSelector(OffRamp.TokenHandlingError.selector, errorMessage)); + + s_offRamp.executeSingleMessage(message, new bytes[](message.tokenAmounts.length)); + } + + function test_ZeroGasDONExecution_Revert() public { + Internal.Any2EVMRampMessage memory message = + _generateAny2EVMMessageNoTokens(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1, 1); + message.gasLimit = 0; + + vm.expectRevert(abi.encodeWithSelector(OffRamp.ReceiverError.selector, "")); + + s_offRamp.executeSingleMessage(message, new bytes[](message.tokenAmounts.length)); + } + + function test_MessageSender_Revert() public { + vm.stopPrank(); + Internal.Any2EVMRampMessage memory message = + _generateAny2EVMMessageNoTokens(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1, 1); + vm.expectRevert(OffRamp.CanOnlySelfCall.selector); + s_offRamp.executeSingleMessage(message, new bytes[](message.tokenAmounts.length)); + } + + function test_executeSingleMessage_WithFailingValidation_Revert() public { + vm.stopPrank(); + vm.startPrank(OWNER); + _enableInboundMessageValidator(); + vm.startPrank(address(s_offRamp)); + Internal.Any2EVMRampMessage memory message = + _generateAny2EVMMessageNoTokens(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1, 1); + s_inboundMessageValidator.setMessageIdValidationState(message.header.messageId, true); + vm.expectRevert( + abi.encodeWithSelector( + IMessageInterceptor.MessageValidationError.selector, + abi.encodeWithSelector(IMessageInterceptor.MessageValidationError.selector, bytes("Invalid message")) + ) + ); + s_offRamp.executeSingleMessage(message, new bytes[](message.tokenAmounts.length)); + } + + function test_executeSingleMessage_WithFailingValidationNoRouterCall_Revert() public { + vm.stopPrank(); + vm.startPrank(OWNER); + _enableInboundMessageValidator(); + vm.startPrank(address(s_offRamp)); + + Internal.Any2EVMRampMessage memory message = + _generateAny2EVMMessageNoTokens(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1, 1); + + // Setup the receiver to a non-CCIP Receiver, which will skip the Router call (but should still perform the validation) + MaybeRevertMessageReceiverNo165 newReceiver = new MaybeRevertMessageReceiverNo165(true); + message.receiver = address(newReceiver); + message.header.messageId = Internal._hash(message, ON_RAMP_ADDRESS_1); + + s_inboundMessageValidator.setMessageIdValidationState(message.header.messageId, true); + vm.expectRevert( + abi.encodeWithSelector( + IMessageInterceptor.MessageValidationError.selector, + abi.encodeWithSelector(IMessageInterceptor.MessageValidationError.selector, bytes("Invalid message")) + ) + ); + s_offRamp.executeSingleMessage(message, new bytes[](message.tokenAmounts.length)); + } +} + +contract OffRamp_batchExecute is OffRampSetup { + function setUp() public virtual override { + super.setUp(); + _setupMultipleOffRamps(); + s_offRamp.setVerifyOverrideResult(SOURCE_CHAIN_SELECTOR_1, 1); + s_offRamp.setVerifyOverrideResult(SOURCE_CHAIN_SELECTOR_3, 1); + } + + function test_SingleReport_Success() public { + Internal.Any2EVMRampMessage[] memory messages = + _generateSingleBasicMessage(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1); + + uint64 nonceBefore = s_inboundNonceManager.getInboundNonce(SOURCE_CHAIN_SELECTOR_1, messages[0].sender); + + vm.recordLogs(); + s_offRamp.batchExecute(_generateBatchReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messages), new uint256[][](1)); + assertExecutionStateChangedEventLogs( + messages[0].header.sourceChainSelector, + messages[0].header.sequenceNumber, + messages[0].header.messageId, + Internal._hash(messages[0], ON_RAMP_ADDRESS_1), + Internal.MessageExecutionState.SUCCESS, + "" + ); + + assertGt(s_inboundNonceManager.getInboundNonce(SOURCE_CHAIN_SELECTOR_1, messages[0].sender), nonceBefore); + } + + function test_MultipleReportsSameChain_Success() public { + Internal.Any2EVMRampMessage[] memory messages1 = new Internal.Any2EVMRampMessage[](2); + Internal.Any2EVMRampMessage[] memory messages2 = new Internal.Any2EVMRampMessage[](1); + + messages1[0] = _generateAny2EVMMessageNoTokens(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1, 1); + messages1[1] = _generateAny2EVMMessageNoTokens(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1, 2); + messages2[0] = _generateAny2EVMMessageNoTokens(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1, 3); + + Internal.ExecutionReportSingleChain[] memory reports = new Internal.ExecutionReportSingleChain[](2); + reports[0] = _generateReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messages1); + reports[1] = _generateReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messages2); + + uint64 nonceBefore = s_inboundNonceManager.getInboundNonce(SOURCE_CHAIN_SELECTOR_1, messages1[0].sender); + vm.recordLogs(); + s_offRamp.batchExecute(reports, new uint256[][](2)); + + Vm.Log[] memory logs = vm.getRecordedLogs(); + + assertExecutionStateChangedEventLogs( + logs, + messages1[0].header.sourceChainSelector, + messages1[0].header.sequenceNumber, + messages1[0].header.messageId, + Internal._hash(messages1[0], ON_RAMP_ADDRESS_1), + Internal.MessageExecutionState.SUCCESS, + "" + ); + + assertExecutionStateChangedEventLogs( + logs, + messages1[1].header.sourceChainSelector, + messages1[1].header.sequenceNumber, + messages1[1].header.messageId, + Internal._hash(messages1[1], ON_RAMP_ADDRESS_1), + Internal.MessageExecutionState.SUCCESS, + "" + ); + + assertExecutionStateChangedEventLogs( + logs, + messages2[0].header.sourceChainSelector, + messages2[0].header.sequenceNumber, + messages2[0].header.messageId, + Internal._hash(messages2[0], ON_RAMP_ADDRESS_1), + Internal.MessageExecutionState.SUCCESS, + "" + ); + + assertGt(s_inboundNonceManager.getInboundNonce(SOURCE_CHAIN_SELECTOR_1, messages1[0].sender), nonceBefore); + } + + function test_MultipleReportsDifferentChains_Success() public { + Internal.Any2EVMRampMessage[] memory messages1 = new Internal.Any2EVMRampMessage[](2); + Internal.Any2EVMRampMessage[] memory messages2 = new Internal.Any2EVMRampMessage[](1); + + messages1[0] = _generateAny2EVMMessageNoTokens(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1, 1); + messages1[1] = _generateAny2EVMMessageNoTokens(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1, 2); + messages2[0] = _generateAny2EVMMessageNoTokens(SOURCE_CHAIN_SELECTOR_3, ON_RAMP_ADDRESS_3, 1); + + Internal.ExecutionReportSingleChain[] memory reports = new Internal.ExecutionReportSingleChain[](2); + reports[0] = _generateReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messages1); + reports[1] = _generateReportFromMessages(SOURCE_CHAIN_SELECTOR_3, messages2); + + vm.recordLogs(); + + s_offRamp.batchExecute(reports, new uint256[][](2)); + + Vm.Log[] memory logs = vm.getRecordedLogs(); + + assertExecutionStateChangedEventLogs( + logs, + messages1[0].header.sourceChainSelector, + messages1[0].header.sequenceNumber, + messages1[0].header.messageId, + Internal._hash(messages1[0], ON_RAMP_ADDRESS_1), + Internal.MessageExecutionState.SUCCESS, + "" + ); + + assertExecutionStateChangedEventLogs( + logs, + messages1[1].header.sourceChainSelector, + messages1[1].header.sequenceNumber, + messages1[1].header.messageId, + Internal._hash(messages1[1], ON_RAMP_ADDRESS_1), + Internal.MessageExecutionState.SUCCESS, + "" + ); + + assertExecutionStateChangedEventLogs( + logs, + messages2[0].header.sourceChainSelector, + messages2[0].header.sequenceNumber, + messages2[0].header.messageId, + Internal._hash(messages2[0], ON_RAMP_ADDRESS_3), + Internal.MessageExecutionState.SUCCESS, + "" + ); + + uint64 nonceChain1 = s_inboundNonceManager.getInboundNonce(SOURCE_CHAIN_SELECTOR_1, messages1[0].sender); + uint64 nonceChain3 = s_inboundNonceManager.getInboundNonce(SOURCE_CHAIN_SELECTOR_3, messages2[0].sender); + + assertTrue(nonceChain1 != nonceChain3); + assertGt(nonceChain1, 0); + assertGt(nonceChain3, 0); + } + + function test_MultipleReportsDifferentChainsSkipCursedChain_Success() public { + _setMockRMNChainCurse(SOURCE_CHAIN_SELECTOR_1, true); + + Internal.Any2EVMRampMessage[] memory messages1 = new Internal.Any2EVMRampMessage[](2); + Internal.Any2EVMRampMessage[] memory messages2 = new Internal.Any2EVMRampMessage[](1); + + messages1[0] = _generateAny2EVMMessageNoTokens(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1, 1); + messages1[1] = _generateAny2EVMMessageNoTokens(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1, 2); + messages2[0] = _generateAny2EVMMessageNoTokens(SOURCE_CHAIN_SELECTOR_3, ON_RAMP_ADDRESS_3, 1); + + Internal.ExecutionReportSingleChain[] memory reports = new Internal.ExecutionReportSingleChain[](2); + reports[0] = _generateReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messages1); + reports[1] = _generateReportFromMessages(SOURCE_CHAIN_SELECTOR_3, messages2); + + vm.recordLogs(); + + vm.expectEmit(); + emit OffRamp.SkippedReportExecution(SOURCE_CHAIN_SELECTOR_1); + + s_offRamp.batchExecute(reports, new uint256[][](2)); + + Vm.Log[] memory logs = vm.getRecordedLogs(); + + for (uint256 i = 0; i < logs.length; ++i) { + if (logs[i].topics[0] == OffRamp.ExecutionStateChanged.selector) { + uint64 logSourceChainSelector = uint64(uint256(logs[i].topics[1])); + uint64 logSequenceNumber = uint64(uint256(logs[i].topics[2])); + bytes32 logMessageId = bytes32(logs[i].topics[3]); + (bytes32 logMessageHash, uint8 logState,,) = abi.decode(logs[i].data, (bytes32, uint8, bytes, uint256)); + assertEq(logMessageId, messages2[0].header.messageId); + assertEq(logSourceChainSelector, messages2[0].header.sourceChainSelector); + assertEq(logSequenceNumber, messages2[0].header.sequenceNumber); + assertEq(logMessageId, messages2[0].header.messageId); + assertEq(logMessageHash, Internal._hash(messages2[0], ON_RAMP_ADDRESS_3)); + assertEq(logState, uint8(Internal.MessageExecutionState.SUCCESS)); + } + } + } + + function test_MultipleReportsSkipDuplicate_Success() public { + Internal.Any2EVMRampMessage[] memory messages = + _generateSingleBasicMessage(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1); + + Internal.ExecutionReportSingleChain[] memory reports = new Internal.ExecutionReportSingleChain[](2); + reports[0] = _generateReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messages); + reports[1] = _generateReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messages); + + vm.expectEmit(); + emit OffRamp.SkippedAlreadyExecutedMessage(SOURCE_CHAIN_SELECTOR_1, messages[0].header.sequenceNumber); + + vm.recordLogs(); + s_offRamp.batchExecute(reports, new uint256[][](2)); + assertExecutionStateChangedEventLogs( + messages[0].header.sourceChainSelector, + messages[0].header.sequenceNumber, + messages[0].header.messageId, + Internal._hash(messages[0], ON_RAMP_ADDRESS_1), + Internal.MessageExecutionState.SUCCESS, + "" + ); + } + + function test_Unhealthy_Success() public { + _setMockRMNChainCurse(SOURCE_CHAIN_SELECTOR_1, true); + vm.expectEmit(); + emit OffRamp.SkippedReportExecution(SOURCE_CHAIN_SELECTOR_1); + s_offRamp.batchExecute( + _generateBatchReportFromMessages( + SOURCE_CHAIN_SELECTOR_1, _generateMessagesWithTokens(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1) + ), + new uint256[][](1) + ); + + _setMockRMNChainCurse(SOURCE_CHAIN_SELECTOR_1, false); + + vm.recordLogs(); + s_offRamp.batchExecute( + _generateBatchReportFromMessages( + SOURCE_CHAIN_SELECTOR_1, _generateMessagesWithTokens(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1) + ), + new uint256[][](1) + ); + + _assertNoEmit(OffRamp.SkippedReportExecution.selector); + } + + // Reverts + function test_ZeroReports_Revert() public { + vm.expectRevert(OffRamp.EmptyReport.selector); + s_offRamp.batchExecute(new Internal.ExecutionReportSingleChain[](0), new uint256[][](1)); + } + + function test_OutOfBoundsGasLimitsAccess_Revert() public { + Internal.Any2EVMRampMessage[] memory messages1 = new Internal.Any2EVMRampMessage[](2); + Internal.Any2EVMRampMessage[] memory messages2 = new Internal.Any2EVMRampMessage[](1); + + messages1[0] = _generateAny2EVMMessageNoTokens(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1, 1); + messages1[1] = _generateAny2EVMMessageNoTokens(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1, 2); + messages2[0] = _generateAny2EVMMessageNoTokens(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1, 3); + + Internal.ExecutionReportSingleChain[] memory reports = new Internal.ExecutionReportSingleChain[](2); + reports[0] = _generateReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messages1); + reports[1] = _generateReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messages2); + + vm.expectRevert(); + s_offRamp.batchExecute(reports, new uint256[][](1)); + } +} + +contract OffRamp_manuallyExecute is OffRampSetup { + function setUp() public virtual override { + super.setUp(); + _setupMultipleOffRamps(); + + s_offRamp.setVerifyOverrideResult(SOURCE_CHAIN_SELECTOR_1, 1); + s_offRamp.setVerifyOverrideResult(SOURCE_CHAIN_SELECTOR_3, 1); + } + + function test_manuallyExecute_Success() public { + Internal.Any2EVMRampMessage[] memory messages = + _generateSingleBasicMessage(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1); + messages[0].receiver = address(s_reverting_receiver); + messages[0].header.messageId = Internal._hash(messages[0], ON_RAMP_ADDRESS_1); + s_offRamp.batchExecute(_generateBatchReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messages), new uint256[][](1)); + + s_reverting_receiver.setRevert(false); + + uint256[][] memory gasLimitOverrides = new uint256[][](1); + gasLimitOverrides[0] = new uint256[](messages.length); + + vm.recordLogs(); + s_offRamp.manuallyExecute(_generateBatchReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messages), gasLimitOverrides); + assertExecutionStateChangedEventLogs( + SOURCE_CHAIN_SELECTOR_1, + messages[0].header.sequenceNumber, + messages[0].header.messageId, + Internal._hash(messages[0], ON_RAMP_ADDRESS_1), + Internal.MessageExecutionState.SUCCESS, + "" + ); + } + + function test_manuallyExecute_WithGasOverride_Success() public { + Internal.Any2EVMRampMessage[] memory messages = + _generateSingleBasicMessage(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1); + messages[0].receiver = address(s_reverting_receiver); + messages[0].header.messageId = Internal._hash(messages[0], ON_RAMP_ADDRESS_1); + s_offRamp.batchExecute(_generateBatchReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messages), new uint256[][](1)); + + s_reverting_receiver.setRevert(false); + + uint256[][] memory gasLimitOverrides = new uint256[][](1); + gasLimitOverrides[0] = _getGasLimitsFromMessages(messages); + gasLimitOverrides[0][0] += 1; + vm.recordLogs(); + s_offRamp.manuallyExecute(_generateBatchReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messages), gasLimitOverrides); + assertExecutionStateChangedEventLogs( + SOURCE_CHAIN_SELECTOR_1, + messages[0].header.sequenceNumber, + messages[0].header.messageId, + Internal._hash(messages[0], ON_RAMP_ADDRESS_1), + Internal.MessageExecutionState.SUCCESS, + "" + ); + } + + function test_manuallyExecute_DoesNotRevertIfUntouched_Success() public { + Internal.Any2EVMRampMessage[] memory messages = + _generateSingleBasicMessage(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1); + messages[0].receiver = address(s_reverting_receiver); + messages[0].header.messageId = Internal._hash(messages[0], ON_RAMP_ADDRESS_1); + + assertEq( + messages[0].header.nonce - 1, s_inboundNonceManager.getInboundNonce(SOURCE_CHAIN_SELECTOR_1, messages[0].sender) + ); + + s_reverting_receiver.setRevert(true); + + uint256[][] memory gasLimitOverrides = new uint256[][](1); + gasLimitOverrides[0] = _getGasLimitsFromMessages(messages); + + vm.recordLogs(); + s_offRamp.manuallyExecute(_generateBatchReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messages), gasLimitOverrides); + assertExecutionStateChangedEventLogs( + SOURCE_CHAIN_SELECTOR_1, + messages[0].header.sequenceNumber, + messages[0].header.messageId, + Internal._hash(messages[0], ON_RAMP_ADDRESS_1), + Internal.MessageExecutionState.FAILURE, + abi.encodeWithSelector( + OffRamp.ReceiverError.selector, abi.encodeWithSelector(MaybeRevertMessageReceiver.CustomError.selector, "") + ) + ); + + assertEq( + messages[0].header.nonce, s_inboundNonceManager.getInboundNonce(SOURCE_CHAIN_SELECTOR_1, messages[0].sender) + ); + } + + function test_manuallyExecute_WithMultiReportGasOverride_Success() public { + Internal.Any2EVMRampMessage[] memory messages1 = new Internal.Any2EVMRampMessage[](3); + Internal.Any2EVMRampMessage[] memory messages2 = new Internal.Any2EVMRampMessage[](2); + + for (uint64 i = 0; i < 3; ++i) { + messages1[i] = _generateAny2EVMMessageNoTokens(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1, i + 1); + messages1[i].receiver = address(s_reverting_receiver); + messages1[i].header.messageId = Internal._hash(messages1[i], ON_RAMP_ADDRESS_1); + } + + for (uint64 i = 0; i < 2; ++i) { + messages2[i] = _generateAny2EVMMessageNoTokens(SOURCE_CHAIN_SELECTOR_3, ON_RAMP_ADDRESS_3, i + 1); + messages2[i].receiver = address(s_reverting_receiver); + messages2[i].header.messageId = Internal._hash(messages2[i], ON_RAMP_ADDRESS_3); + } + + Internal.ExecutionReportSingleChain[] memory reports = new Internal.ExecutionReportSingleChain[](2); + reports[0] = _generateReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messages1); + reports[1] = _generateReportFromMessages(SOURCE_CHAIN_SELECTOR_3, messages2); + + s_offRamp.batchExecute(reports, new uint256[][](2)); + + s_reverting_receiver.setRevert(false); + + uint256[][] memory gasLimitOverrides = new uint256[][](2); + gasLimitOverrides[0] = _getGasLimitsFromMessages(messages1); + gasLimitOverrides[1] = _getGasLimitsFromMessages(messages2); + + for (uint256 i = 0; i < 3; ++i) { + gasLimitOverrides[0][i] += 1; + } + + for (uint256 i = 0; i < 2; ++i) { + gasLimitOverrides[1][i] += 1; + } + + vm.recordLogs(); + s_offRamp.manuallyExecute(reports, gasLimitOverrides); + + Vm.Log[] memory logs = vm.getRecordedLogs(); + + for (uint256 j = 0; j < 3; ++j) { + assertExecutionStateChangedEventLogs( + logs, + SOURCE_CHAIN_SELECTOR_1, + messages1[j].header.sequenceNumber, + messages1[j].header.messageId, + Internal._hash(messages1[j], ON_RAMP_ADDRESS_1), + Internal.MessageExecutionState.SUCCESS, + "" + ); + } + + for (uint256 k = 0; k < 2; ++k) { + assertExecutionStateChangedEventLogs( + logs, + SOURCE_CHAIN_SELECTOR_3, + messages2[k].header.sequenceNumber, + messages2[k].header.messageId, + Internal._hash(messages2[k], ON_RAMP_ADDRESS_3), + Internal.MessageExecutionState.SUCCESS, + "" + ); + } + } + + function test_manuallyExecute_WithPartialMessages_Success() public { + Internal.Any2EVMRampMessage[] memory messages = new Internal.Any2EVMRampMessage[](3); + + for (uint64 i = 0; i < 3; ++i) { + messages[i] = _generateAny2EVMMessageNoTokens(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1, i + 1); + } + + messages[1].receiver = address(s_reverting_receiver); + messages[1].header.messageId = Internal._hash(messages[1], ON_RAMP_ADDRESS_1); + + vm.recordLogs(); + s_offRamp.batchExecute(_generateBatchReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messages), new uint256[][](1)); + + Vm.Log[] memory logs = vm.getRecordedLogs(); + + assertExecutionStateChangedEventLogs( + logs, + SOURCE_CHAIN_SELECTOR_1, + messages[0].header.sequenceNumber, + messages[0].header.messageId, + Internal._hash(messages[0], ON_RAMP_ADDRESS_1), + Internal.MessageExecutionState.SUCCESS, + "" + ); + + assertExecutionStateChangedEventLogs( + logs, + SOURCE_CHAIN_SELECTOR_1, + messages[1].header.sequenceNumber, + messages[1].header.messageId, + Internal._hash(messages[1], ON_RAMP_ADDRESS_1), + Internal.MessageExecutionState.FAILURE, + abi.encodeWithSelector( + OffRamp.ReceiverError.selector, + abi.encodeWithSelector(MaybeRevertMessageReceiver.CustomError.selector, bytes("")) + ) + ); + + assertExecutionStateChangedEventLogs( + logs, + SOURCE_CHAIN_SELECTOR_1, + messages[2].header.sequenceNumber, + messages[2].header.messageId, + Internal._hash(messages[2], ON_RAMP_ADDRESS_1), + Internal.MessageExecutionState.SUCCESS, + "" + ); + + s_reverting_receiver.setRevert(false); + + // Only the 2nd message reverted + Internal.Any2EVMRampMessage[] memory newMessages = new Internal.Any2EVMRampMessage[](1); + newMessages[0] = messages[1]; + + uint256[][] memory gasLimitOverrides = new uint256[][](1); + gasLimitOverrides[0] = _getGasLimitsFromMessages(newMessages); + gasLimitOverrides[0][0] += 1; + + vm.recordLogs(); + s_offRamp.manuallyExecute(_generateBatchReportFromMessages(SOURCE_CHAIN_SELECTOR_1, newMessages), gasLimitOverrides); + assertExecutionStateChangedEventLogs( + SOURCE_CHAIN_SELECTOR_1, + messages[0].header.sequenceNumber, + messages[0].header.messageId, + Internal._hash(messages[0], ON_RAMP_ADDRESS_1), + Internal.MessageExecutionState.SUCCESS, + "" + ); + } + + function test_manuallyExecute_LowGasLimit_Success() public { + Internal.Any2EVMRampMessage[] memory messages = + _generateSingleBasicMessage(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1); + messages[0].gasLimit = 1; + messages[0].receiver = address(new ConformingReceiver(address(s_destRouter), s_destFeeToken)); + messages[0].header.messageId = Internal._hash(messages[0], ON_RAMP_ADDRESS_1); + + vm.recordLogs(); + s_offRamp.batchExecute(_generateBatchReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messages), new uint256[][](1)); + assertExecutionStateChangedEventLogs( + SOURCE_CHAIN_SELECTOR_1, + messages[0].header.sequenceNumber, + messages[0].header.messageId, + Internal._hash(messages[0], ON_RAMP_ADDRESS_1), + Internal.MessageExecutionState.FAILURE, + abi.encodeWithSelector(OffRamp.ReceiverError.selector, "") + ); + + uint256[][] memory gasLimitOverrides = new uint256[][](1); + gasLimitOverrides[0] = new uint256[](1); + gasLimitOverrides[0][0] = 100_000; + + vm.expectEmit(); + emit ConformingReceiver.MessageReceived(); + + vm.recordLogs(); + s_offRamp.manuallyExecute(_generateBatchReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messages), gasLimitOverrides); + assertExecutionStateChangedEventLogs( + SOURCE_CHAIN_SELECTOR_1, + messages[0].header.sequenceNumber, + messages[0].header.messageId, + Internal._hash(messages[0], ON_RAMP_ADDRESS_1), + Internal.MessageExecutionState.SUCCESS, + "" + ); + } + + // Reverts + + function test_manuallyExecute_ForkedChain_Revert() public { + Internal.Any2EVMRampMessage[] memory messages = + _generateSingleBasicMessage(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1); + + Internal.ExecutionReportSingleChain[] memory reports = + _generateBatchReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messages); + uint256 chain1 = block.chainid; + uint256 chain2 = chain1 + 1; + vm.chainId(chain2); + vm.expectRevert(abi.encodeWithSelector(MultiOCR3Base.ForkedChain.selector, chain1, chain2)); + + uint256[][] memory gasLimitOverrides = new uint256[][](1); + gasLimitOverrides[0] = _getGasLimitsFromMessages(messages); + + s_offRamp.manuallyExecute(reports, gasLimitOverrides); + } + + function test_ManualExecGasLimitMismatchSingleReport_Revert() public { + Internal.Any2EVMRampMessage[] memory messages = new Internal.Any2EVMRampMessage[](2); + messages[0] = _generateAny2EVMMessageNoTokens(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1, 1); + messages[1] = _generateAny2EVMMessageNoTokens(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1, 2); + + Internal.ExecutionReportSingleChain[] memory reports = + _generateBatchReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messages); + + // No overrides for report + vm.expectRevert(OffRamp.ManualExecutionGasLimitMismatch.selector); + s_offRamp.manuallyExecute(reports, new uint256[][](0)); + + // No messages + uint256[][] memory gasLimitOverrides = new uint256[][](1); + + vm.expectRevert(OffRamp.ManualExecutionGasLimitMismatch.selector); + s_offRamp.manuallyExecute(reports, gasLimitOverrides); + + // 1 message missing + gasLimitOverrides[0] = new uint256[](1); + + vm.expectRevert(OffRamp.ManualExecutionGasLimitMismatch.selector); + s_offRamp.manuallyExecute(reports, gasLimitOverrides); + + // 1 message in excess + gasLimitOverrides[0] = new uint256[](3); + + vm.expectRevert(OffRamp.ManualExecutionGasLimitMismatch.selector); + s_offRamp.manuallyExecute(reports, gasLimitOverrides); + } + + function test_manuallyExecute_GasLimitMismatchMultipleReports_Revert() public { + Internal.Any2EVMRampMessage[] memory messages1 = new Internal.Any2EVMRampMessage[](2); + Internal.Any2EVMRampMessage[] memory messages2 = new Internal.Any2EVMRampMessage[](1); + + messages1[0] = _generateAny2EVMMessageNoTokens(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1, 1); + messages1[1] = _generateAny2EVMMessageNoTokens(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1, 2); + messages2[0] = _generateAny2EVMMessageNoTokens(SOURCE_CHAIN_SELECTOR_3, ON_RAMP_ADDRESS_3, 1); + + Internal.ExecutionReportSingleChain[] memory reports = new Internal.ExecutionReportSingleChain[](2); + reports[0] = _generateReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messages1); + reports[1] = _generateReportFromMessages(SOURCE_CHAIN_SELECTOR_3, messages2); + + vm.expectRevert(OffRamp.ManualExecutionGasLimitMismatch.selector); + s_offRamp.manuallyExecute(reports, new uint256[][](0)); + + vm.expectRevert(OffRamp.ManualExecutionGasLimitMismatch.selector); + s_offRamp.manuallyExecute(reports, new uint256[][](1)); + + uint256[][] memory gasLimitOverrides = new uint256[][](2); + + vm.expectRevert(OffRamp.ManualExecutionGasLimitMismatch.selector); + s_offRamp.manuallyExecute(reports, gasLimitOverrides); + + // 2nd report empty + gasLimitOverrides[0] = new uint256[](2); + + vm.expectRevert(OffRamp.ManualExecutionGasLimitMismatch.selector); + s_offRamp.manuallyExecute(reports, gasLimitOverrides); + + // 1st report empty + gasLimitOverrides[0] = new uint256[](0); + gasLimitOverrides[1] = new uint256[](1); + + vm.expectRevert(OffRamp.ManualExecutionGasLimitMismatch.selector); + s_offRamp.manuallyExecute(reports, gasLimitOverrides); + + // 1st report oversized + gasLimitOverrides[0] = new uint256[](3); + + vm.expectRevert(OffRamp.ManualExecutionGasLimitMismatch.selector); + s_offRamp.manuallyExecute(reports, gasLimitOverrides); + } + + function test_ManualExecInvalidGasLimit_Revert() public { + Internal.Any2EVMRampMessage[] memory messages = + _generateSingleBasicMessage(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1); + + uint256[][] memory gasLimitOverrides = new uint256[][](1); + gasLimitOverrides[0] = _getGasLimitsFromMessages(messages); + gasLimitOverrides[0][0]--; + + vm.expectRevert( + abi.encodeWithSelector( + OffRamp.InvalidManualExecutionGasLimit.selector, SOURCE_CHAIN_SELECTOR_1, 0, gasLimitOverrides[0][0] + ) + ); + s_offRamp.manuallyExecute(_generateBatchReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messages), gasLimitOverrides); + } + + function test_manuallyExecute_FailedTx_Revert() public { + Internal.Any2EVMRampMessage[] memory messages = + _generateSingleBasicMessage(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1); + + messages[0].receiver = address(s_reverting_receiver); + messages[0].header.messageId = Internal._hash(messages[0], ON_RAMP_ADDRESS_1); + + s_offRamp.batchExecute(_generateBatchReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messages), new uint256[][](1)); + + s_reverting_receiver.setRevert(true); + + uint256[][] memory gasLimitOverrides = new uint256[][](1); + gasLimitOverrides[0] = _getGasLimitsFromMessages(messages); + + vm.expectRevert( + abi.encodeWithSelector( + OffRamp.ExecutionError.selector, + messages[0].header.messageId, + abi.encodeWithSelector( + OffRamp.ReceiverError.selector, + abi.encodeWithSelector(MaybeRevertMessageReceiver.CustomError.selector, bytes("")) + ) + ) + ); + s_offRamp.manuallyExecute(_generateBatchReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messages), gasLimitOverrides); + } + + function test_manuallyExecute_ReentrancyFails_Success() public { + uint256 tokenAmount = 1e9; + IERC20 tokenToAbuse = IERC20(s_destFeeToken); + + // This needs to be deployed before the source chain message is sent + // because we need the address for the receiver. + ReentrancyAbuserMultiRamp receiver = new ReentrancyAbuserMultiRamp(address(s_destRouter), s_offRamp); + uint256 balancePre = tokenToAbuse.balanceOf(address(receiver)); + + // For this test any message will be flagged as correct by the + // commitStore. In a real scenario the abuser would have to actually + // send the message that they want to replay. + Internal.Any2EVMRampMessage[] memory messages = + _generateSingleBasicMessage(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1); + messages[0].tokenAmounts = new Internal.RampTokenAmount[](1); + messages[0].tokenAmounts[0] = Internal.RampTokenAmount({ + sourcePoolAddress: abi.encode(s_sourcePoolByToken[s_sourceFeeToken]), + destTokenAddress: abi.encode(s_destTokenBySourceToken[s_sourceFeeToken]), + extraData: "", + amount: tokenAmount, + destExecData: abi.encode(DEFAULT_TOKEN_DEST_GAS_OVERHEAD) + }); + + messages[0].receiver = address(receiver); + + messages[0].header.messageId = Internal._hash(messages[0], ON_RAMP_ADDRESS_1); + + Internal.ExecutionReportSingleChain memory report = _generateReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messages); + + // sets the report to be repeated on the ReentrancyAbuser to be able to replay + receiver.setPayload(report); + + uint256[][] memory gasLimitOverrides = new uint256[][](1); + gasLimitOverrides[0] = _getGasLimitsFromMessages(messages); + + // The first entry should be fine and triggers the second entry which is skipped. Due to the reentrancy + // the second completes first, so we expect the skip event before the success event. + vm.expectEmit(); + emit OffRamp.SkippedAlreadyExecutedMessage( + messages[0].header.sourceChainSelector, messages[0].header.sequenceNumber + ); + + vm.recordLogs(); + s_offRamp.manuallyExecute(_generateBatchReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messages), gasLimitOverrides); + assertExecutionStateChangedEventLogs( + SOURCE_CHAIN_SELECTOR_1, + messages[0].header.sequenceNumber, + messages[0].header.messageId, + Internal._hash(messages[0], ON_RAMP_ADDRESS_1), + Internal.MessageExecutionState.SUCCESS, + "" + ); + + // Since the tx failed we don't release the tokens + assertEq(tokenToAbuse.balanceOf(address(receiver)), balancePre + tokenAmount); + } + + function test_manuallyExecute_MultipleReportsWithSingleCursedLane_Revert() public { + Internal.Any2EVMRampMessage[] memory messages1 = new Internal.Any2EVMRampMessage[](3); + Internal.Any2EVMRampMessage[] memory messages2 = new Internal.Any2EVMRampMessage[](2); + + for (uint64 i = 0; i < 3; ++i) { + messages1[i] = _generateAny2EVMMessageNoTokens(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1, i + 1); + messages1[i].receiver = address(s_reverting_receiver); + messages1[i].header.messageId = Internal._hash(messages1[i], ON_RAMP_ADDRESS_1); + } + + for (uint64 i = 0; i < 2; ++i) { + messages2[i] = _generateAny2EVMMessageNoTokens(SOURCE_CHAIN_SELECTOR_3, ON_RAMP_ADDRESS_3, i + 1); + messages2[i].receiver = address(s_reverting_receiver); + messages2[i].header.messageId = Internal._hash(messages2[i], ON_RAMP_ADDRESS_3); + } + + Internal.ExecutionReportSingleChain[] memory reports = new Internal.ExecutionReportSingleChain[](2); + reports[0] = _generateReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messages1); + reports[1] = _generateReportFromMessages(SOURCE_CHAIN_SELECTOR_3, messages2); + + uint256[][] memory gasLimitOverrides = new uint256[][](2); + gasLimitOverrides[0] = _getGasLimitsFromMessages(messages1); + gasLimitOverrides[1] = _getGasLimitsFromMessages(messages2); + + _setMockRMNChainCurse(SOURCE_CHAIN_SELECTOR_3, true); + + vm.expectRevert(abi.encodeWithSelector(OffRamp.CursedByRMN.selector, SOURCE_CHAIN_SELECTOR_3)); + + s_offRamp.manuallyExecute(reports, gasLimitOverrides); + } +} + +contract OffRamp_execute is OffRampSetup { + function setUp() public virtual override { + super.setUp(); + _setupMultipleOffRamps(); + s_offRamp.setVerifyOverrideResult(SOURCE_CHAIN_SELECTOR_1, 1); + } + + // Asserts that execute completes + function test_SingleReport_Success() public { + Internal.Any2EVMRampMessage[] memory messages = + _generateSingleBasicMessage(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1); + Internal.ExecutionReportSingleChain[] memory reports = + _generateBatchReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messages); + + vm.expectEmit(); + emit MultiOCR3Base.Transmitted( + uint8(Internal.OCRPluginType.Execution), s_configDigestExec, uint64(uint256(s_configDigestExec)) + ); + + vm.recordLogs(); + + _execute(reports); + + assertExecutionStateChangedEventLogs( + SOURCE_CHAIN_SELECTOR_1, + messages[0].header.sequenceNumber, + messages[0].header.messageId, + Internal._hash(messages[0], ON_RAMP_ADDRESS_1), + Internal.MessageExecutionState.SUCCESS, + "" + ); + } + + function test_MultipleReports_Success() public { + Internal.Any2EVMRampMessage[] memory messages1 = new Internal.Any2EVMRampMessage[](2); + Internal.Any2EVMRampMessage[] memory messages2 = new Internal.Any2EVMRampMessage[](1); + + messages1[0] = _generateAny2EVMMessageNoTokens(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1, 1); + messages1[1] = _generateAny2EVMMessageNoTokens(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1, 2); + messages2[0] = _generateAny2EVMMessageNoTokens(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1, 3); + + Internal.ExecutionReportSingleChain[] memory reports = new Internal.ExecutionReportSingleChain[](2); + reports[0] = _generateReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messages1); + reports[1] = _generateReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messages2); + + vm.expectEmit(); + emit MultiOCR3Base.Transmitted( + uint8(Internal.OCRPluginType.Execution), s_configDigestExec, uint64(uint256(s_configDigestExec)) + ); + + vm.recordLogs(); + _execute(reports); + + Vm.Log[] memory logs = vm.getRecordedLogs(); + + assertExecutionStateChangedEventLogs( + logs, + messages1[0].header.sourceChainSelector, + messages1[0].header.sequenceNumber, + messages1[0].header.messageId, + Internal._hash(messages1[0], ON_RAMP_ADDRESS_1), + Internal.MessageExecutionState.SUCCESS, + "" + ); + + assertExecutionStateChangedEventLogs( + logs, + messages1[1].header.sourceChainSelector, + messages1[1].header.sequenceNumber, + messages1[1].header.messageId, + Internal._hash(messages1[1], ON_RAMP_ADDRESS_1), + Internal.MessageExecutionState.SUCCESS, + "" + ); + + assertExecutionStateChangedEventLogs( + logs, + messages2[0].header.sourceChainSelector, + messages2[0].header.sequenceNumber, + messages2[0].header.messageId, + Internal._hash(messages2[0], ON_RAMP_ADDRESS_1), + Internal.MessageExecutionState.SUCCESS, + "" + ); + } + + function test_LargeBatch_Success() public { + Internal.ExecutionReportSingleChain[] memory reports = new Internal.ExecutionReportSingleChain[](10); + for (uint64 i = 0; i < reports.length; ++i) { + Internal.Any2EVMRampMessage[] memory messages = new Internal.Any2EVMRampMessage[](3); + messages[0] = _generateAny2EVMMessageNoTokens(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1, 1 + i * 3); + messages[1] = _generateAny2EVMMessageNoTokens(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1, 2 + i * 3); + messages[2] = _generateAny2EVMMessageNoTokens(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1, 3 + i * 3); + + reports[i] = _generateReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messages); + } + + vm.expectEmit(); + emit MultiOCR3Base.Transmitted( + uint8(Internal.OCRPluginType.Execution), s_configDigestExec, uint64(uint256(s_configDigestExec)) + ); + + vm.recordLogs(); + _execute(reports); + + Vm.Log[] memory logs = vm.getRecordedLogs(); + + for (uint64 i = 0; i < reports.length; ++i) { + for (uint64 j = 0; j < reports[i].messages.length; ++j) { + assertExecutionStateChangedEventLogs( + logs, + reports[i].messages[j].header.sourceChainSelector, + reports[i].messages[j].header.sequenceNumber, + reports[i].messages[j].header.messageId, + Internal._hash(reports[i].messages[j], ON_RAMP_ADDRESS_1), + Internal.MessageExecutionState.SUCCESS, + "" + ); + } + } + } + + function test_MultipleReportsWithPartialValidationFailures_Success() public { + _enableInboundMessageValidator(); + + Internal.Any2EVMRampMessage[] memory messages1 = new Internal.Any2EVMRampMessage[](2); + Internal.Any2EVMRampMessage[] memory messages2 = new Internal.Any2EVMRampMessage[](1); + + messages1[0] = _generateAny2EVMMessageNoTokens(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1, 1); + messages1[1] = _generateAny2EVMMessageNoTokens(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1, 2); + messages2[0] = _generateAny2EVMMessageNoTokens(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1, 3); + + Internal.ExecutionReportSingleChain[] memory reports = new Internal.ExecutionReportSingleChain[](2); + reports[0] = _generateReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messages1); + reports[1] = _generateReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messages2); + + s_inboundMessageValidator.setMessageIdValidationState(messages1[0].header.messageId, true); + s_inboundMessageValidator.setMessageIdValidationState(messages2[0].header.messageId, true); + + vm.expectEmit(); + emit MultiOCR3Base.Transmitted( + uint8(Internal.OCRPluginType.Execution), s_configDigestExec, uint64(uint256(s_configDigestExec)) + ); + + vm.recordLogs(); + _execute(reports); + + Vm.Log[] memory logs = vm.getRecordedLogs(); + + assertExecutionStateChangedEventLogs( + logs, + messages1[0].header.sourceChainSelector, + messages1[0].header.sequenceNumber, + messages1[0].header.messageId, + Internal._hash(messages1[0], ON_RAMP_ADDRESS_1), + Internal.MessageExecutionState.FAILURE, + abi.encodeWithSelector( + IMessageInterceptor.MessageValidationError.selector, + abi.encodeWithSelector(IMessageInterceptor.MessageValidationError.selector, bytes("Invalid message")) + ) + ); + + assertExecutionStateChangedEventLogs( + logs, + messages1[1].header.sourceChainSelector, + messages1[1].header.sequenceNumber, + messages1[1].header.messageId, + Internal._hash(messages1[1], ON_RAMP_ADDRESS_1), + Internal.MessageExecutionState.SUCCESS, + "" + ); + + assertExecutionStateChangedEventLogs( + logs, + messages2[0].header.sourceChainSelector, + messages2[0].header.sequenceNumber, + messages2[0].header.messageId, + Internal._hash(messages2[0], ON_RAMP_ADDRESS_1), + Internal.MessageExecutionState.FAILURE, + abi.encodeWithSelector( + IMessageInterceptor.MessageValidationError.selector, + abi.encodeWithSelector(IMessageInterceptor.MessageValidationError.selector, bytes("Invalid message")) + ) + ); + } + + // Reverts + + function test_UnauthorizedTransmitter_Revert() public { + bytes32[3] memory reportContext = [s_configDigestExec, s_configDigestExec, s_configDigestExec]; + + Internal.Any2EVMRampMessage[] memory messages = + _generateSingleBasicMessage(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1); + Internal.ExecutionReportSingleChain[] memory reports = + _generateBatchReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messages); + + vm.expectRevert(MultiOCR3Base.UnauthorizedTransmitter.selector); + s_offRamp.execute(reportContext, abi.encode(reports)); + } + + function test_NoConfig_Revert() public { + _redeployOffRampWithNoOCRConfigs(); + s_offRamp.setVerifyOverrideResult(SOURCE_CHAIN_SELECTOR_1, 1); + + Internal.Any2EVMRampMessage[] memory messages = + _generateSingleBasicMessage(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1); + Internal.ExecutionReportSingleChain[] memory reports = + _generateBatchReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messages); + + bytes32[3] memory reportContext = [bytes32(""), s_configDigestExec, s_configDigestExec]; + + vm.startPrank(s_validTransmitters[0]); + vm.expectRevert(MultiOCR3Base.UnauthorizedTransmitter.selector); + s_offRamp.execute(reportContext, abi.encode(reports)); + } + + function test_NoConfigWithOtherConfigPresent_Revert() public { + _redeployOffRampWithNoOCRConfigs(); + s_offRamp.setVerifyOverrideResult(SOURCE_CHAIN_SELECTOR_1, 1); + + MultiOCR3Base.OCRConfigArgs[] memory ocrConfigs = new MultiOCR3Base.OCRConfigArgs[](1); + ocrConfigs[0] = MultiOCR3Base.OCRConfigArgs({ + ocrPluginType: uint8(Internal.OCRPluginType.Commit), + configDigest: s_configDigestCommit, + F: s_F, + isSignatureVerificationEnabled: false, + signers: s_emptySigners, + transmitters: s_validTransmitters + }); + s_offRamp.setOCR3Configs(ocrConfigs); + + Internal.Any2EVMRampMessage[] memory messages = + _generateSingleBasicMessage(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1); + Internal.ExecutionReportSingleChain[] memory reports = + _generateBatchReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messages); + + bytes32[3] memory reportContext = [bytes32(""), s_configDigestExec, s_configDigestExec]; + + vm.startPrank(s_validTransmitters[0]); + vm.expectRevert(MultiOCR3Base.UnauthorizedTransmitter.selector); + s_offRamp.execute(reportContext, abi.encode(reports)); + } + + function test_WrongConfigWithSigners_Revert() public { + _redeployOffRampWithNoOCRConfigs(); + s_offRamp.setVerifyOverrideResult(SOURCE_CHAIN_SELECTOR_1, 1); + + s_configDigestExec = _getBasicConfigDigest(1, s_validSigners, s_validTransmitters); + + MultiOCR3Base.OCRConfigArgs[] memory ocrConfigs = new MultiOCR3Base.OCRConfigArgs[](1); + ocrConfigs[0] = MultiOCR3Base.OCRConfigArgs({ + ocrPluginType: uint8(Internal.OCRPluginType.Execution), + configDigest: s_configDigestExec, + F: s_F, + isSignatureVerificationEnabled: true, + signers: s_validSigners, + transmitters: s_validTransmitters + }); + s_offRamp.setOCR3Configs(ocrConfigs); + + Internal.Any2EVMRampMessage[] memory messages = + _generateSingleBasicMessage(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1); + Internal.ExecutionReportSingleChain[] memory reports = + _generateBatchReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messages); + + vm.expectRevert(); + _execute(reports); + } + + function test_ZeroReports_Revert() public { + Internal.ExecutionReportSingleChain[] memory reports = new Internal.ExecutionReportSingleChain[](0); + + vm.expectRevert(OffRamp.EmptyReport.selector); + _execute(reports); + } + + function test_IncorrectArrayType_Revert() public { + bytes32[3] memory reportContext = [s_configDigestExec, s_configDigestExec, s_configDigestExec]; + + uint256[] memory wrongData = new uint256[](1); + wrongData[0] = 1; + + vm.startPrank(s_validTransmitters[0]); + vm.expectRevert(); + s_offRamp.execute(reportContext, abi.encode(wrongData)); + } + + function test_NonArray_Revert() public { + bytes32[3] memory reportContext = [s_configDigestExec, s_configDigestExec, s_configDigestExec]; + + Internal.Any2EVMRampMessage[] memory messages = + _generateSingleBasicMessage(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1); + Internal.ExecutionReportSingleChain memory report = _generateReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messages); + + vm.startPrank(s_validTransmitters[0]); + vm.expectRevert(); + s_offRamp.execute(reportContext, abi.encode(report)); + } +} + +contract OffRamp_getExecutionState is OffRampSetup { + mapping(uint64 sourceChainSelector => mapping(uint64 seqNum => Internal.MessageExecutionState state)) internal + s_differentialExecutionState; + + /// forge-config: default.fuzz.runs = 32 + /// forge-config: ccip.fuzz.runs = 32 + function test_Fuzz_Differential_Success( + uint64 sourceChainSelector, + uint16[500] memory seqNums, + uint8[500] memory values + ) public { + for (uint256 i = 0; i < seqNums.length; ++i) { + // Only use the first three slots. This makes sure existing slots get overwritten + // as the tests uses 500 sequence numbers. + uint16 seqNum = seqNums[i] % 386; + Internal.MessageExecutionState state = Internal.MessageExecutionState(values[i] % 4); + s_differentialExecutionState[sourceChainSelector][seqNum] = state; + s_offRamp.setExecutionStateHelper(sourceChainSelector, seqNum, state); + assertEq(uint256(state), uint256(s_offRamp.getExecutionState(sourceChainSelector, seqNum))); + } + + for (uint256 i = 0; i < seqNums.length; ++i) { + uint16 seqNum = seqNums[i] % 386; + Internal.MessageExecutionState expectedState = s_differentialExecutionState[sourceChainSelector][seqNum]; + assertEq(uint256(expectedState), uint256(s_offRamp.getExecutionState(sourceChainSelector, seqNum))); + } + } + + function test_GetExecutionState_Success() public { + s_offRamp.setExecutionStateHelper(SOURCE_CHAIN_SELECTOR_1, 0, Internal.MessageExecutionState.FAILURE); + assertEq(s_offRamp.getExecutionStateBitMap(SOURCE_CHAIN_SELECTOR_1, 0), 3); + + s_offRamp.setExecutionStateHelper(SOURCE_CHAIN_SELECTOR_1, 1, Internal.MessageExecutionState.FAILURE); + assertEq(s_offRamp.getExecutionStateBitMap(SOURCE_CHAIN_SELECTOR_1, 0), 3 + (3 << 2)); + + s_offRamp.setExecutionStateHelper(SOURCE_CHAIN_SELECTOR_1, 1, Internal.MessageExecutionState.IN_PROGRESS); + assertEq(s_offRamp.getExecutionStateBitMap(SOURCE_CHAIN_SELECTOR_1, 0), 3 + (1 << 2)); + + s_offRamp.setExecutionStateHelper(SOURCE_CHAIN_SELECTOR_1, 2, Internal.MessageExecutionState.FAILURE); + assertEq(s_offRamp.getExecutionStateBitMap(SOURCE_CHAIN_SELECTOR_1, 0), 3 + (1 << 2) + (3 << 4)); + + s_offRamp.setExecutionStateHelper(SOURCE_CHAIN_SELECTOR_1, 127, Internal.MessageExecutionState.IN_PROGRESS); + assertEq(s_offRamp.getExecutionStateBitMap(SOURCE_CHAIN_SELECTOR_1, 0), 3 + (1 << 2) + (3 << 4) + (1 << 254)); + + s_offRamp.setExecutionStateHelper(SOURCE_CHAIN_SELECTOR_1, 128, Internal.MessageExecutionState.SUCCESS); + assertEq(s_offRamp.getExecutionStateBitMap(SOURCE_CHAIN_SELECTOR_1, 0), 3 + (1 << 2) + (3 << 4) + (1 << 254)); + assertEq(s_offRamp.getExecutionStateBitMap(SOURCE_CHAIN_SELECTOR_1, 1), 2); + + assertEq( + uint256(Internal.MessageExecutionState.FAILURE), uint256(s_offRamp.getExecutionState(SOURCE_CHAIN_SELECTOR_1, 0)) + ); + assertEq( + uint256(Internal.MessageExecutionState.IN_PROGRESS), + uint256(s_offRamp.getExecutionState(SOURCE_CHAIN_SELECTOR_1, 1)) + ); + assertEq( + uint256(Internal.MessageExecutionState.FAILURE), uint256(s_offRamp.getExecutionState(SOURCE_CHAIN_SELECTOR_1, 2)) + ); + assertEq( + uint256(Internal.MessageExecutionState.IN_PROGRESS), + uint256(s_offRamp.getExecutionState(SOURCE_CHAIN_SELECTOR_1, 127)) + ); + assertEq( + uint256(Internal.MessageExecutionState.SUCCESS), + uint256(s_offRamp.getExecutionState(SOURCE_CHAIN_SELECTOR_1, 128)) + ); + } + + function test_GetDifferentChainExecutionState_Success() public { + s_offRamp.setExecutionStateHelper(SOURCE_CHAIN_SELECTOR_1, 0, Internal.MessageExecutionState.FAILURE); + assertEq(s_offRamp.getExecutionStateBitMap(SOURCE_CHAIN_SELECTOR_1, 0), 3); + assertEq(s_offRamp.getExecutionStateBitMap(SOURCE_CHAIN_SELECTOR_1 + 1, 0), 0); + + s_offRamp.setExecutionStateHelper(SOURCE_CHAIN_SELECTOR_1, 127, Internal.MessageExecutionState.IN_PROGRESS); + assertEq(s_offRamp.getExecutionStateBitMap(SOURCE_CHAIN_SELECTOR_1, 0), 3 + (1 << 254)); + assertEq(s_offRamp.getExecutionStateBitMap(SOURCE_CHAIN_SELECTOR_1 + 1, 0), 0); + + s_offRamp.setExecutionStateHelper(SOURCE_CHAIN_SELECTOR_1, 128, Internal.MessageExecutionState.SUCCESS); + assertEq(s_offRamp.getExecutionStateBitMap(SOURCE_CHAIN_SELECTOR_1, 0), 3 + (1 << 254)); + assertEq(s_offRamp.getExecutionStateBitMap(SOURCE_CHAIN_SELECTOR_1, 1), 2); + assertEq(s_offRamp.getExecutionStateBitMap(SOURCE_CHAIN_SELECTOR_1 + 1, 0), 0); + assertEq(s_offRamp.getExecutionStateBitMap(SOURCE_CHAIN_SELECTOR_1 + 1, 1), 0); + + s_offRamp.setExecutionStateHelper(SOURCE_CHAIN_SELECTOR_1 + 1, 127, Internal.MessageExecutionState.FAILURE); + assertEq(s_offRamp.getExecutionStateBitMap(SOURCE_CHAIN_SELECTOR_1, 0), 3 + (1 << 254)); + assertEq(s_offRamp.getExecutionStateBitMap(SOURCE_CHAIN_SELECTOR_1, 1), 2); + assertEq(s_offRamp.getExecutionStateBitMap(SOURCE_CHAIN_SELECTOR_1 + 1, 0), (3 << 254)); + assertEq(s_offRamp.getExecutionStateBitMap(SOURCE_CHAIN_SELECTOR_1 + 1, 1), 0); + + assertEq( + uint256(Internal.MessageExecutionState.FAILURE), uint256(s_offRamp.getExecutionState(SOURCE_CHAIN_SELECTOR_1, 0)) + ); + assertEq( + uint256(Internal.MessageExecutionState.IN_PROGRESS), + uint256(s_offRamp.getExecutionState(SOURCE_CHAIN_SELECTOR_1, 127)) + ); + assertEq( + uint256(Internal.MessageExecutionState.SUCCESS), + uint256(s_offRamp.getExecutionState(SOURCE_CHAIN_SELECTOR_1, 128)) + ); + + assertEq( + uint256(Internal.MessageExecutionState.UNTOUCHED), + uint256(s_offRamp.getExecutionState(SOURCE_CHAIN_SELECTOR_1 + 1, 0)) + ); + assertEq( + uint256(Internal.MessageExecutionState.FAILURE), + uint256(s_offRamp.getExecutionState(SOURCE_CHAIN_SELECTOR_1 + 1, 127)) + ); + assertEq( + uint256(Internal.MessageExecutionState.UNTOUCHED), + uint256(s_offRamp.getExecutionState(SOURCE_CHAIN_SELECTOR_1 + 1, 128)) + ); + } + + function test_FillExecutionState_Success() public { + for (uint64 i = 0; i < 384; ++i) { + s_offRamp.setExecutionStateHelper(SOURCE_CHAIN_SELECTOR_1, i, Internal.MessageExecutionState.FAILURE); + } + + for (uint64 i = 0; i < 384; ++i) { + assertEq( + uint256(Internal.MessageExecutionState.FAILURE), + uint256(s_offRamp.getExecutionState(SOURCE_CHAIN_SELECTOR_1, i)) + ); + } + + for (uint64 i = 0; i < 3; ++i) { + assertEq(type(uint256).max, s_offRamp.getExecutionStateBitMap(SOURCE_CHAIN_SELECTOR_1, i)); + } + + for (uint64 i = 0; i < 384; ++i) { + s_offRamp.setExecutionStateHelper(SOURCE_CHAIN_SELECTOR_1, i, Internal.MessageExecutionState.IN_PROGRESS); + } + + for (uint64 i = 0; i < 384; ++i) { + assertEq( + uint256(Internal.MessageExecutionState.IN_PROGRESS), + uint256(s_offRamp.getExecutionState(SOURCE_CHAIN_SELECTOR_1, i)) + ); + } + + for (uint64 i = 0; i < 3; ++i) { + // 0x555... == 0b101010101010..... + assertEq( + 0x5555555555555555555555555555555555555555555555555555555555555555, + s_offRamp.getExecutionStateBitMap(SOURCE_CHAIN_SELECTOR_1, i) + ); + } + } +} + +contract OffRamp_trialExecute is OffRampSetup { + function setUp() public virtual override { + super.setUp(); + _setupMultipleOffRamps(); + } + + function test_trialExecute_Success() public { + uint256[] memory amounts = new uint256[](2); + amounts[0] = 1000; + amounts[1] = 50; + + Internal.Any2EVMRampMessage memory message = + _generateAny2EVMMessageWithTokens(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1, 1, amounts); + IERC20 dstToken0 = IERC20(s_destTokens[0]); + uint256 startingBalance = dstToken0.balanceOf(message.receiver); + + (Internal.MessageExecutionState newState, bytes memory err) = + s_offRamp.trialExecute(message, new bytes[](message.tokenAmounts.length)); + assertEq(uint256(Internal.MessageExecutionState.SUCCESS), uint256(newState)); + assertEq("", err); + + // Check that the tokens were transferred + assertEq(startingBalance + amounts[0], dstToken0.balanceOf(message.receiver)); + } + + function test_TokenHandlingErrorIsCaught_Success() public { + uint256[] memory amounts = new uint256[](2); + amounts[0] = 1000; + amounts[1] = 50; + + IERC20 dstToken0 = IERC20(s_destTokens[0]); + uint256 startingBalance = dstToken0.balanceOf(OWNER); + + bytes memory errorMessage = "Random token pool issue"; + + Internal.Any2EVMRampMessage memory message = + _generateAny2EVMMessageWithTokens(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1, 1, amounts); + s_maybeRevertingPool.setShouldRevert(errorMessage); + + (Internal.MessageExecutionState newState, bytes memory err) = + s_offRamp.trialExecute(message, new bytes[](message.tokenAmounts.length)); + assertEq(uint256(Internal.MessageExecutionState.FAILURE), uint256(newState)); + assertEq(abi.encodeWithSelector(OffRamp.TokenHandlingError.selector, errorMessage), err); + + // Expect the balance to remain the same + assertEq(startingBalance, dstToken0.balanceOf(OWNER)); + } + + function test_RateLimitError_Success() public { + uint256[] memory amounts = new uint256[](2); + amounts[0] = 1000; + amounts[1] = 50; + + bytes memory errorMessage = abi.encodeWithSelector(RateLimiter.BucketOverfilled.selector); + + Internal.Any2EVMRampMessage memory message = + _generateAny2EVMMessageWithTokens(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1, 1, amounts); + s_maybeRevertingPool.setShouldRevert(errorMessage); + + (Internal.MessageExecutionState newState, bytes memory err) = + s_offRamp.trialExecute(message, new bytes[](message.tokenAmounts.length)); + assertEq(uint256(Internal.MessageExecutionState.FAILURE), uint256(newState)); + assertEq(abi.encodeWithSelector(OffRamp.TokenHandlingError.selector, errorMessage), err); + } + + // TODO test actual pool exists but isn't compatible instead of just no pool + function test_TokenPoolIsNotAContract_Success() public { + uint256[] memory amounts = new uint256[](2); + amounts[0] = 10000; + Internal.Any2EVMRampMessage memory message = + _generateAny2EVMMessageWithTokens(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1, 1, amounts); + + // Happy path, pool is correct + (Internal.MessageExecutionState newState, bytes memory err) = + s_offRamp.trialExecute(message, new bytes[](message.tokenAmounts.length)); + + assertEq(uint256(Internal.MessageExecutionState.SUCCESS), uint256(newState)); + assertEq("", err); + + // address 0 has no contract + assertEq(address(0).code.length, 0); + + message.tokenAmounts[0] = Internal.RampTokenAmount({ + sourcePoolAddress: abi.encode(address(0)), + destTokenAddress: abi.encode(address(0)), + extraData: "", + amount: message.tokenAmounts[0].amount, + destExecData: abi.encode(DEFAULT_TOKEN_DEST_GAS_OVERHEAD) + }); + + message.header.messageId = Internal._hash(message, ON_RAMP_ADDRESS_1); + + // Unhappy path, no revert but marked as failed. + (newState, err) = s_offRamp.trialExecute(message, new bytes[](message.tokenAmounts.length)); + + assertEq(uint256(Internal.MessageExecutionState.FAILURE), uint256(newState)); + assertEq(abi.encodeWithSelector(Internal.InvalidEVMAddress.selector, abi.encode(address(0))), err); + + address notAContract = makeAddr("not_a_contract"); + + message.tokenAmounts[0] = Internal.RampTokenAmount({ + sourcePoolAddress: abi.encode(address(0)), + destTokenAddress: abi.encode(notAContract), + extraData: "", + amount: message.tokenAmounts[0].amount, + destExecData: abi.encode(DEFAULT_TOKEN_DEST_GAS_OVERHEAD) + }); + + message.header.messageId = Internal._hash(message, ON_RAMP_ADDRESS_1); + + (newState, err) = s_offRamp.trialExecute(message, new bytes[](message.tokenAmounts.length)); + + assertEq(uint256(Internal.MessageExecutionState.FAILURE), uint256(newState)); + assertEq(abi.encodeWithSelector(OffRamp.NotACompatiblePool.selector, address(0)), err); + } +} + +contract OffRamp__releaseOrMintSingleToken is OffRampSetup { + function setUp() public virtual override { + super.setUp(); + _setupMultipleOffRamps(); + } + + function test__releaseOrMintSingleToken_Success() public { + uint256 amount = 123123; + address token = s_sourceTokens[0]; + bytes memory originalSender = abi.encode(OWNER); + bytes memory offchainTokenData = abi.encode(keccak256("offchainTokenData")); + + IERC20 dstToken1 = IERC20(s_destTokenBySourceToken[token]); + uint256 startingBalance = dstToken1.balanceOf(OWNER); + + Internal.RampTokenAmount memory tokenAmount = Internal.RampTokenAmount({ + sourcePoolAddress: abi.encode(s_sourcePoolByToken[token]), + destTokenAddress: abi.encode(s_destTokenBySourceToken[token]), + extraData: "", + amount: amount, + destExecData: abi.encode(DEFAULT_TOKEN_DEST_GAS_OVERHEAD) + }); + + vm.expectCall( + s_destPoolBySourceToken[token], + abi.encodeWithSelector( + LockReleaseTokenPool.releaseOrMint.selector, + Pool.ReleaseOrMintInV1({ + originalSender: originalSender, + receiver: OWNER, + amount: amount, + localToken: s_destTokenBySourceToken[token], + remoteChainSelector: SOURCE_CHAIN_SELECTOR_1, + sourcePoolAddress: tokenAmount.sourcePoolAddress, + sourcePoolData: tokenAmount.extraData, + offchainTokenData: offchainTokenData + }) + ) + ); + + s_offRamp.releaseOrMintSingleToken(tokenAmount, originalSender, OWNER, SOURCE_CHAIN_SELECTOR_1, offchainTokenData); + + assertEq(startingBalance + amount, dstToken1.balanceOf(OWNER)); + } + + function test_releaseOrMintToken_InvalidDataLength_Revert() public { + uint256 amount = 123123; + address token = s_sourceTokens[0]; + + Internal.RampTokenAmount memory tokenAmount = Internal.RampTokenAmount({ + sourcePoolAddress: abi.encode(s_sourcePoolByToken[token]), + destTokenAddress: abi.encode(s_destTokenBySourceToken[token]), + extraData: "", + amount: amount, + destExecData: abi.encode(DEFAULT_TOKEN_DEST_GAS_OVERHEAD) + }); + + // Mock the call so returns 2 slots of data + vm.mockCall( + s_destTokenBySourceToken[token], abi.encodeWithSelector(IERC20.balanceOf.selector, OWNER), abi.encode(0, 0) + ); + + vm.expectRevert(abi.encodeWithSelector(OffRamp.InvalidDataLength.selector, Internal.MAX_BALANCE_OF_RET_BYTES, 64)); + + s_offRamp.releaseOrMintSingleToken(tokenAmount, abi.encode(OWNER), OWNER, SOURCE_CHAIN_SELECTOR, ""); + } + + function test_releaseOrMintToken_TokenHandlingError_BalanceOf_Revert() public { + uint256 amount = 123123; + address token = s_sourceTokens[0]; + + Internal.RampTokenAmount memory tokenAmount = Internal.RampTokenAmount({ + sourcePoolAddress: abi.encode(s_sourcePoolByToken[token]), + destTokenAddress: abi.encode(s_destTokenBySourceToken[token]), + extraData: "", + amount: amount, + destExecData: abi.encode(DEFAULT_TOKEN_DEST_GAS_OVERHEAD) + }); + + bytes memory revertData = "failed to balanceOf"; + + // Mock the call so returns 2 slots of data + vm.mockCallRevert( + s_destTokenBySourceToken[token], abi.encodeWithSelector(IERC20.balanceOf.selector, OWNER), revertData + ); + + vm.expectRevert(abi.encodeWithSelector(OffRamp.TokenHandlingError.selector, revertData)); + + s_offRamp.releaseOrMintSingleToken(tokenAmount, abi.encode(OWNER), OWNER, SOURCE_CHAIN_SELECTOR, ""); + } + + function test_releaseOrMintToken_ReleaseOrMintBalanceMismatch_Revert() public { + uint256 amount = 123123; + address token = s_sourceTokens[0]; + uint256 mockedStaticBalance = 50000; + + Internal.RampTokenAmount memory tokenAmount = Internal.RampTokenAmount({ + sourcePoolAddress: abi.encode(s_sourcePoolByToken[token]), + destTokenAddress: abi.encode(s_destTokenBySourceToken[token]), + extraData: "", + amount: amount, + destExecData: abi.encode(DEFAULT_TOKEN_DEST_GAS_OVERHEAD) + }); + + vm.mockCall( + s_destTokenBySourceToken[token], + abi.encodeWithSelector(IERC20.balanceOf.selector, OWNER), + abi.encode(mockedStaticBalance) + ); + + vm.expectRevert( + abi.encodeWithSelector( + OffRamp.ReleaseOrMintBalanceMismatch.selector, amount, mockedStaticBalance, mockedStaticBalance + ) + ); + + s_offRamp.releaseOrMintSingleToken(tokenAmount, abi.encode(OWNER), OWNER, SOURCE_CHAIN_SELECTOR, ""); + } + + function test_releaseOrMintToken_skip_ReleaseOrMintBalanceMismatch_if_pool_Revert() public { + uint256 amount = 123123; + address token = s_sourceTokens[0]; + uint256 mockedStaticBalance = 50000; + + Internal.RampTokenAmount memory tokenAmount = Internal.RampTokenAmount({ + sourcePoolAddress: abi.encode(s_sourcePoolByToken[token]), + destTokenAddress: abi.encode(s_destTokenBySourceToken[token]), + extraData: "", + amount: amount, + destExecData: abi.encode(DEFAULT_TOKEN_DEST_GAS_OVERHEAD) + }); + + // This should make the call fail if it does not skip the check + vm.mockCall( + s_destTokenBySourceToken[token], + abi.encodeWithSelector(IERC20.balanceOf.selector, OWNER), + abi.encode(mockedStaticBalance) + ); + + s_offRamp.releaseOrMintSingleToken( + tokenAmount, abi.encode(OWNER), s_destPoolBySourceToken[token], SOURCE_CHAIN_SELECTOR, "" + ); + } + + function test__releaseOrMintSingleToken_NotACompatiblePool_Revert() public { + uint256 amount = 123123; + address token = s_sourceTokens[0]; + address destToken = s_destTokenBySourceToken[token]; + vm.label(destToken, "destToken"); + bytes memory originalSender = abi.encode(OWNER); + bytes memory offchainTokenData = abi.encode(keccak256("offchainTokenData")); + + Internal.RampTokenAmount memory tokenAmount = Internal.RampTokenAmount({ + sourcePoolAddress: abi.encode(s_sourcePoolByToken[token]), + destTokenAddress: abi.encode(destToken), + extraData: "", + amount: amount, + destExecData: abi.encode(DEFAULT_TOKEN_DEST_GAS_OVERHEAD) + }); + + // Address(0) should always revert + address returnedPool = address(0); + + vm.mockCall( + address(s_tokenAdminRegistry), + abi.encodeWithSelector(ITokenAdminRegistry.getPool.selector, destToken), + abi.encode(returnedPool) + ); + + vm.expectRevert(abi.encodeWithSelector(OffRamp.NotACompatiblePool.selector, returnedPool)); + + s_offRamp.releaseOrMintSingleToken(tokenAmount, originalSender, OWNER, SOURCE_CHAIN_SELECTOR_1, offchainTokenData); + + // A contract that doesn't support the interface should also revert + returnedPool = address(s_offRamp); + + vm.mockCall( + address(s_tokenAdminRegistry), + abi.encodeWithSelector(ITokenAdminRegistry.getPool.selector, destToken), + abi.encode(returnedPool) + ); + + vm.expectRevert(abi.encodeWithSelector(OffRamp.NotACompatiblePool.selector, returnedPool)); + + s_offRamp.releaseOrMintSingleToken(tokenAmount, originalSender, OWNER, SOURCE_CHAIN_SELECTOR_1, offchainTokenData); + } + + function test__releaseOrMintSingleToken_TokenHandlingError_transfer_Revert() public { + address receiver = makeAddr("receiver"); + uint256 amount = 123123; + address token = s_sourceTokens[0]; + address destToken = s_destTokenBySourceToken[token]; + bytes memory originalSender = abi.encode(OWNER); + bytes memory offchainTokenData = abi.encode(keccak256("offchainTokenData")); + + Internal.RampTokenAmount memory tokenAmount = Internal.RampTokenAmount({ + sourcePoolAddress: abi.encode(s_sourcePoolByToken[token]), + destTokenAddress: abi.encode(destToken), + extraData: "", + amount: amount, + destExecData: abi.encode(DEFAULT_TOKEN_DEST_GAS_OVERHEAD) + }); + + bytes memory revertData = "call reverted :o"; + + vm.mockCallRevert(destToken, abi.encodeWithSelector(IERC20.transfer.selector, receiver, amount), revertData); + + vm.expectRevert(abi.encodeWithSelector(OffRamp.TokenHandlingError.selector, revertData)); + s_offRamp.releaseOrMintSingleToken( + tokenAmount, originalSender, receiver, SOURCE_CHAIN_SELECTOR_1, offchainTokenData + ); + } +} + +contract OffRamp_releaseOrMintTokens is OffRampSetup { + function setUp() public virtual override { + super.setUp(); + _setupMultipleOffRamps(); + } + + function test_releaseOrMintTokens_Success() public { + Client.EVMTokenAmount[] memory srcTokenAmounts = _getCastedSourceEVMTokenAmountsWithZeroAmounts(); + IERC20 dstToken1 = IERC20(s_destFeeToken); + uint256 startingBalance = dstToken1.balanceOf(OWNER); + uint256 amount1 = 100; + srcTokenAmounts[0].amount = amount1; + + bytes[] memory offchainTokenData = new bytes[](srcTokenAmounts.length); + offchainTokenData[0] = abi.encode(0x12345678); + + Internal.RampTokenAmount[] memory sourceTokenAmounts = _getDefaultSourceTokenData(srcTokenAmounts); + + vm.expectCall( + s_destPoolBySourceToken[srcTokenAmounts[0].token], + abi.encodeWithSelector( + LockReleaseTokenPool.releaseOrMint.selector, + Pool.ReleaseOrMintInV1({ + originalSender: abi.encode(OWNER), + receiver: OWNER, + amount: srcTokenAmounts[0].amount, + localToken: s_destTokenBySourceToken[srcTokenAmounts[0].token], + remoteChainSelector: SOURCE_CHAIN_SELECTOR_1, + sourcePoolAddress: sourceTokenAmounts[0].sourcePoolAddress, + sourcePoolData: sourceTokenAmounts[0].extraData, + offchainTokenData: offchainTokenData[0] + }) + ) + ); + + s_offRamp.releaseOrMintTokens( + sourceTokenAmounts, abi.encode(OWNER), OWNER, SOURCE_CHAIN_SELECTOR_1, offchainTokenData + ); + + assertEq(startingBalance + amount1, dstToken1.balanceOf(OWNER)); + } + + function test_releaseOrMintTokens_destDenominatedDecimals_Success() public { + Client.EVMTokenAmount[] memory srcTokenAmounts = _getCastedSourceEVMTokenAmountsWithZeroAmounts(); + uint256 amount = 100; + uint256 destinationDenominationMultiplier = 1000; + srcTokenAmounts[1].amount = amount; + + bytes[] memory offchainTokenData = new bytes[](srcTokenAmounts.length); + + Internal.RampTokenAmount[] memory sourceTokenAmounts = _getDefaultSourceTokenData(srcTokenAmounts); + + address pool = s_destPoolBySourceToken[srcTokenAmounts[1].token]; + address destToken = s_destTokenBySourceToken[srcTokenAmounts[1].token]; + + MaybeRevertingBurnMintTokenPool(pool).setReleaseOrMintMultiplier(destinationDenominationMultiplier); + + Client.EVMTokenAmount[] memory destTokenAmounts = s_offRamp.releaseOrMintTokens( + sourceTokenAmounts, abi.encode(OWNER), OWNER, SOURCE_CHAIN_SELECTOR_1, offchainTokenData + ); + assertEq(destTokenAmounts[1].amount, amount * destinationDenominationMultiplier); + assertEq(destTokenAmounts[1].token, destToken); + } + + // Revert + + function test_TokenHandlingError_Reverts() public { + Client.EVMTokenAmount[] memory srcTokenAmounts = _getCastedSourceEVMTokenAmountsWithZeroAmounts(); + + bytes memory unknownError = bytes("unknown error"); + s_maybeRevertingPool.setShouldRevert(unknownError); + + vm.expectRevert(abi.encodeWithSelector(OffRamp.TokenHandlingError.selector, unknownError)); + + s_offRamp.releaseOrMintTokens( + _getDefaultSourceTokenData(srcTokenAmounts), + abi.encode(OWNER), + OWNER, + SOURCE_CHAIN_SELECTOR_1, + new bytes[](srcTokenAmounts.length) + ); + } + + function test_releaseOrMintTokens_InvalidDataLengthReturnData_Revert() public { + uint256 amount = 100; + Client.EVMTokenAmount[] memory srcTokenAmounts = _getCastedSourceEVMTokenAmountsWithZeroAmounts(); + srcTokenAmounts[0].amount = amount; + + bytes[] memory offchainTokenData = new bytes[](srcTokenAmounts.length); + Internal.RampTokenAmount[] memory sourceTokenAmounts = _getDefaultSourceTokenData(srcTokenAmounts); + + vm.mockCall( + s_destPoolBySourceToken[srcTokenAmounts[0].token], + abi.encodeWithSelector( + LockReleaseTokenPool.releaseOrMint.selector, + Pool.ReleaseOrMintInV1({ + originalSender: abi.encode(OWNER), + receiver: OWNER, + amount: amount, + localToken: s_destTokenBySourceToken[srcTokenAmounts[0].token], + remoteChainSelector: SOURCE_CHAIN_SELECTOR_1, + sourcePoolAddress: sourceTokenAmounts[0].sourcePoolAddress, + sourcePoolData: sourceTokenAmounts[0].extraData, + offchainTokenData: offchainTokenData[0] + }) + ), + // Includes the amount twice, this will revert due to the return data being to long + abi.encode(amount, amount) + ); + + vm.expectRevert(abi.encodeWithSelector(OffRamp.InvalidDataLength.selector, Pool.CCIP_LOCK_OR_BURN_V1_RET_BYTES, 64)); + + s_offRamp.releaseOrMintTokens( + sourceTokenAmounts, abi.encode(OWNER), OWNER, SOURCE_CHAIN_SELECTOR_1, offchainTokenData + ); + } + + function test_releaseOrMintTokens_InvalidEVMAddress_Revert() public { + Client.EVMTokenAmount[] memory srcTokenAmounts = _getCastedSourceEVMTokenAmountsWithZeroAmounts(); + + bytes[] memory offchainTokenData = new bytes[](srcTokenAmounts.length); + Internal.RampTokenAmount[] memory sourceTokenAmounts = _getDefaultSourceTokenData(srcTokenAmounts); + bytes memory wrongAddress = abi.encode(address(1000), address(10000), address(10000)); + + sourceTokenAmounts[0].destTokenAddress = wrongAddress; + + vm.expectRevert(abi.encodeWithSelector(Internal.InvalidEVMAddress.selector, wrongAddress)); + + s_offRamp.releaseOrMintTokens( + sourceTokenAmounts, abi.encode(OWNER), OWNER, SOURCE_CHAIN_SELECTOR_1, offchainTokenData + ); + } + + function test__releaseOrMintTokens_PoolIsNotAPool_Reverts() public { + // The offRamp is a contract, but not a pool + address fakePoolAddress = address(s_offRamp); + + Internal.RampTokenAmount[] memory sourceTokenAmounts = new Internal.RampTokenAmount[](1); + sourceTokenAmounts[0] = Internal.RampTokenAmount({ + sourcePoolAddress: abi.encode(fakePoolAddress), + destTokenAddress: abi.encode(s_offRamp), + extraData: "", + amount: 1, + destExecData: abi.encode(DEFAULT_TOKEN_DEST_GAS_OVERHEAD) + }); + + vm.expectRevert(abi.encodeWithSelector(OffRamp.NotACompatiblePool.selector, address(0))); + s_offRamp.releaseOrMintTokens(sourceTokenAmounts, abi.encode(OWNER), OWNER, SOURCE_CHAIN_SELECTOR_1, new bytes[](1)); + } + + function test_releaseOrMintTokens_PoolDoesNotSupportDest_Reverts() public { + Client.EVMTokenAmount[] memory srcTokenAmounts = _getCastedSourceEVMTokenAmountsWithZeroAmounts(); + uint256 amount1 = 100; + srcTokenAmounts[0].amount = amount1; + + bytes[] memory offchainTokenData = new bytes[](srcTokenAmounts.length); + offchainTokenData[0] = abi.encode(0x12345678); + + Internal.RampTokenAmount[] memory sourceTokenAmounts = _getDefaultSourceTokenData(srcTokenAmounts); + + vm.expectCall( + s_destPoolBySourceToken[srcTokenAmounts[0].token], + abi.encodeWithSelector( + LockReleaseTokenPool.releaseOrMint.selector, + Pool.ReleaseOrMintInV1({ + originalSender: abi.encode(OWNER), + receiver: OWNER, + amount: srcTokenAmounts[0].amount, + localToken: s_destTokenBySourceToken[srcTokenAmounts[0].token], + remoteChainSelector: SOURCE_CHAIN_SELECTOR_3, + sourcePoolAddress: sourceTokenAmounts[0].sourcePoolAddress, + sourcePoolData: sourceTokenAmounts[0].extraData, + offchainTokenData: offchainTokenData[0] + }) + ) + ); + vm.expectRevert(); + s_offRamp.releaseOrMintTokens( + sourceTokenAmounts, abi.encode(OWNER), OWNER, SOURCE_CHAIN_SELECTOR_3, offchainTokenData + ); + } + + /// forge-config: default.fuzz.runs = 32 + /// forge-config: ccip.fuzz.runs = 1024 + // Uint256 gives a good range of values to test, both inside and outside of the eth address space. + function test_Fuzz__releaseOrMintTokens_AnyRevertIsCaught_Success(uint256 destPool) public { + // Input 447301751254033913445893214690834296930546521452, which is 0x4E59B44847B379578588920CA78FBF26C0B4956C + // triggers some Create2Deployer and causes it to fail + vm.assume(destPool != 447301751254033913445893214690834296930546521452); + bytes memory unusedVar = abi.encode(makeAddr("unused")); + Internal.RampTokenAmount[] memory sourceTokenAmounts = new Internal.RampTokenAmount[](1); + sourceTokenAmounts[0] = Internal.RampTokenAmount({ + sourcePoolAddress: unusedVar, + destTokenAddress: abi.encode(destPool), + extraData: unusedVar, + amount: 1, + destExecData: abi.encode(DEFAULT_TOKEN_DEST_GAS_OVERHEAD) + }); + + try s_offRamp.releaseOrMintTokens( + sourceTokenAmounts, abi.encode(OWNER), OWNER, SOURCE_CHAIN_SELECTOR_1, new bytes[](1) + ) {} catch (bytes memory reason) { + // Any revert should be a TokenHandlingError, InvalidEVMAddress, InvalidDataLength or NoContract as those are caught by the offramp + assertTrue( + bytes4(reason) == OffRamp.TokenHandlingError.selector || bytes4(reason) == Internal.InvalidEVMAddress.selector + || bytes4(reason) == OffRamp.InvalidDataLength.selector + || bytes4(reason) == CallWithExactGas.NoContract.selector + || bytes4(reason) == OffRamp.NotACompatiblePool.selector, + "Expected TokenHandlingError or InvalidEVMAddress" + ); + + if (destPool > type(uint160).max) { + assertEq(reason, abi.encodeWithSelector(Internal.InvalidEVMAddress.selector, abi.encode(destPool))); + } + } + } +} + +contract OffRamp_applySourceChainConfigUpdates is OffRampSetup { + function test_ApplyZeroUpdates_Success() public { + OffRamp.SourceChainConfigArgs[] memory sourceChainConfigs = new OffRamp.SourceChainConfigArgs[](0); + + vm.recordLogs(); + s_offRamp.applySourceChainConfigUpdates(sourceChainConfigs); + + // No logs emitted + Vm.Log[] memory logEntries = vm.getRecordedLogs(); + assertEq(logEntries.length, 0); + + // assertEq(s_offRamp.getSourceChainSelectors().length, 0); + } + + function test_AddNewChain_Success() public { + OffRamp.SourceChainConfigArgs[] memory sourceChainConfigs = new OffRamp.SourceChainConfigArgs[](1); + sourceChainConfigs[0] = OffRamp.SourceChainConfigArgs({ + router: s_destRouter, + sourceChainSelector: SOURCE_CHAIN_SELECTOR_1, + onRamp: ON_RAMP_ADDRESS_1, + isEnabled: true + }); + + OffRamp.SourceChainConfig memory expectedSourceChainConfig = + OffRamp.SourceChainConfig({router: s_destRouter, isEnabled: true, minSeqNr: 1, onRamp: ON_RAMP_ADDRESS_1}); + + vm.expectEmit(); + emit OffRamp.SourceChainSelectorAdded(SOURCE_CHAIN_SELECTOR_1); + + vm.expectEmit(); + emit OffRamp.SourceChainConfigSet(SOURCE_CHAIN_SELECTOR_1, expectedSourceChainConfig); + + s_offRamp.applySourceChainConfigUpdates(sourceChainConfigs); + + _assertSourceChainConfigEquality(s_offRamp.getSourceChainConfig(SOURCE_CHAIN_SELECTOR_1), expectedSourceChainConfig); + } + + function test_ReplaceExistingChain_Success() public { + OffRamp.SourceChainConfigArgs[] memory sourceChainConfigs = new OffRamp.SourceChainConfigArgs[](1); + sourceChainConfigs[0] = OffRamp.SourceChainConfigArgs({ + router: s_destRouter, + sourceChainSelector: SOURCE_CHAIN_SELECTOR_1, + onRamp: ON_RAMP_ADDRESS_1, + isEnabled: true + }); + + s_offRamp.applySourceChainConfigUpdates(sourceChainConfigs); + + sourceChainConfigs[0].isEnabled = false; + OffRamp.SourceChainConfig memory expectedSourceChainConfig = + OffRamp.SourceChainConfig({router: s_destRouter, isEnabled: false, minSeqNr: 1, onRamp: ON_RAMP_ADDRESS_1}); + + vm.expectEmit(); + emit OffRamp.SourceChainConfigSet(SOURCE_CHAIN_SELECTOR_1, expectedSourceChainConfig); + + vm.recordLogs(); + s_offRamp.applySourceChainConfigUpdates(sourceChainConfigs); + + // No log emitted for chain selector added (only for setting the config) + Vm.Log[] memory logEntries = vm.getRecordedLogs(); + assertEq(logEntries.length, 1); + + _assertSourceChainConfigEquality(s_offRamp.getSourceChainConfig(SOURCE_CHAIN_SELECTOR_1), expectedSourceChainConfig); + + // uint64[] memory resultSourceChainSelectors = s_offRamp.getSourceChainSelectors(); + // assertEq(resultSourceChainSelectors.length, 1); + // assertEq(resultSourceChainSelectors[0], SOURCE_CHAIN_SELECTOR_1); + } + + function test_AddMultipleChains_Success() public { + OffRamp.SourceChainConfigArgs[] memory sourceChainConfigs = new OffRamp.SourceChainConfigArgs[](3); + sourceChainConfigs[0] = OffRamp.SourceChainConfigArgs({ + router: s_destRouter, + sourceChainSelector: SOURCE_CHAIN_SELECTOR_1, + onRamp: abi.encode(ON_RAMP_ADDRESS_1, 0), + isEnabled: true + }); + sourceChainConfigs[1] = OffRamp.SourceChainConfigArgs({ + router: s_destRouter, + sourceChainSelector: SOURCE_CHAIN_SELECTOR_1 + 1, + onRamp: abi.encode(ON_RAMP_ADDRESS_1, 1), + isEnabled: false + }); + sourceChainConfigs[2] = OffRamp.SourceChainConfigArgs({ + router: s_destRouter, + sourceChainSelector: SOURCE_CHAIN_SELECTOR_1 + 2, + onRamp: abi.encode(ON_RAMP_ADDRESS_1, 2), + isEnabled: true + }); + + OffRamp.SourceChainConfig[] memory expectedSourceChainConfigs = new OffRamp.SourceChainConfig[](3); + for (uint256 i = 0; i < 3; ++i) { + expectedSourceChainConfigs[i] = OffRamp.SourceChainConfig({ + router: s_destRouter, + isEnabled: sourceChainConfigs[i].isEnabled, + minSeqNr: 1, + onRamp: abi.encode(ON_RAMP_ADDRESS_1, i) + }); + + vm.expectEmit(); + emit OffRamp.SourceChainSelectorAdded(sourceChainConfigs[i].sourceChainSelector); + + vm.expectEmit(); + emit OffRamp.SourceChainConfigSet(sourceChainConfigs[i].sourceChainSelector, expectedSourceChainConfigs[i]); + } + + s_offRamp.applySourceChainConfigUpdates(sourceChainConfigs); + + for (uint256 i = 0; i < 3; ++i) { + _assertSourceChainConfigEquality( + s_offRamp.getSourceChainConfig(sourceChainConfigs[i].sourceChainSelector), expectedSourceChainConfigs[i] + ); + } + } + + function test_Fuzz_applySourceChainConfigUpdate_Success( + OffRamp.SourceChainConfigArgs memory sourceChainConfigArgs + ) public { + // Skip invalid inputs + vm.assume(sourceChainConfigArgs.sourceChainSelector != 0); + vm.assume(sourceChainConfigArgs.onRamp.length != 0); + vm.assume(address(sourceChainConfigArgs.router) != address(0)); + + OffRamp.SourceChainConfigArgs[] memory sourceChainConfigs = new OffRamp.SourceChainConfigArgs[](2); + sourceChainConfigs[0] = OffRamp.SourceChainConfigArgs({ + router: s_destRouter, + sourceChainSelector: SOURCE_CHAIN_SELECTOR_1, + onRamp: ON_RAMP_ADDRESS_1, + isEnabled: true + }); + sourceChainConfigs[1] = sourceChainConfigArgs; + + // Handle cases when an update occurs + bool isNewChain = sourceChainConfigs[1].sourceChainSelector != SOURCE_CHAIN_SELECTOR_1; + if (!isNewChain) { + sourceChainConfigs[1].onRamp = sourceChainConfigs[0].onRamp; + } + + OffRamp.SourceChainConfig memory expectedSourceChainConfig = OffRamp.SourceChainConfig({ + router: sourceChainConfigArgs.router, + isEnabled: sourceChainConfigArgs.isEnabled, + minSeqNr: 1, + onRamp: sourceChainConfigArgs.onRamp + }); + + if (isNewChain) { + vm.expectEmit(); + emit OffRamp.SourceChainSelectorAdded(sourceChainConfigArgs.sourceChainSelector); + } + + vm.expectEmit(); + emit OffRamp.SourceChainConfigSet(sourceChainConfigArgs.sourceChainSelector, expectedSourceChainConfig); + + s_offRamp.applySourceChainConfigUpdates(sourceChainConfigs); + + _assertSourceChainConfigEquality( + s_offRamp.getSourceChainConfig(sourceChainConfigArgs.sourceChainSelector), expectedSourceChainConfig + ); + } + + // Reverts + + function test_ZeroOnRampAddress_Revert() public { + OffRamp.SourceChainConfigArgs[] memory sourceChainConfigs = new OffRamp.SourceChainConfigArgs[](1); + sourceChainConfigs[0] = OffRamp.SourceChainConfigArgs({ + router: s_destRouter, + sourceChainSelector: SOURCE_CHAIN_SELECTOR_1, + onRamp: new bytes(0), + isEnabled: true + }); + + vm.expectRevert(OffRamp.ZeroAddressNotAllowed.selector); + s_offRamp.applySourceChainConfigUpdates(sourceChainConfigs); + } + + function test_RouterAddress_Revert() public { + OffRamp.SourceChainConfigArgs[] memory sourceChainConfigs = new OffRamp.SourceChainConfigArgs[](1); + sourceChainConfigs[0] = OffRamp.SourceChainConfigArgs({ + router: IRouter(address(0)), + sourceChainSelector: SOURCE_CHAIN_SELECTOR_1, + onRamp: ON_RAMP_ADDRESS_1, + isEnabled: true + }); + + vm.expectRevert(OffRamp.ZeroAddressNotAllowed.selector); + s_offRamp.applySourceChainConfigUpdates(sourceChainConfigs); + } + + function test_ZeroSourceChainSelector_Revert() public { + OffRamp.SourceChainConfigArgs[] memory sourceChainConfigs = new OffRamp.SourceChainConfigArgs[](1); + sourceChainConfigs[0] = OffRamp.SourceChainConfigArgs({ + router: s_destRouter, + sourceChainSelector: 0, + onRamp: ON_RAMP_ADDRESS_1, + isEnabled: true + }); + + vm.expectRevert(OffRamp.ZeroChainSelectorNotAllowed.selector); + s_offRamp.applySourceChainConfigUpdates(sourceChainConfigs); + } + + function test_ReplaceExistingChainOnRamp_Revert() public { + OffRamp.SourceChainConfigArgs[] memory sourceChainConfigs = new OffRamp.SourceChainConfigArgs[](1); + sourceChainConfigs[0] = OffRamp.SourceChainConfigArgs({ + router: s_destRouter, + sourceChainSelector: SOURCE_CHAIN_SELECTOR_1, + onRamp: ON_RAMP_ADDRESS_1, + isEnabled: true + }); + + s_offRamp.applySourceChainConfigUpdates(sourceChainConfigs); + + sourceChainConfigs[0].onRamp = ON_RAMP_ADDRESS_2; + + vm.expectRevert(abi.encodeWithSelector(OffRamp.InvalidStaticConfig.selector, SOURCE_CHAIN_SELECTOR_1)); + s_offRamp.applySourceChainConfigUpdates(sourceChainConfigs); + } +} + +contract OffRamp_commit is OffRampSetup { + uint64 internal s_maxInterval = 12; + + function setUp() public virtual override { + super.setUp(); + _setupMultipleOffRamps(); + + s_latestSequenceNumber = uint64(uint256(s_configDigestCommit)); + } + + function test_ReportAndPriceUpdate_Success() public { + OffRamp.CommitReport memory commitReport = _constructCommitReport(); + + vm.expectEmit(); + emit OffRamp.CommitReportAccepted(commitReport); + + vm.expectEmit(); + emit MultiOCR3Base.Transmitted(uint8(Internal.OCRPluginType.Commit), s_configDigestCommit, s_latestSequenceNumber); + + _commit(commitReport, s_latestSequenceNumber); + + assertEq(s_maxInterval + 1, s_offRamp.getSourceChainConfig(SOURCE_CHAIN_SELECTOR).minSeqNr); + assertEq(s_latestSequenceNumber, s_offRamp.getLatestPriceSequenceNumber()); + } + + function test_ReportOnlyRootSuccess_gas() public { + uint64 max1 = 931; + bytes32 root = "Only a single root"; + + Internal.MerkleRoot[] memory roots = new Internal.MerkleRoot[](1); + roots[0] = Internal.MerkleRoot({ + sourceChainSelector: SOURCE_CHAIN_SELECTOR_1, + minSeqNr: 1, + maxSeqNr: max1, + merkleRoot: root, + onRampAddress: abi.encode(ON_RAMP_ADDRESS_1) + }); + + OffRamp.CommitReport memory commitReport = + OffRamp.CommitReport({priceUpdates: _getEmptyPriceUpdates(), merkleRoots: roots, rmnSignatures: s_rmnSignatures}); + + vm.expectEmit(); + emit OffRamp.CommitReportAccepted(commitReport); + + vm.expectEmit(); + emit MultiOCR3Base.Transmitted(uint8(Internal.OCRPluginType.Commit), s_configDigestCommit, s_latestSequenceNumber); + + _commit(commitReport, s_latestSequenceNumber); + + assertEq(max1 + 1, s_offRamp.getSourceChainConfig(SOURCE_CHAIN_SELECTOR).minSeqNr); + assertEq(0, s_offRamp.getLatestPriceSequenceNumber()); + assertEq(block.timestamp, s_offRamp.getMerkleRoot(SOURCE_CHAIN_SELECTOR_1, root)); + } + + function test_StaleReportWithRoot_Success() public { + uint64 maxSeq = 12; + uint224 tokenStartPrice = IFeeQuoter(s_offRamp.getDynamicConfig().feeQuoter).getTokenPrice(s_sourceFeeToken).value; + + Internal.MerkleRoot[] memory roots = new Internal.MerkleRoot[](1); + roots[0] = Internal.MerkleRoot({ + sourceChainSelector: SOURCE_CHAIN_SELECTOR_1, + minSeqNr: 1, + maxSeqNr: maxSeq, + merkleRoot: "stale report 1", + onRampAddress: abi.encode(ON_RAMP_ADDRESS_1) + }); + OffRamp.CommitReport memory commitReport = + OffRamp.CommitReport({priceUpdates: _getEmptyPriceUpdates(), merkleRoots: roots, rmnSignatures: s_rmnSignatures}); + + vm.expectEmit(); + emit OffRamp.CommitReportAccepted(commitReport); + + vm.expectEmit(); + emit MultiOCR3Base.Transmitted(uint8(Internal.OCRPluginType.Commit), s_configDigestCommit, s_latestSequenceNumber); + + _commit(commitReport, s_latestSequenceNumber); + + assertEq(maxSeq + 1, s_offRamp.getSourceChainConfig(SOURCE_CHAIN_SELECTOR).minSeqNr); + assertEq(0, s_offRamp.getLatestPriceSequenceNumber()); + + commitReport.merkleRoots[0].minSeqNr = maxSeq + 1; + commitReport.merkleRoots[0].maxSeqNr = maxSeq * 2; + commitReport.merkleRoots[0].merkleRoot = "stale report 2"; + + vm.expectEmit(); + emit OffRamp.CommitReportAccepted(commitReport); + + vm.expectEmit(); + emit MultiOCR3Base.Transmitted(uint8(Internal.OCRPluginType.Commit), s_configDigestCommit, s_latestSequenceNumber); + + _commit(commitReport, s_latestSequenceNumber); + + assertEq(maxSeq * 2 + 1, s_offRamp.getSourceChainConfig(SOURCE_CHAIN_SELECTOR).minSeqNr); + assertEq(0, s_offRamp.getLatestPriceSequenceNumber()); + assertEq(tokenStartPrice, IFeeQuoter(s_offRamp.getDynamicConfig().feeQuoter).getTokenPrice(s_sourceFeeToken).value); + } + + function test_OnlyTokenPriceUpdates_Success() public { + // force RMN verification to fail + vm.mockCallRevert(address(s_mockRMNRemote), abi.encodeWithSelector(IRMNV2.verify.selector), bytes("")); + + Internal.MerkleRoot[] memory roots = new Internal.MerkleRoot[](0); + OffRamp.CommitReport memory commitReport = OffRamp.CommitReport({ + priceUpdates: _getSingleTokenPriceUpdateStruct(s_sourceFeeToken, 4e18), + merkleRoots: roots, + rmnSignatures: s_rmnSignatures + }); + + vm.expectEmit(); + emit FeeQuoter.UsdPerTokenUpdated(s_sourceFeeToken, 4e18, block.timestamp); + + vm.expectEmit(); + emit MultiOCR3Base.Transmitted(uint8(Internal.OCRPluginType.Commit), s_configDigestCommit, s_latestSequenceNumber); + + _commit(commitReport, s_latestSequenceNumber); + + assertEq(s_latestSequenceNumber, s_offRamp.getLatestPriceSequenceNumber()); + } + + function test_OnlyGasPriceUpdates_Success() public { + // force RMN verification to fail + vm.mockCallRevert(address(s_mockRMNRemote), abi.encodeWithSelector(IRMNV2.verify.selector), bytes("")); + + Internal.MerkleRoot[] memory roots = new Internal.MerkleRoot[](0); + OffRamp.CommitReport memory commitReport = OffRamp.CommitReport({ + priceUpdates: _getSingleTokenPriceUpdateStruct(s_sourceFeeToken, 4e18), + merkleRoots: roots, + rmnSignatures: s_rmnSignatures + }); + + vm.expectEmit(); + emit FeeQuoter.UsdPerTokenUpdated(s_sourceFeeToken, 4e18, block.timestamp); + + vm.expectEmit(); + emit MultiOCR3Base.Transmitted(uint8(Internal.OCRPluginType.Commit), s_configDigestCommit, s_latestSequenceNumber); + + _commit(commitReport, s_latestSequenceNumber); + assertEq(s_latestSequenceNumber, s_offRamp.getLatestPriceSequenceNumber()); + } + + function test_PriceSequenceNumberCleared_Success() public { + Internal.MerkleRoot[] memory roots = new Internal.MerkleRoot[](0); + OffRamp.CommitReport memory commitReport = OffRamp.CommitReport({ + priceUpdates: _getSingleTokenPriceUpdateStruct(s_sourceFeeToken, 4e18), + merkleRoots: roots, + rmnSignatures: s_rmnSignatures + }); + + vm.expectEmit(); + emit FeeQuoter.UsdPerTokenUpdated(s_sourceFeeToken, 4e18, block.timestamp); + _commit(commitReport, s_latestSequenceNumber); + + assertEq(s_latestSequenceNumber, s_offRamp.getLatestPriceSequenceNumber()); + + vm.startPrank(OWNER); + MultiOCR3Base.OCRConfigArgs[] memory ocrConfigs = new MultiOCR3Base.OCRConfigArgs[](1); + ocrConfigs[0] = MultiOCR3Base.OCRConfigArgs({ + ocrPluginType: uint8(Internal.OCRPluginType.Execution), + configDigest: s_configDigestExec, + F: s_F, + isSignatureVerificationEnabled: false, + signers: s_emptySigners, + transmitters: s_validTransmitters + }); + s_offRamp.setOCR3Configs(ocrConfigs); + + // Execution plugin OCR config should not clear latest epoch and round + assertEq(s_latestSequenceNumber, s_offRamp.getLatestPriceSequenceNumber()); + + // Commit plugin config should clear latest epoch & round + ocrConfigs[0] = MultiOCR3Base.OCRConfigArgs({ + ocrPluginType: uint8(Internal.OCRPluginType.Commit), + configDigest: s_configDigestCommit, + F: s_F, + isSignatureVerificationEnabled: true, + signers: s_validSigners, + transmitters: s_validTransmitters + }); + s_offRamp.setOCR3Configs(ocrConfigs); + + assertEq(0, s_offRamp.getLatestPriceSequenceNumber()); + + // The same sequence number can be reported again + vm.expectEmit(); + emit FeeQuoter.UsdPerTokenUpdated(s_sourceFeeToken, 4e18, block.timestamp); + + _commit(commitReport, s_latestSequenceNumber); + } + + function test_ValidPriceUpdateThenStaleReportWithRoot_Success() public { + uint64 maxSeq = 12; + uint224 tokenPrice1 = 4e18; + uint224 tokenPrice2 = 5e18; + Internal.MerkleRoot[] memory roots = new Internal.MerkleRoot[](0); + OffRamp.CommitReport memory commitReport = OffRamp.CommitReport({ + priceUpdates: _getSingleTokenPriceUpdateStruct(s_sourceFeeToken, tokenPrice1), + merkleRoots: roots, + rmnSignatures: s_rmnSignatures + }); + + vm.expectEmit(); + emit FeeQuoter.UsdPerTokenUpdated(s_sourceFeeToken, tokenPrice1, block.timestamp); + + vm.expectEmit(); + emit MultiOCR3Base.Transmitted(uint8(Internal.OCRPluginType.Commit), s_configDigestCommit, s_latestSequenceNumber); + + _commit(commitReport, s_latestSequenceNumber); + assertEq(s_latestSequenceNumber, s_offRamp.getLatestPriceSequenceNumber()); + + roots = new Internal.MerkleRoot[](1); + roots[0] = Internal.MerkleRoot({ + sourceChainSelector: SOURCE_CHAIN_SELECTOR_1, + minSeqNr: 1, + maxSeqNr: maxSeq, + merkleRoot: "stale report", + onRampAddress: abi.encode(ON_RAMP_ADDRESS_1) + }); + commitReport.priceUpdates = _getSingleTokenPriceUpdateStruct(s_sourceFeeToken, tokenPrice2); + commitReport.merkleRoots = roots; + + vm.expectEmit(); + emit OffRamp.CommitReportAccepted(commitReport); + + vm.expectEmit(); + emit MultiOCR3Base.Transmitted(uint8(Internal.OCRPluginType.Commit), s_configDigestCommit, s_latestSequenceNumber); + + _commit(commitReport, s_latestSequenceNumber); + + assertEq(maxSeq + 1, s_offRamp.getSourceChainConfig(SOURCE_CHAIN_SELECTOR).minSeqNr); + assertEq(tokenPrice1, IFeeQuoter(s_offRamp.getDynamicConfig().feeQuoter).getTokenPrice(s_sourceFeeToken).value); + assertEq(s_latestSequenceNumber, s_offRamp.getLatestPriceSequenceNumber()); + } + + // Reverts + + function test_UnauthorizedTransmitter_Revert() public { + OffRamp.CommitReport memory commitReport = _constructCommitReport(); + + bytes32[3] memory reportContext = + [s_configDigestCommit, bytes32(uint256(s_latestSequenceNumber)), s_configDigestCommit]; + + (bytes32[] memory rs, bytes32[] memory ss,, bytes32 rawVs) = + _getSignaturesForDigest(s_validSignerKeys, abi.encode(commitReport), reportContext, s_F + 1); + + vm.expectRevert(MultiOCR3Base.UnauthorizedTransmitter.selector); + s_offRamp.commit(reportContext, abi.encode(commitReport), rs, ss, rawVs); + } + + function test_NoConfig_Revert() public { + _redeployOffRampWithNoOCRConfigs(); + + OffRamp.CommitReport memory commitReport = _constructCommitReport(); + + bytes32[3] memory reportContext = [bytes32(""), s_configDigestCommit, s_configDigestCommit]; + (bytes32[] memory rs, bytes32[] memory ss,, bytes32 rawVs) = + _getSignaturesForDigest(s_validSignerKeys, abi.encode(commitReport), reportContext, s_F + 1); + + vm.startPrank(s_validTransmitters[0]); + vm.expectRevert(); + s_offRamp.commit(reportContext, abi.encode(commitReport), rs, ss, rawVs); + } + + function test_NoConfigWithOtherConfigPresent_Revert() public { + _redeployOffRampWithNoOCRConfigs(); + + MultiOCR3Base.OCRConfigArgs[] memory ocrConfigs = new MultiOCR3Base.OCRConfigArgs[](1); + ocrConfigs[0] = MultiOCR3Base.OCRConfigArgs({ + ocrPluginType: uint8(Internal.OCRPluginType.Execution), + configDigest: s_configDigestExec, + F: s_F, + isSignatureVerificationEnabled: false, + signers: s_emptySigners, + transmitters: s_validTransmitters + }); + s_offRamp.setOCR3Configs(ocrConfigs); + + OffRamp.CommitReport memory commitReport = _constructCommitReport(); + + bytes32[3] memory reportContext = [bytes32(""), s_configDigestCommit, s_configDigestCommit]; + (bytes32[] memory rs, bytes32[] memory ss,, bytes32 rawVs) = + _getSignaturesForDigest(s_validSignerKeys, abi.encode(commitReport), reportContext, s_F + 1); + + vm.startPrank(s_validTransmitters[0]); + vm.expectRevert(); + s_offRamp.commit(reportContext, abi.encode(commitReport), rs, ss, rawVs); + } + + function test_WrongConfigWithoutSigners_Revert() public { + _redeployOffRampWithNoOCRConfigs(); + + OffRamp.CommitReport memory commitReport = _constructCommitReport(); + + MultiOCR3Base.OCRConfigArgs[] memory ocrConfigs = new MultiOCR3Base.OCRConfigArgs[](1); + ocrConfigs[0] = MultiOCR3Base.OCRConfigArgs({ + ocrPluginType: uint8(Internal.OCRPluginType.Commit), + configDigest: s_configDigestCommit, + F: s_F, + isSignatureVerificationEnabled: false, + signers: s_emptySigners, + transmitters: s_validTransmitters + }); + s_offRamp.setOCR3Configs(ocrConfigs); + + vm.expectRevert(); + _commit(commitReport, s_latestSequenceNumber); + } + + function test_FailedRMNVerification_Reverts() public { + // force RMN verification to fail + vm.mockCallRevert(address(s_mockRMNRemote), abi.encodeWithSelector(IRMNV2.verify.selector), bytes("")); + + OffRamp.CommitReport memory commitReport = _constructCommitReport(); + vm.expectRevert(); + _commit(commitReport, s_latestSequenceNumber); + } + + function test_Unhealthy_Revert() public { + _setMockRMNChainCurse(SOURCE_CHAIN_SELECTOR_1, true); + Internal.MerkleRoot[] memory roots = new Internal.MerkleRoot[](1); + roots[0] = Internal.MerkleRoot({ + sourceChainSelector: SOURCE_CHAIN_SELECTOR_1, + minSeqNr: 1, + maxSeqNr: 2, + merkleRoot: "Only a single root", + onRampAddress: abi.encode(ON_RAMP_ADDRESS_1) + }); + + OffRamp.CommitReport memory commitReport = + OffRamp.CommitReport({priceUpdates: _getEmptyPriceUpdates(), merkleRoots: roots, rmnSignatures: s_rmnSignatures}); + + vm.expectRevert(abi.encodeWithSelector(OffRamp.CursedByRMN.selector, roots[0].sourceChainSelector)); + _commit(commitReport, s_latestSequenceNumber); + } + + function test_InvalidRootRevert() public { + Internal.MerkleRoot[] memory roots = new Internal.MerkleRoot[](1); + roots[0] = Internal.MerkleRoot({ + sourceChainSelector: SOURCE_CHAIN_SELECTOR_1, + minSeqNr: 1, + maxSeqNr: 4, + merkleRoot: bytes32(0), + onRampAddress: abi.encode(ON_RAMP_ADDRESS_1) + }); + OffRamp.CommitReport memory commitReport = + OffRamp.CommitReport({priceUpdates: _getEmptyPriceUpdates(), merkleRoots: roots, rmnSignatures: s_rmnSignatures}); + + vm.expectRevert(OffRamp.InvalidRoot.selector); + _commit(commitReport, s_latestSequenceNumber); + } + + function test_InvalidInterval_Revert() public { + Internal.MerkleRoot[] memory roots = new Internal.MerkleRoot[](1); + roots[0] = Internal.MerkleRoot({ + sourceChainSelector: SOURCE_CHAIN_SELECTOR_1, + minSeqNr: 2, + maxSeqNr: 2, + merkleRoot: bytes32(0), + onRampAddress: abi.encode(ON_RAMP_ADDRESS_1) + }); + OffRamp.CommitReport memory commitReport = + OffRamp.CommitReport({priceUpdates: _getEmptyPriceUpdates(), merkleRoots: roots, rmnSignatures: s_rmnSignatures}); + + vm.expectRevert( + abi.encodeWithSelector( + OffRamp.InvalidInterval.selector, roots[0].sourceChainSelector, roots[0].minSeqNr, roots[0].maxSeqNr + ) + ); + _commit(commitReport, s_latestSequenceNumber); + } + + function test_InvalidIntervalMinLargerThanMax_Revert() public { + s_offRamp.getSourceChainConfig(SOURCE_CHAIN_SELECTOR); + Internal.MerkleRoot[] memory roots = new Internal.MerkleRoot[](1); + roots[0] = Internal.MerkleRoot({ + sourceChainSelector: SOURCE_CHAIN_SELECTOR_1, + minSeqNr: 1, + maxSeqNr: 0, + merkleRoot: bytes32(0), + onRampAddress: abi.encode(ON_RAMP_ADDRESS_1) + }); + OffRamp.CommitReport memory commitReport = + OffRamp.CommitReport({priceUpdates: _getEmptyPriceUpdates(), merkleRoots: roots, rmnSignatures: s_rmnSignatures}); + + vm.expectRevert( + abi.encodeWithSelector( + OffRamp.InvalidInterval.selector, roots[0].sourceChainSelector, roots[0].minSeqNr, roots[0].maxSeqNr + ) + ); + _commit(commitReport, s_latestSequenceNumber); + } + + function test_ZeroEpochAndRound_Revert() public { + Internal.MerkleRoot[] memory roots = new Internal.MerkleRoot[](0); + OffRamp.CommitReport memory commitReport = OffRamp.CommitReport({ + priceUpdates: _getSingleTokenPriceUpdateStruct(s_sourceFeeToken, 4e18), + merkleRoots: roots, + rmnSignatures: s_rmnSignatures + }); + + vm.expectRevert(OffRamp.StaleCommitReport.selector); + _commit(commitReport, 0); + } + + function test_OnlyPriceUpdateStaleReport_Revert() public { + Internal.MerkleRoot[] memory roots = new Internal.MerkleRoot[](0); + OffRamp.CommitReport memory commitReport = OffRamp.CommitReport({ + priceUpdates: _getSingleTokenPriceUpdateStruct(s_sourceFeeToken, 4e18), + merkleRoots: roots, + rmnSignatures: s_rmnSignatures + }); + + vm.expectEmit(); + emit FeeQuoter.UsdPerTokenUpdated(s_sourceFeeToken, 4e18, block.timestamp); + _commit(commitReport, s_latestSequenceNumber); + + vm.expectRevert(OffRamp.StaleCommitReport.selector); + _commit(commitReport, s_latestSequenceNumber); + } + + function test_SourceChainNotEnabled_Revert() public { + Internal.MerkleRoot[] memory roots = new Internal.MerkleRoot[](1); + roots[0] = Internal.MerkleRoot({ + sourceChainSelector: 0, + minSeqNr: 1, + maxSeqNr: 2, + merkleRoot: "Only a single root", + onRampAddress: abi.encode(ON_RAMP_ADDRESS_1) + }); + + OffRamp.CommitReport memory commitReport = + OffRamp.CommitReport({priceUpdates: _getEmptyPriceUpdates(), merkleRoots: roots, rmnSignatures: s_rmnSignatures}); + + vm.expectRevert(abi.encodeWithSelector(OffRamp.SourceChainNotEnabled.selector, 0)); + _commit(commitReport, s_latestSequenceNumber); + } + + function test_RootAlreadyCommitted_Revert() public { + Internal.MerkleRoot[] memory roots = new Internal.MerkleRoot[](1); + roots[0] = Internal.MerkleRoot({ + sourceChainSelector: SOURCE_CHAIN_SELECTOR_1, + minSeqNr: 1, + maxSeqNr: 2, + merkleRoot: "Only a single root", + onRampAddress: abi.encode(ON_RAMP_ADDRESS_1) + }); + OffRamp.CommitReport memory commitReport = + OffRamp.CommitReport({priceUpdates: _getEmptyPriceUpdates(), merkleRoots: roots, rmnSignatures: s_rmnSignatures}); + + _commit(commitReport, s_latestSequenceNumber); + commitReport.merkleRoots[0].minSeqNr = 3; + commitReport.merkleRoots[0].maxSeqNr = 3; + + vm.expectRevert( + abi.encodeWithSelector(OffRamp.RootAlreadyCommitted.selector, roots[0].sourceChainSelector, roots[0].merkleRoot) + ); + _commit(commitReport, ++s_latestSequenceNumber); + } + + function _constructCommitReport() internal view returns (OffRamp.CommitReport memory) { + Internal.MerkleRoot[] memory roots = new Internal.MerkleRoot[](1); + roots[0] = Internal.MerkleRoot({ + sourceChainSelector: SOURCE_CHAIN_SELECTOR_1, + minSeqNr: 1, + maxSeqNr: s_maxInterval, + merkleRoot: "test #2", + onRampAddress: abi.encode(ON_RAMP_ADDRESS_1) + }); + + return OffRamp.CommitReport({ + priceUpdates: _getSingleTokenPriceUpdateStruct(s_sourceFeeToken, 4e18), + merkleRoots: roots, + rmnSignatures: s_rmnSignatures + }); + } +} diff --git a/contracts/src/v0.8/ccip/test/offRamp/OffRampSetup.t.sol b/contracts/src/v0.8/ccip/test/offRamp/OffRampSetup.t.sol new file mode 100644 index 00000000000..2d65ee735ca --- /dev/null +++ b/contracts/src/v0.8/ccip/test/offRamp/OffRampSetup.t.sol @@ -0,0 +1,541 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {IAny2EVMMessageReceiver} from "../../interfaces/IAny2EVMMessageReceiver.sol"; +import {ICommitStore} from "../../interfaces/ICommitStore.sol"; +import {IRMN} from "../../interfaces/IRMN.sol"; +import {IRMNV2} from "../../interfaces/IRMNV2.sol"; + +import {AuthorizedCallers} from "../../../shared/access/AuthorizedCallers.sol"; +import {NonceManager} from "../../NonceManager.sol"; +import {RMN} from "../../RMN.sol"; +import {Router} from "../../Router.sol"; +import {Client} from "../../libraries/Client.sol"; +import {Internal} from "../../libraries/Internal.sol"; +import {MultiOCR3Base} from "../../ocr/MultiOCR3Base.sol"; +import {EVM2EVMOffRamp} from "../../offRamp/EVM2EVMOffRamp.sol"; +import {OffRamp} from "../../offRamp/OffRamp.sol"; +import {TokenPool} from "../../pools/TokenPool.sol"; + +import {FeeQuoterSetup} from "../feeQuoter/FeeQuoterSetup.t.sol"; +import {EVM2EVMOffRampHelper} from "../helpers/EVM2EVMOffRampHelper.sol"; +import {MaybeRevertingBurnMintTokenPool} from "../helpers/MaybeRevertingBurnMintTokenPool.sol"; +import {MessageInterceptorHelper} from "../helpers/MessageInterceptorHelper.sol"; +import {OffRampHelper} from "../helpers/OffRampHelper.sol"; +import {MaybeRevertMessageReceiver} from "../helpers/receivers/MaybeRevertMessageReceiver.sol"; +import {MultiOCR3BaseSetup} from "../ocr/MultiOCR3BaseSetup.t.sol"; +import {Vm} from "forge-std/Test.sol"; + +contract OffRampSetup is FeeQuoterSetup, MultiOCR3BaseSetup { + uint64 internal constant SOURCE_CHAIN_SELECTOR_1 = SOURCE_CHAIN_SELECTOR; + uint64 internal constant SOURCE_CHAIN_SELECTOR_2 = 6433500567565415381; + uint64 internal constant SOURCE_CHAIN_SELECTOR_3 = 4051577828743386545; + + bytes internal constant ON_RAMP_ADDRESS_1 = abi.encode(ON_RAMP_ADDRESS); + bytes internal constant ON_RAMP_ADDRESS_2 = abi.encode(0xaA3f843Cf8E33B1F02dd28303b6bD87B1aBF8AE4); + bytes internal constant ON_RAMP_ADDRESS_3 = abi.encode(0x71830C37Cb193e820de488Da111cfbFcC680a1b9); + + address internal constant BLESS_VOTE_ADDR = address(8888); + + IAny2EVMMessageReceiver internal s_receiver; + IAny2EVMMessageReceiver internal s_secondary_receiver; + MaybeRevertMessageReceiver internal s_reverting_receiver; + + MaybeRevertingBurnMintTokenPool internal s_maybeRevertingPool; + + OffRampHelper internal s_offRamp; + MessageInterceptorHelper internal s_inboundMessageValidator; + NonceManager internal s_inboundNonceManager; + RMN internal s_realRMN; + address internal s_sourceTokenPool = makeAddr("sourceTokenPool"); + + bytes32 internal s_configDigestExec; + bytes32 internal s_configDigestCommit; + uint64 internal constant s_offchainConfigVersion = 3; + uint8 internal constant s_F = 1; + + uint64 internal s_latestSequenceNumber; + + IRMNV2.Signature[] internal s_rmnSignatures; + + function setUp() public virtual override(FeeQuoterSetup, MultiOCR3BaseSetup) { + FeeQuoterSetup.setUp(); + MultiOCR3BaseSetup.setUp(); + + s_inboundMessageValidator = new MessageInterceptorHelper(); + s_receiver = new MaybeRevertMessageReceiver(false); + s_secondary_receiver = new MaybeRevertMessageReceiver(false); + s_reverting_receiver = new MaybeRevertMessageReceiver(true); + + s_maybeRevertingPool = MaybeRevertingBurnMintTokenPool(s_destPoolByToken[s_destTokens[1]]); + s_inboundNonceManager = new NonceManager(new address[](0)); + + _deployOffRamp(s_mockRMNRemote, s_inboundNonceManager); + } + + function _deployOffRamp(IRMNV2 rmn, NonceManager nonceManager) internal { + OffRamp.SourceChainConfigArgs[] memory sourceChainConfigs = new OffRamp.SourceChainConfigArgs[](0); + + s_offRamp = new OffRampHelper( + OffRamp.StaticConfig({ + chainSelector: DEST_CHAIN_SELECTOR, + rmn: rmn, + tokenAdminRegistry: address(s_tokenAdminRegistry), + nonceManager: address(nonceManager) + }), + _generateDynamicOffRampConfig(address(s_feeQuoter)), + sourceChainConfigs + ); + + s_configDigestExec = _getBasicConfigDigest(s_F, s_emptySigners, s_validTransmitters); + s_configDigestCommit = _getBasicConfigDigest(s_F, s_validSigners, s_validTransmitters); + + MultiOCR3Base.OCRConfigArgs[] memory ocrConfigs = new MultiOCR3Base.OCRConfigArgs[](2); + ocrConfigs[0] = MultiOCR3Base.OCRConfigArgs({ + ocrPluginType: uint8(Internal.OCRPluginType.Execution), + configDigest: s_configDigestExec, + F: s_F, + isSignatureVerificationEnabled: false, + signers: s_emptySigners, + transmitters: s_validTransmitters + }); + ocrConfigs[1] = MultiOCR3Base.OCRConfigArgs({ + ocrPluginType: uint8(Internal.OCRPluginType.Commit), + configDigest: s_configDigestCommit, + F: s_F, + isSignatureVerificationEnabled: true, + signers: s_validSigners, + transmitters: s_validTransmitters + }); + + s_offRamp.setDynamicConfig(_generateDynamicOffRampConfig(address(s_feeQuoter))); + s_offRamp.setOCR3Configs(ocrConfigs); + + address[] memory authorizedCallers = new address[](1); + authorizedCallers[0] = address(s_offRamp); + NonceManager(nonceManager).applyAuthorizedCallerUpdates( + AuthorizedCallers.AuthorizedCallerArgs({addedCallers: authorizedCallers, removedCallers: new address[](0)}) + ); + + address[] memory priceUpdaters = new address[](1); + priceUpdaters[0] = address(s_offRamp); + s_feeQuoter.applyAuthorizedCallerUpdates( + AuthorizedCallers.AuthorizedCallerArgs({addedCallers: priceUpdaters, removedCallers: new address[](0)}) + ); + } + + // TODO: function can be made common across OffRampSetup and MultiOffRampSetup + function _deploySingleLaneOffRamp( + ICommitStore commitStore, + Router router, + address prevOffRamp, + uint64 sourceChainSelector, + address onRampAddress + ) internal returns (EVM2EVMOffRampHelper) { + EVM2EVMOffRampHelper offRamp = new EVM2EVMOffRampHelper( + EVM2EVMOffRamp.StaticConfig({ + commitStore: address(commitStore), + chainSelector: DEST_CHAIN_SELECTOR, + sourceChainSelector: sourceChainSelector, + onRamp: onRampAddress, + prevOffRamp: prevOffRamp, + rmnProxy: address(s_mockRMN), + tokenAdminRegistry: address(s_tokenAdminRegistry) + }), + _getInboundRateLimiterConfig() + ); + offRamp.setOCR2Config( + s_validSigners, + s_validTransmitters, + s_F, + abi.encode(_generateDynamicOffRampConfig(address(router), address(s_feeQuoter))), + s_offchainConfigVersion, + abi.encode("") + ); + + Router.OnRamp[] memory onRampUpdates = new Router.OnRamp[](0); + Router.OffRamp[] memory offRampUpdates = new Router.OffRamp[](2); + offRampUpdates[0] = Router.OffRamp({sourceChainSelector: sourceChainSelector, offRamp: address(s_offRamp)}); + offRampUpdates[1] = Router.OffRamp({sourceChainSelector: sourceChainSelector, offRamp: address(prevOffRamp)}); + s_destRouter.applyRampUpdates(onRampUpdates, new Router.OffRamp[](0), offRampUpdates); + EVM2EVMOffRamp.RateLimitToken[] memory tokensToAdd = new EVM2EVMOffRamp.RateLimitToken[](s_sourceTokens.length); + for (uint256 i = 0; i < s_sourceTokens.length; ++i) { + tokensToAdd[i] = EVM2EVMOffRamp.RateLimitToken({sourceToken: s_sourceTokens[i], destToken: s_destTokens[i]}); + } + offRamp.updateRateLimitTokens(new EVM2EVMOffRamp.RateLimitToken[](0), tokensToAdd); + + return offRamp; + } + + function _setupMultipleOffRamps() internal { + OffRamp.SourceChainConfigArgs[] memory sourceChainConfigs = new OffRamp.SourceChainConfigArgs[](3); + sourceChainConfigs[0] = OffRamp.SourceChainConfigArgs({ + router: s_destRouter, + sourceChainSelector: SOURCE_CHAIN_SELECTOR_1, + onRamp: ON_RAMP_ADDRESS_1, + isEnabled: true + }); + sourceChainConfigs[1] = OffRamp.SourceChainConfigArgs({ + router: s_destRouter, + sourceChainSelector: SOURCE_CHAIN_SELECTOR_2, + onRamp: ON_RAMP_ADDRESS_2, + isEnabled: false + }); + sourceChainConfigs[2] = OffRamp.SourceChainConfigArgs({ + router: s_destRouter, + sourceChainSelector: SOURCE_CHAIN_SELECTOR_3, + onRamp: ON_RAMP_ADDRESS_3, + isEnabled: true + }); + _setupMultipleOffRampsFromConfigs(sourceChainConfigs); + } + + function _setupMultipleOffRampsFromConfigs(OffRamp.SourceChainConfigArgs[] memory sourceChainConfigs) internal { + s_offRamp.applySourceChainConfigUpdates(sourceChainConfigs); + + Router.OnRamp[] memory onRampUpdates = new Router.OnRamp[](0); + Router.OffRamp[] memory offRampUpdates = new Router.OffRamp[](2 * sourceChainConfigs.length); + + for (uint256 i = 0; i < sourceChainConfigs.length; ++i) { + uint64 sourceChainSelector = sourceChainConfigs[i].sourceChainSelector; + + offRampUpdates[2 * i] = Router.OffRamp({sourceChainSelector: sourceChainSelector, offRamp: address(s_offRamp)}); + offRampUpdates[2 * i + 1] = Router.OffRamp({ + sourceChainSelector: sourceChainSelector, + offRamp: s_inboundNonceManager.getPreviousRamps(sourceChainSelector).prevOffRamp + }); + } + + s_destRouter.applyRampUpdates(onRampUpdates, new Router.OffRamp[](0), offRampUpdates); + } + + function _generateDynamicOffRampConfig( + address router, + address priceRegistry + ) internal pure returns (EVM2EVMOffRamp.DynamicConfig memory) { + return EVM2EVMOffRamp.DynamicConfig({ + permissionLessExecutionThresholdSeconds: PERMISSION_LESS_EXECUTION_THRESHOLD_SECONDS, + router: router, + priceRegistry: priceRegistry, + maxNumberOfTokensPerMsg: MAX_TOKENS_LENGTH, + maxDataBytes: MAX_DATA_SIZE + }); + } + + uint32 internal constant MAX_TOKEN_POOL_RELEASE_OR_MINT_GAS = 200_000; + uint32 internal constant MAX_TOKEN_POOL_TRANSFER_GAS = 50_000; + + function _generateDynamicOffRampConfig(address feeQuoter) internal pure returns (OffRamp.DynamicConfig memory) { + return OffRamp.DynamicConfig({ + permissionLessExecutionThresholdSeconds: PERMISSION_LESS_EXECUTION_THRESHOLD_SECONDS, + feeQuoter: feeQuoter, + messageValidator: address(0), + maxPoolReleaseOrMintGas: MAX_TOKEN_POOL_RELEASE_OR_MINT_GAS, + maxTokenTransferGas: MAX_TOKEN_POOL_TRANSFER_GAS + }); + } + + function _convertToGeneralMessage( + Internal.Any2EVMRampMessage memory original + ) internal view returns (Client.Any2EVMMessage memory message) { + uint256 numberOfTokens = original.tokenAmounts.length; + Client.EVMTokenAmount[] memory destTokenAmounts = new Client.EVMTokenAmount[](numberOfTokens); + + for (uint256 i = 0; i < numberOfTokens; ++i) { + Internal.RampTokenAmount memory tokenAmount = original.tokenAmounts[i]; + + address destPoolAddress = abi.decode(tokenAmount.destTokenAddress, (address)); + TokenPool pool = TokenPool(destPoolAddress); + destTokenAmounts[i].token = address(pool.getToken()); + destTokenAmounts[i].amount = tokenAmount.amount; + } + + return Client.Any2EVMMessage({ + messageId: original.header.messageId, + sourceChainSelector: original.header.sourceChainSelector, + sender: abi.encode(original.sender), + data: original.data, + destTokenAmounts: destTokenAmounts + }); + } + + function _generateAny2EVMMessageNoTokens( + uint64 sourceChainSelector, + bytes memory onRamp, + uint64 sequenceNumber + ) internal view returns (Internal.Any2EVMRampMessage memory) { + return _generateAny2EVMMessage(sourceChainSelector, onRamp, sequenceNumber, new Client.EVMTokenAmount[](0), false); + } + + function _generateAny2EVMMessageWithTokens( + uint64 sourceChainSelector, + bytes memory onRamp, + uint64 sequenceNumber, + uint256[] memory amounts + ) internal view returns (Internal.Any2EVMRampMessage memory) { + Client.EVMTokenAmount[] memory tokenAmounts = _getCastedSourceEVMTokenAmountsWithZeroAmounts(); + for (uint256 i = 0; i < tokenAmounts.length; ++i) { + tokenAmounts[i].amount = amounts[i]; + } + return _generateAny2EVMMessage(sourceChainSelector, onRamp, sequenceNumber, tokenAmounts, false); + } + + function _generateAny2EVMMessage( + uint64 sourceChainSelector, + bytes memory onRamp, + uint64 sequenceNumber, + Client.EVMTokenAmount[] memory tokenAmounts, + bool allowOutOfOrderExecution + ) internal view returns (Internal.Any2EVMRampMessage memory) { + bytes memory data = abi.encode(0); + + Internal.RampTokenAmount[] memory rampTokenAmounts = new Internal.RampTokenAmount[](tokenAmounts.length); + + // Correctly set the TokenDataPayload for each token. Tokens have to be set up in the TokenSetup. + for (uint256 i = 0; i < tokenAmounts.length; ++i) { + rampTokenAmounts[i] = Internal.RampTokenAmount({ + sourcePoolAddress: abi.encode(s_sourcePoolByToken[tokenAmounts[i].token]), + destTokenAddress: abi.encode(s_destTokenBySourceToken[tokenAmounts[i].token]), + extraData: "", + amount: tokenAmounts[i].amount, + destExecData: abi.encode(DEFAULT_TOKEN_DEST_GAS_OVERHEAD) + }); + } + + Internal.Any2EVMRampMessage memory message = Internal.Any2EVMRampMessage({ + header: Internal.RampMessageHeader({ + messageId: "", + sourceChainSelector: sourceChainSelector, + destChainSelector: DEST_CHAIN_SELECTOR, + sequenceNumber: sequenceNumber, + nonce: allowOutOfOrderExecution ? 0 : sequenceNumber + }), + sender: abi.encode(OWNER), + data: data, + receiver: address(s_receiver), + tokenAmounts: rampTokenAmounts, + gasLimit: GAS_LIMIT + }); + + message.header.messageId = Internal._hash(message, onRamp); + + return message; + } + + function _generateSingleBasicMessage( + uint64 sourceChainSelector, + bytes memory onRamp + ) internal view returns (Internal.Any2EVMRampMessage[] memory) { + Internal.Any2EVMRampMessage[] memory messages = new Internal.Any2EVMRampMessage[](1); + messages[0] = _generateAny2EVMMessageNoTokens(sourceChainSelector, onRamp, 1); + return messages; + } + + function _generateMessagesWithTokens( + uint64 sourceChainSelector, + bytes memory onRamp + ) internal view returns (Internal.Any2EVMRampMessage[] memory) { + Internal.Any2EVMRampMessage[] memory messages = new Internal.Any2EVMRampMessage[](2); + Client.EVMTokenAmount[] memory tokenAmounts = _getCastedSourceEVMTokenAmountsWithZeroAmounts(); + tokenAmounts[0].amount = 1e18; + tokenAmounts[1].amount = 5e18; + messages[0] = _generateAny2EVMMessage(sourceChainSelector, onRamp, 1, tokenAmounts, false); + messages[1] = _generateAny2EVMMessage(sourceChainSelector, onRamp, 2, tokenAmounts, false); + + return messages; + } + + function _generateReportFromMessages( + uint64 sourceChainSelector, + Internal.Any2EVMRampMessage[] memory messages + ) internal pure returns (Internal.ExecutionReportSingleChain memory) { + bytes[][] memory offchainTokenData = new bytes[][](messages.length); + + for (uint256 i = 0; i < messages.length; ++i) { + offchainTokenData[i] = new bytes[](messages[i].tokenAmounts.length); + } + + return Internal.ExecutionReportSingleChain({ + sourceChainSelector: sourceChainSelector, + proofs: new bytes32[](0), + proofFlagBits: 2 ** 256 - 1, + messages: messages, + offchainTokenData: offchainTokenData + }); + } + + function _generateBatchReportFromMessages( + uint64 sourceChainSelector, + Internal.Any2EVMRampMessage[] memory messages + ) internal pure returns (Internal.ExecutionReportSingleChain[] memory) { + Internal.ExecutionReportSingleChain[] memory reports = new Internal.ExecutionReportSingleChain[](1); + reports[0] = _generateReportFromMessages(sourceChainSelector, messages); + return reports; + } + + function _getGasLimitsFromMessages( + Internal.Any2EVMRampMessage[] memory messages + ) internal pure returns (uint256[] memory) { + uint256[] memory gasLimits = new uint256[](messages.length); + for (uint256 i = 0; i < messages.length; ++i) { + gasLimits[i] = messages[i].gasLimit; + } + + return gasLimits; + } + + function _assertSameConfig(OffRamp.DynamicConfig memory a, OffRamp.DynamicConfig memory b) public pure { + assertEq(a.permissionLessExecutionThresholdSeconds, b.permissionLessExecutionThresholdSeconds); + assertEq(a.maxPoolReleaseOrMintGas, b.maxPoolReleaseOrMintGas); + assertEq(a.maxTokenTransferGas, b.maxTokenTransferGas); + assertEq(a.messageValidator, b.messageValidator); + assertEq(a.feeQuoter, b.feeQuoter); + } + + function _assertSourceChainConfigEquality( + OffRamp.SourceChainConfig memory config1, + OffRamp.SourceChainConfig memory config2 + ) internal pure { + assertEq(config1.isEnabled, config2.isEnabled); + assertEq(config1.minSeqNr, config2.minSeqNr); + assertEq(config1.onRamp, config2.onRamp); + assertEq(address(config1.router), address(config2.router)); + } + + function _getDefaultSourceTokenData( + Client.EVMTokenAmount[] memory srcTokenAmounts + ) internal view returns (Internal.RampTokenAmount[] memory) { + Internal.RampTokenAmount[] memory sourceTokenData = new Internal.RampTokenAmount[](srcTokenAmounts.length); + for (uint256 i = 0; i < srcTokenAmounts.length; ++i) { + sourceTokenData[i] = Internal.RampTokenAmount({ + sourcePoolAddress: abi.encode(s_sourcePoolByToken[srcTokenAmounts[i].token]), + destTokenAddress: abi.encode(s_destTokenBySourceToken[srcTokenAmounts[i].token]), + extraData: "", + amount: srcTokenAmounts[i].amount, + destExecData: abi.encode(DEFAULT_TOKEN_DEST_GAS_OVERHEAD) + }); + } + return sourceTokenData; + } + + function _enableInboundMessageValidator() internal { + OffRamp.DynamicConfig memory dynamicConfig = s_offRamp.getDynamicConfig(); + dynamicConfig.messageValidator = address(s_inboundMessageValidator); + s_offRamp.setDynamicConfig(dynamicConfig); + } + + function _redeployOffRampWithNoOCRConfigs() internal { + s_offRamp = new OffRampHelper( + OffRamp.StaticConfig({ + chainSelector: DEST_CHAIN_SELECTOR, + rmn: s_mockRMNRemote, + tokenAdminRegistry: address(s_tokenAdminRegistry), + nonceManager: address(s_inboundNonceManager) + }), + _generateDynamicOffRampConfig(address(s_feeQuoter)), + new OffRamp.SourceChainConfigArgs[](0) + ); + + address[] memory authorizedCallers = new address[](1); + authorizedCallers[0] = address(s_offRamp); + s_inboundNonceManager.applyAuthorizedCallerUpdates( + AuthorizedCallers.AuthorizedCallerArgs({addedCallers: authorizedCallers, removedCallers: new address[](0)}) + ); + _setupMultipleOffRamps(); + + address[] memory priceUpdaters = new address[](1); + priceUpdaters[0] = address(s_offRamp); + s_feeQuoter.applyAuthorizedCallerUpdates( + AuthorizedCallers.AuthorizedCallerArgs({addedCallers: priceUpdaters, removedCallers: new address[](0)}) + ); + } + + function _setupRealRMN() internal { + RMN.Voter[] memory voters = new RMN.Voter[](1); + voters[0] = + RMN.Voter({blessVoteAddr: BLESS_VOTE_ADDR, curseVoteAddr: address(9999), blessWeight: 1, curseWeight: 1}); + // Overwrite base mock rmn with real. + s_realRMN = new RMN(RMN.Config({voters: voters, blessWeightThreshold: 1, curseWeightThreshold: 1})); + } + + function _commit(OffRamp.CommitReport memory commitReport, uint64 sequenceNumber) internal { + bytes32[3] memory reportContext = [s_configDigestCommit, bytes32(uint256(sequenceNumber)), s_configDigestCommit]; + + (bytes32[] memory rs, bytes32[] memory ss,, bytes32 rawVs) = + _getSignaturesForDigest(s_validSignerKeys, abi.encode(commitReport), reportContext, s_F + 1); + + vm.startPrank(s_validTransmitters[0]); + s_offRamp.commit(reportContext, abi.encode(commitReport), rs, ss, rawVs); + } + + function _execute(Internal.ExecutionReportSingleChain[] memory reports) internal { + bytes32[3] memory reportContext = [s_configDigestExec, s_configDigestExec, s_configDigestExec]; + + vm.startPrank(s_validTransmitters[0]); + s_offRamp.execute(reportContext, abi.encode(reports)); + } + + function assertExecutionStateChangedEventLogs( + uint64 sourceChainSelector, + uint64 sequenceNumber, + bytes32 messageId, + bytes32 messageHash, + Internal.MessageExecutionState state, + bytes memory returnData + ) public { + Vm.Log[] memory logs = vm.getRecordedLogs(); + for (uint256 i = 0; i < logs.length; ++i) { + if (logs[i].topics[0] == OffRamp.ExecutionStateChanged.selector) { + uint64 logSourceChainSelector = uint64(uint256(logs[i].topics[1])); + uint64 logSequenceNumber = uint64(uint256(logs[i].topics[2])); + bytes32 logMessageId = bytes32(logs[i].topics[3]); + (bytes32 logMessageHash, uint8 logState, bytes memory logReturnData,) = + abi.decode(logs[i].data, (bytes32, uint8, bytes, uint256)); + if (logMessageId == messageId) { + assertEq(logSourceChainSelector, sourceChainSelector); + assertEq(logSequenceNumber, sequenceNumber); + assertEq(logMessageId, messageId); + assertEq(logMessageHash, messageHash); + assertEq(logState, uint8(state)); + assertEq(logReturnData, returnData); + } + } + } + } + + function assertExecutionStateChangedEventLogs( + Vm.Log[] memory logs, + uint64 sourceChainSelector, + uint64 sequenceNumber, + bytes32 messageId, + bytes32 messageHash, + Internal.MessageExecutionState state, + bytes memory returnData + ) public pure { + for (uint256 i = 0; i < logs.length; ++i) { + if (logs[i].topics[0] == OffRamp.ExecutionStateChanged.selector) { + uint64 logSourceChainSelector = uint64(uint256(logs[i].topics[1])); + uint64 logSequenceNumber = uint64(uint256(logs[i].topics[2])); + bytes32 logMessageId = bytes32(logs[i].topics[3]); + (bytes32 logMessageHash, uint8 logState, bytes memory logReturnData,) = + abi.decode(logs[i].data, (bytes32, uint8, bytes, uint256)); + if (logMessageId == messageId) { + assertEq(logSourceChainSelector, sourceChainSelector); + assertEq(logSequenceNumber, sequenceNumber); + assertEq(logMessageId, messageId); + assertEq(logMessageHash, messageHash); + assertEq(logState, uint8(state)); + assertEq(logReturnData, returnData); + } + } + } + } + + function _assertNoEmit(bytes32 eventSelector) internal { + Vm.Log[] memory logs = vm.getRecordedLogs(); + + for (uint256 i = 0; i < logs.length; i++) { + assertTrue(logs[i].topics[0] != eventSelector); + } + } +} diff --git a/contracts/src/v0.8/ccip/test/onRamp/EVM2EVMOnRamp.t.sol b/contracts/src/v0.8/ccip/test/onRamp/EVM2EVMOnRamp.t.sol new file mode 100644 index 00000000000..f0cd0f80edb --- /dev/null +++ b/contracts/src/v0.8/ccip/test/onRamp/EVM2EVMOnRamp.t.sol @@ -0,0 +1,2051 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {ITokenAdminRegistry} from "../../interfaces/ITokenAdminRegistry.sol"; + +import {BurnMintERC677} from "../../../shared/token/ERC677/BurnMintERC677.sol"; +import {AggregateRateLimiter} from "../../AggregateRateLimiter.sol"; +import {Pool} from "../../libraries/Pool.sol"; +import {RateLimiter} from "../../libraries/RateLimiter.sol"; +import {USDPriceWith18Decimals} from "../../libraries/USDPriceWith18Decimals.sol"; +import {EVM2EVMOnRamp} from "../../onRamp/EVM2EVMOnRamp.sol"; +import {LockReleaseTokenPool} from "../../pools/LockReleaseTokenPool.sol"; +import {TokenPool} from "../../pools/TokenPool.sol"; +import {MaybeRevertingBurnMintTokenPool} from "../helpers/MaybeRevertingBurnMintTokenPool.sol"; +import "./EVM2EVMOnRampSetup.t.sol"; + +contract EVM2EVMOnRamp_constructor is EVM2EVMOnRampSetup { + function test_Constructor_Success() public { + EVM2EVMOnRamp.StaticConfig memory staticConfig = EVM2EVMOnRamp.StaticConfig({ + linkToken: s_sourceTokens[0], + chainSelector: SOURCE_CHAIN_SELECTOR, + destChainSelector: DEST_CHAIN_SELECTOR, + defaultTxGasLimit: GAS_LIMIT, + maxNopFeesJuels: MAX_NOP_FEES_JUELS, + prevOnRamp: address(0), + rmnProxy: address(s_mockRMN), + tokenAdminRegistry: address(s_tokenAdminRegistry) + }); + EVM2EVMOnRamp.DynamicConfig memory dynamicConfig = + generateDynamicOnRampConfig(address(s_sourceRouter), address(s_feeQuoter)); + + vm.expectEmit(); + emit EVM2EVMOnRamp.ConfigSet(staticConfig, dynamicConfig); + + s_onRamp = new EVM2EVMOnRampHelper( + staticConfig, + dynamicConfig, + _getOutboundRateLimiterConfig(), + s_feeTokenConfigArgs, + s_tokenTransferFeeConfigArgs, + getNopsAndWeights() + ); + + EVM2EVMOnRamp.StaticConfig memory gotStaticConfig = s_onRamp.getStaticConfig(); + assertEq(staticConfig.linkToken, gotStaticConfig.linkToken); + assertEq(staticConfig.chainSelector, gotStaticConfig.chainSelector); + assertEq(staticConfig.destChainSelector, gotStaticConfig.destChainSelector); + assertEq(staticConfig.defaultTxGasLimit, gotStaticConfig.defaultTxGasLimit); + assertEq(staticConfig.maxNopFeesJuels, gotStaticConfig.maxNopFeesJuels); + assertEq(staticConfig.prevOnRamp, gotStaticConfig.prevOnRamp); + assertEq(staticConfig.rmnProxy, gotStaticConfig.rmnProxy); + + EVM2EVMOnRamp.DynamicConfig memory gotDynamicConfig = s_onRamp.getDynamicConfig(); + assertEq(dynamicConfig.router, gotDynamicConfig.router); + assertEq(dynamicConfig.maxNumberOfTokensPerMsg, gotDynamicConfig.maxNumberOfTokensPerMsg); + assertEq(dynamicConfig.destGasOverhead, gotDynamicConfig.destGasOverhead); + assertEq(dynamicConfig.destGasPerPayloadByte, gotDynamicConfig.destGasPerPayloadByte); + assertEq(dynamicConfig.priceRegistry, gotDynamicConfig.priceRegistry); + assertEq(dynamicConfig.maxDataBytes, gotDynamicConfig.maxDataBytes); + assertEq(dynamicConfig.maxPerMsgGasLimit, gotDynamicConfig.maxPerMsgGasLimit); + + // Initial values + assertEq("EVM2EVMOnRamp 1.5.0", s_onRamp.typeAndVersion()); + assertEq(OWNER, s_onRamp.owner()); + assertEq(1, s_onRamp.getExpectedNextSequenceNumber()); + } +} + +contract EVM2EVMOnRamp_payNops_fuzz is EVM2EVMOnRampSetup { + function test_Fuzz_NopPayNops_Success(uint96 nopFeesJuels) public { + (EVM2EVMOnRamp.NopAndWeight[] memory nopsAndWeights, uint256 weightsTotal) = s_onRamp.getNops(); + // To avoid NoFeesToPay + vm.assume(nopFeesJuels > weightsTotal); + vm.assume(nopFeesJuels < MAX_NOP_FEES_JUELS); + + // Set Nop fee juels + deal(s_sourceFeeToken, address(s_onRamp), nopFeesJuels); + vm.startPrank(address(s_sourceRouter)); + s_onRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, _generateEmptyMessage(), nopFeesJuels, OWNER); + + vm.startPrank(OWNER); + + uint256 totalJuels = s_onRamp.getNopFeesJuels(); + s_onRamp.payNops(); + for (uint256 i = 0; i < nopsAndWeights.length; ++i) { + uint256 expectedPayout = (totalJuels * nopsAndWeights[i].weight) / weightsTotal; + assertEq(IERC20(s_sourceFeeToken).balanceOf(nopsAndWeights[i].nop), expectedPayout); + } + } +} + +contract EVM2EVMNopsFeeSetup is EVM2EVMOnRampSetup { + function setUp() public virtual override { + EVM2EVMOnRampSetup.setUp(); + + // Since we'll mostly be testing for valid calls from the router we'll + // mock all calls to be originating from the router and re-mock in + // tests that require failure. + vm.startPrank(address(s_sourceRouter)); + + uint256 feeAmount = 1234567890; + uint256 numberOfMessages = 5; + + // Send a bunch of messages, increasing the juels in the contract + for (uint256 i = 0; i < numberOfMessages; ++i) { + IERC20(s_sourceFeeToken).transferFrom(OWNER, address(s_onRamp), feeAmount); + s_onRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, _generateEmptyMessage(), feeAmount, OWNER); + } + + assertEq(s_onRamp.getNopFeesJuels(), feeAmount * numberOfMessages); + assertEq(IERC20(s_sourceFeeToken).balanceOf(address(s_onRamp)), feeAmount * numberOfMessages); + } +} + +contract EVM2EVMOnRamp_payNops is EVM2EVMNopsFeeSetup { + function test_OwnerPayNops_Success() public { + vm.startPrank(OWNER); + + uint256 totalJuels = s_onRamp.getNopFeesJuels(); + s_onRamp.payNops(); + (EVM2EVMOnRamp.NopAndWeight[] memory nopsAndWeights, uint256 weightsTotal) = s_onRamp.getNops(); + for (uint256 i = 0; i < nopsAndWeights.length; ++i) { + uint256 expectedPayout = (nopsAndWeights[i].weight * totalJuels) / weightsTotal; + assertEq(IERC20(s_sourceFeeToken).balanceOf(nopsAndWeights[i].nop), expectedPayout); + } + } + + function test_AdminPayNops_Success() public { + vm.startPrank(ADMIN); + + uint256 totalJuels = s_onRamp.getNopFeesJuels(); + s_onRamp.payNops(); + (EVM2EVMOnRamp.NopAndWeight[] memory nopsAndWeights, uint256 weightsTotal) = s_onRamp.getNops(); + for (uint256 i = 0; i < nopsAndWeights.length; ++i) { + uint256 expectedPayout = (nopsAndWeights[i].weight * totalJuels) / weightsTotal; + assertEq(IERC20(s_sourceFeeToken).balanceOf(nopsAndWeights[i].nop), expectedPayout); + } + } + + function test_NopPayNops_Success() public { + vm.startPrank(getNopsAndWeights()[0].nop); + + uint256 totalJuels = s_onRamp.getNopFeesJuels(); + s_onRamp.payNops(); + (EVM2EVMOnRamp.NopAndWeight[] memory nopsAndWeights, uint256 weightsTotal) = s_onRamp.getNops(); + for (uint256 i = 0; i < nopsAndWeights.length; ++i) { + uint256 expectedPayout = (nopsAndWeights[i].weight * totalJuels) / weightsTotal; + assertEq(IERC20(s_sourceFeeToken).balanceOf(nopsAndWeights[i].nop), expectedPayout); + } + } + + function test_PayNopsSuccessAfterSetNops() public { + vm.startPrank(OWNER); + + // set 2 nops, 1 from previous, 1 new + address prevNop = getNopsAndWeights()[0].nop; + address newNop = STRANGER; + EVM2EVMOnRamp.NopAndWeight[] memory nopsAndWeights = new EVM2EVMOnRamp.NopAndWeight[](2); + nopsAndWeights[0] = EVM2EVMOnRamp.NopAndWeight({nop: prevNop, weight: 1}); + nopsAndWeights[1] = EVM2EVMOnRamp.NopAndWeight({nop: newNop, weight: 1}); + s_onRamp.setNops(nopsAndWeights); + + // refill OnRamp nops fees + vm.startPrank(address(s_sourceRouter)); + uint256 feeAmount = 1234567890; + IERC20(s_sourceFeeToken).transferFrom(OWNER, address(s_onRamp), feeAmount); + s_onRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, _generateEmptyMessage(), feeAmount, OWNER); + + vm.startPrank(newNop); + uint256 prevNopBalance = IERC20(s_sourceFeeToken).balanceOf(prevNop); + uint256 totalJuels = s_onRamp.getNopFeesJuels(); + + s_onRamp.payNops(); + + assertEq(totalJuels / 2 + prevNopBalance, IERC20(s_sourceFeeToken).balanceOf(prevNop)); + assertEq(totalJuels / 2, IERC20(s_sourceFeeToken).balanceOf(newNop)); + } + + // Reverts + + function test_InsufficientBalance_Revert() public { + vm.startPrank(address(s_onRamp)); + IERC20(s_sourceFeeToken).transfer(OWNER, IERC20(s_sourceFeeToken).balanceOf(address(s_onRamp))); + vm.startPrank(OWNER); + vm.expectRevert(EVM2EVMOnRamp.InsufficientBalance.selector); + s_onRamp.payNops(); + } + + function test_WrongPermissions_Revert() public { + vm.startPrank(STRANGER); + + vm.expectRevert(EVM2EVMOnRamp.OnlyCallableByOwnerOrAdminOrNop.selector); + s_onRamp.payNops(); + } + + function test_NoFeesToPay_Revert() public { + vm.startPrank(OWNER); + s_onRamp.payNops(); + vm.expectRevert(EVM2EVMOnRamp.NoFeesToPay.selector); + s_onRamp.payNops(); + } + + function test_NoNopsToPay_Revert() public { + vm.startPrank(OWNER); + EVM2EVMOnRamp.NopAndWeight[] memory nopsAndWeights = new EVM2EVMOnRamp.NopAndWeight[](0); + s_onRamp.setNops(nopsAndWeights); + vm.expectRevert(EVM2EVMOnRamp.NoNopsToPay.selector); + s_onRamp.payNops(); + } +} + +contract EVM2EVMOnRamp_linkAvailableForPayment is EVM2EVMNopsFeeSetup { + function test_LinkAvailableForPayment_Success() public { + uint256 totalJuels = s_onRamp.getNopFeesJuels(); + uint256 linkBalance = IERC20(s_sourceFeeToken).balanceOf(address(s_onRamp)); + + assertEq(int256(linkBalance - totalJuels), s_onRamp.linkAvailableForPayment()); + + vm.startPrank(OWNER); + s_onRamp.payNops(); + + assertEq(int256(linkBalance - totalJuels), s_onRamp.linkAvailableForPayment()); + } + + function test_InsufficientLinkBalance_Success() public { + uint256 totalJuels = s_onRamp.getNopFeesJuels(); + uint256 linkBalance = IERC20(s_sourceFeeToken).balanceOf(address(s_onRamp)); + + vm.startPrank(address(s_onRamp)); + + uint256 linkRemaining = 1; + IERC20(s_sourceFeeToken).transfer(OWNER, linkBalance - linkRemaining); + + vm.startPrank(STRANGER); + assertEq(int256(linkRemaining) - int256(totalJuels), s_onRamp.linkAvailableForPayment()); + } +} + +contract EVM2EVMOnRamp_forwardFromRouter is EVM2EVMOnRampSetup { + struct LegacyExtraArgs { + uint256 gasLimit; + bool strict; + } + + function setUp() public virtual override { + EVM2EVMOnRampSetup.setUp(); + + address[] memory feeTokens = new address[](1); + feeTokens[0] = s_sourceTokens[1]; + s_feeQuoter.applyFeeTokensUpdates(feeTokens, new address[](0)); + + // Since we'll mostly be testing for valid calls from the router we'll + // mock all calls to be originating from the router and re-mock in + // tests that require failure. + vm.startPrank(address(s_sourceRouter)); + } + + function test_ForwardFromRouterSuccessCustomExtraArgs() public { + Client.EVM2AnyMessage memory message = _generateEmptyMessage(); + message.extraArgs = Client._argsToBytes(Client.EVMExtraArgsV1({gasLimit: GAS_LIMIT * 2})); + uint256 feeAmount = 1234567890; + IERC20(s_sourceFeeToken).transferFrom(OWNER, address(s_onRamp), feeAmount); + + vm.expectEmit(); + emit EVM2EVMOnRamp.CCIPSendRequested(_messageToEvent(message, 1, 1, feeAmount, OWNER)); + + s_onRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, message, feeAmount, OWNER); + } + + function test_ForwardFromRouterSuccessLegacyExtraArgs() public { + Client.EVM2AnyMessage memory message = _generateEmptyMessage(); + message.extraArgs = + abi.encodeWithSelector(Client.EVM_EXTRA_ARGS_V1_TAG, LegacyExtraArgs({gasLimit: GAS_LIMIT * 2, strict: true})); + uint256 feeAmount = 1234567890; + IERC20(s_sourceFeeToken).transferFrom(OWNER, address(s_onRamp), feeAmount); + + vm.expectEmit(); + // We expect the message to be emitted with strict = false. + emit EVM2EVMOnRamp.CCIPSendRequested(_messageToEvent(message, 1, 1, feeAmount, OWNER)); + + s_onRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, message, feeAmount, OWNER); + } + + function test_ForwardFromRouter_Success() public { + Client.EVM2AnyMessage memory message = _generateEmptyMessage(); + + uint256 feeAmount = 1234567890; + IERC20(s_sourceFeeToken).transferFrom(OWNER, address(s_onRamp), feeAmount); + + vm.expectEmit(); + emit EVM2EVMOnRamp.CCIPSendRequested(_messageToEvent(message, 1, 1, feeAmount, OWNER)); + + s_onRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, message, feeAmount, OWNER); + } + + function test_ForwardFromRouterExtraArgsV2_Success() public { + Client.EVM2AnyMessage memory message = _generateEmptyMessage(); + message.extraArgs = abi.encodeWithSelector( + Client.EVM_EXTRA_ARGS_V2_TAG, Client.EVMExtraArgsV2({gasLimit: GAS_LIMIT * 2, allowOutOfOrderExecution: true}) + ); + uint256 feeAmount = 1234567890; + IERC20(s_sourceFeeToken).transferFrom(OWNER, address(s_onRamp), feeAmount); + + vm.expectEmit(); + emit EVM2EVMOnRamp.CCIPSendRequested(_messageToEvent(message, 1, 1, feeAmount, OWNER)); + + s_onRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, message, feeAmount, OWNER); + } + + function test_ForwardFromRouterExtraArgsV2AllowOutOfOrderTrue_Success() public { + Client.EVM2AnyMessage memory message = _generateEmptyMessage(); + message.extraArgs = abi.encodeWithSelector( + Client.EVM_EXTRA_ARGS_V2_TAG, Client.EVMExtraArgsV2({gasLimit: GAS_LIMIT * 2, allowOutOfOrderExecution: true}) + ); + uint256 feeAmount = 1234567890; + IERC20(s_sourceFeeToken).transferFrom(OWNER, address(s_onRamp), feeAmount); + + vm.expectEmit(); + emit EVM2EVMOnRamp.CCIPSendRequested(_messageToEvent(message, 1, 1, feeAmount, OWNER)); + + s_onRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, message, feeAmount, OWNER); + } + + function test_Fuzz_EnforceOutOfOrder(bool enforce, bool allowOutOfOrderExecution) public { + // Update dynamic config to enforce allowOutOfOrderExecution = defaultVal. + vm.stopPrank(); + vm.startPrank(OWNER); + EVM2EVMOnRamp.DynamicConfig memory dynamicConfig = s_onRamp.getDynamicConfig(); + s_onRamp.setDynamicConfig( + EVM2EVMOnRamp.DynamicConfig({ + router: dynamicConfig.router, + maxNumberOfTokensPerMsg: dynamicConfig.maxNumberOfTokensPerMsg, + destGasOverhead: dynamicConfig.destGasOverhead, + destGasPerPayloadByte: dynamicConfig.destGasPerPayloadByte, + destDataAvailabilityOverheadGas: dynamicConfig.destDataAvailabilityOverheadGas, + destGasPerDataAvailabilityByte: dynamicConfig.destGasPerDataAvailabilityByte, + destDataAvailabilityMultiplierBps: dynamicConfig.destDataAvailabilityMultiplierBps, + priceRegistry: dynamicConfig.priceRegistry, + maxDataBytes: dynamicConfig.maxDataBytes, + maxPerMsgGasLimit: dynamicConfig.maxPerMsgGasLimit, + defaultTokenFeeUSDCents: dynamicConfig.defaultTokenFeeUSDCents, + defaultTokenDestGasOverhead: dynamicConfig.defaultTokenDestGasOverhead, + enforceOutOfOrder: enforce + }) + ); + vm.stopPrank(); + + vm.startPrank(address(s_sourceRouter)); + Client.EVM2AnyMessage memory message = _generateEmptyMessage(); + message.extraArgs = abi.encodeWithSelector( + Client.EVM_EXTRA_ARGS_V2_TAG, + Client.EVMExtraArgsV2({gasLimit: GAS_LIMIT * 2, allowOutOfOrderExecution: allowOutOfOrderExecution}) + ); + uint256 feeAmount = 1234567890; + IERC20(s_sourceFeeToken).transferFrom(OWNER, address(s_onRamp), feeAmount); + + if (enforce) { + // If enforcement is on, only true should be allowed. + if (allowOutOfOrderExecution) { + vm.expectEmit(); + emit EVM2EVMOnRamp.CCIPSendRequested(_messageToEvent(message, 1, 1, feeAmount, OWNER)); + s_onRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, message, feeAmount, OWNER); + } else { + vm.expectRevert(EVM2EVMOnRamp.ExtraArgOutOfOrderExecutionMustBeTrue.selector); + s_onRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, message, feeAmount, OWNER); + } + } else { + // no enforcement should allow any value. + vm.expectEmit(); + emit EVM2EVMOnRamp.CCIPSendRequested(_messageToEvent(message, 1, 1, feeAmount, OWNER)); + s_onRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, message, feeAmount, OWNER); + } + } + + function test_ShouldIncrementSeqNumAndNonce_Success() public { + Client.EVM2AnyMessage memory message = _generateEmptyMessage(); + + for (uint64 i = 1; i < 4; ++i) { + uint64 nonceBefore = s_onRamp.getSenderNonce(OWNER); + uint64 sequenceNumberBefore = s_onRamp.getSequenceNumber(); + + vm.expectEmit(); + emit EVM2EVMOnRamp.CCIPSendRequested(_messageToEvent(message, i, i, 0, OWNER)); + + s_onRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, message, 0, OWNER); + + uint64 nonceAfter = s_onRamp.getSenderNonce(OWNER); + uint64 sequenceNumberAfter = s_onRamp.getSequenceNumber(); + assertEq(nonceAfter, nonceBefore + 1); + assertEq(sequenceNumberAfter, sequenceNumberBefore + 1); + } + } + + function test_ShouldIncrementNonceOnlyOnOrdered_Success() public { + Client.EVM2AnyMessage memory message = _generateEmptyMessage(); + message.extraArgs = abi.encodeWithSelector( + Client.EVM_EXTRA_ARGS_V2_TAG, Client.EVMExtraArgsV2({gasLimit: GAS_LIMIT * 2, allowOutOfOrderExecution: true}) + ); + + for (uint64 i = 1; i < 4; ++i) { + uint64 nonceBefore = s_onRamp.getSenderNonce(OWNER); + uint64 sequenceNumberBefore = s_onRamp.getSequenceNumber(); + + vm.expectEmit(); + emit EVM2EVMOnRamp.CCIPSendRequested(_messageToEvent(message, i, i, 0, OWNER)); + + s_onRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, message, 0, OWNER); + + uint64 nonceAfter = s_onRamp.getSenderNonce(OWNER); + uint64 sequenceNumberAfter = s_onRamp.getSequenceNumber(); + assertEq(nonceAfter, nonceBefore); + assertEq(sequenceNumberAfter, sequenceNumberBefore + 1); + } + } + + function test_forwardFromRouter_ShouldStoreLinkFees_Success() public { + Client.EVM2AnyMessage memory message = _generateEmptyMessage(); + + uint256 feeAmount = 1234567890; + IERC20(s_sourceFeeToken).transferFrom(OWNER, address(s_onRamp), feeAmount); + + s_onRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, message, feeAmount, OWNER); + + assertEq(IERC20(s_sourceFeeToken).balanceOf(address(s_onRamp)), feeAmount); + assertEq(s_onRamp.getNopFeesJuels(), feeAmount); + } + + function test_ShouldStoreNonLinkFees() public { + Client.EVM2AnyMessage memory message = _generateEmptyMessage(); + message.feeToken = s_sourceTokens[1]; + + uint256 feeAmount = 1234567890; + IERC20(s_sourceTokens[1]).transferFrom(OWNER, address(s_onRamp), feeAmount); + + s_onRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, message, feeAmount, OWNER); + + assertEq(IERC20(s_sourceTokens[1]).balanceOf(address(s_onRamp)), feeAmount); + + // Calculate conversion done by prices contract + uint256 feeTokenPrice = s_feeQuoter.getTokenPrice(s_sourceTokens[1]).value; + uint256 linkTokenPrice = s_feeQuoter.getTokenPrice(s_sourceFeeToken).value; + uint256 conversionRate = (feeTokenPrice * 1e18) / linkTokenPrice; + uint256 expectedJuels = (feeAmount * conversionRate) / 1e18; + + assertEq(s_onRamp.getNopFeesJuels(), expectedJuels); + } + + // Make sure any valid sender, receiver and feeAmount can be handled. + // @TODO Temporarily setting lower fuzz run as 256 triggers snapshot gas off by 1 error. + // https://github.com/foundry-rs/foundry/issues/5689 + /// forge-config: default.fuzz.runs = 32 + /// forge-config: ccip.fuzz.runs = 32 + function test_Fuzz_ForwardFromRouter_Success(address originalSender, address receiver, uint96 feeTokenAmount) public { + // To avoid RouterMustSetOriginalSender + vm.assume(originalSender != address(0)); + vm.assume(uint160(receiver) >= Internal.PRECOMPILE_SPACE); + vm.assume(feeTokenAmount <= MAX_NOP_FEES_JUELS); + + Client.EVM2AnyMessage memory message = _generateEmptyMessage(); + message.receiver = abi.encode(receiver); + + // Make sure the tokens are in the contract + deal(s_sourceFeeToken, address(s_onRamp), feeTokenAmount); + + Internal.EVM2EVMMessage memory expectedEvent = _messageToEvent(message, 1, 1, feeTokenAmount, originalSender); + + vm.expectEmit(false, false, false, true); + emit EVM2EVMOnRamp.CCIPSendRequested(expectedEvent); + + // Assert the message Id is correct + assertEq( + expectedEvent.messageId, s_onRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, message, feeTokenAmount, originalSender) + ); + // Assert the fee token amount is correctly assigned to the nop fee pool + assertEq(feeTokenAmount, s_onRamp.getNopFeesJuels()); + } + + function test_OverValueWithARLOff_Success() public { + Client.EVM2AnyMessage memory message = _generateEmptyMessage(); + message.tokenAmounts = new Client.EVMTokenAmount[](1); + message.tokenAmounts[0].amount = 10; + message.tokenAmounts[0].token = s_sourceTokens[0]; + + IERC20(s_sourceTokens[0]).approve(address(s_onRamp), 10); + + vm.startPrank(OWNER); + // Set a high price to trip the ARL + uint224 tokenPrice = 3 ** 128; + Internal.PriceUpdates memory priceUpdates = _getSingleTokenPriceUpdateStruct(s_sourceTokens[0], tokenPrice); + s_feeQuoter.updatePrices(priceUpdates); + vm.startPrank(address(s_sourceRouter)); + + vm.expectRevert( + abi.encodeWithSelector( + RateLimiter.AggregateValueMaxCapacityExceeded.selector, + _getOutboundRateLimiterConfig().capacity, + (message.tokenAmounts[0].amount * tokenPrice) / 1e18 + ) + ); + // Expect to fail from ARL + s_onRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, message, 0, OWNER); + + // Configure ARL off for token + EVM2EVMOnRamp.TokenTransferFeeConfig memory tokenTransferFeeConfig = + s_onRamp.getTokenTransferFeeConfig(s_sourceTokens[0]); + EVM2EVMOnRamp.TokenTransferFeeConfigArgs[] memory tokenTransferFeeConfigArgs = + new EVM2EVMOnRamp.TokenTransferFeeConfigArgs[](1); + tokenTransferFeeConfigArgs[0] = EVM2EVMOnRamp.TokenTransferFeeConfigArgs({ + token: s_sourceTokens[0], + minFeeUSDCents: tokenTransferFeeConfig.minFeeUSDCents, + maxFeeUSDCents: tokenTransferFeeConfig.maxFeeUSDCents, + deciBps: tokenTransferFeeConfig.deciBps, + destGasOverhead: tokenTransferFeeConfig.destGasOverhead, + destBytesOverhead: tokenTransferFeeConfig.destBytesOverhead, + aggregateRateLimitEnabled: false + }); + vm.startPrank(OWNER); + s_onRamp.setTokenTransferFeeConfig(tokenTransferFeeConfigArgs, new address[](0)); + + vm.startPrank(address(s_sourceRouter)); + // Expect the call now succeeds + s_onRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, message, 0, OWNER); + } + + function test_forwardFromRouter_correctSourceTokenData_Success() public { + Client.EVM2AnyMessage memory message = _generateTokenMessage(); + + for (uint256 i = 0; i < message.tokenAmounts.length; ++i) { + address token = message.tokenAmounts[i].token; + deal(token, s_sourcePoolByToken[token], message.tokenAmounts[i].amount * 2); + } + + uint256 feeAmount = 1234567890; + IERC20(s_sourceFeeToken).transferFrom(OWNER, address(s_onRamp), feeAmount * 2); + + Internal.EVM2EVMMessage memory expectedEvent = _messageToEvent(message, 1, 1, feeAmount, OWNER); + + vm.expectEmit(); + emit EVM2EVMOnRamp.CCIPSendRequested(expectedEvent); + + s_onRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, message, feeAmount, OWNER); + + // Same message, but we change the onchain config which should be reflected in the event. + // We get the event before changing the onRamp config, as the event generation code uses the current + // onramp to generate the event. This test checks if it does so correctly. + expectedEvent = _messageToEvent(message, 2, 2, feeAmount, OWNER); + + uint256 tokenIndexToChange = 1; + address changedToken = message.tokenAmounts[tokenIndexToChange].token; + + // Set token config to change the destGasOverhead + vm.startPrank(OWNER); + EVM2EVMOnRamp.TokenTransferFeeConfigArgs[] memory tokenTransferFeeConfigArgs = + new EVM2EVMOnRamp.TokenTransferFeeConfigArgs[](1); + tokenTransferFeeConfigArgs[0] = EVM2EVMOnRamp.TokenTransferFeeConfigArgs({ + token: changedToken, + minFeeUSDCents: 0, + maxFeeUSDCents: 100, + deciBps: 0, + destGasOverhead: 1_000_111, + destBytesOverhead: uint32(Pool.CCIP_LOCK_OR_BURN_V1_RET_BYTES) + 32, + aggregateRateLimitEnabled: false + }); + s_onRamp.setTokenTransferFeeConfig(tokenTransferFeeConfigArgs, new address[](0)); + + vm.startPrank(address(s_sourceRouter)); + + expectedEvent.sourceTokenData[tokenIndexToChange] = abi.encode( + Internal.SourceTokenData({ + sourcePoolAddress: abi.encode(s_sourcePoolByToken[changedToken]), + destTokenAddress: abi.encode(s_destTokenBySourceToken[changedToken]), + extraData: "", + // The user will be billed either the default or the override, so we send the exact amount that we billed for + // to the destination chain to be used for the token releaseOrMint and transfer. + destGasAmount: tokenTransferFeeConfigArgs[0].destGasOverhead + }) + ); + // Update the hash because we manually changed sourceTokenData + expectedEvent.messageId = Internal._hash(expectedEvent, s_metadataHash); + + vm.expectEmit(); + emit EVM2EVMOnRamp.CCIPSendRequested(expectedEvent); + + s_onRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, message, feeAmount, OWNER); + } + + // Reverts + + function test_Paused_Revert() public { + // We pause by disabling the whitelist + vm.stopPrank(); + vm.startPrank(OWNER); + address router = address(0); + s_onRamp.setDynamicConfig(generateDynamicOnRampConfig(router, address(2))); + vm.expectRevert(EVM2EVMOnRamp.MustBeCalledByRouter.selector); + s_onRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, _generateEmptyMessage(), 0, OWNER); + } + + function test_InvalidExtraArgsTag_Revert() public { + Client.EVM2AnyMessage memory message = _generateEmptyMessage(); + message.extraArgs = bytes("bad args"); + + vm.expectRevert(EVM2EVMOnRamp.InvalidExtraArgsTag.selector); + + s_onRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, message, 0, OWNER); + } + + function test_Unhealthy_Revert() public { + s_mockRMN.setGlobalCursed(true); + vm.expectRevert(EVM2EVMOnRamp.CursedByRMN.selector); + s_onRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, _generateEmptyMessage(), 0, OWNER); + } + + function test_Permissions_Revert() public { + vm.stopPrank(); + vm.startPrank(OWNER); + vm.expectRevert(EVM2EVMOnRamp.MustBeCalledByRouter.selector); + s_onRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, _generateEmptyMessage(), 0, OWNER); + } + + function test_OriginalSender_Revert() public { + vm.expectRevert(EVM2EVMOnRamp.RouterMustSetOriginalSender.selector); + s_onRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, _generateEmptyMessage(), 0, address(0)); + } + + function test_MessageTooLarge_Revert() public { + Client.EVM2AnyMessage memory message = _generateEmptyMessage(); + message.data = new bytes(MAX_DATA_SIZE + 1); + vm.expectRevert(abi.encodeWithSelector(EVM2EVMOnRamp.MessageTooLarge.selector, MAX_DATA_SIZE, message.data.length)); + + s_onRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, message, 0, STRANGER); + } + + function test_TooManyTokens_Revert() public { + Client.EVM2AnyMessage memory message = _generateEmptyMessage(); + uint256 tooMany = MAX_TOKENS_LENGTH + 1; + message.tokenAmounts = new Client.EVMTokenAmount[](tooMany); + vm.expectRevert(EVM2EVMOnRamp.UnsupportedNumberOfTokens.selector); + s_onRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, message, 0, STRANGER); + } + + function test_CannotSendZeroTokens_Revert() public { + Client.EVM2AnyMessage memory message = _generateEmptyMessage(); + message.tokenAmounts = new Client.EVMTokenAmount[](1); + message.tokenAmounts[0].amount = 0; + message.tokenAmounts[0].token = s_sourceTokens[0]; + vm.expectRevert(EVM2EVMOnRamp.CannotSendZeroTokens.selector); + s_onRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, message, 0, STRANGER); + } + + function test_UnsupportedToken_Revert() public { + address wrongToken = address(1); + + Client.EVM2AnyMessage memory message = _generateEmptyMessage(); + message.tokenAmounts = new Client.EVMTokenAmount[](1); + message.tokenAmounts[0].token = wrongToken; + message.tokenAmounts[0].amount = 1; + + // We need to set the price of this new token to be able to reach + // the proper revert point. This must be called by the owner. + vm.stopPrank(); + vm.startPrank(OWNER); + + Internal.PriceUpdates memory priceUpdates = _getSingleTokenPriceUpdateStruct(wrongToken, 1); + s_feeQuoter.updatePrices(priceUpdates); + + // Change back to the router + vm.startPrank(address(s_sourceRouter)); + vm.expectRevert(abi.encodeWithSelector(EVM2EVMOnRamp.UnsupportedToken.selector, wrongToken)); + + s_onRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, message, 0, OWNER); + } + + function test_MaxCapacityExceeded_Revert() public { + Client.EVM2AnyMessage memory message = _generateEmptyMessage(); + message.tokenAmounts = new Client.EVMTokenAmount[](1); + message.tokenAmounts[0].amount = 2 ** 128; + message.tokenAmounts[0].token = s_sourceTokens[0]; + + IERC20(s_sourceTokens[0]).approve(address(s_onRamp), 2 ** 128); + + vm.expectRevert( + abi.encodeWithSelector( + RateLimiter.AggregateValueMaxCapacityExceeded.selector, + _getOutboundRateLimiterConfig().capacity, + (message.tokenAmounts[0].amount * s_sourceTokenPrices[0]) / 1e18 + ) + ); + + s_onRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, message, 0, OWNER); + } + + function test_PriceNotFoundForToken_Revert() public { + // Set token price to 0 + vm.stopPrank(); + vm.startPrank(OWNER); + s_feeQuoter.updatePrices(_getSingleTokenPriceUpdateStruct(CUSTOM_TOKEN, 0)); + + vm.startPrank(address(s_sourceRouter)); + + Client.EVM2AnyMessage memory message = _generateEmptyMessage(); + message.tokenAmounts = new Client.EVMTokenAmount[](1); + message.tokenAmounts[0].token = CUSTOM_TOKEN; + message.tokenAmounts[0].amount = 1; + + vm.expectRevert(abi.encodeWithSelector(AggregateRateLimiter.PriceNotFoundForToken.selector, CUSTOM_TOKEN)); + + s_onRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, message, 0, OWNER); + } + + // Asserts gasLimit must be <=maxGasLimit + function test_MessageGasLimitTooHigh_Revert() public { + Client.EVM2AnyMessage memory message = _generateEmptyMessage(); + message.extraArgs = Client._argsToBytes(Client.EVMExtraArgsV1({gasLimit: MAX_GAS_LIMIT + 1})); + vm.expectRevert(abi.encodeWithSelector(EVM2EVMOnRamp.MessageGasLimitTooHigh.selector)); + s_onRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, message, 0, OWNER); + } + + function test_InvalidAddressEncodePacked_Revert() public { + Client.EVM2AnyMessage memory message = _generateEmptyMessage(); + message.receiver = abi.encodePacked(address(234)); + + vm.expectRevert(abi.encodeWithSelector(Internal.InvalidEVMAddress.selector, message.receiver)); + + s_onRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, message, 1, OWNER); + } + + function test_InvalidAddress_Revert() public { + Client.EVM2AnyMessage memory message = _generateEmptyMessage(); + message.receiver = abi.encode(type(uint208).max); + + vm.expectRevert(abi.encodeWithSelector(Internal.InvalidEVMAddress.selector, message.receiver)); + + s_onRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, message, 1, OWNER); + } + + // We disallow sending to addresses 0-9. + function test_ZeroAddressReceiver_Revert() public { + Client.EVM2AnyMessage memory message = _generateEmptyMessage(); + + for (uint160 i = 0; i < 10; ++i) { + message.receiver = abi.encode(address(i)); + + vm.expectRevert(abi.encodeWithSelector(Internal.InvalidEVMAddress.selector, message.receiver)); + + s_onRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, message, 1, OWNER); + } + } + + function test_MaxFeeBalanceReached_Revert() public { + Client.EVM2AnyMessage memory message = _generateEmptyMessage(); + + vm.expectRevert(EVM2EVMOnRamp.MaxFeeBalanceReached.selector); + + s_onRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, message, MAX_NOP_FEES_JUELS + 1, OWNER); + } + + function test_InvalidChainSelector_Revert() public { + Client.EVM2AnyMessage memory message = _generateEmptyMessage(); + + uint64 wrongChainSelector = DEST_CHAIN_SELECTOR + 1; + vm.expectRevert(abi.encodeWithSelector(EVM2EVMOnRamp.InvalidChainSelector.selector, wrongChainSelector)); + + s_onRamp.forwardFromRouter(wrongChainSelector, message, 1, OWNER); + } + + function test_SourceTokenDataTooLarge_Revert() public { + address sourceETH = s_sourceTokens[1]; + vm.stopPrank(); + vm.startPrank(OWNER); + + MaybeRevertingBurnMintTokenPool newPool = new MaybeRevertingBurnMintTokenPool( + BurnMintERC677(sourceETH), new address[](0), address(s_mockRMN), address(s_sourceRouter) + ); + BurnMintERC677(sourceETH).grantMintAndBurnRoles(address(newPool)); + deal(address(sourceETH), address(newPool), type(uint256).max); + + // Add TokenPool to OnRamp + s_tokenAdminRegistry.setPool(sourceETH, address(newPool)); + + // Allow chain in TokenPool + TokenPool.ChainUpdate[] memory chainUpdates = new TokenPool.ChainUpdate[](1); + chainUpdates[0] = TokenPool.ChainUpdate({ + remoteChainSelector: DEST_CHAIN_SELECTOR, + remotePoolAddress: abi.encode(s_destTokenPool), + remoteTokenAddress: abi.encode(s_destToken), + allowed: true, + outboundRateLimiterConfig: _getOutboundRateLimiterConfig(), + inboundRateLimiterConfig: _getInboundRateLimiterConfig() + }); + newPool.applyChainUpdates(chainUpdates); + + Client.EVM2AnyMessage memory message = _generateSingleTokenMessage(address(sourceETH), 1000); + + // No data set, should succeed + vm.startPrank(address(s_sourceRouter)); + s_onRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, message, 0, OWNER); + + // Set max data length, should succeed + vm.startPrank(OWNER); + newPool.setSourceTokenData(new bytes(Pool.CCIP_LOCK_OR_BURN_V1_RET_BYTES)); + + vm.startPrank(address(s_sourceRouter)); + s_onRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, message, 0, OWNER); + + // Set data to max length +1, should revert + vm.startPrank(OWNER); + newPool.setSourceTokenData(new bytes(Pool.CCIP_LOCK_OR_BURN_V1_RET_BYTES + 1)); + + vm.startPrank(address(s_sourceRouter)); + vm.expectRevert(abi.encodeWithSelector(EVM2EVMOnRamp.SourceTokenDataTooLarge.selector, sourceETH)); + s_onRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, message, 0, OWNER); + + // Set token config to allow larger data + vm.startPrank(OWNER); + EVM2EVMOnRamp.TokenTransferFeeConfigArgs[] memory tokenTransferFeeConfigArgs = + new EVM2EVMOnRamp.TokenTransferFeeConfigArgs[](1); + tokenTransferFeeConfigArgs[0] = EVM2EVMOnRamp.TokenTransferFeeConfigArgs({ + token: sourceETH, + minFeeUSDCents: 1, + maxFeeUSDCents: 0, + deciBps: 0, + destGasOverhead: 0, + destBytesOverhead: uint32(Pool.CCIP_LOCK_OR_BURN_V1_RET_BYTES) + 32, + aggregateRateLimitEnabled: false + }); + s_onRamp.setTokenTransferFeeConfig(tokenTransferFeeConfigArgs, new address[](0)); + + vm.startPrank(address(s_sourceRouter)); + s_onRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, message, 0, OWNER); + + // Set the token data larger than the configured token data, should revert + vm.startPrank(OWNER); + newPool.setSourceTokenData(new bytes(uint32(Pool.CCIP_LOCK_OR_BURN_V1_RET_BYTES) + 32 + 1)); + + vm.startPrank(address(s_sourceRouter)); + vm.expectRevert(abi.encodeWithSelector(EVM2EVMOnRamp.SourceTokenDataTooLarge.selector, sourceETH)); + s_onRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, message, 0, OWNER); + } + + function test_forwardFromRouter_UnsupportedToken_Revert() public { + Client.EVM2AnyMessage memory message = _generateEmptyMessage(); + message.tokenAmounts = new Client.EVMTokenAmount[](1); + message.tokenAmounts[0].amount = 1; + message.tokenAmounts[0].token = address(1); + + vm.expectRevert(abi.encodeWithSelector(EVM2EVMOnRamp.UnsupportedToken.selector, message.tokenAmounts[0].token)); + + s_onRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, message, 0, OWNER); + } + + function test_EnforceOutOfOrder_Revert() public { + // Update dynamic config to enforce allowOutOfOrderExecution = true. + vm.stopPrank(); + vm.startPrank(OWNER); + EVM2EVMOnRamp.DynamicConfig memory dynamicConfig = s_onRamp.getDynamicConfig(); + s_onRamp.setDynamicConfig( + EVM2EVMOnRamp.DynamicConfig({ + router: dynamicConfig.router, + maxNumberOfTokensPerMsg: dynamicConfig.maxNumberOfTokensPerMsg, + destGasOverhead: dynamicConfig.destGasOverhead, + destGasPerPayloadByte: dynamicConfig.destGasPerPayloadByte, + destDataAvailabilityOverheadGas: dynamicConfig.destDataAvailabilityOverheadGas, + destGasPerDataAvailabilityByte: dynamicConfig.destGasPerDataAvailabilityByte, + destDataAvailabilityMultiplierBps: dynamicConfig.destDataAvailabilityMultiplierBps, + priceRegistry: dynamicConfig.priceRegistry, + maxDataBytes: dynamicConfig.maxDataBytes, + maxPerMsgGasLimit: dynamicConfig.maxPerMsgGasLimit, + defaultTokenFeeUSDCents: dynamicConfig.defaultTokenFeeUSDCents, + defaultTokenDestGasOverhead: dynamicConfig.defaultTokenDestGasOverhead, + enforceOutOfOrder: true + }) + ); + vm.stopPrank(); + + vm.startPrank(address(s_sourceRouter)); + Client.EVM2AnyMessage memory message = _generateEmptyMessage(); + // Empty extraArgs to should revert since it enforceOutOfOrder is true. + message.extraArgs = ""; + uint256 feeAmount = 1234567890; + IERC20(s_sourceFeeToken).transferFrom(OWNER, address(s_onRamp), feeAmount); + + vm.expectRevert(EVM2EVMOnRamp.ExtraArgOutOfOrderExecutionMustBeTrue.selector); + s_onRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, message, feeAmount, OWNER); + } +} + +contract EVM2EVMOnRamp_forwardFromRouter_upgrade is EVM2EVMOnRampSetup { + uint256 internal constant FEE_AMOUNT = 1234567890; + EVM2EVMOnRampHelper internal s_prevOnRamp; + + function setUp() public virtual override { + EVM2EVMOnRampSetup.setUp(); + + s_prevOnRamp = s_onRamp; + + s_onRamp = new EVM2EVMOnRampHelper( + EVM2EVMOnRamp.StaticConfig({ + linkToken: s_sourceTokens[0], + chainSelector: SOURCE_CHAIN_SELECTOR, + destChainSelector: DEST_CHAIN_SELECTOR, + defaultTxGasLimit: GAS_LIMIT, + maxNopFeesJuels: MAX_NOP_FEES_JUELS, + prevOnRamp: address(s_prevOnRamp), + rmnProxy: address(s_mockRMN), + tokenAdminRegistry: address(s_tokenAdminRegistry) + }), + generateDynamicOnRampConfig(address(s_sourceRouter), address(s_feeQuoter)), + _getOutboundRateLimiterConfig(), + s_feeTokenConfigArgs, + s_tokenTransferFeeConfigArgs, + getNopsAndWeights() + ); + s_onRamp.setAdmin(ADMIN); + + s_metadataHash = keccak256( + abi.encode(Internal.EVM_2_EVM_MESSAGE_HASH, SOURCE_CHAIN_SELECTOR, DEST_CHAIN_SELECTOR, address(s_onRamp)) + ); + + vm.startPrank(address(s_sourceRouter)); + } + + function test_V2_Success() public { + Client.EVM2AnyMessage memory message = _generateEmptyMessage(); + + vm.expectEmit(); + emit EVM2EVMOnRamp.CCIPSendRequested(_messageToEvent(message, 1, 1, FEE_AMOUNT, OWNER)); + s_onRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, message, FEE_AMOUNT, OWNER); + } + + function test_V2SenderNoncesReadsPreviousRamp_Success() public { + Client.EVM2AnyMessage memory message = _generateEmptyMessage(); + uint64 startNonce = s_onRamp.getSenderNonce(OWNER); + + for (uint64 i = 1; i < 4; ++i) { + s_prevOnRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, message, 0, OWNER); + + assertEq(startNonce + i, s_onRamp.getSenderNonce(OWNER)); + } + } + + function test_V2NonceStartsAtV1Nonce_Success() public { + Client.EVM2AnyMessage memory message = _generateEmptyMessage(); + + uint64 startNonce = s_onRamp.getSenderNonce(OWNER); + + // send 1 message from previous onramp + s_prevOnRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, message, FEE_AMOUNT, OWNER); + + assertEq(startNonce + 1, s_onRamp.getSenderNonce(OWNER)); + + // new onramp nonce should start from 2, while sequence number start from 1 + vm.expectEmit(); + emit EVM2EVMOnRamp.CCIPSendRequested(_messageToEvent(message, 1, startNonce + 2, FEE_AMOUNT, OWNER)); + s_onRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, message, FEE_AMOUNT, OWNER); + + assertEq(startNonce + 2, s_onRamp.getSenderNonce(OWNER)); + + // after another send, nonce should be 3, and sequence number be 2 + vm.expectEmit(); + emit EVM2EVMOnRamp.CCIPSendRequested(_messageToEvent(message, 2, startNonce + 3, FEE_AMOUNT, OWNER)); + s_onRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, message, FEE_AMOUNT, OWNER); + + assertEq(startNonce + 3, s_onRamp.getSenderNonce(OWNER)); + } + + function test_V2NonceNewSenderStartsAtZero_Success() public { + Client.EVM2AnyMessage memory message = _generateEmptyMessage(); + + // send 1 message from previous onramp from OWNER + s_prevOnRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, message, FEE_AMOUNT, OWNER); + + address newSender = address(1234567); + // new onramp nonce should start from 1 for new sender + vm.expectEmit(); + emit EVM2EVMOnRamp.CCIPSendRequested(_messageToEvent(message, 1, 1, FEE_AMOUNT, newSender)); + s_onRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, message, FEE_AMOUNT, newSender); + } +} + +contract EVM2EVMOnRamp_getFeeSetup is EVM2EVMOnRampSetup { + uint224 internal s_feeTokenPrice; + uint224 internal s_wrappedTokenPrice; + uint224 internal s_customTokenPrice; + + address internal s_selfServeTokenDefaultPricing = makeAddr("self-serve-token-default-pricing"); + + function setUp() public virtual override { + EVM2EVMOnRampSetup.setUp(); + + // Add additional pool addresses for test tokens to mark them as supported + s_tokenAdminRegistry.proposeAdministrator(s_sourceRouter.getWrappedNative(), OWNER); + s_tokenAdminRegistry.acceptAdminRole(s_sourceRouter.getWrappedNative()); + s_tokenAdminRegistry.proposeAdministrator(CUSTOM_TOKEN, OWNER); + s_tokenAdminRegistry.acceptAdminRole(CUSTOM_TOKEN); + + LockReleaseTokenPool wrappedNativePool = new LockReleaseTokenPool( + IERC20(s_sourceRouter.getWrappedNative()), new address[](0), address(s_mockRMN), true, address(s_sourceRouter) + ); + + TokenPool.ChainUpdate[] memory wrappedNativeChainUpdate = new TokenPool.ChainUpdate[](1); + wrappedNativeChainUpdate[0] = TokenPool.ChainUpdate({ + remoteChainSelector: DEST_CHAIN_SELECTOR, + remotePoolAddress: abi.encode(address(111111)), + remoteTokenAddress: abi.encode(s_destToken), + allowed: true, + outboundRateLimiterConfig: _getOutboundRateLimiterConfig(), + inboundRateLimiterConfig: _getInboundRateLimiterConfig() + }); + wrappedNativePool.applyChainUpdates(wrappedNativeChainUpdate); + s_tokenAdminRegistry.setPool(s_sourceRouter.getWrappedNative(), address(wrappedNativePool)); + + LockReleaseTokenPool customPool = new LockReleaseTokenPool( + IERC20(CUSTOM_TOKEN), new address[](0), address(s_mockRMN), true, address(s_sourceRouter) + ); + TokenPool.ChainUpdate[] memory customChainUpdate = new TokenPool.ChainUpdate[](1); + customChainUpdate[0] = TokenPool.ChainUpdate({ + remoteChainSelector: DEST_CHAIN_SELECTOR, + remotePoolAddress: abi.encode(makeAddr("random")), + remoteTokenAddress: abi.encode(s_destToken), + allowed: true, + outboundRateLimiterConfig: _getOutboundRateLimiterConfig(), + inboundRateLimiterConfig: _getInboundRateLimiterConfig() + }); + customPool.applyChainUpdates(customChainUpdate); + s_tokenAdminRegistry.setPool(CUSTOM_TOKEN, address(customPool)); + + s_feeTokenPrice = s_sourceTokenPrices[0]; + s_wrappedTokenPrice = s_sourceTokenPrices[2]; + s_customTokenPrice = CUSTOM_TOKEN_PRICE; + + // Ensure the self-serve token is set up on the admin registry + vm.mockCall( + address(s_tokenAdminRegistry), + abi.encodeWithSelector(ITokenAdminRegistry.getPool.selector, s_selfServeTokenDefaultPricing), + abi.encode(makeAddr("self-serve-pool")) + ); + } + + function calcUSDValueFromTokenAmount(uint224 tokenPrice, uint256 tokenAmount) internal pure returns (uint256) { + return (tokenPrice * tokenAmount) / 1e18; + } + + function applyBpsRatio(uint256 tokenAmount, uint16 ratio) internal pure returns (uint256) { + return (tokenAmount * ratio) / 1e5; + } + + function configUSDCentToWei(uint256 usdCent) internal pure returns (uint256) { + return usdCent * 1e16; + } +} + +contract EVM2EVMOnRamp_getDataAvailabilityCost is EVM2EVMOnRamp_getFeeSetup { + function test_EmptyMessageCalculatesDataAvailabilityCost_Success() public view { + uint256 dataAvailabilityCostUSD = s_onRamp.getDataAvailabilityCost(USD_PER_DATA_AVAILABILITY_GAS, 0, 0, 0); + + EVM2EVMOnRamp.DynamicConfig memory dynamicConfig = s_onRamp.getDynamicConfig(); + + uint256 dataAvailabilityGas = dynamicConfig.destDataAvailabilityOverheadGas + + dynamicConfig.destGasPerDataAvailabilityByte * Internal.MESSAGE_FIXED_BYTES; + uint256 expectedDataAvailabilityCostUSD = + USD_PER_DATA_AVAILABILITY_GAS * dataAvailabilityGas * dynamicConfig.destDataAvailabilityMultiplierBps * 1e14; + + assertEq(expectedDataAvailabilityCostUSD, dataAvailabilityCostUSD); + } + + function test_SimpleMessageCalculatesDataAvailabilityCost_Success() public view { + uint256 dataAvailabilityCostUSD = s_onRamp.getDataAvailabilityCost(USD_PER_DATA_AVAILABILITY_GAS, 100, 5, 50); + + EVM2EVMOnRamp.DynamicConfig memory dynamicConfig = s_onRamp.getDynamicConfig(); + + uint256 dataAvailabilityLengthBytes = + Internal.MESSAGE_FIXED_BYTES + 100 + (5 * Internal.MESSAGE_FIXED_BYTES_PER_TOKEN) + 50; + uint256 dataAvailabilityGas = dynamicConfig.destDataAvailabilityOverheadGas + + dynamicConfig.destGasPerDataAvailabilityByte * dataAvailabilityLengthBytes; + uint256 expectedDataAvailabilityCostUSD = + USD_PER_DATA_AVAILABILITY_GAS * dataAvailabilityGas * dynamicConfig.destDataAvailabilityMultiplierBps * 1e14; + + assertEq(expectedDataAvailabilityCostUSD, dataAvailabilityCostUSD); + } + + function test_Fuzz_ZeroDataAvailabilityGasPriceAlwaysCalculatesZeroDataAvailabilityCost_Success( + uint64 messageDataLength, + uint32 numberOfTokens, + uint32 tokenTransferBytesOverhead + ) public view { + uint256 dataAvailabilityCostUSD = + s_onRamp.getDataAvailabilityCost(0, messageDataLength, numberOfTokens, tokenTransferBytesOverhead); + + assertEq(0, dataAvailabilityCostUSD); + } + + function test_Fuzz_CalculateDataAvailabilityCost_Success( + uint32 destDataAvailabilityOverheadGas, + uint16 destGasPerDataAvailabilityByte, + uint16 destDataAvailabilityMultiplierBps, + uint112 dataAvailabilityGasPrice, + uint64 messageDataLength, + uint32 numberOfTokens, + uint32 tokenTransferBytesOverhead + ) public { + EVM2EVMOnRamp.DynamicConfig memory dynamicConfig = s_onRamp.getDynamicConfig(); + dynamicConfig.destDataAvailabilityOverheadGas = destDataAvailabilityOverheadGas; + dynamicConfig.destGasPerDataAvailabilityByte = destGasPerDataAvailabilityByte; + dynamicConfig.destDataAvailabilityMultiplierBps = destDataAvailabilityMultiplierBps; + s_onRamp.setDynamicConfig(dynamicConfig); + + uint256 dataAvailabilityCostUSD = s_onRamp.getDataAvailabilityCost( + dataAvailabilityGasPrice, messageDataLength, numberOfTokens, tokenTransferBytesOverhead + ); + + uint256 dataAvailabilityLengthBytes = Internal.MESSAGE_FIXED_BYTES + messageDataLength + + (numberOfTokens * Internal.MESSAGE_FIXED_BYTES_PER_TOKEN) + tokenTransferBytesOverhead; + + uint256 dataAvailabilityGas = + destDataAvailabilityOverheadGas + destGasPerDataAvailabilityByte * dataAvailabilityLengthBytes; + uint256 expectedDataAvailabilityCostUSD = + dataAvailabilityGasPrice * dataAvailabilityGas * destDataAvailabilityMultiplierBps * 1e14; + + assertEq(expectedDataAvailabilityCostUSD, dataAvailabilityCostUSD); + } +} + +contract EVM2EVMOnRamp_getSupportedTokens is EVM2EVMOnRampSetup { + function test_GetSupportedTokens_Revert() public { + vm.expectRevert(EVM2EVMOnRamp.GetSupportedTokensFunctionalityRemovedCheckAdminRegistry.selector); + s_onRamp.getSupportedTokens(DEST_CHAIN_SELECTOR); + } +} + +contract EVM2EVMOnRamp_getTokenTransferCost is EVM2EVMOnRamp_getFeeSetup { + using USDPriceWith18Decimals for uint224; + + function test_NoTokenTransferChargesZeroFee_Success() public view { + Client.EVM2AnyMessage memory message = _generateEmptyMessage(); + (uint256 feeUSDWei, uint32 destGasOverhead, uint32 destBytesOverhead) = + s_onRamp.getTokenTransferCost(message.feeToken, s_feeTokenPrice, message.tokenAmounts); + + assertEq(0, feeUSDWei); + assertEq(0, destGasOverhead); + assertEq(0, destBytesOverhead); + } + + function test__getTokenTransferCost_selfServeUsesDefaults_Success() public view { + Client.EVM2AnyMessage memory message = _generateSingleTokenMessage(s_selfServeTokenDefaultPricing, 1000); + + // Get config to assert it isn't set + EVM2EVMOnRamp.TokenTransferFeeConfig memory transferFeeConfig = + s_onRamp.getTokenTransferFeeConfig(message.tokenAmounts[0].token); + + assertFalse(transferFeeConfig.isEnabled); + + (uint256 feeUSDWei, uint32 destGasOverhead, uint32 destBytesOverhead) = + s_onRamp.getTokenTransferCost(message.feeToken, s_feeTokenPrice, message.tokenAmounts); + + // Assert that the default values are used + assertEq(uint256(DEFAULT_TOKEN_FEE_USD_CENTS) * 1e16, feeUSDWei); + assertEq(DEFAULT_TOKEN_DEST_GAS_OVERHEAD, destGasOverhead); + assertEq(DEFAULT_TOKEN_BYTES_OVERHEAD, destBytesOverhead); + } + + function test_SmallTokenTransferChargesMinFeeAndGas_Success() public view { + Client.EVM2AnyMessage memory message = _generateSingleTokenMessage(s_sourceFeeToken, 1000); + EVM2EVMOnRamp.TokenTransferFeeConfig memory transferFeeConfig = + s_onRamp.getTokenTransferFeeConfig(message.tokenAmounts[0].token); + + (uint256 feeUSDWei, uint32 destGasOverhead, uint32 destBytesOverhead) = + s_onRamp.getTokenTransferCost(message.feeToken, s_feeTokenPrice, message.tokenAmounts); + + assertEq(configUSDCentToWei(transferFeeConfig.minFeeUSDCents), feeUSDWei); + assertEq(transferFeeConfig.destGasOverhead, destGasOverhead); + assertEq(Pool.CCIP_LOCK_OR_BURN_V1_RET_BYTES, destBytesOverhead); + } + + function test_ZeroAmountTokenTransferChargesMinFeeAndGas_Success() public view { + Client.EVM2AnyMessage memory message = _generateSingleTokenMessage(s_sourceFeeToken, 0); + EVM2EVMOnRamp.TokenTransferFeeConfig memory transferFeeConfig = + s_onRamp.getTokenTransferFeeConfig(message.tokenAmounts[0].token); + + (uint256 feeUSDWei, uint32 destGasOverhead, uint32 destBytesOverhead) = + s_onRamp.getTokenTransferCost(message.feeToken, s_feeTokenPrice, message.tokenAmounts); + + assertEq(configUSDCentToWei(transferFeeConfig.minFeeUSDCents), feeUSDWei); + assertEq(transferFeeConfig.destGasOverhead, destGasOverhead); + assertEq(Pool.CCIP_LOCK_OR_BURN_V1_RET_BYTES, destBytesOverhead); + } + + function test_LargeTokenTransferChargesMaxFeeAndGas_Success() public view { + Client.EVM2AnyMessage memory message = _generateSingleTokenMessage(s_sourceFeeToken, 1e36); + EVM2EVMOnRamp.TokenTransferFeeConfig memory transferFeeConfig = + s_onRamp.getTokenTransferFeeConfig(message.tokenAmounts[0].token); + + (uint256 feeUSDWei, uint32 destGasOverhead, uint32 destBytesOverhead) = + s_onRamp.getTokenTransferCost(message.feeToken, s_feeTokenPrice, message.tokenAmounts); + + assertEq(configUSDCentToWei(transferFeeConfig.maxFeeUSDCents), feeUSDWei); + assertEq(transferFeeConfig.destGasOverhead, destGasOverhead); + assertEq(Pool.CCIP_LOCK_OR_BURN_V1_RET_BYTES, destBytesOverhead); + } + + function test_FeeTokenBpsFee_Success() public view { + uint256 tokenAmount = 10000e18; + + Client.EVM2AnyMessage memory message = _generateSingleTokenMessage(s_sourceFeeToken, tokenAmount); + EVM2EVMOnRamp.TokenTransferFeeConfig memory transferFeeConfig = + s_onRamp.getTokenTransferFeeConfig(message.tokenAmounts[0].token); + + (uint256 feeUSDWei, uint32 destGasOverhead, uint32 destBytesOverhead) = + s_onRamp.getTokenTransferCost(message.feeToken, s_feeTokenPrice, message.tokenAmounts); + + uint256 usdWei = calcUSDValueFromTokenAmount(s_feeTokenPrice, tokenAmount); + uint256 bpsUSDWei = applyBpsRatio(usdWei, s_tokenTransferFeeConfigArgs[0].deciBps); + + assertEq(bpsUSDWei, feeUSDWei); + assertEq(transferFeeConfig.destGasOverhead, destGasOverhead); + assertEq(Pool.CCIP_LOCK_OR_BURN_V1_RET_BYTES, destBytesOverhead); + } + + function test_CustomTokenBpsFee_Success() public view { + uint256 tokenAmount = 200000e18; + + Client.EVM2AnyMessage memory message = Client.EVM2AnyMessage({ + receiver: abi.encode(OWNER), + data: "", + tokenAmounts: new Client.EVMTokenAmount[](1), + feeToken: s_sourceFeeToken, + extraArgs: Client._argsToBytes(Client.EVMExtraArgsV1({gasLimit: GAS_LIMIT})) + }); + message.tokenAmounts[0] = Client.EVMTokenAmount({token: CUSTOM_TOKEN, amount: tokenAmount}); + + EVM2EVMOnRamp.TokenTransferFeeConfig memory transferFeeConfig = + s_onRamp.getTokenTransferFeeConfig(message.tokenAmounts[0].token); + + (uint256 feeUSDWei, uint32 destGasOverhead, uint32 destBytesOverhead) = + s_onRamp.getTokenTransferCost(message.feeToken, s_feeTokenPrice, message.tokenAmounts); + + uint256 usdWei = calcUSDValueFromTokenAmount(s_customTokenPrice, tokenAmount); + uint256 bpsUSDWei = applyBpsRatio(usdWei, s_tokenTransferFeeConfigArgs[1].deciBps); + + assertEq(bpsUSDWei, feeUSDWei); + assertEq(transferFeeConfig.destGasOverhead, destGasOverhead); + assertEq(transferFeeConfig.destBytesOverhead, destBytesOverhead); + } + + function test_ZeroFeeConfigChargesMinFee_Success() public { + EVM2EVMOnRamp.TokenTransferFeeConfigArgs[] memory tokenTransferFeeConfigArgs = + new EVM2EVMOnRamp.TokenTransferFeeConfigArgs[](1); + tokenTransferFeeConfigArgs[0] = EVM2EVMOnRamp.TokenTransferFeeConfigArgs({ + token: s_sourceFeeToken, + minFeeUSDCents: 1, + maxFeeUSDCents: 0, + deciBps: 0, + destGasOverhead: 0, + destBytesOverhead: uint32(Pool.CCIP_LOCK_OR_BURN_V1_RET_BYTES), + aggregateRateLimitEnabled: true + }); + s_onRamp.setTokenTransferFeeConfig(tokenTransferFeeConfigArgs, new address[](0)); + + Client.EVM2AnyMessage memory message = _generateSingleTokenMessage(s_sourceFeeToken, 1e36); + (uint256 feeUSDWei, uint32 destGasOverhead, uint32 destBytesOverhead) = + s_onRamp.getTokenTransferCost(message.feeToken, s_feeTokenPrice, message.tokenAmounts); + + // if token charges 0 bps, it should cost minFee to transfer + assertEq(configUSDCentToWei(tokenTransferFeeConfigArgs[0].minFeeUSDCents), feeUSDWei); + assertEq(0, destGasOverhead); + assertEq(Pool.CCIP_LOCK_OR_BURN_V1_RET_BYTES, destBytesOverhead); + } + + function test_Fuzz_TokenTransferFeeDuplicateTokens_Success(uint256 transfers, uint256 amount) public view { + // It shouldn't be possible to pay materially lower fees by splitting up the transfers. + // Note it is possible to pay higher fees since the minimum fees are added. + EVM2EVMOnRamp.DynamicConfig memory dynamicConfig = s_onRamp.getDynamicConfig(); + transfers = bound(transfers, 1, dynamicConfig.maxNumberOfTokensPerMsg); + // Cap amount to avoid overflow + amount = bound(amount, 0, 1e36); + Client.EVMTokenAmount[] memory multiple = new Client.EVMTokenAmount[](transfers); + for (uint256 i = 0; i < transfers; ++i) { + multiple[i] = Client.EVMTokenAmount({token: s_sourceTokens[0], amount: amount}); + } + Client.EVMTokenAmount[] memory single = new Client.EVMTokenAmount[](1); + single[0] = Client.EVMTokenAmount({token: s_sourceTokens[0], amount: amount * transfers}); + + address feeToken = s_sourceRouter.getWrappedNative(); + + (uint256 feeSingleUSDWei, uint32 gasOverheadSingle, uint32 bytesOverheadSingle) = + s_onRamp.getTokenTransferCost(feeToken, s_wrappedTokenPrice, single); + (uint256 feeMultipleUSDWei, uint32 gasOverheadMultiple, uint32 bytesOverheadMultiple) = + s_onRamp.getTokenTransferCost(feeToken, s_wrappedTokenPrice, multiple); + + // Note that there can be a rounding error once per split. + assertTrue(feeMultipleUSDWei >= (feeSingleUSDWei - dynamicConfig.maxNumberOfTokensPerMsg)); + assertEq(gasOverheadMultiple, gasOverheadSingle * transfers); + assertEq(bytesOverheadMultiple, bytesOverheadSingle * transfers); + } + + function test_MixedTokenTransferFee_Success() public view { + address[3] memory testTokens = [s_sourceFeeToken, s_sourceRouter.getWrappedNative(), CUSTOM_TOKEN]; + uint224[3] memory tokenPrices = [s_feeTokenPrice, s_wrappedTokenPrice, s_customTokenPrice]; + EVM2EVMOnRamp.TokenTransferFeeConfig[3] memory tokenTransferFeeConfigs = [ + s_onRamp.getTokenTransferFeeConfig(testTokens[0]), + s_onRamp.getTokenTransferFeeConfig(testTokens[1]), + s_onRamp.getTokenTransferFeeConfig(testTokens[2]) + ]; + + Client.EVM2AnyMessage memory message = Client.EVM2AnyMessage({ + receiver: abi.encode(OWNER), + data: "", + tokenAmounts: new Client.EVMTokenAmount[](3), + feeToken: s_sourceRouter.getWrappedNative(), + extraArgs: Client._argsToBytes(Client.EVMExtraArgsV1({gasLimit: GAS_LIMIT})) + }); + uint256 expectedTotalGas = 0; + uint256 expectedTotalBytes = 0; + + // Start with small token transfers, total bps fee is lower than min token transfer fee + for (uint256 i = 0; i < testTokens.length; ++i) { + message.tokenAmounts[i] = Client.EVMTokenAmount({token: testTokens[i], amount: 1e14}); + EVM2EVMOnRamp.TokenTransferFeeConfig memory tokenTransferFeeConfig = + s_onRamp.getTokenTransferFeeConfig(testTokens[i]); + expectedTotalGas += tokenTransferFeeConfig.destGasOverhead == 0 + ? DEFAULT_TOKEN_DEST_GAS_OVERHEAD + : tokenTransferFeeConfig.destGasOverhead; + expectedTotalBytes += tokenTransferFeeConfig.destBytesOverhead == 0 + ? uint32(Pool.CCIP_LOCK_OR_BURN_V1_RET_BYTES) + : tokenTransferFeeConfig.destBytesOverhead; + } + (uint256 feeUSDWei, uint32 destGasOverhead, uint32 destBytesOverhead) = + s_onRamp.getTokenTransferCost(message.feeToken, s_wrappedTokenPrice, message.tokenAmounts); + + uint256 expectedFeeUSDWei = 0; + for (uint256 i = 0; i < testTokens.length; ++i) { + expectedFeeUSDWei += configUSDCentToWei( + tokenTransferFeeConfigs[i].minFeeUSDCents == 0 + ? DEFAULT_TOKEN_FEE_USD_CENTS + : tokenTransferFeeConfigs[i].minFeeUSDCents + ); + } + + assertEq(expectedFeeUSDWei, feeUSDWei, "wrong feeUSDWei 1"); + assertEq(expectedTotalGas, destGasOverhead, "wrong destGasOverhead 1"); + assertEq(expectedTotalBytes, destBytesOverhead, "wrong destBytesOverhead 1"); + + // Set 1st token transfer to a meaningful amount so its bps fee is now between min and max fee + message.tokenAmounts[0] = Client.EVMTokenAmount({token: testTokens[0], amount: 10000e18}); + + uint256 token0USDWei = applyBpsRatio( + calcUSDValueFromTokenAmount(tokenPrices[0], message.tokenAmounts[0].amount), tokenTransferFeeConfigs[0].deciBps + ); + uint256 token1USDWei = configUSDCentToWei(DEFAULT_TOKEN_FEE_USD_CENTS); + + (feeUSDWei, destGasOverhead, destBytesOverhead) = + s_onRamp.getTokenTransferCost(message.feeToken, s_wrappedTokenPrice, message.tokenAmounts); + expectedFeeUSDWei = token0USDWei + token1USDWei + configUSDCentToWei(tokenTransferFeeConfigs[2].minFeeUSDCents); + + assertEq(expectedFeeUSDWei, feeUSDWei, "wrong feeUSDWei 2"); + assertEq(expectedTotalGas, destGasOverhead, "wrong destGasOverhead 2"); + assertEq(expectedTotalBytes, destBytesOverhead, "wrong destBytesOverhead 2"); + + // Set 2nd token transfer to a large amount that is higher than maxFeeUSD + message.tokenAmounts[2] = Client.EVMTokenAmount({token: testTokens[2], amount: 1e36}); + + (feeUSDWei, destGasOverhead, destBytesOverhead) = + s_onRamp.getTokenTransferCost(message.feeToken, s_wrappedTokenPrice, message.tokenAmounts); + expectedFeeUSDWei = token0USDWei + token1USDWei + configUSDCentToWei(tokenTransferFeeConfigs[2].maxFeeUSDCents); + + assertEq(expectedFeeUSDWei, feeUSDWei, "wrong feeUSDWei 3"); + assertEq(expectedTotalGas, destGasOverhead, "wrong destGasOverhead 3"); + assertEq(expectedTotalBytes, destBytesOverhead, "wrong destBytesOverhead 3"); + } + + // reverts + + function test_UnsupportedToken_Revert() public { + address NOT_SUPPORTED_TOKEN = address(123); + Client.EVM2AnyMessage memory message = _generateSingleTokenMessage(NOT_SUPPORTED_TOKEN, 200); + + vm.expectRevert(abi.encodeWithSelector(EVM2EVMOnRamp.UnsupportedToken.selector, NOT_SUPPORTED_TOKEN)); + + s_onRamp.getTokenTransferCost(message.feeToken, s_feeTokenPrice, message.tokenAmounts); + } +} + +contract EVM2EVMOnRamp_getFee is EVM2EVMOnRamp_getFeeSetup { + using USDPriceWith18Decimals for uint224; + + function test_EmptyMessage_Success() public view { + address[2] memory testTokens = [s_sourceFeeToken, s_sourceRouter.getWrappedNative()]; + uint224[2] memory feeTokenPrices = [s_feeTokenPrice, s_wrappedTokenPrice]; + + for (uint256 i = 0; i < feeTokenPrices.length; ++i) { + Client.EVM2AnyMessage memory message = _generateEmptyMessage(); + message.feeToken = testTokens[i]; + EVM2EVMOnRamp.FeeTokenConfig memory feeTokenConfig = s_onRamp.getFeeTokenConfig(message.feeToken); + + uint256 feeAmount = s_onRamp.getFee(DEST_CHAIN_SELECTOR, message); + + uint256 gasUsed = GAS_LIMIT + DEST_GAS_OVERHEAD; + uint256 gasFeeUSD = (gasUsed * feeTokenConfig.gasMultiplierWeiPerEth * USD_PER_GAS); + uint256 messageFeeUSD = + (configUSDCentToWei(feeTokenConfig.networkFeeUSDCents) * feeTokenConfig.premiumMultiplierWeiPerEth); + uint256 dataAvailabilityFeeUSD = s_onRamp.getDataAvailabilityCost( + USD_PER_DATA_AVAILABILITY_GAS, message.data.length, message.tokenAmounts.length, 0 + ); + + uint256 totalPriceInFeeToken = (gasFeeUSD + messageFeeUSD + dataAvailabilityFeeUSD) / feeTokenPrices[i]; + assertEq(totalPriceInFeeToken, feeAmount); + } + } + + function test_GetFeeOfZeroForTokenMessage_Success() public { + Client.EVM2AnyMessage memory message = _generateEmptyMessage(); + + uint256 feeAmount = s_onRamp.getFee(DEST_CHAIN_SELECTOR, message); + assertTrue(feeAmount > 0); + + EVM2EVMOnRamp.FeeTokenConfigArgs[] memory feeTokenConfigArgs = new EVM2EVMOnRamp.FeeTokenConfigArgs[](1); + feeTokenConfigArgs[0] = EVM2EVMOnRamp.FeeTokenConfigArgs({ + token: message.feeToken, + networkFeeUSDCents: 0, + gasMultiplierWeiPerEth: 0, + premiumMultiplierWeiPerEth: 0, + enabled: true + }); + + s_onRamp.setFeeTokenConfig(feeTokenConfigArgs); + EVM2EVMOnRamp.DynamicConfig memory config = + generateDynamicOnRampConfig(address(s_sourceRouter), address(s_feeQuoter)); + config.destDataAvailabilityMultiplierBps = 0; + + s_onRamp.setDynamicConfig(config); + + feeAmount = s_onRamp.getFee(DEST_CHAIN_SELECTOR, message); + assertEq(0, feeAmount); + } + + function test_ZeroDataAvailabilityMultiplier_Success() public { + EVM2EVMOnRamp.DynamicConfig memory dynamicConfig = s_onRamp.getDynamicConfig(); + dynamicConfig.destDataAvailabilityMultiplierBps = 0; + s_onRamp.setDynamicConfig(dynamicConfig); + + Client.EVM2AnyMessage memory message = _generateEmptyMessage(); + EVM2EVMOnRamp.FeeTokenConfig memory feeTokenConfig = s_onRamp.getFeeTokenConfig(message.feeToken); + + uint256 feeAmount = s_onRamp.getFee(DEST_CHAIN_SELECTOR, message); + + uint256 gasUsed = GAS_LIMIT + DEST_GAS_OVERHEAD; + uint256 gasFeeUSD = (gasUsed * feeTokenConfig.gasMultiplierWeiPerEth * USD_PER_GAS); + uint256 messageFeeUSD = + (configUSDCentToWei(feeTokenConfig.networkFeeUSDCents) * feeTokenConfig.premiumMultiplierWeiPerEth); + + uint256 totalPriceInFeeToken = (gasFeeUSD + messageFeeUSD) / s_feeTokenPrice; + assertEq(totalPriceInFeeToken, feeAmount); + } + + function test_HighGasMessage_Success() public view { + address[2] memory testTokens = [s_sourceFeeToken, s_sourceRouter.getWrappedNative()]; + uint224[2] memory feeTokenPrices = [s_feeTokenPrice, s_wrappedTokenPrice]; + + uint256 customGasLimit = MAX_GAS_LIMIT; + uint256 customDataSize = MAX_DATA_SIZE; + for (uint256 i = 0; i < feeTokenPrices.length; ++i) { + Client.EVM2AnyMessage memory message = Client.EVM2AnyMessage({ + receiver: abi.encode(OWNER), + data: new bytes(customDataSize), + tokenAmounts: new Client.EVMTokenAmount[](0), + feeToken: testTokens[i], + extraArgs: Client._argsToBytes(Client.EVMExtraArgsV1({gasLimit: customGasLimit})) + }); + + EVM2EVMOnRamp.FeeTokenConfig memory feeTokenConfig = s_onRamp.getFeeTokenConfig(message.feeToken); + uint256 feeAmount = s_onRamp.getFee(DEST_CHAIN_SELECTOR, message); + + uint256 gasUsed = customGasLimit + DEST_GAS_OVERHEAD + customDataSize * DEST_GAS_PER_PAYLOAD_BYTE; + uint256 gasFeeUSD = (gasUsed * feeTokenConfig.gasMultiplierWeiPerEth * USD_PER_GAS); + uint256 messageFeeUSD = + (configUSDCentToWei(feeTokenConfig.networkFeeUSDCents) * feeTokenConfig.premiumMultiplierWeiPerEth); + uint256 dataAvailabilityFeeUSD = s_onRamp.getDataAvailabilityCost( + USD_PER_DATA_AVAILABILITY_GAS, message.data.length, message.tokenAmounts.length, 0 + ); + + uint256 totalPriceInFeeToken = (gasFeeUSD + messageFeeUSD + dataAvailabilityFeeUSD) / feeTokenPrices[i]; + assertEq(totalPriceInFeeToken, feeAmount); + } + } + + function test_SingleTokenMessage_Success() public view { + address[2] memory testTokens = [s_sourceFeeToken, s_sourceRouter.getWrappedNative()]; + uint224[2] memory feeTokenPrices = [s_feeTokenPrice, s_wrappedTokenPrice]; + + uint256 tokenAmount = 10000e18; + for (uint256 i = 0; i < feeTokenPrices.length; ++i) { + Client.EVM2AnyMessage memory message = _generateSingleTokenMessage(s_sourceFeeToken, tokenAmount); + message.feeToken = testTokens[i]; + EVM2EVMOnRamp.FeeTokenConfig memory feeTokenConfig = s_onRamp.getFeeTokenConfig(message.feeToken); + uint32 tokenGasOverhead = s_onRamp.getTokenTransferFeeConfig(message.tokenAmounts[0].token).destGasOverhead; + uint32 destBytesOverhead = s_onRamp.getTokenTransferFeeConfig(message.tokenAmounts[0].token).destBytesOverhead; + uint32 tokenBytesOverhead = + destBytesOverhead == 0 ? uint32(Pool.CCIP_LOCK_OR_BURN_V1_RET_BYTES) : destBytesOverhead; + + uint256 feeAmount = s_onRamp.getFee(DEST_CHAIN_SELECTOR, message); + + uint256 gasUsed = GAS_LIMIT + DEST_GAS_OVERHEAD + tokenGasOverhead; + uint256 gasFeeUSD = (gasUsed * feeTokenConfig.gasMultiplierWeiPerEth * USD_PER_GAS); + (uint256 transferFeeUSD,,) = + s_onRamp.getTokenTransferCost(message.feeToken, feeTokenPrices[i], message.tokenAmounts); + uint256 messageFeeUSD = (transferFeeUSD * feeTokenConfig.premiumMultiplierWeiPerEth); + uint256 dataAvailabilityFeeUSD = s_onRamp.getDataAvailabilityCost( + USD_PER_DATA_AVAILABILITY_GAS, message.data.length, message.tokenAmounts.length, tokenBytesOverhead + ); + + uint256 totalPriceInFeeToken = (gasFeeUSD + messageFeeUSD + dataAvailabilityFeeUSD) / feeTokenPrices[i]; + assertEq(totalPriceInFeeToken, feeAmount); + } + } + + function test_MessageWithDataAndTokenTransfer_Success() public view { + address[2] memory testTokens = [s_sourceFeeToken, s_sourceRouter.getWrappedNative()]; + uint224[2] memory feeTokenPrices = [s_feeTokenPrice, s_wrappedTokenPrice]; + + uint256 customGasLimit = 1_000_000; + uint256 feeTokenAmount = 10000e18; + uint256 customTokenAmount = 200000e18; + for (uint256 i = 0; i < feeTokenPrices.length; ++i) { + Client.EVM2AnyMessage memory message = Client.EVM2AnyMessage({ + receiver: abi.encode(OWNER), + data: "", + tokenAmounts: new Client.EVMTokenAmount[](2), + feeToken: testTokens[i], + extraArgs: Client._argsToBytes(Client.EVMExtraArgsV1({gasLimit: customGasLimit})) + }); + EVM2EVMOnRamp.FeeTokenConfig memory feeTokenConfig = s_onRamp.getFeeTokenConfig(message.feeToken); + + message.tokenAmounts[0] = Client.EVMTokenAmount({token: s_sourceFeeToken, amount: feeTokenAmount}); + message.tokenAmounts[1] = Client.EVMTokenAmount({token: CUSTOM_TOKEN, amount: customTokenAmount}); + message.data = "random bits and bytes that should be factored into the cost of the message"; + + uint32 tokenGasOverhead = 0; + uint32 tokenBytesOverhead = 0; + for (uint256 j = 0; j < message.tokenAmounts.length; ++j) { + tokenGasOverhead += s_onRamp.getTokenTransferFeeConfig(message.tokenAmounts[j].token).destGasOverhead; + uint32 destBytesOverhead = s_onRamp.getTokenTransferFeeConfig(message.tokenAmounts[j].token).destBytesOverhead; + tokenBytesOverhead += destBytesOverhead == 0 ? uint32(Pool.CCIP_LOCK_OR_BURN_V1_RET_BYTES) : destBytesOverhead; + } + + uint256 feeAmount = s_onRamp.getFee(DEST_CHAIN_SELECTOR, message); + + uint256 gasUsed = + customGasLimit + DEST_GAS_OVERHEAD + message.data.length * DEST_GAS_PER_PAYLOAD_BYTE + tokenGasOverhead; + uint256 gasFeeUSD = (gasUsed * feeTokenConfig.gasMultiplierWeiPerEth * USD_PER_GAS); + (uint256 transferFeeUSD,,) = + s_onRamp.getTokenTransferCost(message.feeToken, feeTokenPrices[i], message.tokenAmounts); + uint256 messageFeeUSD = (transferFeeUSD * feeTokenConfig.premiumMultiplierWeiPerEth); + uint256 dataAvailabilityFeeUSD = s_onRamp.getDataAvailabilityCost( + USD_PER_DATA_AVAILABILITY_GAS, message.data.length, message.tokenAmounts.length, tokenBytesOverhead + ); + + uint256 totalPriceInFeeToken = (gasFeeUSD + messageFeeUSD + dataAvailabilityFeeUSD) / feeTokenPrices[i]; + assertEq(totalPriceInFeeToken, feeAmount); + } + } + + // Reverts + + function test_NotAFeeToken_Revert() public { + address notAFeeToken = address(0x111111); + Client.EVM2AnyMessage memory message = _generateSingleTokenMessage(notAFeeToken, 1); + message.feeToken = notAFeeToken; + + vm.expectRevert(abi.encodeWithSelector(EVM2EVMOnRamp.NotAFeeToken.selector, notAFeeToken)); + + s_onRamp.getFee(DEST_CHAIN_SELECTOR, message); + } + + function test_MessageTooLarge_Revert() public { + Client.EVM2AnyMessage memory message = _generateEmptyMessage(); + message.data = new bytes(MAX_DATA_SIZE + 1); + vm.expectRevert(abi.encodeWithSelector(EVM2EVMOnRamp.MessageTooLarge.selector, MAX_DATA_SIZE, message.data.length)); + + s_onRamp.getFee(DEST_CHAIN_SELECTOR, message); + } + + function test_TooManyTokens_Revert() public { + Client.EVM2AnyMessage memory message = _generateEmptyMessage(); + uint256 tooMany = MAX_TOKENS_LENGTH + 1; + message.tokenAmounts = new Client.EVMTokenAmount[](tooMany); + vm.expectRevert(EVM2EVMOnRamp.UnsupportedNumberOfTokens.selector); + s_onRamp.getFee(DEST_CHAIN_SELECTOR, message); + } + + // Asserts gasLimit must be <=maxGasLimit + function test_MessageGasLimitTooHigh_Revert() public { + Client.EVM2AnyMessage memory message = _generateEmptyMessage(); + message.extraArgs = Client._argsToBytes(Client.EVMExtraArgsV1({gasLimit: MAX_GAS_LIMIT + 1})); + vm.expectRevert(abi.encodeWithSelector(EVM2EVMOnRamp.MessageGasLimitTooHigh.selector)); + s_onRamp.getFee(DEST_CHAIN_SELECTOR, message); + } +} + +contract EVM2EVMOnRamp_setNops is EVM2EVMOnRampSetup { + // Used because EnumerableMap doesn't guarantee order + mapping(address nop => uint256 weight) internal s_nopsToWeights; + + function test_SetNops_Success() public { + EVM2EVMOnRamp.NopAndWeight[] memory nopsAndWeights = getNopsAndWeights(); + nopsAndWeights[1].nop = USER_4; + nopsAndWeights[1].weight = 20; + for (uint256 i = 0; i < nopsAndWeights.length; ++i) { + s_nopsToWeights[nopsAndWeights[i].nop] = nopsAndWeights[i].weight; + } + + s_onRamp.setNops(nopsAndWeights); + + (EVM2EVMOnRamp.NopAndWeight[] memory actual,) = s_onRamp.getNops(); + for (uint256 i = 0; i < actual.length; ++i) { + assertEq(actual[i].weight, s_nopsToWeights[actual[i].nop]); + } + } + + function test_AdminCanSetNops_Success() public { + EVM2EVMOnRamp.NopAndWeight[] memory nopsAndWeights = getNopsAndWeights(); + // Should not revert + vm.startPrank(ADMIN); + s_onRamp.setNops(nopsAndWeights); + } + + function test_IncludesPayment_Success() public { + EVM2EVMOnRamp.NopAndWeight[] memory nopsAndWeights = getNopsAndWeights(); + nopsAndWeights[1].nop = USER_4; + nopsAndWeights[1].weight = 20; + uint32 totalWeight; + for (uint256 i = 0; i < nopsAndWeights.length; ++i) { + totalWeight += nopsAndWeights[i].weight; + s_nopsToWeights[nopsAndWeights[i].nop] = nopsAndWeights[i].weight; + } + + // Make sure a payout happens regardless of what the weights are set to + uint96 nopFeesJuels = totalWeight * 5; + // Set Nop fee juels + deal(s_sourceFeeToken, address(s_onRamp), nopFeesJuels); + vm.startPrank(address(s_sourceRouter)); + s_onRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, _generateEmptyMessage(), nopFeesJuels, OWNER); + vm.startPrank(OWNER); + + // We don't care about the fee calculation logic in this test + // so we don't verify the amounts. We do verify the addresses to + // make sure the existing nops get paid and not the new ones. + EVM2EVMOnRamp.NopAndWeight[] memory existingNopsAndWeights = getNopsAndWeights(); + for (uint256 i = 0; i < existingNopsAndWeights.length; ++i) { + vm.expectEmit(true, false, false, false); + emit EVM2EVMOnRamp.NopPaid(existingNopsAndWeights[i].nop, 0); + } + + s_onRamp.setNops(nopsAndWeights); + + (EVM2EVMOnRamp.NopAndWeight[] memory actual,) = s_onRamp.getNops(); + for (uint256 i = 0; i < actual.length; ++i) { + assertEq(actual[i].weight, s_nopsToWeights[actual[i].nop]); + } + } + + function test_SetNopsRemovesOldNopsCompletely_Success() public { + EVM2EVMOnRamp.NopAndWeight[] memory nopsAndWeights = new EVM2EVMOnRamp.NopAndWeight[](0); + s_onRamp.setNops(nopsAndWeights); + (EVM2EVMOnRamp.NopAndWeight[] memory actual, uint256 totalWeight) = s_onRamp.getNops(); + assertEq(actual.length, 0); + assertEq(totalWeight, 0); + + address prevNop = getNopsAndWeights()[0].nop; + vm.startPrank(prevNop); + + // prev nop should not have permission to call payNops + vm.expectRevert(EVM2EVMOnRamp.OnlyCallableByOwnerOrAdminOrNop.selector); + s_onRamp.payNops(); + } + + // Reverts + + function test_NotEnoughFundsForPayout_Revert() public { + uint96 nopFeesJuels = MAX_NOP_FEES_JUELS; + // Set Nop fee juels but don't transfer LINK. This can happen when users + // pay in non-link tokens. + vm.startPrank(address(s_sourceRouter)); + s_onRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, _generateEmptyMessage(), nopFeesJuels, OWNER); + vm.startPrank(OWNER); + + vm.expectRevert(EVM2EVMOnRamp.InsufficientBalance.selector); + + s_onRamp.setNops(getNopsAndWeights()); + } + + function test_NonOwnerOrAdmin_Revert() public { + EVM2EVMOnRamp.NopAndWeight[] memory nopsAndWeights = getNopsAndWeights(); + vm.startPrank(STRANGER); + vm.expectRevert(EVM2EVMOnRamp.OnlyCallableByOwnerOrAdmin.selector); + s_onRamp.setNops(nopsAndWeights); + } + + function test_LinkTokenCannotBeNop_Revert() public { + EVM2EVMOnRamp.NopAndWeight[] memory nopsAndWeights = getNopsAndWeights(); + nopsAndWeights[0].nop = address(s_sourceTokens[0]); + + vm.expectRevert(abi.encodeWithSelector(EVM2EVMOnRamp.InvalidNopAddress.selector, address(s_sourceTokens[0]))); + + s_onRamp.setNops(nopsAndWeights); + } + + function test_ZeroAddressCannotBeNop_Revert() public { + EVM2EVMOnRamp.NopAndWeight[] memory nopsAndWeights = getNopsAndWeights(); + nopsAndWeights[0].nop = address(0); + + vm.expectRevert(abi.encodeWithSelector(EVM2EVMOnRamp.InvalidNopAddress.selector, address(0))); + + s_onRamp.setNops(nopsAndWeights); + } + + function test_TooManyNops_Revert() public { + EVM2EVMOnRamp.NopAndWeight[] memory nopsAndWeights = new EVM2EVMOnRamp.NopAndWeight[](257); + + vm.expectRevert(EVM2EVMOnRamp.TooManyNops.selector); + + s_onRamp.setNops(nopsAndWeights); + } +} + +contract EVM2EVMOnRamp_withdrawNonLinkFees is EVM2EVMOnRampSetup { + IERC20 internal s_token; + + function setUp() public virtual override { + EVM2EVMOnRampSetup.setUp(); + // Send some non-link tokens to the onRamp + s_token = IERC20(s_sourceTokens[1]); + deal(s_sourceTokens[1], address(s_onRamp), 100); + } + + function test_WithdrawNonLinkFees_Success() public { + s_onRamp.withdrawNonLinkFees(address(s_token), address(this)); + + assertEq(0, s_token.balanceOf(address(s_onRamp))); + assertEq(100, s_token.balanceOf(address(this))); + } + + function test_SettlingBalance_Success() public { + // Set Nop fee juels + uint96 nopFeesJuels = 10000000; + vm.startPrank(address(s_sourceRouter)); + s_onRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, _generateEmptyMessage(), nopFeesJuels, OWNER); + vm.startPrank(OWNER); + + vm.expectRevert(EVM2EVMOnRamp.LinkBalanceNotSettled.selector); + s_onRamp.withdrawNonLinkFees(address(s_token), address(this)); + + // It doesnt matter how the link tokens get to the onRamp + // In this case we simply deal them to the ramp to show + // anyone can settle the balance + deal(s_sourceTokens[0], address(s_onRamp), nopFeesJuels); + + s_onRamp.withdrawNonLinkFees(address(s_token), address(this)); + } + + function test_Fuzz_FuzzWithdrawalOnlyLeftoverLink_Success(uint96 nopFeeJuels, uint64 extraJuels) public { + nopFeeJuels = uint96(bound(nopFeeJuels, 1, MAX_NOP_FEES_JUELS)); + + // Set Nop fee juels + vm.startPrank(address(s_sourceRouter)); + s_onRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, _generateEmptyMessage(), nopFeeJuels, OWNER); + vm.startPrank(OWNER); + + vm.expectRevert(EVM2EVMOnRamp.LinkBalanceNotSettled.selector); + s_onRamp.withdrawNonLinkFees(address(s_token), address(this)); + + address linkToken = s_sourceTokens[0]; + // It doesnt matter how the link tokens get to the onRamp + // In this case we simply deal them to the ramp to show + // anyone can settle the balance + deal(linkToken, address(s_onRamp), nopFeeJuels + uint96(extraJuels)); + + // Now that we've sent nopFeesJuels + extraJuels, we should be able to withdraw extraJuels + address linkRecipient = address(0x123456789); + assertEq(0, IERC20(linkToken).balanceOf(linkRecipient)); + + s_onRamp.withdrawNonLinkFees(linkToken, linkRecipient); + + assertEq(extraJuels, IERC20(linkToken).balanceOf(linkRecipient)); + } + + // Reverts + + function test_LinkBalanceNotSettled_Revert() public { + // Set Nop fee juels + uint96 nopFeesJuels = 10000000; + vm.startPrank(address(s_sourceRouter)); + s_onRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, _generateEmptyMessage(), nopFeesJuels, OWNER); + vm.startPrank(OWNER); + + vm.expectRevert(EVM2EVMOnRamp.LinkBalanceNotSettled.selector); + + s_onRamp.withdrawNonLinkFees(address(s_token), address(this)); + } + + function test_NonOwnerOrAdmin_Revert() public { + vm.startPrank(STRANGER); + + vm.expectRevert(EVM2EVMOnRamp.OnlyCallableByOwnerOrAdmin.selector); + s_onRamp.withdrawNonLinkFees(address(s_token), address(this)); + } + + function test_WithdrawToZeroAddress_Revert() public { + vm.expectRevert(EVM2EVMOnRamp.InvalidWithdrawParams.selector); + s_onRamp.withdrawNonLinkFees(address(s_token), address(0)); + } +} + +contract EVM2EVMOnRamp_setFeeTokenConfig is EVM2EVMOnRampSetup { + function test_SetFeeTokenConfig_Success() public { + EVM2EVMOnRamp.FeeTokenConfigArgs[] memory feeConfig; + + vm.expectEmit(); + emit EVM2EVMOnRamp.FeeConfigSet(feeConfig); + + s_onRamp.setFeeTokenConfig(feeConfig); + } + + function test_SetFeeTokenConfigByAdmin_Success() public { + EVM2EVMOnRamp.FeeTokenConfigArgs[] memory feeConfig; + + vm.startPrank(ADMIN); + + vm.expectEmit(); + emit EVM2EVMOnRamp.FeeConfigSet(feeConfig); + + s_onRamp.setFeeTokenConfig(feeConfig); + } + + // Reverts + + function test_OnlyCallableByOwnerOrAdmin_Revert() public { + EVM2EVMOnRamp.FeeTokenConfigArgs[] memory feeConfig; + vm.startPrank(STRANGER); + + vm.expectRevert(EVM2EVMOnRamp.OnlyCallableByOwnerOrAdmin.selector); + + s_onRamp.setFeeTokenConfig(feeConfig); + } +} + +contract EVM2EVMOnRamp_setTokenTransferFeeConfig is EVM2EVMOnRampSetup { + function test__setTokenTransferFeeConfig_Success() public { + EVM2EVMOnRamp.TokenTransferFeeConfigArgs[] memory tokenTransferFeeArgs = + new EVM2EVMOnRamp.TokenTransferFeeConfigArgs[](2); + tokenTransferFeeArgs[0] = EVM2EVMOnRamp.TokenTransferFeeConfigArgs({ + token: address(5), + minFeeUSDCents: 6, + maxFeeUSDCents: 7, + deciBps: 8, + destGasOverhead: 9, + destBytesOverhead: 312, + aggregateRateLimitEnabled: true + }); + tokenTransferFeeArgs[1] = EVM2EVMOnRamp.TokenTransferFeeConfigArgs({ + token: address(11), + minFeeUSDCents: 12, + maxFeeUSDCents: 13, + deciBps: 14, + destGasOverhead: 15, + destBytesOverhead: 394, + aggregateRateLimitEnabled: false + }); + + vm.expectEmit(); + emit EVM2EVMOnRamp.TokenTransferFeeConfigSet(tokenTransferFeeArgs); + + s_onRamp.setTokenTransferFeeConfig(tokenTransferFeeArgs, new address[](0)); + + EVM2EVMOnRamp.TokenTransferFeeConfig memory config0 = + s_onRamp.getTokenTransferFeeConfig(tokenTransferFeeArgs[0].token); + + assertEq(tokenTransferFeeArgs[0].minFeeUSDCents, config0.minFeeUSDCents); + assertEq(tokenTransferFeeArgs[0].maxFeeUSDCents, config0.maxFeeUSDCents); + assertEq(tokenTransferFeeArgs[0].deciBps, config0.deciBps); + assertEq(tokenTransferFeeArgs[0].destGasOverhead, config0.destGasOverhead); + assertEq(tokenTransferFeeArgs[0].destBytesOverhead, config0.destBytesOverhead); + assertEq(tokenTransferFeeArgs[0].aggregateRateLimitEnabled, config0.aggregateRateLimitEnabled); + assertTrue(config0.isEnabled); + + EVM2EVMOnRamp.TokenTransferFeeConfig memory config1 = + s_onRamp.getTokenTransferFeeConfig(tokenTransferFeeArgs[1].token); + + assertEq(tokenTransferFeeArgs[1].minFeeUSDCents, config1.minFeeUSDCents); + assertEq(tokenTransferFeeArgs[1].maxFeeUSDCents, config1.maxFeeUSDCents); + assertEq(tokenTransferFeeArgs[1].deciBps, config1.deciBps); + assertEq(tokenTransferFeeArgs[1].destGasOverhead, config1.destGasOverhead); + assertEq(tokenTransferFeeArgs[1].destBytesOverhead, config1.destBytesOverhead); + assertEq(tokenTransferFeeArgs[1].aggregateRateLimitEnabled, config1.aggregateRateLimitEnabled); + assertTrue(config0.isEnabled); + + // Remove only the first token and validate only the first token is removed + address[] memory tokensToRemove = new address[](1); + tokensToRemove[0] = tokenTransferFeeArgs[0].token; + + vm.expectEmit(); + emit EVM2EVMOnRamp.TokenTransferFeeConfigDeleted(tokensToRemove); + + s_onRamp.setTokenTransferFeeConfig(new EVM2EVMOnRamp.TokenTransferFeeConfigArgs[](0), tokensToRemove); + + config0 = s_onRamp.getTokenTransferFeeConfig(tokenTransferFeeArgs[0].token); + + assertEq(0, config0.minFeeUSDCents); + assertEq(0, config0.maxFeeUSDCents); + assertEq(0, config0.deciBps); + assertEq(0, config0.destGasOverhead); + assertEq(0, config0.destBytesOverhead); + assertFalse(config0.aggregateRateLimitEnabled); + assertFalse(config0.isEnabled); + + config1 = s_onRamp.getTokenTransferFeeConfig(tokenTransferFeeArgs[1].token); + + assertEq(tokenTransferFeeArgs[1].minFeeUSDCents, config1.minFeeUSDCents); + assertEq(tokenTransferFeeArgs[1].maxFeeUSDCents, config1.maxFeeUSDCents); + assertEq(tokenTransferFeeArgs[1].deciBps, config1.deciBps); + assertEq(tokenTransferFeeArgs[1].destGasOverhead, config1.destGasOverhead); + assertEq(tokenTransferFeeArgs[1].destBytesOverhead, config1.destBytesOverhead); + assertEq(tokenTransferFeeArgs[1].aggregateRateLimitEnabled, config1.aggregateRateLimitEnabled); + assertTrue(config1.isEnabled); + } + + function test__setTokenTransferFeeConfig_byAdmin_Success() public { + EVM2EVMOnRamp.TokenTransferFeeConfigArgs[] memory transferFeeConfig; + vm.startPrank(ADMIN); + + vm.expectEmit(); + emit EVM2EVMOnRamp.TokenTransferFeeConfigSet(transferFeeConfig); + + s_onRamp.setTokenTransferFeeConfig(transferFeeConfig, new address[](0)); + } + + // Reverts + + function test__setTokenTransferFeeConfig_InvalidDestBytesOverhead_Revert() public { + EVM2EVMOnRamp.TokenTransferFeeConfigArgs[] memory transferFeeConfig = + new EVM2EVMOnRamp.TokenTransferFeeConfigArgs[](1); + transferFeeConfig[0].destBytesOverhead = uint32(Pool.CCIP_LOCK_OR_BURN_V1_RET_BYTES) - 1; + vm.expectRevert( + abi.encodeWithSelector( + EVM2EVMOnRamp.InvalidDestBytesOverhead.selector, + transferFeeConfig[0].token, + transferFeeConfig[0].destBytesOverhead + ) + ); + s_onRamp.setTokenTransferFeeConfig(transferFeeConfig, new address[](0)); + } + + function test__setTokenTransferFeeConfig_OnlyCallableByOwnerOrAdmin_Revert() public { + EVM2EVMOnRamp.TokenTransferFeeConfigArgs[] memory transferFeeConfig; + vm.startPrank(STRANGER); + + vm.expectRevert(EVM2EVMOnRamp.OnlyCallableByOwnerOrAdmin.selector); + + s_onRamp.setTokenTransferFeeConfig(transferFeeConfig, new address[](0)); + } +} + +contract EVM2EVMOnRamp_getTokenPool is EVM2EVMOnRampSetup { + function test_GetTokenPool_Success() public view { + assertEq( + s_sourcePoolByToken[s_sourceTokens[0]], + address(s_onRamp.getPoolBySourceToken(DEST_CHAIN_SELECTOR, IERC20(s_sourceTokens[0]))) + ); + assertEq( + s_sourcePoolByToken[s_sourceTokens[1]], + address(s_onRamp.getPoolBySourceToken(DEST_CHAIN_SELECTOR, IERC20(s_sourceTokens[1]))) + ); + + address wrongToken = address(123); + address nonExistentPool = address(s_onRamp.getPoolBySourceToken(DEST_CHAIN_SELECTOR, IERC20(wrongToken))); + + assertEq(address(0), nonExistentPool); + } +} + +contract EVM2EVMOnRamp_setDynamicConfig is EVM2EVMOnRampSetup { + function test_SetDynamicConfig_Success() public { + EVM2EVMOnRamp.StaticConfig memory staticConfig = s_onRamp.getStaticConfig(); + EVM2EVMOnRamp.DynamicConfig memory newConfig = EVM2EVMOnRamp.DynamicConfig({ + router: address(2134), + maxNumberOfTokensPerMsg: 14, + destGasOverhead: DEST_GAS_OVERHEAD / 2, + destGasPerPayloadByte: DEST_GAS_PER_PAYLOAD_BYTE / 2, + destDataAvailabilityOverheadGas: DEST_DATA_AVAILABILITY_OVERHEAD_GAS, + destGasPerDataAvailabilityByte: DEST_GAS_PER_DATA_AVAILABILITY_BYTE, + destDataAvailabilityMultiplierBps: DEST_GAS_DATA_AVAILABILITY_MULTIPLIER_BPS, + priceRegistry: address(23423), + maxDataBytes: 400, + maxPerMsgGasLimit: MAX_GAS_LIMIT / 2, + defaultTokenFeeUSDCents: DEFAULT_TOKEN_FEE_USD_CENTS, + defaultTokenDestGasOverhead: DEFAULT_TOKEN_DEST_GAS_OVERHEAD, + enforceOutOfOrder: false + }); + + vm.expectEmit(); + emit EVM2EVMOnRamp.ConfigSet(staticConfig, newConfig); + + s_onRamp.setDynamicConfig(newConfig); + + EVM2EVMOnRamp.DynamicConfig memory gotDynamicConfig = s_onRamp.getDynamicConfig(); + assertEq(newConfig.router, gotDynamicConfig.router); + assertEq(newConfig.maxNumberOfTokensPerMsg, gotDynamicConfig.maxNumberOfTokensPerMsg); + assertEq(newConfig.destGasOverhead, gotDynamicConfig.destGasOverhead); + assertEq(newConfig.destGasPerPayloadByte, gotDynamicConfig.destGasPerPayloadByte); + assertEq(newConfig.priceRegistry, gotDynamicConfig.priceRegistry); + assertEq(newConfig.maxDataBytes, gotDynamicConfig.maxDataBytes); + assertEq(newConfig.maxPerMsgGasLimit, gotDynamicConfig.maxPerMsgGasLimit); + } + + // Reverts + + function test_SetConfigInvalidConfig_Revert() public { + EVM2EVMOnRamp.DynamicConfig memory newConfig = EVM2EVMOnRamp.DynamicConfig({ + router: address(1), + maxNumberOfTokensPerMsg: 14, + destGasOverhead: DEST_GAS_OVERHEAD / 2, + destGasPerPayloadByte: DEST_GAS_PER_PAYLOAD_BYTE / 2, + destDataAvailabilityOverheadGas: DEST_DATA_AVAILABILITY_OVERHEAD_GAS, + destGasPerDataAvailabilityByte: DEST_GAS_PER_DATA_AVAILABILITY_BYTE, + destDataAvailabilityMultiplierBps: DEST_GAS_DATA_AVAILABILITY_MULTIPLIER_BPS, + priceRegistry: address(23423), + maxDataBytes: 400, + maxPerMsgGasLimit: MAX_GAS_LIMIT / 2, + defaultTokenFeeUSDCents: DEFAULT_TOKEN_FEE_USD_CENTS, + defaultTokenDestGasOverhead: DEFAULT_TOKEN_DEST_GAS_OVERHEAD, + enforceOutOfOrder: false + }); + + // Invalid price reg reverts. + newConfig.priceRegistry = address(0); + vm.expectRevert(EVM2EVMOnRamp.InvalidConfig.selector); + s_onRamp.setDynamicConfig(newConfig); + + // Succeeds if valid + newConfig.priceRegistry = address(23423); + s_onRamp.setDynamicConfig(newConfig); + } + + function test_SetConfigOnlyOwner_Revert() public { + vm.startPrank(STRANGER); + vm.expectRevert("Only callable by owner"); + s_onRamp.setDynamicConfig(generateDynamicOnRampConfig(address(1), address(2))); + vm.startPrank(ADMIN); + vm.expectRevert("Only callable by owner"); + s_onRamp.setDynamicConfig(generateDynamicOnRampConfig(address(1), address(2))); + } +} diff --git a/contracts/src/v0.8/ccip/test/onRamp/EVM2EVMOnRampSetup.t.sol b/contracts/src/v0.8/ccip/test/onRamp/EVM2EVMOnRampSetup.t.sol new file mode 100644 index 00000000000..84350448a13 --- /dev/null +++ b/contracts/src/v0.8/ccip/test/onRamp/EVM2EVMOnRampSetup.t.sol @@ -0,0 +1,251 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {Router} from "../../Router.sol"; +import {Client} from "../../libraries/Client.sol"; +import {Internal} from "../../libraries/Internal.sol"; +import {Pool} from "../../libraries/Pool.sol"; +import {EVM2EVMOnRamp} from "../../onRamp/EVM2EVMOnRamp.sol"; +import {TokenSetup} from "../TokenSetup.t.sol"; + +import {FeeQuoterSetup} from "../feeQuoter/FeeQuoterSetup.t.sol"; +import {EVM2EVMOnRampHelper} from "../helpers/EVM2EVMOnRampHelper.sol"; + +import {IERC20} from "../../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/IERC20.sol"; + +contract EVM2EVMOnRampSetup is TokenSetup, FeeQuoterSetup { + uint256 internal immutable i_tokenAmount0 = 9; + uint256 internal immutable i_tokenAmount1 = 7; + + bytes32 internal s_metadataHash; + + EVM2EVMOnRampHelper internal s_onRamp; + address[] internal s_offRamps; + + address internal s_destTokenPool = makeAddr("destTokenPool"); + address internal s_destToken = makeAddr("destToken"); + + EVM2EVMOnRamp.FeeTokenConfigArgs[] internal s_feeTokenConfigArgs; + EVM2EVMOnRamp.TokenTransferFeeConfigArgs[] internal s_tokenTransferFeeConfigArgs; + + function setUp() public virtual override(TokenSetup, FeeQuoterSetup) { + TokenSetup.setUp(); + FeeQuoterSetup.setUp(); + + s_feeQuoter.updatePrices(_getSingleTokenPriceUpdateStruct(CUSTOM_TOKEN, CUSTOM_TOKEN_PRICE)); + + address WETH = s_sourceRouter.getWrappedNative(); + + s_feeTokenConfigArgs.push( + EVM2EVMOnRamp.FeeTokenConfigArgs({ + token: s_sourceFeeToken, + networkFeeUSDCents: 1_00, // 1 USD + gasMultiplierWeiPerEth: 1e18, // 1x + premiumMultiplierWeiPerEth: 5e17, // 0.5x + enabled: true + }) + ); + s_feeTokenConfigArgs.push( + EVM2EVMOnRamp.FeeTokenConfigArgs({ + token: WETH, + networkFeeUSDCents: 5_00, // 5 USD + gasMultiplierWeiPerEth: 2e18, // 2x + premiumMultiplierWeiPerEth: 2e18, // 2x + enabled: true + }) + ); + + s_tokenTransferFeeConfigArgs.push( + EVM2EVMOnRamp.TokenTransferFeeConfigArgs({ + token: s_sourceFeeToken, + minFeeUSDCents: 1_00, // 1 USD + maxFeeUSDCents: 1000_00, // 1,000 USD + deciBps: 2_5, // 2.5 bps, or 0.025% + destGasOverhead: 84_000, + destBytesOverhead: uint32(Pool.CCIP_LOCK_OR_BURN_V1_RET_BYTES), + aggregateRateLimitEnabled: true + }) + ); + s_tokenTransferFeeConfigArgs.push( + EVM2EVMOnRamp.TokenTransferFeeConfigArgs({ + token: CUSTOM_TOKEN, + minFeeUSDCents: 2_00, // 1 USD + maxFeeUSDCents: 500_00, // 500 USD + deciBps: 10_0, // 10 bps, or 0.1% + destGasOverhead: 83_000, + destBytesOverhead: 200, + aggregateRateLimitEnabled: true + }) + ); + + s_onRamp = new EVM2EVMOnRampHelper( + EVM2EVMOnRamp.StaticConfig({ + linkToken: s_sourceTokens[0], + chainSelector: SOURCE_CHAIN_SELECTOR, + destChainSelector: DEST_CHAIN_SELECTOR, + defaultTxGasLimit: GAS_LIMIT, + maxNopFeesJuels: MAX_NOP_FEES_JUELS, + prevOnRamp: address(0), + rmnProxy: address(s_mockRMN), + tokenAdminRegistry: address(s_tokenAdminRegistry) + }), + generateDynamicOnRampConfig(address(s_sourceRouter), address(s_feeQuoter)), + _getOutboundRateLimiterConfig(), + s_feeTokenConfigArgs, + s_tokenTransferFeeConfigArgs, + getNopsAndWeights() + ); + s_onRamp.setAdmin(ADMIN); + + s_metadataHash = keccak256( + abi.encode(Internal.EVM_2_EVM_MESSAGE_HASH, SOURCE_CHAIN_SELECTOR, DEST_CHAIN_SELECTOR, address(s_onRamp)) + ); + + s_offRamps = new address[](2); + s_offRamps[0] = address(10); + s_offRamps[1] = address(11); + Router.OnRamp[] memory onRampUpdates = new Router.OnRamp[](1); + Router.OffRamp[] memory offRampUpdates = new Router.OffRamp[](2); + onRampUpdates[0] = Router.OnRamp({destChainSelector: DEST_CHAIN_SELECTOR, onRamp: address(s_onRamp)}); + offRampUpdates[0] = Router.OffRamp({sourceChainSelector: SOURCE_CHAIN_SELECTOR, offRamp: s_offRamps[0]}); + offRampUpdates[1] = Router.OffRamp({sourceChainSelector: SOURCE_CHAIN_SELECTOR, offRamp: s_offRamps[1]}); + s_sourceRouter.applyRampUpdates(onRampUpdates, new Router.OffRamp[](0), offRampUpdates); + + // Pre approve the first token so the gas estimates of the tests + // only cover actual gas usage from the ramps + IERC20(s_sourceTokens[0]).approve(address(s_sourceRouter), 2 ** 128); + IERC20(s_sourceTokens[1]).approve(address(s_sourceRouter), 2 ** 128); + } + + function getNopsAndWeights() internal pure returns (EVM2EVMOnRamp.NopAndWeight[] memory) { + EVM2EVMOnRamp.NopAndWeight[] memory nopsAndWeights = new EVM2EVMOnRamp.NopAndWeight[](3); + nopsAndWeights[0] = EVM2EVMOnRamp.NopAndWeight({nop: USER_1, weight: 19284}); + nopsAndWeights[1] = EVM2EVMOnRamp.NopAndWeight({nop: USER_2, weight: 52935}); + nopsAndWeights[2] = EVM2EVMOnRamp.NopAndWeight({nop: USER_3, weight: 8}); + return nopsAndWeights; + } + + function generateDynamicOnRampConfig( + address router, + address priceRegistry + ) internal pure returns (EVM2EVMOnRamp.DynamicConfig memory) { + return EVM2EVMOnRamp.DynamicConfig({ + router: router, + maxNumberOfTokensPerMsg: MAX_TOKENS_LENGTH, + destGasOverhead: DEST_GAS_OVERHEAD, + destGasPerPayloadByte: DEST_GAS_PER_PAYLOAD_BYTE, + destDataAvailabilityOverheadGas: DEST_DATA_AVAILABILITY_OVERHEAD_GAS, + destGasPerDataAvailabilityByte: DEST_GAS_PER_DATA_AVAILABILITY_BYTE, + destDataAvailabilityMultiplierBps: DEST_GAS_DATA_AVAILABILITY_MULTIPLIER_BPS, + priceRegistry: priceRegistry, + maxDataBytes: MAX_DATA_SIZE, + maxPerMsgGasLimit: MAX_GAS_LIMIT, + defaultTokenFeeUSDCents: DEFAULT_TOKEN_FEE_USD_CENTS, + defaultTokenDestGasOverhead: DEFAULT_TOKEN_DEST_GAS_OVERHEAD, + enforceOutOfOrder: false + }); + } + + function _generateTokenMessage() public view returns (Client.EVM2AnyMessage memory) { + Client.EVMTokenAmount[] memory tokenAmounts = _getCastedSourceEVMTokenAmountsWithZeroAmounts(); + tokenAmounts[0].amount = i_tokenAmount0; + tokenAmounts[1].amount = i_tokenAmount1; + return Client.EVM2AnyMessage({ + receiver: abi.encode(OWNER), + data: "", + tokenAmounts: tokenAmounts, + feeToken: s_sourceFeeToken, + extraArgs: Client._argsToBytes(Client.EVMExtraArgsV1({gasLimit: GAS_LIMIT})) + }); + } + + function _generateSingleTokenMessage( + address token, + uint256 amount + ) public view returns (Client.EVM2AnyMessage memory) { + Client.EVMTokenAmount[] memory tokenAmounts = new Client.EVMTokenAmount[](1); + tokenAmounts[0] = Client.EVMTokenAmount({token: token, amount: amount}); + + return Client.EVM2AnyMessage({ + receiver: abi.encode(OWNER), + data: "", + tokenAmounts: tokenAmounts, + feeToken: s_sourceFeeToken, + extraArgs: Client._argsToBytes(Client.EVMExtraArgsV1({gasLimit: GAS_LIMIT})) + }); + } + + function _generateEmptyMessage() public view returns (Client.EVM2AnyMessage memory) { + return Client.EVM2AnyMessage({ + receiver: abi.encode(OWNER), + data: "", + tokenAmounts: new Client.EVMTokenAmount[](0), + feeToken: s_sourceFeeToken, + extraArgs: Client._argsToBytes(Client.EVMExtraArgsV1({gasLimit: GAS_LIMIT})) + }); + } + + function _messageToEvent( + Client.EVM2AnyMessage memory message, + uint64 seqNum, + uint64 nonce, + uint256 feeTokenAmount, + address originalSender + ) public view returns (Internal.EVM2EVMMessage memory) { + // Slicing is only available for calldata. So we have to build a new bytes array. + bytes memory args = new bytes(message.extraArgs.length - 4); + for (uint256 i = 4; i < message.extraArgs.length; ++i) { + args[i - 4] = message.extraArgs[i]; + } + uint256 numberOfTokens = message.tokenAmounts.length; + Client.EVMExtraArgsV2 memory extraArgs = _extraArgsFromBytes(bytes4(message.extraArgs), args); + Internal.EVM2EVMMessage memory messageEvent = Internal.EVM2EVMMessage({ + sequenceNumber: seqNum, + feeTokenAmount: feeTokenAmount, + sender: originalSender, + nonce: extraArgs.allowOutOfOrderExecution ? 0 : nonce, + gasLimit: extraArgs.gasLimit, + strict: false, + sourceChainSelector: SOURCE_CHAIN_SELECTOR, + receiver: abi.decode(message.receiver, (address)), + data: message.data, + tokenAmounts: message.tokenAmounts, + sourceTokenData: new bytes[](numberOfTokens), + feeToken: message.feeToken, + messageId: "" + }); + + for (uint256 i = 0; i < numberOfTokens; ++i) { + EVM2EVMOnRamp.TokenTransferFeeConfig memory tokenTransferFeeConfig = + s_onRamp.getTokenTransferFeeConfig(message.tokenAmounts[i].token); + + messageEvent.sourceTokenData[i] = abi.encode( + Internal.SourceTokenData({ + sourcePoolAddress: abi.encode(s_sourcePoolByToken[message.tokenAmounts[i].token]), + destTokenAddress: abi.encode(s_destTokenBySourceToken[message.tokenAmounts[i].token]), + extraData: "", + destGasAmount: tokenTransferFeeConfig.isEnabled + ? tokenTransferFeeConfig.destGasOverhead + : DEFAULT_TOKEN_DEST_GAS_OVERHEAD + }) + ); + } + + messageEvent.messageId = Internal._hash(messageEvent, s_metadataHash); + return messageEvent; + } + + function _extraArgsFromBytes( + bytes4 sig, + bytes memory extraArgData + ) public pure returns (Client.EVMExtraArgsV2 memory) { + if (sig == Client.EVM_EXTRA_ARGS_V1_TAG) { + Client.EVMExtraArgsV1 memory extraArgsV1 = abi.decode(extraArgData, (Client.EVMExtraArgsV1)); + return Client.EVMExtraArgsV2({gasLimit: extraArgsV1.gasLimit, allowOutOfOrderExecution: false}); + } else if (sig == Client.EVM_EXTRA_ARGS_V2_TAG) { + return abi.decode(extraArgData, (Client.EVMExtraArgsV2)); + } else { + revert("Invalid extraArgs tag"); + } + } +} diff --git a/contracts/src/v0.8/ccip/test/onRamp/OnRamp.t.sol b/contracts/src/v0.8/ccip/test/onRamp/OnRamp.t.sol new file mode 100644 index 00000000000..d989c15651e --- /dev/null +++ b/contracts/src/v0.8/ccip/test/onRamp/OnRamp.t.sol @@ -0,0 +1,993 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {IMessageInterceptor} from "../../interfaces/IMessageInterceptor.sol"; +import {IRMNV2} from "../../interfaces/IRMNV2.sol"; +import {IRouter} from "../../interfaces/IRouter.sol"; + +import {BurnMintERC677} from "../../../shared/token/ERC677/BurnMintERC677.sol"; +import {FeeQuoter} from "../../FeeQuoter.sol"; +import {Client} from "../../libraries/Client.sol"; +import {Internal} from "../../libraries/Internal.sol"; +import {Pool} from "../../libraries/Pool.sol"; +import {USDPriceWith18Decimals} from "../../libraries/USDPriceWith18Decimals.sol"; +import {OnRamp} from "../../onRamp/OnRamp.sol"; +import {TokenPool} from "../../pools/TokenPool.sol"; +import {MaybeRevertingBurnMintTokenPool} from "../helpers/MaybeRevertingBurnMintTokenPool.sol"; +import "./OnRampSetup.t.sol"; + +import {IERC20} from "../../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/IERC20.sol"; + +contract OnRamp_constructor is OnRampSetup { + function test_Constructor_Success() public { + OnRamp.StaticConfig memory staticConfig = OnRamp.StaticConfig({ + chainSelector: SOURCE_CHAIN_SELECTOR, + rmn: s_mockRMNRemote, + nonceManager: address(s_outboundNonceManager), + tokenAdminRegistry: address(s_tokenAdminRegistry) + }); + OnRamp.DynamicConfig memory dynamicConfig = _generateDynamicOnRampConfig(address(s_feeQuoter)); + + vm.expectEmit(); + emit OnRamp.ConfigSet(staticConfig, dynamicConfig); + vm.expectEmit(); + emit OnRamp.DestChainConfigSet(DEST_CHAIN_SELECTOR, 0, s_sourceRouter, false); + + _deployOnRamp(SOURCE_CHAIN_SELECTOR, s_sourceRouter, address(s_outboundNonceManager), address(s_tokenAdminRegistry)); + + OnRamp.StaticConfig memory gotStaticConfig = s_onRamp.getStaticConfig(); + _assertStaticConfigsEqual(staticConfig, gotStaticConfig); + + OnRamp.DynamicConfig memory gotDynamicConfig = s_onRamp.getDynamicConfig(); + _assertDynamicConfigsEqual(dynamicConfig, gotDynamicConfig); + + // Initial values + assertEq("OnRamp 1.6.0-dev", s_onRamp.typeAndVersion()); + assertEq(OWNER, s_onRamp.owner()); + assertEq(1, s_onRamp.getExpectedNextSequenceNumber(DEST_CHAIN_SELECTOR)); + assertEq(address(s_sourceRouter), address(s_onRamp.getRouter(DEST_CHAIN_SELECTOR))); + } + + function test_Constructor_InvalidConfigChainSelectorEqZero_Revert() public { + vm.expectRevert(OnRamp.InvalidConfig.selector); + new OnRampHelper( + OnRamp.StaticConfig({ + chainSelector: 0, + rmn: s_mockRMNRemote, + nonceManager: address(s_outboundNonceManager), + tokenAdminRegistry: address(s_tokenAdminRegistry) + }), + _generateDynamicOnRampConfig(address(s_feeQuoter)), + _generateDestChainConfigArgs(IRouter(address(0))) + ); + } + + function test_Constructor_InvalidConfigRMNProxyEqAddressZero_Revert() public { + vm.expectRevert(OnRamp.InvalidConfig.selector); + s_onRamp = new OnRampHelper( + OnRamp.StaticConfig({ + chainSelector: SOURCE_CHAIN_SELECTOR, + rmn: IRMNV2(address(0)), + nonceManager: address(s_outboundNonceManager), + tokenAdminRegistry: address(s_tokenAdminRegistry) + }), + _generateDynamicOnRampConfig(address(s_feeQuoter)), + _generateDestChainConfigArgs(IRouter(address(0))) + ); + } + + function test_Constructor_InvalidConfigNonceManagerEqAddressZero_Revert() public { + vm.expectRevert(OnRamp.InvalidConfig.selector); + new OnRampHelper( + OnRamp.StaticConfig({ + chainSelector: SOURCE_CHAIN_SELECTOR, + rmn: s_mockRMNRemote, + nonceManager: address(0), + tokenAdminRegistry: address(s_tokenAdminRegistry) + }), + _generateDynamicOnRampConfig(address(s_feeQuoter)), + _generateDestChainConfigArgs(IRouter(address(0))) + ); + } + + function test_Constructor_InvalidConfigTokenAdminRegistryEqAddressZero_Revert() public { + vm.expectRevert(OnRamp.InvalidConfig.selector); + new OnRampHelper( + OnRamp.StaticConfig({ + chainSelector: SOURCE_CHAIN_SELECTOR, + rmn: s_mockRMNRemote, + nonceManager: address(s_outboundNonceManager), + tokenAdminRegistry: address(0) + }), + _generateDynamicOnRampConfig(address(s_feeQuoter)), + _generateDestChainConfigArgs(IRouter(address(0))) + ); + } +} + +contract OnRamp_forwardFromRouter is OnRampSetup { + struct LegacyExtraArgs { + uint256 gasLimit; + bool strict; + } + + function setUp() public virtual override { + super.setUp(); + + address[] memory feeTokens = new address[](1); + feeTokens[0] = s_sourceTokens[1]; + s_feeQuoter.applyFeeTokensUpdates(feeTokens, new address[](0)); + + uint64[] memory destinationChainSelectors = new uint64[](1); + destinationChainSelectors[0] = DEST_CHAIN_SELECTOR; + address[] memory addAllowedList = new address[](1); + addAllowedList[0] = OWNER; + OnRamp.AllowListConfigArgs memory allowListConfigArgs = OnRamp.AllowListConfigArgs({ + allowListEnabled: true, + destChainSelector: DEST_CHAIN_SELECTOR, + addedAllowlistedSenders: addAllowedList, + removedAllowlistedSenders: new address[](0) + }); + OnRamp.AllowListConfigArgs[] memory applyAllowListConfigArgsItems = new OnRamp.AllowListConfigArgs[](1); + applyAllowListConfigArgsItems[0] = allowListConfigArgs; + s_onRamp.applyAllowListUpdates(applyAllowListConfigArgsItems); + + // Since we'll mostly be testing for valid calls from the router we'll + // mock all calls to be originating from the router and re-mock in + // tests that require failure. + vm.startPrank(address(s_sourceRouter)); + } + + function test_ForwardFromRouterSuccessCustomExtraArgs() public { + Client.EVM2AnyMessage memory message = _generateEmptyMessage(); + message.extraArgs = Client._argsToBytes(Client.EVMExtraArgsV1({gasLimit: GAS_LIMIT * 2})); + uint256 feeAmount = 1234567890; + IERC20(s_sourceFeeToken).transferFrom(OWNER, address(s_onRamp), feeAmount); + + vm.expectEmit(); + emit OnRamp.CCIPMessageSent(DEST_CHAIN_SELECTOR, _messageToEvent(message, 1, 1, feeAmount, OWNER)); + + s_onRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, message, feeAmount, OWNER); + } + + function test_ForwardFromRouter_Success_ConfigurableSourceRouter() public { + Client.EVM2AnyMessage memory message = _generateEmptyMessage(); + message.extraArgs = Client._argsToBytes(Client.EVMExtraArgsV1({gasLimit: GAS_LIMIT * 2})); + uint256 feeAmount = 1234567890; + IERC20(s_sourceFeeToken).transferFrom(OWNER, address(s_onRamp), feeAmount); + + // Change the source router for this lane + IRouter newRouter = IRouter(makeAddr("NEW ROUTER")); + vm.stopPrank(); + vm.prank(OWNER); + s_onRamp.applyDestChainConfigUpdates(_generateDestChainConfigArgs(newRouter)); + + // forward fails from wrong router + vm.prank(address(s_sourceRouter)); + vm.expectRevert(OnRamp.MustBeCalledByRouter.selector); + s_onRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, message, feeAmount, OWNER); + + // forward succeeds from correct router + vm.prank(address(newRouter)); + s_onRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, message, feeAmount, OWNER); + } + + function test_ForwardFromRouterSuccessLegacyExtraArgs() public { + Client.EVM2AnyMessage memory message = _generateEmptyMessage(); + message.extraArgs = + abi.encodeWithSelector(Client.EVM_EXTRA_ARGS_V1_TAG, LegacyExtraArgs({gasLimit: GAS_LIMIT * 2, strict: true})); + uint256 feeAmount = 1234567890; + IERC20(s_sourceFeeToken).transferFrom(OWNER, address(s_onRamp), feeAmount); + + vm.expectEmit(); + // We expect the message to be emitted with strict = false. + emit OnRamp.CCIPMessageSent(DEST_CHAIN_SELECTOR, _messageToEvent(message, 1, 1, feeAmount, OWNER)); + + s_onRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, message, feeAmount, OWNER); + } + + function test_ForwardFromRouterSuccessEmptyExtraArgs() public { + Client.EVM2AnyMessage memory message = _generateEmptyMessage(); + message.extraArgs = ""; + uint256 feeAmount = 1234567890; + IERC20(s_sourceFeeToken).transferFrom(OWNER, address(s_onRamp), feeAmount); + + vm.expectEmit(); + // We expect the message to be emitted with strict = false. + emit OnRamp.CCIPMessageSent(DEST_CHAIN_SELECTOR, _messageToEvent(message, 1, 1, feeAmount, OWNER)); + + s_onRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, message, feeAmount, OWNER); + } + + function test_ForwardFromRouter_Success() public { + Client.EVM2AnyMessage memory message = _generateEmptyMessage(); + + uint256 feeAmount = 1234567890; + IERC20(s_sourceFeeToken).transferFrom(OWNER, address(s_onRamp), feeAmount); + + vm.expectEmit(); + emit OnRamp.CCIPMessageSent(DEST_CHAIN_SELECTOR, _messageToEvent(message, 1, 1, feeAmount, OWNER)); + + s_onRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, message, feeAmount, OWNER); + } + + function test_ForwardFromRouterExtraArgsV2_Success() public { + Client.EVM2AnyMessage memory message = _generateEmptyMessage(); + message.extraArgs = abi.encodeWithSelector( + Client.EVM_EXTRA_ARGS_V2_TAG, Client.EVMExtraArgsV2({gasLimit: GAS_LIMIT * 2, allowOutOfOrderExecution: false}) + ); + uint256 feeAmount = 1234567890; + IERC20(s_sourceFeeToken).transferFrom(OWNER, address(s_onRamp), feeAmount); + + vm.expectEmit(); + emit OnRamp.CCIPMessageSent(DEST_CHAIN_SELECTOR, _messageToEvent(message, 1, 1, feeAmount, OWNER)); + + s_onRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, message, feeAmount, OWNER); + } + + function test_ForwardFromRouterExtraArgsV2AllowOutOfOrderTrue_Success() public { + Client.EVM2AnyMessage memory message = _generateEmptyMessage(); + message.extraArgs = abi.encodeWithSelector( + Client.EVM_EXTRA_ARGS_V2_TAG, Client.EVMExtraArgsV2({gasLimit: GAS_LIMIT * 2, allowOutOfOrderExecution: true}) + ); + uint256 feeAmount = 1234567890; + IERC20(s_sourceFeeToken).transferFrom(OWNER, address(s_onRamp), feeAmount); + + vm.expectEmit(); + emit OnRamp.CCIPMessageSent(DEST_CHAIN_SELECTOR, _messageToEvent(message, 1, 1, feeAmount, OWNER)); + + s_onRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, message, feeAmount, OWNER); + } + + function test_ShouldIncrementSeqNumAndNonce_Success() public { + Client.EVM2AnyMessage memory message = _generateEmptyMessage(); + + for (uint64 i = 1; i < 4; ++i) { + uint64 nonceBefore = s_outboundNonceManager.getOutboundNonce(DEST_CHAIN_SELECTOR, OWNER); + uint64 sequenceNumberBefore = s_onRamp.getExpectedNextSequenceNumber(DEST_CHAIN_SELECTOR) - 1; + + vm.expectEmit(); + emit OnRamp.CCIPMessageSent(DEST_CHAIN_SELECTOR, _messageToEvent(message, i, i, 0, OWNER)); + + s_onRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, message, 0, OWNER); + + uint64 nonceAfter = s_outboundNonceManager.getOutboundNonce(DEST_CHAIN_SELECTOR, OWNER); + uint64 sequenceNumberAfter = s_onRamp.getExpectedNextSequenceNumber(DEST_CHAIN_SELECTOR) - 1; + assertEq(nonceAfter, nonceBefore + 1); + assertEq(sequenceNumberAfter, sequenceNumberBefore + 1); + } + } + + function test_ShouldIncrementNonceOnlyOnOrdered_Success() public { + Client.EVM2AnyMessage memory message = _generateEmptyMessage(); + message.extraArgs = abi.encodeWithSelector( + Client.EVM_EXTRA_ARGS_V2_TAG, Client.EVMExtraArgsV2({gasLimit: GAS_LIMIT * 2, allowOutOfOrderExecution: true}) + ); + + for (uint64 i = 1; i < 4; ++i) { + uint64 nonceBefore = s_outboundNonceManager.getOutboundNonce(DEST_CHAIN_SELECTOR, OWNER); + uint64 sequenceNumberBefore = s_onRamp.getExpectedNextSequenceNumber(DEST_CHAIN_SELECTOR) - 1; + + vm.expectEmit(); + emit OnRamp.CCIPMessageSent(DEST_CHAIN_SELECTOR, _messageToEvent(message, i, i, 0, OWNER)); + + s_onRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, message, 0, OWNER); + + uint64 nonceAfter = s_outboundNonceManager.getOutboundNonce(DEST_CHAIN_SELECTOR, OWNER); + uint64 sequenceNumberAfter = s_onRamp.getExpectedNextSequenceNumber(DEST_CHAIN_SELECTOR) - 1; + assertEq(nonceAfter, nonceBefore); + assertEq(sequenceNumberAfter, sequenceNumberBefore + 1); + } + } + + function test_ShouldStoreLinkFees() public { + Client.EVM2AnyMessage memory message = _generateEmptyMessage(); + + uint256 feeAmount = 1234567890; + IERC20(s_sourceFeeToken).transferFrom(OWNER, address(s_onRamp), feeAmount); + + vm.expectEmit(); + emit OnRamp.FeePaid(s_sourceFeeToken, feeAmount); + s_onRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, message, feeAmount, OWNER); + + assertEq(IERC20(s_sourceFeeToken).balanceOf(address(s_onRamp)), feeAmount); + } + + function test_ShouldStoreNonLinkFees() public { + Client.EVM2AnyMessage memory message = _generateEmptyMessage(); + message.feeToken = s_sourceTokens[1]; + + uint256 feeAmount = 1234567890; + IERC20(s_sourceTokens[1]).transferFrom(OWNER, address(s_onRamp), feeAmount); + + // Calculate conversion done by prices contract + uint256 feeTokenPrice = s_feeQuoter.getTokenPrice(s_sourceTokens[1]).value; + uint256 linkTokenPrice = s_feeQuoter.getTokenPrice(s_sourceFeeToken).value; + uint256 conversionRate = (feeTokenPrice * 1e18) / linkTokenPrice; + uint256 expectedJuels = (feeAmount * conversionRate) / 1e18; + + vm.expectEmit(); + emit OnRamp.FeePaid(s_sourceTokens[1], expectedJuels); + s_onRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, message, feeAmount, OWNER); + + assertEq(IERC20(s_sourceTokens[1]).balanceOf(address(s_onRamp)), feeAmount); + } + + // Make sure any valid sender, receiver and feeAmount can be handled. + // @TODO Temporarily setting lower fuzz run as 256 triggers snapshot gas off by 1 error. + // https://github.com/foundry-rs/foundry/issues/5689 + /// forge-dynamicConfig: default.fuzz.runs = 32 + /// forge-dynamicConfig: ccip.fuzz.runs = 32 + function test_Fuzz_ForwardFromRouter_Success(address originalSender, address receiver, uint96 feeTokenAmount) public { + // To avoid RouterMustSetOriginalSender + vm.assume(originalSender != address(0)); + vm.assume(uint160(receiver) >= Internal.PRECOMPILE_SPACE); + feeTokenAmount = uint96(bound(feeTokenAmount, 0, MAX_MSG_FEES_JUELS)); + vm.stopPrank(); + + vm.startPrank(OWNER); + uint64[] memory destinationChainSelectors = new uint64[](1); + destinationChainSelectors[0] = uint64(DEST_CHAIN_SELECTOR); + address[] memory addAllowedList = new address[](1); + addAllowedList[0] = originalSender; + OnRamp.AllowListConfigArgs memory allowListConfigArgs = OnRamp.AllowListConfigArgs({ + allowListEnabled: true, + destChainSelector: DEST_CHAIN_SELECTOR, + addedAllowlistedSenders: addAllowedList, + removedAllowlistedSenders: new address[](0) + }); + OnRamp.AllowListConfigArgs[] memory applyAllowListConfigArgsItems = new OnRamp.AllowListConfigArgs[](1); + applyAllowListConfigArgsItems[0] = allowListConfigArgs; + s_onRamp.applyAllowListUpdates(applyAllowListConfigArgsItems); + vm.stopPrank(); + + vm.startPrank(address(s_sourceRouter)); + + Client.EVM2AnyMessage memory message = _generateEmptyMessage(); + message.receiver = abi.encode(receiver); + + // Make sure the tokens are in the contract + deal(s_sourceFeeToken, address(s_onRamp), feeTokenAmount); + + Internal.EVM2AnyRampMessage memory expectedEvent = _messageToEvent(message, 1, 1, feeTokenAmount, originalSender); + + vm.expectEmit(); + emit OnRamp.FeePaid(s_sourceFeeToken, feeTokenAmount); + vm.expectEmit(false, false, false, true); + emit OnRamp.CCIPMessageSent(DEST_CHAIN_SELECTOR, expectedEvent); + + // Assert the message Id is correct + assertEq( + expectedEvent.header.messageId, + s_onRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, message, feeTokenAmount, originalSender) + ); + } + + function test_forwardFromRouter_WithValidation_Success() public { + _enableOutboundMessageValidator(); + + Client.EVM2AnyMessage memory message = _generateEmptyMessage(); + message.extraArgs = Client._argsToBytes(Client.EVMExtraArgsV1({gasLimit: GAS_LIMIT * 2})); + uint256 feeAmount = 1234567890; + message.tokenAmounts = new Client.EVMTokenAmount[](1); + message.tokenAmounts[0].amount = 1e18; + message.tokenAmounts[0].token = s_sourceTokens[0]; + IERC20(s_sourceFeeToken).transferFrom(OWNER, address(s_onRamp), feeAmount); + s_outboundMessageValidator.setMessageIdValidationState(keccak256(abi.encode(message)), false); + + vm.expectEmit(); + emit OnRamp.CCIPMessageSent(DEST_CHAIN_SELECTOR, _messageToEvent(message, 1, 1, feeAmount, OWNER)); + + s_onRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, message, feeAmount, OWNER); + } + + // Reverts + + function test_Paused_Revert() public { + // We pause by disabling the whitelist + vm.stopPrank(); + vm.startPrank(OWNER); + s_onRamp.setDynamicConfig(_generateDynamicOnRampConfig(address(2))); + vm.expectRevert(OnRamp.MustBeCalledByRouter.selector); + s_onRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, _generateEmptyMessage(), 0, OWNER); + } + + function test_InvalidExtraArgsTag_Revert() public { + Client.EVM2AnyMessage memory message = _generateEmptyMessage(); + message.extraArgs = bytes("bad args"); + + vm.expectRevert(FeeQuoter.InvalidExtraArgsTag.selector); + + s_onRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, message, 0, OWNER); + } + + function test_Permissions_Revert() public { + vm.stopPrank(); + vm.startPrank(OWNER); + vm.expectRevert(OnRamp.MustBeCalledByRouter.selector); + s_onRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, _generateEmptyMessage(), 0, OWNER); + } + + function test_OriginalSender_Revert() public { + vm.expectRevert(OnRamp.RouterMustSetOriginalSender.selector); + s_onRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, _generateEmptyMessage(), 0, address(0)); + } + + function test_UnAllowedOriginalSender_Revert() public { + vm.stopPrank(); + vm.startPrank(STRANGER); + vm.expectRevert(abi.encodeWithSelector(OnRamp.SenderNotAllowed.selector, STRANGER)); + s_onRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, _generateEmptyMessage(), 0, STRANGER); + } + + function test_MessageValidationError_Revert() public { + _enableOutboundMessageValidator(); + + Client.EVM2AnyMessage memory message = _generateEmptyMessage(); + message.extraArgs = Client._argsToBytes(Client.EVMExtraArgsV1({gasLimit: GAS_LIMIT * 2})); + uint256 feeAmount = 1234567890; + message.tokenAmounts = new Client.EVMTokenAmount[](1); + message.tokenAmounts[0].amount = 1e18; + message.tokenAmounts[0].token = s_sourceTokens[0]; + IERC20(s_sourceFeeToken).transferFrom(OWNER, address(s_onRamp), feeAmount); + s_outboundMessageValidator.setMessageIdValidationState(keccak256(abi.encode(message)), true); + + vm.expectRevert( + abi.encodeWithSelector(IMessageInterceptor.MessageValidationError.selector, bytes("Invalid message")) + ); + + s_onRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, message, feeAmount, OWNER); + } + + function test_MultiCannotSendZeroTokens_Revert() public { + Client.EVM2AnyMessage memory message = _generateEmptyMessage(); + message.tokenAmounts = new Client.EVMTokenAmount[](1); + message.tokenAmounts[0].amount = 0; + message.tokenAmounts[0].token = s_sourceTokens[0]; + vm.expectRevert(OnRamp.CannotSendZeroTokens.selector); + s_onRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, message, 0, OWNER); + } + + function test_UnsupportedToken_Revert() public { + address wrongToken = address(1); + + Client.EVM2AnyMessage memory message = _generateEmptyMessage(); + message.tokenAmounts = new Client.EVMTokenAmount[](1); + message.tokenAmounts[0].token = wrongToken; + message.tokenAmounts[0].amount = 1; + + // We need to set the price of this new token to be able to reach + // the proper revert point. This must be called by the owner. + vm.stopPrank(); + vm.startPrank(OWNER); + + Internal.PriceUpdates memory priceUpdates = _getSingleTokenPriceUpdateStruct(wrongToken, 1); + s_feeQuoter.updatePrices(priceUpdates); + + // Change back to the router + vm.startPrank(address(s_sourceRouter)); + vm.expectRevert(abi.encodeWithSelector(OnRamp.UnsupportedToken.selector, wrongToken)); + + s_onRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, message, 0, OWNER); + } + + function test_forwardFromRouter_UnsupportedToken_Revert() public { + Client.EVM2AnyMessage memory message = _generateEmptyMessage(); + message.tokenAmounts = new Client.EVMTokenAmount[](1); + message.tokenAmounts[0].amount = 1; + message.tokenAmounts[0].token = address(1); + + vm.expectRevert(abi.encodeWithSelector(OnRamp.UnsupportedToken.selector, message.tokenAmounts[0].token)); + + s_onRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, message, 0, OWNER); + } + + function test_MesssageFeeTooHigh_Revert() public { + Client.EVM2AnyMessage memory message = _generateEmptyMessage(); + + vm.expectRevert( + abi.encodeWithSelector(FeeQuoter.MessageFeeTooHigh.selector, MAX_MSG_FEES_JUELS + 1, MAX_MSG_FEES_JUELS) + ); + + s_onRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, message, MAX_MSG_FEES_JUELS + 1, OWNER); + } + + function test_SourceTokenDataTooLarge_Revert() public { + address sourceETH = s_sourceTokens[1]; + vm.stopPrank(); + vm.startPrank(OWNER); + + MaybeRevertingBurnMintTokenPool newPool = new MaybeRevertingBurnMintTokenPool( + BurnMintERC677(sourceETH), new address[](0), address(s_mockRMNRemote), address(s_sourceRouter) + ); + BurnMintERC677(sourceETH).grantMintAndBurnRoles(address(newPool)); + deal(address(sourceETH), address(newPool), type(uint256).max); + + // Add TokenPool to OnRamp + s_tokenAdminRegistry.setPool(sourceETH, address(newPool)); + + // Allow chain in TokenPool + TokenPool.ChainUpdate[] memory chainUpdates = new TokenPool.ChainUpdate[](1); + chainUpdates[0] = TokenPool.ChainUpdate({ + remoteChainSelector: DEST_CHAIN_SELECTOR, + remotePoolAddress: abi.encode(s_destTokenPool), + remoteTokenAddress: abi.encode(s_destToken), + allowed: true, + outboundRateLimiterConfig: _getOutboundRateLimiterConfig(), + inboundRateLimiterConfig: _getInboundRateLimiterConfig() + }); + newPool.applyChainUpdates(chainUpdates); + + Client.EVM2AnyMessage memory message = _generateSingleTokenMessage(address(sourceETH), 1000); + + // No data set, should succeed + vm.startPrank(address(s_sourceRouter)); + s_onRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, message, 0, OWNER); + + // Set max data length, should succeed + vm.startPrank(OWNER); + newPool.setSourceTokenData(new bytes(Pool.CCIP_LOCK_OR_BURN_V1_RET_BYTES)); + + vm.startPrank(address(s_sourceRouter)); + s_onRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, message, 0, OWNER); + + // Set data to max length +1, should revert + vm.startPrank(OWNER); + newPool.setSourceTokenData(new bytes(Pool.CCIP_LOCK_OR_BURN_V1_RET_BYTES + 1)); + + vm.startPrank(address(s_sourceRouter)); + vm.expectRevert(abi.encodeWithSelector(FeeQuoter.SourceTokenDataTooLarge.selector, sourceETH)); + s_onRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, message, 0, OWNER); + + // Set token config to allow larger data + vm.startPrank(OWNER); + FeeQuoter.TokenTransferFeeConfigArgs[] memory tokenTransferFeeConfigArgs = _generateTokenTransferFeeConfigArgs(1, 1); + tokenTransferFeeConfigArgs[0].destChainSelector = DEST_CHAIN_SELECTOR; + tokenTransferFeeConfigArgs[0].tokenTransferFeeConfigs[0].token = sourceETH; + tokenTransferFeeConfigArgs[0].tokenTransferFeeConfigs[0].tokenTransferFeeConfig = FeeQuoter.TokenTransferFeeConfig({ + minFeeUSDCents: 1, + maxFeeUSDCents: 0, + deciBps: 0, + destGasOverhead: 0, + destBytesOverhead: uint32(Pool.CCIP_LOCK_OR_BURN_V1_RET_BYTES) + 32, + isEnabled: true + }); + s_feeQuoter.applyTokenTransferFeeConfigUpdates( + tokenTransferFeeConfigArgs, new FeeQuoter.TokenTransferFeeConfigRemoveArgs[](0) + ); + + vm.startPrank(address(s_sourceRouter)); + s_onRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, message, 0, OWNER); + + // Set the token data larger than the configured token data, should revert + vm.startPrank(OWNER); + newPool.setSourceTokenData(new bytes(uint32(Pool.CCIP_LOCK_OR_BURN_V1_RET_BYTES) + 32 + 1)); + + vm.startPrank(address(s_sourceRouter)); + vm.expectRevert(abi.encodeWithSelector(FeeQuoter.SourceTokenDataTooLarge.selector, sourceETH)); + s_onRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, message, 0, OWNER); + } +} + +contract OnRamp_getSupportedTokens is OnRampSetup { + function test_GetSupportedTokens_Revert() public { + vm.expectRevert(OnRamp.GetSupportedTokensFunctionalityRemovedCheckAdminRegistry.selector); + s_onRamp.getSupportedTokens(DEST_CHAIN_SELECTOR); + } +} + +contract OnRamp_getFee is OnRampSetup { + using USDPriceWith18Decimals for uint224; + + function test_EmptyMessage_Success() public view { + address[2] memory testTokens = [s_sourceFeeToken, s_sourceRouter.getWrappedNative()]; + uint224[2] memory feeTokenPrices = [s_feeTokenPrice, s_wrappedTokenPrice]; + + for (uint256 i = 0; i < feeTokenPrices.length; ++i) { + Client.EVM2AnyMessage memory message = _generateEmptyMessage(); + message.feeToken = testTokens[i]; + + uint256 feeAmount = s_onRamp.getFee(DEST_CHAIN_SELECTOR, message); + uint256 expectedFeeAmount = s_feeQuoter.getValidatedFee(DEST_CHAIN_SELECTOR, message); + + assertEq(expectedFeeAmount, feeAmount); + } + } + + function test_SingleTokenMessage_Success() public view { + address[2] memory testTokens = [s_sourceFeeToken, s_sourceRouter.getWrappedNative()]; + uint224[2] memory feeTokenPrices = [s_feeTokenPrice, s_wrappedTokenPrice]; + + uint256 tokenAmount = 10000e18; + for (uint256 i = 0; i < feeTokenPrices.length; ++i) { + Client.EVM2AnyMessage memory message = _generateSingleTokenMessage(s_sourceFeeToken, tokenAmount); + message.feeToken = testTokens[i]; + + uint256 feeAmount = s_onRamp.getFee(DEST_CHAIN_SELECTOR, message); + uint256 expectedFeeAmount = s_feeQuoter.getValidatedFee(DEST_CHAIN_SELECTOR, message); + + assertEq(expectedFeeAmount, feeAmount); + } + } + + function test_GetFeeOfZeroForTokenMessage_Success() public { + Client.EVM2AnyMessage memory message = _generateEmptyMessage(); + + uint256 feeAmount = s_onRamp.getFee(DEST_CHAIN_SELECTOR, message); + assertTrue(feeAmount > 0); + + FeeQuoter.PremiumMultiplierWeiPerEthArgs[] memory tokenMults = new FeeQuoter.PremiumMultiplierWeiPerEthArgs[](1); + tokenMults[0] = FeeQuoter.PremiumMultiplierWeiPerEthArgs({token: message.feeToken, premiumMultiplierWeiPerEth: 0}); + s_feeQuoter.applyPremiumMultiplierWeiPerEthUpdates(tokenMults); + + FeeQuoter.DestChainConfigArgs[] memory destChainConfigArgs = _generateFeeQuoterDestChainConfigArgs(); + destChainConfigArgs[0].destChainConfig.destDataAvailabilityMultiplierBps = 0; + destChainConfigArgs[0].destChainConfig.gasMultiplierWeiPerEth = 0; + s_feeQuoter.applyDestChainConfigUpdates(destChainConfigArgs); + + feeAmount = s_onRamp.getFee(DEST_CHAIN_SELECTOR, message); + + assertEq(0, feeAmount); + } + + // Reverts + + function test_Unhealthy_Revert() public { + _setMockRMNChainCurse(DEST_CHAIN_SELECTOR, true); + vm.expectRevert(abi.encodeWithSelector(OnRamp.CursedByRMN.selector, DEST_CHAIN_SELECTOR)); + s_onRamp.getFee(DEST_CHAIN_SELECTOR, _generateEmptyMessage()); + } + + function test_EnforceOutOfOrder_Revert() public { + // Update dynamic config to enforce allowOutOfOrderExecution = true. + vm.stopPrank(); + vm.startPrank(OWNER); + + FeeQuoter.DestChainConfigArgs[] memory destChainConfigArgs = _generateFeeQuoterDestChainConfigArgs(); + destChainConfigArgs[0].destChainConfig.enforceOutOfOrder = true; + s_feeQuoter.applyDestChainConfigUpdates(destChainConfigArgs); + vm.stopPrank(); + + Client.EVM2AnyMessage memory message = _generateEmptyMessage(); + // Empty extraArgs to should revert since it enforceOutOfOrder is true. + message.extraArgs = ""; + + vm.expectRevert(FeeQuoter.ExtraArgOutOfOrderExecutionMustBeTrue.selector); + s_onRamp.getFee(DEST_CHAIN_SELECTOR, message); + } + + function test_NotAFeeTokenButPricedToken_Revert() public { + Client.EVM2AnyMessage memory message = _generateEmptyMessage(); + message.feeToken = s_sourceTokens[1]; + + vm.expectRevert(abi.encodeWithSelector(FeeQuoter.FeeTokenNotSupported.selector, message.feeToken)); + + s_onRamp.getFee(DEST_CHAIN_SELECTOR, message); + } +} + +contract OnRamp_setDynamicConfig is OnRampSetup { + function test_SetDynamicConfig_Success() public { + OnRamp.StaticConfig memory staticConfig = s_onRamp.getStaticConfig(); + OnRamp.DynamicConfig memory newConfig = OnRamp.DynamicConfig({ + feeQuoter: address(23423), + messageValidator: makeAddr("messageValidator"), + feeAggregator: FEE_AGGREGATOR, + allowListAdmin: address(0) + }); + + vm.expectEmit(); + emit OnRamp.ConfigSet(staticConfig, newConfig); + + s_onRamp.setDynamicConfig(newConfig); + + OnRamp.DynamicConfig memory gotDynamicConfig = s_onRamp.getDynamicConfig(); + assertEq(newConfig.feeQuoter, gotDynamicConfig.feeQuoter); + } + + // Reverts + + function test_SetConfigInvalidConfigFeeQuoterEqAddressZero_Revert() public { + OnRamp.DynamicConfig memory newConfig = OnRamp.DynamicConfig({ + feeQuoter: address(0), + feeAggregator: FEE_AGGREGATOR, + messageValidator: makeAddr("messageValidator"), + allowListAdmin: address(0) + }); + + vm.expectRevert(OnRamp.InvalidConfig.selector); + s_onRamp.setDynamicConfig(newConfig); + } + + function test_SetConfigInvalidConfig_Revert() public { + OnRamp.DynamicConfig memory newConfig = OnRamp.DynamicConfig({ + feeQuoter: address(23423), + messageValidator: address(0), + feeAggregator: FEE_AGGREGATOR, + allowListAdmin: address(0) + }); + + // Invalid price reg reverts. + newConfig.feeQuoter = address(0); + vm.expectRevert(OnRamp.InvalidConfig.selector); + s_onRamp.setDynamicConfig(newConfig); + } + + function test_SetConfigInvalidConfigFeeAggregatorEqAddressZero_Revert() public { + OnRamp.DynamicConfig memory newConfig = OnRamp.DynamicConfig({ + feeQuoter: address(23423), + messageValidator: address(0), + feeAggregator: address(0), + allowListAdmin: address(0) + }); + + vm.expectRevert(OnRamp.InvalidConfig.selector); + s_onRamp.setDynamicConfig(newConfig); + } + + function test_SetConfigOnlyOwner_Revert() public { + vm.startPrank(STRANGER); + vm.expectRevert("Only callable by owner"); + s_onRamp.setDynamicConfig(_generateDynamicOnRampConfig(address(2))); + vm.startPrank(ADMIN); + vm.expectRevert("Only callable by owner"); + s_onRamp.setDynamicConfig(_generateDynamicOnRampConfig(address(2))); + } +} + +contract OnRamp_withdrawFeeTokens is OnRampSetup { + mapping(address => uint256) internal s_nopFees; + + function setUp() public virtual override { + super.setUp(); + + // Since we'll mostly be testing for valid calls from the router we'll + // mock all calls to be originating from the router and re-mock in + // tests that require failure. + vm.startPrank(address(s_sourceRouter)); + + uint256 feeAmount = 1234567890; + + // Send a bunch of messages, increasing the juels in the contract + for (uint256 i = 0; i < s_sourceFeeTokens.length; ++i) { + Client.EVM2AnyMessage memory message = _generateEmptyMessage(); + message.feeToken = s_sourceFeeTokens[i % s_sourceFeeTokens.length]; + uint256 newFeeTokenBalance = IERC20(message.feeToken).balanceOf(address(s_onRamp)) + feeAmount; + deal(message.feeToken, address(s_onRamp), newFeeTokenBalance); + s_nopFees[message.feeToken] = newFeeTokenBalance; + s_onRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, message, feeAmount, OWNER); + } + } + + function test_Fuzz_WithdrawFeeTokens_Success(uint256[5] memory amounts) public { + vm.startPrank(OWNER); + address[] memory feeTokens = new address[](amounts.length); + for (uint256 i = 0; i < amounts.length; ++i) { + vm.assume(amounts[i] > 0); + feeTokens[i] = _deploySourceToken("", amounts[i], 18); + IERC20(feeTokens[i]).transfer(address(s_onRamp), amounts[i]); + } + + s_feeQuoter.applyFeeTokensUpdates(feeTokens, new address[](0)); + + for (uint256 i = 0; i < feeTokens.length; ++i) { + vm.expectEmit(); + emit OnRamp.FeeTokenWithdrawn(FEE_AGGREGATOR, feeTokens[i], amounts[i]); + } + + s_onRamp.withdrawFeeTokens(); + + for (uint256 i = 0; i < feeTokens.length; ++i) { + assertEq(IERC20(feeTokens[i]).balanceOf(FEE_AGGREGATOR), amounts[i]); + assertEq(IERC20(feeTokens[i]).balanceOf(address(s_onRamp)), 0); + } + } + + function test_WithdrawFeeTokens_Success() public { + vm.expectEmit(); + emit OnRamp.FeeTokenWithdrawn(FEE_AGGREGATOR, s_sourceFeeToken, s_nopFees[s_sourceFeeToken]); + + s_onRamp.withdrawFeeTokens(); + + assertEq(IERC20(s_sourceFeeToken).balanceOf(FEE_AGGREGATOR), s_nopFees[s_sourceFeeToken]); + assertEq(IERC20(s_sourceFeeToken).balanceOf(address(s_onRamp)), 0); + } +} + +contract OnRamp_getTokenPool is OnRampSetup { + function test_GetTokenPool_Success() public view { + assertEq( + s_sourcePoolByToken[s_sourceTokens[0]], + address(s_onRamp.getPoolBySourceToken(DEST_CHAIN_SELECTOR, IERC20(s_sourceTokens[0]))) + ); + assertEq( + s_sourcePoolByToken[s_sourceTokens[1]], + address(s_onRamp.getPoolBySourceToken(DEST_CHAIN_SELECTOR, IERC20(s_sourceTokens[1]))) + ); + + address wrongToken = address(123); + address nonExistentPool = address(s_onRamp.getPoolBySourceToken(DEST_CHAIN_SELECTOR, IERC20(wrongToken))); + + assertEq(address(0), nonExistentPool); + } +} + +contract OnRamp_applyDestChainConfigUpdates is OnRampSetup { + function test_ApplyDestChainConfigUpdates_Success() external { + vm.stopPrank(); + vm.startPrank(OWNER); + OnRamp.DestChainConfigArgs[] memory configArgs = new OnRamp.DestChainConfigArgs[](1); + configArgs[0].destChainSelector = DEST_CHAIN_SELECTOR; + + // supports disabling a lane by setting a router to zero + vm.expectEmit(); + emit OnRamp.DestChainConfigSet(DEST_CHAIN_SELECTOR, 0, IRouter(address(0)), false); + s_onRamp.applyDestChainConfigUpdates(configArgs); + assertEq(address(0), address(s_onRamp.getRouter(DEST_CHAIN_SELECTOR))); + + // supports updating and adding lanes simultaneously + configArgs = new OnRamp.DestChainConfigArgs[](2); + configArgs[0] = OnRamp.DestChainConfigArgs({destChainSelector: DEST_CHAIN_SELECTOR, router: s_sourceRouter}); + configArgs[1] = OnRamp.DestChainConfigArgs({destChainSelector: 9999, router: IRouter(address(9999))}); + vm.expectEmit(); + emit OnRamp.DestChainConfigSet(DEST_CHAIN_SELECTOR, 0, s_sourceRouter, false); + vm.expectEmit(); + emit OnRamp.DestChainConfigSet(9999, 0, IRouter(address(9999)), false); + s_onRamp.applyDestChainConfigUpdates(configArgs); + assertEq(address(s_sourceRouter), address(s_onRamp.getRouter(DEST_CHAIN_SELECTOR))); + assertEq(address(9999), address(s_onRamp.getRouter(9999))); + + // handles empty list + uint256 numLogs = vm.getRecordedLogs().length; + configArgs = new OnRamp.DestChainConfigArgs[](0); + s_onRamp.applyDestChainConfigUpdates(configArgs); + assertEq(numLogs, vm.getRecordedLogs().length); // indicates no changes made + } + + function test_ApplyDestChainConfigUpdates_WithInvalidChainSelector_Revert() external { + vm.stopPrank(); + vm.startPrank(OWNER); + OnRamp.DestChainConfigArgs[] memory configArgs = new OnRamp.DestChainConfigArgs[](1); + configArgs[0].destChainSelector = 0; // invalid + vm.expectRevert(abi.encodeWithSelector(OnRamp.InvalidDestChainConfig.selector, 0)); + s_onRamp.applyDestChainConfigUpdates(configArgs); + } +} + +contract OnRamp_allowListConfigUpdates is OnRampSetup { + function test_applyAllowList_Success() public { + vm.stopPrank(); + vm.startPrank(OWNER); + + OnRamp.DestChainConfigArgs[] memory configArgs = new OnRamp.DestChainConfigArgs[](2); + configArgs[0] = OnRamp.DestChainConfigArgs({destChainSelector: DEST_CHAIN_SELECTOR, router: s_sourceRouter}); + configArgs[1] = OnRamp.DestChainConfigArgs({destChainSelector: 9999, router: IRouter(address(9999))}); + vm.expectEmit(); + emit OnRamp.DestChainConfigSet(DEST_CHAIN_SELECTOR, 0, s_sourceRouter, false); + vm.expectEmit(); + emit OnRamp.DestChainConfigSet(9999, 0, IRouter(address(9999)), false); + s_onRamp.applyDestChainConfigUpdates(configArgs); + + (uint64 sequenceNumber, bool allowListEnabled, address router) = s_onRamp.getDestChainConfig(9999); + assertEq(sequenceNumber, 0); + assertEq(allowListEnabled, false); + assertEq(router, address(9999)); + + uint64[] memory destinationChainSelectors = new uint64[](2); + destinationChainSelectors[0] = DEST_CHAIN_SELECTOR; + destinationChainSelectors[1] = uint64(99999); + + address[] memory addedAllowlistedSenders = new address[](4); + addedAllowlistedSenders[0] = vm.addr(1); + addedAllowlistedSenders[1] = vm.addr(2); + addedAllowlistedSenders[2] = vm.addr(3); + addedAllowlistedSenders[3] = vm.addr(4); + + vm.expectEmit(); + emit OnRamp.AllowListSendersAdded(DEST_CHAIN_SELECTOR, addedAllowlistedSenders); + + OnRamp.AllowListConfigArgs memory allowListConfigArgs = OnRamp.AllowListConfigArgs({ + allowListEnabled: true, + destChainSelector: DEST_CHAIN_SELECTOR, + addedAllowlistedSenders: addedAllowlistedSenders, + removedAllowlistedSenders: new address[](0) + }); + + OnRamp.AllowListConfigArgs[] memory applyAllowListConfigArgsItems = new OnRamp.AllowListConfigArgs[](1); + applyAllowListConfigArgsItems[0] = allowListConfigArgs; + + s_onRamp.applyAllowListUpdates(applyAllowListConfigArgsItems); + assertEq(4, s_onRamp.getAllowedSendersList(DEST_CHAIN_SELECTOR).length); + + assertEq(addedAllowlistedSenders, s_onRamp.getAllowedSendersList(DEST_CHAIN_SELECTOR)); + + address[] memory removedAllowlistedSenders = new address[](1); + removedAllowlistedSenders[0] = vm.addr(2); + + vm.expectEmit(); + emit OnRamp.AllowListSendersRemoved(DEST_CHAIN_SELECTOR, removedAllowlistedSenders); + + allowListConfigArgs = OnRamp.AllowListConfigArgs({ + allowListEnabled: true, + destChainSelector: DEST_CHAIN_SELECTOR, + addedAllowlistedSenders: new address[](0), + removedAllowlistedSenders: removedAllowlistedSenders + }); + + OnRamp.AllowListConfigArgs[] memory allowListConfigArgsItems_2 = new OnRamp.AllowListConfigArgs[](1); + allowListConfigArgsItems_2[0] = allowListConfigArgs; + + s_onRamp.applyAllowListUpdates(allowListConfigArgsItems_2); + assertEq(3, s_onRamp.getAllowedSendersList(DEST_CHAIN_SELECTOR).length); + + addedAllowlistedSenders = new address[](2); + addedAllowlistedSenders[0] = vm.addr(5); + addedAllowlistedSenders[1] = vm.addr(6); + + removedAllowlistedSenders = new address[](2); + removedAllowlistedSenders[0] = vm.addr(1); + removedAllowlistedSenders[1] = vm.addr(3); + + vm.expectEmit(); + emit OnRamp.AllowListSendersAdded(DEST_CHAIN_SELECTOR, addedAllowlistedSenders); + emit OnRamp.AllowListSendersRemoved(DEST_CHAIN_SELECTOR, removedAllowlistedSenders); + + allowListConfigArgs = OnRamp.AllowListConfigArgs({ + allowListEnabled: true, + destChainSelector: DEST_CHAIN_SELECTOR, + addedAllowlistedSenders: addedAllowlistedSenders, + removedAllowlistedSenders: removedAllowlistedSenders + }); + + OnRamp.AllowListConfigArgs[] memory allowListConfigArgsItems_3 = new OnRamp.AllowListConfigArgs[](1); + allowListConfigArgsItems_3[0] = allowListConfigArgs; + + s_onRamp.applyAllowListUpdates(allowListConfigArgsItems_3); + assertEq(3, s_onRamp.getAllowedSendersList(DEST_CHAIN_SELECTOR).length); + } + + function test_applyAllowList_Revert() public { + vm.stopPrank(); + vm.startPrank(OWNER); + + OnRamp.DestChainConfigArgs[] memory configArgs = new OnRamp.DestChainConfigArgs[](2); + configArgs[0] = OnRamp.DestChainConfigArgs({destChainSelector: DEST_CHAIN_SELECTOR, router: s_sourceRouter}); + configArgs[1] = OnRamp.DestChainConfigArgs({destChainSelector: 9999, router: IRouter(address(9999))}); + vm.expectEmit(); + emit OnRamp.DestChainConfigSet(DEST_CHAIN_SELECTOR, 0, s_sourceRouter, false); + vm.expectEmit(); + emit OnRamp.DestChainConfigSet(9999, 0, IRouter(address(9999)), false); + s_onRamp.applyDestChainConfigUpdates(configArgs); + + uint64[] memory destinationChainSelectors = new uint64[](2); + destinationChainSelectors[0] = DEST_CHAIN_SELECTOR; + destinationChainSelectors[1] = uint64(99999); + + address[] memory addedAllowlistedSenders = new address[](4); + addedAllowlistedSenders[0] = vm.addr(1); + addedAllowlistedSenders[1] = vm.addr(2); + addedAllowlistedSenders[2] = vm.addr(3); + addedAllowlistedSenders[3] = vm.addr(4); + + OnRamp.AllowListConfigArgs memory allowListConfigArgs = OnRamp.AllowListConfigArgs({ + allowListEnabled: true, + destChainSelector: DEST_CHAIN_SELECTOR, + addedAllowlistedSenders: addedAllowlistedSenders, + removedAllowlistedSenders: new address[](0) + }); + + OnRamp.AllowListConfigArgs[] memory applyAllowListConfigArgsItems = new OnRamp.AllowListConfigArgs[](1); + applyAllowListConfigArgsItems[0] = allowListConfigArgs; + + vm.startPrank(STRANGER); + vm.expectRevert(OnRamp.OnlyCallableByOwnerOrAllowlistAdmin.selector); + s_onRamp.applyAllowListUpdates(applyAllowListConfigArgsItems); + vm.stopPrank(); + + applyAllowListConfigArgsItems[0].addedAllowlistedSenders[0] = address(0); + vm.expectRevert(abi.encodeWithSelector(OnRamp.InvalidAllowListRequest.selector, DEST_CHAIN_SELECTOR)); + vm.startPrank(OWNER); + s_onRamp.applyAllowListUpdates(applyAllowListConfigArgsItems); + vm.stopPrank(); + } +} diff --git a/contracts/src/v0.8/ccip/test/onRamp/OnRampSetup.t.sol b/contracts/src/v0.8/ccip/test/onRamp/OnRampSetup.t.sol new file mode 100644 index 00000000000..4c43c16f59d --- /dev/null +++ b/contracts/src/v0.8/ccip/test/onRamp/OnRampSetup.t.sol @@ -0,0 +1,171 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {IRouter} from "../../interfaces/IRouter.sol"; + +import {AuthorizedCallers} from "../../../shared/access/AuthorizedCallers.sol"; +import {NonceManager} from "../../NonceManager.sol"; +import {Router} from "../../Router.sol"; +import {Client} from "../../libraries/Client.sol"; +import {Internal} from "../../libraries/Internal.sol"; +import {OnRamp} from "../../onRamp/OnRamp.sol"; +import {FeeQuoterFeeSetup} from "../feeQuoter/FeeQuoterSetup.t.sol"; +import {MessageInterceptorHelper} from "../helpers/MessageInterceptorHelper.sol"; +import {OnRampHelper} from "../helpers/OnRampHelper.sol"; + +import {IERC20} from "../../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/IERC20.sol"; + +contract OnRampSetup is FeeQuoterFeeSetup { + uint256 internal immutable i_tokenAmount0 = 9; + uint256 internal immutable i_tokenAmount1 = 7; + + bytes32 internal s_metadataHash; + + OnRampHelper internal s_onRamp; + MessageInterceptorHelper internal s_outboundMessageValidator; + address[] internal s_offRamps; + NonceManager internal s_outboundNonceManager; + + function setUp() public virtual override { + super.setUp(); + + s_outboundMessageValidator = new MessageInterceptorHelper(); + s_outboundNonceManager = new NonceManager(new address[](0)); + (s_onRamp, s_metadataHash) = _deployOnRamp( + SOURCE_CHAIN_SELECTOR, s_sourceRouter, address(s_outboundNonceManager), address(s_tokenAdminRegistry) + ); + + s_offRamps = new address[](2); + s_offRamps[0] = address(10); + s_offRamps[1] = address(11); + Router.OnRamp[] memory onRampUpdates = new Router.OnRamp[](1); + Router.OffRamp[] memory offRampUpdates = new Router.OffRamp[](2); + onRampUpdates[0] = Router.OnRamp({destChainSelector: DEST_CHAIN_SELECTOR, onRamp: address(s_onRamp)}); + offRampUpdates[0] = Router.OffRamp({sourceChainSelector: SOURCE_CHAIN_SELECTOR, offRamp: s_offRamps[0]}); + offRampUpdates[1] = Router.OffRamp({sourceChainSelector: SOURCE_CHAIN_SELECTOR, offRamp: s_offRamps[1]}); + s_sourceRouter.applyRampUpdates(onRampUpdates, new Router.OffRamp[](0), offRampUpdates); + + // Pre approve the first token so the gas estimates of the tests + // only cover actual gas usage from the ramps + IERC20(s_sourceTokens[0]).approve(address(s_sourceRouter), 2 ** 128); + IERC20(s_sourceTokens[1]).approve(address(s_sourceRouter), 2 ** 128); + } + + function _generateTokenMessage() public view returns (Client.EVM2AnyMessage memory) { + Client.EVMTokenAmount[] memory tokenAmounts = _getCastedSourceEVMTokenAmountsWithZeroAmounts(); + tokenAmounts[0].amount = i_tokenAmount0; + tokenAmounts[1].amount = i_tokenAmount1; + return Client.EVM2AnyMessage({ + receiver: abi.encode(OWNER), + data: "", + tokenAmounts: tokenAmounts, + feeToken: s_sourceFeeToken, + extraArgs: Client._argsToBytes(Client.EVMExtraArgsV1({gasLimit: GAS_LIMIT})) + }); + } + + function _messageToEvent( + Client.EVM2AnyMessage memory message, + uint64 seqNum, + uint64 nonce, + uint256 feeTokenAmount, + address originalSender + ) public view returns (Internal.EVM2AnyRampMessage memory) { + return _messageToEvent( + message, + SOURCE_CHAIN_SELECTOR, + DEST_CHAIN_SELECTOR, + seqNum, + nonce, + feeTokenAmount, + originalSender, + s_metadataHash, + s_tokenAdminRegistry + ); + } + + function _generateDynamicOnRampConfig(address feeQuoter) internal pure returns (OnRamp.DynamicConfig memory) { + return OnRamp.DynamicConfig({ + feeQuoter: feeQuoter, + messageValidator: address(0), + feeAggregator: FEE_AGGREGATOR, + allowListAdmin: address(0) + }); + } + + // Slicing is only available for calldata. So we have to build a new bytes array. + function _removeFirst4Bytes(bytes memory data) internal pure returns (bytes memory) { + bytes memory result = new bytes(data.length - 4); + for (uint256 i = 4; i < data.length; ++i) { + result[i - 4] = data[i]; + } + return result; + } + + function _generateDestChainConfigArgs(IRouter router) internal pure returns (OnRamp.DestChainConfigArgs[] memory) { + OnRamp.DestChainConfigArgs[] memory destChainConfigs = new OnRamp.DestChainConfigArgs[](1); + destChainConfigs[0] = OnRamp.DestChainConfigArgs({destChainSelector: DEST_CHAIN_SELECTOR, router: router}); + return destChainConfigs; + } + + function _deployOnRamp( + uint64 sourceChainSelector, + IRouter router, + address nonceManager, + address tokenAdminRegistry + ) internal returns (OnRampHelper, bytes32 metadataHash) { + OnRampHelper onRamp = new OnRampHelper( + OnRamp.StaticConfig({ + chainSelector: sourceChainSelector, + rmn: s_mockRMNRemote, + nonceManager: nonceManager, + tokenAdminRegistry: tokenAdminRegistry + }), + _generateDynamicOnRampConfig(address(s_feeQuoter)), + _generateDestChainConfigArgs(router) + ); + + address[] memory authorizedCallers = new address[](1); + authorizedCallers[0] = address(onRamp); + + NonceManager(nonceManager).applyAuthorizedCallerUpdates( + AuthorizedCallers.AuthorizedCallerArgs({addedCallers: authorizedCallers, removedCallers: new address[](0)}) + ); + + return ( + onRamp, + keccak256(abi.encode(Internal.EVM_2_ANY_MESSAGE_HASH, sourceChainSelector, DEST_CHAIN_SELECTOR, address(onRamp))) + ); + } + + function _enableOutboundMessageValidator() internal { + (, address msgSender,) = vm.readCallers(); + + bool resetPrank = false; + + if (msgSender != OWNER) { + vm.stopPrank(); + vm.startPrank(OWNER); + resetPrank = true; + } + + OnRamp.DynamicConfig memory dynamicConfig = s_onRamp.getDynamicConfig(); + dynamicConfig.messageValidator = address(s_outboundMessageValidator); + s_onRamp.setDynamicConfig(dynamicConfig); + + if (resetPrank) { + vm.stopPrank(); + vm.startPrank(msgSender); + } + } + + function _assertStaticConfigsEqual(OnRamp.StaticConfig memory a, OnRamp.StaticConfig memory b) internal pure { + assertEq(a.chainSelector, b.chainSelector); + assertEq(address(a.rmn), address(b.rmn)); + assertEq(a.tokenAdminRegistry, b.tokenAdminRegistry); + } + + function _assertDynamicConfigsEqual(OnRamp.DynamicConfig memory a, OnRamp.DynamicConfig memory b) internal pure { + assertEq(a.feeQuoter, b.feeQuoter); + } +} diff --git a/contracts/src/v0.8/ccip/test/pools/BurnFromMintTokenPool.t.sol b/contracts/src/v0.8/ccip/test/pools/BurnFromMintTokenPool.t.sol new file mode 100644 index 00000000000..b5967e74d1e --- /dev/null +++ b/contracts/src/v0.8/ccip/test/pools/BurnFromMintTokenPool.t.sol @@ -0,0 +1,103 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {Pool} from "../../libraries/Pool.sol"; +import {RateLimiter} from "../../libraries/RateLimiter.sol"; +import {BurnFromMintTokenPool} from "../../pools/BurnFromMintTokenPool.sol"; +import {TokenPool} from "../../pools/TokenPool.sol"; +import {BurnMintSetup} from "./BurnMintSetup.t.sol"; + +import {IERC20} from "../../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/IERC20.sol"; + +contract BurnFromMintTokenPoolSetup is BurnMintSetup { + BurnFromMintTokenPool internal s_pool; + + function setUp() public virtual override { + BurnMintSetup.setUp(); + + s_pool = new BurnFromMintTokenPool(s_burnMintERC677, new address[](0), address(s_mockRMN), address(s_sourceRouter)); + s_burnMintERC677.grantMintAndBurnRoles(address(s_pool)); + + _applyChainUpdates(address(s_pool)); + } +} + +contract BurnFromMintTokenPool_lockOrBurn is BurnFromMintTokenPoolSetup { + function test_Setup_Success() public view { + assertEq(address(s_burnMintERC677), address(s_pool.getToken())); + assertEq(address(s_mockRMN), s_pool.getRmnProxy()); + assertEq(false, s_pool.getAllowListEnabled()); + assertEq(type(uint256).max, s_burnMintERC677.allowance(address(s_pool), address(s_pool))); + assertEq("BurnFromMintTokenPool 1.5.0", s_pool.typeAndVersion()); + } + + function test_PoolBurn_Success() public { + uint256 burnAmount = 20_000e18; + + deal(address(s_burnMintERC677), address(s_pool), burnAmount); + assertEq(s_burnMintERC677.balanceOf(address(s_pool)), burnAmount); + + vm.startPrank(s_burnMintOnRamp); + + vm.expectEmit(); + emit RateLimiter.TokensConsumed(burnAmount); + + vm.expectEmit(); + emit IERC20.Transfer(address(s_pool), address(0), burnAmount); + + vm.expectEmit(); + emit TokenPool.Burned(address(s_burnMintOnRamp), burnAmount); + + bytes4 expectedSignature = bytes4(keccak256("burnFrom(address,uint256)")); + vm.expectCall(address(s_burnMintERC677), abi.encodeWithSelector(expectedSignature, address(s_pool), burnAmount)); + + s_pool.lockOrBurn( + Pool.LockOrBurnInV1({ + originalSender: OWNER, + receiver: bytes(""), + amount: burnAmount, + remoteChainSelector: DEST_CHAIN_SELECTOR, + localToken: address(s_burnMintERC677) + }) + ); + + assertEq(s_burnMintERC677.balanceOf(address(s_pool)), 0); + } + + // Should not burn tokens if cursed. + function test_PoolBurnRevertNotHealthy_Revert() public { + s_mockRMN.setGlobalCursed(true); + uint256 before = s_burnMintERC677.balanceOf(address(s_pool)); + vm.startPrank(s_burnMintOnRamp); + + vm.expectRevert(TokenPool.CursedByRMN.selector); + s_pool.lockOrBurn( + Pool.LockOrBurnInV1({ + originalSender: OWNER, + receiver: bytes(""), + amount: 1e5, + remoteChainSelector: DEST_CHAIN_SELECTOR, + localToken: address(s_burnMintERC677) + }) + ); + + assertEq(s_burnMintERC677.balanceOf(address(s_pool)), before); + } + + function test_ChainNotAllowed_Revert() public { + uint64 wrongChainSelector = 8838833; + vm.expectRevert(abi.encodeWithSelector(TokenPool.ChainNotAllowed.selector, wrongChainSelector)); + s_pool.releaseOrMint( + Pool.ReleaseOrMintInV1({ + originalSender: bytes(""), + receiver: OWNER, + amount: 1, + localToken: address(s_burnMintERC677), + remoteChainSelector: wrongChainSelector, + sourcePoolAddress: _generateSourceTokenData().sourcePoolAddress, + sourcePoolData: _generateSourceTokenData().extraData, + offchainTokenData: "" + }) + ); + } +} diff --git a/contracts/src/v0.8/ccip/test/pools/BurnMintSetup.t.sol b/contracts/src/v0.8/ccip/test/pools/BurnMintSetup.t.sol new file mode 100644 index 00000000000..220f6ca1125 --- /dev/null +++ b/contracts/src/v0.8/ccip/test/pools/BurnMintSetup.t.sol @@ -0,0 +1,43 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {BurnMintERC677} from "../../../shared/token/ERC677/BurnMintERC677.sol"; +import {Router} from "../../Router.sol"; +import {BurnMintTokenPool} from "../../pools/BurnMintTokenPool.sol"; +import {TokenPool} from "../../pools/TokenPool.sol"; +import {RouterSetup} from "../router/RouterSetup.t.sol"; + +contract BurnMintSetup is RouterSetup { + BurnMintERC677 internal s_burnMintERC677; + address internal s_burnMintOffRamp = makeAddr("burn_mint_offRamp"); + address internal s_burnMintOnRamp = makeAddr("burn_mint_onRamp"); + + address internal s_remoteBurnMintPool = makeAddr("remote_burn_mint_pool"); + address internal s_remoteToken = makeAddr("remote_token"); + + function setUp() public virtual override { + RouterSetup.setUp(); + + s_burnMintERC677 = new BurnMintERC677("Chainlink Token", "LINK", 18, 0); + } + + function _applyChainUpdates(address pool) internal { + TokenPool.ChainUpdate[] memory chains = new TokenPool.ChainUpdate[](1); + chains[0] = TokenPool.ChainUpdate({ + remoteChainSelector: DEST_CHAIN_SELECTOR, + remotePoolAddress: abi.encode(s_remoteBurnMintPool), + remoteTokenAddress: abi.encode(s_remoteToken), + allowed: true, + outboundRateLimiterConfig: _getOutboundRateLimiterConfig(), + inboundRateLimiterConfig: _getInboundRateLimiterConfig() + }); + + BurnMintTokenPool(pool).applyChainUpdates(chains); + + Router.OnRamp[] memory onRampUpdates = new Router.OnRamp[](1); + onRampUpdates[0] = Router.OnRamp({destChainSelector: DEST_CHAIN_SELECTOR, onRamp: s_burnMintOnRamp}); + Router.OffRamp[] memory offRampUpdates = new Router.OffRamp[](1); + offRampUpdates[0] = Router.OffRamp({sourceChainSelector: DEST_CHAIN_SELECTOR, offRamp: s_burnMintOffRamp}); + s_sourceRouter.applyRampUpdates(onRampUpdates, new Router.OffRamp[](0), offRampUpdates); + } +} diff --git a/contracts/src/v0.8/ccip/test/pools/BurnMintTokenPool.t.sol b/contracts/src/v0.8/ccip/test/pools/BurnMintTokenPool.t.sol new file mode 100644 index 00000000000..8a6d047380c --- /dev/null +++ b/contracts/src/v0.8/ccip/test/pools/BurnMintTokenPool.t.sol @@ -0,0 +1,168 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {Pool} from "../../libraries/Pool.sol"; +import {RateLimiter} from "../../libraries/RateLimiter.sol"; +import {BurnMintTokenPool} from "../../pools/BurnMintTokenPool.sol"; +import {TokenPool} from "../../pools/TokenPool.sol"; +import {BurnMintSetup} from "./BurnMintSetup.t.sol"; + +import {IERC20} from "../../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/IERC20.sol"; + +contract BurnMintTokenPoolSetup is BurnMintSetup { + BurnMintTokenPool internal s_pool; + + function setUp() public virtual override { + BurnMintSetup.setUp(); + + s_pool = new BurnMintTokenPool(s_burnMintERC677, new address[](0), address(s_mockRMN), address(s_sourceRouter)); + s_burnMintERC677.grantMintAndBurnRoles(address(s_pool)); + + _applyChainUpdates(address(s_pool)); + } +} + +contract BurnMintTokenPool_lockOrBurn is BurnMintTokenPoolSetup { + function test_Setup_Success() public view { + assertEq(address(s_burnMintERC677), address(s_pool.getToken())); + assertEq(address(s_mockRMN), s_pool.getRmnProxy()); + assertEq(false, s_pool.getAllowListEnabled()); + assertEq("BurnMintTokenPool 1.5.0", s_pool.typeAndVersion()); + } + + function test_PoolBurn_Success() public { + uint256 burnAmount = 20_000e18; + + deal(address(s_burnMintERC677), address(s_pool), burnAmount); + assertEq(s_burnMintERC677.balanceOf(address(s_pool)), burnAmount); + + vm.startPrank(s_burnMintOnRamp); + + vm.expectEmit(); + emit RateLimiter.TokensConsumed(burnAmount); + + vm.expectEmit(); + emit IERC20.Transfer(address(s_pool), address(0), burnAmount); + + vm.expectEmit(); + emit TokenPool.Burned(address(s_burnMintOnRamp), burnAmount); + + bytes4 expectedSignature = bytes4(keccak256("burn(uint256)")); + vm.expectCall(address(s_burnMintERC677), abi.encodeWithSelector(expectedSignature, burnAmount)); + + s_pool.lockOrBurn( + Pool.LockOrBurnInV1({ + originalSender: OWNER, + receiver: bytes(""), + amount: burnAmount, + remoteChainSelector: DEST_CHAIN_SELECTOR, + localToken: address(s_burnMintERC677) + }) + ); + + assertEq(s_burnMintERC677.balanceOf(address(s_pool)), 0); + } + + // Should not burn tokens if cursed. + function test_PoolBurnRevertNotHealthy_Revert() public { + s_mockRMN.setGlobalCursed(true); + uint256 before = s_burnMintERC677.balanceOf(address(s_pool)); + vm.startPrank(s_burnMintOnRamp); + + vm.expectRevert(TokenPool.CursedByRMN.selector); + s_pool.lockOrBurn( + Pool.LockOrBurnInV1({ + originalSender: OWNER, + receiver: bytes(""), + amount: 1e5, + remoteChainSelector: DEST_CHAIN_SELECTOR, + localToken: address(s_burnMintERC677) + }) + ); + + assertEq(s_burnMintERC677.balanceOf(address(s_pool)), before); + } + + function test_ChainNotAllowed_Revert() public { + uint64 wrongChainSelector = 8838833; + + vm.expectRevert(abi.encodeWithSelector(TokenPool.ChainNotAllowed.selector, wrongChainSelector)); + s_pool.lockOrBurn( + Pool.LockOrBurnInV1({ + originalSender: OWNER, + receiver: bytes(""), + amount: 1, + remoteChainSelector: wrongChainSelector, + localToken: address(s_burnMintERC677) + }) + ); + } +} + +contract BurnMintTokenPool_releaseOrMint is BurnMintTokenPoolSetup { + function test_PoolMint_Success() public { + uint256 amount = 1e19; + address receiver = makeAddr("receiver_address"); + + vm.startPrank(s_burnMintOffRamp); + + vm.expectEmit(); + emit IERC20.Transfer(address(0), receiver, amount); + + s_pool.releaseOrMint( + Pool.ReleaseOrMintInV1({ + originalSender: bytes(""), + receiver: receiver, + amount: amount, + localToken: address(s_burnMintERC677), + remoteChainSelector: DEST_CHAIN_SELECTOR, + sourcePoolAddress: abi.encode(s_remoteBurnMintPool), + sourcePoolData: "", + offchainTokenData: "" + }) + ); + + assertEq(s_burnMintERC677.balanceOf(receiver), amount); + } + + function test_PoolMintNotHealthy_Revert() public { + // Should not mint tokens if cursed. + s_mockRMN.setGlobalCursed(true); + uint256 before = s_burnMintERC677.balanceOf(OWNER); + vm.startPrank(s_burnMintOffRamp); + + vm.expectRevert(TokenPool.CursedByRMN.selector); + s_pool.releaseOrMint( + Pool.ReleaseOrMintInV1({ + originalSender: bytes(""), + receiver: OWNER, + amount: 1e5, + localToken: address(s_burnMintERC677), + remoteChainSelector: DEST_CHAIN_SELECTOR, + sourcePoolAddress: _generateSourceTokenData().sourcePoolAddress, + sourcePoolData: _generateSourceTokenData().extraData, + offchainTokenData: "" + }) + ); + + assertEq(s_burnMintERC677.balanceOf(OWNER), before); + } + + function test_ChainNotAllowed_Revert() public { + uint64 wrongChainSelector = 8838833; + + vm.expectRevert(abi.encodeWithSelector(TokenPool.ChainNotAllowed.selector, wrongChainSelector)); + s_pool.releaseOrMint( + Pool.ReleaseOrMintInV1({ + originalSender: bytes(""), + receiver: OWNER, + amount: 1, + localToken: address(s_burnMintERC677), + remoteChainSelector: wrongChainSelector, + sourcePoolAddress: _generateSourceTokenData().sourcePoolAddress, + sourcePoolData: _generateSourceTokenData().extraData, + offchainTokenData: "" + }) + ); + } +} diff --git a/contracts/src/v0.8/ccip/test/pools/BurnWithFromMintTokenPool.t.sol b/contracts/src/v0.8/ccip/test/pools/BurnWithFromMintTokenPool.t.sol new file mode 100644 index 00000000000..92e871708da --- /dev/null +++ b/contracts/src/v0.8/ccip/test/pools/BurnWithFromMintTokenPool.t.sol @@ -0,0 +1,104 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {Pool} from "../../libraries/Pool.sol"; +import {RateLimiter} from "../../libraries/RateLimiter.sol"; +import {BurnWithFromMintTokenPool} from "../../pools/BurnWithFromMintTokenPool.sol"; +import {TokenPool} from "../../pools/TokenPool.sol"; +import {BurnMintSetup} from "./BurnMintSetup.t.sol"; + +import {IERC20} from "../../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/IERC20.sol"; + +contract BurnWithFromMintTokenPoolSetup is BurnMintSetup { + BurnWithFromMintTokenPool internal s_pool; + + function setUp() public virtual override { + BurnMintSetup.setUp(); + + s_pool = + new BurnWithFromMintTokenPool(s_burnMintERC677, new address[](0), address(s_mockRMN), address(s_sourceRouter)); + s_burnMintERC677.grantMintAndBurnRoles(address(s_pool)); + + _applyChainUpdates(address(s_pool)); + } +} + +contract BurnWithFromMintTokenPool_lockOrBurn is BurnWithFromMintTokenPoolSetup { + function test_Setup_Success() public view { + assertEq(address(s_burnMintERC677), address(s_pool.getToken())); + assertEq(address(s_mockRMN), s_pool.getRmnProxy()); + assertEq(false, s_pool.getAllowListEnabled()); + assertEq(type(uint256).max, s_burnMintERC677.allowance(address(s_pool), address(s_pool))); + assertEq("BurnWithFromMintTokenPool 1.5.0", s_pool.typeAndVersion()); + } + + function test_PoolBurn_Success() public { + uint256 burnAmount = 20_000e18; + + deal(address(s_burnMintERC677), address(s_pool), burnAmount); + assertEq(s_burnMintERC677.balanceOf(address(s_pool)), burnAmount); + + vm.startPrank(s_burnMintOnRamp); + + vm.expectEmit(); + emit RateLimiter.TokensConsumed(burnAmount); + + vm.expectEmit(); + emit IERC20.Transfer(address(s_pool), address(0), burnAmount); + + vm.expectEmit(); + emit TokenPool.Burned(address(s_burnMintOnRamp), burnAmount); + + bytes4 expectedSignature = bytes4(keccak256("burn(address,uint256)")); + vm.expectCall(address(s_burnMintERC677), abi.encodeWithSelector(expectedSignature, address(s_pool), burnAmount)); + + s_pool.lockOrBurn( + Pool.LockOrBurnInV1({ + originalSender: OWNER, + receiver: bytes(""), + amount: burnAmount, + remoteChainSelector: DEST_CHAIN_SELECTOR, + localToken: address(s_burnMintERC677) + }) + ); + + assertEq(s_burnMintERC677.balanceOf(address(s_pool)), 0); + } + + // Should not burn tokens if cursed. + function test_PoolBurnRevertNotHealthy_Revert() public { + s_mockRMN.setGlobalCursed(true); + uint256 before = s_burnMintERC677.balanceOf(address(s_pool)); + vm.startPrank(s_burnMintOnRamp); + + vm.expectRevert(TokenPool.CursedByRMN.selector); + s_pool.lockOrBurn( + Pool.LockOrBurnInV1({ + originalSender: OWNER, + receiver: bytes(""), + amount: 1e5, + remoteChainSelector: DEST_CHAIN_SELECTOR, + localToken: address(s_burnMintERC677) + }) + ); + + assertEq(s_burnMintERC677.balanceOf(address(s_pool)), before); + } + + function test_ChainNotAllowed_Revert() public { + uint64 wrongChainSelector = 8838833; + vm.expectRevert(abi.encodeWithSelector(TokenPool.ChainNotAllowed.selector, wrongChainSelector)); + s_pool.releaseOrMint( + Pool.ReleaseOrMintInV1({ + originalSender: bytes(""), + receiver: OWNER, + amount: 1, + localToken: address(s_burnMintERC677), + remoteChainSelector: wrongChainSelector, + sourcePoolAddress: _generateSourceTokenData().sourcePoolAddress, + sourcePoolData: _generateSourceTokenData().extraData, + offchainTokenData: "" + }) + ); + } +} diff --git a/contracts/src/v0.8/ccip/test/pools/HybridLockReleaseUSDCTokenPool.t.sol b/contracts/src/v0.8/ccip/test/pools/HybridLockReleaseUSDCTokenPool.t.sol new file mode 100644 index 00000000000..96216c6fcc4 --- /dev/null +++ b/contracts/src/v0.8/ccip/test/pools/HybridLockReleaseUSDCTokenPool.t.sol @@ -0,0 +1,661 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {ILiquidityContainer} from "../../../liquiditymanager/interfaces/ILiquidityContainer.sol"; +import {IBurnMintERC20} from "../../../shared/token/ERC20/IBurnMintERC20.sol"; +import {IPoolV1} from "../../interfaces/IPool.sol"; +import {ITokenMessenger} from "../../pools/USDC/ITokenMessenger.sol"; + +import {BurnMintERC677} from "../../../shared/token/ERC677/BurnMintERC677.sol"; +import {Router} from "../../Router.sol"; +import {Internal} from "../../libraries/Internal.sol"; +import {Pool} from "../../libraries/Pool.sol"; +import {RateLimiter} from "../../libraries/RateLimiter.sol"; + +import {TokenPool} from "../../pools/TokenPool.sol"; +import {HybridLockReleaseUSDCTokenPool} from "../../pools/USDC/HybridLockReleaseUSDCTokenPool.sol"; +import {USDCBridgeMigrator} from "../../pools/USDC/USDCBridgeMigrator.sol"; +import {USDCTokenPool} from "../../pools/USDC/USDCTokenPool.sol"; +import {BaseTest} from "../BaseTest.t.sol"; +import {USDCTokenPoolHelper} from "../helpers/USDCTokenPoolHelper.sol"; +import {MockE2EUSDCTransmitter} from "../mocks/MockE2EUSDCTransmitter.sol"; +import {MockUSDCTokenMessenger} from "../mocks/MockUSDCTokenMessenger.sol"; + +import {IERC165} from "../../../vendor/openzeppelin-solidity/v4.8.3/contracts/utils/introspection/IERC165.sol"; + +contract USDCTokenPoolSetup is BaseTest { + IBurnMintERC20 internal s_token; + MockUSDCTokenMessenger internal s_mockUSDC; + MockE2EUSDCTransmitter internal s_mockUSDCTransmitter; + uint32 internal constant USDC_DEST_TOKEN_GAS = 150_000; + + struct USDCMessage { + uint32 version; + uint32 sourceDomain; + uint32 destinationDomain; + uint64 nonce; + bytes32 sender; + bytes32 recipient; + bytes32 destinationCaller; + bytes messageBody; + } + + uint32 internal constant SOURCE_DOMAIN_IDENTIFIER = 0x02020202; + uint32 internal constant DEST_DOMAIN_IDENTIFIER = 0; + + bytes32 internal constant SOURCE_CHAIN_TOKEN_SENDER = bytes32(uint256(uint160(0x01111111221))); + address internal constant SOURCE_CHAIN_USDC_POOL = address(0x23789765456789); + address internal constant DEST_CHAIN_USDC_POOL = address(0x987384873458734); + address internal constant DEST_CHAIN_USDC_TOKEN = address(0x23598918358198766); + + address internal s_routerAllowedOnRamp = address(3456); + address internal s_routerAllowedOffRamp = address(234); + Router internal s_router; + + HybridLockReleaseUSDCTokenPool internal s_usdcTokenPool; + HybridLockReleaseUSDCTokenPool internal s_usdcTokenPoolTransferLiquidity; + address[] internal s_allowedList; + + function setUp() public virtual override { + BaseTest.setUp(); + BurnMintERC677 usdcToken = new BurnMintERC677("LINK", "LNK", 18, 0); + s_token = usdcToken; + deal(address(s_token), OWNER, type(uint256).max); + setUpRamps(); + + s_mockUSDCTransmitter = new MockE2EUSDCTransmitter(0, DEST_DOMAIN_IDENTIFIER, address(s_token)); + s_mockUSDC = new MockUSDCTokenMessenger(0, address(s_mockUSDCTransmitter)); + + usdcToken.grantMintAndBurnRoles(address(s_mockUSDCTransmitter)); + + s_usdcTokenPool = + new HybridLockReleaseUSDCTokenPool(s_mockUSDC, s_token, new address[](0), address(s_mockRMN), address(s_router)); + + s_usdcTokenPoolTransferLiquidity = + new HybridLockReleaseUSDCTokenPool(s_mockUSDC, s_token, new address[](0), address(s_mockRMN), address(s_router)); + + usdcToken.grantMintAndBurnRoles(address(s_mockUSDC)); + usdcToken.grantMintAndBurnRoles(address(s_usdcTokenPool)); + + TokenPool.ChainUpdate[] memory chainUpdates = new TokenPool.ChainUpdate[](2); + chainUpdates[0] = TokenPool.ChainUpdate({ + remoteChainSelector: SOURCE_CHAIN_SELECTOR, + remotePoolAddress: abi.encode(SOURCE_CHAIN_USDC_POOL), + remoteTokenAddress: abi.encode(address(s_token)), + allowed: true, + outboundRateLimiterConfig: _getOutboundRateLimiterConfig(), + inboundRateLimiterConfig: _getInboundRateLimiterConfig() + }); + chainUpdates[1] = TokenPool.ChainUpdate({ + remoteChainSelector: DEST_CHAIN_SELECTOR, + remotePoolAddress: abi.encode(DEST_CHAIN_USDC_POOL), + remoteTokenAddress: abi.encode(DEST_CHAIN_USDC_TOKEN), + allowed: true, + outboundRateLimiterConfig: _getOutboundRateLimiterConfig(), + inboundRateLimiterConfig: _getInboundRateLimiterConfig() + }); + + s_usdcTokenPool.applyChainUpdates(chainUpdates); + + USDCTokenPool.DomainUpdate[] memory domains = new USDCTokenPool.DomainUpdate[](1); + domains[0] = USDCTokenPool.DomainUpdate({ + destChainSelector: DEST_CHAIN_SELECTOR, + domainIdentifier: 9999, + allowedCaller: keccak256("allowedCaller"), + enabled: true + }); + + s_usdcTokenPool.setDomains(domains); + + vm.expectEmit(); + emit HybridLockReleaseUSDCTokenPool.LiquidityProviderSet(address(0), OWNER, DEST_CHAIN_SELECTOR); + + s_usdcTokenPool.setLiquidityProvider(DEST_CHAIN_SELECTOR, OWNER); + } + + function setUpRamps() internal { + s_router = new Router(address(s_token), address(s_mockRMN)); + + Router.OnRamp[] memory onRampUpdates = new Router.OnRamp[](1); + onRampUpdates[0] = Router.OnRamp({destChainSelector: DEST_CHAIN_SELECTOR, onRamp: s_routerAllowedOnRamp}); + Router.OffRamp[] memory offRampUpdates = new Router.OffRamp[](1); + address[] memory offRamps = new address[](1); + offRamps[0] = s_routerAllowedOffRamp; + offRampUpdates[0] = Router.OffRamp({sourceChainSelector: SOURCE_CHAIN_SELECTOR, offRamp: offRamps[0]}); + + s_router.applyRampUpdates(onRampUpdates, new Router.OffRamp[](0), offRampUpdates); + } + + function _generateUSDCMessage(USDCMessage memory usdcMessage) internal pure returns (bytes memory) { + return abi.encodePacked( + usdcMessage.version, + usdcMessage.sourceDomain, + usdcMessage.destinationDomain, + usdcMessage.nonce, + usdcMessage.sender, + usdcMessage.recipient, + usdcMessage.destinationCaller, + usdcMessage.messageBody + ); + } +} + +contract HybridUSDCTokenPoolTests is USDCTokenPoolSetup { + function test_LockOrBurn_onLockReleaseMechanism_Success() public { + bytes32 receiver = bytes32(uint256(uint160(STRANGER))); + + // Mark the destination chain as supporting CCTP, so use L/R instead. + uint64[] memory destChainAdds = new uint64[](1); + destChainAdds[0] = DEST_CHAIN_SELECTOR; + + s_usdcTokenPool.updateChainSelectorMechanisms(new uint64[](0), destChainAdds); + + assertTrue( + s_usdcTokenPool.shouldUseLockRelease(DEST_CHAIN_SELECTOR), + "Lock/Release mech not configured for outgoing message to DEST_CHAIN_SELECTOR" + ); + + uint256 amount = 1e6; + + s_token.transfer(address(s_usdcTokenPool), amount); + + vm.startPrank(s_routerAllowedOnRamp); + + vm.expectEmit(); + emit TokenPool.Locked(s_routerAllowedOnRamp, amount); + + s_usdcTokenPool.lockOrBurn( + Pool.LockOrBurnInV1({ + originalSender: OWNER, + receiver: abi.encodePacked(receiver), + amount: amount, + remoteChainSelector: DEST_CHAIN_SELECTOR, + localToken: address(s_token) + }) + ); + + assertEq(s_token.balanceOf(address(s_usdcTokenPool)), amount, "Incorrect token amount in the tokenPool"); + } + + function test_MintOrRelease_OnLockReleaseMechanism_Success() public { + address recipient = address(1234); + + // Designate the SOURCE_CHAIN as not using native-USDC, and so the L/R mechanism must be used instead + uint64[] memory destChainAdds = new uint64[](1); + destChainAdds[0] = SOURCE_CHAIN_SELECTOR; + + s_usdcTokenPool.updateChainSelectorMechanisms(new uint64[](0), destChainAdds); + + assertTrue( + s_usdcTokenPool.shouldUseLockRelease(SOURCE_CHAIN_SELECTOR), + "Lock/Release mech not configured for incoming message from SOURCE_CHAIN_SELECTOR" + ); + + vm.startPrank(OWNER); + s_usdcTokenPool.setLiquidityProvider(SOURCE_CHAIN_SELECTOR, OWNER); + + // Add 1e12 liquidity so that there's enough to release + vm.startPrank(s_usdcTokenPool.getLiquidityProvider(SOURCE_CHAIN_SELECTOR)); + + s_token.approve(address(s_usdcTokenPool), type(uint256).max); + + uint256 liquidityAmount = 1e12; + s_usdcTokenPool.provideLiquidity(SOURCE_CHAIN_SELECTOR, liquidityAmount); + + Internal.SourceTokenData memory sourceTokenData = Internal.SourceTokenData({ + sourcePoolAddress: abi.encode(SOURCE_CHAIN_USDC_POOL), + destTokenAddress: abi.encode(address(s_usdcTokenPool)), + extraData: abi.encode(USDCTokenPool.SourceTokenDataPayload({nonce: 1, sourceDomain: SOURCE_DOMAIN_IDENTIFIER})), + destGasAmount: USDC_DEST_TOKEN_GAS + }); + + uint256 amount = 1e6; + + vm.startPrank(s_routerAllowedOffRamp); + + vm.expectEmit(); + emit TokenPool.Released(s_routerAllowedOffRamp, recipient, amount); + + Pool.ReleaseOrMintOutV1 memory poolReturnDataV1 = s_usdcTokenPool.releaseOrMint( + Pool.ReleaseOrMintInV1({ + originalSender: abi.encode(OWNER), + receiver: recipient, + amount: amount, + localToken: address(s_token), + remoteChainSelector: SOURCE_CHAIN_SELECTOR, + sourcePoolAddress: sourceTokenData.sourcePoolAddress, + sourcePoolData: "", + offchainTokenData: "" + }) + ); + + assertEq(poolReturnDataV1.destinationAmount, amount, "destinationAmount and actual amount transferred differ"); + + // Simulate the off-ramp forwarding tokens to the recipient on destination chain + // s_token.transfer(recipient, amount); + + assertEq( + s_token.balanceOf(address(s_usdcTokenPool)), + liquidityAmount - amount, + "Incorrect remaining liquidity in TokenPool" + ); + assertEq(s_token.balanceOf(recipient), amount, "Tokens not transferred to recipient"); + } + + function test_LockOrBurn_PrimaryMechanism_Success() public { + bytes32 receiver = bytes32(uint256(uint160(STRANGER))); + uint256 amount = 1; + + vm.startPrank(OWNER); + + s_token.transfer(address(s_usdcTokenPool), amount); + + vm.startPrank(s_routerAllowedOnRamp); + + USDCTokenPool.Domain memory expectedDomain = s_usdcTokenPool.getDomain(DEST_CHAIN_SELECTOR); + + vm.expectEmit(); + emit RateLimiter.TokensConsumed(amount); + + vm.expectEmit(); + emit ITokenMessenger.DepositForBurn( + s_mockUSDC.s_nonce(), + address(s_token), + amount, + address(s_usdcTokenPool), + receiver, + expectedDomain.domainIdentifier, + s_mockUSDC.DESTINATION_TOKEN_MESSENGER(), + expectedDomain.allowedCaller + ); + + vm.expectEmit(); + emit TokenPool.Burned(s_routerAllowedOnRamp, amount); + + Pool.LockOrBurnOutV1 memory poolReturnDataV1 = s_usdcTokenPool.lockOrBurn( + Pool.LockOrBurnInV1({ + originalSender: OWNER, + receiver: abi.encodePacked(receiver), + amount: amount, + remoteChainSelector: DEST_CHAIN_SELECTOR, + localToken: address(s_token) + }) + ); + + uint64 nonce = abi.decode(poolReturnDataV1.destPoolData, (uint64)); + assertEq(s_mockUSDC.s_nonce() - 1, nonce); + } + + // https://etherscan.io/tx/0xac9f501fe0b76df1f07a22e1db30929fd12524bc7068d74012dff948632f0883 + function test_MintOrRelease_incomingMessageWithPrimaryMechanism() public { + bytes memory encodedUsdcMessage = + hex"000000000000000300000000000000000000127a00000000000000000000000019330d10d9cc8751218eaf51e8885d058642e08a000000000000000000000000bd3fa81b58ba92a82136038b25adec7066af3155000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000af88d065e77c8cc2239327c5edb3a432268e58310000000000000000000000004af08f56978be7dce2d1be3c65c005b41e79401c000000000000000000000000000000000000000000000000000000002057ff7a0000000000000000000000003a23f943181408eac424116af7b7790c94cb97a50000000000000000000000000000000000000000000000000000000000000000000000000000008274119237535fd659626b090f87e365ff89ebc7096bb32e8b0e85f155626b73ae7c4bb2485c184b7cc3cf7909045487890b104efb62ae74a73e32901bdcec91df1bb9ee08ccb014fcbcfe77b74d1263fd4e0b0e8de05d6c9a5913554364abfd5ea768b222f50c715908183905d74044bb2b97527c7e70ae7983c443a603557cac3b1c000000000000000000000000000000000000000000000000000000000000"; + bytes memory attestation = bytes("attestation bytes"); + + uint32 nonce = 4730; + uint32 sourceDomain = 3; + uint256 amount = 100; + + Internal.SourceTokenData memory sourceTokenData = Internal.SourceTokenData({ + sourcePoolAddress: abi.encode(SOURCE_CHAIN_USDC_POOL), + destTokenAddress: abi.encode(address(s_usdcTokenPool)), + extraData: abi.encode(USDCTokenPool.SourceTokenDataPayload({nonce: nonce, sourceDomain: sourceDomain})), + destGasAmount: USDC_DEST_TOKEN_GAS + }); + + // The mocked receiver does not release the token to the pool, so we manually do it here + deal(address(s_token), address(s_usdcTokenPool), amount); + + bytes memory offchainTokenData = + abi.encode(USDCTokenPool.MessageAndAttestation({message: encodedUsdcMessage, attestation: attestation})); + + vm.expectCall( + address(s_mockUSDCTransmitter), + abi.encodeWithSelector(MockE2EUSDCTransmitter.receiveMessage.selector, encodedUsdcMessage, attestation) + ); + + vm.startPrank(s_routerAllowedOffRamp); + s_usdcTokenPool.releaseOrMint( + Pool.ReleaseOrMintInV1({ + originalSender: abi.encode(OWNER), + receiver: OWNER, + amount: amount, + localToken: address(s_token), + remoteChainSelector: SOURCE_CHAIN_SELECTOR, + sourcePoolAddress: sourceTokenData.sourcePoolAddress, + sourcePoolData: sourceTokenData.extraData, + offchainTokenData: offchainTokenData + }) + ); + } + + function test_LockOrBurn_LocKReleaseMechanism_then_switchToPrimary_Success() public { + // Test Enabling the LR mechanism and sending an outgoing message + test_LockOrBurn_PrimaryMechanism_Success(); + + // Disable the LR mechanism so that primary CCTP is used and then attempt to send a message + uint64[] memory destChainRemoves = new uint64[](1); + destChainRemoves[0] = DEST_CHAIN_SELECTOR; + + vm.startPrank(OWNER); + + vm.expectEmit(); + emit HybridLockReleaseUSDCTokenPool.LockReleaseDisabled(DEST_CHAIN_SELECTOR); + + s_usdcTokenPool.updateChainSelectorMechanisms(destChainRemoves, new uint64[](0)); + + // Send an outgoing message + test_LockOrBurn_PrimaryMechanism_Success(); + } + + function test_MintOrRelease_OnLockReleaseMechanism_then_switchToPrimary_Success() public { + test_MintOrRelease_OnLockReleaseMechanism_Success(); + + // Disable the LR mechanism so that primary CCTP is used and then attempt to send a message + uint64[] memory destChainRemoves = new uint64[](1); + destChainRemoves[0] = SOURCE_CHAIN_SELECTOR; + + vm.startPrank(OWNER); + + vm.expectEmit(); + emit HybridLockReleaseUSDCTokenPool.LockReleaseDisabled(SOURCE_CHAIN_SELECTOR); + + s_usdcTokenPool.updateChainSelectorMechanisms(destChainRemoves, new uint64[](0)); + + vm.expectEmit(); + emit HybridLockReleaseUSDCTokenPool.LiquidityProviderSet(OWNER, OWNER, SOURCE_CHAIN_SELECTOR); + + s_usdcTokenPool.setLiquidityProvider(SOURCE_CHAIN_SELECTOR, OWNER); + + // Test incoming on the primary mechanism after disable LR, simulating Circle's new support for CCTP on + // DEST_CHAIN_SELECTOR + test_MintOrRelease_incomingMessageWithPrimaryMechanism(); + } + + function test_withdrawLiquidity_Success() public { + uint256 liquidityAmount = 1e12; + + vm.startPrank(OWNER); + s_token.approve(address(s_usdcTokenPool), type(uint256).max); + + s_usdcTokenPool.setLiquidityProvider(SOURCE_CHAIN_SELECTOR, OWNER); + assertEq(s_usdcTokenPool.getLiquidityProvider(SOURCE_CHAIN_SELECTOR), OWNER, "Owner is not Rebalancer"); + + s_usdcTokenPool.provideLiquidity(SOURCE_CHAIN_SELECTOR, liquidityAmount); + + assertEq(s_usdcTokenPool.getLockedTokensForChain(SOURCE_CHAIN_SELECTOR), liquidityAmount); + + assertEq( + s_token.balanceOf(address(s_usdcTokenPool)), + liquidityAmount, + "Available tokens doesn't match provided liquidity amount" + ); + + uint256 withdrawalAmount = liquidityAmount / 2; // Withdraw half of the liquidity + + vm.expectEmit(); + emit ILiquidityContainer.LiquidityRemoved(OWNER, withdrawalAmount); + + s_usdcTokenPool.withdrawLiquidity(SOURCE_CHAIN_SELECTOR, withdrawalAmount); + + assertEq( + s_usdcTokenPool.getLockedTokensForChain(SOURCE_CHAIN_SELECTOR), + liquidityAmount - withdrawalAmount, + "Remaining liquidity incorrect" + ); + assertEq( + s_token.balanceOf(address(s_usdcTokenPool)), + liquidityAmount - withdrawalAmount, + "Available tokens doesn't match provided liquidity amount" + ); + } + + function test_LockOrBurn_WhileMigrationPause_Revert() public { + // Create a fake migration proposal + s_usdcTokenPool.proposeCCTPMigration(DEST_CHAIN_SELECTOR); + + assertEq(s_usdcTokenPool.getCurrentProposedCCTPChainMigration(), DEST_CHAIN_SELECTOR); + + bytes32 receiver = bytes32(uint256(uint160(STRANGER))); + + // Mark the destination chain as supporting CCTP, so use L/R instead. + uint64[] memory destChainAdds = new uint64[](1); + destChainAdds[0] = DEST_CHAIN_SELECTOR; + + s_usdcTokenPool.updateChainSelectorMechanisms(new uint64[](0), destChainAdds); + + assertTrue( + s_usdcTokenPool.shouldUseLockRelease(DEST_CHAIN_SELECTOR), + "Lock Release mech not configured for outgoing message to DEST_CHAIN_SELECTOR" + ); + + uint256 amount = 1e6; + + s_token.transfer(address(s_usdcTokenPool), amount); + + vm.startPrank(s_routerAllowedOnRamp); + + // Expect the lockOrBurn to fail because a pending CCTP-Migration has paused outgoing messages on CCIP + vm.expectRevert( + abi.encodeWithSelector(HybridLockReleaseUSDCTokenPool.LanePausedForCCTPMigration.selector, DEST_CHAIN_SELECTOR) + ); + + s_usdcTokenPool.lockOrBurn( + Pool.LockOrBurnInV1({ + originalSender: OWNER, + receiver: abi.encodePacked(receiver), + amount: amount, + remoteChainSelector: DEST_CHAIN_SELECTOR, + localToken: address(s_token) + }) + ); + } +} + +contract HybridUSDCTokenPoolMigrationTests is HybridUSDCTokenPoolTests { + function test_lockOrBurn_then_BurnInCCTPMigration_Success() public { + bytes32 receiver = bytes32(uint256(uint160(STRANGER))); + address CIRCLE = makeAddr("CIRCLE CCTP Migrator"); + + // Mark the destination chain as supporting CCTP, so use L/R instead. + uint64[] memory destChainAdds = new uint64[](1); + destChainAdds[0] = DEST_CHAIN_SELECTOR; + + s_usdcTokenPool.updateChainSelectorMechanisms(new uint64[](0), destChainAdds); + + assertTrue( + s_usdcTokenPool.shouldUseLockRelease(DEST_CHAIN_SELECTOR), + "Lock/Release mech not configured for outgoing message to DEST_CHAIN_SELECTOR" + ); + + uint256 amount = 1e6; + + s_token.transfer(address(s_usdcTokenPool), amount); + + vm.startPrank(s_routerAllowedOnRamp); + + vm.expectEmit(); + emit TokenPool.Locked(s_routerAllowedOnRamp, amount); + + s_usdcTokenPool.lockOrBurn( + Pool.LockOrBurnInV1({ + originalSender: OWNER, + receiver: abi.encodePacked(receiver), + amount: amount, + remoteChainSelector: DEST_CHAIN_SELECTOR, + localToken: address(s_token) + }) + ); + + // Ensure that the tokens are properly locked + assertEq(s_token.balanceOf(address(s_usdcTokenPool)), amount, "Incorrect token amount in the tokenPool"); + + assertEq( + s_usdcTokenPool.getLockedTokensForChain(DEST_CHAIN_SELECTOR), + amount, + "Internal locked token accounting is incorrect" + ); + + vm.startPrank(OWNER); + + vm.expectEmit(); + emit USDCBridgeMigrator.CircleMigratorAddressSet(CIRCLE); + + s_usdcTokenPool.setCircleMigratorAddress(CIRCLE); + + vm.expectEmit(); + emit USDCBridgeMigrator.CCTPMigrationProposed(DEST_CHAIN_SELECTOR); + + // Propose the migration to CCTP + s_usdcTokenPool.proposeCCTPMigration(DEST_CHAIN_SELECTOR); + + assertEq( + s_usdcTokenPool.getCurrentProposedCCTPChainMigration(), + DEST_CHAIN_SELECTOR, + "Current proposed chain migration does not match expected for DEST_CHAIN_SELECTOR" + ); + + // Impersonate the set circle address and execute the proposal + vm.startPrank(CIRCLE); + + vm.expectEmit(); + emit USDCBridgeMigrator.CCTPMigrationExecuted(DEST_CHAIN_SELECTOR, amount); + + // Ensure the call to the burn function is properly + vm.expectCall(address(s_token), abi.encodeWithSelector(bytes4(keccak256("burn(uint256)")), amount)); + + s_usdcTokenPool.burnLockedUSDC(); + + // Assert that the tokens were actually burned + assertEq(s_token.balanceOf(address(s_usdcTokenPool)), 0, "Tokens were not burned out of the tokenPool"); + + // Ensure the proposal slot was cleared and there's no tokens locked for the destination chain anymore + assertEq(s_usdcTokenPool.getCurrentProposedCCTPChainMigration(), 0, "Proposal Slot should be empty"); + assertEq( + s_usdcTokenPool.getLockedTokensForChain(DEST_CHAIN_SELECTOR), + 0, + "No tokens should be locked for DEST_CHAIN_SELECTOR after CCTP-approved burn" + ); + + assertFalse( + s_usdcTokenPool.shouldUseLockRelease(DEST_CHAIN_SELECTOR), "Lock/Release mech should be disabled after a burn" + ); + + test_LockOrBurn_PrimaryMechanism_Success(); + } + + function test_cancelExistingCCTPMigrationProposal() public { + vm.startPrank(OWNER); + + vm.expectEmit(); + emit USDCBridgeMigrator.CCTPMigrationProposed(DEST_CHAIN_SELECTOR); + + s_usdcTokenPool.proposeCCTPMigration(DEST_CHAIN_SELECTOR); + + assertEq( + s_usdcTokenPool.getCurrentProposedCCTPChainMigration(), + DEST_CHAIN_SELECTOR, + "migration proposal should exist, but doesn't" + ); + + vm.expectEmit(); + emit USDCBridgeMigrator.CCTPMigrationCancelled(DEST_CHAIN_SELECTOR); + + s_usdcTokenPool.cancelExistingCCTPMigrationProposal(); + + assertEq( + s_usdcTokenPool.getCurrentProposedCCTPChainMigration(), + 0, + "migration proposal exists, but shouldn't after being cancelled" + ); + + vm.expectRevert(USDCBridgeMigrator.NoExistingMigrationProposal.selector); + s_usdcTokenPool.cancelExistingCCTPMigrationProposal(); + } + + function test_burnLockedUSDC_invalidPermissions_Revert() public { + address CIRCLE = makeAddr("CIRCLE"); + + vm.startPrank(OWNER); + + // Set the circle migrator address for later, but don't start pranking as it yet + s_usdcTokenPool.setCircleMigratorAddress(CIRCLE); + + vm.expectRevert(abi.encodeWithSelector(USDCBridgeMigrator.onlyCircle.selector)); + + // Should fail because only Circle can call this function + s_usdcTokenPool.burnLockedUSDC(); + + vm.startPrank(CIRCLE); + + vm.expectRevert(abi.encodeWithSelector(USDCBridgeMigrator.ExistingMigrationProposal.selector)); + s_usdcTokenPool.burnLockedUSDC(); + } + + function test_transferLiquidity_Success() public { + // Set as the OWNER so we can provide liquidity + vm.startPrank(OWNER); + s_usdcTokenPoolTransferLiquidity.setLiquidityProvider(DEST_CHAIN_SELECTOR, OWNER); + + s_token.approve(address(s_usdcTokenPoolTransferLiquidity), type(uint256).max); + + uint256 liquidityAmount = 1e9; + + // Provide 1000 USDC as liquidity + s_usdcTokenPoolTransferLiquidity.provideLiquidity(DEST_CHAIN_SELECTOR, liquidityAmount); + + // Set the new token pool as the rebalancer + s_usdcTokenPoolTransferLiquidity.setLiquidityProvider(DEST_CHAIN_SELECTOR, address(s_usdcTokenPool)); + + vm.expectEmit(); + emit ILiquidityContainer.LiquidityRemoved(address(s_usdcTokenPool), liquidityAmount); + + vm.expectEmit(); + emit HybridLockReleaseUSDCTokenPool.LiquidityTransferred( + address(s_usdcTokenPoolTransferLiquidity), DEST_CHAIN_SELECTOR, liquidityAmount + ); + + s_usdcTokenPool.transferLiquidity(address(s_usdcTokenPoolTransferLiquidity), DEST_CHAIN_SELECTOR, liquidityAmount); + + assertEq( + s_usdcTokenPool.getLockedTokensForChain(DEST_CHAIN_SELECTOR), + liquidityAmount, + "Tokens locked for dest chain doesn't match expected amount in storage" + ); + + assertEq( + s_usdcTokenPoolTransferLiquidity.getLockedTokensForChain(DEST_CHAIN_SELECTOR), + 0, + "Tokens locked for dest chain in old token pool doesn't match expected amount in storage" + ); + + assertEq( + s_token.balanceOf(address(s_usdcTokenPool)), + liquidityAmount, + "Liquidity amount of tokens should be new in new pool, but aren't" + ); + } + + function test_cannotModifyLiquidityWithoutPermissions_Revert() public { + address randomAddr = makeAddr("RANDOM"); + + vm.startPrank(randomAddr); + + vm.expectRevert(abi.encodeWithSelector(TokenPool.Unauthorized.selector, randomAddr)); + + // Revert because there's insufficient permissions for the DEST_CHAIN_SELECTOR to provide liquidity + s_usdcTokenPool.provideLiquidity(DEST_CHAIN_SELECTOR, 1e6); + + vm.expectRevert(abi.encodeWithSelector(TokenPool.Unauthorized.selector, randomAddr)); + + // Revert because there's insufficient permissions for the DEST_CHAIN_SELECTOR to withdraw liquidity + s_usdcTokenPool.withdrawLiquidity(DEST_CHAIN_SELECTOR, 1e6); + } + + function test_cannotCancelANonExistentMigrationProposal() public { + vm.expectRevert(USDCBridgeMigrator.NoExistingMigrationProposal.selector); + + // Proposal to migrate doesn't exist, and so the chain selector is zero, and therefore should revert + s_usdcTokenPool.cancelExistingCCTPMigrationProposal(); + } +} diff --git a/contracts/src/v0.8/ccip/test/pools/LockReleaseTokenPool.t.sol b/contracts/src/v0.8/ccip/test/pools/LockReleaseTokenPool.t.sol new file mode 100644 index 00000000000..ed8a1cf31f1 --- /dev/null +++ b/contracts/src/v0.8/ccip/test/pools/LockReleaseTokenPool.t.sol @@ -0,0 +1,430 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {IPoolV1} from "../../interfaces/IPool.sol"; + +import {BurnMintERC677} from "../../../shared/token/ERC677/BurnMintERC677.sol"; +import {Router} from "../../Router.sol"; +import {Pool} from "../../libraries/Pool.sol"; +import {RateLimiter} from "../../libraries/RateLimiter.sol"; +import {LockReleaseTokenPool} from "../../pools/LockReleaseTokenPool.sol"; +import {TokenPool} from "../../pools/TokenPool.sol"; + +import {IERC20} from "../../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/IERC20.sol"; +import {IERC165} from "../../../vendor/openzeppelin-solidity/v5.0.2/contracts/utils/introspection/IERC165.sol"; +import {RouterSetup} from "../router/RouterSetup.t.sol"; + +contract LockReleaseTokenPoolSetup is RouterSetup { + IERC20 internal s_token; + LockReleaseTokenPool internal s_lockReleaseTokenPool; + LockReleaseTokenPool internal s_lockReleaseTokenPoolWithAllowList; + address[] internal s_allowedList; + + address internal s_allowedOnRamp = address(123); + address internal s_allowedOffRamp = address(234); + + address internal s_destPoolAddress = address(2736782345); + address internal s_sourcePoolAddress = address(53852352095); + + function setUp() public virtual override { + RouterSetup.setUp(); + s_token = new BurnMintERC677("LINK", "LNK", 18, 0); + deal(address(s_token), OWNER, type(uint256).max); + s_lockReleaseTokenPool = + new LockReleaseTokenPool(s_token, new address[](0), address(s_mockRMN), true, address(s_sourceRouter)); + + s_allowedList.push(USER_1); + s_allowedList.push(DUMMY_CONTRACT_ADDRESS); + s_lockReleaseTokenPoolWithAllowList = + new LockReleaseTokenPool(s_token, s_allowedList, address(s_mockRMN), true, address(s_sourceRouter)); + + TokenPool.ChainUpdate[] memory chainUpdate = new TokenPool.ChainUpdate[](1); + chainUpdate[0] = TokenPool.ChainUpdate({ + remoteChainSelector: DEST_CHAIN_SELECTOR, + remotePoolAddress: abi.encode(s_destPoolAddress), + remoteTokenAddress: abi.encode(address(2)), + allowed: true, + outboundRateLimiterConfig: _getOutboundRateLimiterConfig(), + inboundRateLimiterConfig: _getInboundRateLimiterConfig() + }); + + s_lockReleaseTokenPool.applyChainUpdates(chainUpdate); + s_lockReleaseTokenPoolWithAllowList.applyChainUpdates(chainUpdate); + s_lockReleaseTokenPool.setRebalancer(OWNER); + + Router.OnRamp[] memory onRampUpdates = new Router.OnRamp[](1); + Router.OffRamp[] memory offRampUpdates = new Router.OffRamp[](1); + onRampUpdates[0] = Router.OnRamp({destChainSelector: DEST_CHAIN_SELECTOR, onRamp: s_allowedOnRamp}); + offRampUpdates[0] = Router.OffRamp({sourceChainSelector: SOURCE_CHAIN_SELECTOR, offRamp: s_allowedOffRamp}); + s_sourceRouter.applyRampUpdates(onRampUpdates, new Router.OffRamp[](0), offRampUpdates); + } +} + +contract LockReleaseTokenPool_setRebalancer is LockReleaseTokenPoolSetup { + function test_SetRebalancer_Success() public { + assertEq(address(s_lockReleaseTokenPool.getRebalancer()), OWNER); + s_lockReleaseTokenPool.setRebalancer(STRANGER); + assertEq(address(s_lockReleaseTokenPool.getRebalancer()), STRANGER); + } + + function test_SetRebalancer_Revert() public { + vm.startPrank(STRANGER); + + vm.expectRevert("Only callable by owner"); + s_lockReleaseTokenPool.setRebalancer(STRANGER); + } +} + +contract LockReleaseTokenPool_lockOrBurn is LockReleaseTokenPoolSetup { + function test_Fuzz_LockOrBurnNoAllowList_Success(uint256 amount) public { + amount = bound(amount, 1, _getOutboundRateLimiterConfig().capacity); + vm.startPrank(s_allowedOnRamp); + + vm.expectEmit(); + emit RateLimiter.TokensConsumed(amount); + vm.expectEmit(); + emit TokenPool.Locked(s_allowedOnRamp, amount); + + s_lockReleaseTokenPool.lockOrBurn( + Pool.LockOrBurnInV1({ + originalSender: STRANGER, + receiver: bytes(""), + amount: amount, + remoteChainSelector: DEST_CHAIN_SELECTOR, + localToken: address(s_token) + }) + ); + } + + function test_LockOrBurnWithAllowList_Success() public { + uint256 amount = 100; + vm.startPrank(s_allowedOnRamp); + + vm.expectEmit(); + emit RateLimiter.TokensConsumed(amount); + vm.expectEmit(); + emit TokenPool.Locked(s_allowedOnRamp, amount); + + s_lockReleaseTokenPoolWithAllowList.lockOrBurn( + Pool.LockOrBurnInV1({ + originalSender: s_allowedList[0], + receiver: bytes(""), + amount: amount, + remoteChainSelector: DEST_CHAIN_SELECTOR, + localToken: address(s_token) + }) + ); + + vm.expectEmit(); + emit TokenPool.Locked(s_allowedOnRamp, amount); + + s_lockReleaseTokenPoolWithAllowList.lockOrBurn( + Pool.LockOrBurnInV1({ + originalSender: s_allowedList[1], + receiver: bytes(""), + amount: amount, + remoteChainSelector: DEST_CHAIN_SELECTOR, + localToken: address(s_token) + }) + ); + } + + function test_LockOrBurnWithAllowList_Revert() public { + vm.startPrank(s_allowedOnRamp); + + vm.expectRevert(abi.encodeWithSelector(TokenPool.SenderNotAllowed.selector, STRANGER)); + + s_lockReleaseTokenPoolWithAllowList.lockOrBurn( + Pool.LockOrBurnInV1({ + originalSender: STRANGER, + receiver: bytes(""), + amount: 100, + remoteChainSelector: DEST_CHAIN_SELECTOR, + localToken: address(s_token) + }) + ); + } + + function test_PoolBurnRevertNotHealthy_Revert() public { + // Should not burn tokens if cursed. + s_mockRMN.setGlobalCursed(true); + uint256 before = s_token.balanceOf(address(s_lockReleaseTokenPoolWithAllowList)); + + vm.startPrank(s_allowedOnRamp); + vm.expectRevert(TokenPool.CursedByRMN.selector); + + s_lockReleaseTokenPoolWithAllowList.lockOrBurn( + Pool.LockOrBurnInV1({ + originalSender: s_allowedList[0], + receiver: bytes(""), + amount: 1e5, + remoteChainSelector: DEST_CHAIN_SELECTOR, + localToken: address(s_token) + }) + ); + + assertEq(s_token.balanceOf(address(s_lockReleaseTokenPoolWithAllowList)), before); + } +} + +contract LockReleaseTokenPool_releaseOrMint is LockReleaseTokenPoolSetup { + function setUp() public virtual override { + LockReleaseTokenPoolSetup.setUp(); + TokenPool.ChainUpdate[] memory chainUpdate = new TokenPool.ChainUpdate[](1); + chainUpdate[0] = TokenPool.ChainUpdate({ + remoteChainSelector: SOURCE_CHAIN_SELECTOR, + remotePoolAddress: abi.encode(s_sourcePoolAddress), + remoteTokenAddress: abi.encode(address(2)), + allowed: true, + outboundRateLimiterConfig: _getOutboundRateLimiterConfig(), + inboundRateLimiterConfig: _getInboundRateLimiterConfig() + }); + + s_lockReleaseTokenPool.applyChainUpdates(chainUpdate); + s_lockReleaseTokenPoolWithAllowList.applyChainUpdates(chainUpdate); + } + + function test_ReleaseOrMint_Success() public { + vm.startPrank(s_allowedOffRamp); + + uint256 amount = 100; + deal(address(s_token), address(s_lockReleaseTokenPool), amount); + + vm.expectEmit(); + emit RateLimiter.TokensConsumed(amount); + vm.expectEmit(); + emit TokenPool.Released(s_allowedOffRamp, OWNER, amount); + + s_lockReleaseTokenPool.releaseOrMint( + Pool.ReleaseOrMintInV1({ + originalSender: bytes(""), + receiver: OWNER, + amount: amount, + localToken: address(s_token), + remoteChainSelector: SOURCE_CHAIN_SELECTOR, + sourcePoolAddress: abi.encode(s_sourcePoolAddress), + sourcePoolData: "", + offchainTokenData: "" + }) + ); + } + + function test_Fuzz_ReleaseOrMint_Success(address recipient, uint256 amount) public { + // Since the owner already has tokens this would break the checks + vm.assume(recipient != OWNER); + vm.assume(recipient != address(0)); + vm.assume(recipient != address(s_token)); + + // Makes sure the pool always has enough funds + deal(address(s_token), address(s_lockReleaseTokenPool), amount); + vm.startPrank(s_allowedOffRamp); + + uint256 capacity = _getInboundRateLimiterConfig().capacity; + // Determine if we hit the rate limit or the txs should succeed. + if (amount > capacity) { + vm.expectRevert( + abi.encodeWithSelector(RateLimiter.TokenMaxCapacityExceeded.selector, capacity, amount, address(s_token)) + ); + } else { + // Only rate limit if the amount is >0 + if (amount > 0) { + vm.expectEmit(); + emit RateLimiter.TokensConsumed(amount); + } + + vm.expectEmit(); + emit TokenPool.Released(s_allowedOffRamp, recipient, amount); + } + + s_lockReleaseTokenPool.releaseOrMint( + Pool.ReleaseOrMintInV1({ + originalSender: bytes(""), + receiver: recipient, + amount: amount, + localToken: address(s_token), + remoteChainSelector: SOURCE_CHAIN_SELECTOR, + sourcePoolAddress: abi.encode(s_sourcePoolAddress), + sourcePoolData: "", + offchainTokenData: "" + }) + ); + } + + function test_ChainNotAllowed_Revert() public { + address notAllowedRemotePoolAddress = address(1); + + TokenPool.ChainUpdate[] memory chainUpdate = new TokenPool.ChainUpdate[](1); + chainUpdate[0] = TokenPool.ChainUpdate({ + remoteChainSelector: SOURCE_CHAIN_SELECTOR, + remotePoolAddress: abi.encode(notAllowedRemotePoolAddress), + remoteTokenAddress: abi.encode(address(2)), + allowed: false, + outboundRateLimiterConfig: RateLimiter.Config({isEnabled: false, capacity: 0, rate: 0}), + inboundRateLimiterConfig: RateLimiter.Config({isEnabled: false, capacity: 0, rate: 0}) + }); + + s_lockReleaseTokenPool.applyChainUpdates(chainUpdate); + + vm.startPrank(s_allowedOffRamp); + + vm.expectRevert(abi.encodeWithSelector(TokenPool.ChainNotAllowed.selector, SOURCE_CHAIN_SELECTOR)); + s_lockReleaseTokenPool.releaseOrMint( + Pool.ReleaseOrMintInV1({ + originalSender: bytes(""), + receiver: OWNER, + amount: 1e5, + localToken: address(s_token), + remoteChainSelector: SOURCE_CHAIN_SELECTOR, + sourcePoolAddress: abi.encode(s_sourcePoolAddress), + sourcePoolData: "", + offchainTokenData: "" + }) + ); + } + + function test_PoolMintNotHealthy_Revert() public { + // Should not mint tokens if cursed. + s_mockRMN.setGlobalCursed(true); + uint256 before = s_token.balanceOf(OWNER); + vm.startPrank(s_allowedOffRamp); + vm.expectRevert(TokenPool.CursedByRMN.selector); + s_lockReleaseTokenPool.releaseOrMint( + Pool.ReleaseOrMintInV1({ + originalSender: bytes(""), + receiver: OWNER, + amount: 1e5, + localToken: address(s_token), + remoteChainSelector: SOURCE_CHAIN_SELECTOR, + sourcePoolAddress: _generateSourceTokenData().sourcePoolAddress, + sourcePoolData: _generateSourceTokenData().extraData, + offchainTokenData: "" + }) + ); + + assertEq(s_token.balanceOf(OWNER), before); + } +} + +contract LockReleaseTokenPool_canAcceptLiquidity is LockReleaseTokenPoolSetup { + function test_CanAcceptLiquidity_Success() public { + assertEq(true, s_lockReleaseTokenPool.canAcceptLiquidity()); + + s_lockReleaseTokenPool = + new LockReleaseTokenPool(s_token, new address[](0), address(s_mockRMN), false, address(s_sourceRouter)); + assertEq(false, s_lockReleaseTokenPool.canAcceptLiquidity()); + } +} + +contract LockReleaseTokenPool_provideLiquidity is LockReleaseTokenPoolSetup { + function test_Fuzz_ProvideLiquidity_Success(uint256 amount) public { + uint256 balancePre = s_token.balanceOf(OWNER); + s_token.approve(address(s_lockReleaseTokenPool), amount); + + s_lockReleaseTokenPool.provideLiquidity(amount); + + assertEq(s_token.balanceOf(OWNER), balancePre - amount); + assertEq(s_token.balanceOf(address(s_lockReleaseTokenPool)), amount); + } + + // Reverts + + function test_Unauthorized_Revert() public { + vm.startPrank(STRANGER); + vm.expectRevert(abi.encodeWithSelector(TokenPool.Unauthorized.selector, STRANGER)); + + s_lockReleaseTokenPool.provideLiquidity(1); + } + + function test_Fuzz_ExceedsAllowance(uint256 amount) public { + vm.assume(amount > 0); + vm.expectRevert("ERC20: insufficient allowance"); + s_lockReleaseTokenPool.provideLiquidity(amount); + } + + function test_LiquidityNotAccepted_Revert() public { + s_lockReleaseTokenPool = + new LockReleaseTokenPool(s_token, new address[](0), address(s_mockRMN), false, address(s_sourceRouter)); + + vm.expectRevert(LockReleaseTokenPool.LiquidityNotAccepted.selector); + s_lockReleaseTokenPool.provideLiquidity(1); + } +} + +contract LockReleaseTokenPool_withdrawalLiquidity is LockReleaseTokenPoolSetup { + function test_Fuzz_WithdrawalLiquidity_Success(uint256 amount) public { + uint256 balancePre = s_token.balanceOf(OWNER); + s_token.approve(address(s_lockReleaseTokenPool), amount); + s_lockReleaseTokenPool.provideLiquidity(amount); + + s_lockReleaseTokenPool.withdrawLiquidity(amount); + + assertEq(s_token.balanceOf(OWNER), balancePre); + } + + // Reverts + + function test_Unauthorized_Revert() public { + vm.startPrank(STRANGER); + vm.expectRevert(abi.encodeWithSelector(TokenPool.Unauthorized.selector, STRANGER)); + + s_lockReleaseTokenPool.withdrawLiquidity(1); + } + + function test_InsufficientLiquidity_Revert() public { + uint256 maxUint256 = 2 ** 256 - 1; + s_token.approve(address(s_lockReleaseTokenPool), maxUint256); + s_lockReleaseTokenPool.provideLiquidity(maxUint256); + + vm.startPrank(address(s_lockReleaseTokenPool)); + s_token.transfer(OWNER, maxUint256); + vm.startPrank(OWNER); + + vm.expectRevert(LockReleaseTokenPool.InsufficientLiquidity.selector); + s_lockReleaseTokenPool.withdrawLiquidity(1); + } +} + +contract LockReleaseTokenPool_transferLiquidity is LockReleaseTokenPoolSetup { + LockReleaseTokenPool internal s_oldLockReleaseTokenPool; + uint256 internal s_amount = 100000; + + function setUp() public virtual override { + super.setUp(); + + s_oldLockReleaseTokenPool = + new LockReleaseTokenPool(s_token, new address[](0), address(s_mockRMN), true, address(s_sourceRouter)); + + deal(address(s_token), address(s_oldLockReleaseTokenPool), s_amount); + } + + function test_transferLiquidity_Success() public { + uint256 balancePre = s_token.balanceOf(address(s_lockReleaseTokenPool)); + + s_oldLockReleaseTokenPool.setRebalancer(address(s_lockReleaseTokenPool)); + + vm.expectEmit(); + emit LockReleaseTokenPool.LiquidityTransferred(address(s_oldLockReleaseTokenPool), s_amount); + + s_lockReleaseTokenPool.transferLiquidity(address(s_oldLockReleaseTokenPool), s_amount); + + assertEq(s_token.balanceOf(address(s_lockReleaseTokenPool)), balancePre + s_amount); + } + + function test_transferLiquidity_transferTooMuch_Revert() public { + uint256 balancePre = s_token.balanceOf(address(s_lockReleaseTokenPool)); + + s_oldLockReleaseTokenPool.setRebalancer(address(s_lockReleaseTokenPool)); + + vm.expectRevert(LockReleaseTokenPool.InsufficientLiquidity.selector); + s_lockReleaseTokenPool.transferLiquidity(address(s_oldLockReleaseTokenPool), s_amount + 1); + + assertEq(s_token.balanceOf(address(s_lockReleaseTokenPool)), balancePre); + } +} + +contract LockReleaseTokenPool_supportsInterface is LockReleaseTokenPoolSetup { + function test_SupportsInterface_Success() public view { + assertTrue(s_lockReleaseTokenPool.supportsInterface(type(IPoolV1).interfaceId)); + assertTrue(s_lockReleaseTokenPool.supportsInterface(type(IERC165).interfaceId)); + } +} diff --git a/contracts/src/v0.8/ccip/test/pools/TokenPool.t.sol b/contracts/src/v0.8/ccip/test/pools/TokenPool.t.sol new file mode 100644 index 00000000000..2c1bc0ed575 --- /dev/null +++ b/contracts/src/v0.8/ccip/test/pools/TokenPool.t.sol @@ -0,0 +1,783 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {BurnMintERC677} from "../../../shared/token/ERC677/BurnMintERC677.sol"; +import {Router} from "../../Router.sol"; +import {RateLimiter} from "../../libraries/RateLimiter.sol"; +import {TokenPool} from "../../pools/TokenPool.sol"; +import {TokenPoolHelper} from "../helpers/TokenPoolHelper.sol"; +import {RouterSetup} from "../router/RouterSetup.t.sol"; + +import {IERC20} from "../../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/IERC20.sol"; + +contract TokenPoolSetup is RouterSetup { + IERC20 internal s_token; + TokenPoolHelper internal s_tokenPool; + + function setUp() public virtual override { + RouterSetup.setUp(); + s_token = new BurnMintERC677("LINK", "LNK", 18, 0); + deal(address(s_token), OWNER, type(uint256).max); + + s_tokenPool = new TokenPoolHelper(s_token, new address[](0), address(s_mockRMN), address(s_sourceRouter)); + } +} + +contract TokenPool_constructor is TokenPoolSetup { + function test_immutableFields_Success() public view { + assertEq(address(s_token), address(s_tokenPool.getToken())); + assertEq(address(s_mockRMN), s_tokenPool.getRmnProxy()); + assertEq(false, s_tokenPool.getAllowListEnabled()); + assertEq(address(s_sourceRouter), s_tokenPool.getRouter()); + } + + // Reverts + function test_ZeroAddressNotAllowed_Revert() public { + vm.expectRevert(TokenPool.ZeroAddressNotAllowed.selector); + + s_tokenPool = new TokenPoolHelper(IERC20(address(0)), new address[](0), address(s_mockRMN), address(s_sourceRouter)); + } +} + +contract TokenPool_getRemotePool is TokenPoolSetup { + function test_getRemotePool_Success() public { + uint64 chainSelector = 123124; + address remotePool = makeAddr("remotePool"); + address remoteToken = makeAddr("remoteToken"); + + // Zero indicates nothing is set + assertEq(0, s_tokenPool.getRemotePool(chainSelector).length); + + TokenPool.ChainUpdate[] memory chainUpdates = new TokenPool.ChainUpdate[](1); + chainUpdates[0] = TokenPool.ChainUpdate({ + remoteChainSelector: chainSelector, + remotePoolAddress: abi.encode(remotePool), + remoteTokenAddress: abi.encode(remoteToken), + allowed: true, + outboundRateLimiterConfig: _getOutboundRateLimiterConfig(), + inboundRateLimiterConfig: _getInboundRateLimiterConfig() + }); + s_tokenPool.applyChainUpdates(chainUpdates); + + assertEq(remotePool, abi.decode(s_tokenPool.getRemotePool(chainSelector), (address))); + } +} + +contract TokenPool_setRemotePool is TokenPoolSetup { + function test_setRemotePool_Success() public { + uint64 chainSelector = DEST_CHAIN_SELECTOR; + address initialPool = makeAddr("remotePool"); + address remoteToken = makeAddr("remoteToken"); + // The new pool is a non-evm pool, as it doesn't fit in the normal 160 bits + bytes memory newPool = abi.encode(type(uint256).max); + + TokenPool.ChainUpdate[] memory chainUpdates = new TokenPool.ChainUpdate[](1); + chainUpdates[0] = TokenPool.ChainUpdate({ + remoteChainSelector: chainSelector, + remotePoolAddress: abi.encode(initialPool), + remoteTokenAddress: abi.encode(remoteToken), + allowed: true, + outboundRateLimiterConfig: _getOutboundRateLimiterConfig(), + inboundRateLimiterConfig: _getInboundRateLimiterConfig() + }); + s_tokenPool.applyChainUpdates(chainUpdates); + + vm.expectEmit(); + emit TokenPool.RemotePoolSet(chainSelector, abi.encode(initialPool), newPool); + + s_tokenPool.setRemotePool(chainSelector, newPool); + + assertEq(keccak256(newPool), keccak256(s_tokenPool.getRemotePool(chainSelector))); + } + + // Reverts + + function test_setRemotePool_NonExistentChain_Reverts() public { + uint64 chainSelector = 123124; + bytes memory remotePool = abi.encode(makeAddr("remotePool")); + + vm.expectRevert(abi.encodeWithSelector(TokenPool.NonExistentChain.selector, chainSelector)); + s_tokenPool.setRemotePool(chainSelector, remotePool); + } + + function test_setRemotePool_OnlyOwner_Reverts() public { + vm.startPrank(STRANGER); + + vm.expectRevert("Only callable by owner"); + s_tokenPool.setRemotePool(123124, abi.encode(makeAddr("remotePool"))); + } +} + +contract TokenPool_applyChainUpdates is TokenPoolSetup { + function assertState(TokenPool.ChainUpdate[] memory chainUpdates) public view { + uint64[] memory chainSelectors = s_tokenPool.getSupportedChains(); + for (uint256 i = 0; i < chainUpdates.length; i++) { + assertEq(chainUpdates[i].remoteChainSelector, chainSelectors[i]); + } + + for (uint256 i = 0; i < chainUpdates.length; ++i) { + assertTrue(s_tokenPool.isSupportedChain(chainUpdates[i].remoteChainSelector)); + RateLimiter.TokenBucket memory bkt = + s_tokenPool.getCurrentOutboundRateLimiterState(chainUpdates[i].remoteChainSelector); + assertEq(bkt.capacity, chainUpdates[i].outboundRateLimiterConfig.capacity); + assertEq(bkt.rate, chainUpdates[i].outboundRateLimiterConfig.rate); + assertEq(bkt.isEnabled, chainUpdates[i].outboundRateLimiterConfig.isEnabled); + + bkt = s_tokenPool.getCurrentInboundRateLimiterState(chainUpdates[i].remoteChainSelector); + assertEq(bkt.capacity, chainUpdates[i].inboundRateLimiterConfig.capacity); + assertEq(bkt.rate, chainUpdates[i].inboundRateLimiterConfig.rate); + assertEq(bkt.isEnabled, chainUpdates[i].inboundRateLimiterConfig.isEnabled); + } + } + + function test_applyChainUpdates_Success() public { + RateLimiter.Config memory outboundRateLimit1 = RateLimiter.Config({isEnabled: true, capacity: 100e28, rate: 1e18}); + RateLimiter.Config memory inboundRateLimit1 = RateLimiter.Config({isEnabled: true, capacity: 100e29, rate: 1e19}); + RateLimiter.Config memory outboundRateLimit2 = RateLimiter.Config({isEnabled: true, capacity: 100e26, rate: 1e16}); + RateLimiter.Config memory inboundRateLimit2 = RateLimiter.Config({isEnabled: true, capacity: 100e27, rate: 1e17}); + + // EVM chain, which uses the 160 bit evm address space + uint64 evmChainSelector = 1; + bytes memory evmRemotePool = abi.encode(makeAddr("evm_remote_pool")); + bytes memory evmRemoteToken = abi.encode(makeAddr("evm_remote_token")); + + // Non EVM chain, which uses the full 256 bits + uint64 nonEvmChainSelector = type(uint64).max; + bytes memory nonEvmRemotePool = abi.encode(keccak256("non_evm_remote_pool")); + bytes memory nonEvmRemoteToken = abi.encode(keccak256("non_evm_remote_token")); + + TokenPool.ChainUpdate[] memory chainUpdates = new TokenPool.ChainUpdate[](2); + chainUpdates[0] = TokenPool.ChainUpdate({ + remoteChainSelector: evmChainSelector, + remotePoolAddress: evmRemotePool, + remoteTokenAddress: evmRemoteToken, + allowed: true, + outboundRateLimiterConfig: outboundRateLimit1, + inboundRateLimiterConfig: inboundRateLimit1 + }); + chainUpdates[1] = TokenPool.ChainUpdate({ + remoteChainSelector: nonEvmChainSelector, + remotePoolAddress: nonEvmRemotePool, + remoteTokenAddress: nonEvmRemoteToken, + allowed: true, + outboundRateLimiterConfig: outboundRateLimit2, + inboundRateLimiterConfig: inboundRateLimit2 + }); + + // Assert configuration is applied + vm.expectEmit(); + emit TokenPool.ChainAdded( + chainUpdates[0].remoteChainSelector, + chainUpdates[0].remoteTokenAddress, + chainUpdates[0].outboundRateLimiterConfig, + chainUpdates[0].inboundRateLimiterConfig + ); + vm.expectEmit(); + emit TokenPool.ChainAdded( + chainUpdates[1].remoteChainSelector, + chainUpdates[1].remoteTokenAddress, + chainUpdates[1].outboundRateLimiterConfig, + chainUpdates[1].inboundRateLimiterConfig + ); + s_tokenPool.applyChainUpdates(chainUpdates); + // on1: rateLimit1, on2: rateLimit2, off1: rateLimit1, off2: rateLimit3 + assertState(chainUpdates); + + // Removing an non-existent chain should revert + TokenPool.ChainUpdate[] memory chainRemoves = new TokenPool.ChainUpdate[](1); + uint64 strangerChainSelector = 120938; + chainRemoves[0] = TokenPool.ChainUpdate({ + remoteChainSelector: strangerChainSelector, + remotePoolAddress: evmRemotePool, + remoteTokenAddress: evmRemoteToken, + allowed: false, + outboundRateLimiterConfig: RateLimiter.Config({isEnabled: false, capacity: 0, rate: 0}), + inboundRateLimiterConfig: RateLimiter.Config({isEnabled: false, capacity: 0, rate: 0}) + }); + vm.expectRevert(abi.encodeWithSelector(TokenPool.NonExistentChain.selector, strangerChainSelector)); + s_tokenPool.applyChainUpdates(chainRemoves); + // State remains + assertState(chainUpdates); + + // Can remove a chain + chainRemoves[0].remoteChainSelector = evmChainSelector; + + vm.expectEmit(); + emit TokenPool.ChainRemoved(chainRemoves[0].remoteChainSelector); + + s_tokenPool.applyChainUpdates(chainRemoves); + + // State updated, only chain 2 remains + TokenPool.ChainUpdate[] memory singleChainConfigured = new TokenPool.ChainUpdate[](1); + singleChainConfigured[0] = chainUpdates[1]; + assertState(singleChainConfigured); + + // Cannot reset already configured ramp + vm.expectRevert( + abi.encodeWithSelector(TokenPool.ChainAlreadyExists.selector, singleChainConfigured[0].remoteChainSelector) + ); + s_tokenPool.applyChainUpdates(singleChainConfigured); + } + + // Reverts + + function test_applyChainUpdates_OnlyCallableByOwner_Revert() public { + vm.startPrank(STRANGER); + vm.expectRevert("Only callable by owner"); + s_tokenPool.applyChainUpdates(new TokenPool.ChainUpdate[](0)); + } + + function test_applyChainUpdates_ZeroAddressNotAllowed_Revert() public { + TokenPool.ChainUpdate[] memory chainUpdates = new TokenPool.ChainUpdate[](1); + chainUpdates[0] = TokenPool.ChainUpdate({ + remoteChainSelector: 1, + remotePoolAddress: "", + remoteTokenAddress: abi.encode(address(2)), + allowed: true, + outboundRateLimiterConfig: RateLimiter.Config({isEnabled: true, capacity: 100e28, rate: 1e18}), + inboundRateLimiterConfig: RateLimiter.Config({isEnabled: true, capacity: 100e28, rate: 1e18}) + }); + + vm.expectRevert(TokenPool.ZeroAddressNotAllowed.selector); + s_tokenPool.applyChainUpdates(chainUpdates); + + chainUpdates = new TokenPool.ChainUpdate[](1); + chainUpdates[0] = TokenPool.ChainUpdate({ + remoteChainSelector: 1, + remotePoolAddress: abi.encode(address(2)), + remoteTokenAddress: "", + allowed: true, + outboundRateLimiterConfig: RateLimiter.Config({isEnabled: true, capacity: 100e28, rate: 1e18}), + inboundRateLimiterConfig: RateLimiter.Config({isEnabled: true, capacity: 100e28, rate: 1e18}) + }); + + vm.expectRevert(TokenPool.ZeroAddressNotAllowed.selector); + s_tokenPool.applyChainUpdates(chainUpdates); + } + + function test_applyChainUpdates_DisabledNonZeroRateLimit_Revert() public { + RateLimiter.Config memory outboundRateLimit = RateLimiter.Config({isEnabled: true, capacity: 100e28, rate: 1e18}); + RateLimiter.Config memory inboundRateLimit = RateLimiter.Config({isEnabled: true, capacity: 100e22, rate: 1e12}); + TokenPool.ChainUpdate[] memory chainUpdates = new TokenPool.ChainUpdate[](1); + chainUpdates[0] = TokenPool.ChainUpdate({ + remoteChainSelector: 1, + remotePoolAddress: abi.encode(address(1)), + remoteTokenAddress: abi.encode(address(2)), + allowed: true, + outboundRateLimiterConfig: outboundRateLimit, + inboundRateLimiterConfig: inboundRateLimit + }); + + s_tokenPool.applyChainUpdates(chainUpdates); + + chainUpdates[0].allowed = false; + chainUpdates[0].outboundRateLimiterConfig = RateLimiter.Config({isEnabled: false, capacity: 10, rate: 1}); + chainUpdates[0].inboundRateLimiterConfig = RateLimiter.Config({isEnabled: false, capacity: 10, rate: 1}); + + vm.expectRevert( + abi.encodeWithSelector(RateLimiter.DisabledNonZeroRateLimit.selector, chainUpdates[0].outboundRateLimiterConfig) + ); + s_tokenPool.applyChainUpdates(chainUpdates); + } + + function test_applyChainUpdates_NonExistentChain_Revert() public { + RateLimiter.Config memory outboundRateLimit = RateLimiter.Config({isEnabled: false, capacity: 0, rate: 0}); + RateLimiter.Config memory inboundRateLimit = RateLimiter.Config({isEnabled: false, capacity: 0, rate: 0}); + TokenPool.ChainUpdate[] memory chainUpdates = new TokenPool.ChainUpdate[](1); + chainUpdates[0] = TokenPool.ChainUpdate({ + remoteChainSelector: 1, + remotePoolAddress: abi.encode(address(1)), + remoteTokenAddress: abi.encode(address(2)), + allowed: false, + outboundRateLimiterConfig: outboundRateLimit, + inboundRateLimiterConfig: inboundRateLimit + }); + + vm.expectRevert(abi.encodeWithSelector(TokenPool.NonExistentChain.selector, chainUpdates[0].remoteChainSelector)); + s_tokenPool.applyChainUpdates(chainUpdates); + } + + function test_applyChainUpdates_InvalidRateLimitRate_Revert() public { + TokenPool.ChainUpdate[] memory chainUpdates = new TokenPool.ChainUpdate[](1); + chainUpdates[0] = TokenPool.ChainUpdate({ + remoteChainSelector: 1, + remotePoolAddress: abi.encode(address(1)), + remoteTokenAddress: abi.encode(address(2)), + allowed: true, + outboundRateLimiterConfig: RateLimiter.Config({isEnabled: true, capacity: 0, rate: 0}), + inboundRateLimiterConfig: RateLimiter.Config({isEnabled: true, capacity: 100e22, rate: 1e12}) + }); + + // Outbound + + vm.expectRevert( + abi.encodeWithSelector(RateLimiter.InvalidRateLimitRate.selector, chainUpdates[0].outboundRateLimiterConfig) + ); + s_tokenPool.applyChainUpdates(chainUpdates); + + chainUpdates[0].outboundRateLimiterConfig.rate = 100; + + vm.expectRevert( + abi.encodeWithSelector(RateLimiter.InvalidRateLimitRate.selector, chainUpdates[0].outboundRateLimiterConfig) + ); + s_tokenPool.applyChainUpdates(chainUpdates); + + chainUpdates[0].outboundRateLimiterConfig.capacity = 100; + + vm.expectRevert( + abi.encodeWithSelector(RateLimiter.InvalidRateLimitRate.selector, chainUpdates[0].outboundRateLimiterConfig) + ); + s_tokenPool.applyChainUpdates(chainUpdates); + + chainUpdates[0].outboundRateLimiterConfig.capacity = 101; + + s_tokenPool.applyChainUpdates(chainUpdates); + + // Change the chain selector as adding the same one would revert + chainUpdates[0].remoteChainSelector = 2; + + // Inbound + + chainUpdates[0].inboundRateLimiterConfig.capacity = 0; + chainUpdates[0].inboundRateLimiterConfig.rate = 0; + + vm.expectRevert( + abi.encodeWithSelector(RateLimiter.InvalidRateLimitRate.selector, chainUpdates[0].inboundRateLimiterConfig) + ); + s_tokenPool.applyChainUpdates(chainUpdates); + + chainUpdates[0].inboundRateLimiterConfig.rate = 100; + + vm.expectRevert( + abi.encodeWithSelector(RateLimiter.InvalidRateLimitRate.selector, chainUpdates[0].inboundRateLimiterConfig) + ); + s_tokenPool.applyChainUpdates(chainUpdates); + + chainUpdates[0].inboundRateLimiterConfig.capacity = 100; + + vm.expectRevert( + abi.encodeWithSelector(RateLimiter.InvalidRateLimitRate.selector, chainUpdates[0].inboundRateLimiterConfig) + ); + s_tokenPool.applyChainUpdates(chainUpdates); + + chainUpdates[0].inboundRateLimiterConfig.capacity = 101; + + s_tokenPool.applyChainUpdates(chainUpdates); + } +} + +contract TokenPool_setChainRateLimiterConfig is TokenPoolSetup { + uint64 internal s_remoteChainSelector; + + function setUp() public virtual override { + TokenPoolSetup.setUp(); + TokenPool.ChainUpdate[] memory chainUpdates = new TokenPool.ChainUpdate[](1); + s_remoteChainSelector = 123124; + chainUpdates[0] = TokenPool.ChainUpdate({ + remoteChainSelector: s_remoteChainSelector, + remotePoolAddress: abi.encode(address(2)), + remoteTokenAddress: abi.encode(address(3)), + allowed: true, + outboundRateLimiterConfig: _getOutboundRateLimiterConfig(), + inboundRateLimiterConfig: _getInboundRateLimiterConfig() + }); + s_tokenPool.applyChainUpdates(chainUpdates); + } + + function test_Fuzz_SetChainRateLimiterConfig_Success(uint128 capacity, uint128 rate, uint32 newTime) public { + // Cap the lower bound to 4 so 4/2 is still >= 2 + vm.assume(capacity >= 4); + // Cap the lower bound to 2 so 2/2 is still >= 1 + rate = uint128(bound(rate, 2, capacity - 2)); + // Bucket updates only work on increasing time + newTime = uint32(bound(newTime, block.timestamp + 1, type(uint32).max)); + vm.warp(newTime); + + uint256 oldOutboundTokens = s_tokenPool.getCurrentOutboundRateLimiterState(s_remoteChainSelector).tokens; + uint256 oldInboundTokens = s_tokenPool.getCurrentInboundRateLimiterState(s_remoteChainSelector).tokens; + + RateLimiter.Config memory newOutboundConfig = RateLimiter.Config({isEnabled: true, capacity: capacity, rate: rate}); + RateLimiter.Config memory newInboundConfig = + RateLimiter.Config({isEnabled: true, capacity: capacity / 2, rate: rate / 2}); + + vm.expectEmit(); + emit RateLimiter.ConfigChanged(newOutboundConfig); + vm.expectEmit(); + emit RateLimiter.ConfigChanged(newInboundConfig); + vm.expectEmit(); + emit TokenPool.ChainConfigured(s_remoteChainSelector, newOutboundConfig, newInboundConfig); + + s_tokenPool.setChainRateLimiterConfig(s_remoteChainSelector, newOutboundConfig, newInboundConfig); + + uint256 expectedTokens = RateLimiter._min(newOutboundConfig.capacity, oldOutboundTokens); + + RateLimiter.TokenBucket memory bucket = s_tokenPool.getCurrentOutboundRateLimiterState(s_remoteChainSelector); + assertEq(bucket.capacity, newOutboundConfig.capacity); + assertEq(bucket.rate, newOutboundConfig.rate); + assertEq(bucket.tokens, expectedTokens); + assertEq(bucket.lastUpdated, newTime); + + expectedTokens = RateLimiter._min(newInboundConfig.capacity, oldInboundTokens); + + bucket = s_tokenPool.getCurrentInboundRateLimiterState(s_remoteChainSelector); + assertEq(bucket.capacity, newInboundConfig.capacity); + assertEq(bucket.rate, newInboundConfig.rate); + assertEq(bucket.tokens, expectedTokens); + assertEq(bucket.lastUpdated, newTime); + } + + // Reverts + + function test_OnlyOwnerOrRateLimitAdmin_Revert() public { + vm.startPrank(STRANGER); + + vm.expectRevert(abi.encodeWithSelector(TokenPool.Unauthorized.selector, STRANGER)); + s_tokenPool.setChainRateLimiterConfig( + s_remoteChainSelector, _getOutboundRateLimiterConfig(), _getInboundRateLimiterConfig() + ); + } + + function test_NonExistentChain_Revert() public { + uint64 wrongChainSelector = 9084102894; + + vm.expectRevert(abi.encodeWithSelector(TokenPool.NonExistentChain.selector, wrongChainSelector)); + s_tokenPool.setChainRateLimiterConfig( + wrongChainSelector, _getOutboundRateLimiterConfig(), _getInboundRateLimiterConfig() + ); + } +} + +contract LockRelease_setRateLimitAdmin is TokenPoolSetup { + function test_SetRateLimitAdmin_Success() public { + assertEq(address(0), s_tokenPool.getRateLimitAdmin()); + s_tokenPool.setRateLimitAdmin(OWNER); + assertEq(OWNER, s_tokenPool.getRateLimitAdmin()); + } + + // Reverts + + function test_SetRateLimitAdmin_Revert() public { + vm.startPrank(STRANGER); + + vm.expectRevert("Only callable by owner"); + s_tokenPool.setRateLimitAdmin(STRANGER); + } +} + +contract TokenPool_onlyOnRamp is TokenPoolSetup { + function test_onlyOnRamp_Success() public { + uint64 chainSelector = 13377; + address onRamp = makeAddr("onRamp"); + + TokenPool.ChainUpdate[] memory chainUpdate = new TokenPool.ChainUpdate[](1); + chainUpdate[0] = TokenPool.ChainUpdate({ + remoteChainSelector: chainSelector, + remotePoolAddress: abi.encode(address(1)), + remoteTokenAddress: abi.encode(address(2)), + allowed: true, + outboundRateLimiterConfig: _getOutboundRateLimiterConfig(), + inboundRateLimiterConfig: _getInboundRateLimiterConfig() + }); + s_tokenPool.applyChainUpdates(chainUpdate); + + Router.OnRamp[] memory onRampUpdates = new Router.OnRamp[](1); + onRampUpdates[0] = Router.OnRamp({destChainSelector: chainSelector, onRamp: onRamp}); + s_sourceRouter.applyRampUpdates(onRampUpdates, new Router.OffRamp[](0), new Router.OffRamp[](0)); + + vm.startPrank(onRamp); + + s_tokenPool.onlyOnRampModifier(chainSelector); + } + + function test_ChainNotAllowed_Revert() public { + uint64 chainSelector = 13377; + address onRamp = makeAddr("onRamp"); + + vm.startPrank(onRamp); + + vm.expectRevert(abi.encodeWithSelector(TokenPool.ChainNotAllowed.selector, chainSelector)); + s_tokenPool.onlyOnRampModifier(chainSelector); + + vm.startPrank(OWNER); + + TokenPool.ChainUpdate[] memory chainUpdate = new TokenPool.ChainUpdate[](1); + chainUpdate[0] = TokenPool.ChainUpdate({ + remoteChainSelector: chainSelector, + remotePoolAddress: abi.encode(address(1)), + remoteTokenAddress: abi.encode(address(2)), + allowed: true, + outboundRateLimiterConfig: _getOutboundRateLimiterConfig(), + inboundRateLimiterConfig: _getInboundRateLimiterConfig() + }); + s_tokenPool.applyChainUpdates(chainUpdate); + + Router.OnRamp[] memory onRampUpdates = new Router.OnRamp[](1); + onRampUpdates[0] = Router.OnRamp({destChainSelector: chainSelector, onRamp: onRamp}); + s_sourceRouter.applyRampUpdates(onRampUpdates, new Router.OffRamp[](0), new Router.OffRamp[](0)); + + vm.startPrank(onRamp); + // Should succeed now that we've added the chain + s_tokenPool.onlyOnRampModifier(chainSelector); + + chainUpdate[0] = TokenPool.ChainUpdate({ + remoteChainSelector: chainSelector, + remotePoolAddress: abi.encode(address(1)), + remoteTokenAddress: abi.encode(address(2)), + allowed: false, + outboundRateLimiterConfig: RateLimiter.Config({isEnabled: false, capacity: 0, rate: 0}), + inboundRateLimiterConfig: RateLimiter.Config({isEnabled: false, capacity: 0, rate: 0}) + }); + + vm.startPrank(OWNER); + s_tokenPool.applyChainUpdates(chainUpdate); + + vm.startPrank(onRamp); + + vm.expectRevert(abi.encodeWithSelector(TokenPool.ChainNotAllowed.selector, chainSelector)); + s_tokenPool.onlyOffRampModifier(chainSelector); + } + + function test_CallerIsNotARampOnRouter_Revert() public { + uint64 chainSelector = 13377; + address onRamp = makeAddr("onRamp"); + + TokenPool.ChainUpdate[] memory chainUpdate = new TokenPool.ChainUpdate[](1); + chainUpdate[0] = TokenPool.ChainUpdate({ + remoteChainSelector: chainSelector, + remotePoolAddress: abi.encode(address(1)), + remoteTokenAddress: abi.encode(address(2)), + allowed: true, + outboundRateLimiterConfig: _getOutboundRateLimiterConfig(), + inboundRateLimiterConfig: _getInboundRateLimiterConfig() + }); + s_tokenPool.applyChainUpdates(chainUpdate); + + vm.startPrank(onRamp); + + vm.expectRevert(abi.encodeWithSelector(TokenPool.CallerIsNotARampOnRouter.selector, onRamp)); + + s_tokenPool.onlyOnRampModifier(chainSelector); + } +} + +contract TokenPool_onlyOffRamp is TokenPoolSetup { + function test_onlyOffRamp_Success() public { + uint64 chainSelector = 13377; + address offRamp = makeAddr("onRamp"); + + TokenPool.ChainUpdate[] memory chainUpdate = new TokenPool.ChainUpdate[](1); + chainUpdate[0] = TokenPool.ChainUpdate({ + remoteChainSelector: chainSelector, + remotePoolAddress: abi.encode(address(1)), + remoteTokenAddress: abi.encode(address(2)), + allowed: true, + outboundRateLimiterConfig: _getOutboundRateLimiterConfig(), + inboundRateLimiterConfig: _getInboundRateLimiterConfig() + }); + s_tokenPool.applyChainUpdates(chainUpdate); + + Router.OffRamp[] memory offRampUpdates = new Router.OffRamp[](1); + offRampUpdates[0] = Router.OffRamp({sourceChainSelector: chainSelector, offRamp: offRamp}); + s_sourceRouter.applyRampUpdates(new Router.OnRamp[](0), new Router.OffRamp[](0), offRampUpdates); + + vm.startPrank(offRamp); + + s_tokenPool.onlyOffRampModifier(chainSelector); + } + + function test_ChainNotAllowed_Revert() public { + uint64 chainSelector = 13377; + address offRamp = makeAddr("onRamp"); + + vm.startPrank(offRamp); + + vm.expectRevert(abi.encodeWithSelector(TokenPool.ChainNotAllowed.selector, chainSelector)); + s_tokenPool.onlyOffRampModifier(chainSelector); + + vm.startPrank(OWNER); + + TokenPool.ChainUpdate[] memory chainUpdate = new TokenPool.ChainUpdate[](1); + chainUpdate[0] = TokenPool.ChainUpdate({ + remoteChainSelector: chainSelector, + remotePoolAddress: abi.encode(address(1)), + remoteTokenAddress: abi.encode(address(2)), + allowed: true, + outboundRateLimiterConfig: _getOutboundRateLimiterConfig(), + inboundRateLimiterConfig: _getInboundRateLimiterConfig() + }); + s_tokenPool.applyChainUpdates(chainUpdate); + + Router.OffRamp[] memory offRampUpdates = new Router.OffRamp[](1); + offRampUpdates[0] = Router.OffRamp({sourceChainSelector: chainSelector, offRamp: offRamp}); + s_sourceRouter.applyRampUpdates(new Router.OnRamp[](0), new Router.OffRamp[](0), offRampUpdates); + + vm.startPrank(offRamp); + // Should succeed now that we've added the chain + s_tokenPool.onlyOffRampModifier(chainSelector); + + chainUpdate[0] = TokenPool.ChainUpdate({ + remoteChainSelector: chainSelector, + remotePoolAddress: abi.encode(address(1)), + remoteTokenAddress: abi.encode(address(2)), + allowed: false, + outboundRateLimiterConfig: RateLimiter.Config({isEnabled: false, capacity: 0, rate: 0}), + inboundRateLimiterConfig: RateLimiter.Config({isEnabled: false, capacity: 0, rate: 0}) + }); + + vm.startPrank(OWNER); + s_tokenPool.applyChainUpdates(chainUpdate); + + vm.startPrank(offRamp); + + vm.expectRevert(abi.encodeWithSelector(TokenPool.ChainNotAllowed.selector, chainSelector)); + s_tokenPool.onlyOffRampModifier(chainSelector); + } + + function test_CallerIsNotARampOnRouter_Revert() public { + uint64 chainSelector = 13377; + address offRamp = makeAddr("offRamp"); + + TokenPool.ChainUpdate[] memory chainUpdate = new TokenPool.ChainUpdate[](1); + chainUpdate[0] = TokenPool.ChainUpdate({ + remoteChainSelector: chainSelector, + remotePoolAddress: abi.encode(address(1)), + remoteTokenAddress: abi.encode(address(2)), + allowed: true, + outboundRateLimiterConfig: _getOutboundRateLimiterConfig(), + inboundRateLimiterConfig: _getInboundRateLimiterConfig() + }); + s_tokenPool.applyChainUpdates(chainUpdate); + + vm.startPrank(offRamp); + + vm.expectRevert(abi.encodeWithSelector(TokenPool.CallerIsNotARampOnRouter.selector, offRamp)); + + s_tokenPool.onlyOffRampModifier(chainSelector); + } +} + +contract TokenPoolWithAllowListSetup is TokenPoolSetup { + address[] internal s_allowedSenders; + + function setUp() public virtual override { + TokenPoolSetup.setUp(); + + s_allowedSenders.push(STRANGER); + s_allowedSenders.push(DUMMY_CONTRACT_ADDRESS); + + s_tokenPool = new TokenPoolHelper(s_token, s_allowedSenders, address(s_mockRMN), address(s_sourceRouter)); + } +} + +contract TokenPoolWithAllowList_getAllowListEnabled is TokenPoolWithAllowListSetup { + function test_GetAllowListEnabled_Success() public view { + assertTrue(s_tokenPool.getAllowListEnabled()); + } +} + +contract TokenPoolWithAllowList_setRouter is TokenPoolWithAllowListSetup { + function test_SetRouter_Success() public { + assertEq(address(s_sourceRouter), s_tokenPool.getRouter()); + + address newRouter = makeAddr("newRouter"); + + vm.expectEmit(); + emit TokenPool.RouterUpdated(address(s_sourceRouter), newRouter); + + s_tokenPool.setRouter(newRouter); + + assertEq(newRouter, s_tokenPool.getRouter()); + } +} + +contract TokenPoolWithAllowList_getAllowList is TokenPoolWithAllowListSetup { + function test_GetAllowList_Success() public view { + address[] memory setAddresses = s_tokenPool.getAllowList(); + assertEq(2, setAddresses.length); + assertEq(s_allowedSenders[0], setAddresses[0]); + assertEq(s_allowedSenders[1], setAddresses[1]); + } +} + +contract TokenPoolWithAllowList_applyAllowListUpdates is TokenPoolWithAllowListSetup { + function test_SetAllowList_Success() public { + address[] memory newAddresses = new address[](2); + newAddresses[0] = address(1); + newAddresses[1] = address(2); + + for (uint256 i = 0; i < 2; ++i) { + vm.expectEmit(); + emit TokenPool.AllowListAdd(newAddresses[i]); + } + + s_tokenPool.applyAllowListUpdates(new address[](0), newAddresses); + address[] memory setAddresses = s_tokenPool.getAllowList(); + + assertEq(s_allowedSenders[0], setAddresses[0]); + assertEq(s_allowedSenders[1], setAddresses[1]); + assertEq(address(1), setAddresses[2]); + assertEq(address(2), setAddresses[3]); + + // address(2) exists noop, add address(3), remove address(1) + newAddresses = new address[](2); + newAddresses[0] = address(2); + newAddresses[1] = address(3); + + address[] memory removeAddresses = new address[](1); + removeAddresses[0] = address(1); + + vm.expectEmit(); + emit TokenPool.AllowListRemove(address(1)); + + vm.expectEmit(); + emit TokenPool.AllowListAdd(address(3)); + + s_tokenPool.applyAllowListUpdates(removeAddresses, newAddresses); + setAddresses = s_tokenPool.getAllowList(); + + assertEq(s_allowedSenders[0], setAddresses[0]); + assertEq(s_allowedSenders[1], setAddresses[1]); + assertEq(address(2), setAddresses[2]); + assertEq(address(3), setAddresses[3]); + + // remove all from allowList + for (uint256 i = 0; i < setAddresses.length; ++i) { + vm.expectEmit(); + emit TokenPool.AllowListRemove(setAddresses[i]); + } + + s_tokenPool.applyAllowListUpdates(setAddresses, new address[](0)); + setAddresses = s_tokenPool.getAllowList(); + + assertEq(0, setAddresses.length); + } + + function test_SetAllowListSkipsZero_Success() public { + uint256 setAddressesLength = s_tokenPool.getAllowList().length; + + address[] memory newAddresses = new address[](1); + newAddresses[0] = address(0); + + s_tokenPool.applyAllowListUpdates(new address[](0), newAddresses); + address[] memory setAddresses = s_tokenPool.getAllowList(); + + assertEq(setAddresses.length, setAddressesLength); + } + + // Reverts + + function test_OnlyOwner_Revert() public { + vm.stopPrank(); + vm.expectRevert("Only callable by owner"); + address[] memory newAddresses = new address[](2); + s_tokenPool.applyAllowListUpdates(new address[](0), newAddresses); + } + + function test_AllowListNotEnabled_Revert() public { + s_tokenPool = new TokenPoolHelper(s_token, new address[](0), address(s_mockRMN), address(s_sourceRouter)); + + vm.expectRevert(TokenPool.AllowListNotEnabled.selector); + + s_tokenPool.applyAllowListUpdates(new address[](0), new address[](2)); + } +} diff --git a/contracts/src/v0.8/ccip/test/pools/USDCTokenPool.t.sol b/contracts/src/v0.8/ccip/test/pools/USDCTokenPool.t.sol new file mode 100644 index 00000000000..b71094a3109 --- /dev/null +++ b/contracts/src/v0.8/ccip/test/pools/USDCTokenPool.t.sol @@ -0,0 +1,700 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {IBurnMintERC20} from "../../../shared/token/ERC20/IBurnMintERC20.sol"; +import {IPoolV1} from "../../interfaces/IPool.sol"; +import {ITokenMessenger} from "../../pools/USDC/ITokenMessenger.sol"; + +import {BurnMintERC677} from "../../../shared/token/ERC677/BurnMintERC677.sol"; +import {Router} from "../../Router.sol"; +import {Internal} from "../../libraries/Internal.sol"; +import {Pool} from "../../libraries/Pool.sol"; +import {RateLimiter} from "../../libraries/RateLimiter.sol"; +import {TokenPool} from "../../pools/TokenPool.sol"; +import {USDCTokenPool} from "../../pools/USDC/USDCTokenPool.sol"; +import {BaseTest} from "../BaseTest.t.sol"; +import {USDCTokenPoolHelper} from "../helpers/USDCTokenPoolHelper.sol"; +import {MockE2EUSDCTransmitter} from "../mocks/MockE2EUSDCTransmitter.sol"; +import {MockUSDCTokenMessenger} from "../mocks/MockUSDCTokenMessenger.sol"; + +import {IERC165} from "../../../vendor/openzeppelin-solidity/v5.0.2/contracts/utils/introspection/IERC165.sol"; + +contract USDCTokenPoolSetup is BaseTest { + IBurnMintERC20 internal s_token; + MockUSDCTokenMessenger internal s_mockUSDC; + MockE2EUSDCTransmitter internal s_mockUSDCTransmitter; + uint32 internal constant USDC_DEST_TOKEN_GAS = 150_000; + + struct USDCMessage { + uint32 version; + uint32 sourceDomain; + uint32 destinationDomain; + uint64 nonce; + bytes32 sender; + bytes32 recipient; + bytes32 destinationCaller; + bytes messageBody; + } + + uint32 internal constant SOURCE_DOMAIN_IDENTIFIER = 0x02020202; + uint32 internal constant DEST_DOMAIN_IDENTIFIER = 0; + + bytes32 internal constant SOURCE_CHAIN_TOKEN_SENDER = bytes32(uint256(uint160(0x01111111221))); + address internal constant SOURCE_CHAIN_USDC_POOL = address(0x23789765456789); + address internal constant DEST_CHAIN_USDC_POOL = address(0x987384873458734); + address internal constant DEST_CHAIN_USDC_TOKEN = address(0x23598918358198766); + + address internal s_routerAllowedOnRamp = address(3456); + address internal s_routerAllowedOffRamp = address(234); + Router internal s_router; + + USDCTokenPoolHelper internal s_usdcTokenPool; + USDCTokenPoolHelper internal s_usdcTokenPoolWithAllowList; + address[] internal s_allowedList; + + function setUp() public virtual override { + BaseTest.setUp(); + BurnMintERC677 usdcToken = new BurnMintERC677("LINK", "LNK", 18, 0); + s_token = usdcToken; + deal(address(s_token), OWNER, type(uint256).max); + _setUpRamps(); + + s_mockUSDCTransmitter = new MockE2EUSDCTransmitter(0, DEST_DOMAIN_IDENTIFIER, address(s_token)); + s_mockUSDC = new MockUSDCTokenMessenger(0, address(s_mockUSDCTransmitter)); + + usdcToken.grantMintAndBurnRoles(address(s_mockUSDCTransmitter)); + + s_usdcTokenPool = + new USDCTokenPoolHelper(s_mockUSDC, s_token, new address[](0), address(s_mockRMN), address(s_router)); + usdcToken.grantMintAndBurnRoles(address(s_mockUSDC)); + + s_allowedList.push(USER_1); + s_usdcTokenPoolWithAllowList = + new USDCTokenPoolHelper(s_mockUSDC, s_token, s_allowedList, address(s_mockRMN), address(s_router)); + + TokenPool.ChainUpdate[] memory chainUpdates = new TokenPool.ChainUpdate[](2); + chainUpdates[0] = TokenPool.ChainUpdate({ + remoteChainSelector: SOURCE_CHAIN_SELECTOR, + remotePoolAddress: abi.encode(SOURCE_CHAIN_USDC_POOL), + remoteTokenAddress: abi.encode(address(s_token)), + allowed: true, + outboundRateLimiterConfig: _getOutboundRateLimiterConfig(), + inboundRateLimiterConfig: _getInboundRateLimiterConfig() + }); + chainUpdates[1] = TokenPool.ChainUpdate({ + remoteChainSelector: DEST_CHAIN_SELECTOR, + remotePoolAddress: abi.encode(DEST_CHAIN_USDC_POOL), + remoteTokenAddress: abi.encode(DEST_CHAIN_USDC_TOKEN), + allowed: true, + outboundRateLimiterConfig: _getOutboundRateLimiterConfig(), + inboundRateLimiterConfig: _getInboundRateLimiterConfig() + }); + + s_usdcTokenPool.applyChainUpdates(chainUpdates); + s_usdcTokenPoolWithAllowList.applyChainUpdates(chainUpdates); + + USDCTokenPool.DomainUpdate[] memory domains = new USDCTokenPool.DomainUpdate[](1); + domains[0] = USDCTokenPool.DomainUpdate({ + destChainSelector: DEST_CHAIN_SELECTOR, + domainIdentifier: 9999, + allowedCaller: keccak256("allowedCaller"), + enabled: true + }); + + s_usdcTokenPool.setDomains(domains); + s_usdcTokenPoolWithAllowList.setDomains(domains); + } + + function _setUpRamps() internal { + s_router = new Router(address(s_token), address(s_mockRMN)); + + Router.OnRamp[] memory onRampUpdates = new Router.OnRamp[](1); + onRampUpdates[0] = Router.OnRamp({destChainSelector: DEST_CHAIN_SELECTOR, onRamp: s_routerAllowedOnRamp}); + Router.OffRamp[] memory offRampUpdates = new Router.OffRamp[](1); + address[] memory offRamps = new address[](1); + offRamps[0] = s_routerAllowedOffRamp; + offRampUpdates[0] = Router.OffRamp({sourceChainSelector: SOURCE_CHAIN_SELECTOR, offRamp: offRamps[0]}); + + s_router.applyRampUpdates(onRampUpdates, new Router.OffRamp[](0), offRampUpdates); + } + + function _generateUSDCMessage(USDCMessage memory usdcMessage) internal pure returns (bytes memory) { + return abi.encodePacked( + usdcMessage.version, + usdcMessage.sourceDomain, + usdcMessage.destinationDomain, + usdcMessage.nonce, + usdcMessage.sender, + usdcMessage.recipient, + usdcMessage.destinationCaller, + usdcMessage.messageBody + ); + } +} + +contract USDCTokenPool_lockOrBurn is USDCTokenPoolSetup { + // Base test case, included for PR gas comparisons as fuzz tests are excluded from forge snapshot due to being flaky. + function test_LockOrBurn_Success() public { + bytes32 receiver = bytes32(uint256(uint160(STRANGER))); + uint256 amount = 1; + s_token.transfer(address(s_usdcTokenPool), amount); + vm.startPrank(s_routerAllowedOnRamp); + + USDCTokenPool.Domain memory expectedDomain = s_usdcTokenPool.getDomain(DEST_CHAIN_SELECTOR); + + vm.expectEmit(); + emit RateLimiter.TokensConsumed(amount); + + vm.expectEmit(); + emit ITokenMessenger.DepositForBurn( + s_mockUSDC.s_nonce(), + address(s_token), + amount, + address(s_usdcTokenPool), + receiver, + expectedDomain.domainIdentifier, + s_mockUSDC.DESTINATION_TOKEN_MESSENGER(), + expectedDomain.allowedCaller + ); + + vm.expectEmit(); + emit TokenPool.Burned(s_routerAllowedOnRamp, amount); + + Pool.LockOrBurnOutV1 memory poolReturnDataV1 = s_usdcTokenPool.lockOrBurn( + Pool.LockOrBurnInV1({ + originalSender: OWNER, + receiver: abi.encodePacked(receiver), + amount: amount, + remoteChainSelector: DEST_CHAIN_SELECTOR, + localToken: address(s_token) + }) + ); + + uint64 nonce = abi.decode(poolReturnDataV1.destPoolData, (uint64)); + assertEq(s_mockUSDC.s_nonce() - 1, nonce); + } + + function test_Fuzz_LockOrBurn_Success(bytes32 destinationReceiver, uint256 amount) public { + vm.assume(destinationReceiver != bytes32(0)); + amount = bound(amount, 1, _getOutboundRateLimiterConfig().capacity); + s_token.transfer(address(s_usdcTokenPool), amount); + vm.startPrank(s_routerAllowedOnRamp); + + USDCTokenPool.Domain memory expectedDomain = s_usdcTokenPool.getDomain(DEST_CHAIN_SELECTOR); + + vm.expectEmit(); + emit RateLimiter.TokensConsumed(amount); + + vm.expectEmit(); + emit ITokenMessenger.DepositForBurn( + s_mockUSDC.s_nonce(), + address(s_token), + amount, + address(s_usdcTokenPool), + destinationReceiver, + expectedDomain.domainIdentifier, + s_mockUSDC.DESTINATION_TOKEN_MESSENGER(), + expectedDomain.allowedCaller + ); + + vm.expectEmit(); + emit TokenPool.Burned(s_routerAllowedOnRamp, amount); + + Pool.LockOrBurnOutV1 memory poolReturnDataV1 = s_usdcTokenPool.lockOrBurn( + Pool.LockOrBurnInV1({ + originalSender: OWNER, + receiver: abi.encodePacked(destinationReceiver), + amount: amount, + remoteChainSelector: DEST_CHAIN_SELECTOR, + localToken: address(s_token) + }) + ); + + uint64 nonce = abi.decode(poolReturnDataV1.destPoolData, (uint64)); + assertEq(s_mockUSDC.s_nonce() - 1, nonce); + assertEq(poolReturnDataV1.destTokenAddress, abi.encode(DEST_CHAIN_USDC_TOKEN)); + } + + function test_Fuzz_LockOrBurnWithAllowList_Success(bytes32 destinationReceiver, uint256 amount) public { + vm.assume(destinationReceiver != bytes32(0)); + amount = bound(amount, 1, _getOutboundRateLimiterConfig().capacity); + s_token.transfer(address(s_usdcTokenPoolWithAllowList), amount); + vm.startPrank(s_routerAllowedOnRamp); + + USDCTokenPool.Domain memory expectedDomain = s_usdcTokenPoolWithAllowList.getDomain(DEST_CHAIN_SELECTOR); + + vm.expectEmit(); + emit RateLimiter.TokensConsumed(amount); + vm.expectEmit(); + emit ITokenMessenger.DepositForBurn( + s_mockUSDC.s_nonce(), + address(s_token), + amount, + address(s_usdcTokenPoolWithAllowList), + destinationReceiver, + expectedDomain.domainIdentifier, + s_mockUSDC.DESTINATION_TOKEN_MESSENGER(), + expectedDomain.allowedCaller + ); + vm.expectEmit(); + emit TokenPool.Burned(s_routerAllowedOnRamp, amount); + + Pool.LockOrBurnOutV1 memory poolReturnDataV1 = s_usdcTokenPoolWithAllowList.lockOrBurn( + Pool.LockOrBurnInV1({ + originalSender: s_allowedList[0], + receiver: abi.encodePacked(destinationReceiver), + amount: amount, + remoteChainSelector: DEST_CHAIN_SELECTOR, + localToken: address(s_token) + }) + ); + uint64 nonce = abi.decode(poolReturnDataV1.destPoolData, (uint64)); + assertEq(s_mockUSDC.s_nonce() - 1, nonce); + assertEq(poolReturnDataV1.destTokenAddress, abi.encode(DEST_CHAIN_USDC_TOKEN)); + } + + // Reverts + function test_UnknownDomain_Revert() public { + uint64 wrongDomain = DEST_CHAIN_SELECTOR + 1; + // We need to setup the wrong chainSelector so it reaches the domain check + Router.OnRamp[] memory onRampUpdates = new Router.OnRamp[](1); + onRampUpdates[0] = Router.OnRamp({destChainSelector: wrongDomain, onRamp: s_routerAllowedOnRamp}); + s_router.applyRampUpdates(onRampUpdates, new Router.OffRamp[](0), new Router.OffRamp[](0)); + + TokenPool.ChainUpdate[] memory chainUpdates = new TokenPool.ChainUpdate[](1); + chainUpdates[0] = TokenPool.ChainUpdate({ + remoteChainSelector: wrongDomain, + remotePoolAddress: abi.encode(address(1)), + remoteTokenAddress: abi.encode(address(2)), + allowed: true, + outboundRateLimiterConfig: _getOutboundRateLimiterConfig(), + inboundRateLimiterConfig: _getInboundRateLimiterConfig() + }); + + s_usdcTokenPool.applyChainUpdates(chainUpdates); + + uint256 amount = 1000; + vm.startPrank(s_routerAllowedOnRamp); + deal(address(s_token), s_routerAllowedOnRamp, amount); + s_token.approve(address(s_usdcTokenPool), amount); + + vm.expectRevert(abi.encodeWithSelector(USDCTokenPool.UnknownDomain.selector, wrongDomain)); + + s_usdcTokenPool.lockOrBurn( + Pool.LockOrBurnInV1({ + originalSender: OWNER, + receiver: abi.encodePacked(address(0)), + amount: amount, + remoteChainSelector: wrongDomain, + localToken: address(s_token) + }) + ); + } + + function test_CallerIsNotARampOnRouter_Revert() public { + vm.expectRevert(abi.encodeWithSelector(TokenPool.CallerIsNotARampOnRouter.selector, OWNER)); + + s_usdcTokenPool.lockOrBurn( + Pool.LockOrBurnInV1({ + originalSender: OWNER, + receiver: abi.encodePacked(address(0)), + amount: 0, + remoteChainSelector: DEST_CHAIN_SELECTOR, + localToken: address(s_token) + }) + ); + } + + function test_LockOrBurnWithAllowList_Revert() public { + vm.startPrank(s_routerAllowedOnRamp); + + vm.expectRevert(abi.encodeWithSelector(TokenPool.SenderNotAllowed.selector, STRANGER)); + + s_usdcTokenPoolWithAllowList.lockOrBurn( + Pool.LockOrBurnInV1({ + originalSender: STRANGER, + receiver: abi.encodePacked(address(0)), + amount: 1000, + remoteChainSelector: DEST_CHAIN_SELECTOR, + localToken: address(s_token) + }) + ); + } +} + +contract USDCTokenPool_releaseOrMint is USDCTokenPoolSetup { + // From https://github.com/circlefin/evm-cctp-contracts/blob/377c9bd813fb86a42d900ae4003599d82aef635a/src/messages/BurnMessage.sol#L57 + function _formatMessage( + uint32 _version, + bytes32 _burnToken, + bytes32 _mintRecipient, + uint256 _amount, + bytes32 _messageSender + ) internal pure returns (bytes memory) { + return abi.encodePacked(_version, _burnToken, _mintRecipient, _amount, _messageSender); + } + + function test_Fuzz_ReleaseOrMint_Success(address recipient, uint256 amount) public { + vm.assume(recipient != address(0) && recipient != address(s_token)); + amount = bound(amount, 0, _getInboundRateLimiterConfig().capacity); + + USDCMessage memory usdcMessage = USDCMessage({ + version: 0, + sourceDomain: SOURCE_DOMAIN_IDENTIFIER, + destinationDomain: DEST_DOMAIN_IDENTIFIER, + nonce: 0x060606060606, + sender: SOURCE_CHAIN_TOKEN_SENDER, + recipient: bytes32(uint256(uint160(recipient))), + destinationCaller: bytes32(uint256(uint160(address(s_usdcTokenPool)))), + messageBody: _formatMessage( + 0, + bytes32(uint256(uint160(address(s_token)))), + bytes32(uint256(uint160(recipient))), + amount, + bytes32(uint256(uint160(OWNER))) + ) + }); + + bytes memory message = _generateUSDCMessage(usdcMessage); + bytes memory attestation = bytes("attestation bytes"); + + Internal.SourceTokenData memory sourceTokenData = Internal.SourceTokenData({ + sourcePoolAddress: abi.encode(SOURCE_CHAIN_USDC_POOL), + destTokenAddress: abi.encode(address(s_usdcTokenPool)), + extraData: abi.encode( + USDCTokenPool.SourceTokenDataPayload({nonce: usdcMessage.nonce, sourceDomain: SOURCE_DOMAIN_IDENTIFIER}) + ), + destGasAmount: USDC_DEST_TOKEN_GAS + }); + + bytes memory offchainTokenData = + abi.encode(USDCTokenPool.MessageAndAttestation({message: message, attestation: attestation})); + + // The mocked receiver does not release the token to the pool, so we manually do it here + deal(address(s_token), address(s_usdcTokenPool), amount); + + vm.expectEmit(); + emit TokenPool.Minted(s_routerAllowedOffRamp, recipient, amount); + + vm.expectCall( + address(s_mockUSDCTransmitter), + abi.encodeWithSelector(MockE2EUSDCTransmitter.receiveMessage.selector, message, attestation) + ); + + vm.startPrank(s_routerAllowedOffRamp); + s_usdcTokenPool.releaseOrMint( + Pool.ReleaseOrMintInV1({ + originalSender: abi.encode(OWNER), + receiver: recipient, + amount: amount, + localToken: address(s_token), + remoteChainSelector: SOURCE_CHAIN_SELECTOR, + sourcePoolAddress: sourceTokenData.sourcePoolAddress, + sourcePoolData: sourceTokenData.extraData, + offchainTokenData: offchainTokenData + }) + ); + } + + // https://etherscan.io/tx/0xac9f501fe0b76df1f07a22e1db30929fd12524bc7068d74012dff948632f0883 + function test_ReleaseOrMintRealTx_Success() public { + bytes memory encodedUsdcMessage = + hex"000000000000000300000000000000000000127a00000000000000000000000019330d10d9cc8751218eaf51e8885d058642e08a000000000000000000000000bd3fa81b58ba92a82136038b25adec7066af3155000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000af88d065e77c8cc2239327c5edb3a432268e58310000000000000000000000004af08f56978be7dce2d1be3c65c005b41e79401c000000000000000000000000000000000000000000000000000000002057ff7a0000000000000000000000003a23f943181408eac424116af7b7790c94cb97a50000000000000000000000000000000000000000000000000000000000000000000000000000008274119237535fd659626b090f87e365ff89ebc7096bb32e8b0e85f155626b73ae7c4bb2485c184b7cc3cf7909045487890b104efb62ae74a73e32901bdcec91df1bb9ee08ccb014fcbcfe77b74d1263fd4e0b0e8de05d6c9a5913554364abfd5ea768b222f50c715908183905d74044bb2b97527c7e70ae7983c443a603557cac3b1c000000000000000000000000000000000000000000000000000000000000"; + bytes memory attestation = bytes("attestation bytes"); + + uint32 nonce = 4730; + uint32 sourceDomain = 3; + uint256 amount = 100; + + Internal.SourceTokenData memory sourceTokenData = Internal.SourceTokenData({ + sourcePoolAddress: abi.encode(SOURCE_CHAIN_USDC_POOL), + destTokenAddress: abi.encode(address(s_usdcTokenPool)), + extraData: abi.encode(USDCTokenPool.SourceTokenDataPayload({nonce: nonce, sourceDomain: sourceDomain})), + destGasAmount: USDC_DEST_TOKEN_GAS + }); + + // The mocked receiver does not release the token to the pool, so we manually do it here + deal(address(s_token), address(s_usdcTokenPool), amount); + + bytes memory offchainTokenData = + abi.encode(USDCTokenPool.MessageAndAttestation({message: encodedUsdcMessage, attestation: attestation})); + + vm.expectCall( + address(s_mockUSDCTransmitter), + abi.encodeWithSelector(MockE2EUSDCTransmitter.receiveMessage.selector, encodedUsdcMessage, attestation) + ); + + vm.startPrank(s_routerAllowedOffRamp); + s_usdcTokenPool.releaseOrMint( + Pool.ReleaseOrMintInV1({ + originalSender: abi.encode(OWNER), + receiver: OWNER, + amount: amount, + localToken: address(s_token), + remoteChainSelector: SOURCE_CHAIN_SELECTOR, + sourcePoolAddress: sourceTokenData.sourcePoolAddress, + sourcePoolData: sourceTokenData.extraData, + offchainTokenData: offchainTokenData + }) + ); + } + + // Reverts + function test_UnlockingUSDCFailed_Revert() public { + vm.startPrank(s_routerAllowedOffRamp); + s_mockUSDCTransmitter.setShouldSucceed(false); + + uint256 amount = 13255235235; + + USDCMessage memory usdcMessage = USDCMessage({ + version: 0, + sourceDomain: SOURCE_DOMAIN_IDENTIFIER, + destinationDomain: DEST_DOMAIN_IDENTIFIER, + nonce: 0x060606060606, + sender: SOURCE_CHAIN_TOKEN_SENDER, + recipient: bytes32(uint256(uint160(address(s_mockUSDC)))), + destinationCaller: bytes32(uint256(uint160(address(s_usdcTokenPool)))), + messageBody: _formatMessage( + 0, + bytes32(uint256(uint160(address(s_token)))), + bytes32(uint256(uint160(OWNER))), + amount, + bytes32(uint256(uint160(OWNER))) + ) + }); + + Internal.SourceTokenData memory sourceTokenData = Internal.SourceTokenData({ + sourcePoolAddress: abi.encode(SOURCE_CHAIN_USDC_POOL), + destTokenAddress: abi.encode(address(s_usdcTokenPool)), + extraData: abi.encode( + USDCTokenPool.SourceTokenDataPayload({nonce: usdcMessage.nonce, sourceDomain: SOURCE_DOMAIN_IDENTIFIER}) + ), + destGasAmount: USDC_DEST_TOKEN_GAS + }); + + bytes memory offchainTokenData = abi.encode( + USDCTokenPool.MessageAndAttestation({message: _generateUSDCMessage(usdcMessage), attestation: bytes("")}) + ); + + vm.expectRevert(USDCTokenPool.UnlockingUSDCFailed.selector); + + s_usdcTokenPool.releaseOrMint( + Pool.ReleaseOrMintInV1({ + originalSender: abi.encode(OWNER), + receiver: OWNER, + amount: amount, + localToken: address(s_token), + remoteChainSelector: SOURCE_CHAIN_SELECTOR, + sourcePoolAddress: sourceTokenData.sourcePoolAddress, + sourcePoolData: sourceTokenData.extraData, + offchainTokenData: offchainTokenData + }) + ); + } + + function test_TokenMaxCapacityExceeded_Revert() public { + uint256 capacity = _getInboundRateLimiterConfig().capacity; + uint256 amount = 10 * capacity; + address recipient = address(1); + vm.startPrank(s_routerAllowedOffRamp); + + Internal.SourceTokenData memory sourceTokenData = Internal.SourceTokenData({ + sourcePoolAddress: abi.encode(SOURCE_CHAIN_USDC_POOL), + destTokenAddress: abi.encode(address(s_usdcTokenPool)), + extraData: abi.encode(USDCTokenPool.SourceTokenDataPayload({nonce: 1, sourceDomain: SOURCE_DOMAIN_IDENTIFIER})), + destGasAmount: USDC_DEST_TOKEN_GAS + }); + + bytes memory offchainTokenData = + abi.encode(USDCTokenPool.MessageAndAttestation({message: bytes(""), attestation: bytes("")})); + + vm.expectRevert( + abi.encodeWithSelector(RateLimiter.TokenMaxCapacityExceeded.selector, capacity, amount, address(s_token)) + ); + + s_usdcTokenPool.releaseOrMint( + Pool.ReleaseOrMintInV1({ + originalSender: abi.encode(OWNER), + receiver: recipient, + amount: amount, + localToken: address(s_token), + remoteChainSelector: SOURCE_CHAIN_SELECTOR, + sourcePoolAddress: sourceTokenData.sourcePoolAddress, + sourcePoolData: sourceTokenData.extraData, + offchainTokenData: offchainTokenData + }) + ); + } +} + +contract USDCTokenPool_supportsInterface is USDCTokenPoolSetup { + function test_SupportsInterface_Success() public view { + assertTrue(s_usdcTokenPool.supportsInterface(type(IPoolV1).interfaceId)); + assertTrue(s_usdcTokenPool.supportsInterface(type(IERC165).interfaceId)); + } +} + +contract USDCTokenPool_setDomains is USDCTokenPoolSetup { + mapping(uint64 destChainSelector => USDCTokenPool.Domain domain) private s_chainToDomain; + + // Setting lower fuzz run as 256 runs was causing differing gas results in snapshot. + /// forge-config: default.fuzz.runs = 32 + /// forge-config: ccip.fuzz.runs = 32 + function test_Fuzz_SetDomains_Success( + bytes32[5] calldata allowedCallers, + uint32[5] calldata domainIdentifiers, + uint64[5] calldata destChainSelectors + ) public { + uint256 numberOfDomains = allowedCallers.length; + USDCTokenPool.DomainUpdate[] memory domainUpdates = new USDCTokenPool.DomainUpdate[](numberOfDomains); + for (uint256 i = 0; i < numberOfDomains; ++i) { + vm.assume(allowedCallers[i] != bytes32(0) && domainIdentifiers[i] != 0 && destChainSelectors[i] != 0); + + domainUpdates[i] = USDCTokenPool.DomainUpdate({ + allowedCaller: allowedCallers[i], + domainIdentifier: domainIdentifiers[i], + destChainSelector: destChainSelectors[i], + enabled: true + }); + + s_chainToDomain[destChainSelectors[i]] = + USDCTokenPool.Domain({domainIdentifier: domainIdentifiers[i], allowedCaller: allowedCallers[i], enabled: true}); + } + + vm.expectEmit(); + emit USDCTokenPool.DomainsSet(domainUpdates); + + s_usdcTokenPool.setDomains(domainUpdates); + + for (uint256 i = 0; i < numberOfDomains; ++i) { + USDCTokenPool.Domain memory expected = s_chainToDomain[destChainSelectors[i]]; + USDCTokenPool.Domain memory got = s_usdcTokenPool.getDomain(destChainSelectors[i]); + assertEq(got.allowedCaller, expected.allowedCaller); + assertEq(got.domainIdentifier, expected.domainIdentifier); + } + } + + // Reverts + + function test_OnlyOwner_Revert() public { + USDCTokenPool.DomainUpdate[] memory domainUpdates = new USDCTokenPool.DomainUpdate[](0); + + vm.startPrank(STRANGER); + vm.expectRevert("Only callable by owner"); + + s_usdcTokenPool.setDomains(domainUpdates); + } + + function test_InvalidDomain_Revert() public { + bytes32 validCaller = bytes32(uint256(25)); + // Ensure valid domain works + USDCTokenPool.DomainUpdate[] memory domainUpdates = new USDCTokenPool.DomainUpdate[](1); + domainUpdates[0] = USDCTokenPool.DomainUpdate({ + allowedCaller: validCaller, + domainIdentifier: 0, // ensures 0 is valid, as this is eth mainnet + destChainSelector: 45690, + enabled: true + }); + + s_usdcTokenPool.setDomains(domainUpdates); + + // Make update invalid on allowedCaller + domainUpdates[0].allowedCaller = bytes32(0); + vm.expectRevert(abi.encodeWithSelector(USDCTokenPool.InvalidDomain.selector, domainUpdates[0])); + + s_usdcTokenPool.setDomains(domainUpdates); + + // Make valid again + domainUpdates[0].allowedCaller = validCaller; + + // Make invalid on destChainSelector + domainUpdates[0].destChainSelector = 0; + vm.expectRevert(abi.encodeWithSelector(USDCTokenPool.InvalidDomain.selector, domainUpdates[0])); + + s_usdcTokenPool.setDomains(domainUpdates); + } +} + +contract USDCTokenPool__validateMessage is USDCTokenPoolSetup { + function test_Fuzz_ValidateMessage_Success(uint32 sourceDomain, uint64 nonce) public { + vm.pauseGasMetering(); + USDCMessage memory usdcMessage = USDCMessage({ + version: 0, + sourceDomain: sourceDomain, + destinationDomain: DEST_DOMAIN_IDENTIFIER, + nonce: nonce, + sender: SOURCE_CHAIN_TOKEN_SENDER, + recipient: bytes32(uint256(299999)), + destinationCaller: bytes32(uint256(uint160(address(s_usdcTokenPool)))), + messageBody: bytes("") + }); + + bytes memory encodedUsdcMessage = _generateUSDCMessage(usdcMessage); + + vm.resumeGasMetering(); + s_usdcTokenPool.validateMessage( + encodedUsdcMessage, USDCTokenPool.SourceTokenDataPayload({nonce: nonce, sourceDomain: sourceDomain}) + ); + } + + // Reverts + + function test_ValidateInvalidMessage_Revert() public { + USDCMessage memory usdcMessage = USDCMessage({ + version: 0, + sourceDomain: 1553252, + destinationDomain: DEST_DOMAIN_IDENTIFIER, + nonce: 387289284924, + sender: SOURCE_CHAIN_TOKEN_SENDER, + recipient: bytes32(uint256(92398429395823)), + destinationCaller: bytes32(uint256(uint160(address(s_usdcTokenPool)))), + messageBody: bytes("") + }); + + USDCTokenPool.SourceTokenDataPayload memory sourceTokenData = + USDCTokenPool.SourceTokenDataPayload({nonce: usdcMessage.nonce, sourceDomain: usdcMessage.sourceDomain}); + + bytes memory encodedUsdcMessage = _generateUSDCMessage(usdcMessage); + + s_usdcTokenPool.validateMessage(encodedUsdcMessage, sourceTokenData); + + uint32 expectedSourceDomain = usdcMessage.sourceDomain + 1; + + vm.expectRevert( + abi.encodeWithSelector(USDCTokenPool.InvalidSourceDomain.selector, expectedSourceDomain, usdcMessage.sourceDomain) + ); + s_usdcTokenPool.validateMessage( + encodedUsdcMessage, + USDCTokenPool.SourceTokenDataPayload({nonce: usdcMessage.nonce, sourceDomain: expectedSourceDomain}) + ); + + uint64 expectedNonce = usdcMessage.nonce + 1; + + vm.expectRevert(abi.encodeWithSelector(USDCTokenPool.InvalidNonce.selector, expectedNonce, usdcMessage.nonce)); + s_usdcTokenPool.validateMessage( + encodedUsdcMessage, + USDCTokenPool.SourceTokenDataPayload({nonce: expectedNonce, sourceDomain: usdcMessage.sourceDomain}) + ); + + usdcMessage.destinationDomain = DEST_DOMAIN_IDENTIFIER + 1; + vm.expectRevert( + abi.encodeWithSelector( + USDCTokenPool.InvalidDestinationDomain.selector, DEST_DOMAIN_IDENTIFIER, usdcMessage.destinationDomain + ) + ); + + s_usdcTokenPool.validateMessage( + _generateUSDCMessage(usdcMessage), + USDCTokenPool.SourceTokenDataPayload({nonce: usdcMessage.nonce, sourceDomain: usdcMessage.sourceDomain}) + ); + usdcMessage.destinationDomain = DEST_DOMAIN_IDENTIFIER; + + uint32 wrongVersion = usdcMessage.version + 1; + + usdcMessage.version = wrongVersion; + encodedUsdcMessage = _generateUSDCMessage(usdcMessage); + + vm.expectRevert(abi.encodeWithSelector(USDCTokenPool.InvalidMessageVersion.selector, wrongVersion)); + s_usdcTokenPool.validateMessage(encodedUsdcMessage, sourceTokenData); + } +} diff --git a/contracts/src/v0.8/ccip/test/rateLimiter/AggregateRateLimiter.t.sol b/contracts/src/v0.8/ccip/test/rateLimiter/AggregateRateLimiter.t.sol new file mode 100644 index 00000000000..318821c441b --- /dev/null +++ b/contracts/src/v0.8/ccip/test/rateLimiter/AggregateRateLimiter.t.sol @@ -0,0 +1,235 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {AggregateRateLimiter} from "../../AggregateRateLimiter.sol"; +import {Client} from "../../libraries/Client.sol"; +import {Internal} from "../../libraries/Internal.sol"; +import {RateLimiter} from "../../libraries/RateLimiter.sol"; + +import {FeeQuoterSetup} from "../feeQuoter/FeeQuoterSetup.t.sol"; +import {AggregateRateLimiterHelper} from "../helpers/AggregateRateLimiterHelper.sol"; + +import {stdError} from "forge-std/Test.sol"; + +contract AggregateTokenLimiterSetup is FeeQuoterSetup { + AggregateRateLimiterHelper internal s_rateLimiter; + RateLimiter.Config internal s_config; + + address internal immutable TOKEN = 0x21118E64E1fB0c487F25Dd6d3601FF6af8D32E4e; + uint224 internal constant TOKEN_PRICE = 4e18; + + function setUp() public virtual override { + FeeQuoterSetup.setUp(); + + Internal.PriceUpdates memory priceUpdates = _getSingleTokenPriceUpdateStruct(TOKEN, TOKEN_PRICE); + s_feeQuoter.updatePrices(priceUpdates); + + s_config = RateLimiter.Config({isEnabled: true, rate: 5, capacity: 100}); + s_rateLimiter = new AggregateRateLimiterHelper(s_config); + s_rateLimiter.setAdmin(ADMIN); + } +} + +contract AggregateTokenLimiter_constructor is AggregateTokenLimiterSetup { + function test_Constructor_Success() public view { + assertEq(ADMIN, s_rateLimiter.getTokenLimitAdmin()); + assertEq(OWNER, s_rateLimiter.owner()); + + RateLimiter.TokenBucket memory bucket = s_rateLimiter.currentRateLimiterState(); + assertEq(s_config.rate, bucket.rate); + assertEq(s_config.capacity, bucket.capacity); + assertEq(s_config.capacity, bucket.tokens); + assertEq(s_config.isEnabled, bucket.isEnabled); + assertEq(BLOCK_TIME, bucket.lastUpdated); + } +} + +contract AggregateTokenLimiter_getTokenLimitAdmin is AggregateTokenLimiterSetup { + function test_GetTokenLimitAdmin_Success() public view { + assertEq(ADMIN, s_rateLimiter.getTokenLimitAdmin()); + } +} + +contract AggregateTokenLimiter_setAdmin is AggregateTokenLimiterSetup { + function test_Owner_Success() public { + vm.expectEmit(); + emit AggregateRateLimiter.AdminSet(STRANGER); + + s_rateLimiter.setAdmin(STRANGER); + assertEq(STRANGER, s_rateLimiter.getTokenLimitAdmin()); + } + + // Reverts + + function test_OnlyOwnerOrAdmin_Revert() public { + vm.startPrank(STRANGER); + vm.expectRevert(RateLimiter.OnlyCallableByAdminOrOwner.selector); + + s_rateLimiter.setAdmin(STRANGER); + } +} + +contract AggregateTokenLimiter_getTokenBucket is AggregateTokenLimiterSetup { + function test_GetTokenBucket_Success() public view { + RateLimiter.TokenBucket memory bucket = s_rateLimiter.currentRateLimiterState(); + assertEq(s_config.rate, bucket.rate); + assertEq(s_config.capacity, bucket.capacity); + assertEq(s_config.capacity, bucket.tokens); + assertEq(BLOCK_TIME, bucket.lastUpdated); + } + + function test_Refill_Success() public { + s_config.capacity = s_config.capacity * 2; + s_rateLimiter.setRateLimiterConfig(s_config); + + RateLimiter.TokenBucket memory bucket = s_rateLimiter.currentRateLimiterState(); + + assertEq(s_config.rate, bucket.rate); + assertEq(s_config.capacity, bucket.capacity); + assertEq(s_config.capacity / 2, bucket.tokens); + assertEq(BLOCK_TIME, bucket.lastUpdated); + + uint256 warpTime = 4; + vm.warp(BLOCK_TIME + warpTime); + + bucket = s_rateLimiter.currentRateLimiterState(); + + assertEq(s_config.rate, bucket.rate); + assertEq(s_config.capacity, bucket.capacity); + assertEq(s_config.capacity / 2 + warpTime * s_config.rate, bucket.tokens); + assertEq(BLOCK_TIME + warpTime, bucket.lastUpdated); + + vm.warp(BLOCK_TIME + warpTime * 100); + + // Bucket overflow + bucket = s_rateLimiter.currentRateLimiterState(); + assertEq(s_config.capacity, bucket.tokens); + } + + // Reverts + + function test_TimeUnderflow_Revert() public { + vm.warp(BLOCK_TIME - 1); + + vm.expectRevert(stdError.arithmeticError); + s_rateLimiter.currentRateLimiterState(); + } +} + +contract AggregateTokenLimiter_setRateLimiterConfig is AggregateTokenLimiterSetup { + function test_Owner_Success() public { + setConfig(); + } + + function test_TokenLimitAdmin_Success() public { + vm.startPrank(ADMIN); + setConfig(); + } + + function setConfig() private { + RateLimiter.TokenBucket memory bucket = s_rateLimiter.currentRateLimiterState(); + assertEq(s_config.rate, bucket.rate); + assertEq(s_config.capacity, bucket.capacity); + + if (bucket.isEnabled) { + s_config = RateLimiter.Config({isEnabled: false, rate: 0, capacity: 0}); + } else { + s_config = RateLimiter.Config({isEnabled: true, rate: 100, capacity: 200}); + } + + vm.expectEmit(); + emit RateLimiter.ConfigChanged(s_config); + + s_rateLimiter.setRateLimiterConfig(s_config); + + bucket = s_rateLimiter.currentRateLimiterState(); + assertEq(s_config.rate, bucket.rate); + assertEq(s_config.capacity, bucket.capacity); + assertEq(s_config.isEnabled, bucket.isEnabled); + } + + // Reverts + + function test_OnlyOnlyCallableByAdminOrOwner_Revert() public { + vm.startPrank(STRANGER); + + vm.expectRevert(RateLimiter.OnlyCallableByAdminOrOwner.selector); + + s_rateLimiter.setRateLimiterConfig(s_config); + } +} + +contract AggregateTokenLimiter_rateLimitValue is AggregateTokenLimiterSetup { + function test_RateLimitValueSuccess_gas() public { + vm.pauseGasMetering(); + // start from blocktime that does not equal rate limiter init timestamp + vm.warp(BLOCK_TIME + 1); + + // 15 (tokens) * 4 (price) * 2 (number of times) > 100 (capacity) + uint256 numberOfTokens = 15; + uint256 value = (numberOfTokens * TOKEN_PRICE) / 1e18; + + vm.expectEmit(); + emit RateLimiter.TokensConsumed(value); + + vm.resumeGasMetering(); + s_rateLimiter.rateLimitValue(value); + vm.pauseGasMetering(); + + // Get the updated bucket status + RateLimiter.TokenBucket memory bucket = s_rateLimiter.currentRateLimiterState(); + // Assert the proper value has been taken out of the bucket + assertEq(bucket.capacity - value, bucket.tokens); + + // Since value * 2 > bucket.capacity we cannot take it out twice. + // Expect a revert when we try, with a wait time. + uint256 waitTime = 4; + vm.expectRevert( + abi.encodeWithSelector(RateLimiter.AggregateValueRateLimitReached.selector, waitTime, bucket.tokens) + ); + s_rateLimiter.rateLimitValue(value); + + // Move the block time forward by 10 so the bucket refills by 10 * rate + vm.warp(BLOCK_TIME + 1 + waitTime); + + // The bucket has filled up enough so we can take out more tokens + s_rateLimiter.rateLimitValue(value); + bucket = s_rateLimiter.currentRateLimiterState(); + assertEq(bucket.capacity - value + waitTime * s_config.rate - value, bucket.tokens); + vm.resumeGasMetering(); + } + + // Reverts + + function test_AggregateValueMaxCapacityExceeded_Revert() public { + RateLimiter.TokenBucket memory bucket = s_rateLimiter.currentRateLimiterState(); + + uint256 numberOfTokens = 100; + uint256 value = (numberOfTokens * TOKEN_PRICE) / 1e18; + + vm.expectRevert( + abi.encodeWithSelector( + RateLimiter.AggregateValueMaxCapacityExceeded.selector, bucket.capacity, (numberOfTokens * TOKEN_PRICE) / 1e18 + ) + ); + s_rateLimiter.rateLimitValue(value); + } +} + +contract AggregateTokenLimiter_getTokenValue is AggregateTokenLimiterSetup { + function test_GetTokenValue_Success() public view { + uint256 numberOfTokens = 10; + Client.EVMTokenAmount memory tokenAmount = Client.EVMTokenAmount({token: TOKEN, amount: 10}); + uint256 value = s_rateLimiter.getTokenValue(tokenAmount, s_feeQuoter); + assertEq(value, (numberOfTokens * TOKEN_PRICE) / 1e18); + } + + // Reverts + function test_NoTokenPrice_Reverts() public { + address tokenWithNoPrice = makeAddr("Token with no price"); + Client.EVMTokenAmount memory tokenAmount = Client.EVMTokenAmount({token: tokenWithNoPrice, amount: 10}); + + vm.expectRevert(abi.encodeWithSelector(AggregateRateLimiter.PriceNotFoundForToken.selector, tokenWithNoPrice)); + s_rateLimiter.getTokenValue(tokenAmount, s_feeQuoter); + } +} diff --git a/contracts/src/v0.8/ccip/test/rateLimiter/MultiAggregateRateLimiter.t.sol b/contracts/src/v0.8/ccip/test/rateLimiter/MultiAggregateRateLimiter.t.sol new file mode 100644 index 00000000000..a7d73cc8b37 --- /dev/null +++ b/contracts/src/v0.8/ccip/test/rateLimiter/MultiAggregateRateLimiter.t.sol @@ -0,0 +1,1196 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {AuthorizedCallers} from "../../../shared/access/AuthorizedCallers.sol"; +import {MultiAggregateRateLimiter} from "../../MultiAggregateRateLimiter.sol"; +import {Client} from "../../libraries/Client.sol"; +import {Internal} from "../../libraries/Internal.sol"; +import {RateLimiter} from "../../libraries/RateLimiter.sol"; +import {BaseTest} from "../BaseTest.t.sol"; + +import {FeeQuoterSetup} from "../feeQuoter/FeeQuoterSetup.t.sol"; +import {MultiAggregateRateLimiterHelper} from "../helpers/MultiAggregateRateLimiterHelper.sol"; +import {stdError} from "forge-std/Test.sol"; +import {Vm} from "forge-std/Vm.sol"; + +contract MultiAggregateRateLimiterSetup is BaseTest, FeeQuoterSetup { + MultiAggregateRateLimiterHelper internal s_rateLimiter; + + address internal immutable TOKEN = 0x21118E64E1fB0c487F25Dd6d3601FF6af8D32E4e; + uint224 internal constant TOKEN_PRICE = 4e18; + + uint64 internal constant CHAIN_SELECTOR_1 = 5009297550715157269; + uint64 internal constant CHAIN_SELECTOR_2 = 4949039107694359620; + + RateLimiter.Config internal RATE_LIMITER_CONFIG_1 = RateLimiter.Config({isEnabled: true, rate: 5, capacity: 100}); + RateLimiter.Config internal RATE_LIMITER_CONFIG_2 = RateLimiter.Config({isEnabled: true, rate: 10, capacity: 200}); + + address internal immutable MOCK_OFFRAMP = address(1111); + address internal immutable MOCK_ONRAMP = address(1112); + + address[] internal s_authorizedCallers; + + function setUp() public virtual override(BaseTest, FeeQuoterSetup) { + BaseTest.setUp(); + FeeQuoterSetup.setUp(); + + Internal.PriceUpdates memory priceUpdates = _getSingleTokenPriceUpdateStruct(TOKEN, TOKEN_PRICE); + s_feeQuoter.updatePrices(priceUpdates); + + MultiAggregateRateLimiter.RateLimiterConfigArgs[] memory configUpdates = + new MultiAggregateRateLimiter.RateLimiterConfigArgs[](4); + configUpdates[0] = MultiAggregateRateLimiter.RateLimiterConfigArgs({ + remoteChainSelector: CHAIN_SELECTOR_1, + isOutboundLane: false, + rateLimiterConfig: RATE_LIMITER_CONFIG_1 + }); + configUpdates[1] = MultiAggregateRateLimiter.RateLimiterConfigArgs({ + remoteChainSelector: CHAIN_SELECTOR_2, + isOutboundLane: false, + rateLimiterConfig: RATE_LIMITER_CONFIG_2 + }); + configUpdates[2] = MultiAggregateRateLimiter.RateLimiterConfigArgs({ + remoteChainSelector: CHAIN_SELECTOR_1, + isOutboundLane: true, + rateLimiterConfig: RATE_LIMITER_CONFIG_1 + }); + configUpdates[3] = MultiAggregateRateLimiter.RateLimiterConfigArgs({ + remoteChainSelector: CHAIN_SELECTOR_2, + isOutboundLane: true, + rateLimiterConfig: RATE_LIMITER_CONFIG_2 + }); + + s_authorizedCallers = new address[](2); + s_authorizedCallers[0] = MOCK_OFFRAMP; + s_authorizedCallers[1] = MOCK_ONRAMP; + + s_rateLimiter = new MultiAggregateRateLimiterHelper(address(s_feeQuoter), s_authorizedCallers); + s_rateLimiter.applyRateLimiterConfigUpdates(configUpdates); + } + + function _assertConfigWithTokenBucketEquality( + RateLimiter.Config memory config, + RateLimiter.TokenBucket memory tokenBucket + ) internal pure { + assertEq(config.rate, tokenBucket.rate); + assertEq(config.capacity, tokenBucket.capacity); + assertEq(config.capacity, tokenBucket.tokens); + assertEq(config.isEnabled, tokenBucket.isEnabled); + } + + function _assertTokenBucketEquality( + RateLimiter.TokenBucket memory tokenBucketA, + RateLimiter.TokenBucket memory tokenBucketB + ) internal pure { + assertEq(tokenBucketA.rate, tokenBucketB.rate); + assertEq(tokenBucketA.capacity, tokenBucketB.capacity); + assertEq(tokenBucketA.tokens, tokenBucketB.tokens); + assertEq(tokenBucketA.isEnabled, tokenBucketB.isEnabled); + } + + function _generateAny2EVMMessage( + uint64 sourceChainSelector, + Client.EVMTokenAmount[] memory tokenAmounts + ) internal pure returns (Client.Any2EVMMessage memory) { + return Client.Any2EVMMessage({ + messageId: keccak256(bytes("messageId")), + sourceChainSelector: sourceChainSelector, + sender: abi.encode(OWNER), + data: abi.encode(0), + destTokenAmounts: tokenAmounts + }); + } + + function _generateAny2EVMMessageNoTokens( + uint64 sourceChainSelector + ) internal pure returns (Client.Any2EVMMessage memory) { + return _generateAny2EVMMessage(sourceChainSelector, new Client.EVMTokenAmount[](0)); + } +} + +contract MultiAggregateRateLimiter_constructor is MultiAggregateRateLimiterSetup { + function test_ConstructorNoAuthorizedCallers_Success() public { + address[] memory authorizedCallers = new address[](0); + + vm.recordLogs(); + s_rateLimiter = new MultiAggregateRateLimiterHelper(address(s_feeQuoter), authorizedCallers); + + // FeeQuoterSet + Vm.Log[] memory logEntries = vm.getRecordedLogs(); + assertEq(logEntries.length, 1); + + assertEq(OWNER, s_rateLimiter.owner()); + assertEq(address(s_feeQuoter), s_rateLimiter.getFeeQuoter()); + } + + function test_Constructor_Success() public { + address[] memory authorizedCallers = new address[](2); + authorizedCallers[0] = MOCK_OFFRAMP; + authorizedCallers[1] = MOCK_ONRAMP; + + vm.expectEmit(); + emit MultiAggregateRateLimiter.FeeQuoterSet(address(s_feeQuoter)); + + s_rateLimiter = new MultiAggregateRateLimiterHelper(address(s_feeQuoter), authorizedCallers); + + assertEq(OWNER, s_rateLimiter.owner()); + assertEq(address(s_feeQuoter), s_rateLimiter.getFeeQuoter()); + assertEq(s_rateLimiter.typeAndVersion(), "MultiAggregateRateLimiter 1.6.0-dev"); + } +} + +contract MultiAggregateRateLimiter_setFeeQuoter is MultiAggregateRateLimiterSetup { + function test_Owner_Success() public { + address newAddress = address(42); + + vm.expectEmit(); + emit MultiAggregateRateLimiter.FeeQuoterSet(newAddress); + + s_rateLimiter.setFeeQuoter(newAddress); + assertEq(newAddress, s_rateLimiter.getFeeQuoter()); + } + + // Reverts + + function test_OnlyOwner_Revert() public { + vm.startPrank(STRANGER); + vm.expectRevert(bytes("Only callable by owner")); + + s_rateLimiter.setFeeQuoter(STRANGER); + } + + function test_ZeroAddress_Revert() public { + vm.expectRevert(AuthorizedCallers.ZeroAddressNotAllowed.selector); + s_rateLimiter.setFeeQuoter(address(0)); + } +} + +contract MultiAggregateRateLimiter_getTokenBucket is MultiAggregateRateLimiterSetup { + function test_GetTokenBucket_Success() public view { + RateLimiter.TokenBucket memory bucketInbound = s_rateLimiter.currentRateLimiterState(CHAIN_SELECTOR_1, false); + _assertConfigWithTokenBucketEquality(RATE_LIMITER_CONFIG_1, bucketInbound); + assertEq(BLOCK_TIME, bucketInbound.lastUpdated); + + RateLimiter.TokenBucket memory bucketOutbound = s_rateLimiter.currentRateLimiterState(CHAIN_SELECTOR_1, true); + _assertConfigWithTokenBucketEquality(RATE_LIMITER_CONFIG_1, bucketOutbound); + assertEq(BLOCK_TIME, bucketOutbound.lastUpdated); + } + + function test_Refill_Success() public { + RATE_LIMITER_CONFIG_1.capacity = RATE_LIMITER_CONFIG_1.capacity * 2; + + MultiAggregateRateLimiter.RateLimiterConfigArgs[] memory configUpdates = + new MultiAggregateRateLimiter.RateLimiterConfigArgs[](1); + configUpdates[0] = MultiAggregateRateLimiter.RateLimiterConfigArgs({ + remoteChainSelector: CHAIN_SELECTOR_1, + isOutboundLane: false, + rateLimiterConfig: RATE_LIMITER_CONFIG_1 + }); + + s_rateLimiter.applyRateLimiterConfigUpdates(configUpdates); + + RateLimiter.TokenBucket memory bucket = s_rateLimiter.currentRateLimiterState(CHAIN_SELECTOR_1, false); + + assertEq(RATE_LIMITER_CONFIG_1.rate, bucket.rate); + assertEq(RATE_LIMITER_CONFIG_1.capacity, bucket.capacity); + assertEq(RATE_LIMITER_CONFIG_1.capacity / 2, bucket.tokens); + assertEq(BLOCK_TIME, bucket.lastUpdated); + + uint256 warpTime = 4; + vm.warp(BLOCK_TIME + warpTime); + + bucket = s_rateLimiter.currentRateLimiterState(CHAIN_SELECTOR_1, false); + + assertEq(RATE_LIMITER_CONFIG_1.rate, bucket.rate); + assertEq(RATE_LIMITER_CONFIG_1.capacity, bucket.capacity); + assertEq(RATE_LIMITER_CONFIG_1.capacity / 2 + warpTime * RATE_LIMITER_CONFIG_1.rate, bucket.tokens); + assertEq(BLOCK_TIME + warpTime, bucket.lastUpdated); + + vm.warp(BLOCK_TIME + warpTime * 100); + + // Bucket overflow + bucket = s_rateLimiter.currentRateLimiterState(CHAIN_SELECTOR_1, false); + assertEq(RATE_LIMITER_CONFIG_1.capacity, bucket.tokens); + } + + // Reverts + + function test_TimeUnderflow_Revert() public { + vm.warp(BLOCK_TIME - 1); + + vm.expectRevert(stdError.arithmeticError); + s_rateLimiter.currentRateLimiterState(CHAIN_SELECTOR_1, false); + } +} + +contract MultiAggregateRateLimiter_applyRateLimiterConfigUpdates is MultiAggregateRateLimiterSetup { + function test_ZeroConfigs_Success() public { + MultiAggregateRateLimiter.RateLimiterConfigArgs[] memory configUpdates = + new MultiAggregateRateLimiter.RateLimiterConfigArgs[](0); + + vm.recordLogs(); + s_rateLimiter.applyRateLimiterConfigUpdates(configUpdates); + + Vm.Log[] memory logEntries = vm.getRecordedLogs(); + assertEq(logEntries.length, 0); + } + + function test_SingleConfig_Success() public { + MultiAggregateRateLimiter.RateLimiterConfigArgs[] memory configUpdates = + new MultiAggregateRateLimiter.RateLimiterConfigArgs[](1); + configUpdates[0] = MultiAggregateRateLimiter.RateLimiterConfigArgs({ + remoteChainSelector: CHAIN_SELECTOR_1 + 1, + isOutboundLane: false, + rateLimiterConfig: RATE_LIMITER_CONFIG_1 + }); + + vm.expectEmit(); + emit MultiAggregateRateLimiter.RateLimiterConfigUpdated( + configUpdates[0].remoteChainSelector, false, configUpdates[0].rateLimiterConfig + ); + + vm.recordLogs(); + s_rateLimiter.applyRateLimiterConfigUpdates(configUpdates); + + Vm.Log[] memory logEntries = vm.getRecordedLogs(); + assertEq(logEntries.length, 1); + + RateLimiter.TokenBucket memory bucket1 = + s_rateLimiter.currentRateLimiterState(configUpdates[0].remoteChainSelector, false); + _assertConfigWithTokenBucketEquality(configUpdates[0].rateLimiterConfig, bucket1); + assertEq(BLOCK_TIME, bucket1.lastUpdated); + } + + function test_SingleConfigOutbound_Success() public { + MultiAggregateRateLimiter.RateLimiterConfigArgs[] memory configUpdates = + new MultiAggregateRateLimiter.RateLimiterConfigArgs[](1); + configUpdates[0] = MultiAggregateRateLimiter.RateLimiterConfigArgs({ + remoteChainSelector: CHAIN_SELECTOR_1 + 1, + isOutboundLane: true, + rateLimiterConfig: RATE_LIMITER_CONFIG_2 + }); + + vm.expectEmit(); + emit MultiAggregateRateLimiter.RateLimiterConfigUpdated( + configUpdates[0].remoteChainSelector, true, configUpdates[0].rateLimiterConfig + ); + + vm.recordLogs(); + s_rateLimiter.applyRateLimiterConfigUpdates(configUpdates); + + Vm.Log[] memory logEntries = vm.getRecordedLogs(); + assertEq(logEntries.length, 1); + + RateLimiter.TokenBucket memory bucket1 = + s_rateLimiter.currentRateLimiterState(configUpdates[0].remoteChainSelector, true); + _assertConfigWithTokenBucketEquality(configUpdates[0].rateLimiterConfig, bucket1); + assertEq(BLOCK_TIME, bucket1.lastUpdated); + } + + function test_MultipleConfigs_Success() public { + MultiAggregateRateLimiter.RateLimiterConfigArgs[] memory configUpdates = + new MultiAggregateRateLimiter.RateLimiterConfigArgs[](5); + + for (uint64 i; i < configUpdates.length; ++i) { + configUpdates[i] = MultiAggregateRateLimiter.RateLimiterConfigArgs({ + remoteChainSelector: CHAIN_SELECTOR_1 + i + 1, + isOutboundLane: i % 2 == 0 ? false : true, + rateLimiterConfig: RateLimiter.Config({isEnabled: true, rate: 5 + i, capacity: 100 + i}) + }); + + vm.expectEmit(); + emit MultiAggregateRateLimiter.RateLimiterConfigUpdated( + configUpdates[i].remoteChainSelector, configUpdates[i].isOutboundLane, configUpdates[i].rateLimiterConfig + ); + } + + vm.recordLogs(); + s_rateLimiter.applyRateLimiterConfigUpdates(configUpdates); + + Vm.Log[] memory logEntries = vm.getRecordedLogs(); + assertEq(logEntries.length, configUpdates.length); + + for (uint256 i; i < configUpdates.length; ++i) { + RateLimiter.TokenBucket memory bucket = + s_rateLimiter.currentRateLimiterState(configUpdates[i].remoteChainSelector, configUpdates[i].isOutboundLane); + _assertConfigWithTokenBucketEquality(configUpdates[i].rateLimiterConfig, bucket); + assertEq(BLOCK_TIME, bucket.lastUpdated); + } + } + + function test_MultipleConfigsBothLanes_Success() public { + MultiAggregateRateLimiter.RateLimiterConfigArgs[] memory configUpdates = + new MultiAggregateRateLimiter.RateLimiterConfigArgs[](2); + + for (uint64 i; i < configUpdates.length; ++i) { + configUpdates[i] = MultiAggregateRateLimiter.RateLimiterConfigArgs({ + remoteChainSelector: CHAIN_SELECTOR_1 + 1, + isOutboundLane: i % 2 == 0 ? false : true, + rateLimiterConfig: RateLimiter.Config({isEnabled: true, rate: 5 + i, capacity: 100 + i}) + }); + + vm.expectEmit(); + emit MultiAggregateRateLimiter.RateLimiterConfigUpdated( + configUpdates[i].remoteChainSelector, configUpdates[i].isOutboundLane, configUpdates[i].rateLimiterConfig + ); + } + + vm.recordLogs(); + s_rateLimiter.applyRateLimiterConfigUpdates(configUpdates); + + Vm.Log[] memory logEntries = vm.getRecordedLogs(); + assertEq(logEntries.length, configUpdates.length); + + for (uint256 i; i < configUpdates.length; ++i) { + RateLimiter.TokenBucket memory bucket = + s_rateLimiter.currentRateLimiterState(configUpdates[i].remoteChainSelector, configUpdates[i].isOutboundLane); + _assertConfigWithTokenBucketEquality(configUpdates[i].rateLimiterConfig, bucket); + assertEq(BLOCK_TIME, bucket.lastUpdated); + } + } + + function test_UpdateExistingConfig_Success() public { + MultiAggregateRateLimiter.RateLimiterConfigArgs[] memory configUpdates = + new MultiAggregateRateLimiter.RateLimiterConfigArgs[](1); + configUpdates[0] = MultiAggregateRateLimiter.RateLimiterConfigArgs({ + remoteChainSelector: CHAIN_SELECTOR_1, + isOutboundLane: false, + rateLimiterConfig: RATE_LIMITER_CONFIG_2 + }); + + RateLimiter.TokenBucket memory bucket1 = + s_rateLimiter.currentRateLimiterState(configUpdates[0].remoteChainSelector, false); + + // Capacity equals tokens + assertEq(bucket1.capacity, bucket1.tokens); + + vm.expectEmit(); + emit MultiAggregateRateLimiter.RateLimiterConfigUpdated( + configUpdates[0].remoteChainSelector, false, configUpdates[0].rateLimiterConfig + ); + + vm.recordLogs(); + s_rateLimiter.applyRateLimiterConfigUpdates(configUpdates); + + vm.warp(BLOCK_TIME + 1); + bucket1 = s_rateLimiter.currentRateLimiterState(configUpdates[0].remoteChainSelector, false); + assertEq(BLOCK_TIME + 1, bucket1.lastUpdated); + + // Tokens < capacity since capacity doubled + assertTrue(bucket1.capacity != bucket1.tokens); + + // Outbound lane config remains unchanged + _assertConfigWithTokenBucketEquality( + RATE_LIMITER_CONFIG_1, s_rateLimiter.currentRateLimiterState(CHAIN_SELECTOR_1, true) + ); + } + + function test_UpdateExistingConfigWithNoDifference_Success() public { + MultiAggregateRateLimiter.RateLimiterConfigArgs[] memory configUpdates = + new MultiAggregateRateLimiter.RateLimiterConfigArgs[](1); + configUpdates[0] = MultiAggregateRateLimiter.RateLimiterConfigArgs({ + remoteChainSelector: CHAIN_SELECTOR_1, + isOutboundLane: false, + rateLimiterConfig: RATE_LIMITER_CONFIG_1 + }); + + RateLimiter.TokenBucket memory bucketPreUpdate = + s_rateLimiter.currentRateLimiterState(configUpdates[0].remoteChainSelector, false); + + vm.expectEmit(); + emit MultiAggregateRateLimiter.RateLimiterConfigUpdated( + configUpdates[0].remoteChainSelector, false, configUpdates[0].rateLimiterConfig + ); + + vm.recordLogs(); + s_rateLimiter.applyRateLimiterConfigUpdates(configUpdates); + + vm.warp(BLOCK_TIME + 1); + RateLimiter.TokenBucket memory bucketPostUpdate = + s_rateLimiter.currentRateLimiterState(configUpdates[0].remoteChainSelector, false); + _assertTokenBucketEquality(bucketPreUpdate, bucketPostUpdate); + assertEq(BLOCK_TIME + 1, bucketPostUpdate.lastUpdated); + } + + // Reverts + function test_ZeroChainSelector_Revert() public { + MultiAggregateRateLimiter.RateLimiterConfigArgs[] memory configUpdates = + new MultiAggregateRateLimiter.RateLimiterConfigArgs[](1); + configUpdates[0] = MultiAggregateRateLimiter.RateLimiterConfigArgs({ + remoteChainSelector: 0, + isOutboundLane: false, + rateLimiterConfig: RATE_LIMITER_CONFIG_1 + }); + + vm.expectRevert(MultiAggregateRateLimiter.ZeroChainSelectorNotAllowed.selector); + s_rateLimiter.applyRateLimiterConfigUpdates(configUpdates); + } + + function test_OnlyCallableByOwner_Revert() public { + MultiAggregateRateLimiter.RateLimiterConfigArgs[] memory configUpdates = + new MultiAggregateRateLimiter.RateLimiterConfigArgs[](1); + configUpdates[0] = MultiAggregateRateLimiter.RateLimiterConfigArgs({ + remoteChainSelector: CHAIN_SELECTOR_1 + 1, + isOutboundLane: false, + rateLimiterConfig: RATE_LIMITER_CONFIG_1 + }); + vm.startPrank(STRANGER); + + vm.expectRevert(bytes("Only callable by owner")); + s_rateLimiter.applyRateLimiterConfigUpdates(configUpdates); + } +} + +contract MultiAggregateRateLimiter_getTokenValue is MultiAggregateRateLimiterSetup { + function test_GetTokenValue_Success() public view { + uint256 numberOfTokens = 10; + Client.EVMTokenAmount memory tokenAmount = Client.EVMTokenAmount({token: TOKEN, amount: 10}); + uint256 value = s_rateLimiter.getTokenValue(tokenAmount); + assertEq(value, (numberOfTokens * TOKEN_PRICE) / 1e18); + } + + // Reverts + function test_NoTokenPrice_Reverts() public { + address tokenWithNoPrice = makeAddr("Token with no price"); + Client.EVMTokenAmount memory tokenAmount = Client.EVMTokenAmount({token: tokenWithNoPrice, amount: 10}); + + vm.expectRevert(abi.encodeWithSelector(MultiAggregateRateLimiter.PriceNotFoundForToken.selector, tokenWithNoPrice)); + s_rateLimiter.getTokenValue(tokenAmount); + } +} + +contract MultiAggregateRateLimiter_updateRateLimitTokens is MultiAggregateRateLimiterSetup { + function setUp() public virtual override { + super.setUp(); + + // Clear rate limit tokens state + MultiAggregateRateLimiter.LocalRateLimitToken[] memory removes = + new MultiAggregateRateLimiter.LocalRateLimitToken[](s_sourceTokens.length); + for (uint256 i = 0; i < s_sourceTokens.length; ++i) { + removes[i] = MultiAggregateRateLimiter.LocalRateLimitToken({ + remoteChainSelector: CHAIN_SELECTOR_1, + localToken: s_destTokens[i] + }); + } + s_rateLimiter.updateRateLimitTokens(removes, new MultiAggregateRateLimiter.RateLimitTokenArgs[](0)); + } + + function test_UpdateRateLimitTokensSingleChain_Success() public { + MultiAggregateRateLimiter.RateLimitTokenArgs[] memory adds = new MultiAggregateRateLimiter.RateLimitTokenArgs[](2); + adds[0] = MultiAggregateRateLimiter.RateLimitTokenArgs({ + localTokenArgs: MultiAggregateRateLimiter.LocalRateLimitToken({ + remoteChainSelector: CHAIN_SELECTOR_1, + localToken: s_destTokens[0] + }), + remoteToken: abi.encode(s_sourceTokens[0]) + }); + adds[1] = MultiAggregateRateLimiter.RateLimitTokenArgs({ + localTokenArgs: MultiAggregateRateLimiter.LocalRateLimitToken({ + remoteChainSelector: CHAIN_SELECTOR_1, + localToken: s_destTokens[1] + }), + remoteToken: abi.encode(s_sourceTokens[1]) + }); + + for (uint256 i = 0; i < adds.length; ++i) { + vm.expectEmit(); + emit MultiAggregateRateLimiter.TokenAggregateRateLimitAdded( + CHAIN_SELECTOR_1, adds[i].remoteToken, adds[i].localTokenArgs.localToken + ); + } + + s_rateLimiter.updateRateLimitTokens(new MultiAggregateRateLimiter.LocalRateLimitToken[](0), adds); + + (address[] memory localTokens, bytes[] memory remoteTokens) = s_rateLimiter.getAllRateLimitTokens(CHAIN_SELECTOR_1); + + assertEq(localTokens.length, adds.length); + assertEq(localTokens.length, remoteTokens.length); + + for (uint256 i = 0; i < adds.length; ++i) { + assertEq(adds[i].remoteToken, remoteTokens[i]); + assertEq(adds[i].localTokenArgs.localToken, localTokens[i]); + } + } + + function test_UpdateRateLimitTokensMultipleChains_Success() public { + MultiAggregateRateLimiter.RateLimitTokenArgs[] memory adds = new MultiAggregateRateLimiter.RateLimitTokenArgs[](2); + adds[0] = MultiAggregateRateLimiter.RateLimitTokenArgs({ + localTokenArgs: MultiAggregateRateLimiter.LocalRateLimitToken({ + remoteChainSelector: CHAIN_SELECTOR_1, + localToken: s_destTokens[0] + }), + remoteToken: abi.encode(s_sourceTokens[0]) + }); + adds[1] = MultiAggregateRateLimiter.RateLimitTokenArgs({ + localTokenArgs: MultiAggregateRateLimiter.LocalRateLimitToken({ + remoteChainSelector: CHAIN_SELECTOR_2, + localToken: s_destTokens[1] + }), + remoteToken: abi.encode(s_sourceTokens[1]) + }); + + for (uint256 i = 0; i < adds.length; ++i) { + vm.expectEmit(); + emit MultiAggregateRateLimiter.TokenAggregateRateLimitAdded( + adds[i].localTokenArgs.remoteChainSelector, adds[i].remoteToken, adds[i].localTokenArgs.localToken + ); + } + + s_rateLimiter.updateRateLimitTokens(new MultiAggregateRateLimiter.LocalRateLimitToken[](0), adds); + + (address[] memory localTokensChain1, bytes[] memory remoteTokensChain1) = + s_rateLimiter.getAllRateLimitTokens(CHAIN_SELECTOR_1); + + assertEq(localTokensChain1.length, 1); + assertEq(localTokensChain1.length, remoteTokensChain1.length); + assertEq(localTokensChain1[0], adds[0].localTokenArgs.localToken); + assertEq(remoteTokensChain1[0], adds[0].remoteToken); + + (address[] memory localTokensChain2, bytes[] memory remoteTokensChain2) = + s_rateLimiter.getAllRateLimitTokens(CHAIN_SELECTOR_2); + + assertEq(localTokensChain2.length, 1); + assertEq(localTokensChain2.length, remoteTokensChain2.length); + assertEq(localTokensChain2[0], adds[1].localTokenArgs.localToken); + assertEq(remoteTokensChain2[0], adds[1].remoteToken); + } + + function test_UpdateRateLimitTokens_AddsAndRemoves_Success() public { + MultiAggregateRateLimiter.RateLimitTokenArgs[] memory adds = new MultiAggregateRateLimiter.RateLimitTokenArgs[](2); + adds[0] = MultiAggregateRateLimiter.RateLimitTokenArgs({ + localTokenArgs: MultiAggregateRateLimiter.LocalRateLimitToken({ + remoteChainSelector: CHAIN_SELECTOR_1, + localToken: s_destTokens[0] + }), + remoteToken: abi.encode(s_sourceTokens[0]) + }); + adds[1] = MultiAggregateRateLimiter.RateLimitTokenArgs({ + localTokenArgs: MultiAggregateRateLimiter.LocalRateLimitToken({ + remoteChainSelector: CHAIN_SELECTOR_1, + localToken: s_destTokens[1] + }), + remoteToken: abi.encode(s_sourceTokens[1]) + }); + + MultiAggregateRateLimiter.LocalRateLimitToken[] memory removes = + new MultiAggregateRateLimiter.LocalRateLimitToken[](1); + removes[0] = adds[0].localTokenArgs; + + for (uint256 i = 0; i < adds.length; ++i) { + vm.expectEmit(); + emit MultiAggregateRateLimiter.TokenAggregateRateLimitAdded( + CHAIN_SELECTOR_1, adds[i].remoteToken, adds[i].localTokenArgs.localToken + ); + } + + s_rateLimiter.updateRateLimitTokens(removes, adds); + + for (uint256 i = 0; i < removes.length; ++i) { + vm.expectEmit(); + emit MultiAggregateRateLimiter.TokenAggregateRateLimitRemoved(CHAIN_SELECTOR_1, removes[i].localToken); + } + + s_rateLimiter.updateRateLimitTokens(removes, new MultiAggregateRateLimiter.RateLimitTokenArgs[](0)); + + (address[] memory localTokens, bytes[] memory remoteTokens) = s_rateLimiter.getAllRateLimitTokens(CHAIN_SELECTOR_1); + + assertEq(1, remoteTokens.length); + assertEq(adds[1].remoteToken, remoteTokens[0]); + + assertEq(1, localTokens.length); + assertEq(adds[1].localTokenArgs.localToken, localTokens[0]); + } + + function test_UpdateRateLimitTokens_RemoveNonExistentToken_Success() public { + MultiAggregateRateLimiter.RateLimitTokenArgs[] memory adds = new MultiAggregateRateLimiter.RateLimitTokenArgs[](0); + + MultiAggregateRateLimiter.LocalRateLimitToken[] memory removes = + new MultiAggregateRateLimiter.LocalRateLimitToken[](1); + removes[0] = MultiAggregateRateLimiter.LocalRateLimitToken({ + remoteChainSelector: CHAIN_SELECTOR_1, + localToken: s_destTokens[0] + }); + + vm.recordLogs(); + s_rateLimiter.updateRateLimitTokens(removes, adds); + + // No event since no remove occurred + Vm.Log[] memory logEntries = vm.getRecordedLogs(); + assertEq(logEntries.length, 0); + + (address[] memory localTokens, bytes[] memory remoteTokens) = s_rateLimiter.getAllRateLimitTokens(CHAIN_SELECTOR_1); + + assertEq(localTokens.length, 0); + assertEq(localTokens.length, remoteTokens.length); + } + + // Reverts + + function test_ZeroSourceToken_Revert() public { + MultiAggregateRateLimiter.RateLimitTokenArgs[] memory adds = new MultiAggregateRateLimiter.RateLimitTokenArgs[](1); + adds[0] = MultiAggregateRateLimiter.RateLimitTokenArgs({ + localTokenArgs: MultiAggregateRateLimiter.LocalRateLimitToken({ + remoteChainSelector: CHAIN_SELECTOR_1, + localToken: s_destTokens[0] + }), + remoteToken: new bytes(0) + }); + + vm.expectRevert(AuthorizedCallers.ZeroAddressNotAllowed.selector); + s_rateLimiter.updateRateLimitTokens(new MultiAggregateRateLimiter.LocalRateLimitToken[](0), adds); + } + + function test_ZeroDestToken_Revert() public { + MultiAggregateRateLimiter.RateLimitTokenArgs[] memory adds = new MultiAggregateRateLimiter.RateLimitTokenArgs[](1); + adds[0] = MultiAggregateRateLimiter.RateLimitTokenArgs({ + localTokenArgs: MultiAggregateRateLimiter.LocalRateLimitToken({ + remoteChainSelector: CHAIN_SELECTOR_1, + localToken: address(0) + }), + remoteToken: abi.encode(s_destTokens[0]) + }); + + vm.expectRevert(AuthorizedCallers.ZeroAddressNotAllowed.selector); + s_rateLimiter.updateRateLimitTokens(new MultiAggregateRateLimiter.LocalRateLimitToken[](0), adds); + } + + function test_NonOwner_Revert() public { + MultiAggregateRateLimiter.RateLimitTokenArgs[] memory adds = new MultiAggregateRateLimiter.RateLimitTokenArgs[](4); + + vm.startPrank(STRANGER); + + vm.expectRevert(bytes("Only callable by owner")); + s_rateLimiter.updateRateLimitTokens(new MultiAggregateRateLimiter.LocalRateLimitToken[](0), adds); + } +} + +contract MultiAggregateRateLimiter_onInboundMessage is MultiAggregateRateLimiterSetup { + address internal immutable MOCK_RECEIVER = address(1113); + + function setUp() public virtual override { + super.setUp(); + + MultiAggregateRateLimiter.RateLimitTokenArgs[] memory tokensToAdd = + new MultiAggregateRateLimiter.RateLimitTokenArgs[](s_sourceTokens.length); + for (uint224 i = 0; i < s_sourceTokens.length; ++i) { + tokensToAdd[i] = MultiAggregateRateLimiter.RateLimitTokenArgs({ + localTokenArgs: MultiAggregateRateLimiter.LocalRateLimitToken({ + remoteChainSelector: CHAIN_SELECTOR_1, + localToken: s_destTokens[i] + }), + remoteToken: abi.encode(s_sourceTokens[i]) + }); + + Internal.PriceUpdates memory priceUpdates = + _getSingleTokenPriceUpdateStruct(s_destTokens[i], TOKEN_PRICE * (i + 1)); + s_feeQuoter.updatePrices(priceUpdates); + } + s_rateLimiter.updateRateLimitTokens(new MultiAggregateRateLimiter.LocalRateLimitToken[](0), tokensToAdd); + } + + function test_ValidateMessageWithNoTokens_Success() public { + vm.startPrank(MOCK_OFFRAMP); + + vm.recordLogs(); + s_rateLimiter.onInboundMessage(_generateAny2EVMMessageNoTokens(CHAIN_SELECTOR_1)); + + // No consumed rate limit events + Vm.Log[] memory logEntries = vm.getRecordedLogs(); + assertEq(logEntries.length, 0); + } + + function test_ValidateMessageWithTokens_Success() public { + vm.startPrank(MOCK_OFFRAMP); + + Client.EVMTokenAmount[] memory tokenAmounts = new Client.EVMTokenAmount[](2); + tokenAmounts[0] = Client.EVMTokenAmount({token: s_destTokens[0], amount: 3}); + tokenAmounts[1] = Client.EVMTokenAmount({token: s_destTokens[1], amount: 1}); + + // 3 tokens * TOKEN_PRICE + 1 token * (2 * TOKEN_PRICE) + vm.expectEmit(); + emit RateLimiter.TokensConsumed((5 * TOKEN_PRICE) / 1e18); + + s_rateLimiter.onInboundMessage(_generateAny2EVMMessage(CHAIN_SELECTOR_1, tokenAmounts)); + } + + function test_ValidateMessageWithDisabledRateLimitToken_Success() public { + MultiAggregateRateLimiter.LocalRateLimitToken[] memory removes = + new MultiAggregateRateLimiter.LocalRateLimitToken[](1); + removes[0] = MultiAggregateRateLimiter.LocalRateLimitToken({ + remoteChainSelector: CHAIN_SELECTOR_1, + localToken: s_destTokens[1] + }); + s_rateLimiter.updateRateLimitTokens(removes, new MultiAggregateRateLimiter.RateLimitTokenArgs[](0)); + + Client.EVMTokenAmount[] memory tokenAmounts = new Client.EVMTokenAmount[](2); + tokenAmounts[0] = Client.EVMTokenAmount({token: s_destTokens[0], amount: 5}); + tokenAmounts[1] = Client.EVMTokenAmount({token: s_destTokens[1], amount: 1}); + + vm.startPrank(MOCK_OFFRAMP); + + vm.expectEmit(); + emit RateLimiter.TokensConsumed((5 * TOKEN_PRICE) / 1e18); + + s_rateLimiter.onInboundMessage(_generateAny2EVMMessage(CHAIN_SELECTOR_1, tokenAmounts)); + } + + function test_ValidateMessageWithRateLimitDisabled_Success() public { + MultiAggregateRateLimiter.RateLimiterConfigArgs[] memory configUpdates = + new MultiAggregateRateLimiter.RateLimiterConfigArgs[](1); + configUpdates[0] = MultiAggregateRateLimiter.RateLimiterConfigArgs({ + remoteChainSelector: CHAIN_SELECTOR_1, + isOutboundLane: false, + rateLimiterConfig: RATE_LIMITER_CONFIG_1 + }); + configUpdates[0].rateLimiterConfig.isEnabled = false; + + s_rateLimiter.applyRateLimiterConfigUpdates(configUpdates); + + Client.EVMTokenAmount[] memory tokenAmounts = new Client.EVMTokenAmount[](2); + tokenAmounts[0] = Client.EVMTokenAmount({token: s_destTokens[0], amount: 1000}); + tokenAmounts[1] = Client.EVMTokenAmount({token: s_destTokens[1], amount: 50}); + + vm.startPrank(MOCK_OFFRAMP); + s_rateLimiter.onInboundMessage(_generateAny2EVMMessage(CHAIN_SELECTOR_1, tokenAmounts)); + + // No consumed rate limit events + Vm.Log[] memory logEntries = vm.getRecordedLogs(); + assertEq(logEntries.length, 0); + } + + function test_ValidateMessageWithTokensOnDifferentChains_Success() public { + MultiAggregateRateLimiter.RateLimitTokenArgs[] memory tokensToAdd = + new MultiAggregateRateLimiter.RateLimitTokenArgs[](s_sourceTokens.length); + for (uint224 i = 0; i < s_sourceTokens.length; ++i) { + tokensToAdd[i] = MultiAggregateRateLimiter.RateLimitTokenArgs({ + localTokenArgs: MultiAggregateRateLimiter.LocalRateLimitToken({ + remoteChainSelector: CHAIN_SELECTOR_2, + localToken: s_destTokens[i] + }), + // Create a remote token address that is different from CHAIN_SELECTOR_1 + remoteToken: abi.encode(uint256(uint160(s_sourceTokens[i])) + type(uint160).max + 1) + }); + } + s_rateLimiter.updateRateLimitTokens(new MultiAggregateRateLimiter.LocalRateLimitToken[](0), tokensToAdd); + + vm.startPrank(MOCK_OFFRAMP); + + Client.EVMTokenAmount[] memory tokenAmounts = new Client.EVMTokenAmount[](2); + tokenAmounts[0] = Client.EVMTokenAmount({token: s_destTokens[0], amount: 2}); + tokenAmounts[1] = Client.EVMTokenAmount({token: s_destTokens[1], amount: 1}); + + // 2 tokens * (TOKEN_PRICE) + 1 token * (2 * TOKEN_PRICE) + uint256 totalValue = (4 * TOKEN_PRICE) / 1e18; + + s_rateLimiter.onInboundMessage(_generateAny2EVMMessage(CHAIN_SELECTOR_1, tokenAmounts)); + + // Chain 1 changed + RateLimiter.TokenBucket memory bucketChain1 = s_rateLimiter.currentRateLimiterState(CHAIN_SELECTOR_1, false); + assertEq(bucketChain1.capacity - totalValue, bucketChain1.tokens); + + // Chain 2 unchanged + RateLimiter.TokenBucket memory bucketChain2 = s_rateLimiter.currentRateLimiterState(CHAIN_SELECTOR_2, false); + assertEq(bucketChain2.capacity, bucketChain2.tokens); + + vm.expectEmit(); + emit RateLimiter.TokensConsumed(totalValue); + + s_rateLimiter.onInboundMessage(_generateAny2EVMMessage(CHAIN_SELECTOR_2, tokenAmounts)); + + // Chain 1 unchanged + bucketChain1 = s_rateLimiter.currentRateLimiterState(CHAIN_SELECTOR_1, false); + assertEq(bucketChain1.capacity - totalValue, bucketChain1.tokens); + + // Chain 2 changed + bucketChain2 = s_rateLimiter.currentRateLimiterState(CHAIN_SELECTOR_2, false); + assertEq(bucketChain2.capacity - totalValue, bucketChain2.tokens); + } + + function test_ValidateMessageWithDifferentTokensOnDifferentChains_Success() public { + MultiAggregateRateLimiter.RateLimitTokenArgs[] memory tokensToAdd = + new MultiAggregateRateLimiter.RateLimitTokenArgs[](1); + + // Only 1 rate limited token on different chain + tokensToAdd[0] = MultiAggregateRateLimiter.RateLimitTokenArgs({ + localTokenArgs: MultiAggregateRateLimiter.LocalRateLimitToken({ + remoteChainSelector: CHAIN_SELECTOR_2, + localToken: s_destTokens[0] + }), + // Create a remote token address that is different from CHAIN_SELECTOR_1 + remoteToken: abi.encode(uint256(uint160(s_sourceTokens[0])) + type(uint160).max + 1) + }); + s_rateLimiter.updateRateLimitTokens(new MultiAggregateRateLimiter.LocalRateLimitToken[](0), tokensToAdd); + + vm.startPrank(MOCK_OFFRAMP); + + Client.EVMTokenAmount[] memory tokenAmounts = new Client.EVMTokenAmount[](2); + tokenAmounts[0] = Client.EVMTokenAmount({token: s_destTokens[0], amount: 3}); + tokenAmounts[1] = Client.EVMTokenAmount({token: s_destTokens[1], amount: 1}); + + // 3 tokens * (TOKEN_PRICE) + 1 token * (2 * TOKEN_PRICE) + uint256 totalValue = (5 * TOKEN_PRICE) / 1e18; + + s_rateLimiter.onInboundMessage(_generateAny2EVMMessage(CHAIN_SELECTOR_1, tokenAmounts)); + + // Chain 1 changed + RateLimiter.TokenBucket memory bucketChain1 = s_rateLimiter.currentRateLimiterState(CHAIN_SELECTOR_1, false); + assertEq(bucketChain1.capacity - totalValue, bucketChain1.tokens); + + // Chain 2 unchanged + RateLimiter.TokenBucket memory bucketChain2 = s_rateLimiter.currentRateLimiterState(CHAIN_SELECTOR_2, false); + assertEq(bucketChain2.capacity, bucketChain2.tokens); + + // 3 tokens * (TOKEN_PRICE) + uint256 totalValue2 = (3 * TOKEN_PRICE) / 1e18; + + vm.expectEmit(); + emit RateLimiter.TokensConsumed(totalValue2); + + s_rateLimiter.onInboundMessage(_generateAny2EVMMessage(CHAIN_SELECTOR_2, tokenAmounts)); + + // Chain 1 unchanged + bucketChain1 = s_rateLimiter.currentRateLimiterState(CHAIN_SELECTOR_1, false); + assertEq(bucketChain1.capacity - totalValue, bucketChain1.tokens); + + // Chain 2 changed + bucketChain2 = s_rateLimiter.currentRateLimiterState(CHAIN_SELECTOR_2, false); + assertEq(bucketChain2.capacity - totalValue2, bucketChain2.tokens); + } + + function test_ValidateMessageWithRateLimitReset_Success() public { + vm.startPrank(MOCK_OFFRAMP); + + Client.EVMTokenAmount[] memory tokenAmounts = new Client.EVMTokenAmount[](2); + tokenAmounts[0] = Client.EVMTokenAmount({token: s_destTokens[0], amount: 20}); + + // Remaining capacity: 100 -> 20 + s_rateLimiter.onInboundMessage(_generateAny2EVMMessage(CHAIN_SELECTOR_1, tokenAmounts)); + + // Cannot fit 80 rate limit value (need to wait at least 12 blocks, current capacity is 20) + vm.expectRevert(abi.encodeWithSelector(RateLimiter.AggregateValueRateLimitReached.selector, 12, 20)); + s_rateLimiter.onInboundMessage(_generateAny2EVMMessage(CHAIN_SELECTOR_1, tokenAmounts)); + + // Remaining capacity: 20 -> 35 (need to wait 9 more blocks) + vm.warp(BLOCK_TIME + 3); + vm.expectRevert(abi.encodeWithSelector(RateLimiter.AggregateValueRateLimitReached.selector, 9, 35)); + s_rateLimiter.onInboundMessage(_generateAny2EVMMessage(CHAIN_SELECTOR_1, tokenAmounts)); + + // Remaining capacity: 35 -> 80 (can fit exactly 80) + vm.warp(BLOCK_TIME + 12); + s_rateLimiter.onInboundMessage(_generateAny2EVMMessage(CHAIN_SELECTOR_1, tokenAmounts)); + } + + // Reverts + + function test_ValidateMessageWithRateLimitExceeded_Revert() public { + vm.startPrank(MOCK_OFFRAMP); + + Client.EVMTokenAmount[] memory tokenAmounts = new Client.EVMTokenAmount[](2); + tokenAmounts[0] = Client.EVMTokenAmount({token: s_destTokens[0], amount: 80}); + tokenAmounts[1] = Client.EVMTokenAmount({token: s_destTokens[1], amount: 30}); + + uint256 totalValue = (80 * TOKEN_PRICE + 2 * (30 * TOKEN_PRICE)) / 1e18; + vm.expectRevert(abi.encodeWithSelector(RateLimiter.AggregateValueMaxCapacityExceeded.selector, 100, totalValue)); + s_rateLimiter.onInboundMessage(_generateAny2EVMMessage(CHAIN_SELECTOR_1, tokenAmounts)); + } + + function test_ValidateMessageFromUnauthorizedCaller_Revert() public { + vm.startPrank(STRANGER); + + vm.expectRevert(abi.encodeWithSelector(AuthorizedCallers.UnauthorizedCaller.selector, STRANGER)); + s_rateLimiter.onInboundMessage(_generateAny2EVMMessageNoTokens(CHAIN_SELECTOR_1)); + } +} + +contract MultiAggregateRateLimiter_onOutboundMessage is MultiAggregateRateLimiterSetup { + function setUp() public virtual override { + super.setUp(); + + MultiAggregateRateLimiter.RateLimitTokenArgs[] memory tokensToAdd = + new MultiAggregateRateLimiter.RateLimitTokenArgs[](s_sourceTokens.length); + for (uint224 i = 0; i < s_sourceTokens.length; ++i) { + tokensToAdd[i] = MultiAggregateRateLimiter.RateLimitTokenArgs({ + localTokenArgs: MultiAggregateRateLimiter.LocalRateLimitToken({ + remoteChainSelector: CHAIN_SELECTOR_1, + localToken: s_sourceTokens[i] + }), + remoteToken: abi.encode(bytes20(s_destTokenBySourceToken[s_sourceTokens[i]])) + }); + + Internal.PriceUpdates memory priceUpdates = + _getSingleTokenPriceUpdateStruct(s_sourceTokens[i], TOKEN_PRICE * (i + 1)); + s_feeQuoter.updatePrices(priceUpdates); + } + s_rateLimiter.updateRateLimitTokens(new MultiAggregateRateLimiter.LocalRateLimitToken[](0), tokensToAdd); + } + + function test_ValidateMessageWithNoTokens_Success() public { + vm.startPrank(MOCK_ONRAMP); + + vm.recordLogs(); + s_rateLimiter.onOutboundMessage(CHAIN_SELECTOR_1, _generateEVM2AnyMessageNoTokens()); + + // No consumed rate limit events + assertEq(vm.getRecordedLogs().length, 0); + } + + function test_onOutboundMessage_ValidateMessageWithTokens_Success() public { + vm.startPrank(MOCK_ONRAMP); + + Client.EVMTokenAmount[] memory tokenAmounts = new Client.EVMTokenAmount[](2); + tokenAmounts[0] = Client.EVMTokenAmount({token: s_sourceTokens[0], amount: 3}); + tokenAmounts[1] = Client.EVMTokenAmount({token: s_sourceTokens[1], amount: 1}); + + // 3 tokens * TOKEN_PRICE + 1 token * (2 * TOKEN_PRICE) + vm.expectEmit(); + emit RateLimiter.TokensConsumed((5 * TOKEN_PRICE) / 1e18); + + s_rateLimiter.onOutboundMessage(CHAIN_SELECTOR_1, _generateEVM2AnyMessage(tokenAmounts)); + } + + function test_onOutboundMessage_ValidateMessageWithDisabledRateLimitToken_Success() public { + MultiAggregateRateLimiter.LocalRateLimitToken[] memory removes = + new MultiAggregateRateLimiter.LocalRateLimitToken[](1); + removes[0] = MultiAggregateRateLimiter.LocalRateLimitToken({ + remoteChainSelector: CHAIN_SELECTOR_1, + localToken: s_sourceTokens[1] + }); + s_rateLimiter.updateRateLimitTokens(removes, new MultiAggregateRateLimiter.RateLimitTokenArgs[](0)); + + Client.EVMTokenAmount[] memory tokenAmounts = new Client.EVMTokenAmount[](2); + tokenAmounts[0] = Client.EVMTokenAmount({token: s_sourceTokens[0], amount: 5}); + tokenAmounts[1] = Client.EVMTokenAmount({token: s_sourceTokens[1], amount: 1}); + + vm.startPrank(MOCK_ONRAMP); + + vm.expectEmit(); + emit RateLimiter.TokensConsumed((5 * TOKEN_PRICE) / 1e18); + + s_rateLimiter.onOutboundMessage(CHAIN_SELECTOR_1, _generateEVM2AnyMessage(tokenAmounts)); + } + + function test_onOutboundMessage_ValidateMessageWithRateLimitDisabled_Success() public { + MultiAggregateRateLimiter.RateLimiterConfigArgs[] memory configUpdates = + new MultiAggregateRateLimiter.RateLimiterConfigArgs[](1); + configUpdates[0] = MultiAggregateRateLimiter.RateLimiterConfigArgs({ + remoteChainSelector: CHAIN_SELECTOR_1, + isOutboundLane: true, + rateLimiterConfig: RATE_LIMITER_CONFIG_1 + }); + configUpdates[0].rateLimiterConfig.isEnabled = false; + + s_rateLimiter.applyRateLimiterConfigUpdates(configUpdates); + + Client.EVMTokenAmount[] memory tokenAmounts = new Client.EVMTokenAmount[](2); + tokenAmounts[0] = Client.EVMTokenAmount({token: s_sourceTokens[0], amount: 1000}); + tokenAmounts[1] = Client.EVMTokenAmount({token: s_sourceTokens[1], amount: 50}); + + vm.startPrank(MOCK_ONRAMP); + s_rateLimiter.onOutboundMessage(CHAIN_SELECTOR_1, _generateEVM2AnyMessage(tokenAmounts)); + + // No consumed rate limit events + assertEq(vm.getRecordedLogs().length, 0); + } + + function test_onOutboundMessage_ValidateMessageWithTokensOnDifferentChains_Success() public { + MultiAggregateRateLimiter.RateLimitTokenArgs[] memory tokensToAdd = + new MultiAggregateRateLimiter.RateLimitTokenArgs[](s_sourceTokens.length); + for (uint224 i = 0; i < s_sourceTokens.length; ++i) { + tokensToAdd[i] = MultiAggregateRateLimiter.RateLimitTokenArgs({ + localTokenArgs: MultiAggregateRateLimiter.LocalRateLimitToken({ + remoteChainSelector: CHAIN_SELECTOR_2, + localToken: s_sourceTokens[i] + }), + // Create a remote token address that is different from CHAIN_SELECTOR_1 + remoteToken: abi.encode(uint256(uint160(s_destTokenBySourceToken[s_sourceTokens[i]])) + type(uint160).max + 1) + }); + } + s_rateLimiter.updateRateLimitTokens(new MultiAggregateRateLimiter.LocalRateLimitToken[](0), tokensToAdd); + + vm.startPrank(MOCK_ONRAMP); + + Client.EVMTokenAmount[] memory tokenAmounts = new Client.EVMTokenAmount[](2); + tokenAmounts[0] = Client.EVMTokenAmount({token: s_sourceTokens[0], amount: 2}); + tokenAmounts[1] = Client.EVMTokenAmount({token: s_sourceTokens[1], amount: 1}); + + // 2 tokens * (TOKEN_PRICE) + 1 token * (2 * TOKEN_PRICE) + uint256 totalValue = (4 * TOKEN_PRICE) / 1e18; + + s_rateLimiter.onOutboundMessage(CHAIN_SELECTOR_1, _generateEVM2AnyMessage(tokenAmounts)); + + // Chain 1 changed + RateLimiter.TokenBucket memory bucketChain1 = s_rateLimiter.currentRateLimiterState(CHAIN_SELECTOR_1, true); + assertEq(bucketChain1.capacity - totalValue, bucketChain1.tokens); + + // Chain 2 unchanged + RateLimiter.TokenBucket memory bucketChain2 = s_rateLimiter.currentRateLimiterState(CHAIN_SELECTOR_2, true); + assertEq(bucketChain2.capacity, bucketChain2.tokens); + + vm.expectEmit(); + emit RateLimiter.TokensConsumed(totalValue); + + s_rateLimiter.onOutboundMessage(CHAIN_SELECTOR_2, _generateEVM2AnyMessage(tokenAmounts)); + + // Chain 1 unchanged + bucketChain1 = s_rateLimiter.currentRateLimiterState(CHAIN_SELECTOR_1, true); + assertEq(bucketChain1.capacity - totalValue, bucketChain1.tokens); + + // Chain 2 changed + bucketChain2 = s_rateLimiter.currentRateLimiterState(CHAIN_SELECTOR_2, true); + assertEq(bucketChain2.capacity - totalValue, bucketChain2.tokens); + } + + function test_onOutboundMessage_ValidateMessageWithDifferentTokensOnDifferentChains_Success() public { + MultiAggregateRateLimiter.RateLimitTokenArgs[] memory tokensToAdd = + new MultiAggregateRateLimiter.RateLimitTokenArgs[](1); + + // Only 1 rate limited token on different chain + tokensToAdd[0] = MultiAggregateRateLimiter.RateLimitTokenArgs({ + localTokenArgs: MultiAggregateRateLimiter.LocalRateLimitToken({ + remoteChainSelector: CHAIN_SELECTOR_2, + localToken: s_sourceTokens[0] + }), + // Create a remote token address that is different from CHAIN_SELECTOR_1 + remoteToken: abi.encode(uint256(uint160(s_destTokenBySourceToken[s_sourceTokens[0]])) + type(uint160).max + 1) + }); + s_rateLimiter.updateRateLimitTokens(new MultiAggregateRateLimiter.LocalRateLimitToken[](0), tokensToAdd); + + vm.startPrank(MOCK_ONRAMP); + + Client.EVMTokenAmount[] memory tokenAmounts = new Client.EVMTokenAmount[](2); + tokenAmounts[0] = Client.EVMTokenAmount({token: s_sourceTokens[0], amount: 3}); + tokenAmounts[1] = Client.EVMTokenAmount({token: s_sourceTokens[1], amount: 1}); + + // 3 tokens * (TOKEN_PRICE) + 1 token * (2 * TOKEN_PRICE) + uint256 totalValue = (5 * TOKEN_PRICE) / 1e18; + + s_rateLimiter.onOutboundMessage(CHAIN_SELECTOR_1, _generateEVM2AnyMessage(tokenAmounts)); + + // Chain 1 changed + RateLimiter.TokenBucket memory bucketChain1 = s_rateLimiter.currentRateLimiterState(CHAIN_SELECTOR_1, true); + assertEq(bucketChain1.capacity - totalValue, bucketChain1.tokens); + + // Chain 2 unchanged + RateLimiter.TokenBucket memory bucketChain2 = s_rateLimiter.currentRateLimiterState(CHAIN_SELECTOR_2, true); + assertEq(bucketChain2.capacity, bucketChain2.tokens); + + // 3 tokens * (TOKEN_PRICE) + uint256 totalValue2 = (3 * TOKEN_PRICE) / 1e18; + + vm.expectEmit(); + emit RateLimiter.TokensConsumed(totalValue2); + + s_rateLimiter.onOutboundMessage(CHAIN_SELECTOR_2, _generateEVM2AnyMessage(tokenAmounts)); + + // Chain 1 unchanged + bucketChain1 = s_rateLimiter.currentRateLimiterState(CHAIN_SELECTOR_1, true); + assertEq(bucketChain1.capacity - totalValue, bucketChain1.tokens); + + // Chain 2 changed + bucketChain2 = s_rateLimiter.currentRateLimiterState(CHAIN_SELECTOR_2, true); + assertEq(bucketChain2.capacity - totalValue2, bucketChain2.tokens); + } + + function test_onOutboundMessage_ValidateMessageWithRateLimitReset_Success() public { + vm.startPrank(MOCK_ONRAMP); + + Client.EVMTokenAmount[] memory tokenAmounts = new Client.EVMTokenAmount[](2); + tokenAmounts[0] = Client.EVMTokenAmount({token: s_sourceTokens[0], amount: 20}); + + // Remaining capacity: 100 -> 20 + s_rateLimiter.onOutboundMessage(CHAIN_SELECTOR_1, _generateEVM2AnyMessage(tokenAmounts)); + + // Cannot fit 80 rate limit value (need to wait at least 12 blocks, current capacity is 20) + vm.expectRevert(abi.encodeWithSelector(RateLimiter.AggregateValueRateLimitReached.selector, 12, 20)); + s_rateLimiter.onOutboundMessage(CHAIN_SELECTOR_1, _generateEVM2AnyMessage(tokenAmounts)); + + // Remaining capacity: 20 -> 35 (need to wait 9 more blocks) + vm.warp(BLOCK_TIME + 3); + vm.expectRevert(abi.encodeWithSelector(RateLimiter.AggregateValueRateLimitReached.selector, 9, 35)); + s_rateLimiter.onOutboundMessage(CHAIN_SELECTOR_1, _generateEVM2AnyMessage(tokenAmounts)); + + // Remaining capacity: 35 -> 80 (can fit exactly 80) + vm.warp(BLOCK_TIME + 12); + s_rateLimiter.onOutboundMessage(CHAIN_SELECTOR_1, _generateEVM2AnyMessage(tokenAmounts)); + } + + function test_RateLimitValueDifferentLanes_Success() public { + vm.pauseGasMetering(); + // start from blocktime that does not equal rate limiter init timestamp + vm.warp(BLOCK_TIME + 1); + + // 10 (tokens) * 4 (price) * 2 (number of times) = 80 < 100 (capacity) + uint256 numberOfTokens = 10; + Client.EVMTokenAmount[] memory tokenAmounts = new Client.EVMTokenAmount[](1); + tokenAmounts[0] = Client.EVMTokenAmount({token: s_sourceTokens[0], amount: numberOfTokens}); + uint256 value = (numberOfTokens * TOKEN_PRICE) / 1e18; + + vm.expectEmit(); + emit RateLimiter.TokensConsumed(value); + + vm.resumeGasMetering(); + vm.startPrank(MOCK_ONRAMP); + s_rateLimiter.onOutboundMessage(CHAIN_SELECTOR_1, _generateEVM2AnyMessage(tokenAmounts)); + vm.pauseGasMetering(); + + // Get the updated bucket status + RateLimiter.TokenBucket memory bucket1 = s_rateLimiter.currentRateLimiterState(CHAIN_SELECTOR_1, true); + RateLimiter.TokenBucket memory bucket2 = s_rateLimiter.currentRateLimiterState(CHAIN_SELECTOR_1, false); + + // Assert the proper value has been taken out of the bucket + assertEq(bucket1.capacity - value, bucket1.tokens); + // Inbound lane should remain unchanged + assertEq(bucket2.capacity, bucket2.tokens); + + vm.expectEmit(); + emit RateLimiter.TokensConsumed(value); + + vm.resumeGasMetering(); + s_rateLimiter.onInboundMessage(_generateAny2EVMMessage(CHAIN_SELECTOR_1, tokenAmounts)); + vm.pauseGasMetering(); + + bucket1 = s_rateLimiter.currentRateLimiterState(CHAIN_SELECTOR_1, true); + bucket2 = s_rateLimiter.currentRateLimiterState(CHAIN_SELECTOR_1, false); + + // Inbound lane should remain unchanged + assertEq(bucket1.capacity - value, bucket1.tokens); + assertEq(bucket2.capacity - value, bucket2.tokens); + } + + // Reverts + + function test_onOutboundMessage_ValidateMessageWithRateLimitExceeded_Revert() public { + vm.startPrank(MOCK_OFFRAMP); + + Client.EVMTokenAmount[] memory tokenAmounts = new Client.EVMTokenAmount[](2); + tokenAmounts[0] = Client.EVMTokenAmount({token: s_sourceTokens[0], amount: 80}); + tokenAmounts[1] = Client.EVMTokenAmount({token: s_sourceTokens[1], amount: 30}); + + uint256 totalValue = (80 * TOKEN_PRICE + 2 * (30 * TOKEN_PRICE)) / 1e18; + vm.expectRevert(abi.encodeWithSelector(RateLimiter.AggregateValueMaxCapacityExceeded.selector, 100, totalValue)); + s_rateLimiter.onOutboundMessage(CHAIN_SELECTOR_1, _generateEVM2AnyMessage(tokenAmounts)); + } + + function test_onOutboundMessage_ValidateMessageFromUnauthorizedCaller_Revert() public { + vm.startPrank(STRANGER); + + vm.expectRevert(abi.encodeWithSelector(AuthorizedCallers.UnauthorizedCaller.selector, STRANGER)); + s_rateLimiter.onOutboundMessage(CHAIN_SELECTOR_1, _generateEVM2AnyMessageNoTokens()); + } + + function _generateEVM2AnyMessage( + Client.EVMTokenAmount[] memory tokenAmounts + ) public view returns (Client.EVM2AnyMessage memory) { + return Client.EVM2AnyMessage({ + receiver: abi.encode(OWNER), + data: "", + tokenAmounts: tokenAmounts, + feeToken: s_sourceFeeToken, + extraArgs: Client._argsToBytes(Client.EVMExtraArgsV1({gasLimit: GAS_LIMIT})) + }); + } + + function _generateEVM2AnyMessageNoTokens() internal view returns (Client.EVM2AnyMessage memory) { + return _generateEVM2AnyMessage(new Client.EVMTokenAmount[](0)); + } +} diff --git a/contracts/src/v0.8/ccip/test/router/Router.t.sol b/contracts/src/v0.8/ccip/test/router/Router.t.sol new file mode 100644 index 00000000000..95d3c2f293f --- /dev/null +++ b/contracts/src/v0.8/ccip/test/router/Router.t.sol @@ -0,0 +1,892 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {IAny2EVMMessageReceiver} from "../../interfaces/IAny2EVMMessageReceiver.sol"; +import {IRouter} from "../../interfaces/IRouter.sol"; +import {IRouterClient} from "../../interfaces/IRouterClient.sol"; +import {IWrappedNative} from "../../interfaces/IWrappedNative.sol"; + +import {Router} from "../../Router.sol"; +import {Client} from "../../libraries/Client.sol"; +import {Internal} from "../../libraries/Internal.sol"; +import {EVM2EVMOnRamp} from "../../onRamp/EVM2EVMOnRamp.sol"; +import {MaybeRevertMessageReceiver} from "../helpers/receivers/MaybeRevertMessageReceiver.sol"; +import {EVM2EVMOffRampSetup} from "../offRamp/EVM2EVMOffRampSetup.t.sol"; +import {EVM2EVMOnRampSetup} from "../onRamp/EVM2EVMOnRampSetup.t.sol"; +import {RouterSetup} from "../router/RouterSetup.t.sol"; + +import {IERC20} from "../../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/IERC20.sol"; + +contract Router_constructor is EVM2EVMOnRampSetup { + function test_Constructor_Success() public view { + assertEq("Router 1.2.0", s_sourceRouter.typeAndVersion()); + assertEq(OWNER, s_sourceRouter.owner()); + } +} + +contract Router_recoverTokens is EVM2EVMOnRampSetup { + function test_RecoverTokens_Success() public { + // Assert we can recover sourceToken + IERC20 token = IERC20(s_sourceTokens[0]); + uint256 balanceBefore = token.balanceOf(OWNER); + token.transfer(address(s_sourceRouter), 1); + assertEq(token.balanceOf(address(s_sourceRouter)), 1); + s_sourceRouter.recoverTokens(address(token), OWNER, 1); + assertEq(token.balanceOf(address(s_sourceRouter)), 0); + assertEq(token.balanceOf(OWNER), balanceBefore); + + // Assert we can recover native + balanceBefore = OWNER.balance; + deal(address(s_sourceRouter), 10); + assertEq(address(s_sourceRouter).balance, 10); + s_sourceRouter.recoverTokens(address(0), OWNER, 10); + assertEq(OWNER.balance, balanceBefore + 10); + assertEq(address(s_sourceRouter).balance, 0); + } + + function test_RecoverTokensNonOwner_Revert() public { + // Reverts if not owner + vm.startPrank(STRANGER); + vm.expectRevert("Only callable by owner"); + s_sourceRouter.recoverTokens(address(0), STRANGER, 1); + } + + function test_RecoverTokensInvalidRecipient_Revert() public { + vm.expectRevert(abi.encodeWithSelector(Router.InvalidRecipientAddress.selector, address(0))); + s_sourceRouter.recoverTokens(address(0), address(0), 1); + } + + function test_RecoverTokensNoFunds_Revert() public { + // Reverts if no funds present + vm.expectRevert(); + s_sourceRouter.recoverTokens(address(0), OWNER, 10); + } + + function test_RecoverTokensValueReceiver_Revert() public { + MaybeRevertMessageReceiver revertingValueReceiver = new MaybeRevertMessageReceiver(true); + deal(address(s_sourceRouter), 10); + + // Value receiver reverts + vm.expectRevert(Router.FailedToSendValue.selector); + s_sourceRouter.recoverTokens(address(0), address(revertingValueReceiver), 10); + } +} + +contract Router_ccipSend is EVM2EVMOnRampSetup { + event Burned(address indexed sender, uint256 amount); + + function test_CCIPSendLinkFeeOneTokenSuccess_gas() public { + vm.pauseGasMetering(); + Client.EVM2AnyMessage memory message = _generateEmptyMessage(); + + IERC20 sourceToken1 = IERC20(s_sourceTokens[1]); + sourceToken1.approve(address(s_sourceRouter), 2 ** 64); + + message.tokenAmounts = new Client.EVMTokenAmount[](1); + message.tokenAmounts[0].amount = 2 ** 64; + message.tokenAmounts[0].token = s_sourceTokens[1]; + + uint256 expectedFee = s_sourceRouter.getFee(DEST_CHAIN_SELECTOR, message); + assertGt(expectedFee, 0); + + uint256 balanceBefore = sourceToken1.balanceOf(OWNER); + + // Assert that the tokens are burned + vm.expectEmit(); + emit Burned(address(s_onRamp), message.tokenAmounts[0].amount); + + Internal.EVM2EVMMessage memory msgEvent = _messageToEvent(message, 1, 1, expectedFee, OWNER); + + vm.expectEmit(); + emit EVM2EVMOnRamp.CCIPSendRequested(msgEvent); + + vm.resumeGasMetering(); + bytes32 messageId = s_sourceRouter.ccipSend(DEST_CHAIN_SELECTOR, message); + vm.pauseGasMetering(); + + assertEq(msgEvent.messageId, messageId); + // Assert the user balance is lowered by the tokenAmounts sent and the fee amount + uint256 expectedBalance = balanceBefore - (message.tokenAmounts[0].amount); + assertEq(expectedBalance, sourceToken1.balanceOf(OWNER)); + vm.resumeGasMetering(); + } + + function test_CCIPSendLinkFeeNoTokenSuccess_gas() public { + vm.pauseGasMetering(); + Client.EVM2AnyMessage memory message = _generateEmptyMessage(); + + uint256 expectedFee = s_sourceRouter.getFee(DEST_CHAIN_SELECTOR, message); + assertGt(expectedFee, 0); + + Internal.EVM2EVMMessage memory msgEvent = _messageToEvent(message, 1, 1, expectedFee, OWNER); + + vm.expectEmit(); + emit EVM2EVMOnRamp.CCIPSendRequested(msgEvent); + + vm.resumeGasMetering(); + bytes32 messageId = s_sourceRouter.ccipSend(DEST_CHAIN_SELECTOR, message); + vm.pauseGasMetering(); + + assertEq(msgEvent.messageId, messageId); + vm.resumeGasMetering(); + } + + function test_CCIPSendNativeFeeOneTokenSuccess_gas() public { + vm.pauseGasMetering(); + Client.EVM2AnyMessage memory message = _generateEmptyMessage(); + + IERC20 sourceToken1 = IERC20(s_sourceTokens[1]); + sourceToken1.approve(address(s_sourceRouter), 2 ** 64); + + message.tokenAmounts = new Client.EVMTokenAmount[](1); + message.tokenAmounts[0].amount = 2 ** 64; + message.tokenAmounts[0].token = s_sourceTokens[1]; + uint256 expectedFee = s_sourceRouter.getFee(DEST_CHAIN_SELECTOR, message); + assertGt(expectedFee, 0); + + uint256 balanceBefore = sourceToken1.balanceOf(OWNER); + + // Assert that the tokens are burned + vm.expectEmit(); + emit Burned(address(s_onRamp), message.tokenAmounts[0].amount); + + // Native fees will be wrapped so we need to calculate the event with + // the wrapped native feeCoin address. + message.feeToken = s_sourceRouter.getWrappedNative(); + Internal.EVM2EVMMessage memory msgEvent = _messageToEvent(message, 1, 1, expectedFee, OWNER); + // Set it to address(0) to indicate native + message.feeToken = address(0); + + vm.expectEmit(); + emit EVM2EVMOnRamp.CCIPSendRequested(msgEvent); + + vm.resumeGasMetering(); + bytes32 messageId = s_sourceRouter.ccipSend{value: expectedFee}(DEST_CHAIN_SELECTOR, message); + vm.pauseGasMetering(); + + assertEq(msgEvent.messageId, messageId); + // Assert the user balance is lowered by the tokenAmounts sent and the fee amount + uint256 expectedBalance = balanceBefore - (message.tokenAmounts[0].amount); + assertEq(expectedBalance, sourceToken1.balanceOf(OWNER)); + vm.resumeGasMetering(); + } + + function test_CCIPSendNativeFeeNoTokenSuccess_gas() public { + vm.pauseGasMetering(); + Client.EVM2AnyMessage memory message = _generateEmptyMessage(); + + uint256 expectedFee = s_sourceRouter.getFee(DEST_CHAIN_SELECTOR, message); + assertGt(expectedFee, 0); + + // Native fees will be wrapped so we need to calculate the event with + // the wrapped native feeCoin address. + message.feeToken = s_sourceRouter.getWrappedNative(); + Internal.EVM2EVMMessage memory msgEvent = _messageToEvent(message, 1, 1, expectedFee, OWNER); + // Set it to address(0) to indicate native + message.feeToken = address(0); + + vm.expectEmit(); + emit EVM2EVMOnRamp.CCIPSendRequested(msgEvent); + + vm.resumeGasMetering(); + bytes32 messageId = s_sourceRouter.ccipSend{value: expectedFee}(DEST_CHAIN_SELECTOR, message); + vm.pauseGasMetering(); + + assertEq(msgEvent.messageId, messageId); + // Assert the user balance is lowered by the tokenAmounts sent and the fee amount + vm.resumeGasMetering(); + } + + function test_NonLinkFeeToken_Success() public { + EVM2EVMOnRamp.FeeTokenConfigArgs[] memory feeTokenConfigArgs = new EVM2EVMOnRamp.FeeTokenConfigArgs[](1); + feeTokenConfigArgs[0] = EVM2EVMOnRamp.FeeTokenConfigArgs({ + token: s_sourceTokens[1], + networkFeeUSDCents: 1, + gasMultiplierWeiPerEth: 108e16, + premiumMultiplierWeiPerEth: 1e18, + enabled: true + }); + s_onRamp.setFeeTokenConfig(feeTokenConfigArgs); + + address[] memory feeTokens = new address[](1); + feeTokens[0] = s_sourceTokens[1]; + s_feeQuoter.applyFeeTokensUpdates(feeTokens, new address[](0)); + + Client.EVM2AnyMessage memory message = _generateEmptyMessage(); + message.feeToken = s_sourceTokens[1]; + IERC20(s_sourceTokens[1]).approve(address(s_sourceRouter), 2 ** 64); + s_sourceRouter.ccipSend(DEST_CHAIN_SELECTOR, message); + } + + function test_NativeFeeToken_Success() public { + Client.EVM2AnyMessage memory message = _generateEmptyMessage(); + message.feeToken = address(0); // Raw native + uint256 nativeQuote = s_sourceRouter.getFee(DEST_CHAIN_SELECTOR, message); + vm.stopPrank(); + hoax(address(1), 100 ether); + s_sourceRouter.ccipSend{value: nativeQuote}(DEST_CHAIN_SELECTOR, message); + } + + function test_NativeFeeTokenOverpay_Success() public { + Client.EVM2AnyMessage memory message = _generateEmptyMessage(); + message.feeToken = address(0); // Raw native + uint256 nativeQuote = s_sourceRouter.getFee(DEST_CHAIN_SELECTOR, message); + vm.stopPrank(); + hoax(address(1), 100 ether); + s_sourceRouter.ccipSend{value: nativeQuote + 1}(DEST_CHAIN_SELECTOR, message); + // We expect the overpayment to be taken in full. + assertEq(address(1).balance, 100 ether - (nativeQuote + 1)); + assertEq(address(s_sourceRouter).balance, 0); + } + + function test_WrappedNativeFeeToken_Success() public { + Client.EVM2AnyMessage memory message = _generateEmptyMessage(); + message.feeToken = s_sourceRouter.getWrappedNative(); + uint256 nativeQuote = s_sourceRouter.getFee(DEST_CHAIN_SELECTOR, message); + vm.stopPrank(); + hoax(address(1), 100 ether); + // Now address(1) has nativeQuote wrapped. + IWrappedNative(s_sourceRouter.getWrappedNative()).deposit{value: nativeQuote}(); + IWrappedNative(s_sourceRouter.getWrappedNative()).approve(address(s_sourceRouter), nativeQuote); + s_sourceRouter.ccipSend(DEST_CHAIN_SELECTOR, message); + } + + // Since sending with zero fees is a legitimate use case for some destination + // chains, e.g. private chains, we want to make sure that we can still send even + // when the configured fee is 0. + function test_ZeroFeeAndGasPrice_Success() public { + // Configure a new fee token that has zero gas and zero fees but is still + // enabled and valid to pay with. + address feeTokenWithZeroFeeAndGas = s_sourceTokens[1]; + + // Set the new token as feeToken + address[] memory feeTokens = new address[](1); + feeTokens[0] = feeTokenWithZeroFeeAndGas; + s_feeQuoter.applyFeeTokensUpdates(feeTokens, new address[](0)); + + // Update the price of the newly set feeToken + Internal.PriceUpdates memory priceUpdates = _getSingleTokenPriceUpdateStruct(feeTokenWithZeroFeeAndGas, 2_000 ether); + priceUpdates.gasPriceUpdates = new Internal.GasPriceUpdate[](1); + priceUpdates.gasPriceUpdates[0] = + Internal.GasPriceUpdate({destChainSelector: DEST_CHAIN_SELECTOR, usdPerUnitGas: 0}); + + s_feeQuoter.updatePrices(priceUpdates); + + // Set the feeToken args on the onRamp + EVM2EVMOnRamp.FeeTokenConfigArgs[] memory feeTokenConfigArgs = new EVM2EVMOnRamp.FeeTokenConfigArgs[](1); + feeTokenConfigArgs[0] = EVM2EVMOnRamp.FeeTokenConfigArgs({ + token: s_sourceTokens[1], + networkFeeUSDCents: 0, + gasMultiplierWeiPerEth: 108e16, + premiumMultiplierWeiPerEth: 1e18, + enabled: true + }); + + s_onRamp.setFeeTokenConfig(feeTokenConfigArgs); + + // Send a message with the new feeToken + Client.EVM2AnyMessage memory message = _generateEmptyMessage(); + message.feeToken = feeTokenWithZeroFeeAndGas; + + // Fee should be 0 and sending should not revert + uint256 fee = s_sourceRouter.getFee(DEST_CHAIN_SELECTOR, message); + assertEq(fee, 0); + + s_sourceRouter.ccipSend(DEST_CHAIN_SELECTOR, message); + } + + // Reverts + + function test_WhenNotHealthy_Revert() public { + Client.EVM2AnyMessage memory message = _generateEmptyMessage(); + s_mockRMN.setGlobalCursed(true); + vm.expectRevert(Router.BadARMSignal.selector); + s_sourceRouter.ccipSend(DEST_CHAIN_SELECTOR, message); + } + + function test_UnsupportedDestinationChain_Revert() public { + Client.EVM2AnyMessage memory message = _generateEmptyMessage(); + uint64 wrongChain = DEST_CHAIN_SELECTOR + 1; + + vm.expectRevert(abi.encodeWithSelector(IRouterClient.UnsupportedDestinationChain.selector, wrongChain)); + + s_sourceRouter.ccipSend(wrongChain, message); + } + + function test_Fuzz_UnsupportedFeeToken_Reverts(address wrongFeeToken) public { + // We have three fee tokens set, all others should revert. + vm.assume(address(s_sourceFeeToken) != wrongFeeToken); + vm.assume(address(s_sourceRouter.getWrappedNative()) != wrongFeeToken); + vm.assume(address(0) != wrongFeeToken); + + Client.EVM2AnyMessage memory message = _generateEmptyMessage(); + message.feeToken = wrongFeeToken; + + vm.expectRevert(abi.encodeWithSelector(EVM2EVMOnRamp.NotAFeeToken.selector, wrongFeeToken)); + + s_sourceRouter.ccipSend(DEST_CHAIN_SELECTOR, message); + } + + function test_Fuzz_UnsupportedToken_Reverts(address wrongToken) public { + for (uint256 i = 0; i < s_sourceTokens.length; ++i) { + vm.assume(address(s_sourceTokens[i]) != wrongToken); + } + + for (uint256 i = 0; i < s_destTokens.length; ++i) { + vm.assume(address(s_destTokens[i]) != wrongToken); + } + Client.EVM2AnyMessage memory message = _generateEmptyMessage(); + Client.EVMTokenAmount[] memory tokenAmounts = new Client.EVMTokenAmount[](1); + tokenAmounts[0] = Client.EVMTokenAmount({token: wrongToken, amount: 1}); + message.tokenAmounts = tokenAmounts; + + vm.expectRevert(abi.encodeWithSelector(EVM2EVMOnRamp.UnsupportedToken.selector, wrongToken)); + + s_sourceRouter.ccipSend(DEST_CHAIN_SELECTOR, message); + } + + function test_FeeTokenAmountTooLow_Revert() public { + Client.EVM2AnyMessage memory message = _generateEmptyMessage(); + IERC20(s_sourceTokens[0]).approve(address(s_sourceRouter), 0); + + vm.expectRevert("ERC20: insufficient allowance"); + + s_sourceRouter.ccipSend(DEST_CHAIN_SELECTOR, message); + } + + function test_InvalidMsgValue() public { + Client.EVM2AnyMessage memory message = _generateEmptyMessage(); + // Non-empty feeToken but with msg.value should revert + vm.stopPrank(); + hoax(address(1), 1); + vm.expectRevert(IRouterClient.InvalidMsgValue.selector); + s_sourceRouter.ccipSend{value: 1}(DEST_CHAIN_SELECTOR, message); + } + + function test_NativeFeeTokenZeroValue() public { + Client.EVM2AnyMessage memory message = _generateEmptyMessage(); + message.feeToken = address(0); // Raw native + // Include no value, should revert + vm.expectRevert(); + s_sourceRouter.ccipSend(DEST_CHAIN_SELECTOR, message); + } + + function test_NativeFeeTokenInsufficientValue() public { + Client.EVM2AnyMessage memory message = _generateEmptyMessage(); + message.feeToken = address(0); // Raw native + // Include insufficient, should also revert + vm.stopPrank(); + + s_onRamp.getFeeTokenConfig(s_sourceRouter.getWrappedNative()); + + hoax(address(1), 1); + vm.expectRevert(IRouterClient.InsufficientFeeTokenAmount.selector); + s_sourceRouter.ccipSend{value: 1}(DEST_CHAIN_SELECTOR, message); + } +} + +contract Router_getArmProxy is RouterSetup { + function test_getArmProxy() public view { + assertEq(s_sourceRouter.getArmProxy(), address(s_mockRMN)); + } +} + +contract Router_applyRampUpdates is RouterSetup { + MaybeRevertMessageReceiver internal s_receiver; + + function setUp() public virtual override(RouterSetup) { + RouterSetup.setUp(); + s_receiver = new MaybeRevertMessageReceiver(false); + } + + function _assertOffRampRouteSucceeds(Router.OffRamp memory offRamp) internal { + vm.startPrank(offRamp.offRamp); + + Client.Any2EVMMessage memory message = _generateReceiverMessage(offRamp.sourceChainSelector); + vm.expectCall(address(s_receiver), abi.encodeWithSelector(IAny2EVMMessageReceiver.ccipReceive.selector, message)); + s_sourceRouter.routeMessage(message, GAS_FOR_CALL_EXACT_CHECK, 100_000, address(s_receiver)); + } + + function _assertOffRampRouteReverts(Router.OffRamp memory offRamp) internal { + vm.startPrank(offRamp.offRamp); + + vm.expectRevert(IRouter.OnlyOffRamp.selector); + s_sourceRouter.routeMessage( + _generateReceiverMessage(offRamp.sourceChainSelector), GAS_FOR_CALL_EXACT_CHECK, 100_000, address(s_receiver) + ); + } + + function test_Fuzz_OffRampUpdates(address[20] memory offRampsInput) public { + Router.OffRamp[] memory offRamps = new Router.OffRamp[](20); + + for (uint256 i = 0; i < offRampsInput.length; ++i) { + offRamps[i] = Router.OffRamp({sourceChainSelector: uint64(i), offRamp: offRampsInput[i]}); + } + + // Test adding offRamps + s_sourceRouter.applyRampUpdates(new Router.OnRamp[](0), new Router.OffRamp[](0), offRamps); + + // There is no uniqueness guarantee on fuzz input, offRamps will not emit in case of a duplicate, + // hence cannot assert on number of offRamps event emissions, we need to use isOffRa + for (uint256 i = 0; i < offRamps.length; ++i) { + assertTrue(s_sourceRouter.isOffRamp(offRamps[i].sourceChainSelector, offRamps[i].offRamp)); + } + + // Test removing offRamps + s_sourceRouter.applyRampUpdates(new Router.OnRamp[](0), s_sourceRouter.getOffRamps(), new Router.OffRamp[](0)); + + assertEq(0, s_sourceRouter.getOffRamps().length); + for (uint256 i = 0; i < offRamps.length; ++i) { + assertFalse(s_sourceRouter.isOffRamp(offRamps[i].sourceChainSelector, offRamps[i].offRamp)); + } + + // Testing removing and adding in same call + s_sourceRouter.applyRampUpdates(new Router.OnRamp[](0), new Router.OffRamp[](0), offRamps); + s_sourceRouter.applyRampUpdates(new Router.OnRamp[](0), offRamps, offRamps); + for (uint256 i = 0; i < offRamps.length; ++i) { + assertTrue(s_sourceRouter.isOffRamp(offRamps[i].sourceChainSelector, offRamps[i].offRamp)); + } + } + + function test_OffRampUpdatesWithRouting() public { + // Explicitly construct chain selectors and ramp addresses so we have ramp uniqueness for the various test scenarios. + uint256 numberOfSelectors = 10; + uint64[] memory sourceChainSelectors = new uint64[](numberOfSelectors); + for (uint256 i = 0; i < numberOfSelectors; ++i) { + sourceChainSelectors[i] = uint64(i); + } + + uint256 numberOfOffRamps = 5; + address[] memory offRamps = new address[](numberOfOffRamps); + for (uint256 i = 0; i < numberOfOffRamps; ++i) { + offRamps[i] = address(uint160(i * 10)); + } + + // 1st test scenario: add offramps. + // Check all the offramps are added correctly, and can route messages. + Router.OnRamp[] memory onRampUpdates = new Router.OnRamp[](0); + Router.OffRamp[] memory offRampUpdates = new Router.OffRamp[](numberOfSelectors * numberOfOffRamps); + + // Ensure there are multi-offramp source and multi-source offramps + for (uint256 i = 0; i < numberOfSelectors; ++i) { + for (uint256 j = 0; j < numberOfOffRamps; ++j) { + offRampUpdates[(i * numberOfOffRamps) + j] = Router.OffRamp(sourceChainSelectors[i], offRamps[j]); + } + } + + for (uint256 i = 0; i < offRampUpdates.length; ++i) { + vm.expectEmit(); + emit Router.OffRampAdded(offRampUpdates[i].sourceChainSelector, offRampUpdates[i].offRamp); + } + s_sourceRouter.applyRampUpdates(onRampUpdates, new Router.OffRamp[](0), offRampUpdates); + + Router.OffRamp[] memory gotOffRamps = s_sourceRouter.getOffRamps(); + assertEq(offRampUpdates.length, gotOffRamps.length); + + for (uint256 i = 0; i < offRampUpdates.length; ++i) { + assertEq(offRampUpdates[i].offRamp, gotOffRamps[i].offRamp); + assertTrue(s_sourceRouter.isOffRamp(offRampUpdates[i].sourceChainSelector, offRampUpdates[i].offRamp)); + _assertOffRampRouteSucceeds(offRampUpdates[i]); + } + + vm.startPrank(OWNER); + + // 2nd test scenario: partially remove existing offramps, add new offramps. + // Check offramps are removed correctly. Removed offramps cannot route messages. + // Check new offramps are added correctly. New offramps can route messages. + // Check unmodified offramps remain correct, and can still route messages. + uint256 numberOfPartialUpdates = offRampUpdates.length / 2; + Router.OffRamp[] memory partialOffRampRemoves = new Router.OffRamp[](numberOfPartialUpdates); + Router.OffRamp[] memory partialOffRampAdds = new Router.OffRamp[](numberOfPartialUpdates); + for (uint256 i = 0; i < numberOfPartialUpdates; ++i) { + partialOffRampRemoves[i] = offRampUpdates[i]; + partialOffRampAdds[i] = Router.OffRamp({ + sourceChainSelector: offRampUpdates[i].sourceChainSelector, + offRamp: address(uint160(offRampUpdates[i].offRamp) + 1e18) // Ensure unique new offRamps addresses + }); + } + + for (uint256 i = 0; i < numberOfPartialUpdates; ++i) { + vm.expectEmit(); + emit Router.OffRampRemoved(partialOffRampRemoves[i].sourceChainSelector, partialOffRampRemoves[i].offRamp); + } + for (uint256 i = 0; i < numberOfPartialUpdates; ++i) { + vm.expectEmit(); + emit Router.OffRampAdded(partialOffRampAdds[i].sourceChainSelector, partialOffRampAdds[i].offRamp); + } + s_sourceRouter.applyRampUpdates(onRampUpdates, partialOffRampRemoves, partialOffRampAdds); + + gotOffRamps = s_sourceRouter.getOffRamps(); + assertEq(offRampUpdates.length, gotOffRamps.length); + + for (uint256 i = 0; i < numberOfPartialUpdates; ++i) { + assertFalse( + s_sourceRouter.isOffRamp(partialOffRampRemoves[i].sourceChainSelector, partialOffRampRemoves[i].offRamp) + ); + _assertOffRampRouteReverts(partialOffRampRemoves[i]); + + assertTrue(s_sourceRouter.isOffRamp(partialOffRampAdds[i].sourceChainSelector, partialOffRampAdds[i].offRamp)); + _assertOffRampRouteSucceeds(partialOffRampAdds[i]); + } + for (uint256 i = numberOfPartialUpdates; i < offRampUpdates.length; ++i) { + assertTrue(s_sourceRouter.isOffRamp(offRampUpdates[i].sourceChainSelector, offRampUpdates[i].offRamp)); + _assertOffRampRouteSucceeds(offRampUpdates[i]); + } + + vm.startPrank(OWNER); + + // 3rd test scenario: remove all offRamps. + // Check all offramps have been removed, no offramp is able to route messages. + for (uint256 i = 0; i < numberOfPartialUpdates; ++i) { + vm.expectEmit(); + emit Router.OffRampRemoved(partialOffRampAdds[i].sourceChainSelector, partialOffRampAdds[i].offRamp); + } + s_sourceRouter.applyRampUpdates(onRampUpdates, partialOffRampAdds, new Router.OffRamp[](0)); + + uint256 numberOfRemainingOfframps = offRampUpdates.length - numberOfPartialUpdates; + Router.OffRamp[] memory remainingOffRampRemoves = new Router.OffRamp[](numberOfRemainingOfframps); + for (uint256 i = 0; i < numberOfRemainingOfframps; ++i) { + remainingOffRampRemoves[i] = offRampUpdates[i + numberOfPartialUpdates]; + } + + for (uint256 i = 0; i < numberOfRemainingOfframps; ++i) { + vm.expectEmit(); + emit Router.OffRampRemoved(remainingOffRampRemoves[i].sourceChainSelector, remainingOffRampRemoves[i].offRamp); + } + s_sourceRouter.applyRampUpdates(onRampUpdates, remainingOffRampRemoves, new Router.OffRamp[](0)); + + // Check there are no offRamps. + assertEq(0, s_sourceRouter.getOffRamps().length); + + for (uint256 i = 0; i < numberOfPartialUpdates; ++i) { + assertFalse(s_sourceRouter.isOffRamp(partialOffRampAdds[i].sourceChainSelector, partialOffRampAdds[i].offRamp)); + _assertOffRampRouteReverts(partialOffRampAdds[i]); + } + for (uint256 i = 0; i < offRampUpdates.length; ++i) { + assertFalse(s_sourceRouter.isOffRamp(offRampUpdates[i].sourceChainSelector, offRampUpdates[i].offRamp)); + _assertOffRampRouteReverts(offRampUpdates[i]); + } + + vm.startPrank(OWNER); + + // 4th test scenario: add initial onRamps back. + // Check the offramps are added correctly, and can route messages. + // Check offramps that were not added back remain unset, and cannot route messages. + for (uint256 i = 0; i < offRampUpdates.length; ++i) { + vm.expectEmit(); + emit Router.OffRampAdded(offRampUpdates[i].sourceChainSelector, offRampUpdates[i].offRamp); + } + s_sourceRouter.applyRampUpdates(onRampUpdates, new Router.OffRamp[](0), offRampUpdates); + + // Check initial offRamps are added back and can route to receiver. + gotOffRamps = s_sourceRouter.getOffRamps(); + assertEq(offRampUpdates.length, gotOffRamps.length); + + for (uint256 i = 0; i < offRampUpdates.length; ++i) { + assertEq(offRampUpdates[i].offRamp, gotOffRamps[i].offRamp); + assertTrue(s_sourceRouter.isOffRamp(offRampUpdates[i].sourceChainSelector, offRampUpdates[i].offRamp)); + _assertOffRampRouteSucceeds(offRampUpdates[i]); + } + + // Check offramps that were not added back remain unset. + for (uint256 i = 0; i < numberOfPartialUpdates; ++i) { + assertFalse(s_sourceRouter.isOffRamp(partialOffRampAdds[i].sourceChainSelector, partialOffRampAdds[i].offRamp)); + _assertOffRampRouteReverts(partialOffRampAdds[i]); + } + } + + function test_Fuzz_OnRampUpdates(Router.OnRamp[] memory onRamps) public { + // Test adding onRamps + for (uint256 i = 0; i < onRamps.length; ++i) { + vm.expectEmit(); + emit Router.OnRampSet(onRamps[i].destChainSelector, onRamps[i].onRamp); + } + + s_sourceRouter.applyRampUpdates(onRamps, new Router.OffRamp[](0), new Router.OffRamp[](0)); + + // Test setting onRamps to unsupported + for (uint256 i = 0; i < onRamps.length; ++i) { + onRamps[i].onRamp = address(0); + + vm.expectEmit(); + emit Router.OnRampSet(onRamps[i].destChainSelector, onRamps[i].onRamp); + } + s_sourceRouter.applyRampUpdates(onRamps, new Router.OffRamp[](0), new Router.OffRamp[](0)); + for (uint256 i = 0; i < onRamps.length; ++i) { + assertEq(address(0), s_sourceRouter.getOnRamp(onRamps[i].destChainSelector)); + assertFalse(s_sourceRouter.isChainSupported(onRamps[i].destChainSelector)); + } + } + + function test_OnRampDisable() public { + // Add onRamp + Router.OnRamp[] memory onRampUpdates = new Router.OnRamp[](1); + Router.OffRamp[] memory offRampUpdates = new Router.OffRamp[](0); + address onRamp = address(uint160(2)); + onRampUpdates[0] = Router.OnRamp({destChainSelector: DEST_CHAIN_SELECTOR, onRamp: onRamp}); + s_sourceRouter.applyRampUpdates(onRampUpdates, new Router.OffRamp[](0), offRampUpdates); + assertEq(onRamp, s_sourceRouter.getOnRamp(DEST_CHAIN_SELECTOR)); + assertTrue(s_sourceRouter.isChainSupported(DEST_CHAIN_SELECTOR)); + + // Disable onRamp + onRampUpdates[0] = Router.OnRamp({destChainSelector: DEST_CHAIN_SELECTOR, onRamp: address(0)}); + s_sourceRouter.applyRampUpdates(onRampUpdates, new Router.OffRamp[](0), new Router.OffRamp[](0)); + assertEq(address(0), s_sourceRouter.getOnRamp(DEST_CHAIN_SELECTOR)); + assertFalse(s_sourceRouter.isChainSupported(DEST_CHAIN_SELECTOR)); + + // Re-enable onRamp + onRampUpdates[0] = Router.OnRamp({destChainSelector: DEST_CHAIN_SELECTOR, onRamp: onRamp}); + s_sourceRouter.applyRampUpdates(onRampUpdates, new Router.OffRamp[](0), new Router.OffRamp[](0)); + assertEq(onRamp, s_sourceRouter.getOnRamp(DEST_CHAIN_SELECTOR)); + assertTrue(s_sourceRouter.isChainSupported(DEST_CHAIN_SELECTOR)); + } + + function test_OnlyOwner_Revert() public { + vm.stopPrank(); + vm.expectRevert("Only callable by owner"); + Router.OnRamp[] memory onRampUpdates = new Router.OnRamp[](0); + Router.OffRamp[] memory offRampUpdates = new Router.OffRamp[](0); + s_sourceRouter.applyRampUpdates(onRampUpdates, offRampUpdates, offRampUpdates); + } + + function test_OffRampMismatch_Revert() public { + address offRamp = address(uint160(2)); + + Router.OnRamp[] memory onRampUpdates = new Router.OnRamp[](0); + Router.OffRamp[] memory offRampUpdates = new Router.OffRamp[](1); + offRampUpdates[0] = Router.OffRamp(DEST_CHAIN_SELECTOR, offRamp); + + vm.expectEmit(); + emit Router.OffRampAdded(DEST_CHAIN_SELECTOR, offRamp); + s_sourceRouter.applyRampUpdates(onRampUpdates, new Router.OffRamp[](0), offRampUpdates); + + offRampUpdates[0] = Router.OffRamp(SOURCE_CHAIN_SELECTOR, offRamp); + + vm.expectRevert(abi.encodeWithSelector(Router.OffRampMismatch.selector, SOURCE_CHAIN_SELECTOR, offRamp)); + s_sourceRouter.applyRampUpdates(onRampUpdates, offRampUpdates, offRampUpdates); + } +} + +contract Router_setWrappedNative is EVM2EVMOnRampSetup { + function test_Fuzz_SetWrappedNative_Success(address wrappedNative) public { + s_sourceRouter.setWrappedNative(wrappedNative); + assertEq(wrappedNative, s_sourceRouter.getWrappedNative()); + } + + // Reverts + function test_OnlyOwner_Revert() public { + vm.stopPrank(); + vm.expectRevert("Only callable by owner"); + s_sourceRouter.setWrappedNative(address(1)); + } +} + +contract Router_getSupportedTokens is EVM2EVMOnRampSetup { + function test_GetSupportedTokens_Revert() public { + vm.expectRevert(EVM2EVMOnRamp.GetSupportedTokensFunctionalityRemovedCheckAdminRegistry.selector); + s_onRamp.getSupportedTokens(DEST_CHAIN_SELECTOR); + } +} + +contract Router_routeMessage is EVM2EVMOffRampSetup { + function setUp() public virtual override { + EVM2EVMOffRampSetup.setUp(); + vm.startPrank(address(s_offRamp)); + } + + function _generateManualGasLimit(uint256 callDataLength) internal view returns (uint256) { + return ((gasleft() - 2 * (16 * callDataLength + GAS_FOR_CALL_EXACT_CHECK)) * 62) / 64; + } + + function test_ManualExec_Success() public { + Client.Any2EVMMessage memory message = _generateReceiverMessage(SOURCE_CHAIN_SELECTOR); + // Manuel execution cannot run out of gas + + (bool success, bytes memory retData, uint256 gasUsed) = s_destRouter.routeMessage( + _generateReceiverMessage(SOURCE_CHAIN_SELECTOR), + GAS_FOR_CALL_EXACT_CHECK, + _generateManualGasLimit(message.data.length), + address(s_receiver) + ); + assertTrue(success); + assertEq("", retData); + assertGt(gasUsed, 3_000); + } + + function test_ExecutionEvent_Success() public { + Client.Any2EVMMessage memory message = _generateReceiverMessage(SOURCE_CHAIN_SELECTOR); + // Should revert with reason + bytes memory realError1 = new bytes(2); + realError1[0] = 0xbe; + realError1[1] = 0xef; + s_reverting_receiver.setErr(realError1); + + vm.expectEmit(); + emit Router.MessageExecuted( + message.messageId, + message.sourceChainSelector, + address(s_offRamp), + keccak256(abi.encodeWithSelector(IAny2EVMMessageReceiver.ccipReceive.selector, message)) + ); + + (bool success, bytes memory retData, uint256 gasUsed) = s_destRouter.routeMessage( + _generateReceiverMessage(SOURCE_CHAIN_SELECTOR), + GAS_FOR_CALL_EXACT_CHECK, + _generateManualGasLimit(message.data.length), + address(s_reverting_receiver) + ); + + assertFalse(success); + assertEq(abi.encodeWithSelector(MaybeRevertMessageReceiver.CustomError.selector, realError1), retData); + assertGt(gasUsed, 3_000); + + // Reason is truncated + // Over the MAX_RET_BYTES limit (including offset and length word since we have a dynamic values), should be ignored + bytes memory realError2 = new bytes(32 * 2 + 1); + realError2[32 * 2 - 1] = 0xAA; + realError2[32 * 2] = 0xFF; + s_reverting_receiver.setErr(realError2); + + vm.expectEmit(); + emit Router.MessageExecuted( + message.messageId, + message.sourceChainSelector, + address(s_offRamp), + keccak256(abi.encodeWithSelector(IAny2EVMMessageReceiver.ccipReceive.selector, message)) + ); + + (success, retData, gasUsed) = s_destRouter.routeMessage( + _generateReceiverMessage(SOURCE_CHAIN_SELECTOR), + GAS_FOR_CALL_EXACT_CHECK, + _generateManualGasLimit(message.data.length), + address(s_reverting_receiver) + ); + + assertFalse(success); + assertEq( + abi.encodeWithSelector( + MaybeRevertMessageReceiver.CustomError.selector, + uint256(32), + uint256(realError2.length), + uint256(0), + uint256(0xAA) + ), + retData + ); + assertGt(gasUsed, 3_000); + + // Should emit success + vm.expectEmit(); + emit Router.MessageExecuted( + message.messageId, + message.sourceChainSelector, + address(s_offRamp), + keccak256(abi.encodeWithSelector(IAny2EVMMessageReceiver.ccipReceive.selector, message)) + ); + + (success, retData, gasUsed) = s_destRouter.routeMessage( + _generateReceiverMessage(SOURCE_CHAIN_SELECTOR), + GAS_FOR_CALL_EXACT_CHECK, + _generateManualGasLimit(message.data.length), + address(s_receiver) + ); + + assertTrue(success); + assertEq("", retData); + assertGt(gasUsed, 3_000); + } + + function test_Fuzz_ExecutionEvent_Success(bytes calldata error) public { + Client.Any2EVMMessage memory message = _generateReceiverMessage(SOURCE_CHAIN_SELECTOR); + s_reverting_receiver.setErr(error); + + bytes memory expectedRetData; + + if (error.length >= 33) { + uint256 cutOff = error.length > 64 ? 64 : error.length; + vm.expectEmit(); + emit Router.MessageExecuted( + message.messageId, + message.sourceChainSelector, + address(s_offRamp), + keccak256(abi.encodeWithSelector(IAny2EVMMessageReceiver.ccipReceive.selector, message)) + ); + expectedRetData = abi.encodeWithSelector( + MaybeRevertMessageReceiver.CustomError.selector, + uint256(32), + uint256(error.length), + bytes32(error[:32]), + bytes32(error[32:cutOff]) + ); + } else { + vm.expectEmit(); + emit Router.MessageExecuted( + message.messageId, + message.sourceChainSelector, + address(s_offRamp), + keccak256(abi.encodeWithSelector(IAny2EVMMessageReceiver.ccipReceive.selector, message)) + ); + expectedRetData = abi.encodeWithSelector(MaybeRevertMessageReceiver.CustomError.selector, error); + } + + (bool success, bytes memory retData,) = s_destRouter.routeMessage( + _generateReceiverMessage(SOURCE_CHAIN_SELECTOR), + GAS_FOR_CALL_EXACT_CHECK, + _generateManualGasLimit(message.data.length), + address(s_reverting_receiver) + ); + + assertFalse(success); + assertEq(expectedRetData, retData); + } + + function test_AutoExec_Success() public { + (bool success,,) = s_destRouter.routeMessage( + _generateReceiverMessage(SOURCE_CHAIN_SELECTOR), GAS_FOR_CALL_EXACT_CHECK, 100_000, address(s_receiver) + ); + + assertTrue(success); + + (success,,) = s_destRouter.routeMessage( + _generateReceiverMessage(SOURCE_CHAIN_SELECTOR), GAS_FOR_CALL_EXACT_CHECK, 1, address(s_receiver) + ); + + // Can run out of gas, should return false + assertFalse(success); + } + + // Reverts + function test_OnlyOffRamp_Revert() public { + vm.stopPrank(); + vm.startPrank(STRANGER); + + vm.expectRevert(IRouter.OnlyOffRamp.selector); + s_destRouter.routeMessage( + _generateReceiverMessage(SOURCE_CHAIN_SELECTOR), GAS_FOR_CALL_EXACT_CHECK, 100_000, address(s_receiver) + ); + } + + function test_WhenNotHealthy_Revert() public { + s_mockRMN.setGlobalCursed(true); + vm.expectRevert(Router.BadARMSignal.selector); + s_destRouter.routeMessage( + _generateReceiverMessage(SOURCE_CHAIN_SELECTOR), GAS_FOR_CALL_EXACT_CHECK, 100_000, address(s_receiver) + ); + } +} + +contract Router_getFee is EVM2EVMOnRampSetup { + function test_GetFeeSupportedChain_Success() public view { + Client.EVM2AnyMessage memory message = _generateEmptyMessage(); + uint256 expectedFee = s_sourceRouter.getFee(DEST_CHAIN_SELECTOR, message); + assertGt(expectedFee, 10e9); + } + + // Reverts + function test_UnsupportedDestinationChain_Revert() public { + Client.EVM2AnyMessage memory message = _generateEmptyMessage(); + + vm.expectRevert(abi.encodeWithSelector(IRouterClient.UnsupportedDestinationChain.selector, 999)); + s_sourceRouter.getFee(999, message); + } +} diff --git a/contracts/src/v0.8/ccip/test/router/RouterSetup.t.sol b/contracts/src/v0.8/ccip/test/router/RouterSetup.t.sol new file mode 100644 index 00000000000..7297721baae --- /dev/null +++ b/contracts/src/v0.8/ccip/test/router/RouterSetup.t.sol @@ -0,0 +1,48 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {Router} from "../../Router.sol"; +import {Client} from "../../libraries/Client.sol"; +import {Internal} from "../../libraries/Internal.sol"; +import {BaseTest} from "../BaseTest.t.sol"; +import {WETH9} from "../WETH9.sol"; + +contract RouterSetup is BaseTest { + Router internal s_sourceRouter; + Router internal s_destRouter; + + function setUp() public virtual override { + BaseTest.setUp(); + + if (address(s_sourceRouter) == address(0)) { + WETH9 weth = new WETH9(); + s_sourceRouter = new Router(address(weth), address(s_mockRMN)); + vm.label(address(s_sourceRouter), "sourceRouter"); + } + if (address(s_destRouter) == address(0)) { + WETH9 weth = new WETH9(); + s_destRouter = new Router(address(weth), address(s_mockRMN)); + vm.label(address(s_destRouter), "destRouter"); + } + } + + function _generateReceiverMessage(uint64 chainSelector) internal pure returns (Client.Any2EVMMessage memory) { + Client.EVMTokenAmount[] memory ta = new Client.EVMTokenAmount[](0); + return Client.Any2EVMMessage({ + messageId: bytes32("a"), + sourceChainSelector: chainSelector, + sender: bytes("a"), + data: bytes("a"), + destTokenAmounts: ta + }); + } + + function _generateSourceTokenData() internal pure returns (Internal.SourceTokenData memory) { + return Internal.SourceTokenData({ + sourcePoolAddress: abi.encode(address(12312412312)), + destTokenAddress: abi.encode(address(9809808909)), + extraData: "", + destGasAmount: DEFAULT_TOKEN_DEST_GAS_OVERHEAD + }); + } +} diff --git a/contracts/src/v0.8/ccip/test/tokenAdminRegistry/RegistryModuleOwnerCustom.t.sol b/contracts/src/v0.8/ccip/test/tokenAdminRegistry/RegistryModuleOwnerCustom.t.sol new file mode 100644 index 00000000000..dfb599bd307 --- /dev/null +++ b/contracts/src/v0.8/ccip/test/tokenAdminRegistry/RegistryModuleOwnerCustom.t.sol @@ -0,0 +1,104 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.0; + +import {IGetCCIPAdmin} from "../../interfaces/IGetCCIPAdmin.sol"; +import {IOwner} from "../../interfaces/IOwner.sol"; + +import {RegistryModuleOwnerCustom} from "../../tokenAdminRegistry/RegistryModuleOwnerCustom.sol"; +import {TokenAdminRegistry} from "../../tokenAdminRegistry/TokenAdminRegistry.sol"; +import {BurnMintERC677Helper} from "../helpers/BurnMintERC677Helper.sol"; + +import {Test} from "forge-std/Test.sol"; + +contract RegistryModuleOwnerCustomSetup is Test { + address internal constant OWNER = 0x00007e64E1fB0C487F25dd6D3601ff6aF8d32e4e; + + RegistryModuleOwnerCustom internal s_registryModuleOwnerCustom; + TokenAdminRegistry internal s_tokenAdminRegistry; + address internal s_token; + + function setUp() public virtual { + vm.startPrank(OWNER); + + s_tokenAdminRegistry = new TokenAdminRegistry(); + s_token = address(new BurnMintERC677Helper("Test", "TST")); + s_registryModuleOwnerCustom = new RegistryModuleOwnerCustom(address(s_tokenAdminRegistry)); + s_tokenAdminRegistry.addRegistryModule(address(s_registryModuleOwnerCustom)); + } +} + +contract RegistryModuleOwnerCustom_constructor is RegistryModuleOwnerCustomSetup { + function test_constructor_Revert() public { + vm.expectRevert(abi.encodeWithSelector(RegistryModuleOwnerCustom.AddressZero.selector)); + + new RegistryModuleOwnerCustom(address(0)); + } +} + +contract RegistryModuleOwnerCustom_registerAdminViaGetCCIPAdmin is RegistryModuleOwnerCustomSetup { + function test_registerAdminViaGetCCIPAdmin_Success() public { + assertEq(s_tokenAdminRegistry.getTokenConfig(s_token).administrator, address(0)); + + address expectedOwner = IGetCCIPAdmin(s_token).getCCIPAdmin(); + + vm.expectCall(s_token, abi.encodeWithSelector(IGetCCIPAdmin.getCCIPAdmin.selector), 1); + vm.expectCall( + address(s_tokenAdminRegistry), + abi.encodeWithSelector(TokenAdminRegistry.proposeAdministrator.selector, s_token, expectedOwner), + 1 + ); + + vm.expectEmit(); + emit RegistryModuleOwnerCustom.AdministratorRegistered(s_token, expectedOwner); + + s_registryModuleOwnerCustom.registerAdminViaGetCCIPAdmin(s_token); + + assertEq(s_tokenAdminRegistry.getTokenConfig(s_token).pendingAdministrator, OWNER); + } + + function test_registerAdminViaGetCCIPAdmin_Revert() public { + address expectedOwner = IGetCCIPAdmin(s_token).getCCIPAdmin(); + + vm.startPrank(makeAddr("Not_expected_owner")); + + vm.expectRevert( + abi.encodeWithSelector(RegistryModuleOwnerCustom.CanOnlySelfRegister.selector, expectedOwner, s_token) + ); + + s_registryModuleOwnerCustom.registerAdminViaGetCCIPAdmin(s_token); + } +} + +contract RegistryModuleOwnerCustom_registerAdminViaOwner is RegistryModuleOwnerCustomSetup { + function test_registerAdminViaOwner_Success() public { + assertEq(s_tokenAdminRegistry.getTokenConfig(s_token).administrator, address(0)); + + address expectedOwner = IOwner(s_token).owner(); + + vm.expectCall(s_token, abi.encodeWithSelector(IOwner.owner.selector), 1); + vm.expectCall( + address(s_tokenAdminRegistry), + abi.encodeWithSelector(TokenAdminRegistry.proposeAdministrator.selector, s_token, expectedOwner), + 1 + ); + + vm.expectEmit(); + emit RegistryModuleOwnerCustom.AdministratorRegistered(s_token, expectedOwner); + + s_registryModuleOwnerCustom.registerAdminViaOwner(s_token); + + assertEq(s_tokenAdminRegistry.getTokenConfig(s_token).pendingAdministrator, OWNER); + } + + function test_registerAdminViaOwner_Revert() public { + address expectedOwner = IOwner(s_token).owner(); + + vm.startPrank(makeAddr("Not_expected_owner")); + + vm.expectRevert( + abi.encodeWithSelector(RegistryModuleOwnerCustom.CanOnlySelfRegister.selector, expectedOwner, s_token) + ); + + s_registryModuleOwnerCustom.registerAdminViaOwner(s_token); + } +} diff --git a/contracts/src/v0.8/ccip/test/tokenAdminRegistry/TokenAdminRegistry.t.sol b/contracts/src/v0.8/ccip/test/tokenAdminRegistry/TokenAdminRegistry.t.sol new file mode 100644 index 00000000000..ada0369045c --- /dev/null +++ b/contracts/src/v0.8/ccip/test/tokenAdminRegistry/TokenAdminRegistry.t.sol @@ -0,0 +1,393 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.0; + +import {IPoolV1} from "../../interfaces/IPool.sol"; + +import {TokenAdminRegistry} from "../../tokenAdminRegistry/TokenAdminRegistry.sol"; +import {TokenSetup} from "../TokenSetup.t.sol"; + +contract TokenAdminRegistrySetup is TokenSetup { + address internal s_registryModule = makeAddr("registryModule"); + + function setUp() public virtual override { + TokenSetup.setUp(); + + s_tokenAdminRegistry.addRegistryModule(s_registryModule); + } +} + +contract TokenAdminRegistry_getPools is TokenAdminRegistrySetup { + function test_getPools_Success() public { + address[] memory tokens = new address[](1); + tokens[0] = s_sourceTokens[0]; + + address[] memory got = s_tokenAdminRegistry.getPools(tokens); + assertEq(got.length, 1); + assertEq(got[0], s_sourcePoolByToken[tokens[0]]); + + got = s_tokenAdminRegistry.getPools(s_sourceTokens); + assertEq(got.length, s_sourceTokens.length); + for (uint256 i = 0; i < s_sourceTokens.length; i++) { + assertEq(got[i], s_sourcePoolByToken[s_sourceTokens[i]]); + } + + address doesNotExist = makeAddr("doesNotExist"); + tokens[0] = doesNotExist; + got = s_tokenAdminRegistry.getPools(tokens); + assertEq(got.length, 1); + assertEq(got[0], address(0)); + } +} + +contract TokenAdminRegistry_getPool is TokenAdminRegistrySetup { + function test_getPool_Success() public view { + address got = s_tokenAdminRegistry.getPool(s_sourceTokens[0]); + assertEq(got, s_sourcePoolByToken[s_sourceTokens[0]]); + } +} + +contract TokenAdminRegistry_setPool is TokenAdminRegistrySetup { + function test_setPool_Success() public { + address pool = makeAddr("pool"); + vm.mockCall(pool, abi.encodeWithSelector(IPoolV1.isSupportedToken.selector), abi.encode(true)); + + vm.expectEmit(); + emit TokenAdminRegistry.PoolSet(s_sourceTokens[0], s_sourcePoolByToken[s_sourceTokens[0]], pool); + + s_tokenAdminRegistry.setPool(s_sourceTokens[0], pool); + + assertEq(s_tokenAdminRegistry.getPool(s_sourceTokens[0]), pool); + + // Assert the event is not emitted if the pool is the same as the current pool. + vm.recordLogs(); + s_tokenAdminRegistry.setPool(s_sourceTokens[0], pool); + + vm.assertEq(vm.getRecordedLogs().length, 0); + } + + function test_setPool_ZeroAddressRemovesPool_Success() public { + address pool = makeAddr("pool"); + vm.mockCall(pool, abi.encodeWithSelector(IPoolV1.isSupportedToken.selector), abi.encode(true)); + s_tokenAdminRegistry.setPool(s_sourceTokens[0], pool); + + assertEq(s_tokenAdminRegistry.getPool(s_sourceTokens[0]), pool); + + vm.expectEmit(); + emit TokenAdminRegistry.PoolSet(s_sourceTokens[0], pool, address(0)); + + s_tokenAdminRegistry.setPool(s_sourceTokens[0], address(0)); + + assertEq(s_tokenAdminRegistry.getPool(s_sourceTokens[0]), address(0)); + } + + function test_setPool_InvalidTokenPoolToken_Revert() public { + address pool = makeAddr("pool"); + vm.mockCall(pool, abi.encodeWithSelector(IPoolV1.isSupportedToken.selector), abi.encode(false)); + + vm.expectRevert(abi.encodeWithSelector(TokenAdminRegistry.InvalidTokenPoolToken.selector, s_sourceTokens[0])); + s_tokenAdminRegistry.setPool(s_sourceTokens[0], pool); + } + + function test_setPool_OnlyAdministrator_Revert() public { + vm.stopPrank(); + + vm.expectRevert( + abi.encodeWithSelector(TokenAdminRegistry.OnlyAdministrator.selector, address(this), s_sourceTokens[0]) + ); + s_tokenAdminRegistry.setPool(s_sourceTokens[0], makeAddr("pool")); + } +} + +contract TokenAdminRegistry_getAllConfiguredTokens is TokenAdminRegistrySetup { + function test_Fuzz_getAllConfiguredTokens_Success(uint8 numberOfTokens) public { + TokenAdminRegistry cleanTokenAdminRegistry = new TokenAdminRegistry(); + for (uint160 i = 0; i < numberOfTokens; ++i) { + cleanTokenAdminRegistry.proposeAdministrator(address(i), address(i + 1000)); + } + + uint160 count = 0; + for (uint160 start = 0; start < numberOfTokens; start += count++) { + address[] memory got = cleanTokenAdminRegistry.getAllConfiguredTokens(uint64(start), uint64(count)); + if (start + count > numberOfTokens) { + assertEq(got.length, numberOfTokens - start); + } else { + assertEq(got.length, count); + } + + for (uint160 j = 0; j < got.length; ++j) { + assertEq(got[j], address(j + start)); + } + } + } + + function test_getAllConfiguredTokens_outOfBounds_Success() public view { + address[] memory tokens = s_tokenAdminRegistry.getAllConfiguredTokens(type(uint64).max, 10); + assertEq(tokens.length, 0); + } +} + +contract TokenAdminRegistry_transferAdminRole is TokenAdminRegistrySetup { + function test_transferAdminRole_Success() public { + address token = s_sourceTokens[0]; + + address currentAdmin = s_tokenAdminRegistry.getTokenConfig(token).administrator; + address newAdmin = makeAddr("newAdmin"); + + vm.expectEmit(); + emit TokenAdminRegistry.AdministratorTransferRequested(token, currentAdmin, newAdmin); + + s_tokenAdminRegistry.transferAdminRole(token, newAdmin); + + TokenAdminRegistry.TokenConfig memory config = s_tokenAdminRegistry.getTokenConfig(token); + + // Assert only the pending admin updates, without affecting the pending admin. + assertEq(config.pendingAdministrator, newAdmin); + assertEq(config.administrator, currentAdmin); + } + + function test_transferAdminRole_OnlyAdministrator_Revert() public { + vm.stopPrank(); + + vm.expectRevert( + abi.encodeWithSelector(TokenAdminRegistry.OnlyAdministrator.selector, address(this), s_sourceTokens[0]) + ); + s_tokenAdminRegistry.transferAdminRole(s_sourceTokens[0], makeAddr("newAdmin")); + } +} + +contract TokenAdminRegistry_acceptAdminRole is TokenAdminRegistrySetup { + function test_acceptAdminRole_Success() public { + address token = s_sourceTokens[0]; + + address currentAdmin = s_tokenAdminRegistry.getTokenConfig(token).administrator; + address newAdmin = makeAddr("newAdmin"); + + vm.expectEmit(); + emit TokenAdminRegistry.AdministratorTransferRequested(token, currentAdmin, newAdmin); + + s_tokenAdminRegistry.transferAdminRole(token, newAdmin); + + TokenAdminRegistry.TokenConfig memory config = s_tokenAdminRegistry.getTokenConfig(token); + + // Assert only the pending admin updates, without affecting the pending admin. + assertEq(config.pendingAdministrator, newAdmin); + assertEq(config.administrator, currentAdmin); + + vm.startPrank(newAdmin); + + vm.expectEmit(); + emit TokenAdminRegistry.AdministratorTransferred(token, newAdmin); + + s_tokenAdminRegistry.acceptAdminRole(token); + + config = s_tokenAdminRegistry.getTokenConfig(token); + + // Assert only the pending admin updates, without affecting the pending admin. + assertEq(config.pendingAdministrator, address(0)); + assertEq(config.administrator, newAdmin); + } + + function test_acceptAdminRole_OnlyPendingAdministrator_Revert() public { + address token = s_sourceTokens[0]; + address currentAdmin = s_tokenAdminRegistry.getTokenConfig(token).administrator; + address newAdmin = makeAddr("newAdmin"); + + s_tokenAdminRegistry.transferAdminRole(token, newAdmin); + + TokenAdminRegistry.TokenConfig memory config = s_tokenAdminRegistry.getTokenConfig(token); + + // Assert only the pending admin updates, without affecting the pending admin. + assertEq(config.pendingAdministrator, newAdmin); + assertEq(config.administrator, currentAdmin); + + address notNewAdmin = makeAddr("notNewAdmin"); + vm.startPrank(notNewAdmin); + + vm.expectRevert(abi.encodeWithSelector(TokenAdminRegistry.OnlyPendingAdministrator.selector, notNewAdmin, token)); + s_tokenAdminRegistry.acceptAdminRole(token); + } +} + +contract TokenAdminRegistry_isAdministrator is TokenAdminRegistrySetup { + function test_isAdministrator_Success() public { + address newAdmin = makeAddr("newAdmin"); + address newToken = makeAddr("newToken"); + assertFalse(s_tokenAdminRegistry.isAdministrator(newToken, newAdmin)); + assertFalse(s_tokenAdminRegistry.isAdministrator(newToken, OWNER)); + + s_tokenAdminRegistry.proposeAdministrator(newToken, newAdmin); + changePrank(newAdmin); + s_tokenAdminRegistry.acceptAdminRole(newToken); + + assertTrue(s_tokenAdminRegistry.isAdministrator(newToken, newAdmin)); + assertFalse(s_tokenAdminRegistry.isAdministrator(newToken, OWNER)); + } +} + +contract TokenAdminRegistry_proposeAdministrator is TokenAdminRegistrySetup { + function test_proposeAdministrator_module_Success() public { + vm.startPrank(s_registryModule); + address newAdmin = makeAddr("newAdmin"); + address newToken = makeAddr("newToken"); + + vm.expectEmit(); + emit TokenAdminRegistry.AdministratorTransferRequested(newToken, address(0), newAdmin); + + s_tokenAdminRegistry.proposeAdministrator(newToken, newAdmin); + + assertEq(s_tokenAdminRegistry.getTokenConfig(newToken).pendingAdministrator, newAdmin); + assertEq(s_tokenAdminRegistry.getTokenConfig(newToken).administrator, address(0)); + assertEq(s_tokenAdminRegistry.getTokenConfig(newToken).tokenPool, address(0)); + + changePrank(newAdmin); + s_tokenAdminRegistry.acceptAdminRole(newToken); + + assertTrue(s_tokenAdminRegistry.isAdministrator(newToken, newAdmin)); + } + + function test_proposeAdministrator_owner_Success() public { + address newAdmin = makeAddr("newAdmin"); + address newToken = makeAddr("newToken"); + + vm.expectEmit(); + emit TokenAdminRegistry.AdministratorTransferRequested(newToken, address(0), newAdmin); + + s_tokenAdminRegistry.proposeAdministrator(newToken, newAdmin); + + assertEq(s_tokenAdminRegistry.getTokenConfig(newToken).pendingAdministrator, newAdmin); + + changePrank(newAdmin); + s_tokenAdminRegistry.acceptAdminRole(newToken); + + assertTrue(s_tokenAdminRegistry.isAdministrator(newToken, newAdmin)); + } + + function test_proposeAdministrator_reRegisterWhileUnclaimed_Success() public { + address newAdmin = makeAddr("wrongAddress"); + address newToken = makeAddr("newToken"); + + vm.expectEmit(); + emit TokenAdminRegistry.AdministratorTransferRequested(newToken, address(0), newAdmin); + + s_tokenAdminRegistry.proposeAdministrator(newToken, newAdmin); + + assertEq(s_tokenAdminRegistry.getTokenConfig(newToken).pendingAdministrator, newAdmin); + + newAdmin = makeAddr("correctAddress"); + + vm.expectEmit(); + emit TokenAdminRegistry.AdministratorTransferRequested(newToken, address(0), newAdmin); + + // Ensure we can still register the correct admin while the previous admin is unclaimed. + s_tokenAdminRegistry.proposeAdministrator(newToken, newAdmin); + + changePrank(newAdmin); + s_tokenAdminRegistry.acceptAdminRole(newToken); + + assertTrue(s_tokenAdminRegistry.isAdministrator(newToken, newAdmin)); + } + + mapping(address token => address admin) internal s_AdminByToken; + + function test_Fuzz_proposeAdministrator_Success(address[50] memory tokens, address[50] memory admins) public { + TokenAdminRegistry cleanTokenAdminRegistry = new TokenAdminRegistry(); + for (uint256 i = 0; i < tokens.length; i++) { + if (admins[i] == address(0)) { + continue; + } + if (cleanTokenAdminRegistry.getTokenConfig(tokens[i]).administrator != address(0)) { + continue; + } + cleanTokenAdminRegistry.proposeAdministrator(tokens[i], admins[i]); + s_AdminByToken[tokens[i]] = admins[i]; + } + + for (uint256 i = 0; i < tokens.length; i++) { + assertEq(cleanTokenAdminRegistry.getTokenConfig(tokens[i]).pendingAdministrator, s_AdminByToken[tokens[i]]); + } + } + + function test_proposeAdministrator_OnlyRegistryModule_Revert() public { + address newToken = makeAddr("newToken"); + vm.stopPrank(); + + vm.expectRevert(abi.encodeWithSelector(TokenAdminRegistry.OnlyRegistryModuleOrOwner.selector, address(this))); + s_tokenAdminRegistry.proposeAdministrator(newToken, OWNER); + } + + function test_proposeAdministrator_ZeroAddress_Revert() public { + address newToken = makeAddr("newToken"); + + vm.expectRevert(abi.encodeWithSelector(TokenAdminRegistry.ZeroAddress.selector)); + s_tokenAdminRegistry.proposeAdministrator(newToken, address(0)); + } + + function test_proposeAdministrator_AlreadyRegistered_Revert() public { + address newAdmin = makeAddr("newAdmin"); + address newToken = makeAddr("newToken"); + + s_tokenAdminRegistry.proposeAdministrator(newToken, newAdmin); + changePrank(newAdmin); + s_tokenAdminRegistry.acceptAdminRole(newToken); + + changePrank(OWNER); + + vm.expectRevert(abi.encodeWithSelector(TokenAdminRegistry.AlreadyRegistered.selector, newToken)); + s_tokenAdminRegistry.proposeAdministrator(newToken, newAdmin); + } +} + +contract TokenAdminRegistry_addRegistryModule is TokenAdminRegistrySetup { + function test_addRegistryModule_Success() public { + address newModule = makeAddr("newModule"); + + s_tokenAdminRegistry.addRegistryModule(newModule); + + assertTrue(s_tokenAdminRegistry.isRegistryModule(newModule)); + + // Assert the event is not emitted if the module is already added. + vm.recordLogs(); + s_tokenAdminRegistry.addRegistryModule(newModule); + + vm.assertEq(vm.getRecordedLogs().length, 0); + } + + function test_addRegistryModule_OnlyOwner_Revert() public { + address newModule = makeAddr("newModule"); + vm.stopPrank(); + + vm.expectRevert("Only callable by owner"); + s_tokenAdminRegistry.addRegistryModule(newModule); + } +} + +contract TokenAdminRegistry_removeRegistryModule is TokenAdminRegistrySetup { + function test_removeRegistryModule_Success() public { + address newModule = makeAddr("newModule"); + + s_tokenAdminRegistry.addRegistryModule(newModule); + + assertTrue(s_tokenAdminRegistry.isRegistryModule(newModule)); + + vm.expectEmit(); + emit TokenAdminRegistry.RegistryModuleRemoved(newModule); + + s_tokenAdminRegistry.removeRegistryModule(newModule); + + assertFalse(s_tokenAdminRegistry.isRegistryModule(newModule)); + + // Assert the event is not emitted if the module is already removed. + vm.recordLogs(); + s_tokenAdminRegistry.removeRegistryModule(newModule); + + vm.assertEq(vm.getRecordedLogs().length, 0); + } + + function test_removeRegistryModule_OnlyOwner_Revert() public { + address newModule = makeAddr("newModule"); + vm.stopPrank(); + + vm.expectRevert("Only callable by owner"); + s_tokenAdminRegistry.removeRegistryModule(newModule); + } +} diff --git a/contracts/src/v0.8/ccip/tokenAdminRegistry/RegistryModuleOwnerCustom.sol b/contracts/src/v0.8/ccip/tokenAdminRegistry/RegistryModuleOwnerCustom.sol new file mode 100644 index 00000000000..a794d68c9e3 --- /dev/null +++ b/contracts/src/v0.8/ccip/tokenAdminRegistry/RegistryModuleOwnerCustom.sol @@ -0,0 +1,54 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {ITypeAndVersion} from "../../shared/interfaces/ITypeAndVersion.sol"; +import {IGetCCIPAdmin} from "../interfaces/IGetCCIPAdmin.sol"; +import {IOwner} from "../interfaces/IOwner.sol"; +import {ITokenAdminRegistry} from "../interfaces/ITokenAdminRegistry.sol"; + +contract RegistryModuleOwnerCustom is ITypeAndVersion { + error CanOnlySelfRegister(address admin, address token); + error AddressZero(); + + event AdministratorRegistered(address indexed token, address indexed administrator); + + string public constant override typeAndVersion = "RegistryModuleOwnerCustom 1.5.0"; + + // The TokenAdminRegistry contract + ITokenAdminRegistry internal immutable i_tokenAdminRegistry; + + constructor(address tokenAdminRegistry) { + if (tokenAdminRegistry == address(0)) { + revert AddressZero(); + } + i_tokenAdminRegistry = ITokenAdminRegistry(tokenAdminRegistry); + } + + /// @notice Registers the admin of the token using the `getCCIPAdmin` method. + /// @param token The token to register the admin for. + /// @dev The caller must be the admin returned by the `getCCIPAdmin` method. + function registerAdminViaGetCCIPAdmin(address token) external { + _registerAdmin(token, IGetCCIPAdmin(token).getCCIPAdmin()); + } + + /// @notice Registers the admin of the token using the `owner` method. + /// @param token The token to register the admin for. + /// @dev The caller must be the admin returned by the `owner` method. + function registerAdminViaOwner(address token) external { + _registerAdmin(token, IOwner(token).owner()); + } + + /// @notice Registers the admin of the token to msg.sender given that the + /// admin is equal to msg.sender. + /// @param token The token to register the admin for. + /// @param admin The caller must be the admin. + function _registerAdmin(address token, address admin) internal { + if (admin != msg.sender) { + revert CanOnlySelfRegister(admin, token); + } + + i_tokenAdminRegistry.proposeAdministrator(token, admin); + + emit AdministratorRegistered(token, admin); + } +} diff --git a/contracts/src/v0.8/ccip/tokenAdminRegistry/TokenAdminRegistry.sol b/contracts/src/v0.8/ccip/tokenAdminRegistry/TokenAdminRegistry.sol new file mode 100644 index 00000000000..fd995ca96ae --- /dev/null +++ b/contracts/src/v0.8/ccip/tokenAdminRegistry/TokenAdminRegistry.sol @@ -0,0 +1,221 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {ITypeAndVersion} from "../../shared/interfaces/ITypeAndVersion.sol"; +import {IPoolV1} from "../interfaces/IPool.sol"; +import {ITokenAdminRegistry} from "../interfaces/ITokenAdminRegistry.sol"; + +import {OwnerIsCreator} from "../../shared/access/OwnerIsCreator.sol"; + +import {EnumerableSet} from "../../vendor/openzeppelin-solidity/v5.0.2/contracts/utils/structs/EnumerableSet.sol"; + +/// @notice This contract stores the token pool configuration for all CCIP enabled tokens. It works +/// on a self-serve basis, where tokens can be registered without intervention from the CCIP owner. +/// @dev This contract is not considered upgradable, as it is a customer facing contract that will store +/// significant amounts of data. +contract TokenAdminRegistry is ITokenAdminRegistry, ITypeAndVersion, OwnerIsCreator { + using EnumerableSet for EnumerableSet.AddressSet; + + error OnlyRegistryModuleOrOwner(address sender); + error OnlyAdministrator(address sender, address token); + error OnlyPendingAdministrator(address sender, address token); + error AlreadyRegistered(address token); + error ZeroAddress(); + error InvalidTokenPoolToken(address token); + + event PoolSet(address indexed token, address indexed previousPool, address indexed newPool); + event AdministratorTransferRequested(address indexed token, address indexed currentAdmin, address indexed newAdmin); + event AdministratorTransferred(address indexed token, address indexed newAdmin); + event RegistryModuleAdded(address module); + event RegistryModuleRemoved(address indexed module); + + // The struct is packed in a way that optimizes the attributes that are accessed together. + // solhint-disable-next-line gas-struct-packing + struct TokenConfig { + address administrator; // the current administrator of the token + address pendingAdministrator; // the address that is pending to become the new administrator + address tokenPool; // the token pool for this token. Can be address(0) if not deployed or not configured. + } + + string public constant override typeAndVersion = "TokenAdminRegistry 1.5.0"; + + // Mapping of token address to token configuration + mapping(address token => TokenConfig) internal s_tokenConfig; + + // All tokens that have been configured + EnumerableSet.AddressSet internal s_tokens; + + // Registry modules are allowed to register administrators for tokens + EnumerableSet.AddressSet internal s_registryModules; + + /// @notice Returns all pools for the given tokens. + /// @dev Will return address(0) for tokens that do not have a pool. + function getPools(address[] calldata tokens) external view returns (address[] memory) { + address[] memory pools = new address[](tokens.length); + for (uint256 i = 0; i < tokens.length; ++i) { + pools[i] = s_tokenConfig[tokens[i]].tokenPool; + } + return pools; + } + + /// @inheritdoc ITokenAdminRegistry + function getPool(address token) external view returns (address) { + return s_tokenConfig[token].tokenPool; + } + + /// @notice Returns the configuration for a token. + /// @param token The token to get the configuration for. + /// @return config The configuration for the token. + function getTokenConfig(address token) external view returns (TokenConfig memory) { + return s_tokenConfig[token]; + } + + /// @notice Returns a list of tokens that are configured in the token admin registry. + /// @param startIndex Starting index in list, can be 0 if you want to start from the beginning. + /// @param maxCount Maximum number of tokens to retrieve. Since the list can be large, + /// it is recommended to use a paging mechanism to retrieve all tokens. If querying for very + /// large lists, RPCs can time out. If you want all tokens, use type(uint64).max. + /// @return tokens List of configured tokens. + /// @dev The function is paginated to avoid RPC timeouts. + /// @dev The ordering is guaranteed to remain the same as it is not possible to remove tokens + /// from s_tokens. + function getAllConfiguredTokens(uint64 startIndex, uint64 maxCount) external view returns (address[] memory tokens) { + uint256 numberOfTokens = s_tokens.length(); + if (startIndex >= numberOfTokens) { + return tokens; + } + uint256 count = maxCount; + if (count + startIndex > numberOfTokens) { + count = numberOfTokens - startIndex; + } + tokens = new address[](count); + for (uint256 i = 0; i < count; ++i) { + tokens[i] = s_tokens.at(startIndex + i); + } + + return tokens; + } + + // ================================================================ + // │ Administrator functions │ + // ================================================================ + + /// @notice Sets the pool for a token. Setting the pool to address(0) effectively delists the token + /// from CCIP. Setting the pool to any other address enables the token on CCIP. + /// @param localToken The token to set the pool for. + /// @param pool The pool to set for the token. + function setPool(address localToken, address pool) external onlyTokenAdmin(localToken) { + // The pool has to support the token, but we want to allow removing the pool, so we only check + // if the pool supports the token if it is not address(0). + if (pool != address(0) && !IPoolV1(pool).isSupportedToken(localToken)) { + revert InvalidTokenPoolToken(localToken); + } + + TokenConfig storage config = s_tokenConfig[localToken]; + + address previousPool = config.tokenPool; + config.tokenPool = pool; + + if (previousPool != pool) { + emit PoolSet(localToken, previousPool, pool); + } + } + + /// @notice Transfers the administrator role for a token to a new address with a 2-step process. + /// @param localToken The token to transfer the administrator role for. + /// @param newAdmin The address to transfer the administrator role to. Can be address(0) to cancel + /// a pending transfer. + /// @dev The new admin must call `acceptAdminRole` to accept the role. + function transferAdminRole(address localToken, address newAdmin) external onlyTokenAdmin(localToken) { + TokenConfig storage config = s_tokenConfig[localToken]; + config.pendingAdministrator = newAdmin; + + emit AdministratorTransferRequested(localToken, msg.sender, newAdmin); + } + + /// @notice Accepts the administrator role for a token. + /// @param localToken The token to accept the administrator role for. + /// @dev This function can only be called by the pending administrator. + function acceptAdminRole(address localToken) external { + TokenConfig storage config = s_tokenConfig[localToken]; + if (config.pendingAdministrator != msg.sender) { + revert OnlyPendingAdministrator(msg.sender, localToken); + } + + config.administrator = msg.sender; + config.pendingAdministrator = address(0); + + emit AdministratorTransferred(localToken, msg.sender); + } + + // ================================================================ + // │ Administrator config │ + // ================================================================ + + /// @notice Public getter to check for permissions of an administrator + function isAdministrator(address localToken, address administrator) external view returns (bool) { + return s_tokenConfig[localToken].administrator == administrator; + } + + /// @inheritdoc ITokenAdminRegistry + /// @dev Can only be called by a registry module. + function proposeAdministrator(address localToken, address administrator) external { + if (!isRegistryModule(msg.sender) && msg.sender != owner()) { + revert OnlyRegistryModuleOrOwner(msg.sender); + } + if (administrator == address(0)) { + revert ZeroAddress(); + } + TokenConfig storage config = s_tokenConfig[localToken]; + + if (config.administrator != address(0)) { + revert AlreadyRegistered(localToken); + } + + config.pendingAdministrator = administrator; + + // We don't care if it's already in the set, as it's a no-op. + s_tokens.add(localToken); + + emit AdministratorTransferRequested(localToken, address(0), administrator); + } + + // ================================================================ + // │ Registry Modules │ + // ================================================================ + + /// @notice Checks if an address is a registry module. + /// @param module The address to check. + /// @return True if the address is a registry module, false otherwise. + function isRegistryModule(address module) public view returns (bool) { + return s_registryModules.contains(module); + } + + /// @notice Adds a new registry module to the list of allowed modules. + /// @param module The module to add. + function addRegistryModule(address module) external onlyOwner { + if (s_registryModules.add(module)) { + emit RegistryModuleAdded(module); + } + } + + /// @notice Removes a registry module from the list of allowed modules. + /// @param module The module to remove. + function removeRegistryModule(address module) external onlyOwner { + if (s_registryModules.remove(module)) { + emit RegistryModuleRemoved(module); + } + } + + // ================================================================ + // │ Access │ + // ================================================================ + + /// @notice Checks if an address is the administrator of the given token. + modifier onlyTokenAdmin(address token) { + if (s_tokenConfig[token].administrator != msg.sender) { + revert OnlyAdministrator(msg.sender, token); + } + _; + } +} diff --git a/contracts/src/v0.8/ccip/v1.5-CCIP-License-grants.md b/contracts/src/v0.8/ccip/v1.5-CCIP-License-grants.md new file mode 100644 index 00000000000..ef0f55ea924 --- /dev/null +++ b/contracts/src/v0.8/ccip/v1.5-CCIP-License-grants.md @@ -0,0 +1,8 @@ +v1.5-CCIP-License-grants + +Additional Use Grant(s): + +You may make use of the Cross-Chain Interoperability Protocol v1.5 (which is available subject to the license here, the “Licensed Work ”) solely for purposes of + +1. importing client-side libraries or example clients to facilitate the integration of the Licensed Work into your application. +2. Developing, deploying and operating [the token pool contracts](./pools) solely for purposes of the integration and use of CCIP. \ No newline at end of file diff --git a/contracts/src/v0.8/functions/dev/v1_X/FunctionsBilling.sol b/contracts/src/v0.8/functions/dev/v1_X/FunctionsBilling.sol index c973f55a715..75420fe71d1 100644 --- a/contracts/src/v0.8/functions/dev/v1_X/FunctionsBilling.sol +++ b/contracts/src/v0.8/functions/dev/v1_X/FunctionsBilling.sol @@ -199,13 +199,15 @@ abstract contract FunctionsBilling is Routable, IFunctionsBilling { gasPriceWei = s_config.minimumEstimateGasPriceWei; } - uint256 gasPriceWithOverestimation = gasPriceWei + - ((gasPriceWei * s_config.fulfillmentGasPriceOverEstimationBP) / 10_000); - /// @NOTE: Basis Points are 1/100th of 1%, divide by 10_000 to bring back to original units - uint256 executionGas = s_config.gasOverheadBeforeCallback + s_config.gasOverheadAfterCallback + callbackGasLimit; - uint256 l1FeeWei = ChainSpecificUtil._getCurrentTxL1GasFees(msg.data); - uint96 estimatedGasReimbursementJuels = _getJuelsFromWei((gasPriceWithOverestimation * executionGas) + l1FeeWei); + uint256 l1FeeWei = ChainSpecificUtil._getL1FeeUpperLimit(s_config.transmitTxSizeBytes); + uint256 totalFeeWei = (gasPriceWei * executionGas) + l1FeeWei; + + // Basis Points are 1/100th of 1%, divide by 10_000 to bring back to original units + uint256 totalFeeWeiWithOverestimate = totalFeeWei + + ((totalFeeWei * s_config.fulfillmentGasPriceOverEstimationBP) / 10_000); + + uint96 estimatedGasReimbursementJuels = _getJuelsFromWei(totalFeeWeiWithOverestimate); uint96 feesJuels = uint96(donFeeJuels) + uint96(adminFeeJuels) + uint96(operationFeeJuels); @@ -298,7 +300,7 @@ abstract contract FunctionsBilling is Routable, IFunctionsBilling { FunctionsResponse.Commitment memory commitment = abi.decode(onchainMetadata, (FunctionsResponse.Commitment)); uint256 gasOverheadWei = (commitment.gasOverheadBeforeCallback + commitment.gasOverheadAfterCallback) * tx.gasprice; - uint256 l1FeeShareWei = ChainSpecificUtil._getCurrentTxL1GasFees(msg.data) / reportBatchSize; + uint256 l1FeeShareWei = ChainSpecificUtil._getL1FeeUpperLimit(msg.data.length) / reportBatchSize; // Gas overhead without callback uint96 gasOverheadJuels = _getJuelsFromWei(gasOverheadWei + l1FeeShareWei); uint96 juelsPerGas = _getJuelsFromWei(tx.gasprice); diff --git a/contracts/src/v0.8/functions/dev/v1_X/FunctionsCoordinator.sol b/contracts/src/v0.8/functions/dev/v1_X/FunctionsCoordinator.sol index f0bec7c3e9c..69d6f3a7b0a 100644 --- a/contracts/src/v0.8/functions/dev/v1_X/FunctionsCoordinator.sol +++ b/contracts/src/v0.8/functions/dev/v1_X/FunctionsCoordinator.sol @@ -16,7 +16,7 @@ contract FunctionsCoordinator is OCR2Base, IFunctionsCoordinator, FunctionsBilli using FunctionsResponse for FunctionsResponse.FulfillResult; /// @inheritdoc ITypeAndVersion - string public constant override typeAndVersion = "Functions Coordinator v1.3.0"; + string public constant override typeAndVersion = "Functions Coordinator v1.3.1"; event OracleRequest( bytes32 indexed requestId, diff --git a/contracts/src/v0.8/functions/dev/v1_X/accessControl/TermsOfServiceAllowList.sol b/contracts/src/v0.8/functions/dev/v1_X/accessControl/TermsOfServiceAllowList.sol index 04604e67974..0ba8e5d6ca5 100644 --- a/contracts/src/v0.8/functions/dev/v1_X/accessControl/TermsOfServiceAllowList.sol +++ b/contracts/src/v0.8/functions/dev/v1_X/accessControl/TermsOfServiceAllowList.sol @@ -16,7 +16,8 @@ contract TermsOfServiceAllowList is ITermsOfServiceAllowList, IAccessController, using EnumerableSet for EnumerableSet.AddressSet; /// @inheritdoc ITypeAndVersion - string public constant override typeAndVersion = "Functions Terms of Service Allow List v1.1.0"; + string public constant override typeAndVersion = "Functions Terms of Service Allow List v1.1.1"; + address private s_previousToSContract; EnumerableSet.AddressSet private s_allowedSenders; EnumerableSet.AddressSet private s_blockedSenders; @@ -29,6 +30,7 @@ contract TermsOfServiceAllowList is ITermsOfServiceAllowList, IAccessController, error InvalidUsage(); error RecipientIsBlocked(); error InvalidCalldata(); + error NoPreviousToSContract(); TermsOfServiceAllowListConfig private s_config; @@ -41,7 +43,8 @@ contract TermsOfServiceAllowList is ITermsOfServiceAllowList, IAccessController, constructor( TermsOfServiceAllowListConfig memory config, address[] memory initialAllowedSenders, - address[] memory initialBlockedSenders + address[] memory initialBlockedSenders, + address previousToSContract ) ConfirmedOwner(msg.sender) { updateConfig(config); @@ -56,6 +59,8 @@ contract TermsOfServiceAllowList is ITermsOfServiceAllowList, IAccessController, } s_blockedSenders.add(initialBlockedSenders[j]); } + + s_previousToSContract = previousToSContract; } // ================================================================ @@ -197,4 +202,19 @@ contract TermsOfServiceAllowList is ITermsOfServiceAllowList, IAccessController, return blockedSenders; } + + /// @inheritdoc ITermsOfServiceAllowList + function migratePreviouslyAllowedSenders(address[] memory previousSendersToAdd) external override onlyOwner { + if (s_previousToSContract == address(0)) { + revert NoPreviousToSContract(); + } + IAccessController previousToSContract = IAccessController(s_previousToSContract); + for (uint256 i = 0; i < previousSendersToAdd.length; ++i) { + if (previousToSContract.hasAccess(previousSendersToAdd[i], "")) { + if (!s_blockedSenders.contains(previousSendersToAdd[i])) { + s_allowedSenders.add(previousSendersToAdd[i]); + } + } + } + } } diff --git a/contracts/src/v0.8/functions/dev/v1_X/accessControl/interfaces/ITermsOfServiceAllowList.sol b/contracts/src/v0.8/functions/dev/v1_X/accessControl/interfaces/ITermsOfServiceAllowList.sol index 65db9c42b69..32a0ecef798 100644 --- a/contracts/src/v0.8/functions/dev/v1_X/accessControl/interfaces/ITermsOfServiceAllowList.sol +++ b/contracts/src/v0.8/functions/dev/v1_X/accessControl/interfaces/ITermsOfServiceAllowList.sol @@ -69,6 +69,10 @@ interface ITermsOfServiceAllowList { uint64 blockedSenderIdxStart, uint64 blockedSenderIdxEnd ) external view returns (address[] memory blockedSenders); + + /// @notice Enables migrating any previously allowed senders to the new contract + /// @param previousSendersToAdd - List of addresses to migrate. These address must be allowed on the previous ToS contract and not blocked + function migratePreviouslyAllowedSenders(address[] memory previousSendersToAdd) external; } // ================================================================ diff --git a/contracts/src/v0.8/functions/dev/v1_X/interfaces/IFunctionsBilling.sol b/contracts/src/v0.8/functions/dev/v1_X/interfaces/IFunctionsBilling.sol index ecf15c68f0d..0f31f7f2344 100644 --- a/contracts/src/v0.8/functions/dev/v1_X/interfaces/IFunctionsBilling.sol +++ b/contracts/src/v0.8/functions/dev/v1_X/interfaces/IFunctionsBilling.sol @@ -69,5 +69,6 @@ struct FunctionsBillingConfig { uint224 fallbackNativePerUnitLink; // ═══════════╗ Fallback NATIVE CURRENCY / LINK conversion rate if the data feed is stale uint32 requestTimeoutSeconds; // ════════════════╝ How many seconds it takes before we consider a request to be timed out uint16 donFeeCentsUsd; // ═══════════════════════════════╗ Additional flat fee (denominated in cents of USD, paid as LINK) that will be split between Node Operators. - uint16 operationFeeCentsUsd; // ═════════════════════════╝ Additional flat fee (denominated in cents of USD, paid as LINK) that will be paid to the owner of the Coordinator contract. + uint16 operationFeeCentsUsd; // ║ Additional flat fee (denominated in cents of USD, paid as LINK) that will be paid to the owner of the Coordinator contract. + uint16 transmitTxSizeBytes; // ══════════════════════════╝ The size of the calldata for the transmit transaction in bytes assuming a single 256 byte response payload. Used to estimate L1 cost for fulfillments on L2 chains. } diff --git a/contracts/src/v0.8/functions/dev/v1_X/libraries/ChainSpecificUtil.sol b/contracts/src/v0.8/functions/dev/v1_X/libraries/ChainSpecificUtil.sol index 574d1bf1645..d4c4b5f4426 100644 --- a/contracts/src/v0.8/functions/dev/v1_X/libraries/ChainSpecificUtil.sol +++ b/contracts/src/v0.8/functions/dev/v1_X/libraries/ChainSpecificUtil.sol @@ -2,17 +2,19 @@ pragma solidity ^0.8.19; import {ArbGasInfo} from "../../../../vendor/@arbitrum/nitro-contracts/src/precompiles/ArbGasInfo.sol"; -import {GasPriceOracle} from "../../../../vendor/@eth-optimism/contracts-bedrock/v0.16.2/src/L2/GasPriceOracle.sol"; +import {GasPriceOracle} from "../../../../vendor/@eth-optimism/contracts-bedrock/v0.17.3/src/L2/GasPriceOracle.sol"; /// @dev A library that abstracts out opcodes that behave differently across chains. /// @dev The methods below return values that are pertinent to the given chain. library ChainSpecificUtil { // ------------ Start Arbitrum Constants ------------ - /// @dev ARBGAS_ADDR is the address of the ArbGasInfo precompile on Arbitrum. /// @dev reference: https://github.com/OffchainLabs/nitro/blob/v2.0.14/contracts/src/precompiles/ArbGasInfo.sol#L10 address private constant ARBGAS_ADDR = address(0x000000000000000000000000000000000000006C); ArbGasInfo private constant ARBGAS = ArbGasInfo(ARBGAS_ADDR); + /// @dev ARB_DATA_PADDING_SIZE is the max size of the "static" data on Arbitrum for the transaction which refers to the tx data that is not the calldata (signature, etc.) + /// @dev reference: https://docs.arbitrum.io/build-decentralized-apps/how-to-estimate-gas#where-do-we-get-all-this-information-from + uint256 private constant ARB_DATA_PADDING_SIZE = 140; uint256 private constant ARB_MAINNET_CHAIN_ID = 42161; uint256 private constant ARB_GOERLI_TESTNET_CHAIN_ID = 421613; @@ -21,13 +23,9 @@ library ChainSpecificUtil { // ------------ End Arbitrum Constants ------------ // ------------ Start Optimism Constants ------------ - /// @dev L1_FEE_DATA_PADDING includes 35 bytes for L1 data padding for Optimism - bytes internal constant L1_FEE_DATA_PADDING = - "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"; - /// @dev OVM_GASPRICEORACLE_ADDR is the address of the GasPriceOracle precompile on Optimism. - /// @dev reference: https://community.optimism.io/docs/developers/build/transaction-fees/#estimating-the-l1-data-fee - address private constant OVM_GASPRICEORACLE_ADDR = address(0x420000000000000000000000000000000000000F); - GasPriceOracle private constant OVM_GASPRICEORACLE = GasPriceOracle(OVM_GASPRICEORACLE_ADDR); + /// @dev GAS_PRICE_ORACLE_ADDR is the address of the GasPriceOracle precompile on Optimism. + address private constant GAS_PRICE_ORACLE_ADDR = address(0x420000000000000000000000000000000000000F); + GasPriceOracle private constant GAS_PRICE_ORACLE = GasPriceOracle(GAS_PRICE_ORACLE_ADDR); uint256 private constant OP_MAINNET_CHAIN_ID = 10; uint256 private constant OP_GOERLI_CHAIN_ID = 420; @@ -40,18 +38,17 @@ library ChainSpecificUtil { // ------------ End Optimism Constants ------------ - /// @notice Returns the L1 fees in wei that will be paid for the current transaction, given any calldata - /// @notice for the current transaction. - /// @notice When on a known Arbitrum chain, it uses ArbGas.getCurrentTxL1GasFees to get the fees. - /// @notice On Arbitrum, the provided calldata is not used to calculate the fees. - /// @notice On Optimism, the provided calldata is passed to the GasPriceOracle predeploy - /// @notice and getL1Fee is called to get the fees. - function _getCurrentTxL1GasFees(bytes memory txCallData) internal view returns (uint256 l1FeeWei) { + /// @notice Returns the upper limit estimate of the L1 fees in wei that will be paid for L2 chains + /// @notice based on the size of the transaction data and the current gas conditions. + /// @notice This is an "upper limit" as it assumes the transaction data is uncompressed when posted on L1. + function _getL1FeeUpperLimit(uint256 calldataSizeBytes) internal view returns (uint256 l1FeeWei) { uint256 chainid = block.chainid; if (_isArbitrumChainId(chainid)) { - return ARBGAS.getCurrentTxL1GasFees(); + // https://docs.arbitrum.io/build-decentralized-apps/how-to-estimate-gas#where-do-we-get-all-this-information-from + (, uint256 l1PricePerByte, , , , ) = ARBGAS.getPricesInWei(); + return l1PricePerByte * (calldataSizeBytes + ARB_DATA_PADDING_SIZE); } else if (_isOptimismChainId(chainid)) { - return OVM_GASPRICEORACLE.getL1Fee(bytes.concat(txCallData, L1_FEE_DATA_PADDING)); + return GAS_PRICE_ORACLE.getL1FeeUpperBound(calldataSizeBytes); } return 0; } diff --git a/contracts/src/v0.8/functions/tests/v1_X/ChainSpecificUtil.t.sol b/contracts/src/v0.8/functions/tests/v1_X/ChainSpecificUtil.t.sol index 5384a66d912..d57d5113e89 100644 --- a/contracts/src/v0.8/functions/tests/v1_X/ChainSpecificUtil.t.sol +++ b/contracts/src/v0.8/functions/tests/v1_X/ChainSpecificUtil.t.sol @@ -11,22 +11,31 @@ import {FunctionsResponse} from "../../dev/v1_X/libraries/FunctionsResponse.sol" import {FunctionsFulfillmentSetup} from "./Setup.t.sol"; import {ArbGasInfo} from "../../../vendor/@arbitrum/nitro-contracts/src/precompiles/ArbGasInfo.sol"; -import {OVM_GasPriceOracle} from "../../../vendor/@eth-optimism/contracts/v0.8.9/contracts/L2/predeploys/OVM_GasPriceOracle.sol"; +import {GasPriceOracle} from "../../../vendor/@eth-optimism/contracts-bedrock/v0.17.3/src/L2/GasPriceOracle.sol"; -/// @notice #_getCurrentTxL1GasFees Arbitrum +/// @notice #_getL1FeeUpperLimit Arbitrum /// @dev Arbitrum gas formula = L2 Gas Price * (Gas used on L2 + Extra Buffer for L1 cost) /// @dev where Extra Buffer for L1 cost = (L1 Estimated Cost / L2 Gas Price) -contract ChainSpecificUtil__getCurrentTxL1GasFees_Arbitrum is FunctionsFulfillmentSetup { +contract ChainSpecificUtil__getL1FeeUpperLimit_Arbitrum is FunctionsFulfillmentSetup { address private constant ARBGAS_ADDR = address(0x000000000000000000000000000000000000006C); - uint256 private constant L1_FEE_WEI = 15_818_209_764_247; + uint256 private constant WEI_PER_L1_CALLDATA_BYTE = 2_243_708_528; + uint256 private constant L1_FEE_ESTIMATE_WITH_OVERESTIMATION_WEI = 6_408_031_555_968; + uint256 private constant L1_FEE_WEI = 3_697_631_654_144; + + uint96 l1FeeEstimateJuels = uint96((1e18 * L1_FEE_ESTIMATE_WITH_OVERESTIMATION_WEI) / uint256(LINK_ETH_RATE)); uint96 l1FeeJuels = uint96((1e18 * L1_FEE_WEI) / uint256(LINK_ETH_RATE)); function setUp() public virtual override { - vm.mockCall(ARBGAS_ADDR, abi.encodeWithSelector(ArbGasInfo.getCurrentTxL1GasFees.selector), abi.encode(L1_FEE_WEI)); + uint256 unused = 0; + vm.mockCall( + ARBGAS_ADDR, + abi.encodeWithSelector(ArbGasInfo.getPricesInWei.selector), + abi.encode(unused, WEI_PER_L1_CALLDATA_BYTE, unused, unused, unused, unused) + ); } - function test__getCurrentTxL1GasFees_SuccessWhenArbitrumMainnet() public { + function test__getL1FeeUpperLimit_SuccessWhenArbitrumMainnet() public { // Set the chainID vm.chainId(42161); @@ -35,15 +44,19 @@ contract ChainSpecificUtil__getCurrentTxL1GasFees_Arbitrum is FunctionsFulfillme // Check request cost estimate uint96 expectedEstimatedTotalCostJuels = _getExpectedCostEstimate(s_requests[1].requestData.callbackGasLimit) + - l1FeeJuels; - assertEq(s_requests[1].commitment.estimatedTotalCostJuels, expectedEstimatedTotalCostJuels); + l1FeeEstimateJuels; + assertEq( + s_requests[1].commitment.estimatedTotalCostJuels, + expectedEstimatedTotalCostJuels, + "Estimated cost mismatch for Arbitrum mainnet" + ); // Check response actual cost uint96 expectedTotalCostJuels = _getExpectedCost(5416) + l1FeeJuels; - assertEq(s_responses[1].totalCostJuels, expectedTotalCostJuels); + assertEq(s_responses[1].totalCostJuels, expectedTotalCostJuels, "Response cost mismatch for Arbitrum mainnet"); } - function test__getCurrentTxL1GasFees_SuccessWhenArbitrumGoerli() public { + function test__getL1FeeUpperLimit_SuccessWhenArbitrumGoerli() public { // Set the chainID vm.chainId(421613); @@ -52,15 +65,19 @@ contract ChainSpecificUtil__getCurrentTxL1GasFees_Arbitrum is FunctionsFulfillme // Check request cost estimate uint96 expectedEstimatedTotalCostJuels = _getExpectedCostEstimate(s_requests[1].requestData.callbackGasLimit) + - l1FeeJuels; - assertEq(s_requests[1].commitment.estimatedTotalCostJuels, expectedEstimatedTotalCostJuels); + l1FeeEstimateJuels; + assertEq( + s_requests[1].commitment.estimatedTotalCostJuels, + expectedEstimatedTotalCostJuels, + "Estimated cost mismatch for Arbitrum Goerli" + ); // Check response actual cost uint96 expectedTotalCostJuels = _getExpectedCost(5416) + l1FeeJuels; - assertEq(s_responses[1].totalCostJuels, expectedTotalCostJuels); + assertEq(s_responses[1].totalCostJuels, expectedTotalCostJuels, "Response cost mismatch for Arbitrum Goerli"); } - function test__getCurrentTxL1GasFees_SuccessWhenArbitrumSepolia() public { + function test__getL1FeeUpperLimit_SuccessWhenArbitrumSepolia() public { // Set the chainID vm.chainId(421614); @@ -69,33 +86,43 @@ contract ChainSpecificUtil__getCurrentTxL1GasFees_Arbitrum is FunctionsFulfillme // Check request cost estimate uint96 expectedEstimatedTotalCostJuels = _getExpectedCostEstimate(s_requests[1].requestData.callbackGasLimit) + - l1FeeJuels; - assertEq(s_requests[1].commitment.estimatedTotalCostJuels, expectedEstimatedTotalCostJuels); + l1FeeEstimateJuels; + assertEq( + s_requests[1].commitment.estimatedTotalCostJuels, + expectedEstimatedTotalCostJuels, + "Estimated cost mismatch for Arbitrum Sepolia" + ); // Check response actual cost uint96 expectedTotalCostJuels = _getExpectedCost(5416) + l1FeeJuels; - assertEq(s_responses[1].totalCostJuels, expectedTotalCostJuels); + assertEq(s_responses[1].totalCostJuels, expectedTotalCostJuels, "Response cost mismatch for Arbitrum Sepolia"); } } -/// @notice #_getCurrentTxL1GasFees Optimism -/// @dev Optimism gas formula = ((l2_base_fee + l2_priority_fee) * l2_gas_used) + L1 data fee -/// @dev where L1 data fee = l1_gas_price * ((count_zero_bytes(tx_data) * 4 + count_non_zero_bytes(tx_data) * 16) + fixed_overhead + noncalldata_gas) * dynamic_overhead -contract ChainSpecificUtil__getCurrentTxL1GasFees_Optimism is FunctionsFulfillmentSetup { - address private constant OVM_GASPRICEORACLE_ADDR = address(0x420000000000000000000000000000000000000F); - uint256 private constant L1_FEE_WEI = 15_818_209_764_247; +/// @notice #_getL1FeeUpperLimit Optimism +/// @dev Optimism gas formula: https://docs.optimism.io/stack/transactions/fees#ecotone +/// @dev Note that the docs fail to mention the calculation also requires a division by 10^6 +/// @dev See here: https://github.com/ethereum-optimism/specs/blob/main/specs/protocol/exec-engine.md#ecotone-l1-cost-fee-changes-eip-4844-da +/// @dev Also, we conservatively assume all non-zero bytes: tx_compressed_size = tx_data_size_bytes +contract ChainSpecificUtil__getL1FeeUpperLimit_Optimism is FunctionsFulfillmentSetup { + address private constant GAS_PRICE_ORACLE_ADDR = address(0x420000000000000000000000000000000000000F); + GasPriceOracle private constant GAS_PRICE_ORACLE = GasPriceOracle(GAS_PRICE_ORACLE_ADDR); + + uint256 private constant L1_FEE_WEI = 1_648_118_885_618; + uint256 private constant L1_FEE_ESTIMATE_WITH_OVERESTIMATION_WEI = (L1_FEE_WEI * (10_000 + 5_000)) / 10_000; + uint96 l1FeeEstimateJuels = uint96((1e18 * L1_FEE_ESTIMATE_WITH_OVERESTIMATION_WEI) / uint256(LINK_ETH_RATE)); uint96 l1FeeJuels = uint96((1e18 * L1_FEE_WEI) / uint256(LINK_ETH_RATE)); function setUp() public virtual override { vm.mockCall( - OVM_GASPRICEORACLE_ADDR, - abi.encodeWithSelector(OVM_GasPriceOracle.getL1Fee.selector), + GAS_PRICE_ORACLE_ADDR, + abi.encodeWithSelector(GAS_PRICE_ORACLE.getL1FeeUpperBound.selector), abi.encode(L1_FEE_WEI) ); } - function test__getCurrentTxL1GasFees_SuccessWhenOptimismMainnet() public { + function test__getL1FeeUpperLimit_SuccessWhenOptimismMainnet() public { // Set the chainID vm.chainId(10); @@ -104,15 +131,19 @@ contract ChainSpecificUtil__getCurrentTxL1GasFees_Optimism is FunctionsFulfillme // Check request cost estimate uint96 expectedEstimatedTotalCostJuels = _getExpectedCostEstimate(s_requests[1].requestData.callbackGasLimit) + - l1FeeJuels; - assertEq(s_requests[1].commitment.estimatedTotalCostJuels, expectedEstimatedTotalCostJuels); + l1FeeEstimateJuels; + assertEq( + s_requests[1].commitment.estimatedTotalCostJuels, + expectedEstimatedTotalCostJuels, + "Estimated cost mismatch for Optimism mainnet" + ); // Check response actual cost uint96 expectedTotalCostJuels = _getExpectedCost(5416) + l1FeeJuels; - assertEq(s_responses[1].totalCostJuels, expectedTotalCostJuels); + assertEq(s_responses[1].totalCostJuels, expectedTotalCostJuels, "Response cost mismatch for Optimism mainnet"); } - function test__getCurrentTxL1GasFees_SuccessWhenOptimismGoerli() public { + function test__getL1FeeUpperLimit_SuccessWhenOptimismGoerli() public { // Set the chainID vm.chainId(420); @@ -121,15 +152,19 @@ contract ChainSpecificUtil__getCurrentTxL1GasFees_Optimism is FunctionsFulfillme // Check request cost estimate uint96 expectedEstimatedTotalCostJuels = _getExpectedCostEstimate(s_requests[1].requestData.callbackGasLimit) + - l1FeeJuels; - assertEq(s_requests[1].commitment.estimatedTotalCostJuels, expectedEstimatedTotalCostJuels); + l1FeeEstimateJuels; + assertEq( + s_requests[1].commitment.estimatedTotalCostJuels, + expectedEstimatedTotalCostJuels, + "Estimated cost mismatch for Optimism Goerli" + ); // Check response actual cost uint96 expectedTotalCostJuels = _getExpectedCost(5416) + l1FeeJuels; - assertEq(s_responses[1].totalCostJuels, expectedTotalCostJuels); + assertEq(s_responses[1].totalCostJuels, expectedTotalCostJuels, "Response cost mismatch for Optimism Goerli"); } - function test__getCurrentTxL1GasFees_SuccessWhenOptimismSepolia() public { + function test__getL1FeeUpperLimit_SuccessWhenOptimismSepolia() public { // Set the chainID vm.chainId(11155420); @@ -138,33 +173,40 @@ contract ChainSpecificUtil__getCurrentTxL1GasFees_Optimism is FunctionsFulfillme // Check request cost estimate uint96 expectedEstimatedTotalCostJuels = _getExpectedCostEstimate(s_requests[1].requestData.callbackGasLimit) + - l1FeeJuels; - assertEq(s_requests[1].commitment.estimatedTotalCostJuels, expectedEstimatedTotalCostJuels); + l1FeeEstimateJuels; + assertEq( + s_requests[1].commitment.estimatedTotalCostJuels, + expectedEstimatedTotalCostJuels, + "Estimated cost mismatch for Optimism Sepolia" + ); // Check response actual cost uint96 expectedTotalCostJuels = _getExpectedCost(5416) + l1FeeJuels; - assertEq(s_responses[1].totalCostJuels, expectedTotalCostJuels); + assertEq(s_responses[1].totalCostJuels, expectedTotalCostJuels, "Response cost mismatch for Optimism Sepolia"); } } -/// @notice #_getCurrentTxL1GasFees Base -/// @dev Base gas formula uses Optimism formula = ((l2_base_fee + l2_priority_fee) * l2_gas_used) + L1 data fee -/// @dev where L1 data fee = l1_gas_price * ((count_zero_bytes(tx_data) * 4 + count_non_zero_bytes(tx_data) * 16) + fixed_overhead + noncalldata_gas) * dynamic_overhead -contract ChainSpecificUtil__getCurrentTxL1GasFees_Base is FunctionsFulfillmentSetup { - address private constant OVM_GASPRICEORACLE_ADDR = address(0x420000000000000000000000000000000000000F); - uint256 private constant L1_FEE_WEI = 15_818_209_764_247; +/// @notice #_getL1FeeUpperLimit Base +/// @dev Base gas formula uses Optimism formula since it is build on the OP chain stack (See comments above for Optimism tests) +contract ChainSpecificUtil__getL1FeeUpperLimit_Base is FunctionsFulfillmentSetup { + address private constant GAS_PRICE_ORACLE_ADDR = address(0x420000000000000000000000000000000000000F); + GasPriceOracle private constant GAS_PRICE_ORACLE = GasPriceOracle(GAS_PRICE_ORACLE_ADDR); + + uint256 private constant L1_FEE_WEI = 1_648_118_885_618; + uint256 private constant L1_FEE_ESTIMATE_WITH_OVERESTIMATION_WEI = (L1_FEE_WEI * (10_000 + 5_000)) / 10_000; + uint96 l1FeeEstimateJuels = uint96((1e18 * L1_FEE_ESTIMATE_WITH_OVERESTIMATION_WEI) / uint256(LINK_ETH_RATE)); uint96 l1FeeJuels = uint96((1e18 * L1_FEE_WEI) / uint256(LINK_ETH_RATE)); function setUp() public virtual override { vm.mockCall( - OVM_GASPRICEORACLE_ADDR, - abi.encodeWithSelector(OVM_GasPriceOracle.getL1Fee.selector), + GAS_PRICE_ORACLE_ADDR, + abi.encodeWithSelector(GAS_PRICE_ORACLE.getL1FeeUpperBound.selector), abi.encode(L1_FEE_WEI) ); } - function test__getCurrentTxL1GasFees_SuccessWhenBaseMainnet() public { + function test__getL1FeeUpperLimit_SuccessWhenBaseMainnet() public { // Set the chainID vm.chainId(8453); @@ -173,15 +215,19 @@ contract ChainSpecificUtil__getCurrentTxL1GasFees_Base is FunctionsFulfillmentSe // Check request cost estimate uint96 expectedEstimatedTotalCostJuels = _getExpectedCostEstimate(s_requests[1].requestData.callbackGasLimit) + - l1FeeJuels; - assertEq(s_requests[1].commitment.estimatedTotalCostJuels, expectedEstimatedTotalCostJuels); + l1FeeEstimateJuels; + assertEq( + s_requests[1].commitment.estimatedTotalCostJuels, + expectedEstimatedTotalCostJuels, + "Estimated cost mismatch for Base mainnet" + ); // Check response actual cost uint96 expectedTotalCostJuels = _getExpectedCost(5416) + l1FeeJuels; - assertEq(s_responses[1].totalCostJuels, expectedTotalCostJuels); + assertEq(s_responses[1].totalCostJuels, expectedTotalCostJuels, "Response cost mismatch for Base mainnet"); } - function test__getCurrentTxL1GasFees_SuccessWhenBaseGoerli() public { + function test__getL1FeeUpperLimit_SuccessWhenBaseGoerli() public { // Set the chainID vm.chainId(84531); @@ -190,15 +236,19 @@ contract ChainSpecificUtil__getCurrentTxL1GasFees_Base is FunctionsFulfillmentSe // Check request cost estimate uint96 expectedEstimatedTotalCostJuels = _getExpectedCostEstimate(s_requests[1].requestData.callbackGasLimit) + - l1FeeJuels; - assertEq(s_requests[1].commitment.estimatedTotalCostJuels, expectedEstimatedTotalCostJuels); + l1FeeEstimateJuels; + assertEq( + s_requests[1].commitment.estimatedTotalCostJuels, + expectedEstimatedTotalCostJuels, + "Estimated cost mismatch for Base Goerli" + ); // Check response actual cost uint96 expectedTotalCostJuels = _getExpectedCost(5416) + l1FeeJuels; - assertEq(s_responses[1].totalCostJuels, expectedTotalCostJuels); + assertEq(s_responses[1].totalCostJuels, expectedTotalCostJuels, "Response cost mismatch for Base Goerli"); } - function test__getCurrentTxL1GasFees_SuccessWhenBaseSepolia() public { + function test__getL1FeeUpperLimit_SuccessWhenBaseSepolia() public { // Set the chainID vm.chainId(84532); @@ -207,11 +257,15 @@ contract ChainSpecificUtil__getCurrentTxL1GasFees_Base is FunctionsFulfillmentSe // Check request cost estimate uint96 expectedEstimatedTotalCostJuels = _getExpectedCostEstimate(s_requests[1].requestData.callbackGasLimit) + - l1FeeJuels; - assertEq(s_requests[1].commitment.estimatedTotalCostJuels, expectedEstimatedTotalCostJuels); + l1FeeEstimateJuels; + assertEq( + s_requests[1].commitment.estimatedTotalCostJuels, + expectedEstimatedTotalCostJuels, + "Estimated cost mismatch for Base Sepolia" + ); // Check response actual cost uint96 expectedTotalCostJuels = _getExpectedCost(5416) + l1FeeJuels; - assertEq(s_responses[1].totalCostJuels, expectedTotalCostJuels); + assertEq(s_responses[1].totalCostJuels, expectedTotalCostJuels, "Response cost mismatch for Base Sepolia"); } } diff --git a/contracts/src/v0.8/functions/tests/v1_X/FunctionsBilling.t.sol b/contracts/src/v0.8/functions/tests/v1_X/FunctionsBilling.t.sol index 774fe4e875c..b66c1e42f90 100644 --- a/contracts/src/v0.8/functions/tests/v1_X/FunctionsBilling.t.sol +++ b/contracts/src/v0.8/functions/tests/v1_X/FunctionsBilling.t.sol @@ -59,7 +59,8 @@ contract FunctionsBilling_UpdateConfig is FunctionsRouterSetup { fallbackNativePerUnitLink: getCoordinatorConfig().fallbackNativePerUnitLink * 2, fallbackUsdPerUnitLink: getCoordinatorConfig().fallbackUsdPerUnitLink * 2, fallbackUsdPerUnitLinkDecimals: getCoordinatorConfig().fallbackUsdPerUnitLinkDecimals * 2, - minimumEstimateGasPriceWei: getCoordinatorConfig().minimumEstimateGasPriceWei * 2 + minimumEstimateGasPriceWei: getCoordinatorConfig().minimumEstimateGasPriceWei * 2, + transmitTxSizeBytes: getCoordinatorConfig().transmitTxSizeBytes * 2 }); } diff --git a/contracts/src/v0.8/functions/tests/v1_X/FunctionsCoordinator.t.sol b/contracts/src/v0.8/functions/tests/v1_X/FunctionsCoordinator.t.sol index 3944c5873b1..03d9f645146 100644 --- a/contracts/src/v0.8/functions/tests/v1_X/FunctionsCoordinator.t.sol +++ b/contracts/src/v0.8/functions/tests/v1_X/FunctionsCoordinator.t.sol @@ -14,7 +14,7 @@ import {FunctionsRouterSetup, FunctionsDONSetup, FunctionsSubscriptionSetup} fro /// @notice #constructor contract FunctionsCoordinator_Constructor is FunctionsRouterSetup { function test_Constructor_Success() public { - assertEq(s_functionsCoordinator.typeAndVersion(), "Functions Coordinator v1.3.0"); + assertEq(s_functionsCoordinator.typeAndVersion(), "Functions Coordinator v1.3.1"); assertEq(s_functionsCoordinator.owner(), OWNER_ADDRESS); } } diff --git a/contracts/src/v0.8/functions/tests/v1_X/FunctionsTermsOfServiceAllowList.t.sol b/contracts/src/v0.8/functions/tests/v1_X/FunctionsTermsOfServiceAllowList.t.sol index e121f7b881d..9bf09748b89 100644 --- a/contracts/src/v0.8/functions/tests/v1_X/FunctionsTermsOfServiceAllowList.t.sol +++ b/contracts/src/v0.8/functions/tests/v1_X/FunctionsTermsOfServiceAllowList.t.sol @@ -11,7 +11,7 @@ import "forge-std/Vm.sol"; /// @notice #constructor contract FunctionsTermsOfServiceAllowList_Constructor is FunctionsRoutesSetup { function test_Constructor_Success() public { - assertEq(s_termsOfServiceAllowList.typeAndVersion(), "Functions Terms of Service Allow List v1.1.0"); + assertEq(s_termsOfServiceAllowList.typeAndVersion(), "Functions Terms of Service Allow List v1.1.1"); assertEq(s_termsOfServiceAllowList.owner(), OWNER_ADDRESS); } } @@ -511,3 +511,47 @@ contract FunctionsTermsOfServiceAllowList_GetBlockedSendersInRange is FunctionsR s_termsOfServiceAllowList.getBlockedSendersInRange(1, BlockedSendersCount + 1); } } + +/// @notice #migratePreviouslyAllowedSenders +contract FunctionsTermsOfServiceAllowList_MigratePreviouslyAllowedSenders is FunctionsRoutesSetup { + function setUp() public virtual override { + FunctionsRoutesSetup.setUp(); + } + + function test_MigratePreviouslyAllowedSenders_RevertIfNotOwner() public { + // Send as stranger + vm.stopPrank(); + vm.startPrank(STRANGER_ADDRESS); + + vm.expectRevert("Only callable by owner"); + address[] memory empty = new address[](0); + s_termsOfServiceAllowList.migratePreviouslyAllowedSenders(empty); + } + + function test_MigratePreviouslyAllowedSenders_Success() public { + address previouslyAllowedSender1 = 0x1000000000000000000000000000000000000000; + address previouslyAllowedSender2 = 0x2000000000000000000000000000000000000000; + address currentlyBlockedSender = 0xB000000000000000000000000000000000000000; + + address[] memory mockPreviousAllowlist = new address[](3); + mockPreviousAllowlist[0] = previouslyAllowedSender1; + mockPreviousAllowlist[1] = currentlyBlockedSender; + mockPreviousAllowlist[2] = previouslyAllowedSender2; + + s_termsOfServiceAllowList.blockSender(currentlyBlockedSender); + + vm.mockCall( + MOCK_PREVIOUS_TOS_ADDRESS, + abi.encodeWithSelector(TermsOfServiceAllowList.hasAccess.selector), + abi.encode(true) + ); + s_termsOfServiceAllowList.migratePreviouslyAllowedSenders(mockPreviousAllowlist); + + address[] memory currentlyAllowedSenders = s_termsOfServiceAllowList.getAllAllowedSenders(); + + address[] memory expectedAllowedSenders = new address[](2); + expectedAllowedSenders[0] = previouslyAllowedSender1; + expectedAllowedSenders[1] = previouslyAllowedSender2; + assertEq(currentlyAllowedSenders, expectedAllowedSenders); + } +} diff --git a/contracts/src/v0.8/functions/tests/v1_X/Setup.t.sol b/contracts/src/v0.8/functions/tests/v1_X/Setup.t.sol index 32dc53e42ab..444fc18fe81 100644 --- a/contracts/src/v0.8/functions/tests/v1_X/Setup.t.sol +++ b/contracts/src/v0.8/functions/tests/v1_X/Setup.t.sol @@ -37,6 +37,7 @@ contract FunctionsRouterSetup is BaseTest { int256 internal LINK_USD_RATE = 1_500_000_000; uint8 internal LINK_USD_DECIMALS = 8; + address public MOCK_PREVIOUS_TOS_ADDRESS = 0x746f730000000000000000000000000000000000; uint256 internal TOS_SIGNER_PRIVATE_KEY = 0x3; address internal TOS_SIGNER = vm.addr(TOS_SIGNER_PRIVATE_KEY); @@ -57,7 +58,8 @@ contract FunctionsRouterSetup is BaseTest { s_termsOfServiceAllowList = new TermsOfServiceAllowList( getTermsOfServiceConfig(), initialAllowedSenders, - initialBlockedSenders + initialBlockedSenders, + MOCK_PREVIOUS_TOS_ADDRESS ); } @@ -93,7 +95,8 @@ contract FunctionsRouterSetup is BaseTest { fallbackNativePerUnitLink: 5000000000000000, fallbackUsdPerUnitLink: 1400000000, fallbackUsdPerUnitLinkDecimals: 8, - minimumEstimateGasPriceWei: 1000000000 // 1 gwei + minimumEstimateGasPriceWei: 1000000000, // 1 gwei + transmitTxSizeBytes: 1764 }); } diff --git a/contracts/src/v0.8/keystone/CapabilitiesRegistry.sol b/contracts/src/v0.8/keystone/CapabilitiesRegistry.sol index 6b150dc5d74..68c59c7f8ca 100644 --- a/contracts/src/v0.8/keystone/CapabilitiesRegistry.sol +++ b/contracts/src/v0.8/keystone/CapabilitiesRegistry.sol @@ -3,8 +3,8 @@ pragma solidity 0.8.24; import {TypeAndVersionInterface} from "../interfaces/TypeAndVersionInterface.sol"; import {OwnerIsCreator} from "../shared/access/OwnerIsCreator.sol"; -import {IERC165} from "../vendor/openzeppelin-solidity/v4.8.3/contracts/interfaces/IERC165.sol"; import {EnumerableSet} from "../vendor/openzeppelin-solidity/v4.8.3/contracts/utils/structs/EnumerableSet.sol"; +import {ERC165Checker} from "../vendor/openzeppelin-solidity/v4.8.3/contracts/utils/introspection/ERC165Checker.sol"; import {ICapabilityConfiguration} from "./interfaces/ICapabilityConfiguration.sol"; /// @notice CapabilitiesRegistry is used to manage Nodes (including their links to Node @@ -396,7 +396,7 @@ contract CapabilitiesRegistry is OwnerIsCreator, TypeAndVersionInterface { /// @param donId The ID of the DON the config was set for /// @param configCount The number of times the DON has been /// configured - event ConfigSet(uint32 donId, uint32 configCount); + event ConfigSet(uint32 indexed donId, uint32 configCount); /// @notice This event is emitted when a new node operator is added /// @param nodeOperatorId The ID of the newly added node operator @@ -502,7 +502,7 @@ contract CapabilitiesRegistry is OwnerIsCreator, TypeAndVersionInterface { NodeOperator memory nodeOperator = nodeOperators[i]; if (nodeOperator.admin == address(0)) revert InvalidNodeOperatorAdmin(); - if (msg.sender != nodeOperator.admin && msg.sender != owner) revert AccessForbidden(msg.sender); + if (msg.sender != currentNodeOperator.admin && msg.sender != owner) revert AccessForbidden(msg.sender); if ( currentNodeOperator.admin != nodeOperator.admin || @@ -611,11 +611,12 @@ contract CapabilitiesRegistry is OwnerIsCreator, TypeAndVersionInterface { bool isOwner = msg.sender == owner(); for (uint256 i; i < nodes.length; ++i) { NodeParams memory node = nodes[i]; - NodeOperator memory nodeOperator = s_nodeOperators[node.nodeOperatorId]; - if (!isOwner && msg.sender != nodeOperator.admin) revert AccessForbidden(msg.sender); - Node storage storedNode = s_nodes[node.p2pId]; + NodeOperator memory nodeOperator = s_nodeOperators[storedNode.nodeOperatorId]; + if (storedNode.signer == bytes32("")) revert NodeDoesNotExist(node.p2pId); + if (!isOwner && msg.sender != nodeOperator.admin) revert AccessForbidden(msg.sender); + if (node.signer == bytes32("")) revert InvalidNodeSigner(); bytes32 previousSigner = storedNode.signer; @@ -774,7 +775,9 @@ contract CapabilitiesRegistry is OwnerIsCreator, TypeAndVersionInterface { /// @param nodes The nodes making up the DON /// @param capabilityConfigurations The list of configurations for the /// capabilities supported by the DON - /// @param isPublic True if the DON is public + /// @param isPublic True if the DON is can accept external capability requests + /// @param acceptsWorkflows True if the DON can accept workflows + /// @param f The maximum number of faulty nodes the DON can tolerate function addDON( bytes32[] calldata nodes, CapabilityConfiguration[] calldata capabilityConfigurations, @@ -796,24 +799,32 @@ contract CapabilitiesRegistry is OwnerIsCreator, TypeAndVersionInterface { /// the admin to reconfigure the list of capabilities supported /// by the DON, the list of nodes that make up the DON as well /// as whether or not the DON can accept external workflows + /// @param donId The ID of the DON to update /// @param nodes The nodes making up the DON /// @param capabilityConfigurations The list of configurations for the /// capabilities supported by the DON - /// @param isPublic True if the DON is can accept external workflows + /// @param isPublic True if the DON is can accept external capability requests + /// @param f The maximum number of nodes that can fail function updateDON( uint32 donId, bytes32[] calldata nodes, CapabilityConfiguration[] calldata capabilityConfigurations, bool isPublic, - bool acceptsWorkflows, uint8 f ) external onlyOwner { - uint32 configCount = s_dons[donId].configCount; + DON storage don = s_dons[donId]; + uint32 configCount = don.configCount; if (configCount == 0) revert DONDoesNotExist(donId); _setDONConfig( nodes, capabilityConfigurations, - DONParams({id: donId, configCount: ++configCount, isPublic: isPublic, acceptsWorkflows: acceptsWorkflows, f: f}) + DONParams({ + id: donId, + configCount: ++configCount, + isPublic: isPublic, + acceptsWorkflows: don.acceptsWorkflows, + f: f + }) ); } @@ -960,6 +971,11 @@ contract CapabilitiesRegistry is OwnerIsCreator, TypeAndVersionInterface { donCapabilityConfig.capabilityIds.push(configuration.capabilityId); donCapabilityConfig.capabilityConfigs[configuration.capabilityId] = configuration.config; + s_dons[donParams.id].isPublic = donParams.isPublic; + s_dons[donParams.id].acceptsWorkflows = donParams.acceptsWorkflows; + s_dons[donParams.id].f = donParams.f; + s_dons[donParams.id].configCount = donParams.configCount; + _setDONCapabilityConfig( donParams.id, donParams.configCount, @@ -968,10 +984,6 @@ contract CapabilitiesRegistry is OwnerIsCreator, TypeAndVersionInterface { configuration.config ); } - s_dons[donParams.id].isPublic = donParams.isPublic; - s_dons[donParams.id].acceptsWorkflows = donParams.acceptsWorkflows; - s_dons[donParams.id].f = donParams.f; - s_dons[donParams.id].configCount = donParams.configCount; emit ConfigSet(donParams.id, donParams.configCount); } @@ -1009,8 +1021,7 @@ contract CapabilitiesRegistry is OwnerIsCreator, TypeAndVersionInterface { /// by implementing both getCapabilityConfiguration and /// beforeCapabilityConfigSet if ( - capability.configurationContract.code.length == 0 || - !IERC165(capability.configurationContract).supportsInterface(type(ICapabilityConfiguration).interfaceId) + !ERC165Checker.supportsInterface(capability.configurationContract, type(ICapabilityConfiguration).interfaceId) ) revert InvalidCapabilityConfigurationContractInterface(capability.configurationContract); } s_capabilities[hashedCapabilityId] = capability; diff --git a/contracts/src/v0.8/keystone/KeystoneFeedsConsumer.sol b/contracts/src/v0.8/keystone/KeystoneFeedsConsumer.sol index 9dc6f67560e..306b211f33e 100644 --- a/contracts/src/v0.8/keystone/KeystoneFeedsConsumer.sol +++ b/contracts/src/v0.8/keystone/KeystoneFeedsConsumer.sol @@ -1,10 +1,11 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.24; -import {IReceiver} from "./interfaces/IReceiver.sol"; +import {IERC165} from "../vendor/openzeppelin-solidity/v4.8.3/contracts/interfaces/IERC165.sol"; import {OwnerIsCreator} from "../shared/access/OwnerIsCreator.sol"; +import {IReceiver} from "./interfaces/IReceiver.sol"; -contract KeystoneFeedsConsumer is IReceiver, OwnerIsCreator { +contract KeystoneFeedsConsumer is IReceiver, OwnerIsCreator, IERC165 { event FeedReceived(bytes32 indexed feedId, uint224 price, uint32 timestamp); error UnauthorizedSender(address sender); @@ -97,4 +98,8 @@ contract KeystoneFeedsConsumer is IReceiver, OwnerIsCreator { StoredFeedReport memory report = s_feedReports[feedId]; return (report.Price, report.Timestamp); } + + function supportsInterface(bytes4 interfaceId) public pure returns (bool) { + return interfaceId == type(IReceiver).interfaceId || interfaceId == type(IERC165).interfaceId; + } } diff --git a/contracts/src/v0.8/keystone/KeystoneFeedsPermissionHandler.sol b/contracts/src/v0.8/keystone/KeystoneFeedsPermissionHandler.sol new file mode 100644 index 00000000000..3223deeebe5 --- /dev/null +++ b/contracts/src/v0.8/keystone/KeystoneFeedsPermissionHandler.sol @@ -0,0 +1,85 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.24; + +import {OwnerIsCreator} from "../shared/access/OwnerIsCreator.sol"; + +/// @title Keystone Feeds Permission Handler +/// @notice This contract is designed to manage and validate permissions for accessing specific reports within a decentralized system. +/// @dev The contract uses mappings to keep track of report permissions associated with a unique report ID. +abstract contract KeystoneFeedsPermissionHandler is OwnerIsCreator { + /// @notice Holds the details for permissions of a report + /// @dev Workflow names and report names are stored as bytes to optimize for gas efficiency. + struct Permission { + address forwarder; //───────────────╮ The address of the forwarder (20 bytes) + bytes10 workflowName; // │ The name of the workflow in bytes10 + bytes2 reportName; //───────────────╯ The name of the report in bytes2 + address workflowOwner; //──────────────╮ // The address of the workflow owner (20 bytes) + bool isAllowed; //─────────────────────╯// Whether the report is allowed or not (1 byte) + } + + /// @notice Event emitted when report permissions are set + event ReportPermissionSet(bytes32 indexed reportId, Permission permission); + + /// @notice Error to be thrown when an unauthorized access attempt is made + error ReportForwarderUnauthorized(address forwarder, address workflowOwner, bytes10 workflowName, bytes2 reportName); + + /// @dev Mapping from a report ID to a boolean indicating whether the report is allowed or not + mapping(bytes32 reportId => bool isAllowed) internal s_allowedReports; + + /// @notice Sets permissions for multiple reports + /// @param permissions An array of Permission structs for which to set permissions + /// @dev Emits a ReportPermissionSet event for each permission set + function setReportPermissions(Permission[] memory permissions) external onlyOwner { + for (uint256 i; i < permissions.length; ++i) { + _setReportPermission(permissions[i]); + } + } + + /// @dev Internal function to set a single report permission + /// @param permission The Permission struct containing details about the permission to set + /// @dev Emits a ReportPermissionSet event + function _setReportPermission(Permission memory permission) internal { + bytes32 reportId = _createReportId( + permission.forwarder, + permission.workflowOwner, + permission.workflowName, + permission.reportName + ); + s_allowedReports[reportId] = permission.isAllowed; + emit ReportPermissionSet(reportId, permission); + } + + /// @dev Internal view function to validate if a report is allowed for a given set of details + /// @param forwarder The address of the forwarder + /// @param workflowOwner The address of the workflow owner + /// @param workflowName The name of the workflow in bytes10 + /// @param reportName The name of the report in bytes2 + /// @dev Reverts with Unauthorized if the report is not allowed + function _validateReportPermission( + address forwarder, + address workflowOwner, + bytes10 workflowName, + bytes2 reportName + ) internal view { + bytes32 reportId = _createReportId(forwarder, workflowOwner, workflowName, reportName); + if (!s_allowedReports[reportId]) { + revert ReportForwarderUnauthorized(forwarder, workflowOwner, workflowName, reportName); + } + } + + /// @notice Generates a unique report ID based on the provided parameters. + /// @dev The report ID is computed using the Keccak-256 hash function over the encoded parameters. + /// @param forwarder The address of the forwarder associated with the report. + /// @param workflowOwner The address of the owner of the workflow. + /// @param workflowName The name of the workflow, represented as a 10-byte value. + /// @param reportName The name of the report, represented as a 2-byte value. + /// @return reportId The computed unique report ID as a bytes32 value. + function _createReportId( + address forwarder, + address workflowOwner, + bytes10 workflowName, + bytes2 reportName + ) internal pure returns (bytes32 reportId) { + return keccak256(abi.encode(forwarder, workflowOwner, workflowName, reportName)); + } +} diff --git a/contracts/src/v0.8/keystone/KeystoneForwarder.sol b/contracts/src/v0.8/keystone/KeystoneForwarder.sol index 4b44feccbfe..c4511124cd2 100644 --- a/contracts/src/v0.8/keystone/KeystoneForwarder.sol +++ b/contracts/src/v0.8/keystone/KeystoneForwarder.sol @@ -1,12 +1,14 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.24; -import {IReceiver} from "./interfaces/IReceiver.sol"; -import {IRouter} from "./interfaces/IRouter.sol"; -import {ITypeAndVersion} from "../shared/interfaces/ITypeAndVersion.sol"; +import {ERC165Checker} from "../vendor/openzeppelin-solidity/v4.8.3/contracts/utils/introspection/ERC165Checker.sol"; +import {ITypeAndVersion} from "../shared/interfaces/ITypeAndVersion.sol"; import {OwnerIsCreator} from "../shared/access/OwnerIsCreator.sol"; +import {IReceiver} from "./interfaces/IReceiver.sol"; +import {IRouter} from "./interfaces/IRouter.sol"; + /// @notice This is an entry point for `write_${chain}` Target capability. It /// allows nodes to determine if reports have been processed (successfully or /// not) in a decentralized and product-agnostic way by recording processed @@ -49,7 +51,7 @@ contract KeystoneForwarder is OwnerIsCreator, ITypeAndVersion, IRouter { error InvalidConfig(uint64 configId); /// @notice This error is thrown whenever a signer address is not in the - /// configuration. + /// configuration or when trying to set a zero address as a signer. /// @param signer The signer address that was not in the configuration error InvalidSigner(address signer); @@ -64,9 +66,25 @@ contract KeystoneForwarder is OwnerIsCreator, ITypeAndVersion, IRouter { mapping(address signer => uint256 position) _positions; // 1-indexed to detect unset values } + struct Transmission { + address transmitter; + // This is true if the receiver is not a contract or does not implement the + // `IReceiver` interface. + bool invalidReceiver; + // Whether the transmission attempt was successful. If `false`, the + // transmission can be retried with an increased gas limit. + bool success; + // The amount of gas allocated for the `IReceiver.onReport` call. uint80 + // allows storing gas for known EVM block gas limits. + // Ensures that the minimum gas requested by the user is available during + // the transmission attempt. If the transmission fails (indicated by a + // `false` success state), it can be retried with an increased gas limit. + uint80 gasLimit; + } + /// @notice Contains the configuration for each DON ID // @param configId (uint64(donId) << 32) | configVersion - mapping(uint64 configId => OracleSet) internal s_configs; + mapping(uint64 configId => OracleSet oracleSet) internal s_configs; event ConfigSet(uint32 indexed donId, uint32 indexed configVersion, uint8 f, address[] signers); @@ -90,12 +108,22 @@ contract KeystoneForwarder is OwnerIsCreator, ITypeAndVersion, IRouter { uint256 internal constant FORWARDER_METADATA_LENGTH = 45; uint256 internal constant SIGNATURE_LENGTH = 65; + /// @dev This is the gas required to store `success` after the report is processed. + /// It is a warm storage write because of the packed struct. In practice it will cost less. + uint256 internal constant INTERNAL_GAS_REQUIREMENTS_AFTER_REPORT = 5_000; + /// @dev This is the gas required to store the transmission struct and perform other checks. + uint256 internal constant INTERNAL_GAS_REQUIREMENTS = 25_000 + INTERNAL_GAS_REQUIREMENTS_AFTER_REPORT; + /// @dev This is the minimum gas required to route a report. This includes internal gas requirements + /// as well as the minimum gas that the user contract will receive. 30k * 3 gas is to account for + /// cases where consumers need close to the 30k limit provided in the supportsInterface check. + uint256 internal constant MINIMUM_GAS_LIMIT = INTERNAL_GAS_REQUIREMENTS + 30_000 * 3 + 10_000; + // ================================================================ // │ Router │ // ================================================================ - mapping(address forwarder => bool) internal s_forwarders; - mapping(bytes32 transmissionId => TransmissionInfo) internal s_transmissions; + mapping(address forwarder => bool isForwarder) internal s_forwarders; + mapping(bytes32 transmissionId => Transmission transmission) internal s_transmissions; function addForwarder(address forwarder) external onlyOwner { s_forwarders[forwarder] = true; @@ -114,21 +142,37 @@ contract KeystoneForwarder is OwnerIsCreator, ITypeAndVersion, IRouter { bytes calldata metadata, bytes calldata validatedReport ) public returns (bool) { - if (!s_forwarders[msg.sender]) { - revert UnauthorizedForwarder(); - } + if (!s_forwarders[msg.sender]) revert UnauthorizedForwarder(); + + uint256 gasLimit = gasleft() - INTERNAL_GAS_REQUIREMENTS; + if (gasLimit < MINIMUM_GAS_LIMIT) revert InsufficientGasForRouting(transmissionId); + + Transmission memory transmission = s_transmissions[transmissionId]; + if (transmission.success || transmission.invalidReceiver) revert AlreadyAttempted(transmissionId); - if (s_transmissions[transmissionId].transmitter != address(0)) revert AlreadyAttempted(transmissionId); s_transmissions[transmissionId].transmitter = transmitter; + s_transmissions[transmissionId].gasLimit = uint80(gasLimit); - if (receiver.code.length == 0) return false; + // This call can consume up to 90k gas. + if (!ERC165Checker.supportsInterface(receiver, type(IReceiver).interfaceId)) { + s_transmissions[transmissionId].invalidReceiver = true; + return false; + } + + bool success; + bytes memory payload = abi.encodeCall(IReceiver.onReport, (metadata, validatedReport)); + + uint256 remainingGas = gasleft() - INTERNAL_GAS_REQUIREMENTS_AFTER_REPORT; + assembly { + // call and return whether we succeeded. ignore return data + // call(gas,addr,value,argsOffset,argsLength,retOffset,retLength) + success := call(remainingGas, receiver, 0, add(payload, 0x20), mload(payload), 0x0, 0x0) + } - try IReceiver(receiver).onReport(metadata, validatedReport) { + if (success) { s_transmissions[transmissionId].success = true; - return true; - } catch { - return false; } + return success; } function getTransmissionId( @@ -141,26 +185,43 @@ contract KeystoneForwarder is OwnerIsCreator, ITypeAndVersion, IRouter { return keccak256(bytes.concat(bytes20(uint160(receiver)), workflowExecutionId, reportId)); } - /// @notice Get transmitter of a given report or 0x0 if it wasn't transmitted yet - function getTransmitter( + function getTransmissionInfo( address receiver, bytes32 workflowExecutionId, bytes2 reportId - ) external view returns (address) { - return s_transmissions[getTransmissionId(receiver, workflowExecutionId, reportId)].transmitter; + ) external view returns (TransmissionInfo memory) { + bytes32 transmissionId = getTransmissionId(receiver, workflowExecutionId, reportId); + + Transmission memory transmission = s_transmissions[transmissionId]; + + TransmissionState state; + + if (transmission.transmitter == address(0)) { + state = IRouter.TransmissionState.NOT_ATTEMPTED; + } else if (transmission.invalidReceiver) { + state = IRouter.TransmissionState.INVALID_RECEIVER; + } else { + state = transmission.success ? IRouter.TransmissionState.SUCCEEDED : IRouter.TransmissionState.FAILED; + } + + return + TransmissionInfo({ + gasLimit: transmission.gasLimit, + invalidReceiver: transmission.invalidReceiver, + state: state, + success: transmission.success, + transmissionId: transmissionId, + transmitter: transmission.transmitter + }); } - /// @notice Get delivery status of a given report - function getTransmissionState( + /// @notice Get transmitter of a given report or 0x0 if it wasn't transmitted yet + function getTransmitter( address receiver, bytes32 workflowExecutionId, bytes2 reportId - ) external view returns (IRouter.TransmissionState) { - bytes32 transmissionId = getTransmissionId(receiver, workflowExecutionId, reportId); - - if (s_transmissions[transmissionId].transmitter == address(0)) return IRouter.TransmissionState.NOT_ATTEMPTED; - return - s_transmissions[transmissionId].success ? IRouter.TransmissionState.SUCCEEDED : IRouter.TransmissionState.FAILED; + ) external view returns (address) { + return s_transmissions[getTransmissionId(receiver, workflowExecutionId, reportId)].transmitter; } function isForwarder(address forwarder) external view returns (bool) { @@ -187,6 +248,7 @@ contract KeystoneForwarder is OwnerIsCreator, ITypeAndVersion, IRouter { for (uint256 i = 0; i < signers.length; ++i) { // assign indices, detect duplicates address signer = signers[i]; + if (signer == address(0)) revert InvalidSigner(signer); if (s_configs[configId]._positions[signer] != 0) revert DuplicateSigner(signer); s_configs[configId]._positions[signer] = i + 1; } diff --git a/contracts/src/v0.8/keystone/OCR3Capability.sol b/contracts/src/v0.8/keystone/OCR3Capability.sol index 8613a803b20..c7ab8299b73 100644 --- a/contracts/src/v0.8/keystone/OCR3Capability.sol +++ b/contracts/src/v0.8/keystone/OCR3Capability.sol @@ -1,29 +1,186 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.19; +pragma solidity 0.8.24; -import {OCR2Base} from "./ocr/OCR2Base.sol"; +import {ConfirmedOwner} from "../shared/access/ConfirmedOwner.sol"; +import {OCR2Abstract} from "./ocr/OCR2Abstract.sol"; // OCR2Base provides config management compatible with OCR3 -contract OCR3Capability is OCR2Base { +contract OCR3Capability is ConfirmedOwner, OCR2Abstract { + error InvalidConfig(string message); error ReportingUnsupported(); - constructor() OCR2Base() {} + constructor() ConfirmedOwner(msg.sender) {} + // incremented each time a new config is posted. This count is incorporated + // into the config digest, to prevent replay attacks. + uint32 internal s_configCount; + uint32 internal s_latestConfigBlockNumber; // makes it easier for offchain systems + // to extract config from logs. - function typeAndVersion() external pure override returns (string memory) { - return "Keystone 1.0.0"; + // Storing these fields used on the hot path in a ConfigInfo variable reduces the + // retrieval of all of them to a single SLOAD. If any further fields are + // added, make sure that storage of the struct still takes at most 32 bytes. + struct ConfigInfo { + bytes32 latestConfigDigest; + uint8 f; // TODO: could be optimized by squeezing into one slot + uint8 n; + } + ConfigInfo internal s_configInfo; + + /* + * Config logic + */ + + // Reverts transaction if config args are invalid + modifier checkConfigValid( + uint256 numSigners, + uint256 numTransmitters, + uint256 f + ) { + if (numSigners > MAX_NUM_ORACLES) revert InvalidConfig("too many signers"); + if (f == 0) revert InvalidConfig("f must be positive"); + if (numSigners != numTransmitters) revert InvalidConfig("oracle addresses out of registration"); + if (numSigners <= 3 * f) revert InvalidConfig("faulty-oracle f too high"); + _; } - function _beforeSetConfig(uint8 /* _f */, bytes memory /* _onchainConfig */) internal override { - // no-op + /// @inheritdoc OCR2Abstract + function latestConfigDigestAndEpoch() + external + view + virtual + override + returns (bool scanLogs, bytes32 configDigest, uint32 epoch) + { + return (true, bytes32(0), uint32(0)); + } + + // signer = [ 1 byte type | 2 byte len | n byte value ]... + + /** + * @notice sets offchain reporting protocol configuration incl. participating oracles + * @param _signers addresses with which oracles sign the reports + * @param _transmitters addresses oracles use to transmit the reports + * @param _f number of faulty oracles the system can tolerate + * @param _onchainConfig encoded on-chain contract configuration + * @param _offchainConfigVersion version number for offchainEncoding schema + * @param _offchainConfig encoded off-chain oracle configuration + */ + function setConfig( + bytes[] calldata _signers, + address[] calldata _transmitters, + uint8 _f, + bytes memory _onchainConfig, + uint64 _offchainConfigVersion, + bytes memory _offchainConfig + ) external override checkConfigValid(_signers.length, _transmitters.length, _f) onlyOwner { + // Bounded by MAX_NUM_ORACLES in OCR2Abstract.sol + for (uint256 i = 0; i < _signers.length; i++) { + if (_transmitters[i] == address(0)) revert InvalidConfig("transmitter must not be empty"); + // add new signers + bytes calldata publicKeys = _signers[i]; + uint16 offset = 0; + uint16 len = uint16(publicKeys.length); + // scan through public keys to validate encoded format + while (offset < len) { + // solhint-disable-next-line no-unused-vars + uint8 keyType = uint8(publicKeys[offset]); + uint16 keyLen = uint16(uint8(publicKeys[offset + 1])) + (uint16(uint8(publicKeys[offset + 2])) << 8); + // solhint-disable-next-line no-unused-vars + bytes calldata publicKey = publicKeys[offset + 3:offset + 3 + keyLen]; + offset += 3 + keyLen; + } + } + s_configInfo.f = _f; + uint32 previousConfigBlockNumber = s_latestConfigBlockNumber; + s_latestConfigBlockNumber = uint32(block.number); + s_configCount += 1; + { + s_configInfo.latestConfigDigest = _configDigestFromConfigData( + block.chainid, + address(this), + s_configCount, + _signers, + _transmitters, + _f, + _onchainConfig, + _offchainConfigVersion, + _offchainConfig + ); + } + s_configInfo.n = uint8(_signers.length); + + emit ConfigSet( + previousConfigBlockNumber, + s_configInfo.latestConfigDigest, + s_configCount, + _signers, + _transmitters, + _f, + _onchainConfig, + _offchainConfigVersion, + _offchainConfig + ); + } + + function _configDigestFromConfigData( + uint256 _chainId, + address _contractAddress, + uint64 _configCount, + bytes[] calldata _signers, + address[] calldata _transmitters, + uint8 _f, + bytes memory _onchainConfig, + uint64 _encodedConfigVersion, + bytes memory _encodedConfig + ) internal pure returns (bytes32) { + uint256 h = uint256( + keccak256( + abi.encode( + _chainId, + _contractAddress, + _configCount, + _signers, + _transmitters, + _f, + _onchainConfig, + _encodedConfigVersion, + _encodedConfig + ) + ) + ); + uint256 prefixMask = type(uint256).max << (256 - 16); // 0xFFFF00..00 + uint256 prefix = 0x000e << (256 - 16); // 0x000e00..00 + return bytes32((prefix & prefixMask) | (h & ~prefixMask)); + } + + /** + * @notice information about current offchain reporting protocol configuration + * @return configCount ordinal number of current config, out of all configs applied to this contract so far + * @return blockNumber block at which this config was set + * @return configDigest domain-separation tag for current config (see __configDigestFromConfigData) + */ + function latestConfigDetails() + external + view + override + returns (uint32 configCount, uint32 blockNumber, bytes32 configDigest) + { + return (s_configCount, s_latestConfigBlockNumber, s_configInfo.latestConfigDigest); + } + + function typeAndVersion() external pure override returns (string memory) { + return "Keystone 1.0.0"; } - function _report( - uint256 /* initialGas */, - address /* transmitter */, - uint8 /* signerCount */, - address[MAX_NUM_ORACLES] memory /* signers */, - bytes calldata /* report */ - ) internal virtual override { + function transmit( + // NOTE: If these parameters are changed, expectedMsgDataLength and/or + // TRANSMIT_MSGDATA_CONSTANT_LENGTH_COMPONENT need to be changed accordingly + bytes32[3] calldata /* reportContext */, + bytes calldata /* report */, + bytes32[] calldata /* rs */, + bytes32[] calldata /* ss */, + bytes32 /* rawVs */ // signatures + ) external pure override { revert ReportingUnsupported(); } } diff --git a/contracts/src/v0.8/keystone/interfaces/ICapabilityConfiguration.sol b/contracts/src/v0.8/keystone/interfaces/ICapabilityConfiguration.sol index 429c2a1d3aa..702d55dba9d 100644 --- a/contracts/src/v0.8/keystone/interfaces/ICapabilityConfiguration.sol +++ b/contracts/src/v0.8/keystone/interfaces/ICapabilityConfiguration.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.19; +pragma solidity 0.8.24; /// @notice Interface for capability configuration contract. It MUST be /// implemented for a contract to be used as a capability configuration. diff --git a/contracts/src/v0.8/keystone/interfaces/IReceiver.sol b/contracts/src/v0.8/keystone/interfaces/IReceiver.sol index f58c2da7ae1..debe58feea4 100644 --- a/contracts/src/v0.8/keystone/interfaces/IReceiver.sol +++ b/contracts/src/v0.8/keystone/interfaces/IReceiver.sol @@ -1,7 +1,12 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.19; +pragma solidity 0.8.24; /// @title IReceiver - receives keystone reports interface IReceiver { + /// @notice Handles incoming keystone reports. + /// @dev If this function call reverts, it can be retried with a higher gas + /// limit. The receiver is responsible for discarding stale reports. + /// @param metadata Report's metadata. + /// @param report Workflow report. function onReport(bytes calldata metadata, bytes calldata report) external; } diff --git a/contracts/src/v0.8/keystone/interfaces/IRouter.sol b/contracts/src/v0.8/keystone/interfaces/IRouter.sol index a36c17c14d6..3209ae58311 100644 --- a/contracts/src/v0.8/keystone/interfaces/IRouter.sol +++ b/contracts/src/v0.8/keystone/interfaces/IRouter.sol @@ -1,9 +1,12 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.19; +pragma solidity 0.8.24; /// @title IRouter - delivers keystone reports to receiver interface IRouter { error UnauthorizedForwarder(); + /// @dev Thrown when the gas limit is insufficient for handling state after + /// calling the receiver function. + error InsufficientGasForRouting(bytes32 transmissionId); error AlreadyAttempted(bytes32 transmissionId); event ForwarderAdded(address indexed forwarder); @@ -12,12 +15,26 @@ interface IRouter { enum TransmissionState { NOT_ATTEMPTED, SUCCEEDED, + INVALID_RECEIVER, FAILED } struct TransmissionInfo { + bytes32 transmissionId; + TransmissionState state; address transmitter; + // This is true if the receiver is not a contract or does not implement the + // `IReceiver` interface. + bool invalidReceiver; + // Whether the transmission attempt was successful. If `false`, the + // transmission can be retried with an increased gas limit. bool success; + // The amount of gas allocated for the `IReceiver.onReport` call. uint80 + // allows storing gas for known EVM block gas limits. + // Ensures that the minimum gas requested by the user is available during + // the transmission attempt. If the transmission fails (indicated by a + // `false` success state), it can be retried with an increased gas limit. + uint80 gasLimit; } function addForwarder(address forwarder) external; @@ -36,15 +53,14 @@ interface IRouter { bytes32 workflowExecutionId, bytes2 reportId ) external pure returns (bytes32); - function getTransmitter( + function getTransmissionInfo( address receiver, bytes32 workflowExecutionId, bytes2 reportId - ) external view returns (address); - function getTransmissionState( + ) external view returns (TransmissionInfo memory); + function getTransmitter( address receiver, bytes32 workflowExecutionId, bytes2 reportId - ) external view returns (TransmissionState); - function isForwarder(address forwarder) external view returns (bool); + ) external view returns (address); } diff --git a/contracts/src/v0.8/keystone/lib/KeystoneFeedDefaultMetadataLib.sol b/contracts/src/v0.8/keystone/lib/KeystoneFeedDefaultMetadataLib.sol new file mode 100644 index 00000000000..061789be5c2 --- /dev/null +++ b/contracts/src/v0.8/keystone/lib/KeystoneFeedDefaultMetadataLib.sol @@ -0,0 +1,35 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.24; + +library KeystoneFeedDefaultMetadataLib { + /** + * Metadata Layout: + * + * +-------------------------------+--------------------+---------------------+---------------+ + * | 32 bytes (length prefix) | 32 bytes | 10 bytes | 20 bytes | 2 bytes | + * | (Not used in function) | workflow_cid | workflow_name | workflow_owner| report_name | + * +-------------------------------+--------------------+---------------------+---------------+----------------+ + * | | | | | | + * | (Offset 0) | (Offset 32) | (Offset 64) | (Offset 74) | (Offset 94) | + * +-------------------------------+--------------------+---------------------+---------------+----------------+ + * @dev used to slice metadata bytes into workflowName, workflowOwner and report name + */ + function _extractMetadataInfo( + bytes memory metadata + ) internal pure returns (bytes10 workflowName, address workflowOwner, bytes2 reportName) { + // (first 32 bytes contain length of the byte array) + // workflow_cid // offset 32, size 32 + // workflow_name // offset 64, size 10 + // workflow_owner // offset 74, size 20 + // report_name // offset 94, size 2 + assembly { + // no shifting needed for bytes10 type + workflowName := mload(add(metadata, 64)) + // shift right by 12 bytes to get the actual value + workflowOwner := shr(mul(12, 8), mload(add(metadata, 74))) + // no shifting needed for bytes2 type + reportName := mload(add(metadata, 94)) + } + return (workflowName, workflowOwner, reportName); + } +} diff --git a/contracts/src/v0.8/keystone/ocr/OCR2Abstract.sol b/contracts/src/v0.8/keystone/ocr/OCR2Abstract.sol index 083a4045344..4eb5cb069b7 100644 --- a/contracts/src/v0.8/keystone/ocr/OCR2Abstract.sol +++ b/contracts/src/v0.8/keystone/ocr/OCR2Abstract.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.19; +pragma solidity 0.8.24; import {ITypeAndVersion} from "../../shared/interfaces/ITypeAndVersion.sol"; @@ -23,7 +23,7 @@ abstract contract OCR2Abstract is ITypeAndVersion { uint32 previousConfigBlockNumber, bytes32 configDigest, uint64 configCount, - address[] signers, + bytes[] signers, address[] transmitters, uint8 f, bytes onchainConfig, @@ -41,7 +41,7 @@ abstract contract OCR2Abstract is ITypeAndVersion { * @param offchainConfig serialized configuration used by the oracles exclusively and only passed through the contract */ function setConfig( - address[] memory signers, + bytes[] memory signers, address[] memory transmitters, uint8 f, bytes memory onchainConfig, diff --git a/contracts/src/v0.8/keystone/ocr/OCR2Base.sol b/contracts/src/v0.8/keystone/ocr/OCR2Base.sol deleted file mode 100644 index efc7992e90a..00000000000 --- a/contracts/src/v0.8/keystone/ocr/OCR2Base.sol +++ /dev/null @@ -1,352 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; - -import {ConfirmedOwner} from "../../shared/access/ConfirmedOwner.sol"; -import {OCR2Abstract} from "./OCR2Abstract.sol"; - -/** - * @notice Onchain verification of reports from the offchain reporting protocol - * @dev For details on its operation, see the offchain reporting protocol design - * doc, which refers to this contract as simply the "contract". - */ -abstract contract OCR2Base is ConfirmedOwner, OCR2Abstract { - error ReportInvalid(string message); - error InvalidConfig(string message); - - constructor() ConfirmedOwner(msg.sender) {} - - // incremented each time a new config is posted. This count is incorporated - // into the config digest, to prevent replay attacks. - uint32 internal s_configCount; - uint32 internal s_latestConfigBlockNumber; // makes it easier for offchain systems - // to extract config from logs. - - // Storing these fields used on the hot path in a ConfigInfo variable reduces the - // retrieval of all of them to a single SLOAD. If any further fields are - // added, make sure that storage of the struct still takes at most 32 bytes. - struct ConfigInfo { - bytes32 latestConfigDigest; - uint8 f; // TODO: could be optimized by squeezing into one slot - uint8 n; - } - ConfigInfo internal s_configInfo; - - // Used for s_oracles[a].role, where a is an address, to track the purpose - // of the address, or to indicate that the address is unset. - enum Role { - // No oracle role has been set for address a - Unset, - // Signing address for the s_oracles[a].index'th oracle. I.e., report - // signatures from this oracle should ecrecover back to address a. - Signer, - // Transmission address for the s_oracles[a].index'th oracle. I.e., if a - // report is received by OCR2Aggregator.transmit in which msg.sender is - // a, it is attributed to the s_oracles[a].index'th oracle. - Transmitter - } - - struct Oracle { - uint8 index; // Index of oracle in s_signers/s_transmitters - Role role; // Role of the address which mapped to this struct - } - - mapping(address signerOrTransmitter => Oracle) internal s_oracles; - - // s_signers contains the signing address of each oracle - address[] internal s_signers; - - // s_transmitters contains the transmission address of each oracle, - // i.e. the address the oracle actually sends transactions to the contract from - address[] internal s_transmitters; - - /* - * Config logic - */ - - // Reverts transaction if config args are invalid - modifier checkConfigValid( - uint256 numSigners, - uint256 numTransmitters, - uint256 f - ) { - if (numSigners > MAX_NUM_ORACLES) revert InvalidConfig("too many signers"); - if (f == 0) revert InvalidConfig("f must be positive"); - if (numSigners != numTransmitters) revert InvalidConfig("oracle addresses out of registration"); - if (numSigners <= 3 * f) revert InvalidConfig("faulty-oracle f too high"); - _; - } - - // solhint-disable-next-line gas-struct-packing - struct SetConfigArgs { - address[] signers; - address[] transmitters; - uint8 f; - bytes onchainConfig; - uint64 offchainConfigVersion; - bytes offchainConfig; - } - - /// @inheritdoc OCR2Abstract - function latestConfigDigestAndEpoch() - external - view - virtual - override - returns (bool scanLogs, bytes32 configDigest, uint32 epoch) - { - return (true, bytes32(0), uint32(0)); - } - - /** - * @notice sets offchain reporting protocol configuration incl. participating oracles - * @param _signers addresses with which oracles sign the reports - * @param _transmitters addresses oracles use to transmit the reports - * @param _f number of faulty oracles the system can tolerate - * @param _onchainConfig encoded on-chain contract configuration - * @param _offchainConfigVersion version number for offchainEncoding schema - * @param _offchainConfig encoded off-chain oracle configuration - */ - function setConfig( - address[] memory _signers, - address[] memory _transmitters, - uint8 _f, - bytes memory _onchainConfig, - uint64 _offchainConfigVersion, - bytes memory _offchainConfig - ) external override checkConfigValid(_signers.length, _transmitters.length, _f) onlyOwner { - SetConfigArgs memory args = SetConfigArgs({ - signers: _signers, - transmitters: _transmitters, - f: _f, - onchainConfig: _onchainConfig, - offchainConfigVersion: _offchainConfigVersion, - offchainConfig: _offchainConfig - }); - - _beforeSetConfig(args.f, args.onchainConfig); - - while (s_signers.length != 0) { - // remove any old signer/transmitter addresses - uint256 lastIdx = s_signers.length - 1; - address signer = s_signers[lastIdx]; - address transmitter = s_transmitters[lastIdx]; - delete s_oracles[signer]; - delete s_oracles[transmitter]; - s_signers.pop(); - s_transmitters.pop(); - } - - // Bounded by MAX_NUM_ORACLES in OCR2Abstract.sol - for (uint256 i = 0; i < args.signers.length; i++) { - if (args.signers[i] == address(0)) revert InvalidConfig("signer must not be empty"); - if (args.transmitters[i] == address(0)) revert InvalidConfig("transmitter must not be empty"); - // add new signer/transmitter addresses - if (s_oracles[args.signers[i]].role != Role.Unset) revert InvalidConfig("repeated signer address"); - s_oracles[args.signers[i]] = Oracle(uint8(i), Role.Signer); - if (s_oracles[args.transmitters[i]].role != Role.Unset) revert InvalidConfig("repeated transmitter address"); - s_oracles[args.transmitters[i]] = Oracle(uint8(i), Role.Transmitter); - s_signers.push(args.signers[i]); - s_transmitters.push(args.transmitters[i]); - } - s_configInfo.f = args.f; - uint32 previousConfigBlockNumber = s_latestConfigBlockNumber; - s_latestConfigBlockNumber = uint32(block.number); - s_configCount += 1; - { - s_configInfo.latestConfigDigest = _configDigestFromConfigData( - block.chainid, - address(this), - s_configCount, - args.signers, - args.transmitters, - args.f, - args.onchainConfig, - args.offchainConfigVersion, - args.offchainConfig - ); - } - s_configInfo.n = uint8(args.signers.length); - - emit ConfigSet( - previousConfigBlockNumber, - s_configInfo.latestConfigDigest, - s_configCount, - args.signers, - args.transmitters, - args.f, - args.onchainConfig, - args.offchainConfigVersion, - args.offchainConfig - ); - } - - function _configDigestFromConfigData( - uint256 _chainId, - address _contractAddress, - uint64 _configCount, - address[] memory _signers, - address[] memory _transmitters, - uint8 _f, - bytes memory _onchainConfig, - uint64 _encodedConfigVersion, - bytes memory _encodedConfig - ) internal pure returns (bytes32) { - uint256 h = uint256( - keccak256( - abi.encode( - _chainId, - _contractAddress, - _configCount, - _signers, - _transmitters, - _f, - _onchainConfig, - _encodedConfigVersion, - _encodedConfig - ) - ) - ); - uint256 prefixMask = type(uint256).max << (256 - 16); // 0xFFFF00..00 - uint256 prefix = 0x0001 << (256 - 16); // 0x000100..00 - return bytes32((prefix & prefixMask) | (h & ~prefixMask)); - } - - /** - * @notice information about current offchain reporting protocol configuration - * @return configCount ordinal number of current config, out of all configs applied to this contract so far - * @return blockNumber block at which this config was set - * @return configDigest domain-separation tag for current config (see __configDigestFromConfigData) - */ - function latestConfigDetails() - external - view - override - returns (uint32 configCount, uint32 blockNumber, bytes32 configDigest) - { - return (s_configCount, s_latestConfigBlockNumber, s_configInfo.latestConfigDigest); - } - - /** - * @return list of addresses permitted to transmit reports to this contract - * @dev The list will match the order used to specify the transmitter during setConfig - */ - function transmitters() external view returns (address[] memory) { - return s_transmitters; - } - - function _beforeSetConfig(uint8 _f, bytes memory _onchainConfig) internal virtual; - - /** - * @dev hook called after the report has been fully validated - * for the extending contract to handle additional logic, such as oracle payment - * @param initialGas the amount of gas before validation - * @param transmitter the address of the account that submitted the report - * @param signers the addresses of all signing accounts - * @param report serialized report - */ - function _report( - uint256 initialGas, - address transmitter, - uint8 signerCount, - address[MAX_NUM_ORACLES] memory signers, - bytes calldata report - ) internal virtual; - - // The constant-length components of the msg.data sent to transmit. - // See the "If we wanted to call sam" example on for example reasoning - // https://solidity.readthedocs.io/en/v0.7.2/abi-spec.html - uint16 private constant TRANSMIT_MSGDATA_CONSTANT_LENGTH_COMPONENT = - 4 + // function selector - 32 * - 3 + // 3 words containing reportContext - 32 + // word containing start location of abiencoded report value - 32 + // word containing location start of abiencoded rs value - 32 + // word containing start location of abiencoded ss value - 32 + // rawVs value - 32 + // word containing length of report - 32 + // word containing length rs - 32 + // word containing length of ss - 0; // placeholder - - function _requireExpectedMsgDataLength( - bytes calldata report, - bytes32[] calldata rs, - bytes32[] calldata ss - ) private pure { - // calldata will never be big enough to make this overflow - uint256 expected = uint256(TRANSMIT_MSGDATA_CONSTANT_LENGTH_COMPONENT) + - report.length + // one byte pure entry in _report - rs.length * - 32 + // 32 bytes per entry in _rs - ss.length * - 32 + // 32 bytes per entry in _ss - 0; // placeholder - if (msg.data.length != expected) revert ReportInvalid("calldata length mismatch"); - } - - /** - * @notice transmit is called to post a new report to the contract - * @param report serialized report, which the signatures are signing. - * @param rs ith element is the R components of the ith signature on report. Must have at most maxNumOracles entries - * @param ss ith element is the S components of the ith signature on report. Must have at most maxNumOracles entries - * @param rawVs ith element is the the V component of the ith signature - */ - function transmit( - // NOTE: If these parameters are changed, expectedMsgDataLength and/or - // TRANSMIT_MSGDATA_CONSTANT_LENGTH_COMPONENT need to be changed accordingly - bytes32[3] calldata reportContext, - bytes calldata report, - bytes32[] calldata rs, - bytes32[] calldata ss, - bytes32 rawVs // signatures - ) external override { - uint256 initialGas = gasleft(); // This line must come first - - { - // reportContext consists of: - // reportContext[0]: ConfigDigest - // reportContext[1]: 27 byte padding, 4-byte epoch and 1-byte round - // reportContext[2]: ExtraHash - bytes32 configDigest = reportContext[0]; - uint32 epochAndRound = uint32(uint256(reportContext[1])); - - emit Transmitted(configDigest, uint32(epochAndRound >> 8)); - - // The following check is disabled to allow both current and proposed routes to submit reports using the same OCR config digest - // Chainlink Functions uses globally unique request IDs. Metadata about the request is stored and checked in the Coordinator and Router - // require(configInfo.latestConfigDigest == configDigest, "configDigest mismatch"); - - _requireExpectedMsgDataLength(report, rs, ss); - - uint256 expectedNumSignatures = (s_configInfo.n + s_configInfo.f) / 2 + 1; - - if (rs.length != expectedNumSignatures) revert ReportInvalid("wrong number of signatures"); - if (rs.length != ss.length) revert ReportInvalid("report rs and ss must be of equal length"); - - Oracle memory transmitter = s_oracles[msg.sender]; - if (transmitter.role != Role.Transmitter && msg.sender != s_transmitters[transmitter.index]) - revert ReportInvalid("unauthorized transmitter"); - } - - address[MAX_NUM_ORACLES] memory signed; - uint8 signerCount = 0; - - { - // Verify signatures attached to report - bytes32 h = keccak256(abi.encodePacked(keccak256(report), reportContext)); - - Oracle memory o; - // Bounded by MAX_NUM_ORACLES in OCR2Abstract.sol - for (uint256 i = 0; i < rs.length; ++i) { - address signer = ecrecover(h, uint8(rawVs[i]) + 27, rs[i], ss[i]); - o = s_oracles[signer]; - if (o.role != Role.Signer) revert ReportInvalid("address not authorized to sign"); - if (signed[o.index] != address(0)) revert ReportInvalid("non-unique signature"); - signed[o.index] = signer; - signerCount += 1; - } - } - - _report(initialGas, msg.sender, signerCount, signed, report); - } -} diff --git a/contracts/src/v0.8/keystone/test/BaseTest.t.sol b/contracts/src/v0.8/keystone/test/BaseTest.t.sol index e637406c145..64dc018c3ac 100644 --- a/contracts/src/v0.8/keystone/test/BaseTest.t.sol +++ b/contracts/src/v0.8/keystone/test/BaseTest.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.19; +pragma solidity 0.8.24; import {Test} from "forge-std/Test.sol"; import {Constants} from "./Constants.t.sol"; diff --git a/contracts/src/v0.8/keystone/test/CapabilitiesRegistry_AddDONTest.t.sol b/contracts/src/v0.8/keystone/test/CapabilitiesRegistry_AddDONTest.t.sol index fff6623a59b..dc0b85bfa3f 100644 --- a/contracts/src/v0.8/keystone/test/CapabilitiesRegistry_AddDONTest.t.sol +++ b/contracts/src/v0.8/keystone/test/CapabilitiesRegistry_AddDONTest.t.sol @@ -1,9 +1,10 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.19; +pragma solidity 0.8.24; import {BaseTest} from "./BaseTest.t.sol"; import {ICapabilityConfiguration} from "../interfaces/ICapabilityConfiguration.sol"; import {CapabilitiesRegistry} from "../CapabilitiesRegistry.sol"; +import {MaliciousConfigurationContract} from "./mocks/MaliciousConfigurationContract.sol"; contract CapabilitiesRegistry_AddDONTest is BaseTest { function setUp() public override { @@ -245,3 +246,75 @@ contract CapabilitiesRegistry_AddDONTest is BaseTest { assertEq(donInfo.nodeP2PIds[1], P2P_ID_THREE); } } + +contract CapabilitiesRegistry_AddDONTest_WhenMaliciousCapabilityConfigurationConfigured is BaseTest { + function setUp() public override { + BaseTest.setUp(); + CapabilitiesRegistry.Capability[] memory capabilities = new CapabilitiesRegistry.Capability[](2); + + address maliciousConfigContractAddr = address( + new MaliciousConfigurationContract(s_capabilityWithConfigurationContractId) + ); + s_basicCapability.configurationContract = maliciousConfigContractAddr; + capabilities[0] = s_basicCapability; + capabilities[1] = s_capabilityWithConfigurationContract; + + CapabilitiesRegistry.NodeOperator[] memory nodeOperators = _getNodeOperators(); + nodeOperators[0].admin = maliciousConfigContractAddr; + nodeOperators[1].admin = maliciousConfigContractAddr; + nodeOperators[2].admin = maliciousConfigContractAddr; + + s_CapabilitiesRegistry.addNodeOperators(nodeOperators); + s_CapabilitiesRegistry.addCapabilities(capabilities); + + CapabilitiesRegistry.NodeParams[] memory nodes = new CapabilitiesRegistry.NodeParams[](3); + bytes32[] memory capabilityIds = new bytes32[](1); + capabilityIds[0] = s_basicHashedCapabilityId; + + nodes[0] = CapabilitiesRegistry.NodeParams({ + nodeOperatorId: TEST_NODE_OPERATOR_ONE_ID, + p2pId: P2P_ID, + signer: NODE_OPERATOR_ONE_SIGNER_ADDRESS, + hashedCapabilityIds: capabilityIds + }); + + bytes32[] memory nodeTwoCapabilityIds = new bytes32[](1); + nodeTwoCapabilityIds[0] = s_basicHashedCapabilityId; + + nodes[1] = CapabilitiesRegistry.NodeParams({ + nodeOperatorId: TEST_NODE_OPERATOR_TWO_ID, + p2pId: P2P_ID_TWO, + signer: NODE_OPERATOR_TWO_SIGNER_ADDRESS, + hashedCapabilityIds: nodeTwoCapabilityIds + }); + + nodes[2] = CapabilitiesRegistry.NodeParams({ + nodeOperatorId: TEST_NODE_OPERATOR_THREE_ID, + p2pId: P2P_ID_THREE, + signer: NODE_OPERATOR_THREE_SIGNER_ADDRESS, + hashedCapabilityIds: capabilityIds + }); + + s_CapabilitiesRegistry.addNodes(nodes); + + changePrank(ADMIN); + } + + function test_RevertWhen_MaliciousCapabilitiesConfigContractTriesToRemoveCapabilitiesFromDONNodes() public { + bytes32[] memory nodes = new bytes32[](2); + nodes[0] = P2P_ID; + nodes[1] = P2P_ID_THREE; + + CapabilitiesRegistry.CapabilityConfiguration[] + memory capabilityConfigs = new CapabilitiesRegistry.CapabilityConfiguration[](1); + capabilityConfigs[0] = CapabilitiesRegistry.CapabilityConfiguration({ + capabilityId: s_basicHashedCapabilityId, + config: BASIC_CAPABILITY_CONFIG + }); + + vm.expectRevert( + abi.encodeWithSelector(CapabilitiesRegistry.CapabilityRequiredByDON.selector, s_basicHashedCapabilityId, DON_ID) + ); + s_CapabilitiesRegistry.addDON(nodes, capabilityConfigs, true, true, F_VALUE); + } +} diff --git a/contracts/src/v0.8/keystone/test/CapabilitiesRegistry_DeprecateCapabilitiesTest.t.sol b/contracts/src/v0.8/keystone/test/CapabilitiesRegistry_DeprecateCapabilitiesTest.t.sol index 4d289e7c745..e06fa4a703a 100644 --- a/contracts/src/v0.8/keystone/test/CapabilitiesRegistry_DeprecateCapabilitiesTest.t.sol +++ b/contracts/src/v0.8/keystone/test/CapabilitiesRegistry_DeprecateCapabilitiesTest.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.19; +pragma solidity 0.8.24; import {BaseTest} from "./BaseTest.t.sol"; import {CapabilitiesRegistry} from "../CapabilitiesRegistry.sol"; diff --git a/contracts/src/v0.8/keystone/test/CapabilitiesRegistry_GetCapabilitiesTest.t.sol b/contracts/src/v0.8/keystone/test/CapabilitiesRegistry_GetCapabilitiesTest.t.sol index 9702c62b9c7..8f39183ee79 100644 --- a/contracts/src/v0.8/keystone/test/CapabilitiesRegistry_GetCapabilitiesTest.t.sol +++ b/contracts/src/v0.8/keystone/test/CapabilitiesRegistry_GetCapabilitiesTest.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.19; +pragma solidity 0.8.24; import {BaseTest} from "./BaseTest.t.sol"; import {CapabilitiesRegistry} from "../CapabilitiesRegistry.sol"; diff --git a/contracts/src/v0.8/keystone/test/CapabilitiesRegistry_GetDONsTest.t.sol b/contracts/src/v0.8/keystone/test/CapabilitiesRegistry_GetDONsTest.t.sol index a83b1421d3c..a79485abad1 100644 --- a/contracts/src/v0.8/keystone/test/CapabilitiesRegistry_GetDONsTest.t.sol +++ b/contracts/src/v0.8/keystone/test/CapabilitiesRegistry_GetDONsTest.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.19; +pragma solidity 0.8.24; import {BaseTest} from "./BaseTest.t.sol"; diff --git a/contracts/src/v0.8/keystone/test/CapabilitiesRegistry_GetHashedCapabilityIdTest.t.sol b/contracts/src/v0.8/keystone/test/CapabilitiesRegistry_GetHashedCapabilityIdTest.t.sol index b9a6e6dc97a..cdfb0eb6439 100644 --- a/contracts/src/v0.8/keystone/test/CapabilitiesRegistry_GetHashedCapabilityIdTest.t.sol +++ b/contracts/src/v0.8/keystone/test/CapabilitiesRegistry_GetHashedCapabilityIdTest.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.19; +pragma solidity 0.8.24; import {BaseTest} from "./BaseTest.t.sol"; import {CapabilityConfigurationContract} from "./mocks/CapabilityConfigurationContract.sol"; diff --git a/contracts/src/v0.8/keystone/test/CapabilitiesRegistry_GetNodeOperatorsTest.t.sol b/contracts/src/v0.8/keystone/test/CapabilitiesRegistry_GetNodeOperatorsTest.t.sol index 36ef201a998..471f4a86ade 100644 --- a/contracts/src/v0.8/keystone/test/CapabilitiesRegistry_GetNodeOperatorsTest.t.sol +++ b/contracts/src/v0.8/keystone/test/CapabilitiesRegistry_GetNodeOperatorsTest.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.19; +pragma solidity 0.8.24; import {BaseTest} from "./BaseTest.t.sol"; import {CapabilitiesRegistry} from "../CapabilitiesRegistry.sol"; diff --git a/contracts/src/v0.8/keystone/test/CapabilitiesRegistry_GetNodesTest.t.sol b/contracts/src/v0.8/keystone/test/CapabilitiesRegistry_GetNodesTest.t.sol index 901e7b92728..a5fe5fa1d1a 100644 --- a/contracts/src/v0.8/keystone/test/CapabilitiesRegistry_GetNodesTest.t.sol +++ b/contracts/src/v0.8/keystone/test/CapabilitiesRegistry_GetNodesTest.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.19; +pragma solidity 0.8.24; import {BaseTest} from "./BaseTest.t.sol"; import {CapabilitiesRegistry} from "../CapabilitiesRegistry.sol"; diff --git a/contracts/src/v0.8/keystone/test/CapabilitiesRegistry_RemoveNodesTest.t.sol b/contracts/src/v0.8/keystone/test/CapabilitiesRegistry_RemoveNodesTest.t.sol index 9622c238766..08646600a67 100644 --- a/contracts/src/v0.8/keystone/test/CapabilitiesRegistry_RemoveNodesTest.t.sol +++ b/contracts/src/v0.8/keystone/test/CapabilitiesRegistry_RemoveNodesTest.t.sol @@ -158,7 +158,7 @@ contract CapabilitiesRegistry_RemoveNodesTest is BaseTest { bytes32[] memory updatedNodes = new bytes32[](2); updatedNodes[0] = P2P_ID; updatedNodes[1] = P2P_ID_THREE; - s_CapabilitiesRegistry.updateDON(DON_ID, updatedNodes, capabilityConfigs, true, true, F_VALUE); + s_CapabilitiesRegistry.updateDON(DON_ID, updatedNodes, capabilityConfigs, true, F_VALUE); // Remove node s_CapabilitiesRegistry.removeNodes(removedNodes); diff --git a/contracts/src/v0.8/keystone/test/CapabilitiesRegistry_UpdateDONTest.t.sol b/contracts/src/v0.8/keystone/test/CapabilitiesRegistry_UpdateDONTest.t.sol index 8b21b295067..825524ebe86 100644 --- a/contracts/src/v0.8/keystone/test/CapabilitiesRegistry_UpdateDONTest.t.sol +++ b/contracts/src/v0.8/keystone/test/CapabilitiesRegistry_UpdateDONTest.t.sol @@ -71,7 +71,7 @@ contract CapabilitiesRegistry_UpdateDONTest is BaseTest { capabilityId: s_basicHashedCapabilityId, config: BASIC_CAPABILITY_CONFIG }); - s_CapabilitiesRegistry.updateDON(DON_ID, nodes, capabilityConfigs, true, true, F_VALUE); + s_CapabilitiesRegistry.updateDON(DON_ID, nodes, capabilityConfigs, true, F_VALUE); } function test_RevertWhen_NodeDoesNotSupportCapability() public { @@ -91,7 +91,7 @@ contract CapabilitiesRegistry_UpdateDONTest is BaseTest { s_capabilityWithConfigurationContractId ) ); - s_CapabilitiesRegistry.updateDON(DON_ID, nodes, capabilityConfigs, true, true, F_VALUE); + s_CapabilitiesRegistry.updateDON(DON_ID, nodes, capabilityConfigs, true, F_VALUE); } function test_RevertWhen_DONDoesNotExist() public { @@ -106,7 +106,7 @@ contract CapabilitiesRegistry_UpdateDONTest is BaseTest { config: BASIC_CAPABILITY_CONFIG }); vm.expectRevert(abi.encodeWithSelector(CapabilitiesRegistry.DONDoesNotExist.selector, nonExistentDONId)); - s_CapabilitiesRegistry.updateDON(nonExistentDONId, nodes, capabilityConfigs, true, true, F_VALUE); + s_CapabilitiesRegistry.updateDON(nonExistentDONId, nodes, capabilityConfigs, true, F_VALUE); } function test_RevertWhen_CapabilityDoesNotExist() public { @@ -122,7 +122,7 @@ contract CapabilitiesRegistry_UpdateDONTest is BaseTest { vm.expectRevert( abi.encodeWithSelector(CapabilitiesRegistry.CapabilityDoesNotExist.selector, s_nonExistentHashedCapabilityId) ); - s_CapabilitiesRegistry.updateDON(DON_ID, nodes, capabilityConfigs, true, true, F_VALUE); + s_CapabilitiesRegistry.updateDON(DON_ID, nodes, capabilityConfigs, true, F_VALUE); } function test_RevertWhen_DuplicateCapabilityAdded() public { @@ -144,7 +144,7 @@ contract CapabilitiesRegistry_UpdateDONTest is BaseTest { vm.expectRevert( abi.encodeWithSelector(CapabilitiesRegistry.DuplicateDONCapability.selector, 1, s_basicHashedCapabilityId) ); - s_CapabilitiesRegistry.updateDON(DON_ID, nodes, capabilityConfigs, true, true, F_VALUE); + s_CapabilitiesRegistry.updateDON(DON_ID, nodes, capabilityConfigs, true, F_VALUE); } function test_RevertWhen_DeprecatedCapabilityAdded() public { @@ -165,7 +165,7 @@ contract CapabilitiesRegistry_UpdateDONTest is BaseTest { }); vm.expectRevert(abi.encodeWithSelector(CapabilitiesRegistry.CapabilityIsDeprecated.selector, capabilityId)); - s_CapabilitiesRegistry.updateDON(DON_ID, nodes, capabilityConfigs, true, true, F_VALUE); + s_CapabilitiesRegistry.updateDON(DON_ID, nodes, capabilityConfigs, true, F_VALUE); } function test_RevertWhen_DuplicateNodeAdded() public { @@ -180,7 +180,7 @@ contract CapabilitiesRegistry_UpdateDONTest is BaseTest { config: BASIC_CAPABILITY_CONFIG }); vm.expectRevert(abi.encodeWithSelector(CapabilitiesRegistry.DuplicateDONNode.selector, 1, P2P_ID)); - s_CapabilitiesRegistry.updateDON(DON_ID, nodes, capabilityConfigs, true, true, F_VALUE); + s_CapabilitiesRegistry.updateDON(DON_ID, nodes, capabilityConfigs, true, F_VALUE); } function test_UpdatesDON() public { @@ -217,7 +217,7 @@ contract CapabilitiesRegistry_UpdateDONTest is BaseTest { ), 1 ); - s_CapabilitiesRegistry.updateDON(DON_ID, nodes, capabilityConfigs, expectedDONIsPublic, true, F_VALUE); + s_CapabilitiesRegistry.updateDON(DON_ID, nodes, capabilityConfigs, expectedDONIsPublic, F_VALUE); CapabilitiesRegistry.DONInfo memory donInfo = s_CapabilitiesRegistry.getDON(DON_ID); assertEq(donInfo.id, DON_ID); diff --git a/contracts/src/v0.8/keystone/test/CapabilitiesRegistry_UpdateNodeOperatorsTest.t.sol b/contracts/src/v0.8/keystone/test/CapabilitiesRegistry_UpdateNodeOperatorsTest.t.sol index e0d1742c981..8f6be580f49 100644 --- a/contracts/src/v0.8/keystone/test/CapabilitiesRegistry_UpdateNodeOperatorsTest.t.sol +++ b/contracts/src/v0.8/keystone/test/CapabilitiesRegistry_UpdateNodeOperatorsTest.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.19; +pragma solidity 0.8.24; import {BaseTest} from "./BaseTest.t.sol"; import {CapabilitiesRegistry} from "../CapabilitiesRegistry.sol"; @@ -19,10 +19,7 @@ contract CapabilitiesRegistry_UpdateNodeOperatorTest is BaseTest { changePrank(STRANGER); CapabilitiesRegistry.NodeOperator[] memory nodeOperators = new CapabilitiesRegistry.NodeOperator[](1); - nodeOperators[0] = CapabilitiesRegistry.NodeOperator({ - admin: NEW_NODE_OPERATOR_ADMIN, - name: NEW_NODE_OPERATOR_NAME - }); + nodeOperators[0] = CapabilitiesRegistry.NodeOperator({admin: ADMIN, name: NEW_NODE_OPERATOR_NAME}); uint32[] memory nodeOperatorIds = new uint32[](1); nodeOperatorIds[0] = TEST_NODE_OPERATOR_ID; diff --git a/contracts/src/v0.8/keystone/test/CapabilitiesRegistry_UpdateNodesTest.t.sol b/contracts/src/v0.8/keystone/test/CapabilitiesRegistry_UpdateNodesTest.t.sol index 43c6adc35b6..9b516767f27 100644 --- a/contracts/src/v0.8/keystone/test/CapabilitiesRegistry_UpdateNodesTest.t.sol +++ b/contracts/src/v0.8/keystone/test/CapabilitiesRegistry_UpdateNodesTest.t.sol @@ -59,6 +59,24 @@ contract CapabilitiesRegistry_UpdateNodesTest is BaseTest { s_CapabilitiesRegistry.updateNodes(nodes); } + function test_RevertWhen_CalledByAnotherNodeOperatorAdmin() public { + changePrank(NODE_OPERATOR_TWO_ADMIN); + CapabilitiesRegistry.NodeParams[] memory nodes = new CapabilitiesRegistry.NodeParams[](1); + + bytes32[] memory hashedCapabilityIds = new bytes32[](1); + hashedCapabilityIds[0] = s_basicHashedCapabilityId; + + nodes[0] = CapabilitiesRegistry.NodeParams({ + nodeOperatorId: TEST_NODE_OPERATOR_TWO_ID, + p2pId: P2P_ID, + signer: NEW_NODE_SIGNER, + hashedCapabilityIds: hashedCapabilityIds + }); + + vm.expectRevert(abi.encodeWithSelector(CapabilitiesRegistry.AccessForbidden.selector, NODE_OPERATOR_TWO_ADMIN)); + s_CapabilitiesRegistry.updateNodes(nodes); + } + function test_RevertWhen_NodeDoesNotExist() public { changePrank(NODE_OPERATOR_ONE_ADMIN); CapabilitiesRegistry.NodeParams[] memory nodes = new CapabilitiesRegistry.NodeParams[](1); diff --git a/contracts/src/v0.8/keystone/test/Constants.t.sol b/contracts/src/v0.8/keystone/test/Constants.t.sol index 23c80eea9f1..a540a255725 100644 --- a/contracts/src/v0.8/keystone/test/Constants.t.sol +++ b/contracts/src/v0.8/keystone/test/Constants.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.19; +pragma solidity 0.8.24; contract Constants { address internal constant ADMIN = address(1); diff --git a/contracts/src/v0.8/keystone/test/KeystoneForwarderBaseTest.t.sol b/contracts/src/v0.8/keystone/test/KeystoneForwarderBaseTest.t.sol index 3b3c4060780..c106c2b2b21 100644 --- a/contracts/src/v0.8/keystone/test/KeystoneForwarderBaseTest.t.sol +++ b/contracts/src/v0.8/keystone/test/KeystoneForwarderBaseTest.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.19; +pragma solidity 0.8.24; import {Test} from "forge-std/Test.sol"; import {Receiver} from "./mocks/Receiver.sol"; diff --git a/contracts/src/v0.8/keystone/test/KeystoneForwarder_ReportTest.t.sol b/contracts/src/v0.8/keystone/test/KeystoneForwarder_ReportTest.t.sol index ccb398fac5a..c6dc7fca538 100644 --- a/contracts/src/v0.8/keystone/test/KeystoneForwarder_ReportTest.t.sol +++ b/contracts/src/v0.8/keystone/test/KeystoneForwarder_ReportTest.t.sol @@ -1,8 +1,10 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.19; +pragma solidity 0.8.24; import {BaseTest} from "./KeystoneForwarderBaseTest.t.sol"; import {IRouter} from "../interfaces/IRouter.sol"; +import {MaliciousReportReceiver} from "./mocks/MaliciousReportReceiver.sol"; +import {MaliciousRevertingReceiver} from "./mocks/MaliciousRevertingReceiver.sol"; import {KeystoneForwarder} from "../KeystoneForwarder.sol"; contract KeystoneForwarder_ReportTest is BaseTest { @@ -141,15 +143,40 @@ contract KeystoneForwarder_ReportTest is BaseTest { s_forwarder.report(address(s_receiver), report, reportContext, signatures); } - function test_RevertWhen_AlreadyAttempted() public { - s_forwarder.report(address(s_receiver), report, reportContext, signatures); + function test_RevertWhen_RetryingSuccessfulTransmission() public { + s_forwarder.report{gas: 400_000}(address(s_receiver), report, reportContext, signatures); bytes32 transmissionId = s_forwarder.getTransmissionId(address(s_receiver), executionId, reportId); vm.expectRevert(abi.encodeWithSelector(IRouter.AlreadyAttempted.selector, transmissionId)); - s_forwarder.report(address(s_receiver), report, reportContext, signatures); + // Retyring with more gas + s_forwarder.report{gas: 450_000}(address(s_receiver), report, reportContext, signatures); + } + + function test_RevertWhen_RetryingInvalidContractTransmission() public { + // Receiver is not a contract + address receiver = address(404); + s_forwarder.report{gas: 400_000}(receiver, report, reportContext, signatures); + + bytes32 transmissionId = s_forwarder.getTransmissionId(receiver, executionId, reportId); + vm.expectRevert(abi.encodeWithSelector(IRouter.AlreadyAttempted.selector, transmissionId)); + // Retyring with more gas + s_forwarder.report{gas: 450_000}(receiver, report, reportContext, signatures); + } + + function test_RevertWhen_AttemptingTransmissionWithInsufficientGas() public { + bytes32 transmissionId = s_forwarder.getTransmissionId(address(s_receiver), executionId, reportId); + vm.expectRevert(abi.encodeWithSelector(IRouter.InsufficientGasForRouting.selector, transmissionId)); + s_forwarder.report{gas: 150_000}(address(s_receiver), report, reportContext, signatures); } function test_Report_SuccessfulDelivery() public { + IRouter.TransmissionInfo memory transmissionInfo = s_forwarder.getTransmissionInfo( + address(s_receiver), + executionId, + reportId + ); + assertEq(uint8(transmissionInfo.state), uint8(IRouter.TransmissionState.NOT_ATTEMPTED), "state mismatch"); + vm.expectEmit(address(s_receiver)); emit MessageReceived(metadata, mercuryReports); @@ -158,16 +185,31 @@ contract KeystoneForwarder_ReportTest is BaseTest { s_forwarder.report(address(s_receiver), report, reportContext, signatures); - assertEq( - s_forwarder.getTransmitter(address(s_receiver), executionId, reportId), - TRANSMITTER, - "transmitter mismatch" - ); - assertEq( - uint8(s_forwarder.getTransmissionState(address(s_receiver), executionId, reportId)), - uint8(IRouter.TransmissionState.SUCCEEDED), - "TransmissionState mismatch" + transmissionInfo = s_forwarder.getTransmissionInfo(address(s_receiver), executionId, reportId); + + assertEq(transmissionInfo.transmitter, TRANSMITTER, "transmitter mismatch"); + assertEq(uint8(transmissionInfo.state), uint8(IRouter.TransmissionState.SUCCEEDED), "state mismatch"); + assertGt(transmissionInfo.gasLimit, 100_000, "gas limit mismatch"); + } + + function test_Report_SuccessfulRetryWithMoreGas() public { + s_forwarder.report{gas: 200_000}(address(s_receiver), report, reportContext, signatures); + + IRouter.TransmissionInfo memory transmissionInfo = s_forwarder.getTransmissionInfo( + address(s_receiver), + executionId, + reportId ); + // Expect to fail with the receiver running out of gas + assertEq(uint8(transmissionInfo.state), uint8(IRouter.TransmissionState.FAILED), "state mismatch"); + assertGt(transmissionInfo.gasLimit, 100_000, "gas limit mismatch"); + + // Should succeed with more gas + s_forwarder.report{gas: 300_000}(address(s_receiver), report, reportContext, signatures); + + transmissionInfo = s_forwarder.getTransmissionInfo(address(s_receiver), executionId, reportId); + assertEq(uint8(transmissionInfo.state), uint8(IRouter.TransmissionState.SUCCEEDED), "state mismatch"); + assertGt(transmissionInfo.gasLimit, 200_000, "gas limit mismatch"); } function test_Report_FailedDeliveryWhenReceiverNotContract() public { @@ -179,29 +221,53 @@ contract KeystoneForwarder_ReportTest is BaseTest { s_forwarder.report(receiver, report, reportContext, signatures); - assertEq(s_forwarder.getTransmitter(receiver, executionId, reportId), TRANSMITTER, "transmitter mismatch"); - assertEq( - uint8(s_forwarder.getTransmissionState(receiver, executionId, reportId)), - uint8(IRouter.TransmissionState.FAILED), - "TransmissionState mismatch" - ); + IRouter.TransmissionInfo memory transmissionInfo = s_forwarder.getTransmissionInfo(receiver, executionId, reportId); + assertEq(uint8(transmissionInfo.state), uint8(IRouter.TransmissionState.INVALID_RECEIVER), "state mismatch"); } function test_Report_FailedDeliveryWhenReceiverInterfaceNotSupported() public { // Receiver is a contract but doesn't implement the required interface address receiver = address(s_forwarder); - vm.expectEmit(address(s_forwarder)); + vm.expectEmit(true, true, true, false); emit ReportProcessed(receiver, executionId, reportId, false); s_forwarder.report(receiver, report, reportContext, signatures); - assertEq(s_forwarder.getTransmitter(receiver, executionId, reportId), TRANSMITTER, "transmitter mismatch"); - assertEq( - uint8(s_forwarder.getTransmissionState(receiver, executionId, reportId)), - uint8(IRouter.TransmissionState.FAILED), - "TransmissionState mismatch" + IRouter.TransmissionInfo memory transmissionInfo = s_forwarder.getTransmissionInfo(receiver, executionId, reportId); + assertEq(uint8(transmissionInfo.state), uint8(IRouter.TransmissionState.INVALID_RECEIVER), "state mismatch"); + } + + function test_Report_FailedDeliveryWhenReportReceiverConsumesAllGasAndInterfaceCheckUsesMax() public { + MaliciousRevertingReceiver maliciousReceiver = new MaliciousRevertingReceiver(); + // This should not revert if gas tracking is effective + // It may revert if it fails to reserve sufficient gas for routing + // This POC requires pretty specific initial gas, so that 1/64 of gas passed to `onReport()` is insufficient to store the success + s_forwarder.report{gas: 200_000}(address(maliciousReceiver), report, reportContext, signatures); + + IRouter.TransmissionInfo memory transmissionInfo = s_forwarder.getTransmissionInfo( + address(maliciousReceiver), + executionId, + reportId + ); + + assertEq(transmissionInfo.transmitter, TRANSMITTER, "transmitter mismatch"); + assertEq(uint8(transmissionInfo.state), uint8(IRouter.TransmissionState.SUCCEEDED), "state mismatch"); + } + + function test_Report_FailedDelieryWhenReportReceiverConsumesAllGas() public { + MaliciousReportReceiver s_maliciousReceiver = new MaliciousReportReceiver(); + s_forwarder.report{gas: 500_000}(address(s_maliciousReceiver), report, reportContext, signatures); + + IRouter.TransmissionInfo memory transmissionInfo = s_forwarder.getTransmissionInfo( + address(s_maliciousReceiver), + executionId, + reportId ); + + assertEq(transmissionInfo.transmitter, TRANSMITTER, "transmitter mismatch"); + assertEq(uint8(transmissionInfo.state), uint8(IRouter.TransmissionState.FAILED), "state mismatch"); + assertGt(transmissionInfo.gasLimit, 410_000, "gas limit mismatch"); } function test_Report_ConfigVersion() public { diff --git a/contracts/src/v0.8/keystone/test/KeystoneForwarder_SetConfigTest.t.sol b/contracts/src/v0.8/keystone/test/KeystoneForwarder_SetConfigTest.t.sol index 4b908bb702f..5dcf79b38ec 100644 --- a/contracts/src/v0.8/keystone/test/KeystoneForwarder_SetConfigTest.t.sol +++ b/contracts/src/v0.8/keystone/test/KeystoneForwarder_SetConfigTest.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.19; +pragma solidity 0.8.24; import {BaseTest} from "./KeystoneForwarderBaseTest.t.sol"; import {KeystoneForwarder} from "../KeystoneForwarder.sol"; @@ -41,6 +41,14 @@ contract KeystoneForwarder_SetConfigTest is BaseTest { s_forwarder.setConfig(DON_ID, CONFIG_VERSION, F, signers); } + function test_RevertWhen_ProvidingZeroAddressSigner() public { + address[] memory signers = _getSignerAddresses(); + signers[1] = address(0); + + vm.expectRevert(abi.encodeWithSelector(KeystoneForwarder.InvalidSigner.selector, signers[1])); + s_forwarder.setConfig(DON_ID, CONFIG_VERSION, F, signers); + } + function test_SetConfig_FirstTime() public { s_forwarder.setConfig(DON_ID, CONFIG_VERSION, F, _getSignerAddresses()); } diff --git a/contracts/src/v0.8/keystone/test/KeystoneForwarder_TypeAndVersionTest.t.sol b/contracts/src/v0.8/keystone/test/KeystoneForwarder_TypeAndVersionTest.t.sol index 8aad3766497..5a5cc70d2bb 100644 --- a/contracts/src/v0.8/keystone/test/KeystoneForwarder_TypeAndVersionTest.t.sol +++ b/contracts/src/v0.8/keystone/test/KeystoneForwarder_TypeAndVersionTest.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.19; +pragma solidity 0.8.24; import {BaseTest} from "./KeystoneForwarderBaseTest.t.sol"; diff --git a/contracts/src/v0.8/keystone/test/KeystoneRouter_AccessTest.t.sol b/contracts/src/v0.8/keystone/test/KeystoneRouter_AccessTest.t.sol index c126f7ce31d..0e43b72bdc1 100644 --- a/contracts/src/v0.8/keystone/test/KeystoneRouter_AccessTest.t.sol +++ b/contracts/src/v0.8/keystone/test/KeystoneRouter_AccessTest.t.sol @@ -5,6 +5,7 @@ import {Test} from "forge-std/Test.sol"; import {IReceiver} from "../interfaces/IReceiver.sol"; import {IRouter} from "../interfaces/IRouter.sol"; import {KeystoneForwarder} from "../KeystoneForwarder.sol"; +import {Receiver} from "./mocks/Receiver.sol"; contract KeystoneRouter_SetConfigTest is Test { address internal ADMIN = address(1); @@ -18,10 +19,12 @@ contract KeystoneRouter_SetConfigTest is Test { bytes32 internal id = hex"6d795f657865637574696f6e5f69640000000000000000000000000000000000"; KeystoneForwarder internal s_router; + Receiver internal s_receiver; function setUp() public virtual { vm.prank(ADMIN); s_router = new KeystoneForwarder(); + s_receiver = new Receiver(); } function test_AddForwarder_RevertWhen_NotOwner() public { @@ -36,6 +39,13 @@ contract KeystoneRouter_SetConfigTest is Test { s_router.removeForwarder(FORWARDER); } + function test_RemoveForwarder_Success() public { + vm.prank(ADMIN); + vm.expectEmit(true, false, false, false); + emit IRouter.ForwarderRemoved(FORWARDER); + s_router.removeForwarder(FORWARDER); + } + function test_Route_RevertWhen_UnauthorizedForwarder() public { vm.prank(STRANGER); vm.expectRevert(IRouter.UnauthorizedForwarder.selector); @@ -50,8 +60,8 @@ contract KeystoneRouter_SetConfigTest is Test { assertEq(s_router.isForwarder(FORWARDER), true); vm.prank(FORWARDER); - vm.mockCall(RECEIVER, abi.encodeCall(IReceiver.onReport, (metadata, report)), abi.encode()); - vm.expectCall(RECEIVER, abi.encodeCall(IReceiver.onReport, (metadata, report))); - s_router.route(id, TRANSMITTER, RECEIVER, metadata, report); + vm.mockCall(address(s_receiver), abi.encodeCall(IReceiver.onReport, (metadata, report)), abi.encode()); + vm.expectCall(address(s_receiver), abi.encodeCall(IReceiver.onReport, (metadata, report))); + s_router.route(id, TRANSMITTER, address(s_receiver), metadata, report); } } diff --git a/contracts/src/v0.8/keystone/test/mocks/CapabilityConfigurationContract.sol b/contracts/src/v0.8/keystone/test/mocks/CapabilityConfigurationContract.sol index c2a916c87e8..105c89006f0 100644 --- a/contracts/src/v0.8/keystone/test/mocks/CapabilityConfigurationContract.sol +++ b/contracts/src/v0.8/keystone/test/mocks/CapabilityConfigurationContract.sol @@ -2,9 +2,9 @@ pragma solidity 0.8.24; import {ICapabilityConfiguration} from "../../interfaces/ICapabilityConfiguration.sol"; -import {ERC165} from "../../../vendor/openzeppelin-solidity/v4.8.3/contracts/utils/introspection/ERC165.sol"; +import {IERC165} from "../../../vendor/openzeppelin-solidity/v4.8.3/contracts/interfaces/IERC165.sol"; -contract CapabilityConfigurationContract is ICapabilityConfiguration, ERC165 { +contract CapabilityConfigurationContract is ICapabilityConfiguration, IERC165 { mapping(uint256 => bytes) private s_donConfiguration; function getCapabilityConfiguration(uint32 donId) external view returns (bytes memory configuration) { @@ -17,7 +17,7 @@ contract CapabilityConfigurationContract is ICapabilityConfiguration, ERC165 { s_donConfiguration[donId] = config; } - function supportsInterface(bytes4 interfaceId) public pure override returns (bool) { - return interfaceId == this.getCapabilityConfiguration.selector ^ this.beforeCapabilityConfigSet.selector; + function supportsInterface(bytes4 interfaceId) public pure returns (bool) { + return interfaceId == type(ICapabilityConfiguration).interfaceId || interfaceId == type(IERC165).interfaceId; } } diff --git a/contracts/src/v0.8/keystone/test/mocks/MaliciousConfigurationContract.sol b/contracts/src/v0.8/keystone/test/mocks/MaliciousConfigurationContract.sol new file mode 100644 index 00000000000..2a7fc4d18d5 --- /dev/null +++ b/contracts/src/v0.8/keystone/test/mocks/MaliciousConfigurationContract.sol @@ -0,0 +1,47 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.24; + +import {ICapabilityConfiguration} from "../../interfaces/ICapabilityConfiguration.sol"; +import {CapabilitiesRegistry} from "../../CapabilitiesRegistry.sol"; +import {IERC165} from "../../../vendor/openzeppelin-solidity/v4.8.3/contracts/interfaces/IERC165.sol"; +import {Constants} from "../Constants.t.sol"; + +contract MaliciousConfigurationContract is ICapabilityConfiguration, IERC165, Constants { + bytes32 internal s_capabilityWithConfigurationContractId; + + constructor(bytes32 capabilityWithConfigContractId) { + s_capabilityWithConfigurationContractId = capabilityWithConfigContractId; + } + + function getCapabilityConfiguration(uint32) external pure returns (bytes memory configuration) { + return bytes(""); + } + + function beforeCapabilityConfigSet(bytes32[] calldata, bytes calldata, uint64, uint32) external { + CapabilitiesRegistry.NodeParams[] memory nodes = new CapabilitiesRegistry.NodeParams[](2); + bytes32[] memory hashedCapabilityIds = new bytes32[](1); + + hashedCapabilityIds[0] = s_capabilityWithConfigurationContractId; + + // Set node one's signer to another address + nodes[0] = CapabilitiesRegistry.NodeParams({ + nodeOperatorId: TEST_NODE_OPERATOR_ONE_ID, + p2pId: P2P_ID, + signer: NODE_OPERATOR_ONE_SIGNER_ADDRESS, + hashedCapabilityIds: hashedCapabilityIds + }); + + nodes[1] = CapabilitiesRegistry.NodeParams({ + nodeOperatorId: TEST_NODE_OPERATOR_ONE_ID, + p2pId: P2P_ID_THREE, + signer: NODE_OPERATOR_THREE_SIGNER_ADDRESS, + hashedCapabilityIds: hashedCapabilityIds + }); + + CapabilitiesRegistry(msg.sender).updateNodes(nodes); + } + + function supportsInterface(bytes4 interfaceId) public pure returns (bool) { + return interfaceId == type(ICapabilityConfiguration).interfaceId || interfaceId == type(IERC165).interfaceId; + } +} diff --git a/contracts/src/v0.8/keystone/test/mocks/MaliciousReportReceiver.sol b/contracts/src/v0.8/keystone/test/mocks/MaliciousReportReceiver.sol new file mode 100644 index 00000000000..ac203cccf67 --- /dev/null +++ b/contracts/src/v0.8/keystone/test/mocks/MaliciousReportReceiver.sol @@ -0,0 +1,23 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.24; + +import {IERC165} from "../../../vendor/openzeppelin-solidity/v4.8.3/contracts/interfaces/IERC165.sol"; +import {IReceiver} from "../../interfaces/IReceiver.sol"; + +contract MaliciousReportReceiver is IReceiver, IERC165 { + event MessageReceived(bytes metadata, bytes[] mercuryReports); + bytes public latestReport; + + function onReport(bytes calldata metadata, bytes calldata rawReport) external { + // Exhaust all gas that was provided + for (uint256 i = 0; i < 1_000_000_000; i++) { + bytes[] memory mercuryReports = abi.decode(rawReport, (bytes[])); + latestReport = rawReport; + emit MessageReceived(metadata, mercuryReports); + } + } + + function supportsInterface(bytes4 interfaceId) public pure override returns (bool) { + return interfaceId == type(IReceiver).interfaceId || interfaceId == type(IERC165).interfaceId; + } +} diff --git a/contracts/src/v0.8/keystone/test/mocks/MaliciousRevertingReceiver.sol b/contracts/src/v0.8/keystone/test/mocks/MaliciousRevertingReceiver.sol new file mode 100644 index 00000000000..d128b4a751e --- /dev/null +++ b/contracts/src/v0.8/keystone/test/mocks/MaliciousRevertingReceiver.sol @@ -0,0 +1,22 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.24; + +import {IERC165} from "../../../vendor/openzeppelin-solidity/v4.8.3/contracts/interfaces/IERC165.sol"; +import {IReceiver} from "../../interfaces/IReceiver.sol"; + +/// A malicious receiver that uses max allowed for ERC165 checks and consumes all gas in `onReport()` +/// Causes parent Forwarder contract to revert if it doesn't handle gas tracking accurately +contract MaliciousRevertingReceiver is IReceiver, IERC165 { + function onReport(bytes calldata, bytes calldata) external view override { + // consumes about 63/64 of all gas available + uint256 targetGasRemaining = 200; + for (uint256 i = 0; gasleft() > targetGasRemaining; i++) {} + } + + function supportsInterface(bytes4 interfaceId) public pure override returns (bool) { + // Consume up to the maximum amount of gas that can be consumed in this check + for (uint256 i = 0; i < 500; i++) {} + + return interfaceId == type(IReceiver).interfaceId || interfaceId == type(IERC165).interfaceId; + } +} diff --git a/contracts/src/v0.8/keystone/test/mocks/Receiver.sol b/contracts/src/v0.8/keystone/test/mocks/Receiver.sol index 25e8755641b..d4005950ade 100644 --- a/contracts/src/v0.8/keystone/test/mocks/Receiver.sol +++ b/contracts/src/v0.8/keystone/test/mocks/Receiver.sol @@ -1,16 +1,24 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.19; +pragma solidity 0.8.24; +import {IERC165} from "../../../vendor/openzeppelin-solidity/v4.8.3/contracts/interfaces/IERC165.sol"; import {IReceiver} from "../../interfaces/IReceiver.sol"; -contract Receiver is IReceiver { +contract Receiver is IReceiver, IERC165 { event MessageReceived(bytes metadata, bytes[] mercuryReports); + bytes public latestReport; constructor() {} function onReport(bytes calldata metadata, bytes calldata rawReport) external { + latestReport = rawReport; + // parse actual report bytes[] memory mercuryReports = abi.decode(rawReport, (bytes[])); emit MessageReceived(metadata, mercuryReports); } + + function supportsInterface(bytes4 interfaceId) public pure returns (bool) { + return interfaceId == type(IReceiver).interfaceId || interfaceId == type(IERC165).interfaceId; + } } diff --git a/contracts/src/v0.8/l2ep/dev/CrossDomainDelegateForwarder.sol b/contracts/src/v0.8/l2ep/dev/CrossDomainDelegateForwarder.sol index 5dc73619afc..859c6f0e7f3 100644 --- a/contracts/src/v0.8/l2ep/dev/CrossDomainDelegateForwarder.sol +++ b/contracts/src/v0.8/l2ep/dev/CrossDomainDelegateForwarder.sol @@ -2,7 +2,7 @@ pragma solidity ^0.8.0; import {CrossDomainOwnable} from "./CrossDomainOwnable.sol"; -import {DelegateForwarderInterface} from "./interfaces/DelegateForwarderInterface.sol"; +import {IDelegateForwarder} from "./interfaces/IDelegateForwarder.sol"; /** * @title CrossDomainDelegateForwarder - L1 xDomain account representation (with delegatecall support) @@ -10,4 +10,4 @@ import {DelegateForwarderInterface} from "./interfaces/DelegateForwarderInterfac * @dev Any other L2 contract which uses this contract's address as a privileged position, * can consider that position to be held by the `l1Owner` */ -abstract contract CrossDomainDelegateForwarder is DelegateForwarderInterface, CrossDomainOwnable {} +abstract contract CrossDomainDelegateForwarder is IDelegateForwarder, CrossDomainOwnable {} diff --git a/contracts/src/v0.8/l2ep/dev/CrossDomainForwarder.sol b/contracts/src/v0.8/l2ep/dev/CrossDomainForwarder.sol index 8f218f66b80..c097057f8a7 100644 --- a/contracts/src/v0.8/l2ep/dev/CrossDomainForwarder.sol +++ b/contracts/src/v0.8/l2ep/dev/CrossDomainForwarder.sol @@ -2,7 +2,7 @@ pragma solidity ^0.8.0; import {CrossDomainOwnable} from "./CrossDomainOwnable.sol"; -import {ForwarderInterface} from "./interfaces/ForwarderInterface.sol"; +import {IForwarder} from "./interfaces/IForwarder.sol"; /** * @title CrossDomainForwarder - L1 xDomain account representation @@ -10,4 +10,4 @@ import {ForwarderInterface} from "./interfaces/ForwarderInterface.sol"; * @dev Any other L2 contract which uses this contract's address as a privileged position, * can consider that position to be held by the `l1Owner` */ -abstract contract CrossDomainForwarder is ForwarderInterface, CrossDomainOwnable {} +abstract contract CrossDomainForwarder is IForwarder, CrossDomainOwnable {} diff --git a/contracts/src/v0.8/l2ep/dev/CrossDomainOwnable.sol b/contracts/src/v0.8/l2ep/dev/CrossDomainOwnable.sol index f861da32a7c..c85762b6fca 100644 --- a/contracts/src/v0.8/l2ep/dev/CrossDomainOwnable.sol +++ b/contracts/src/v0.8/l2ep/dev/CrossDomainOwnable.sol @@ -2,13 +2,13 @@ pragma solidity ^0.8.0; import {ConfirmedOwner} from "../../shared/access/ConfirmedOwner.sol"; -import {CrossDomainOwnableInterface} from "./interfaces/CrossDomainOwnableInterface.sol"; +import {ICrossDomainOwnable} from "./interfaces/ICrossDomainOwnable.sol"; /** * @title The CrossDomainOwnable contract * @notice A contract with helpers for cross-domain contract ownership. */ -contract CrossDomainOwnable is CrossDomainOwnableInterface, ConfirmedOwner { +contract CrossDomainOwnable is ICrossDomainOwnable, ConfirmedOwner { address internal s_l1Owner; address internal s_l1PendingOwner; diff --git a/contracts/src/v0.8/l2ep/dev/Flags.sol b/contracts/src/v0.8/l2ep/dev/Flags.sol index 0fcd095ac8e..2dc030d7d59 100644 --- a/contracts/src/v0.8/l2ep/dev/Flags.sol +++ b/contracts/src/v0.8/l2ep/dev/Flags.sol @@ -1,12 +1,12 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.6; +pragma solidity ^0.8.24; import {SimpleReadAccessController} from "../../shared/access/SimpleReadAccessController.sol"; import {AccessControllerInterface} from "../../shared/interfaces/AccessControllerInterface.sol"; import {ITypeAndVersion} from "../../shared/interfaces/ITypeAndVersion.sol"; /* dev dependencies - to be re/moved after audit */ -import {FlagsInterface} from "./interfaces/FlagsInterface.sol"; +import {IFlags} from "./interfaces/IFlags.sol"; /** * @title The Flags contract @@ -18,7 +18,7 @@ import {FlagsInterface} from "./interfaces/FlagsInterface.sol"; * FlagOn events you should filter for addresses you care about. */ // solhint-disable gas-custom-errors -contract Flags is ITypeAndVersion, FlagsInterface, SimpleReadAccessController { +contract Flags is ITypeAndVersion, IFlags, SimpleReadAccessController { AccessControllerInterface public raisingAccessController; AccessControllerInterface public loweringAccessController; diff --git a/contracts/src/v0.8/l2ep/dev/arbitrum/ArbitrumCrossDomainForwarder.sol b/contracts/src/v0.8/l2ep/dev/arbitrum/ArbitrumCrossDomainForwarder.sol index 158ffcc3042..0db657ee71c 100644 --- a/contracts/src/v0.8/l2ep/dev/arbitrum/ArbitrumCrossDomainForwarder.sol +++ b/contracts/src/v0.8/l2ep/dev/arbitrum/ArbitrumCrossDomainForwarder.sol @@ -1,9 +1,9 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; +pragma solidity ^0.8.24; -import {TypeAndVersionInterface} from "../../../interfaces/TypeAndVersionInterface.sol"; +import {ITypeAndVersion} from "../../../shared/interfaces/ITypeAndVersion.sol"; // solhint-disable-next-line no-unused-import -import {ForwarderInterface} from "../interfaces/ForwarderInterface.sol"; +import {IForwarder} from "../interfaces/IForwarder.sol"; import {CrossDomainForwarder} from "../CrossDomainForwarder.sol"; import {CrossDomainOwnable} from "../CrossDomainOwnable.sol"; @@ -17,7 +17,7 @@ import {Address} from "../../../vendor/openzeppelin-solidity/v4.7.3/contracts/ut * @dev Any other L2 contract which uses this contract's address as a privileged position, * can be considered to be owned by the `l1Owner` */ -contract ArbitrumCrossDomainForwarder is TypeAndVersionInterface, CrossDomainForwarder { +contract ArbitrumCrossDomainForwarder is ITypeAndVersion, CrossDomainForwarder { /** * @notice creates a new Arbitrum xDomain Forwarder contract * @param l1OwnerAddr the L1 owner address that will be allowed to call the forward fn @@ -31,7 +31,7 @@ contract ArbitrumCrossDomainForwarder is TypeAndVersionInterface, CrossDomainFor * - ArbitrumCrossDomainForwarder 0.1.0: initial release * - ArbitrumCrossDomainForwarder 1.0.0: Use OZ Address, CrossDomainOwnable * - * @inheritdoc TypeAndVersionInterface + * @inheritdoc ITypeAndVersion */ function typeAndVersion() external pure virtual override returns (string memory) { return "ArbitrumCrossDomainForwarder 1.0.0"; @@ -46,7 +46,7 @@ contract ArbitrumCrossDomainForwarder is TypeAndVersionInterface, CrossDomainFor /** * @dev forwarded only if L2 Messenger calls with `xDomainMessageSender` being the L1 owner address - * @inheritdoc ForwarderInterface + * @inheritdoc IForwarder */ function forward(address target, bytes memory data) external virtual override onlyL1Owner { Address.functionCall(target, data, "Forwarder call reverted"); diff --git a/contracts/src/v0.8/l2ep/dev/arbitrum/ArbitrumCrossDomainGovernor.sol b/contracts/src/v0.8/l2ep/dev/arbitrum/ArbitrumCrossDomainGovernor.sol index ebf579b8494..60d9cc52666 100644 --- a/contracts/src/v0.8/l2ep/dev/arbitrum/ArbitrumCrossDomainGovernor.sol +++ b/contracts/src/v0.8/l2ep/dev/arbitrum/ArbitrumCrossDomainGovernor.sol @@ -2,10 +2,10 @@ pragma solidity ^0.8.0; // solhint-disable-next-line no-unused-import -import {TypeAndVersionInterface} from "../../../interfaces/TypeAndVersionInterface.sol"; +import {ITypeAndVersion} from "../../../shared/interfaces/ITypeAndVersion.sol"; // solhint-disable-next-line no-unused-import -import {ForwarderInterface} from "../interfaces/ForwarderInterface.sol"; -import {DelegateForwarderInterface} from "../interfaces/DelegateForwarderInterface.sol"; +import {IForwarder} from "../interfaces/IForwarder.sol"; +import {IDelegateForwarder} from "../interfaces/IDelegateForwarder.sol"; import {ArbitrumCrossDomainForwarder} from "./ArbitrumCrossDomainForwarder.sol"; @@ -17,7 +17,7 @@ import {Address} from "../../../vendor/openzeppelin-solidity/v4.7.3/contracts/ut * @dev Any other L2 contract which uses this contract's address as a privileged position, * can be considered to be simultaneously owned by the `l1Owner` and L2 `owner` */ -contract ArbitrumCrossDomainGovernor is DelegateForwarderInterface, ArbitrumCrossDomainForwarder { +contract ArbitrumCrossDomainGovernor is IDelegateForwarder, ArbitrumCrossDomainForwarder { /** * @notice creates a new Arbitrum xDomain Forwarder contract * @param l1OwnerAddr the L1 owner address that will be allowed to call the forward fn @@ -30,7 +30,7 @@ contract ArbitrumCrossDomainGovernor is DelegateForwarderInterface, ArbitrumCros * * - ArbitrumCrossDomainGovernor 1.0.0: initial release * - * @inheritdoc TypeAndVersionInterface + * @inheritdoc ITypeAndVersion */ function typeAndVersion() external pure virtual override returns (string memory) { return "ArbitrumCrossDomainGovernor 1.0.0"; @@ -38,7 +38,7 @@ contract ArbitrumCrossDomainGovernor is DelegateForwarderInterface, ArbitrumCros /** * @dev forwarded only if L2 Messenger calls with `msg.sender` being the L1 owner address, or called by the L2 owner - * @inheritdoc ForwarderInterface + * @inheritdoc IForwarder */ function forward(address target, bytes memory data) external override onlyLocalOrCrossDomainOwner { Address.functionCall(target, data, "Governor call reverted"); @@ -46,7 +46,7 @@ contract ArbitrumCrossDomainGovernor is DelegateForwarderInterface, ArbitrumCros /** * @dev forwarded only if L2 Messenger calls with `msg.sender` being the L1 owner address, or called by the L2 owner - * @inheritdoc DelegateForwarderInterface + * @inheritdoc IDelegateForwarder */ function forwardDelegate(address target, bytes memory data) external override onlyLocalOrCrossDomainOwner { Address.functionDelegateCall(target, data, "Governor delegatecall reverted"); diff --git a/contracts/src/v0.8/l2ep/dev/arbitrum/ArbitrumSequencerUptimeFeed.sol b/contracts/src/v0.8/l2ep/dev/arbitrum/ArbitrumSequencerUptimeFeed.sol index 63952ab7ba6..678bef3a853 100644 --- a/contracts/src/v0.8/l2ep/dev/arbitrum/ArbitrumSequencerUptimeFeed.sol +++ b/contracts/src/v0.8/l2ep/dev/arbitrum/ArbitrumSequencerUptimeFeed.sol @@ -1,13 +1,13 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.4; +pragma solidity ^0.8.24; import {AddressAliasHelper} from "../../../vendor/arb-bridge-eth/v0.8.0-custom/contracts/libraries/AddressAliasHelper.sol"; import {AggregatorInterface} from "../../../shared/interfaces/AggregatorInterface.sol"; import {AggregatorV3Interface} from "../../../shared/interfaces/AggregatorV3Interface.sol"; import {AggregatorV2V3Interface} from "../../../shared/interfaces/AggregatorV2V3Interface.sol"; -import {TypeAndVersionInterface} from "../../../interfaces/TypeAndVersionInterface.sol"; -import {FlagsInterface} from "../interfaces/FlagsInterface.sol"; -import {ArbitrumSequencerUptimeFeedInterface} from "../interfaces/ArbitrumSequencerUptimeFeedInterface.sol"; +import {ITypeAndVersion} from "../../../shared/interfaces/ITypeAndVersion.sol"; +import {IFlags} from "../interfaces/IFlags.sol"; +import {ISequencerUptimeFeed} from "../interfaces/ISequencerUptimeFeed.sol"; import {SimpleReadAccessController} from "../../../shared/access/SimpleReadAccessController.sol"; /** @@ -18,8 +18,8 @@ import {SimpleReadAccessController} from "../../../shared/access/SimpleReadAcces */ contract ArbitrumSequencerUptimeFeed is AggregatorV2V3Interface, - ArbitrumSequencerUptimeFeedInterface, - TypeAndVersionInterface, + ISequencerUptimeFeed, + ITypeAndVersion, SimpleReadAccessController { /// @dev Round info (for uptime history) @@ -62,7 +62,7 @@ contract ArbitrumSequencerUptimeFeed is /// @dev Flags contract to raise/lower flags on, during status transitions // solhint-disable-next-line chainlink-solidity/prefix-immutable-variables-with-i - FlagsInterface public immutable FLAGS; + IFlags public immutable FLAGS; /// @dev L1 address address private s_l1Sender; /// @dev s_latestRoundId == 0 means this contract is uninitialized. @@ -76,7 +76,7 @@ contract ArbitrumSequencerUptimeFeed is constructor(address flagsAddress, address l1SenderAddress) { _setL1Sender(l1SenderAddress); - FLAGS = FlagsInterface(flagsAddress); + FLAGS = IFlags(flagsAddress); } /** @@ -120,7 +120,7 @@ contract ArbitrumSequencerUptimeFeed is * * - ArbitrumSequencerUptimeFeed 1.0.0: initial release * - * @inheritdoc TypeAndVersionInterface + * @inheritdoc ITypeAndVersion */ function typeAndVersion() external pure virtual override returns (string memory) { return "ArbitrumSequencerUptimeFeed 1.0.0"; diff --git a/contracts/src/v0.8/l2ep/dev/arbitrum/ArbitrumValidator.sol b/contracts/src/v0.8/l2ep/dev/arbitrum/ArbitrumValidator.sol index edcb62cae90..05f9349eb62 100644 --- a/contracts/src/v0.8/l2ep/dev/arbitrum/ArbitrumValidator.sol +++ b/contracts/src/v0.8/l2ep/dev/arbitrum/ArbitrumValidator.sol @@ -1,13 +1,13 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; +pragma solidity ^0.8.24; import {AggregatorValidatorInterface} from "../../../shared/interfaces/AggregatorValidatorInterface.sol"; -import {TypeAndVersionInterface} from "../../../interfaces/TypeAndVersionInterface.sol"; +import {ITypeAndVersion} from "../../../shared/interfaces/ITypeAndVersion.sol"; import {AccessControllerInterface} from "../../../shared/interfaces/AccessControllerInterface.sol"; import {SimpleWriteAccessController} from "../../../shared/access/SimpleWriteAccessController.sol"; /* ./dev dependencies - to be moved from ./dev after audit */ -import {ArbitrumSequencerUptimeFeedInterface} from "../interfaces/ArbitrumSequencerUptimeFeedInterface.sol"; +import {ISequencerUptimeFeed} from "../interfaces/ISequencerUptimeFeed.sol"; import {IArbitrumDelayedInbox} from "../interfaces/IArbitrumDelayedInbox.sol"; import {AddressAliasHelper} from "../../../vendor/arb-bridge-eth/v0.8.0-custom/contracts/libraries/AddressAliasHelper.sol"; import {ArbSys} from "../../../vendor/@arbitrum/nitro-contracts/src/precompiles/ArbSys.sol"; @@ -20,7 +20,7 @@ import {Address} from "../../../vendor/openzeppelin-solidity/v4.7.3/contracts/ut * - Gas configuration is controlled by a configurable external SimpleWriteAccessController * - Funds on the contract are managed by the owner */ -contract ArbitrumValidator is TypeAndVersionInterface, AggregatorValidatorInterface, SimpleWriteAccessController { +contract ArbitrumValidator is ITypeAndVersion, AggregatorValidatorInterface, SimpleWriteAccessController { enum PaymentStrategy { L1, L2 @@ -124,7 +124,7 @@ contract ArbitrumValidator is TypeAndVersionInterface, AggregatorValidatorInterf * - ArbitrumValidator 2.0.0: change how maxSubmissionCost is calculated when sending cross chain messages * - now calls `calculateRetryableSubmissionFee` instead of inlining equation to estimate * the maxSubmissionCost required to send the message to L2 - * @inheritdoc TypeAndVersionInterface + * @inheritdoc ITypeAndVersion */ function typeAndVersion() external pure virtual override returns (string memory) { return "ArbitrumValidator 2.0.0"; @@ -264,7 +264,7 @@ contract ArbitrumValidator is TypeAndVersionInterface, AggregatorValidatorInterf // Excess gas on L2 will be sent to the L2 xDomain alias address of this contract address refundAddr = L2_ALIAS; // Encode the ArbitrumSequencerUptimeFeed call - bytes4 selector = ArbitrumSequencerUptimeFeedInterface.updateStatus.selector; + bytes4 selector = ISequencerUptimeFeed.updateStatus.selector; bool status = currentAnswer == ANSWER_SEQ_OFFLINE; uint64 timestamp = uint64(block.timestamp); // Encode `status` and `timestamp` diff --git a/contracts/src/v0.8/l2ep/dev/interfaces/ArbitrumSequencerUptimeFeedInterface.sol b/contracts/src/v0.8/l2ep/dev/interfaces/ArbitrumSequencerUptimeFeedInterface.sol deleted file mode 100644 index 57b507bae8d..00000000000 --- a/contracts/src/v0.8/l2ep/dev/interfaces/ArbitrumSequencerUptimeFeedInterface.sol +++ /dev/null @@ -1,7 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; - -// solhint-disable-next-line interface-starts-with-i -interface ArbitrumSequencerUptimeFeedInterface { - function updateStatus(bool status, uint64 timestamp) external; -} diff --git a/contracts/src/v0.8/l2ep/dev/interfaces/CrossDomainOwnableInterface.sol b/contracts/src/v0.8/l2ep/dev/interfaces/CrossDomainOwnableInterface.sol deleted file mode 100644 index ddcfded9ca2..00000000000 --- a/contracts/src/v0.8/l2ep/dev/interfaces/CrossDomainOwnableInterface.sol +++ /dev/null @@ -1,16 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; - -/// @title CrossDomainOwnableInterface - A contract with helpers for cross-domain contract ownership -// solhint-disable-next-line interface-starts-with-i -interface CrossDomainOwnableInterface { - event L1OwnershipTransferRequested(address indexed from, address indexed to); - - event L1OwnershipTransferred(address indexed from, address indexed to); - - function l1Owner() external returns (address); - - function transferL1Ownership(address recipient) external; - - function acceptL1Ownership() external; -} diff --git a/contracts/src/v0.8/l2ep/dev/interfaces/DelegateForwarderInterface.sol b/contracts/src/v0.8/l2ep/dev/interfaces/DelegateForwarderInterface.sol deleted file mode 100644 index 498dee586c8..00000000000 --- a/contracts/src/v0.8/l2ep/dev/interfaces/DelegateForwarderInterface.sol +++ /dev/null @@ -1,13 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; - -/// @title DelegateForwarderInterface - forwards a delegatecall to a target, under some conditions -// solhint-disable-next-line interface-starts-with-i -interface DelegateForwarderInterface { - /** - * @notice forward delegatecalls the `target` with `data` - * @param target contract address to be delegatecalled - * @param data to send to target contract - */ - function forwardDelegate(address target, bytes memory data) external; -} diff --git a/contracts/src/v0.8/l2ep/dev/interfaces/FlagsInterface.sol b/contracts/src/v0.8/l2ep/dev/interfaces/FlagsInterface.sol deleted file mode 100644 index b6491a9d601..00000000000 --- a/contracts/src/v0.8/l2ep/dev/interfaces/FlagsInterface.sol +++ /dev/null @@ -1,21 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.6; - -// solhint-disable-next-line interface-starts-with-i -interface FlagsInterface { - function getFlag(address) external view returns (bool); - - function getFlags(address[] calldata) external view returns (bool[] memory); - - function raiseFlag(address) external; - - function raiseFlags(address[] calldata) external; - - function lowerFlag(address) external; - - function lowerFlags(address[] calldata) external; - - function setRaisingAccessController(address) external; - - function setLoweringAccessController(address) external; -} diff --git a/contracts/src/v0.8/l2ep/dev/interfaces/ForwarderInterface.sol b/contracts/src/v0.8/l2ep/dev/interfaces/ForwarderInterface.sol deleted file mode 100644 index a6db32b9231..00000000000 --- a/contracts/src/v0.8/l2ep/dev/interfaces/ForwarderInterface.sol +++ /dev/null @@ -1,13 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; - -/// @title ForwarderInterface - forwards a call to a target, under some conditions -// solhint-disable-next-line interface-starts-with-i -interface ForwarderInterface { - /** - * @notice forward calls the `target` with `data` - * @param target contract address to be called - * @param data to send to target contract - */ - function forward(address target, bytes memory data) external; -} diff --git a/contracts/src/v0.8/l2ep/dev/interfaces/ICrossDomainOwnable.sol b/contracts/src/v0.8/l2ep/dev/interfaces/ICrossDomainOwnable.sol new file mode 100644 index 00000000000..d5a01386e3c --- /dev/null +++ b/contracts/src/v0.8/l2ep/dev/interfaces/ICrossDomainOwnable.sol @@ -0,0 +1,15 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +/// @title A contract with helpers for cross-domain contract ownership +interface ICrossDomainOwnable { + event L1OwnershipTransferRequested(address indexed from, address indexed to); + + event L1OwnershipTransferred(address indexed from, address indexed to); + + function l1Owner() external returns (address); + + function transferL1Ownership(address recipient) external; + + function acceptL1Ownership() external; +} diff --git a/contracts/src/v0.8/l2ep/dev/interfaces/IDelegateForwarder.sol b/contracts/src/v0.8/l2ep/dev/interfaces/IDelegateForwarder.sol new file mode 100644 index 00000000000..3df532b94c5 --- /dev/null +++ b/contracts/src/v0.8/l2ep/dev/interfaces/IDelegateForwarder.sol @@ -0,0 +1,10 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +/// @title Forwards a delegatecall to a target, under some conditions +interface IDelegateForwarder { + /// @notice forward delegatecalls the `target` with `data` + /// @param target contract address to be delegatecalled + /// @param data to send to target contract + function forwardDelegate(address target, bytes memory data) external; +} diff --git a/contracts/src/v0.8/l2ep/dev/interfaces/IFlags.sol b/contracts/src/v0.8/l2ep/dev/interfaces/IFlags.sol new file mode 100644 index 00000000000..6ae5a3a3f38 --- /dev/null +++ b/contracts/src/v0.8/l2ep/dev/interfaces/IFlags.sol @@ -0,0 +1,20 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +interface IFlags { + function getFlag(address) external view returns (bool); + + function getFlags(address[] calldata) external view returns (bool[] memory); + + function raiseFlag(address) external; + + function raiseFlags(address[] calldata) external; + + function lowerFlag(address) external; + + function lowerFlags(address[] calldata) external; + + function setRaisingAccessController(address) external; + + function setLoweringAccessController(address) external; +} diff --git a/contracts/src/v0.8/l2ep/dev/interfaces/IForwarder.sol b/contracts/src/v0.8/l2ep/dev/interfaces/IForwarder.sol new file mode 100644 index 00000000000..374e3810647 --- /dev/null +++ b/contracts/src/v0.8/l2ep/dev/interfaces/IForwarder.sol @@ -0,0 +1,10 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +/// @title Forwards a call to a target, under some conditions +interface IForwarder { + /// @notice forward calls the `target` with `data` + /// @param target contract address to be called + /// @param data to send to target contract + function forward(address target, bytes memory data) external; +} diff --git a/contracts/src/v0.8/l2ep/dev/interfaces/ISequencerUptimeFeed.sol b/contracts/src/v0.8/l2ep/dev/interfaces/ISequencerUptimeFeed.sol new file mode 100644 index 00000000000..879dc06d37e --- /dev/null +++ b/contracts/src/v0.8/l2ep/dev/interfaces/ISequencerUptimeFeed.sol @@ -0,0 +1,6 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +interface ISequencerUptimeFeed { + function updateStatus(bool status, uint64 timestamp) external; +} diff --git a/contracts/src/v0.8/l2ep/dev/interfaces/OptimismSequencerUptimeFeedInterface.sol b/contracts/src/v0.8/l2ep/dev/interfaces/OptimismSequencerUptimeFeedInterface.sol deleted file mode 100644 index a08a1b26204..00000000000 --- a/contracts/src/v0.8/l2ep/dev/interfaces/OptimismSequencerUptimeFeedInterface.sol +++ /dev/null @@ -1,7 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; - -// solhint-disable-next-line interface-starts-with-i -interface OptimismSequencerUptimeFeedInterface { - function updateStatus(bool status, uint64 timestamp) external; -} diff --git a/contracts/src/v0.8/l2ep/dev/interfaces/ScrollSequencerUptimeFeedInterface.sol b/contracts/src/v0.8/l2ep/dev/interfaces/ScrollSequencerUptimeFeedInterface.sol deleted file mode 100644 index 89327fbc3a1..00000000000 --- a/contracts/src/v0.8/l2ep/dev/interfaces/ScrollSequencerUptimeFeedInterface.sol +++ /dev/null @@ -1,7 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity 0.8.19; - -// solhint-disable-next-line interface-starts-with-i -interface ScrollSequencerUptimeFeedInterface { - function updateStatus(bool status, uint64 timestamp) external; -} diff --git a/contracts/src/v0.8/l2ep/dev/optimism/OptimismCrossDomainForwarder.sol b/contracts/src/v0.8/l2ep/dev/optimism/OptimismCrossDomainForwarder.sol index 37d9260b47b..1d037886960 100644 --- a/contracts/src/v0.8/l2ep/dev/optimism/OptimismCrossDomainForwarder.sol +++ b/contracts/src/v0.8/l2ep/dev/optimism/OptimismCrossDomainForwarder.sol @@ -1,9 +1,9 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; +pragma solidity ^0.8.24; -import {TypeAndVersionInterface} from "../../../interfaces/TypeAndVersionInterface.sol"; +import {ITypeAndVersion} from "../../../shared/interfaces/ITypeAndVersion.sol"; // solhint-disable-next-line no-unused-import -import {ForwarderInterface} from "../interfaces/ForwarderInterface.sol"; +import {IForwarder} from "../interfaces/IForwarder.sol"; /* ./dev dependencies - to be moved from ./dev after audit */ import {CrossDomainForwarder} from "../CrossDomainForwarder.sol"; @@ -18,7 +18,7 @@ import {Address} from "../../../vendor/openzeppelin-solidity/v4.7.3/contracts/ut * @dev Any other L2 contract which uses this contract's address as a privileged position, * can be considered to be owned by the `l1Owner` */ -contract OptimismCrossDomainForwarder is TypeAndVersionInterface, CrossDomainForwarder { +contract OptimismCrossDomainForwarder is ITypeAndVersion, CrossDomainForwarder { // OVM_L2CrossDomainMessenger is a precompile usually deployed to 0x4200000000000000000000000000000000000007 // solhint-disable-next-line chainlink-solidity/prefix-immutable-variables-with-i iOVM_CrossDomainMessenger private immutable OVM_CROSS_DOMAIN_MESSENGER; @@ -40,7 +40,7 @@ contract OptimismCrossDomainForwarder is TypeAndVersionInterface, CrossDomainFor * - OptimismCrossDomainForwarder 0.1.0: initial release * - OptimismCrossDomainForwarder 1.0.0: Use OZ Address, CrossDomainOwnable * - * @inheritdoc TypeAndVersionInterface + * @inheritdoc ITypeAndVersion */ function typeAndVersion() external pure virtual override returns (string memory) { return "OptimismCrossDomainForwarder 1.0.0"; @@ -48,7 +48,7 @@ contract OptimismCrossDomainForwarder is TypeAndVersionInterface, CrossDomainFor /** * @dev forwarded only if L2 Messenger calls with `xDomainMessageSender` being the L1 owner address - * @inheritdoc ForwarderInterface + * @inheritdoc IForwarder */ function forward(address target, bytes memory data) external virtual override onlyL1Owner { Address.functionCall(target, data, "Forwarder call reverted"); diff --git a/contracts/src/v0.8/l2ep/dev/optimism/OptimismCrossDomainGovernor.sol b/contracts/src/v0.8/l2ep/dev/optimism/OptimismCrossDomainGovernor.sol index ad780946911..6a41bd98f03 100644 --- a/contracts/src/v0.8/l2ep/dev/optimism/OptimismCrossDomainGovernor.sol +++ b/contracts/src/v0.8/l2ep/dev/optimism/OptimismCrossDomainGovernor.sol @@ -1,9 +1,9 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; +pragma solidity ^0.8.24; -import {DelegateForwarderInterface} from "../interfaces/DelegateForwarderInterface.sol"; +import {IDelegateForwarder} from "../interfaces/IDelegateForwarder.sol"; // solhint-disable-next-line no-unused-import -import {ForwarderInterface} from "../interfaces/ForwarderInterface.sol"; +import {IForwarder} from "../interfaces/IForwarder.sol"; import {OptimismCrossDomainForwarder} from "./OptimismCrossDomainForwarder.sol"; @@ -16,7 +16,7 @@ import {Address} from "../../../vendor/openzeppelin-solidity/v4.7.3/contracts/ut * @dev Any other L2 contract which uses this contract's address as a privileged position, * can be considered to be simultaneously owned by the `l1Owner` and L2 `owner` */ -contract OptimismCrossDomainGovernor is DelegateForwarderInterface, OptimismCrossDomainForwarder { +contract OptimismCrossDomainGovernor is IDelegateForwarder, OptimismCrossDomainForwarder { /** * @notice creates a new Optimism xDomain Forwarder contract * @param crossDomainMessengerAddr the xDomain bridge messenger (Optimism bridge L2) contract address @@ -39,7 +39,7 @@ contract OptimismCrossDomainGovernor is DelegateForwarderInterface, OptimismCros /** * @dev forwarded only if L2 Messenger calls with `msg.sender` being the L1 owner address, or called by the L2 owner - * @inheritdoc ForwarderInterface + * @inheritdoc IForwarder */ function forward(address target, bytes memory data) external override onlyLocalOrCrossDomainOwner { Address.functionCall(target, data, "Governor call reverted"); @@ -47,7 +47,7 @@ contract OptimismCrossDomainGovernor is DelegateForwarderInterface, OptimismCros /** * @dev forwarded only if L2 Messenger calls with `msg.sender` being the L1 owner address, or called by the L2 owner - * @inheritdoc DelegateForwarderInterface + * @inheritdoc IDelegateForwarder */ function forwardDelegate(address target, bytes memory data) external override onlyLocalOrCrossDomainOwner { Address.functionDelegateCall(target, data, "Governor delegatecall reverted"); diff --git a/contracts/src/v0.8/l2ep/dev/optimism/OptimismSequencerUptimeFeed.sol b/contracts/src/v0.8/l2ep/dev/optimism/OptimismSequencerUptimeFeed.sol index 947b1b0bf5d..0e6f9c52f22 100644 --- a/contracts/src/v0.8/l2ep/dev/optimism/OptimismSequencerUptimeFeed.sol +++ b/contracts/src/v0.8/l2ep/dev/optimism/OptimismSequencerUptimeFeed.sol @@ -1,12 +1,8 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.4; +pragma solidity ^0.8.19; + +import {BaseSequencerUptimeFeed} from "../shared/BaseSequencerUptimeFeed.sol"; -import {AggregatorInterface} from "../../../shared/interfaces/AggregatorInterface.sol"; -import {AggregatorV3Interface} from "../../../shared/interfaces/AggregatorV3Interface.sol"; -import {AggregatorV2V3Interface} from "../../../shared/interfaces/AggregatorV2V3Interface.sol"; -import {TypeAndVersionInterface} from "../../../interfaces/TypeAndVersionInterface.sol"; -import {OptimismSequencerUptimeFeedInterface} from "./../interfaces/OptimismSequencerUptimeFeedInterface.sol"; -import {SimpleReadAccessController} from "../../../shared/access/SimpleReadAccessController.sol"; import {IL2CrossDomainMessenger} from "@eth-optimism/contracts/L2/messaging/IL2CrossDomainMessenger.sol"; /** @@ -14,50 +10,8 @@ import {IL2CrossDomainMessenger} from "@eth-optimism/contracts/L2/messaging/IL2C * @notice L2 contract that receives status updates from a specific L1 address, * records a new answer if the status changed */ -contract OptimismSequencerUptimeFeed is - AggregatorV2V3Interface, - OptimismSequencerUptimeFeedInterface, - TypeAndVersionInterface, - SimpleReadAccessController -{ - /// @dev Round info (for uptime history) - struct Round { - bool status; - uint64 startedAt; - uint64 updatedAt; - } - - /// @dev Packed state struct to save sloads - struct FeedState { - uint80 latestRoundId; - bool latestStatus; - uint64 startedAt; - uint64 updatedAt; - } - - /// @notice Sender is not the L2 messenger - error InvalidSender(); - /// @notice Replacement for AggregatorV3Interface "No data present" - error NoDataPresent(); - - event L1SenderTransferred(address indexed from, address indexed to); - /// @dev Emitted when an `updateStatus` call is ignored due to unchanged status or stale timestamp - event UpdateIgnored(bool latestStatus, uint64 latestTimestamp, bool incomingStatus, uint64 incomingTimestamp); - /// @dev Emitted when a updateStatus is called without the status changing - event RoundUpdated(int256 status, uint64 updatedAt); - - // solhint-disable-next-line chainlink-solidity/all-caps-constant-storage-variables - uint8 public constant override decimals = 0; - // solhint-disable-next-line chainlink-solidity/all-caps-constant-storage-variables - string public constant override description = "L2 Sequencer Uptime Status Feed"; - // solhint-disable-next-line chainlink-solidity/all-caps-constant-storage-variables - uint256 public constant override version = 1; - - /// @dev L1 address - address private s_l1Sender; - /// @dev s_latestRoundId == 0 means this contract is uninitialized. - FeedState private s_feedState = FeedState({latestRoundId: 0, latestStatus: false, startedAt: 0, updatedAt: 0}); - mapping(uint80 => Round) private s_rounds; +contract OptimismSequencerUptimeFeed is BaseSequencerUptimeFeed { + string public constant override typeAndVersion = "OptimismSequencerUptimeFeed 1.1.0-dev"; // solhint-disable-next-line chainlink-solidity/prefix-immutable-variables-with-i IL2CrossDomainMessenger private immutable s_l2CrossDomainMessenger; @@ -67,202 +21,19 @@ contract OptimismSequencerUptimeFeed is * @param l2CrossDomainMessengerAddr Address of the L2CrossDomainMessenger contract * @param initialStatus The initial status of the feed */ - constructor(address l1SenderAddress, address l2CrossDomainMessengerAddr, bool initialStatus) { - _setL1Sender(l1SenderAddress); + constructor( + address l1SenderAddress, + address l2CrossDomainMessengerAddr, + bool initialStatus + ) BaseSequencerUptimeFeed(l1SenderAddress, initialStatus) { s_l2CrossDomainMessenger = IL2CrossDomainMessenger(l2CrossDomainMessengerAddr); - uint64 timestamp = uint64(block.timestamp); - - // Initialise roundId == 1 as the first round - _recordRound(1, initialStatus, timestamp); - } - - /** - * @notice Check if a roundId is valid in this current contract state - * @dev Mainly used for AggregatorV2V3Interface functions - * @param roundId Round ID to check - */ - function _isValidRound(uint256 roundId) private view returns (bool) { - return roundId > 0 && roundId <= type(uint80).max && s_feedState.latestRoundId >= roundId; - } - - /** - * @notice versions: - * - * - OptimismSequencerUptimeFeed 1.0.0: initial release - * - * @inheritdoc TypeAndVersionInterface - */ - function typeAndVersion() external pure virtual override returns (string memory) { - return "OptimismSequencerUptimeFeed 1.0.0"; - } - - /// @return L1 sender address - function l1Sender() public view virtual returns (address) { - return s_l1Sender; - } - - /** - * @notice Set the allowed L1 sender for this contract to a new L1 sender - * @dev Can be disabled by setting the L1 sender as `address(0)`. Accessible only by owner. - * @param to new L1 sender that will be allowed to call `updateStatus` on this contract - */ - function transferL1Sender(address to) external virtual onlyOwner { - _setL1Sender(to); - } - - /// @notice internal method that stores the L1 sender - function _setL1Sender(address to) private { - address from = s_l1Sender; - if (from != to) { - s_l1Sender = to; - emit L1SenderTransferred(from, to); - } - } - - /** - * @dev Returns an AggregatorV2V3Interface compatible answer from status flag - * - * @param status The status flag to convert to an aggregator-compatible answer - */ - function _getStatusAnswer(bool status) private pure returns (int256) { - return status ? int256(1) : int256(0); - } - - /** - * @notice Helper function to record a round and set the latest feed state. - * - * @param roundId The round ID to record - * @param status Sequencer status - * @param timestamp The L1 block timestamp of status update - */ - function _recordRound(uint80 roundId, bool status, uint64 timestamp) private { - uint64 updatedAt = uint64(block.timestamp); - Round memory nextRound = Round(status, timestamp, updatedAt); - FeedState memory feedState = FeedState(roundId, status, timestamp, updatedAt); - - s_rounds[roundId] = nextRound; - s_feedState = feedState; - - emit NewRound(roundId, msg.sender, timestamp); - emit AnswerUpdated(_getStatusAnswer(status), roundId, timestamp); } - /** - * @notice Helper function to update when a round was last updated - * - * @param roundId The round ID to update - * @param status Sequencer status - */ - function _updateRound(uint80 roundId, bool status) private { - uint64 updatedAt = uint64(block.timestamp); - s_rounds[roundId].updatedAt = updatedAt; - s_feedState.updatedAt = updatedAt; - emit RoundUpdated(_getStatusAnswer(status), updatedAt); - } - - /** - * @notice Record a new status and timestamp if it has changed since the last round. - * @dev This function will revert if not called from `l1Sender` via the L1->L2 messenger. - * - * @param status Sequencer status - * @param timestamp Block timestamp of status update - */ - function updateStatus(bool status, uint64 timestamp) external override { - FeedState memory feedState = s_feedState; + function _validateSender(address l1Sender) internal view override { if ( - msg.sender != address(s_l2CrossDomainMessenger) || s_l2CrossDomainMessenger.xDomainMessageSender() != s_l1Sender + msg.sender != address(s_l2CrossDomainMessenger) || s_l2CrossDomainMessenger.xDomainMessageSender() != l1Sender ) { revert InvalidSender(); } - - // Ignore if latest recorded timestamp is newer - if (feedState.startedAt > timestamp) { - emit UpdateIgnored(feedState.latestStatus, feedState.startedAt, status, timestamp); - return; - } - - if (feedState.latestStatus == status) { - _updateRound(feedState.latestRoundId, status); - } else { - feedState.latestRoundId += 1; - _recordRound(feedState.latestRoundId, status, timestamp); - } - } - - /// @inheritdoc AggregatorInterface - function latestAnswer() external view override checkAccess returns (int256) { - FeedState memory feedState = s_feedState; - return _getStatusAnswer(feedState.latestStatus); - } - - /// @inheritdoc AggregatorInterface - function latestTimestamp() external view override checkAccess returns (uint256) { - FeedState memory feedState = s_feedState; - return feedState.startedAt; - } - - /// @inheritdoc AggregatorInterface - function latestRound() external view override checkAccess returns (uint256) { - FeedState memory feedState = s_feedState; - return feedState.latestRoundId; - } - - /// @inheritdoc AggregatorInterface - function getAnswer(uint256 roundId) external view override checkAccess returns (int256) { - if (_isValidRound(roundId)) { - return _getStatusAnswer(s_rounds[uint80(roundId)].status); - } - - revert NoDataPresent(); - } - - /// @inheritdoc AggregatorInterface - function getTimestamp(uint256 roundId) external view override checkAccess returns (uint256) { - if (_isValidRound(roundId)) { - return s_rounds[uint80(roundId)].startedAt; - } - - revert NoDataPresent(); - } - - /// @inheritdoc AggregatorV3Interface - function getRoundData( - uint80 _roundId - ) - public - view - override - checkAccess - returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound) - { - if (_isValidRound(_roundId)) { - Round memory round = s_rounds[_roundId]; - answer = _getStatusAnswer(round.status); - startedAt = uint256(round.startedAt); - roundId = _roundId; - updatedAt = uint256(round.updatedAt); - answeredInRound = roundId; - } else { - revert NoDataPresent(); - } - return (roundId, answer, startedAt, updatedAt, answeredInRound); - } - - /// @inheritdoc AggregatorV3Interface - function latestRoundData() - external - view - override - checkAccess - returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound) - { - FeedState memory feedState = s_feedState; - - roundId = feedState.latestRoundId; - answer = _getStatusAnswer(feedState.latestStatus); - startedAt = feedState.startedAt; - updatedAt = feedState.updatedAt; - answeredInRound = roundId; - return (roundId, answer, startedAt, updatedAt, answeredInRound); } } diff --git a/contracts/src/v0.8/l2ep/dev/optimism/OptimismValidator.sol b/contracts/src/v0.8/l2ep/dev/optimism/OptimismValidator.sol index a54a56ee604..cf5222f017e 100644 --- a/contracts/src/v0.8/l2ep/dev/optimism/OptimismValidator.sol +++ b/contracts/src/v0.8/l2ep/dev/optimism/OptimismValidator.sol @@ -1,82 +1,28 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; +pragma solidity ^0.8.19; -import {AggregatorValidatorInterface} from "../../../shared/interfaces/AggregatorValidatorInterface.sol"; -import {TypeAndVersionInterface} from "../../../interfaces/TypeAndVersionInterface.sol"; -import {OptimismSequencerUptimeFeedInterface} from "./../interfaces/OptimismSequencerUptimeFeedInterface.sol"; +import {ISequencerUptimeFeed} from "./../interfaces/ISequencerUptimeFeed.sol"; -import {SimpleWriteAccessController} from "../../../shared/access/SimpleWriteAccessController.sol"; +import {BaseValidator} from "../shared/BaseValidator.sol"; import {IL1CrossDomainMessenger} from "@eth-optimism/contracts/L1/messaging/IL1CrossDomainMessenger.sol"; -/** - * @title OptimismValidator - makes cross chain call to update the Sequencer Uptime Feed on L2 - */ -contract OptimismValidator is TypeAndVersionInterface, AggregatorValidatorInterface, SimpleWriteAccessController { - int256 private constant ANSWER_SEQ_OFFLINE = 1; - uint32 private s_gasLimit; - - // solhint-disable-next-line chainlink-solidity/prefix-immutable-variables-with-i - address public immutable L1_CROSS_DOMAIN_MESSENGER_ADDRESS; - // solhint-disable-next-line chainlink-solidity/prefix-immutable-variables-with-i - address public immutable L2_UPTIME_FEED_ADDR; - - /** - * @notice emitted when gas cost to spend on L2 is updated - * @param gasLimit updated gas cost - */ - event GasLimitUpdated(uint32 gasLimit); - - /** - * @param l1CrossDomainMessengerAddress address the L1CrossDomainMessenger contract address - * @param l2UptimeFeedAddr the address of the OptimismSequencerUptimeFeed contract address - * @param gasLimit the gasLimit to use for sending a message from L1 to L2 - */ - constructor(address l1CrossDomainMessengerAddress, address l2UptimeFeedAddr, uint32 gasLimit) { - // solhint-disable-next-line gas-custom-errors - require(l1CrossDomainMessengerAddress != address(0), "Invalid xDomain Messenger address"); - // solhint-disable-next-line gas-custom-errors - require(l2UptimeFeedAddr != address(0), "Invalid OptimismSequencerUptimeFeed contract address"); - L1_CROSS_DOMAIN_MESSENGER_ADDRESS = l1CrossDomainMessengerAddress; - L2_UPTIME_FEED_ADDR = l2UptimeFeedAddr; - s_gasLimit = gasLimit; - } - - /** - * @notice versions: - * - * - OptimismValidator 0.1.0: initial release - * - OptimismValidator 1.0.0: change target of L2 sequencer status update - * - now calls `updateStatus` on an L2 OptimismSequencerUptimeFeed contract instead of - * directly calling the Flags contract - * - * @inheritdoc TypeAndVersionInterface - */ - function typeAndVersion() external pure virtual override returns (string memory) { - return "OptimismValidator 1.0.0"; - } - - /** - * @notice sets the new gas cost to spend when sending cross chain message - * @param gasLimit the updated gas cost - */ - function setGasLimit(uint32 gasLimit) external onlyOwner { - s_gasLimit = gasLimit; - emit GasLimitUpdated(gasLimit); - } - - /** - * @notice fetches the gas cost of sending a cross chain message - */ - function getGasLimit() external view returns (uint32) { - return s_gasLimit; - } - - /** - * @notice validate method sends an xDomain L2 tx to update Uptime Feed contract on L2. - * @dev A message is sent using the L1CrossDomainMessenger. This method is accessed controlled. - * @param currentAnswer new aggregator answer - value of 1 considers the sequencer offline. - */ +/// @title OptimismValidator - makes cross chain call to update the Sequencer Uptime Feed on L2 +contract OptimismValidator is BaseValidator { + string public constant override typeAndVersion = "OptimismValidator 1.1.0-dev"; + + /// @param l1CrossDomainMessengerAddress address the L1CrossDomainMessenger contract address + /// @param l2UptimeFeedAddr the address of the OptimismSequencerUptimeFeed contract address + /// @param gasLimit the gasLimit to use for sending a message from L1 to L2 + constructor( + address l1CrossDomainMessengerAddress, + address l2UptimeFeedAddr, + uint32 gasLimit + ) BaseValidator(l1CrossDomainMessengerAddress, l2UptimeFeedAddr, gasLimit) {} + + /// @notice validate method sends an xDomain L2 tx to update Uptime Feed contract on L2. + /// @dev A message is sent using the L1CrossDomainMessenger. This method is accessed controlled. + /// @param currentAnswer new aggregator answer - value of 1 considers the sequencer offline. function validate( uint256 /* previousRoundId */, int256 /* previousAnswer */, @@ -84,7 +30,7 @@ contract OptimismValidator is TypeAndVersionInterface, AggregatorValidatorInterf int256 currentAnswer ) external override checkAccess returns (bool) { // Encode the OptimismSequencerUptimeFeed call - bytes4 selector = OptimismSequencerUptimeFeedInterface.updateStatus.selector; + bytes4 selector = ISequencerUptimeFeed.updateStatus.selector; bool status = currentAnswer == ANSWER_SEQ_OFFLINE; uint64 timestamp = uint64(block.timestamp); // Encode `status` and `timestamp` diff --git a/contracts/src/v0.8/l2ep/dev/scroll/ScrollCrossDomainForwarder.sol b/contracts/src/v0.8/l2ep/dev/scroll/ScrollCrossDomainForwarder.sol index 4ec51fc6938..c70bc794afb 100644 --- a/contracts/src/v0.8/l2ep/dev/scroll/ScrollCrossDomainForwarder.sol +++ b/contracts/src/v0.8/l2ep/dev/scroll/ScrollCrossDomainForwarder.sol @@ -1,8 +1,8 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.19; +pragma solidity 0.8.24; -import {TypeAndVersionInterface} from "../../../interfaces/TypeAndVersionInterface.sol"; -import {ForwarderInterface} from "../interfaces/ForwarderInterface.sol"; +import {ITypeAndVersion} from "../../../shared/interfaces/ITypeAndVersion.sol"; +import {IForwarder} from "../interfaces/IForwarder.sol"; import {CrossDomainForwarder} from "../CrossDomainForwarder.sol"; import {CrossDomainOwnable} from "../CrossDomainOwnable.sol"; @@ -14,7 +14,7 @@ import {Address} from "../../../vendor/openzeppelin-solidity/v4.7.3/contracts/ut /// @notice L2 Contract which receives messages from a specific L1 address and transparently forwards them to the destination. /// @dev Any other L2 contract which uses this contract's address as a privileged position, /// can be considered to be owned by the `l1Owner` -contract ScrollCrossDomainForwarder is TypeAndVersionInterface, CrossDomainForwarder { +contract ScrollCrossDomainForwarder is ITypeAndVersion, CrossDomainForwarder { string public constant override typeAndVersion = "ScrollCrossDomainForwarder 1.0.0"; address internal immutable i_scrollCrossDomainMessenger; @@ -28,7 +28,7 @@ contract ScrollCrossDomainForwarder is TypeAndVersionInterface, CrossDomainForwa } /// @dev forwarded only if L2 Messenger calls with `xDomainMessageSender` being the L1 owner address - /// @inheritdoc ForwarderInterface + /// @inheritdoc IForwarder function forward(address target, bytes memory data) external override onlyL1Owner { Address.functionCall(target, data, "Forwarder call reverted"); } diff --git a/contracts/src/v0.8/l2ep/dev/scroll/ScrollCrossDomainGovernor.sol b/contracts/src/v0.8/l2ep/dev/scroll/ScrollCrossDomainGovernor.sol index f7d13059fe7..dae621e9b08 100644 --- a/contracts/src/v0.8/l2ep/dev/scroll/ScrollCrossDomainGovernor.sol +++ b/contracts/src/v0.8/l2ep/dev/scroll/ScrollCrossDomainGovernor.sol @@ -1,10 +1,10 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.19; +pragma solidity 0.8.24; -import {TypeAndVersionInterface} from "../../../interfaces/TypeAndVersionInterface.sol"; -import {DelegateForwarderInterface} from "../interfaces/DelegateForwarderInterface.sol"; +import {ITypeAndVersion} from "../../../shared/interfaces/ITypeAndVersion.sol"; +import {IDelegateForwarder} from "../interfaces/IDelegateForwarder.sol"; // solhint-disable-next-line no-unused-import -import {ForwarderInterface} from "../interfaces/ForwarderInterface.sol"; +import {IForwarder} from "../interfaces/IForwarder.sol"; import {CrossDomainForwarder} from "../CrossDomainForwarder.sol"; import {CrossDomainOwnable} from "../CrossDomainOwnable.sol"; @@ -16,7 +16,7 @@ import {Address} from "../../../vendor/openzeppelin-solidity/v4.7.3/contracts/ut /// @notice L2 Contract which receives messages from a specific L1 address and transparently forwards them to the destination. /// @dev Any other L2 contract which uses this contract's address as a privileged position, /// can be considered to be simultaneously owned by the `l1Owner` and L2 `owner` -contract ScrollCrossDomainGovernor is DelegateForwarderInterface, TypeAndVersionInterface, CrossDomainForwarder { +contract ScrollCrossDomainGovernor is IDelegateForwarder, ITypeAndVersion, CrossDomainForwarder { string public constant override typeAndVersion = "ScrollCrossDomainGovernor 1.0.0"; address internal immutable i_scrollCrossDomainMessenger; @@ -29,13 +29,13 @@ contract ScrollCrossDomainGovernor is DelegateForwarderInterface, TypeAndVersion i_scrollCrossDomainMessenger = address(crossDomainMessengerAddr); } - /// @inheritdoc ForwarderInterface + /// @inheritdoc IForwarder /// @dev forwarded only if L2 Messenger calls with `msg.sender` being the L1 owner address, or called by the L2 owner function forward(address target, bytes memory data) external override onlyLocalOrCrossDomainOwner { Address.functionCall(target, data, "Governor call reverted"); } - /// @inheritdoc DelegateForwarderInterface + /// @inheritdoc IDelegateForwarder /// @dev forwarded only if L2 Messenger calls with `msg.sender` being the L1 owner address, or called by the L2 owner function forwardDelegate(address target, bytes memory data) external override onlyLocalOrCrossDomainOwner { Address.functionDelegateCall(target, data, "Governor delegatecall reverted"); diff --git a/contracts/src/v0.8/l2ep/dev/scroll/ScrollSequencerUptimeFeed.sol b/contracts/src/v0.8/l2ep/dev/scroll/ScrollSequencerUptimeFeed.sol index e60e8703b77..40f2941aa69 100644 --- a/contracts/src/v0.8/l2ep/dev/scroll/ScrollSequencerUptimeFeed.sol +++ b/contracts/src/v0.8/l2ep/dev/scroll/ScrollSequencerUptimeFeed.sol @@ -1,66 +1,16 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.19; +pragma solidity 0.8.24; -import {ScrollSequencerUptimeFeedInterface} from "../interfaces/ScrollSequencerUptimeFeedInterface.sol"; -import {AggregatorInterface} from "../../../shared/interfaces/AggregatorInterface.sol"; -import {AggregatorV3Interface} from "../../../shared/interfaces/AggregatorV3Interface.sol"; -import {AggregatorV2V3Interface} from "../../../shared/interfaces/AggregatorV2V3Interface.sol"; -import {TypeAndVersionInterface} from "../../../interfaces/TypeAndVersionInterface.sol"; - -import {SimpleReadAccessController} from "../../../shared/access/SimpleReadAccessController.sol"; +import {BaseSequencerUptimeFeed} from "../shared/BaseSequencerUptimeFeed.sol"; import {IL2ScrollMessenger} from "@scroll-tech/contracts/L2/IL2ScrollMessenger.sol"; /// @title ScrollSequencerUptimeFeed - L2 sequencer uptime status aggregator /// @notice L2 contract that receives status updates, and records a new answer if the status changed -contract ScrollSequencerUptimeFeed is - AggregatorV2V3Interface, - ScrollSequencerUptimeFeedInterface, - TypeAndVersionInterface, - SimpleReadAccessController -{ - string public constant override typeAndVersion = "ScrollSequencerUptimeFeed 1.0.0"; - - /// @dev Round info (for uptime history) - struct Round { - bool status; - uint64 startedAt; - uint64 updatedAt; - } - - /// @dev Packed state struct to save sloads - struct FeedState { - uint80 latestRoundId; - bool latestStatus; - uint64 startedAt; - uint64 updatedAt; - } - - /// @notice Sender is not the L2 messenger - error InvalidSender(); - /// @notice Replacement for AggregatorV3Interface "No data present" - error NoDataPresent(); - /// @notice Address must not be the zero address +contract ScrollSequencerUptimeFeed is BaseSequencerUptimeFeed { error ZeroAddress(); - event L1SenderTransferred(address indexed from, address indexed to); - /// @dev Emitted when an `updateStatus` call is ignored due to unchanged status or stale timestamp - event UpdateIgnored(bool latestStatus, uint64 latestTimestamp, bool incomingStatus, uint64 incomingTimestamp); - /// @dev Emitted when a updateStatus is called without the status changing - event RoundUpdated(int256 status, uint64 updatedAt); - - // solhint-disable-next-line chainlink-solidity/all-caps-constant-storage-variables - uint8 public constant override decimals = 0; - // solhint-disable-next-line chainlink-solidity/all-caps-constant-storage-variables - string public constant override description = "L2 Sequencer Uptime Status Feed"; - // solhint-disable-next-line chainlink-solidity/all-caps-constant-storage-variables - uint256 public constant override version = 1; - - /// @dev L1 address - address private s_l1Sender; - /// @dev s_latestRoundId == 0 means this contract is uninitialized. - FeedState private s_feedState = FeedState({latestRoundId: 0, latestStatus: false, startedAt: 0, updatedAt: 0}); - mapping(uint80 roundId => Round round) private s_rounds; + string public constant override typeAndVersion = "ScrollSequencerUptimeFeed 1.1.0-dev"; // solhint-disable-next-line chainlink-solidity/prefix-immutable-variables-with-i IL2ScrollMessenger private immutable s_l2CrossDomainMessenger; @@ -68,169 +18,23 @@ contract ScrollSequencerUptimeFeed is /// @param l1SenderAddress Address of the L1 contract that is permissioned to call this contract /// @param l2CrossDomainMessengerAddr Address of the L2CrossDomainMessenger contract /// @param initialStatus The initial status of the feed - constructor(address l1SenderAddress, address l2CrossDomainMessengerAddr, bool initialStatus) { + constructor( + address l1SenderAddress, + address l2CrossDomainMessengerAddr, + bool initialStatus + ) BaseSequencerUptimeFeed(l1SenderAddress, initialStatus) { if (l2CrossDomainMessengerAddr == address(0)) { revert ZeroAddress(); } - _setL1Sender(l1SenderAddress); s_l2CrossDomainMessenger = IL2ScrollMessenger(l2CrossDomainMessengerAddr); - - // Initialise roundId == 1 as the first round - _recordRound(1, initialStatus, uint64(block.timestamp)); - } - - /// @notice Check if a roundId is valid in this current contract state - /// @dev Mainly used for AggregatorV2V3Interface functions - /// @param roundId Round ID to check - function _isValidRound(uint256 roundId) private view returns (bool) { - return roundId > 0 && roundId <= type(uint80).max && s_feedState.latestRoundId >= roundId; - } - - /// @return L1 sender address - function l1Sender() public view virtual returns (address) { - return s_l1Sender; } - /// @notice Set the allowed L1 sender for this contract to a new L1 sender - /// @dev Can be disabled by setting the L1 sender as `address(0)`. Accessible only by owner. - /// @param to new L1 sender that will be allowed to call `updateStatus` on this contract - function transferL1Sender(address to) external virtual onlyOwner { - _setL1Sender(to); - } - - /// @notice internal method that stores the L1 sender - function _setL1Sender(address to) private { - address from = s_l1Sender; - if (from != to) { - s_l1Sender = to; - emit L1SenderTransferred(from, to); - } - } - - /// @dev Returns an AggregatorV2V3Interface compatible answer from status flag - /// @param status The status flag to convert to an aggregator-compatible answer - function _getStatusAnswer(bool status) private pure returns (int256) { - return status ? int256(1) : int256(0); - } - - /// @notice Helper function to record a round and set the latest feed state. - /// @param roundId The round ID to record - /// @param status Sequencer status - /// @param timestamp The L1 block timestamp of status update - function _recordRound(uint80 roundId, bool status, uint64 timestamp) private { - s_feedState = FeedState(roundId, status, timestamp, uint64(block.timestamp)); - s_rounds[roundId] = Round(status, timestamp, uint64(block.timestamp)); - - emit NewRound(roundId, msg.sender, timestamp); - emit AnswerUpdated(_getStatusAnswer(status), roundId, timestamp); - } - - /// @notice Helper function to update when a round was last updated - /// @param roundId The round ID to update - /// @param status Sequencer status - function _updateRound(uint80 roundId, bool status) private { - s_feedState.updatedAt = uint64(block.timestamp); - s_rounds[roundId].updatedAt = uint64(block.timestamp); - emit RoundUpdated(_getStatusAnswer(status), uint64(block.timestamp)); - } - - /// @notice Record a new status and timestamp if it has changed since the last round. - /// @dev This function will revert if not called from `l1Sender` via the L1->L2 messenger. - /// - /// @param status Sequencer status - /// @param timestamp Block timestamp of status update - function updateStatus(bool status, uint64 timestamp) external override { - FeedState memory feedState = s_feedState; - + function _validateSender(address l1Sender) internal view override { if ( - msg.sender != address(s_l2CrossDomainMessenger) || s_l2CrossDomainMessenger.xDomainMessageSender() != s_l1Sender + msg.sender != address(s_l2CrossDomainMessenger) || s_l2CrossDomainMessenger.xDomainMessageSender() != l1Sender ) { revert InvalidSender(); } - - // Ignore if latest recorded timestamp is newer - if (feedState.startedAt > timestamp) { - emit UpdateIgnored(feedState.latestStatus, feedState.startedAt, status, timestamp); - return; - } - - if (feedState.latestStatus == status) { - _updateRound(feedState.latestRoundId, status); - } else { - feedState.latestRoundId += 1; - _recordRound(feedState.latestRoundId, status, timestamp); - } - } - - /// @inheritdoc AggregatorInterface - function latestAnswer() external view override checkAccess returns (int256) { - return _getStatusAnswer(s_feedState.latestStatus); - } - - /// @inheritdoc AggregatorInterface - function latestTimestamp() external view override checkAccess returns (uint256) { - return s_feedState.startedAt; - } - - /// @inheritdoc AggregatorInterface - function latestRound() external view override checkAccess returns (uint256) { - return s_feedState.latestRoundId; - } - - /// @inheritdoc AggregatorInterface - function getAnswer(uint256 roundId) external view override checkAccess returns (int256) { - if (!_isValidRound(roundId)) { - revert NoDataPresent(); - } - - return _getStatusAnswer(s_rounds[uint80(roundId)].status); - } - - /// @inheritdoc AggregatorInterface - function getTimestamp(uint256 roundId) external view override checkAccess returns (uint256) { - if (!_isValidRound(roundId)) { - revert NoDataPresent(); - } - - return s_rounds[uint80(roundId)].startedAt; - } - - /// @inheritdoc AggregatorV3Interface - function getRoundData( - uint80 _roundId - ) - public - view - override - checkAccess - returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound) - { - if (!_isValidRound(_roundId)) { - revert NoDataPresent(); - } - - Round memory round = s_rounds[_roundId]; - - return (_roundId, _getStatusAnswer(round.status), uint256(round.startedAt), uint256(round.updatedAt), _roundId); - } - - /// @inheritdoc AggregatorV3Interface - function latestRoundData() - external - view - override - checkAccess - returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound) - { - FeedState memory feedState = s_feedState; - - return ( - feedState.latestRoundId, - _getStatusAnswer(feedState.latestStatus), - feedState.startedAt, - feedState.updatedAt, - feedState.latestRoundId - ); } } diff --git a/contracts/src/v0.8/l2ep/dev/scroll/ScrollValidator.sol b/contracts/src/v0.8/l2ep/dev/scroll/ScrollValidator.sol index 9df4a12ac6e..b009c80fdfd 100644 --- a/contracts/src/v0.8/l2ep/dev/scroll/ScrollValidator.sol +++ b/contracts/src/v0.8/l2ep/dev/scroll/ScrollValidator.sol @@ -1,71 +1,31 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.19; +pragma solidity 0.8.24; -import {AggregatorValidatorInterface} from "../../../shared/interfaces/AggregatorValidatorInterface.sol"; -import {TypeAndVersionInterface} from "../../../interfaces/TypeAndVersionInterface.sol"; -import {ScrollSequencerUptimeFeedInterface} from "../interfaces/ScrollSequencerUptimeFeedInterface.sol"; +import {ISequencerUptimeFeed} from "../interfaces/ISequencerUptimeFeed.sol"; -import {SimpleWriteAccessController} from "../../../shared/access/SimpleWriteAccessController.sol"; +import {BaseValidator} from "../shared/BaseValidator.sol"; import {IL1MessageQueue} from "@scroll-tech/contracts/L1/rollup/IL1MessageQueue.sol"; import {IL1ScrollMessenger} from "@scroll-tech/contracts/L1/IL1ScrollMessenger.sol"; /// @title ScrollValidator - makes cross chain call to update the Sequencer Uptime Feed on L2 -contract ScrollValidator is TypeAndVersionInterface, AggregatorValidatorInterface, SimpleWriteAccessController { - // solhint-disable-next-line chainlink-solidity/prefix-immutable-variables-with-i - address public immutable L1_CROSS_DOMAIN_MESSENGER_ADDRESS; - // solhint-disable-next-line chainlink-solidity/prefix-immutable-variables-with-i - address public immutable L2_UPTIME_FEED_ADDR; +contract ScrollValidator is BaseValidator { + string public constant override typeAndVersion = "ScrollValidator 1.1.0-dev"; + // solhint-disable-next-line chainlink-solidity/prefix-immutable-variables-with-i address public immutable L1_MSG_QUEUE_ADDR; - string public constant override typeAndVersion = "ScrollValidator 1.0.0"; - int256 private constant ANSWER_SEQ_OFFLINE = 1; - uint32 private s_gasLimit; - - /// @notice emitted when gas cost to spend on L2 is updated - /// @param gasLimit updated gas cost - event GasLimitUpdated(uint32 gasLimit); - - /// @param l1CrossDomainMessengerAddress address the L1CrossDomainMessenger contract address - /// @param l2UptimeFeedAddr the address of the ScrollSequencerUptimeFeed contract address - /// @param gasLimit the gasLimit to use for sending a message from L1 to L2 constructor( address l1CrossDomainMessengerAddress, address l2UptimeFeedAddr, address l1MessageQueueAddr, uint32 gasLimit - ) { - // solhint-disable-next-line gas-custom-errors - require(l1CrossDomainMessengerAddress != address(0), "Invalid xDomain Messenger address"); + ) BaseValidator(l1CrossDomainMessengerAddress, l2UptimeFeedAddr, gasLimit) { // solhint-disable-next-line gas-custom-errors require(l1MessageQueueAddr != address(0), "Invalid L1 message queue address"); - // solhint-disable-next-line gas-custom-errors - require(l2UptimeFeedAddr != address(0), "Invalid ScrollSequencerUptimeFeed contract address"); - L1_CROSS_DOMAIN_MESSENGER_ADDRESS = l1CrossDomainMessengerAddress; - L2_UPTIME_FEED_ADDR = l2UptimeFeedAddr; L1_MSG_QUEUE_ADDR = l1MessageQueueAddr; - s_gasLimit = gasLimit; - } - - /// @notice sets the new gas cost to spend when sending cross chain message - /// @param gasLimit the updated gas cost - function setGasLimit(uint32 gasLimit) external onlyOwner { - s_gasLimit = gasLimit; - emit GasLimitUpdated(gasLimit); } - /// @notice fetches the gas cost of sending a cross chain message - function getGasLimit() external view returns (uint32) { - return s_gasLimit; - } - - /// @notice makes this contract payable - /// @dev receives funds: - /// - to use them (if configured) to pay for L2 execution on L1 - /// - when withdrawing funds from L2 xDomain alias address (pay for L2 execution on L2) - receive() external payable {} - /// @notice validate method sends an xDomain L2 tx to update Uptime Feed contract on L2. /// @dev A message is sent using the L1CrossDomainMessenger. This method is accessed controlled. /// @param currentAnswer new aggregator answer - value of 1 considers the sequencer offline. @@ -82,7 +42,7 @@ contract ScrollValidator is TypeAndVersionInterface, AggregatorValidatorInterfac L2_UPTIME_FEED_ADDR, 0, abi.encodeWithSelector( - ScrollSequencerUptimeFeedInterface.updateStatus.selector, + ISequencerUptimeFeed.updateStatus.selector, currentAnswer == ANSWER_SEQ_OFFLINE, uint64(block.timestamp) ), diff --git a/contracts/src/v0.8/l2ep/dev/shared/BaseSequencerUptimeFeed.sol b/contracts/src/v0.8/l2ep/dev/shared/BaseSequencerUptimeFeed.sol new file mode 100644 index 00000000000..15c20504569 --- /dev/null +++ b/contracts/src/v0.8/l2ep/dev/shared/BaseSequencerUptimeFeed.sol @@ -0,0 +1,231 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.19; + +import {ITypeAndVersion} from "../../../shared/interfaces/ITypeAndVersion.sol"; +import {AggregatorInterface} from "../../../shared/interfaces/AggregatorInterface.sol"; +import {AggregatorV3Interface} from "../../../shared/interfaces/AggregatorV3Interface.sol"; +import {AggregatorV2V3Interface} from "../../../shared/interfaces/AggregatorV2V3Interface.sol"; +import {ISequencerUptimeFeed} from "./../interfaces/ISequencerUptimeFeed.sol"; + +import {SimpleReadAccessController} from "../../../shared/access/SimpleReadAccessController.sol"; + +/// @title L2 sequencer uptime status aggregator +/// @notice L2 contract that receives status updates from a specific L1 address, +/// records a new answer if the status changed +abstract contract BaseSequencerUptimeFeed is + ITypeAndVersion, + AggregatorV2V3Interface, + ISequencerUptimeFeed, + SimpleReadAccessController +{ + /// @dev Round info for uptime history + struct Round { + uint64 startedAt; // ─╮ The timestamp at which the round started + uint64 updatedAt; // │ The timestamp at which the round was updated + bool status; // ──────╯ The sequencer status for the round + } + + struct FeedState { + uint80 latestRoundId; // ─╮ The ID of the latest round + uint64 startedAt; // │ The date at which the latest round started + uint64 updatedAt; // │ The date at which the latest round was updated + bool latestStatus; // ────╯ The status of the latest round + } + + /// @notice Sender is not the L2 messenger + error InvalidSender(); + /// @notice Replacement for AggregatorV3Interface "No data present" + error NoDataPresent(); + + event L1SenderTransferred(address indexed from, address indexed to); + /// @dev Emitted when an `updateStatus` call is ignored due to unchanged status or stale timestamp + event UpdateIgnored(bool latestStatus, uint64 latestTimestamp, bool incomingStatus, uint64 incomingTimestamp); + /// @dev Emitted when a updateStatus is called without the status changing + event RoundUpdated(int256 status, uint64 updatedAt); + + // solhint-disable-next-line chainlink-solidity/all-caps-constant-storage-variables + uint8 public constant override decimals = 0; + // solhint-disable-next-line chainlink-solidity/all-caps-constant-storage-variables + string public constant override description = "L2 Sequencer Uptime Status Feed"; + // solhint-disable-next-line chainlink-solidity/all-caps-constant-storage-variables + uint256 public constant override version = 1; + + /// @dev L1 address + address private s_l1Sender; + /// @dev s_latestRoundId == 0 means this contract is uninitialized. + FeedState private s_feedState = FeedState({latestRoundId: 0, latestStatus: false, startedAt: 0, updatedAt: 0}); + mapping(uint80 roundId => Round round) private s_rounds; + + /// @param l1SenderAddress Address of the L1 contract that is permissioned to call this contract + /// @param initialStatus The initial status of the feed + constructor(address l1SenderAddress, bool initialStatus) { + // We neet to allow l1SenderAddress to be zero because this contract is deployed first + // After deploying the validator contract, this contract will be updated with the correct L1 sender address + _setL1Sender(l1SenderAddress); + + // Initialise roundId == 1 as the first round + _recordRound(1, initialStatus, uint64(block.timestamp)); + } + + /// @notice Check if a roundId is valid in this current contract state + /// @dev Mainly used for AggregatorV2V3Interface functions + /// @param roundId Round ID to check + function _isValidRound(uint256 roundId) private view returns (bool) { + return roundId > 0 && roundId <= type(uint80).max && s_feedState.latestRoundId >= roundId; + } + + /// @return L1 sender address + function l1Sender() public view virtual returns (address) { + return s_l1Sender; + } + + /// @notice Set the allowed L1 sender for this contract to a new L1 sender + /// @dev Can be disabled by setting the L1 sender as `address(0)`. Accessible only by owner. + /// @param to new L1 sender that will be allowed to call `updateStatus` on this contract + function transferL1Sender(address to) external virtual onlyOwner { + _setL1Sender(to); + } + + /// @notice internal method that stores the L1 sender + function _setL1Sender(address newSender) internal { + address oldSender = s_l1Sender; + if (oldSender != newSender) { + s_l1Sender = newSender; + emit L1SenderTransferred(oldSender, newSender); + } + } + + /// @dev Returns an AggregatorV2V3Interface compatible answer from status flag + /// @param status The status flag to convert to an aggregator-compatible answer + function _getStatusAnswer(bool status) internal pure returns (int256) { + return status ? int256(1) : int256(0); + } + + /// @notice Helper function to record a round and set the latest feed state. + /// @param roundId The round ID to record + /// @param status Sequencer status + /// @param timestamp The L1 block timestamp of status update + function _recordRound(uint80 roundId, bool status, uint64 timestamp) internal { + s_rounds[roundId] = Round({status: status, startedAt: timestamp, updatedAt: uint64(block.timestamp)}); + s_feedState = FeedState({ + latestRoundId: roundId, + latestStatus: status, + startedAt: timestamp, + updatedAt: uint64(block.timestamp) + }); + + emit NewRound(roundId, msg.sender, timestamp); + emit AnswerUpdated(_getStatusAnswer(status), roundId, timestamp); + } + + /// @notice Helper function to update when a round was last updated + /// @param roundId The round ID to update + /// @param status Sequencer status + function _updateRound(uint80 roundId, bool status) internal { + s_rounds[roundId].updatedAt = uint64(block.timestamp); + s_feedState.updatedAt = uint64(block.timestamp); + emit RoundUpdated(_getStatusAnswer(status), uint64(block.timestamp)); + } + + function _getFeedState() internal view returns (FeedState memory) { + return s_feedState; + } + + /// @inheritdoc AggregatorInterface + function latestAnswer() external view override checkAccess returns (int256) { + return _getStatusAnswer(s_feedState.latestStatus); + } + + /// @inheritdoc AggregatorInterface + function latestTimestamp() external view override checkAccess returns (uint256) { + return s_feedState.startedAt; + } + + /// @inheritdoc AggregatorInterface + function latestRound() external view override checkAccess returns (uint256) { + return s_feedState.latestRoundId; + } + + /// @inheritdoc AggregatorInterface + function getAnswer(uint256 roundId) external view override checkAccess returns (int256) { + if (!_isValidRound(roundId)) { + revert NoDataPresent(); + } + + return _getStatusAnswer(s_rounds[uint80(roundId)].status); + } + + /// @inheritdoc AggregatorInterface + function getTimestamp(uint256 roundId) external view override checkAccess returns (uint256) { + if (!_isValidRound(roundId)) { + revert NoDataPresent(); + } + + return s_rounds[uint80(roundId)].startedAt; + } + + /** + * @notice Record a new status and timestamp if it has changed since the last round. + * @dev This function will revert if not called from `l1Sender` via the L1->L2 messenger. + * + * @param status Sequencer status + * @param timestamp Block timestamp of status update + */ + function updateStatus(bool status, uint64 timestamp) external override { + _validateSender(s_l1Sender); + + FeedState memory feedState = _getFeedState(); + // Ignore if latest recorded timestamp is newer + if (feedState.startedAt > timestamp) { + emit UpdateIgnored(feedState.latestStatus, feedState.startedAt, status, timestamp); + return; + } + + if (feedState.latestStatus == status) { + _updateRound(feedState.latestRoundId, status); + } else { + feedState.latestRoundId += 1; + _recordRound(feedState.latestRoundId, status, timestamp); + } + } + + function _validateSender(address l1Sender) internal virtual; + + /// @inheritdoc AggregatorV3Interface + function getRoundData( + uint80 _roundId + ) + public + view + override + checkAccess + returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound) + { + if (!_isValidRound(_roundId)) { + revert NoDataPresent(); + } + + Round storage round = s_rounds[_roundId]; + + return (_roundId, _getStatusAnswer(round.status), uint256(round.startedAt), uint256(round.updatedAt), _roundId); + } + + /// @inheritdoc AggregatorV3Interface + function latestRoundData() + external + view + override + checkAccess + returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound) + { + FeedState storage feedState = s_feedState; + + return ( + feedState.latestRoundId, + _getStatusAnswer(feedState.latestStatus), + feedState.startedAt, + feedState.updatedAt, + feedState.latestRoundId + ); + } +} diff --git a/contracts/src/v0.8/l2ep/dev/shared/BaseValidator.sol b/contracts/src/v0.8/l2ep/dev/shared/BaseValidator.sol new file mode 100644 index 00000000000..33df388972f --- /dev/null +++ b/contracts/src/v0.8/l2ep/dev/shared/BaseValidator.sol @@ -0,0 +1,59 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.19; + +import {AggregatorValidatorInterface} from "../../../shared/interfaces/AggregatorValidatorInterface.sol"; +import {ITypeAndVersion} from "../../../shared/interfaces/ITypeAndVersion.sol"; + +import {SimpleWriteAccessController} from "../../../shared/access/SimpleWriteAccessController.sol"; + +abstract contract BaseValidator is SimpleWriteAccessController, AggregatorValidatorInterface, ITypeAndVersion { + /// @notice emitted when gas cost to spend on L2 is updated + /// @param gasLimit updated gas cost + event GasLimitUpdated(uint32 gasLimit); + + error L1CrossDomainMessengerAddressZero(); + error L2UptimeFeedAddrZero(); + + // solhint-disable-next-line chainlink-solidity/prefix-immutable-variables-with-i + address public immutable L1_CROSS_DOMAIN_MESSENGER_ADDRESS; + // solhint-disable-next-line chainlink-solidity/prefix-immutable-variables-with-i + address public immutable L2_UPTIME_FEED_ADDR; + + int256 internal constant ANSWER_SEQ_OFFLINE = 1; + + uint32 internal s_gasLimit; + + /// @param l1CrossDomainMessengerAddress address the L1CrossDomainMessenger contract address + /// @param l2UptimeFeedAddr the address of the SequencerUptimeFeed contract address + /// @param gasLimit the gasLimit to use for sending a message from L1 to L2 + constructor(address l1CrossDomainMessengerAddress, address l2UptimeFeedAddr, uint32 gasLimit) { + if (l1CrossDomainMessengerAddress == address(0)) { + revert L1CrossDomainMessengerAddressZero(); + } + if (l2UptimeFeedAddr == address(0)) { + revert L2UptimeFeedAddrZero(); + } + + L1_CROSS_DOMAIN_MESSENGER_ADDRESS = l1CrossDomainMessengerAddress; + L2_UPTIME_FEED_ADDR = l2UptimeFeedAddr; + s_gasLimit = gasLimit; + } + + /// @notice fetches the gas cost of sending a cross chain message + function getGasLimit() external view returns (uint32) { + return s_gasLimit; + } + + /// @notice sets the new gas cost to spend when sending cross chain message + /// @param gasLimit the updated gas cost + function setGasLimit(uint32 gasLimit) external onlyOwner { + s_gasLimit = gasLimit; + emit GasLimitUpdated(gasLimit); + } + + /// @notice makes this contract payable + /// @dev receives funds: + /// - to use them (if configured) to pay for L2 execution on L1 + /// - when withdrawing funds from L2 xDomain alias address (pay for L2 execution on L2) + receive() external payable {} +} diff --git a/contracts/src/v0.8/l2ep/dev/zksync/ZKSyncSequencerUptimeFeed.sol b/contracts/src/v0.8/l2ep/dev/zksync/ZKSyncSequencerUptimeFeed.sol new file mode 100644 index 00000000000..0074a0277d1 --- /dev/null +++ b/contracts/src/v0.8/l2ep/dev/zksync/ZKSyncSequencerUptimeFeed.sol @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.19; + +import {BaseSequencerUptimeFeed} from "../shared/BaseSequencerUptimeFeed.sol"; + +import {AddressAliasHelper} from "../../../vendor/arb-bridge-eth/v0.8.0-custom/contracts/libraries/AddressAliasHelper.sol"; + +/// @title ZKSyncSequencerUptimeFeed - L2 sequencer uptime status aggregator +/// @notice L2 contract that receives status updates from a specific L1 address, +/// records a new answer if the status changed +contract ZKSyncSequencerUptimeFeed is BaseSequencerUptimeFeed { + string public constant override typeAndVersion = "ZKSyncSequencerUptimeFeed 1.1.0-dev"; + + /// @param l1SenderAddress Address of the L1 contract that is permissioned to call this contract + /// @param initialStatus The initial status of the feed + constructor(address l1SenderAddress, bool initialStatus) BaseSequencerUptimeFeed(l1SenderAddress, initialStatus) {} + + function _validateSender(address l1Sender) internal view override { + address aliasedL1Sender = AddressAliasHelper.applyL1ToL2Alias(l1Sender); + + if (msg.sender != aliasedL1Sender) { + revert InvalidSender(); + } + } +} diff --git a/contracts/src/v0.8/l2ep/dev/zksync/ZKSyncValidator.sol b/contracts/src/v0.8/l2ep/dev/zksync/ZKSyncValidator.sol new file mode 100644 index 00000000000..10f68ce286d --- /dev/null +++ b/contracts/src/v0.8/l2ep/dev/zksync/ZKSyncValidator.sol @@ -0,0 +1,104 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.19; + +import {ISequencerUptimeFeed} from "./../interfaces/ISequencerUptimeFeed.sol"; + +import {BaseValidator} from "../shared/BaseValidator.sol"; + +import {IBridgehub, L2TransactionRequestDirect} from "@zksync/contracts/l1-contracts/contracts/bridgehub/IBridgehub.sol"; + +/// @title ZKSyncValidator - makes cross chain call to update the Sequencer Uptime Feed on L2 +contract ZKSyncValidator is BaseValidator { + /// Contract state variables + string public constant override typeAndVersion = "ZKSyncValidator 1.1.0-dev"; + uint32 private constant ZKSYNC_TEST_NET_CHAIN_ID = 300; + uint32 private constant ZKSYNC_MAIN_NET_CHAIN_ID = 324; + // solhint-disable-next-line chainlink-solidity/prefix-immutable-variables-with-i + uint32 private immutable CHAIN_ID; + /// @dev how much l2 gas each byte of pubdata costs + uint32 private s_l2GasPerPubdataByteLimit; + + /// @notice emitted when the gas per pubdata byte limit is updated + /// @param l2GasPerPubdataByteLimit updated gas per pubdata byte limit + event GasPerPubdataByteLimitUpdated(uint32 l2GasPerPubdataByteLimit); + + /// @notice ChainID is not a valid value + error InvalidChainID(); + + /// @param l1CrossDomainMessengerAddress address the Bridgehub contract address + /// @param l2UptimeFeedAddr the address of the SequencerUptimeFeedInterface contract address + /// @param gasLimit the gasLimit to use for sending a message from L1 to L2 + constructor( + address l1CrossDomainMessengerAddress, + address l2UptimeFeedAddr, + uint32 gasLimit, + uint32 chainId, + uint32 l2GasPerPubdataByteLimit + ) BaseValidator(l1CrossDomainMessengerAddress, l2UptimeFeedAddr, gasLimit) { + if (chainId != ZKSYNC_TEST_NET_CHAIN_ID && chainId != ZKSYNC_MAIN_NET_CHAIN_ID) { + revert InvalidChainID(); + } + + s_l2GasPerPubdataByteLimit = l2GasPerPubdataByteLimit; + CHAIN_ID = chainId; + } + + /// @notice sets the l2GasPerPubdataByteLimit for the L2 transaction request + /// @param l2GasPerPubdataByteLimit the updated l2GasPerPubdataByteLimit + function setL2GasPerPubdataByteLimit(uint32 l2GasPerPubdataByteLimit) external onlyOwner { + if (s_l2GasPerPubdataByteLimit != l2GasPerPubdataByteLimit) { + s_l2GasPerPubdataByteLimit = l2GasPerPubdataByteLimit; + emit GasPerPubdataByteLimitUpdated(l2GasPerPubdataByteLimit); + } + } + + /// @notice fetches the l2GasPerPubdataByteLimit for the L2 transaction request + function getL2GasPerPubdataByteLimit() external view returns (uint32) { + return s_l2GasPerPubdataByteLimit; + } + + /// @notice fetches the chain id + function getChainId() external view returns (uint32) { + return CHAIN_ID; + } + + /// @notice validate method sends an xDomain L2 tx to update Uptime Feed contract on L2. + /// @dev A message is sent using the Bridgehub. This method is accessed controlled. + /// @param currentAnswer new aggregator answer - value of 1 considers the sequencer offline. + function validate( + uint256 /* previousRoundId */, + int256 /* previousAnswer */, + uint256 /* currentRoundId */, + int256 currentAnswer + ) external override checkAccess returns (bool) { + IBridgehub bridgeHub = IBridgehub(L1_CROSS_DOMAIN_MESSENGER_ADDRESS); + + uint256 transactionBaseCostEstimate = bridgeHub.l2TransactionBaseCost( + CHAIN_ID, + tx.gasprice, + s_gasLimit, + s_l2GasPerPubdataByteLimit + ); + + L2TransactionRequestDirect memory l2TransactionRequestDirect = L2TransactionRequestDirect({ + chainId: CHAIN_ID, + mintValue: transactionBaseCostEstimate, + l2Contract: L2_UPTIME_FEED_ADDR, + l2Value: 0, + l2Calldata: abi.encodeWithSelector( + ISequencerUptimeFeed.updateStatus.selector, + currentAnswer == ANSWER_SEQ_OFFLINE, + uint64(block.timestamp) + ), + l2GasLimit: s_gasLimit, + l2GasPerPubdataByteLimit: s_l2GasPerPubdataByteLimit, + factoryDeps: new bytes[](0), + refundRecipient: msg.sender + }); + + // Make the xDomain call + bridgeHub.requestL2TransactionDirect{value: transactionBaseCostEstimate}(l2TransactionRequestDirect); + + return true; + } +} diff --git a/contracts/src/v0.8/l2ep/test/mocks/MockAggregatorV2V3.sol b/contracts/src/v0.8/l2ep/test/mocks/MockAggregatorV2V3.sol index c4e2f710300..52019324f59 100644 --- a/contracts/src/v0.8/l2ep/test/mocks/MockAggregatorV2V3.sol +++ b/contracts/src/v0.8/l2ep/test/mocks/MockAggregatorV2V3.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.9; +pragma solidity ^0.8.24; import {AggregatorV2V3Interface} from "../../../shared/interfaces/AggregatorV2V3Interface.sol"; diff --git a/contracts/src/v0.8/l2ep/test/mocks/scroll/MockScrollL1CrossDomainMessenger.sol b/contracts/src/v0.8/l2ep/test/mocks/scroll/MockScrollL1CrossDomainMessenger.sol index e63847d6557..42147fbd91e 100644 --- a/contracts/src/v0.8/l2ep/test/mocks/scroll/MockScrollL1CrossDomainMessenger.sol +++ b/contracts/src/v0.8/l2ep/test/mocks/scroll/MockScrollL1CrossDomainMessenger.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.9; +pragma solidity ^0.8.24; import {IL1ScrollMessenger} from "@scroll-tech/contracts/L1/IL1ScrollMessenger.sol"; diff --git a/contracts/src/v0.8/l2ep/test/mocks/scroll/MockScrollL1MessageQueue.sol b/contracts/src/v0.8/l2ep/test/mocks/scroll/MockScrollL1MessageQueue.sol index 1700bcbe168..e43f1bf1366 100644 --- a/contracts/src/v0.8/l2ep/test/mocks/scroll/MockScrollL1MessageQueue.sol +++ b/contracts/src/v0.8/l2ep/test/mocks/scroll/MockScrollL1MessageQueue.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.19; +pragma solidity 0.8.24; import {IL1MessageQueue} from "@scroll-tech/contracts/L1/rollup/IL1MessageQueue.sol"; diff --git a/contracts/src/v0.8/l2ep/test/mocks/scroll/MockScrollL2CrossDomainMessenger.sol b/contracts/src/v0.8/l2ep/test/mocks/scroll/MockScrollL2CrossDomainMessenger.sol index 66400b7d305..af0e0b5ca59 100644 --- a/contracts/src/v0.8/l2ep/test/mocks/scroll/MockScrollL2CrossDomainMessenger.sol +++ b/contracts/src/v0.8/l2ep/test/mocks/scroll/MockScrollL2CrossDomainMessenger.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.9; +pragma solidity ^0.8.24; import {IL2ScrollMessenger} from "@scroll-tech/contracts/L2/IL2ScrollMessenger.sol"; diff --git a/contracts/src/v0.8/l2ep/test/mocks/zksync/MockZKSyncL1Bridge.sol b/contracts/src/v0.8/l2ep/test/mocks/zksync/MockZKSyncL1Bridge.sol new file mode 100644 index 00000000000..b46b9d9fdf0 --- /dev/null +++ b/contracts/src/v0.8/l2ep/test/mocks/zksync/MockZKSyncL1Bridge.sol @@ -0,0 +1,147 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.24; + +import {IBridgehub, L2TransactionRequestDirect, L2TransactionRequestTwoBridgesOuter} from "@zksync/contracts/l1-contracts/contracts/bridgehub/IBridgehub.sol"; +import {IL1SharedBridge} from "@zksync/contracts/l1-contracts/contracts/bridge/interfaces/IL1SharedBridge.sol"; +import {L2Message, L2Log, TxStatus} from "@zksync/contracts/l1-contracts/contracts/common/Messaging.sol"; + +contract MockBridgehub is IBridgehub { + address public pendingAdmin; + address public admin; + address public sharedBridgeAddr; + + mapping(address stateTransitionManager => bool stateTransitionManagerIsRegistered) + public registeredStateTransitionManagers; + mapping(uint256 chainId => address stateTransitionManagerAddress) public stateTransitionManagers; + mapping(address baseToken => bool tokenIsRegistered) public registeredTokens; + mapping(uint256 chainId => address baseToken) public baseTokens; + mapping(uint256 chainId => address hyperChain) public hyperchains; + + /// Generic error for unauthorized actions + error NotAuthorized(string msg); + + /// Fake event that will get emitted when `requestL2TransactionDirect` is called + event SentMessage(address indexed sender, bytes message); + + /// Admin functions + function setPendingAdmin(address _newPendingAdmin) external override { + emit NewPendingAdmin(pendingAdmin, _newPendingAdmin); + pendingAdmin = _newPendingAdmin; + } + + function acceptAdmin() external override { + if (msg.sender != pendingAdmin) { + revert NotAuthorized("Only pending admin can accept"); + } + + emit NewAdmin(admin, pendingAdmin); + admin = pendingAdmin; + pendingAdmin = address(0); + } + + /// Getters + function stateTransitionManagerIsRegistered(address _stateTransitionManager) external view override returns (bool) { + return registeredStateTransitionManagers[_stateTransitionManager]; + } + + function stateTransitionManager(uint256 _chainId) external view override returns (address) { + return stateTransitionManagers[_chainId]; + } + + function tokenIsRegistered(address _baseToken) external view override returns (bool) { + return registeredTokens[_baseToken]; + } + + function baseToken(uint256 _chainId) external view override returns (address) { + return baseTokens[_chainId]; + } + + function sharedBridge() external view override returns (IL1SharedBridge) { + return IL1SharedBridge(sharedBridgeAddr); + } + + function getHyperchain(uint256 _chainId) external view override returns (address) { + return hyperchains[_chainId]; + } + + /// Mailbox forwarder + function proveL2MessageInclusion( + uint256, + uint256, + uint256, + L2Message calldata, + bytes32[] calldata + ) external pure override returns (bool) { + return true; + } + + function proveL2LogInclusion( + uint256, + uint256, + uint256, + L2Log memory, + bytes32[] calldata + ) external pure override returns (bool) { + return true; + } + + function proveL1ToL2TransactionStatus( + uint256, + bytes32, + uint256, + uint256, + uint16, + bytes32[] calldata, + TxStatus + ) external pure override returns (bool) { + return true; + } + + function requestL2TransactionDirect( + L2TransactionRequestDirect calldata txRequest + ) external payable override returns (bytes32) { + emit SentMessage(msg.sender, txRequest.l2Calldata); + return keccak256(abi.encodePacked("L2TransactionDirect")); + } + + function requestL2TransactionTwoBridges( + L2TransactionRequestTwoBridgesOuter calldata + ) external payable override returns (bytes32) { + return keccak256(abi.encodePacked("L2TransactionTwoBridges")); + } + + function l2TransactionBaseCost(uint256, uint256, uint256, uint256) external pure override returns (uint256) { + return 0; + } + + /// Registry + function createNewChain( + uint256 _chainId, + address _stateTransitionManager, + address _baseToken, + uint256, + address, + bytes calldata + ) external override returns (uint256 chainId) { + hyperchains[_chainId] = _stateTransitionManager; + baseTokens[_chainId] = _baseToken; + emit NewChain(_chainId, _stateTransitionManager, address(this)); + return _chainId; + } + + function addStateTransitionManager(address _stateTransitionManager) external override { + registeredStateTransitionManagers[_stateTransitionManager] = true; + } + + function removeStateTransitionManager(address _stateTransitionManager) external override { + registeredStateTransitionManagers[_stateTransitionManager] = false; + } + + function addToken(address _token) external override { + registeredTokens[_token] = true; + } + + function setSharedBridge(address _sharedBridgeAddr) external override { + sharedBridgeAddr = _sharedBridgeAddr; + } +} diff --git a/contracts/src/v0.8/l2ep/test/v1_0_0/L2EPTest.t.sol b/contracts/src/v0.8/l2ep/test/v1_0_0/L2EPTest.t.sol index 561e32be1a2..93640f4bcb4 100644 --- a/contracts/src/v0.8/l2ep/test/v1_0_0/L2EPTest.t.sol +++ b/contracts/src/v0.8/l2ep/test/v1_0_0/L2EPTest.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.19; +pragma solidity ^0.8.24; import {Greeter} from "../../../tests/Greeter.sol"; @@ -13,21 +13,6 @@ contract L2EPTest is Test { address internal s_eoaValidator = vm.addr(0x3); address internal s_deployerAddr = vm.addr(0x4); - /// @param expectedGasUsage - the expected gas usage - /// @param startGasUsage - the gas usage before the code of interest is run - /// @param finalGasUsage - the gas usage after the code of interest is run - /// @param deviation - the amount of gas that the actual usage is allowed to deviate by (e.g. (expectedGas - deviation) <= actualGasUsage <= (expectedGas + deviation)) - function assertGasUsageIsCloseTo( - uint256 expectedGasUsage, - uint256 startGasUsage, - uint256 finalGasUsage, - uint256 deviation - ) public { - uint256 gasUsed = (startGasUsage - finalGasUsage) * tx.gasprice; - assertLe(gasUsed, expectedGasUsage + deviation); - assertGe(gasUsed, expectedGasUsage - deviation); - } - /// @param selector - the function selector /// @param greeterAddr - the address of the Greeter contract /// @param message - the new greeting message, which will be passed as an argument to Greeter#setGreeting diff --git a/contracts/src/v0.8/l2ep/test/v1_0_0/arbitrum/ArbitrumCrossDomainForwarder.t.sol b/contracts/src/v0.8/l2ep/test/v1_0_0/arbitrum/ArbitrumCrossDomainForwarder.t.sol index be3851c5b5d..cff9b953e2e 100644 --- a/contracts/src/v0.8/l2ep/test/v1_0_0/arbitrum/ArbitrumCrossDomainForwarder.t.sol +++ b/contracts/src/v0.8/l2ep/test/v1_0_0/arbitrum/ArbitrumCrossDomainForwarder.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.19; +pragma solidity 0.8.24; import {ArbitrumCrossDomainForwarder} from "../../../dev/arbitrum/ArbitrumCrossDomainForwarder.sol"; import {Greeter} from "../../../../tests/Greeter.sol"; diff --git a/contracts/src/v0.8/l2ep/test/v1_0_0/arbitrum/ArbitrumCrossDomainGovernor.t.sol b/contracts/src/v0.8/l2ep/test/v1_0_0/arbitrum/ArbitrumCrossDomainGovernor.t.sol index c5b8adaf7d2..610f49f16c4 100644 --- a/contracts/src/v0.8/l2ep/test/v1_0_0/arbitrum/ArbitrumCrossDomainGovernor.t.sol +++ b/contracts/src/v0.8/l2ep/test/v1_0_0/arbitrum/ArbitrumCrossDomainGovernor.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.19; +pragma solidity 0.8.24; import {ArbitrumCrossDomainGovernor} from "../../../dev/arbitrum/ArbitrumCrossDomainGovernor.sol"; import {Greeter} from "../../../../tests/Greeter.sol"; diff --git a/contracts/src/v0.8/l2ep/test/v1_0_0/arbitrum/ArbitrumSequencerUptimeFeed.t.sol b/contracts/src/v0.8/l2ep/test/v1_0_0/arbitrum/ArbitrumSequencerUptimeFeed.t.sol index 3b9df3bf910..e308ead3432 100644 --- a/contracts/src/v0.8/l2ep/test/v1_0_0/arbitrum/ArbitrumSequencerUptimeFeed.t.sol +++ b/contracts/src/v0.8/l2ep/test/v1_0_0/arbitrum/ArbitrumSequencerUptimeFeed.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.19; +pragma solidity 0.8.24; import {SimpleWriteAccessController} from "../../../../shared/access/SimpleWriteAccessController.sol"; import {ArbitrumSequencerUptimeFeed} from "../../../dev/arbitrum/ArbitrumSequencerUptimeFeed.sol"; @@ -246,199 +246,3 @@ contract ArbitrumSequencerUptimeFeed_ProtectReadsOnAggregatorV2V3InterfaceFuncti assertEq(answer, 0); } } - -contract ArbitrumSequencerUptimeFeed_GasCosts is ArbitrumSequencerUptimeFeedTest { - /// @notice it should consume a known amount of gas for updates - function test_GasCosts() public { - // Sets msg.sender and tx.origin to a valid address - vm.startPrank(s_l2MessengerAddr, s_l2MessengerAddr); - - // Assert initial conditions - uint256 timestamp = s_arbitrumSequencerUptimeFeed.latestTimestamp(); - assertEq(s_arbitrumSequencerUptimeFeed.latestAnswer(), 0); - - // Defines helper variables for measuring gas usage - uint256 expectedGasUsed; - uint256 gasStart; - uint256 gasFinal; - - // measures gas used for no update - expectedGasUsed = 5507; // NOTE: used to be 28300 in hardhat tests - gasStart = gasleft(); - s_arbitrumSequencerUptimeFeed.updateStatus(false, uint64(timestamp + 1000)); - gasFinal = gasleft(); - assertEq(s_arbitrumSequencerUptimeFeed.latestAnswer(), 0); - assertGasUsageIsCloseTo(expectedGasUsed, gasStart, gasFinal, GAS_USED_DEVIATION); - - // measures gas used for update - expectedGasUsed = 68198; // NOTE: used to be 93015 in hardhat tests - gasStart = gasleft(); - s_arbitrumSequencerUptimeFeed.updateStatus(true, uint64(timestamp + 1000)); - gasFinal = gasleft(); - assertEq(s_arbitrumSequencerUptimeFeed.latestAnswer(), 1); - assertGasUsageIsCloseTo(expectedGasUsed, gasStart, gasFinal, GAS_USED_DEVIATION); - } -} - -contract ArbitrumSequencerUptimeFeed_AggregatorInterfaceGasCosts is ArbitrumSequencerUptimeFeedTest { - /// @notice it should consume a known amount of gas for getRoundData(uint80) - function test_GasUsageForGetRoundData() public { - // Sets msg.sender and tx.origin to a valid address - vm.startPrank(s_l2MessengerAddr, s_l2MessengerAddr); - - // Defines helper variables for measuring gas usage - uint256 expectedGasUsed = 4658; // NOTE: used to be 31157 in hardhat tests - uint256 gasStart; - uint256 gasFinal; - - // Initializes a round - uint256 timestamp = s_arbitrumSequencerUptimeFeed.latestTimestamp() + 1000; - s_arbitrumSequencerUptimeFeed.updateStatus(true, uint64(timestamp)); - - // Measures gas usage - gasStart = gasleft(); - s_arbitrumSequencerUptimeFeed.getRoundData(1); - gasFinal = gasleft(); - - // Checks that gas usage is within expected range - assertGasUsageIsCloseTo(expectedGasUsed, gasStart, gasFinal, GAS_USED_DEVIATION); - } - - /// @notice it should consume a known amount of gas for latestRoundData() - function test_GasUsageForLatestRoundData() public { - // Sets msg.sender and tx.origin to a valid address - vm.startPrank(s_l2MessengerAddr, s_l2MessengerAddr); - - // Defines helper variables for measuring gas usage - uint256 expectedGasUsed = 2154; // NOTE: used to be 28523 in hardhat tests - uint256 gasStart; - uint256 gasFinal; - - // Initializes a round - uint256 timestamp = s_arbitrumSequencerUptimeFeed.latestTimestamp() + 1000; - s_arbitrumSequencerUptimeFeed.updateStatus(true, uint64(timestamp)); - - // Measures gas usage - gasStart = gasleft(); - s_arbitrumSequencerUptimeFeed.latestRoundData(); - gasFinal = gasleft(); - - // Checks that gas usage is within expected range - assertGasUsageIsCloseTo(expectedGasUsed, gasStart, gasFinal, GAS_USED_DEVIATION); - } - - /// @notice it should consume a known amount of gas for latestAnswer() - function test_GasUsageForLatestAnswer() public { - // Sets msg.sender and tx.origin to a valid address - vm.startPrank(s_l2MessengerAddr, s_l2MessengerAddr); - - // Defines helper variables for measuring gas usage - uint256 expectedGasUsed = 1722; // NOTE: used to be 28329 in hardhat tests - uint256 gasStart; - uint256 gasFinal; - - // Initializes a round - uint256 timestamp = s_arbitrumSequencerUptimeFeed.latestTimestamp() + 1000; - s_arbitrumSequencerUptimeFeed.updateStatus(true, uint64(timestamp)); - - // Measures gas usage - gasStart = gasleft(); - s_arbitrumSequencerUptimeFeed.latestAnswer(); - gasFinal = gasleft(); - - // Checks that gas usage is within expected range - assertGasUsageIsCloseTo(expectedGasUsed, gasStart, gasFinal, GAS_USED_DEVIATION); - } - - /// @notice it should consume a known amount of gas for latestTimestamp() - function test_GasUsageForLatestTimestamp() public { - // Sets msg.sender and tx.origin to a valid address - vm.startPrank(s_l2MessengerAddr, s_l2MessengerAddr); - - // Defines helper variables for measuring gas usage - uint256 expectedGasUsed = 1652; // NOTE: used to be 28229 in hardhat tests - uint256 gasStart; - uint256 gasFinal; - - // Initializes a round - uint256 timestamp = s_arbitrumSequencerUptimeFeed.latestTimestamp() + 1000; - s_arbitrumSequencerUptimeFeed.updateStatus(true, uint64(timestamp)); - - // Measures gas usage - gasStart = gasleft(); - s_arbitrumSequencerUptimeFeed.latestTimestamp(); - gasFinal = gasleft(); - - // Checks that gas usage is within expected range - assertGasUsageIsCloseTo(expectedGasUsed, gasStart, gasFinal, GAS_USED_DEVIATION); - } - - /// @notice it should consume a known amount of gas for latestRound() - function test_GasUsageForLatestRound() public { - // Sets msg.sender and tx.origin to a valid address - vm.startPrank(s_l2MessengerAddr, s_l2MessengerAddr); - - // Defines helper variables for measuring gas usage - uint256 expectedGasUsed = 1632; // NOTE: used to be 28245 in hardhat tests - uint256 gasStart; - uint256 gasFinal; - - // Initializes a round - uint256 timestamp = s_arbitrumSequencerUptimeFeed.latestTimestamp() + 1000; - s_arbitrumSequencerUptimeFeed.updateStatus(true, uint64(timestamp)); - - // Measures gas usage - gasStart = gasleft(); - s_arbitrumSequencerUptimeFeed.latestRound(); - gasFinal = gasleft(); - - // Checks that gas usage is within expected range - assertGasUsageIsCloseTo(expectedGasUsed, gasStart, gasFinal, GAS_USED_DEVIATION); - } - - /// @notice it should consume a known amount of gas for getAnswer() - function test_GasUsageForGetAnswer() public { - // Sets msg.sender and tx.origin to a valid address - vm.startPrank(s_l2MessengerAddr, s_l2MessengerAddr); - - // Defines helper variables for measuring gas usage - uint256 expectedGasUsed = 4059; // NOTE: used to be 30799 in hardhat tests - uint256 gasStart; - uint256 gasFinal; - - // Initializes a round - uint256 timestamp = s_arbitrumSequencerUptimeFeed.latestTimestamp() + 1000; - s_arbitrumSequencerUptimeFeed.updateStatus(true, uint64(timestamp)); - - // Measures gas usage - gasStart = gasleft(); - s_arbitrumSequencerUptimeFeed.getAnswer(1); - gasFinal = gasleft(); - - // Checks that gas usage is within expected range - assertGasUsageIsCloseTo(expectedGasUsed, gasStart, gasFinal, GAS_USED_DEVIATION); - } - - /// @notice it should consume a known amount of gas for getTimestamp() - function test_GasUsageForGetTimestamp() public { - // Sets msg.sender and tx.origin to a valid address - vm.startPrank(s_l2MessengerAddr, s_l2MessengerAddr); - - // Defines helper variables for measuring gas usage - uint256 expectedGasUsed = 4024; // NOTE: used to be 30753 in hardhat tests - uint256 gasStart; - uint256 gasFinal; - - // Initializes a round - uint256 timestamp = s_arbitrumSequencerUptimeFeed.latestTimestamp() + 1000; - s_arbitrumSequencerUptimeFeed.updateStatus(true, uint64(timestamp)); - - // Measures gas usage - gasStart = gasleft(); - s_arbitrumSequencerUptimeFeed.getTimestamp(1); - gasFinal = gasleft(); - - // Checks that gas usage is within expected range - assertGasUsageIsCloseTo(expectedGasUsed, gasStart, gasFinal, GAS_USED_DEVIATION); - } -} diff --git a/contracts/src/v0.8/l2ep/test/v1_0_0/arbitrum/ArbitrumValidator.t.sol b/contracts/src/v0.8/l2ep/test/v1_0_0/arbitrum/ArbitrumValidator.t.sol index 504635540ce..ab872991749 100644 --- a/contracts/src/v0.8/l2ep/test/v1_0_0/arbitrum/ArbitrumValidator.t.sol +++ b/contracts/src/v0.8/l2ep/test/v1_0_0/arbitrum/ArbitrumValidator.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.19; +pragma solidity 0.8.24; import {AccessControllerInterface} from "../../../../shared/interfaces/AccessControllerInterface.sol"; diff --git a/contracts/src/v0.8/l2ep/test/v1_0_0/optimism/OptimismCrossDomainForwarder.t.sol b/contracts/src/v0.8/l2ep/test/v1_0_0/optimism/OptimismCrossDomainForwarder.t.sol index d5c482dce98..c0e82ab8d5e 100644 --- a/contracts/src/v0.8/l2ep/test/v1_0_0/optimism/OptimismCrossDomainForwarder.t.sol +++ b/contracts/src/v0.8/l2ep/test/v1_0_0/optimism/OptimismCrossDomainForwarder.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.19; +pragma solidity 0.8.24; import {OptimismCrossDomainForwarder} from "../../../dev/optimism/OptimismCrossDomainForwarder.sol"; import {MockOVMCrossDomainMessenger} from "../../mocks/optimism/MockOVMCrossDomainMessenger.sol"; diff --git a/contracts/src/v0.8/l2ep/test/v1_0_0/optimism/OptimismCrossDomainGovernor.t.sol b/contracts/src/v0.8/l2ep/test/v1_0_0/optimism/OptimismCrossDomainGovernor.t.sol index e1a5aef95a1..8f8fb9d7e7c 100644 --- a/contracts/src/v0.8/l2ep/test/v1_0_0/optimism/OptimismCrossDomainGovernor.t.sol +++ b/contracts/src/v0.8/l2ep/test/v1_0_0/optimism/OptimismCrossDomainGovernor.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.19; +pragma solidity 0.8.24; import {OptimismCrossDomainGovernor} from "../../../dev/optimism/OptimismCrossDomainGovernor.sol"; import {MockOVMCrossDomainMessenger} from "../../mocks/optimism/MockOVMCrossDomainMessenger.sol"; diff --git a/contracts/src/v0.8/l2ep/test/v1_0_0/optimism/OptimismSequencerUptimeFeed.t.sol b/contracts/src/v0.8/l2ep/test/v1_0_0/optimism/OptimismSequencerUptimeFeed.t.sol index 60598b9f952..eec9657ac14 100644 --- a/contracts/src/v0.8/l2ep/test/v1_0_0/optimism/OptimismSequencerUptimeFeed.t.sol +++ b/contracts/src/v0.8/l2ep/test/v1_0_0/optimism/OptimismSequencerUptimeFeed.t.sol @@ -1,9 +1,10 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.19; +pragma solidity 0.8.24; import {MockOptimismL1CrossDomainMessenger} from "../../../../tests/MockOptimismL1CrossDomainMessenger.sol"; import {MockOptimismL2CrossDomainMessenger} from "../../../../tests/MockOptimismL2CrossDomainMessenger.sol"; import {OptimismSequencerUptimeFeed} from "../../../dev/optimism/OptimismSequencerUptimeFeed.sol"; +import {BaseSequencerUptimeFeed} from "../../../dev/shared/BaseSequencerUptimeFeed.sol"; import {FeedConsumer} from "../../../../tests/FeedConsumer.sol"; import {L2EPTest} from "../L2EPTest.t.sol"; @@ -61,7 +62,7 @@ contract OptimismSequencerUptimeFeed_UpdateStatus is OptimismSequencerUptimeFeed vm.startPrank(s_strangerAddr, s_strangerAddr); // Tries to update the status from an unauthorized account - vm.expectRevert(OptimismSequencerUptimeFeed.InvalidSender.selector); + vm.expectRevert(BaseSequencerUptimeFeed.InvalidSender.selector); s_optimismSequencerUptimeFeed.updateStatus(true, uint64(1)); } @@ -74,7 +75,7 @@ contract OptimismSequencerUptimeFeed_UpdateStatus is OptimismSequencerUptimeFeed s_mockOptimismL2CrossDomainMessenger.setSender(s_strangerAddr); // Tries to update the status from an unauthorized account - vm.expectRevert(OptimismSequencerUptimeFeed.InvalidSender.selector); + vm.expectRevert(BaseSequencerUptimeFeed.InvalidSender.selector); s_optimismSequencerUptimeFeed.updateStatus(true, uint64(1)); } @@ -257,7 +258,7 @@ contract OptimismSequencerUptimeFeed_AggregatorV3Interface is OptimismSequencerU vm.startPrank(s_l1OwnerAddr, s_l1OwnerAddr); // Gets data from a round that has not happened yet - vm.expectRevert(OptimismSequencerUptimeFeed.NoDataPresent.selector); + vm.expectRevert(BaseSequencerUptimeFeed.NoDataPresent.selector); s_optimismSequencerUptimeFeed.getRoundData(2); } @@ -267,7 +268,7 @@ contract OptimismSequencerUptimeFeed_AggregatorV3Interface is OptimismSequencerU vm.startPrank(s_l1OwnerAddr, s_l1OwnerAddr); // Gets data from a round that has not happened yet - vm.expectRevert(OptimismSequencerUptimeFeed.NoDataPresent.selector); + vm.expectRevert(BaseSequencerUptimeFeed.NoDataPresent.selector); s_optimismSequencerUptimeFeed.getAnswer(2); } @@ -277,7 +278,7 @@ contract OptimismSequencerUptimeFeed_AggregatorV3Interface is OptimismSequencerU vm.startPrank(s_l1OwnerAddr, s_l1OwnerAddr); // Gets data from a round that has not happened yet - vm.expectRevert(OptimismSequencerUptimeFeed.NoDataPresent.selector); + vm.expectRevert(BaseSequencerUptimeFeed.NoDataPresent.selector); s_optimismSequencerUptimeFeed.getTimestamp(2); } } @@ -318,207 +319,3 @@ contract OptimismSequencerUptimeFeed_ProtectReadsOnAggregatorV2V3InterfaceFuncti assertEq(answer, 0); } } - -contract OptimismSequencerUptimeFeed_GasCosts is OptimismSequencerUptimeFeedTest { - /// @notice it should consume a known amount of gas for updates - function test_GasCosts() public { - // Sets msg.sender and tx.origin to a valid address - address l2MessengerAddr = address(s_mockOptimismL2CrossDomainMessenger); - vm.startPrank(l2MessengerAddr, l2MessengerAddr); - - // Assert initial conditions - uint256 timestamp = s_optimismSequencerUptimeFeed.latestTimestamp(); - assertEq(s_optimismSequencerUptimeFeed.latestAnswer(), 0); - - // Defines helper variables for measuring gas usage - uint256 expectedGasUsed; - uint256 gasStart; - uint256 gasFinal; - - // measures gas used for no update - expectedGasUsed = 10197; // NOTE: used to be 38594 in hardhat tests - gasStart = gasleft(); - s_optimismSequencerUptimeFeed.updateStatus(false, uint64(timestamp + 1000)); - gasFinal = gasleft(); - assertEq(s_optimismSequencerUptimeFeed.latestAnswer(), 0); - assertGasUsageIsCloseTo(expectedGasUsed, gasStart, gasFinal, GAS_USED_DEVIATION); - - // measures gas used for update - expectedGasUsed = 33348; // NOTE: used to be 60170 in hardhat tests - gasStart = gasleft(); - s_optimismSequencerUptimeFeed.updateStatus(true, uint64(timestamp + 1000)); - gasFinal = gasleft(); - assertEq(s_optimismSequencerUptimeFeed.latestAnswer(), 1); - assertGasUsageIsCloseTo(expectedGasUsed, gasStart, gasFinal, GAS_USED_DEVIATION); - } -} - -contract OptimismSequencerUptimeFeed_AggregatorInterfaceGasCosts is OptimismSequencerUptimeFeedTest { - /// @notice it should consume a known amount of gas for getRoundData(uint80) - function test_GasUsageForGetRoundData() public { - // Sets msg.sender and tx.origin to a valid address - address l2MessengerAddr = address(s_mockOptimismL2CrossDomainMessenger); - vm.startPrank(l2MessengerAddr, l2MessengerAddr); - - // Defines helper variables for measuring gas usage - uint256 expectedGasUsed = 4504; // NOTE: used to be 30952 in hardhat tests - uint256 gasStart; - uint256 gasFinal; - - // Initializes a round - uint256 timestamp = s_optimismSequencerUptimeFeed.latestTimestamp() + 1000; - s_optimismSequencerUptimeFeed.updateStatus(true, uint64(timestamp)); - - // Measures gas usage - gasStart = gasleft(); - s_optimismSequencerUptimeFeed.getRoundData(1); - gasFinal = gasleft(); - - // Checks that gas usage is within expected range - assertGasUsageIsCloseTo(expectedGasUsed, gasStart, gasFinal, GAS_USED_DEVIATION); - } - - /// @notice it should consume a known amount of gas for latestRoundData() - function test_GasUsageForLatestRoundData() public { - // Sets msg.sender and tx.origin to a valid address - address l2MessengerAddr = address(s_mockOptimismL2CrossDomainMessenger); - vm.startPrank(l2MessengerAddr, l2MessengerAddr); - - // Defines helper variables for measuring gas usage - uint256 expectedGasUsed = 2154; // NOTE: used to be 28523 in hardhat tests - uint256 gasStart; - uint256 gasFinal; - - // Initializes a round - uint256 timestamp = s_optimismSequencerUptimeFeed.latestTimestamp() + 1000; - s_optimismSequencerUptimeFeed.updateStatus(true, uint64(timestamp)); - - // Measures gas usage - gasStart = gasleft(); - s_optimismSequencerUptimeFeed.latestRoundData(); - gasFinal = gasleft(); - - // Checks that gas usage is within expected range - assertGasUsageIsCloseTo(expectedGasUsed, gasStart, gasFinal, GAS_USED_DEVIATION); - } - - /// @notice it should consume a known amount of gas for latestAnswer() - function test_GasUsageForLatestAnswer() public { - // Sets msg.sender and tx.origin to a valid address - address l2MessengerAddr = address(s_mockOptimismL2CrossDomainMessenger); - vm.startPrank(l2MessengerAddr, l2MessengerAddr); - - // Defines helper variables for measuring gas usage - uint256 expectedGasUsed = 1722; // NOTE: used to be 28329 in hardhat tests - uint256 gasStart; - uint256 gasFinal; - - // Initializes a round - uint256 timestamp = s_optimismSequencerUptimeFeed.latestTimestamp() + 1000; - s_optimismSequencerUptimeFeed.updateStatus(true, uint64(timestamp)); - - // Measures gas usage - gasStart = gasleft(); - s_optimismSequencerUptimeFeed.latestAnswer(); - gasFinal = gasleft(); - - // Checks that gas usage is within expected range - assertGasUsageIsCloseTo(expectedGasUsed, gasStart, gasFinal, GAS_USED_DEVIATION); - } - - /// @notice it should consume a known amount of gas for latestTimestamp() - function test_GasUsageForLatestTimestamp() public { - // Sets msg.sender and tx.origin to a valid address - address l2MessengerAddr = address(s_mockOptimismL2CrossDomainMessenger); - vm.startPrank(l2MessengerAddr, l2MessengerAddr); - - // Defines helper variables for measuring gas usage - uint256 expectedGasUsed = 1598; // NOTE: used to be 28229 in hardhat tests - uint256 gasStart; - uint256 gasFinal; - - // Initializes a round - uint256 timestamp = s_optimismSequencerUptimeFeed.latestTimestamp() + 1000; - s_optimismSequencerUptimeFeed.updateStatus(true, uint64(timestamp)); - - // Measures gas usage - gasStart = gasleft(); - s_optimismSequencerUptimeFeed.latestTimestamp(); - gasFinal = gasleft(); - - // Checks that gas usage is within expected range - assertGasUsageIsCloseTo(expectedGasUsed, gasStart, gasFinal, GAS_USED_DEVIATION); - } - - /// @notice it should consume a known amount of gas for latestRound() - function test_GasUsageForLatestRound() public { - // Sets msg.sender and tx.origin to a valid address - address l2MessengerAddr = address(s_mockOptimismL2CrossDomainMessenger); - vm.startPrank(l2MessengerAddr, l2MessengerAddr); - - // Defines helper variables for measuring gas usage - uint256 expectedGasUsed = 1632; // NOTE: used to be 28245 in hardhat tests - uint256 gasStart; - uint256 gasFinal; - - // Initializes a round - uint256 timestamp = s_optimismSequencerUptimeFeed.latestTimestamp() + 1000; - s_optimismSequencerUptimeFeed.updateStatus(true, uint64(timestamp)); - - // Measures gas usage - gasStart = gasleft(); - s_optimismSequencerUptimeFeed.latestRound(); - gasFinal = gasleft(); - - // Checks that gas usage is within expected range - assertGasUsageIsCloseTo(expectedGasUsed, gasStart, gasFinal, GAS_USED_DEVIATION); - } - - /// @notice it should consume a known amount of gas for getAnswer() - function test_GasUsageForGetAnswer() public { - // Sets msg.sender and tx.origin to a valid address - address l2MessengerAddr = address(s_mockOptimismL2CrossDomainMessenger); - vm.startPrank(l2MessengerAddr, l2MessengerAddr); - - // Defines helper variables for measuring gas usage - uint256 expectedGasUsed = 3929; // NOTE: used to be 30682 in hardhat tests - uint256 gasStart; - uint256 gasFinal; - - // Initializes a round - uint256 timestamp = s_optimismSequencerUptimeFeed.latestTimestamp() + 1000; - s_optimismSequencerUptimeFeed.updateStatus(true, uint64(timestamp)); - - // Measures gas usage - gasStart = gasleft(); - s_optimismSequencerUptimeFeed.getAnswer(1); - gasFinal = gasleft(); - - // Checks that gas usage is within expected range - assertGasUsageIsCloseTo(expectedGasUsed, gasStart, gasFinal, GAS_USED_DEVIATION); - } - - /// @notice it should consume a known amount of gas for getTimestamp() - function test_GasUsageForGetTimestamp() public { - // Sets msg.sender and tx.origin to a valid address - address l2MessengerAddr = address(s_mockOptimismL2CrossDomainMessenger); - vm.startPrank(l2MessengerAddr, l2MessengerAddr); - - // Defines helper variables for measuring gas usage - uint256 expectedGasUsed = 3817; // NOTE: used to be 30570 in hardhat tests - uint256 gasStart; - uint256 gasFinal; - - // Initializes a round - uint256 timestamp = s_optimismSequencerUptimeFeed.latestTimestamp() + 1000; - s_optimismSequencerUptimeFeed.updateStatus(true, uint64(timestamp)); - - // Measures gas usage - gasStart = gasleft(); - s_optimismSequencerUptimeFeed.getTimestamp(1); - gasFinal = gasleft(); - - // Checks that gas usage is within expected range - assertGasUsageIsCloseTo(expectedGasUsed, gasStart, gasFinal, GAS_USED_DEVIATION); - } -} diff --git a/contracts/src/v0.8/l2ep/test/v1_0_0/optimism/OptimismValidator.t.sol b/contracts/src/v0.8/l2ep/test/v1_0_0/optimism/OptimismValidator.t.sol index 9364396817a..59395bf5d8b 100644 --- a/contracts/src/v0.8/l2ep/test/v1_0_0/optimism/OptimismValidator.t.sol +++ b/contracts/src/v0.8/l2ep/test/v1_0_0/optimism/OptimismValidator.t.sol @@ -1,5 +1,7 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.19; +pragma solidity 0.8.24; + +import {ISequencerUptimeFeed} from "../../../dev/interfaces/ISequencerUptimeFeed.sol"; import {MockOptimismL1CrossDomainMessenger} from "../../../../tests/MockOptimismL1CrossDomainMessenger.sol"; import {MockOptimismL2CrossDomainMessenger} from "../../../../tests/MockOptimismL2CrossDomainMessenger.sol"; @@ -73,7 +75,7 @@ contract OptimismValidator_Validate is OptimismValidatorTest { emit SentMessage( L2_SEQ_STATUS_RECORDER_ADDRESS, // target address(s_optimismValidator), // sender - abi.encodeWithSelector(OptimismSequencerUptimeFeed.updateStatus.selector, false, futureTimestampInSeconds), // message + abi.encodeWithSelector(ISequencerUptimeFeed.updateStatus.selector, false, futureTimestampInSeconds), // message 0, // nonce INIT_GAS_LIMIT // gas limit ); @@ -97,7 +99,7 @@ contract OptimismValidator_Validate is OptimismValidatorTest { emit SentMessage( L2_SEQ_STATUS_RECORDER_ADDRESS, // target address(s_optimismValidator), // sender - abi.encodeWithSelector(OptimismSequencerUptimeFeed.updateStatus.selector, true, futureTimestampInSeconds), // message + abi.encodeWithSelector(ISequencerUptimeFeed.updateStatus.selector, true, futureTimestampInSeconds), // message 0, // nonce INIT_GAS_LIMIT // gas limit ); diff --git a/contracts/src/v0.8/l2ep/test/v1_0_0/scroll/ScrollCrossDomainForwarder.t.sol b/contracts/src/v0.8/l2ep/test/v1_0_0/scroll/ScrollCrossDomainForwarder.t.sol index f921fa9242e..e34e84f4006 100644 --- a/contracts/src/v0.8/l2ep/test/v1_0_0/scroll/ScrollCrossDomainForwarder.t.sol +++ b/contracts/src/v0.8/l2ep/test/v1_0_0/scroll/ScrollCrossDomainForwarder.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.19; +pragma solidity 0.8.24; import {MockScrollCrossDomainMessenger} from "../../mocks/scroll/MockScrollCrossDomainMessenger.sol"; import {ScrollCrossDomainForwarder} from "../../../dev/scroll/ScrollCrossDomainForwarder.sol"; diff --git a/contracts/src/v0.8/l2ep/test/v1_0_0/scroll/ScrollCrossDomainGovernor.t.sol b/contracts/src/v0.8/l2ep/test/v1_0_0/scroll/ScrollCrossDomainGovernor.t.sol index 9c444604946..8c3d56d1560 100644 --- a/contracts/src/v0.8/l2ep/test/v1_0_0/scroll/ScrollCrossDomainGovernor.t.sol +++ b/contracts/src/v0.8/l2ep/test/v1_0_0/scroll/ScrollCrossDomainGovernor.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.19; +pragma solidity 0.8.24; import {MockScrollCrossDomainMessenger} from "../../mocks/scroll/MockScrollCrossDomainMessenger.sol"; import {ScrollCrossDomainGovernor} from "../../../dev/scroll/ScrollCrossDomainGovernor.sol"; diff --git a/contracts/src/v0.8/l2ep/test/v1_0_0/scroll/ScrollSequencerUptimeFeed.t.sol b/contracts/src/v0.8/l2ep/test/v1_0_0/scroll/ScrollSequencerUptimeFeed.t.sol index 520fbf6dfdc..0968c69415f 100644 --- a/contracts/src/v0.8/l2ep/test/v1_0_0/scroll/ScrollSequencerUptimeFeed.t.sol +++ b/contracts/src/v0.8/l2ep/test/v1_0_0/scroll/ScrollSequencerUptimeFeed.t.sol @@ -1,9 +1,10 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.19; +pragma solidity 0.8.24; import {MockScrollL1CrossDomainMessenger} from "../../mocks/scroll/MockScrollL1CrossDomainMessenger.sol"; import {MockScrollL2CrossDomainMessenger} from "../../mocks/scroll/MockScrollL2CrossDomainMessenger.sol"; import {ScrollSequencerUptimeFeed} from "../../../dev/scroll/ScrollSequencerUptimeFeed.sol"; +import {BaseSequencerUptimeFeed} from "../../../dev/shared/BaseSequencerUptimeFeed.sol"; import {FeedConsumer} from "../../../../tests/FeedConsumer.sol"; import {L2EPTest} from "../L2EPTest.t.sol"; @@ -65,7 +66,7 @@ contract ScrollSequencerUptimeFeed_UpdateStatus is ScrollSequencerUptimeFeedTest vm.startPrank(s_strangerAddr, s_strangerAddr); // Tries to update the status from an unauthorized account - vm.expectRevert(ScrollSequencerUptimeFeed.InvalidSender.selector); + vm.expectRevert(BaseSequencerUptimeFeed.InvalidSender.selector); s_scrollSequencerUptimeFeed.updateStatus(true, uint64(1)); } @@ -78,7 +79,7 @@ contract ScrollSequencerUptimeFeed_UpdateStatus is ScrollSequencerUptimeFeedTest s_mockScrollL2CrossDomainMessenger.setSender(s_strangerAddr); // Tries to update the status from an unauthorized account - vm.expectRevert(ScrollSequencerUptimeFeed.InvalidSender.selector); + vm.expectRevert(BaseSequencerUptimeFeed.InvalidSender.selector); s_scrollSequencerUptimeFeed.updateStatus(true, uint64(1)); } @@ -261,7 +262,7 @@ contract ScrollSequencerUptimeFeed_AggregatorV3Interface is ScrollSequencerUptim vm.startPrank(s_l1OwnerAddr, s_l1OwnerAddr); // Gets data from a round that has not happened yet - vm.expectRevert(ScrollSequencerUptimeFeed.NoDataPresent.selector); + vm.expectRevert(BaseSequencerUptimeFeed.NoDataPresent.selector); s_scrollSequencerUptimeFeed.getRoundData(2); } @@ -271,7 +272,7 @@ contract ScrollSequencerUptimeFeed_AggregatorV3Interface is ScrollSequencerUptim vm.startPrank(s_l1OwnerAddr, s_l1OwnerAddr); // Gets data from a round that has not happened yet - vm.expectRevert(ScrollSequencerUptimeFeed.NoDataPresent.selector); + vm.expectRevert(BaseSequencerUptimeFeed.NoDataPresent.selector); s_scrollSequencerUptimeFeed.getAnswer(2); } @@ -281,7 +282,7 @@ contract ScrollSequencerUptimeFeed_AggregatorV3Interface is ScrollSequencerUptim vm.startPrank(s_l1OwnerAddr, s_l1OwnerAddr); // Gets data from a round that has not happened yet - vm.expectRevert(ScrollSequencerUptimeFeed.NoDataPresent.selector); + vm.expectRevert(BaseSequencerUptimeFeed.NoDataPresent.selector); s_scrollSequencerUptimeFeed.getTimestamp(2); } } @@ -322,207 +323,3 @@ contract ScrollSequencerUptimeFeed_ProtectReadsOnAggregatorV2V3InterfaceFunction assertEq(answer, 0); } } - -contract ScrollSequencerUptimeFeed_GasCosts is ScrollSequencerUptimeFeedTest { - /// @notice it should consume a known amount of gas for updates - function test_GasCosts() public { - // Sets msg.sender and tx.origin to a valid address - address l2MessengerAddr = address(s_mockScrollL2CrossDomainMessenger); - vm.startPrank(l2MessengerAddr, l2MessengerAddr); - - // Assert initial conditions - uint256 timestamp = s_scrollSequencerUptimeFeed.latestTimestamp(); - assertEq(s_scrollSequencerUptimeFeed.latestAnswer(), 0); - - // Defines helper variables for measuring gas usage - uint256 expectedGasUsed; - uint256 gasStart; - uint256 gasFinal; - - // measures gas used for no update - expectedGasUsed = 10197; // NOTE: used to be 38594 in hardhat tests - gasStart = gasleft(); - s_scrollSequencerUptimeFeed.updateStatus(false, uint64(timestamp + 1000)); - gasFinal = gasleft(); - assertEq(s_scrollSequencerUptimeFeed.latestAnswer(), 0); - assertGasUsageIsCloseTo(expectedGasUsed, gasStart, gasFinal, GAS_USED_DEVIATION); - - // measures gas used for update - expectedGasUsed = 31644; // NOTE: used to be 58458 in hardhat tests - gasStart = gasleft(); - s_scrollSequencerUptimeFeed.updateStatus(true, uint64(timestamp + 1000)); - gasFinal = gasleft(); - assertEq(s_scrollSequencerUptimeFeed.latestAnswer(), 1); - assertGasUsageIsCloseTo(expectedGasUsed, gasStart, gasFinal, GAS_USED_DEVIATION); - } -} - -contract ScrollSequencerUptimeFeed_AggregatorInterfaceGasCosts is ScrollSequencerUptimeFeedTest { - /// @notice it should consume a known amount of gas for getRoundData(uint80) - function test_GasUsageForGetRoundData() public { - // Sets msg.sender and tx.origin to a valid address - address l2MessengerAddr = address(s_mockScrollL2CrossDomainMessenger); - vm.startPrank(l2MessengerAddr, l2MessengerAddr); - - // Defines helper variables for measuring gas usage - uint256 expectedGasUsed = 4504; // NOTE: used to be 30952 in hardhat tesst - uint256 gasStart; - uint256 gasFinal; - - // Initializes a round - uint256 timestamp = s_scrollSequencerUptimeFeed.latestTimestamp() + 1000; - s_scrollSequencerUptimeFeed.updateStatus(true, uint64(timestamp)); - - // Measures gas usage - gasStart = gasleft(); - s_scrollSequencerUptimeFeed.getRoundData(1); - gasFinal = gasleft(); - - // Checks that gas usage is within expected range - assertGasUsageIsCloseTo(expectedGasUsed, gasStart, gasFinal, GAS_USED_DEVIATION); - } - - /// @notice it should consume a known amount of gas for latestRoundData() - function test_GasUsageForLatestRoundData() public { - // Sets msg.sender and tx.origin to a valid address - address l2MessengerAddr = address(s_mockScrollL2CrossDomainMessenger); - vm.startPrank(l2MessengerAddr, l2MessengerAddr); - - // Defines helper variables for measuring gas usage - uint256 expectedGasUsed = 2154; // NOTE: used to be 28523 in hardhat tests - uint256 gasStart; - uint256 gasFinal; - - // Initializes a round - uint256 timestamp = s_scrollSequencerUptimeFeed.latestTimestamp() + 1000; - s_scrollSequencerUptimeFeed.updateStatus(true, uint64(timestamp)); - - // Measures gas usage - gasStart = gasleft(); - s_scrollSequencerUptimeFeed.latestRoundData(); - gasFinal = gasleft(); - - // Checks that gas usage is within expected range - assertGasUsageIsCloseTo(expectedGasUsed, gasStart, gasFinal, GAS_USED_DEVIATION); - } - - /// @notice it should consume a known amount of gas for latestAnswer() - function test_GasUsageForLatestAnswer() public { - // Sets msg.sender and tx.origin to a valid address - address l2MessengerAddr = address(s_mockScrollL2CrossDomainMessenger); - vm.startPrank(l2MessengerAddr, l2MessengerAddr); - - // Defines helper variables for measuring gas usage - uint256 expectedGasUsed = 1566; // NOTE: used to be 28229 in hardhat tests - uint256 gasStart; - uint256 gasFinal; - - // Initializes a round - uint256 timestamp = s_scrollSequencerUptimeFeed.latestTimestamp() + 1000; - s_scrollSequencerUptimeFeed.updateStatus(true, uint64(timestamp)); - - // Measures gas usage - gasStart = gasleft(); - s_scrollSequencerUptimeFeed.latestAnswer(); - gasFinal = gasleft(); - - // Checks that gas usage is within expected range - assertGasUsageIsCloseTo(expectedGasUsed, gasStart, gasFinal, GAS_USED_DEVIATION); - } - - /// @notice it should consume a known amount of gas for latestTimestamp() - function test_GasUsageForLatestTimestamp() public { - // Sets msg.sender and tx.origin to a valid address - address l2MessengerAddr = address(s_mockScrollL2CrossDomainMessenger); - vm.startPrank(l2MessengerAddr, l2MessengerAddr); - - // Defines helper variables for measuring gas usage - uint256 expectedGasUsed = 1459; // NOTE: used to be 28129 in hardhat tests - uint256 gasStart; - uint256 gasFinal; - - // Initializes a round - uint256 timestamp = s_scrollSequencerUptimeFeed.latestTimestamp() + 1000; - s_scrollSequencerUptimeFeed.updateStatus(true, uint64(timestamp)); - - // Measures gas usage - gasStart = gasleft(); - s_scrollSequencerUptimeFeed.latestTimestamp(); - gasFinal = gasleft(); - - // Checks that gas usage is within expected range - assertGasUsageIsCloseTo(expectedGasUsed, gasStart, gasFinal, GAS_USED_DEVIATION); - } - - /// @notice it should consume a known amount of gas for latestRound() - function test_GasUsageForLatestRound() public { - // Sets msg.sender and tx.origin to a valid address - address l2MessengerAddr = address(s_mockScrollL2CrossDomainMessenger); - vm.startPrank(l2MessengerAddr, l2MessengerAddr); - - // Defines helper variables for measuring gas usage - uint256 expectedGasUsed = 1470; // NOTE: used to be 28145 in hardhat tests - uint256 gasStart; - uint256 gasFinal; - - // Initializes a round - uint256 timestamp = s_scrollSequencerUptimeFeed.latestTimestamp() + 1000; - s_scrollSequencerUptimeFeed.updateStatus(true, uint64(timestamp)); - - // Measures gas usage - gasStart = gasleft(); - s_scrollSequencerUptimeFeed.latestRound(); - gasFinal = gasleft(); - - // Checks that gas usage is within expected range - assertGasUsageIsCloseTo(expectedGasUsed, gasStart, gasFinal, GAS_USED_DEVIATION); - } - - /// @notice it should consume a known amount of gas for getAnswer() - function test_GasUsageForGetAnswer() public { - // Sets msg.sender and tx.origin to a valid address - address l2MessengerAddr = address(s_mockScrollL2CrossDomainMessenger); - vm.startPrank(l2MessengerAddr, l2MessengerAddr); - - // Defines helper variables for measuring gas usage - uint256 expectedGasUsed = 3929; // NOTE: used to be 30682 in hardhat tests - uint256 gasStart; - uint256 gasFinal; - - // Initializes a round - uint256 timestamp = s_scrollSequencerUptimeFeed.latestTimestamp() + 1000; - s_scrollSequencerUptimeFeed.updateStatus(true, uint64(timestamp)); - - // Measures gas usage - gasStart = gasleft(); - s_scrollSequencerUptimeFeed.getAnswer(1); - gasFinal = gasleft(); - - // Checks that gas usage is within expected range - assertGasUsageIsCloseTo(expectedGasUsed, gasStart, gasFinal, GAS_USED_DEVIATION); - } - - /// @notice it should consume a known amount of gas for getTimestamp() - function test_GasUsageForGetTimestamp() public { - // Sets msg.sender and tx.origin to a valid address - address l2MessengerAddr = address(s_mockScrollL2CrossDomainMessenger); - vm.startPrank(l2MessengerAddr, l2MessengerAddr); - - // Defines helper variables for measuring gas usage - uint256 expectedGasUsed = 3817; // NOTE: used to be 30570 in hardhat tests - uint256 gasStart; - uint256 gasFinal; - - // Initializes a round - uint256 timestamp = s_scrollSequencerUptimeFeed.latestTimestamp() + 1000; - s_scrollSequencerUptimeFeed.updateStatus(true, uint64(timestamp)); - - // Measures gas usage - gasStart = gasleft(); - s_scrollSequencerUptimeFeed.getTimestamp(1); - gasFinal = gasleft(); - - // Checks that gas usage is within expected range - assertGasUsageIsCloseTo(expectedGasUsed, gasStart, gasFinal, GAS_USED_DEVIATION); - } -} diff --git a/contracts/src/v0.8/l2ep/test/v1_0_0/scroll/ScrollValidator.t.sol b/contracts/src/v0.8/l2ep/test/v1_0_0/scroll/ScrollValidator.t.sol index f425ca1c6e5..3d5298d5184 100644 --- a/contracts/src/v0.8/l2ep/test/v1_0_0/scroll/ScrollValidator.t.sol +++ b/contracts/src/v0.8/l2ep/test/v1_0_0/scroll/ScrollValidator.t.sol @@ -1,5 +1,7 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.19; +pragma solidity 0.8.24; + +import {ISequencerUptimeFeed} from "../../../dev/interfaces/ISequencerUptimeFeed.sol"; import {MockScrollL1CrossDomainMessenger} from "../../mocks/scroll/MockScrollL1CrossDomainMessenger.sol"; import {MockScrollL2CrossDomainMessenger} from "../../mocks/scroll/MockScrollL2CrossDomainMessenger.sol"; @@ -87,7 +89,7 @@ contract ScrollValidator_Validate is ScrollValidatorTest { 0, // value 0, // nonce INIT_GAS_LIMIT, // gas limit - abi.encodeWithSelector(ScrollSequencerUptimeFeed.updateStatus.selector, false, futureTimestampInSeconds) // message + abi.encodeWithSelector(ISequencerUptimeFeed.updateStatus.selector, false, futureTimestampInSeconds) // message ); // Runs the function (which produces the event to test) @@ -112,7 +114,7 @@ contract ScrollValidator_Validate is ScrollValidatorTest { 0, // value 0, // nonce INIT_GAS_LIMIT, // gas limit - abi.encodeWithSelector(ScrollSequencerUptimeFeed.updateStatus.selector, true, futureTimestampInSeconds) // message + abi.encodeWithSelector(ISequencerUptimeFeed.updateStatus.selector, true, futureTimestampInSeconds) // message ); // Runs the function (which produces the event to test) diff --git a/contracts/src/v0.8/l2ep/test/v1_0_0/zksync/ZKSyncSequencerUptimeFeed.t.sol b/contracts/src/v0.8/l2ep/test/v1_0_0/zksync/ZKSyncSequencerUptimeFeed.t.sol new file mode 100644 index 00000000000..6d90b3973e9 --- /dev/null +++ b/contracts/src/v0.8/l2ep/test/v1_0_0/zksync/ZKSyncSequencerUptimeFeed.t.sol @@ -0,0 +1,291 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.24; + +import {AddressAliasHelper} from "../../../../vendor/arb-bridge-eth/v0.8.0-custom/contracts/libraries/AddressAliasHelper.sol"; +import {ZKSyncSequencerUptimeFeed} from "../../../dev/zksync/ZKSyncSequencerUptimeFeed.sol"; +import {BaseSequencerUptimeFeed} from "../../../dev/shared/BaseSequencerUptimeFeed.sol"; +import {FeedConsumer} from "../../../../tests/FeedConsumer.sol"; +import {L2EPTest} from "../L2EPTest.t.sol"; + +contract ZKSyncSequencerUptimeFeedTest is L2EPTest { + /// Helper Variables + address internal s_aliasedL1OwnerAddress = AddressAliasHelper.applyL1ToL2Alias(s_l1OwnerAddr); + + /// L2EP contracts + ZKSyncSequencerUptimeFeed internal s_zksyncSequencerUptimeFeed; + + /// Events + event UpdateIgnored(bool latestStatus, uint64 latestTimestamp, bool incomingStatus, uint64 incomingTimestamp); + event AnswerUpdated(int256 indexed current, uint256 indexed roundId, uint256 updatedAt); + event RoundUpdated(int256 status, uint64 updatedAt); + + /// Setup + function setUp() public { + // Deploys contracts + s_zksyncSequencerUptimeFeed = new ZKSyncSequencerUptimeFeed(s_l1OwnerAddr, false); + } +} + +contract ZKSyncSequencerUptimeFeed_Constructor is ZKSyncSequencerUptimeFeedTest { + /// @notice it should have been deployed with the correct initial state + function test_InitialState() public { + // Sets msg.sender and tx.origin to a valid address + vm.startPrank(s_l1OwnerAddr, s_l1OwnerAddr); + + // Checks L1 sender + address actualL1Addr = s_zksyncSequencerUptimeFeed.l1Sender(); + assertEq(actualL1Addr, s_l1OwnerAddr); + + // Checks latest round data + (uint80 roundId, int256 answer, , , ) = s_zksyncSequencerUptimeFeed.latestRoundData(); + assertEq(roundId, 1); + assertEq(answer, 0); + } +} + +contract ZKSyncSequencerUptimeFeed_UpdateStatus is ZKSyncSequencerUptimeFeedTest { + /// @notice it should revert if called by an unauthorized account + function test_RevertIfNotL2CrossDomainMessengerAddr() public { + // Sets msg.sender and tx.origin to an unauthorized address + vm.startPrank(s_strangerAddr, s_strangerAddr); + + // Tries to update the status from an unauthorized account + vm.expectRevert(BaseSequencerUptimeFeed.InvalidSender.selector); + s_zksyncSequencerUptimeFeed.updateStatus(true, uint64(1)); + } + + /// @notice it should update status when status has not changed and incoming timestamp is the same as latest + function test_UpdateStatusWhenNoChange() public { + // Sets msg.sender and tx.origin to a valid address + vm.startPrank(s_aliasedL1OwnerAddress, s_aliasedL1OwnerAddress); + + // Fetches the latest timestamp + uint256 timestamp = s_zksyncSequencerUptimeFeed.latestTimestamp(); + + // Submits a status update + vm.expectEmit(); + emit AnswerUpdated(1, 2, timestamp); + s_zksyncSequencerUptimeFeed.updateStatus(true, uint64(timestamp)); + assertEq(s_zksyncSequencerUptimeFeed.latestAnswer(), 1); + assertEq(s_zksyncSequencerUptimeFeed.latestTimestamp(), uint64(timestamp)); + + // Stores the current round data before updating it + ( + uint80 roundIdBeforeUpdate, + int256 answerBeforeUpdate, + uint256 startedAtBeforeUpdate, + , + uint80 answeredInRoundBeforeUpdate + ) = s_zksyncSequencerUptimeFeed.latestRoundData(); + + // Submit another status update with the same status + vm.expectEmit(); + emit RoundUpdated(1, uint64(block.timestamp)); + s_zksyncSequencerUptimeFeed.updateStatus(true, uint64(timestamp + 200)); + assertEq(s_zksyncSequencerUptimeFeed.latestAnswer(), 1); + assertEq(s_zksyncSequencerUptimeFeed.latestTimestamp(), uint64(timestamp)); + + // Stores the current round data after updating it + ( + uint80 roundIdAfterUpdate, + int256 answerAfterUpdate, + uint256 startedAtAfterUpdate, + uint256 updatedAtAfterUpdate, + uint80 answeredInRoundAfterUpdate + ) = s_zksyncSequencerUptimeFeed.latestRoundData(); + + // Verifies the latest round data has been properly updated + assertEq(roundIdAfterUpdate, roundIdBeforeUpdate); + assertEq(answerAfterUpdate, answerBeforeUpdate); + assertEq(startedAtAfterUpdate, startedAtBeforeUpdate); + assertEq(answeredInRoundAfterUpdate, answeredInRoundBeforeUpdate); + assertEq(updatedAtAfterUpdate, block.timestamp); + } + + /// @notice it should update status when status has changed and incoming timestamp is newer than the latest + function test_UpdateStatusWhenStatusChangeAndTimeChange() public { + // Sets msg.sender and tx.origin to a valid address + vm.startPrank(s_aliasedL1OwnerAddress, s_aliasedL1OwnerAddress); + + // Submits a status update + uint256 timestamp = s_zksyncSequencerUptimeFeed.latestTimestamp(); + vm.expectEmit(); + emit AnswerUpdated(1, 2, timestamp); + s_zksyncSequencerUptimeFeed.updateStatus(true, uint64(timestamp)); + assertEq(s_zksyncSequencerUptimeFeed.latestAnswer(), 1); + assertEq(s_zksyncSequencerUptimeFeed.latestTimestamp(), uint64(timestamp)); + + // Submit another status update, different status, newer timestamp should update + timestamp = timestamp + 200; + vm.expectEmit(); + emit AnswerUpdated(0, 3, timestamp); + s_zksyncSequencerUptimeFeed.updateStatus(false, uint64(timestamp)); + assertEq(s_zksyncSequencerUptimeFeed.latestAnswer(), 0); + assertEq(s_zksyncSequencerUptimeFeed.latestTimestamp(), uint64(timestamp)); + } + + /// @notice it should update status when status has changed and incoming timestamp is the same as latest + function test_UpdateStatusWhenStatusChangeAndNoTimeChange() public { + // Sets msg.sender and tx.origin to a valid address + vm.startPrank(s_aliasedL1OwnerAddress, s_aliasedL1OwnerAddress); + + // Fetches the latest timestamp + uint256 timestamp = s_zksyncSequencerUptimeFeed.latestTimestamp(); + + // Submits a status update + vm.expectEmit(); + emit AnswerUpdated(1, 2, timestamp); + s_zksyncSequencerUptimeFeed.updateStatus(true, uint64(timestamp)); + assertEq(s_zksyncSequencerUptimeFeed.latestAnswer(), 1); + assertEq(s_zksyncSequencerUptimeFeed.latestTimestamp(), uint64(timestamp)); + + // Submit another status update, different status, same timestamp should update + vm.expectEmit(); + emit AnswerUpdated(0, 3, timestamp); + s_zksyncSequencerUptimeFeed.updateStatus(false, uint64(timestamp)); + assertEq(s_zksyncSequencerUptimeFeed.latestAnswer(), 0); + assertEq(s_zksyncSequencerUptimeFeed.latestTimestamp(), uint64(timestamp)); + } + + /// @notice it should ignore out-of-order updates + function test_IgnoreOutOfOrderUpdates() public { + // Sets msg.sender and tx.origin to a valid address + vm.startPrank(s_aliasedL1OwnerAddress, s_aliasedL1OwnerAddress); + + // Submits a status update + uint256 timestamp = s_zksyncSequencerUptimeFeed.latestTimestamp() + 10000; + vm.expectEmit(); + emit AnswerUpdated(1, 2, timestamp); + s_zksyncSequencerUptimeFeed.updateStatus(true, uint64(timestamp)); + assertEq(s_zksyncSequencerUptimeFeed.latestAnswer(), 1); + assertEq(s_zksyncSequencerUptimeFeed.latestTimestamp(), uint64(timestamp)); + + // Update with different status, but stale timestamp, should be ignored + timestamp = timestamp - 1000; + vm.expectEmit(false, false, false, false); + emit UpdateIgnored(true, 0, true, 0); // arguments are dummy values + // TODO: how can we check that an AnswerUpdated event was NOT emitted + s_zksyncSequencerUptimeFeed.updateStatus(false, uint64(timestamp)); + } +} + +contract ZKSyncSequencerUptimeFeed_AggregatorV3Interface is ZKSyncSequencerUptimeFeedTest { + /// @notice it should return valid answer from getRoundData and latestRoundData + function test_AggregatorV3Interface() public { + // Sets msg.sender and tx.origin to a valid address + vm.startPrank(s_aliasedL1OwnerAddress, s_aliasedL1OwnerAddress); + + // Defines helper variables + uint80 roundId; + int256 answer; + uint256 startedAt; + uint256 updatedAt; + uint80 answeredInRound; + + // Checks initial state + (roundId, answer, startedAt, updatedAt, answeredInRound) = s_zksyncSequencerUptimeFeed.latestRoundData(); + assertEq(roundId, 1); + assertEq(answer, 0); + assertEq(answeredInRound, roundId); + assertEq(startedAt, updatedAt); + + // Submits status update with different status and newer timestamp, should update + uint256 timestamp = startedAt + 1000; + s_zksyncSequencerUptimeFeed.updateStatus(true, uint64(timestamp)); + (roundId, answer, startedAt, updatedAt, answeredInRound) = s_zksyncSequencerUptimeFeed.getRoundData(2); + assertEq(roundId, 2); + assertEq(answer, 1); + assertEq(answeredInRound, roundId); + assertEq(startedAt, timestamp); + assertLe(updatedAt, startedAt); + + // Saves round 2 data + uint80 roundId2 = roundId; + int256 answer2 = answer; + uint256 startedAt2 = startedAt; + uint256 updatedAt2 = updatedAt; + uint80 answeredInRound2 = answeredInRound; + + // Checks that last round is still returning the correct data + (roundId, answer, startedAt, updatedAt, answeredInRound) = s_zksyncSequencerUptimeFeed.getRoundData(1); + assertEq(roundId, 1); + assertEq(answer, 0); + assertEq(answeredInRound, roundId); + assertEq(startedAt, updatedAt); + + // Assert latestRoundData corresponds to latest round id + (roundId, answer, startedAt, updatedAt, answeredInRound) = s_zksyncSequencerUptimeFeed.latestRoundData(); + assertEq(roundId2, roundId); + assertEq(answer2, answer); + assertEq(startedAt2, startedAt); + assertEq(updatedAt2, updatedAt); + assertEq(answeredInRound2, answeredInRound); + } + + /// @notice it should revert from #getRoundData when round does not yet exist (future roundId) + function test_RevertGetRoundDataWhenRoundDoesNotExistYet() public { + // Sets msg.sender and tx.origin to a valid address + vm.startPrank(s_l1OwnerAddr, s_l1OwnerAddr); + + // Gets data from a round that has not happened yet + vm.expectRevert(BaseSequencerUptimeFeed.NoDataPresent.selector); + s_zksyncSequencerUptimeFeed.getRoundData(2); + } + + /// @notice it should revert from #getAnswer when round does not yet exist (future roundId) + function test_RevertGetAnswerWhenRoundDoesNotExistYet() public { + // Sets msg.sender and tx.origin to a valid address + vm.startPrank(s_l1OwnerAddr, s_l1OwnerAddr); + + // Gets data from a round that has not happened yet + vm.expectRevert(BaseSequencerUptimeFeed.NoDataPresent.selector); + s_zksyncSequencerUptimeFeed.getAnswer(2); + } + + /// @notice it should revert from #getTimestamp when round does not yet exist (future roundId) + function test_RevertGetTimestampWhenRoundDoesNotExistYet() public { + // Sets msg.sender and tx.origin to a valid address + vm.startPrank(s_l1OwnerAddr, s_l1OwnerAddr); + + // Gets data from a round that has not happened yet + vm.expectRevert(BaseSequencerUptimeFeed.NoDataPresent.selector); + s_zksyncSequencerUptimeFeed.getTimestamp(2); + } +} + +contract ZKSyncSequencerUptimeFeed_ProtectReadsOnAggregatorV2V3InterfaceFunctions is ZKSyncSequencerUptimeFeedTest { + /// @notice it should disallow reads on AggregatorV2V3Interface functions when consuming contract is not whitelisted + function test_AggregatorV2V3InterfaceDisallowReadsIfConsumingContractIsNotWhitelisted() public { + // Deploys a FeedConsumer contract + FeedConsumer feedConsumer = new FeedConsumer(address(s_zksyncSequencerUptimeFeed)); + + // Sanity - consumer is not whitelisted + assertEq(s_zksyncSequencerUptimeFeed.checkEnabled(), true); + assertEq(s_zksyncSequencerUptimeFeed.hasAccess(address(feedConsumer), abi.encode("")), false); + + // Asserts reads are not possible from consuming contract + vm.expectRevert("No access"); + feedConsumer.latestAnswer(); + vm.expectRevert("No access"); + feedConsumer.latestRoundData(); + } + + /// @notice it should allow reads on AggregatorV2V3Interface functions when consuming contract is whitelisted + function test_AggregatorV2V3InterfaceAllowReadsIfConsumingContractIsWhitelisted() public { + // Deploys a FeedConsumer contract + FeedConsumer feedConsumer = new FeedConsumer(address(s_zksyncSequencerUptimeFeed)); + + // Whitelist consumer + s_zksyncSequencerUptimeFeed.addAccess(address(feedConsumer)); + + // Sanity - consumer is whitelisted + assertEq(s_zksyncSequencerUptimeFeed.checkEnabled(), true); + assertEq(s_zksyncSequencerUptimeFeed.hasAccess(address(feedConsumer), abi.encode("")), true); + + // Asserts reads are possible from consuming contract + (uint80 roundId, int256 answer, , , ) = feedConsumer.latestRoundData(); + assertEq(feedConsumer.latestAnswer(), 0); + assertEq(roundId, 1); + assertEq(answer, 0); + } +} diff --git a/contracts/src/v0.8/l2ep/test/v1_0_0/zksync/ZKSyncValidator.t.sol b/contracts/src/v0.8/l2ep/test/v1_0_0/zksync/ZKSyncValidator.t.sol new file mode 100644 index 00000000000..0bea147c8cd --- /dev/null +++ b/contracts/src/v0.8/l2ep/test/v1_0_0/zksync/ZKSyncValidator.t.sol @@ -0,0 +1,149 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.24; + +import {MockBridgehub} from "../../mocks/zksync/MockZKSyncL1Bridge.sol"; +import {ISequencerUptimeFeed} from "../../../dev/interfaces/ISequencerUptimeFeed.sol"; +import {ZKSyncValidator} from "../../../dev/zksync/ZKSyncValidator.sol"; +import {BaseValidator} from "../../../dev/shared/BaseValidator.sol"; +import {L2EPTest} from "../L2EPTest.t.sol"; + +contract ZKSyncValidatorTest is L2EPTest { + address internal constant L2_SEQ_STATUS_RECORDER_ADDRESS = address(0x491B1dDA0A8fa069bbC1125133A975BF4e85a91b); + address internal constant DUMMY_L1_XDOMAIN_MSNGR_ADDR = address(0xa04Fc18f012B1a5A8231c7Ee4b916Dd6dbd271b6); + address internal constant DUMMY_L2_UPTIME_FEED_ADDR = address(0xFe31891940A2e5f04B76eD8bD1038E44127d1512); + uint32 internal constant INIT_GAS_PER_PUBDATA_BYTE_LIMIT = 800; + uint32 internal constant INIT_GAS_LIMIT = 1900000; + uint32 internal constant MAIN_NET_CHAIN_ID = 300; + uint32 internal constant BAD_CHAIN_ID = 0; + + ISequencerUptimeFeed internal s_zksyncSequencerUptimeFeed; + MockBridgehub internal s_mockZKSyncL1Bridge; + ZKSyncValidator internal s_zksyncValidator; + + /// Fake event that will get emitted when `requestL2TransactionDirect` is called + /// Definition is taken from MockZKSyncL1Bridge + event SentMessage(address indexed sender, bytes message); + + /// Setup + function setUp() public { + s_mockZKSyncL1Bridge = new MockBridgehub(); + + s_zksyncValidator = new ZKSyncValidator( + address(s_mockZKSyncL1Bridge), + DUMMY_L2_UPTIME_FEED_ADDR, + INIT_GAS_LIMIT, + MAIN_NET_CHAIN_ID, + INIT_GAS_PER_PUBDATA_BYTE_LIMIT + ); + } +} + +contract ZKSyncValidator_Constructor is ZKSyncValidatorTest { + /// @notice it correctly validates that the chain id is valid + function test_ConstructingRevertedWithInvalidChainId() public { + vm.expectRevert(ZKSyncValidator.InvalidChainID.selector); + new ZKSyncValidator( + DUMMY_L1_XDOMAIN_MSNGR_ADDR, + DUMMY_L2_UPTIME_FEED_ADDR, + INIT_GAS_LIMIT, + BAD_CHAIN_ID, + INIT_GAS_PER_PUBDATA_BYTE_LIMIT + ); + } + + /// @notice it correctly validates that the L1 bridge address is not zero + function test_ConstructingRevertedWithZeroL1BridgeAddress() public { + vm.expectRevert(BaseValidator.L1CrossDomainMessengerAddressZero.selector); + new ZKSyncValidator( + address(0), + DUMMY_L2_UPTIME_FEED_ADDR, + INIT_GAS_LIMIT, + MAIN_NET_CHAIN_ID, + INIT_GAS_PER_PUBDATA_BYTE_LIMIT + ); + } + + /// @notice it correctly validates that the L2 Uptime feed address is not zero + function test_ConstructingRevertedWithZeroL2UpdateFeedAddress() public { + vm.expectRevert(BaseValidator.L2UptimeFeedAddrZero.selector); + new ZKSyncValidator( + DUMMY_L1_XDOMAIN_MSNGR_ADDR, + address(0), + INIT_GAS_LIMIT, + MAIN_NET_CHAIN_ID, + INIT_GAS_PER_PUBDATA_BYTE_LIMIT + ); + } +} + +contract ZKSyncValidator_GetSetL2GasPerPubdataByteLimit is ZKSyncValidatorTest { + /// @notice it correctly updates the gas limit per pubdata byte + function test_CorrectlyGetsAndUpdatesTheGasPerPubdataByteLimit() public { + assertEq(s_zksyncValidator.getL2GasPerPubdataByteLimit(), INIT_GAS_PER_PUBDATA_BYTE_LIMIT); + + uint32 newGasPerPubDataByteLimit = 2000000; + s_zksyncValidator.setL2GasPerPubdataByteLimit(newGasPerPubDataByteLimit); + assertEq(s_zksyncValidator.getL2GasPerPubdataByteLimit(), newGasPerPubDataByteLimit); + } +} + +contract ZKSyncValidator_GetChainId is ZKSyncValidatorTest { + /// @notice it correctly gets the chain id + function test_CorrectlyGetsTheChainId() public { + assertEq(s_zksyncValidator.getChainId(), MAIN_NET_CHAIN_ID); + } +} + +contract ZKSyncValidator_Validate is ZKSyncValidatorTest { + /// @notice it reverts if called by account with no access + function test_RevertsIfCalledByAnAccountWithNoAccess() public { + vm.startPrank(s_strangerAddr); + vm.expectRevert("No access"); + s_zksyncValidator.validate(0, 0, 1, 1); + } + + /// @notice it posts sequencer status when there is not status change + function test_PostSequencerStatusWhenThereIsNotStatusChange() public { + // Gives access to the s_eoaValidator + s_zksyncValidator.addAccess(s_eoaValidator); + + // Sets block.timestamp to a later date + uint256 futureTimestampInSeconds = block.timestamp + 5000; + vm.startPrank(s_eoaValidator); + vm.warp(futureTimestampInSeconds); + + // Sets up the expected event data + bytes memory message = abi.encodeWithSelector( + ISequencerUptimeFeed.updateStatus.selector, + false, + futureTimestampInSeconds + ); + + vm.expectEmit(false, false, false, true); + emit SentMessage(address(s_zksyncValidator), message); + + // Runs the function (which produces the event to test) + s_zksyncValidator.validate(0, 0, 0, 0); + } + + /// @notice it post sequencer offline + function test_PostSequencerOffline() public { + // Gives access to the s_eoaValidator + s_zksyncValidator.addAccess(s_eoaValidator); + + // Sets block.timestamp to a later date + uint256 futureTimestampInSeconds = block.timestamp + 10000; + vm.startPrank(s_eoaValidator); + vm.warp(futureTimestampInSeconds); + + // Sets up the expected event data + vm.expectEmit(false, false, false, true); + emit SentMessage( + address(s_zksyncValidator), + abi.encodeWithSelector(ISequencerUptimeFeed.updateStatus.selector, true, futureTimestampInSeconds) + ); + + // Runs the function (which produces the event to test) + s_zksyncValidator.validate(0, 0, 1, 1); + } +} diff --git a/contracts/src/v0.8/liquiditymanager/LiquidityManager.sol b/contracts/src/v0.8/liquiditymanager/LiquidityManager.sol new file mode 100644 index 00000000000..070930b904a --- /dev/null +++ b/contracts/src/v0.8/liquiditymanager/LiquidityManager.sol @@ -0,0 +1,575 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {IBridgeAdapter} from "./interfaces/IBridge.sol"; +import {ILiquidityManager} from "./interfaces/ILiquidityManager.sol"; +import {ILiquidityContainer} from "./interfaces/ILiquidityContainer.sol"; +import {IWrappedNative} from "../ccip/interfaces/IWrappedNative.sol"; + +import {OCR3Base} from "./ocr/OCR3Base.sol"; + +import {IERC20} from "../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/IERC20.sol"; +import {SafeERC20} from "../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/utils/SafeERC20.sol"; + +/// @notice LiquidityManager for a single token over multiple chains. +/// @dev This contract is designed to be used with the LockReleaseTokenPool contract but +/// isn't constrained to it. It can be used with any contract that implements the ILiquidityContainer +/// interface. +/// @dev The OCR3 DON should only be able to transfer funds to other pre-approved contracts +/// on other chains. Under no circumstances should it be able to transfer funds to arbitrary +/// addresses. The owner is therefore in full control of the funds in this contract, not the DON. +/// This is a security feature. The worst that can happen is that the DON can lock up funds in +/// bridges, but it can't steal them. +/// @dev References to local mean logic on the same chain as this contract is deployed on. +/// References to remote mean logic on other chains. +contract LiquidityManager is ILiquidityManager, OCR3Base { + using SafeERC20 for IERC20; + + error ZeroAddress(); + error InvalidRemoteChain(uint64 chainSelector); + error ZeroChainSelector(); + error InsufficientLiquidity(uint256 requested, uint256 available, uint256 reserve); + error EmptyReport(); + error TransferFailed(); + error OnlyFinanceRole(); + + /// @notice Emitted when a finalization step is completed without funds being available. + /// @param ocrSeqNum The OCR sequence number of the report. + /// @param remoteChainSelector The chain selector of the remote chain funds are coming from. + /// @param bridgeSpecificData The bridge specific data that was used to finalize the transfer. + event FinalizationStepCompleted( + uint64 indexed ocrSeqNum, + uint64 indexed remoteChainSelector, + bytes bridgeSpecificData + ); + + /// @notice Emitted when the CLL finance role is set. + /// @param financeRole The address of the new finance role. + event FinanceRoleSet(address financeRole); + + /// @notice Emitted when liquidity is transferred to another chain, or received from another chain. + /// @param ocrSeqNum The OCR sequence number of the report. + /// @param fromChainSelector The chain selector of the chain the funds are coming from. + /// In the event fromChainSelector == i_localChainSelector, this is an outgoing transfer. + /// Otherwise, it is an incoming transfer. + /// @param toChainSelector The chain selector of the chain the funds are going to. + /// In the event toChainSelector == i_localChainSelector, this is an incoming transfer. + /// Otherwise, it is an outgoing transfer. + /// @param to The address the funds are going to. + /// If this is address(this), the funds are arriving in this contract. + /// @param amount The amount of tokens being transferred. + /// @param bridgeSpecificData The bridge specific data that was passed to the local bridge adapter + /// when transferring the funds. + /// @param bridgeReturnData The return data from the local bridge adapter when transferring the funds. + event LiquidityTransferred( + uint64 indexed ocrSeqNum, + uint64 indexed fromChainSelector, + uint64 indexed toChainSelector, + address to, + uint256 amount, + bytes bridgeSpecificData, + bytes bridgeReturnData + ); + + /// @notice Emitted when liquidity is added to the local liquidity container. + /// @param provider The address of the provider that added the liquidity. + /// @param amount The amount of liquidity that was added. + event LiquidityAddedToContainer(address indexed provider, uint256 indexed amount); + + /// @notice Emitted when liquidity is removed from the local liquidity container. + /// @param remover The address of the remover that removed the liquidity. + /// @param amount The amount of liquidity that was removed. + event LiquidityRemovedFromContainer(address indexed remover, uint256 indexed amount); + + /// @notice Emitted when the local liquidity container is set. + /// @param newLiquidityContainer The address of the new liquidity container. + event LiquidityContainerSet(address indexed newLiquidityContainer); + + /// @notice Emitted when the minimum liquidity is set. + /// @param oldBalance The old minimum liquidity. + /// @param newBalance The new minimum liquidity. + event MinimumLiquiditySet(uint256 oldBalance, uint256 newBalance); + + /// @notice Emitted when someone sends native to this contract + /// @param amount The amount of native deposited + /// @param depositor The address that deposited the native + event NativeDeposited(uint256 amount, address depositor); + + /// @notice Emitted when native balance is withdrawn by contract owner + /// @param amount The amount of native withdrawn + /// @param destination The address the native is sent to + event NativeWithdrawn(uint256 amount, address destination); + + /// @notice Emitted when a cross chain rebalancer is set. + /// @param remoteChainSelector The chain selector of the remote chain. + /// @param localBridge The local bridge adapter that will be used to transfer funds. + /// @param remoteToken The address of the token on the remote chain. + /// @param remoteRebalancer The address of the remote rebalancer contract. + /// @param enabled Whether the rebalancer is enabled. + event CrossChainRebalancerSet( + uint64 indexed remoteChainSelector, + IBridgeAdapter localBridge, + address remoteToken, + address remoteRebalancer, + bool enabled + ); + + /// @notice Emitted when a finalization step fails. + /// @param ocrSeqNum The OCR sequence number of the report. + /// @param remoteChainSelector The chain selector of the remote chain funds are coming from. + /// @param bridgeSpecificData The bridge specific data that was used to finalize the transfer. + /// @param reason The reason the finalization failed. + event FinalizationFailed( + uint64 indexed ocrSeqNum, + uint64 indexed remoteChainSelector, + bytes bridgeSpecificData, + bytes reason + ); + + struct CrossChainRebalancer { + address remoteRebalancer; + IBridgeAdapter localBridge; + address remoteToken; + bool enabled; + } + + string public constant override typeAndVersion = "LiquidityManager 1.0.0-dev"; + + /// @notice The token that this pool manages liquidity for. + IERC20 public immutable i_localToken; + + /// @notice The chain selector belonging to the chain this pool is deployed on. + uint64 internal immutable i_localChainSelector; + + /// @notice The target balance defines the expected amount of tokens for this network. + /// Setting the balance to 0 will disable any automated rebalancing operations. + uint256 internal s_minimumLiquidity; + + /// @notice Mapping of chain selector to liquidity container on other chains + mapping(uint64 chainSelector => CrossChainRebalancer) private s_crossChainRebalancer; + + uint64[] private s_supportedDestChains; + + /// @notice The liquidity container on the local chain + /// @dev In the case of CCIP, this would be the token pool. + ILiquidityContainer private s_localLiquidityContainer; + + /// @notice The CLL finance team multisig + address private s_finance; + + constructor( + IERC20 token, + uint64 localChainSelector, + ILiquidityContainer localLiquidityContainer, + uint256 minimumLiquidity, + address finance + ) OCR3Base() { + if (localChainSelector == 0) { + revert ZeroChainSelector(); + } + + if (address(token) == address(0) || address(localLiquidityContainer) == address(0)) { + revert ZeroAddress(); + } + i_localToken = token; + i_localChainSelector = localChainSelector; + s_localLiquidityContainer = localLiquidityContainer; + s_minimumLiquidity = minimumLiquidity; + s_finance = finance; + } + + // ================================================================ + // │ Native Management │ + // ================================================================ + + receive() external payable { + emit NativeDeposited(msg.value, msg.sender); + } + + /// @notice withdraw native balance + function withdrawNative(uint256 amount, address payable destination) external onlyFinance { + (bool success, ) = destination.call{value: amount}(""); + if (!success) revert TransferFailed(); + + emit NativeWithdrawn(amount, destination); + } + + // ================================================================ + // │ Liquidity Management │ + // ================================================================ + + /// @inheritdoc ILiquidityManager + function getLiquidity() public view returns (uint256 currentLiquidity) { + return i_localToken.balanceOf(address(s_localLiquidityContainer)); + } + + /// @notice Adds liquidity to the multi-chain system. + /// @dev Anyone can call this function, but anyone other than the owner should regard + /// adding liquidity as a donation to the system, as there is no way to get it out. + /// This function is open to anyone to be able to quickly add funds to the system + /// without having to go through potentially complicated multisig schemes to do it from + /// the owner address. + function addLiquidity(uint256 amount) external { + i_localToken.safeTransferFrom(msg.sender, address(this), amount); + + // Make sure this is tether compatible, as they have strange approval requirements + // Should be good since all approvals are always immediately used. + i_localToken.safeApprove(address(s_localLiquidityContainer), amount); + s_localLiquidityContainer.provideLiquidity(amount); + + emit LiquidityAddedToContainer(msg.sender, amount); + } + + /// @notice Removes liquidity from the system and sends it to the caller, so the owner. + /// @dev Only the owner can call this function. + function removeLiquidity(uint256 amount) external onlyFinance { + uint256 currentBalance = getLiquidity(); + if (currentBalance < amount) { + revert InsufficientLiquidity(amount, currentBalance, 0); + } + + s_localLiquidityContainer.withdrawLiquidity(amount); + i_localToken.safeTransfer(msg.sender, amount); + + emit LiquidityRemovedFromContainer(msg.sender, amount); + } + + /// @notice escape hatch to manually withdraw any ERC20 token from the LM contract + /// @param token The address of the token to withdraw + /// @param amount The amount of tokens to withdraw + /// @param destination The address to send the tokens to + function withdrawERC20(address token, uint256 amount, address destination) external onlyFinance { + IERC20(token).safeTransfer(destination, amount); + } + + /// @notice Transfers liquidity to another chain. + /// @dev This function is a public version of the internal _rebalanceLiquidity function. + /// to allow the owner to also initiate a rebalancing when needed. + function rebalanceLiquidity( + uint64 chainSelector, + uint256 amount, + uint256 nativeBridgeFee, + bytes calldata bridgeSpecificPayload + ) external onlyFinance { + _rebalanceLiquidity(chainSelector, amount, nativeBridgeFee, type(uint64).max, bridgeSpecificPayload); + } + + /// @notice Finalizes liquidity from another chain. + /// @dev This function is a public version of the internal _receiveLiquidity function. + /// to allow the owner to also initiate a finalization when needed. + function receiveLiquidity( + uint64 remoteChainSelector, + uint256 amount, + bool shouldWrapNative, + bytes calldata bridgeSpecificPayload + ) external onlyFinance { + _receiveLiquidity(remoteChainSelector, amount, bridgeSpecificPayload, shouldWrapNative, type(uint64).max); + } + + /// @notice Transfers liquidity to another chain. + /// @dev Called by both the owner and the DON. + /// @param chainSelector The chain selector of the chain to transfer liquidity to. + /// @param tokenAmount The amount of tokens to transfer. + /// @param nativeBridgeFee The fee to pay to the bridge. + /// @param ocrSeqNum The OCR sequence number of the report. + /// @param bridgeSpecificPayload The bridge specific data to pass to the bridge adapter. + function _rebalanceLiquidity( + uint64 chainSelector, + uint256 tokenAmount, + uint256 nativeBridgeFee, + uint64 ocrSeqNum, + bytes memory bridgeSpecificPayload + ) internal { + uint256 currentBalance = getLiquidity(); + uint256 minBalance = s_minimumLiquidity; + if (currentBalance < minBalance || currentBalance - minBalance < tokenAmount) { + revert InsufficientLiquidity(tokenAmount, currentBalance, minBalance); + } + + CrossChainRebalancer memory remoteLiqManager = s_crossChainRebalancer[chainSelector]; + + if (!remoteLiqManager.enabled) { + revert InvalidRemoteChain(chainSelector); + } + + // XXX: Could be optimized by withdrawing once and then sending to all destinations + s_localLiquidityContainer.withdrawLiquidity(tokenAmount); + i_localToken.safeApprove(address(remoteLiqManager.localBridge), tokenAmount); + + bytes memory bridgeReturnData = remoteLiqManager.localBridge.sendERC20{value: nativeBridgeFee}( + address(i_localToken), + remoteLiqManager.remoteToken, + remoteLiqManager.remoteRebalancer, + tokenAmount, + bridgeSpecificPayload + ); + + emit LiquidityTransferred( + ocrSeqNum, + i_localChainSelector, + chainSelector, + remoteLiqManager.remoteRebalancer, + tokenAmount, + bridgeSpecificPayload, + bridgeReturnData + ); + } + + /// @notice Receives liquidity from another chain. + /// @dev Called by both the owner and the DON. + /// @param remoteChainSelector The chain selector of the chain to receive liquidity from. + /// @param amount The amount of tokens to receive. + /// @param bridgeSpecificPayload The bridge specific data to pass to the bridge adapter finalizeWithdrawERC20 call. + /// @param shouldWrapNative Whether the token should be wrapped before injecting it into the liquidity container. + /// This only applies to native tokens wrapper contracts, e.g WETH. + /// @param ocrSeqNum The OCR sequence number of the report. + function _receiveLiquidity( + uint64 remoteChainSelector, + uint256 amount, + bytes memory bridgeSpecificPayload, + bool shouldWrapNative, + uint64 ocrSeqNum + ) internal { + // check if the remote chain is supported + CrossChainRebalancer memory remoteRebalancer = s_crossChainRebalancer[remoteChainSelector]; + if (!remoteRebalancer.enabled) { + revert InvalidRemoteChain(remoteChainSelector); + } + + // finalize the withdrawal through the bridge adapter + try + remoteRebalancer.localBridge.finalizeWithdrawERC20( + remoteRebalancer.remoteRebalancer, // remoteSender: the remote rebalancer + address(this), // localReceiver: this contract + bridgeSpecificPayload + ) + returns (bool fundsAvailable) { + if (fundsAvailable) { + // finalization was successful and we can inject the liquidity into the container. + // approve and liquidity container should transferFrom. + _injectLiquidity(amount, ocrSeqNum, remoteChainSelector, bridgeSpecificPayload, shouldWrapNative); + } else { + // a finalization step was completed, but funds are not available. + // hence, we cannot inject any liquidity yet. + emit FinalizationStepCompleted(ocrSeqNum, remoteChainSelector, bridgeSpecificPayload); + } + + // return here on the happy path. + // sad path is when finalizeWithdrawERC20 reverts, which is handled after the catch block. + return; + } catch (bytes memory lowLevelData) { + // failed to finalize the withdrawal. + // this could mean that the withdrawal was already finalized + // or that the withdrawal failed. + // we assume the former and continue + emit FinalizationFailed(ocrSeqNum, remoteChainSelector, bridgeSpecificPayload, lowLevelData); + } + + // if we reach this point, the finalization failed. + // since we don't have enough information to know why it failed, + // we assume that it failed because the withdrawal was already finalized, + // and that the funds are available. + _injectLiquidity(amount, ocrSeqNum, remoteChainSelector, bridgeSpecificPayload, shouldWrapNative); + } + + /// @notice Injects liquidity into the local liquidity container. + /// @param amount The amount of tokens to inject. + /// @param ocrSeqNum The OCR sequence number of the report. + /// @param remoteChainSelector The chain selector of the remote chain. + /// @param bridgeSpecificPayload The bridge specific data passed to the bridge adapter finalizeWithdrawERC20 call. + /// @param shouldWrapNative Whether the token should be wrapped before injecting it into the liquidity container. + function _injectLiquidity( + uint256 amount, + uint64 ocrSeqNum, + uint64 remoteChainSelector, + bytes memory bridgeSpecificPayload, + bool shouldWrapNative + ) private { + // We trust the DON or the owner (the only two actors who can end up calling this function) + // to correctly set the shouldWrapNative flag. + // Some bridges only bridge native and not wrapped native. + // In such a case we need to re-wrap the native in order to inject it into the liquidity container. + // TODO: escape hatch in case of bug? + if (shouldWrapNative) { + IWrappedNative(address(i_localToken)).deposit{value: amount}(); + } + + i_localToken.safeIncreaseAllowance(address(s_localLiquidityContainer), amount); + s_localLiquidityContainer.provideLiquidity(amount); + + emit LiquidityTransferred( + ocrSeqNum, + remoteChainSelector, + i_localChainSelector, + address(this), + amount, + bridgeSpecificPayload, + bytes("") // no bridge return data when receiving + ); + } + + /// @notice Process the OCR report. + /// @dev Called by OCR3Base's transmit() function. + function _report(bytes calldata report, uint64 ocrSeqNum) internal override { + ILiquidityManager.LiquidityInstructions memory instructions = abi.decode( + report, + (ILiquidityManager.LiquidityInstructions) + ); + + uint256 sendInstructions = instructions.sendLiquidityParams.length; + uint256 receiveInstructions = instructions.receiveLiquidityParams.length; + + // There should always be instructions to send or receive, if not, the report is invalid + // and we revert to save the gas of the signature validation of OCR. + if (sendInstructions == 0 && receiveInstructions == 0) { + revert EmptyReport(); + } + + for (uint256 i = 0; i < sendInstructions; ++i) { + _rebalanceLiquidity( + instructions.sendLiquidityParams[i].remoteChainSelector, + instructions.sendLiquidityParams[i].amount, + instructions.sendLiquidityParams[i].nativeBridgeFee, + ocrSeqNum, + instructions.sendLiquidityParams[i].bridgeData + ); + } + + for (uint256 i = 0; i < receiveInstructions; ++i) { + _receiveLiquidity( + instructions.receiveLiquidityParams[i].remoteChainSelector, + instructions.receiveLiquidityParams[i].amount, + instructions.receiveLiquidityParams[i].bridgeData, + instructions.receiveLiquidityParams[i].shouldWrapNative, + ocrSeqNum + ); + } + } + + // ================================================================ + // │ Config │ + // ================================================================ + + function getSupportedDestChains() external view returns (uint64[] memory) { + return s_supportedDestChains; + } + + /// @notice Gets the cross chain liquidity manager + function getCrossChainRebalancer(uint64 chainSelector) external view returns (CrossChainRebalancer memory) { + return s_crossChainRebalancer[chainSelector]; + } + + /// @notice Gets all cross chain liquidity managers + /// @dev We don't care too much about gas since this function is intended for offchain usage. + function getAllCrossChainRebalancers() external view returns (CrossChainRebalancerArgs[] memory) { + uint256 numChains = s_supportedDestChains.length; + CrossChainRebalancerArgs[] memory managers = new CrossChainRebalancerArgs[](numChains); + for (uint256 i = 0; i < numChains; ++i) { + uint64 chainSelector = s_supportedDestChains[i]; + CrossChainRebalancer memory currentManager = s_crossChainRebalancer[chainSelector]; + managers[i] = CrossChainRebalancerArgs({ + remoteRebalancer: currentManager.remoteRebalancer, + localBridge: currentManager.localBridge, + remoteToken: currentManager.remoteToken, + remoteChainSelector: chainSelector, + enabled: currentManager.enabled + }); + } + + return managers; + } + + /// @notice Sets a list of cross chain liquidity managers. + /// @dev Will update the list of supported dest chains if the chain is new. + function setCrossChainRebalancers(CrossChainRebalancerArgs[] calldata crossChainRebalancers) external onlyOwner { + for (uint256 i = 0; i < crossChainRebalancers.length; ++i) { + _setCrossChainRebalancer(crossChainRebalancers[i]); + } + } + + function setCrossChainRebalancer(CrossChainRebalancerArgs calldata crossChainLiqManager) external onlyOwner { + _setCrossChainRebalancer(crossChainLiqManager); + } + + /// @notice Sets a single cross chain liquidity manager. + /// @dev Will update the list of supported dest chains if the chain is new. + function _setCrossChainRebalancer(CrossChainRebalancerArgs calldata crossChainLiqManager) internal { + if (crossChainLiqManager.remoteChainSelector == 0) { + revert ZeroChainSelector(); + } + + if ( + crossChainLiqManager.remoteRebalancer == address(0) || + address(crossChainLiqManager.localBridge) == address(0) || + crossChainLiqManager.remoteToken == address(0) + ) { + revert ZeroAddress(); + } + + // If the destination chain is new, add it to the list of supported chains + if (s_crossChainRebalancer[crossChainLiqManager.remoteChainSelector].remoteToken == address(0)) { + s_supportedDestChains.push(crossChainLiqManager.remoteChainSelector); + } + + s_crossChainRebalancer[crossChainLiqManager.remoteChainSelector] = CrossChainRebalancer({ + remoteRebalancer: crossChainLiqManager.remoteRebalancer, + localBridge: crossChainLiqManager.localBridge, + remoteToken: crossChainLiqManager.remoteToken, + enabled: crossChainLiqManager.enabled + }); + + emit CrossChainRebalancerSet( + crossChainLiqManager.remoteChainSelector, + crossChainLiqManager.localBridge, + crossChainLiqManager.remoteToken, + crossChainLiqManager.remoteRebalancer, + crossChainLiqManager.enabled + ); + } + + /// @notice Gets the local liquidity container. + function getLocalLiquidityContainer() external view returns (address) { + return address(s_localLiquidityContainer); + } + + /// @notice Sets the local liquidity container. + /// @dev Only the owner can call this function. + function setLocalLiquidityContainer(ILiquidityContainer localLiquidityContainer) external onlyOwner { + if (address(localLiquidityContainer) == address(0)) { + revert ZeroAddress(); + } + s_localLiquidityContainer = localLiquidityContainer; + + emit LiquidityContainerSet(address(localLiquidityContainer)); + } + + /// @notice Gets the target tokens balance. + function getMinimumLiquidity() external view returns (uint256) { + return s_minimumLiquidity; + } + + /// @notice Sets the target tokens balance. + /// @dev Only the owner can call this function. + function setMinimumLiquidity(uint256 minimumLiquidity) external onlyOwner { + uint256 oldLiquidity = s_minimumLiquidity; + s_minimumLiquidity = minimumLiquidity; + emit MinimumLiquiditySet(oldLiquidity, s_minimumLiquidity); + } + + /// @notice Gets the CLL finance team multisig address + function getFinanceRole() external view returns (address) { + return s_finance; + } + + /// @notice Sets the finance team multisig address + /// @dev Only the owner can call this function. + function setFinanceRole(address finance) external onlyOwner { + s_finance = finance; + emit FinanceRoleSet(finance); + } + + modifier onlyFinance() { + if (msg.sender != s_finance) revert OnlyFinanceRole(); + _; + } +} diff --git a/contracts/src/v0.8/liquiditymanager/bridge-adapters/ArbitrumL1BridgeAdapter.sol b/contracts/src/v0.8/liquiditymanager/bridge-adapters/ArbitrumL1BridgeAdapter.sol new file mode 100644 index 00000000000..9ab7376c273 --- /dev/null +++ b/contracts/src/v0.8/liquiditymanager/bridge-adapters/ArbitrumL1BridgeAdapter.sol @@ -0,0 +1,175 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {IBridgeAdapter} from "../interfaces/IBridge.sol"; + +import {IL1GatewayRouter} from "@arbitrum/token-bridge-contracts/contracts/tokenbridge/ethereum/gateway/IL1GatewayRouter.sol"; +import {IGatewayRouter} from "@arbitrum/token-bridge-contracts/contracts/tokenbridge/libraries/gateway/IGatewayRouter.sol"; +import {IERC20} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/IERC20.sol"; +import {SafeERC20} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/utils/SafeERC20.sol"; + +interface IOutbox { + /** + * @notice Executes a messages in an Outbox entry. + * @dev Reverts if dispute period hasn't expired, since the outbox entry + * is only created once the rollup confirms the respective assertion. + * @dev it is not possible to execute any L2-to-L1 transaction which contains data + * to a contract address without any code (as enforced by the Bridge contract). + * @param proof Merkle proof of message inclusion in send root + * @param index Merkle path to message + * @param l2Sender sender if original message (i.e., caller of ArbSys.sendTxToL1) + * @param to destination address for L1 contract call + * @param l2Block l2 block number at which sendTxToL1 call was made + * @param l1Block l1 block number at which sendTxToL1 call was made + * @param l2Timestamp l2 Timestamp at which sendTxToL1 call was made + * @param value wei in L1 message + * @param data abi-encoded L1 message data + */ + function executeTransaction( + bytes32[] calldata proof, + uint256 index, + address l2Sender, + address to, + uint256 l2Block, + uint256 l1Block, + uint256 l2Timestamp, + uint256 value, + bytes calldata data + ) external; +} + +/// @notice Arbitrum L1 Bridge adapter +/// @dev Auto unwraps and re-wraps wrapped eth in the bridge. +contract ArbitrumL1BridgeAdapter is IBridgeAdapter { + using SafeERC20 for IERC20; + + IL1GatewayRouter internal immutable i_l1GatewayRouter; + IOutbox internal immutable i_l1Outbox; + + error NoGatewayForToken(address token); + error Unimplemented(); + + constructor(IL1GatewayRouter l1GatewayRouter, IOutbox l1Outbox) { + if (address(l1GatewayRouter) == address(0) || address(l1Outbox) == address(0)) { + revert BridgeAddressCannotBeZero(); + } + i_l1GatewayRouter = l1GatewayRouter; + i_l1Outbox = l1Outbox; + } + + /// @dev these are parameters provided by the caller of the sendERC20 function + /// and must be determined offchain. + struct SendERC20Params { + uint256 gasLimit; + uint256 maxSubmissionCost; + uint256 maxFeePerGas; + } + + /// @inheritdoc IBridgeAdapter + function sendERC20( + address localToken, + address /* remoteToken */, + address recipient, + uint256 amount, + bytes calldata bridgeSpecificPayload + ) external payable override returns (bytes memory) { + // receive the token transfer from the msg.sender + IERC20(localToken).safeTransferFrom(msg.sender, address(this), amount); + + // Note: the gateway router could return 0x0 for the gateway address + // if that token is not yet registered + address gateway = IGatewayRouter(address(i_l1GatewayRouter)).getGateway(localToken); + if (gateway == address(0)) { + revert NoGatewayForToken(localToken); + } + + // approve the gateway to transfer the token amount sent to the adapter + IERC20(localToken).safeApprove(gateway, amount); + + SendERC20Params memory params = abi.decode(bridgeSpecificPayload, (SendERC20Params)); + + uint256 expectedMsgValue = (params.gasLimit * params.maxFeePerGas) + params.maxSubmissionCost; + if (msg.value < expectedMsgValue) { + revert MsgValueDoesNotMatchAmount(msg.value, expectedMsgValue); + } + + // The router will route the call to the gateway that we approved + // above. The gateway will then transfer the tokens to the L2. + // outboundTransferCustomRefund will return the abi encoded inbox sequence number + // which is 256 bits, so we can cap the return data to 256 bits. + bytes memory inboxSequenceNumber = i_l1GatewayRouter.outboundTransferCustomRefund{value: msg.value}( + localToken, + recipient, + recipient, + amount, + params.gasLimit, + params.maxFeePerGas, + abi.encode(params.maxSubmissionCost, bytes("")) + ); + + return inboxSequenceNumber; + } + + /// @dev This function is so that we can easily abi-encode the arbitrum-specific payload for the sendERC20 function. + function exposeSendERC20Params(SendERC20Params memory params) public pure {} + + /// @dev fees have to be determined offchain for arbitrum, therefore revert here to discourage usage. + function getBridgeFeeInNative() public pure override returns (uint256) { + revert Unimplemented(); + } + + /// @param proof Merkle proof of message inclusion in send root + /// @param index Merkle path to message + /// @param l2Sender sender if original message (i.e., caller of ArbSys.sendTxToL1) + /// @param to destination address for L1 contract call + /// @param l2Block l2 block number at which sendTxToL1 call was made + /// @param l1Block l1 block number at which sendTxToL1 call was made + /// @param l2Timestamp l2 Timestamp at which sendTxToL1 call was made + /// @param value wei in L1 message + /// @param data abi-encoded L1 message data + struct ArbitrumFinalizationPayload { + bytes32[] proof; + uint256 index; + address l2Sender; + address to; + uint256 l2Block; + uint256 l1Block; + uint256 l2Timestamp; + uint256 value; + bytes data; + } + + /// @dev This function is so that we can easily abi-encode the arbitrum-specific payload for the finalizeWithdrawERC20 function. + function exposeArbitrumFinalizationPayload(ArbitrumFinalizationPayload memory payload) public pure {} + + /// @notice Finalize an L2 -> L1 transfer. + /// Arbitrum finalizations are single-step, so we always return true. + /// Calls to this function will revert in two cases, 1) if the finalization payload is wrong, + /// i.e incorrect merkle proof, or index and 2) if the withdrawal was already finalized. + /// @return true iff the finalization does not revert. + function finalizeWithdrawERC20( + address /* remoteSender */, + address /* localReceiver */, + bytes calldata arbitrumFinalizationPayload + ) external override returns (bool) { + ArbitrumFinalizationPayload memory payload = abi.decode(arbitrumFinalizationPayload, (ArbitrumFinalizationPayload)); + i_l1Outbox.executeTransaction( + payload.proof, + payload.index, + payload.l2Sender, + payload.to, + payload.l2Block, + payload.l1Block, + payload.l2Timestamp, + payload.value, + payload.data + ); + return true; + } + + /// @notice Convenience function to get the L2 token address from the L1 token address. + /// @return The L2 token address for the given L1 token address. + function getL2Token(address l1Token) external view returns (address) { + return i_l1GatewayRouter.calculateL2TokenAddress(l1Token); + } +} diff --git a/contracts/src/v0.8/liquiditymanager/bridge-adapters/ArbitrumL2BridgeAdapter.sol b/contracts/src/v0.8/liquiditymanager/bridge-adapters/ArbitrumL2BridgeAdapter.sol new file mode 100644 index 00000000000..6ee97163f65 --- /dev/null +++ b/contracts/src/v0.8/liquiditymanager/bridge-adapters/ArbitrumL2BridgeAdapter.sol @@ -0,0 +1,78 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {IBridgeAdapter} from "../interfaces/IBridge.sol"; + +import {IERC20} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/IERC20.sol"; +import {SafeERC20} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/utils/SafeERC20.sol"; + +interface IArbSys { + function withdrawEth(address destination) external payable returns (uint256); +} + +interface IL2GatewayRouter { + function outboundTransfer( + address l1Token, + address to, + uint256 amount, + bytes calldata data + ) external payable returns (bytes memory); +} + +/// @notice Arbitrum L2 Bridge adapter +/// @dev Auto unwraps and re-wraps wrapped eth in the bridge. +contract ArbitrumL2BridgeAdapter is IBridgeAdapter { + using SafeERC20 for IERC20; + + IL2GatewayRouter internal immutable i_l2GatewayRouter; + // address internal immutable i_l1ERC20Gateway; + IArbSys internal constant ARB_SYS = IArbSys(address(0x64)); + + constructor(IL2GatewayRouter l2GatewayRouter) { + if (address(l2GatewayRouter) == address(0)) { + revert BridgeAddressCannotBeZero(); + } + i_l2GatewayRouter = l2GatewayRouter; + } + + /// @inheritdoc IBridgeAdapter + function sendERC20( + address localToken, + address remoteToken, + address recipient, + uint256 amount, + bytes calldata /* bridgeSpecificPayload */ + ) external payable override returns (bytes memory) { + if (msg.value != 0) { + revert MsgShouldNotContainValue(msg.value); + } + + IERC20(localToken).safeTransferFrom(msg.sender, address(this), amount); + + // the data returned is the unique id of the L2 to L1 transfer + // see https://github.com/OffchainLabs/token-bridge-contracts/blob/bf9ad3d7f25c0eaf0a5f89eec7a0a370833cea16/contracts/tokenbridge/arbitrum/gateway/L2ArbitrumGateway.sol#L169-L191 + // No approval needed, the bridge will burn the tokens from this contract. + bytes memory l2ToL1TxId = i_l2GatewayRouter.outboundTransfer(remoteToken, recipient, amount, bytes("")); + + return l2ToL1TxId; + } + + /// @notice No-op since L1 -> L2 transfers do not need finalization. + /// @return true always. + function finalizeWithdrawERC20( + address /* remoteSender */, + address /* localReceiver */, + bytes calldata /* bridgeSpecificPayload */ + ) external pure override returns (bool) { + return true; + } + + /// @notice There are no fees to bridge back to L1 + function getBridgeFeeInNative() external pure returns (uint256) { + return 0; + } + + function depositNativeToL1(address recipient) external payable { + ARB_SYS.withdrawEth{value: msg.value}(recipient); + } +} diff --git a/contracts/src/v0.8/liquiditymanager/bridge-adapters/OptimismL1BridgeAdapter.sol b/contracts/src/v0.8/liquiditymanager/bridge-adapters/OptimismL1BridgeAdapter.sol new file mode 100644 index 00000000000..6734c74bd8d --- /dev/null +++ b/contracts/src/v0.8/liquiditymanager/bridge-adapters/OptimismL1BridgeAdapter.sol @@ -0,0 +1,196 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {IBridgeAdapter} from "../interfaces/IBridge.sol"; +import {IWrappedNative} from "../../ccip/interfaces/IWrappedNative.sol"; +import {Types} from "../interfaces/optimism/Types.sol"; +import {IOptimismPortal} from "../interfaces/optimism/IOptimismPortal.sol"; + +import {IL1StandardBridge} from "@eth-optimism/contracts/L1/messaging/IL1StandardBridge.sol"; +import {IERC20} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/IERC20.sol"; +import {SafeERC20} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/utils/SafeERC20.sol"; + +/// @notice OptimismL1BridgeAdapter implements IBridgeAdapter for the Optimism L1<=>L2 bridge. +/// @dev L1 -> L2 deposits are done via the depositERC20To and depositETHTo functions on the L1StandardBridge. +/// The amount of gas provided for the transaction must be buffered - the Optimism SDK recommends a 20% buffer. +/// The Optimism Bridge implements 2-step withdrawals from L2 to L1. Once a withdrawal transaction is included +/// in the L2 chain, it must be proven on L1 before it can be finalized. There is a buffer between the transaction +/// being posted on L2 before it can be proven, and similarly, there is a buffer in the time it takes to prove +/// the transaction before it can be finalized. +/// See https://blog.oplabs.co/two-step-withdrawals/ for more details on this mechanism. +/// @dev We have to unwrap WETH into ether before depositing it to L2. Therefore this bridge adapter bridges +/// WETH to ether. The receiver on L2 must wrap the ether back into WETH. +contract OptimismL1BridgeAdapter is IBridgeAdapter { + using SafeERC20 for IERC20; + + /// @notice used when the action in the payload is invalid. + error InvalidFinalizationAction(); + + /// @notice Payload for proving a withdrawal from L2 on L1 via finalizeWithdrawERC20. + /// @param withdrawalTransaction The withdrawal transaction, see its docstring for more details. + /// @param l2OutputIndex The index of the output in the L2 block, or the dispute game index post fault proof upgrade. + /// @param outputRootProof The inclusion proof of the L2ToL1MessagePasser contract's storage root. + /// @param withdrawalProof The Merkle proof of the withdrawal key presence in the L2ToL1MessagePasser contract's state trie. + struct OptimismProveWithdrawalPayload { + Types.WithdrawalTransaction withdrawalTransaction; + uint256 l2OutputIndex; + Types.OutputRootProof outputRootProof; + bytes[] withdrawalProof; + } + + /// @notice Payload for finalizing a withdrawal from L2 on L1. + /// Note that the withdrawal must be proven first before it can be finalized. + /// @param withdrawalTransaction The withdrawal transaction, see its docstring for more details. + struct OptimismFinalizationPayload { + Types.WithdrawalTransaction withdrawalTransaction; + } + + /// @notice The action to take when finalizing a withdrawal. + /// Optimism implements two-step withdrawals, so we need to specify the action to take + /// each time the finalizeWithdrawERC20 function is called. + enum FinalizationAction { + ProveWithdrawal, + FinalizeWithdrawal + } + + /// @notice Payload for interacting with the finalizeWithdrawERC20 function. + /// Since Optimism has 2-step withdrawals, we cannot finalize and get the funds on L1 in the same transaction. + /// @param action The action to take; either ProveWithdrawal or FinalizeWithdrawal. + /// @param data The payload for the action. If ProveWithdrawal, it must be an abi-encoded OptimismProveWithdrawalPayload. + /// If FinalizeWithdrawal, it must be an abi-encoded OptimismFinalizationPayload. + struct FinalizeWithdrawERC20Payload { + FinalizationAction action; + bytes data; + } + + /// @dev Reference to the L1StandardBridge contract. Deposits to L2 go through this contract. + IL1StandardBridge internal immutable i_L1Bridge; + + /// @dev Reference to the WrappedNative contract. Optimism bridges ether directly rather than WETH, + /// so we need to unwrap WETH into ether before depositing it to L2. + IWrappedNative internal immutable i_wrappedNative; + + /// @dev Reference to the OptimismPortal contract, which is used to prove and finalize withdrawals. + IOptimismPortal internal immutable i_optimismPortal; + + /// @dev Nonce to use for L2 deposits to allow for better tracking offchain. + uint64 private s_nonce = 0; + + constructor(IL1StandardBridge l1Bridge, IWrappedNative wrappedNative, IOptimismPortal optimismPortal) { + if ( + address(l1Bridge) == address(0) || address(wrappedNative) == address(0) || address(optimismPortal) == address(0) + ) { + revert BridgeAddressCannotBeZero(); + } + i_L1Bridge = l1Bridge; + i_wrappedNative = wrappedNative; + i_optimismPortal = optimismPortal; + } + + /// @notice The WETH withdraw requires this be present otherwise withdraws will fail. + receive() external payable {} + + /// @inheritdoc IBridgeAdapter + function sendERC20( + address localToken, + address remoteToken, + address recipient, + uint256 amount, + bytes calldata /* bridgeSpecificPayload */ + ) external payable override returns (bytes memory) { + IERC20(localToken).safeTransferFrom(msg.sender, address(this), amount); + + if (msg.value != 0) { + revert MsgShouldNotContainValue(msg.value); + } + + // Extra data for the L2 deposit. + // We encode the nonce in the extra data so that we can track the L2 deposit offchain. + bytes memory extraData = abi.encode(s_nonce++); + + // If the token is the wrapped native, we unwrap it and deposit native + if (localToken == address(i_wrappedNative)) { + i_wrappedNative.withdraw(amount); + i_L1Bridge.depositETHTo{value: amount}(recipient, 0, extraData); + return extraData; + } + + // Token is a normal ERC20. + IERC20(localToken).safeApprove(address(i_L1Bridge), amount); + i_L1Bridge.depositERC20To(localToken, remoteToken, recipient, amount, 0, extraData); + + return extraData; + } + + /// @notice Bridging to Optimism is paid for with gas + /// @dev Since the gas amount charged is dynamic, the gas burn can change from block to block. + /// You should always add a buffer of at least 20% to the gas limit for your L1 to L2 transaction + /// to avoid running out of gas. + function getBridgeFeeInNative() public pure returns (uint256) { + return 0; + } + + /// @notice Prove or finalize an ERC20 withdrawal from L2. + /// The action to take is specified in the payload. See the docstring of FinalizeWithdrawERC20Payload for more details. + /// @param data The payload for the action. This is an abi.encode'd FinalizeWithdrawERC20Payload with the appropriate data. + /// @return true iff finalization is successful, and false for proving a withdrawal. If either of these fail, + /// the call to this function will revert. + function finalizeWithdrawERC20( + address /* remoteSender */, + address /* localReceiver */, + bytes calldata data + ) external override returns (bool) { + // decode the data into FinalizeWithdrawERC20Payload first and extract the action. + FinalizeWithdrawERC20Payload memory payload = abi.decode(data, (FinalizeWithdrawERC20Payload)); + if (payload.action == FinalizationAction.ProveWithdrawal) { + // The action being ProveWithdrawal indicates that this is a withdrawal proof payload. + // Decode the data into OptimismProveWithdrawalPayload and call the proveWithdrawal function. + OptimismProveWithdrawalPayload memory provePayload = abi.decode(payload.data, (OptimismProveWithdrawalPayload)); + _proveWithdrawal(provePayload); + return false; + } else if (payload.action == FinalizationAction.FinalizeWithdrawal) { + // decode the data into OptimismFinalizationPayload and call the finalizeWithdrawal function. + OptimismFinalizationPayload memory finalizePayload = abi.decode(payload.data, (OptimismFinalizationPayload)); + // NOTE: finalizing ether withdrawals will currently send ether to the receiver address as indicated by the + // withdrawal tx. However, this is problematic because we need to re-wrap it into WETH. + // However, we can't do that from within this adapter because it doesn't actually have the ether. + // So its up to the caller to rectify this by re-wrapping the ether. + _finalizeWithdrawal(finalizePayload); + return true; + } else { + revert InvalidFinalizationAction(); + } + } + + function _proveWithdrawal(OptimismProveWithdrawalPayload memory payload) internal { + // will revert if the proof is invalid or the output index is not yet included on L1. + i_optimismPortal.proveWithdrawalTransaction( + payload.withdrawalTransaction, + payload.l2OutputIndex, + payload.outputRootProof, + payload.withdrawalProof + ); + } + + function _finalizeWithdrawal(OptimismFinalizationPayload memory payload) internal { + i_optimismPortal.finalizeWithdrawalTransaction(payload.withdrawalTransaction); + } + + /// @notice returns the address of the WETH token used by this adapter. + /// @return the address of the WETH token used by this adapter. + function getWrappedNative() external view returns (address) { + return address(i_wrappedNative); + } + + /// @notice returns the address of the Optimism portal contract. + /// @return the address of the Optimism portal contract. + function getOptimismPortal() external view returns (address) { + return address(i_optimismPortal); + } + + /// @notice returns the address of the Optimism L1StandardBridge bridge contract. + /// @return the address of the Optimism L1StandardBridge bridge contract. + function getL1Bridge() external view returns (address) { + return address(i_L1Bridge); + } +} diff --git a/contracts/src/v0.8/liquiditymanager/bridge-adapters/OptimismL2BridgeAdapter.sol b/contracts/src/v0.8/liquiditymanager/bridge-adapters/OptimismL2BridgeAdapter.sol new file mode 100644 index 00000000000..fd1218f6704 --- /dev/null +++ b/contracts/src/v0.8/liquiditymanager/bridge-adapters/OptimismL2BridgeAdapter.sol @@ -0,0 +1,119 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {IBridgeAdapter} from "../interfaces/IBridge.sol"; +import {IWrappedNative} from "../../ccip/interfaces/IWrappedNative.sol"; + +import {Lib_PredeployAddresses} from "@eth-optimism/contracts/libraries/constants/Lib_PredeployAddresses.sol"; + +import {IERC20} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/IERC20.sol"; +import {SafeERC20} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/utils/SafeERC20.sol"; + +/// @dev copy/pasted from https://github.com/ethereum-optimism/optimism/blob/f707883038d527cbf1e9f8ea513fe33255deadbc/packages/contracts-bedrock/src/L2/L2StandardBridge.sol#L114-L122. +/// We can't import it because of hard pin solidity version in the pragma (0.8.15). +interface IL2StandardBridge { + /// @custom:legacy + /// @notice Initiates a withdrawal from L2 to L1 to a target account on L1. + /// Note that if ETH is sent to a contract on L1 and the call fails, then that ETH will + /// be locked in the L1StandardBridge. ETH may be recoverable if the call can be + /// successfully replayed by increasing the amount of gas supplied to the call. If the + /// call will fail for any amount of gas, then the ETH will be locked permanently. + /// This function only works with OptimismMintableERC20 tokens or ether. Use the + /// `bridgeERC20To` function to bridge native L2 tokens to L1. + /// @param _l2Token Address of the L2 token to withdraw. + /// @param _to Recipient account on L1. + /// @param _amount Amount of the L2 token to withdraw. + /// @param _minGasLimit Minimum gas limit to use for the transaction. + /// @param _extraData Extra data attached to the withdrawal. + function withdrawTo( + address _l2Token, + address _to, + uint256 _amount, + uint32 _minGasLimit, + bytes calldata _extraData + ) external payable; +} + +/// @notice OptimismL2BridgeAdapter implements IBridgeAdapter for the Optimism L2<=>L1 bridge. +/// @dev We have to unwrap WETH into ether before withdrawing it to L1. Therefore this bridge adapter bridges +/// WETH to ether. The receiver on L1 must wrap the ether back into WETH. +contract OptimismL2BridgeAdapter is IBridgeAdapter { + using SafeERC20 for IERC20; + + IL2StandardBridge internal immutable i_L2Bridge = IL2StandardBridge(Lib_PredeployAddresses.L2_STANDARD_BRIDGE); + IWrappedNative internal immutable i_wrappedNative; + + // Nonce to use for L1 withdrawals to allow for better tracking offchain. + uint64 private s_nonce = 0; + + constructor(IWrappedNative wrappedNative) { + // Wrapped native can be address zero, this means that auto-wrapping is disabled. + i_wrappedNative = wrappedNative; + } + + /// @notice The WETH withdraw requires this be present otherwise withdraws will fail. + receive() external payable {} + + /// @inheritdoc IBridgeAdapter + function sendERC20( + address localToken, + address /* remoteToken */, + address recipient, + uint256 amount, + bytes calldata /* bridgeSpecificPayload */ + ) external payable override returns (bytes memory) { + if (msg.value != 0) { + revert MsgShouldNotContainValue(msg.value); + } + + IERC20(localToken).safeTransferFrom(msg.sender, address(this), amount); + + // Extra data for the L2 withdraw. + // We encode the nonce in the extra data so that we can track the L2 withdraw offchain. + bytes memory extraData = abi.encode(s_nonce++); + + // If the token is the wrapped native, we unwrap it and withdraw native + if (localToken == address(i_wrappedNative)) { + i_wrappedNative.withdraw(amount); + // XXX: Lib_PredeployAddresses.OVM_ETH is actually 0xDeadDeAddeAddEAddeadDEaDDEAdDeaDDeAD0000. + // This code path still works because the L2 bridge is hardcoded to handle this specific address. + // The better approach might be to use the bridgeEthTo function, which is on the StandardBridge + // abstract contract, inherited by both L1StandardBridge and L2StandardBridge. + // This is also marked as legacy, so it might mean that this will be deprecated soon. + i_L2Bridge.withdrawTo{value: amount}(Lib_PredeployAddresses.OVM_ETH, recipient, amount, 0, extraData); + return extraData; + } + + // Token is normal ERC20 + IERC20(localToken).approve(address(i_L2Bridge), amount); + i_L2Bridge.withdrawTo(localToken, recipient, amount, 0, extraData); + return extraData; + } + + /// @notice No-op since L1 -> L2 transfers do not need finalization. + /// @return true always. + function finalizeWithdrawERC20( + address /* remoteSender */, + address /* localReceiver */, + bytes calldata /* bridgeSpecificPayload */ + ) external pure override returns (bool) { + return true; + } + + /// @notice There are no fees to bridge back to L1 + function getBridgeFeeInNative() external pure returns (uint256) { + return 0; + } + + /// @notice returns the address of the WETH token used by this adapter. + /// @return the address of the WETH token used by this adapter. + function getWrappedNative() external view returns (address) { + return address(i_wrappedNative); + } + + /// @notice returns the address of the L2 bridge used by this adapter. + /// @return the address of the L2 bridge used by this adapter. + function getL2Bridge() external view returns (address) { + return address(i_L2Bridge); + } +} diff --git a/contracts/src/v0.8/liquiditymanager/encoders/OptimismL1BridgeAdapterEncoder.sol b/contracts/src/v0.8/liquiditymanager/encoders/OptimismL1BridgeAdapterEncoder.sol new file mode 100644 index 00000000000..888b48732d7 --- /dev/null +++ b/contracts/src/v0.8/liquiditymanager/encoders/OptimismL1BridgeAdapterEncoder.sol @@ -0,0 +1,21 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {OptimismL1BridgeAdapter} from "../bridge-adapters/OptimismL1BridgeAdapter.sol"; + +/// @dev to generate abi's for the OptimismL1BridgeAdapter's various payload types. +/// @dev for usage examples see core/scripts/ccip/liquiditymanager/opstack/prove_withdrawal.go +/// @dev or core/scripts/ccip/liquiditymanager/opstack/finalize.go. +abstract contract OptimismL1BridgeAdapterEncoder { + function encodeFinalizeWithdrawalERC20Payload( + OptimismL1BridgeAdapter.FinalizeWithdrawERC20Payload memory payload + ) public pure {} + + function encodeOptimismProveWithdrawalPayload( + OptimismL1BridgeAdapter.OptimismProveWithdrawalPayload memory payload + ) public pure {} + + function encodeOptimismFinalizationPayload( + OptimismL1BridgeAdapter.OptimismFinalizationPayload memory payload + ) public pure {} +} diff --git a/contracts/src/v0.8/liquiditymanager/interfaces/IBridge.sol b/contracts/src/v0.8/liquiditymanager/interfaces/IBridge.sol new file mode 100644 index 00000000000..83e64edce48 --- /dev/null +++ b/contracts/src/v0.8/liquiditymanager/interfaces/IBridge.sol @@ -0,0 +1,49 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.0; + +/// @dev IBridgeAdapter provides a common interface to interact with the native bridge. +interface IBridgeAdapter { + error BridgeAddressCannotBeZero(); + error MsgValueDoesNotMatchAmount(uint256 msgValue, uint256 amount); + error InsufficientEthValue(uint256 wanted, uint256 got); + error MsgShouldNotContainValue(uint256 value); + + /// @notice Send the specified amount of the local token cross-chain to the remote chain. + /// The tokens on the remote chain will then be sourced from the remoteToken address. + /// The amount to be sent must be approved by the caller beforehand on the localToken contract. + /// The caller must provide the bridging fee in native currency, i.e msg.value. + /// @param localToken The address of the local ERC-20 token. + /// @param remoteToken The address of the remote ERC-20 token. + /// @param recipient The address of the recipient on the remote chain. + /// @param amount The amount of the local token to send. + /// @param bridgeSpecificPayload The payload of the cross-chain transfer. Bridge-specific. + function sendERC20( + address localToken, + address remoteToken, + address recipient, + uint256 amount, + bytes calldata bridgeSpecificPayload + ) external payable returns (bytes memory); + + /// @notice Get the bridging fee in native currency. This fee must be provided upon sending tokens via + /// the sendERC20 function. + /// @return The bridging fee in native currency. + function getBridgeFeeInNative() external view returns (uint256); + + /// @notice Finalize the withdrawal of a cross-chain transfer. + /// Not all implementations will finalize a transfer in a single call to this function. + /// Optimism, for example, requires a two-step process to finalize a transfer. The first + /// step requires proving the withdrawal that occurred on L2 on L1. The second step is then + /// the finalization, whereby funds become available to the recipient. So, in that particular + /// scenario, `false` is returned from `finalizeWithdrawERC20` when the first step is completed, + /// and `true` is returned when the second step is completed. + /// @param remoteSender The address of the sender on the remote chain. + /// @param localReceiver The address of the receiver on the local chain. + /// @param bridgeSpecificPayload The payload of the cross-chain transfer, bridge-specific, i.e a proof of some kind. + /// @return true iff the funds are available, false otherwise. + function finalizeWithdrawERC20( + address remoteSender, + address localReceiver, + bytes calldata bridgeSpecificPayload + ) external returns (bool); +} diff --git a/contracts/src/v0.8/liquiditymanager/interfaces/ILiquidityContainer.sol b/contracts/src/v0.8/liquiditymanager/interfaces/ILiquidityContainer.sol new file mode 100644 index 00000000000..062325d9531 --- /dev/null +++ b/contracts/src/v0.8/liquiditymanager/interfaces/ILiquidityContainer.sol @@ -0,0 +1,16 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.0; + +/// @notice Interface for a liquidity container, this can be a CCIP token pool. +interface ILiquidityContainer { + event LiquidityAdded(address indexed provider, uint256 indexed amount); + event LiquidityRemoved(address indexed provider, uint256 indexed amount); + + /// @notice Provide additional liquidity to the container. + /// @dev Should emit LiquidityAdded + function provideLiquidity(uint256 amount) external; + + /// @notice Withdraws liquidity from the container to the msg sender + /// @dev Should emit LiquidityRemoved + function withdrawLiquidity(uint256 amount) external; +} diff --git a/contracts/src/v0.8/liquiditymanager/interfaces/ILiquidityManager.sol b/contracts/src/v0.8/liquiditymanager/interfaces/ILiquidityManager.sol new file mode 100644 index 00000000000..19fd1014a4d --- /dev/null +++ b/contracts/src/v0.8/liquiditymanager/interfaces/ILiquidityManager.sol @@ -0,0 +1,62 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.0; + +import {IBridgeAdapter} from "./IBridge.sol"; + +interface ILiquidityManager { + /// @notice Parameters for sending liquidity to a remote chain. + /// @param amount The amount of tokens to be sent to the remote chain. + /// @param nativeBridgeFee The amount of native that should be sent by the liquiditymanager in the sendERC20 call. + /// Used to pay for the bridge fees. + /// @param remoteChainSelector The selector of the remote chain. + /// @param bridgeData The bridge data that should be passed to the sendERC20 call. + struct SendLiquidityParams { + uint256 amount; + uint256 nativeBridgeFee; + uint64 remoteChainSelector; + bytes bridgeData; + } + + /// @notice Parameters for receiving liquidity from a remote chain. + /// @param amount The amount of tokens to be received from the remote chain. + /// @param remoteChainSelector The selector of the remote chain. + /// @param bridgeData The bridge data that should be passed to the finalizeWithdrawERC20 call. + /// @param shouldWrapNative Whether the received native token should be wrapped into wrapped native. + /// This is needed for when the bridge being used doesn't bridge wrapped native but native directly. + struct ReceiveLiquidityParams { + uint256 amount; + uint64 remoteChainSelector; + bool shouldWrapNative; + bytes bridgeData; + } + + /// @notice Instructions for the rebalancer on what to do with the available liquidity. + /// @param sendLiquidityParams The parameters for sending liquidity to a remote chain. + /// @param receiveLiquidityParams The parameters for receiving liquidity from a remote chain. + struct LiquidityInstructions { + SendLiquidityParams[] sendLiquidityParams; + ReceiveLiquidityParams[] receiveLiquidityParams; + } + + /// @notice Parameters for adding a cross-chain rebalancer. + /// @param remoteRebalancer The address of the remote rebalancer. + /// @param localBridge The local bridge adapter address. + /// @param remoteToken The address of the remote token. + /// @param remoteChainSelector The selector of the remote chain. + /// @param enabled Whether the rebalancer is enabled. + struct CrossChainRebalancerArgs { + address remoteRebalancer; + IBridgeAdapter localBridge; + address remoteToken; + uint64 remoteChainSelector; + bool enabled; + } + + /// @notice Returns the current liquidity in the liquidity container. + /// @return currentLiquidity The current liquidity in the liquidity container. + function getLiquidity() external view returns (uint256 currentLiquidity); + + /// @notice Returns all the cross-chain rebalancers. + /// @return All the cross-chain rebalancers. + function getAllCrossChainRebalancers() external view returns (CrossChainRebalancerArgs[] memory); +} diff --git a/contracts/src/v0.8/liquiditymanager/interfaces/arbitrum/IAbstractArbitrumTokenGateway.sol b/contracts/src/v0.8/liquiditymanager/interfaces/arbitrum/IAbstractArbitrumTokenGateway.sol new file mode 100644 index 00000000000..c695729fa93 --- /dev/null +++ b/contracts/src/v0.8/liquiditymanager/interfaces/arbitrum/IAbstractArbitrumTokenGateway.sol @@ -0,0 +1,7 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.0; + +import {TokenGateway} from "@arbitrum/token-bridge-contracts/contracts/tokenbridge/libraries/gateway/TokenGateway.sol"; + +/// @dev to generate gethwrappers +abstract contract IAbstractArbitrumTokenGateway is TokenGateway {} diff --git a/contracts/src/v0.8/liquiditymanager/interfaces/arbitrum/IArbRollupCore.sol b/contracts/src/v0.8/liquiditymanager/interfaces/arbitrum/IArbRollupCore.sol new file mode 100644 index 00000000000..a5d0e5e8e6a --- /dev/null +++ b/contracts/src/v0.8/liquiditymanager/interfaces/arbitrum/IArbRollupCore.sol @@ -0,0 +1,7 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.0; + +import {IRollupCore} from "@arbitrum/nitro-contracts/src/rollup/IRollupCore.sol"; + +/// @dev to generate gethwrappers +interface IArbRollupCore is IRollupCore {} diff --git a/contracts/src/v0.8/liquiditymanager/interfaces/arbitrum/IArbSys.sol b/contracts/src/v0.8/liquiditymanager/interfaces/arbitrum/IArbSys.sol new file mode 100644 index 00000000000..7d6afbc18e4 --- /dev/null +++ b/contracts/src/v0.8/liquiditymanager/interfaces/arbitrum/IArbSys.sol @@ -0,0 +1,7 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.0; + +import {ArbSys} from "../../../vendor/@arbitrum/nitro-contracts/src/precompiles/ArbSys.sol"; + +/// @dev to generate gethwrappers +interface IArbSys is ArbSys {} diff --git a/contracts/src/v0.8/liquiditymanager/interfaces/arbitrum/IArbitrumGatewayRouter.sol b/contracts/src/v0.8/liquiditymanager/interfaces/arbitrum/IArbitrumGatewayRouter.sol new file mode 100644 index 00000000000..81fc2cb1b5e --- /dev/null +++ b/contracts/src/v0.8/liquiditymanager/interfaces/arbitrum/IArbitrumGatewayRouter.sol @@ -0,0 +1,7 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.0; + +import {IGatewayRouter} from "@arbitrum/token-bridge-contracts/contracts/tokenbridge/libraries/gateway/IGatewayRouter.sol"; + +/// @dev to generate gethwrappers +interface IArbitrumGatewayRouter is IGatewayRouter {} diff --git a/contracts/src/v0.8/liquiditymanager/interfaces/arbitrum/IArbitrumInbox.sol b/contracts/src/v0.8/liquiditymanager/interfaces/arbitrum/IArbitrumInbox.sol new file mode 100644 index 00000000000..a306ef21b1a --- /dev/null +++ b/contracts/src/v0.8/liquiditymanager/interfaces/arbitrum/IArbitrumInbox.sol @@ -0,0 +1,7 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.0; + +import {IInboxBase} from "@arbitrum/nitro-contracts/src/bridge/IInboxBase.sol"; + +/// @dev to generate gethwrappers +interface IArbitrumInbox is IInboxBase {} diff --git a/contracts/src/v0.8/liquiditymanager/interfaces/arbitrum/IArbitrumL1GatewayRouter.sol b/contracts/src/v0.8/liquiditymanager/interfaces/arbitrum/IArbitrumL1GatewayRouter.sol new file mode 100644 index 00000000000..49e7e45dd7d --- /dev/null +++ b/contracts/src/v0.8/liquiditymanager/interfaces/arbitrum/IArbitrumL1GatewayRouter.sol @@ -0,0 +1,7 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.0; + +import {IL1GatewayRouter} from "@arbitrum/token-bridge-contracts/contracts/tokenbridge/ethereum/gateway/IL1GatewayRouter.sol"; + +/// @dev to generate gethwrappers +interface IArbitrumL1GatewayRouter is IL1GatewayRouter {} diff --git a/contracts/src/v0.8/liquiditymanager/interfaces/arbitrum/IArbitrumTokenGateway.sol b/contracts/src/v0.8/liquiditymanager/interfaces/arbitrum/IArbitrumTokenGateway.sol new file mode 100644 index 00000000000..0c1f2281890 --- /dev/null +++ b/contracts/src/v0.8/liquiditymanager/interfaces/arbitrum/IArbitrumTokenGateway.sol @@ -0,0 +1,7 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.0; + +import {ITokenGateway} from "@arbitrum/token-bridge-contracts/contracts/tokenbridge/libraries/gateway/ITokenGateway.sol"; + +/// @dev to generate gethwrappers +interface IArbitrumTokenGateway is ITokenGateway {} diff --git a/contracts/src/v0.8/liquiditymanager/interfaces/arbitrum/IL2ArbitrumGateway.sol b/contracts/src/v0.8/liquiditymanager/interfaces/arbitrum/IL2ArbitrumGateway.sol new file mode 100644 index 00000000000..96a63a0dcd0 --- /dev/null +++ b/contracts/src/v0.8/liquiditymanager/interfaces/arbitrum/IL2ArbitrumGateway.sol @@ -0,0 +1,7 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.0; + +import {L2ArbitrumGateway} from "@arbitrum/token-bridge-contracts/contracts/tokenbridge/arbitrum/gateway/L2ArbitrumGateway.sol"; + +/// @dev to generate gethwrappers +abstract contract IL2ArbitrumGateway is L2ArbitrumGateway {} diff --git a/contracts/src/v0.8/liquiditymanager/interfaces/arbitrum/IL2ArbitrumMessenger.sol b/contracts/src/v0.8/liquiditymanager/interfaces/arbitrum/IL2ArbitrumMessenger.sol new file mode 100644 index 00000000000..115882a2115 --- /dev/null +++ b/contracts/src/v0.8/liquiditymanager/interfaces/arbitrum/IL2ArbitrumMessenger.sol @@ -0,0 +1,7 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.0; + +import {L2ArbitrumMessenger} from "@arbitrum/token-bridge-contracts/contracts/tokenbridge/arbitrum/L2ArbitrumMessenger.sol"; + +/// @dev to generate gethwrappers +abstract contract IL2ArbitrumMessenger is L2ArbitrumMessenger {} diff --git a/contracts/src/v0.8/liquiditymanager/interfaces/arbitrum/INodeInterface.sol b/contracts/src/v0.8/liquiditymanager/interfaces/arbitrum/INodeInterface.sol new file mode 100644 index 00000000000..79475cdf5d1 --- /dev/null +++ b/contracts/src/v0.8/liquiditymanager/interfaces/arbitrum/INodeInterface.sol @@ -0,0 +1,7 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.0; + +import {NodeInterface} from "@arbitrum/nitro-contracts/src/node-interface/NodeInterface.sol"; + +/// @dev to generate gethwrappers +interface INodeInterface is NodeInterface {} diff --git a/contracts/src/v0.8/liquiditymanager/interfaces/optimism/DisputeTypes.sol b/contracts/src/v0.8/liquiditymanager/interfaces/optimism/DisputeTypes.sol new file mode 100644 index 00000000000..f0bd99fbcde --- /dev/null +++ b/contracts/src/v0.8/liquiditymanager/interfaces/optimism/DisputeTypes.sol @@ -0,0 +1,23 @@ +// SPDX-License-Identifier: MIT +// Copied from https://github.com/ethereum-optimism/optimism/blob/v1.7.0/packages/contracts-bedrock/src/libraries/DisputeTypes.sol +pragma solidity ^0.8.0; + +/// @notice A `GameType` represents the type of game being played. +type GameType is uint32; + +/// @notice A `GameId` represents a packed 1 byte game ID, an 11 byte timestamp, and a 20 byte address. +/// @dev The packed layout of this type is as follows: +/// ┌───────────┬───────────┐ +/// │ Bits │ Value │ +/// ├───────────┼───────────┤ +/// │ [0, 8) │ Game Type │ +/// │ [8, 96) │ Timestamp │ +/// │ [96, 256) │ Address │ +/// └───────────┴───────────┘ +type GameId is bytes32; + +/// @notice A dedicated timestamp type. +type Timestamp is uint64; + +/// @notice A claim represents an MPT root representing the state of the fault proof program. +type Claim is bytes32; diff --git a/contracts/src/v0.8/liquiditymanager/interfaces/optimism/IOptimismCrossDomainMessenger.sol b/contracts/src/v0.8/liquiditymanager/interfaces/optimism/IOptimismCrossDomainMessenger.sol new file mode 100644 index 00000000000..2b5cc650724 --- /dev/null +++ b/contracts/src/v0.8/liquiditymanager/interfaces/optimism/IOptimismCrossDomainMessenger.sol @@ -0,0 +1,31 @@ +// SPDX-License-Identifier: MIT +// Copied from https://github.com/ethereum-optimism/optimism/blob/f707883038d527cbf1e9f8ea513fe33255deadbc/packages/contracts-bedrock/src/universal/CrossDomainMessenger.sol#L153 +pragma solidity ^0.8.0; + +interface IOptimismCrossDomainMessenger { + /// @notice Emitted whenever a message is sent to the other chain. + /// @param target Address of the recipient of the message. + /// @param sender Address of the sender of the message. + /// @param message Message to trigger the recipient address with. + /// @param messageNonce Unique nonce attached to the message. + /// @param gasLimit Minimum gas limit that the message can be executed with. + event SentMessage(address indexed target, address sender, bytes message, uint256 messageNonce, uint256 gasLimit); + + /// @notice Relays a message that was sent by the other CrossDomainMessenger contract. Can only + /// be executed via cross-chain call from the other messenger OR if the message was + /// already received once and is currently being replayed. + /// @param _nonce Nonce of the message being relayed. + /// @param _sender Address of the user who sent the message. + /// @param _target Address that the message is targeted at. + /// @param _value ETH value to send with the message. + /// @param _minGasLimit Minimum amount of gas that the message can be executed with. + /// @param _message Message to send to the target. + function relayMessage( + uint256 _nonce, + address _sender, + address _target, + uint256 _value, + uint256 _minGasLimit, + bytes calldata _message + ) external payable; +} diff --git a/contracts/src/v0.8/liquiditymanager/interfaces/optimism/IOptimismDisputeGameFactory.sol b/contracts/src/v0.8/liquiditymanager/interfaces/optimism/IOptimismDisputeGameFactory.sol new file mode 100644 index 00000000000..f72e6456d3f --- /dev/null +++ b/contracts/src/v0.8/liquiditymanager/interfaces/optimism/IOptimismDisputeGameFactory.sol @@ -0,0 +1,31 @@ +// SPDX-License-Identifier: MIT +// Copied from https://github.com/ethereum-optimism/optimism/blob/v1.7.0/packages/contracts-bedrock/src/dispute/DisputeGameFactory.sol +pragma solidity ^0.8.0; + +import {GameType, GameId, Timestamp, Claim} from "./DisputeTypes.sol"; + +interface IOptimismDisputeGameFactory { + /// @notice Information about a dispute game found in a `findLatestGames` search. + struct GameSearchResult { + uint256 index; + GameId metadata; + Timestamp timestamp; + Claim rootClaim; + bytes extraData; + } + + /// @notice Finds the `_n` most recent `GameId`'s of type `_gameType` starting at `_start`. If there are less than + /// `_n` games of type `_gameType` starting at `_start`, then the returned array will be shorter than `_n`. + /// @param _gameType The type of game to find. + /// @param _start The index to start the reverse search from. + /// @param _n The number of games to find. + function findLatestGames( + GameType _gameType, + uint256 _start, + uint256 _n + ) external view returns (GameSearchResult[] memory games_); + + /// @notice The total number of dispute games created by this factory. + /// @return gameCount_ The total number of dispute games created by this factory. + function gameCount() external view returns (uint256 gameCount_); +} diff --git a/contracts/src/v0.8/liquiditymanager/interfaces/optimism/IOptimismL1StandardBridge.sol b/contracts/src/v0.8/liquiditymanager/interfaces/optimism/IOptimismL1StandardBridge.sol new file mode 100644 index 00000000000..3a518fcf798 --- /dev/null +++ b/contracts/src/v0.8/liquiditymanager/interfaces/optimism/IOptimismL1StandardBridge.sol @@ -0,0 +1,18 @@ +// SPDX-License-Identifier: MIT +// Copied from https://github.com/ethereum-optimism/optimism/blob/f707883038d527cbf1e9f8ea513fe33255deadbc/packages/contracts-bedrock/src/L1/L1StandardBridge.sol +pragma solidity ^0.8.0; + +interface IOptimismL1StandardBridge { + /// @custom:legacy + /// @notice Deposits some amount of ETH into a target account on L2. + /// Note that if ETH is sent to a contract on L2 and the call fails, then that ETH will + /// be locked in the L2StandardBridge. ETH may be recoverable if the call can be + /// successfully replayed by increasing the amount of gas supplied to the call. If the + /// call will fail for any amount of gas, then the ETH will be locked permanently. + /// @param _to Address of the recipient on L2. + /// @param _minGasLimit Minimum gas limit for the deposit message on L2. + /// @param _extraData Optional data to forward to L2. + /// Data supplied here will not be used to execute any code on L2 and is + /// only emitted as extra data for the convenience of off-chain tooling. + function depositETHTo(address _to, uint32 _minGasLimit, bytes calldata _extraData) external payable; +} diff --git a/contracts/src/v0.8/liquiditymanager/interfaces/optimism/IOptimismL2OutputOracle.sol b/contracts/src/v0.8/liquiditymanager/interfaces/optimism/IOptimismL2OutputOracle.sol new file mode 100644 index 00000000000..fa36863c5b7 --- /dev/null +++ b/contracts/src/v0.8/liquiditymanager/interfaces/optimism/IOptimismL2OutputOracle.sol @@ -0,0 +1,19 @@ +// SPDX-License-Identifier: MIT +// Copied from https://github.com/ethereum-optimism/optimism/blob/v1.7.0/packages/contracts-bedrock/src/L1/L2OutputOracle.sol +pragma solidity ^0.8.0; + +import {Types} from "./Types.sol"; + +interface IOptimismL2OutputOracle { + /// @notice Returns the index of the L2 output that checkpoints a given L2 block number. + /// Uses a binary search to find the first output greater than or equal to the given + /// block. + /// @param _l2BlockNumber L2 block number to find a checkpoint for. + /// @return Index of the first checkpoint that commits to the given L2 block number. + function getL2OutputIndexAfter(uint256 _l2BlockNumber) external view returns (uint256); + + /// @notice Returns an output by index. Needed to return a struct instead of a tuple. + /// @param _l2OutputIndex Index of the output to return. + /// @return The output at the given index. + function getL2Output(uint256 _l2OutputIndex) external view returns (Types.OutputProposal memory); +} diff --git a/contracts/src/v0.8/liquiditymanager/interfaces/optimism/IOptimismL2ToL1MessagePasser.sol b/contracts/src/v0.8/liquiditymanager/interfaces/optimism/IOptimismL2ToL1MessagePasser.sol new file mode 100644 index 00000000000..9ac6aebfb28 --- /dev/null +++ b/contracts/src/v0.8/liquiditymanager/interfaces/optimism/IOptimismL2ToL1MessagePasser.sol @@ -0,0 +1,23 @@ +// SPDX-License-Identifier: MIT +// Copied from https://github.com/ethereum-optimism/optimism/blob/v1.7.0/packages/contracts-bedrock/src/L2/L2ToL1MessagePasser.sol +pragma solidity ^0.8.0; + +interface IOptimismL2ToL1MessagePasser { + /// @notice Emitted any time a withdrawal is initiated. + /// @param nonce Unique value corresponding to each withdrawal. + /// @param sender The L2 account address which initiated the withdrawal. + /// @param target The L1 account address the call will be send to. + /// @param value The ETH value submitted for withdrawal, to be forwarded to the target. + /// @param gasLimit The minimum amount of gas that must be provided when withdrawing. + /// @param data The data to be forwarded to the target on L1. + /// @param withdrawalHash The hash of the withdrawal. + event MessagePassed( + uint256 indexed nonce, + address indexed sender, + address indexed target, + uint256 value, + uint256 gasLimit, + bytes data, + bytes32 withdrawalHash + ); +} diff --git a/contracts/src/v0.8/liquiditymanager/interfaces/optimism/IOptimismPortal.sol b/contracts/src/v0.8/liquiditymanager/interfaces/optimism/IOptimismPortal.sol new file mode 100644 index 00000000000..887025bac75 --- /dev/null +++ b/contracts/src/v0.8/liquiditymanager/interfaces/optimism/IOptimismPortal.sol @@ -0,0 +1,26 @@ +// SPDX-License-Identifier: MIT +// Copied from https://github.com/ethereum-optimism/optimism/blob/v1.7.0/packages/contracts-bedrock/src/L1/OptimismPortal.sol +pragma solidity ^0.8.0; + +import {Types} from "./Types.sol"; + +interface IOptimismPortal { + /// @notice Semantic version. + function version() external view returns (string memory); + + /// @notice Proves a withdrawal transaction. + /// @param _tx Withdrawal transaction to finalize. + /// @param _l2OutputIndex L2 output index to prove against. + /// @param _outputRootProof Inclusion proof of the L2ToL1MessagePasser contract's storage root. + /// @param _withdrawalProof Inclusion proof of the withdrawal in L2ToL1MessagePasser contract. + function proveWithdrawalTransaction( + Types.WithdrawalTransaction memory _tx, + uint256 _l2OutputIndex, + Types.OutputRootProof calldata _outputRootProof, + bytes[] calldata _withdrawalProof + ) external; + + /// @notice Finalizes a withdrawal transaction. + /// @param _tx Withdrawal transaction to finalize. + function finalizeWithdrawalTransaction(Types.WithdrawalTransaction memory _tx) external; +} diff --git a/contracts/src/v0.8/liquiditymanager/interfaces/optimism/IOptimismPortal2.sol b/contracts/src/v0.8/liquiditymanager/interfaces/optimism/IOptimismPortal2.sol new file mode 100644 index 00000000000..165922b5aae --- /dev/null +++ b/contracts/src/v0.8/liquiditymanager/interfaces/optimism/IOptimismPortal2.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: MIT +// Copied from https://github.com/ethereum-optimism/optimism/blob/v1.7.0/packages/contracts-bedrock/src/L1/OptimismPortal2.sol +pragma solidity ^0.8.0; +import {GameType} from "./DisputeTypes.sol"; + +interface IOptimismPortal2 { + /// @notice The dispute game factory address. + /// @dev See https://github.com/ethereum-optimism/optimism/blob/f707883038d527cbf1e9f8ea513fe33255deadbc/packages/contracts-bedrock/src/L1/OptimismPortal2.sol#L79. + function disputeGameFactory() external view returns (address); + /// @notice The game type that the OptimismPortal consults for output proposals. + function respectedGameType() external view returns (GameType); +} diff --git a/contracts/src/v0.8/liquiditymanager/interfaces/optimism/IOptimismStandardBridge.sol b/contracts/src/v0.8/liquiditymanager/interfaces/optimism/IOptimismStandardBridge.sol new file mode 100644 index 00000000000..2f9ef91d7c4 --- /dev/null +++ b/contracts/src/v0.8/liquiditymanager/interfaces/optimism/IOptimismStandardBridge.sol @@ -0,0 +1,40 @@ +// SPDX-License-Identifier: MIT +// Copied from https://github.com/ethereum-optimism/optimism/blob/f707883038d527cbf1e9f8ea513fe33255deadbc/packages/contracts-bedrock/src/universal/StandardBridge.sol#L88 +pragma solidity ^0.8.0; + +interface IOptimismStandardBridge { + /// @notice Emitted when an ERC20 bridge is finalized on this chain. + /// @param localToken Address of the ERC20 on this chain. + /// @param remoteToken Address of the ERC20 on the remote chain. + /// @param from Address of the sender. + /// @param to Address of the receiver. + /// @param amount Amount of the ERC20 sent. + /// @param extraData Extra data sent with the transaction. + event ERC20BridgeFinalized( + address indexed localToken, + address indexed remoteToken, + address indexed from, + address to, + uint256 amount, + bytes extraData + ); + + /// @notice Finalizes an ERC20 bridge on this chain. Can only be triggered by the other + /// StandardBridge contract on the remote chain. + /// @param _localToken Address of the ERC20 on this chain. + /// @param _remoteToken Address of the corresponding token on the remote chain. + /// @param _from Address of the sender. + /// @param _to Address of the receiver. + /// @param _amount Amount of the ERC20 being bridged. + /// @param _extraData Extra data to be sent with the transaction. Note that the recipient will + /// not be triggered with this data, but it will be emitted and can be used + /// to identify the transaction. + function finalizeBridgeERC20( + address _localToken, + address _remoteToken, + address _from, + address _to, + uint256 _amount, + bytes calldata _extraData + ) external; +} diff --git a/contracts/src/v0.8/liquiditymanager/interfaces/optimism/Types.sol b/contracts/src/v0.8/liquiditymanager/interfaces/optimism/Types.sol new file mode 100644 index 00000000000..bd8d5d3b630 --- /dev/null +++ b/contracts/src/v0.8/liquiditymanager/interfaces/optimism/Types.sol @@ -0,0 +1,72 @@ +// SPDX-License-Identifier: MIT +// Copied from https://github.com/ethereum-optimism/optimism/blob/v1.7.0/packages/contracts-bedrock/src/libraries/Types.sol +pragma solidity ^0.8.0; + +/// @title Types +/// @notice Contains various types used throughout the Optimism contract system. +library Types { + /// @notice OutputProposal represents a commitment to the L2 state. The timestamp is the L1 + /// timestamp that the output root is posted. This timestamp is used to verify that the + /// finalization period has passed since the output root was submitted. + /// @custom:field outputRoot Hash of the L2 output. + /// @custom:field timestamp Timestamp of the L1 block that the output root was submitted in. + /// @custom:field l2BlockNumber L2 block number that the output corresponds to. + struct OutputProposal { + bytes32 outputRoot; + uint128 timestamp; + uint128 l2BlockNumber; + } + + /// @notice Struct representing the elements that are hashed together to generate an output root + /// which itself represents a snapshot of the L2 state. + /// @custom:field version Version of the output root. + /// @custom:field stateRoot Root of the state trie at the block of this output. + /// @custom:field messagePasserStorageRoot Root of the message passer storage trie. + /// @custom:field latestBlockhash Hash of the block this output was generated from. + struct OutputRootProof { + bytes32 version; + bytes32 stateRoot; + bytes32 messagePasserStorageRoot; + bytes32 latestBlockhash; + } + + /// @notice Struct representing a deposit transaction (L1 => L2 transaction) created by an end + /// user (as opposed to a system deposit transaction generated by the system). + /// @custom:field from Address of the sender of the transaction. + /// @custom:field to Address of the recipient of the transaction. + /// @custom:field isCreation True if the transaction is a contract creation. + /// @custom:field value Value to send to the recipient. + /// @custom:field mint Amount of ETH to mint. + /// @custom:field gasLimit Gas limit of the transaction. + /// @custom:field data Data of the transaction. + /// @custom:field l1BlockHash Hash of the block the transaction was submitted in. + /// @custom:field logIndex Index of the log in the block the transaction was submitted in. + //solhint-disable gas-struct-packing + struct UserDepositTransaction { + address from; + address to; + bool isCreation; + uint256 value; + uint256 mint; + uint64 gasLimit; + bytes data; + bytes32 l1BlockHash; + uint256 logIndex; + } + + /// @notice Struct representing a withdrawal transaction. + /// @custom:field nonce Nonce of the withdrawal transaction + /// @custom:field sender Address of the sender of the transaction. + /// @custom:field target Address of the recipient of the transaction. + /// @custom:field value Value to send to the recipient. + /// @custom:field gasLimit Gas limit of the transaction. + /// @custom:field data Data of the transaction. + struct WithdrawalTransaction { + uint256 nonce; + address sender; + address target; + uint256 value; + uint256 gasLimit; + bytes data; + } +} diff --git a/contracts/src/v0.8/liquiditymanager/ocr/OCR3Abstract.sol b/contracts/src/v0.8/liquiditymanager/ocr/OCR3Abstract.sol new file mode 100644 index 00000000000..44e5d89f7fb --- /dev/null +++ b/contracts/src/v0.8/liquiditymanager/ocr/OCR3Abstract.sol @@ -0,0 +1,108 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.0; + +import {ITypeAndVersion} from "../../shared/interfaces/ITypeAndVersion.sol"; + +abstract contract OCR3Abstract is ITypeAndVersion { + // Maximum number of oracles the offchain reporting protocol is designed for + uint256 internal constant MAX_NUM_ORACLES = 31; + + /// @notice triggers a new run of the offchain reporting protocol + /// @param previousConfigBlockNumber block in which the previous config was set, to simplify historic analysis + /// @param configDigest configDigest of this configuration + /// @param configCount ordinal number of this config setting among all config settings over the life of this contract + /// @param signers ith element is address ith oracle uses to sign a report + /// @param transmitters ith element is address ith oracle uses to transmit a report via the transmit method + /// @param f maximum number of faulty/dishonest oracles the protocol can tolerate while still working correctly + /// @param onchainConfig serialized configuration used by the contract (and possibly oracles) + /// @param offchainConfigVersion version of the serialization format used for "offchainConfig" parameter + /// @param offchainConfig serialized configuration used by the oracles exclusively and only passed through the contract + event ConfigSet( + uint32 previousConfigBlockNumber, + bytes32 configDigest, + uint64 configCount, + address[] signers, + address[] transmitters, + uint8 f, + bytes onchainConfig, + uint64 offchainConfigVersion, + bytes offchainConfig + ); + + /// @notice sets offchain reporting protocol configuration incl. participating oracles + /// @param signers addresses with which oracles sign the reports + /// @param transmitters addresses oracles use to transmit the reports + /// @param f number of faulty oracles the system can tolerate + /// @param onchainConfig serialized configuration used by the contract (and possibly oracles) + /// @param offchainConfigVersion version number for offchainEncoding schema + /// @param offchainConfig serialized configuration used by the oracles exclusively and only passed through the contract + function setOCR3Config( + address[] memory signers, + address[] memory transmitters, + uint8 f, + bytes memory onchainConfig, + uint64 offchainConfigVersion, + bytes memory offchainConfig + ) external virtual; + + /// @notice information about current offchain reporting protocol configuration + /// @return configCount ordinal number of current config, out of all configs applied to this contract so far + /// @return blockNumber block at which this config was set + /// @return configDigest domain-separation tag for current config (see _configDigestFromConfigData) + function latestConfigDetails() + external + view + virtual + returns (uint32 configCount, uint32 blockNumber, bytes32 configDigest); + + function _configDigestFromConfigData( + uint256 chainId, + address contractAddress, + uint64 configCount, + address[] memory signers, + address[] memory transmitters, + uint8 f, + bytes memory onchainConfig, + uint64 offchainConfigVersion, + bytes memory offchainConfig + ) internal pure returns (bytes32) { + uint256 h = uint256( + keccak256( + abi.encode( + chainId, + contractAddress, + configCount, + signers, + transmitters, + f, + onchainConfig, + offchainConfigVersion, + offchainConfig + ) + ) + ); + uint256 prefixMask = type(uint256).max << (256 - 16); // 0xFFFF00..00 + uint256 prefix = 0x0001 << (256 - 16); // 0x000100..00 + return bytes32((prefix & prefixMask) | (h & ~prefixMask)); + } + + /// @notice optionally emitted to indicate the latest configDigest and sequence number + /// for which a report was successfully transmitted. Alternatively, the contract may + /// use latestConfigDigestAndEpoch with scanLogs set to false. + event Transmitted(bytes32 configDigest, uint64 sequenceNumber); + + /// @notice transmit is called to post a new report to the contract + /// @param report serialized report, which the signatures are signing. + /// @param rs ith element is the R components of the ith signature on report. Must have at most MAX_NUM_ORACLES entries + /// @param ss ith element is the S components of the ith signature on report. Must have at most MAX_NUM_ORACLES entries + /// @param rawVs ith element is the the V component of the ith signature + function transmit( + // NOTE: If these parameters are changed, expectedMsgDataLength and/or + // TRANSMIT_MSGDATA_CONSTANT_LENGTH_COMPONENT need to be changed accordingly + bytes32[3] calldata reportContext, + bytes calldata report, + bytes32[] calldata rs, + bytes32[] calldata ss, + bytes32 rawVs // signatures + ) external virtual; +} diff --git a/contracts/src/v0.8/liquiditymanager/ocr/OCR3Base.sol b/contracts/src/v0.8/liquiditymanager/ocr/OCR3Base.sol new file mode 100644 index 00000000000..b856f734e7b --- /dev/null +++ b/contracts/src/v0.8/liquiditymanager/ocr/OCR3Base.sol @@ -0,0 +1,284 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.0; + +import {OwnerIsCreator} from "../../shared/access/OwnerIsCreator.sol"; +import {OCR3Abstract} from "./OCR3Abstract.sol"; + +/// @notice Onchain verification of reports from the offchain reporting protocol +/// @dev For details on its operation, see the offchain reporting protocol design +/// doc, which refers to this contract as simply the "contract". +abstract contract OCR3Base is OwnerIsCreator, OCR3Abstract { + error InvalidConfig(string message); + error WrongMessageLength(uint256 expected, uint256 actual); + error ConfigDigestMismatch(bytes32 expected, bytes32 actual); + error ForkedChain(uint256 expected, uint256 actual); + error WrongNumberOfSignatures(); + error SignaturesOutOfRegistration(); + error UnauthorizedTransmitter(); + error UnauthorizedSigner(); + error NonUniqueSignatures(); + error OracleCannotBeZeroAddress(); + error NonIncreasingSequenceNumber(uint64 sequenceNumber, uint64 latestSequenceNumber); + + // Packing these fields used on the hot path in a ConfigInfo variable reduces the + // retrieval of all of them to a minimum number of SLOADs. + struct ConfigInfo { + bytes32 latestConfigDigest; + uint8 f; + uint8 n; + } + + // Used for s_oracles[a].role, where a is an address, to track the purpose + // of the address, or to indicate that the address is unset. + enum Role { + // No oracle role has been set for address a + Unset, + // Signing address for the s_oracles[a].index'th oracle. I.e., report + // signatures from this oracle should ecrecover back to address a. + Signer, + // Transmission address for the s_oracles[a].index'th oracle. I.e., if a + // report is received by OCR3Aggregator.transmit in which msg.sender is + // a, it is attributed to the s_oracles[a].index'th oracle. + Transmitter + } + + struct Oracle { + uint8 index; // Index of oracle in s_signers/s_transmitters + Role role; // Role of the address which mapped to this struct + } + + // The current config + ConfigInfo internal s_configInfo; + + // incremented each time a new config is posted. This count is incorporated + // into the config digest, to prevent replay attacks. + uint32 internal s_configCount; + // makes it easier for offchain systems to extract config from logs. + uint32 internal s_latestConfigBlockNumber; + + uint64 internal s_latestSequenceNumber; + + // signer OR transmitter address + mapping(address signerOrTransmitter => Oracle oracle) internal s_oracles; + + // s_signers contains the signing address of each oracle + address[] internal s_signers; + + // s_transmitters contains the transmission address of each oracle, + // i.e. the address the oracle actually sends transactions to the contract from + address[] internal s_transmitters; + + // The constant-length components of the msg.data sent to transmit. + // See the "If we wanted to call sam" example on for example reasoning + // https://solidity.readthedocs.io/en/v0.7.2/abi-spec.html + uint16 private constant TRANSMIT_MSGDATA_CONSTANT_LENGTH_COMPONENT = + 4 + // function selector + 32 * + 3 + // 3 words containing reportContext + 32 + // word containing start location of abiencoded report value + 32 + // word containing location start of abiencoded rs value + 32 + // word containing start location of abiencoded ss value + 32 + // rawVs value + 32 + // word containing length of report + 32 + // word containing length rs + 32; // word containing length of ss + + uint256 internal immutable i_chainID; + + constructor() { + i_chainID = block.chainid; + } + + // Reverts transaction if config args are invalid + modifier checkConfigValid( + uint256 numSigners, + uint256 numTransmitters, + uint256 f + ) { + if (numSigners > MAX_NUM_ORACLES) revert InvalidConfig("too many signers"); + if (f == 0) revert InvalidConfig("f must be positive"); + if (numSigners != numTransmitters) revert InvalidConfig("oracle addresses out of registration"); + if (numSigners <= 3 * f) revert InvalidConfig("faulty-oracle f too high"); + _; + } + + /// @notice sets offchain reporting protocol configuration incl. participating oracles + /// @param signers addresses with which oracles sign the reports + /// @param transmitters addresses oracles use to transmit the reports + /// @param f number of faulty oracles the system can tolerate + /// @param onchainConfig encoded on-chain contract configuration + /// @param offchainConfigVersion version number for offchainEncoding schema + /// @param offchainConfig encoded off-chain oracle configuration + function setOCR3Config( + address[] memory signers, + address[] memory transmitters, + uint8 f, + bytes memory onchainConfig, + uint64 offchainConfigVersion, + bytes memory offchainConfig + ) external override checkConfigValid(signers.length, transmitters.length, f) onlyOwner { + _beforeSetConfig(onchainConfig); + uint256 oldSignerLength = s_signers.length; + for (uint256 i = 0; i < oldSignerLength; ++i) { + delete s_oracles[s_signers[i]]; + delete s_oracles[s_transmitters[i]]; + } + + uint256 newSignersLength = signers.length; + for (uint256 i = 0; i < newSignersLength; ++i) { + // add new signer/transmitter addresses + address signer = signers[i]; + if (s_oracles[signer].role != Role.Unset) revert InvalidConfig("repeated signer address"); + if (signer == address(0)) revert OracleCannotBeZeroAddress(); + s_oracles[signer] = Oracle(uint8(i), Role.Signer); + + address transmitter = transmitters[i]; + if (s_oracles[transmitter].role != Role.Unset) revert InvalidConfig("repeated transmitter address"); + if (transmitter == address(0)) revert OracleCannotBeZeroAddress(); + s_oracles[transmitter] = Oracle(uint8(i), Role.Transmitter); + } + + s_signers = signers; + s_transmitters = transmitters; + + s_configInfo.f = f; + s_configInfo.n = uint8(newSignersLength); + s_configInfo.latestConfigDigest = _configDigestFromConfigData( + block.chainid, + address(this), + ++s_configCount, + signers, + transmitters, + f, + onchainConfig, + offchainConfigVersion, + offchainConfig + ); + + uint32 previousConfigBlockNumber = s_latestConfigBlockNumber; + s_latestConfigBlockNumber = uint32(block.number); + s_latestSequenceNumber = 0; + + emit ConfigSet( + previousConfigBlockNumber, + s_configInfo.latestConfigDigest, + s_configCount, + signers, + transmitters, + f, + onchainConfig, + offchainConfigVersion, + offchainConfig + ); + } + + /// @dev Hook that is run from setOCR3Config() right after validating configuration. + /// Empty by default, please provide an implementation in a child contract if you need additional configuration processing + function _beforeSetConfig(bytes memory _onchainConfig) internal virtual {} + + /// @return list of addresses permitted to transmit reports to this contract + /// @dev The list will match the order used to specify the transmitter during setConfig + function getTransmitters() external view returns (address[] memory) { + return s_transmitters; + } + + /// @notice transmit is called to post a new report to the contract + /// @param report serialized report, which the signatures are signing. + /// @param rs ith element is the R components of the ith signature on report. Must have at most MAX_NUM_ORACLES entries + /// @param ss ith element is the S components of the ith signature on report. Must have at most MAX_NUM_ORACLES entries + /// @param rawVs ith element is the the V component of the ith signature + function transmit( + // NOTE: If these parameters are changed, expectedMsgDataLength and/or + // TRANSMIT_MSGDATA_CONSTANT_LENGTH_COMPONENT need to be changed accordingly + bytes32[3] calldata reportContext, + bytes calldata report, + bytes32[] calldata rs, + bytes32[] calldata ss, + bytes32 rawVs // signatures + ) external override { + uint64 sequenceNumber = uint64(uint256(reportContext[1])); + if (sequenceNumber <= s_latestSequenceNumber) { + revert NonIncreasingSequenceNumber(sequenceNumber, s_latestSequenceNumber); + } + + // Scoping this reduces stack pressure and gas usage + { + _report(report, sequenceNumber); + } + + s_latestSequenceNumber = sequenceNumber; + // reportContext consists of: + // reportContext[0]: ConfigDigest + // reportContext[1]: 24 byte padding, 8 byte sequence number + bytes32 configDigest = reportContext[0]; + ConfigInfo memory configInfo = s_configInfo; + + if (configInfo.latestConfigDigest != configDigest) { + revert ConfigDigestMismatch(configInfo.latestConfigDigest, configDigest); + } + // If the cached chainID at time of deployment doesn't match the current chainID, we reject all signed reports. + // This avoids a (rare) scenario where chain A forks into chain A and A', A' still has configDigest + // calculated from chain A and so OCR reports will be valid on both forks. + if (i_chainID != block.chainid) revert ForkedChain(i_chainID, block.chainid); + + emit Transmitted(configDigest, sequenceNumber); + + if (rs.length != configInfo.f + 1) revert WrongNumberOfSignatures(); + if (rs.length != ss.length) revert SignaturesOutOfRegistration(); + + // Scoping this reduces stack pressure and gas usage + { + Oracle memory transmitter = s_oracles[msg.sender]; + // Check that sender is authorized to report + if (!(transmitter.role == Role.Transmitter && msg.sender == s_transmitters[transmitter.index])) + revert UnauthorizedTransmitter(); + } + // Scoping this reduces stack pressure and gas usage + { + uint256 expectedDataLength = uint256(TRANSMIT_MSGDATA_CONSTANT_LENGTH_COMPONENT) + + report.length + // one byte pure entry in _report + rs.length * + 32 + // 32 bytes per entry in _rs + ss.length * + 32; // 32 bytes per entry in _ss) + if (msg.data.length != expectedDataLength) revert WrongMessageLength(expectedDataLength, msg.data.length); + } + + // Verify signatures attached to report + bytes32 h = keccak256(abi.encodePacked(keccak256(report), reportContext)); + bool[MAX_NUM_ORACLES] memory signed; + + uint256 numberOfSignatures = rs.length; + for (uint256 i = 0; i < numberOfSignatures; ++i) { + // Safe from ECDSA malleability here since we check for duplicate signers. + address signer = ecrecover(h, uint8(rawVs[i]) + 27, rs[i], ss[i]); + // Since we disallow address(0) as a valid signer address, it can + // never have a signer role. + Oracle memory oracle = s_oracles[signer]; + if (oracle.role != Role.Signer) revert UnauthorizedSigner(); + if (signed[oracle.index]) revert NonUniqueSignatures(); + signed[oracle.index] = true; + } + } + + /// @notice information about current offchain reporting protocol configuration + /// @return configCount ordinal number of current config, out of all configs applied to this contract so far + /// @return blockNumber block at which this config was set + /// @return configDigest domain-separation tag for current config (see _configDigestFromConfigData) + function latestConfigDetails() + external + view + override + returns (uint32 configCount, uint32 blockNumber, bytes32 configDigest) + { + return (s_configCount, s_latestConfigBlockNumber, s_configInfo.latestConfigDigest); + } + + /// @notice gets the latest sequence number accepted by the contract + /// @return sequenceNumber the monotomically incremenenting number associated with OCR reports + function latestSequenceNumber() external view virtual returns (uint64 sequenceNumber) { + return s_latestSequenceNumber; + } + + function _report(bytes calldata report, uint64 sequenceNumber) internal virtual; +} diff --git a/contracts/src/v0.8/liquiditymanager/test/LiquidityManager.t.sol b/contracts/src/v0.8/liquiditymanager/test/LiquidityManager.t.sol new file mode 100644 index 00000000000..73c9ba74455 --- /dev/null +++ b/contracts/src/v0.8/liquiditymanager/test/LiquidityManager.t.sol @@ -0,0 +1,945 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {ILiquidityManager} from "../interfaces/ILiquidityManager.sol"; +import {IBridgeAdapter} from "../interfaces/IBridge.sol"; + +import {LockReleaseTokenPool} from "../../ccip/pools/LockReleaseTokenPool.sol"; +import {LiquidityManager} from "../LiquidityManager.sol"; +import {MockL1BridgeAdapter} from "./mocks/MockBridgeAdapter.sol"; +import {LiquidityManagerBaseTest} from "./LiquidityManagerBaseTest.t.sol"; +import {LiquidityManagerHelper} from "./helpers/LiquidityManagerHelper.sol"; + +import {IERC20} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/IERC20.sol"; + +// FOUNDRY_PROFILE=liquiditymanager forge test --match-path src/v0.8/liquiditymanager/test/LiquidityManager.t.sol + +contract LiquidityManagerSetup is LiquidityManagerBaseTest { + event FinalizationStepCompleted( + uint64 indexed ocrSeqNum, + uint64 indexed remoteChainSelector, + bytes bridgeSpecificData + ); + event LiquidityTransferred( + uint64 indexed ocrSeqNum, + uint64 indexed fromChainSelector, + uint64 indexed toChainSelector, + address to, + uint256 amount, + bytes bridgeSpecificPayload, + bytes bridgeReturnData + ); + event FinalizationFailed( + uint64 indexed ocrSeqNum, + uint64 indexed remoteChainSelector, + bytes bridgeSpecificData, + bytes reason + ); + event FinanceRoleSet(address financeRole); + event LiquidityAddedToContainer(address indexed provider, uint256 indexed amount); + event LiquidityRemovedFromContainer(address indexed remover, uint256 indexed amount); + // Liquidity container event + event LiquidityAdded(address indexed provider, uint256 indexed amount); + event LiquidityRemoved(address indexed remover, uint256 indexed amount); + + error NonceAlreadyUsed(uint256 nonce); + + LiquidityManagerHelper internal s_liquidityManager; + LockReleaseTokenPool internal s_lockReleaseTokenPool; + MockL1BridgeAdapter internal s_bridgeAdapter; + + // LiquidityManager that rebalances weth. + LiquidityManagerHelper internal s_wethRebalancer; + LockReleaseTokenPool internal s_wethLockReleaseTokenPool; + MockL1BridgeAdapter internal s_wethBridgeAdapter; + + function setUp() public virtual override { + LiquidityManagerBaseTest.setUp(); + + s_bridgeAdapter = new MockL1BridgeAdapter(s_l1Token, false); + s_lockReleaseTokenPool = new LockReleaseTokenPool(s_l1Token, new address[](0), address(1), true, address(123)); + s_liquidityManager = new LiquidityManagerHelper( + s_l1Token, + i_localChainSelector, + s_lockReleaseTokenPool, + 0, + FINANCE + ); + + s_lockReleaseTokenPool.setRebalancer(address(s_liquidityManager)); + + s_wethBridgeAdapter = new MockL1BridgeAdapter(IERC20(address(s_l1Weth)), true); + s_wethLockReleaseTokenPool = new LockReleaseTokenPool( + IERC20(address(s_l1Weth)), + new address[](0), + address(1), + true, + address(123) + ); + s_wethRebalancer = new LiquidityManagerHelper( + IERC20(address(s_l1Weth)), + i_localChainSelector, + s_wethLockReleaseTokenPool, + 0, + FINANCE + ); + + s_wethLockReleaseTokenPool.setRebalancer(address(s_wethRebalancer)); + } +} + +contract LiquidityManager_addLiquidity is LiquidityManagerSetup { + function test_addLiquiditySuccess() external { + address caller = STRANGER; + vm.startPrank(caller); + + uint256 amount = 12345679; + deal(address(s_l1Token), caller, amount); + + s_l1Token.approve(address(s_liquidityManager), amount); + + vm.expectEmit(); + emit LiquidityAddedToContainer(caller, amount); + + s_liquidityManager.addLiquidity(amount); + + assertEq(s_l1Token.balanceOf(address(s_lockReleaseTokenPool)), amount); + } +} + +contract LiquidityManager_removeLiquidity is LiquidityManagerSetup { + function test_removeLiquiditySuccess() external { + uint256 amount = 12345679; + deal(address(s_l1Token), address(s_lockReleaseTokenPool), amount); + + vm.expectEmit(); + emit LiquidityRemovedFromContainer(FINANCE, amount); + + vm.startPrank(FINANCE); + s_liquidityManager.removeLiquidity(amount); + + assertEq(s_l1Token.balanceOf(address(s_liquidityManager)), 0); + } + + function test_InsufficientLiquidityReverts() external { + uint256 balance = 923; + uint256 requested = balance + 1; + + deal(address(s_l1Token), address(s_lockReleaseTokenPool), balance); + + vm.expectRevert(abi.encodeWithSelector(LiquidityManager.InsufficientLiquidity.selector, requested, balance, 0)); + + vm.startPrank(FINANCE); + s_liquidityManager.removeLiquidity(requested); + } + + function test_OnlyFinanceRoleReverts() external { + vm.stopPrank(); + + vm.expectRevert(LiquidityManager.OnlyFinanceRole.selector); + + s_liquidityManager.removeLiquidity(123); + } +} + +contract LiquidityManager__report is LiquidityManagerSetup { + function test_EmptyReportReverts() external { + ILiquidityManager.LiquidityInstructions memory instructions = ILiquidityManager.LiquidityInstructions({ + sendLiquidityParams: new ILiquidityManager.SendLiquidityParams[](0), + receiveLiquidityParams: new ILiquidityManager.ReceiveLiquidityParams[](0) + }); + + vm.expectRevert(LiquidityManager.EmptyReport.selector); + + s_liquidityManager.report(abi.encode(instructions), 123); + } +} + +contract LiquidityManager_rebalanceLiquidity is LiquidityManagerSetup { + uint256 internal constant AMOUNT = 12345679; + + function test_rebalanceLiquiditySuccess() external { + deal(address(s_l1Token), address(s_lockReleaseTokenPool), AMOUNT); + + LiquidityManager.CrossChainRebalancerArgs[] memory args = new LiquidityManager.CrossChainRebalancerArgs[](1); + args[0] = ILiquidityManager.CrossChainRebalancerArgs({ + remoteRebalancer: address(s_liquidityManager), + localBridge: s_bridgeAdapter, + remoteToken: address(s_l2Token), + remoteChainSelector: i_remoteChainSelector, + enabled: true + }); + s_liquidityManager.setCrossChainRebalancers(args); + + vm.expectEmit(); + emit Transfer(address(s_lockReleaseTokenPool), address(s_liquidityManager), AMOUNT); + + vm.expectEmit(); + emit Approval(address(s_liquidityManager), address(s_bridgeAdapter), AMOUNT); + + vm.expectEmit(); + emit Transfer(address(s_liquidityManager), address(s_bridgeAdapter), AMOUNT); + + vm.expectEmit(); + bytes memory encodedNonce = abi.encode(uint256(1)); + emit LiquidityTransferred( + type(uint64).max, + i_localChainSelector, + i_remoteChainSelector, + address(s_liquidityManager), + AMOUNT, + bytes(""), + encodedNonce + ); + + vm.startPrank(FINANCE); + s_liquidityManager.rebalanceLiquidity(i_remoteChainSelector, AMOUNT, 0, bytes("")); + + assertEq(s_l1Token.balanceOf(address(s_liquidityManager)), 0); + assertEq(s_l1Token.balanceOf(address(s_bridgeAdapter)), AMOUNT); + assertEq(s_l1Token.allowance(address(s_liquidityManager), address(s_bridgeAdapter)), 0); + } + + /// @notice this test sets up a circular system where the liquidity container of + /// the local Liquidity manager is the bridge adapter of the remote liquidity manager + /// and the other way around for the remote liquidity manager. This allows us to + /// rebalance funds between the two liquidity managers on the same chain. + function test_rebalanceBetweenPoolsSuccess() external { + uint256 amount = 12345670; + + s_liquidityManager = new LiquidityManagerHelper(s_l1Token, i_localChainSelector, s_bridgeAdapter, 0, FINANCE); + + MockL1BridgeAdapter mockRemoteBridgeAdapter = new MockL1BridgeAdapter(s_l1Token, false); + LiquidityManager mockRemoteRebalancer = new LiquidityManager( + s_l1Token, + i_remoteChainSelector, + mockRemoteBridgeAdapter, + 0, + FINANCE + ); + + LiquidityManager.CrossChainRebalancerArgs[] memory args = new LiquidityManager.CrossChainRebalancerArgs[](1); + args[0] = ILiquidityManager.CrossChainRebalancerArgs({ + remoteRebalancer: address(mockRemoteRebalancer), + localBridge: mockRemoteBridgeAdapter, + remoteToken: address(s_l1Token), + remoteChainSelector: i_remoteChainSelector, + enabled: true + }); + + s_liquidityManager.setCrossChainRebalancers(args); + + args[0] = ILiquidityManager.CrossChainRebalancerArgs({ + remoteRebalancer: address(s_liquidityManager), + localBridge: s_bridgeAdapter, + remoteToken: address(s_l1Token), + remoteChainSelector: i_localChainSelector, + enabled: true + }); + + mockRemoteRebalancer.setCrossChainRebalancers(args); + + deal(address(s_l1Token), address(s_bridgeAdapter), amount); + + vm.startPrank(FINANCE); + s_liquidityManager.rebalanceLiquidity(i_remoteChainSelector, amount, 0, bytes("")); + + assertEq(s_l1Token.balanceOf(address(s_bridgeAdapter)), 0); + assertEq(s_l1Token.balanceOf(address(mockRemoteBridgeAdapter)), amount); + assertEq(s_l1Token.allowance(address(s_liquidityManager), address(s_bridgeAdapter)), 0); + + // attach a bridge fee and see the relevant adapter's ether balance change. + // the bridge fee is sent along with the sendERC20 call. + uint256 bridgeFee = 123; + vm.deal(address(mockRemoteRebalancer), bridgeFee); + mockRemoteRebalancer.rebalanceLiquidity(i_localChainSelector, amount, bridgeFee, bytes("")); + + assertEq(s_l1Token.balanceOf(address(s_bridgeAdapter)), amount); + assertEq(s_l1Token.balanceOf(address(mockRemoteBridgeAdapter)), 0); + assertEq(address(s_bridgeAdapter).balance, bridgeFee); + + // Assert partial rebalancing works correctly + s_liquidityManager.rebalanceLiquidity(i_remoteChainSelector, amount / 2, 0, bytes("")); + + assertEq(s_l1Token.balanceOf(address(s_bridgeAdapter)), amount / 2); + assertEq(s_l1Token.balanceOf(address(mockRemoteBridgeAdapter)), amount / 2); + } + + function test_rebalanceBetweenPoolsSuccess_AlreadyFinalized() external { + // set up a rebalancer on another chain, an "L2". + // note we use the L1 bridge adapter because it has the reverting logic + // when finalization is already done. + MockL1BridgeAdapter remoteBridgeAdapter = new MockL1BridgeAdapter(s_l2Token, false); + LockReleaseTokenPool remotePool = new LockReleaseTokenPool( + s_l2Token, + new address[](0), + address(1), + true, + address(123) + ); + LiquidityManager remoteRebalancer = new LiquidityManager(s_l2Token, i_remoteChainSelector, remotePool, 0, FINANCE); + + // set rebalancer role on the pool. + remotePool.setRebalancer(address(remoteRebalancer)); + + // set up the cross chain rebalancer on "L1". + LiquidityManager.CrossChainRebalancerArgs[] memory args = new LiquidityManager.CrossChainRebalancerArgs[](1); + args[0] = ILiquidityManager.CrossChainRebalancerArgs({ + remoteRebalancer: address(remoteRebalancer), + localBridge: s_bridgeAdapter, + remoteToken: address(s_l2Token), + remoteChainSelector: i_remoteChainSelector, + enabled: true + }); + + s_liquidityManager.setCrossChainRebalancers(args); + + // set up the cross chain rebalancer on "L2". + args[0] = ILiquidityManager.CrossChainRebalancerArgs({ + remoteRebalancer: address(s_liquidityManager), + localBridge: remoteBridgeAdapter, + remoteToken: address(s_l1Token), + remoteChainSelector: i_localChainSelector, + enabled: true + }); + + remoteRebalancer.setCrossChainRebalancers(args); + + // deal some L1 tokens to the L1 bridge adapter so that it can send them to the rebalancer + // when the withdrawal gets finalized. + deal(address(s_l1Token), address(s_bridgeAdapter), AMOUNT); + // deal some L2 tokens to the remote token pool so that we can withdraw it when we rebalance. + deal(address(s_l2Token), address(remotePool), AMOUNT); + + uint256 nonce = 1; + uint64 maxSeqNum = type(uint64).max; + bytes memory bridgeSendReturnData = abi.encode(nonce); + bytes memory bridgeSpecificPayload = bytes(""); + vm.expectEmit(); + emit LiquidityRemoved(address(remoteRebalancer), AMOUNT); + vm.expectEmit(); + emit LiquidityTransferred( + maxSeqNum, + i_remoteChainSelector, + i_localChainSelector, + address(s_liquidityManager), + AMOUNT, + bridgeSpecificPayload, + bridgeSendReturnData + ); + vm.startPrank(FINANCE); + remoteRebalancer.rebalanceLiquidity(i_localChainSelector, AMOUNT, 0, bridgeSpecificPayload); + + // available liquidity has been moved to the remote bridge adapter from the token pool. + assertEq(s_l2Token.balanceOf(address(remoteBridgeAdapter)), AMOUNT, "remoteBridgeAdapter balance"); + assertEq(s_l2Token.balanceOf(address(remotePool)), 0, "remotePool balance"); + + // prove and finalize manually on the L1 bridge adapter. + // this should transfer the funds to the rebalancer. + MockL1BridgeAdapter.ProvePayload memory provePayload = MockL1BridgeAdapter.ProvePayload({nonce: nonce}); + MockL1BridgeAdapter.Payload memory payload = MockL1BridgeAdapter.Payload({ + action: MockL1BridgeAdapter.FinalizationAction.ProveWithdrawal, + data: abi.encode(provePayload) + }); + bool fundsAvailable = s_bridgeAdapter.finalizeWithdrawERC20( + address(0), + address(s_liquidityManager), + abi.encode(payload) + ); + assertFalse(fundsAvailable, "fundsAvailable must be false"); + MockL1BridgeAdapter.FinalizePayload memory finalizePayload = MockL1BridgeAdapter.FinalizePayload({ + nonce: nonce, + amount: AMOUNT + }); + payload = MockL1BridgeAdapter.Payload({ + action: MockL1BridgeAdapter.FinalizationAction.FinalizeWithdrawal, + data: abi.encode(finalizePayload) + }); + fundsAvailable = s_bridgeAdapter.finalizeWithdrawERC20( + address(0), + address(s_liquidityManager), + abi.encode(payload) + ); + assertTrue(fundsAvailable, "fundsAvailable must be true"); + + // available balance on the L1 bridge adapter has been moved to the rebalancer. + assertEq(s_l1Token.balanceOf(address(s_liquidityManager)), AMOUNT, "rebalancer balance 1"); + assertEq(s_l1Token.balanceOf(address(s_bridgeAdapter)), 0, "bridgeAdapter balance"); + + // try to finalize on L1 again + // bytes memory revertData = abi.encodeWithSelector(NonceAlreadyUsed.selector, nonce); + vm.expectEmit(); + emit FinalizationFailed( + maxSeqNum, + i_remoteChainSelector, + abi.encode(payload), + abi.encodeWithSelector(NonceAlreadyUsed.selector, nonce) + ); + vm.expectEmit(); + emit LiquidityAdded(address(s_liquidityManager), AMOUNT); + vm.expectEmit(); + emit LiquidityTransferred( + maxSeqNum, + i_remoteChainSelector, + i_localChainSelector, + address(s_liquidityManager), + AMOUNT, + abi.encode(payload), + bytes("") + ); + s_liquidityManager.receiveLiquidity(i_remoteChainSelector, AMOUNT, false, abi.encode(payload)); + + // available balance on the rebalancer has been injected into the token pool. + assertEq(s_l1Token.balanceOf(address(s_liquidityManager)), 0, "rebalancer balance 2"); + assertEq(s_l1Token.balanceOf(address(s_lockReleaseTokenPool)), AMOUNT, "lockReleaseTokenPool balance"); + } + + function test_rebalanceBetweenPools_MultiStageFinalization() external { + // set up a rebalancer on another chain, an "L2". + // note we use the L1 bridge adapter because it has the reverting logic + // when finalization is already done. + MockL1BridgeAdapter remoteBridgeAdapter = new MockL1BridgeAdapter(s_l2Token, false); + LockReleaseTokenPool remotePool = new LockReleaseTokenPool( + s_l2Token, + new address[](0), + address(1), + true, + address(123) + ); + LiquidityManager remoteRebalancer = new LiquidityManager(s_l2Token, i_remoteChainSelector, remotePool, 0, FINANCE); + + // set rebalancer role on the pool. + remotePool.setRebalancer(address(remoteRebalancer)); + + // set up the cross chain rebalancer on "L1". + LiquidityManager.CrossChainRebalancerArgs[] memory args = new LiquidityManager.CrossChainRebalancerArgs[](1); + args[0] = ILiquidityManager.CrossChainRebalancerArgs({ + remoteRebalancer: address(remoteRebalancer), + localBridge: s_bridgeAdapter, + remoteToken: address(s_l2Token), + remoteChainSelector: i_remoteChainSelector, + enabled: true + }); + + s_liquidityManager.setCrossChainRebalancers(args); + + // set up the cross chain rebalancer on "L2". + args[0] = ILiquidityManager.CrossChainRebalancerArgs({ + remoteRebalancer: address(s_liquidityManager), + localBridge: remoteBridgeAdapter, + remoteToken: address(s_l1Token), + remoteChainSelector: i_localChainSelector, + enabled: true + }); + + remoteRebalancer.setCrossChainRebalancers(args); + + // deal some L1 tokens to the L1 bridge adapter so that it can send them to the rebalancer + // when the withdrawal gets finalized. + deal(address(s_l1Token), address(s_bridgeAdapter), AMOUNT); + // deal some L2 tokens to the remote token pool so that we can withdraw it when we rebalance. + deal(address(s_l2Token), address(remotePool), AMOUNT); + + // initiate a send from remote rebalancer to s_liquidityManager. + uint256 nonce = 1; + uint64 maxSeqNum = type(uint64).max; + bytes memory bridgeSendReturnData = abi.encode(nonce); + bytes memory bridgeSpecificPayload = bytes(""); + vm.expectEmit(); + emit LiquidityRemoved(address(remoteRebalancer), AMOUNT); + vm.expectEmit(); + emit LiquidityTransferred( + maxSeqNum, + i_remoteChainSelector, + i_localChainSelector, + address(s_liquidityManager), + AMOUNT, + bridgeSpecificPayload, + bridgeSendReturnData + ); + vm.startPrank(FINANCE); + remoteRebalancer.rebalanceLiquidity(i_localChainSelector, AMOUNT, 0, bridgeSpecificPayload); + + // available liquidity has been moved to the remote bridge adapter from the token pool. + assertEq(s_l2Token.balanceOf(address(remoteBridgeAdapter)), AMOUNT, "remoteBridgeAdapter balance"); + assertEq(s_l2Token.balanceOf(address(remotePool)), 0, "remotePool balance"); + + // prove withdrawal on the L1 bridge adapter, through the rebalancer. + uint256 balanceBeforeProve = s_l1Token.balanceOf(address(s_lockReleaseTokenPool)); + MockL1BridgeAdapter.ProvePayload memory provePayload = MockL1BridgeAdapter.ProvePayload({nonce: nonce}); + MockL1BridgeAdapter.Payload memory payload = MockL1BridgeAdapter.Payload({ + action: MockL1BridgeAdapter.FinalizationAction.ProveWithdrawal, + data: abi.encode(provePayload) + }); + vm.expectEmit(); + emit FinalizationStepCompleted(maxSeqNum, i_remoteChainSelector, abi.encode(payload)); + s_liquidityManager.receiveLiquidity(i_remoteChainSelector, AMOUNT, false, abi.encode(payload)); + + // s_liquidityManager should have no tokens. + assertEq(s_l1Token.balanceOf(address(s_liquidityManager)), 0, "rebalancer balance 1"); + // balance of s_lockReleaseTokenPool should be unchanged since no liquidity got added yet. + assertEq( + s_l1Token.balanceOf(address(s_lockReleaseTokenPool)), + balanceBeforeProve, + "s_lockReleaseTokenPool balance should be unchanged" + ); + + // finalize withdrawal on the L1 bridge adapter, through the rebalancer. + MockL1BridgeAdapter.FinalizePayload memory finalizePayload = MockL1BridgeAdapter.FinalizePayload({ + nonce: nonce, + amount: AMOUNT + }); + payload = MockL1BridgeAdapter.Payload({ + action: MockL1BridgeAdapter.FinalizationAction.FinalizeWithdrawal, + data: abi.encode(finalizePayload) + }); + vm.expectEmit(); + emit LiquidityAdded(address(s_liquidityManager), AMOUNT); + vm.expectEmit(); + emit LiquidityTransferred( + maxSeqNum, + i_remoteChainSelector, + i_localChainSelector, + address(s_liquidityManager), + AMOUNT, + abi.encode(payload), + bytes("") + ); + s_liquidityManager.receiveLiquidity(i_remoteChainSelector, AMOUNT, false, abi.encode(payload)); + + // s_liquidityManager should have no tokens. + assertEq(s_l1Token.balanceOf(address(s_liquidityManager)), 0, "rebalancer balance 2"); + // balance of s_lockReleaseTokenPool should be updated + assertEq( + s_l1Token.balanceOf(address(s_lockReleaseTokenPool)), + balanceBeforeProve + AMOUNT, + "s_lockReleaseTokenPool balance should be updated" + ); + } + + function test_rebalanceBetweenPools_NativeRewrap() external { + // set up a rebalancer similar to the above on another chain, an "L2". + MockL1BridgeAdapter remoteBridgeAdapter = new MockL1BridgeAdapter(IERC20(address(s_l2Weth)), true); + LockReleaseTokenPool remotePool = new LockReleaseTokenPool( + IERC20(address(s_l2Weth)), + new address[](0), + address(1), + true, + address(123) + ); + LiquidityManager remoteRebalancer = new LiquidityManager( + IERC20(address(s_l2Weth)), + i_remoteChainSelector, + remotePool, + 0, + FINANCE + ); + + // set rebalancer role on the pool. + remotePool.setRebalancer(address(remoteRebalancer)); + + // set up the cross chain rebalancer on "L1". + LiquidityManager.CrossChainRebalancerArgs[] memory args = new LiquidityManager.CrossChainRebalancerArgs[](1); + args[0] = ILiquidityManager.CrossChainRebalancerArgs({ + remoteRebalancer: address(remoteRebalancer), + localBridge: s_wethBridgeAdapter, + remoteToken: address(s_l2Weth), + remoteChainSelector: i_remoteChainSelector, + enabled: true + }); + + s_wethRebalancer.setCrossChainRebalancers(args); + + // set up the cross chain rebalancer on "L2". + args[0] = ILiquidityManager.CrossChainRebalancerArgs({ + remoteRebalancer: address(s_wethRebalancer), + localBridge: remoteBridgeAdapter, + remoteToken: address(s_l1Weth), + remoteChainSelector: i_localChainSelector, + enabled: true + }); + + remoteRebalancer.setCrossChainRebalancers(args); + + // deal some ether to the L1 bridge adapter so that it can send them to the rebalancer + // when the withdrawal gets finalized. + vm.deal(address(s_wethBridgeAdapter), AMOUNT); + // deal some L2 tokens to the remote token pool so that we can withdraw it when we rebalance. + deal(address(s_l2Weth), address(remotePool), AMOUNT); + // deposit some eth to the weth contract on L2 from the remote bridge adapter + // so that the withdraw() call succeeds. + vm.deal(address(remoteBridgeAdapter), AMOUNT); + vm.startPrank(address(remoteBridgeAdapter)); + s_l2Weth.deposit{value: AMOUNT}(); + vm.stopPrank(); + + // switch to finance for the rest of the test to avoid reverts. + vm.startPrank(FINANCE); + + // initiate a send from remote rebalancer to s_wethRebalancer. + uint256 nonce = 1; + uint64 maxSeqNum = type(uint64).max; + bytes memory bridgeSendReturnData = abi.encode(nonce); + bytes memory bridgeSpecificPayload = bytes(""); + vm.expectEmit(); + emit LiquidityRemoved(address(remoteRebalancer), AMOUNT); + vm.expectEmit(); + emit LiquidityTransferred( + maxSeqNum, + i_remoteChainSelector, + i_localChainSelector, + address(s_wethRebalancer), + AMOUNT, + bridgeSpecificPayload, + bridgeSendReturnData + ); + remoteRebalancer.rebalanceLiquidity(i_localChainSelector, AMOUNT, 0, bridgeSpecificPayload); + + // available liquidity has been moved to the remote bridge adapter from the token pool. + assertEq(s_l2Weth.balanceOf(address(remoteBridgeAdapter)), AMOUNT, "remoteBridgeAdapter balance"); + assertEq(s_l2Weth.balanceOf(address(remotePool)), 0, "remotePool balance"); + + // prove withdrawal on the L1 bridge adapter, through the rebalancer. + uint256 balanceBeforeProve = s_l1Weth.balanceOf(address(s_wethLockReleaseTokenPool)); + MockL1BridgeAdapter.ProvePayload memory provePayload = MockL1BridgeAdapter.ProvePayload({nonce: nonce}); + MockL1BridgeAdapter.Payload memory payload = MockL1BridgeAdapter.Payload({ + action: MockL1BridgeAdapter.FinalizationAction.ProveWithdrawal, + data: abi.encode(provePayload) + }); + vm.expectEmit(); + emit FinalizationStepCompleted(maxSeqNum, i_remoteChainSelector, abi.encode(payload)); + s_wethRebalancer.receiveLiquidity(i_remoteChainSelector, AMOUNT, false, abi.encode(payload)); + + // s_wethRebalancer should have no tokens. + assertEq(s_l1Weth.balanceOf(address(s_wethRebalancer)), 0, "rebalancer balance 1"); + // balance of s_wethLockReleaseTokenPool should be unchanged since no liquidity got added yet. + assertEq( + s_l1Weth.balanceOf(address(s_wethLockReleaseTokenPool)), + balanceBeforeProve, + "s_wethLockReleaseTokenPool balance should be unchanged" + ); + + // finalize withdrawal on the L1 bridge adapter, through the rebalancer. + MockL1BridgeAdapter.FinalizePayload memory finalizePayload = MockL1BridgeAdapter.FinalizePayload({ + nonce: nonce, + amount: AMOUNT + }); + payload = MockL1BridgeAdapter.Payload({ + action: MockL1BridgeAdapter.FinalizationAction.FinalizeWithdrawal, + data: abi.encode(finalizePayload) + }); + vm.expectEmit(); + emit LiquidityAdded(address(s_wethRebalancer), AMOUNT); + vm.expectEmit(); + emit LiquidityTransferred( + maxSeqNum, + i_remoteChainSelector, + i_localChainSelector, + address(s_wethRebalancer), + AMOUNT, + abi.encode(payload), + bytes("") + ); + s_wethRebalancer.receiveLiquidity(i_remoteChainSelector, AMOUNT, true, abi.encode(payload)); + + // s_wethRebalancer should have no tokens. + assertEq(s_l1Weth.balanceOf(address(s_wethRebalancer)), 0, "rebalancer balance 2"); + // s_wethRebalancer should have no native tokens. + assertEq(address(s_wethRebalancer).balance, 0, "rebalancer native balance should be zero"); + // balance of s_wethLockReleaseTokenPool should be updated + assertEq( + s_l1Weth.balanceOf(address(s_wethLockReleaseTokenPool)), + balanceBeforeProve + AMOUNT, + "s_wethLockReleaseTokenPool balance should be updated" + ); + } + + // Reverts + + function test_InsufficientLiquidityReverts() external { + s_liquidityManager.setMinimumLiquidity(3); + deal(address(s_l1Token), address(s_lockReleaseTokenPool), AMOUNT); + vm.expectRevert(abi.encodeWithSelector(LiquidityManager.InsufficientLiquidity.selector, AMOUNT, AMOUNT, 3)); + + vm.startPrank(FINANCE); + s_liquidityManager.rebalanceLiquidity(0, AMOUNT, 0, bytes("")); + } + + function test_InvalidRemoteChainReverts() external { + deal(address(s_l1Token), address(s_lockReleaseTokenPool), AMOUNT); + + vm.expectRevert(abi.encodeWithSelector(LiquidityManager.InvalidRemoteChain.selector, i_remoteChainSelector)); + + vm.startPrank(FINANCE); + s_liquidityManager.rebalanceLiquidity(i_remoteChainSelector, AMOUNT, 0, bytes("")); + } +} + +contract LiquidityManager_setCrossChainRebalancer is LiquidityManagerSetup { + event CrossChainRebalancerSet( + uint64 indexed remoteChainSelector, + IBridgeAdapter localBridge, + address remoteToken, + address remoteRebalancer, + bool enabled + ); + + function test_setCrossChainRebalancerSuccess() external { + address newRebalancer = address(23892423); + uint64 remoteChainSelector = 12301293; + + uint64[] memory supportedChains = s_liquidityManager.getSupportedDestChains(); + assertEq(supportedChains.length, 0); + + LiquidityManager.CrossChainRebalancerArgs[] memory args = new LiquidityManager.CrossChainRebalancerArgs[](1); + args[0] = ILiquidityManager.CrossChainRebalancerArgs({ + remoteRebalancer: newRebalancer, + localBridge: s_bridgeAdapter, + remoteToken: address(190490124908), + remoteChainSelector: remoteChainSelector, + enabled: true + }); + + vm.expectEmit(); + emit CrossChainRebalancerSet( + remoteChainSelector, + args[0].localBridge, + args[0].remoteToken, + newRebalancer, + args[0].enabled + ); + + s_liquidityManager.setCrossChainRebalancers(args); + + assertEq(s_liquidityManager.getCrossChainRebalancer(remoteChainSelector).remoteRebalancer, newRebalancer); + + LiquidityManager.CrossChainRebalancerArgs[] memory got = s_liquidityManager.getAllCrossChainRebalancers(); + assertEq(got.length, 1); + assertEq(got[0].remoteRebalancer, args[0].remoteRebalancer); + assertEq(address(got[0].localBridge), address(args[0].localBridge)); + assertEq(got[0].remoteToken, args[0].remoteToken); + assertEq(got[0].remoteChainSelector, args[0].remoteChainSelector); + assertEq(got[0].enabled, args[0].enabled); + + supportedChains = s_liquidityManager.getSupportedDestChains(); + assertEq(supportedChains.length, 1); + assertEq(supportedChains[0], remoteChainSelector); + + address anotherRebalancer = address(123); + args[0].remoteRebalancer = anotherRebalancer; + + vm.expectEmit(); + emit CrossChainRebalancerSet( + remoteChainSelector, + args[0].localBridge, + args[0].remoteToken, + anotherRebalancer, + args[0].enabled + ); + + s_liquidityManager.setCrossChainRebalancer(args[0]); + + assertEq(s_liquidityManager.getCrossChainRebalancer(remoteChainSelector).remoteRebalancer, anotherRebalancer); + + supportedChains = s_liquidityManager.getSupportedDestChains(); + assertEq(supportedChains.length, 1); + assertEq(supportedChains[0], remoteChainSelector); + } + + function test_ZeroChainSelectorReverts() external { + LiquidityManager.CrossChainRebalancerArgs memory arg = ILiquidityManager.CrossChainRebalancerArgs({ + remoteRebalancer: address(9), + localBridge: s_bridgeAdapter, + remoteToken: address(190490124908), + remoteChainSelector: 0, + enabled: true + }); + + vm.expectRevert(LiquidityManager.ZeroChainSelector.selector); + + s_liquidityManager.setCrossChainRebalancer(arg); + } + + function test_ZeroAddressReverts() external { + LiquidityManager.CrossChainRebalancerArgs memory arg = ILiquidityManager.CrossChainRebalancerArgs({ + remoteRebalancer: address(0), + localBridge: s_bridgeAdapter, + remoteToken: address(190490124908), + remoteChainSelector: 123, + enabled: true + }); + + vm.expectRevert(LiquidityManager.ZeroAddress.selector); + + s_liquidityManager.setCrossChainRebalancer(arg); + + arg.remoteRebalancer = address(9); + arg.localBridge = IBridgeAdapter(address(0)); + + vm.expectRevert(LiquidityManager.ZeroAddress.selector); + + s_liquidityManager.setCrossChainRebalancer(arg); + + arg.localBridge = s_bridgeAdapter; + arg.remoteToken = address(0); + + vm.expectRevert(LiquidityManager.ZeroAddress.selector); + + s_liquidityManager.setCrossChainRebalancer(arg); + } + + function test_OnlyOwnerReverts() external { + vm.stopPrank(); + + vm.expectRevert("Only callable by owner"); + + // Test the entrypoint that takes a list + s_liquidityManager.setCrossChainRebalancers(new LiquidityManager.CrossChainRebalancerArgs[](0)); + + vm.expectRevert("Only callable by owner"); + + // Test the entrypoint that takes a single item + s_liquidityManager.setCrossChainRebalancer( + ILiquidityManager.CrossChainRebalancerArgs({ + remoteRebalancer: address(9), + localBridge: s_bridgeAdapter, + remoteToken: address(190490124908), + remoteChainSelector: 124, + enabled: true + }) + ); + } +} + +contract LiquidityManager_setLocalLiquidityContainer is LiquidityManagerSetup { + event LiquidityContainerSet(address indexed newLiquidityContainer); + + function test_setLocalLiquidityContainerSuccess() external { + LockReleaseTokenPool newPool = new LockReleaseTokenPool( + s_l1Token, + new address[](0), + address(1), + true, + address(123) + ); + + vm.expectEmit(); + emit LiquidityContainerSet(address(newPool)); + + s_liquidityManager.setLocalLiquidityContainer(newPool); + + assertEq(s_liquidityManager.getLocalLiquidityContainer(), address(newPool)); + } + + function test_OnlyOwnerReverts() external { + vm.stopPrank(); + + vm.expectRevert("Only callable by owner"); + + s_liquidityManager.setLocalLiquidityContainer(LockReleaseTokenPool(address(1))); + } + + function test_ReverstWhen_CalledWithTheZeroAddress() external { + vm.expectRevert(LiquidityManager.ZeroAddress.selector); + s_liquidityManager.setLocalLiquidityContainer(LockReleaseTokenPool(address(0))); + } +} + +contract LiquidityManager_setMinimumLiquidity is LiquidityManagerSetup { + event MinimumLiquiditySet(uint256 oldBalance, uint256 newBalance); + + function test_setMinimumLiquiditySuccess() external { + vm.expectEmit(); + emit MinimumLiquiditySet(uint256(0), uint256(1000)); + s_liquidityManager.setMinimumLiquidity(1000); + assertEq(s_liquidityManager.getMinimumLiquidity(), uint256(1000)); + } + + function test_OnlyOwnerReverts() external { + vm.stopPrank(); + vm.expectRevert("Only callable by owner"); + s_liquidityManager.setMinimumLiquidity(uint256(1000)); + } +} + +contract LiquidityManager_setFinanceRole is LiquidityManagerSetup { + event MinimumLiquiditySet(uint256 oldBalance, uint256 newBalance); + + function test_setFinanceRoleSuccess() external { + vm.expectEmit(); + address newFinanceRole = makeAddr("newFinanceRole"); + assertEq(s_liquidityManager.getFinanceRole(), FINANCE); + emit FinanceRoleSet(newFinanceRole); + s_liquidityManager.setFinanceRole(newFinanceRole); + assertEq(s_liquidityManager.getFinanceRole(), newFinanceRole); + } + + function test_OnlyOwnerReverts() external { + vm.stopPrank(); + vm.expectRevert("Only callable by owner"); + s_liquidityManager.setFinanceRole(address(1)); + } +} + +contract LiquidityManager_withdrawNative is LiquidityManagerSetup { + event NativeWithdrawn(uint256 amount, address destination); + + address private receiver = makeAddr("receiver"); + + function setUp() public override { + super.setUp(); + vm.deal(address(s_liquidityManager), 1); + } + + function test_withdrawNative_success() external { + assertEq(receiver.balance, 0); + vm.expectEmit(); + emit NativeWithdrawn(1, receiver); + vm.startPrank(FINANCE); + s_liquidityManager.withdrawNative(1, payable(receiver)); + assertEq(receiver.balance, 1); + } + + function test_OnlyFinanceRoleReverts() external { + vm.stopPrank(); + vm.expectRevert(LiquidityManager.OnlyFinanceRole.selector); + s_liquidityManager.withdrawNative(1, payable(receiver)); + } +} + +contract LiquidityManager_receive is LiquidityManagerSetup { + event NativeDeposited(uint256 amount, address depositor); + + address private depositor = makeAddr("depositor"); + + function test_receive_success() external { + vm.deal(depositor, 100); + uint256 before = address(s_liquidityManager).balance; + vm.expectEmit(); + emit NativeDeposited(100, depositor); + vm.startPrank(depositor); + payable(address(s_liquidityManager)).transfer(100); + assertEq(address(s_liquidityManager).balance, before + 100); + } +} + +contract LiquidityManager_withdrawERC20 is LiquidityManagerSetup { + function test_withdrawERC20Success() external { + uint256 amount = 100; + deal(address(s_otherToken), address(s_liquidityManager), amount); + assertEq(s_otherToken.balanceOf(address(1)), 0); + assertEq(s_otherToken.balanceOf(address(s_liquidityManager)), amount); + vm.startPrank(FINANCE); + s_liquidityManager.withdrawERC20(address(s_otherToken), amount, address(1)); + assertEq(s_otherToken.balanceOf(address(1)), amount); + assertEq(s_otherToken.balanceOf(address(s_liquidityManager)), 0); + } + + function test_withdrawERC20Reverts() external { + uint256 amount = 100; + deal(address(s_otherToken), address(s_liquidityManager), amount); + vm.startPrank(STRANGER); + vm.expectRevert(LiquidityManager.OnlyFinanceRole.selector); + s_liquidityManager.withdrawERC20(address(s_otherToken), amount, address(1)); + } +} diff --git a/contracts/src/v0.8/liquiditymanager/test/LiquidityManagerBaseTest.t.sol b/contracts/src/v0.8/liquiditymanager/test/LiquidityManagerBaseTest.t.sol new file mode 100644 index 00000000000..128a03f255a --- /dev/null +++ b/contracts/src/v0.8/liquiditymanager/test/LiquidityManagerBaseTest.t.sol @@ -0,0 +1,43 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {Test} from "forge-std/Test.sol"; + +import {WETH9} from "../../ccip/test/WETH9.sol"; + +import {ERC20} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/ERC20.sol"; +import {IERC20} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/IERC20.sol"; + +contract LiquidityManagerBaseTest is Test { + // ERC20 events + event Transfer(address indexed from, address indexed to, uint256 value); + event Approval(address indexed owner, address indexed spender, uint256 value); + + IERC20 internal s_l1Token; + IERC20 internal s_l2Token; + IERC20 internal s_otherToken; + WETH9 internal s_l1Weth; + WETH9 internal s_l2Weth; + + uint64 internal immutable i_localChainSelector = 1234; + uint64 internal immutable i_remoteChainSelector = 9876; + + address internal constant FINANCE = address(0x00000fffffffffffffffffffff); + address internal constant OWNER = address(0x00000078772732723782873283); + address internal constant STRANGER = address(0x00000999999911111111222222); + + function setUp() public virtual { + s_l1Token = new ERC20("l1", "L1"); + s_l2Token = new ERC20("l2", "L2"); + s_otherToken = new ERC20("other", "OTHER"); + + s_l1Weth = new WETH9(); + s_l2Weth = new WETH9(); + + vm.startPrank(OWNER); + + vm.label(FINANCE, "FINANCE"); + vm.label(OWNER, "OWNER"); + vm.label(STRANGER, "STRANGER"); + } +} diff --git a/contracts/src/v0.8/liquiditymanager/test/bridge-adapters/ArbitrumL1BridgeAdapter.t.sol b/contracts/src/v0.8/liquiditymanager/test/bridge-adapters/ArbitrumL1BridgeAdapter.t.sol new file mode 100644 index 00000000000..8afea2d680d --- /dev/null +++ b/contracts/src/v0.8/liquiditymanager/test/bridge-adapters/ArbitrumL1BridgeAdapter.t.sol @@ -0,0 +1,98 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {IWrappedNative} from "../../../ccip/interfaces/IWrappedNative.sol"; + +import {ArbitrumL1BridgeAdapter, IOutbox} from "../../bridge-adapters/ArbitrumL1BridgeAdapter.sol"; +import "forge-std/Test.sol"; + +import {IL1GatewayRouter} from "@arbitrum/token-bridge-contracts/contracts/tokenbridge/ethereum/gateway/IL1GatewayRouter.sol"; +import {IGatewayRouter} from "@arbitrum/token-bridge-contracts/contracts/tokenbridge/libraries/gateway/IGatewayRouter.sol"; +import {IERC20} from "../../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/IERC20.sol"; + +//contract ArbitrumL1BridgeAdapterSetup is Test { +// uint256 internal mainnetFork; +// uint256 internal arbitrumFork; +// +// string internal constant MAINNET_RPC_URL = ""; +// +// address internal constant L1_GATEWAY_ROUTER = 0x72Ce9c846789fdB6fC1f34aC4AD25Dd9ef7031ef; +// address internal constant L1_ERC20_GATEWAY = 0xa3A7B6F88361F48403514059F1F16C8E78d60EeC; +// address internal constant L1_INBOX = 0x4Dbd4fc535Ac27206064B68FfCf827b0A60BAB3f; +// // inbox 0x5aED5f8A1e3607476F1f81c3d8fe126deB0aFE94? +// address internal constant L1_OUTBOX = 0x0B9857ae2D4A3DBe74ffE1d7DF045bb7F96E4840; +// +// IERC20 internal constant L1_LINK = IERC20(0x514910771AF9Ca656af840dff83E8264EcF986CA); +// IWrappedNative internal constant L1_WRAPPED_NATIVE = IWrappedNative(0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2); +// +// address internal constant L2_GATEWAY_ROUTER = 0x5288c571Fd7aD117beA99bF60FE0846C4E84F933; +// address internal constant L2_ETH_WITHDRAWAL_PRECOMPILE = 0x0000000000000000000000000000000000000064; +// +// IERC20 internal constant L2_LINK = IERC20(0xf97f4df75117a78c1A5a0DBb814Af92458539FB4); +// IWrappedNative internal constant L2_WRAPPED_NATIVE = IWrappedNative(0x82aF49447D8a07e3bd95BD0d56f35241523fBab1); +// +// ArbitrumL1BridgeAdapter internal s_l1BridgeAdapter; +// +// uint256 internal constant TOKEN_BALANCE = 10e18; +// address internal constant OWNER = address(0xdead); +// +// function setUp() public { +// vm.startPrank(OWNER); +// +// mainnetFork = vm.createFork(MAINNET_RPC_URL); +// vm.selectFork(mainnetFork); +// +// s_l1BridgeAdapter = new ArbitrumL1BridgeAdapter( +// IL1GatewayRouter(L1_GATEWAY_ROUTER), +// IOutbox(L1_OUTBOX), +// L1_ERC20_GATEWAY +// ); +// +// deal(address(L1_LINK), OWNER, TOKEN_BALANCE); +// deal(address(L1_WRAPPED_NATIVE), OWNER, TOKEN_BALANCE); +// +// vm.label(OWNER, "Owner"); +// vm.label(L1_GATEWAY_ROUTER, "L1GatewayRouter"); +// vm.label(L1_ERC20_GATEWAY, "L1 ERC20 Gateway"); +// } +//} +// +//contract ArbitrumL1BridgeAdapter_sendERC20 is ArbitrumL1BridgeAdapterSetup { +// event TransferRouted(address indexed token, address indexed _userFrom, address indexed _userTo, address gateway); +// +// function test_sendERC20Success() public { +// L1_LINK.approve(address(s_l1BridgeAdapter), TOKEN_BALANCE); +// +// vm.expectEmit(); +// emit TransferRouted(address(L1_LINK), address(s_l1BridgeAdapter), OWNER, L1_ERC20_GATEWAY); +// +// uint256 expectedCost = s_l1BridgeAdapter.MAX_GAS() * +// s_l1BridgeAdapter.GAS_PRICE_BID() + +// s_l1BridgeAdapter.MAX_SUBMISSION_COST(); +// +// s_l1BridgeAdapter.sendERC20{value: expectedCost}(address(L1_LINK), OWNER, OWNER, TOKEN_BALANCE); +// } +// +// function test_BridgeFeeTooLowReverts() public { +// L1_LINK.approve(address(s_l1BridgeAdapter), TOKEN_BALANCE); +// uint256 expectedCost = s_l1BridgeAdapter.MAX_GAS() * +// s_l1BridgeAdapter.GAS_PRICE_BID() + +// s_l1BridgeAdapter.MAX_SUBMISSION_COST(); +// +// vm.expectRevert( +// abi.encodeWithSelector(ArbitrumL1BridgeAdapter.InsufficientEthValue.selector, expectedCost, expectedCost - 1) +// ); +// +// s_l1BridgeAdapter.sendERC20{value: expectedCost - 1}(address(L1_LINK), OWNER, OWNER, TOKEN_BALANCE); +// } +// +// function test_noApprovalReverts() public { +// uint256 expectedCost = s_l1BridgeAdapter.MAX_GAS() * +// s_l1BridgeAdapter.GAS_PRICE_BID() + +// s_l1BridgeAdapter.MAX_SUBMISSION_COST(); +// +// vm.expectRevert("SafeERC20: low-level call failed"); +// +// s_l1BridgeAdapter.sendERC20{value: expectedCost}(address(L1_LINK), OWNER, OWNER, TOKEN_BALANCE); +// } +//} diff --git a/contracts/src/v0.8/liquiditymanager/test/bridge-adapters/ArbitrumL2BridgeAdapter.t.sol b/contracts/src/v0.8/liquiditymanager/test/bridge-adapters/ArbitrumL2BridgeAdapter.t.sol new file mode 100644 index 00000000000..e34ff0480c0 --- /dev/null +++ b/contracts/src/v0.8/liquiditymanager/test/bridge-adapters/ArbitrumL2BridgeAdapter.t.sol @@ -0,0 +1,51 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {IWrappedNative} from "../../../ccip/interfaces/IWrappedNative.sol"; + +import {ArbitrumL2BridgeAdapter, IL2GatewayRouter} from "../../bridge-adapters/ArbitrumL2BridgeAdapter.sol"; +import "forge-std/Test.sol"; + +import {IERC20} from "../../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/IERC20.sol"; + +//contract ArbitrumL2BridgeAdapterSetup is Test { +// uint256 internal arbitrumFork; +// +// string internal constant ARBITRUM_RPC_URL = ""; +// +// address internal constant L2_GATEWAY_ROUTER = 0x5288c571Fd7aD117beA99bF60FE0846C4E84F933; +// address internal constant L2_ETH_WITHDRAWAL_PRECOMPILE = 0x0000000000000000000000000000000000000064; +// +// IERC20 internal constant L1_LINK = IERC20(0x514910771AF9Ca656af840dff83E8264EcF986CA); +// IERC20 internal constant L2_LINK = IERC20(0xf97f4df75117a78c1A5a0DBb814Af92458539FB4); +// IWrappedNative internal constant L2_WRAPPED_NATIVE = IWrappedNative(0x82aF49447D8a07e3bd95BD0d56f35241523fBab1); +// +// uint256 internal constant TOKEN_BALANCE = 10e18; +// address internal constant OWNER = address(0xdead); +// +// ArbitrumL2BridgeAdapter internal s_l2BridgeAdapter; +// +// function setUp() public { +// vm.startPrank(OWNER); +// +// arbitrumFork = vm.createFork(ARBITRUM_RPC_URL); +// +// vm.selectFork(arbitrumFork); +// s_l2BridgeAdapter = new ArbitrumL2BridgeAdapter(IL2GatewayRouter(L2_GATEWAY_ROUTER)); +// deal(address(L2_LINK), OWNER, TOKEN_BALANCE); +// deal(address(L2_WRAPPED_NATIVE), OWNER, TOKEN_BALANCE); +// +// vm.label(OWNER, "Owner"); +// vm.label(L2_GATEWAY_ROUTER, "L2GatewayRouterProxy"); +// vm.label(0xe80eb0238029333e368e0bDDB7acDf1b9cb28278, "L2GatewayRouter"); +// vm.label(L2_ETH_WITHDRAWAL_PRECOMPILE, "Precompile: ArbSys"); +// } +//} +// +//contract ArbitrumL2BridgeAdapter_sendERC20 is ArbitrumL2BridgeAdapterSetup { +// function test_sendERC20Success() public { +// L2_LINK.approve(address(s_l2BridgeAdapter), TOKEN_BALANCE); +// +// s_l2BridgeAdapter.sendERC20(address(L1_LINK), address(L2_LINK), OWNER, TOKEN_BALANCE); +// } +//} diff --git a/contracts/src/v0.8/liquiditymanager/test/bridge-adapters/OptimismL1BridgeAdapter.t.sol b/contracts/src/v0.8/liquiditymanager/test/bridge-adapters/OptimismL1BridgeAdapter.t.sol new file mode 100644 index 00000000000..cface1d5067 --- /dev/null +++ b/contracts/src/v0.8/liquiditymanager/test/bridge-adapters/OptimismL1BridgeAdapter.t.sol @@ -0,0 +1,129 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import "forge-std/Test.sol"; + +import {IWrappedNative} from "../../../ccip/interfaces/IWrappedNative.sol"; +import {WETH9} from "../../../ccip/test/WETH9.sol"; +import {OptimismL1BridgeAdapter} from "../../bridge-adapters/OptimismL1BridgeAdapter.sol"; +import {Types} from "../../interfaces/optimism/Types.sol"; +import {IOptimismPortal} from "../../interfaces/optimism/IOptimismPortal.sol"; + +import {IL1StandardBridge} from "@eth-optimism/contracts/L1/messaging/IL1StandardBridge.sol"; + +import {IERC20} from "../../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/IERC20.sol"; + +contract OptimismL1BridgeAdapterSetup is Test { + // addresses below are fake + address internal constant L1_STANDARD_BRIDGE = address(1234); + address internal constant OP_PORTAL = address(4567); + address internal constant OWNER = address(0xdead); + + OptimismL1BridgeAdapter internal s_adapter; + + function setUp() public { + vm.startPrank(OWNER); + + // deploy wrapped native + WETH9 weth = new WETH9(); + + // deploy bridge adapter + s_adapter = new OptimismL1BridgeAdapter( + IL1StandardBridge(L1_STANDARD_BRIDGE), + IWrappedNative(address(weth)), + IOptimismPortal(OP_PORTAL) + ); + } +} + +contract OptimismL1BridgeAdapter_finalizeWithdrawERC20 is OptimismL1BridgeAdapterSetup { + function testfinalizeWithdrawERC20proveWithdrawalSuccess() public { + // prepare payload + OptimismL1BridgeAdapter.OptimismProveWithdrawalPayload memory provePayload = OptimismL1BridgeAdapter + .OptimismProveWithdrawalPayload({ + withdrawalTransaction: Types.WithdrawalTransaction({ + nonce: 1, + sender: address(0xdead), + target: address(0xbeef), + value: 1234, + gasLimit: 4567, + data: hex"deadbeef" + }), + l2OutputIndex: 1234, + outputRootProof: Types.OutputRootProof({ + version: bytes32(0), + stateRoot: bytes32(uint256(500)), + messagePasserStorageRoot: bytes32(uint256(600)), + latestBlockhash: bytes32(uint256(700)) + }), + withdrawalProof: new bytes[](0) + }); + OptimismL1BridgeAdapter.FinalizeWithdrawERC20Payload memory payload; + payload.action = OptimismL1BridgeAdapter.FinalizationAction.ProveWithdrawal; + payload.data = abi.encode(provePayload); + + bytes memory encodedPayload = abi.encode(payload); + + // mock out call to optimism portal + vm.mockCall( + OP_PORTAL, + abi.encodeWithSelector( + IOptimismPortal.proveWithdrawalTransaction.selector, + provePayload.withdrawalTransaction, + provePayload.l2OutputIndex, + provePayload.outputRootProof, + provePayload.withdrawalProof + ), + "" + ); + + // call finalizeWithdrawERC20 + s_adapter.finalizeWithdrawERC20(address(0), address(0), encodedPayload); + } + + function testfinalizeWithdrawERC20FinalizeSuccess() public { + // prepare payload + OptimismL1BridgeAdapter.OptimismFinalizationPayload memory finalizePayload = OptimismL1BridgeAdapter + .OptimismFinalizationPayload({ + withdrawalTransaction: Types.WithdrawalTransaction({ + nonce: 1, + sender: address(0xdead), + target: address(0xbeef), + value: 1234, + gasLimit: 4567, + data: hex"deadbeef" + }) + }); + OptimismL1BridgeAdapter.FinalizeWithdrawERC20Payload memory payload; + payload.action = OptimismL1BridgeAdapter.FinalizationAction.FinalizeWithdrawal; + payload.data = abi.encode(finalizePayload); + + bytes memory encodedPayload = abi.encode(payload); + + // mock out call to optimism portal + vm.mockCall( + OP_PORTAL, + abi.encodeWithSelector( + IOptimismPortal.finalizeWithdrawalTransaction.selector, + finalizePayload.withdrawalTransaction + ), + "" + ); + + // call finalizeWithdrawERC20 + s_adapter.finalizeWithdrawERC20(address(0), address(0), encodedPayload); + } + + function testFinalizeWithdrawERC20Reverts() public { + // case 1: badly encoded payload + bytes memory payload = abi.encode(1, 2, 3); + vm.expectRevert(); + s_adapter.finalizeWithdrawERC20(address(0), address(0), payload); + + // case 2: invalid action + // can't prepare the payload in solidity + payload = hex"0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000004deadbeef00000000000000000000000000000000000000000000000000000000"; + vm.expectRevert(); + s_adapter.finalizeWithdrawERC20(address(0), address(0), payload); + } +} diff --git a/contracts/src/v0.8/liquiditymanager/test/helpers/LiquidityManagerHelper.sol b/contracts/src/v0.8/liquiditymanager/test/helpers/LiquidityManagerHelper.sol new file mode 100644 index 00000000000..9b4654a07ff --- /dev/null +++ b/contracts/src/v0.8/liquiditymanager/test/helpers/LiquidityManagerHelper.sol @@ -0,0 +1,22 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.0; + +import {ILiquidityContainer} from "../../interfaces/ILiquidityContainer.sol"; + +import {LiquidityManager} from "../../LiquidityManager.sol"; + +import {IERC20} from "../../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/IERC20.sol"; + +contract LiquidityManagerHelper is LiquidityManager { + constructor( + IERC20 token, + uint64 localChainSelector, + ILiquidityContainer localLiquidityContainer, + uint256 targetTokens, + address finance + ) LiquidityManager(token, localChainSelector, localLiquidityContainer, targetTokens, finance) {} + + function report(bytes calldata rep, uint64 ocrSeqNum) external { + _report(rep, ocrSeqNum); + } +} diff --git a/contracts/src/v0.8/liquiditymanager/test/helpers/OCR3Helper.sol b/contracts/src/v0.8/liquiditymanager/test/helpers/OCR3Helper.sol new file mode 100644 index 00000000000..b2cd2ef3712 --- /dev/null +++ b/contracts/src/v0.8/liquiditymanager/test/helpers/OCR3Helper.sol @@ -0,0 +1,41 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {OCR3Base} from "../../ocr/OCR3Base.sol"; + +contract OCR3Helper is OCR3Base { + function configDigestFromConfigData( + uint256 chainSelector, + address contractAddress, + uint64 configCount, + address[] memory signers, + address[] memory transmitters, + uint8 f, + bytes memory onchainConfig, + uint64 offchainConfigVersion, + bytes memory offchainConfig + ) public pure returns (bytes32) { + return + _configDigestFromConfigData( + chainSelector, + contractAddress, + configCount, + signers, + transmitters, + f, + onchainConfig, + offchainConfigVersion, + offchainConfig + ); + } + + function _report(bytes calldata report, uint64 sequenceNumber) internal override {} + + function typeAndVersion() public pure override returns (string memory) { + return "OCR3BaseHelper 1.0.0"; + } + + function setLatestSeqNum(uint64 newSeqNum) external { + s_latestSequenceNumber = newSeqNum; + } +} diff --git a/contracts/src/v0.8/liquiditymanager/test/helpers/ReportEncoder.sol b/contracts/src/v0.8/liquiditymanager/test/helpers/ReportEncoder.sol new file mode 100644 index 00000000000..ff5e21f2e14 --- /dev/null +++ b/contracts/src/v0.8/liquiditymanager/test/helpers/ReportEncoder.sol @@ -0,0 +1,10 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.0; + +import {ILiquidityManager} from "../../interfaces/ILiquidityManager.sol"; + +/// @dev this is needed to generate the types to help encode the report offchain +abstract contract ReportEncoder is ILiquidityManager { + /// @dev exposed so that we can encode the report for OCR offchain + function exposeForEncoding(ILiquidityManager.LiquidityInstructions memory instructions) public pure {} +} diff --git a/contracts/src/v0.8/liquiditymanager/test/mocks/MockBridgeAdapter.sol b/contracts/src/v0.8/liquiditymanager/test/mocks/MockBridgeAdapter.sol new file mode 100644 index 00000000000..f51c60fcf3d --- /dev/null +++ b/contracts/src/v0.8/liquiditymanager/test/mocks/MockBridgeAdapter.sol @@ -0,0 +1,191 @@ +// SPDX-License-Identifier: BUSL-1.1 +// solhint-disable one-contract-per-file +pragma solidity ^0.8.0; + +import {IBridgeAdapter} from "../../interfaces/IBridge.sol"; +import {ILiquidityContainer} from "../../interfaces/ILiquidityContainer.sol"; +import {IWrappedNative} from "../../../ccip/interfaces/IWrappedNative.sol"; + +import {IERC20} from "../../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/IERC20.sol"; +import {SafeERC20} from "../../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/utils/SafeERC20.sol"; + +/// @notice Mock multiple-stage finalization bridge adapter implementation. +/// @dev Funds are only made available after both the prove and finalization steps are completed. +/// Sends the L1 tokens from the msg sender to address(this). +contract MockL1BridgeAdapter is IBridgeAdapter, ILiquidityContainer { + using SafeERC20 for IERC20; + + error InsufficientLiquidity(); + error NonceAlreadyUsed(uint256 nonce); + error InvalidFinalizationAction(); + error NonceNotProven(uint256 nonce); + error NativeSendFailed(); + + /// @notice Payload to "prove" the withdrawal. + /// @dev This is just a mock setup, there's no real proving. This is so that + /// we can test the multi-step finalization code path. + /// @param nonce the nonce emitted on the remote chain. + struct ProvePayload { + uint256 nonce; + } + + /// @notice Payload to "finalize" the withdrawal. + /// @dev This is just a mock setup, there's no real finalization. This is so that + /// we can test the multi-step finalization code path. + /// @param nonce the nonce emitted on the remote chain. + struct FinalizePayload { + uint256 nonce; + uint256 amount; + } + + /// @notice The finalization action to take. + /// @dev This emulates Optimism's two-step withdrawal process. + enum FinalizationAction { + ProveWithdrawal, + FinalizeWithdrawal + } + + /// @notice The payload to use for the bridgeSpecificPayload in the finalizeWithdrawERC20 function. + struct Payload { + FinalizationAction action; + bytes data; + } + + IERC20 internal immutable i_token; + uint256 internal s_nonce = 1; + mapping(uint256 => bool) internal s_nonceProven; + mapping(uint256 => bool) internal s_nonceFinalized; + + /// @dev For test cases where we want to send pure native upon finalizeWithdrawERC20 being called. + /// This is to emulate the behavior of bridges that do not bridge wrapped native. + bool internal immutable i_holdNative; + + constructor(IERC20 token, bool holdNative) { + i_token = token; + i_holdNative = holdNative; + } + + /// @dev The receive function is needed for IWrappedNative.withdraw() to work. + receive() external payable {} + + /// @notice Simply transferFrom msg.sender the tokens that are to be bridged to address(this). + function sendERC20( + address localToken, + address /* remoteToken */, + address /* remoteReceiver */, + uint256 amount, + bytes calldata /* bridgeSpecificPayload */ + ) external payable override returns (bytes memory) { + IERC20(localToken).transferFrom(msg.sender, address(this), amount); + + // If the flag to hold native is set we assume that i_token points to a WETH contract + // and withdraw native. + // This way we can transfer the raw native back to the sender upon finalization. + if (i_holdNative) { + IWrappedNative(address(i_token)).withdraw(amount); + } + + bytes memory encodedNonce = abi.encode(s_nonce++); + return encodedNonce; + } + + function getBridgeFeeInNative() external pure returns (uint256) { + return 0; + } + + function provideLiquidity(uint256 amount) external { + i_token.safeTransferFrom(msg.sender, address(this), amount); + emit LiquidityAdded(msg.sender, amount); + } + + function withdrawLiquidity(uint256 amount) external { + if (i_token.balanceOf(address(this)) < amount) revert InsufficientLiquidity(); + i_token.safeTransfer(msg.sender, amount); + emit LiquidityRemoved(msg.sender, amount); + } + + /// @dev for easy encoding offchain + function encodeProvePayload(ProvePayload memory payload) external pure {} + + function encodeFinalizePayload(FinalizePayload memory payload) external pure {} + + function encodePayload(Payload memory payload) external pure {} + + /// @dev Test setup is trusted, so just transfer the tokens to the localReceiver, + /// which should be the local rebalancer. Infer the amount from the bridgeSpecificPayload. + /// Note that this means that this bridge adapter will need to have some tokens, + /// however this is ok in a test environment since we will have infinite tokens. + /// @param localReceiver the address to transfer the tokens to. + /// @param bridgeSpecificPayload the payload to use for the finalization or proving. + /// @return true if the transfer was successful, revert otherwise. + function finalizeWithdrawERC20( + address /* remoteSender */, + address localReceiver, + bytes calldata bridgeSpecificPayload + ) external override returns (bool) { + Payload memory payload = abi.decode(bridgeSpecificPayload, (Payload)); + if (payload.action == FinalizationAction.ProveWithdrawal) { + return _proveWithdrawal(payload); + } else if (payload.action == FinalizationAction.FinalizeWithdrawal) { + return _finalizeWithdrawal(payload, localReceiver); + } + revert InvalidFinalizationAction(); + } + + function _proveWithdrawal(Payload memory payload) internal returns (bool) { + ProvePayload memory provePayload = abi.decode(payload.data, (ProvePayload)); + if (s_nonceProven[provePayload.nonce]) revert NonceAlreadyUsed(provePayload.nonce); + s_nonceProven[provePayload.nonce] = true; + return false; + } + + function _finalizeWithdrawal(Payload memory payload, address localReceiver) internal returns (bool) { + FinalizePayload memory finalizePayload = abi.decode(payload.data, (FinalizePayload)); + if (!s_nonceProven[finalizePayload.nonce]) revert NonceNotProven(finalizePayload.nonce); + if (s_nonceFinalized[finalizePayload.nonce]) revert NonceAlreadyUsed(finalizePayload.nonce); + s_nonceFinalized[finalizePayload.nonce] = true; + // re-entrancy prevented by nonce checks above. + _transferTokens(finalizePayload.amount, localReceiver); + return true; + } + + function _transferTokens(uint256 amount, address localReceiver) internal { + if (i_holdNative) { + (bool success, ) = payable(localReceiver).call{value: amount}(""); + if (!success) { + revert NativeSendFailed(); + } + } else { + i_token.safeTransfer(localReceiver, amount); + } + } +} + +/// @notice Mock L2 Bridge adapter +/// @dev Sends the L2 tokens from the msg sender to address(this) +contract MockL2BridgeAdapter is IBridgeAdapter { + /// @notice Simply transferFrom msg.sender the tokens that are to be bridged. + function sendERC20( + address localToken, + address /* remoteToken */, + address /* recipient */, + uint256 amount, + bytes calldata /* bridgeSpecificPayload */ + ) external payable override returns (bytes memory) { + IERC20(localToken).transferFrom(msg.sender, address(this), amount); + return ""; + } + + function getBridgeFeeInNative() external pure returns (uint256) { + return 0; + } + + // No-op + function finalizeWithdrawERC20( + address /* remoteSender */, + address /* localReceiver */, + bytes calldata /* bridgeSpecificData */ + ) external pure override returns (bool) { + return true; + } +} diff --git a/contracts/src/v0.8/liquiditymanager/test/mocks/NoOpOCR3.sol b/contracts/src/v0.8/liquiditymanager/test/mocks/NoOpOCR3.sol new file mode 100644 index 00000000000..5e771f0ccd6 --- /dev/null +++ b/contracts/src/v0.8/liquiditymanager/test/mocks/NoOpOCR3.sol @@ -0,0 +1,18 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.0; + +import {OCR3Base} from "../../ocr/OCR3Base.sol"; + +// NoOpOCR3 is a mock implementation of the OCR3Base contract that does nothing +// This is so that we can generate gethwrappers for the contract and use the OCR3 ABI in +// Go code. +contract NoOpOCR3 is OCR3Base { + // solhint-disable-next-line chainlink-solidity/all-caps-constant-storage-variables + string public constant override typeAndVersion = "NoOpOCR3 1.0.0"; + + constructor() OCR3Base() {} + + function _report(bytes calldata, uint64) internal override { + // do nothing + } +} diff --git a/contracts/src/v0.8/liquiditymanager/test/ocr/OCR3Base.t.sol b/contracts/src/v0.8/liquiditymanager/test/ocr/OCR3Base.t.sol new file mode 100644 index 00000000000..840e90fb876 --- /dev/null +++ b/contracts/src/v0.8/liquiditymanager/test/ocr/OCR3Base.t.sol @@ -0,0 +1,337 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.24; + +import {OCR3Setup} from "./OCR3Setup.t.sol"; +import {OCR3Base} from "../../ocr/OCR3Base.sol"; +import {OCR3Helper} from "../helpers/OCR3Helper.sol"; + +contract OCR3BaseSetup is OCR3Setup { + event ConfigSet( + uint32 previousConfigBlockNumber, + bytes32 configDigest, + uint64 configCount, + address[] signers, + address[] transmitters, + uint8 f, + bytes onchainConfig, + uint64 offchainConfigVersion, + bytes offchainConfig + ); + + OCR3Helper internal s_OCR3Base; + + bytes32[] internal s_rs; + bytes32[] internal s_ss; + bytes32 internal s_rawVs; + + uint40 internal s_latestEpochAndRound; + + function setUp() public virtual override { + OCR3Setup.setUp(); + s_OCR3Base = new OCR3Helper(); + + bytes32 testReportDigest = getTestReportDigest(); + + bytes32[] memory rs = new bytes32[](2); + bytes32[] memory ss = new bytes32[](2); + uint8[] memory vs = new uint8[](2); + + // Calculate signatures + (vs[0], rs[0], ss[0]) = vm.sign(PRIVATE0, testReportDigest); + (vs[1], rs[1], ss[1]) = vm.sign(PRIVATE1, testReportDigest); + + s_rs = rs; + s_ss = ss; + s_rawVs = bytes32(bytes1(vs[0] - 27)) | (bytes32(bytes1(vs[1] - 27)) >> 8); + } + + function getBasicConfigDigest(uint8 f, uint64 currentConfigCount) internal view returns (bytes32) { + bytes memory configBytes = abi.encode(""); + return + s_OCR3Base.configDigestFromConfigData( + block.chainid, + address(s_OCR3Base), + currentConfigCount + 1, + s_valid_signers, + s_valid_transmitters, + f, + configBytes, + s_offchainConfigVersion, + configBytes + ); + } + + function getTestReportDigest() internal view returns (bytes32) { + bytes32 configDigest = getBasicConfigDigest(s_f, 0); + bytes32[3] memory reportContext = [configDigest, configDigest, configDigest]; + return keccak256(abi.encodePacked(keccak256(REPORT), reportContext)); + } + + function getBasicConfigDigest( + address contractAddress, + uint8 f, + uint64 currentConfigCount, + bytes memory onchainConfig + ) internal view returns (bytes32) { + return + s_OCR3Base.configDigestFromConfigData( + block.chainid, + contractAddress, + currentConfigCount + 1, + s_valid_signers, + s_valid_transmitters, + f, + onchainConfig, + s_offchainConfigVersion, + abi.encode("") + ); + } +} + +contract OCR3Base_transmit is OCR3BaseSetup { + bytes32 internal s_configDigest; + + function setUp() public virtual override { + OCR3BaseSetup.setUp(); + bytes memory configBytes = abi.encode(""); + + s_configDigest = getBasicConfigDigest(s_f, 0); + s_OCR3Base.setOCR3Config( + s_valid_signers, + s_valid_transmitters, + s_f, + configBytes, + s_offchainConfigVersion, + configBytes + ); + } + + function testTransmit2SignersSuccess_gas() public { + vm.pauseGasMetering(); + bytes32[3] memory reportContext = [s_configDigest, s_configDigest, s_configDigest]; + + vm.startPrank(s_valid_transmitters[0]); + vm.resumeGasMetering(); + s_OCR3Base.transmit(reportContext, REPORT, s_rs, s_ss, s_rawVs); + } + + // Reverts + + function testNonIncreasingSequenceNumberReverts() public { + bytes32[3] memory reportContext = [s_configDigest, bytes32(uint256(0)) /* sequence number */, s_configDigest]; + + vm.expectRevert(abi.encodeWithSelector(OCR3Base.NonIncreasingSequenceNumber.selector, 0, 0)); + s_OCR3Base.transmit(reportContext, REPORT, s_rs, s_ss, s_rawVs); + } + + function testForkedChainReverts() public { + bytes32[3] memory reportContext = [s_configDigest, s_configDigest, s_configDigest]; + + uint256 chain1 = block.chainid; + uint256 chain2 = chain1 + 1; + vm.chainId(chain2); + vm.expectRevert(abi.encodeWithSelector(OCR3Base.ForkedChain.selector, chain1, chain2)); + vm.startPrank(s_valid_transmitters[0]); + s_OCR3Base.transmit(reportContext, REPORT, s_rs, s_ss, s_rawVs); + } + + function testWrongNumberOfSignaturesReverts() public { + bytes32[3] memory reportContext = [s_configDigest, s_configDigest, s_configDigest]; + + vm.expectRevert(OCR3Base.WrongNumberOfSignatures.selector); + s_OCR3Base.transmit(reportContext, REPORT, new bytes32[](0), new bytes32[](0), s_rawVs); + } + + function testConfigDigestMismatchReverts() public { + bytes32 configDigest; + bytes32[3] memory reportContext = [configDigest, bytes32(uint256(1)) /* sequence number */, configDigest]; + + vm.expectRevert(abi.encodeWithSelector(OCR3Base.ConfigDigestMismatch.selector, s_configDigest, configDigest)); + s_OCR3Base.transmit(reportContext, REPORT, new bytes32[](0), new bytes32[](0), s_rawVs); + } + + function testSignatureOutOfRegistrationReverts() public { + bytes32[3] memory reportContext = [s_configDigest, s_configDigest, s_configDigest]; + + bytes32[] memory rs = new bytes32[](2); + bytes32[] memory ss = new bytes32[](1); + + vm.expectRevert(OCR3Base.SignaturesOutOfRegistration.selector); + s_OCR3Base.transmit(reportContext, REPORT, rs, ss, s_rawVs); + } + + function testUnAuthorizedTransmitterReverts() public { + bytes32[3] memory reportContext = [s_configDigest, s_configDigest, s_configDigest]; + bytes32[] memory rs = new bytes32[](2); + bytes32[] memory ss = new bytes32[](2); + + vm.expectRevert(OCR3Base.UnauthorizedTransmitter.selector); + s_OCR3Base.transmit(reportContext, REPORT, rs, ss, s_rawVs); + } + + function testNonUniqueSignatureReverts() public { + bytes32[3] memory reportContext = [s_configDigest, s_configDigest, s_configDigest]; + bytes32[] memory rs = s_rs; + bytes32[] memory ss = s_ss; + + rs[1] = rs[0]; + ss[1] = ss[0]; + // Need to reset the rawVs to be valid + bytes32 rawVs = bytes32(bytes1(uint8(28) - 27)) | (bytes32(bytes1(uint8(28) - 27)) >> 8); + + vm.startPrank(s_valid_transmitters[0]); + vm.expectRevert(OCR3Base.NonUniqueSignatures.selector); + s_OCR3Base.transmit(reportContext, REPORT, rs, ss, rawVs); + } + + function testUnauthorizedSignerReverts() public { + bytes32[3] memory reportContext = [s_configDigest, s_configDigest, s_configDigest]; + bytes32[] memory rs = new bytes32[](2); + rs[0] = s_configDigest; + bytes32[] memory ss = rs; + + vm.startPrank(s_valid_transmitters[0]); + vm.expectRevert(OCR3Base.UnauthorizedSigner.selector); + s_OCR3Base.transmit(reportContext, REPORT, rs, ss, s_rawVs); + } +} + +contract OCR3Base_setOCR3Config is OCR3BaseSetup { + function testSetConfigSuccess() public { + vm.pauseGasMetering(); + bytes memory configBytes = abi.encode(""); + uint32 configCount = 0; + + bytes32 configDigest = getBasicConfigDigest(s_f, configCount++); + + address[] memory transmitters = s_OCR3Base.getTransmitters(); + assertEq(0, transmitters.length); + + s_OCR3Base.setLatestSeqNum(3); + uint64 seqNum = s_OCR3Base.latestSequenceNumber(); + assertEq(seqNum, 3); + + vm.expectEmit(); + emit ConfigSet( + 0, + configDigest, + configCount, + s_valid_signers, + s_valid_transmitters, + s_f, + configBytes, + s_offchainConfigVersion, + configBytes + ); + + s_OCR3Base.setOCR3Config( + s_valid_signers, + s_valid_transmitters, + s_f, + configBytes, + s_offchainConfigVersion, + configBytes + ); + + transmitters = s_OCR3Base.getTransmitters(); + assertEq(s_valid_transmitters, transmitters); + + configDigest = getBasicConfigDigest(s_f, configCount++); + + seqNum = s_OCR3Base.latestSequenceNumber(); + assertEq(seqNum, 0); + + vm.expectEmit(); + emit ConfigSet( + uint32(block.number), + configDigest, + configCount, + s_valid_signers, + s_valid_transmitters, + s_f, + configBytes, + s_offchainConfigVersion, + configBytes + ); + vm.resumeGasMetering(); + s_OCR3Base.setOCR3Config( + s_valid_signers, + s_valid_transmitters, + s_f, + configBytes, + s_offchainConfigVersion, + configBytes + ); + } + + // Reverts + function testRepeatAddressReverts() public { + address[] memory signers = new address[](10); + signers[0] = address(1245678); + address[] memory transmitters = new address[](10); + transmitters[0] = signers[0]; + + vm.expectRevert(abi.encodeWithSelector(OCR3Base.InvalidConfig.selector, "repeated transmitter address")); + s_OCR3Base.setOCR3Config(signers, transmitters, 2, abi.encode(""), 100, abi.encode("")); + } + + function testSignerCannotBeZeroAddressReverts() public { + uint256 f = 1; + address[] memory signers = new address[](3 * f + 1); + address[] memory transmitters = new address[](3 * f + 1); + for (uint160 i = 0; i < 3 * f + 1; ++i) { + signers[i] = address(i + 1); + transmitters[i] = address(i + 1000); + } + + signers[0] = address(0); + + vm.expectRevert(OCR3Base.OracleCannotBeZeroAddress.selector); + s_OCR3Base.setOCR3Config(signers, transmitters, uint8(f), abi.encode(""), 100, abi.encode("")); + } + + function testTransmitterCannotBeZeroAddressReverts() public { + uint256 f = 1; + address[] memory signers = new address[](3 * f + 1); + address[] memory transmitters = new address[](3 * f + 1); + for (uint160 i = 0; i < 3 * f + 1; ++i) { + signers[i] = address(i + 1); + transmitters[i] = address(i + 1000); + } + + transmitters[0] = address(0); + + vm.expectRevert(OCR3Base.OracleCannotBeZeroAddress.selector); + s_OCR3Base.setOCR3Config(signers, transmitters, uint8(f), abi.encode(""), 100, abi.encode("")); + } + + function testOracleOutOfRegisterReverts() public { + address[] memory signers = new address[](10); + address[] memory transmitters = new address[](0); + + vm.expectRevert(abi.encodeWithSelector(OCR3Base.InvalidConfig.selector, "oracle addresses out of registration")); + s_OCR3Base.setOCR3Config(signers, transmitters, 2, abi.encode(""), 100, abi.encode("")); + } + + function testFTooHighReverts() public { + address[] memory signers = new address[](0); + uint8 f = 1; + + vm.expectRevert(abi.encodeWithSelector(OCR3Base.InvalidConfig.selector, "faulty-oracle f too high")); + s_OCR3Base.setOCR3Config(signers, new address[](0), f, abi.encode(""), 100, abi.encode("")); + } + + function testFMustBePositiveReverts() public { + uint8 f = 0; + + vm.expectRevert(abi.encodeWithSelector(OCR3Base.InvalidConfig.selector, "f must be positive")); + s_OCR3Base.setOCR3Config(new address[](0), new address[](0), f, abi.encode(""), 100, abi.encode("")); + } + + function testTooManySignersReverts() public { + address[] memory signers = new address[](32); + + vm.expectRevert(abi.encodeWithSelector(OCR3Base.InvalidConfig.selector, "too many signers")); + s_OCR3Base.setOCR3Config(signers, new address[](0), 0, abi.encode(""), 100, abi.encode("")); + } +} diff --git a/contracts/src/v0.8/liquiditymanager/test/ocr/OCR3Setup.t.sol b/contracts/src/v0.8/liquiditymanager/test/ocr/OCR3Setup.t.sol new file mode 100644 index 00000000000..ee60c58dcc6 --- /dev/null +++ b/contracts/src/v0.8/liquiditymanager/test/ocr/OCR3Setup.t.sol @@ -0,0 +1,34 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.0; + +import {LiquidityManagerBaseTest} from "../LiquidityManagerBaseTest.t.sol"; + +contract OCR3Setup is LiquidityManagerBaseTest { + // Signer private keys used for these test + uint256 internal constant PRIVATE0 = 0x7b2e97fe057e6de99d6872a2ef2abf52c9b4469bc848c2465ac3fcd8d336e81d; + uint256 internal constant PRIVATE1 = 0xab56160806b05ef1796789248e1d7f34a6465c5280899159d645218cd216cee6; + uint256 internal constant PRIVATE2 = 0x6ec7caa8406a49b76736602810e0a2871959fbbb675e23a8590839e4717f1f7f; + uint256 internal constant PRIVATE3 = 0x80f14b11da94ae7f29d9a7713ea13dc838e31960a5c0f2baf45ed458947b730a; + + address[] internal s_valid_signers; + address[] internal s_valid_transmitters; + + uint64 internal constant s_offchainConfigVersion = 3; + uint8 internal constant s_f = 1; + bytes internal constant REPORT = abi.encode("testReport"); + + function setUp() public virtual override { + LiquidityManagerBaseTest.setUp(); + + s_valid_transmitters = new address[](4); + for (uint160 i = 0; i < 4; ++i) { + s_valid_transmitters[i] = address(4 + i); + } + + s_valid_signers = new address[](4); + s_valid_signers[0] = vm.addr(PRIVATE0); //0xc110458BE52CaA6bB68E66969C3218A4D9Db0211 + s_valid_signers[1] = vm.addr(PRIVATE1); //0xc110a19c08f1da7F5FfB281dc93630923F8E3719 + s_valid_signers[2] = vm.addr(PRIVATE2); //0xc110fdF6e8fD679C7Cc11602d1cd829211A18e9b + s_valid_signers[3] = vm.addr(PRIVATE3); //0xc11028017c9b445B6bF8aE7da951B5cC28B326C0 + } +} diff --git a/contracts/src/v0.8/llo-feeds/dev/ChannelConfigStore.sol b/contracts/src/v0.8/llo-feeds/dev/ChannelConfigStore.sol deleted file mode 100644 index 6c6a5ec9b3e..00000000000 --- a/contracts/src/v0.8/llo-feeds/dev/ChannelConfigStore.sol +++ /dev/null @@ -1,105 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity ^0.8.19; - -import {ConfirmedOwner} from "../../shared/access/ConfirmedOwner.sol"; -import {IChannelConfigStore} from "./interfaces/IChannelConfigStore.sol"; -import {TypeAndVersionInterface} from "../../interfaces/TypeAndVersionInterface.sol"; - -contract ChannelConfigStore is ConfirmedOwner, IChannelConfigStore, TypeAndVersionInterface { - mapping(uint32 => ChannelDefinition) private s_channelDefinitions; - - // mapping(bytes32 => ChannelConfiguration) private s_channelProductionConfigurations; - // mapping(bytes32 => ChannelConfiguration) private s_channelStagingConfigurations; - - event NewChannelDefinition(uint32 channelId, ChannelDefinition channelDefinition); - event ChannelDefinitionRemoved(uint32 channelId); - // event NewProductionConfig(ChannelConfiguration channelConfig); - // event NewStagingConfig(ChannelConfiguration channelConfig); - event PromoteStagingConfig(uint32 channelId); - - error OnlyCallableByEOA(); - error StagingConfigAlreadyPromoted(); - error EmptyStreamIDs(); - error ZeroReportFormat(); - error ZeroChainSelector(); - error ChannelDefinitionNotFound(); - - constructor() ConfirmedOwner(msg.sender) {} - - // function setStagingConfig(bytes32 configDigest, ChannelConfiguration calldata channelConfig) external onlyOwner { - // s_channelStagingConfigurations[channelId] = channelConfig; - - // emit NewStagingConfig(channelConfig); - // } - - //// this will trigger the following: - //// - offchain ShouldRetireCache will start returning true for the old (production) - //// protocol instance - //// - once the old production instance retires it will generate a handover - //// retirement report - //// - the staging instance will become the new production instance once - //// any honest oracle that is on both instances forward the retirement - //// report from the old instance to the new instace via the - //// PredecessorRetirementReportCache - //// - //// Note: the promotion flow only works if the previous production instance - //// is working correctly & generating reports. If that's not the case, the - //// owner is expected to "setProductionConfig" directly instead. This will - //// cause "gaps" to be created, but that seems unavoidable in such a scenario. - // function promoteStagingConfig(bytes32 configDigest) external onlyOwner { - // ChannelConfiguration memory stagingConfig = s_channelStagingConfigurations[channelId]; - - // if(stagingConfig.channelConfigId.length == 0) { - // revert StagingConfigAlreadyPromoted(); - // } - - // s_channelProductionConfigurations[channelId] = s_channelStagingConfigurations[channelId]; - - // emit PromoteStagingConfig(channelId); - // } - - function addChannel(uint32 channelId, ChannelDefinition calldata channelDefinition) external onlyOwner { - if (channelDefinition.streamIDs.length == 0) { - revert EmptyStreamIDs(); - } - - if (channelDefinition.chainSelector == 0) { - revert ZeroChainSelector(); - } - - if (channelDefinition.reportFormat == 0) { - revert ZeroReportFormat(); - } - - s_channelDefinitions[channelId] = channelDefinition; - - emit NewChannelDefinition(channelId, channelDefinition); - } - - function removeChannel(uint32 channelId) external onlyOwner { - if (s_channelDefinitions[channelId].streamIDs.length == 0) { - revert ChannelDefinitionNotFound(); - } - - delete s_channelDefinitions[channelId]; - - emit ChannelDefinitionRemoved(channelId); - } - - function getChannelDefinitions(uint32 channelId) external view returns (ChannelDefinition memory) { - // solhint-disable-next-line avoid-tx-origin - if (msg.sender != tx.origin) { - revert OnlyCallableByEOA(); - } - - return s_channelDefinitions[channelId]; - } - - function typeAndVersion() external pure override returns (string memory) { - return "ChannelConfigStore 0.0.0"; - } - - function supportsInterface(bytes4 interfaceId) external pure returns (bool) { - return interfaceId == type(IChannelConfigStore).interfaceId; - } -} diff --git a/contracts/src/v0.8/llo-feeds/dev/ChannelVerifier.sol b/contracts/src/v0.8/llo-feeds/dev/ChannelVerifier.sol deleted file mode 100644 index 424022dc441..00000000000 --- a/contracts/src/v0.8/llo-feeds/dev/ChannelVerifier.sol +++ /dev/null @@ -1,536 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity 0.8.19; - -import {ConfirmedOwner} from "../../shared/access/ConfirmedOwner.sol"; -import {TypeAndVersionInterface} from "../../interfaces/TypeAndVersionInterface.sol"; -import {IERC165} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/interfaces/IERC165.sol"; -import {Common} from "../libraries/Common.sol"; -import {IChannelVerifier} from "./interfaces/IChannelVerifier.sol"; - -// OCR2 standard -uint256 constant MAX_NUM_ORACLES = 31; - -/* - * The verifier contract is used to verify offchain reports signed - * by DONs. A report consists of a price, block number and feed Id. It - * represents the observed price of an asset at a specified block number for - * a feed. The verifier contract is used to verify that such reports have - * been signed by the correct signers. - **/ -contract ChannelVerifier is IChannelVerifier, ConfirmedOwner, TypeAndVersionInterface { - // The first byte of the mask can be 0, because we only ever have 31 oracles - uint256 internal constant ORACLE_MASK = 0x0001010101010101010101010101010101010101010101010101010101010101; - - enum Role { - // Default role for an oracle address. This means that the oracle address - // is not a signer - Unset, - // Role given to an oracle address that is allowed to sign feed data - Signer - } - - struct Signer { - // Index of oracle in a configuration - uint8 index; - // The oracle's role - Role role; - } - - struct Config { - // Fault tolerance - uint8 f; - // Marks whether or not a configuration is active - bool isActive; - // Map of signer addresses to oracles - mapping(address => Signer) oracles; - } - - struct VerifierState { - // The number of times a new configuration - /// has been set - uint32 configCount; - // The block number of the block the last time - /// the configuration was updated. - uint32 latestConfigBlockNumber; - // The latest epoch a report was verified for - uint32 latestEpoch; - /// The latest config digest set - bytes32 latestConfigDigest; - /// List of deactivated feeds - mapping(bytes32 => bool) deactivatedFeeds; - /// The historical record of all previously set configs by feedId - mapping(bytes32 => Config) s_verificationDataConfigs; - } - - /// @notice This event is emitted when a new report is verified. - /// It is used to keep a historical record of verified reports. - event ReportVerified(bytes32 indexed feedId, address requester); - - /// @notice This event is emitted whenever a new configuration is set. It triggers a new run of the offchain reporting protocol. - event ConfigSet( - uint32 previousConfigBlockNumber, - bytes32 configDigest, - uint64 configCount, - address[] signers, - bytes32[] offchainTransmitters, - uint8 f, - bytes onchainConfig, - uint64 offchainConfigVersion, - bytes offchainConfig - ); - - /// @notice This event is emitted whenever a configuration is deactivated - event ConfigDeactivated(bytes32 configDigest); - - /// @notice This event is emitted whenever a configuration is activated - event ConfigActivated(bytes32 configDigest); - - /// @notice This event is emitted whenever a feed is activated - event FeedActivated(bytes32 indexed feedId); - - /// @notice This event is emitted whenever a feed is deactivated - event FeedDeactivated(bytes32 indexed feedId); - - /// @notice This error is thrown whenever an address tries - /// to exeecute a transaction that it is not authorized to do so - error AccessForbidden(); - - /// @notice This error is thrown whenever a zero address is passed - error ZeroAddress(); - - /// @notice This error is thrown whenever the feed ID passed in - /// a signed report is empty - error FeedIdEmpty(); - - /// @notice This error is thrown whenever the config digest - /// is empty - error DigestEmpty(); - - /// @notice This error is thrown whenever the config digest - /// passed in has not been set in this verifier - /// @param configDigest The config digest that has not been set - error DigestNotSet(bytes32 configDigest); - - /// @notice This error is thrown whenever the config digest - /// has been deactivated - /// @param configDigest The config digest that is inactive - error DigestInactive(bytes32 configDigest); - - /// @notice This error is thrown whenever trying to set a config - /// with a fault tolerance of 0 - error FaultToleranceMustBePositive(); - - /// @notice This error is thrown whenever a report is signed - /// with more than the max number of signers - /// @param numSigners The number of signers who have signed the report - /// @param maxSigners The maximum number of signers that can sign a report - error ExcessSigners(uint256 numSigners, uint256 maxSigners); - - /// @notice This error is thrown whenever a report is signed - /// with less than the minimum number of signers - /// @param numSigners The number of signers who have signed the report - /// @param minSigners The minimum number of signers that need to sign a report - error InsufficientSigners(uint256 numSigners, uint256 minSigners); - - /// @notice This error is thrown whenever a report is signed - /// with an incorrect number of signers - /// @param numSigners The number of signers who have signed the report - /// @param expectedNumSigners The expected number of signers that need to sign - /// a report - error IncorrectSignatureCount(uint256 numSigners, uint256 expectedNumSigners); - - /// @notice This error is thrown whenever the R and S signer components - /// have different lengths - /// @param rsLength The number of r signature components - /// @param ssLength The number of s signature components - error MismatchedSignatures(uint256 rsLength, uint256 ssLength); - - /// @notice This error is thrown whenever setting a config with duplicate signatures - error NonUniqueSignatures(); - - /// @notice This error is thrown whenever a report fails to verify due to bad or duplicate signatures - error BadVerification(); - - /// @notice This error is thrown whenever the admin tries to deactivate - /// the latest config digest - /// @param configDigest The latest config digest - error CannotDeactivateLatestConfig(bytes32 configDigest); - - /// @notice This error is thrown whenever the feed ID passed in is deactivated - /// @param feedId The feed ID - error InactiveFeed(bytes32 feedId); - - /// @notice This error is thrown whenever the feed ID passed in is not found - /// @param feedId The feed ID - error InvalidFeed(bytes32 feedId); - - /// @notice The address of the verifier proxy - address private immutable i_verifierProxyAddr; - - /// @notice Verifier states keyed on Feed ID - VerifierState internal s_feedVerifierState; - - /// @param verifierProxyAddr The address of the VerifierProxy contract - constructor(address verifierProxyAddr) ConfirmedOwner(msg.sender) { - if (verifierProxyAddr == address(0)) revert ZeroAddress(); - i_verifierProxyAddr = verifierProxyAddr; - } - - modifier checkConfigValid(uint256 numSigners, uint256 f) { - if (f == 0) revert FaultToleranceMustBePositive(); - if (numSigners > MAX_NUM_ORACLES) revert ExcessSigners(numSigners, MAX_NUM_ORACLES); - if (numSigners <= 3 * f) revert InsufficientSigners(numSigners, 3 * f + 1); - _; - } - - /// @inheritdoc IERC165 - function supportsInterface(bytes4 interfaceId) external pure override returns (bool isVerifier) { - return interfaceId == this.verify.selector; - } - - /// @inheritdoc TypeAndVersionInterface - function typeAndVersion() external pure override returns (string memory) { - return "ChannelVerifier 0.0.0"; - } - - /// @inheritdoc IChannelVerifier - function verify( - bytes calldata signedReport, - address sender - ) external override returns (bytes memory verifierResponse) { - if (msg.sender != i_verifierProxyAddr) revert AccessForbidden(); - ( - bytes32[3] memory reportContext, - bytes memory reportData, - bytes32[] memory rs, - bytes32[] memory ss, - bytes32 rawVs - ) = abi.decode(signedReport, (bytes32[3], bytes, bytes32[], bytes32[], bytes32)); - - // The feed ID is the first 32 bytes of the report data. - bytes32 feedId = bytes32(reportData); - - // If the feed has been deactivated, do not verify the report - if (s_feedVerifierState.deactivatedFeeds[feedId]) { - revert InactiveFeed(feedId); - } - - // reportContext consists of: - // reportContext[0]: ConfigDigest - // reportContext[1]: 27 byte padding, 4-byte epoch and 1-byte round - // reportContext[2]: ExtraHash - bytes32 configDigest = reportContext[0]; - Config storage s_config = s_feedVerifierState.s_verificationDataConfigs[configDigest]; - - _validateReport(configDigest, rs, ss, s_config); - _updateEpoch(reportContext, s_feedVerifierState); - - bytes32 hashedReport = keccak256(reportData); - - _verifySignatures(hashedReport, reportContext, rs, ss, rawVs, s_config); - emit ReportVerified(feedId, sender); - - return reportData; - } - - /// @notice Validates parameters of the report - /// @param configDigest Config digest from the report - /// @param rs R components from the report - /// @param ss S components from the report - /// @param config Config for the given feed ID keyed on the config digest - function _validateReport( - bytes32 configDigest, - bytes32[] memory rs, - bytes32[] memory ss, - Config storage config - ) private view { - uint8 expectedNumSignatures = config.f + 1; - - if (!config.isActive) revert DigestInactive(configDigest); - if (rs.length != expectedNumSignatures) revert IncorrectSignatureCount(rs.length, expectedNumSignatures); - if (rs.length != ss.length) revert MismatchedSignatures(rs.length, ss.length); - } - - /** - * @notice Conditionally update the epoch for a feed - * @param reportContext Report context containing the epoch and round - * @param feedVerifierState Feed verifier state to conditionally update - */ - function _updateEpoch(bytes32[3] memory reportContext, VerifierState storage feedVerifierState) private { - uint40 epochAndRound = uint40(uint256(reportContext[1])); - uint32 epoch = uint32(epochAndRound >> 8); - if (epoch > feedVerifierState.latestEpoch) { - feedVerifierState.latestEpoch = epoch; - } - } - - /// @notice Verifies that a report has been signed by the correct - /// signers and that enough signers have signed the reports. - /// @param hashedReport The keccak256 hash of the raw report's bytes - /// @param reportContext The context the report was signed in - /// @param rs ith element is the R components of the ith signature on report. Must have at most MAX_NUM_ORACLES entries - /// @param ss ith element is the S components of the ith signature on report. Must have at most MAX_NUM_ORACLES entries - /// @param rawVs ith element is the the V component of the ith signature - /// @param s_config The config digest the report was signed for - function _verifySignatures( - bytes32 hashedReport, - bytes32[3] memory reportContext, - bytes32[] memory rs, - bytes32[] memory ss, - bytes32 rawVs, - Config storage s_config - ) private view { - bytes32 h = keccak256(abi.encodePacked(hashedReport, reportContext)); - // i-th byte counts number of sigs made by i-th signer - uint256 signedCount; - - Signer memory o; - address signerAddress; - uint256 numSigners = rs.length; - for (uint256 i; i < numSigners; ++i) { - signerAddress = ecrecover(h, uint8(rawVs[i]) + 27, rs[i], ss[i]); - o = s_config.oracles[signerAddress]; - if (o.role != Role.Signer) revert BadVerification(); - unchecked { - signedCount += 1 << (8 * o.index); - } - } - - if (signedCount & ORACLE_MASK != signedCount) revert BadVerification(); - } - - /// @inheritdoc IChannelVerifier - function setConfig( - address[] memory signers, - bytes32[] memory offchainTransmitters, - uint8 f, - bytes memory onchainConfig, - uint64 offchainConfigVersion, - bytes memory offchainConfig, - Common.AddressAndWeight[] memory recipientAddressesAndWeights - ) external override checkConfigValid(signers.length, f) onlyOwner { - _setConfig( - block.chainid, - address(this), - 0, // 0 defaults to feedConfig.configCount + 1 - signers, - offchainTransmitters, - f, - onchainConfig, - offchainConfigVersion, - offchainConfig, - recipientAddressesAndWeights - ); - } - - /// @inheritdoc IChannelVerifier - function setConfigFromSource( - uint256 sourceChainId, - address sourceAddress, - uint32 newConfigCount, - address[] memory signers, - bytes32[] memory offchainTransmitters, - uint8 f, - bytes memory onchainConfig, - uint64 offchainConfigVersion, - bytes memory offchainConfig, - Common.AddressAndWeight[] memory recipientAddressesAndWeights - ) external override checkConfigValid(signers.length, f) onlyOwner { - _setConfig( - sourceChainId, - sourceAddress, - newConfigCount, - signers, - offchainTransmitters, - f, - onchainConfig, - offchainConfigVersion, - offchainConfig, - recipientAddressesAndWeights - ); - } - - /// @notice Sets config based on the given arguments - /// @param sourceChainId Chain ID of source config - /// @param sourceAddress Address of source config Verifier - /// @param newConfigCount Optional param to force the new config count - /// @param signers addresses with which oracles sign the reports - /// @param offchainTransmitters CSA key for the ith Oracle - /// @param f number of faulty oracles the system can tolerate - /// @param onchainConfig serialized configuration used by the contract (and possibly oracles) - /// @param offchainConfigVersion version number for offchainEncoding schema - /// @param offchainConfig serialized configuration used by the oracles exclusively and only passed through the contract - /// @param recipientAddressesAndWeights the addresses and weights of all the recipients to receive rewards - function _setConfig( - uint256 sourceChainId, - address sourceAddress, - uint32 newConfigCount, - address[] memory signers, - bytes32[] memory offchainTransmitters, - uint8 f, - bytes memory onchainConfig, - uint64 offchainConfigVersion, - bytes memory offchainConfig, - Common.AddressAndWeight[] memory recipientAddressesAndWeights - ) internal { - // Increment the number of times a config has been set first - if (newConfigCount > 0) s_feedVerifierState.configCount = newConfigCount; - else s_feedVerifierState.configCount++; - - bytes32 configDigest = _configDigestFromConfigData( - sourceChainId, - sourceAddress, - s_feedVerifierState.configCount, - signers, - offchainTransmitters, - f, - onchainConfig, - offchainConfigVersion, - offchainConfig - ); - - s_feedVerifierState.s_verificationDataConfigs[configDigest].f = f; - s_feedVerifierState.s_verificationDataConfigs[configDigest].isActive = true; - for (uint8 i; i < signers.length; ++i) { - address signerAddr = signers[i]; - if (signerAddr == address(0)) revert ZeroAddress(); - - // All signer roles are unset by default for a new config digest. - // Here the contract checks to see if a signer's address has already - // been set to ensure that the group of signer addresses that will - // sign reports with the config digest are unique. - bool isSignerAlreadySet = s_feedVerifierState.s_verificationDataConfigs[configDigest].oracles[signerAddr].role != - Role.Unset; - if (isSignerAlreadySet) revert NonUniqueSignatures(); - s_feedVerifierState.s_verificationDataConfigs[configDigest].oracles[signerAddr] = Signer({ - role: Role.Signer, - index: i - }); - } - - recipientAddressesAndWeights; // silence unused var warning - // IVerifierProxy(i_verifierProxyAddr).setVerifier( - // feedVerifierState.latestConfigDigest, - // configDigest, - // recipientAddressesAndWeights - // ); - - emit ConfigSet( - s_feedVerifierState.latestConfigBlockNumber, - configDigest, - s_feedVerifierState.configCount, - signers, - offchainTransmitters, - f, - onchainConfig, - offchainConfigVersion, - offchainConfig - ); - - s_feedVerifierState.latestEpoch = 0; - s_feedVerifierState.latestConfigBlockNumber = uint32(block.number); - s_feedVerifierState.latestConfigDigest = configDigest; - } - - /// @notice Generates the config digest from config data - /// @param sourceChainId Chain ID of source config - /// @param sourceAddress Address of source config Verifier - /// @param configCount ordinal number of this config setting among all config settings over the life of this contract - /// @param signers ith element is address ith oracle uses to sign a report - /// @param offchainTransmitters ith element is address ith oracle used to transmit reports (in this case used for flexible additional field, such as CSA pub keys) - /// @param f maximum number of faulty/dishonest oracles the protocol can tolerate while still working correctly - /// @param onchainConfig serialized configuration used by the contract (and possibly oracles) - /// @param offchainConfigVersion version of the serialization format used for "offchainConfig" parameter - /// @param offchainConfig serialized configuration used by the oracles exclusively and only passed through the contract - /// @dev This function is a modified version of the method from OCR2Abstract - function _configDigestFromConfigData( - uint256 sourceChainId, - address sourceAddress, - uint64 configCount, - address[] memory signers, - bytes32[] memory offchainTransmitters, - uint8 f, - bytes memory onchainConfig, - uint64 offchainConfigVersion, - bytes memory offchainConfig - ) internal pure returns (bytes32) { - uint256 h = uint256( - keccak256( - abi.encode( - sourceChainId, - sourceAddress, - configCount, - signers, - offchainTransmitters, - f, - onchainConfig, - offchainConfigVersion, - offchainConfig - ) - ) - ); - uint256 prefixMask = type(uint256).max << (256 - 16); // 0xFFFF00..00 - // 0x0009 corresponds to ConfigDigestPrefixLLO in libocr - uint256 prefix = 0x0009 << (256 - 16); // 0x000900..00 - return bytes32((prefix & prefixMask) | (h & ~prefixMask)); - } - - /// @inheritdoc IChannelVerifier - function activateConfig(bytes32 configDigest) external onlyOwner { - if (configDigest == bytes32("")) revert DigestEmpty(); - if (s_feedVerifierState.s_verificationDataConfigs[configDigest].f == 0) revert DigestNotSet(configDigest); - s_feedVerifierState.s_verificationDataConfigs[configDigest].isActive = true; - emit ConfigActivated(configDigest); - } - - /// @inheritdoc IChannelVerifier - function deactivateConfig(bytes32 configDigest) external onlyOwner { - if (configDigest == bytes32("")) revert DigestEmpty(); - if (s_feedVerifierState.s_verificationDataConfigs[configDigest].f == 0) revert DigestNotSet(configDigest); - if (configDigest == s_feedVerifierState.latestConfigDigest) { - revert CannotDeactivateLatestConfig(configDigest); - } - s_feedVerifierState.s_verificationDataConfigs[configDigest].isActive = false; - emit ConfigDeactivated(configDigest); - } - - /// @inheritdoc IChannelVerifier - function activateFeed(bytes32 feedId) external onlyOwner { - if (s_feedVerifierState.deactivatedFeeds[feedId]) return; - - s_feedVerifierState.deactivatedFeeds[feedId] = false; - emit FeedActivated(feedId); - } - - /// @inheritdoc IChannelVerifier - function deactivateFeed(bytes32 feedId) external onlyOwner { - if (s_feedVerifierState.deactivatedFeeds[feedId] == false) return; - - s_feedVerifierState.deactivatedFeeds[feedId] = true; - emit FeedDeactivated(feedId); - } - - /// @inheritdoc IChannelVerifier - function latestConfigDigestAndEpoch() - external - view - override - returns (bool scanLogs, bytes32 configDigest, uint32 epoch) - { - return (false, s_feedVerifierState.latestConfigDigest, s_feedVerifierState.latestEpoch); - } - - /// @inheritdoc IChannelVerifier - function latestConfigDetails() - external - view - override - returns (uint32 configCount, uint32 blockNumber, bytes32 configDigest) - { - return ( - s_feedVerifierState.configCount, - s_feedVerifierState.latestConfigBlockNumber, - s_feedVerifierState.latestConfigDigest - ); - } -} diff --git a/contracts/src/v0.8/llo-feeds/dev/interfaces/IChannelConfigStore.sol b/contracts/src/v0.8/llo-feeds/dev/interfaces/IChannelConfigStore.sol deleted file mode 100644 index 45e3ee313d8..00000000000 --- a/contracts/src/v0.8/llo-feeds/dev/interfaces/IChannelConfigStore.sol +++ /dev/null @@ -1,32 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity 0.8.19; - -import {IERC165} from "../../../vendor/openzeppelin-solidity/v4.8.3/contracts/interfaces/IERC165.sol"; - -interface IChannelConfigStore is IERC165 { - // function setStagingConfig(bytes32 configDigest, ChannelConfiguration calldata channelConfig) external; - - // function promoteStagingConfig(bytes32 configDigest) external; - - function addChannel(uint32 channelId, ChannelDefinition calldata channelDefinition) external; - - function removeChannel(uint32 channelId) external; - - function getChannelDefinitions(uint32 channelId) external view returns (ChannelDefinition memory); - - // struct ChannelConfiguration { - // bytes32 configDigest; - // } - - struct ChannelDefinition { - // e.g. evm, solana, CosmWasm, kalechain, etc... - uint32 reportFormat; - // Specifies the chain on which this channel can be verified. Currently uses - // CCIP chain selectors, but lots of other schemes are possible as well. - uint64 chainSelector; - // We assume that StreamIDs is always non-empty and that the 0-th stream - // contains the verification price in LINK and the 1-st stream contains the - // verification price in the native coin. - uint32[] streamIDs; - } -} diff --git a/contracts/src/v0.8/llo-feeds/dev/interfaces/IChannelVerifier.sol b/contracts/src/v0.8/llo-feeds/dev/interfaces/IChannelVerifier.sol deleted file mode 100644 index 6bab5912a70..00000000000 --- a/contracts/src/v0.8/llo-feeds/dev/interfaces/IChannelVerifier.sol +++ /dev/null @@ -1,111 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity 0.8.19; - -import {IERC165} from "../../../vendor/openzeppelin-solidity/v4.8.3/contracts/interfaces/IERC165.sol"; -import {Common} from "../../libraries/Common.sol"; - -interface IChannelVerifier is IERC165 { - /** - * @notice Verifies that the data encoded has been signed - * correctly by routing to the correct verifier. - * @param signedReport The encoded data to be verified. - * @param sender The address that requested to verify the contract. - * This is only used for logging purposes. - * @dev Verification is typically only done through the proxy contract so - * we can't just use msg.sender to log the requester as the msg.sender - * contract will always be the proxy. - * @return verifierResponse The encoded verified response. - */ - function verify(bytes calldata signedReport, address sender) external returns (bytes memory verifierResponse); - - /** - * @notice sets offchain reporting protocol configuration incl. participating oracles - * @param signers addresses with which oracles sign the reports - * @param offchainTransmitters CSA key for the ith Oracle - * @param f number of faulty oracles the system can tolerate - * @param onchainConfig serialized configuration used by the contract (and possibly oracles) - * @param offchainConfigVersion version number for offchainEncoding schema - * @param offchainConfig serialized configuration used by the oracles exclusively and only passed through the contract - * @param recipientAddressesAndWeights the addresses and weights of all the recipients to receive rewards - */ - function setConfig( - address[] memory signers, - bytes32[] memory offchainTransmitters, - uint8 f, - bytes memory onchainConfig, - uint64 offchainConfigVersion, - bytes memory offchainConfig, - Common.AddressAndWeight[] memory recipientAddressesAndWeights - ) external; - - /** - * @notice identical to `setConfig` except with args for sourceChainId and sourceAddress - * @param sourceChainId Chain ID of source config - * @param sourceAddress Address of source config Verifier - * @param newConfigCount Param to force the new config count - * @param signers addresses with which oracles sign the reports - * @param offchainTransmitters CSA key for the ith Oracle - * @param f number of faulty oracles the system can tolerate - * @param onchainConfig serialized configuration used by the contract (and possibly oracles) - * @param offchainConfigVersion version number for offchainEncoding schema - * @param offchainConfig serialized configuration used by the oracles exclusively and only passed through the contract - * @param recipientAddressesAndWeights the addresses and weights of all the recipients to receive rewards - */ - function setConfigFromSource( - uint256 sourceChainId, - address sourceAddress, - uint32 newConfigCount, - address[] memory signers, - bytes32[] memory offchainTransmitters, - uint8 f, - bytes memory onchainConfig, - uint64 offchainConfigVersion, - bytes memory offchainConfig, - Common.AddressAndWeight[] memory recipientAddressesAndWeights - ) external; - - /** - * @notice Activates the configuration for a config digest - * @param configDigest The config digest to activate - * @dev This function can be called by the contract admin to activate a configuration. - */ - function activateConfig(bytes32 configDigest) external; - - /** - * @notice Deactivates the configuration for a config digest - * @param configDigest The config digest to deactivate - * @dev This function can be called by the contract admin to deactivate an incorrect configuration. - */ - function deactivateConfig(bytes32 configDigest) external; - - /** - * @notice Activates the given feed - * @param feedId Feed ID to activated - * @dev This function can be called by the contract admin to activate a feed - */ - function activateFeed(bytes32 feedId) external; - - /** - * @notice Deactivates the given feed - * @param feedId Feed ID to deactivated - * @dev This function can be called by the contract admin to deactivate a feed - */ - function deactivateFeed(bytes32 feedId) external; - - /** - * @notice returns the latest config digest and epoch - * @return scanLogs indicates whether to rely on the configDigest and epoch - * returned or whether to scan logs for the Transmitted event instead. - * @return configDigest - * @return epoch - */ - function latestConfigDigestAndEpoch() external view returns (bool scanLogs, bytes32 configDigest, uint32 epoch); - - /** - * @notice information about current offchain reporting protocol configuration - * @return configCount ordinal number of current config, out of all configs applied to this contract so far - * @return blockNumber block at which this config was set - * @return configDigest domain-separation tag for current config - */ - function latestConfigDetails() external view returns (uint32 configCount, uint32 blockNumber, bytes32 configDigest); -} diff --git a/contracts/src/v0.8/llo-feeds/dev/test/mocks/ExposedChannelVerifier.sol b/contracts/src/v0.8/llo-feeds/dev/test/mocks/ExposedChannelVerifier.sol deleted file mode 100644 index 650b3b4a81e..00000000000 --- a/contracts/src/v0.8/llo-feeds/dev/test/mocks/ExposedChannelVerifier.sol +++ /dev/null @@ -1,66 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity 0.8.19; - -// ExposedChannelVerifier exposes certain internal Verifier -// methods/structures so that golang code can access them, and we get -// reliable type checking on their usage -contract ExposedChannelVerifier { - constructor() {} - - function _configDigestFromConfigData( - uint256 chainId, - address contractAddress, - uint64 configCount, - address[] memory signers, - bytes32[] memory offchainTransmitters, - uint8 f, - bytes memory onchainConfig, - uint64 offchainConfigVersion, - bytes memory offchainConfig - ) internal pure returns (bytes32) { - uint256 h = uint256( - keccak256( - abi.encode( - chainId, - contractAddress, - configCount, - signers, - offchainTransmitters, - f, - onchainConfig, - offchainConfigVersion, - offchainConfig - ) - ) - ); - uint256 prefixMask = type(uint256).max << (256 - 16); // 0xFFFF00..00 - // 0x0009 corresponds to ConfigDigestPrefixLLO in libocr - uint256 prefix = 0x0009 << (256 - 16); // 0x000900..00 - return bytes32((prefix & prefixMask) | (h & ~prefixMask)); - } - - function exposedConfigDigestFromConfigData( - uint256 _chainId, - address _contractAddress, - uint64 _configCount, - address[] memory _signers, - bytes32[] memory _offchainTransmitters, - uint8 _f, - bytes calldata _onchainConfig, - uint64 _encodedConfigVersion, - bytes memory _encodedConfig - ) public pure returns (bytes32) { - return - _configDigestFromConfigData( - _chainId, - _contractAddress, - _configCount, - _signers, - _offchainTransmitters, - _f, - _onchainConfig, - _encodedConfigVersion, - _encodedConfig - ); - } -} diff --git a/contracts/src/v0.8/llo-feeds/interfaces/IConfigurator.sol b/contracts/src/v0.8/llo-feeds/interfaces/IConfigurator.sol new file mode 100644 index 00000000000..478afa918cd --- /dev/null +++ b/contracts/src/v0.8/llo-feeds/interfaces/IConfigurator.sol @@ -0,0 +1,28 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.19; + +interface IConfigurator { + /// @notice This event is emitted whenever a new configuration is set for a feed. It triggers a new run of the offchain reporting protocol. + event ConfigSet( + bytes32 indexed configId, + uint32 previousConfigBlockNumber, + bytes32 configDigest, + uint64 configCount, + address[] signers, + bytes32[] offchainTransmitters, + uint8 f, + bytes onchainConfig, + uint64 offchainConfigVersion, + bytes offchainConfig + ); + + function setConfig( + bytes32 configId, + address[] memory signers, + bytes32[] memory offchainTransmitters, + uint8 f, + bytes memory onchainConfig, + uint64 offchainConfigVersion, + bytes memory offchainConfig + ) external; +} diff --git a/contracts/src/v0.8/llo-feeds/libraries/Common.sol b/contracts/src/v0.8/llo-feeds/libraries/Common.sol index f732ced004b..23418bf41a9 100644 --- a/contracts/src/v0.8/llo-feeds/libraries/Common.sol +++ b/contracts/src/v0.8/llo-feeds/libraries/Common.sol @@ -19,6 +19,28 @@ library Common { uint64 weight; } + /** + * @notice Checks if an array of AddressAndWeight has duplicate addresses + * @param recipients The array of AddressAndWeight to check + * @return bool True if there are duplicates, false otherwise + */ + function _hasDuplicateAddresses(address[] memory recipients) internal pure returns (bool) { + for (uint256 i = 0; i < recipients.length; ) { + for (uint256 j = i + 1; j < recipients.length; ) { + if (recipients[i] == recipients[j]) { + return true; + } + unchecked { + ++j; + } + } + unchecked { + ++i; + } + } + return false; + } + /** * @notice Checks if an array of AddressAndWeight has duplicate addresses * @param recipients The array of AddressAndWeight to check @@ -40,4 +62,28 @@ library Common { } return false; } + + /** + * @notice sorts a list of addresses numerically + * @param arr The array of addresses to sort + * @param left the start index + * @param right the end index + */ + function _quickSort(address[] memory arr, int256 left, int256 right) internal pure { + int256 i = left; + int256 j = right; + if (i == j) return; + address pivot = arr[uint256(left + (right - left) / 2)]; + while (i <= j) { + while (uint160(arr[uint256(i)]) < uint160(pivot)) i++; + while (uint160(pivot) < uint160(arr[uint256(j)])) j--; + if (i <= j) { + (arr[uint256(i)], arr[uint256(j)]) = (arr[uint256(j)], arr[uint256(i)]); + i++; + j--; + } + } + if (left < j) _quickSort(arr, left, j); + if (i < right) _quickSort(arr, i, right); + } } diff --git a/contracts/src/v0.8/llo-feeds/test/ByteUtilTest.t.sol b/contracts/src/v0.8/llo-feeds/libraries/test/ByteUtilTest.t.sol similarity index 88% rename from contracts/src/v0.8/llo-feeds/test/ByteUtilTest.t.sol rename to contracts/src/v0.8/llo-feeds/libraries/test/ByteUtilTest.t.sol index 21bd957e4e1..8f11dab0936 100644 --- a/contracts/src/v0.8/llo-feeds/test/ByteUtilTest.t.sol +++ b/contracts/src/v0.8/llo-feeds/libraries/test/ByteUtilTest.t.sol @@ -2,7 +2,7 @@ pragma solidity 0.8.19; import {Test} from "forge-std/Test.sol"; -import {ByteUtil} from "../libraries/ByteUtil.sol"; +import {ByteUtil} from "../ByteUtil.sol"; contract ByteUtilTest is Test { using ByteUtil for bytes; @@ -15,7 +15,7 @@ contract ByteUtilTest is Test { bytes4 internal constant MALFORMED_ERROR_SELECTOR = bytes4(keccak256("MalformedData()")); - function test_readUint256Max() public { + function test_readUint256Max() public pure { //read the first 32 bytes uint256 result = B_512._readUint256(0); @@ -23,7 +23,7 @@ contract ByteUtilTest is Test { assertEq(result, type(uint256).max); } - function test_readUint192Max() public { + function test_readUint192Max() public pure { //read the first 24 bytes uint256 result = B_512._readUint192(0); @@ -31,7 +31,7 @@ contract ByteUtilTest is Test { assertEq(result, type(uint192).max); } - function test_readUint32Max() public { + function test_readUint32Max() public pure { //read the first 4 bytes uint256 result = B_512._readUint32(0); @@ -39,7 +39,7 @@ contract ByteUtilTest is Test { assertEq(result, type(uint32).max); } - function test_readUint256Min() public { + function test_readUint256Min() public pure { //read the second 32 bytes uint256 result = B_512._readUint256(32); @@ -47,7 +47,7 @@ contract ByteUtilTest is Test { assertEq(result, type(uint256).min); } - function test_readUint192Min() public { + function test_readUint192Min() public pure { //read the second 24 bytes uint256 result = B_512._readUint192(32); @@ -55,7 +55,7 @@ contract ByteUtilTest is Test { assertEq(result, type(uint192).min); } - function test_readUint32Min() public { + function test_readUint32Min() public pure { //read the second 4 bytes uint256 result = B_512._readUint32(32); @@ -63,7 +63,7 @@ contract ByteUtilTest is Test { assertEq(result, type(uint32).min); } - function test_readUint256MultiWord() public { + function test_readUint256MultiWord() public pure { //read the first 32 bytes uint256 result = B_512._readUint256(31); @@ -71,7 +71,7 @@ contract ByteUtilTest is Test { assertEq(result, type(uint256).max << 248); } - function test_readUint192MultiWord() public { + function test_readUint192MultiWord() public pure { //read the first 24 bytes uint256 result = B_512._readUint192(31); @@ -79,7 +79,7 @@ contract ByteUtilTest is Test { assertEq(result, type(uint192).max << 184); } - function test_readUint32MultiWord() public { + function test_readUint32MultiWord() public pure { //read the first 4 bytes uint256 result = B_512._readUint32(31); @@ -135,7 +135,7 @@ contract ByteUtilTest is Test { B_EMPTY._readUint32(0); } - function test_readAddress() public { + function test_readAddress() public pure { //read the first 20 bytes address result = B_512._readAddress(0); @@ -143,7 +143,7 @@ contract ByteUtilTest is Test { assertEq(result, address(type(uint160).max)); } - function test_readZeroAddress() public { + function test_readZeroAddress() public pure { //read the first 32 bytes after the first word address result = B_512._readAddress(32); @@ -151,7 +151,7 @@ contract ByteUtilTest is Test { assertEq(result, address(type(uint160).min)); } - function test_readAddressMultiWord() public { + function test_readAddressMultiWord() public pure { //read the first 20 bytes after byte 13 address result = B_512._readAddress(13); diff --git a/contracts/src/v0.8/llo-feeds/test/mocks/ErroredVerifier.sol b/contracts/src/v0.8/llo-feeds/test/mocks/ErroredVerifier.sol deleted file mode 100644 index 01cb1a50611..00000000000 --- a/contracts/src/v0.8/llo-feeds/test/mocks/ErroredVerifier.sol +++ /dev/null @@ -1,84 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity 0.8.19; - -import {IVerifier} from "../../interfaces/IVerifier.sol"; -import {Common} from "../../libraries/Common.sol"; - -contract ErroredVerifier is IVerifier { - function supportsInterface(bytes4 interfaceId) public pure override returns (bool) { - return interfaceId == this.verify.selector; - } - - function verify( - bytes memory, - /** - * signedReport* - */ - address - ) - external - pure - override - returns ( - /** - * sender* - */ - bytes memory - ) - { - revert("Failed to verify"); - } - - function setConfig( - bytes32, - address[] memory, - bytes32[] memory, - uint8, - bytes memory, - uint64, - bytes memory, - Common.AddressAndWeight[] memory - ) external pure override { - revert("Failed to set config"); - } - - function setConfigFromSource( - bytes32, - uint256, - address, - uint32, - address[] memory, - bytes32[] memory, - uint8, - bytes memory, - uint64, - bytes memory, - Common.AddressAndWeight[] memory - ) external pure override { - revert("Failed to set config"); - } - - function activateConfig(bytes32, bytes32) external pure { - revert("Failed to activate config"); - } - - function deactivateConfig(bytes32, bytes32) external pure { - revert("Failed to deactivate config"); - } - - function activateFeed(bytes32) external pure { - revert("Failed to activate feed"); - } - - function deactivateFeed(bytes32) external pure { - revert("Failed to deactivate feed"); - } - - function latestConfigDigestAndEpoch(bytes32) external pure override returns (bool, bytes32, uint32) { - revert("Failed to get latest config digest and epoch"); - } - - function latestConfigDetails(bytes32) external pure override returns (uint32, uint32, bytes32) { - revert("Failed to get latest config details"); - } -} diff --git a/contracts/src/v0.8/llo-feeds/test/mocks/ExposedVerifier.sol b/contracts/src/v0.8/llo-feeds/test/mocks/ExposedVerifier.sol deleted file mode 100644 index 1c004bf3846..00000000000 --- a/contracts/src/v0.8/llo-feeds/test/mocks/ExposedVerifier.sol +++ /dev/null @@ -1,69 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity 0.8.19; - -// ExposedVerifier exposes certain internal Verifier -// methods/structures so that golang code can access them, and we get -// reliable type checking on their usage -contract ExposedVerifier { - constructor() {} - - function _configDigestFromConfigData( - bytes32 feedId, - uint256 chainId, - address contractAddress, - uint64 configCount, - address[] memory signers, - bytes32[] memory offchainTransmitters, - uint8 f, - bytes memory onchainConfig, - uint64 offchainConfigVersion, - bytes memory offchainConfig - ) internal pure returns (bytes32) { - uint256 h = uint256( - keccak256( - abi.encode( - feedId, - chainId, - contractAddress, - configCount, - signers, - offchainTransmitters, - f, - onchainConfig, - offchainConfigVersion, - offchainConfig - ) - ) - ); - uint256 prefixMask = type(uint256).max << (256 - 16); // 0xFFFF00..00 - uint256 prefix = 0x0006 << (256 - 16); // 0x000600..00 - return bytes32((prefix & prefixMask) | (h & ~prefixMask)); - } - - function exposedConfigDigestFromConfigData( - bytes32 _feedId, - uint256 _chainId, - address _contractAddress, - uint64 _configCount, - address[] memory _signers, - bytes32[] memory _offchainTransmitters, - uint8 _f, - bytes calldata _onchainConfig, - uint64 _encodedConfigVersion, - bytes memory _encodedConfig - ) public pure returns (bytes32) { - return - _configDigestFromConfigData( - _feedId, - _chainId, - _contractAddress, - _configCount, - _signers, - _offchainTransmitters, - _f, - _onchainConfig, - _encodedConfigVersion, - _encodedConfig - ); - } -} diff --git a/contracts/src/v0.8/llo-feeds/test/mocks/FeeManagerProxy.sol b/contracts/src/v0.8/llo-feeds/test/mocks/FeeManagerProxy.sol deleted file mode 100644 index 16935f69d6b..00000000000 --- a/contracts/src/v0.8/llo-feeds/test/mocks/FeeManagerProxy.sol +++ /dev/null @@ -1,20 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity 0.8.19; - -import "../../interfaces/IFeeManager.sol"; - -contract FeeManagerProxy { - IFeeManager internal i_feeManager; - - function processFee(bytes calldata payload, bytes calldata parameterPayload) public payable { - i_feeManager.processFee{value: msg.value}(payload, parameterPayload, msg.sender); - } - - function processFeeBulk(bytes[] calldata payloads, bytes calldata parameterPayload) public payable { - i_feeManager.processFeeBulk{value: msg.value}(payloads, parameterPayload, msg.sender); - } - - function setFeeManager(IFeeManager feeManager) public { - i_feeManager = feeManager; - } -} diff --git a/contracts/src/v0.8/llo-feeds/FeeManager.sol b/contracts/src/v0.8/llo-feeds/v0.3.0/FeeManager.sol similarity index 96% rename from contracts/src/v0.8/llo-feeds/FeeManager.sol rename to contracts/src/v0.8/llo-feeds/v0.3.0/FeeManager.sol index 665940d4670..44f550e3253 100644 --- a/contracts/src/v0.8/llo-feeds/FeeManager.sol +++ b/contracts/src/v0.8/llo-feeds/v0.3.0/FeeManager.sol @@ -1,16 +1,16 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.19; -import {ConfirmedOwner} from "../shared/access/ConfirmedOwner.sol"; +import {ConfirmedOwner} from "../../shared/access/ConfirmedOwner.sol"; import {IFeeManager} from "./interfaces/IFeeManager.sol"; -import {TypeAndVersionInterface} from "../interfaces/TypeAndVersionInterface.sol"; -import {IERC165} from "../vendor/openzeppelin-solidity/v4.8.3/contracts/interfaces/IERC165.sol"; -import {Common} from "./libraries/Common.sol"; +import {TypeAndVersionInterface} from "../../interfaces/TypeAndVersionInterface.sol"; +import {IERC165} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/interfaces/IERC165.sol"; +import {Common} from "../libraries/Common.sol"; import {IRewardManager} from "./interfaces/IRewardManager.sol"; -import {IWERC20} from "../shared/interfaces/IWERC20.sol"; -import {IERC20} from "../vendor/openzeppelin-solidity/v4.8.3/contracts/interfaces/IERC20.sol"; -import {Math} from "../vendor/openzeppelin-solidity/v4.8.3/contracts/utils/math/Math.sol"; -import {SafeERC20} from "../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/utils/SafeERC20.sol"; +import {IWERC20} from "../../shared/interfaces/IWERC20.sol"; +import {IERC20} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/interfaces/IERC20.sol"; +import {Math} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/utils/math/Math.sol"; +import {SafeERC20} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/utils/SafeERC20.sol"; import {IVerifierFeeManager} from "./interfaces/IVerifierFeeManager.sol"; /** diff --git a/contracts/src/v0.8/llo-feeds/RewardManager.sol b/contracts/src/v0.8/llo-feeds/v0.3.0/RewardManager.sol similarity index 96% rename from contracts/src/v0.8/llo-feeds/RewardManager.sol rename to contracts/src/v0.8/llo-feeds/v0.3.0/RewardManager.sol index 1929289a360..49fef51c569 100644 --- a/contracts/src/v0.8/llo-feeds/RewardManager.sol +++ b/contracts/src/v0.8/llo-feeds/v0.3.0/RewardManager.sol @@ -1,12 +1,12 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.19; -import {ConfirmedOwner} from "../shared/access/ConfirmedOwner.sol"; +import {ConfirmedOwner} from "../../shared/access/ConfirmedOwner.sol"; import {IRewardManager} from "./interfaces/IRewardManager.sol"; -import {IERC20} from "../vendor/openzeppelin-solidity/v4.8.3/contracts/interfaces/IERC20.sol"; -import {TypeAndVersionInterface} from "../interfaces/TypeAndVersionInterface.sol"; -import {Common} from "./libraries/Common.sol"; -import {SafeERC20} from "../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/utils/SafeERC20.sol"; +import {IERC20} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/interfaces/IERC20.sol"; +import {TypeAndVersionInterface} from "../../interfaces/TypeAndVersionInterface.sol"; +import {Common} from "../libraries/Common.sol"; +import {SafeERC20} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/utils/SafeERC20.sol"; /** * @title RewardManager diff --git a/contracts/src/v0.8/llo-feeds/Verifier.sol b/contracts/src/v0.8/llo-feeds/v0.3.0/Verifier.sol similarity index 98% rename from contracts/src/v0.8/llo-feeds/Verifier.sol rename to contracts/src/v0.8/llo-feeds/v0.3.0/Verifier.sol index c8858999dab..fe5742108a5 100644 --- a/contracts/src/v0.8/llo-feeds/Verifier.sol +++ b/contracts/src/v0.8/llo-feeds/v0.3.0/Verifier.sol @@ -1,12 +1,12 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.19; -import {ConfirmedOwner} from "../shared/access/ConfirmedOwner.sol"; +import {ConfirmedOwner} from "../../shared/access/ConfirmedOwner.sol"; import {IVerifier} from "./interfaces/IVerifier.sol"; import {IVerifierProxy} from "./interfaces/IVerifierProxy.sol"; -import {TypeAndVersionInterface} from "../interfaces/TypeAndVersionInterface.sol"; -import {IERC165} from "../vendor/openzeppelin-solidity/v4.8.3/contracts/interfaces/IERC165.sol"; -import {Common} from "./libraries/Common.sol"; +import {TypeAndVersionInterface} from "../../interfaces/TypeAndVersionInterface.sol"; +import {IERC165} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/interfaces/IERC165.sol"; +import {Common} from "../libraries/Common.sol"; // OCR2 standard uint256 constant MAX_NUM_ORACLES = 31; diff --git a/contracts/src/v0.8/llo-feeds/VerifierProxy.sol b/contracts/src/v0.8/llo-feeds/v0.3.0/VerifierProxy.sol similarity index 95% rename from contracts/src/v0.8/llo-feeds/VerifierProxy.sol rename to contracts/src/v0.8/llo-feeds/v0.3.0/VerifierProxy.sol index c32a27178cc..c06312dd7be 100644 --- a/contracts/src/v0.8/llo-feeds/VerifierProxy.sol +++ b/contracts/src/v0.8/llo-feeds/v0.3.0/VerifierProxy.sol @@ -1,14 +1,14 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.19; -import {ConfirmedOwner} from "../shared/access/ConfirmedOwner.sol"; +import {ConfirmedOwner} from "../../shared/access/ConfirmedOwner.sol"; import {IVerifierProxy} from "./interfaces/IVerifierProxy.sol"; import {IVerifier} from "./interfaces/IVerifier.sol"; -import {TypeAndVersionInterface} from "../interfaces/TypeAndVersionInterface.sol"; -import {AccessControllerInterface} from "../shared/interfaces/AccessControllerInterface.sol"; -import {IERC165} from "../vendor/openzeppelin-solidity/v4.8.3/contracts/interfaces/IERC165.sol"; +import {TypeAndVersionInterface} from "../../interfaces/TypeAndVersionInterface.sol"; +import {AccessControllerInterface} from "../../shared/interfaces/AccessControllerInterface.sol"; +import {IERC165} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/interfaces/IERC165.sol"; import {IVerifierFeeManager} from "./interfaces/IVerifierFeeManager.sol"; -import {Common} from "./libraries/Common.sol"; +import {Common} from "../libraries/Common.sol"; /** * The verifier proxy contract is the gateway for all report verification requests diff --git a/contracts/src/v0.8/llo-feeds/interfaces/IFeeManager.sol b/contracts/src/v0.8/llo-feeds/v0.3.0/interfaces/IFeeManager.sol similarity index 94% rename from contracts/src/v0.8/llo-feeds/interfaces/IFeeManager.sol rename to contracts/src/v0.8/llo-feeds/v0.3.0/interfaces/IFeeManager.sol index 4095607b911..818a3a09a4c 100644 --- a/contracts/src/v0.8/llo-feeds/interfaces/IFeeManager.sol +++ b/contracts/src/v0.8/llo-feeds/v0.3.0/interfaces/IFeeManager.sol @@ -1,8 +1,8 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.19; -import {IERC165} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/interfaces/IERC165.sol"; -import {Common} from "../libraries/Common.sol"; +import {IERC165} from "../../../vendor/openzeppelin-solidity/v4.8.3/contracts/interfaces/IERC165.sol"; +import {Common} from "../../libraries/Common.sol"; import {IVerifierFeeManager} from "./IVerifierFeeManager.sol"; interface IFeeManager is IERC165, IVerifierFeeManager { diff --git a/contracts/src/v0.8/llo-feeds/interfaces/IRewardManager.sol b/contracts/src/v0.8/llo-feeds/v0.3.0/interfaces/IRewardManager.sol similarity index 94% rename from contracts/src/v0.8/llo-feeds/interfaces/IRewardManager.sol rename to contracts/src/v0.8/llo-feeds/v0.3.0/interfaces/IRewardManager.sol index 5a6e03f1c9a..f08ce34db29 100644 --- a/contracts/src/v0.8/llo-feeds/interfaces/IRewardManager.sol +++ b/contracts/src/v0.8/llo-feeds/v0.3.0/interfaces/IRewardManager.sol @@ -1,8 +1,8 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.19; -import {IERC165} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/interfaces/IERC165.sol"; -import {Common} from "../libraries/Common.sol"; +import {IERC165} from "../../../vendor/openzeppelin-solidity/v4.8.3/contracts/interfaces/IERC165.sol"; +import {Common} from "../../libraries/Common.sol"; interface IRewardManager is IERC165 { /** diff --git a/contracts/src/v0.8/llo-feeds/interfaces/IVerifier.sol b/contracts/src/v0.8/llo-feeds/v0.3.0/interfaces/IVerifier.sol similarity index 97% rename from contracts/src/v0.8/llo-feeds/interfaces/IVerifier.sol rename to contracts/src/v0.8/llo-feeds/v0.3.0/interfaces/IVerifier.sol index 617d702d3f8..94b260399ea 100644 --- a/contracts/src/v0.8/llo-feeds/interfaces/IVerifier.sol +++ b/contracts/src/v0.8/llo-feeds/v0.3.0/interfaces/IVerifier.sol @@ -1,8 +1,8 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.19; -import {IERC165} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/interfaces/IERC165.sol"; -import {Common} from "../libraries/Common.sol"; +import {IERC165} from "../../../vendor/openzeppelin-solidity/v4.8.3/contracts/interfaces/IERC165.sol"; +import {Common} from "../../libraries/Common.sol"; interface IVerifier is IERC165 { /** diff --git a/contracts/src/v0.8/llo-feeds/interfaces/IVerifierFeeManager.sol b/contracts/src/v0.8/llo-feeds/v0.3.0/interfaces/IVerifierFeeManager.sol similarity index 88% rename from contracts/src/v0.8/llo-feeds/interfaces/IVerifierFeeManager.sol rename to contracts/src/v0.8/llo-feeds/v0.3.0/interfaces/IVerifierFeeManager.sol index 522db952e5d..da3fdfac153 100644 --- a/contracts/src/v0.8/llo-feeds/interfaces/IVerifierFeeManager.sol +++ b/contracts/src/v0.8/llo-feeds/v0.3.0/interfaces/IVerifierFeeManager.sol @@ -1,8 +1,8 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.19; -import {IERC165} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/interfaces/IERC165.sol"; -import {Common} from "../libraries/Common.sol"; +import {IERC165} from "../../../vendor/openzeppelin-solidity/v4.8.3/contracts/interfaces/IERC165.sol"; +import {Common} from "../../libraries/Common.sol"; interface IVerifierFeeManager is IERC165 { /** diff --git a/contracts/src/v0.8/llo-feeds/interfaces/IVerifierProxy.sol b/contracts/src/v0.8/llo-feeds/v0.3.0/interfaces/IVerifierProxy.sol similarity index 95% rename from contracts/src/v0.8/llo-feeds/interfaces/IVerifierProxy.sol rename to contracts/src/v0.8/llo-feeds/v0.3.0/interfaces/IVerifierProxy.sol index 2eb1b4aff4b..6609e4869ae 100644 --- a/contracts/src/v0.8/llo-feeds/interfaces/IVerifierProxy.sol +++ b/contracts/src/v0.8/llo-feeds/v0.3.0/interfaces/IVerifierProxy.sol @@ -1,8 +1,8 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.19; -import {Common} from "../libraries/Common.sol"; -import {AccessControllerInterface} from "../../shared/interfaces/AccessControllerInterface.sol"; +import {Common} from "../../libraries/Common.sol"; +import {AccessControllerInterface} from "../../../shared/interfaces/AccessControllerInterface.sol"; import {IVerifierFeeManager} from "./IVerifierFeeManager.sol"; interface IVerifierProxy { diff --git a/contracts/src/v0.8/llo-feeds/test/fee-manager/BaseFeeManager.t.sol b/contracts/src/v0.8/llo-feeds/v0.3.0/test/fee-manager/BaseFeeManager.t.sol similarity index 98% rename from contracts/src/v0.8/llo-feeds/test/fee-manager/BaseFeeManager.t.sol rename to contracts/src/v0.8/llo-feeds/v0.3.0/test/fee-manager/BaseFeeManager.t.sol index edde26b2ee1..0d598cdac52 100644 --- a/contracts/src/v0.8/llo-feeds/test/fee-manager/BaseFeeManager.t.sol +++ b/contracts/src/v0.8/llo-feeds/v0.3.0/test/fee-manager/BaseFeeManager.t.sol @@ -4,9 +4,9 @@ pragma solidity 0.8.19; import {Test} from "forge-std/Test.sol"; import {FeeManager} from "../../FeeManager.sol"; import {RewardManager} from "../../RewardManager.sol"; -import {Common} from "../../libraries/Common.sol"; -import {ERC20Mock} from "../../../vendor/openzeppelin-solidity/v4.8.3/contracts/mocks/ERC20Mock.sol"; -import {WERC20Mock} from "../../../shared/mocks/WERC20Mock.sol"; +import {Common} from "../../../libraries/Common.sol"; +import {ERC20Mock} from "../../../../vendor/openzeppelin-solidity/v4.8.3/contracts/mocks/ERC20Mock.sol"; +import {WERC20Mock} from "../../../../shared/mocks/WERC20Mock.sol"; import {IRewardManager} from "../../interfaces/IRewardManager.sol"; import {FeeManagerProxy} from "../mocks/FeeManagerProxy.sol"; diff --git a/contracts/src/v0.8/llo-feeds/test/fee-manager/FeeManager.general.t.sol b/contracts/src/v0.8/llo-feeds/v0.3.0/test/fee-manager/FeeManager.general.t.sol similarity index 100% rename from contracts/src/v0.8/llo-feeds/test/fee-manager/FeeManager.general.t.sol rename to contracts/src/v0.8/llo-feeds/v0.3.0/test/fee-manager/FeeManager.general.t.sol diff --git a/contracts/src/v0.8/llo-feeds/test/fee-manager/FeeManager.getFeeAndReward.t.sol b/contracts/src/v0.8/llo-feeds/v0.3.0/test/fee-manager/FeeManager.getFeeAndReward.t.sol similarity index 98% rename from contracts/src/v0.8/llo-feeds/test/fee-manager/FeeManager.getFeeAndReward.t.sol rename to contracts/src/v0.8/llo-feeds/v0.3.0/test/fee-manager/FeeManager.getFeeAndReward.t.sol index 299a7f09d51..1b0f95d51bd 100644 --- a/contracts/src/v0.8/llo-feeds/test/fee-manager/FeeManager.getFeeAndReward.t.sol +++ b/contracts/src/v0.8/llo-feeds/v0.3.0/test/fee-manager/FeeManager.getFeeAndReward.t.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.19; -import {Common} from "../../libraries/Common.sol"; +import {Common} from "../../../libraries/Common.sol"; import "./BaseFeeManager.t.sol"; /** @@ -10,7 +10,7 @@ import "./BaseFeeManager.t.sol"; * @notice This contract will test the functionality of the feeManager's getFeeAndReward */ contract FeeManagerProcessFeeTest is BaseFeeManagerTest { - function test_baseFeeIsAppliedForNative() public { + function test_baseFeeIsAppliedForNative() public view { //get the fee required by the feeManager Common.Asset memory fee = getFee(getV3Report(DEFAULT_FEED_1_V3), getNativeQuote(), USER); @@ -18,7 +18,7 @@ contract FeeManagerProcessFeeTest is BaseFeeManagerTest { assertEq(fee.amount, DEFAULT_REPORT_NATIVE_FEE); } - function test_baseFeeIsAppliedForLink() public { + function test_baseFeeIsAppliedForLink() public view { //get the fee required by the feeManager Common.Asset memory fee = getFee(getV3Report(DEFAULT_FEED_1_V3), getLinkQuote(), USER); @@ -378,7 +378,7 @@ contract FeeManagerProcessFeeTest is BaseFeeManagerTest { assertEq(fee.amount, DEFAULT_REPORT_NATIVE_FEE - expectedDiscount); } - function test_reportWithNoExpiryOrFeeReturnsZero() public { + function test_reportWithNoExpiryOrFeeReturnsZero() public view { //get the fee required by the feeManager Common.Asset memory fee = getFee(getV1Report(DEFAULT_FEED_1_V1), getNativeQuote(), USER); @@ -462,7 +462,7 @@ contract FeeManagerProcessFeeTest is BaseFeeManagerTest { setNativeSurcharge(nativeSurcharge, ADMIN); } - function test_getBaseRewardWithLinkQuote() public { + function test_getBaseRewardWithLinkQuote() public view { //get the fee required by the feeManager Common.Asset memory reward = getReward(getV3Report(DEFAULT_FEED_1_V3), getLinkQuote(), USER); @@ -481,7 +481,7 @@ contract FeeManagerProcessFeeTest is BaseFeeManagerTest { assertEq(reward.amount, DEFAULT_REPORT_LINK_FEE / 2); } - function test_getRewardWithNativeQuote() public { + function test_getRewardWithNativeQuote() public view { //get the fee required by the feeManager Common.Asset memory reward = getReward(getV3Report(DEFAULT_FEED_1_V3), getNativeQuote(), USER); diff --git a/contracts/src/v0.8/llo-feeds/test/fee-manager/FeeManager.processFee.t.sol b/contracts/src/v0.8/llo-feeds/v0.3.0/test/fee-manager/FeeManager.processFee.t.sol similarity index 99% rename from contracts/src/v0.8/llo-feeds/test/fee-manager/FeeManager.processFee.t.sol rename to contracts/src/v0.8/llo-feeds/v0.3.0/test/fee-manager/FeeManager.processFee.t.sol index f8c1d47d4d0..0e0ed8977bc 100644 --- a/contracts/src/v0.8/llo-feeds/test/fee-manager/FeeManager.processFee.t.sol +++ b/contracts/src/v0.8/llo-feeds/v0.3.0/test/fee-manager/FeeManager.processFee.t.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.19; -import {Common} from "../../libraries/Common.sol"; +import {Common} from "../../../libraries/Common.sol"; import "./BaseFeeManager.t.sol"; import {IRewardManager} from "../../interfaces/IRewardManager.sol"; diff --git a/contracts/src/v0.8/llo-feeds/test/fee-manager/FeeManager.processFeeBulk.t.sol b/contracts/src/v0.8/llo-feeds/v0.3.0/test/fee-manager/FeeManager.processFeeBulk.t.sol similarity index 100% rename from contracts/src/v0.8/llo-feeds/test/fee-manager/FeeManager.processFeeBulk.t.sol rename to contracts/src/v0.8/llo-feeds/v0.3.0/test/fee-manager/FeeManager.processFeeBulk.t.sol diff --git a/contracts/src/v0.8/llo-feeds/test/gas/Gas_VerifierTest.t.sol b/contracts/src/v0.8/llo-feeds/v0.3.0/test/gas/Gas_VerifierTest.t.sol similarity index 98% rename from contracts/src/v0.8/llo-feeds/test/gas/Gas_VerifierTest.t.sol rename to contracts/src/v0.8/llo-feeds/v0.3.0/test/gas/Gas_VerifierTest.t.sol index 29b488fb328..ee8ba4c3e34 100644 --- a/contracts/src/v0.8/llo-feeds/test/gas/Gas_VerifierTest.t.sol +++ b/contracts/src/v0.8/llo-feeds/v0.3.0/test/gas/Gas_VerifierTest.t.sol @@ -2,8 +2,8 @@ pragma solidity 0.8.19; import {BaseTest, BaseTestWithConfiguredVerifierAndFeeManager} from "../verifier/BaseVerifierTest.t.sol"; -import {SimpleWriteAccessController} from "../../../shared/access/SimpleWriteAccessController.sol"; -import {Common} from "../../libraries/Common.sol"; +import {SimpleWriteAccessController} from "../../../../shared/access/SimpleWriteAccessController.sol"; +import {Common} from "../../../libraries/Common.sol"; import {IRewardManager} from "../../interfaces/IRewardManager.sol"; contract Verifier_setConfig is BaseTest { diff --git a/contracts/src/v0.8/llo-feeds/v0.3.0/test/mocks/ErroredVerifier.sol b/contracts/src/v0.8/llo-feeds/v0.3.0/test/mocks/ErroredVerifier.sol new file mode 100644 index 00000000000..e9dcd589e23 --- /dev/null +++ b/contracts/src/v0.8/llo-feeds/v0.3.0/test/mocks/ErroredVerifier.sol @@ -0,0 +1,95 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity 0.8.19; + +import {IVerifier} from "../../interfaces/IVerifier.sol"; +import {Common} from "../../../libraries/Common.sol"; + +contract ErroredVerifier is IVerifier { + function supportsInterface(bytes4 interfaceId) public pure override returns (bool) { + return interfaceId == this.verify.selector; + } + + //define each of the errors thrown in the revert below + + error FailedToVerify(); + error FailedToSetConfig(); + error FailedToActivateConfig(); + error FailedToDeactivateConfig(); + error FailedToActivateFeed(); + error FailedToDeactivateFeed(); + error FailedToGetLatestConfigDigestAndEpoch(); + error FailedToGetLatestConfigDetails(); + + function verify( + bytes memory, + /** + * signedReport* + */ + address + ) + external + pure + override + returns ( + /** + * sender* + */ + bytes memory + ) + { + revert FailedToVerify(); + } + + function setConfig( + bytes32, + address[] memory, + bytes32[] memory, + uint8, + bytes memory, + uint64, + bytes memory, + Common.AddressAndWeight[] memory + ) external pure override { + revert FailedToSetConfig(); + } + + function setConfigFromSource( + bytes32, + uint256, + address, + uint32, + address[] memory, + bytes32[] memory, + uint8, + bytes memory, + uint64, + bytes memory, + Common.AddressAndWeight[] memory + ) external pure override { + revert FailedToSetConfig(); + } + + function activateConfig(bytes32, bytes32) external pure { + revert FailedToActivateConfig(); + } + + function deactivateConfig(bytes32, bytes32) external pure { + revert FailedToDeactivateConfig(); + } + + function activateFeed(bytes32) external pure { + revert FailedToActivateFeed(); + } + + function deactivateFeed(bytes32) external pure { + revert FailedToDeactivateFeed(); + } + + function latestConfigDigestAndEpoch(bytes32) external pure override returns (bool, bytes32, uint32) { + revert FailedToGetLatestConfigDigestAndEpoch(); + } + + function latestConfigDetails(bytes32) external pure override returns (uint32, uint32, bytes32) { + revert FailedToGetLatestConfigDetails(); + } +} diff --git a/contracts/src/v0.8/llo-feeds/dev/test/mocks/ExposedVerifier.sol b/contracts/src/v0.8/llo-feeds/v0.3.0/test/mocks/ExposedVerifier.sol similarity index 100% rename from contracts/src/v0.8/llo-feeds/dev/test/mocks/ExposedVerifier.sol rename to contracts/src/v0.8/llo-feeds/v0.3.0/test/mocks/ExposedVerifier.sol diff --git a/contracts/src/v0.8/llo-feeds/v0.3.0/test/mocks/FeeManagerProxy.sol b/contracts/src/v0.8/llo-feeds/v0.3.0/test/mocks/FeeManagerProxy.sol new file mode 100644 index 00000000000..9abb4c50c29 --- /dev/null +++ b/contracts/src/v0.8/llo-feeds/v0.3.0/test/mocks/FeeManagerProxy.sol @@ -0,0 +1,20 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.19; + +import {IFeeManager} from "../../interfaces/IFeeManager.sol"; + +contract FeeManagerProxy { + IFeeManager internal s_feeManager; + + function processFee(bytes calldata payload, bytes calldata parameterPayload) public payable { + s_feeManager.processFee{value: msg.value}(payload, parameterPayload, msg.sender); + } + + function processFeeBulk(bytes[] calldata payloads, bytes calldata parameterPayload) public payable { + s_feeManager.processFeeBulk{value: msg.value}(payloads, parameterPayload, msg.sender); + } + + function setFeeManager(IFeeManager feeManager) public { + s_feeManager = feeManager; + } +} diff --git a/contracts/src/v0.8/llo-feeds/test/reward-manager/BaseRewardManager.t.sol b/contracts/src/v0.8/llo-feeds/v0.3.0/test/reward-manager/BaseRewardManager.t.sol similarity index 97% rename from contracts/src/v0.8/llo-feeds/test/reward-manager/BaseRewardManager.t.sol rename to contracts/src/v0.8/llo-feeds/v0.3.0/test/reward-manager/BaseRewardManager.t.sol index 65481513f0d..c7bd7528c31 100644 --- a/contracts/src/v0.8/llo-feeds/test/reward-manager/BaseRewardManager.t.sol +++ b/contracts/src/v0.8/llo-feeds/v0.3.0/test/reward-manager/BaseRewardManager.t.sol @@ -2,9 +2,9 @@ pragma solidity 0.8.19; import {Test} from "forge-std/Test.sol"; -import {ERC20Mock} from "../../../vendor/openzeppelin-solidity/v4.8.3/contracts/mocks/ERC20Mock.sol"; -import {RewardManager} from "../../RewardManager.sol"; -import {Common} from "../../libraries/Common.sol"; +import {ERC20Mock} from "../../../../vendor/openzeppelin-solidity/v4.8.3/contracts/mocks/ERC20Mock.sol"; +import {RewardManager} from "../../../v0.3.0/RewardManager.sol"; +import {Common} from "../../../libraries/Common.sol"; import {IRewardManager} from "../../interfaces/IRewardManager.sol"; /** diff --git a/contracts/src/v0.8/llo-feeds/test/reward-manager/RewardManager.claim.t.sol b/contracts/src/v0.8/llo-feeds/v0.3.0/test/reward-manager/RewardManager.claim.t.sol similarity index 99% rename from contracts/src/v0.8/llo-feeds/test/reward-manager/RewardManager.claim.t.sol rename to contracts/src/v0.8/llo-feeds/v0.3.0/test/reward-manager/RewardManager.claim.t.sol index 5f07d36c72c..efbe9fd6b36 100644 --- a/contracts/src/v0.8/llo-feeds/test/reward-manager/RewardManager.claim.t.sol +++ b/contracts/src/v0.8/llo-feeds/v0.3.0/test/reward-manager/RewardManager.claim.t.sol @@ -2,7 +2,7 @@ pragma solidity 0.8.19; import {BaseRewardManagerTest} from "./BaseRewardManager.t.sol"; -import {Common} from "../../libraries/Common.sol"; +import {Common} from "../../../libraries/Common.sol"; /** * @title BaseRewardManagerTest @@ -574,7 +574,7 @@ contract RewardManagerRecipientClaimMultiplePoolsTest is BaseRewardManagerTest { assertEq(poolIds[1], ZERO_POOL_ID); } - function test_getRewardsAvailableToRecipientInNoPools() public { + function test_getRewardsAvailableToRecipientInNoPools() public view { //get index 0 as this recipient is in both default pools bytes32[] memory poolIds = rewardManager.getAvailableRewardPoolIds(FEE_MANAGER, 0, type(uint256).max); diff --git a/contracts/src/v0.8/llo-feeds/test/reward-manager/RewardManager.general.t.sol b/contracts/src/v0.8/llo-feeds/v0.3.0/test/reward-manager/RewardManager.general.t.sol similarity index 92% rename from contracts/src/v0.8/llo-feeds/test/reward-manager/RewardManager.general.t.sol rename to contracts/src/v0.8/llo-feeds/v0.3.0/test/reward-manager/RewardManager.general.t.sol index 7fde76d5281..baff3887699 100644 --- a/contracts/src/v0.8/llo-feeds/test/reward-manager/RewardManager.general.t.sol +++ b/contracts/src/v0.8/llo-feeds/v0.3.0/test/reward-manager/RewardManager.general.t.sol @@ -2,8 +2,8 @@ pragma solidity 0.8.19; import {BaseRewardManagerTest} from "./BaseRewardManager.t.sol"; -import {RewardManager} from "../../RewardManager.sol"; -import {ERC20Mock} from "../../../vendor/openzeppelin-solidity/v4.8.3/contracts/mocks/ERC20Mock.sol"; +import {RewardManager} from "../../../v0.3.0/RewardManager.sol"; +import {ERC20Mock} from "../../../../vendor/openzeppelin-solidity/v4.8.3/contracts/mocks/ERC20Mock.sol"; import {IRewardManager} from "../../interfaces/IRewardManager.sol"; /** diff --git a/contracts/src/v0.8/llo-feeds/test/reward-manager/RewardManager.payRecipients.t.sol b/contracts/src/v0.8/llo-feeds/v0.3.0/test/reward-manager/RewardManager.payRecipients.t.sol similarity index 100% rename from contracts/src/v0.8/llo-feeds/test/reward-manager/RewardManager.payRecipients.t.sol rename to contracts/src/v0.8/llo-feeds/v0.3.0/test/reward-manager/RewardManager.payRecipients.t.sol diff --git a/contracts/src/v0.8/llo-feeds/test/reward-manager/RewardManager.setRecipients.t.sol b/contracts/src/v0.8/llo-feeds/v0.3.0/test/reward-manager/RewardManager.setRecipients.t.sol similarity index 98% rename from contracts/src/v0.8/llo-feeds/test/reward-manager/RewardManager.setRecipients.t.sol rename to contracts/src/v0.8/llo-feeds/v0.3.0/test/reward-manager/RewardManager.setRecipients.t.sol index 1cf5b51f621..d3e6990bd9f 100644 --- a/contracts/src/v0.8/llo-feeds/test/reward-manager/RewardManager.setRecipients.t.sol +++ b/contracts/src/v0.8/llo-feeds/v0.3.0/test/reward-manager/RewardManager.setRecipients.t.sol @@ -2,7 +2,7 @@ pragma solidity 0.8.19; import {BaseRewardManagerTest} from "./BaseRewardManager.t.sol"; -import {Common} from "../../libraries/Common.sol"; +import {Common} from "../../../libraries/Common.sol"; /** * @title BaseRewardManagerTest diff --git a/contracts/src/v0.8/llo-feeds/test/reward-manager/RewardManager.updateRewardRecipients.t.sol b/contracts/src/v0.8/llo-feeds/v0.3.0/test/reward-manager/RewardManager.updateRewardRecipients.t.sol similarity index 99% rename from contracts/src/v0.8/llo-feeds/test/reward-manager/RewardManager.updateRewardRecipients.t.sol rename to contracts/src/v0.8/llo-feeds/v0.3.0/test/reward-manager/RewardManager.updateRewardRecipients.t.sol index 6c51a0fbfdd..0d3a2b69b39 100644 --- a/contracts/src/v0.8/llo-feeds/test/reward-manager/RewardManager.updateRewardRecipients.t.sol +++ b/contracts/src/v0.8/llo-feeds/v0.3.0/test/reward-manager/RewardManager.updateRewardRecipients.t.sol @@ -2,7 +2,7 @@ pragma solidity 0.8.19; import {BaseRewardManagerTest} from "./BaseRewardManager.t.sol"; -import {Common} from "../../libraries/Common.sol"; +import {Common} from "../../../libraries/Common.sol"; /** * @title BaseRewardManagerTest diff --git a/contracts/src/v0.8/llo-feeds/test/verifier/BaseVerifierTest.t.sol b/contracts/src/v0.8/llo-feeds/v0.3.0/test/verifier/BaseVerifierTest.t.sol similarity index 97% rename from contracts/src/v0.8/llo-feeds/test/verifier/BaseVerifierTest.t.sol rename to contracts/src/v0.8/llo-feeds/v0.3.0/test/verifier/BaseVerifierTest.t.sol index daf31875036..4d65414676e 100644 --- a/contracts/src/v0.8/llo-feeds/test/verifier/BaseVerifierTest.t.sol +++ b/contracts/src/v0.8/llo-feeds/v0.3.0/test/verifier/BaseVerifierTest.t.sol @@ -3,17 +3,16 @@ pragma solidity 0.8.19; import {Test} from "forge-std/Test.sol"; import {VerifierProxy} from "../../VerifierProxy.sol"; -import {IERC165} from "../../../vendor/openzeppelin-solidity/v4.8.3/contracts/interfaces/IERC165.sol"; +import {IERC165} from "../../../../vendor/openzeppelin-solidity/v4.8.3/contracts/interfaces/IERC165.sol"; import {IVerifier} from "../../interfaces/IVerifier.sol"; import {ErroredVerifier} from "../mocks/ErroredVerifier.sol"; import {Verifier} from "../../Verifier.sol"; import {Strings} from "@openzeppelin/contracts/utils/Strings.sol"; -import {AccessControllerInterface} from "../../../shared/interfaces/AccessControllerInterface.sol"; -import {FeeManager} from "../../FeeManager.sol"; -import {Common} from "../../libraries/Common.sol"; -import {ERC20Mock} from "../../../vendor/openzeppelin-solidity/v4.8.3/contracts/mocks/ERC20Mock.sol"; -import {WERC20Mock} from "../../../shared/mocks/WERC20Mock.sol"; +import {AccessControllerInterface} from "../../../../shared/interfaces/AccessControllerInterface.sol"; import {FeeManager} from "../../FeeManager.sol"; +import {Common} from "../../../libraries/Common.sol"; +import {ERC20Mock} from "../../../../vendor/openzeppelin-solidity/v4.8.3/contracts/mocks/ERC20Mock.sol"; +import {WERC20Mock} from "../../../../shared/mocks/WERC20Mock.sol"; import {RewardManager} from "../../RewardManager.sol"; contract BaseTest is Test { diff --git a/contracts/src/v0.8/llo-feeds/test/verifier/VerifierActivateConfigTest.t.sol b/contracts/src/v0.8/llo-feeds/v0.3.0/test/verifier/VerifierActivateConfigTest.t.sol similarity index 97% rename from contracts/src/v0.8/llo-feeds/test/verifier/VerifierActivateConfigTest.t.sol rename to contracts/src/v0.8/llo-feeds/v0.3.0/test/verifier/VerifierActivateConfigTest.t.sol index f53c26ba192..99daabe206b 100644 --- a/contracts/src/v0.8/llo-feeds/test/verifier/VerifierActivateConfigTest.t.sol +++ b/contracts/src/v0.8/llo-feeds/v0.3.0/test/verifier/VerifierActivateConfigTest.t.sol @@ -2,7 +2,7 @@ pragma solidity 0.8.19; import {BaseTestWithConfiguredVerifierAndFeeManager, BaseTestWithMultipleConfiguredDigests} from "./BaseVerifierTest.t.sol"; -import {Verifier} from "../../Verifier.sol"; +import {Verifier} from "../../../v0.3.0/Verifier.sol"; contract VerifierActivateConfigTest is BaseTestWithConfiguredVerifierAndFeeManager { function test_revertsIfNotOwner() public { diff --git a/contracts/src/v0.8/llo-feeds/test/verifier/VerifierDeactivateFeedTest.t.sol b/contracts/src/v0.8/llo-feeds/v0.3.0/test/verifier/VerifierDeactivateFeedTest.t.sol similarity index 98% rename from contracts/src/v0.8/llo-feeds/test/verifier/VerifierDeactivateFeedTest.t.sol rename to contracts/src/v0.8/llo-feeds/v0.3.0/test/verifier/VerifierDeactivateFeedTest.t.sol index 97647c88635..fb52c1c93e7 100644 --- a/contracts/src/v0.8/llo-feeds/test/verifier/VerifierDeactivateFeedTest.t.sol +++ b/contracts/src/v0.8/llo-feeds/v0.3.0/test/verifier/VerifierDeactivateFeedTest.t.sol @@ -2,7 +2,7 @@ pragma solidity 0.8.19; import {BaseTestWithConfiguredVerifierAndFeeManager, BaseTestWithMultipleConfiguredDigests} from "./BaseVerifierTest.t.sol"; -import {Verifier} from "../../Verifier.sol"; +import {Verifier} from "../../../v0.3.0/Verifier.sol"; contract VerifierActivateFeedTest is BaseTestWithConfiguredVerifierAndFeeManager { function test_revertsIfNotOwnerActivateFeed() public { diff --git a/contracts/src/v0.8/llo-feeds/test/verifier/VerifierProxyConstructorTest.t.sol b/contracts/src/v0.8/llo-feeds/v0.3.0/test/verifier/VerifierProxyConstructorTest.t.sol similarity index 77% rename from contracts/src/v0.8/llo-feeds/test/verifier/VerifierProxyConstructorTest.t.sol rename to contracts/src/v0.8/llo-feeds/v0.3.0/test/verifier/VerifierProxyConstructorTest.t.sol index b085dc8a651..82efd8907be 100644 --- a/contracts/src/v0.8/llo-feeds/test/verifier/VerifierProxyConstructorTest.t.sol +++ b/contracts/src/v0.8/llo-feeds/v0.3.0/test/verifier/VerifierProxyConstructorTest.t.sol @@ -2,8 +2,8 @@ pragma solidity 0.8.19; import {BaseTest} from "./BaseVerifierTest.t.sol"; -import {VerifierProxy} from "../../VerifierProxy.sol"; -import {AccessControllerInterface} from "../../../shared/interfaces/AccessControllerInterface.sol"; +import {VerifierProxy} from "../../../v0.3.0/VerifierProxy.sol"; +import {AccessControllerInterface} from "../../../../shared/interfaces/AccessControllerInterface.sol"; contract VerifierProxyConstructorTest is BaseTest { function test_correctlySetsTheOwner() public { @@ -17,7 +17,7 @@ contract VerifierProxyConstructorTest is BaseTest { assertEq(address(proxy.s_accessController()), accessControllerAddr); } - function test_correctlySetsVersion() public { + function test_correctlySetsVersion() public view { string memory version = s_verifierProxy.typeAndVersion(); assertEq(version, "VerifierProxy 2.0.0"); } diff --git a/contracts/src/v0.8/llo-feeds/test/verifier/VerifierProxyInitializeVerifierTest.t.sol b/contracts/src/v0.8/llo-feeds/v0.3.0/test/verifier/VerifierProxyInitializeVerifierTest.t.sol similarity index 93% rename from contracts/src/v0.8/llo-feeds/test/verifier/VerifierProxyInitializeVerifierTest.t.sol rename to contracts/src/v0.8/llo-feeds/v0.3.0/test/verifier/VerifierProxyInitializeVerifierTest.t.sol index e02b14fe56e..5537d273be9 100644 --- a/contracts/src/v0.8/llo-feeds/test/verifier/VerifierProxyInitializeVerifierTest.t.sol +++ b/contracts/src/v0.8/llo-feeds/v0.3.0/test/verifier/VerifierProxyInitializeVerifierTest.t.sol @@ -2,7 +2,7 @@ pragma solidity 0.8.19; import {BaseTest} from "./BaseVerifierTest.t.sol"; -import {VerifierProxy} from "../../VerifierProxy.sol"; +import {VerifierProxy} from "../../../v0.3.0/VerifierProxy.sol"; contract VerifierProxyInitializeVerifierTest is BaseTest { bytes32 latestDigest; diff --git a/contracts/src/v0.8/llo-feeds/test/verifier/VerifierProxySetAccessControllerTest.t.sol b/contracts/src/v0.8/llo-feeds/v0.3.0/test/verifier/VerifierProxySetAccessControllerTest.t.sol similarity index 92% rename from contracts/src/v0.8/llo-feeds/test/verifier/VerifierProxySetAccessControllerTest.t.sol rename to contracts/src/v0.8/llo-feeds/v0.3.0/test/verifier/VerifierProxySetAccessControllerTest.t.sol index 04889e0d5f4..03bd6d97ee5 100644 --- a/contracts/src/v0.8/llo-feeds/test/verifier/VerifierProxySetAccessControllerTest.t.sol +++ b/contracts/src/v0.8/llo-feeds/v0.3.0/test/verifier/VerifierProxySetAccessControllerTest.t.sol @@ -2,7 +2,7 @@ pragma solidity 0.8.19; import {BaseTest} from "./BaseVerifierTest.t.sol"; -import {AccessControllerInterface} from "../../../shared/interfaces/AccessControllerInterface.sol"; +import {AccessControllerInterface} from "../../../../shared/interfaces/AccessControllerInterface.sol"; contract VerifierProxySetAccessControllerTest is BaseTest { event AccessControllerSet(address oldAccessController, address newAccessController); diff --git a/contracts/src/v0.8/llo-feeds/test/verifier/VerifierProxySetVerifierTest.t.sol b/contracts/src/v0.8/llo-feeds/v0.3.0/test/verifier/VerifierProxySetVerifierTest.t.sol similarity index 88% rename from contracts/src/v0.8/llo-feeds/test/verifier/VerifierProxySetVerifierTest.t.sol rename to contracts/src/v0.8/llo-feeds/v0.3.0/test/verifier/VerifierProxySetVerifierTest.t.sol index ea23f880ba7..78e5ff0766f 100644 --- a/contracts/src/v0.8/llo-feeds/test/verifier/VerifierProxySetVerifierTest.t.sol +++ b/contracts/src/v0.8/llo-feeds/v0.3.0/test/verifier/VerifierProxySetVerifierTest.t.sol @@ -3,9 +3,9 @@ pragma solidity 0.8.19; import {BaseTestWithConfiguredVerifierAndFeeManager} from "./BaseVerifierTest.t.sol"; import {IVerifier} from "../../interfaces/IVerifier.sol"; -import {VerifierProxy} from "../../VerifierProxy.sol"; -import {IERC165} from "../../../vendor/openzeppelin-solidity/v4.8.3/contracts/interfaces/IERC165.sol"; -import {Common} from "../../libraries/Common.sol"; +import {VerifierProxy} from "../../../v0.3.0/VerifierProxy.sol"; +import {IERC165} from "../../../../vendor/openzeppelin-solidity/v4.8.3/contracts/interfaces/IERC165.sol"; +import {Common} from "../../../libraries/Common.sol"; contract VerifierProxyInitializeVerifierTest is BaseTestWithConfiguredVerifierAndFeeManager { function test_revertsIfNotCorrectVerifier() public { diff --git a/contracts/src/v0.8/llo-feeds/test/verifier/VerifierProxyTest.t.sol b/contracts/src/v0.8/llo-feeds/v0.3.0/test/verifier/VerifierProxyTest.t.sol similarity index 87% rename from contracts/src/v0.8/llo-feeds/test/verifier/VerifierProxyTest.t.sol rename to contracts/src/v0.8/llo-feeds/v0.3.0/test/verifier/VerifierProxyTest.t.sol index ea7e02d7409..441626e575b 100644 --- a/contracts/src/v0.8/llo-feeds/test/verifier/VerifierProxyTest.t.sol +++ b/contracts/src/v0.8/llo-feeds/v0.3.0/test/verifier/VerifierProxyTest.t.sol @@ -2,8 +2,8 @@ pragma solidity 0.8.19; import {BaseTestWithConfiguredVerifierAndFeeManager} from "./BaseVerifierTest.t.sol"; -import {VerifierProxy} from "../../VerifierProxy.sol"; -import {FeeManager} from "../../FeeManager.sol"; +import {VerifierProxy} from "../../../v0.3.0/VerifierProxy.sol"; +import {FeeManager} from "../../../v0.3.0/FeeManager.sol"; contract VerifierProxyInitializeVerifierTest is BaseTestWithConfiguredVerifierAndFeeManager { function test_setFeeManagerZeroAddress() public { diff --git a/contracts/src/v0.8/llo-feeds/test/verifier/VerifierProxyUnsetVerifierTest.t.sol b/contracts/src/v0.8/llo-feeds/v0.3.0/test/verifier/VerifierProxyUnsetVerifierTest.t.sol similarity index 95% rename from contracts/src/v0.8/llo-feeds/test/verifier/VerifierProxyUnsetVerifierTest.t.sol rename to contracts/src/v0.8/llo-feeds/v0.3.0/test/verifier/VerifierProxyUnsetVerifierTest.t.sol index 746aa955748..a51c67e336c 100644 --- a/contracts/src/v0.8/llo-feeds/test/verifier/VerifierProxyUnsetVerifierTest.t.sol +++ b/contracts/src/v0.8/llo-feeds/v0.3.0/test/verifier/VerifierProxyUnsetVerifierTest.t.sol @@ -2,7 +2,7 @@ pragma solidity 0.8.19; import {BaseTest, BaseTestWithConfiguredVerifierAndFeeManager} from "./BaseVerifierTest.t.sol"; -import {VerifierProxy} from "../../VerifierProxy.sol"; +import {VerifierProxy} from "../../../v0.3.0/VerifierProxy.sol"; contract VerifierProxyUnsetVerifierTest is BaseTest { function test_revertsIfNotAdmin() public { diff --git a/contracts/src/v0.8/llo-feeds/test/verifier/VerifierSetConfigFromSourceTest.t.sol b/contracts/src/v0.8/llo-feeds/v0.3.0/test/verifier/VerifierSetConfigFromSourceTest.t.sol similarity index 98% rename from contracts/src/v0.8/llo-feeds/test/verifier/VerifierSetConfigFromSourceTest.t.sol rename to contracts/src/v0.8/llo-feeds/v0.3.0/test/verifier/VerifierSetConfigFromSourceTest.t.sol index 0cd5902161d..9ee9b5272a7 100644 --- a/contracts/src/v0.8/llo-feeds/test/verifier/VerifierSetConfigFromSourceTest.t.sol +++ b/contracts/src/v0.8/llo-feeds/v0.3.0/test/verifier/VerifierSetConfigFromSourceTest.t.sol @@ -2,7 +2,7 @@ pragma solidity 0.8.19; import {BaseTest, BaseTestWithMultipleConfiguredDigests} from "./BaseVerifierTest.t.sol"; -import {Common} from "../../libraries/Common.sol"; +import {Common} from "../../../libraries/Common.sol"; contract VerifierSetConfigFromSourceTest is BaseTest { function setUp() public virtual override { diff --git a/contracts/src/v0.8/llo-feeds/test/verifier/VerifierSetConfigTest.t.sol b/contracts/src/v0.8/llo-feeds/v0.3.0/test/verifier/VerifierSetConfigTest.t.sol similarity index 98% rename from contracts/src/v0.8/llo-feeds/test/verifier/VerifierSetConfigTest.t.sol rename to contracts/src/v0.8/llo-feeds/v0.3.0/test/verifier/VerifierSetConfigTest.t.sol index a4e15dcdd4c..972ead81230 100644 --- a/contracts/src/v0.8/llo-feeds/test/verifier/VerifierSetConfigTest.t.sol +++ b/contracts/src/v0.8/llo-feeds/v0.3.0/test/verifier/VerifierSetConfigTest.t.sol @@ -2,8 +2,8 @@ pragma solidity 0.8.19; import {BaseTest, BaseTestWithMultipleConfiguredDigests} from "./BaseVerifierTest.t.sol"; -import {Verifier} from "../../Verifier.sol"; -import {Common} from "../../libraries/Common.sol"; +import {Verifier} from "../../../v0.3.0/Verifier.sol"; +import {Common} from "../../../libraries/Common.sol"; contract VerifierSetConfigTest is BaseTest { function setUp() public virtual override { diff --git a/contracts/src/v0.8/llo-feeds/test/verifier/VerifierTest.t.sol b/contracts/src/v0.8/llo-feeds/v0.3.0/test/verifier/VerifierTest.t.sol similarity index 88% rename from contracts/src/v0.8/llo-feeds/test/verifier/VerifierTest.t.sol rename to contracts/src/v0.8/llo-feeds/v0.3.0/test/verifier/VerifierTest.t.sol index 2857b8f4d3d..81f65f0c6eb 100644 --- a/contracts/src/v0.8/llo-feeds/test/verifier/VerifierTest.t.sol +++ b/contracts/src/v0.8/llo-feeds/v0.3.0/test/verifier/VerifierTest.t.sol @@ -2,7 +2,7 @@ pragma solidity 0.8.19; import {BaseTest} from "./BaseVerifierTest.t.sol"; -import {Verifier} from "../../Verifier.sol"; +import {Verifier} from "../../../v0.3.0/Verifier.sol"; contract VerifierConstructorTest is BaseTest { function test_revertsIfInitializedWithEmptyVerifierProxy() public { @@ -30,12 +30,12 @@ contract VerifierConstructorTest is BaseTest { } contract VerifierSupportsInterfaceTest is BaseTest { - function test_falseIfIsNotCorrectInterface() public { + function test_falseIfIsNotCorrectInterface() public view { bool isInterface = s_verifier.supportsInterface(bytes4("abcd")); assertEq(isInterface, false); } - function test_trueIfIsCorrectInterface() public { + function test_trueIfIsCorrectInterface() public view { bool isInterface = s_verifier.supportsInterface(Verifier.verify.selector); assertEq(isInterface, true); } diff --git a/contracts/src/v0.8/llo-feeds/test/verifier/VerifierTestBillingReport.t.sol b/contracts/src/v0.8/llo-feeds/v0.3.0/test/verifier/VerifierTestBillingReport.t.sol similarity index 100% rename from contracts/src/v0.8/llo-feeds/test/verifier/VerifierTestBillingReport.t.sol rename to contracts/src/v0.8/llo-feeds/v0.3.0/test/verifier/VerifierTestBillingReport.t.sol diff --git a/contracts/src/v0.8/llo-feeds/test/verifier/VerifierUnsetConfigTest.t.sol b/contracts/src/v0.8/llo-feeds/v0.3.0/test/verifier/VerifierUnsetConfigTest.t.sol similarity index 97% rename from contracts/src/v0.8/llo-feeds/test/verifier/VerifierUnsetConfigTest.t.sol rename to contracts/src/v0.8/llo-feeds/v0.3.0/test/verifier/VerifierUnsetConfigTest.t.sol index cc3c33331df..e192a2e9e08 100644 --- a/contracts/src/v0.8/llo-feeds/test/verifier/VerifierUnsetConfigTest.t.sol +++ b/contracts/src/v0.8/llo-feeds/v0.3.0/test/verifier/VerifierUnsetConfigTest.t.sol @@ -2,7 +2,7 @@ pragma solidity 0.8.19; import {BaseTestWithMultipleConfiguredDigests} from "./BaseVerifierTest.t.sol"; -import {Verifier} from "../../Verifier.sol"; +import {Verifier} from "../../../v0.3.0/Verifier.sol"; contract VerificationdeactivateConfigWhenThereAreMultipleDigestsTest is BaseTestWithMultipleConfiguredDigests { function test_revertsIfCalledByNonOwner() public { diff --git a/contracts/src/v0.8/llo-feeds/test/verifier/VerifierVerifyTest.t.sol b/contracts/src/v0.8/llo-feeds/v0.3.0/test/verifier/VerifierVerifyTest.t.sol similarity index 97% rename from contracts/src/v0.8/llo-feeds/test/verifier/VerifierVerifyTest.t.sol rename to contracts/src/v0.8/llo-feeds/v0.3.0/test/verifier/VerifierVerifyTest.t.sol index db7be5ca543..1c14ba974c0 100644 --- a/contracts/src/v0.8/llo-feeds/test/verifier/VerifierVerifyTest.t.sol +++ b/contracts/src/v0.8/llo-feeds/v0.3.0/test/verifier/VerifierVerifyTest.t.sol @@ -2,10 +2,10 @@ pragma solidity 0.8.19; import {BaseTestWithConfiguredVerifierAndFeeManager} from "./BaseVerifierTest.t.sol"; -import {Verifier} from "../../Verifier.sol"; -import {VerifierProxy} from "../../VerifierProxy.sol"; -import {AccessControllerInterface} from "../../../shared/interfaces/AccessControllerInterface.sol"; -import {Common} from "../../libraries/Common.sol"; +import {Verifier} from "../../../v0.3.0/Verifier.sol"; +import {VerifierProxy} from "../../../v0.3.0/VerifierProxy.sol"; +import {AccessControllerInterface} from "../../../../shared/interfaces/AccessControllerInterface.sol"; +import {Common} from "../../../libraries/Common.sol"; contract VerifierVerifyTest is BaseTestWithConfiguredVerifierAndFeeManager { bytes32[3] internal s_reportContext; @@ -32,7 +32,7 @@ contract VerifierVerifyTest is BaseTestWithConfiguredVerifierAndFeeManager { ); } - function assertReportsEqual(bytes memory response, V1Report memory testReport) public { + function assertReportsEqual(bytes memory response, V1Report memory testReport) public pure { ( bytes32 feedId, uint32 timestamp, diff --git a/contracts/src/v0.8/llo-feeds/v0.4.0/DestinationFeeManager.sol b/contracts/src/v0.8/llo-feeds/v0.4.0/DestinationFeeManager.sol new file mode 100644 index 00000000000..08ac1d45f58 --- /dev/null +++ b/contracts/src/v0.8/llo-feeds/v0.4.0/DestinationFeeManager.sol @@ -0,0 +1,573 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.19; + +import {ConfirmedOwner} from "../../shared/access/ConfirmedOwner.sol"; +import {TypeAndVersionInterface} from "../../interfaces/TypeAndVersionInterface.sol"; +import {IERC165} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/interfaces/IERC165.sol"; +import {Common} from "../libraries/Common.sol"; +import {IWERC20} from "../../shared/interfaces/IWERC20.sol"; +import {IERC20} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/interfaces/IERC20.sol"; +import {Math} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/utils/math/Math.sol"; +import {SafeERC20} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/utils/SafeERC20.sol"; +import {IDestinationRewardManager} from "./interfaces/IDestinationRewardManager.sol"; +import {IDestinationFeeManager} from "./interfaces/IDestinationFeeManager.sol"; +import {IDestinationVerifierFeeManager} from "./interfaces/IDestinationVerifierFeeManager.sol"; + +/** + * @title FeeManager + * @author Michael Fletcher + * @author Austin Born + * @notice This contract is used for the handling of fees required for users verifying reports. + */ +contract DestinationFeeManager is + IDestinationFeeManager, + IDestinationVerifierFeeManager, + ConfirmedOwner, + TypeAndVersionInterface +{ + using SafeERC20 for IERC20; + + /// @notice list of subscribers and their discounts subscriberDiscounts[subscriber][feedId][token] + mapping(address => mapping(bytes32 => mapping(address => uint256))) public s_subscriberDiscounts; + + /// @notice map of global discounts + mapping(address => mapping(address => uint256)) public s_globalDiscounts; + + /// @notice keep track of any subsidised link that is owed to the reward manager. + mapping(bytes32 => uint256) public s_linkDeficit; + + /// @notice the total discount that can be applied to a fee, 1e18 = 100% discount + uint64 private constant PERCENTAGE_SCALAR = 1e18; + + /// @notice the LINK token address + address public immutable i_linkAddress; + + /// @notice the native token address + address public immutable i_nativeAddress; + + /// @notice the verifier address + mapping(address => address) public s_verifierAddressList; + + /// @notice the reward manager address + IDestinationRewardManager public i_rewardManager; + + // @notice the mask to apply to get the report version + bytes32 private constant REPORT_VERSION_MASK = 0xffff000000000000000000000000000000000000000000000000000000000000; + + // @notice the different report versions + bytes32 private constant REPORT_V1 = 0x0001000000000000000000000000000000000000000000000000000000000000; + + /// @notice the surcharge fee to be paid if paying in native + uint256 public s_nativeSurcharge; + + /// @notice the error thrown if the discount or surcharge is invalid + error InvalidSurcharge(); + + /// @notice the error thrown if the discount is invalid + error InvalidDiscount(); + + /// @notice the error thrown if the address is invalid + error InvalidAddress(); + + /// @notice thrown if msg.value is supplied with a bad quote + error InvalidDeposit(); + + /// @notice thrown if a report has expired + error ExpiredReport(); + + /// @notice thrown if a report has no quote + error InvalidQuote(); + + // @notice thrown when the caller is not authorized + error Unauthorized(); + + // @notice thrown when trying to clear a zero deficit + error ZeroDeficit(); + + /// @notice thrown when trying to pay an address that cannot except funds + error InvalidReceivingAddress(); + + /// @notice thrown when trying to bulk verify reports where theres not a matching number of poolIds + error PoolIdMismatch(); + + /// @notice Emitted whenever a subscriber's discount is updated + /// @param subscriber address of the subscriber to update discounts for + /// @param feedId Feed ID for the discount + /// @param token Token address for the discount + /// @param discount Discount to apply, in relation to the PERCENTAGE_SCALAR + event SubscriberDiscountUpdated(address indexed subscriber, bytes32 indexed feedId, address token, uint64 discount); + + /// @notice Emitted when updating the native surcharge + /// @param newSurcharge Surcharge amount to apply relative to PERCENTAGE_SCALAR + event NativeSurchargeUpdated(uint64 newSurcharge); + + /// @notice Emits when this contract does not have enough LINK to send to the reward manager when paying in native + /// @param rewards Config digest and link fees which could not be subsidised + event InsufficientLink(IDestinationRewardManager.FeePayment[] rewards); + + /// @notice Emitted when funds are withdrawn + /// @param adminAddress Address of the admin + /// @param recipient Address of the recipient + /// @param assetAddress Address of the asset withdrawn + /// @param quantity Amount of the asset withdrawn + event Withdraw(address adminAddress, address recipient, address assetAddress, uint192 quantity); + + /// @notice Emits when a deficit has been cleared for a particular config digest + /// @param configDigest Config digest of the deficit cleared + /// @param linkQuantity Amount of LINK required to pay the deficit + event LinkDeficitCleared(bytes32 indexed configDigest, uint256 linkQuantity); + + /// @notice Emits when a fee has been processed + /// @param configDigest Config digest of the fee processed + /// @param subscriber Address of the subscriber who paid the fee + /// @param fee Fee paid + /// @param reward Reward paid + /// @param appliedDiscount Discount applied to the fee + event DiscountApplied( + bytes32 indexed configDigest, + address indexed subscriber, + Common.Asset fee, + Common.Asset reward, + uint256 appliedDiscount + ); + + /** + * @notice Construct the FeeManager contract + * @param _linkAddress The address of the LINK token + * @param _nativeAddress The address of the wrapped ERC-20 version of the native token (represents fee in native or wrapped) + * @param _verifierAddress The address of the verifier contract + * @param _rewardManagerAddress The address of the reward manager contract + */ + constructor( + address _linkAddress, + address _nativeAddress, + address _verifierAddress, + address _rewardManagerAddress + ) ConfirmedOwner(msg.sender) { + if ( + _linkAddress == address(0) || + _nativeAddress == address(0) || + _verifierAddress == address(0) || + _rewardManagerAddress == address(0) + ) revert InvalidAddress(); + + i_linkAddress = _linkAddress; + i_nativeAddress = _nativeAddress; + s_verifierAddressList[_verifierAddress] = _verifierAddress; + i_rewardManager = IDestinationRewardManager(_rewardManagerAddress); + + IERC20(i_linkAddress).approve(address(i_rewardManager), type(uint256).max); + } + + modifier onlyVerifier() { + if (msg.sender != s_verifierAddressList[msg.sender]) revert Unauthorized(); + _; + } + + /// @inheritdoc TypeAndVersionInterface + function typeAndVersion() external pure override returns (string memory) { + return "DestinationFeeManager 0.4.0"; + } + + /// @inheritdoc IERC165 + function supportsInterface(bytes4 interfaceId) external pure override returns (bool) { + return + interfaceId == type(IDestinationFeeManager).interfaceId || + interfaceId == type(IDestinationVerifierFeeManager).interfaceId; + } + + /// @inheritdoc IDestinationVerifierFeeManager + function processFee( + bytes32 recipient, + bytes calldata payload, + bytes calldata parameterPayload, + address subscriber + ) external payable override onlyVerifier { + (Common.Asset memory fee, Common.Asset memory reward, uint256 appliedDiscount) = _calculateFee( + payload, + parameterPayload, + subscriber + ); + + if (fee.amount == 0) { + _tryReturnChange(subscriber, msg.value); + return; + } + + IDestinationFeeManager.FeeAndReward[] memory feeAndReward = new IDestinationFeeManager.FeeAndReward[](1); + feeAndReward[0] = IDestinationFeeManager.FeeAndReward(recipient, fee, reward, appliedDiscount); + + if (fee.assetAddress == i_linkAddress) { + _handleFeesAndRewards(subscriber, feeAndReward, 1, 0); + } else { + _handleFeesAndRewards(subscriber, feeAndReward, 0, 1); + } + } + + /// @inheritdoc IDestinationVerifierFeeManager + function processFeeBulk( + bytes32[] memory poolIds, + bytes[] calldata payloads, + bytes calldata parameterPayload, + address subscriber + ) external payable override onlyVerifier { + //poolIDs are mapped to payloads, so they should be the same length + if (poolIds.length != payloads.length) revert PoolIdMismatch(); + + IDestinationFeeManager.FeeAndReward[] memory feesAndRewards = new IDestinationFeeManager.FeeAndReward[]( + payloads.length + ); + + //keep track of the number of fees to prevent over initialising the FeePayment array within _convertToLinkAndNativeFees + uint256 numberOfLinkFees; + uint256 numberOfNativeFees; + + uint256 feesAndRewardsIndex; + for (uint256 i; i < payloads.length; ++i) { + if (poolIds[i] == bytes32(0)) revert InvalidAddress(); + + (Common.Asset memory fee, Common.Asset memory reward, uint256 appliedDiscount) = _calculateFee( + payloads[i], + parameterPayload, + subscriber + ); + + if (fee.amount != 0) { + feesAndRewards[feesAndRewardsIndex++] = IDestinationFeeManager.FeeAndReward( + poolIds[i], + fee, + reward, + appliedDiscount + ); + + unchecked { + //keep track of some tallys to make downstream calculations more efficient + if (fee.assetAddress == i_linkAddress) { + ++numberOfLinkFees; + } else { + ++numberOfNativeFees; + } + } + } + } + + if (numberOfLinkFees != 0 || numberOfNativeFees != 0) { + _handleFeesAndRewards(subscriber, feesAndRewards, numberOfLinkFees, numberOfNativeFees); + } else { + _tryReturnChange(subscriber, msg.value); + } + } + + /// @inheritdoc IDestinationFeeManager + function getFeeAndReward( + address subscriber, + bytes memory report, + address quoteAddress + ) public view returns (Common.Asset memory, Common.Asset memory, uint256) { + Common.Asset memory fee; + Common.Asset memory reward; + + //get the feedId from the report + bytes32 feedId = bytes32(report); + + //the report needs to be a support version + bytes32 reportVersion = _getReportVersion(feedId); + + //version 1 of the reports don't require quotes, so the fee will be 0 + if (reportVersion == REPORT_V1) { + fee.assetAddress = i_nativeAddress; + reward.assetAddress = i_linkAddress; + return (fee, reward, 0); + } + + //verify the quote payload is a supported token + if (quoteAddress != i_nativeAddress && quoteAddress != i_linkAddress) { + revert InvalidQuote(); + } + + //decode the report depending on the version + uint256 linkQuantity; + uint256 nativeQuantity; + uint256 expiresAt; + (, , , nativeQuantity, linkQuantity, expiresAt) = abi.decode( + report, + (bytes32, uint32, uint32, uint192, uint192, uint32) + ); + + //read the timestamp bytes from the report data and verify it has not expired + if (expiresAt < block.timestamp) { + revert ExpiredReport(); + } + + //check if feed discount has been applied + uint256 discount = s_subscriberDiscounts[subscriber][feedId][quoteAddress]; + + if (discount == 0) { + //check if a global discount has been applied + discount = s_globalDiscounts[subscriber][quoteAddress]; + } + + //the reward is always set in LINK + reward.assetAddress = i_linkAddress; + reward.amount = Math.ceilDiv(linkQuantity * (PERCENTAGE_SCALAR - discount), PERCENTAGE_SCALAR); + + //calculate either the LINK fee or native fee if it's within the report + if (quoteAddress == i_linkAddress) { + fee.assetAddress = i_linkAddress; + fee.amount = reward.amount; + } else { + uint256 surchargedFee = Math.ceilDiv(nativeQuantity * (PERCENTAGE_SCALAR + s_nativeSurcharge), PERCENTAGE_SCALAR); + + fee.assetAddress = i_nativeAddress; + fee.amount = Math.ceilDiv(surchargedFee * (PERCENTAGE_SCALAR - discount), PERCENTAGE_SCALAR); + } + + //return the fee + return (fee, reward, discount); + } + + /// @inheritdoc IDestinationVerifierFeeManager + function setFeeRecipients( + bytes32 configDigest, + Common.AddressAndWeight[] calldata rewardRecipientAndWeights + ) external onlyVerifier { + i_rewardManager.setRewardRecipients(configDigest, rewardRecipientAndWeights); + } + + /// @inheritdoc IDestinationFeeManager + function setNativeSurcharge(uint64 surcharge) external onlyOwner { + if (surcharge > PERCENTAGE_SCALAR) revert InvalidSurcharge(); + + s_nativeSurcharge = surcharge; + + emit NativeSurchargeUpdated(surcharge); + } + + /// @inheritdoc IDestinationFeeManager + function updateSubscriberDiscount( + address subscriber, + bytes32 feedId, + address token, + uint64 discount + ) external onlyOwner { + //make sure the discount is not greater than the total discount that can be applied + if (discount > PERCENTAGE_SCALAR) revert InvalidDiscount(); + //make sure the token is either LINK or native + if (token != i_linkAddress && token != i_nativeAddress) revert InvalidAddress(); + + s_subscriberDiscounts[subscriber][feedId][token] = discount; + + emit SubscriberDiscountUpdated(subscriber, feedId, token, discount); + } + + function updateSubscriberGlobalDiscount(address subscriber, address token, uint64 discount) external onlyOwner { + //make sure the discount is not greater than the total discount that can be applied + if (discount > PERCENTAGE_SCALAR) revert InvalidDiscount(); + //make sure the token is either LINK or native + if (token != i_linkAddress && token != i_nativeAddress) revert InvalidAddress(); + + s_globalDiscounts[subscriber][token] = discount; + + emit SubscriberDiscountUpdated(subscriber, bytes32(0), token, discount); + } + + /// @inheritdoc IDestinationFeeManager + function withdraw(address assetAddress, address recipient, uint192 quantity) external onlyOwner { + //address 0 is used to withdraw native in the context of withdrawing + if (assetAddress == address(0)) { + (bool success, ) = payable(recipient).call{value: quantity}(""); + + if (!success) revert InvalidReceivingAddress(); + return; + } + + //withdraw the requested asset + IERC20(assetAddress).safeTransfer(recipient, quantity); + + //emit event when funds are withdrawn + emit Withdraw(msg.sender, recipient, assetAddress, uint192(quantity)); + } + + /// @inheritdoc IDestinationFeeManager + function linkAvailableForPayment() external view returns (uint256) { + //return the amount of LINK this contact has available to pay rewards + return IERC20(i_linkAddress).balanceOf(address(this)); + } + + /** + * @notice Gets the current version of the report that is encoded as the last two bytes of the feed + * @param feedId feed id to get the report version for + */ + function _getReportVersion(bytes32 feedId) internal pure returns (bytes32) { + return REPORT_VERSION_MASK & feedId; + } + + function _calculateFee( + bytes calldata payload, + bytes calldata parameterPayload, + address subscriber + ) internal view returns (Common.Asset memory, Common.Asset memory, uint256) { + if (subscriber == address(this)) revert InvalidAddress(); + + //decode the report from the payload + (, bytes memory report) = abi.decode(payload, (bytes32[3], bytes)); + + //get the feedId from the report + bytes32 feedId = bytes32(report); + + //v1 doesn't need a quote payload, so skip the decoding + address quote; + if (_getReportVersion(feedId) != REPORT_V1) { + //decode the quote from the bytes + (quote) = abi.decode(parameterPayload, (address)); + } + + //decode the fee, it will always be native or LINK + return getFeeAndReward(subscriber, report, quote); + } + + function _handleFeesAndRewards( + address subscriber, + IDestinationFeeManager.FeeAndReward[] memory feesAndRewards, + uint256 numberOfLinkFees, + uint256 numberOfNativeFees + ) internal { + IDestinationRewardManager.FeePayment[] memory linkRewards = new IDestinationRewardManager.FeePayment[]( + numberOfLinkFees + ); + IDestinationRewardManager.FeePayment[] memory nativeFeeLinkRewards = new IDestinationRewardManager.FeePayment[]( + numberOfNativeFees + ); + + uint256 totalNativeFee; + uint256 totalNativeFeeLinkValue; + + uint256 linkRewardsIndex; + uint256 nativeFeeLinkRewardsIndex; + + uint256 totalNumberOfFees = numberOfLinkFees + numberOfNativeFees; + for (uint256 i; i < totalNumberOfFees; ++i) { + if (feesAndRewards[i].fee.assetAddress == i_linkAddress) { + linkRewards[linkRewardsIndex++] = IDestinationRewardManager.FeePayment( + feesAndRewards[i].configDigest, + uint192(feesAndRewards[i].reward.amount) + ); + } else { + nativeFeeLinkRewards[nativeFeeLinkRewardsIndex++] = IDestinationRewardManager.FeePayment( + feesAndRewards[i].configDigest, + uint192(feesAndRewards[i].reward.amount) + ); + totalNativeFee += feesAndRewards[i].fee.amount; + totalNativeFeeLinkValue += feesAndRewards[i].reward.amount; + } + + if (feesAndRewards[i].appliedDiscount != 0) { + emit DiscountApplied( + feesAndRewards[i].configDigest, + subscriber, + feesAndRewards[i].fee, + feesAndRewards[i].reward, + feesAndRewards[i].appliedDiscount + ); + } + } + + //keep track of change in case of any over payment + uint256 change; + + if (msg.value != 0) { + //there must be enough to cover the fee + if (totalNativeFee > msg.value) revert InvalidDeposit(); + + //wrap the amount required to pay the fee & approve as the subscriber paid in wrapped native + IWERC20(i_nativeAddress).deposit{value: totalNativeFee}(); + + unchecked { + //msg.value is always >= to fee.amount + change = msg.value - totalNativeFee; + } + } else { + if (totalNativeFee != 0) { + //subscriber has paid in wrapped native, so transfer the native to this contract + IERC20(i_nativeAddress).safeTransferFrom(subscriber, address(this), totalNativeFee); + } + } + + if (linkRewards.length != 0) { + i_rewardManager.onFeePaid(linkRewards, subscriber); + } + + if (nativeFeeLinkRewards.length != 0) { + //distribute subsidised fees paid in Native + if (totalNativeFeeLinkValue > IERC20(i_linkAddress).balanceOf(address(this))) { + // If not enough LINK on this contract to forward for rewards, tally the deficit to be paid by out-of-band LINK + for (uint256 i; i < nativeFeeLinkRewards.length; ++i) { + unchecked { + //we have previously tallied the fees, any overflows would have already reverted + s_linkDeficit[nativeFeeLinkRewards[i].poolId] += nativeFeeLinkRewards[i].amount; + } + } + + emit InsufficientLink(nativeFeeLinkRewards); + } else { + //distribute the fees + i_rewardManager.onFeePaid(nativeFeeLinkRewards, address(this)); + } + } + + // a refund may be needed if the payee has paid in excess of the fee + _tryReturnChange(subscriber, change); + } + + function _tryReturnChange(address subscriber, uint256 quantity) internal { + if (quantity != 0) { + payable(subscriber).transfer(quantity); + } + } + + /// @inheritdoc IDestinationFeeManager + function payLinkDeficit(bytes32 configDigest) external onlyOwner { + uint256 deficit = s_linkDeficit[configDigest]; + + if (deficit == 0) revert ZeroDeficit(); + + delete s_linkDeficit[configDigest]; + + IDestinationRewardManager.FeePayment[] memory deficitFeePayment = new IDestinationRewardManager.FeePayment[](1); + + deficitFeePayment[0] = IDestinationRewardManager.FeePayment(configDigest, uint192(deficit)); + + i_rewardManager.onFeePaid(deficitFeePayment, address(this)); + + emit LinkDeficitCleared(configDigest, deficit); + } + + /// @inheritdoc IDestinationFeeManager + function addVerifier(address verifierAddress) external onlyOwner { + if (verifierAddress == address(0)) revert InvalidAddress(); + //check doesn't already exist + if (s_verifierAddressList[verifierAddress] != address(0)) revert InvalidAddress(); + s_verifierAddressList[verifierAddress] = verifierAddress; + } + + /// @inheritdoc IDestinationFeeManager + function removeVerifier(address verifierAddress) external onlyOwner { + if (verifierAddress == address(0)) revert InvalidAddress(); + //check doesn't already exist + if (s_verifierAddressList[verifierAddress] == address(0)) revert InvalidAddress(); + delete s_verifierAddressList[verifierAddress]; + } + + /// @inheritdoc IDestinationFeeManager + function setRewardManager(address rewardManagerAddress) external onlyOwner { + if (rewardManagerAddress == address(0)) revert InvalidAddress(); + + if (!IERC165(rewardManagerAddress).supportsInterface(type(IDestinationRewardManager).interfaceId)) { + revert InvalidAddress(); + } + + IERC20(i_linkAddress).approve(address(i_rewardManager), 0); + i_rewardManager = IDestinationRewardManager(rewardManagerAddress); + IERC20(i_linkAddress).approve(address(rewardManagerAddress), type(uint256).max); + } +} diff --git a/contracts/src/v0.8/llo-feeds/v0.4.0/DestinationRewardManager.sol b/contracts/src/v0.8/llo-feeds/v0.4.0/DestinationRewardManager.sol new file mode 100644 index 00000000000..4b4c1f50efd --- /dev/null +++ b/contracts/src/v0.8/llo-feeds/v0.4.0/DestinationRewardManager.sol @@ -0,0 +1,328 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.19; + +import {ConfirmedOwner} from "../../shared/access/ConfirmedOwner.sol"; +import {IDestinationRewardManager} from "./interfaces/IDestinationRewardManager.sol"; +import {IERC20} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/interfaces/IERC20.sol"; +import {TypeAndVersionInterface} from "../../interfaces/TypeAndVersionInterface.sol"; +import {Common} from "../libraries/Common.sol"; +import {SafeERC20} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/utils/SafeERC20.sol"; + +/** + * @title DestinationRewardManager + * @author Michael Fletcher + * @author Austin Born + * @notice This contract will be used to reward any configured recipients within a pool. Recipients will receive a share of their pool relative to their configured weight. + */ +contract DestinationRewardManager is IDestinationRewardManager, ConfirmedOwner, TypeAndVersionInterface { + using SafeERC20 for IERC20; + + // @dev The mapping of total fees collected for a particular pot: s_totalRewardRecipientFees[poolId] + mapping(bytes32 => uint256) public s_totalRewardRecipientFees; + + // @dev The mapping of fee balances for each pot last time the recipient claimed: s_totalRewardRecipientFeesLastClaimedAmounts[poolId][recipient] + mapping(bytes32 => mapping(address => uint256)) public s_totalRewardRecipientFeesLastClaimedAmounts; + + // @dev The mapping of RewardRecipient weights for a particular poolId: s_rewardRecipientWeights[poolId][rewardRecipient]. + mapping(bytes32 => mapping(address => uint256)) public s_rewardRecipientWeights; + + // @dev Keep track of the reward recipient weights that have been set to prevent duplicates + mapping(bytes32 => bool) public s_rewardRecipientWeightsSet; + + // @dev Store a list of pool ids that have been registered, to make off chain lookups easier + bytes32[] public s_registeredPoolIds; + + // @dev The address for the LINK contract + address public immutable i_linkAddress; + + // The total weight of all RewardRecipients. 1e18 = 100% of the pool fees + uint64 private constant PERCENTAGE_SCALAR = 1e18; + + // The fee manager address + mapping(address => address) public s_feeManagerAddressList; + + // @notice Thrown whenever the RewardRecipient weights are invalid + error InvalidWeights(); + + // @notice Thrown when any given address is invalid + error InvalidAddress(); + + // @notice Thrown when the pool id is invalid + error InvalidPoolId(); + + // @notice Thrown when the calling contract is not within the authorized contracts + error Unauthorized(); + + // @notice Thrown when getAvailableRewardPoolIds parameters are incorrectly set + error InvalidPoolLength(); + + // Events emitted upon state change + event RewardRecipientsUpdated(bytes32 indexed poolId, Common.AddressAndWeight[] newRewardRecipients); + event RewardsClaimed(bytes32 indexed poolId, address indexed recipient, uint192 quantity); + event FeeManagerUpdated(address newFeeManagerAddress); + event FeePaid(FeePayment[] payments, address payer); + + /** + * @notice Constructor + * @param linkAddress address of the wrapped LINK token + */ + constructor(address linkAddress) ConfirmedOwner(msg.sender) { + //ensure that the address ia not zero + if (linkAddress == address(0)) revert InvalidAddress(); + + i_linkAddress = linkAddress; + } + + // @inheritdoc TypeAndVersionInterface + function typeAndVersion() external pure override returns (string memory) { + return "DestinationRewardManager 0.4.0"; + } + + // @inheritdoc IERC165 + function supportsInterface(bytes4 interfaceId) external pure override returns (bool) { + return interfaceId == type(IDestinationRewardManager).interfaceId; + } + + modifier onlyOwnerOrFeeManager() { + if (msg.sender != s_feeManagerAddressList[msg.sender] && msg.sender != owner()) revert Unauthorized(); + _; + } + + modifier onlyOwnerOrRecipientInPool(bytes32 poolId) { + if (s_rewardRecipientWeights[poolId][msg.sender] == 0 && msg.sender != owner()) revert Unauthorized(); + _; + } + + modifier onlyFeeManager() { + if (msg.sender != s_feeManagerAddressList[msg.sender]) revert Unauthorized(); + _; + } + + /// @inheritdoc IDestinationRewardManager + function onFeePaid(FeePayment[] calldata payments, address payer) external override onlyFeeManager { + uint256 totalFeeAmount; + for (uint256 i; i < payments.length; ++i) { + unchecked { + //the total amount for any ERC-20 asset cannot exceed 2^256 - 1 + //see https://github.com/OpenZeppelin/openzeppelin-contracts/blob/36bf1e46fa811f0f07d38eb9cfbc69a955f300ce/contracts/token/ERC20/ERC20.sol#L266 + //for example implementation. + s_totalRewardRecipientFees[payments[i].poolId] += payments[i].amount; + + //tally the total payable fees + totalFeeAmount += payments[i].amount; + } + } + + //transfer the fees to this contract + IERC20(i_linkAddress).safeTransferFrom(payer, address(this), totalFeeAmount); + + emit FeePaid(payments, payer); + } + + /// @inheritdoc IDestinationRewardManager + function claimRewards(bytes32[] memory poolIds) external override { + _claimRewards(msg.sender, poolIds); + } + + // wrapper impl for claimRewards + function _claimRewards(address recipient, bytes32[] memory poolIds) internal returns (uint256) { + //get the total amount claimable for this recipient + uint256 claimAmount; + + //loop and claim all the rewards in the poolId pot + for (uint256 i; i < poolIds.length; ++i) { + //get the poolId to be claimed + bytes32 poolId = poolIds[i]; + + //get the total fees for the pot + uint256 totalFeesInPot = s_totalRewardRecipientFees[poolId]; + + unchecked { + //avoid unnecessary storage reads if there's no fees in the pot + if (totalFeesInPot == 0) continue; + + //get the claimable amount for this recipient, this calculation will never exceed the amount in the pot + uint256 claimableAmount = totalFeesInPot - s_totalRewardRecipientFeesLastClaimedAmounts[poolId][recipient]; + + //calculate the recipients share of the fees, which is their weighted share of the difference between the last amount they claimed and the current amount in the pot. This can never be more than the total amount in existence + uint256 recipientShare = (claimableAmount * s_rewardRecipientWeights[poolId][recipient]) / PERCENTAGE_SCALAR; + + //if there's no fees to claim, continue as there's nothing to update + if (recipientShare == 0) continue; + + //keep track of the total amount claimable, this can never be more than the total amount in existence + claimAmount += recipientShare; + + //set the current total amount of fees in the pot as it's used to calculate future claims + s_totalRewardRecipientFeesLastClaimedAmounts[poolId][recipient] = totalFeesInPot; + + //emit event if the recipient has rewards to claim + emit RewardsClaimed(poolIds[i], recipient, uint192(recipientShare)); + } + } + + //check if there's any rewards to claim in the given poolId + if (claimAmount != 0) { + //transfer the reward to the recipient + IERC20(i_linkAddress).safeTransfer(recipient, claimAmount); + } + + return claimAmount; + } + + /// @inheritdoc IDestinationRewardManager + function setRewardRecipients( + bytes32 poolId, + Common.AddressAndWeight[] calldata rewardRecipientAndWeights + ) external override onlyOwnerOrFeeManager { + //revert if there are no recipients to set + if (rewardRecipientAndWeights.length == 0) revert InvalidAddress(); + + //check that the weights have not been previously set + if (s_rewardRecipientWeightsSet[poolId]) revert InvalidPoolId(); + + //keep track of the registered poolIds to make off chain lookups easier + s_registeredPoolIds.push(poolId); + + //keep track of which pools have had their reward recipients set + s_rewardRecipientWeightsSet[poolId] = true; + + //set the reward recipients, this will only be called once and contain the full set of RewardRecipients with a total weight of 100% + _setRewardRecipientWeights(poolId, rewardRecipientAndWeights, PERCENTAGE_SCALAR); + + emit RewardRecipientsUpdated(poolId, rewardRecipientAndWeights); + } + + function _setRewardRecipientWeights( + bytes32 poolId, + Common.AddressAndWeight[] calldata rewardRecipientAndWeights, + uint256 expectedWeight + ) internal { + //we can't update the weights if it contains duplicates + if (Common._hasDuplicateAddresses(rewardRecipientAndWeights)) revert InvalidAddress(); + + //loop all the reward recipients and validate the weight and address + uint256 totalWeight; + for (uint256 i; i < rewardRecipientAndWeights.length; ++i) { + //get the weight + uint256 recipientWeight = rewardRecipientAndWeights[i].weight; + //get the address + address recipientAddress = rewardRecipientAndWeights[i].addr; + + //ensure the reward recipient address is not zero + if (recipientAddress == address(0)) revert InvalidAddress(); + + //save/overwrite the weight for the reward recipient + s_rewardRecipientWeights[poolId][recipientAddress] = recipientWeight; + + unchecked { + //keep track of the cumulative weight, this cannot overflow as the total weight is restricted at 1e18 + totalWeight += recipientWeight; + } + } + + //if total weight is not met, the fees will either be under or over distributed + if (totalWeight != expectedWeight) revert InvalidWeights(); + } + + /// @inheritdoc IDestinationRewardManager + function updateRewardRecipients( + bytes32 poolId, + Common.AddressAndWeight[] calldata newRewardRecipients + ) external override onlyOwner { + //create an array of poolIds to pass to _claimRewards if required + bytes32[] memory poolIds = new bytes32[](1); + poolIds[0] = poolId; + + //loop all the reward recipients and claim their rewards before updating their weights + uint256 existingTotalWeight; + for (uint256 i; i < newRewardRecipients.length; ++i) { + //get the address + address recipientAddress = newRewardRecipients[i].addr; + //get the existing weight + uint256 existingWeight = s_rewardRecipientWeights[poolId][recipientAddress]; + + //if a recipient is updated, the rewards must be claimed first as they can't claim previous fees at the new weight + _claimRewards(newRewardRecipients[i].addr, poolIds); + + unchecked { + //keep tally of the weights so that the expected collective weight is known + existingTotalWeight += existingWeight; + } + } + + //update the reward recipients, if the new collective weight isn't equal to the previous collective weight, the fees will either be under or over distributed + _setRewardRecipientWeights(poolId, newRewardRecipients, existingTotalWeight); + + //emit event + emit RewardRecipientsUpdated(poolId, newRewardRecipients); + } + + /// @inheritdoc IDestinationRewardManager + function payRecipients(bytes32 poolId, address[] calldata recipients) external onlyOwnerOrRecipientInPool(poolId) { + //convert poolIds to an array to match the interface of _claimRewards + bytes32[] memory poolIdsArray = new bytes32[](1); + poolIdsArray[0] = poolId; + + //loop each recipient and claim the rewards for each of the pools and assets + for (uint256 i; i < recipients.length; ++i) { + _claimRewards(recipients[i], poolIdsArray); + } + } + + /// @inheritdoc IDestinationRewardManager + function addFeeManager(address newFeeManagerAddress) external onlyOwner { + if (newFeeManagerAddress == address(0)) revert InvalidAddress(); + if (s_feeManagerAddressList[newFeeManagerAddress] != address(0)) revert InvalidAddress(); + + s_feeManagerAddressList[newFeeManagerAddress] = newFeeManagerAddress; + + emit FeeManagerUpdated(newFeeManagerAddress); + } + + /// @inheritdoc IDestinationRewardManager + function removeFeeManager(address feeManagerAddress) external onlyOwner { + if (s_feeManagerAddressList[feeManagerAddress] == address(0)) revert InvalidAddress(); + delete s_feeManagerAddressList[feeManagerAddress]; + } + + /// @inheritdoc IDestinationRewardManager + function getAvailableRewardPoolIds( + address recipient, + uint256 startIndex, + uint256 endIndex + ) external view returns (bytes32[] memory) { + //get the length of the pool ids which we will loop through and potentially return + uint256 registeredPoolIdsLength = s_registeredPoolIds.length; + + uint256 lastIndex = endIndex > registeredPoolIdsLength ? registeredPoolIdsLength : endIndex; + + if (startIndex > lastIndex) revert InvalidPoolLength(); + + //create a new array with the maximum amount of potential pool ids + bytes32[] memory claimablePoolIds = new bytes32[](lastIndex - startIndex); + //we want the pools which a recipient has funds for to be sequential, so we need to keep track of the index + uint256 poolIdArrayIndex; + + //loop all the pool ids, and check if the recipient has a registered weight and a claimable amount + for (uint256 i = startIndex; i < lastIndex; ++i) { + //get the poolId + bytes32 poolId = s_registeredPoolIds[i]; + + //if the recipient has a weight, they are a recipient of this poolId + if (s_rewardRecipientWeights[poolId][recipient] != 0) { + //get the total in this pool + uint256 totalPoolAmount = s_totalRewardRecipientFees[poolId]; + //if the recipient has any LINK, then add the poolId to the array + unchecked { + //s_totalRewardRecipientFeesLastClaimedAmounts can never exceed total pool amount, and the number of pools can't exceed the max array length + if (totalPoolAmount - s_totalRewardRecipientFeesLastClaimedAmounts[poolId][recipient] != 0) { + claimablePoolIds[poolIdArrayIndex++] = poolId; + } + } + } + } + + return claimablePoolIds; + } +} diff --git a/contracts/src/v0.8/llo-feeds/v0.4.0/DestinationVerifier.sol b/contracts/src/v0.8/llo-feeds/v0.4.0/DestinationVerifier.sol new file mode 100644 index 00000000000..8ab0f6acc23 --- /dev/null +++ b/contracts/src/v0.8/llo-feeds/v0.4.0/DestinationVerifier.sol @@ -0,0 +1,443 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.19; + +import {ConfirmedOwner} from "../../shared/access/ConfirmedOwner.sol"; +import {IDestinationVerifier} from "./interfaces/IDestinationVerifier.sol"; +import {TypeAndVersionInterface} from "../../interfaces/TypeAndVersionInterface.sol"; +import {IERC165} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/interfaces/IERC165.sol"; +import {Common} from "../libraries/Common.sol"; +import {IAccessController} from "../../shared/interfaces/IAccessController.sol"; +import {IDestinationVerifierProxy} from "./interfaces/IDestinationVerifierProxy.sol"; +import {IDestinationVerifierProxyVerifier} from "./interfaces/IDestinationVerifierProxyVerifier.sol"; +import {IDestinationVerifierFeeManager} from "./interfaces/IDestinationVerifierFeeManager.sol"; + +// OCR2 standard +uint256 constant MAX_NUM_ORACLES = 31; + +/** + * @title DestinationVerifier + * @author Michael Fletcher + * @notice This contract will be used to verify reports based on the oracle signatures. This is not the source verifier which required individual fee configurations, instead, this checks that a report has been signed by one of the configured oracles. + */ +contract DestinationVerifier is + IDestinationVerifier, + IDestinationVerifierProxyVerifier, + ConfirmedOwner, + TypeAndVersionInterface +{ + /// @notice The list of DON configurations by hash(address|donConfigId) - set to true if the signer is part of the config + mapping(bytes32 => bool) private s_signerByAddressAndDonConfigId; + + /// array of DON configs + DonConfig[] private s_donConfigs; + + /// @notice The address of the verifierProxy + address public s_feeManager; + + /// @notice The address of the access controller + address public s_accessController; + + /// @notice The address of the verifierProxy + IDestinationVerifierProxy public immutable i_verifierProxy; + + /// @notice This error is thrown whenever trying to set a config + /// with a fault tolerance of 0 + error FaultToleranceMustBePositive(); + + /// @notice This error is thrown whenever a report is signed + /// with more than the max number of signers + /// @param numSigners The number of signers who have signed the report + /// @param maxSigners The maximum number of signers that can sign a report + error ExcessSigners(uint256 numSigners, uint256 maxSigners); + + /// @notice This error is thrown whenever a report is signed or expected to be signed with less than the minimum number of signers + /// @param numSigners The number of signers who have signed the report + /// @param minSigners The minimum number of signers that need to sign a report + error InsufficientSigners(uint256 numSigners, uint256 minSigners); + + /// @notice This error is thrown whenever a report is submitted with no signatures + error NoSigners(); + + /// @notice This error is thrown whenever a DonConfig already exists + /// @param donConfigId The ID of the DonConfig that already exists + error DonConfigAlreadyExists(bytes24 donConfigId); + + /// @notice This error is thrown whenever the R and S signer components + /// have different lengths + /// @param rsLength The number of r signature components + /// @param ssLength The number of s signature components + error MismatchedSignatures(uint256 rsLength, uint256 ssLength); + + /// @notice This error is thrown whenever setting a config with duplicate signatures + error NonUniqueSignatures(); + + /* @notice This error is thrown whenever a report fails to verify. This error be thrown for multiple reasons and it's purposely like + * this to prevent information being leaked about the verification process which could be used to enable free verifications maliciously + */ + error BadVerification(); + + /// @notice This error is thrown whenever a zero address is passed + error ZeroAddress(); + + /// @notice This error is thrown when the fee manager at an address does + /// not conform to the fee manager interface + error FeeManagerInvalid(); + + /// @notice This error is thrown whenever an address tries + /// to execute a verification that it is not authorized to do so + error AccessForbidden(); + + /// @notice This error is thrown whenever a config does not exist + error DonConfigDoesNotExist(); + + /// @notice This error is thrown when the activation time is either in the future or less than the current configs + error BadActivationTime(); + + /// @notice This event is emitted when a new report is verified. + /// It is used to keep a historical record of verified reports. + event ReportVerified(bytes32 indexed feedId, address requester); + + /// @notice This event is emitted whenever a configuration is activated or deactivated + event ConfigActivated(bytes24 donConfigId, bool isActive); + + /// @notice This event is emitted whenever a configuration is removed + event ConfigRemoved(bytes24 donConfigId); + + /// @notice event is emitted whenever a new DON Config is set + event ConfigSet( + bytes24 indexed donConfigId, + address[] signers, + uint8 f, + Common.AddressAndWeight[] recipientAddressesAndWeights, + uint16 donConfigIndex + ); + + /// @notice This event is emitted when a new fee manager is set + /// @param oldFeeManager The old fee manager address + /// @param newFeeManager The new fee manager address + event FeeManagerSet(address oldFeeManager, address newFeeManager); + + /// @notice This event is emitted when a new access controller is set + /// @param oldAccessController The old access controller address + /// @param newAccessController The new access controller address + event AccessControllerSet(address oldAccessController, address newAccessController); + + struct DonConfig { + // The ID of the DonConfig + bytes24 donConfigId; + // Fault tolerance of the DON + uint8 f; + // Whether the config is active + bool isActive; + // The time the config was set + uint32 activationTime; + } + + constructor(address verifierProxy) ConfirmedOwner(msg.sender) { + if (verifierProxy == address(0)) { + revert ZeroAddress(); + } + + i_verifierProxy = IDestinationVerifierProxy(verifierProxy); + } + + /// @inheritdoc IDestinationVerifierProxyVerifier + function verify( + bytes calldata signedReport, + bytes calldata parameterPayload, + address sender + ) external payable override onlyProxy checkAccess(sender) returns (bytes memory) { + (bytes memory verifierResponse, bytes32 donConfigId) = _verify(signedReport, sender); + + address fm = s_feeManager; + if (fm != address(0)) { + //process the fee and catch the error + try + IDestinationVerifierFeeManager(fm).processFee{value: msg.value}( + donConfigId, + signedReport, + parameterPayload, + sender + ) + { + //do nothing + } catch { + // we purposefully obfuscate the error here to prevent information leaking leading to free verifications + revert BadVerification(); + } + } + + return verifierResponse; + } + + /// @inheritdoc IDestinationVerifierProxyVerifier + function verifyBulk( + bytes[] calldata signedReports, + bytes calldata parameterPayload, + address sender + ) external payable override onlyProxy checkAccess(sender) returns (bytes[] memory) { + bytes[] memory verifierResponses = new bytes[](signedReports.length); + bytes32[] memory donConfigs = new bytes32[](signedReports.length); + + for (uint256 i; i < signedReports.length; ++i) { + (bytes memory report, bytes32 config) = _verify(signedReports[i], sender); + verifierResponses[i] = report; + donConfigs[i] = config; + } + + address fm = s_feeManager; + if (fm != address(0)) { + //process the fee and catch the error + try + IDestinationVerifierFeeManager(fm).processFeeBulk{value: msg.value}( + donConfigs, + signedReports, + parameterPayload, + sender + ) + { + //do nothing + } catch { + // we purposefully obfuscate the error here to prevent information leaking leading to free verifications + revert BadVerification(); + } + } + + return verifierResponses; + } + + function _verify(bytes calldata signedReport, address sender) internal returns (bytes memory, bytes32) { + ( + bytes32[3] memory reportContext, + bytes memory reportData, + bytes32[] memory rs, + bytes32[] memory ss, + bytes32 rawVs + ) = abi.decode(signedReport, (bytes32[3], bytes, bytes32[], bytes32[], bytes32)); + + // Signature lengths must match + if (rs.length != ss.length) revert MismatchedSignatures(rs.length, ss.length); + + //Must always be at least 1 signer + if (rs.length == 0) revert NoSigners(); + + // The payload is hashed and signed by the oracles - we need to recover the addresses + bytes32 signedPayload = keccak256(abi.encodePacked(keccak256(reportData), reportContext)); + address[] memory signers = new address[](rs.length); + for (uint256 i; i < rs.length; ++i) { + signers[i] = ecrecover(signedPayload, uint8(rawVs[i]) + 27, rs[i], ss[i]); + } + + // Duplicate signatures are not allowed + if (Common._hasDuplicateAddresses(signers)) { + revert BadVerification(); + } + + //We need to know the timestamp the report was generated to lookup the active activeDonConfig + uint256 reportTimestamp = _decodeReportTimestamp(reportData); + + // Find the latest config for this report + DonConfig memory activeDonConfig = _findActiveConfig(reportTimestamp); + + // Check a config has been set + if (activeDonConfig.donConfigId == bytes24(0)) { + revert BadVerification(); + } + + //check the config is active + if (!activeDonConfig.isActive) { + revert BadVerification(); + } + + //check we have enough signatures + if (signers.length <= activeDonConfig.f) { + revert BadVerification(); + } + + //check each signer is registered against the active DON + bytes32 signerDonConfigKey; + for (uint256 i; i < signers.length; ++i) { + signerDonConfigKey = keccak256(abi.encodePacked(signers[i], activeDonConfig.donConfigId)); + if (!s_signerByAddressAndDonConfigId[signerDonConfigKey]) { + revert BadVerification(); + } + } + + emit ReportVerified(bytes32(reportData), sender); + + return (reportData, activeDonConfig.donConfigId); + } + + /// @inheritdoc IDestinationVerifier + function setConfigWithActivationTime( + address[] memory signers, + uint8 f, + Common.AddressAndWeight[] memory recipientAddressesAndWeights, + uint32 activationTime + ) external override checkConfigValid(signers.length, f) onlyOwner { + _setConfig(signers, f, recipientAddressesAndWeights, activationTime); + } + + /// @inheritdoc IDestinationVerifier + function setConfig( + address[] memory signers, + uint8 f, + Common.AddressAndWeight[] memory recipientAddressesAndWeights + ) external override checkConfigValid(signers.length, f) onlyOwner { + _setConfig(signers, f, recipientAddressesAndWeights, uint32(block.timestamp)); + } + + function _setConfig( + address[] memory signers, + uint8 f, + Common.AddressAndWeight[] memory recipientAddressesAndWeights, + uint32 activationTime + ) internal { + // Duplicate addresses would break protocol rules + if (Common._hasDuplicateAddresses(signers)) { + revert NonUniqueSignatures(); + } + + //activation time cannot be in the future + if (activationTime > block.timestamp) { + revert BadActivationTime(); + } + + // Sort signers to ensure donConfigId is deterministic + Common._quickSort(signers, 0, int256(signers.length - 1)); + + //DonConfig is made up of hash(signers|f) + bytes24 donConfigId = bytes24(keccak256(abi.encodePacked(signers, f))); + + // Register the signers for this DON + for (uint256 i; i < signers.length; ++i) { + if (signers[i] == address(0)) revert ZeroAddress(); + /** This index is registered so we can efficiently lookup whether a NOP is part of a config without having to + loop through the entire config each verification. It's effectively a DonConfig <-> Signer + composite key which keys track of all historic configs for a signer */ + s_signerByAddressAndDonConfigId[keccak256(abi.encodePacked(signers[i], donConfigId))] = true; + } + + // Check the activation time is greater than the latest config + uint256 donConfigLength = s_donConfigs.length; + if (donConfigLength > 0 && s_donConfigs[donConfigLength - 1].activationTime >= activationTime) { + revert BadActivationTime(); + } + + // Check the config we're setting isn't already set as the current active config as this will increase search costs unnecessarily when verifying historic reports + if (donConfigLength > 0 && s_donConfigs[donConfigLength - 1].donConfigId == donConfigId) { + revert DonConfigAlreadyExists(donConfigId); + } + + // We may want to register these later or skip this step in the unlikely scenario they've previously been registered in the RewardsManager + if (recipientAddressesAndWeights.length != 0) { + if (s_feeManager == address(0)) { + revert FeeManagerInvalid(); + } + IDestinationVerifierFeeManager(s_feeManager).setFeeRecipients(donConfigId, recipientAddressesAndWeights); + } + + // push the DonConfig + s_donConfigs.push(DonConfig(donConfigId, f, true, activationTime)); + + emit ConfigSet(donConfigId, signers, f, recipientAddressesAndWeights, uint16(donConfigLength)); + } + + /// @inheritdoc IDestinationVerifier + function setFeeManager(address feeManager) external override onlyOwner { + if (!IERC165(feeManager).supportsInterface(type(IDestinationVerifierFeeManager).interfaceId)) + revert FeeManagerInvalid(); + + address oldFeeManager = s_feeManager; + s_feeManager = feeManager; + + emit FeeManagerSet(oldFeeManager, feeManager); + } + + /// @inheritdoc IDestinationVerifier + function setAccessController(address accessController) external override onlyOwner { + address oldAccessController = s_accessController; + s_accessController = accessController; + emit AccessControllerSet(oldAccessController, accessController); + } + + /// @inheritdoc IDestinationVerifier + function setConfigActive(uint256 donConfigIndex, bool isActive) external onlyOwner { + // Config must exist + if (donConfigIndex >= s_donConfigs.length) { + revert DonConfigDoesNotExist(); + } + + // Update the config + DonConfig storage config = s_donConfigs[donConfigIndex]; + config.isActive = isActive; + + emit ConfigActivated(config.donConfigId, isActive); + } + + /// @inheritdoc IDestinationVerifier + function removeLatestConfig() external onlyOwner { + if (s_donConfigs.length == 0) { + revert DonConfigDoesNotExist(); + } + + DonConfig memory config = s_donConfigs[s_donConfigs.length - 1]; + + s_donConfigs.pop(); + + emit ConfigRemoved(config.donConfigId); + } + + function _decodeReportTimestamp(bytes memory reportPayload) internal pure returns (uint256) { + (, , uint256 timestamp) = abi.decode(reportPayload, (bytes32, uint32, uint32)); + + return timestamp; + } + + function _findActiveConfig(uint256 timestamp) internal view returns (DonConfig memory) { + DonConfig memory activeDonConfig; + + // 99% of the time the signer config will be the last index, however for historic reports generated by a previous configuration we'll need to cycle back + uint256 i = s_donConfigs.length; + while (i > 0) { + --i; + if (s_donConfigs[i].activationTime <= timestamp) { + activeDonConfig = s_donConfigs[i]; + break; + } + } + return activeDonConfig; + } + + modifier checkConfigValid(uint256 numSigners, uint256 f) { + if (f == 0) revert FaultToleranceMustBePositive(); + if (numSigners > MAX_NUM_ORACLES) revert ExcessSigners(numSigners, MAX_NUM_ORACLES); + if (numSigners <= 3 * f) revert InsufficientSigners(numSigners, 3 * f + 1); + _; + } + + modifier onlyProxy() { + if (address(i_verifierProxy) != msg.sender) { + revert AccessForbidden(); + } + _; + } + + modifier checkAccess(address sender) { + address ac = s_accessController; + if (address(ac) != address(0) && !IAccessController(ac).hasAccess(sender, msg.data)) revert AccessForbidden(); + _; + } + + /// @inheritdoc IERC165 + function supportsInterface(bytes4 interfaceId) public pure override returns (bool) { + return + interfaceId == type(IDestinationVerifier).interfaceId || + interfaceId == type(IDestinationVerifierProxyVerifier).interfaceId; + } + + /// @inheritdoc TypeAndVersionInterface + function typeAndVersion() external pure override returns (string memory) { + return "DestinationVerifier 0.4.0"; + } +} diff --git a/contracts/src/v0.8/llo-feeds/v0.4.0/DestinationVerifierProxy.sol b/contracts/src/v0.8/llo-feeds/v0.4.0/DestinationVerifierProxy.sol new file mode 100644 index 00000000000..6790883ba31 --- /dev/null +++ b/contracts/src/v0.8/llo-feeds/v0.4.0/DestinationVerifierProxy.sol @@ -0,0 +1,70 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.19; + +import {ConfirmedOwner} from "../../shared/access/ConfirmedOwner.sol"; +import {TypeAndVersionInterface} from "../../interfaces/TypeAndVersionInterface.sol"; +import {IERC165} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/interfaces/IERC165.sol"; +import {IDestinationVerifierProxy} from "./interfaces/IDestinationVerifierProxy.sol"; +import {IDestinationVerifierProxyVerifier} from "./interfaces/IDestinationVerifierProxyVerifier.sol"; + +/** + * @title DestinationVerifierProxy + * @author Michael Fletcher + * @notice This contract will be used to route all requests through to the assigned verifier contract. This contract does not support individual feed configurations and is aimed at being a simple proxy for the verifier contract on any destination chain. + */ +contract DestinationVerifierProxy is IDestinationVerifierProxy, ConfirmedOwner, TypeAndVersionInterface { + /// @notice The active verifier for this proxy + IDestinationVerifierProxyVerifier private s_verifier; + + /// @notice This error is thrown whenever a zero address is passed + error ZeroAddress(); + + /// @notice This error is thrown when trying to set a verifier address that does not implement the expected interface + error VerifierInvalid(address verifierAddress); + + constructor() ConfirmedOwner(msg.sender) {} + + /// @inheritdoc TypeAndVersionInterface + function typeAndVersion() external pure override returns (string memory) { + return "DestinationVerifierProxy 0.4.0"; + } + + /// @inheritdoc IDestinationVerifierProxy + function verify(bytes calldata payload, bytes calldata parameterPayload) external payable returns (bytes memory) { + return s_verifier.verify{value: msg.value}(payload, parameterPayload, msg.sender); + } + + /// @inheritdoc IDestinationVerifierProxy + function verifyBulk( + bytes[] calldata payloads, + bytes calldata parameterPayload + ) external payable returns (bytes[] memory verifiedReports) { + return s_verifier.verifyBulk{value: msg.value}(payloads, parameterPayload, msg.sender); + } + + /// @inheritdoc IDestinationVerifierProxy + function setVerifier(address verifierAddress) external onlyOwner { + //check it supports the functions we need + if (!IERC165(verifierAddress).supportsInterface(type(IDestinationVerifierProxyVerifier).interfaceId)) + revert VerifierInvalid(verifierAddress); + + s_verifier = IDestinationVerifierProxyVerifier(verifierAddress); + } + + /// @inheritdoc IDestinationVerifierProxy + // solhint-disable-next-line func-name-mixedcase + function s_feeManager() external view override returns (address) { + return s_verifier.s_feeManager(); + } + + /// @inheritdoc IDestinationVerifierProxy + // solhint-disable-next-line func-name-mixedcase + function s_accessController() external view override returns (address) { + return s_verifier.s_accessController(); + } + + /// @inheritdoc IERC165 + function supportsInterface(bytes4 interfaceId) external pure override returns (bool) { + return interfaceId == type(IDestinationVerifierProxy).interfaceId; + } +} diff --git a/contracts/src/v0.8/llo-feeds/v0.4.0/interfaces/IDestinationFeeManager.sol b/contracts/src/v0.8/llo-feeds/v0.4.0/interfaces/IDestinationFeeManager.sol new file mode 100644 index 00000000000..00420a4edb7 --- /dev/null +++ b/contracts/src/v0.8/llo-feeds/v0.4.0/interfaces/IDestinationFeeManager.sol @@ -0,0 +1,103 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.19; + +import {IERC165} from "../../../vendor/openzeppelin-solidity/v4.8.3/contracts/interfaces/IERC165.sol"; +import {Common} from "../../libraries/Common.sol"; + +interface IDestinationFeeManager is IERC165 { + /** + * @notice Calculate the applied fee and the reward from a report. If the sender is a subscriber, they will receive a discount. + * @param subscriber address trying to verify + * @param report report to calculate the fee for + * @param quoteAddress address of the quote payment token + * @return (fee, reward, totalDiscount) fee and the reward data with the discount applied + */ + function getFeeAndReward( + address subscriber, + bytes memory report, + address quoteAddress + ) external returns (Common.Asset memory, Common.Asset memory, uint256); + + /** + * @notice Sets the native surcharge + * @param surcharge surcharge to be paid if paying in native + */ + function setNativeSurcharge(uint64 surcharge) external; + + /** + * @notice Adds a subscriber to the fee manager + * @param subscriber address of the subscriber + * @param feedId feed id to apply the discount to + * @param token token to apply the discount to + * @param discount discount to be applied to the fee + */ + function updateSubscriberDiscount(address subscriber, bytes32 feedId, address token, uint64 discount) external; + + /** + * @notice Adds a subscriber to the fee manager + * @param subscriber address of the subscriber + * @param token token to apply the discount to + * @param discount discount to be applied to the fee + */ + function updateSubscriberGlobalDiscount(address subscriber, address token, uint64 discount) external; + + /** + * @notice Withdraws any native or LINK rewards to the owner address + * @param assetAddress address of the asset to withdraw + * @param recipientAddress address to withdraw to + * @param quantity quantity to withdraw + */ + function withdraw(address assetAddress, address recipientAddress, uint192 quantity) external; + + /** + * @notice Returns the link balance of the fee manager + * @return link balance of the fee manager + */ + function linkAvailableForPayment() external returns (uint256); + + /** + * @notice Admin function to pay the LINK deficit for a given config digest + * @param configDigest the config digest to pay the deficit for + */ + function payLinkDeficit(bytes32 configDigest) external; + + /** + * @notice Adds the verifier to the list of verifiers able to use the feeManager + * @param verifier address of the verifier + */ + function addVerifier(address verifier) external; + + /** + * @notice Removes the verifier from the list of verifiers able to use the feeManager + * @param verifier address of the verifier + */ + function removeVerifier(address verifier) external; + + /** + * @notice Sets the reward manager to the address + * @param rewardManager address of the reward manager + */ + function setRewardManager(address rewardManager) external; + + /** + * @notice The structure to hold a fee and reward to verify a report + * @param digest the digest linked to the fee and reward + * @param fee the fee paid to verify the report + * @param reward the reward paid upon verification + & @param appliedDiscount the discount applied to the reward + */ + struct FeeAndReward { + bytes32 configDigest; + Common.Asset fee; + Common.Asset reward; + uint256 appliedDiscount; + } + + /** + * @notice The structure to hold quote metadata + * @param quoteAddress the address of the quote + */ + struct Quote { + address quoteAddress; + } +} diff --git a/contracts/src/v0.8/llo-feeds/v0.4.0/interfaces/IDestinationRewardManager.sol b/contracts/src/v0.8/llo-feeds/v0.4.0/interfaces/IDestinationRewardManager.sol new file mode 100644 index 00000000000..95f07937aec --- /dev/null +++ b/contracts/src/v0.8/llo-feeds/v0.4.0/interfaces/IDestinationRewardManager.sol @@ -0,0 +1,75 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.19; + +import {IERC165} from "../../../vendor/openzeppelin-solidity/v4.8.3/contracts/interfaces/IERC165.sol"; +import {Common} from "../../libraries/Common.sol"; + +interface IDestinationRewardManager is IERC165 { + /** + * @notice Record the fee received for a particular pool + * @param payments array of structs containing pool id and amount + * @param payee the user the funds should be retrieved from + */ + function onFeePaid(FeePayment[] calldata payments, address payee) external; + + /** + * @notice Claims the rewards in a specific pool + * @param poolIds array of poolIds to claim rewards for + */ + function claimRewards(bytes32[] calldata poolIds) external; + + /** + * @notice Set the RewardRecipients and weights for a specific pool. This should only be called once per pool Id. Else updateRewardRecipients should be used. + * @param poolId poolId to set RewardRecipients and weights for + * @param rewardRecipientAndWeights array of each RewardRecipient and associated weight + */ + function setRewardRecipients(bytes32 poolId, Common.AddressAndWeight[] calldata rewardRecipientAndWeights) external; + + /** + * @notice Updates a subset the reward recipients for a specific poolId. The collective weight of the recipients should add up to the recipients existing weights. Any recipients with a weight of 0 will be removed. + * @param poolId the poolId to update + * @param newRewardRecipients array of new reward recipients + */ + function updateRewardRecipients(bytes32 poolId, Common.AddressAndWeight[] calldata newRewardRecipients) external; + + /** + * @notice Pays all the recipients for each of the pool ids + * @param poolId the pool id to pay recipients for + * @param recipients array of recipients to pay within the pool + */ + function payRecipients(bytes32 poolId, address[] calldata recipients) external; + + /** + * @notice Add the fee manager to the list of feeManagers able to call the reward manager + * @param newFeeManager address of the new verifier proxy + */ + function addFeeManager(address newFeeManager) external; + + /** + * @notice Removes the fee manager. This needs to be done post construction to prevent a circular dependency. + * @param feeManager address of the verifier proxy to remove + */ + function removeFeeManager(address feeManager) external; + + /** + * @notice Gets a list of pool ids which have reward for a specific recipient. + * @param recipient address of the recipient to get pool ids for + * @param startIndex the index to start from + * @param endIndex the index to stop at + */ + function getAvailableRewardPoolIds( + address recipient, + uint256 startIndex, + uint256 endIndex + ) external view returns (bytes32[] memory); + + /** + * @notice The structure to hold a fee payment notice + * @param poolId the poolId receiving the payment + * @param amount the amount being paid + */ + struct FeePayment { + bytes32 poolId; + uint192 amount; + } +} diff --git a/contracts/src/v0.8/llo-feeds/v0.4.0/interfaces/IDestinationVerifier.sol b/contracts/src/v0.8/llo-feeds/v0.4.0/interfaces/IDestinationVerifier.sol new file mode 100644 index 00000000000..041a8c8f72c --- /dev/null +++ b/contracts/src/v0.8/llo-feeds/v0.4.0/interfaces/IDestinationVerifier.sol @@ -0,0 +1,57 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.19; + +import {Common} from "../../libraries/Common.sol"; +import {IERC165} from "../../../vendor/openzeppelin-solidity/v4.8.3/contracts/interfaces/IERC165.sol"; + +interface IDestinationVerifier is IERC165 { + /** + * @notice sets off-chain reporting protocol configuration incl. participating oracles + * @param signers addresses with which oracles sign the reports + * @param f number of faulty oracles the system can tolerate + * @param recipientAddressesAndWeights the addresses and weights of all the recipients to receive rewards + */ + function setConfig( + address[] memory signers, + uint8 f, + Common.AddressAndWeight[] memory recipientAddressesAndWeights + ) external; + + /** + * @notice sets off-chain reporting protocol configuration incl. participating oracles + * @param signers addresses with which oracles sign the reports + * @param f number of faulty oracles the system can tolerate + * @param recipientAddressesAndWeights the addresses and weights of all the recipients to receive rewards + * @param activationTime the time at which the config was activated + */ + function setConfigWithActivationTime( + address[] memory signers, + uint8 f, + Common.AddressAndWeight[] memory recipientAddressesAndWeights, + uint32 activationTime + ) external; + + /** + * @notice Sets the fee manager address + * @param feeManager The address of the fee manager + */ + function setFeeManager(address feeManager) external; + + /** + * @notice Sets the access controller address + * @param accessController The address of the access controller + */ + function setAccessController(address accessController) external; + + /** + * @notice Updates the config active status + * @param donConfigId The ID of the config to update + * @param isActive The new config active status + */ + function setConfigActive(uint256 donConfigId, bool isActive) external; + + /** + * @notice Removes the latest config + */ + function removeLatestConfig() external; +} diff --git a/contracts/src/v0.8/llo-feeds/v0.4.0/interfaces/IDestinationVerifierFeeManager.sol b/contracts/src/v0.8/llo-feeds/v0.4.0/interfaces/IDestinationVerifierFeeManager.sol new file mode 100644 index 00000000000..291f3706b3e --- /dev/null +++ b/contracts/src/v0.8/llo-feeds/v0.4.0/interfaces/IDestinationVerifierFeeManager.sol @@ -0,0 +1,45 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.19; + +import {IERC165} from "../../../vendor/openzeppelin-solidity/v4.8.3/contracts/interfaces/IERC165.sol"; +import {Common} from "../../libraries/Common.sol"; + +interface IDestinationVerifierFeeManager is IERC165 { + /** + * @notice Handles fees for a report from the subscriber and manages rewards + * @param poolId pool id of the pool to pay into + * @param payload report to process the fee for + * @param parameterPayload fee payload + * @param subscriber address of the fee will be applied + */ + function processFee( + bytes32 poolId, + bytes calldata payload, + bytes calldata parameterPayload, + address subscriber + ) external payable; + + /** + * @notice Processes the fees for each report in the payload, billing the subscriber and paying the reward manager + * @param poolIds pool ids of the pool to pay into + * @param payloads reports to process + * @param parameterPayload fee payload + * @param subscriber address of the user to process fee for + */ + function processFeeBulk( + bytes32[] memory poolIds, + bytes[] calldata payloads, + bytes calldata parameterPayload, + address subscriber + ) external payable; + + /** + * @notice Sets the fee recipients according to the fee manager + * @param configDigest digest of the configuration + * @param rewardRecipientAndWeights the address and weights of all the recipients to receive rewards + */ + function setFeeRecipients( + bytes32 configDigest, + Common.AddressAndWeight[] calldata rewardRecipientAndWeights + ) external; +} diff --git a/contracts/src/v0.8/llo-feeds/v0.4.0/interfaces/IDestinationVerifierProxy.sol b/contracts/src/v0.8/llo-feeds/v0.4.0/interfaces/IDestinationVerifierProxy.sol new file mode 100644 index 00000000000..e0dcb30d541 --- /dev/null +++ b/contracts/src/v0.8/llo-feeds/v0.4.0/interfaces/IDestinationVerifierProxy.sol @@ -0,0 +1,52 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.19; + +import {IERC165} from "../../../vendor/openzeppelin-solidity/v4.8.3/contracts/interfaces/IERC165.sol"; + +interface IDestinationVerifierProxy is IERC165 { + /** + * @notice Verifies that the data encoded has been signed + * correctly by routing to the verifier, and bills the user if applicable. + * @param payload The encoded data to be verified, including the signed + * report. + * @param parameterPayload fee metadata for billing + * @return verifierResponse The encoded report from the verifier. + */ + function verify( + bytes calldata payload, + bytes calldata parameterPayload + ) external payable returns (bytes memory verifierResponse); + + /** + * @notice Bulk verifies that the data encoded has been signed + * correctly by routing to the correct verifier, and bills the user if applicable. + * @param payloads The encoded payloads to be verified, including the signed + * report. + * @param parameterPayload fee metadata for billing + * @return verifiedReports The encoded reports from the verifier. + */ + function verifyBulk( + bytes[] calldata payloads, + bytes calldata parameterPayload + ) external payable returns (bytes[] memory verifiedReports); + + /** + * @notice Sets the active verifier for this proxy + * @param verifierAddress The address of the verifier contract + */ + function setVerifier(address verifierAddress) external; + + /** + * @notice Used to honor the source verifierProxy feeManager interface + * @return IVerifierFeeManager + */ + // solhint-disable-next-line func-name-mixedcase + function s_feeManager() external view returns (address); + + /** + * @notice Used to honor the source verifierProxy feeManager interface + * @return AccessControllerInterface + */ + // solhint-disable-next-line func-name-mixedcase + function s_accessController() external view returns (address); +} diff --git a/contracts/src/v0.8/llo-feeds/v0.4.0/interfaces/IDestinationVerifierProxyVerifier.sol b/contracts/src/v0.8/llo-feeds/v0.4.0/interfaces/IDestinationVerifierProxyVerifier.sol new file mode 100644 index 00000000000..a957f8f928d --- /dev/null +++ b/contracts/src/v0.8/llo-feeds/v0.4.0/interfaces/IDestinationVerifierProxyVerifier.sol @@ -0,0 +1,48 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.19; + +import {IERC165} from "../../../vendor/openzeppelin-solidity/v4.8.3/contracts/interfaces/IERC165.sol"; + +interface IDestinationVerifierProxyVerifier is IERC165 { + /** + * @notice Verifies that the data encoded has been signed correctly using the signatures included within the payload. + * @param signedReport The encoded data to be verified. + * @param parameterPayload The encoded parameters to be used in the verification and billing process. + * @param sender The address that requested to verify the contract.Used for logging and applying the fee. + * @dev Verification is typically only done through the proxy contract so we can't just use msg.sender. + * @return verifierResponse The encoded verified response. + */ + function verify( + bytes calldata signedReport, + bytes calldata parameterPayload, + address sender + ) external payable returns (bytes memory verifierResponse); + + /** + * @notice Bulk verifies that the data encoded has been signed correctly using the signatures included within the payload. + * @param signedReports The encoded data to be verified. + * @param parameterPayload The encoded parameters to be used in the verification and billing process. + * @param sender The address that requested to verify the contract. Used for logging and applying the fee. + * @dev Verification is typically only done through the proxy contract so we can't just use msg.sender. + * @return verifiedReports The encoded verified responses. + */ + function verifyBulk( + bytes[] calldata signedReports, + bytes calldata parameterPayload, + address sender + ) external payable returns (bytes[] memory verifiedReports); + + /* + * @notice Returns the reward manager + * @return IDestinationRewardManager + */ + // solhint-disable-next-line func-name-mixedcase + function s_feeManager() external view returns (address); + + /** + * @notice Returns the access controller + * @return IDestinationFeeManager + */ + // solhint-disable-next-line func-name-mixedcase + function s_accessController() external view returns (address); +} diff --git a/contracts/src/v0.8/llo-feeds/v0.4.0/test/fee-manager/BaseDestinationFeeManager.t.sol b/contracts/src/v0.8/llo-feeds/v0.4.0/test/fee-manager/BaseDestinationFeeManager.t.sol new file mode 100644 index 00000000000..38b1bad2171 --- /dev/null +++ b/contracts/src/v0.8/llo-feeds/v0.4.0/test/fee-manager/BaseDestinationFeeManager.t.sol @@ -0,0 +1,406 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity 0.8.19; + +import {Test} from "forge-std/Test.sol"; +import {DestinationFeeManager} from "../../DestinationFeeManager.sol"; +import {DestinationRewardManager} from "../../DestinationRewardManager.sol"; +import {Common} from "../../../libraries/Common.sol"; +import {ERC20Mock} from "../../../../vendor/openzeppelin-solidity/v4.8.3/contracts/mocks/ERC20Mock.sol"; +import {WERC20Mock} from "../../../../shared/mocks/WERC20Mock.sol"; +import {IDestinationRewardManager} from "../../interfaces/IDestinationRewardManager.sol"; +import {DestinationFeeManagerProxy} from "../mocks/DestinationFeeManagerProxy.sol"; + +/** + * @title BaseDestinationFeeManagerTest + * @author Michael Fletcher + * @notice Base class for all feeManager tests + * @dev This contract is intended to be inherited from and not used directly. It contains functionality to setup the feeManager + */ +contract BaseDestinationFeeManagerTest is Test { + //contracts + DestinationFeeManager internal feeManager; + DestinationRewardManager internal rewardManager; + DestinationFeeManagerProxy internal feeManagerProxy; + + ERC20Mock internal link; + WERC20Mock internal native; + + //erc20 config + uint256 internal constant DEFAULT_LINK_MINT_QUANTITY = 100 ether; + uint256 internal constant DEFAULT_NATIVE_MINT_QUANTITY = 100 ether; + + //contract owner + address internal constant INVALID_ADDRESS = address(0); + address internal constant ADMIN = address(uint160(uint256(keccak256("ADMIN")))); + address internal constant USER = address(uint160(uint256(keccak256("USER")))); + address internal constant PROXY = address(uint160(uint256(keccak256("PROXY")))); + + //version masks + bytes32 internal constant V_MASK = 0x0000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff; + bytes32 internal constant V1_BITMASK = 0x0001000000000000000000000000000000000000000000000000000000000000; + bytes32 internal constant V2_BITMASK = 0x0002000000000000000000000000000000000000000000000000000000000000; + bytes32 internal constant V3_BITMASK = 0x0003000000000000000000000000000000000000000000000000000000000000; + + //feed ids & config digests + bytes32 internal constant DEFAULT_FEED_1_V1 = (keccak256("ETH-USD") & V_MASK) | V1_BITMASK; + bytes32 internal constant DEFAULT_FEED_1_V2 = (keccak256("ETH-USD") & V_MASK) | V2_BITMASK; + bytes32 internal constant DEFAULT_FEED_1_V3 = (keccak256("ETH-USD") & V_MASK) | V3_BITMASK; + + bytes32 internal constant DEFAULT_FEED_2_V3 = (keccak256("LINK-USD") & V_MASK) | V3_BITMASK; + bytes32 internal constant DEFAULT_CONFIG_DIGEST = keccak256("DEFAULT_CONFIG_DIGEST"); + bytes32 internal constant DEFAULT_CONFIG_DIGEST2 = keccak256("DEFAULT_CONFIG_DIGEST2"); + + //report + uint256 internal constant DEFAULT_REPORT_LINK_FEE = 1e10; + uint256 internal constant DEFAULT_REPORT_NATIVE_FEE = 1e12; + + //rewards + uint64 internal constant FEE_SCALAR = 1e18; + + address internal constant NATIVE_WITHDRAW_ADDRESS = address(0); + + //the selector for each error + bytes4 internal immutable INVALID_DISCOUNT_ERROR = DestinationFeeManager.InvalidDiscount.selector; + bytes4 internal immutable INVALID_ADDRESS_ERROR = DestinationFeeManager.InvalidAddress.selector; + bytes4 internal immutable INVALID_SURCHARGE_ERROR = DestinationFeeManager.InvalidSurcharge.selector; + bytes4 internal immutable EXPIRED_REPORT_ERROR = DestinationFeeManager.ExpiredReport.selector; + bytes4 internal immutable INVALID_DEPOSIT_ERROR = DestinationFeeManager.InvalidDeposit.selector; + bytes4 internal immutable INVALID_QUOTE_ERROR = DestinationFeeManager.InvalidQuote.selector; + bytes4 internal immutable UNAUTHORIZED_ERROR = DestinationFeeManager.Unauthorized.selector; + bytes4 internal immutable POOLID_MISMATCH_ERROR = DestinationFeeManager.PoolIdMismatch.selector; + bytes internal constant ONLY_CALLABLE_BY_OWNER_ERROR = "Only callable by owner"; + bytes internal constant INSUFFICIENT_ALLOWANCE_ERROR = "ERC20: insufficient allowance"; + bytes4 internal immutable ZERO_DEFICIT = DestinationFeeManager.ZeroDeficit.selector; + + //events emitted + event SubscriberDiscountUpdated(address indexed subscriber, bytes32 indexed feedId, address token, uint64 discount); + event NativeSurchargeUpdated(uint64 newSurcharge); + event InsufficientLink(IDestinationRewardManager.FeePayment[] feesAndRewards); + event Withdraw(address adminAddress, address recipient, address assetAddress, uint192 quantity); + event LinkDeficitCleared(bytes32 indexed configDigest, uint256 linkQuantity); + event DiscountApplied( + bytes32 indexed configDigest, + address indexed subscriber, + Common.Asset fee, + Common.Asset reward, + uint256 appliedDiscountQuantity + ); + + function setUp() public virtual { + //change to admin user + vm.startPrank(ADMIN); + + //init required contracts + _initializeContracts(); + } + + function _initializeContracts() internal { + link = new ERC20Mock("LINK", "LINK", ADMIN, 0); + native = new WERC20Mock(); + + feeManagerProxy = new DestinationFeeManagerProxy(); + rewardManager = new DestinationRewardManager(address(link)); + feeManager = new DestinationFeeManager( + address(link), + address(native), + address(feeManagerProxy), + address(rewardManager) + ); + + //link the feeManager to the proxy + feeManagerProxy.setDestinationFeeManager(address(feeManager)); + + //link the feeManager to the reward manager + rewardManager.addFeeManager(address(feeManager)); + + //mint some tokens to the admin + link.mint(ADMIN, DEFAULT_LINK_MINT_QUANTITY); + native.mint(ADMIN, DEFAULT_NATIVE_MINT_QUANTITY); + vm.deal(ADMIN, DEFAULT_NATIVE_MINT_QUANTITY); + + //mint some tokens to the user + link.mint(USER, DEFAULT_LINK_MINT_QUANTITY); + native.mint(USER, DEFAULT_NATIVE_MINT_QUANTITY); + vm.deal(USER, DEFAULT_NATIVE_MINT_QUANTITY); + + //mint some tokens to the proxy + link.mint(PROXY, DEFAULT_LINK_MINT_QUANTITY); + native.mint(PROXY, DEFAULT_NATIVE_MINT_QUANTITY); + vm.deal(PROXY, DEFAULT_NATIVE_MINT_QUANTITY); + } + + function setSubscriberDiscount( + address subscriber, + bytes32 feedId, + address token, + uint256 discount, + address sender + ) internal { + //record the current address and switch to the recipient + address originalAddr = msg.sender; + changePrank(sender); + + //set the discount + feeManager.updateSubscriberDiscount(subscriber, feedId, token, uint64(discount)); + + //change back to the original address + changePrank(originalAddr); + } + + function setSubscriberGlobalDiscount(address subscriber, address token, uint256 discount, address sender) public { + //record the current address and switch to the recipient + address originalAddr = msg.sender; + changePrank(sender); + + //set the discount + feeManager.updateSubscriberGlobalDiscount(subscriber, token, uint64(discount)); + + //change back to the original address + changePrank(originalAddr); + } + + function setNativeSurcharge(uint256 surcharge, address sender) public { + //record the current address and switch to the recipient + address originalAddr = msg.sender; + changePrank(sender); + + //set the surcharge + feeManager.setNativeSurcharge(uint64(surcharge)); + + //change back to the original address + changePrank(originalAddr); + } + + // solium-disable-next-line no-unused-vars + function getFee(bytes memory report, address quote, address subscriber) public view returns (Common.Asset memory) { + //get the fee + (Common.Asset memory fee, , ) = feeManager.getFeeAndReward(subscriber, report, quote); + + return fee; + } + + function getReward(bytes memory report, address quote, address subscriber) public view returns (Common.Asset memory) { + //get the reward + (, Common.Asset memory reward, ) = feeManager.getFeeAndReward(subscriber, report, quote); + + return reward; + } + + function getAppliedDiscount(bytes memory report, address quote, address subscriber) public view returns (uint256) { + //get the reward + (, , uint256 appliedDiscount) = feeManager.getFeeAndReward(subscriber, report, quote); + + return appliedDiscount; + } + + function getV1Report(bytes32 feedId) public pure returns (bytes memory) { + return abi.encode(feedId, uint32(0), int192(0), int192(0), int192(0), uint64(0), bytes32(0), uint64(0), uint64(0)); + } + + function getV2Report(bytes32 feedId) public view returns (bytes memory) { + return + abi.encode( + feedId, + uint32(0), + uint32(0), + uint192(DEFAULT_REPORT_NATIVE_FEE), + uint192(DEFAULT_REPORT_LINK_FEE), + uint32(block.timestamp), + int192(0) + ); + } + + function getV3Report(bytes32 feedId) public view returns (bytes memory) { + return + abi.encode( + feedId, + uint32(0), + uint32(0), + uint192(DEFAULT_REPORT_NATIVE_FEE), + uint192(DEFAULT_REPORT_LINK_FEE), + uint32(block.timestamp), + int192(0), + int192(0), + int192(0) + ); + } + + function getV3ReportWithCustomExpiryAndFee( + bytes32 feedId, + uint256 expiry, + uint256 linkFee, + uint256 nativeFee + ) public pure returns (bytes memory) { + return + abi.encode( + feedId, + uint32(0), + uint32(0), + uint192(nativeFee), + uint192(linkFee), + uint32(expiry), + int192(0), + int192(0), + int192(0) + ); + } + + function getLinkQuote() public view returns (address) { + return address(link); + } + + function getNativeQuote() public view returns (address) { + return address(native); + } + + function withdraw(address assetAddress, address recipient, uint256 amount, address sender) public { + //record the current address and switch to the recipient + address originalAddr = msg.sender; + changePrank(sender); + + //set the surcharge + feeManager.withdraw(assetAddress, recipient, uint192(amount)); + + //change back to the original address + changePrank(originalAddr); + } + + function getLinkBalance(address balanceAddress) public view returns (uint256) { + return link.balanceOf(balanceAddress); + } + + function getNativeBalance(address balanceAddress) public view returns (uint256) { + return native.balanceOf(balanceAddress); + } + + function getNativeUnwrappedBalance(address balanceAddress) public view returns (uint256) { + return balanceAddress.balance; + } + + function mintLink(address recipient, uint256 amount) public { + //record the current address and switch to the recipient + address originalAddr = msg.sender; + changePrank(ADMIN); + + //mint the link to the recipient + link.mint(recipient, amount); + + //change back to the original address + changePrank(originalAddr); + } + + function mintNative(address recipient, uint256 amount, address sender) public { + //record the current address and switch to the recipient + address originalAddr = msg.sender; + changePrank(sender); + + //mint the native to the recipient + native.mint(recipient, amount); + + //change back to the original address + changePrank(originalAddr); + } + + function issueUnwrappedNative(address recipient, uint256 quantity) public { + vm.deal(recipient, quantity); + } + + function ProcessFeeAsUser( + bytes32 poolId, + bytes memory payload, + address subscriber, + address tokenAddress, + uint256 wrappedNativeValue, + address sender + ) public { + //record the current address and switch to the recipient + address originalAddr = msg.sender; + changePrank(sender); + + //process the fee + feeManager.processFee{value: wrappedNativeValue}(poolId, payload, abi.encode(tokenAddress), subscriber); + + //change ProcessFeeAsUserback to the original address + changePrank(originalAddr); + } + + function processFee( + bytes32 poolId, + bytes memory payload, + address subscriber, + address feeAddress, + uint256 wrappedNativeValue + ) public { + //record the current address and switch to the recipient + address originalAddr = msg.sender; + changePrank(subscriber); + + //process the fee + feeManagerProxy.processFee{value: wrappedNativeValue}(poolId, payload, abi.encode(feeAddress)); + + //change back to the original address + changePrank(originalAddr); + } + + function processFee( + bytes32[] memory poolIds, + bytes[] memory payloads, + address subscriber, + address feeAddress, + uint256 wrappedNativeValue + ) public { + //record the current address and switch to the recipient + address originalAddr = msg.sender; + changePrank(subscriber); + + //process the fee + feeManagerProxy.processFeeBulk{value: wrappedNativeValue}(poolIds, payloads, abi.encode(feeAddress)); + + //change back to the original address + changePrank(originalAddr); + } + + function getPayload(bytes memory reportPayload) public pure returns (bytes memory) { + return abi.encode([DEFAULT_CONFIG_DIGEST, 0, 0], reportPayload, new bytes32[](1), new bytes32[](1), bytes32("")); + } + + function approveLink(address spender, uint256 quantity, address sender) public { + //record the current address and switch to the recipient + address originalAddr = msg.sender; + changePrank(sender); + + //approve the link to be transferred + link.approve(spender, quantity); + + //change back to the original address + changePrank(originalAddr); + } + + function approveNative(address spender, uint256 quantity, address sender) public { + //record the current address and switch to the recipient + address originalAddr = msg.sender; + changePrank(sender); + + //approve the link to be transferred + native.approve(spender, quantity); + + //change back to the original address + changePrank(originalAddr); + } + + function payLinkDeficit(bytes32 configDigest, address sender) public { + //record the current address and switch to the recipient + address originalAddr = msg.sender; + changePrank(sender); + + //approve the link to be transferred + feeManager.payLinkDeficit(configDigest); + + //change back to the original address + changePrank(originalAddr); + } + + function getLinkDeficit(bytes32 configDigest) public view returns (uint256) { + return feeManager.s_linkDeficit(configDigest); + } +} diff --git a/contracts/src/v0.8/llo-feeds/v0.4.0/test/fee-manager/DestinationFeeManager.general.t.sol b/contracts/src/v0.8/llo-feeds/v0.4.0/test/fee-manager/DestinationFeeManager.general.t.sol new file mode 100644 index 00000000000..305125c3329 --- /dev/null +++ b/contracts/src/v0.8/llo-feeds/v0.4.0/test/fee-manager/DestinationFeeManager.general.t.sol @@ -0,0 +1,299 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity 0.8.19; + +import "./BaseDestinationFeeManager.t.sol"; + +/** + * @title BaseDestinationFeeManagerTest + * @author Michael Fletcher + * @notice This contract will test the setup functionality of the feemanager + */ +contract DestinationFeeManagerProcessFeeTest is BaseDestinationFeeManagerTest { + function setUp() public override { + super.setUp(); + } + + function test_WithdrawERC20() public { + //simulate a fee + mintLink(address(feeManager), DEFAULT_LINK_MINT_QUANTITY); + + //get the balances to ne used for comparison + uint256 contractBalance = getLinkBalance(address(feeManager)); + uint256 adminBalance = getLinkBalance(ADMIN); + + //the amount to withdraw + uint256 withdrawAmount = contractBalance / 2; + + //withdraw some balance + withdraw(address(link), ADMIN, withdrawAmount, ADMIN); + + //check the balance has been reduced + uint256 newContractBalance = getLinkBalance(address(feeManager)); + uint256 newAdminBalance = getLinkBalance(ADMIN); + + //check the balance is greater than zero + assertGt(newContractBalance, 0); + //check the balance has been reduced by the correct amount + assertEq(newContractBalance, contractBalance - withdrawAmount); + //check the admin balance has increased by the correct amount + assertEq(newAdminBalance, adminBalance + withdrawAmount); + } + + function test_WithdrawUnwrappedNative() public { + //issue funds straight to the contract to bypass the lack of fallback function + issueUnwrappedNative(address(feeManager), DEFAULT_NATIVE_MINT_QUANTITY); + + //get the balances to be used for comparison + uint256 contractBalance = getNativeUnwrappedBalance(address(feeManager)); + uint256 adminBalance = getNativeUnwrappedBalance(ADMIN); + + //the amount to withdraw + uint256 withdrawAmount = contractBalance / 2; + + //withdraw some balance + withdraw(NATIVE_WITHDRAW_ADDRESS, ADMIN, withdrawAmount, ADMIN); + + //check the balance has been reduced + uint256 newContractBalance = getNativeUnwrappedBalance(address(feeManager)); + uint256 newAdminBalance = getNativeUnwrappedBalance(ADMIN); + + //check the balance is greater than zero + assertGt(newContractBalance, 0); + //check the balance has been reduced by the correct amount + assertEq(newContractBalance, contractBalance - withdrawAmount); + //check the admin balance has increased by the correct amount + assertEq(newAdminBalance, adminBalance + withdrawAmount); + } + + function test_WithdrawNonAdminAddr() public { + //simulate a fee + mintLink(address(feeManager), DEFAULT_LINK_MINT_QUANTITY); + + //should revert if not admin + vm.expectRevert(ONLY_CALLABLE_BY_OWNER_ERROR); + + //withdraw some balance + withdraw(address(link), ADMIN, DEFAULT_LINK_MINT_QUANTITY, USER); + } + + function test_eventIsEmittedAfterSurchargeIsSet() public { + //native surcharge + uint64 nativeSurcharge = FEE_SCALAR / 5; + + //expect an emit + vm.expectEmit(); + + //emit the event that is expected to be emitted + emit NativeSurchargeUpdated(nativeSurcharge); + + //set the surcharge + setNativeSurcharge(nativeSurcharge, ADMIN); + } + + function test_subscriberDiscountEventIsEmittedOnUpdate() public { + //native surcharge + uint64 discount = FEE_SCALAR / 3; + + //an event should be emitted + vm.expectEmit(); + + //emit the event that is expected to be emitted + emit SubscriberDiscountUpdated(USER, DEFAULT_FEED_1_V3, address(native), discount); + + //set the surcharge + setSubscriberDiscount(USER, DEFAULT_FEED_1_V3, address(native), discount, ADMIN); + } + + function test_eventIsEmittedUponWithdraw() public { + //simulate a fee + mintLink(address(feeManager), DEFAULT_LINK_MINT_QUANTITY); + + //the amount to withdraw + uint192 withdrawAmount = 1; + + //expect an emit + vm.expectEmit(); + + //the event to be emitted + emit Withdraw(ADMIN, ADMIN, address(link), withdrawAmount); + + //withdraw some balance + withdraw(address(link), ADMIN, withdrawAmount, ADMIN); + } + + function test_linkAvailableForPaymentReturnsLinkBalance() public { + //simulate a deposit of link for the conversion pool + mintLink(address(feeManager), DEFAULT_REPORT_LINK_FEE); + + //check there's a balance + assertGt(getLinkBalance(address(feeManager)), 0); + + //check the link available for payment is the link balance + assertEq(feeManager.linkAvailableForPayment(), getLinkBalance(address(feeManager))); + } + + function test_payLinkDeficit() public { + //get the default payload + bytes memory payload = getPayload(getV2Report(DEFAULT_FEED_1_V3)); + + approveNative(address(feeManager), DEFAULT_REPORT_NATIVE_FEE, USER); + + //not enough funds in the reward pool should trigger an insufficient link event + vm.expectEmit(); + + IDestinationRewardManager.FeePayment[] memory contractFees = new IDestinationRewardManager.FeePayment[](1); + contractFees[0] = IDestinationRewardManager.FeePayment(DEFAULT_CONFIG_DIGEST, uint192(DEFAULT_REPORT_LINK_FEE)); + + emit InsufficientLink(contractFees); + + //process the fee + processFee(contractFees[0].poolId, payload, USER, address(native), 0); + + //double check the rewardManager balance is 0 + assertEq(getLinkBalance(address(rewardManager)), 0); + + //simulate a deposit of link to cover the deficit + mintLink(address(feeManager), DEFAULT_REPORT_LINK_FEE); + + vm.expectEmit(); + emit LinkDeficitCleared(DEFAULT_CONFIG_DIGEST, DEFAULT_REPORT_LINK_FEE); + + //pay the deficit which will transfer link from the rewardManager to the rewardManager + payLinkDeficit(DEFAULT_CONFIG_DIGEST, ADMIN); + + //check the rewardManager received the link + assertEq(getLinkBalance(address(rewardManager)), DEFAULT_REPORT_LINK_FEE); + } + + function test_payLinkDeficitTwice() public { + //get the default payload + bytes memory payload = getPayload(getV2Report(DEFAULT_FEED_1_V3)); + + approveNative(address(feeManager), DEFAULT_REPORT_NATIVE_FEE, USER); + + //not enough funds in the reward pool should trigger an insufficient link event + vm.expectEmit(); + + IDestinationRewardManager.FeePayment[] memory contractFees = new IDestinationRewardManager.FeePayment[](1); + contractFees[0] = IDestinationRewardManager.FeePayment(DEFAULT_CONFIG_DIGEST, uint192(DEFAULT_REPORT_LINK_FEE)); + + //emit the event that is expected to be emitted + emit InsufficientLink(contractFees); + + //process the fee + processFee(contractFees[0].poolId, payload, USER, address(native), 0); + + //double check the rewardManager balance is 0 + assertEq(getLinkBalance(address(rewardManager)), 0); + + //simulate a deposit of link to cover the deficit + mintLink(address(feeManager), DEFAULT_REPORT_LINK_FEE); + + vm.expectEmit(); + emit LinkDeficitCleared(DEFAULT_CONFIG_DIGEST, DEFAULT_REPORT_LINK_FEE); + + //pay the deficit which will transfer link from the rewardManager to the rewardManager + payLinkDeficit(DEFAULT_CONFIG_DIGEST, ADMIN); + + //check the rewardManager received the link + assertEq(getLinkBalance(address(rewardManager)), DEFAULT_REPORT_LINK_FEE); + + //paying again should revert with 0 + vm.expectRevert(ZERO_DEFICIT); + + payLinkDeficit(DEFAULT_CONFIG_DIGEST, ADMIN); + } + + function test_payLinkDeficitPaysAllFeesProcessed() public { + //get the default payload + bytes memory payload = getPayload(getV2Report(DEFAULT_FEED_1_V3)); + + //approve the native to be transferred from the user + approveNative(address(feeManager), DEFAULT_REPORT_NATIVE_FEE * 2, USER); + + //processing the fee will transfer the native from the user to the feeManager + processFee(DEFAULT_CONFIG_DIGEST, payload, USER, address(native), 0); + processFee(DEFAULT_CONFIG_DIGEST, payload, USER, address(native), 0); + + //check the deficit has been increased twice + assertEq(getLinkDeficit(DEFAULT_CONFIG_DIGEST), DEFAULT_REPORT_LINK_FEE * 2); + + //double check the rewardManager balance is 0 + assertEq(getLinkBalance(address(rewardManager)), 0); + + //simulate a deposit of link to cover the deficit + mintLink(address(feeManager), DEFAULT_REPORT_LINK_FEE * 2); + + vm.expectEmit(); + emit LinkDeficitCleared(DEFAULT_CONFIG_DIGEST, DEFAULT_REPORT_LINK_FEE * 2); + + //pay the deficit which will transfer link from the rewardManager to the rewardManager + payLinkDeficit(DEFAULT_CONFIG_DIGEST, ADMIN); + + //check the rewardManager received the link + assertEq(getLinkBalance(address(rewardManager)), DEFAULT_REPORT_LINK_FEE * 2); + } + + function test_payLinkDeficitOnlyCallableByAdmin() public { + vm.expectRevert(ONLY_CALLABLE_BY_OWNER_ERROR); + + payLinkDeficit(DEFAULT_CONFIG_DIGEST, USER); + } + + function test_revertOnSettingAnAddressZeroVerifier() public { + vm.expectRevert(INVALID_ADDRESS_ERROR); + feeManager.addVerifier(address(0)); + } + + function test_onlyCallableByOwnerReverts() public { + address STRANGER = address(999); + changePrank(STRANGER); + vm.expectRevert(bytes("Only callable by owner")); + feeManager.addVerifier(address(0)); + } + + function test_addVerifierExistingAddress() public { + address dummyAddress = address(998); + feeManager.addVerifier(dummyAddress); + vm.expectRevert(INVALID_ADDRESS_ERROR); + feeManager.addVerifier(dummyAddress); + } + + function test_addVerifier() public { + address dummyAddress = address(998); + feeManager.addVerifier(dummyAddress); + vm.expectRevert(INVALID_ADDRESS_ERROR); + feeManager.addVerifier(dummyAddress); + + // check calls to setFeeRecipients it should not error unauthorized + changePrank(dummyAddress); + bytes32 dummyConfigDigest = 0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef; + Common.AddressAndWeight[] memory recipients = new Common.AddressAndWeight[](1); + recipients[0] = Common.AddressAndWeight(address(991), 1e18); + feeManager.setFeeRecipients(dummyConfigDigest, recipients); + + // removing this verifier should result in unauthorized when calling setFeeRecipients + changePrank(ADMIN); + feeManager.removeVerifier(dummyAddress); + changePrank(dummyAddress); + vm.expectRevert(UNAUTHORIZED_ERROR); + feeManager.setFeeRecipients(dummyConfigDigest, recipients); + } + + function test_removeVerifierZeroAaddress() public { + address dummyAddress = address(0); + vm.expectRevert(INVALID_ADDRESS_ERROR); + feeManager.removeVerifier(dummyAddress); + } + + function test_removeVerifierNonExistentAddress() public { + address dummyAddress = address(991); + vm.expectRevert(INVALID_ADDRESS_ERROR); + feeManager.removeVerifier(dummyAddress); + } + + function test_setRewardManagerZeroAddress() public { + vm.expectRevert(INVALID_ADDRESS_ERROR); + feeManager.setRewardManager(address(0)); + } +} diff --git a/contracts/src/v0.8/llo-feeds/v0.4.0/test/fee-manager/DestinationFeeManager.getFeeAndReward.t.sol b/contracts/src/v0.8/llo-feeds/v0.4.0/test/fee-manager/DestinationFeeManager.getFeeAndReward.t.sol new file mode 100644 index 00000000000..ddd3ac5a8ea --- /dev/null +++ b/contracts/src/v0.8/llo-feeds/v0.4.0/test/fee-manager/DestinationFeeManager.getFeeAndReward.t.sol @@ -0,0 +1,720 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity 0.8.19; + +import {Common} from "../../../libraries/Common.sol"; +import "./BaseDestinationFeeManager.t.sol"; + +/** + * @title BaseFeeManagerTest + * @author Michael Fletcher + * @notice This contract will test the functionality of the feeManager's getFeeAndReward + */ +contract DestinationFeeManagerProcessFeeTest is BaseDestinationFeeManagerTest { + function test_baseFeeIsAppliedForNative() public view { + //get the fee required by the feeManager + Common.Asset memory fee = getFee(getV3Report(DEFAULT_FEED_1_V3), getNativeQuote(), USER); + + //fee should be the default + assertEq(fee.amount, DEFAULT_REPORT_NATIVE_FEE); + } + + function test_baseFeeIsAppliedForLink() public view { + //get the fee required by the feeManager + Common.Asset memory fee = getFee(getV3Report(DEFAULT_FEED_1_V3), getLinkQuote(), USER); + + //fee should be the default + assertEq(fee.amount, DEFAULT_REPORT_LINK_FEE); + } + + function test_discountAIsNotAppliedWhenSetForOtherUsers() public { + //set the subscriber discount for another user + setSubscriberDiscount(USER, DEFAULT_FEED_1_V3, address(link), FEE_SCALAR / 2, ADMIN); + + //get the fee required by the feeManager + Common.Asset memory fee = getFee(getV3Report(DEFAULT_FEED_1_V3), getNativeQuote(), INVALID_ADDRESS); + + //fee should be the default + assertEq(fee.amount, DEFAULT_REPORT_NATIVE_FEE); + } + + function test_discountIsNotAppliedForInvalidTokenAddress() public { + //should revert with invalid address as it's not a configured token + vm.expectRevert(INVALID_ADDRESS_ERROR); + + //set the subscriber discount for another user + setSubscriberDiscount(USER, DEFAULT_FEED_1_V3, INVALID_ADDRESS, FEE_SCALAR / 2, ADMIN); + } + + function test_discountIsAppliedForLink() public { + //set the subscriber discount to 50% + setSubscriberDiscount(USER, DEFAULT_FEED_1_V3, address(link), FEE_SCALAR / 2, ADMIN); + + //get the fee required by the feeManager + Common.Asset memory fee = getFee(getV3Report(DEFAULT_FEED_1_V3), getLinkQuote(), USER); + + //fee should be half the default + assertEq(fee.amount, DEFAULT_REPORT_LINK_FEE / 2); + } + + function test_DiscountIsAppliedForNative() public { + //set the subscriber discount to 50% + setSubscriberDiscount(USER, DEFAULT_FEED_1_V3, address(native), FEE_SCALAR / 2, ADMIN); + + //get the fee required by the feeManager + Common.Asset memory fee = getFee(getV3Report(DEFAULT_FEED_1_V3), getNativeQuote(), USER); + + //fee should be half the default + assertEq(fee.amount, DEFAULT_REPORT_NATIVE_FEE / 2); + } + + function test_discountIsNoLongerAppliedAfterRemoving() public { + //set the subscriber discount to 50% + setSubscriberDiscount(USER, DEFAULT_FEED_1_V3, address(link), FEE_SCALAR / 2, ADMIN); + + //get the fee required by the feeManager + Common.Asset memory fee = getFee(getV3Report(DEFAULT_FEED_1_V3), getLinkQuote(), USER); + + //fee should be half the default + assertEq(fee.amount, DEFAULT_REPORT_LINK_FEE / 2); + + //remove the discount + setSubscriberDiscount(USER, DEFAULT_FEED_1_V3, address(link), 0, ADMIN); + + //get the fee required by the feeManager + fee = getFee(getV3Report(DEFAULT_FEED_1_V3), getLinkQuote(), USER); + + //fee should be the default + assertEq(fee.amount, DEFAULT_REPORT_LINK_FEE); + } + + function test_surchargeIsApplied() public { + //native surcharge + uint256 nativeSurcharge = FEE_SCALAR / 5; + + //set the surcharge + setNativeSurcharge(nativeSurcharge, ADMIN); + + //get the fee required by the feeManager + Common.Asset memory fee = getFee(getV3Report(DEFAULT_FEED_1_V3), getNativeQuote(), USER); + + //calculate the expected surcharge + uint256 expectedSurcharge = ((DEFAULT_REPORT_NATIVE_FEE * nativeSurcharge) / FEE_SCALAR); + + //expected fee should the base fee offset by the surcharge and discount + assertEq(fee.amount, DEFAULT_REPORT_NATIVE_FEE + expectedSurcharge); + } + + function test_surchargeIsNotAppliedForLinkFee() public { + //native surcharge + uint256 nativeSurcharge = FEE_SCALAR / 5; + + //set the surcharge + setNativeSurcharge(nativeSurcharge, ADMIN); + + //get the fee required by the feeManager + Common.Asset memory fee = getFee(getV3Report(DEFAULT_FEED_1_V3), getLinkQuote(), USER); + + //fee should be the default + assertEq(fee.amount, DEFAULT_REPORT_LINK_FEE); + } + + function test_surchargeIsNoLongerAppliedAfterRemoving() public { + //native surcharge + uint256 nativeSurcharge = FEE_SCALAR / 5; + + //set the surcharge + setNativeSurcharge(nativeSurcharge, ADMIN); + + //get the fee required by the feeManager + Common.Asset memory fee = getFee(getV3Report(DEFAULT_FEED_1_V3), getNativeQuote(), USER); + + //calculate the expected surcharge + uint256 expectedSurcharge = ((DEFAULT_REPORT_NATIVE_FEE * nativeSurcharge) / FEE_SCALAR); + + //expected fee should be the base fee offset by the surcharge and discount + assertEq(fee.amount, DEFAULT_REPORT_NATIVE_FEE + expectedSurcharge); + + //remove the surcharge + setNativeSurcharge(0, ADMIN); + + //get the fee required by the feeManager + fee = getFee(getV3Report(DEFAULT_FEED_1_V3), getNativeQuote(), USER); + + //fee should be the default + assertEq(fee.amount, DEFAULT_REPORT_NATIVE_FEE); + } + + function test_feeIsUpdatedAfterNewSurchargeIsApplied() public { + //native surcharge + uint256 nativeSurcharge = FEE_SCALAR / 5; + + //set the surcharge + setNativeSurcharge(nativeSurcharge, ADMIN); + + //get the fee required by the feeManager + Common.Asset memory fee = getFee(getV3Report(DEFAULT_FEED_1_V3), getNativeQuote(), USER); + + //calculate the expected surcharge + uint256 expectedSurcharge = ((DEFAULT_REPORT_NATIVE_FEE * nativeSurcharge) / FEE_SCALAR); + + //expected fee should the base fee offset by the surcharge and discount + assertEq(fee.amount, DEFAULT_REPORT_NATIVE_FEE + expectedSurcharge); + + //change the surcharge + setNativeSurcharge(nativeSurcharge, ADMIN); + + //get the fee required by the feeManager + fee = getFee(getV3Report(DEFAULT_FEED_1_V3), getNativeQuote(), USER); + + //calculate the expected surcharge + expectedSurcharge = ((DEFAULT_REPORT_NATIVE_FEE * nativeSurcharge) / FEE_SCALAR); + + //expected fee should the base fee offset by the surcharge and discount + assertEq(fee.amount, DEFAULT_REPORT_NATIVE_FEE + expectedSurcharge); + } + + function test_surchargeIsAppliedForNativeFeeWithDiscount() public { + //native surcharge + uint256 nativeSurcharge = FEE_SCALAR / 5; + + //set the subscriber discount to 50% + setSubscriberDiscount(USER, DEFAULT_FEED_1_V3, address(native), FEE_SCALAR / 2, ADMIN); + + //set the surcharge + setNativeSurcharge(nativeSurcharge, ADMIN); + + //get the fee required by the feeManager + Common.Asset memory fee = getFee(getV3Report(DEFAULT_FEED_1_V3), getNativeQuote(), USER); + + //calculate the expected surcharge quantity + uint256 expectedSurcharge = ((DEFAULT_REPORT_NATIVE_FEE * nativeSurcharge) / FEE_SCALAR); + + //calculate the expected discount quantity + uint256 expectedDiscount = ((DEFAULT_REPORT_NATIVE_FEE + expectedSurcharge) / 2); + + //expected fee should the base fee offset by the surcharge and discount + assertEq(fee.amount, DEFAULT_REPORT_NATIVE_FEE + expectedSurcharge - expectedDiscount); + } + + function test_emptyQuoteRevertsWithError() public { + //expect a revert + vm.expectRevert(INVALID_QUOTE_ERROR); + + //get the fee required by the feeManager + getFee(getV3Report(DEFAULT_FEED_1_V3), address(0), USER); + } + + function test_nativeSurcharge100Percent() public { + //set the surcharge + setNativeSurcharge(FEE_SCALAR, ADMIN); + + //get the fee required by the feeManager + Common.Asset memory fee = getFee(getV3Report(DEFAULT_FEED_1_V3), getNativeQuote(), USER); + + //fee should be twice the base fee + assertEq(fee.amount, DEFAULT_REPORT_NATIVE_FEE * 2); + } + + function test_nativeSurcharge0Percent() public { + //set the surcharge + setNativeSurcharge(0, ADMIN); + + //get the fee required by the feeManager + Common.Asset memory fee = getFee(getV3Report(DEFAULT_FEED_1_V3), getNativeQuote(), USER); + + //fee should base fee + assertEq(fee.amount, DEFAULT_REPORT_NATIVE_FEE); + } + + function test_nativeSurchargeCannotExceed100Percent() public { + //should revert if surcharge is greater than 100% + vm.expectRevert(INVALID_SURCHARGE_ERROR); + + //set the surcharge above the max + setNativeSurcharge(FEE_SCALAR + 1, ADMIN); + } + + function test_discountIsAppliedWith100PercentSurcharge() public { + //set the subscriber discount to 50% + setSubscriberDiscount(USER, DEFAULT_FEED_1_V3, address(native), FEE_SCALAR / 2, ADMIN); + + //set the surcharge + setNativeSurcharge(FEE_SCALAR, ADMIN); + + //get the fee required by the feeManager + Common.Asset memory fee = getFee(getV3Report(DEFAULT_FEED_1_V3), getNativeQuote(), USER); + + //calculate the expected discount quantity + uint256 expectedDiscount = DEFAULT_REPORT_NATIVE_FEE; + + //fee should be twice the surcharge minus the discount + assertEq(fee.amount, DEFAULT_REPORT_NATIVE_FEE * 2 - expectedDiscount); + } + + function test_feeIsZeroWith100PercentDiscount() public { + //set the subscriber discount to 100% + setSubscriberDiscount(USER, DEFAULT_FEED_1_V3, address(native), FEE_SCALAR, ADMIN); + + //get the fee required by the feeManager + Common.Asset memory fee = getFee(getV3Report(DEFAULT_FEED_1_V3), getNativeQuote(), USER); + + //fee should be zero + assertEq(fee.amount, 0); + } + + function test_feeIsUpdatedAfterDiscountIsRemoved() public { + //set the subscriber discount to 50% + setSubscriberDiscount(USER, DEFAULT_FEED_1_V3, address(native), FEE_SCALAR / 2, ADMIN); + + //get the fee required by the feeManager + Common.Asset memory fee = getFee(getV3Report(DEFAULT_FEED_1_V3), getNativeQuote(), USER); + + //calculate the expected discount quantity + uint256 expectedDiscount = DEFAULT_REPORT_NATIVE_FEE / 2; + + //fee should be 50% of the base fee + assertEq(fee.amount, DEFAULT_REPORT_NATIVE_FEE - expectedDiscount); + + //remove the discount + setSubscriberDiscount(USER, DEFAULT_FEED_1_V3, address(native), 0, ADMIN); + + //get the fee required by the feeManager + fee = getFee(getV3Report(DEFAULT_FEED_1_V3), getNativeQuote(), USER); + + //fee should be the base fee + assertEq(fee.amount, DEFAULT_REPORT_NATIVE_FEE); + } + + function test_feeIsUpdatedAfterNewDiscountIsApplied() public { + //set the subscriber discount to 50% + setSubscriberDiscount(USER, DEFAULT_FEED_1_V3, address(native), FEE_SCALAR / 2, ADMIN); + + //get the fee required by the feeManager + Common.Asset memory fee = getFee(getV3Report(DEFAULT_FEED_1_V3), getNativeQuote(), USER); + + //calculate the expected discount quantity + uint256 expectedDiscount = DEFAULT_REPORT_NATIVE_FEE / 2; + + //fee should be 50% of the base fee + assertEq(fee.amount, DEFAULT_REPORT_NATIVE_FEE - expectedDiscount); + + //change the discount to 25% + setSubscriberDiscount(USER, DEFAULT_FEED_1_V3, address(native), FEE_SCALAR / 4, ADMIN); + + //get the fee required by the feeManager + fee = getFee(getV3Report(DEFAULT_FEED_1_V3), getNativeQuote(), USER); + + //expected discount is now 25% + expectedDiscount = DEFAULT_REPORT_NATIVE_FEE / 4; + + //fee should be the base fee minus the expected discount + assertEq(fee.amount, DEFAULT_REPORT_NATIVE_FEE - expectedDiscount); + } + + function test_setDiscountOver100Percent() public { + //should revert with invalid discount + vm.expectRevert(INVALID_DISCOUNT_ERROR); + + //set the subscriber discount to over 100% + setSubscriberDiscount(USER, DEFAULT_FEED_1_V3, address(native), FEE_SCALAR + 1, ADMIN); + } + + function test_surchargeIsNotAppliedWith100PercentDiscount() public { + //native surcharge + uint256 nativeSurcharge = FEE_SCALAR / 5; + + //set the subscriber discount to 100% + setSubscriberDiscount(USER, DEFAULT_FEED_1_V3, address(native), FEE_SCALAR, ADMIN); + + //set the surcharge + setNativeSurcharge(nativeSurcharge, ADMIN); + + //get the fee required by the feeManager + Common.Asset memory fee = getFee(getV3Report(DEFAULT_FEED_1_V3), getNativeQuote(), USER); + + //fee should be zero + assertEq(fee.amount, 0); + } + + function test_nonAdminUserCanNotSetDiscount() public { + //should revert with unauthorized + vm.expectRevert(ONLY_CALLABLE_BY_OWNER_ERROR); + + //set the subscriber discount to 50% + setSubscriberDiscount(USER, DEFAULT_FEED_1_V3, address(native), FEE_SCALAR, USER); + } + + function test_surchargeFeeRoundsUpWhenUneven() public { + //native surcharge + uint256 nativeSurcharge = FEE_SCALAR / 3; + + //set the surcharge + setNativeSurcharge(nativeSurcharge, ADMIN); + + //get the fee required by the feeManager + Common.Asset memory fee = getFee(getV3Report(DEFAULT_FEED_1_V3), getNativeQuote(), USER); + + //calculate the expected surcharge quantity + uint256 expectedSurcharge = (DEFAULT_REPORT_NATIVE_FEE * nativeSurcharge) / FEE_SCALAR; + + //expected fee should the base fee offset by the expected surcharge + assertEq(fee.amount, DEFAULT_REPORT_NATIVE_FEE + expectedSurcharge + 1); + } + + function test_discountFeeRoundsDownWhenUneven() public { + //native surcharge + uint256 discount = FEE_SCALAR / 3; + + //set the subscriber discount to 33.333% + setSubscriberDiscount(USER, DEFAULT_FEED_1_V3, address(native), discount, ADMIN); + + //get the fee required by the feeManager + Common.Asset memory fee = getFee(getV3Report(DEFAULT_FEED_1_V3), getNativeQuote(), USER); + + //calculate the expected quantity + uint256 expectedDiscount = ((DEFAULT_REPORT_NATIVE_FEE * discount) / FEE_SCALAR); + + //expected fee should the base fee offset by the expected surcharge + assertEq(fee.amount, DEFAULT_REPORT_NATIVE_FEE - expectedDiscount); + } + + function test_reportWithNoExpiryOrFeeReturnsZero() public view { + //get the fee required by the feeManager + Common.Asset memory fee = getFee(getV1Report(DEFAULT_FEED_1_V1), getNativeQuote(), USER); + + //fee should be zero + assertEq(fee.amount, 0); + } + + function test_correctDiscountIsAppliedWhenBothTokensAreDiscounted() public { + //set the subscriber and native discounts + setSubscriberDiscount(USER, DEFAULT_FEED_1_V3, address(link), FEE_SCALAR / 4, ADMIN); + setSubscriberDiscount(USER, DEFAULT_FEED_1_V3, address(native), FEE_SCALAR / 2, ADMIN); + + //get the fee required by the feeManager for both tokens + Common.Asset memory linkFee = getFee(getV3Report(DEFAULT_FEED_1_V3), getLinkQuote(), USER); + Common.Asset memory nativeFee = getFee(getV3Report(DEFAULT_FEED_1_V3), getNativeQuote(), USER); + + //calculate the expected discount quantity for each token + uint256 expectedDiscountLink = (DEFAULT_REPORT_LINK_FEE * FEE_SCALAR) / 4 / FEE_SCALAR; + uint256 expectedDiscountNative = (DEFAULT_REPORT_NATIVE_FEE * FEE_SCALAR) / 2 / FEE_SCALAR; + + //check the fee calculation for each token + assertEq(linkFee.amount, DEFAULT_REPORT_LINK_FEE - expectedDiscountLink); + assertEq(nativeFee.amount, DEFAULT_REPORT_NATIVE_FEE - expectedDiscountNative); + } + + function test_discountIsNotAppliedToOtherFeeds() public { + //set the subscriber discount to 50% + setSubscriberDiscount(USER, DEFAULT_FEED_1_V3, address(native), FEE_SCALAR / 2, ADMIN); + + //get the fee required by the feeManager + Common.Asset memory fee = getFee(getV3Report(DEFAULT_FEED_2_V3), getNativeQuote(), USER); + + //fee should be the base fee + assertEq(fee.amount, DEFAULT_REPORT_NATIVE_FEE); + } + + function test_noFeeIsAppliedWhenReportHasZeroFee() public { + //set the subscriber discount to 50% + setSubscriberDiscount(USER, DEFAULT_FEED_1_V3, address(native), FEE_SCALAR / 2, ADMIN); + + //get the fee required by the feeManager + Common.Asset memory fee = getFee( + getV3ReportWithCustomExpiryAndFee(DEFAULT_FEED_1_V3, uint32(block.timestamp), 0, 0), + getNativeQuote(), + USER + ); + + //fee should be zero + assertEq(fee.amount, 0); + } + + function test_noFeeIsAppliedWhenReportHasZeroFeeAndDiscountAndSurchargeIsSet() public { + //set the subscriber discount to 50% + setSubscriberDiscount(USER, DEFAULT_FEED_1_V3, address(native), FEE_SCALAR / 2, ADMIN); + + //set the surcharge + setNativeSurcharge(FEE_SCALAR / 2, ADMIN); + + //get the fee required by the feeManager + Common.Asset memory fee = getFee( + getV3ReportWithCustomExpiryAndFee(DEFAULT_FEED_1_V3, uint32(block.timestamp), 0, 0), + getNativeQuote(), + USER + ); + + //fee should be zero + assertEq(fee.amount, 0); + } + + function test_nativeSurchargeEventIsEmittedOnUpdate() public { + //native surcharge + uint64 nativeSurcharge = FEE_SCALAR / 3; + + //an event should be emitted + vm.expectEmit(); + + //emit the event that is expected to be emitted + emit NativeSurchargeUpdated(nativeSurcharge); + + //set the surcharge + setNativeSurcharge(nativeSurcharge, ADMIN); + } + + function test_getBaseRewardWithLinkQuote() public view { + //get the fee required by the feeManager + Common.Asset memory reward = getReward(getV3Report(DEFAULT_FEED_1_V3), getLinkQuote(), USER); + + //the reward should equal the base fee + assertEq(reward.amount, DEFAULT_REPORT_LINK_FEE); + } + + function test_getRewardWithLinkQuoteAndLinkDiscount() public { + //set the link discount + setSubscriberDiscount(USER, DEFAULT_FEED_1_V3, address(link), FEE_SCALAR / 2, ADMIN); + + //get the fee required by the feeManager + Common.Asset memory reward = getReward(getV3Report(DEFAULT_FEED_1_V3), getLinkQuote(), USER); + + //the reward should equal the discounted base fee + assertEq(reward.amount, DEFAULT_REPORT_LINK_FEE / 2); + } + + function test_getRewardWithNativeQuote() public view { + //get the fee required by the feeManager + Common.Asset memory reward = getReward(getV3Report(DEFAULT_FEED_1_V3), getNativeQuote(), USER); + + //the reward should equal the base fee in link + assertEq(reward.amount, DEFAULT_REPORT_LINK_FEE); + } + + function test_getRewardWithNativeQuoteAndSurcharge() public { + //set the native surcharge + setNativeSurcharge(FEE_SCALAR / 2, ADMIN); + + //get the fee required by the feeManager + Common.Asset memory reward = getReward(getV3Report(DEFAULT_FEED_1_V3), getNativeQuote(), USER); + + //the reward should equal the base fee in link regardless of the surcharge + assertEq(reward.amount, DEFAULT_REPORT_LINK_FEE); + } + + function test_getRewardWithLinkDiscount() public { + //set the link discount + setSubscriberDiscount(USER, DEFAULT_FEED_1_V3, address(link), FEE_SCALAR / 2, ADMIN); + + //get the fee required by the feeManager + Common.Asset memory reward = getReward(getV3Report(DEFAULT_FEED_1_V3), getLinkQuote(), USER); + + //the reward should equal the discounted base fee + assertEq(reward.amount, DEFAULT_REPORT_LINK_FEE / 2); + } + + function test_getLinkFeeIsRoundedUp() public { + //set the link discount + setSubscriberDiscount(USER, DEFAULT_FEED_1_V3, address(link), FEE_SCALAR / 3, ADMIN); + + //get the fee required by the feeManager + Common.Asset memory fee = getFee(getV3Report(DEFAULT_FEED_1_V3), getLinkQuote(), USER); + + //the reward should equal .66% + 1 of the base fee due to a 33% discount rounded up + assertEq(fee.amount, (DEFAULT_REPORT_LINK_FEE * 2) / 3 + 1); + } + + function test_getLinkRewardIsSameAsFee() public { + //set the link discount + setSubscriberDiscount(USER, DEFAULT_FEED_1_V3, address(link), FEE_SCALAR / 3, ADMIN); + + //get the fee required by the feeManager + Common.Asset memory fee = getFee(getV3Report(DEFAULT_FEED_1_V3), getLinkQuote(), USER); + Common.Asset memory reward = getReward(getV3Report(DEFAULT_FEED_1_V3), getLinkQuote(), USER); + + //check the reward is in link + assertEq(fee.assetAddress, address(link)); + + //the reward should equal .66% of the base fee due to a 33% discount rounded down + assertEq(reward.amount, fee.amount); + } + + function test_getLinkRewardWithNativeQuoteAndSurchargeWithLinkDiscount() public { + //set the native surcharge + setNativeSurcharge(FEE_SCALAR / 2, ADMIN); + + //set the link discount + setSubscriberDiscount(USER, DEFAULT_FEED_1_V3, address(link), FEE_SCALAR / 3, ADMIN); + + //get the fee required by the feeManager + Common.Asset memory reward = getReward(getV3Report(DEFAULT_FEED_1_V3), getNativeQuote(), USER); + + //the reward should equal the base fee in link regardless of the surcharge + assertEq(reward.amount, DEFAULT_REPORT_LINK_FEE); + } + + function test_testRevertIfReportHasExpired() public { + //expect a revert + vm.expectRevert(EXPIRED_REPORT_ERROR); + + //get the fee required by the feeManager + getFee( + getV3ReportWithCustomExpiryAndFee( + DEFAULT_FEED_1_V3, + block.timestamp - 1, + DEFAULT_REPORT_LINK_FEE, + DEFAULT_REPORT_NATIVE_FEE + ), + getNativeQuote(), + USER + ); + } + + function test_discountIsReturnedForLink() public { + //set the subscriber discount to 50% + setSubscriberDiscount(USER, DEFAULT_FEED_1_V3, address(link), FEE_SCALAR / 2, ADMIN); + + //get the fee applied + uint256 discount = getAppliedDiscount(getV3Report(DEFAULT_FEED_1_V3), getLinkQuote(), USER); + + //fee should be half the default + assertEq(discount, FEE_SCALAR / 2); + } + + function test_DiscountIsReturnedForNative() public { + //set the subscriber discount to 50% + setSubscriberDiscount(USER, DEFAULT_FEED_1_V3, address(native), FEE_SCALAR / 2, ADMIN); + + //get the discount applied + uint256 discount = getAppliedDiscount(getV3Report(DEFAULT_FEED_1_V3), getNativeQuote(), USER); + + //fee should be half the default + assertEq(discount, FEE_SCALAR / 2); + } + + function test_DiscountIsReturnedForNativeWithSurcharge() public { + //set the subscriber discount to 50% + setSubscriberDiscount(USER, DEFAULT_FEED_1_V3, address(native), FEE_SCALAR / 2, ADMIN); + + //set the surcharge + setNativeSurcharge(FEE_SCALAR / 5, ADMIN); + + //get the discount applied + uint256 discount = getAppliedDiscount(getV3Report(DEFAULT_FEED_1_V3), getNativeQuote(), USER); + + //fee should be half the default + assertEq(discount, FEE_SCALAR / 2); + } + + function test_GlobalDiscountWithNative() public { + //set the global discount to 50% + setSubscriberGlobalDiscount(USER, address(native), FEE_SCALAR / 2, ADMIN); + + //get the discount applied + uint256 discount = getAppliedDiscount(getV3Report(DEFAULT_FEED_1_V3), getNativeQuote(), USER); + + //fee should be half the default + assertEq(discount, FEE_SCALAR / 2); + } + + function test_GlobalDiscountWithLink() public { + //set the global discount to 50% + setSubscriberGlobalDiscount(USER, address(link), FEE_SCALAR / 2, ADMIN); + + //get the discount applied + uint256 discount = getAppliedDiscount(getV3Report(DEFAULT_FEED_1_V3), getLinkQuote(), USER); + + //fee should be half the default + assertEq(discount, FEE_SCALAR / 2); + } + + function test_GlobalDiscountWithNativeAndLink() public { + //set the global discount to 50% + setSubscriberGlobalDiscount(USER, address(native), FEE_SCALAR / 2, ADMIN); + setSubscriberGlobalDiscount(USER, address(link), FEE_SCALAR / 2, ADMIN); + + //get the discount applied + uint256 discount = getAppliedDiscount(getV3Report(DEFAULT_FEED_1_V3), getLinkQuote(), USER); + + //fee should be half the default + assertEq(discount, FEE_SCALAR / 2); + } + + function test_GlobalDiscountIsOverridenByIndividualDiscountNative() public { + //set the global discount to 50% + setSubscriberGlobalDiscount(USER, address(native), FEE_SCALAR / 2, ADMIN); + setSubscriberDiscount(USER, DEFAULT_FEED_1_V3, address(native), FEE_SCALAR / 4, ADMIN); + + //get the discount applied + uint256 discount = getAppliedDiscount(getV3Report(DEFAULT_FEED_1_V3), getNativeQuote(), USER); + + //fee should be half the default + assertEq(discount, FEE_SCALAR / 4); + } + + function test_GlobalDiscountIsOverridenByIndividualDiscountLink() public { + //set the global discount to 50% + setSubscriberGlobalDiscount(USER, address(link), FEE_SCALAR / 2, ADMIN); + setSubscriberDiscount(USER, DEFAULT_FEED_1_V3, address(link), FEE_SCALAR / 4, ADMIN); + + //get the discount applied + uint256 discount = getAppliedDiscount(getV3Report(DEFAULT_FEED_1_V3), getLinkQuote(), USER); + + //fee should be half the default + assertEq(discount, FEE_SCALAR / 4); + } + + function test_GlobalDiscountIsUpdatedAfterBeingSetToZeroLink() public { + //set the global discount to 50% + setSubscriberGlobalDiscount(USER, address(link), FEE_SCALAR / 2, ADMIN); + + //get the discount applied + uint256 discount = getAppliedDiscount(getV3Report(DEFAULT_FEED_1_V3), getLinkQuote(), USER); + + //fee should be half the default + assertEq(discount, FEE_SCALAR / 2); + + //set the global discount to zero + setSubscriberGlobalDiscount(USER, address(link), 0, ADMIN); + + //get the discount applied + discount = getAppliedDiscount(getV3Report(DEFAULT_FEED_1_V3), getLinkQuote(), USER); + + //fee should be zero + assertEq(discount, 0); + } + + function test_GlobalDiscountIsUpdatedAfterBeingSetToZeroNative() public { + //set the global discount to 50% + setSubscriberGlobalDiscount(USER, address(native), FEE_SCALAR / 2, ADMIN); + + //get the discount applied + uint256 discount = getAppliedDiscount(getV3Report(DEFAULT_FEED_1_V3), getNativeQuote(), USER); + + //fee should be half the default + assertEq(discount, FEE_SCALAR / 2); + + //set the global discount to zero + setSubscriberGlobalDiscount(USER, address(native), 0, ADMIN); + + //get the discount applied + discount = getAppliedDiscount(getV3Report(DEFAULT_FEED_1_V3), getNativeQuote(), USER); + + //fee should be zero + assertEq(discount, 0); + } + + function test_GlobalDiscountCantBeSetToMoreThanMaximum() public { + //should revert with invalid discount + vm.expectRevert(INVALID_DISCOUNT_ERROR); + + //set the global discount to 101% + setSubscriberGlobalDiscount(USER, address(native), FEE_SCALAR + 1, ADMIN); + } + + function test_onlyOwnerCanSetGlobalDiscount() public { + //should revert with unauthorized + vm.expectRevert(ONLY_CALLABLE_BY_OWNER_ERROR); + + //set the global discount to 50% + setSubscriberGlobalDiscount(USER, address(native), FEE_SCALAR / 2, USER); + } +} diff --git a/contracts/src/v0.8/llo-feeds/v0.4.0/test/fee-manager/DestinationFeeManager.processFee.t.sol b/contracts/src/v0.8/llo-feeds/v0.4.0/test/fee-manager/DestinationFeeManager.processFee.t.sol new file mode 100644 index 00000000000..0880352dca4 --- /dev/null +++ b/contracts/src/v0.8/llo-feeds/v0.4.0/test/fee-manager/DestinationFeeManager.processFee.t.sol @@ -0,0 +1,492 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity 0.8.19; + +import {Common} from "../../../libraries/Common.sol"; +import "./BaseDestinationFeeManager.t.sol"; +import {IDestinationRewardManager} from "../../interfaces/IDestinationRewardManager.sol"; + +/** + * @title BaseFeeManagerTest + * @author Michael Fletcher + * @notice This contract will test the functionality of the feeManager processFee + */ +contract DestinationFeeManagerProcessFeeTest is BaseDestinationFeeManagerTest { + function setUp() public override { + super.setUp(); + } + + function test_nonAdminProxyUserCannotProcessFee() public { + //get the default payload + bytes memory payload = getPayload(getV3Report(DEFAULT_FEED_1_V3)); + + //should revert as the user is not the owner + vm.expectRevert(UNAUTHORIZED_ERROR); + + //process the fee + ProcessFeeAsUser(DEFAULT_CONFIG_DIGEST, payload, USER, address(link), 0, USER); + } + + function test_processFeeAsProxy() public { + //get the default payload + bytes memory payload = getPayload(getV3Report(DEFAULT_FEED_1_V3)); + + //approve the link to be transferred from the from the subscriber to the rewardManager + approveLink(address(rewardManager), DEFAULT_REPORT_LINK_FEE, USER); + + //processing the fee will transfer the link from the user to the rewardManager + processFee(DEFAULT_CONFIG_DIGEST, payload, USER, address(link), 0); + + //check the link has been transferred + assertEq(getLinkBalance(address(rewardManager)), DEFAULT_REPORT_LINK_FEE); + + //check the user has had the link fee deducted + assertEq(getLinkBalance(USER), DEFAULT_LINK_MINT_QUANTITY - DEFAULT_REPORT_LINK_FEE); + } + + function test_processFeeIfSubscriberIsSelf() public { + //get the default payload + bytes memory payload = getPayload(getV3Report(DEFAULT_FEED_1_V3)); + + //expect a revert due to the feeManager being the subscriber + vm.expectRevert(INVALID_ADDRESS_ERROR); + + //process the fee will fail due to assertion + processFee(DEFAULT_CONFIG_DIGEST, payload, address(feeManager), address(native), 0); + } + + function test_processFeeWithWithEmptyQuotePayload() public { + //get the default payload + bytes memory payload = getPayload(getV3Report(DEFAULT_FEED_1_V3)); + + //expect a revert as the quote is invalid + vm.expectRevert(); + + //processing the fee will transfer the link by default + processFee(DEFAULT_CONFIG_DIGEST, payload, USER, address(0), 0); + } + + function test_processFeeWithWithZeroQuotePayload() public { + //get the default payload + bytes memory payload = getPayload(getV3Report(DEFAULT_FEED_1_V3)); + + //expect a revert as the quote is invalid + vm.expectRevert(INVALID_QUOTE_ERROR); + + //processing the fee will transfer the link by default + processFee(DEFAULT_CONFIG_DIGEST, payload, USER, INVALID_ADDRESS, 0); + } + + function test_processFeeWithWithCorruptQuotePayload() public { + //get the default payload + bytes memory payload = abi.encode( + [DEFAULT_CONFIG_DIGEST, 0, 0], + getV3Report(DEFAULT_FEED_1_V3), + new bytes32[](1), + new bytes32[](1), + bytes32("") + ); + + //expect an evm revert as the quote is corrupt + vm.expectRevert(); + + //processing the fee will not withdraw anything as there is no fee to collect + processFee(DEFAULT_CONFIG_DIGEST, payload, USER, address(link), 0); + } + + function test_processFeeDefaultReportsStillVerifiesWithEmptyQuote() public { + //get the default payload + bytes memory payload = getPayload(getV1Report(DEFAULT_FEED_1_V1)); + + //processing the fee will transfer the link from the user to the rewardManager + processFee(DEFAULT_CONFIG_DIGEST, payload, USER, address(0), 0); + } + + function test_processFeeWithDefaultReportPayloadAndQuoteStillVerifies() public { + //get the default payload + bytes memory payload = getPayload(getV1Report(DEFAULT_FEED_1_V1)); + + //processing the fee will not withdraw anything as there is no fee to collect + processFee(DEFAULT_CONFIG_DIGEST, payload, USER, address(link), 0); + } + + function test_processFeeNative() public { + //simulate a deposit of link for the conversion pool + mintLink(address(feeManager), DEFAULT_REPORT_LINK_FEE); + + //get the default payload + bytes memory payload = getPayload(getV3Report(DEFAULT_FEED_1_V3)); + + //approve the native to be transferred from the user + approveNative(address(feeManager), DEFAULT_REPORT_NATIVE_FEE, USER); + + //processing the fee will transfer the native from the user to the feeManager + processFee(DEFAULT_CONFIG_DIGEST, payload, USER, address(native), 0); + + //check the native has been transferred + assertEq(getNativeBalance(address(feeManager)), DEFAULT_REPORT_NATIVE_FEE); + + //check the link has been transferred to the rewardManager + assertEq(getLinkBalance(address(rewardManager)), DEFAULT_REPORT_LINK_FEE); + + //check the feeManager has had the link deducted, the remaining balance should be 0 + assertEq(getLinkBalance(address(feeManager)), 0); + + //check the subscriber has had the native deducted + assertEq(getNativeBalance(USER), DEFAULT_NATIVE_MINT_QUANTITY - DEFAULT_REPORT_NATIVE_FEE); + } + + function test_processFeeEmitsEventIfNotEnoughLink() public { + //simulate a deposit of half the link required for the fee + mintLink(address(feeManager), DEFAULT_REPORT_LINK_FEE / 2); + + //get the default payload + bytes memory payload = getPayload(getV3Report(DEFAULT_FEED_1_V3)); + + //approve the native to be transferred from the user + approveNative(address(feeManager), DEFAULT_REPORT_NATIVE_FEE, USER); + + //expect an emit as there's not enough link + vm.expectEmit(); + + IDestinationRewardManager.FeePayment[] memory contractFees = new IDestinationRewardManager.FeePayment[](1); + contractFees[0] = IDestinationRewardManager.FeePayment(DEFAULT_CONFIG_DIGEST, uint192(DEFAULT_REPORT_LINK_FEE)); + + //emit the event that is expected to be emitted + emit InsufficientLink(contractFees); + + //processing the fee will transfer the native from the user to the feeManager + processFee(DEFAULT_CONFIG_DIGEST, payload, USER, address(native), 0); + + //check the native has been transferred + assertEq(getNativeBalance(address(feeManager)), DEFAULT_REPORT_NATIVE_FEE); + + //check no link has been transferred to the rewardManager + assertEq(getLinkBalance(address(rewardManager)), 0); + assertEq(getLinkBalance(address(feeManager)), DEFAULT_REPORT_LINK_FEE / 2); + + //check the subscriber has had the native deducted + assertEq(getNativeBalance(USER), DEFAULT_NATIVE_MINT_QUANTITY - DEFAULT_REPORT_NATIVE_FEE); + } + + function test_processFeeWithUnwrappedNative() public { + //simulate a deposit of link for the conversion pool + mintLink(address(feeManager), DEFAULT_REPORT_LINK_FEE); + + //get the default payload + bytes memory payload = getPayload(getV3Report(DEFAULT_FEED_1_V3)); + + //only the proxy or admin can call processFee, they will pass in the native value on the users behalf + processFee(DEFAULT_CONFIG_DIGEST, payload, USER, address(native), DEFAULT_REPORT_NATIVE_FEE); + + //check the native has been transferred and converted to wrapped native + assertEq(getNativeBalance(address(feeManager)), DEFAULT_REPORT_NATIVE_FEE); + assertEq(getNativeUnwrappedBalance(address(feeManager)), 0); + + //check the link has been transferred to the rewardManager + assertEq(getLinkBalance(address(rewardManager)), DEFAULT_REPORT_LINK_FEE); + + //check the feeManager has had the link deducted, the remaining balance should be 0 + assertEq(getLinkBalance(address(feeManager)), 0); + + //check the subscriber has had the native deducted + assertEq(getNativeUnwrappedBalance(USER), DEFAULT_NATIVE_MINT_QUANTITY - DEFAULT_REPORT_NATIVE_FEE); + } + + function test_processFeeWithUnwrappedNativeShortFunds() public { + //simulate a deposit of link for the conversion pool + mintLink(address(feeManager), DEFAULT_REPORT_LINK_FEE); + + //get the default payload + bytes memory payload = getPayload(getV3Report(DEFAULT_FEED_1_V3)); + + //expect a revert as not enough funds + vm.expectRevert(INVALID_DEPOSIT_ERROR); + + //only the proxy or admin can call processFee, they will pass in the native value on the users behalf + processFee(DEFAULT_CONFIG_DIGEST, payload, USER, address(native), DEFAULT_REPORT_NATIVE_FEE - 1); + } + + function test_processFeeWithUnwrappedNativeLinkAddress() public { + //simulate a deposit of link for the conversion pool + mintLink(address(feeManager), DEFAULT_REPORT_LINK_FEE); + + //get the default payload + bytes memory payload = getPayload(getV3Report(DEFAULT_FEED_1_V3)); + + //expect a revert as not enough funds + vm.expectRevert(INSUFFICIENT_ALLOWANCE_ERROR); + + //the change will be returned and the user will attempted to be billed in LINK + processFee(DEFAULT_CONFIG_DIGEST, payload, USER, address(link), DEFAULT_REPORT_NATIVE_FEE - 1); + } + + function test_processFeeWithUnwrappedNativeLinkAddressExcessiveFee() public { + //approve the link to be transferred from the from the subscriber to the rewardManager + approveLink(address(rewardManager), DEFAULT_REPORT_LINK_FEE, PROXY); + + //get the default payload + bytes memory payload = getPayload(getV3Report(DEFAULT_FEED_1_V3)); + + //call processFee from the proxy to test whether the funds are returned to the subscriber. In reality, the funds would be returned to the caller of the proxy. + processFee(DEFAULT_CONFIG_DIGEST, payload, PROXY, address(link), DEFAULT_REPORT_NATIVE_FEE); + + //check the native unwrapped is no longer in the account + assertEq(getNativeBalance(address(feeManager)), 0); + assertEq(getNativeUnwrappedBalance(address(feeManager)), 0); + + //check the link has been transferred to the rewardManager + assertEq(getLinkBalance(address(rewardManager)), DEFAULT_REPORT_LINK_FEE); + + //check the feeManager has had the link deducted, the remaining balance should be 0 + assertEq(getLinkBalance(address(feeManager)), 0); + + //native should not be deducted + assertEq(getNativeUnwrappedBalance(PROXY), DEFAULT_NATIVE_MINT_QUANTITY); + } + + function test_processFeeWithUnwrappedNativeWithExcessiveFee() public { + //simulate a deposit of link for the conversion pool + mintLink(address(feeManager), DEFAULT_REPORT_LINK_FEE); + + //get the default payload + bytes memory payload = getPayload(getV3Report(DEFAULT_FEED_1_V3)); + + //call processFee from the proxy to test whether the funds are returned to the subscriber. In reality, the funds would be returned to the caller of the proxy. + processFee(DEFAULT_CONFIG_DIGEST, payload, PROXY, address(native), DEFAULT_REPORT_NATIVE_FEE * 2); + + //check the native has been transferred and converted to wrapped native + assertEq(getNativeBalance(address(feeManager)), DEFAULT_REPORT_NATIVE_FEE); + assertEq(getNativeUnwrappedBalance(address(feeManager)), 0); + + //check the link has been transferred to the rewardManager + assertEq(getLinkBalance(address(rewardManager)), DEFAULT_REPORT_LINK_FEE); + + //check the feeManager has had the link deducted, the remaining balance should be 0 + assertEq(getLinkBalance(address(feeManager)), 0); + + //check the subscriber has had the native deducted + assertEq(getNativeUnwrappedBalance(PROXY), DEFAULT_NATIVE_MINT_QUANTITY - DEFAULT_REPORT_NATIVE_FEE); + } + + function test_processFeeUsesCorrectDigest() public { + //get the default payload + bytes memory payload = getPayload(getV3Report(DEFAULT_FEED_1_V3)); + + //approve the link to be transferred from the from the subscriber to the rewardManager + approveLink(address(rewardManager), DEFAULT_REPORT_LINK_FEE, USER); + + //processing the fee will transfer the link from the user to the rewardManager + processFee(DEFAULT_CONFIG_DIGEST, payload, USER, address(link), 0); + + //check the link has been transferred + assertEq(getLinkBalance(address(rewardManager)), DEFAULT_REPORT_LINK_FEE); + + //check the user has had the link fee deducted + assertEq(getLinkBalance(USER), DEFAULT_LINK_MINT_QUANTITY - DEFAULT_REPORT_LINK_FEE); + + //check funds have been paid to the reward manager + assertEq(rewardManager.s_totalRewardRecipientFees(DEFAULT_CONFIG_DIGEST), DEFAULT_REPORT_LINK_FEE); + } + + function test_V1PayloadVerifies() public { + //replicate a default payload + bytes memory payload = abi.encode( + [DEFAULT_CONFIG_DIGEST, 0, 0], + getV2Report(DEFAULT_FEED_1_V1), + new bytes32[](1), + new bytes32[](1), + bytes32("") + ); + + //processing the fee will transfer the link from the user to the rewardManager + processFee(DEFAULT_CONFIG_DIGEST, payload, USER, address(0), 0); + } + + function test_V2PayloadVerifies() public { + //get the default payload + bytes memory payload = getPayload(getV2Report(DEFAULT_FEED_1_V2)); + + //approve the link to be transferred from the from the subscriber to the rewardManager + approveLink(address(rewardManager), DEFAULT_REPORT_LINK_FEE, USER); + + //processing the fee will transfer the link from the user to the rewardManager + processFee(DEFAULT_CONFIG_DIGEST, payload, USER, address(link), 0); + + //check the link has been transferred + assertEq(getLinkBalance(address(rewardManager)), DEFAULT_REPORT_LINK_FEE); + + //check the user has had the link fee deducted + assertEq(getLinkBalance(USER), DEFAULT_LINK_MINT_QUANTITY - DEFAULT_REPORT_LINK_FEE); + } + + function test_V2PayloadWithoutQuoteFails() public { + //get the default payload + bytes memory payload = getPayload(getV2Report(DEFAULT_FEED_1_V2)); + + //expect a revert as the quote is invalid + vm.expectRevert(); + + //processing the fee will transfer the link from the user to the rewardManager + processFee(DEFAULT_CONFIG_DIGEST, payload, USER, address(0), 0); + } + + function test_V2PayloadWithoutZeroFee() public { + //get the default payload + bytes memory payload = getPayload(getV2Report(DEFAULT_FEED_1_V2)); + + //expect a revert as the quote is invalid + vm.expectRevert(); + + //processing the fee will transfer the link from the user to the rewardManager + processFee(DEFAULT_CONFIG_DIGEST, payload, USER, address(link), 0); + } + + function test_processFeeWithInvalidReportVersionFailsToDecode() public { + bytes memory data = abi.encode(0x0000100000000000000000000000000000000000000000000000000000000000); + + //get the default payload + bytes memory payload = getPayload(data); + + //serialization will fail as there is no report to decode + vm.expectRevert(); + + //processing the fee will not withdraw anything as there is no fee to collect + processFee(DEFAULT_CONFIG_DIGEST, payload, USER, address(link), 0); + } + + function test_processFeeWithZeroNativeNonZeroLinkWithNativeQuote() public { + //get the default payload + bytes memory payload = getPayload( + getV3ReportWithCustomExpiryAndFee(DEFAULT_FEED_1_V3, block.timestamp, DEFAULT_REPORT_LINK_FEE, 0) + ); + + //call processFee should not revert as the fee is 0 + processFee(DEFAULT_CONFIG_DIGEST, payload, PROXY, address(native), 0); + } + + function test_processFeeWithZeroNativeNonZeroLinkWithLinkQuote() public { + //get the default payload + bytes memory payload = getPayload( + getV3ReportWithCustomExpiryAndFee(DEFAULT_FEED_1_V3, block.timestamp, DEFAULT_REPORT_LINK_FEE, 0) + ); + + //approve the link to be transferred from the from the subscriber to the rewardManager + approveLink(address(rewardManager), DEFAULT_REPORT_LINK_FEE, USER); + + //processing the fee will transfer the link to the rewardManager from the user + processFee(DEFAULT_CONFIG_DIGEST, payload, USER, address(link), 0); + + //check the link has been transferred + assertEq(getLinkBalance(address(rewardManager)), DEFAULT_REPORT_LINK_FEE); + + //check the user has had the link fee deducted + assertEq(getLinkBalance(USER), DEFAULT_LINK_MINT_QUANTITY - DEFAULT_REPORT_LINK_FEE); + } + + function test_processFeeWithZeroLinkNonZeroNativeWithNativeQuote() public { + //simulate a deposit of link for the conversion pool + mintLink(address(feeManager), DEFAULT_REPORT_LINK_FEE); + + //get the default payload + bytes memory payload = getPayload( + getV3ReportWithCustomExpiryAndFee(DEFAULT_FEED_1_V3, block.timestamp, 0, DEFAULT_REPORT_NATIVE_FEE) + ); + + //approve the native to be transferred from the user + approveNative(address(feeManager), DEFAULT_REPORT_NATIVE_FEE, USER); + + //processing the fee will transfer the native from the user to the feeManager + processFee(DEFAULT_CONFIG_DIGEST, payload, USER, address(native), 0); + + //check the native has been transferred + assertEq(getNativeBalance(address(feeManager)), DEFAULT_REPORT_NATIVE_FEE); + + //check no link has been transferred to the rewardManager + assertEq(getLinkBalance(address(rewardManager)), 0); + + //check the feeManager has had no link deducted + assertEq(getLinkBalance(address(feeManager)), DEFAULT_REPORT_LINK_FEE); + + //check the subscriber has had the native deducted + assertEq(getNativeBalance(USER), DEFAULT_NATIVE_MINT_QUANTITY - DEFAULT_REPORT_NATIVE_FEE); + } + + function test_processFeeWithZeroLinkNonZeroNativeWithLinkQuote() public { + //get the default payload + bytes memory payload = getPayload( + getV3ReportWithCustomExpiryAndFee(DEFAULT_FEED_1_V3, block.timestamp, 0, DEFAULT_REPORT_NATIVE_FEE) + ); + + //call processFee should not revert as the fee is 0 + processFee(DEFAULT_CONFIG_DIGEST, payload, USER, address(link), 0); + } + + function test_processFeeWithZeroNativeNonZeroLinkReturnsChange() public { + //get the default payload + bytes memory payload = getPayload( + getV3ReportWithCustomExpiryAndFee(DEFAULT_FEED_1_V3, block.timestamp, 0, DEFAULT_REPORT_NATIVE_FEE) + ); + + //call processFee should not revert as the fee is 0 + processFee(DEFAULT_CONFIG_DIGEST, payload, USER, address(link), DEFAULT_REPORT_NATIVE_FEE); + + //check the change has been returned + assertEq(USER.balance, DEFAULT_NATIVE_MINT_QUANTITY); + } + + function test_V1PayloadVerifiesAndReturnsChange() public { + //emulate a V1 payload with no quote + bytes memory payload = getPayload(getV1Report(DEFAULT_FEED_1_V1)); + + processFee(DEFAULT_CONFIG_DIGEST, payload, USER, address(0), DEFAULT_REPORT_NATIVE_FEE); + + //Fee manager should not contain any native + assertEq(address(feeManager).balance, 0); + assertEq(getNativeBalance(address(feeManager)), 0); + + //check the unused native passed in is returned + assertEq(USER.balance, DEFAULT_NATIVE_MINT_QUANTITY); + } + + function test_processFeeWithDiscountEmitsEvent() public { + //simulate a deposit of link for the conversion pool + mintLink(address(feeManager), DEFAULT_REPORT_LINK_FEE); + + //set the subscriber discount to 50% + setSubscriberDiscount(USER, DEFAULT_FEED_1_V3, address(native), FEE_SCALAR / 2, ADMIN); + + //approve the native to be transferred from the user + approveNative(address(feeManager), DEFAULT_REPORT_NATIVE_FEE / 2, USER); + + //get the default payload + bytes memory payload = getPayload(getV3Report(DEFAULT_FEED_1_V3)); + + Common.Asset memory fee = getFee(getV3Report(DEFAULT_FEED_1_V3), getNativeQuote(), USER); + Common.Asset memory reward = getReward(getV3Report(DEFAULT_FEED_1_V3), getNativeQuote(), USER); + uint256 appliedDiscount = getAppliedDiscount(getV3Report(DEFAULT_FEED_1_V3), getNativeQuote(), USER); + + vm.expectEmit(); + + emit DiscountApplied(DEFAULT_CONFIG_DIGEST, USER, fee, reward, appliedDiscount); + + //call processFee should not revert as the fee is 0 + processFee(DEFAULT_CONFIG_DIGEST, payload, USER, address(native), 0); + } + + function test_processFeeWithNoDiscountDoesNotEmitEvent() public { + //simulate a deposit of link for the conversion pool + mintLink(address(feeManager), DEFAULT_REPORT_LINK_FEE); + + //approve the native to be transferred from the user + approveNative(address(feeManager), DEFAULT_REPORT_NATIVE_FEE, USER); + + //get the default payload + bytes memory payload = getPayload(getV3Report(DEFAULT_FEED_1_V3)); + + //call processFee should not revert as the fee is 0 + processFee(DEFAULT_CONFIG_DIGEST, payload, USER, address(native), 0); + + //no logs should have been emitted + assertEq(vm.getRecordedLogs().length, 0); + } +} diff --git a/contracts/src/v0.8/llo-feeds/v0.4.0/test/fee-manager/DestinationFeeManager.processFeeBulk.t.sol b/contracts/src/v0.8/llo-feeds/v0.4.0/test/fee-manager/DestinationFeeManager.processFeeBulk.t.sol new file mode 100644 index 00000000000..a50441bed67 --- /dev/null +++ b/contracts/src/v0.8/llo-feeds/v0.4.0/test/fee-manager/DestinationFeeManager.processFeeBulk.t.sol @@ -0,0 +1,310 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity 0.8.19; + +import "./BaseDestinationFeeManager.t.sol"; +import {IDestinationRewardManager} from "../../interfaces/IDestinationRewardManager.sol"; + +/** + * @title BaseFeeManagerTest + * @author Michael Fletcher + * @notice This contract will test the functionality of the feeManager processFee + */ +contract DestinationFeeManagerProcessFeeTest is BaseDestinationFeeManagerTest { + uint256 internal constant NUMBER_OF_REPORTS = 5; + + function setUp() public override { + super.setUp(); + } + + function test_processMultipleLinkReports() public { + bytes memory payload = getPayload(getV3Report(DEFAULT_FEED_1_V3)); + + bytes[] memory payloads = new bytes[](NUMBER_OF_REPORTS); + for (uint256 i = 0; i < NUMBER_OF_REPORTS; ++i) { + payloads[i] = payload; + } + + bytes32[] memory poolIds = new bytes32[](NUMBER_OF_REPORTS); + for (uint256 i = 0; i < NUMBER_OF_REPORTS; ++i) { + poolIds[i] = DEFAULT_CONFIG_DIGEST; + } + + approveLink(address(rewardManager), DEFAULT_REPORT_LINK_FEE * NUMBER_OF_REPORTS, USER); + + processFee(poolIds, payloads, USER, address(link), DEFAULT_NATIVE_MINT_QUANTITY); + + assertEq(getLinkBalance(address(rewardManager)), DEFAULT_REPORT_LINK_FEE * NUMBER_OF_REPORTS); + assertEq(getLinkBalance(address(feeManager)), 0); + assertEq(getLinkBalance(USER), DEFAULT_LINK_MINT_QUANTITY - DEFAULT_REPORT_LINK_FEE * NUMBER_OF_REPORTS); + + //the subscriber (user) should receive funds back and not the proxy, although when live the proxy will forward the funds sent and not cover it seen here + assertEq(USER.balance, DEFAULT_NATIVE_MINT_QUANTITY); + assertEq(PROXY.balance, DEFAULT_NATIVE_MINT_QUANTITY); + } + + function test_processMultipleWrappedNativeReports() public { + mintLink(address(feeManager), DEFAULT_REPORT_LINK_FEE * NUMBER_OF_REPORTS + 1); + + bytes memory payload = getPayload(getV3Report(DEFAULT_FEED_1_V3)); + + bytes[] memory payloads = new bytes[](NUMBER_OF_REPORTS); + for (uint256 i; i < NUMBER_OF_REPORTS; ++i) { + payloads[i] = payload; + } + + bytes32[] memory poolIds = new bytes32[](NUMBER_OF_REPORTS); + for (uint256 i = 0; i < NUMBER_OF_REPORTS; ++i) { + poolIds[i] = DEFAULT_CONFIG_DIGEST; + } + + approveNative(address(feeManager), DEFAULT_REPORT_NATIVE_FEE * NUMBER_OF_REPORTS, USER); + + processFee(poolIds, payloads, USER, address(native), 0); + + assertEq(getNativeBalance(address(feeManager)), DEFAULT_REPORT_NATIVE_FEE * NUMBER_OF_REPORTS); + assertEq(getLinkBalance(address(rewardManager)), DEFAULT_REPORT_LINK_FEE * NUMBER_OF_REPORTS); + assertEq(getLinkBalance(address(feeManager)), 1); + assertEq(getNativeBalance(USER), DEFAULT_NATIVE_MINT_QUANTITY - DEFAULT_REPORT_NATIVE_FEE * NUMBER_OF_REPORTS); + } + + function test_processMultipleUnwrappedNativeReports() public { + mintLink(address(feeManager), DEFAULT_REPORT_LINK_FEE * NUMBER_OF_REPORTS + 1); + + bytes memory payload = getPayload(getV3Report(DEFAULT_FEED_1_V3)); + + bytes[] memory payloads = new bytes[](NUMBER_OF_REPORTS); + for (uint256 i; i < NUMBER_OF_REPORTS; ++i) { + payloads[i] = payload; + } + + bytes32[] memory poolIds = new bytes32[](NUMBER_OF_REPORTS); + for (uint256 i = 0; i < NUMBER_OF_REPORTS; ++i) { + poolIds[i] = DEFAULT_CONFIG_DIGEST; + } + + processFee(poolIds, payloads, USER, address(native), DEFAULT_REPORT_NATIVE_FEE * NUMBER_OF_REPORTS * 2); + + assertEq(getNativeBalance(address(feeManager)), DEFAULT_REPORT_NATIVE_FEE * NUMBER_OF_REPORTS); + assertEq(getLinkBalance(address(rewardManager)), DEFAULT_REPORT_LINK_FEE * NUMBER_OF_REPORTS); + assertEq(getLinkBalance(address(feeManager)), 1); + + assertEq(PROXY.balance, DEFAULT_NATIVE_MINT_QUANTITY); + assertEq(USER.balance, DEFAULT_NATIVE_MINT_QUANTITY - DEFAULT_REPORT_NATIVE_FEE * NUMBER_OF_REPORTS); + } + + function test_processV1V2V3Reports() public { + mintLink(address(feeManager), 1); + + bytes memory payloadV1 = abi.encode( + [DEFAULT_CONFIG_DIGEST, 0, 0], + getV1Report(DEFAULT_FEED_1_V1), + new bytes32[](1), + new bytes32[](1), + bytes32("") + ); + + bytes memory linkPayloadV2 = getPayload(getV2Report(DEFAULT_FEED_1_V2)); + bytes memory linkPayloadV3 = getPayload(getV3Report(DEFAULT_FEED_1_V3)); + + bytes[] memory payloads = new bytes[](5); + payloads[0] = payloadV1; + payloads[1] = linkPayloadV2; + payloads[2] = linkPayloadV2; + payloads[3] = linkPayloadV3; + payloads[4] = linkPayloadV3; + + approveLink(address(rewardManager), DEFAULT_REPORT_LINK_FEE * 4, USER); + + bytes32[] memory poolIds = new bytes32[](5); + for (uint256 i = 0; i < 5; ++i) { + poolIds[i] = DEFAULT_CONFIG_DIGEST; + } + + processFee(poolIds, payloads, USER, address(link), 0); + + assertEq(getNativeBalance(address(feeManager)), 0); + assertEq(getLinkBalance(address(rewardManager)), DEFAULT_REPORT_LINK_FEE * 4); + assertEq(getLinkBalance(address(feeManager)), 1); + + assertEq(getLinkBalance(USER), DEFAULT_LINK_MINT_QUANTITY - DEFAULT_REPORT_LINK_FEE * 4); + assertEq(getNativeBalance(USER), DEFAULT_NATIVE_MINT_QUANTITY - 0); + } + + function test_processV1V2V3ReportsWithUnwrapped() public { + mintLink(address(feeManager), DEFAULT_REPORT_LINK_FEE * 4 + 1); + + bytes memory payloadV1 = abi.encode( + [DEFAULT_CONFIG_DIGEST, 0, 0], + getV1Report(DEFAULT_FEED_1_V1), + new bytes32[](1), + new bytes32[](1), + bytes32("") + ); + + bytes memory nativePayloadV2 = getPayload(getV2Report(DEFAULT_FEED_1_V2)); + bytes memory nativePayloadV3 = getPayload(getV3Report(DEFAULT_FEED_1_V3)); + + bytes[] memory payloads = new bytes[](5); + payloads[0] = payloadV1; + payloads[1] = nativePayloadV2; + payloads[2] = nativePayloadV2; + payloads[3] = nativePayloadV3; + payloads[4] = nativePayloadV3; + + bytes32[] memory poolIds = new bytes32[](5); + for (uint256 i = 0; i < 5; ++i) { + poolIds[i] = DEFAULT_CONFIG_DIGEST; + } + + processFee(poolIds, payloads, USER, address(native), DEFAULT_REPORT_NATIVE_FEE * 4); + + assertEq(getNativeBalance(address(feeManager)), DEFAULT_REPORT_NATIVE_FEE * 4); + assertEq(getLinkBalance(address(rewardManager)), DEFAULT_REPORT_LINK_FEE * 4); + assertEq(getLinkBalance(address(feeManager)), 1); + + assertEq(USER.balance, DEFAULT_NATIVE_MINT_QUANTITY - DEFAULT_REPORT_NATIVE_FEE * 4); + assertEq(PROXY.balance, DEFAULT_NATIVE_MINT_QUANTITY); + } + + function test_processMultipleV1Reports() public { + bytes memory payload = abi.encode( + [DEFAULT_CONFIG_DIGEST, 0, 0], + getV1Report(DEFAULT_FEED_1_V1), + new bytes32[](1), + new bytes32[](1), + bytes32("") + ); + + bytes[] memory payloads = new bytes[](NUMBER_OF_REPORTS); + for (uint256 i = 0; i < NUMBER_OF_REPORTS; ++i) { + payloads[i] = payload; + } + + bytes32[] memory poolIds = new bytes32[](NUMBER_OF_REPORTS); + for (uint256 i = 0; i < NUMBER_OF_REPORTS; ++i) { + poolIds[i] = DEFAULT_CONFIG_DIGEST; + } + + processFee(poolIds, payloads, USER, address(native), DEFAULT_REPORT_NATIVE_FEE * 5); + + assertEq(USER.balance, DEFAULT_NATIVE_MINT_QUANTITY); + assertEq(PROXY.balance, DEFAULT_NATIVE_MINT_QUANTITY); + } + + function test_eventIsEmittedIfNotEnoughLink() public { + bytes memory nativePayload = getPayload(getV3Report(DEFAULT_FEED_1_V3)); + + bytes[] memory payloads = new bytes[](5); + payloads[0] = nativePayload; + payloads[1] = nativePayload; + payloads[2] = nativePayload; + payloads[3] = nativePayload; + payloads[4] = nativePayload; + + approveNative(address(feeManager), DEFAULT_REPORT_NATIVE_FEE * 5, USER); + + IDestinationRewardManager.FeePayment[] memory payments = new IDestinationRewardManager.FeePayment[](5); + payments[0] = IDestinationRewardManager.FeePayment(DEFAULT_CONFIG_DIGEST, uint192(DEFAULT_REPORT_LINK_FEE)); + payments[1] = IDestinationRewardManager.FeePayment(DEFAULT_CONFIG_DIGEST, uint192(DEFAULT_REPORT_LINK_FEE)); + payments[2] = IDestinationRewardManager.FeePayment(DEFAULT_CONFIG_DIGEST, uint192(DEFAULT_REPORT_LINK_FEE)); + payments[3] = IDestinationRewardManager.FeePayment(DEFAULT_CONFIG_DIGEST, uint192(DEFAULT_REPORT_LINK_FEE)); + payments[4] = IDestinationRewardManager.FeePayment(DEFAULT_CONFIG_DIGEST, uint192(DEFAULT_REPORT_LINK_FEE)); + + vm.expectEmit(); + + bytes32[] memory poolIds = new bytes32[](5); + for (uint256 i = 0; i < 5; ++i) { + poolIds[i] = payments[i].poolId; + } + + emit InsufficientLink(payments); + + processFee(poolIds, payloads, USER, address(native), 0); + + assertEq(getNativeBalance(address(feeManager)), DEFAULT_REPORT_NATIVE_FEE * 5); + assertEq(getNativeBalance(USER), DEFAULT_NATIVE_MINT_QUANTITY - DEFAULT_REPORT_NATIVE_FEE * 5); + assertEq(getLinkBalance(USER), DEFAULT_LINK_MINT_QUANTITY); + } + + function test_processPoolIdsPassedMismatched() public { + mintLink(address(feeManager), DEFAULT_REPORT_LINK_FEE * NUMBER_OF_REPORTS + 1); + + bytes memory payload = getPayload(getV3Report(DEFAULT_FEED_1_V3)); + + bytes[] memory payloads = new bytes[](NUMBER_OF_REPORTS); + for (uint256 i; i < NUMBER_OF_REPORTS; ++i) { + payloads[i] = payload; + } + + // poolIds passed are different that number of reports in payload + bytes32[] memory poolIds = new bytes32[](NUMBER_OF_REPORTS - 1); + for (uint256 i = 0; i < NUMBER_OF_REPORTS - 1; ++i) { + poolIds[i] = DEFAULT_CONFIG_DIGEST; + } + + vm.expectRevert(POOLID_MISMATCH_ERROR); + processFee(poolIds, payloads, USER, address(native), DEFAULT_REPORT_NATIVE_FEE * NUMBER_OF_REPORTS * 2); + } + + function test_poolIdsCannotBeZeroAddress() public { + mintLink(address(feeManager), DEFAULT_REPORT_LINK_FEE * NUMBER_OF_REPORTS + 1); + + bytes memory payload = getPayload(getV3Report(DEFAULT_FEED_1_V3)); + + bytes[] memory payloads = new bytes[](NUMBER_OF_REPORTS); + for (uint256 i; i < NUMBER_OF_REPORTS; ++i) { + payloads[i] = payload; + } + + bytes32[] memory poolIds = new bytes32[](NUMBER_OF_REPORTS); + for (uint256 i = 0; i < NUMBER_OF_REPORTS; ++i) { + poolIds[i] = DEFAULT_CONFIG_DIGEST; + } + + poolIds[2] = 0x000; + vm.expectRevert(INVALID_ADDRESS_ERROR); + processFee(poolIds, payloads, USER, address(native), DEFAULT_REPORT_NATIVE_FEE * NUMBER_OF_REPORTS * 2); + } + + function test_rewardsAreCorrectlySentToEachAssociatedPoolWhenVerifyingInBulk() public { + bytes memory payload = getPayload(getV3Report(DEFAULT_FEED_1_V3)); + + bytes[] memory payloads = new bytes[](NUMBER_OF_REPORTS); + for (uint256 i = 0; i < NUMBER_OF_REPORTS; ++i) { + payloads[i] = payload; + } + + bytes32[] memory poolIds = new bytes32[](NUMBER_OF_REPORTS); + for (uint256 i = 0; i < NUMBER_OF_REPORTS - 1; ++i) { + poolIds[i] = DEFAULT_CONFIG_DIGEST; + } + poolIds[NUMBER_OF_REPORTS - 1] = DEFAULT_CONFIG_DIGEST2; + + approveLink(address(rewardManager), DEFAULT_REPORT_LINK_FEE * NUMBER_OF_REPORTS, USER); + + // Checking no rewards yet for each pool + for (uint256 i = 0; i < NUMBER_OF_REPORTS; ++i) { + bytes32 p_id = poolIds[i]; + uint256 poolDeficit = rewardManager.s_totalRewardRecipientFees(p_id); + assertEq(poolDeficit, 0); + } + + processFee(poolIds, payloads, USER, address(link), DEFAULT_NATIVE_MINT_QUANTITY); + + assertEq(getLinkBalance(address(rewardManager)), DEFAULT_REPORT_LINK_FEE * NUMBER_OF_REPORTS); + assertEq(getLinkBalance(address(feeManager)), 0); + assertEq(getLinkBalance(USER), DEFAULT_LINK_MINT_QUANTITY - DEFAULT_REPORT_LINK_FEE * NUMBER_OF_REPORTS); + + assertEq(USER.balance, DEFAULT_NATIVE_MINT_QUANTITY); + assertEq(PROXY.balance, DEFAULT_NATIVE_MINT_QUANTITY); + + // Checking each pool got the correct rewards + uint256 expectedRewards = DEFAULT_REPORT_LINK_FEE * (NUMBER_OF_REPORTS - 1); + uint256 poolRewards = rewardManager.s_totalRewardRecipientFees(DEFAULT_CONFIG_DIGEST); + assertEq(poolRewards, expectedRewards); + + expectedRewards = DEFAULT_REPORT_LINK_FEE; + poolRewards = rewardManager.s_totalRewardRecipientFees(DEFAULT_CONFIG_DIGEST2); + assertEq(poolRewards, expectedRewards); + } +} diff --git a/contracts/src/v0.8/llo-feeds/v0.4.0/test/mocks/DestinationFeeManagerProxy.sol b/contracts/src/v0.8/llo-feeds/v0.4.0/test/mocks/DestinationFeeManagerProxy.sol new file mode 100644 index 00000000000..7dde878321e --- /dev/null +++ b/contracts/src/v0.8/llo-feeds/v0.4.0/test/mocks/DestinationFeeManagerProxy.sol @@ -0,0 +1,24 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.19; + +import {IDestinationVerifierFeeManager} from "../../interfaces/IDestinationVerifierFeeManager.sol"; + +contract DestinationFeeManagerProxy { + IDestinationVerifierFeeManager internal s_feeManager; + + function processFee(bytes32 poolId, bytes calldata payload, bytes calldata parameterPayload) public payable { + s_feeManager.processFee{value: msg.value}(poolId, payload, parameterPayload, msg.sender); + } + + function processFeeBulk( + bytes32[] memory poolIds, + bytes[] calldata payloads, + bytes calldata parameterPayload + ) public payable { + s_feeManager.processFeeBulk{value: msg.value}(poolIds, payloads, parameterPayload, msg.sender); + } + + function setDestinationFeeManager(address feeManager) public { + s_feeManager = IDestinationVerifierFeeManager(feeManager); + } +} diff --git a/contracts/src/v0.8/llo-feeds/v0.4.0/test/reward-manager/BaseDestinationRewardManager.t.sol b/contracts/src/v0.8/llo-feeds/v0.4.0/test/reward-manager/BaseDestinationRewardManager.t.sol new file mode 100644 index 00000000000..7cafb1629db --- /dev/null +++ b/contracts/src/v0.8/llo-feeds/v0.4.0/test/reward-manager/BaseDestinationRewardManager.t.sol @@ -0,0 +1,264 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity 0.8.19; + +import {Test} from "forge-std/Test.sol"; +import {ERC20Mock} from "../../../../vendor/openzeppelin-solidity/v4.8.3/contracts/mocks/ERC20Mock.sol"; +import {DestinationRewardManager} from "../../../v0.4.0/DestinationRewardManager.sol"; +import {Common} from "../../../libraries/Common.sol"; +import {IDestinationRewardManager} from "../../interfaces/IDestinationRewardManager.sol"; + +/** + * @title DestinationRewardManagerTest + * @author Michael Fletcher + * @notice Base class for all reward manager tests + * @dev This contract is intended to be inherited from and not used directly. It contains functionality to setup a primary and secondary pool + */ +contract BaseDestinationRewardManagerTest is Test { + //contracts + ERC20Mock internal asset; + ERC20Mock internal unsupported; + DestinationRewardManager internal rewardManager; + + //default address for unregistered recipient + address internal constant INVALID_ADDRESS = address(0); + //contract owner + address internal constant ADMIN = address(uint160(uint256(keccak256("ADMIN")))); + //address to represent feeManager contract + address internal constant FEE_MANAGER = address(uint160(uint256(keccak256("FEE_MANAGER")))); + //address to represent another feeManager + address internal constant FEE_MANAGER_2 = address(uint160(uint256(keccak256("FEE_MANAGER_2")))); + //a general user + address internal constant USER = address(uint160(uint256(keccak256("USER")))); + + //default recipients configured in reward manager + address internal constant DEFAULT_RECIPIENT_1 = address(uint160(uint256(keccak256("DEFAULT_RECIPIENT_1")))); + address internal constant DEFAULT_RECIPIENT_2 = address(uint160(uint256(keccak256("DEFAULT_RECIPIENT_2")))); + address internal constant DEFAULT_RECIPIENT_3 = address(uint160(uint256(keccak256("DEFAULT_RECIPIENT_3")))); + address internal constant DEFAULT_RECIPIENT_4 = address(uint160(uint256(keccak256("DEFAULT_RECIPIENT_4")))); + address internal constant DEFAULT_RECIPIENT_5 = address(uint160(uint256(keccak256("DEFAULT_RECIPIENT_5")))); + address internal constant DEFAULT_RECIPIENT_6 = address(uint160(uint256(keccak256("DEFAULT_RECIPIENT_6")))); + address internal constant DEFAULT_RECIPIENT_7 = address(uint160(uint256(keccak256("DEFAULT_RECIPIENT_7")))); + + //additional recipients not in the reward manager + address internal constant DEFAULT_RECIPIENT_8 = address(uint160(uint256(keccak256("DEFAULT_RECIPIENT_8")))); + address internal constant DEFAULT_RECIPIENT_9 = address(uint160(uint256(keccak256("DEFAULT_RECIPIENT_9")))); + + //two pools should be enough to test all edge cases + bytes32 internal constant PRIMARY_POOL_ID = keccak256("primary_pool"); + bytes32 internal constant SECONDARY_POOL_ID = keccak256("secondary_pool"); + bytes32 internal constant INVALID_POOL_ID = keccak256("invalid_pool"); + bytes32 internal constant ZERO_POOL_ID = bytes32(0); + + //convenience arrays of all pool combinations used for testing + bytes32[] internal PRIMARY_POOL_ARRAY = [PRIMARY_POOL_ID]; + bytes32[] internal SECONDARY_POOL_ARRAY = [SECONDARY_POOL_ID]; + bytes32[] internal ALL_POOLS = [PRIMARY_POOL_ID, SECONDARY_POOL_ID]; + + //erc20 config + uint256 internal constant DEFAULT_MINT_QUANTITY = 100 ether; + + //reward scalar (this should match the const in the contract) + uint64 internal constant POOL_SCALAR = 1e18; + uint64 internal constant ONE_PERCENT = POOL_SCALAR / 100; + uint64 internal constant FIFTY_PERCENT = POOL_SCALAR / 2; + uint64 internal constant TEN_PERCENT = POOL_SCALAR / 10; + + //the selector for each error + bytes4 internal immutable UNAUTHORIZED_ERROR_SELECTOR = DestinationRewardManager.Unauthorized.selector; + bytes4 internal immutable INVALID_ADDRESS_ERROR_SELECTOR = DestinationRewardManager.InvalidAddress.selector; + bytes4 internal immutable INVALID_WEIGHT_ERROR_SELECTOR = DestinationRewardManager.InvalidWeights.selector; + bytes4 internal immutable INVALID_POOL_ID_ERROR_SELECTOR = DestinationRewardManager.InvalidPoolId.selector; + bytes internal constant ONLY_CALLABLE_BY_OWNER_ERROR = "Only callable by owner"; + bytes4 internal immutable INVALID_POOL_LENGTH_SELECTOR = DestinationRewardManager.InvalidPoolLength.selector; + + // Events emitted within the reward manager + event RewardRecipientsUpdated(bytes32 indexed poolId, Common.AddressAndWeight[] newRewardRecipients); + event RewardsClaimed(bytes32 indexed poolId, address indexed recipient, uint192 quantity); + event FeeManagerUpdated(address newProxyAddress); + event FeePaid(IDestinationRewardManager.FeePayment[] payments, address payee); + + function setUp() public virtual { + //change to admin user + vm.startPrank(ADMIN); + + //init required contracts + _initializeERC20Contracts(); + _initializeRewardManager(); + } + + function _initializeERC20Contracts() internal { + //create the contracts + asset = new ERC20Mock("ASSET", "AST", ADMIN, 0); + unsupported = new ERC20Mock("UNSUPPORTED", "UNS", ADMIN, 0); + + //mint some tokens to the admin + asset.mint(ADMIN, DEFAULT_MINT_QUANTITY); + unsupported.mint(ADMIN, DEFAULT_MINT_QUANTITY); + + //mint some tokens to the user + asset.mint(FEE_MANAGER, DEFAULT_MINT_QUANTITY); + unsupported.mint(FEE_MANAGER, DEFAULT_MINT_QUANTITY); + } + + function _initializeRewardManager() internal { + //create the contract + rewardManager = new DestinationRewardManager(address(asset)); + + rewardManager.addFeeManager(FEE_MANAGER); + } + + function createPrimaryPool() public { + rewardManager.setRewardRecipients(PRIMARY_POOL_ID, getPrimaryRecipients()); + } + + function createSecondaryPool() public { + rewardManager.setRewardRecipients(SECONDARY_POOL_ID, getSecondaryRecipients()); + } + + //override this to test variations of different recipients. changing this function will require existing tests to be updated as constants are hardcoded to be explicit + function getPrimaryRecipients() public virtual returns (Common.AddressAndWeight[] memory) { + //array of recipients + Common.AddressAndWeight[] memory recipients = new Common.AddressAndWeight[](4); + + //init each recipient with even weights. 2500 = 25% of pool + recipients[0] = Common.AddressAndWeight(DEFAULT_RECIPIENT_1, POOL_SCALAR / 4); + recipients[1] = Common.AddressAndWeight(DEFAULT_RECIPIENT_2, POOL_SCALAR / 4); + recipients[2] = Common.AddressAndWeight(DEFAULT_RECIPIENT_3, POOL_SCALAR / 4); + recipients[3] = Common.AddressAndWeight(DEFAULT_RECIPIENT_4, POOL_SCALAR / 4); + + return recipients; + } + + function getPrimaryRecipientAddresses() public pure returns (address[] memory) { + //array of recipients + address[] memory recipients = new address[](4); + + recipients[0] = DEFAULT_RECIPIENT_1; + recipients[1] = DEFAULT_RECIPIENT_2; + recipients[2] = DEFAULT_RECIPIENT_3; + recipients[3] = DEFAULT_RECIPIENT_4; + + return recipients; + } + + //override this to test variations of different recipients. + function getSecondaryRecipients() public virtual returns (Common.AddressAndWeight[] memory) { + //array of recipients + Common.AddressAndWeight[] memory recipients = new Common.AddressAndWeight[](4); + + //init each recipient with even weights. 2500 = 25% of pool + recipients[0] = Common.AddressAndWeight(DEFAULT_RECIPIENT_1, POOL_SCALAR / 4); + recipients[1] = Common.AddressAndWeight(DEFAULT_RECIPIENT_5, POOL_SCALAR / 4); + recipients[2] = Common.AddressAndWeight(DEFAULT_RECIPIENT_6, POOL_SCALAR / 4); + recipients[3] = Common.AddressAndWeight(DEFAULT_RECIPIENT_7, POOL_SCALAR / 4); + + return recipients; + } + + function getSecondaryRecipientAddresses() public pure returns (address[] memory) { + //array of recipients + address[] memory recipients = new address[](4); + + recipients[0] = DEFAULT_RECIPIENT_1; + recipients[1] = DEFAULT_RECIPIENT_5; + recipients[2] = DEFAULT_RECIPIENT_6; + recipients[3] = DEFAULT_RECIPIENT_7; + + return recipients; + } + + function addFundsToPool(bytes32 poolId, Common.Asset memory amount, address sender) public { + IDestinationRewardManager.FeePayment[] memory payments = new IDestinationRewardManager.FeePayment[](1); + payments[0] = IDestinationRewardManager.FeePayment(poolId, uint192(amount.amount)); + + addFundsToPool(payments, sender); + } + + function addFundsToPool(IDestinationRewardManager.FeePayment[] memory payments, address sender) public { + //record the current address and switch to the sender + address originalAddr = msg.sender; + changePrank(sender); + + uint256 totalPayment; + for (uint256 i; i < payments.length; ++i) { + totalPayment += payments[i].amount; + } + + //approve the amount being paid into the pool + ERC20Mock(address(asset)).approve(address(rewardManager), totalPayment); + + //this represents the verifier adding some funds to the pool + rewardManager.onFeePaid(payments, sender); + + //change back to the original address + changePrank(originalAddr); + } + + function getAsset(uint256 quantity) public view returns (Common.Asset memory) { + return Common.Asset(address(asset), quantity); + } + + function getAssetBalance(address addr) public view returns (uint256) { + return asset.balanceOf(addr); + } + + function claimRewards(bytes32[] memory poolIds, address sender) public { + //record the current address and switch to the recipient + address originalAddr = msg.sender; + changePrank(sender); + + //claim the rewards + rewardManager.claimRewards(poolIds); + + //change back to the original address + changePrank(originalAddr); + } + + function payRecipients(bytes32 poolId, address[] memory recipients, address sender) public { + //record the current address and switch to the recipient + address originalAddr = msg.sender; + changePrank(sender); + + //pay the recipients + rewardManager.payRecipients(poolId, recipients); + + //change back to the original address + changePrank(originalAddr); + } + + function setRewardRecipients(bytes32 poolId, Common.AddressAndWeight[] memory recipients, address sender) public { + //record the current address and switch to the recipient + address originalAddr = msg.sender; + changePrank(sender); + + //pay the recipients + rewardManager.setRewardRecipients(poolId, recipients); + + //change back to the original address + changePrank(originalAddr); + } + + function setFeeManager(address feeManager, address sender) public { + //record the current address and switch to the recipient + address originalAddr = msg.sender; + changePrank(sender); + + //update the proxy + rewardManager.addFeeManager(feeManager); + + //change back to the original address + changePrank(originalAddr); + } + + function updateRewardRecipients(bytes32 poolId, Common.AddressAndWeight[] memory recipients, address sender) public { + //record the current address and switch to the recipient + address originalAddr = msg.sender; + changePrank(sender); + + //pay the recipients + rewardManager.updateRewardRecipients(poolId, recipients); + + //change back to the original address + changePrank(originalAddr); + } +} diff --git a/contracts/src/v0.8/llo-feeds/v0.4.0/test/reward-manager/DestinationRewardManager.claim.t.sol b/contracts/src/v0.8/llo-feeds/v0.4.0/test/reward-manager/DestinationRewardManager.claim.t.sol new file mode 100644 index 00000000000..c0a67d08758 --- /dev/null +++ b/contracts/src/v0.8/llo-feeds/v0.4.0/test/reward-manager/DestinationRewardManager.claim.t.sol @@ -0,0 +1,790 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity 0.8.19; + +import {BaseDestinationRewardManagerTest} from "./BaseDestinationRewardManager.t.sol"; +import {Common} from "../../../libraries/Common.sol"; + +/** + * @title DestinationRewardManagerClaimTest + * @author Michael Fletcher + * @notice This contract will test the claim functionality of the RewardManager contract. + */ +contract DestinationRewardManagerClaimTest is BaseDestinationRewardManagerTest { + uint256 internal constant POOL_DEPOSIT_AMOUNT = 10e18; + + function setUp() public override { + //setup contracts + super.setUp(); + + //create a single pool for these tests + createPrimaryPool(); + + //add funds to the pool to be split among the recipients + addFundsToPool(PRIMARY_POOL_ID, getAsset(POOL_DEPOSIT_AMOUNT), FEE_MANAGER); + } + + function test_claimAllRecipients() public { + //expected recipient amount is 1/4 of the pool deposit + uint256 expectedRecipientAmount = POOL_DEPOSIT_AMOUNT / 4; + + //claim funds for each recipient within the pool + for (uint256 i; i < getPrimaryRecipients().length; i++) { + //get the recipient that is claiming + Common.AddressAndWeight memory recipient = getPrimaryRecipients()[i]; + + //claim the individual rewards for each recipient + claimRewards(PRIMARY_POOL_ARRAY, recipient.addr); + + //check the balance matches the ratio the recipient should have received + assertEq(getAssetBalance(recipient.addr), expectedRecipientAmount); + } + } + + function test_claimRewardsWithDuplicatePoolIdsDoesNotPayoutTwice() public { + //add funds to a different pool to ensure they're not claimed + addFundsToPool(SECONDARY_POOL_ID, getAsset(POOL_DEPOSIT_AMOUNT), FEE_MANAGER); + + //expected recipient amount is 1/4 of the pool deposit + uint256 expectedRecipientAmount = POOL_DEPOSIT_AMOUNT / 4; + + //create an array containing duplicate poolIds + bytes32[] memory poolIds = new bytes32[](2); + poolIds[0] = PRIMARY_POOL_ID; + poolIds[1] = PRIMARY_POOL_ID; + + //claim funds for each recipient within the pool + for (uint256 i; i < getPrimaryRecipients().length; i++) { + //get the recipient that is claiming + Common.AddressAndWeight memory recipient = getPrimaryRecipients()[i]; + + //claim the individual rewards for each recipient + claimRewards(poolIds, recipient.addr); + + //check the balance matches the ratio the recipient should have received + assertEq(getAssetBalance(recipient.addr), expectedRecipientAmount); + } + + //the pool should still have the remaining + assertEq(getAssetBalance(address(rewardManager)), POOL_DEPOSIT_AMOUNT); + } + + function test_claimSingleRecipient() public { + //get the recipient that is claiming + Common.AddressAndWeight memory recipient = getPrimaryRecipients()[0]; + + //claim the individual rewards for this recipient + claimRewards(PRIMARY_POOL_ARRAY, recipient.addr); + + //expected recipient amount is 1/4 of the pool deposit + uint256 expectedRecipientAmount = POOL_DEPOSIT_AMOUNT / 4; + + //check the recipients balance matches the ratio the recipient should have received + assertEq(getAssetBalance(recipient.addr), expectedRecipientAmount); + + //check the rewardManager has the remaining quantity + assertEq(getAssetBalance(address(rewardManager)), POOL_DEPOSIT_AMOUNT - expectedRecipientAmount); + } + + function test_claimMultipleRecipients() public { + //claim the individual rewards for each recipient + claimRewards(PRIMARY_POOL_ARRAY, getPrimaryRecipients()[0].addr); + claimRewards(PRIMARY_POOL_ARRAY, getPrimaryRecipients()[1].addr); + + //expected recipient amount is 1/4 of the pool deposit + uint256 expectedRecipientAmount = POOL_DEPOSIT_AMOUNT / 4; + + //check the recipients balance matches the ratio the recipient should have received + assertEq(getAssetBalance(getPrimaryRecipients()[0].addr), expectedRecipientAmount); + assertEq(getAssetBalance(getPrimaryRecipients()[1].addr), expectedRecipientAmount); + + //check the rewardManager has the remaining quantity + assertEq(getAssetBalance(address(rewardManager)), POOL_DEPOSIT_AMOUNT - (expectedRecipientAmount * 2)); + } + + function test_claimUnregisteredRecipient() public { + //claim the rewards for a recipient who isn't in this pool + claimRewards(PRIMARY_POOL_ARRAY, getSecondaryRecipients()[1].addr); + + //check the recipients didn't receive any fees from this pool + assertEq(getAssetBalance(getSecondaryRecipients()[1].addr), 0); + + //check the rewardManager has the remaining quantity + assertEq(getAssetBalance(address(rewardManager)), POOL_DEPOSIT_AMOUNT); + } + + function test_claimUnevenAmountRoundsDown() public { + //adding 1 to the pool should leave 1 wei worth of dust, which the contract doesn't handle due to it being economically infeasible + addFundsToPool(PRIMARY_POOL_ID, getAsset(1), FEE_MANAGER); + + //expected recipient amount is 1/4 of the pool deposit + uint256 expectedRecipientAmount = POOL_DEPOSIT_AMOUNT / 4; + + //claim funds for each recipient within the pool + for (uint256 i; i < getPrimaryRecipients().length; i++) { + //get the recipient that is claiming + Common.AddressAndWeight memory recipient = getPrimaryRecipients()[i]; + + //claim the individual rewards for each recipient + claimRewards(PRIMARY_POOL_ARRAY, recipient.addr); + + //check the balance matches the ratio the recipient should have received + assertEq(getAssetBalance(recipient.addr), expectedRecipientAmount); + } + + //check the rewardManager has the remaining quantity equals 1 wei + assertEq(getAssetBalance(address(rewardManager)), 1); + } + + function test_claimUnregisteredPoolId() public { + //get the recipient that is claiming + Common.AddressAndWeight memory recipient = getPrimaryRecipients()[0]; + + //claim the individual rewards for this recipient + claimRewards(SECONDARY_POOL_ARRAY, recipient.addr); + + //check the recipients balance is still 0 as there's no pool to receive fees from + assertEq(getAssetBalance(recipient.addr), 0); + + //check the rewardManager has the full amount + assertEq(getAssetBalance(address(rewardManager)), POOL_DEPOSIT_AMOUNT); + } + + function test_singleRecipientClaimMultipleDeposits() public { + //get the recipient that is claiming + Common.AddressAndWeight memory recipient = getPrimaryRecipients()[0]; + + //claim the individual rewards for this recipient + claimRewards(PRIMARY_POOL_ARRAY, recipient.addr); + + //expected recipient amount is 1/4 of the pool deposit + uint256 expectedRecipientAmount = POOL_DEPOSIT_AMOUNT / 4; + + //check the recipients balance matches the ratio the recipient should have received + assertEq(getAssetBalance(recipient.addr), expectedRecipientAmount); + + //check the rewardManager has the remaining quantity, which is 3/4 of the initial deposit + assertEq(getAssetBalance(address(rewardManager)), POOL_DEPOSIT_AMOUNT - expectedRecipientAmount); + + //add funds to the pool to be split among the recipients + addFundsToPool(PRIMARY_POOL_ID, getAsset(POOL_DEPOSIT_AMOUNT), FEE_MANAGER); + + //claim the individual rewards for this recipient + claimRewards(PRIMARY_POOL_ARRAY, recipient.addr); + + //check the recipients balance matches the ratio the recipient should have received, which is 1/4 of each deposit + assertEq(getAssetBalance(recipient.addr), expectedRecipientAmount * 2); + + //check the rewardManager has the remaining quantity, which is now 3/4 of both deposits + assertEq(getAssetBalance(address(rewardManager)), POOL_DEPOSIT_AMOUNT * 2 - (expectedRecipientAmount * 2)); + } + + function test_recipientsClaimMultipleDeposits() public { + //expected recipient amount is 1/4 of the pool deposit + uint256 expectedRecipientAmount = POOL_DEPOSIT_AMOUNT / 4; + + //claim funds for each recipient within the pool + for (uint256 i; i < getPrimaryRecipients().length; i++) { + //get the recipient that is claiming + Common.AddressAndWeight memory recipient = getPrimaryRecipients()[i]; + + //claim the individual rewards for each recipient + claimRewards(PRIMARY_POOL_ARRAY, recipient.addr); + + //check the balance matches the ratio the recipient should have received + assertEq(getAssetBalance(recipient.addr), expectedRecipientAmount); + } + + //the reward manager balance should be 0 as all of the funds have been claimed + assertEq(getAssetBalance(address(rewardManager)), 0); + + //add funds to the pool to be split among the recipients + addFundsToPool(PRIMARY_POOL_ID, getAsset(POOL_DEPOSIT_AMOUNT), FEE_MANAGER); + + //claim funds for each recipient within the pool + for (uint256 i; i < getPrimaryRecipients().length; i++) { + //get the recipient that is claiming + Common.AddressAndWeight memory recipient = getPrimaryRecipients()[i]; + + //claim the individual rewards for each recipient + claimRewards(PRIMARY_POOL_ARRAY, recipient.addr); + + //expected recipient amount is 1/4 of the pool deposit + expectedRecipientAmount = (POOL_DEPOSIT_AMOUNT / 4) * 2; + + //check the balance matches the ratio the recipient should have received + assertEq(getAssetBalance(recipient.addr), expectedRecipientAmount); + } + + //the reward manager balance should again be 0 as all of the funds have been claimed + assertEq(getAssetBalance(address(rewardManager)), 0); + } + + function test_eventIsEmittedUponClaim() public { + //get the recipient that is claiming + Common.AddressAndWeight memory recipient = getPrimaryRecipients()[0]; + + //expect an emit + vm.expectEmit(); + + //emit the event that is expected to be emitted + emit RewardsClaimed(PRIMARY_POOL_ID, recipient.addr, uint192(POOL_DEPOSIT_AMOUNT / 4)); + + //claim the individual rewards for each recipient + claimRewards(PRIMARY_POOL_ARRAY, recipient.addr); + } + + function test_eventIsNotEmittedUponUnsuccessfulClaim() public { + //record logs to check no events were emitted + vm.recordLogs(); + + //get the recipient that is claiming + Common.AddressAndWeight memory recipient = getPrimaryRecipients()[0]; + + //claim the individual rewards for each recipient + claimRewards(SECONDARY_POOL_ARRAY, recipient.addr); + + //no logs should have been emitted + assertEq(vm.getRecordedLogs().length, 0); + } +} + +contract DestinationRewardManagerRecipientClaimMultiplePoolsTest is BaseDestinationRewardManagerTest { + uint256 internal constant POOL_DEPOSIT_AMOUNT = 10e18; + + function setUp() public override { + //setup contracts + super.setUp(); + + //create a two pools + createPrimaryPool(); + createSecondaryPool(); + + //add funds to each of the pools to be split among the recipients + addFundsToPool(PRIMARY_POOL_ID, getAsset(POOL_DEPOSIT_AMOUNT), FEE_MANAGER); + addFundsToPool(SECONDARY_POOL_ID, getAsset(POOL_DEPOSIT_AMOUNT), FEE_MANAGER); + } + + function test_claimAllRecipientsSinglePool() public { + //expected recipient amount is 1/4 of the pool deposit + uint256 expectedRecipientAmount = POOL_DEPOSIT_AMOUNT / 4; + + //claim funds for each recipient within the pool + for (uint256 i; i < getPrimaryRecipients().length; i++) { + //get the recipient that is claiming + Common.AddressAndWeight memory recipient = getPrimaryRecipients()[i]; + + //claim the individual rewards for each recipient + claimRewards(PRIMARY_POOL_ARRAY, recipient.addr); + + //check the balance matches the ratio the recipient should have received + assertEq(getAssetBalance(recipient.addr), expectedRecipientAmount); + } + + //check the pool balance is still equal to DEPOSIT_AMOUNT as the test only claims for one of the pools + assertEq(getAssetBalance(address(rewardManager)), POOL_DEPOSIT_AMOUNT); + } + + function test_claimMultipleRecipientsSinglePool() public { + //claim the individual rewards for each recipient + claimRewards(SECONDARY_POOL_ARRAY, getSecondaryRecipients()[0].addr); + claimRewards(SECONDARY_POOL_ARRAY, getSecondaryRecipients()[1].addr); + + //expected recipient amount is 1/4 of the pool deposit + uint256 expectedRecipientAmount = POOL_DEPOSIT_AMOUNT / 4; + + //check the recipients balance matches the ratio the recipient should have received + assertEq(getAssetBalance(getSecondaryRecipients()[0].addr), expectedRecipientAmount); + assertEq(getAssetBalance(getSecondaryRecipients()[1].addr), expectedRecipientAmount); + + //check the rewardManager has the remaining quantity + assertEq(getAssetBalance(address(rewardManager)), POOL_DEPOSIT_AMOUNT * 2 - (expectedRecipientAmount * 2)); + } + + function test_claimMultipleRecipientsMultiplePools() public { + //claim the individual rewards for each recipient + claimRewards(PRIMARY_POOL_ARRAY, getPrimaryRecipients()[0].addr); + claimRewards(PRIMARY_POOL_ARRAY, getPrimaryRecipients()[1].addr); + claimRewards(SECONDARY_POOL_ARRAY, getSecondaryRecipients()[0].addr); + claimRewards(SECONDARY_POOL_ARRAY, getSecondaryRecipients()[1].addr); + + //expected recipient amount is 1/4 of the pool deposit + uint256 expectedRecipientAmount = POOL_DEPOSIT_AMOUNT / 4; + + //check the recipients balance matches the ratio the recipient should have received. The first recipient is shared across both pools so should receive 1/4 of each pool + assertEq(getAssetBalance(getPrimaryRecipients()[0].addr), expectedRecipientAmount * 2); + assertEq(getAssetBalance(getPrimaryRecipients()[1].addr), expectedRecipientAmount); + assertEq(getAssetBalance(getSecondaryRecipients()[1].addr), expectedRecipientAmount); + + //check the rewardManager has the remaining quantity + assertEq(getAssetBalance(address(rewardManager)), POOL_DEPOSIT_AMOUNT); + } + + function test_claimAllRecipientsMultiplePools() public { + //expected recipient amount is 1/4 of the pool deposit + uint256 expectedRecipientAmount = POOL_DEPOSIT_AMOUNT / 4; + + //claim funds for each recipient within the pool + for (uint256 i = 1; i < getPrimaryRecipients().length; i++) { + //get the recipient that is claiming + Common.AddressAndWeight memory recipient = getPrimaryRecipients()[i]; + + //claim the individual rewards for each recipient + claimRewards(PRIMARY_POOL_ARRAY, recipient.addr); + + //check the balance matches the ratio the recipient should have received + assertEq(getAssetBalance(recipient.addr), expectedRecipientAmount); + } + + //claim funds for each recipient within the pool + for (uint256 i = 1; i < getSecondaryRecipients().length; i++) { + //get the recipient that is claiming + Common.AddressAndWeight memory secondaryRecipient = getSecondaryRecipients()[i]; + + //claim the individual rewards for each recipient + claimRewards(SECONDARY_POOL_ARRAY, secondaryRecipient.addr); + + //check the balance matches the ratio the recipient should have received + assertEq(getAssetBalance(secondaryRecipient.addr), expectedRecipientAmount); + } + + //special case to handle the first recipient of each pool as they're the same address + Common.AddressAndWeight memory commonRecipient = getPrimaryRecipients()[0]; + + //claim the individual rewards for each pool + claimRewards(PRIMARY_POOL_ARRAY, commonRecipient.addr); + claimRewards(SECONDARY_POOL_ARRAY, commonRecipient.addr); + + //check the balance matches the ratio the recipient should have received, which is 1/4 of each deposit for each pool + assertEq(getAssetBalance(commonRecipient.addr), expectedRecipientAmount * 2); + } + + function test_claimSingleUniqueRecipient() public { + //the first recipient of the secondary pool is in both pools, so take the second recipient which is unique + Common.AddressAndWeight memory recipient = getSecondaryRecipients()[1]; + + //claim the individual rewards for this recipient + claimRewards(PRIMARY_POOL_ARRAY, recipient.addr); + claimRewards(SECONDARY_POOL_ARRAY, recipient.addr); + + //the recipient should have received 1/4 of the deposit amount + uint256 recipientExpectedAmount = POOL_DEPOSIT_AMOUNT / 4; + + //the recipient should have received 1/4 of the deposit amount + assertEq(getAssetBalance(recipient.addr), recipientExpectedAmount); + + //check the rewardManager has the remaining quantity + assertEq(getAssetBalance(address(rewardManager)), POOL_DEPOSIT_AMOUNT * 2 - recipientExpectedAmount); + } + + function test_claimSingleRecipientMultiplePools() public { + //the first recipient of the secondary pool is in both pools + Common.AddressAndWeight memory recipient = getSecondaryRecipients()[0]; + + //claim the individual rewards for this recipient + claimRewards(PRIMARY_POOL_ARRAY, recipient.addr); + claimRewards(SECONDARY_POOL_ARRAY, recipient.addr); + + //the recipient should have received 1/4 of the deposit amount for each pool + uint256 recipientExpectedAmount = (POOL_DEPOSIT_AMOUNT / 4) * 2; + + //this recipient belongs in both pools so should have received 1/4 of each + assertEq(getAssetBalance(recipient.addr), recipientExpectedAmount); + + //check the rewardManager has the remaining quantity + assertEq(getAssetBalance(address(rewardManager)), POOL_DEPOSIT_AMOUNT * 2 - recipientExpectedAmount); + } + + function test_claimUnregisteredRecipient() public { + //claim the individual rewards for this recipient + claimRewards(PRIMARY_POOL_ARRAY, getSecondaryRecipients()[1].addr); + claimRewards(SECONDARY_POOL_ARRAY, getPrimaryRecipients()[1].addr); + + //check the recipients didn't receive any fees from this pool + assertEq(getAssetBalance(getSecondaryRecipients()[1].addr), 0); + assertEq(getAssetBalance(getPrimaryRecipients()[1].addr), 0); + + //check the rewardManager has the remaining quantity + assertEq(getAssetBalance(address(rewardManager)), POOL_DEPOSIT_AMOUNT * 2); + } + + function test_claimUnevenAmountRoundsDown() public { + //adding an uneven amount of dust to each pool, this should round down to the nearest whole number with 4 remaining in the contract + addFundsToPool(PRIMARY_POOL_ID, getAsset(3), FEE_MANAGER); + addFundsToPool(SECONDARY_POOL_ID, getAsset(1), FEE_MANAGER); + + //the recipient should have received 1/4 of the deposit amount for each pool + uint256 recipientExpectedAmount = POOL_DEPOSIT_AMOUNT / 4; + + //claim funds for each recipient within the pool + for (uint256 i; i < getPrimaryRecipients().length; i++) { + //get the recipient that is claiming + Common.AddressAndWeight memory recipient = getPrimaryRecipients()[i]; + + //claim the individual rewards for each recipient + claimRewards(PRIMARY_POOL_ARRAY, recipient.addr); + + //check the balance matches the ratio the recipient should have received + assertEq(getAssetBalance(recipient.addr), recipientExpectedAmount); + } + + //special case to handle the first recipient of each pool as they're the same address + claimRewards(SECONDARY_POOL_ARRAY, getSecondaryRecipients()[0].addr); + + //check the balance matches the ratio the recipient should have received + assertEq(getAssetBalance(getSecondaryRecipients()[0].addr), recipientExpectedAmount * 2); + + //claim funds for each recipient of the secondary pool except the first + for (uint256 i = 1; i < getSecondaryRecipients().length; i++) { + //get the recipient that is claiming + Common.AddressAndWeight memory recipient = getSecondaryRecipients()[i]; + + //claim the individual rewards for each recipient + claimRewards(SECONDARY_POOL_ARRAY, recipient.addr); + + //check the balance matches the ratio the recipient should have received + assertEq(getAssetBalance(recipient.addr), recipientExpectedAmount); + } + + //contract should have 4 remaining + assertEq(getAssetBalance(address(rewardManager)), 4); + } + + function test_singleRecipientClaimMultipleDeposits() public { + //get the recipient that is claiming + Common.AddressAndWeight memory recipient = getSecondaryRecipients()[0]; + + //claim the individual rewards for this recipient + claimRewards(SECONDARY_POOL_ARRAY, recipient.addr); + + //the recipient should have received 1/4 of the deposit amount + uint256 expectedRecipientAmount = POOL_DEPOSIT_AMOUNT / 4; + + //check the recipients balance matches the ratio the recipient should have received + assertEq(getAssetBalance(recipient.addr), expectedRecipientAmount); + + //check the rewardManager has the remaining quantity, which is 3/4 of the initial deposit plus the deposit from the second pool + assertEq(getAssetBalance(address(rewardManager)), POOL_DEPOSIT_AMOUNT * 2 - expectedRecipientAmount); + + //add funds to the pool to be split among the recipients + addFundsToPool(SECONDARY_POOL_ID, getAsset(POOL_DEPOSIT_AMOUNT), FEE_MANAGER); + + //claim the individual rewards for this recipient + claimRewards(SECONDARY_POOL_ARRAY, recipient.addr); + + //the recipient should have received 1/4 of the next deposit amount + expectedRecipientAmount += POOL_DEPOSIT_AMOUNT / 4; + + //check the recipients balance matches the ratio the recipient should have received, which is 1/4 of each deposit + assertEq(getAssetBalance(recipient.addr), expectedRecipientAmount); + + //check the rewardManager has the remaining quantity, which is now 3/4 of both deposits + assertEq(getAssetBalance(address(rewardManager)), POOL_DEPOSIT_AMOUNT * 3 - expectedRecipientAmount); + } + + function test_recipientsClaimMultipleDeposits() public { + //the recipient should have received 1/4 of the deposit amount + uint256 expectedRecipientAmount = POOL_DEPOSIT_AMOUNT / 4; + + //claim funds for each recipient within the pool + for (uint256 i; i < getSecondaryRecipients().length; i++) { + //get the recipient that is claiming + Common.AddressAndWeight memory recipient = getSecondaryRecipients()[i]; + + //claim the individual rewards for each recipient + claimRewards(SECONDARY_POOL_ARRAY, recipient.addr); + + //check the balance matches the ratio the recipient should have received + assertEq(getAssetBalance(recipient.addr), expectedRecipientAmount); + } + + //the reward manager balance should contain only the funds of the secondary pool + assertEq(getAssetBalance(address(rewardManager)), POOL_DEPOSIT_AMOUNT); + + //add funds to the pool to be split among the recipients + addFundsToPool(SECONDARY_POOL_ID, getAsset(POOL_DEPOSIT_AMOUNT), FEE_MANAGER); + + //special case to handle the first recipient of each pool as they're the same address + claimRewards(SECONDARY_POOL_ARRAY, getSecondaryRecipients()[0].addr); + + //check the balance matches the ratio the recipient should have received + assertEq(getAssetBalance(getSecondaryRecipients()[0].addr), expectedRecipientAmount * 2); + + //claim funds for each recipient within the pool except the first + for (uint256 i = 1; i < getSecondaryRecipients().length; i++) { + //get the recipient that is claiming + Common.AddressAndWeight memory recipient = getSecondaryRecipients()[i]; + + //claim the individual rewards for each recipient + claimRewards(SECONDARY_POOL_ARRAY, recipient.addr); + + //check the balance matches the ratio the recipient should have received + assertEq(getAssetBalance(recipient.addr), expectedRecipientAmount * 2); + } + + //the reward manager balance should again be the balance of the secondary pool as the primary pool has been emptied twice + assertEq(getAssetBalance(address(rewardManager)), POOL_DEPOSIT_AMOUNT); + } + + function test_claimEmptyPoolWhenSecondPoolContainsFunds() public { + //the recipient should have received 1/4 of the deposit amount + uint256 expectedRecipientAmount = POOL_DEPOSIT_AMOUNT / 4; + + //claim all rewards for each recipient in the primary pool + for (uint256 i; i < getPrimaryRecipients().length; i++) { + //get the recipient that is claiming + Common.AddressAndWeight memory recipient = getPrimaryRecipients()[i]; + + //claim the individual rewards for each recipient + claimRewards(PRIMARY_POOL_ARRAY, recipient.addr); + + //check the balance matches the ratio the recipient should have received + assertEq(getAssetBalance(recipient.addr), expectedRecipientAmount); + } + + //claim all the rewards again for the first recipient as that address is a member of both pools + claimRewards(PRIMARY_POOL_ARRAY, getSecondaryRecipients()[0].addr); + + //check the balance + assertEq(getAssetBalance(getSecondaryRecipients()[0].addr), expectedRecipientAmount); + } + + function test_getRewardsAvailableToRecipientInBothPools() public { + //get index 0 as this recipient is in both default pools + bytes32[] memory poolIds = rewardManager.getAvailableRewardPoolIds( + getPrimaryRecipients()[0].addr, + 0, + type(uint256).max + ); + + //check the recipient is in both pools + assertEq(poolIds[0], PRIMARY_POOL_ID); + assertEq(poolIds[1], SECONDARY_POOL_ID); + } + + function test_getRewardsAvailableToRecipientInSinglePool() public { + //get index 0 as this recipient is in both default pools + bytes32[] memory poolIds = rewardManager.getAvailableRewardPoolIds( + getPrimaryRecipients()[1].addr, + 0, + type(uint256).max + ); + + //check the recipient is in both pools + assertEq(poolIds[0], PRIMARY_POOL_ID); + assertEq(poolIds[1], ZERO_POOL_ID); + } + + function test_getRewardsAvailableToRecipientInNoPools() public view { + //get index 0 as this recipient is in both default pools + bytes32[] memory poolIds = rewardManager.getAvailableRewardPoolIds(FEE_MANAGER, 0, type(uint256).max); + + //check the recipient is in neither pool + assertEq(poolIds[0], ZERO_POOL_ID); + assertEq(poolIds[1], ZERO_POOL_ID); + } + + function test_getRewardsAvailableToRecipientInBothPoolsWhereAlreadyClaimed() public { + //get index 0 as this recipient is in both default pools + bytes32[] memory poolIds = rewardManager.getAvailableRewardPoolIds( + getPrimaryRecipients()[0].addr, + 0, + type(uint256).max + ); + + //check the recipient is in both pools + assertEq(poolIds[0], PRIMARY_POOL_ID); + assertEq(poolIds[1], SECONDARY_POOL_ID); + + //claim the rewards for each pool + claimRewards(PRIMARY_POOL_ARRAY, getPrimaryRecipients()[0].addr); + claimRewards(SECONDARY_POOL_ARRAY, getSecondaryRecipients()[0].addr); + + //get the available pools again + poolIds = rewardManager.getAvailableRewardPoolIds(getPrimaryRecipients()[0].addr, 0, type(uint256).max); + + //user should not be in any pool + assertEq(poolIds[0], ZERO_POOL_ID); + assertEq(poolIds[1], ZERO_POOL_ID); + } + + function test_getAvailableRewardsCursorCannotBeGreaterThanTotalPools() public { + vm.expectRevert(INVALID_POOL_LENGTH_SELECTOR); + + rewardManager.getAvailableRewardPoolIds(FEE_MANAGER, type(uint256).max, 0); + } + + function test_getAvailableRewardsCursorAndTotalPoolsEqual() public { + bytes32[] memory poolIds = rewardManager.getAvailableRewardPoolIds(getPrimaryRecipients()[0].addr, 2, 2); + + assertEq(poolIds.length, 0); + } + + function test_getAvailableRewardsCursorSingleResult() public { + bytes32[] memory poolIds = rewardManager.getAvailableRewardPoolIds(getPrimaryRecipients()[0].addr, 0, 1); + + assertEq(poolIds[0], PRIMARY_POOL_ID); + } +} + +contract DestinationRewardManagerRecipientClaimDifferentWeightsTest is BaseDestinationRewardManagerTest { + uint256 internal constant POOL_DEPOSIT_AMOUNT = 10e18; + + function setUp() public override { + //setup contracts + super.setUp(); + + //create a single pool for these tests + createPrimaryPool(); + + //add funds to the pool to be split among the recipients + addFundsToPool(PRIMARY_POOL_ID, getAsset(POOL_DEPOSIT_AMOUNT), FEE_MANAGER); + } + + function getPrimaryRecipients() public virtual override returns (Common.AddressAndWeight[] memory) { + //array of recipients + Common.AddressAndWeight[] memory recipients = new Common.AddressAndWeight[](4); + + //init each recipient with uneven weights + recipients[0] = Common.AddressAndWeight(DEFAULT_RECIPIENT_1, TEN_PERCENT); + recipients[1] = Common.AddressAndWeight(DEFAULT_RECIPIENT_2, TEN_PERCENT * 8); + recipients[2] = Common.AddressAndWeight(DEFAULT_RECIPIENT_3, ONE_PERCENT * 6); + recipients[3] = Common.AddressAndWeight(DEFAULT_RECIPIENT_4, ONE_PERCENT * 4); + + return recipients; + } + + function test_allRecipientsClaimingReceiveExpectedAmount() public { + //loop all the recipients and claim their expected amount + for (uint256 i; i < getPrimaryRecipients().length; i++) { + //get the recipient that is claiming + Common.AddressAndWeight memory recipient = getPrimaryRecipients()[i]; + + //claim the individual rewards for each recipient + claimRewards(PRIMARY_POOL_ARRAY, recipient.addr); + + //the recipient should have received a share proportional to their weight + uint256 expectedRecipientAmount = (POOL_DEPOSIT_AMOUNT * recipient.weight) / POOL_SCALAR; + + //check the balance matches the ratio the recipient should have received + assertEq(getAssetBalance(recipient.addr), expectedRecipientAmount); + } + } +} + +contract DestinationRewardManagerRecipientClaimUnevenWeightTest is BaseDestinationRewardManagerTest { + uint256 internal constant POOL_DEPOSIT_AMOUNT = 10e18; + + function setUp() public override { + //setup contracts + super.setUp(); + + //create a single pool for these tests + createPrimaryPool(); + } + + function getPrimaryRecipients() public virtual override returns (Common.AddressAndWeight[] memory) { + //array of recipients + Common.AddressAndWeight[] memory recipients = new Common.AddressAndWeight[](2); + + uint64 oneThird = POOL_SCALAR / 3; + + //init each recipient with even weights. + recipients[0] = Common.AddressAndWeight(DEFAULT_RECIPIENT_1, oneThird); + recipients[1] = Common.AddressAndWeight(DEFAULT_RECIPIENT_2, 2 * oneThird + 1); + + return recipients; + } + + function test_allRecipientsClaimingReceiveExpectedAmountWithSmallDeposit() public { + //add a smaller amount of funds to the pool + uint256 smallDeposit = 1e8; + + //add a smaller amount of funds to the pool + addFundsToPool(PRIMARY_POOL_ID, getAsset(smallDeposit), FEE_MANAGER); + + //loop all the recipients and claim their expected amount + for (uint256 i; i < getPrimaryRecipients().length; i++) { + //get the recipient that is claiming + Common.AddressAndWeight memory recipient = getPrimaryRecipients()[i]; + + //claim the individual rewards for each recipient + claimRewards(PRIMARY_POOL_ARRAY, recipient.addr); + + //the recipient should have received a share proportional to their weight + uint256 expectedRecipientAmount = (smallDeposit * recipient.weight) / POOL_SCALAR; + + //check the balance matches the ratio the recipient should have received + assertEq(getAssetBalance(recipient.addr), expectedRecipientAmount); + } + + //smaller deposits will consequently have less precision and will not be able to be split as evenly, the remaining 1 will be lost due to 333...|... being paid out instead of 333...4| + assertEq(getAssetBalance(address(rewardManager)), 1); + } + + function test_allRecipientsClaimingReceiveExpectedAmount() public { + //add funds to the pool to be split among the recipients + addFundsToPool(PRIMARY_POOL_ID, getAsset(POOL_DEPOSIT_AMOUNT), FEE_MANAGER); + + //loop all the recipients and claim their expected amount + for (uint256 i; i < getPrimaryRecipients().length; i++) { + //get the recipient that is claiming + Common.AddressAndWeight memory recipient = getPrimaryRecipients()[i]; + + //claim the individual rewards for each recipient + claimRewards(PRIMARY_POOL_ARRAY, recipient.addr); + + //the recipient should have received a share proportional to their weight + uint256 expectedRecipientAmount = (POOL_DEPOSIT_AMOUNT * recipient.weight) / POOL_SCALAR; + + //check the balance matches the ratio the recipient should have received + assertEq(getAssetBalance(recipient.addr), expectedRecipientAmount); + } + + //their should be 0 wei left over indicating a successful split + assertEq(getAssetBalance(address(rewardManager)), 0); + } +} + +contract DestinationRewardManagerNoRecipientSet is BaseDestinationRewardManagerTest { + uint256 internal constant POOL_DEPOSIT_AMOUNT = 10e18; + + function setUp() public override { + //setup contracts + super.setUp(); + + //add funds to the pool to be split among the recipients once registered + addFundsToPool(PRIMARY_POOL_ID, getAsset(POOL_DEPOSIT_AMOUNT), FEE_MANAGER); + } + + function test_claimAllRecipientsAfterRecipientsSet() public { + //expected recipient amount is 1/4 of the pool deposit + uint256 expectedRecipientAmount = POOL_DEPOSIT_AMOUNT / 4; + + //try and claim funds for each recipient within the pool + for (uint256 i; i < getPrimaryRecipients().length; i++) { + //get the recipient that is claiming + Common.AddressAndWeight memory recipient = getPrimaryRecipients()[i]; + + //there should be no rewards claimed as the recipient is not registered + claimRewards(PRIMARY_POOL_ARRAY, recipient.addr); + + //check the recipient received nothing + assertEq(getAssetBalance(recipient.addr), 0); + } + + //Set the recipients after the rewards have been paid into the pool + setRewardRecipients(PRIMARY_POOL_ID, getPrimaryRecipients(), ADMIN); + + //claim funds for each recipient within the pool + for (uint256 i; i < getPrimaryRecipients().length; i++) { + //get the recipient that is claiming + Common.AddressAndWeight memory recipient = getPrimaryRecipients()[i]; + + //there should be no rewards claimed as the recipient is registered + claimRewards(PRIMARY_POOL_ARRAY, recipient.addr); + + //check the balance matches the ratio the recipient should have received + assertEq(getAssetBalance(recipient.addr), expectedRecipientAmount); + } + } +} diff --git a/contracts/src/v0.8/llo-feeds/v0.4.0/test/reward-manager/DestinationRewardManager.general.t.sol b/contracts/src/v0.8/llo-feeds/v0.4.0/test/reward-manager/DestinationRewardManager.general.t.sol new file mode 100644 index 00000000000..4c79d2cba5e --- /dev/null +++ b/contracts/src/v0.8/llo-feeds/v0.4.0/test/reward-manager/DestinationRewardManager.general.t.sol @@ -0,0 +1,99 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity 0.8.19; + +import {BaseDestinationRewardManagerTest} from "./BaseDestinationRewardManager.t.sol"; +import {DestinationRewardManager} from "../../../v0.4.0/DestinationRewardManager.sol"; +import {ERC20Mock} from "../../../../vendor/openzeppelin-solidity/v4.8.3/contracts/mocks/ERC20Mock.sol"; +import {IDestinationRewardManager} from "../../interfaces/IDestinationRewardManager.sol"; + +/** + * @title DestinationRewardManagerSetupTest + * @author Michael Fletcher + * @notice This contract will test the core functionality of the DestinationRewardManager contract + */ +contract DestinationRewardManagerSetupTest is BaseDestinationRewardManagerTest { + uint256 internal constant POOL_DEPOSIT_AMOUNT = 10e18; + + function setUp() public override { + //setup contracts + super.setUp(); + } + + function test_rejectsZeroLinkAddressOnConstruction() public { + //should revert if the contract is a zero address + vm.expectRevert(INVALID_ADDRESS_ERROR_SELECTOR); + + //create a rewardManager with a zero link address + new DestinationRewardManager(address(0)); + } + + function test_eventEmittedUponFeeManagerUpdate() public { + //expect the event to be emitted + vm.expectEmit(); + + //emit the event that is expected to be emitted + emit FeeManagerUpdated(FEE_MANAGER_2); + + //set the verifier proxy + setFeeManager(FEE_MANAGER_2, ADMIN); + } + + function test_eventEmittedUponFeePaid() public { + //create pool and add funds + createPrimaryPool(); + + //change to the feeManager who is the one who will be paying the fees + changePrank(FEE_MANAGER); + + //approve the amount being paid into the pool + ERC20Mock(getAsset(POOL_DEPOSIT_AMOUNT).assetAddress).approve(address(rewardManager), POOL_DEPOSIT_AMOUNT); + + IDestinationRewardManager.FeePayment[] memory payments = new IDestinationRewardManager.FeePayment[](1); + payments[0] = IDestinationRewardManager.FeePayment(PRIMARY_POOL_ID, uint192(POOL_DEPOSIT_AMOUNT)); + + //event is emitted when funds are added + vm.expectEmit(); + emit FeePaid(payments, FEE_MANAGER); + + //this represents the verifier adding some funds to the pool + rewardManager.onFeePaid(payments, FEE_MANAGER); + } + + function test_setFeeManagerZeroAddress() public { + //should revert if the contract is a zero address + vm.expectRevert(INVALID_ADDRESS_ERROR_SELECTOR); + + //set the verifier proxy + setFeeManager(address(0), ADMIN); + } + + function test_addFeeManagerZeroAddress() public { + vm.expectRevert(INVALID_ADDRESS_ERROR_SELECTOR); + rewardManager.addFeeManager(address(0)); + } + + function test_addFeeManagerExistingAddress() public { + address dummyAddress = address(998); + rewardManager.addFeeManager(dummyAddress); + vm.expectRevert(INVALID_ADDRESS_ERROR_SELECTOR); + rewardManager.addFeeManager(dummyAddress); + } + + function test_removeFeeManagerNonExistentAddress() public { + address dummyAddress = address(991); + vm.expectRevert(INVALID_ADDRESS_ERROR_SELECTOR); + rewardManager.removeFeeManager(dummyAddress); + } + + function test_addRemoveFeeManager() public { + address dummyAddress1 = address(1); + address dummyAddress2 = address(2); + rewardManager.addFeeManager(dummyAddress1); + rewardManager.addFeeManager(dummyAddress2); + assertEq(rewardManager.s_feeManagerAddressList(dummyAddress1), dummyAddress1); + assertEq(rewardManager.s_feeManagerAddressList(dummyAddress2), dummyAddress2); + rewardManager.removeFeeManager(dummyAddress1); + assertEq(rewardManager.s_feeManagerAddressList(dummyAddress1), address(0)); + assertEq(rewardManager.s_feeManagerAddressList(dummyAddress2), dummyAddress2); + } +} diff --git a/contracts/src/v0.8/llo-feeds/v0.4.0/test/reward-manager/DestinationRewardManager.payRecipients.t.sol b/contracts/src/v0.8/llo-feeds/v0.4.0/test/reward-manager/DestinationRewardManager.payRecipients.t.sol new file mode 100644 index 00000000000..4aa3c868b35 --- /dev/null +++ b/contracts/src/v0.8/llo-feeds/v0.4.0/test/reward-manager/DestinationRewardManager.payRecipients.t.sol @@ -0,0 +1,194 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity 0.8.19; + +import {BaseDestinationRewardManagerTest} from "./BaseDestinationRewardManager.t.sol"; +import {IDestinationRewardManager} from "../../interfaces/IDestinationRewardManager.sol"; + +/** + * @title DestinationRewardManagerPayRecipientsTest + * @author Michael Fletcher + * @notice This contract will test the payRecipients functionality of the RewardManager contract + */ +contract DestinationRewardManagerPayRecipientsTest is BaseDestinationRewardManagerTest { + uint256 internal constant POOL_DEPOSIT_AMOUNT = 10e18; + + function setUp() public override { + //setup contracts + super.setUp(); + + //create a single pool for these tests + createPrimaryPool(); + + //add funds to the pool to be split among the recipients + addFundsToPool(PRIMARY_POOL_ID, getAsset(POOL_DEPOSIT_AMOUNT), FEE_MANAGER); + } + + function test_payAllRecipients() public { + //pay all the recipients in the pool + payRecipients(PRIMARY_POOL_ID, getPrimaryRecipientAddresses(), ADMIN); + + //each recipient should receive 1/4 of the pool + uint256 expectedRecipientAmount = POOL_DEPOSIT_AMOUNT / 4; + + //check each recipient received the correct amount + for (uint256 i = 0; i < getPrimaryRecipientAddresses().length; i++) { + assertEq(getAssetBalance(getPrimaryRecipientAddresses()[i]), expectedRecipientAmount); + } + } + + function test_paySingleRecipient() public { + //get the first individual recipient + address recipient = getPrimaryRecipientAddresses()[0]; + + //get a single recipient as an array + address[] memory recipients = new address[](1); + recipients[0] = recipient; + + //pay a single recipient + payRecipients(PRIMARY_POOL_ID, recipients, ADMIN); + + //the recipient should have received 1/4 of the deposit amount + uint256 expectedRecipientAmount = POOL_DEPOSIT_AMOUNT / 4; + + assertEq(getAssetBalance(recipient), expectedRecipientAmount); + } + + function test_payRecipientWithInvalidPool() public { + //get the first individual recipient + address recipient = getPrimaryRecipientAddresses()[0]; + + //get a single recipient as an array + address[] memory recipients = new address[](1); + recipients[0] = recipient; + + //pay a single recipient + payRecipients(SECONDARY_POOL_ID, recipients, ADMIN); + + //the recipient should have received nothing + assertEq(getAssetBalance(recipient), 0); + } + + function test_payRecipientsEmptyRecipientList() public { + //get a single recipient + address[] memory recipients = new address[](0); + + //pay a single recipient + payRecipients(PRIMARY_POOL_ID, recipients, ADMIN); + + //rewardManager should have the full balance + assertEq(getAssetBalance(address(rewardManager)), POOL_DEPOSIT_AMOUNT); + } + + function test_payAllRecipientsWithAdditionalUnregisteredRecipient() public { + //load all the recipients and add an additional one who is not in the pool + address[] memory recipients = new address[](getPrimaryRecipientAddresses().length + 1); + for (uint256 i = 0; i < getPrimaryRecipientAddresses().length; i++) { + recipients[i] = getPrimaryRecipientAddresses()[i]; + } + recipients[recipients.length - 1] = DEFAULT_RECIPIENT_5; + + //pay the recipients + payRecipients(PRIMARY_POOL_ID, recipients, ADMIN); + + //each recipient should receive 1/4 of the pool except the last + uint256 expectedRecipientAmount = POOL_DEPOSIT_AMOUNT / 4; + + //check each recipient received the correct amount + for (uint256 i = 0; i < getPrimaryRecipientAddresses().length; i++) { + assertEq(getAssetBalance(getPrimaryRecipientAddresses()[i]), expectedRecipientAmount); + } + + //the unregistered recipient should receive nothing + assertEq(getAssetBalance(DEFAULT_RECIPIENT_5), 0); + } + + function test_payAllRecipientsWithAdditionalInvalidRecipient() public { + //load all the recipients and add an additional one which is invalid, that should receive nothing + address[] memory recipients = new address[](getPrimaryRecipientAddresses().length + 1); + for (uint256 i = 0; i < getPrimaryRecipientAddresses().length; i++) { + recipients[i] = getPrimaryRecipientAddresses()[i]; + } + recipients[recipients.length - 1] = INVALID_ADDRESS; + + //pay the recipients + payRecipients(PRIMARY_POOL_ID, recipients, ADMIN); + + //each recipient should receive 1/4 of the pool except the last + uint256 expectedRecipientAmount = POOL_DEPOSIT_AMOUNT / 4; + + //check each recipient received the correct amount + for (uint256 i = 0; i < getPrimaryRecipientAddresses().length; i++) { + assertEq(getAssetBalance(getPrimaryRecipientAddresses()[i]), expectedRecipientAmount); + } + } + + function test_paySubsetOfRecipientsInPool() public { + //load a subset of the recipients into an array + address[] memory recipients = new address[](getPrimaryRecipientAddresses().length - 1); + for (uint256 i = 0; i < recipients.length; i++) { + recipients[i] = getPrimaryRecipientAddresses()[i]; + } + + //pay the subset of recipients + payRecipients(PRIMARY_POOL_ID, recipients, ADMIN); + + //each recipient should receive 1/4 of the pool except the last + uint256 expectedRecipientAmount = POOL_DEPOSIT_AMOUNT / 4; + + //check each subset of recipients received the correct amount + for (uint256 i = 0; i < recipients.length - 1; i++) { + assertEq(getAssetBalance(recipients[i]), expectedRecipientAmount); + } + + //check the pool has the remaining balance + assertEq( + getAssetBalance(address(rewardManager)), + POOL_DEPOSIT_AMOUNT - expectedRecipientAmount * recipients.length + ); + } + + function test_payAllRecipientsFromNonAdminUser() public { + //should revert if the caller isn't an admin or recipient within the pool + vm.expectRevert(UNAUTHORIZED_ERROR_SELECTOR); + + //pay all the recipients in the pool + payRecipients(PRIMARY_POOL_ID, getPrimaryRecipientAddresses(), FEE_MANAGER); + } + + function test_payAllRecipientsFromRecipientInPool() public { + //pay all the recipients in the pool + payRecipients(PRIMARY_POOL_ID, getPrimaryRecipientAddresses(), DEFAULT_RECIPIENT_1); + + //each recipient should receive 1/4 of the pool + uint256 expectedRecipientAmount = POOL_DEPOSIT_AMOUNT / 4; + + //check each recipient received the correct amount + for (uint256 i = 0; i < getPrimaryRecipientAddresses().length; i++) { + assertEq(getAssetBalance(getPrimaryRecipientAddresses()[i]), expectedRecipientAmount); + } + } + + function test_payRecipientsWithInvalidPoolId() public { + //pay all the recipients in the pool + payRecipients(INVALID_POOL_ID, getPrimaryRecipientAddresses(), ADMIN); + + //pool should still contain the full balance + assertEq(getAssetBalance(address(rewardManager)), POOL_DEPOSIT_AMOUNT); + } + + function test_addFundsToPoolAsOwner() public { + //add funds to the pool + addFundsToPool(PRIMARY_POOL_ID, getAsset(POOL_DEPOSIT_AMOUNT), FEE_MANAGER); + } + + function test_addFundsToPoolAsNonOwnerOrFeeManager() public { + //should revert if the caller isn't an admin or recipient within the pool + vm.expectRevert(UNAUTHORIZED_ERROR_SELECTOR); + + IDestinationRewardManager.FeePayment[] memory payments = new IDestinationRewardManager.FeePayment[](1); + payments[0] = IDestinationRewardManager.FeePayment(PRIMARY_POOL_ID, uint192(POOL_DEPOSIT_AMOUNT)); + + //add funds to the pool + rewardManager.onFeePaid(payments, USER); + } +} diff --git a/contracts/src/v0.8/llo-feeds/v0.4.0/test/reward-manager/DestinationRewardManager.setRecipients.t.sol b/contracts/src/v0.8/llo-feeds/v0.4.0/test/reward-manager/DestinationRewardManager.setRecipients.t.sol new file mode 100644 index 00000000000..facbaa1ab77 --- /dev/null +++ b/contracts/src/v0.8/llo-feeds/v0.4.0/test/reward-manager/DestinationRewardManager.setRecipients.t.sol @@ -0,0 +1,148 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity 0.8.19; + +import {BaseDestinationRewardManagerTest} from "./BaseDestinationRewardManager.t.sol"; +import {Common} from "../../../libraries/Common.sol"; + +/** + * @title DestinationRewardManagerSetRecipientsTest + * @author Michael Fletcher + * @notice This contract will test the setRecipient functionality of the RewardManager contract + */ +contract DestinationRewardManagerSetRecipientsTest is BaseDestinationRewardManagerTest { + function setUp() public override { + //setup contracts + super.setUp(); + } + + function test_setRewardRecipients() public { + //set the recipients + setRewardRecipients(PRIMARY_POOL_ID, getPrimaryRecipients(), ADMIN); + } + + function test_setRewardRecipientsIsEmpty() public { + //array of recipients + Common.AddressAndWeight[] memory recipients = new Common.AddressAndWeight[](4); + + //should revert if the recipients array is empty + vm.expectRevert(INVALID_ADDRESS_ERROR_SELECTOR); + + //set the recipients + setRewardRecipients(PRIMARY_POOL_ID, recipients, ADMIN); + } + + function test_setRewardRecipientWithZeroWeight() public { + //array of recipients + Common.AddressAndWeight[] memory recipients = new Common.AddressAndWeight[](5); + + //init each recipient with even weights + recipients[0] = Common.AddressAndWeight(DEFAULT_RECIPIENT_1, ONE_PERCENT * 25); + recipients[1] = Common.AddressAndWeight(DEFAULT_RECIPIENT_2, ONE_PERCENT * 25); + recipients[2] = Common.AddressAndWeight(DEFAULT_RECIPIENT_3, ONE_PERCENT * 25); + recipients[3] = Common.AddressAndWeight(DEFAULT_RECIPIENT_4, ONE_PERCENT * 25); + recipients[4] = Common.AddressAndWeight(DEFAULT_RECIPIENT_5, 0); + + //set the recipients + setRewardRecipients(PRIMARY_POOL_ID, recipients, ADMIN); + } + + function test_setRewardRecipientWithZeroAddress() public { + //array of recipients + Common.AddressAndWeight[] memory recipients = getPrimaryRecipients(); + + //override the first recipient with a zero address + recipients[0].addr = address(0); + + //should revert if the recipients array is empty + vm.expectRevert(INVALID_ADDRESS_ERROR_SELECTOR); + + //set the recipients + setRewardRecipients(PRIMARY_POOL_ID, recipients, ADMIN); + } + + function test_setRewardRecipientWeights() public { + //array of recipients + Common.AddressAndWeight[] memory recipients = new Common.AddressAndWeight[](4); + + //init each recipient with even weights + recipients[0] = Common.AddressAndWeight(DEFAULT_RECIPIENT_1, 25); + recipients[1] = Common.AddressAndWeight(DEFAULT_RECIPIENT_2, 25); + recipients[2] = Common.AddressAndWeight(DEFAULT_RECIPIENT_3, 25); + recipients[3] = Common.AddressAndWeight(DEFAULT_RECIPIENT_4, 25); + + //should revert if the recipients array is empty + vm.expectRevert(INVALID_WEIGHT_ERROR_SELECTOR); + + //set the recipients with a recipient with a weight of 100% + setRewardRecipients(PRIMARY_POOL_ID, recipients, ADMIN); + } + + function test_setSingleRewardRecipient() public { + //array of recipients + Common.AddressAndWeight[] memory recipients = new Common.AddressAndWeight[](1); + + //init each recipient with even weights + recipients[0] = Common.AddressAndWeight(DEFAULT_RECIPIENT_1, POOL_SCALAR); + + //set the recipients with a recipient with a weight of 100% + setRewardRecipients(PRIMARY_POOL_ID, recipients, ADMIN); + } + + function test_setRewardRecipientTwice() public { + //set the recipients + setRewardRecipients(PRIMARY_POOL_ID, getPrimaryRecipients(), ADMIN); + + //should revert if recipients for this pool have already been set + vm.expectRevert(INVALID_POOL_ID_ERROR_SELECTOR); + + //set the recipients again + setRewardRecipients(PRIMARY_POOL_ID, getPrimaryRecipients(), ADMIN); + } + + function test_setRewardRecipientFromNonOwnerOrFeeManagerAddress() public { + //should revert if the sender is not the owner or proxy + vm.expectRevert(UNAUTHORIZED_ERROR_SELECTOR); + + //set the recipients + setRewardRecipients(PRIMARY_POOL_ID, getPrimaryRecipients(), USER); + } + + function test_setRewardRecipientFromManagerAddress() public { + //update the proxy address + setFeeManager(FEE_MANAGER_2, ADMIN); + + //set the recipients + setRewardRecipients(PRIMARY_POOL_ID, getPrimaryRecipients(), FEE_MANAGER_2); + } + + function test_eventIsEmittedUponSetRecipients() public { + //expect an emit + vm.expectEmit(); + + //emit the event that is expected to be emitted + emit RewardRecipientsUpdated(PRIMARY_POOL_ID, getPrimaryRecipients()); + + //set the recipients + setRewardRecipients(PRIMARY_POOL_ID, getPrimaryRecipients(), ADMIN); + } + + function test_setRecipientContainsDuplicateRecipients() public { + //create a new array to hold the existing recipients + Common.AddressAndWeight[] memory recipients = new Common.AddressAndWeight[](getPrimaryRecipients().length * 2); + + //add all the existing recipients + for (uint256 i; i < getPrimaryRecipients().length; i++) { + recipients[i] = getPrimaryRecipients()[i]; + } + //add all the existing recipients again + for (uint256 i; i < getPrimaryRecipients().length; i++) { + recipients[i + getPrimaryRecipients().length] = getPrimaryRecipients()[i]; + } + + //should revert as the list contains a duplicate + vm.expectRevert(INVALID_ADDRESS_ERROR_SELECTOR); + + //set the recipients + setRewardRecipients(PRIMARY_POOL_ID, recipients, ADMIN); + } +} diff --git a/contracts/src/v0.8/llo-feeds/v0.4.0/test/reward-manager/DestinationRewardManager.updateRewardRecipients.t.sol b/contracts/src/v0.8/llo-feeds/v0.4.0/test/reward-manager/DestinationRewardManager.updateRewardRecipients.t.sol new file mode 100644 index 00000000000..226be8ed325 --- /dev/null +++ b/contracts/src/v0.8/llo-feeds/v0.4.0/test/reward-manager/DestinationRewardManager.updateRewardRecipients.t.sol @@ -0,0 +1,450 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity 0.8.19; + +import {BaseDestinationRewardManagerTest} from "./BaseDestinationRewardManager.t.sol"; +import {Common} from "../../../libraries/Common.sol"; + +/** + * @title DestinationRewardManagerUpdateRewardRecipientsTest + * @author Michael Fletcher + * @notice This contract will test the updateRecipient functionality of the RewardManager contract + */ +contract DestinationRewardManagerUpdateRewardRecipientsTest is BaseDestinationRewardManagerTest { + uint256 internal constant POOL_DEPOSIT_AMOUNT = 10e18; + + function setUp() public override { + //setup contracts + super.setUp(); + + //create a single pool for these tests + createPrimaryPool(); + + //add funds to the pool to be split among the recipients + addFundsToPool(PRIMARY_POOL_ID, getAsset(POOL_DEPOSIT_AMOUNT), FEE_MANAGER); + } + + function test_onlyAdminCanUpdateRecipients() public { + //should revert if the caller is not the admin + vm.expectRevert(ONLY_CALLABLE_BY_OWNER_ERROR); + + //updating a recipient should force the funds to be paid out + updateRewardRecipients(PRIMARY_POOL_ID, getPrimaryRecipients(), FEE_MANAGER); + } + + function test_updateAllRecipientsWithSameAddressAndWeight() public { + //expected recipient amount is 1/4 of the pool deposit + uint256 expectedRecipientAmount = POOL_DEPOSIT_AMOUNT / 4; + + //updating a recipient should force the funds to be paid out + updateRewardRecipients(PRIMARY_POOL_ID, getPrimaryRecipients(), ADMIN); + + //check each recipient received the correct amount + for (uint256 i; i < getPrimaryRecipients().length; i++) { + //check the balance matches the ratio the recipient should have received + assertEq(getAssetBalance(getPrimaryRecipients()[i].addr), expectedRecipientAmount); + } + } + + function test_updatePartialRecipientsWithSameAddressAndWeight() public { + //expected recipient amount is 1/4 of the pool deposit + uint256 expectedRecipientAmount = POOL_DEPOSIT_AMOUNT / 4; + + //get a subset of the recipients + Common.AddressAndWeight[] memory recipients = new Common.AddressAndWeight[](2); + recipients[0] = Common.AddressAndWeight(DEFAULT_RECIPIENT_1, ONE_PERCENT * 25); + recipients[1] = Common.AddressAndWeight(DEFAULT_RECIPIENT_2, ONE_PERCENT * 25); + + //updating a recipient should force the funds to be paid out + updateRewardRecipients(PRIMARY_POOL_ID, recipients, ADMIN); + + //check each recipient received the correct amount + for (uint256 i; i < recipients.length; i++) { + //check the balance matches the ratio the recipient should have received + assertEq(getAssetBalance(recipients[i].addr), expectedRecipientAmount); + } + + //the reward manager should still have half remaining funds + assertEq(getAssetBalance(address(rewardManager)), POOL_DEPOSIT_AMOUNT / 2); + } + + function test_updateRecipientWithNewZeroAddress() public { + //create a new array to hold the existing recipients plus a new zero address + Common.AddressAndWeight[] memory recipients = new Common.AddressAndWeight[](getPrimaryRecipients().length + 1); + + //add all the existing recipients + for (uint256 i; i < getPrimaryRecipients().length; i++) { + recipients[i] = getPrimaryRecipients()[i]; + } + //add a new address to the primary recipients + recipients[recipients.length - 1] = Common.AddressAndWeight(address(0), 0); + + //should revert if the recipient is a zero address + vm.expectRevert(INVALID_ADDRESS_ERROR_SELECTOR); + + //update the recipients with invalid address + updateRewardRecipients(PRIMARY_POOL_ID, recipients, ADMIN); + } + + function test_updateRecipientsContainsDuplicateRecipients() public { + //create a new array to hold the existing recipients + Common.AddressAndWeight[] memory recipients = new Common.AddressAndWeight[](getPrimaryRecipients().length * 2); + + //add all the existing recipients + for (uint256 i; i < getPrimaryRecipients().length; i++) { + recipients[i] = getPrimaryRecipients()[i]; + } + //add all the existing recipients again + for (uint256 i; i < getPrimaryRecipients().length; i++) { + recipients[i + getPrimaryRecipients().length] = getPrimaryRecipients()[i]; + } + + //should revert as the list contains a duplicate + vm.expectRevert(INVALID_ADDRESS_ERROR_SELECTOR); + + //update the recipients with the duplicate addresses + updateRewardRecipients(PRIMARY_POOL_ID, recipients, ADMIN); + } + + function test_updateRecipientsToDifferentSet() public { + //create a list of containing recipients from the primary configured set, and new recipients + Common.AddressAndWeight[] memory recipients = new Common.AddressAndWeight[](getPrimaryRecipients().length + 4); + for (uint256 i; i < getPrimaryRecipients().length; i++) { + //copy the recipient and set the weight to 0 which implies the recipient is being replaced + recipients[i] = Common.AddressAndWeight(getPrimaryRecipients()[i].addr, 0); + } + + //add the new recipients individually + recipients[4] = Common.AddressAndWeight(DEFAULT_RECIPIENT_5, ONE_PERCENT * 25); + recipients[5] = Common.AddressAndWeight(DEFAULT_RECIPIENT_6, ONE_PERCENT * 25); + recipients[6] = Common.AddressAndWeight(DEFAULT_RECIPIENT_7, ONE_PERCENT * 25); + recipients[7] = Common.AddressAndWeight(DEFAULT_RECIPIENT_8, ONE_PERCENT * 25); + + //updating a recipient should force the funds to be paid out for the primary recipients + updateRewardRecipients(PRIMARY_POOL_ID, recipients, ADMIN); + } + + function test_updateRecipientsToDifferentPartialSet() public { + //create a list of containing recipients from the primary configured set, and new recipients + Common.AddressAndWeight[] memory recipients = new Common.AddressAndWeight[](getPrimaryRecipients().length + 2); + for (uint256 i; i < getPrimaryRecipients().length; i++) { + //copy the recipient and set the weight to 0 which implies the recipient is being replaced + recipients[i] = Common.AddressAndWeight(getPrimaryRecipients()[i].addr, 0); + } + + //add the new recipients individually + recipients[4] = Common.AddressAndWeight(DEFAULT_RECIPIENT_5, FIFTY_PERCENT); + recipients[5] = Common.AddressAndWeight(DEFAULT_RECIPIENT_6, FIFTY_PERCENT); + + //updating a recipient should force the funds to be paid out for the primary recipients + updateRewardRecipients(PRIMARY_POOL_ID, recipients, ADMIN); + } + + function test_updateRecipientsToDifferentLargerSet() public { + //create a list of containing recipients from the primary configured set, and new recipients + Common.AddressAndWeight[] memory recipients = new Common.AddressAndWeight[](getPrimaryRecipients().length + 5); + for (uint256 i; i < getPrimaryRecipients().length; i++) { + //copy the recipient and set the weight to 0 which implies the recipient is being replaced + recipients[i] = Common.AddressAndWeight(getPrimaryRecipients()[i].addr, 0); + } + + //add the new recipients individually + recipients[4] = Common.AddressAndWeight(DEFAULT_RECIPIENT_5, TEN_PERCENT * 2); + recipients[5] = Common.AddressAndWeight(DEFAULT_RECIPIENT_6, TEN_PERCENT * 2); + recipients[6] = Common.AddressAndWeight(DEFAULT_RECIPIENT_7, TEN_PERCENT * 2); + recipients[7] = Common.AddressAndWeight(DEFAULT_RECIPIENT_8, TEN_PERCENT * 2); + recipients[8] = Common.AddressAndWeight(DEFAULT_RECIPIENT_9, TEN_PERCENT * 2); + + //updating a recipient should force the funds to be paid out for the primary recipients + updateRewardRecipients(PRIMARY_POOL_ID, recipients, ADMIN); + } + + function test_updateRecipientsUpdateAndRemoveExistingForLargerSet() public { + //create a list of containing recipients from the primary configured set, and new recipients + Common.AddressAndWeight[] memory recipients = new Common.AddressAndWeight[](9); + + //update the existing recipients + recipients[0] = Common.AddressAndWeight(getPrimaryRecipients()[0].addr, 0); + recipients[1] = Common.AddressAndWeight(getPrimaryRecipients()[1].addr, 0); + recipients[2] = Common.AddressAndWeight(getPrimaryRecipients()[2].addr, TEN_PERCENT * 3); + recipients[3] = Common.AddressAndWeight(getPrimaryRecipients()[3].addr, TEN_PERCENT * 3); + + //add the new recipients individually + recipients[4] = Common.AddressAndWeight(DEFAULT_RECIPIENT_5, TEN_PERCENT); + recipients[5] = Common.AddressAndWeight(DEFAULT_RECIPIENT_6, TEN_PERCENT); + recipients[6] = Common.AddressAndWeight(DEFAULT_RECIPIENT_7, TEN_PERCENT); + recipients[7] = Common.AddressAndWeight(DEFAULT_RECIPIENT_8, TEN_PERCENT); + recipients[8] = Common.AddressAndWeight(DEFAULT_RECIPIENT_9, TEN_PERCENT); + + //should revert as the weight does not equal 100% + vm.expectRevert(INVALID_WEIGHT_ERROR_SELECTOR); + + //updating a recipient should force the funds to be paid out for the primary recipients + updateRewardRecipients(PRIMARY_POOL_ID, recipients, ADMIN); + } + + function test_updateRecipientsUpdateAndRemoveExistingForSmallerSet() public { + //create a list of containing recipients from the primary configured set, and new recipients + Common.AddressAndWeight[] memory recipients = new Common.AddressAndWeight[](5); + + //update the existing recipients + recipients[0] = Common.AddressAndWeight(getPrimaryRecipients()[0].addr, 0); + recipients[1] = Common.AddressAndWeight(getPrimaryRecipients()[1].addr, 0); + recipients[2] = Common.AddressAndWeight(getPrimaryRecipients()[2].addr, TEN_PERCENT * 3); + recipients[3] = Common.AddressAndWeight(getPrimaryRecipients()[3].addr, TEN_PERCENT * 2); + + //add the new recipients individually + recipients[4] = Common.AddressAndWeight(DEFAULT_RECIPIENT_5, TEN_PERCENT * 5); + + //updating a recipient should force the funds to be paid out for the primary recipients + updateRewardRecipients(PRIMARY_POOL_ID, recipients, ADMIN); + } + + function test_updateRecipientsToDifferentSetWithInvalidWeights() public { + //create a list of containing recipients from the primary configured set, and new recipients + Common.AddressAndWeight[] memory recipients = new Common.AddressAndWeight[](getPrimaryRecipients().length + 2); + for (uint256 i; i < getPrimaryRecipients().length; i++) { + //copy the recipient and set the weight to 0 which implies the recipient is being replaced + recipients[i] = Common.AddressAndWeight(getPrimaryRecipients()[i].addr, 0); + } + + //add the new recipients individually + recipients[4] = Common.AddressAndWeight(DEFAULT_RECIPIENT_5, TEN_PERCENT * 5); + recipients[5] = Common.AddressAndWeight(DEFAULT_RECIPIENT_6, TEN_PERCENT); + + //should revert as the weight will not equal 100% + vm.expectRevert(INVALID_WEIGHT_ERROR_SELECTOR); + + //updating a recipient should force the funds to be paid out for the primary recipients + updateRewardRecipients(PRIMARY_POOL_ID, recipients, ADMIN); + } + + function test_updatePartialRecipientsToSubset() public { + //create a list of containing recipients from the primary configured set, and new recipients + Common.AddressAndWeight[] memory recipients = new Common.AddressAndWeight[](4); + recipients[0] = Common.AddressAndWeight(DEFAULT_RECIPIENT_1, 0); + recipients[1] = Common.AddressAndWeight(DEFAULT_RECIPIENT_2, 0); + recipients[2] = Common.AddressAndWeight(DEFAULT_RECIPIENT_3, TEN_PERCENT * 5); + recipients[3] = Common.AddressAndWeight(DEFAULT_RECIPIENT_4, TEN_PERCENT * 5); + + //updating a recipient should force the funds to be paid out for the primary recipients + updateRewardRecipients(PRIMARY_POOL_ID, recipients, ADMIN); + } + + function test_updatePartialRecipientsWithUnderWeightSet() public { + //create a list of containing recipients from the primary configured set, and new recipients + Common.AddressAndWeight[] memory recipients = new Common.AddressAndWeight[](4); + recipients[0] = Common.AddressAndWeight(DEFAULT_RECIPIENT_1, TEN_PERCENT); + recipients[1] = Common.AddressAndWeight(DEFAULT_RECIPIENT_2, TEN_PERCENT); + recipients[2] = Common.AddressAndWeight(DEFAULT_RECIPIENT_3, TEN_PERCENT); + recipients[3] = Common.AddressAndWeight(DEFAULT_RECIPIENT_4, TEN_PERCENT); + + //should revert as the new weights exceed the previous weights being replaced + vm.expectRevert(INVALID_WEIGHT_ERROR_SELECTOR); + + //updating a recipient should force the funds to be paid out for the primary recipients + updateRewardRecipients(PRIMARY_POOL_ID, recipients, ADMIN); + } + + function test_updatePartialRecipientsWithExcessiveWeight() public { + //create a list of containing recipients from the primary configured set, and new recipients + Common.AddressAndWeight[] memory recipients = new Common.AddressAndWeight[](4); + recipients[0] = Common.AddressAndWeight(DEFAULT_RECIPIENT_1, TEN_PERCENT); + recipients[1] = Common.AddressAndWeight(DEFAULT_RECIPIENT_2, TEN_PERCENT); + recipients[2] = Common.AddressAndWeight(DEFAULT_RECIPIENT_3, TEN_PERCENT); + recipients[3] = Common.AddressAndWeight(DEFAULT_RECIPIENT_4, POOL_SCALAR); + + //should revert as the new weights exceed the previous weights being replaced + vm.expectRevert(INVALID_WEIGHT_ERROR_SELECTOR); + + //updating a recipient should force the funds to be paid out for the primary recipients + updateRewardRecipients(PRIMARY_POOL_ID, recipients, ADMIN); + } + + function test_updateRecipientWeights() public { + //expected recipient amount is 1/4 of the pool deposit for original recipients + uint256 expectedRecipientAmount = POOL_DEPOSIT_AMOUNT / 4; + + //create a list of containing recipients from the primary configured set with their new weights + Common.AddressAndWeight[] memory recipients = new Common.AddressAndWeight[](4); + recipients[0] = Common.AddressAndWeight(DEFAULT_RECIPIENT_1, TEN_PERCENT); + recipients[1] = Common.AddressAndWeight(DEFAULT_RECIPIENT_2, TEN_PERCENT); + recipients[2] = Common.AddressAndWeight(DEFAULT_RECIPIENT_3, TEN_PERCENT * 3); + recipients[3] = Common.AddressAndWeight(DEFAULT_RECIPIENT_4, TEN_PERCENT * 5); + + //updating a recipient should force the funds to be paid out for the primary recipients + updateRewardRecipients(PRIMARY_POOL_ID, recipients, ADMIN); + + //check each recipient received the correct amount + for (uint256 i; i < recipients.length; i++) { + //check the balance matches the ratio the recipient should have received + assertEq(getAssetBalance(recipients[i].addr), expectedRecipientAmount); + } + + //the reward manager should have no funds remaining + assertEq(getAssetBalance(address(rewardManager)), 0); + + //add more funds to the pool to check new distribution + addFundsToPool(PRIMARY_POOL_ID, getAsset(POOL_DEPOSIT_AMOUNT), FEE_MANAGER); + + //loop each user and claim the rewards + for (uint256 i; i < recipients.length; i++) { + //claim the rewards for this recipient + claimRewards(PRIMARY_POOL_ARRAY, recipients[i].addr); + } + + //manually check the balance of each recipient + assertEq( + getAssetBalance(DEFAULT_RECIPIENT_1), + (POOL_DEPOSIT_AMOUNT * TEN_PERCENT) / POOL_SCALAR + expectedRecipientAmount + ); + assertEq( + getAssetBalance(DEFAULT_RECIPIENT_2), + (POOL_DEPOSIT_AMOUNT * TEN_PERCENT) / POOL_SCALAR + expectedRecipientAmount + ); + assertEq( + getAssetBalance(DEFAULT_RECIPIENT_3), + (POOL_DEPOSIT_AMOUNT * TEN_PERCENT * 3) / POOL_SCALAR + expectedRecipientAmount + ); + assertEq( + getAssetBalance(DEFAULT_RECIPIENT_4), + (POOL_DEPOSIT_AMOUNT * TEN_PERCENT * 5) / POOL_SCALAR + expectedRecipientAmount + ); + } + + function test_partialUpdateRecipientWeights() public { + //expected recipient amount is 1/4 of the pool deposit for original recipients + uint256 expectedRecipientAmount = POOL_DEPOSIT_AMOUNT / 4; + + //create a list of containing recipients from the primary configured set with their new weights + Common.AddressAndWeight[] memory recipients = new Common.AddressAndWeight[](2); + recipients[0] = Common.AddressAndWeight(DEFAULT_RECIPIENT_1, TEN_PERCENT); + recipients[1] = Common.AddressAndWeight(DEFAULT_RECIPIENT_2, TEN_PERCENT * 4); + + //updating a recipient should force the funds to be paid out for the primary recipients + updateRewardRecipients(PRIMARY_POOL_ID, recipients, ADMIN); + + //check each recipient received the correct amount + for (uint256 i; i < recipients.length; i++) { + //check the balance matches the ratio the recipient should have received + assertEq(getAssetBalance(recipients[i].addr), expectedRecipientAmount); + } + + //the reward manager should have half the funds remaining + assertEq(getAssetBalance(address(rewardManager)), POOL_DEPOSIT_AMOUNT / 2); + + //add more funds to the pool to check new distribution + addFundsToPool(PRIMARY_POOL_ID, getAsset(POOL_DEPOSIT_AMOUNT), FEE_MANAGER); + + //loop each user and claim the rewards + for (uint256 i; i < recipients.length; i++) { + //claim the rewards for this recipient + claimRewards(PRIMARY_POOL_ARRAY, recipients[i].addr); + } + + //manually check the balance of each recipient + assertEq( + getAssetBalance(DEFAULT_RECIPIENT_1), + (POOL_DEPOSIT_AMOUNT * TEN_PERCENT) / POOL_SCALAR + expectedRecipientAmount + ); + assertEq( + getAssetBalance(DEFAULT_RECIPIENT_2), + (POOL_DEPOSIT_AMOUNT * TEN_PERCENT * 4) / POOL_SCALAR + expectedRecipientAmount + ); + + //the reward manager should have half the funds remaining + assertEq(getAssetBalance(address(rewardManager)), POOL_DEPOSIT_AMOUNT); + } + + function test_eventIsEmittedUponUpdateRecipients() public { + //expect an emit + vm.expectEmit(); + + //emit the event that is expected to be emitted + emit RewardRecipientsUpdated(PRIMARY_POOL_ID, getPrimaryRecipients()); + + //expected recipient amount is 1/4 of the pool deposit + uint256 expectedRecipientAmount = POOL_DEPOSIT_AMOUNT / 4; + + //updating a recipient should force the funds to be paid out + updateRewardRecipients(PRIMARY_POOL_ID, getPrimaryRecipients(), ADMIN); + + //check each recipient received the correct amount + for (uint256 i; i < getPrimaryRecipients().length; i++) { + //check the balance matches the ratio the recipient should have received + assertEq(getAssetBalance(getPrimaryRecipients()[i].addr), expectedRecipientAmount); + } + } +} + +contract DestinationRewardManagerUpdateRewardRecipientsMultiplePoolsTest is BaseDestinationRewardManagerTest { + uint256 internal constant POOL_DEPOSIT_AMOUNT = 10e18; + + function setUp() public override { + //setup contracts + super.setUp(); + + //create a single pool for these tests + createPrimaryPool(); + createSecondaryPool(); + + //add funds to the pool to be split among the recipients + addFundsToPool(PRIMARY_POOL_ID, getAsset(POOL_DEPOSIT_AMOUNT), FEE_MANAGER); + addFundsToPool(SECONDARY_POOL_ID, getAsset(POOL_DEPOSIT_AMOUNT), FEE_MANAGER); + } + + function getSecondaryRecipients() public override returns (Common.AddressAndWeight[] memory) { + //for testing purposes, the primary and secondary pool to contain the same recipients + return getPrimaryRecipients(); + } + + function test_updatePrimaryRecipientWeights() public { + //expected recipient amount is 1/4 of the pool deposit for original recipients + uint256 expectedRecipientAmount = POOL_DEPOSIT_AMOUNT / 4; + + //create a list of containing recipients from the primary configured set, and new recipients + Common.AddressAndWeight[] memory recipients = new Common.AddressAndWeight[](4); + recipients[0] = Common.AddressAndWeight(DEFAULT_RECIPIENT_1, TEN_PERCENT * 4); + recipients[1] = Common.AddressAndWeight(DEFAULT_RECIPIENT_2, TEN_PERCENT * 4); + recipients[2] = Common.AddressAndWeight(DEFAULT_RECIPIENT_3, TEN_PERCENT); + recipients[3] = Common.AddressAndWeight(DEFAULT_RECIPIENT_4, TEN_PERCENT); + + //updating a recipient should force the funds to be paid out for the primary recipients + updateRewardRecipients(PRIMARY_POOL_ID, recipients, ADMIN); + + //check each recipient received the correct amount + for (uint256 i; i < recipients.length; i++) { + //check the balance matches the ratio the recipient should have received + assertEq(getAssetBalance(recipients[i].addr), expectedRecipientAmount); + } + + //the reward manager should still have the funds for the secondary pool + assertEq(getAssetBalance(address(rewardManager)), POOL_DEPOSIT_AMOUNT); + + //add more funds to the pool to check new distribution + addFundsToPool(PRIMARY_POOL_ID, getAsset(POOL_DEPOSIT_AMOUNT), FEE_MANAGER); + + //claim the rewards for the updated recipients manually + claimRewards(PRIMARY_POOL_ARRAY, recipients[0].addr); + claimRewards(PRIMARY_POOL_ARRAY, recipients[1].addr); + claimRewards(PRIMARY_POOL_ARRAY, recipients[2].addr); + claimRewards(PRIMARY_POOL_ARRAY, recipients[3].addr); + + //check the balance matches the ratio the recipient who were updated should have received + assertEq( + getAssetBalance(recipients[0].addr), + (POOL_DEPOSIT_AMOUNT * TEN_PERCENT * 4) / POOL_SCALAR + expectedRecipientAmount + ); + assertEq( + getAssetBalance(recipients[1].addr), + (POOL_DEPOSIT_AMOUNT * TEN_PERCENT * 4) / POOL_SCALAR + expectedRecipientAmount + ); + assertEq( + getAssetBalance(recipients[2].addr), + (POOL_DEPOSIT_AMOUNT * TEN_PERCENT) / POOL_SCALAR + expectedRecipientAmount + ); + assertEq( + getAssetBalance(recipients[3].addr), + (POOL_DEPOSIT_AMOUNT * TEN_PERCENT) / POOL_SCALAR + expectedRecipientAmount + ); + } +} diff --git a/contracts/src/v0.8/llo-feeds/v0.4.0/test/verifier/BaseDestinationVerifierTest.t.sol b/contracts/src/v0.8/llo-feeds/v0.4.0/test/verifier/BaseDestinationVerifierTest.t.sol new file mode 100644 index 00000000000..ec3b3a0eed7 --- /dev/null +++ b/contracts/src/v0.8/llo-feeds/v0.4.0/test/verifier/BaseDestinationVerifierTest.t.sol @@ -0,0 +1,347 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity 0.8.19; + +import {Test} from "forge-std/Test.sol"; +import {DestinationVerifierProxy} from "../../DestinationVerifierProxy.sol"; +import {IERC165} from "../../../../vendor/openzeppelin-solidity/v4.8.3/contracts/interfaces/IERC165.sol"; +import {IDestinationVerifier} from "../../interfaces/IDestinationVerifier.sol"; +import {IDestinationVerifierProxy} from "../../interfaces/IDestinationVerifierProxy.sol"; +import {DestinationVerifier} from "../../DestinationVerifier.sol"; +import {Strings} from "@openzeppelin/contracts/utils/Strings.sol"; +import {AccessControllerInterface} from "../../../../shared/interfaces/AccessControllerInterface.sol"; +import {DestinationFeeManager} from "../../DestinationFeeManager.sol"; +import {Common} from "../../../libraries/Common.sol"; +import {ERC20Mock} from "../../../../vendor/openzeppelin-solidity/v4.8.3/contracts/mocks/ERC20Mock.sol"; +import {WERC20Mock} from "../../../../shared/mocks/WERC20Mock.sol"; +import {DestinationRewardManager} from "../../DestinationRewardManager.sol"; +import {IDestinationRewardManager} from "../../interfaces/IDestinationRewardManager.sol"; + +contract BaseTest is Test { + uint64 internal constant POOL_SCALAR = 1e18; + uint64 internal constant ONE_PERCENT = POOL_SCALAR / 100; + uint256 internal constant MAX_ORACLES = 31; + address internal constant ADMIN = address(1); + address internal constant USER = address(2); + + address internal constant MOCK_VERIFIER_ADDRESS = address(100); + address internal constant ACCESS_CONTROLLER_ADDRESS = address(300); + + uint256 internal constant DEFAULT_REPORT_LINK_FEE = 1e10; + uint256 internal constant DEFAULT_REPORT_NATIVE_FEE = 1e12; + + uint64 internal constant VERIFIER_VERSION = 1; + + uint8 internal constant FAULT_TOLERANCE = 10; + + DestinationVerifierProxy internal s_verifierProxy; + DestinationVerifier internal s_verifier; + DestinationFeeManager internal feeManager; + DestinationRewardManager internal rewardManager; + ERC20Mock internal link; + WERC20Mock internal native; + + struct Signer { + uint256 mockPrivateKey; + address signerAddress; + } + + Signer[MAX_ORACLES] internal s_signers; + bytes32[] internal s_offchaintransmitters; + bool private s_baseTestInitialized; + + struct V3Report { + // The feed ID the report has data for + bytes32 feedId; + // The time the median value was observed on + uint32 observationsTimestamp; + // The timestamp the report is valid from + uint32 validFromTimestamp; + // The link fee + uint192 linkFee; + // The native fee + uint192 nativeFee; + // The expiry of the report + uint32 expiresAt; + // The median value agreed in an OCR round + int192 benchmarkPrice; + // The best bid value agreed in an OCR round + int192 bid; + // The best ask value agreed in an OCR round + int192 ask; + } + + bytes32 internal constant V_MASK = 0x0000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff; + bytes32 internal constant V1_BITMASK = 0x0001000000000000000000000000000000000000000000000000000000000000; + bytes32 internal constant V2_BITMASK = 0x0002000000000000000000000000000000000000000000000000000000000000; + bytes32 internal constant V3_BITMASK = 0x0003000000000000000000000000000000000000000000000000000000000000; + + bytes32 internal constant INVALID_FEED = keccak256("INVALID"); + uint32 internal constant OBSERVATIONS_TIMESTAMP = 1000; + uint64 internal constant BLOCKNUMBER_LOWER_BOUND = 1000; + uint64 internal constant BLOCKNUMBER_UPPER_BOUND = BLOCKNUMBER_LOWER_BOUND + 5; + int192 internal constant MEDIAN = 1 ether; + int192 internal constant BID = 500000000 gwei; + int192 internal constant ASK = 2 ether; + + //version 0 feeds + bytes32 internal constant FEED_ID = (keccak256("ETH-USD") & V_MASK) | V1_BITMASK; + bytes32 internal constant FEED_ID_2 = (keccak256("LINK-USD") & V_MASK) | V1_BITMASK; + bytes32 internal constant FEED_ID_3 = (keccak256("BTC-USD") & V_MASK) | V1_BITMASK; + + //version 3 feeds + bytes32 internal constant FEED_ID_V3 = (keccak256("ETH-USD") & V_MASK) | V3_BITMASK; + + function _encodeReport(V3Report memory report) internal pure returns (bytes memory) { + return + abi.encode( + report.feedId, + report.observationsTimestamp, + report.validFromTimestamp, + report.nativeFee, + report.linkFee, + report.expiresAt, + report.benchmarkPrice, + report.bid, + report.ask + ); + } + + function _generateSignerSignatures( + bytes memory report, + bytes32[3] memory reportContext, + Signer[] memory signers + ) internal pure returns (bytes32[] memory rawRs, bytes32[] memory rawSs, bytes32 rawVs) { + bytes32[] memory rs = new bytes32[](signers.length); + bytes32[] memory ss = new bytes32[](signers.length); + bytes memory vs = new bytes(signers.length); + + bytes32 hash = keccak256(abi.encodePacked(keccak256(report), reportContext)); + + for (uint256 i = 0; i < signers.length; i++) { + (uint8 v, bytes32 r, bytes32 s) = vm.sign(signers[i].mockPrivateKey, hash); + rs[i] = r; + ss[i] = s; + vs[i] = bytes1(v - 27); + } + return (rs, ss, bytes32(vs)); + } + + function _generateV3EncodedBlob( + V3Report memory report, + bytes32[3] memory reportContext, + Signer[] memory signers + ) internal pure returns (bytes memory) { + bytes memory reportBytes = _encodeReport(report); + (bytes32[] memory rs, bytes32[] memory ss, bytes32 rawVs) = _generateSignerSignatures( + reportBytes, + reportContext, + signers + ); + return abi.encode(reportContext, reportBytes, rs, ss, rawVs); + } + + function _verify(bytes memory payload, address feeAddress, uint256 wrappedNativeValue, address sender) internal { + address originalAddr = msg.sender; + changePrank(sender); + + s_verifierProxy.verify{value: wrappedNativeValue}(payload, abi.encode(feeAddress)); + + changePrank(originalAddr); + } + + function _generateV3Report() internal view returns (V3Report memory) { + return + V3Report({ + feedId: FEED_ID_V3, + observationsTimestamp: OBSERVATIONS_TIMESTAMP, + validFromTimestamp: uint32(block.timestamp), + nativeFee: uint192(DEFAULT_REPORT_NATIVE_FEE), + linkFee: uint192(DEFAULT_REPORT_LINK_FEE), + expiresAt: uint32(block.timestamp), + benchmarkPrice: MEDIAN, + bid: BID, + ask: ASK + }); + } + + function _verifyBulk( + bytes[] memory payload, + address feeAddress, + uint256 wrappedNativeValue, + address sender + ) internal { + address originalAddr = msg.sender; + changePrank(sender); + + s_verifierProxy.verifyBulk{value: wrappedNativeValue}(payload, abi.encode(feeAddress)); + + changePrank(originalAddr); + } + + function _approveLink(address spender, uint256 quantity, address sender) internal { + address originalAddr = msg.sender; + changePrank(sender); + + link.approve(spender, quantity); + changePrank(originalAddr); + } + + function setUp() public virtual { + // BaseTest.setUp is often called multiple times from tests' setUp due to inheritance. + if (s_baseTestInitialized) return; + s_baseTestInitialized = true; + vm.startPrank(ADMIN); + + s_verifierProxy = new DestinationVerifierProxy(); + s_verifier = new DestinationVerifier(address(s_verifierProxy)); + s_verifierProxy.setVerifier(address(s_verifier)); + + // setting up FeeManager and RewardManager + native = new WERC20Mock(); + link = new ERC20Mock("LINK", "LINK", ADMIN, 0); + rewardManager = new DestinationRewardManager(address(link)); + feeManager = new DestinationFeeManager(address(link), address(native), address(s_verifier), address(rewardManager)); + + for (uint256 i; i < MAX_ORACLES; i++) { + uint256 mockPK = i + 1; + s_signers[i].mockPrivateKey = mockPK; + s_signers[i].signerAddress = vm.addr(mockPK); + } + } + + function _getSigners(uint256 numSigners) internal view returns (Signer[] memory) { + Signer[] memory signers = new Signer[](numSigners); + for (uint256 i; i < numSigners; i++) { + signers[i] = s_signers[i]; + } + return signers; + } + + function _getSignerAddresses(Signer[] memory signers) internal pure returns (address[] memory) { + address[] memory signerAddrs = new address[](signers.length); + for (uint256 i = 0; i < signerAddrs.length; i++) { + signerAddrs[i] = signers[i].signerAddress; + } + return signerAddrs; + } + + function _signerAddressAndDonConfigKey(address signer, bytes24 donConfigId) internal pure returns (bytes32) { + return keccak256(abi.encodePacked(signer, donConfigId)); + } + + function _donConfigIdFromConfigData(address[] memory signers, uint8 f) internal pure returns (bytes24) { + Common._quickSort(signers, 0, int256(signers.length - 1)); + bytes24 donConfigId = bytes24(keccak256(abi.encodePacked(signers, f))); + return donConfigId; + } + + function assertReportsEqual(bytes memory response, V3Report memory testReport) public pure { + ( + bytes32 feedId, + uint32 observationsTimestamp, + uint32 validFromTimestamp, + uint192 nativeFee, + uint192 linkFee, + uint32 expiresAt, + int192 benchmarkPrice, + int192 bid, + int192 ask + ) = abi.decode(response, (bytes32, uint32, uint32, uint192, uint192, uint32, int192, int192, int192)); + assertEq(feedId, testReport.feedId); + assertEq(observationsTimestamp, testReport.observationsTimestamp); + assertEq(validFromTimestamp, testReport.validFromTimestamp); + assertEq(expiresAt, testReport.expiresAt); + assertEq(benchmarkPrice, testReport.benchmarkPrice); + assertEq(bid, testReport.bid); + assertEq(ask, testReport.ask); + assertEq(linkFee, testReport.linkFee); + assertEq(nativeFee, testReport.nativeFee); + } + + function _approveNative(address spender, uint256 quantity, address sender) internal { + address originalAddr = msg.sender; + changePrank(sender); + + native.approve(spender, quantity); + changePrank(originalAddr); + } +} + +contract VerifierWithFeeManager is BaseTest { + uint256 internal constant DEFAULT_LINK_MINT_QUANTITY = 100 ether; + uint256 internal constant DEFAULT_NATIVE_MINT_QUANTITY = 100 ether; + + function setUp() public virtual override { + BaseTest.setUp(); + + s_verifierProxy.setVerifier(address(s_verifier)); + s_verifier.setFeeManager(address(feeManager)); + rewardManager.addFeeManager(address(feeManager)); + + //mint some tokens to the user + link.mint(USER, DEFAULT_LINK_MINT_QUANTITY); + native.mint(USER, DEFAULT_NATIVE_MINT_QUANTITY); + vm.deal(USER, DEFAULT_NATIVE_MINT_QUANTITY); + + //mint some link tokens to the feeManager pool + link.mint(address(feeManager), DEFAULT_REPORT_LINK_FEE); + } +} + +contract MultipleVerifierWithMultipleFeeManagers is BaseTest { + uint256 internal constant DEFAULT_LINK_MINT_QUANTITY = 100 ether; + uint256 internal constant DEFAULT_NATIVE_MINT_QUANTITY = 100 ether; + + DestinationVerifier internal s_verifier2; + DestinationVerifier internal s_verifier3; + + DestinationVerifierProxy internal s_verifierProxy2; + DestinationVerifierProxy internal s_verifierProxy3; + + DestinationFeeManager internal feeManager2; + + function setUp() public virtual override { + /* + - Sets up 3 verifiers + - Sets up 2 Fee managers, wire the fee managers and verifiers + - Sets up a Reward Manager which can be used by both fee managers + */ + BaseTest.setUp(); + + s_verifierProxy2 = new DestinationVerifierProxy(); + s_verifierProxy3 = new DestinationVerifierProxy(); + + s_verifier2 = new DestinationVerifier(address(s_verifierProxy2)); + s_verifier3 = new DestinationVerifier(address(s_verifierProxy3)); + + s_verifierProxy2.setVerifier(address(s_verifier2)); + s_verifierProxy3.setVerifier(address(s_verifier3)); + + feeManager2 = new DestinationFeeManager( + address(link), + address(native), + address(s_verifier), + address(rewardManager) + ); + + s_verifier.setFeeManager(address(feeManager)); + s_verifier2.setFeeManager(address(feeManager)); + s_verifier3.setFeeManager(address(feeManager2)); + + // this is already set in the base contract + // feeManager.addVerifier(address(s_verifier)); + feeManager.addVerifier(address(s_verifier2)); + feeManager2.addVerifier(address(s_verifier3)); + + rewardManager.addFeeManager(address(feeManager)); + rewardManager.addFeeManager(address(feeManager2)); + + //mint some tokens to the user + link.mint(USER, DEFAULT_LINK_MINT_QUANTITY); + native.mint(USER, DEFAULT_NATIVE_MINT_QUANTITY); + vm.deal(USER, DEFAULT_NATIVE_MINT_QUANTITY); + + //mint some link tokens to the feeManager pool + link.mint(address(feeManager), DEFAULT_REPORT_LINK_FEE); + } +} diff --git a/contracts/src/v0.8/llo-feeds/v0.4.0/test/verifier/DestinationVerifierInterfacesTest.t.sol b/contracts/src/v0.8/llo-feeds/v0.4.0/test/verifier/DestinationVerifierInterfacesTest.t.sol new file mode 100644 index 00000000000..d4772ba1855 --- /dev/null +++ b/contracts/src/v0.8/llo-feeds/v0.4.0/test/verifier/DestinationVerifierInterfacesTest.t.sol @@ -0,0 +1,128 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity 0.8.19; + +import {Test} from "forge-std/Test.sol"; +import {VerifierWithFeeManager} from "./BaseDestinationVerifierTest.t.sol"; +import {DestinationVerifier} from "../../../v0.4.0/DestinationVerifier.sol"; +import {DestinationVerifierProxy} from "../../../v0.4.0/DestinationVerifierProxy.sol"; +import {AccessControllerInterface} from "../../../../shared/interfaces/AccessControllerInterface.sol"; +import {IDestinationFeeManager} from "../../../v0.4.0/interfaces/IDestinationFeeManager.sol"; +import {IDestinationRewardManager} from "../../../v0.4.0/interfaces/IDestinationRewardManager.sol"; +import {IDestinationVerifierProxy} from "../../../v0.4.0/interfaces/IDestinationVerifierProxy.sol"; +import {Common} from "../../../libraries/Common.sol"; +import {BaseTest} from "./BaseDestinationVerifierTest.t.sol"; +import {IERC20} from "../../../../vendor/openzeppelin-solidity/v4.8.3/contracts/interfaces/IERC20.sol"; + +/* +This test checks the interfaces of destination verifier matches the expectations. +The code here comes from this example: + +https://docs.chain.link/chainlink-automation/guides/streams-lookup + +*/ + +// Custom interfaces for IVerifierProxy and IFeeManager +interface IVerifierProxy { + /** + * @notice Verifies that the data encoded has been signed. + * correctly by routing to the correct verifier, and bills the user if applicable. + * @param payload The encoded data to be verified, including the signed + * report. + * @param parameterPayload Fee metadata for billing. For the current implementation this is just the abi-encoded fee token ERC-20 address. + * @return verifierResponse The encoded report from the verifier. + */ + function verify( + bytes calldata payload, + bytes calldata parameterPayload + ) external payable returns (bytes memory verifierResponse); + + function s_feeManager() external view returns (IDestinationFeeManager); +} + +interface IFeeManager { + /** + * @notice Calculates the fee and reward associated with verifying a report, including discounts for subscribers. + * This function assesses the fee and reward for report verification, applying a discount for recognized subscriber addresses. + * @param subscriber The address attempting to verify the report. A discount is applied if this address + * is recognized as a subscriber. + * @param unverifiedReport The report data awaiting verification. The content of this report is used to + * determine the base fee and reward, before considering subscriber discounts. + * @param quoteAddress The payment token address used for quoting fees and rewards. + * @return fee The fee assessed for verifying the report, with subscriber discounts applied where applicable. + * @return reward The reward allocated to the caller for successfully verifying the report. + * @return totalDiscount The total discount amount deducted from the fee for subscribers. + */ + function getFeeAndReward( + address subscriber, + bytes memory unverifiedReport, + address quoteAddress + ) external returns (Common.Asset memory, Common.Asset memory, uint256); + + function i_linkAddress() external view returns (address); + + function i_nativeAddress() external view returns (address); + + function i_rewardManager() external view returns (address); +} + +//Tests +// https://docs.chain.link/chainlink-automation/guides/streams-lookup +contract VerifierInterfacesTest is VerifierWithFeeManager { + address internal constant DEFAULT_RECIPIENT_1 = address(uint160(uint256(keccak256("DEFAULT_RECIPIENT_1")))); + + IVerifierProxy public verifier; + V3Report internal s_testReport; + + address public FEE_ADDRESS; + string public constant DATASTREAMS_FEEDLABEL = "feedIDs"; + string public constant DATASTREAMS_QUERYLABEL = "timestamp"; + int192 public last_retrieved_price; + bytes internal signedReport; + bytes32[3] internal s_reportContext; + uint8 MINIMAL_FAULT_TOLERANCE = 2; + + function setUp() public virtual override { + VerifierWithFeeManager.setUp(); + s_reportContext[0] = bytes32(abi.encode(uint32(5), uint8(1))); + Signer[] memory signers = _getSigners(MAX_ORACLES); + + s_testReport = V3Report({ + feedId: FEED_ID_V3, + observationsTimestamp: OBSERVATIONS_TIMESTAMP, + validFromTimestamp: uint32(block.timestamp), + nativeFee: uint192(DEFAULT_REPORT_NATIVE_FEE), + linkFee: uint192(DEFAULT_REPORT_LINK_FEE), + expiresAt: uint32(block.timestamp), + benchmarkPrice: MEDIAN, + bid: BID, + ask: ASK + }); + address[] memory signerAddrs = _getSignerAddresses(signers); + Common.AddressAndWeight[] memory weights = new Common.AddressAndWeight[](1); + weights[0] = Common.AddressAndWeight(DEFAULT_RECIPIENT_1, ONE_PERCENT * 100); + s_verifier.setConfig(signerAddrs, MINIMAL_FAULT_TOLERANCE, weights); + signedReport = _generateV3EncodedBlob(s_testReport, s_reportContext, signers); + + verifier = IVerifierProxy(address(s_verifierProxy)); + } + + function test_DestinationContractInterfaces() public { + bytes memory unverifiedReport = signedReport; + + (, bytes memory reportData) = abi.decode(unverifiedReport, (bytes32[3], bytes)); + + // Report verification fees + IFeeManager feeManager = IFeeManager(address(verifier.s_feeManager())); + IDestinationRewardManager rewardManager = IDestinationRewardManager(address(feeManager.i_rewardManager())); + + address feeTokenAddress = feeManager.i_linkAddress(); + (Common.Asset memory fee, , ) = feeManager.getFeeAndReward(address(this), reportData, feeTokenAddress); + + // Approve rewardManager to spend this contract's balance in fees + _approveLink(address(rewardManager), fee.amount, USER); + _verify(unverifiedReport, address(feeTokenAddress), 0, USER); + + assertEq(link.balanceOf(USER), DEFAULT_LINK_MINT_QUANTITY - fee.amount); + assertEq(link.balanceOf(address(rewardManager)), fee.amount); + } +} diff --git a/contracts/src/v0.8/llo-feeds/v0.4.0/test/verifier/DestinationVerifierProxyTest.t.sol b/contracts/src/v0.8/llo-feeds/v0.4.0/test/verifier/DestinationVerifierProxyTest.t.sol new file mode 100644 index 00000000000..2851057d0e8 --- /dev/null +++ b/contracts/src/v0.8/llo-feeds/v0.4.0/test/verifier/DestinationVerifierProxyTest.t.sol @@ -0,0 +1,38 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity 0.8.19; + +import {BaseTest} from "./BaseDestinationVerifierTest.t.sol"; +import {DestinationVerifierProxy} from "../../../v0.4.0/DestinationVerifierProxy.sol"; +import {DestinationVerifier} from "../../../v0.4.0/DestinationVerifier.sol"; +import {DestinationFeeManager} from "../../../v0.4.0/DestinationFeeManager.sol"; +import {IERC165} from "../../../../vendor/openzeppelin-solidity/v4.8.3/contracts/interfaces/IERC165.sol"; + +contract DestinationVerifierProxyInitializeVerifierTest is BaseTest { + function test_setVerifierCalledByNoOwner() public { + address STRANGER = address(999); + changePrank(STRANGER); + vm.expectRevert(bytes("Only callable by owner")); + s_verifierProxy.setVerifier(address(s_verifier)); + } + + function test_setVerifierWhichDoesntHonourInterface() public { + vm.expectRevert(abi.encodeWithSelector(DestinationVerifierProxy.VerifierInvalid.selector, address(rewardManager))); + s_verifierProxy.setVerifier(address(rewardManager)); + } + + function test_setVerifierOk() public { + s_verifierProxy.setVerifier(address(s_verifier)); + assertEq(s_verifierProxy.s_feeManager(), s_verifier.s_feeManager()); + assertEq(s_verifierProxy.s_accessController(), s_verifier.s_accessController()); + } + + function test_correctlySetsTheOwner() public { + DestinationVerifierProxy proxy = new DestinationVerifierProxy(); + assertEq(proxy.owner(), ADMIN); + } + + function test_correctlySetsVersion() public view { + string memory version = s_verifierProxy.typeAndVersion(); + assertEq(version, "DestinationVerifierProxy 0.4.0"); + } +} diff --git a/contracts/src/v0.8/llo-feeds/v0.4.0/test/verifier/DestinationVerifierRemoveLatestConfigTest.t.sol b/contracts/src/v0.8/llo-feeds/v0.4.0/test/verifier/DestinationVerifierRemoveLatestConfigTest.t.sol new file mode 100644 index 00000000000..6309efc9959 --- /dev/null +++ b/contracts/src/v0.8/llo-feeds/v0.4.0/test/verifier/DestinationVerifierRemoveLatestConfigTest.t.sol @@ -0,0 +1,126 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity 0.8.19; + +import {BaseTest} from "./BaseDestinationVerifierTest.t.sol"; +import {DestinationVerifier} from "../../../v0.4.0/DestinationVerifier.sol"; +import {DestinationRewardManager} from "../../../v0.4.0/DestinationRewardManager.sol"; +import {Common} from "../../../libraries/Common.sol"; + +contract DestinationVerifierSetConfigTest is BaseTest { + bytes32[3] internal s_reportContext; + V3Report internal s_testReport; + + function setUp() public virtual override { + BaseTest.setUp(); + s_reportContext[0] = bytes32(abi.encode(uint32(5), uint8(1))); + } + + function test_removeLatestConfigWhenNoConfigShouldFail() public { + vm.expectRevert(abi.encodeWithSelector(DestinationVerifier.DonConfigDoesNotExist.selector)); + s_verifier.removeLatestConfig(); + } + + function test_removeLatestConfig() public { + /* + This test sets two Configs: Config A and Config B. + - it removes and readds config B multiple times while trying Config A verifications + */ + Signer[] memory signers = _getSigners(MAX_ORACLES); + + uint8 MINIMAL_FAULT_TOLERANCE = 2; + BaseTest.Signer[] memory signersA = new BaseTest.Signer[](7); + signersA[0] = signers[0]; + signersA[1] = signers[1]; + signersA[2] = signers[2]; + signersA[3] = signers[3]; + signersA[4] = signers[4]; + signersA[5] = signers[5]; + signersA[6] = signers[6]; + + // ConfigA + address[] memory signersAddrA = _getSignerAddresses(signersA); + s_verifier.setConfig(signersAddrA, MINIMAL_FAULT_TOLERANCE, new Common.AddressAndWeight[](0)); + vm.warp(block.timestamp + 10); + V3Report memory s_testReportA = V3Report({ + feedId: FEED_ID_V3, + observationsTimestamp: OBSERVATIONS_TIMESTAMP, + validFromTimestamp: uint32(block.timestamp), + nativeFee: uint192(DEFAULT_REPORT_NATIVE_FEE), + linkFee: uint192(DEFAULT_REPORT_LINK_FEE), + expiresAt: uint32(block.timestamp), + benchmarkPrice: MEDIAN, + bid: BID, + ask: ASK + }); + + vm.warp(block.timestamp + 100); + // Config B + BaseTest.Signer[] memory signersB = new BaseTest.Signer[](7); + // signers in ConfigA + signersB[0] = signers[8]; + signersB[1] = signers[9]; + signersB[2] = signers[10]; + signersB[3] = signers[11]; + signersB[4] = signers[12]; + signersB[5] = signers[13]; + signersB[6] = signers[14]; + address[] memory signersAddrsB = _getSignerAddresses(signersB); + s_verifier.setConfig(signersAddrsB, MINIMAL_FAULT_TOLERANCE, new Common.AddressAndWeight[](0)); + + V3Report memory s_testReportB = V3Report({ + feedId: FEED_ID_V3, + observationsTimestamp: OBSERVATIONS_TIMESTAMP, + validFromTimestamp: uint32(block.timestamp), + nativeFee: uint192(DEFAULT_REPORT_NATIVE_FEE), + linkFee: uint192(DEFAULT_REPORT_LINK_FEE), + expiresAt: uint32(block.timestamp), + benchmarkPrice: MEDIAN, + bid: BID, + ask: ASK + }); + + BaseTest.Signer[] memory reportSignersA = new BaseTest.Signer[](3); + reportSignersA[0] = signers[0]; + reportSignersA[1] = signers[1]; + reportSignersA[2] = signers[2]; + + BaseTest.Signer[] memory reportSignersB = new BaseTest.Signer[](3); + reportSignersB[0] = signers[8]; + reportSignersB[1] = signers[9]; + reportSignersB[2] = signers[10]; + + bytes memory signedReportA = _generateV3EncodedBlob(s_testReportA, s_reportContext, reportSignersA); + bytes memory signedReportB = _generateV3EncodedBlob(s_testReportB, s_reportContext, reportSignersB); + + // verifying should work + s_verifierProxy.verify(signedReportA, abi.encode(native)); + s_verifierProxy.verify(signedReportB, abi.encode(native)); + + s_verifier.removeLatestConfig(); + + // this should remove the latest config, so ConfigA should be able to verify reports still + s_verifierProxy.verify(signedReportA, abi.encode(native)); + // this report cannot be verified any longer because ConfigB is not there + vm.expectRevert(abi.encodeWithSelector(DestinationVerifier.BadVerification.selector)); + s_verifierProxy.verify(signedReportB, abi.encode(native)); + + // since ConfigB is removed we should be able to set it again with no errors + s_verifier.setConfig(signersAddrsB, MINIMAL_FAULT_TOLERANCE, new Common.AddressAndWeight[](0)); + + // we should be able to remove ConfigB + s_verifier.removeLatestConfig(); + // removing configA + s_verifier.removeLatestConfig(); + + // verifigny should fail + // verifying should work + vm.expectRevert(abi.encodeWithSelector(DestinationVerifier.BadVerification.selector)); + s_verifierProxy.verify(signedReportA, abi.encode(native)); + vm.expectRevert(abi.encodeWithSelector(DestinationVerifier.BadVerification.selector)); + s_verifierProxy.verify(signedReportB, abi.encode(native)); + + // removing again should fail. no other configs exist + vm.expectRevert(abi.encodeWithSelector(DestinationVerifier.DonConfigDoesNotExist.selector)); + s_verifier.removeLatestConfig(); + } +} diff --git a/contracts/src/v0.8/llo-feeds/v0.4.0/test/verifier/DestinationVerifierSetAccessControllerTest.t.sol b/contracts/src/v0.8/llo-feeds/v0.4.0/test/verifier/DestinationVerifierSetAccessControllerTest.t.sol new file mode 100644 index 00000000000..d40b674f237 --- /dev/null +++ b/contracts/src/v0.8/llo-feeds/v0.4.0/test/verifier/DestinationVerifierSetAccessControllerTest.t.sol @@ -0,0 +1,33 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity 0.8.19; + +import {BaseTest} from "./BaseDestinationVerifierTest.t.sol"; + +contract DestinationVerifierSetAccessControllerTest is BaseTest { + event AccessControllerSet(address oldAccessController, address newAccessController); + + function test_revertsIfCalledByNonOwner() public { + vm.expectRevert("Only callable by owner"); + + changePrank(USER); + s_verifier.setAccessController(ACCESS_CONTROLLER_ADDRESS); + } + + function test_successfullySetsNewAccessController() public { + s_verifier.setAccessController(ACCESS_CONTROLLER_ADDRESS); + address ac = s_verifier.s_accessController(); + assertEq(ac, ACCESS_CONTROLLER_ADDRESS); + } + + function test_successfullySetsNewAccessControllerIsEmpty() public { + s_verifier.setAccessController(address(0)); + address ac = s_verifier.s_accessController(); + assertEq(ac, address(0)); + } + + function test_emitsTheCorrectEvent() public { + vm.expectEmit(true, false, false, false); + emit AccessControllerSet(address(0), ACCESS_CONTROLLER_ADDRESS); + s_verifier.setAccessController(ACCESS_CONTROLLER_ADDRESS); + } +} diff --git a/contracts/src/v0.8/llo-feeds/v0.4.0/test/verifier/DestinationVerifierSetConfigTest.t.sol b/contracts/src/v0.8/llo-feeds/v0.4.0/test/verifier/DestinationVerifierSetConfigTest.t.sol new file mode 100644 index 00000000000..4f96e4969a3 --- /dev/null +++ b/contracts/src/v0.8/llo-feeds/v0.4.0/test/verifier/DestinationVerifierSetConfigTest.t.sol @@ -0,0 +1,176 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity 0.8.19; + +import {BaseTest} from "./BaseDestinationVerifierTest.t.sol"; +import {DestinationVerifier} from "../../../v0.4.0/DestinationVerifier.sol"; +import {DestinationRewardManager} from "../../../v0.4.0/DestinationRewardManager.sol"; +import {Common} from "../../../libraries/Common.sol"; + +contract DestinationVerifierSetConfigTest is BaseTest { + function setUp() public virtual override { + BaseTest.setUp(); + } + + function test_revertsIfCalledByNonOwner() public { + vm.expectRevert("Only callable by owner"); + Signer[] memory signers = _getSigners(MAX_ORACLES); + changePrank(USER); + s_verifier.setConfig(_getSignerAddresses(signers), FAULT_TOLERANCE, new Common.AddressAndWeight[](0)); + } + + function test_revertsIfSetWithTooManySigners() public { + address[] memory signers = new address[](MAX_ORACLES + 1); + vm.expectRevert(abi.encodeWithSelector(DestinationVerifier.ExcessSigners.selector, signers.length, MAX_ORACLES)); + s_verifier.setConfig(signers, FAULT_TOLERANCE, new Common.AddressAndWeight[](0)); + } + + function test_revertsIfFaultToleranceIsZero() public { + vm.expectRevert(abi.encodeWithSelector(DestinationVerifier.FaultToleranceMustBePositive.selector)); + Signer[] memory signers = _getSigners(MAX_ORACLES); + s_verifier.setConfig(_getSignerAddresses(signers), 0, new Common.AddressAndWeight[](0)); + } + + function test_revertsIfNotEnoughSigners() public { + address[] memory signers = new address[](2); + signers[0] = address(1000); + signers[1] = address(1001); + + vm.expectRevert( + abi.encodeWithSelector(DestinationVerifier.InsufficientSigners.selector, signers.length, FAULT_TOLERANCE * 3 + 1) + ); + s_verifier.setConfig(signers, FAULT_TOLERANCE, new Common.AddressAndWeight[](0)); + } + + function test_revertsIfDuplicateSigners() public { + Signer[] memory signers = _getSigners(MAX_ORACLES); + address[] memory signerAddrs = _getSignerAddresses(signers); + signerAddrs[0] = signerAddrs[1]; + vm.expectRevert(abi.encodeWithSelector(DestinationVerifier.NonUniqueSignatures.selector)); + s_verifier.setConfig(signerAddrs, FAULT_TOLERANCE, new Common.AddressAndWeight[](0)); + } + + function test_revertsIfSignerContainsZeroAddress() public { + Signer[] memory signers = _getSigners(MAX_ORACLES); + address[] memory signerAddrs = _getSignerAddresses(signers); + signerAddrs[0] = address(0); + vm.expectRevert(abi.encodeWithSelector(DestinationVerifier.ZeroAddress.selector)); + s_verifier.setConfig(signerAddrs, FAULT_TOLERANCE, new Common.AddressAndWeight[](0)); + } + + function test_donConfigIdIsSameForSignersInDifferentOrder() public { + Signer[] memory signers = _getSigners(MAX_ORACLES); + address[] memory signerAddrs = _getSignerAddresses(signers); + + bytes24 expectedDonConfigId = _donConfigIdFromConfigData(signerAddrs, FAULT_TOLERANCE); + + s_verifier.setConfig(signerAddrs, FAULT_TOLERANCE, new Common.AddressAndWeight[](0)); + vm.warp(block.timestamp + 1); + + address temp = signerAddrs[0]; + signerAddrs[0] = signerAddrs[1]; + signerAddrs[1] = temp; + + vm.expectRevert(abi.encodeWithSelector(DestinationVerifier.DonConfigAlreadyExists.selector, expectedDonConfigId)); + + s_verifier.setConfig(signerAddrs, FAULT_TOLERANCE, new Common.AddressAndWeight[](0)); + } + + function test_NoDonConfigAlreadyExists() public { + Signer[] memory signers = _getSigners(MAX_ORACLES); + address[] memory signerAddrs = _getSignerAddresses(signers); + + s_verifier.setConfig(signerAddrs, FAULT_TOLERANCE, new Common.AddressAndWeight[](0)); + + vm.warp(block.timestamp + 1); + + // testing adding same set of Signers but different FAULT_TOLERENCE does not result in DonConfigAlreadyExists revert + s_verifier.setConfig(signerAddrs, FAULT_TOLERANCE - 1, new Common.AddressAndWeight[](0)); + + vm.warp(block.timestamp + 1); + + // testing adding a different set of Signers with same FAULT_TOLERENCE does not result in DonConfigAlreadyExists revert + address[] memory signerAddrsMinusOne = new address[](signerAddrs.length - 1); + for (uint256 i = 0; i < signerAddrs.length - 1; i++) { + signerAddrsMinusOne[i] = signerAddrs[i]; + } + s_verifier.setConfig(signerAddrsMinusOne, FAULT_TOLERANCE - 1, new Common.AddressAndWeight[](0)); + } + + function test_addressesAndWeightsDoNotProduceSideEffectsInDonConfigIds() public { + Signer[] memory signers = _getSigners(MAX_ORACLES); + address[] memory signerAddrs = _getSignerAddresses(signers); + + s_verifier.setConfig(signerAddrs, FAULT_TOLERANCE, new Common.AddressAndWeight[](0)); + vm.warp(block.timestamp + 1); + + bytes24 expectedDonConfigId = _donConfigIdFromConfigData(signerAddrs, FAULT_TOLERANCE); + + vm.expectRevert(abi.encodeWithSelector(DestinationVerifier.DonConfigAlreadyExists.selector, expectedDonConfigId)); + + // Same call to setConfig with different addressAndWeights do not entail a new DonConfigID + // Resulting in a DonConfigAlreadyExists error + Common.AddressAndWeight[] memory weights = new Common.AddressAndWeight[](1); + weights[0] = Common.AddressAndWeight(signers[0].signerAddress, 1); + s_verifier.setConfig(signerAddrs, FAULT_TOLERANCE, weights); + } + + function test_setConfigActiveUnknownDonConfigId() public { + vm.expectRevert(abi.encodeWithSelector(DestinationVerifier.DonConfigDoesNotExist.selector)); + s_verifier.setConfigActive(3, true); + } + + function test_setConfigWithActivationTime() public { + // simple case setting a config with specific activation time + Signer[] memory signers = _getSigners(MAX_ORACLES); + address[] memory signerAddrs = _getSignerAddresses(signers); + uint32 activationTime = 10; + s_verifier.setConfigWithActivationTime( + signerAddrs, + FAULT_TOLERANCE, + new Common.AddressAndWeight[](0), + activationTime + ); + } + + function test_setConfigWithActivationTimeNoFutureTimeShouldFail() public { + // calling setConfigWithActivationTime with a future timestamp should fail + Signer[] memory signers = _getSigners(MAX_ORACLES); + address[] memory signerAddrs = _getSignerAddresses(signers); + uint32 activationTime = uint32(block.timestamp) + 100; + vm.expectRevert(abi.encodeWithSelector(DestinationVerifier.BadActivationTime.selector)); + s_verifier.setConfigWithActivationTime( + signerAddrs, + FAULT_TOLERANCE, + new Common.AddressAndWeight[](0), + activationTime + ); + } + + function test_setConfigWithActivationTimeEarlierThanLatestConfigShouldFail() public { + // setting a config older than the latest current config should fail + Signer[] memory signers = _getSigners(MAX_ORACLES); + address[] memory signerAddrs = _getSignerAddresses(signers); + uint32 oldActivationTime = uint32(block.timestamp) - 1; + // sets a config with timestamp = block.timestamp + s_verifier.setConfig(signerAddrs, FAULT_TOLERANCE, new Common.AddressAndWeight[](0)); + // setting a config with ealier timestamp retuls in failure + vm.expectRevert(abi.encodeWithSelector(DestinationVerifier.BadActivationTime.selector)); + s_verifier.setConfigWithActivationTime( + signerAddrs, + FAULT_TOLERANCE - 1, + new Common.AddressAndWeight[](0), + oldActivationTime + ); + } + + function test_setConfigWithActivationTimeTheSameAsLatestConfigShouldFail() public { + // setting a config older than the latest current config should fail + Signer[] memory signers = _getSigners(MAX_ORACLES); + address[] memory signerAddrs = _getSignerAddresses(signers); + // sets a config with timestamp = block.timestamp + s_verifier.setConfig(signerAddrs, FAULT_TOLERANCE, new Common.AddressAndWeight[](0)); + // setting a config with ealier timestamp retuls in failure + vm.expectRevert(abi.encodeWithSelector(DestinationVerifier.BadActivationTime.selector)); + s_verifier.setConfig(signerAddrs, FAULT_TOLERANCE, new Common.AddressAndWeight[](0)); + } +} diff --git a/contracts/src/v0.8/llo-feeds/v0.4.0/test/verifier/DestinationVerifierSetFeeManagerTest.t.sol b/contracts/src/v0.8/llo-feeds/v0.4.0/test/verifier/DestinationVerifierSetFeeManagerTest.t.sol new file mode 100644 index 00000000000..fdf75d6845b --- /dev/null +++ b/contracts/src/v0.8/llo-feeds/v0.4.0/test/verifier/DestinationVerifierSetFeeManagerTest.t.sol @@ -0,0 +1,28 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity 0.8.19; + +import {BaseTest} from "./BaseDestinationVerifierTest.t.sol"; +import {DestinationVerifier} from "../../../v0.4.0/DestinationVerifier.sol"; + +contract VerifierSetAccessControllerTest is BaseTest { + event FeeManagerSet(address oldFeeManager, address newFeeManager); + + function test_revertsIfCalledByNonOwner() public { + vm.expectRevert("Only callable by owner"); + changePrank(USER); + s_verifier.setFeeManager(address(feeManager)); + } + + function test_successfullySetsNewFeeManager() public { + vm.expectEmit(true, false, false, false); + emit FeeManagerSet(address(0), ACCESS_CONTROLLER_ADDRESS); + s_verifier.setFeeManager(address(feeManager)); + address ac = s_verifier.s_feeManager(); + assertEq(ac, address(feeManager)); + } + + function test_setFeeManagerWhichDoesntHonourInterface() public { + vm.expectRevert(abi.encodeWithSelector(DestinationVerifier.FeeManagerInvalid.selector)); + s_verifier.setFeeManager(address(rewardManager)); + } +} diff --git a/contracts/src/v0.8/llo-feeds/v0.4.0/test/verifier/DestinationVerifierTest.t.sol b/contracts/src/v0.8/llo-feeds/v0.4.0/test/verifier/DestinationVerifierTest.t.sol new file mode 100644 index 00000000000..476acbf806d --- /dev/null +++ b/contracts/src/v0.8/llo-feeds/v0.4.0/test/verifier/DestinationVerifierTest.t.sol @@ -0,0 +1,34 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity 0.8.19; + +import {BaseTest} from "./BaseDestinationVerifierTest.t.sol"; +import {DestinationVerifier} from "../../../v0.4.0/DestinationVerifier.sol"; +import {IDestinationVerifier} from "../../../v0.4.0/interfaces/IDestinationVerifier.sol"; +import {IDestinationVerifierProxyVerifier} from "../../../v0.4.0/interfaces/IDestinationVerifierProxyVerifier.sol"; + +contract DestinationVerifierConstructorTest is BaseTest { + bytes32[3] internal s_reportContext; + + function test_revertsIfInitializedWithEmptyVerifierProxy() public { + vm.expectRevert(abi.encodeWithSelector(DestinationVerifier.ZeroAddress.selector)); + new DestinationVerifier(address(0)); + } + + function test_typeAndVersion() public { + DestinationVerifier v = new DestinationVerifier(address(s_verifierProxy)); + assertEq(v.owner(), ADMIN); + string memory typeAndVersion = s_verifier.typeAndVersion(); + assertEq(typeAndVersion, "DestinationVerifier 0.4.0"); + } + + function test_falseIfIsNotCorrectInterface() public view { + bool isInterface = s_verifier.supportsInterface(bytes4("abcd")); + assertEq(isInterface, false); + } + + function test_trueIfIsCorrectInterface() public view { + bool isInterface = s_verifier.supportsInterface(type(IDestinationVerifier).interfaceId) && + s_verifier.supportsInterface(type(IDestinationVerifierProxyVerifier).interfaceId); + assertEq(isInterface, true); + } +} diff --git a/contracts/src/v0.8/llo-feeds/v0.4.0/test/verifier/DestinationVerifierTestBillingReport.t.sol b/contracts/src/v0.8/llo-feeds/v0.4.0/test/verifier/DestinationVerifierTestBillingReport.t.sol new file mode 100644 index 00000000000..574e169cf26 --- /dev/null +++ b/contracts/src/v0.8/llo-feeds/v0.4.0/test/verifier/DestinationVerifierTestBillingReport.t.sol @@ -0,0 +1,189 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity 0.8.19; + +import {VerifierWithFeeManager} from "./BaseDestinationVerifierTest.t.sol"; +import {DestinationVerifier} from "../../../v0.4.0/DestinationVerifier.sol"; +import {DestinationVerifierProxy} from "../../../v0.4.0/DestinationVerifierProxy.sol"; +import {AccessControllerInterface} from "../../../../shared/interfaces/AccessControllerInterface.sol"; +import {Common} from "../../../libraries/Common.sol"; + +contract VerifierBillingTests is VerifierWithFeeManager { + bytes32[3] internal s_reportContext; + V3Report internal s_testReportThree; + + function setUp() public virtual override { + VerifierWithFeeManager.setUp(); + s_reportContext[0] = bytes32(abi.encode(uint32(5), uint8(1))); + s_testReportThree = V3Report({ + feedId: FEED_ID_V3, + observationsTimestamp: OBSERVATIONS_TIMESTAMP, + validFromTimestamp: uint32(block.timestamp), + nativeFee: uint192(DEFAULT_REPORT_NATIVE_FEE), + linkFee: uint192(DEFAULT_REPORT_LINK_FEE), + expiresAt: uint32(block.timestamp), + benchmarkPrice: MEDIAN, + bid: BID, + ask: ASK + }); + } + + function test_verifyWithLinkV3Report() public { + Signer[] memory signers = _getSigners(MAX_ORACLES); + address[] memory signerAddrs = _getSignerAddresses(signers); + Common.AddressAndWeight[] memory weights = new Common.AddressAndWeight[](0); + s_verifier.setConfig(signerAddrs, FAULT_TOLERANCE, weights); + bytes memory signedReport = _generateV3EncodedBlob(s_testReportThree, s_reportContext, signers); + bytes32 expectedDonConfigId = _donConfigIdFromConfigData(signerAddrs, FAULT_TOLERANCE); + + _approveLink(address(rewardManager), DEFAULT_REPORT_LINK_FEE, USER); + _verify(signedReport, address(link), 0, USER); + assertEq(link.balanceOf(USER), DEFAULT_LINK_MINT_QUANTITY - DEFAULT_REPORT_LINK_FEE); + + // internal state checks + assertEq(feeManager.s_linkDeficit(expectedDonConfigId), 0); + assertEq(rewardManager.s_totalRewardRecipientFees(expectedDonConfigId), DEFAULT_REPORT_LINK_FEE); + assertEq(link.balanceOf(address(rewardManager)), DEFAULT_REPORT_LINK_FEE); + } + + function test_verifyWithNativeERC20() public { + Signer[] memory signers = _getSigners(MAX_ORACLES); + address[] memory signerAddrs = _getSignerAddresses(signers); + Common.AddressAndWeight[] memory weights = new Common.AddressAndWeight[](1); + weights[0] = Common.AddressAndWeight(signerAddrs[0], ONE_PERCENT * 100); + + s_verifier.setConfig(signerAddrs, FAULT_TOLERANCE, weights); + bytes memory signedReport = _generateV3EncodedBlob( + s_testReportThree, + s_reportContext, + _getSigners(FAULT_TOLERANCE + 1) + ); + _approveNative(address(feeManager), DEFAULT_REPORT_NATIVE_FEE, USER); + _verify(signedReport, address(native), 0, USER); + assertEq(native.balanceOf(USER), DEFAULT_NATIVE_MINT_QUANTITY - DEFAULT_REPORT_NATIVE_FEE); + + assertEq(link.balanceOf(address(rewardManager)), DEFAULT_REPORT_LINK_FEE); + } + + function test_verifyWithNativeUnwrapped() public { + Signer[] memory signers = _getSigners(MAX_ORACLES); + address[] memory signerAddrs = _getSignerAddresses(signers); + Common.AddressAndWeight[] memory weights = new Common.AddressAndWeight[](0); + + s_verifier.setConfig(signerAddrs, FAULT_TOLERANCE, weights); + bytes memory signedReport = _generateV3EncodedBlob( + s_testReportThree, + s_reportContext, + _getSigners(FAULT_TOLERANCE + 1) + ); + _verify(signedReport, address(native), DEFAULT_REPORT_NATIVE_FEE, USER); + + assertEq(USER.balance, DEFAULT_NATIVE_MINT_QUANTITY - DEFAULT_REPORT_NATIVE_FEE); + assertEq(address(feeManager).balance, 0); + } + + function test_verifyWithNativeUnwrappedReturnsChange() public { + Signer[] memory signers = _getSigners(MAX_ORACLES); + address[] memory signerAddrs = _getSignerAddresses(signers); + Common.AddressAndWeight[] memory weights = new Common.AddressAndWeight[](0); + + s_verifier.setConfig(signerAddrs, FAULT_TOLERANCE, weights); + bytes memory signedReport = _generateV3EncodedBlob( + s_testReportThree, + s_reportContext, + _getSigners(FAULT_TOLERANCE + 1) + ); + + _verify(signedReport, address(native), DEFAULT_REPORT_NATIVE_FEE * 2, USER); + assertEq(USER.balance, DEFAULT_NATIVE_MINT_QUANTITY - DEFAULT_REPORT_NATIVE_FEE); + assertEq(address(feeManager).balance, 0); + } +} + +contract DestinationVerifierBulkVerifyBillingReport is VerifierWithFeeManager { + uint256 internal constant NUMBERS_OF_REPORTS = 5; + + bytes32[3] internal s_reportContext; + + function setUp() public virtual override { + VerifierWithFeeManager.setUp(); + // setting a DonConfig we can reuse in the rest of tests + s_reportContext[0] = bytes32(abi.encode(uint32(5), uint8(1))); + Signer[] memory signers = _getSigners(MAX_ORACLES); + address[] memory signerAddrs = _getSignerAddresses(signers); + Common.AddressAndWeight[] memory weights = new Common.AddressAndWeight[](0); + s_verifier.setConfig(signerAddrs, FAULT_TOLERANCE, weights); + } + + function test_verifyWithBulkLink() public { + bytes memory signedReport = _generateV3EncodedBlob( + _generateV3Report(), + s_reportContext, + _getSigners(FAULT_TOLERANCE + 1) + ); + + bytes[] memory signedReports = new bytes[](NUMBERS_OF_REPORTS); + for (uint256 i = 0; i < NUMBERS_OF_REPORTS; i++) { + signedReports[i] = signedReport; + } + + _approveLink(address(rewardManager), DEFAULT_REPORT_LINK_FEE * NUMBERS_OF_REPORTS, USER); + + _verifyBulk(signedReports, address(link), 0, USER); + + assertEq(link.balanceOf(USER), DEFAULT_LINK_MINT_QUANTITY - DEFAULT_REPORT_LINK_FEE * NUMBERS_OF_REPORTS); + assertEq(link.balanceOf(address(rewardManager)), DEFAULT_REPORT_LINK_FEE * NUMBERS_OF_REPORTS); + } + + function test_verifyWithBulkNative() public { + bytes memory signedReport = _generateV3EncodedBlob( + _generateV3Report(), + s_reportContext, + _getSigners(FAULT_TOLERANCE + 1) + ); + + bytes[] memory signedReports = new bytes[](NUMBERS_OF_REPORTS); + for (uint256 i = 0; i < NUMBERS_OF_REPORTS; i++) { + signedReports[i] = signedReport; + } + + _approveNative(address(feeManager), DEFAULT_REPORT_NATIVE_FEE * NUMBERS_OF_REPORTS, USER); + _verifyBulk(signedReports, address(native), 0, USER); + assertEq(native.balanceOf(USER), DEFAULT_NATIVE_MINT_QUANTITY - DEFAULT_REPORT_NATIVE_FEE * NUMBERS_OF_REPORTS); + } + + function test_verifyWithBulkNativeUnwrapped() public { + bytes memory signedReport = _generateV3EncodedBlob( + _generateV3Report(), + s_reportContext, + _getSigners(FAULT_TOLERANCE + 1) + ); + + bytes[] memory signedReports = new bytes[](NUMBERS_OF_REPORTS); + for (uint256 i; i < NUMBERS_OF_REPORTS; i++) { + signedReports[i] = signedReport; + } + + _verifyBulk(signedReports, address(native), 200 * DEFAULT_REPORT_NATIVE_FEE * NUMBERS_OF_REPORTS, USER); + + assertEq(USER.balance, DEFAULT_NATIVE_MINT_QUANTITY - DEFAULT_REPORT_NATIVE_FEE * 5); + assertEq(address(feeManager).balance, 0); + } + + function test_verifyWithBulkNativeUnwrappedReturnsChange() public { + bytes memory signedReport = _generateV3EncodedBlob( + _generateV3Report(), + s_reportContext, + _getSigners(FAULT_TOLERANCE + 1) + ); + + bytes[] memory signedReports = new bytes[](NUMBERS_OF_REPORTS); + for (uint256 i = 0; i < NUMBERS_OF_REPORTS; i++) { + signedReports[i] = signedReport; + } + + _verifyBulk(signedReports, address(native), DEFAULT_REPORT_NATIVE_FEE * (NUMBERS_OF_REPORTS * 2), USER); + + assertEq(USER.balance, DEFAULT_NATIVE_MINT_QUANTITY - DEFAULT_REPORT_NATIVE_FEE * NUMBERS_OF_REPORTS); + assertEq(address(feeManager).balance, 0); + } +} diff --git a/contracts/src/v0.8/llo-feeds/v0.4.0/test/verifier/DestinationVerifierTestRewards.t.sol b/contracts/src/v0.8/llo-feeds/v0.4.0/test/verifier/DestinationVerifierTestRewards.t.sol new file mode 100644 index 00000000000..8ca954b8cac --- /dev/null +++ b/contracts/src/v0.8/llo-feeds/v0.4.0/test/verifier/DestinationVerifierTestRewards.t.sol @@ -0,0 +1,227 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity 0.8.19; + +import {VerifierWithFeeManager} from "./BaseDestinationVerifierTest.t.sol"; +import {DestinationVerifier} from "../../../v0.4.0/DestinationVerifier.sol"; +import {DestinationVerifierProxy} from "../../../v0.4.0/DestinationVerifierProxy.sol"; +import {AccessControllerInterface} from "../../../../shared/interfaces/AccessControllerInterface.sol"; +import {Common} from "../../../libraries/Common.sol"; + +contract VerifierBillingTests is VerifierWithFeeManager { + uint8 MINIMAL_FAULT_TOLERANCE = 2; + address internal constant DEFAULT_RECIPIENT_1 = address(uint160(uint256(keccak256("DEFAULT_RECIPIENT_1")))); + address internal constant DEFAULT_RECIPIENT_2 = address(uint160(uint256(keccak256("DEFAULT_RECIPIENT_2")))); + address internal constant DEFAULT_RECIPIENT_3 = address(uint160(uint256(keccak256("DEFAULT_RECIPIENT_3")))); + address internal constant DEFAULT_RECIPIENT_4 = address(uint160(uint256(keccak256("DEFAULT_RECIPIENT_4")))); + address internal constant DEFAULT_RECIPIENT_5 = address(uint160(uint256(keccak256("DEFAULT_RECIPIENT_5")))); + address internal constant DEFAULT_RECIPIENT_6 = address(uint160(uint256(keccak256("DEFAULT_RECIPIENT_6")))); + address internal constant DEFAULT_RECIPIENT_7 = address(uint160(uint256(keccak256("DEFAULT_RECIPIENT_7")))); + + function payRecipients(bytes32 poolId, address[] memory recipients, address sender) public { + //record the current address and switch to the recipient + address originalAddr = msg.sender; + changePrank(sender); + + //pay the recipients + rewardManager.payRecipients(poolId, recipients); + + //change back to the original address + changePrank(originalAddr); + } + + bytes32[3] internal s_reportContext; + V3Report internal s_testReport; + + function setUp() public virtual override { + VerifierWithFeeManager.setUp(); + s_reportContext[0] = bytes32(abi.encode(uint32(5), uint8(1))); + s_testReport = generateReportAtTimestamp(block.timestamp); + } + + function generateReportAtTimestamp(uint256 timestamp) public pure returns (V3Report memory) { + return + V3Report({ + feedId: FEED_ID_V3, + observationsTimestamp: OBSERVATIONS_TIMESTAMP, + validFromTimestamp: uint32(timestamp), + nativeFee: uint192(DEFAULT_REPORT_NATIVE_FEE), + linkFee: uint192(DEFAULT_REPORT_LINK_FEE), + // ask michael about this expires at, is it usually set at what blocks + expiresAt: uint32(timestamp) + 500, + benchmarkPrice: MEDIAN, + bid: BID, + ask: ASK + }); + } + + function getRecipientAndWeightsGroup2() public pure returns (Common.AddressAndWeight[] memory, address[] memory) { + address[] memory recipients = new address[](4); + recipients[0] = DEFAULT_RECIPIENT_4; + recipients[1] = DEFAULT_RECIPIENT_5; + recipients[2] = DEFAULT_RECIPIENT_6; + recipients[3] = DEFAULT_RECIPIENT_7; + + Common.AddressAndWeight[] memory weights = new Common.AddressAndWeight[](4); + //init each recipient with even weights. 2500 = 25% of pool + weights[0] = Common.AddressAndWeight(DEFAULT_RECIPIENT_4, POOL_SCALAR / 4); + weights[1] = Common.AddressAndWeight(DEFAULT_RECIPIENT_5, POOL_SCALAR / 4); + weights[2] = Common.AddressAndWeight(DEFAULT_RECIPIENT_6, POOL_SCALAR / 4); + weights[3] = Common.AddressAndWeight(DEFAULT_RECIPIENT_7, POOL_SCALAR / 4); + return (weights, recipients); + } + + function getRecipientAndWeightsGroup1() public pure returns (Common.AddressAndWeight[] memory, address[] memory) { + address[] memory recipients = new address[](4); + recipients[0] = DEFAULT_RECIPIENT_1; + recipients[1] = DEFAULT_RECIPIENT_2; + recipients[2] = DEFAULT_RECIPIENT_3; + recipients[3] = DEFAULT_RECIPIENT_4; + + Common.AddressAndWeight[] memory weights = new Common.AddressAndWeight[](4); + //init each recipient with even weights. 2500 = 25% of pool + weights[0] = Common.AddressAndWeight(DEFAULT_RECIPIENT_1, POOL_SCALAR / 4); + weights[1] = Common.AddressAndWeight(DEFAULT_RECIPIENT_2, POOL_SCALAR / 4); + weights[2] = Common.AddressAndWeight(DEFAULT_RECIPIENT_3, POOL_SCALAR / 4); + weights[3] = Common.AddressAndWeight(DEFAULT_RECIPIENT_4, POOL_SCALAR / 4); + return (weights, recipients); + } + + function test_rewardsAreDistributedAccordingToWeights() public { + /* + Simple test verifying that rewards are distributed according to address and weights + associated to the DonConfig used to verify the report + */ + Signer[] memory signers = _getSigners(MAX_ORACLES); + address[] memory signerAddrs = _getSignerAddresses(signers); + Common.AddressAndWeight[] memory weights = new Common.AddressAndWeight[](1); + weights[0] = Common.AddressAndWeight(DEFAULT_RECIPIENT_1, ONE_PERCENT * 100); + s_verifier.setConfig(signerAddrs, FAULT_TOLERANCE, weights); + bytes memory signedReport = _generateV3EncodedBlob(s_testReport, s_reportContext, signers); + bytes32 expectedDonConfigId = _donConfigIdFromConfigData(signerAddrs, FAULT_TOLERANCE); + + _approveLink(address(rewardManager), DEFAULT_REPORT_LINK_FEE, USER); + _verify(signedReport, address(link), 0, USER); + assertEq(link.balanceOf(USER), DEFAULT_LINK_MINT_QUANTITY - DEFAULT_REPORT_LINK_FEE); + + // internal state checks + assertEq(feeManager.s_linkDeficit(expectedDonConfigId), 0); + assertEq(rewardManager.s_totalRewardRecipientFees(expectedDonConfigId), DEFAULT_REPORT_LINK_FEE); + assertEq(link.balanceOf(address(rewardManager)), DEFAULT_REPORT_LINK_FEE); + + // check the recipients are paid according to weights + address[] memory recipients = new address[](1); + recipients[0] = DEFAULT_RECIPIENT_1; + payRecipients(expectedDonConfigId, recipients, ADMIN); + assertEq(link.balanceOf(recipients[0]), DEFAULT_REPORT_LINK_FEE); + assertEq(link.balanceOf(address(rewardManager)), 0); + } + + function test_rewardsAreDistributedAccordingToWeightsMultipleWeigths() public { + /* + Rewards are distributed according to AddressAndWeight's + associated to the DonConfig used to verify the report: + - multiple recipients + - multiple verifications + */ + Signer[] memory signers = _getSigners(MAX_ORACLES); + address[] memory signerAddrs = _getSignerAddresses(signers); + (Common.AddressAndWeight[] memory weights, address[] memory recipients) = getRecipientAndWeightsGroup1(); + s_verifier.setConfig(signerAddrs, FAULT_TOLERANCE, weights); + + bytes memory signedReport = _generateV3EncodedBlob(s_testReport, s_reportContext, signers); + bytes32 expectedDonConfigId = _donConfigIdFromConfigData(signerAddrs, FAULT_TOLERANCE); + + uint256 number_of_reports_verified = 10; + + for (uint256 i = 0; i < number_of_reports_verified; i++) { + _approveLink(address(rewardManager), DEFAULT_REPORT_LINK_FEE, USER); + _verify(signedReport, address(link), 0, USER); + } + + uint256 expected_pool_amount = DEFAULT_REPORT_LINK_FEE * number_of_reports_verified; + + //each recipient should receive 1/4 of the pool + uint256 expectedRecipientAmount = expected_pool_amount / 4; + + payRecipients(expectedDonConfigId, recipients, ADMIN); + for (uint256 i = 0; i < recipients.length; i++) { + // checking each recipient got rewards as set by the weights + assertEq(link.balanceOf(recipients[i]), expectedRecipientAmount); + } + // checking nothing left in reward manager + assertEq(link.balanceOf(address(rewardManager)), 0); + } + + function test_rewardsAreDistributedAccordingToWeightsUsingHistoricalConfigs() public { + /* + Verifies that reports verified with historical give rewards according to the verifying config AddressAndWeight. + - Sets two Configs: ConfigA and ConfigB, These two Configs have different Recipient and Weights + - Verifies a couple reports with each config + - Pays recipients + - Asserts expected rewards for each recipient + */ + + Signer[] memory signers = _getSigners(10); + address[] memory signerAddrs = _getSignerAddresses(signers); + + (Common.AddressAndWeight[] memory weights, address[] memory recipients) = getRecipientAndWeightsGroup1(); + + // Create ConfigA + s_verifier.setConfig(signerAddrs, MINIMAL_FAULT_TOLERANCE, weights); + vm.warp(block.timestamp + 100); + + V3Report memory testReportAtT1 = generateReportAtTimestamp(block.timestamp); + bytes memory signedReportT1 = _generateV3EncodedBlob(testReportAtT1, s_reportContext, signers); + bytes32 expectedDonConfigIdA = _donConfigIdFromConfigData(signerAddrs, MINIMAL_FAULT_TOLERANCE); + + uint256 number_of_reports_verified = 2; + + // advancing the blocktimestamp so we can test verifying with configs + vm.warp(block.timestamp + 100); + + Signer[] memory signers2 = _getSigners(12); + address[] memory signerAddrs2 = _getSignerAddresses(signers2); + (Common.AddressAndWeight[] memory weights2, address[] memory recipients2) = getRecipientAndWeightsGroup2(); + + // Create ConfigB + s_verifier.setConfig(signerAddrs2, MINIMAL_FAULT_TOLERANCE, weights2); + bytes32 expectedDonConfigIdB = _donConfigIdFromConfigData(signerAddrs2, MINIMAL_FAULT_TOLERANCE); + + V3Report memory testReportAtT2 = generateReportAtTimestamp(block.timestamp); + + // verifiying using ConfigA (report with Old timestamp) + for (uint256 i = 0; i < number_of_reports_verified; i++) { + _approveLink(address(rewardManager), DEFAULT_REPORT_LINK_FEE, USER); + _verify(signedReportT1, address(link), 0, USER); + } + + // verifying using ConfigB (report with new timestamp) + for (uint256 i = 0; i < number_of_reports_verified; i++) { + _approveLink(address(rewardManager), DEFAULT_REPORT_LINK_FEE, USER); + _verify(_generateV3EncodedBlob(testReportAtT2, s_reportContext, signers2), address(link), 0, USER); + } + + uint256 expected_pool_amount = DEFAULT_REPORT_LINK_FEE * number_of_reports_verified; + assertEq(rewardManager.s_totalRewardRecipientFees(expectedDonConfigIdA), expected_pool_amount); + assertEq(rewardManager.s_totalRewardRecipientFees(expectedDonConfigIdB), expected_pool_amount); + + // check the recipients are paid according to weights + payRecipients(expectedDonConfigIdA, recipients, ADMIN); + + for (uint256 i = 0; i < recipients.length; i++) { + // //each recipient should receive 1/4 of the pool + assertEq(link.balanceOf(recipients[i]), expected_pool_amount / 4); + } + + payRecipients(expectedDonConfigIdB, recipients2, ADMIN); + + for (uint256 i = 1; i < recipients2.length; i++) { + // //each recipient should receive 1/4 of the pool + assertEq(link.balanceOf(recipients2[i]), expected_pool_amount / 4); + } + + // this recipient was part of the two config weights + assertEq(link.balanceOf(recipients2[0]), (expected_pool_amount / 4) * 2); + assertEq(link.balanceOf(address(rewardManager)), 0); + } +} diff --git a/contracts/src/v0.8/llo-feeds/v0.4.0/test/verifier/DestinationVerifierTestRewardsMultiVefifierFeeManager.t.sol b/contracts/src/v0.8/llo-feeds/v0.4.0/test/verifier/DestinationVerifierTestRewardsMultiVefifierFeeManager.t.sol new file mode 100644 index 00000000000..6a90cbf3738 --- /dev/null +++ b/contracts/src/v0.8/llo-feeds/v0.4.0/test/verifier/DestinationVerifierTestRewardsMultiVefifierFeeManager.t.sol @@ -0,0 +1,141 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity 0.8.19; + +import {MultipleVerifierWithMultipleFeeManagers} from "./BaseDestinationVerifierTest.t.sol"; +import {DestinationVerifier} from "../../../v0.4.0/DestinationVerifier.sol"; +import {DestinationVerifierProxy} from "../../../v0.4.0/DestinationVerifierProxy.sol"; +import {AccessControllerInterface} from "../../../../shared/interfaces/AccessControllerInterface.sol"; +import {Common} from "../../../libraries/Common.sol"; + +contract MultiVerifierBillingTests is MultipleVerifierWithMultipleFeeManagers { + uint8 MINIMAL_FAULT_TOLERANCE = 2; + address internal constant DEFAULT_RECIPIENT_1 = address(uint160(uint256(keccak256("DEFAULT_RECIPIENT_1")))); + address internal constant DEFAULT_RECIPIENT_2 = address(uint160(uint256(keccak256("DEFAULT_RECIPIENT_2")))); + address internal constant DEFAULT_RECIPIENT_3 = address(uint160(uint256(keccak256("DEFAULT_RECIPIENT_3")))); + address internal constant DEFAULT_RECIPIENT_4 = address(uint160(uint256(keccak256("DEFAULT_RECIPIENT_4")))); + address internal constant DEFAULT_RECIPIENT_5 = address(uint160(uint256(keccak256("DEFAULT_RECIPIENT_5")))); + address internal constant DEFAULT_RECIPIENT_6 = address(uint160(uint256(keccak256("DEFAULT_RECIPIENT_6")))); + address internal constant DEFAULT_RECIPIENT_7 = address(uint160(uint256(keccak256("DEFAULT_RECIPIENT_7")))); + + bytes32[3] internal s_reportContext; + V3Report internal s_testReport; + + function setUp() public virtual override { + MultipleVerifierWithMultipleFeeManagers.setUp(); + s_reportContext[0] = bytes32(abi.encode(uint32(5), uint8(1))); + s_testReport = generateReportAtTimestamp(block.timestamp); + } + + function _verify( + DestinationVerifierProxy proxy, + bytes memory payload, + address feeAddress, + uint256 wrappedNativeValue, + address sender + ) internal { + address originalAddr = msg.sender; + changePrank(sender); + + proxy.verify{value: wrappedNativeValue}(payload, abi.encode(feeAddress)); + + changePrank(originalAddr); + } + + function generateReportAtTimestamp(uint256 timestamp) public pure returns (V3Report memory) { + return + V3Report({ + feedId: FEED_ID_V3, + observationsTimestamp: OBSERVATIONS_TIMESTAMP, + validFromTimestamp: uint32(timestamp), + nativeFee: uint192(DEFAULT_REPORT_NATIVE_FEE), + linkFee: uint192(DEFAULT_REPORT_LINK_FEE), + // ask michael about this expires at, is it usually set at what blocks + expiresAt: uint32(timestamp) + 500, + benchmarkPrice: MEDIAN, + bid: BID, + ask: ASK + }); + } + + function payRecipients(bytes32 poolId, address[] memory recipients, address sender) public { + //record the current address and switch to the recipient + address originalAddr = msg.sender; + changePrank(sender); + + //pay the recipients + rewardManager.payRecipients(poolId, recipients); + + //change back to the original address + changePrank(originalAddr); + } + + function test_multipleFeeManagersAndVerifiers() public { + /* + In this test we got: + - three verifiers (verifier, verifier2, verifier3). + - two fee managers (feeManager, feeManager2) + - one reward manager + + we glue: + - feeManager is used by verifier1 and verifier2 + - feeManager is used by verifier3 + - Rewardmanager is used by feeManager and feeManager2 + + In this test we do verificatons via verifier1, verifier2 and verifier3 and check that rewards are set accordingly + + */ + Signer[] memory signers = _getSigners(MAX_ORACLES); + address[] memory signerAddrs = _getSignerAddresses(signers); + Common.AddressAndWeight[] memory weights = new Common.AddressAndWeight[](1); + weights[0] = Common.AddressAndWeight(DEFAULT_RECIPIENT_1, ONE_PERCENT * 100); + + Common.AddressAndWeight[] memory weights2 = new Common.AddressAndWeight[](1); + weights2[0] = Common.AddressAndWeight(DEFAULT_RECIPIENT_2, ONE_PERCENT * 100); + + Common.AddressAndWeight[] memory weights3 = new Common.AddressAndWeight[](1); + weights3[0] = Common.AddressAndWeight(DEFAULT_RECIPIENT_3, ONE_PERCENT * 100); + + s_verifier.setConfig(signerAddrs, FAULT_TOLERANCE, weights); + s_verifier2.setConfig(signerAddrs, MINIMAL_FAULT_TOLERANCE, weights2); + s_verifier3.setConfig(signerAddrs, MINIMAL_FAULT_TOLERANCE + 1, weights3); + bytes memory signedReport = _generateV3EncodedBlob(s_testReport, s_reportContext, signers); + bytes32 expectedDonConfigID = _donConfigIdFromConfigData(signerAddrs, FAULT_TOLERANCE); + bytes32 expectedDonConfigID2 = _donConfigIdFromConfigData(signerAddrs, MINIMAL_FAULT_TOLERANCE); + bytes32 expectedDonConfigID3 = _donConfigIdFromConfigData(signerAddrs, MINIMAL_FAULT_TOLERANCE + 1); + + _approveLink(address(rewardManager), DEFAULT_REPORT_LINK_FEE, USER); + _verify(s_verifierProxy, signedReport, address(link), 0, USER); + assertEq(link.balanceOf(USER), DEFAULT_LINK_MINT_QUANTITY - DEFAULT_REPORT_LINK_FEE); + + // internal state checks + assertEq(feeManager.s_linkDeficit(expectedDonConfigID), 0); + assertEq(rewardManager.s_totalRewardRecipientFees(expectedDonConfigID), DEFAULT_REPORT_LINK_FEE); + assertEq(link.balanceOf(address(rewardManager)), DEFAULT_REPORT_LINK_FEE); + + // check the recipients are paid according to weights + // These rewards happened through verifier1 and feeManager1 + address[] memory recipients = new address[](1); + recipients[0] = DEFAULT_RECIPIENT_1; + payRecipients(expectedDonConfigID, recipients, ADMIN); + assertEq(link.balanceOf(recipients[0]), DEFAULT_REPORT_LINK_FEE); + assertEq(link.balanceOf(address(rewardManager)), 0); + + // these rewards happaned through verifier2 and feeManager1 + address[] memory recipients2 = new address[](1); + recipients2[0] = DEFAULT_RECIPIENT_2; + _approveLink(address(rewardManager), DEFAULT_REPORT_LINK_FEE, USER); + _verify(s_verifierProxy2, signedReport, address(link), 0, USER); + payRecipients(expectedDonConfigID2, recipients2, ADMIN); + assertEq(link.balanceOf(recipients2[0]), DEFAULT_REPORT_LINK_FEE); + assertEq(link.balanceOf(address(rewardManager)), 0); + + // these rewards happened through verifier3 and feeManager2 + address[] memory recipients3 = new address[](1); + recipients3[0] = DEFAULT_RECIPIENT_3; + _approveLink(address(rewardManager), DEFAULT_REPORT_LINK_FEE, USER); + _verify(s_verifierProxy3, signedReport, address(link), 0, USER); + payRecipients(expectedDonConfigID3, recipients3, ADMIN); + assertEq(link.balanceOf(recipients3[0]), DEFAULT_REPORT_LINK_FEE); + assertEq(link.balanceOf(address(rewardManager)), 0); + } +} diff --git a/contracts/src/v0.8/llo-feeds/v0.4.0/test/verifier/DestinationVerifierVerifyBulkTest.t.sol b/contracts/src/v0.8/llo-feeds/v0.4.0/test/verifier/DestinationVerifierVerifyBulkTest.t.sol new file mode 100644 index 00000000000..1c57295baed --- /dev/null +++ b/contracts/src/v0.8/llo-feeds/v0.4.0/test/verifier/DestinationVerifierVerifyBulkTest.t.sol @@ -0,0 +1,140 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity 0.8.19; + +import {BaseTest} from "./BaseDestinationVerifierTest.t.sol"; +import {DestinationVerifier} from "../../../v0.4.0/DestinationVerifier.sol"; +import {DestinationVerifierProxy} from "../../../v0.4.0/DestinationVerifierProxy.sol"; +import {AccessControllerInterface} from "../../../../shared/interfaces/AccessControllerInterface.sol"; +import {Common} from "../../../libraries/Common.sol"; + +contract VerifierVerifyBulkTest is BaseTest { + bytes32[3] internal s_reportContext; + V3Report internal s_testReportThree; + + function setUp() public virtual override { + BaseTest.setUp(); + s_reportContext[0] = bytes32(abi.encode(uint32(5), uint8(1))); + + s_testReportThree = V3Report({ + feedId: FEED_ID_V3, + observationsTimestamp: OBSERVATIONS_TIMESTAMP, + validFromTimestamp: uint32(block.timestamp), + nativeFee: uint192(DEFAULT_REPORT_NATIVE_FEE), + linkFee: uint192(DEFAULT_REPORT_LINK_FEE), + expiresAt: uint32(block.timestamp), + benchmarkPrice: MEDIAN, + bid: BID, + ask: ASK + }); + } + + function test_revertsVerifyBulkIfNoAccess() public { + vm.mockCall( + ACCESS_CONTROLLER_ADDRESS, + abi.encodeWithSelector(AccessControllerInterface.hasAccess.selector, USER), + abi.encode(false) + ); + bytes memory signedReport = _generateV3EncodedBlob( + s_testReportThree, + s_reportContext, + _getSigners(FAULT_TOLERANCE + 1) + ); + + bytes[] memory signedReports = new bytes[](2); + signedReports[0] = signedReport; + signedReports[1] = signedReport; + vm.expectRevert(abi.encodeWithSelector(DestinationVerifier.AccessForbidden.selector)); + changePrank(USER); + s_verifier.verifyBulk(signedReports, abi.encode(native), msg.sender); + } + + function test_verifyBulkSingleCaseWithSingleConfig() public { + Signer[] memory signers = _getSigners(MAX_ORACLES); + + uint8 MINIMAL_FAULT_TOLERANCE = 2; + BaseTest.Signer[] memory signersSubset1 = new BaseTest.Signer[](7); + signersSubset1[0] = signers[0]; + signersSubset1[1] = signers[1]; + signersSubset1[2] = signers[2]; + signersSubset1[3] = signers[3]; + signersSubset1[4] = signers[4]; + signersSubset1[5] = signers[5]; + signersSubset1[6] = signers[6]; + + address[] memory signersAddrSubset1 = _getSignerAddresses(signersSubset1); + // Config1 + s_verifier.setConfig(signersAddrSubset1, MINIMAL_FAULT_TOLERANCE, new Common.AddressAndWeight[](0)); + + V3Report memory report = V3Report({ + feedId: FEED_ID_V3, + observationsTimestamp: OBSERVATIONS_TIMESTAMP, + validFromTimestamp: uint32(block.timestamp), + nativeFee: uint192(DEFAULT_REPORT_NATIVE_FEE), + linkFee: uint192(DEFAULT_REPORT_LINK_FEE), + expiresAt: uint32(block.timestamp), + benchmarkPrice: MEDIAN, + bid: BID, + ask: ASK + }); + + BaseTest.Signer[] memory reportSigners = new BaseTest.Signer[](3); + reportSigners[0] = signers[0]; + reportSigners[1] = signers[1]; + reportSigners[2] = signers[2]; + + bytes[] memory signedReports = new bytes[](10); + + bytes memory signedReport = _generateV3EncodedBlob(report, s_reportContext, reportSigners); + + for (uint256 i = 0; i < signedReports.length; i++) { + signedReports[i] = signedReport; + } + + bytes[] memory verifierResponses = s_verifierProxy.verifyBulk(signedReports, abi.encode(native)); + + for (uint256 i = 0; i < verifierResponses.length; i++) { + bytes memory verifierResponse = verifierResponses[i]; + assertReportsEqual(verifierResponse, report); + } + } + + function test_verifyBulkWithSingleConfigOneVerifyFails() public { + Signer[] memory signers = _getSigners(MAX_ORACLES); + + uint8 MINIMAL_FAULT_TOLERANCE = 2; + BaseTest.Signer[] memory signersSubset1 = new BaseTest.Signer[](7); + signersSubset1[0] = signers[0]; + signersSubset1[1] = signers[1]; + signersSubset1[2] = signers[2]; + signersSubset1[3] = signers[3]; + signersSubset1[4] = signers[4]; + signersSubset1[5] = signers[5]; + signersSubset1[6] = signers[6]; + + address[] memory signersAddrSubset1 = _getSignerAddresses(signersSubset1); + // Config1 + s_verifier.setConfig(signersAddrSubset1, MINIMAL_FAULT_TOLERANCE, new Common.AddressAndWeight[](0)); + + BaseTest.Signer[] memory reportSigners = new BaseTest.Signer[](3); + reportSigners[0] = signers[0]; + reportSigners[1] = signers[1]; + reportSigners[2] = signers[2]; + + bytes[] memory signedReports = new bytes[](11); + bytes memory signedReport = _generateV3EncodedBlob(s_testReportThree, s_reportContext, reportSigners); + + for (uint256 i = 0; i < 10; i++) { + signedReports[i] = signedReport; + } + + // Making the last report in this batch not verifiable + BaseTest.Signer[] memory reportSigners2 = new BaseTest.Signer[](3); + reportSigners2[0] = signers[30]; + reportSigners2[1] = signers[29]; + reportSigners2[2] = signers[28]; + signedReports[10] = _generateV3EncodedBlob(s_testReportThree, s_reportContext, reportSigners2); + + vm.expectRevert(abi.encodeWithSelector(DestinationVerifier.BadVerification.selector)); + s_verifierProxy.verifyBulk(signedReports, abi.encode(native)); + } +} diff --git a/contracts/src/v0.8/llo-feeds/v0.4.0/test/verifier/DestinationVerifierVerifyTest.t.sol b/contracts/src/v0.8/llo-feeds/v0.4.0/test/verifier/DestinationVerifierVerifyTest.t.sol new file mode 100644 index 00000000000..e72cfd09b65 --- /dev/null +++ b/contracts/src/v0.8/llo-feeds/v0.4.0/test/verifier/DestinationVerifierVerifyTest.t.sol @@ -0,0 +1,714 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity 0.8.19; + +import {BaseTest} from "./BaseDestinationVerifierTest.t.sol"; +import {DestinationVerifier} from "../../../v0.4.0/DestinationVerifier.sol"; +import {DestinationVerifierProxy} from "../../../v0.4.0/DestinationVerifierProxy.sol"; +import {AccessControllerInterface} from "../../../../shared/interfaces/AccessControllerInterface.sol"; +import {Common} from "../../../libraries/Common.sol"; + +contract VerifierVerifyTest is BaseTest { + bytes32[3] internal s_reportContext; + V3Report internal s_testReportThree; + + function setUp() public virtual override { + BaseTest.setUp(); + + s_testReportThree = V3Report({ + feedId: FEED_ID_V3, + observationsTimestamp: OBSERVATIONS_TIMESTAMP, + validFromTimestamp: uint32(block.timestamp), + nativeFee: uint192(DEFAULT_REPORT_NATIVE_FEE), + linkFee: uint192(DEFAULT_REPORT_LINK_FEE), + expiresAt: uint32(block.timestamp), + benchmarkPrice: MEDIAN, + bid: BID, + ask: ASK + }); + } + + function test_verifyReport() public { + // Simple use case just setting a config and verifying a report + Signer[] memory signers = _getSigners(MAX_ORACLES); + address[] memory signerAddrs = _getSignerAddresses(signers); + s_reportContext[0] = bytes32(abi.encode(uint32(5), uint8(1))); + + s_verifier.setConfig(signerAddrs, FAULT_TOLERANCE, new Common.AddressAndWeight[](0)); + + bytes memory signedReport = _generateV3EncodedBlob(s_testReportThree, s_reportContext, signers); + + bytes memory verifierResponse = s_verifierProxy.verify(signedReport, abi.encode(native)); + assertReportsEqual(verifierResponse, s_testReportThree); + } + + function test_verifyTooglingActiveFlagsDonConfigs() public { + // sets config + Signer[] memory signers = _getSigners(MAX_ORACLES); + address[] memory signerAddrs = _getSignerAddresses(signers); + s_reportContext[0] = bytes32(abi.encode(uint32(5), uint8(1))); + bytes memory signedReport = _generateV3EncodedBlob(s_testReportThree, s_reportContext, signers); + s_verifier.setConfig(signerAddrs, FAULT_TOLERANCE, new Common.AddressAndWeight[](0)); + // verifies report + bytes memory verifierResponse = s_verifierProxy.verify(signedReport, abi.encode(native)); + assertReportsEqual(verifierResponse, s_testReportThree); + + // test verifying via a config that is deactivated + s_verifier.setConfigActive(0, false); + vm.expectRevert(abi.encodeWithSelector(DestinationVerifier.BadVerification.selector)); + verifierResponse = s_verifierProxy.verify(signedReport, abi.encode(native)); + + // test verifying via a reactivated config + s_verifier.setConfigActive(0, true); + verifierResponse = s_verifierProxy.verify(signedReport, abi.encode(native)); + assertReportsEqual(verifierResponse, s_testReportThree); + } + + function test_failToVerifyReportIfNotEnoughSigners() public { + Signer[] memory signers = _getSigners(MAX_ORACLES); + + uint8 MINIMAL_FAULT_TOLERANCE = 2; + BaseTest.Signer[] memory signersSubset1 = new BaseTest.Signer[](7); + signersSubset1[0] = signers[0]; + signersSubset1[1] = signers[1]; + signersSubset1[2] = signers[2]; + signersSubset1[3] = signers[3]; + signersSubset1[4] = signers[4]; + signersSubset1[5] = signers[5]; + signersSubset1[6] = signers[6]; + address[] memory signersAddrSubset1 = _getSignerAddresses(signersSubset1); + s_verifier.setConfig(signersAddrSubset1, MINIMAL_FAULT_TOLERANCE, new Common.AddressAndWeight[](0)); + + // only one signer, signers < MINIMAL_FAULT_TOLERANCE + BaseTest.Signer[] memory signersSubset2 = new BaseTest.Signer[](1); + signersSubset2[0] = signers[4]; + + bytes memory signedReport = _generateV3EncodedBlob(s_testReportThree, s_reportContext, signersSubset2); + vm.expectRevert(abi.encodeWithSelector(DestinationVerifier.BadVerification.selector)); + s_verifierProxy.verify(signedReport, abi.encode(native)); + } + + function test_failToVerifyReportIfNoSigners() public { + Signer[] memory signers = _getSigners(MAX_ORACLES); + + uint8 MINIMAL_FAULT_TOLERANCE = 2; + BaseTest.Signer[] memory signersSubset1 = new BaseTest.Signer[](7); + signersSubset1[0] = signers[0]; + signersSubset1[1] = signers[1]; + signersSubset1[2] = signers[2]; + signersSubset1[3] = signers[3]; + signersSubset1[4] = signers[4]; + signersSubset1[5] = signers[5]; + signersSubset1[6] = signers[6]; + address[] memory signersAddrSubset1 = _getSignerAddresses(signersSubset1); + s_verifier.setConfig(signersAddrSubset1, MINIMAL_FAULT_TOLERANCE, new Common.AddressAndWeight[](0)); + + // No signers for this report + BaseTest.Signer[] memory signersSubset2 = new BaseTest.Signer[](0); + bytes memory signedReport = _generateV3EncodedBlob(s_testReportThree, s_reportContext, signersSubset2); + + vm.expectRevert(abi.encodeWithSelector(DestinationVerifier.NoSigners.selector)); + s_verifierProxy.verify(signedReport, abi.encode(native)); + } + + function test_failToVerifyReportIfDupSigners() public { + Signer[] memory signers = _getSigners(MAX_ORACLES); + + uint8 MINIMAL_FAULT_TOLERANCE = 2; + BaseTest.Signer[] memory signersSubset1 = new BaseTest.Signer[](7); + signersSubset1[0] = signers[0]; + signersSubset1[1] = signers[1]; + signersSubset1[2] = signers[2]; + signersSubset1[3] = signers[3]; + signersSubset1[4] = signers[4]; + signersSubset1[5] = signers[5]; + signersSubset1[6] = signers[6]; + address[] memory signersAddrSubset1 = _getSignerAddresses(signersSubset1); + s_verifier.setConfig(signersAddrSubset1, MINIMAL_FAULT_TOLERANCE, new Common.AddressAndWeight[](0)); + // One signer is repeated + BaseTest.Signer[] memory signersSubset2 = new BaseTest.Signer[](4); + signersSubset2[0] = signers[0]; + signersSubset2[1] = signers[1]; + // repeated signers + signersSubset2[2] = signers[2]; + signersSubset2[3] = signers[2]; + + bytes memory signedReport = _generateV3EncodedBlob(s_testReportThree, s_reportContext, signersSubset2); + + vm.expectRevert(abi.encodeWithSelector(DestinationVerifier.BadVerification.selector)); + s_verifierProxy.verify(signedReport, abi.encode(native)); + } + + function test_failToVerifyReportIfSignerNotInConfig() public { + Signer[] memory signers = _getSigners(MAX_ORACLES); + + uint8 MINIMAL_FAULT_TOLERANCE = 2; + BaseTest.Signer[] memory signersSubset1 = new BaseTest.Signer[](7); + signersSubset1[0] = signers[0]; + signersSubset1[1] = signers[1]; + signersSubset1[2] = signers[2]; + signersSubset1[3] = signers[3]; + signersSubset1[4] = signers[4]; + signersSubset1[5] = signers[5]; + signersSubset1[6] = signers[6]; + address[] memory signersAddrSubset1 = _getSignerAddresses(signersSubset1); + s_verifier.setConfig(signersAddrSubset1, MINIMAL_FAULT_TOLERANCE, new Common.AddressAndWeight[](0)); + + // one report whose signer is not in the config + BaseTest.Signer[] memory reportSigners = new BaseTest.Signer[](4); + // these signers are part ofm the config + reportSigners[0] = signers[4]; + reportSigners[1] = signers[5]; + reportSigners[2] = signers[6]; + // this single signer is not in the config + reportSigners[3] = signers[7]; + + bytes memory signedReport = _generateV3EncodedBlob(s_testReportThree, s_reportContext, reportSigners); + + vm.expectRevert(abi.encodeWithSelector(DestinationVerifier.BadVerification.selector)); + s_verifierProxy.verify(signedReport, abi.encode(native)); + } + + function test_canVerifyOlderV3ReportsWithOlderConfigs() public { + /* + This test is checking we can use historical Configs to verify reports: + - DonConfigA has signers {A, B, C, E} is set at time T1 + - DonConfigB has signers {A, B, C, D} is set at time T2 + - checks we can verify a report with {B, C, D} signers (via DonConfigB) + - checks we can verify a report with {B, C, E} signers and timestamp below T2 (via DonConfigA historical config) + - checks we can't verify a report with {B, C, E} signers and timestamp above T2 (it gets verivied via DonConfigB) + - sets DonConfigA as deactivated + - checks we can't verify a report with {B, C, E} signers and timestamp below T2 (via DonConfigA) + */ + Signer[] memory signers = _getSigners(MAX_ORACLES); + + uint8 MINIMAL_FAULT_TOLERANCE = 2; + BaseTest.Signer[] memory signersSubset1 = new BaseTest.Signer[](7); + signersSubset1[0] = signers[0]; + signersSubset1[1] = signers[1]; + signersSubset1[2] = signers[2]; + signersSubset1[3] = signers[3]; + signersSubset1[4] = signers[4]; + signersSubset1[5] = signers[5]; + signersSubset1[6] = signers[6]; + + address[] memory signersAddrSubset1 = _getSignerAddresses(signersSubset1); + // Config1 + s_verifier.setConfig(signersAddrSubset1, MINIMAL_FAULT_TOLERANCE, new Common.AddressAndWeight[](0)); + + BaseTest.Signer[] memory signersSubset2 = new BaseTest.Signer[](7); + signersSubset2[0] = signers[0]; + signersSubset2[1] = signers[1]; + signersSubset2[2] = signers[2]; + signersSubset2[3] = signers[3]; + signersSubset2[4] = signers[4]; + signersSubset2[5] = signers[5]; + signersSubset2[6] = signers[29]; + address[] memory signersAddrSubset2 = _getSignerAddresses(signersSubset2); + + V3Report memory reportAtSetConfig1Timestmap = V3Report({ + feedId: FEED_ID_V3, + observationsTimestamp: OBSERVATIONS_TIMESTAMP, + validFromTimestamp: uint32(block.timestamp), + nativeFee: uint192(DEFAULT_REPORT_NATIVE_FEE), + linkFee: uint192(DEFAULT_REPORT_LINK_FEE), + expiresAt: uint32(block.timestamp), + benchmarkPrice: MEDIAN, + bid: BID, + ask: ASK + }); + + vm.warp(block.timestamp + 100); + + // Config2 + s_verifier.setConfig(signersAddrSubset2, MINIMAL_FAULT_TOLERANCE, new Common.AddressAndWeight[](0)); + + V3Report memory reportAtSetConfig2Timestmap = V3Report({ + feedId: FEED_ID_V3, + observationsTimestamp: OBSERVATIONS_TIMESTAMP, + validFromTimestamp: uint32(block.timestamp), + nativeFee: uint192(DEFAULT_REPORT_NATIVE_FEE), + linkFee: uint192(DEFAULT_REPORT_LINK_FEE), + expiresAt: uint32(block.timestamp), + benchmarkPrice: MEDIAN, + bid: BID, + ask: ASK + }); + + BaseTest.Signer[] memory reportSigners = new BaseTest.Signer[](5); + reportSigners[0] = signers[0]; + reportSigners[1] = signers[1]; + reportSigners[2] = signers[2]; + reportSigners[3] = signers[3]; + reportSigners[4] = signers[29]; + + bytes memory signedReport = _generateV3EncodedBlob(reportAtSetConfig2Timestmap, s_reportContext, reportSigners); + + // this report is verified via Config2 + bytes memory verifierResponse = s_verifierProxy.verify(signedReport, abi.encode(native)); + assertReportsEqual(verifierResponse, reportAtSetConfig2Timestmap); + + BaseTest.Signer[] memory reportSigners2 = new BaseTest.Signer[](5); + reportSigners2[0] = signers[0]; + reportSigners2[1] = signers[1]; + reportSigners2[2] = signers[2]; + reportSigners2[3] = signers[3]; + reportSigners2[4] = signers[6]; + + bytes memory signedReport2 = _generateV3EncodedBlob(reportAtSetConfig1Timestmap, s_reportContext, reportSigners2); + + // this report is verified via Config1 (using a historical config) + bytes memory verifierResponse2 = s_verifierProxy.verify(signedReport2, abi.encode(native)); + assertReportsEqual(verifierResponse2, reportAtSetConfig1Timestmap); + + // same report with same signers but with a higher timestamp gets verified via Config2 + // which means verification fails + bytes memory signedReport3 = _generateV3EncodedBlob(reportAtSetConfig2Timestmap, s_reportContext, reportSigners2); + vm.expectRevert(abi.encodeWithSelector(DestinationVerifier.BadVerification.selector)); + s_verifierProxy.verify(signedReport3, abi.encode(native)); + + // deactivating Config1 and trying a reverifications ends in failure + s_verifier.setConfigActive(0, false); + vm.expectRevert(abi.encodeWithSelector(DestinationVerifier.BadVerification.selector)); + s_verifierProxy.verify(signedReport2, abi.encode(native)); + } + + function test_revertsVerifyIfNoAccess() public { + vm.mockCall( + ACCESS_CONTROLLER_ADDRESS, + abi.encodeWithSelector(AccessControllerInterface.hasAccess.selector, USER), + abi.encode(false) + ); + bytes memory signedReport = _generateV3EncodedBlob( + s_testReportThree, + s_reportContext, + _getSigners(FAULT_TOLERANCE + 1) + ); + + vm.expectRevert(abi.encodeWithSelector(DestinationVerifier.AccessForbidden.selector)); + + changePrank(USER); + s_verifier.verify(signedReport, abi.encode(native), msg.sender); + } + + function test_canVerifyNewerReportsWithNewerConfigs() public { + /* + This test is checking that we use prefer verifiying via newer configs instead of old ones. + - DonConfigA has signers {A, B, C, E} is set at time T1 + - DonConfigB has signers {F, G, H, I} is set at time T2 + - DonConfigC has signers {J, K, L, M } is set at time T3 + - checks we can verify a report with {K, L, M} signers (via DonConfigC) + */ + Signer[] memory signers = _getSigners(MAX_ORACLES); + + uint8 MINIMAL_FAULT_TOLERANCE = 2; + BaseTest.Signer[] memory signersSubset1 = new BaseTest.Signer[](7); + signersSubset1[0] = signers[0]; + signersSubset1[1] = signers[1]; + signersSubset1[2] = signers[2]; + signersSubset1[3] = signers[3]; + signersSubset1[4] = signers[4]; + signersSubset1[5] = signers[5]; + signersSubset1[6] = signers[6]; + + address[] memory signersAddrSubset1 = _getSignerAddresses(signersSubset1); + // Config1 + s_verifier.setConfig(signersAddrSubset1, MINIMAL_FAULT_TOLERANCE, new Common.AddressAndWeight[](0)); + vm.warp(block.timestamp + 1); + + BaseTest.Signer[] memory signersSubset2 = new BaseTest.Signer[](7); + signersSubset2[0] = signers[7]; + signersSubset2[1] = signers[8]; + signersSubset2[2] = signers[9]; + signersSubset2[3] = signers[10]; + signersSubset2[4] = signers[11]; + signersSubset2[5] = signers[12]; + signersSubset2[6] = signers[13]; + + address[] memory signersAddrSubset2 = _getSignerAddresses(signersSubset2); + // Config2 + s_verifier.setConfig(signersAddrSubset2, MINIMAL_FAULT_TOLERANCE, new Common.AddressAndWeight[](0)); + vm.warp(block.timestamp + 1); + + BaseTest.Signer[] memory signersSubset3 = new BaseTest.Signer[](7); + signersSubset3[0] = signers[30]; + signersSubset3[1] = signers[29]; + signersSubset3[2] = signers[28]; + signersSubset3[3] = signers[27]; + signersSubset3[4] = signers[26]; + signersSubset3[5] = signers[25]; + signersSubset3[6] = signers[24]; + + address[] memory signersAddrSubset3 = _getSignerAddresses(signersSubset3); + // Config3 + s_verifier.setConfig(signersAddrSubset3, MINIMAL_FAULT_TOLERANCE, new Common.AddressAndWeight[](0)); + vm.warp(block.timestamp + 1); + + V3Report memory report = V3Report({ + feedId: FEED_ID_V3, + observationsTimestamp: OBSERVATIONS_TIMESTAMP, + validFromTimestamp: uint32(block.timestamp), + nativeFee: uint192(DEFAULT_REPORT_NATIVE_FEE), + linkFee: uint192(DEFAULT_REPORT_LINK_FEE), + expiresAt: uint32(block.timestamp), + benchmarkPrice: MEDIAN, + bid: BID, + ask: ASK + }); + + BaseTest.Signer[] memory reportSigners = new BaseTest.Signer[](3); + reportSigners[0] = signers[30]; + reportSigners[1] = signers[29]; + reportSigners[2] = signers[28]; + + bytes memory signedReport = _generateV3EncodedBlob(report, s_reportContext, reportSigners); + + s_verifierProxy.verify(signedReport, abi.encode(native)); + } + + function test_rollingOutConfiguration() public { + /* + This test is checking that we can roll out to a new DON without downtime using a transition configuration + - DonConfigA has signers {A, B, C} is set at time T1 + - DonConfigB (transition config) has signers {A, B, C, D, E, F} is set at time T2 + - DonConfigC has signers {D, E, F} is set at time T3 + + - checks we can verify a report with {A, B, C} signers (via DonConfigA) at time between T1 and T2 + - checks we can verify a report with {A, B, C} signers (via DonConfigB) at time between T2 and T3 + - checks we can verify a report with {D, E, F} signers (via DonConfigB) at time between T2 and T3 + - checks we can verify a report with {D, E, F} signers (via DonConfigC) at time > T3 + - checks we can't verify a report with {A, B, C} signers (via DonConfigC) and timestamp >T3 at time > T3 + - checks we can verify a report with {A, B, C} signers (via DonConfigC) and timestamp between T2 and T3 at time > T3 (historical check) + + */ + + Signer[] memory signers = _getSigners(MAX_ORACLES); + + uint8 MINIMAL_FAULT_TOLERANCE = 2; + BaseTest.Signer[] memory signersSubset1 = new BaseTest.Signer[](7); + signersSubset1[0] = signers[0]; + signersSubset1[1] = signers[1]; + signersSubset1[2] = signers[2]; + signersSubset1[3] = signers[3]; + signersSubset1[4] = signers[4]; + signersSubset1[5] = signers[5]; + signersSubset1[6] = signers[6]; + + // ConfigA + address[] memory signersAddrSubset1 = _getSignerAddresses(signersSubset1); + s_verifier.setConfig(signersAddrSubset1, MINIMAL_FAULT_TOLERANCE, new Common.AddressAndWeight[](0)); + + V3Report memory reportT1 = V3Report({ + feedId: FEED_ID_V3, + observationsTimestamp: OBSERVATIONS_TIMESTAMP, + validFromTimestamp: uint32(block.timestamp), + nativeFee: uint192(DEFAULT_REPORT_NATIVE_FEE), + linkFee: uint192(DEFAULT_REPORT_LINK_FEE), + expiresAt: uint32(block.timestamp), + benchmarkPrice: MEDIAN, + bid: BID, + ask: ASK + }); + + BaseTest.Signer[] memory reportSignersConfigA = new BaseTest.Signer[](3); + reportSignersConfigA[0] = signers[0]; + reportSignersConfigA[1] = signers[1]; + reportSignersConfigA[2] = signers[2]; + + // just testing ConfigA + bytes memory signedReport = _generateV3EncodedBlob(reportT1, s_reportContext, reportSignersConfigA); + s_verifierProxy.verify(signedReport, abi.encode(native)); + + vm.warp(block.timestamp + 100); + + BaseTest.Signer[] memory signersSuperset = new BaseTest.Signer[](14); + // signers in ConfigA + signersSuperset[0] = signers[0]; + signersSuperset[1] = signers[1]; + signersSuperset[2] = signers[2]; + signersSuperset[3] = signers[3]; + signersSuperset[4] = signers[4]; + signersSuperset[5] = signers[5]; + signersSuperset[6] = signers[6]; + // new signers + signersSuperset[7] = signers[7]; + signersSuperset[8] = signers[8]; + signersSuperset[9] = signers[9]; + signersSuperset[10] = signers[10]; + signersSuperset[11] = signers[11]; + signersSuperset[12] = signers[12]; + signersSuperset[13] = signers[13]; + + BaseTest.Signer[] memory reportSignersConfigC = new BaseTest.Signer[](3); + reportSignersConfigC[0] = signers[7]; + reportSignersConfigC[1] = signers[8]; + reportSignersConfigC[2] = signers[9]; + + // ConfigB (transition Config) + address[] memory signersAddrsSuperset = _getSignerAddresses(signersSuperset); + s_verifier.setConfig(signersAddrsSuperset, MINIMAL_FAULT_TOLERANCE, new Common.AddressAndWeight[](0)); + + V3Report memory reportT2 = V3Report({ + feedId: FEED_ID_V3, + observationsTimestamp: OBSERVATIONS_TIMESTAMP, + validFromTimestamp: uint32(block.timestamp), + nativeFee: uint192(DEFAULT_REPORT_NATIVE_FEE), + linkFee: uint192(DEFAULT_REPORT_LINK_FEE), + expiresAt: uint32(block.timestamp), + benchmarkPrice: MEDIAN, + bid: BID, + ask: ASK + }); + + // testing we can verify a fresh (block timestamp) report with ConfigA signers. This should use ConfigB + signedReport = _generateV3EncodedBlob(reportT2, s_reportContext, reportSignersConfigA); + s_verifierProxy.verify(signedReport, abi.encode(native)); + + // testing we can verify an old ( non fresh block timestamp) report with ConfigA signers. This should use ConfigA + signedReport = _generateV3EncodedBlob(reportT1, s_reportContext, reportSignersConfigA); + s_verifierProxy.verify(signedReport, abi.encode(native)); + // deactivating to make sure we are really verifiying via ConfigA + s_verifier.setConfigActive(0, false); + vm.expectRevert(abi.encodeWithSelector(DestinationVerifier.BadVerification.selector)); + s_verifierProxy.verify(signedReport, abi.encode(native)); + s_verifier.setConfigActive(0, true); + + // testing we can verify a fresh (block timestamp) report with the new signers. This should use ConfigB + signedReport = _generateV3EncodedBlob(reportT2, s_reportContext, reportSignersConfigC); + s_verifierProxy.verify(signedReport, abi.encode(native)); + + vm.warp(block.timestamp + 100); + + // Adding ConfigC + BaseTest.Signer[] memory signersSubset2 = new BaseTest.Signer[](7); + signersSubset2[0] = signers[7]; + signersSubset2[1] = signers[8]; + signersSubset2[2] = signers[9]; + signersSubset2[3] = signers[10]; + signersSubset2[4] = signers[11]; + signersSubset2[5] = signers[12]; + signersSubset2[6] = signers[13]; + address[] memory signersAddrsSubset2 = _getSignerAddresses(signersSubset2); + s_verifier.setConfig(signersAddrsSubset2, MINIMAL_FAULT_TOLERANCE, new Common.AddressAndWeight[](0)); + + V3Report memory reportT3 = V3Report({ + feedId: FEED_ID_V3, + observationsTimestamp: OBSERVATIONS_TIMESTAMP, + validFromTimestamp: uint32(block.timestamp), + nativeFee: uint192(DEFAULT_REPORT_NATIVE_FEE), + linkFee: uint192(DEFAULT_REPORT_LINK_FEE), + expiresAt: uint32(block.timestamp), + benchmarkPrice: MEDIAN, + bid: BID, + ask: ASK + }); + + // testing we can verify reports with ConfigC signers + signedReport = _generateV3EncodedBlob(reportT3, s_reportContext, reportSignersConfigC); + s_verifierProxy.verify(signedReport, abi.encode(native)); + + // testing an old report (block timestamp) with ConfigC signers should verify via ConfigB + signedReport = _generateV3EncodedBlob(reportT2, s_reportContext, reportSignersConfigC); + s_verifierProxy.verify(signedReport, abi.encode(native)); + // deactivating to make sure we are really verifiying via ConfigB + s_verifier.setConfigActive(1, false); + vm.expectRevert(abi.encodeWithSelector(DestinationVerifier.BadVerification.selector)); + s_verifierProxy.verify(signedReport, abi.encode(native)); + s_verifier.setConfigActive(1, true); + + // testing a recent report with ConfigA signers should not verify + signedReport = _generateV3EncodedBlob(reportT3, s_reportContext, reportSignersConfigA); + vm.expectRevert(abi.encodeWithSelector(DestinationVerifier.BadVerification.selector)); + s_verifierProxy.verify(signedReport, abi.encode(native)); + + // testing an old report (block timestamp) with ConfigA signers should verify via ConfigB + signedReport = _generateV3EncodedBlob(reportT2, s_reportContext, reportSignersConfigA); + s_verifierProxy.verify(signedReport, abi.encode(native)); + // deactivating to make sure we are really verifiying via ConfigB + s_verifier.setConfigActive(1, false); + vm.expectRevert(abi.encodeWithSelector(DestinationVerifier.BadVerification.selector)); + s_verifierProxy.verify(signedReport, abi.encode(native)); + s_verifier.setConfigActive(1, true); + + // testing an old report (block timestamp) with ConfigA signers should verify via ConfigA + signedReport = _generateV3EncodedBlob(reportT1, s_reportContext, reportSignersConfigA); + s_verifierProxy.verify(signedReport, abi.encode(native)); + // deactivating to make sure we are really verifiying via ConfigB + s_verifier.setConfigActive(0, false); + vm.expectRevert(abi.encodeWithSelector(DestinationVerifier.BadVerification.selector)); + s_verifierProxy.verify(signedReport, abi.encode(native)); + s_verifier.setConfigActive(0, true); + } + + function test_verifyFailsWhenReportIsOlderThanConfig() public { + /* + - SetConfig A at time T0 + - SetConfig B at time T1 + - tries verifing report issued at blocktimestmap < T0 + + this test is failing: ToDo Ask Michael + */ + Signer[] memory signers = _getSigners(MAX_ORACLES); + address[] memory signerAddrs = _getSignerAddresses(signers); + s_reportContext[0] = bytes32(abi.encode(uint32(5), uint8(1))); + + vm.warp(block.timestamp + 100); + + V3Report memory reportAtTMinus100 = V3Report({ + feedId: FEED_ID_V3, + observationsTimestamp: OBSERVATIONS_TIMESTAMP, + validFromTimestamp: uint32(block.timestamp - 100), + nativeFee: uint192(DEFAULT_REPORT_NATIVE_FEE), + linkFee: uint192(DEFAULT_REPORT_LINK_FEE), + expiresAt: uint32(block.timestamp), + benchmarkPrice: MEDIAN, + bid: BID, + ask: ASK + }); + + s_verifier.setConfig(signerAddrs, FAULT_TOLERANCE, new Common.AddressAndWeight[](0)); + vm.warp(block.timestamp + 100); + s_verifier.setConfig(signerAddrs, FAULT_TOLERANCE - 1, new Common.AddressAndWeight[](0)); + + bytes memory signedReport = _generateV3EncodedBlob(reportAtTMinus100, s_reportContext, signers); + + vm.expectRevert(abi.encodeWithSelector(DestinationVerifier.BadVerification.selector)); + s_verifierProxy.verify(signedReport, abi.encode(native)); + } + + function test_scenarioRollingNewChainWithHistoricConfigs() public { + /* + This test is checking that we can roll out in a new network and set historic configurations : + - Stars with a chain at blocktimestamp 1000 + - SetConfigA with teimstamp 100 + - SetConfigB with timesmtap 200 + - SetConfigC with timestamp current + - tries verifying reports for all the configs + */ + + vm.warp(block.timestamp + 1000); + + Signer[] memory signers = _getSigners(MAX_ORACLES); + + uint8 MINIMAL_FAULT_TOLERANCE = 2; + BaseTest.Signer[] memory signersA = new BaseTest.Signer[](7); + signersA[0] = signers[0]; + signersA[1] = signers[1]; + signersA[2] = signers[2]; + signersA[3] = signers[3]; + signersA[4] = signers[4]; + signersA[5] = signers[5]; + signersA[6] = signers[6]; + + // ConfigA (historical config) + uint32 configATimestmap = 100; + address[] memory signersAddrA = _getSignerAddresses(signersA); + s_verifier.setConfigWithActivationTime( + signersAddrA, + MINIMAL_FAULT_TOLERANCE, + new Common.AddressAndWeight[](0), + configATimestmap + ); + + // ConfigB (historical config) + uint32 configBTimestmap = 200; + // Config B + BaseTest.Signer[] memory signersB = new BaseTest.Signer[](7); + // signers in ConfigA + signersB[0] = signers[8]; + signersB[1] = signers[9]; + signersB[2] = signers[10]; + signersB[3] = signers[11]; + signersB[4] = signers[12]; + signersB[5] = signers[13]; + signersB[6] = signers[14]; + address[] memory signersAddrsB = _getSignerAddresses(signersB); + s_verifier.setConfigWithActivationTime( + signersAddrsB, + MINIMAL_FAULT_TOLERANCE, + new Common.AddressAndWeight[](0), + configBTimestmap + ); + + // ConfigC (config at current timestamp) + // BaseTest.Signer[] memory signersC = new BaseTest.Signer[](7); + // signers in ConfigA + signersB[6] = signers[15]; + address[] memory signersAddrsC = _getSignerAddresses(signersB); + s_verifier.setConfig(signersAddrsC, MINIMAL_FAULT_TOLERANCE, new Common.AddressAndWeight[](0)); + + vm.warp(block.timestamp + 10); + + // historical report + V3Report memory s_testReportA = V3Report({ + feedId: FEED_ID_V3, + observationsTimestamp: OBSERVATIONS_TIMESTAMP, + validFromTimestamp: uint32(101), + nativeFee: uint192(DEFAULT_REPORT_NATIVE_FEE), + linkFee: uint192(DEFAULT_REPORT_LINK_FEE), + expiresAt: uint32(block.timestamp + 1000), + benchmarkPrice: MEDIAN, + bid: BID, + ask: ASK + }); + + // historical report + V3Report memory s_testReportB = V3Report({ + feedId: FEED_ID_V3, + observationsTimestamp: OBSERVATIONS_TIMESTAMP, + validFromTimestamp: uint32(201), + nativeFee: uint192(DEFAULT_REPORT_NATIVE_FEE), + linkFee: uint192(DEFAULT_REPORT_LINK_FEE), + expiresAt: uint32(block.timestamp + 1000), + benchmarkPrice: MEDIAN, + bid: BID, + ask: ASK + }); + + // report at recent timestamp + V3Report memory s_testReportC = V3Report({ + feedId: FEED_ID_V3, + observationsTimestamp: OBSERVATIONS_TIMESTAMP, + validFromTimestamp: uint32(block.timestamp), + nativeFee: uint192(DEFAULT_REPORT_NATIVE_FEE), + linkFee: uint192(DEFAULT_REPORT_LINK_FEE), + expiresAt: uint32(block.timestamp + 1000), + benchmarkPrice: MEDIAN, + bid: BID, + ask: ASK + }); + + BaseTest.Signer[] memory reportSignersA = new BaseTest.Signer[](3); + reportSignersA[0] = signers[0]; + reportSignersA[1] = signers[1]; + reportSignersA[2] = signers[2]; + + BaseTest.Signer[] memory reportSignersB = new BaseTest.Signer[](3); + reportSignersB[0] = signers[8]; + reportSignersB[1] = signers[9]; + reportSignersB[2] = signers[14]; + + BaseTest.Signer[] memory reportSignersC = new BaseTest.Signer[](3); + reportSignersC[0] = signers[15]; + reportSignersC[1] = signers[13]; + reportSignersC[2] = signers[12]; + + bytes memory signedReportA = _generateV3EncodedBlob(s_testReportA, s_reportContext, reportSignersA); + bytes memory signedReportB = _generateV3EncodedBlob(s_testReportB, s_reportContext, reportSignersB); + bytes memory signedReportC = _generateV3EncodedBlob(s_testReportC, s_reportContext, reportSignersC); + + // verifying historical reports + s_verifierProxy.verify(signedReportA, abi.encode(native)); + s_verifierProxy.verify(signedReportB, abi.encode(native)); + // verifiying a current report + s_verifierProxy.verify(signedReportC, abi.encode(native)); + + // current report verified by historical report fails + bytes memory signedNewReportWithOldSignatures = _generateV3EncodedBlob( + s_testReportC, + s_reportContext, + reportSignersA + ); + vm.expectRevert(abi.encodeWithSelector(DestinationVerifier.BadVerification.selector)); + s_verifierProxy.verify(signedNewReportWithOldSignatures, abi.encode(native)); + } +} diff --git a/contracts/src/v0.8/llo-feeds/v0.5.0/configuration/ChannelConfigStore.sol b/contracts/src/v0.8/llo-feeds/v0.5.0/configuration/ChannelConfigStore.sol new file mode 100644 index 00000000000..f5e5040bb8f --- /dev/null +++ b/contracts/src/v0.8/llo-feeds/v0.5.0/configuration/ChannelConfigStore.sol @@ -0,0 +1,29 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.19; + +import {ConfirmedOwner} from "../../../shared/access/ConfirmedOwner.sol"; +import {IChannelConfigStore} from "./interfaces/IChannelConfigStore.sol"; +import {TypeAndVersionInterface} from "../../../interfaces/TypeAndVersionInterface.sol"; + +contract ChannelConfigStore is ConfirmedOwner, IChannelConfigStore, TypeAndVersionInterface { + event NewChannelDefinition(uint256 indexed donId, uint32 version, string url, bytes32 sha); + + constructor() ConfirmedOwner(msg.sender) {} + + /// @notice The version of a channel definition keyed by DON ID + // Increments by 1 on every update + mapping(uint256 => uint256) internal s_channelDefinitionVersions; + + function setChannelDefinitions(uint32 donId, string calldata url, bytes32 sha) external onlyOwner { + uint32 newVersion = uint32(++s_channelDefinitionVersions[uint256(donId)]); + emit NewChannelDefinition(donId, newVersion, url, sha); + } + + function typeAndVersion() external pure override returns (string memory) { + return "ChannelConfigStore 0.0.1"; + } + + function supportsInterface(bytes4 interfaceId) external pure returns (bool) { + return interfaceId == type(IChannelConfigStore).interfaceId; + } +} diff --git a/contracts/src/v0.8/llo-feeds/v0.5.0/configuration/Configurator.sol b/contracts/src/v0.8/llo-feeds/v0.5.0/configuration/Configurator.sol new file mode 100644 index 00000000000..5945f7ab730 --- /dev/null +++ b/contracts/src/v0.8/llo-feeds/v0.5.0/configuration/Configurator.sol @@ -0,0 +1,188 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.19; + +import {ConfirmedOwner} from "../../../shared/access/ConfirmedOwner.sol"; +import {TypeAndVersionInterface} from "../../../interfaces/TypeAndVersionInterface.sol"; +import {IERC165} from "../../../vendor/openzeppelin-solidity/v4.8.3/contracts/interfaces/IERC165.sol"; +import {IConfigurator} from "../../interfaces/IConfigurator.sol"; + +// OCR2 standard +uint256 constant MAX_NUM_ORACLES = 31; + +/** + * @title Configurator + * @author samsondav + * @notice This contract is intended to be deployed on the source chain and acts as a OCR3 configurator for LLO/Mercury + **/ + +contract Configurator is IConfigurator, ConfirmedOwner, TypeAndVersionInterface, IERC165 { + /// @notice This error is thrown whenever trying to set a config + /// with a fault tolerance of 0 + error FaultToleranceMustBePositive(); + + /// @notice This error is thrown whenever a report is signed + /// with more than the max number of signers + /// @param numSigners The number of signers who have signed the report + /// @param maxSigners The maximum number of signers that can sign a report + error ExcessSigners(uint256 numSigners, uint256 maxSigners); + + /// @notice This error is thrown whenever a report is signed + /// with less than the minimum number of signers + /// @param numSigners The number of signers who have signed the report + /// @param minSigners The minimum number of signers that need to sign a report + error InsufficientSigners(uint256 numSigners, uint256 minSigners); + + struct ConfigurationState { + // The number of times a new configuration + // has been set + uint64 configCount; + // The block number of the block the last time + /// the configuration was updated. + uint32 latestConfigBlockNumber; + } + + constructor() ConfirmedOwner(msg.sender) {} + + /// @notice Configuration states keyed on DON ID + mapping(bytes32 => ConfigurationState) internal s_configurationStates; + + /// @inheritdoc IConfigurator + function setConfig( + bytes32 donId, + address[] memory signers, + bytes32[] memory offchainTransmitters, + uint8 f, + bytes memory onchainConfig, + uint64 offchainConfigVersion, + bytes memory offchainConfig + ) external override checkConfigValid(signers.length, f) onlyOwner { + _setConfig( + donId, + block.chainid, + address(this), + signers, + offchainTransmitters, + f, + onchainConfig, + offchainConfigVersion, + offchainConfig + ); + } + + /// @notice Sets config based on the given arguments + /// @param donId DON ID to set config for + /// @param sourceChainId Chain ID of source config + /// @param sourceAddress Address of source config Verifier + /// @param signers addresses with which oracles sign the reports + /// @param offchainTransmitters CSA key for the ith Oracle + /// @param f number of faulty oracles the system can tolerate + /// @param onchainConfig serialized configuration used by the contract (and possibly oracles) + /// @param offchainConfigVersion version number for offchainEncoding schema + /// @param offchainConfig serialized configuration used by the oracles exclusively and only passed through the contract + function _setConfig( + bytes32 donId, + uint256 sourceChainId, + address sourceAddress, + address[] memory signers, + bytes32[] memory offchainTransmitters, + uint8 f, + bytes memory onchainConfig, + uint64 offchainConfigVersion, + bytes memory offchainConfig + ) internal { + ConfigurationState storage configurationState = s_configurationStates[donId]; + + uint64 newConfigCount = ++configurationState.configCount; + + bytes32 configDigest = _configDigestFromConfigData( + donId, + sourceChainId, + sourceAddress, + newConfigCount, + signers, + offchainTransmitters, + f, + onchainConfig, + offchainConfigVersion, + offchainConfig + ); + + emit ConfigSet( + donId, + configurationState.latestConfigBlockNumber, + configDigest, + newConfigCount, + signers, + offchainTransmitters, + f, + onchainConfig, + offchainConfigVersion, + offchainConfig + ); + + configurationState.latestConfigBlockNumber = uint32(block.number); + } + + /// @notice Generates the config digest from config data + /// @param donId DON ID to set config for + /// @param sourceChainId Chain ID of configurator contract + /// @param sourceAddress Address of configurator contract + /// @param configCount ordinal number of this config setting among all config settings over the life of this contract + /// @param signers ith element is address ith oracle uses to sign a report + /// @param offchainTransmitters ith element is address ith oracle used to transmit reports (in this case used for flexible additional field, such as CSA pub keys) + /// @param f maximum number of faulty/dishonest oracles the protocol can tolerate while still working correctly + /// @param onchainConfig serialized configuration used by the contract (and possibly oracles) + /// @param offchainConfigVersion version of the serialization format used for "offchainConfig" parameter + /// @param offchainConfig serialized configuration used by the oracles exclusively and only passed through the contract + /// @dev This function is a modified version of the method from OCR2Abstract + function _configDigestFromConfigData( + bytes32 donId, + uint256 sourceChainId, + address sourceAddress, + uint64 configCount, + address[] memory signers, + bytes32[] memory offchainTransmitters, + uint8 f, + bytes memory onchainConfig, + uint64 offchainConfigVersion, + bytes memory offchainConfig + ) internal pure returns (bytes32) { + uint256 h = uint256( + keccak256( + abi.encode( + donId, + sourceChainId, + sourceAddress, + configCount, + signers, + offchainTransmitters, + f, + onchainConfig, + offchainConfigVersion, + offchainConfig + ) + ) + ); + uint256 prefixMask = type(uint256).max << (256 - 16); // 0xFFFF00..00 + // 0x0006 corresponds to ConfigDigestPrefixLLO in libocr + uint256 prefix = 0x0009 << (256 - 16); // 0x000900..00 + return bytes32((prefix & prefixMask) | (h & ~prefixMask)); + } + + /// @inheritdoc IERC165 + function supportsInterface(bytes4 interfaceId) external pure override returns (bool isVerifier) { + return interfaceId == type(IConfigurator).interfaceId; + } + + /// @inheritdoc TypeAndVersionInterface + function typeAndVersion() external pure override returns (string memory) { + return "Configurator 0.4.0"; + } + + modifier checkConfigValid(uint256 numSigners, uint256 f) { + if (f == 0) revert FaultToleranceMustBePositive(); + if (numSigners > MAX_NUM_ORACLES) revert ExcessSigners(numSigners, MAX_NUM_ORACLES); + if (numSigners <= 3 * f) revert InsufficientSigners(numSigners, 3 * f + 1); + _; + } +} diff --git a/contracts/src/v0.8/llo-feeds/v0.5.0/configuration/interfaces/IChannelConfigStore.sol b/contracts/src/v0.8/llo-feeds/v0.5.0/configuration/interfaces/IChannelConfigStore.sol new file mode 100644 index 00000000000..8628e3c1d51 --- /dev/null +++ b/contracts/src/v0.8/llo-feeds/v0.5.0/configuration/interfaces/IChannelConfigStore.sol @@ -0,0 +1,8 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.19; + +import {IERC165} from "../../../../vendor/openzeppelin-solidity/v4.8.3/contracts/interfaces/IERC165.sol"; + +interface IChannelConfigStore is IERC165 { + function setChannelDefinitions(uint32 donId, string calldata url, bytes32 sha) external; +} diff --git a/contracts/src/v0.8/llo-feeds/v0.5.0/configuration/test/ChannelConfigStore.t.sol b/contracts/src/v0.8/llo-feeds/v0.5.0/configuration/test/ChannelConfigStore.t.sol new file mode 100644 index 00000000000..70b033e66b1 --- /dev/null +++ b/contracts/src/v0.8/llo-feeds/v0.5.0/configuration/test/ChannelConfigStore.t.sol @@ -0,0 +1,41 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity 0.8.19; + +import {IChannelConfigStore} from "../interfaces/IChannelConfigStore.sol"; +import {Test} from "forge-std/Test.sol"; +import {ChannelConfigStore} from "../ChannelConfigStore.sol"; +import {ExposedChannelConfigStore} from "./mocks/ExposedChannelConfigStore.sol"; + +/** + * @title ChannelConfigStoreTest + * @author samsondav + * @notice Base class for ChannelConfigStore tests + */ +contract ChannelConfigStoreTest is Test { + ExposedChannelConfigStore public channelConfigStore; + event NewChannelDefinition(uint256 indexed donId, uint32 version, string url, bytes32 sha); + + function setUp() public virtual { + channelConfigStore = new ExposedChannelConfigStore(); + } + + function testTypeAndVersion() public view { + assertEq(channelConfigStore.typeAndVersion(), "ChannelConfigStore 0.0.1"); + } + + function testSupportsInterface() public view { + assertTrue(channelConfigStore.supportsInterface(type(IChannelConfigStore).interfaceId)); + } + + function testSetChannelDefinitions() public { + vm.expectEmit(); + emit NewChannelDefinition(42, 1, "url", keccak256("sha")); + channelConfigStore.setChannelDefinitions(42, "url", keccak256("sha")); + + vm.expectEmit(); + emit NewChannelDefinition(42, 2, "url2", keccak256("sha2")); + channelConfigStore.setChannelDefinitions(42, "url2", keccak256("sha2")); + + assertEq(channelConfigStore.exposedReadChannelDefinitionStates(42), uint32(2)); + } +} diff --git a/contracts/src/v0.8/llo-feeds/v0.5.0/configuration/test/mocks/ExposedChannelConfigStore.sol b/contracts/src/v0.8/llo-feeds/v0.5.0/configuration/test/mocks/ExposedChannelConfigStore.sol new file mode 100644 index 00000000000..1ffd51210f1 --- /dev/null +++ b/contracts/src/v0.8/llo-feeds/v0.5.0/configuration/test/mocks/ExposedChannelConfigStore.sol @@ -0,0 +1,15 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.19; + +import {ChannelConfigStore} from "../../ChannelConfigStore.sol"; + +// Exposed ChannelConfigStore exposes certain internal ChannelConfigStore +// methods/structures so that golang code can access them, and we get +// reliable type checking on their usage +contract ExposedChannelConfigStore is ChannelConfigStore { + constructor() {} + + function exposedReadChannelDefinitionStates(uint256 donId) public view returns (uint256) { + return s_channelDefinitionVersions[donId]; + } +} diff --git a/contracts/src/v0.8/llo-feeds/v0.5.0/configuration/test/mocks/ExposedConfigurator.sol b/contracts/src/v0.8/llo-feeds/v0.5.0/configuration/test/mocks/ExposedConfigurator.sol new file mode 100644 index 00000000000..7b1370a8467 --- /dev/null +++ b/contracts/src/v0.8/llo-feeds/v0.5.0/configuration/test/mocks/ExposedConfigurator.sol @@ -0,0 +1,15 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.19; + +import {Configurator} from "../../Configurator.sol"; + +// Exposed ChannelConfigStore exposes certain internal ChannelConfigStore +// methods/structures so that golang code can access them, and we get +// reliable type checking on their usage +contract ExposedConfigurator is Configurator { + constructor() {} + + function exposedReadConfigurationStates(bytes32 donId) public view returns (ConfigurationState memory) { + return s_configurationStates[donId]; + } +} diff --git a/contracts/src/v0.8/operatorforwarder/test/testhelpers/MaliciousConsumer.sol b/contracts/src/v0.8/operatorforwarder/test/testhelpers/MaliciousConsumer.sol index 842eec90542..bd731c7718e 100644 --- a/contracts/src/v0.8/operatorforwarder/test/testhelpers/MaliciousConsumer.sol +++ b/contracts/src/v0.8/operatorforwarder/test/testhelpers/MaliciousConsumer.sol @@ -7,7 +7,7 @@ contract MaliciousConsumer is Chainlinked { uint256 private constant ORACLE_PAYMENT = 1 ether; uint256 private s_expiration; - constructor(address _link, address _oracle) public payable { + constructor(address _link, address _oracle) payable { setLinkToken(_link); setOracle(_oracle); } diff --git a/contracts/src/v0.8/operatorforwarder/test/testhelpers/MaliciousMultiWordConsumer.sol b/contracts/src/v0.8/operatorforwarder/test/testhelpers/MaliciousMultiWordConsumer.sol index 6e5881524f5..93af16f64fd 100644 --- a/contracts/src/v0.8/operatorforwarder/test/testhelpers/MaliciousMultiWordConsumer.sol +++ b/contracts/src/v0.8/operatorforwarder/test/testhelpers/MaliciousMultiWordConsumer.sol @@ -8,7 +8,7 @@ contract MaliciousMultiWordConsumer is ChainlinkClient { uint256 private constant ORACLE_PAYMENT = 1 ether; uint256 private s_expiration; - constructor(address _link, address _oracle) public payable { + constructor(address _link, address _oracle) payable { _setChainlinkToken(_link); _setChainlinkOracle(_oracle); } diff --git a/contracts/src/v0.8/shared/enumerable/EnumerableMapAddresses.sol b/contracts/src/v0.8/shared/enumerable/EnumerableMapAddresses.sol index 6fbd37c60d7..c14a03b4443 100644 --- a/contracts/src/v0.8/shared/enumerable/EnumerableMapAddresses.sol +++ b/contracts/src/v0.8/shared/enumerable/EnumerableMapAddresses.sol @@ -1,12 +1,15 @@ // SPDX-License-Identifier: MIT +/* solhint-disable-next-line chainlink-solidity/prefix-internal-functions-with-underscore */ pragma solidity ^0.8.0; import {EnumerableMap} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/utils/structs/EnumerableMap.sol"; +import {EnumerableMapBytes32} from "./EnumerableMapBytes32.sol"; // TODO: the lib can be replaced with OZ v5.1 post-upgrade, which has AddressToAddressMap and AddressToBytes32Map library EnumerableMapAddresses { using EnumerableMap for EnumerableMap.UintToAddressMap; using EnumerableMap for EnumerableMap.Bytes32ToBytes32Map; + using EnumerableMapBytes32 for EnumerableMapBytes32.Bytes32ToBytesMap; struct AddressToAddressMap { EnumerableMap.UintToAddressMap _inner; @@ -57,8 +60,6 @@ library EnumerableMapAddresses { return map._inner.get(uint256(uint160(key)), errorMessage); } - // AddressToBytes32Map - struct AddressToBytes32Map { EnumerableMap.Bytes32ToBytes32Map _inner; } @@ -137,4 +138,88 @@ library EnumerableMapAddresses { function get(AddressToBytes32Map storage map, address key) internal view returns (bytes32) { return map._inner.get(bytes32(uint256(uint160(key)))); } + + struct AddressToBytesMap { + EnumerableMapBytes32.Bytes32ToBytesMap _inner; + } + + /** + * @dev Sets the value for `key` in the map. Returns true if the key was added to the map, that is if it was not already present. + * @param map The map where the value will be set + * @param key The key to set the value for + * @param value The value to set for the key + * @return bool indicating whether the key was added to the map + */ + // solhint-disable-next-line chainlink-solidity/prefix-internal-functions-with-underscore + function set(AddressToBytesMap storage map, address key, bytes memory value) internal returns (bool) { + return map._inner.set(bytes32(uint256(uint160(key))), value); + } + + /** + * @dev Removes the value for `key` in the map. Returns true if the key was removed from the map, that is if it was present. + * @param map The map where the value will be removed + * @param key The key to remove the value for + * @return bool indicating whether the key was removed from the map + */ + // solhint-disable-next-line chainlink-solidity/prefix-internal-functions-with-underscore + function remove(AddressToBytesMap storage map, address key) internal returns (bool) { + return map._inner.remove(bytes32(uint256(uint160(key)))); + } + + /** + * @dev Checks if the map contains the `key`. Returns true if the key is in the map. + * @param map The map to check for the presence of the key + * @param key The key to check for presence in the map + * @return bool indicating whether the key is in the map + */ + // solhint-disable-next-line chainlink-solidity/prefix-internal-functions-with-underscore + function contains(AddressToBytesMap storage map, address key) internal view returns (bool) { + return map._inner.contains(bytes32(uint256(uint160(key)))); + } + + /** + * @dev Returns the number of elements in the map. + * @param map The map to check the length of + * @return uint256 indicating the number of elements in the map + */ + // solhint-disable-next-line chainlink-solidity/prefix-internal-functions-with-underscore + function length(AddressToBytesMap storage map) internal view returns (uint256) { + return map._inner.length(); + } + + /** + * @dev Returns the element stored at position `index` in the map. Note that there are no guarantees on the ordering of values inside the array, and it may change when more values are added or removed. + * @param map The map to retrieve the element from + * @param index The index to retrieve the element at + * @return address The key of the element at the specified index + * @return bytes The value of the element at the specified index + */ + // solhint-disable-next-line chainlink-solidity/prefix-internal-functions-with-underscore + function at(AddressToBytesMap storage map, uint256 index) internal view returns (address, bytes memory) { + (bytes32 key, bytes memory value) = map._inner.at(index); + return (address(uint160(uint256(key))), value); + } + + /** + * @dev Tries to return the value associated with `key`. Does not revert if `key` is not in the map. + * @param map The map to retrieve the value from + * @param key The key to retrieve the value for + * @return bool indicating whether the key was in the map + * @return bytes The value associated with the key + */ + // solhint-disable-next-line chainlink-solidity/prefix-internal-functions-with-underscore + function tryGet(AddressToBytesMap storage map, address key) internal view returns (bool, bytes memory) { + return map._inner.tryGet(bytes32(uint256(uint160(key)))); + } + + /** + * @dev Returns the value associated with `key`. + * @param map The map to retrieve the value from + * @param key The key to retrieve the value for + * @return bytes The value associated with the key + */ + // solhint-disable-next-line chainlink-solidity/prefix-internal-functions-with-underscore + function get(AddressToBytesMap storage map, address key) internal view returns (bytes memory) { + return map._inner.get(bytes32(uint256(uint160(key)))); + } } diff --git a/contracts/src/v0.8/shared/enumerable/EnumerableMapBytes32.sol b/contracts/src/v0.8/shared/enumerable/EnumerableMapBytes32.sol new file mode 100644 index 00000000000..2ec9098f855 --- /dev/null +++ b/contracts/src/v0.8/shared/enumerable/EnumerableMapBytes32.sol @@ -0,0 +1,136 @@ +// SPDX-License-Identifier: MIT +/* solhint-disable-next-line chainlink-solidity/prefix-internal-functions-with-underscore */ +pragma solidity ^0.8.0; + +import {EnumerableSet} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/utils/structs/EnumerableSet.sol"; + +/** + * @dev Library for managing an enumerable variant of Solidity's + * https://solidity.readthedocs.io/en/latest/types.html#mapping-types[`mapping`] + * type. + * + * Maps have the following properties: + * + * - Entries are added, removed, and checked for existence in constant time + * (O(1)). + * - Entries are enumerated in O(n). No guarantees are made on the ordering. + * + * ``` + * contract Example { + * // Add the library methods + * using EnumerableMapBytes32 for EnumerableMapBytes32.Bytes32ToBytesMap; + * + * // Declare a set state variable + * EnumerableMapBytes32.Bytes32ToBytesMap private myMap; + * } + * ``` + * + * The following map types are supported: + * + * - `bytes32 -> bytes` (`Bytes32ToBytes`) + * + * [WARNING] + * ==== + * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure + * unusable. + * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info. + * + * In order to clean up an EnumerableMapBytes32, you should remove all elements one by one. + * ==== + */ +library EnumerableMapBytes32 { + using EnumerableSet for EnumerableSet.Bytes32Set; + + error NonexistentKeyError(); + + struct Bytes32ToBytesMap { + EnumerableSet.Bytes32Set _keys; + mapping(bytes32 => bytes) _values; + } + + /** + * @dev Adds a key-value pair to a map, or updates the value for an existing + * key. O(1). + * + * Returns true if the key was added to the map, that is if it was not + * already present. + */ + // solhint-disable-next-line chainlink-solidity/prefix-internal-functions-with-underscore + function set(Bytes32ToBytesMap storage map, bytes32 key, bytes memory value) internal returns (bool) { + map._values[key] = value; + return map._keys.add(key); + } + + /** + * @dev Removes a key-value pair from a map. O(1). + * + * Returns true if the key was removed from the map, that is if it was present. + */ + // solhint-disable-next-line chainlink-solidity/prefix-internal-functions-with-underscore + function remove(Bytes32ToBytesMap storage map, bytes32 key) internal returns (bool) { + delete map._values[key]; + return map._keys.remove(key); + } + + /** + * @dev Returns true if the key is in the map. O(1). + */ + // solhint-disable-next-line chainlink-solidity/prefix-internal-functions-with-underscore + function contains(Bytes32ToBytesMap storage map, bytes32 key) internal view returns (bool) { + return map._keys.contains(key); + } + + /** + * @dev Returns the number of key-value pairs in the map. O(1). + */ + // solhint-disable-next-line chainlink-solidity/prefix-internal-functions-with-underscore + function length(Bytes32ToBytesMap storage map) internal view returns (uint256) { + return map._keys.length(); + } + + /** + * @dev Returns the key-value pair stored at position `index` in the map. O(1). + * + * Note that there are no guarantees on the ordering of entries inside the + * array, and it may change when more entries are added or removed. + * + * Requirements: + * + * - `index` must be strictly less than {length}. + */ + // solhint-disable-next-line chainlink-solidity/prefix-internal-functions-with-underscore + function at(Bytes32ToBytesMap storage map, uint256 index) internal view returns (bytes32, bytes memory) { + bytes32 key = map._keys.at(index); + return (key, map._values[key]); + } + + /** + * @dev Tries to returns the value associated with `key`. O(1). + * Does not revert if `key` is not in the map. + */ + // solhint-disable-next-line chainlink-solidity/prefix-internal-functions-with-underscore + function tryGet(Bytes32ToBytesMap storage map, bytes32 key) internal view returns (bool, bytes memory) { + bytes memory value = map._values[key]; + if (value.length == 0) { + return (contains(map, key), bytes("")); + } else { + return (true, value); + } + } + + /** + * @dev Returns the value associated with `key`. O(1). + * + * Requirements: + * + * - `key` must be in the map. + */ + // solhint-disable-next-line chainlink-solidity/prefix-internal-functions-with-underscore + function get(Bytes32ToBytesMap storage map, bytes32 key) internal view returns (bytes memory) { + bytes memory value = map._values[key]; + if (value.length == 0 && !contains(map, key)) { + revert NonexistentKeyError(); + } + return value; + } +} diff --git a/contracts/src/v0.8/shared/test/call/CallWithExactGas.t.sol b/contracts/src/v0.8/shared/test/call/CallWithExactGas.t.sol index 444112d2d8d..3623cb8b129 100644 --- a/contracts/src/v0.8/shared/test/call/CallWithExactGas.t.sol +++ b/contracts/src/v0.8/shared/test/call/CallWithExactGas.t.sol @@ -220,7 +220,7 @@ contract CallWithExactGas__callWithExactGasSafeReturnData is CallWithExactGasSet assertGt(gasUsed, 500); } - function testFuzz_CallWithExactGasSafeReturnData_ConsumeAllGas_Success(uint8 gasLimitMultiplier) external { + function test_Fuzz_CallWithExactGasSafeReturnData_ConsumeAllGas_Success(uint8 gasLimitMultiplier) external { vm.assume(gasLimitMultiplier > 0); // Assume not zero to avoid zero gas being passed to s_gasConsumer uint16 maxRetBytes = 0; @@ -244,7 +244,7 @@ contract CallWithExactGas__callWithExactGasSafeReturnData is CallWithExactGasSet assertTrue(success, "Error: External Call Failed"); - //Assert equal within a margin of error of 1/64 of the gas limit to account for excess gas used by execution library + // Assert equal within a margin of error of 1/64 of the gas limit to account for excess gas used by execution library assertApproxEqAbs( gasUsed - CALL_WITH_EXACT_GAS_SAFE_RETURN_DATA_GAS_OVERHEAD, gasLimit, diff --git a/contracts/src/v0.8/shared/test/enumerable/EnumerableMapAddresses.t.sol b/contracts/src/v0.8/shared/test/enumerable/EnumerableMapAddresses.t.sol index 900c546f66d..097e79e372e 100644 --- a/contracts/src/v0.8/shared/test/enumerable/EnumerableMapAddresses.t.sol +++ b/contracts/src/v0.8/shared/test/enumerable/EnumerableMapAddresses.t.sol @@ -7,11 +7,14 @@ import {EnumerableMapAddresses} from "../../enumerable/EnumerableMapAddresses.so contract EnumerableMapAddressesTest is BaseTest { using EnumerableMapAddresses for EnumerableMapAddresses.AddressToBytes32Map; using EnumerableMapAddresses for EnumerableMapAddresses.AddressToAddressMap; + using EnumerableMapAddresses for EnumerableMapAddresses.AddressToBytesMap; EnumerableMapAddresses.AddressToAddressMap internal s_addressToAddressMap; EnumerableMapAddresses.AddressToBytes32Map internal s_addressToBytes32Map; + EnumerableMapAddresses.AddressToBytesMap internal s_addressToBytesMap; bytes32 internal constant MOCK_BYTES32_VALUE = bytes32(uint256(42)); + bytes internal constant MOCK_BYTES_VALUE = "0x123456789abcdef"; function setUp() public virtual override { BaseTest.setUp(); @@ -21,6 +24,7 @@ contract EnumerableMapAddressesTest is BaseTest { contract EnumerableMapAddresses_set is EnumerableMapAddressesTest { using EnumerableMapAddresses for EnumerableMapAddresses.AddressToBytes32Map; using EnumerableMapAddresses for EnumerableMapAddresses.AddressToAddressMap; + using EnumerableMapAddresses for EnumerableMapAddresses.AddressToBytesMap; function testSetSuccess() public { assertTrue(!s_addressToAddressMap.contains(address(this))); @@ -35,11 +39,19 @@ contract EnumerableMapAddresses_set is EnumerableMapAddressesTest { assertTrue(s_addressToBytes32Map.contains(address(this))); assertTrue(!s_addressToBytes32Map.set(address(this), MOCK_BYTES32_VALUE)); } + + function testBytesSetSuccess() public { + assertTrue(!s_addressToBytesMap.contains(address(this))); + assertTrue(s_addressToBytesMap.set(address(this), MOCK_BYTES_VALUE)); + assertTrue(s_addressToBytesMap.contains(address(this))); + assertTrue(!s_addressToBytesMap.set(address(this), MOCK_BYTES_VALUE)); + } } contract EnumerableMapAddresses_remove is EnumerableMapAddressesTest { using EnumerableMapAddresses for EnumerableMapAddresses.AddressToBytes32Map; using EnumerableMapAddresses for EnumerableMapAddresses.AddressToAddressMap; + using EnumerableMapAddresses for EnumerableMapAddresses.AddressToBytesMap; function testRemoveSuccess() public { assertTrue(!s_addressToAddressMap.contains(address(this))); @@ -58,11 +70,21 @@ contract EnumerableMapAddresses_remove is EnumerableMapAddressesTest { assertTrue(!s_addressToBytes32Map.contains(address(this))); assertTrue(!s_addressToBytes32Map.remove(address(this))); } + + function testBytesRemoveSuccess() public { + assertTrue(!s_addressToBytesMap.contains(address(this))); + assertTrue(s_addressToBytesMap.set(address(this), MOCK_BYTES_VALUE)); + assertTrue(s_addressToBytesMap.contains(address(this))); + assertTrue(s_addressToBytesMap.remove(address(this))); + assertTrue(!s_addressToBytesMap.contains(address(this))); + assertTrue(!s_addressToBytesMap.remove(address(this))); + } } contract EnumerableMapAddresses_contains is EnumerableMapAddressesTest { using EnumerableMapAddresses for EnumerableMapAddresses.AddressToBytes32Map; using EnumerableMapAddresses for EnumerableMapAddresses.AddressToAddressMap; + using EnumerableMapAddresses for EnumerableMapAddresses.AddressToBytesMap; function testContainsSuccess() public { assertTrue(!s_addressToAddressMap.contains(address(this))); @@ -75,55 +97,81 @@ contract EnumerableMapAddresses_contains is EnumerableMapAddressesTest { assertTrue(s_addressToBytes32Map.set(address(this), MOCK_BYTES32_VALUE)); assertTrue(s_addressToBytes32Map.contains(address(this))); } + + function testBytesContainsSuccess() public { + assertTrue(!s_addressToBytesMap.contains(address(this))); + assertTrue(s_addressToBytesMap.set(address(this), MOCK_BYTES_VALUE)); + assertTrue(s_addressToBytesMap.contains(address(this))); + } } contract EnumerableMapAddresses_length is EnumerableMapAddressesTest { using EnumerableMapAddresses for EnumerableMapAddresses.AddressToBytes32Map; using EnumerableMapAddresses for EnumerableMapAddresses.AddressToAddressMap; + using EnumerableMapAddresses for EnumerableMapAddresses.AddressToBytesMap; function testLengthSuccess() public { - assertTrue(s_addressToAddressMap.length() == 0); + assertEq(s_addressToAddressMap.length(), 0); assertTrue(s_addressToAddressMap.set(address(this), address(this))); - assertTrue(s_addressToAddressMap.length() == 1); + assertEq(s_addressToAddressMap.length(), 1); assertTrue(s_addressToAddressMap.remove(address(this))); - assertTrue(s_addressToAddressMap.length() == 0); + assertEq(s_addressToAddressMap.length(), 0); } function testBytes32LengthSuccess() public { - assertTrue(s_addressToBytes32Map.length() == 0); + assertEq(s_addressToBytes32Map.length(), 0); assertTrue(s_addressToBytes32Map.set(address(this), MOCK_BYTES32_VALUE)); - assertTrue(s_addressToBytes32Map.length() == 1); + assertEq(s_addressToBytes32Map.length(), 1); assertTrue(s_addressToBytes32Map.remove(address(this))); - assertTrue(s_addressToBytes32Map.length() == 0); + assertEq(s_addressToBytes32Map.length(), 0); + } + + function testBytesLengthSuccess() public { + assertEq(s_addressToBytesMap.length(), 0); + assertTrue(s_addressToBytesMap.set(address(this), MOCK_BYTES_VALUE)); + assertEq(s_addressToBytesMap.length(), 1); + assertTrue(s_addressToBytesMap.remove(address(this))); + assertEq(s_addressToBytesMap.length(), 0); } } contract EnumerableMapAddresses_at is EnumerableMapAddressesTest { using EnumerableMapAddresses for EnumerableMapAddresses.AddressToBytes32Map; using EnumerableMapAddresses for EnumerableMapAddresses.AddressToAddressMap; + using EnumerableMapAddresses for EnumerableMapAddresses.AddressToBytesMap; function testAtSuccess() public { - assertTrue(s_addressToAddressMap.length() == 0); + assertEq(s_addressToAddressMap.length(), 0); assertTrue(s_addressToAddressMap.set(address(this), address(this))); - assertTrue(s_addressToAddressMap.length() == 1); + assertEq(s_addressToAddressMap.length(), 1); (address key, address value) = s_addressToAddressMap.at(0); - assertTrue(key == address(this)); - assertTrue(value == address(this)); + assertEq(key, address(this)); + assertEq(value, address(this)); } function testBytes32AtSuccess() public { - assertTrue(s_addressToBytes32Map.length() == 0); + assertEq(s_addressToBytes32Map.length(), 0); assertTrue(s_addressToBytes32Map.set(address(this), MOCK_BYTES32_VALUE)); - assertTrue(s_addressToBytes32Map.length() == 1); + assertEq(s_addressToBytes32Map.length(), 1); (address key, bytes32 value) = s_addressToBytes32Map.at(0); - assertTrue(key == address(this)); - assertTrue(value == MOCK_BYTES32_VALUE); + assertEq(key, address(this)); + assertEq(value, MOCK_BYTES32_VALUE); + } + + function testBytesAtSuccess() public { + assertEq(s_addressToBytesMap.length(), 0); + assertTrue(s_addressToBytesMap.set(address(this), MOCK_BYTES_VALUE)); + assertEq(s_addressToBytesMap.length(), 1); + (address key, bytes memory value) = s_addressToBytesMap.at(0); + assertEq(key, address(this)); + assertEq(value, MOCK_BYTES_VALUE); } } contract EnumerableMapAddresses_tryGet is EnumerableMapAddressesTest { using EnumerableMapAddresses for EnumerableMapAddresses.AddressToBytes32Map; using EnumerableMapAddresses for EnumerableMapAddresses.AddressToAddressMap; + using EnumerableMapAddresses for EnumerableMapAddresses.AddressToBytesMap; function testTryGetSuccess() public { assertTrue(!s_addressToAddressMap.contains(address(this))); @@ -131,7 +179,7 @@ contract EnumerableMapAddresses_tryGet is EnumerableMapAddressesTest { assertTrue(s_addressToAddressMap.contains(address(this))); (bool success, address value) = s_addressToAddressMap.tryGet(address(this)); assertTrue(success); - assertTrue(value == address(this)); + assertEq(value, address(this)); } function testBytes32TryGetSuccess() public { @@ -140,37 +188,62 @@ contract EnumerableMapAddresses_tryGet is EnumerableMapAddressesTest { assertTrue(s_addressToBytes32Map.contains(address(this))); (bool success, bytes32 value) = s_addressToBytes32Map.tryGet(address(this)); assertTrue(success); - assertTrue(value == MOCK_BYTES32_VALUE); + assertEq(value, MOCK_BYTES32_VALUE); + } + + function testBytesTryGetSuccess() public { + assertTrue(!s_addressToBytesMap.contains(address(this))); + assertTrue(s_addressToBytesMap.set(address(this), MOCK_BYTES_VALUE)); + assertTrue(s_addressToBytesMap.contains(address(this))); + (bool success, bytes memory value) = s_addressToBytesMap.tryGet(address(this)); + assertTrue(success); + assertEq(value, MOCK_BYTES_VALUE); } } contract EnumerableMapAddresses_get is EnumerableMapAddressesTest { using EnumerableMapAddresses for EnumerableMapAddresses.AddressToBytes32Map; using EnumerableMapAddresses for EnumerableMapAddresses.AddressToAddressMap; + using EnumerableMapAddresses for EnumerableMapAddresses.AddressToBytesMap; function testGetSuccess() public { assertTrue(!s_addressToAddressMap.contains(address(this))); assertTrue(s_addressToAddressMap.set(address(this), address(this))); assertTrue(s_addressToAddressMap.contains(address(this))); - assertTrue(s_addressToAddressMap.get(address(this)) == address(this)); + assertEq(s_addressToAddressMap.get(address(this)), address(this)); } function testBytes32GetSuccess() public { assertTrue(!s_addressToBytes32Map.contains(address(this))); assertTrue(s_addressToBytes32Map.set(address(this), MOCK_BYTES32_VALUE)); assertTrue(s_addressToBytes32Map.contains(address(this))); - assertTrue(s_addressToBytes32Map.get(address(this)) == MOCK_BYTES32_VALUE); + assertEq(s_addressToBytes32Map.get(address(this)), MOCK_BYTES32_VALUE); + } + + function testBytesGetSuccess() public { + assertTrue(!s_addressToBytesMap.contains(address(this))); + assertTrue(s_addressToBytesMap.set(address(this), MOCK_BYTES_VALUE)); + assertTrue(s_addressToBytesMap.contains(address(this))); + assertEq(s_addressToBytesMap.get(address(this)), MOCK_BYTES_VALUE); } } contract EnumerableMapAddresses_get_errorMessage is EnumerableMapAddressesTest { using EnumerableMapAddresses for EnumerableMapAddresses.AddressToBytes32Map; using EnumerableMapAddresses for EnumerableMapAddresses.AddressToAddressMap; + using EnumerableMapAddresses for EnumerableMapAddresses.AddressToBytesMap; function testGetErrorMessageSuccess() public { assertTrue(!s_addressToAddressMap.contains(address(this))); assertTrue(s_addressToAddressMap.set(address(this), address(this))); assertTrue(s_addressToAddressMap.contains(address(this))); - assertTrue(s_addressToAddressMap.get(address(this), "EnumerableMapAddresses: nonexistent key") == address(this)); + assertEq(s_addressToAddressMap.get(address(this), "EnumerableMapAddresses: nonexistent key"), address(this)); + } + + function testBytesGetErrorMessageSuccess() public { + assertTrue(!s_addressToBytesMap.contains(address(this))); + assertTrue(s_addressToBytesMap.set(address(this), MOCK_BYTES_VALUE)); + assertTrue(s_addressToBytesMap.contains(address(this))); + assertEq(s_addressToBytesMap.get(address(this)), MOCK_BYTES_VALUE); } } diff --git a/contracts/src/v0.8/shared/test/helpers/ChainReaderTester.sol b/contracts/src/v0.8/shared/test/helpers/ChainReaderTester.sol index 32969acad70..2ca192e9fed 100644 --- a/contracts/src/v0.8/shared/test/helpers/ChainReaderTester.sol +++ b/contracts/src/v0.8/shared/test/helpers/ChainReaderTester.sol @@ -10,29 +10,41 @@ struct TestStruct { address Account; address[] Accounts; int192 BigField; - MidLevelTestStruct NestedStruct; + MidLevelDynamicTestStruct NestedDynamicStruct; + MidLevelStaticTestStruct NestedStaticStruct; } -struct MidLevelTestStruct { +struct MidLevelDynamicTestStruct { bytes2 FixedBytes; - InnerTestStruct Inner; + InnerDynamicTestStruct Inner; } -struct InnerTestStruct { +struct InnerDynamicTestStruct { int64 IntVal; string S; } +struct MidLevelStaticTestStruct { + bytes2 FixedBytes; + InnerStaticTestStruct Inner; +} + +struct InnerStaticTestStruct { + int64 IntVal; + address A; +} + contract ChainReaderTester { event Triggered( int32 indexed field, - string differentField, uint8 oracleId, + MidLevelDynamicTestStruct nestedDynamicStruct, + MidLevelStaticTestStruct nestedStaticStruct, uint8[32] oracleIds, address Account, address[] Accounts, - int192 bigField, - MidLevelTestStruct nestedStruct + string differentField, + int192 bigField ); event TriggeredEventWithDynamicTopic(string indexed fieldHash, string field); @@ -40,8 +52,12 @@ contract ChainReaderTester { // First topic is event hash event TriggeredWithFourTopics(int32 indexed field1, int32 indexed field2, int32 indexed field3); + // first topic is event hash, second and third topics get hashed before getting stored + event TriggeredWithFourTopicsWithHashed(string indexed field1, uint8[32] indexed field2, bytes32 indexed field3); + TestStruct[] private s_seen; uint64[] private s_arr; + uint64 private s_value; constructor() { // See chain_reader_interface_tests.go in chainlink-relay @@ -57,9 +73,26 @@ contract ChainReaderTester { address account, address[] calldata accounts, int192 bigField, - MidLevelTestStruct calldata nestedStruct + MidLevelDynamicTestStruct calldata nestedDynamicStruct, + MidLevelStaticTestStruct calldata nestedStaticStruct ) public { - s_seen.push(TestStruct(field, differentField, oracleId, oracleIds, account, accounts, bigField, nestedStruct)); + s_seen.push( + TestStruct( + field, + differentField, + oracleId, + oracleIds, + account, + accounts, + bigField, + nestedDynamicStruct, + nestedStaticStruct + ) + ); + } + + function setAlterablePrimitiveValue(uint64 value) public { + s_value = value; } function returnSeen( @@ -70,9 +103,21 @@ contract ChainReaderTester { address account, address[] calldata accounts, int192 bigField, - MidLevelTestStruct calldata nestedStruct + MidLevelDynamicTestStruct calldata nestedDynamicStruct, + MidLevelStaticTestStruct calldata nestedStaticStruct ) public pure returns (TestStruct memory) { - return TestStruct(field, differentField, oracleId, oracleIds, account, accounts, bigField, nestedStruct); + return + TestStruct( + field, + differentField, + oracleId, + oracleIds, + account, + accounts, + bigField, + nestedDynamicStruct, + nestedStaticStruct + ); } function getElementAtIndex(uint256 i) public view returns (TestStruct memory) { @@ -85,6 +130,11 @@ contract ChainReaderTester { return 3; } + function getAlterablePrimitiveValue() public view returns (uint64) { + // See chain_reader_interface_tests.go in chainlink-relay + return s_value; + } + function getDifferentPrimitiveValue() public pure returns (uint64) { // See chain_reader_interface_tests.go in chainlink-relay return 1990; @@ -96,15 +146,26 @@ contract ChainReaderTester { function triggerEvent( int32 field, - string calldata differentField, uint8 oracleId, + MidLevelDynamicTestStruct calldata nestedDynamicStruct, + MidLevelStaticTestStruct calldata nestedStaticStruct, uint8[32] calldata oracleIds, address account, address[] calldata accounts, - int192 bigField, - MidLevelTestStruct calldata nestedStruct + string calldata differentField, + int192 bigField ) public { - emit Triggered(field, differentField, oracleId, oracleIds, account, accounts, bigField, nestedStruct); + emit Triggered( + field, + oracleId, + nestedDynamicStruct, + nestedStaticStruct, + oracleIds, + account, + accounts, + differentField, + bigField + ); } function triggerEventWithDynamicTopic(string calldata field) public { @@ -115,4 +176,9 @@ contract ChainReaderTester { function triggerWithFourTopics(int32 field1, int32 field2, int32 field3) public { emit TriggeredWithFourTopics(field1, field2, field3); } + + // first topic is event hash, second and third topics get hashed before getting stored + function triggerWithFourTopicsWithHashed(string memory field1, uint8[32] memory field2, bytes32 field3) public { + emit TriggeredWithFourTopicsWithHashed(field1, field2, field3); + } } diff --git a/contracts/src/v0.8/shared/test/testhelpers/GasConsumer.sol b/contracts/src/v0.8/shared/test/testhelpers/GasConsumer.sol index 3c7bd2d596e..efac2d15c1d 100644 --- a/contracts/src/v0.8/shared/test/testhelpers/GasConsumer.sol +++ b/contracts/src/v0.8/shared/test/testhelpers/GasConsumer.sol @@ -9,8 +9,9 @@ contract GasConsumer { } lt(0, 1) { } { - // If 60 gas is remaining, then exit the loop by returning. 60 was determined by manual binary search to be the minimal amount of gas needed but less than the cost of another loop - if lt(gas(), 60) { + // If 100 gas is remaining, then exit the loop by returning. 100 was determined by manual binary search to be + // the minimal amount of gas needed but less than the cost of another loop + if lt(gas(), 100) { return(0x0, 0x0) // Return with no return data } } diff --git a/contracts/src/v0.8/shared/test/token/ERC677/BurnMintERC677.t.sol b/contracts/src/v0.8/shared/test/token/ERC677/BurnMintERC677.t.sol index de9067a569a..2815f992563 100644 --- a/contracts/src/v0.8/shared/test/token/ERC677/BurnMintERC677.t.sol +++ b/contracts/src/v0.8/shared/test/token/ERC677/BurnMintERC677.t.sol @@ -338,7 +338,7 @@ contract BurnMintERC677_increaseApproval is BurnMintERC677Setup { } contract BurnMintERC677_supportsInterface is BurnMintERC677Setup { - function testConstructorSuccess() public { + function testConstructorSuccess() public view { assertTrue(s_burnMintERC677.supportsInterface(type(IERC20).interfaceId)); assertTrue(s_burnMintERC677.supportsInterface(type(IERC677).interfaceId)); assertTrue(s_burnMintERC677.supportsInterface(type(IBurnMintERC20).interfaceId)); diff --git a/contracts/src/v0.8/shared/test/token/ERC677/OpStackBurnMintERC677.t.sol b/contracts/src/v0.8/shared/test/token/ERC677/OpStackBurnMintERC677.t.sol index 7987fefec48..614b3bea15b 100644 --- a/contracts/src/v0.8/shared/test/token/ERC677/OpStackBurnMintERC677.t.sol +++ b/contracts/src/v0.8/shared/test/token/ERC677/OpStackBurnMintERC677.t.sol @@ -41,7 +41,7 @@ contract OpStackBurnMintERC677_constructor is OpStackBurnMintERC677Setup { } contract OpStackBurnMintERC677_supportsInterface is OpStackBurnMintERC677Setup { - function testConstructorSuccess() public { + function testConstructorSuccess() public view { assertTrue(s_opStackBurnMintERC677.supportsInterface(type(IOptimismMintableERC20Minimal).interfaceId)); assertTrue(s_opStackBurnMintERC677.supportsInterface(type(IERC677).interfaceId)); assertTrue(s_opStackBurnMintERC677.supportsInterface(type(IBurnMintERC20).interfaceId)); diff --git a/contracts/src/v0.8/shared/test/util/SortedSetValidationUtil.t.sol b/contracts/src/v0.8/shared/test/util/SortedSetValidationUtil.t.sol index ae7eba479ff..bf88df64ad5 100644 --- a/contracts/src/v0.8/shared/test/util/SortedSetValidationUtil.t.sol +++ b/contracts/src/v0.8/shared/test/util/SortedSetValidationUtil.t.sol @@ -50,7 +50,7 @@ contract SortedSetValidationUtilBaseTest is BaseTest { contract SortedSetValidationUtil_CheckIsValidUniqueSubsetTest is SortedSetValidationUtilBaseTest { // Successes. - function test__checkIsValidUniqueSubset_ValidSubset_Success() public { + function test__checkIsValidUniqueSubset_ValidSubset_Success() public pure { (bytes32[] memory subset, bytes32[] memory superset) = _createSets(3, 5); _convertArrayToSortedSet(superset, OFFSET); _convertArrayToSubset(subset, superset); @@ -123,7 +123,7 @@ contract SortedSetValidationUtil_CheckIsValidUniqueSubsetTest is SortedSetValida SortedSetValidationUtil._checkIsValidUniqueSubset(subset, superset); } - function test__checkIsValidUniqueSubset_SubsetEqualsSuperset_NoRevert() public { + function test__checkIsValidUniqueSubset_SubsetEqualsSuperset_NoRevert() public pure { (bytes32[] memory subset, bytes32[] memory superset) = _createSets(5, 5); _convertArrayToSortedSet(subset, OFFSET); _convertArrayToSortedSet(superset, OFFSET); @@ -131,7 +131,7 @@ contract SortedSetValidationUtil_CheckIsValidUniqueSubsetTest is SortedSetValida SortedSetValidationUtil._checkIsValidUniqueSubset(subset, superset); } - function test__checkIsValidUniqueSubset_SingleElementSubset() public { + function test__checkIsValidUniqueSubset_SingleElementSubset() public pure { (bytes32[] memory subset, bytes32[] memory superset) = _createSets(1, 5); _convertArrayToSortedSet(superset, OFFSET); _convertArrayToSubset(subset, superset); @@ -139,7 +139,7 @@ contract SortedSetValidationUtil_CheckIsValidUniqueSubsetTest is SortedSetValida SortedSetValidationUtil._checkIsValidUniqueSubset(subset, superset); } - function test__checkIsValidUniqueSubset_SingleElementSubsetAndSuperset_Equal() public { + function test__checkIsValidUniqueSubset_SingleElementSubsetAndSuperset_Equal() public pure { (bytes32[] memory subset, bytes32[] memory superset) = _createSets(1, 1); _convertArrayToSortedSet(subset, OFFSET); _convertArrayToSortedSet(superset, OFFSET); diff --git a/contracts/src/v0.8/tests/MockGasBoundCaller.sol b/contracts/src/v0.8/tests/MockGasBoundCaller.sol new file mode 100644 index 00000000000..3184f9dba38 --- /dev/null +++ b/contracts/src/v0.8/tests/MockGasBoundCaller.sol @@ -0,0 +1,32 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.19; + +contract MockGasBoundCaller { + error TransactionFailed(address target); + + function gasBoundCall(address target, uint256 gasAmount, bytes memory data) external payable { + bool success; + assembly { + success := call(gasAmount, target, 0, add(data, 0x20), mload(data), 0, 0) + } + + // gas bound caller will propagate the revert + if (!success) { + revert TransactionFailed(target); + } + + uint256 pubdataGas = 500000; + bytes memory returnData = abi.encode(address(0), pubdataGas); + + uint256 paddedReturndataLen = returnData.length + 96; + if (paddedReturndataLen % 32 != 0) { + paddedReturndataLen += 32 - (paddedReturndataLen % 32); + } + + assembly { + mstore(sub(returnData, 0x40), 0x40) + mstore(sub(returnData, 0x20), pubdataGas) + return(sub(returnData, 0x40), paddedReturndataLen) + } + } +} diff --git a/contracts/src/v0.8/tests/MockOVMGasPriceOracle.sol b/contracts/src/v0.8/tests/MockOVMGasPriceOracle.sol index 29790b0e150..6bb0dae6455 100644 --- a/contracts/src/v0.8/tests/MockOVMGasPriceOracle.sol +++ b/contracts/src/v0.8/tests/MockOVMGasPriceOracle.sol @@ -1,7 +1,12 @@ +// SPDX-License-Identifier: MIT pragma solidity 0.8.6; contract MockOVMGasPriceOracle { - function getL1Fee(bytes memory _data) public view returns (uint256) { + function getL1Fee(bytes memory) public pure returns (uint256) { + return 2000000; + } + + function getL1FeeUpperBound(uint256) public pure returns (uint256) { return 2000000; } } diff --git a/contracts/src/v0.8/tests/MockZKSyncSystemContext.sol b/contracts/src/v0.8/tests/MockZKSyncSystemContext.sol new file mode 100644 index 00000000000..265d4b678a5 --- /dev/null +++ b/contracts/src/v0.8/tests/MockZKSyncSystemContext.sol @@ -0,0 +1,16 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.19; + +contract MockZKSyncSystemContext { + function gasPrice() external pure returns (uint256) { + return 250000000; // 0.25 gwei + } + + function gasPerPubdataByte() external pure returns (uint256) { + return 500; + } + + function getCurrentPubdataSpent() external pure returns (uint256 currentPubdataSpent) { + return 1000; + } +} diff --git a/contracts/src/v0.8/vendor/openzeppelin-solidity/v4.8.3/contracts/utils/introspection/ERC165Checker.sol b/contracts/src/v0.8/vendor/openzeppelin-solidity/v4.8.3/contracts/utils/introspection/ERC165Checker.sol new file mode 100644 index 00000000000..4daefc5d4f2 --- /dev/null +++ b/contracts/src/v0.8/vendor/openzeppelin-solidity/v4.8.3/contracts/utils/introspection/ERC165Checker.sol @@ -0,0 +1,127 @@ +// SPDX-License-Identifier: MIT +// OpenZeppelin Contracts (last updated v4.8.2) (utils/introspection/ERC165Checker.sol) + +pragma solidity ^0.8.0; + +import "./IERC165.sol"; + +/** + * @dev Library used to query support of an interface declared via {IERC165}. + * + * Note that these functions return the actual result of the query: they do not + * `revert` if an interface is not supported. It is up to the caller to decide + * what to do in these cases. + */ +library ERC165Checker { + // As per the EIP-165 spec, no interface should ever match 0xffffffff + bytes4 private constant _INTERFACE_ID_INVALID = 0xffffffff; + + /** + * @dev Returns true if `account` supports the {IERC165} interface. + */ + function supportsERC165(address account) internal view returns (bool) { + // Any contract that implements ERC165 must explicitly indicate support of + // InterfaceId_ERC165 and explicitly indicate non-support of InterfaceId_Invalid + return + supportsERC165InterfaceUnchecked(account, type(IERC165).interfaceId) && + !supportsERC165InterfaceUnchecked(account, _INTERFACE_ID_INVALID); + } + + /** + * @dev Returns true if `account` supports the interface defined by + * `interfaceId`. Support for {IERC165} itself is queried automatically. + * + * See {IERC165-supportsInterface}. + */ + function supportsInterface(address account, bytes4 interfaceId) internal view returns (bool) { + // query support of both ERC165 as per the spec and support of _interfaceId + return supportsERC165(account) && supportsERC165InterfaceUnchecked(account, interfaceId); + } + + /** + * @dev Returns a boolean array where each value corresponds to the + * interfaces passed in and whether they're supported or not. This allows + * you to batch check interfaces for a contract where your expectation + * is that some interfaces may not be supported. + * + * See {IERC165-supportsInterface}. + * + * _Available since v3.4._ + */ + function getSupportedInterfaces(address account, bytes4[] memory interfaceIds) + internal + view + returns (bool[] memory) + { + // an array of booleans corresponding to interfaceIds and whether they're supported or not + bool[] memory interfaceIdsSupported = new bool[](interfaceIds.length); + + // query support of ERC165 itself + if (supportsERC165(account)) { + // query support of each interface in interfaceIds + for (uint256 i = 0; i < interfaceIds.length; i++) { + interfaceIdsSupported[i] = supportsERC165InterfaceUnchecked(account, interfaceIds[i]); + } + } + + return interfaceIdsSupported; + } + + /** + * @dev Returns true if `account` supports all the interfaces defined in + * `interfaceIds`. Support for {IERC165} itself is queried automatically. + * + * Batch-querying can lead to gas savings by skipping repeated checks for + * {IERC165} support. + * + * See {IERC165-supportsInterface}. + */ + function supportsAllInterfaces(address account, bytes4[] memory interfaceIds) internal view returns (bool) { + // query support of ERC165 itself + if (!supportsERC165(account)) { + return false; + } + + // query support of each interface in interfaceIds + for (uint256 i = 0; i < interfaceIds.length; i++) { + if (!supportsERC165InterfaceUnchecked(account, interfaceIds[i])) { + return false; + } + } + + // all interfaces supported + return true; + } + + /** + * @notice Query if a contract implements an interface, does not check ERC165 support + * @param account The address of the contract to query for support of an interface + * @param interfaceId The interface identifier, as specified in ERC-165 + * @return true if the contract at account indicates support of the interface with + * identifier interfaceId, false otherwise + * @dev Assumes that account contains a contract that supports ERC165, otherwise + * the behavior of this method is undefined. This precondition can be checked + * with {supportsERC165}. + * + * Some precompiled contracts will falsely indicate support for a given interface, so caution + * should be exercised when using this function. + * + * Interface identification is specified in ERC-165. + */ + function supportsERC165InterfaceUnchecked(address account, bytes4 interfaceId) internal view returns (bool) { + // prepare call + bytes memory encodedParams = abi.encodeWithSelector(IERC165.supportsInterface.selector, interfaceId); + + // perform static call + bool success; + uint256 returnSize; + uint256 returnValue; + assembly { + success := staticcall(30000, account, add(encodedParams, 0x20), mload(encodedParams), 0x00, 0x20) + returnSize := returndatasize() + returnValue := mload(0x00) + } + + return success && returnSize >= 0x20 && returnValue > 0; + } +} diff --git a/contracts/src/v0.8/vendor/openzeppelin-solidity/v5.0.2/contracts/access/AccessControl.sol b/contracts/src/v0.8/vendor/openzeppelin-solidity/v5.0.2/contracts/access/AccessControl.sol new file mode 100644 index 00000000000..3e3341e9cfd --- /dev/null +++ b/contracts/src/v0.8/vendor/openzeppelin-solidity/v5.0.2/contracts/access/AccessControl.sol @@ -0,0 +1,209 @@ +// SPDX-License-Identifier: MIT +// OpenZeppelin Contracts (last updated v5.0.0) (access/AccessControl.sol) + +pragma solidity ^0.8.20; + +import {IAccessControl} from "./IAccessControl.sol"; +import {Context} from "../utils/Context.sol"; +import {ERC165} from "../utils/introspection/ERC165.sol"; + +/** + * @dev Contract module that allows children to implement role-based access + * control mechanisms. This is a lightweight version that doesn't allow enumerating role + * members except through off-chain means by accessing the contract event logs. Some + * applications may benefit from on-chain enumerability, for those cases see + * {AccessControlEnumerable}. + * + * Roles are referred to by their `bytes32` identifier. These should be exposed + * in the external API and be unique. The best way to achieve this is by + * using `public constant` hash digests: + * + * ```solidity + * bytes32 public constant MY_ROLE = keccak256("MY_ROLE"); + * ``` + * + * Roles can be used to represent a set of permissions. To restrict access to a + * function call, use {hasRole}: + * + * ```solidity + * function foo() public { + * require(hasRole(MY_ROLE, msg.sender)); + * ... + * } + * ``` + * + * Roles can be granted and revoked dynamically via the {grantRole} and + * {revokeRole} functions. Each role has an associated admin role, and only + * accounts that have a role's admin role can call {grantRole} and {revokeRole}. + * + * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means + * that only accounts with this role will be able to grant or revoke other + * roles. More complex role relationships can be created by using + * {_setRoleAdmin}. + * + * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to + * grant and revoke this role. Extra precautions should be taken to secure + * accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules} + * to enforce additional security measures for this role. + */ +abstract contract AccessControl is Context, IAccessControl, ERC165 { + struct RoleData { + mapping(address account => bool) hasRole; + bytes32 adminRole; + } + + mapping(bytes32 role => RoleData) private _roles; + + bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; + + /** + * @dev Modifier that checks that an account has a specific role. Reverts + * with an {AccessControlUnauthorizedAccount} error including the required role. + */ + modifier onlyRole(bytes32 role) { + _checkRole(role); + _; + } + + /** + * @dev See {IERC165-supportsInterface}. + */ + function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { + return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId); + } + + /** + * @dev Returns `true` if `account` has been granted `role`. + */ + function hasRole(bytes32 role, address account) public view virtual returns (bool) { + return _roles[role].hasRole[account]; + } + + /** + * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `_msgSender()` + * is missing `role`. Overriding this function changes the behavior of the {onlyRole} modifier. + */ + function _checkRole(bytes32 role) internal view virtual { + _checkRole(role, _msgSender()); + } + + /** + * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `account` + * is missing `role`. + */ + function _checkRole(bytes32 role, address account) internal view virtual { + if (!hasRole(role, account)) { + revert AccessControlUnauthorizedAccount(account, role); + } + } + + /** + * @dev Returns the admin role that controls `role`. See {grantRole} and + * {revokeRole}. + * + * To change a role's admin, use {_setRoleAdmin}. + */ + function getRoleAdmin(bytes32 role) public view virtual returns (bytes32) { + return _roles[role].adminRole; + } + + /** + * @dev Grants `role` to `account`. + * + * If `account` had not been already granted `role`, emits a {RoleGranted} + * event. + * + * Requirements: + * + * - the caller must have ``role``'s admin role. + * + * May emit a {RoleGranted} event. + */ + function grantRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) { + _grantRole(role, account); + } + + /** + * @dev Revokes `role` from `account`. + * + * If `account` had been granted `role`, emits a {RoleRevoked} event. + * + * Requirements: + * + * - the caller must have ``role``'s admin role. + * + * May emit a {RoleRevoked} event. + */ + function revokeRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) { + _revokeRole(role, account); + } + + /** + * @dev Revokes `role` from the calling account. + * + * Roles are often managed via {grantRole} and {revokeRole}: this function's + * purpose is to provide a mechanism for accounts to lose their privileges + * if they are compromised (such as when a trusted device is misplaced). + * + * If the calling account had been revoked `role`, emits a {RoleRevoked} + * event. + * + * Requirements: + * + * - the caller must be `callerConfirmation`. + * + * May emit a {RoleRevoked} event. + */ + function renounceRole(bytes32 role, address callerConfirmation) public virtual { + if (callerConfirmation != _msgSender()) { + revert AccessControlBadConfirmation(); + } + + _revokeRole(role, callerConfirmation); + } + + /** + * @dev Sets `adminRole` as ``role``'s admin role. + * + * Emits a {RoleAdminChanged} event. + */ + function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual { + bytes32 previousAdminRole = getRoleAdmin(role); + _roles[role].adminRole = adminRole; + emit RoleAdminChanged(role, previousAdminRole, adminRole); + } + + /** + * @dev Attempts to grant `role` to `account` and returns a boolean indicating if `role` was granted. + * + * Internal function without access restriction. + * + * May emit a {RoleGranted} event. + */ + function _grantRole(bytes32 role, address account) internal virtual returns (bool) { + if (!hasRole(role, account)) { + _roles[role].hasRole[account] = true; + emit RoleGranted(role, account, _msgSender()); + return true; + } else { + return false; + } + } + + /** + * @dev Attempts to revoke `role` to `account` and returns a boolean indicating if `role` was revoked. + * + * Internal function without access restriction. + * + * May emit a {RoleRevoked} event. + */ + function _revokeRole(bytes32 role, address account) internal virtual returns (bool) { + if (hasRole(role, account)) { + _roles[role].hasRole[account] = false; + emit RoleRevoked(role, account, _msgSender()); + return true; + } else { + return false; + } + } +} diff --git a/contracts/src/v0.8/vendor/openzeppelin-solidity/v5.0.2/contracts/access/IAccessControl.sol b/contracts/src/v0.8/vendor/openzeppelin-solidity/v5.0.2/contracts/access/IAccessControl.sol new file mode 100644 index 00000000000..2ac89ca7356 --- /dev/null +++ b/contracts/src/v0.8/vendor/openzeppelin-solidity/v5.0.2/contracts/access/IAccessControl.sol @@ -0,0 +1,98 @@ +// SPDX-License-Identifier: MIT +// OpenZeppelin Contracts (last updated v5.0.0) (access/IAccessControl.sol) + +pragma solidity ^0.8.20; + +/** + * @dev External interface of AccessControl declared to support ERC165 detection. + */ +interface IAccessControl { + /** + * @dev The `account` is missing a role. + */ + error AccessControlUnauthorizedAccount(address account, bytes32 neededRole); + + /** + * @dev The caller of a function is not the expected one. + * + * NOTE: Don't confuse with {AccessControlUnauthorizedAccount}. + */ + error AccessControlBadConfirmation(); + + /** + * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` + * + * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite + * {RoleAdminChanged} not being emitted signaling this. + */ + event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole); + + /** + * @dev Emitted when `account` is granted `role`. + * + * `sender` is the account that originated the contract call, an admin role + * bearer except when using {AccessControl-_setupRole}. + */ + event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender); + + /** + * @dev Emitted when `account` is revoked `role`. + * + * `sender` is the account that originated the contract call: + * - if using `revokeRole`, it is the admin role bearer + * - if using `renounceRole`, it is the role bearer (i.e. `account`) + */ + event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender); + + /** + * @dev Returns `true` if `account` has been granted `role`. + */ + function hasRole(bytes32 role, address account) external view returns (bool); + + /** + * @dev Returns the admin role that controls `role`. See {grantRole} and + * {revokeRole}. + * + * To change a role's admin, use {AccessControl-_setRoleAdmin}. + */ + function getRoleAdmin(bytes32 role) external view returns (bytes32); + + /** + * @dev Grants `role` to `account`. + * + * If `account` had not been already granted `role`, emits a {RoleGranted} + * event. + * + * Requirements: + * + * - the caller must have ``role``'s admin role. + */ + function grantRole(bytes32 role, address account) external; + + /** + * @dev Revokes `role` from `account`. + * + * If `account` had been granted `role`, emits a {RoleRevoked} event. + * + * Requirements: + * + * - the caller must have ``role``'s admin role. + */ + function revokeRole(bytes32 role, address account) external; + + /** + * @dev Revokes `role` from the calling account. + * + * Roles are often managed via {grantRole} and {revokeRole}: this function's + * purpose is to provide a mechanism for accounts to lose their privileges + * if they are compromised (such as when a trusted device is misplaced). + * + * If the calling account had been granted `role`, emits a {RoleRevoked} + * event. + * + * Requirements: + * + * - the caller must be `callerConfirmation`. + */ + function renounceRole(bytes32 role, address callerConfirmation) external; +} diff --git a/contracts/src/v0.8/vendor/openzeppelin-solidity/v5.0.2/contracts/interfaces/IERC165.sol b/contracts/src/v0.8/vendor/openzeppelin-solidity/v5.0.2/contracts/interfaces/IERC165.sol new file mode 100644 index 00000000000..944dd0d5912 --- /dev/null +++ b/contracts/src/v0.8/vendor/openzeppelin-solidity/v5.0.2/contracts/interfaces/IERC165.sol @@ -0,0 +1,6 @@ +// SPDX-License-Identifier: MIT +// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC165.sol) + +pragma solidity ^0.8.20; + +import {IERC165} from "../utils/introspection/IERC165.sol"; diff --git a/contracts/src/v0.8/vendor/openzeppelin-solidity/v5.0.2/contracts/interfaces/IERC20.sol b/contracts/src/v0.8/vendor/openzeppelin-solidity/v5.0.2/contracts/interfaces/IERC20.sol new file mode 100644 index 00000000000..21d5a413275 --- /dev/null +++ b/contracts/src/v0.8/vendor/openzeppelin-solidity/v5.0.2/contracts/interfaces/IERC20.sol @@ -0,0 +1,6 @@ +// SPDX-License-Identifier: MIT +// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC20.sol) + +pragma solidity ^0.8.20; + +import {IERC20} from "../token/ERC20/IERC20.sol"; diff --git a/contracts/src/v0.8/vendor/openzeppelin-solidity/v5.0.2/contracts/interfaces/IERC5267.sol b/contracts/src/v0.8/vendor/openzeppelin-solidity/v5.0.2/contracts/interfaces/IERC5267.sol new file mode 100644 index 00000000000..47a9fd58855 --- /dev/null +++ b/contracts/src/v0.8/vendor/openzeppelin-solidity/v5.0.2/contracts/interfaces/IERC5267.sol @@ -0,0 +1,28 @@ +// SPDX-License-Identifier: MIT +// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC5267.sol) + +pragma solidity ^0.8.20; + +interface IERC5267 { + /** + * @dev MAY be emitted to signal that the domain could have changed. + */ + event EIP712DomainChanged(); + + /** + * @dev returns the fields and values that describe the domain separator used by this contract for EIP-712 + * signature. + */ + function eip712Domain() + external + view + returns ( + bytes1 fields, + string memory name, + string memory version, + uint256 chainId, + address verifyingContract, + bytes32 salt, + uint256[] memory extensions + ); +} diff --git a/contracts/src/v0.8/vendor/openzeppelin-solidity/v5.0.2/contracts/interfaces/draft-IERC6093.sol b/contracts/src/v0.8/vendor/openzeppelin-solidity/v5.0.2/contracts/interfaces/draft-IERC6093.sol new file mode 100644 index 00000000000..f6990e607c9 --- /dev/null +++ b/contracts/src/v0.8/vendor/openzeppelin-solidity/v5.0.2/contracts/interfaces/draft-IERC6093.sol @@ -0,0 +1,161 @@ +// SPDX-License-Identifier: MIT +// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/draft-IERC6093.sol) +pragma solidity ^0.8.20; + +/** + * @dev Standard ERC20 Errors + * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC20 tokens. + */ +interface IERC20Errors { + /** + * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers. + * @param sender Address whose tokens are being transferred. + * @param balance Current balance for the interacting account. + * @param needed Minimum amount required to perform a transfer. + */ + error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed); + + /** + * @dev Indicates a failure with the token `sender`. Used in transfers. + * @param sender Address whose tokens are being transferred. + */ + error ERC20InvalidSender(address sender); + + /** + * @dev Indicates a failure with the token `receiver`. Used in transfers. + * @param receiver Address to which tokens are being transferred. + */ + error ERC20InvalidReceiver(address receiver); + + /** + * @dev Indicates a failure with the `spender`’s `allowance`. Used in transfers. + * @param spender Address that may be allowed to operate on tokens without being their owner. + * @param allowance Amount of tokens a `spender` is allowed to operate with. + * @param needed Minimum amount required to perform a transfer. + */ + error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed); + + /** + * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals. + * @param approver Address initiating an approval operation. + */ + error ERC20InvalidApprover(address approver); + + /** + * @dev Indicates a failure with the `spender` to be approved. Used in approvals. + * @param spender Address that may be allowed to operate on tokens without being their owner. + */ + error ERC20InvalidSpender(address spender); +} + +/** + * @dev Standard ERC721 Errors + * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC721 tokens. + */ +interface IERC721Errors { + /** + * @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in EIP-20. + * Used in balance queries. + * @param owner Address of the current owner of a token. + */ + error ERC721InvalidOwner(address owner); + + /** + * @dev Indicates a `tokenId` whose `owner` is the zero address. + * @param tokenId Identifier number of a token. + */ + error ERC721NonexistentToken(uint256 tokenId); + + /** + * @dev Indicates an error related to the ownership over a particular token. Used in transfers. + * @param sender Address whose tokens are being transferred. + * @param tokenId Identifier number of a token. + * @param owner Address of the current owner of a token. + */ + error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner); + + /** + * @dev Indicates a failure with the token `sender`. Used in transfers. + * @param sender Address whose tokens are being transferred. + */ + error ERC721InvalidSender(address sender); + + /** + * @dev Indicates a failure with the token `receiver`. Used in transfers. + * @param receiver Address to which tokens are being transferred. + */ + error ERC721InvalidReceiver(address receiver); + + /** + * @dev Indicates a failure with the `operator`’s approval. Used in transfers. + * @param operator Address that may be allowed to operate on tokens without being their owner. + * @param tokenId Identifier number of a token. + */ + error ERC721InsufficientApproval(address operator, uint256 tokenId); + + /** + * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals. + * @param approver Address initiating an approval operation. + */ + error ERC721InvalidApprover(address approver); + + /** + * @dev Indicates a failure with the `operator` to be approved. Used in approvals. + * @param operator Address that may be allowed to operate on tokens without being their owner. + */ + error ERC721InvalidOperator(address operator); +} + +/** + * @dev Standard ERC1155 Errors + * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC1155 tokens. + */ +interface IERC1155Errors { + /** + * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers. + * @param sender Address whose tokens are being transferred. + * @param balance Current balance for the interacting account. + * @param needed Minimum amount required to perform a transfer. + * @param tokenId Identifier number of a token. + */ + error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId); + + /** + * @dev Indicates a failure with the token `sender`. Used in transfers. + * @param sender Address whose tokens are being transferred. + */ + error ERC1155InvalidSender(address sender); + + /** + * @dev Indicates a failure with the token `receiver`. Used in transfers. + * @param receiver Address to which tokens are being transferred. + */ + error ERC1155InvalidReceiver(address receiver); + + /** + * @dev Indicates a failure with the `operator`’s approval. Used in transfers. + * @param operator Address that may be allowed to operate on tokens without being their owner. + * @param owner Address of the current owner of a token. + */ + error ERC1155MissingApprovalForAll(address operator, address owner); + + /** + * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals. + * @param approver Address initiating an approval operation. + */ + error ERC1155InvalidApprover(address approver); + + /** + * @dev Indicates a failure with the `operator` to be approved. Used in approvals. + * @param operator Address that may be allowed to operate on tokens without being their owner. + */ + error ERC1155InvalidOperator(address operator); + + /** + * @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation. + * Used in batch transfers. + * @param idsLength Length of the array of token identifiers + * @param valuesLength Length of the array of token amounts + */ + error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength); +} diff --git a/contracts/src/v0.8/vendor/openzeppelin-solidity/v5.0.2/contracts/token/ERC20/ERC20.sol b/contracts/src/v0.8/vendor/openzeppelin-solidity/v5.0.2/contracts/token/ERC20/ERC20.sol new file mode 100644 index 00000000000..1fde5279d00 --- /dev/null +++ b/contracts/src/v0.8/vendor/openzeppelin-solidity/v5.0.2/contracts/token/ERC20/ERC20.sol @@ -0,0 +1,316 @@ +// SPDX-License-Identifier: MIT +// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/ERC20.sol) + +pragma solidity ^0.8.20; + +import {IERC20} from "./IERC20.sol"; +import {IERC20Metadata} from "./extensions/IERC20Metadata.sol"; +import {Context} from "../../utils/Context.sol"; +import {IERC20Errors} from "../../interfaces/draft-IERC6093.sol"; + +/** + * @dev Implementation of the {IERC20} interface. + * + * This implementation is agnostic to the way tokens are created. This means + * that a supply mechanism has to be added in a derived contract using {_mint}. + * + * TIP: For a detailed writeup see our guide + * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How + * to implement supply mechanisms]. + * + * The default value of {decimals} is 18. To change this, you should override + * this function so it returns a different value. + * + * We have followed general OpenZeppelin Contracts guidelines: functions revert + * instead returning `false` on failure. This behavior is nonetheless + * conventional and does not conflict with the expectations of ERC20 + * applications. + * + * Additionally, an {Approval} event is emitted on calls to {transferFrom}. + * This allows applications to reconstruct the allowance for all accounts just + * by listening to said events. Other implementations of the EIP may not emit + * these events, as it isn't required by the specification. + */ +abstract contract ERC20 is Context, IERC20, IERC20Metadata, IERC20Errors { + mapping(address account => uint256) private _balances; + + mapping(address account => mapping(address spender => uint256)) private _allowances; + + uint256 private _totalSupply; + + string private _name; + string private _symbol; + + /** + * @dev Sets the values for {name} and {symbol}. + * + * All two of these values are immutable: they can only be set once during + * construction. + */ + constructor(string memory name_, string memory symbol_) { + _name = name_; + _symbol = symbol_; + } + + /** + * @dev Returns the name of the token. + */ + function name() public view virtual returns (string memory) { + return _name; + } + + /** + * @dev Returns the symbol of the token, usually a shorter version of the + * name. + */ + function symbol() public view virtual returns (string memory) { + return _symbol; + } + + /** + * @dev Returns the number of decimals used to get its user representation. + * For example, if `decimals` equals `2`, a balance of `505` tokens should + * be displayed to a user as `5.05` (`505 / 10 ** 2`). + * + * Tokens usually opt for a value of 18, imitating the relationship between + * Ether and Wei. This is the default value returned by this function, unless + * it's overridden. + * + * NOTE: This information is only used for _display_ purposes: it in + * no way affects any of the arithmetic of the contract, including + * {IERC20-balanceOf} and {IERC20-transfer}. + */ + function decimals() public view virtual returns (uint8) { + return 18; + } + + /** + * @dev See {IERC20-totalSupply}. + */ + function totalSupply() public view virtual returns (uint256) { + return _totalSupply; + } + + /** + * @dev See {IERC20-balanceOf}. + */ + function balanceOf(address account) public view virtual returns (uint256) { + return _balances[account]; + } + + /** + * @dev See {IERC20-transfer}. + * + * Requirements: + * + * - `to` cannot be the zero address. + * - the caller must have a balance of at least `value`. + */ + function transfer(address to, uint256 value) public virtual returns (bool) { + address owner = _msgSender(); + _transfer(owner, to, value); + return true; + } + + /** + * @dev See {IERC20-allowance}. + */ + function allowance(address owner, address spender) public view virtual returns (uint256) { + return _allowances[owner][spender]; + } + + /** + * @dev See {IERC20-approve}. + * + * NOTE: If `value` is the maximum `uint256`, the allowance is not updated on + * `transferFrom`. This is semantically equivalent to an infinite approval. + * + * Requirements: + * + * - `spender` cannot be the zero address. + */ + function approve(address spender, uint256 value) public virtual returns (bool) { + address owner = _msgSender(); + _approve(owner, spender, value); + return true; + } + + /** + * @dev See {IERC20-transferFrom}. + * + * Emits an {Approval} event indicating the updated allowance. This is not + * required by the EIP. See the note at the beginning of {ERC20}. + * + * NOTE: Does not update the allowance if the current allowance + * is the maximum `uint256`. + * + * Requirements: + * + * - `from` and `to` cannot be the zero address. + * - `from` must have a balance of at least `value`. + * - the caller must have allowance for ``from``'s tokens of at least + * `value`. + */ + function transferFrom(address from, address to, uint256 value) public virtual returns (bool) { + address spender = _msgSender(); + _spendAllowance(from, spender, value); + _transfer(from, to, value); + return true; + } + + /** + * @dev Moves a `value` amount of tokens from `from` to `to`. + * + * This internal function is equivalent to {transfer}, and can be used to + * e.g. implement automatic token fees, slashing mechanisms, etc. + * + * Emits a {Transfer} event. + * + * NOTE: This function is not virtual, {_update} should be overridden instead. + */ + function _transfer(address from, address to, uint256 value) internal { + if (from == address(0)) { + revert ERC20InvalidSender(address(0)); + } + if (to == address(0)) { + revert ERC20InvalidReceiver(address(0)); + } + _update(from, to, value); + } + + /** + * @dev Transfers a `value` amount of tokens from `from` to `to`, or alternatively mints (or burns) if `from` + * (or `to`) is the zero address. All customizations to transfers, mints, and burns should be done by overriding + * this function. + * + * Emits a {Transfer} event. + */ + function _update(address from, address to, uint256 value) internal virtual { + if (from == address(0)) { + // Overflow check required: The rest of the code assumes that totalSupply never overflows + _totalSupply += value; + } else { + uint256 fromBalance = _balances[from]; + if (fromBalance < value) { + revert ERC20InsufficientBalance(from, fromBalance, value); + } + unchecked { + // Overflow not possible: value <= fromBalance <= totalSupply. + _balances[from] = fromBalance - value; + } + } + + if (to == address(0)) { + unchecked { + // Overflow not possible: value <= totalSupply or value <= fromBalance <= totalSupply. + _totalSupply -= value; + } + } else { + unchecked { + // Overflow not possible: balance + value is at most totalSupply, which we know fits into a uint256. + _balances[to] += value; + } + } + + emit Transfer(from, to, value); + } + + /** + * @dev Creates a `value` amount of tokens and assigns them to `account`, by transferring it from address(0). + * Relies on the `_update` mechanism + * + * Emits a {Transfer} event with `from` set to the zero address. + * + * NOTE: This function is not virtual, {_update} should be overridden instead. + */ + function _mint(address account, uint256 value) internal { + if (account == address(0)) { + revert ERC20InvalidReceiver(address(0)); + } + _update(address(0), account, value); + } + + /** + * @dev Destroys a `value` amount of tokens from `account`, lowering the total supply. + * Relies on the `_update` mechanism. + * + * Emits a {Transfer} event with `to` set to the zero address. + * + * NOTE: This function is not virtual, {_update} should be overridden instead + */ + function _burn(address account, uint256 value) internal { + if (account == address(0)) { + revert ERC20InvalidSender(address(0)); + } + _update(account, address(0), value); + } + + /** + * @dev Sets `value` as the allowance of `spender` over the `owner` s tokens. + * + * This internal function is equivalent to `approve`, and can be used to + * e.g. set automatic allowances for certain subsystems, etc. + * + * Emits an {Approval} event. + * + * Requirements: + * + * - `owner` cannot be the zero address. + * - `spender` cannot be the zero address. + * + * Overrides to this logic should be done to the variant with an additional `bool emitEvent` argument. + */ + function _approve(address owner, address spender, uint256 value) internal { + _approve(owner, spender, value, true); + } + + /** + * @dev Variant of {_approve} with an optional flag to enable or disable the {Approval} event. + * + * By default (when calling {_approve}) the flag is set to true. On the other hand, approval changes made by + * `_spendAllowance` during the `transferFrom` operation set the flag to false. This saves gas by not emitting any + * `Approval` event during `transferFrom` operations. + * + * Anyone who wishes to continue emitting `Approval` events on the`transferFrom` operation can force the flag to + * true using the following override: + * ``` + * function _approve(address owner, address spender, uint256 value, bool) internal virtual override { + * super._approve(owner, spender, value, true); + * } + * ``` + * + * Requirements are the same as {_approve}. + */ + function _approve(address owner, address spender, uint256 value, bool emitEvent) internal virtual { + if (owner == address(0)) { + revert ERC20InvalidApprover(address(0)); + } + if (spender == address(0)) { + revert ERC20InvalidSpender(address(0)); + } + _allowances[owner][spender] = value; + if (emitEvent) { + emit Approval(owner, spender, value); + } + } + + /** + * @dev Updates `owner` s allowance for `spender` based on spent `value`. + * + * Does not update the allowance value in case of infinite allowance. + * Revert if not enough allowance is available. + * + * Does not emit an {Approval} event. + */ + function _spendAllowance(address owner, address spender, uint256 value) internal virtual { + uint256 currentAllowance = allowance(owner, spender); + if (currentAllowance != type(uint256).max) { + if (currentAllowance < value) { + revert ERC20InsufficientAllowance(spender, currentAllowance, value); + } + unchecked { + _approve(owner, spender, currentAllowance - value, false); + } + } + } +} diff --git a/contracts/src/v0.8/vendor/openzeppelin-solidity/v5.0.2/contracts/token/ERC20/IERC20.sol b/contracts/src/v0.8/vendor/openzeppelin-solidity/v5.0.2/contracts/token/ERC20/IERC20.sol new file mode 100644 index 00000000000..db01cf4c751 --- /dev/null +++ b/contracts/src/v0.8/vendor/openzeppelin-solidity/v5.0.2/contracts/token/ERC20/IERC20.sol @@ -0,0 +1,79 @@ +// SPDX-License-Identifier: MIT +// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol) + +pragma solidity ^0.8.20; + +/** + * @dev Interface of the ERC20 standard as defined in the EIP. + */ +interface IERC20 { + /** + * @dev Emitted when `value` tokens are moved from one account (`from`) to + * another (`to`). + * + * Note that `value` may be zero. + */ + event Transfer(address indexed from, address indexed to, uint256 value); + + /** + * @dev Emitted when the allowance of a `spender` for an `owner` is set by + * a call to {approve}. `value` is the new allowance. + */ + event Approval(address indexed owner, address indexed spender, uint256 value); + + /** + * @dev Returns the value of tokens in existence. + */ + function totalSupply() external view returns (uint256); + + /** + * @dev Returns the value of tokens owned by `account`. + */ + function balanceOf(address account) external view returns (uint256); + + /** + * @dev Moves a `value` amount of tokens from the caller's account to `to`. + * + * Returns a boolean value indicating whether the operation succeeded. + * + * Emits a {Transfer} event. + */ + function transfer(address to, uint256 value) external returns (bool); + + /** + * @dev Returns the remaining number of tokens that `spender` will be + * allowed to spend on behalf of `owner` through {transferFrom}. This is + * zero by default. + * + * This value changes when {approve} or {transferFrom} are called. + */ + function allowance(address owner, address spender) external view returns (uint256); + + /** + * @dev Sets a `value` amount of tokens as the allowance of `spender` over the + * caller's tokens. + * + * Returns a boolean value indicating whether the operation succeeded. + * + * IMPORTANT: Beware that changing an allowance with this method brings the risk + * that someone may use both the old and the new allowance by unfortunate + * transaction ordering. One possible solution to mitigate this race + * condition is to first reduce the spender's allowance to 0 and set the + * desired value afterwards: + * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 + * + * Emits an {Approval} event. + */ + function approve(address spender, uint256 value) external returns (bool); + + /** + * @dev Moves a `value` amount of tokens from `from` to `to` using the + * allowance mechanism. `value` is then deducted from the caller's + * allowance. + * + * Returns a boolean value indicating whether the operation succeeded. + * + * Emits a {Transfer} event. + */ + function transferFrom(address from, address to, uint256 value) external returns (bool); +} diff --git a/contracts/src/v0.8/vendor/openzeppelin-solidity/v5.0.2/contracts/token/ERC20/extensions/ERC20Burnable.sol b/contracts/src/v0.8/vendor/openzeppelin-solidity/v5.0.2/contracts/token/ERC20/extensions/ERC20Burnable.sol new file mode 100644 index 00000000000..4d482d8ec83 --- /dev/null +++ b/contracts/src/v0.8/vendor/openzeppelin-solidity/v5.0.2/contracts/token/ERC20/extensions/ERC20Burnable.sol @@ -0,0 +1,39 @@ +// SPDX-License-Identifier: MIT +// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/ERC20Burnable.sol) + +pragma solidity ^0.8.20; + +import {ERC20} from "../ERC20.sol"; +import {Context} from "../../../utils/Context.sol"; + +/** + * @dev Extension of {ERC20} that allows token holders to destroy both their own + * tokens and those that they have an allowance for, in a way that can be + * recognized off-chain (via event analysis). + */ +abstract contract ERC20Burnable is Context, ERC20 { + /** + * @dev Destroys a `value` amount of tokens from the caller. + * + * See {ERC20-_burn}. + */ + function burn(uint256 value) public virtual { + _burn(_msgSender(), value); + } + + /** + * @dev Destroys a `value` amount of tokens from `account`, deducting from + * the caller's allowance. + * + * See {ERC20-_burn} and {ERC20-allowance}. + * + * Requirements: + * + * - the caller must have allowance for ``accounts``'s tokens of at least + * `value`. + */ + function burnFrom(address account, uint256 value) public virtual { + _spendAllowance(account, _msgSender(), value); + _burn(account, value); + } +} diff --git a/contracts/src/v0.8/vendor/openzeppelin-solidity/v5.0.2/contracts/token/ERC20/extensions/IERC20Metadata.sol b/contracts/src/v0.8/vendor/openzeppelin-solidity/v5.0.2/contracts/token/ERC20/extensions/IERC20Metadata.sol new file mode 100644 index 00000000000..1a38cba3e06 --- /dev/null +++ b/contracts/src/v0.8/vendor/openzeppelin-solidity/v5.0.2/contracts/token/ERC20/extensions/IERC20Metadata.sol @@ -0,0 +1,26 @@ +// SPDX-License-Identifier: MIT +// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Metadata.sol) + +pragma solidity ^0.8.20; + +import {IERC20} from "../IERC20.sol"; + +/** + * @dev Interface for the optional metadata functions from the ERC20 standard. + */ +interface IERC20Metadata is IERC20 { + /** + * @dev Returns the name of the token. + */ + function name() external view returns (string memory); + + /** + * @dev Returns the symbol of the token. + */ + function symbol() external view returns (string memory); + + /** + * @dev Returns the decimals places of the token. + */ + function decimals() external view returns (uint8); +} diff --git a/contracts/src/v0.8/vendor/openzeppelin-solidity/v5.0.2/contracts/token/ERC20/extensions/IERC20Permit.sol b/contracts/src/v0.8/vendor/openzeppelin-solidity/v5.0.2/contracts/token/ERC20/extensions/IERC20Permit.sol new file mode 100644 index 00000000000..5af48101ab8 --- /dev/null +++ b/contracts/src/v0.8/vendor/openzeppelin-solidity/v5.0.2/contracts/token/ERC20/extensions/IERC20Permit.sol @@ -0,0 +1,90 @@ +// SPDX-License-Identifier: MIT +// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Permit.sol) + +pragma solidity ^0.8.20; + +/** + * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in + * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612]. + * + * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by + * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't + * need to send a transaction, and thus is not required to hold Ether at all. + * + * ==== Security Considerations + * + * There are two important considerations concerning the use of `permit`. The first is that a valid permit signature + * expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be + * considered as an intention to spend the allowance in any specific way. The second is that because permits have + * built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should + * take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be + * generally recommended is: + * + * ```solidity + * function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public { + * try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {} + * doThing(..., value); + * } + * + * function doThing(..., uint256 value) public { + * token.safeTransferFrom(msg.sender, address(this), value); + * ... + * } + * ``` + * + * Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of + * `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also + * {SafeERC20-safeTransferFrom}). + * + * Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so + * contracts should have entry points that don't rely on permit. + */ +interface IERC20Permit { + /** + * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens, + * given ``owner``'s signed approval. + * + * IMPORTANT: The same issues {IERC20-approve} has related to transaction + * ordering also apply here. + * + * Emits an {Approval} event. + * + * Requirements: + * + * - `spender` cannot be the zero address. + * - `deadline` must be a timestamp in the future. + * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner` + * over the EIP712-formatted function arguments. + * - the signature must use ``owner``'s current nonce (see {nonces}). + * + * For more information on the signature format, see the + * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP + * section]. + * + * CAUTION: See Security Considerations above. + */ + function permit( + address owner, + address spender, + uint256 value, + uint256 deadline, + uint8 v, + bytes32 r, + bytes32 s + ) external; + + /** + * @dev Returns the current nonce for `owner`. This value must be + * included whenever a signature is generated for {permit}. + * + * Every successful call to {permit} increases ``owner``'s nonce by one. This + * prevents a signature from being used multiple times. + */ + function nonces(address owner) external view returns (uint256); + + /** + * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}. + */ + // solhint-disable-next-line func-name-mixedcase + function DOMAIN_SEPARATOR() external view returns (bytes32); +} diff --git a/contracts/src/v0.8/vendor/openzeppelin-solidity/v5.0.2/contracts/token/ERC20/utils/SafeERC20.sol b/contracts/src/v0.8/vendor/openzeppelin-solidity/v5.0.2/contracts/token/ERC20/utils/SafeERC20.sol new file mode 100644 index 00000000000..bb65709b46b --- /dev/null +++ b/contracts/src/v0.8/vendor/openzeppelin-solidity/v5.0.2/contracts/token/ERC20/utils/SafeERC20.sol @@ -0,0 +1,118 @@ +// SPDX-License-Identifier: MIT +// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/utils/SafeERC20.sol) + +pragma solidity ^0.8.20; + +import {IERC20} from "../IERC20.sol"; +import {IERC20Permit} from "../extensions/IERC20Permit.sol"; +import {Address} from "../../../utils/Address.sol"; + +/** + * @title SafeERC20 + * @dev Wrappers around ERC20 operations that throw on failure (when the token + * contract returns false). Tokens that return no value (and instead revert or + * throw on failure) are also supported, non-reverting calls are assumed to be + * successful. + * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract, + * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. + */ +library SafeERC20 { + using Address for address; + + /** + * @dev An operation with an ERC20 token failed. + */ + error SafeERC20FailedOperation(address token); + + /** + * @dev Indicates a failed `decreaseAllowance` request. + */ + error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease); + + /** + * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value, + * non-reverting calls are assumed to be successful. + */ + function safeTransfer(IERC20 token, address to, uint256 value) internal { + _callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value))); + } + + /** + * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the + * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful. + */ + function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal { + _callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value))); + } + + /** + * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value, + * non-reverting calls are assumed to be successful. + */ + function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal { + uint256 oldAllowance = token.allowance(address(this), spender); + forceApprove(token, spender, oldAllowance + value); + } + + /** + * @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no + * value, non-reverting calls are assumed to be successful. + */ + function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal { + unchecked { + uint256 currentAllowance = token.allowance(address(this), spender); + if (currentAllowance < requestedDecrease) { + revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease); + } + forceApprove(token, spender, currentAllowance - requestedDecrease); + } + } + + /** + * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value, + * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval + * to be set to zero before setting it to a non-zero value, such as USDT. + */ + function forceApprove(IERC20 token, address spender, uint256 value) internal { + bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value)); + + if (!_callOptionalReturnBool(token, approvalCall)) { + _callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0))); + _callOptionalReturn(token, approvalCall); + } + } + + /** + * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement + * on the return value: the return value is optional (but if data is returned, it must not be false). + * @param token The token targeted by the call. + * @param data The call data (encoded using abi.encode or one of its variants). + */ + function _callOptionalReturn(IERC20 token, bytes memory data) private { + // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since + // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that + // the target address contains contract code and also asserts for success in the low-level call. + + bytes memory returndata = address(token).functionCall(data); + if (returndata.length != 0 && !abi.decode(returndata, (bool))) { + revert SafeERC20FailedOperation(address(token)); + } + } + + /** + * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement + * on the return value: the return value is optional (but if data is returned, it must not be false). + * @param token The token targeted by the call. + * @param data The call data (encoded using abi.encode or one of its variants). + * + * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead. + */ + function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) { + // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since + // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false + // and not revert is the subcall reverts. + + (bool success, bytes memory returndata) = address(token).call(data); + return success && (returndata.length == 0 || abi.decode(returndata, (bool))) && address(token).code.length > 0; + } +} diff --git a/contracts/src/v0.8/vendor/openzeppelin-solidity/v5.0.2/contracts/utils/Address.sol b/contracts/src/v0.8/vendor/openzeppelin-solidity/v5.0.2/contracts/utils/Address.sol new file mode 100644 index 00000000000..b7e3059529a --- /dev/null +++ b/contracts/src/v0.8/vendor/openzeppelin-solidity/v5.0.2/contracts/utils/Address.sol @@ -0,0 +1,159 @@ +// SPDX-License-Identifier: MIT +// OpenZeppelin Contracts (last updated v5.0.0) (utils/Address.sol) + +pragma solidity ^0.8.20; + +/** + * @dev Collection of functions related to the address type + */ +library Address { + /** + * @dev The ETH balance of the account is not enough to perform the operation. + */ + error AddressInsufficientBalance(address account); + + /** + * @dev There's no code at `target` (it is not a contract). + */ + error AddressEmptyCode(address target); + + /** + * @dev A call to an address target failed. The target may have reverted. + */ + error FailedInnerCall(); + + /** + * @dev Replacement for Solidity's `transfer`: sends `amount` wei to + * `recipient`, forwarding all available gas and reverting on errors. + * + * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost + * of certain opcodes, possibly making contracts go over the 2300 gas limit + * imposed by `transfer`, making them unable to receive funds via + * `transfer`. {sendValue} removes this limitation. + * + * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more]. + * + * IMPORTANT: because control is transferred to `recipient`, care must be + * taken to not create reentrancy vulnerabilities. Consider using + * {ReentrancyGuard} or the + * https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. + */ + function sendValue(address payable recipient, uint256 amount) internal { + if (address(this).balance < amount) { + revert AddressInsufficientBalance(address(this)); + } + + (bool success, ) = recipient.call{value: amount}(""); + if (!success) { + revert FailedInnerCall(); + } + } + + /** + * @dev Performs a Solidity function call using a low level `call`. A + * plain `call` is an unsafe replacement for a function call: use this + * function instead. + * + * If `target` reverts with a revert reason or custom error, it is bubbled + * up by this function (like regular Solidity function calls). However, if + * the call reverted with no returned reason, this function reverts with a + * {FailedInnerCall} error. + * + * Returns the raw returned data. To convert to the expected return value, + * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. + * + * Requirements: + * + * - `target` must be a contract. + * - calling `target` with `data` must not revert. + */ + function functionCall(address target, bytes memory data) internal returns (bytes memory) { + return functionCallWithValue(target, data, 0); + } + + /** + * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], + * but also transferring `value` wei to `target`. + * + * Requirements: + * + * - the calling contract must have an ETH balance of at least `value`. + * - the called Solidity function must be `payable`. + */ + function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { + if (address(this).balance < value) { + revert AddressInsufficientBalance(address(this)); + } + (bool success, bytes memory returndata) = target.call{value: value}(data); + return verifyCallResultFromTarget(target, success, returndata); + } + + /** + * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], + * but performing a static call. + */ + function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { + (bool success, bytes memory returndata) = target.staticcall(data); + return verifyCallResultFromTarget(target, success, returndata); + } + + /** + * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], + * but performing a delegate call. + */ + function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { + (bool success, bytes memory returndata) = target.delegatecall(data); + return verifyCallResultFromTarget(target, success, returndata); + } + + /** + * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target + * was not a contract or bubbling up the revert reason (falling back to {FailedInnerCall}) in case of an + * unsuccessful call. + */ + function verifyCallResultFromTarget( + address target, + bool success, + bytes memory returndata + ) internal view returns (bytes memory) { + if (!success) { + _revert(returndata); + } else { + // only check if target is a contract if the call was successful and the return data is empty + // otherwise we already know that it was a contract + if (returndata.length == 0 && target.code.length == 0) { + revert AddressEmptyCode(target); + } + return returndata; + } + } + + /** + * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the + * revert reason or with a default {FailedInnerCall} error. + */ + function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) { + if (!success) { + _revert(returndata); + } else { + return returndata; + } + } + + /** + * @dev Reverts with returndata if present. Otherwise reverts with {FailedInnerCall}. + */ + function _revert(bytes memory returndata) private pure { + // Look for revert reason and bubble it up if present + if (returndata.length > 0) { + // The easiest way to bubble the revert reason is using memory via assembly + /// @solidity memory-safe-assembly + assembly { + let returndata_size := mload(returndata) + revert(add(32, returndata), returndata_size) + } + } else { + revert FailedInnerCall(); + } + } +} diff --git a/contracts/src/v0.8/vendor/openzeppelin-solidity/v5.0.2/contracts/utils/Context.sol b/contracts/src/v0.8/vendor/openzeppelin-solidity/v5.0.2/contracts/utils/Context.sol new file mode 100644 index 00000000000..4e535fe03c2 --- /dev/null +++ b/contracts/src/v0.8/vendor/openzeppelin-solidity/v5.0.2/contracts/utils/Context.sol @@ -0,0 +1,28 @@ +// SPDX-License-Identifier: MIT +// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol) + +pragma solidity ^0.8.20; + +/** + * @dev Provides information about the current execution context, including the + * sender of the transaction and its data. While these are generally available + * via msg.sender and msg.data, they should not be accessed in such a direct + * manner, since when dealing with meta-transactions the account sending and + * paying for execution may not be the actual sender (as far as an application + * is concerned). + * + * This contract is only required for intermediate, library-like contracts. + */ +abstract contract Context { + function _msgSender() internal view virtual returns (address) { + return msg.sender; + } + + function _msgData() internal view virtual returns (bytes calldata) { + return msg.data; + } + + function _contextSuffixLength() internal view virtual returns (uint256) { + return 0; + } +} diff --git a/contracts/src/v0.8/vendor/openzeppelin-solidity/v5.0.2/contracts/utils/Pausable.sol b/contracts/src/v0.8/vendor/openzeppelin-solidity/v5.0.2/contracts/utils/Pausable.sol new file mode 100644 index 00000000000..312f1cb90fe --- /dev/null +++ b/contracts/src/v0.8/vendor/openzeppelin-solidity/v5.0.2/contracts/utils/Pausable.sol @@ -0,0 +1,119 @@ +// SPDX-License-Identifier: MIT +// OpenZeppelin Contracts (last updated v5.0.0) (utils/Pausable.sol) + +pragma solidity ^0.8.20; + +import {Context} from "../utils/Context.sol"; + +/** + * @dev Contract module which allows children to implement an emergency stop + * mechanism that can be triggered by an authorized account. + * + * This module is used through inheritance. It will make available the + * modifiers `whenNotPaused` and `whenPaused`, which can be applied to + * the functions of your contract. Note that they will not be pausable by + * simply including this module, only once the modifiers are put in place. + */ +abstract contract Pausable is Context { + bool private _paused; + + /** + * @dev Emitted when the pause is triggered by `account`. + */ + event Paused(address account); + + /** + * @dev Emitted when the pause is lifted by `account`. + */ + event Unpaused(address account); + + /** + * @dev The operation failed because the contract is paused. + */ + error EnforcedPause(); + + /** + * @dev The operation failed because the contract is not paused. + */ + error ExpectedPause(); + + /** + * @dev Initializes the contract in unpaused state. + */ + constructor() { + _paused = false; + } + + /** + * @dev Modifier to make a function callable only when the contract is not paused. + * + * Requirements: + * + * - The contract must not be paused. + */ + modifier whenNotPaused() { + _requireNotPaused(); + _; + } + + /** + * @dev Modifier to make a function callable only when the contract is paused. + * + * Requirements: + * + * - The contract must be paused. + */ + modifier whenPaused() { + _requirePaused(); + _; + } + + /** + * @dev Returns true if the contract is paused, and false otherwise. + */ + function paused() public view virtual returns (bool) { + return _paused; + } + + /** + * @dev Throws if the contract is paused. + */ + function _requireNotPaused() internal view virtual { + if (paused()) { + revert EnforcedPause(); + } + } + + /** + * @dev Throws if the contract is not paused. + */ + function _requirePaused() internal view virtual { + if (!paused()) { + revert ExpectedPause(); + } + } + + /** + * @dev Triggers stopped state. + * + * Requirements: + * + * - The contract must not be paused. + */ + function _pause() internal virtual whenNotPaused { + _paused = true; + emit Paused(_msgSender()); + } + + /** + * @dev Returns to normal state. + * + * Requirements: + * + * - The contract must be paused. + */ + function _unpause() internal virtual whenPaused { + _paused = false; + emit Unpaused(_msgSender()); + } +} diff --git a/contracts/src/v0.8/vendor/openzeppelin-solidity/v5.0.2/contracts/utils/ShortStrings.sol b/contracts/src/v0.8/vendor/openzeppelin-solidity/v5.0.2/contracts/utils/ShortStrings.sol new file mode 100644 index 00000000000..fdfe774d635 --- /dev/null +++ b/contracts/src/v0.8/vendor/openzeppelin-solidity/v5.0.2/contracts/utils/ShortStrings.sol @@ -0,0 +1,123 @@ +// SPDX-License-Identifier: MIT +// OpenZeppelin Contracts (last updated v5.0.0) (utils/ShortStrings.sol) + +pragma solidity ^0.8.20; + +import {StorageSlot} from "./StorageSlot.sol"; + +// | string | 0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA | +// | length | 0x BB | +type ShortString is bytes32; + +/** + * @dev This library provides functions to convert short memory strings + * into a `ShortString` type that can be used as an immutable variable. + * + * Strings of arbitrary length can be optimized using this library if + * they are short enough (up to 31 bytes) by packing them with their + * length (1 byte) in a single EVM word (32 bytes). Additionally, a + * fallback mechanism can be used for every other case. + * + * Usage example: + * + * ```solidity + * contract Named { + * using ShortStrings for *; + * + * ShortString private immutable _name; + * string private _nameFallback; + * + * constructor(string memory contractName) { + * _name = contractName.toShortStringWithFallback(_nameFallback); + * } + * + * function name() external view returns (string memory) { + * return _name.toStringWithFallback(_nameFallback); + * } + * } + * ``` + */ +library ShortStrings { + // Used as an identifier for strings longer than 31 bytes. + bytes32 private constant FALLBACK_SENTINEL = 0x00000000000000000000000000000000000000000000000000000000000000FF; + + error StringTooLong(string str); + error InvalidShortString(); + + /** + * @dev Encode a string of at most 31 chars into a `ShortString`. + * + * This will trigger a `StringTooLong` error is the input string is too long. + */ + function toShortString(string memory str) internal pure returns (ShortString) { + bytes memory bstr = bytes(str); + if (bstr.length > 31) { + revert StringTooLong(str); + } + return ShortString.wrap(bytes32(uint256(bytes32(bstr)) | bstr.length)); + } + + /** + * @dev Decode a `ShortString` back to a "normal" string. + */ + function toString(ShortString sstr) internal pure returns (string memory) { + uint256 len = byteLength(sstr); + // using `new string(len)` would work locally but is not memory safe. + string memory str = new string(32); + /// @solidity memory-safe-assembly + assembly { + mstore(str, len) + mstore(add(str, 0x20), sstr) + } + return str; + } + + /** + * @dev Return the length of a `ShortString`. + */ + function byteLength(ShortString sstr) internal pure returns (uint256) { + uint256 result = uint256(ShortString.unwrap(sstr)) & 0xFF; + if (result > 31) { + revert InvalidShortString(); + } + return result; + } + + /** + * @dev Encode a string into a `ShortString`, or write it to storage if it is too long. + */ + function toShortStringWithFallback(string memory value, string storage store) internal returns (ShortString) { + if (bytes(value).length < 32) { + return toShortString(value); + } else { + StorageSlot.getStringSlot(store).value = value; + return ShortString.wrap(FALLBACK_SENTINEL); + } + } + + /** + * @dev Decode a string that was encoded to `ShortString` or written to storage using {setWithFallback}. + */ + function toStringWithFallback(ShortString value, string storage store) internal pure returns (string memory) { + if (ShortString.unwrap(value) != FALLBACK_SENTINEL) { + return toString(value); + } else { + return store; + } + } + + /** + * @dev Return the length of a string that was encoded to `ShortString` or written to storage using + * {setWithFallback}. + * + * WARNING: This will return the "byte length" of the string. This may not reflect the actual length in terms of + * actual characters as the UTF-8 encoding of a single character can span over multiple bytes. + */ + function byteLengthWithFallback(ShortString value, string storage store) internal view returns (uint256) { + if (ShortString.unwrap(value) != FALLBACK_SENTINEL) { + return byteLength(value); + } else { + return bytes(store).length; + } + } +} diff --git a/contracts/src/v0.8/vendor/openzeppelin-solidity/v5.0.2/contracts/utils/StorageSlot.sol b/contracts/src/v0.8/vendor/openzeppelin-solidity/v5.0.2/contracts/utils/StorageSlot.sol new file mode 100644 index 00000000000..08418327a59 --- /dev/null +++ b/contracts/src/v0.8/vendor/openzeppelin-solidity/v5.0.2/contracts/utils/StorageSlot.sol @@ -0,0 +1,135 @@ +// SPDX-License-Identifier: MIT +// OpenZeppelin Contracts (last updated v5.0.0) (utils/StorageSlot.sol) +// This file was procedurally generated from scripts/generate/templates/StorageSlot.js. + +pragma solidity ^0.8.20; + +/** + * @dev Library for reading and writing primitive types to specific storage slots. + * + * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts. + * This library helps with reading and writing to such slots without the need for inline assembly. + * + * The functions in this library return Slot structs that contain a `value` member that can be used to read or write. + * + * Example usage to set ERC1967 implementation slot: + * ```solidity + * contract ERC1967 { + * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; + * + * function _getImplementation() internal view returns (address) { + * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value; + * } + * + * function _setImplementation(address newImplementation) internal { + * require(newImplementation.code.length > 0); + * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation; + * } + * } + * ``` + */ +library StorageSlot { + struct AddressSlot { + address value; + } + + struct BooleanSlot { + bool value; + } + + struct Bytes32Slot { + bytes32 value; + } + + struct Uint256Slot { + uint256 value; + } + + struct StringSlot { + string value; + } + + struct BytesSlot { + bytes value; + } + + /** + * @dev Returns an `AddressSlot` with member `value` located at `slot`. + */ + function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) { + /// @solidity memory-safe-assembly + assembly { + r.slot := slot + } + } + + /** + * @dev Returns an `BooleanSlot` with member `value` located at `slot`. + */ + function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) { + /// @solidity memory-safe-assembly + assembly { + r.slot := slot + } + } + + /** + * @dev Returns an `Bytes32Slot` with member `value` located at `slot`. + */ + function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) { + /// @solidity memory-safe-assembly + assembly { + r.slot := slot + } + } + + /** + * @dev Returns an `Uint256Slot` with member `value` located at `slot`. + */ + function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) { + /// @solidity memory-safe-assembly + assembly { + r.slot := slot + } + } + + /** + * @dev Returns an `StringSlot` with member `value` located at `slot`. + */ + function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) { + /// @solidity memory-safe-assembly + assembly { + r.slot := slot + } + } + + /** + * @dev Returns an `StringSlot` representation of the string storage pointer `store`. + */ + function getStringSlot(string storage store) internal pure returns (StringSlot storage r) { + /// @solidity memory-safe-assembly + assembly { + r.slot := store.slot + } + } + + /** + * @dev Returns an `BytesSlot` with member `value` located at `slot`. + */ + function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) { + /// @solidity memory-safe-assembly + assembly { + r.slot := slot + } + } + + /** + * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`. + */ + function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) { + /// @solidity memory-safe-assembly + assembly { + r.slot := store.slot + } + } +} diff --git a/contracts/src/v0.8/vendor/openzeppelin-solidity/v5.0.2/contracts/utils/Strings.sol b/contracts/src/v0.8/vendor/openzeppelin-solidity/v5.0.2/contracts/utils/Strings.sol new file mode 100644 index 00000000000..b2c0a40fb2a --- /dev/null +++ b/contracts/src/v0.8/vendor/openzeppelin-solidity/v5.0.2/contracts/utils/Strings.sol @@ -0,0 +1,94 @@ +// SPDX-License-Identifier: MIT +// OpenZeppelin Contracts (last updated v5.0.0) (utils/Strings.sol) + +pragma solidity ^0.8.20; + +import {Math} from "./math/Math.sol"; +import {SignedMath} from "./math/SignedMath.sol"; + +/** + * @dev String operations. + */ +library Strings { + bytes16 private constant HEX_DIGITS = "0123456789abcdef"; + uint8 private constant ADDRESS_LENGTH = 20; + + /** + * @dev The `value` string doesn't fit in the specified `length`. + */ + error StringsInsufficientHexLength(uint256 value, uint256 length); + + /** + * @dev Converts a `uint256` to its ASCII `string` decimal representation. + */ + function toString(uint256 value) internal pure returns (string memory) { + unchecked { + uint256 length = Math.log10(value) + 1; + string memory buffer = new string(length); + uint256 ptr; + /// @solidity memory-safe-assembly + assembly { + ptr := add(buffer, add(32, length)) + } + while (true) { + ptr--; + /// @solidity memory-safe-assembly + assembly { + mstore8(ptr, byte(mod(value, 10), HEX_DIGITS)) + } + value /= 10; + if (value == 0) break; + } + return buffer; + } + } + + /** + * @dev Converts a `int256` to its ASCII `string` decimal representation. + */ + function toStringSigned(int256 value) internal pure returns (string memory) { + return string.concat(value < 0 ? "-" : "", toString(SignedMath.abs(value))); + } + + /** + * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. + */ + function toHexString(uint256 value) internal pure returns (string memory) { + unchecked { + return toHexString(value, Math.log256(value) + 1); + } + } + + /** + * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. + */ + function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { + uint256 localValue = value; + bytes memory buffer = new bytes(2 * length + 2); + buffer[0] = "0"; + buffer[1] = "x"; + for (uint256 i = 2 * length + 1; i > 1; --i) { + buffer[i] = HEX_DIGITS[localValue & 0xf]; + localValue >>= 4; + } + if (localValue != 0) { + revert StringsInsufficientHexLength(value, length); + } + return string(buffer); + } + + /** + * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal + * representation. + */ + function toHexString(address addr) internal pure returns (string memory) { + return toHexString(uint256(uint160(addr)), ADDRESS_LENGTH); + } + + /** + * @dev Returns true if the two strings are equal. + */ + function equal(string memory a, string memory b) internal pure returns (bool) { + return bytes(a).length == bytes(b).length && keccak256(bytes(a)) == keccak256(bytes(b)); + } +} diff --git a/contracts/src/v0.8/vendor/openzeppelin-solidity/v5.0.2/contracts/utils/cryptography/ECDSA.sol b/contracts/src/v0.8/vendor/openzeppelin-solidity/v5.0.2/contracts/utils/cryptography/ECDSA.sol new file mode 100644 index 00000000000..04b3e5e0646 --- /dev/null +++ b/contracts/src/v0.8/vendor/openzeppelin-solidity/v5.0.2/contracts/utils/cryptography/ECDSA.sol @@ -0,0 +1,174 @@ +// SPDX-License-Identifier: MIT +// OpenZeppelin Contracts (last updated v5.0.0) (utils/cryptography/ECDSA.sol) + +pragma solidity ^0.8.20; + +/** + * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations. + * + * These functions can be used to verify that a message was signed by the holder + * of the private keys of a given address. + */ +library ECDSA { + enum RecoverError { + NoError, + InvalidSignature, + InvalidSignatureLength, + InvalidSignatureS + } + + /** + * @dev The signature derives the `address(0)`. + */ + error ECDSAInvalidSignature(); + + /** + * @dev The signature has an invalid length. + */ + error ECDSAInvalidSignatureLength(uint256 length); + + /** + * @dev The signature has an S value that is in the upper half order. + */ + error ECDSAInvalidSignatureS(bytes32 s); + + /** + * @dev Returns the address that signed a hashed message (`hash`) with `signature` or an error. This will not + * return address(0) without also returning an error description. Errors are documented using an enum (error type) + * and a bytes32 providing additional information about the error. + * + * If no error is returned, then the address can be used for verification purposes. + * + * The `ecrecover` EVM precompile allows for malleable (non-unique) signatures: + * this function rejects them by requiring the `s` value to be in the lower + * half order, and the `v` value to be either 27 or 28. + * + * IMPORTANT: `hash` _must_ be the result of a hash operation for the + * verification to be secure: it is possible to craft signatures that + * recover to arbitrary addresses for non-hashed data. A safe way to ensure + * this is by receiving a hash of the original message (which may otherwise + * be too long), and then calling {MessageHashUtils-toEthSignedMessageHash} on it. + * + * Documentation for signature generation: + * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js] + * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers] + */ + function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError, bytes32) { + if (signature.length == 65) { + bytes32 r; + bytes32 s; + uint8 v; + // ecrecover takes the signature parameters, and the only way to get them + // currently is to use assembly. + /// @solidity memory-safe-assembly + assembly { + r := mload(add(signature, 0x20)) + s := mload(add(signature, 0x40)) + v := byte(0, mload(add(signature, 0x60))) + } + return tryRecover(hash, v, r, s); + } else { + return (address(0), RecoverError.InvalidSignatureLength, bytes32(signature.length)); + } + } + + /** + * @dev Returns the address that signed a hashed message (`hash`) with + * `signature`. This address can then be used for verification purposes. + * + * The `ecrecover` EVM precompile allows for malleable (non-unique) signatures: + * this function rejects them by requiring the `s` value to be in the lower + * half order, and the `v` value to be either 27 or 28. + * + * IMPORTANT: `hash` _must_ be the result of a hash operation for the + * verification to be secure: it is possible to craft signatures that + * recover to arbitrary addresses for non-hashed data. A safe way to ensure + * this is by receiving a hash of the original message (which may otherwise + * be too long), and then calling {MessageHashUtils-toEthSignedMessageHash} on it. + */ + function recover(bytes32 hash, bytes memory signature) internal pure returns (address) { + (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, signature); + _throwError(error, errorArg); + return recovered; + } + + /** + * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately. + * + * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures] + */ + function tryRecover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address, RecoverError, bytes32) { + unchecked { + bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff); + // We do not check for an overflow here since the shift operation results in 0 or 1. + uint8 v = uint8((uint256(vs) >> 255) + 27); + return tryRecover(hash, v, r, s); + } + } + + /** + * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately. + */ + function recover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address) { + (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, r, vs); + _throwError(error, errorArg); + return recovered; + } + + /** + * @dev Overload of {ECDSA-tryRecover} that receives the `v`, + * `r` and `s` signature fields separately. + */ + function tryRecover( + bytes32 hash, + uint8 v, + bytes32 r, + bytes32 s + ) internal pure returns (address, RecoverError, bytes32) { + // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature + // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines + // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most + // signatures from current libraries generate a unique signature with an s-value in the lower half order. + // + // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value + // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or + // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept + // these malleable signatures as well. + if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) { + return (address(0), RecoverError.InvalidSignatureS, s); + } + + // If the signature is valid (and not malleable), return the signer address + address signer = ecrecover(hash, v, r, s); + if (signer == address(0)) { + return (address(0), RecoverError.InvalidSignature, bytes32(0)); + } + + return (signer, RecoverError.NoError, bytes32(0)); + } + + /** + * @dev Overload of {ECDSA-recover} that receives the `v`, + * `r` and `s` signature fields separately. + */ + function recover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address) { + (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, v, r, s); + _throwError(error, errorArg); + return recovered; + } + + /** + * @dev Optionally reverts with the corresponding custom error according to the `error` argument provided. + */ + function _throwError(RecoverError error, bytes32 errorArg) private pure { + if (error == RecoverError.NoError) { + return; // no error: do nothing + } else if (error == RecoverError.InvalidSignature) { + revert ECDSAInvalidSignature(); + } else if (error == RecoverError.InvalidSignatureLength) { + revert ECDSAInvalidSignatureLength(uint256(errorArg)); + } else if (error == RecoverError.InvalidSignatureS) { + revert ECDSAInvalidSignatureS(errorArg); + } + } +} diff --git a/contracts/src/v0.8/vendor/openzeppelin-solidity/v5.0.2/contracts/utils/cryptography/EIP712.sol b/contracts/src/v0.8/vendor/openzeppelin-solidity/v5.0.2/contracts/utils/cryptography/EIP712.sol new file mode 100644 index 00000000000..8e548cdd8f0 --- /dev/null +++ b/contracts/src/v0.8/vendor/openzeppelin-solidity/v5.0.2/contracts/utils/cryptography/EIP712.sol @@ -0,0 +1,160 @@ +// SPDX-License-Identifier: MIT +// OpenZeppelin Contracts (last updated v5.0.0) (utils/cryptography/EIP712.sol) + +pragma solidity ^0.8.20; + +import {MessageHashUtils} from "./MessageHashUtils.sol"; +import {ShortStrings, ShortString} from "../ShortStrings.sol"; +import {IERC5267} from "../../interfaces/IERC5267.sol"; + +/** + * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data. + * + * The encoding scheme specified in the EIP requires a domain separator and a hash of the typed structured data, whose + * encoding is very generic and therefore its implementation in Solidity is not feasible, thus this contract + * does not implement the encoding itself. Protocols need to implement the type-specific encoding they need in order to + * produce the hash of their typed data using a combination of `abi.encode` and `keccak256`. + * + * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding + * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA + * ({_hashTypedDataV4}). + * + * The implementation of the domain separator was designed to be as efficient as possible while still properly updating + * the chain id to protect against replay attacks on an eventual fork of the chain. + * + * NOTE: This contract implements the version of the encoding known as "v4", as implemented by the JSON RPC method + * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask]. + * + * NOTE: In the upgradeable version of this contract, the cached values will correspond to the address, and the domain + * separator of the implementation contract. This will cause the {_domainSeparatorV4} function to always rebuild the + * separator from the immutable values, which is cheaper than accessing a cached version in cold storage. + * + * @custom:oz-upgrades-unsafe-allow state-variable-immutable + */ +abstract contract EIP712 is IERC5267 { + using ShortStrings for *; + + bytes32 private constant TYPE_HASH = + keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"); + + // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to + // invalidate the cached domain separator if the chain id changes. + bytes32 private immutable _cachedDomainSeparator; + uint256 private immutable _cachedChainId; + address private immutable _cachedThis; + + bytes32 private immutable _hashedName; + bytes32 private immutable _hashedVersion; + + ShortString private immutable _name; + ShortString private immutable _version; + string private _nameFallback; + string private _versionFallback; + + /** + * @dev Initializes the domain separator and parameter caches. + * + * The meaning of `name` and `version` is specified in + * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]: + * + * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol. + * - `version`: the current major version of the signing domain. + * + * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart + * contract upgrade]. + */ + constructor(string memory name, string memory version) { + _name = name.toShortStringWithFallback(_nameFallback); + _version = version.toShortStringWithFallback(_versionFallback); + _hashedName = keccak256(bytes(name)); + _hashedVersion = keccak256(bytes(version)); + + _cachedChainId = block.chainid; + _cachedDomainSeparator = _buildDomainSeparator(); + _cachedThis = address(this); + } + + /** + * @dev Returns the domain separator for the current chain. + */ + function _domainSeparatorV4() internal view returns (bytes32) { + if (address(this) == _cachedThis && block.chainid == _cachedChainId) { + return _cachedDomainSeparator; + } else { + return _buildDomainSeparator(); + } + } + + function _buildDomainSeparator() private view returns (bytes32) { + return keccak256(abi.encode(TYPE_HASH, _hashedName, _hashedVersion, block.chainid, address(this))); + } + + /** + * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this + * function returns the hash of the fully encoded EIP712 message for this domain. + * + * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example: + * + * ```solidity + * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode( + * keccak256("Mail(address to,string contents)"), + * mailTo, + * keccak256(bytes(mailContents)) + * ))); + * address signer = ECDSA.recover(digest, signature); + * ``` + */ + function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) { + return MessageHashUtils.toTypedDataHash(_domainSeparatorV4(), structHash); + } + + /** + * @dev See {IERC-5267}. + */ + function eip712Domain() + public + view + virtual + returns ( + bytes1 fields, + string memory name, + string memory version, + uint256 chainId, + address verifyingContract, + bytes32 salt, + uint256[] memory extensions + ) + { + return ( + hex"0f", // 01111 + _EIP712Name(), + _EIP712Version(), + block.chainid, + address(this), + bytes32(0), + new uint256[](0) + ); + } + + /** + * @dev The name parameter for the EIP712 domain. + * + * NOTE: By default this function reads _name which is an immutable value. + * It only reads from storage if necessary (in case the value is too large to fit in a ShortString). + */ + // solhint-disable-next-line func-name-mixedcase + function _EIP712Name() internal view returns (string memory) { + return _name.toStringWithFallback(_nameFallback); + } + + /** + * @dev The version parameter for the EIP712 domain. + * + * NOTE: By default this function reads _version which is an immutable value. + * It only reads from storage if necessary (in case the value is too large to fit in a ShortString). + */ + // solhint-disable-next-line func-name-mixedcase + function _EIP712Version() internal view returns (string memory) { + return _version.toStringWithFallback(_versionFallback); + } +} diff --git a/contracts/src/v0.8/vendor/openzeppelin-solidity/v5.0.2/contracts/utils/cryptography/MessageHashUtils.sol b/contracts/src/v0.8/vendor/openzeppelin-solidity/v5.0.2/contracts/utils/cryptography/MessageHashUtils.sol new file mode 100644 index 00000000000..8836693e79b --- /dev/null +++ b/contracts/src/v0.8/vendor/openzeppelin-solidity/v5.0.2/contracts/utils/cryptography/MessageHashUtils.sol @@ -0,0 +1,86 @@ +// SPDX-License-Identifier: MIT +// OpenZeppelin Contracts (last updated v5.0.0) (utils/cryptography/MessageHashUtils.sol) + +pragma solidity ^0.8.20; + +import {Strings} from "../Strings.sol"; + +/** + * @dev Signature message hash utilities for producing digests to be consumed by {ECDSA} recovery or signing. + * + * The library provides methods for generating a hash of a message that conforms to the + * https://eips.ethereum.org/EIPS/eip-191[EIP 191] and https://eips.ethereum.org/EIPS/eip-712[EIP 712] + * specifications. + */ +library MessageHashUtils { + /** + * @dev Returns the keccak256 digest of an EIP-191 signed data with version + * `0x45` (`personal_sign` messages). + * + * The digest is calculated by prefixing a bytes32 `messageHash` with + * `"\x19Ethereum Signed Message:\n32"` and hashing the result. It corresponds with the + * hash signed when using the https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] JSON-RPC method. + * + * NOTE: The `messageHash` parameter is intended to be the result of hashing a raw message with + * keccak256, although any bytes32 value can be safely used because the final digest will + * be re-hashed. + * + * See {ECDSA-recover}. + */ + function toEthSignedMessageHash(bytes32 messageHash) internal pure returns (bytes32 digest) { + /// @solidity memory-safe-assembly + assembly { + mstore(0x00, "\x19Ethereum Signed Message:\n32") // 32 is the bytes-length of messageHash + mstore(0x1c, messageHash) // 0x1c (28) is the length of the prefix + digest := keccak256(0x00, 0x3c) // 0x3c is the length of the prefix (0x1c) + messageHash (0x20) + } + } + + /** + * @dev Returns the keccak256 digest of an EIP-191 signed data with version + * `0x45` (`personal_sign` messages). + * + * The digest is calculated by prefixing an arbitrary `message` with + * `"\x19Ethereum Signed Message:\n" + len(message)` and hashing the result. It corresponds with the + * hash signed when using the https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] JSON-RPC method. + * + * See {ECDSA-recover}. + */ + function toEthSignedMessageHash(bytes memory message) internal pure returns (bytes32) { + return + keccak256(bytes.concat("\x19Ethereum Signed Message:\n", bytes(Strings.toString(message.length)), message)); + } + + /** + * @dev Returns the keccak256 digest of an EIP-191 signed data with version + * `0x00` (data with intended validator). + * + * The digest is calculated by prefixing an arbitrary `data` with `"\x19\x00"` and the intended + * `validator` address. Then hashing the result. + * + * See {ECDSA-recover}. + */ + function toDataWithIntendedValidatorHash(address validator, bytes memory data) internal pure returns (bytes32) { + return keccak256(abi.encodePacked(hex"19_00", validator, data)); + } + + /** + * @dev Returns the keccak256 digest of an EIP-712 typed data (EIP-191 version `0x01`). + * + * The digest is calculated from a `domainSeparator` and a `structHash`, by prefixing them with + * `\x19\x01` and hashing the result. It corresponds to the hash signed by the + * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] JSON-RPC method as part of EIP-712. + * + * See {ECDSA-recover}. + */ + function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32 digest) { + /// @solidity memory-safe-assembly + assembly { + let ptr := mload(0x40) + mstore(ptr, hex"19_01") + mstore(add(ptr, 0x02), domainSeparator) + mstore(add(ptr, 0x22), structHash) + digest := keccak256(ptr, 0x42) + } + } +} diff --git a/contracts/src/v0.8/vendor/openzeppelin-solidity/v5.0.2/contracts/utils/introspection/ERC165.sol b/contracts/src/v0.8/vendor/openzeppelin-solidity/v5.0.2/contracts/utils/introspection/ERC165.sol new file mode 100644 index 00000000000..1e77b60d739 --- /dev/null +++ b/contracts/src/v0.8/vendor/openzeppelin-solidity/v5.0.2/contracts/utils/introspection/ERC165.sol @@ -0,0 +1,27 @@ +// SPDX-License-Identifier: MIT +// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/ERC165.sol) + +pragma solidity ^0.8.20; + +import {IERC165} from "./IERC165.sol"; + +/** + * @dev Implementation of the {IERC165} interface. + * + * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check + * for the additional interface id that will be supported. For example: + * + * ```solidity + * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { + * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); + * } + * ``` + */ +abstract contract ERC165 is IERC165 { + /** + * @dev See {IERC165-supportsInterface}. + */ + function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) { + return interfaceId == type(IERC165).interfaceId; + } +} diff --git a/contracts/src/v0.8/vendor/openzeppelin-solidity/v5.0.2/contracts/utils/introspection/ERC165Checker.sol b/contracts/src/v0.8/vendor/openzeppelin-solidity/v5.0.2/contracts/utils/introspection/ERC165Checker.sol new file mode 100644 index 00000000000..7b52241446d --- /dev/null +++ b/contracts/src/v0.8/vendor/openzeppelin-solidity/v5.0.2/contracts/utils/introspection/ERC165Checker.sol @@ -0,0 +1,124 @@ +// SPDX-License-Identifier: MIT +// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/ERC165Checker.sol) + +pragma solidity ^0.8.20; + +import {IERC165} from "./IERC165.sol"; + +/** + * @dev Library used to query support of an interface declared via {IERC165}. + * + * Note that these functions return the actual result of the query: they do not + * `revert` if an interface is not supported. It is up to the caller to decide + * what to do in these cases. + */ +library ERC165Checker { + // As per the EIP-165 spec, no interface should ever match 0xffffffff + bytes4 private constant INTERFACE_ID_INVALID = 0xffffffff; + + /** + * @dev Returns true if `account` supports the {IERC165} interface. + */ + function supportsERC165(address account) internal view returns (bool) { + // Any contract that implements ERC165 must explicitly indicate support of + // InterfaceId_ERC165 and explicitly indicate non-support of InterfaceId_Invalid + return + supportsERC165InterfaceUnchecked(account, type(IERC165).interfaceId) && + !supportsERC165InterfaceUnchecked(account, INTERFACE_ID_INVALID); + } + + /** + * @dev Returns true if `account` supports the interface defined by + * `interfaceId`. Support for {IERC165} itself is queried automatically. + * + * See {IERC165-supportsInterface}. + */ + function supportsInterface(address account, bytes4 interfaceId) internal view returns (bool) { + // query support of both ERC165 as per the spec and support of _interfaceId + return supportsERC165(account) && supportsERC165InterfaceUnchecked(account, interfaceId); + } + + /** + * @dev Returns a boolean array where each value corresponds to the + * interfaces passed in and whether they're supported or not. This allows + * you to batch check interfaces for a contract where your expectation + * is that some interfaces may not be supported. + * + * See {IERC165-supportsInterface}. + */ + function getSupportedInterfaces( + address account, + bytes4[] memory interfaceIds + ) internal view returns (bool[] memory) { + // an array of booleans corresponding to interfaceIds and whether they're supported or not + bool[] memory interfaceIdsSupported = new bool[](interfaceIds.length); + + // query support of ERC165 itself + if (supportsERC165(account)) { + // query support of each interface in interfaceIds + for (uint256 i = 0; i < interfaceIds.length; i++) { + interfaceIdsSupported[i] = supportsERC165InterfaceUnchecked(account, interfaceIds[i]); + } + } + + return interfaceIdsSupported; + } + + /** + * @dev Returns true if `account` supports all the interfaces defined in + * `interfaceIds`. Support for {IERC165} itself is queried automatically. + * + * Batch-querying can lead to gas savings by skipping repeated checks for + * {IERC165} support. + * + * See {IERC165-supportsInterface}. + */ + function supportsAllInterfaces(address account, bytes4[] memory interfaceIds) internal view returns (bool) { + // query support of ERC165 itself + if (!supportsERC165(account)) { + return false; + } + + // query support of each interface in interfaceIds + for (uint256 i = 0; i < interfaceIds.length; i++) { + if (!supportsERC165InterfaceUnchecked(account, interfaceIds[i])) { + return false; + } + } + + // all interfaces supported + return true; + } + + /** + * @notice Query if a contract implements an interface, does not check ERC165 support + * @param account The address of the contract to query for support of an interface + * @param interfaceId The interface identifier, as specified in ERC-165 + * @return true if the contract at account indicates support of the interface with + * identifier interfaceId, false otherwise + * @dev Assumes that account contains a contract that supports ERC165, otherwise + * the behavior of this method is undefined. This precondition can be checked + * with {supportsERC165}. + * + * Some precompiled contracts will falsely indicate support for a given interface, so caution + * should be exercised when using this function. + * + * Interface identification is specified in ERC-165. + */ + function supportsERC165InterfaceUnchecked(address account, bytes4 interfaceId) internal view returns (bool) { + // prepare call + bytes memory encodedParams = abi.encodeCall(IERC165.supportsInterface, (interfaceId)); + + // perform static call + bool success; + uint256 returnSize; + uint256 returnValue; + assembly { + success := staticcall(30000, account, add(encodedParams, 0x20), mload(encodedParams), 0x00, 0x20) + returnSize := returndatasize() + returnValue := mload(0x00) + } + + return success && returnSize >= 0x20 && returnValue > 0; + } +} diff --git a/contracts/src/v0.8/vendor/openzeppelin-solidity/v5.0.2/contracts/utils/introspection/IERC165.sol b/contracts/src/v0.8/vendor/openzeppelin-solidity/v5.0.2/contracts/utils/introspection/IERC165.sol new file mode 100644 index 00000000000..c09f31fe128 --- /dev/null +++ b/contracts/src/v0.8/vendor/openzeppelin-solidity/v5.0.2/contracts/utils/introspection/IERC165.sol @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: MIT +// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol) + +pragma solidity ^0.8.20; + +/** + * @dev Interface of the ERC165 standard, as defined in the + * https://eips.ethereum.org/EIPS/eip-165[EIP]. + * + * Implementers can declare support of contract interfaces, which can then be + * queried by others ({ERC165Checker}). + * + * For an implementation, see {ERC165}. + */ +interface IERC165 { + /** + * @dev Returns true if this contract implements the interface defined by + * `interfaceId`. See the corresponding + * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] + * to learn more about how these ids are created. + * + * This function call must use less than 30 000 gas. + */ + function supportsInterface(bytes4 interfaceId) external view returns (bool); +} diff --git a/contracts/src/v0.8/vendor/openzeppelin-solidity/v5.0.2/contracts/utils/math/Math.sol b/contracts/src/v0.8/vendor/openzeppelin-solidity/v5.0.2/contracts/utils/math/Math.sol new file mode 100644 index 00000000000..9681524529b --- /dev/null +++ b/contracts/src/v0.8/vendor/openzeppelin-solidity/v5.0.2/contracts/utils/math/Math.sol @@ -0,0 +1,415 @@ +// SPDX-License-Identifier: MIT +// OpenZeppelin Contracts (last updated v5.0.0) (utils/math/Math.sol) + +pragma solidity ^0.8.20; + +/** + * @dev Standard math utilities missing in the Solidity language. + */ +library Math { + /** + * @dev Muldiv operation overflow. + */ + error MathOverflowedMulDiv(); + + enum Rounding { + Floor, // Toward negative infinity + Ceil, // Toward positive infinity + Trunc, // Toward zero + Expand // Away from zero + } + + /** + * @dev Returns the addition of two unsigned integers, with an overflow flag. + */ + function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { + unchecked { + uint256 c = a + b; + if (c < a) return (false, 0); + return (true, c); + } + } + + /** + * @dev Returns the subtraction of two unsigned integers, with an overflow flag. + */ + function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { + unchecked { + if (b > a) return (false, 0); + return (true, a - b); + } + } + + /** + * @dev Returns the multiplication of two unsigned integers, with an overflow flag. + */ + function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { + unchecked { + // Gas optimization: this is cheaper than requiring 'a' not being zero, but the + // benefit is lost if 'b' is also tested. + // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 + if (a == 0) return (true, 0); + uint256 c = a * b; + if (c / a != b) return (false, 0); + return (true, c); + } + } + + /** + * @dev Returns the division of two unsigned integers, with a division by zero flag. + */ + function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { + unchecked { + if (b == 0) return (false, 0); + return (true, a / b); + } + } + + /** + * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. + */ + function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { + unchecked { + if (b == 0) return (false, 0); + return (true, a % b); + } + } + + /** + * @dev Returns the largest of two numbers. + */ + function max(uint256 a, uint256 b) internal pure returns (uint256) { + return a > b ? a : b; + } + + /** + * @dev Returns the smallest of two numbers. + */ + function min(uint256 a, uint256 b) internal pure returns (uint256) { + return a < b ? a : b; + } + + /** + * @dev Returns the average of two numbers. The result is rounded towards + * zero. + */ + function average(uint256 a, uint256 b) internal pure returns (uint256) { + // (a + b) / 2 can overflow. + return (a & b) + (a ^ b) / 2; + } + + /** + * @dev Returns the ceiling of the division of two numbers. + * + * This differs from standard division with `/` in that it rounds towards infinity instead + * of rounding towards zero. + */ + function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { + if (b == 0) { + // Guarantee the same behavior as in a regular Solidity division. + return a / b; + } + + // (a + b - 1) / b can overflow on addition, so we distribute. + return a == 0 ? 0 : (a - 1) / b + 1; + } + + /** + * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or + * denominator == 0. + * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by + * Uniswap Labs also under MIT license. + */ + function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) { + unchecked { + // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use + // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256 + // variables such that product = prod1 * 2^256 + prod0. + uint256 prod0 = x * y; // Least significant 256 bits of the product + uint256 prod1; // Most significant 256 bits of the product + assembly { + let mm := mulmod(x, y, not(0)) + prod1 := sub(sub(mm, prod0), lt(mm, prod0)) + } + + // Handle non-overflow cases, 256 by 256 division. + if (prod1 == 0) { + // Solidity will revert if denominator == 0, unlike the div opcode on its own. + // The surrounding unchecked block does not change this fact. + // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic. + return prod0 / denominator; + } + + // Make sure the result is less than 2^256. Also prevents denominator == 0. + if (denominator <= prod1) { + revert MathOverflowedMulDiv(); + } + + /////////////////////////////////////////////// + // 512 by 256 division. + /////////////////////////////////////////////// + + // Make division exact by subtracting the remainder from [prod1 prod0]. + uint256 remainder; + assembly { + // Compute remainder using mulmod. + remainder := mulmod(x, y, denominator) + + // Subtract 256 bit number from 512 bit number. + prod1 := sub(prod1, gt(remainder, prod0)) + prod0 := sub(prod0, remainder) + } + + // Factor powers of two out of denominator and compute largest power of two divisor of denominator. + // Always >= 1. See https://cs.stackexchange.com/q/138556/92363. + + uint256 twos = denominator & (0 - denominator); + assembly { + // Divide denominator by twos. + denominator := div(denominator, twos) + + // Divide [prod1 prod0] by twos. + prod0 := div(prod0, twos) + + // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one. + twos := add(div(sub(0, twos), twos), 1) + } + + // Shift in bits from prod1 into prod0. + prod0 |= prod1 * twos; + + // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such + // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for + // four bits. That is, denominator * inv = 1 mod 2^4. + uint256 inverse = (3 * denominator) ^ 2; + + // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also + // works in modular arithmetic, doubling the correct bits in each step. + inverse *= 2 - denominator * inverse; // inverse mod 2^8 + inverse *= 2 - denominator * inverse; // inverse mod 2^16 + inverse *= 2 - denominator * inverse; // inverse mod 2^32 + inverse *= 2 - denominator * inverse; // inverse mod 2^64 + inverse *= 2 - denominator * inverse; // inverse mod 2^128 + inverse *= 2 - denominator * inverse; // inverse mod 2^256 + + // Because the division is now exact we can divide by multiplying with the modular inverse of denominator. + // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is + // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1 + // is no longer required. + result = prod0 * inverse; + return result; + } + } + + /** + * @notice Calculates x * y / denominator with full precision, following the selected rounding direction. + */ + function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) { + uint256 result = mulDiv(x, y, denominator); + if (unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0) { + result += 1; + } + return result; + } + + /** + * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded + * towards zero. + * + * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11). + */ + function sqrt(uint256 a) internal pure returns (uint256) { + if (a == 0) { + return 0; + } + + // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target. + // + // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have + // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`. + // + // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)` + // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))` + // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)` + // + // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit. + uint256 result = 1 << (log2(a) >> 1); + + // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128, + // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at + // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision + // into the expected uint128 result. + unchecked { + result = (result + a / result) >> 1; + result = (result + a / result) >> 1; + result = (result + a / result) >> 1; + result = (result + a / result) >> 1; + result = (result + a / result) >> 1; + result = (result + a / result) >> 1; + result = (result + a / result) >> 1; + return min(result, a / result); + } + } + + /** + * @notice Calculates sqrt(a), following the selected rounding direction. + */ + function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) { + unchecked { + uint256 result = sqrt(a); + return result + (unsignedRoundsUp(rounding) && result * result < a ? 1 : 0); + } + } + + /** + * @dev Return the log in base 2 of a positive value rounded towards zero. + * Returns 0 if given 0. + */ + function log2(uint256 value) internal pure returns (uint256) { + uint256 result = 0; + unchecked { + if (value >> 128 > 0) { + value >>= 128; + result += 128; + } + if (value >> 64 > 0) { + value >>= 64; + result += 64; + } + if (value >> 32 > 0) { + value >>= 32; + result += 32; + } + if (value >> 16 > 0) { + value >>= 16; + result += 16; + } + if (value >> 8 > 0) { + value >>= 8; + result += 8; + } + if (value >> 4 > 0) { + value >>= 4; + result += 4; + } + if (value >> 2 > 0) { + value >>= 2; + result += 2; + } + if (value >> 1 > 0) { + result += 1; + } + } + return result; + } + + /** + * @dev Return the log in base 2, following the selected rounding direction, of a positive value. + * Returns 0 if given 0. + */ + function log2(uint256 value, Rounding rounding) internal pure returns (uint256) { + unchecked { + uint256 result = log2(value); + return result + (unsignedRoundsUp(rounding) && 1 << result < value ? 1 : 0); + } + } + + /** + * @dev Return the log in base 10 of a positive value rounded towards zero. + * Returns 0 if given 0. + */ + function log10(uint256 value) internal pure returns (uint256) { + uint256 result = 0; + unchecked { + if (value >= 10 ** 64) { + value /= 10 ** 64; + result += 64; + } + if (value >= 10 ** 32) { + value /= 10 ** 32; + result += 32; + } + if (value >= 10 ** 16) { + value /= 10 ** 16; + result += 16; + } + if (value >= 10 ** 8) { + value /= 10 ** 8; + result += 8; + } + if (value >= 10 ** 4) { + value /= 10 ** 4; + result += 4; + } + if (value >= 10 ** 2) { + value /= 10 ** 2; + result += 2; + } + if (value >= 10 ** 1) { + result += 1; + } + } + return result; + } + + /** + * @dev Return the log in base 10, following the selected rounding direction, of a positive value. + * Returns 0 if given 0. + */ + function log10(uint256 value, Rounding rounding) internal pure returns (uint256) { + unchecked { + uint256 result = log10(value); + return result + (unsignedRoundsUp(rounding) && 10 ** result < value ? 1 : 0); + } + } + + /** + * @dev Return the log in base 256 of a positive value rounded towards zero. + * Returns 0 if given 0. + * + * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string. + */ + function log256(uint256 value) internal pure returns (uint256) { + uint256 result = 0; + unchecked { + if (value >> 128 > 0) { + value >>= 128; + result += 16; + } + if (value >> 64 > 0) { + value >>= 64; + result += 8; + } + if (value >> 32 > 0) { + value >>= 32; + result += 4; + } + if (value >> 16 > 0) { + value >>= 16; + result += 2; + } + if (value >> 8 > 0) { + result += 1; + } + } + return result; + } + + /** + * @dev Return the log in base 256, following the selected rounding direction, of a positive value. + * Returns 0 if given 0. + */ + function log256(uint256 value, Rounding rounding) internal pure returns (uint256) { + unchecked { + uint256 result = log256(value); + return result + (unsignedRoundsUp(rounding) && 1 << (result << 3) < value ? 1 : 0); + } + } + + /** + * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers. + */ + function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) { + return uint8(rounding) % 2 == 1; + } +} diff --git a/contracts/src/v0.8/vendor/openzeppelin-solidity/v5.0.2/contracts/utils/math/SafeCast.sol b/contracts/src/v0.8/vendor/openzeppelin-solidity/v5.0.2/contracts/utils/math/SafeCast.sol new file mode 100644 index 00000000000..0ed458b43c2 --- /dev/null +++ b/contracts/src/v0.8/vendor/openzeppelin-solidity/v5.0.2/contracts/utils/math/SafeCast.sol @@ -0,0 +1,1153 @@ +// SPDX-License-Identifier: MIT +// OpenZeppelin Contracts (last updated v5.0.0) (utils/math/SafeCast.sol) +// This file was procedurally generated from scripts/generate/templates/SafeCast.js. + +pragma solidity ^0.8.20; + +/** + * @dev Wrappers over Solidity's uintXX/intXX casting operators with added overflow + * checks. + * + * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can + * easily result in undesired exploitation or bugs, since developers usually + * assume that overflows raise errors. `SafeCast` restores this intuition by + * reverting the transaction when such an operation overflows. + * + * Using this library instead of the unchecked operations eliminates an entire + * class of bugs, so it's recommended to use it always. + */ +library SafeCast { + /** + * @dev Value doesn't fit in an uint of `bits` size. + */ + error SafeCastOverflowedUintDowncast(uint8 bits, uint256 value); + + /** + * @dev An int value doesn't fit in an uint of `bits` size. + */ + error SafeCastOverflowedIntToUint(int256 value); + + /** + * @dev Value doesn't fit in an int of `bits` size. + */ + error SafeCastOverflowedIntDowncast(uint8 bits, int256 value); + + /** + * @dev An uint value doesn't fit in an int of `bits` size. + */ + error SafeCastOverflowedUintToInt(uint256 value); + + /** + * @dev Returns the downcasted uint248 from uint256, reverting on + * overflow (when the input is greater than largest uint248). + * + * Counterpart to Solidity's `uint248` operator. + * + * Requirements: + * + * - input must fit into 248 bits + */ + function toUint248(uint256 value) internal pure returns (uint248) { + if (value > type(uint248).max) { + revert SafeCastOverflowedUintDowncast(248, value); + } + return uint248(value); + } + + /** + * @dev Returns the downcasted uint240 from uint256, reverting on + * overflow (when the input is greater than largest uint240). + * + * Counterpart to Solidity's `uint240` operator. + * + * Requirements: + * + * - input must fit into 240 bits + */ + function toUint240(uint256 value) internal pure returns (uint240) { + if (value > type(uint240).max) { + revert SafeCastOverflowedUintDowncast(240, value); + } + return uint240(value); + } + + /** + * @dev Returns the downcasted uint232 from uint256, reverting on + * overflow (when the input is greater than largest uint232). + * + * Counterpart to Solidity's `uint232` operator. + * + * Requirements: + * + * - input must fit into 232 bits + */ + function toUint232(uint256 value) internal pure returns (uint232) { + if (value > type(uint232).max) { + revert SafeCastOverflowedUintDowncast(232, value); + } + return uint232(value); + } + + /** + * @dev Returns the downcasted uint224 from uint256, reverting on + * overflow (when the input is greater than largest uint224). + * + * Counterpart to Solidity's `uint224` operator. + * + * Requirements: + * + * - input must fit into 224 bits + */ + function toUint224(uint256 value) internal pure returns (uint224) { + if (value > type(uint224).max) { + revert SafeCastOverflowedUintDowncast(224, value); + } + return uint224(value); + } + + /** + * @dev Returns the downcasted uint216 from uint256, reverting on + * overflow (when the input is greater than largest uint216). + * + * Counterpart to Solidity's `uint216` operator. + * + * Requirements: + * + * - input must fit into 216 bits + */ + function toUint216(uint256 value) internal pure returns (uint216) { + if (value > type(uint216).max) { + revert SafeCastOverflowedUintDowncast(216, value); + } + return uint216(value); + } + + /** + * @dev Returns the downcasted uint208 from uint256, reverting on + * overflow (when the input is greater than largest uint208). + * + * Counterpart to Solidity's `uint208` operator. + * + * Requirements: + * + * - input must fit into 208 bits + */ + function toUint208(uint256 value) internal pure returns (uint208) { + if (value > type(uint208).max) { + revert SafeCastOverflowedUintDowncast(208, value); + } + return uint208(value); + } + + /** + * @dev Returns the downcasted uint200 from uint256, reverting on + * overflow (when the input is greater than largest uint200). + * + * Counterpart to Solidity's `uint200` operator. + * + * Requirements: + * + * - input must fit into 200 bits + */ + function toUint200(uint256 value) internal pure returns (uint200) { + if (value > type(uint200).max) { + revert SafeCastOverflowedUintDowncast(200, value); + } + return uint200(value); + } + + /** + * @dev Returns the downcasted uint192 from uint256, reverting on + * overflow (when the input is greater than largest uint192). + * + * Counterpart to Solidity's `uint192` operator. + * + * Requirements: + * + * - input must fit into 192 bits + */ + function toUint192(uint256 value) internal pure returns (uint192) { + if (value > type(uint192).max) { + revert SafeCastOverflowedUintDowncast(192, value); + } + return uint192(value); + } + + /** + * @dev Returns the downcasted uint184 from uint256, reverting on + * overflow (when the input is greater than largest uint184). + * + * Counterpart to Solidity's `uint184` operator. + * + * Requirements: + * + * - input must fit into 184 bits + */ + function toUint184(uint256 value) internal pure returns (uint184) { + if (value > type(uint184).max) { + revert SafeCastOverflowedUintDowncast(184, value); + } + return uint184(value); + } + + /** + * @dev Returns the downcasted uint176 from uint256, reverting on + * overflow (when the input is greater than largest uint176). + * + * Counterpart to Solidity's `uint176` operator. + * + * Requirements: + * + * - input must fit into 176 bits + */ + function toUint176(uint256 value) internal pure returns (uint176) { + if (value > type(uint176).max) { + revert SafeCastOverflowedUintDowncast(176, value); + } + return uint176(value); + } + + /** + * @dev Returns the downcasted uint168 from uint256, reverting on + * overflow (when the input is greater than largest uint168). + * + * Counterpart to Solidity's `uint168` operator. + * + * Requirements: + * + * - input must fit into 168 bits + */ + function toUint168(uint256 value) internal pure returns (uint168) { + if (value > type(uint168).max) { + revert SafeCastOverflowedUintDowncast(168, value); + } + return uint168(value); + } + + /** + * @dev Returns the downcasted uint160 from uint256, reverting on + * overflow (when the input is greater than largest uint160). + * + * Counterpart to Solidity's `uint160` operator. + * + * Requirements: + * + * - input must fit into 160 bits + */ + function toUint160(uint256 value) internal pure returns (uint160) { + if (value > type(uint160).max) { + revert SafeCastOverflowedUintDowncast(160, value); + } + return uint160(value); + } + + /** + * @dev Returns the downcasted uint152 from uint256, reverting on + * overflow (when the input is greater than largest uint152). + * + * Counterpart to Solidity's `uint152` operator. + * + * Requirements: + * + * - input must fit into 152 bits + */ + function toUint152(uint256 value) internal pure returns (uint152) { + if (value > type(uint152).max) { + revert SafeCastOverflowedUintDowncast(152, value); + } + return uint152(value); + } + + /** + * @dev Returns the downcasted uint144 from uint256, reverting on + * overflow (when the input is greater than largest uint144). + * + * Counterpart to Solidity's `uint144` operator. + * + * Requirements: + * + * - input must fit into 144 bits + */ + function toUint144(uint256 value) internal pure returns (uint144) { + if (value > type(uint144).max) { + revert SafeCastOverflowedUintDowncast(144, value); + } + return uint144(value); + } + + /** + * @dev Returns the downcasted uint136 from uint256, reverting on + * overflow (when the input is greater than largest uint136). + * + * Counterpart to Solidity's `uint136` operator. + * + * Requirements: + * + * - input must fit into 136 bits + */ + function toUint136(uint256 value) internal pure returns (uint136) { + if (value > type(uint136).max) { + revert SafeCastOverflowedUintDowncast(136, value); + } + return uint136(value); + } + + /** + * @dev Returns the downcasted uint128 from uint256, reverting on + * overflow (when the input is greater than largest uint128). + * + * Counterpart to Solidity's `uint128` operator. + * + * Requirements: + * + * - input must fit into 128 bits + */ + function toUint128(uint256 value) internal pure returns (uint128) { + if (value > type(uint128).max) { + revert SafeCastOverflowedUintDowncast(128, value); + } + return uint128(value); + } + + /** + * @dev Returns the downcasted uint120 from uint256, reverting on + * overflow (when the input is greater than largest uint120). + * + * Counterpart to Solidity's `uint120` operator. + * + * Requirements: + * + * - input must fit into 120 bits + */ + function toUint120(uint256 value) internal pure returns (uint120) { + if (value > type(uint120).max) { + revert SafeCastOverflowedUintDowncast(120, value); + } + return uint120(value); + } + + /** + * @dev Returns the downcasted uint112 from uint256, reverting on + * overflow (when the input is greater than largest uint112). + * + * Counterpart to Solidity's `uint112` operator. + * + * Requirements: + * + * - input must fit into 112 bits + */ + function toUint112(uint256 value) internal pure returns (uint112) { + if (value > type(uint112).max) { + revert SafeCastOverflowedUintDowncast(112, value); + } + return uint112(value); + } + + /** + * @dev Returns the downcasted uint104 from uint256, reverting on + * overflow (when the input is greater than largest uint104). + * + * Counterpart to Solidity's `uint104` operator. + * + * Requirements: + * + * - input must fit into 104 bits + */ + function toUint104(uint256 value) internal pure returns (uint104) { + if (value > type(uint104).max) { + revert SafeCastOverflowedUintDowncast(104, value); + } + return uint104(value); + } + + /** + * @dev Returns the downcasted uint96 from uint256, reverting on + * overflow (when the input is greater than largest uint96). + * + * Counterpart to Solidity's `uint96` operator. + * + * Requirements: + * + * - input must fit into 96 bits + */ + function toUint96(uint256 value) internal pure returns (uint96) { + if (value > type(uint96).max) { + revert SafeCastOverflowedUintDowncast(96, value); + } + return uint96(value); + } + + /** + * @dev Returns the downcasted uint88 from uint256, reverting on + * overflow (when the input is greater than largest uint88). + * + * Counterpart to Solidity's `uint88` operator. + * + * Requirements: + * + * - input must fit into 88 bits + */ + function toUint88(uint256 value) internal pure returns (uint88) { + if (value > type(uint88).max) { + revert SafeCastOverflowedUintDowncast(88, value); + } + return uint88(value); + } + + /** + * @dev Returns the downcasted uint80 from uint256, reverting on + * overflow (when the input is greater than largest uint80). + * + * Counterpart to Solidity's `uint80` operator. + * + * Requirements: + * + * - input must fit into 80 bits + */ + function toUint80(uint256 value) internal pure returns (uint80) { + if (value > type(uint80).max) { + revert SafeCastOverflowedUintDowncast(80, value); + } + return uint80(value); + } + + /** + * @dev Returns the downcasted uint72 from uint256, reverting on + * overflow (when the input is greater than largest uint72). + * + * Counterpart to Solidity's `uint72` operator. + * + * Requirements: + * + * - input must fit into 72 bits + */ + function toUint72(uint256 value) internal pure returns (uint72) { + if (value > type(uint72).max) { + revert SafeCastOverflowedUintDowncast(72, value); + } + return uint72(value); + } + + /** + * @dev Returns the downcasted uint64 from uint256, reverting on + * overflow (when the input is greater than largest uint64). + * + * Counterpart to Solidity's `uint64` operator. + * + * Requirements: + * + * - input must fit into 64 bits + */ + function toUint64(uint256 value) internal pure returns (uint64) { + if (value > type(uint64).max) { + revert SafeCastOverflowedUintDowncast(64, value); + } + return uint64(value); + } + + /** + * @dev Returns the downcasted uint56 from uint256, reverting on + * overflow (when the input is greater than largest uint56). + * + * Counterpart to Solidity's `uint56` operator. + * + * Requirements: + * + * - input must fit into 56 bits + */ + function toUint56(uint256 value) internal pure returns (uint56) { + if (value > type(uint56).max) { + revert SafeCastOverflowedUintDowncast(56, value); + } + return uint56(value); + } + + /** + * @dev Returns the downcasted uint48 from uint256, reverting on + * overflow (when the input is greater than largest uint48). + * + * Counterpart to Solidity's `uint48` operator. + * + * Requirements: + * + * - input must fit into 48 bits + */ + function toUint48(uint256 value) internal pure returns (uint48) { + if (value > type(uint48).max) { + revert SafeCastOverflowedUintDowncast(48, value); + } + return uint48(value); + } + + /** + * @dev Returns the downcasted uint40 from uint256, reverting on + * overflow (when the input is greater than largest uint40). + * + * Counterpart to Solidity's `uint40` operator. + * + * Requirements: + * + * - input must fit into 40 bits + */ + function toUint40(uint256 value) internal pure returns (uint40) { + if (value > type(uint40).max) { + revert SafeCastOverflowedUintDowncast(40, value); + } + return uint40(value); + } + + /** + * @dev Returns the downcasted uint32 from uint256, reverting on + * overflow (when the input is greater than largest uint32). + * + * Counterpart to Solidity's `uint32` operator. + * + * Requirements: + * + * - input must fit into 32 bits + */ + function toUint32(uint256 value) internal pure returns (uint32) { + if (value > type(uint32).max) { + revert SafeCastOverflowedUintDowncast(32, value); + } + return uint32(value); + } + + /** + * @dev Returns the downcasted uint24 from uint256, reverting on + * overflow (when the input is greater than largest uint24). + * + * Counterpart to Solidity's `uint24` operator. + * + * Requirements: + * + * - input must fit into 24 bits + */ + function toUint24(uint256 value) internal pure returns (uint24) { + if (value > type(uint24).max) { + revert SafeCastOverflowedUintDowncast(24, value); + } + return uint24(value); + } + + /** + * @dev Returns the downcasted uint16 from uint256, reverting on + * overflow (when the input is greater than largest uint16). + * + * Counterpart to Solidity's `uint16` operator. + * + * Requirements: + * + * - input must fit into 16 bits + */ + function toUint16(uint256 value) internal pure returns (uint16) { + if (value > type(uint16).max) { + revert SafeCastOverflowedUintDowncast(16, value); + } + return uint16(value); + } + + /** + * @dev Returns the downcasted uint8 from uint256, reverting on + * overflow (when the input is greater than largest uint8). + * + * Counterpart to Solidity's `uint8` operator. + * + * Requirements: + * + * - input must fit into 8 bits + */ + function toUint8(uint256 value) internal pure returns (uint8) { + if (value > type(uint8).max) { + revert SafeCastOverflowedUintDowncast(8, value); + } + return uint8(value); + } + + /** + * @dev Converts a signed int256 into an unsigned uint256. + * + * Requirements: + * + * - input must be greater than or equal to 0. + */ + function toUint256(int256 value) internal pure returns (uint256) { + if (value < 0) { + revert SafeCastOverflowedIntToUint(value); + } + return uint256(value); + } + + /** + * @dev Returns the downcasted int248 from int256, reverting on + * overflow (when the input is less than smallest int248 or + * greater than largest int248). + * + * Counterpart to Solidity's `int248` operator. + * + * Requirements: + * + * - input must fit into 248 bits + */ + function toInt248(int256 value) internal pure returns (int248 downcasted) { + downcasted = int248(value); + if (downcasted != value) { + revert SafeCastOverflowedIntDowncast(248, value); + } + } + + /** + * @dev Returns the downcasted int240 from int256, reverting on + * overflow (when the input is less than smallest int240 or + * greater than largest int240). + * + * Counterpart to Solidity's `int240` operator. + * + * Requirements: + * + * - input must fit into 240 bits + */ + function toInt240(int256 value) internal pure returns (int240 downcasted) { + downcasted = int240(value); + if (downcasted != value) { + revert SafeCastOverflowedIntDowncast(240, value); + } + } + + /** + * @dev Returns the downcasted int232 from int256, reverting on + * overflow (when the input is less than smallest int232 or + * greater than largest int232). + * + * Counterpart to Solidity's `int232` operator. + * + * Requirements: + * + * - input must fit into 232 bits + */ + function toInt232(int256 value) internal pure returns (int232 downcasted) { + downcasted = int232(value); + if (downcasted != value) { + revert SafeCastOverflowedIntDowncast(232, value); + } + } + + /** + * @dev Returns the downcasted int224 from int256, reverting on + * overflow (when the input is less than smallest int224 or + * greater than largest int224). + * + * Counterpart to Solidity's `int224` operator. + * + * Requirements: + * + * - input must fit into 224 bits + */ + function toInt224(int256 value) internal pure returns (int224 downcasted) { + downcasted = int224(value); + if (downcasted != value) { + revert SafeCastOverflowedIntDowncast(224, value); + } + } + + /** + * @dev Returns the downcasted int216 from int256, reverting on + * overflow (when the input is less than smallest int216 or + * greater than largest int216). + * + * Counterpart to Solidity's `int216` operator. + * + * Requirements: + * + * - input must fit into 216 bits + */ + function toInt216(int256 value) internal pure returns (int216 downcasted) { + downcasted = int216(value); + if (downcasted != value) { + revert SafeCastOverflowedIntDowncast(216, value); + } + } + + /** + * @dev Returns the downcasted int208 from int256, reverting on + * overflow (when the input is less than smallest int208 or + * greater than largest int208). + * + * Counterpart to Solidity's `int208` operator. + * + * Requirements: + * + * - input must fit into 208 bits + */ + function toInt208(int256 value) internal pure returns (int208 downcasted) { + downcasted = int208(value); + if (downcasted != value) { + revert SafeCastOverflowedIntDowncast(208, value); + } + } + + /** + * @dev Returns the downcasted int200 from int256, reverting on + * overflow (when the input is less than smallest int200 or + * greater than largest int200). + * + * Counterpart to Solidity's `int200` operator. + * + * Requirements: + * + * - input must fit into 200 bits + */ + function toInt200(int256 value) internal pure returns (int200 downcasted) { + downcasted = int200(value); + if (downcasted != value) { + revert SafeCastOverflowedIntDowncast(200, value); + } + } + + /** + * @dev Returns the downcasted int192 from int256, reverting on + * overflow (when the input is less than smallest int192 or + * greater than largest int192). + * + * Counterpart to Solidity's `int192` operator. + * + * Requirements: + * + * - input must fit into 192 bits + */ + function toInt192(int256 value) internal pure returns (int192 downcasted) { + downcasted = int192(value); + if (downcasted != value) { + revert SafeCastOverflowedIntDowncast(192, value); + } + } + + /** + * @dev Returns the downcasted int184 from int256, reverting on + * overflow (when the input is less than smallest int184 or + * greater than largest int184). + * + * Counterpart to Solidity's `int184` operator. + * + * Requirements: + * + * - input must fit into 184 bits + */ + function toInt184(int256 value) internal pure returns (int184 downcasted) { + downcasted = int184(value); + if (downcasted != value) { + revert SafeCastOverflowedIntDowncast(184, value); + } + } + + /** + * @dev Returns the downcasted int176 from int256, reverting on + * overflow (when the input is less than smallest int176 or + * greater than largest int176). + * + * Counterpart to Solidity's `int176` operator. + * + * Requirements: + * + * - input must fit into 176 bits + */ + function toInt176(int256 value) internal pure returns (int176 downcasted) { + downcasted = int176(value); + if (downcasted != value) { + revert SafeCastOverflowedIntDowncast(176, value); + } + } + + /** + * @dev Returns the downcasted int168 from int256, reverting on + * overflow (when the input is less than smallest int168 or + * greater than largest int168). + * + * Counterpart to Solidity's `int168` operator. + * + * Requirements: + * + * - input must fit into 168 bits + */ + function toInt168(int256 value) internal pure returns (int168 downcasted) { + downcasted = int168(value); + if (downcasted != value) { + revert SafeCastOverflowedIntDowncast(168, value); + } + } + + /** + * @dev Returns the downcasted int160 from int256, reverting on + * overflow (when the input is less than smallest int160 or + * greater than largest int160). + * + * Counterpart to Solidity's `int160` operator. + * + * Requirements: + * + * - input must fit into 160 bits + */ + function toInt160(int256 value) internal pure returns (int160 downcasted) { + downcasted = int160(value); + if (downcasted != value) { + revert SafeCastOverflowedIntDowncast(160, value); + } + } + + /** + * @dev Returns the downcasted int152 from int256, reverting on + * overflow (when the input is less than smallest int152 or + * greater than largest int152). + * + * Counterpart to Solidity's `int152` operator. + * + * Requirements: + * + * - input must fit into 152 bits + */ + function toInt152(int256 value) internal pure returns (int152 downcasted) { + downcasted = int152(value); + if (downcasted != value) { + revert SafeCastOverflowedIntDowncast(152, value); + } + } + + /** + * @dev Returns the downcasted int144 from int256, reverting on + * overflow (when the input is less than smallest int144 or + * greater than largest int144). + * + * Counterpart to Solidity's `int144` operator. + * + * Requirements: + * + * - input must fit into 144 bits + */ + function toInt144(int256 value) internal pure returns (int144 downcasted) { + downcasted = int144(value); + if (downcasted != value) { + revert SafeCastOverflowedIntDowncast(144, value); + } + } + + /** + * @dev Returns the downcasted int136 from int256, reverting on + * overflow (when the input is less than smallest int136 or + * greater than largest int136). + * + * Counterpart to Solidity's `int136` operator. + * + * Requirements: + * + * - input must fit into 136 bits + */ + function toInt136(int256 value) internal pure returns (int136 downcasted) { + downcasted = int136(value); + if (downcasted != value) { + revert SafeCastOverflowedIntDowncast(136, value); + } + } + + /** + * @dev Returns the downcasted int128 from int256, reverting on + * overflow (when the input is less than smallest int128 or + * greater than largest int128). + * + * Counterpart to Solidity's `int128` operator. + * + * Requirements: + * + * - input must fit into 128 bits + */ + function toInt128(int256 value) internal pure returns (int128 downcasted) { + downcasted = int128(value); + if (downcasted != value) { + revert SafeCastOverflowedIntDowncast(128, value); + } + } + + /** + * @dev Returns the downcasted int120 from int256, reverting on + * overflow (when the input is less than smallest int120 or + * greater than largest int120). + * + * Counterpart to Solidity's `int120` operator. + * + * Requirements: + * + * - input must fit into 120 bits + */ + function toInt120(int256 value) internal pure returns (int120 downcasted) { + downcasted = int120(value); + if (downcasted != value) { + revert SafeCastOverflowedIntDowncast(120, value); + } + } + + /** + * @dev Returns the downcasted int112 from int256, reverting on + * overflow (when the input is less than smallest int112 or + * greater than largest int112). + * + * Counterpart to Solidity's `int112` operator. + * + * Requirements: + * + * - input must fit into 112 bits + */ + function toInt112(int256 value) internal pure returns (int112 downcasted) { + downcasted = int112(value); + if (downcasted != value) { + revert SafeCastOverflowedIntDowncast(112, value); + } + } + + /** + * @dev Returns the downcasted int104 from int256, reverting on + * overflow (when the input is less than smallest int104 or + * greater than largest int104). + * + * Counterpart to Solidity's `int104` operator. + * + * Requirements: + * + * - input must fit into 104 bits + */ + function toInt104(int256 value) internal pure returns (int104 downcasted) { + downcasted = int104(value); + if (downcasted != value) { + revert SafeCastOverflowedIntDowncast(104, value); + } + } + + /** + * @dev Returns the downcasted int96 from int256, reverting on + * overflow (when the input is less than smallest int96 or + * greater than largest int96). + * + * Counterpart to Solidity's `int96` operator. + * + * Requirements: + * + * - input must fit into 96 bits + */ + function toInt96(int256 value) internal pure returns (int96 downcasted) { + downcasted = int96(value); + if (downcasted != value) { + revert SafeCastOverflowedIntDowncast(96, value); + } + } + + /** + * @dev Returns the downcasted int88 from int256, reverting on + * overflow (when the input is less than smallest int88 or + * greater than largest int88). + * + * Counterpart to Solidity's `int88` operator. + * + * Requirements: + * + * - input must fit into 88 bits + */ + function toInt88(int256 value) internal pure returns (int88 downcasted) { + downcasted = int88(value); + if (downcasted != value) { + revert SafeCastOverflowedIntDowncast(88, value); + } + } + + /** + * @dev Returns the downcasted int80 from int256, reverting on + * overflow (when the input is less than smallest int80 or + * greater than largest int80). + * + * Counterpart to Solidity's `int80` operator. + * + * Requirements: + * + * - input must fit into 80 bits + */ + function toInt80(int256 value) internal pure returns (int80 downcasted) { + downcasted = int80(value); + if (downcasted != value) { + revert SafeCastOverflowedIntDowncast(80, value); + } + } + + /** + * @dev Returns the downcasted int72 from int256, reverting on + * overflow (when the input is less than smallest int72 or + * greater than largest int72). + * + * Counterpart to Solidity's `int72` operator. + * + * Requirements: + * + * - input must fit into 72 bits + */ + function toInt72(int256 value) internal pure returns (int72 downcasted) { + downcasted = int72(value); + if (downcasted != value) { + revert SafeCastOverflowedIntDowncast(72, value); + } + } + + /** + * @dev Returns the downcasted int64 from int256, reverting on + * overflow (when the input is less than smallest int64 or + * greater than largest int64). + * + * Counterpart to Solidity's `int64` operator. + * + * Requirements: + * + * - input must fit into 64 bits + */ + function toInt64(int256 value) internal pure returns (int64 downcasted) { + downcasted = int64(value); + if (downcasted != value) { + revert SafeCastOverflowedIntDowncast(64, value); + } + } + + /** + * @dev Returns the downcasted int56 from int256, reverting on + * overflow (when the input is less than smallest int56 or + * greater than largest int56). + * + * Counterpart to Solidity's `int56` operator. + * + * Requirements: + * + * - input must fit into 56 bits + */ + function toInt56(int256 value) internal pure returns (int56 downcasted) { + downcasted = int56(value); + if (downcasted != value) { + revert SafeCastOverflowedIntDowncast(56, value); + } + } + + /** + * @dev Returns the downcasted int48 from int256, reverting on + * overflow (when the input is less than smallest int48 or + * greater than largest int48). + * + * Counterpart to Solidity's `int48` operator. + * + * Requirements: + * + * - input must fit into 48 bits + */ + function toInt48(int256 value) internal pure returns (int48 downcasted) { + downcasted = int48(value); + if (downcasted != value) { + revert SafeCastOverflowedIntDowncast(48, value); + } + } + + /** + * @dev Returns the downcasted int40 from int256, reverting on + * overflow (when the input is less than smallest int40 or + * greater than largest int40). + * + * Counterpart to Solidity's `int40` operator. + * + * Requirements: + * + * - input must fit into 40 bits + */ + function toInt40(int256 value) internal pure returns (int40 downcasted) { + downcasted = int40(value); + if (downcasted != value) { + revert SafeCastOverflowedIntDowncast(40, value); + } + } + + /** + * @dev Returns the downcasted int32 from int256, reverting on + * overflow (when the input is less than smallest int32 or + * greater than largest int32). + * + * Counterpart to Solidity's `int32` operator. + * + * Requirements: + * + * - input must fit into 32 bits + */ + function toInt32(int256 value) internal pure returns (int32 downcasted) { + downcasted = int32(value); + if (downcasted != value) { + revert SafeCastOverflowedIntDowncast(32, value); + } + } + + /** + * @dev Returns the downcasted int24 from int256, reverting on + * overflow (when the input is less than smallest int24 or + * greater than largest int24). + * + * Counterpart to Solidity's `int24` operator. + * + * Requirements: + * + * - input must fit into 24 bits + */ + function toInt24(int256 value) internal pure returns (int24 downcasted) { + downcasted = int24(value); + if (downcasted != value) { + revert SafeCastOverflowedIntDowncast(24, value); + } + } + + /** + * @dev Returns the downcasted int16 from int256, reverting on + * overflow (when the input is less than smallest int16 or + * greater than largest int16). + * + * Counterpart to Solidity's `int16` operator. + * + * Requirements: + * + * - input must fit into 16 bits + */ + function toInt16(int256 value) internal pure returns (int16 downcasted) { + downcasted = int16(value); + if (downcasted != value) { + revert SafeCastOverflowedIntDowncast(16, value); + } + } + + /** + * @dev Returns the downcasted int8 from int256, reverting on + * overflow (when the input is less than smallest int8 or + * greater than largest int8). + * + * Counterpart to Solidity's `int8` operator. + * + * Requirements: + * + * - input must fit into 8 bits + */ + function toInt8(int256 value) internal pure returns (int8 downcasted) { + downcasted = int8(value); + if (downcasted != value) { + revert SafeCastOverflowedIntDowncast(8, value); + } + } + + /** + * @dev Converts an unsigned uint256 into a signed int256. + * + * Requirements: + * + * - input must be less than or equal to maxInt256. + */ + function toInt256(uint256 value) internal pure returns (int256) { + // Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive + if (value > uint256(type(int256).max)) { + revert SafeCastOverflowedUintToInt(value); + } + return int256(value); + } +} diff --git a/contracts/src/v0.8/vendor/openzeppelin-solidity/v5.0.2/contracts/utils/math/SignedMath.sol b/contracts/src/v0.8/vendor/openzeppelin-solidity/v5.0.2/contracts/utils/math/SignedMath.sol new file mode 100644 index 00000000000..66a61516292 --- /dev/null +++ b/contracts/src/v0.8/vendor/openzeppelin-solidity/v5.0.2/contracts/utils/math/SignedMath.sol @@ -0,0 +1,43 @@ +// SPDX-License-Identifier: MIT +// OpenZeppelin Contracts (last updated v5.0.0) (utils/math/SignedMath.sol) + +pragma solidity ^0.8.20; + +/** + * @dev Standard signed math utilities missing in the Solidity language. + */ +library SignedMath { + /** + * @dev Returns the largest of two signed numbers. + */ + function max(int256 a, int256 b) internal pure returns (int256) { + return a > b ? a : b; + } + + /** + * @dev Returns the smallest of two signed numbers. + */ + function min(int256 a, int256 b) internal pure returns (int256) { + return a < b ? a : b; + } + + /** + * @dev Returns the average of two signed numbers without overflow. + * The result is rounded towards zero. + */ + function average(int256 a, int256 b) internal pure returns (int256) { + // Formula from the book "Hacker's Delight" + int256 x = (a & b) + ((a ^ b) >> 1); + return x + (int256(uint256(x) >> 255) & (a ^ b)); + } + + /** + * @dev Returns the absolute unsigned value of a signed value. + */ + function abs(int256 n) internal pure returns (uint256) { + unchecked { + // must be unchecked in order to support `n = type(int256).min` + return uint256(n >= 0 ? n : -n); + } + } +} diff --git a/contracts/src/v0.8/vendor/openzeppelin-solidity/v5.0.2/contracts/utils/structs/EnumerableMap.sol b/contracts/src/v0.8/vendor/openzeppelin-solidity/v5.0.2/contracts/utils/structs/EnumerableMap.sol new file mode 100644 index 00000000000..929ae7c536e --- /dev/null +++ b/contracts/src/v0.8/vendor/openzeppelin-solidity/v5.0.2/contracts/utils/structs/EnumerableMap.sol @@ -0,0 +1,533 @@ +// SPDX-License-Identifier: MIT +// OpenZeppelin Contracts (last updated v5.0.0) (utils/structs/EnumerableMap.sol) +// This file was procedurally generated from scripts/generate/templates/EnumerableMap.js. + +pragma solidity ^0.8.20; + +import {EnumerableSet} from "./EnumerableSet.sol"; + +/** + * @dev Library for managing an enumerable variant of Solidity's + * https://solidity.readthedocs.io/en/latest/types.html#mapping-types[`mapping`] + * type. + * + * Maps have the following properties: + * + * - Entries are added, removed, and checked for existence in constant time + * (O(1)). + * - Entries are enumerated in O(n). No guarantees are made on the ordering. + * + * ```solidity + * contract Example { + * // Add the library methods + * using EnumerableMap for EnumerableMap.UintToAddressMap; + * + * // Declare a set state variable + * EnumerableMap.UintToAddressMap private myMap; + * } + * ``` + * + * The following map types are supported: + * + * - `uint256 -> address` (`UintToAddressMap`) since v3.0.0 + * - `address -> uint256` (`AddressToUintMap`) since v4.6.0 + * - `bytes32 -> bytes32` (`Bytes32ToBytes32Map`) since v4.6.0 + * - `uint256 -> uint256` (`UintToUintMap`) since v4.7.0 + * - `bytes32 -> uint256` (`Bytes32ToUintMap`) since v4.7.0 + * + * [WARNING] + * ==== + * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure + * unusable. + * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info. + * + * In order to clean an EnumerableMap, you can either remove all elements one by one or create a fresh instance using an + * array of EnumerableMap. + * ==== + */ +library EnumerableMap { + using EnumerableSet for EnumerableSet.Bytes32Set; + + // To implement this library for multiple types with as little code repetition as possible, we write it in + // terms of a generic Map type with bytes32 keys and values. The Map implementation uses private functions, + // and user-facing implementations such as `UintToAddressMap` are just wrappers around the underlying Map. + // This means that we can only create new EnumerableMaps for types that fit in bytes32. + + /** + * @dev Query for a nonexistent map key. + */ + error EnumerableMapNonexistentKey(bytes32 key); + + struct Bytes32ToBytes32Map { + // Storage of keys + EnumerableSet.Bytes32Set _keys; + mapping(bytes32 key => bytes32) _values; + } + + /** + * @dev Adds a key-value pair to a map, or updates the value for an existing + * key. O(1). + * + * Returns true if the key was added to the map, that is if it was not + * already present. + */ + function set(Bytes32ToBytes32Map storage map, bytes32 key, bytes32 value) internal returns (bool) { + map._values[key] = value; + return map._keys.add(key); + } + + /** + * @dev Removes a key-value pair from a map. O(1). + * + * Returns true if the key was removed from the map, that is if it was present. + */ + function remove(Bytes32ToBytes32Map storage map, bytes32 key) internal returns (bool) { + delete map._values[key]; + return map._keys.remove(key); + } + + /** + * @dev Returns true if the key is in the map. O(1). + */ + function contains(Bytes32ToBytes32Map storage map, bytes32 key) internal view returns (bool) { + return map._keys.contains(key); + } + + /** + * @dev Returns the number of key-value pairs in the map. O(1). + */ + function length(Bytes32ToBytes32Map storage map) internal view returns (uint256) { + return map._keys.length(); + } + + /** + * @dev Returns the key-value pair stored at position `index` in the map. O(1). + * + * Note that there are no guarantees on the ordering of entries inside the + * array, and it may change when more entries are added or removed. + * + * Requirements: + * + * - `index` must be strictly less than {length}. + */ + function at(Bytes32ToBytes32Map storage map, uint256 index) internal view returns (bytes32, bytes32) { + bytes32 key = map._keys.at(index); + return (key, map._values[key]); + } + + /** + * @dev Tries to returns the value associated with `key`. O(1). + * Does not revert if `key` is not in the map. + */ + function tryGet(Bytes32ToBytes32Map storage map, bytes32 key) internal view returns (bool, bytes32) { + bytes32 value = map._values[key]; + if (value == bytes32(0)) { + return (contains(map, key), bytes32(0)); + } else { + return (true, value); + } + } + + /** + * @dev Returns the value associated with `key`. O(1). + * + * Requirements: + * + * - `key` must be in the map. + */ + function get(Bytes32ToBytes32Map storage map, bytes32 key) internal view returns (bytes32) { + bytes32 value = map._values[key]; + if (value == 0 && !contains(map, key)) { + revert EnumerableMapNonexistentKey(key); + } + return value; + } + + /** + * @dev Return the an array containing all the keys + * + * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed + * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that + * this function has an unbounded cost, and using it as part of a state-changing function may render the function + * uncallable if the map grows to a point where copying to memory consumes too much gas to fit in a block. + */ + function keys(Bytes32ToBytes32Map storage map) internal view returns (bytes32[] memory) { + return map._keys.values(); + } + + // UintToUintMap + + struct UintToUintMap { + Bytes32ToBytes32Map _inner; + } + + /** + * @dev Adds a key-value pair to a map, or updates the value for an existing + * key. O(1). + * + * Returns true if the key was added to the map, that is if it was not + * already present. + */ + function set(UintToUintMap storage map, uint256 key, uint256 value) internal returns (bool) { + return set(map._inner, bytes32(key), bytes32(value)); + } + + /** + * @dev Removes a value from a map. O(1). + * + * Returns true if the key was removed from the map, that is if it was present. + */ + function remove(UintToUintMap storage map, uint256 key) internal returns (bool) { + return remove(map._inner, bytes32(key)); + } + + /** + * @dev Returns true if the key is in the map. O(1). + */ + function contains(UintToUintMap storage map, uint256 key) internal view returns (bool) { + return contains(map._inner, bytes32(key)); + } + + /** + * @dev Returns the number of elements in the map. O(1). + */ + function length(UintToUintMap storage map) internal view returns (uint256) { + return length(map._inner); + } + + /** + * @dev Returns the element stored at position `index` in the map. O(1). + * Note that there are no guarantees on the ordering of values inside the + * array, and it may change when more values are added or removed. + * + * Requirements: + * + * - `index` must be strictly less than {length}. + */ + function at(UintToUintMap storage map, uint256 index) internal view returns (uint256, uint256) { + (bytes32 key, bytes32 value) = at(map._inner, index); + return (uint256(key), uint256(value)); + } + + /** + * @dev Tries to returns the value associated with `key`. O(1). + * Does not revert if `key` is not in the map. + */ + function tryGet(UintToUintMap storage map, uint256 key) internal view returns (bool, uint256) { + (bool success, bytes32 value) = tryGet(map._inner, bytes32(key)); + return (success, uint256(value)); + } + + /** + * @dev Returns the value associated with `key`. O(1). + * + * Requirements: + * + * - `key` must be in the map. + */ + function get(UintToUintMap storage map, uint256 key) internal view returns (uint256) { + return uint256(get(map._inner, bytes32(key))); + } + + /** + * @dev Return the an array containing all the keys + * + * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed + * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that + * this function has an unbounded cost, and using it as part of a state-changing function may render the function + * uncallable if the map grows to a point where copying to memory consumes too much gas to fit in a block. + */ + function keys(UintToUintMap storage map) internal view returns (uint256[] memory) { + bytes32[] memory store = keys(map._inner); + uint256[] memory result; + + /// @solidity memory-safe-assembly + assembly { + result := store + } + + return result; + } + + // UintToAddressMap + + struct UintToAddressMap { + Bytes32ToBytes32Map _inner; + } + + /** + * @dev Adds a key-value pair to a map, or updates the value for an existing + * key. O(1). + * + * Returns true if the key was added to the map, that is if it was not + * already present. + */ + function set(UintToAddressMap storage map, uint256 key, address value) internal returns (bool) { + return set(map._inner, bytes32(key), bytes32(uint256(uint160(value)))); + } + + /** + * @dev Removes a value from a map. O(1). + * + * Returns true if the key was removed from the map, that is if it was present. + */ + function remove(UintToAddressMap storage map, uint256 key) internal returns (bool) { + return remove(map._inner, bytes32(key)); + } + + /** + * @dev Returns true if the key is in the map. O(1). + */ + function contains(UintToAddressMap storage map, uint256 key) internal view returns (bool) { + return contains(map._inner, bytes32(key)); + } + + /** + * @dev Returns the number of elements in the map. O(1). + */ + function length(UintToAddressMap storage map) internal view returns (uint256) { + return length(map._inner); + } + + /** + * @dev Returns the element stored at position `index` in the map. O(1). + * Note that there are no guarantees on the ordering of values inside the + * array, and it may change when more values are added or removed. + * + * Requirements: + * + * - `index` must be strictly less than {length}. + */ + function at(UintToAddressMap storage map, uint256 index) internal view returns (uint256, address) { + (bytes32 key, bytes32 value) = at(map._inner, index); + return (uint256(key), address(uint160(uint256(value)))); + } + + /** + * @dev Tries to returns the value associated with `key`. O(1). + * Does not revert if `key` is not in the map. + */ + function tryGet(UintToAddressMap storage map, uint256 key) internal view returns (bool, address) { + (bool success, bytes32 value) = tryGet(map._inner, bytes32(key)); + return (success, address(uint160(uint256(value)))); + } + + /** + * @dev Returns the value associated with `key`. O(1). + * + * Requirements: + * + * - `key` must be in the map. + */ + function get(UintToAddressMap storage map, uint256 key) internal view returns (address) { + return address(uint160(uint256(get(map._inner, bytes32(key))))); + } + + /** + * @dev Return the an array containing all the keys + * + * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed + * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that + * this function has an unbounded cost, and using it as part of a state-changing function may render the function + * uncallable if the map grows to a point where copying to memory consumes too much gas to fit in a block. + */ + function keys(UintToAddressMap storage map) internal view returns (uint256[] memory) { + bytes32[] memory store = keys(map._inner); + uint256[] memory result; + + /// @solidity memory-safe-assembly + assembly { + result := store + } + + return result; + } + + // AddressToUintMap + + struct AddressToUintMap { + Bytes32ToBytes32Map _inner; + } + + /** + * @dev Adds a key-value pair to a map, or updates the value for an existing + * key. O(1). + * + * Returns true if the key was added to the map, that is if it was not + * already present. + */ + function set(AddressToUintMap storage map, address key, uint256 value) internal returns (bool) { + return set(map._inner, bytes32(uint256(uint160(key))), bytes32(value)); + } + + /** + * @dev Removes a value from a map. O(1). + * + * Returns true if the key was removed from the map, that is if it was present. + */ + function remove(AddressToUintMap storage map, address key) internal returns (bool) { + return remove(map._inner, bytes32(uint256(uint160(key)))); + } + + /** + * @dev Returns true if the key is in the map. O(1). + */ + function contains(AddressToUintMap storage map, address key) internal view returns (bool) { + return contains(map._inner, bytes32(uint256(uint160(key)))); + } + + /** + * @dev Returns the number of elements in the map. O(1). + */ + function length(AddressToUintMap storage map) internal view returns (uint256) { + return length(map._inner); + } + + /** + * @dev Returns the element stored at position `index` in the map. O(1). + * Note that there are no guarantees on the ordering of values inside the + * array, and it may change when more values are added or removed. + * + * Requirements: + * + * - `index` must be strictly less than {length}. + */ + function at(AddressToUintMap storage map, uint256 index) internal view returns (address, uint256) { + (bytes32 key, bytes32 value) = at(map._inner, index); + return (address(uint160(uint256(key))), uint256(value)); + } + + /** + * @dev Tries to returns the value associated with `key`. O(1). + * Does not revert if `key` is not in the map. + */ + function tryGet(AddressToUintMap storage map, address key) internal view returns (bool, uint256) { + (bool success, bytes32 value) = tryGet(map._inner, bytes32(uint256(uint160(key)))); + return (success, uint256(value)); + } + + /** + * @dev Returns the value associated with `key`. O(1). + * + * Requirements: + * + * - `key` must be in the map. + */ + function get(AddressToUintMap storage map, address key) internal view returns (uint256) { + return uint256(get(map._inner, bytes32(uint256(uint160(key))))); + } + + /** + * @dev Return the an array containing all the keys + * + * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed + * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that + * this function has an unbounded cost, and using it as part of a state-changing function may render the function + * uncallable if the map grows to a point where copying to memory consumes too much gas to fit in a block. + */ + function keys(AddressToUintMap storage map) internal view returns (address[] memory) { + bytes32[] memory store = keys(map._inner); + address[] memory result; + + /// @solidity memory-safe-assembly + assembly { + result := store + } + + return result; + } + + // Bytes32ToUintMap + + struct Bytes32ToUintMap { + Bytes32ToBytes32Map _inner; + } + + /** + * @dev Adds a key-value pair to a map, or updates the value for an existing + * key. O(1). + * + * Returns true if the key was added to the map, that is if it was not + * already present. + */ + function set(Bytes32ToUintMap storage map, bytes32 key, uint256 value) internal returns (bool) { + return set(map._inner, key, bytes32(value)); + } + + /** + * @dev Removes a value from a map. O(1). + * + * Returns true if the key was removed from the map, that is if it was present. + */ + function remove(Bytes32ToUintMap storage map, bytes32 key) internal returns (bool) { + return remove(map._inner, key); + } + + /** + * @dev Returns true if the key is in the map. O(1). + */ + function contains(Bytes32ToUintMap storage map, bytes32 key) internal view returns (bool) { + return contains(map._inner, key); + } + + /** + * @dev Returns the number of elements in the map. O(1). + */ + function length(Bytes32ToUintMap storage map) internal view returns (uint256) { + return length(map._inner); + } + + /** + * @dev Returns the element stored at position `index` in the map. O(1). + * Note that there are no guarantees on the ordering of values inside the + * array, and it may change when more values are added or removed. + * + * Requirements: + * + * - `index` must be strictly less than {length}. + */ + function at(Bytes32ToUintMap storage map, uint256 index) internal view returns (bytes32, uint256) { + (bytes32 key, bytes32 value) = at(map._inner, index); + return (key, uint256(value)); + } + + /** + * @dev Tries to returns the value associated with `key`. O(1). + * Does not revert if `key` is not in the map. + */ + function tryGet(Bytes32ToUintMap storage map, bytes32 key) internal view returns (bool, uint256) { + (bool success, bytes32 value) = tryGet(map._inner, key); + return (success, uint256(value)); + } + + /** + * @dev Returns the value associated with `key`. O(1). + * + * Requirements: + * + * - `key` must be in the map. + */ + function get(Bytes32ToUintMap storage map, bytes32 key) internal view returns (uint256) { + return uint256(get(map._inner, key)); + } + + /** + * @dev Return the an array containing all the keys + * + * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed + * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that + * this function has an unbounded cost, and using it as part of a state-changing function may render the function + * uncallable if the map grows to a point where copying to memory consumes too much gas to fit in a block. + */ + function keys(Bytes32ToUintMap storage map) internal view returns (bytes32[] memory) { + bytes32[] memory store = keys(map._inner); + bytes32[] memory result; + + /// @solidity memory-safe-assembly + assembly { + result := store + } + + return result; + } +} diff --git a/contracts/src/v0.8/vendor/openzeppelin-solidity/v5.0.2/contracts/utils/structs/EnumerableSet.sol b/contracts/src/v0.8/vendor/openzeppelin-solidity/v5.0.2/contracts/utils/structs/EnumerableSet.sol new file mode 100644 index 00000000000..4c7fc5e1d76 --- /dev/null +++ b/contracts/src/v0.8/vendor/openzeppelin-solidity/v5.0.2/contracts/utils/structs/EnumerableSet.sol @@ -0,0 +1,378 @@ +// SPDX-License-Identifier: MIT +// OpenZeppelin Contracts (last updated v5.0.0) (utils/structs/EnumerableSet.sol) +// This file was procedurally generated from scripts/generate/templates/EnumerableSet.js. + +pragma solidity ^0.8.20; + +/** + * @dev Library for managing + * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive + * types. + * + * Sets have the following properties: + * + * - Elements are added, removed, and checked for existence in constant time + * (O(1)). + * - Elements are enumerated in O(n). No guarantees are made on the ordering. + * + * ```solidity + * contract Example { + * // Add the library methods + * using EnumerableSet for EnumerableSet.AddressSet; + * + * // Declare a set state variable + * EnumerableSet.AddressSet private mySet; + * } + * ``` + * + * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`) + * and `uint256` (`UintSet`) are supported. + * + * [WARNING] + * ==== + * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure + * unusable. + * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info. + * + * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an + * array of EnumerableSet. + * ==== + */ +library EnumerableSet { + // To implement this library for multiple types with as little code + // repetition as possible, we write it in terms of a generic Set type with + // bytes32 values. + // The Set implementation uses private functions, and user-facing + // implementations (such as AddressSet) are just wrappers around the + // underlying Set. + // This means that we can only create new EnumerableSets for types that fit + // in bytes32. + + struct Set { + // Storage of set values + bytes32[] _values; + // Position is the index of the value in the `values` array plus 1. + // Position 0 is used to mean a value is not in the set. + mapping(bytes32 value => uint256) _positions; + } + + /** + * @dev Add a value to a set. O(1). + * + * Returns true if the value was added to the set, that is if it was not + * already present. + */ + function _add(Set storage set, bytes32 value) private returns (bool) { + if (!_contains(set, value)) { + set._values.push(value); + // The value is stored at length-1, but we add 1 to all indexes + // and use 0 as a sentinel value + set._positions[value] = set._values.length; + return true; + } else { + return false; + } + } + + /** + * @dev Removes a value from a set. O(1). + * + * Returns true if the value was removed from the set, that is if it was + * present. + */ + function _remove(Set storage set, bytes32 value) private returns (bool) { + // We cache the value's position to prevent multiple reads from the same storage slot + uint256 position = set._positions[value]; + + if (position != 0) { + // Equivalent to contains(set, value) + // To delete an element from the _values array in O(1), we swap the element to delete with the last one in + // the array, and then remove the last element (sometimes called as 'swap and pop'). + // This modifies the order of the array, as noted in {at}. + + uint256 valueIndex = position - 1; + uint256 lastIndex = set._values.length - 1; + + if (valueIndex != lastIndex) { + bytes32 lastValue = set._values[lastIndex]; + + // Move the lastValue to the index where the value to delete is + set._values[valueIndex] = lastValue; + // Update the tracked position of the lastValue (that was just moved) + set._positions[lastValue] = position; + } + + // Delete the slot where the moved value was stored + set._values.pop(); + + // Delete the tracked position for the deleted slot + delete set._positions[value]; + + return true; + } else { + return false; + } + } + + /** + * @dev Returns true if the value is in the set. O(1). + */ + function _contains(Set storage set, bytes32 value) private view returns (bool) { + return set._positions[value] != 0; + } + + /** + * @dev Returns the number of values on the set. O(1). + */ + function _length(Set storage set) private view returns (uint256) { + return set._values.length; + } + + /** + * @dev Returns the value stored at position `index` in the set. O(1). + * + * Note that there are no guarantees on the ordering of values inside the + * array, and it may change when more values are added or removed. + * + * Requirements: + * + * - `index` must be strictly less than {length}. + */ + function _at(Set storage set, uint256 index) private view returns (bytes32) { + return set._values[index]; + } + + /** + * @dev Return the entire set in an array + * + * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed + * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that + * this function has an unbounded cost, and using it as part of a state-changing function may render the function + * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. + */ + function _values(Set storage set) private view returns (bytes32[] memory) { + return set._values; + } + + // Bytes32Set + + struct Bytes32Set { + Set _inner; + } + + /** + * @dev Add a value to a set. O(1). + * + * Returns true if the value was added to the set, that is if it was not + * already present. + */ + function add(Bytes32Set storage set, bytes32 value) internal returns (bool) { + return _add(set._inner, value); + } + + /** + * @dev Removes a value from a set. O(1). + * + * Returns true if the value was removed from the set, that is if it was + * present. + */ + function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) { + return _remove(set._inner, value); + } + + /** + * @dev Returns true if the value is in the set. O(1). + */ + function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) { + return _contains(set._inner, value); + } + + /** + * @dev Returns the number of values in the set. O(1). + */ + function length(Bytes32Set storage set) internal view returns (uint256) { + return _length(set._inner); + } + + /** + * @dev Returns the value stored at position `index` in the set. O(1). + * + * Note that there are no guarantees on the ordering of values inside the + * array, and it may change when more values are added or removed. + * + * Requirements: + * + * - `index` must be strictly less than {length}. + */ + function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) { + return _at(set._inner, index); + } + + /** + * @dev Return the entire set in an array + * + * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed + * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that + * this function has an unbounded cost, and using it as part of a state-changing function may render the function + * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. + */ + function values(Bytes32Set storage set) internal view returns (bytes32[] memory) { + bytes32[] memory store = _values(set._inner); + bytes32[] memory result; + + /// @solidity memory-safe-assembly + assembly { + result := store + } + + return result; + } + + // AddressSet + + struct AddressSet { + Set _inner; + } + + /** + * @dev Add a value to a set. O(1). + * + * Returns true if the value was added to the set, that is if it was not + * already present. + */ + function add(AddressSet storage set, address value) internal returns (bool) { + return _add(set._inner, bytes32(uint256(uint160(value)))); + } + + /** + * @dev Removes a value from a set. O(1). + * + * Returns true if the value was removed from the set, that is if it was + * present. + */ + function remove(AddressSet storage set, address value) internal returns (bool) { + return _remove(set._inner, bytes32(uint256(uint160(value)))); + } + + /** + * @dev Returns true if the value is in the set. O(1). + */ + function contains(AddressSet storage set, address value) internal view returns (bool) { + return _contains(set._inner, bytes32(uint256(uint160(value)))); + } + + /** + * @dev Returns the number of values in the set. O(1). + */ + function length(AddressSet storage set) internal view returns (uint256) { + return _length(set._inner); + } + + /** + * @dev Returns the value stored at position `index` in the set. O(1). + * + * Note that there are no guarantees on the ordering of values inside the + * array, and it may change when more values are added or removed. + * + * Requirements: + * + * - `index` must be strictly less than {length}. + */ + function at(AddressSet storage set, uint256 index) internal view returns (address) { + return address(uint160(uint256(_at(set._inner, index)))); + } + + /** + * @dev Return the entire set in an array + * + * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed + * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that + * this function has an unbounded cost, and using it as part of a state-changing function may render the function + * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. + */ + function values(AddressSet storage set) internal view returns (address[] memory) { + bytes32[] memory store = _values(set._inner); + address[] memory result; + + /// @solidity memory-safe-assembly + assembly { + result := store + } + + return result; + } + + // UintSet + + struct UintSet { + Set _inner; + } + + /** + * @dev Add a value to a set. O(1). + * + * Returns true if the value was added to the set, that is if it was not + * already present. + */ + function add(UintSet storage set, uint256 value) internal returns (bool) { + return _add(set._inner, bytes32(value)); + } + + /** + * @dev Removes a value from a set. O(1). + * + * Returns true if the value was removed from the set, that is if it was + * present. + */ + function remove(UintSet storage set, uint256 value) internal returns (bool) { + return _remove(set._inner, bytes32(value)); + } + + /** + * @dev Returns true if the value is in the set. O(1). + */ + function contains(UintSet storage set, uint256 value) internal view returns (bool) { + return _contains(set._inner, bytes32(value)); + } + + /** + * @dev Returns the number of values in the set. O(1). + */ + function length(UintSet storage set) internal view returns (uint256) { + return _length(set._inner); + } + + /** + * @dev Returns the value stored at position `index` in the set. O(1). + * + * Note that there are no guarantees on the ordering of values inside the + * array, and it may change when more values are added or removed. + * + * Requirements: + * + * - `index` must be strictly less than {length}. + */ + function at(UintSet storage set, uint256 index) internal view returns (uint256) { + return uint256(_at(set._inner, index)); + } + + /** + * @dev Return the entire set in an array + * + * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed + * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that + * this function has an unbounded cost, and using it as part of a state-changing function may render the function + * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. + */ + function values(UintSet storage set) internal view returns (uint256[] memory) { + bytes32[] memory store = _values(set._inner); + uint256[] memory result; + + /// @solidity memory-safe-assembly + assembly { + result := store + } + + return result; + } +} diff --git a/contracts/src/v0.8/vrf/dev/testhelpers/VRFCoordinatorTestV2_5.sol b/contracts/src/v0.8/vrf/dev/testhelpers/VRFCoordinatorTestV2_5.sol new file mode 100644 index 00000000000..2e9c4a2da75 --- /dev/null +++ b/contracts/src/v0.8/vrf/dev/testhelpers/VRFCoordinatorTestV2_5.sol @@ -0,0 +1,773 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.19; + +import {BlockhashStoreInterface} from "../../interfaces/BlockhashStoreInterface.sol"; +import {VRFOld} from "./VRFOld.sol"; +import {VRFTypes} from "../../VRFTypes.sol"; +import {VRFConsumerBaseV2Plus, IVRFMigratableConsumerV2Plus} from "../VRFConsumerBaseV2Plus.sol"; +import {ChainSpecificUtil} from "../../../ChainSpecificUtil.sol"; +import {SubscriptionAPI} from "../SubscriptionAPI.sol"; +import {VRFV2PlusClient} from "../libraries/VRFV2PlusClient.sol"; +import {IVRFCoordinatorV2PlusMigration} from "../interfaces/IVRFCoordinatorV2PlusMigration.sol"; +// solhint-disable-next-line no-unused-import +import {IVRFCoordinatorV2Plus, IVRFSubscriptionV2Plus} from "../interfaces/IVRFCoordinatorV2Plus.sol"; + +// solhint-disable-next-line contract-name-camelcase +contract VRFCoordinatorTestV2_5 is VRFOld, SubscriptionAPI, IVRFCoordinatorV2Plus { + /// @dev should always be available + // solhint-disable-next-line chainlink-solidity/prefix-immutable-variables-with-i + BlockhashStoreInterface public immutable BLOCKHASH_STORE; + + // Set this maximum to 200 to give us a 56 block window to fulfill + // the request before requiring the block hash feeder. + uint16 public constant MAX_REQUEST_CONFIRMATIONS = 200; + uint32 public constant MAX_NUM_WORDS = 500; + // 5k is plenty for an EXTCODESIZE call (2600) + warm CALL (100) + // and some arithmetic operations. + uint256 private constant GAS_FOR_CALL_EXACT_CHECK = 5_000; + // upper bound limit for premium percentages to make sure fee calculations don't overflow + uint8 private constant PREMIUM_PERCENTAGE_MAX = 155; + error InvalidRequestConfirmations(uint16 have, uint16 min, uint16 max); + error GasLimitTooBig(uint32 have, uint32 want); + error NumWordsTooBig(uint32 have, uint32 want); + error MsgDataTooBig(uint256 have, uint32 max); + error ProvingKeyAlreadyRegistered(bytes32 keyHash); + error NoSuchProvingKey(bytes32 keyHash); + error InvalidLinkWeiPrice(int256 linkWei); + error LinkDiscountTooHigh(uint32 flatFeeLinkDiscountPPM, uint32 flatFeeNativePPM); + error InvalidPremiumPercentage(uint8 premiumPercentage, uint8 max); + error NoCorrespondingRequest(); + error IncorrectCommitment(); + error BlockhashNotInStore(uint256 blockNum); + error PaymentTooLarge(); + error InvalidExtraArgsTag(); + error GasPriceExceeded(uint256 gasPrice, uint256 maxGas); + + struct ProvingKey { + bool exists; // proving key exists + uint64 maxGas; // gas lane max gas price for fulfilling requests + } + + mapping(bytes32 => ProvingKey) /* keyHash */ /* provingKey */ public s_provingKeys; + bytes32[] public s_provingKeyHashes; + mapping(uint256 => bytes32) /* requestID */ /* commitment */ public s_requestCommitments; + event ProvingKeyRegistered(bytes32 keyHash, uint64 maxGas); + event ProvingKeyDeregistered(bytes32 keyHash, uint64 maxGas); + + event RandomWordsRequested( + bytes32 indexed keyHash, + uint256 requestId, + uint256 preSeed, + uint256 indexed subId, + uint16 minimumRequestConfirmations, + uint32 callbackGasLimit, + uint32 numWords, + bytes extraArgs, + address indexed sender + ); + + event RandomWordsFulfilled( + uint256 indexed requestId, + uint256 outputSeed, + uint256 indexed subId, + uint96 payment, + bool nativePayment, + bool success, + bool onlyPremium + ); + + int256 public s_fallbackWeiPerUnitLink; + + event ConfigSet( + uint16 minimumRequestConfirmations, + uint32 maxGasLimit, + uint32 stalenessSeconds, + uint32 gasAfterPaymentCalculation, + int256 fallbackWeiPerUnitLink, + uint32 fulfillmentFlatFeeNativePPM, + uint32 fulfillmentFlatFeeLinkDiscountPPM, + uint8 nativePremiumPercentage, + uint8 linkPremiumPercentage + ); + + event FallbackWeiPerUnitLinkUsed(uint256 requestId, int256 fallbackWeiPerUnitLink); + + constructor(address blockhashStore) SubscriptionAPI() { + BLOCKHASH_STORE = BlockhashStoreInterface(blockhashStore); + } + + /** + * @notice Registers a proving key to. + * @param publicProvingKey key that oracle can use to submit vrf fulfillments + */ + function registerProvingKey(uint256[2] calldata publicProvingKey, uint64 maxGas) external onlyOwner { + bytes32 kh = hashOfKey(publicProvingKey); + if (s_provingKeys[kh].exists) { + revert ProvingKeyAlreadyRegistered(kh); + } + s_provingKeys[kh] = ProvingKey({exists: true, maxGas: maxGas}); + s_provingKeyHashes.push(kh); + emit ProvingKeyRegistered(kh, maxGas); + } + + /** + * @notice Deregisters a proving key. + * @param publicProvingKey key that oracle can use to submit vrf fulfillments + */ + function deregisterProvingKey(uint256[2] calldata publicProvingKey) external onlyOwner { + bytes32 kh = hashOfKey(publicProvingKey); + ProvingKey memory key = s_provingKeys[kh]; + if (!key.exists) { + revert NoSuchProvingKey(kh); + } + delete s_provingKeys[kh]; + uint256 s_provingKeyHashesLength = s_provingKeyHashes.length; + for (uint256 i = 0; i < s_provingKeyHashesLength; ++i) { + if (s_provingKeyHashes[i] == kh) { + // Copy last element and overwrite kh to be deleted with it + s_provingKeyHashes[i] = s_provingKeyHashes[s_provingKeyHashesLength - 1]; + s_provingKeyHashes.pop(); + break; + } + } + emit ProvingKeyDeregistered(kh, key.maxGas); + } + + /** + * @notice Returns the proving key hash key associated with this public key + * @param publicKey the key to return the hash of + */ + function hashOfKey(uint256[2] memory publicKey) public pure returns (bytes32) { + return keccak256(abi.encode(publicKey)); + } + + /** + * @notice Sets the configuration of the vrfv2 coordinator + * @param minimumRequestConfirmations global min for request confirmations + * @param maxGasLimit global max for request gas limit + * @param stalenessSeconds if the native/link feed is more stale then this, use the fallback price + * @param gasAfterPaymentCalculation gas used in doing accounting after completing the gas measurement + * @param fallbackWeiPerUnitLink fallback native/link price in the case of a stale feed + * @param fulfillmentFlatFeeNativePPM flat fee in native for native payment + * @param fulfillmentFlatFeeLinkDiscountPPM flat fee discount for link payment in native + * @param nativePremiumPercentage native premium percentage + * @param linkPremiumPercentage link premium percentage + */ + function setConfig( + uint16 minimumRequestConfirmations, + uint32 maxGasLimit, + uint32 stalenessSeconds, + uint32 gasAfterPaymentCalculation, + int256 fallbackWeiPerUnitLink, + uint32 fulfillmentFlatFeeNativePPM, + uint32 fulfillmentFlatFeeLinkDiscountPPM, + uint8 nativePremiumPercentage, + uint8 linkPremiumPercentage + ) external onlyOwner { + if (minimumRequestConfirmations > MAX_REQUEST_CONFIRMATIONS) { + revert InvalidRequestConfirmations( + minimumRequestConfirmations, + minimumRequestConfirmations, + MAX_REQUEST_CONFIRMATIONS + ); + } + if (fallbackWeiPerUnitLink <= 0) { + revert InvalidLinkWeiPrice(fallbackWeiPerUnitLink); + } + if (fulfillmentFlatFeeLinkDiscountPPM > fulfillmentFlatFeeNativePPM) { + revert LinkDiscountTooHigh(fulfillmentFlatFeeLinkDiscountPPM, fulfillmentFlatFeeNativePPM); + } + if (nativePremiumPercentage > PREMIUM_PERCENTAGE_MAX) { + revert InvalidPremiumPercentage(nativePremiumPercentage, PREMIUM_PERCENTAGE_MAX); + } + if (linkPremiumPercentage > PREMIUM_PERCENTAGE_MAX) { + revert InvalidPremiumPercentage(linkPremiumPercentage, PREMIUM_PERCENTAGE_MAX); + } + s_config = Config({ + minimumRequestConfirmations: minimumRequestConfirmations, + maxGasLimit: maxGasLimit, + stalenessSeconds: stalenessSeconds, + gasAfterPaymentCalculation: gasAfterPaymentCalculation, + reentrancyLock: false, + fulfillmentFlatFeeNativePPM: fulfillmentFlatFeeNativePPM, + fulfillmentFlatFeeLinkDiscountPPM: fulfillmentFlatFeeLinkDiscountPPM, + nativePremiumPercentage: nativePremiumPercentage, + linkPremiumPercentage: linkPremiumPercentage + }); + s_fallbackWeiPerUnitLink = fallbackWeiPerUnitLink; + emit ConfigSet( + minimumRequestConfirmations, + maxGasLimit, + stalenessSeconds, + gasAfterPaymentCalculation, + fallbackWeiPerUnitLink, + fulfillmentFlatFeeNativePPM, + fulfillmentFlatFeeLinkDiscountPPM, + nativePremiumPercentage, + linkPremiumPercentage + ); + } + + /// @dev Convert the extra args bytes into a struct + /// @param extraArgs The extra args bytes + /// @return The extra args struct + function _fromBytes(bytes calldata extraArgs) internal pure returns (VRFV2PlusClient.ExtraArgsV1 memory) { + if (extraArgs.length == 0) { + return VRFV2PlusClient.ExtraArgsV1({nativePayment: false}); + } + if (bytes4(extraArgs) != VRFV2PlusClient.EXTRA_ARGS_V1_TAG) revert InvalidExtraArgsTag(); + return abi.decode(extraArgs[4:], (VRFV2PlusClient.ExtraArgsV1)); + } + + /** + * @notice Request a set of random words. + * @param req - a struct containing following fiels for randomness request: + * keyHash - Corresponds to a particular oracle job which uses + * that key for generating the VRF proof. Different keyHash's have different gas price + * ceilings, so you can select a specific one to bound your maximum per request cost. + * subId - The ID of the VRF subscription. Must be funded + * with the minimum subscription balance required for the selected keyHash. + * requestConfirmations - How many blocks you'd like the + * oracle to wait before responding to the request. See SECURITY CONSIDERATIONS + * for why you may want to request more. The acceptable range is + * [minimumRequestBlockConfirmations, 200]. + * callbackGasLimit - How much gas you'd like to receive in your + * fulfillRandomWords callback. Note that gasleft() inside fulfillRandomWords + * may be slightly less than this amount because of gas used calling the function + * (argument decoding etc.), so you may need to request slightly more than you expect + * to have inside fulfillRandomWords. The acceptable range is + * [0, maxGasLimit] + * numWords - The number of uint256 random values you'd like to receive + * in your fulfillRandomWords callback. Note these numbers are expanded in a + * secure way by the VRFCoordinator from a single random value supplied by the oracle. + * extraArgs - Encoded extra arguments that has a boolean flag for whether payment + * should be made in native or LINK. Payment in LINK is only available if the LINK token is available to this contract. + * @return requestId - A unique identifier of the request. Can be used to match + * a request to a response in fulfillRandomWords. + */ + function requestRandomWords( + VRFV2PlusClient.RandomWordsRequest calldata req + ) external override nonReentrant returns (uint256 requestId) { + // Input validation using the subscription storage. + uint256 subId = req.subId; + if (s_subscriptionConfigs[subId].owner == address(0)) { + revert InvalidSubscription(); + } + // Its important to ensure that the consumer is in fact who they say they + // are, otherwise they could use someone else's subscription balance. + mapping(uint256 => ConsumerConfig) storage consumerConfigs = s_consumers[msg.sender]; + ConsumerConfig memory consumerConfig = consumerConfigs[subId]; + if (!consumerConfig.active) { + revert InvalidConsumer(subId, msg.sender); + } + // Input validation using the config storage word. + if ( + req.requestConfirmations < s_config.minimumRequestConfirmations || + req.requestConfirmations > MAX_REQUEST_CONFIRMATIONS + ) { + revert InvalidRequestConfirmations( + req.requestConfirmations, + s_config.minimumRequestConfirmations, + MAX_REQUEST_CONFIRMATIONS + ); + } + // No lower bound on the requested gas limit. A user could request 0 + // and they would simply be billed for the proof verification and wouldn't be + // able to do anything with the random value. + if (req.callbackGasLimit > s_config.maxGasLimit) { + revert GasLimitTooBig(req.callbackGasLimit, s_config.maxGasLimit); + } + if (req.numWords > MAX_NUM_WORDS) { + revert NumWordsTooBig(req.numWords, MAX_NUM_WORDS); + } + + // Note we do not check whether the keyHash is valid to save gas. + // The consequence for users is that they can send requests + // for invalid keyHashes which will simply not be fulfilled. + ++consumerConfig.nonce; + ++consumerConfig.pendingReqCount; + uint256 preSeed; + (requestId, preSeed) = _computeRequestId(req.keyHash, msg.sender, subId, consumerConfig.nonce); + + bytes memory extraArgsBytes = VRFV2PlusClient._argsToBytes(_fromBytes(req.extraArgs)); + s_requestCommitments[requestId] = keccak256( + abi.encode( + requestId, + ChainSpecificUtil._getBlockNumber(), + subId, + req.callbackGasLimit, + req.numWords, + msg.sender, + extraArgsBytes + ) + ); + emit RandomWordsRequested( + req.keyHash, + requestId, + preSeed, + subId, + req.requestConfirmations, + req.callbackGasLimit, + req.numWords, + extraArgsBytes, + msg.sender + ); + consumerConfigs[subId] = consumerConfig; + + return requestId; + } + + function _computeRequestId( + bytes32 keyHash, + address sender, + uint256 subId, + uint64 nonce + ) internal pure returns (uint256, uint256) { + uint256 preSeed = uint256(keccak256(abi.encode(keyHash, sender, subId, nonce))); + return (uint256(keccak256(abi.encode(keyHash, preSeed))), preSeed); + } + + /** + * @dev calls target address with exactly gasAmount gas and data as calldata + * or reverts if at least gasAmount gas is not available. + */ + function _callWithExactGas(uint256 gasAmount, address target, bytes memory data) private returns (bool success) { + assembly { + let g := gas() + // Compute g -= GAS_FOR_CALL_EXACT_CHECK and check for underflow + // The gas actually passed to the callee is min(gasAmount, 63//64*gas available). + // We want to ensure that we revert if gasAmount > 63//64*gas available + // as we do not want to provide them with less, however that check itself costs + // gas. GAS_FOR_CALL_EXACT_CHECK ensures we have at least enough gas to be able + // to revert if gasAmount > 63//64*gas available. + if lt(g, GAS_FOR_CALL_EXACT_CHECK) { + revert(0, 0) + } + g := sub(g, GAS_FOR_CALL_EXACT_CHECK) + // if g - g//64 <= gasAmount, revert + // (we subtract g//64 because of EIP-150) + if iszero(gt(sub(g, div(g, 64)), gasAmount)) { + revert(0, 0) + } + // solidity calls check that a contract actually exists at the destination, so we do the same + if iszero(extcodesize(target)) { + revert(0, 0) + } + // call and return whether we succeeded. ignore return data + // call(gas,addr,value,argsOffset,argsLength,retOffset,retLength) + success := call(gasAmount, target, 0, add(data, 0x20), mload(data), 0, 0) + } + return success; + } + + struct Output { + ProvingKey provingKey; + uint256 requestId; + uint256 randomness; + } + + function _getRandomnessFromProof( + Proof memory proof, + VRFTypes.RequestCommitmentV2Plus memory rc + ) internal view returns (Output memory) { + bytes32 keyHash = hashOfKey(proof.pk); + ProvingKey memory key = s_provingKeys[keyHash]; + // Only registered proving keys are permitted. + if (!key.exists) { + revert NoSuchProvingKey(keyHash); + } + uint256 requestId = uint256(keccak256(abi.encode(keyHash, proof.seed))); + bytes32 commitment = s_requestCommitments[requestId]; + if (commitment == 0) { + revert NoCorrespondingRequest(); + } + if ( + commitment != + keccak256(abi.encode(requestId, rc.blockNum, rc.subId, rc.callbackGasLimit, rc.numWords, rc.sender, rc.extraArgs)) + ) { + revert IncorrectCommitment(); + } + + bytes32 blockHash = ChainSpecificUtil._getBlockhash(rc.blockNum); + if (blockHash == bytes32(0)) { + blockHash = BLOCKHASH_STORE.getBlockhash(rc.blockNum); + if (blockHash == bytes32(0)) { + revert BlockhashNotInStore(rc.blockNum); + } + } + + // The seed actually used by the VRF machinery, mixing in the blockhash + uint256 actualSeed = uint256(keccak256(abi.encodePacked(proof.seed, blockHash))); + uint256 randomness = VRFOld._randomValueFromVRFProof(proof, actualSeed); // Reverts on failure + return Output(key, requestId, randomness); + } + + function _getValidatedGasPrice(bool onlyPremium, uint64 gasLaneMaxGas) internal view returns (uint256 gasPrice) { + if (tx.gasprice > gasLaneMaxGas) { + if (onlyPremium) { + // if only the premium amount needs to be billed, then the premium is capped by the gas lane max + return uint256(gasLaneMaxGas); + } else { + // Ensure gas price does not exceed the gas lane max gas price + revert GasPriceExceeded(tx.gasprice, gasLaneMaxGas); + } + } + return tx.gasprice; + } + + function _deliverRandomness( + uint256 requestId, + VRFTypes.RequestCommitmentV2Plus memory rc, + uint256[] memory randomWords + ) internal returns (bool success) { + VRFConsumerBaseV2Plus v; + bytes memory resp = abi.encodeWithSelector(v.rawFulfillRandomWords.selector, requestId, randomWords); + // Call with explicitly the amount of callback gas requested + // Important to not let them exhaust the gas budget and avoid oracle payment. + // Do not allow any non-view/non-pure coordinator functions to be called + // during the consumers callback code via reentrancyLock. + // Note that _callWithExactGas will revert if we do not have sufficient gas + // to give the callee their requested amount. + s_config.reentrancyLock = true; + success = _callWithExactGas(rc.callbackGasLimit, rc.sender, resp); + s_config.reentrancyLock = false; + return success; + } + + /* + * @notice Fulfill a randomness request. + * @param proof contains the proof and randomness + * @param rc request commitment pre-image, committed to at request time + * @param onlyPremium only charge premium + * @return payment amount billed to the subscription + * @dev simulated offchain to determine if sufficient balance is present to fulfill the request + */ + function fulfillRandomWords( + Proof memory proof, + VRFTypes.RequestCommitmentV2Plus memory rc, + bool onlyPremium + ) external nonReentrant returns (uint96 payment) { + uint256 startGas = gasleft(); + // fulfillRandomWords msg.data has 772 bytes and with an additional + // buffer of 32 bytes, we get 804 bytes. + /* Data size split: + * fulfillRandomWords function signature - 4 bytes + * proof - 416 bytes + * pk - 64 bytes + * gamma - 64 bytes + * c - 32 bytes + * s - 32 bytes + * seed - 32 bytes + * uWitness - 32 bytes + * cGammaWitness - 64 bytes + * sHashWitness - 64 bytes + * zInv - 32 bytes + * requestCommitment - 320 bytes + * blockNum - 32 bytes + * subId - 32 bytes + * callbackGasLimit - 32 bytes + * numWords - 32 bytes + * sender - 32 bytes + * extraArgs - 128 bytes + * onlyPremium - 32 bytes + */ + if (msg.data.length > 804) { + revert MsgDataTooBig(msg.data.length, 804); + } + Output memory output = _getRandomnessFromProof(proof, rc); + uint256 gasPrice = _getValidatedGasPrice(onlyPremium, output.provingKey.maxGas); + + uint256[] memory randomWords; + uint256 randomness = output.randomness; + // stack too deep error + { + uint256 numWords = rc.numWords; + randomWords = new uint256[](numWords); + for (uint256 i = 0; i < numWords; ++i) { + randomWords[i] = uint256(keccak256(abi.encode(randomness, i))); + } + } + + delete s_requestCommitments[output.requestId]; + bool success = _deliverRandomness(output.requestId, rc, randomWords); + + // Increment the req count for the subscription. + ++s_subscriptions[rc.subId].reqCount; + // Decrement the pending req count for the consumer. + --s_consumers[rc.sender][rc.subId].pendingReqCount; + + bool nativePayment = uint8(rc.extraArgs[rc.extraArgs.length - 1]) == 1; + + // stack too deep error + { + // We want to charge users exactly for how much gas they use in their callback with + // an additional premium. If onlyPremium is true, only premium is charged without + // the gas cost. The gasAfterPaymentCalculation is meant to cover these additional + // operations where we decrement the subscription balance and increment the + // withdrawable balance. + bool isFeedStale; + (payment, isFeedStale) = _calculatePaymentAmount(startGas, gasPrice, nativePayment, onlyPremium); + if (isFeedStale) { + emit FallbackWeiPerUnitLinkUsed(output.requestId, s_fallbackWeiPerUnitLink); + } + } + + _chargePayment(payment, nativePayment, rc.subId); + + // Include payment in the event for tracking costs. + emit RandomWordsFulfilled(output.requestId, randomness, rc.subId, payment, nativePayment, success, onlyPremium); + + return payment; + } + + function _chargePayment(uint96 payment, bool nativePayment, uint256 subId) internal { + Subscription storage subcription = s_subscriptions[subId]; + if (nativePayment) { + uint96 prevBal = subcription.nativeBalance; + if (prevBal < payment) { + revert InsufficientBalance(); + } + subcription.nativeBalance = prevBal - payment; + s_withdrawableNative += payment; + } else { + uint96 prevBal = subcription.balance; + if (prevBal < payment) { + revert InsufficientBalance(); + } + subcription.balance = prevBal - payment; + s_withdrawableTokens += payment; + } + } + + function _calculatePaymentAmount( + uint256 startGas, + uint256 weiPerUnitGas, + bool nativePayment, + bool onlyPremium + ) internal view returns (uint96, bool) { + if (nativePayment) { + return (_calculatePaymentAmountNative(startGas, weiPerUnitGas, onlyPremium), false); + } + return _calculatePaymentAmountLink(startGas, weiPerUnitGas, onlyPremium); + } + + function _calculatePaymentAmountNative( + uint256 startGas, + uint256 weiPerUnitGas, + bool onlyPremium + ) internal view returns (uint96) { + // Will return non-zero on chains that have this enabled + uint256 l1CostWei = ChainSpecificUtil._getCurrentTxL1GasFees(msg.data); + // calculate the payment without the premium + uint256 baseFeeWei = weiPerUnitGas * (s_config.gasAfterPaymentCalculation + startGas - gasleft()); + // calculate flat fee in native + uint256 flatFeeWei = 1e12 * uint256(s_config.fulfillmentFlatFeeNativePPM); + if (onlyPremium) { + return uint96((((l1CostWei + baseFeeWei) * (s_config.nativePremiumPercentage)) / 100) + flatFeeWei); + } else { + return uint96((((l1CostWei + baseFeeWei) * (100 + s_config.nativePremiumPercentage)) / 100) + flatFeeWei); + } + } + + // Get the amount of gas used for fulfillment + function _calculatePaymentAmountLink( + uint256 startGas, + uint256 weiPerUnitGas, + bool onlyPremium + ) internal view returns (uint96, bool) { + (int256 weiPerUnitLink, bool isFeedStale) = _getFeedData(); + if (weiPerUnitLink <= 0) { + revert InvalidLinkWeiPrice(weiPerUnitLink); + } + // Will return non-zero on chains that have this enabled + uint256 l1CostWei = ChainSpecificUtil._getCurrentTxL1GasFees(msg.data); + // (1e18 juels/link) ((wei/gas * gas) + l1wei) / (wei/link) = juels + uint256 paymentNoFee = (1e18 * + (weiPerUnitGas * (s_config.gasAfterPaymentCalculation + startGas - gasleft()) + l1CostWei)) / + uint256(weiPerUnitLink); + // calculate the flat fee in wei + uint256 flatFeeWei = 1e12 * + uint256(s_config.fulfillmentFlatFeeNativePPM - s_config.fulfillmentFlatFeeLinkDiscountPPM); + uint256 flatFeeJuels = (1e18 * flatFeeWei) / uint256(weiPerUnitLink); + uint256 payment; + if (onlyPremium) { + payment = ((paymentNoFee * (s_config.linkPremiumPercentage)) / 100 + flatFeeJuels); + } else { + payment = ((paymentNoFee * (100 + s_config.linkPremiumPercentage)) / 100 + flatFeeJuels); + } + if (payment > 1e27) { + revert PaymentTooLarge(); // Payment + fee cannot be more than all of the link in existence. + } + return (uint96(payment), isFeedStale); + } + + function _getFeedData() private view returns (int256 weiPerUnitLink, bool isFeedStale) { + uint32 stalenessSeconds = s_config.stalenessSeconds; + uint256 timestamp; + (, weiPerUnitLink, , timestamp, ) = LINK_NATIVE_FEED.latestRoundData(); + // solhint-disable-next-line not-rely-on-time + isFeedStale = stalenessSeconds > 0 && stalenessSeconds < block.timestamp - timestamp; + if (isFeedStale) { + weiPerUnitLink = s_fallbackWeiPerUnitLink; + } + return (weiPerUnitLink, isFeedStale); + } + + /** + * @inheritdoc IVRFSubscriptionV2Plus + */ + function pendingRequestExists(uint256 subId) public view override returns (bool) { + address[] storage consumers = s_subscriptionConfigs[subId].consumers; + uint256 consumersLength = consumers.length; + if (consumersLength == 0) { + return false; + } + for (uint256 i = 0; i < consumersLength; ++i) { + if (s_consumers[consumers[i]][subId].pendingReqCount > 0) { + return true; + } + } + return false; + } + + /** + * @inheritdoc IVRFSubscriptionV2Plus + */ + function removeConsumer(uint256 subId, address consumer) external override onlySubOwner(subId) nonReentrant { + if (pendingRequestExists(subId)) { + revert PendingRequestExists(); + } + if (!s_consumers[consumer][subId].active) { + revert InvalidConsumer(subId, consumer); + } + // Note bounded by MAX_CONSUMERS + address[] memory consumers = s_subscriptionConfigs[subId].consumers; + uint256 lastConsumerIndex = consumers.length - 1; + for (uint256 i = 0; i < consumers.length; ++i) { + if (consumers[i] == consumer) { + address last = consumers[lastConsumerIndex]; + // Storage write to preserve last element + s_subscriptionConfigs[subId].consumers[i] = last; + // Storage remove last element + s_subscriptionConfigs[subId].consumers.pop(); + break; + } + } + s_consumers[consumer][subId].active = false; + emit SubscriptionConsumerRemoved(subId, consumer); + } + + /** + * @inheritdoc IVRFSubscriptionV2Plus + */ + function cancelSubscription(uint256 subId, address to) external override onlySubOwner(subId) nonReentrant { + if (pendingRequestExists(subId)) { + revert PendingRequestExists(); + } + _cancelSubscriptionHelper(subId, to); + } + + /*************************************************************************** + * Section: Migration + ***************************************************************************/ + + address[] internal s_migrationTargets; + + /// @dev Emitted when new coordinator is registered as migratable target + event CoordinatorRegistered(address coordinatorAddress); + + /// @dev Emitted when new coordinator is deregistered + event CoordinatorDeregistered(address coordinatorAddress); + + /// @notice emitted when migration to new coordinator completes successfully + /// @param newCoordinator coordinator address after migration + /// @param subId subscription ID + event MigrationCompleted(address newCoordinator, uint256 subId); + + /// @notice emitted when migrate() is called and given coordinator is not registered as migratable target + error CoordinatorNotRegistered(address coordinatorAddress); + + /// @notice emitted when migrate() is called and given coordinator is registered as migratable target + error CoordinatorAlreadyRegistered(address coordinatorAddress); + + /// @dev encapsulates data to be migrated from current coordinator + // solhint-disable-next-line gas-struct-packing + struct V1MigrationData { + uint8 fromVersion; + uint256 subId; + address subOwner; + address[] consumers; + uint96 linkBalance; + uint96 nativeBalance; + } + + function _isTargetRegistered(address target) internal view returns (bool) { + uint256 migrationTargetsLength = s_migrationTargets.length; + for (uint256 i = 0; i < migrationTargetsLength; ++i) { + if (s_migrationTargets[i] == target) { + return true; + } + } + return false; + } + + function registerMigratableCoordinator(address target) external onlyOwner { + if (_isTargetRegistered(target)) { + revert CoordinatorAlreadyRegistered(target); + } + s_migrationTargets.push(target); + emit CoordinatorRegistered(target); + } + + function deregisterMigratableCoordinator(address target) external onlyOwner { + uint256 nTargets = s_migrationTargets.length; + for (uint256 i = 0; i < nTargets; ++i) { + if (s_migrationTargets[i] == target) { + s_migrationTargets[i] = s_migrationTargets[nTargets - 1]; + s_migrationTargets.pop(); + emit CoordinatorDeregistered(target); + return; + } + } + revert CoordinatorNotRegistered(target); + } + + function migrate(uint256 subId, address newCoordinator) external nonReentrant { + if (!_isTargetRegistered(newCoordinator)) { + revert CoordinatorNotRegistered(newCoordinator); + } + (uint96 balance, uint96 nativeBalance, , address subOwner, address[] memory consumers) = getSubscription(subId); + // solhint-disable-next-line gas-custom-errors + require(subOwner == msg.sender, "Not subscription owner"); + // solhint-disable-next-line gas-custom-errors + require(!pendingRequestExists(subId), "Pending request exists"); + + V1MigrationData memory migrationData = V1MigrationData({ + fromVersion: 1, + subId: subId, + subOwner: subOwner, + consumers: consumers, + linkBalance: balance, + nativeBalance: nativeBalance + }); + bytes memory encodedData = abi.encode(migrationData); + _deleteSubscription(subId); + IVRFCoordinatorV2PlusMigration(newCoordinator).onMigration{value: nativeBalance}(encodedData); + + // Only transfer LINK if the token is active and there is a balance. + if (address(LINK) != address(0) && balance != 0) { + // solhint-disable-next-line gas-custom-errors + require(LINK.transfer(address(newCoordinator), balance), "insufficient funds"); + } + + // despite the fact that we follow best practices this is still probably safest + // to prevent any re-entrancy possibilities. + s_config.reentrancyLock = true; + for (uint256 i = 0; i < consumers.length; ++i) { + IVRFMigratableConsumerV2Plus(consumers[i]).setCoordinator(newCoordinator); + } + s_config.reentrancyLock = false; + + emit MigrationCompleted(newCoordinator, subId); + } +} diff --git a/contracts/src/v0.8/vrf/dev/testhelpers/VRFOld.sol b/contracts/src/v0.8/vrf/dev/testhelpers/VRFOld.sol new file mode 100644 index 00000000000..137235fd0a3 --- /dev/null +++ b/contracts/src/v0.8/vrf/dev/testhelpers/VRFOld.sol @@ -0,0 +1,588 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +/** **************************************************************************** + * @notice Verification of verifiable-random-function (VRF) proofs, following + * @notice https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-vrf-05#section-5.3 + * @notice See https://eprint.iacr.org/2017/099.pdf for security proofs. + + * @dev Bibliographic references: + + * @dev Goldberg, et al., "Verifiable Random Functions (VRFs)", Internet Draft + * @dev draft-irtf-cfrg-vrf-05, IETF, Aug 11 2019, + * @dev https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-vrf-05 + + * @dev Papadopoulos, et al., "Making NSEC5 Practical for DNSSEC", Cryptology + * @dev ePrint Archive, Report 2017/099, https://eprint.iacr.org/2017/099.pdf + * **************************************************************************** + * @dev USAGE + + * @dev The main entry point is _randomValueFromVRFProof. See its docstring. + * **************************************************************************** + * @dev PURPOSE + + * @dev Reggie the Random Oracle (not his real job) wants to provide randomness + * @dev to Vera the verifier in such a way that Vera can be sure he's not + * @dev making his output up to suit himself. Reggie provides Vera a public key + * @dev to which he knows the secret key. Each time Vera provides a seed to + * @dev Reggie, he gives back a value which is computed completely + * @dev deterministically from the seed and the secret key. + + * @dev Reggie provides a proof by which Vera can verify that the output was + * @dev correctly computed once Reggie tells it to her, but without that proof, + * @dev the output is computationally indistinguishable to her from a uniform + * @dev random sample from the output space. + + * @dev The purpose of this contract is to perform that verification. + * **************************************************************************** + * @dev DESIGN NOTES + + * @dev The VRF algorithm verified here satisfies the full uniqueness, full + * @dev collision resistance, and full pseudo-randomness security properties. + * @dev See "SECURITY PROPERTIES" below, and + * @dev https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-vrf-05#section-3 + + * @dev An elliptic curve point is generally represented in the solidity code + * @dev as a uint256[2], corresponding to its affine coordinates in + * @dev GF(FIELD_SIZE). + + * @dev For the sake of efficiency, this implementation deviates from the spec + * @dev in some minor ways: + + * @dev - Keccak hash rather than the SHA256 hash recommended in + * @dev https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-vrf-05#section-5.5 + * @dev Keccak costs much less gas on the EVM, and provides similar security. + + * @dev - Secp256k1 curve instead of the P-256 or ED25519 curves recommended in + * @dev https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-vrf-05#section-5.5 + * @dev For curve-point multiplication, it's much cheaper to abuse ECRECOVER + + * @dev - _hashToCurve recursively hashes until it finds a curve x-ordinate. On + * @dev the EVM, this is slightly more efficient than the recommendation in + * @dev https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-vrf-05#section-5.4.1.1 + * @dev step 5, to concatenate with a nonce then hash, and rehash with the + * @dev nonce updated until a valid x-ordinate is found. + + * @dev - _hashToCurve does not include a cipher version string or the byte 0x1 + * @dev in the hash message, as recommended in step 5.B of the draft + * @dev standard. They are unnecessary here because no variation in the + * @dev cipher suite is allowed. + + * @dev - Similarly, the hash input in _scalarFromCurvePoints does not include a + * @dev commitment to the cipher suite, either, which differs from step 2 of + * @dev https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-vrf-05#section-5.4.3 + * @dev . Also, the hash input is the concatenation of the uncompressed + * @dev points, not the compressed points as recommended in step 3. + + * @dev - In the calculation of the challenge value "c", the "u" value (i.e. + * @dev the value computed by Reggie as the nonce times the secp256k1 + * @dev generator point, see steps 5 and 7 of + * @dev https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-vrf-05#section-5.3 + * @dev ) is replaced by its ethereum address, i.e. the lower 160 bits of the + * @dev keccak hash of the original u. This is because we only verify the + * @dev calculation of u up to its address, by abusing ECRECOVER. + * **************************************************************************** + * @dev SECURITY PROPERTIES + + * @dev Here are the security properties for this VRF: + + * @dev Full uniqueness: For any seed and valid VRF public key, there is + * @dev exactly one VRF output which can be proved to come from that seed, in + * @dev the sense that the proof will pass _verifyVRFProof. + + * @dev Full collision resistance: It's cryptographically infeasible to find + * @dev two seeds with same VRF output from a fixed, valid VRF key + + * @dev Full pseudorandomness: Absent the proofs that the VRF outputs are + * @dev derived from a given seed, the outputs are computationally + * @dev indistinguishable from randomness. + + * @dev https://eprint.iacr.org/2017/099.pdf, Appendix B contains the proofs + * @dev for these properties. + + * @dev For secp256k1, the key validation described in section + * @dev https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-vrf-05#section-5.6 + * @dev is unnecessary, because secp256k1 has cofactor 1, and the + * @dev representation of the public key used here (affine x- and y-ordinates + * @dev of the secp256k1 point on the standard y^2=x^3+7 curve) cannot refer to + * @dev the point at infinity. + * **************************************************************************** + * @dev OTHER SECURITY CONSIDERATIONS + * + * @dev The seed input to the VRF could in principle force an arbitrary amount + * @dev of work in _hashToCurve, by requiring extra rounds of hashing and + * @dev checking whether that's yielded the x ordinate of a secp256k1 point. + * @dev However, under the Random Oracle Model the probability of choosing a + * @dev point which forces n extra rounds in _hashToCurve is 2⁻ⁿ. The base cost + * @dev for calling _hashToCurve is about 25,000 gas, and each round of checking + * @dev for a valid x ordinate costs about 15,555 gas, so to find a seed for + * @dev which _hashToCurve would cost more than 2,017,000 gas, one would have to + * @dev try, in expectation, about 2¹²⁸ seeds, which is infeasible for any + * @dev foreseeable computational resources. (25,000 + 128 * 15,555 < 2,017,000.) + + * @dev Since the gas block limit for the Ethereum main net is 10,000,000 gas, + * @dev this means it is infeasible for an adversary to prevent correct + * @dev operation of this contract by choosing an adverse seed. + + * @dev (See TestMeasureHashToCurveGasCost for verification of the gas cost for + * @dev _hashToCurve.) + + * @dev It may be possible to make a secure constant-time _hashToCurve function. + * @dev See notes in _hashToCurve docstring. +*/ +contract VRFOld { + // See https://www.secg.org/sec2-v2.pdf, section 2.4.1, for these constants. + // Number of points in Secp256k1 + uint256 private constant GROUP_ORDER = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141; + // Prime characteristic of the galois field over which Secp256k1 is defined + uint256 private constant FIELD_SIZE = + // solium-disable-next-line indentation + 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F; + uint256 private constant WORD_LENGTH_BYTES = 0x20; + + // (base^exponent) % FIELD_SIZE + // Cribbed from https://medium.com/@rbkhmrcr/precompiles-solidity-e5d29bd428c4 + function _bigModExp(uint256 base, uint256 exponent) internal view returns (uint256 exponentiation) { + uint256 callResult; + uint256[6] memory bigModExpContractInputs; + bigModExpContractInputs[0] = WORD_LENGTH_BYTES; // Length of base + bigModExpContractInputs[1] = WORD_LENGTH_BYTES; // Length of exponent + bigModExpContractInputs[2] = WORD_LENGTH_BYTES; // Length of modulus + bigModExpContractInputs[3] = base; + bigModExpContractInputs[4] = exponent; + bigModExpContractInputs[5] = FIELD_SIZE; + uint256[1] memory output; + assembly { + callResult := staticcall( + not(0), // Gas cost: no limit + 0x05, // Bigmodexp contract address + bigModExpContractInputs, + 0xc0, // Length of input segment: 6*0x20-bytes + output, + 0x20 // Length of output segment + ) + } + if (callResult == 0) { + // solhint-disable-next-line gas-custom-errors + revert("bigModExp failure!"); + } + return output[0]; + } + + // Let q=FIELD_SIZE. q % 4 = 3, ∴ x≡r^2 mod q ⇒ x^SQRT_POWER≡±r mod q. See + // https://en.wikipedia.org/wiki/Modular_square_root#Prime_or_prime_power_modulus + uint256 private constant SQRT_POWER = (FIELD_SIZE + 1) >> 2; + + // Computes a s.t. a^2 = x in the field. Assumes a exists + function _squareRoot(uint256 x) internal view returns (uint256) { + return _bigModExp(x, SQRT_POWER); + } + + // The value of y^2 given that (x,y) is on secp256k1. + function _ySquared(uint256 x) internal pure returns (uint256) { + // Curve is y^2=x^3+7. See section 2.4.1 of https://www.secg.org/sec2-v2.pdf + uint256 xCubed = mulmod(x, mulmod(x, x, FIELD_SIZE), FIELD_SIZE); + return addmod(xCubed, 7, FIELD_SIZE); + } + + // True iff p is on secp256k1 + function _isOnCurve(uint256[2] memory p) internal pure returns (bool) { + // Section 2.3.6. in https://www.secg.org/sec1-v2.pdf + // requires each ordinate to be in [0, ..., FIELD_SIZE-1] + // solhint-disable-next-line gas-custom-errors + require(p[0] < FIELD_SIZE, "invalid x-ordinate"); + // solhint-disable-next-line gas-custom-errors + require(p[1] < FIELD_SIZE, "invalid y-ordinate"); + return _ySquared(p[0]) == mulmod(p[1], p[1], FIELD_SIZE); + } + + // Hash x uniformly into {0, ..., FIELD_SIZE-1}. + function _fieldHash(bytes memory b) internal pure returns (uint256 x_) { + x_ = uint256(keccak256(b)); + // Rejecting if x >= FIELD_SIZE corresponds to step 2.1 in section 2.3.4 of + // http://www.secg.org/sec1-v2.pdf , which is part of the definition of + // string_to_point in the IETF draft + while (x_ >= FIELD_SIZE) { + x_ = uint256(keccak256(abi.encodePacked(x_))); + } + return x_; + } + + // Hash b to a random point which hopefully lies on secp256k1. The y ordinate + // is always even, due to + // https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-vrf-05#section-5.4.1.1 + // step 5.C, which references arbitrary_string_to_point, defined in + // https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-vrf-05#section-5.5 as + // returning the point with given x ordinate, and even y ordinate. + function _newCandidateSecp256k1Point(bytes memory b) internal view returns (uint256[2] memory p) { + unchecked { + p[0] = _fieldHash(b); + p[1] = _squareRoot(_ySquared(p[0])); + if (p[1] % 2 == 1) { + // Note that 0 <= p[1] < FIELD_SIZE + // so this cannot wrap, we use unchecked to save gas. + p[1] = FIELD_SIZE - p[1]; + } + } + return p; + } + + // Domain-separation tag for initial hash in _hashToCurve. Corresponds to + // vrf.go/hashToCurveHashPrefix + uint256 internal constant HASH_TO_CURVE_HASH_PREFIX = 1; + + // Cryptographic hash function onto the curve. + // + // Corresponds to algorithm in section 5.4.1.1 of the draft standard. (But see + // DESIGN NOTES above for slight differences.) + // + // TODO(alx): Implement a bounded-computation hash-to-curve, as described in + // "Construction of Rational Points on Elliptic Curves over Finite Fields" + // http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.831.5299&rep=rep1&type=pdf + // and suggested by + // https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-hash-to-curve-01#section-5.2.2 + // (Though we can't used exactly that because secp256k1's j-invariant is 0.) + // + // This would greatly simplify the analysis in "OTHER SECURITY CONSIDERATIONS" + // https://www.pivotaltracker.com/story/show/171120900 + function _hashToCurve(uint256[2] memory pk, uint256 input) internal view returns (uint256[2] memory rv) { + rv = _newCandidateSecp256k1Point(abi.encodePacked(HASH_TO_CURVE_HASH_PREFIX, pk, input)); + while (!_isOnCurve(rv)) { + rv = _newCandidateSecp256k1Point(abi.encodePacked(rv[0])); + } + return rv; + } + + /** ********************************************************************* + * @notice Check that product==scalar*multiplicand + * + * @dev Based on Vitalik Buterin's idea in ethresear.ch post cited below. + * + * @param multiplicand: secp256k1 point + * @param scalar: non-zero GF(GROUP_ORDER) scalar + * @param product: secp256k1 expected to be multiplier * multiplicand + * @return verifies true iff product==scalar*multiplicand, with cryptographically high probability + */ + function _ecmulVerify( + uint256[2] memory multiplicand, + uint256 scalar, + uint256[2] memory product + ) internal pure returns (bool verifies) { + // solhint-disable-next-line gas-custom-errors + require(scalar != 0, "zero scalar"); // Rules out an ecrecover failure case + uint256 x = multiplicand[0]; // x ordinate of multiplicand + uint8 v = multiplicand[1] % 2 == 0 ? 27 : 28; // parity of y ordinate + // https://ethresear.ch/t/you-can-kinda-abuse-ecrecover-to-do-ecmul-in-secp256k1-today/2384/9 + // Point corresponding to address ecrecover(0, v, x, s=scalar*x) is + // (x⁻¹ mod GROUP_ORDER) * (scalar * x * multiplicand - 0 * g), i.e. + // scalar*multiplicand. See https://crypto.stackexchange.com/a/18106 + bytes32 scalarTimesX = bytes32(mulmod(scalar, x, GROUP_ORDER)); + address actual = ecrecover(bytes32(0), v, bytes32(x), scalarTimesX); + // Explicit conversion to address takes bottom 160 bits + address expected = address(uint160(uint256(keccak256(abi.encodePacked(product))))); + return (actual == expected); + } + + // Returns x1/z1-x2/z2=(x1z2-x2z1)/(z1z2) in projective coordinates on P¹(𝔽ₙ) + function _projectiveSub( + uint256 x1, + uint256 z1, + uint256 x2, + uint256 z2 + ) internal pure returns (uint256 x3, uint256 z3) { + unchecked { + uint256 num1 = mulmod(z2, x1, FIELD_SIZE); + // Note this cannot wrap since x2 is a point in [0, FIELD_SIZE-1] + // we use unchecked to save gas. + uint256 num2 = mulmod(FIELD_SIZE - x2, z1, FIELD_SIZE); + (x3, z3) = (addmod(num1, num2, FIELD_SIZE), mulmod(z1, z2, FIELD_SIZE)); + } + return (x3, z3); + } + + // Returns x1/z1*x2/z2=(x1x2)/(z1z2), in projective coordinates on P¹(𝔽ₙ) + function _projectiveMul( + uint256 x1, + uint256 z1, + uint256 x2, + uint256 z2 + ) internal pure returns (uint256 x3, uint256 z3) { + (x3, z3) = (mulmod(x1, x2, FIELD_SIZE), mulmod(z1, z2, FIELD_SIZE)); + return (x3, z3); + } + + /** ************************************************************************** + @notice Computes elliptic-curve sum, in projective co-ordinates + + @dev Using projective coordinates avoids costly divisions + + @dev To use this with p and q in affine coordinates, call + @dev _projectiveECAdd(px, py, qx, qy). This will return + @dev the addition of (px, py, 1) and (qx, qy, 1), in the + @dev secp256k1 group. + + @dev This can be used to calculate the z which is the inverse to zInv + @dev in isValidVRFOutput. But consider using a faster + @dev re-implementation such as ProjectiveECAdd in the golang vrf package. + + @dev This function assumes [px,py,1],[qx,qy,1] are valid projective + coordinates of secp256k1 points. That is safe in this contract, + because this method is only used by _linearCombination, which checks + points are on the curve via ecrecover. + ************************************************************************** + @param px The first affine coordinate of the first summand + @param py The second affine coordinate of the first summand + @param qx The first affine coordinate of the second summand + @param qy The second affine coordinate of the second summand + + (px,py) and (qx,qy) must be distinct, valid secp256k1 points. + ************************************************************************** + Return values are projective coordinates of [px,py,1]+[qx,qy,1] as points + on secp256k1, in P²(𝔽ₙ) + @return sx + @return sy + @return sz + */ + function _projectiveECAdd( + uint256 px, + uint256 py, + uint256 qx, + uint256 qy + ) internal pure returns (uint256 sx, uint256 sy, uint256 sz) { + unchecked { + // See "Group law for E/K : y^2 = x^3 + ax + b", in section 3.1.2, p. 80, + // "Guide to Elliptic Curve Cryptography" by Hankerson, Menezes and Vanstone + // We take the equations there for (sx,sy), and homogenize them to + // projective coordinates. That way, no inverses are required, here, and we + // only need the one inverse in _affineECAdd. + + // We only need the "point addition" equations from Hankerson et al. Can + // skip the "point doubling" equations because p1 == p2 is cryptographically + // impossible, and required not to be the case in _linearCombination. + + // Add extra "projective coordinate" to the two points + (uint256 z1, uint256 z2) = (1, 1); + + // (lx, lz) = (qy-py)/(qx-px), i.e., gradient of secant line. + // Cannot wrap since px and py are in [0, FIELD_SIZE-1] + uint256 lx = addmod(qy, FIELD_SIZE - py, FIELD_SIZE); + uint256 lz = addmod(qx, FIELD_SIZE - px, FIELD_SIZE); + + uint256 dx; // Accumulates denominator from sx calculation + // sx=((qy-py)/(qx-px))^2-px-qx + (sx, dx) = _projectiveMul(lx, lz, lx, lz); // ((qy-py)/(qx-px))^2 + (sx, dx) = _projectiveSub(sx, dx, px, z1); // ((qy-py)/(qx-px))^2-px + (sx, dx) = _projectiveSub(sx, dx, qx, z2); // ((qy-py)/(qx-px))^2-px-qx + + uint256 dy; // Accumulates denominator from sy calculation + // sy=((qy-py)/(qx-px))(px-sx)-py + (sy, dy) = _projectiveSub(px, z1, sx, dx); // px-sx + (sy, dy) = _projectiveMul(sy, dy, lx, lz); // ((qy-py)/(qx-px))(px-sx) + (sy, dy) = _projectiveSub(sy, dy, py, z1); // ((qy-py)/(qx-px))(px-sx)-py + + if (dx != dy) { + // Cross-multiply to put everything over a common denominator + sx = mulmod(sx, dy, FIELD_SIZE); + sy = mulmod(sy, dx, FIELD_SIZE); + sz = mulmod(dx, dy, FIELD_SIZE); + } else { + // Already over a common denominator, use that for z ordinate + sz = dx; + } + } + return (sx, sy, sz); + } + + // p1+p2, as affine points on secp256k1. + // + // invZ must be the inverse of the z returned by _projectiveECAdd(p1, p2). + // It is computed off-chain to save gas. + // + // p1 and p2 must be distinct, because _projectiveECAdd doesn't handle + // point doubling. + function _affineECAdd( + uint256[2] memory p1, + uint256[2] memory p2, + uint256 invZ + ) internal pure returns (uint256[2] memory) { + uint256 x; + uint256 y; + uint256 z; + (x, y, z) = _projectiveECAdd(p1[0], p1[1], p2[0], p2[1]); + // solhint-disable-next-line gas-custom-errors + require(mulmod(z, invZ, FIELD_SIZE) == 1, "invZ must be inverse of z"); + // Clear the z ordinate of the projective representation by dividing through + // by it, to obtain the affine representation + return [mulmod(x, invZ, FIELD_SIZE), mulmod(y, invZ, FIELD_SIZE)]; + } + + // True iff address(c*p+s*g) == lcWitness, where g is generator. (With + // cryptographically high probability.) + function _verifyLinearCombinationWithGenerator( + uint256 c, + uint256[2] memory p, + uint256 s, + address lcWitness + ) internal pure returns (bool) { + // Rule out ecrecover failure modes which return address 0. + unchecked { + // solhint-disable-next-line gas-custom-errors + require(lcWitness != address(0), "bad witness"); + uint8 v = (p[1] % 2 == 0) ? 27 : 28; // parity of y-ordinate of p + // Note this cannot wrap (X - Y % X), but we use unchecked to save + // gas. + bytes32 pseudoHash = bytes32(GROUP_ORDER - mulmod(p[0], s, GROUP_ORDER)); // -s*p[0] + bytes32 pseudoSignature = bytes32(mulmod(c, p[0], GROUP_ORDER)); // c*p[0] + // https://ethresear.ch/t/you-can-kinda-abuse-ecrecover-to-do-ecmul-in-secp256k1-today/2384/9 + // The point corresponding to the address returned by + // ecrecover(-s*p[0],v,p[0],c*p[0]) is + // (p[0]⁻¹ mod GROUP_ORDER)*(c*p[0]-(-s)*p[0]*g)=c*p+s*g. + // See https://crypto.stackexchange.com/a/18106 + // https://bitcoin.stackexchange.com/questions/38351/ecdsa-v-r-s-what-is-v + address computed = ecrecover(pseudoHash, v, bytes32(p[0]), pseudoSignature); + return computed == lcWitness; + } + } + + // c*p1 + s*p2. Requires cp1Witness=c*p1 and sp2Witness=s*p2. Also + // requires cp1Witness != sp2Witness (which is fine for this application, + // since it is cryptographically impossible for them to be equal. In the + // (cryptographically impossible) case that a prover accidentally derives + // a proof with equal c*p1 and s*p2, they should retry with a different + // proof nonce.) Assumes that all points are on secp256k1 + // (which is checked in _verifyVRFProof below.) + function _linearCombination( + uint256 c, + uint256[2] memory p1, + uint256[2] memory cp1Witness, + uint256 s, + uint256[2] memory p2, + uint256[2] memory sp2Witness, + uint256 zInv + ) internal pure returns (uint256[2] memory) { + unchecked { + // Note we are relying on the wrap around here + // solhint-disable-next-line gas-custom-errors + require((cp1Witness[0] % FIELD_SIZE) != (sp2Witness[0] % FIELD_SIZE), "points in sum must be distinct"); + // solhint-disable-next-line gas-custom-errors + require(_ecmulVerify(p1, c, cp1Witness), "First mul check failed"); + // solhint-disable-next-line gas-custom-errors + require(_ecmulVerify(p2, s, sp2Witness), "Second mul check failed"); + return _affineECAdd(cp1Witness, sp2Witness, zInv); + } + } + + // Domain-separation tag for the hash taken in _scalarFromCurvePoints. + // Corresponds to scalarFromCurveHashPrefix in vrf.go + uint256 internal constant SCALAR_FROM_CURVE_POINTS_HASH_PREFIX = 2; + + // Pseudo-random number from inputs. Matches vrf.go/_scalarFromCurvePoints, and + // https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-vrf-05#section-5.4.3 + // The draft calls (in step 7, via the definition of string_to_int, in + // https://datatracker.ietf.org/doc/html/rfc8017#section-4.2 ) for taking the + // first hash without checking that it corresponds to a number less than the + // group order, which will lead to a slight bias in the sample. + // + // TODO(alx): We could save a bit of gas by following the standard here and + // using the compressed representation of the points, if we collated the y + // parities into a single bytes32. + // https://www.pivotaltracker.com/story/show/171120588 + function _scalarFromCurvePoints( + uint256[2] memory hash, + uint256[2] memory pk, + uint256[2] memory gamma, + address uWitness, + uint256[2] memory v + ) internal pure returns (uint256 s) { + return uint256(keccak256(abi.encodePacked(SCALAR_FROM_CURVE_POINTS_HASH_PREFIX, hash, pk, gamma, v, uWitness))); + } + + // True if (gamma, c, s) is a correctly constructed randomness proof from pk + // and seed. zInv must be the inverse of the third ordinate from + // _projectiveECAdd applied to cGammaWitness and sHashWitness. Corresponds to + // section 5.3 of the IETF draft. + // + // TODO(alx): Since I'm only using pk in the ecrecover call, I could only pass + // the x ordinate, and the parity of the y ordinate in the top bit of uWitness + // (which I could make a uint256 without using any extra space.) Would save + // about 2000 gas. https://www.pivotaltracker.com/story/show/170828567 + function _verifyVRFProof( + uint256[2] memory pk, + uint256[2] memory gamma, + uint256 c, + uint256 s, + uint256 seed, + address uWitness, + uint256[2] memory cGammaWitness, + uint256[2] memory sHashWitness, + uint256 zInv + ) internal view { + unchecked { + // solhint-disable-next-line gas-custom-errors + require(_isOnCurve(pk), "public key is not on curve"); + // solhint-disable-next-line gas-custom-errors + require(_isOnCurve(gamma), "gamma is not on curve"); + // solhint-disable-next-line gas-custom-errors + require(_isOnCurve(cGammaWitness), "cGammaWitness is not on curve"); + // solhint-disable-next-line gas-custom-errors + require(_isOnCurve(sHashWitness), "sHashWitness is not on curve"); + // Step 5. of IETF draft section 5.3 (pk corresponds to 5.3's Y, and here + // we use the address of u instead of u itself. Also, here we add the + // terms instead of taking the difference, and in the proof construction in + // vrf.GenerateProof, we correspondingly take the difference instead of + // taking the sum as they do in step 7 of section 5.1.) + // solhint-disable-next-line gas-custom-errors + require(_verifyLinearCombinationWithGenerator(c, pk, s, uWitness), "addr(c*pk+s*g)!=_uWitness"); + // Step 4. of IETF draft section 5.3 (pk corresponds to Y, seed to alpha_string) + uint256[2] memory hash = _hashToCurve(pk, seed); + // Step 6. of IETF draft section 5.3, but see note for step 5 about +/- terms + uint256[2] memory v = _linearCombination(c, gamma, cGammaWitness, s, hash, sHashWitness, zInv); + // Steps 7. and 8. of IETF draft section 5.3 + uint256 derivedC = _scalarFromCurvePoints(hash, pk, gamma, uWitness, v); + // solhint-disable-next-line gas-custom-errors + require(c == derivedC, "invalid proof"); + } + } + + // Domain-separation tag for the hash used as the final VRF output. + // Corresponds to vrfRandomOutputHashPrefix in vrf.go + uint256 internal constant VRF_RANDOM_OUTPUT_HASH_PREFIX = 3; + + struct Proof { + uint256[2] pk; + uint256[2] gamma; + uint256 c; + uint256 s; + uint256 seed; + address uWitness; + uint256[2] cGammaWitness; + uint256[2] sHashWitness; + uint256 zInv; + } + + /* *************************************************************************** + * @notice Returns proof's output, if proof is valid. Otherwise reverts + + * @param proof vrf proof components + * @param seed seed used to generate the vrf output + * + * Throws if proof is invalid, otherwise: + * @return output i.e., the random output implied by the proof + * *************************************************************************** + */ + function _randomValueFromVRFProof(Proof memory proof, uint256 seed) internal view returns (uint256 output) { + _verifyVRFProof( + proof.pk, + proof.gamma, + proof.c, + proof.s, + seed, + proof.uWitness, + proof.cGammaWitness, + proof.sHashWitness, + proof.zInv + ); + output = uint256(keccak256(abi.encode(VRF_RANDOM_OUTPUT_HASH_PREFIX, proof.gamma))); + return output; + } +} diff --git a/contracts/src/v0.8/vrf/test/BatchVRFCoordinatorV2Plus.t.sol b/contracts/src/v0.8/vrf/test/BatchVRFCoordinatorV2Plus.t.sol index c2938cb35b0..4197073aa50 100644 --- a/contracts/src/v0.8/vrf/test/BatchVRFCoordinatorV2Plus.t.sol +++ b/contracts/src/v0.8/vrf/test/BatchVRFCoordinatorV2Plus.t.sol @@ -48,17 +48,26 @@ contract BatchVRFCoordinatorV2PlusTest is FixtureVRFCoordinatorV2_5 { // Store the previous block's blockhash. vm.roll(requestBlock + 1); s_bhs.store(requestBlock); + assertEq(hex"1a192fabce13988b84994d4296e6cdc418d55e2f1d7f942188d4040b94fc57ac", s_bhs.getBlockhash(requestBlock)); VRFTypes.Proof[] memory proofs = new VRFTypes.Proof[](2); VRFTypes.RequestCommitmentV2Plus[] memory rcs = new VRFTypes.RequestCommitmentV2Plus[](2); - // Proof generated via the generate-proof-v2-plus script command. Example usage: - // _printGenerateProofV2PlusCommand(address(s_consumer), 1, requestBlock, true); + // Proof generated via the generate-proof-v2-plus script command. + // 1st step: Uncomment the print command below and run the test to print the output. + // _printGenerateProofV2PlusCommand(address(s_consumer1), 1, requestBlock, false); + // 2nd step: export the following environment variables to run the generate-proof-v2-plus script. + // export ETH_URL=https://ethereum-sepolia-rpc.publicnode.com # or any other RPC provider you prefer + // export ETH_CHAIN_ID=11155111 # or switch to any other chain + // export ACCOUNT_KEY= + // 3rd step: copy the output from the 1st step and update the command below, then run the command + // and copy the command output in the proof section below /* + Run from this folder: chainlink/core/scripts/vrfv2plus/testnet go run . generate-proof-v2-plus \ -key-hash 0x9f2353bde94264dbc3d554a94cceba2d7d2b4fdce4304d3e09a1fea9fbeb1528 \ - -pre-seed 33855227690351884611579800220581891477580182035146587491531555927634180294480 \ - -block-hash 0x0a \ + -pre-seed 4430852740828987645228960511496023658059009607317025880962658187812299131155 \ + -block-hash 0x1a192fabce13988b84994d4296e6cdc418d55e2f1d7f942188d4040b94fc57ac \ -block-num 10 \ -sender 0xdc90e8ce61c1af8a638b95264037c8e67ee5765c \ -native-payment true @@ -70,22 +79,22 @@ contract BatchVRFCoordinatorV2PlusTest is FixtureVRFCoordinatorV2_5 { 62070622898698443831883535403436258712770888294397026493185421712108624767191 ], gamma: [ - 80420391742429647505172101941811820476888293644816377569181566466584288434705, - 24046736031266889997051641830469514057863365715722268340801477580836256044582 + 26762213923453052192184693334574145607290366984305044804336172347176490943606, + 70503534560525619072578237689732581746976650376431765635714023643649039207077 ], - c: 74775128390693502914275156263410881155583102046081919417827483535122161050585, - s: 69563235412360165148368009853509434870917653835330501139204071967997764190111, - seed: 33855227690351884611579800220581891477580182035146587491531555927634180294480, - uWitness: 0xfB0663eaf48785540dE0FD0F837FD9c09BF4B80A, + c: 10992233996918874905152274435276937088064589467016709044984819613170049539489, + s: 79662863379962724455809192044326025082567113176696761949197261107120333769102, + seed: 4430852740828987645228960511496023658059009607317025880962658187812299131155, + uWitness: 0x421A52Fb797d76Fb610aA1a0c020346fC1Ee2DeB, cGammaWitness: [ - 53711159452748734758194447734939737695995909567499536035707522847057731697403, - 113650002631484103366420937668971311744887820666944514581352028601506700116835 + 50748523246052507241857300891945475679319243536065937584940024494820365165901, + 85746856994474260612851047426766648416105284284185975301552792881940939754570 ], sHashWitness: [ - 89656531714223714144489731263049239277719465105516547297952288438117443488525, - 90859682705760125677895017864538514058733199985667976488434404721197234427011 + 78637275871978664522379716948105702461748200460627087255706483027519919611423, + 82219236913923465822780520561305604064850823877720616893986252854976640396959 ], - zInv: 97275608653505690744303242942631893944856831559408852202478373762878300587548 + zInv: 60547558497534848069125896511700272238016171243048151035528198622956754542730 }); rcs[0] = VRFTypes.RequestCommitmentV2Plus({ blockNum: requestBlock, @@ -116,14 +125,23 @@ contract BatchVRFCoordinatorV2PlusTest is FixtureVRFCoordinatorV2_5 { // Store the previous block's blockhash. vm.roll(requestBlock + 1); s_bhs.store(requestBlock); + assertEq(hex"731dc163f73d31d8c68f9917ce4ff967753939f70432973c04fd2c2a48148607", s_bhs.getBlockhash(requestBlock)); - // Proof generated via the generate-proof-v2-plus script command. Example usage: + // Proof generated via the generate-proof-v2-plus script command. + // 1st step: Uncomment the print command below and run the test to print the output. // _printGenerateProofV2PlusCommand(address(s_consumer1), 1, requestBlock, false); + // 2nd step: export the following environment variables to run the generate-proof-v2-plus script. + // export ETH_URL=https://ethereum-sepolia-rpc.publicnode.com # or any other RPC provider you prefer + // export ETH_CHAIN_ID=11155111 # or switch to any other chain + // export ACCOUNT_KEY= + // 3rd step: copy the output from the 1st step and update the command below, then run the command + // and copy the command output in the proof section below /* + Run from this folder: chainlink/core/scripts/vrfv2plus/testnet go run . generate-proof-v2-plus \ -key-hash 0x9f2353bde94264dbc3d554a94cceba2d7d2b4fdce4304d3e09a1fea9fbeb1528 \ - -pre-seed 76568185840201037774581758921393822690942290841865097674309745036496166431060 \ - -block-hash 0x14 \ + -pre-seed 14541556911652758131165474365357244907354309169650401973525070879190071151266 \ + -block-hash 0x731dc163f73d31d8c68f9917ce4ff967753939f70432973c04fd2c2a48148607 \ -block-num 20 \ -sender 0x2f1c0761d6e4b1e5f01968d6c746f695e5f3e25d \ -native-payment false @@ -134,22 +152,22 @@ contract BatchVRFCoordinatorV2PlusTest is FixtureVRFCoordinatorV2_5 { 62070622898698443831883535403436258712770888294397026493185421712108624767191 ], gamma: [ - 21323932463597506192387578758854201988004673105893105492473194972397109828006, - 96834737826889397196571646974355352644437196500310392203712129010026003355112 + 97658842840420719674383370910135023062422561858595941631054490821636116883585, + 44255438468488339528368406358785988551798314198954634050943346751039644360856 ], - c: 8775807990949224376582975115621037245862755412370175152581490650310350359728, - s: 6805708577951013810918872616271445638109899206333819877111740872779453350091, - seed: 76568185840201037774581758921393822690942290841865097674309745036496166431060, - uWitness: 0xE82fF24Fecfbe73d682f38308bE3E039Dfabdf5c, + c: 5233652943248967403606766735502925802264855214922758107203237169366748118852, + s: 87931642435666855739510477620068257005869145374865238974094299759068218698655, + seed: 14541556911652758131165474365357244907354309169650401973525070879190071151266, + uWitness: 0x0A87a9CB71983cE0F2C4bA41D0c1A6Fb1785c46A, cGammaWitness: [ - 92810770919624535241476539842820168209710445519252592382122118536598338376923, - 17271305664006119131434661141858450289379246199095231636439133258170648418554 + 54062743217909816783918413821204010151082432359411822104552882037459289383418, + 67491004534731980264926765871774299056809003077448271411776926359153820235981 ], sHashWitness: [ - 29540023305939374439696120003978246982707698669656874393367212257432197207536, - 93902323936532381028323379401739289810874348405259732508442252936582467730050 + 7745933951617569731026754652291310837540252155195826133994719499558406927394, + 58405861596456412358325504621101233475720292237067230796670629212111423924259 ], - zInv: 88845170436601946907659333156418518556235340365885668267853966404617557948692 + zInv: 44253513765558903217330502897662324213800000485156126961643960636269885275795 }); rcs[1] = VRFTypes.RequestCommitmentV2Plus({ blockNum: requestBlock, @@ -168,9 +186,9 @@ contract BatchVRFCoordinatorV2PlusTest is FixtureVRFCoordinatorV2_5 { // The payments are NOT pre-calculated and simply copied from the actual event. // We can assert and ignore the payment field but the code will be considerably longer. vm.expectEmit(true, true, false, true, address(s_coordinator)); - emit RandomWordsFulfilled(output.requestId, output.randomness, s_subId, 500000000000143283, true, true, false); + emit RandomWordsFulfilled(output.requestId, output.randomness, s_subId, 500000000000143261, true, true, false); vm.expectEmit(true, true, false, true, address(s_coordinator)); - emit RandomWordsFulfilled(output1.requestId, output1.randomness, s_subId, 800000000000306143, false, true, false); + emit RandomWordsFulfilled(output1.requestId, output1.randomness, s_subId, 800000000000312358, false, true, false); // Fulfill the requests. s_batchCoordinator.fulfillRandomWords(proofs, rcs); diff --git a/contracts/src/v0.8/vrf/test/VRFV2Plus.t.sol b/contracts/src/v0.8/vrf/test/VRFV2Plus.t.sol index 75a8d969273..dd3f54b580a 100644 --- a/contracts/src/v0.8/vrf/test/VRFV2Plus.t.sol +++ b/contracts/src/v0.8/vrf/test/VRFV2Plus.t.sol @@ -513,26 +513,33 @@ contract VRFV2Plus is BaseTest { assertEq(fulfilled, false); assertTrue(s_testCoordinator.pendingRequestExists(subId)); - // Uncomment these console logs to see info about the request: - // console.log("requestId: ", requestId); - // console.log("preSeed: ", preSeed); - // console.log("sender: ", address(s_testConsumer)); - // Move on to the next block. // Store the previous block's blockhash, and assert that it is as expected. vm.roll(requestBlock + 1); s_bhs.store(requestBlock); - assertEq(hex"0000000000000000000000000000000000000000000000000000000000000014", s_bhs.getBlockhash(requestBlock)); + assertEq(hex"731dc163f73d31d8c68f9917ce4ff967753939f70432973c04fd2c2a48148607", s_bhs.getBlockhash(requestBlock)); // Fulfill the request. - // Proof generated via the generate-proof-v2-plus script command. Example usage: + // Proof generated via the generate-proof-v2-plus script command. + // 1st step: Uncomment these 3 console logs to see info about the request and run the test to get output: + // console.log("requestId: ", requestId); + // console.log("preSeed: ", preSeed); + // console.log("sender: ", address(s_testConsumer)); + // 2nd step: Update pre-seed in the command commented out below with new value printed in console logs. + // 3rd step: export the following environment variables to run the generate-proof-v2-plus script. + // export ETH_URL=https://ethereum-sepolia-rpc.publicnode.com # or any other RPC provider you prefer + // export ETH_CHAIN_ID=11155111 # or switch to any other chain + // export ACCOUNT_KEY= + // 4th step: run the command and copy the command output in the proof section below. /* + Run from this folder: chainlink/core/scripts/vrfv2plus/testnet go run . generate-proof-v2-plus \ -key-hash 0x9f2353bde94264dbc3d554a94cceba2d7d2b4fdce4304d3e09a1fea9fbeb1528 \ - -pre-seed 58424872742560034068603954318478134981993109073728628043159461959392650534066 \ - -block-hash 0x0000000000000000000000000000000000000000000000000000000000000014 \ + -pre-seed 77134414723242246520332717536018735794426514244521954002798799849127623496871 \ + -block-hash 0x731dc163f73d31d8c68f9917ce4ff967753939f70432973c04fd2c2a48148607 \ -block-num 20 \ - -sender 0x90A8820424CC8a819d14cBdE54D12fD3fbFa9bb2 + -sender 0x90A8820424CC8a819d14cBdE54D12fD3fbFa9bb2 \ + -native-payment false */ proof = VRF.Proof({ pk: [ @@ -540,22 +547,22 @@ contract VRFV2Plus is BaseTest { 62070622898698443831883535403436258712770888294397026493185421712108624767191 ], gamma: [ - 38041205470219573731614166317842050442610096576830191475863676359766283013831, - 31897503406364148988967447112698248795931483458172800286988696482435433838056 + 103927982338770370318312316555080928288985522873495041111817988974598585393796, + 56789421278806198480964888112155620425048056183534931202752833185923411715624 ], - c: 114706080610174375269579192101772790158458728655229562781479812703475130740224, - s: 91869928024010088265014058436030407245056128545665425448353233998362687232253, - seed: 58424872742560034068603954318478134981993109073728628043159461959392650534066, - uWitness: 0x1514536B09a51E671d070312bcD3653386d5a82b, + c: 23645475075665525321781505993434124657388421977074956645288621921391376468128, + s: 106817081950846808215350231311242951539230271757396902089035477907017240898689, + seed: 77134414723242246520332717536018735794426514244521954002798799849127623496871, + uWitness: 0xD6899602060d574DE03FE1cf76fDf66afE12d549, cGammaWitness: [ - 90605489216274499662544489893800286859751132311034850249229378789467669572783, - 76568417372883461229305641415175605031997103681542349721251313705711146936024 + 9892458071712426452033749279561067220589549155902380165087951541202159693388, + 61235995320721681444549354910430438435754757626312862714628885100042911955139 ], sHashWitness: [ - 43417948503950579681520475434461454031791886587406480417092620950034789197994, - 100772571879140362396088596211082924128900752544164141322636815729889228000249 + 101478618362722903511580105256015180591690884037598276249676652094434483808775, + 82512235485399822034680598942438982472006937353405384896956013889074719896188 ], - zInv: 82374292458278672300647114418593830323283909625362447038989596015264004164958 + zInv: 82281039329215616805111360985152709712368762415186906218863971780664103705723 }); rc = VRFTypes.RequestCommitmentV2Plus({ blockNum: requestBlock, @@ -602,24 +609,30 @@ contract VRFV2Plus is BaseTest { assertEq(fulfilled, false); assertTrue(s_testCoordinator.pendingRequestExists(subId)); - // Uncomment these console logs to see info about the request: - // console.log("requestId: ", requestId); - // console.log("preSeed: ", preSeed); - // console.log("sender: ", address(s_testConsumer)); - // Move on to the next block. // Store the previous block's blockhash, and assert that it is as expected. vm.roll(requestBlock + 1); s_bhs.store(requestBlock); - assertEq(hex"000000000000000000000000000000000000000000000000000000000000000a", s_bhs.getBlockhash(requestBlock)); + assertEq(hex"1a192fabce13988b84994d4296e6cdc418d55e2f1d7f942188d4040b94fc57ac", s_bhs.getBlockhash(requestBlock)); // Fulfill the request. - // Proof generated via the generate-proof-v2-plus script command. Example usage: + // Proof generated via the generate-proof-v2-plus script command. + // 1st step: Uncomment these 3 console logs to see info about the request and run the test to get output: + // console.log("requestId: ", requestId); + // console.log("preSeed: ", preSeed); + // console.log("sender: ", address(s_testConsumer)); + // 2nd step: Update pre-seed in the command commented out below with new value printed in console logs. + // 3rd step: export the following environment variables to run the generate-proof-v2-plus script. + // export ETH_URL=https://ethereum-sepolia-rpc.publicnode.com # or any other RPC provider you prefer + // export ETH_CHAIN_ID=11155111 # or switch to any other chain + // export ACCOUNT_KEY= + // 4th step: run the command and copy the command output in the proof section below. /* + Run from this folder: chainlink/core/scripts/vrfv2plus/testnet go run . generate-proof-v2-plus \ -key-hash 0x9f2353bde94264dbc3d554a94cceba2d7d2b4fdce4304d3e09a1fea9fbeb1528 \ - -pre-seed 83266692323404068105564931899467966321583332182309426611016082057597749986430 \ - -block-hash 0x000000000000000000000000000000000000000000000000000000000000000a \ + -pre-seed 88177119495082281213609405072572269421661478022189589823108119237563684383163 \ + -block-hash 0x1a192fabce13988b84994d4296e6cdc418d55e2f1d7f942188d4040b94fc57ac \ -block-num 10 \ -sender 0x90A8820424CC8a819d14cBdE54D12fD3fbFa9bb2 \ -native-payment true @@ -630,22 +643,22 @@ contract VRFV2Plus is BaseTest { 62070622898698443831883535403436258712770888294397026493185421712108624767191 ], gamma: [ - 47144451677122876068574640250190132179872561942855874114516471019540736524783, - 63001220656590641645486673489302242739512599229187442248048295264418080499391 + 102142782721757938350759722545721736888276217484353597703162772276193136052353, + 87167280284008869627768921028415708350806510214000539818296353518495698939660 ], - c: 42928477813589729783511577059394077774341588261592343937605454161333818133643, - s: 14447529458406454898597883219032514356523135029224613793880920230249515634875, - seed: 83266692323404068105564931899467966321583332182309426611016082057597749986430, - uWitness: 0x5Ed3bb2AA8EAFe168a23079644d5dfBf892B1038, + c: 78738462581063211677832865654743924688552792392007862664964608134754001810280, + s: 97066881804257970453329086439696419448135613089654606517271688187030953014593, + seed: 88177119495082281213609405072572269421661478022189589823108119237563684383163, + uWitness: 0xa335ea8dF652d5331a276B60b16c9733435D4f73, cGammaWitness: [ - 40742088032247467257043132769297935807697466810312051815364187117543257089153, - 110399474382135664619186049639190334359061769014381608543009407662815758204131 + 114435126227922602743444254494036972095649501991695809092954325430947992864624, + 63032211040463927862594425238691911311087931119674607521158894139074063158678 ], sHashWitness: [ - 26556776392895292893984393164594214244553035014769995354896600239759043777485, - 67126706735912782218279556535631175449291035782208850310724682668198932501077 + 105043781471073183057173130563345930784924139079040814418442661347864735908726, + 68696469914696211053833437482938344908217760552761185546164836556562945431554 ], - zInv: 88742453392918610091640193378775723954629905126315835248392650970979000380325 + zInv: 73325637847357165955904789471972164751975373195750497508525598331798833112175 }); rc = VRFTypes.RequestCommitmentV2Plus({ blockNum: requestBlock, @@ -750,26 +763,26 @@ contract VRFV2Plus is BaseTest { (bool fulfilled, , ) = s_testConsumer.s_requests(requestId); assertEq(fulfilled, true); - // The cost of fulfillRandomWords is approximately 86_700 gas. + // The cost of fulfillRandomWords is approximately 89_100 gas. // gasAfterPaymentCalculation is 50_000. // // The cost of the VRF fulfillment charged to the user is: // paymentNoFee = (weiPerUnitGas * (gasAfterPaymentCalculation + startGas - gasleft() + l1CostWei) / link_native_ratio) // network gas price is capped at gas lane max gas (5000 gwei) - // paymentNoFee = (5e12 * (50_000 + 86_700 + 0)) / .5 - // paymentNoFee = 1.367e+18 + // paymentNoFee = (5e12 * (50_000 + 89_100 + 0)) / .5 + // paymentNoFee = 1.391e+18 // flatFeeWei = 1e12 * (fulfillmentFlatFeeNativePPM - fulfillmentFlatFeeLinkDiscountPPM) // flatFeeWei = 1e12 * (500_000 - 100_000) // flatFeeJuels = 1e18 * flatFeeWei / link_native_ratio // flatFeeJuels = 4e17 / 0.5 = 8e17 // billed_fee = paymentNoFee * (10 / 100) + 8e17 - // billed_fee = 1.367e+18 * 0.1 + 8e17 - // billed_fee = 9.367e+17 + // billed_fee = 1.391e+18 * 0.1 + 8e17 + // billed_fee = 9.391e+17 // note: delta is doubled from the native test to account for more variance due to the link/native ratio (uint96 linkBalanceAfter, , , , ) = s_testCoordinator.getSubscription(subId); // 1e15 is less than 1 percent discrepancy - assertApproxEqAbs(payment, 9.367 * 1e17, 1e15); - assertApproxEqAbs(linkBalanceAfter, linkBalanceBefore - 9.367 * 1e17, 1e15); + assertApproxEqAbs(payment, 9.391 * 1e17, 1e15); + assertApproxEqAbs(linkBalanceAfter, linkBalanceBefore - 9.391 * 1e17, 1e15); assertFalse(s_testCoordinator.pendingRequestExists(subId)); } @@ -834,24 +847,30 @@ contract VRFV2Plus is BaseTest { ); assertTrue(s_testCoordinator.pendingRequestExists(subId)); - // 3. Fulfill the request above - //console.log("requestId: ", requestId); - //console.log("preSeed: ", preSeed); - //console.log("sender: ", address(consumer)); - // Move on to the next block. // Store the previous block's blockhash, and assert that it is as expected. vm.roll(requestBlock + 1); s_bhs.store(requestBlock); - assertEq(hex"000000000000000000000000000000000000000000000000000000000000000a", s_bhs.getBlockhash(requestBlock)); + assertEq(hex"1a192fabce13988b84994d4296e6cdc418d55e2f1d7f942188d4040b94fc57ac", s_bhs.getBlockhash(requestBlock)); - // Fulfill the request. - // Proof generated via the generate-proof-v2-plus script command. Example usage: + // 3. Fulfill the request above + // Proof generated via the generate-proof-v2-plus script command. + // 1st step: Uncomment these 3 console logs to see info about the request and run the test to get output: + // console.log("requestId: ", requestId); + // console.log("preSeed: ", preSeed); + // console.log("sender: ", address(s_testConsumer)); + // 2nd step: Update pre-seed in the command commented out below with new value printed in console logs. + // 3rd step: export the following environment variables to run the generate-proof-v2-plus script. + // export ETH_URL=https://ethereum-sepolia-rpc.publicnode.com # or any other RPC provider you prefer + // export ETH_CHAIN_ID=11155111 # or switch to any other chain + // export ACCOUNT_KEY= + // 4th step: run the command and copy the command output in the proof section below. /* + Run from this folder: chainlink/core/scripts/vrfv2plus/testnet go run . generate-proof-v2-plus \ -key-hash 0x9f2353bde94264dbc3d554a94cceba2d7d2b4fdce4304d3e09a1fea9fbeb1528 \ - -pre-seed 94043941380654896554739370173616551044559721638888689173752661912204412136884 \ - -block-hash 0x000000000000000000000000000000000000000000000000000000000000000a \ + -pre-seed 78857362017365444144484359594634073685493503942324326290718892836953423263381 \ + -block-hash 0x1a192fabce13988b84994d4296e6cdc418d55e2f1d7f942188d4040b94fc57ac \ -block-num 10 \ -sender 0x44CAfC03154A0708F9DCf988681821f648dA74aF \ -native-payment true @@ -862,22 +881,22 @@ contract VRFV2Plus is BaseTest { 62070622898698443831883535403436258712770888294397026493185421712108624767191 ], gamma: [ - 18593555375562408458806406536059989757338587469093035962641476877033456068708, - 55675218112764789548330682504442195066741636758414578491295297591596761905475 + 65913937398148449626792563067325648649534055460473988721938103219381973178278, + 63156327344180203180831822252171874192175272818200597638000091892096122362120 ], - c: 56595337384472359782910435918403237878894172750128610188222417200315739516270, - s: 60666722370046279064490737533582002977678558769715798604164042022636022215663, - seed: 94043941380654896554739370173616551044559721638888689173752661912204412136884, - uWitness: 0xEdbE15fd105cfEFb9CCcbBD84403d1F62719E50d, + c: 96524997218413735279221574381819903278651909890109201564980667824986706861580, + s: 32941032142956097592442894642111025677491308239274769364799856748447418202313, + seed: 78857362017365444144484359594634073685493503942324326290718892836953423263381, + uWitness: 0xda613621Dc2347d9A6670a1cBA812d52A7ec3A3A, cGammaWitness: [ - 11752391553651713021860307604522059957920042356542944931263270793211985356642, - 14713353048309058367510422609936133400473710094544154206129568172815229277104 + 6776842114900054689355891239487365968068230823400902903493665825747641410781, + 753482930067864853610521010650481816782338376846697006021590704037205560592 ], sHashWitness: [ - 109716108880570827107616596438987062129934448629902940427517663799192095060206, - 79378277044196229730810703755304140279837983575681427317104232794580059801930 + 76619528582417858778905184311764104068650968652636772643050945629834129417915, + 27947566794040118487986033070014357750801611688958204148187927873566412002355 ], - zInv: 18898957977631212231148068121702167284572066246731769473720131179584458697812 + zInv: 77351076831418813780936064446565588198113457019145030499544500588309236458362 }); VRFTypes.RequestCommitmentV2Plus memory rc = VRFTypes.RequestCommitmentV2Plus({ blockNum: requestBlock, @@ -988,20 +1007,26 @@ contract VRFV2Plus is BaseTest { // Store the previous block's blockhash, and assert that it is as expected. vm.roll(requestBlock + 1); s_bhs.store(requestBlock); - assertEq(hex"000000000000000000000000000000000000000000000000000000000000000a", s_bhs.getBlockhash(requestBlock)); + assertEq(hex"1a192fabce13988b84994d4296e6cdc418d55e2f1d7f942188d4040b94fc57ac", s_bhs.getBlockhash(requestBlock)); // 3. Fulfill the 1st request above - console.log("requestId: ", requestId1); - console.log("preSeed: ", preSeed1); - console.log("sender: ", address(consumer1)); - - // Fulfill the request. - // Proof generated via the generate-proof-v2-plus script command. Example usage: + // Proof generated via the generate-proof-v2-plus script command. + // 1st step: Uncomment these 3 console logs to see info about the request and run the test to get output: + // console.log("requestId: ", requestId); + // console.log("preSeed: ", preSeed); + // console.log("sender: ", address(s_testConsumer)); + // 2nd step: Update pre-seed in the command commented out below with new value printed in console logs. + // 3rd step: export the following environment variables to run the generate-proof-v2-plus script. + // export ETH_URL=https://ethereum-sepolia-rpc.publicnode.com # or any other RPC provider you prefer + // export ETH_CHAIN_ID=11155111 # or switch to any other chain + // export ACCOUNT_KEY= + // 4th step: run the command and copy the command output in the proof section below. /* + Run from this folder: chainlink/core/scripts/vrfv2plus/testnet go run . generate-proof-v2-plus \ -key-hash 0x9f2353bde94264dbc3d554a94cceba2d7d2b4fdce4304d3e09a1fea9fbeb1528 \ - -pre-seed 94043941380654896554739370173616551044559721638888689173752661912204412136884 \ - -block-hash 0x000000000000000000000000000000000000000000000000000000000000000a \ + -pre-seed 78857362017365444144484359594634073685493503942324326290718892836953423263381 \ + -block-hash 0x1a192fabce13988b84994d4296e6cdc418d55e2f1d7f942188d4040b94fc57ac \ -block-num 10 \ -sender 0x44CAfC03154A0708F9DCf988681821f648dA74aF \ -native-payment true @@ -1012,22 +1037,22 @@ contract VRFV2Plus is BaseTest { 62070622898698443831883535403436258712770888294397026493185421712108624767191 ], gamma: [ - 18593555375562408458806406536059989757338587469093035962641476877033456068708, - 55675218112764789548330682504442195066741636758414578491295297591596761905475 + 65913937398148449626792563067325648649534055460473988721938103219381973178278, + 63156327344180203180831822252171874192175272818200597638000091892096122362120 ], - c: 56595337384472359782910435918403237878894172750128610188222417200315739516270, - s: 60666722370046279064490737533582002977678558769715798604164042022636022215663, - seed: 94043941380654896554739370173616551044559721638888689173752661912204412136884, - uWitness: 0xEdbE15fd105cfEFb9CCcbBD84403d1F62719E50d, + c: 103296526941774692908067234360350834482645116475454593803823148315342533216203, + s: 50291245814080656739779812653411869801334231723444391096753849942661931376590, + seed: 78857362017365444144484359594634073685493503942324326290718892836953423263381, + uWitness: 0x38500711AdcB471ac1A566c4b915759eb9cBCE2F, cGammaWitness: [ - 11752391553651713021860307604522059957920042356542944931263270793211985356642, - 14713353048309058367510422609936133400473710094544154206129568172815229277104 + 56476970720509547210740928951846471668018949971632948991136782499758110143588, + 44326075300781389077656415325167171692706436527877070415603658305817367373598 ], sHashWitness: [ - 109716108880570827107616596438987062129934448629902940427517663799192095060206, - 79378277044196229730810703755304140279837983575681427317104232794580059801930 + 109524696164787283409393383708118913934136014139634321235031691839206768278439, + 52690039857779635909051684567562068782378693408005554345469129234366171822741 ], - zInv: 18898957977631212231148068121702167284572066246731769473720131179584458697812 + zInv: 108537983043800425266290112227943788107669768716438017124275578856644517258573 }); VRFTypes.RequestCommitmentV2Plus memory rc = VRFTypes.RequestCommitmentV2Plus({ blockNum: requestBlock, @@ -1040,18 +1065,24 @@ contract VRFV2Plus is BaseTest { s_testCoordinator.fulfillRandomWords(proof, rc, true /* onlyPremium */); assertTrue(s_testCoordinator.pendingRequestExists(subId)); - //4. Fulfill the 2nd request - console.log("requestId: ", requestId2); - console.log("preSeed: ", preSeed2); - console.log("sender: ", address(consumer2)); - - // Fulfill the request. - // Proof generated via the generate-proof-v2-plus script command. Example usage: + // 4. Fulfill the 2nd request + // Proof generated via the generate-proof-v2-plus script command. + // 1st step: Uncomment these 3 console logs to see info about the request and run the test to get output: + // console.log("requestId: ", requestId); + // console.log("preSeed: ", preSeed); + // console.log("sender: ", address(s_testConsumer)); + // 2nd step: Update pre-seed in the command commented out below with new value printed in console logs. + // 3rd step: export the following environment variables to run the generate-proof-v2-plus script. + // export ETH_URL=https://ethereum-sepolia-rpc.publicnode.com # or any other RPC provider you prefer + // export ETH_CHAIN_ID=11155111 # or switch to any other chain + // export ACCOUNT_KEY= + // 4th step: run the command and copy the command output in the proof section below. /* + Run from this folder: chainlink/core/scripts/vrfv2plus/testnet go run . generate-proof-v2-plus \ -key-hash 0x9f2353bde94264dbc3d554a94cceba2d7d2b4fdce4304d3e09a1fea9fbeb1528 \ - -pre-seed 60086281972849674111646805013521068579710860774417505336898013292594859262126 \ - -block-hash 0x000000000000000000000000000000000000000000000000000000000000000a \ + -pre-seed 53330100288105770463016865504321558518073051667771993294213115153676065708950 \ + -block-hash 0x1a192fabce13988b84994d4296e6cdc418d55e2f1d7f942188d4040b94fc57ac \ -block-num 10 \ -sender 0xf5a165378E120f93784395aDF1E08a437e902865 \ -native-payment true @@ -1062,22 +1093,22 @@ contract VRFV2Plus is BaseTest { 62070622898698443831883535403436258712770888294397026493185421712108624767191 ], gamma: [ - 8781676794493524976318989249067879326013864868749595045909181134740761572122, - 70144896394968351242907510966944756907625107566821127114847472296460405612124 + 7260273098301741284457725182313945178888499328441106869722941415453613782770, + 91648498042618923465107471165504200585847250228048015102713552756245653299952 ], - c: 67847193668837615807355025316836592349514589069599294392546721746916067719949, - s: 114946531382736685625345450298146929067341928840493664822961336014597880904075, - seed: 60086281972849674111646805013521068579710860774417505336898013292594859262126, - uWitness: 0xe1de4fD69277D0C5516cAE4d760b1d08BC340A28, + c: 64987886290696558870328339791409334400119338012796549091587853494368167422332, + s: 69469162696695326295567645789624554797683340898724555794078876350372084267572, + seed: 53330100288105770463016865504321558518073051667771993294213115153676065708950, + uWitness: 0xa6ce21aD47eC5E90Ac7a2c6152D9710234Afe8ab, cGammaWitness: [ - 90301582727701442026215692513959255065128476395727596945643431833363167168678, - 61501369717028493801369453424028509804064958915788808540582630993703331669978 + 57318358662553647785891634403735348577492991113152343207139729697842283565417, + 57942043484796308689103390068712967247519265087617809262260051163954389512396 ], sHashWitness: [ - 98738650825542176387169085844714248077697103572877410412808249468787326424906, - 85647963391545223707301702874240345890884970941786094239896961457539737216630 + 113345999157319332195230171660555736547709417795439282230372737104445523493539, + 113358219039155973560933190466797830695088313506343976960055230355894888727567 ], - zInv: 29080001901010358083725892808339807464533563010468652346220922643802059192842 + zInv: 68349552569605209428774574139615352877146713490794995768725549089572297658255 }); rc = VRFTypes.RequestCommitmentV2Plus({ blockNum: requestBlock, diff --git a/contracts/test/v0.8/automation/AutomationRegistry2_2.test.ts b/contracts/test/v0.8/automation/AutomationRegistry2_2.test.ts index 62733bcad43..6b220f2f7cb 100644 --- a/contracts/test/v0.8/automation/AutomationRegistry2_2.test.ts +++ b/contracts/test/v0.8/automation/AutomationRegistry2_2.test.ts @@ -23,7 +23,7 @@ import { MockArbGasInfo__factory as MockArbGasInfoFactory } from '../../../typec import { MockOVMGasPriceOracle__factory as MockOVMGasPriceOracleFactory } from '../../../typechain/factories/MockOVMGasPriceOracle__factory' import { ChainModuleBase__factory as ChainModuleBaseFactory } from '../../../typechain/factories/ChainModuleBase__factory' import { ArbitrumModule__factory as ArbitrumModuleFactory } from '../../../typechain/factories/ArbitrumModule__factory' -import { OptimismModule__factory as OptimismModuleFactory } from '../../../typechain/factories/OptimismModule__factory' +import { OptimismModuleV2__factory as OptimismModuleV2Factory } from '../../../typechain/factories/OptimismModuleV2__factory' import { ILogAutomation__factory as ILogAutomationactory } from '../../../typechain/factories/ILogAutomation__factory' import { IAutomationForwarder__factory as IAutomationForwarderFactory } from '../../../typechain/factories/IAutomationForwarder__factory' import { MockArbSys__factory as MockArbSysFactory } from '../../../typechain/factories/MockArbSys__factory' @@ -35,7 +35,7 @@ import { MockV3Aggregator } from '../../../typechain/MockV3Aggregator' import { UpkeepMock } from '../../../typechain/UpkeepMock' import { ChainModuleBase } from '../../../typechain/ChainModuleBase' import { ArbitrumModule } from '../../../typechain/ArbitrumModule' -import { OptimismModule } from '../../../typechain/OptimismModule' +import { OptimismModuleV2 } from '../../../typechain/OptimismModuleV2' import { UpkeepTranscoder } from '../../../typechain/UpkeepTranscoder' import { IChainModule, UpkeepAutoFunder } from '../../../typechain' import { @@ -148,7 +148,7 @@ let upkeepMockFactory: UpkeepMockFactory let upkeepAutoFunderFactory: UpkeepAutoFunderFactory let chainModuleBaseFactory: ChainModuleBaseFactory let arbitrumModuleFactory: ArbitrumModuleFactory -let optimismModuleFactory: OptimismModuleFactory +let optimismModuleV2Factory: OptimismModuleV2Factory let streamsLookupUpkeepFactory: StreamsLookupUpkeepFactory let personas: Personas @@ -169,7 +169,7 @@ let ltUpkeep: MockContract let transcoder: UpkeepTranscoder let chainModuleBase: ChainModuleBase let arbitrumModule: ArbitrumModule -let optimismModule: OptimismModule +let optimismModule: OptimismModuleV2 let streamsLookupUpkeep: StreamsLookupUpkeep let automationUtils: AutomationCompatibleUtils @@ -430,7 +430,8 @@ describe('AutomationRegistry2_2', () => { await ethers.getContractFactory('UpkeepAutoFunder') chainModuleBaseFactory = await ethers.getContractFactory('ChainModuleBase') arbitrumModuleFactory = await ethers.getContractFactory('ArbitrumModule') - optimismModuleFactory = await ethers.getContractFactory('OptimismModule') + optimismModuleV2Factory = + await ethers.getContractFactory('OptimismModuleV2') streamsLookupUpkeepFactory = await ethers.getContractFactory( 'StreamsLookupUpkeep', ) @@ -844,7 +845,7 @@ describe('AutomationRegistry2_2', () => { .deploy() chainModuleBase = await chainModuleBaseFactory.connect(owner).deploy() arbitrumModule = await arbitrumModuleFactory.connect(owner).deploy() - optimismModule = await optimismModuleFactory.connect(owner).deploy() + optimismModule = await optimismModuleV2Factory.connect(owner).deploy() streamsLookupUpkeep = await streamsLookupUpkeepFactory .connect(owner) .deploy( diff --git a/contracts/test/v0.8/automation/AutomationRegistry2_3.test.ts b/contracts/test/v0.8/automation/AutomationRegistry2_3.test.ts index 9a572269695..f3c2d9bb984 100644 --- a/contracts/test/v0.8/automation/AutomationRegistry2_3.test.ts +++ b/contracts/test/v0.8/automation/AutomationRegistry2_3.test.ts @@ -23,9 +23,8 @@ import { MockArbGasInfo__factory as MockArbGasInfoFactory } from '../../../typec import { MockOVMGasPriceOracle__factory as MockOVMGasPriceOracleFactory } from '../../../typechain/factories/MockOVMGasPriceOracle__factory' import { ChainModuleBase__factory as ChainModuleBaseFactory } from '../../../typechain/factories/ChainModuleBase__factory' import { ArbitrumModule__factory as ArbitrumModuleFactory } from '../../../typechain/factories/ArbitrumModule__factory' -import { OptimismModule__factory as OptimismModuleFactory } from '../../../typechain/factories/OptimismModule__factory' +import { OptimismModuleV2__factory as OptimismModuleV2Factory } from '../../../typechain/factories/OptimismModuleV2__factory' import { ILogAutomation__factory as ILogAutomationactory } from '../../../typechain/factories/ILogAutomation__factory' -import { IAutomationForwarder__factory as IAutomationForwarderFactory } from '../../../typechain/factories/IAutomationForwarder__factory' import { MockArbSys__factory as MockArbSysFactory } from '../../../typechain/factories/MockArbSys__factory' import { AutomationCompatibleUtils } from '../../../typechain/AutomationCompatibleUtils' import { MockArbGasInfo } from '../../../typechain/MockArbGasInfo' @@ -35,7 +34,7 @@ import { MockV3Aggregator } from '../../../typechain/MockV3Aggregator' import { UpkeepMock } from '../../../typechain/UpkeepMock' import { ChainModuleBase } from '../../../typechain/ChainModuleBase' import { ArbitrumModule } from '../../../typechain/ArbitrumModule' -import { OptimismModule } from '../../../typechain/OptimismModule' +import { OptimismModuleV2 } from '../../../typechain/OptimismModuleV2' import { UpkeepTranscoder } from '../../../typechain/UpkeepTranscoder' import { IChainModule, UpkeepAutoFunder } from '../../../typechain' import { @@ -153,7 +152,7 @@ let upkeepMockFactory: UpkeepMockFactory let upkeepAutoFunderFactory: UpkeepAutoFunderFactory let chainModuleBaseFactory: ChainModuleBaseFactory let arbitrumModuleFactory: ArbitrumModuleFactory -let optimismModuleFactory: OptimismModuleFactory +let optimismModuleFactory: OptimismModuleV2Factory let streamsLookupUpkeepFactory: StreamsLookupUpkeepFactory let personas: Personas @@ -175,7 +174,7 @@ let ltUpkeep: MockContract let transcoder: UpkeepTranscoder let chainModuleBase: ChainModuleBase let arbitrumModule: ArbitrumModule -let optimismModule: OptimismModule +let optimismModule: OptimismModuleV2 let streamsLookupUpkeep: StreamsLookupUpkeep let automationUtils: AutomationCompatibleUtils let automationUtils2_3: AutomationUtils2_3 @@ -443,7 +442,7 @@ describe('AutomationRegistry2_3', () => { await ethers.getContractFactory('UpkeepAutoFunder') chainModuleBaseFactory = await ethers.getContractFactory('ChainModuleBase') arbitrumModuleFactory = await ethers.getContractFactory('ArbitrumModule') - optimismModuleFactory = await ethers.getContractFactory('OptimismModule') + optimismModuleFactory = await ethers.getContractFactory('OptimismModuleV2') streamsLookupUpkeepFactory = await ethers.getContractFactory( 'StreamsLookupUpkeep', ) @@ -3107,44 +3106,6 @@ describe('AutomationRegistry2_3', () => { await getTransmitTx(registry, keeper1, [upkeepId2]) }) - it('reverts if called on a non existing ID', async () => { - await evmRevertCustomError( - registry - .connect(admin) - .withdrawFunds(upkeepId.add(1), await payee1.getAddress()), - registry, - 'OnlyCallableByAdmin', - ) - }) - - it('reverts if called by anyone but the admin', async () => { - await evmRevertCustomError( - registry - .connect(owner) - .withdrawFunds(upkeepId, await payee1.getAddress()), - registry, - 'OnlyCallableByAdmin', - ) - }) - - it('reverts if called on an uncanceled upkeep', async () => { - await evmRevertCustomError( - registry - .connect(admin) - .withdrawFunds(upkeepId, await payee1.getAddress()), - registry, - 'UpkeepNotCanceled', - ) - }) - - it('reverts if called with the 0 address', async () => { - await evmRevertCustomError( - registry.connect(admin).withdrawFunds(upkeepId, zeroAddress), - registry, - 'InvalidRecipient', - ) - }) - describe('after the registration is paused, then cancelled', () => { it('allows the admin to withdraw', async () => { const balance = await registry.getBalance(upkeepId) @@ -3514,46 +3475,6 @@ describe('AutomationRegistry2_3', () => { }) }) - describe('#getActiveUpkeepIDs', () => { - it('reverts if startIndex is out of bounds ', async () => { - await evmRevertCustomError( - registry.getActiveUpkeepIDs(numUpkeeps, 0), - registry, - 'IndexOutOfRange', - ) - await evmRevertCustomError( - registry.getActiveUpkeepIDs(numUpkeeps + 1, 0), - registry, - 'IndexOutOfRange', - ) - }) - - it('returns upkeep IDs bounded by maxCount', async () => { - let upkeepIds = await registry.getActiveUpkeepIDs(0, 1) - assert(upkeepIds.length == 1) - assert(upkeepIds[0].eq(upkeepId)) - upkeepIds = await registry.getActiveUpkeepIDs(1, 3) - assert(upkeepIds.length == 3) - expect(upkeepIds).to.deep.equal([ - afUpkeepId, - logUpkeepId, - streamsLookupUpkeepId, - ]) - }) - - it('returns as many ids as possible if maxCount > num available', async () => { - const upkeepIds = await registry.getActiveUpkeepIDs(1, numUpkeeps + 100) - assert(upkeepIds.length == numUpkeeps - 1) - }) - - it('returns all upkeep IDs if maxCount is 0', async () => { - let upkeepIds = await registry.getActiveUpkeepIDs(0, 0) - assert(upkeepIds.length == numUpkeeps) - upkeepIds = await registry.getActiveUpkeepIDs(2, 0) - assert(upkeepIds.length == numUpkeeps - 2) - }) - }) - describe('#getMaxPaymentForGas', () => { let maxl1CostWeiArbWithoutMultiplier: BigNumber let maxl1CostWeiOptWithoutMultiplier: BigNumber @@ -4225,1140 +4146,180 @@ describe('AutomationRegistry2_3', () => { }) }) - describe('#setPeerRegistryMigrationPermission() / #getPeerRegistryMigrationPermission()', () => { - const peer = randomAddress() - it('allows the owner to set the peer registries', async () => { - let permission = await registry.getPeerRegistryMigrationPermission(peer) - expect(permission).to.equal(0) - await registry.setPeerRegistryMigrationPermission(peer, 1) - permission = await registry.getPeerRegistryMigrationPermission(peer) - expect(permission).to.equal(1) - await registry.setPeerRegistryMigrationPermission(peer, 2) - permission = await registry.getPeerRegistryMigrationPermission(peer) - expect(permission).to.equal(2) - await registry.setPeerRegistryMigrationPermission(peer, 0) - permission = await registry.getPeerRegistryMigrationPermission(peer) - expect(permission).to.equal(0) - }) - it('reverts if passed an unsupported permission', async () => { - await expect( - registry.connect(admin).setPeerRegistryMigrationPermission(peer, 10), - ).to.be.reverted - }) - it('reverts if not called by the owner', async () => { - await expect( - registry.connect(admin).setPeerRegistryMigrationPermission(peer, 1), - ).to.be.revertedWith('Only callable by owner') - }) - }) - - describe('#pauseUpkeep', () => { - it('reverts if the registration does not exist', async () => { - await evmRevertCustomError( - registry.connect(keeper1).pauseUpkeep(upkeepId.add(1)), - registry, - 'OnlyCallableByAdmin', - ) - }) - - it('reverts if the upkeep is already canceled', async () => { - await registry.connect(admin).cancelUpkeep(upkeepId) - - await evmRevertCustomError( - registry.connect(admin).pauseUpkeep(upkeepId), - registry, - 'UpkeepCancelled', - ) - }) - - it('reverts if the upkeep is already paused', async () => { - await registry.connect(admin).pauseUpkeep(upkeepId) - - await evmRevertCustomError( - registry.connect(admin).pauseUpkeep(upkeepId), - registry, - 'OnlyUnpausedUpkeep', - ) - }) - - it('reverts if the caller is not the upkeep admin', async () => { - await evmRevertCustomError( - registry.connect(keeper1).pauseUpkeep(upkeepId), - registry, - 'OnlyCallableByAdmin', - ) - }) - - it('pauses the upkeep and emits an event', async () => { - const tx = await registry.connect(admin).pauseUpkeep(upkeepId) - await expect(tx).to.emit(registry, 'UpkeepPaused').withArgs(upkeepId) + describe('#cancelUpkeep', () => { + describe('when called by the owner', async () => { + it('immediately prevents upkeep', async () => { + await registry.connect(owner).cancelUpkeep(upkeepId) - const registration = await registry.getUpkeep(upkeepId) - assert.equal(registration.paused, true) + const tx = await getTransmitTx(registry, keeper1, [upkeepId]) + const receipt = await tx.wait() + const cancelledUpkeepReportLogs = + parseCancelledUpkeepReportLogs(receipt) + // exactly 1 CancelledUpkeepReport log should be emitted + assert.equal(cancelledUpkeepReportLogs.length, 1) + }) }) - }) - describe('#unpauseUpkeep', () => { - it('reverts if the registration does not exist', async () => { - await evmRevertCustomError( - registry.connect(keeper1).unpauseUpkeep(upkeepId.add(1)), - registry, - 'OnlyCallableByAdmin', - ) - }) + describe('when called by the admin', async () => { + it('immediately prevents upkeep', async () => { + await linkToken.connect(owner).approve(registry.address, toWei('100')) + await registry.connect(owner).addFunds(upkeepId, toWei('100')) + await registry.connect(admin).cancelUpkeep(upkeepId) - it('reverts if the upkeep is already canceled', async () => { - await registry.connect(owner).cancelUpkeep(upkeepId) + await getTransmitTx(registry, keeper1, [upkeepId]) - await evmRevertCustomError( - registry.connect(admin).unpauseUpkeep(upkeepId), - registry, - 'UpkeepCancelled', - ) - }) + for (let i = 0; i < cancellationDelay; i++) { + await ethers.provider.send('evm_mine', []) + } - it('marks the contract as paused', async () => { - assert.isFalse((await registry.getState()).state.paused) + const tx = await getTransmitTx(registry, keeper1, [upkeepId]) - await registry.connect(owner).pause() + const receipt = await tx.wait() + const cancelledUpkeepReportLogs = + parseCancelledUpkeepReportLogs(receipt) + // exactly 1 CancelledUpkeepReport log should be emitted + assert.equal(cancelledUpkeepReportLogs.length, 1) + }) - assert.isTrue((await registry.getState()).state.paused) - }) + describeMaybe('when an upkeep has been performed', async () => { + beforeEach(async () => { + await linkToken.connect(owner).approve(registry.address, toWei('100')) + await registry.connect(owner).addFunds(upkeepId, toWei('100')) + await getTransmitTx(registry, keeper1, [upkeepId]) + }) - it('reverts if the upkeep is not paused', async () => { - await evmRevertCustomError( - registry.connect(admin).unpauseUpkeep(upkeepId), - registry, - 'OnlyPausedUpkeep', - ) - }) + it('deducts a cancellation fee from the upkeep and adds to reserve', async () => { + const newMinUpkeepSpend = toWei('10') + const financeAdminAddress = await financeAdmin.getAddress() - it('reverts if the caller is not the upkeep admin', async () => { - await registry.connect(admin).pauseUpkeep(upkeepId) + await registry.connect(owner).setConfigTypeSafe( + signerAddresses, + keeperAddresses, + f, + { + checkGasLimit, + stalenessSeconds, + gasCeilingMultiplier, + maxCheckDataSize, + maxPerformDataSize, + maxRevertDataSize, + maxPerformGas, + fallbackGasPrice, + fallbackLinkPrice, + fallbackNativePrice, + transcoder: transcoder.address, + registrars: [], + upkeepPrivilegeManager: upkeepManager, + chainModule: chainModuleBase.address, + reorgProtectionEnabled: true, + financeAdmin: financeAdminAddress, + }, + offchainVersion, + offchainBytes, + [linkToken.address], + [ + { + gasFeePPB: paymentPremiumPPB, + flatFeeMilliCents, + priceFeed: linkUSDFeed.address, + fallbackPrice: fallbackLinkPrice, + minSpend: newMinUpkeepSpend, + decimals: 18, + }, + ], + ) - const registration = await registry.getUpkeep(upkeepId) + const payee1Before = await linkToken.balanceOf( + await payee1.getAddress(), + ) + const upkeepBefore = (await registry.getUpkeep(upkeepId)).balance + const ownerBefore = await registry.linkAvailableForPayment() - assert.equal(registration.paused, true) + const amountSpent = toWei('100').sub(upkeepBefore) + const cancellationFee = newMinUpkeepSpend.sub(amountSpent) - await evmRevertCustomError( - registry.connect(keeper1).unpauseUpkeep(upkeepId), - registry, - 'OnlyCallableByAdmin', - ) - }) + await registry.connect(admin).cancelUpkeep(upkeepId) - it('unpauses the upkeep and emits an event', async () => { - const originalCount = (await registry.getActiveUpkeepIDs(0, 0)).length + const payee1After = await linkToken.balanceOf( + await payee1.getAddress(), + ) + const upkeepAfter = (await registry.getUpkeep(upkeepId)).balance + const ownerAfter = await registry.linkAvailableForPayment() - await registry.connect(admin).pauseUpkeep(upkeepId) + // post upkeep balance should be previous balance minus cancellation fee + assert.isTrue(upkeepBefore.sub(cancellationFee).eq(upkeepAfter)) + // payee balance should not change + assert.isTrue(payee1Before.eq(payee1After)) + // owner should receive the cancellation fee + assert.isTrue(ownerAfter.sub(ownerBefore).eq(cancellationFee)) + }) - const tx = await registry.connect(admin).unpauseUpkeep(upkeepId) + it('deducts up to balance as cancellation fee', async () => { + // Very high min spend, should deduct whole balance as cancellation fees + const newMinUpkeepSpend = toWei('1000') + const financeAdminAddress = await financeAdmin.getAddress() - await expect(tx).to.emit(registry, 'UpkeepUnpaused').withArgs(upkeepId) + await registry.connect(owner).setConfigTypeSafe( + signerAddresses, + keeperAddresses, + f, + { + checkGasLimit, + stalenessSeconds, + gasCeilingMultiplier, + maxCheckDataSize, + maxPerformDataSize, + maxRevertDataSize, + maxPerformGas, + fallbackGasPrice, + fallbackLinkPrice, + fallbackNativePrice, + transcoder: transcoder.address, + registrars: [], + upkeepPrivilegeManager: upkeepManager, + chainModule: chainModuleBase.address, + reorgProtectionEnabled: true, + financeAdmin: financeAdminAddress, + }, + offchainVersion, + offchainBytes, + [linkToken.address], + [ + { + gasFeePPB: paymentPremiumPPB, + flatFeeMilliCents, + priceFeed: linkUSDFeed.address, + fallbackPrice: fallbackLinkPrice, + minSpend: newMinUpkeepSpend, + decimals: 18, + }, + ], + ) + const payee1Before = await linkToken.balanceOf( + await payee1.getAddress(), + ) + const upkeepBefore = (await registry.getUpkeep(upkeepId)).balance + const ownerBefore = await registry.linkAvailableForPayment() - const registration = await registry.getUpkeep(upkeepId) - assert.equal(registration.paused, false) + await registry.connect(admin).cancelUpkeep(upkeepId) + const payee1After = await linkToken.balanceOf( + await payee1.getAddress(), + ) + const ownerAfter = await registry.linkAvailableForPayment() + const upkeepAfter = (await registry.getUpkeep(upkeepId)).balance - const upkeepIds = await registry.getActiveUpkeepIDs(0, 0) - assert.equal(upkeepIds.length, originalCount) - }) - }) + // all upkeep balance is deducted for cancellation fee + assert.equal(upkeepAfter.toNumber(), 0) + // payee balance should not change + assert.isTrue(payee1After.eq(payee1Before)) + // all upkeep balance is transferred to the owner + assert.isTrue(ownerAfter.sub(ownerBefore).eq(upkeepBefore)) + }) - describe('#setUpkeepCheckData', () => { - it('reverts if the registration does not exist', async () => { - await evmRevertCustomError( - registry - .connect(keeper1) - .setUpkeepCheckData(upkeepId.add(1), randomBytes), - registry, - 'OnlyCallableByAdmin', - ) - }) - - it('reverts if the caller is not upkeep admin', async () => { - await evmRevertCustomError( - registry.connect(keeper1).setUpkeepCheckData(upkeepId, randomBytes), - registry, - 'OnlyCallableByAdmin', - ) - }) - - it('reverts if the upkeep is cancelled', async () => { - await registry.connect(admin).cancelUpkeep(upkeepId) - - await evmRevertCustomError( - registry.connect(admin).setUpkeepCheckData(upkeepId, randomBytes), - registry, - 'UpkeepCancelled', - ) - }) - - it('is allowed to update on paused upkeep', async () => { - await registry.connect(admin).pauseUpkeep(upkeepId) - await registry.connect(admin).setUpkeepCheckData(upkeepId, randomBytes) - - const registration = await registry.getUpkeep(upkeepId) - assert.equal(randomBytes, registration.checkData) - }) - - it('reverts if new data exceeds limit', async () => { - let longBytes = '0x' - for (let i = 0; i < 10000; i++) { - longBytes += '1' - } - - await evmRevertCustomError( - registry.connect(admin).setUpkeepCheckData(upkeepId, longBytes), - registry, - 'CheckDataExceedsLimit', - ) - }) - - it('updates the upkeep check data and emits an event', async () => { - const tx = await registry - .connect(admin) - .setUpkeepCheckData(upkeepId, randomBytes) - await expect(tx) - .to.emit(registry, 'UpkeepCheckDataSet') - .withArgs(upkeepId, randomBytes) - - const registration = await registry.getUpkeep(upkeepId) - assert.equal(randomBytes, registration.checkData) - }) - }) - - describe('#setUpkeepGasLimit', () => { - const newGasLimit = BigNumber.from('300000') - - it('reverts if the registration does not exist', async () => { - await evmRevertCustomError( - registry.connect(admin).setUpkeepGasLimit(upkeepId.add(1), newGasLimit), - registry, - 'OnlyCallableByAdmin', - ) - }) - - it('reverts if the upkeep is canceled', async () => { - await registry.connect(admin).cancelUpkeep(upkeepId) - await evmRevertCustomError( - registry.connect(admin).setUpkeepGasLimit(upkeepId, newGasLimit), - registry, - 'UpkeepCancelled', - ) - }) - - it('reverts if called by anyone but the admin', async () => { - await evmRevertCustomError( - registry.connect(owner).setUpkeepGasLimit(upkeepId, newGasLimit), - registry, - 'OnlyCallableByAdmin', - ) - }) - - it('reverts if new gas limit is out of bounds', async () => { - await evmRevertCustomError( - registry - .connect(admin) - .setUpkeepGasLimit(upkeepId, BigNumber.from('100')), - registry, - 'GasLimitOutsideRange', - ) - await evmRevertCustomError( - registry - .connect(admin) - .setUpkeepGasLimit(upkeepId, BigNumber.from('6000000')), - registry, - 'GasLimitOutsideRange', - ) - }) - - it('updates the gas limit successfully', async () => { - const initialGasLimit = (await registry.getUpkeep(upkeepId)).performGas - assert.equal(initialGasLimit, performGas.toNumber()) - await registry.connect(admin).setUpkeepGasLimit(upkeepId, newGasLimit) - const updatedGasLimit = (await registry.getUpkeep(upkeepId)).performGas - assert.equal(updatedGasLimit, newGasLimit.toNumber()) - }) - - it('emits a log', async () => { - const tx = await registry - .connect(admin) - .setUpkeepGasLimit(upkeepId, newGasLimit) - await expect(tx) - .to.emit(registry, 'UpkeepGasLimitSet') - .withArgs(upkeepId, newGasLimit) - }) - }) - - describe('#setUpkeepOffchainConfig', () => { - const newConfig = '0xc0ffeec0ffee' - - it('reverts if the registration does not exist', async () => { - await evmRevertCustomError( - registry - .connect(admin) - .setUpkeepOffchainConfig(upkeepId.add(1), newConfig), - registry, - 'OnlyCallableByAdmin', - ) - }) - - it('reverts if the upkeep is canceled', async () => { - await registry.connect(admin).cancelUpkeep(upkeepId) - await evmRevertCustomError( - registry.connect(admin).setUpkeepOffchainConfig(upkeepId, newConfig), - registry, - 'UpkeepCancelled', - ) - }) - - it('reverts if called by anyone but the admin', async () => { - await evmRevertCustomError( - registry.connect(owner).setUpkeepOffchainConfig(upkeepId, newConfig), - registry, - 'OnlyCallableByAdmin', - ) - }) - - it('updates the config successfully', async () => { - const initialConfig = (await registry.getUpkeep(upkeepId)).offchainConfig - assert.equal(initialConfig, '0x') - await registry.connect(admin).setUpkeepOffchainConfig(upkeepId, newConfig) - const updatedConfig = (await registry.getUpkeep(upkeepId)).offchainConfig - assert.equal(newConfig, updatedConfig) - }) - - it('emits a log', async () => { - const tx = await registry - .connect(admin) - .setUpkeepOffchainConfig(upkeepId, newConfig) - await expect(tx) - .to.emit(registry, 'UpkeepOffchainConfigSet') - .withArgs(upkeepId, newConfig) - }) - }) - - describe('#setUpkeepTriggerConfig', () => { - const newConfig = '0xdeadbeef' - - it('reverts if the registration does not exist', async () => { - await evmRevertCustomError( - registry - .connect(admin) - .setUpkeepTriggerConfig(upkeepId.add(1), newConfig), - registry, - 'OnlyCallableByAdmin', - ) - }) - - it('reverts if the upkeep is canceled', async () => { - await registry.connect(admin).cancelUpkeep(upkeepId) - await evmRevertCustomError( - registry.connect(admin).setUpkeepTriggerConfig(upkeepId, newConfig), - registry, - 'UpkeepCancelled', - ) - }) - - it('reverts if called by anyone but the admin', async () => { - await evmRevertCustomError( - registry.connect(owner).setUpkeepTriggerConfig(upkeepId, newConfig), - registry, - 'OnlyCallableByAdmin', - ) - }) - - it('emits a log', async () => { - const tx = await registry - .connect(admin) - .setUpkeepTriggerConfig(upkeepId, newConfig) - await expect(tx) - .to.emit(registry, 'UpkeepTriggerConfigSet') - .withArgs(upkeepId, newConfig) - }) - }) - - describe('#transferUpkeepAdmin', () => { - it('reverts when called by anyone but the current upkeep admin', async () => { - await evmRevertCustomError( - registry - .connect(payee1) - .transferUpkeepAdmin(upkeepId, await payee2.getAddress()), - registry, - 'OnlyCallableByAdmin', - ) - }) - - it('reverts when transferring to self', async () => { - await evmRevertCustomError( - registry - .connect(admin) - .transferUpkeepAdmin(upkeepId, await admin.getAddress()), - registry, - 'ValueNotChanged', - ) - }) - - it('reverts when the upkeep is cancelled', async () => { - await registry.connect(admin).cancelUpkeep(upkeepId) - - await evmRevertCustomError( - registry - .connect(admin) - .transferUpkeepAdmin(upkeepId, await keeper1.getAddress()), - registry, - 'UpkeepCancelled', - ) - }) - - it('allows cancelling transfer by reverting to zero address', async () => { - await registry - .connect(admin) - .transferUpkeepAdmin(upkeepId, await payee1.getAddress()) - const tx = await registry - .connect(admin) - .transferUpkeepAdmin(upkeepId, ethers.constants.AddressZero) - - await expect(tx) - .to.emit(registry, 'UpkeepAdminTransferRequested') - .withArgs( - upkeepId, - await admin.getAddress(), - ethers.constants.AddressZero, - ) - }) - - it('does not change the upkeep admin', async () => { - await registry - .connect(admin) - .transferUpkeepAdmin(upkeepId, await payee1.getAddress()) - - const upkeep = await registry.getUpkeep(upkeepId) - assert.equal(await admin.getAddress(), upkeep.admin) - }) - - it('emits an event announcing the new upkeep admin', async () => { - const tx = await registry - .connect(admin) - .transferUpkeepAdmin(upkeepId, await payee1.getAddress()) - - await expect(tx) - .to.emit(registry, 'UpkeepAdminTransferRequested') - .withArgs(upkeepId, await admin.getAddress(), await payee1.getAddress()) - }) - - it('does not emit an event when called with the same proposed upkeep admin', async () => { - await registry - .connect(admin) - .transferUpkeepAdmin(upkeepId, await payee1.getAddress()) - - const tx = await registry - .connect(admin) - .transferUpkeepAdmin(upkeepId, await payee1.getAddress()) - const receipt = await tx.wait() - assert.equal(receipt.logs.length, 0) - }) - }) - - describe('#acceptUpkeepAdmin', () => { - beforeEach(async () => { - // Start admin transfer to payee1 - await registry - .connect(admin) - .transferUpkeepAdmin(upkeepId, await payee1.getAddress()) - }) - - it('reverts when not called by the proposed upkeep admin', async () => { - await evmRevertCustomError( - registry.connect(payee2).acceptUpkeepAdmin(upkeepId), - registry, - 'OnlyCallableByProposedAdmin', - ) - }) - - it('reverts when the upkeep is cancelled', async () => { - await registry.connect(admin).cancelUpkeep(upkeepId) - - await evmRevertCustomError( - registry.connect(payee1).acceptUpkeepAdmin(upkeepId), - registry, - 'UpkeepCancelled', - ) - }) - - it('does change the admin', async () => { - await registry.connect(payee1).acceptUpkeepAdmin(upkeepId) - - const upkeep = await registry.getUpkeep(upkeepId) - assert.equal(await payee1.getAddress(), upkeep.admin) - }) - - it('emits an event announcing the new upkeep admin', async () => { - const tx = await registry.connect(payee1).acceptUpkeepAdmin(upkeepId) - await expect(tx) - .to.emit(registry, 'UpkeepAdminTransferred') - .withArgs(upkeepId, await admin.getAddress(), await payee1.getAddress()) - }) - }) - - describe('#withdrawOwnerFunds', () => { - it('can only be called by finance admin', async () => { - await evmRevertCustomError( - registry.connect(keeper1).withdrawLink(zeroAddress, 1), - registry, - 'OnlyFinanceAdmin', - ) - }) - - itMaybe('withdraws the collected fees to owner', async () => { - await registry.connect(admin).addFunds(upkeepId, toWei('100')) - const financeAdminAddress = await financeAdmin.getAddress() - // Very high min spend, whole balance as cancellation fees - const newMinUpkeepSpend = toWei('1000') - await registry.connect(owner).setConfigTypeSafe( - signerAddresses, - keeperAddresses, - f, - { - checkGasLimit, - stalenessSeconds, - gasCeilingMultiplier, - maxCheckDataSize, - maxPerformDataSize, - maxRevertDataSize, - maxPerformGas, - fallbackGasPrice, - fallbackLinkPrice, - fallbackNativePrice, - transcoder: transcoder.address, - registrars: [], - upkeepPrivilegeManager: upkeepManager, - chainModule: chainModuleBase.address, - reorgProtectionEnabled: true, - financeAdmin: financeAdminAddress, - }, - offchainVersion, - offchainBytes, - [linkToken.address], - [ - { - gasFeePPB: paymentPremiumPPB, - flatFeeMilliCents, - priceFeed: linkUSDFeed.address, - fallbackPrice: fallbackLinkPrice, - minSpend: newMinUpkeepSpend, - decimals: 18, - }, - ], - ) - const upkeepBalance = (await registry.getUpkeep(upkeepId)).balance - const ownerBefore = await linkToken.balanceOf(await owner.getAddress()) - - await registry.connect(owner).cancelUpkeep(upkeepId) - - // Transfered to owner balance on registry - let ownerRegistryBalance = await registry.linkAvailableForPayment() - assert.isTrue(ownerRegistryBalance.eq(upkeepBalance)) - - // Now withdraw - await registry - .connect(financeAdmin) - .withdrawLink(await owner.getAddress(), ownerRegistryBalance) - - ownerRegistryBalance = await registry.linkAvailableForPayment() - const ownerAfter = await linkToken.balanceOf(await owner.getAddress()) - - // Owner registry balance should be changed to 0 - assert.isTrue(ownerRegistryBalance.eq(BigNumber.from('0'))) - - // Owner should be credited with the balance - assert.isTrue(ownerBefore.add(upkeepBalance).eq(ownerAfter)) - }) - }) - - describe('#transferPayeeship', () => { - it('reverts when called by anyone but the current payee', async () => { - await evmRevertCustomError( - registry - .connect(payee2) - .transferPayeeship( - await keeper1.getAddress(), - await payee2.getAddress(), - ), - registry, - 'OnlyCallableByPayee', - ) - }) - - it('reverts when transferring to self', async () => { - await evmRevertCustomError( - registry - .connect(payee1) - .transferPayeeship( - await keeper1.getAddress(), - await payee1.getAddress(), - ), - registry, - 'ValueNotChanged', - ) - }) - - it('does not change the payee', async () => { - await registry - .connect(payee1) - .transferPayeeship( - await keeper1.getAddress(), - await payee2.getAddress(), - ) - - const info = await registry.getTransmitterInfo(await keeper1.getAddress()) - assert.equal(await payee1.getAddress(), info.payee) - }) - - it('emits an event announcing the new payee', async () => { - const tx = await registry - .connect(payee1) - .transferPayeeship( - await keeper1.getAddress(), - await payee2.getAddress(), - ) - await expect(tx) - .to.emit(registry, 'PayeeshipTransferRequested') - .withArgs( - await keeper1.getAddress(), - await payee1.getAddress(), - await payee2.getAddress(), - ) - }) - - it('does not emit an event when called with the same proposal', async () => { - await registry - .connect(payee1) - .transferPayeeship( - await keeper1.getAddress(), - await payee2.getAddress(), - ) - - const tx = await registry - .connect(payee1) - .transferPayeeship( - await keeper1.getAddress(), - await payee2.getAddress(), - ) - const receipt = await tx.wait() - assert.equal(receipt.logs.length, 0) - }) - }) - - describe('#acceptPayeeship', () => { - beforeEach(async () => { - await registry - .connect(payee1) - .transferPayeeship( - await keeper1.getAddress(), - await payee2.getAddress(), - ) - }) - - it('reverts when called by anyone but the proposed payee', async () => { - await evmRevertCustomError( - registry.connect(payee1).acceptPayeeship(await keeper1.getAddress()), - registry, - 'OnlyCallableByProposedPayee', - ) - }) - - it('emits an event announcing the new payee', async () => { - const tx = await registry - .connect(payee2) - .acceptPayeeship(await keeper1.getAddress()) - await expect(tx) - .to.emit(registry, 'PayeeshipTransferred') - .withArgs( - await keeper1.getAddress(), - await payee1.getAddress(), - await payee2.getAddress(), - ) - }) - - it('does change the payee', async () => { - await registry.connect(payee2).acceptPayeeship(await keeper1.getAddress()) - - const info = await registry.getTransmitterInfo(await keeper1.getAddress()) - assert.equal(await payee2.getAddress(), info.payee) - }) - }) - - describe('#pause', () => { - it('reverts if called by a non-owner', async () => { - await evmRevert( - registry.connect(keeper1).pause(), - 'Only callable by owner', - ) - }) - - it('marks the contract as paused', async () => { - assert.isFalse((await registry.getState()).state.paused) - - await registry.connect(owner).pause() - - assert.isTrue((await registry.getState()).state.paused) - }) - - it('Does not allow transmits when paused', async () => { - await registry.connect(owner).pause() - - await evmRevertCustomError( - getTransmitTx(registry, keeper1, [upkeepId]), - registry, - 'RegistryPaused', - ) - }) - - it('Does not allow creation of new upkeeps when paused', async () => { - await registry.connect(owner).pause() - - await evmRevertCustomError( - registry - .connect(owner) - .registerUpkeep( - mock.address, - performGas, - await admin.getAddress(), - Trigger.CONDITION, - linkToken.address, - '0x', - '0x', - '0x', - ), - registry, - 'RegistryPaused', - ) - }) - }) - - describe('#unpause', () => { - beforeEach(async () => { - await registry.connect(owner).pause() - }) - - it('reverts if called by a non-owner', async () => { - await evmRevert( - registry.connect(keeper1).unpause(), - 'Only callable by owner', - ) - }) - - it('marks the contract as not paused', async () => { - assert.isTrue((await registry.getState()).state.paused) - - await registry.connect(owner).unpause() - - assert.isFalse((await registry.getState()).state.paused) - }) - }) - - describe('#setPayees', () => { - const IGNORE_ADDRESS = '0xFFfFfFffFFfffFFfFFfFFFFFffFFFffffFfFFFfF' - - it('reverts when not called by the owner', async () => { - await evmRevert( - registry.connect(keeper1).setPayees(payees), - 'Only callable by owner', - ) - }) - - it('reverts with different numbers of payees than transmitters', async () => { - await evmRevertCustomError( - registry.connect(owner).setPayees([...payees, randomAddress()]), - registry, - 'ParameterLengthError', - ) - }) - - it('reverts if the payee is the zero address', async () => { - await blankRegistry.connect(owner).setConfigTypeSafe(...baseConfig) // used to test initial config - - await evmRevertCustomError( - blankRegistry // used to test initial config - .connect(owner) - .setPayees([ethers.constants.AddressZero, ...payees.slice(1)]), - registry, - 'InvalidPayee', - ) - }) - - itMaybe( - 'sets the payees when exisitng payees are zero address', - async () => { - //Initial payees should be zero address - await blankRegistry.connect(owner).setConfigTypeSafe(...baseConfig) // used to test initial config - - for (let i = 0; i < keeperAddresses.length; i++) { - const payee = ( - await blankRegistry.getTransmitterInfo(keeperAddresses[i]) - ).payee // used to test initial config - assert.equal(payee, zeroAddress) - } - - await blankRegistry.connect(owner).setPayees(payees) // used to test initial config - - for (let i = 0; i < keeperAddresses.length; i++) { - const payee = ( - await blankRegistry.getTransmitterInfo(keeperAddresses[i]) - ).payee - assert.equal(payee, payees[i]) - } - }, - ) - - it('does not change the payee if IGNORE_ADDRESS is used as payee', async () => { - const signers = Array.from({ length: 5 }, randomAddress) - const keepers = Array.from({ length: 5 }, randomAddress) - const payees = Array.from({ length: 5 }, randomAddress) - const newTransmitter = randomAddress() - const newPayee = randomAddress() - const ignoreAddresses = new Array(payees.length).fill(IGNORE_ADDRESS) - const newPayees = [...ignoreAddresses, newPayee] - // arbitrum registry - // configure registry with 5 keepers // optimism registry - await blankRegistry // used to test initial configurations - .connect(owner) - .setConfigTypeSafe( - signers, - keepers, - f, - config, - offchainVersion, - offchainBytes, - [], - [], - ) - // arbitrum registry - // set initial payees // optimism registry - await blankRegistry.connect(owner).setPayees(payees) // used to test initial configurations - // arbitrum registry - // add another keeper // optimism registry - await blankRegistry // used to test initial configurations - .connect(owner) - .setConfigTypeSafe( - [...signers, randomAddress()], - [...keepers, newTransmitter], - f, - config, - offchainVersion, - offchainBytes, - [], - [], - ) - // arbitrum registry - // update payee list // optimism registry // arbitrum registry - await blankRegistry.connect(owner).setPayees(newPayees) // used to test initial configurations // optimism registry - const ignored = await blankRegistry.getTransmitterInfo(newTransmitter) // used to test initial configurations - assert.equal(newPayee, ignored.payee) - assert.equal(ignored.active, true) - }) - - it('reverts if payee is non zero and owner tries to change payee', async () => { - const newPayees = [randomAddress(), ...payees.slice(1)] - - await evmRevertCustomError( - registry.connect(owner).setPayees(newPayees), - registry, - 'InvalidPayee', - ) - }) - - it('emits events for every payee added and removed', async () => { - const tx = await registry.connect(owner).setPayees(payees) - await expect(tx) - .to.emit(registry, 'PayeesUpdated') - .withArgs(keeperAddresses, payees) - }) - }) - - describe('#cancelUpkeep', () => { - it('reverts if the ID is not valid', async () => { - await evmRevertCustomError( - registry.connect(owner).cancelUpkeep(upkeepId.add(1)), - registry, - 'CannotCancel', - ) - }) - - it('reverts if called by a non-owner/non-admin', async () => { - await evmRevertCustomError( - registry.connect(keeper1).cancelUpkeep(upkeepId), - registry, - 'OnlyCallableByOwnerOrAdmin', - ) - }) - - describe('when called by the owner', async () => { - it('sets the registration to invalid immediately', async () => { - const tx = await registry.connect(owner).cancelUpkeep(upkeepId) - const receipt = await tx.wait() - const registration = await registry.getUpkeep(upkeepId) - assert.equal( - registration.maxValidBlocknumber.toNumber(), - receipt.blockNumber, - ) - }) - - it('emits an event', async () => { - const tx = await registry.connect(owner).cancelUpkeep(upkeepId) - const receipt = await tx.wait() - await expect(tx) - .to.emit(registry, 'UpkeepCanceled') - .withArgs(upkeepId, BigNumber.from(receipt.blockNumber)) - }) - - it('immediately prevents upkeep', async () => { - await registry.connect(owner).cancelUpkeep(upkeepId) - - const tx = await getTransmitTx(registry, keeper1, [upkeepId]) - const receipt = await tx.wait() - const cancelledUpkeepReportLogs = - parseCancelledUpkeepReportLogs(receipt) - // exactly 1 CancelledUpkeepReport log should be emitted - assert.equal(cancelledUpkeepReportLogs.length, 1) - }) - - it('does not revert if reverts if called multiple times', async () => { - await registry.connect(owner).cancelUpkeep(upkeepId) - await evmRevertCustomError( - registry.connect(owner).cancelUpkeep(upkeepId), - registry, - 'UpkeepCancelled', - ) - }) - - describe('when called by the owner when the admin has just canceled', () => { - // eslint-disable-next-line @typescript-eslint/no-unused-vars - // @ts-ignore - let oldExpiration: BigNumber - - beforeEach(async () => { - await registry.connect(admin).cancelUpkeep(upkeepId) - const registration = await registry.getUpkeep(upkeepId) - oldExpiration = registration.maxValidBlocknumber - }) - - it('reverts with proper error', async () => { - await evmRevertCustomError( - registry.connect(owner).cancelUpkeep(upkeepId), - registry, - 'UpkeepCancelled', - ) - }) - }) - }) - - describe('when called by the admin', async () => { - it('reverts if called again by the admin', async () => { - await registry.connect(admin).cancelUpkeep(upkeepId) - - await evmRevertCustomError( - registry.connect(admin).cancelUpkeep(upkeepId), - registry, - 'UpkeepCancelled', - ) - }) - - it('reverts if called by the owner after the timeout', async () => { - await registry.connect(admin).cancelUpkeep(upkeepId) - - for (let i = 0; i < cancellationDelay; i++) { - await ethers.provider.send('evm_mine', []) - } - - await evmRevertCustomError( - registry.connect(owner).cancelUpkeep(upkeepId), - registry, - 'UpkeepCancelled', - ) - }) - - it('sets the registration to invalid in 50 blocks', async () => { - const tx = await registry.connect(admin).cancelUpkeep(upkeepId) - const receipt = await tx.wait() - const registration = await registry.getUpkeep(upkeepId) - assert.equal( - registration.maxValidBlocknumber.toNumber(), - receipt.blockNumber + 50, - ) - }) - - it('emits an event', async () => { - const tx = await registry.connect(admin).cancelUpkeep(upkeepId) - const receipt = await tx.wait() - await expect(tx) - .to.emit(registry, 'UpkeepCanceled') - .withArgs( - upkeepId, - BigNumber.from(receipt.blockNumber + cancellationDelay), - ) - }) - - it('immediately prevents upkeep', async () => { - await linkToken.connect(owner).approve(registry.address, toWei('100')) - await registry.connect(owner).addFunds(upkeepId, toWei('100')) - await registry.connect(admin).cancelUpkeep(upkeepId) - - await getTransmitTx(registry, keeper1, [upkeepId]) - - for (let i = 0; i < cancellationDelay; i++) { - await ethers.provider.send('evm_mine', []) - } - - const tx = await getTransmitTx(registry, keeper1, [upkeepId]) - - const receipt = await tx.wait() - const cancelledUpkeepReportLogs = - parseCancelledUpkeepReportLogs(receipt) - // exactly 1 CancelledUpkeepReport log should be emitted - assert.equal(cancelledUpkeepReportLogs.length, 1) - }) - - describeMaybe('when an upkeep has been performed', async () => { - beforeEach(async () => { - await linkToken.connect(owner).approve(registry.address, toWei('100')) - await registry.connect(owner).addFunds(upkeepId, toWei('100')) - await getTransmitTx(registry, keeper1, [upkeepId]) - }) - - it('deducts a cancellation fee from the upkeep and adds to reserve', async () => { - const newMinUpkeepSpend = toWei('10') - const financeAdminAddress = await financeAdmin.getAddress() - - await registry.connect(owner).setConfigTypeSafe( - signerAddresses, - keeperAddresses, - f, - { - checkGasLimit, - stalenessSeconds, - gasCeilingMultiplier, - maxCheckDataSize, - maxPerformDataSize, - maxRevertDataSize, - maxPerformGas, - fallbackGasPrice, - fallbackLinkPrice, - fallbackNativePrice, - transcoder: transcoder.address, - registrars: [], - upkeepPrivilegeManager: upkeepManager, - chainModule: chainModuleBase.address, - reorgProtectionEnabled: true, - financeAdmin: financeAdminAddress, - }, - offchainVersion, - offchainBytes, - [linkToken.address], - [ - { - gasFeePPB: paymentPremiumPPB, - flatFeeMilliCents, - priceFeed: linkUSDFeed.address, - fallbackPrice: fallbackLinkPrice, - minSpend: newMinUpkeepSpend, - decimals: 18, - }, - ], - ) - - const payee1Before = await linkToken.balanceOf( - await payee1.getAddress(), - ) - const upkeepBefore = (await registry.getUpkeep(upkeepId)).balance - const ownerBefore = await registry.linkAvailableForPayment() - - const amountSpent = toWei('100').sub(upkeepBefore) - const cancellationFee = newMinUpkeepSpend.sub(amountSpent) - - await registry.connect(admin).cancelUpkeep(upkeepId) - - const payee1After = await linkToken.balanceOf( - await payee1.getAddress(), - ) - const upkeepAfter = (await registry.getUpkeep(upkeepId)).balance - const ownerAfter = await registry.linkAvailableForPayment() - - // post upkeep balance should be previous balance minus cancellation fee - assert.isTrue(upkeepBefore.sub(cancellationFee).eq(upkeepAfter)) - // payee balance should not change - assert.isTrue(payee1Before.eq(payee1After)) - // owner should receive the cancellation fee - assert.isTrue(ownerAfter.sub(ownerBefore).eq(cancellationFee)) - }) - - it('deducts up to balance as cancellation fee', async () => { - // Very high min spend, should deduct whole balance as cancellation fees - const newMinUpkeepSpend = toWei('1000') - const financeAdminAddress = await financeAdmin.getAddress() - - await registry.connect(owner).setConfigTypeSafe( - signerAddresses, - keeperAddresses, - f, - { - checkGasLimit, - stalenessSeconds, - gasCeilingMultiplier, - maxCheckDataSize, - maxPerformDataSize, - maxRevertDataSize, - maxPerformGas, - fallbackGasPrice, - fallbackLinkPrice, - fallbackNativePrice, - transcoder: transcoder.address, - registrars: [], - upkeepPrivilegeManager: upkeepManager, - chainModule: chainModuleBase.address, - reorgProtectionEnabled: true, - financeAdmin: financeAdminAddress, - }, - offchainVersion, - offchainBytes, - [linkToken.address], - [ - { - gasFeePPB: paymentPremiumPPB, - flatFeeMilliCents, - priceFeed: linkUSDFeed.address, - fallbackPrice: fallbackLinkPrice, - minSpend: newMinUpkeepSpend, - decimals: 18, - }, - ], - ) - const payee1Before = await linkToken.balanceOf( - await payee1.getAddress(), - ) - const upkeepBefore = (await registry.getUpkeep(upkeepId)).balance - const ownerBefore = await registry.linkAvailableForPayment() - - await registry.connect(admin).cancelUpkeep(upkeepId) - const payee1After = await linkToken.balanceOf( - await payee1.getAddress(), - ) - const ownerAfter = await registry.linkAvailableForPayment() - const upkeepAfter = (await registry.getUpkeep(upkeepId)).balance - - // all upkeep balance is deducted for cancellation fee - assert.equal(upkeepAfter.toNumber(), 0) - // payee balance should not change - assert.isTrue(payee1After.eq(payee1Before)) - // all upkeep balance is transferred to the owner - assert.isTrue(ownerAfter.sub(ownerBefore).eq(upkeepBefore)) - }) - - it('does not deduct cancellation fee if more than minUpkeepSpendDollars is spent', async () => { - // Very low min spend, already spent in one perform upkeep - const newMinUpkeepSpend = BigNumber.from(420) - const financeAdminAddress = await financeAdmin.getAddress() + it('does not deduct cancellation fee if more than minUpkeepSpendDollars is spent', async () => { + // Very low min spend, already spent in one perform upkeep + const newMinUpkeepSpend = BigNumber.from(420) + const financeAdminAddress = await financeAdmin.getAddress() await registry.connect(owner).setConfigTypeSafe( signerAddresses, @@ -5595,62 +4556,6 @@ describe('AutomationRegistry2_3', () => { }) }) - describe('#setUpkeepPrivilegeConfig() / #getUpkeepPrivilegeConfig()', () => { - it('reverts when non manager tries to set privilege config', async () => { - await evmRevertCustomError( - registry.connect(payee3).setUpkeepPrivilegeConfig(upkeepId, '0x1234'), - registry, - 'OnlyCallableByUpkeepPrivilegeManager', - ) - }) - - it('returns empty bytes for upkeep privilege config before setting', async () => { - const cfg = await registry.getUpkeepPrivilegeConfig(upkeepId) - assert.equal(cfg, '0x') - }) - - it('allows upkeep manager to set privilege config', async () => { - const tx = await registry - .connect(personas.Norbert) - .setUpkeepPrivilegeConfig(upkeepId, '0x1234') - await expect(tx) - .to.emit(registry, 'UpkeepPrivilegeConfigSet') - .withArgs(upkeepId, '0x1234') - - const cfg = await registry.getUpkeepPrivilegeConfig(upkeepId) - assert.equal(cfg, '0x1234') - }) - }) - - describe('#setAdminPrivilegeConfig() / #getAdminPrivilegeConfig()', () => { - const admin = randomAddress() - - it('reverts when non manager tries to set privilege config', async () => { - await evmRevertCustomError( - registry.connect(payee3).setAdminPrivilegeConfig(admin, '0x1234'), - registry, - 'OnlyCallableByUpkeepPrivilegeManager', - ) - }) - - it('returns empty bytes for upkeep privilege config before setting', async () => { - const cfg = await registry.getAdminPrivilegeConfig(admin) - assert.equal(cfg, '0x') - }) - - it('allows upkeep manager to set privilege config', async () => { - const tx = await registry - .connect(personas.Norbert) - .setAdminPrivilegeConfig(admin, '0x1234') - await expect(tx) - .to.emit(registry, 'AdminPrivilegeConfigSet') - .withArgs(admin, '0x1234') - - const cfg = await registry.getAdminPrivilegeConfig(admin) - assert.equal(cfg, '0x1234') - }) - }) - describe('transmitterPremiumSplit [ @skip-coverage ]', () => { beforeEach(async () => { await linkToken.connect(owner).approve(registry.address, toWei('100')) diff --git a/contracts/test/v0.8/automation/IAutomationRegistryMaster2_2.test.ts b/contracts/test/v0.8/automation/IAutomationRegistryMaster2_2.test.ts index 0c1e34a1167..11da7273ab9 100644 --- a/contracts/test/v0.8/automation/IAutomationRegistryMaster2_2.test.ts +++ b/contracts/test/v0.8/automation/IAutomationRegistryMaster2_2.test.ts @@ -93,7 +93,8 @@ describe('IAutomationRegistryMaster2_2', () => { ) }) - it('satisfies the OCR2Abstract interface', async () => { + // temporarily disable this test due to this update: https://github.com/smartcontractkit/chainlink/pull/14369/files#diff-6e79d46ea0ef204dea679ffd2a9f4dfccd090d8f405ba2d9bffad527d7b862c6L44 + it.skip('satisfies the OCR2Abstract interface', async () => { assertSatisfiesInterface( IAutomationRegistryMasterFactory.abi, OCR2AbstractFactory.abi, diff --git a/contracts/test/v0.8/automation/IAutomationRegistryMaster2_3.test.ts b/contracts/test/v0.8/automation/IAutomationRegistryMaster2_3.test.ts index 8bc4f695672..44fa277b5e1 100644 --- a/contracts/test/v0.8/automation/IAutomationRegistryMaster2_3.test.ts +++ b/contracts/test/v0.8/automation/IAutomationRegistryMaster2_3.test.ts @@ -87,7 +87,8 @@ describe('IAutomationRegistryMaster2_3', () => { ) }) - it('satisfies the OCR2Abstract interface', async () => { + // temporarily disable this test due to this update: https://github.com/smartcontractkit/chainlink/pull/14369/files#diff-6e79d46ea0ef204dea679ffd2a9f4dfccd090d8f405ba2d9bffad527d7b862c6L44 + it.skip('satisfies the OCR2Abstract interface', async () => { assertSatisfiesInterface( IAutomationRegistryMasterFactory.abi, OCR2AbstractFactory.abi, diff --git a/contracts/test/v0.8/automation/ZKSyncAutomationRegistry2_3.test.ts b/contracts/test/v0.8/automation/ZKSyncAutomationRegistry2_3.test.ts new file mode 100644 index 00000000000..95210cf6444 --- /dev/null +++ b/contracts/test/v0.8/automation/ZKSyncAutomationRegistry2_3.test.ts @@ -0,0 +1,4403 @@ +import { ethers } from 'hardhat' +import { loadFixture } from '@nomicfoundation/hardhat-network-helpers' +import { assert, expect } from 'chai' +import { + BigNumber, + BigNumberish, + BytesLike, + Contract, + ContractFactory, + ContractReceipt, + ContractTransaction, + Signer, + Wallet, +} from 'ethers' +import { evmRevert, evmRevertCustomError } from '../../test-helpers/matchers' +import { getUsers, Personas } from '../../test-helpers/setup' +import { randomAddress, toWei } from '../../test-helpers/helpers' +import { StreamsLookupUpkeep__factory as StreamsLookupUpkeepFactory } from '../../../typechain/factories/StreamsLookupUpkeep__factory' +import { MockV3Aggregator__factory as MockV3AggregatorFactory } from '../../../typechain/factories/MockV3Aggregator__factory' +import { UpkeepMock__factory as UpkeepMockFactory } from '../../../typechain/factories/UpkeepMock__factory' +import { UpkeepAutoFunder__factory as UpkeepAutoFunderFactory } from '../../../typechain/factories/UpkeepAutoFunder__factory' +import { MockZKSyncSystemContext__factory as MockZKSyncSystemContextFactory } from '../../../typechain/factories/MockZKSyncSystemContext__factory' +import { ChainModuleBase__factory as ChainModuleBaseFactory } from '../../../typechain/factories/ChainModuleBase__factory' +import { MockGasBoundCaller__factory as MockGasBoundCallerFactory } from '../../../typechain/factories/MockGasBoundCaller__factory' +import { ILogAutomation__factory as ILogAutomationactory } from '../../../typechain/factories/ILogAutomation__factory' +import { AutomationCompatibleUtils } from '../../../typechain/AutomationCompatibleUtils' +import { StreamsLookupUpkeep } from '../../../typechain/StreamsLookupUpkeep' +import { MockV3Aggregator } from '../../../typechain/MockV3Aggregator' +import { MockGasBoundCaller } from '../../../typechain/MockGasBoundCaller' +import { UpkeepMock } from '../../../typechain/UpkeepMock' +import { ChainModuleBase } from '../../../typechain/ChainModuleBase' +import { UpkeepTranscoder } from '../../../typechain/UpkeepTranscoder' +import { MockZKSyncSystemContext } from '../../../typechain/MockZKSyncSystemContext' +import { IChainModule, UpkeepAutoFunder } from '../../../typechain' +import { + CancelledUpkeepReportEvent, + IAutomationRegistryMaster2_3 as IAutomationRegistry, + ReorgedUpkeepReportEvent, + StaleUpkeepReportEvent, + UpkeepPerformedEvent, +} from '../../../typechain/IAutomationRegistryMaster2_3' +import { + deployMockContract, + MockContract, +} from '@ethereum-waffle/mock-contract' +import { deployZKSyncRegistry23 } from './helpers' +import { AutomationUtils2_3 } from '../../../typechain/AutomationUtils2_3' + +const describeMaybe = process.env.SKIP_SLOW ? describe.skip : describe +const itMaybe = process.env.SKIP_SLOW ? it.skip : it + +// copied from AutomationRegistryInterface2_3.sol +enum UpkeepFailureReason { + NONE, + UPKEEP_CANCELLED, + UPKEEP_PAUSED, + TARGET_CHECK_REVERTED, + UPKEEP_NOT_NEEDED, + PERFORM_DATA_EXCEEDS_LIMIT, + INSUFFICIENT_BALANCE, + CHECK_CALLBACK_REVERTED, + REVERT_DATA_EXCEEDS_LIMIT, + REGISTRY_PAUSED, +} + +// copied from AutomationRegistryBase2_3.sol +enum Trigger { + CONDITION, + LOG, +} + +// un-exported types that must be extracted from the utils contract +type Report = Parameters[0] +type LogTrigger = Parameters[0] +type ConditionalTrigger = Parameters< + AutomationCompatibleUtils['_conditionalTrigger'] +>[0] +type Log = Parameters[0] +type OnChainConfig = Parameters[3] + +// ----------------------------------------------------------------------------------------------- + +// These values should match the constants declared in registry +let registryConditionalOverhead: BigNumber +let registryLogOverhead: BigNumber +let registryPerSignerGasOverhead: BigNumber +// let registryPerPerformByteGasOverhead: BigNumber +// let registryTransmitCalldataFixedBytesOverhead: BigNumber +// let registryTransmitCalldataPerSignerBytesOverhead: BigNumber +let cancellationDelay: number + +// This is the margin for gas that we test for. Gas charged should always be greater +// than total gas used in tx but should not increase beyond this margin +// const gasCalculationMargin = BigNumber.from(50_000) +// This is the margin for gas overhead estimation in checkUpkeep. The estimated gas +// overhead should be larger than actual gas overhead but should not increase beyond this margin +// const gasEstimationMargin = BigNumber.from(50_000) + +// 1 Link = 0.005 Eth +const linkUSD = BigNumber.from('2000000000') // 1 LINK = $20 +const nativeUSD = BigNumber.from('400000000000') // 1 ETH = $4000 +const gasWei = BigNumber.from(1000000000) // 1 gwei +// ----------------------------------------------------------------------------------------------- +// test-wide configs for upkeeps +const performGas = BigNumber.from('1000000') +const paymentPremiumBase = BigNumber.from('1000000000') +const paymentPremiumPPB = BigNumber.from('250000000') +const flatFeeMilliCents = BigNumber.from(0) + +const randomBytes = '0x1234abcd' +const emptyBytes = '0x' +const emptyBytes32 = + '0x0000000000000000000000000000000000000000000000000000000000000000' + +const pubdataGas = BigNumber.from(500000) +const transmitGasOverhead = 1_040_000 +const checkGasOverhead = 600_000 + +const stalenessSeconds = BigNumber.from(43820) +const gasCeilingMultiplier = BigNumber.from(2) +const checkGasLimit = BigNumber.from(10000000) +const fallbackGasPrice = gasWei.mul(BigNumber.from('2')) +const fallbackLinkPrice = linkUSD.div(BigNumber.from('2')) +const fallbackNativePrice = nativeUSD.div(BigNumber.from('2')) +const maxCheckDataSize = BigNumber.from(1000) +const maxPerformDataSize = BigNumber.from(1000) +const maxRevertDataSize = BigNumber.from(1000) +const maxPerformGas = BigNumber.from(5000000) +const minUpkeepSpend = BigNumber.from(0) +const f = 1 +const offchainVersion = 1 +const offchainBytes = '0x' +const zeroAddress = ethers.constants.AddressZero +const wrappedNativeTokenAddress = '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2' +const epochAndRound5_1 = + '0x0000000000000000000000000000000000000000000000000000000000000501' + +let logTriggerConfig: string + +// ----------------------------------------------------------------------------------------------- + +// Smart contract factories +let linkTokenFactory: ContractFactory +let mockV3AggregatorFactory: MockV3AggregatorFactory +let mockGasBoundCallerFactory: MockGasBoundCallerFactory +let upkeepMockFactory: UpkeepMockFactory +let upkeepAutoFunderFactory: UpkeepAutoFunderFactory +let moduleBaseFactory: ChainModuleBaseFactory +let mockZKSyncSystemContextFactory: MockZKSyncSystemContextFactory +let streamsLookupUpkeepFactory: StreamsLookupUpkeepFactory +let personas: Personas + +// contracts +let linkToken: Contract +let linkUSDFeed: MockV3Aggregator +let nativeUSDFeed: MockV3Aggregator +let gasPriceFeed: MockV3Aggregator +let registry: IAutomationRegistry // default registry, used for most tests +let mgRegistry: IAutomationRegistry // "migrate registry" used in migration tests +let mock: UpkeepMock +let autoFunderUpkeep: UpkeepAutoFunder +let ltUpkeep: MockContract +let transcoder: UpkeepTranscoder +let moduleBase: ChainModuleBase +let mockGasBoundCaller: MockGasBoundCaller +let mockZKSyncSystemContext: MockZKSyncSystemContext +let streamsLookupUpkeep: StreamsLookupUpkeep +let automationUtils: AutomationCompatibleUtils +let automationUtils2_3: AutomationUtils2_3 + +function now() { + return Math.floor(Date.now() / 1000) +} + +async function getUpkeepID(tx: ContractTransaction): Promise { + const receipt = await tx.wait() + for (const event of receipt.events || []) { + if ( + event.args && + event.eventSignature == 'UpkeepRegistered(uint256,uint32,address)' + ) { + return event.args[0] + } + } + throw new Error('could not find upkeep ID in tx event logs') +} + +const getTriggerType = (upkeepId: BigNumber): Trigger => { + const hexBytes = ethers.utils.defaultAbiCoder.encode(['uint256'], [upkeepId]) + const bytes = ethers.utils.arrayify(hexBytes) + for (let idx = 4; idx < 15; idx++) { + if (bytes[idx] != 0) { + return Trigger.CONDITION + } + } + return bytes[15] as Trigger +} + +const encodeBlockTrigger = (conditionalTrigger: ConditionalTrigger) => { + return ( + '0x' + + automationUtils.interface + .encodeFunctionData('_conditionalTrigger', [conditionalTrigger]) + .slice(10) + ) +} + +const encodeLogTrigger = (logTrigger: LogTrigger) => { + return ( + '0x' + + automationUtils.interface + .encodeFunctionData('_logTrigger', [logTrigger]) + .slice(10) + ) +} + +const encodeLog = (log: Log) => { + return ( + '0x' + automationUtils.interface.encodeFunctionData('_log', [log]).slice(10) + ) +} + +const encodeReport = (report: Report) => { + return ( + '0x' + + automationUtils2_3.interface + .encodeFunctionData('_report', [report]) + .slice(10) + ) +} + +type UpkeepData = { + Id: BigNumberish + performGas: BigNumberish + performData: BytesLike + trigger: BytesLike +} + +const makeReport = (upkeeps: UpkeepData[]) => { + const upkeepIds = upkeeps.map((u) => u.Id) + const performGases = upkeeps.map((u) => u.performGas) + const triggers = upkeeps.map((u) => u.trigger) + const performDatas = upkeeps.map((u) => u.performData) + return encodeReport({ + fastGasWei: gasWei, + linkUSD, + upkeepIds, + gasLimits: performGases, + triggers, + performDatas, + }) +} + +const makeLatestBlockReport = async (upkeepsIDs: BigNumberish[]) => { + const latestBlock = await ethers.provider.getBlock('latest') + const upkeeps: UpkeepData[] = [] + for (let i = 0; i < upkeepsIDs.length; i++) { + upkeeps.push({ + Id: upkeepsIDs[i], + performGas, + trigger: encodeBlockTrigger({ + blockNum: latestBlock.number, + blockHash: latestBlock.hash, + }), + performData: '0x', + }) + } + return makeReport(upkeeps) +} + +const signReport = ( + reportContext: string[], + report: any, + signers: Wallet[], +) => { + const reportDigest = ethers.utils.keccak256(report) + const packedArgs = ethers.utils.solidityPack( + ['bytes32', 'bytes32[3]'], + [reportDigest, reportContext], + ) + const packedDigest = ethers.utils.keccak256(packedArgs) + + const signatures = [] + for (const signer of signers) { + signatures.push(signer._signingKey().signDigest(packedDigest)) + } + const vs = signatures.map((i) => '0' + (i.v - 27).toString(16)).join('') + return { + vs: '0x' + vs.padEnd(64, '0'), + rs: signatures.map((i) => i.r), + ss: signatures.map((i) => i.s), + } +} + +const parseUpkeepPerformedLogs = (receipt: ContractReceipt) => { + const parsedLogs = [] + for (const rawLog of receipt.logs) { + try { + const log = registry.interface.parseLog(rawLog) + if ( + log.name == + registry.interface.events[ + 'UpkeepPerformed(uint256,bool,uint96,uint256,uint256,bytes)' + ].name + ) { + parsedLogs.push(log as unknown as UpkeepPerformedEvent) + } + } catch { + continue + } + } + return parsedLogs +} + +const parseReorgedUpkeepReportLogs = (receipt: ContractReceipt) => { + const parsedLogs = [] + for (const rawLog of receipt.logs) { + try { + const log = registry.interface.parseLog(rawLog) + if ( + log.name == + registry.interface.events['ReorgedUpkeepReport(uint256,bytes)'].name + ) { + parsedLogs.push(log as unknown as ReorgedUpkeepReportEvent) + } + } catch { + continue + } + } + return parsedLogs +} + +const parseStaleUpkeepReportLogs = (receipt: ContractReceipt) => { + const parsedLogs = [] + for (const rawLog of receipt.logs) { + try { + const log = registry.interface.parseLog(rawLog) + if ( + log.name == + registry.interface.events['StaleUpkeepReport(uint256,bytes)'].name + ) { + parsedLogs.push(log as unknown as StaleUpkeepReportEvent) + } + } catch { + continue + } + } + return parsedLogs +} + +const parseCancelledUpkeepReportLogs = (receipt: ContractReceipt) => { + const parsedLogs = [] + for (const rawLog of receipt.logs) { + try { + const log = registry.interface.parseLog(rawLog) + if ( + log.name == + registry.interface.events['CancelledUpkeepReport(uint256,bytes)'].name + ) { + parsedLogs.push(log as unknown as CancelledUpkeepReportEvent) + } + } catch { + continue + } + } + return parsedLogs +} + +describe('ZKSyncAutomationRegistry2_3', () => { + let owner: Signer + let keeper1: Signer + let keeper2: Signer + let keeper3: Signer + let keeper4: Signer + let keeper5: Signer + let nonkeeper: Signer + let signer1: Wallet + let signer2: Wallet + let signer3: Wallet + let signer4: Wallet + let signer5: Wallet + let admin: Signer + let payee1: Signer + let payee2: Signer + let payee3: Signer + let payee4: Signer + let payee5: Signer + let financeAdmin: Signer + + let upkeepId: BigNumber // conditional upkeep + let afUpkeepId: BigNumber // auto funding upkeep + let logUpkeepId: BigNumber // log trigger upkeepID + let streamsLookupUpkeepId: BigNumber // streams lookup upkeep + // const numUpkeeps = 4 // see above + let keeperAddresses: string[] + let payees: string[] + let signers: Wallet[] + let signerAddresses: string[] + let config: OnChainConfig + let baseConfig: Parameters + let upkeepManager: string + + before(async () => { + personas = (await getUsers()).personas + + const compatibleUtilsFactory = await ethers.getContractFactory( + 'AutomationCompatibleUtils', + ) + automationUtils = await compatibleUtilsFactory.deploy() + + const utilsFactory = await ethers.getContractFactory('AutomationUtils2_3') + automationUtils2_3 = await utilsFactory.deploy() + + linkTokenFactory = await ethers.getContractFactory( + 'src/v0.8/shared/test/helpers/LinkTokenTestHelper.sol:LinkTokenTestHelper', + ) + // need full path because there are two contracts with name MockV3Aggregator + mockV3AggregatorFactory = (await ethers.getContractFactory( + 'src/v0.8/tests/MockV3Aggregator.sol:MockV3Aggregator', + )) as unknown as MockV3AggregatorFactory + mockZKSyncSystemContextFactory = await ethers.getContractFactory( + 'MockZKSyncSystemContext', + ) + mockGasBoundCallerFactory = + await ethers.getContractFactory('MockGasBoundCaller') + upkeepMockFactory = await ethers.getContractFactory('UpkeepMock') + upkeepAutoFunderFactory = + await ethers.getContractFactory('UpkeepAutoFunder') + moduleBaseFactory = await ethers.getContractFactory('ChainModuleBase') + streamsLookupUpkeepFactory = await ethers.getContractFactory( + 'StreamsLookupUpkeep', + ) + + owner = personas.Default + keeper1 = personas.Carol + keeper2 = personas.Eddy + keeper3 = personas.Nancy + keeper4 = personas.Norbert + keeper5 = personas.Nick + nonkeeper = personas.Ned + admin = personas.Neil + payee1 = personas.Nelly + payee2 = personas.Norbert + payee3 = personas.Nick + payee4 = personas.Eddy + payee5 = personas.Carol + upkeepManager = await personas.Norbert.getAddress() + financeAdmin = personas.Nick + // signers + signer1 = new ethers.Wallet( + '0x7777777000000000000000000000000000000000000000000000000000000001', + ) + signer2 = new ethers.Wallet( + '0x7777777000000000000000000000000000000000000000000000000000000002', + ) + signer3 = new ethers.Wallet( + '0x7777777000000000000000000000000000000000000000000000000000000003', + ) + signer4 = new ethers.Wallet( + '0x7777777000000000000000000000000000000000000000000000000000000004', + ) + signer5 = new ethers.Wallet( + '0x7777777000000000000000000000000000000000000000000000000000000005', + ) + + keeperAddresses = [ + await keeper1.getAddress(), + await keeper2.getAddress(), + await keeper3.getAddress(), + await keeper4.getAddress(), + await keeper5.getAddress(), + ] + payees = [ + await payee1.getAddress(), + await payee2.getAddress(), + await payee3.getAddress(), + await payee4.getAddress(), + await payee5.getAddress(), + ] + signers = [signer1, signer2, signer3, signer4, signer5] + + // We append 26 random addresses to keepers, payees and signers to get a system of 31 oracles + // This allows f value of 1 - 10 + for (let i = 0; i < 26; i++) { + keeperAddresses.push(randomAddress()) + payees.push(randomAddress()) + signers.push(ethers.Wallet.createRandom()) + } + signerAddresses = [] + for (const signer of signers) { + signerAddresses.push(await signer.getAddress()) + } + + logTriggerConfig = + '0x' + + automationUtils.interface + .encodeFunctionData('_logTriggerConfig', [ + { + contractAddress: randomAddress(), + filterSelector: 0, + topic0: ethers.utils.randomBytes(32), + topic1: ethers.utils.randomBytes(32), + topic2: ethers.utils.randomBytes(32), + topic3: ethers.utils.randomBytes(32), + }, + ]) + .slice(10) + }) + + // This function is similar to registry's _calculatePaymentAmount + // It uses global fastGasWei, linkEth, and assumes isExecution = false (gasFee = fastGasWei*multiplier) + // rest of the parameters are the same + const linkForGas = ( + upkeepGasSpent: BigNumber, + gasOverhead: BigNumber, + gasMultiplier: BigNumber, + premiumPPB: BigNumber, + flatFee: BigNumber, // in millicents + ) => { + const gasSpent = gasOverhead.add(BigNumber.from(upkeepGasSpent)) + const gasPayment = gasWei + .mul(gasMultiplier) + .mul(gasSpent) + .mul(nativeUSD) + .div(linkUSD) + + const premium = gasWei + .mul(gasMultiplier) + .mul(upkeepGasSpent) + .mul(premiumPPB) + .mul(nativeUSD) + .div(paymentPremiumBase) + .add(flatFee.mul(BigNumber.from(10).pow(21))) + .div(linkUSD) + + return { + total: gasPayment.add(premium), + gasPayment, + premium, + } + } + + const verifyMaxPayment = async ( + registry: IAutomationRegistry, + chainModule: IChainModule, + ) => { + type TestCase = { + name: string + multiplier: number + gas: number + premium: number + flatFee: number + } + + const tests: TestCase[] = [ + { + name: 'no fees', + multiplier: 1, + gas: 100000, + premium: 0, + flatFee: 0, + }, + { + name: 'basic fees', + multiplier: 1, + gas: 100000, + premium: 250000000, + flatFee: 1000000, + }, + { + name: 'max fees', + multiplier: 3, + gas: 10000000, + premium: 250000000, + flatFee: 1000000, + }, + ] + + const fPlusOne = BigNumber.from(f + 1) + const chainModuleOverheads = await chainModule.getGasOverhead() + const totalConditionalOverhead = registryConditionalOverhead + .add(registryPerSignerGasOverhead.mul(fPlusOne)) + .add(chainModuleOverheads.chainModuleFixedOverhead) + + const totalLogOverhead = registryLogOverhead + .add(registryPerSignerGasOverhead.mul(fPlusOne)) + .add(chainModuleOverheads.chainModuleFixedOverhead) + + const financeAdminAddress = await financeAdmin.getAddress() + + for (const test of tests) { + await registry.connect(owner).setConfigTypeSafe( + signerAddresses, + keeperAddresses, + f, + { + checkGasLimit, + stalenessSeconds, + gasCeilingMultiplier: test.multiplier, + maxCheckDataSize, + maxPerformDataSize, + maxRevertDataSize, + maxPerformGas, + fallbackGasPrice, + fallbackLinkPrice, + fallbackNativePrice, + transcoder: transcoder.address, + registrars: [], + upkeepPrivilegeManager: upkeepManager, + chainModule: chainModule.address, + reorgProtectionEnabled: true, + financeAdmin: financeAdminAddress, + }, + offchainVersion, + offchainBytes, + [linkToken.address], + [ + { + gasFeePPB: test.premium, + flatFeeMilliCents: test.flatFee, + priceFeed: linkUSDFeed.address, + fallbackPrice: fallbackLinkPrice, + minSpend: minUpkeepSpend, + decimals: 18, + }, + ], + ) + + const conditionalPrice = await registry.getMaxPaymentForGas( + upkeepId, + Trigger.CONDITION, + test.gas, + linkToken.address, + ) + expect(conditionalPrice).to.equal( + linkForGas( + BigNumber.from(test.gas), + totalConditionalOverhead, + BigNumber.from(test.multiplier), + BigNumber.from(test.premium), + BigNumber.from(test.flatFee), + ).total, + ) + + const logPrice = await registry.getMaxPaymentForGas( + upkeepId, + Trigger.LOG, + test.gas, + linkToken.address, + ) + expect(logPrice).to.equal( + linkForGas( + BigNumber.from(test.gas), + totalLogOverhead, + BigNumber.from(test.multiplier), + BigNumber.from(test.premium), + BigNumber.from(test.flatFee), + ).total, + ) + } + } + + const verifyConsistentAccounting = async ( + maxAllowedSpareChange: BigNumber, + ) => { + const expectedLinkBalance = await registry.getReserveAmount( + linkToken.address, + ) + const linkTokenBalance = await linkToken.balanceOf(registry.address) + const upkeepIdBalance = (await registry.getUpkeep(upkeepId)).balance + let totalKeeperBalance = BigNumber.from(0) + for (let i = 0; i < keeperAddresses.length; i++) { + totalKeeperBalance = totalKeeperBalance.add( + (await registry.getTransmitterInfo(keeperAddresses[i])).balance, + ) + } + + const linkAvailableForPayment = await registry.linkAvailableForPayment() + assert.isTrue(expectedLinkBalance.eq(linkTokenBalance)) + assert.isTrue( + upkeepIdBalance + .add(totalKeeperBalance) + .add(linkAvailableForPayment) + .lte(expectedLinkBalance), + ) + assert.isTrue( + expectedLinkBalance + .sub(upkeepIdBalance) + .sub(totalKeeperBalance) + .sub(linkAvailableForPayment) + .lte(maxAllowedSpareChange), + ) + } + + interface GetTransmitTXOptions { + numSigners?: number + startingSignerIndex?: number + gasLimit?: BigNumberish + gasPrice?: BigNumberish + performGas?: BigNumberish + performDatas?: string[] + checkBlockNum?: number + checkBlockHash?: string + logBlockHash?: BytesLike + txHash?: BytesLike + logIndex?: number + timestamp?: number + } + + const getTransmitTx = async ( + registry: IAutomationRegistry, + transmitter: Signer, + upkeepIds: BigNumber[], + overrides: GetTransmitTXOptions = {}, + ) => { + const latestBlock = await ethers.provider.getBlock('latest') + const configDigest = (await registry.getState()).state.latestConfigDigest + const config = { + numSigners: f + 1, + startingSignerIndex: 0, + performDatas: undefined, + performGas, + checkBlockNum: latestBlock.number, + checkBlockHash: latestBlock.hash, + logIndex: 0, + txHash: undefined, // assigned uniquely below + logBlockHash: undefined, // assigned uniquely below + timestamp: now(), + gasLimit: undefined, + gasPrice: undefined, + } + Object.assign(config, overrides) + const upkeeps: UpkeepData[] = [] + for (let i = 0; i < upkeepIds.length; i++) { + let trigger: string + switch (getTriggerType(upkeepIds[i])) { + case Trigger.CONDITION: + trigger = encodeBlockTrigger({ + blockNum: config.checkBlockNum, + blockHash: config.checkBlockHash, + }) + break + case Trigger.LOG: + trigger = encodeLogTrigger({ + logBlockHash: config.logBlockHash || ethers.utils.randomBytes(32), + txHash: config.txHash || ethers.utils.randomBytes(32), + logIndex: config.logIndex, + blockNum: config.checkBlockNum, + blockHash: config.checkBlockHash, + }) + break + } + upkeeps.push({ + Id: upkeepIds[i], + performGas: config.performGas, + trigger, + performData: config.performDatas ? config.performDatas[i] : '0x', + }) + } + + const report = makeReport(upkeeps) + const reportContext = [configDigest, epochAndRound5_1, emptyBytes32] + const sigs = signReport( + reportContext, + report, + signers.slice( + config.startingSignerIndex, + config.startingSignerIndex + config.numSigners, + ), + ) + + type txOverride = { + gasLimit?: BigNumberish | Promise + gasPrice?: BigNumberish | Promise + } + const txOverrides: txOverride = {} + if (config.gasLimit) { + txOverrides.gasLimit = config.gasLimit + } + if (config.gasPrice) { + txOverrides.gasPrice = config.gasPrice + } + + return registry + .connect(transmitter) + .transmit( + [configDigest, epochAndRound5_1, emptyBytes32], + report, + sigs.rs, + sigs.ss, + sigs.vs, + txOverrides, + ) + } + + const getTransmitTxWithReport = async ( + registry: IAutomationRegistry, + transmitter: Signer, + report: BytesLike, + ) => { + const configDigest = (await registry.getState()).state.latestConfigDigest + const reportContext = [configDigest, epochAndRound5_1, emptyBytes32] + const sigs = signReport(reportContext, report, signers.slice(0, f + 1)) + + return registry + .connect(transmitter) + .transmit( + [configDigest, epochAndRound5_1, emptyBytes32], + report, + sigs.rs, + sigs.ss, + sigs.vs, + ) + } + + const setup = async () => { + linkToken = await linkTokenFactory.connect(owner).deploy() + gasPriceFeed = await mockV3AggregatorFactory + .connect(owner) + .deploy(0, gasWei) + linkUSDFeed = await mockV3AggregatorFactory + .connect(owner) + .deploy(8, linkUSD) + nativeUSDFeed = await mockV3AggregatorFactory + .connect(owner) + .deploy(8, nativeUSD) + const upkeepTranscoderFactory = await ethers.getContractFactory( + 'UpkeepTranscoder5_0', + ) + transcoder = await upkeepTranscoderFactory.connect(owner).deploy() + mockZKSyncSystemContext = await mockZKSyncSystemContextFactory + .connect(owner) + .deploy() + mockGasBoundCaller = await mockGasBoundCallerFactory.connect(owner).deploy() + moduleBase = await moduleBaseFactory.connect(owner).deploy() + streamsLookupUpkeep = await streamsLookupUpkeepFactory + .connect(owner) + .deploy( + BigNumber.from('10000'), + BigNumber.from('100'), + false /* useArbBlock */, + true /* staging */, + false /* verify mercury response */, + ) + + const zksyncSystemContextCode = await ethers.provider.send('eth_getCode', [ + mockZKSyncSystemContext.address, + ]) + await ethers.provider.send('hardhat_setCode', [ + '0x000000000000000000000000000000000000800B', + zksyncSystemContextCode, + ]) + + const gasBoundCallerCode = await ethers.provider.send('eth_getCode', [ + mockGasBoundCaller.address, + ]) + await ethers.provider.send('hardhat_setCode', [ + '0xc706EC7dfA5D4Dc87f29f859094165E8290530f5', + gasBoundCallerCode, + ]) + + const financeAdminAddress = await financeAdmin.getAddress() + + config = { + checkGasLimit, + stalenessSeconds, + gasCeilingMultiplier, + maxCheckDataSize, + maxPerformDataSize, + maxRevertDataSize, + maxPerformGas, + fallbackGasPrice, + fallbackLinkPrice, + fallbackNativePrice, + transcoder: transcoder.address, + registrars: [], + upkeepPrivilegeManager: upkeepManager, + chainModule: moduleBase.address, + reorgProtectionEnabled: true, + financeAdmin: financeAdminAddress, + } + + baseConfig = [ + signerAddresses, + keeperAddresses, + f, + config, + offchainVersion, + offchainBytes, + [linkToken.address], + [ + { + gasFeePPB: paymentPremiumPPB, + flatFeeMilliCents, + priceFeed: linkUSDFeed.address, + fallbackPrice: fallbackLinkPrice, + minSpend: minUpkeepSpend, + decimals: 18, + }, + ], + ] + + const registryParams: Parameters = [ + owner, + linkToken.address, + linkUSDFeed.address, + nativeUSDFeed.address, + gasPriceFeed.address, + zeroAddress, + 0, // onchain payout mode + wrappedNativeTokenAddress, + ] + + registry = await deployZKSyncRegistry23(...registryParams) + mgRegistry = await deployZKSyncRegistry23(...registryParams) + + registryConditionalOverhead = await registry.getConditionalGasOverhead() + registryLogOverhead = await registry.getLogGasOverhead() + registryPerSignerGasOverhead = await registry.getPerSignerGasOverhead() + // registryPerPerformByteGasOverhead = + // await registry.getPerPerformByteGasOverhead() + // registryTransmitCalldataFixedBytesOverhead = + // await registry.getTransmitCalldataFixedBytesOverhead() + // registryTransmitCalldataPerSignerBytesOverhead = + // await registry.getTransmitCalldataPerSignerBytesOverhead() + cancellationDelay = (await registry.getCancellationDelay()).toNumber() + + await registry.connect(owner).setConfigTypeSafe(...baseConfig) + await mgRegistry.connect(owner).setConfigTypeSafe(...baseConfig) + for (const reg of [registry, mgRegistry]) { + await reg.connect(owner).setPayees(payees) + await linkToken.connect(admin).approve(reg.address, toWei('1000')) + await linkToken.connect(owner).approve(reg.address, toWei('1000')) + } + + mock = await upkeepMockFactory.deploy() + await linkToken + .connect(owner) + .transfer(await admin.getAddress(), toWei('1000')) + let tx = await registry + .connect(owner) + .registerUpkeep( + mock.address, + performGas, + await admin.getAddress(), + Trigger.CONDITION, + linkToken.address, + randomBytes, + '0x', + '0x', + ) + upkeepId = await getUpkeepID(tx) + + autoFunderUpkeep = await upkeepAutoFunderFactory + .connect(owner) + .deploy(linkToken.address, registry.address) + tx = await registry + .connect(owner) + .registerUpkeep( + autoFunderUpkeep.address, + performGas, + autoFunderUpkeep.address, + Trigger.CONDITION, + linkToken.address, + '0x', + '0x', + '0x', + ) + afUpkeepId = await getUpkeepID(tx) + + ltUpkeep = await deployMockContract(owner, ILogAutomationactory.abi) + tx = await registry + .connect(owner) + .registerUpkeep( + ltUpkeep.address, + performGas, + await admin.getAddress(), + Trigger.LOG, + linkToken.address, + '0x', + logTriggerConfig, + emptyBytes, + ) + logUpkeepId = await getUpkeepID(tx) + + await autoFunderUpkeep.setUpkeepId(afUpkeepId) + // Give enough funds for upkeep as well as to the upkeep contract + await linkToken + .connect(owner) + .transfer(autoFunderUpkeep.address, toWei('1000')) + + tx = await registry + .connect(owner) + .registerUpkeep( + streamsLookupUpkeep.address, + performGas, + await admin.getAddress(), + Trigger.CONDITION, + linkToken.address, + '0x', + '0x', + '0x', + ) + streamsLookupUpkeepId = await getUpkeepID(tx) + } + + const getMultipleUpkeepsDeployedAndFunded = async ( + numPassingConditionalUpkeeps: number, + numPassingLogUpkeeps: number, + numFailingUpkeeps: number, + ) => { + const passingConditionalUpkeepIds = [] + const passingLogUpkeepIds = [] + const failingUpkeepIds = [] + for (let i = 0; i < numPassingConditionalUpkeeps; i++) { + const mock = await upkeepMockFactory.deploy() + await mock.setCanPerform(true) + await mock.setPerformGasToBurn(BigNumber.from('0')) + const tx = await registry + .connect(owner) + .registerUpkeep( + mock.address, + performGas, + await admin.getAddress(), + Trigger.CONDITION, + linkToken.address, + '0x', + '0x', + '0x', + ) + const condUpkeepId = await getUpkeepID(tx) + passingConditionalUpkeepIds.push(condUpkeepId) + + // Add funds to passing upkeeps + await registry.connect(admin).addFunds(condUpkeepId, toWei('100')) + } + for (let i = 0; i < numPassingLogUpkeeps; i++) { + const mock = await upkeepMockFactory.deploy() + await mock.setCanPerform(true) + await mock.setPerformGasToBurn(BigNumber.from('0')) + const tx = await registry + .connect(owner) + .registerUpkeep( + mock.address, + performGas, + await admin.getAddress(), + Trigger.LOG, + linkToken.address, + '0x', + logTriggerConfig, + emptyBytes, + ) + const logUpkeepId = await getUpkeepID(tx) + passingLogUpkeepIds.push(logUpkeepId) + + // Add funds to passing upkeeps + await registry.connect(admin).addFunds(logUpkeepId, toWei('100')) + } + for (let i = 0; i < numFailingUpkeeps; i++) { + const mock = await upkeepMockFactory.deploy() + await mock.setCanPerform(true) + await mock.setPerformGasToBurn(BigNumber.from('0')) + const tx = await registry + .connect(owner) + .registerUpkeep( + mock.address, + performGas, + await admin.getAddress(), + Trigger.CONDITION, + linkToken.address, + '0x', + '0x', + '0x', + ) + const failingUpkeepId = await getUpkeepID(tx) + failingUpkeepIds.push(failingUpkeepId) + } + return { + passingConditionalUpkeepIds, + passingLogUpkeepIds, + failingUpkeepIds, + } + } + + beforeEach(async () => { + await loadFixture(setup) + }) + + describe('#transmit', () => { + const fArray = [1, 5, 10] + + it('reverts when registry is paused', async () => { + await registry.connect(owner).pause() + await evmRevertCustomError( + getTransmitTx(registry, keeper1, [upkeepId]), + registry, + 'RegistryPaused', + ) + }) + + it('reverts when called by non active transmitter', async () => { + await evmRevertCustomError( + getTransmitTx(registry, payee1, [upkeepId]), + registry, + 'OnlyActiveTransmitters', + ) + }) + + it('reverts when report data lengths mismatches', async () => { + const upkeepIds = [] + const gasLimits: BigNumber[] = [] + const triggers: string[] = [] + const performDatas = [] + + upkeepIds.push(upkeepId) + gasLimits.push(performGas) + triggers.push('0x') + performDatas.push('0x') + // Push an extra perform data + performDatas.push('0x') + + const report = encodeReport({ + fastGasWei: 0, + linkUSD: 0, + upkeepIds, + gasLimits, + triggers, + performDatas, + }) + + await evmRevertCustomError( + getTransmitTxWithReport(registry, keeper1, report), + registry, + 'InvalidReport', + ) + }) + + it('returns early when invalid upkeepIds are included in report', async () => { + const tx = await getTransmitTx(registry, keeper1, [ + upkeepId.add(BigNumber.from('1')), + ]) + + const receipt = await tx.wait() + const cancelledUpkeepReportLogs = parseCancelledUpkeepReportLogs(receipt) + // exactly 1 CancelledUpkeepReport log should be emitted + assert.equal(cancelledUpkeepReportLogs.length, 1) + }) + + it('performs even when the upkeep has insufficient funds and the upkeep pays out all the remaining balance', async () => { + // add very little fund to this upkeep + await registry.connect(admin).addFunds(upkeepId, BigNumber.from(10)) + const tx = await getTransmitTx(registry, keeper1, [upkeepId]) + const receipt = await tx.wait() + // the upkeep is underfunded in transmit but still performed + const upkeepPerformedLogs = parseUpkeepPerformedLogs(receipt) + assert.equal(upkeepPerformedLogs.length, 1) + const balance = (await registry.getUpkeep(upkeepId)).balance + assert.equal(balance.toNumber(), 0) + }) + + context('When the upkeep is funded', async () => { + beforeEach(async () => { + // Fund the upkeep + await Promise.all([ + registry.connect(admin).addFunds(upkeepId, toWei('100')), + registry.connect(admin).addFunds(logUpkeepId, toWei('100')), + ]) + }) + + it('handles duplicate upkeepIDs', async () => { + const tests: [string, BigNumber, number, number][] = [ + // [name, upkeep, num stale, num performed] + ['conditional', upkeepId, 1, 1], // checkBlocks must be sequential + ['log-trigger', logUpkeepId, 0, 2], // logs are deduped based on the "trigger ID" + ] + for (const [type, id, nStale, nPerformed] of tests) { + const tx = await getTransmitTx(registry, keeper1, [id, id]) + const receipt = await tx.wait() + const staleUpkeepReport = parseStaleUpkeepReportLogs(receipt) + const upkeepPerformedLogs = parseUpkeepPerformedLogs(receipt) + assert.equal( + staleUpkeepReport.length, + nStale, + `wrong log count for ${type} upkeep`, + ) + assert.equal( + upkeepPerformedLogs.length, + nPerformed, + `wrong log count for ${type} upkeep`, + ) + } + }) + + it('handles duplicate log triggers', async () => { + const logBlockHash = ethers.utils.randomBytes(32) + const txHash = ethers.utils.randomBytes(32) + const logIndex = 0 + const expectedDedupKey = ethers.utils.solidityKeccak256( + ['uint256', 'bytes32', 'bytes32', 'uint32'], + [logUpkeepId, logBlockHash, txHash, logIndex], + ) + assert.isFalse(await registry.hasDedupKey(expectedDedupKey)) + const tx = await getTransmitTx( + registry, + keeper1, + [logUpkeepId, logUpkeepId], + { logBlockHash, txHash, logIndex }, // will result in the same dedup key + ) + const receipt = await tx.wait() + const staleUpkeepReport = parseStaleUpkeepReportLogs(receipt) + const upkeepPerformedLogs = parseUpkeepPerformedLogs(receipt) + assert.equal(staleUpkeepReport.length, 1) + assert.equal(upkeepPerformedLogs.length, 1) + assert.isTrue(await registry.hasDedupKey(expectedDedupKey)) + await expect(tx) + .to.emit(registry, 'DedupKeyAdded') + .withArgs(expectedDedupKey) + }) + + it('returns early when check block number is less than last perform (block)', async () => { + // First perform an upkeep to put last perform block number on upkeep state + const tx = await getTransmitTx(registry, keeper1, [upkeepId]) + await tx.wait() + const lastPerformed = (await registry.getUpkeep(upkeepId)) + .lastPerformedBlockNumber + const lastPerformBlock = await ethers.provider.getBlock(lastPerformed) + assert.equal(lastPerformed.toString(), tx.blockNumber?.toString()) + // Try to transmit a report which has checkBlockNumber = lastPerformed-1, should result in stale report + const transmitTx = await getTransmitTx(registry, keeper1, [upkeepId], { + checkBlockNum: lastPerformBlock.number - 1, + checkBlockHash: lastPerformBlock.parentHash, + }) + const receipt = await transmitTx.wait() + const staleUpkeepReportLogs = parseStaleUpkeepReportLogs(receipt) + // exactly 1 StaleUpkeepReportLogs log should be emitted + assert.equal(staleUpkeepReportLogs.length, 1) + }) + + it('handles case when check block hash does not match', async () => { + const tests: [string, BigNumber][] = [ + ['conditional', upkeepId], + ['log-trigger', logUpkeepId], + ] + for (const [type, id] of tests) { + const latestBlock = await ethers.provider.getBlock('latest') + // Try to transmit a report which has incorrect checkBlockHash + const tx = await getTransmitTx(registry, keeper1, [id], { + checkBlockNum: latestBlock.number - 1, + checkBlockHash: latestBlock.hash, // should be latestBlock.parentHash + }) + + const receipt = await tx.wait() + const reorgedUpkeepReportLogs = parseReorgedUpkeepReportLogs(receipt) + // exactly 1 ReorgedUpkeepReportLogs log should be emitted + assert.equal( + reorgedUpkeepReportLogs.length, + 1, + `wrong log count for ${type} upkeep`, + ) + } + }) + + it('handles case when check block number is older than 256 blocks', async () => { + for (let i = 0; i < 256; i++) { + await ethers.provider.send('evm_mine', []) + } + const tests: [string, BigNumber][] = [ + ['conditional', upkeepId], + ['log-trigger', logUpkeepId], + ] + for (const [type, id] of tests) { + const latestBlock = await ethers.provider.getBlock('latest') + const old = await ethers.provider.getBlock(latestBlock.number - 256) + // Try to transmit a report which has incorrect checkBlockHash + const tx = await getTransmitTx(registry, keeper1, [id], { + checkBlockNum: old.number, + checkBlockHash: old.hash, + }) + + const receipt = await tx.wait() + const reorgedUpkeepReportLogs = parseReorgedUpkeepReportLogs(receipt) + // exactly 1 ReorgedUpkeepReportLogs log should be emitted + assert.equal( + reorgedUpkeepReportLogs.length, + 1, + `wrong log count for ${type} upkeep`, + ) + } + }) + + it('allows bypassing reorg protection with empty blockhash', async () => { + const tests: [string, BigNumber][] = [ + ['conditional', upkeepId], + ['log-trigger', logUpkeepId], + ] + for (const [type, id] of tests) { + const latestBlock = await ethers.provider.getBlock('latest') + const tx = await getTransmitTx(registry, keeper1, [id], { + checkBlockNum: latestBlock.number, + checkBlockHash: emptyBytes32, + }) + const receipt = await tx.wait() + const upkeepPerformedLogs = parseUpkeepPerformedLogs(receipt) + assert.equal( + upkeepPerformedLogs.length, + 1, + `wrong log count for ${type} upkeep`, + ) + } + }) + + it('allows bypassing reorg protection with reorgProtectionEnabled false config', async () => { + const tests: [string, BigNumber][] = [ + ['conditional', upkeepId], + ['log-trigger', logUpkeepId], + ] + const newConfig = config + newConfig.reorgProtectionEnabled = false + await registry // used to test initial configurations + .connect(owner) + .setConfigTypeSafe( + signerAddresses, + keeperAddresses, + f, + newConfig, + offchainVersion, + offchainBytes, + baseConfig[6], + baseConfig[7], + ) + + for (const [type, id] of tests) { + const latestBlock = await ethers.provider.getBlock('latest') + // Try to transmit a report which has incorrect checkBlockHash + const tx = await getTransmitTx(registry, keeper1, [id], { + checkBlockNum: latestBlock.number - 1, + checkBlockHash: latestBlock.hash, // should be latestBlock.parentHash + }) + + const receipt = await tx.wait() + const upkeepPerformedLogs = parseUpkeepPerformedLogs(receipt) + assert.equal( + upkeepPerformedLogs.length, + 1, + `wrong log count for ${type} upkeep`, + ) + } + }) + + it('allows very old trigger block numbers when bypassing reorg protection with reorgProtectionEnabled config', async () => { + const newConfig = config + newConfig.reorgProtectionEnabled = false + await registry // used to test initial configurations + .connect(owner) + .setConfigTypeSafe( + signerAddresses, + keeperAddresses, + f, + newConfig, + offchainVersion, + offchainBytes, + baseConfig[6], + baseConfig[7], + ) + for (let i = 0; i < 256; i++) { + await ethers.provider.send('evm_mine', []) + } + const tests: [string, BigNumber][] = [ + ['conditional', upkeepId], + ['log-trigger', logUpkeepId], + ] + for (const [type, id] of tests) { + const latestBlock = await ethers.provider.getBlock('latest') + const old = await ethers.provider.getBlock(latestBlock.number - 256) + // Try to transmit a report which has incorrect checkBlockHash + const tx = await getTransmitTx(registry, keeper1, [id], { + checkBlockNum: old.number, + checkBlockHash: old.hash, + }) + + const receipt = await tx.wait() + const upkeepPerformedLogs = parseUpkeepPerformedLogs(receipt) + assert.equal( + upkeepPerformedLogs.length, + 1, + `wrong log count for ${type} upkeep`, + ) + } + }) + + it('allows very old trigger block numbers when bypassing reorg protection with empty blockhash', async () => { + // mine enough blocks so that blockhash(1) is unavailable + for (let i = 0; i <= 256; i++) { + await ethers.provider.send('evm_mine', []) + } + const tests: [string, BigNumber][] = [ + ['conditional', upkeepId], + ['log-trigger', logUpkeepId], + ] + for (const [type, id] of tests) { + const tx = await getTransmitTx(registry, keeper1, [id], { + checkBlockNum: 1, + checkBlockHash: emptyBytes32, + }) + const receipt = await tx.wait() + const upkeepPerformedLogs = parseUpkeepPerformedLogs(receipt) + assert.equal( + upkeepPerformedLogs.length, + 1, + `wrong log count for ${type} upkeep`, + ) + } + }) + + it('returns early when future block number is provided as trigger, irrespective of blockhash being present', async () => { + const tests: [string, BigNumber][] = [ + ['conditional', upkeepId], + ['log-trigger', logUpkeepId], + ] + for (const [type, id] of tests) { + const latestBlock = await ethers.provider.getBlock('latest') + + // Should fail when blockhash is empty + let tx = await getTransmitTx(registry, keeper1, [id], { + checkBlockNum: latestBlock.number + 100, + checkBlockHash: emptyBytes32, + }) + let receipt = await tx.wait() + let reorgedUpkeepReportLogs = parseReorgedUpkeepReportLogs(receipt) + // exactly 1 ReorgedUpkeepReportLogs log should be emitted + assert.equal( + reorgedUpkeepReportLogs.length, + 1, + `wrong log count for ${type} upkeep`, + ) + + // Should also fail when blockhash is not empty + tx = await getTransmitTx(registry, keeper1, [id], { + checkBlockNum: latestBlock.number + 100, + checkBlockHash: latestBlock.hash, + }) + receipt = await tx.wait() + reorgedUpkeepReportLogs = parseReorgedUpkeepReportLogs(receipt) + // exactly 1 ReorgedUpkeepReportLogs log should be emitted + assert.equal( + reorgedUpkeepReportLogs.length, + 1, + `wrong log count for ${type} upkeep`, + ) + } + }) + + it('returns early when future block number is provided as trigger, irrespective of reorgProtectionEnabled config', async () => { + const newConfig = config + newConfig.reorgProtectionEnabled = false + await registry // used to test initial configurations + .connect(owner) + .setConfigTypeSafe( + signerAddresses, + keeperAddresses, + f, + newConfig, + offchainVersion, + offchainBytes, + baseConfig[6], + baseConfig[7], + ) + const tests: [string, BigNumber][] = [ + ['conditional', upkeepId], + ['log-trigger', logUpkeepId], + ] + for (const [type, id] of tests) { + const latestBlock = await ethers.provider.getBlock('latest') + + // Should fail when blockhash is empty + let tx = await getTransmitTx(registry, keeper1, [id], { + checkBlockNum: latestBlock.number + 100, + checkBlockHash: emptyBytes32, + }) + let receipt = await tx.wait() + let reorgedUpkeepReportLogs = parseReorgedUpkeepReportLogs(receipt) + // exactly 1 ReorgedUpkeepReportLogs log should be emitted + assert.equal( + reorgedUpkeepReportLogs.length, + 1, + `wrong log count for ${type} upkeep`, + ) + + // Should also fail when blockhash is not empty + tx = await getTransmitTx(registry, keeper1, [id], { + checkBlockNum: latestBlock.number + 100, + checkBlockHash: latestBlock.hash, + }) + receipt = await tx.wait() + reorgedUpkeepReportLogs = parseReorgedUpkeepReportLogs(receipt) + // exactly 1 ReorgedUpkeepReportLogs log should be emitted + assert.equal( + reorgedUpkeepReportLogs.length, + 1, + `wrong log count for ${type} upkeep`, + ) + } + }) + + it('returns early when upkeep is cancelled and cancellation delay has gone', async () => { + const latestBlockReport = await makeLatestBlockReport([upkeepId]) + await registry.connect(admin).cancelUpkeep(upkeepId) + + for (let i = 0; i < cancellationDelay; i++) { + await ethers.provider.send('evm_mine', []) + } + + const tx = await getTransmitTxWithReport( + registry, + keeper1, + latestBlockReport, + ) + + const receipt = await tx.wait() + const cancelledUpkeepReportLogs = + parseCancelledUpkeepReportLogs(receipt) + // exactly 1 CancelledUpkeepReport log should be emitted + assert.equal(cancelledUpkeepReportLogs.length, 1) + }) + + it('does not revert if the target cannot execute', async () => { + await mock.setCanPerform(false) + const tx = await getTransmitTx(registry, keeper1, [upkeepId]) + + const receipt = await tx.wait() + const upkeepPerformedLogs = parseUpkeepPerformedLogs(receipt) + // exactly 1 Upkeep Performed should be emitted + assert.equal(upkeepPerformedLogs.length, 1) + const upkeepPerformedLog = upkeepPerformedLogs[0] + + const success = upkeepPerformedLog.args.success + assert.equal(success, false) + }) + + it('does not revert if the target runs out of gas', async () => { + await mock.setCanPerform(false) + + const tx = await getTransmitTx(registry, keeper1, [upkeepId], { + performGas: 10, // too little gas + }) + + const receipt = await tx.wait() + const upkeepPerformedLogs = parseUpkeepPerformedLogs(receipt) + // exactly 1 Upkeep Performed should be emitted + assert.equal(upkeepPerformedLogs.length, 1) + const upkeepPerformedLog = upkeepPerformedLogs[0] + + const success = upkeepPerformedLog.args.success + assert.equal(success, false) + }) + + it('reverts if not enough gas supplied', async () => { + await mock.setCanPerform(true) + await evmRevert( + getTransmitTx(registry, keeper1, [upkeepId], { + gasLimit: BigNumber.from(150000), + }), + ) + }) + + it('executes the data passed to the registry', async () => { + await mock.setCanPerform(true) + + const tx = await getTransmitTx(registry, keeper1, [upkeepId], { + performDatas: [randomBytes], + }) + const receipt = await tx.wait() + + const upkeepPerformedWithABI = [ + 'event UpkeepPerformedWith(bytes upkeepData)', + ] + const iface = new ethers.utils.Interface(upkeepPerformedWithABI) + const parsedLogs = [] + for (let i = 0; i < receipt.logs.length; i++) { + const log = receipt.logs[i] + try { + parsedLogs.push(iface.parseLog(log)) + } catch (e) { + // ignore log + } + } + assert.equal(parsedLogs.length, 1) + assert.equal(parsedLogs[0].args.upkeepData, randomBytes) + }) + + it('uses actual execution price for payment and premium calculation', async () => { + // Actual multiplier is 2, but we set gasPrice to be == gasWei + const gasPrice = gasWei + await mock.setCanPerform(true) + const registryPremiumBefore = (await registry.getState()).state + .totalPremium + const tx = await getTransmitTx(registry, keeper1, [upkeepId], { + gasPrice, + }) + const receipt = await tx.wait() + const registryPremiumAfter = (await registry.getState()).state + .totalPremium + const premium = registryPremiumAfter.sub(registryPremiumBefore) + + const upkeepPerformedLogs = parseUpkeepPerformedLogs(receipt) + // exactly 1 Upkeep Performed should be emitted + assert.equal(upkeepPerformedLogs.length, 1) + const upkeepPerformedLog = upkeepPerformedLogs[0] + + const gasUsed = upkeepPerformedLog.args.gasUsed // 14657 gasUsed + const gasOverhead = upkeepPerformedLog.args.gasOverhead // 137230 gasOverhead + const totalPayment = upkeepPerformedLog.args.totalPayment + + assert.equal( + linkForGas( + gasUsed, + gasOverhead, + BigNumber.from('1'), // Not the config multiplier, but the actual gas used + paymentPremiumPPB, + flatFeeMilliCents, + // pubdataGas.mul(gasPrice), + ).total.toString(), + totalPayment.toString(), + ) + + assert.equal( + linkForGas( + gasUsed, + gasOverhead, + BigNumber.from('1'), // Not the config multiplier, but the actual gas used + paymentPremiumPPB, + flatFeeMilliCents, + // pubdataGas.mul(gasPrice), + ).premium.toString(), + premium.toString(), + ) + }) + + it('only pays at a rate up to the gas ceiling [ @skip-coverage ]', async () => { + // Actual multiplier is 2, but we set gasPrice to be 10x + const gasPrice = gasWei.mul(BigNumber.from('10')) + await mock.setCanPerform(true) + + const tx = await getTransmitTx(registry, keeper1, [upkeepId], { + gasPrice, + }) + const receipt = await tx.wait() + const upkeepPerformedLogs = parseUpkeepPerformedLogs(receipt) + // exactly 1 Upkeep Performed should be emitted + assert.equal(upkeepPerformedLogs.length, 1) + const upkeepPerformedLog = upkeepPerformedLogs[0] + + const gasUsed = upkeepPerformedLog.args.gasUsed + const gasOverhead = upkeepPerformedLog.args.gasOverhead + const totalPayment = upkeepPerformedLog.args.totalPayment + + assert.equal( + linkForGas( + gasUsed, + gasOverhead, + gasCeilingMultiplier, // Should be same with exisitng multiplier + paymentPremiumPPB, + flatFeeMilliCents, + // pubdataGas.mul(gasPrice), + ).total.toString(), + totalPayment.toString(), + ) + }) + + itMaybe('can self fund', async () => { + const maxPayment = await registry.getMaxPaymentForGas( + upkeepId, + Trigger.CONDITION, + performGas, + linkToken.address, + ) + + // First set auto funding amount to 0 and verify that balance is deducted upon performUpkeep + let initialBalance = toWei('100') + await registry.connect(owner).addFunds(afUpkeepId, initialBalance) + await autoFunderUpkeep.setAutoFundLink(0) + await autoFunderUpkeep.setIsEligible(true) + await getTransmitTx(registry, keeper1, [afUpkeepId]) + + let postUpkeepBalance = (await registry.getUpkeep(afUpkeepId)).balance + assert.isTrue(postUpkeepBalance.lt(initialBalance)) // Balance should be deducted + assert.isTrue(postUpkeepBalance.gte(initialBalance.sub(maxPayment))) // Balance should not be deducted more than maxPayment + + // Now set auto funding amount to 100 wei and verify that the balance increases + initialBalance = postUpkeepBalance + const autoTopupAmount = toWei('100') + await autoFunderUpkeep.setAutoFundLink(autoTopupAmount) + await autoFunderUpkeep.setIsEligible(true) + await getTransmitTx(registry, keeper1, [afUpkeepId]) + + postUpkeepBalance = (await registry.getUpkeep(afUpkeepId)).balance + // Balance should increase by autoTopupAmount and decrease by max maxPayment + assert.isTrue( + postUpkeepBalance.gte( + initialBalance.add(autoTopupAmount).sub(maxPayment), + ), + ) + }) + + it('can self cancel', async () => { + await registry.connect(owner).addFunds(afUpkeepId, toWei('100')) + + await autoFunderUpkeep.setIsEligible(true) + await autoFunderUpkeep.setShouldCancel(true) + + let registration = await registry.getUpkeep(afUpkeepId) + const oldExpiration = registration.maxValidBlocknumber + + // Do the thing + await getTransmitTx(registry, keeper1, [afUpkeepId]) + + // Verify upkeep gets cancelled + registration = await registry.getUpkeep(afUpkeepId) + const newExpiration = registration.maxValidBlocknumber + assert.isTrue(newExpiration.lt(oldExpiration)) + }) + + it('reverts when configDigest mismatches', async () => { + const report = await makeLatestBlockReport([upkeepId]) + const reportContext = [emptyBytes32, epochAndRound5_1, emptyBytes32] // wrong config digest + const sigs = signReport(reportContext, report, signers.slice(0, f + 1)) + await evmRevertCustomError( + registry + .connect(keeper1) + .transmit( + [reportContext[0], reportContext[1], reportContext[2]], + report, + sigs.rs, + sigs.ss, + sigs.vs, + ), + registry, + 'ConfigDigestMismatch', + ) + }) + + it('reverts with incorrect number of signatures', async () => { + const configDigest = (await registry.getState()).state + .latestConfigDigest + const report = await makeLatestBlockReport([upkeepId]) + const reportContext = [configDigest, epochAndRound5_1, emptyBytes32] // wrong config digest + const sigs = signReport(reportContext, report, signers.slice(0, f + 2)) + await evmRevertCustomError( + registry + .connect(keeper1) + .transmit( + [reportContext[0], reportContext[1], reportContext[2]], + report, + sigs.rs, + sigs.ss, + sigs.vs, + ), + registry, + 'IncorrectNumberOfSignatures', + ) + }) + + it('reverts with invalid signature for inactive signers', async () => { + const configDigest = (await registry.getState()).state + .latestConfigDigest + const report = await makeLatestBlockReport([upkeepId]) + const reportContext = [configDigest, epochAndRound5_1, emptyBytes32] // wrong config digest + const sigs = signReport(reportContext, report, [ + new ethers.Wallet(ethers.Wallet.createRandom()), + new ethers.Wallet(ethers.Wallet.createRandom()), + ]) + await evmRevertCustomError( + registry + .connect(keeper1) + .transmit( + [reportContext[0], reportContext[1], reportContext[2]], + report, + sigs.rs, + sigs.ss, + sigs.vs, + ), + registry, + 'OnlyActiveSigners', + ) + }) + + it('reverts with invalid signature for duplicated signers', async () => { + const configDigest = (await registry.getState()).state + .latestConfigDigest + const report = await makeLatestBlockReport([upkeepId]) + const reportContext = [configDigest, epochAndRound5_1, emptyBytes32] // wrong config digest + const sigs = signReport(reportContext, report, [signer1, signer1]) + await evmRevertCustomError( + registry + .connect(keeper1) + .transmit( + [reportContext[0], reportContext[1], reportContext[2]], + report, + sigs.rs, + sigs.ss, + sigs.vs, + ), + registry, + 'DuplicateSigners', + ) + }) + + itMaybe( + 'has a large enough gas overhead to cover upkeep that use all its gas [ @skip-coverage ]', + async () => { + await registry.connect(owner).setConfigTypeSafe( + signerAddresses, + keeperAddresses, + 10, // maximise f to maximise overhead + config, + offchainVersion, + offchainBytes, + baseConfig[6], + baseConfig[7], + ) + const tx = await registry.connect(owner).registerUpkeep( + mock.address, + maxPerformGas, // max allowed gas + await admin.getAddress(), + Trigger.CONDITION, + linkToken.address, + '0x', + '0x', + '0x', + ) + const testUpkeepId = await getUpkeepID(tx) + await registry.connect(admin).addFunds(testUpkeepId, toWei('100')) + + let performData = '0x' + for (let i = 0; i < maxPerformDataSize.toNumber(); i++) { + performData += '11' + } // max allowed performData + + await mock.setCanPerform(true) + await mock.setPerformGasToBurn(maxPerformGas) + + await getTransmitTx(registry, keeper1, [testUpkeepId], { + gasLimit: maxPerformGas.add(transmitGasOverhead), + numSigners: 11, + performDatas: [performData], + }) // Should not revert + }, + ) + + itMaybe( + 'performs upkeep, deducts payment, updates lastPerformed and emits events', + async () => { + await mock.setCanPerform(true) + + for (const i in fArray) { + const newF = fArray[i] + await registry + .connect(owner) + .setConfigTypeSafe( + signerAddresses, + keeperAddresses, + newF, + config, + offchainVersion, + offchainBytes, + baseConfig[6], + baseConfig[7], + ) + const checkBlock = await ethers.provider.getBlock('latest') + + const keeperBefore = await registry.getTransmitterInfo( + await keeper1.getAddress(), + ) + const registrationBefore = await registry.getUpkeep(upkeepId) + const registryPremiumBefore = (await registry.getState()).state + .totalPremium + const keeperLinkBefore = await linkToken.balanceOf( + await keeper1.getAddress(), + ) + const registryLinkBefore = await linkToken.balanceOf( + registry.address, + ) + + // Do the thing + const tx = await getTransmitTx(registry, keeper1, [upkeepId], { + checkBlockNum: checkBlock.number, + checkBlockHash: checkBlock.hash, + numSigners: newF + 1, + }) + + const receipt = await tx.wait() + + const upkeepPerformedLogs = parseUpkeepPerformedLogs(receipt) + // exactly 1 Upkeep Performed should be emitted + assert.equal(upkeepPerformedLogs.length, 1) + const upkeepPerformedLog = upkeepPerformedLogs[0] + + const id = upkeepPerformedLog.args.id + const success = upkeepPerformedLog.args.success + const trigger = upkeepPerformedLog.args.trigger + const gasUsed = upkeepPerformedLog.args.gasUsed + const gasOverhead = upkeepPerformedLog.args.gasOverhead + const totalPayment = upkeepPerformedLog.args.totalPayment + assert.equal(id.toString(), upkeepId.toString()) + assert.equal(success, true) + assert.equal( + trigger, + encodeBlockTrigger({ + blockNum: checkBlock.number, + blockHash: checkBlock.hash, + }), + ) + assert.isTrue(gasUsed.gt(BigNumber.from('0'))) + assert.isTrue(gasOverhead.gt(BigNumber.from('0'))) + assert.isTrue(totalPayment.gt(BigNumber.from('0'))) + + const keeperAfter = await registry.getTransmitterInfo( + await keeper1.getAddress(), + ) + const registrationAfter = await registry.getUpkeep(upkeepId) + const keeperLinkAfter = await linkToken.balanceOf( + await keeper1.getAddress(), + ) + const registryLinkAfter = await linkToken.balanceOf( + registry.address, + ) + const registryPremiumAfter = (await registry.getState()).state + .totalPremium + const premium = registryPremiumAfter.sub(registryPremiumBefore) + // Keeper payment is gasPayment + premium / num keepers + const keeperPayment = totalPayment + .sub(premium) + .add(premium.div(BigNumber.from(keeperAddresses.length))) + + assert.equal( + keeperAfter.balance.sub(keeperPayment).toString(), + keeperBefore.balance.toString(), + ) + assert.equal( + registrationBefore.balance.sub(totalPayment).toString(), + registrationAfter.balance.toString(), + ) + assert.isTrue(keeperLinkAfter.eq(keeperLinkBefore)) + assert.isTrue(registryLinkBefore.eq(registryLinkAfter)) + + // Amount spent should be updated correctly + assert.equal( + registrationAfter.amountSpent.sub(totalPayment).toString(), + registrationBefore.amountSpent.toString(), + ) + assert.isTrue( + registrationAfter.amountSpent + .sub(registrationBefore.amountSpent) + .eq(registrationBefore.balance.sub(registrationAfter.balance)), + ) + // Last perform block number should be updated + assert.equal( + registrationAfter.lastPerformedBlockNumber.toString(), + tx.blockNumber?.toString(), + ) + + // Latest epoch should be 5 + assert.equal((await registry.getState()).state.latestEpoch, 5) + } + }, + ) + + // describe.only('Gas benchmarking conditional upkeeps [ @skip-coverage ]', function () { + // const fs = [1] + // fs.forEach(function (newF) { + // it( + // 'When f=' + + // newF + + // ' calculates gas overhead appropriately within a margin for different scenarios', + // async () => { + // // Perform the upkeep once to remove non-zero storage slots and have predictable gas measurement + // let tx = await getTransmitTx(registry, keeper1, [upkeepId]) + // await tx.wait() + // + // await registry + // .connect(admin) + // .setUpkeepGasLimit(upkeepId, performGas.mul(3)) + // + // // Different test scenarios + // let longBytes = '0x' + // for (let i = 0; i < maxPerformDataSize.toNumber(); i++) { + // longBytes += '11' + // } + // const upkeepSuccessArray = [true, false] + // const performGasArray = [5000, performGas] + // const performDataArray = ['0x', longBytes] + // const chainModuleOverheads = await moduleBase.getGasOverhead() + // + // for (const i in upkeepSuccessArray) { + // for (const j in performGasArray) { + // for (const k in performDataArray) { + // const upkeepSuccess = upkeepSuccessArray[i] + // const performGas = performGasArray[j] + // const performData = performDataArray[k] + // + // await mock.setCanPerform(upkeepSuccess) + // await mock.setPerformGasToBurn(performGas) + // await registry + // .connect(owner) + // .setConfigTypeSafe( + // signerAddresses, + // keeperAddresses, + // newF, + // config, + // offchainVersion, + // offchainBytes, + // baseConfig[6], + // baseConfig[7], + // ) + // tx = await getTransmitTx(registry, keeper1, [upkeepId], { + // numSigners: newF + 1, + // performDatas: [performData], + // }) + // const receipt = await tx.wait() + // const upkeepPerformedLogs = + // parseUpkeepPerformedLogs(receipt) + // // exactly 1 Upkeep Performed should be emitted + // assert.equal(upkeepPerformedLogs.length, 1) + // const upkeepPerformedLog = upkeepPerformedLogs[0] + // + // const upkeepGasUsed = upkeepPerformedLog.args.gasUsed + // const chargedGasOverhead = + // upkeepPerformedLog.args.gasOverhead + // const actualGasOverhead = receipt.gasUsed + // .sub(upkeepGasUsed) + // .add(500000) // the amount of pubdataGas used returned by mock gas bound caller + // const estimatedGasOverhead = registryConditionalOverhead + // .add( + // registryPerSignerGasOverhead.mul( + // BigNumber.from(newF + 1), + // ), + // ) + // .add(chainModuleOverheads.chainModuleFixedOverhead) + // .add(65_400) + // + // assert.isTrue(upkeepGasUsed.gt(BigNumber.from('0'))) + // assert.isTrue(chargedGasOverhead.gt(BigNumber.from('0'))) + // assert.isTrue(actualGasOverhead.gt(BigNumber.from('0'))) + // + // console.log( + // 'Gas Benchmarking conditional upkeeps:', + // 'upkeepSuccess=', + // upkeepSuccess, + // 'performGas=', + // performGas.toString(), + // 'performData length=', + // performData.length / 2 - 1, + // 'sig verification ( f =', + // newF, + // '): estimated overhead: ', + // estimatedGasOverhead.toString(), // 179800 + // ' charged overhead: ', + // chargedGasOverhead.toString(), // 180560 + // ' actual overhead: ', + // actualGasOverhead.toString(), // 632949 + // ' calculation margin over gasUsed: ', + // chargedGasOverhead.sub(actualGasOverhead).toString(), // 18456 + // ' estimation margin over gasUsed: ', + // estimatedGasOverhead.sub(actualGasOverhead).toString(), // -27744 + // ' upkeepGasUsed: ', + // upkeepGasUsed, // 988620 + // ' receipt.gasUsed: ', + // receipt.gasUsed, // 1121569 + // ) + // + // // The actual gas overhead should be less than charged gas overhead, but not by a lot + // // The charged gas overhead is controlled by ACCOUNTING_FIXED_GAS_OVERHEAD and + // // ACCOUNTING_PER_UPKEEP_GAS_OVERHEAD, and their correct values should be set to + // // satisfy constraints in multiple places + // assert.isTrue( + // chargedGasOverhead.gt(actualGasOverhead), + // 'Gas overhead calculated is too low, increase account gas variables (ACCOUNTING_FIXED_GAS_OVERHEAD/ACCOUNTING_PER_UPKEEP_GAS_OVERHEAD) by at least ' + + // actualGasOverhead.sub(chargedGasOverhead).toString(), + // ) + // assert.isTrue( + // chargedGasOverhead // 180560 + // .sub(actualGasOverhead) // 132940 + // .lt(gasCalculationMargin), + // 'Gas overhead calculated is too high, decrease account gas variables (ACCOUNTING_FIXED_GAS_OVERHEAD/ACCOUNTING_PER_SIGNER_GAS_OVERHEAD) by at least ' + + // chargedGasOverhead + // .sub(actualGasOverhead) + // .sub(gasCalculationMargin) + // .toString(), + // ) + // + // // The estimated overhead during checkUpkeep should be close to the actual overhead in transaction + // // It should be greater than the actual overhead but not by a lot + // // The estimated overhead is controlled by variables + // // REGISTRY_CONDITIONAL_OVERHEAD, REGISTRY_LOG_OVERHEAD, REGISTRY_PER_SIGNER_GAS_OVERHEAD + // // REGISTRY_PER_PERFORM_BYTE_GAS_OVERHEAD + // assert.isTrue( + // estimatedGasOverhead.gt(actualGasOverhead), + // 'Gas overhead estimated in check upkeep is too low, increase estimation gas variables (REGISTRY_CONDITIONAL_OVERHEAD/REGISTRY_LOG_OVERHEAD/REGISTRY_PER_SIGNER_GAS_OVERHEAD/REGISTRY_PER_PERFORM_BYTE_GAS_OVERHEAD) by at least ' + + // estimatedGasOverhead.sub(chargedGasOverhead).toString(), + // ) + // assert.isTrue( + // estimatedGasOverhead + // .sub(actualGasOverhead) + // .lt(gasEstimationMargin), + // 'Gas overhead estimated is too high, decrease estimation gas variables (REGISTRY_CONDITIONAL_OVERHEAD/REGISTRY_LOG_OVERHEAD/REGISTRY_PER_SIGNER_GAS_OVERHEAD/REGISTRY_PER_PERFORM_BYTE_GAS_OVERHEAD) by at least ' + + // estimatedGasOverhead + // .sub(actualGasOverhead) + // .sub(gasEstimationMargin) + // .toString(), + // ) + // } + // } + // } + // }, + // ) + // }) + // }) + + // describe.only('Gas benchmarking log upkeeps [ @skip-coverage ]', function () { + // const fs = [1] + // fs.forEach(function (newF) { + // it( + // 'When f=' + + // newF + + // ' calculates gas overhead appropriately within a margin', + // async () => { + // // Perform the upkeep once to remove non-zero storage slots and have predictable gas measurement + // let tx = await getTransmitTx(registry, keeper1, [logUpkeepId]) + // await tx.wait() + // const performData = '0x' + // await mock.setCanPerform(true) + // await mock.setPerformGasToBurn(performGas) + // await registry.setConfigTypeSafe( + // signerAddresses, + // keeperAddresses, + // newF, + // config, + // offchainVersion, + // offchainBytes, + // baseConfig[6], + // baseConfig[7], + // ) + // tx = await getTransmitTx(registry, keeper1, [logUpkeepId], { + // numSigners: newF + 1, + // performDatas: [performData], + // }) + // const receipt = await tx.wait() + // const upkeepPerformedLogs = parseUpkeepPerformedLogs(receipt) + // // exactly 1 Upkeep Performed should be emitted + // assert.equal(upkeepPerformedLogs.length, 1) + // const upkeepPerformedLog = upkeepPerformedLogs[0] + // const chainModuleOverheads = await moduleBase.getGasOverhead() + // + // const upkeepGasUsed = upkeepPerformedLog.args.gasUsed + // const chargedGasOverhead = upkeepPerformedLog.args.gasOverhead + // const actualGasOverhead = receipt.gasUsed + // .sub(upkeepGasUsed) + // .add(500000) // the amount of pubdataGas used returned by mock gas bound caller + // const estimatedGasOverhead = registryLogOverhead + // .add(registryPerSignerGasOverhead.mul(BigNumber.from(newF + 1))) + // .add(chainModuleOverheads.chainModuleFixedOverhead) + // .add(65_400) + // + // assert.isTrue(upkeepGasUsed.gt(BigNumber.from('0'))) + // assert.isTrue(chargedGasOverhead.gt(BigNumber.from('0'))) + // assert.isTrue(actualGasOverhead.gt(BigNumber.from('0'))) + // + // console.log( + // 'Gas Benchmarking log upkeeps:', + // 'upkeepSuccess=', + // true, + // 'performGas=', + // performGas.toString(), + // 'performData length=', + // performData.length / 2 - 1, + // 'sig verification ( f =', + // newF, + // '): estimated overhead: ', + // estimatedGasOverhead.toString(), + // ' charged overhead: ', + // chargedGasOverhead.toString(), + // ' actual overhead: ', + // actualGasOverhead.toString(), + // ' calculation margin over gasUsed: ', + // chargedGasOverhead.sub(actualGasOverhead).toString(), + // ' estimation margin over gasUsed: ', + // estimatedGasOverhead.sub(actualGasOverhead).toString(), + // ' upkeepGasUsed: ', + // upkeepGasUsed, + // ' receipt.gasUsed: ', + // receipt.gasUsed, + // ) + // + // assert.isTrue( + // chargedGasOverhead.gt(actualGasOverhead), + // 'Gas overhead calculated is too low, increase account gas variables (ACCOUNTING_FIXED_GAS_OVERHEAD/ACCOUNTING_PER_UPKEEP_GAS_OVERHEAD) by at least ' + + // actualGasOverhead.sub(chargedGasOverhead).toString(), + // ) + // assert.isTrue( + // chargedGasOverhead + // .sub(actualGasOverhead) + // .lt(gasCalculationMargin), + // 'Gas overhead calculated is too high, decrease account gas variables (ACCOUNTING_FIXED_GAS_OVERHEAD/ACCOUNTING_PER_SIGNER_GAS_OVERHEAD) by at least ' + + // chargedGasOverhead + // .sub(actualGasOverhead) + // .sub(gasCalculationMargin) + // .toString(), + // ) + // + // assert.isTrue( + // estimatedGasOverhead.gt(actualGasOverhead), + // 'Gas overhead estimated in check upkeep is too low, increase estimation gas variables (REGISTRY_CONDITIONAL_OVERHEAD/REGISTRY_LOG_OVERHEAD/REGISTRY_PER_SIGNER_GAS_OVERHEAD/REGISTRY_PER_PERFORM_BYTE_GAS_OVERHEAD) by at least ' + + // estimatedGasOverhead.sub(chargedGasOverhead).toString(), + // ) + // assert.isTrue( + // estimatedGasOverhead + // .sub(actualGasOverhead) + // .lt(gasEstimationMargin), + // 'Gas overhead estimated is too high, decrease estimation gas variables (REGISTRY_CONDITIONAL_OVERHEAD/REGISTRY_LOG_OVERHEAD/REGISTRY_PER_SIGNER_GAS_OVERHEAD/REGISTRY_PER_PERFORM_BYTE_GAS_OVERHEAD) by at least ' + + // estimatedGasOverhead + // .sub(actualGasOverhead) + // .sub(gasEstimationMargin) + // .toString(), + // ) + // }, + // ) + // }) + // }) + }) + }) + + describeMaybe( + '#transmit with upkeep batches [ @skip-coverage ]', + function () { + const numPassingConditionalUpkeepsArray = [0, 1, 5] + const numPassingLogUpkeepsArray = [0, 1, 5] + const numFailingUpkeepsArray = [0, 3] + + for (let idx = 0; idx < numPassingConditionalUpkeepsArray.length; idx++) { + for (let jdx = 0; jdx < numPassingLogUpkeepsArray.length; jdx++) { + for (let kdx = 0; kdx < numFailingUpkeepsArray.length; kdx++) { + const numPassingConditionalUpkeeps = + numPassingConditionalUpkeepsArray[idx] + const numPassingLogUpkeeps = numPassingLogUpkeepsArray[jdx] + const numFailingUpkeeps = numFailingUpkeepsArray[kdx] + if ( + numPassingConditionalUpkeeps == 0 && + numPassingLogUpkeeps == 0 + ) { + continue + } + it( + '[Conditional:' + + numPassingConditionalUpkeeps + + ',Log:' + + numPassingLogUpkeeps + + ',Failures:' + + numFailingUpkeeps + + '] performs successful upkeeps and does not charge failing upkeeps', + async () => { + const allUpkeeps = await getMultipleUpkeepsDeployedAndFunded( + numPassingConditionalUpkeeps, + numPassingLogUpkeeps, + numFailingUpkeeps, + ) + const passingConditionalUpkeepIds = + allUpkeeps.passingConditionalUpkeepIds + const passingLogUpkeepIds = allUpkeeps.passingLogUpkeepIds + const failingUpkeepIds = allUpkeeps.failingUpkeepIds + + const keeperBefore = await registry.getTransmitterInfo( + await keeper1.getAddress(), + ) + const keeperLinkBefore = await linkToken.balanceOf( + await keeper1.getAddress(), + ) + const registryLinkBefore = await linkToken.balanceOf( + registry.address, + ) + const registryPremiumBefore = (await registry.getState()).state + .totalPremium + const registrationConditionalPassingBefore = await Promise.all( + passingConditionalUpkeepIds.map(async (id) => { + const reg = await registry.getUpkeep(BigNumber.from(id)) + assert.equal(reg.lastPerformedBlockNumber.toString(), '0') + return reg + }), + ) + const registrationLogPassingBefore = await Promise.all( + passingLogUpkeepIds.map(async (id) => { + const reg = await registry.getUpkeep(BigNumber.from(id)) + assert.equal(reg.lastPerformedBlockNumber.toString(), '0') + return reg + }), + ) + const registrationFailingBefore = await Promise.all( + failingUpkeepIds.map(async (id) => { + const reg = await registry.getUpkeep(BigNumber.from(id)) + assert.equal(reg.lastPerformedBlockNumber.toString(), '0') + return reg + }), + ) + + // cancel upkeeps so they will fail in the transmit process + // must call the cancel upkeep as the owner to avoid the CANCELLATION_DELAY + for (let ldx = 0; ldx < failingUpkeepIds.length; ldx++) { + await registry + .connect(owner) + .cancelUpkeep(failingUpkeepIds[ldx]) + } + + const tx = await getTransmitTx( + registry, + keeper1, + passingConditionalUpkeepIds.concat( + passingLogUpkeepIds.concat(failingUpkeepIds), + ), + ) + + const receipt = await tx.wait() + const upkeepPerformedLogs = parseUpkeepPerformedLogs(receipt) + // exactly numPassingUpkeeps Upkeep Performed should be emitted + assert.equal( + upkeepPerformedLogs.length, + numPassingConditionalUpkeeps + numPassingLogUpkeeps, + ) + const cancelledUpkeepReportLogs = + parseCancelledUpkeepReportLogs(receipt) + // exactly numFailingUpkeeps Upkeep Performed should be emitted + assert.equal( + cancelledUpkeepReportLogs.length, + numFailingUpkeeps, + ) + + const keeperAfter = await registry.getTransmitterInfo( + await keeper1.getAddress(), + ) + const keeperLinkAfter = await linkToken.balanceOf( + await keeper1.getAddress(), + ) + const registryLinkAfter = await linkToken.balanceOf( + registry.address, + ) + const registrationConditionalPassingAfter = await Promise.all( + passingConditionalUpkeepIds.map(async (id) => { + return await registry.getUpkeep(BigNumber.from(id)) + }), + ) + const registrationLogPassingAfter = await Promise.all( + passingLogUpkeepIds.map(async (id) => { + return await registry.getUpkeep(BigNumber.from(id)) + }), + ) + const registrationFailingAfter = await Promise.all( + failingUpkeepIds.map(async (id) => { + return await registry.getUpkeep(BigNumber.from(id)) + }), + ) + const registryPremiumAfter = (await registry.getState()).state + .totalPremium + const premium = registryPremiumAfter.sub(registryPremiumBefore) + + let netPayment = BigNumber.from('0') + for (let i = 0; i < numPassingConditionalUpkeeps; i++) { + const id = upkeepPerformedLogs[i].args.id + const gasUsed = upkeepPerformedLogs[i].args.gasUsed + const gasOverhead = upkeepPerformedLogs[i].args.gasOverhead + const totalPayment = upkeepPerformedLogs[i].args.totalPayment + + expect(id).to.equal(passingConditionalUpkeepIds[i]) + assert.isTrue(gasUsed.gt(BigNumber.from('0'))) + assert.isTrue(gasOverhead.gt(BigNumber.from('0'))) + assert.isTrue(totalPayment.gt(BigNumber.from('0'))) + + // Balance should be deducted + assert.equal( + registrationConditionalPassingBefore[i].balance + .sub(totalPayment) + .toString(), + registrationConditionalPassingAfter[i].balance.toString(), + ) + + // Amount spent should be updated correctly + assert.equal( + registrationConditionalPassingAfter[i].amountSpent + .sub(totalPayment) + .toString(), + registrationConditionalPassingBefore[ + i + ].amountSpent.toString(), + ) + + // Last perform block number should be updated + assert.equal( + registrationConditionalPassingAfter[ + i + ].lastPerformedBlockNumber.toString(), + tx.blockNumber?.toString(), + ) + + netPayment = netPayment.add(totalPayment) + } + + for (let i = 0; i < numPassingLogUpkeeps; i++) { + const id = + upkeepPerformedLogs[numPassingConditionalUpkeeps + i].args + .id + const gasUsed = + upkeepPerformedLogs[numPassingConditionalUpkeeps + i].args + .gasUsed + const gasOverhead = + upkeepPerformedLogs[numPassingConditionalUpkeeps + i].args + .gasOverhead + const totalPayment = + upkeepPerformedLogs[numPassingConditionalUpkeeps + i].args + .totalPayment + + expect(id).to.equal(passingLogUpkeepIds[i]) + assert.isTrue(gasUsed.gt(BigNumber.from('0'))) + assert.isTrue(gasOverhead.gt(BigNumber.from('0'))) + assert.isTrue(totalPayment.gt(BigNumber.from('0'))) + + // Balance should be deducted + assert.equal( + registrationLogPassingBefore[i].balance + .sub(totalPayment) + .toString(), + registrationLogPassingAfter[i].balance.toString(), + ) + + // Amount spent should be updated correctly + assert.equal( + registrationLogPassingAfter[i].amountSpent + .sub(totalPayment) + .toString(), + registrationLogPassingBefore[i].amountSpent.toString(), + ) + + // Last perform block number should not be updated for log triggers + assert.equal( + registrationLogPassingAfter[ + i + ].lastPerformedBlockNumber.toString(), + '0', + ) + + netPayment = netPayment.add(totalPayment) + } + + for (let i = 0; i < numFailingUpkeeps; i++) { + // CancelledUpkeep log should be emitted + const id = cancelledUpkeepReportLogs[i].args.id + expect(id).to.equal(failingUpkeepIds[i]) + + // Balance and amount spent should be same + assert.equal( + registrationFailingBefore[i].balance.toString(), + registrationFailingAfter[i].balance.toString(), + ) + assert.equal( + registrationFailingBefore[i].amountSpent.toString(), + registrationFailingAfter[i].amountSpent.toString(), + ) + + // Last perform block number should not be updated + assert.equal( + registrationFailingAfter[ + i + ].lastPerformedBlockNumber.toString(), + '0', + ) + } + + // Keeper payment is gasPayment + premium / num keepers + const keeperPayment = netPayment + .sub(premium) + .add(premium.div(BigNumber.from(keeperAddresses.length))) + + // Keeper should be paid net payment for all passed upkeeps + assert.equal( + keeperAfter.balance.sub(keeperPayment).toString(), + keeperBefore.balance.toString(), + ) + + assert.isTrue(keeperLinkAfter.eq(keeperLinkBefore)) + assert.isTrue(registryLinkBefore.eq(registryLinkAfter)) + }, + ) + + it( + '[Conditional:' + + numPassingConditionalUpkeeps + + ',Log' + + numPassingLogUpkeeps + + ',Failures:' + + numFailingUpkeeps + + '] splits gas overhead appropriately among performed upkeeps [ @skip-coverage ]', + async () => { + const allUpkeeps = await getMultipleUpkeepsDeployedAndFunded( + numPassingConditionalUpkeeps, + numPassingLogUpkeeps, + numFailingUpkeeps, + ) + const passingConditionalUpkeepIds = + allUpkeeps.passingConditionalUpkeepIds + const passingLogUpkeepIds = allUpkeeps.passingLogUpkeepIds + const failingUpkeepIds = allUpkeeps.failingUpkeepIds + + // Perform the upkeeps once to remove non-zero storage slots and have predictable gas measurement + let tx = await getTransmitTx( + registry, + keeper1, + passingConditionalUpkeepIds.concat( + passingLogUpkeepIds.concat(failingUpkeepIds), + ), + ) + + await tx.wait() + + // cancel upkeeps so they will fail in the transmit process + // must call the cancel upkeep as the owner to avoid the CANCELLATION_DELAY + for (let ldx = 0; ldx < failingUpkeepIds.length; ldx++) { + await registry + .connect(owner) + .cancelUpkeep(failingUpkeepIds[ldx]) + } + + // Do the actual thing + + tx = await getTransmitTx( + registry, + keeper1, + passingConditionalUpkeepIds.concat( + passingLogUpkeepIds.concat(failingUpkeepIds), + ), + ) + + const receipt = await tx.wait() + const upkeepPerformedLogs = parseUpkeepPerformedLogs(receipt) + // exactly numPassingUpkeeps Upkeep Performed should be emitted + assert.equal( + upkeepPerformedLogs.length, + numPassingConditionalUpkeeps + numPassingLogUpkeeps, + ) + + let netGasUsedPlusChargedOverhead = BigNumber.from('0') + for (let i = 0; i < numPassingConditionalUpkeeps; i++) { + const gasUsed = upkeepPerformedLogs[i].args.gasUsed + const chargedGasOverhead = + upkeepPerformedLogs[i].args.gasOverhead + + assert.isTrue(gasUsed.gt(BigNumber.from('0'))) + assert.isTrue(chargedGasOverhead.gt(BigNumber.from('0'))) + + // Overhead should be same for every upkeep + assert.isTrue( + chargedGasOverhead.eq( + upkeepPerformedLogs[0].args.gasOverhead, + ), + ) + netGasUsedPlusChargedOverhead = netGasUsedPlusChargedOverhead + .add(gasUsed) + .add(chargedGasOverhead) + } + + for (let i = 0; i < numPassingLogUpkeeps; i++) { + const gasUsed = + upkeepPerformedLogs[numPassingConditionalUpkeeps + i].args + .gasUsed + const chargedGasOverhead = + upkeepPerformedLogs[numPassingConditionalUpkeeps + i].args + .gasOverhead + + assert.isTrue(gasUsed.gt(BigNumber.from('0'))) + assert.isTrue(chargedGasOverhead.gt(BigNumber.from('0'))) + + // Overhead should be same for every upkeep + assert.isTrue( + chargedGasOverhead.eq( + upkeepPerformedLogs[numPassingConditionalUpkeeps].args + .gasOverhead, + ), + ) + netGasUsedPlusChargedOverhead = netGasUsedPlusChargedOverhead + .add(gasUsed) + .add(chargedGasOverhead) + } + + console.log( + 'Gas Benchmarking - batching (passedConditionalUpkeeps: ', + numPassingConditionalUpkeeps, + 'passedLogUpkeeps:', + numPassingLogUpkeeps, + 'failedUpkeeps:', + numFailingUpkeeps, + '): ', + numPassingConditionalUpkeeps > 0 + ? 'charged conditional overhead' + : '', + numPassingConditionalUpkeeps > 0 + ? upkeepPerformedLogs[0].args.gasOverhead.toString() + : '', + numPassingLogUpkeeps > 0 ? 'charged log overhead' : '', + numPassingLogUpkeeps > 0 + ? upkeepPerformedLogs[ + numPassingConditionalUpkeeps + ].args.gasOverhead.toString() + : '', + ' margin over gasUsed', + netGasUsedPlusChargedOverhead.sub(receipt.gasUsed).toString(), + ) + + // The total gas charged should be greater than tx gas + assert.isTrue( + netGasUsedPlusChargedOverhead.gt(receipt.gasUsed), + 'Charged gas overhead is too low for batch upkeeps, increase ACCOUNTING_PER_UPKEEP_GAS_OVERHEAD', + ) + }, + ) + } + } + } + + it('has enough perform gas overhead for large batches [ @skip-coverage ]', async () => { + const numUpkeeps = 20 + const upkeepIds: BigNumber[] = [] + let totalPerformGas = BigNumber.from('0') + for (let i = 0; i < numUpkeeps; i++) { + const mock = await upkeepMockFactory.deploy() + const tx = await registry + .connect(owner) + .registerUpkeep( + mock.address, + performGas, + await admin.getAddress(), + Trigger.CONDITION, + linkToken.address, + '0x', + '0x', + '0x', + ) + const testUpkeepId = await getUpkeepID(tx) + upkeepIds.push(testUpkeepId) + + // Add funds to passing upkeeps + await registry.connect(owner).addFunds(testUpkeepId, toWei('10')) + + await mock.setCanPerform(true) + await mock.setPerformGasToBurn(performGas) + + totalPerformGas = totalPerformGas.add(performGas) + } + + // Should revert with no overhead added + await evmRevert( + getTransmitTx(registry, keeper1, upkeepIds, { + gasLimit: totalPerformGas, + }), + ) + // Should not revert with overhead added + await getTransmitTx(registry, keeper1, upkeepIds, { + gasLimit: totalPerformGas.add(transmitGasOverhead), + }) + }) + }, + ) + + describe('#recoverFunds', () => { + const sent = toWei('7') + + beforeEach(async () => { + await linkToken.connect(admin).approve(registry.address, toWei('100')) + await linkToken + .connect(owner) + .transfer(await keeper1.getAddress(), toWei('1000')) + + // add funds to upkeep 1 and perform and withdraw some payment + const tx = await registry + .connect(owner) + .registerUpkeep( + mock.address, + performGas, + await admin.getAddress(), + Trigger.CONDITION, + linkToken.address, + '0x', + '0x', + '0x', + ) + + const id1 = await getUpkeepID(tx) + await registry.connect(admin).addFunds(id1, toWei('5')) + + await getTransmitTx(registry, keeper1, [id1]) + await getTransmitTx(registry, keeper2, [id1]) + await getTransmitTx(registry, keeper3, [id1]) + + await registry + .connect(payee1) + .withdrawPayment( + await keeper1.getAddress(), + await nonkeeper.getAddress(), + ) + + // transfer funds directly to the registry + await linkToken.connect(keeper1).transfer(registry.address, sent) + + // add funds to upkeep 2 and perform and withdraw some payment + const tx2 = await registry + .connect(owner) + .registerUpkeep( + mock.address, + performGas, + await admin.getAddress(), + Trigger.CONDITION, + linkToken.address, + '0x', + '0x', + '0x', + ) + const id2 = await getUpkeepID(tx2) + await registry.connect(admin).addFunds(id2, toWei('5')) + + await getTransmitTx(registry, keeper1, [id2]) + await getTransmitTx(registry, keeper2, [id2]) + await getTransmitTx(registry, keeper3, [id2]) + + await registry + .connect(payee2) + .withdrawPayment( + await keeper2.getAddress(), + await nonkeeper.getAddress(), + ) + + // transfer funds using onTokenTransfer + const data = ethers.utils.defaultAbiCoder.encode(['uint256'], [id2]) + await linkToken + .connect(owner) + .transferAndCall(registry.address, toWei('1'), data) + + // withdraw some funds + await registry.connect(owner).cancelUpkeep(id1) + await registry + .connect(admin) + .withdrawFunds(id1, await nonkeeper.getAddress()) + }) + }) + + describe('#getMinBalanceForUpkeep / #checkUpkeep / #transmit', () => { + it('calculates the minimum balance appropriately', async () => { + await mock.setCanCheck(true) + + const oneWei = BigNumber.from(1) + const minBalance = await registry.getMinBalanceForUpkeep(upkeepId) + const tooLow = minBalance.sub(oneWei) + + await registry.connect(admin).addFunds(upkeepId, tooLow) + let checkUpkeepResult = await registry + .connect(zeroAddress) + .callStatic['checkUpkeep(uint256)'](upkeepId) + + assert.equal(checkUpkeepResult.upkeepNeeded, false) + assert.equal( + checkUpkeepResult.upkeepFailureReason, + UpkeepFailureReason.INSUFFICIENT_BALANCE, + ) + + await registry.connect(admin).addFunds(upkeepId, oneWei) + checkUpkeepResult = await registry + .connect(zeroAddress) + .callStatic['checkUpkeep(uint256)'](upkeepId) + assert.equal(checkUpkeepResult.upkeepNeeded, true) + }) + + it('uses maxPerformData size in checkUpkeep but actual performDataSize in transmit', async () => { + const tx = await registry + .connect(owner) + .registerUpkeep( + mock.address, + performGas, + await admin.getAddress(), + Trigger.CONDITION, + linkToken.address, + '0x', + '0x', + '0x', + ) + const upkeepID = await getUpkeepID(tx) + await mock.setCanCheck(true) + await mock.setCanPerform(true) + + // upkeep is underfunded by 1 wei + const minBalance1 = (await registry.getMinBalanceForUpkeep(upkeepID)).sub( + 1, + ) + await registry.connect(owner).addFunds(upkeepID, minBalance1) + + // upkeep check should return false, 2 should return true + const checkUpkeepResult = await registry + .connect(zeroAddress) + .callStatic['checkUpkeep(uint256)'](upkeepID) + assert.equal(checkUpkeepResult.upkeepNeeded, false) + assert.equal( + checkUpkeepResult.upkeepFailureReason, + UpkeepFailureReason.INSUFFICIENT_BALANCE, + ) + + // however upkeep should perform and pay all the remaining balance + let maxPerformData = '0x' + for (let i = 0; i < maxPerformDataSize.toNumber(); i++) { + maxPerformData += '11' + } + + const tx2 = await getTransmitTx(registry, keeper1, [upkeepID], { + gasPrice: gasWei.mul(gasCeilingMultiplier), + performDatas: [maxPerformData], + }) + + const receipt = await tx2.wait() + const upkeepPerformedLogs = parseUpkeepPerformedLogs(receipt) + assert.equal(upkeepPerformedLogs.length, 1) + }) + }) + + describe('#withdrawFunds', () => { + let upkeepId2: BigNumber + + beforeEach(async () => { + const tx = await registry + .connect(owner) + .registerUpkeep( + mock.address, + performGas, + await admin.getAddress(), + Trigger.CONDITION, + linkToken.address, + '0x', + '0x', + '0x', + ) + upkeepId2 = await getUpkeepID(tx) + + await registry.connect(admin).addFunds(upkeepId, toWei('100')) + await registry.connect(admin).addFunds(upkeepId2, toWei('100')) + + // Do a perform so that upkeep is charged some amount + await getTransmitTx(registry, keeper1, [upkeepId]) + await getTransmitTx(registry, keeper1, [upkeepId2]) + }) + + describe('after the registration is paused, then cancelled', () => { + it('allows the admin to withdraw', async () => { + const balance = await registry.getBalance(upkeepId) + const payee = await payee1.getAddress() + await registry.connect(admin).pauseUpkeep(upkeepId) + await registry.connect(owner).cancelUpkeep(upkeepId) + await expect(() => + registry.connect(admin).withdrawFunds(upkeepId, payee), + ).to.changeTokenBalance(linkToken, payee1, balance) + }) + }) + + describe('after the registration is cancelled', () => { + beforeEach(async () => { + await registry.connect(owner).cancelUpkeep(upkeepId) + await registry.connect(owner).cancelUpkeep(upkeepId2) + }) + + it('can be called successively on two upkeeps', async () => { + await registry + .connect(admin) + .withdrawFunds(upkeepId, await payee1.getAddress()) + await registry + .connect(admin) + .withdrawFunds(upkeepId2, await payee1.getAddress()) + }) + + it('moves the funds out and updates the balance and emits an event', async () => { + const payee1Before = await linkToken.balanceOf( + await payee1.getAddress(), + ) + const registryBefore = await linkToken.balanceOf(registry.address) + + let registration = await registry.getUpkeep(upkeepId) + const previousBalance = registration.balance + + const tx = await registry + .connect(admin) + .withdrawFunds(upkeepId, await payee1.getAddress()) + await expect(tx) + .to.emit(registry, 'FundsWithdrawn') + .withArgs(upkeepId, previousBalance, await payee1.getAddress()) + + const payee1After = await linkToken.balanceOf(await payee1.getAddress()) + const registryAfter = await linkToken.balanceOf(registry.address) + + assert.isTrue(payee1Before.add(previousBalance).eq(payee1After)) + assert.isTrue(registryBefore.sub(previousBalance).eq(registryAfter)) + + registration = await registry.getUpkeep(upkeepId) + assert.equal(registration.balance.toNumber(), 0) + }) + }) + }) + + describe('#simulatePerformUpkeep', () => { + it('reverts if called by non zero address', async () => { + await evmRevertCustomError( + registry + .connect(await owner.getAddress()) + .callStatic.simulatePerformUpkeep(upkeepId, '0x'), + registry, + 'OnlySimulatedBackend', + ) + }) + + it('reverts when registry is paused', async () => { + await registry.connect(owner).pause() + await evmRevertCustomError( + registry + .connect(zeroAddress) + .callStatic.simulatePerformUpkeep(upkeepId, '0x'), + registry, + 'RegistryPaused', + ) + }) + + it('returns false and gasUsed when perform fails', async () => { + await mock.setCanPerform(false) + + const simulatePerformResult = await registry + .connect(zeroAddress) + .callStatic.simulatePerformUpkeep(upkeepId, '0x') + + assert.equal(simulatePerformResult.success, false) + assert.isTrue(simulatePerformResult.gasUsed.gt(BigNumber.from('0'))) // Some gas should be used + }) + + it('returns true, gasUsed, and performGas when perform succeeds', async () => { + await mock.setCanPerform(true) + + const simulatePerformResult = await registry + .connect(zeroAddress) + .callStatic.simulatePerformUpkeep(upkeepId, '0x') + + assert.equal(simulatePerformResult.success, true) + assert.isTrue(simulatePerformResult.gasUsed.gt(BigNumber.from('0'))) // Some gas should be used + }) + + it('returns correct amount of gasUsed when perform succeeds', async () => { + await mock.setCanPerform(true) + await mock.setPerformGasToBurn(performGas) // 1,000,000 + + // increase upkeep gas limit because the mock gas bound caller will always return 500,000 as the L1 gas used + // that brings the total gas used to about 1M + 0.5M = 1.5M + await registry + .connect(admin) + .setUpkeepGasLimit(upkeepId, BigNumber.from(2000000)) + + const simulatePerformResult = await registry + .connect(zeroAddress) + .callStatic.simulatePerformUpkeep(upkeepId, '0x') + + // Full execute gas should be used, with some performGasBuffer(1000) + assert.isTrue( + simulatePerformResult.gasUsed.gt( + performGas.add(pubdataGas).sub(BigNumber.from('1000')), + ), + ) + }) + }) + + describe('#checkUpkeep', () => { + it('reverts if called by non zero address', async () => { + await evmRevertCustomError( + registry + .connect(await owner.getAddress()) + .callStatic['checkUpkeep(uint256)'](upkeepId), + registry, + 'OnlySimulatedBackend', + ) + }) + + it('returns false and error code if the upkeep is cancelled by admin', async () => { + await registry.connect(admin).cancelUpkeep(upkeepId) + + const checkUpkeepResult = await registry + .connect(zeroAddress) + .callStatic['checkUpkeep(uint256)'](upkeepId) + + assert.equal(checkUpkeepResult.upkeepNeeded, false) + assert.equal(checkUpkeepResult.performData, '0x') + assert.equal( + checkUpkeepResult.upkeepFailureReason, + UpkeepFailureReason.UPKEEP_CANCELLED, + ) + expect(checkUpkeepResult.gasUsed).to.equal(0) + expect(checkUpkeepResult.gasLimit).to.equal(performGas) + }) + + it('returns false and error code if the upkeep is cancelled by owner', async () => { + await registry.connect(owner).cancelUpkeep(upkeepId) + + const checkUpkeepResult = await registry + .connect(zeroAddress) + .callStatic['checkUpkeep(uint256)'](upkeepId) + + assert.equal(checkUpkeepResult.upkeepNeeded, false) + assert.equal(checkUpkeepResult.performData, '0x') + assert.equal( + checkUpkeepResult.upkeepFailureReason, + UpkeepFailureReason.UPKEEP_CANCELLED, + ) + expect(checkUpkeepResult.gasUsed).to.equal(0) + expect(checkUpkeepResult.gasLimit).to.equal(performGas) + }) + + it('returns false and error code if the registry is paused', async () => { + await registry.connect(owner).pause() + + const checkUpkeepResult = await registry + .connect(zeroAddress) + .callStatic['checkUpkeep(uint256)'](upkeepId) + + assert.equal(checkUpkeepResult.upkeepNeeded, false) + assert.equal(checkUpkeepResult.performData, '0x') + assert.equal( + checkUpkeepResult.upkeepFailureReason, + UpkeepFailureReason.REGISTRY_PAUSED, + ) + expect(checkUpkeepResult.gasUsed).to.equal(0) + expect(checkUpkeepResult.gasLimit).to.equal(performGas) + }) + + it('returns false and error code if the upkeep is paused', async () => { + await registry.connect(admin).pauseUpkeep(upkeepId) + + const checkUpkeepResult = await registry + .connect(zeroAddress) + .callStatic['checkUpkeep(uint256)'](upkeepId) + + assert.equal(checkUpkeepResult.upkeepNeeded, false) + assert.equal(checkUpkeepResult.performData, '0x') + assert.equal( + checkUpkeepResult.upkeepFailureReason, + UpkeepFailureReason.UPKEEP_PAUSED, + ) + expect(checkUpkeepResult.gasUsed).to.equal(0) + expect(checkUpkeepResult.gasLimit).to.equal(performGas) + }) + + it('returns false and error code if user is out of funds', async () => { + const checkUpkeepResult = await registry + .connect(zeroAddress) + .callStatic['checkUpkeep(uint256)'](upkeepId) + + assert.equal(checkUpkeepResult.upkeepNeeded, false) + assert.equal(checkUpkeepResult.performData, '0x') + assert.equal( + checkUpkeepResult.upkeepFailureReason, + UpkeepFailureReason.INSUFFICIENT_BALANCE, + ) + expect(checkUpkeepResult.gasUsed).to.equal(0) + expect(checkUpkeepResult.gasLimit).to.equal(performGas) + }) + + context('when the registration is funded', () => { + beforeEach(async () => { + await linkToken.connect(admin).approve(registry.address, toWei('200')) + await registry.connect(admin).addFunds(upkeepId, toWei('100')) + await registry.connect(admin).addFunds(logUpkeepId, toWei('100')) + }) + + it('returns false, error code, and revert data if the target check reverts', async () => { + await mock.setShouldRevertCheck(true) + await mock.setCheckRevertReason( + 'custom revert error, clever way to insert offchain data', + ) + const checkUpkeepResult = await registry + .connect(zeroAddress) + .callStatic['checkUpkeep(uint256)'](upkeepId) + assert.equal(checkUpkeepResult.upkeepNeeded, false) + + const revertReasonBytes = `0x${checkUpkeepResult.performData.slice(10)}` // remove sighash + assert.equal( + ethers.utils.defaultAbiCoder.decode(['string'], revertReasonBytes)[0], + 'custom revert error, clever way to insert offchain data', + ) + assert.equal( + checkUpkeepResult.upkeepFailureReason, + UpkeepFailureReason.TARGET_CHECK_REVERTED, + ) + assert.isTrue(checkUpkeepResult.gasUsed.gt(BigNumber.from('0'))) // Some gas should be used + expect(checkUpkeepResult.gasLimit).to.equal(performGas) + // Feed data should be returned here + assert.isTrue(checkUpkeepResult.fastGasWei.gt(BigNumber.from('0'))) + assert.isTrue(checkUpkeepResult.linkUSD.gt(BigNumber.from('0'))) + }) + + it('returns false, error code, and no revert data if the target check revert data exceeds maxRevertDataSize', async () => { + await mock.setShouldRevertCheck(true) + let longRevertReason = '' + for (let i = 0; i <= maxRevertDataSize.toNumber(); i++) { + longRevertReason += 'x' + } + await mock.setCheckRevertReason(longRevertReason) + const checkUpkeepResult = await registry + .connect(zeroAddress) + .callStatic['checkUpkeep(uint256)'](upkeepId) + assert.equal(checkUpkeepResult.upkeepNeeded, false) + + assert.equal(checkUpkeepResult.performData, '0x') + assert.equal( + checkUpkeepResult.upkeepFailureReason, + UpkeepFailureReason.REVERT_DATA_EXCEEDS_LIMIT, + ) + assert.isTrue(checkUpkeepResult.gasUsed.gt(BigNumber.from('0'))) // Some gas should be used + expect(checkUpkeepResult.gasLimit).to.equal(performGas) + }) + + it('returns false and error code if the upkeep is not needed', async () => { + await mock.setCanCheck(false) + const checkUpkeepResult = await registry + .connect(zeroAddress) + .callStatic['checkUpkeep(uint256)'](upkeepId) + + assert.equal(checkUpkeepResult.upkeepNeeded, false) + assert.equal(checkUpkeepResult.performData, '0x') + assert.equal( + checkUpkeepResult.upkeepFailureReason, + UpkeepFailureReason.UPKEEP_NOT_NEEDED, + ) + assert.isTrue(checkUpkeepResult.gasUsed.gt(BigNumber.from('0'))) // Some gas should be used + expect(checkUpkeepResult.gasLimit).to.equal(performGas) + }) + + it('returns false and error code if the performData exceeds limit', async () => { + let longBytes = '0x' + for (let i = 0; i < 5000; i++) { + longBytes += '1' + } + await mock.setCanCheck(true) + await mock.setPerformData(longBytes) + + const checkUpkeepResult = await registry + .connect(zeroAddress) + .callStatic['checkUpkeep(uint256)'](upkeepId) + + assert.equal(checkUpkeepResult.upkeepNeeded, false) + assert.equal(checkUpkeepResult.performData, '0x') + assert.equal( + checkUpkeepResult.upkeepFailureReason, + UpkeepFailureReason.PERFORM_DATA_EXCEEDS_LIMIT, + ) + assert.isTrue(checkUpkeepResult.gasUsed.gt(BigNumber.from('0'))) // Some gas should be used + expect(checkUpkeepResult.gasLimit).to.equal(performGas) + }) + + it('returns true with gas used if the target can execute', async () => { + await mock.setCanCheck(true) + await mock.setPerformData(randomBytes) + + const latestBlock = await ethers.provider.getBlock('latest') + + const checkUpkeepResult = await registry + .connect(zeroAddress) + .callStatic['checkUpkeep(uint256)'](upkeepId, { + blockTag: latestBlock.number, + }) + + assert.equal(checkUpkeepResult.upkeepNeeded, true) + assert.equal(checkUpkeepResult.performData, randomBytes) + assert.equal( + checkUpkeepResult.upkeepFailureReason, + UpkeepFailureReason.NONE, + ) + assert.isTrue(checkUpkeepResult.gasUsed.gt(BigNumber.from('0'))) // Some gas should be used + expect(checkUpkeepResult.gasLimit).to.equal(performGas) + assert.isTrue(checkUpkeepResult.fastGasWei.eq(gasWei)) + assert.isTrue(checkUpkeepResult.linkUSD.eq(linkUSD)) + }) + + it('calls checkLog for log-trigger upkeeps', async () => { + const log: Log = { + index: 0, + timestamp: 0, + txHash: ethers.utils.randomBytes(32), + blockNumber: 100, + blockHash: ethers.utils.randomBytes(32), + source: randomAddress(), + topics: [ethers.utils.randomBytes(32), ethers.utils.randomBytes(32)], + data: ethers.utils.randomBytes(1000), + } + + await ltUpkeep.mock.checkLog.withArgs(log, '0x').returns(true, '0x1234') + + const checkData = encodeLog(log) + + const checkUpkeepResult = await registry + .connect(zeroAddress) + .callStatic['checkUpkeep(uint256,bytes)'](logUpkeepId, checkData) + + expect(checkUpkeepResult.upkeepNeeded).to.be.true + expect(checkUpkeepResult.performData).to.equal('0x1234') + }) + + itMaybe( + 'has a large enough gas overhead to cover upkeeps that use all their gas [ @skip-coverage ]', + async () => { + await mock.setCanCheck(true) + await mock.setCheckGasToBurn(checkGasLimit) + const gas = checkGasLimit.add(checkGasOverhead) + const checkUpkeepResult = await registry + .connect(zeroAddress) + .callStatic['checkUpkeep(uint256)'](upkeepId, { + gasLimit: gas, + }) + + assert.equal(checkUpkeepResult.upkeepNeeded, true) + }, + ) + }) + }) + + describe('#getMaxPaymentForGas', () => { + itMaybe('calculates the max fee appropriately in ZKSync', async () => { + await verifyMaxPayment(registry, moduleBase) + }) + + it('uses the fallback gas price if the feed has issues in ZKSync', async () => { + const chainModuleOverheads = await moduleBase.getGasOverhead() + const expectedFallbackMaxPayment = linkForGas( + performGas, + registryConditionalOverhead + .add(registryPerSignerGasOverhead.mul(f + 1)) + .add(chainModuleOverheads.chainModuleFixedOverhead), + gasCeilingMultiplier.mul('2'), // fallbackGasPrice is 2x gas price + paymentPremiumPPB, + flatFeeMilliCents, + ).total + + // Stale feed + let roundId = 99 + const answer = 100 + let updatedAt = 946684800 // New Years 2000 🥳 + let startedAt = 946684799 + await gasPriceFeed + .connect(owner) + .updateRoundData(roundId, answer, updatedAt, startedAt) + + assert.equal( + expectedFallbackMaxPayment.toString(), + ( + await registry.getMaxPaymentForGas( + upkeepId, + Trigger.CONDITION, + performGas, + linkToken.address, + ) + ).toString(), + ) + + // Negative feed price + roundId = 100 + updatedAt = now() + startedAt = 946684799 + await gasPriceFeed + .connect(owner) + .updateRoundData(roundId, -100, updatedAt, startedAt) + + assert.equal( + expectedFallbackMaxPayment.toString(), + ( + await registry.getMaxPaymentForGas( + upkeepId, + Trigger.CONDITION, + performGas, + linkToken.address, + ) + ).toString(), + ) + + // Zero feed price + roundId = 101 + updatedAt = now() + startedAt = 946684799 + await gasPriceFeed + .connect(owner) + .updateRoundData(roundId, 0, updatedAt, startedAt) + + assert.equal( + expectedFallbackMaxPayment.toString(), + ( + await registry.getMaxPaymentForGas( + upkeepId, + Trigger.CONDITION, + performGas, + linkToken.address, + ) + ).toString(), + ) + }) + + it('uses the fallback link price if the feed has issues in ZKSync', async () => { + const chainModuleOverheads = await moduleBase.getGasOverhead() + const expectedFallbackMaxPayment = linkForGas( + performGas, + registryConditionalOverhead + .add(registryPerSignerGasOverhead.mul(f + 1)) + .add(chainModuleOverheads.chainModuleFixedOverhead), + gasCeilingMultiplier.mul('2'), // fallbackLinkPrice is 1/2 link price, so multiply by 2 + paymentPremiumPPB, + flatFeeMilliCents, + ).total + + // Stale feed + let roundId = 99 + const answer = 100 + let updatedAt = 946684800 // New Years 2000 🥳 + let startedAt = 946684799 + await linkUSDFeed + .connect(owner) + .updateRoundData(roundId, answer, updatedAt, startedAt) + + assert.equal( + expectedFallbackMaxPayment.toString(), + ( + await registry.getMaxPaymentForGas( + upkeepId, + Trigger.CONDITION, + performGas, + linkToken.address, + ) + ).toString(), + ) + + // Negative feed price + roundId = 100 + updatedAt = now() + startedAt = 946684799 + await linkUSDFeed + .connect(owner) + .updateRoundData(roundId, -100, updatedAt, startedAt) + + assert.equal( + expectedFallbackMaxPayment.toString(), + ( + await registry.getMaxPaymentForGas( + upkeepId, + Trigger.CONDITION, + performGas, + linkToken.address, + ) + ).toString(), + ) + + // Zero feed price + roundId = 101 + updatedAt = now() + startedAt = 946684799 + await linkUSDFeed + .connect(owner) + .updateRoundData(roundId, 0, updatedAt, startedAt) + + assert.equal( + expectedFallbackMaxPayment.toString(), + ( + await registry.getMaxPaymentForGas( + upkeepId, + Trigger.CONDITION, + performGas, + linkToken.address, + ) + ).toString(), + ) + }) + }) + + describe('#typeAndVersion', () => { + it('uses the correct type and version', async () => { + const typeAndVersion = await registry.typeAndVersion() + assert.equal(typeAndVersion, 'AutomationRegistry 2.3.0') + }) + }) + + describeMaybe('#setConfig - onchain', async () => { + const maxGas = BigNumber.from(6) + const staleness = BigNumber.from(4) + const ceiling = BigNumber.from(5) + const newMaxCheckDataSize = BigNumber.from(10000) + const newMaxPerformDataSize = BigNumber.from(10000) + const newMaxRevertDataSize = BigNumber.from(10000) + const newMaxPerformGas = BigNumber.from(10000000) + const fbGasEth = BigNumber.from(7) + const fbLinkEth = BigNumber.from(8) + const fbNativeEth = BigNumber.from(100) + const newTranscoder = randomAddress() + const newRegistrars = [randomAddress(), randomAddress()] + const upkeepManager = randomAddress() + const financeAdminAddress = randomAddress() + + const newConfig: OnChainConfig = { + checkGasLimit: maxGas, + stalenessSeconds: staleness, + gasCeilingMultiplier: ceiling, + maxCheckDataSize: newMaxCheckDataSize, + maxPerformDataSize: newMaxPerformDataSize, + maxRevertDataSize: newMaxRevertDataSize, + maxPerformGas: newMaxPerformGas, + fallbackGasPrice: fbGasEth, + fallbackLinkPrice: fbLinkEth, + fallbackNativePrice: fbNativeEth, + transcoder: newTranscoder, + registrars: newRegistrars, + upkeepPrivilegeManager: upkeepManager, + chainModule: moduleBase.address, + reorgProtectionEnabled: true, + financeAdmin: financeAdminAddress, + } + + it('reverts when called by anyone but the proposed owner', async () => { + await evmRevert( + registry + .connect(payee1) + .setConfigTypeSafe( + signerAddresses, + keeperAddresses, + f, + newConfig, + offchainVersion, + offchainBytes, + baseConfig[6], + baseConfig[7], + ), + 'Only callable by owner', + ) + }) + + it('reverts if signers or transmitters are the zero address', async () => { + await evmRevertCustomError( + registry + .connect(owner) + .setConfigTypeSafe( + [randomAddress(), randomAddress(), randomAddress(), zeroAddress], + [ + randomAddress(), + randomAddress(), + randomAddress(), + randomAddress(), + ], + f, + newConfig, + offchainVersion, + offchainBytes, + baseConfig[6], + baseConfig[7], + ), + registry, + 'InvalidSigner', + ) + + await evmRevertCustomError( + registry + .connect(owner) + .setConfigTypeSafe( + [ + randomAddress(), + randomAddress(), + randomAddress(), + randomAddress(), + ], + [randomAddress(), randomAddress(), randomAddress(), zeroAddress], + f, + newConfig, + offchainVersion, + offchainBytes, + baseConfig[6], + baseConfig[7], + ), + registry, + 'InvalidTransmitter', + ) + }) + + it('updates the onchainConfig and configDigest', async () => { + const old = await registry.getState() + const oldConfig = await registry.getConfig() + const oldState = old.state + assert.isTrue(stalenessSeconds.eq(oldConfig.stalenessSeconds)) + assert.isTrue(gasCeilingMultiplier.eq(oldConfig.gasCeilingMultiplier)) + + await registry + .connect(owner) + .setConfigTypeSafe( + signerAddresses, + keeperAddresses, + f, + newConfig, + offchainVersion, + offchainBytes, + [], + [], + ) + + const updated = await registry.getState() + const updatedConfig = updated.config + const updatedState = updated.state + assert.equal(updatedConfig.stalenessSeconds, staleness.toNumber()) + assert.equal(updatedConfig.gasCeilingMultiplier, ceiling.toNumber()) + assert.equal( + updatedConfig.maxCheckDataSize, + newMaxCheckDataSize.toNumber(), + ) + assert.equal( + updatedConfig.maxPerformDataSize, + newMaxPerformDataSize.toNumber(), + ) + assert.equal( + updatedConfig.maxRevertDataSize, + newMaxRevertDataSize.toNumber(), + ) + assert.equal(updatedConfig.maxPerformGas, newMaxPerformGas.toNumber()) + assert.equal(updatedConfig.checkGasLimit, maxGas.toNumber()) + assert.equal( + updatedConfig.fallbackGasPrice.toNumber(), + fbGasEth.toNumber(), + ) + assert.equal( + updatedConfig.fallbackLinkPrice.toNumber(), + fbLinkEth.toNumber(), + ) + assert.equal(updatedState.latestEpoch, 0) + + assert(oldState.configCount + 1 == updatedState.configCount) + assert( + oldState.latestConfigBlockNumber != + updatedState.latestConfigBlockNumber, + ) + assert(oldState.latestConfigDigest != updatedState.latestConfigDigest) + + assert.equal(updatedConfig.transcoder, newTranscoder) + assert.deepEqual(updatedConfig.registrars, newRegistrars) + assert.equal(updatedConfig.upkeepPrivilegeManager, upkeepManager) + }) + + it('maintains paused state when config is changed', async () => { + await registry.pause() + const old = await registry.getState() + assert.isTrue(old.state.paused) + + await registry + .connect(owner) + .setConfigTypeSafe( + signerAddresses, + keeperAddresses, + f, + newConfig, + offchainVersion, + offchainBytes, + [], + [], + ) + + const updated = await registry.getState() + assert.isTrue(updated.state.paused) + }) + + it('emits an event', async () => { + const tx = await registry + .connect(owner) + .setConfigTypeSafe( + signerAddresses, + keeperAddresses, + f, + newConfig, + offchainVersion, + offchainBytes, + [], + [], + ) + await expect(tx).to.emit(registry, 'ConfigSet') + }) + }) + + describe('#setConfig - offchain', () => { + let newKeepers: string[] + + beforeEach(async () => { + newKeepers = [ + await personas.Eddy.getAddress(), + await personas.Nick.getAddress(), + await personas.Neil.getAddress(), + await personas.Carol.getAddress(), + ] + }) + + it('reverts when called by anyone but the owner', async () => { + await evmRevert( + registry + .connect(payee1) + .setConfigTypeSafe( + newKeepers, + newKeepers, + f, + config, + offchainVersion, + offchainBytes, + baseConfig[6], + baseConfig[7], + ), + 'Only callable by owner', + ) + }) + + it('reverts if too many keeperAddresses set', async () => { + for (let i = 0; i < 40; i++) { + newKeepers.push(randomAddress()) + } + await evmRevertCustomError( + registry + .connect(owner) + .setConfigTypeSafe( + newKeepers, + newKeepers, + f, + config, + offchainVersion, + offchainBytes, + baseConfig[6], + baseConfig[7], + ), + registry, + 'TooManyOracles', + ) + }) + + it('reverts if f=0', async () => { + await evmRevertCustomError( + registry + .connect(owner) + .setConfigTypeSafe( + newKeepers, + newKeepers, + 0, + config, + offchainVersion, + offchainBytes, + baseConfig[6], + baseConfig[7], + ), + registry, + 'IncorrectNumberOfFaultyOracles', + ) + }) + + it('reverts if signers != transmitters length', async () => { + const signers = [randomAddress()] + await evmRevertCustomError( + registry + .connect(owner) + .setConfigTypeSafe( + signers, + newKeepers, + f, + config, + offchainVersion, + offchainBytes, + baseConfig[6], + baseConfig[7], + ), + registry, + 'IncorrectNumberOfSigners', + ) + }) + + it('reverts if signers <= 3f', async () => { + newKeepers.pop() + await evmRevertCustomError( + registry + .connect(owner) + .setConfigTypeSafe( + newKeepers, + newKeepers, + f, + config, + offchainVersion, + offchainBytes, + baseConfig[6], + baseConfig[7], + ), + registry, + 'IncorrectNumberOfSigners', + ) + }) + + it('reverts on repeated signers', async () => { + const newSigners = [ + await personas.Eddy.getAddress(), + await personas.Eddy.getAddress(), + await personas.Eddy.getAddress(), + await personas.Eddy.getAddress(), + ] + await evmRevertCustomError( + registry + .connect(owner) + .setConfigTypeSafe( + newSigners, + newKeepers, + f, + config, + offchainVersion, + offchainBytes, + baseConfig[6], + baseConfig[7], + ), + registry, + 'RepeatedSigner', + ) + }) + + it('reverts on repeated transmitters', async () => { + const newTransmitters = [ + await personas.Eddy.getAddress(), + await personas.Eddy.getAddress(), + await personas.Eddy.getAddress(), + await personas.Eddy.getAddress(), + ] + await evmRevertCustomError( + registry + .connect(owner) + .setConfigTypeSafe( + newKeepers, + newTransmitters, + f, + config, + offchainVersion, + offchainBytes, + baseConfig[6], + baseConfig[7], + ), + registry, + 'RepeatedTransmitter', + ) + }) + + itMaybe('stores new config and emits event', async () => { + // Perform an upkeep so that totalPremium is updated + await registry.connect(admin).addFunds(upkeepId, toWei('100')) + let tx = await getTransmitTx(registry, keeper1, [upkeepId]) + await tx.wait() + + const newOffChainVersion = BigNumber.from('2') + const newOffChainConfig = '0x1122' + + const old = await registry.getState() + const oldState = old.state + assert(oldState.totalPremium.gt(BigNumber.from('0'))) + + const newSigners = newKeepers + tx = await registry + .connect(owner) + .setConfigTypeSafe( + newSigners, + newKeepers, + f, + config, + newOffChainVersion, + newOffChainConfig, + [], + [], + ) + + const updated = await registry.getState() + const updatedState = updated.state + assert(oldState.totalPremium.eq(updatedState.totalPremium)) + + // Old signer addresses which are not in new signers should be non active + for (let i = 0; i < signerAddresses.length; i++) { + const signer = signerAddresses[i] + if (!newSigners.includes(signer)) { + assert(!(await registry.getSignerInfo(signer)).active) + assert((await registry.getSignerInfo(signer)).index == 0) + } + } + // New signer addresses should be active + for (let i = 0; i < newSigners.length; i++) { + const signer = newSigners[i] + assert((await registry.getSignerInfo(signer)).active) + assert((await registry.getSignerInfo(signer)).index == i) + } + // Old transmitter addresses which are not in new transmitter should be non active, update lastCollected but retain other info + for (let i = 0; i < keeperAddresses.length; i++) { + const transmitter = keeperAddresses[i] + if (!newKeepers.includes(transmitter)) { + assert(!(await registry.getTransmitterInfo(transmitter)).active) + assert((await registry.getTransmitterInfo(transmitter)).index == i) + assert( + (await registry.getTransmitterInfo(transmitter)).lastCollected.eq( + oldState.totalPremium.sub( + oldState.totalPremium.mod(keeperAddresses.length), + ), + ), + ) + } + } + // New transmitter addresses should be active + for (let i = 0; i < newKeepers.length; i++) { + const transmitter = newKeepers[i] + assert((await registry.getTransmitterInfo(transmitter)).active) + assert((await registry.getTransmitterInfo(transmitter)).index == i) + assert( + (await registry.getTransmitterInfo(transmitter)).lastCollected.eq( + oldState.totalPremium, + ), + ) + } + + // config digest should be updated + assert(oldState.configCount + 1 == updatedState.configCount) + assert( + oldState.latestConfigBlockNumber != + updatedState.latestConfigBlockNumber, + ) + assert(oldState.latestConfigDigest != updatedState.latestConfigDigest) + + //New config should be updated + assert.deepEqual(updated.signers, newKeepers) + assert.deepEqual(updated.transmitters, newKeepers) + + // Event should have been emitted + await expect(tx).to.emit(registry, 'ConfigSet') + }) + }) + + describe('#cancelUpkeep', () => { + describe('when called by the admin', async () => { + describeMaybe('when an upkeep has been performed', async () => { + beforeEach(async () => { + await linkToken.connect(owner).approve(registry.address, toWei('100')) + await registry.connect(owner).addFunds(upkeepId, toWei('100')) + await getTransmitTx(registry, keeper1, [upkeepId]) + }) + + it('deducts a cancellation fee from the upkeep and adds to reserve', async () => { + const newMinUpkeepSpend = toWei('10') + const financeAdminAddress = await financeAdmin.getAddress() + + await registry.connect(owner).setConfigTypeSafe( + signerAddresses, + keeperAddresses, + f, + { + checkGasLimit, + stalenessSeconds, + gasCeilingMultiplier, + maxCheckDataSize, + maxPerformDataSize, + maxRevertDataSize, + maxPerformGas, + fallbackGasPrice, + fallbackLinkPrice, + fallbackNativePrice, + transcoder: transcoder.address, + registrars: [], + upkeepPrivilegeManager: upkeepManager, + chainModule: moduleBase.address, + reorgProtectionEnabled: true, + financeAdmin: financeAdminAddress, + }, + offchainVersion, + offchainBytes, + [linkToken.address], + [ + { + gasFeePPB: paymentPremiumPPB, + flatFeeMilliCents, + priceFeed: linkUSDFeed.address, + fallbackPrice: fallbackLinkPrice, + minSpend: newMinUpkeepSpend, + decimals: 18, + }, + ], + ) + + const payee1Before = await linkToken.balanceOf( + await payee1.getAddress(), + ) + const upkeepBefore = (await registry.getUpkeep(upkeepId)).balance + const ownerBefore = await registry.linkAvailableForPayment() + + const amountSpent = toWei('100').sub(upkeepBefore) + const cancellationFee = newMinUpkeepSpend.sub(amountSpent) + + await registry.connect(admin).cancelUpkeep(upkeepId) + + const payee1After = await linkToken.balanceOf( + await payee1.getAddress(), + ) + const upkeepAfter = (await registry.getUpkeep(upkeepId)).balance + const ownerAfter = await registry.linkAvailableForPayment() + + // post upkeep balance should be previous balance minus cancellation fee + assert.isTrue(upkeepBefore.sub(cancellationFee).eq(upkeepAfter)) + // payee balance should not change + assert.isTrue(payee1Before.eq(payee1After)) + // owner should receive the cancellation fee + assert.isTrue(ownerAfter.sub(ownerBefore).eq(cancellationFee)) + }) + + it('deducts up to balance as cancellation fee', async () => { + // Very high min spend, should deduct whole balance as cancellation fees + const newMinUpkeepSpend = toWei('1000') + const financeAdminAddress = await financeAdmin.getAddress() + + await registry.connect(owner).setConfigTypeSafe( + signerAddresses, + keeperAddresses, + f, + { + checkGasLimit, + stalenessSeconds, + gasCeilingMultiplier, + maxCheckDataSize, + maxPerformDataSize, + maxRevertDataSize, + maxPerformGas, + fallbackGasPrice, + fallbackLinkPrice, + fallbackNativePrice, + transcoder: transcoder.address, + registrars: [], + upkeepPrivilegeManager: upkeepManager, + chainModule: moduleBase.address, + reorgProtectionEnabled: true, + financeAdmin: financeAdminAddress, + }, + offchainVersion, + offchainBytes, + [linkToken.address], + [ + { + gasFeePPB: paymentPremiumPPB, + flatFeeMilliCents, + priceFeed: linkUSDFeed.address, + fallbackPrice: fallbackLinkPrice, + minSpend: newMinUpkeepSpend, + decimals: 18, + }, + ], + ) + const payee1Before = await linkToken.balanceOf( + await payee1.getAddress(), + ) + const upkeepBefore = (await registry.getUpkeep(upkeepId)).balance + const ownerBefore = await registry.linkAvailableForPayment() + + await registry.connect(admin).cancelUpkeep(upkeepId) + const payee1After = await linkToken.balanceOf( + await payee1.getAddress(), + ) + const ownerAfter = await registry.linkAvailableForPayment() + const upkeepAfter = (await registry.getUpkeep(upkeepId)).balance + + // all upkeep balance is deducted for cancellation fee + assert.equal(upkeepAfter.toNumber(), 0) + // payee balance should not change + assert.isTrue(payee1After.eq(payee1Before)) + // all upkeep balance is transferred to the owner + assert.isTrue(ownerAfter.sub(ownerBefore).eq(upkeepBefore)) + }) + + it('does not deduct cancellation fee if more than minUpkeepSpendDollars is spent', async () => { + // Very low min spend, already spent in one perform upkeep + const newMinUpkeepSpend = BigNumber.from(420) + const financeAdminAddress = await financeAdmin.getAddress() + + await registry.connect(owner).setConfigTypeSafe( + signerAddresses, + keeperAddresses, + f, + { + checkGasLimit, + stalenessSeconds, + gasCeilingMultiplier, + maxCheckDataSize, + maxPerformDataSize, + maxRevertDataSize, + maxPerformGas, + fallbackGasPrice, + fallbackLinkPrice, + fallbackNativePrice, + transcoder: transcoder.address, + registrars: [], + upkeepPrivilegeManager: upkeepManager, + chainModule: moduleBase.address, + reorgProtectionEnabled: true, + financeAdmin: financeAdminAddress, + }, + offchainVersion, + offchainBytes, + [linkToken.address], + [ + { + gasFeePPB: paymentPremiumPPB, + flatFeeMilliCents, + priceFeed: linkUSDFeed.address, + fallbackPrice: fallbackLinkPrice, + minSpend: newMinUpkeepSpend, + decimals: 18, + }, + ], + ) + const payee1Before = await linkToken.balanceOf( + await payee1.getAddress(), + ) + const upkeepBefore = (await registry.getUpkeep(upkeepId)).balance + const ownerBefore = await registry.linkAvailableForPayment() + + await registry.connect(admin).cancelUpkeep(upkeepId) + const payee1After = await linkToken.balanceOf( + await payee1.getAddress(), + ) + const ownerAfter = await registry.linkAvailableForPayment() + const upkeepAfter = (await registry.getUpkeep(upkeepId)).balance + + // upkeep does not pay cancellation fee after cancellation because minimum upkeep spent is met + assert.isTrue(upkeepBefore.eq(upkeepAfter)) + // owner balance does not change + assert.isTrue(ownerAfter.eq(ownerBefore)) + // payee balance does not change + assert.isTrue(payee1Before.eq(payee1After)) + }) + }) + }) + }) + + describe('#withdrawPayment', () => { + beforeEach(async () => { + await linkToken.connect(owner).approve(registry.address, toWei('100')) + await registry.connect(owner).addFunds(upkeepId, toWei('100')) + await getTransmitTx(registry, keeper1, [upkeepId]) + }) + + it('reverts if called by anyone but the payee', async () => { + await evmRevertCustomError( + registry + .connect(payee2) + .withdrawPayment( + await keeper1.getAddress(), + await nonkeeper.getAddress(), + ), + registry, + 'OnlyCallableByPayee', + ) + }) + + it('reverts if called with the 0 address', async () => { + await evmRevertCustomError( + registry + .connect(payee2) + .withdrawPayment(await keeper1.getAddress(), zeroAddress), + registry, + 'InvalidRecipient', + ) + }) + + it('updates the balances', async () => { + const to = await nonkeeper.getAddress() + const keeperBefore = await registry.getTransmitterInfo( + await keeper1.getAddress(), + ) + const registrationBefore = (await registry.getUpkeep(upkeepId)).balance + const toLinkBefore = await linkToken.balanceOf(to) + const registryLinkBefore = await linkToken.balanceOf(registry.address) + const registryPremiumBefore = (await registry.getState()).state + .totalPremium + const ownerBefore = await registry.linkAvailableForPayment() + + // Withdrawing for first time, last collected = 0 + assert.equal(keeperBefore.lastCollected.toString(), '0') + + //// Do the thing + await registry + .connect(payee1) + .withdrawPayment(await keeper1.getAddress(), to) + + const keeperAfter = await registry.getTransmitterInfo( + await keeper1.getAddress(), + ) + const registrationAfter = (await registry.getUpkeep(upkeepId)).balance + const toLinkAfter = await linkToken.balanceOf(to) + const registryLinkAfter = await linkToken.balanceOf(registry.address) + const registryPremiumAfter = (await registry.getState()).state + .totalPremium + const ownerAfter = await registry.linkAvailableForPayment() + + // registry total premium should not change + assert.isTrue(registryPremiumBefore.eq(registryPremiumAfter)) + + // Last collected should be updated to premium-change + assert.isTrue( + keeperAfter.lastCollected.eq( + registryPremiumBefore.sub( + registryPremiumBefore.mod(keeperAddresses.length), + ), + ), + ) + + // owner balance should remain unchanged + assert.isTrue(ownerAfter.eq(ownerBefore)) + + assert.isTrue(keeperAfter.balance.eq(BigNumber.from(0))) + assert.isTrue(registrationBefore.eq(registrationAfter)) + assert.isTrue(toLinkBefore.add(keeperBefore.balance).eq(toLinkAfter)) + assert.isTrue( + registryLinkBefore.sub(keeperBefore.balance).eq(registryLinkAfter), + ) + }) + + it('emits a log announcing the withdrawal', async () => { + const balance = ( + await registry.getTransmitterInfo(await keeper1.getAddress()) + ).balance + const tx = await registry + .connect(payee1) + .withdrawPayment( + await keeper1.getAddress(), + await nonkeeper.getAddress(), + ) + await expect(tx) + .to.emit(registry, 'PaymentWithdrawn') + .withArgs( + await keeper1.getAddress(), + balance, + await nonkeeper.getAddress(), + await payee1.getAddress(), + ) + }) + }) + + describe('#checkCallback', () => { + it('returns false with appropriate failure reason when target callback reverts', async () => { + await streamsLookupUpkeep.setShouldRevertCallback(true) + + const values: any[] = ['0x1234', '0xabcd'] + const res = await registry + .connect(zeroAddress) + .callStatic.checkCallback(streamsLookupUpkeepId, values, '0x') + + assert.isFalse(res.upkeepNeeded) + assert.equal(res.performData, '0x') + assert.equal( + res.upkeepFailureReason, + UpkeepFailureReason.CHECK_CALLBACK_REVERTED, + ) + assert.isTrue(res.gasUsed.gt(BigNumber.from('0'))) // Some gas should be used + }) + + it('returns false with appropriate failure reason when target callback returns big performData', async () => { + let longBytes = '0x' + for (let i = 0; i <= maxPerformDataSize.toNumber(); i++) { + longBytes += '11' + } + const values: any[] = [longBytes, longBytes] + const res = await registry + .connect(zeroAddress) + .callStatic.checkCallback(streamsLookupUpkeepId, values, '0x') + + assert.isFalse(res.upkeepNeeded) + assert.equal(res.performData, '0x') + assert.equal( + res.upkeepFailureReason, + UpkeepFailureReason.PERFORM_DATA_EXCEEDS_LIMIT, + ) + assert.isTrue(res.gasUsed.gt(BigNumber.from('0'))) // Some gas should be used + }) + + it('returns false with appropriate failure reason when target callback returns false', async () => { + await streamsLookupUpkeep.setCallbackReturnBool(false) + const values: any[] = ['0x1234', '0xabcd'] + const res = await registry + .connect(zeroAddress) + .callStatic.checkCallback(streamsLookupUpkeepId, values, '0x') + + assert.isFalse(res.upkeepNeeded) + assert.equal(res.performData, '0x') + assert.equal( + res.upkeepFailureReason, + UpkeepFailureReason.UPKEEP_NOT_NEEDED, + ) + assert.isTrue(res.gasUsed.gt(BigNumber.from('0'))) // Some gas should be used + }) + + it('succeeds with upkeep needed', async () => { + const values: any[] = ['0x1234', '0xabcd'] + + const res = await registry + .connect(zeroAddress) + .callStatic.checkCallback(streamsLookupUpkeepId, values, '0x') + const expectedPerformData = ethers.utils.defaultAbiCoder.encode( + ['bytes[]', 'bytes'], + [values, '0x'], + ) + + assert.isTrue(res.upkeepNeeded) + assert.equal(res.performData, expectedPerformData) + assert.equal(res.upkeepFailureReason, UpkeepFailureReason.NONE) + assert.isTrue(res.gasUsed.gt(BigNumber.from('0'))) // Some gas should be used + }) + }) + + describe('transmitterPremiumSplit [ @skip-coverage ]', () => { + beforeEach(async () => { + await linkToken.connect(owner).approve(registry.address, toWei('100')) + await registry.connect(owner).addFunds(upkeepId, toWei('100')) + }) + + it('splits premium evenly across transmitters', async () => { + // Do a transmit from keeper1 + await getTransmitTx(registry, keeper1, [upkeepId]) + + const registryPremium = (await registry.getState()).state.totalPremium + assert.isTrue(registryPremium.gt(BigNumber.from(0))) + + const premiumPerTransmitter = registryPremium.div( + BigNumber.from(keeperAddresses.length), + ) + const k1Balance = ( + await registry.getTransmitterInfo(await keeper1.getAddress()) + ).balance + // transmitter should be reimbursed for gas and get the premium + assert.isTrue(k1Balance.gt(premiumPerTransmitter)) + const k1GasReimbursement = k1Balance.sub(premiumPerTransmitter) + + const k2Balance = ( + await registry.getTransmitterInfo(await keeper2.getAddress()) + ).balance + // non transmitter should get its share of premium + assert.isTrue(k2Balance.eq(premiumPerTransmitter)) + + // Now do a transmit from keeper 2 + await getTransmitTx(registry, keeper2, [upkeepId]) + const registryPremiumNew = (await registry.getState()).state.totalPremium + assert.isTrue(registryPremiumNew.gt(registryPremium)) + const premiumPerTransmitterNew = registryPremiumNew.div( + BigNumber.from(keeperAddresses.length), + ) + const additionalPremium = premiumPerTransmitterNew.sub( + premiumPerTransmitter, + ) + + const k1BalanceNew = ( + await registry.getTransmitterInfo(await keeper1.getAddress()) + ).balance + // k1 should get the new premium + assert.isTrue( + k1BalanceNew.eq(k1GasReimbursement.add(premiumPerTransmitterNew)), + ) + + const k2BalanceNew = ( + await registry.getTransmitterInfo(await keeper2.getAddress()) + ).balance + // k2 should get gas reimbursement in addition to new premium + assert.isTrue(k2BalanceNew.gt(k2Balance.add(additionalPremium))) + }) + + it('updates last collected upon payment withdrawn', async () => { + // Do a transmit from keeper1 + await getTransmitTx(registry, keeper1, [upkeepId]) + + const registryPremium = (await registry.getState()).state.totalPremium + const k1 = await registry.getTransmitterInfo(await keeper1.getAddress()) + const k2 = await registry.getTransmitterInfo(await keeper2.getAddress()) + + // Withdrawing for first time, last collected = 0 + assert.isTrue(k1.lastCollected.eq(BigNumber.from(0))) + assert.isTrue(k2.lastCollected.eq(BigNumber.from(0))) + + //// Do the thing + await registry + .connect(payee1) + .withdrawPayment( + await keeper1.getAddress(), + await nonkeeper.getAddress(), + ) + + const k1New = await registry.getTransmitterInfo( + await keeper1.getAddress(), + ) + const k2New = await registry.getTransmitterInfo( + await keeper2.getAddress(), + ) + + // transmitter info lastCollected should be updated for k1, not for k2 + assert.isTrue( + k1New.lastCollected.eq( + registryPremium.sub(registryPremium.mod(keeperAddresses.length)), + ), + ) + assert.isTrue(k2New.lastCollected.eq(BigNumber.from(0))) + }) + + // itMaybe( + it('maintains consistent balance information across all parties', async () => { + // throughout transmits, withdrawals, setConfigs total claim on balances should remain less than expected balance + // some spare change can get lost but it should be less than maxAllowedSpareChange + + let maxAllowedSpareChange = BigNumber.from('0') + await verifyConsistentAccounting(maxAllowedSpareChange) + + await getTransmitTx(registry, keeper1, [upkeepId]) + maxAllowedSpareChange = maxAllowedSpareChange.add(BigNumber.from('31')) + await verifyConsistentAccounting(maxAllowedSpareChange) + + await registry + .connect(payee1) + .withdrawPayment( + await keeper1.getAddress(), + await nonkeeper.getAddress(), + ) + await verifyConsistentAccounting(maxAllowedSpareChange) + + await registry + .connect(payee2) + .withdrawPayment( + await keeper2.getAddress(), + await nonkeeper.getAddress(), + ) + await verifyConsistentAccounting(maxAllowedSpareChange) + + await getTransmitTx(registry, keeper1, [upkeepId]) + maxAllowedSpareChange = maxAllowedSpareChange.add(BigNumber.from('31')) + await verifyConsistentAccounting(maxAllowedSpareChange) + + await registry.connect(owner).setConfigTypeSafe( + signerAddresses.slice(2, 15), // only use 2-14th index keepers + keeperAddresses.slice(2, 15), + f, + config, + offchainVersion, + offchainBytes, + baseConfig[6], + baseConfig[7], + ) + await verifyConsistentAccounting(maxAllowedSpareChange) + + await getTransmitTx(registry, keeper3, [upkeepId], { + startingSignerIndex: 2, + }) + maxAllowedSpareChange = maxAllowedSpareChange.add(BigNumber.from('13')) + await verifyConsistentAccounting(maxAllowedSpareChange) + + await registry + .connect(payee1) + .withdrawPayment( + await keeper1.getAddress(), + await nonkeeper.getAddress(), + ) + await verifyConsistentAccounting(maxAllowedSpareChange) + + await registry + .connect(payee3) + .withdrawPayment( + await keeper3.getAddress(), + await nonkeeper.getAddress(), + ) + await verifyConsistentAccounting(maxAllowedSpareChange) + + await registry.connect(owner).setConfigTypeSafe( + signerAddresses.slice(0, 4), // only use 0-3rd index keepers + keeperAddresses.slice(0, 4), + f, + config, + offchainVersion, + offchainBytes, + baseConfig[6], + baseConfig[7], + ) + await verifyConsistentAccounting(maxAllowedSpareChange) + await getTransmitTx(registry, keeper1, [upkeepId]) + maxAllowedSpareChange = maxAllowedSpareChange.add(BigNumber.from('4')) + await getTransmitTx(registry, keeper3, [upkeepId]) + maxAllowedSpareChange = maxAllowedSpareChange.add(BigNumber.from('4')) + + await verifyConsistentAccounting(maxAllowedSpareChange) + await registry + .connect(payee5) + .withdrawPayment( + await keeper5.getAddress(), + await nonkeeper.getAddress(), + ) + await verifyConsistentAccounting(maxAllowedSpareChange) + + await registry + .connect(payee1) + .withdrawPayment( + await keeper1.getAddress(), + await nonkeeper.getAddress(), + ) + await verifyConsistentAccounting(maxAllowedSpareChange) + }) + }) +}) diff --git a/contracts/test/v0.8/automation/helpers.ts b/contracts/test/v0.8/automation/helpers.ts index 5a95fb482cd..99f2cef9b87 100644 --- a/contracts/test/v0.8/automation/helpers.ts +++ b/contracts/test/v0.8/automation/helpers.ts @@ -9,6 +9,7 @@ import { IAutomationRegistryMaster__factory as IAutomationRegistryMasterFactory import { assert } from 'chai' import { FunctionFragment } from '@ethersproject/abi' import { AutomationRegistryLogicC2_3__factory as AutomationRegistryLogicC2_3Factory } from '../../../typechain/factories/AutomationRegistryLogicC2_3__factory' +import { ZKSyncAutomationRegistryLogicC2_3__factory as ZKSyncAutomationRegistryLogicC2_3Factory } from '../../../typechain/factories/ZKSyncAutomationRegistryLogicC2_3__factory' import { IAutomationRegistryMaster2_3 as IAutomationRegistry2_3 } from '../../../typechain/IAutomationRegistryMaster2_3' import { IAutomationRegistryMaster2_3__factory as IAutomationRegistryMaster2_3Factory } from '../../../typechain/factories/IAutomationRegistryMaster2_3__factory' @@ -170,10 +171,10 @@ export const deployRegistry23 = async ( link: Parameters[0], linkUSD: Parameters[1], nativeUSD: Parameters[2], - fastgas: Parameters[2], + fastgas: Parameters[3], allowedReadOnlyAddress: Parameters< AutomationRegistryLogicC2_3Factory['deploy'] - >[3], + >[5], payoutMode: Parameters[6], wrappedNativeTokenAddress: Parameters< AutomationRegistryLogicC2_3Factory['deploy'] @@ -212,3 +213,51 @@ export const deployRegistry23 = async ( const master = await registryFactory.connect(from).deploy(logicA.address) return IAutomationRegistryMaster2_3Factory.connect(master.address, from) } + +export const deployZKSyncRegistry23 = async ( + from: Signer, + link: Parameters[0], + linkUSD: Parameters[1], + nativeUSD: Parameters[2], + fastgas: Parameters[3], + allowedReadOnlyAddress: Parameters< + AutomationRegistryLogicC2_3Factory['deploy'] + >[5], + payoutMode: Parameters[6], + wrappedNativeTokenAddress: Parameters< + ZKSyncAutomationRegistryLogicC2_3Factory['deploy'] + >[7], +): Promise => { + const logicCFactory = await ethers.getContractFactory( + 'ZKSyncAutomationRegistryLogicC2_3', + ) + const logicBFactory = await ethers.getContractFactory( + 'ZKSyncAutomationRegistryLogicB2_3', + ) + const logicAFactory = await ethers.getContractFactory( + 'ZKSyncAutomationRegistryLogicA2_3', + ) + const registryFactory = await ethers.getContractFactory( + 'ZKSyncAutomationRegistry2_3', + ) + const forwarderLogicFactory = await ethers.getContractFactory( + 'AutomationForwarderLogic', + ) + const forwarderLogic = await forwarderLogicFactory.connect(from).deploy() + const logicC = await logicCFactory + .connect(from) + .deploy( + link, + linkUSD, + nativeUSD, + fastgas, + forwarderLogic.address, + allowedReadOnlyAddress, + payoutMode, + wrappedNativeTokenAddress, + ) + const logicB = await logicBFactory.connect(from).deploy(logicC.address) + const logicA = await logicAFactory.connect(from).deploy(logicB.address) + const master = await registryFactory.connect(from).deploy(logicA.address) + return IAutomationRegistryMaster2_3Factory.connect(master.address, from) +} diff --git a/core/bridges/cache.go b/core/bridges/cache.go index 4b5a6552447..e97874a35e5 100644 --- a/core/bridges/cache.go +++ b/core/bridges/cache.go @@ -10,11 +10,9 @@ import ( "golang.org/x/exp/maps" + "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink-common/pkg/services" "github.com/smartcontractkit/chainlink-common/pkg/sqlutil" - - "github.com/smartcontractkit/chainlink/v2/core/logger" - "github.com/smartcontractkit/chainlink/v2/core/utils" ) const ( @@ -25,13 +23,11 @@ const ( type Cache struct { // dependencies and configurations ORM - lggr logger.Logger interval time.Duration // service state - services.StateMachine - wg sync.WaitGroup - chStop services.StopChan + services.Service + eng *services.Engine // data state bridgeTypesCache sync.Map @@ -43,17 +39,20 @@ var _ ORM = (*Cache)(nil) var _ services.Service = (*Cache)(nil) func NewCache(base ORM, lggr logger.Logger, upsertInterval time.Duration) *Cache { - return &Cache{ + c := &Cache{ ORM: base, - lggr: lggr.Named(CacheServiceName), interval: upsertInterval, - chStop: make(chan struct{}), bridgeLastValueCache: make(map[string]BridgeResponse), } + c.Service, c.eng = services.Config{ + Name: CacheServiceName, + Start: c.start, + }.NewServiceEngine(lggr) + return c } func (c *Cache) WithDataSource(ds sqlutil.DataSource) ORM { - return NewCache(NewORM(ds), c.lggr, c.interval) + return NewCache(NewORM(ds), c.eng, c.interval) } func (c *Cache) FindBridge(ctx context.Context, name BridgeName) (BridgeType, error) { @@ -190,51 +189,17 @@ func (c *Cache) UpsertBridgeResponse(ctx context.Context, dotId string, specId i return nil } -func (c *Cache) Start(_ context.Context) error { - return c.StartOnce(CacheServiceName, func() error { - c.wg.Add(1) - - go c.run() - - return nil - }) -} - -func (c *Cache) Close() error { - return c.StopOnce(CacheServiceName, func() error { - close(c.chStop) - c.wg.Wait() - - return nil - }) -} - -func (c *Cache) HealthReport() map[string]error { - return map[string]error{c.Name(): c.Healthy()} -} - -func (c *Cache) Name() string { - return c.lggr.Name() -} - -func (c *Cache) run() { - defer c.wg.Done() - - for { - timer := time.NewTimer(utils.WithJitter(c.interval)) +func (c *Cache) start(_ context.Context) error { + ticker := services.TickerConfig{ + Initial: c.interval, + JitterPct: services.DefaultJitter, + }.NewTicker(c.interval) + c.eng.GoTick(ticker, c.doBulkUpsert) - select { - case <-timer.C: - c.doBulkUpsert() - case <-c.chStop: - timer.Stop() - - return - } - } + return nil } -func (c *Cache) doBulkUpsert() { +func (c *Cache) doBulkUpsert(ctx context.Context) { c.mu.RLock() values := maps.Values(c.bridgeLastValueCache) c.mu.RUnlock() @@ -243,11 +208,8 @@ func (c *Cache) doBulkUpsert() { return } - ctx, cancel := c.chStop.NewCtx() - defer cancel() - if err := c.ORM.BulkUpsertBridgeResponse(ctx, values); err != nil { - c.lggr.Warnf("bulk upsert of bridge responses failed: %s", err.Error()) + c.eng.Warnf("bulk upsert of bridge responses failed: %s", err.Error()) } } diff --git a/core/bridges/mocks/orm.go b/core/bridges/mocks/orm.go index db8553fb215..e3fc3edee9d 100644 --- a/core/bridges/mocks/orm.go +++ b/core/bridges/mocks/orm.go @@ -20,6 +20,14 @@ type ORM struct { mock.Mock } +type ORM_Expecter struct { + mock *mock.Mock +} + +func (_m *ORM) EXPECT() *ORM_Expecter { + return &ORM_Expecter{mock: &_m.Mock} +} + // BridgeTypes provides a mock function with given fields: ctx, offset, limit func (_m *ORM) BridgeTypes(ctx context.Context, offset int, limit int) ([]bridges.BridgeType, int, error) { ret := _m.Called(ctx, offset, limit) @@ -57,6 +65,36 @@ func (_m *ORM) BridgeTypes(ctx context.Context, offset int, limit int) ([]bridge return r0, r1, r2 } +// ORM_BridgeTypes_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BridgeTypes' +type ORM_BridgeTypes_Call struct { + *mock.Call +} + +// BridgeTypes is a helper method to define mock.On call +// - ctx context.Context +// - offset int +// - limit int +func (_e *ORM_Expecter) BridgeTypes(ctx interface{}, offset interface{}, limit interface{}) *ORM_BridgeTypes_Call { + return &ORM_BridgeTypes_Call{Call: _e.mock.On("BridgeTypes", ctx, offset, limit)} +} + +func (_c *ORM_BridgeTypes_Call) Run(run func(ctx context.Context, offset int, limit int)) *ORM_BridgeTypes_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(int), args[2].(int)) + }) + return _c +} + +func (_c *ORM_BridgeTypes_Call) Return(_a0 []bridges.BridgeType, _a1 int, _a2 error) *ORM_BridgeTypes_Call { + _c.Call.Return(_a0, _a1, _a2) + return _c +} + +func (_c *ORM_BridgeTypes_Call) RunAndReturn(run func(context.Context, int, int) ([]bridges.BridgeType, int, error)) *ORM_BridgeTypes_Call { + _c.Call.Return(run) + return _c +} + // BulkUpsertBridgeResponse provides a mock function with given fields: ctx, responses func (_m *ORM) BulkUpsertBridgeResponse(ctx context.Context, responses []bridges.BridgeResponse) error { ret := _m.Called(ctx, responses) @@ -75,6 +113,35 @@ func (_m *ORM) BulkUpsertBridgeResponse(ctx context.Context, responses []bridges return r0 } +// ORM_BulkUpsertBridgeResponse_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BulkUpsertBridgeResponse' +type ORM_BulkUpsertBridgeResponse_Call struct { + *mock.Call +} + +// BulkUpsertBridgeResponse is a helper method to define mock.On call +// - ctx context.Context +// - responses []bridges.BridgeResponse +func (_e *ORM_Expecter) BulkUpsertBridgeResponse(ctx interface{}, responses interface{}) *ORM_BulkUpsertBridgeResponse_Call { + return &ORM_BulkUpsertBridgeResponse_Call{Call: _e.mock.On("BulkUpsertBridgeResponse", ctx, responses)} +} + +func (_c *ORM_BulkUpsertBridgeResponse_Call) Run(run func(ctx context.Context, responses []bridges.BridgeResponse)) *ORM_BulkUpsertBridgeResponse_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].([]bridges.BridgeResponse)) + }) + return _c +} + +func (_c *ORM_BulkUpsertBridgeResponse_Call) Return(_a0 error) *ORM_BulkUpsertBridgeResponse_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ORM_BulkUpsertBridgeResponse_Call) RunAndReturn(run func(context.Context, []bridges.BridgeResponse) error) *ORM_BulkUpsertBridgeResponse_Call { + _c.Call.Return(run) + return _c +} + // CreateBridgeType provides a mock function with given fields: ctx, bt func (_m *ORM) CreateBridgeType(ctx context.Context, bt *bridges.BridgeType) error { ret := _m.Called(ctx, bt) @@ -93,6 +160,35 @@ func (_m *ORM) CreateBridgeType(ctx context.Context, bt *bridges.BridgeType) err return r0 } +// ORM_CreateBridgeType_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateBridgeType' +type ORM_CreateBridgeType_Call struct { + *mock.Call +} + +// CreateBridgeType is a helper method to define mock.On call +// - ctx context.Context +// - bt *bridges.BridgeType +func (_e *ORM_Expecter) CreateBridgeType(ctx interface{}, bt interface{}) *ORM_CreateBridgeType_Call { + return &ORM_CreateBridgeType_Call{Call: _e.mock.On("CreateBridgeType", ctx, bt)} +} + +func (_c *ORM_CreateBridgeType_Call) Run(run func(ctx context.Context, bt *bridges.BridgeType)) *ORM_CreateBridgeType_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*bridges.BridgeType)) + }) + return _c +} + +func (_c *ORM_CreateBridgeType_Call) Return(_a0 error) *ORM_CreateBridgeType_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ORM_CreateBridgeType_Call) RunAndReturn(run func(context.Context, *bridges.BridgeType) error) *ORM_CreateBridgeType_Call { + _c.Call.Return(run) + return _c +} + // CreateExternalInitiator provides a mock function with given fields: ctx, externalInitiator func (_m *ORM) CreateExternalInitiator(ctx context.Context, externalInitiator *bridges.ExternalInitiator) error { ret := _m.Called(ctx, externalInitiator) @@ -111,6 +207,35 @@ func (_m *ORM) CreateExternalInitiator(ctx context.Context, externalInitiator *b return r0 } +// ORM_CreateExternalInitiator_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateExternalInitiator' +type ORM_CreateExternalInitiator_Call struct { + *mock.Call +} + +// CreateExternalInitiator is a helper method to define mock.On call +// - ctx context.Context +// - externalInitiator *bridges.ExternalInitiator +func (_e *ORM_Expecter) CreateExternalInitiator(ctx interface{}, externalInitiator interface{}) *ORM_CreateExternalInitiator_Call { + return &ORM_CreateExternalInitiator_Call{Call: _e.mock.On("CreateExternalInitiator", ctx, externalInitiator)} +} + +func (_c *ORM_CreateExternalInitiator_Call) Run(run func(ctx context.Context, externalInitiator *bridges.ExternalInitiator)) *ORM_CreateExternalInitiator_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*bridges.ExternalInitiator)) + }) + return _c +} + +func (_c *ORM_CreateExternalInitiator_Call) Return(_a0 error) *ORM_CreateExternalInitiator_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ORM_CreateExternalInitiator_Call) RunAndReturn(run func(context.Context, *bridges.ExternalInitiator) error) *ORM_CreateExternalInitiator_Call { + _c.Call.Return(run) + return _c +} + // DeleteBridgeType provides a mock function with given fields: ctx, bt func (_m *ORM) DeleteBridgeType(ctx context.Context, bt *bridges.BridgeType) error { ret := _m.Called(ctx, bt) @@ -129,6 +254,35 @@ func (_m *ORM) DeleteBridgeType(ctx context.Context, bt *bridges.BridgeType) err return r0 } +// ORM_DeleteBridgeType_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteBridgeType' +type ORM_DeleteBridgeType_Call struct { + *mock.Call +} + +// DeleteBridgeType is a helper method to define mock.On call +// - ctx context.Context +// - bt *bridges.BridgeType +func (_e *ORM_Expecter) DeleteBridgeType(ctx interface{}, bt interface{}) *ORM_DeleteBridgeType_Call { + return &ORM_DeleteBridgeType_Call{Call: _e.mock.On("DeleteBridgeType", ctx, bt)} +} + +func (_c *ORM_DeleteBridgeType_Call) Run(run func(ctx context.Context, bt *bridges.BridgeType)) *ORM_DeleteBridgeType_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*bridges.BridgeType)) + }) + return _c +} + +func (_c *ORM_DeleteBridgeType_Call) Return(_a0 error) *ORM_DeleteBridgeType_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ORM_DeleteBridgeType_Call) RunAndReturn(run func(context.Context, *bridges.BridgeType) error) *ORM_DeleteBridgeType_Call { + _c.Call.Return(run) + return _c +} + // DeleteExternalInitiator provides a mock function with given fields: ctx, name func (_m *ORM) DeleteExternalInitiator(ctx context.Context, name string) error { ret := _m.Called(ctx, name) @@ -147,6 +301,35 @@ func (_m *ORM) DeleteExternalInitiator(ctx context.Context, name string) error { return r0 } +// ORM_DeleteExternalInitiator_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteExternalInitiator' +type ORM_DeleteExternalInitiator_Call struct { + *mock.Call +} + +// DeleteExternalInitiator is a helper method to define mock.On call +// - ctx context.Context +// - name string +func (_e *ORM_Expecter) DeleteExternalInitiator(ctx interface{}, name interface{}) *ORM_DeleteExternalInitiator_Call { + return &ORM_DeleteExternalInitiator_Call{Call: _e.mock.On("DeleteExternalInitiator", ctx, name)} +} + +func (_c *ORM_DeleteExternalInitiator_Call) Run(run func(ctx context.Context, name string)) *ORM_DeleteExternalInitiator_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *ORM_DeleteExternalInitiator_Call) Return(_a0 error) *ORM_DeleteExternalInitiator_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ORM_DeleteExternalInitiator_Call) RunAndReturn(run func(context.Context, string) error) *ORM_DeleteExternalInitiator_Call { + _c.Call.Return(run) + return _c +} + // ExternalInitiators provides a mock function with given fields: ctx, offset, limit func (_m *ORM) ExternalInitiators(ctx context.Context, offset int, limit int) ([]bridges.ExternalInitiator, int, error) { ret := _m.Called(ctx, offset, limit) @@ -184,6 +367,36 @@ func (_m *ORM) ExternalInitiators(ctx context.Context, offset int, limit int) ([ return r0, r1, r2 } +// ORM_ExternalInitiators_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ExternalInitiators' +type ORM_ExternalInitiators_Call struct { + *mock.Call +} + +// ExternalInitiators is a helper method to define mock.On call +// - ctx context.Context +// - offset int +// - limit int +func (_e *ORM_Expecter) ExternalInitiators(ctx interface{}, offset interface{}, limit interface{}) *ORM_ExternalInitiators_Call { + return &ORM_ExternalInitiators_Call{Call: _e.mock.On("ExternalInitiators", ctx, offset, limit)} +} + +func (_c *ORM_ExternalInitiators_Call) Run(run func(ctx context.Context, offset int, limit int)) *ORM_ExternalInitiators_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(int), args[2].(int)) + }) + return _c +} + +func (_c *ORM_ExternalInitiators_Call) Return(_a0 []bridges.ExternalInitiator, _a1 int, _a2 error) *ORM_ExternalInitiators_Call { + _c.Call.Return(_a0, _a1, _a2) + return _c +} + +func (_c *ORM_ExternalInitiators_Call) RunAndReturn(run func(context.Context, int, int) ([]bridges.ExternalInitiator, int, error)) *ORM_ExternalInitiators_Call { + _c.Call.Return(run) + return _c +} + // FindBridge provides a mock function with given fields: ctx, name func (_m *ORM) FindBridge(ctx context.Context, name bridges.BridgeName) (bridges.BridgeType, error) { ret := _m.Called(ctx, name) @@ -212,6 +425,35 @@ func (_m *ORM) FindBridge(ctx context.Context, name bridges.BridgeName) (bridges return r0, r1 } +// ORM_FindBridge_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindBridge' +type ORM_FindBridge_Call struct { + *mock.Call +} + +// FindBridge is a helper method to define mock.On call +// - ctx context.Context +// - name bridges.BridgeName +func (_e *ORM_Expecter) FindBridge(ctx interface{}, name interface{}) *ORM_FindBridge_Call { + return &ORM_FindBridge_Call{Call: _e.mock.On("FindBridge", ctx, name)} +} + +func (_c *ORM_FindBridge_Call) Run(run func(ctx context.Context, name bridges.BridgeName)) *ORM_FindBridge_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(bridges.BridgeName)) + }) + return _c +} + +func (_c *ORM_FindBridge_Call) Return(bt bridges.BridgeType, err error) *ORM_FindBridge_Call { + _c.Call.Return(bt, err) + return _c +} + +func (_c *ORM_FindBridge_Call) RunAndReturn(run func(context.Context, bridges.BridgeName) (bridges.BridgeType, error)) *ORM_FindBridge_Call { + _c.Call.Return(run) + return _c +} + // FindBridges provides a mock function with given fields: ctx, name func (_m *ORM) FindBridges(ctx context.Context, name []bridges.BridgeName) ([]bridges.BridgeType, error) { ret := _m.Called(ctx, name) @@ -242,6 +484,35 @@ func (_m *ORM) FindBridges(ctx context.Context, name []bridges.BridgeName) ([]br return r0, r1 } +// ORM_FindBridges_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindBridges' +type ORM_FindBridges_Call struct { + *mock.Call +} + +// FindBridges is a helper method to define mock.On call +// - ctx context.Context +// - name []bridges.BridgeName +func (_e *ORM_Expecter) FindBridges(ctx interface{}, name interface{}) *ORM_FindBridges_Call { + return &ORM_FindBridges_Call{Call: _e.mock.On("FindBridges", ctx, name)} +} + +func (_c *ORM_FindBridges_Call) Run(run func(ctx context.Context, name []bridges.BridgeName)) *ORM_FindBridges_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].([]bridges.BridgeName)) + }) + return _c +} + +func (_c *ORM_FindBridges_Call) Return(bts []bridges.BridgeType, err error) *ORM_FindBridges_Call { + _c.Call.Return(bts, err) + return _c +} + +func (_c *ORM_FindBridges_Call) RunAndReturn(run func(context.Context, []bridges.BridgeName) ([]bridges.BridgeType, error)) *ORM_FindBridges_Call { + _c.Call.Return(run) + return _c +} + // FindExternalInitiator provides a mock function with given fields: ctx, eia func (_m *ORM) FindExternalInitiator(ctx context.Context, eia *auth.Token) (*bridges.ExternalInitiator, error) { ret := _m.Called(ctx, eia) @@ -272,6 +543,35 @@ func (_m *ORM) FindExternalInitiator(ctx context.Context, eia *auth.Token) (*bri return r0, r1 } +// ORM_FindExternalInitiator_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindExternalInitiator' +type ORM_FindExternalInitiator_Call struct { + *mock.Call +} + +// FindExternalInitiator is a helper method to define mock.On call +// - ctx context.Context +// - eia *auth.Token +func (_e *ORM_Expecter) FindExternalInitiator(ctx interface{}, eia interface{}) *ORM_FindExternalInitiator_Call { + return &ORM_FindExternalInitiator_Call{Call: _e.mock.On("FindExternalInitiator", ctx, eia)} +} + +func (_c *ORM_FindExternalInitiator_Call) Run(run func(ctx context.Context, eia *auth.Token)) *ORM_FindExternalInitiator_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*auth.Token)) + }) + return _c +} + +func (_c *ORM_FindExternalInitiator_Call) Return(_a0 *bridges.ExternalInitiator, _a1 error) *ORM_FindExternalInitiator_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ORM_FindExternalInitiator_Call) RunAndReturn(run func(context.Context, *auth.Token) (*bridges.ExternalInitiator, error)) *ORM_FindExternalInitiator_Call { + _c.Call.Return(run) + return _c +} + // FindExternalInitiatorByName provides a mock function with given fields: ctx, iname func (_m *ORM) FindExternalInitiatorByName(ctx context.Context, iname string) (bridges.ExternalInitiator, error) { ret := _m.Called(ctx, iname) @@ -300,6 +600,35 @@ func (_m *ORM) FindExternalInitiatorByName(ctx context.Context, iname string) (b return r0, r1 } +// ORM_FindExternalInitiatorByName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindExternalInitiatorByName' +type ORM_FindExternalInitiatorByName_Call struct { + *mock.Call +} + +// FindExternalInitiatorByName is a helper method to define mock.On call +// - ctx context.Context +// - iname string +func (_e *ORM_Expecter) FindExternalInitiatorByName(ctx interface{}, iname interface{}) *ORM_FindExternalInitiatorByName_Call { + return &ORM_FindExternalInitiatorByName_Call{Call: _e.mock.On("FindExternalInitiatorByName", ctx, iname)} +} + +func (_c *ORM_FindExternalInitiatorByName_Call) Run(run func(ctx context.Context, iname string)) *ORM_FindExternalInitiatorByName_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *ORM_FindExternalInitiatorByName_Call) Return(exi bridges.ExternalInitiator, err error) *ORM_FindExternalInitiatorByName_Call { + _c.Call.Return(exi, err) + return _c +} + +func (_c *ORM_FindExternalInitiatorByName_Call) RunAndReturn(run func(context.Context, string) (bridges.ExternalInitiator, error)) *ORM_FindExternalInitiatorByName_Call { + _c.Call.Return(run) + return _c +} + // GetCachedResponse provides a mock function with given fields: ctx, dotId, specId, maxElapsed func (_m *ORM) GetCachedResponse(ctx context.Context, dotId string, specId int32, maxElapsed time.Duration) ([]byte, error) { ret := _m.Called(ctx, dotId, specId, maxElapsed) @@ -330,6 +659,37 @@ func (_m *ORM) GetCachedResponse(ctx context.Context, dotId string, specId int32 return r0, r1 } +// ORM_GetCachedResponse_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetCachedResponse' +type ORM_GetCachedResponse_Call struct { + *mock.Call +} + +// GetCachedResponse is a helper method to define mock.On call +// - ctx context.Context +// - dotId string +// - specId int32 +// - maxElapsed time.Duration +func (_e *ORM_Expecter) GetCachedResponse(ctx interface{}, dotId interface{}, specId interface{}, maxElapsed interface{}) *ORM_GetCachedResponse_Call { + return &ORM_GetCachedResponse_Call{Call: _e.mock.On("GetCachedResponse", ctx, dotId, specId, maxElapsed)} +} + +func (_c *ORM_GetCachedResponse_Call) Run(run func(ctx context.Context, dotId string, specId int32, maxElapsed time.Duration)) *ORM_GetCachedResponse_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(int32), args[3].(time.Duration)) + }) + return _c +} + +func (_c *ORM_GetCachedResponse_Call) Return(_a0 []byte, _a1 error) *ORM_GetCachedResponse_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ORM_GetCachedResponse_Call) RunAndReturn(run func(context.Context, string, int32, time.Duration) ([]byte, error)) *ORM_GetCachedResponse_Call { + _c.Call.Return(run) + return _c +} + // GetCachedResponseWithFinished provides a mock function with given fields: ctx, dotId, specId, maxElapsed func (_m *ORM) GetCachedResponseWithFinished(ctx context.Context, dotId string, specId int32, maxElapsed time.Duration) ([]byte, time.Time, error) { ret := _m.Called(ctx, dotId, specId, maxElapsed) @@ -367,6 +727,37 @@ func (_m *ORM) GetCachedResponseWithFinished(ctx context.Context, dotId string, return r0, r1, r2 } +// ORM_GetCachedResponseWithFinished_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetCachedResponseWithFinished' +type ORM_GetCachedResponseWithFinished_Call struct { + *mock.Call +} + +// GetCachedResponseWithFinished is a helper method to define mock.On call +// - ctx context.Context +// - dotId string +// - specId int32 +// - maxElapsed time.Duration +func (_e *ORM_Expecter) GetCachedResponseWithFinished(ctx interface{}, dotId interface{}, specId interface{}, maxElapsed interface{}) *ORM_GetCachedResponseWithFinished_Call { + return &ORM_GetCachedResponseWithFinished_Call{Call: _e.mock.On("GetCachedResponseWithFinished", ctx, dotId, specId, maxElapsed)} +} + +func (_c *ORM_GetCachedResponseWithFinished_Call) Run(run func(ctx context.Context, dotId string, specId int32, maxElapsed time.Duration)) *ORM_GetCachedResponseWithFinished_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(int32), args[3].(time.Duration)) + }) + return _c +} + +func (_c *ORM_GetCachedResponseWithFinished_Call) Return(_a0 []byte, _a1 time.Time, _a2 error) *ORM_GetCachedResponseWithFinished_Call { + _c.Call.Return(_a0, _a1, _a2) + return _c +} + +func (_c *ORM_GetCachedResponseWithFinished_Call) RunAndReturn(run func(context.Context, string, int32, time.Duration) ([]byte, time.Time, error)) *ORM_GetCachedResponseWithFinished_Call { + _c.Call.Return(run) + return _c +} + // UpdateBridgeType provides a mock function with given fields: ctx, bt, btr func (_m *ORM) UpdateBridgeType(ctx context.Context, bt *bridges.BridgeType, btr *bridges.BridgeTypeRequest) error { ret := _m.Called(ctx, bt, btr) @@ -385,6 +776,36 @@ func (_m *ORM) UpdateBridgeType(ctx context.Context, bt *bridges.BridgeType, btr return r0 } +// ORM_UpdateBridgeType_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateBridgeType' +type ORM_UpdateBridgeType_Call struct { + *mock.Call +} + +// UpdateBridgeType is a helper method to define mock.On call +// - ctx context.Context +// - bt *bridges.BridgeType +// - btr *bridges.BridgeTypeRequest +func (_e *ORM_Expecter) UpdateBridgeType(ctx interface{}, bt interface{}, btr interface{}) *ORM_UpdateBridgeType_Call { + return &ORM_UpdateBridgeType_Call{Call: _e.mock.On("UpdateBridgeType", ctx, bt, btr)} +} + +func (_c *ORM_UpdateBridgeType_Call) Run(run func(ctx context.Context, bt *bridges.BridgeType, btr *bridges.BridgeTypeRequest)) *ORM_UpdateBridgeType_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*bridges.BridgeType), args[2].(*bridges.BridgeTypeRequest)) + }) + return _c +} + +func (_c *ORM_UpdateBridgeType_Call) Return(_a0 error) *ORM_UpdateBridgeType_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ORM_UpdateBridgeType_Call) RunAndReturn(run func(context.Context, *bridges.BridgeType, *bridges.BridgeTypeRequest) error) *ORM_UpdateBridgeType_Call { + _c.Call.Return(run) + return _c +} + // UpsertBridgeResponse provides a mock function with given fields: ctx, dotId, specId, response func (_m *ORM) UpsertBridgeResponse(ctx context.Context, dotId string, specId int32, response []byte) error { ret := _m.Called(ctx, dotId, specId, response) @@ -403,6 +824,37 @@ func (_m *ORM) UpsertBridgeResponse(ctx context.Context, dotId string, specId in return r0 } +// ORM_UpsertBridgeResponse_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpsertBridgeResponse' +type ORM_UpsertBridgeResponse_Call struct { + *mock.Call +} + +// UpsertBridgeResponse is a helper method to define mock.On call +// - ctx context.Context +// - dotId string +// - specId int32 +// - response []byte +func (_e *ORM_Expecter) UpsertBridgeResponse(ctx interface{}, dotId interface{}, specId interface{}, response interface{}) *ORM_UpsertBridgeResponse_Call { + return &ORM_UpsertBridgeResponse_Call{Call: _e.mock.On("UpsertBridgeResponse", ctx, dotId, specId, response)} +} + +func (_c *ORM_UpsertBridgeResponse_Call) Run(run func(ctx context.Context, dotId string, specId int32, response []byte)) *ORM_UpsertBridgeResponse_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(int32), args[3].([]byte)) + }) + return _c +} + +func (_c *ORM_UpsertBridgeResponse_Call) Return(_a0 error) *ORM_UpsertBridgeResponse_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ORM_UpsertBridgeResponse_Call) RunAndReturn(run func(context.Context, string, int32, []byte) error) *ORM_UpsertBridgeResponse_Call { + _c.Call.Return(run) + return _c +} + // WithDataSource provides a mock function with given fields: _a0 func (_m *ORM) WithDataSource(_a0 sqlutil.DataSource) bridges.ORM { ret := _m.Called(_a0) @@ -423,6 +875,34 @@ func (_m *ORM) WithDataSource(_a0 sqlutil.DataSource) bridges.ORM { return r0 } +// ORM_WithDataSource_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WithDataSource' +type ORM_WithDataSource_Call struct { + *mock.Call +} + +// WithDataSource is a helper method to define mock.On call +// - _a0 sqlutil.DataSource +func (_e *ORM_Expecter) WithDataSource(_a0 interface{}) *ORM_WithDataSource_Call { + return &ORM_WithDataSource_Call{Call: _e.mock.On("WithDataSource", _a0)} +} + +func (_c *ORM_WithDataSource_Call) Run(run func(_a0 sqlutil.DataSource)) *ORM_WithDataSource_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(sqlutil.DataSource)) + }) + return _c +} + +func (_c *ORM_WithDataSource_Call) Return(_a0 bridges.ORM) *ORM_WithDataSource_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ORM_WithDataSource_Call) RunAndReturn(run func(sqlutil.DataSource) bridges.ORM) *ORM_WithDataSource_Call { + _c.Call.Return(run) + return _c +} + // NewORM creates a new instance of ORM. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewORM(t interface { diff --git a/core/bridges/orm.go b/core/bridges/orm.go index edacdec85b6..b20c95f161d 100644 --- a/core/bridges/orm.go +++ b/core/bridges/orm.go @@ -13,8 +13,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/auth" ) -//go:generate mockery --quiet --name ORM --output ./mocks --case=underscore - type ORM interface { FindBridge(ctx context.Context, name BridgeName) (bt BridgeType, err error) FindBridges(ctx context.Context, name []BridgeName) (bts []BridgeType, err error) diff --git a/core/capabilities/ccip/ccip_integration_tests/.gitignore b/core/capabilities/ccip/ccip_integration_tests/.gitignore new file mode 100644 index 00000000000..567609b1234 --- /dev/null +++ b/core/capabilities/ccip/ccip_integration_tests/.gitignore @@ -0,0 +1 @@ +build/ diff --git a/core/capabilities/ccip/ccip_integration_tests/ccipreader/ccipreader_test.go b/core/capabilities/ccip/ccip_integration_tests/ccipreader/ccipreader_test.go new file mode 100644 index 00000000000..c2cd25768a9 --- /dev/null +++ b/core/capabilities/ccip/ccip_integration_tests/ccipreader/ccipreader_test.go @@ -0,0 +1,518 @@ +package ccipreader + +import ( + "context" + "math/big" + "sort" + "testing" + "time" + + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/accounts/abi/bind/backends" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/crypto" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "go.uber.org/zap/zapcore" + "golang.org/x/exp/maps" + + "github.com/smartcontractkit/chainlink-common/pkg/types" + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccipocr3" + "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/headtracker" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/ccip_reader_tester" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/pgtest" + "github.com/smartcontractkit/chainlink/v2/core/logger" + "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm" + evmtypes "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/types" + + "github.com/smartcontractkit/chainlink-ccip/pkg/consts" + "github.com/smartcontractkit/chainlink-ccip/pkg/contractreader" + ccipreaderpkg "github.com/smartcontractkit/chainlink-ccip/pkg/reader" + "github.com/smartcontractkit/chainlink-ccip/plugintypes" +) + +const ( + chainS1 = cciptypes.ChainSelector(1) + chainS2 = cciptypes.ChainSelector(2) + chainS3 = cciptypes.ChainSelector(3) + chainD = cciptypes.ChainSelector(4) +) + +func TestCCIPReader_CommitReportsGTETimestamp(t *testing.T) { + ctx := testutils.Context(t) + + cfg := evmtypes.ChainReaderConfig{ + Contracts: map[string]evmtypes.ChainContractReader{ + consts.ContractNameOffRamp: { + ContractPollingFilter: evmtypes.ContractPollingFilter{ + GenericEventNames: []string{consts.EventNameCommitReportAccepted}, + }, + ContractABI: ccip_reader_tester.CCIPReaderTesterABI, + Configs: map[string]*evmtypes.ChainReaderDefinition{ + consts.EventNameCommitReportAccepted: { + ChainSpecificName: consts.EventNameCommitReportAccepted, + ReadType: evmtypes.Event, + }, + }, + }, + }, + } + + s := testSetup(ctx, t, chainD, chainD, nil, cfg) + + tokenA := common.HexToAddress("123") + const numReports = 5 + + for i := uint8(0); i < numReports; i++ { + _, err := s.contract.EmitCommitReportAccepted(s.auth, ccip_reader_tester.OffRampCommitReport{ + PriceUpdates: ccip_reader_tester.InternalPriceUpdates{ + TokenPriceUpdates: []ccip_reader_tester.InternalTokenPriceUpdate{ + { + SourceToken: tokenA, + UsdPerToken: big.NewInt(1000), + }, + }, + GasPriceUpdates: []ccip_reader_tester.InternalGasPriceUpdate{ + { + DestChainSelector: uint64(chainD), + UsdPerUnitGas: big.NewInt(90), + }, + }, + }, + MerkleRoots: []ccip_reader_tester.InternalMerkleRoot{ + { + SourceChainSelector: uint64(chainS1), + MinSeqNr: 10, + MaxSeqNr: 20, + MerkleRoot: [32]byte{i + 1}, + }, + }, + }) + assert.NoError(t, err) + s.sb.Commit() + } + + // Need to replay as sometimes the logs are not picked up by the log poller (?) + // Maybe another situation where chain reader doesn't register filters as expected. + require.NoError(t, s.lp.Replay(ctx, 1)) + + var reports []plugintypes.CommitPluginReportWithMeta + var err error + require.Eventually(t, func() bool { + reports, err = s.reader.CommitReportsGTETimestamp( + ctx, + chainD, + time.Unix(30, 0), // Skips first report, simulated backend report timestamps are [20, 30, 40, ...] + 10, + ) + require.NoError(t, err) + return len(reports) == numReports-1 + }, tests.WaitTimeout(t), 50*time.Millisecond) + + assert.Len(t, reports[0].Report.MerkleRoots, 1) + assert.Equal(t, chainS1, reports[0].Report.MerkleRoots[0].ChainSel) + assert.Equal(t, cciptypes.SeqNum(10), reports[0].Report.MerkleRoots[0].SeqNumsRange.Start()) + assert.Equal(t, cciptypes.SeqNum(20), reports[0].Report.MerkleRoots[0].SeqNumsRange.End()) + assert.Equal(t, "0x0200000000000000000000000000000000000000000000000000000000000000", + reports[0].Report.MerkleRoots[0].MerkleRoot.String()) + + assert.Equal(t, tokenA.String(), string(reports[0].Report.PriceUpdates.TokenPriceUpdates[0].TokenID)) + assert.Equal(t, uint64(1000), reports[0].Report.PriceUpdates.TokenPriceUpdates[0].Price.Uint64()) + + assert.Equal(t, chainD, reports[0].Report.PriceUpdates.GasPriceUpdates[0].ChainSel) + assert.Equal(t, uint64(90), reports[0].Report.PriceUpdates.GasPriceUpdates[0].GasPrice.Uint64()) +} + +func TestCCIPReader_ExecutedMessageRanges(t *testing.T) { + ctx := testutils.Context(t) + cfg := evmtypes.ChainReaderConfig{ + Contracts: map[string]evmtypes.ChainContractReader{ + consts.ContractNameOffRamp: { + ContractPollingFilter: evmtypes.ContractPollingFilter{ + GenericEventNames: []string{consts.EventNameExecutionStateChanged}, + }, + ContractABI: ccip_reader_tester.CCIPReaderTesterABI, + Configs: map[string]*evmtypes.ChainReaderDefinition{ + consts.EventNameExecutionStateChanged: { + ChainSpecificName: consts.EventNameExecutionStateChanged, + ReadType: evmtypes.Event, + }, + }, + }, + }, + } + + s := testSetup(ctx, t, chainD, chainD, nil, cfg) + + _, err := s.contract.EmitExecutionStateChanged( + s.auth, + uint64(chainS1), + 14, + cciptypes.Bytes32{1, 0, 0, 1}, + 1, + []byte{1, 2, 3, 4}, + ) + assert.NoError(t, err) + s.sb.Commit() + + _, err = s.contract.EmitExecutionStateChanged( + s.auth, + uint64(chainS1), + 15, + cciptypes.Bytes32{1, 0, 0, 2}, + 1, + []byte{1, 2, 3, 4, 5}, + ) + assert.NoError(t, err) + s.sb.Commit() + + // Need to replay as sometimes the logs are not picked up by the log poller (?) + // Maybe another situation where chain reader doesn't register filters as expected. + require.NoError(t, s.lp.Replay(ctx, 1)) + + var executedRanges []cciptypes.SeqNumRange + require.Eventually(t, func() bool { + executedRanges, err = s.reader.ExecutedMessageRanges( + ctx, + chainS1, + chainD, + cciptypes.NewSeqNumRange(14, 15), + ) + require.NoError(t, err) + return len(executedRanges) == 2 + }, testutils.WaitTimeout(t), 50*time.Millisecond) + + assert.Equal(t, cciptypes.SeqNum(14), executedRanges[0].Start()) + assert.Equal(t, cciptypes.SeqNum(14), executedRanges[0].End()) + + assert.Equal(t, cciptypes.SeqNum(15), executedRanges[1].Start()) + assert.Equal(t, cciptypes.SeqNum(15), executedRanges[1].End()) +} + +func TestCCIPReader_MsgsBetweenSeqNums(t *testing.T) { + ctx := testutils.Context(t) + + cfg := evmtypes.ChainReaderConfig{ + Contracts: map[string]evmtypes.ChainContractReader{ + consts.ContractNameOnRamp: { + ContractPollingFilter: evmtypes.ContractPollingFilter{ + GenericEventNames: []string{consts.EventNameCCIPMessageSent}, + }, + ContractABI: ccip_reader_tester.CCIPReaderTesterABI, + Configs: map[string]*evmtypes.ChainReaderDefinition{ + consts.EventNameCCIPMessageSent: { + ChainSpecificName: "CCIPMessageSent", + ReadType: evmtypes.Event, + }, + }, + }, + }, + } + + s := testSetup(ctx, t, chainS1, chainD, nil, cfg) + + _, err := s.contract.EmitCCIPMessageSent(s.auth, uint64(chainD), ccip_reader_tester.InternalEVM2AnyRampMessage{ + Header: ccip_reader_tester.InternalRampMessageHeader{ + MessageId: [32]byte{1, 0, 0, 0, 0}, + SourceChainSelector: uint64(chainS1), + DestChainSelector: uint64(chainD), + SequenceNumber: 10, + }, + Sender: utils.RandomAddress(), + Data: make([]byte, 0), + Receiver: utils.RandomAddress().Bytes(), + ExtraArgs: make([]byte, 0), + FeeToken: utils.RandomAddress(), + FeeTokenAmount: big.NewInt(0), + TokenAmounts: make([]ccip_reader_tester.InternalRampTokenAmount, 0), + }) + assert.NoError(t, err) + + _, err = s.contract.EmitCCIPMessageSent(s.auth, uint64(chainD), ccip_reader_tester.InternalEVM2AnyRampMessage{ + Header: ccip_reader_tester.InternalRampMessageHeader{ + MessageId: [32]byte{1, 0, 0, 0, 1}, + SourceChainSelector: uint64(chainS1), + DestChainSelector: uint64(chainD), + SequenceNumber: 15, + }, + Sender: utils.RandomAddress(), + Data: make([]byte, 0), + Receiver: utils.RandomAddress().Bytes(), + ExtraArgs: make([]byte, 0), + FeeToken: utils.RandomAddress(), + FeeTokenAmount: big.NewInt(0), + TokenAmounts: make([]ccip_reader_tester.InternalRampTokenAmount, 0), + }) + assert.NoError(t, err) + + s.sb.Commit() + + // Need to replay as sometimes the logs are not picked up by the log poller (?) + // Maybe another situation where chain reader doesn't register filters as expected. + require.NoError(t, s.lp.Replay(ctx, 1)) + + var msgs []cciptypes.Message + require.Eventually(t, func() bool { + msgs, err = s.reader.MsgsBetweenSeqNums( + ctx, + chainS1, + cciptypes.NewSeqNumRange(5, 20), + ) + require.NoError(t, err) + return len(msgs) == 2 + }, tests.WaitTimeout(t), 100*time.Millisecond) + + require.Len(t, msgs, 2) + // sort to ensure ascending order of sequence numbers. + sort.Slice(msgs, func(i, j int) bool { + return msgs[i].Header.SequenceNumber < msgs[j].Header.SequenceNumber + }) + require.Equal(t, cciptypes.SeqNum(10), msgs[0].Header.SequenceNumber) + require.Equal(t, cciptypes.SeqNum(15), msgs[1].Header.SequenceNumber) + for _, msg := range msgs { + require.Equal(t, chainS1, msg.Header.SourceChainSelector) + require.Equal(t, chainD, msg.Header.DestChainSelector) + } +} + +func TestCCIPReader_NextSeqNum(t *testing.T) { + ctx := testutils.Context(t) + + onChainSeqNums := map[cciptypes.ChainSelector]cciptypes.SeqNum{ + chainS1: 10, + chainS2: 20, + chainS3: 30, + } + + cfg := evmtypes.ChainReaderConfig{ + Contracts: map[string]evmtypes.ChainContractReader{ + consts.ContractNameOffRamp: { + ContractABI: ccip_reader_tester.CCIPReaderTesterABI, + Configs: map[string]*evmtypes.ChainReaderDefinition{ + consts.MethodNameGetSourceChainConfig: { + ChainSpecificName: "getSourceChainConfig", + ReadType: evmtypes.Method, + }, + }, + }, + }, + } + + s := testSetup(ctx, t, chainD, chainD, onChainSeqNums, cfg) + + seqNums, err := s.reader.NextSeqNum(ctx, []cciptypes.ChainSelector{chainS1, chainS2, chainS3}) + assert.NoError(t, err) + assert.Len(t, seqNums, 3) + assert.Equal(t, cciptypes.SeqNum(10), seqNums[0]) + assert.Equal(t, cciptypes.SeqNum(20), seqNums[1]) + assert.Equal(t, cciptypes.SeqNum(30), seqNums[2]) +} + +func TestCCIPReader_GetExpectedNextSequenceNumber(t *testing.T) { + ctx := testutils.Context(t) + + cfg := evmtypes.ChainReaderConfig{ + Contracts: map[string]evmtypes.ChainContractReader{ + consts.ContractNameOnRamp: { + ContractABI: ccip_reader_tester.CCIPReaderTesterABI, + Configs: map[string]*evmtypes.ChainReaderDefinition{ + consts.MethodNameGetExpectedNextSequenceNumber: { + ChainSpecificName: "getExpectedNextSequenceNumber", + ReadType: evmtypes.Method, + }, + }, + }, + }, + } + + s := testSetup(ctx, t, chainS1, chainD, nil, cfg) + + _, err := s.contract.SetDestChainSeqNr(s.auth, uint64(chainD), 10) + require.NoError(t, err) + s.sb.Commit() + + seqNum, err := s.reader.GetExpectedNextSequenceNumber(ctx, chainS1, chainD) + require.NoError(t, err) + require.Equal(t, cciptypes.SeqNum(10)+1, seqNum) + + _, err = s.contract.SetDestChainSeqNr(s.auth, uint64(chainD), 25) + require.NoError(t, err) + s.sb.Commit() + + seqNum, err = s.reader.GetExpectedNextSequenceNumber(ctx, chainS1, chainD) + require.NoError(t, err) + require.Equal(t, cciptypes.SeqNum(25)+1, seqNum) +} + +func TestCCIPReader_Nonces(t *testing.T) { + ctx := testutils.Context(t) + var nonces = map[cciptypes.ChainSelector]map[common.Address]uint64{ + chainS1: { + utils.RandomAddress(): 10, + utils.RandomAddress(): 20, + }, + chainS2: { + utils.RandomAddress(): 30, + utils.RandomAddress(): 40, + }, + chainS3: { + utils.RandomAddress(): 50, + utils.RandomAddress(): 60, + }, + } + + cfg := evmtypes.ChainReaderConfig{ + Contracts: map[string]evmtypes.ChainContractReader{ + consts.ContractNameNonceManager: { + ContractABI: ccip_reader_tester.CCIPReaderTesterABI, + Configs: map[string]*evmtypes.ChainReaderDefinition{ + consts.MethodNameGetInboundNonce: { + ChainSpecificName: "getInboundNonce", + ReadType: evmtypes.Method, + }, + }, + }, + }, + } + + s := testSetup(ctx, t, chainD, chainD, nil, cfg) + + // Add some nonces. + for chain, addrs := range nonces { + for addr, nonce := range addrs { + _, err := s.contract.SetInboundNonce(s.auth, uint64(chain), nonce, addr.Bytes()) + assert.NoError(t, err) + } + } + s.sb.Commit() + + for sourceChain, addrs := range nonces { + var addrQuery []string + for addr := range addrs { + addrQuery = append(addrQuery, addr.String()) + } + addrQuery = append(addrQuery, utils.RandomAddress().String()) + + results, err := s.reader.Nonces(ctx, sourceChain, chainD, addrQuery) + assert.NoError(t, err) + assert.Len(t, results, len(addrQuery)) + for addr, nonce := range addrs { + assert.Equal(t, nonce, results[addr.String()]) + } + } +} + +func testSetup(ctx context.Context, t *testing.T, readerChain, destChain cciptypes.ChainSelector, onChainSeqNums map[cciptypes.ChainSelector]cciptypes.SeqNum, cfg evmtypes.ChainReaderConfig) *testSetupData { + const chainID = 1337 + + // Generate a new key pair for the simulated account + privateKey, err := crypto.GenerateKey() + assert.NoError(t, err) + // Set up the genesis account with balance + blnc, ok := big.NewInt(0).SetString("999999999999999999999999999999999999", 10) + assert.True(t, ok) + alloc := map[common.Address]core.GenesisAccount{crypto.PubkeyToAddress(privateKey.PublicKey): {Balance: blnc}} + simulatedBackend := backends.NewSimulatedBackend(alloc, 0) + // Create a transactor + + auth, err := bind.NewKeyedTransactorWithChainID(privateKey, big.NewInt(chainID)) + assert.NoError(t, err) + auth.GasLimit = uint64(0) + + // Deploy the contract + address, _, _, err := ccip_reader_tester.DeployCCIPReaderTester(auth, simulatedBackend) + assert.NoError(t, err) + simulatedBackend.Commit() + + // Setup contract client + contract, err := ccip_reader_tester.NewCCIPReaderTester(address, simulatedBackend) + assert.NoError(t, err) + + lggr := logger.TestLogger(t) + lggr.SetLogLevel(zapcore.ErrorLevel) + db := pgtest.NewSqlxDB(t) + lpOpts := logpoller.Opts{ + PollPeriod: time.Millisecond, + FinalityDepth: 0, + BackfillBatchSize: 10, + RpcBatchSize: 10, + KeepFinalizedBlocksDepth: 100000, + } + cl := client.NewSimulatedBackendClient(t, simulatedBackend, big.NewInt(0).SetUint64(uint64(readerChain))) + headTracker := headtracker.NewSimulatedHeadTracker(cl, lpOpts.UseFinalityTag, lpOpts.FinalityDepth) + lp := logpoller.NewLogPoller(logpoller.NewORM(big.NewInt(0).SetUint64(uint64(readerChain)), db, lggr), + cl, + lggr, + headTracker, + lpOpts, + ) + assert.NoError(t, lp.Start(ctx)) + + for sourceChain, seqNum := range onChainSeqNums { + _, err1 := contract.SetSourceChainConfig(auth, uint64(sourceChain), ccip_reader_tester.OffRampSourceChainConfig{ + IsEnabled: true, + MinSeqNr: uint64(seqNum), + OnRamp: utils.RandomAddress().Bytes(), + }) + assert.NoError(t, err1) + simulatedBackend.Commit() + scc, err1 := contract.GetSourceChainConfig(&bind.CallOpts{Context: ctx}, uint64(sourceChain)) + assert.NoError(t, err1) + assert.Equal(t, seqNum, cciptypes.SeqNum(scc.MinSeqNr)) + } + + contractNames := maps.Keys(cfg.Contracts) + assert.Len(t, contractNames, 1, "test setup assumes there is only one contract") + + cr, err := evm.NewChainReaderService(ctx, lggr, lp, headTracker, cl, cfg) + require.NoError(t, err) + + extendedCr := contractreader.NewExtendedContractReader(cr) + err = extendedCr.Bind(ctx, []types.BoundContract{ + { + Address: address.String(), + Name: contractNames[0], + }, + }) + require.NoError(t, err) + + err = cr.Start(ctx) + require.NoError(t, err) + + contractReaders := map[cciptypes.ChainSelector]contractreader.Extended{readerChain: extendedCr} + contractWriters := make(map[cciptypes.ChainSelector]types.ChainWriter) + reader := ccipreaderpkg.NewCCIPReaderWithExtendedContractReaders(lggr, contractReaders, contractWriters, destChain, nil) + + t.Cleanup(func() { + require.NoError(t, cr.Close()) + require.NoError(t, lp.Close()) + require.NoError(t, db.Close()) + }) + + return &testSetupData{ + contractAddr: address, + contract: contract, + sb: simulatedBackend, + auth: auth, + lp: lp, + cl: cl, + reader: reader, + } +} + +type testSetupData struct { + contractAddr common.Address + contract *ccip_reader_tester.CCIPReaderTester + sb *backends.SimulatedBackend + auth *bind.TransactOpts + lp logpoller.LogPoller + cl client.Client + reader ccipreaderpkg.CCIPReader +} diff --git a/core/capabilities/ccip/ccip_integration_tests/chainreader/Makefile b/core/capabilities/ccip/ccip_integration_tests/chainreader/Makefile new file mode 100644 index 00000000000..e9c88564e69 --- /dev/null +++ b/core/capabilities/ccip/ccip_integration_tests/chainreader/Makefile @@ -0,0 +1,12 @@ + +# IMPORTANT: If you encounter any issues try using solc 0.8.18 and abigen 1.14.5 + +.PHONY: build +build: + rm -rf build/ + solc --evm-version paris --abi --bin mycontract.sol -o build + abigen --abi build/mycontract_sol_SimpleContract.abi --bin build/mycontract_sol_SimpleContract.bin --pkg=chainreader --out=mycontract.go + +.PHONY: test +test: build + go test -v --tags "playground" ./... diff --git a/core/capabilities/ccip/ccip_integration_tests/chainreader/chainreader_test.go b/core/capabilities/ccip/ccip_integration_tests/chainreader/chainreader_test.go new file mode 100644 index 00000000000..52a3de0dae9 --- /dev/null +++ b/core/capabilities/ccip/ccip_integration_tests/chainreader/chainreader_test.go @@ -0,0 +1,273 @@ +//go:build playground +// +build playground + +package chainreader + +import ( + "context" + _ "embed" + "math/big" + "strconv" + "sync" + "testing" + "time" + + "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/accounts/abi/bind/backends" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/crypto" + "github.com/stretchr/testify/assert" + + "github.com/smartcontractkit/chainlink-common/pkg/codec" + types2 "github.com/smartcontractkit/chainlink-common/pkg/types" + query2 "github.com/smartcontractkit/chainlink-common/pkg/types/query" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/headtracker" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/pgtest" + logger2 "github.com/smartcontractkit/chainlink/v2/core/logger" + "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm" + evmtypes "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/types" +) + +const chainID = 1337 + +type testSetupData struct { + contractAddr common.Address + contract *Chainreader + sb *backends.SimulatedBackend + auth *bind.TransactOpts +} + +func TestChainReader(t *testing.T) { + ctx := testutils.Context(t) + lggr := logger2.NullLogger + d := testSetup(t, ctx) + + db := pgtest.NewSqlxDB(t) + lpOpts := logpoller.Opts{ + PollPeriod: time.Millisecond, + FinalityDepth: 0, + BackfillBatchSize: 10, + RpcBatchSize: 10, + KeepFinalizedBlocksDepth: 100000, + } + cl := client.NewSimulatedBackendClient(t, d.sb, big.NewInt(chainID)) + headTracker := headtracker.NewSimulatedHeadTracker(cl, lpOpts.UseFinalityTag, lpOpts.FinalityDepth) + lp := logpoller.NewLogPoller(logpoller.NewORM(big.NewInt(chainID), db, lggr), + cl, + lggr, + headTracker, + lpOpts, + ) + assert.NoError(t, lp.Start(ctx)) + + const ( + ContractNameAlias = "myCoolContract" + + FnAliasGetCount = "myCoolFunction" + FnGetCount = "getEventCount" + + FnAliasGetNumbers = "GetNumbers" + FnGetNumbers = "getNumbers" + + FnAliasGetPerson = "GetPerson" + FnGetPerson = "getPerson" + + EventNameAlias = "myCoolEvent" + EventName = "SimpleEvent" + ) + + // Initialize chainReader + cfg := evmtypes.ChainReaderConfig{ + Contracts: map[string]evmtypes.ChainContractReader{ + ContractNameAlias: { + ContractPollingFilter: evmtypes.ContractPollingFilter{ + GenericEventNames: []string{EventNameAlias}, + }, + ContractABI: ChainreaderMetaData.ABI, + Configs: map[string]*evmtypes.ChainReaderDefinition{ + EventNameAlias: { + ChainSpecificName: EventName, + ReadType: evmtypes.Event, + ConfidenceConfirmations: map[string]int{"0.0": 0, "1.0": 0}, + }, + FnAliasGetCount: { + ChainSpecificName: FnGetCount, + }, + FnAliasGetNumbers: { + ChainSpecificName: FnGetNumbers, + OutputModifications: codec.ModifiersConfig{}, + }, + FnAliasGetPerson: { + ChainSpecificName: FnGetPerson, + OutputModifications: codec.ModifiersConfig{ + &codec.RenameModifierConfig{ + Fields: map[string]string{"Name": "NameField"}, // solidity name -> go struct name + }, + }, + }, + }, + }, + }, + } + + cr, err := evm.NewChainReaderService(ctx, lggr, lp, cl, cfg) + assert.NoError(t, err) + err = cr.Bind(ctx, []types2.BoundContract{ + { + Address: d.contractAddr.String(), + Name: ContractNameAlias, + Pending: false, + }, + }) + assert.NoError(t, err) + + err = cr.Start(ctx) + assert.NoError(t, err) + for { + if err := cr.Ready(); err == nil { + break + } + } + + emitEvents(t, d, ctx) // Calls the contract to emit events + + // (hack) Sometimes LP logs are missing, commit several times and wait few seconds to make it work. + for i := 0; i < 100; i++ { + d.sb.Commit() + } + time.Sleep(5 * time.Second) + + t.Run("simple contract read", func(t *testing.T) { + var cnt big.Int + err = cr.GetLatestValue(ctx, ContractNameAlias, FnAliasGetCount, map[string]interface{}{}, &cnt) + assert.NoError(t, err) + assert.Equal(t, int64(10), cnt.Int64()) + }) + + t.Run("read array", func(t *testing.T) { + var nums []big.Int + err = cr.GetLatestValue(ctx, ContractNameAlias, FnAliasGetNumbers, map[string]interface{}{}, &nums) + assert.NoError(t, err) + assert.Len(t, nums, 10) + for i := 1; i <= 10; i++ { + assert.Equal(t, int64(i), nums[i-1].Int64()) + } + }) + + t.Run("read struct", func(t *testing.T) { + person := struct { + NameField string + Age *big.Int // WARN: specifying a wrong data type e.g. int instead of *big.Int fails silently with a default value of 0 + }{} + err = cr.GetLatestValue(ctx, ContractNameAlias, FnAliasGetPerson, map[string]interface{}{}, &person) + assert.Equal(t, "Dim", person.NameField) + assert.Equal(t, int64(18), person.Age.Int64()) + }) + + t.Run("read events", func(t *testing.T) { + var myDataType *big.Int + seq, err := cr.QueryKey( + ctx, + ContractNameAlias, + query2.KeyFilter{ + Key: EventNameAlias, + Expressions: []query2.Expression{}, + }, + query2.LimitAndSort{}, + myDataType, + ) + assert.NoError(t, err) + assert.Equal(t, 10, len(seq), "expected 10 events from chain reader") + for _, v := range seq { + // TODO: for some reason log poller does not populate event data + blockNum, err := strconv.ParseUint(v.Identifier, 10, 64) + assert.NoError(t, err) + assert.Positive(t, blockNum) + t.Logf("(chain reader) got event: (data=%v) (hash=%x)", v.Data, v.Hash) + } + }) +} + +func testSetup(t *testing.T, ctx context.Context) *testSetupData { + // Generate a new key pair for the simulated account + privateKey, err := crypto.GenerateKey() + assert.NoError(t, err) + // Set up the genesis account with balance + blnc, ok := big.NewInt(0).SetString("999999999999999999999999999999999999", 10) + assert.True(t, ok) + alloc := map[common.Address]core.GenesisAccount{crypto.PubkeyToAddress(privateKey.PublicKey): {Balance: blnc}} + simulatedBackend := backends.NewSimulatedBackend(alloc, 0) + // Create a transactor + + auth, err := bind.NewKeyedTransactorWithChainID(privateKey, big.NewInt(chainID)) + assert.NoError(t, err) + auth.GasLimit = uint64(0) + + // Deploy the contract + address, tx, _, err := DeployChainreader(auth, simulatedBackend) + assert.NoError(t, err) + simulatedBackend.Commit() + t.Logf("contract deployed: addr=%s tx=%s", address.Hex(), tx.Hash()) + + // Setup contract client + contract, err := NewChainreader(address, simulatedBackend) + assert.NoError(t, err) + + return &testSetupData{ + contractAddr: address, + contract: contract, + sb: simulatedBackend, + auth: auth, + } +} + +func emitEvents(t *testing.T, d *testSetupData, ctx context.Context) { + var wg sync.WaitGroup + wg.Add(2) + + // Start emitting events + go func() { + defer wg.Done() + for i := 0; i < 10; i++ { + _, err := d.contract.EmitEvent(d.auth) + assert.NoError(t, err) + d.sb.Commit() + } + }() + + // Listen events using go-ethereum lib + go func() { + query := ethereum.FilterQuery{ + FromBlock: big.NewInt(0), + Addresses: []common.Address{d.contractAddr}, + } + logs := make(chan types.Log) + sub, err := d.sb.SubscribeFilterLogs(ctx, query, logs) + assert.NoError(t, err) + + numLogs := 0 + defer wg.Done() + for { + // Wait for the events + select { + case err := <-sub.Err(): + assert.NoError(t, err, "got an unexpected error") + case vLog := <-logs: + assert.Equal(t, d.contractAddr, vLog.Address, "got an unexpected address") + t.Logf("(geth) got new log (cnt=%d) (data=%x) (topics=%s)", numLogs, vLog.Data, vLog.Topics) + numLogs++ + if numLogs == 10 { + return + } + } + } + }() + + wg.Wait() // wait for all the events to be consumed +} diff --git a/core/capabilities/ccip/ccip_integration_tests/chainreader/mycontract.go b/core/capabilities/ccip/ccip_integration_tests/chainreader/mycontract.go new file mode 100644 index 00000000000..c7d480eed46 --- /dev/null +++ b/core/capabilities/ccip/ccip_integration_tests/chainreader/mycontract.go @@ -0,0 +1,519 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package chainreader + +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 + _ = abi.ConvertType +) + +// SimpleContractPerson is an auto generated low-level Go binding around an user-defined struct. +type SimpleContractPerson struct { + Name string + Age *big.Int +} + +// ChainreaderMetaData contains all meta data concerning the Chainreader contract. +var ChainreaderMetaData = &bind.MetaData{ + ABI: "[{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"SimpleEvent\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"emitEvent\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"eventCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getEventCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getNumbers\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"\",\"type\":\"uint256[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getPerson\",\"outputs\":[{\"components\":[{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"age\",\"type\":\"uint256\"}],\"internalType\":\"structSimpleContract.Person\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"numbers\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", + Bin: "0x608060405234801561001057600080fd5b506105a1806100206000396000f3fe608060405234801561001057600080fd5b50600436106100625760003560e01c806371be2e4a146100675780637b0cb8391461008557806389f915f61461008f5780638ec4dc95146100ad578063d39fa233146100cb578063d9e48f5c146100fb575b600080fd5b61006f610119565b60405161007c91906102ac565b60405180910390f35b61008d61011f565b005b61009761019c565b6040516100a49190610385565b60405180910390f35b6100b56101f4565b6040516100c29190610474565b60405180910390f35b6100e560048036038101906100e091906104c7565b61024c565b6040516100f291906102ac565b60405180910390f35b610103610270565b60405161011091906102ac565b60405180910390f35b60005481565b60008081548092919061013190610523565b9190505550600160005490806001815401808255809150506001900390600052602060002001600090919091909150557f12d199749b3f4c44df8d9386c63d725b7756ec47204f3aa0bf05ea832f89effb60005460405161019291906102ac565b60405180910390a1565b606060018054806020026020016040519081016040528092919081815260200182805480156101ea57602002820191906000526020600020905b8154815260200190600101908083116101d6575b5050505050905090565b6101fc610279565b60405180604001604052806040518060400160405280600381526020017f44696d000000000000000000000000000000000000000000000000000000000081525081526020016012815250905090565b6001818154811061025c57600080fd5b906000526020600020016000915090505481565b60008054905090565b604051806040016040528060608152602001600081525090565b6000819050919050565b6102a681610293565b82525050565b60006020820190506102c1600083018461029d565b92915050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6102fc81610293565b82525050565b600061030e83836102f3565b60208301905092915050565b6000602082019050919050565b6000610332826102c7565b61033c81856102d2565b9350610347836102e3565b8060005b8381101561037857815161035f8882610302565b975061036a8361031a565b92505060018101905061034b565b5085935050505092915050565b6000602082019050818103600083015261039f8184610327565b905092915050565b600081519050919050565b600082825260208201905092915050565b60005b838110156103e15780820151818401526020810190506103c6565b60008484015250505050565b6000601f19601f8301169050919050565b6000610409826103a7565b61041381856103b2565b93506104238185602086016103c3565b61042c816103ed565b840191505092915050565b6000604083016000830151848203600086015261045482826103fe565b915050602083015161046960208601826102f3565b508091505092915050565b6000602082019050818103600083015261048e8184610437565b905092915050565b600080fd5b6104a481610293565b81146104af57600080fd5b50565b6000813590506104c18161049b565b92915050565b6000602082840312156104dd576104dc610496565b5b60006104eb848285016104b2565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061052e82610293565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036105605761055f6104f4565b5b60018201905091905056fea2646970667358221220f7986dc9efbc0d9ef58e2925ffddc62ea13a6bab8b3a2c03ad2d85d50653129664736f6c63430008120033", +} + +// ChainreaderABI is the input ABI used to generate the binding from. +// Deprecated: Use ChainreaderMetaData.ABI instead. +var ChainreaderABI = ChainreaderMetaData.ABI + +// ChainreaderBin is the compiled bytecode used for deploying new contracts. +// Deprecated: Use ChainreaderMetaData.Bin instead. +var ChainreaderBin = ChainreaderMetaData.Bin + +// DeployChainreader deploys a new Ethereum contract, binding an instance of Chainreader to it. +func DeployChainreader(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *Chainreader, error) { + parsed, err := ChainreaderMetaData.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(ChainreaderBin), backend) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &Chainreader{ChainreaderCaller: ChainreaderCaller{contract: contract}, ChainreaderTransactor: ChainreaderTransactor{contract: contract}, ChainreaderFilterer: ChainreaderFilterer{contract: contract}}, nil +} + +// Chainreader is an auto generated Go binding around an Ethereum contract. +type Chainreader struct { + ChainreaderCaller // Read-only binding to the contract + ChainreaderTransactor // Write-only binding to the contract + ChainreaderFilterer // Log filterer for contract events +} + +// ChainreaderCaller is an auto generated read-only Go binding around an Ethereum contract. +type ChainreaderCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// ChainreaderTransactor is an auto generated write-only Go binding around an Ethereum contract. +type ChainreaderTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// ChainreaderFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type ChainreaderFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// ChainreaderSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type ChainreaderSession struct { + Contract *Chainreader // 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 +} + +// ChainreaderCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type ChainreaderCallerSession struct { + Contract *ChainreaderCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// ChainreaderTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type ChainreaderTransactorSession struct { + Contract *ChainreaderTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// ChainreaderRaw is an auto generated low-level Go binding around an Ethereum contract. +type ChainreaderRaw struct { + Contract *Chainreader // Generic contract binding to access the raw methods on +} + +// ChainreaderCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type ChainreaderCallerRaw struct { + Contract *ChainreaderCaller // Generic read-only contract binding to access the raw methods on +} + +// ChainreaderTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type ChainreaderTransactorRaw struct { + Contract *ChainreaderTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewChainreader creates a new instance of Chainreader, bound to a specific deployed contract. +func NewChainreader(address common.Address, backend bind.ContractBackend) (*Chainreader, error) { + contract, err := bindChainreader(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &Chainreader{ChainreaderCaller: ChainreaderCaller{contract: contract}, ChainreaderTransactor: ChainreaderTransactor{contract: contract}, ChainreaderFilterer: ChainreaderFilterer{contract: contract}}, nil +} + +// NewChainreaderCaller creates a new read-only instance of Chainreader, bound to a specific deployed contract. +func NewChainreaderCaller(address common.Address, caller bind.ContractCaller) (*ChainreaderCaller, error) { + contract, err := bindChainreader(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &ChainreaderCaller{contract: contract}, nil +} + +// NewChainreaderTransactor creates a new write-only instance of Chainreader, bound to a specific deployed contract. +func NewChainreaderTransactor(address common.Address, transactor bind.ContractTransactor) (*ChainreaderTransactor, error) { + contract, err := bindChainreader(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &ChainreaderTransactor{contract: contract}, nil +} + +// NewChainreaderFilterer creates a new log filterer instance of Chainreader, bound to a specific deployed contract. +func NewChainreaderFilterer(address common.Address, filterer bind.ContractFilterer) (*ChainreaderFilterer, error) { + contract, err := bindChainreader(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &ChainreaderFilterer{contract: contract}, nil +} + +// bindChainreader binds a generic wrapper to an already deployed contract. +func bindChainreader(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := ChainreaderMetaData.GetAbi() + 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 (_Chainreader *ChainreaderRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _Chainreader.Contract.ChainreaderCaller.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 (_Chainreader *ChainreaderRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Chainreader.Contract.ChainreaderTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_Chainreader *ChainreaderRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _Chainreader.Contract.ChainreaderTransactor.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 (_Chainreader *ChainreaderCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _Chainreader.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 (_Chainreader *ChainreaderTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Chainreader.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_Chainreader *ChainreaderTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _Chainreader.Contract.contract.Transact(opts, method, params...) +} + +// EventCount is a free data retrieval call binding the contract method 0x71be2e4a. +// +// Solidity: function eventCount() view returns(uint256) +func (_Chainreader *ChainreaderCaller) EventCount(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _Chainreader.contract.Call(opts, &out, "eventCount") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// EventCount is a free data retrieval call binding the contract method 0x71be2e4a. +// +// Solidity: function eventCount() view returns(uint256) +func (_Chainreader *ChainreaderSession) EventCount() (*big.Int, error) { + return _Chainreader.Contract.EventCount(&_Chainreader.CallOpts) +} + +// EventCount is a free data retrieval call binding the contract method 0x71be2e4a. +// +// Solidity: function eventCount() view returns(uint256) +func (_Chainreader *ChainreaderCallerSession) EventCount() (*big.Int, error) { + return _Chainreader.Contract.EventCount(&_Chainreader.CallOpts) +} + +// GetEventCount is a free data retrieval call binding the contract method 0xd9e48f5c. +// +// Solidity: function getEventCount() view returns(uint256) +func (_Chainreader *ChainreaderCaller) GetEventCount(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _Chainreader.contract.Call(opts, &out, "getEventCount") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// GetEventCount is a free data retrieval call binding the contract method 0xd9e48f5c. +// +// Solidity: function getEventCount() view returns(uint256) +func (_Chainreader *ChainreaderSession) GetEventCount() (*big.Int, error) { + return _Chainreader.Contract.GetEventCount(&_Chainreader.CallOpts) +} + +// GetEventCount is a free data retrieval call binding the contract method 0xd9e48f5c. +// +// Solidity: function getEventCount() view returns(uint256) +func (_Chainreader *ChainreaderCallerSession) GetEventCount() (*big.Int, error) { + return _Chainreader.Contract.GetEventCount(&_Chainreader.CallOpts) +} + +// GetNumbers is a free data retrieval call binding the contract method 0x89f915f6. +// +// Solidity: function getNumbers() view returns(uint256[]) +func (_Chainreader *ChainreaderCaller) GetNumbers(opts *bind.CallOpts) ([]*big.Int, error) { + var out []interface{} + err := _Chainreader.contract.Call(opts, &out, "getNumbers") + + if err != nil { + return *new([]*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new([]*big.Int)).(*[]*big.Int) + + return out0, err + +} + +// GetNumbers is a free data retrieval call binding the contract method 0x89f915f6. +// +// Solidity: function getNumbers() view returns(uint256[]) +func (_Chainreader *ChainreaderSession) GetNumbers() ([]*big.Int, error) { + return _Chainreader.Contract.GetNumbers(&_Chainreader.CallOpts) +} + +// GetNumbers is a free data retrieval call binding the contract method 0x89f915f6. +// +// Solidity: function getNumbers() view returns(uint256[]) +func (_Chainreader *ChainreaderCallerSession) GetNumbers() ([]*big.Int, error) { + return _Chainreader.Contract.GetNumbers(&_Chainreader.CallOpts) +} + +// GetPerson is a free data retrieval call binding the contract method 0x8ec4dc95. +// +// Solidity: function getPerson() pure returns((string,uint256)) +func (_Chainreader *ChainreaderCaller) GetPerson(opts *bind.CallOpts) (SimpleContractPerson, error) { + var out []interface{} + err := _Chainreader.contract.Call(opts, &out, "getPerson") + + if err != nil { + return *new(SimpleContractPerson), err + } + + out0 := *abi.ConvertType(out[0], new(SimpleContractPerson)).(*SimpleContractPerson) + + return out0, err + +} + +// GetPerson is a free data retrieval call binding the contract method 0x8ec4dc95. +// +// Solidity: function getPerson() pure returns((string,uint256)) +func (_Chainreader *ChainreaderSession) GetPerson() (SimpleContractPerson, error) { + return _Chainreader.Contract.GetPerson(&_Chainreader.CallOpts) +} + +// GetPerson is a free data retrieval call binding the contract method 0x8ec4dc95. +// +// Solidity: function getPerson() pure returns((string,uint256)) +func (_Chainreader *ChainreaderCallerSession) GetPerson() (SimpleContractPerson, error) { + return _Chainreader.Contract.GetPerson(&_Chainreader.CallOpts) +} + +// Numbers is a free data retrieval call binding the contract method 0xd39fa233. +// +// Solidity: function numbers(uint256 ) view returns(uint256) +func (_Chainreader *ChainreaderCaller) Numbers(opts *bind.CallOpts, arg0 *big.Int) (*big.Int, error) { + var out []interface{} + err := _Chainreader.contract.Call(opts, &out, "numbers", arg0) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// Numbers is a free data retrieval call binding the contract method 0xd39fa233. +// +// Solidity: function numbers(uint256 ) view returns(uint256) +func (_Chainreader *ChainreaderSession) Numbers(arg0 *big.Int) (*big.Int, error) { + return _Chainreader.Contract.Numbers(&_Chainreader.CallOpts, arg0) +} + +// Numbers is a free data retrieval call binding the contract method 0xd39fa233. +// +// Solidity: function numbers(uint256 ) view returns(uint256) +func (_Chainreader *ChainreaderCallerSession) Numbers(arg0 *big.Int) (*big.Int, error) { + return _Chainreader.Contract.Numbers(&_Chainreader.CallOpts, arg0) +} + +// EmitEvent is a paid mutator transaction binding the contract method 0x7b0cb839. +// +// Solidity: function emitEvent() returns() +func (_Chainreader *ChainreaderTransactor) EmitEvent(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Chainreader.contract.Transact(opts, "emitEvent") +} + +// EmitEvent is a paid mutator transaction binding the contract method 0x7b0cb839. +// +// Solidity: function emitEvent() returns() +func (_Chainreader *ChainreaderSession) EmitEvent() (*types.Transaction, error) { + return _Chainreader.Contract.EmitEvent(&_Chainreader.TransactOpts) +} + +// EmitEvent is a paid mutator transaction binding the contract method 0x7b0cb839. +// +// Solidity: function emitEvent() returns() +func (_Chainreader *ChainreaderTransactorSession) EmitEvent() (*types.Transaction, error) { + return _Chainreader.Contract.EmitEvent(&_Chainreader.TransactOpts) +} + +// ChainreaderSimpleEventIterator is returned from FilterSimpleEvent and is used to iterate over the raw logs and unpacked data for SimpleEvent events raised by the Chainreader contract. +type ChainreaderSimpleEventIterator struct { + Event *ChainreaderSimpleEvent // 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 *ChainreaderSimpleEventIterator) 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(ChainreaderSimpleEvent) + 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(ChainreaderSimpleEvent) + 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 *ChainreaderSimpleEventIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *ChainreaderSimpleEventIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// ChainreaderSimpleEvent represents a SimpleEvent event raised by the Chainreader contract. +type ChainreaderSimpleEvent struct { + Value *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterSimpleEvent is a free log retrieval operation binding the contract event 0x12d199749b3f4c44df8d9386c63d725b7756ec47204f3aa0bf05ea832f89effb. +// +// Solidity: event SimpleEvent(uint256 value) +func (_Chainreader *ChainreaderFilterer) FilterSimpleEvent(opts *bind.FilterOpts) (*ChainreaderSimpleEventIterator, error) { + + logs, sub, err := _Chainreader.contract.FilterLogs(opts, "SimpleEvent") + if err != nil { + return nil, err + } + return &ChainreaderSimpleEventIterator{contract: _Chainreader.contract, event: "SimpleEvent", logs: logs, sub: sub}, nil +} + +// WatchSimpleEvent is a free log subscription operation binding the contract event 0x12d199749b3f4c44df8d9386c63d725b7756ec47204f3aa0bf05ea832f89effb. +// +// Solidity: event SimpleEvent(uint256 value) +func (_Chainreader *ChainreaderFilterer) WatchSimpleEvent(opts *bind.WatchOpts, sink chan<- *ChainreaderSimpleEvent) (event.Subscription, error) { + + logs, sub, err := _Chainreader.contract.WatchLogs(opts, "SimpleEvent") + 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(ChainreaderSimpleEvent) + if err := _Chainreader.contract.UnpackLog(event, "SimpleEvent", 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 +} + +// ParseSimpleEvent is a log parse operation binding the contract event 0x12d199749b3f4c44df8d9386c63d725b7756ec47204f3aa0bf05ea832f89effb. +// +// Solidity: event SimpleEvent(uint256 value) +func (_Chainreader *ChainreaderFilterer) ParseSimpleEvent(log types.Log) (*ChainreaderSimpleEvent, error) { + event := new(ChainreaderSimpleEvent) + if err := _Chainreader.contract.UnpackLog(event, "SimpleEvent", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} diff --git a/core/capabilities/ccip/ccip_integration_tests/chainreader/mycontract.sol b/core/capabilities/ccip/ccip_integration_tests/chainreader/mycontract.sol new file mode 100644 index 00000000000..0fae1f4baac --- /dev/null +++ b/core/capabilities/ccip/ccip_integration_tests/chainreader/mycontract.sol @@ -0,0 +1,31 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.18; + +contract SimpleContract { + event SimpleEvent(uint256 value); + uint256 public eventCount; + uint[] public numbers; + + struct Person { + string name; + uint age; + } + + function emitEvent() public { + eventCount++; + numbers.push(eventCount); + emit SimpleEvent(eventCount); + } + + function getEventCount() public view returns (uint256) { + return eventCount; + } + + function getNumbers() public view returns (uint256[] memory) { + return numbers; + } + + function getPerson() public pure returns (Person memory) { + return Person("Dim", 18); + } +} diff --git a/core/capabilities/ccip/ccip_integration_tests/helpers.go b/core/capabilities/ccip/ccip_integration_tests/helpers.go new file mode 100644 index 00000000000..4670333e391 --- /dev/null +++ b/core/capabilities/ccip/ccip_integration_tests/helpers.go @@ -0,0 +1,953 @@ +package ccip_integration_tests + +import ( + "bytes" + "encoding/hex" + "math/big" + "sort" + "testing" + "time" + + "github.com/smartcontractkit/chainlink-ccip/chainconfig" + "github.com/smartcontractkit/chainlink-ccip/pluginconfig" + commonconfig "github.com/smartcontractkit/chainlink-common/pkg/config" + "github.com/smartcontractkit/chainlink-common/pkg/types/ccipocr3" + "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/ccip_integration_tests/integrationhelpers" + cctypes "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/types" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/fee_quoter" + + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/accounts/abi/bind/backends" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core" + + confighelper2 "github.com/smartcontractkit/libocr/offchainreporting2plus/confighelper" + "github.com/smartcontractkit/libocr/offchainreporting2plus/ocr3confighelper" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/ccip_config" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/maybe_revert_message_receiver" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/mock_rmn_contract" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/nonce_manager" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/ocr3_config_encoder" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/offramp" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/onramp" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/rmn_proxy_contract" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/router" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/token_admin_registry" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/weth9" + kcr "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/capabilities_registry" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/shared/generated/link_token" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" + + chainsel "github.com/smartcontractkit/chain-selectors" + + "github.com/stretchr/testify/require" +) + +var ( + homeChainID = chainsel.GETH_TESTNET.EvmChainID + ccipMessageSentTopic = onramp.OnRampCCIPMessageSent{}.Topic() + commitReportAcceptedTopic = offramp.OffRampCommitReportAccepted{}.Topic() + executionStateChangedTopic = offramp.OffRampExecutionStateChanged{}.Topic() +) + +const ( + CapabilityLabelledName = "ccip" + CapabilityVersion = "v1.0.0" + NodeOperatorID = 1 + + // These constants drive what is set in the plugin offchain configs. + FirstBlockAge = 8 * time.Hour + RemoteGasPriceBatchWriteFrequency = 30 * time.Minute + BatchGasLimit = 6_500_000 + RelativeBoostPerWaitHour = 1.5 + InflightCacheExpiry = 10 * time.Minute + RootSnoozeTime = 30 * time.Minute + BatchingStrategyID = 0 + DeltaProgress = 30 * time.Second + DeltaResend = 10 * time.Second + DeltaInitial = 20 * time.Second + DeltaRound = 2 * time.Second + DeltaGrace = 2 * time.Second + DeltaCertifiedCommitRequest = 10 * time.Second + DeltaStage = 10 * time.Second + Rmax = 3 + MaxDurationQuery = 50 * time.Millisecond + MaxDurationObservation = 5 * time.Second + MaxDurationShouldAcceptAttestedReport = 10 * time.Second + MaxDurationShouldTransmitAcceptedReport = 10 * time.Second +) + +func e18Mult(amount uint64) *big.Int { + return new(big.Int).Mul(uBigInt(amount), uBigInt(1e18)) +} + +func uBigInt(i uint64) *big.Int { + return new(big.Int).SetUint64(i) +} + +type homeChain struct { + backend *backends.SimulatedBackend + owner *bind.TransactOpts + chainID uint64 + capabilityRegistry *kcr.CapabilitiesRegistry + ccipConfig *ccip_config.CCIPConfig +} + +type onchainUniverse struct { + backend *backends.SimulatedBackend + owner *bind.TransactOpts + chainID uint64 + linkToken *link_token.LinkToken + weth *weth9.WETH9 + router *router.Router + rmnProxy *rmn_proxy_contract.RMNProxyContract + rmn *mock_rmn_contract.MockRMNContract + onramp *onramp.OnRamp + offramp *offramp.OffRamp + priceRegistry *fee_quoter.FeeQuoter + tokenAdminRegistry *token_admin_registry.TokenAdminRegistry + nonceManager *nonce_manager.NonceManager + receiver *maybe_revert_message_receiver.MaybeRevertMessageReceiver +} + +type requestData struct { + destChainSelector uint64 + receiverAddress common.Address + data []byte +} + +func (u *onchainUniverse) SendCCIPRequests(t *testing.T, requestDatas []requestData) { + for _, reqData := range requestDatas { + msg := router.ClientEVM2AnyMessage{ + Receiver: common.LeftPadBytes(reqData.receiverAddress.Bytes(), 32), + Data: reqData.data, + TokenAmounts: nil, // TODO: no tokens for now + FeeToken: u.weth.Address(), + ExtraArgs: nil, // TODO: no extra args for now, falls back to default + } + fee, err := u.router.GetFee(&bind.CallOpts{Context: testutils.Context(t)}, reqData.destChainSelector, msg) + require.NoError(t, err) + _, err = u.weth.Deposit(&bind.TransactOpts{ + From: u.owner.From, + Signer: u.owner.Signer, + Value: fee, + }) + require.NoError(t, err) + u.backend.Commit() + _, err = u.weth.Approve(u.owner, u.router.Address(), fee) + require.NoError(t, err) + u.backend.Commit() + + t.Logf("Sending CCIP request from chain %d (selector %d) to chain selector %d", + u.chainID, getSelector(u.chainID), reqData.destChainSelector) + _, err = u.router.CcipSend(u.owner, reqData.destChainSelector, msg) + require.NoError(t, err) + u.backend.Commit() + } +} + +type chainBase struct { + backend *backends.SimulatedBackend + owner *bind.TransactOpts +} + +// createUniverses does the following: +// 1. Creates 1 home chain and `numChains`-1 non-home chains +// 2. Sets up home chain with the capability registry and the CCIP config contract +// 2. Deploys the CCIP contracts to all chains. +// 3. Sets up the initial configurations for the contracts on all chains. +// 4. Wires the chains together. +// +// Conceptually one universe is ONE chain with all the contracts deployed on it and all the dependencies initialized. +func createUniverses( + t *testing.T, + numChains int, +) (homeChainUni homeChain, universes map[uint64]onchainUniverse) { + chains := createChains(t, numChains) + + homeChainBase, ok := chains[homeChainID] + require.True(t, ok, "home chain backend not available") + // Set up home chain first + homeChainUniverse := setupHomeChain(t, homeChainBase.owner, homeChainBase.backend) + + // deploy the ccip contracts on all chains + universes = make(map[uint64]onchainUniverse) + for chainID, base := range chains { + owner := base.owner + backend := base.backend + // deploy the CCIP contracts + linkToken := deployLinkToken(t, owner, backend, chainID) + rmn := deployMockRMNContract(t, owner, backend, chainID) + rmnProxy := deployRMNProxyContract(t, owner, backend, rmn.Address(), chainID) + weth := deployWETHContract(t, owner, backend, chainID) + rout := deployRouter(t, owner, backend, weth.Address(), rmnProxy.Address(), chainID) + priceRegistry := deployPriceRegistry(t, owner, backend, linkToken.Address(), weth.Address(), big.NewInt(1e18), chainID) + tokenAdminRegistry := deployTokenAdminRegistry(t, owner, backend, chainID) + nonceManager := deployNonceManager(t, owner, backend, chainID) + + // ====================================================================== + // OnRamp + // ====================================================================== + onRampAddr, _, _, err := onramp.DeployOnRamp( + owner, + backend, + onramp.OnRampStaticConfig{ + ChainSelector: getSelector(chainID), + Rmn: rmnProxy.Address(), + NonceManager: nonceManager.Address(), + TokenAdminRegistry: tokenAdminRegistry.Address(), + }, + onramp.OnRampDynamicConfig{ + FeeQuoter: priceRegistry.Address(), + // `withdrawFeeTokens` onRamp function is not part of the message flow + // so we can set this to any address + FeeAggregator: testutils.NewAddress(), + }, + // Destination chain configs will be set up later once we have all chains + []onramp.OnRampDestChainConfigArgs{}, + ) + require.NoErrorf(t, err, "failed to deploy onramp on chain id %d", chainID) + backend.Commit() + onramp, err := onramp.NewOnRamp(onRampAddr, backend) + require.NoError(t, err) + + // ====================================================================== + // OffRamp + // ====================================================================== + offrampAddr, _, _, err := offramp.DeployOffRamp( + owner, + backend, + offramp.OffRampStaticConfig{ + ChainSelector: getSelector(chainID), + Rmn: rmnProxy.Address(), + TokenAdminRegistry: tokenAdminRegistry.Address(), + NonceManager: nonceManager.Address(), + }, + offramp.OffRampDynamicConfig{ + FeeQuoter: priceRegistry.Address(), + }, + // Source chain configs will be set up later once we have all chains + []offramp.OffRampSourceChainConfigArgs{}, + ) + require.NoErrorf(t, err, "failed to deploy offramp on chain id %d", chainID) + backend.Commit() + offramp, err := offramp.NewOffRamp(offrampAddr, backend) + require.NoError(t, err) + + receiverAddress, _, _, err := maybe_revert_message_receiver.DeployMaybeRevertMessageReceiver( + owner, + backend, + false, + ) + require.NoError(t, err, "failed to deploy MaybeRevertMessageReceiver on chain id %d", chainID) + backend.Commit() + receiver, err := maybe_revert_message_receiver.NewMaybeRevertMessageReceiver(receiverAddress, backend) + require.NoError(t, err) + + universe := onchainUniverse{ + backend: backend, + owner: owner, + chainID: chainID, + linkToken: linkToken, + weth: weth, + router: rout, + rmnProxy: rmnProxy, + rmn: rmn, + onramp: onramp, + offramp: offramp, + priceRegistry: priceRegistry, + tokenAdminRegistry: tokenAdminRegistry, + nonceManager: nonceManager, + receiver: receiver, + } + // Set up the initial configurations for the contracts + setupUniverseBasics(t, universe) + + universes[chainID] = universe + } + + // Once we have all chains created and contracts deployed, we can set up the initial configurations and wire chains together + connectUniverses(t, universes) + + // print out all contract addresses for debugging purposes + for chainID, uni := range universes { + t.Logf("Chain ID: %d\n Chain Selector: %d\n LinkToken: %s\n WETH: %s\n Router: %s\n RMNProxy: %s\n RMN: %s\n OnRamp: %s\n OffRamp: %s\n PriceRegistry: %s\n TokenAdminRegistry: %s\n NonceManager: %s\n", + chainID, + getSelector(chainID), + uni.linkToken.Address().Hex(), + uni.weth.Address().Hex(), + uni.router.Address().Hex(), + uni.rmnProxy.Address().Hex(), + uni.rmn.Address().Hex(), + uni.onramp.Address().Hex(), + uni.offramp.Address().Hex(), + uni.priceRegistry.Address().Hex(), + uni.tokenAdminRegistry.Address().Hex(), + uni.nonceManager.Address().Hex(), + ) + } + + // print out topic hashes of relevant events for debugging purposes + t.Logf("Topic hash of CommitReportAccepted: %s", commitReportAcceptedTopic.Hex()) + t.Logf("Topic hash of ExecutionStateChanged: %s", executionStateChangedTopic.Hex()) + t.Logf("Topic hash of CCIPMessageSent: %s", ccipMessageSentTopic.Hex()) + + return homeChainUniverse, universes +} + +// Creates 1 home chain and `numChains`-1 non-home chains +func createChains(t *testing.T, numChains int) map[uint64]chainBase { + chains := make(map[uint64]chainBase) + + homeChainOwner := testutils.MustNewSimTransactor(t) + homeChainBackend := backends.NewSimulatedBackend(core.GenesisAlloc{ + homeChainOwner.From: core.GenesisAccount{ + Balance: assets.Ether(10_000).ToInt(), + }, + }, 30e6) + tweakChainTimestamp(t, homeChainBackend, FirstBlockAge) + + chains[homeChainID] = chainBase{ + owner: homeChainOwner, + backend: homeChainBackend, + } + + for chainID := chainsel.TEST_90000001.EvmChainID; len(chains) < numChains && chainID < chainsel.TEST_90000020.EvmChainID; chainID++ { + owner := testutils.MustNewSimTransactor(t) + backend := backends.NewSimulatedBackend(core.GenesisAlloc{ + owner.From: core.GenesisAccount{ + Balance: assets.Ether(10_000).ToInt(), + }, + }, 30e6) + + tweakChainTimestamp(t, backend, FirstBlockAge) + + chains[chainID] = chainBase{ + owner: owner, + backend: backend, + } + } + + return chains +} + +// CCIP relies on block timestamps, but SimulatedBackend uses by default clock starting from 1970-01-01 +// This trick is used to move the clock closer to the current time. We set first block to be X hours ago. +// Tests create plenty of transactions so this number can't be too low, every new block mined will tick the clock, +// if you mine more than "X hours" transactions, SimulatedBackend will panic because generated timestamps will be in the future. +func tweakChainTimestamp(t *testing.T, backend *backends.SimulatedBackend, tweak time.Duration) { + blockTime := time.Unix(int64(backend.Blockchain().CurrentHeader().Time), 0) + sinceBlockTime := time.Since(blockTime) + diff := sinceBlockTime - tweak + err := backend.AdjustTime(diff) + require.NoError(t, err, "unable to adjust time on simulated chain") + backend.Commit() + backend.Commit() +} + +func setupHomeChain(t *testing.T, owner *bind.TransactOpts, backend *backends.SimulatedBackend) homeChain { + // deploy the capability registry on the home chain + crAddress, _, _, err := kcr.DeployCapabilitiesRegistry(owner, backend) + require.NoError(t, err, "failed to deploy capability registry on home chain") + backend.Commit() + + capabilityRegistry, err := kcr.NewCapabilitiesRegistry(crAddress, backend) + require.NoError(t, err) + + ccAddress, _, _, err := ccip_config.DeployCCIPConfig(owner, backend, crAddress) + require.NoError(t, err) + backend.Commit() + + capabilityConfig, err := ccip_config.NewCCIPConfig(ccAddress, backend) + require.NoError(t, err) + + _, err = capabilityRegistry.AddCapabilities(owner, []kcr.CapabilitiesRegistryCapability{ + { + LabelledName: CapabilityLabelledName, + Version: CapabilityVersion, + CapabilityType: 2, // consensus. not used (?) + ResponseType: 0, // report. not used (?) + ConfigurationContract: ccAddress, + }, + }) + require.NoError(t, err, "failed to add capabilities to the capability registry") + backend.Commit() + + // Add NodeOperator, for simplicity we'll add one NodeOperator only + // First NodeOperator will have NodeOperatorId = 1 + _, err = capabilityRegistry.AddNodeOperators(owner, []kcr.CapabilitiesRegistryNodeOperator{ + { + Admin: owner.From, + Name: "NodeOperator", + }, + }) + require.NoError(t, err, "failed to add node operator to the capability registry") + backend.Commit() + + return homeChain{ + backend: backend, + owner: owner, + chainID: homeChainID, + capabilityRegistry: capabilityRegistry, + ccipConfig: capabilityConfig, + } +} + +func sortP2PIDS(p2pIDs [][32]byte) { + sort.Slice(p2pIDs, func(i, j int) bool { + return bytes.Compare(p2pIDs[i][:], p2pIDs[j][:]) < 0 + }) +} + +func (h *homeChain) AddNodes( + t *testing.T, + p2pIDs [][32]byte, + capabilityIDs [][32]byte, +) { + sortP2PIDS(p2pIDs) + var nodeParams []kcr.CapabilitiesRegistryNodeParams + for _, p2pID := range p2pIDs { + nodeParam := kcr.CapabilitiesRegistryNodeParams{ + NodeOperatorId: NodeOperatorID, + Signer: p2pID, // Not used in tests + P2pId: p2pID, + HashedCapabilityIds: capabilityIDs, + } + nodeParams = append(nodeParams, nodeParam) + } + _, err := h.capabilityRegistry.AddNodes(h.owner, nodeParams) + require.NoError(t, err, "failed to add node operator oracles") + h.backend.Commit() +} + +func AddChainConfig( + t *testing.T, + h homeChain, + chainSelector uint64, + p2pIDs [][32]byte, + f uint8, +) ccip_config.CCIPConfigTypesChainConfigInfo { + sortP2PIDS(p2pIDs) + // First Add ChainConfig that includes all p2pIDs as readers + encodedExtraChainConfig, err := chainconfig.EncodeChainConfig(chainconfig.ChainConfig{ + GasPriceDeviationPPB: ccipocr3.NewBigIntFromInt64(1000), + DAGasPriceDeviationPPB: ccipocr3.NewBigIntFromInt64(0), + OptimisticConfirmations: 1, + }) + require.NoError(t, err) + chainConfig := integrationhelpers.SetupConfigInfo(chainSelector, p2pIDs, f, encodedExtraChainConfig) + inputConfig := []ccip_config.CCIPConfigTypesChainConfigInfo{ + chainConfig, + } + _, err = h.ccipConfig.ApplyChainConfigUpdates(h.owner, nil, inputConfig) + require.NoError(t, err) + h.backend.Commit() + return chainConfig +} + +func (h *homeChain) AddDON( + t *testing.T, + ccipCapabilityID [32]byte, + chainSelector uint64, + uni onchainUniverse, + f uint8, + bootstrapP2PID [32]byte, + p2pIDs [][32]byte, + oracles []confighelper2.OracleIdentityExtra, +) { + // Get OCR3 Config from helper + var schedule []int + for range oracles { + schedule = append(schedule, 1) + } + + tabi, err := ocr3_config_encoder.IOCR3ConfigEncoderMetaData.GetAbi() + require.NoError(t, err) + + // Add DON on capability registry contract + var ocr3Configs []ocr3_config_encoder.CCIPConfigTypesOCR3Config + for _, pluginType := range []cctypes.PluginType{cctypes.PluginTypeCCIPCommit, cctypes.PluginTypeCCIPExec} { + var encodedOffchainConfig []byte + var err2 error + if pluginType == cctypes.PluginTypeCCIPCommit { + encodedOffchainConfig, err2 = pluginconfig.EncodeCommitOffchainConfig(pluginconfig.CommitOffchainConfig{ + RemoteGasPriceBatchWriteFrequency: *commonconfig.MustNewDuration(RemoteGasPriceBatchWriteFrequency), + // TODO: implement token price writes + // TokenPriceBatchWriteFrequency: *commonconfig.MustNewDuration(tokenPriceBatchWriteFrequency), + }) + require.NoError(t, err2) + } else { + encodedOffchainConfig, err2 = pluginconfig.EncodeExecuteOffchainConfig(pluginconfig.ExecuteOffchainConfig{ + BatchGasLimit: BatchGasLimit, + RelativeBoostPerWaitHour: RelativeBoostPerWaitHour, + MessageVisibilityInterval: *commonconfig.MustNewDuration(FirstBlockAge), + InflightCacheExpiry: *commonconfig.MustNewDuration(InflightCacheExpiry), + RootSnoozeTime: *commonconfig.MustNewDuration(RootSnoozeTime), + BatchingStrategyID: BatchingStrategyID, + }) + require.NoError(t, err2) + } + signers, transmitters, configF, _, offchainConfigVersion, offchainConfig, err2 := ocr3confighelper.ContractSetConfigArgsForTests( + DeltaProgress, + DeltaResend, + DeltaInitial, + DeltaRound, + DeltaGrace, + DeltaCertifiedCommitRequest, + DeltaStage, + Rmax, + schedule, + oracles, + encodedOffchainConfig, + MaxDurationQuery, + MaxDurationObservation, + MaxDurationShouldAcceptAttestedReport, + MaxDurationShouldTransmitAcceptedReport, + int(f), + []byte{}, // empty OnChainConfig + ) + require.NoError(t, err2, "failed to create contract config") + + signersBytes := make([][]byte, len(signers)) + for i, signer := range signers { + signersBytes[i] = signer + } + + transmittersBytes := make([][]byte, len(transmitters)) + for i, transmitter := range transmitters { + // anotherErr because linting doesn't want to shadow err + parsed, anotherErr := common.ParseHexOrString(string(transmitter)) + require.NoError(t, anotherErr) + transmittersBytes[i] = parsed + } + + ocr3Configs = append(ocr3Configs, ocr3_config_encoder.CCIPConfigTypesOCR3Config{ + PluginType: uint8(pluginType), + ChainSelector: chainSelector, + F: configF, + OffchainConfigVersion: offchainConfigVersion, + OfframpAddress: uni.offramp.Address().Bytes(), + P2pIds: p2pIDs, + Signers: signersBytes, + Transmitters: transmittersBytes, + OffchainConfig: offchainConfig, + }) + } + + encodedCall, err := tabi.Pack("exposeOCR3Config", ocr3Configs) + require.NoError(t, err) + + // Trim first four bytes to remove function selector. + encodedConfigs := encodedCall[4:] + + // commit so that we have an empty block to filter events from + h.backend.Commit() + + _, err = h.capabilityRegistry.AddDON(h.owner, p2pIDs, []kcr.CapabilitiesRegistryCapabilityConfiguration{ + { + CapabilityId: ccipCapabilityID, + Config: encodedConfigs, + }, + }, false, false, f) + require.NoError(t, err) + h.backend.Commit() + + endBlock := h.backend.Blockchain().CurrentBlock().Number.Uint64() + iter, err := h.capabilityRegistry.FilterConfigSet(&bind.FilterOpts{ + Start: h.backend.Blockchain().CurrentBlock().Number.Uint64() - 1, + End: &endBlock, + }, []uint32{}) + require.NoError(t, err, "failed to filter config set events") + var donID uint32 + for iter.Next() { + donID = iter.Event.DonId + break + } + require.NotZero(t, donID, "failed to get donID from config set event") + + var signerAddresses []common.Address + for _, oracle := range oracles { + signerAddresses = append(signerAddresses, common.BytesToAddress(oracle.OnchainPublicKey)) + } + + var transmitterAddresses []common.Address + for _, oracle := range oracles { + transmitterAddresses = append(transmitterAddresses, common.HexToAddress(string(oracle.TransmitAccount))) + } + + // get the config digest from the ccip config contract and set config on the offramp. + var offrampOCR3Configs []offramp.MultiOCR3BaseOCRConfigArgs + for _, pluginType := range []cctypes.PluginType{cctypes.PluginTypeCCIPCommit, cctypes.PluginTypeCCIPExec} { + ocrConfig, err1 := h.ccipConfig.GetOCRConfig(&bind.CallOpts{ + Context: testutils.Context(t), + }, donID, uint8(pluginType)) + require.NoError(t, err1, "failed to get OCR3 config from ccip config contract") + require.Len(t, ocrConfig, 1, "expected exactly one OCR3 config") + offrampOCR3Configs = append(offrampOCR3Configs, offramp.MultiOCR3BaseOCRConfigArgs{ + ConfigDigest: ocrConfig[0].ConfigDigest, + OcrPluginType: uint8(pluginType), + F: f, + IsSignatureVerificationEnabled: pluginType == cctypes.PluginTypeCCIPCommit, + Signers: signerAddresses, + Transmitters: transmitterAddresses, + }) + } + + uni.backend.Commit() + + _, err = uni.offramp.SetOCR3Configs(uni.owner, offrampOCR3Configs) + require.NoError(t, err, "failed to set ocr3 configs on offramp") + uni.backend.Commit() + + for _, pluginType := range []cctypes.PluginType{cctypes.PluginTypeCCIPCommit, cctypes.PluginTypeCCIPExec} { + ocrConfig, err := uni.offramp.LatestConfigDetails(&bind.CallOpts{ + Context: testutils.Context(t), + }, uint8(pluginType)) + require.NoError(t, err, "failed to get latest commit OCR3 config") + require.Equalf(t, offrampOCR3Configs[pluginType].ConfigDigest, ocrConfig.ConfigInfo.ConfigDigest, "%s OCR3 config digest mismatch", pluginType.String()) + require.Equalf(t, offrampOCR3Configs[pluginType].F, ocrConfig.ConfigInfo.F, "%s OCR3 config F mismatch", pluginType.String()) + require.Equalf(t, offrampOCR3Configs[pluginType].IsSignatureVerificationEnabled, ocrConfig.ConfigInfo.IsSignatureVerificationEnabled, "%s OCR3 config signature verification mismatch", pluginType.String()) + if pluginType == cctypes.PluginTypeCCIPCommit { + // only commit will set signers, exec doesn't need them. + require.Equalf(t, offrampOCR3Configs[pluginType].Signers, ocrConfig.Signers, "%s OCR3 config signers mismatch", pluginType.String()) + } + require.Equalf(t, offrampOCR3Configs[pluginType].Transmitters, ocrConfig.Transmitters, "%s OCR3 config transmitters mismatch", pluginType.String()) + } + + t.Logf("set ocr3 config on the offramp, signers: %+v, transmitters: %+v", signerAddresses, transmitterAddresses) +} + +func connectUniverses( + t *testing.T, + universes map[uint64]onchainUniverse, +) { + for _, uni := range universes { + wireRouter(t, uni, universes) + wirePriceRegistry(t, uni, universes) + wireOnRamp(t, uni, universes) + wireOffRamp(t, uni, universes) + initRemoteChainsGasPrices(t, uni, universes) + } +} + +// setupUniverseBasics sets up the initial configurations for the CCIP contracts on a single chain. +// 1. Mint 1000 LINK to the owner +// 2. Set the price registry with local token prices +// 3. Authorize the onRamp and offRamp on the nonce manager +func setupUniverseBasics(t *testing.T, uni onchainUniverse) { + // ============================================================================= + // Universe specific updates/configs + // These updates are specific to each universe and are set up here + // These updates don't depend on other chains + // ============================================================================= + owner := uni.owner + // ============================================================================= + // Mint 1000 LINK to owner + // ============================================================================= + _, err := uni.linkToken.GrantMintRole(owner, owner.From) + require.NoError(t, err) + _, err = uni.linkToken.Mint(owner, owner.From, e18Mult(1000)) + require.NoError(t, err) + uni.backend.Commit() + + // ============================================================================= + // Price updates for tokens + // These are the prices of the fee tokens of local chain in USD + // ============================================================================= + tokenPriceUpdates := []fee_quoter.InternalTokenPriceUpdate{ + { + SourceToken: uni.linkToken.Address(), + UsdPerToken: e18Mult(20), + }, + { + SourceToken: uni.weth.Address(), + UsdPerToken: e18Mult(4000), + }, + } + _, err = uni.priceRegistry.UpdatePrices(owner, fee_quoter.InternalPriceUpdates{ + TokenPriceUpdates: tokenPriceUpdates, + }) + require.NoErrorf(t, err, "failed to update prices in price registry on chain id %d", uni.chainID) + uni.backend.Commit() + + _, err = uni.priceRegistry.ApplyAuthorizedCallerUpdates(owner, fee_quoter.AuthorizedCallersAuthorizedCallerArgs{ + AddedCallers: []common.Address{ + uni.offramp.Address(), + }, + }) + require.NoError(t, err, "failed to authorize offramp on price registry") + uni.backend.Commit() + + // ============================================================================= + // Authorize OnRamp & OffRamp on NonceManager + // Otherwise the onramp will not be able to call the nonceManager to get next Nonce + // ============================================================================= + authorizedCallersAuthorizedCallerArgs := nonce_manager.AuthorizedCallersAuthorizedCallerArgs{ + AddedCallers: []common.Address{ + uni.onramp.Address(), + uni.offramp.Address(), + }, + } + _, err = uni.nonceManager.ApplyAuthorizedCallerUpdates(owner, authorizedCallersAuthorizedCallerArgs) + require.NoError(t, err) + uni.backend.Commit() +} + +// As we can't change router contract. The contract was expecting onRamp and offRamp per lane and not per chain +// In the new architecture we have only one onRamp and one offRamp per chain. +// hence we add the mapping for all remote chains to the onRamp/offRamp contract of the local chain +func wireRouter(t *testing.T, uni onchainUniverse, universes map[uint64]onchainUniverse) { + owner := uni.owner + var ( + routerOnrampUpdates []router.RouterOnRamp + routerOfframpUpdates []router.RouterOffRamp + ) + for remoteChainID := range universes { + if remoteChainID == uni.chainID { + continue + } + routerOnrampUpdates = append(routerOnrampUpdates, router.RouterOnRamp{ + DestChainSelector: getSelector(remoteChainID), + OnRamp: uni.onramp.Address(), + }) + routerOfframpUpdates = append(routerOfframpUpdates, router.RouterOffRamp{ + SourceChainSelector: getSelector(remoteChainID), + OffRamp: uni.offramp.Address(), + }) + } + _, err := uni.router.ApplyRampUpdates(owner, routerOnrampUpdates, []router.RouterOffRamp{}, routerOfframpUpdates) + require.NoErrorf(t, err, "failed to apply ramp updates on router on chain id %d", uni.chainID) + uni.backend.Commit() +} + +// Setting OnRampDestChainConfigs +func wirePriceRegistry(t *testing.T, uni onchainUniverse, universes map[uint64]onchainUniverse) { + owner := uni.owner + var priceRegistryDestChainConfigArgs []fee_quoter.FeeQuoterDestChainConfigArgs + for remoteChainID := range universes { + if remoteChainID == uni.chainID { + continue + } + priceRegistryDestChainConfigArgs = append(priceRegistryDestChainConfigArgs, fee_quoter.FeeQuoterDestChainConfigArgs{ + DestChainSelector: getSelector(remoteChainID), + DestChainConfig: defaultPriceRegistryDestChainConfig(t), + }) + } + _, err := uni.priceRegistry.ApplyDestChainConfigUpdates(owner, priceRegistryDestChainConfigArgs) + require.NoErrorf(t, err, "failed to apply dest chain config updates on price registry on chain id %d", uni.chainID) + uni.backend.Commit() +} + +// Setting OnRampDestChainConfigs +func wireOnRamp(t *testing.T, uni onchainUniverse, universes map[uint64]onchainUniverse) { + owner := uni.owner + var onrampSourceChainConfigArgs []onramp.OnRampDestChainConfigArgs + for remoteChainID := range universes { + if remoteChainID == uni.chainID { + continue + } + onrampSourceChainConfigArgs = append(onrampSourceChainConfigArgs, onramp.OnRampDestChainConfigArgs{ + DestChainSelector: getSelector(remoteChainID), + Router: uni.router.Address(), + }) + } + _, err := uni.onramp.ApplyDestChainConfigUpdates(owner, onrampSourceChainConfigArgs) + require.NoErrorf(t, err, "failed to apply dest chain config updates on onramp with chain id %d", uni.chainID) + uni.backend.Commit() +} + +// Setting OffRampSourceChainConfigs +func wireOffRamp(t *testing.T, uni onchainUniverse, universes map[uint64]onchainUniverse) { + owner := uni.owner + var offrampSourceChainConfigArgs []offramp.OffRampSourceChainConfigArgs + for remoteChainID, remoteUniverse := range universes { + if remoteChainID == uni.chainID { + continue + } + offrampSourceChainConfigArgs = append(offrampSourceChainConfigArgs, offramp.OffRampSourceChainConfigArgs{ + SourceChainSelector: getSelector(remoteChainID), + IsEnabled: true, + Router: uni.router.Address(), + OnRamp: remoteUniverse.onramp.Address().Bytes(), + }) + } + _, err := uni.offramp.ApplySourceChainConfigUpdates(owner, offrampSourceChainConfigArgs) + require.NoErrorf(t, err, "failed to apply source chain config updates on offramp on chain id %d", uni.chainID) + uni.backend.Commit() + for remoteChainID, remoteUniverse := range universes { + if remoteChainID == uni.chainID { + continue + } + sourceCfg, err2 := uni.offramp.GetSourceChainConfig(&bind.CallOpts{}, getSelector(remoteChainID)) + require.NoError(t, err2) + require.True(t, sourceCfg.IsEnabled, "source chain config should be enabled") + require.Equal(t, remoteUniverse.onramp.Address(), common.BytesToAddress(sourceCfg.OnRamp), "source chain config onRamp address mismatch") + } +} + +func getSelector(chainID uint64) uint64 { + selector, err := chainsel.SelectorFromChainId(chainID) + if err != nil { + panic(err) + } + return selector +} + +// initRemoteChainsGasPrices sets the gas prices for all chains except the local chain in the local price registry +func initRemoteChainsGasPrices(t *testing.T, uni onchainUniverse, universes map[uint64]onchainUniverse) { + var gasPriceUpdates []fee_quoter.InternalGasPriceUpdate + for remoteChainID := range universes { + if remoteChainID == uni.chainID { + continue + } + gasPriceUpdates = append(gasPriceUpdates, + fee_quoter.InternalGasPriceUpdate{ + DestChainSelector: getSelector(remoteChainID), + UsdPerUnitGas: big.NewInt(2e12), + }, + ) + } + _, err := uni.priceRegistry.UpdatePrices(uni.owner, fee_quoter.InternalPriceUpdates{ + GasPriceUpdates: gasPriceUpdates, + }) + require.NoError(t, err) +} + +func defaultPriceRegistryDestChainConfig(t *testing.T) fee_quoter.FeeQuoterDestChainConfig { + // https://github.com/smartcontractkit/ccip/blob/c4856b64bd766f1ddbaf5d13b42d3c4b12efde3a/contracts/src/v0.8/ccip/libraries/Internal.sol#L337-L337 + /* + ```Solidity + // bytes4(keccak256("CCIP ChainFamilySelector EVM")) + bytes4 public constant CHAIN_FAMILY_SELECTOR_EVM = 0x2812d52c; + ``` + */ + evmFamilySelector, err := hex.DecodeString("2812d52c") + require.NoError(t, err) + return fee_quoter.FeeQuoterDestChainConfig{ + IsEnabled: true, + MaxNumberOfTokensPerMsg: 10, + MaxDataBytes: 256, + MaxPerMsgGasLimit: 3_000_000, + DestGasOverhead: 50_000, + DefaultTokenFeeUSDCents: 1, + DestGasPerPayloadByte: 10, + DestDataAvailabilityOverheadGas: 0, + DestGasPerDataAvailabilityByte: 100, + DestDataAvailabilityMultiplierBps: 1, + DefaultTokenDestGasOverhead: 125_000, + DefaultTxGasLimit: 200_000, + GasMultiplierWeiPerEth: 1, + NetworkFeeUSDCents: 1, + ChainFamilySelector: [4]byte(evmFamilySelector), + } +} + +func deployLinkToken(t *testing.T, owner *bind.TransactOpts, backend *backends.SimulatedBackend, chainID uint64) *link_token.LinkToken { + linkAddr, _, _, err := link_token.DeployLinkToken(owner, backend) + require.NoErrorf(t, err, "failed to deploy link token on chain id %d", chainID) + backend.Commit() + linkToken, err := link_token.NewLinkToken(linkAddr, backend) + require.NoError(t, err) + return linkToken +} + +func deployMockRMNContract(t *testing.T, owner *bind.TransactOpts, backend *backends.SimulatedBackend, chainID uint64) *mock_rmn_contract.MockRMNContract { + rmnAddr, _, _, err := mock_rmn_contract.DeployMockRMNContract(owner, backend) + require.NoErrorf(t, err, "failed to deploy mock arm on chain id %d", chainID) + backend.Commit() + rmn, err := mock_rmn_contract.NewMockRMNContract(rmnAddr, backend) + require.NoError(t, err) + return rmn +} + +func deployRMNProxyContract(t *testing.T, owner *bind.TransactOpts, backend *backends.SimulatedBackend, rmnAddr common.Address, chainID uint64) *rmn_proxy_contract.RMNProxyContract { + rmnProxyAddr, _, _, err := rmn_proxy_contract.DeployRMNProxyContract(owner, backend, rmnAddr) + require.NoErrorf(t, err, "failed to deploy arm proxy on chain id %d", chainID) + backend.Commit() + rmnProxy, err := rmn_proxy_contract.NewRMNProxyContract(rmnProxyAddr, backend) + require.NoError(t, err) + return rmnProxy +} + +func deployWETHContract(t *testing.T, owner *bind.TransactOpts, backend *backends.SimulatedBackend, chainID uint64) *weth9.WETH9 { + wethAddr, _, _, err := weth9.DeployWETH9(owner, backend) + require.NoErrorf(t, err, "failed to deploy weth contract on chain id %d", chainID) + backend.Commit() + weth, err := weth9.NewWETH9(wethAddr, backend) + require.NoError(t, err) + return weth +} + +func deployRouter(t *testing.T, owner *bind.TransactOpts, backend *backends.SimulatedBackend, wethAddr, rmnProxyAddr common.Address, chainID uint64) *router.Router { + routerAddr, _, _, err := router.DeployRouter(owner, backend, wethAddr, rmnProxyAddr) + require.NoErrorf(t, err, "failed to deploy router on chain id %d", chainID) + backend.Commit() + rout, err := router.NewRouter(routerAddr, backend) + require.NoError(t, err) + return rout +} + +func deployPriceRegistry( + t *testing.T, + owner *bind.TransactOpts, + backend *backends.SimulatedBackend, + linkAddr, + wethAddr common.Address, + maxFeeJuelsPerMsg *big.Int, + chainID uint64, +) *fee_quoter.FeeQuoter { + priceRegistryAddr, _, _, err := fee_quoter.DeployFeeQuoter( + owner, + backend, + fee_quoter.FeeQuoterStaticConfig{ + MaxFeeJuelsPerMsg: maxFeeJuelsPerMsg, + LinkToken: linkAddr, + StalenessThreshold: 24 * 60 * 60, // 24 hours + }, + []common.Address{ + owner.From, // owner can update prices in this test + }, // price updaters, will be set to offramp later + []common.Address{linkAddr, wethAddr}, // fee tokens + // empty for now, need to fill in when testing token transfers + []fee_quoter.FeeQuoterTokenPriceFeedUpdate{}, + // empty for now, need to fill in when testing token transfers + []fee_quoter.FeeQuoterTokenTransferFeeConfigArgs{}, + []fee_quoter.FeeQuoterPremiumMultiplierWeiPerEthArgs{ + { + PremiumMultiplierWeiPerEth: 9e17, // 0.9 ETH + Token: linkAddr, + }, + { + PremiumMultiplierWeiPerEth: 1e18, + Token: wethAddr, + }, + }, + // Destination chain configs will be set up later once we have all chains + []fee_quoter.FeeQuoterDestChainConfigArgs{}, + ) + require.NoErrorf(t, err, "failed to deploy price registry on chain id %d", chainID) + backend.Commit() + priceRegistry, err := fee_quoter.NewFeeQuoter(priceRegistryAddr, backend) + require.NoError(t, err) + return priceRegistry +} + +func deployTokenAdminRegistry(t *testing.T, owner *bind.TransactOpts, backend *backends.SimulatedBackend, chainID uint64) *token_admin_registry.TokenAdminRegistry { + tarAddr, _, _, err := token_admin_registry.DeployTokenAdminRegistry(owner, backend) + require.NoErrorf(t, err, "failed to deploy token admin registry on chain id %d", chainID) + backend.Commit() + tokenAdminRegistry, err := token_admin_registry.NewTokenAdminRegistry(tarAddr, backend) + require.NoError(t, err) + return tokenAdminRegistry +} + +func deployNonceManager(t *testing.T, owner *bind.TransactOpts, backend *backends.SimulatedBackend, chainID uint64) *nonce_manager.NonceManager { + nonceManagerAddr, _, _, err := nonce_manager.DeployNonceManager(owner, backend, []common.Address{owner.From}) + require.NoErrorf(t, err, "failed to deploy nonce_manager on chain id %d", chainID) + backend.Commit() + nonceManager, err := nonce_manager.NewNonceManager(nonceManagerAddr, backend) + require.NoError(t, err) + return nonceManager +} diff --git a/core/capabilities/ccip/ccip_integration_tests/home_chain_test.go b/core/capabilities/ccip/ccip_integration_tests/home_chain_test.go new file mode 100644 index 00000000000..f0921cc8f49 --- /dev/null +++ b/core/capabilities/ccip/ccip_integration_tests/home_chain_test.go @@ -0,0 +1,112 @@ +package ccip_integration_tests + +import ( + "math/big" + "testing" + "time" + + "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/ccip_integration_tests/integrationhelpers" + + mapset "github.com/deckarep/golang-set/v2" + "github.com/onsi/gomega" + + libocrtypes "github.com/smartcontractkit/libocr/ragep2p/types" + + "github.com/smartcontractkit/chainlink-ccip/chainconfig" + ccipreader "github.com/smartcontractkit/chainlink-ccip/pkg/reader" + + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccipocr3" + + "github.com/stretchr/testify/require" + + capcfg "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/ccip_config" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" + "github.com/smartcontractkit/chainlink/v2/core/logger" +) + +func TestHomeChainReader(t *testing.T) { + ctx := testutils.Context(t) + lggr := logger.TestLogger(t) + uni := integrationhelpers.NewTestUniverse(ctx, t, lggr) + // We need 3*f + 1 p2pIDs to have enough nodes to bootstrap + var arr []int64 + n := int(integrationhelpers.FChainA*3 + 1) + for i := 0; i <= n; i++ { + arr = append(arr, int64(i)) + } + p2pIDs := integrationhelpers.P2pIDsFromInts(arr) + uni.AddCapability(p2pIDs) + + //==============================Apply configs to Capability Contract================================= + encodedChainConfig, err := chainconfig.EncodeChainConfig(chainconfig.ChainConfig{ + GasPriceDeviationPPB: cciptypes.NewBigIntFromInt64(1000), + DAGasPriceDeviationPPB: cciptypes.NewBigIntFromInt64(1_000_000), + OptimisticConfirmations: 1, + }) + require.NoError(t, err) + inputConfig := []capcfg.CCIPConfigTypesChainConfigInfo{ + integrationhelpers.SetupConfigInfo(integrationhelpers.ChainA, p2pIDs, integrationhelpers.FChainA, encodedChainConfig), + integrationhelpers.SetupConfigInfo(integrationhelpers.ChainB, p2pIDs[1:], integrationhelpers.FChainB, encodedChainConfig), + integrationhelpers.SetupConfigInfo(integrationhelpers.ChainC, p2pIDs[2:], integrationhelpers.FChainC, encodedChainConfig), + } + _, err = uni.CcipCfg.ApplyChainConfigUpdates(uni.Transactor, nil, inputConfig) + require.NoError(t, err) + uni.Backend.Commit() + chainConfigInfos, err := uni.CcipCfg.GetAllChainConfigs(nil, big.NewInt(0), big.NewInt(100)) + require.NoError(t, err) + require.Len(t, chainConfigInfos, len(inputConfig)) + + // Wait for the home chain reader to read the expected amount of chain configs. + gomega.NewWithT(t).Eventually(func() bool { + configs, _ := uni.HomeChainReader.GetAllChainConfigs() + return len(configs) == len(inputConfig) + }, testutils.WaitTimeout(t), 1*time.Second).Should(gomega.BeTrue()) + + t.Logf("homchain reader is ready") + + //================================Test HomeChain Reader=============================== + expectedChainConfigs := map[cciptypes.ChainSelector]ccipreader.ChainConfig{} + for _, c := range inputConfig { + expectedChainConfigs[cciptypes.ChainSelector(c.ChainSelector)] = ccipreader.ChainConfig{ + FChain: int(c.ChainConfig.FChain), + SupportedNodes: toPeerIDs(c.ChainConfig.Readers), + Config: mustDecodeChainConfig(t, c.ChainConfig.Config), + } + } + + configs, err := uni.HomeChainReader.GetAllChainConfigs() + require.NoError(t, err) + + require.Equal(t, expectedChainConfigs, configs) + + // Remove chain C from the chain configs and expect the home chain reader to + // update its state accordingly. + _, err = uni.CcipCfg.ApplyChainConfigUpdates(uni.Transactor, []uint64{integrationhelpers.ChainC}, nil) + require.NoError(t, err) + uni.Backend.Commit() + + // Wait for the home chain reader to read the expected amount of chain configs. + gomega.NewWithT(t).Eventually(func() bool { + chainConfigs, _ := uni.HomeChainReader.GetAllChainConfigs() + return len(chainConfigs) == len(inputConfig)-1 + }, testutils.WaitTimeout(t), 1*time.Second).Should(gomega.BeTrue()) + configs, err = uni.HomeChainReader.GetAllChainConfigs() + require.NoError(t, err) + + delete(expectedChainConfigs, cciptypes.ChainSelector(integrationhelpers.ChainC)) + require.Equal(t, expectedChainConfigs, configs) +} + +func toPeerIDs(readers [][32]byte) mapset.Set[libocrtypes.PeerID] { + peerIDs := mapset.NewSet[libocrtypes.PeerID]() + for _, r := range readers { + peerIDs.Add(r) + } + return peerIDs +} + +func mustDecodeChainConfig(t *testing.T, encodedChainConfig []byte) chainconfig.ChainConfig { + chainConfig, err := chainconfig.DecodeChainConfig(encodedChainConfig) + require.NoError(t, err) + return chainConfig +} diff --git a/core/capabilities/ccip/ccip_integration_tests/integrationhelpers/integration_helpers.go b/core/capabilities/ccip/ccip_integration_tests/integrationhelpers/integration_helpers.go new file mode 100644 index 00000000000..e6eb3aa6e09 --- /dev/null +++ b/core/capabilities/ccip/ccip_integration_tests/integrationhelpers/integration_helpers.go @@ -0,0 +1,306 @@ +package integrationhelpers + +import ( + "context" + "encoding/json" + "fmt" + "math/big" + "sort" + "testing" + "time" + + configsevm "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/configs/evm" + cctypes "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/types" + + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/accounts/abi/bind/backends" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core" + + "github.com/smartcontractkit/chainlink-ccip/pkg/consts" + ccipreader "github.com/smartcontractkit/chainlink-ccip/pkg/reader" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/headtracker" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/ccip_config" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/ocr3_config_encoder" + kcr "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/capabilities_registry" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" + "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" + + "github.com/smartcontractkit/chainlink-common/pkg/types" + + "github.com/stretchr/testify/require" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/pgtest" + "github.com/smartcontractkit/chainlink/v2/core/logger" + "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm" + evmrelaytypes "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/types" +) + +const chainID = 1337 + +var CapabilityID = fmt.Sprintf("%s@%s", CcipCapabilityLabelledName, CcipCapabilityVersion) + +func NewReader( + t *testing.T, + logPoller logpoller.LogPoller, + headTracker logpoller.HeadTracker, + client client.Client, + address common.Address, + chainReaderConfig evmrelaytypes.ChainReaderConfig, +) types.ContractReader { + cr, err := evm.NewChainReaderService(testutils.Context(t), logger.TestLogger(t), logPoller, headTracker, client, chainReaderConfig) + require.NoError(t, err) + err = cr.Bind(testutils.Context(t), []types.BoundContract{ + { + Address: address.String(), + Name: consts.ContractNameCCIPConfig, + }, + }) + require.NoError(t, err) + require.NoError(t, cr.Start(testutils.Context(t))) + for { + if err := cr.Ready(); err == nil { + break + } + } + + return cr +} + +const ( + ChainA uint64 = 1 + FChainA uint8 = 1 + + ChainB uint64 = 2 + FChainB uint8 = 2 + + ChainC uint64 = 3 + FChainC uint8 = 3 + + CcipCapabilityLabelledName = "ccip" + CcipCapabilityVersion = "v1.0" +) + +type TestUniverse struct { + Transactor *bind.TransactOpts + Backend *backends.SimulatedBackend + CapReg *kcr.CapabilitiesRegistry + CcipCfg *ccip_config.CCIPConfig + TestingT *testing.T + LogPoller logpoller.LogPoller + HeadTracker logpoller.HeadTracker + SimClient client.Client + HomeChainReader ccipreader.HomeChain +} + +func NewTestUniverse(ctx context.Context, t *testing.T, lggr logger.Logger) TestUniverse { + transactor := testutils.MustNewSimTransactor(t) + backend := backends.NewSimulatedBackend(core.GenesisAlloc{ + transactor.From: {Balance: assets.Ether(1000).ToInt()}, + }, 30e6) + + crAddress, _, _, err := kcr.DeployCapabilitiesRegistry(transactor, backend) + require.NoError(t, err) + backend.Commit() + + capReg, err := kcr.NewCapabilitiesRegistry(crAddress, backend) + require.NoError(t, err) + + ccAddress, _, _, err := ccip_config.DeployCCIPConfig(transactor, backend, crAddress) + require.NoError(t, err) + backend.Commit() + + cc, err := ccip_config.NewCCIPConfig(ccAddress, backend) + require.NoError(t, err) + + db := pgtest.NewSqlxDB(t) + lpOpts := logpoller.Opts{ + PollPeriod: time.Millisecond, + FinalityDepth: 0, + BackfillBatchSize: 10, + RpcBatchSize: 10, + KeepFinalizedBlocksDepth: 100000, + } + cl := client.NewSimulatedBackendClient(t, backend, big.NewInt(chainID)) + headTracker := headtracker.NewSimulatedHeadTracker(cl, lpOpts.UseFinalityTag, lpOpts.FinalityDepth) + if lpOpts.PollPeriod == 0 { + lpOpts.PollPeriod = 1 * time.Hour + } + lp := logpoller.NewLogPoller(logpoller.NewORM(big.NewInt(chainID), db, lggr), cl, logger.NullLogger, headTracker, lpOpts) + require.NoError(t, lp.Start(ctx)) + t.Cleanup(func() { require.NoError(t, lp.Close()) }) + + hcr := NewHomeChainReader(t, lp, headTracker, cl, ccAddress) + return TestUniverse{ + Transactor: transactor, + Backend: backend, + CapReg: capReg, + CcipCfg: cc, + TestingT: t, + SimClient: cl, + LogPoller: lp, + HeadTracker: headTracker, + HomeChainReader: hcr, + } +} + +func (t TestUniverse) NewContractReader(ctx context.Context, cfg []byte) (types.ContractReader, error) { + var config evmrelaytypes.ChainReaderConfig + err := json.Unmarshal(cfg, &config) + require.NoError(t.TestingT, err) + return evm.NewChainReaderService(ctx, logger.TestLogger(t.TestingT), t.LogPoller, t.HeadTracker, t.SimClient, config) +} + +func P2pIDsFromInts(ints []int64) [][32]byte { + var p2pIDs [][32]byte + for _, i := range ints { + p2pID := p2pkey.MustNewV2XXXTestingOnly(big.NewInt(i)).PeerID() + p2pIDs = append(p2pIDs, p2pID) + } + sort.Slice(p2pIDs, func(i, j int) bool { + for k := 0; k < 32; k++ { + if p2pIDs[i][k] < p2pIDs[j][k] { + return true + } else if p2pIDs[i][k] > p2pIDs[j][k] { + return false + } + } + return false + }) + return p2pIDs +} + +func (t *TestUniverse) AddCapability(p2pIDs [][32]byte) { + _, err := t.CapReg.AddCapabilities(t.Transactor, []kcr.CapabilitiesRegistryCapability{ + { + LabelledName: CcipCapabilityLabelledName, + Version: CcipCapabilityVersion, + CapabilityType: 0, + ResponseType: 0, + ConfigurationContract: t.CcipCfg.Address(), + }, + }) + require.NoError(t.TestingT, err, "failed to add capability to registry") + t.Backend.Commit() + + ccipCapabilityID, err := t.CapReg.GetHashedCapabilityId(nil, CcipCapabilityLabelledName, CcipCapabilityVersion) + require.NoError(t.TestingT, err) + + for i := 0; i < len(p2pIDs); i++ { + _, err = t.CapReg.AddNodeOperators(t.Transactor, []kcr.CapabilitiesRegistryNodeOperator{ + { + Admin: t.Transactor.From, + Name: fmt.Sprintf("nop-%d", i), + }, + }) + require.NoError(t.TestingT, err) + t.Backend.Commit() + + // get the node operator id from the event + it, err := t.CapReg.FilterNodeOperatorAdded(nil, nil, nil) + require.NoError(t.TestingT, err) + var nodeOperatorID uint32 + for it.Next() { + if it.Event.Name == fmt.Sprintf("nop-%d", i) { + nodeOperatorID = it.Event.NodeOperatorId + break + } + } + require.NotZero(t.TestingT, nodeOperatorID) + + _, err = t.CapReg.AddNodes(t.Transactor, []kcr.CapabilitiesRegistryNodeParams{ + { + NodeOperatorId: nodeOperatorID, + Signer: testutils.Random32Byte(), + P2pId: p2pIDs[i], + HashedCapabilityIds: [][32]byte{ccipCapabilityID}, + }, + }) + require.NoError(t.TestingT, err) + t.Backend.Commit() + + // verify that the node was added successfully + nodeInfo, err := t.CapReg.GetNode(nil, p2pIDs[i]) + require.NoError(t.TestingT, err) + + require.Equal(t.TestingT, nodeOperatorID, nodeInfo.NodeOperatorId) + require.Equal(t.TestingT, p2pIDs[i][:], nodeInfo.P2pId[:]) + } +} + +func NewHomeChainReader(t *testing.T, logPoller logpoller.LogPoller, headTracker logpoller.HeadTracker, client client.Client, ccAddress common.Address) ccipreader.HomeChain { + cr := NewReader(t, logPoller, headTracker, client, ccAddress, configsevm.HomeChainReaderConfigRaw) + + hcr := ccipreader.NewHomeChainReader(cr, logger.TestLogger(t), 500*time.Millisecond, types.BoundContract{ + Address: ccAddress.String(), + Name: consts.ContractNameCCIPConfig, + }) + require.NoError(t, hcr.Start(testutils.Context(t))) + t.Cleanup(func() { require.NoError(t, hcr.Close()) }) + + return hcr +} + +func (t *TestUniverse) AddDONToRegistry( + ccipCapabilityID [32]byte, + chainSelector uint64, + f uint8, + bootstrapP2PID [32]byte, + p2pIDs [][32]byte, +) { + tabi, err := ocr3_config_encoder.IOCR3ConfigEncoderMetaData.GetAbi() + require.NoError(t.TestingT, err) + + var ( + signers [][]byte + transmitters [][]byte + ) + for range p2pIDs { + signers = append(signers, testutils.NewAddress().Bytes()) + transmitters = append(transmitters, testutils.NewAddress().Bytes()) + } + + var ocr3Configs []ocr3_config_encoder.CCIPConfigTypesOCR3Config + for _, pluginType := range []cctypes.PluginType{cctypes.PluginTypeCCIPCommit, cctypes.PluginTypeCCIPExec} { + ocr3Configs = append(ocr3Configs, ocr3_config_encoder.CCIPConfigTypesOCR3Config{ + PluginType: uint8(pluginType), + ChainSelector: chainSelector, + F: f, + OffchainConfigVersion: 30, + OfframpAddress: testutils.NewAddress().Bytes(), + P2pIds: p2pIDs, + Signers: signers, + Transmitters: transmitters, + OffchainConfig: []byte("offchain config"), + }) + } + + encodedCall, err := tabi.Pack("exposeOCR3Config", ocr3Configs) + require.NoError(t.TestingT, err) + + // Trim first four bytes to remove function selector. + encodedConfigs := encodedCall[4:] + + _, err = t.CapReg.AddDON(t.Transactor, p2pIDs, []kcr.CapabilitiesRegistryCapabilityConfiguration{ + { + CapabilityId: ccipCapabilityID, + Config: encodedConfigs, + }, + }, false, false, f) + require.NoError(t.TestingT, err) + t.Backend.Commit() +} + +func SetupConfigInfo(chainSelector uint64, readers [][32]byte, fChain uint8, cfg []byte) ccip_config.CCIPConfigTypesChainConfigInfo { + return ccip_config.CCIPConfigTypesChainConfigInfo{ + ChainSelector: chainSelector, + ChainConfig: ccip_config.CCIPConfigTypesChainConfig{ + Readers: readers, + FChain: fChain, + Config: cfg, + }, + } +} diff --git a/core/capabilities/ccip/ccip_integration_tests/ocr_node_helper.go b/core/capabilities/ccip/ccip_integration_tests/ocr_node_helper.go new file mode 100644 index 00000000000..aff02cd55d8 --- /dev/null +++ b/core/capabilities/ccip/ccip_integration_tests/ocr_node_helper.go @@ -0,0 +1,318 @@ +package ccip_integration_tests + +import ( + "context" + "fmt" + "math/big" + "net/http" + "strconv" + "sync" + "testing" + "time" + + coretypes "github.com/smartcontractkit/chainlink-common/pkg/types/core/mocks" + + "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/validate" + + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/accounts/abi/bind/backends" + "github.com/ethereum/go-ethereum/common" + gethtypes "github.com/ethereum/go-ethereum/core/types" + "github.com/jmoiron/sqlx" + + "github.com/smartcontractkit/chainlink/v2/core/services/job" + "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" + + "github.com/smartcontractkit/chainlink-common/pkg/config" + "github.com/smartcontractkit/chainlink-common/pkg/loop" + "github.com/smartcontractkit/chainlink-common/pkg/utils/mailbox" + + "github.com/smartcontractkit/chainlink/v2/core/services/relay" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" + v2toml "github.com/smartcontractkit/chainlink/v2/core/chains/evm/config/toml" + evmutils "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils/big" + "github.com/smartcontractkit/chainlink/v2/core/chains/legacyevm" + configv2 "github.com/smartcontractkit/chainlink/v2/core/config/toml" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" + "github.com/smartcontractkit/chainlink/v2/core/logger" + "github.com/smartcontractkit/chainlink/v2/core/logger/audit" + "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" + "github.com/smartcontractkit/chainlink/v2/core/services/keystore" + "github.com/smartcontractkit/chainlink/v2/core/services/keystore/chaintype" + "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ocr2key" + "github.com/smartcontractkit/chainlink/v2/core/utils" + "github.com/smartcontractkit/chainlink/v2/core/utils/testutils/heavyweight" + "github.com/smartcontractkit/chainlink/v2/plugins" + + "github.com/stretchr/testify/require" + "go.uber.org/zap/zapcore" +) + +type ocr3Node struct { + app chainlink.Application + peerID string + transmitters map[uint64]common.Address + keybundle ocr2key.KeyBundle + db *sqlx.DB +} + +// setupNodeOCR3 creates a chainlink node and any associated keys in order to run +// ccip. +func setupNodeOCR3( + t *testing.T, + port int, + universes map[uint64]onchainUniverse, + homeChainUniverse homeChain, + logLevel zapcore.Level, +) *ocr3Node { + // Do not want to load fixtures as they contain a dummy chainID. + cfg, db := heavyweight.FullTestDBNoFixturesV2(t, func(c *chainlink.Config, s *chainlink.Secrets) { + c.Insecure.OCRDevelopmentMode = ptr(true) // Disables ocr spec validation so we can have fast polling for the test. + + c.Feature.LogPoller = ptr(true) + + // P2P V2 configs. + c.P2P.V2.Enabled = ptr(true) + c.P2P.V2.DeltaDial = config.MustNewDuration(500 * time.Millisecond) + c.P2P.V2.DeltaReconcile = config.MustNewDuration(5 * time.Second) + c.P2P.V2.ListenAddresses = &[]string{fmt.Sprintf("127.0.0.1:%d", port)} + + // Enable Capabilities, This is a pre-requisite for registrySyncer to work. + c.Capabilities.ExternalRegistry.NetworkID = ptr(relay.NetworkEVM) + c.Capabilities.ExternalRegistry.ChainID = ptr(strconv.FormatUint(homeChainUniverse.chainID, 10)) + c.Capabilities.ExternalRegistry.Address = ptr(homeChainUniverse.capabilityRegistry.Address().String()) + + // OCR configs + c.OCR.Enabled = ptr(false) + c.OCR.DefaultTransactionQueueDepth = ptr(uint32(200)) + c.OCR2.Enabled = ptr(true) + c.OCR2.ContractPollInterval = config.MustNewDuration(5 * time.Second) + + c.Log.Level = ptr(configv2.LogLevel(logLevel)) + + var chains v2toml.EVMConfigs + for chainID := range universes { + chains = append(chains, createConfigV2Chain(uBigInt(chainID))) + } + c.EVM = chains + }) + + lggr := logger.TestLogger(t) + lggr.SetLogLevel(logLevel) + ctx := testutils.Context(t) + clients := make(map[uint64]client.Client) + + for chainID, uni := range universes { + clients[chainID] = client.NewSimulatedBackendClient(t, uni.backend, uBigInt(chainID)) + } + + master := keystore.New(db, utils.FastScryptParams, lggr) + + kStore := KeystoreSim{ + eks: &EthKeystoreSim{ + Eth: master.Eth(), + t: t, + }, + csa: master.CSA(), + } + mailMon := mailbox.NewMonitor("ccip", lggr.Named("mailbox")) + evmOpts := chainlink.EVMFactoryConfig{ + ChainOpts: legacyevm.ChainOpts{ + AppConfig: cfg, + GenEthClient: func(i *big.Int) client.Client { + client, ok := clients[i.Uint64()] + if !ok { + t.Fatal("no backend for chainID", i) + } + return client + }, + MailMon: mailMon, + DS: db, + }, + CSAETHKeystore: kStore, + } + relayerFactory := chainlink.RelayerFactory{ + Logger: lggr, + LoopRegistry: plugins.NewLoopRegistry(lggr.Named("LoopRegistry"), cfg.Tracing(), cfg.Telemetry()), + GRPCOpts: loop.GRPCOpts{}, + CapabilitiesRegistry: coretypes.NewCapabilitiesRegistry(t), + } + initOps := []chainlink.CoreRelayerChainInitFunc{chainlink.InitEVM(testutils.Context(t), relayerFactory, evmOpts)} + rci, err := chainlink.NewCoreRelayerChainInteroperators(initOps...) + require.NoError(t, err) + + app, err := chainlink.NewApplication(chainlink.ApplicationOpts{ + Config: cfg, + DS: db, + KeyStore: master, + RelayerChainInteroperators: rci, + Logger: lggr, + ExternalInitiatorManager: nil, + CloseLogger: lggr.Sync, + UnrestrictedHTTPClient: &http.Client{}, + RestrictedHTTPClient: &http.Client{}, + AuditLogger: audit.NoopLogger, + MailMon: mailMon, + LoopRegistry: plugins.NewLoopRegistry(lggr, cfg.Tracing(), cfg.Telemetry()), + }) + require.NoError(t, err) + require.NoError(t, app.GetKeyStore().Unlock(ctx, "password")) + _, err = app.GetKeyStore().P2P().Create(ctx) + require.NoError(t, err) + + p2pIDs, err := app.GetKeyStore().P2P().GetAll() + require.NoError(t, err) + require.Len(t, p2pIDs, 1) + peerID := p2pIDs[0].PeerID() + // create a transmitter for each chain + transmitters := make(map[uint64]common.Address) + for chainID, uni := range universes { + backend := uni.backend + owner := uni.owner + cID := uBigInt(chainID) + addrs, err2 := app.GetKeyStore().Eth().EnabledAddressesForChain(testutils.Context(t), cID) + require.NoError(t, err2) + if len(addrs) == 1 { + // just fund the address + fundAddress(t, owner, addrs[0], assets.Ether(10).ToInt(), backend) + transmitters[chainID] = addrs[0] + } else { + // create key and fund it + _, err3 := app.GetKeyStore().Eth().Create(testutils.Context(t), cID) + require.NoError(t, err3, "failed to create key for chain", chainID) + sendingKeys, err3 := app.GetKeyStore().Eth().EnabledAddressesForChain(testutils.Context(t), cID) + require.NoError(t, err3) + require.Len(t, sendingKeys, 1) + fundAddress(t, owner, sendingKeys[0], assets.Ether(10).ToInt(), backend) + transmitters[chainID] = sendingKeys[0] + } + } + require.Len(t, transmitters, len(universes)) + + keybundle, err := app.GetKeyStore().OCR2().Create(ctx, chaintype.EVM) + require.NoError(t, err) + + t.Cleanup(func() { + require.NoError(t, db.Close()) + }) + + return &ocr3Node{ + // can't use this app because it doesn't have the right toml config + // missing bootstrapp + app: app, + peerID: peerID.Raw(), + transmitters: transmitters, + keybundle: keybundle, + db: db, + } +} + +func ptr[T any](v T) *T { return &v } + +var _ keystore.Eth = &EthKeystoreSim{} + +type EthKeystoreSim struct { + keystore.Eth + t *testing.T +} + +// override +func (e *EthKeystoreSim) SignTx(ctx context.Context, address common.Address, tx *gethtypes.Transaction, chainID *big.Int) (*gethtypes.Transaction, error) { + // always sign with chain id 1337 for the simulated backend + return e.Eth.SignTx(ctx, address, tx, big.NewInt(1337)) +} + +type KeystoreSim struct { + eks keystore.Eth + csa keystore.CSA +} + +func (e KeystoreSim) Eth() keystore.Eth { + return e.eks +} + +func (e KeystoreSim) CSA() keystore.CSA { + return e.csa +} + +func fundAddress(t *testing.T, from *bind.TransactOpts, to common.Address, amount *big.Int, backend *backends.SimulatedBackend) { + nonce, err := backend.PendingNonceAt(testutils.Context(t), from.From) + require.NoError(t, err) + gp, err := backend.SuggestGasPrice(testutils.Context(t)) + require.NoError(t, err) + rawTx := gethtypes.NewTx(&gethtypes.LegacyTx{ + Nonce: nonce, + GasPrice: gp, + Gas: 21000, + To: &to, + Value: amount, + }) + signedTx, err := from.Signer(from.From, rawTx) + require.NoError(t, err) + err = backend.SendTransaction(testutils.Context(t), signedTx) + require.NoError(t, err) + backend.Commit() +} + +func createConfigV2Chain(chainID *big.Int) *v2toml.EVMConfig { + chain := v2toml.Defaults((*evmutils.Big)(chainID)) + chain.GasEstimator.LimitDefault = ptr(uint64(5e6)) + chain.LogPollInterval = config.MustNewDuration(100 * time.Millisecond) + chain.Transactions.ForwardersEnabled = ptr(false) + chain.FinalityDepth = ptr(uint32(2)) + return &v2toml.EVMConfig{ + ChainID: (*evmutils.Big)(chainID), + Enabled: ptr(true), + Chain: chain, + Nodes: v2toml.EVMNodes{&v2toml.Node{}}, + } +} + +// Commit blocks periodically in the background for all chains +func commitBlocksBackground(t *testing.T, universes map[uint64]onchainUniverse, tick *time.Ticker) { + t.Log("starting ticker to commit blocks") + tickCtx, tickCancel := context.WithCancel(testutils.Context(t)) + var wg sync.WaitGroup + wg.Add(1) + go func() { + defer wg.Done() + for { + select { + case <-tick.C: + for _, uni := range universes { + uni.backend.Commit() + } + case <-tickCtx.Done(): + return + } + } + }() + t.Cleanup(func() { + tickCancel() + wg.Wait() + }) +} + +// p2pKeyID: nodes p2p id +// ocrKeyBundleID: nodes ocr key bundle id +func mustGetJobSpec(t *testing.T, bootstrapP2PID p2pkey.PeerID, bootstrapPort int, p2pKeyID string, ocrKeyBundleID string) job.Job { + specArgs := validate.SpecArgs{ + P2PV2Bootstrappers: []string{ + fmt.Sprintf("%s@127.0.0.1:%d", bootstrapP2PID.Raw(), bootstrapPort), + }, + CapabilityVersion: CapabilityVersion, + CapabilityLabelledName: CapabilityLabelledName, + OCRKeyBundleIDs: map[string]string{ + relay.NetworkEVM: ocrKeyBundleID, + }, + P2PKeyID: p2pKeyID, + PluginConfig: map[string]any{}, + } + specToml, err := validate.NewCCIPSpecToml(specArgs) + require.NoError(t, err) + jb, err := validate.ValidatedCCIPSpec(specToml) + require.NoError(t, err) + return jb +} diff --git a/core/capabilities/ccip/ccip_integration_tests/ping_pong_test.go b/core/capabilities/ccip/ccip_integration_tests/ping_pong_test.go new file mode 100644 index 00000000000..57d2e09f225 --- /dev/null +++ b/core/capabilities/ccip/ccip_integration_tests/ping_pong_test.go @@ -0,0 +1,95 @@ +package ccip_integration_tests + +import ( + "testing" + + "github.com/ethereum/go-ethereum/accounts/abi/bind" + gethcommon "github.com/ethereum/go-ethereum/common" + + "github.com/stretchr/testify/require" + + "golang.org/x/exp/maps" + + pp "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/ping_pong_demo" +) + +/* +* Test is setting up 3 chains (let's call them A, B, C), each chain deploys and starts 2 ping pong contracts for the other 2. +* A ---deploy+start---> (pingPongB, pingPongC) +* B ---deploy+start---> (pingPongA, pingPongC) +* C ---deploy+start---> (pingPongA, pingPongB) +* and then checks that each ping pong contract emitted `CCIPMessageSent` event from the expected source to destination. +* Test fails if any wiring between contracts is not correct. + */ +func TestPingPong(t *testing.T) { + _, universes := createUniverses(t, 3) + pingPongs := initializePingPongContracts(t, universes) + for chainID, universe := range universes { + for otherChain, pingPong := range pingPongs[chainID] { + t.Log("PingPong From: ", chainID, " To: ", otherChain) + _, err := pingPong.StartPingPong(universe.owner) + require.NoError(t, err) + universe.backend.Commit() + + logIter, err := universe.onramp.FilterCCIPMessageSent(&bind.FilterOpts{Start: 0}, nil) + require.NoError(t, err) + // Iterate until latest event + for logIter.Next() { + } + log := logIter.Event + require.Equal(t, getSelector(otherChain), log.DestChainSelector) + require.Equal(t, pingPong.Address(), log.Message.Sender) + chainPingPongAddr := pingPongs[otherChain][chainID].Address().Bytes() + // With chain agnostic addresses we need to pad the address to the correct length if the receiver is zero prefixed + paddedAddr := gethcommon.LeftPadBytes(chainPingPongAddr, len(log.Message.Receiver)) + require.Equal(t, paddedAddr, log.Message.Receiver) + } + } +} + +// InitializeContracts initializes ping pong contracts on all chains and +// connects them all to each other. +func initializePingPongContracts( + t *testing.T, + chainUniverses map[uint64]onchainUniverse, +) map[uint64]map[uint64]*pp.PingPongDemo { + pingPongs := make(map[uint64]map[uint64]*pp.PingPongDemo) + chainIDs := maps.Keys(chainUniverses) + // For each chain initialize N ping pong contracts, where N is the (number of chains - 1) + for chainID, universe := range chainUniverses { + pingPongs[chainID] = make(map[uint64]*pp.PingPongDemo) + for _, chainToConnect := range chainIDs { + if chainToConnect == chainID { + continue // don't connect chain to itself + } + backend := universe.backend + owner := universe.owner + pingPongAddr, _, _, err := pp.DeployPingPongDemo(owner, backend, universe.router.Address(), universe.linkToken.Address()) + require.NoError(t, err) + backend.Commit() + pingPong, err := pp.NewPingPongDemo(pingPongAddr, backend) + require.NoError(t, err) + backend.Commit() + // Fund the ping pong contract with LINK + _, err = universe.linkToken.Transfer(owner, pingPong.Address(), e18Mult(10)) + backend.Commit() + require.NoError(t, err) + pingPongs[chainID][chainToConnect] = pingPong + } + } + + // Set up each ping pong contract to its counterpart on the other chain + for chainID, universe := range chainUniverses { + for chainToConnect, pingPong := range pingPongs[chainID] { + _, err := pingPong.SetCounterpart( + universe.owner, + getSelector(chainUniverses[chainToConnect].chainID), + // This is the address of the ping pong contract on the other chain + pingPongs[chainToConnect][chainID].Address(), + ) + require.NoError(t, err) + universe.backend.Commit() + } + } + return pingPongs +} diff --git a/core/capabilities/ccip/ccip_integration_tests/usdcreader/usdcreader_test.go b/core/capabilities/ccip/ccip_integration_tests/usdcreader/usdcreader_test.go new file mode 100644 index 00000000000..8d26d2b395a --- /dev/null +++ b/core/capabilities/ccip/ccip_integration_tests/usdcreader/usdcreader_test.go @@ -0,0 +1,305 @@ +package usdcreader + +import ( + "context" + "math/big" + "testing" + "time" + + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/accounts/abi/bind/backends" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/crypto" + "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "go.uber.org/zap/zapcore" + + sel "github.com/smartcontractkit/chain-selectors" + + "github.com/smartcontractkit/chainlink-ccip/execute/exectypes" + "github.com/smartcontractkit/chainlink-ccip/pkg/consts" + "github.com/smartcontractkit/chainlink-ccip/pkg/contractreader" + "github.com/smartcontractkit/chainlink-ccip/pkg/reader" + "github.com/smartcontractkit/chainlink-ccip/pluginconfig" + "github.com/smartcontractkit/chainlink-common/pkg/types" + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccipocr3" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/headtracker" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/usdc_reader_tester" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/pgtest" + "github.com/smartcontractkit/chainlink/v2/core/logger" + "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm" + evmtypes "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/types" +) + +func Test_USDCReader_MessageHashes(t *testing.T) { + ctx := testutils.Context(t) + ethereumChain := cciptypes.ChainSelector(sel.ETHEREUM_MAINNET_OPTIMISM_1.Selector) + ethereumDomainCCTP := reader.CCTPDestDomains[uint64(ethereumChain)] + avalancheChain := cciptypes.ChainSelector(sel.AVALANCHE_MAINNET.Selector) + avalancheDomainCCTP := reader.CCTPDestDomains[uint64(avalancheChain)] + polygonChain := cciptypes.ChainSelector(sel.POLYGON_MAINNET.Selector) + polygonDomainCCTP := reader.CCTPDestDomains[uint64(polygonChain)] + + cfg := evmtypes.ChainReaderConfig{ + Contracts: map[string]evmtypes.ChainContractReader{ + consts.ContractNameCCTPMessageTransmitter: { + ContractPollingFilter: evmtypes.ContractPollingFilter{ + GenericEventNames: []string{consts.EventNameCCTPMessageSent}, + }, + ContractABI: usdc_reader_tester.USDCReaderTesterABI, + Configs: map[string]*evmtypes.ChainReaderDefinition{ + consts.EventNameCCTPMessageSent: { + ChainSpecificName: consts.EventNameCCTPMessageSent, + ReadType: evmtypes.Event, + }, + }, + }, + }, + } + + ts := testSetup(ctx, t, ethereumChain, cfg) + + usdcReader, err := reader.NewUSDCMessageReader( + map[cciptypes.ChainSelector]pluginconfig.USDCCCTPTokenConfig{ + ethereumChain: { + SourceMessageTransmitterAddr: ts.contractAddr.String(), + }, + }, + map[cciptypes.ChainSelector]contractreader.ContractReaderFacade{ + ethereumChain: ts.reader, + }) + require.NoError(t, err) + + emitMessageSent(t, ts, ethereumDomainCCTP, avalancheDomainCCTP, 11) + emitMessageSent(t, ts, ethereumDomainCCTP, avalancheDomainCCTP, 21) + emitMessageSent(t, ts, ethereumDomainCCTP, avalancheDomainCCTP, 31) + emitMessageSent(t, ts, ethereumDomainCCTP, avalancheDomainCCTP, 41) + emitMessageSent(t, ts, ethereumDomainCCTP, polygonDomainCCTP, 31) + emitMessageSent(t, ts, ethereumDomainCCTP, polygonDomainCCTP, 41) + + // Need to replay as sometimes the logs are not picked up by the log poller (?) + // Maybe another situation where chain reader doesn't register filters as expected. + require.NoError(t, ts.lp.Replay(ctx, 1)) + + tt := []struct { + name string + tokens map[exectypes.MessageTokenID]cciptypes.RampTokenAmount + sourceChain cciptypes.ChainSelector + destChain cciptypes.ChainSelector + expectedMsgIDs []exectypes.MessageTokenID + }{ + { + name: "empty messages should return empty response", + tokens: map[exectypes.MessageTokenID]cciptypes.RampTokenAmount{}, + sourceChain: ethereumChain, + destChain: avalancheChain, + expectedMsgIDs: []exectypes.MessageTokenID{}, + }, + { + name: "single token message", + tokens: map[exectypes.MessageTokenID]cciptypes.RampTokenAmount{ + exectypes.NewMessageTokenID(1, 1): { + ExtraData: reader.NewSourceTokenDataPayload(11, ethereumDomainCCTP).ToBytes(), + }, + }, + sourceChain: ethereumChain, + destChain: avalancheChain, + expectedMsgIDs: []exectypes.MessageTokenID{exectypes.NewMessageTokenID(1, 1)}, + }, + { + name: "single token message but different chain", + tokens: map[exectypes.MessageTokenID]cciptypes.RampTokenAmount{ + exectypes.NewMessageTokenID(1, 2): { + ExtraData: reader.NewSourceTokenDataPayload(31, ethereumDomainCCTP).ToBytes(), + }, + }, + sourceChain: ethereumChain, + destChain: polygonChain, + expectedMsgIDs: []exectypes.MessageTokenID{exectypes.NewMessageTokenID(1, 2)}, + }, + { + name: "message without matching nonce", + tokens: map[exectypes.MessageTokenID]cciptypes.RampTokenAmount{ + exectypes.NewMessageTokenID(1, 1): { + ExtraData: reader.NewSourceTokenDataPayload(1234, ethereumDomainCCTP).ToBytes(), + }, + }, + sourceChain: ethereumChain, + destChain: avalancheChain, + expectedMsgIDs: []exectypes.MessageTokenID{}, + }, + { + name: "message without matching source domain", + tokens: map[exectypes.MessageTokenID]cciptypes.RampTokenAmount{ + exectypes.NewMessageTokenID(1, 1): { + ExtraData: reader.NewSourceTokenDataPayload(11, avalancheDomainCCTP).ToBytes(), + }, + }, + sourceChain: ethereumChain, + destChain: avalancheChain, + expectedMsgIDs: []exectypes.MessageTokenID{}, + }, + { + name: "message with multiple tokens", + tokens: map[exectypes.MessageTokenID]cciptypes.RampTokenAmount{ + exectypes.NewMessageTokenID(1, 1): { + ExtraData: reader.NewSourceTokenDataPayload(11, ethereumDomainCCTP).ToBytes(), + }, + exectypes.NewMessageTokenID(1, 2): { + ExtraData: reader.NewSourceTokenDataPayload(21, ethereumDomainCCTP).ToBytes(), + }, + }, + sourceChain: ethereumChain, + destChain: avalancheChain, + expectedMsgIDs: []exectypes.MessageTokenID{ + exectypes.NewMessageTokenID(1, 1), + exectypes.NewMessageTokenID(1, 2), + }, + }, + { + name: "message with multiple tokens, one without matching nonce", + tokens: map[exectypes.MessageTokenID]cciptypes.RampTokenAmount{ + exectypes.NewMessageTokenID(1, 1): { + ExtraData: reader.NewSourceTokenDataPayload(11, ethereumDomainCCTP).ToBytes(), + }, + exectypes.NewMessageTokenID(1, 2): { + ExtraData: reader.NewSourceTokenDataPayload(12, ethereumDomainCCTP).ToBytes(), + }, + exectypes.NewMessageTokenID(1, 3): { + ExtraData: reader.NewSourceTokenDataPayload(31, ethereumDomainCCTP).ToBytes(), + }, + }, + sourceChain: ethereumChain, + destChain: avalancheChain, + expectedMsgIDs: []exectypes.MessageTokenID{ + exectypes.NewMessageTokenID(1, 1), + exectypes.NewMessageTokenID(1, 3), + }, + }, + } + + for _, tc := range tt { + t.Run(tc.name, func(t *testing.T) { + require.Eventually(t, func() bool { + hashes, err1 := usdcReader.MessageHashes(ctx, tc.sourceChain, tc.destChain, tc.tokens) + require.NoError(t, err1) + + if len(tc.expectedMsgIDs) != len(hashes) { + return false + } + + for _, msgID := range tc.expectedMsgIDs { + if _, ok := hashes[msgID]; !ok { + return false + } + } + return true + }, tests.WaitTimeout(t), 50*time.Millisecond) + }) + } +} + +func emitMessageSent(t *testing.T, testEnv *testSetupData, source, dest uint32, nonce uint64) { + payload := utils.RandomBytes32() + _, err := testEnv.contract.EmitMessageSent( + testEnv.auth, + reader.CCTPMessageVersion, + source, + dest, + utils.RandomBytes32(), + utils.RandomBytes32(), + [32]byte{}, + nonce, + payload[:], + ) + require.NoError(t, err) + testEnv.sb.Commit() +} + +func testSetup(ctx context.Context, t *testing.T, readerChain cciptypes.ChainSelector, cfg evmtypes.ChainReaderConfig) *testSetupData { + const chainID = 1337 + + // Generate a new key pair for the simulated account + privateKey, err := crypto.GenerateKey() + assert.NoError(t, err) + // Set up the genesis account with balance + blnc, ok := big.NewInt(0).SetString("999999999999999999999999999999999999", 10) + assert.True(t, ok) + alloc := map[common.Address]core.GenesisAccount{crypto.PubkeyToAddress(privateKey.PublicKey): {Balance: blnc}} + simulatedBackend := backends.NewSimulatedBackend(alloc, 0) + // Create a transactor + + auth, err := bind.NewKeyedTransactorWithChainID(privateKey, big.NewInt(chainID)) + assert.NoError(t, err) + auth.GasLimit = uint64(0) + + address, _, _, err := usdc_reader_tester.DeployUSDCReaderTester( + auth, + simulatedBackend, + ) + require.NoError(t, err) + simulatedBackend.Commit() + + contract, err := usdc_reader_tester.NewUSDCReaderTester(address, simulatedBackend) + require.NoError(t, err) + + lggr := logger.TestLogger(t) + lggr.SetLogLevel(zapcore.ErrorLevel) + db := pgtest.NewSqlxDB(t) + lpOpts := logpoller.Opts{ + PollPeriod: time.Millisecond, + FinalityDepth: 0, + BackfillBatchSize: 10, + RpcBatchSize: 10, + KeepFinalizedBlocksDepth: 100000, + } + cl := client.NewSimulatedBackendClient(t, simulatedBackend, big.NewInt(0).SetUint64(uint64(readerChain))) + headTracker := headtracker.NewSimulatedHeadTracker(cl, lpOpts.UseFinalityTag, lpOpts.FinalityDepth) + lp := logpoller.NewLogPoller(logpoller.NewORM(big.NewInt(0).SetUint64(uint64(readerChain)), db, lggr), + cl, + lggr, + headTracker, + lpOpts, + ) + require.NoError(t, lp.Start(ctx)) + + cr, err := evm.NewChainReaderService(ctx, lggr, lp, headTracker, cl, cfg) + require.NoError(t, err) + + err = cr.Start(ctx) + require.NoError(t, err) + + t.Cleanup(func() { + require.NoError(t, cr.Close()) + require.NoError(t, lp.Close()) + require.NoError(t, db.Close()) + }) + + return &testSetupData{ + contractAddr: address, + contract: contract, + sb: simulatedBackend, + auth: auth, + cl: cl, + reader: cr, + lp: lp, + } +} + +type testSetupData struct { + contractAddr common.Address + contract *usdc_reader_tester.USDCReaderTester + sb *backends.SimulatedBackend + auth *bind.TransactOpts + cl client.Client + reader types.ContractReader + lp logpoller.LogPoller +} diff --git a/core/capabilities/ccip/ccipevm/commitcodec.go b/core/capabilities/ccip/ccipevm/commitcodec.go new file mode 100644 index 00000000000..ca515ff2119 --- /dev/null +++ b/core/capabilities/ccip/ccipevm/commitcodec.go @@ -0,0 +1,136 @@ +package ccipevm + +import ( + "context" + "fmt" + "math/big" + "strings" + + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/common" + "github.com/smartcontractkit/libocr/offchainreporting2plus/types" + + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccipocr3" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/offramp" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/abihelpers" +) + +// CommitPluginCodecV1 is a codec for encoding and decoding commit plugin reports. +// Compatible with: +// - "OffRamp 1.6.0-dev" +type CommitPluginCodecV1 struct { + commitReportAcceptedEventInputs abi.Arguments +} + +func NewCommitPluginCodecV1() *CommitPluginCodecV1 { + abiParsed, err := abi.JSON(strings.NewReader(offramp.OffRampABI)) + if err != nil { + panic(fmt.Errorf("parse multi offramp abi: %s", err)) + } + eventInputs := abihelpers.MustGetEventInputs("CommitReportAccepted", abiParsed) + return &CommitPluginCodecV1{commitReportAcceptedEventInputs: eventInputs} +} + +func (c *CommitPluginCodecV1) Encode(ctx context.Context, report cciptypes.CommitPluginReport) ([]byte, error) { + merkleRoots := make([]offramp.InternalMerkleRoot, 0, len(report.MerkleRoots)) + for _, root := range report.MerkleRoots { + merkleRoots = append(merkleRoots, offramp.InternalMerkleRoot{ + SourceChainSelector: uint64(root.ChainSel), + MinSeqNr: uint64(root.SeqNumsRange.Start()), + MaxSeqNr: uint64(root.SeqNumsRange.End()), + MerkleRoot: root.MerkleRoot, + }) + } + + tokenPriceUpdates := make([]offramp.InternalTokenPriceUpdate, 0, len(report.PriceUpdates.TokenPriceUpdates)) + for _, update := range report.PriceUpdates.TokenPriceUpdates { + if !common.IsHexAddress(string(update.TokenID)) { + return nil, fmt.Errorf("invalid token address: %s", update.TokenID) + } + if update.Price.IsEmpty() { + return nil, fmt.Errorf("empty price for token: %s", update.TokenID) + } + tokenPriceUpdates = append(tokenPriceUpdates, offramp.InternalTokenPriceUpdate{ + SourceToken: common.HexToAddress(string(update.TokenID)), + UsdPerToken: update.Price.Int, + }) + } + + gasPriceUpdates := make([]offramp.InternalGasPriceUpdate, 0, len(report.PriceUpdates.GasPriceUpdates)) + for _, update := range report.PriceUpdates.GasPriceUpdates { + if update.GasPrice.IsEmpty() { + return nil, fmt.Errorf("empty gas price for chain: %d", update.ChainSel) + } + + gasPriceUpdates = append(gasPriceUpdates, offramp.InternalGasPriceUpdate{ + DestChainSelector: uint64(update.ChainSel), + UsdPerUnitGas: update.GasPrice.Int, + }) + } + + evmReport := offramp.OffRampCommitReport{ + PriceUpdates: offramp.InternalPriceUpdates{ + TokenPriceUpdates: tokenPriceUpdates, + GasPriceUpdates: gasPriceUpdates, + }, + MerkleRoots: merkleRoots, + } + + return c.commitReportAcceptedEventInputs.PackValues([]interface{}{evmReport}) +} + +func (c *CommitPluginCodecV1) Decode(ctx context.Context, bytes []byte) (cciptypes.CommitPluginReport, error) { + unpacked, err := c.commitReportAcceptedEventInputs.Unpack(bytes) + if err != nil { + return cciptypes.CommitPluginReport{}, err + } + if len(unpacked) != 1 { + return cciptypes.CommitPluginReport{}, fmt.Errorf("expected 1 argument, got %d", len(unpacked)) + } + + commitReportRaw := abi.ConvertType(unpacked[0], new(offramp.OffRampCommitReport)) + commitReport, is := commitReportRaw.(*offramp.OffRampCommitReport) + if !is { + return cciptypes.CommitPluginReport{}, + fmt.Errorf("expected OffRampCommitReport, got %T", unpacked[0]) + } + + merkleRoots := make([]cciptypes.MerkleRootChain, 0, len(commitReport.MerkleRoots)) + for _, root := range commitReport.MerkleRoots { + merkleRoots = append(merkleRoots, cciptypes.MerkleRootChain{ + ChainSel: cciptypes.ChainSelector(root.SourceChainSelector), + SeqNumsRange: cciptypes.NewSeqNumRange( + cciptypes.SeqNum(root.MinSeqNr), + cciptypes.SeqNum(root.MaxSeqNr), + ), + MerkleRoot: root.MerkleRoot, + }) + } + + tokenPriceUpdates := make([]cciptypes.TokenPrice, 0, len(commitReport.PriceUpdates.TokenPriceUpdates)) + for _, update := range commitReport.PriceUpdates.TokenPriceUpdates { + tokenPriceUpdates = append(tokenPriceUpdates, cciptypes.TokenPrice{ + TokenID: types.Account(update.SourceToken.String()), + Price: cciptypes.NewBigInt(big.NewInt(0).Set(update.UsdPerToken)), + }) + } + + gasPriceUpdates := make([]cciptypes.GasPriceChain, 0, len(commitReport.PriceUpdates.GasPriceUpdates)) + for _, update := range commitReport.PriceUpdates.GasPriceUpdates { + gasPriceUpdates = append(gasPriceUpdates, cciptypes.GasPriceChain{ + GasPrice: cciptypes.NewBigInt(big.NewInt(0).Set(update.UsdPerUnitGas)), + ChainSel: cciptypes.ChainSelector(update.DestChainSelector), + }) + } + + return cciptypes.CommitPluginReport{ + MerkleRoots: merkleRoots, + PriceUpdates: cciptypes.PriceUpdates{ + TokenPriceUpdates: tokenPriceUpdates, + GasPriceUpdates: gasPriceUpdates, + }, + }, nil +} + +// Ensure CommitPluginCodec implements the CommitPluginCodec interface +var _ cciptypes.CommitPluginCodec = (*CommitPluginCodecV1)(nil) diff --git a/core/capabilities/ccip/ccipevm/commitcodec_test.go b/core/capabilities/ccip/ccipevm/commitcodec_test.go new file mode 100644 index 00000000000..22dd0bfd126 --- /dev/null +++ b/core/capabilities/ccip/ccipevm/commitcodec_test.go @@ -0,0 +1,159 @@ +package ccipevm + +import ( + "math/big" + "math/rand" + "testing" + + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/smartcontractkit/libocr/offchainreporting2plus/types" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccipocr3" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/offramp" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" +) + +var randomCommitReport = func() cciptypes.CommitPluginReport { + return cciptypes.CommitPluginReport{ + MerkleRoots: []cciptypes.MerkleRootChain{ + { + ChainSel: cciptypes.ChainSelector(rand.Uint64()), + SeqNumsRange: cciptypes.NewSeqNumRange( + cciptypes.SeqNum(rand.Uint64()), + cciptypes.SeqNum(rand.Uint64()), + ), + MerkleRoot: utils.RandomBytes32(), + }, + { + ChainSel: cciptypes.ChainSelector(rand.Uint64()), + SeqNumsRange: cciptypes.NewSeqNumRange( + cciptypes.SeqNum(rand.Uint64()), + cciptypes.SeqNum(rand.Uint64()), + ), + MerkleRoot: utils.RandomBytes32(), + }, + }, + PriceUpdates: cciptypes.PriceUpdates{ + TokenPriceUpdates: []cciptypes.TokenPrice{ + { + TokenID: types.Account(utils.RandomAddress().String()), + Price: cciptypes.NewBigInt(utils.RandUint256()), + }, + }, + GasPriceUpdates: []cciptypes.GasPriceChain{ + {GasPrice: cciptypes.NewBigInt(utils.RandUint256()), ChainSel: cciptypes.ChainSelector(rand.Uint64())}, + {GasPrice: cciptypes.NewBigInt(utils.RandUint256()), ChainSel: cciptypes.ChainSelector(rand.Uint64())}, + {GasPrice: cciptypes.NewBigInt(utils.RandUint256()), ChainSel: cciptypes.ChainSelector(rand.Uint64())}, + }, + }, + } +} + +func TestCommitPluginCodecV1(t *testing.T) { + testCases := []struct { + name string + report func(report cciptypes.CommitPluginReport) cciptypes.CommitPluginReport + expErr bool + }{ + { + name: "base report", + report: func(report cciptypes.CommitPluginReport) cciptypes.CommitPluginReport { + return report + }, + }, + { + name: "empty token address", + report: func(report cciptypes.CommitPluginReport) cciptypes.CommitPluginReport { + report.PriceUpdates.TokenPriceUpdates[0].TokenID = "" + return report + }, + expErr: true, + }, + { + name: "empty merkle root", + report: func(report cciptypes.CommitPluginReport) cciptypes.CommitPluginReport { + report.MerkleRoots[0].MerkleRoot = cciptypes.Bytes32{} + return report + }, + }, + { + name: "zero token price", + report: func(report cciptypes.CommitPluginReport) cciptypes.CommitPluginReport { + report.PriceUpdates.TokenPriceUpdates[0].Price = cciptypes.NewBigInt(big.NewInt(0)) + return report + }, + }, + { + name: "zero gas price", + report: func(report cciptypes.CommitPluginReport) cciptypes.CommitPluginReport { + report.PriceUpdates.GasPriceUpdates[0].GasPrice = cciptypes.NewBigInt(big.NewInt(0)) + return report + }, + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + report := tc.report(randomCommitReport()) + commitCodec := NewCommitPluginCodecV1() + ctx := testutils.Context(t) + encodedReport, err := commitCodec.Encode(ctx, report) + if tc.expErr { + assert.Error(t, err) + return + } + require.NoError(t, err) + decodedReport, err := commitCodec.Decode(ctx, encodedReport) + require.NoError(t, err) + require.Equal(t, report, decodedReport) + }) + } +} + +func BenchmarkCommitPluginCodecV1_Encode(b *testing.B) { + commitCodec := NewCommitPluginCodecV1() + ctx := testutils.Context(b) + + rep := randomCommitReport() + for i := 0; i < b.N; i++ { + _, err := commitCodec.Encode(ctx, rep) + require.NoError(b, err) + } +} + +func BenchmarkCommitPluginCodecV1_Decode(b *testing.B) { + commitCodec := NewCommitPluginCodecV1() + ctx := testutils.Context(b) + encodedReport, err := commitCodec.Encode(ctx, randomCommitReport()) + require.NoError(b, err) + + for i := 0; i < b.N; i++ { + _, err := commitCodec.Decode(ctx, encodedReport) + require.NoError(b, err) + } +} + +func TestDecodeCommitReport(t *testing.T) { + report := hexutil.MustDecode("0x2d04ab76000a61cae2575edd7bc451a34fdad33f7d577226b7ab6015122590d6abc4e450000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000003200000000000000000000000000000000000000000000000000000000000000380010100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002200000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000001e00000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000c9f9284461c852b00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001dc7b58803f528bba0ff4fed53b1309d3ea5319201eb7b74e1d7952985966a09000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002023d96f990f8e5a2cfb69307999265fc1af26b85b5b979c5dffdb45fe41ca29d326001361e4a8bf3b3de5719b2441501ca1d82521ad87b98c805c65f77afa272000000000000000000000000000000000000000000000000000000000000000224b0ec1abc40a8b57b7caa1f952b03b99ff2997236cd91a667463faf172f781023e5abc6a3a5c2fc9ae829869c73387f438bd81697696313efaad61f39a480d8") + tabi, err := offramp.OffRampMetaData.GetAbi() + require.NoError(t, err) + unpacked, err := tabi.Methods["commit"].Inputs.Unpack(report[4:]) + require.NoError(t, err) + require.Len(t, unpacked, 5) + + reportBytes := *abi.ConvertType(unpacked[1], &[]byte{}).(*[]byte) + t.Log("reportBytes: ", hexutil.Encode(reportBytes)) + + unpackedReportRaw, err := tabi.Events["CommitReportAccepted"].Inputs.Unpack(reportBytes) + require.NoError(t, err) + + unpackedReport := *abi.ConvertType(unpackedReportRaw[0], &offramp.OffRampCommitReport{}).(*offramp.OffRampCommitReport) + + t.Log("roots: ", unpackedReport.MerkleRoots) + t.Log("price updates: ", unpackedReport.PriceUpdates) + t.Log("rmn sigs: ", unpackedReport.RmnSignatures) +} diff --git a/core/capabilities/ccip/ccipevm/executecodec.go b/core/capabilities/ccip/ccipevm/executecodec.go new file mode 100644 index 00000000000..2349beb390b --- /dev/null +++ b/core/capabilities/ccip/ccipevm/executecodec.go @@ -0,0 +1,181 @@ +package ccipevm + +import ( + "context" + "fmt" + "strings" + + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/common" + + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccipocr3" + + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/offramp" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/abihelpers" +) + +// ExecutePluginCodecV1 is a codec for encoding and decoding execute plugin reports. +// Compatible with: +// - "OffRamp 1.6.0-dev" +type ExecutePluginCodecV1 struct { + executeReportMethodInputs abi.Arguments +} + +func NewExecutePluginCodecV1() *ExecutePluginCodecV1 { + abiParsed, err := abi.JSON(strings.NewReader(offramp.OffRampABI)) + if err != nil { + panic(fmt.Errorf("parse multi offramp abi: %s", err)) + } + methodInputs := abihelpers.MustGetMethodInputs("manuallyExecute", abiParsed) + if len(methodInputs) == 0 { + panic("no inputs found for method: manuallyExecute") + } + + return &ExecutePluginCodecV1{ + executeReportMethodInputs: methodInputs[:1], + } +} + +func (e *ExecutePluginCodecV1) Encode(ctx context.Context, report cciptypes.ExecutePluginReport) ([]byte, error) { + evmReport := make([]offramp.InternalExecutionReportSingleChain, 0, len(report.ChainReports)) + + for _, chainReport := range report.ChainReports { + if chainReport.ProofFlagBits.IsEmpty() { + return nil, fmt.Errorf("proof flag bits are empty") + } + + evmProofs := make([][32]byte, 0, len(chainReport.Proofs)) + for _, proof := range chainReport.Proofs { + evmProofs = append(evmProofs, proof) + } + + evmMessages := make([]offramp.InternalAny2EVMRampMessage, 0, len(chainReport.Messages)) + for _, message := range chainReport.Messages { + receiver := common.BytesToAddress(message.Receiver) + + tokenAmounts := make([]offramp.InternalRampTokenAmount, 0, len(message.TokenAmounts)) + for _, tokenAmount := range message.TokenAmounts { + if tokenAmount.Amount.IsEmpty() { + return nil, fmt.Errorf("empty amount for token: %s", tokenAmount.DestTokenAddress) + } + + tokenAmounts = append(tokenAmounts, offramp.InternalRampTokenAmount{ + SourcePoolAddress: tokenAmount.SourcePoolAddress, + DestTokenAddress: tokenAmount.DestTokenAddress, + ExtraData: tokenAmount.ExtraData, + Amount: tokenAmount.Amount.Int, + }) + } + + gasLimit, err := decodeExtraArgsV1V2(message.ExtraArgs) + if err != nil { + return nil, fmt.Errorf("decode extra args to get gas limit: %w", err) + } + + evmMessages = append(evmMessages, offramp.InternalAny2EVMRampMessage{ + Header: offramp.InternalRampMessageHeader{ + MessageId: message.Header.MessageID, + SourceChainSelector: uint64(message.Header.SourceChainSelector), + DestChainSelector: uint64(message.Header.DestChainSelector), + SequenceNumber: uint64(message.Header.SequenceNumber), + Nonce: message.Header.Nonce, + }, + Sender: message.Sender, + Data: message.Data, + Receiver: receiver, + GasLimit: gasLimit, + TokenAmounts: tokenAmounts, + }) + } + + evmChainReport := offramp.InternalExecutionReportSingleChain{ + SourceChainSelector: uint64(chainReport.SourceChainSelector), + Messages: evmMessages, + OffchainTokenData: chainReport.OffchainTokenData, + Proofs: evmProofs, + ProofFlagBits: chainReport.ProofFlagBits.Int, + } + evmReport = append(evmReport, evmChainReport) + } + + return e.executeReportMethodInputs.PackValues([]interface{}{&evmReport}) +} + +func (e *ExecutePluginCodecV1) Decode(ctx context.Context, encodedReport []byte) (cciptypes.ExecutePluginReport, error) { + unpacked, err := e.executeReportMethodInputs.Unpack(encodedReport) + if err != nil { + return cciptypes.ExecutePluginReport{}, fmt.Errorf("unpack encoded report: %w", err) + } + if len(unpacked) != 1 { + return cciptypes.ExecutePluginReport{}, fmt.Errorf("unpacked report is empty") + } + + evmReportRaw := abi.ConvertType(unpacked[0], new([]offramp.InternalExecutionReportSingleChain)) + evmReportPtr, is := evmReportRaw.(*[]offramp.InternalExecutionReportSingleChain) + if !is { + return cciptypes.ExecutePluginReport{}, fmt.Errorf("got an unexpected report type %T", unpacked[0]) + } + if evmReportPtr == nil { + return cciptypes.ExecutePluginReport{}, fmt.Errorf("evm report is nil") + } + + evmReport := *evmReportPtr + executeReport := cciptypes.ExecutePluginReport{ + ChainReports: make([]cciptypes.ExecutePluginReportSingleChain, 0, len(evmReport)), + } + + for _, evmChainReport := range evmReport { + proofs := make([]cciptypes.Bytes32, 0, len(evmChainReport.Proofs)) + for _, proof := range evmChainReport.Proofs { + proofs = append(proofs, proof) + } + + messages := make([]cciptypes.Message, 0, len(evmChainReport.Messages)) + for _, evmMessage := range evmChainReport.Messages { + tokenAmounts := make([]cciptypes.RampTokenAmount, 0, len(evmMessage.TokenAmounts)) + for _, tokenAmount := range evmMessage.TokenAmounts { + tokenAmounts = append(tokenAmounts, cciptypes.RampTokenAmount{ + SourcePoolAddress: tokenAmount.SourcePoolAddress, + DestTokenAddress: tokenAmount.DestTokenAddress, + ExtraData: tokenAmount.ExtraData, + Amount: cciptypes.NewBigInt(tokenAmount.Amount), + }) + } + + message := cciptypes.Message{ + Header: cciptypes.RampMessageHeader{ + MessageID: evmMessage.Header.MessageId, + SourceChainSelector: cciptypes.ChainSelector(evmMessage.Header.SourceChainSelector), + DestChainSelector: cciptypes.ChainSelector(evmMessage.Header.DestChainSelector), + SequenceNumber: cciptypes.SeqNum(evmMessage.Header.SequenceNumber), + Nonce: evmMessage.Header.Nonce, + MsgHash: cciptypes.Bytes32{}, // <-- todo: info not available, but not required atm + OnRamp: cciptypes.Bytes{}, // <-- todo: info not available, but not required atm + }, + Sender: evmMessage.Sender, + Data: evmMessage.Data, + Receiver: evmMessage.Receiver.Bytes(), + ExtraArgs: cciptypes.Bytes{}, // <-- todo: info not available, but not required atm + FeeToken: cciptypes.Bytes{}, // <-- todo: info not available, but not required atm + FeeTokenAmount: cciptypes.BigInt{}, // <-- todo: info not available, but not required atm + TokenAmounts: tokenAmounts, + } + messages = append(messages, message) + } + + chainReport := cciptypes.ExecutePluginReportSingleChain{ + SourceChainSelector: cciptypes.ChainSelector(evmChainReport.SourceChainSelector), + Messages: messages, + OffchainTokenData: evmChainReport.OffchainTokenData, + Proofs: proofs, + ProofFlagBits: cciptypes.NewBigInt(evmChainReport.ProofFlagBits), + } + + executeReport.ChainReports = append(executeReport.ChainReports, chainReport) + } + + return executeReport, nil +} + +// Ensure ExecutePluginCodec implements the ExecutePluginCodec interface +var _ cciptypes.ExecutePluginCodec = (*ExecutePluginCodecV1)(nil) diff --git a/core/capabilities/ccip/ccipevm/executecodec_test.go b/core/capabilities/ccip/ccipevm/executecodec_test.go new file mode 100644 index 00000000000..4f207fdb0e2 --- /dev/null +++ b/core/capabilities/ccip/ccipevm/executecodec_test.go @@ -0,0 +1,174 @@ +package ccipevm + +import ( + "math/rand" + "testing" + + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/accounts/abi/bind/backends" + "github.com/ethereum/go-ethereum/core" + + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccipocr3" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/message_hasher" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/report_codec" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +var randomExecuteReport = func(t *testing.T, d *testSetupData) cciptypes.ExecutePluginReport { + const numChainReports = 10 + const msgsPerReport = 10 + const numTokensPerMsg = 3 + + chainReports := make([]cciptypes.ExecutePluginReportSingleChain, numChainReports) + for i := 0; i < numChainReports; i++ { + reportMessages := make([]cciptypes.Message, msgsPerReport) + for j := 0; j < msgsPerReport; j++ { + data, err := cciptypes.NewBytesFromString(utils.RandomAddress().String()) + assert.NoError(t, err) + + tokenAmounts := make([]cciptypes.RampTokenAmount, numTokensPerMsg) + for z := 0; z < numTokensPerMsg; z++ { + tokenAmounts[z] = cciptypes.RampTokenAmount{ + SourcePoolAddress: utils.RandomAddress().Bytes(), + DestTokenAddress: utils.RandomAddress().Bytes(), + ExtraData: data, + Amount: cciptypes.NewBigInt(utils.RandUint256()), + } + } + + extraArgs, err := d.contract.EncodeEVMExtraArgsV1(nil, message_hasher.ClientEVMExtraArgsV1{ + GasLimit: utils.RandUint256(), + }) + assert.NoError(t, err) + + reportMessages[j] = cciptypes.Message{ + Header: cciptypes.RampMessageHeader{ + MessageID: utils.RandomBytes32(), + SourceChainSelector: cciptypes.ChainSelector(rand.Uint64()), + DestChainSelector: cciptypes.ChainSelector(rand.Uint64()), + SequenceNumber: cciptypes.SeqNum(rand.Uint64()), + Nonce: rand.Uint64(), + MsgHash: utils.RandomBytes32(), + OnRamp: utils.RandomAddress().Bytes(), + }, + Sender: utils.RandomAddress().Bytes(), + Data: data, + Receiver: utils.RandomAddress().Bytes(), + ExtraArgs: extraArgs, + FeeToken: utils.RandomAddress().Bytes(), + FeeTokenAmount: cciptypes.NewBigInt(utils.RandUint256()), + TokenAmounts: tokenAmounts, + } + } + + tokenData := make([][][]byte, numTokensPerMsg) + for j := 0; j < numTokensPerMsg; j++ { + tokenData[j] = [][]byte{{0x1}, {0x2, 0x3}} + } + + chainReports[i] = cciptypes.ExecutePluginReportSingleChain{ + SourceChainSelector: cciptypes.ChainSelector(rand.Uint64()), + Messages: reportMessages, + OffchainTokenData: tokenData, + Proofs: []cciptypes.Bytes32{utils.RandomBytes32(), utils.RandomBytes32()}, + ProofFlagBits: cciptypes.NewBigInt(utils.RandUint256()), + } + } + + return cciptypes.ExecutePluginReport{ChainReports: chainReports} +} + +func TestExecutePluginCodecV1(t *testing.T) { + d := testSetup(t) + + testCases := []struct { + name string + report func(report cciptypes.ExecutePluginReport) cciptypes.ExecutePluginReport + expErr bool + }{ + { + name: "base report", + report: func(report cciptypes.ExecutePluginReport) cciptypes.ExecutePluginReport { return report }, + expErr: false, + }, + { + name: "reports have empty msgs", + report: func(report cciptypes.ExecutePluginReport) cciptypes.ExecutePluginReport { + report.ChainReports[0].Messages = []cciptypes.Message{} + report.ChainReports[4].Messages = []cciptypes.Message{} + return report + }, + expErr: false, + }, + { + name: "reports have empty offchain token data", + report: func(report cciptypes.ExecutePluginReport) cciptypes.ExecutePluginReport { + report.ChainReports[0].OffchainTokenData = [][][]byte{} + report.ChainReports[4].OffchainTokenData[1] = [][]byte{} + return report + }, + expErr: false, + }, + } + + ctx := testutils.Context(t) + + // Deploy the contract + transactor := testutils.MustNewSimTransactor(t) + simulatedBackend := backends.NewSimulatedBackend(core.GenesisAlloc{ + transactor.From: {Balance: assets.Ether(1000).ToInt()}, + }, 30e6) + address, _, _, err := report_codec.DeployReportCodec(transactor, simulatedBackend) + require.NoError(t, err) + simulatedBackend.Commit() + contract, err := report_codec.NewReportCodec(address, simulatedBackend) + require.NoError(t, err) + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + codec := NewExecutePluginCodecV1() + report := tc.report(randomExecuteReport(t, d)) + bytes, err := codec.Encode(ctx, report) + if tc.expErr { + assert.Error(t, err) + return + } + assert.NoError(t, err) + + testSetup(t) + + // ignore msg hash in comparison + for i := range report.ChainReports { + for j := range report.ChainReports[i].Messages { + report.ChainReports[i].Messages[j].Header.MsgHash = cciptypes.Bytes32{} + report.ChainReports[i].Messages[j].Header.OnRamp = cciptypes.Bytes{} + report.ChainReports[i].Messages[j].FeeToken = cciptypes.Bytes{} + report.ChainReports[i].Messages[j].ExtraArgs = cciptypes.Bytes{} + report.ChainReports[i].Messages[j].FeeTokenAmount = cciptypes.BigInt{} + } + } + + // decode using the contract + contractDecodedReport, err := contract.DecodeExecuteReport(&bind.CallOpts{Context: ctx}, bytes) + assert.NoError(t, err) + assert.Equal(t, len(report.ChainReports), len(contractDecodedReport)) + for i, expReport := range report.ChainReports { + actReport := contractDecodedReport[i] + assert.Equal(t, expReport.OffchainTokenData, actReport.OffchainTokenData) + assert.Equal(t, len(expReport.Messages), len(actReport.Messages)) + assert.Equal(t, uint64(expReport.SourceChainSelector), actReport.SourceChainSelector) + } + + // decode using the codec + codecDecoded, err := codec.Decode(ctx, bytes) + assert.NoError(t, err) + assert.Equal(t, report, codecDecoded) + }) + } +} diff --git a/core/capabilities/ccip/ccipevm/gas_helpers.go b/core/capabilities/ccip/ccipevm/gas_helpers.go new file mode 100644 index 00000000000..41acb2a15fa --- /dev/null +++ b/core/capabilities/ccip/ccipevm/gas_helpers.go @@ -0,0 +1,89 @@ +package ccipevm + +import ( + "math" + + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccipocr3" +) + +const ( + EvmAddressLengthBytes = 20 + EvmWordBytes = 32 + CalldataGasPerByte = 16 + TokenAdminRegistryWarmupCost = 2_500 + TokenAdminRegistryPoolLookupGas = 100 + // WARM_ACCESS_COST TokenAdminRegistry + 700 + // CALL cost for TokenAdminRegistry + 2_100 // COLD_SLOAD_COST loading the pool address + SupportsInterfaceCheck = 2600 + // because the receiver will be untouched initially + 30_000*3 // supportsInterface of ERC165Checker library performs 3 static-calls of 30k gas each + PerTokenOverheadGas = TokenAdminRegistryPoolLookupGas + + SupportsInterfaceCheck + + 200_000 + // releaseOrMint using callWithExactGas + 50_000 // transfer using callWithExactGas + RateLimiterOverheadGas = 2_100 + // COLD_SLOAD_COST for accessing token bucket + 5_000 // SSTORE_RESET_GAS for updating & decreasing token bucket + ConstantMessagePartBytes = 10 * 32 // A message consists of 10 abi encoded fields 32B each (after encoding) + ExecutionStateProcessingOverheadGas = 2_100 + // COLD_SLOAD_COST for first reading the state + 20_000 + // SSTORE_SET_GAS for writing from 0 (untouched) to non-zero (in-progress) + 100 //# SLOAD_GAS = WARM_STORAGE_READ_COST for rewriting from non-zero (in-progress) to non-zero (success/failure) +) + +func NewGasEstimateProvider() EstimateProvider { + return EstimateProvider{} +} + +type EstimateProvider struct { +} + +// CalculateMerkleTreeGas estimates the merkle tree gas based on number of requests +func (gp EstimateProvider) CalculateMerkleTreeGas(numRequests int) uint64 { + if numRequests == 0 { + return 0 + } + merkleProofBytes := (math.Ceil(math.Log2(float64(numRequests))))*32 + (1+2)*32 // only ever one outer root hash + return uint64(merkleProofBytes * CalldataGasPerByte) +} + +// return the size of bytes for msg tokens +func bytesForMsgTokens(numTokens int) int { + // token address (address) + token amount (uint256) + return (EvmAddressLengthBytes + EvmWordBytes) * numTokens +} + +// CalculateMessageMaxGas computes the maximum gas overhead for a message. +func (gp EstimateProvider) CalculateMessageMaxGas(msg cciptypes.Message) uint64 { + numTokens := len(msg.TokenAmounts) + var data []byte = msg.Data + dataLength := len(data) + + // TODO: update interface to return error? + // Although this decoding should never fail. + messageGasLimit, err := decodeExtraArgsV1V2(msg.ExtraArgs) + if err != nil { + panic(err) + } + + messageBytes := ConstantMessagePartBytes + + bytesForMsgTokens(numTokens) + + dataLength + + messageCallDataGas := uint64(messageBytes * CalldataGasPerByte) + + // Rate limiter only limits value in tokens. It's not called if there are no + // tokens in the message. The same goes for the admin registry, it's only loaded + // if there are tokens, and it's only loaded once. + rateLimiterOverhead := uint64(0) + adminRegistryOverhead := uint64(0) + if numTokens >= 1 { + rateLimiterOverhead = RateLimiterOverheadGas + adminRegistryOverhead = TokenAdminRegistryWarmupCost + } + + return messageGasLimit.Uint64() + + messageCallDataGas + + ExecutionStateProcessingOverheadGas + + SupportsInterfaceCheck + + adminRegistryOverhead + + rateLimiterOverhead + + PerTokenOverheadGas*uint64(numTokens) +} diff --git a/core/capabilities/ccip/ccipevm/gas_helpers_test.go b/core/capabilities/ccip/ccipevm/gas_helpers_test.go new file mode 100644 index 00000000000..f7897898fbc --- /dev/null +++ b/core/capabilities/ccip/ccipevm/gas_helpers_test.go @@ -0,0 +1,157 @@ +package ccipevm + +import ( + "math/big" + "testing" + + "github.com/ethereum/go-ethereum/common" + "github.com/stretchr/testify/assert" + + "github.com/smartcontractkit/chainlink-common/pkg/types/ccipocr3" +) + +func Test_calculateMessageMaxGas(t *testing.T) { + type args struct { + dataLen int + numTokens int + extraArgs []byte + } + tests := []struct { + name string + args args + want uint64 + }{ + { + name: "base", + args: args{dataLen: 5, numTokens: 2, extraArgs: makeExtraArgsV1(200_000)}, + want: 1_022_264, + }, + { + name: "large", + args: args{dataLen: 1000, numTokens: 1000, extraArgs: makeExtraArgsV1(200_000)}, + want: 346_677_520, + }, + { + name: "overheadGas test 1", + args: args{dataLen: 0, numTokens: 0, extraArgs: makeExtraArgsV1(200_000)}, + want: 319_920, + }, + { + name: "overheadGas test 2", + args: args{dataLen: len([]byte{0x0, 0x0, 0x0, 0x0, 0x0, 0x0}), numTokens: 1, extraArgs: makeExtraArgsV1(200_000)}, + want: 675_948, + }, + { + name: "allowOOO set to true makes no difference to final gas estimate", + args: args{dataLen: 5, numTokens: 2, extraArgs: makeExtraArgsV2(200_000, true)}, + want: 1_022_264, + }, + { + name: "allowOOO set to false makes no difference to final gas estimate", + args: args{dataLen: 5, numTokens: 2, extraArgs: makeExtraArgsV2(200_000, false)}, + want: 1_022_264, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + msg := ccipocr3.Message{ + Data: make([]byte, tt.args.dataLen), + TokenAmounts: make([]ccipocr3.RampTokenAmount, tt.args.numTokens), + ExtraArgs: tt.args.extraArgs, + } + ep := EstimateProvider{} + got := ep.CalculateMessageMaxGas(msg) + t.Log(got) + assert.Equalf(t, tt.want, got, "calculateMessageMaxGas(%v, %v)", tt.args.dataLen, tt.args.numTokens) + }) + } +} + +// TestCalculateMaxGas is taken from the ccip repo where the CalculateMerkleTreeGas and CalculateMessageMaxGas values +// are combined to one function. +func TestCalculateMaxGas(t *testing.T) { + tests := []struct { + name string + numRequests int + dataLength int + numberOfTokens int + extraArgs []byte + want uint64 + }{ + { + name: "maxGasOverheadGas 1", + numRequests: 6, + dataLength: 0, + numberOfTokens: 0, + extraArgs: makeExtraArgsV1(200_000), + want: 322_992, + }, + { + name: "maxGasOverheadGas 2", + numRequests: 3, + dataLength: len([]byte{0x0, 0x0, 0x0, 0x0, 0x0, 0x0}), + numberOfTokens: 1, + extraArgs: makeExtraArgsV1(200_000), + want: 678_508, + }, + { + name: "v2 extra args", + numRequests: 3, + dataLength: len([]byte{0x0, 0x0, 0x0, 0x0, 0x0, 0x0}), + numberOfTokens: 1, + extraArgs: makeExtraArgsV2(200_000, true), + want: 678_508, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + msg := ccipocr3.Message{ + Data: make([]byte, tt.dataLength), + TokenAmounts: make([]ccipocr3.RampTokenAmount, tt.numberOfTokens), + ExtraArgs: tt.extraArgs, + } + ep := EstimateProvider{} + + gotTree := ep.CalculateMerkleTreeGas(tt.numRequests) + gotMsg := ep.CalculateMessageMaxGas(msg) + t.Log("want", tt.want, "got", gotTree+gotMsg) + assert.Equal(t, tt.want, gotTree+gotMsg) + }) + } +} + +func makeExtraArgsV1(gasLimit uint64) []byte { + // extra args is the tag followed by the gas limit abi-encoded. + var extraArgs []byte + extraArgs = append(extraArgs, evmExtraArgsV1Tag...) + gasLimitBytes := new(big.Int).SetUint64(gasLimit).Bytes() + // pad from the left to 32 bytes + gasLimitBytes = common.LeftPadBytes(gasLimitBytes, 32) + extraArgs = append(extraArgs, gasLimitBytes...) + return extraArgs +} + +func makeExtraArgsV2(gasLimit uint64, allowOOO bool) []byte { + // extra args is the tag followed by the gas limit and allowOOO abi-encoded. + var extraArgs []byte + extraArgs = append(extraArgs, evmExtraArgsV2Tag...) + gasLimitBytes := new(big.Int).SetUint64(gasLimit).Bytes() + // pad from the left to 32 bytes + gasLimitBytes = common.LeftPadBytes(gasLimitBytes, 32) + + // abi-encode allowOOO + var allowOOOBytes []byte + if allowOOO { + allowOOOBytes = append(allowOOOBytes, 1) + } else { + allowOOOBytes = append(allowOOOBytes, 0) + } + // pad from the left to 32 bytes + allowOOOBytes = common.LeftPadBytes(allowOOOBytes, 32) + + extraArgs = append(extraArgs, gasLimitBytes...) + extraArgs = append(extraArgs, allowOOOBytes...) + return extraArgs +} diff --git a/core/capabilities/ccip/ccipevm/helpers.go b/core/capabilities/ccip/ccipevm/helpers.go new file mode 100644 index 00000000000..4cfd64b7c65 --- /dev/null +++ b/core/capabilities/ccip/ccipevm/helpers.go @@ -0,0 +1,45 @@ +package ccipevm + +import ( + "bytes" + "fmt" + "math/big" + + "github.com/ethereum/go-ethereum/accounts/abi" +) + +func decodeExtraArgsV1V2(extraArgs []byte) (gasLimit *big.Int, err error) { + if len(extraArgs) < 4 { + return nil, fmt.Errorf("extra args too short: %d, should be at least 4 (i.e the extraArgs tag)", len(extraArgs)) + } + + var method string + if bytes.Equal(extraArgs[:4], evmExtraArgsV1Tag) { + method = "decodeEVMExtraArgsV1" + } else if bytes.Equal(extraArgs[:4], evmExtraArgsV2Tag) { + method = "decodeEVMExtraArgsV2" + } else { + return nil, fmt.Errorf("unknown extra args tag: %x", extraArgs) + } + ifaces, err := messageHasherABI.Methods[method].Inputs.UnpackValues(extraArgs[4:]) + if err != nil { + return nil, fmt.Errorf("abi decode extra args v1: %w", err) + } + // gas limit is always the first argument, and allow OOO isn't set explicitly + // on the message. + _, ok := ifaces[0].(*big.Int) + if !ok { + return nil, fmt.Errorf("expected *big.Int, got %T", ifaces[0]) + } + return ifaces[0].(*big.Int), nil +} + +// abiEncodeMethodInputs encodes the inputs for a method call. +// example abi: `[{ "name" : "method", "type": "function", "inputs": [{"name": "a", "type": "uint256"}]}]` +func abiEncodeMethodInputs(abiDef abi.ABI, inputs ...interface{}) ([]byte, error) { + packed, err := abiDef.Pack("method", inputs...) + if err != nil { + return nil, err + } + return packed[4:], nil // remove the method selector +} diff --git a/core/capabilities/ccip/ccipevm/helpers_test.go b/core/capabilities/ccip/ccipevm/helpers_test.go new file mode 100644 index 00000000000..95a5d4439bb --- /dev/null +++ b/core/capabilities/ccip/ccipevm/helpers_test.go @@ -0,0 +1,41 @@ +package ccipevm + +import ( + "math/big" + "math/rand" + "testing" + + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/message_hasher" + + "github.com/stretchr/testify/require" +) + +func Test_decodeExtraArgs(t *testing.T) { + d := testSetup(t) + gasLimit := big.NewInt(rand.Int63()) + + t.Run("v1", func(t *testing.T) { + encoded, err := d.contract.EncodeEVMExtraArgsV1(nil, message_hasher.ClientEVMExtraArgsV1{ + GasLimit: gasLimit, + }) + require.NoError(t, err) + + decodedGasLimit, err := decodeExtraArgsV1V2(encoded) + require.NoError(t, err) + + require.Equal(t, gasLimit, decodedGasLimit) + }) + + t.Run("v2", func(t *testing.T) { + encoded, err := d.contract.EncodeEVMExtraArgsV2(nil, message_hasher.ClientEVMExtraArgsV2{ + GasLimit: gasLimit, + AllowOutOfOrderExecution: true, + }) + require.NoError(t, err) + + decodedGasLimit, err := decodeExtraArgsV1V2(encoded) + require.NoError(t, err) + + require.Equal(t, gasLimit, decodedGasLimit) + }) +} diff --git a/core/capabilities/ccip/ccipevm/msghasher.go b/core/capabilities/ccip/ccipevm/msghasher.go new file mode 100644 index 00000000000..cf37a28b003 --- /dev/null +++ b/core/capabilities/ccip/ccipevm/msghasher.go @@ -0,0 +1,127 @@ +package ccipevm + +import ( + "context" + "fmt" + + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccipocr3" + + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/message_hasher" +) + +var ( + // bytes32 internal constant LEAF_DOMAIN_SEPARATOR = 0x0000000000000000000000000000000000000000000000000000000000000000; + leafDomainSeparator = [32]byte{} + + // bytes32 internal constant ANY_2_EVM_MESSAGE_HASH = keccak256("Any2EVMMessageHashV1"); + ANY_2_EVM_MESSAGE_HASH = utils.Keccak256Fixed([]byte("Any2EVMMessageHashV1")) + + messageHasherABI = types.MustGetABI(message_hasher.MessageHasherABI) + + // bytes4 public constant EVM_EXTRA_ARGS_V1_TAG = 0x97a657c9; + evmExtraArgsV1Tag = hexutil.MustDecode("0x97a657c9") + + // bytes4 public constant EVM_EXTRA_ARGS_V2_TAG = 0x181dcf10; + evmExtraArgsV2Tag = hexutil.MustDecode("0x181dcf10") +) + +// MessageHasherV1 implements the MessageHasher interface. +// Compatible with: +// - "OnRamp 1.6.0-dev" +type MessageHasherV1 struct{} + +func NewMessageHasherV1() *MessageHasherV1 { + return &MessageHasherV1{} +} + +// Hash implements the MessageHasher interface. +// It constructs all of the inputs to the final keccak256 hash in Internal._hash(Any2EVMRampMessage). +// The main structure of the hash is as follows: +/* + keccak256( + leafDomainSeparator, + keccak256(any_2_evm_message_hash, header.sourceChainSelector, header.destinationChainSelector, onRamp), + keccak256(fixedSizeMessageFields), + keccak256(messageData), + keccak256(encodedRampTokenAmounts), + ) +*/ +func (h *MessageHasherV1) Hash(_ context.Context, msg cciptypes.Message) (cciptypes.Bytes32, error) { + var rampTokenAmounts []message_hasher.InternalRampTokenAmount + for _, rta := range msg.TokenAmounts { + rampTokenAmounts = append(rampTokenAmounts, message_hasher.InternalRampTokenAmount{ + SourcePoolAddress: rta.SourcePoolAddress, + DestTokenAddress: rta.DestTokenAddress, + ExtraData: rta.ExtraData, + Amount: rta.Amount.Int, + }) + } + encodedRampTokenAmounts, err := h.abiEncode("encodeTokenAmountsHashPreimage", rampTokenAmounts) + if err != nil { + return [32]byte{}, fmt.Errorf("abi encode token amounts: %w", err) + } + + metaDataHashInput, err := h.abiEncode( + "encodeMetadataHashPreimage", + ANY_2_EVM_MESSAGE_HASH, + uint64(msg.Header.SourceChainSelector), + uint64(msg.Header.DestChainSelector), + []byte(msg.Header.OnRamp), + ) + if err != nil { + return [32]byte{}, fmt.Errorf("abi encode metadata hash input: %w", err) + } + + // Need to decode the extra args to get the gas limit. + // TODO: we assume that extra args is always abi-encoded for now, but we need + // to decode according to source chain selector family. We should add a family + // lookup API to the chain-selectors library. + gasLimit, err := decodeExtraArgsV1V2(msg.ExtraArgs) + if err != nil { + return [32]byte{}, fmt.Errorf("decode extra args: %w", err) + } + + fixedSizeFieldsEncoded, err := h.abiEncode( + "encodeFixedSizeFieldsHashPreimage", + msg.Header.MessageID, + []byte(msg.Sender), + common.BytesToAddress(msg.Receiver), + uint64(msg.Header.SequenceNumber), + gasLimit, + msg.Header.Nonce, + ) + if err != nil { + return [32]byte{}, fmt.Errorf("abi encode fixed size values: %w", err) + } + + packedValues, err := h.abiEncode( + "encodeFinalHashPreimage", + leafDomainSeparator, + utils.Keccak256Fixed(metaDataHashInput), + utils.Keccak256Fixed(fixedSizeFieldsEncoded), + utils.Keccak256Fixed(msg.Data), + utils.Keccak256Fixed(encodedRampTokenAmounts), + ) + if err != nil { + return [32]byte{}, fmt.Errorf("abi encode packed values: %w", err) + } + + return utils.Keccak256Fixed(packedValues), nil +} + +func (h *MessageHasherV1) abiEncode(method string, values ...interface{}) ([]byte, error) { + res, err := messageHasherABI.Pack(method, values...) + if err != nil { + return nil, err + } + // trim the method selector. + return res[4:], nil +} + +// Interface compliance check +var _ cciptypes.MessageHasher = (*MessageHasherV1)(nil) diff --git a/core/capabilities/ccip/ccipevm/msghasher_test.go b/core/capabilities/ccip/ccipevm/msghasher_test.go new file mode 100644 index 00000000000..911a10b26a5 --- /dev/null +++ b/core/capabilities/ccip/ccipevm/msghasher_test.go @@ -0,0 +1,189 @@ +package ccipevm + +import ( + "context" + cryptorand "crypto/rand" + "fmt" + "math/big" + "math/rand" + "strings" + "testing" + + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/accounts/abi/bind/backends" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core" + "github.com/stretchr/testify/require" + + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccipocr3" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/message_hasher" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" +) + +// NOTE: these test cases are only EVM <-> EVM. +// Update these cases once we have non-EVM examples. +func TestMessageHasher_EVM2EVM(t *testing.T) { + ctx := testutils.Context(t) + d := testSetup(t) + + testCases := []evmExtraArgs{ + {version: "v1", gasLimit: big.NewInt(rand.Int63())}, + {version: "v2", gasLimit: big.NewInt(rand.Int63()), allowOOO: false}, + {version: "v2", gasLimit: big.NewInt(rand.Int63()), allowOOO: true}, + } + for i, tc := range testCases { + t.Run(fmt.Sprintf("tc_%d", i), func(tt *testing.T) { + testHasherEVM2EVM(ctx, tt, d, tc) + }) + } +} + +func testHasherEVM2EVM(ctx context.Context, t *testing.T, d *testSetupData, evmExtraArgs evmExtraArgs) { + ccipMsg := createEVM2EVMMessage(t, d.contract, evmExtraArgs) + + var tokenAmounts []message_hasher.InternalRampTokenAmount + for _, rta := range ccipMsg.TokenAmounts { + tokenAmounts = append(tokenAmounts, message_hasher.InternalRampTokenAmount{ + SourcePoolAddress: rta.SourcePoolAddress, + DestTokenAddress: rta.DestTokenAddress, + ExtraData: rta.ExtraData[:], + Amount: rta.Amount.Int, + }) + } + evmMsg := message_hasher.InternalAny2EVMRampMessage{ + Header: message_hasher.InternalRampMessageHeader{ + MessageId: ccipMsg.Header.MessageID, + SourceChainSelector: uint64(ccipMsg.Header.SourceChainSelector), + DestChainSelector: uint64(ccipMsg.Header.DestChainSelector), + SequenceNumber: uint64(ccipMsg.Header.SequenceNumber), + Nonce: ccipMsg.Header.Nonce, + }, + Sender: ccipMsg.Sender, + Receiver: common.BytesToAddress(ccipMsg.Receiver), + GasLimit: evmExtraArgs.gasLimit, + Data: ccipMsg.Data, + TokenAmounts: tokenAmounts, + } + + expectedHash, err := d.contract.Hash(&bind.CallOpts{Context: ctx}, evmMsg, ccipMsg.Header.OnRamp) + require.NoError(t, err) + + evmMsgHasher := NewMessageHasherV1() + actualHash, err := evmMsgHasher.Hash(ctx, ccipMsg) + require.NoError(t, err) + + require.Equal(t, fmt.Sprintf("%x", expectedHash), strings.TrimPrefix(actualHash.String(), "0x")) +} + +type evmExtraArgs struct { + version string + gasLimit *big.Int + allowOOO bool +} + +func createEVM2EVMMessage(t *testing.T, messageHasher *message_hasher.MessageHasher, evmExtraArgs evmExtraArgs) cciptypes.Message { + messageID := utils.RandomBytes32() + + sourceTokenData := make([]byte, rand.Intn(2048)) + _, err := cryptorand.Read(sourceTokenData) + require.NoError(t, err) + + sourceChain := rand.Uint64() + seqNum := rand.Uint64() + nonce := rand.Uint64() + destChain := rand.Uint64() + + var extraArgsBytes []byte + if evmExtraArgs.version == "v1" { + extraArgsBytes, err = messageHasher.EncodeEVMExtraArgsV1(nil, message_hasher.ClientEVMExtraArgsV1{ + GasLimit: evmExtraArgs.gasLimit, + }) + require.NoError(t, err) + } else if evmExtraArgs.version == "v2" { + extraArgsBytes, err = messageHasher.EncodeEVMExtraArgsV2(nil, message_hasher.ClientEVMExtraArgsV2{ + GasLimit: evmExtraArgs.gasLimit, + AllowOutOfOrderExecution: evmExtraArgs.allowOOO, + }) + require.NoError(t, err) + } else { + require.FailNowf(t, "unknown extra args version", "version: %s", evmExtraArgs.version) + } + + messageData := make([]byte, rand.Intn(2048)) + _, err = cryptorand.Read(messageData) + require.NoError(t, err) + + numTokens := rand.Intn(10) + var sourceTokenDatas [][]byte + for i := 0; i < numTokens; i++ { + sourceTokenDatas = append(sourceTokenDatas, sourceTokenData) + } + + var tokenAmounts []cciptypes.RampTokenAmount + for i := 0; i < len(sourceTokenDatas); i++ { + extraData := utils.RandomBytes32() + tokenAmounts = append(tokenAmounts, cciptypes.RampTokenAmount{ + SourcePoolAddress: abiEncodedAddress(t), + DestTokenAddress: abiEncodedAddress(t), + ExtraData: extraData[:], + Amount: cciptypes.NewBigInt(big.NewInt(0).SetUint64(rand.Uint64())), + }) + } + + return cciptypes.Message{ + Header: cciptypes.RampMessageHeader{ + MessageID: messageID, + SourceChainSelector: cciptypes.ChainSelector(sourceChain), + DestChainSelector: cciptypes.ChainSelector(destChain), + SequenceNumber: cciptypes.SeqNum(seqNum), + Nonce: nonce, + OnRamp: abiEncodedAddress(t), + }, + Sender: abiEncodedAddress(t), + Receiver: abiEncodedAddress(t), + Data: messageData, + TokenAmounts: tokenAmounts, + FeeToken: abiEncodedAddress(t), + FeeTokenAmount: cciptypes.NewBigInt(big.NewInt(0).SetUint64(rand.Uint64())), + ExtraArgs: extraArgsBytes, + } +} + +func abiEncodedAddress(t *testing.T) []byte { + addr := utils.RandomAddress() + encoded, err := utils.ABIEncode(`[{"type": "address"}]`, addr) + require.NoError(t, err) + return encoded +} + +type testSetupData struct { + contractAddr common.Address + contract *message_hasher.MessageHasher + sb *backends.SimulatedBackend + auth *bind.TransactOpts +} + +func testSetup(t *testing.T) *testSetupData { + transactor := testutils.MustNewSimTransactor(t) + simulatedBackend := backends.NewSimulatedBackend(core.GenesisAlloc{ + transactor.From: {Balance: assets.Ether(1000).ToInt()}, + }, 30e6) + + // Deploy the contract + address, _, _, err := message_hasher.DeployMessageHasher(transactor, simulatedBackend) + require.NoError(t, err) + simulatedBackend.Commit() + + // Setup contract client + contract, err := message_hasher.NewMessageHasher(address, simulatedBackend) + require.NoError(t, err) + + return &testSetupData{ + contractAddr: address, + contract: contract, + sb: simulatedBackend, + auth: transactor, + } +} diff --git a/core/capabilities/ccip/ccipevm/rmncrypto.go b/core/capabilities/ccip/ccipevm/rmncrypto.go new file mode 100644 index 00000000000..794a466524f --- /dev/null +++ b/core/capabilities/ccip/ccipevm/rmncrypto.go @@ -0,0 +1,184 @@ +package ccipevm + +import ( + "bytes" + "context" + "errors" + "fmt" + "math/big" + "strings" + + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/crypto" + + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccipocr3" +) + +// encodingUtilsAbi is the ABI for the EncodingUtils contract. +// Should be imported when gethwrappers are moved from ccip repo to core. +// nolint:lll +const encodingUtilsAbiRaw = `[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"DoNotDeploy","type":"error"},{"inputs":[{"internalType":"bytes32","name":"rmnReportVersion","type":"bytes32"},{"components":[{"internalType":"uint256","name":"destChainId","type":"uint256"},{"internalType":"uint64","name":"destChainSelector","type":"uint64"},{"internalType":"address","name":"rmnRemoteContractAddress","type":"address"},{"internalType":"address","name":"offrampAddress","type":"address"},{"internalType":"bytes32","name":"rmnHomeContractConfigDigest","type":"bytes32"},{"components":[{"internalType":"uint64","name":"sourceChainSelector","type":"uint64"},{"internalType":"bytes","name":"onRampAddress","type":"bytes"},{"internalType":"uint64","name":"minSeqNr","type":"uint64"},{"internalType":"uint64","name":"maxSeqNr","type":"uint64"},{"internalType":"bytes32","name":"merkleRoot","type":"bytes32"}],"internalType":"struct Internal.MerkleRoot[]","name":"destLaneUpdates","type":"tuple[]"}],"internalType":"struct RMNRemote.Report","name":"rmnReport","type":"tuple"}],"name":"_rmnReport","outputs":[],"stateMutability":"nonpayable","type":"function"}]` +const addressEncodeAbiRaw = `[{"name":"method","type":"function","inputs":[{"name": "", "type": "address"}]}]` + +var ( + encodingUtilsABI abi.ABI + addressEncodeABI abi.ABI +) + +func init() { + var err error + + encodingUtilsABI, err = abi.JSON(strings.NewReader(encodingUtilsAbiRaw)) + if err != nil { + panic(fmt.Errorf("failed to parse encoding utils ABI: %v", err)) + } + + addressEncodeABI, err = abi.JSON(strings.NewReader(addressEncodeAbiRaw)) + if err != nil { + panic(fmt.Errorf("failed to parse address encode ABI: %v", err)) + } +} + +const ( + // v is the recovery ID for ECDSA signatures. This implementation assumes that v is always 27. + v = 27 +) + +// EVMRMNCrypto is the RMNCrypto implementation for EVM chains. +type EVMRMNCrypto struct{} + +// Interface compliance check +var _ cciptypes.RMNCrypto = (*EVMRMNCrypto)(nil) + +func NewEVMRMNCrypto() *EVMRMNCrypto { + return &EVMRMNCrypto{} +} + +// Should be replaced by gethwrapper types when they're available +type evmRMNRemoteReport struct { + DestChainID *big.Int `abi:"destChainId"` + DestChainSelector uint64 + RmnRemoteContractAddress common.Address + OfframpAddress common.Address + RmnHomeContractConfigDigest [32]byte + DestLaneUpdates []evmInternalMerkleRoot +} + +type evmInternalMerkleRoot struct { + SourceChainSelector uint64 + OnRampAddress []byte + MinSeqNr uint64 + MaxSeqNr uint64 + MerkleRoot [32]byte +} + +func (r *EVMRMNCrypto) VerifyReportSignatures( + _ context.Context, + sigs []cciptypes.RMNECDSASignature, + report cciptypes.RMNReport, + signerAddresses []cciptypes.Bytes, +) error { + if sigs == nil { + return fmt.Errorf("no signatures provided") + } + if report.LaneUpdates == nil { + return fmt.Errorf("no lane updates provided") + } + + rmnVersionHash := crypto.Keccak256Hash([]byte(report.ReportVersion)) + + evmLaneUpdates := make([]evmInternalMerkleRoot, len(report.LaneUpdates)) + for i, lu := range report.LaneUpdates { + onRampAddress := common.BytesToAddress(lu.OnRampAddress) + onRampAddrAbi, err := abiEncodeMethodInputs(addressEncodeABI, onRampAddress) + if err != nil { + return fmt.Errorf("ΑΒΙ encode onRampAddress: %w", err) + } + evmLaneUpdates[i] = evmInternalMerkleRoot{ + SourceChainSelector: uint64(lu.SourceChainSelector), + OnRampAddress: onRampAddrAbi, + MinSeqNr: uint64(lu.MinSeqNr), + MaxSeqNr: uint64(lu.MaxSeqNr), + MerkleRoot: lu.MerkleRoot, + } + } + + evmReport := evmRMNRemoteReport{ + DestChainID: report.DestChainID.Int, + DestChainSelector: uint64(report.DestChainSelector), + RmnRemoteContractAddress: common.HexToAddress(report.RmnRemoteContractAddress.String()), + OfframpAddress: common.HexToAddress(report.OfframpAddress.String()), + RmnHomeContractConfigDigest: report.RmnHomeContractConfigDigest, + DestLaneUpdates: evmLaneUpdates, + } + + abiEnc, err := encodingUtilsABI.Methods["_rmnReport"].Inputs.Pack(rmnVersionHash, evmReport) + if err != nil { + return fmt.Errorf("failed to ABI encode args: %w", err) + } + + signedHash := crypto.Keccak256Hash(abiEnc) + + // keep track of the previous signer for validating signers ordering + prevSignerAddr := common.Address{} + + for _, sig := range sigs { + recoveredAddress, err := recoverAddressFromSig( + v, + sig.R, + sig.S, + signedHash[:], + ) + if err != nil { + return fmt.Errorf("failed to recover public key from signature: %w", err) + } + + // make sure that signers are ordered correctly (ASC addresses). + if bytes.Compare(prevSignerAddr.Bytes(), recoveredAddress.Bytes()) == 1 { + return fmt.Errorf("signers are not ordered correctly") + } + prevSignerAddr = recoveredAddress + + // Check if the public key is in the list of the provided RMN nodes + found := false + for _, signerAddr := range signerAddresses { + signerAddrEvm := common.BytesToAddress(signerAddr) + if signerAddrEvm == recoveredAddress { + found = true + break + } + } + if !found { + return fmt.Errorf("the recovered public key does not match any signer address, verification failed") + } + } + + return nil +} + +// recoverAddressFromSig Recovers a public address from an ECDSA signature using r, s, v, and the hash of the message. +func recoverAddressFromSig(v int, r, s [32]byte, hash []byte) (common.Address, error) { + // Ensure v is either 27 or 28 (as used in Ethereum) + if v != 27 && v != 28 { + return common.Address{}, errors.New("v must be 27 or 28") + } + + // Construct the signature by concatenating r, s, and the recovery ID (v - 27 to convert to 0/1) + sig := append(r[:], s[:]...) + sig = append(sig, byte(v-27)) + + // Recover the public key bytes from the signature and message hash + pubKeyBytes, err := crypto.Ecrecover(hash, sig) + if err != nil { + return common.Address{}, fmt.Errorf("failed to recover public key: %v", err) + } + + // Convert the recovered public key to an ECDSA public key + pubKey, err := crypto.UnmarshalPubkey(pubKeyBytes) + if err != nil { + return common.Address{}, fmt.Errorf("failed to unmarshal public key: %v", err) + } // or SigToPub + + return crypto.PubkeyToAddress(*pubKey), nil +} diff --git a/core/capabilities/ccip/ccipevm/rmncrypto_test.go b/core/capabilities/ccip/ccipevm/rmncrypto_test.go new file mode 100644 index 00000000000..e12b20ab304 --- /dev/null +++ b/core/capabilities/ccip/ccipevm/rmncrypto_test.go @@ -0,0 +1,68 @@ +package ccipevm + +import ( + "testing" + + "github.com/ethereum/go-ethereum/common" + + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccipocr3" + "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func Test_VerifyRmnReportSignatures(t *testing.T) { + // NOTE: The following test data (public keys, signatures, ...) are shared from the RMN team. + + onchainRmnRemoteAddr := common.HexToAddress("0x7821bcd6944457d17c631157efeb0c621baa76eb") + + rmnHomeContractConfigDigestHex := "0x785936570d1c7422ef30b7da5555ad2f175fa2dd97a2429a2e71d1e07c94e060" + rmnHomeContractConfigDigest := common.FromHex(rmnHomeContractConfigDigestHex) + require.Len(t, rmnHomeContractConfigDigest, 32) + var rmnHomeContractConfigDigest32 [32]byte + copy(rmnHomeContractConfigDigest32[:], rmnHomeContractConfigDigest) + + rootHex := "0x48e688aefc20a04fdec6b8ff19df358fd532455659dcf529797cda358e9e5205" + root := common.FromHex(rootHex) + require.Len(t, root, 32) + var root32 [32]byte + copy(root32[:], root) + + onRampAddr := common.HexToAddress("0x6662cb20464f4be557262693bea0409f068397ed") + + destChainEvmID := int64(4083663998511321420) + + reportData := cciptypes.RMNReport{ + ReportVersion: "RMN_V1_6_ANY2EVM_REPORT", + DestChainID: cciptypes.NewBigIntFromInt64(destChainEvmID), + DestChainSelector: 5266174733271469989, + RmnRemoteContractAddress: common.HexToAddress("0x3d015cec4411357eff4ea5f009a581cc519f75d3").Bytes(), + OfframpAddress: common.HexToAddress("0xc5cdb7711a478058023373b8ae9e7421925140f8").Bytes(), + RmnHomeContractConfigDigest: rmnHomeContractConfigDigest32, + LaneUpdates: []cciptypes.RMNLaneUpdate{ + { + SourceChainSelector: 8258882951688608272, + OnRampAddress: onRampAddr.Bytes(), + MinSeqNr: 9018980618932210108, + MaxSeqNr: 8239368306600774074, + MerkleRoot: root32, + }, + }, + } + + ctx := tests.Context(t) + + rmnCrypto := NewEVMRMNCrypto() + + r, _ := cciptypes.NewBytes32FromString("0x89546b4652d0377062a398e413344e4da6034ae877c437d0efe0e5246b70a9a1") + s, _ := cciptypes.NewBytes32FromString("0x95eef2d24d856ccac3886db8f4aebea60684ed73942392692908fed79a679b4e") + + err := rmnCrypto.VerifyReportSignatures( + ctx, + []cciptypes.RMNECDSASignature{{R: r, S: s}}, + reportData, + []cciptypes.Bytes{onchainRmnRemoteAddr.Bytes()}, + ) + assert.NoError(t, err) +} diff --git a/core/capabilities/ccip/common/common.go b/core/capabilities/ccip/common/common.go new file mode 100644 index 00000000000..6409345ed93 --- /dev/null +++ b/core/capabilities/ccip/common/common.go @@ -0,0 +1,23 @@ +package common + +import ( + "fmt" + + "github.com/ethereum/go-ethereum/crypto" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils" +) + +// HashedCapabilityID returns the hashed capability id in a manner equivalent to the capability registry. +func HashedCapabilityID(capabilityLabelledName, capabilityVersion string) (r [32]byte, err error) { + // TODO: investigate how to avoid parsing the ABI everytime. + tabi := `[{"type": "string"}, {"type": "string"}]` + abiEncoded, err := utils.ABIEncode(tabi, capabilityLabelledName, capabilityVersion) + if err != nil { + return r, fmt.Errorf("failed to ABI encode capability version and labelled name: %w", err) + } + + h := crypto.Keccak256(abiEncoded) + copy(r[:], h) + return r, nil +} diff --git a/core/capabilities/ccip/common/common_test.go b/core/capabilities/ccip/common/common_test.go new file mode 100644 index 00000000000..a7484a83ad9 --- /dev/null +++ b/core/capabilities/ccip/common/common_test.go @@ -0,0 +1,51 @@ +package common_test + +import ( + "testing" + + capcommon "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/common" + + "github.com/ethereum/go-ethereum/accounts/abi/bind/backends" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core" + "github.com/stretchr/testify/require" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" + kcr "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/capabilities_registry" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" +) + +func Test_HashedCapabilityId(t *testing.T) { + transactor := testutils.MustNewSimTransactor(t) + sb := backends.NewSimulatedBackend(core.GenesisAlloc{ + transactor.From: {Balance: assets.Ether(1000).ToInt()}, + }, 30e6) + + crAddress, _, _, err := kcr.DeployCapabilitiesRegistry(transactor, sb) + require.NoError(t, err) + sb.Commit() + + cr, err := kcr.NewCapabilitiesRegistry(crAddress, sb) + require.NoError(t, err) + + // add a capability, ignore cap config for simplicity. + _, err = cr.AddCapabilities(transactor, []kcr.CapabilitiesRegistryCapability{ + { + LabelledName: "ccip", + Version: "v1.0.0", + CapabilityType: 0, + ResponseType: 0, + ConfigurationContract: common.Address{}, + }, + }) + require.NoError(t, err) + sb.Commit() + + hidExpected, err := cr.GetHashedCapabilityId(nil, "ccip", "v1.0.0") + require.NoError(t, err) + + hid, err := capcommon.HashedCapabilityID("ccip", "v1.0.0") + require.NoError(t, err) + + require.Equal(t, hidExpected, hid) +} diff --git a/core/capabilities/ccip/configs/evm/chain_writer.go b/core/capabilities/ccip/configs/evm/chain_writer.go new file mode 100644 index 00000000000..6f8c4a1570b --- /dev/null +++ b/core/capabilities/ccip/configs/evm/chain_writer.go @@ -0,0 +1,75 @@ +package evm + +import ( + "encoding/json" + "fmt" + + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/common" + + "github.com/smartcontractkit/chainlink-ccip/pkg/consts" + "github.com/smartcontractkit/chainlink/v2/common/txmgr" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" + evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/offramp" + evmrelaytypes "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/types" +) + +var ( + offrampABI = evmtypes.MustGetABI(offramp.OffRampABI) +) + +func MustChainWriterConfig( + fromAddress common.Address, + maxGasPrice *assets.Wei, + commitGasLimit, + execBatchGasLimit uint64, +) []byte { + rawConfig := ChainWriterConfigRaw(fromAddress, maxGasPrice, commitGasLimit, execBatchGasLimit) + encoded, err := json.Marshal(rawConfig) + if err != nil { + panic(fmt.Errorf("failed to marshal ChainWriterConfig: %w", err)) + } + + return encoded +} + +// ChainWriterConfigRaw returns a ChainWriterConfig that can be used to transmit commit and execute reports. +func ChainWriterConfigRaw( + fromAddress common.Address, + maxGasPrice *assets.Wei, + commitGasLimit, + execBatchGasLimit uint64, +) evmrelaytypes.ChainWriterConfig { + return evmrelaytypes.ChainWriterConfig{ + Contracts: map[string]*evmrelaytypes.ContractConfig{ + consts.ContractNameOffRamp: { + ContractABI: offramp.OffRampABI, + Configs: map[string]*evmrelaytypes.ChainWriterDefinition{ + consts.MethodCommit: { + ChainSpecificName: mustGetMethodName("commit", offrampABI), + FromAddress: fromAddress, + GasLimit: commitGasLimit, + }, + consts.MethodExecute: { + ChainSpecificName: mustGetMethodName("execute", offrampABI), + FromAddress: fromAddress, + GasLimit: execBatchGasLimit, + }, + }, + }, + }, + SendStrategy: txmgr.NewSendEveryStrategy(), + MaxGasPrice: maxGasPrice, + } +} + +// mustGetMethodName panics if the method name is not found in the provided ABI. +func mustGetMethodName(name string, tabi abi.ABI) (methodName string) { + m, ok := tabi.Methods[name] + if !ok { + panic(fmt.Sprintf("missing method %s in the abi", name)) + } + return m.Name +} diff --git a/core/capabilities/ccip/configs/evm/contract_reader.go b/core/capabilities/ccip/configs/evm/contract_reader.go new file mode 100644 index 00000000000..fbfbf260b8a --- /dev/null +++ b/core/capabilities/ccip/configs/evm/contract_reader.go @@ -0,0 +1,273 @@ +package evm + +import ( + "encoding/json" + "fmt" + + "github.com/ethereum/go-ethereum/accounts/abi" + + "github.com/smartcontractkit/chainlink-ccip/pkg/consts" + + evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/ccip_config" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/fee_quoter" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/nonce_manager" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/offramp" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/onramp" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/rmn_remote" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/aggregator_v3_interface" + kcr "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/capabilities_registry" + evmrelaytypes "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/types" +) + +var ( + onrampABI = evmtypes.MustGetABI(onramp.OnRampABI) + capabilitiesRegsitryABI = evmtypes.MustGetABI(kcr.CapabilitiesRegistryABI) + ccipConfigABI = evmtypes.MustGetABI(ccip_config.CCIPConfigABI) + feeQuoterABI = evmtypes.MustGetABI(fee_quoter.FeeQuoterABI) + nonceManagerABI = evmtypes.MustGetABI(nonce_manager.NonceManagerABI) + priceFeedABI = evmtypes.MustGetABI(aggregator_v3_interface.AggregatorV3InterfaceABI) + rmnRemoteABI = evmtypes.MustGetABI(rmn_remote.RMNRemoteABI) + rmnHomeABI = evmtypes.MustGetABI(rmnHomeString) +) + +// TODO: replace with generated ABI when the contract will be defined +var rmnHomeString = "[{\"inputs\":[],\"name\":\"getAllConfigs\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"num\",\"type\":\"uint256\"}],\"name\":\"store\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]" + +// MustSourceReaderConfig returns a ChainReaderConfig that can be used to read from the onramp. +// The configuration is marshaled into JSON so that it can be passed to the relayer NewContractReader() method. +func MustSourceReaderConfig() []byte { + rawConfig := SourceReaderConfig + encoded, err := json.Marshal(rawConfig) + if err != nil { + panic(fmt.Errorf("failed to marshal ChainReaderConfig into JSON: %w", err)) + } + + return encoded +} + +// MustDestReaderConfig returns a ChainReaderConfig that can be used to read from the offramp. +// The configuration is marshaled into JSON so that it can be passed to the relayer NewContractReader() method. +func MustDestReaderConfig() []byte { + rawConfig := DestReaderConfig + encoded, err := json.Marshal(rawConfig) + if err != nil { + panic(fmt.Errorf("failed to marshal ChainReaderConfig into JSON: %w", err)) + } + + return encoded +} + +func MergeReaderConfigs(configs ...evmrelaytypes.ChainReaderConfig) evmrelaytypes.ChainReaderConfig { + allContracts := make(map[string]evmrelaytypes.ChainContractReader) + for _, c := range configs { + for contractName, contractReader := range c.Contracts { + allContracts[contractName] = contractReader + } + } + + return evmrelaytypes.ChainReaderConfig{Contracts: allContracts} +} + +// DestReaderConfig returns a ChainReaderConfig that can be used to read from the offramp. +var DestReaderConfig = evmrelaytypes.ChainReaderConfig{ + Contracts: map[string]evmrelaytypes.ChainContractReader{ + consts.ContractNameOffRamp: { + ContractABI: offramp.OffRampABI, + ContractPollingFilter: evmrelaytypes.ContractPollingFilter{ + GenericEventNames: []string{ + mustGetEventName(consts.EventNameExecutionStateChanged, offrampABI), + mustGetEventName(consts.EventNameCommitReportAccepted, offrampABI), + }, + }, + Configs: map[string]*evmrelaytypes.ChainReaderDefinition{ + consts.MethodNameGetExecutionState: { + ChainSpecificName: mustGetMethodName("getExecutionState", offrampABI), + ReadType: evmrelaytypes.Method, + }, + consts.MethodNameGetMerkleRoot: { + ChainSpecificName: mustGetMethodName("getMerkleRoot", offrampABI), + ReadType: evmrelaytypes.Method, + }, + consts.MethodNameGetLatestPriceSequenceNumber: { + ChainSpecificName: mustGetMethodName("getLatestPriceSequenceNumber", offrampABI), + ReadType: evmrelaytypes.Method, + }, + consts.MethodNameOfframpGetStaticConfig: { + ChainSpecificName: mustGetMethodName("getStaticConfig", offrampABI), + ReadType: evmrelaytypes.Method, + }, + consts.MethodNameOfframpGetDynamicConfig: { + ChainSpecificName: mustGetMethodName("getDynamicConfig", offrampABI), + ReadType: evmrelaytypes.Method, + }, + consts.MethodNameGetSourceChainConfig: { + ChainSpecificName: mustGetMethodName("getSourceChainConfig", offrampABI), + ReadType: evmrelaytypes.Method, + }, + consts.EventNameCommitReportAccepted: { + ChainSpecificName: mustGetEventName(consts.EventNameCommitReportAccepted, offrampABI), + ReadType: evmrelaytypes.Event, + }, + consts.EventNameExecutionStateChanged: { + ChainSpecificName: mustGetEventName(consts.EventNameExecutionStateChanged, offrampABI), + ReadType: evmrelaytypes.Event, + }, + }, + }, + consts.ContractNameNonceManager: { + ContractABI: nonce_manager.NonceManagerABI, + Configs: map[string]*evmrelaytypes.ChainReaderDefinition{ + consts.MethodNameGetInboundNonce: { + ChainSpecificName: mustGetMethodName("getInboundNonce", nonceManagerABI), + ReadType: evmrelaytypes.Method, + }, + consts.MethodNameGetOutboundNonce: { + ChainSpecificName: mustGetMethodName("getOutboundNonce", nonceManagerABI), + ReadType: evmrelaytypes.Method, + }, + }, + }, + consts.ContractNameFeeQuoter: { + ContractABI: fee_quoter.FeeQuoterABI, + Configs: map[string]*evmrelaytypes.ChainReaderDefinition{ + consts.MethodNameFeeQuoterGetStaticConfig: { + ChainSpecificName: mustGetMethodName("getStaticConfig", feeQuoterABI), + ReadType: evmrelaytypes.Method, + }, + consts.MethodNameFeeQuoterGetTokenPrices: { + ChainSpecificName: mustGetMethodName("getTokenPrices", feeQuoterABI), + ReadType: evmrelaytypes.Method, + }, + consts.MethodNameGetDestChainConfig: { + ChainSpecificName: mustGetMethodName("getDestChainConfig", feeQuoterABI), + ReadType: evmrelaytypes.Method, + }, + consts.MethodNameGetPremiumMultiplierWeiPerEth: { + ChainSpecificName: mustGetMethodName("getPremiumMultiplierWeiPerEth", feeQuoterABI), + ReadType: evmrelaytypes.Method, + }, + consts.MethodNameGetTokenTransferFeeConfig: { + ChainSpecificName: mustGetMethodName("getTokenTransferFeeConfig", feeQuoterABI), + ReadType: evmrelaytypes.Method, + }, + consts.MethodNameProcessMessageArgs: { + ChainSpecificName: mustGetMethodName("processMessageArgs", feeQuoterABI), + ReadType: evmrelaytypes.Method, + }, + consts.MethodNameProcessPoolReturnData: { + ChainSpecificName: mustGetMethodName("processPoolReturnData", feeQuoterABI), + ReadType: evmrelaytypes.Method, + }, + consts.MethodNameGetValidatedTokenPrice: { + ChainSpecificName: mustGetMethodName("getValidatedTokenPrice", feeQuoterABI), + ReadType: evmrelaytypes.Method, + }, + consts.MethodNameGetFeeTokens: { + ChainSpecificName: mustGetMethodName("getFeeTokens", feeQuoterABI), + ReadType: evmrelaytypes.Method, + }, + }, + }, + consts.ContractNameRMNRemote: { + ContractABI: rmn_remote.RMNRemoteABI, + Configs: map[string]*evmrelaytypes.ChainReaderDefinition{ + consts.MethodNameGetVersionedConfig: { + ChainSpecificName: mustGetMethodName("getVersionedConfig", rmnRemoteABI), + ReadType: evmrelaytypes.Method, + }, + }, + }, + }, +} + +// SourceReaderConfig returns a ChainReaderConfig that can be used to read from the onramp. +var SourceReaderConfig = evmrelaytypes.ChainReaderConfig{ + Contracts: map[string]evmrelaytypes.ChainContractReader{ + consts.ContractNameOnRamp: { + ContractABI: onramp.OnRampABI, + ContractPollingFilter: evmrelaytypes.ContractPollingFilter{ + GenericEventNames: []string{ + consts.EventNameCCIPMessageSent, + }, + }, + Configs: map[string]*evmrelaytypes.ChainReaderDefinition{ + // all "{external|public} view" functions in the onramp except for getFee and getPoolBySourceToken are here. + // getFee is not expected to get called offchain and is only called by end-user contracts. + consts.MethodNameGetExpectedNextSequenceNumber: { + ChainSpecificName: mustGetMethodName("getExpectedNextSequenceNumber", onrampABI), + ReadType: evmrelaytypes.Method, + }, + consts.MethodNameOnrampGetStaticConfig: { + ChainSpecificName: mustGetMethodName("getStaticConfig", onrampABI), + ReadType: evmrelaytypes.Method, + }, + consts.MethodNameOnrampGetDynamicConfig: { + ChainSpecificName: mustGetMethodName("getDynamicConfig", onrampABI), + ReadType: evmrelaytypes.Method, + }, + consts.EventNameCCIPMessageSent: { + ChainSpecificName: mustGetEventName("CCIPMessageSent", onrampABI), + ReadType: evmrelaytypes.Event, + }, + }, + }, + }, +} + +var FeedReaderConfig = evmrelaytypes.ChainReaderConfig{ + Contracts: map[string]evmrelaytypes.ChainContractReader{ + consts.ContractNamePriceAggregator: { + ContractABI: aggregator_v3_interface.AggregatorV3InterfaceABI, + Configs: map[string]*evmrelaytypes.ChainReaderDefinition{ + consts.MethodNameGetLatestRoundData: { + ChainSpecificName: mustGetMethodName(consts.MethodNameGetLatestRoundData, priceFeedABI), + }, + consts.MethodNameGetDecimals: { + ChainSpecificName: mustGetMethodName(consts.MethodNameGetDecimals, priceFeedABI), + }, + }, + }, + }, +} + +// HomeChainReaderConfigRaw returns a ChainReaderConfig that can be used to read from the home chain. +var HomeChainReaderConfigRaw = evmrelaytypes.ChainReaderConfig{ + Contracts: map[string]evmrelaytypes.ChainContractReader{ + consts.ContractNameCapabilitiesRegistry: { + ContractABI: kcr.CapabilitiesRegistryABI, + Configs: map[string]*evmrelaytypes.ChainReaderDefinition{ + consts.MethodNameGetCapability: { + ChainSpecificName: mustGetMethodName("getCapability", capabilitiesRegsitryABI), + }, + }, + }, + consts.ContractNameCCIPConfig: { + ContractABI: ccip_config.CCIPConfigABI, + Configs: map[string]*evmrelaytypes.ChainReaderDefinition{ + consts.MethodNameGetAllChainConfigs: { + ChainSpecificName: mustGetMethodName("getAllChainConfigs", ccipConfigABI), + }, + consts.MethodNameGetOCRConfig: { + ChainSpecificName: mustGetMethodName("getOCRConfig", ccipConfigABI), + }, + }, + }, + consts.ContractNameRMNHome: { + ContractABI: rmnHomeString, + Configs: map[string]*evmrelaytypes.ChainReaderDefinition{ + consts.MethodNameGetAllConfigs: { + ChainSpecificName: mustGetMethodName("getAllConfigs", rmnHomeABI), + }, + }, + }, + }, +} + +func mustGetEventName(event string, tabi abi.ABI) string { + e, ok := tabi.Events[event] + if !ok { + panic(fmt.Sprintf("missing event %s in onrampABI", event)) + } + return e.Name +} diff --git a/core/capabilities/ccip/delegate.go b/core/capabilities/ccip/delegate.go new file mode 100644 index 00000000000..30007a7b2cf --- /dev/null +++ b/core/capabilities/ccip/delegate.go @@ -0,0 +1,362 @@ +package ccip + +import ( + "context" + "fmt" + "strconv" + "time" + + "github.com/smartcontractkit/chainlink-common/pkg/loop" + + "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/common" + configsevm "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/configs/evm" + "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/launcher" + "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/oraclecreator" + "github.com/smartcontractkit/chainlink/v2/core/services/ocrcommon" + p2ptypes "github.com/smartcontractkit/chainlink/v2/core/services/p2p/types" + "github.com/smartcontractkit/chainlink/v2/core/services/registrysyncer" + + ragep2ptypes "github.com/smartcontractkit/libocr/ragep2p/types" + + "github.com/smartcontractkit/chainlink-ccip/pkg/consts" + ccipreaderpkg "github.com/smartcontractkit/chainlink-ccip/pkg/reader" + "github.com/smartcontractkit/chainlink-common/pkg/sqlutil" + "github.com/smartcontractkit/chainlink-common/pkg/types" + "github.com/smartcontractkit/chainlink-common/pkg/types/query/primitives" + + chainsel "github.com/smartcontractkit/chain-selectors" + + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccipocr3" + cctypes "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/types" + + "github.com/smartcontractkit/chainlink/v2/core/chains/legacyevm" + "github.com/smartcontractkit/chainlink/v2/core/config" + kcr "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/capabilities_registry" + "github.com/smartcontractkit/chainlink/v2/core/logger" + "github.com/smartcontractkit/chainlink/v2/core/services/job" + "github.com/smartcontractkit/chainlink/v2/core/services/keystore" + "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ocr2key" + "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2" + "github.com/smartcontractkit/chainlink/v2/core/services/pipeline" + "github.com/smartcontractkit/chainlink/v2/core/services/relay" + "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm" + "github.com/smartcontractkit/chainlink/v2/core/services/telemetry" + "github.com/smartcontractkit/chainlink/v2/plugins" +) + +type RelayGetter interface { + Get(types.RelayID) (loop.Relayer, error) + GetIDToRelayerMap() (map[types.RelayID]loop.Relayer, error) +} + +type Delegate struct { + lggr logger.Logger + registrarConfig plugins.RegistrarConfig + pipelineRunner pipeline.Runner + chains legacyevm.LegacyChainContainer + relayers RelayGetter + keystore keystore.Master + ds sqlutil.DataSource + peerWrapper *ocrcommon.SingletonPeerWrapper + monitoringEndpointGen telemetry.MonitoringEndpointGenerator + capabilityConfig config.Capabilities + + isNewlyCreatedJob bool +} + +func NewDelegate( + lggr logger.Logger, + registrarConfig plugins.RegistrarConfig, + pipelineRunner pipeline.Runner, + chains legacyevm.LegacyChainContainer, + relayers RelayGetter, + keystore keystore.Master, + ds sqlutil.DataSource, + peerWrapper *ocrcommon.SingletonPeerWrapper, + monitoringEndpointGen telemetry.MonitoringEndpointGenerator, + capabilityConfig config.Capabilities, +) *Delegate { + return &Delegate{ + lggr: lggr, + registrarConfig: registrarConfig, + pipelineRunner: pipelineRunner, + chains: chains, + relayers: relayers, + ds: ds, + keystore: keystore, + peerWrapper: peerWrapper, + monitoringEndpointGen: monitoringEndpointGen, + capabilityConfig: capabilityConfig, + } +} + +func (d *Delegate) JobType() job.Type { + return job.CCIP +} + +func (d *Delegate) BeforeJobCreated(job.Job) { + // This is only called first time the job is created + d.isNewlyCreatedJob = true +} + +func (d *Delegate) ServicesForSpec(ctx context.Context, spec job.Job) (services []job.ServiceCtx, err error) { + // In general there should only be one P2P key but the node may have multiple. + // The job spec should specify the correct P2P key to use. + peerID, err := p2pkey.MakePeerID(spec.CCIPSpec.P2PKeyID) + if err != nil { + return nil, fmt.Errorf("failed to make peer ID from provided spec p2p id (%s): %w", spec.CCIPSpec.P2PKeyID, err) + } + + p2pID, err := d.keystore.P2P().Get(peerID) + if err != nil { + return nil, fmt.Errorf("failed to get all p2p keys: %w", err) + } + + cfg := d.capabilityConfig + rid := cfg.ExternalRegistry().RelayID() + relayer, err := d.relayers.Get(rid) + if err != nil { + return nil, fmt.Errorf("could not fetch relayer %s configured for capabilities registry: %w", rid, err) + } + registrySyncer, err := registrysyncer.New( + d.lggr, + func() (p2ptypes.PeerID, error) { + return p2ptypes.PeerID(p2pID.PeerID()), nil + }, + relayer, + cfg.ExternalRegistry().Address(), + registrysyncer.NewORM(d.ds, d.lggr), + ) + if err != nil { + return nil, fmt.Errorf("could not configure syncer: %w", err) + } + + ocrKeys, err := d.getOCRKeys(spec.CCIPSpec.OCRKeyBundleIDs) + if err != nil { + return nil, err + } + + transmitterKeys, err := d.getTransmitterKeys(ctx, d.chains) + if err != nil { + return nil, err + } + + bootstrapperLocators, err := ocrcommon.ParseBootstrapPeers(spec.CCIPSpec.P2PV2Bootstrappers) + if err != nil { + return nil, fmt.Errorf("failed to parse bootstrapper locators: %w", err) + } + + // NOTE: we can use the same DB for all plugin instances, + // since all queries are scoped by config digest. + ocrDB := ocr2.NewDB(d.ds, spec.ID, 0, d.lggr) + + homeChainContractReader, ccipConfigBinding, err := d.getHomeChainContractReader( + ctx, + d.chains, + spec.CCIPSpec.CapabilityLabelledName, + spec.CCIPSpec.CapabilityVersion) + if err != nil { + return nil, fmt.Errorf("failed to get home chain contract reader: %w", err) + } + + hcr := ccipreaderpkg.NewHomeChainReader( + homeChainContractReader, + d.lggr.Named("HomeChainReader"), + 100*time.Millisecond, + ccipConfigBinding, + ) + + // get the chain selector for the home chain + homeChainChainID, err := strconv.ParseUint(d.capabilityConfig.ExternalRegistry().RelayID().ChainID, 10, 64) + if err != nil { + return nil, fmt.Errorf("failed to parse chain ID %s: %w", d.capabilityConfig.ExternalRegistry().RelayID().ChainID, err) + } + homeChainChainSelector, err := chainsel.SelectorFromChainId(homeChainChainID) + if err != nil { + return nil, fmt.Errorf("failed to get chain selector from chain ID %d", homeChainChainID) + } + + // if bootstrappers are provided we assume that the node is a plugin oracle. + // the reason for this is that bootstrap oracles do not need to be aware + // of other bootstrap oracles. however, plugin oracles, at least initially, + // must be aware of available bootstrappers. + var oracleCreator cctypes.OracleCreator + if len(spec.CCIPSpec.P2PV2Bootstrappers) > 0 { + oracleCreator = oraclecreator.NewPluginOracleCreator( + ocrKeys, + transmitterKeys, + d.chains, + d.peerWrapper, + spec.ExternalJobID, + spec.ID, + d.isNewlyCreatedJob, + spec.CCIPSpec.PluginConfig, + ocrDB, + d.lggr, + d.monitoringEndpointGen, + bootstrapperLocators, + hcr, + cciptypes.ChainSelector(homeChainChainSelector), + ) + } else { + oracleCreator = oraclecreator.NewBootstrapOracleCreator( + d.peerWrapper, + bootstrapperLocators, + ocrDB, + d.monitoringEndpointGen, + d.lggr, + ) + } + + capabilityID := fmt.Sprintf("%s@%s", spec.CCIPSpec.CapabilityLabelledName, spec.CCIPSpec.CapabilityVersion) + capLauncher := launcher.New( + capabilityID, + ragep2ptypes.PeerID(p2pID.PeerID()), + d.lggr, + hcr, + 12*time.Second, + oracleCreator, + ) + + // register the capability launcher with the registry syncer + registrySyncer.AddLauncher(capLauncher) + + return []job.ServiceCtx{ + registrySyncer, + hcr, + capLauncher, + }, nil +} + +func (d *Delegate) AfterJobCreated(spec job.Job) {} + +func (d *Delegate) BeforeJobDeleted(spec job.Job) {} + +func (d *Delegate) OnDeleteJob(ctx context.Context, spec job.Job) error { + // TODO: shut down needed services? + return nil +} + +func (d *Delegate) getOCRKeys(ocrKeyBundleIDs job.JSONConfig) (map[string]ocr2key.KeyBundle, error) { + ocrKeys := make(map[string]ocr2key.KeyBundle) + for networkType, bundleIDRaw := range ocrKeyBundleIDs { + if networkType != relay.NetworkEVM { + return nil, fmt.Errorf("unsupported chain type: %s", networkType) + } + + bundleID, ok := bundleIDRaw.(string) + if !ok { + return nil, fmt.Errorf("OCRKeyBundleIDs must be a map of chain types to OCR key bundle IDs, got: %T", bundleIDRaw) + } + + bundle, err2 := d.keystore.OCR2().Get(bundleID) + if err2 != nil { + return nil, fmt.Errorf("OCR key bundle with ID %s not found: %w", bundleID, err2) + } + + ocrKeys[networkType] = bundle + } + return ocrKeys, nil +} + +func (d *Delegate) getTransmitterKeys(ctx context.Context, chains legacyevm.LegacyChainContainer) (map[types.RelayID][]string, error) { + transmitterKeys := make(map[types.RelayID][]string) + for _, chain := range chains.Slice() { + relayID := types.NewRelayID(relay.NetworkEVM, chain.ID().String()) + ethKeys, err2 := d.keystore.Eth().EnabledAddressesForChain(ctx, chain.ID()) + if err2 != nil { + return nil, fmt.Errorf("error getting enabled addresses for chain: %s %w", chain.ID().String(), err2) + } + + transmitterKeys[relayID] = func() (r []string) { + for _, key := range ethKeys { + r = append(r, key.Hex()) + } + return + }() + } + return transmitterKeys, nil +} + +func (d *Delegate) getHomeChainContractReader( + ctx context.Context, + chains legacyevm.LegacyChainContainer, + capabilityLabelledName, + capabilityVersion string, +) (types.ContractReader, types.BoundContract, error) { + // home chain is where the capability registry is deployed, + // which should be set correctly in toml config. + homeChainRelayID := d.capabilityConfig.ExternalRegistry().RelayID() + homeChain, err := chains.Get(homeChainRelayID.ChainID) + if err != nil { + return nil, types.BoundContract{}, fmt.Errorf("home chain relayer not found, chain id: %s, err: %w", homeChainRelayID.String(), err) + } + + reader, err := evm.NewChainReaderService( + context.Background(), + d.lggr, + homeChain.LogPoller(), + homeChain.HeadTracker(), + homeChain.Client(), + configsevm.HomeChainReaderConfigRaw, + ) + if err != nil { + return nil, types.BoundContract{}, fmt.Errorf("failed to create home chain contract reader: %w", err) + } + + reader, ccipConfigBinding, err := bindReader(ctx, reader, d.capabilityConfig.ExternalRegistry().Address(), capabilityLabelledName, capabilityVersion) + if err != nil { + return nil, types.BoundContract{}, fmt.Errorf("failed to bind home chain contract reader: %w", err) + } + + return reader, ccipConfigBinding, nil +} + +func bindReader(ctx context.Context, + reader types.ContractReader, + capRegAddress, + capabilityLabelledName, + capabilityVersion string, +) (boundReader types.ContractReader, ccipConfigBinding types.BoundContract, err error) { + boundContract := types.BoundContract{ + Address: capRegAddress, + Name: consts.ContractNameCapabilitiesRegistry, + } + + err = reader.Bind(ctx, []types.BoundContract{boundContract}) + if err != nil { + return nil, types.BoundContract{}, fmt.Errorf("failed to bind home chain contract reader: %w", err) + } + + hid, err := common.HashedCapabilityID(capabilityLabelledName, capabilityVersion) + if err != nil { + return nil, types.BoundContract{}, fmt.Errorf("failed to hash capability id: %w", err) + } + + var ccipCapabilityInfo kcr.CapabilitiesRegistryCapabilityInfo + err = reader.GetLatestValue( + ctx, + boundContract.ReadIdentifier(consts.MethodNameGetCapability), + primitives.Unconfirmed, + map[string]any{ + "hashedId": hid, + }, + &ccipCapabilityInfo, + ) + if err != nil { + return nil, types.BoundContract{}, fmt.Errorf("failed to get CCIP capability info from chain reader: %w", err) + } + + // bind the ccip capability configuration contract + ccipConfigBinding = types.BoundContract{ + Address: ccipCapabilityInfo.ConfigurationContract.String(), + Name: consts.ContractNameCCIPConfig, + } + err = reader.Bind(ctx, []types.BoundContract{ccipConfigBinding}) + if err != nil { + return nil, types.BoundContract{}, fmt.Errorf("failed to bind CCIP capability configuration contract: %w", err) + } + + return reader, ccipConfigBinding, nil +} diff --git a/core/capabilities/ccip/delegate_test.go b/core/capabilities/ccip/delegate_test.go new file mode 100644 index 00000000000..dd8a5124b57 --- /dev/null +++ b/core/capabilities/ccip/delegate_test.go @@ -0,0 +1 @@ +package ccip diff --git a/core/capabilities/ccip/launcher/README.md b/core/capabilities/ccip/launcher/README.md new file mode 100644 index 00000000000..41fbecfdbd8 --- /dev/null +++ b/core/capabilities/ccip/launcher/README.md @@ -0,0 +1,69 @@ +# CCIP Capability Launcher + +The CCIP capability launcher is responsible for listening to +[Capabilities Registry](../../../../contracts/src/v0.8/keystone/CapabilitiesRegistry.sol) (CR) updates +for the particular CCIP capability (labelled name, version) pair and reacting to them. In +particular, there are three kinds of events that would affect a particular capability: + +1. DON Creation: when `addDON` is called on the CR, the capabilities of this new DON are specified. +If CCIP is one of those capabilities, the launcher will launch a commit and an execution plugin +with the OCR configuration specified in the DON creation process. See +[Types.sol](../../../../contracts/src/v0.8/ccip/capability/libraries/Types.sol) for more details +on what the OCR configuration contains. +2. DON update: when `updateDON` is called on the CR, capabilities of the DON can be updated. In the +CCIP use case specifically, `updateDON` is used to update OCR configuration of that DON. Updates +follow the blue/green deployment pattern (explained in detail below with a state diagram). In this +scenario the launcher must either launch brand new instances of the commit and execution plugins +(in the event a green deployment is made) or promote the currently running green instance to be +the blue instance. +3. DON deletion: when `deleteDON` is called on the CR, the launcher must shut down all running plugins +related to that DON. When a DON is deleted it effectively means that it should no longer function. +DON deletion is permanent. + +## Architecture Diagram + +![CCIP Capability Launcher](ccip_capability_launcher.png) + +The above diagram shows how the CCIP capability launcher interacts with the rest of the components +in the CCIP system. + +The CCIP capability job, which is created on the Chainlink node, will spin up the CCIP capability +launcher alongside the home chain reader, which reads the [CCIPConfig.sol](../../../../contracts/src/v0.8/ccip/capability/CCIPConfig.sol) +contract deployed on the home chain (typically Ethereum Mainnet, though could be "any chain" in theory). + +Injected into the launcher is the [OracleCreator](../types/types.go) object which knows how to spin up CCIP +oracles (both bootstrap and plugin oracles). This is used by the launcher at the appropriate time in order +to create oracle instances but not start them right away. + +After all the required oracles have been created, the launcher will start and shut them down as required +in order to match the configuration that was posted on-chain in the CR and the CCIPConfig.sol contract. + + +## Config State Diagram + +![CCIP Config State Machine](ccip_config_state_machine.png) + +CCIP's blue/green deployment paradigm is intentionally kept as simple as possible. + +Every CCIP DON starts in the `Init` state. Upon DON creation, which must provide a valid OCR +configuration, the CCIP DON will move into the `Running` state. In this state, the DON is +presumed to be fully functional from a configuration standpoint. + +When we want to update configuration, we propose a new configuration to the CR that consists of +an array of two OCR configurations: + +1. The first element of the array is the current OCR configuration that is running (termed "blue"). +2. The second element of the array is the future OCR configuration that we want to run (termed "green"). + +Various checks are done on-chain in order to validate this particular state transition, in particular, +related to config counts. Doing this will move the state of the configuration to the `Staging` state. + +In the `Staging` state, there are effectively four plugins running - one (commit, execution) pair for the +blue configuration, and one (commit, execution) pair for the green configuration. However, only the blue +configuration will actually be writing on-chain, where as the green configuration will be "dry running", +i.e doing everything except transmitting. + +This allows us to test out new configurations without committing to them immediately. + +Finally, from the `Staging` state, there is only one transition, which is to promote the green configuration +to be the new blue configuration, and go back into the `Running` state. diff --git a/core/capabilities/ccip/launcher/bluegreen.go b/core/capabilities/ccip/launcher/bluegreen.go new file mode 100644 index 00000000000..c15f8c038f6 --- /dev/null +++ b/core/capabilities/ccip/launcher/bluegreen.go @@ -0,0 +1,132 @@ +package launcher + +import ( + "fmt" + + cctypes "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/types" + + "go.uber.org/multierr" + + ccipreaderpkg "github.com/smartcontractkit/chainlink-ccip/pkg/reader" +) + +// blueGreenDeployment represents a blue-green deployment of OCR instances. +type blueGreenDeployment struct { + // blue is the blue OCR instance. + // blue must always be present. + blue cctypes.CCIPOracle + + // green is the green OCR instance. + // green may or may not be present. + // green must never be present if blue is not present. + // TODO: should we enforce this invariant somehow? + green cctypes.CCIPOracle +} + +// ccipDeployment represents blue-green deployments of both commit and exec +// OCR instances. +type ccipDeployment struct { + commit blueGreenDeployment + exec blueGreenDeployment +} + +// Close shuts down all OCR instances in the deployment. +func (c *ccipDeployment) Close() error { + var err error + + // shutdown blue commit instance. + err = multierr.Append(err, c.commit.blue.Close()) + + // shutdown green commit instance. + if c.commit.green != nil { + err = multierr.Append(err, c.commit.green.Close()) + } + + // shutdown blue exec instance. + err = multierr.Append(err, c.exec.blue.Close()) + + // shutdown green exec instance. + if c.exec.green != nil { + err = multierr.Append(err, c.exec.green.Close()) + } + + return err +} + +// StartBlue starts the blue OCR instances. +func (c *ccipDeployment) StartBlue() error { + var err error + + err = multierr.Append(err, c.commit.blue.Start()) + err = multierr.Append(err, c.exec.blue.Start()) + + return err +} + +// CloseBlue shuts down the blue OCR instances. +func (c *ccipDeployment) CloseBlue() error { + var err error + + err = multierr.Append(err, c.commit.blue.Close()) + err = multierr.Append(err, c.exec.blue.Close()) + + return err +} + +// HandleBlueGreen handles the blue-green deployment transition. +// prevDeployment is the previous deployment state. +// there are two possible cases: +// +// 1. both blue and green are present in prevDeployment, but only blue is present in c. +// this is a promotion of green to blue, so we need to shut down the blue deployment +// and make green the new blue. In this case green is already running, so there's no +// need to start it. However, we need to shut down the blue deployment. +// +// 2. only blue is present in prevDeployment, both blue and green are present in c. +// In this case, blue is already running, so there's no need to start it. We need to +// start green. +func (c *ccipDeployment) HandleBlueGreen(prevDeployment *ccipDeployment) error { + if prevDeployment == nil { + return fmt.Errorf("previous deployment is nil") + } + + var err error + if prevDeployment.commit.green != nil && c.commit.green == nil { + err = multierr.Append(err, prevDeployment.commit.blue.Close()) + } else if prevDeployment.commit.green == nil && c.commit.green != nil { + err = multierr.Append(err, c.commit.green.Start()) + } else { + return fmt.Errorf("invalid blue-green deployment transition") + } + + if prevDeployment.exec.green != nil && c.exec.green == nil { + err = multierr.Append(err, prevDeployment.exec.blue.Close()) + } else if prevDeployment.exec.green == nil && c.exec.green != nil { + err = multierr.Append(err, c.exec.green.Start()) + } else { + return fmt.Errorf("invalid blue-green deployment transition") + } + + return err +} + +// HasGreenInstance returns true if the deployment has a green instance for the +// given plugin type. +func (c *ccipDeployment) HasGreenInstance(pluginType cctypes.PluginType) bool { + switch pluginType { + case cctypes.PluginTypeCCIPCommit: + return c.commit.green != nil + case cctypes.PluginTypeCCIPExec: + return c.exec.green != nil + default: + return false + } +} + +func isNewGreenInstance(pluginType cctypes.PluginType, ocrConfigs []ccipreaderpkg.OCR3ConfigWithMeta, prevDeployment ccipDeployment) bool { + return len(ocrConfigs) == 2 && !prevDeployment.HasGreenInstance(pluginType) +} + +func isPromotion(pluginType cctypes.PluginType, ocrConfigs []ccipreaderpkg.OCR3ConfigWithMeta, prevDeployment ccipDeployment) bool { + return len(ocrConfigs) == 1 && prevDeployment.HasGreenInstance(pluginType) +} diff --git a/core/capabilities/ccip/launcher/bluegreen_test.go b/core/capabilities/ccip/launcher/bluegreen_test.go new file mode 100644 index 00000000000..965491180e6 --- /dev/null +++ b/core/capabilities/ccip/launcher/bluegreen_test.go @@ -0,0 +1,681 @@ +package launcher + +import ( + "errors" + "testing" + + cctypes "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/types" + mocktypes "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/types/mocks" + + "github.com/stretchr/testify/require" + + ccipreaderpkg "github.com/smartcontractkit/chainlink-ccip/pkg/reader" +) + +func Test_ccipDeployment_Close(t *testing.T) { + type args struct { + commitBlue *mocktypes.CCIPOracle + commitGreen *mocktypes.CCIPOracle + execBlue *mocktypes.CCIPOracle + execGreen *mocktypes.CCIPOracle + } + tests := []struct { + name string + args args + expect func(t *testing.T, args args) + asserts func(t *testing.T, args args) + wantErr bool + }{ + { + name: "no errors, blue only", + args: args{ + commitBlue: mocktypes.NewCCIPOracle(t), + commitGreen: nil, + execBlue: mocktypes.NewCCIPOracle(t), + execGreen: nil, + }, + expect: func(t *testing.T, args args) { + args.commitBlue.On("Close").Return(nil).Once() + args.execBlue.On("Close").Return(nil).Once() + }, + asserts: func(t *testing.T, args args) { + args.commitBlue.AssertExpectations(t) + args.execBlue.AssertExpectations(t) + }, + wantErr: false, + }, + { + name: "no errors, blue and green", + args: args{ + commitBlue: mocktypes.NewCCIPOracle(t), + commitGreen: mocktypes.NewCCIPOracle(t), + execBlue: mocktypes.NewCCIPOracle(t), + execGreen: mocktypes.NewCCIPOracle(t), + }, + expect: func(t *testing.T, args args) { + args.commitBlue.On("Close").Return(nil).Once() + args.commitGreen.On("Close").Return(nil).Once() + args.execBlue.On("Close").Return(nil).Once() + args.execGreen.On("Close").Return(nil).Once() + }, + asserts: func(t *testing.T, args args) { + args.commitBlue.AssertExpectations(t) + args.commitGreen.AssertExpectations(t) + args.execBlue.AssertExpectations(t) + args.execGreen.AssertExpectations(t) + }, + wantErr: false, + }, + { + name: "error on commit blue", + args: args{ + commitBlue: mocktypes.NewCCIPOracle(t), + commitGreen: nil, + execBlue: mocktypes.NewCCIPOracle(t), + execGreen: nil, + }, + expect: func(t *testing.T, args args) { + args.commitBlue.On("Close").Return(errors.New("failed")).Once() + args.execBlue.On("Close").Return(nil).Once() + }, + asserts: func(t *testing.T, args args) { + args.commitBlue.AssertExpectations(t) + args.execBlue.AssertExpectations(t) + }, + wantErr: true, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + c := &ccipDeployment{ + commit: blueGreenDeployment{ + blue: tt.args.commitBlue, + }, + exec: blueGreenDeployment{ + blue: tt.args.execBlue, + }, + } + if tt.args.commitGreen != nil { + c.commit.green = tt.args.commitGreen + } + + if tt.args.execGreen != nil { + c.exec.green = tt.args.execGreen + } + + tt.expect(t, tt.args) + defer tt.asserts(t, tt.args) + err := c.Close() + if tt.wantErr { + require.Error(t, err) + } else { + require.NoError(t, err) + } + }) + } +} + +func Test_ccipDeployment_StartBlue(t *testing.T) { + type args struct { + commitBlue *mocktypes.CCIPOracle + execBlue *mocktypes.CCIPOracle + } + tests := []struct { + name string + args args + expect func(t *testing.T, args args) + asserts func(t *testing.T, args args) + wantErr bool + }{ + { + name: "no errors", + args: args{ + commitBlue: mocktypes.NewCCIPOracle(t), + execBlue: mocktypes.NewCCIPOracle(t), + }, + expect: func(t *testing.T, args args) { + args.commitBlue.On("Start").Return(nil).Once() + args.execBlue.On("Start").Return(nil).Once() + }, + asserts: func(t *testing.T, args args) { + args.commitBlue.AssertExpectations(t) + args.execBlue.AssertExpectations(t) + }, + wantErr: false, + }, + { + name: "error on commit blue", + args: args{ + commitBlue: mocktypes.NewCCIPOracle(t), + execBlue: mocktypes.NewCCIPOracle(t), + }, + expect: func(t *testing.T, args args) { + args.commitBlue.On("Start").Return(errors.New("failed")).Once() + args.execBlue.On("Start").Return(nil).Once() + }, + asserts: func(t *testing.T, args args) { + args.commitBlue.AssertExpectations(t) + args.execBlue.AssertExpectations(t) + }, + wantErr: true, + }, + { + name: "error on exec blue", + args: args{ + commitBlue: mocktypes.NewCCIPOracle(t), + execBlue: mocktypes.NewCCIPOracle(t), + }, + expect: func(t *testing.T, args args) { + args.commitBlue.On("Start").Return(nil).Once() + args.execBlue.On("Start").Return(errors.New("failed")).Once() + }, + asserts: func(t *testing.T, args args) { + args.commitBlue.AssertExpectations(t) + args.execBlue.AssertExpectations(t) + }, + wantErr: true, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + c := &ccipDeployment{ + commit: blueGreenDeployment{ + blue: tt.args.commitBlue, + }, + exec: blueGreenDeployment{ + blue: tt.args.execBlue, + }, + } + + tt.expect(t, tt.args) + defer tt.asserts(t, tt.args) + err := c.StartBlue() + if tt.wantErr { + require.Error(t, err) + } else { + require.NoError(t, err) + } + }) + } +} + +func Test_ccipDeployment_CloseBlue(t *testing.T) { + type args struct { + commitBlue *mocktypes.CCIPOracle + execBlue *mocktypes.CCIPOracle + } + tests := []struct { + name string + args args + expect func(t *testing.T, args args) + asserts func(t *testing.T, args args) + wantErr bool + }{ + { + name: "no errors", + args: args{ + commitBlue: mocktypes.NewCCIPOracle(t), + execBlue: mocktypes.NewCCIPOracle(t), + }, + expect: func(t *testing.T, args args) { + args.commitBlue.On("Close").Return(nil).Once() + args.execBlue.On("Close").Return(nil).Once() + }, + asserts: func(t *testing.T, args args) { + args.commitBlue.AssertExpectations(t) + args.execBlue.AssertExpectations(t) + }, + wantErr: false, + }, + { + name: "error on commit blue", + args: args{ + commitBlue: mocktypes.NewCCIPOracle(t), + execBlue: mocktypes.NewCCIPOracle(t), + }, + expect: func(t *testing.T, args args) { + args.commitBlue.On("Close").Return(errors.New("failed")).Once() + args.execBlue.On("Close").Return(nil).Once() + }, + asserts: func(t *testing.T, args args) { + args.commitBlue.AssertExpectations(t) + args.execBlue.AssertExpectations(t) + }, + wantErr: true, + }, + { + name: "error on exec blue", + args: args{ + commitBlue: mocktypes.NewCCIPOracle(t), + execBlue: mocktypes.NewCCIPOracle(t), + }, + expect: func(t *testing.T, args args) { + args.commitBlue.On("Close").Return(nil).Once() + args.execBlue.On("Close").Return(errors.New("failed")).Once() + }, + asserts: func(t *testing.T, args args) { + args.commitBlue.AssertExpectations(t) + args.execBlue.AssertExpectations(t) + }, + wantErr: true, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + c := &ccipDeployment{ + commit: blueGreenDeployment{ + blue: tt.args.commitBlue, + }, + exec: blueGreenDeployment{ + blue: tt.args.execBlue, + }, + } + + tt.expect(t, tt.args) + defer tt.asserts(t, tt.args) + err := c.CloseBlue() + if tt.wantErr { + require.Error(t, err) + } else { + require.NoError(t, err) + } + }) + } +} + +func Test_ccipDeployment_HandleBlueGreen_PrevDeploymentNil(t *testing.T) { + require.Error(t, (&ccipDeployment{}).HandleBlueGreen(nil)) +} + +func Test_ccipDeployment_HandleBlueGreen(t *testing.T) { + type args struct { + commitBlue *mocktypes.CCIPOracle + commitGreen *mocktypes.CCIPOracle + execBlue *mocktypes.CCIPOracle + execGreen *mocktypes.CCIPOracle + } + tests := []struct { + name string + argsPrevDeployment args + argsFutureDeployment args + expect func(t *testing.T, args args, argsPrevDeployment args) + asserts func(t *testing.T, args args, argsPrevDeployment args) + wantErr bool + }{ + { + name: "promotion blue to green", + argsPrevDeployment: args{ + commitBlue: mocktypes.NewCCIPOracle(t), + commitGreen: mocktypes.NewCCIPOracle(t), + execBlue: mocktypes.NewCCIPOracle(t), + execGreen: mocktypes.NewCCIPOracle(t), + }, + argsFutureDeployment: args{ + commitBlue: mocktypes.NewCCIPOracle(t), + commitGreen: nil, + execBlue: mocktypes.NewCCIPOracle(t), + execGreen: nil, + }, + expect: func(t *testing.T, args args, argsPrevDeployment args) { + argsPrevDeployment.commitBlue.On("Close").Return(nil).Once() + argsPrevDeployment.execBlue.On("Close").Return(nil).Once() + }, + asserts: func(t *testing.T, args args, argsPrevDeployment args) { + argsPrevDeployment.commitBlue.AssertExpectations(t) + argsPrevDeployment.execBlue.AssertExpectations(t) + }, + wantErr: false, + }, + { + name: "new green deployment", + argsPrevDeployment: args{ + commitBlue: mocktypes.NewCCIPOracle(t), + commitGreen: nil, + execBlue: mocktypes.NewCCIPOracle(t), + execGreen: nil, + }, + argsFutureDeployment: args{ + commitBlue: mocktypes.NewCCIPOracle(t), + commitGreen: mocktypes.NewCCIPOracle(t), + execBlue: mocktypes.NewCCIPOracle(t), + execGreen: mocktypes.NewCCIPOracle(t), + }, + expect: func(t *testing.T, args args, argsPrevDeployment args) { + args.commitGreen.On("Start").Return(nil).Once() + args.execGreen.On("Start").Return(nil).Once() + }, + asserts: func(t *testing.T, args args, argsPrevDeployment args) { + args.commitGreen.AssertExpectations(t) + args.execGreen.AssertExpectations(t) + }, + wantErr: false, + }, + { + name: "error on commit green start", + argsPrevDeployment: args{ + commitBlue: mocktypes.NewCCIPOracle(t), + commitGreen: nil, + execBlue: mocktypes.NewCCIPOracle(t), + execGreen: nil, + }, + argsFutureDeployment: args{ + commitBlue: mocktypes.NewCCIPOracle(t), + commitGreen: mocktypes.NewCCIPOracle(t), + execBlue: mocktypes.NewCCIPOracle(t), + execGreen: mocktypes.NewCCIPOracle(t), + }, + expect: func(t *testing.T, args args, argsPrevDeployment args) { + args.commitGreen.On("Start").Return(errors.New("failed")).Once() + args.execGreen.On("Start").Return(nil).Once() + }, + asserts: func(t *testing.T, args args, argsPrevDeployment args) { + args.commitGreen.AssertExpectations(t) + args.execGreen.AssertExpectations(t) + }, + wantErr: true, + }, + { + name: "error on exec green start", + argsPrevDeployment: args{ + commitBlue: mocktypes.NewCCIPOracle(t), + commitGreen: nil, + execBlue: mocktypes.NewCCIPOracle(t), + execGreen: nil, + }, + argsFutureDeployment: args{ + commitBlue: mocktypes.NewCCIPOracle(t), + commitGreen: mocktypes.NewCCIPOracle(t), + execBlue: mocktypes.NewCCIPOracle(t), + execGreen: mocktypes.NewCCIPOracle(t), + }, + expect: func(t *testing.T, args args, argsPrevDeployment args) { + args.commitGreen.On("Start").Return(nil).Once() + args.execGreen.On("Start").Return(errors.New("failed")).Once() + }, + asserts: func(t *testing.T, args args, argsPrevDeployment args) { + args.commitGreen.AssertExpectations(t) + args.execGreen.AssertExpectations(t) + }, + wantErr: true, + }, + { + name: "invalid blue-green deployment transition commit: both prev and future deployment have green", + argsPrevDeployment: args{ + commitBlue: mocktypes.NewCCIPOracle(t), + commitGreen: mocktypes.NewCCIPOracle(t), + execBlue: mocktypes.NewCCIPOracle(t), + execGreen: mocktypes.NewCCIPOracle(t), + }, + argsFutureDeployment: args{ + commitBlue: mocktypes.NewCCIPOracle(t), + commitGreen: mocktypes.NewCCIPOracle(t), + execBlue: mocktypes.NewCCIPOracle(t), + execGreen: mocktypes.NewCCIPOracle(t), + }, + expect: func(t *testing.T, args args, argsPrevDeployment args) {}, + asserts: func(t *testing.T, args args, argsPrevDeployment args) {}, + wantErr: true, + }, + { + name: "invalid blue-green deployment transition exec: both prev and future exec deployment have green", + argsPrevDeployment: args{ + commitBlue: mocktypes.NewCCIPOracle(t), + commitGreen: nil, + execBlue: mocktypes.NewCCIPOracle(t), + execGreen: mocktypes.NewCCIPOracle(t), + }, + argsFutureDeployment: args{ + commitBlue: mocktypes.NewCCIPOracle(t), + commitGreen: mocktypes.NewCCIPOracle(t), + execBlue: mocktypes.NewCCIPOracle(t), + execGreen: mocktypes.NewCCIPOracle(t), + }, + expect: func(t *testing.T, args args, argsPrevDeployment args) { + args.commitGreen.On("Start").Return(nil).Once() + }, + asserts: func(t *testing.T, args args, argsPrevDeployment args) { + args.commitGreen.AssertExpectations(t) + }, + wantErr: true, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + futDeployment := &ccipDeployment{ + commit: blueGreenDeployment{ + blue: tt.argsFutureDeployment.commitBlue, + }, + exec: blueGreenDeployment{ + blue: tt.argsFutureDeployment.execBlue, + }, + } + if tt.argsFutureDeployment.commitGreen != nil { + futDeployment.commit.green = tt.argsFutureDeployment.commitGreen + } + if tt.argsFutureDeployment.execGreen != nil { + futDeployment.exec.green = tt.argsFutureDeployment.execGreen + } + + prevDeployment := &ccipDeployment{ + commit: blueGreenDeployment{ + blue: tt.argsPrevDeployment.commitBlue, + }, + exec: blueGreenDeployment{ + blue: tt.argsPrevDeployment.execBlue, + }, + } + if tt.argsPrevDeployment.commitGreen != nil { + prevDeployment.commit.green = tt.argsPrevDeployment.commitGreen + } + if tt.argsPrevDeployment.execGreen != nil { + prevDeployment.exec.green = tt.argsPrevDeployment.execGreen + } + + tt.expect(t, tt.argsFutureDeployment, tt.argsPrevDeployment) + defer tt.asserts(t, tt.argsFutureDeployment, tt.argsPrevDeployment) + err := futDeployment.HandleBlueGreen(prevDeployment) + if tt.wantErr { + require.Error(t, err) + } else { + require.NoError(t, err) + } + }) + } +} + +func Test_isNewGreenInstance(t *testing.T) { + type args struct { + pluginType cctypes.PluginType + ocrConfigs []ccipreaderpkg.OCR3ConfigWithMeta + prevDeployment ccipDeployment + } + tests := []struct { + name string + args args + want bool + }{ + { + "prev deployment only blue", + args{ + pluginType: cctypes.PluginTypeCCIPCommit, + ocrConfigs: []ccipreaderpkg.OCR3ConfigWithMeta{ + {}, {}, + }, + prevDeployment: ccipDeployment{ + commit: blueGreenDeployment{ + blue: mocktypes.NewCCIPOracle(t), + }, + }, + }, + true, + }, + { + "green -> blue promotion", + args{ + pluginType: cctypes.PluginTypeCCIPCommit, + ocrConfigs: []ccipreaderpkg.OCR3ConfigWithMeta{ + {}, + }, + prevDeployment: ccipDeployment{ + commit: blueGreenDeployment{ + blue: mocktypes.NewCCIPOracle(t), + green: mocktypes.NewCCIPOracle(t), + }, + }, + }, + false, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + got := isNewGreenInstance(tt.args.pluginType, tt.args.ocrConfigs, tt.args.prevDeployment) + require.Equal(t, tt.want, got) + }) + } +} + +func Test_isPromotion(t *testing.T) { + type args struct { + pluginType cctypes.PluginType + ocrConfigs []ccipreaderpkg.OCR3ConfigWithMeta + prevDeployment ccipDeployment + } + tests := []struct { + name string + args args + want bool + }{ + { + "prev deployment only blue", + args{ + pluginType: cctypes.PluginTypeCCIPCommit, + ocrConfigs: []ccipreaderpkg.OCR3ConfigWithMeta{ + {}, {}, + }, + prevDeployment: ccipDeployment{ + commit: blueGreenDeployment{ + blue: mocktypes.NewCCIPOracle(t), + }, + }, + }, + false, + }, + { + "green -> blue promotion", + args{ + pluginType: cctypes.PluginTypeCCIPCommit, + ocrConfigs: []ccipreaderpkg.OCR3ConfigWithMeta{ + {}, + }, + prevDeployment: ccipDeployment{ + commit: blueGreenDeployment{ + blue: mocktypes.NewCCIPOracle(t), + green: mocktypes.NewCCIPOracle(t), + }, + }, + }, + true, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + if got := isPromotion(tt.args.pluginType, tt.args.ocrConfigs, tt.args.prevDeployment); got != tt.want { + t.Errorf("isPromotion() = %v, want %v", got, tt.want) + } + }) + } +} + +func Test_ccipDeployment_HasGreenInstance(t *testing.T) { + type fields struct { + commit blueGreenDeployment + exec blueGreenDeployment + } + type args struct { + pluginType cctypes.PluginType + } + tests := []struct { + name string + fields fields + args args + want bool + }{ + { + "commit green present", + fields{ + commit: blueGreenDeployment{ + blue: mocktypes.NewCCIPOracle(t), + green: mocktypes.NewCCIPOracle(t), + }, + }, + args{ + pluginType: cctypes.PluginTypeCCIPCommit, + }, + true, + }, + { + "commit green not present", + fields{ + commit: blueGreenDeployment{ + blue: mocktypes.NewCCIPOracle(t), + }, + }, + args{ + pluginType: cctypes.PluginTypeCCIPCommit, + }, + false, + }, + { + "exec green present", + fields{ + exec: blueGreenDeployment{ + blue: mocktypes.NewCCIPOracle(t), + green: mocktypes.NewCCIPOracle(t), + }, + }, + args{ + pluginType: cctypes.PluginTypeCCIPExec, + }, + true, + }, + { + "exec green not present", + fields{ + exec: blueGreenDeployment{ + blue: mocktypes.NewCCIPOracle(t), + }, + }, + args{ + pluginType: cctypes.PluginTypeCCIPExec, + }, + false, + }, + { + "invalid plugin type", + fields{}, + args{ + pluginType: cctypes.PluginType(100), + }, + false, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + c := &ccipDeployment{} + if tt.fields.commit.blue != nil { + c.commit.blue = tt.fields.commit.blue + } + if tt.fields.commit.green != nil { + c.commit.green = tt.fields.commit.green + } + if tt.fields.exec.blue != nil { + c.exec.blue = tt.fields.exec.blue + } + if tt.fields.exec.green != nil { + c.exec.green = tt.fields.exec.green + } + got := c.HasGreenInstance(tt.args.pluginType) + require.Equal(t, tt.want, got) + }) + } +} diff --git a/core/capabilities/ccip/launcher/ccip_capability_launcher.png b/core/capabilities/ccip/launcher/ccip_capability_launcher.png new file mode 100644 index 00000000000..5e90d5ff7da Binary files /dev/null and b/core/capabilities/ccip/launcher/ccip_capability_launcher.png differ diff --git a/core/capabilities/ccip/launcher/ccip_config_state_machine.png b/core/capabilities/ccip/launcher/ccip_config_state_machine.png new file mode 100644 index 00000000000..ece40e6c19e Binary files /dev/null and b/core/capabilities/ccip/launcher/ccip_config_state_machine.png differ diff --git a/core/capabilities/ccip/launcher/diff.go b/core/capabilities/ccip/launcher/diff.go new file mode 100644 index 00000000000..de429deedc1 --- /dev/null +++ b/core/capabilities/ccip/launcher/diff.go @@ -0,0 +1,128 @@ +package launcher + +import ( + "fmt" + + ragep2ptypes "github.com/smartcontractkit/libocr/ragep2p/types" + + "github.com/smartcontractkit/chainlink/v2/core/services/registrysyncer" +) + +// diffResult contains the added, removed and updated CCIP DONs. +// It is determined by using the `diff` function below. +type diffResult struct { + added map[registrysyncer.DonID]registrysyncer.DON + removed map[registrysyncer.DonID]registrysyncer.DON + updated map[registrysyncer.DonID]registrysyncer.DON +} + +// diff compares the old and new state and returns the added, removed and updated CCIP DONs. +func diff( + capabilityID string, + oldState, + newState registrysyncer.LocalRegistry, +) (diffResult, error) { + ccipCapability, err := checkCapabilityPresence(capabilityID, newState) + if err != nil { + return diffResult{}, fmt.Errorf("failed to check capability presence: %w", err) + } + + newCCIPDONs, err := filterCCIPDONs(ccipCapability, newState) + if err != nil { + return diffResult{}, fmt.Errorf("failed to filter CCIP DONs from new state: %w", err) + } + + currCCIPDONs, err := filterCCIPDONs(ccipCapability, oldState) + if err != nil { + return diffResult{}, fmt.Errorf("failed to filter CCIP DONs from old state: %w", err) + } + + // compare curr with new and launch or update OCR instances as needed + diffRes, err := compareDONs(currCCIPDONs, newCCIPDONs) + if err != nil { + return diffResult{}, fmt.Errorf("failed to compare CCIP DONs: %w", err) + } + + return diffRes, nil +} + +// compareDONs compares the current and new CCIP DONs and returns the added, removed and updated DONs. +func compareDONs( + currCCIPDONs, + newCCIPDONs map[registrysyncer.DonID]registrysyncer.DON, +) ( + dr diffResult, + err error, +) { + added := make(map[registrysyncer.DonID]registrysyncer.DON) + removed := make(map[registrysyncer.DonID]registrysyncer.DON) + updated := make(map[registrysyncer.DonID]registrysyncer.DON) + + for id, don := range newCCIPDONs { + if currDONState, ok := currCCIPDONs[id]; !ok { + // Not in current state, so mark as added. + added[id] = don + } else { + // If its in the current state and the config count for the DON has changed, mark as updated. + // Since the registry returns the full state we need to compare the config count. + if don.ConfigVersion > currDONState.ConfigVersion { + updated[id] = don + } + } + } + + for id, don := range currCCIPDONs { + if _, ok := newCCIPDONs[id]; !ok { + // In current state but not in latest registry state, so should remove. + removed[id] = don + } + } + + return diffResult{ + added: added, + removed: removed, + updated: updated, + }, nil +} + +// filterCCIPDONs filters the CCIP DONs from the given state. +func filterCCIPDONs( + ccipCapability registrysyncer.Capability, + state registrysyncer.LocalRegistry, +) (map[registrysyncer.DonID]registrysyncer.DON, error) { + ccipDONs := make(map[registrysyncer.DonID]registrysyncer.DON) + for _, don := range state.IDsToDONs { + _, ok := don.CapabilityConfigurations[ccipCapability.ID] + if ok { + ccipDONs[registrysyncer.DonID(don.ID)] = don + } + } + + return ccipDONs, nil +} + +// checkCapabilityPresence checks if the capability with the given capabilityID +// is present in the given capability registry state. +func checkCapabilityPresence( + capabilityID string, + state registrysyncer.LocalRegistry, +) (registrysyncer.Capability, error) { + // Sanity check to make sure the capability registry has the capability we are looking for. + ccipCapability, ok := state.IDsToCapabilities[capabilityID] + if !ok { + return registrysyncer.Capability{}, + fmt.Errorf("failed to find capability with capabilityID %s in capability registry state", capabilityID) + } + + return ccipCapability, nil +} + +// isMemberOfDON returns true if and only if the given p2pID is a member of the given DON. +func isMemberOfDON(don registrysyncer.DON, p2pID ragep2ptypes.PeerID) bool { + for _, node := range don.Members { + if node == p2pID { + return true + } + } + return false +} diff --git a/core/capabilities/ccip/launcher/diff_test.go b/core/capabilities/ccip/launcher/diff_test.go new file mode 100644 index 00000000000..3b168d91488 --- /dev/null +++ b/core/capabilities/ccip/launcher/diff_test.go @@ -0,0 +1,343 @@ +package launcher + +import ( + "math/big" + "reflect" + "testing" + + ragep2ptypes "github.com/smartcontractkit/libocr/ragep2p/types" + + "github.com/stretchr/testify/require" + + kcr "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/capabilities_registry" + "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" + "github.com/smartcontractkit/chainlink/v2/core/services/p2p/types" + "github.com/smartcontractkit/chainlink/v2/core/services/registrysyncer" +) + +func Test_diff(t *testing.T) { + type args struct { + capabilityID string + oldState registrysyncer.LocalRegistry + newState registrysyncer.LocalRegistry + } + tests := []struct { + name string + args args + want diffResult + wantErr bool + }{ + { + name: "no diff", + args: args{ + capabilityID: defaultCapability.ID, + oldState: registrysyncer.LocalRegistry{ + IDsToCapabilities: map[string]registrysyncer.Capability{ + defaultCapability.ID: defaultCapability, + }, + IDsToDONs: map[registrysyncer.DonID]registrysyncer.DON{ + 1: defaultRegistryDon, + }, + IDsToNodes: map[types.PeerID]kcr.CapabilitiesRegistryNodeInfo{}, + }, + newState: registrysyncer.LocalRegistry{ + IDsToCapabilities: map[string]registrysyncer.Capability{ + defaultCapability.ID: defaultCapability, + }, + IDsToDONs: map[registrysyncer.DonID]registrysyncer.DON{ + 1: defaultRegistryDon, + }, + IDsToNodes: map[types.PeerID]kcr.CapabilitiesRegistryNodeInfo{}, + }, + }, + want: diffResult{ + added: map[registrysyncer.DonID]registrysyncer.DON{}, + removed: map[registrysyncer.DonID]registrysyncer.DON{}, + updated: map[registrysyncer.DonID]registrysyncer.DON{}, + }, + }, + { + "capability not present", + args{ + capabilityID: defaultCapability.ID, + oldState: registrysyncer.LocalRegistry{ + IDsToCapabilities: map[string]registrysyncer.Capability{ + newCapability.ID: newCapability, + }, + }, + newState: registrysyncer.LocalRegistry{ + IDsToCapabilities: map[string]registrysyncer.Capability{ + newCapability.ID: newCapability, + }, + }, + }, + diffResult{}, + true, + }, + { + "diff present, new don", + args{ + capabilityID: defaultCapability.ID, + oldState: registrysyncer.LocalRegistry{ + IDsToCapabilities: map[string]registrysyncer.Capability{ + defaultCapability.ID: defaultCapability, + }, + IDsToDONs: map[registrysyncer.DonID]registrysyncer.DON{}, + }, + newState: registrysyncer.LocalRegistry{ + IDsToCapabilities: map[string]registrysyncer.Capability{ + defaultCapability.ID: defaultCapability, + }, + IDsToDONs: map[registrysyncer.DonID]registrysyncer.DON{ + 1: defaultRegistryDon, + }, + }, + }, + diffResult{ + added: map[registrysyncer.DonID]registrysyncer.DON{ + 1: defaultRegistryDon, + }, + removed: map[registrysyncer.DonID]registrysyncer.DON{}, + updated: map[registrysyncer.DonID]registrysyncer.DON{}, + }, + false, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + got, err := diff(tt.args.capabilityID, tt.args.oldState, tt.args.newState) + if tt.wantErr { + require.Error(t, err) + } else { + require.NoError(t, err) + require.Equal(t, tt.want, got) + } + }) + } +} + +func Test_compareDONs(t *testing.T) { + type args struct { + currCCIPDONs map[registrysyncer.DonID]registrysyncer.DON + newCCIPDONs map[registrysyncer.DonID]registrysyncer.DON + } + tests := []struct { + name string + args args + wantAdded map[registrysyncer.DonID]registrysyncer.DON + wantRemoved map[registrysyncer.DonID]registrysyncer.DON + wantUpdated map[registrysyncer.DonID]registrysyncer.DON + wantErr bool + }{ + { + "added dons", + args{ + currCCIPDONs: map[registrysyncer.DonID]registrysyncer.DON{}, + newCCIPDONs: map[registrysyncer.DonID]registrysyncer.DON{ + 1: defaultRegistryDon, + }, + }, + map[registrysyncer.DonID]registrysyncer.DON{ + 1: defaultRegistryDon, + }, + map[registrysyncer.DonID]registrysyncer.DON{}, + map[registrysyncer.DonID]registrysyncer.DON{}, + false, + }, + { + "removed dons", + args{ + currCCIPDONs: map[registrysyncer.DonID]registrysyncer.DON{ + 1: defaultRegistryDon, + }, + newCCIPDONs: map[registrysyncer.DonID]registrysyncer.DON{}, + }, + map[registrysyncer.DonID]registrysyncer.DON{}, + map[registrysyncer.DonID]registrysyncer.DON{ + 1: defaultRegistryDon, + }, + map[registrysyncer.DonID]registrysyncer.DON{}, + false, + }, + { + "updated dons", + args{ + currCCIPDONs: map[registrysyncer.DonID]registrysyncer.DON{ + 1: defaultRegistryDon, + }, + newCCIPDONs: map[registrysyncer.DonID]registrysyncer.DON{ + 1: { + DON: getDON(defaultRegistryDon.ID, defaultRegistryDon.Members, defaultRegistryDon.ConfigVersion+1), + CapabilityConfigurations: defaultCapCfgs, + }, + }, + }, + map[registrysyncer.DonID]registrysyncer.DON{}, + map[registrysyncer.DonID]registrysyncer.DON{}, + map[registrysyncer.DonID]registrysyncer.DON{ + 1: { + DON: getDON(defaultRegistryDon.ID, defaultRegistryDon.Members, defaultRegistryDon.ConfigVersion+1), + CapabilityConfigurations: defaultCapCfgs, + }, + }, + false, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + dr, err := compareDONs(tt.args.currCCIPDONs, tt.args.newCCIPDONs) + if tt.wantErr { + require.Error(t, err) + } else { + require.NoError(t, err) + require.Equal(t, tt.wantAdded, dr.added) + require.Equal(t, tt.wantRemoved, dr.removed) + require.Equal(t, tt.wantUpdated, dr.updated) + } + }) + } +} + +func Test_filterCCIPDONs(t *testing.T) { + type args struct { + ccipCapability registrysyncer.Capability + state registrysyncer.LocalRegistry + } + tests := []struct { + name string + args args + want map[registrysyncer.DonID]registrysyncer.DON + wantErr bool + }{ + { + "one ccip don", + args{ + ccipCapability: defaultCapability, + state: registrysyncer.LocalRegistry{ + IDsToDONs: map[registrysyncer.DonID]registrysyncer.DON{ + 1: defaultRegistryDon, + }, + }, + }, + map[registrysyncer.DonID]registrysyncer.DON{ + 1: defaultRegistryDon, + }, + false, + }, + { + "no ccip dons - different capability", + args{ + ccipCapability: newCapability, + state: registrysyncer.LocalRegistry{ + IDsToDONs: map[registrysyncer.DonID]registrysyncer.DON{ + 1: defaultRegistryDon, + }, + }, + }, + map[registrysyncer.DonID]registrysyncer.DON{}, + false, + }, + { + "don with multiple capabilities, one of them ccip", + args{ + ccipCapability: defaultCapability, + state: registrysyncer.LocalRegistry{ + IDsToDONs: map[registrysyncer.DonID]registrysyncer.DON{ + 1: { + DON: getDON(1, []ragep2ptypes.PeerID{p2pID1}, 0), + CapabilityConfigurations: map[string]registrysyncer.CapabilityConfiguration{ + defaultCapability.ID: {}, + newCapability.ID: {}, + }, + }, + }, + }, + }, + map[registrysyncer.DonID]registrysyncer.DON{ + 1: { + DON: getDON(1, []ragep2ptypes.PeerID{p2pID1}, 0), + CapabilityConfigurations: map[string]registrysyncer.CapabilityConfiguration{ + defaultCapability.ID: {}, + newCapability.ID: {}, + }, + }, + }, + false, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + got, err := filterCCIPDONs(tt.args.ccipCapability, tt.args.state) + if tt.wantErr { + require.Error(t, err) + } else { + require.NoError(t, err) + require.Equal(t, tt.want, got) + } + }) + } +} + +func Test_checkCapabilityPresence(t *testing.T) { + type args struct { + capabilityID string + state registrysyncer.LocalRegistry + } + tests := []struct { + name string + args args + want registrysyncer.Capability + wantErr bool + }{ + { + "in registry state", + args{ + capabilityID: defaultCapability.ID, + state: registrysyncer.LocalRegistry{ + IDsToCapabilities: map[string]registrysyncer.Capability{ + defaultCapability.ID: defaultCapability, + }, + }, + }, + defaultCapability, + false, + }, + { + "not in registry state", + args{ + capabilityID: defaultCapability.ID, + state: registrysyncer.LocalRegistry{ + IDsToCapabilities: map[string]registrysyncer.Capability{ + newCapability.ID: newCapability, + }, + }, + }, + registrysyncer.Capability{}, + true, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + got, err := checkCapabilityPresence(tt.args.capabilityID, tt.args.state) + if (err != nil) != tt.wantErr { + t.Errorf("checkCapabilityPresence() error = %v, wantErr %v", err, tt.wantErr) + return + } + if !reflect.DeepEqual(got, tt.want) { + t.Errorf("checkCapabilityPresence() = %v, want %v", got, tt.want) + } + }) + } +} + +func Test_isMemberOfDON(t *testing.T) { + var p2pIDs []ragep2ptypes.PeerID + for i := range [4]struct{}{} { + p2pIDs = append(p2pIDs, ragep2ptypes.PeerID(p2pkey.MustNewV2XXXTestingOnly(big.NewInt(int64(i+1))).PeerID())) + } + don := registrysyncer.DON{ + DON: getDON(1, p2pIDs, 0), + } + require.True(t, isMemberOfDON(don, ragep2ptypes.PeerID(p2pkey.MustNewV2XXXTestingOnly(big.NewInt(1)).PeerID()))) + require.False(t, isMemberOfDON(don, ragep2ptypes.PeerID(p2pkey.MustNewV2XXXTestingOnly(big.NewInt(5)).PeerID()))) +} diff --git a/core/capabilities/ccip/launcher/integration_test.go b/core/capabilities/ccip/launcher/integration_test.go new file mode 100644 index 00000000000..2680d587d1a --- /dev/null +++ b/core/capabilities/ccip/launcher/integration_test.go @@ -0,0 +1,122 @@ +package launcher + +import ( + "testing" + "time" + + it "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/ccip_integration_tests/integrationhelpers" + cctypes "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/types" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/pgtest" + p2ptypes "github.com/smartcontractkit/chainlink/v2/core/services/p2p/types" + + "github.com/onsi/gomega" + "github.com/stretchr/testify/require" + + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/ccip_config" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" + "github.com/smartcontractkit/chainlink/v2/core/logger" + "github.com/smartcontractkit/chainlink/v2/core/services/registrysyncer" +) + +func TestIntegration_Launcher(t *testing.T) { + ctx := testutils.Context(t) + lggr := logger.TestLogger(t) + uni := it.NewTestUniverse(ctx, t, lggr) + // We need 3*f + 1 p2pIDs to have enough nodes to bootstrap + var arr []int64 + n := int(it.FChainA*3 + 1) + for i := 0; i <= n; i++ { + arr = append(arr, int64(i)) + } + p2pIDs := it.P2pIDsFromInts(arr) + uni.AddCapability(p2pIDs) + + db := pgtest.NewSqlxDB(t) + regSyncer, err := registrysyncer.New(lggr, + func() (p2ptypes.PeerID, error) { + return p2pIDs[0], nil + }, + uni, + uni.CapReg.Address().String(), + registrysyncer.NewORM(db, lggr), + ) + require.NoError(t, err) + + oracleCreator := &oracleCreatorPrints{ + t: t, + } + launcher := New( + it.CapabilityID, + p2pIDs[0], + logger.TestLogger(t), + uni.HomeChainReader, + 1*time.Second, + oracleCreator, + ) + regSyncer.AddLauncher(launcher) + + require.NoError(t, launcher.Start(ctx)) + require.NoError(t, regSyncer.Start(ctx)) + t.Cleanup(func() { require.NoError(t, regSyncer.Close()) }) + t.Cleanup(func() { require.NoError(t, launcher.Close()) }) + + chainAConf := it.SetupConfigInfo(it.ChainA, p2pIDs, it.FChainA, []byte("ChainA")) + chainBConf := it.SetupConfigInfo(it.ChainB, p2pIDs[1:], it.FChainB, []byte("ChainB")) + chainCConf := it.SetupConfigInfo(it.ChainC, p2pIDs[2:], it.FChainC, []byte("ChainC")) + inputConfig := []ccip_config.CCIPConfigTypesChainConfigInfo{ + chainAConf, + chainBConf, + chainCConf, + } + _, err = uni.CcipCfg.ApplyChainConfigUpdates(uni.Transactor, nil, inputConfig) + require.NoError(t, err) + uni.Backend.Commit() + + ccipCapabilityID, err := uni.CapReg.GetHashedCapabilityId(nil, it.CcipCapabilityLabelledName, it.CcipCapabilityVersion) + require.NoError(t, err) + + uni.AddDONToRegistry( + ccipCapabilityID, + it.ChainA, + it.FChainA, + p2pIDs[1], + p2pIDs) + + gomega.NewWithT(t).Eventually(func() bool { + return len(launcher.runningDONIDs()) == 1 + }, testutils.WaitTimeout(t), testutils.TestInterval).Should(gomega.BeTrue()) +} + +type oraclePrints struct { + t *testing.T + pluginType cctypes.PluginType + config cctypes.OCR3ConfigWithMeta + isBootstrap bool +} + +func (o *oraclePrints) Start() error { + o.t.Logf("Starting oracle (pluginType: %s, isBootstrap: %t) with config %+v\n", o.pluginType, o.isBootstrap, o.config) + return nil +} + +func (o *oraclePrints) Close() error { + o.t.Logf("Closing oracle (pluginType: %s, isBootstrap: %t) with config %+v\n", o.pluginType, o.isBootstrap, o.config) + return nil +} + +type oracleCreatorPrints struct { + t *testing.T +} + +func (o *oracleCreatorPrints) Create(_ uint32, config cctypes.OCR3ConfigWithMeta) (cctypes.CCIPOracle, error) { + pluginType := cctypes.PluginType(config.Config.PluginType) + o.t.Logf("Creating plugin oracle (pluginType: %s) with config %+v\n", pluginType, config) + return &oraclePrints{pluginType: pluginType, config: config, t: o.t}, nil +} + +func (o *oracleCreatorPrints) Type() cctypes.OracleType { + return cctypes.OracleTypePlugin +} + +var _ cctypes.OracleCreator = &oracleCreatorPrints{} +var _ cctypes.CCIPOracle = &oraclePrints{} diff --git a/core/capabilities/ccip/launcher/launcher.go b/core/capabilities/ccip/launcher/launcher.go new file mode 100644 index 00000000000..7f677d50c8c --- /dev/null +++ b/core/capabilities/ccip/launcher/launcher.go @@ -0,0 +1,412 @@ +package launcher + +import ( + "context" + "fmt" + "sync" + "time" + + cctypes "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/types" + "github.com/smartcontractkit/chainlink/v2/core/logger" + "github.com/smartcontractkit/chainlink/v2/core/services/job" + p2ptypes "github.com/smartcontractkit/chainlink/v2/core/services/p2p/types" + "github.com/smartcontractkit/chainlink/v2/core/services/registrysyncer" + + "go.uber.org/multierr" + + ragep2ptypes "github.com/smartcontractkit/libocr/ragep2p/types" + + ccipreader "github.com/smartcontractkit/chainlink-ccip/pkg/reader" + + "github.com/smartcontractkit/chainlink-common/pkg/services" + + kcr "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/capabilities_registry" +) + +var ( + _ job.ServiceCtx = (*launcher)(nil) + _ registrysyncer.Launcher = (*launcher)(nil) +) + +func New( + capabilityID string, + p2pID ragep2ptypes.PeerID, + lggr logger.Logger, + homeChainReader ccipreader.HomeChain, + tickInterval time.Duration, + oracleCreator cctypes.OracleCreator, +) *launcher { + return &launcher{ + p2pID: p2pID, + capabilityID: capabilityID, + lggr: lggr, + homeChainReader: homeChainReader, + regState: registrysyncer.LocalRegistry{ + IDsToDONs: make(map[registrysyncer.DonID]registrysyncer.DON), + IDsToNodes: make(map[p2ptypes.PeerID]kcr.CapabilitiesRegistryNodeInfo), + IDsToCapabilities: make(map[string]registrysyncer.Capability), + }, + dons: make(map[registrysyncer.DonID]*ccipDeployment), + tickInterval: tickInterval, + oracleCreator: oracleCreator, + } +} + +// launcher manages the lifecycles of the CCIP capability on all chains. +type launcher struct { + services.StateMachine + + capabilityID string + p2pID ragep2ptypes.PeerID + lggr logger.Logger + homeChainReader ccipreader.HomeChain + stopChan chan struct{} + // latestState is the latest capability registry state received from the syncer. + latestState registrysyncer.LocalRegistry + // regState is the latest capability registry state that we have successfully processed. + regState registrysyncer.LocalRegistry + oracleCreator cctypes.OracleCreator + lock sync.RWMutex + wg sync.WaitGroup + tickInterval time.Duration + + // dons is a map of CCIP DON IDs to the OCR instances that are running on them. + // we can have up to two OCR instances per CCIP plugin, since we are running two plugins, + // thats four OCR instances per CCIP DON maximum. + dons map[registrysyncer.DonID]*ccipDeployment +} + +// Launch implements registrysyncer.Launcher. +func (l *launcher) Launch(ctx context.Context, state *registrysyncer.LocalRegistry) error { + l.lock.Lock() + defer l.lock.Unlock() + l.lggr.Debugw("Received new state from syncer", "dons", state.IDsToDONs) + l.latestState = *state + return nil +} + +func (l *launcher) getLatestState() registrysyncer.LocalRegistry { + l.lock.RLock() + defer l.lock.RUnlock() + return l.latestState +} + +func (l *launcher) runningDONIDs() []registrysyncer.DonID { + l.lock.RLock() + defer l.lock.RUnlock() + var runningDONs []registrysyncer.DonID + for id := range l.dons { + runningDONs = append(runningDONs, id) + } + return runningDONs +} + +// Close implements job.ServiceCtx. +func (l *launcher) Close() error { + return l.StateMachine.StopOnce("launcher", func() error { + // shut down the monitor goroutine. + close(l.stopChan) + l.wg.Wait() + + // shut down all running oracles. + var err error + for _, ceDep := range l.dons { + err = multierr.Append(err, ceDep.Close()) + } + + return err + }) +} + +// Start implements job.ServiceCtx. +func (l *launcher) Start(context.Context) error { + return l.StartOnce("launcher", func() error { + l.stopChan = make(chan struct{}) + l.wg.Add(1) + go l.monitor() + return nil + }) +} + +func (l *launcher) monitor() { + defer l.wg.Done() + ticker := time.NewTicker(l.tickInterval) + for { + select { + case <-l.stopChan: + return + case <-ticker.C: + if err := l.tick(); err != nil { + l.lggr.Errorw("Failed to tick", "err", err) + } + } + } +} + +func (l *launcher) tick() error { + // Ensure that the home chain reader is healthy. + // For new jobs it may be possible that the home chain reader is not yet ready + // so we won't be able to fetch configs and start any OCR instances. + if ready := l.homeChainReader.Ready(); ready != nil { + return fmt.Errorf("home chain reader is not ready: %w", ready) + } + + // Fetch the latest state from the capability registry and determine if we need to + // launch or update any OCR instances. + latestState := l.getLatestState() + + diffRes, err := diff(l.capabilityID, l.regState, latestState) + if err != nil { + return fmt.Errorf("failed to diff capability registry states: %w", err) + } + + err = l.processDiff(diffRes) + if err != nil { + return fmt.Errorf("failed to process diff: %w", err) + } + + return nil +} + +// processDiff processes the diff between the current and latest capability registry states. +// for any added OCR instances, it will launch them. +// for any removed OCR instances, it will shut them down. +// for any updated OCR instances, it will restart them with the new configuration. +func (l *launcher) processDiff(diff diffResult) error { + err := l.processRemoved(diff.removed) + err = multierr.Append(err, l.processAdded(diff.added)) + err = multierr.Append(err, l.processUpdate(diff.updated)) + + return err +} + +func (l *launcher) processUpdate(updated map[registrysyncer.DonID]registrysyncer.DON) error { + l.lock.Lock() + defer l.lock.Unlock() + + for donID, don := range updated { + prevDeployment, ok := l.dons[registrysyncer.DonID(don.ID)] + if !ok { + return fmt.Errorf("invariant violation: expected to find CCIP DON %d in the map of running deployments", don.ID) + } + + futDeployment, err := updateDON( + l.lggr, + l.p2pID, + l.homeChainReader, + *prevDeployment, + don, + l.oracleCreator, + ) + if err != nil { + return err + } + if err := futDeployment.HandleBlueGreen(prevDeployment); err != nil { + // TODO: how to handle a failed blue-green deployment? + return fmt.Errorf("failed to handle blue-green deployment for CCIP DON %d: %w", donID, err) + } + + // update state. + l.dons[donID] = futDeployment + // update the state with the latest config. + // this way if one of the starts errors, we don't retry all of them. + l.regState.IDsToDONs[donID] = updated[donID] + } + + return nil +} + +func (l *launcher) processAdded(added map[registrysyncer.DonID]registrysyncer.DON) error { + l.lock.Lock() + defer l.lock.Unlock() + + for donID, don := range added { + dep, err := createDON( + l.lggr, + l.p2pID, + l.homeChainReader, + don, + l.oracleCreator, + ) + if err != nil { + return err + } + if dep == nil { + // not a member of this DON. + continue + } + + if err := dep.StartBlue(); err != nil { + if shutdownErr := dep.CloseBlue(); shutdownErr != nil { + l.lggr.Errorw("Failed to shutdown blue instance after failed start", "donId", donID, "err", shutdownErr) + } + return fmt.Errorf("failed to start oracles for CCIP DON %d: %w", donID, err) + } + + // update state. + l.dons[donID] = dep + // update the state with the latest config. + // this way if one of the starts errors, we don't retry all of them. + l.regState.IDsToDONs[donID] = added[donID] + } + + return nil +} + +func (l *launcher) processRemoved(removed map[registrysyncer.DonID]registrysyncer.DON) error { + l.lock.Lock() + defer l.lock.Unlock() + + for id := range removed { + ceDep, ok := l.dons[id] + if !ok { + // not running this particular DON. + continue + } + + if err := ceDep.Close(); err != nil { + return fmt.Errorf("failed to shutdown oracles for CCIP DON %d: %w", id, err) + } + + // after a successful shutdown we can safely remove the DON deployment from the map. + delete(l.dons, id) + delete(l.regState.IDsToDONs, id) + } + + return nil +} + +// updateDON is a pure function that handles the case where a DON in the capability registry +// has received a new configuration. +// It returns a new ccipDeployment that can then be used to perform the blue-green deployment, +// based on the previous deployment. +func updateDON( + lggr logger.Logger, + p2pID ragep2ptypes.PeerID, + homeChainReader ccipreader.HomeChain, + prevDeployment ccipDeployment, + don registrysyncer.DON, + oracleCreator cctypes.OracleCreator, +) (futDeployment *ccipDeployment, err error) { + if !isMemberOfDON(don, p2pID) { + lggr.Infow("Not a member of this DON, skipping", "donId", don.ID, "p2pId", p2pID.String()) + return nil, nil + } + + // this should be a retryable error. + commitOCRConfigs, err := homeChainReader.GetOCRConfigs(context.Background(), don.ID, uint8(cctypes.PluginTypeCCIPCommit)) + if err != nil { + return nil, fmt.Errorf("failed to fetch OCR configs for CCIP commit plugin (don id: %d) from home chain config contract: %w", + don.ID, err) + } + + execOCRConfigs, err := homeChainReader.GetOCRConfigs(context.Background(), don.ID, uint8(cctypes.PluginTypeCCIPExec)) + if err != nil { + return nil, fmt.Errorf("failed to fetch OCR configs for CCIP exec plugin (don id: %d) from home chain config contract: %w", + don.ID, err) + } + + commitBgd, err := createFutureBlueGreenDeployment(don.ID, prevDeployment, commitOCRConfigs, oracleCreator, cctypes.PluginTypeCCIPCommit) + if err != nil { + return nil, fmt.Errorf("failed to create future blue-green deployment for CCIP commit plugin: %w, don id: %d", err, don.ID) + } + + execBgd, err := createFutureBlueGreenDeployment(don.ID, prevDeployment, execOCRConfigs, oracleCreator, cctypes.PluginTypeCCIPExec) + if err != nil { + return nil, fmt.Errorf("failed to create future blue-green deployment for CCIP exec plugin: %w, don id: %d", err, don.ID) + } + + return &ccipDeployment{ + commit: commitBgd, + exec: execBgd, + }, nil +} + +// valid cases: +// a) len(ocrConfigs) == 2 && !prevDeployment.HasGreenInstance(pluginType): this is a new green instance. +// b) len(ocrConfigs) == 1 && prevDeployment.HasGreenInstance(): this is a promotion of green->blue. +// All other cases are invalid. This is enforced in the ccip config contract. +func createFutureBlueGreenDeployment( + donID uint32, + prevDeployment ccipDeployment, + ocrConfigs []ccipreader.OCR3ConfigWithMeta, + oracleCreator cctypes.OracleCreator, + pluginType cctypes.PluginType, +) (blueGreenDeployment, error) { + var deployment blueGreenDeployment + if isNewGreenInstance(pluginType, ocrConfigs, prevDeployment) { + // this is a new green instance. + greenOracle, err := oracleCreator.Create(donID, cctypes.OCR3ConfigWithMeta(ocrConfigs[1])) + if err != nil { + return blueGreenDeployment{}, fmt.Errorf("failed to create CCIP commit oracle: %w", err) + } + + deployment.blue = prevDeployment.commit.blue + deployment.green = greenOracle + } else if isPromotion(pluginType, ocrConfigs, prevDeployment) { + // this is a promotion of green->blue. + deployment.blue = prevDeployment.commit.green + } else { + return blueGreenDeployment{}, fmt.Errorf("invariant violation: expected 1 or 2 OCR configs for CCIP plugin (type: %d), got %d", pluginType, len(ocrConfigs)) + } + + return deployment, nil +} + +// createDON is a pure function that handles the case where a new DON is added to the capability registry. +// It returns a new ccipDeployment that can then be used to start the blue instance. +func createDON( + lggr logger.Logger, + p2pID ragep2ptypes.PeerID, + homeChainReader ccipreader.HomeChain, + don registrysyncer.DON, + oracleCreator cctypes.OracleCreator, +) (*ccipDeployment, error) { + // this should be a retryable error. + commitOCRConfigs, err := homeChainReader.GetOCRConfigs(context.Background(), don.ID, uint8(cctypes.PluginTypeCCIPCommit)) + if err != nil { + return nil, fmt.Errorf("failed to fetch OCR configs for CCIP commit plugin (don id: %d) from home chain config contract: %w", + don.ID, err) + } + + execOCRConfigs, err := homeChainReader.GetOCRConfigs(context.Background(), don.ID, uint8(cctypes.PluginTypeCCIPExec)) + if err != nil { + return nil, fmt.Errorf("failed to fetch OCR configs for CCIP exec plugin (don id: %d) from home chain config contract: %w", + don.ID, err) + } + + // upon creation we should only have one OCR config per plugin type. + if len(commitOCRConfigs) != 1 { + return nil, fmt.Errorf("expected exactly one OCR config for CCIP commit plugin (don id: %d), got %d", don.ID, len(commitOCRConfigs)) + } + + if len(execOCRConfigs) != 1 { + return nil, fmt.Errorf("expected exactly one OCR config for CCIP exec plugin (don id: %d), got %d", don.ID, len(execOCRConfigs)) + } + + if !isMemberOfDON(don, p2pID) && oracleCreator.Type() == cctypes.OracleTypePlugin { + lggr.Infow("Not a member of this DON and not a bootstrap node either, skipping", "donId", don.ID, "p2pId", p2pID.String()) + return nil, nil + } + + // at this point we know we are either a member of the DON or a bootstrap node. + // the injected oracleCreator will create the appropriate oracle. + commitOracle, err := oracleCreator.Create(don.ID, cctypes.OCR3ConfigWithMeta(commitOCRConfigs[0])) + if err != nil { + return nil, fmt.Errorf("failed to create CCIP commit oracle: %w", err) + } + + execOracle, err := oracleCreator.Create(don.ID, cctypes.OCR3ConfigWithMeta(execOCRConfigs[0])) + if err != nil { + return nil, fmt.Errorf("failed to create CCIP exec oracle: %w", err) + } + + return &ccipDeployment{ + commit: blueGreenDeployment{ + blue: commitOracle, + }, + exec: blueGreenDeployment{ + blue: execOracle, + }, + }, nil +} diff --git a/core/capabilities/ccip/launcher/launcher_test.go b/core/capabilities/ccip/launcher/launcher_test.go new file mode 100644 index 00000000000..06e9f88c4e6 --- /dev/null +++ b/core/capabilities/ccip/launcher/launcher_test.go @@ -0,0 +1,460 @@ +package launcher + +import ( + "math/big" + "reflect" + "testing" + + cctypes "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/types" + "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/types/mocks" + + ragep2ptypes "github.com/smartcontractkit/libocr/ragep2p/types" + "github.com/stretchr/testify/mock" + "github.com/stretchr/testify/require" + + ccipreaderpkg "github.com/smartcontractkit/chainlink-ccip/pkg/reader" + + "github.com/smartcontractkit/chainlink/v2/core/logger" + "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" + "github.com/smartcontractkit/chainlink/v2/core/services/registrysyncer" +) + +func Test_createDON(t *testing.T) { + type args struct { + lggr logger.Logger + p2pID ragep2ptypes.PeerID + homeChainReader *mocks.HomeChainReader + oracleCreator *mocks.OracleCreator + don registrysyncer.DON + } + tests := []struct { + name string + args args + expect func(t *testing.T, args args, oracleCreator *mocks.OracleCreator, homeChainReader *mocks.HomeChainReader) + wantErr bool + }{ + { + "not a member of the DON and not a bootstrap node", + args{ + logger.TestLogger(t), + p2pID1, + mocks.NewHomeChainReader(t), + mocks.NewOracleCreator(t), + registrysyncer.DON{ + DON: getDON(2, []ragep2ptypes.PeerID{p2pID3, p2pID4}, 0), + CapabilityConfigurations: defaultCapCfgs, + }, + }, + func(t *testing.T, args args, oracleCreator *mocks.OracleCreator, homeChainReader *mocks.HomeChainReader) { + homeChainReader. + On("GetOCRConfigs", mock.Anything, uint32(2), uint8(cctypes.PluginTypeCCIPCommit)). + Return([]ccipreaderpkg.OCR3ConfigWithMeta{{ + Config: ccipreaderpkg.OCR3Config{ + PluginType: uint8(cctypes.PluginTypeCCIPCommit), + P2PIds: [][32]byte{ + p2pkey.MustNewV2XXXTestingOnly(big.NewInt(3)).PeerID(), + p2pkey.MustNewV2XXXTestingOnly(big.NewInt(4)).PeerID(), + }, + }, + }}, nil) + homeChainReader. + On("GetOCRConfigs", mock.Anything, uint32(2), uint8(cctypes.PluginTypeCCIPExec)). + Return([]ccipreaderpkg.OCR3ConfigWithMeta{{ + Config: ccipreaderpkg.OCR3Config{ + PluginType: uint8(cctypes.PluginTypeCCIPExec), + P2PIds: [][32]byte{ + p2pkey.MustNewV2XXXTestingOnly(big.NewInt(3)).PeerID(), + p2pkey.MustNewV2XXXTestingOnly(big.NewInt(4)).PeerID(), + }, + }, + }}, nil) + oracleCreator.EXPECT().Type().Return(cctypes.OracleTypePlugin).Once() + }, + false, + }, + { + "not a member of the DON but a running a bootstrap oracle creator", + args{ + logger.TestLogger(t), + ragep2ptypes.PeerID(p2pkey.MustNewV2XXXTestingOnly(big.NewInt(1)).PeerID()), + mocks.NewHomeChainReader(t), + mocks.NewOracleCreator(t), + registrysyncer.DON{ + DON: getDON(2, []ragep2ptypes.PeerID{p2pID3, p2pID4}, 0), + CapabilityConfigurations: defaultCapCfgs, + }, + }, + func(t *testing.T, args args, oracleCreator *mocks.OracleCreator, homeChainReader *mocks.HomeChainReader) { + homeChainReader. + On("GetOCRConfigs", mock.Anything, uint32(2), uint8(cctypes.PluginTypeCCIPCommit)). + Return([]ccipreaderpkg.OCR3ConfigWithMeta{{ + Config: ccipreaderpkg.OCR3Config{ + PluginType: uint8(cctypes.PluginTypeCCIPCommit), + P2PIds: [][32]byte{ + p2pkey.MustNewV2XXXTestingOnly(big.NewInt(3)).PeerID(), + p2pkey.MustNewV2XXXTestingOnly(big.NewInt(4)).PeerID(), + }, + }, + }}, nil) + homeChainReader. + On("GetOCRConfigs", mock.Anything, uint32(2), uint8(cctypes.PluginTypeCCIPExec)). + Return([]ccipreaderpkg.OCR3ConfigWithMeta{{ + Config: ccipreaderpkg.OCR3Config{ + PluginType: uint8(cctypes.PluginTypeCCIPExec), + P2PIds: [][32]byte{ + p2pkey.MustNewV2XXXTestingOnly(big.NewInt(3)).PeerID(), + p2pkey.MustNewV2XXXTestingOnly(big.NewInt(4)).PeerID(), + }, + }, + }}, nil) + oracleCreator.EXPECT().Type().Return(cctypes.OracleTypeBootstrap).Once() + oracleCreator.EXPECT().Create(mock.Anything, mock.Anything).Return(mocks.NewCCIPOracle(t), nil).Twice() + }, + false, + }, + { + "success", + args{ + logger.TestLogger(t), + p2pID1, + mocks.NewHomeChainReader(t), + mocks.NewOracleCreator(t), + defaultRegistryDon, + }, + func(t *testing.T, args args, oracleCreator *mocks.OracleCreator, homeChainReader *mocks.HomeChainReader) { + homeChainReader. + On("GetOCRConfigs", mock.Anything, uint32(1), uint8(cctypes.PluginTypeCCIPCommit)). + Return([]ccipreaderpkg.OCR3ConfigWithMeta{{ + Config: ccipreaderpkg.OCR3Config{ + PluginType: uint8(cctypes.PluginTypeCCIPCommit), + P2PIds: [][32]byte{ + p2pkey.MustNewV2XXXTestingOnly(big.NewInt(1)).PeerID(), + p2pkey.MustNewV2XXXTestingOnly(big.NewInt(2)).PeerID(), + }, + }, + }}, nil) + homeChainReader. + On("GetOCRConfigs", mock.Anything, uint32(1), uint8(cctypes.PluginTypeCCIPExec)). + Return([]ccipreaderpkg.OCR3ConfigWithMeta{{ + Config: ccipreaderpkg.OCR3Config{ + PluginType: uint8(cctypes.PluginTypeCCIPExec), + P2PIds: [][32]byte{ + p2pkey.MustNewV2XXXTestingOnly(big.NewInt(1)).PeerID(), + p2pkey.MustNewV2XXXTestingOnly(big.NewInt(2)).PeerID(), + }, + }, + }}, nil) + + oracleCreator.EXPECT().Create(mock.Anything, mock.MatchedBy(func(cfg cctypes.OCR3ConfigWithMeta) bool { + return cfg.Config.PluginType == uint8(cctypes.PluginTypeCCIPCommit) + })). + Return(mocks.NewCCIPOracle(t), nil) + oracleCreator.EXPECT().Create(mock.Anything, mock.MatchedBy(func(cfg cctypes.OCR3ConfigWithMeta) bool { + return cfg.Config.PluginType == uint8(cctypes.PluginTypeCCIPExec) + })). + Return(mocks.NewCCIPOracle(t), nil) + }, + false, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + if tt.expect != nil { + tt.expect(t, tt.args, tt.args.oracleCreator, tt.args.homeChainReader) + } + + _, err := createDON(tt.args.lggr, tt.args.p2pID, tt.args.homeChainReader, tt.args.don, tt.args.oracleCreator) + if tt.wantErr { + require.Error(t, err) + } else { + require.NoError(t, err) + } + }) + } +} + +func Test_createFutureBlueGreenDeployment(t *testing.T) { + type args struct { + donID uint32 + prevDeployment ccipDeployment + ocrConfigs []ccipreaderpkg.OCR3ConfigWithMeta + oracleCreator *mocks.OracleCreator + pluginType cctypes.PluginType + } + tests := []struct { + name string + args args + want blueGreenDeployment + wantErr bool + }{ + // TODO: Add test cases. + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + got, err := createFutureBlueGreenDeployment(tt.args.donID, tt.args.prevDeployment, tt.args.ocrConfigs, tt.args.oracleCreator, tt.args.pluginType) + if (err != nil) != tt.wantErr { + t.Errorf("createFutureBlueGreenDeployment() error = %v, wantErr %v", err, tt.wantErr) + return + } + if !reflect.DeepEqual(got, tt.want) { + t.Errorf("createFutureBlueGreenDeployment() = %v, want %v", got, tt.want) + } + }) + } +} + +func Test_updateDON(t *testing.T) { + type args struct { + lggr logger.Logger + p2pID ragep2ptypes.PeerID + homeChainReader *mocks.HomeChainReader + oracleCreator *mocks.OracleCreator + prevDeployment ccipDeployment + don registrysyncer.DON + } + tests := []struct { + name string + args args + wantFutDeployment *ccipDeployment + wantErr bool + }{ + // TODO: Add test cases. + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + gotFutDeployment, err := updateDON(tt.args.lggr, tt.args.p2pID, tt.args.homeChainReader, tt.args.prevDeployment, tt.args.don, tt.args.oracleCreator) + if (err != nil) != tt.wantErr { + t.Errorf("updateDON() error = %v, wantErr %v", err, tt.wantErr) + return + } + if !reflect.DeepEqual(gotFutDeployment, tt.wantFutDeployment) { + t.Errorf("updateDON() = %v, want %v", gotFutDeployment, tt.wantFutDeployment) + } + }) + } +} + +func Test_launcher_processDiff(t *testing.T) { + type fields struct { + lggr logger.Logger + p2pID ragep2ptypes.PeerID + homeChainReader *mocks.HomeChainReader + oracleCreator *mocks.OracleCreator + dons map[registrysyncer.DonID]*ccipDeployment + regState registrysyncer.LocalRegistry + } + type args struct { + diff diffResult + } + tests := []struct { + name string + fields fields + args args + assert func(t *testing.T, l *launcher) + wantErr bool + }{ + { + "don removed success", + fields{ + dons: map[registrysyncer.DonID]*ccipDeployment{ + 1: { + commit: blueGreenDeployment{ + blue: newMock(t, + func(t *testing.T) *mocks.CCIPOracle { return mocks.NewCCIPOracle(t) }, + func(m *mocks.CCIPOracle) { + m.On("Close").Return(nil) + }), + }, + exec: blueGreenDeployment{ + blue: newMock(t, + func(t *testing.T) *mocks.CCIPOracle { return mocks.NewCCIPOracle(t) }, + func(m *mocks.CCIPOracle) { + m.On("Close").Return(nil) + }), + }, + }, + }, + regState: registrysyncer.LocalRegistry{ + IDsToDONs: map[registrysyncer.DonID]registrysyncer.DON{ + 1: defaultRegistryDon, + }, + }, + }, + args{ + diff: diffResult{ + removed: map[registrysyncer.DonID]registrysyncer.DON{ + 1: defaultRegistryDon, + }, + }, + }, + func(t *testing.T, l *launcher) { + require.Len(t, l.dons, 0) + require.Len(t, l.regState.IDsToDONs, 0) + }, + false, + }, + { + "don added success", + fields{ + lggr: logger.TestLogger(t), + p2pID: p2pID1, + homeChainReader: newMock(t, func(t *testing.T) *mocks.HomeChainReader { + return mocks.NewHomeChainReader(t) + }, func(m *mocks.HomeChainReader) { + m.On("GetOCRConfigs", mock.Anything, uint32(1), uint8(cctypes.PluginTypeCCIPCommit)). + Return([]ccipreaderpkg.OCR3ConfigWithMeta{{ + Config: ccipreaderpkg.OCR3Config{ + PluginType: uint8(cctypes.PluginTypeCCIPCommit), + }, + }}, nil) + m.On("GetOCRConfigs", mock.Anything, uint32(1), uint8(cctypes.PluginTypeCCIPExec)). + Return([]ccipreaderpkg.OCR3ConfigWithMeta{{ + Config: ccipreaderpkg.OCR3Config{ + PluginType: uint8(cctypes.PluginTypeCCIPExec), + }, + }}, nil) + }), + oracleCreator: newMock(t, func(t *testing.T) *mocks.OracleCreator { + return mocks.NewOracleCreator(t) + }, func(m *mocks.OracleCreator) { + commitOracle := mocks.NewCCIPOracle(t) + commitOracle.On("Start").Return(nil) + execOracle := mocks.NewCCIPOracle(t) + execOracle.On("Start").Return(nil) + m.EXPECT().Create(mock.Anything, mock.MatchedBy(func(cfg cctypes.OCR3ConfigWithMeta) bool { + return cfg.Config.PluginType == uint8(cctypes.PluginTypeCCIPCommit) + })). + Return(commitOracle, nil) + m.EXPECT().Create(mock.Anything, mock.MatchedBy(func(cfg cctypes.OCR3ConfigWithMeta) bool { + return cfg.Config.PluginType == uint8(cctypes.PluginTypeCCIPExec) + })). + Return(execOracle, nil) + }), + dons: map[registrysyncer.DonID]*ccipDeployment{}, + regState: registrysyncer.LocalRegistry{ + IDsToDONs: map[registrysyncer.DonID]registrysyncer.DON{}, + }, + }, + args{ + diff: diffResult{ + added: map[registrysyncer.DonID]registrysyncer.DON{ + 1: defaultRegistryDon, + }, + }, + }, + func(t *testing.T, l *launcher) { + require.Len(t, l.dons, 1) + require.Len(t, l.regState.IDsToDONs, 1) + }, + false, + }, + { + "don updated new green instance success", + fields{ + lggr: logger.TestLogger(t), + p2pID: p2pID1, + homeChainReader: newMock(t, func(t *testing.T) *mocks.HomeChainReader { + return mocks.NewHomeChainReader(t) + }, func(m *mocks.HomeChainReader) { + m.On("GetOCRConfigs", mock.Anything, uint32(1), uint8(cctypes.PluginTypeCCIPCommit)). + Return([]ccipreaderpkg.OCR3ConfigWithMeta{{ + Config: ccipreaderpkg.OCR3Config{ + PluginType: uint8(cctypes.PluginTypeCCIPCommit), + }, + }, { + Config: ccipreaderpkg.OCR3Config{ + PluginType: uint8(cctypes.PluginTypeCCIPCommit), + }, + }}, nil) + m.On("GetOCRConfigs", mock.Anything, uint32(1), uint8(cctypes.PluginTypeCCIPExec)). + Return([]ccipreaderpkg.OCR3ConfigWithMeta{{ + Config: ccipreaderpkg.OCR3Config{ + PluginType: uint8(cctypes.PluginTypeCCIPExec), + }, + }, { + Config: ccipreaderpkg.OCR3Config{ + PluginType: uint8(cctypes.PluginTypeCCIPExec), + }, + }}, nil) + }), + oracleCreator: newMock(t, func(t *testing.T) *mocks.OracleCreator { + return mocks.NewOracleCreator(t) + }, func(m *mocks.OracleCreator) { + commitOracle := mocks.NewCCIPOracle(t) + commitOracle.On("Start").Return(nil) + execOracle := mocks.NewCCIPOracle(t) + execOracle.On("Start").Return(nil) + m.EXPECT().Create(mock.Anything, mock.MatchedBy(func(cfg cctypes.OCR3ConfigWithMeta) bool { + return cfg.Config.PluginType == uint8(cctypes.PluginTypeCCIPCommit) + })). + Return(commitOracle, nil) + m.EXPECT().Create(mock.Anything, mock.MatchedBy(func(cfg cctypes.OCR3ConfigWithMeta) bool { + return cfg.Config.PluginType == uint8(cctypes.PluginTypeCCIPExec) + })). + Return(execOracle, nil) + }), + dons: map[registrysyncer.DonID]*ccipDeployment{ + 1: { + commit: blueGreenDeployment{ + blue: newMock(t, func(t *testing.T) *mocks.CCIPOracle { + return mocks.NewCCIPOracle(t) + }, func(m *mocks.CCIPOracle) {}), + }, + exec: blueGreenDeployment{ + blue: newMock(t, func(t *testing.T) *mocks.CCIPOracle { + return mocks.NewCCIPOracle(t) + }, func(m *mocks.CCIPOracle) {}), + }, + }, + }, + regState: registrysyncer.LocalRegistry{ + IDsToDONs: map[registrysyncer.DonID]registrysyncer.DON{ + 1: defaultRegistryDon, + }, + }, + }, + args{ + diff: diffResult{ + updated: map[registrysyncer.DonID]registrysyncer.DON{ + 1: { + // new Node in Don: p2pID2 + DON: getDON(1, []ragep2ptypes.PeerID{p2pID1, p2pID2}, 0), + CapabilityConfigurations: defaultCapCfgs, + }, + }, + }, + }, + func(t *testing.T, l *launcher) { + require.Len(t, l.dons, 1) + require.Len(t, l.regState.IDsToDONs, 1) + require.Len(t, l.regState.IDsToDONs[1].Members, 2) + }, + false, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + l := &launcher{ + dons: tt.fields.dons, + regState: tt.fields.regState, + p2pID: tt.fields.p2pID, + lggr: tt.fields.lggr, + homeChainReader: tt.fields.homeChainReader, + oracleCreator: tt.fields.oracleCreator, + } + err := l.processDiff(tt.args.diff) + if tt.wantErr { + require.Error(t, err) + } else { + require.NoError(t, err) + } + tt.assert(t, l) + }) + } +} + +func newMock[T any](t *testing.T, newer func(t *testing.T) T, expect func(m T)) T { + o := newer(t) + expect(o) + return o +} diff --git a/core/capabilities/ccip/launcher/test_helpers.go b/core/capabilities/ccip/launcher/test_helpers.go new file mode 100644 index 00000000000..f4ded9c2cf2 --- /dev/null +++ b/core/capabilities/ccip/launcher/test_helpers.go @@ -0,0 +1,58 @@ +package launcher + +import ( + "fmt" + "math/big" + + "github.com/smartcontractkit/chainlink-common/pkg/capabilities" + + "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" + "github.com/smartcontractkit/chainlink/v2/core/services/registrysyncer" + + ragep2ptypes "github.com/smartcontractkit/libocr/ragep2p/types" +) + +const ( + ccipCapVersion = "v1.0.0" + ccipCapNewVersion = "v1.1.0" + ccipCapName = "ccip" +) + +var ( + defaultCapability = getCapability(ccipCapName, ccipCapVersion) + newCapability = getCapability(ccipCapName, ccipCapNewVersion) + p2pID1 = getP2PID(1) + p2pID2 = getP2PID(2) + p2pID3 = getP2PID(3) + p2pID4 = getP2PID(4) + defaultCapCfgs = map[string]registrysyncer.CapabilityConfiguration{ + defaultCapability.ID: {}, + } + defaultRegistryDon = registrysyncer.DON{ + DON: getDON(1, []ragep2ptypes.PeerID{p2pID1}, 0), + CapabilityConfigurations: defaultCapCfgs, + } +) + +func getP2PID(id uint32) ragep2ptypes.PeerID { + return ragep2ptypes.PeerID(p2pkey.MustNewV2XXXTestingOnly(big.NewInt(int64(id))).PeerID()) +} + +func getCapability(ccipCapName, ccipCapVersion string) registrysyncer.Capability { + id := fmt.Sprintf("%s@%s", ccipCapName, ccipCapVersion) + return registrysyncer.Capability{ + CapabilityType: capabilities.CapabilityTypeTarget, + ID: id, + } +} + +func getDON(id uint32, members []ragep2ptypes.PeerID, cfgVersion uint32) capabilities.DON { + return capabilities.DON{ + ID: id, + ConfigVersion: cfgVersion, + F: uint8(1), + IsPublic: true, + AcceptsWorkflows: true, + Members: members, + } +} diff --git a/core/capabilities/ccip/ocrimpls/config_digester.go b/core/capabilities/ccip/ocrimpls/config_digester.go new file mode 100644 index 00000000000..ef0c5e7ca32 --- /dev/null +++ b/core/capabilities/ccip/ocrimpls/config_digester.go @@ -0,0 +1,23 @@ +package ocrimpls + +import "github.com/smartcontractkit/libocr/offchainreporting2plus/types" + +type configDigester struct { + d types.ConfigDigest +} + +func NewConfigDigester(d types.ConfigDigest) *configDigester { + return &configDigester{d: d} +} + +// ConfigDigest implements types.OffchainConfigDigester. +func (c *configDigester) ConfigDigest(types.ContractConfig) (types.ConfigDigest, error) { + return c.d, nil +} + +// ConfigDigestPrefix implements types.OffchainConfigDigester. +func (c *configDigester) ConfigDigestPrefix() (types.ConfigDigestPrefix, error) { + return types.ConfigDigestPrefixCCIPMultiRole, nil +} + +var _ types.OffchainConfigDigester = (*configDigester)(nil) diff --git a/core/capabilities/ccip/ocrimpls/config_tracker.go b/core/capabilities/ccip/ocrimpls/config_tracker.go new file mode 100644 index 00000000000..3a6a27fa40c --- /dev/null +++ b/core/capabilities/ccip/ocrimpls/config_tracker.go @@ -0,0 +1,77 @@ +package ocrimpls + +import ( + "context" + + cctypes "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/types" + + gethcommon "github.com/ethereum/go-ethereum/common" + "github.com/smartcontractkit/libocr/offchainreporting2plus/ocr3confighelper" + "github.com/smartcontractkit/libocr/offchainreporting2plus/types" +) + +type configTracker struct { + cfg cctypes.OCR3ConfigWithMeta +} + +func NewConfigTracker(cfg cctypes.OCR3ConfigWithMeta) *configTracker { + return &configTracker{cfg: cfg} +} + +// LatestBlockHeight implements types.ContractConfigTracker. +func (c *configTracker) LatestBlockHeight(ctx context.Context) (blockHeight uint64, err error) { + return 0, nil +} + +// LatestConfig implements types.ContractConfigTracker. +func (c *configTracker) LatestConfig(ctx context.Context, changedInBlock uint64) (types.ContractConfig, error) { + return c.contractConfig(), nil +} + +// LatestConfigDetails implements types.ContractConfigTracker. +func (c *configTracker) LatestConfigDetails(ctx context.Context) (changedInBlock uint64, configDigest types.ConfigDigest, err error) { + return 0, c.cfg.ConfigDigest, nil +} + +// Notify implements types.ContractConfigTracker. +func (c *configTracker) Notify() <-chan struct{} { + return nil +} + +func (c *configTracker) contractConfig() types.ContractConfig { + return types.ContractConfig{ + ConfigDigest: c.cfg.ConfigDigest, + ConfigCount: c.cfg.ConfigCount, + Signers: toOnchainPublicKeys(c.cfg.Config.Signers), + Transmitters: toOCRAccounts(c.cfg.Config.Transmitters), + F: c.cfg.Config.F, + OnchainConfig: []byte{}, + OffchainConfigVersion: c.cfg.Config.OffchainConfigVersion, + OffchainConfig: c.cfg.Config.OffchainConfig, + } +} + +// PublicConfig returns the OCR configuration as a PublicConfig so that we can +// access ReportingPluginConfig and other fields prior to launching the plugins. +func (c *configTracker) PublicConfig() (ocr3confighelper.PublicConfig, error) { + return ocr3confighelper.PublicConfigFromContractConfig(false, c.contractConfig()) +} + +func toOnchainPublicKeys(signers [][]byte) []types.OnchainPublicKey { + keys := make([]types.OnchainPublicKey, len(signers)) + for i, signer := range signers { + keys[i] = types.OnchainPublicKey(signer) + } + return keys +} + +func toOCRAccounts(transmitters [][]byte) []types.Account { + accounts := make([]types.Account, len(transmitters)) + for i, transmitter := range transmitters { + // TODO: string-encode the transmitter appropriately to the dest chain family. + accounts[i] = types.Account(gethcommon.BytesToAddress(transmitter).Hex()) + } + return accounts +} + +var _ types.ContractConfigTracker = (*configTracker)(nil) diff --git a/core/capabilities/ccip/ocrimpls/contract_transmitter.go b/core/capabilities/ccip/ocrimpls/contract_transmitter.go new file mode 100644 index 00000000000..fd8e206d0e3 --- /dev/null +++ b/core/capabilities/ccip/ocrimpls/contract_transmitter.go @@ -0,0 +1,188 @@ +package ocrimpls + +import ( + "context" + "errors" + "fmt" + "math/big" + + "github.com/google/uuid" + "github.com/smartcontractkit/libocr/offchainreporting2/chains/evmutil" + "github.com/smartcontractkit/libocr/offchainreporting2plus/ocr3types" + ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" + + "github.com/smartcontractkit/chainlink-ccip/pkg/consts" + commontypes "github.com/smartcontractkit/chainlink-common/pkg/types" +) + +type ToCalldataFunc func(rawReportCtx [3][32]byte, report []byte, rs, ss [][32]byte, vs [32]byte) any + +func ToCommitCalldata(rawReportCtx [3][32]byte, report []byte, rs, ss [][32]byte, vs [32]byte) any { + // Note that the name of the struct field is very important, since the encoder used + // by the chainwriter uses mapstructure, which will use the struct field name to map + // to the argument name in the function call. + // If, for whatever reason, we want to change the field name, make sure to add a `mapstructure:""` tag + // for that field. + return struct { + ReportContext [3][32]byte + Report []byte + Rs [][32]byte + Ss [][32]byte + RawVs [32]byte + }{ + ReportContext: rawReportCtx, + Report: report, + Rs: rs, + Ss: ss, + RawVs: vs, + } +} + +func ToExecCalldata(rawReportCtx [3][32]byte, report []byte, _, _ [][32]byte, _ [32]byte) any { + // Note that the name of the struct field is very important, since the encoder used + // by the chainwriter uses mapstructure, which will use the struct field name to map + // to the argument name in the function call. + // If, for whatever reason, we want to change the field name, make sure to add a `mapstructure:""` tag + // for that field. + return struct { + ReportContext [3][32]byte + Report []byte + }{ + ReportContext: rawReportCtx, + Report: report, + } +} + +var _ ocr3types.ContractTransmitter[[]byte] = &commitTransmitter[[]byte]{} + +type commitTransmitter[RI any] struct { + cw commontypes.ChainWriter + fromAccount ocrtypes.Account + contractName string + method string + offrampAddress string + toCalldataFn ToCalldataFunc +} + +func XXXNewContractTransmitterTestsOnly[RI any]( + cw commontypes.ChainWriter, + fromAccount ocrtypes.Account, + contractName string, + method string, + offrampAddress string, + toCalldataFn ToCalldataFunc, +) ocr3types.ContractTransmitter[RI] { + return &commitTransmitter[RI]{ + cw: cw, + fromAccount: fromAccount, + contractName: contractName, + method: method, + offrampAddress: offrampAddress, + toCalldataFn: toCalldataFn, + } +} + +func NewCommitContractTransmitter[RI any]( + cw commontypes.ChainWriter, + fromAccount ocrtypes.Account, + offrampAddress string, +) ocr3types.ContractTransmitter[RI] { + return &commitTransmitter[RI]{ + cw: cw, + fromAccount: fromAccount, + contractName: consts.ContractNameOffRamp, + method: consts.MethodCommit, + offrampAddress: offrampAddress, + toCalldataFn: ToCommitCalldata, + } +} + +func NewExecContractTransmitter[RI any]( + cw commontypes.ChainWriter, + fromAccount ocrtypes.Account, + offrampAddress string, +) ocr3types.ContractTransmitter[RI] { + return &commitTransmitter[RI]{ + cw: cw, + fromAccount: fromAccount, + contractName: consts.ContractNameOffRamp, + method: consts.MethodExecute, + offrampAddress: offrampAddress, + toCalldataFn: ToExecCalldata, + } +} + +// FromAccount implements ocr3types.ContractTransmitter. +func (c *commitTransmitter[RI]) FromAccount() (ocrtypes.Account, error) { + return c.fromAccount, nil +} + +// Transmit implements ocr3types.ContractTransmitter. +func (c *commitTransmitter[RI]) Transmit( + ctx context.Context, + configDigest ocrtypes.ConfigDigest, + seqNr uint64, + reportWithInfo ocr3types.ReportWithInfo[RI], + sigs []ocrtypes.AttributedOnchainSignature, +) error { + var rs [][32]byte + var ss [][32]byte + var vs [32]byte + if len(sigs) > 32 { + return errors.New("too many signatures, maximum is 32") + } + for i, as := range sigs { + r, s, v, err := evmutil.SplitSignature(as.Signature) + if err != nil { + return fmt.Errorf("failed to split signature: %w", err) + } + rs = append(rs, r) + ss = append(ss, s) + vs[i] = v + } + + // report ctx for OCR3 consists of the following + // reportContext[0]: ConfigDigest + // reportContext[1]: 24 byte padding, 8 byte sequence number + // reportContext[2]: unused + // convert seqNum, which is a uint64, into a uint32 epoch and uint8 round + // while this does truncate the sequence number, it is not a problem because + // it still gives us 2^40 - 1 possible sequence numbers. + // assuming a sequence number is generated every second, this gives us + // 1099511627775 seconds, or approximately 34,865 years, before we run out + // of sequence numbers. + epoch, round := uint64ToUint32AndUint8(seqNr) + rawReportCtx := evmutil.RawReportContext(ocrtypes.ReportContext{ + ReportTimestamp: ocrtypes.ReportTimestamp{ + ConfigDigest: configDigest, + Epoch: epoch, + Round: round, + }, + // ExtraData not used in OCR3 + }) + + if c.toCalldataFn == nil { + return errors.New("toCalldataFn is nil") + } + + // chain writer takes in the raw calldata and packs it on its own. + args := c.toCalldataFn(rawReportCtx, reportWithInfo.Report, rs, ss, vs) + + // TODO: no meta fields yet, what should we add? + // probably whats in the info part of the report? + meta := commontypes.TxMeta{} + txID, err := uuid.NewRandom() // NOTE: CW expects us to generate an ID, rather than return one + if err != nil { + return fmt.Errorf("failed to generate UUID: %w", err) + } + zero := big.NewInt(0) + if err := c.cw.SubmitTransaction(ctx, c.contractName, c.method, args, fmt.Sprintf("%s-%s-%s", c.contractName, c.offrampAddress, txID.String()), c.offrampAddress, &meta, zero); err != nil { + return fmt.Errorf("failed to submit transaction thru chainwriter: %w", err) + } + + return nil +} + +func uint64ToUint32AndUint8(x uint64) (uint32, uint8) { + return uint32(x >> 32), uint8(x) +} diff --git a/core/capabilities/ccip/ocrimpls/contract_transmitter_test.go b/core/capabilities/ccip/ocrimpls/contract_transmitter_test.go new file mode 100644 index 00000000000..274620926fa --- /dev/null +++ b/core/capabilities/ccip/ocrimpls/contract_transmitter_test.go @@ -0,0 +1,704 @@ +package ocrimpls_test + +import ( + "crypto/rand" + "math/big" + "net/url" + "testing" + "time" + + "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/ocrimpls" + cctypes "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/types" + + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/accounts/abi/bind/backends" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/core" + "github.com/jmoiron/sqlx" + "github.com/onsi/gomega" + "github.com/stretchr/testify/require" + + "github.com/smartcontractkit/libocr/commontypes" + "github.com/smartcontractkit/libocr/offchainreporting2plus/ocr3types" + ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" + + "github.com/smartcontractkit/chainlink-common/pkg/utils/mailbox" + + txmgrcommon "github.com/smartcontractkit/chainlink/v2/common/txmgr" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" + evmconfig "github.com/smartcontractkit/chainlink/v2/core/chains/evm/config" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/config/chaintype" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/gas" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/headtracker" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/keystore" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/txmgr" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils" + "github.com/smartcontractkit/chainlink/v2/core/config" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/multi_ocr3_helper" + "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/pgtest" + "github.com/smartcontractkit/chainlink/v2/core/logger" + kschaintype "github.com/smartcontractkit/chainlink/v2/core/services/keystore/chaintype" + "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ocr2key" + "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm" + evmrelaytypes "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/types" +) + +func Test_ContractTransmitter_TransmitWithoutSignatures(t *testing.T) { + type testCase struct { + name string + pluginType uint8 + withSigs bool + expectedSigsEnabled bool + report []byte + } + + testCases := []testCase{ + { + "empty report with sigs", + uint8(cctypes.PluginTypeCCIPCommit), + true, + true, + []byte{}, + }, + { + "empty report without sigs", + uint8(cctypes.PluginTypeCCIPExec), + false, + false, + []byte{}, + }, + { + "report with data with sigs", + uint8(cctypes.PluginTypeCCIPCommit), + true, + true, + randomReport(t, 96), + }, + { + "report with data without sigs", + uint8(cctypes.PluginTypeCCIPExec), + false, + false, + randomReport(t, 96), + }, + } + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + tc := tc + testTransmitter(t, tc.pluginType, tc.withSigs, tc.expectedSigsEnabled, tc.report) + }) + } +} + +func testTransmitter( + t *testing.T, + pluginType uint8, + withSigs bool, + expectedSigsEnabled bool, + report []byte, +) { + uni := newTestUniverse[[]byte](t, nil) + + c, err := uni.wrapper.LatestConfigDetails(nil, pluginType) + require.NoError(t, err, "failed to get latest config details") + configDigest := c.ConfigInfo.ConfigDigest + require.Equal(t, expectedSigsEnabled, c.ConfigInfo.IsSignatureVerificationEnabled, "signature verification enabled setting not correct") + + // set the plugin type on the helper so it fetches the right config info. + // the important aspect is whether signatures should be enabled or not. + _, err = uni.wrapper.SetTransmitOcrPluginType(uni.deployer, pluginType) + require.NoError(t, err, "failed to set plugin type") + uni.backend.Commit() + + // create attributed sigs + // only need f+1 which is 2 in this case + rwi := ocr3types.ReportWithInfo[[]byte]{ + Report: report, + Info: []byte{}, + } + seqNr := uint64(1) + attributedSigs := uni.SignReport(t, configDigest, rwi, seqNr) + + account, err := uni.transmitterWithSigs.FromAccount() + require.NoError(t, err, "failed to get from account") + require.Equal(t, ocrtypes.Account(uni.transmitters[0].Hex()), account, "from account mismatch") + if withSigs { + err = uni.transmitterWithSigs.Transmit(testutils.Context(t), configDigest, seqNr, rwi, attributedSigs) + } else { + err = uni.transmitterWithoutSigs.Transmit(testutils.Context(t), configDigest, seqNr, rwi, attributedSigs) + } + require.NoError(t, err, "failed to transmit") + uni.backend.Commit() + + var txStatus uint64 + gomega.NewWithT(t).Eventually(func() bool { + uni.backend.Commit() + rows, err := uni.db.QueryContext(testutils.Context(t), `SELECT hash FROM evm.tx_attempts LIMIT 1`) + require.NoError(t, err, "failed to query txes") + defer rows.Close() + var txHash []byte + for rows.Next() { + require.NoError(t, rows.Scan(&txHash), "failed to scan") + } + t.Log("txHash:", txHash) + receipt, err := uni.simClient.TransactionReceipt(testutils.Context(t), common.BytesToHash(txHash)) + if err != nil { + t.Log("tx not found yet:", hexutil.Encode(txHash)) + return false + } + t.Log("tx found:", hexutil.Encode(txHash), "status:", receipt.Status) + txStatus = receipt.Status + return true + }, testutils.WaitTimeout(t), 1*time.Second).Should(gomega.BeTrue()) + + // wait for receipt to be written to the db + gomega.NewWithT(t).Eventually(func() bool { + rows, err := uni.db.QueryContext(testutils.Context(t), `SELECT count(*) as cnt FROM evm.receipts LIMIT 1`) + require.NoError(t, err, "failed to query receipts") + defer rows.Close() + var count int + for rows.Next() { + require.NoError(t, rows.Scan(&count), "failed to scan") + } + return count == 1 + }, testutils.WaitTimeout(t), 2*time.Second).Should(gomega.BeTrue()) + + require.Equal(t, uint64(1), txStatus, "tx status should be success") + + // check that the event was emitted + events := uni.TransmittedEvents(t) + require.Len(t, events, 1, "expected 1 event") + require.Equal(t, configDigest, events[0].ConfigDigest, "config digest mismatch") + require.Equal(t, seqNr, events[0].SequenceNumber, "seq num mismatch") +} + +type testUniverse[RI any] struct { + simClient *client.SimulatedBackendClient + backend *backends.SimulatedBackend + deployer *bind.TransactOpts + transmitters []common.Address + signers []common.Address + wrapper *multi_ocr3_helper.MultiOCR3Helper + transmitterWithSigs ocr3types.ContractTransmitter[RI] + transmitterWithoutSigs ocr3types.ContractTransmitter[RI] + keyrings []ocr3types.OnchainKeyring[RI] + f uint8 + db *sqlx.DB + txm txmgr.TxManager + gasEstimator gas.EvmFeeEstimator +} + +type keyringsAndSigners[RI any] struct { + keyrings []ocr3types.OnchainKeyring[RI] + signers []common.Address +} + +func newTestUniverse[RI any](t *testing.T, ks *keyringsAndSigners[RI]) *testUniverse[RI] { + t.Helper() + + db := pgtest.NewSqlxDB(t) + owner := testutils.MustNewSimTransactor(t) + + // create many transmitters but only need to fund one, rest are to get + // setOCR3Config to pass. + keyStore := cltest.NewKeyStore(t, db) + var transmitters []common.Address + for i := 0; i < 4; i++ { + key, err := keyStore.Eth().Create(testutils.Context(t), big.NewInt(1337)) + require.NoError(t, err, "failed to create key") + transmitters = append(transmitters, key.Address) + } + + backend := backends.NewSimulatedBackend(core.GenesisAlloc{ + owner.From: core.GenesisAccount{ + Balance: assets.Ether(1000).ToInt(), + }, + transmitters[0]: core.GenesisAccount{ + Balance: assets.Ether(1000).ToInt(), + }, + }, 30e6) + + ocr3HelperAddr, _, _, err := multi_ocr3_helper.DeployMultiOCR3Helper(owner, backend) + require.NoError(t, err) + backend.Commit() + wrapper, err := multi_ocr3_helper.NewMultiOCR3Helper(ocr3HelperAddr, backend) + require.NoError(t, err) + + // create the oracle identities for setConfig + // need to create at least 4 identities otherwise setConfig will fail + var ( + keyrings []ocr3types.OnchainKeyring[RI] + signers []common.Address + ) + if ks != nil { + keyrings = ks.keyrings + signers = ks.signers + } else { + for i := 0; i < 4; i++ { + kb, err2 := ocr2key.New(kschaintype.EVM) + require.NoError(t, err2, "failed to create key") + kr := ocrimpls.NewOnchainKeyring[RI](kb, logger.TestLogger(t)) + signers = append(signers, common.BytesToAddress(kr.PublicKey())) + keyrings = append(keyrings, kr) + } + } + f := uint8(1) + commitConfigDigest := testutils.Random32Byte() + execConfigDigest := testutils.Random32Byte() + _, err = wrapper.SetOCR3Configs( + owner, + []multi_ocr3_helper.MultiOCR3BaseOCRConfigArgs{ + { + ConfigDigest: commitConfigDigest, + OcrPluginType: uint8(cctypes.PluginTypeCCIPCommit), + F: f, + IsSignatureVerificationEnabled: true, + Signers: signers, + Transmitters: []common.Address{ + transmitters[0], + transmitters[1], + transmitters[2], + transmitters[3], + }, + }, + { + ConfigDigest: execConfigDigest, + OcrPluginType: uint8(cctypes.PluginTypeCCIPExec), + F: f, + IsSignatureVerificationEnabled: false, + Signers: signers, + Transmitters: []common.Address{ + transmitters[0], + transmitters[1], + transmitters[2], + transmitters[3], + }, + }, + }, + ) + require.NoError(t, err) + backend.Commit() + + commitConfig, err := wrapper.LatestConfigDetails(nil, uint8(cctypes.PluginTypeCCIPCommit)) + require.NoError(t, err, "failed to get latest commit config") + require.Equal(t, commitConfigDigest, commitConfig.ConfigInfo.ConfigDigest, "commit config digest mismatch") + execConfig, err := wrapper.LatestConfigDetails(nil, uint8(cctypes.PluginTypeCCIPExec)) + require.NoError(t, err, "failed to get latest exec config") + require.Equal(t, execConfigDigest, execConfig.ConfigInfo.ConfigDigest, "exec config digest mismatch") + + simClient := client.NewSimulatedBackendClient(t, backend, testutils.SimulatedChainID) + + // create the chain writer service + txm, gasEstimator := makeTestEvmTxm(t, db, simClient, keyStore.Eth()) + require.NoError(t, txm.Start(testutils.Context(t)), "failed to start tx manager") + t.Cleanup(func() { require.NoError(t, txm.Close()) }) + + chainWriter, err := evm.NewChainWriterService( + logger.TestLogger(t), + simClient, + txm, + gasEstimator, + chainWriterConfigRaw(transmitters[0], assets.GWei(1))) + require.NoError(t, err, "failed to create chain writer") + require.NoError(t, chainWriter.Start(testutils.Context(t)), "failed to start chain writer") + t.Cleanup(func() { require.NoError(t, chainWriter.Close()) }) + + transmitterWithSigs := ocrimpls.XXXNewContractTransmitterTestsOnly[RI]( + chainWriter, + ocrtypes.Account(transmitters[0].Hex()), + contractName, + methodTransmitWithSignatures, + ocr3HelperAddr.Hex(), + ocrimpls.ToCommitCalldata, + ) + transmitterWithoutSigs := ocrimpls.XXXNewContractTransmitterTestsOnly[RI]( + chainWriter, + ocrtypes.Account(transmitters[0].Hex()), + contractName, + methodTransmitWithoutSignatures, + ocr3HelperAddr.Hex(), + ocrimpls.ToExecCalldata, + ) + + return &testUniverse[RI]{ + simClient: simClient, + backend: backend, + deployer: owner, + transmitters: transmitters, + signers: signers, + wrapper: wrapper, + transmitterWithSigs: transmitterWithSigs, + transmitterWithoutSigs: transmitterWithoutSigs, + keyrings: keyrings, + f: f, + db: db, + txm: txm, + gasEstimator: gasEstimator, + } +} + +func (uni testUniverse[RI]) SignReport(t *testing.T, configDigest ocrtypes.ConfigDigest, rwi ocr3types.ReportWithInfo[RI], seqNum uint64) []ocrtypes.AttributedOnchainSignature { + var attributedSigs []ocrtypes.AttributedOnchainSignature + for i := uint8(0); i < uni.f+1; i++ { + t.Log("signing report with", hexutil.Encode(uni.keyrings[i].PublicKey())) + sig, err := uni.keyrings[i].Sign(configDigest, seqNum, rwi) + require.NoError(t, err, "failed to sign report") + attributedSigs = append(attributedSigs, ocrtypes.AttributedOnchainSignature{ + Signature: sig, + Signer: commontypes.OracleID(i), + }) + } + return attributedSigs +} + +func (uni testUniverse[RI]) TransmittedEvents(t *testing.T) []*multi_ocr3_helper.MultiOCR3HelperTransmitted { + iter, err := uni.wrapper.FilterTransmitted(&bind.FilterOpts{ + Start: 0, + }, nil) + require.NoError(t, err, "failed to create filter iterator") + var events []*multi_ocr3_helper.MultiOCR3HelperTransmitted + for iter.Next() { + event := iter.Event + events = append(events, event) + } + return events +} + +func randomReport(t *testing.T, len int) []byte { + report := make([]byte, len) + _, err := rand.Reader.Read(report) + require.NoError(t, err, "failed to read random bytes") + return report +} + +const ( + contractName = "MultiOCR3Helper" + methodTransmitWithSignatures = "TransmitWithSignatures" + methodTransmitWithoutSignatures = "TransmitWithoutSignatures" +) + +func chainWriterConfigRaw(fromAddress common.Address, maxGasPrice *assets.Wei) evmrelaytypes.ChainWriterConfig { + return evmrelaytypes.ChainWriterConfig{ + Contracts: map[string]*evmrelaytypes.ContractConfig{ + contractName: { + ContractABI: multi_ocr3_helper.MultiOCR3HelperABI, + Configs: map[string]*evmrelaytypes.ChainWriterDefinition{ + methodTransmitWithSignatures: { + ChainSpecificName: "transmitWithSignatures", + GasLimit: 1e6, + FromAddress: fromAddress, + }, + methodTransmitWithoutSignatures: { + ChainSpecificName: "transmitWithoutSignatures", + GasLimit: 1e6, + FromAddress: fromAddress, + }, + }, + }, + }, + SendStrategy: txmgrcommon.NewSendEveryStrategy(), + MaxGasPrice: maxGasPrice, + } +} + +func makeTestEvmTxm( + t *testing.T, + db *sqlx.DB, + ethClient client.Client, + keyStore keystore.Eth) (txmgr.TxManager, gas.EvmFeeEstimator) { + config, dbConfig, evmConfig := MakeTestConfigs(t) + + estimator, err := gas.NewEstimator(logger.TestLogger(t), ethClient, config, evmConfig.GasEstimator()) + require.NoError(t, err, "failed to create gas estimator") + + lggr := logger.TestLogger(t) + lpOpts := logpoller.Opts{ + PollPeriod: 100 * time.Millisecond, + FinalityDepth: 2, + BackfillBatchSize: 3, + RpcBatchSize: 2, + KeepFinalizedBlocksDepth: 1000, + } + + chainID := big.NewInt(1337) + headSaver := headtracker.NewHeadSaver( + logger.NullLogger, + headtracker.NewORM(*chainID, db), + evmConfig, + evmConfig.HeadTrackerConfig, + ) + + broadcaster := headtracker.NewHeadBroadcaster(logger.NullLogger) + require.NoError(t, broadcaster.Start(testutils.Context(t)), "failed to start head broadcaster") + t.Cleanup(func() { require.NoError(t, broadcaster.Close()) }) + + ht := headtracker.NewHeadTracker( + logger.NullLogger, + ethClient, + evmConfig, + evmConfig.HeadTrackerConfig, + broadcaster, + headSaver, + mailbox.NewMonitor("contract_transmitter_test", logger.NullLogger), + ) + require.NoError(t, ht.Start(testutils.Context(t)), "failed to start head tracker") + t.Cleanup(func() { require.NoError(t, ht.Close()) }) + + lp := logpoller.NewLogPoller(logpoller.NewORM(testutils.FixtureChainID, db, logger.NullLogger), + ethClient, logger.NullLogger, ht, lpOpts) + require.NoError(t, lp.Start(testutils.Context(t)), "failed to start log poller") + t.Cleanup(func() { require.NoError(t, lp.Close()) }) + + // logic for building components (from evm/evm_txm.go) ------- + lggr.Infow("Initializing EVM transaction manager", + "bumpTxDepth", evmConfig.GasEstimator().BumpTxDepth(), + "maxInFlightTransactions", config.EvmConfig.Transactions().MaxInFlight(), + "maxQueuedTransactions", config.EvmConfig.Transactions().MaxQueued(), + "nonceAutoSync", evmConfig.NonceAutoSync(), + "limitDefault", evmConfig.GasEstimator().LimitDefault(), + ) + + txm, err := txmgr.NewTxm( + db, + config, + config.EvmConfig.GasEstimator(), + config.EvmConfig.Transactions(), + nil, + dbConfig, + dbConfig.Listener(), + ethClient, + lggr, + lp, + keyStore, + estimator, + ht) + require.NoError(t, err, "can't create tx manager") + + _, unsub := broadcaster.Subscribe(txm) + t.Cleanup(unsub) + + return txm, estimator +} + +// Code below copied/pasted and slightly modified in order to work from core/chains/evm/txmgr/test_helpers.go. + +func ptr[T any](t T) *T { return &t } + +type TestDatabaseConfig struct { + config.Database + defaultQueryTimeout time.Duration +} + +func (d *TestDatabaseConfig) DefaultQueryTimeout() time.Duration { + return d.defaultQueryTimeout +} + +func (d *TestDatabaseConfig) LogSQL() bool { + return false +} + +type TestListenerConfig struct { + config.Listener +} + +func (l *TestListenerConfig) FallbackPollInterval() time.Duration { + return 1 * time.Minute +} + +func (d *TestDatabaseConfig) Listener() config.Listener { + return &TestListenerConfig{} +} + +type TestHeadTrackerConfig struct{} + +// FinalityTagBypass implements config.HeadTracker. +func (t *TestHeadTrackerConfig) FinalityTagBypass() bool { + return false +} + +// HistoryDepth implements config.HeadTracker. +func (t *TestHeadTrackerConfig) HistoryDepth() uint32 { + return 50 +} + +// MaxAllowedFinalityDepth implements config.HeadTracker. +func (t *TestHeadTrackerConfig) MaxAllowedFinalityDepth() uint32 { + return 100 +} + +// MaxBufferSize implements config.HeadTracker. +func (t *TestHeadTrackerConfig) MaxBufferSize() uint32 { + return 100 +} + +// SamplingInterval implements config.HeadTracker. +func (t *TestHeadTrackerConfig) SamplingInterval() time.Duration { + return 1 * time.Second +} + +func (t *TestHeadTrackerConfig) PersistenceEnabled() bool { + return true +} + +var _ evmconfig.HeadTracker = (*TestHeadTrackerConfig)(nil) + +type TestEvmConfig struct { + evmconfig.EVM + HeadTrackerConfig evmconfig.HeadTracker + MaxInFlight uint32 + ReaperInterval time.Duration + ReaperThreshold time.Duration + ResendAfterThreshold time.Duration + BumpThreshold uint64 + MaxQueued uint64 + Enabled bool + Threshold uint32 + MinAttempts uint32 + DetectionApiUrl *url.URL +} + +func (e *TestEvmConfig) FinalityTagEnabled() bool { + return false +} + +func (e *TestEvmConfig) FinalityDepth() uint32 { + return 42 +} + +func (e *TestEvmConfig) FinalizedBlockOffset() uint32 { + return 42 +} + +func (e *TestEvmConfig) BlockEmissionIdleWarningThreshold() time.Duration { + return 10 * time.Second +} + +func (e *TestEvmConfig) Transactions() evmconfig.Transactions { + return &transactionsConfig{e: e, autoPurge: &autoPurgeConfig{}} +} + +func (e *TestEvmConfig) NonceAutoSync() bool { return true } + +func (e *TestEvmConfig) ChainType() chaintype.ChainType { return "" } + +type TestGasEstimatorConfig struct { + bumpThreshold uint64 +} + +func (g *TestGasEstimatorConfig) BlockHistory() evmconfig.BlockHistory { + return &TestBlockHistoryConfig{} +} + +func (g *TestGasEstimatorConfig) FeeHistory() evmconfig.FeeHistory { + return &TestFeeHistoryConfig{} +} + +func (g *TestGasEstimatorConfig) EIP1559DynamicFees() bool { return false } +func (g *TestGasEstimatorConfig) LimitDefault() uint64 { return 1e6 } +func (g *TestGasEstimatorConfig) BumpPercent() uint16 { return 2 } +func (g *TestGasEstimatorConfig) BumpThreshold() uint64 { return g.bumpThreshold } +func (g *TestGasEstimatorConfig) BumpMin() *assets.Wei { return assets.GWei(1) } +func (g *TestGasEstimatorConfig) FeeCapDefault() *assets.Wei { return assets.GWei(1) } +func (g *TestGasEstimatorConfig) PriceDefault() *assets.Wei { return assets.GWei(1) } +func (g *TestGasEstimatorConfig) TipCapDefault() *assets.Wei { return assets.GWei(1) } +func (g *TestGasEstimatorConfig) TipCapMin() *assets.Wei { return assets.GWei(1) } +func (g *TestGasEstimatorConfig) LimitMax() uint64 { return 0 } +func (g *TestGasEstimatorConfig) LimitMultiplier() float32 { return 1 } +func (g *TestGasEstimatorConfig) BumpTxDepth() uint32 { return 42 } +func (g *TestGasEstimatorConfig) LimitTransfer() uint64 { return 42 } +func (g *TestGasEstimatorConfig) PriceMax() *assets.Wei { return assets.GWei(1) } +func (g *TestGasEstimatorConfig) PriceMin() *assets.Wei { return assets.GWei(1) } +func (g *TestGasEstimatorConfig) Mode() string { return "FixedPrice" } +func (g *TestGasEstimatorConfig) LimitJobType() evmconfig.LimitJobType { + return &TestLimitJobTypeConfig{} +} +func (g *TestGasEstimatorConfig) PriceMaxKey(addr common.Address) *assets.Wei { + return assets.GWei(1) +} +func (g *TestGasEstimatorConfig) EstimateLimit() bool { return false } + +func (e *TestEvmConfig) GasEstimator() evmconfig.GasEstimator { + return &TestGasEstimatorConfig{bumpThreshold: e.BumpThreshold} +} + +type TestLimitJobTypeConfig struct { +} + +func (l *TestLimitJobTypeConfig) OCR() *uint32 { return ptr(uint32(0)) } +func (l *TestLimitJobTypeConfig) OCR2() *uint32 { return ptr(uint32(0)) } +func (l *TestLimitJobTypeConfig) DR() *uint32 { return ptr(uint32(0)) } +func (l *TestLimitJobTypeConfig) FM() *uint32 { return ptr(uint32(0)) } +func (l *TestLimitJobTypeConfig) Keeper() *uint32 { return ptr(uint32(0)) } +func (l *TestLimitJobTypeConfig) VRF() *uint32 { return ptr(uint32(0)) } + +type TestBlockHistoryConfig struct { + evmconfig.BlockHistory +} + +func (b *TestBlockHistoryConfig) BatchSize() uint32 { return 42 } +func (b *TestBlockHistoryConfig) BlockDelay() uint16 { return 42 } +func (b *TestBlockHistoryConfig) BlockHistorySize() uint16 { return 42 } +func (b *TestBlockHistoryConfig) EIP1559FeeCapBufferBlocks() uint16 { return 42 } +func (b *TestBlockHistoryConfig) TransactionPercentile() uint16 { return 42 } + +type TestFeeHistoryConfig struct { + evmconfig.FeeHistory +} + +type transactionsConfig struct { + evmconfig.Transactions + e *TestEvmConfig + autoPurge evmconfig.AutoPurgeConfig +} + +func (*transactionsConfig) ForwardersEnabled() bool { return false } +func (t *transactionsConfig) MaxInFlight() uint32 { return t.e.MaxInFlight } +func (t *transactionsConfig) MaxQueued() uint64 { return t.e.MaxQueued } +func (t *transactionsConfig) ReaperInterval() time.Duration { return t.e.ReaperInterval } +func (t *transactionsConfig) ReaperThreshold() time.Duration { return t.e.ReaperThreshold } +func (t *transactionsConfig) ResendAfterThreshold() time.Duration { return t.e.ResendAfterThreshold } +func (t *transactionsConfig) AutoPurge() evmconfig.AutoPurgeConfig { return t.autoPurge } + +type autoPurgeConfig struct { + evmconfig.AutoPurgeConfig +} + +func (a *autoPurgeConfig) Enabled() bool { return false } + +type MockConfig struct { + EvmConfig *TestEvmConfig + RpcDefaultBatchSize uint32 + finalityDepth uint32 + finalityTagEnabled bool +} + +func (c *MockConfig) EVM() evmconfig.EVM { + return c.EvmConfig +} + +func (c *MockConfig) NonceAutoSync() bool { return true } +func (c *MockConfig) ChainType() chaintype.ChainType { return "" } +func (c *MockConfig) FinalityDepth() uint32 { return c.finalityDepth } +func (c *MockConfig) SetFinalityDepth(fd uint32) { c.finalityDepth = fd } +func (c *MockConfig) FinalityTagEnabled() bool { return c.finalityTagEnabled } +func (c *MockConfig) RPCDefaultBatchSize() uint32 { return c.RpcDefaultBatchSize } + +func MakeTestConfigs(t *testing.T) (*MockConfig, *TestDatabaseConfig, *TestEvmConfig) { + db := &TestDatabaseConfig{defaultQueryTimeout: utils.DefaultQueryTimeout} + ec := &TestEvmConfig{ + HeadTrackerConfig: &TestHeadTrackerConfig{}, + BumpThreshold: 42, + MaxInFlight: uint32(42), + MaxQueued: uint64(0), + ReaperInterval: time.Duration(0), + ReaperThreshold: time.Duration(0), + } + config := &MockConfig{EvmConfig: ec} + return config, db, ec +} diff --git a/core/capabilities/ccip/ocrimpls/keyring.go b/core/capabilities/ccip/ocrimpls/keyring.go new file mode 100644 index 00000000000..4b15c75b09a --- /dev/null +++ b/core/capabilities/ccip/ocrimpls/keyring.go @@ -0,0 +1,61 @@ +package ocrimpls + +import ( + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/smartcontractkit/libocr/offchainreporting2plus/ocr3types" + "github.com/smartcontractkit/libocr/offchainreporting2plus/types" + + "github.com/smartcontractkit/chainlink/v2/core/logger" +) + +var _ ocr3types.OnchainKeyring[[]byte] = &ocr3Keyring[[]byte]{} + +type ocr3Keyring[RI any] struct { + core types.OnchainKeyring + lggr logger.Logger +} + +func NewOnchainKeyring[RI any](keyring types.OnchainKeyring, lggr logger.Logger) *ocr3Keyring[RI] { + return &ocr3Keyring[RI]{ + core: keyring, + lggr: lggr.Named("OCR3Keyring"), + } +} + +func (w *ocr3Keyring[RI]) PublicKey() types.OnchainPublicKey { + return w.core.PublicKey() +} + +func (w *ocr3Keyring[RI]) MaxSignatureLength() int { + return w.core.MaxSignatureLength() +} + +func (w *ocr3Keyring[RI]) Sign(configDigest types.ConfigDigest, seqNr uint64, r ocr3types.ReportWithInfo[RI]) (signature []byte, err error) { + epoch, round := uint64ToUint32AndUint8(seqNr) + rCtx := types.ReportContext{ + ReportTimestamp: types.ReportTimestamp{ + ConfigDigest: configDigest, + Epoch: epoch, + Round: round, + }, + } + + w.lggr.Debugw("signing report", "configDigest", configDigest.Hex(), "seqNr", seqNr, "report", hexutil.Encode(r.Report)) + + return w.core.Sign(rCtx, r.Report) +} + +func (w *ocr3Keyring[RI]) Verify(key types.OnchainPublicKey, configDigest types.ConfigDigest, seqNr uint64, r ocr3types.ReportWithInfo[RI], signature []byte) bool { + epoch, round := uint64ToUint32AndUint8(seqNr) + rCtx := types.ReportContext{ + ReportTimestamp: types.ReportTimestamp{ + ConfigDigest: configDigest, + Epoch: epoch, + Round: round, + }, + } + + w.lggr.Debugw("verifying report", "configDigest", configDigest.Hex(), "seqNr", seqNr, "report", hexutil.Encode(r.Report)) + + return w.core.Verify(key, rCtx, r.Report, signature) +} diff --git a/core/capabilities/ccip/oraclecreator/bootstrap.go b/core/capabilities/ccip/oraclecreator/bootstrap.go new file mode 100644 index 00000000000..22de4ae9486 --- /dev/null +++ b/core/capabilities/ccip/oraclecreator/bootstrap.go @@ -0,0 +1,97 @@ +package oraclecreator + +import ( + "context" + "fmt" + + "github.com/ethereum/go-ethereum/common/hexutil" + + chainsel "github.com/smartcontractkit/chain-selectors" + "github.com/smartcontractkit/libocr/commontypes" + libocr3 "github.com/smartcontractkit/libocr/offchainreporting2plus" + "github.com/smartcontractkit/libocr/offchainreporting2plus/ocr3types" + + "github.com/smartcontractkit/chainlink-common/pkg/types" + + "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/ocrimpls" + cctypes "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/types" + "github.com/smartcontractkit/chainlink/v2/core/logger" + "github.com/smartcontractkit/chainlink/v2/core/services/keystore/chaintype" + "github.com/smartcontractkit/chainlink/v2/core/services/ocrcommon" + "github.com/smartcontractkit/chainlink/v2/core/services/synchronization" + "github.com/smartcontractkit/chainlink/v2/core/services/telemetry" +) + +var _ cctypes.OracleCreator = &bootstrapOracleCreator{} + +type bootstrapOracleCreator struct { + peerWrapper *ocrcommon.SingletonPeerWrapper + bootstrapperLocators []commontypes.BootstrapperLocator + db ocr3types.Database + monitoringEndpointGen telemetry.MonitoringEndpointGenerator + lggr logger.Logger +} + +func NewBootstrapOracleCreator( + peerWrapper *ocrcommon.SingletonPeerWrapper, + bootstrapperLocators []commontypes.BootstrapperLocator, + db ocr3types.Database, + monitoringEndpointGen telemetry.MonitoringEndpointGenerator, + lggr logger.Logger, +) cctypes.OracleCreator { + return &bootstrapOracleCreator{ + peerWrapper: peerWrapper, + bootstrapperLocators: bootstrapperLocators, + db: db, + monitoringEndpointGen: monitoringEndpointGen, + lggr: lggr, + } +} + +// Type implements types.OracleCreator. +func (i *bootstrapOracleCreator) Type() cctypes.OracleType { + return cctypes.OracleTypeBootstrap +} + +// Create implements types.OracleCreator. +func (i *bootstrapOracleCreator) Create(_ uint32, config cctypes.OCR3ConfigWithMeta) (cctypes.CCIPOracle, error) { + // Assuming that the chain selector is referring to an evm chain for now. + // TODO: add an api that returns chain family. + // NOTE: this doesn't really matter for the bootstrap node, it doesn't do anything on-chain. + // Its for the monitoring endpoint generation below. + chainID, err := chainsel.ChainIdFromSelector(uint64(config.Config.ChainSelector)) + if err != nil { + return nil, fmt.Errorf("failed to get chain ID from selector: %w", err) + } + + destChainFamily := chaintype.EVM + destRelayID := types.NewRelayID(string(destChainFamily), fmt.Sprintf("%d", chainID)) + + bootstrapperArgs := libocr3.BootstrapperArgs{ + BootstrapperFactory: i.peerWrapper.Peer2, + V2Bootstrappers: i.bootstrapperLocators, + ContractConfigTracker: ocrimpls.NewConfigTracker(config), + Database: i.db, + LocalConfig: defaultLocalConfig(), + Logger: ocrcommon.NewOCRWrapper( + i.lggr. + Named("CCIPBootstrap"). + Named(destRelayID.String()). + Named(config.Config.ChainSelector.String()). + Named(hexutil.Encode(config.Config.OfframpAddress)), + false, /* traceLogging */ + func(ctx context.Context, msg string) {}), + MonitoringEndpoint: i.monitoringEndpointGen.GenMonitoringEndpoint( + string(destChainFamily), + destRelayID.ChainID, + hexutil.Encode(config.Config.OfframpAddress), + synchronization.OCR3CCIPBootstrap, + ), + OffchainConfigDigester: ocrimpls.NewConfigDigester(config.ConfigDigest), + } + bootstrapper, err := libocr3.NewBootstrapper(bootstrapperArgs) + if err != nil { + return nil, err + } + return bootstrapper, nil +} diff --git a/core/capabilities/ccip/oraclecreator/plugin.go b/core/capabilities/ccip/oraclecreator/plugin.go new file mode 100644 index 00000000000..3515ae39994 --- /dev/null +++ b/core/capabilities/ccip/oraclecreator/plugin.go @@ -0,0 +1,509 @@ +package oraclecreator + +import ( + "context" + "fmt" + "time" + + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/google/uuid" + "github.com/prometheus/client_golang/prometheus" + "github.com/smartcontractkit/libocr/offchainreporting2plus/ocr3confighelper" + + "github.com/smartcontractkit/chainlink-ccip/execute/tokendata" + "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/ccipevm" + evmconfig "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/configs/evm" + "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/ocrimpls" + cctypes "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/types" + + chainsel "github.com/smartcontractkit/chain-selectors" + + "github.com/smartcontractkit/libocr/commontypes" + libocr3 "github.com/smartcontractkit/libocr/offchainreporting2plus" + "github.com/smartcontractkit/libocr/offchainreporting2plus/ocr3types" + ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" + + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccipocr3" + + commitocr3 "github.com/smartcontractkit/chainlink-ccip/commit" + execocr3 "github.com/smartcontractkit/chainlink-ccip/execute" + "github.com/smartcontractkit/chainlink-ccip/pkg/consts" + ccipreaderpkg "github.com/smartcontractkit/chainlink-ccip/pkg/reader" + "github.com/smartcontractkit/chainlink-ccip/pluginconfig" + + "github.com/smartcontractkit/chainlink-common/pkg/types" + "github.com/smartcontractkit/chainlink/v2/core/chains/legacyevm" + "github.com/smartcontractkit/chainlink/v2/core/logger" + "github.com/smartcontractkit/chainlink/v2/core/services/job" + "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ocr2key" + "github.com/smartcontractkit/chainlink/v2/core/services/ocrcommon" + "github.com/smartcontractkit/chainlink/v2/core/services/relay" + "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm" + evmrelaytypes "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/types" + "github.com/smartcontractkit/chainlink/v2/core/services/synchronization" + "github.com/smartcontractkit/chainlink/v2/core/services/telemetry" +) + +var _ cctypes.OracleCreator = &pluginOracleCreator{} + +const ( + defaultCommitGasLimit = 500_000 +) + +// pluginOracleCreator creates oracles that reference plugins running +// in the same process as the chainlink node, i.e not LOOPPs. +type pluginOracleCreator struct { + ocrKeyBundles map[string]ocr2key.KeyBundle + transmitters map[types.RelayID][]string + chains legacyevm.LegacyChainContainer + peerWrapper *ocrcommon.SingletonPeerWrapper + externalJobID uuid.UUID + jobID int32 + isNewlyCreatedJob bool + pluginConfig job.JSONConfig + db ocr3types.Database + lggr logger.Logger + monitoringEndpointGen telemetry.MonitoringEndpointGenerator + bootstrapperLocators []commontypes.BootstrapperLocator + homeChainReader ccipreaderpkg.HomeChain + homeChainSelector cciptypes.ChainSelector +} + +func NewPluginOracleCreator( + ocrKeyBundles map[string]ocr2key.KeyBundle, + transmitters map[types.RelayID][]string, + chains legacyevm.LegacyChainContainer, + peerWrapper *ocrcommon.SingletonPeerWrapper, + externalJobID uuid.UUID, + jobID int32, + isNewlyCreatedJob bool, + pluginConfig job.JSONConfig, + db ocr3types.Database, + lggr logger.Logger, + monitoringEndpointGen telemetry.MonitoringEndpointGenerator, + bootstrapperLocators []commontypes.BootstrapperLocator, + homeChainReader ccipreaderpkg.HomeChain, + homeChainSelector cciptypes.ChainSelector, +) cctypes.OracleCreator { + return &pluginOracleCreator{ + ocrKeyBundles: ocrKeyBundles, + transmitters: transmitters, + chains: chains, + peerWrapper: peerWrapper, + externalJobID: externalJobID, + jobID: jobID, + isNewlyCreatedJob: isNewlyCreatedJob, + pluginConfig: pluginConfig, + db: db, + lggr: lggr, + monitoringEndpointGen: monitoringEndpointGen, + bootstrapperLocators: bootstrapperLocators, + homeChainReader: homeChainReader, + homeChainSelector: homeChainSelector, + } +} + +// Type implements types.OracleCreator. +func (i *pluginOracleCreator) Type() cctypes.OracleType { + return cctypes.OracleTypePlugin +} + +// Create implements types.OracleCreator. +func (i *pluginOracleCreator) Create(donID uint32, config cctypes.OCR3ConfigWithMeta) (cctypes.CCIPOracle, error) { + pluginType := cctypes.PluginType(config.Config.PluginType) + + // Assuming that the chain selector is referring to an evm chain for now. + // TODO: add an api that returns chain family. + destChainID, err := chainsel.ChainIdFromSelector(uint64(config.Config.ChainSelector)) + if err != nil { + return nil, fmt.Errorf("failed to get chain ID from selector %d: %w", config.Config.ChainSelector, err) + } + destChainFamily := relay.NetworkEVM + destRelayID := types.NewRelayID(destChainFamily, fmt.Sprintf("%d", destChainID)) + + configTracker := ocrimpls.NewConfigTracker(config) + publicConfig, err := configTracker.PublicConfig() + if err != nil { + return nil, fmt.Errorf("failed to get public config from OCR config: %w", err) + } + + contractReaders, chainWriters, err := i.createReadersAndWriters( + destChainID, + pluginType, + config, + publicConfig, + ) + if err != nil { + return nil, fmt.Errorf("failed to create readers and writers: %w", err) + } + + // build the onchain keyring. it will be the signing key for the destination chain family. + keybundle, ok := i.ocrKeyBundles[destChainFamily] + if !ok { + return nil, fmt.Errorf("no OCR key bundle found for chain family %s, forgot to create one?", destChainFamily) + } + onchainKeyring := ocrimpls.NewOnchainKeyring[[]byte](keybundle, i.lggr) + + // build the contract transmitter + // assume that we are using the first account in the keybundle as the from account + // and that we are able to transmit to the dest chain. + // TODO: revisit this in the future, since not all oracles will be able to transmit to the dest chain. + destChainWriter, ok := chainWriters[config.Config.ChainSelector] + if !ok { + return nil, fmt.Errorf("no chain writer found for dest chain selector %d, can't create contract transmitter", + config.Config.ChainSelector) + } + destFromAccounts, ok := i.transmitters[destRelayID] + if !ok { + return nil, fmt.Errorf("no transmitter found for dest relay ID %s, can't create contract transmitter", destRelayID) + } + + // TODO: Extract the correct transmitter address from the destsFromAccount + factory, transmitter, err := i.createFactoryAndTransmitter(donID, config, destRelayID, contractReaders, chainWriters, destChainWriter, destFromAccounts) + if err != nil { + return nil, fmt.Errorf("failed to create factory and transmitter: %w", err) + } + + oracleArgs := libocr3.OCR3OracleArgs[[]byte]{ + BinaryNetworkEndpointFactory: i.peerWrapper.Peer2, + Database: i.db, + // NOTE: when specifying V2Bootstrappers here we actually do NOT need to run a full bootstrap node! + // Thus it is vital that the bootstrapper locators are correctly set in the job spec. + V2Bootstrappers: i.bootstrapperLocators, + ContractConfigTracker: configTracker, + ContractTransmitter: transmitter, + LocalConfig: defaultLocalConfig(), + Logger: ocrcommon.NewOCRWrapper( + i.lggr. + Named(fmt.Sprintf("CCIP%sOCR3", pluginType.String())). + Named(destRelayID.String()). + Named(hexutil.Encode(config.Config.OfframpAddress)), + false, + func(ctx context.Context, msg string) {}), + MetricsRegisterer: prometheus.WrapRegistererWith(map[string]string{"name": fmt.Sprintf("commit-%d", config.Config.ChainSelector)}, prometheus.DefaultRegisterer), + MonitoringEndpoint: i.monitoringEndpointGen.GenMonitoringEndpoint( + destChainFamily, + destRelayID.ChainID, + string(config.Config.OfframpAddress), + synchronization.OCR3CCIPCommit, + ), + OffchainConfigDigester: ocrimpls.NewConfigDigester(config.ConfigDigest), + OffchainKeyring: keybundle, + OnchainKeyring: onchainKeyring, + ReportingPluginFactory: factory, + } + oracle, err := libocr3.NewOracle(oracleArgs) + if err != nil { + return nil, err + } + return oracle, nil +} + +func (i *pluginOracleCreator) createFactoryAndTransmitter( + donID uint32, + config cctypes.OCR3ConfigWithMeta, + destRelayID types.RelayID, + contractReaders map[cciptypes.ChainSelector]types.ContractReader, + chainWriters map[cciptypes.ChainSelector]types.ChainWriter, + destChainWriter types.ChainWriter, + destFromAccounts []string, +) (ocr3types.ReportingPluginFactory[[]byte], ocr3types.ContractTransmitter[[]byte], error) { + var factory ocr3types.ReportingPluginFactory[[]byte] + var transmitter ocr3types.ContractTransmitter[[]byte] + if config.Config.PluginType == uint8(cctypes.PluginTypeCCIPCommit) { + factory = commitocr3.NewPluginFactory( + i.lggr. + Named("CCIPCommitPlugin"). + Named(destRelayID.String()). + Named(fmt.Sprintf("%d", config.Config.ChainSelector)). + Named(hexutil.Encode(config.Config.OfframpAddress)), + donID, + ccipreaderpkg.OCR3ConfigWithMeta(config), + ccipevm.NewCommitPluginCodecV1(), + ccipevm.NewMessageHasherV1(), + i.homeChainReader, + i.homeChainSelector, + contractReaders, + chainWriters, + ) + transmitter = ocrimpls.NewCommitContractTransmitter[[]byte](destChainWriter, + ocrtypes.Account(destFromAccounts[0]), + hexutil.Encode(config.Config.OfframpAddress), // TODO: this works for evm only, how about non-evm? + ) + } else if config.Config.PluginType == uint8(cctypes.PluginTypeCCIPExec) { + factory = execocr3.NewPluginFactory( + i.lggr. + Named("CCIPExecPlugin"). + Named(destRelayID.String()). + Named(hexutil.Encode(config.Config.OfframpAddress)), + donID, + ccipreaderpkg.OCR3ConfigWithMeta(config), + ccipevm.NewExecutePluginCodecV1(), + ccipevm.NewMessageHasherV1(), + i.homeChainReader, + &tokendata.NoopTokenDataObserver{}, + ccipevm.NewGasEstimateProvider(), + contractReaders, + chainWriters, + ) + transmitter = ocrimpls.NewExecContractTransmitter[[]byte](destChainWriter, + ocrtypes.Account(destFromAccounts[0]), + hexutil.Encode(config.Config.OfframpAddress), // TODO: this works for evm only, how about non-evm? + ) + } else { + return nil, nil, fmt.Errorf("unsupported plugin type %d", config.Config.PluginType) + } + return factory, transmitter, nil +} + +func (i *pluginOracleCreator) createReadersAndWriters( + destChainID uint64, + pluginType cctypes.PluginType, + config cctypes.OCR3ConfigWithMeta, + publicCfg ocr3confighelper.PublicConfig, +) ( + map[cciptypes.ChainSelector]types.ContractReader, + map[cciptypes.ChainSelector]types.ChainWriter, + error, +) { + ofc, err := decodeAndValidateOffchainConfig(pluginType, publicCfg) + if err != nil { + return nil, nil, err + } + + var execBatchGasLimit uint64 + if !ofc.execEmpty() { + execBatchGasLimit = ofc.exec().BatchGasLimit + } + + homeChainID, err := i.getChainID(i.homeChainSelector) + if err != nil { + return nil, nil, err + } + + contractReaders := make(map[cciptypes.ChainSelector]types.ContractReader) + chainWriters := make(map[cciptypes.ChainSelector]types.ChainWriter) + for _, chain := range i.chains.Slice() { + chainSelector, err1 := i.getChainSelector(chain.ID().Uint64()) + if err1 != nil { + return nil, nil, err1 + } + + chainReaderConfig := getChainReaderConfig(chain.ID().Uint64(), destChainID, homeChainID, ofc, chainSelector) + cr, err1 := createChainReader(i.lggr, chain, chainReaderConfig, pluginType) + if err1 != nil { + return nil, nil, err1 + } + + if err2 := bindContracts(chain, cr, config, destChainID); err2 != nil { + return nil, nil, err2 + } + + if err3 := cr.Start(context.Background()); err3 != nil { + return nil, nil, fmt.Errorf("failed to start contract reader for chain %s: %w", chain.ID(), err3) + } + + cw, err1 := createChainWriter(i.lggr, chain, pluginType, i.transmitters, execBatchGasLimit) + if err1 != nil { + return nil, nil, err1 + } + + if err4 := cw.Start(context.Background()); err4 != nil { + return nil, nil, fmt.Errorf("failed to start chain writer for chain %s: %w", chain.ID(), err4) + } + + contractReaders[chainSelector] = cr + chainWriters[chainSelector] = cw + } + return contractReaders, chainWriters, nil +} + +func decodeAndValidateOffchainConfig( + pluginType cctypes.PluginType, + publicConfig ocr3confighelper.PublicConfig, +) (offChainConfig, error) { + var ofc offChainConfig + if pluginType == cctypes.PluginTypeCCIPExec { + execOffchainCfg, err1 := pluginconfig.DecodeExecuteOffchainConfig(publicConfig.ReportingPluginConfig) + if err1 != nil { + return offChainConfig{}, fmt.Errorf("failed to decode execute offchain config: %w, raw: %s", err1, string(publicConfig.ReportingPluginConfig)) + } + if err2 := execOffchainCfg.Validate(); err2 != nil { + return offChainConfig{}, fmt.Errorf("failed to validate execute offchain config: %w", err2) + } + ofc.execOffchainConfig = &execOffchainCfg + } else if pluginType == cctypes.PluginTypeCCIPCommit { + commitOffchainCfg, err1 := pluginconfig.DecodeCommitOffchainConfig(publicConfig.ReportingPluginConfig) + if err1 != nil { + return offChainConfig{}, fmt.Errorf("failed to decode commit offchain config: %w, raw: %s", err1, string(publicConfig.ReportingPluginConfig)) + } + if err2 := commitOffchainCfg.Validate(); err2 != nil { + return offChainConfig{}, fmt.Errorf("failed to validate commit offchain config: %w", err2) + } + ofc.commitOffchainConfig = &commitOffchainCfg + } + if !ofc.isValid() { + return offChainConfig{}, fmt.Errorf("invalid offchain config: both commit and exec configs are either set or unset") + } + return ofc, nil +} + +func (i *pluginOracleCreator) getChainSelector(chainID uint64) (cciptypes.ChainSelector, error) { + chainSelector, ok := chainsel.EvmChainIdToChainSelector()[chainID] + if !ok { + return 0, fmt.Errorf("failed to get chain selector from chain ID %d", chainID) + } + return cciptypes.ChainSelector(chainSelector), nil +} + +func (i *pluginOracleCreator) getChainID(chainSelector cciptypes.ChainSelector) (uint64, error) { + chainID, err := chainsel.ChainIdFromSelector(uint64(chainSelector)) + if err != nil { + return 0, fmt.Errorf("failed to get chain ID from chain selector %d: %w", chainSelector, err) + } + return chainID, nil +} + +func getChainReaderConfig( + chainID uint64, + destChainID uint64, + homeChainID uint64, + ofc offChainConfig, + chainSelector cciptypes.ChainSelector, +) evmrelaytypes.ChainReaderConfig { + var chainReaderConfig evmrelaytypes.ChainReaderConfig + if chainID == destChainID { + chainReaderConfig = evmconfig.DestReaderConfig + } else { + chainReaderConfig = evmconfig.SourceReaderConfig + } + + if !ofc.commitEmpty() && ofc.commit().PriceFeedChainSelector == chainSelector { + chainReaderConfig = evmconfig.MergeReaderConfigs(chainReaderConfig, evmconfig.FeedReaderConfig) + } + + if chainID == homeChainID { + chainReaderConfig = evmconfig.MergeReaderConfigs(chainReaderConfig, evmconfig.HomeChainReaderConfigRaw) + } + return chainReaderConfig +} + +func createChainReader( + lggr logger.Logger, + chain legacyevm.Chain, + chainReaderConfig evmrelaytypes.ChainReaderConfig, + pluginType cctypes.PluginType, +) (types.ContractReader, error) { + cr, err := evm.NewChainReaderService( + context.Background(), + lggr. + Named("EVMChainReaderService"). + Named(chain.ID().String()). + Named(pluginType.String()), + chain.LogPoller(), + chain.HeadTracker(), + chain.Client(), + chainReaderConfig, + ) + if err != nil { + return nil, fmt.Errorf("failed to create contract reader for chain %s: %w", chain.ID(), err) + } + return cr, nil +} + +func bindContracts( + chain legacyevm.Chain, + cr types.ContractReader, + config cctypes.OCR3ConfigWithMeta, + destChainID uint64, +) error { + if chain.ID().Uint64() == destChainID { + offrampAddressHex := common.BytesToAddress(config.Config.OfframpAddress).Hex() + err := cr.Bind(context.Background(), []types.BoundContract{ + { + Address: offrampAddressHex, + Name: consts.ContractNameOffRamp, + }, + }) + if err != nil { + return fmt.Errorf("failed to bind chain reader for dest chain %s's offramp at %s: %w", chain.ID(), offrampAddressHex, err) + } + } + return nil +} + +func createChainWriter( + lggr logger.Logger, + chain legacyevm.Chain, + pluginType cctypes.PluginType, + transmitters map[types.RelayID][]string, + execBatchGasLimit uint64, +) (types.ChainWriter, error) { + var fromAddress common.Address + transmitter, ok := transmitters[types.NewRelayID(relay.NetworkEVM, chain.ID().String())] + if ok { + // TODO: remove EVM-specific stuff + fromAddress = common.HexToAddress(transmitter[0]) + } + cw, err := evm.NewChainWriterService( + lggr.Named("EVMChainWriterService"). + Named(chain.ID().String()). + Named(pluginType.String()), + chain.Client(), + chain.TxManager(), + chain.GasEstimator(), + evmconfig.ChainWriterConfigRaw( + fromAddress, + chain.Config().EVM().GasEstimator().PriceMaxKey(fromAddress), + defaultCommitGasLimit, + execBatchGasLimit, + ), + ) + if err != nil { + return nil, fmt.Errorf("failed to create chain writer for chain %s: %w", chain.ID(), err) + } + return cw, nil +} + +type offChainConfig struct { + commitOffchainConfig *pluginconfig.CommitOffchainConfig + execOffchainConfig *pluginconfig.ExecuteOffchainConfig +} + +func (ofc offChainConfig) commitEmpty() bool { + return ofc.commitOffchainConfig == nil +} + +func (ofc offChainConfig) execEmpty() bool { + return ofc.execOffchainConfig == nil +} + +func (ofc offChainConfig) commit() *pluginconfig.CommitOffchainConfig { + return ofc.commitOffchainConfig +} + +func (ofc offChainConfig) exec() *pluginconfig.ExecuteOffchainConfig { + return ofc.execOffchainConfig +} + +// Exactly one of both plugins should be empty at any given time. +func (ofc offChainConfig) isValid() bool { + return (ofc.commitEmpty() && !ofc.execEmpty()) || (!ofc.commitEmpty() && ofc.execEmpty()) +} + +func defaultLocalConfig() ocrtypes.LocalConfig { + return ocrtypes.LocalConfig{ + BlockchainTimeout: 10 * time.Second, + // Config tracking is handled by the launcher, since we're doing blue-green + // deployments we're not going to be using OCR's built-in config switching, + // which always shuts down the previous instance. + ContractConfigConfirmations: 1, + SkipContractConfigConfirmations: true, + ContractConfigTrackerPollInterval: 10 * time.Second, + ContractTransmitterTransmitTimeout: 10 * time.Second, + DatabaseTimeout: 10 * time.Second, + MinOCR2MaxDurationQuery: 1 * time.Second, + DevelopmentMode: "false", + } +} diff --git a/core/capabilities/ccip/types/mocks/ccip_oracle.go b/core/capabilities/ccip/types/mocks/ccip_oracle.go new file mode 100644 index 00000000000..c849b3d9414 --- /dev/null +++ b/core/capabilities/ccip/types/mocks/ccip_oracle.go @@ -0,0 +1,122 @@ +// Code generated by mockery v2.43.2. DO NOT EDIT. + +package mocks + +import mock "github.com/stretchr/testify/mock" + +// CCIPOracle is an autogenerated mock type for the CCIPOracle type +type CCIPOracle struct { + mock.Mock +} + +type CCIPOracle_Expecter struct { + mock *mock.Mock +} + +func (_m *CCIPOracle) EXPECT() *CCIPOracle_Expecter { + return &CCIPOracle_Expecter{mock: &_m.Mock} +} + +// Close provides a mock function with given fields: +func (_m *CCIPOracle) Close() error { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Close") + } + + var r0 error + if rf, ok := ret.Get(0).(func() error); ok { + r0 = rf() + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// CCIPOracle_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close' +type CCIPOracle_Close_Call struct { + *mock.Call +} + +// Close is a helper method to define mock.On call +func (_e *CCIPOracle_Expecter) Close() *CCIPOracle_Close_Call { + return &CCIPOracle_Close_Call{Call: _e.mock.On("Close")} +} + +func (_c *CCIPOracle_Close_Call) Run(run func()) *CCIPOracle_Close_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *CCIPOracle_Close_Call) Return(_a0 error) *CCIPOracle_Close_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *CCIPOracle_Close_Call) RunAndReturn(run func() error) *CCIPOracle_Close_Call { + _c.Call.Return(run) + return _c +} + +// Start provides a mock function with given fields: +func (_m *CCIPOracle) Start() error { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Start") + } + + var r0 error + if rf, ok := ret.Get(0).(func() error); ok { + r0 = rf() + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// CCIPOracle_Start_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Start' +type CCIPOracle_Start_Call struct { + *mock.Call +} + +// Start is a helper method to define mock.On call +func (_e *CCIPOracle_Expecter) Start() *CCIPOracle_Start_Call { + return &CCIPOracle_Start_Call{Call: _e.mock.On("Start")} +} + +func (_c *CCIPOracle_Start_Call) Run(run func()) *CCIPOracle_Start_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *CCIPOracle_Start_Call) Return(_a0 error) *CCIPOracle_Start_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *CCIPOracle_Start_Call) RunAndReturn(run func() error) *CCIPOracle_Start_Call { + _c.Call.Return(run) + return _c +} + +// NewCCIPOracle creates a new instance of CCIPOracle. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewCCIPOracle(t interface { + mock.TestingT + Cleanup(func()) +}) *CCIPOracle { + mock := &CCIPOracle{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/core/capabilities/ccip/types/mocks/home_chain_reader.go b/core/capabilities/ccip/types/mocks/home_chain_reader.go new file mode 100644 index 00000000000..a5a581a1d2d --- /dev/null +++ b/core/capabilities/ccip/types/mocks/home_chain_reader.go @@ -0,0 +1,129 @@ +package mocks + +import ( + "context" + + mapset "github.com/deckarep/golang-set/v2" + "github.com/stretchr/testify/mock" + + ccipreaderpkg "github.com/smartcontractkit/chainlink-ccip/pkg/reader" + + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccipocr3" + + "github.com/smartcontractkit/libocr/ragep2p/types" +) + +var _ ccipreaderpkg.HomeChain = (*HomeChainReader)(nil) + +type HomeChainReader struct { + mock.Mock +} + +func (_m *HomeChainReader) GetChainConfig(chainSelector cciptypes.ChainSelector) (ccipreaderpkg.ChainConfig, error) { + //TODO implement me + panic("implement me") +} + +func (_m *HomeChainReader) GetAllChainConfigs() (map[cciptypes.ChainSelector]ccipreaderpkg.ChainConfig, error) { + //TODO implement me + panic("implement me") +} + +func (_m *HomeChainReader) GetSupportedChainsForPeer(id types.PeerID) (mapset.Set[cciptypes.ChainSelector], error) { + //TODO implement me + panic("implement me") +} + +func (_m *HomeChainReader) GetKnownCCIPChains() (mapset.Set[cciptypes.ChainSelector], error) { + //TODO implement me + panic("implement me") +} + +func (_m *HomeChainReader) GetFChain() (map[cciptypes.ChainSelector]int, error) { + //TODO implement me + panic("implement me") +} + +func (_m *HomeChainReader) Start(ctx context.Context) error { + //TODO implement me + panic("implement me") +} + +func (_m *HomeChainReader) Close() error { + //TODO implement me + panic("implement me") +} + +func (_m *HomeChainReader) HealthReport() map[string]error { + //TODO implement me + panic("implement me") +} + +func (_m *HomeChainReader) Name() string { + //TODO implement me + panic("implement me") +} + +// GetOCRConfigs provides a mock function with given fields: ctx, donID, pluginType +func (_m *HomeChainReader) GetOCRConfigs(ctx context.Context, donID uint32, pluginType uint8) ([]ccipreaderpkg.OCR3ConfigWithMeta, error) { + ret := _m.Called(ctx, donID, pluginType) + + if len(ret) == 0 { + panic("no return value specified for GetOCRConfigs") + } + + var r0 []ccipreaderpkg.OCR3ConfigWithMeta + var r1 error + if rf, ok := ret.Get(0).(func(ctx context.Context, donID uint32, pluginType uint8) ([]ccipreaderpkg.OCR3ConfigWithMeta, error)); ok { + return rf(ctx, donID, pluginType) + } + if rf, ok := ret.Get(0).(func(ctx context.Context, donID uint32, pluginType uint8) []ccipreaderpkg.OCR3ConfigWithMeta); ok { + r0 = rf(ctx, donID, pluginType) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]ccipreaderpkg.OCR3ConfigWithMeta) + } + } + + if rf, ok := ret.Get(1).(func(ctx context.Context, donID uint32, pluginType uint8) error); ok { + r1 = rf(ctx, donID, pluginType) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +func (_m *HomeChainReader) Ready() error { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Ready") + } + + var r0 error + if rf, ok := ret.Get(0).(func() error); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() error); ok { + r0 = rf() + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// NewHomeChainReader creates a new instance of HomeChainReader. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewHomeChainReader(t interface { + mock.TestingT + Cleanup(func()) +}) *HomeChainReader { + mock := &HomeChainReader{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/core/capabilities/ccip/types/mocks/oracle_creator.go b/core/capabilities/ccip/types/mocks/oracle_creator.go new file mode 100644 index 00000000000..362a89a94d9 --- /dev/null +++ b/core/capabilities/ccip/types/mocks/oracle_creator.go @@ -0,0 +1,139 @@ +// Code generated by mockery v2.43.2. DO NOT EDIT. + +package mocks + +import ( + types "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/types" + mock "github.com/stretchr/testify/mock" +) + +// OracleCreator is an autogenerated mock type for the OracleCreator type +type OracleCreator struct { + mock.Mock +} + +type OracleCreator_Expecter struct { + mock *mock.Mock +} + +func (_m *OracleCreator) EXPECT() *OracleCreator_Expecter { + return &OracleCreator_Expecter{mock: &_m.Mock} +} + +// Create provides a mock function with given fields: donID, config +func (_m *OracleCreator) Create(donID uint32, config types.OCR3ConfigWithMeta) (types.CCIPOracle, error) { + ret := _m.Called(donID, config) + + if len(ret) == 0 { + panic("no return value specified for Create") + } + + var r0 types.CCIPOracle + var r1 error + if rf, ok := ret.Get(0).(func(uint32, types.OCR3ConfigWithMeta) (types.CCIPOracle, error)); ok { + return rf(donID, config) + } + if rf, ok := ret.Get(0).(func(uint32, types.OCR3ConfigWithMeta) types.CCIPOracle); ok { + r0 = rf(donID, config) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(types.CCIPOracle) + } + } + + if rf, ok := ret.Get(1).(func(uint32, types.OCR3ConfigWithMeta) error); ok { + r1 = rf(donID, config) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// OracleCreator_Create_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Create' +type OracleCreator_Create_Call struct { + *mock.Call +} + +// Create is a helper method to define mock.On call +// - donID uint32 +// - config types.OCR3ConfigWithMeta +func (_e *OracleCreator_Expecter) Create(donID interface{}, config interface{}) *OracleCreator_Create_Call { + return &OracleCreator_Create_Call{Call: _e.mock.On("Create", donID, config)} +} + +func (_c *OracleCreator_Create_Call) Run(run func(donID uint32, config types.OCR3ConfigWithMeta)) *OracleCreator_Create_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(uint32), args[1].(types.OCR3ConfigWithMeta)) + }) + return _c +} + +func (_c *OracleCreator_Create_Call) Return(_a0 types.CCIPOracle, _a1 error) *OracleCreator_Create_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *OracleCreator_Create_Call) RunAndReturn(run func(uint32, types.OCR3ConfigWithMeta) (types.CCIPOracle, error)) *OracleCreator_Create_Call { + _c.Call.Return(run) + return _c +} + +// Type provides a mock function with given fields: +func (_m *OracleCreator) Type() types.OracleType { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Type") + } + + var r0 types.OracleType + if rf, ok := ret.Get(0).(func() types.OracleType); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(types.OracleType) + } + + return r0 +} + +// OracleCreator_Type_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Type' +type OracleCreator_Type_Call struct { + *mock.Call +} + +// Type is a helper method to define mock.On call +func (_e *OracleCreator_Expecter) Type() *OracleCreator_Type_Call { + return &OracleCreator_Type_Call{Call: _e.mock.On("Type")} +} + +func (_c *OracleCreator_Type_Call) Run(run func()) *OracleCreator_Type_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *OracleCreator_Type_Call) Return(_a0 types.OracleType) *OracleCreator_Type_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *OracleCreator_Type_Call) RunAndReturn(run func() types.OracleType) *OracleCreator_Type_Call { + _c.Call.Return(run) + return _c +} + +// NewOracleCreator creates a new instance of OracleCreator. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewOracleCreator(t interface { + mock.TestingT + Cleanup(func()) +}) *OracleCreator { + mock := &OracleCreator{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/core/capabilities/ccip/types/types.go b/core/capabilities/ccip/types/types.go new file mode 100644 index 00000000000..04da1157b33 --- /dev/null +++ b/core/capabilities/ccip/types/types.go @@ -0,0 +1,54 @@ +package types + +import ( + ccipreaderpkg "github.com/smartcontractkit/chainlink-ccip/pkg/reader" +) + +// OCR3ConfigWithMeta is a type alias in order to generate correct mocks for the OracleCreator interface. +type OCR3ConfigWithMeta ccipreaderpkg.OCR3ConfigWithMeta + +// PluginType represents the type of CCIP plugin. +// It mirrors the OCRPluginType in Internal.sol. +type PluginType uint8 + +const ( + PluginTypeCCIPCommit PluginType = 0 + PluginTypeCCIPExec PluginType = 1 +) + +func (pt PluginType) String() string { + switch pt { + case PluginTypeCCIPCommit: + return "CCIPCommit" + case PluginTypeCCIPExec: + return "CCIPExec" + default: + return "Unknown" + } +} + +type OracleType uint8 + +const ( + OracleTypePlugin OracleType = 0 + OracleTypeBootstrap OracleType = 1 +) + +// CCIPOracle represents either a CCIP commit or exec oracle or a bootstrap node. +type CCIPOracle interface { + Close() error + Start() error +} + +// OracleCreator is an interface for creating CCIP oracles. +// Whether the oracle uses a LOOPP or not is an implementation detail. +type OracleCreator interface { + // Create creates a new oracle that will run either the commit or exec ccip plugin, + // if its a plugin oracle, or a bootstrap oracle if its a bootstrap oracle. + // The oracle must be returned unstarted. + Create(donID uint32, config OCR3ConfigWithMeta) (CCIPOracle, error) + + // Type returns the type of oracle that this creator creates. + // The only valid values are OracleTypePlugin and OracleTypeBootstrap. + Type() OracleType +} diff --git a/core/capabilities/ccip/validate/validate.go b/core/capabilities/ccip/validate/validate.go new file mode 100644 index 00000000000..02e1cb5c8ee --- /dev/null +++ b/core/capabilities/ccip/validate/validate.go @@ -0,0 +1,91 @@ +package validate + +import ( + "fmt" + + "github.com/google/uuid" + "github.com/pelletier/go-toml" + + "github.com/smartcontractkit/chainlink/v2/core/services/job" + "github.com/smartcontractkit/chainlink/v2/core/services/ocrcommon" +) + +// ValidatedCCIPSpec validates the given toml string as a CCIP spec. +func ValidatedCCIPSpec(tomlString string) (jb job.Job, err error) { + var spec job.CCIPSpec + tree, err := toml.Load(tomlString) + if err != nil { + return job.Job{}, fmt.Errorf("toml error on load: %w", err) + } + // Note this validates all the fields which implement an UnmarshalText + err = tree.Unmarshal(&spec) + if err != nil { + return job.Job{}, fmt.Errorf("toml unmarshal error on spec: %w", err) + } + err = tree.Unmarshal(&jb) + if err != nil { + return job.Job{}, fmt.Errorf("toml unmarshal error on job: %w", err) + } + jb.CCIPSpec = &spec + + if jb.Type != job.CCIP { + return job.Job{}, fmt.Errorf("the only supported type is currently 'ccip', got %s", jb.Type) + } + if jb.CCIPSpec.CapabilityLabelledName == "" { + return job.Job{}, fmt.Errorf("capabilityLabelledName must be set") + } + if jb.CCIPSpec.CapabilityVersion == "" { + return job.Job{}, fmt.Errorf("capabilityVersion must be set") + } + if jb.CCIPSpec.P2PKeyID == "" { + return job.Job{}, fmt.Errorf("p2pKeyID must be set") + } + + // ensure that the P2PV2Bootstrappers is in the right format. + for _, bootstrapperLocator := range jb.CCIPSpec.P2PV2Bootstrappers { + // needs to be of the form @: + _, err := ocrcommon.ParseBootstrapPeers([]string{bootstrapperLocator}) + if err != nil { + return job.Job{}, fmt.Errorf("p2p v2 bootstrapper locator %s is not in the correct format: %w", bootstrapperLocator, err) + } + } + + return jb, nil +} + +type SpecArgs struct { + P2PV2Bootstrappers []string `toml:"p2pV2Bootstrappers"` + CapabilityVersion string `toml:"capabilityVersion"` + CapabilityLabelledName string `toml:"capabilityLabelledName"` + OCRKeyBundleIDs map[string]string `toml:"ocrKeyBundleIDs"` + P2PKeyID string `toml:"p2pKeyID"` + RelayConfigs map[string]any `toml:"relayConfigs"` + PluginConfig map[string]any `toml:"pluginConfig"` +} + +// NewCCIPSpecToml creates a new CCIP spec in toml format from the given spec args. +func NewCCIPSpecToml(spec SpecArgs) (string, error) { + type fullSpec struct { + SpecArgs + Type string `toml:"type"` + SchemaVersion uint64 `toml:"schemaVersion"` + Name string `toml:"name"` + ExternalJobID string `toml:"externalJobID"` + } + extJobID, err := uuid.NewRandom() + if err != nil { + return "", fmt.Errorf("failed to generate external job id: %w", err) + } + marshaled, err := toml.Marshal(fullSpec{ + SpecArgs: spec, + Type: "ccip", + SchemaVersion: 1, + Name: fmt.Sprintf("%s-%s", "ccip", extJobID.String()), + ExternalJobID: extJobID.String(), + }) + if err != nil { + return "", fmt.Errorf("failed to marshal spec into toml: %w", err) + } + + return string(marshaled), nil +} diff --git a/core/capabilities/ccip/validate/validate_test.go b/core/capabilities/ccip/validate/validate_test.go new file mode 100644 index 00000000000..97958f4cf9d --- /dev/null +++ b/core/capabilities/ccip/validate/validate_test.go @@ -0,0 +1,58 @@ +package validate_test + +import ( + "testing" + + "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/validate" + + "github.com/stretchr/testify/require" + + "github.com/smartcontractkit/chainlink/v2/core/services/job" +) + +func TestNewCCIPSpecToml(t *testing.T) { + tests := []struct { + name string + specArgs validate.SpecArgs + want string + wantErr bool + }{ + // TODO: Add test cases. + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + got, err := validate.NewCCIPSpecToml(tt.specArgs) + if tt.wantErr { + require.Error(t, err) + } else { + require.NoError(t, err) + require.Equal(t, tt.want, got) + } + }) + } +} + +func TestValidatedCCIPSpec(t *testing.T) { + type args struct { + tomlString string + } + tests := []struct { + name string + args args + wantJb job.Job + wantErr bool + }{ + // TODO: Add test cases. + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + gotJb, err := validate.ValidatedCCIPSpec(tt.args.tomlString) + if tt.wantErr { + require.Error(t, err) + } else { + require.NoError(t, err) + require.Equal(t, tt.wantJb, gotJb) + } + }) + } +} diff --git a/core/capabilities/encoder_factory.go b/core/capabilities/encoder_factory.go new file mode 100644 index 00000000000..73e129bd855 --- /dev/null +++ b/core/capabilities/encoder_factory.go @@ -0,0 +1,21 @@ +package capabilities + +import ( + "fmt" + + "github.com/smartcontractkit/chainlink-common/pkg/capabilities/consensus/ocr3/types" + "github.com/smartcontractkit/chainlink-common/pkg/logger" + "github.com/smartcontractkit/chainlink-common/pkg/values" + "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm" +) + +func NewEncoder(name string, config *values.Map, lggr logger.Logger) (types.Encoder, error) { + switch name { + case "EVM": + return evm.NewEVMEncoder(config) + // TODO: add a "no-op" encoder for users who only want to use dynamic ones? + // https://smartcontract-it.atlassian.net/browse/CAPPL-88 + default: + return nil, fmt.Errorf("encoder %s not supported", name) + } +} diff --git a/core/capabilities/gateway_connector/service_wrapper.go b/core/capabilities/gateway_connector/service_wrapper.go new file mode 100644 index 00000000000..824c92b4f89 --- /dev/null +++ b/core/capabilities/gateway_connector/service_wrapper.go @@ -0,0 +1,114 @@ +package gatewayconnector + +import ( + "context" + "crypto/ecdsa" + "errors" + "math/big" + "slices" + + "github.com/ethereum/go-ethereum/common" + "github.com/jonboulle/clockwork" + + "github.com/smartcontractkit/chainlink-common/pkg/services" + "github.com/smartcontractkit/chainlink/v2/core/config" + "github.com/smartcontractkit/chainlink/v2/core/logger" + gwcommon "github.com/smartcontractkit/chainlink/v2/core/services/gateway/common" + "github.com/smartcontractkit/chainlink/v2/core/services/gateway/connector" + "github.com/smartcontractkit/chainlink/v2/core/services/gateway/network" + "github.com/smartcontractkit/chainlink/v2/core/services/keystore" + "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ethkey" +) + +type ServiceWrapper struct { + services.StateMachine + + config config.GatewayConnector + keystore keystore.Eth + connector connector.GatewayConnector + signerKey *ecdsa.PrivateKey + lggr logger.Logger + clock clockwork.Clock +} + +func translateConfigs(f config.GatewayConnector) connector.ConnectorConfig { + r := connector.ConnectorConfig{} + r.NodeAddress = f.NodeAddress() + r.DonId = f.DonID() + + if len(f.Gateways()) != 0 { + r.Gateways = make([]connector.ConnectorGatewayConfig, len(f.Gateways())) + for index, element := range f.Gateways() { + r.Gateways[index] = connector.ConnectorGatewayConfig{Id: element.ID(), URL: element.URL()} + } + } + + r.WsClientConfig = network.WebSocketClientConfig{HandshakeTimeoutMillis: f.WSHandshakeTimeoutMillis()} + r.AuthMinChallengeLen = f.AuthMinChallengeLen() + r.AuthTimestampToleranceSec = f.AuthTimestampToleranceSec() + return r +} + +// NOTE: this wrapper is needed to make sure that our services are started after Keystore. +func NewGatewayConnectorServiceWrapper(config config.GatewayConnector, keystore keystore.Eth, clock clockwork.Clock, lggr logger.Logger) *ServiceWrapper { + return &ServiceWrapper{ + config: config, + keystore: keystore, + clock: clock, + lggr: lggr, + } +} + +func (e *ServiceWrapper) Start(ctx context.Context) error { + return e.StartOnce("GatewayConnectorServiceWrapper", func() error { + conf := e.config + nodeAddress := conf.NodeAddress() + chainID, _ := new(big.Int).SetString(conf.ChainIDForNodeKey(), 0) + enabledKeys, err := e.keystore.EnabledKeysForChain(ctx, chainID) + if err != nil { + return err + } + if len(enabledKeys) == 0 { + return errors.New("no available keys found") + } + configuredNodeAddress := common.HexToAddress(nodeAddress) + idx := slices.IndexFunc(enabledKeys, func(key ethkey.KeyV2) bool { return key.Address == configuredNodeAddress }) + + if idx == -1 { + return errors.New("key for configured node address not found") + } + e.signerKey = enabledKeys[idx].ToEcdsaPrivKey() + if enabledKeys[idx].ID() != nodeAddress { + return errors.New("node address mismatch") + } + + translated := translateConfigs(conf) + e.connector, err = connector.NewGatewayConnector(&translated, e, e.clock, e.lggr) + if err != nil { + return err + } + return e.connector.Start(ctx) + }) +} + +func (e *ServiceWrapper) Sign(data ...[]byte) ([]byte, error) { + return gwcommon.SignData(e.signerKey, data...) +} + +func (e *ServiceWrapper) Close() error { + return e.StopOnce("GatewayConnectorServiceWrapper", func() (err error) { + return e.connector.Close() + }) +} + +func (e *ServiceWrapper) HealthReport() map[string]error { + return map[string]error{e.Name(): e.Healthy()} +} + +func (e *ServiceWrapper) Name() string { + return "GatewayConnectorServiceWrapper" +} + +func (e *ServiceWrapper) GetGatewayConnector() connector.GatewayConnector { + return e.connector +} diff --git a/core/capabilities/gateway_connector/service_wrapper_test.go b/core/capabilities/gateway_connector/service_wrapper_test.go new file mode 100644 index 00000000000..c88622fcd27 --- /dev/null +++ b/core/capabilities/gateway_connector/service_wrapper_test.go @@ -0,0 +1,81 @@ +package gatewayconnector_test + +import ( + "crypto/ecdsa" + "testing" + + "github.com/jonboulle/clockwork" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + "github.com/stretchr/testify/require" + + gatewayconnector "github.com/smartcontractkit/chainlink/v2/core/capabilities/gateway_connector" + "github.com/smartcontractkit/chainlink/v2/core/config/toml" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" + "github.com/smartcontractkit/chainlink/v2/core/logger" + "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" + "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ethkey" + ksmocks "github.com/smartcontractkit/chainlink/v2/core/services/keystore/mocks" +) + +func generateWrapper(t *testing.T, privateKey *ecdsa.PrivateKey, keystoreKey *ecdsa.PrivateKey) (*gatewayconnector.ServiceWrapper, error) { + logger := logger.TestLogger(t) + privateKeyV2 := ethkey.FromPrivateKey(privateKey) + addr := privateKeyV2.Address + keystoreKeyV2 := ethkey.FromPrivateKey(keystoreKey) + + config, err := chainlink.GeneralConfigOpts{ + Config: chainlink.Config{ + Core: toml.Core{ + Capabilities: toml.Capabilities{ + GatewayConnector: toml.GatewayConnector{ + ChainIDForNodeKey: ptr("1"), + NodeAddress: ptr(addr.Hex()), + DonID: ptr("5"), + WSHandshakeTimeoutMillis: ptr[uint32](100), + AuthMinChallengeLen: ptr[int](0), + AuthTimestampToleranceSec: ptr[uint32](10), + Gateways: []toml.ConnectorGateway{{ID: ptr("example_gateway"), URL: ptr("wss://localhost:8081/node")}}, + }, + }, + }, + }, + }.New() + ethKeystore := ksmocks.NewEth(t) + ethKeystore.On("EnabledKeysForChain", mock.Anything, mock.Anything).Return([]ethkey.KeyV2{keystoreKeyV2}, nil) + gc := config.Capabilities().GatewayConnector() + wrapper := gatewayconnector.NewGatewayConnectorServiceWrapper(gc, ethKeystore, clockwork.NewFakeClock(), logger) + require.NoError(t, err) + return wrapper, err +} + +func TestGatewayConnectorServiceWrapper_CleanStartClose(t *testing.T) { + t.Parallel() + + key, _ := testutils.NewPrivateKeyAndAddress(t) + wrapper, err := generateWrapper(t, key, key) + require.NoError(t, err) + + ctx := testutils.Context(t) + err = wrapper.Start(ctx) + require.NoError(t, err) + + t.Cleanup(func() { + assert.NoError(t, wrapper.Close()) + }) +} + +func TestGatewayConnectorServiceWrapper_NonexistentKey(t *testing.T) { + t.Parallel() + + key, _ := testutils.NewPrivateKeyAndAddress(t) + keystoreKey, _ := testutils.NewPrivateKeyAndAddress(t) + wrapper, err := generateWrapper(t, key, keystoreKey) + require.NoError(t, err) + + ctx := testutils.Context(t) + err = wrapper.Start(ctx) + require.Error(t, err) +} + +func ptr[T any](t T) *T { return &t } diff --git a/core/capabilities/integration_tests/keystone_contracts_setup.go b/core/capabilities/integration_tests/keystone_contracts_setup.go new file mode 100644 index 00000000000..fbd3da5cc51 --- /dev/null +++ b/core/capabilities/integration_tests/keystone_contracts_setup.go @@ -0,0 +1,368 @@ +package integration_tests + +import ( + "context" + "encoding/hex" + "fmt" + "log" + "os" + "strings" + "sync" + "testing" + "time" + + "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/accounts/abi/bind/backends" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/eth/ethconfig" + gethlog "github.com/ethereum/go-ethereum/log" + "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/types/known/durationpb" + + ragetypes "github.com/smartcontractkit/libocr/ragep2p/types" + + "github.com/smartcontractkit/chainlink-common/pkg/capabilities/pb" + "github.com/smartcontractkit/chainlink-common/pkg/values" + + "github.com/smartcontractkit/chainlink-common/pkg/services" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/feeds_consumer" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/forwarder" + "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" + + "github.com/ethereum/go-ethereum/accounts/abi/bind" + + kcr "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/capabilities_registry" +) + +const ( + CapabilityTypeTrigger = 0 + CapabilityTypeAction = 1 + CapabilityTypeConsensus = 2 + CapabilityTypeTarget = 3 +) + +type peer struct { + PeerID string + Signer string +} + +func peerIDToBytes(peerID string) ([32]byte, error) { + var peerIDB ragetypes.PeerID + err := peerIDB.UnmarshalText([]byte(peerID)) + if err != nil { + return [32]byte{}, err + } + + return peerIDB, nil +} + +func peers(ps []peer) ([][32]byte, error) { + out := [][32]byte{} + for _, p := range ps { + b, err := peerIDToBytes(p.PeerID) + if err != nil { + return nil, err + } + + out = append(out, b) + } + + return out, nil +} + +func peerToNode(nopID uint32, p peer) (kcr.CapabilitiesRegistryNodeParams, error) { + peerIDB, err := peerIDToBytes(p.PeerID) + if err != nil { + return kcr.CapabilitiesRegistryNodeParams{}, fmt.Errorf("failed to convert peerID: %w", err) + } + + sig := strings.TrimPrefix(p.Signer, "0x") + signerB, err := hex.DecodeString(sig) + if err != nil { + return kcr.CapabilitiesRegistryNodeParams{}, fmt.Errorf("failed to convert signer: %w", err) + } + + var sigb [32]byte + copy(sigb[:], signerB) + + return kcr.CapabilitiesRegistryNodeParams{ + NodeOperatorId: nopID, + P2pId: peerIDB, + Signer: sigb, + }, nil +} + +func setupCapabilitiesRegistryContract(ctx context.Context, t *testing.T, workflowDon donInfo, triggerDon donInfo, + targetDon donInfo, + transactOpts *bind.TransactOpts, backend *ethBackend) common.Address { + addr, _, reg, err := kcr.DeployCapabilitiesRegistry(transactOpts, backend) + require.NoError(t, err) + + backend.Commit() + + streamsTrigger := kcr.CapabilitiesRegistryCapability{ + LabelledName: "streams-trigger", + Version: "1.0.0", + CapabilityType: CapabilityTypeTrigger, + } + sid, err := reg.GetHashedCapabilityId(&bind.CallOpts{}, streamsTrigger.LabelledName, streamsTrigger.Version) + require.NoError(t, err) + + writeChain := kcr.CapabilitiesRegistryCapability{ + LabelledName: "write_geth-testnet", + Version: "1.0.0", + + CapabilityType: CapabilityTypeTarget, + } + wid, err := reg.GetHashedCapabilityId(&bind.CallOpts{}, writeChain.LabelledName, writeChain.Version) + if err != nil { + log.Printf("failed to call GetHashedCapabilityId: %s", err) + } + + ocr := kcr.CapabilitiesRegistryCapability{ + LabelledName: "offchain_reporting", + Version: "1.0.0", + CapabilityType: CapabilityTypeConsensus, + } + ocrid, err := reg.GetHashedCapabilityId(&bind.CallOpts{}, ocr.LabelledName, ocr.Version) + require.NoError(t, err) + + _, err = reg.AddCapabilities(transactOpts, []kcr.CapabilitiesRegistryCapability{ + streamsTrigger, + writeChain, + ocr, + }) + require.NoError(t, err) + backend.Commit() + + _, err = reg.AddNodeOperators(transactOpts, []kcr.CapabilitiesRegistryNodeOperator{ + { + Admin: transactOpts.From, + Name: "TEST_NODE_OPERATOR", + }, + }) + require.NoError(t, err) + blockHash := backend.Commit() + + logs, err := backend.FilterLogs(ctx, ethereum.FilterQuery{ + BlockHash: &blockHash, + FromBlock: nil, + ToBlock: nil, + Addresses: nil, + Topics: nil, + }) + + require.NoError(t, err) + + recLog, err := reg.ParseNodeOperatorAdded(logs[0]) + require.NoError(t, err) + + nopID := recLog.NodeOperatorId + nodes := []kcr.CapabilitiesRegistryNodeParams{} + for _, wfPeer := range workflowDon.peerIDs { + n, innerErr := peerToNode(nopID, wfPeer) + require.NoError(t, innerErr) + + n.HashedCapabilityIds = [][32]byte{ocrid} + nodes = append(nodes, n) + } + + for _, triggerPeer := range triggerDon.peerIDs { + n, innerErr := peerToNode(nopID, triggerPeer) + require.NoError(t, innerErr) + + n.HashedCapabilityIds = [][32]byte{sid} + nodes = append(nodes, n) + } + + for _, targetPeer := range targetDon.peerIDs { + n, innerErr := peerToNode(nopID, targetPeer) + require.NoError(t, innerErr) + + n.HashedCapabilityIds = [][32]byte{wid} + nodes = append(nodes, n) + } + + _, err = reg.AddNodes(transactOpts, nodes) + require.NoError(t, err) + + // workflow DON + ps, err := peers(workflowDon.peerIDs) + require.NoError(t, err) + + cc := newCapabilityConfig() + ccb, err := proto.Marshal(cc) + require.NoError(t, err) + + cfgs := []kcr.CapabilitiesRegistryCapabilityConfiguration{ + { + CapabilityId: ocrid, + Config: ccb, + }, + } + + _, err = reg.AddDON(transactOpts, ps, cfgs, false, true, workflowDon.F) + require.NoError(t, err) + + // trigger DON + ps, err = peers(triggerDon.peerIDs) + require.NoError(t, err) + + triggerCapabilityConfig := newCapabilityConfig() + triggerCapabilityConfig.RemoteConfig = &pb.CapabilityConfig_RemoteTriggerConfig{ + RemoteTriggerConfig: &pb.RemoteTriggerConfig{ + RegistrationRefresh: durationpb.New(1000 * time.Millisecond), + RegistrationExpiry: durationpb.New(60000 * time.Millisecond), + // F + 1 + MinResponsesToAggregate: uint32(triggerDon.F) + 1, + }, + } + + configb, err := proto.Marshal(triggerCapabilityConfig) + require.NoError(t, err) + + cfgs = []kcr.CapabilitiesRegistryCapabilityConfiguration{ + { + CapabilityId: sid, + Config: configb, + }, + } + + _, err = reg.AddDON(transactOpts, ps, cfgs, true, false, triggerDon.F) + require.NoError(t, err) + + // target DON + ps, err = peers(targetDon.peerIDs) + require.NoError(t, err) + + targetCapabilityConfig := newCapabilityConfig() + + configWithLimit, err := values.WrapMap(map[string]any{"gasLimit": 500000}) + require.NoError(t, err) + + targetCapabilityConfig.DefaultConfig = values.Proto(configWithLimit).GetMapValue() + + targetCapabilityConfig.RemoteConfig = &pb.CapabilityConfig_RemoteTargetConfig{ + RemoteTargetConfig: &pb.RemoteTargetConfig{ + RequestHashExcludedAttributes: []string{"signed_report.Signatures"}, + }, + } + + remoteTargetConfigBytes, err := proto.Marshal(targetCapabilityConfig) + require.NoError(t, err) + + cfgs = []kcr.CapabilitiesRegistryCapabilityConfiguration{ + { + CapabilityId: wid, + Config: remoteTargetConfigBytes, + }, + } + + _, err = reg.AddDON(transactOpts, ps, cfgs, true, false, targetDon.F) + require.NoError(t, err) + + backend.Commit() + + return addr +} + +func newCapabilityConfig() *pb.CapabilityConfig { + return &pb.CapabilityConfig{ + DefaultConfig: values.Proto(values.EmptyMap()).GetMapValue(), + } +} + +func setupForwarderContract(t *testing.T, workflowDon donInfo, + transactOpts *bind.TransactOpts, backend *ethBackend) (common.Address, *forwarder.KeystoneForwarder) { + addr, _, fwd, err := forwarder.DeployKeystoneForwarder(transactOpts, backend) + require.NoError(t, err) + backend.Commit() + + var signers []common.Address + for _, p := range workflowDon.peerIDs { + signers = append(signers, common.HexToAddress(p.Signer)) + } + + _, err = fwd.SetConfig(transactOpts, workflowDon.ID, workflowDon.ConfigVersion, workflowDon.F, signers) + require.NoError(t, err) + backend.Commit() + + return addr, fwd +} + +func setupConsumerContract(t *testing.T, transactOpts *bind.TransactOpts, backend *ethBackend, + forwarderAddress common.Address, workflowOwner string, workflowName string) (common.Address, *feeds_consumer.KeystoneFeedsConsumer) { + addr, _, consumer, err := feeds_consumer.DeployKeystoneFeedsConsumer(transactOpts, backend) + require.NoError(t, err) + backend.Commit() + + var nameBytes [10]byte + copy(nameBytes[:], workflowName) + + ownerAddr := common.HexToAddress(workflowOwner) + + _, err = consumer.SetConfig(transactOpts, []common.Address{forwarderAddress}, []common.Address{ownerAddr}, [][10]byte{nameBytes}) + require.NoError(t, err) + + backend.Commit() + + return addr, consumer +} + +type ethBackend struct { + services.StateMachine + *backends.SimulatedBackend + + blockTimeProcessingTime time.Duration + + stopCh services.StopChan + wg sync.WaitGroup +} + +func setupBlockchain(t *testing.T, initialEth int, blockTimeProcessingTime time.Duration) (*ethBackend, *bind.TransactOpts) { + transactOpts := testutils.MustNewSimTransactor(t) // config contract deployer and owner + genesisData := core.GenesisAlloc{transactOpts.From: {Balance: assets.Ether(initialEth).ToInt()}} + backend := cltest.NewSimulatedBackend(t, genesisData, uint32(ethconfig.Defaults.Miner.GasCeil)) + gethlog.SetDefault(gethlog.NewLogger(gethlog.NewTerminalHandlerWithLevel(os.Stderr, gethlog.LevelWarn, true))) + backend.Commit() + + return ðBackend{SimulatedBackend: backend, stopCh: make(services.StopChan), + blockTimeProcessingTime: blockTimeProcessingTime}, transactOpts +} + +func (b *ethBackend) Start(ctx context.Context) error { + return b.StartOnce("ethBackend", func() error { + b.wg.Add(1) + go func() { + defer b.wg.Done() + ticker := time.NewTicker(b.blockTimeProcessingTime) + defer ticker.Stop() + + for { + select { + case <-b.stopCh: + return + case <-ctx.Done(): + return + case <-ticker.C: + b.SimulatedBackend.Commit() + } + } + }() + + return nil + }) +} + +func (b *ethBackend) Close() error { + return b.StopOnce("ethBackend", func() error { + close(b.stopCh) + b.wg.Wait() + return nil + }) +} diff --git a/core/capabilities/integration_tests/mock_dispatcher.go b/core/capabilities/integration_tests/mock_dispatcher.go new file mode 100644 index 00000000000..1230e59427d --- /dev/null +++ b/core/capabilities/integration_tests/mock_dispatcher.go @@ -0,0 +1,214 @@ +package integration_tests + +import ( + "context" + "fmt" + "sync" + "testing" + "time" + + "github.com/smartcontractkit/chainlink-common/pkg/services" + "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" + "github.com/smartcontractkit/chainlink/v2/core/capabilities/remote" + remotetypes "github.com/smartcontractkit/chainlink/v2/core/capabilities/remote/types" + p2ptypes "github.com/smartcontractkit/chainlink/v2/core/services/p2p/types" + + "google.golang.org/protobuf/proto" +) + +// testAsyncMessageBroker backs the dispatchers created for each node in the test and effectively +// acts as the rageP2P network layer. +type testAsyncMessageBroker struct { + services.StateMachine + t *testing.T + + chanBufferSize int + stopCh services.StopChan + wg sync.WaitGroup + + peerIDToBrokerNode map[p2ptypes.PeerID]*brokerNode + + mux sync.Mutex +} + +func newTestAsyncMessageBroker(t *testing.T, chanBufferSize int) *testAsyncMessageBroker { + return &testAsyncMessageBroker{ + t: t, + stopCh: make(services.StopChan), + chanBufferSize: chanBufferSize, + peerIDToBrokerNode: make(map[p2ptypes.PeerID]*brokerNode), + } +} + +func (a *testAsyncMessageBroker) Start(ctx context.Context) error { + return a.StartOnce("testAsyncMessageBroker", func() error { + return nil + }) +} + +func (a *testAsyncMessageBroker) Close() error { + return a.StopOnce("testAsyncMessageBroker", func() error { + close(a.stopCh) + a.wg.Wait() + return nil + }) +} + +// NewDispatcherForNode creates a new dispatcher for a node with the given peer ID. +func (a *testAsyncMessageBroker) NewDispatcherForNode(nodePeerID p2ptypes.PeerID) remotetypes.Dispatcher { + return &brokerDispatcher{ + callerPeerID: nodePeerID, + broker: a, + receivers: map[key]remotetypes.Receiver{}, + } +} + +func (a *testAsyncMessageBroker) HealthReport() map[string]error { + return nil +} + +func (a *testAsyncMessageBroker) Name() string { + return "testAsyncMessageBroker" +} + +func (a *testAsyncMessageBroker) registerReceiverNode(nodePeerID p2ptypes.PeerID, capabilityId string, capabilityDonID uint32, receiver remotetypes.Receiver) { + a.mux.Lock() + defer a.mux.Unlock() + + node, ok := a.peerIDToBrokerNode[nodePeerID] + if !ok { + node = a.newNode() + a.peerIDToBrokerNode[nodePeerID] = node + } + + node.registerReceiverCh <- ®isterReceiverRequest{ + receiverKey: receiverKey{ + capabilityId: capabilityId, + donId: capabilityDonID, + }, + receiver: receiver, + } +} + +func (a *testAsyncMessageBroker) Send(msg *remotetypes.MessageBody) { + peerID := toPeerID(msg.Receiver) + node, ok := a.peerIDToBrokerNode[peerID] + if !ok { + panic(fmt.Sprintf("node not found for peer ID %v", peerID)) + } + + node.receiveCh <- msg +} + +type brokerNode struct { + registerReceiverCh chan *registerReceiverRequest + receiveCh chan *remotetypes.MessageBody +} + +type receiverKey struct { + capabilityId string + donId uint32 +} + +type registerReceiverRequest struct { + receiverKey + receiver remotetypes.Receiver +} + +func (a *testAsyncMessageBroker) newNode() *brokerNode { + n := &brokerNode{ + receiveCh: make(chan *remotetypes.MessageBody, a.chanBufferSize), + registerReceiverCh: make(chan *registerReceiverRequest, a.chanBufferSize), + } + + a.wg.Add(1) + go func() { + defer a.wg.Done() + receivers := make(map[receiverKey]remotetypes.Receiver) + for { + select { + case <-a.stopCh: + return + case msg := <-n.receiveCh: + k := receiverKey{ + capabilityId: msg.CapabilityId, + donId: msg.CapabilityDonId, + } + + r, ok := receivers[k] + if !ok { + panic(fmt.Sprintf("receiver not found for key %+v", k)) + } + + r.Receive(tests.Context(a.t), msg) + case reg := <-n.registerReceiverCh: + receivers[reg.receiverKey] = reg.receiver + } + } + }() + return n +} + +func toPeerID(id []byte) p2ptypes.PeerID { + return [32]byte(id) +} + +type broker interface { + Send(msg *remotetypes.MessageBody) +} + +type brokerDispatcher struct { + callerPeerID p2ptypes.PeerID + broker broker + + receivers map[key]remotetypes.Receiver + mu sync.Mutex +} + +type key struct { + capId string + donId uint32 +} + +func (t *brokerDispatcher) Send(peerID p2ptypes.PeerID, msgBody *remotetypes.MessageBody) error { + clonedMsg := proto.Clone(msgBody).(*remotetypes.MessageBody) + clonedMsg.Version = 1 + clonedMsg.Sender = t.callerPeerID[:] + clonedMsg.Receiver = peerID[:] + clonedMsg.Timestamp = time.Now().UnixMilli() + t.broker.Send(clonedMsg) + return nil +} + +func (t *brokerDispatcher) SetReceiver(capabilityId string, donId uint32, receiver remotetypes.Receiver) error { + t.mu.Lock() + defer t.mu.Unlock() + k := key{capabilityId, donId} + _, ok := t.receivers[k] + if ok { + return fmt.Errorf("%w: receiver already exists for capability %s and don %d", remote.ErrReceiverExists, capabilityId, donId) + } + t.receivers[k] = receiver + + t.broker.(*testAsyncMessageBroker).registerReceiverNode(t.callerPeerID, capabilityId, donId, receiver) + return nil +} +func (t *brokerDispatcher) RemoveReceiver(capabilityId string, donId uint32) {} + +func (t *brokerDispatcher) Start(context.Context) error { return nil } + +func (t *brokerDispatcher) Close() error { + return nil +} + +func (t *brokerDispatcher) Ready() error { + return nil +} + +func (t *brokerDispatcher) HealthReport() map[string]error { + return nil +} + +func (t *brokerDispatcher) Name() string { + return "mockDispatcher" +} diff --git a/core/capabilities/integration_tests/mock_libocr.go b/core/capabilities/integration_tests/mock_libocr.go new file mode 100644 index 00000000000..14ccdce6000 --- /dev/null +++ b/core/capabilities/integration_tests/mock_libocr.go @@ -0,0 +1,203 @@ +package integration_tests + +import ( + "bytes" + "context" + "fmt" + "math/rand" + "sync" + "testing" + "time" + + "github.com/stretchr/testify/require" + + "github.com/smartcontractkit/libocr/commontypes" + "github.com/smartcontractkit/libocr/offchainreporting2plus/ocr3types" + "github.com/smartcontractkit/libocr/offchainreporting2plus/types" + + "github.com/smartcontractkit/chainlink-common/pkg/capabilities/consensus/ocr3" + "github.com/smartcontractkit/chainlink-common/pkg/services" + "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ocr2key" +) + +type libocrNode struct { + ocr3types.ReportingPlugin[[]byte] + *ocr3.ContractTransmitter + key ocr2key.KeyBundle +} + +// mockLibOCR is a mock libocr implementation for testing purposes that simulates libocr protocol rounds without having +// to setup the libocr network +type mockLibOCR struct { + services.StateMachine + t *testing.T + + nodes []*libocrNode + f uint8 + protocolRoundInterval time.Duration + + seqNr uint64 + outcomeCtx ocr3types.OutcomeContext + + stopCh services.StopChan + wg sync.WaitGroup +} + +func newMockLibOCR(t *testing.T, f uint8, protocolRoundInterval time.Duration) *mockLibOCR { + return &mockLibOCR{ + t: t, + f: f, outcomeCtx: ocr3types.OutcomeContext{ + SeqNr: 0, + PreviousOutcome: nil, + Epoch: 0, + Round: 0, + }, + protocolRoundInterval: protocolRoundInterval, + stopCh: make(services.StopChan), + } +} + +func (m *mockLibOCR) Start(ctx context.Context) error { + return m.StartOnce("mockLibOCR", func() error { + m.wg.Add(1) + go func() { + defer m.wg.Done() + + ticker := time.NewTicker(m.protocolRoundInterval) + defer ticker.Stop() + + for { + select { + case <-m.stopCh: + return + case <-ctx.Done(): + return + case <-ticker.C: + err := m.simulateProtocolRound(ctx) + if err != nil { + require.FailNow(m.t, err.Error()) + } + } + } + }() + return nil + }) +} + +func (m *mockLibOCR) Close() error { + return m.StopOnce("mockLibOCR", func() error { + close(m.stopCh) + m.wg.Wait() + return nil + }) +} + +func (m *mockLibOCR) AddNode(plugin ocr3types.ReportingPlugin[[]byte], transmitter *ocr3.ContractTransmitter, key ocr2key.KeyBundle) { + m.nodes = append(m.nodes, &libocrNode{plugin, transmitter, key}) +} + +func (m *mockLibOCR) simulateProtocolRound(ctx context.Context) error { + // randomly select a leader + leader := m.nodes[rand.Intn(len(m.nodes))] + + // get the query + query, err := leader.Query(ctx, m.outcomeCtx) + if err != nil { + return fmt.Errorf("failed to get query: %w", err) + } + + var observations []types.AttributedObservation + for oracleID, node := range m.nodes { + obs, err2 := node.Observation(ctx, m.outcomeCtx, query) + if err2 != nil { + return fmt.Errorf("failed to get observation: %w", err) + } + + observations = append(observations, types.AttributedObservation{ + Observation: obs, + Observer: commontypes.OracleID(oracleID), + }) + } + + var outcomes []ocr3types.Outcome + for _, node := range m.nodes { + outcome, err2 := node.Outcome(m.outcomeCtx, query, observations) + if err2 != nil { + return fmt.Errorf("failed to get outcome: %w", err) + } + + if len(outcome) == 0 { + return nil // wait until all nodes have an outcome for testing purposes + } + + outcomes = append(outcomes, outcome) + } + + // if all outcomes are equal proceed to reports + for _, outcome := range outcomes { + if !bytes.Equal(outcome, outcomes[0]) { + return nil + } + } + + reports, err := leader.Reports(0, outcomes[0]) + if err != nil { + return fmt.Errorf("failed to get reports: %w", err) + } + for _, report := range reports { + // create signatures + var signatures []types.AttributedOnchainSignature + for i, node := range m.nodes { + sig, err := node.key.Sign(types.ReportContext{}, report.Report) + if err != nil { + return fmt.Errorf("failed to sign report: %w", err) + } + + signatures = append(signatures, types.AttributedOnchainSignature{ + Signer: commontypes.OracleID(i), + Signature: sig, + }) + } + + for _, node := range m.nodes { + accept, err := node.ShouldAcceptAttestedReport(ctx, m.seqNr, report) + if err != nil { + return fmt.Errorf("failed to check if report should be accepted: %w", err) + } + if !accept { + continue + } + + transmit, err := node.ShouldTransmitAcceptedReport(ctx, m.seqNr, report) + if err != nil { + return fmt.Errorf("failed to check if report should be transmitted: %w", err) + } + + if !transmit { + continue + } + + // For each node select a random set of f+1 signatures to mimic libocr behaviour + s := rand.NewSource(time.Now().UnixNano()) + r := rand.New(s) + indices := r.Perm(len(signatures)) + selectedSignatures := make([]types.AttributedOnchainSignature, m.f+1) + for i := 0; i < int(m.f+1); i++ { + selectedSignatures[i] = signatures[indices[i]] + } + + err = node.Transmit(ctx, types.ConfigDigest{}, 0, report, selectedSignatures) + if err != nil { + return fmt.Errorf("failed to transmit report: %w", err) + } + } + + m.seqNr++ + m.outcomeCtx = ocr3types.OutcomeContext{ + SeqNr: 0, + PreviousOutcome: outcomes[0], + } + } + + return nil +} diff --git a/core/capabilities/integration_tests/mock_trigger.go b/core/capabilities/integration_tests/mock_trigger.go new file mode 100644 index 00000000000..35b05b054cc --- /dev/null +++ b/core/capabilities/integration_tests/mock_trigger.go @@ -0,0 +1,143 @@ +package integration_tests + +import ( + "context" + "sync" + "testing" + + "github.com/smartcontractkit/chainlink-common/pkg/capabilities" + "github.com/smartcontractkit/chainlink-common/pkg/capabilities/datastreams" + "github.com/smartcontractkit/chainlink-common/pkg/services" + "github.com/smartcontractkit/chainlink-common/pkg/values" +) + +const triggerID = "streams-trigger@1.0.0" + +type reportsSink struct { + services.StateMachine + triggers []streamsTrigger + + stopCh services.StopChan + wg sync.WaitGroup +} + +func newReportsSink() *reportsSink { + return &reportsSink{ + stopCh: make(services.StopChan), + } +} + +func (r *reportsSink) Start(ctx context.Context) error { + return r.StartOnce("reportsSink", func() error { + return nil + }) +} + +func (r *reportsSink) Close() error { + return r.StopOnce("reportsSink", func() error { + close(r.stopCh) + r.wg.Wait() + return nil + }) +} + +func (r *reportsSink) sendReports(reportList []*datastreams.FeedReport) { + for _, trigger := range r.triggers { + resp, err := wrapReports(reportList, "1", 12, datastreams.Metadata{}) + if err != nil { + panic(err) + } + trigger.sendResponse(resp) + } +} + +func (r *reportsSink) getNewTrigger(t *testing.T) *streamsTrigger { + trigger := streamsTrigger{t: t, toSend: make(chan capabilities.TriggerResponse, 1000), + wg: &r.wg, stopCh: r.stopCh} + r.triggers = append(r.triggers, trigger) + return &trigger +} + +type streamsTrigger struct { + t *testing.T + cancel context.CancelFunc + toSend chan capabilities.TriggerResponse + + wg *sync.WaitGroup + stopCh services.StopChan +} + +func (s *streamsTrigger) sendResponse(resp capabilities.TriggerResponse) { + s.toSend <- resp +} + +func (s *streamsTrigger) Info(ctx context.Context) (capabilities.CapabilityInfo, error) { + return capabilities.MustNewCapabilityInfo( + triggerID, + capabilities.CapabilityTypeTrigger, + "issues a trigger when a report is received.", + ), nil +} + +func (s *streamsTrigger) RegisterTrigger(ctx context.Context, request capabilities.TriggerRegistrationRequest) (<-chan capabilities.TriggerResponse, error) { + if s.cancel != nil { + s.t.Fatal("trigger already registered") + } + + responseCh := make(chan capabilities.TriggerResponse) + + ctxWithCancel, cancel := context.WithCancel(context.Background()) + s.cancel = cancel + s.wg.Add(1) + go func() { + defer s.wg.Done() + for { + select { + case <-s.stopCh: + return + case <-ctxWithCancel.Done(): + return + case resp := <-s.toSend: + responseCh <- resp + } + } + }() + + return responseCh, nil +} + +func (s *streamsTrigger) UnregisterTrigger(ctx context.Context, request capabilities.TriggerRegistrationRequest) error { + if s.cancel == nil { + s.t.Fatal("trigger not registered") + } + + s.cancel() + s.cancel = nil + return nil +} + +func wrapReports(reportList []*datastreams.FeedReport, eventID string, timestamp int64, meta datastreams.Metadata) (capabilities.TriggerResponse, error) { + rl := []datastreams.FeedReport{} + for _, r := range reportList { + rl = append(rl, *r) + } + outputs, err := values.WrapMap(datastreams.StreamsTriggerEvent{ + Payload: rl, + Metadata: meta, + Timestamp: timestamp, + }) + if err != nil { + return capabilities.TriggerResponse{}, err + } + + triggerEvent := capabilities.TriggerEvent{ + TriggerType: triggerID, + ID: eventID, + Outputs: outputs, + } + + // Create a new TriggerResponse with the MercuryTriggerEvent + return capabilities.TriggerResponse{ + Event: triggerEvent, + }, nil +} diff --git a/core/capabilities/integration_tests/setup.go b/core/capabilities/integration_tests/setup.go new file mode 100644 index 00000000000..1d0ec183e69 --- /dev/null +++ b/core/capabilities/integration_tests/setup.go @@ -0,0 +1,439 @@ +package integration_tests + +import ( + "context" + "crypto/rand" + "encoding/hex" + "fmt" + "math/big" + "strconv" + "testing" + "time" + + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/mr-tron/base58" + "github.com/stretchr/testify/require" + "go.uber.org/zap/zapcore" + + "github.com/smartcontractkit/libocr/offchainreporting2plus/chains/evmutil" + "github.com/smartcontractkit/libocr/offchainreporting2plus/ocr3types" + ocrTypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" + + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/feeds_consumer" + + commoncap "github.com/smartcontractkit/chainlink-common/pkg/capabilities" + "github.com/smartcontractkit/chainlink-common/pkg/capabilities/consensus/ocr3" + "github.com/smartcontractkit/chainlink-common/pkg/capabilities/datastreams" + "github.com/smartcontractkit/chainlink-common/pkg/services/servicetest" + coretypes "github.com/smartcontractkit/chainlink-common/pkg/types/core" + v3 "github.com/smartcontractkit/chainlink-common/pkg/types/mercury/v3" + + "github.com/smartcontractkit/chainlink/v2/core/capabilities" + remotetypes "github.com/smartcontractkit/chainlink/v2/core/capabilities/remote/types" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" + "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" + "github.com/smartcontractkit/chainlink/v2/core/logger" + "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" + "github.com/smartcontractkit/chainlink/v2/core/services/keystore/chaintype" + "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ethkey" + "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ocr2key" + p2ptypes "github.com/smartcontractkit/chainlink/v2/core/services/p2p/types" + "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury/v3/reportcodec" + "github.com/smartcontractkit/chainlink/v2/core/utils/testutils/heavyweight" +) + +const ( + // As a default set the logging to info otherwise 10s/100s of MB of logs are created on each test run + TestLogLevel = zapcore.InfoLevel +) + +var ( + workflowName = "abcdef0123" + workflowOwnerID = "0100000000000000000000000000000000000001" +) + +type donInfo struct { + commoncap.DON + keys []ethkey.KeyV2 + keyBundles []ocr2key.KeyBundle + peerIDs []peer +} + +func setupStreamDonsWithTransmissionSchedule(ctx context.Context, t *testing.T, workflowDonInfo donInfo, triggerDonInfo donInfo, targetDonInfo donInfo, + feedCount int, deltaStage string, schedule string) (*feeds_consumer.KeystoneFeedsConsumer, []string, *reportsSink) { + lggr := logger.TestLogger(t) + lggr.SetLogLevel(TestLogLevel) + + ethBlockchain, transactor := setupBlockchain(t, 1000, 1*time.Second) + capabilitiesRegistryAddr := setupCapabilitiesRegistryContract(ctx, t, workflowDonInfo, triggerDonInfo, targetDonInfo, transactor, ethBlockchain) + forwarderAddr, _ := setupForwarderContract(t, workflowDonInfo, transactor, ethBlockchain) + consumerAddr, consumer := setupConsumerContract(t, transactor, ethBlockchain, forwarderAddr, workflowOwnerID, workflowName) + + var feedIDs []string + for i := 0; i < feedCount; i++ { + feedIDs = append(feedIDs, newFeedID(t)) + } + + sink := newReportsSink() + + libocr := newMockLibOCR(t, workflowDonInfo.F, 1*time.Second) + workflowDonNodes, _, _ := createDons(ctx, t, lggr, sink, + workflowDonInfo, triggerDonInfo, targetDonInfo, + ethBlockchain, capabilitiesRegistryAddr, forwarderAddr, + workflowDonInfo.keyBundles, transactor, libocr) + for _, node := range workflowDonNodes { + addWorkflowJob(t, node, workflowName, workflowOwnerID, feedIDs, consumerAddr, deltaStage, schedule) + } + + servicetest.Run(t, ethBlockchain) + servicetest.Run(t, libocr) + servicetest.Run(t, sink) + return consumer, feedIDs, sink +} + +func createDons(ctx context.Context, t *testing.T, lggr logger.Logger, reportsSink *reportsSink, + workflowDon donInfo, + triggerDon donInfo, + targetDon donInfo, + simulatedEthBlockchain *ethBackend, + capRegistryAddr common.Address, + forwarderAddr common.Address, + workflowNodeKeyBundles []ocr2key.KeyBundle, + transactor *bind.TransactOpts, + libocr *mockLibOCR, +) ([]*cltest.TestApplication, []*cltest.TestApplication, []*cltest.TestApplication) { + broker := newTestAsyncMessageBroker(t, 1000) + + var triggerNodes []*cltest.TestApplication + for i, triggerPeer := range triggerDon.Members { + triggerPeerDispatcher := broker.NewDispatcherForNode(triggerPeer) + nodeInfo := commoncap.Node{ + PeerID: &triggerPeer, + } + + capabilityRegistry := capabilities.NewRegistry(lggr) + trigger := reportsSink.getNewTrigger(t) + err := capabilityRegistry.Add(ctx, trigger) + require.NoError(t, err) + + triggerNode := startNewNode(ctx, t, lggr.Named("Trigger-"+strconv.Itoa(i)), nodeInfo, simulatedEthBlockchain, capRegistryAddr, triggerPeerDispatcher, + testPeerWrapper{peer: testPeer{triggerPeer}}, capabilityRegistry, nil, transactor, + triggerDon.keys[i]) + + require.NoError(t, triggerNode.Start(testutils.Context(t))) + triggerNodes = append(triggerNodes, triggerNode) + } + + var targetNodes []*cltest.TestApplication + for i, targetPeer := range targetDon.Members { + targetPeerDispatcher := broker.NewDispatcherForNode(targetPeer) + nodeInfo := commoncap.Node{ + PeerID: &targetPeer, + } + + capabilityRegistry := capabilities.NewRegistry(lggr) + + targetNode := startNewNode(ctx, t, lggr.Named("Target-"+strconv.Itoa(i)), nodeInfo, simulatedEthBlockchain, capRegistryAddr, targetPeerDispatcher, + testPeerWrapper{peer: testPeer{targetPeer}}, capabilityRegistry, &forwarderAddr, transactor, + targetDon.keys[i]) + + require.NoError(t, targetNode.Start(testutils.Context(t))) + targetNodes = append(triggerNodes, targetNode) + } + + var workflowNodes []*cltest.TestApplication + for i, workflowPeer := range workflowDon.Members { + workflowPeerDispatcher := broker.NewDispatcherForNode(workflowPeer) + capabilityRegistry := capabilities.NewRegistry(lggr) + + requestTimeout := 10 * time.Minute + cfg := ocr3.Config{ + Logger: lggr, + EncoderFactory: capabilities.NewEncoder, + AggregatorFactory: capabilities.NewAggregator, + RequestTimeout: &requestTimeout, + } + + ocr3Capability := ocr3.NewOCR3(cfg) + servicetest.Run(t, ocr3Capability) + + pluginCfg := coretypes.ReportingPluginServiceConfig{} + pluginFactory, err := ocr3Capability.NewReportingPluginFactory(ctx, pluginCfg, nil, + nil, nil, nil, capabilityRegistry, nil, nil) + require.NoError(t, err) + + repConfig := ocr3types.ReportingPluginConfig{ + F: int(workflowDon.F), + } + plugin, _, err := pluginFactory.NewReportingPlugin(repConfig) + require.NoError(t, err) + + transmitter := ocr3.NewContractTransmitter(lggr, capabilityRegistry, "") + + libocr.AddNode(plugin, transmitter, workflowNodeKeyBundles[i]) + + nodeInfo := commoncap.Node{ + PeerID: &workflowPeer, + WorkflowDON: workflowDon.DON, + CapabilityDONs: []commoncap.DON{triggerDon.DON, targetDon.DON}, + } + + workflowNode := startNewNode(ctx, t, lggr.Named("Workflow-"+strconv.Itoa(i)), nodeInfo, simulatedEthBlockchain, capRegistryAddr, workflowPeerDispatcher, + testPeerWrapper{peer: testPeer{workflowPeer}}, capabilityRegistry, nil, transactor, + workflowDon.keys[i]) + + require.NoError(t, workflowNode.Start(testutils.Context(t))) + workflowNodes = append(workflowNodes, workflowNode) + } + + servicetest.Run(t, broker) + + return workflowNodes, triggerNodes, targetNodes +} + +func startNewNode(ctx context.Context, + t *testing.T, lggr logger.Logger, nodeInfo commoncap.Node, + backend *ethBackend, capRegistryAddr common.Address, + dispatcher remotetypes.Dispatcher, + peerWrapper p2ptypes.PeerWrapper, + localCapabilities *capabilities.Registry, + forwarderAddress *common.Address, + transactor *bind.TransactOpts, + keyV2 ethkey.KeyV2, +) *cltest.TestApplication { + config, _ := heavyweight.FullTestDBV2(t, func(c *chainlink.Config, s *chainlink.Secrets) { + c.Capabilities.ExternalRegistry.ChainID = ptr(fmt.Sprintf("%d", testutils.SimulatedChainID)) + c.Capabilities.ExternalRegistry.Address = ptr(capRegistryAddr.String()) + c.Capabilities.Peering.V2.Enabled = ptr(true) + + if forwarderAddress != nil { + eip55Address := types.EIP55AddressFromAddress(*forwarderAddress) + c.EVM[0].Chain.Workflow.ForwarderAddress = &eip55Address + c.EVM[0].Chain.Workflow.FromAddress = &keyV2.EIP55Address + } + + c.Feature.FeedsManager = ptr(false) + }) + + n, err := backend.NonceAt(ctx, transactor.From, nil) + require.NoError(t, err) + + tx := cltest.NewLegacyTransaction( + n, keyV2.Address, + assets.Ether(1).ToInt(), + 21000, + assets.GWei(1).ToInt(), + nil) + signedTx, err := transactor.Signer(transactor.From, tx) + require.NoError(t, err) + err = backend.SendTransaction(ctx, signedTx) + require.NoError(t, err) + backend.Commit() + + return cltest.NewApplicationWithConfigV2AndKeyOnSimulatedBlockchain(t, config, backend.SimulatedBackend, nodeInfo, + dispatcher, peerWrapper, localCapabilities, keyV2, lggr) +} + +type don struct { + id uint32 + numNodes int + f uint8 +} + +func createDonInfo(t *testing.T, don don) donInfo { + keyBundles, peerIDs := getKeyBundlesAndPeerIDs(t, don.numNodes) + + donPeers := make([]p2ptypes.PeerID, len(peerIDs)) + var donKeys []ethkey.KeyV2 + for i := 0; i < len(peerIDs); i++ { + peerID := p2ptypes.PeerID{} + require.NoError(t, peerID.UnmarshalText([]byte(peerIDs[i].PeerID))) + donPeers[i] = peerID + newKey, err := ethkey.NewV2() + require.NoError(t, err) + donKeys = append(donKeys, newKey) + } + + triggerDonInfo := donInfo{ + DON: commoncap.DON{ + ID: don.id, + Members: donPeers, + F: don.f, + ConfigVersion: 1, + }, + peerIDs: peerIDs, + keys: donKeys, + keyBundles: keyBundles, + } + return triggerDonInfo +} + +func createFeedReport(t *testing.T, price *big.Int, observationTimestamp int64, + feedIDString string, + keyBundles []ocr2key.KeyBundle) *datastreams.FeedReport { + reportCtx := ocrTypes.ReportContext{} + rawCtx := RawReportContext(reportCtx) + + bytes, err := hex.DecodeString(feedIDString[2:]) + require.NoError(t, err) + var feedIDBytes [32]byte + copy(feedIDBytes[:], bytes) + + report := &datastreams.FeedReport{ + FeedID: feedIDString, + FullReport: newReport(t, feedIDBytes, price, observationTimestamp), + BenchmarkPrice: price.Bytes(), + ObservationTimestamp: observationTimestamp, + Signatures: [][]byte{}, + ReportContext: rawCtx, + } + + for _, key := range keyBundles { + sig, err := key.Sign(reportCtx, report.FullReport) + require.NoError(t, err) + report.Signatures = append(report.Signatures, sig) + } + + return report +} + +func getKeyBundlesAndPeerIDs(t *testing.T, numNodes int) ([]ocr2key.KeyBundle, []peer) { + var keyBundles []ocr2key.KeyBundle + var donPeerIDs []peer + for i := 0; i < numNodes; i++ { + peerID := NewPeerID() + + keyBundle, err := ocr2key.New(chaintype.EVM) + require.NoError(t, err) + keyBundles = append(keyBundles, keyBundle) + + pk := keyBundle.PublicKey() + + p := peer{ + PeerID: peerID, + Signer: fmt.Sprintf("0x%x", pk), + } + + donPeerIDs = append(donPeerIDs, p) + } + return keyBundles, donPeerIDs +} + +func newFeedID(t *testing.T) string { + buf := [32]byte{} + _, err := rand.Read(buf[:]) + require.NoError(t, err) + return "0x" + hex.EncodeToString(buf[:]) +} + +func newReport(t *testing.T, feedID [32]byte, price *big.Int, timestamp int64) []byte { + v3Codec := reportcodec.NewReportCodec(feedID, logger.TestLogger(t)) + raw, err := v3Codec.BuildReport(v3.ReportFields{ + BenchmarkPrice: price, + Timestamp: uint32(timestamp), + Bid: big.NewInt(0), + Ask: big.NewInt(0), + LinkFee: big.NewInt(0), + NativeFee: big.NewInt(0), + }) + require.NoError(t, err) + return raw +} + +type testPeerWrapper struct { + peer testPeer +} + +func (t testPeerWrapper) Start(ctx context.Context) error { + return nil +} + +func (t testPeerWrapper) Close() error { + return nil +} + +func (t testPeerWrapper) Ready() error { + return nil +} + +func (t testPeerWrapper) HealthReport() map[string]error { + return nil +} + +func (t testPeerWrapper) Name() string { + return "testPeerWrapper" +} + +func (t testPeerWrapper) GetPeer() p2ptypes.Peer { + return t.peer +} + +type testPeer struct { + id p2ptypes.PeerID +} + +func (t testPeer) Start(ctx context.Context) error { + return nil +} + +func (t testPeer) Close() error { + return nil +} + +func (t testPeer) Ready() error { + return nil +} + +func (t testPeer) HealthReport() map[string]error { + return nil +} + +func (t testPeer) Name() string { + return "testPeer" +} + +func (t testPeer) ID() p2ptypes.PeerID { + return t.id +} + +func (t testPeer) UpdateConnections(peers map[p2ptypes.PeerID]p2ptypes.StreamConfig) error { + return nil +} + +func (t testPeer) Send(peerID p2ptypes.PeerID, msg []byte) error { + return nil +} + +func (t testPeer) Receive() <-chan p2ptypes.Message { + return nil +} + +func NewPeerID() string { + var privKey [32]byte + _, err := rand.Read(privKey[:]) + if err != nil { + panic(err) + } + + peerID := append(libp2pMagic(), privKey[:]...) + + return base58.Encode(peerID[:]) +} + +func libp2pMagic() []byte { + return []byte{0x00, 0x24, 0x08, 0x01, 0x12, 0x20} +} + +func ptr[T any](t T) *T { return &t } + +func RawReportContext(reportCtx ocrTypes.ReportContext) []byte { + rc := evmutil.RawReportContext(reportCtx) + flat := []byte{} + for _, r := range rc { + flat = append(flat, r[:]...) + } + return flat +} diff --git a/core/capabilities/integration_tests/streams_test.go b/core/capabilities/integration_tests/streams_test.go new file mode 100644 index 00000000000..06c56f722fb --- /dev/null +++ b/core/capabilities/integration_tests/streams_test.go @@ -0,0 +1,99 @@ +package integration_tests + +import ( + "context" + "encoding/hex" + "math/big" + "testing" + "time" + + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + "github.com/smartcontractkit/chainlink-common/pkg/capabilities/datastreams" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/feeds_consumer" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" + reporttypes "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury/v3/types" +) + +func Test_AllAtOnceTransmissionSchedule(t *testing.T) { + ctx := testutils.Context(t) + + // The don IDs set in the below calls are inferred from the order in which the dons are added to the capabilities registry + // in the setupCapabilitiesRegistryContract function, should this order change the don IDs will need updating. + workflowDonInfo := createDonInfo(t, don{id: 1, numNodes: 7, f: 2}) + triggerDonInfo := createDonInfo(t, don{id: 2, numNodes: 7, f: 2}) + targetDonInfo := createDonInfo(t, don{id: 3, numNodes: 4, f: 1}) + + consumer, feedIDs, triggerSink := setupStreamDonsWithTransmissionSchedule(ctx, t, workflowDonInfo, triggerDonInfo, targetDonInfo, 3, + "2s", "allAtOnce") + + reports := []*datastreams.FeedReport{ + createFeedReport(t, big.NewInt(1), 5, feedIDs[0], triggerDonInfo.keyBundles), + createFeedReport(t, big.NewInt(3), 7, feedIDs[1], triggerDonInfo.keyBundles), + createFeedReport(t, big.NewInt(2), 6, feedIDs[2], triggerDonInfo.keyBundles), + } + + triggerSink.sendReports(reports) + + waitForConsumerReports(ctx, t, consumer, reports) +} + +func Test_OneAtATimeTransmissionSchedule(t *testing.T) { + ctx := testutils.Context(t) + + // The don IDs set in the below calls are inferred from the order in which the dons are added to the capabilities registry + // in the setupCapabilitiesRegistryContract function, should this order change the don IDs will need updating. + workflowDonInfo := createDonInfo(t, don{id: 1, numNodes: 7, f: 2}) + triggerDonInfo := createDonInfo(t, don{id: 2, numNodes: 7, f: 2}) + targetDonInfo := createDonInfo(t, don{id: 3, numNodes: 4, f: 1}) + + consumer, feedIDs, triggerSink := setupStreamDonsWithTransmissionSchedule(ctx, t, workflowDonInfo, triggerDonInfo, targetDonInfo, 3, + "2s", "oneAtATime") + + reports := []*datastreams.FeedReport{ + createFeedReport(t, big.NewInt(1), 5, feedIDs[0], triggerDonInfo.keyBundles), + createFeedReport(t, big.NewInt(3), 7, feedIDs[1], triggerDonInfo.keyBundles), + createFeedReport(t, big.NewInt(2), 6, feedIDs[2], triggerDonInfo.keyBundles), + } + + triggerSink.sendReports(reports) + + waitForConsumerReports(ctx, t, consumer, reports) +} + +func waitForConsumerReports(ctx context.Context, t *testing.T, consumer *feeds_consumer.KeystoneFeedsConsumer, triggerFeedReports []*datastreams.FeedReport) { + feedsReceived := make(chan *feeds_consumer.KeystoneFeedsConsumerFeedReceived, 1000) + feedsSub, err := consumer.WatchFeedReceived(&bind.WatchOpts{}, feedsReceived, nil) + require.NoError(t, err) + + feedToReport := map[string]*datastreams.FeedReport{} + for _, report := range triggerFeedReports { + feedToReport[report.FeedID] = report + } + + ctxWithTimeout, cancel := context.WithTimeout(ctx, 1*time.Minute) + defer cancel() + feedCount := 0 + for { + select { + case <-ctxWithTimeout.Done(): + t.Fatalf("timed out waiting for feed reports, expected %d, received %d", len(triggerFeedReports), feedCount) + case err := <-feedsSub.Err(): + require.NoError(t, err) + case feed := <-feedsReceived: + feedID := "0x" + hex.EncodeToString(feed.FeedId[:]) + report := feedToReport[feedID] + decodedReport, err := reporttypes.Decode(report.FullReport) + require.NoError(t, err) + assert.Equal(t, decodedReport.BenchmarkPrice, feed.Price) + assert.Equal(t, decodedReport.ObservationsTimestamp, feed.Timestamp) + + feedCount++ + if feedCount == len(triggerFeedReports) { + return + } + } + } +} diff --git a/core/capabilities/integration_tests/workflow.go b/core/capabilities/integration_tests/workflow.go new file mode 100644 index 00000000000..d116a1ec639 --- /dev/null +++ b/core/capabilities/integration_tests/workflow.go @@ -0,0 +1,75 @@ +package integration_tests + +import ( + "fmt" + "testing" + + "github.com/ethereum/go-ethereum/common" + "github.com/stretchr/testify/require" + + "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" + "github.com/smartcontractkit/chainlink/v2/core/testdata/testspecs" +) + +const hardcodedWorkflow = ` +name: "%s" +owner: "0x%s" +triggers: + - id: "streams-trigger@1.0.0" + config: + feedIds: +%s + +consensus: + - id: "offchain_reporting@1.0.0" + ref: "evm_median" + inputs: + observations: + - "$(trigger.outputs)" + config: + report_id: "0001" + aggregation_method: "data_feeds" + aggregation_config: + feeds: +%s + encoder: "EVM" + encoder_config: + abi: "(bytes32 FeedID, uint224 Price, uint32 Timestamp)[] Reports" + +targets: + - id: "write_geth-testnet@1.0.0" + inputs: + signed_report: "$(evm_median.outputs)" + config: + address: "%s" + params: ["$(report)"] + abi: "receive(report bytes)" + deltaStage: %s + schedule: %s +` + +func addWorkflowJob(t *testing.T, app *cltest.TestApplication, + workflowName string, + workflowOwner string, + feedIDs []string, + consumerAddr common.Address, + deltaStage string, + schedule string) { + triggerFeedIDs := "" + for _, feedID := range feedIDs { + triggerFeedIDs += fmt.Sprintf(" - \"%s\"\n", feedID) + } + + aggregationFeeds := "" + for _, feedID := range feedIDs { + aggregationFeeds += fmt.Sprintf(" \"%s\":\n deviation: \"0.001\"\n heartbeat: 3600\n", feedID) + } + + workflowJobSpec := testspecs.GenerateWorkflowJobSpec(t, fmt.Sprintf(hardcodedWorkflow, workflowName, workflowOwner, triggerFeedIDs, aggregationFeeds, + consumerAddr.String(), deltaStage, schedule)) + job := workflowJobSpec.Job() + + err := app.AddJobV2(testutils.Context(t), &job) + require.NoError(t, err) +} diff --git a/core/capabilities/launcher.go b/core/capabilities/launcher.go index 7d7616faf66..f2bfd5e4b16 100644 --- a/core/capabilities/launcher.go +++ b/core/capabilities/launcher.go @@ -4,6 +4,7 @@ import ( "context" "errors" "fmt" + "slices" "strings" "time" @@ -12,32 +13,32 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/capabilities" "github.com/smartcontractkit/chainlink-common/pkg/capabilities/triggers" "github.com/smartcontractkit/chainlink-common/pkg/services" - "github.com/smartcontractkit/chainlink-common/pkg/types/core" + "github.com/smartcontractkit/chainlink-common/pkg/values" "github.com/smartcontractkit/libocr/ragep2p" ragetypes "github.com/smartcontractkit/libocr/ragep2p/types" + capabilitiespb "github.com/smartcontractkit/chainlink-common/pkg/capabilities/pb" "github.com/smartcontractkit/chainlink/v2/core/capabilities/remote" "github.com/smartcontractkit/chainlink/v2/core/capabilities/remote/target" remotetypes "github.com/smartcontractkit/chainlink/v2/core/capabilities/remote/types" "github.com/smartcontractkit/chainlink/v2/core/capabilities/streams" - kcr "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/capabilities_registry" "github.com/smartcontractkit/chainlink/v2/core/logger" p2ptypes "github.com/smartcontractkit/chainlink/v2/core/services/p2p/types" "github.com/smartcontractkit/chainlink/v2/core/services/registrysyncer" ) var defaultStreamConfig = p2ptypes.StreamConfig{ - IncomingMessageBufferSize: 1000000, - OutgoingMessageBufferSize: 1000000, - MaxMessageLenBytes: 100000, + IncomingMessageBufferSize: 500, + OutgoingMessageBufferSize: 500, + MaxMessageLenBytes: 500000, // 500 KB; max capacity = 500 * 500000 = 250 MB MessageRateLimiter: ragep2p.TokenBucketParams{ Rate: 100.0, - Capacity: 1000, + Capacity: 500, }, BytesRateLimiter: ragep2p.TokenBucketParams{ - Rate: 100000.0, - Capacity: 1000000, + Rate: 5000000.0, // 5 MB/s + Capacity: 10000000, // 10 MB }, } @@ -46,16 +47,51 @@ type launcher struct { lggr logger.Logger peerWrapper p2ptypes.PeerWrapper dispatcher remotetypes.Dispatcher - registry core.CapabilitiesRegistry - localNode capabilities.Node + registry *Registry subServices []services.Service } +func unmarshalCapabilityConfig(data []byte) (capabilities.CapabilityConfiguration, error) { + cconf := &capabilitiespb.CapabilityConfig{} + err := proto.Unmarshal(data, cconf) + if err != nil { + return capabilities.CapabilityConfiguration{}, err + } + + var remoteTriggerConfig *capabilities.RemoteTriggerConfig + var remoteTargetConfig *capabilities.RemoteTargetConfig + + switch cconf.GetRemoteConfig().(type) { + case *capabilitiespb.CapabilityConfig_RemoteTriggerConfig: + prtc := cconf.GetRemoteTriggerConfig() + remoteTriggerConfig = &capabilities.RemoteTriggerConfig{} + remoteTriggerConfig.RegistrationRefresh = prtc.RegistrationRefresh.AsDuration() + remoteTriggerConfig.RegistrationExpiry = prtc.RegistrationExpiry.AsDuration() + remoteTriggerConfig.MinResponsesToAggregate = prtc.MinResponsesToAggregate + remoteTriggerConfig.MessageExpiry = prtc.MessageExpiry.AsDuration() + case *capabilitiespb.CapabilityConfig_RemoteTargetConfig: + prtc := cconf.GetRemoteTargetConfig() + remoteTargetConfig = &capabilities.RemoteTargetConfig{} + remoteTargetConfig.RequestHashExcludedAttributes = prtc.RequestHashExcludedAttributes + } + + dc, err := values.FromMapValueProto(cconf.DefaultConfig) + if err != nil { + return capabilities.CapabilityConfiguration{}, err + } + + return capabilities.CapabilityConfiguration{ + DefaultConfig: dc, + RemoteTriggerConfig: remoteTriggerConfig, + RemoteTargetConfig: remoteTargetConfig, + }, nil +} + func NewLauncher( lggr logger.Logger, peerWrapper p2ptypes.PeerWrapper, dispatcher remotetypes.Dispatcher, - registry core.CapabilitiesRegistry, + registry *Registry, ) *launcher { return &launcher{ lggr: lggr.Named("CapabilitiesLauncher"), @@ -92,50 +128,14 @@ func (w *launcher) Name() string { return "CapabilitiesLauncher" } -func (w *launcher) LocalNode(ctx context.Context) (capabilities.Node, error) { - if w.peerWrapper.GetPeer() == nil { - return w.localNode, errors.New("unable to get local node: peerWrapper hasn't started yet") - } - - if w.localNode.WorkflowDON.ID == 0 { - return w.localNode, errors.New("unable to get local node: waiting for initial call from syncer") - } - - return w.localNode, nil -} - -func (w *launcher) updateLocalNode(state registrysyncer.State) { - pid := w.peerWrapper.GetPeer().ID() - - var workflowDON capabilities.DON - capabilityDONs := []capabilities.DON{} - for _, d := range state.IDsToDONs { - for _, p := range d.NodeP2PIds { - if p == pid { - if d.AcceptsWorkflows { - if workflowDON.ID == 0 { - workflowDON = *toDONInfo(d) - w.lggr.Debug("Workflow DON identified: %+v", workflowDON) - } else { - w.lggr.Errorf("Configuration error: node %s belongs to more than one workflowDON", pid) - } - } - - capabilityDONs = append(capabilityDONs, *toDONInfo(d)) - } - } - } +func (w *launcher) Launch(ctx context.Context, state *registrysyncer.LocalRegistry) error { + w.registry.SetLocalRegistry(state) - w.localNode = capabilities.Node{ - PeerID: &pid, - WorkflowDON: workflowDON, - CapabilityDONs: capabilityDONs, + allDONIDs := []registrysyncer.DonID{} + for id := range state.IDsToDONs { + allDONIDs = append(allDONIDs, id) } -} - -func (w *launcher) Launch(ctx context.Context, state registrysyncer.State) error { - w.lggr.Debugw("running capabilities launcher", "state", state) - w.updateLocalNode(state) + slices.Sort(allDONIDs) // ensure deterministic order // Let's start by updating the list of Peers // We do this by creating a new entry for each node belonging @@ -143,15 +143,16 @@ func (w *launcher) Launch(ctx context.Context, state registrysyncer.State) error // We also add the hardcoded peers determined by the NetworkSetup. allPeers := make(map[ragetypes.PeerID]p2ptypes.StreamConfig) - publicDONs := []kcr.CapabilitiesRegistryDONInfo{} - for _, d := range state.IDsToDONs { - if !d.IsPublic { + publicDONs := []registrysyncer.DON{} + for _, id := range allDONIDs { + d := state.IDsToDONs[id] + if !d.DON.IsPublic { continue } publicDONs = append(publicDONs, d) - for _, nid := range d.NodeP2PIds { + for _, nid := range d.DON.Members { allPeers[nid] = defaultStreamConfig } } @@ -171,18 +172,19 @@ func (w *launcher) Launch(ctx context.Context, state registrysyncer.State) error // We'll also construct a set to record what DONs the current node is a part of, // regardless of any modifiers (public/acceptsWorkflows etc). myID := w.peerWrapper.GetPeer().ID() - myWorkflowDONs := []kcr.CapabilitiesRegistryDONInfo{} - remoteWorkflowDONs := []kcr.CapabilitiesRegistryDONInfo{} + myWorkflowDONs := []registrysyncer.DON{} + remoteWorkflowDONs := []registrysyncer.DON{} myDONs := map[uint32]bool{} - for _, d := range state.IDsToDONs { - for _, peerID := range d.NodeP2PIds { + for _, id := range allDONIDs { + d := state.IDsToDONs[id] + for _, peerID := range d.Members { if peerID == myID { - myDONs[d.Id] = true + myDONs[d.ID] = true } } if d.AcceptsWorkflows { - if myDONs[d.Id] { + if myDONs[d.ID] { myWorkflowDONs = append(myWorkflowDONs, d) } else { remoteWorkflowDONs = append(remoteWorkflowDONs, d) @@ -192,11 +194,11 @@ func (w *launcher) Launch(ctx context.Context, state registrysyncer.State) error // - remote capability DONs (with IsPublic = true) the current node is a part of. // These need server-side shims. - myCapabilityDONs := []kcr.CapabilitiesRegistryDONInfo{} - remoteCapabilityDONs := []kcr.CapabilitiesRegistryDONInfo{} + myCapabilityDONs := []registrysyncer.DON{} + remoteCapabilityDONs := []registrysyncer.DON{} for _, d := range publicDONs { if len(d.CapabilityConfigurations) > 0 { - if myDONs[d.Id] { + if myDONs[d.ID] { myCapabilityDONs = append(myCapabilityDONs, d) } else { remoteCapabilityDONs = append(remoteCapabilityDONs, d) @@ -211,7 +213,7 @@ func (w *launcher) Launch(ctx context.Context, state registrysyncer.State) error // NOTE: this is enforced on-chain and so should never happen. if len(myWorkflowDONs) > 1 { - w.lggr.Error("invariant violation: node is part of more than one workflowDON: this shouldn't happen.") + return errors.New("invariant violation: node is part of more than one workflowDON") } for _, rcd := range remoteCapabilityDONs { @@ -236,14 +238,19 @@ func (w *launcher) Launch(ctx context.Context, state registrysyncer.State) error return nil } -func (w *launcher) addRemoteCapabilities(ctx context.Context, myDON kcr.CapabilitiesRegistryDONInfo, remoteDON kcr.CapabilitiesRegistryDONInfo, state registrysyncer.State) error { - for _, c := range remoteDON.CapabilityConfigurations { - capability, ok := state.IDsToCapabilities[c.CapabilityId] +func (w *launcher) addRemoteCapabilities(ctx context.Context, myDON registrysyncer.DON, remoteDON registrysyncer.DON, state *registrysyncer.LocalRegistry) error { + for cid, c := range remoteDON.CapabilityConfigurations { + capability, ok := state.IDsToCapabilities[cid] if !ok { - return fmt.Errorf("could not find capability matching id %s", c.CapabilityId) + return fmt.Errorf("could not find capability matching id %s", cid) } - switch toCapabilityType(capability.CapabilityType) { + capabilityConfig, err := unmarshalCapabilityConfig(c.Config) + if err != nil { + return fmt.Errorf("could not unmarshal capability config for id %s", cid) + } + + switch capability.CapabilityType { case capabilities.CapabilityTypeTrigger: newTriggerFn := func(info capabilities.CapabilityInfo) (capabilityService, error) { if !strings.HasPrefix(info.ID, "streams-trigger") { @@ -263,12 +270,7 @@ func (w *launcher) addRemoteCapabilities(ctx context.Context, myDON kcr.Capabili int(remoteDON.F+1), w.lggr, ) - cfg := &remotetypes.RemoteTriggerConfig{} - cfg.ApplyDefaults() - err = proto.Unmarshal(c.Config, cfg) - if err != nil { - return nil, err - } + // TODO: We need to implement a custom, Mercury-specific // aggregator here, because there is no guarantee that // all trigger events in the workflow will have the same @@ -276,10 +278,10 @@ func (w *launcher) addRemoteCapabilities(ctx context.Context, myDON kcr.Capabili // When this is solved, we can move to a generic aggregator // and remove this. triggerCap := remote.NewTriggerSubscriber( - cfg, + capabilityConfig.RemoteTriggerConfig, info, - *toDONInfo(remoteDON), - *toDONInfo(myDON), + remoteDON.DON, + myDON.DON, w.dispatcher, aggregator, w.lggr, @@ -298,7 +300,7 @@ func (w *launcher) addRemoteCapabilities(ctx context.Context, myDON kcr.Capabili newTargetFn := func(info capabilities.CapabilityInfo) (capabilityService, error) { client := target.NewClient( info, - *toDONInfo(myDON), + myDON.DON, w.dispatcher, defaultTargetRequestTimeout, w.lggr, @@ -323,24 +325,24 @@ type capabilityService interface { services.Service } -func (w *launcher) addToRegistryAndSetDispatcher(ctx context.Context, capabilityInfo kcr.CapabilitiesRegistryCapabilityInfo, don kcr.CapabilitiesRegistryDONInfo, newCapFn func(info capabilities.CapabilityInfo) (capabilityService, error)) error { - fullCapID := fmt.Sprintf("%s@%s", capabilityInfo.LabelledName, capabilityInfo.Version) +func (w *launcher) addToRegistryAndSetDispatcher(ctx context.Context, capability registrysyncer.Capability, don registrysyncer.DON, newCapFn func(info capabilities.CapabilityInfo) (capabilityService, error)) error { + capabilityID := capability.ID info, err := capabilities.NewRemoteCapabilityInfo( - fullCapID, - toCapabilityType(capabilityInfo.CapabilityType), - fmt.Sprintf("Remote Capability for %s", fullCapID), - toDONInfo(don), + capabilityID, + capability.CapabilityType, + fmt.Sprintf("Remote Capability for %s", capabilityID), + &don.DON, ) if err != nil { return fmt.Errorf("failed to create remote capability info: %w", err) } w.lggr.Debugw("Adding remote capability to registry", "id", info.ID, "don", info.DON) - capability, err := newCapFn(info) + cp, err := newCapFn(info) if err != nil { return fmt.Errorf("failed to instantiate capability: %w", err) } - err = w.registry.Add(ctx, capability) + err = w.registry.Add(ctx, cp) if err != nil { // If the capability already exists, then it's either local // or we've handled this in a previous syncer iteration, @@ -353,19 +355,19 @@ func (w *launcher) addToRegistryAndSetDispatcher(ctx context.Context, capability } err = w.dispatcher.SetReceiver( - fullCapID, - don.Id, - capability, + capabilityID, + don.ID, + cp, ) if err != nil { return err } - w.lggr.Debugw("Setting receiver for capability", "id", fullCapID, "donID", don.Id) - err = capability.Start(ctx) + w.lggr.Debugw("Setting receiver for capability", "id", capabilityID, "donID", don.ID) + err = cp.Start(ctx) if err != nil { return fmt.Errorf("failed to start capability: %w", err) } - w.subServices = append(w.subServices, capability) + w.subServices = append(w.subServices, cp) return nil } @@ -373,32 +375,31 @@ var ( defaultTargetRequestTimeout = time.Minute ) -func (w *launcher) exposeCapabilities(ctx context.Context, myPeerID p2ptypes.PeerID, don kcr.CapabilitiesRegistryDONInfo, state registrysyncer.State, remoteWorkflowDONs []kcr.CapabilitiesRegistryDONInfo) error { +func (w *launcher) exposeCapabilities(ctx context.Context, myPeerID p2ptypes.PeerID, don registrysyncer.DON, state *registrysyncer.LocalRegistry, remoteWorkflowDONs []registrysyncer.DON) error { idsToDONs := map[uint32]capabilities.DON{} for _, d := range remoteWorkflowDONs { - idsToDONs[d.Id] = *toDONInfo(d) + idsToDONs[d.ID] = d.DON } - for _, c := range don.CapabilityConfigurations { - capability, ok := state.IDsToCapabilities[c.CapabilityId] + for cid, c := range don.CapabilityConfigurations { + capability, ok := state.IDsToCapabilities[cid] if !ok { - return fmt.Errorf("could not find capability matching id %s", c.CapabilityId) + return fmt.Errorf("could not find capability matching id %s", cid) + } + + capabilityConfig, err := unmarshalCapabilityConfig(c.Config) + if err != nil { + return fmt.Errorf("could not unmarshal capability config for id %s", cid) } - switch toCapabilityType(capability.CapabilityType) { + switch capability.CapabilityType { case capabilities.CapabilityTypeTrigger: - newTriggerPublisher := func(capability capabilities.BaseCapability, info capabilities.CapabilityInfo) (receiverService, error) { - cfg := &remotetypes.RemoteTriggerConfig{} - cfg.ApplyDefaults() - err := proto.Unmarshal(c.Config, cfg) - if err != nil { - return nil, err - } + newTriggerPublisher := func(capability capabilities.BaseCapability, info capabilities.CapabilityInfo) (remotetypes.ReceiverService, error) { publisher := remote.NewTriggerPublisher( - cfg, + capabilityConfig.RemoteTriggerConfig, capability.(capabilities.TriggerCapability), info, - *toDONInfo(don), + don.DON, idsToDONs, w.dispatcher, w.lggr, @@ -415,12 +416,13 @@ func (w *launcher) exposeCapabilities(ctx context.Context, myPeerID p2ptypes.Pee case capabilities.CapabilityTypeConsensus: w.lggr.Warn("no remote client configured for capability type consensus, skipping configuration") case capabilities.CapabilityTypeTarget: - newTargetServer := func(capability capabilities.BaseCapability, info capabilities.CapabilityInfo) (receiverService, error) { + newTargetServer := func(capability capabilities.BaseCapability, info capabilities.CapabilityInfo) (remotetypes.ReceiverService, error) { return target.NewServer( + capabilityConfig.RemoteTargetConfig, myPeerID, capability.(capabilities.TargetCapability), info, - *toDONInfo(don), + don.DON, idsToDONs, w.dispatcher, defaultTargetRequestTimeout, @@ -439,23 +441,18 @@ func (w *launcher) exposeCapabilities(ctx context.Context, myPeerID p2ptypes.Pee return nil } -type receiverService interface { - services.Service - remotetypes.Receiver -} - -func (w *launcher) addReceiver(ctx context.Context, capability kcr.CapabilitiesRegistryCapabilityInfo, don kcr.CapabilitiesRegistryDONInfo, newReceiverFn func(capability capabilities.BaseCapability, info capabilities.CapabilityInfo) (receiverService, error)) error { - fullCapID := fmt.Sprintf("%s@%s", capability.LabelledName, capability.Version) +func (w *launcher) addReceiver(ctx context.Context, capability registrysyncer.Capability, don registrysyncer.DON, newReceiverFn func(capability capabilities.BaseCapability, info capabilities.CapabilityInfo) (remotetypes.ReceiverService, error)) error { + capID := capability.ID info, err := capabilities.NewRemoteCapabilityInfo( - fullCapID, - toCapabilityType(capability.CapabilityType), - fmt.Sprintf("Remote Capability for %s", fullCapID), - toDONInfo(don), + capID, + capability.CapabilityType, + fmt.Sprintf("Remote Capability for %s", capability.ID), + &don.DON, ) if err != nil { return fmt.Errorf("failed to instantiate remote capability for receiver: %w", err) } - underlying, err := w.registry.Get(ctx, fullCapID) + underlying, err := w.registry.Get(ctx, capability.ID) if err != nil { return fmt.Errorf("failed to get capability from registry: %w", err) } @@ -465,9 +462,14 @@ func (w *launcher) addReceiver(ctx context.Context, capability kcr.CapabilitiesR return fmt.Errorf("failed to instantiate receiver: %w", err) } - w.lggr.Debugw("Enabling external access for capability", "id", fullCapID, "donID", don.Id) - err = w.dispatcher.SetReceiver(fullCapID, don.Id, receiver) - if err != nil { + w.lggr.Debugw("Enabling external access for capability", "id", capID, "donID", don.ID) + err = w.dispatcher.SetReceiver(capID, don.ID, receiver) + if errors.Is(err, remote.ErrReceiverExists) { + // If a receiver already exists, let's log the error for debug purposes, but + // otherwise short-circuit here. We've handled this capability in a previous iteration. + w.lggr.Debugf("receiver already exists for cap ID %s and don ID %d: %s", capID, don.ID, err) + return nil + } else if err != nil { return fmt.Errorf("failed to set receiver: %w", err) } @@ -480,9 +482,9 @@ func (w *launcher) addReceiver(ctx context.Context, capability kcr.CapabilitiesR return nil } -func signersFor(don kcr.CapabilitiesRegistryDONInfo, state registrysyncer.State) ([][]byte, error) { +func signersFor(don registrysyncer.DON, state *registrysyncer.LocalRegistry) ([][]byte, error) { s := [][]byte{} - for _, nodeID := range don.NodeP2PIds { + for _, nodeID := range don.Members { node, ok := state.IDsToNodes[nodeID] if !ok { return nil, fmt.Errorf("could not find node for id %s", nodeID) @@ -495,33 +497,3 @@ func signersFor(don kcr.CapabilitiesRegistryDONInfo, state registrysyncer.State) return s, nil } - -func toDONInfo(don kcr.CapabilitiesRegistryDONInfo) *capabilities.DON { - peerIDs := []p2ptypes.PeerID{} - for _, p := range don.NodeP2PIds { - peerIDs = append(peerIDs, p) - } - - return &capabilities.DON{ - ID: don.Id, - ConfigVersion: don.ConfigCount, - Members: peerIDs, - F: don.F, - } -} - -func toCapabilityType(capabilityType uint8) capabilities.CapabilityType { - switch capabilityType { - case 0: - return capabilities.CapabilityTypeTrigger - case 1: - return capabilities.CapabilityTypeAction - case 2: - return capabilities.CapabilityTypeConsensus - case 3: - return capabilities.CapabilityTypeTarget - default: - // Not found - return capabilities.CapabilityType(-1) - } -} diff --git a/core/capabilities/launcher_test.go b/core/capabilities/launcher_test.go index a2d1c601694..425c6815a43 100644 --- a/core/capabilities/launcher_test.go +++ b/core/capabilities/launcher_test.go @@ -4,15 +4,20 @@ import ( "context" "crypto/rand" "testing" + "time" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/types/known/durationpb" ragetypes "github.com/smartcontractkit/libocr/ragep2p/types" "github.com/smartcontractkit/chainlink-common/pkg/capabilities" + capabilitiespb "github.com/smartcontractkit/chainlink-common/pkg/capabilities/pb" "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" + "github.com/smartcontractkit/chainlink/v2/core/capabilities/remote" remoteMocks "github.com/smartcontractkit/chainlink/v2/core/capabilities/remote/types/mocks" kcr "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/capabilities_registry" "github.com/smartcontractkit/chainlink/v2/core/logger" @@ -25,11 +30,11 @@ type mockTrigger struct { capabilities.CapabilityInfo } -func (m *mockTrigger) RegisterTrigger(ctx context.Context, request capabilities.CapabilityRequest) (<-chan capabilities.CapabilityResponse, error) { +func (m *mockTrigger) RegisterTrigger(ctx context.Context, request capabilities.TriggerRegistrationRequest) (<-chan capabilities.TriggerResponse, error) { return nil, nil } -func (m *mockTrigger) UnregisterTrigger(ctx context.Context, request capabilities.CapabilityRequest) error { +func (m *mockTrigger) UnregisterTrigger(ctx context.Context, request capabilities.TriggerRegistrationRequest) error { return nil } @@ -41,8 +46,8 @@ type mockCapability struct { capabilities.CapabilityInfo } -func (m *mockCapability) Execute(ctx context.Context, req capabilities.CapabilityRequest) (<-chan capabilities.CapabilityResponse, error) { - return nil, nil +func (m *mockCapability) Execute(ctx context.Context, req capabilities.CapabilityRequest) (capabilities.CapabilityResponse, error) { + return capabilities.CapabilityResponse{}, nil } func (m *mockCapability) RegisterToWorkflow(ctx context.Context, request capabilities.RegisterToWorkflowRequest) error { @@ -77,7 +82,7 @@ func TestLauncher_WiresUpExternalCapabilities(t *testing.T) { wrapper := mocks.NewPeerWrapper(t) wrapper.On("GetPeer").Return(peer) - nodes := [][32]byte{ + nodes := []ragetypes.PeerID{ pid, randomWord(), randomWord(), @@ -109,37 +114,31 @@ func TestLauncher_WiresUpExternalCapabilities(t *testing.T) { // which exposes the streams-trigger and write_chain capabilities. // We expect a publisher to be wired up with this configuration, and // no entries should be added to the registry. - state := registrysyncer.State{ - IDsToDONs: map[registrysyncer.DonID]kcr.CapabilitiesRegistryDONInfo{ + state := ®istrysyncer.LocalRegistry{ + IDsToDONs: map[registrysyncer.DonID]registrysyncer.DON{ registrysyncer.DonID(dID): { - Id: dID, - ConfigCount: uint32(0), - F: uint8(1), - IsPublic: true, - AcceptsWorkflows: true, - NodeP2PIds: nodes, - CapabilityConfigurations: []kcr.CapabilitiesRegistryCapabilityConfiguration{ - { - CapabilityId: triggerCapID, - Config: []byte(""), - }, - { - CapabilityId: targetCapID, - Config: []byte(""), - }, + DON: capabilities.DON{ + ID: dID, + ConfigVersion: uint32(0), + F: uint8(1), + IsPublic: true, + AcceptsWorkflows: true, + Members: nodes, + }, + CapabilityConfigurations: map[string]registrysyncer.CapabilityConfiguration{ + fullTriggerCapID: {}, + fullTargetID: {}, }, }, }, - IDsToCapabilities: map[registrysyncer.HashedCapabilityID]kcr.CapabilitiesRegistryCapabilityInfo{ - triggerCapID: { - LabelledName: "streams-trigger", - Version: "1.0.0", - CapabilityType: 0, + IDsToCapabilities: map[string]registrysyncer.Capability{ + fullTriggerCapID: { + ID: "streams-trigger@1.0.0", + CapabilityType: capabilities.CapabilityTypeTrigger, }, - targetCapID: { - LabelledName: "write-chain_evm_1", - Version: "1.0.0", - CapabilityType: 3, + fullTargetID: { + ID: "write-chain_evm_1@1.0.0", + CapabilityType: capabilities.CapabilityTypeTarget, }, }, IDsToNodes: map[p2ptypes.PeerID]kcr.CapabilitiesRegistryNodeInfo{ @@ -200,51 +199,48 @@ func TestSyncer_IgnoresCapabilitiesForPrivateDON(t *testing.T) { wrapper := mocks.NewPeerWrapper(t) wrapper.On("GetPeer").Return(peer) - nodes := [][32]byte{ + nodes := []ragetypes.PeerID{ pid, randomWord(), randomWord(), randomWord(), } - triggerCapID := randomWord() - targetCapID := randomWord() dID := uint32(1) + triggerID := "streams-trigger@1.0.0" + hashedTriggerID := randomWord() + targetID := "write-chain_evm_1@1.0.0" + hashedTargetID := randomWord() + // The below state describes a Workflow DON (AcceptsWorkflows = true), // which isn't public (IsPublic = false), but hosts the // the streams-trigger and write_chain capabilities. // We expect no action to be taken by the syncer. - state := registrysyncer.State{ - IDsToDONs: map[registrysyncer.DonID]kcr.CapabilitiesRegistryDONInfo{ + state := ®istrysyncer.LocalRegistry{ + IDsToDONs: map[registrysyncer.DonID]registrysyncer.DON{ registrysyncer.DonID(dID): { - Id: dID, - ConfigCount: uint32(0), - F: uint8(1), - IsPublic: false, - AcceptsWorkflows: true, - NodeP2PIds: nodes, - CapabilityConfigurations: []kcr.CapabilitiesRegistryCapabilityConfiguration{ - { - CapabilityId: triggerCapID, - Config: []byte(""), - }, - { - CapabilityId: targetCapID, - Config: []byte(""), - }, + DON: capabilities.DON{ + ID: dID, + ConfigVersion: uint32(0), + F: uint8(1), + IsPublic: false, + AcceptsWorkflows: true, + Members: nodes, + }, + CapabilityConfigurations: map[string]registrysyncer.CapabilityConfiguration{ + triggerID: {}, + targetID: {}, }, }, }, - IDsToCapabilities: map[registrysyncer.HashedCapabilityID]kcr.CapabilitiesRegistryCapabilityInfo{ - triggerCapID: { - LabelledName: "streams-trigger", - Version: "1.0.0", - CapabilityType: 0, + IDsToCapabilities: map[string]registrysyncer.Capability{ + triggerID: { + ID: triggerID, + CapabilityType: capabilities.CapabilityTypeTrigger, }, - targetCapID: { - LabelledName: "write-chain_evm_1", - Version: "1.0.0", - CapabilityType: 3, + targetID: { + ID: targetID, + CapabilityType: capabilities.CapabilityTypeTarget, }, }, IDsToNodes: map[p2ptypes.PeerID]kcr.CapabilitiesRegistryNodeInfo{ @@ -252,25 +248,25 @@ func TestSyncer_IgnoresCapabilitiesForPrivateDON(t *testing.T) { NodeOperatorId: 1, Signer: randomWord(), P2pId: nodes[0], - HashedCapabilityIds: [][32]byte{triggerCapID, targetCapID}, + HashedCapabilityIds: [][32]byte{hashedTriggerID, hashedTargetID}, }, nodes[1]: { NodeOperatorId: 1, Signer: randomWord(), P2pId: nodes[1], - HashedCapabilityIds: [][32]byte{triggerCapID, targetCapID}, + HashedCapabilityIds: [][32]byte{hashedTriggerID, hashedTargetID}, }, nodes[2]: { NodeOperatorId: 1, Signer: randomWord(), P2pId: nodes[2], - HashedCapabilityIds: [][32]byte{triggerCapID, targetCapID}, + HashedCapabilityIds: [][32]byte{hashedTriggerID, hashedTargetID}, }, nodes[3]: { NodeOperatorId: 1, Signer: randomWord(), P2pId: nodes[3], - HashedCapabilityIds: [][32]byte{triggerCapID, targetCapID}, + HashedCapabilityIds: [][32]byte{hashedTriggerID, hashedTargetID}, }, }, } @@ -308,14 +304,14 @@ func TestLauncher_WiresUpClientsForPublicWorkflowDON(t *testing.T) { wrapper := mocks.NewPeerWrapper(t) wrapper.On("GetPeer").Return(peer) - workflowDonNodes := [][32]byte{ + workflowDonNodes := []ragetypes.PeerID{ pid, randomWord(), randomWord(), randomWord(), } - capabilityDonNodes := [][32]byte{ + capabilityDonNodes := []ragetypes.PeerID{ randomWord(), randomWord(), randomWord(), @@ -331,45 +327,57 @@ func TestLauncher_WiresUpClientsForPublicWorkflowDON(t *testing.T) { // The below state describes a Workflow DON (AcceptsWorkflows = true), // which exposes the streams-trigger and write_chain capabilities. // We expect receivers to be wired up and both capabilities to be added to the registry. - state := registrysyncer.State{ - IDsToDONs: map[registrysyncer.DonID]kcr.CapabilitiesRegistryDONInfo{ + rtc := &capabilities.RemoteTriggerConfig{} + rtc.ApplyDefaults() + + cfg, err := proto.Marshal(&capabilitiespb.CapabilityConfig{ + RemoteConfig: &capabilitiespb.CapabilityConfig_RemoteTriggerConfig{ + RemoteTriggerConfig: &capabilitiespb.RemoteTriggerConfig{ + RegistrationRefresh: durationpb.New(1 * time.Second), + }, + }, + }) + require.NoError(t, err) + + state := ®istrysyncer.LocalRegistry{ + IDsToDONs: map[registrysyncer.DonID]registrysyncer.DON{ registrysyncer.DonID(dID): { - Id: dID, - ConfigCount: uint32(0), - F: uint8(1), - IsPublic: true, - AcceptsWorkflows: true, - NodeP2PIds: workflowDonNodes, + DON: capabilities.DON{ + ID: dID, + ConfigVersion: uint32(0), + F: uint8(1), + IsPublic: true, + AcceptsWorkflows: true, + Members: workflowDonNodes, + }, }, registrysyncer.DonID(capDonID): { - Id: capDonID, - ConfigCount: uint32(0), - F: uint8(1), - IsPublic: true, - AcceptsWorkflows: false, - NodeP2PIds: capabilityDonNodes, - CapabilityConfigurations: []kcr.CapabilitiesRegistryCapabilityConfiguration{ - { - CapabilityId: triggerCapID, - Config: []byte(""), + DON: capabilities.DON{ + ID: capDonID, + ConfigVersion: uint32(0), + F: uint8(1), + IsPublic: true, + AcceptsWorkflows: false, + Members: capabilityDonNodes, + }, + CapabilityConfigurations: map[string]registrysyncer.CapabilityConfiguration{ + fullTriggerCapID: { + Config: cfg, }, - { - CapabilityId: targetCapID, - Config: []byte(""), + fullTargetID: { + Config: cfg, }, }, }, }, - IDsToCapabilities: map[registrysyncer.HashedCapabilityID]kcr.CapabilitiesRegistryCapabilityInfo{ - triggerCapID: { - LabelledName: "streams-trigger", - Version: "1.0.0", - CapabilityType: 0, + IDsToCapabilities: map[string]registrysyncer.Capability{ + fullTriggerCapID: { + ID: fullTriggerCapID, + CapabilityType: capabilities.CapabilityTypeTrigger, }, - targetCapID: { - LabelledName: "write-chain_evm_1", - Version: "1.0.0", - CapabilityType: 3, + fullTargetID: { + ID: fullTargetID, + CapabilityType: capabilities.CapabilityTypeTarget, }, }, IDsToNodes: map[p2ptypes.PeerID]kcr.CapabilitiesRegistryNodeInfo{ @@ -456,14 +464,14 @@ func TestLauncher_WiresUpClientsForPublicWorkflowDONButIgnoresPrivateCapabilitie wrapper := mocks.NewPeerWrapper(t) wrapper.On("GetPeer").Return(peer) - workflowDonNodes := [][32]byte{ + workflowDonNodes := []ragetypes.PeerID{ pid, randomWord(), randomWord(), randomWord(), } - capabilityDonNodes := [][32]byte{ + capabilityDonNodes := []ragetypes.PeerID{ randomWord(), randomWord(), randomWord(), @@ -471,6 +479,7 @@ func TestLauncher_WiresUpClientsForPublicWorkflowDONButIgnoresPrivateCapabilitie } fullTriggerCapID := "streams-trigger@1.0.0" + fullTargetID := "write-chain_evm_1@1.0.0" triggerCapID := randomWord() targetCapID := randomWord() dID := uint32(1) @@ -479,55 +488,53 @@ func TestLauncher_WiresUpClientsForPublicWorkflowDONButIgnoresPrivateCapabilitie // The below state describes a Workflow DON (AcceptsWorkflows = true), // which exposes the streams-trigger and write_chain capabilities. // We expect receivers to be wired up and both capabilities to be added to the registry. - state := registrysyncer.State{ - IDsToDONs: map[registrysyncer.DonID]kcr.CapabilitiesRegistryDONInfo{ + state := ®istrysyncer.LocalRegistry{ + IDsToDONs: map[registrysyncer.DonID]registrysyncer.DON{ registrysyncer.DonID(dID): { - Id: dID, - ConfigCount: uint32(0), - F: uint8(1), - IsPublic: true, - AcceptsWorkflows: true, - NodeP2PIds: workflowDonNodes, + DON: capabilities.DON{ + ID: dID, + ConfigVersion: uint32(0), + F: uint8(1), + IsPublic: true, + AcceptsWorkflows: true, + Members: workflowDonNodes, + }, }, registrysyncer.DonID(triggerCapDonID): { - Id: triggerCapDonID, - ConfigCount: uint32(0), - F: uint8(1), - IsPublic: true, - AcceptsWorkflows: false, - NodeP2PIds: capabilityDonNodes, - CapabilityConfigurations: []kcr.CapabilitiesRegistryCapabilityConfiguration{ - { - CapabilityId: triggerCapID, - Config: []byte(""), - }, + DON: capabilities.DON{ + ID: triggerCapDonID, + ConfigVersion: uint32(0), + F: uint8(1), + IsPublic: true, + AcceptsWorkflows: false, + Members: capabilityDonNodes, + }, + CapabilityConfigurations: map[string]registrysyncer.CapabilityConfiguration{ + fullTriggerCapID: {}, }, }, registrysyncer.DonID(targetCapDonID): { - Id: targetCapDonID, - ConfigCount: uint32(0), - F: uint8(1), - IsPublic: false, - AcceptsWorkflows: false, - NodeP2PIds: capabilityDonNodes, - CapabilityConfigurations: []kcr.CapabilitiesRegistryCapabilityConfiguration{ - { - CapabilityId: targetCapID, - Config: []byte(""), - }, + DON: capabilities.DON{ + ID: targetCapDonID, + ConfigVersion: uint32(0), + F: uint8(1), + IsPublic: false, + AcceptsWorkflows: false, + Members: capabilityDonNodes, + }, + CapabilityConfigurations: map[string]registrysyncer.CapabilityConfiguration{ + fullTargetID: {}, }, }, }, - IDsToCapabilities: map[registrysyncer.HashedCapabilityID]kcr.CapabilitiesRegistryCapabilityInfo{ - triggerCapID: { - LabelledName: "streams-trigger", - Version: "1.0.0", - CapabilityType: 0, + IDsToCapabilities: map[string]registrysyncer.Capability{ + fullTriggerCapID: { + ID: fullTriggerCapID, + CapabilityType: capabilities.CapabilityTypeTrigger, }, - targetCapID: { - LabelledName: "write-chain_evm_1", - Version: "1.0.0", - CapabilityType: 3, + fullTargetID: { + ID: fullTargetID, + CapabilityType: capabilities.CapabilityTypeTarget, }, }, IDsToNodes: map[p2ptypes.PeerID]kcr.CapabilitiesRegistryNodeInfo{ @@ -595,15 +602,7 @@ func TestLauncher_WiresUpClientsForPublicWorkflowDONButIgnoresPrivateCapabilitie require.NoError(t, err) } -func toPeerIDs(is [][32]byte) (out []p2ptypes.PeerID) { - for _, i := range is { - out = append(out, i) - } - - return out -} - -func TestLauncher_LocalNode(t *testing.T) { +func TestLauncher_SucceedsEvenIfDispatcherAlreadyHasReceiver(t *testing.T) { ctx := tests.Context(t) lggr := logger.TestLogger(t) registry := NewRegistry(lggr) @@ -618,29 +617,91 @@ func TestLauncher_LocalNode(t *testing.T) { wrapper := mocks.NewPeerWrapper(t) wrapper.On("GetPeer").Return(peer) - workflowDonNodes := [][32]byte{ + fullTriggerCapID := "streams-trigger@1.0.0" + mt := newMockTrigger(capabilities.MustNewCapabilityInfo( + fullTriggerCapID, + capabilities.CapabilityTypeTrigger, + "streams trigger", + )) + require.NoError(t, registry.Add(ctx, mt)) + + workflowDonNodes := []p2ptypes.PeerID{ + randomWord(), + randomWord(), + randomWord(), + randomWord(), + } + + capabilityDonNodes := []p2ptypes.PeerID{ pid, randomWord(), randomWord(), randomWord(), } + triggerCapID := randomWord() dID := uint32(1) - // The below state describes a Workflow DON (AcceptsWorkflows = true), + capDonID := uint32(2) + // The below state describes a Capability DON (AcceptsWorkflows = true), // which exposes the streams-trigger and write_chain capabilities. - // We expect receivers to be wired up and both capabilities to be added to the registry. - state := registrysyncer.State{ - IDsToDONs: map[registrysyncer.DonID]kcr.CapabilitiesRegistryDONInfo{ + // We expect receivers to be wired up. + state := ®istrysyncer.LocalRegistry{ + IDsToDONs: map[registrysyncer.DonID]registrysyncer.DON{ registrysyncer.DonID(dID): { - Id: dID, - ConfigCount: uint32(2), - F: uint8(1), - IsPublic: true, - AcceptsWorkflows: true, - NodeP2PIds: workflowDonNodes, + DON: capabilities.DON{ + ID: dID, + ConfigVersion: uint32(0), + F: uint8(1), + IsPublic: true, + AcceptsWorkflows: true, + Members: workflowDonNodes, + }, + }, + registrysyncer.DonID(capDonID): { + DON: capabilities.DON{ + ID: capDonID, + ConfigVersion: uint32(0), + F: uint8(1), + IsPublic: true, + AcceptsWorkflows: false, + Members: capabilityDonNodes, + }, + CapabilityConfigurations: map[string]registrysyncer.CapabilityConfiguration{ + fullTriggerCapID: {}, + }, + }, + }, + IDsToCapabilities: map[string]registrysyncer.Capability{ + fullTriggerCapID: { + ID: fullTriggerCapID, + CapabilityType: capabilities.CapabilityTypeTrigger, }, }, IDsToNodes: map[p2ptypes.PeerID]kcr.CapabilitiesRegistryNodeInfo{ + capabilityDonNodes[0]: { + NodeOperatorId: 1, + Signer: randomWord(), + P2pId: capabilityDonNodes[0], + HashedCapabilityIds: [][32]byte{triggerCapID}, + }, + capabilityDonNodes[1]: { + NodeOperatorId: 1, + Signer: randomWord(), + P2pId: capabilityDonNodes[1], + HashedCapabilityIds: [][32]byte{triggerCapID}, + }, + capabilityDonNodes[2]: { + NodeOperatorId: 1, + Signer: randomWord(), + P2pId: capabilityDonNodes[2], + HashedCapabilityIds: [][32]byte{triggerCapID}, + }, + capabilityDonNodes[3]: { + NodeOperatorId: 1, + Signer: randomWord(), + P2pId: capabilityDonNodes[3], + HashedCapabilityIds: [][32]byte{triggerCapID}, + }, workflowDonNodes[0]: { NodeOperatorId: 1, Signer: randomWord(), @@ -664,6 +725,8 @@ func TestLauncher_LocalNode(t *testing.T) { }, } + dispatcher.On("SetReceiver", fullTriggerCapID, capDonID, mock.AnythingOfType("*remote.triggerPublisher")).Return(remote.ErrReceiverExists) + launcher := NewLauncher( lggr, wrapper, @@ -674,20 +737,4 @@ func TestLauncher_LocalNode(t *testing.T) { err = launcher.Launch(ctx, state) require.NoError(t, err) defer launcher.Close() - - node, err := launcher.LocalNode(ctx) - require.NoError(t, err) - - don := capabilities.DON{ - ID: dID, - ConfigVersion: 2, - Members: toPeerIDs(workflowDonNodes), - F: 1, - } - expectedNode := capabilities.Node{ - PeerID: &pid, - WorkflowDON: don, - CapabilityDONs: []capabilities.DON{don}, - } - assert.Equal(t, expectedNode, node) } diff --git a/core/capabilities/registry.go b/core/capabilities/registry.go index 4cca25d03ca..47285505805 100644 --- a/core/capabilities/registry.go +++ b/core/capabilities/registry.go @@ -8,22 +8,57 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/capabilities" "github.com/smartcontractkit/chainlink/v2/core/logger" + p2ptypes "github.com/smartcontractkit/chainlink/v2/core/services/p2p/types" + "github.com/smartcontractkit/chainlink/v2/core/services/registrysyncer" ) var ( ErrCapabilityAlreadyExists = errors.New("capability already exists") ) +type metadataRegistry interface { + LocalNode(ctx context.Context) (capabilities.Node, error) + ConfigForCapability(ctx context.Context, capabilityID string, donID uint32) (registrysyncer.CapabilityConfiguration, error) +} + // Registry is a struct for the registry of capabilities. // Registry is safe for concurrent use. type Registry struct { - lggr logger.Logger - m map[string]capabilities.BaseCapability - mu sync.RWMutex + metadataRegistry metadataRegistry + lggr logger.Logger + m map[string]capabilities.BaseCapability + mu sync.RWMutex +} + +func (r *Registry) LocalNode(ctx context.Context) (capabilities.Node, error) { + if r.metadataRegistry == nil { + return capabilities.Node{}, errors.New("metadataRegistry information not available") + } + + return r.metadataRegistry.LocalNode(ctx) +} + +func (r *Registry) ConfigForCapability(ctx context.Context, capabilityID string, donID uint32) (capabilities.CapabilityConfiguration, error) { + r.mu.RLock() + defer r.mu.RUnlock() + if r.metadataRegistry == nil { + return capabilities.CapabilityConfiguration{}, errors.New("metadataRegistry information not available") + } + + cfc, err := r.metadataRegistry.ConfigForCapability(ctx, capabilityID, donID) + if err != nil { + return capabilities.CapabilityConfiguration{}, err + } + + return unmarshalCapabilityConfig(cfc.Config) } -func (r *Registry) GetLocalNode(_ context.Context) (capabilities.Node, error) { - return capabilities.Node{}, nil +// SetLocalRegistry sets a local copy of the offchain registry for the registry to use. +// This is only public for testing purposes; the only production use should be from the CapabilitiesLauncher. +func (r *Registry) SetLocalRegistry(lr metadataRegistry) { + r.mu.Lock() + defer r.mu.Unlock() + r.metadataRegistry = lr } // Get gets a capability from the registry. @@ -165,3 +200,30 @@ func NewRegistry(lggr logger.Logger) *Registry { lggr: lggr.Named("CapabilitiesRegistry"), } } + +// TestMetadataRegistry is a test implementation of the metadataRegistry +// interface. It is used when ExternalCapabilitiesRegistry is not available. +type TestMetadataRegistry struct{} + +func (t *TestMetadataRegistry) LocalNode(ctx context.Context) (capabilities.Node, error) { + peerID := p2ptypes.PeerID{} + workflowDON := capabilities.DON{ + ID: 1, + ConfigVersion: 1, + Members: []p2ptypes.PeerID{ + peerID, + }, + F: 0, + IsPublic: false, + AcceptsWorkflows: true, + } + return capabilities.Node{ + PeerID: &peerID, + WorkflowDON: workflowDON, + CapabilityDONs: []capabilities.DON{}, + }, nil +} + +func (t *TestMetadataRegistry) ConfigForCapability(ctx context.Context, capabilityID string, donID uint32) (registrysyncer.CapabilityConfiguration, error) { + return registrysyncer.CapabilityConfiguration{}, nil +} diff --git a/core/capabilities/registry_test.go b/core/capabilities/registry_test.go index 77e5d9edcd6..89f366da04a 100644 --- a/core/capabilities/registry_test.go +++ b/core/capabilities/registry_test.go @@ -21,8 +21,8 @@ type mockCapability struct { capabilities.CapabilityInfo } -func (m *mockCapability) Execute(ctx context.Context, req capabilities.CapabilityRequest) (<-chan capabilities.CapabilityResponse, error) { - return nil, nil +func (m *mockCapability) Execute(ctx context.Context, req capabilities.CapabilityRequest) (capabilities.CapabilityResponse, error) { + return capabilities.CapabilityResponse{}, nil } func (m *mockCapability) RegisterToWorkflow(ctx context.Context, request capabilities.RegisterToWorkflowRequest) error { diff --git a/core/capabilities/remote/dispatcher.go b/core/capabilities/remote/dispatcher.go index 90fca50b22c..f27d691bb66 100644 --- a/core/capabilities/remote/dispatcher.go +++ b/core/capabilities/remote/dispatcher.go @@ -3,9 +3,10 @@ package remote import ( "context" "fmt" - sync "sync" + "sync" "time" + "github.com/pkg/errors" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promauto" "google.golang.org/protobuf/proto" @@ -14,18 +15,25 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/types/core" "github.com/smartcontractkit/chainlink/v2/core/capabilities/remote/types" - remotetypes "github.com/smartcontractkit/chainlink/v2/core/capabilities/remote/types" + "github.com/smartcontractkit/chainlink/v2/core/config" "github.com/smartcontractkit/chainlink/v2/core/logger" + "github.com/smartcontractkit/chainlink/v2/core/services/gateway/handlers/common" p2ptypes "github.com/smartcontractkit/chainlink/v2/core/services/p2p/types" ) +var ( + ErrReceiverExists = errors.New("receiver already exists") +) + // dispatcher en/decodes messages and routes traffic between peers and capabilities type dispatcher struct { + cfg config.Dispatcher peerWrapper p2ptypes.PeerWrapper peer p2ptypes.Peer peerID p2ptypes.PeerID signer p2ptypes.Signer registry core.CapabilitiesRegistry + rateLimiter *common.RateLimiter receivers map[key]*receiver mu sync.RWMutex stopCh services.StopChan @@ -40,17 +48,26 @@ type key struct { var _ services.Service = &dispatcher{} -const supportedVersion = 1 - -func NewDispatcher(peerWrapper p2ptypes.PeerWrapper, signer p2ptypes.Signer, registry core.CapabilitiesRegistry, lggr logger.Logger) *dispatcher { +func NewDispatcher(cfg config.Dispatcher, peerWrapper p2ptypes.PeerWrapper, signer p2ptypes.Signer, registry core.CapabilitiesRegistry, lggr logger.Logger) (*dispatcher, error) { + rl, err := common.NewRateLimiter(common.RateLimiterConfig{ + GlobalRPS: cfg.RateLimit().GlobalRPS(), + GlobalBurst: cfg.RateLimit().GlobalBurst(), + PerSenderRPS: cfg.RateLimit().PerSenderRPS(), + PerSenderBurst: cfg.RateLimit().PerSenderBurst(), + }) + if err != nil { + return nil, errors.Wrap(err, "failed to create rate limiter") + } return &dispatcher{ + cfg: cfg, peerWrapper: peerWrapper, signer: signer, registry: registry, + rateLimiter: rl, receivers: make(map[key]*receiver), stopCh: make(services.StopChan), lggr: lggr.Named("Dispatcher"), - } + }, nil } func (d *dispatcher) Start(ctx context.Context) error { @@ -81,23 +98,21 @@ var capReceiveChannelUsage = promauto.NewGaugeVec(prometheus.GaugeOpts{ Help: "The usage of the receive channel for each capability, 0 indicates empty, 1 indicates full.", }, []string{"capabilityId", "donId"}) -const receiverBufferSize = 10000 - type receiver struct { cancel context.CancelFunc - ch chan *remotetypes.MessageBody + ch chan *types.MessageBody } -func (d *dispatcher) SetReceiver(capabilityId string, donId uint32, rec remotetypes.Receiver) error { +func (d *dispatcher) SetReceiver(capabilityId string, donId uint32, rec types.Receiver) error { d.mu.Lock() defer d.mu.Unlock() k := key{capabilityId, donId} _, ok := d.receivers[k] if ok { - return fmt.Errorf("receiver already exists for capability %s and don %d", capabilityId, donId) + return fmt.Errorf("%w: receiver already exists for capability %s and don %d", ErrReceiverExists, capabilityId, donId) } - receiverCh := make(chan *remotetypes.MessageBody, receiverBufferSize) + receiverCh := make(chan *types.MessageBody, d.cfg.ReceiverBufferSize()) ctx, cancelCtx := d.stopCh.NewCtx() d.wg.Add(1) @@ -135,8 +150,8 @@ func (d *dispatcher) RemoveReceiver(capabilityId string, donId uint32) { } } -func (d *dispatcher) Send(peerID p2ptypes.PeerID, msgBody *remotetypes.MessageBody) error { - msgBody.Version = supportedVersion +func (d *dispatcher) Send(peerID p2ptypes.PeerID, msgBody *types.MessageBody) error { + msgBody.Version = uint32(d.cfg.SupportedVersion()) msgBody.Sender = d.peerID[:] msgBody.Receiver = peerID[:] msgBody.Timestamp = time.Now().UnixMilli() @@ -148,7 +163,7 @@ func (d *dispatcher) Send(peerID p2ptypes.PeerID, msgBody *remotetypes.MessageBo if err != nil { return err } - msg := &remotetypes.Message{Signature: signature, Body: rawBody} + msg := &types.Message{Signature: signature, Body: rawBody} rawMsg, err := proto.Marshal(msg) if err != nil { return err @@ -164,6 +179,10 @@ func (d *dispatcher) receive() { d.lggr.Info("stopped - exiting receive") return case msg := <-recvCh: + if !d.rateLimiter.Allow(msg.Sender.String()) { + d.lggr.Debugw("rate limit exceeded, dropping message", "sender", msg.Sender) + continue + } body, err := ValidateMessage(msg, d.peerID) if err != nil { d.lggr.Debugw("received invalid message", "error", err) @@ -175,12 +194,12 @@ func (d *dispatcher) receive() { receiver, ok := d.receivers[k] d.mu.RUnlock() if !ok { - d.lggr.Debugw("received message for unregistered capability", "capabilityId", k.capId, "donId", k.donId) + d.lggr.Debugw("received message for unregistered capability", "capabilityId", SanitizeLogString(k.capId), "donId", k.donId) d.tryRespondWithError(msg.Sender, body, types.Error_CAPABILITY_NOT_FOUND) continue } - receiverQueueUsage := float64(len(receiver.ch)) / receiverBufferSize + receiverQueueUsage := float64(len(receiver.ch)) / float64(d.cfg.ReceiverBufferSize()) capReceiveChannelUsage.WithLabelValues(k.capId, fmt.Sprint(k.donId)).Set(receiverQueueUsage) select { case receiver.ch <- body: @@ -191,7 +210,7 @@ func (d *dispatcher) receive() { } } -func (d *dispatcher) tryRespondWithError(peerID p2ptypes.PeerID, body *remotetypes.MessageBody, errType types.Error) { +func (d *dispatcher) tryRespondWithError(peerID p2ptypes.PeerID, body *types.MessageBody, errType types.Error) { if body == nil { return } diff --git a/core/capabilities/remote/dispatcher_test.go b/core/capabilities/remote/dispatcher_test.go index 173972375ab..50edc5f3530 100644 --- a/core/capabilities/remote/dispatcher_test.go +++ b/core/capabilities/remote/dispatcher_test.go @@ -8,13 +8,15 @@ import ( "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" - commonMocks "github.com/smartcontractkit/chainlink-common/pkg/types/core/mocks" "github.com/smartcontractkit/chainlink/v2/core/capabilities/remote" remotetypes "github.com/smartcontractkit/chainlink/v2/core/capabilities/remote/types" + "github.com/smartcontractkit/chainlink/v2/core/config" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/logger" p2ptypes "github.com/smartcontractkit/chainlink/v2/core/services/p2p/types" "github.com/smartcontractkit/chainlink/v2/core/services/p2p/types/mocks" + + commonMocks "github.com/smartcontractkit/chainlink-common/pkg/types/core/mocks" ) type testReceiver struct { @@ -31,6 +33,47 @@ func (r *testReceiver) Receive(_ context.Context, msg *remotetypes.MessageBody) r.ch <- msg } +type testRateLimitConfig struct { + globalRPS float64 + globalBurst int + rps float64 + burst int +} + +func (c testRateLimitConfig) GlobalRPS() float64 { + return c.globalRPS +} + +func (c testRateLimitConfig) GlobalBurst() int { + return c.globalBurst +} + +func (c testRateLimitConfig) PerSenderRPS() float64 { + return c.rps +} + +func (c testRateLimitConfig) PerSenderBurst() int { + return c.burst +} + +type testConfig struct { + supportedVersion int + receiverBufferSize int + rateLimit testRateLimitConfig +} + +func (c testConfig) SupportedVersion() int { + return c.supportedVersion +} + +func (c testConfig) ReceiverBufferSize() int { + return c.receiverBufferSize +} + +func (c testConfig) RateLimit() config.DispatcherRateLimit { + return c.rateLimit +} + func TestDispatcher_CleanStartClose(t *testing.T) { lggr := logger.TestLogger(t) ctx := testutils.Context(t) @@ -43,7 +86,17 @@ func TestDispatcher_CleanStartClose(t *testing.T) { signer := mocks.NewSigner(t) registry := commonMocks.NewCapabilitiesRegistry(t) - dispatcher := remote.NewDispatcher(wrapper, signer, registry, lggr) + dispatcher, err := remote.NewDispatcher(testConfig{ + supportedVersion: 1, + receiverBufferSize: 10000, + rateLimit: testRateLimitConfig{ + globalRPS: 800.0, + globalBurst: 100, + rps: 10.0, + burst: 50, + }, + }, wrapper, signer, registry, lggr) + require.NoError(t, err) require.NoError(t, dispatcher.Start(ctx)) require.NoError(t, dispatcher.Close()) } @@ -64,11 +117,21 @@ func TestDispatcher_Receive(t *testing.T) { signer.On("Sign", mock.Anything).Return(nil, errors.New("not implemented")) registry := commonMocks.NewCapabilitiesRegistry(t) - dispatcher := remote.NewDispatcher(wrapper, signer, registry, lggr) + dispatcher, err := remote.NewDispatcher(testConfig{ + supportedVersion: 1, + receiverBufferSize: 10000, + rateLimit: testRateLimitConfig{ + globalRPS: 800.0, + globalBurst: 100, + rps: 10.0, + burst: 50, + }, + }, wrapper, signer, registry, lggr) + require.NoError(t, err) require.NoError(t, dispatcher.Start(ctx)) rcv := newReceiver() - err := dispatcher.SetReceiver(capId1, donId1, rcv) + err = dispatcher.SetReceiver(capId1, donId1, rcv) require.NoError(t, err) // supported capability @@ -112,7 +175,17 @@ func TestDispatcher_RespondWithError(t *testing.T) { signer.On("Sign", mock.Anything).Return([]byte{}, nil) registry := commonMocks.NewCapabilitiesRegistry(t) - dispatcher := remote.NewDispatcher(wrapper, signer, registry, lggr) + dispatcher, err := remote.NewDispatcher(testConfig{ + supportedVersion: 1, + receiverBufferSize: 10000, + rateLimit: testRateLimitConfig{ + globalRPS: 800.0, + globalBurst: 100, + rps: 10.0, + burst: 50, + }, + }, wrapper, signer, registry, lggr) + require.NoError(t, err) require.NoError(t, dispatcher.Start(ctx)) // unknown capability diff --git a/core/capabilities/remote/message_cache.go b/core/capabilities/remote/message_cache.go index 27f909c5165..f3a3a79b2c6 100644 --- a/core/capabilities/remote/message_cache.go +++ b/core/capabilities/remote/message_cache.go @@ -60,12 +60,12 @@ func (c *messageCache[EventID, PeerID]) Ready(eventID EventID, minCount uint32, if msg.timestamp >= minTimestamp { countAboveMinTimestamp++ accPayloads = append(accPayloads, msg.payload) - if countAboveMinTimestamp >= minCount { - ev.wasReady = true - return true, accPayloads - } } } + if countAboveMinTimestamp >= minCount { + ev.wasReady = true + return true, accPayloads + } return false, nil } diff --git a/core/capabilities/remote/target/client.go b/core/capabilities/remote/target/client.go index dbb7c2f8bd8..64dcbd14f01 100644 --- a/core/capabilities/remote/target/client.go +++ b/core/capabilities/remote/target/client.go @@ -9,8 +9,10 @@ import ( commoncap "github.com/smartcontractkit/chainlink-common/pkg/capabilities" "github.com/smartcontractkit/chainlink-common/pkg/services" + "github.com/smartcontractkit/chainlink/v2/core/capabilities/remote" "github.com/smartcontractkit/chainlink/v2/core/capabilities/remote/target/request" "github.com/smartcontractkit/chainlink/v2/core/capabilities/remote/types" + "github.com/smartcontractkit/chainlink/v2/core/capabilities/validation" "github.com/smartcontractkit/chainlink/v2/core/logger" ) @@ -42,7 +44,7 @@ var _ services.Service = &client{} func NewClient(remoteCapabilityInfo commoncap.CapabilityInfo, localDonInfo commoncap.DON, dispatcher types.Dispatcher, requestTimeout time.Duration, lggr logger.Logger) *client { return &client{ - lggr: lggr, + lggr: lggr.Named("TargetClient"), remoteCapabilityInfo: remoteCapabilityInfo, localDONInfo: localDonInfo, dispatcher: dispatcher, @@ -121,7 +123,17 @@ func (c *client) UnregisterFromWorkflow(ctx context.Context, request commoncap.U return nil } -func (c *client) Execute(ctx context.Context, capReq commoncap.CapabilityRequest) (<-chan commoncap.CapabilityResponse, error) { +func (c *client) Execute(ctx context.Context, capReq commoncap.CapabilityRequest) (commoncap.CapabilityResponse, error) { + req, err := c.executeRequest(ctx, capReq) + if err != nil { + return commoncap.CapabilityResponse{}, fmt.Errorf("failed to execute request: %w", err) + } + + resp := <-req.ResponseChan() + return resp.CapabilityResponse, resp.Err +} + +func (c *client) executeRequest(ctx context.Context, capReq commoncap.CapabilityRequest) (*request.ClientRequest, error) { c.mutex.Lock() defer c.mutex.Unlock() @@ -130,6 +142,8 @@ func (c *client) Execute(ctx context.Context, capReq commoncap.CapabilityRequest return nil, fmt.Errorf("failed to get message ID for request: %w", err) } + c.lggr.Debugw("executing remote target", "messageID", messageID) + if _, ok := c.messageIDToCallerRequest[messageID]; ok { return nil, fmt.Errorf("request for message ID %s already exists", messageID) } @@ -141,15 +155,20 @@ func (c *client) Execute(ctx context.Context, capReq commoncap.CapabilityRequest } c.messageIDToCallerRequest[messageID] = req - - return req.ResponseChan(), nil + return req, nil } func (c *client) Receive(ctx context.Context, msg *types.MessageBody) { c.mutex.Lock() defer c.mutex.Unlock() - messageID := GetMessageID(msg) + messageID, err := GetMessageID(msg) + if err != nil { + c.lggr.Errorw("invalid message ID", "err", err, "id", remote.SanitizeLogString(string(msg.MessageId))) + return + } + + c.lggr.Debugw("Remote client target receiving message", "messageID", messageID) req := c.messageIDToCallerRequest[messageID] if req == nil { @@ -163,8 +182,12 @@ func (c *client) Receive(ctx context.Context, msg *types.MessageBody) { } func GetMessageIDForRequest(req commoncap.CapabilityRequest) (string, error) { - if req.Metadata.WorkflowID == "" || req.Metadata.WorkflowExecutionID == "" { - return "", errors.New("workflow ID and workflow execution ID must be set in request metadata") + if err := validation.ValidateWorkflowOrExecutionID(req.Metadata.WorkflowID); err != nil { + return "", fmt.Errorf("workflow ID is invalid: %w", err) + } + + if err := validation.ValidateWorkflowOrExecutionID(req.Metadata.WorkflowExecutionID); err != nil { + return "", fmt.Errorf("workflow execution ID is invalid: %w", err) } return req.Metadata.WorkflowID + req.Metadata.WorkflowExecutionID, nil diff --git a/core/capabilities/remote/target/client_test.go b/core/capabilities/remote/target/client_test.go index 6d26b51b8ae..697cb6e383a 100644 --- a/core/capabilities/remote/target/client_test.go +++ b/core/capabilities/remote/target/client_test.go @@ -21,6 +21,11 @@ import ( p2ptypes "github.com/smartcontractkit/chainlink/v2/core/services/p2p/types" ) +const ( + workflowID1 = "15c631d295ef5e32deb99a10ee6804bc4af13855687559d7ff6552ac6dbb2ce0" + workflowExecutionID1 = "95ef5e32deb99a10ee6804bc4af13855687559d7ff6552ac6dbb2ce0abbadeed" +) + func Test_Client_DonTopologies(t *testing.T) { ctx := testutils.Context(t) @@ -30,9 +35,8 @@ func Test_Client_DonTopologies(t *testing.T) { }) require.NoError(t, err) - responseTest := func(t *testing.T, responseCh <-chan commoncap.CapabilityResponse, responseError error) { + responseTest := func(t *testing.T, response commoncap.CapabilityResponse, responseError error) { require.NoError(t, responseError) - response := <-responseCh mp, err := response.Value.Unwrap() require.NoError(t, err) assert.Equal(t, "aValue1", mp.(map[string]any)["response"].(string)) @@ -61,9 +65,8 @@ func Test_Client_DonTopologies(t *testing.T) { func Test_Client_TransmissionSchedules(t *testing.T) { ctx := testutils.Context(t) - responseTest := func(t *testing.T, responseCh <-chan commoncap.CapabilityResponse, responseError error) { + responseTest := func(t *testing.T, response commoncap.CapabilityResponse, responseError error) { require.NoError(t, responseError) - response := <-responseCh mp, err := response.Value.Unwrap() require.NoError(t, err) assert.Equal(t, "aValue1", mp.(map[string]any)["response"].(string)) @@ -99,10 +102,8 @@ func Test_Client_TransmissionSchedules(t *testing.T) { func Test_Client_TimesOutIfInsufficientCapabilityPeerResponses(t *testing.T) { ctx := testutils.Context(t) - responseTest := func(t *testing.T, responseCh <-chan commoncap.CapabilityResponse, responseError error) { - require.NoError(t, responseError) - response := <-responseCh - assert.NotNil(t, response.Err) + responseTest := func(t *testing.T, response commoncap.CapabilityResponse, responseError error) { + assert.NotNil(t, responseError) } capability := &TestCapability{} @@ -121,7 +122,7 @@ func Test_Client_TimesOutIfInsufficientCapabilityPeerResponses(t *testing.T) { func testClient(ctx context.Context, t *testing.T, numWorkflowPeers int, workflowNodeResponseTimeout time.Duration, numCapabilityPeers int, capabilityDonF uint8, underlying commoncap.TargetCapability, transmissionSchedule *values.Map, - responseTest func(t *testing.T, responseCh <-chan commoncap.CapabilityResponse, responseError error)) { + responseTest func(t *testing.T, responseCh commoncap.CapabilityResponse, responseError error)) { lggr := logger.TestLogger(t) capabilityPeers := make([]p2ptypes.PeerID, numCapabilityPeers) @@ -192,8 +193,8 @@ func testClient(ctx context.Context, t *testing.T, numWorkflowPeers int, workflo responseCh, err := caller.Execute(ctx, commoncap.CapabilityRequest{ Metadata: commoncap.RequestMetadata{ - WorkflowID: "workflowID", - WorkflowExecutionID: "workflowExecutionID", + WorkflowID: workflowID1, + WorkflowExecutionID: workflowExecutionID1, }, Config: transmissionSchedule, Inputs: executeInputs, @@ -234,7 +235,10 @@ func (t *clientTestServer) Receive(_ context.Context, msg *remotetypes.MessageBo defer t.mux.Unlock() sender := toPeerID(msg.Sender) - messageID := target.GetMessageID(msg) + messageID, err := target.GetMessageID(msg) + if err != nil { + panic(err) + } if t.messageIDToSenders[messageID] == nil { t.messageIDToSenders[messageID] = make(map[p2ptypes.PeerID]bool) @@ -253,8 +257,7 @@ func (t *clientTestServer) Receive(_ context.Context, msg *remotetypes.MessageBo panic(err) } - respCh, responseErr := t.targetCapability.Execute(context.Background(), capabilityRequest) - resp := <-respCh + resp, responseErr := t.targetCapability.Execute(context.Background(), capabilityRequest) for receiver := range t.messageIDToSenders[messageID] { var responseMsg = &remotetypes.MessageBody{ diff --git a/core/capabilities/remote/target/endtoend_test.go b/core/capabilities/remote/target/endtoend_test.go index c01b8d99a4f..3b077bbafe0 100644 --- a/core/capabilities/remote/target/endtoend_test.go +++ b/core/capabilities/remote/target/endtoend_test.go @@ -29,10 +29,8 @@ import ( func Test_RemoteTargetCapability_InsufficientCapabilityResponses(t *testing.T) { ctx := testutils.Context(t) - responseTest := func(t *testing.T, responseCh <-chan commoncap.CapabilityResponse, responseError error) { - require.NoError(t, responseError) - response := <-responseCh - assert.NotNil(t, response.Err) + responseTest := func(t *testing.T, responseCh commoncap.CapabilityResponse, responseError error) { + assert.NotNil(t, responseError) } capability := &TestCapability{} @@ -49,10 +47,8 @@ func Test_RemoteTargetCapability_InsufficientCapabilityResponses(t *testing.T) { func Test_RemoteTargetCapability_InsufficientWorkflowRequests(t *testing.T) { ctx := testutils.Context(t) - responseTest := func(t *testing.T, responseCh <-chan commoncap.CapabilityResponse, responseError error) { - require.NoError(t, responseError) - response := <-responseCh - assert.NotNil(t, response.Err) + responseTest := func(t *testing.T, responseCh commoncap.CapabilityResponse, responseError error) { + assert.NotNil(t, responseError) } timeOut := 10 * time.Minute @@ -71,9 +67,8 @@ func Test_RemoteTargetCapability_InsufficientWorkflowRequests(t *testing.T) { func Test_RemoteTargetCapability_TransmissionSchedules(t *testing.T) { ctx := testutils.Context(t) - responseTest := func(t *testing.T, responseCh <-chan commoncap.CapabilityResponse, responseError error) { + responseTest := func(t *testing.T, response commoncap.CapabilityResponse, responseError error) { require.NoError(t, responseError) - response := <-responseCh mp, err := response.Value.Unwrap() require.NoError(t, err) assert.Equal(t, "aValue1", mp.(map[string]any)["response"].(string)) @@ -103,9 +98,8 @@ func Test_RemoteTargetCapability_TransmissionSchedules(t *testing.T) { func Test_RemoteTargetCapability_DonTopologies(t *testing.T) { ctx := testutils.Context(t) - responseTest := func(t *testing.T, responseCh <-chan commoncap.CapabilityResponse, responseError error) { + responseTest := func(t *testing.T, response commoncap.CapabilityResponse, responseError error) { require.NoError(t, responseError) - response := <-responseCh mp, err := response.Value.Unwrap() require.NoError(t, err) assert.Equal(t, "aValue1", mp.(map[string]any)["response"].(string)) @@ -138,10 +132,8 @@ func Test_RemoteTargetCapability_DonTopologies(t *testing.T) { func Test_RemoteTargetCapability_CapabilityError(t *testing.T) { ctx := testutils.Context(t) - responseTest := func(t *testing.T, responseCh <-chan commoncap.CapabilityResponse, responseError error) { - require.NoError(t, responseError) - response := <-responseCh - assert.Equal(t, "failed to execute capability: an error", response.Err.Error()) + responseTest := func(t *testing.T, responseCh commoncap.CapabilityResponse, responseError error) { + assert.Equal(t, "failed to execute capability: an error", responseError.Error()) } capability := &TestErrorCapability{} @@ -158,10 +150,8 @@ func Test_RemoteTargetCapability_CapabilityError(t *testing.T) { func Test_RemoteTargetCapability_RandomCapabilityError(t *testing.T) { ctx := testutils.Context(t) - responseTest := func(t *testing.T, responseCh <-chan commoncap.CapabilityResponse, responseError error) { - require.NoError(t, responseError) - response := <-responseCh - assert.Equal(t, "request expired", response.Err.Error()) + responseTest := func(t *testing.T, response commoncap.CapabilityResponse, responseError error) { + assert.Equal(t, "request expired", responseError.Error()) } capability := &TestRandomErrorCapability{} @@ -177,7 +167,7 @@ func Test_RemoteTargetCapability_RandomCapabilityError(t *testing.T) { func testRemoteTarget(ctx context.Context, t *testing.T, underlying commoncap.TargetCapability, numWorkflowPeers int, workflowDonF uint8, workflowNodeTimeout time.Duration, numCapabilityPeers int, capabilityDonF uint8, capabilityNodeResponseTimeout time.Duration, transmissionSchedule *values.Map, - responseTest func(t *testing.T, responseCh <-chan commoncap.CapabilityResponse, responseError error)) { + responseTest func(t *testing.T, response commoncap.CapabilityResponse, responseError error)) { lggr := logger.TestLogger(t) capabilityPeers := make([]p2ptypes.PeerID, numCapabilityPeers) @@ -226,7 +216,7 @@ func testRemoteTarget(ctx context.Context, t *testing.T, underlying commoncap.Ta for i := 0; i < numCapabilityPeers; i++ { capabilityPeer := capabilityPeers[i] capabilityDispatcher := broker.NewDispatcherForNode(capabilityPeer) - capabilityNode := target.NewServer(capabilityPeer, underlying, capInfo, capDonInfo, workflowDONs, capabilityDispatcher, + capabilityNode := target.NewServer(&commoncap.RemoteTargetConfig{RequestHashExcludedAttributes: []string{}}, capabilityPeer, underlying, capInfo, capDonInfo, workflowDONs, capabilityDispatcher, capabilityNodeResponseTimeout, lggr) servicetest.Run(t, capabilityNode) broker.RegisterReceiverNode(capabilityPeer, capabilityNode) @@ -258,17 +248,17 @@ func testRemoteTarget(ctx context.Context, t *testing.T, underlying commoncap.Ta for _, caller := range workflowNodes { go func(caller commoncap.TargetCapability) { defer wg.Done() - responseCh, err := caller.Execute(ctx, + response, err := caller.Execute(ctx, commoncap.CapabilityRequest{ Metadata: commoncap.RequestMetadata{ - WorkflowID: "workflowID", - WorkflowExecutionID: "workflowExecutionID", + WorkflowID: workflowID1, + WorkflowExecutionID: workflowExecutionID1, }, Config: transmissionSchedule, Inputs: executeInputs, }) - responseTest(t, responseCh, err) + responseTest(t, response, err) }(caller) } @@ -276,67 +266,47 @@ func testRemoteTarget(ctx context.Context, t *testing.T, underlying commoncap.Ta } type testAsyncMessageBroker struct { - services.StateMachine - t *testing.T + services.Service + eng *services.Engine + t *testing.T nodes map[p2ptypes.PeerID]remotetypes.Receiver sendCh chan *remotetypes.MessageBody - - stopCh services.StopChan - wg sync.WaitGroup -} - -func (a *testAsyncMessageBroker) HealthReport() map[string]error { - return nil -} - -func (a *testAsyncMessageBroker) Name() string { - return "testAsyncMessageBroker" } func newTestAsyncMessageBroker(t *testing.T, sendChBufferSize int) *testAsyncMessageBroker { - return &testAsyncMessageBroker{ + b := &testAsyncMessageBroker{ t: t, nodes: make(map[p2ptypes.PeerID]remotetypes.Receiver), - stopCh: make(services.StopChan), sendCh: make(chan *remotetypes.MessageBody, sendChBufferSize), } -} - -func (a *testAsyncMessageBroker) Start(ctx context.Context) error { - return a.StartOnce("testAsyncMessageBroker", func() error { - a.wg.Add(1) - go func() { - defer a.wg.Done() - - for { - select { - case <-a.stopCh: - return - case msg := <-a.sendCh: - receiverId := toPeerID(msg.Receiver) - - receiver, ok := a.nodes[receiverId] - if !ok { - panic("server not found for peer id") - } - - receiver.Receive(tests.Context(a.t), msg) + b.Service, b.eng = services.Config{ + Name: "testAsyncMessageBroker", + Start: b.start, + }.NewServiceEngine(logger.TestLogger(t)) + return b +} + +func (a *testAsyncMessageBroker) start(ctx context.Context) error { + a.eng.Go(func(ctx context.Context) { + for { + select { + case <-ctx.Done(): + return + case msg := <-a.sendCh: + receiverId := toPeerID(msg.Receiver) + + receiver, ok := a.nodes[receiverId] + if !ok { + panic("server not found for peer id") } - } - }() - return nil - }) -} -func (a *testAsyncMessageBroker) Close() error { - return a.StopOnce("testAsyncMessageBroker", func() error { - close(a.stopCh) - - a.wg.Wait() - return nil + receiver.Receive(tests.Context(a.t), msg) + } + } }) + return nil } func (a *testAsyncMessageBroker) NewDispatcherForNode(nodePeerID p2ptypes.PeerID) remotetypes.Dispatcher { @@ -371,6 +341,26 @@ type nodeDispatcher struct { broker broker } +func (t *nodeDispatcher) Name() string { + return "nodeDispatcher" +} + +func (t *nodeDispatcher) Start(ctx context.Context) error { + return nil +} + +func (t *nodeDispatcher) Close() error { + return nil +} + +func (t *nodeDispatcher) Ready() error { + return nil +} + +func (t *nodeDispatcher) HealthReport() map[string]error { + return nil +} + func (t *nodeDispatcher) Send(peerID p2ptypes.PeerID, msgBody *remotetypes.MessageBody) error { msgBody.Version = 1 msgBody.Sender = t.callerPeerID[:] @@ -404,36 +394,31 @@ type TestCapability struct { abstractTestCapability } -func (t TestCapability) Execute(ctx context.Context, request commoncap.CapabilityRequest) (<-chan commoncap.CapabilityResponse, error) { - ch := make(chan commoncap.CapabilityResponse, 1) - +func (t TestCapability) Execute(ctx context.Context, request commoncap.CapabilityRequest) (commoncap.CapabilityResponse, error) { value := request.Inputs.Underlying["executeValue1"] - response, err := values.NewMap(map[string]any{"response": value}) if err != nil { - return nil, err + return commoncap.CapabilityResponse{}, err } - ch <- commoncap.CapabilityResponse{ + return commoncap.CapabilityResponse{ Value: response, - } - - return ch, nil + }, nil } type TestErrorCapability struct { abstractTestCapability } -func (t TestErrorCapability) Execute(ctx context.Context, request commoncap.CapabilityRequest) (<-chan commoncap.CapabilityResponse, error) { - return nil, errors.New("an error") +func (t TestErrorCapability) Execute(ctx context.Context, request commoncap.CapabilityRequest) (commoncap.CapabilityResponse, error) { + return commoncap.CapabilityResponse{}, errors.New("an error") } type TestRandomErrorCapability struct { abstractTestCapability } -func (t TestRandomErrorCapability) Execute(ctx context.Context, request commoncap.CapabilityRequest) (<-chan commoncap.CapabilityResponse, error) { - return nil, errors.New(uuid.New().String()) +func (t TestRandomErrorCapability) Execute(ctx context.Context, request commoncap.CapabilityRequest) (commoncap.CapabilityResponse, error) { + return commoncap.CapabilityResponse{}, errors.New(uuid.New().String()) } func NewP2PPeerID(t *testing.T) p2ptypes.PeerID { diff --git a/core/capabilities/remote/target/request/client_request.go b/core/capabilities/remote/target/request/client_request.go index b48aa28207a..1a0d707146b 100644 --- a/core/capabilities/remote/target/request/client_request.go +++ b/core/capabilities/remote/target/request/client_request.go @@ -8,6 +8,8 @@ import ( "sync" "time" + "google.golang.org/protobuf/proto" + ragep2ptypes "github.com/smartcontractkit/libocr/ragep2p/types" "github.com/smartcontractkit/chainlink-common/pkg/capabilities" @@ -20,13 +22,19 @@ import ( p2ptypes "github.com/smartcontractkit/chainlink/v2/core/services/p2p/types" ) +type asyncCapabilityResponse struct { + capabilities.CapabilityResponse + Err error +} + type ClientRequest struct { cancelFn context.CancelFunc - responseCh chan commoncap.CapabilityResponse + responseCh chan asyncCapabilityResponse createdAt time.Time responseIDCount map[[32]byte]int errorCount map[string]int responseReceived map[p2ptypes.PeerID]bool + lggr logger.Logger requiredIdenticalResponses int @@ -45,7 +53,8 @@ func NewClientRequest(ctx context.Context, lggr logger.Logger, req commoncap.Cap return nil, errors.New("remote capability info missing DON") } - rawRequest, err := pb.MarshalCapabilityRequest(req) + rawRequest, err := proto.MarshalOptions{Deterministic: true}.Marshal(pb.CapabilityRequestToProto(req)) + if err != nil { return nil, fmt.Errorf("failed to marshal capability request: %w", err) } @@ -97,12 +106,13 @@ func NewClientRequest(ctx context.Context, lggr logger.Logger, req commoncap.Cap responseIDCount: make(map[[32]byte]int), errorCount: make(map[string]int), responseReceived: responseReceived, - responseCh: make(chan commoncap.CapabilityResponse, 1), + responseCh: make(chan asyncCapabilityResponse, 1), wg: wg, + lggr: lggr, }, nil } -func (c *ClientRequest) ResponseChan() <-chan commoncap.CapabilityResponse { +func (c *ClientRequest) ResponseChan() <-chan asyncCapabilityResponse { return c.responseCh } @@ -116,20 +126,28 @@ func (c *ClientRequest) Cancel(err error) { c.mux.Lock() defer c.mux.Unlock() if !c.respSent { - c.sendResponse(commoncap.CapabilityResponse{Err: err}) + c.sendResponse(asyncCapabilityResponse{Err: err}) } } -// TODO OnMessage assumes that only one response is received from each peer, if streaming responses need to be supported this will need to be updated func (c *ClientRequest) OnMessage(_ context.Context, msg *types.MessageBody) error { c.mux.Lock() defer c.mux.Unlock() + if c.respSent { + return nil + } + if msg.Sender == nil { return fmt.Errorf("sender missing from message") } - sender := remote.ToPeerID(msg.Sender) + c.lggr.Debugw("OnMessage called for client request", "messageID", msg.MessageId) + + sender, err := remote.ToPeerID(msg.Sender) + if err != nil { + return fmt.Errorf("failed to convert message sender to PeerID: %w", err) + } received, expected := c.responseReceived[sender] if !expected { @@ -146,24 +164,29 @@ func (c *ClientRequest) OnMessage(_ context.Context, msg *types.MessageBody) err responseID := sha256.Sum256(msg.Payload) c.responseIDCount[responseID]++ + if len(c.responseIDCount) > 1 { + c.lggr.Warn("received multiple different responses for the same request, number of different responses received: %d", len(c.responseIDCount)) + } + if c.responseIDCount[responseID] == c.requiredIdenticalResponses { capabilityResponse, err := pb.UnmarshalCapabilityResponse(msg.Payload) if err != nil { - c.sendResponse(commoncap.CapabilityResponse{Err: fmt.Errorf("failed to unmarshal capability response: %w", err)}) + c.sendResponse(asyncCapabilityResponse{Err: fmt.Errorf("failed to unmarshal capability response: %w", err)}) } else { - c.sendResponse(commoncap.CapabilityResponse{Value: capabilityResponse.Value}) + c.sendResponse(asyncCapabilityResponse{CapabilityResponse: commoncap.CapabilityResponse{Value: capabilityResponse.Value}}) } } } else { + c.lggr.Warnw("received error response", "error", remote.SanitizeLogString(msg.ErrorMsg)) c.errorCount[msg.ErrorMsg]++ if c.errorCount[msg.ErrorMsg] == c.requiredIdenticalResponses { - c.sendResponse(commoncap.CapabilityResponse{Err: errors.New(msg.ErrorMsg)}) + c.sendResponse(asyncCapabilityResponse{Err: errors.New(msg.ErrorMsg)}) } } return nil } -func (c *ClientRequest) sendResponse(response commoncap.CapabilityResponse) { +func (c *ClientRequest) sendResponse(response asyncCapabilityResponse) { c.responseCh <- response close(c.responseCh) c.respSent = true diff --git a/core/capabilities/remote/target/request/client_request_test.go b/core/capabilities/remote/target/request/client_request_test.go index c20c24a5508..095c73e8ad9 100644 --- a/core/capabilities/remote/target/request/client_request_test.go +++ b/core/capabilities/remote/target/request/client_request_test.go @@ -20,6 +20,11 @@ import ( p2ptypes "github.com/smartcontractkit/chainlink/v2/core/services/p2p/types" ) +const ( + workflowID1 = "15c631d295ef5e32deb99a10ee6804bc4af13855687559d7ff6552ac6dbb2ce0" + workflowExecutionID1 = "95ef5e32deb99a10ee6804bc4af13855687559d7ff6552ac6dbb2ce0abbadeed" +) + func Test_ClientRequest_MessageValidation(t *testing.T) { lggr := logger.TestLogger(t) @@ -68,8 +73,8 @@ func Test_ClientRequest_MessageValidation(t *testing.T) { capabilityRequest := commoncap.CapabilityRequest{ Metadata: commoncap.RequestMetadata{ - WorkflowID: "workflowID", - WorkflowExecutionID: "workflowExecutionID", + WorkflowID: workflowID1, + WorkflowExecutionID: workflowExecutionID1, }, Inputs: executeInputs, Config: transmissionSchedule, @@ -79,7 +84,6 @@ func Test_ClientRequest_MessageValidation(t *testing.T) { require.NoError(t, err) capabilityResponse := commoncap.CapabilityResponse{ Value: m, - Err: nil, } rawResponse, err := pb.MarshalCapabilityResponse(capabilityResponse) @@ -112,7 +116,6 @@ func Test_ClientRequest_MessageValidation(t *testing.T) { require.NoError(t, err) capabilityResponse2 := commoncap.CapabilityResponse{ Value: nm, - Err: nil, } rawResponse2, err := pb.MarshalCapabilityResponse(capabilityResponse2) @@ -311,6 +314,26 @@ type clientRequestTestDispatcher struct { msgs chan *types.MessageBody } +func (t *clientRequestTestDispatcher) Name() string { + return "clientRequestTestDispatcher" +} + +func (t *clientRequestTestDispatcher) Start(ctx context.Context) error { + return nil +} + +func (t *clientRequestTestDispatcher) Close() error { + return nil +} + +func (t *clientRequestTestDispatcher) Ready() error { + return nil +} + +func (t *clientRequestTestDispatcher) HealthReport() map[string]error { + return nil +} + func (t *clientRequestTestDispatcher) SetReceiver(capabilityId string, donId uint32, receiver types.Receiver) error { return nil } diff --git a/core/capabilities/remote/target/request/server_request.go b/core/capabilities/remote/target/request/server_request.go index 25d88d2192a..d23ba93a44d 100644 --- a/core/capabilities/remote/target/request/server_request.go +++ b/core/capabilities/remote/target/request/server_request.go @@ -62,7 +62,7 @@ func NewServerRequest(capability capabilities.TargetCapability, capabilityID str callingDon: callingDon, requestMessageID: requestMessageID, requestTimeout: requestTimeout, - lggr: lggr, + lggr: lggr.Named("ServerRequest"), } } @@ -74,11 +74,16 @@ func (e *ServerRequest) OnMessage(ctx context.Context, msg *types.MessageBody) e return fmt.Errorf("sender missing from message") } - requester := remote.ToPeerID(msg.Sender) + requester, err := remote.ToPeerID(msg.Sender) + if err != nil { + return fmt.Errorf("failed to convert message sender to PeerID: %w", err) + } + if err := e.addRequester(requester); err != nil { return fmt.Errorf("failed to add requester to request: %w", err) } + e.lggr.Debugw("OnMessage called for request", "msgId", msg.MessageId, "calls", len(e.requesters), "hasResponse", e.response != nil) if e.minimumRequiredRequestsReceived() && !e.hasResponse() { if err := e.executeRequest(ctx, msg.Payload); err != nil { e.setError(types.Error_INTERNAL_ERROR, err.Error()) @@ -100,13 +105,11 @@ func (e *ServerRequest) Cancel(err types.Error, msg string) error { e.mux.Lock() defer e.mux.Unlock() - if e.hasResponse() { - return fmt.Errorf("request already has response") - } - - e.setError(err, msg) - if err := e.sendResponses(); err != nil { - return fmt.Errorf("failed to send responses: %w", err) + if !e.hasResponse() { + e.setError(err, msg) + if err := e.sendResponses(); err != nil { + return fmt.Errorf("failed to send responses: %w", err) + } } return nil @@ -122,20 +125,19 @@ func (e *ServerRequest) executeRequest(ctx context.Context, payload []byte) erro } e.lggr.Debugw("executing capability", "metadata", capabilityRequest.Metadata) - capResponseCh, err := e.capability.Execute(ctxWithTimeout, capabilityRequest) + capResponse, err := e.capability.Execute(ctxWithTimeout, capabilityRequest) if err != nil { + e.lggr.Debugw("received execution error", "workflowExecutionID", capabilityRequest.Metadata.WorkflowExecutionID, "error", err) return fmt.Errorf("failed to execute capability: %w", err) } - // NOTE working on the assumption that the capability will only ever return one response from its channel - capResponse := <-capResponseCh responsePayload, err := pb.MarshalCapabilityResponse(capResponse) if err != nil { return fmt.Errorf("failed to marshal capability response: %w", err) } - e.lggr.Debugw("received execution results", "metadata", capabilityRequest.Metadata, "error", capResponse.Err) + e.lggr.Debugw("received execution results", "workflowExecutionID", capabilityRequest.Metadata.WorkflowExecutionID) e.setResult(responsePayload) return nil } @@ -216,7 +218,7 @@ func (e *ServerRequest) sendResponse(requester p2ptypes.PeerID) error { responseMsg.Payload = e.response.response } - e.lggr.Debugw("Sending response", "receiver", requester) + e.lggr.Debugw("Sending response", "receiver", requester, "msgId", e.requestMessageID) if err := e.dispatcher.Send(requester, &responseMsg); err != nil { return fmt.Errorf("failed to send response to dispatcher: %w", err) } diff --git a/core/capabilities/remote/target/request/server_request_test.go b/core/capabilities/remote/target/request/server_request_test.go index 053cba7064d..619142d0a6f 100644 --- a/core/capabilities/remote/target/request/server_request_test.go +++ b/core/capabilities/remote/target/request/server_request_test.go @@ -190,6 +190,26 @@ type testDispatcher struct { msgs []*types.MessageBody } +func (t *testDispatcher) Name() string { + return "testDispatcher" +} + +func (t *testDispatcher) Start(ctx context.Context) error { + return nil +} + +func (t *testDispatcher) Close() error { + return nil +} + +func (t *testDispatcher) Ready() error { + return nil +} + +func (t *testDispatcher) HealthReport() map[string]error { + return nil +} + func (t *testDispatcher) SetReceiver(capabilityId string, donId uint32, receiver types.Receiver) error { return nil } @@ -220,28 +240,25 @@ type TestCapability struct { abstractTestCapability } -func (t TestCapability) Execute(ctx context.Context, request commoncap.CapabilityRequest) (<-chan commoncap.CapabilityResponse, error) { - ch := make(chan commoncap.CapabilityResponse, 1) - +func (t TestCapability) Execute(ctx context.Context, request commoncap.CapabilityRequest) (commoncap.CapabilityResponse, error) { value := request.Inputs.Underlying["executeValue1"] response, err := values.NewMap(map[string]any{"response": value}) if err != nil { - return nil, err - } - ch <- commoncap.CapabilityResponse{ - Value: response, + return commoncap.CapabilityResponse{}, err } - return ch, nil + return commoncap.CapabilityResponse{ + Value: response, + }, nil } type TestErrorCapability struct { abstractTestCapability } -func (t TestErrorCapability) Execute(ctx context.Context, request commoncap.CapabilityRequest) (<-chan commoncap.CapabilityResponse, error) { - return nil, errors.New("an error") +func (t TestErrorCapability) Execute(ctx context.Context, request commoncap.CapabilityRequest) (commoncap.CapabilityResponse, error) { + return commoncap.CapabilityResponse{}, errors.New("an error") } func NewP2PPeerID(t *testing.T) p2ptypes.PeerID { diff --git a/core/capabilities/remote/target/server.go b/core/capabilities/remote/target/server.go index 1453cfc3778..5324475b192 100644 --- a/core/capabilities/remote/target/server.go +++ b/core/capabilities/remote/target/server.go @@ -4,13 +4,17 @@ import ( "context" "crypto/sha256" "encoding/hex" + "fmt" "sync" "time" commoncap "github.com/smartcontractkit/chainlink-common/pkg/capabilities" + "github.com/smartcontractkit/chainlink-common/pkg/capabilities/pb" "github.com/smartcontractkit/chainlink-common/pkg/services" + "github.com/smartcontractkit/chainlink/v2/core/capabilities/remote" "github.com/smartcontractkit/chainlink/v2/core/capabilities/remote/target/request" "github.com/smartcontractkit/chainlink/v2/core/capabilities/remote/types" + "github.com/smartcontractkit/chainlink/v2/core/capabilities/validation" p2ptypes "github.com/smartcontractkit/chainlink/v2/core/services/p2p/types" "github.com/smartcontractkit/chainlink/v2/core/logger" @@ -24,7 +28,9 @@ import ( // server communicates with corresponding client on remote nodes. type server struct { services.StateMachine - lggr logger.Logger + lggr logger.Logger + + config *commoncap.RemoteTargetConfig peerID p2ptypes.PeerID underlying commoncap.TargetCapability capInfo commoncap.CapabilityInfo @@ -32,9 +38,12 @@ type server struct { workflowDONs map[uint32]commoncap.DON dispatcher types.Dispatcher - requestIDToRequest map[string]*request.ServerRequest + requestIDToRequest map[string]requestAndMsgID requestTimeout time.Duration + // Used to detect messages with the same message id but different payloads + messageIDToRequestIDsCount map[string]map[string]int + receiveLock sync.Mutex stopCh services.StopChan wg sync.WaitGroup @@ -43,9 +52,19 @@ type server struct { var _ types.Receiver = &server{} var _ services.Service = &server{} -func NewServer(peerID p2ptypes.PeerID, underlying commoncap.TargetCapability, capInfo commoncap.CapabilityInfo, localDonInfo commoncap.DON, +type requestAndMsgID struct { + request *request.ServerRequest + messageID string +} + +func NewServer(config *commoncap.RemoteTargetConfig, peerID p2ptypes.PeerID, underlying commoncap.TargetCapability, capInfo commoncap.CapabilityInfo, localDonInfo commoncap.DON, workflowDONs map[uint32]commoncap.DON, dispatcher types.Dispatcher, requestTimeout time.Duration, lggr logger.Logger) *server { + if config == nil { + lggr.Info("no config provided, using default values") + config = &commoncap.RemoteTargetConfig{} + } return &server{ + config: config, underlying: underlying, peerID: peerID, capInfo: capInfo, @@ -53,10 +72,11 @@ func NewServer(peerID p2ptypes.PeerID, underlying commoncap.TargetCapability, ca workflowDONs: workflowDONs, dispatcher: dispatcher, - requestIDToRequest: map[string]*request.ServerRequest{}, - requestTimeout: requestTimeout, + requestIDToRequest: map[string]requestAndMsgID{}, + messageIDToRequestIDsCount: map[string]map[string]int{}, + requestTimeout: requestTimeout, - lggr: lggr, + lggr: lggr.Named("TargetServer"), stopCh: make(services.StopChan), } } @@ -96,12 +116,13 @@ func (r *server) expireRequests() { defer r.receiveLock.Unlock() for requestID, executeReq := range r.requestIDToRequest { - if executeReq.Expired() { - err := executeReq.Cancel(types.Error_TIMEOUT, "request expired") + if executeReq.request.Expired() { + err := executeReq.request.Cancel(types.Error_TIMEOUT, "request expired") if err != nil { r.lggr.Errorw("failed to cancel request", "request", executeReq, "err", err) } delete(r.requestIDToRequest, requestID) + delete(r.messageIDToRequestIDsCount, executeReq.messageID) } } } @@ -111,15 +132,40 @@ func (r *server) Receive(ctx context.Context, msg *types.MessageBody) { defer r.receiveLock.Unlock() if msg.Method != types.MethodExecute { - r.lggr.Errorw("received request for unsupported method type", "method", msg.Method) + r.lggr.Errorw("received request for unsupported method type", "method", remote.SanitizeLogString(msg.Method)) + return + } + + messageId, err := GetMessageID(msg) + if err != nil { + r.lggr.Errorw("invalid message id", "err", err, "id", remote.SanitizeLogString(string(msg.MessageId))) + return + } + + msgHash, err := r.getMessageHash(msg) + if err != nil { + r.lggr.Errorw("failed to get message hash", "err", err) return } // A request is uniquely identified by the message id and the hash of the payload to prevent a malicious // actor from sending a different payload with the same message id - messageId := GetMessageID(msg) - hash := sha256.Sum256(msg.Payload) - requestID := messageId + hex.EncodeToString(hash[:]) + requestID := messageId + hex.EncodeToString(msgHash[:]) + + r.lggr.Debugw("received request", "msgId", msg.MessageId, "requestID", requestID) + + if requestIDs, ok := r.messageIDToRequestIDsCount[messageId]; ok { + requestIDs[requestID] = requestIDs[requestID] + 1 + } else { + r.messageIDToRequestIDsCount[messageId] = map[string]int{requestID: 1} + } + + requestIDs := r.messageIDToRequestIDsCount[messageId] + if len(requestIDs) > 1 { + // This is a potential attack vector as well as a situation that will occur if the client is sending non-deterministic payloads + // so a warning is logged + r.lggr.Warnw("received messages with the same id and different payloads", "messageID", messageId, "lenRequestIDs", len(requestIDs)) + } if _, ok := r.requestIDToRequest[requestID]; !ok { callingDon, ok := r.workflowDONs[msg.CallerDonId] @@ -128,20 +174,47 @@ func (r *server) Receive(ctx context.Context, msg *types.MessageBody) { return } - r.requestIDToRequest[requestID] = request.NewServerRequest(r.underlying, r.capInfo.ID, r.localDonInfo.ID, r.peerID, - callingDon, messageId, r.dispatcher, r.requestTimeout, r.lggr) + r.requestIDToRequest[requestID] = requestAndMsgID{ + request: request.NewServerRequest(r.underlying, r.capInfo.ID, r.localDonInfo.ID, r.peerID, + callingDon, messageId, r.dispatcher, r.requestTimeout, r.lggr), + messageID: messageId, + } } - req := r.requestIDToRequest[requestID] + reqAndMsgID := r.requestIDToRequest[requestID] - err := req.OnMessage(ctx, msg) + err = reqAndMsgID.request.OnMessage(ctx, msg) if err != nil { - r.lggr.Errorw("request failed to OnMessage new message", "request", req, "err", err) + r.lggr.Errorw("request failed to OnMessage new message", "messageID", reqAndMsgID.messageID, "err", err) } } -func GetMessageID(msg *types.MessageBody) string { - return string(msg.MessageId) +func (r *server) getMessageHash(msg *types.MessageBody) ([32]byte, error) { + req, err := pb.UnmarshalCapabilityRequest(msg.Payload) + if err != nil { + return [32]byte{}, fmt.Errorf("failed to unmarshal capability request: %w", err) + } + + for _, path := range r.config.RequestHashExcludedAttributes { + if !req.Inputs.DeleteAtPath(path) { + return [32]byte{}, fmt.Errorf("failed to delete attribute from map at path: %s", path) + } + } + + reqBytes, err := pb.MarshalCapabilityRequest(req) + if err != nil { + return [32]byte{}, fmt.Errorf("failed to marshal capability request: %w", err) + } + hash := sha256.Sum256(reqBytes) + return hash, nil +} + +func GetMessageID(msg *types.MessageBody) (string, error) { + idStr := string(msg.MessageId) + if !validation.IsValidID(idStr) { + return "", fmt.Errorf("invalid message id") + } + return idStr, nil } func (r *server) Ready() error { diff --git a/core/capabilities/remote/target/server_test.go b/core/capabilities/remote/target/server_test.go index a5aa45efd06..505a2dcce5d 100644 --- a/core/capabilities/remote/target/server_test.go +++ b/core/capabilities/remote/target/server_test.go @@ -2,6 +2,7 @@ package target_test import ( "context" + "strconv" "testing" "time" @@ -11,6 +12,7 @@ import ( commoncap "github.com/smartcontractkit/chainlink-common/pkg/capabilities" "github.com/smartcontractkit/chainlink-common/pkg/capabilities/pb" "github.com/smartcontractkit/chainlink-common/pkg/services" + "github.com/smartcontractkit/chainlink-common/pkg/values" "github.com/smartcontractkit/chainlink/v2/core/capabilities/remote/target" remotetypes "github.com/smartcontractkit/chainlink/v2/core/capabilities/remote/types" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" @@ -18,19 +20,55 @@ import ( p2ptypes "github.com/smartcontractkit/chainlink/v2/core/services/p2p/types" ) +func Test_Server_ExcludesNonDeterministicInputAttributes(t *testing.T) { + ctx := testutils.Context(t) + + numCapabilityPeers := 4 + + callers, srvcs := testRemoteTargetServer(ctx, t, &commoncap.RemoteTargetConfig{RequestHashExcludedAttributes: []string{"signed_report.Signatures"}}, + &TestCapability{}, 10, 9, numCapabilityPeers, 3, 10*time.Minute) + + for idx, caller := range callers { + rawInputs := map[string]any{ + "signed_report": map[string]any{"Signatures": "sig" + strconv.Itoa(idx), "Price": 20}, + } + + inputs, err := values.NewMap(rawInputs) + require.NoError(t, err) + + _, err = caller.Execute(context.Background(), + commoncap.CapabilityRequest{ + Metadata: commoncap.RequestMetadata{ + WorkflowID: workflowID1, + WorkflowExecutionID: workflowExecutionID1, + }, + Inputs: inputs, + }) + require.NoError(t, err) + } + + for _, caller := range callers { + for i := 0; i < numCapabilityPeers; i++ { + msg := <-caller.receivedMessages + assert.Equal(t, remotetypes.Error_OK, msg.Error) + } + } + closeServices(t, srvcs) +} + func Test_Server_RespondsAfterSufficientRequests(t *testing.T) { ctx := testutils.Context(t) numCapabilityPeers := 4 - callers, srvcs := testRemoteTargetServer(ctx, t, &TestCapability{}, 10, 9, numCapabilityPeers, 3, 10*time.Minute) + callers, srvcs := testRemoteTargetServer(ctx, t, &commoncap.RemoteTargetConfig{}, &TestCapability{}, 10, 9, numCapabilityPeers, 3, 10*time.Minute) for _, caller := range callers { _, err := caller.Execute(context.Background(), commoncap.CapabilityRequest{ Metadata: commoncap.RequestMetadata{ - WorkflowID: "workflowID", - WorkflowExecutionID: "workflowExecutionID", + WorkflowID: workflowID1, + WorkflowExecutionID: workflowExecutionID1, }, }) require.NoError(t, err) @@ -50,14 +88,14 @@ func Test_Server_InsufficientCallers(t *testing.T) { numCapabilityPeers := 4 - callers, srvcs := testRemoteTargetServer(ctx, t, &TestCapability{}, 10, 10, numCapabilityPeers, 3, 100*time.Millisecond) + callers, srvcs := testRemoteTargetServer(ctx, t, &commoncap.RemoteTargetConfig{}, &TestCapability{}, 10, 10, numCapabilityPeers, 3, 100*time.Millisecond) for _, caller := range callers { _, err := caller.Execute(context.Background(), commoncap.CapabilityRequest{ Metadata: commoncap.RequestMetadata{ - WorkflowID: "workflowID", - WorkflowExecutionID: "workflowExecutionID", + WorkflowID: workflowID1, + WorkflowExecutionID: workflowExecutionID1, }, }) require.NoError(t, err) @@ -77,14 +115,14 @@ func Test_Server_CapabilityError(t *testing.T) { numCapabilityPeers := 4 - callers, srvcs := testRemoteTargetServer(ctx, t, &TestErrorCapability{}, 10, 9, numCapabilityPeers, 3, 100*time.Millisecond) + callers, srvcs := testRemoteTargetServer(ctx, t, &commoncap.RemoteTargetConfig{}, &TestErrorCapability{}, 10, 9, numCapabilityPeers, 3, 100*time.Millisecond) for _, caller := range callers { _, err := caller.Execute(context.Background(), commoncap.CapabilityRequest{ Metadata: commoncap.RequestMetadata{ - WorkflowID: "workflowID", - WorkflowExecutionID: "workflowExecutionID", + WorkflowID: workflowID1, + WorkflowExecutionID: workflowExecutionID1, }, }) require.NoError(t, err) @@ -100,6 +138,7 @@ func Test_Server_CapabilityError(t *testing.T) { } func testRemoteTargetServer(ctx context.Context, t *testing.T, + config *commoncap.RemoteTargetConfig, underlying commoncap.TargetCapability, numWorkflowPeers int, workflowDonF uint8, numCapabilityPeers int, capabilityDonF uint8, capabilityNodeResponseTimeout time.Duration) ([]*serverTestClient, []services.Service) { @@ -150,7 +189,7 @@ func testRemoteTargetServer(ctx context.Context, t *testing.T, for i := 0; i < numCapabilityPeers; i++ { capabilityPeer := capabilityPeers[i] capabilityDispatcher := broker.NewDispatcherForNode(capabilityPeer) - capabilityNode := target.NewServer(capabilityPeer, underlying, capInfo, capDonInfo, workflowDONs, capabilityDispatcher, + capabilityNode := target.NewServer(config, capabilityPeer, underlying, capInfo, capDonInfo, workflowDONs, capabilityDispatcher, capabilityNodeResponseTimeout, lggr) require.NoError(t, capabilityNode.Start(ctx)) broker.RegisterReceiverNode(capabilityPeer, capabilityNode) diff --git a/core/capabilities/remote/trigger_publisher.go b/core/capabilities/remote/trigger_publisher.go index 7744cfb55ee..e5a46c87914 100644 --- a/core/capabilities/remote/trigger_publisher.go +++ b/core/capabilities/remote/trigger_publisher.go @@ -2,14 +2,16 @@ package remote import ( "context" - sync "sync" + "crypto/sha256" + "encoding/binary" + "sync" "time" - "github.com/smartcontractkit/chainlink-common/pkg/capabilities" commoncap "github.com/smartcontractkit/chainlink-common/pkg/capabilities" "github.com/smartcontractkit/chainlink-common/pkg/capabilities/pb" "github.com/smartcontractkit/chainlink-common/pkg/services" "github.com/smartcontractkit/chainlink/v2/core/capabilities/remote/types" + "github.com/smartcontractkit/chainlink/v2/core/capabilities/validation" "github.com/smartcontractkit/chainlink/v2/core/logger" p2ptypes "github.com/smartcontractkit/chainlink/v2/core/services/p2p/types" ) @@ -21,18 +23,22 @@ import ( // // TriggerPublisher communicates with corresponding TriggerSubscribers on remote nodes. type triggerPublisher struct { - config *types.RemoteTriggerConfig - underlying commoncap.TriggerCapability - capInfo commoncap.CapabilityInfo - capDonInfo commoncap.DON - workflowDONs map[uint32]commoncap.DON - dispatcher types.Dispatcher - messageCache *messageCache[registrationKey, p2ptypes.PeerID] - registrations map[registrationKey]*pubRegState - mu sync.RWMutex // protects messageCache and registrations - stopCh services.StopChan - wg sync.WaitGroup - lggr logger.Logger + config *commoncap.RemoteTriggerConfig + underlying commoncap.TriggerCapability + capInfo commoncap.CapabilityInfo + capDonInfo commoncap.DON + workflowDONs map[uint32]commoncap.DON + membersCache map[uint32]map[p2ptypes.PeerID]bool + dispatcher types.Dispatcher + messageCache *messageCache[registrationKey, p2ptypes.PeerID] + registrations map[registrationKey]*pubRegState + mu sync.RWMutex // protects messageCache and registrations + batchingQueue map[[32]byte]*batchedResponse + batchingEnabled bool + bqMu sync.Mutex // protects batchingQueue + stopCh services.StopChan + wg sync.WaitGroup + lggr logger.Logger } type registrationKey struct { @@ -41,42 +47,74 @@ type registrationKey struct { } type pubRegState struct { - callback <-chan commoncap.CapabilityResponse - request commoncap.CapabilityRequest + callback <-chan commoncap.TriggerResponse + request commoncap.TriggerRegistrationRequest } -var _ types.Receiver = &triggerPublisher{} -var _ services.Service = &triggerPublisher{} +type batchedResponse struct { + rawResponse []byte + callerDonID uint32 + triggerEventID string + workflowIDs []string +} + +var _ types.ReceiverService = &triggerPublisher{} + +const minAllowedBatchCollectionPeriod = 10 * time.Millisecond -func NewTriggerPublisher(config *types.RemoteTriggerConfig, underlying commoncap.TriggerCapability, capInfo commoncap.CapabilityInfo, capDonInfo commoncap.DON, workflowDONs map[uint32]commoncap.DON, dispatcher types.Dispatcher, lggr logger.Logger) *triggerPublisher { +func NewTriggerPublisher(config *commoncap.RemoteTriggerConfig, underlying commoncap.TriggerCapability, capInfo commoncap.CapabilityInfo, capDonInfo commoncap.DON, workflowDONs map[uint32]commoncap.DON, dispatcher types.Dispatcher, lggr logger.Logger) *triggerPublisher { + if config == nil { + lggr.Info("no config provided, using default values") + config = &commoncap.RemoteTriggerConfig{} + } config.ApplyDefaults() + membersCache := make(map[uint32]map[p2ptypes.PeerID]bool) + for id, don := range workflowDONs { + cache := make(map[p2ptypes.PeerID]bool) + for _, member := range don.Members { + cache[member] = true + } + membersCache[id] = cache + } return &triggerPublisher{ - config: config, - underlying: underlying, - capInfo: capInfo, - capDonInfo: capDonInfo, - workflowDONs: workflowDONs, - dispatcher: dispatcher, - messageCache: NewMessageCache[registrationKey, p2ptypes.PeerID](), - registrations: make(map[registrationKey]*pubRegState), - stopCh: make(services.StopChan), - lggr: lggr.Named("TriggerPublisher"), + config: config, + underlying: underlying, + capInfo: capInfo, + capDonInfo: capDonInfo, + workflowDONs: workflowDONs, + membersCache: membersCache, + dispatcher: dispatcher, + messageCache: NewMessageCache[registrationKey, p2ptypes.PeerID](), + registrations: make(map[registrationKey]*pubRegState), + batchingQueue: make(map[[32]byte]*batchedResponse), + batchingEnabled: config.MaxBatchSize > 1 && config.BatchCollectionPeriod >= minAllowedBatchCollectionPeriod, + stopCh: make(services.StopChan), + lggr: lggr.Named("TriggerPublisher"), } } func (p *triggerPublisher) Start(ctx context.Context) error { p.wg.Add(1) go p.registrationCleanupLoop() + if p.batchingEnabled { + p.wg.Add(1) + go p.batchingLoop() + } p.lggr.Info("TriggerPublisher started") return nil } func (p *triggerPublisher) Receive(_ context.Context, msg *types.MessageBody) { - sender := ToPeerID(msg.Sender) + sender, err := ToPeerID(msg.Sender) + if err != nil { + p.lggr.Errorw("failed to convert message sender to PeerID", "err", err) + return + } + if msg.Method == types.MethodRegisterTrigger { - req, err := pb.UnmarshalCapabilityRequest(msg.Payload) + req, err := pb.UnmarshalTriggerRegistrationRequest(msg.Payload) if err != nil { - p.lggr.Errorw("failed to unmarshal capability request", "capabilityId", p.capInfo.ID, "err", err) + p.lggr.Errorw("failed to unmarshal trigger registration request", "capabilityId", p.capInfo.ID, "err", err) return } callerDon, ok := p.workflowDONs[msg.CallerDonId] @@ -84,6 +122,14 @@ func (p *triggerPublisher) Receive(_ context.Context, msg *types.MessageBody) { p.lggr.Errorw("received a message from unsupported workflow DON", "capabilityId", p.capInfo.ID, "callerDonId", msg.CallerDonId) return } + if !p.membersCache[msg.CallerDonId][sender] { + p.lggr.Errorw("sender not a member of its workflow DON", "capabilityId", p.capInfo.ID, "callerDonId", msg.CallerDonId, "sender", sender) + return + } + if err = validation.ValidateWorkflowOrExecutionID(req.Metadata.WorkflowID); err != nil { + p.lggr.Errorw("received trigger request with invalid workflow ID", "capabilityId", p.capInfo.ID, "workflowId", SanitizeLogString(req.Metadata.WorkflowID), "err", err) + return + } p.lggr.Debugw("received trigger registration", "capabilityId", p.capInfo.ID, "workflowId", req.Metadata.WorkflowID, "sender", sender) key := registrationKey{msg.CallerDonId, req.Metadata.WorkflowID} nowMs := time.Now().UnixMilli() @@ -97,7 +143,7 @@ func (p *triggerPublisher) Receive(_ context.Context, msg *types.MessageBody) { } // NOTE: require 2F+1 by default, introduce different strategies later (KS-76) minRequired := uint32(2*callerDon.F + 1) - ready, payloads := p.messageCache.Ready(key, minRequired, nowMs-int64(p.config.RegistrationExpiryMs), false) + ready, payloads := p.messageCache.Ready(key, minRequired, nowMs-p.config.RegistrationExpiry.Milliseconds(), false) if !ready { p.lggr.Debugw("not ready to aggregate yet", "capabilityId", p.capInfo.ID, "workflowId", req.Metadata.WorkflowID, "minRequired", minRequired) return @@ -107,7 +153,7 @@ func (p *triggerPublisher) Receive(_ context.Context, msg *types.MessageBody) { p.lggr.Errorw("failed to aggregate trigger registrations", "capabilityId", p.capInfo.ID, "workflowId", req.Metadata.WorkflowID, "err", err) return } - unmarshaled, err := pb.UnmarshalCapabilityRequest(aggregated) + unmarshaled, err := pb.UnmarshalTriggerRegistrationRequest(aggregated) if err != nil { p.lggr.Errorw("failed to unmarshal request", "capabilityId", p.capInfo.ID, "err", err) return @@ -127,13 +173,13 @@ func (p *triggerPublisher) Receive(_ context.Context, msg *types.MessageBody) { p.lggr.Errorw("failed to register trigger", "capabilityId", p.capInfo.ID, "workflowId", req.Metadata.WorkflowID, "err", err) } } else { - p.lggr.Errorw("received trigger request with unknown method", "method", msg.Method, "sender", sender) + p.lggr.Errorw("received trigger request with unknown method", "method", SanitizeLogString(msg.Method), "sender", sender) } } func (p *triggerPublisher) registrationCleanupLoop() { defer p.wg.Done() - ticker := time.NewTicker(time.Duration(p.config.RegistrationExpiryMs) * time.Millisecond) + ticker := time.NewTicker(p.config.RegistrationExpiry) defer ticker.Stop() for { select { @@ -141,10 +187,10 @@ func (p *triggerPublisher) registrationCleanupLoop() { return case <-ticker.C: now := time.Now().UnixMilli() - p.mu.RLock() + p.mu.Lock() for key, req := range p.registrations { callerDon := p.workflowDONs[key.callerDonId] - ready, _ := p.messageCache.Ready(key, uint32(2*callerDon.F+1), now-int64(p.config.RegistrationExpiryMs), false) + ready, _ := p.messageCache.Ready(key, uint32(2*callerDon.F+1), now-p.config.RegistrationExpiry.Milliseconds(), false) if !ready { p.lggr.Infow("trigger registration expired", "capabilityId", p.capInfo.ID, "callerDonID", key.callerDonId, "workflowId", key.workflowId) ctx, cancel := p.stopCh.NewCtx() @@ -156,12 +202,12 @@ func (p *triggerPublisher) registrationCleanupLoop() { p.messageCache.Delete(key) } } - p.mu.RUnlock() + p.mu.Unlock() } } } -func (p *triggerPublisher) triggerEventLoop(callbackCh <-chan commoncap.CapabilityResponse, key registrationKey) { +func (p *triggerPublisher) triggerEventLoop(callbackCh <-chan commoncap.TriggerResponse, key registrationKey) { defer p.wg.Done() for { select { @@ -172,38 +218,100 @@ func (p *triggerPublisher) triggerEventLoop(callbackCh <-chan commoncap.Capabili p.lggr.Infow("triggerEventLoop channel closed", "capabilityId", p.capInfo.ID, "workflowId", key.workflowId) return } - triggerEvent := capabilities.TriggerEvent{} - err := response.Value.UnwrapTo(&triggerEvent) - if err != nil { - p.lggr.Errorw("can't unwrap trigger event", "capabilityId", p.capInfo.ID, "workflowId", key.workflowId, "err", err) - break - } + triggerEvent := response.Event p.lggr.Debugw("received trigger event", "capabilityId", p.capInfo.ID, "workflowId", key.workflowId, "triggerEventID", triggerEvent.ID) - marshaled, err := pb.MarshalCapabilityResponse(response) + marshaledResponse, err := pb.MarshalTriggerResponse(response) if err != nil { p.lggr.Debugw("can't marshal trigger event", "err", err) break } - msg := &types.MessageBody{ - CapabilityId: p.capInfo.ID, - CapabilityDonId: p.capDonInfo.ID, - CallerDonId: key.callerDonId, - Method: types.MethodTriggerEvent, - Payload: marshaled, - Metadata: &types.MessageBody_TriggerEventMetadata{ - TriggerEventMetadata: &types.TriggerEventMetadata{ - // NOTE: optionally introduce batching across workflows as an optimization - WorkflowIds: []string{key.workflowId}, - TriggerEventId: triggerEvent.ID, - }, + + if p.batchingEnabled { + p.enqueueForBatching(marshaledResponse, key, triggerEvent.ID) + } else { + // a single-element "batch" + p.sendBatch(&batchedResponse{ + rawResponse: marshaledResponse, + callerDonID: key.callerDonId, + triggerEventID: triggerEvent.ID, + workflowIDs: []string{key.workflowId}, + }) + } + } + } +} + +func (p *triggerPublisher) enqueueForBatching(rawResponse []byte, key registrationKey, triggerEventID string) { + // put in batching queue, group by hash(callerDonId, triggerEventID, response) + combined := make([]byte, 4) + binary.LittleEndian.PutUint32(combined, key.callerDonId) + combined = append(combined, []byte(triggerEventID)...) + combined = append(combined, rawResponse...) + sha := sha256.Sum256(combined) + p.bqMu.Lock() + elem, exists := p.batchingQueue[sha] + if !exists { + elem = &batchedResponse{ + rawResponse: rawResponse, + callerDonID: key.callerDonId, + triggerEventID: triggerEventID, + workflowIDs: []string{key.workflowId}, + } + p.batchingQueue[sha] = elem + } else { + elem.workflowIDs = append(elem.workflowIDs, key.workflowId) + } + p.bqMu.Unlock() +} + +func (p *triggerPublisher) sendBatch(resp *batchedResponse) { + for len(resp.workflowIDs) > 0 { + idBatch := resp.workflowIDs + if p.batchingEnabled && int64(len(idBatch)) > int64(p.config.MaxBatchSize) { + idBatch = idBatch[:p.config.MaxBatchSize] + resp.workflowIDs = resp.workflowIDs[p.config.MaxBatchSize:] + } else { + resp.workflowIDs = nil + } + msg := &types.MessageBody{ + CapabilityId: p.capInfo.ID, + CapabilityDonId: p.capDonInfo.ID, + CallerDonId: resp.callerDonID, + Method: types.MethodTriggerEvent, + Payload: resp.rawResponse, + Metadata: &types.MessageBody_TriggerEventMetadata{ + TriggerEventMetadata: &types.TriggerEventMetadata{ + WorkflowIds: idBatch, + TriggerEventId: resp.triggerEventID, }, + }, + } + // NOTE: send to all nodes by default, introduce different strategies later (KS-76) + for _, peerID := range p.workflowDONs[resp.callerDonID].Members { + err := p.dispatcher.Send(peerID, msg) + if err != nil { + p.lggr.Errorw("failed to send trigger event", "capabilityId", p.capInfo.ID, "peerID", peerID, "err", err) } - // NOTE: send to all nodes by default, introduce different strategies later (KS-76) - for _, peerID := range p.workflowDONs[key.callerDonId].Members { - err = p.dispatcher.Send(peerID, msg) - if err != nil { - p.lggr.Errorw("failed to send trigger event", "capabilityId", p.capInfo.ID, "peerID", peerID, "err", err) - } + } + } +} + +func (p *triggerPublisher) batchingLoop() { + defer p.wg.Done() + ticker := time.NewTicker(p.config.BatchCollectionPeriod) + defer ticker.Stop() + for { + select { + case <-p.stopCh: + return + case <-ticker.C: + p.bqMu.Lock() + queue := p.batchingQueue + p.batchingQueue = make(map[[32]byte]*batchedResponse) + p.bqMu.Unlock() + + for _, elem := range queue { + p.sendBatch(elem) } } } diff --git a/core/capabilities/remote/trigger_publisher_test.go b/core/capabilities/remote/trigger_publisher_test.go index ec38b962ced..8d078dc1aad 100644 --- a/core/capabilities/remote/trigger_publisher_test.go +++ b/core/capabilities/remote/trigger_publisher_test.go @@ -3,94 +3,178 @@ package remote_test import ( "context" "testing" + "time" + "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" commoncap "github.com/smartcontractkit/chainlink-common/pkg/capabilities" "github.com/smartcontractkit/chainlink-common/pkg/capabilities/pb" "github.com/smartcontractkit/chainlink/v2/core/capabilities/remote" remotetypes "github.com/smartcontractkit/chainlink/v2/core/capabilities/remote/types" - remoteMocks "github.com/smartcontractkit/chainlink/v2/core/capabilities/remote/types/mocks" + "github.com/smartcontractkit/chainlink/v2/core/capabilities/remote/types/mocks" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/logger" p2ptypes "github.com/smartcontractkit/chainlink/v2/core/services/p2p/types" ) +const capID = "cap_id@1" + func TestTriggerPublisher_Register(t *testing.T) { + ctx := testutils.Context(t) + capabilityDONID, workflowDONID := uint32(1), uint32(2) + + underlyingTriggerCap, publisher, _, peers := newServices(t, capabilityDONID, workflowDONID, 1) + + // invalid sender case - node 0 is not a member of the workflow DON, registration shoudn't happen + regEvent := newRegisterTriggerMessage(t, workflowDONID, peers[0]) + publisher.Receive(ctx, regEvent) + require.Empty(t, underlyingTriggerCap.registrationsCh) + + // valid registration + regEvent = newRegisterTriggerMessage(t, workflowDONID, peers[1]) + publisher.Receive(ctx, regEvent) + require.NotEmpty(t, underlyingTriggerCap.registrationsCh) + forwarded := <-underlyingTriggerCap.registrationsCh + require.Equal(t, workflowID1, forwarded.Metadata.WorkflowID) + + require.NoError(t, publisher.Close()) +} + +func TestTriggerPublisher_ReceiveTriggerEvents_NoBatching(t *testing.T) { + ctx := testutils.Context(t) + capabilityDONID, workflowDONID := uint32(1), uint32(2) + + underlyingTriggerCap, publisher, dispatcher, peers := newServices(t, capabilityDONID, workflowDONID, 1) + regEvent := newRegisterTriggerMessage(t, workflowDONID, peers[1]) + publisher.Receive(ctx, regEvent) + require.NotEmpty(t, underlyingTriggerCap.registrationsCh) + + // send a trigger event and expect that it gets delivered right away + underlyingTriggerCap.eventCh <- commoncap.TriggerResponse{} + awaitOutgoingMessageCh := make(chan struct{}) + dispatcher.On("Send", peers[1], mock.Anything).Run(func(args mock.Arguments) { + awaitOutgoingMessageCh <- struct{}{} + }).Return(nil) + <-awaitOutgoingMessageCh + + require.NoError(t, publisher.Close()) +} + +func TestTriggerPublisher_ReceiveTriggerEvents_BatchingEnabled(t *testing.T) { + ctx := testutils.Context(t) + capabilityDONID, workflowDONID := uint32(1), uint32(2) + + underlyingTriggerCap, publisher, dispatcher, peers := newServices(t, capabilityDONID, workflowDONID, 2) + regEvent := newRegisterTriggerMessage(t, workflowDONID, peers[1]) + publisher.Receive(ctx, regEvent) + require.NotEmpty(t, underlyingTriggerCap.registrationsCh) + + // send two trigger events and expect them to be delivered in a batch + underlyingTriggerCap.eventCh <- commoncap.TriggerResponse{} + underlyingTriggerCap.eventCh <- commoncap.TriggerResponse{} + awaitOutgoingMessageCh := make(chan struct{}) + dispatcher.On("Send", peers[1], mock.Anything).Run(func(args mock.Arguments) { + msg := args.Get(1).(*remotetypes.MessageBody) + require.Equal(t, capID, msg.CapabilityId) + require.Equal(t, remotetypes.MethodTriggerEvent, msg.Method) + require.NotEmpty(t, msg.Payload) + metadata := msg.Metadata.(*remotetypes.MessageBody_TriggerEventMetadata) + require.Len(t, metadata.TriggerEventMetadata.WorkflowIds, 2) + awaitOutgoingMessageCh <- struct{}{} + }).Return(nil).Once() + <-awaitOutgoingMessageCh + + // if there are fewer pending event than the batch size, + // the events should still be sent after the batch collection period + underlyingTriggerCap.eventCh <- commoncap.TriggerResponse{} + dispatcher.On("Send", peers[1], mock.Anything).Run(func(args mock.Arguments) { + msg := args.Get(1).(*remotetypes.MessageBody) + metadata := msg.Metadata.(*remotetypes.MessageBody_TriggerEventMetadata) + require.Len(t, metadata.TriggerEventMetadata.WorkflowIds, 1) + awaitOutgoingMessageCh <- struct{}{} + }).Return(nil).Once() + <-awaitOutgoingMessageCh + + require.NoError(t, publisher.Close()) +} + +func newServices(t *testing.T, capabilityDONID uint32, workflowDONID uint32, maxBatchSize uint32) (*testTrigger, remotetypes.ReceiverService, *mocks.Dispatcher, []p2ptypes.PeerID) { lggr := logger.TestLogger(t) ctx := testutils.Context(t) capInfo := commoncap.CapabilityInfo{ - ID: "cap_id@1", + ID: capID, CapabilityType: commoncap.CapabilityTypeTrigger, Description: "Remote Trigger", } - p1 := p2ptypes.PeerID{} - require.NoError(t, p1.UnmarshalText([]byte(peerID1))) - p2 := p2ptypes.PeerID{} - require.NoError(t, p2.UnmarshalText([]byte(peerID2))) + peers := make([]p2ptypes.PeerID, 2) + require.NoError(t, peers[0].UnmarshalText([]byte(peerID1))) + require.NoError(t, peers[1].UnmarshalText([]byte(peerID2))) capDonInfo := commoncap.DON{ - ID: 1, - Members: []p2ptypes.PeerID{p1}, + ID: capabilityDONID, + Members: []p2ptypes.PeerID{peers[0]}, // peer 0 is in the capability DON F: 0, } workflowDonInfo := commoncap.DON{ - ID: 2, - Members: []p2ptypes.PeerID{p2}, + ID: workflowDONID, + Members: []p2ptypes.PeerID{peers[1]}, // peer 1 is in the workflow DON F: 0, } - dispatcher := remoteMocks.NewDispatcher(t) - config := &remotetypes.RemoteTriggerConfig{ - RegistrationRefreshMs: 100, - RegistrationExpiryMs: 100_000, + dispatcher := mocks.NewDispatcher(t) + config := &commoncap.RemoteTriggerConfig{ + RegistrationRefresh: 100 * time.Millisecond, + RegistrationExpiry: 100 * time.Second, MinResponsesToAggregate: 1, - MessageExpiryMs: 100_000, + MessageExpiry: 100 * time.Second, + MaxBatchSize: maxBatchSize, + BatchCollectionPeriod: time.Second, } workflowDONs := map[uint32]commoncap.DON{ workflowDonInfo.ID: workflowDonInfo, } underlying := &testTrigger{ info: capInfo, - registrationsCh: make(chan commoncap.CapabilityRequest, 2), + registrationsCh: make(chan commoncap.TriggerRegistrationRequest, 2), + eventCh: make(chan commoncap.TriggerResponse, 2), } publisher := remote.NewTriggerPublisher(config, underlying, capInfo, capDonInfo, workflowDONs, dispatcher, lggr) require.NoError(t, publisher.Start(ctx)) + return underlying, publisher, dispatcher, peers +} +func newRegisterTriggerMessage(t *testing.T, callerDonID uint32, sender p2ptypes.PeerID) *remotetypes.MessageBody { // trigger registration event - capRequest := commoncap.CapabilityRequest{ + triggerRequest := commoncap.TriggerRegistrationRequest{ Metadata: commoncap.RequestMetadata{ WorkflowID: workflowID1, }, } - marshaled, err := pb.MarshalCapabilityRequest(capRequest) + marshaled, err := pb.MarshalTriggerRegistrationRequest(triggerRequest) require.NoError(t, err) - regEvent := &remotetypes.MessageBody{ - Sender: p1[:], + return &remotetypes.MessageBody{ + Sender: sender[:], Method: remotetypes.MethodRegisterTrigger, - CallerDonId: workflowDonInfo.ID, + CallerDonId: callerDonID, Payload: marshaled, } - publisher.Receive(ctx, regEvent) - forwarded := <-underlying.registrationsCh - require.Equal(t, capRequest.Metadata.WorkflowID, forwarded.Metadata.WorkflowID) - - require.NoError(t, publisher.Close()) } type testTrigger struct { info commoncap.CapabilityInfo - registrationsCh chan commoncap.CapabilityRequest + registrationsCh chan commoncap.TriggerRegistrationRequest + eventCh chan commoncap.TriggerResponse } -func (t *testTrigger) Info(_ context.Context) (commoncap.CapabilityInfo, error) { - return t.info, nil +func (tr *testTrigger) Info(_ context.Context) (commoncap.CapabilityInfo, error) { + return tr.info, nil } -func (t *testTrigger) RegisterTrigger(_ context.Context, request commoncap.CapabilityRequest) (<-chan commoncap.CapabilityResponse, error) { - t.registrationsCh <- request - return nil, nil +func (tr *testTrigger) RegisterTrigger(_ context.Context, request commoncap.TriggerRegistrationRequest) (<-chan commoncap.TriggerResponse, error) { + tr.registrationsCh <- request + return tr.eventCh, nil } -func (t *testTrigger) UnregisterTrigger(_ context.Context, request commoncap.CapabilityRequest) error { +func (tr *testTrigger) UnregisterTrigger(_ context.Context, request commoncap.TriggerRegistrationRequest) error { return nil } diff --git a/core/capabilities/remote/trigger_subscriber.go b/core/capabilities/remote/trigger_subscriber.go index 28bdff9c514..967b59258ae 100644 --- a/core/capabilities/remote/trigger_subscriber.go +++ b/core/capabilities/remote/trigger_subscriber.go @@ -6,7 +6,6 @@ import ( sync "sync" "time" - "github.com/smartcontractkit/chainlink-common/pkg/capabilities" commoncap "github.com/smartcontractkit/chainlink-common/pkg/capabilities" "github.com/smartcontractkit/chainlink-common/pkg/capabilities/pb" "github.com/smartcontractkit/chainlink-common/pkg/services" @@ -23,11 +22,11 @@ import ( // // TriggerSubscriber communicates with corresponding TriggerReceivers on remote nodes. type triggerSubscriber struct { - config *types.RemoteTriggerConfig + config *commoncap.RemoteTriggerConfig capInfo commoncap.CapabilityInfo - capDonInfo capabilities.DON + capDonInfo commoncap.DON capDonMembers map[p2ptypes.PeerID]struct{} - localDonInfo capabilities.DON + localDonInfo commoncap.DON dispatcher types.Dispatcher aggregator types.Aggregator messageCache *messageCache[triggerEventKey, p2ptypes.PeerID] @@ -44,7 +43,7 @@ type triggerEventKey struct { } type subRegState struct { - callback chan commoncap.CapabilityResponse + callback chan commoncap.TriggerResponse rawRequest []byte } @@ -53,13 +52,20 @@ var _ types.Receiver = &triggerSubscriber{} var _ services.Service = &triggerSubscriber{} // TODO makes this configurable with a default -const defaultSendChannelBufferSize = 1000 +const ( + defaultSendChannelBufferSize = 1000 + maxBatchedWorkflowIDs = 1000 +) -func NewTriggerSubscriber(config *types.RemoteTriggerConfig, capInfo commoncap.CapabilityInfo, capDonInfo capabilities.DON, localDonInfo capabilities.DON, dispatcher types.Dispatcher, aggregator types.Aggregator, lggr logger.Logger) *triggerSubscriber { +func NewTriggerSubscriber(config *commoncap.RemoteTriggerConfig, capInfo commoncap.CapabilityInfo, capDonInfo commoncap.DON, localDonInfo commoncap.DON, dispatcher types.Dispatcher, aggregator types.Aggregator, lggr logger.Logger) *triggerSubscriber { if aggregator == nil { lggr.Warnw("no aggregator provided, using default MODE aggregator", "capabilityId", capInfo.ID) aggregator = NewDefaultModeAggregator(uint32(capDonInfo.F + 1)) } + if config == nil { + lggr.Info("no config provided, using default values") + config = &commoncap.RemoteTriggerConfig{} + } config.ApplyDefaults() capDonMembers := make(map[p2ptypes.PeerID]struct{}) for _, member := range capDonInfo.Members { @@ -92,8 +98,8 @@ func (s *triggerSubscriber) Info(ctx context.Context) (commoncap.CapabilityInfo, return s.capInfo, nil } -func (s *triggerSubscriber) RegisterTrigger(ctx context.Context, request commoncap.CapabilityRequest) (<-chan commoncap.CapabilityResponse, error) { - rawRequest, err := pb.MarshalCapabilityRequest(request) +func (s *triggerSubscriber) RegisterTrigger(ctx context.Context, request commoncap.TriggerRegistrationRequest) (<-chan commoncap.TriggerResponse, error) { + rawRequest, err := pb.MarshalTriggerRegistrationRequest(request) if err != nil { return nil, err } @@ -107,7 +113,7 @@ func (s *triggerSubscriber) RegisterTrigger(ctx context.Context, request commonc regState, ok := s.registeredWorkflows[request.Metadata.WorkflowID] if !ok { regState = &subRegState{ - callback: make(chan commoncap.CapabilityResponse, defaultSendChannelBufferSize), + callback: make(chan commoncap.TriggerResponse, defaultSendChannelBufferSize), rawRequest: rawRequest, } s.registeredWorkflows[request.Metadata.WorkflowID] = regState @@ -121,7 +127,7 @@ func (s *triggerSubscriber) RegisterTrigger(ctx context.Context, request commonc func (s *triggerSubscriber) registrationLoop() { defer s.wg.Done() - ticker := time.NewTicker(time.Duration(s.config.RegistrationRefreshMs) * time.Millisecond) + ticker := time.NewTicker(s.config.RegistrationRefresh) defer ticker.Stop() for { select { @@ -154,7 +160,7 @@ func (s *triggerSubscriber) registrationLoop() { } } -func (s *triggerSubscriber) UnregisterTrigger(ctx context.Context, request commoncap.CapabilityRequest) error { +func (s *triggerSubscriber) UnregisterTrigger(ctx context.Context, request commoncap.TriggerRegistrationRequest) error { s.mu.Lock() defer s.mu.Unlock() @@ -169,7 +175,12 @@ func (s *triggerSubscriber) UnregisterTrigger(ctx context.Context, request commo } func (s *triggerSubscriber) Receive(_ context.Context, msg *types.MessageBody) { - sender := ToPeerID(msg.Sender) + sender, err := ToPeerID(msg.Sender) + if err != nil { + s.lggr.Errorw("failed to convert message sender to PeerID", "err", err) + return + } + if _, found := s.capDonMembers[sender]; !found { s.lggr.Errorw("received message from unexpected node", "capabilityId", s.capInfo.ID, "sender", sender) return @@ -180,12 +191,16 @@ func (s *triggerSubscriber) Receive(_ context.Context, msg *types.MessageBody) { s.lggr.Errorw("received message with invalid trigger metadata", "capabilityId", s.capInfo.ID, "sender", sender) return } + if len(meta.WorkflowIds) > maxBatchedWorkflowIDs { + s.lggr.Errorw("received message with too many workflow IDs - truncating", "capabilityId", s.capInfo.ID, "nWorkflows", len(meta.WorkflowIds), "sender", sender) + meta.WorkflowIds = meta.WorkflowIds[:maxBatchedWorkflowIDs] + } for _, workflowId := range meta.WorkflowIds { s.mu.RLock() registration, found := s.registeredWorkflows[workflowId] s.mu.RUnlock() if !found { - s.lggr.Errorw("received message for unregistered workflow", "capabilityId", s.capInfo.ID, "workflowID", workflowId, "sender", sender) + s.lggr.Errorw("received message for unregistered workflow", "capabilityId", s.capInfo.ID, "workflowID", SanitizeLogString(workflowId), "sender", sender) continue } key := triggerEventKey{ @@ -193,11 +208,11 @@ func (s *triggerSubscriber) Receive(_ context.Context, msg *types.MessageBody) { workflowId: workflowId, } nowMs := time.Now().UnixMilli() - s.mu.RLock() + s.mu.Lock() creationTs := s.messageCache.Insert(key, sender, nowMs, msg.Payload) - ready, payloads := s.messageCache.Ready(key, s.config.MinResponsesToAggregate, nowMs-int64(s.config.MessageExpiryMs), true) - s.mu.RUnlock() - if nowMs-creationTs > int64(s.config.RegistrationExpiryMs) { + ready, payloads := s.messageCache.Ready(key, s.config.MinResponsesToAggregate, nowMs-s.config.MessageExpiry.Milliseconds(), true) + s.mu.Unlock() + if nowMs-creationTs > s.config.RegistrationExpiry.Milliseconds() { s.lggr.Warnw("received trigger event for an expired ID", "triggerEventID", meta.TriggerEventId, "capabilityId", s.capInfo.ID, "workflowId", workflowId, "sender", sender) continue } @@ -213,13 +228,13 @@ func (s *triggerSubscriber) Receive(_ context.Context, msg *types.MessageBody) { } } } else { - s.lggr.Errorw("received trigger event with unknown method", "method", msg.Method, "sender", sender) + s.lggr.Errorw("received trigger event with unknown method", "method", SanitizeLogString(msg.Method), "sender", sender) } } func (s *triggerSubscriber) eventCleanupLoop() { defer s.wg.Done() - ticker := time.NewTicker(time.Duration(s.config.MessageExpiryMs) * time.Millisecond) + ticker := time.NewTicker(s.config.MessageExpiry) defer ticker.Stop() for { select { @@ -227,7 +242,7 @@ func (s *triggerSubscriber) eventCleanupLoop() { return case <-ticker.C: s.mu.Lock() - s.messageCache.DeleteOlderThan(time.Now().UnixMilli() - int64(s.config.MessageExpiryMs)) + s.messageCache.DeleteOlderThan(time.Now().UnixMilli() - s.config.MessageExpiry.Milliseconds()) s.mu.Unlock() } } diff --git a/core/capabilities/remote/trigger_subscriber_test.go b/core/capabilities/remote/trigger_subscriber_test.go index 782b29d41f9..b8cc3ddc7bd 100644 --- a/core/capabilities/remote/trigger_subscriber_test.go +++ b/core/capabilities/remote/trigger_subscriber_test.go @@ -2,6 +2,7 @@ package remote_test import ( "testing" + "time" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" @@ -20,7 +21,7 @@ import ( const ( peerID1 = "12D3KooWF3dVeJ6YoT5HFnYhmwQWWMoEwVFzJQ5kKCMX3ZityxMC" peerID2 = "12D3KooWQsmok6aD8PZqt3RnJhQRrNzKHLficq7zYFRp7kZ1hHP8" - workflowID1 = "workflowID1" + workflowID1 = "15c631d295ef5e32deb99a10ee6804bc4af13855687559d7ff6552ac6dbb2ce0" ) var ( @@ -61,16 +62,16 @@ func TestTriggerSubscriber_RegisterAndReceive(t *testing.T) { }) // register trigger - config := &remotetypes.RemoteTriggerConfig{ - RegistrationRefreshMs: 100, - RegistrationExpiryMs: 100, + config := &commoncap.RemoteTriggerConfig{ + RegistrationRefresh: 100 * time.Millisecond, + RegistrationExpiry: 100 * time.Second, MinResponsesToAggregate: 1, - MessageExpiryMs: 100_000, + MessageExpiry: 100 * time.Second, } subscriber := remote.NewTriggerSubscriber(config, capInfo, capDonInfo, workflowDonInfo, dispatcher, nil, lggr) require.NoError(t, subscriber.Start(ctx)) - req := commoncap.CapabilityRequest{ + req := commoncap.TriggerRegistrationRequest{ Metadata: commoncap.RequestMetadata{ WorkflowID: workflowID1, }, @@ -82,11 +83,13 @@ func TestTriggerSubscriber_RegisterAndReceive(t *testing.T) { // receive trigger event triggerEventValue, err := values.NewMap(triggerEvent1) require.NoError(t, err) - capResponse := commoncap.CapabilityResponse{ - Value: triggerEventValue, - Err: nil, + capResponse := commoncap.TriggerResponse{ + Event: commoncap.TriggerEvent{ + Outputs: triggerEventValue, + }, + Err: nil, } - marshaled, err := pb.MarshalCapabilityResponse(capResponse) + marshaled, err := pb.MarshalTriggerResponse(capResponse) require.NoError(t, err) triggerEvent := &remotetypes.MessageBody{ Sender: p1[:], @@ -100,7 +103,7 @@ func TestTriggerSubscriber_RegisterAndReceive(t *testing.T) { } subscriber.Receive(ctx, triggerEvent) response := <-triggerEventCallbackCh - require.Equal(t, response.Value, triggerEventValue) + require.Equal(t, response.Event.Outputs, triggerEventValue) require.NoError(t, subscriber.UnregisterTrigger(ctx, req)) require.NoError(t, subscriber.UnregisterTrigger(ctx, req)) diff --git a/core/capabilities/remote/types/config.go b/core/capabilities/remote/types/config.go deleted file mode 100644 index bb9e0fa4347..00000000000 --- a/core/capabilities/remote/types/config.go +++ /dev/null @@ -1,21 +0,0 @@ -package types - -const ( - DefaultRegistrationRefreshMs = 30_000 - DefaultRegistrationExpiryMs = 120_000 - DefaultMessageExpiryMs = 120_000 -) - -// NOTE: consider splitting this config into values stored in Registry (KS-118) -// and values defined locally by Capability owners. -func (c *RemoteTriggerConfig) ApplyDefaults() { - if c.RegistrationRefreshMs == 0 { - c.RegistrationRefreshMs = DefaultRegistrationRefreshMs - } - if c.RegistrationExpiryMs == 0 { - c.RegistrationExpiryMs = DefaultRegistrationExpiryMs - } - if c.MessageExpiryMs == 0 { - c.MessageExpiryMs = DefaultMessageExpiryMs - } -} diff --git a/core/capabilities/remote/types/messages.pb.go b/core/capabilities/remote/types/messages.pb.go index 68d8f4a262c..f5b77b5c15a 100644 --- a/core/capabilities/remote/types/messages.pb.go +++ b/core/capabilities/remote/types/messages.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.1 +// protoc-gen-go v1.34.2 // protoc v4.25.1 // source: core/capabilities/remote/types/messages.proto @@ -413,77 +413,6 @@ func (x *TriggerEventMetadata) GetWorkflowIds() []string { return nil } -type RemoteTriggerConfig struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - RegistrationRefreshMs uint32 `protobuf:"varint,1,opt,name=registrationRefreshMs,proto3" json:"registrationRefreshMs,omitempty"` - RegistrationExpiryMs uint32 `protobuf:"varint,2,opt,name=registrationExpiryMs,proto3" json:"registrationExpiryMs,omitempty"` - MinResponsesToAggregate uint32 `protobuf:"varint,3,opt,name=minResponsesToAggregate,proto3" json:"minResponsesToAggregate,omitempty"` - MessageExpiryMs uint32 `protobuf:"varint,4,opt,name=messageExpiryMs,proto3" json:"messageExpiryMs,omitempty"` -} - -func (x *RemoteTriggerConfig) Reset() { - *x = RemoteTriggerConfig{} - if protoimpl.UnsafeEnabled { - mi := &file_core_capabilities_remote_types_messages_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RemoteTriggerConfig) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RemoteTriggerConfig) ProtoMessage() {} - -func (x *RemoteTriggerConfig) ProtoReflect() protoreflect.Message { - mi := &file_core_capabilities_remote_types_messages_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RemoteTriggerConfig.ProtoReflect.Descriptor instead. -func (*RemoteTriggerConfig) Descriptor() ([]byte, []int) { - return file_core_capabilities_remote_types_messages_proto_rawDescGZIP(), []int{4} -} - -func (x *RemoteTriggerConfig) GetRegistrationRefreshMs() uint32 { - if x != nil { - return x.RegistrationRefreshMs - } - return 0 -} - -func (x *RemoteTriggerConfig) GetRegistrationExpiryMs() uint32 { - if x != nil { - return x.RegistrationExpiryMs - } - return 0 -} - -func (x *RemoteTriggerConfig) GetMinResponsesToAggregate() uint32 { - if x != nil { - return x.MinResponsesToAggregate - } - return 0 -} - -func (x *RemoteTriggerConfig) GetMessageExpiryMs() uint32 { - if x != nil { - return x.MessageExpiryMs - } - return 0 -} - var File_core_capabilities_remote_types_messages_proto protoreflect.FileDescriptor var file_core_capabilities_remote_types_messages_proto_rawDesc = []byte{ @@ -543,32 +472,17 @@ var file_core_capabilities_remote_types_messages_proto_rawDesc = []byte{ 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x74, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, 0x77, 0x6f, - 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x49, 0x64, 0x73, 0x22, 0xe3, 0x01, 0x0a, 0x13, 0x52, 0x65, - 0x6d, 0x6f, 0x74, 0x65, 0x54, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x12, 0x34, 0x0a, 0x15, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x4d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, - 0x52, 0x15, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, - 0x66, 0x72, 0x65, 0x73, 0x68, 0x4d, 0x73, 0x12, 0x32, 0x0a, 0x14, 0x72, 0x65, 0x67, 0x69, 0x73, - 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x78, 0x70, 0x69, 0x72, 0x79, 0x4d, 0x73, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x14, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x45, 0x78, 0x70, 0x69, 0x72, 0x79, 0x4d, 0x73, 0x12, 0x38, 0x0a, 0x17, 0x6d, - 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x54, 0x6f, 0x41, 0x67, 0x67, - 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x17, 0x6d, 0x69, - 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x54, 0x6f, 0x41, 0x67, 0x67, 0x72, - 0x65, 0x67, 0x61, 0x74, 0x65, 0x12, 0x28, 0x0a, 0x0f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, - 0x45, 0x78, 0x70, 0x69, 0x72, 0x79, 0x4d, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0f, - 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x45, 0x78, 0x70, 0x69, 0x72, 0x79, 0x4d, 0x73, 0x2a, - 0x76, 0x0a, 0x05, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x06, 0x0a, 0x02, 0x4f, 0x4b, 0x10, 0x00, - 0x12, 0x15, 0x0a, 0x11, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x46, - 0x41, 0x49, 0x4c, 0x45, 0x44, 0x10, 0x01, 0x12, 0x18, 0x0a, 0x14, 0x43, 0x41, 0x50, 0x41, 0x42, - 0x49, 0x4c, 0x49, 0x54, 0x59, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x46, 0x4f, 0x55, 0x4e, 0x44, 0x10, - 0x02, 0x12, 0x13, 0x0a, 0x0f, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x5f, 0x52, 0x45, 0x51, - 0x55, 0x45, 0x53, 0x54, 0x10, 0x03, 0x12, 0x0b, 0x0a, 0x07, 0x54, 0x49, 0x4d, 0x45, 0x4f, 0x55, - 0x54, 0x10, 0x04, 0x12, 0x12, 0x0a, 0x0e, 0x49, 0x4e, 0x54, 0x45, 0x52, 0x4e, 0x41, 0x4c, 0x5f, - 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x05, 0x42, 0x20, 0x5a, 0x1e, 0x63, 0x6f, 0x72, 0x65, 0x2f, - 0x63, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, 0x2f, 0x72, 0x65, 0x6d, - 0x6f, 0x74, 0x65, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, + 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x49, 0x64, 0x73, 0x2a, 0x76, 0x0a, 0x05, 0x45, 0x72, 0x72, + 0x6f, 0x72, 0x12, 0x06, 0x0a, 0x02, 0x4f, 0x4b, 0x10, 0x00, 0x12, 0x15, 0x0a, 0x11, 0x56, 0x41, + 0x4c, 0x49, 0x44, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x46, 0x41, 0x49, 0x4c, 0x45, 0x44, 0x10, + 0x01, 0x12, 0x18, 0x0a, 0x14, 0x43, 0x41, 0x50, 0x41, 0x42, 0x49, 0x4c, 0x49, 0x54, 0x59, 0x5f, + 0x4e, 0x4f, 0x54, 0x5f, 0x46, 0x4f, 0x55, 0x4e, 0x44, 0x10, 0x02, 0x12, 0x13, 0x0a, 0x0f, 0x49, + 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x5f, 0x52, 0x45, 0x51, 0x55, 0x45, 0x53, 0x54, 0x10, 0x03, + 0x12, 0x0b, 0x0a, 0x07, 0x54, 0x49, 0x4d, 0x45, 0x4f, 0x55, 0x54, 0x10, 0x04, 0x12, 0x12, 0x0a, + 0x0e, 0x49, 0x4e, 0x54, 0x45, 0x52, 0x4e, 0x41, 0x4c, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, + 0x05, 0x42, 0x20, 0x5a, 0x1e, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x63, 0x61, 0x70, 0x61, 0x62, 0x69, + 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, 0x2f, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2f, 0x74, 0x79, + 0x70, 0x65, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -584,14 +498,13 @@ func file_core_capabilities_remote_types_messages_proto_rawDescGZIP() []byte { } var file_core_capabilities_remote_types_messages_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_core_capabilities_remote_types_messages_proto_msgTypes = make([]protoimpl.MessageInfo, 5) -var file_core_capabilities_remote_types_messages_proto_goTypes = []interface{}{ +var file_core_capabilities_remote_types_messages_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_core_capabilities_remote_types_messages_proto_goTypes = []any{ (Error)(0), // 0: remote.Error (*Message)(nil), // 1: remote.Message (*MessageBody)(nil), // 2: remote.MessageBody (*TriggerRegistrationMetadata)(nil), // 3: remote.TriggerRegistrationMetadata (*TriggerEventMetadata)(nil), // 4: remote.TriggerEventMetadata - (*RemoteTriggerConfig)(nil), // 5: remote.RemoteTriggerConfig } var file_core_capabilities_remote_types_messages_proto_depIdxs = []int32{ 0, // 0: remote.MessageBody.error:type_name -> remote.Error @@ -610,7 +523,7 @@ func file_core_capabilities_remote_types_messages_proto_init() { return } if !protoimpl.UnsafeEnabled { - file_core_capabilities_remote_types_messages_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_core_capabilities_remote_types_messages_proto_msgTypes[0].Exporter = func(v any, i int) any { switch v := v.(*Message); i { case 0: return &v.state @@ -622,7 +535,7 @@ func file_core_capabilities_remote_types_messages_proto_init() { return nil } } - file_core_capabilities_remote_types_messages_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_core_capabilities_remote_types_messages_proto_msgTypes[1].Exporter = func(v any, i int) any { switch v := v.(*MessageBody); i { case 0: return &v.state @@ -634,7 +547,7 @@ func file_core_capabilities_remote_types_messages_proto_init() { return nil } } - file_core_capabilities_remote_types_messages_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + file_core_capabilities_remote_types_messages_proto_msgTypes[2].Exporter = func(v any, i int) any { switch v := v.(*TriggerRegistrationMetadata); i { case 0: return &v.state @@ -646,7 +559,7 @@ func file_core_capabilities_remote_types_messages_proto_init() { return nil } } - file_core_capabilities_remote_types_messages_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + file_core_capabilities_remote_types_messages_proto_msgTypes[3].Exporter = func(v any, i int) any { switch v := v.(*TriggerEventMetadata); i { case 0: return &v.state @@ -658,20 +571,8 @@ func file_core_capabilities_remote_types_messages_proto_init() { return nil } } - file_core_capabilities_remote_types_messages_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RemoteTriggerConfig); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } } - file_core_capabilities_remote_types_messages_proto_msgTypes[1].OneofWrappers = []interface{}{ + file_core_capabilities_remote_types_messages_proto_msgTypes[1].OneofWrappers = []any{ (*MessageBody_TriggerRegistrationMetadata)(nil), (*MessageBody_TriggerEventMetadata)(nil), } @@ -681,7 +582,7 @@ func file_core_capabilities_remote_types_messages_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_core_capabilities_remote_types_messages_proto_rawDesc, NumEnums: 1, - NumMessages: 5, + NumMessages: 4, NumExtensions: 0, NumServices: 0, }, diff --git a/core/capabilities/remote/types/messages.proto b/core/capabilities/remote/types/messages.proto index 4855892f9f4..7726538e8d9 100644 --- a/core/capabilities/remote/types/messages.proto +++ b/core/capabilities/remote/types/messages.proto @@ -49,10 +49,3 @@ message TriggerEventMetadata { string trigger_event_id = 1; repeated string workflow_ids = 2; } - -message RemoteTriggerConfig { - uint32 registrationRefreshMs = 1; - uint32 registrationExpiryMs = 2; - uint32 minResponsesToAggregate = 3; - uint32 messageExpiryMs = 4; -} diff --git a/core/capabilities/remote/types/mocks/dispatcher.go b/core/capabilities/remote/types/mocks/dispatcher.go index 35905dbd0a2..422198ffc1a 100644 --- a/core/capabilities/remote/types/mocks/dispatcher.go +++ b/core/capabilities/remote/types/mocks/dispatcher.go @@ -3,9 +3,12 @@ package mocks import ( - types "github.com/smartcontractkit/chainlink/v2/core/capabilities/remote/types" + context "context" + ragep2ptypes "github.com/smartcontractkit/libocr/ragep2p/types" mock "github.com/stretchr/testify/mock" + + types "github.com/smartcontractkit/chainlink/v2/core/capabilities/remote/types" ) // Dispatcher is an autogenerated mock type for the Dispatcher type @@ -13,11 +16,230 @@ type Dispatcher struct { mock.Mock } +type Dispatcher_Expecter struct { + mock *mock.Mock +} + +func (_m *Dispatcher) EXPECT() *Dispatcher_Expecter { + return &Dispatcher_Expecter{mock: &_m.Mock} +} + +// Close provides a mock function with given fields: +func (_m *Dispatcher) Close() error { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Close") + } + + var r0 error + if rf, ok := ret.Get(0).(func() error); ok { + r0 = rf() + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// Dispatcher_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close' +type Dispatcher_Close_Call struct { + *mock.Call +} + +// Close is a helper method to define mock.On call +func (_e *Dispatcher_Expecter) Close() *Dispatcher_Close_Call { + return &Dispatcher_Close_Call{Call: _e.mock.On("Close")} +} + +func (_c *Dispatcher_Close_Call) Run(run func()) *Dispatcher_Close_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Dispatcher_Close_Call) Return(_a0 error) *Dispatcher_Close_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Dispatcher_Close_Call) RunAndReturn(run func() error) *Dispatcher_Close_Call { + _c.Call.Return(run) + return _c +} + +// HealthReport provides a mock function with given fields: +func (_m *Dispatcher) HealthReport() map[string]error { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for HealthReport") + } + + var r0 map[string]error + if rf, ok := ret.Get(0).(func() map[string]error); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(map[string]error) + } + } + + return r0 +} + +// Dispatcher_HealthReport_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HealthReport' +type Dispatcher_HealthReport_Call struct { + *mock.Call +} + +// HealthReport is a helper method to define mock.On call +func (_e *Dispatcher_Expecter) HealthReport() *Dispatcher_HealthReport_Call { + return &Dispatcher_HealthReport_Call{Call: _e.mock.On("HealthReport")} +} + +func (_c *Dispatcher_HealthReport_Call) Run(run func()) *Dispatcher_HealthReport_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Dispatcher_HealthReport_Call) Return(_a0 map[string]error) *Dispatcher_HealthReport_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Dispatcher_HealthReport_Call) RunAndReturn(run func() map[string]error) *Dispatcher_HealthReport_Call { + _c.Call.Return(run) + return _c +} + +// Name provides a mock function with given fields: +func (_m *Dispatcher) Name() string { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Name") + } + + var r0 string + if rf, ok := ret.Get(0).(func() string); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// Dispatcher_Name_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Name' +type Dispatcher_Name_Call struct { + *mock.Call +} + +// Name is a helper method to define mock.On call +func (_e *Dispatcher_Expecter) Name() *Dispatcher_Name_Call { + return &Dispatcher_Name_Call{Call: _e.mock.On("Name")} +} + +func (_c *Dispatcher_Name_Call) Run(run func()) *Dispatcher_Name_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Dispatcher_Name_Call) Return(_a0 string) *Dispatcher_Name_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Dispatcher_Name_Call) RunAndReturn(run func() string) *Dispatcher_Name_Call { + _c.Call.Return(run) + return _c +} + +// Ready provides a mock function with given fields: +func (_m *Dispatcher) Ready() error { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Ready") + } + + var r0 error + if rf, ok := ret.Get(0).(func() error); ok { + r0 = rf() + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// Dispatcher_Ready_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Ready' +type Dispatcher_Ready_Call struct { + *mock.Call +} + +// Ready is a helper method to define mock.On call +func (_e *Dispatcher_Expecter) Ready() *Dispatcher_Ready_Call { + return &Dispatcher_Ready_Call{Call: _e.mock.On("Ready")} +} + +func (_c *Dispatcher_Ready_Call) Run(run func()) *Dispatcher_Ready_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Dispatcher_Ready_Call) Return(_a0 error) *Dispatcher_Ready_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Dispatcher_Ready_Call) RunAndReturn(run func() error) *Dispatcher_Ready_Call { + _c.Call.Return(run) + return _c +} + // RemoveReceiver provides a mock function with given fields: capabilityId, donId func (_m *Dispatcher) RemoveReceiver(capabilityId string, donId uint32) { _m.Called(capabilityId, donId) } +// Dispatcher_RemoveReceiver_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveReceiver' +type Dispatcher_RemoveReceiver_Call struct { + *mock.Call +} + +// RemoveReceiver is a helper method to define mock.On call +// - capabilityId string +// - donId uint32 +func (_e *Dispatcher_Expecter) RemoveReceiver(capabilityId interface{}, donId interface{}) *Dispatcher_RemoveReceiver_Call { + return &Dispatcher_RemoveReceiver_Call{Call: _e.mock.On("RemoveReceiver", capabilityId, donId)} +} + +func (_c *Dispatcher_RemoveReceiver_Call) Run(run func(capabilityId string, donId uint32)) *Dispatcher_RemoveReceiver_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(uint32)) + }) + return _c +} + +func (_c *Dispatcher_RemoveReceiver_Call) Return() *Dispatcher_RemoveReceiver_Call { + _c.Call.Return() + return _c +} + +func (_c *Dispatcher_RemoveReceiver_Call) RunAndReturn(run func(string, uint32)) *Dispatcher_RemoveReceiver_Call { + _c.Call.Return(run) + return _c +} + // Send provides a mock function with given fields: peerID, msgBody func (_m *Dispatcher) Send(peerID ragep2ptypes.PeerID, msgBody *types.MessageBody) error { ret := _m.Called(peerID, msgBody) @@ -36,6 +258,35 @@ func (_m *Dispatcher) Send(peerID ragep2ptypes.PeerID, msgBody *types.MessageBod return r0 } +// Dispatcher_Send_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Send' +type Dispatcher_Send_Call struct { + *mock.Call +} + +// Send is a helper method to define mock.On call +// - peerID ragep2ptypes.PeerID +// - msgBody *types.MessageBody +func (_e *Dispatcher_Expecter) Send(peerID interface{}, msgBody interface{}) *Dispatcher_Send_Call { + return &Dispatcher_Send_Call{Call: _e.mock.On("Send", peerID, msgBody)} +} + +func (_c *Dispatcher_Send_Call) Run(run func(peerID ragep2ptypes.PeerID, msgBody *types.MessageBody)) *Dispatcher_Send_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(ragep2ptypes.PeerID), args[1].(*types.MessageBody)) + }) + return _c +} + +func (_c *Dispatcher_Send_Call) Return(_a0 error) *Dispatcher_Send_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Dispatcher_Send_Call) RunAndReturn(run func(ragep2ptypes.PeerID, *types.MessageBody) error) *Dispatcher_Send_Call { + _c.Call.Return(run) + return _c +} + // SetReceiver provides a mock function with given fields: capabilityId, donId, receiver func (_m *Dispatcher) SetReceiver(capabilityId string, donId uint32, receiver types.Receiver) error { ret := _m.Called(capabilityId, donId, receiver) @@ -54,6 +305,82 @@ func (_m *Dispatcher) SetReceiver(capabilityId string, donId uint32, receiver ty return r0 } +// Dispatcher_SetReceiver_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetReceiver' +type Dispatcher_SetReceiver_Call struct { + *mock.Call +} + +// SetReceiver is a helper method to define mock.On call +// - capabilityId string +// - donId uint32 +// - receiver types.Receiver +func (_e *Dispatcher_Expecter) SetReceiver(capabilityId interface{}, donId interface{}, receiver interface{}) *Dispatcher_SetReceiver_Call { + return &Dispatcher_SetReceiver_Call{Call: _e.mock.On("SetReceiver", capabilityId, donId, receiver)} +} + +func (_c *Dispatcher_SetReceiver_Call) Run(run func(capabilityId string, donId uint32, receiver types.Receiver)) *Dispatcher_SetReceiver_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(uint32), args[2].(types.Receiver)) + }) + return _c +} + +func (_c *Dispatcher_SetReceiver_Call) Return(_a0 error) *Dispatcher_SetReceiver_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Dispatcher_SetReceiver_Call) RunAndReturn(run func(string, uint32, types.Receiver) error) *Dispatcher_SetReceiver_Call { + _c.Call.Return(run) + return _c +} + +// Start provides a mock function with given fields: _a0 +func (_m *Dispatcher) Start(_a0 context.Context) error { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for Start") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context) error); ok { + r0 = rf(_a0) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// Dispatcher_Start_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Start' +type Dispatcher_Start_Call struct { + *mock.Call +} + +// Start is a helper method to define mock.On call +// - _a0 context.Context +func (_e *Dispatcher_Expecter) Start(_a0 interface{}) *Dispatcher_Start_Call { + return &Dispatcher_Start_Call{Call: _e.mock.On("Start", _a0)} +} + +func (_c *Dispatcher_Start_Call) Run(run func(_a0 context.Context)) *Dispatcher_Start_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *Dispatcher_Start_Call) Return(_a0 error) *Dispatcher_Start_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Dispatcher_Start_Call) RunAndReturn(run func(context.Context) error) *Dispatcher_Start_Call { + _c.Call.Return(run) + return _c +} + // NewDispatcher creates a new instance of Dispatcher. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewDispatcher(t interface { diff --git a/core/capabilities/remote/types/mocks/receiver.go b/core/capabilities/remote/types/mocks/receiver.go index 701ab0f011f..3aaf346b39e 100644 --- a/core/capabilities/remote/types/mocks/receiver.go +++ b/core/capabilities/remote/types/mocks/receiver.go @@ -14,11 +14,48 @@ type Receiver struct { mock.Mock } +type Receiver_Expecter struct { + mock *mock.Mock +} + +func (_m *Receiver) EXPECT() *Receiver_Expecter { + return &Receiver_Expecter{mock: &_m.Mock} +} + // Receive provides a mock function with given fields: ctx, msg func (_m *Receiver) Receive(ctx context.Context, msg *types.MessageBody) { _m.Called(ctx, msg) } +// Receiver_Receive_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Receive' +type Receiver_Receive_Call struct { + *mock.Call +} + +// Receive is a helper method to define mock.On call +// - ctx context.Context +// - msg *types.MessageBody +func (_e *Receiver_Expecter) Receive(ctx interface{}, msg interface{}) *Receiver_Receive_Call { + return &Receiver_Receive_Call{Call: _e.mock.On("Receive", ctx, msg)} +} + +func (_c *Receiver_Receive_Call) Run(run func(ctx context.Context, msg *types.MessageBody)) *Receiver_Receive_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*types.MessageBody)) + }) + return _c +} + +func (_c *Receiver_Receive_Call) Return() *Receiver_Receive_Call { + _c.Call.Return() + return _c +} + +func (_c *Receiver_Receive_Call) RunAndReturn(run func(context.Context, *types.MessageBody)) *Receiver_Receive_Call { + _c.Call.Return(run) + return _c +} + // NewReceiver creates a new instance of Receiver. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewReceiver(t interface { diff --git a/core/capabilities/remote/types/types.go b/core/capabilities/remote/types/types.go index 1f2527b6220..54ec16f09f1 100644 --- a/core/capabilities/remote/types/types.go +++ b/core/capabilities/remote/types/types.go @@ -8,6 +8,7 @@ import ( "context" commoncap "github.com/smartcontractkit/chainlink-common/pkg/capabilities" + "github.com/smartcontractkit/chainlink-common/pkg/services" p2ptypes "github.com/smartcontractkit/chainlink/v2/core/services/p2p/types" ) @@ -18,20 +19,24 @@ const ( MethodExecute = "Execute" ) -//go:generate mockery --quiet --name Dispatcher --output ./mocks/ --case=underscore type Dispatcher interface { + services.Service SetReceiver(capabilityId string, donId uint32, receiver Receiver) error RemoveReceiver(capabilityId string, donId uint32) Send(peerID p2ptypes.PeerID, msgBody *MessageBody) error } -//go:generate mockery --quiet --name Receiver --output ./mocks/ --case=underscore type Receiver interface { Receive(ctx context.Context, msg *MessageBody) } +type ReceiverService interface { + services.Service + Receiver +} + type Aggregator interface { - Aggregate(eventID string, responses [][]byte) (commoncap.CapabilityResponse, error) + Aggregate(eventID string, responses [][]byte) (commoncap.TriggerResponse, error) } // NOTE: this type will become part of the Registry (KS-108) diff --git a/core/capabilities/remote/utils.go b/core/capabilities/remote/utils.go index dba24b843cc..ea6a3efb186 100644 --- a/core/capabilities/remote/utils.go +++ b/core/capabilities/remote/utils.go @@ -7,6 +7,7 @@ import ( "encoding/hex" "errors" "fmt" + "unicode" "google.golang.org/protobuf/proto" @@ -16,6 +17,10 @@ import ( p2ptypes "github.com/smartcontractkit/chainlink/v2/core/services/p2p/types" ) +const ( + maxLoggedStringLen = 256 +) + func ValidateMessage(msg p2ptypes.Message, expectedReceiver p2ptypes.PeerID) (*remotetypes.MessageBody, error) { var topLevelMessage remotetypes.Message err := proto.Unmarshal(msg.Payload, &topLevelMessage) @@ -43,10 +48,14 @@ func ValidateMessage(msg p2ptypes.Message, expectedReceiver p2ptypes.PeerID) (*r return &body, nil } -func ToPeerID(peerID []byte) p2ptypes.PeerID { +func ToPeerID(peerID []byte) (p2ptypes.PeerID, error) { + if len(peerID) != p2ptypes.PeerIDLength { + return p2ptypes.PeerID{}, fmt.Errorf("invalid peer ID length: %d", len(peerID)) + } + var id p2ptypes.PeerID copy(id[:], peerID) - return id + return id, nil } // Default MODE Aggregator needs a configurable number of identical responses for aggregation to succeed @@ -62,15 +71,15 @@ func NewDefaultModeAggregator(minIdenticalResponses uint32) *defaultModeAggregat } } -func (a *defaultModeAggregator) Aggregate(_ string, responses [][]byte) (commoncap.CapabilityResponse, error) { +func (a *defaultModeAggregator) Aggregate(_ string, responses [][]byte) (commoncap.TriggerResponse, error) { found, err := AggregateModeRaw(responses, a.minIdenticalResponses) if err != nil { - return commoncap.CapabilityResponse{}, fmt.Errorf("failed to aggregate responses, err: %w", err) + return commoncap.TriggerResponse{}, fmt.Errorf("failed to aggregate responses, err: %w", err) } - unmarshaled, err := pb.UnmarshalCapabilityResponse(found) + unmarshaled, err := pb.UnmarshalTriggerResponse(found) if err != nil { - return commoncap.CapabilityResponse{}, fmt.Errorf("failed to unmarshal aggregated responses, err: %w", err) + return commoncap.TriggerResponse{}, fmt.Errorf("failed to unmarshal aggregated responses, err: %w", err) } return unmarshaled, nil } @@ -85,7 +94,8 @@ func AggregateModeRaw(elemList [][]byte, minIdenticalResponses uint32) ([]byte, hashToCount[sha]++ if hashToCount[sha] >= minIdenticalResponses { found = elem - break + // update in case we find another elem with an even higher count + minIdenticalResponses = hashToCount[sha] } } if found == nil { @@ -93,3 +103,17 @@ func AggregateModeRaw(elemList [][]byte, minIdenticalResponses uint32) ([]byte, } return found, nil } + +func SanitizeLogString(s string) string { + tooLongSuffix := "" + if len(s) > maxLoggedStringLen { + s = s[:maxLoggedStringLen] + tooLongSuffix = " [TRUNCATED]" + } + for i := 0; i < len(s); i++ { + if !unicode.IsPrint(rune(s[i])) { + return "[UNPRINTABLE] " + hex.EncodeToString([]byte(s)) + tooLongSuffix + } + } + return s + tooLongSuffix +} diff --git a/core/capabilities/remote/utils_test.go b/core/capabilities/remote/utils_test.go index 8bebf71fb66..6707e6ffb25 100644 --- a/core/capabilities/remote/utils_test.go +++ b/core/capabilities/remote/utils_test.go @@ -84,27 +84,32 @@ func encodeAndSign(t *testing.T, senderPrivKey ed25519.PrivateKey, senderId p2pt } func TestToPeerID(t *testing.T) { - id := remote.ToPeerID([]byte("12345678901234567890123456789012")) + id, err := remote.ToPeerID([]byte("12345678901234567890123456789012")) + require.NoError(t, err) require.Equal(t, "12D3KooWD8QYTQVYjB6oog4Ej8PcPpqTrPRnxLQap8yY8KUQRVvq", id.String()) } func TestDefaultModeAggregator_Aggregate(t *testing.T) { val, err := values.NewMap(triggerEvent1) require.NoError(t, err) - capResponse1 := commoncap.CapabilityResponse{ - Value: val, - Err: nil, + capResponse1 := commoncap.TriggerResponse{ + Event: commoncap.TriggerEvent{ + Outputs: val, + }, + Err: nil, } - marshaled1, err := pb.MarshalCapabilityResponse(capResponse1) + marshaled1, err := pb.MarshalTriggerResponse(capResponse1) require.NoError(t, err) val2, err := values.NewMap(triggerEvent2) require.NoError(t, err) - capResponse2 := commoncap.CapabilityResponse{ - Value: val2, - Err: nil, + capResponse2 := commoncap.TriggerResponse{ + Event: commoncap.TriggerEvent{ + Outputs: val2, + }, + Err: nil, } - marshaled2, err := pb.MarshalCapabilityResponse(capResponse2) + marshaled2, err := pb.MarshalTriggerResponse(capResponse2) require.NoError(t, err) agg := remote.NewDefaultModeAggregator(2) @@ -118,3 +123,14 @@ func TestDefaultModeAggregator_Aggregate(t *testing.T) { require.NoError(t, err) require.Equal(t, res, capResponse1) } + +func TestSanitizeLogString(t *testing.T) { + require.Equal(t, "hello", remote.SanitizeLogString("hello")) + require.Equal(t, "[UNPRINTABLE] 0a", remote.SanitizeLogString("\n")) + + longString := "" + for i := 0; i < 100; i++ { + longString += "aa-aa-aa-" + } + require.Equal(t, longString[:256]+" [TRUNCATED]", remote.SanitizeLogString(longString)) +} diff --git a/core/capabilities/streams/codec.go b/core/capabilities/streams/codec.go index d2bc451a39f..d6918f0c739 100644 --- a/core/capabilities/streams/codec.go +++ b/core/capabilities/streams/codec.go @@ -1,6 +1,7 @@ package streams import ( + "encoding/hex" "fmt" "github.com/ethereum/go-ethereum/common" @@ -19,7 +20,7 @@ type codec struct { var _ datastreams.ReportCodec = &codec{} func (c *codec) Unwrap(wrapped values.Value) ([]datastreams.FeedReport, error) { - dest, err := datastreams.UnwrapFeedReportList(wrapped) + dest, err := datastreams.UnwrapStreamsTriggerEventToFeedReportList(wrapped) if err != nil { return nil, fmt.Errorf("failed to unwrap: %v", err) } @@ -34,6 +35,9 @@ func (c *codec) Unwrap(wrapped values.Value) ([]datastreams.FeedReport, error) { if err2 != nil { return nil, fmt.Errorf("failed to decode: %v", err2) } + if decoded.FeedId != id.Bytes() { + return nil, fmt.Errorf("feed ID mismatch: FeedID: %s, FullReport.FeedId: %s", id, hex.EncodeToString(decoded.FeedId[:])) + } dest[i].BenchmarkPrice = decoded.BenchmarkPrice.Bytes() dest[i].ObservationTimestamp = int64(decoded.ObservationsTimestamp) } @@ -41,7 +45,9 @@ func (c *codec) Unwrap(wrapped values.Value) ([]datastreams.FeedReport, error) { } func (c *codec) Wrap(reports []datastreams.FeedReport) (values.Value, error) { - return values.Wrap(reports) + return values.Wrap(&datastreams.StreamsTriggerEvent{ + Payload: reports, + }) } func (c *codec) Validate(report datastreams.FeedReport, allowedSigners [][]byte, minRequiredSignatures int) error { diff --git a/core/capabilities/streams/codec_test.go b/core/capabilities/streams/codec_test.go index e3ada731e43..02ec474fec9 100644 --- a/core/capabilities/streams/codec_test.go +++ b/core/capabilities/streams/codec_test.go @@ -69,7 +69,7 @@ func TestCodec_WrapUnwrap(t *testing.T) { _, err = codec.Unwrap(values.NewBool(true)) require.Error(t, err) - // correct reports byt wrong signatures + // correct reports but wrong signatures unwrapped, err := codec.Unwrap(wrapped) require.NoError(t, err) require.Equal(t, 2, len(unwrapped)) @@ -85,6 +85,20 @@ func TestCodec_WrapUnwrap(t *testing.T) { for _, report := range unwrapped { require.NoError(t, codec.Validate(report, allowedSigners, 2)) } + + // invalid FeedID + wrappedInvalid, err := codec.Wrap([]datastreams.FeedReport{ + { + FeedID: id2Str, // ID #2 doesn't match what's in report #1 + FullReport: report1, + ReportContext: rawCtx, + Signatures: [][]byte{signatureK1R1, signatureK2R1}, + }, + }) + require.NoError(t, err) + _, err = codec.Unwrap(wrappedInvalid) + require.Error(t, err) + require.Contains(t, err.Error(), "feed ID mismatch") } func newFeedID(t *testing.T) ([32]byte, string) { diff --git a/core/capabilities/streams/consensus_agg_test.go b/core/capabilities/streams/consensus_agg_test.go index 506ad26f86f..04396a38ba9 100644 --- a/core/capabilities/streams/consensus_agg_test.go +++ b/core/capabilities/streams/consensus_agg_test.go @@ -9,7 +9,6 @@ import ( "github.com/smartcontractkit/libocr/commontypes" - "github.com/smartcontractkit/chainlink-common/pkg/capabilities" "github.com/smartcontractkit/chainlink-common/pkg/capabilities/consensus/ocr3/datafeeds" "github.com/smartcontractkit/chainlink-common/pkg/capabilities/datastreams" "github.com/smartcontractkit/chainlink-common/pkg/values" @@ -98,26 +97,18 @@ func newObservations(t *testing.T, nNodes int, feeds []feed, minRequiredSignatur reportList = append(reportList, signedStreamsReport) } - payloadVal, err := values.Wrap(reportList) - require.NoError(t, err) - - meta := datastreams.SignersMetadata{ + meta := datastreams.Metadata{ Signers: allowedSigners, MinRequiredSignatures: minRequiredSignatures, } - metaVal, err := values.Wrap(meta) - require.NoError(t, err) - - triggerEvent := capabilities.TriggerEvent{ - TriggerType: triggerID, - ID: "unused", - Timestamp: "1234", - Metadata: metaVal, - Payload: payloadVal, + p := datastreams.StreamsTriggerEvent{ + Payload: reportList, + Metadata: meta, } - wrappedEvent, err := values.Wrap(triggerEvent) + outputs, err := values.WrapMap(p) require.NoError(t, err) - observations[commontypes.OracleID(i)] = []values.Value{wrappedEvent} + + observations[commontypes.OracleID(i)] = []values.Value{outputs} } return observations } diff --git a/core/capabilities/streams/trigger_test.go b/core/capabilities/streams/trigger_test.go index 6d8c9a27c1d..3db6f2445ea 100644 --- a/core/capabilities/streams/trigger_test.go +++ b/core/capabilities/streams/trigger_test.go @@ -87,13 +87,13 @@ func TestStreamsTrigger(t *testing.T) { Members: capMembers, F: uint8(F), } - config := &remotetypes.RemoteTriggerConfig{ + config := &capabilities.RemoteTriggerConfig{ MinResponsesToAggregate: uint32(F + 1), } subscriber := remote.NewTriggerSubscriber(config, capInfo, capDonInfo, capabilities.DON{}, nil, agg, lggr) // register trigger - req := capabilities.CapabilityRequest{ + req := capabilities.TriggerRegistrationRequest{ Metadata: capabilities.RequestMetadata{ WorkflowID: workflowID, }, @@ -131,7 +131,7 @@ func TestStreamsTrigger(t *testing.T) { } response := <-triggerEventCallbackCh - validateLatestReports(t, response.Value, P, basePrice+R-1, baseTimestamp+R-1) + validateLatestReports(t, response.Event.Outputs, P, basePrice+R-1, baseTimestamp+R-1) } totalTime := time.Now().UnixMilli() - startTs lggr.Infow("elapsed", "totalMs", totalTime, "processingMs", processingTime) @@ -180,24 +180,20 @@ func newFeedsWithSignedReports(t *testing.T, nodes []node, N, P, R int) []feed { } func newTriggerEvent(t *testing.T, reportList []datastreams.FeedReport, triggerEventID string, sender ragetypes.PeerID) *remotetypes.MessageBody { - val, err := values.Wrap(reportList) + outputs, err := values.WrapMap(&datastreams.StreamsTriggerEvent{ + Timestamp: 10, + Payload: reportList, + }) require.NoError(t, err) triggerEvent := capabilities.TriggerEvent{ TriggerType: triggerID, ID: triggerEventID, - Timestamp: strconv.FormatInt(1000, 10), - Metadata: nil, - Payload: val, + Outputs: outputs, } - eventVal, err := values.WrapMap(triggerEvent) - require.NoError(t, err) + marshaled, err := pb.MarshalTriggerResponse(capabilities.TriggerResponse{Event: triggerEvent}) - marshaled, err := pb.MarshalCapabilityResponse( - capabilities.CapabilityResponse{ - Value: eventVal, - }) require.NoError(t, err) msg := &remotetypes.MessageBody{ Sender: sender[:], @@ -214,13 +210,11 @@ func newTriggerEvent(t *testing.T, reportList []datastreams.FeedReport, triggerE } func validateLatestReports(t *testing.T, wrapped values.Value, expectedFeedsLen int, expectedPrice int, expectedTimestamp int) { - triggerEvent := capabilities.TriggerEvent{} + triggerEvent := datastreams.StreamsTriggerEvent{} require.NoError(t, wrapped.UnwrapTo(&triggerEvent)) - reports := []datastreams.FeedReport{} - require.NoError(t, triggerEvent.Payload.UnwrapTo(&reports)) - require.Equal(t, expectedFeedsLen, len(reports)) + require.Equal(t, expectedFeedsLen, len(triggerEvent.Payload)) priceBig := big.NewInt(int64(expectedPrice)) - for _, report := range reports { + for _, report := range triggerEvent.Payload { require.Equal(t, priceBig.Bytes(), report.BenchmarkPrice) require.Equal(t, int64(expectedTimestamp), report.ObservationTimestamp) } diff --git a/core/capabilities/targets/mocks/chain_reader.go b/core/capabilities/targets/mocks/chain_reader.go deleted file mode 100644 index 6ad40c71597..00000000000 --- a/core/capabilities/targets/mocks/chain_reader.go +++ /dev/null @@ -1,189 +0,0 @@ -// Code generated by mockery v2.43.2. DO NOT EDIT. - -package mocks - -import ( - context "context" - - query "github.com/smartcontractkit/chainlink-common/pkg/types/query" - mock "github.com/stretchr/testify/mock" - - types "github.com/smartcontractkit/chainlink-common/pkg/types" -) - -// ChainReader is an autogenerated mock type for the ChainReader type -type ChainReader struct { - mock.Mock -} - -// Bind provides a mock function with given fields: ctx, bindings -func (_m *ChainReader) Bind(ctx context.Context, bindings []types.BoundContract) error { - ret := _m.Called(ctx, bindings) - - if len(ret) == 0 { - panic("no return value specified for Bind") - } - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, []types.BoundContract) error); ok { - r0 = rf(ctx, bindings) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// Close provides a mock function with given fields: -func (_m *ChainReader) Close() error { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for Close") - } - - var r0 error - if rf, ok := ret.Get(0).(func() error); ok { - r0 = rf() - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// GetLatestValue provides a mock function with given fields: ctx, contractName, method, params, returnVal -func (_m *ChainReader) GetLatestValue(ctx context.Context, contractName string, method string, params interface{}, returnVal interface{}) error { - ret := _m.Called(ctx, contractName, method, params, returnVal) - - if len(ret) == 0 { - panic("no return value specified for GetLatestValue") - } - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, string, string, interface{}, interface{}) error); ok { - r0 = rf(ctx, contractName, method, params, returnVal) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// HealthReport provides a mock function with given fields: -func (_m *ChainReader) HealthReport() map[string]error { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for HealthReport") - } - - var r0 map[string]error - if rf, ok := ret.Get(0).(func() map[string]error); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(map[string]error) - } - } - - return r0 -} - -// Name provides a mock function with given fields: -func (_m *ChainReader) Name() string { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for Name") - } - - var r0 string - if rf, ok := ret.Get(0).(func() string); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(string) - } - - return r0 -} - -// QueryKey provides a mock function with given fields: ctx, contractName, filter, limitAndSort, sequenceDataType -func (_m *ChainReader) QueryKey(ctx context.Context, contractName string, filter query.KeyFilter, limitAndSort query.LimitAndSort, sequenceDataType interface{}) ([]types.Sequence, error) { - ret := _m.Called(ctx, contractName, filter, limitAndSort, sequenceDataType) - - if len(ret) == 0 { - panic("no return value specified for QueryKey") - } - - var r0 []types.Sequence - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string, query.KeyFilter, query.LimitAndSort, interface{}) ([]types.Sequence, error)); ok { - return rf(ctx, contractName, filter, limitAndSort, sequenceDataType) - } - if rf, ok := ret.Get(0).(func(context.Context, string, query.KeyFilter, query.LimitAndSort, interface{}) []types.Sequence); ok { - r0 = rf(ctx, contractName, filter, limitAndSort, sequenceDataType) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]types.Sequence) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, string, query.KeyFilter, query.LimitAndSort, interface{}) error); ok { - r1 = rf(ctx, contractName, filter, limitAndSort, sequenceDataType) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// Ready provides a mock function with given fields: -func (_m *ChainReader) Ready() error { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for Ready") - } - - var r0 error - if rf, ok := ret.Get(0).(func() error); ok { - r0 = rf() - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// Start provides a mock function with given fields: _a0 -func (_m *ChainReader) Start(_a0 context.Context) error { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for Start") - } - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// NewChainReader creates a new instance of ChainReader. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewChainReader(t interface { - mock.TestingT - Cleanup(func()) -}) *ChainReader { - mock := &ChainReader{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/core/capabilities/targets/mocks/chain_writer.go b/core/capabilities/targets/mocks/chain_writer.go index 0ee28c0777d..28eac87b21c 100644 --- a/core/capabilities/targets/mocks/chain_writer.go +++ b/core/capabilities/targets/mocks/chain_writer.go @@ -16,6 +16,14 @@ type ChainWriter struct { mock.Mock } +type ChainWriter_Expecter struct { + mock *mock.Mock +} + +func (_m *ChainWriter) EXPECT() *ChainWriter_Expecter { + return &ChainWriter_Expecter{mock: &_m.Mock} +} + // Close provides a mock function with given fields: func (_m *ChainWriter) Close() error { ret := _m.Called() @@ -34,6 +42,33 @@ func (_m *ChainWriter) Close() error { return r0 } +// ChainWriter_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close' +type ChainWriter_Close_Call struct { + *mock.Call +} + +// Close is a helper method to define mock.On call +func (_e *ChainWriter_Expecter) Close() *ChainWriter_Close_Call { + return &ChainWriter_Close_Call{Call: _e.mock.On("Close")} +} + +func (_c *ChainWriter_Close_Call) Run(run func()) *ChainWriter_Close_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ChainWriter_Close_Call) Return(_a0 error) *ChainWriter_Close_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ChainWriter_Close_Call) RunAndReturn(run func() error) *ChainWriter_Close_Call { + _c.Call.Return(run) + return _c +} + // GetFeeComponents provides a mock function with given fields: ctx func (_m *ChainWriter) GetFeeComponents(ctx context.Context) (*types.ChainFeeComponents, error) { ret := _m.Called(ctx) @@ -64,6 +99,34 @@ func (_m *ChainWriter) GetFeeComponents(ctx context.Context) (*types.ChainFeeCom return r0, r1 } +// ChainWriter_GetFeeComponents_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetFeeComponents' +type ChainWriter_GetFeeComponents_Call struct { + *mock.Call +} + +// GetFeeComponents is a helper method to define mock.On call +// - ctx context.Context +func (_e *ChainWriter_Expecter) GetFeeComponents(ctx interface{}) *ChainWriter_GetFeeComponents_Call { + return &ChainWriter_GetFeeComponents_Call{Call: _e.mock.On("GetFeeComponents", ctx)} +} + +func (_c *ChainWriter_GetFeeComponents_Call) Run(run func(ctx context.Context)) *ChainWriter_GetFeeComponents_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *ChainWriter_GetFeeComponents_Call) Return(_a0 *types.ChainFeeComponents, _a1 error) *ChainWriter_GetFeeComponents_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ChainWriter_GetFeeComponents_Call) RunAndReturn(run func(context.Context) (*types.ChainFeeComponents, error)) *ChainWriter_GetFeeComponents_Call { + _c.Call.Return(run) + return _c +} + // GetTransactionStatus provides a mock function with given fields: ctx, transactionID func (_m *ChainWriter) GetTransactionStatus(ctx context.Context, transactionID string) (types.TransactionStatus, error) { ret := _m.Called(ctx, transactionID) @@ -92,6 +155,35 @@ func (_m *ChainWriter) GetTransactionStatus(ctx context.Context, transactionID s return r0, r1 } +// ChainWriter_GetTransactionStatus_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetTransactionStatus' +type ChainWriter_GetTransactionStatus_Call struct { + *mock.Call +} + +// GetTransactionStatus is a helper method to define mock.On call +// - ctx context.Context +// - transactionID string +func (_e *ChainWriter_Expecter) GetTransactionStatus(ctx interface{}, transactionID interface{}) *ChainWriter_GetTransactionStatus_Call { + return &ChainWriter_GetTransactionStatus_Call{Call: _e.mock.On("GetTransactionStatus", ctx, transactionID)} +} + +func (_c *ChainWriter_GetTransactionStatus_Call) Run(run func(ctx context.Context, transactionID string)) *ChainWriter_GetTransactionStatus_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *ChainWriter_GetTransactionStatus_Call) Return(_a0 types.TransactionStatus, _a1 error) *ChainWriter_GetTransactionStatus_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ChainWriter_GetTransactionStatus_Call) RunAndReturn(run func(context.Context, string) (types.TransactionStatus, error)) *ChainWriter_GetTransactionStatus_Call { + _c.Call.Return(run) + return _c +} + // HealthReport provides a mock function with given fields: func (_m *ChainWriter) HealthReport() map[string]error { ret := _m.Called() @@ -112,6 +204,33 @@ func (_m *ChainWriter) HealthReport() map[string]error { return r0 } +// ChainWriter_HealthReport_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HealthReport' +type ChainWriter_HealthReport_Call struct { + *mock.Call +} + +// HealthReport is a helper method to define mock.On call +func (_e *ChainWriter_Expecter) HealthReport() *ChainWriter_HealthReport_Call { + return &ChainWriter_HealthReport_Call{Call: _e.mock.On("HealthReport")} +} + +func (_c *ChainWriter_HealthReport_Call) Run(run func()) *ChainWriter_HealthReport_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ChainWriter_HealthReport_Call) Return(_a0 map[string]error) *ChainWriter_HealthReport_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ChainWriter_HealthReport_Call) RunAndReturn(run func() map[string]error) *ChainWriter_HealthReport_Call { + _c.Call.Return(run) + return _c +} + // Name provides a mock function with given fields: func (_m *ChainWriter) Name() string { ret := _m.Called() @@ -130,6 +249,33 @@ func (_m *ChainWriter) Name() string { return r0 } +// ChainWriter_Name_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Name' +type ChainWriter_Name_Call struct { + *mock.Call +} + +// Name is a helper method to define mock.On call +func (_e *ChainWriter_Expecter) Name() *ChainWriter_Name_Call { + return &ChainWriter_Name_Call{Call: _e.mock.On("Name")} +} + +func (_c *ChainWriter_Name_Call) Run(run func()) *ChainWriter_Name_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ChainWriter_Name_Call) Return(_a0 string) *ChainWriter_Name_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ChainWriter_Name_Call) RunAndReturn(run func() string) *ChainWriter_Name_Call { + _c.Call.Return(run) + return _c +} + // Ready provides a mock function with given fields: func (_m *ChainWriter) Ready() error { ret := _m.Called() @@ -148,6 +294,33 @@ func (_m *ChainWriter) Ready() error { return r0 } +// ChainWriter_Ready_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Ready' +type ChainWriter_Ready_Call struct { + *mock.Call +} + +// Ready is a helper method to define mock.On call +func (_e *ChainWriter_Expecter) Ready() *ChainWriter_Ready_Call { + return &ChainWriter_Ready_Call{Call: _e.mock.On("Ready")} +} + +func (_c *ChainWriter_Ready_Call) Run(run func()) *ChainWriter_Ready_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ChainWriter_Ready_Call) Return(_a0 error) *ChainWriter_Ready_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ChainWriter_Ready_Call) RunAndReturn(run func() error) *ChainWriter_Ready_Call { + _c.Call.Return(run) + return _c +} + // Start provides a mock function with given fields: _a0 func (_m *ChainWriter) Start(_a0 context.Context) error { ret := _m.Called(_a0) @@ -166,6 +339,34 @@ func (_m *ChainWriter) Start(_a0 context.Context) error { return r0 } +// ChainWriter_Start_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Start' +type ChainWriter_Start_Call struct { + *mock.Call +} + +// Start is a helper method to define mock.On call +// - _a0 context.Context +func (_e *ChainWriter_Expecter) Start(_a0 interface{}) *ChainWriter_Start_Call { + return &ChainWriter_Start_Call{Call: _e.mock.On("Start", _a0)} +} + +func (_c *ChainWriter_Start_Call) Run(run func(_a0 context.Context)) *ChainWriter_Start_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *ChainWriter_Start_Call) Return(_a0 error) *ChainWriter_Start_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ChainWriter_Start_Call) RunAndReturn(run func(context.Context) error) *ChainWriter_Start_Call { + _c.Call.Return(run) + return _c +} + // SubmitTransaction provides a mock function with given fields: ctx, contractName, method, args, transactionID, toAddress, meta, value func (_m *ChainWriter) SubmitTransaction(ctx context.Context, contractName string, method string, args interface{}, transactionID string, toAddress string, meta *types.TxMeta, value *big.Int) error { ret := _m.Called(ctx, contractName, method, args, transactionID, toAddress, meta, value) @@ -184,6 +385,41 @@ func (_m *ChainWriter) SubmitTransaction(ctx context.Context, contractName strin return r0 } +// ChainWriter_SubmitTransaction_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SubmitTransaction' +type ChainWriter_SubmitTransaction_Call struct { + *mock.Call +} + +// SubmitTransaction is a helper method to define mock.On call +// - ctx context.Context +// - contractName string +// - method string +// - args interface{} +// - transactionID string +// - toAddress string +// - meta *types.TxMeta +// - value *big.Int +func (_e *ChainWriter_Expecter) SubmitTransaction(ctx interface{}, contractName interface{}, method interface{}, args interface{}, transactionID interface{}, toAddress interface{}, meta interface{}, value interface{}) *ChainWriter_SubmitTransaction_Call { + return &ChainWriter_SubmitTransaction_Call{Call: _e.mock.On("SubmitTransaction", ctx, contractName, method, args, transactionID, toAddress, meta, value)} +} + +func (_c *ChainWriter_SubmitTransaction_Call) Run(run func(ctx context.Context, contractName string, method string, args interface{}, transactionID string, toAddress string, meta *types.TxMeta, value *big.Int)) *ChainWriter_SubmitTransaction_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string), args[3].(interface{}), args[4].(string), args[5].(string), args[6].(*types.TxMeta), args[7].(*big.Int)) + }) + return _c +} + +func (_c *ChainWriter_SubmitTransaction_Call) Return(_a0 error) *ChainWriter_SubmitTransaction_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ChainWriter_SubmitTransaction_Call) RunAndReturn(run func(context.Context, string, string, interface{}, string, string, *types.TxMeta, *big.Int) error) *ChainWriter_SubmitTransaction_Call { + _c.Call.Return(run) + return _c +} + // NewChainWriter creates a new instance of ChainWriter. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewChainWriter(t interface { diff --git a/core/capabilities/targets/mocks/contract_value_getter.go b/core/capabilities/targets/mocks/contract_value_getter.go new file mode 100644 index 00000000000..2621de45876 --- /dev/null +++ b/core/capabilities/targets/mocks/contract_value_getter.go @@ -0,0 +1,136 @@ +// Code generated by mockery v2.43.2. DO NOT EDIT. + +package mocks + +import ( + context "context" + + primitives "github.com/smartcontractkit/chainlink-common/pkg/types/query/primitives" + mock "github.com/stretchr/testify/mock" + + types "github.com/smartcontractkit/chainlink-common/pkg/types" +) + +// ContractValueGetter is an autogenerated mock type for the ContractValueGetter type +type ContractValueGetter struct { + mock.Mock +} + +type ContractValueGetter_Expecter struct { + mock *mock.Mock +} + +func (_m *ContractValueGetter) EXPECT() *ContractValueGetter_Expecter { + return &ContractValueGetter_Expecter{mock: &_m.Mock} +} + +// Bind provides a mock function with given fields: _a0, _a1 +func (_m *ContractValueGetter) Bind(_a0 context.Context, _a1 []types.BoundContract) error { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for Bind") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, []types.BoundContract) error); ok { + r0 = rf(_a0, _a1) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// ContractValueGetter_Bind_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Bind' +type ContractValueGetter_Bind_Call struct { + *mock.Call +} + +// Bind is a helper method to define mock.On call +// - _a0 context.Context +// - _a1 []types.BoundContract +func (_e *ContractValueGetter_Expecter) Bind(_a0 interface{}, _a1 interface{}) *ContractValueGetter_Bind_Call { + return &ContractValueGetter_Bind_Call{Call: _e.mock.On("Bind", _a0, _a1)} +} + +func (_c *ContractValueGetter_Bind_Call) Run(run func(_a0 context.Context, _a1 []types.BoundContract)) *ContractValueGetter_Bind_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].([]types.BoundContract)) + }) + return _c +} + +func (_c *ContractValueGetter_Bind_Call) Return(_a0 error) *ContractValueGetter_Bind_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ContractValueGetter_Bind_Call) RunAndReturn(run func(context.Context, []types.BoundContract) error) *ContractValueGetter_Bind_Call { + _c.Call.Return(run) + return _c +} + +// GetLatestValue provides a mock function with given fields: _a0, _a1, _a2, _a3, _a4 +func (_m *ContractValueGetter) GetLatestValue(_a0 context.Context, _a1 string, _a2 primitives.ConfidenceLevel, _a3 interface{}, _a4 interface{}) error { + ret := _m.Called(_a0, _a1, _a2, _a3, _a4) + + if len(ret) == 0 { + panic("no return value specified for GetLatestValue") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, string, primitives.ConfidenceLevel, interface{}, interface{}) error); ok { + r0 = rf(_a0, _a1, _a2, _a3, _a4) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// ContractValueGetter_GetLatestValue_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetLatestValue' +type ContractValueGetter_GetLatestValue_Call struct { + *mock.Call +} + +// GetLatestValue is a helper method to define mock.On call +// - _a0 context.Context +// - _a1 string +// - _a2 primitives.ConfidenceLevel +// - _a3 interface{} +// - _a4 interface{} +func (_e *ContractValueGetter_Expecter) GetLatestValue(_a0 interface{}, _a1 interface{}, _a2 interface{}, _a3 interface{}, _a4 interface{}) *ContractValueGetter_GetLatestValue_Call { + return &ContractValueGetter_GetLatestValue_Call{Call: _e.mock.On("GetLatestValue", _a0, _a1, _a2, _a3, _a4)} +} + +func (_c *ContractValueGetter_GetLatestValue_Call) Run(run func(_a0 context.Context, _a1 string, _a2 primitives.ConfidenceLevel, _a3 interface{}, _a4 interface{})) *ContractValueGetter_GetLatestValue_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(primitives.ConfidenceLevel), args[3].(interface{}), args[4].(interface{})) + }) + return _c +} + +func (_c *ContractValueGetter_GetLatestValue_Call) Return(_a0 error) *ContractValueGetter_GetLatestValue_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ContractValueGetter_GetLatestValue_Call) RunAndReturn(run func(context.Context, string, primitives.ConfidenceLevel, interface{}, interface{}) error) *ContractValueGetter_GetLatestValue_Call { + _c.Call.Return(run) + return _c +} + +// NewContractValueGetter creates a new instance of ContractValueGetter. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewContractValueGetter(t interface { + mock.TestingT + Cleanup(func()) +}) *ContractValueGetter { + mock := &ContractValueGetter{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/core/capabilities/targets/write_target.go b/core/capabilities/targets/write_target.go index f178beb5224..0e0b2071829 100644 --- a/core/capabilities/targets/write_target.go +++ b/core/capabilities/targets/write_target.go @@ -1,7 +1,9 @@ package targets import ( + "bytes" "context" + "encoding/binary" "encoding/hex" "fmt" "math/big" @@ -11,137 +13,260 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/capabilities" "github.com/smartcontractkit/chainlink-common/pkg/capabilities/consensus/ocr3/types" + "github.com/smartcontractkit/chainlink-common/pkg/logger" commontypes "github.com/smartcontractkit/chainlink-common/pkg/types" - "github.com/smartcontractkit/chainlink-common/pkg/values" - "github.com/smartcontractkit/chainlink/v2/core/logger" + "github.com/smartcontractkit/chainlink-common/pkg/types/query/primitives" ) var ( - _ capabilities.ActionCapability = &WriteTarget{} + _ capabilities.TargetCapability = &WriteTarget{} ) -// required field of target's config in the workflow spec -const signedReportField = "signed_report" - type WriteTarget struct { - cr commontypes.ContractReader + cr ContractValueGetter cw commontypes.ChainWriter + binding commontypes.BoundContract forwarderAddress string + // The minimum amount of gas that the receiver contract must get to process the forwarder report + receiverGasMinimum uint64 capabilities.CapabilityInfo + lggr logger.Logger bound bool } -func NewWriteTarget(lggr logger.Logger, id string, cr commontypes.ContractReader, cw commontypes.ChainWriter, forwarderAddress string) *WriteTarget { +type TransmissionInfo struct { + GasLimit *big.Int + InvalidReceiver bool + State uint8 + Success bool + TransmissionId [32]byte + Transmitter common.Address +} + +// The gas cost of the forwarder contract logic, including state updates and event emission. +// This is a rough estimate and should be updated if the forwarder contract logic changes. +// TODO: Make this part of the on-chain capability configuration +const ForwarderContractLogicGasCost = 100_000 + +type ContractValueGetter interface { + Bind(context.Context, []commontypes.BoundContract) error + GetLatestValue(context.Context, string, primitives.ConfidenceLevel, any, any) error +} + +func NewWriteTarget( + lggr logger.Logger, + id string, + cr ContractValueGetter, + cw commontypes.ChainWriter, + forwarderAddress string, + txGasLimit uint64, +) *WriteTarget { info := capabilities.MustNewCapabilityInfo( id, capabilities.CapabilityTypeTarget, "Write target.", ) - logger := lggr.Named("WriteTarget") - return &WriteTarget{ cr, cw, + commontypes.BoundContract{ + Address: forwarderAddress, + Name: "forwarder", + }, forwarderAddress, + txGasLimit - ForwarderContractLogicGasCost, info, - logger, + logger.Named(lggr, "WriteTarget"), false, } } -type EvmConfig struct { - Address string +// Note: This should be a shared type that the OCR3 package validates as well +type ReportV1Metadata struct { + Version uint8 + WorkflowExecutionID [32]byte + Timestamp uint32 + DonID uint32 + DonConfigVersion uint32 + WorkflowCID [32]byte + WorkflowName [10]byte + WorkflowOwner [20]byte + ReportID [2]byte } -func parseConfig(rawConfig *values.Map) (config EvmConfig, err error) { - if err := rawConfig.UnwrapTo(&config); err != nil { - return config, err +func (rm ReportV1Metadata) Encode() ([]byte, error) { + buf := new(bytes.Buffer) + err := binary.Write(buf, binary.BigEndian, rm) + if err != nil { + return nil, err + } + return buf.Bytes(), nil +} + +func (rm ReportV1Metadata) Length() int { + bytes, err := rm.Encode() + if err != nil { + return 0 } - if !common.IsHexAddress(config.Address) { - return config, fmt.Errorf("'%v' is not a valid address", config.Address) + return len(bytes) +} + +func decodeReportMetadata(data []byte) (metadata ReportV1Metadata, err error) { + if len(data) < metadata.Length() { + return metadata, fmt.Errorf("data too short: %d bytes", len(data)) } - return config, nil + return metadata, binary.Read(bytes.NewReader(data[:metadata.Length()]), binary.BigEndian, &metadata) } -func success() <-chan capabilities.CapabilityResponse { - callback := make(chan capabilities.CapabilityResponse) - go func() { - callback <- capabilities.CapabilityResponse{} - close(callback) - }() - return callback +type Config struct { + // Address of the contract that will get the forwarded report + Address string + // Optional gas limit that overrides the default limit sent to the chain writer + GasLimit *uint64 } -func (cap *WriteTarget) Execute(ctx context.Context, request capabilities.CapabilityRequest) (<-chan capabilities.CapabilityResponse, error) { +type Inputs struct { + SignedReport types.SignedReport +} + +type Request struct { + Metadata capabilities.RequestMetadata + Config Config + Inputs Inputs +} + +func evaluate(rawRequest capabilities.CapabilityRequest) (r Request, err error) { + r.Metadata = rawRequest.Metadata + + if rawRequest.Config == nil { + return r, fmt.Errorf("missing config field") + } + + if err = rawRequest.Config.UnwrapTo(&r.Config); err != nil { + return r, err + } + + if !common.IsHexAddress(r.Config.Address) { + return r, fmt.Errorf("'%v' is not a valid address", r.Config.Address) + } + + if rawRequest.Inputs == nil { + return r, fmt.Errorf("missing inputs field") + } + + // required field of target's config in the workflow spec + const signedReportField = "signed_report" + signedReport, ok := rawRequest.Inputs.Underlying[signedReportField] + if !ok { + return r, fmt.Errorf("missing required field %s", signedReportField) + } + + if err = signedReport.UnwrapTo(&r.Inputs.SignedReport); err != nil { + return r, err + } + + reportMetadata, err := decodeReportMetadata(r.Inputs.SignedReport.Report) + if err != nil { + return r, err + } + + if reportMetadata.Version != 1 { + return r, fmt.Errorf("unsupported report version: %d", reportMetadata.Version) + } + + if hex.EncodeToString(reportMetadata.WorkflowExecutionID[:]) != rawRequest.Metadata.WorkflowExecutionID { + return r, fmt.Errorf("WorkflowExecutionID in the report does not match WorkflowExecutionID in the request metadata. Report WorkflowExecutionID: %+v, request WorkflowExecutionID: %+v", reportMetadata.WorkflowExecutionID, rawRequest.Metadata.WorkflowExecutionID) + } + + if hex.EncodeToString(reportMetadata.WorkflowOwner[:]) != rawRequest.Metadata.WorkflowOwner { + return r, fmt.Errorf("WorkflowOwner in the report does not match WorkflowOwner in the request metadata. Report WorkflowOwner: %+v, request WorkflowOwner: %+v", reportMetadata.WorkflowOwner, rawRequest.Metadata.WorkflowOwner) + } + + if hex.EncodeToString(reportMetadata.WorkflowName[:]) != rawRequest.Metadata.WorkflowName { + return r, fmt.Errorf("WorkflowName in the report does not match WorkflowName in the request metadata. Report WorkflowName: %+v, request WorkflowName: %+v", reportMetadata.WorkflowName, rawRequest.Metadata.WorkflowName) + } + + if hex.EncodeToString(reportMetadata.WorkflowCID[:]) != rawRequest.Metadata.WorkflowID { + return r, fmt.Errorf("WorkflowID in the report does not match WorkflowID in the request metadata. Report WorkflowID: %+v, request WorkflowID: %+v", reportMetadata.WorkflowCID, rawRequest.Metadata.WorkflowID) + } + + if !bytes.Equal(reportMetadata.ReportID[:], r.Inputs.SignedReport.ID) { + return r, fmt.Errorf("ReportID in the report does not match ReportID in the inputs. reportMetadata.ReportID: %x, Inputs.SignedReport.ID: %x", reportMetadata.ReportID, r.Inputs.SignedReport.ID) + } + + return r, nil +} + +func (cap *WriteTarget) Execute(ctx context.Context, rawRequest capabilities.CapabilityRequest) (capabilities.CapabilityResponse, error) { // Bind to the contract address on the write path. // Bind() requires a connection to the node's RPCs and // cannot be run during initialization. if !cap.bound { cap.lggr.Debugw("Binding to forwarder address") - err := cap.cr.Bind(ctx, []commontypes.BoundContract{{ - Address: cap.forwarderAddress, - Name: "forwarder", - }}) + err := cap.cr.Bind(ctx, []commontypes.BoundContract{cap.binding}) if err != nil { - return nil, err + return capabilities.CapabilityResponse{}, err } cap.bound = true } - cap.lggr.Debugw("Execute", "request", request) + cap.lggr.Debugw("Execute", "rawRequest", rawRequest) - reqConfig, err := parseConfig(request.Config) + request, err := evaluate(rawRequest) if err != nil { - return nil, err - } - - signedReport, ok := request.Inputs.Underlying[signedReportField] - if !ok { - return nil, fmt.Errorf("missing required field %s", signedReportField) - } - - inputs := types.SignedReport{} - if err = signedReport.UnwrapTo(&inputs); err != nil { - return nil, err - } - - if len(inputs.Report) == 0 { - // We received any empty report -- this means we should skip transmission. - cap.lggr.Debugw("Skipping empty report", "request", request) - return success(), nil + return capabilities.CapabilityResponse{}, err } - // TODO: validate encoded report is prefixed with workflowID and executionID that match the request meta rawExecutionID, err := hex.DecodeString(request.Metadata.WorkflowExecutionID) if err != nil { - return nil, err + return capabilities.CapabilityResponse{}, err } + // Check whether value was already transmitted on chain queryInputs := struct { Receiver string WorkflowExecutionID []byte ReportId []byte }{ - Receiver: reqConfig.Address, + Receiver: request.Config.Address, WorkflowExecutionID: rawExecutionID, - ReportId: inputs.ID, + ReportId: request.Inputs.SignedReport.ID, } - var transmitter common.Address - if err = cap.cr.GetLatestValue(ctx, "forwarder", "getTransmitter", queryInputs, &transmitter); err != nil { - return nil, err + var transmissionInfo TransmissionInfo + if err = cap.cr.GetLatestValue(ctx, cap.binding.ReadIdentifier("getTransmissionInfo"), primitives.Unconfirmed, queryInputs, &transmissionInfo); err != nil { + return capabilities.CapabilityResponse{}, fmt.Errorf("failed to getTransmissionInfo latest value: %w", err) } - if transmitter != common.HexToAddress("0x0") { - cap.lggr.Infow("WriteTarget report already onchain - returning without a tranmission attempt", "executionID", request.Metadata.WorkflowExecutionID) - return success(), nil + + switch { + case transmissionInfo.State == 0: // NOT_ATTEMPTED + cap.lggr.Infow("non-empty report - transmission not attempted - attempting to push to txmgr", "request", request, "reportLen", len(request.Inputs.SignedReport.Report), "reportContextLen", len(request.Inputs.SignedReport.Context), "nSignatures", len(request.Inputs.SignedReport.Signatures), "executionID", request.Metadata.WorkflowExecutionID) + case transmissionInfo.State == 1: // SUCCEEDED + cap.lggr.Infow("returning without a transmission attempt - report already onchain ", "executionID", request.Metadata.WorkflowExecutionID) + return capabilities.CapabilityResponse{}, nil + case transmissionInfo.State == 2: // INVALID_RECEIVER + cap.lggr.Infow("returning without a transmission attempt - transmission already attempted, receiver was marked as invalid", "executionID", request.Metadata.WorkflowExecutionID) + return capabilities.CapabilityResponse{}, nil + case transmissionInfo.State == 3: // FAILED + receiverGasMinimum := cap.receiverGasMinimum + if request.Config.GasLimit != nil { + receiverGasMinimum = *request.Config.GasLimit - ForwarderContractLogicGasCost + } + if transmissionInfo.GasLimit.Uint64() > receiverGasMinimum { + cap.lggr.Infow("returning without a transmission attempt - transmission already attempted and failed, sufficient gas was provided", "executionID", request.Metadata.WorkflowExecutionID, "receiverGasMinimum", receiverGasMinimum, "transmissionGasLimit", transmissionInfo.GasLimit) + return capabilities.CapabilityResponse{}, nil + } else { + cap.lggr.Infow("non-empty report - retrying a failed transmission - attempting to push to txmgr", "request", request, "reportLen", len(request.Inputs.SignedReport.Report), "reportContextLen", len(request.Inputs.SignedReport.Context), "nSignatures", len(request.Inputs.SignedReport.Signatures), "executionID", request.Metadata.WorkflowExecutionID, "receiverGasMinimum", receiverGasMinimum, "transmissionGasLimit", transmissionInfo.GasLimit) + } + default: + return capabilities.CapabilityResponse{}, fmt.Errorf("unexpected transmission state: %v", transmissionInfo.State) } - cap.lggr.Infow("WriteTarget non-empty report - attempting to push to txmgr", "request", request, "reportLen", len(inputs.Report), "reportContextLen", len(inputs.Context), "nSignatures", len(inputs.Signatures), "executionID", request.Metadata.WorkflowExecutionID) txID, err := uuid.NewUUID() // NOTE: CW expects us to generate an ID, rather than return one if err != nil { - return nil, err + return capabilities.CapabilityResponse{}, err } // Note: The codec that ChainWriter uses to encode the parameters for the contract ABI cannot handle @@ -152,7 +277,7 @@ func (cap *WriteTarget) Execute(ctx context.Context, request capabilities.Capabi RawReport []byte ReportContext []byte Signatures [][]byte - }{reqConfig.Address, inputs.Report, inputs.Context, inputs.Signatures} + }{request.Config.Address, request.Inputs.SignedReport.Report, request.Inputs.SignedReport.Context, request.Inputs.SignedReport.Signatures} if req.RawReport == nil { req.RawReport = make([]byte, 0) @@ -168,12 +293,23 @@ func (cap *WriteTarget) Execute(ctx context.Context, request capabilities.Capabi cap.lggr.Debugw("Transaction raw report", "report", hex.EncodeToString(req.RawReport)) meta := commontypes.TxMeta{WorkflowExecutionID: &request.Metadata.WorkflowExecutionID} + if request.Config.GasLimit != nil { + meta.GasLimit = new(big.Int).SetUint64(*request.Config.GasLimit) + } + value := big.NewInt(0) if err := cap.cw.SubmitTransaction(ctx, "forwarder", "report", req, txID.String(), cap.forwarderAddress, &meta, value); err != nil { - return nil, err + if !commontypes.ErrSettingTransactionGasLimitNotSupported.Is(err) { + return capabilities.CapabilityResponse{}, fmt.Errorf("failed to submit transaction: %w", err) + } + meta.GasLimit = nil + if err := cap.cw.SubmitTransaction(ctx, "forwarder", "report", req, txID.String(), cap.forwarderAddress, &meta, value); err != nil { + return capabilities.CapabilityResponse{}, fmt.Errorf("failed to submit transaction: %w", err) + } } + cap.lggr.Debugw("Transaction submitted", "request", request, "transaction", txID) - return success(), nil + return capabilities.CapabilityResponse{}, nil } func (cap *WriteTarget) RegisterToWorkflow(ctx context.Context, request capabilities.RegisterToWorkflowRequest) error { diff --git a/core/capabilities/targets/write_target_test.go b/core/capabilities/targets/write_target_test.go index 9a752b79483..96df31bd3cc 100644 --- a/core/capabilities/targets/write_target_test.go +++ b/core/capabilities/targets/write_target_test.go @@ -2,7 +2,9 @@ package targets_test import ( "context" + "encoding/hex" "errors" + "math/big" "testing" "github.com/ethereum/go-ethereum/common" @@ -12,27 +14,26 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/capabilities" "github.com/smartcontractkit/chainlink-common/pkg/types" + "github.com/smartcontractkit/chainlink-common/pkg/types/query/primitives" "github.com/smartcontractkit/chainlink-common/pkg/values" + "github.com/smartcontractkit/chainlink/v2/core/capabilities/targets" "github.com/smartcontractkit/chainlink/v2/core/capabilities/targets/mocks" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/logger" ) -//go:generate mockery --quiet --name ChainWriter --srcpkg=github.com/smartcontractkit/chainlink-common/pkg/types --output ./mocks/ --case=underscore -//go:generate mockery --quiet --name ChainReader --srcpkg=github.com/smartcontractkit/chainlink-common/pkg/types --output ./mocks/ --case=underscore - func TestWriteTarget(t *testing.T) { lggr := logger.TestLogger(t) ctx := context.Background() cw := mocks.NewChainWriter(t) - cr := mocks.NewChainReader(t) + cr := mocks.NewContractValueGetter(t) forwarderA := testutils.NewAddress() forwarderAddr := forwarderA.Hex() - writeTarget := targets.NewWriteTarget(lggr, "test-write-target@1.0.0", cr, cw, forwarderAddr) + writeTarget := targets.NewWriteTarget(lggr, "test-write-target@1.0.0", cr, cw, forwarderAddr, 400_000) require.NotNil(t, writeTarget) config, err := values.NewMap(map[string]any{ @@ -40,99 +41,151 @@ func TestWriteTarget(t *testing.T) { }) require.NoError(t, err) + reportID := [2]byte{0x00, 0x01} + reportMetadata := targets.ReportV1Metadata{ + Version: 1, + WorkflowExecutionID: [32]byte{}, + Timestamp: 0, + DonID: 0, + DonConfigVersion: 0, + WorkflowCID: [32]byte{}, + WorkflowName: [10]byte{}, + WorkflowOwner: [20]byte{}, + ReportID: reportID, + } + + reportMetadataBytes, err := reportMetadata.Encode() + require.NoError(t, err) + validInputs, err := values.NewMap(map[string]any{ "signed_report": map[string]any{ - "report": []byte{1, 2, 3}, + "report": reportMetadataBytes, "signatures": [][]byte{}, + "context": []byte{4, 5}, + "id": reportID[:], }, }) require.NoError(t, err) - cr.On("Bind", mock.Anything, []types.BoundContract{ - { - Address: forwarderAddr, - Name: "forwarder", - }, - }).Return(nil) - - cr.On("GetLatestValue", mock.Anything, "forwarder", "getTransmitter", mock.Anything, mock.Anything).Return(nil).Run(func(args mock.Arguments) { - transmitter := args.Get(4).(*common.Address) - *transmitter = common.HexToAddress("0x0") - }).Once() + validMetadata := capabilities.RequestMetadata{ + WorkflowID: hex.EncodeToString(reportMetadata.WorkflowCID[:]), + WorkflowOwner: hex.EncodeToString(reportMetadata.WorkflowOwner[:]), + WorkflowName: hex.EncodeToString(reportMetadata.WorkflowName[:]), + WorkflowExecutionID: hex.EncodeToString(reportMetadata.WorkflowExecutionID[:]), + } + + binding := types.BoundContract{ + Address: forwarderAddr, + Name: "forwarder", + } + + cr.On("Bind", mock.Anything, []types.BoundContract{binding}).Return(nil) + + cr.EXPECT().GetLatestValue(mock.Anything, binding.ReadIdentifier("getTransmissionInfo"), mock.Anything, mock.Anything, mock.Anything).Return(nil).Run(func(_ context.Context, _ string, _ primitives.ConfidenceLevel, _, retVal any) { + transmissionInfo := retVal.(*targets.TransmissionInfo) + *transmissionInfo = targets.TransmissionInfo{ + GasLimit: big.NewInt(0), + InvalidReceiver: false, + State: 0, + Success: false, + TransmissionId: [32]byte{}, + Transmitter: common.HexToAddress("0x0"), + } + }) cw.On("SubmitTransaction", mock.Anything, "forwarder", "report", mock.Anything, mock.Anything, forwarderAddr, mock.Anything, mock.Anything).Return(nil).Once() t.Run("succeeds with valid report", func(t *testing.T) { req := capabilities.CapabilityRequest{ - Metadata: capabilities.RequestMetadata{ - WorkflowID: "test-id", - }, - Config: config, - Inputs: validInputs, + Metadata: validMetadata, + Config: config, + Inputs: validInputs, } - ch, err2 := writeTarget.Execute(ctx, req) + response, err2 := writeTarget.Execute(ctx, req) require.NoError(t, err2) - response := <-ch require.NotNil(t, response) }) - t.Run("succeeds with empty report", func(t *testing.T) { - emptyInputs, err2 := values.NewMap(map[string]any{ - "signed_report": map[string]any{ - "report": []byte{}, - }, - "signatures": [][]byte{}, - }) + t.Run("fails when ChainWriter's SubmitTransaction returns error", func(t *testing.T) { + req := capabilities.CapabilityRequest{ + Metadata: validMetadata, + Config: config, + Inputs: validInputs, + } + cw.On("SubmitTransaction", mock.Anything, "forwarder", "report", mock.Anything, mock.Anything, forwarderAddr, mock.Anything, mock.Anything).Return(errors.New("writer error")) - require.NoError(t, err2) + _, err = writeTarget.Execute(ctx, req) + require.Error(t, err) + }) + + t.Run("passes gas limit set on config to the chain writer", func(t *testing.T) { + configGasLimit, err := values.NewMap(map[string]any{ + "Address": forwarderAddr, + "GasLimit": 500000, + }) + require.NoError(t, err) req := capabilities.CapabilityRequest{ - Metadata: capabilities.RequestMetadata{ - WorkflowExecutionID: "test-id", - }, - Config: config, - Inputs: emptyInputs, + Metadata: validMetadata, + Config: configGasLimit, + Inputs: validInputs, } - ch, err2 := writeTarget.Execute(ctx, req) - require.NoError(t, err2) - response := <-ch - require.Nil(t, response.Value) + meta := types.TxMeta{WorkflowExecutionID: &req.Metadata.WorkflowExecutionID, GasLimit: big.NewInt(500000)} + cw.On("SubmitTransaction", mock.Anything, "forwarder", "report", mock.Anything, mock.Anything, forwarderAddr, &meta, mock.Anything).Return(types.ErrSettingTransactionGasLimitNotSupported) + + _, err2 := writeTarget.Execute(ctx, req) + require.Error(t, err2) }) - t.Run("fails when ChainReader's GetLatestValue returns error", func(t *testing.T) { + t.Run("retries without gas limit when ChainWriter's SubmitTransaction returns error due to gas limit not supported", func(t *testing.T) { + configGasLimit, err := values.NewMap(map[string]any{ + "Address": forwarderAddr, + "GasLimit": 500000, + }) + require.NoError(t, err) req := capabilities.CapabilityRequest{ - Metadata: capabilities.RequestMetadata{ - WorkflowID: "test-id", - }, - Config: config, - Inputs: validInputs, + Metadata: validMetadata, + Config: configGasLimit, + Inputs: validInputs, } - cr.On("GetLatestValue", mock.Anything, "forwarder", "getTransmitter", mock.Anything, mock.Anything).Return(errors.New("reader error")) - _, err = writeTarget.Execute(ctx, req) - require.Error(t, err) + meta := types.TxMeta{WorkflowExecutionID: &req.Metadata.WorkflowExecutionID, GasLimit: big.NewInt(500000)} + cw.On("SubmitTransaction", mock.Anything, "forwarder", "report", mock.Anything, mock.Anything, forwarderAddr, &meta, mock.Anything).Return(types.ErrSettingTransactionGasLimitNotSupported) + meta = types.TxMeta{WorkflowExecutionID: &req.Metadata.WorkflowExecutionID} + cw.On("SubmitTransaction", mock.Anything, "forwarder", "report", mock.Anything, mock.Anything, forwarderAddr, &meta, mock.Anything).Return(nil) + + configGasLimit, err = values.NewMap(map[string]any{ + "Address": forwarderAddr, + }) + require.NoError(t, err) + req = capabilities.CapabilityRequest{ + Metadata: validMetadata, + Config: configGasLimit, + Inputs: validInputs, + } + + _, err2 := writeTarget.Execute(ctx, req) + require.Error(t, err2) }) - t.Run("fails when ChainWriter's SubmitTransaction returns error", func(t *testing.T) { + t.Run("fails when ChainReader's GetLatestValue returns error", func(t *testing.T) { req := capabilities.CapabilityRequest{ - Metadata: capabilities.RequestMetadata{ - WorkflowID: "test-id", - }, - Config: config, - Inputs: validInputs, + Metadata: validMetadata, + Config: config, + Inputs: validInputs, } - cw.On("SubmitTransaction", mock.Anything, "forwarder", "report", mock.Anything, mock.Anything, forwarderAddr, mock.Anything, mock.Anything).Return(errors.New("writer error")) + cr.EXPECT().GetLatestValue(mock.Anything, binding.ReadIdentifier("getTransmissionInfo"), mock.Anything, mock.Anything, mock.Anything).Return(errors.New("reader error")) _, err = writeTarget.Execute(ctx, req) require.Error(t, err) }) t.Run("fails with invalid config", func(t *testing.T) { - invalidConfig, err := values.NewMap(map[string]any{ + invalidConfig, err2 := values.NewMap(map[string]any{ "Address": "invalid-address", }) - require.NoError(t, err) + require.NoError(t, err2) req := capabilities.CapabilityRequest{ Metadata: capabilities.RequestMetadata{ @@ -141,7 +194,27 @@ func TestWriteTarget(t *testing.T) { Config: invalidConfig, Inputs: validInputs, } - _, err = writeTarget.Execute(ctx, req) - require.Error(t, err) + _, err2 = writeTarget.Execute(ctx, req) + require.Error(t, err2) + }) + + t.Run("fails with nil config", func(t *testing.T) { + req := capabilities.CapabilityRequest{ + Metadata: validMetadata, + Config: nil, + Inputs: validInputs, + } + _, err2 := writeTarget.Execute(ctx, req) + require.Error(t, err2) + }) + + t.Run("fails with nil inputs", func(t *testing.T) { + req := capabilities.CapabilityRequest{ + Metadata: validMetadata, + Config: config, + Inputs: nil, + } + _, err2 := writeTarget.Execute(ctx, req) + require.Error(t, err2) }) } diff --git a/core/capabilities/transmission/local_target_capability.go b/core/capabilities/transmission/local_target_capability.go index 1240d3a0e7f..637aea4523f 100644 --- a/core/capabilities/transmission/local_target_capability.go +++ b/core/capabilities/transmission/local_target_capability.go @@ -27,7 +27,7 @@ func NewLocalTargetCapability(lggr logger.Logger, capabilityID string, localDON } } -func (l *LocalTargetCapability) Execute(ctx context.Context, req capabilities.CapabilityRequest) (<-chan capabilities.CapabilityResponse, error) { +func (l *LocalTargetCapability) Execute(ctx context.Context, req capabilities.CapabilityRequest) (capabilities.CapabilityResponse, error) { if l.localNode.PeerID == nil || l.localNode.WorkflowDON.ID == 0 { l.lggr.Debugf("empty DON info, executing immediately") return l.TargetCapability.Execute(ctx, req) @@ -40,17 +40,17 @@ func (l *LocalTargetCapability) Execute(ctx context.Context, req capabilities.Ca peerIDToTransmissionDelay, err := GetPeerIDToTransmissionDelay(l.localNode.WorkflowDON.Members, req) if err != nil { - return nil, fmt.Errorf("capability id: %s failed to get peer ID to transmission delay map: %w", l.capabilityID, err) + return capabilities.CapabilityResponse{}, fmt.Errorf("capability id: %s failed to get peer ID to transmission delay map: %w", l.capabilityID, err) } delay, existsForPeerID := peerIDToTransmissionDelay[*l.localNode.PeerID] if !existsForPeerID { - return nil, nil + return capabilities.CapabilityResponse{}, nil } select { case <-ctx.Done(): - return nil, ctx.Err() + return capabilities.CapabilityResponse{}, ctx.Err() case <-time.After(delay): return l.TargetCapability.Execute(ctx, req) } diff --git a/core/capabilities/transmission/local_target_capability_test.go b/core/capabilities/transmission/local_target_capability_test.go index 93bf708ccef..67f22753bda 100644 --- a/core/capabilities/transmission/local_target_capability_test.go +++ b/core/capabilities/transmission/local_target_capability_test.go @@ -54,8 +54,8 @@ func TestScheduledExecutionStrategy_LocalDON(t *testing.T) { name: "position 0; oneAtATime", position: 0, schedule: "oneAtATime", - low: 300 * time.Millisecond, - high: 400 * time.Millisecond, + low: 200 * time.Millisecond, + high: 300 * time.Millisecond, }, { name: "position 1; oneAtATime", @@ -68,15 +68,15 @@ func TestScheduledExecutionStrategy_LocalDON(t *testing.T) { name: "position 2; oneAtATime", position: 2, schedule: "oneAtATime", - low: 0 * time.Millisecond, - high: 100 * time.Millisecond, + low: 300 * time.Millisecond, + high: 400 * time.Millisecond, }, { name: "position 3; oneAtATime", position: 3, schedule: "oneAtATime", - low: 100 * time.Millisecond, - high: 300 * time.Millisecond, + low: 0 * time.Millisecond, + high: 100 * time.Millisecond, }, { name: "position 0; allAtOnce", @@ -121,8 +121,8 @@ func TestScheduledExecutionStrategy_LocalDON(t *testing.T) { req := capabilities.CapabilityRequest{ Config: m, Metadata: capabilities.RequestMetadata{ - WorkflowID: "mock-workflow-id", - WorkflowExecutionID: "mock-execution-id-1", + WorkflowID: "15c631d295ef5e32deb99a10ee6804bc4af13855687559d7ff6552ac6dbb2ce0", + WorkflowExecutionID: "32c631d295ef5e32deb99a10ee6804bc4af13855687559d7ff6552ac6dbb2ce1", }, } @@ -162,7 +162,7 @@ func randKey() [32]byte { type mockCapability struct { capabilities.CapabilityInfo - capabilities.CallbackExecutable + capabilities.Executable response chan capabilities.CapabilityResponse transform func(capabilities.CapabilityRequest) (capabilities.CapabilityResponse, error) } @@ -175,18 +175,14 @@ func newMockCapability(info capabilities.CapabilityInfo, transform func(capabili } } -func (m *mockCapability) Execute(ctx context.Context, req capabilities.CapabilityRequest) (<-chan capabilities.CapabilityResponse, error) { +func (m *mockCapability) Execute(ctx context.Context, req capabilities.CapabilityRequest) (capabilities.CapabilityResponse, error) { cr, err := m.transform(req) if err != nil { - return nil, err + return capabilities.CapabilityResponse{}, err } - ch := make(chan capabilities.CapabilityResponse, 10) - m.response <- cr - ch <- cr - close(ch) - return ch, nil + return cr, nil } func (m *mockCapability) RegisterToWorkflow(ctx context.Context, request capabilities.RegisterToWorkflowRequest) error { diff --git a/core/capabilities/transmission/transmission.go b/core/capabilities/transmission/transmission.go index b41be5bcaa5..88ce0fa3edd 100644 --- a/core/capabilities/transmission/transmission.go +++ b/core/capabilities/transmission/transmission.go @@ -4,10 +4,10 @@ import ( "fmt" "time" - "github.com/pkg/errors" - "github.com/smartcontractkit/libocr/permutation" + "github.com/smartcontractkit/chainlink/v2/core/capabilities/validation" + "github.com/smartcontractkit/chainlink-common/pkg/capabilities" "github.com/smartcontractkit/chainlink-common/pkg/values" "github.com/smartcontractkit/chainlink/v2/core/services/p2p/types" @@ -56,8 +56,12 @@ func GetPeerIDToTransmissionDelay(donPeerIDs []types.PeerID, req capabilities.Ca return nil, fmt.Errorf("failed to extract transmission config from request: %w", err) } - if req.Metadata.WorkflowID == "" || req.Metadata.WorkflowExecutionID == "" { - return nil, errors.New("workflow ID and workflow execution ID must be set in request metadata") + if err = validation.ValidateWorkflowOrExecutionID(req.Metadata.WorkflowID); err != nil { + return nil, fmt.Errorf("workflow ID is invalid: %w", err) + } + + if err = validation.ValidateWorkflowOrExecutionID(req.Metadata.WorkflowExecutionID); err != nil { + return nil, fmt.Errorf("workflow execution ID is invalid: %w", err) } transmissionID := req.Metadata.WorkflowID + req.Metadata.WorkflowExecutionID diff --git a/core/capabilities/transmission/transmission_test.go b/core/capabilities/transmission/transmission_test.go index fba233eadb0..aaa367e78cf 100644 --- a/core/capabilities/transmission/transmission_test.go +++ b/core/capabilities/transmission/transmission_test.go @@ -36,20 +36,21 @@ func Test_GetPeerIDToTransmissionDelay(t *testing.T) { "one", "oneAtATime", "100ms", - "mock-execution-id", + "15c631d295ef5e32deb99a10ee6804bc4af13855687559d7ff6552ac6dbb2ce0", map[string]time.Duration{ "one": 300 * time.Millisecond, - "two": 100 * time.Millisecond, - "three": 0 * time.Millisecond, + "two": 0 * time.Millisecond, + "three": 100 * time.Millisecond, "four": 200 * time.Millisecond, }, }, + { "TestAllAtOnce", "one", "allAtOnce", "100ms", - "mock-execution-id", + "15c631d295ef5e32deb99a10ee6804bc4af13855687559d7ff6552ac6dbb2ce0", map[string]time.Duration{ "one": 0 * time.Millisecond, "two": 0 * time.Millisecond, @@ -57,17 +58,18 @@ func Test_GetPeerIDToTransmissionDelay(t *testing.T) { "four": 0 * time.Millisecond, }, }, + { "TestOneAtATimeWithDifferentExecutionID", "one", "oneAtATime", "100ms", - "mock-execution-id2", + "16c631d295ef5e32deb99a10ee6804bc4af13855687559d7ff6552ac6dbb2ce1", map[string]time.Duration{ - "one": 0 * time.Millisecond, - "two": 200 * time.Millisecond, - "three": 100 * time.Millisecond, - "four": 300 * time.Millisecond, + "one": 300 * time.Millisecond, + "two": 100 * time.Millisecond, + "three": 200 * time.Millisecond, + "four": 0 * time.Millisecond, }, }, } @@ -83,7 +85,7 @@ func Test_GetPeerIDToTransmissionDelay(t *testing.T) { capabilityRequest := capabilities.CapabilityRequest{ Config: transmissionCfg, Metadata: capabilities.RequestMetadata{ - WorkflowID: "mock-workflow-id", + WorkflowID: "17c631d295ef5e32deb99a10ee6804bc4af13855687559d7ff6552ac6dbb2ce0", WorkflowExecutionID: tc.workflowExecutionID, }, } diff --git a/core/capabilities/validation/validation.go b/core/capabilities/validation/validation.go new file mode 100644 index 00000000000..67ee3a504cf --- /dev/null +++ b/core/capabilities/validation/validation.go @@ -0,0 +1,38 @@ +package validation + +import ( + "encoding/hex" + "errors" + "unicode" +) + +const ( + validWorkflowIDLen = 64 + maxIDLen = 128 +) + +// Workflow IDs and Execution IDs are 32-byte hex-encoded strings +func ValidateWorkflowOrExecutionID(id string) error { + if len(id) != validWorkflowIDLen { + return errors.New("must be 32 bytes long") + } + _, err := hex.DecodeString(id) + if err != nil { + return errors.New("must be a hex-encoded string") + } + + return nil +} + +// Trigger event IDs and message IDs can only contain printable characters and must be non-empty +func IsValidID(id string) bool { + if len(id) == 0 || len(id) > maxIDLen { + return false + } + for i := 0; i < len(id); i++ { + if !unicode.IsPrint(rune(id[i])) { + return false + } + } + return true +} diff --git a/core/capabilities/validation/validation_test.go b/core/capabilities/validation/validation_test.go new file mode 100644 index 00000000000..205898652fd --- /dev/null +++ b/core/capabilities/validation/validation_test.go @@ -0,0 +1,19 @@ +package validation + +import ( + "testing" + + "github.com/stretchr/testify/require" +) + +func TestIsValidWorkflowID(t *testing.T) { + require.NotNil(t, ValidateWorkflowOrExecutionID("too_short")) + require.NotNil(t, ValidateWorkflowOrExecutionID("nothex--95ef5e32deb99a10ee6804bc4af13855687559d7ff6552ac6dbb2ce0")) + require.NoError(t, ValidateWorkflowOrExecutionID("15c631d295ef5e32deb99a10ee6804bc4af13855687559d7ff6552ac6dbb2ce0")) +} + +func TestIsValidTriggerEventID(t *testing.T) { + require.False(t, IsValidID("")) + require.False(t, IsValidID("\n\n")) + require.True(t, IsValidID("id_id_2")) +} diff --git a/core/capabilities/webapi/target/connector_handler.go b/core/capabilities/webapi/target/connector_handler.go new file mode 100644 index 00000000000..e52d2bbb2c6 --- /dev/null +++ b/core/capabilities/webapi/target/connector_handler.go @@ -0,0 +1,123 @@ +package target + +import ( + "context" + "encoding/json" + "sort" + "sync" + + "github.com/pkg/errors" + + "github.com/smartcontractkit/chainlink-common/pkg/logger" + "github.com/smartcontractkit/chainlink/v2/core/services/gateway/api" + "github.com/smartcontractkit/chainlink/v2/core/services/gateway/connector" + "github.com/smartcontractkit/chainlink/v2/core/services/gateway/handlers/common" + "github.com/smartcontractkit/chainlink/v2/core/services/gateway/handlers/webapicapabilities" +) + +var _ connector.GatewayConnectorHandler = &ConnectorHandler{} + +type ConnectorHandler struct { + gc connector.GatewayConnector + lggr logger.Logger + responseChs map[string]chan *api.Message + responseChsMu sync.Mutex + rateLimiter *common.RateLimiter +} + +func NewConnectorHandler(gc connector.GatewayConnector, config Config, lgger logger.Logger) (*ConnectorHandler, error) { + rateLimiter, err := common.NewRateLimiter(config.RateLimiter) + if err != nil { + return nil, err + } + responseChs := make(map[string]chan *api.Message) + return &ConnectorHandler{ + gc: gc, + responseChs: responseChs, + responseChsMu: sync.Mutex{}, + rateLimiter: rateLimiter, + lggr: lgger, + }, nil +} + +// HandleSingleNodeRequest sends a request to first available gateway node and blocks until response is received +// TODO: handle retries and timeouts +func (c *ConnectorHandler) HandleSingleNodeRequest(ctx context.Context, messageID string, payload []byte) (*api.Message, error) { + ch := make(chan *api.Message, 1) + c.responseChsMu.Lock() + c.responseChs[messageID] = ch + c.responseChsMu.Unlock() + l := logger.With(c.lggr, "messageID", messageID) + l.Debugw("sending request to gateway") + + body := &api.MessageBody{ + MessageId: messageID, + DonId: c.gc.DonID(), + Method: webapicapabilities.MethodWebAPITarget, + Payload: payload, + } + + // simply, send request to first available gateway node from sorted list + // this allows for deterministic selection of gateway node receiver for easier debugging + gatewayIDs := c.gc.GatewayIDs() + if len(gatewayIDs) == 0 { + return nil, errors.New("no gateway nodes available") + } + sort.Strings(gatewayIDs) + + err := c.gc.SignAndSendToGateway(ctx, gatewayIDs[0], body) + if err != nil { + return nil, errors.Wrap(err, "failed to send request to gateway") + } + + select { + case resp := <-ch: + return resp, nil + case <-ctx.Done(): + return nil, ctx.Err() + } +} + +func (c *ConnectorHandler) HandleGatewayMessage(ctx context.Context, gatewayID string, msg *api.Message) { + body := &msg.Body + l := logger.With(c.lggr, "gatewayID", gatewayID, "method", body.Method, "messageID", msg.Body.MessageId) + if !c.rateLimiter.Allow(body.Sender) { + // error is logged here instead of warning because if a message from gateway is rate-limited, + // the workflow will eventually fail with timeout as there are no retries in place yet + c.lggr.Errorw("request rate-limited") + return + } + l.Debugw("handling gateway request") + switch body.Method { + case webapicapabilities.MethodWebAPITarget: + var payload webapicapabilities.TargetResponsePayload + err := json.Unmarshal(body.Payload, &payload) + if err != nil { + l.Errorw("failed to unmarshal payload", "err", err) + return + } + c.responseChsMu.Lock() + defer c.responseChsMu.Unlock() + ch, ok := c.responseChs[body.MessageId] + if !ok { + l.Errorw("no response channel found") + return + } + select { + case ch <- msg: + delete(c.responseChs, body.MessageId) + case <-ctx.Done(): + return + } + default: + l.Errorw("unsupported method") + } +} + +func (c *ConnectorHandler) Start(ctx context.Context) error { + return c.gc.AddHandler([]string{webapicapabilities.MethodWebAPITarget}, c) +} + +func (c *ConnectorHandler) Close() error { + return nil +} diff --git a/core/capabilities/webapi/target/target.go b/core/capabilities/webapi/target/target.go new file mode 100644 index 00000000000..508d322a7d6 --- /dev/null +++ b/core/capabilities/webapi/target/target.go @@ -0,0 +1,152 @@ +package target + +import ( + "context" + "encoding/json" + "fmt" + "strings" + + "github.com/smartcontractkit/chainlink-common/pkg/capabilities" + "github.com/smartcontractkit/chainlink-common/pkg/logger" + "github.com/smartcontractkit/chainlink-common/pkg/types/core" + "github.com/smartcontractkit/chainlink-common/pkg/values" + "github.com/smartcontractkit/chainlink/v2/core/capabilities/validation" + "github.com/smartcontractkit/chainlink/v2/core/services/gateway/handlers/webapicapabilities" +) + +const ID = "web-api-target@1.0.0" + +var _ capabilities.TargetCapability = &Capability{} + +var capabilityInfo = capabilities.MustNewCapabilityInfo( + ID, + capabilities.CapabilityTypeTarget, + "A target that sends HTTP requests to external clients via the Chainlink Gateway.", +) + +// Capability is a target capability that sends HTTP requests to external clients via the Chainlink Gateway. +type Capability struct { + capabilityInfo capabilities.CapabilityInfo + connectorHandler *ConnectorHandler + lggr logger.Logger + registry core.CapabilitiesRegistry + config Config +} + +func NewCapability(config Config, registry core.CapabilitiesRegistry, connectorHandler *ConnectorHandler, lggr logger.Logger) (*Capability, error) { + return &Capability{ + capabilityInfo: capabilityInfo, + config: config, + registry: registry, + connectorHandler: connectorHandler, + lggr: lggr, + }, nil +} + +func (c *Capability) Start(ctx context.Context) error { + return c.registry.Add(ctx, c) +} + +func (c *Capability) Close() error { + return nil +} + +func (c *Capability) Info(ctx context.Context) (capabilities.CapabilityInfo, error) { + return capabilityInfo, nil +} + +func getMessageID(req capabilities.CapabilityRequest) (string, error) { + if err := validation.ValidateWorkflowOrExecutionID(req.Metadata.WorkflowID); err != nil { + return "", fmt.Errorf("workflow ID is invalid: %w", err) + } + if err := validation.ValidateWorkflowOrExecutionID(req.Metadata.WorkflowExecutionID); err != nil { + return "", fmt.Errorf("workflow execution ID is invalid: %w", err) + } + messageID := []string{ + req.Metadata.WorkflowID, + req.Metadata.WorkflowExecutionID, + webapicapabilities.MethodWebAPITarget, + } + return strings.Join(messageID, "/"), nil +} + +func (c *Capability) Execute(ctx context.Context, req capabilities.CapabilityRequest) (capabilities.CapabilityResponse, error) { + c.lggr.Debugw("executing http target", "capabilityRequest", req) + + var input Input + err := req.Inputs.UnwrapTo(&input) + if err != nil { + return capabilities.CapabilityResponse{}, err + } + + var workflowCfg WorkflowConfig + err = req.Config.UnwrapTo(&workflowCfg) + if err != nil { + return capabilities.CapabilityResponse{}, err + } + + messageID, err := getMessageID(req) + if err != nil { + return capabilities.CapabilityResponse{}, err + } + + payload := webapicapabilities.TargetRequestPayload{ + URL: input.URL, + Method: input.Method, + Headers: input.Headers, + Body: input.Body, + TimeoutMs: workflowCfg.TimeoutMs, + } + + payloadBytes, err := json.Marshal(payload) + if err != nil { + return capabilities.CapabilityResponse{}, err + } + + // Default to SingleNode delivery mode + deliveryMode := SingleNode + if workflowCfg.DeliveryMode != "" { + deliveryMode = workflowCfg.DeliveryMode + } + + switch deliveryMode { + case SingleNode: + // blocking call to handle single node request. waits for response from gateway + resp, err := c.connectorHandler.HandleSingleNodeRequest(ctx, messageID, payloadBytes) + if err != nil { + return capabilities.CapabilityResponse{}, err + } + c.lggr.Debugw("received gateway response", "resp", resp) + var payload webapicapabilities.TargetResponsePayload + err = json.Unmarshal(resp.Body.Payload, &payload) + if err != nil { + return capabilities.CapabilityResponse{}, err + } + + // TODO: check target response format and fields CM-473 + values, err := values.NewMap(map[string]any{ + "statusCode": payload.StatusCode, + "headers": payload.Headers, + "body": payload.Body, + }) + if err != nil { + return capabilities.CapabilityResponse{}, err + } + return capabilities.CapabilityResponse{ + Value: values, + }, nil + default: + return capabilities.CapabilityResponse{}, fmt.Errorf("unsupported delivery mode: %v", workflowCfg.DeliveryMode) + } +} + +func (c *Capability) RegisterToWorkflow(ctx context.Context, req capabilities.RegisterToWorkflowRequest) error { + // Workflow engine guarantees registration requests are valid + // TODO: handle retry configuration CM-472 + return nil +} + +func (c *Capability) UnregisterFromWorkflow(ctx context.Context, req capabilities.UnregisterFromWorkflowRequest) error { + // Workflow engine guarantees deregistration requests are valid + return nil +} diff --git a/core/capabilities/webapi/target/target_test.go b/core/capabilities/webapi/target/target_test.go new file mode 100644 index 00000000000..67923ef4c80 --- /dev/null +++ b/core/capabilities/webapi/target/target_test.go @@ -0,0 +1,340 @@ +package target + +import ( + "context" + "encoding/base64" + "encoding/json" + "errors" + "fmt" + "testing" + + "github.com/stretchr/testify/mock" + "github.com/stretchr/testify/require" + + "github.com/smartcontractkit/chainlink-common/pkg/capabilities" + "github.com/smartcontractkit/chainlink-common/pkg/logger" + registrymock "github.com/smartcontractkit/chainlink-common/pkg/types/core/mocks" + "github.com/smartcontractkit/chainlink-common/pkg/values" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" + "github.com/smartcontractkit/chainlink/v2/core/services/gateway/api" + gcmocks "github.com/smartcontractkit/chainlink/v2/core/services/gateway/connector/mocks" + "github.com/smartcontractkit/chainlink/v2/core/services/gateway/handlers/common" + "github.com/smartcontractkit/chainlink/v2/core/services/gateway/handlers/webapicapabilities" +) + +const ( + workflowID1 = "15c631d295ef5e32deb99a10ee6804bc4af13855687559d7ff6552ac6dbb2ce0" + workflowID2 = "44f129ea13948d1c4eaa2bbc0e72319266364cba12b789174732b2f72b57088d" + workflowExecutionID1 = "95ef5e32deb99a10ee6804bc4af13855687559d7ff6552ac6dbb2ce0abbadeed" + owner1 = "0x00000000000000000000000000000000000000aa" +) + +var defaultConfig = Config{ + RateLimiter: common.RateLimiterConfig{ + GlobalRPS: 100.0, + GlobalBurst: 100, + PerSenderRPS: 100.0, + PerSenderBurst: 100, + }, +} + +type testHarness struct { + registry *registrymock.CapabilitiesRegistry + connector *gcmocks.GatewayConnector + lggr logger.Logger + config Config + connectorHandler *ConnectorHandler + capability *Capability +} + +func setup(t *testing.T, config Config) testHarness { + registry := registrymock.NewCapabilitiesRegistry(t) + connector := gcmocks.NewGatewayConnector(t) + lggr := logger.Test(t) + connectorHandler, err := NewConnectorHandler(connector, config, lggr) + require.NoError(t, err) + + capability, err := NewCapability(config, registry, connectorHandler, lggr) + require.NoError(t, err) + + return testHarness{ + registry: registry, + connector: connector, + lggr: lggr, + config: config, + connectorHandler: connectorHandler, + capability: capability, + } +} + +func inputsAndConfig(t *testing.T) (*values.Map, *values.Map) { + data := map[string]string{ + "key": "value", + } + jsonData, err := json.Marshal(data) + require.NoError(t, err) + encoded := base64.StdEncoding.EncodeToString(jsonData) + targetInput := map[string]any{ + "url": "http://example.com", + "method": "POST", + "headers": map[string]string{"Content-Type": "application/json"}, + "body": encoded, + } + inputs, err := values.NewMap(targetInput) + require.NoError(t, err) + wfConfig, err := values.NewMap(map[string]interface{}{ + "timeoutMs": 1000, + "schedule": SingleNode, + }) + require.NoError(t, err) + return inputs, wfConfig +} + +func capabilityRequest(t *testing.T) capabilities.CapabilityRequest { + inputs, wfConfig := inputsAndConfig(t) + + return capabilities.CapabilityRequest{ + Metadata: capabilities.RequestMetadata{ + WorkflowID: workflowID1, + WorkflowExecutionID: workflowExecutionID1, + }, + Inputs: inputs, + Config: wfConfig, + } +} + +func gatewayResponse(t *testing.T, msgID string) *api.Message { + headers := map[string]string{"Content-Type": "application/json"} + body := []byte("response body") + responsePayload, err := json.Marshal(webapicapabilities.TargetResponsePayload{ + StatusCode: 200, + Headers: headers, + Body: body, + Success: true, + }) + require.NoError(t, err) + return &api.Message{ + Body: api.MessageBody{ + MessageId: msgID, + Method: webapicapabilities.MethodWebAPITarget, + Payload: responsePayload, + }, + } +} + +func TestRegisterUnregister(t *testing.T) { + th := setup(t, defaultConfig) + ctx := testutils.Context(t) + + regReq := capabilities.RegisterToWorkflowRequest{ + Metadata: capabilities.RegistrationMetadata{ + WorkflowID: workflowID1, + WorkflowOwner: owner1, + }, + } + err := th.capability.RegisterToWorkflow(ctx, regReq) + require.NoError(t, err) + + t.Run("happy case", func(t *testing.T) { + err = th.capability.UnregisterFromWorkflow(ctx, capabilities.UnregisterFromWorkflowRequest{ + Metadata: capabilities.RegistrationMetadata{ + WorkflowID: workflowID1, + WorkflowOwner: owner1, + }, + }) + require.NoError(t, err) + }) + + t.Run("unregister non-existent workflow no error", func(t *testing.T) { + err = th.capability.UnregisterFromWorkflow(ctx, capabilities.UnregisterFromWorkflowRequest{ + Metadata: capabilities.RegistrationMetadata{ + WorkflowID: workflowID2, + WorkflowOwner: owner1, + }, + }) + require.NoError(t, err) + }) + + t.Run("reregister idempotent", func(t *testing.T) { + regReq := capabilities.RegisterToWorkflowRequest{ + Metadata: capabilities.RegistrationMetadata{ + WorkflowID: workflowID1, + WorkflowOwner: owner1, + }, + } + err := th.capability.RegisterToWorkflow(ctx, regReq) + require.NoError(t, err) + }) +} + +func TestCapability_Execute(t *testing.T) { + th := setup(t, defaultConfig) + ctx := testutils.Context(t) + th.connector.EXPECT().DonID().Return("donID") + th.connector.EXPECT().GatewayIDs().Return([]string{"gateway2", "gateway1"}) + + t.Run("happy case", func(t *testing.T) { + regReq := capabilities.RegisterToWorkflowRequest{ + Metadata: capabilities.RegistrationMetadata{ + WorkflowID: workflowID1, + WorkflowOwner: owner1, + }, + } + err := th.capability.RegisterToWorkflow(ctx, regReq) + require.NoError(t, err) + + req := capabilityRequest(t) + msgID, err := getMessageID(req) + require.NoError(t, err) + + gatewayResp := gatewayResponse(t, msgID) + + th.connector.On("SignAndSendToGateway", mock.Anything, "gateway1", mock.Anything).Return(nil).Run(func(args mock.Arguments) { + th.connectorHandler.HandleGatewayMessage(ctx, "gateway1", gatewayResp) + }).Once() + + resp, err := th.capability.Execute(ctx, req) + require.NoError(t, err) + var values map[string]any + err = resp.Value.UnwrapTo(&values) + require.NoError(t, err) + fmt.Printf("values %+v", values) + statusCode, ok := values["statusCode"].(int64) + require.True(t, ok) + require.Equal(t, int64(200), statusCode) + respBody, ok := values["body"].([]byte) + require.True(t, ok) + require.Equal(t, "response body", string(respBody)) + }) + + t.Run("context cancelled while waiting for gateway response", func(t *testing.T) { + regReq := capabilities.RegisterToWorkflowRequest{ + Metadata: capabilities.RegistrationMetadata{ + WorkflowID: workflowID1, + WorkflowOwner: owner1, + }, + } + err := th.capability.RegisterToWorkflow(ctx, regReq) + require.NoError(t, err) + + req := capabilityRequest(t) + _, err = getMessageID(req) + require.NoError(t, err) + + newCtx, cancel := context.WithCancel(ctx) + th.connector.On("SignAndSendToGateway", mock.Anything, "gateway1", mock.Anything).Return(nil).Run(func(args mock.Arguments) { + cancel() + }).Once() + + _, err = th.capability.Execute(newCtx, req) + require.Error(t, err) + require.Contains(t, err.Error(), "context canceled") + }) + + t.Run("invalid workflow ID during execute", func(t *testing.T) { + regReq := capabilities.RegisterToWorkflowRequest{ + Metadata: capabilities.RegistrationMetadata{ + WorkflowID: workflowID1, + WorkflowOwner: owner1, + }, + } + err := th.capability.RegisterToWorkflow(ctx, regReq) + require.NoError(t, err) + + inputs, wfConfig := inputsAndConfig(t) + req := capabilities.CapabilityRequest{ + Metadata: capabilities.RequestMetadata{ + WorkflowID: "invalid", + WorkflowExecutionID: workflowExecutionID1, + }, + Inputs: inputs, + Config: wfConfig, + } + + _, err = th.capability.Execute(ctx, req) + require.Error(t, err) + require.ErrorContains(t, err, "workflow ID is invalid") + }) + + t.Run("invalid workflow execution ID during execute", func(t *testing.T) { + regReq := capabilities.RegisterToWorkflowRequest{ + Metadata: capabilities.RegistrationMetadata{ + WorkflowID: workflowID1, + WorkflowOwner: owner1, + }, + } + err := th.capability.RegisterToWorkflow(ctx, regReq) + require.NoError(t, err) + + inputs, wfConfig := inputsAndConfig(t) + req := capabilities.CapabilityRequest{ + Metadata: capabilities.RequestMetadata{ + WorkflowID: workflowID1, + WorkflowExecutionID: "invalid", + }, + Inputs: inputs, + Config: wfConfig, + } + + _, err = th.capability.Execute(ctx, req) + require.Error(t, err) + require.ErrorContains(t, err, "workflow execution ID is invalid") + }) + + t.Run("unsupported delivery mode", func(t *testing.T) { + regReq := capabilities.RegisterToWorkflowRequest{ + Metadata: capabilities.RegistrationMetadata{ + WorkflowID: workflowID1, + WorkflowOwner: owner1, + }, + } + err := th.capability.RegisterToWorkflow(ctx, regReq) + require.NoError(t, err) + + targetInput := map[string]any{ + "url": "http://example.com", + "method": "POST", + "headers": map[string]string{"Content-Type": "application/json"}, + } + inputs, err := values.NewMap(targetInput) + + require.NoError(t, err) + wfConfig, err := values.NewMap(map[string]interface{}{ + "timeoutMs": 1000, + "deliveryMode": "invalid", + }) + require.NoError(t, err) + + req := capabilities.CapabilityRequest{ + Metadata: capabilities.RequestMetadata{ + WorkflowID: workflowID1, + WorkflowExecutionID: workflowExecutionID1, + }, + Inputs: inputs, + Config: wfConfig, + } + + _, err = th.capability.Execute(ctx, req) + require.Error(t, err) + require.Contains(t, err.Error(), "unsupported delivery mode") + }) + + t.Run("gateway connector error", func(t *testing.T) { + regReq := capabilities.RegisterToWorkflowRequest{ + Metadata: capabilities.RegistrationMetadata{ + WorkflowID: workflowID1, + WorkflowOwner: owner1, + }, + } + err := th.capability.RegisterToWorkflow(ctx, regReq) + require.NoError(t, err) + + req := capabilityRequest(t) + require.NoError(t, err) + + th.connector.EXPECT().SignAndSendToGateway(mock.Anything, "gateway1", mock.Anything).Return(errors.New("gateway error")).Once() + _, err = th.capability.Execute(ctx, req) + require.Error(t, err) + require.Contains(t, err.Error(), "gateway error") + }) +} diff --git a/core/capabilities/webapi/target/types.go b/core/capabilities/webapi/target/types.go new file mode 100644 index 00000000000..6152d1496b7 --- /dev/null +++ b/core/capabilities/webapi/target/types.go @@ -0,0 +1,31 @@ +package target + +import "github.com/smartcontractkit/chainlink/v2/core/services/gateway/handlers/common" + +const ( + SingleNode string = "SingleNode" + // TODO: AllAtOnce is not yet implemented + AllAtOnce string = "AllAtOnce" +) + +type Input struct { + URL string `json:"url"` // URL to query, only http and https protocols are supported. + Method string `json:"method,omitempty"` // HTTP verb, defaults to GET. + Headers map[string]string `json:"headers,omitempty"` // HTTP headers, defaults to empty. + Body []byte `json:"body,omitempty"` // HTTP body, defaults to empty. +} + +// WorkflowConfig is the configuration of the workflow that is passed in the workflow execute request +type WorkflowConfig struct { + TimeoutMs uint32 `json:"timeoutMs,omitempty"` // Timeout in milliseconds + RetryCount uint8 `json:"retryCount,omitempty"` // Number of retries, defaults to 0. + DeliveryMode string `json:"deliveryMode,omitempty"` // DeliveryMode describes how request should be delivered to gateway nodes, defaults to SingleNode. +} + +// CapabilityConfigConfig is the configuration for the Target capability and handler +// TODO: handle retry configurations here CM-472 +// Note that workflow executions have their own internal timeouts and retries set by the user +// that are separate from this configuration +type Config struct { + RateLimiter common.RateLimiterConfig `toml:"rateLimiter"` +} diff --git a/core/capabilities/webapi/trigger.go b/core/capabilities/webapi/trigger.go new file mode 100644 index 00000000000..db0df7d1410 --- /dev/null +++ b/core/capabilities/webapi/trigger.go @@ -0,0 +1,18 @@ +package webapi + +import ( + "github.com/smartcontractkit/chainlink-common/pkg/types/core" + "github.com/smartcontractkit/chainlink/v2/core/logger" + "github.com/smartcontractkit/chainlink/v2/core/services/gateway/connector" + "github.com/smartcontractkit/chainlink/v2/core/services/job" +) + +func NewTrigger(config string, registry core.CapabilitiesRegistry, connector connector.GatewayConnector, lggr logger.Logger) (job.ServiceCtx, error) { + // TODO (CAPPL-22, CAPPL-24): + // - decode config + // - create an implementation of the capability API and add it to the Registry + // - create a handler and register it with Gateway Connector + // - manage trigger subscriptions + // - process incoming trigger events and related metadata + return nil, nil +} diff --git a/core/chainlink.Dockerfile b/core/chainlink.Dockerfile index 48f6da73612..753172a1a9f 100644 --- a/core/chainlink.Dockerfile +++ b/core/chainlink.Dockerfile @@ -1,5 +1,5 @@ # Build image: Chainlink binary -FROM golang:1.21-bullseye as buildgo +FROM golang:1.22-bullseye as buildgo RUN go version WORKDIR /chainlink @@ -31,7 +31,7 @@ RUN go list -m -f "{{.Dir}}" github.com/smartcontractkit/chainlink-feeds | xargs RUN go list -m -f "{{.Dir}}" github.com/smartcontractkit/chainlink-solana | xargs -I % ln -s % /chainlink-solana # Build image: Plugins -FROM golang:1.21-bullseye as buildplugins +FROM golang:1.22-bullseye as buildplugins RUN go version WORKDIR /chainlink-feeds diff --git a/core/chainlink.goreleaser.Dockerfile b/core/chainlink.goreleaser.Dockerfile index 5d172fd77e5..c229ad488c3 100644 --- a/core/chainlink.goreleaser.Dockerfile +++ b/core/chainlink.goreleaser.Dockerfile @@ -20,8 +20,9 @@ COPY ./chainlink /usr/local/bin/ # Copy native libs if cgo is enabled COPY ./tmp/linux_${TARGETARCH}/libs /usr/local/bin/libs -# Copy plugins and enable them -COPY ./tmp/linux_${TARGETARCH}/plugins/* /usr/local/bin/ +# Copy plugins if exist and enable them +# https://stackoverflow.com/questions/70096208/dockerfile-copy-folder-if-it-exists-conditional-copy/70096420#70096420 +COPY ./tmp/linux_${TARGETARCH}/plugin[s] /usr/local/bin/ # Allow individual plugins to be enabled by supplying their path ARG CL_MEDIAN_CMD ARG CL_MERCURY_CMD @@ -37,6 +38,11 @@ RUN chmod +x /usr/local/bin/ldd_fix RUN /usr/local/bin/ldd_fix RUN apt-get remove -y patchelf +# CCIP specific +COPY ./cci[p]/confi[g] /chainlink/ccip-config +ARG CL_CHAIN_DEFAULTS +ENV CL_CHAIN_DEFAULTS=${CL_CHAIN_DEFAULTS} + RUN if [ ${CHAINLINK_USER} != root ]; then \ useradd --uid 14933 --create-home ${CHAINLINK_USER}; \ fi diff --git a/core/chains/chain_kv_test.go b/core/chains/chain_kv_test.go index 205ee693d6f..7c9336285e8 100644 --- a/core/chains/chain_kv_test.go +++ b/core/chains/chain_kv_test.go @@ -89,6 +89,11 @@ func (s *testChainService) HealthReport() map[string]error { return map[string]error{} } +// Implement [types.LatestHead] interface +func (s *testChainService) LatestHead(_ context.Context) (head types.Head, err error) { + return +} + // Implement [types.ChainService] interface func (s *testChainService) GetChainStatus(ctx context.Context) (stat types.ChainStatus, err error) { return diff --git a/core/chains/evm/client/chain_client.go b/core/chains/evm/client/chain_client.go index f18c900b038..310528424d6 100644 --- a/core/chains/evm/client/chain_client.go +++ b/core/chains/evm/client/chain_client.go @@ -20,13 +20,10 @@ import ( evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" ) -const queryTimeout = 10 * time.Second const BALANCE_OF_ADDRESS_FUNCTION_SELECTOR = "0x70a08231" var _ Client = (*chainClient)(nil) -//go:generate mockery --quiet --name Client --output ./mocks/ --case=underscore - // Client is the interface used to interact with an ethereum node. type Client interface { Dial(ctx context.Context) error @@ -87,6 +84,7 @@ type Client interface { SuggestGasPrice(ctx context.Context) (*big.Int, error) SuggestGasTipCap(ctx context.Context) (*big.Int, error) LatestBlockHeight(ctx context.Context) (*big.Int, error) + FeeHistory(ctx context.Context, blockCount uint64, rewardPercentiles []float64) (feeHistory *ethereum.FeeHistory, err error) HeaderByNumber(ctx context.Context, n *big.Int) (*types.Header, error) HeaderByHash(ctx context.Context, h common.Hash) (*types.Header, error) @@ -101,7 +99,7 @@ type Client interface { } func ContextWithDefaultTimeout() (ctx context.Context, cancel context.CancelFunc) { - return context.WithTimeout(context.Background(), queryTimeout) + return context.WithTimeout(context.Background(), commonclient.QueryTimeout) } type chainClient struct { @@ -163,9 +161,13 @@ func (c *chainClient) BalanceAt(ctx context.Context, account common.Address, blo return c.multiNode.BalanceAt(ctx, account, blockNumber) } +// BatchCallContext - sends all given requests as a single batch. // Request specific errors for batch calls are returned to the individual BatchElem. // Ensure the same BatchElem slice provided by the caller is passed through the call stack // to ensure the caller has access to the errors. +// Note: some chains (e.g Astar) have custom finality requests, so even when FinalityTagEnabled=true, finality tag +// might not be properly handled and returned results might have weaker finality guarantees. It's highly recommended +// to use HeadTracker to identify latest finalized block. func (c *chainClient) BatchCallContext(ctx context.Context, b []rpc.BatchElem) error { return c.multiNode.BatchCallContext(ctx, b) } @@ -352,6 +354,14 @@ func (c *chainClient) LatestFinalizedBlock(ctx context.Context) (*evmtypes.Head, return c.multiNode.LatestFinalizedBlock(ctx) } +func (c *chainClient) FeeHistory(ctx context.Context, blockCount uint64, rewardPercentiles []float64) (feeHistory *ethereum.FeeHistory, err error) { + rpc, err := c.multiNode.SelectNodeRPC() + if err != nil { + return feeHistory, err + } + return rpc.FeeHistory(ctx, blockCount, rewardPercentiles) +} + func (c *chainClient) CheckTxValidity(ctx context.Context, from common.Address, to common.Address, data []byte) *SendError { msg := ethereum.CallMsg{ From: from, diff --git a/core/chains/evm/client/chain_client_test.go b/core/chains/evm/client/chain_client_test.go index 33955c16451..47041e40e91 100644 --- a/core/chains/evm/client/chain_client_test.go +++ b/core/chains/evm/client/chain_client_test.go @@ -328,7 +328,7 @@ func TestEthClient_HeaderByNumber(t *testing.T) { `{"difficulty":"0xf3a00","extraData":"0xd883010503846765746887676f312e372e318664617277696e","gasLimit":"0xffc001","gasUsed":"0x0","hash":"0x41800b5c3f1717687d85fc9018faac0a6e90b39deaa0b99e7fe4fe796ddeb26a","logsBloom":"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","miner":"0xd1aeb42885a43b72b518182ef893125814811048","mixHash":"0x0f98b15f1a4901a7e9204f3c500a7bd527b3fb2c3340e12176a44b83e414a69e","nonce":"0x0ece08ea8c49dfd9","number":"0x1","parentHash":"0x41941023680923e0fe4d74a34bdac8141f2540e3ae90623718e47d66d1ca4a2d","receiptsRoot":"0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421","sha3Uncles":"0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347","size":"0x218","stateRoot":"0xc7b01007a10da045eacb90385887dd0c38fcb5db7393006bdde24b93873c334b","timestamp":"0x58318da2","totalDifficulty":"0x1f3a00","transactions":[],"transactionsRoot":"0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421","uncles":[]}`}, {"happy parity", expectedBlockNum, expectedBlockNum.Int64(), nil, `{"author":"0xd1aeb42885a43b72b518182ef893125814811048","difficulty":"0xf3a00","extraData":"0xd883010503846765746887676f312e372e318664617277696e","gasLimit":"0xffc001","gasUsed":"0x0","hash":"0x41800b5c3f1717687d85fc9018faac0a6e90b39deaa0b99e7fe4fe796ddeb26a","logsBloom":"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","miner":"0xd1aeb42885a43b72b518182ef893125814811048","mixHash":"0x0f98b15f1a4901a7e9204f3c500a7bd527b3fb2c3340e12176a44b83e414a69e","nonce":"0x0ece08ea8c49dfd9","number":"0x1","parentHash":"0x41941023680923e0fe4d74a34bdac8141f2540e3ae90623718e47d66d1ca4a2d","receiptsRoot":"0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421","sealFields":["0xa00f98b15f1a4901a7e9204f3c500a7bd527b3fb2c3340e12176a44b83e414a69e","0x880ece08ea8c49dfd9"],"sha3Uncles":"0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347","size":"0x218","stateRoot":"0xc7b01007a10da045eacb90385887dd0c38fcb5db7393006bdde24b93873c334b","timestamp":"0x58318da2","totalDifficulty":"0x1f3a00","transactions":[],"transactionsRoot":"0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421","uncles":[]}`}, - {"missing header", expectedBlockNum, 0, fmt.Errorf("no live nodes available for chain %s", testutils.FixtureChainID.String()), + {"missing header", expectedBlockNum, 0, fmt.Errorf("RPCClient returned error (eth-primary-rpc-0): not found"), `null`}, } @@ -366,7 +366,7 @@ func TestEthClient_HeaderByNumber(t *testing.T) { ctx, cancel := context.WithTimeout(tests.Context(t), 5*time.Second) result, err := ethClient.HeadByNumber(ctx, expectedBlockNum) if test.error != nil { - require.Error(t, err, test.error) + require.EqualError(t, err, test.error.Error()) } else { require.NoError(t, err) require.Equal(t, expectedBlockHash, result.Hash.Hex()) @@ -751,7 +751,7 @@ func newMockRpc(t *testing.T) *mocks.RPCClient { mockRpc.On("Close").Return(nil).Once() mockRpc.On("ChainID", mock.Anything).Return(testutils.FixtureChainID, nil).Once() // node does not always manage to fully setup aliveLoop, so we have to make calls optional to avoid flakes - mockRpc.On("SubscribeNewHead", mock.Anything, mock.Anything).Return(client.NewMockSubscription(), nil).Maybe() + mockRpc.On("SubscribeToHeads", mock.Anything).Return(nil, client.NewMockSubscription(), nil).Maybe() mockRpc.On("SetAliveLoopSub", mock.Anything).Return().Maybe() return mockRpc } diff --git a/core/chains/evm/client/config_builder.go b/core/chains/evm/client/config_builder.go index 19e0f14fd67..9a31f9e4b40 100644 --- a/core/chains/evm/client/config_builder.go +++ b/core/chains/evm/client/config_builder.go @@ -41,31 +41,36 @@ func NewClientConfigs( finalizedBlockOffset *uint32, enforceRepeatableRead *bool, deathDeclarationDelay time.Duration, - + noNewFinalizedHeadsThreshold time.Duration, + finalizedBlockPollInterval time.Duration, + newHeadsPollInterval time.Duration, ) (commonclient.ChainConfig, evmconfig.NodePool, []*toml.Node, error) { nodes, err := parseNodeConfigs(nodeCfgs) if err != nil { return nil, nil, nil, err } nodePool := toml.NodePool{ - SelectionMode: selectionMode, - LeaseDuration: commonconfig.MustNewDuration(leaseDuration), - PollFailureThreshold: pollFailureThreshold, - PollInterval: commonconfig.MustNewDuration(pollInterval), - SyncThreshold: syncThreshold, - NodeIsSyncingEnabled: nodeIsSyncingEnabled, - EnforceRepeatableRead: enforceRepeatableRead, - DeathDeclarationDelay: commonconfig.MustNewDuration(deathDeclarationDelay), + SelectionMode: selectionMode, + LeaseDuration: commonconfig.MustNewDuration(leaseDuration), + PollFailureThreshold: pollFailureThreshold, + PollInterval: commonconfig.MustNewDuration(pollInterval), + SyncThreshold: syncThreshold, + NodeIsSyncingEnabled: nodeIsSyncingEnabled, + EnforceRepeatableRead: enforceRepeatableRead, + DeathDeclarationDelay: commonconfig.MustNewDuration(deathDeclarationDelay), + FinalizedBlockPollInterval: commonconfig.MustNewDuration(finalizedBlockPollInterval), + NewHeadsPollInterval: commonconfig.MustNewDuration(newHeadsPollInterval), } nodePoolCfg := &evmconfig.NodePoolConfig{C: nodePool} chainConfig := &evmconfig.EVMConfig{ C: &toml.EVMConfig{ Chain: toml.Chain{ - ChainType: chaintype.NewChainTypeConfig(chainType), - FinalityDepth: finalityDepth, - FinalityTagEnabled: finalityTagEnabled, - NoNewHeadsThreshold: commonconfig.MustNewDuration(noNewHeadsThreshold), - FinalizedBlockOffset: finalizedBlockOffset, + ChainType: chaintype.NewConfig(chainType), + FinalityDepth: finalityDepth, + FinalityTagEnabled: finalityTagEnabled, + NoNewHeadsThreshold: commonconfig.MustNewDuration(noNewHeadsThreshold), + FinalizedBlockOffset: finalizedBlockOffset, + NoNewFinalizedHeadsThreshold: commonconfig.MustNewDuration(noNewFinalizedHeadsThreshold), }, }, } diff --git a/core/chains/evm/client/config_builder_test.go b/core/chains/evm/client/config_builder_test.go index 7c08bf18c1d..28620ac6ca9 100644 --- a/core/chains/evm/client/config_builder_test.go +++ b/core/chains/evm/client/config_builder_test.go @@ -26,6 +26,7 @@ func TestClientConfigBuilder(t *testing.T) { finalizedBlockOffset := ptr[uint32](16) enforceRepeatableRead := ptr(true) deathDeclarationDelay := time.Second * 3 + noNewFinalizedBlocksThreshold := time.Second nodeConfigs := []client.NodeConfig{ { Name: ptr("foo"), @@ -36,9 +37,11 @@ func TestClientConfigBuilder(t *testing.T) { finalityDepth := ptr(uint32(10)) finalityTagEnabled := ptr(true) noNewHeadsThreshold := time.Second + newHeadsPollInterval := 0 * time.Second chainCfg, nodePool, nodes, err := client.NewClientConfigs(selectionMode, leaseDuration, chainTypeStr, nodeConfigs, pollFailureThreshold, pollInterval, syncThreshold, nodeIsSyncingEnabled, noNewHeadsThreshold, finalityDepth, - finalityTagEnabled, finalizedBlockOffset, enforceRepeatableRead, deathDeclarationDelay) + finalityTagEnabled, finalizedBlockOffset, enforceRepeatableRead, deathDeclarationDelay, noNewFinalizedBlocksThreshold, + pollInterval, newHeadsPollInterval) require.NoError(t, err) // Validate node pool configs @@ -50,6 +53,8 @@ func TestClientConfigBuilder(t *testing.T) { require.Equal(t, *nodeIsSyncingEnabled, nodePool.NodeIsSyncingEnabled()) require.Equal(t, *enforceRepeatableRead, nodePool.EnforceRepeatableRead()) require.Equal(t, deathDeclarationDelay, nodePool.DeathDeclarationDelay()) + require.Equal(t, pollInterval, nodePool.FinalizedBlockPollInterval()) + require.Equal(t, newHeadsPollInterval, nodePool.NewHeadsPollInterval()) // Validate node configs require.Equal(t, *nodeConfigs[0].Name, *nodes[0].Name) @@ -61,6 +66,7 @@ func TestClientConfigBuilder(t *testing.T) { require.Equal(t, *finalityDepth, chainCfg.FinalityDepth()) require.Equal(t, *finalityTagEnabled, chainCfg.FinalityTagEnabled()) require.Equal(t, *finalizedBlockOffset, chainCfg.FinalizedBlockOffset()) + require.Equal(t, noNewFinalizedBlocksThreshold, chainCfg.NoNewFinalizedHeadsThreshold()) // let combiler tell us, when we do not have sufficient data to create evm client _ = client.NewEvmClient(nodePool, chainCfg, nil, logger.Test(t), big.NewInt(10), nodes, chaintype.ChainType(chainTypeStr)) diff --git a/core/chains/evm/client/errors.go b/core/chains/evm/client/errors.go index 22fac5f7287..ba13e1bfea8 100644 --- a/core/chains/evm/client/errors.go +++ b/core/chains/evm/client/errors.go @@ -10,6 +10,7 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/rpc" pkgerrors "github.com/pkg/errors" "github.com/smartcontractkit/chainlink-common/pkg/logger" @@ -62,6 +63,7 @@ const ( Fatal ServiceUnavailable TerminallyStuck + TooManyResults ) type ClientErrors map[int]*regexp.Regexp @@ -158,7 +160,13 @@ var arbitrum = ClientErrors{ Fatal: arbitrumFatal, L2FeeTooLow: regexp.MustCompile(`(: |^)max fee per gas less than block base fee(:|$)`), L2Full: regexp.MustCompile(`(: |^)(queue full|sequencer pending tx pool full, please try again)(:|$)`), - ServiceUnavailable: regexp.MustCompile(`(: |^)502 Bad Gateway: [\s\S]*$`), + ServiceUnavailable: regexp.MustCompile(`(: |^)502 Bad Gateway: [\s\S]*$|network is unreachable|i/o timeout`), +} + +// Treasure +var treasureFatal = regexp.MustCompile(`(: |^)invalid chain id for signer(:|$)`) +var treasure = ClientErrors{ + Fatal: treasureFatal, } var celo = ClientErrors{ @@ -247,7 +255,30 @@ var zkSync = ClientErrors{ } var zkEvm = ClientErrors{ - TerminallyStuck: regexp.MustCompile(`(?:: |^)not enough .* counters to continue the execution$`), + TerminallyStuck: regexp.MustCompile(`(?:: |^)(?:not enough .* counters to continue the execution|out of counters at node level (?:.*))$`), +} + +var aStar = ClientErrors{ + TerminallyUnderpriced: regexp.MustCompile(`(?:: |^)(gas price less than block base fee)$`), +} + +var mantle = ClientErrors{ + InsufficientEth: regexp.MustCompile(`(: |^)'*insufficient funds for gas \* price \+ value`), + Fatal: regexp.MustCompile(`(: |^)'*invalid sender`), +} + +var hederaFatal = regexp.MustCompile(`(: |^)(execution reverted)(:|$) | ^Transaction gas limit '(\d+)' exceeds block gas limit '(\d+)' | ^Transaction gas limit provided '(\d+)' is insufficient of intrinsic gas required '(\d+)' | ^Oversized data:|status INVALID_SIGNATURE`) +var hedera = ClientErrors{ + NonceTooLow: regexp.MustCompile(`Nonce too low`), + NonceTooHigh: regexp.MustCompile(`Nonce too high`), + TerminallyUnderpriced: regexp.MustCompile(`(Gas price '(\d+)' is below configured minimum gas price '(\d+)')|(Gas price too low)`), + InsufficientEth: regexp.MustCompile(`Insufficient funds for transfer| failed precheck with status INSUFFICIENT_PAYER_BALANCE`), + ServiceUnavailable: regexp.MustCompile(`Transaction execution returns a null value for transaction`), + Fatal: hederaFatal, +} + +var gnosis = ClientErrors{ + TransactionAlreadyInMempool: regexp.MustCompile(`(: |^)(alreadyknown)`), } const TerminallyStuckMsg = "transaction terminally stuck" @@ -257,7 +288,7 @@ var internal = ClientErrors{ TerminallyStuck: regexp.MustCompile(TerminallyStuckMsg), } -var clients = []ClientErrors{parity, geth, arbitrum, metis, substrate, avalanche, nethermind, harmony, besu, erigon, klaytn, celo, zkSync, zkEvm, internal} +var clients = []ClientErrors{parity, geth, arbitrum, metis, substrate, avalanche, nethermind, harmony, besu, erigon, klaytn, celo, zkSync, zkEvm, treasure, mantle, aStar, hedera, gnosis, internal} // ClientErrorRegexes returns a map of compiled regexes for each error type func ClientErrorRegexes(errsRegex config.ClientErrors) *ClientErrors { @@ -279,6 +310,7 @@ func ClientErrorRegexes(errsRegex config.ClientErrors) *ClientErrors { TransactionAlreadyMined: regexp.MustCompile(errsRegex.TransactionAlreadyMined()), Fatal: regexp.MustCompile(errsRegex.Fatal()), ServiceUnavailable: regexp.MustCompile(errsRegex.ServiceUnavailable()), + TooManyResults: regexp.MustCompile(errsRegex.TooManyResults()), } } @@ -438,6 +470,11 @@ func isFatalSendError(err error) bool { return false } +var ( + _ rpc.Error = JsonError{} + _ rpc.DataError = JsonError{} +) + // go-ethereum@v1.10.0/rpc/json.go type JsonError struct { Code int `json:"code"` @@ -452,7 +489,17 @@ func (err JsonError) Error() string { return err.Message } -func (err *JsonError) String() string { +// To satisfy rpc.Error interface +func (err JsonError) ErrorCode() int { + return err.Code +} + +// To satisfy rpc.DataError +func (err JsonError) ErrorData() interface{} { + return err.Data +} + +func (err JsonError) String() string { return fmt.Sprintf("json-rpc error { Code = %d, Message = '%s', Data = '%v' }", err.Code, err.Message, err.Data) } @@ -583,6 +630,96 @@ func ClassifySendError(err error, clientErrors config.ClientErrors, lggr logger. ) return commonclient.ExceedsMaxFee } + if sendError.IsTerminallyStuckConfigError(configErrors) { + lggr.Warnw("Transaction that would have been terminally stuck in the mempool detected on send. Marking as fatal error.", "err", sendError, "etx", tx) + // Attempt is thrown away in this case; we don't need it since it never got accepted by a node + return commonclient.TerminallyStuck + } lggr.Criticalw("Unknown error encountered when sending transaction", "err", err, "etx", tx) return commonclient.Unknown } + +var infura = ClientErrors{ + TooManyResults: regexp.MustCompile(`(: |^)query returned more than [0-9]+ results. Try with this block range \[0x[0-9A-F]+, 0x[0-9A-F]+\].$`), +} + +var alchemy = ClientErrors{ + TooManyResults: regexp.MustCompile(`(: |^)Log response size exceeded. You can make eth_getLogs requests with up to a [0-9A-Z]+ block range and no limit on the response size, or you can request any block range with a cap of [0-9A-Z]+ logs in the response. Based on your parameters and the response size limit, this block range should work: \[0x[0-9a-f]+, 0x[0-9a-f]+\]$`), +} + +var quicknode = ClientErrors{ + TooManyResults: regexp.MustCompile(`(: |^)eth_getLogs is limited to a [0-9,]+ range$`), +} + +var simplyvc = ClientErrors{ + TooManyResults: regexp.MustCompile(`too wide blocks range, the limit is [0-9,]+$`), +} + +var drpc = ClientErrors{ + TooManyResults: regexp.MustCompile(`(: |^)requested too many blocks from [0-9]+ to [0-9]+, maximum is set to [0-9,]+$`), +} + +// Linkpool, Blockdaemon, and Chainstack all return "request timed out" if the log results are too large for them to process +var defaultClient = ClientErrors{ + TooManyResults: regexp.MustCompile(`request timed out`), +} + +// JSON-RPC error codes which can indicate a refusal of the server to process an eth_getLogs request because the result set is too large +const ( + jsonRpcServerError = -32000 // Server error. SimplyVC uses this error code when too many results are returned + + // Server timeout. When the rpc server has its own limit on how long it can take to compile the results + // Examples: Linkpool, Chainstack, Block Daemon + jsonRpcTimedOut = -32002 + + // See: https://github.com/ethereum/go-ethereum/blob/master/rpc/errors.go#L63 + // Can occur if the rpc server is configured with a maximum byte limit on the response size of batch requests + jsonRpcResponseTooLarge = -32003 + + // Not implemented in geth by default, but is defined in EIP 1474 and implemented by infura and some other 3rd party rpc servers + // See: https://community.infura.io/t/getlogs-error-query-returned-more-than-1000-results/358/5 + jsonRpcLimitExceeded = -32005 // See also: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1474.md + + jsonRpcInvalidParams = -32602 // Invalid method params. Returned by alchemy if the block range is too large or there are too many results to return + + jsonRpcQuicknodeTooManyResults = -32614 // Undocumented error code used by Quicknode for too many results error +) + +func IsTooManyResults(err error, clientErrors config.ClientErrors) bool { + var rpcErr rpc.Error + + if !pkgerrors.As(err, &rpcErr) { + return false + } + configErrors := ClientErrorRegexes(clientErrors) + if configErrors.ErrIs(rpcErr, TooManyResults) { + return true + } + + switch rpcErr.ErrorCode() { + case jsonRpcResponseTooLarge: + return true + case jsonRpcLimitExceeded: + if infura.ErrIs(rpcErr, TooManyResults) { + return true + } + case jsonRpcInvalidParams: + if alchemy.ErrIs(rpcErr, TooManyResults) { + return true + } + case jsonRpcQuicknodeTooManyResults: + if quicknode.ErrIs(rpcErr, TooManyResults) { + return true + } + case jsonRpcTimedOut: + if defaultClient.ErrIs(rpcErr, TooManyResults) { + return true + } + case jsonRpcServerError: + if simplyvc.ErrIs(rpcErr, TooManyResults) || + drpc.ErrIs(rpcErr, TooManyResults) { + return true + } + } + return false +} diff --git a/core/chains/evm/client/errors_test.go b/core/chains/evm/client/errors_test.go index cca54c2a4a9..84e518db666 100644 --- a/core/chains/evm/client/errors_test.go +++ b/core/chains/evm/client/errors_test.go @@ -1,7 +1,9 @@ package client_test import ( + "encoding/json" "errors" + "fmt" "testing" pkgerrors "github.com/pkg/errors" @@ -44,6 +46,7 @@ func Test_Eth_Errors(t *testing.T) { {"call failed: OldNonce, Current nonce: 22, nonce of rejected tx: 17", true, "Nethermind"}, {"nonce too low. allowed nonce range: 427 - 447, actual: 426", true, "zkSync"}, {"client error nonce too low", true, "tomlConfig"}, + {"[Request ID: 2e952947-ffad-408b-aed9-35f3ed152001] Nonce too low. Provided nonce: 15, current nonce: 15", true, "hedera"}, } for _, test := range tests { @@ -65,6 +68,7 @@ func Test_Eth_Errors(t *testing.T) { {"nonce too high", true, "Erigon"}, {"nonce too high. allowed nonce range: 427 - 477, actual: 527", true, "zkSync"}, {"client error nonce too high", true, "tomlConfig"}, + {"[Request ID: 3ec591b4-9396-49f4-a03f-06c415a7cc6a] Nonce too high. Provided nonce: 16, current nonce: 15", true, "hedera"}, } for _, test := range tests { @@ -136,6 +140,7 @@ func Test_Eth_Errors(t *testing.T) { // This seems to be an erroneous message from the zkSync client, we'll have to match it anyway {"ErrorObject { code: ServerError(3), message: \\\"known transaction. transaction with hash 0xf016…ad63 is already in the system\\\", data: Some(RawValue(\\\"0x\\\")) }", true, "zkSync"}, {"client error transaction already in mempool", true, "tomlConfig"}, + {"alreadyknown", true, "Gnosis"}, } for _, test := range tests { err = evmclient.NewSendErrorS(test.message) @@ -166,6 +171,8 @@ func Test_Eth_Errors(t *testing.T) { {"max fee per gas less than block base fee", true, "zkSync"}, {"virtual machine entered unexpected state. please contact developers and provide transaction details that caused this error. Error description: The operator included transaction with an unacceptable gas price", true, "zkSync"}, {"client error terminally underpriced", true, "tomlConfig"}, + {"gas price less than block base fee", true, "aStar"}, + {"[Request ID: e4d09e44-19a4-4eb7-babe-270db4c2ebc9] Gas price '830000000000' is below configured minimum gas price '950000000000'", true, "hedera"}, } for _, test := range tests { @@ -214,6 +221,9 @@ func Test_Eth_Errors(t *testing.T) { {"insufficient funds for gas + value. balance: 42719769622667482000, fee: 48098250000000, value: 42719769622667482000", true, "celo"}, {"client error insufficient eth", true, "tomlConfig"}, {"transaction would cause overdraft", true, "Geth"}, + {"failed to forward tx to sequencer, please try again. Error message: 'insufficient funds for gas * price + value'", true, "Mantle"}, + {"[Request ID: 9dd78806-58c8-4e6d-89a8-a60962abe705] Error invoking RPC: transaction 0.0.3041916@1717691931.680570179 failed precheck with status INSUFFICIENT_PAYER_BALANCE", true, "hedera"}, + {"[Request ID: 6198d2a3-590f-4724-aae5-69fecead0c49] Insufficient funds for transfer", true, "hedera"}, } for _, test := range tests { err = evmclient.NewSendErrorS(test.message) @@ -227,7 +237,10 @@ func Test_Eth_Errors(t *testing.T) { tests := []errorCase{ {"call failed: 503 Service Unavailable: \r\n503 Service Temporarily Unavailable\r\n\r\n

503 Service Temporarily Unavailable

\r\n\r\n\r\n", true, "Nethermind"}, {"call failed: 502 Bad Gateway: \r\n502 Bad Gateway\r\n\r\n

502 Bad Gateway

\r\n
", true, "Arbitrum"}, + {"i/o timeout", true, "Arbitrum"}, + {"network is unreachable", true, "Arbitrum"}, {"client error service unavailable", true, "tomlConfig"}, + {"[Request ID: 825608a8-fd8a-4b5b-aea7-92999509306d] Error invoking RPC: [Request ID: 825608a8-fd8a-4b5b-aea7-92999509306d] Transaction execution returns a null value for transaction", true, "hedera"}, } for _, test := range tests { err = evmclient.NewSendErrorS(test.message) @@ -285,7 +298,7 @@ func Test_Eth_Errors(t *testing.T) { }) t.Run("Metis gas price errors", func(t *testing.T) { - err := evmclient.NewSendErrorS("primary websocket (wss://ws-mainnet.metis.io) call failed: gas price too low: 18000000000 wei, use at least tx.gasPrice = 19500000000 wei") + err = evmclient.NewSendErrorS("primary websocket (wss://ws-mainnet.metis.io) call failed: gas price too low: 18000000000 wei, use at least tx.gasPrice = 19500000000 wei") assert.True(t, err.L2FeeTooLow(clientErrors)) err = newSendErrorWrapped("primary websocket (wss://ws-mainnet.metis.io) call failed: gas price too low: 18000000000 wei, use at least tx.gasPrice = 19500000000 wei") assert.True(t, err.L2FeeTooLow(clientErrors)) @@ -297,7 +310,7 @@ func Test_Eth_Errors(t *testing.T) { }) t.Run("moonriver errors", func(t *testing.T) { - err := evmclient.NewSendErrorS("primary http (http://***REDACTED***:9933) call failed: submit transaction to pool failed: Pool(Stale)") + err = evmclient.NewSendErrorS("primary http (http://***REDACTED***:9933) call failed: submit transaction to pool failed: Pool(Stale)") assert.True(t, err.IsNonceTooLowError(clientErrors)) assert.False(t, err.IsTransactionAlreadyInMempool(clientErrors)) assert.False(t, err.Fatal(clientErrors)) @@ -306,6 +319,26 @@ func Test_Eth_Errors(t *testing.T) { assert.False(t, err.IsNonceTooLowError(clientErrors)) assert.False(t, err.Fatal(clientErrors)) }) + + t.Run("IsTerminallyStuck", func(t *testing.T) { + tests := []errorCase{ + {"failed to add tx to the pool: not enough step counters to continue the execution", true, "zkEVM"}, + {"failed to add tx to the pool: not enough step counters to continue the execution", true, "Xlayer"}, + {"failed to add tx to the pool: not enough keccak counters to continue the execution", true, "zkEVM"}, + {"failed to add tx to the pool: not enough keccak counters to continue the execution", true, "Xlayer"}, + {"RPC error response: failed to add tx to the pool: out of counters at node level (Steps)", true, "zkEVM"}, + {"RPC error response: failed to add tx to the pool: out of counters at node level (GasUsed, KeccakHashes, PoseidonHashes, PoseidonPaddings, MemAligns, Arithmetics, Binaries, Steps, Sha256Hashes)", true, "Xlayer"}, + } + + for _, test := range tests { + t.Run(test.network, func(t *testing.T) { + err = evmclient.NewSendErrorS(test.message) + assert.Equal(t, err.IsTerminallyStuckConfigError(clientErrors), test.expect) + err = newSendErrorWrapped(test.message) + assert.Equal(t, err.IsTerminallyStuckConfigError(clientErrors), test.expect) + }) + } + }) } func Test_Eth_Errors_Fatal(t *testing.T) { @@ -379,7 +412,11 @@ func Test_Eth_Errors_Fatal(t *testing.T) { {"Failed to serialize transaction: max priority fee per gas higher than 2^64-1", true, "zkSync"}, {"Failed to serialize transaction: oversized data. max: 1000000; actual: 1000000", true, "zkSync"}, + {"failed to forward tx to sequencer, please try again. Error message: 'invalid sender'", true, "Mantle"}, + {"client error fatal", true, "tomlConfig"}, + {"[Request ID: d9711488-4c1e-4af2-bc1f-7969913d7b60] Error invoking RPC: transaction 0.0.4425573@1718213476.914320044 failed precheck with status INVALID_SIGNATURE", true, "hedera"}, + {"invalid chain id for signer", true, "Treasure"}, } for _, test := range tests { @@ -413,3 +450,86 @@ func Test_Config_Errors(t *testing.T) { assert.False(t, clientErrors.ErrIs(errors.New("some old bollocks"), evmclient.NonceTooLow)) }) } + +func Test_IsTooManyResultsError(t *testing.T) { + customErrors := evmclient.NewTestClientErrors() + + tests := []errorCase{ + {`{ + "code":-32602, + "message":"Log response size exceeded. You can make eth_getLogs requests with up to a 2K block range and no limit on the response size, or you can request any block range with a cap of 10K logs in the response. Based on your parameters and the response size limit, this block range should work: [0x0, 0x133e71]"}`, + true, + "alchemy", + }, {`{ + "code":-32005, + "data":{"from":"0xCB3D","limit":10000,"to":"0x7B737"}, + "message":"query returned more than 10000 results. Try with this block range [0xCB3D, 0x7B737]."}`, + true, + "infura", + }, {`{ + "code":-32002, + "message":"request timed out"}`, + true, + "LinkPool-Blockdaemon-Chainstack", + }, {`{ + "code":-32614, + "message":"eth_getLogs is limited to a 10,000 range"}`, + true, + "Quicknode", + }, {`{ + "code":-32000, + "message":"too wide blocks range, the limit is 100"}`, + true, + "SimplyVC", + }, {`{ + "message":"requested too many blocks from 0 to 16777216, maximum is set to 2048", + "code":-32000}`, + true, + "Drpc", + }, {` + + + + 503 Backend fetch failed + + +

Error 503 Backend fetch failed

+

Backend fetch failed

+

Guru Meditation:

+

XID: 343710611

+
+

Varnish cache server

+ +`, + false, + "Nirvana Labs"}, // This isn't an error response we can handle, but including for completeness. }, + + {`{ + "code":-32000", + "message":"unrelated server error"}`, + false, + "any", + }, {`{ + "code":-32500, + "message":"unrelated error code"}`, + false, + "any2", + }, {fmt.Sprintf(`{ + "code" : -43106, + "message" : "%s"}`, customErrors.TooManyResults()), + true, + "custom chain with error specified in toml config", + }, + } + + for _, test := range tests { + t.Run(test.network, func(t *testing.T) { + jsonRpcErr := evmclient.JsonError{} + err := json.Unmarshal([]byte(test.message), &jsonRpcErr) + if err == nil { + err = jsonRpcErr + } + assert.Equal(t, test.expect, evmclient.IsTooManyResults(err, &customErrors)) + }) + } +} diff --git a/core/chains/evm/client/evm_client.go b/core/chains/evm/client/evm_client.go index fd7fa5868a4..c26362d6351 100644 --- a/core/chains/evm/client/evm_client.go +++ b/core/chains/evm/client/evm_client.go @@ -3,6 +3,7 @@ package client import ( "math/big" "net/url" + "time" "github.com/smartcontractkit/chainlink-common/pkg/logger" @@ -17,16 +18,17 @@ func NewEvmClient(cfg evmconfig.NodePool, chainCfg commonclient.ChainConfig, cli var empty url.URL var primaries []commonclient.Node[*big.Int, *evmtypes.Head, RPCClient] var sendonlys []commonclient.SendOnlyNode[*big.Int, RPCClient] + largePayloadRPCTimeout, defaultRPCTimeout := getRPCTimeouts(chainType) for i, node := range nodes { if node.SendOnly != nil && *node.SendOnly { rpc := NewRPCClient(lggr, empty, (*url.URL)(node.HTTPURL), *node.Name, int32(i), chainID, - commonclient.Secondary) + commonclient.Secondary, cfg.FinalizedBlockPollInterval(), cfg.NewHeadsPollInterval(), largePayloadRPCTimeout, defaultRPCTimeout, chainType) sendonly := commonclient.NewSendOnlyNode(lggr, (url.URL)(*node.HTTPURL), *node.Name, chainID, rpc) sendonlys = append(sendonlys, sendonly) } else { rpc := NewRPCClient(lggr, (url.URL)(*node.WSURL), (*url.URL)(node.HTTPURL), *node.Name, int32(i), - chainID, commonclient.Primary) + chainID, commonclient.Primary, cfg.FinalizedBlockPollInterval(), cfg.NewHeadsPollInterval(), largePayloadRPCTimeout, defaultRPCTimeout, chainType) primaryNode := commonclient.NewNode(cfg, chainCfg, lggr, (url.URL)(*node.WSURL), (*url.URL)(node.HTTPURL), *node.Name, int32(i), chainID, *node.Order, rpc, "EVM") @@ -37,3 +39,11 @@ func NewEvmClient(cfg evmconfig.NodePool, chainCfg commonclient.ChainConfig, cli return NewChainClient(lggr, cfg.SelectionMode(), cfg.LeaseDuration(), chainCfg.NodeNoNewHeadsThreshold(), primaries, sendonlys, chainID, chainType, clientErrors, cfg.DeathDeclarationDelay()) } + +func getRPCTimeouts(chainType chaintype.ChainType) (largePayload, defaultTimeout time.Duration) { + if chaintype.ChainHedera == chainType { + return 30 * time.Second, commonclient.QueryTimeout + } + + return commonclient.QueryTimeout, commonclient.QueryTimeout +} diff --git a/core/chains/evm/client/evm_client_test.go b/core/chains/evm/client/evm_client_test.go index 9ad25f96025..b762c14653c 100644 --- a/core/chains/evm/client/evm_client_test.go +++ b/core/chains/evm/client/evm_client_test.go @@ -27,6 +27,9 @@ func TestNewEvmClient(t *testing.T) { finalizedBlockOffset := ptr[uint32](16) enforceRepeatableRead := ptr(true) deathDeclarationDelay := time.Second * 3 + noNewFinalizedBlocksThreshold := time.Second * 5 + finalizedBlockPollInterval := time.Second * 4 + newHeadsPollInterval := time.Second * 4 nodeConfigs := []client.NodeConfig{ { Name: ptr("foo"), @@ -38,7 +41,8 @@ func TestNewEvmClient(t *testing.T) { finalityTagEnabled := ptr(true) chainCfg, nodePool, nodes, err := client.NewClientConfigs(selectionMode, leaseDuration, chainTypeStr, nodeConfigs, pollFailureThreshold, pollInterval, syncThreshold, nodeIsSyncingEnabled, noNewHeadsThreshold, finalityDepth, - finalityTagEnabled, finalizedBlockOffset, enforceRepeatableRead, deathDeclarationDelay) + finalityTagEnabled, finalizedBlockOffset, enforceRepeatableRead, deathDeclarationDelay, noNewFinalizedBlocksThreshold, + finalizedBlockPollInterval, newHeadsPollInterval) require.NoError(t, err) client := client.NewEvmClient(nodePool, chainCfg, nil, logger.Test(t), testutils.FixtureChainID, nodes, chaintype.ChainType(chainTypeStr)) diff --git a/core/chains/evm/client/helpers_test.go b/core/chains/evm/client/helpers_test.go index e1017a5564f..031f6481574 100644 --- a/core/chains/evm/client/helpers_test.go +++ b/core/chains/evm/client/helpers_test.go @@ -34,6 +34,7 @@ type TestClientErrors struct { transactionAlreadyMined string fatal string serviceUnavailable string + tooManyResults string } func NewTestClientErrors() TestClientErrors { @@ -52,6 +53,7 @@ func NewTestClientErrors() TestClientErrors { transactionAlreadyMined: "client error transaction already mined", fatal: "client error fatal", serviceUnavailable: "client error service unavailable", + tooManyResults: "client error too many results", } } @@ -77,6 +79,7 @@ func (c *TestClientErrors) L2Full() string { return c.l2Full } func (c *TestClientErrors) TransactionAlreadyMined() string { return c.transactionAlreadyMined } func (c *TestClientErrors) Fatal() string { return c.fatal } func (c *TestClientErrors) ServiceUnavailable() string { return c.serviceUnavailable } +func (c *TestClientErrors) TooManyResults() string { return c.serviceUnavailable } type TestNodePoolConfig struct { NodePollFailureThreshold uint32 @@ -89,6 +92,7 @@ type TestNodePoolConfig struct { NodeErrors config.ClientErrors EnforceRepeatableReadVal bool NodeDeathDeclarationDelay time.Duration + NodeNewHeadsPollInterval time.Duration } func (tc TestNodePoolConfig) PollFailureThreshold() uint32 { return tc.NodePollFailureThreshold } @@ -107,6 +111,10 @@ func (tc TestNodePoolConfig) FinalizedBlockPollInterval() time.Duration { return tc.NodeFinalizedBlockPollInterval } +func (tc TestNodePoolConfig) NewHeadsPollInterval() time.Duration { + return tc.NodeNewHeadsPollInterval +} + func (tc TestNodePoolConfig) Errors() config.ClientErrors { return tc.NodeErrors } @@ -140,7 +148,7 @@ func NewChainClientWithTestNode( } lggr := logger.Test(t) - rpc := NewRPCClient(lggr, *parsed, rpcHTTPURL, "eth-primary-rpc-0", id, chainID, commonclient.Primary) + rpc := NewRPCClient(lggr, *parsed, rpcHTTPURL, "eth-primary-rpc-0", id, chainID, commonclient.Primary, 0, 0, commonclient.QueryTimeout, commonclient.QueryTimeout, "") n := commonclient.NewNode[*big.Int, *evmtypes.Head, RPCClient]( nodeCfg, clientMocks.ChainConfig{NoNewHeadsThresholdVal: noNewHeadsThreshold}, lggr, *parsed, rpcHTTPURL, "eth-primary-node-0", id, chainID, 1, rpc, "EVM") @@ -152,7 +160,7 @@ func NewChainClientWithTestNode( return nil, pkgerrors.Errorf("sendonly ethereum rpc url scheme must be http(s): %s", u.String()) } var empty url.URL - rpc := NewRPCClient(lggr, empty, &sendonlyRPCURLs[i], fmt.Sprintf("eth-sendonly-rpc-%d", i), id, chainID, commonclient.Secondary) + rpc := NewRPCClient(lggr, empty, &sendonlyRPCURLs[i], fmt.Sprintf("eth-sendonly-rpc-%d", i), id, chainID, commonclient.Secondary, 0, 0, commonclient.QueryTimeout, commonclient.QueryTimeout, "") s := commonclient.NewSendOnlyNode[*big.Int, RPCClient]( lggr, u, fmt.Sprintf("eth-sendonly-%d", i), chainID, rpc) sendonlys = append(sendonlys, s) diff --git a/core/chains/evm/client/mocks/batch_sender.go b/core/chains/evm/client/mocks/batch_sender.go deleted file mode 100644 index f6a3601ceab..00000000000 --- a/core/chains/evm/client/mocks/batch_sender.go +++ /dev/null @@ -1,47 +0,0 @@ -// Code generated by mockery v2.42.2. DO NOT EDIT. - -package mocks - -import ( - context "context" - - rpc "github.com/ethereum/go-ethereum/rpc" - mock "github.com/stretchr/testify/mock" -) - -// BatchSender is an autogenerated mock type for the BatchSender type -type BatchSender struct { - mock.Mock -} - -// BatchCallContext provides a mock function with given fields: ctx, b -func (_m *BatchSender) BatchCallContext(ctx context.Context, b []rpc.BatchElem) error { - ret := _m.Called(ctx, b) - - if len(ret) == 0 { - panic("no return value specified for BatchCallContext") - } - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, []rpc.BatchElem) error); ok { - r0 = rf(ctx, b) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// NewBatchSender creates a new instance of BatchSender. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewBatchSender(t interface { - mock.TestingT - Cleanup(func()) -}) *BatchSender { - mock := &BatchSender{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/core/chains/evm/client/mocks/client.go b/core/chains/evm/client/mocks/client.go index 8a5b29cf4cb..da034d95774 100644 --- a/core/chains/evm/client/mocks/client.go +++ b/core/chains/evm/client/mocks/client.go @@ -31,6 +31,14 @@ type Client struct { mock.Mock } +type Client_Expecter struct { + mock *mock.Mock +} + +func (_m *Client) EXPECT() *Client_Expecter { + return &Client_Expecter{mock: &_m.Mock} +} + // BalanceAt provides a mock function with given fields: ctx, account, blockNumber func (_m *Client) BalanceAt(ctx context.Context, account common.Address, blockNumber *big.Int) (*big.Int, error) { ret := _m.Called(ctx, account, blockNumber) @@ -61,6 +69,36 @@ func (_m *Client) BalanceAt(ctx context.Context, account common.Address, blockNu return r0, r1 } +// Client_BalanceAt_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BalanceAt' +type Client_BalanceAt_Call struct { + *mock.Call +} + +// BalanceAt is a helper method to define mock.On call +// - ctx context.Context +// - account common.Address +// - blockNumber *big.Int +func (_e *Client_Expecter) BalanceAt(ctx interface{}, account interface{}, blockNumber interface{}) *Client_BalanceAt_Call { + return &Client_BalanceAt_Call{Call: _e.mock.On("BalanceAt", ctx, account, blockNumber)} +} + +func (_c *Client_BalanceAt_Call) Run(run func(ctx context.Context, account common.Address, blockNumber *big.Int)) *Client_BalanceAt_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(common.Address), args[2].(*big.Int)) + }) + return _c +} + +func (_c *Client_BalanceAt_Call) Return(_a0 *big.Int, _a1 error) *Client_BalanceAt_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Client_BalanceAt_Call) RunAndReturn(run func(context.Context, common.Address, *big.Int) (*big.Int, error)) *Client_BalanceAt_Call { + _c.Call.Return(run) + return _c +} + // BatchCallContext provides a mock function with given fields: ctx, b func (_m *Client) BatchCallContext(ctx context.Context, b []rpc.BatchElem) error { ret := _m.Called(ctx, b) @@ -79,6 +117,35 @@ func (_m *Client) BatchCallContext(ctx context.Context, b []rpc.BatchElem) error return r0 } +// Client_BatchCallContext_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BatchCallContext' +type Client_BatchCallContext_Call struct { + *mock.Call +} + +// BatchCallContext is a helper method to define mock.On call +// - ctx context.Context +// - b []rpc.BatchElem +func (_e *Client_Expecter) BatchCallContext(ctx interface{}, b interface{}) *Client_BatchCallContext_Call { + return &Client_BatchCallContext_Call{Call: _e.mock.On("BatchCallContext", ctx, b)} +} + +func (_c *Client_BatchCallContext_Call) Run(run func(ctx context.Context, b []rpc.BatchElem)) *Client_BatchCallContext_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].([]rpc.BatchElem)) + }) + return _c +} + +func (_c *Client_BatchCallContext_Call) Return(_a0 error) *Client_BatchCallContext_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Client_BatchCallContext_Call) RunAndReturn(run func(context.Context, []rpc.BatchElem) error) *Client_BatchCallContext_Call { + _c.Call.Return(run) + return _c +} + // BatchCallContextAll provides a mock function with given fields: ctx, b func (_m *Client) BatchCallContextAll(ctx context.Context, b []rpc.BatchElem) error { ret := _m.Called(ctx, b) @@ -97,6 +164,35 @@ func (_m *Client) BatchCallContextAll(ctx context.Context, b []rpc.BatchElem) er return r0 } +// Client_BatchCallContextAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BatchCallContextAll' +type Client_BatchCallContextAll_Call struct { + *mock.Call +} + +// BatchCallContextAll is a helper method to define mock.On call +// - ctx context.Context +// - b []rpc.BatchElem +func (_e *Client_Expecter) BatchCallContextAll(ctx interface{}, b interface{}) *Client_BatchCallContextAll_Call { + return &Client_BatchCallContextAll_Call{Call: _e.mock.On("BatchCallContextAll", ctx, b)} +} + +func (_c *Client_BatchCallContextAll_Call) Run(run func(ctx context.Context, b []rpc.BatchElem)) *Client_BatchCallContextAll_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].([]rpc.BatchElem)) + }) + return _c +} + +func (_c *Client_BatchCallContextAll_Call) Return(_a0 error) *Client_BatchCallContextAll_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Client_BatchCallContextAll_Call) RunAndReturn(run func(context.Context, []rpc.BatchElem) error) *Client_BatchCallContextAll_Call { + _c.Call.Return(run) + return _c +} + // BlockByHash provides a mock function with given fields: ctx, hash func (_m *Client) BlockByHash(ctx context.Context, hash common.Hash) (*types.Block, error) { ret := _m.Called(ctx, hash) @@ -127,6 +223,35 @@ func (_m *Client) BlockByHash(ctx context.Context, hash common.Hash) (*types.Blo return r0, r1 } +// Client_BlockByHash_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BlockByHash' +type Client_BlockByHash_Call struct { + *mock.Call +} + +// BlockByHash is a helper method to define mock.On call +// - ctx context.Context +// - hash common.Hash +func (_e *Client_Expecter) BlockByHash(ctx interface{}, hash interface{}) *Client_BlockByHash_Call { + return &Client_BlockByHash_Call{Call: _e.mock.On("BlockByHash", ctx, hash)} +} + +func (_c *Client_BlockByHash_Call) Run(run func(ctx context.Context, hash common.Hash)) *Client_BlockByHash_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(common.Hash)) + }) + return _c +} + +func (_c *Client_BlockByHash_Call) Return(_a0 *types.Block, _a1 error) *Client_BlockByHash_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Client_BlockByHash_Call) RunAndReturn(run func(context.Context, common.Hash) (*types.Block, error)) *Client_BlockByHash_Call { + _c.Call.Return(run) + return _c +} + // BlockByNumber provides a mock function with given fields: ctx, number func (_m *Client) BlockByNumber(ctx context.Context, number *big.Int) (*types.Block, error) { ret := _m.Called(ctx, number) @@ -157,6 +282,35 @@ func (_m *Client) BlockByNumber(ctx context.Context, number *big.Int) (*types.Bl return r0, r1 } +// Client_BlockByNumber_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BlockByNumber' +type Client_BlockByNumber_Call struct { + *mock.Call +} + +// BlockByNumber is a helper method to define mock.On call +// - ctx context.Context +// - number *big.Int +func (_e *Client_Expecter) BlockByNumber(ctx interface{}, number interface{}) *Client_BlockByNumber_Call { + return &Client_BlockByNumber_Call{Call: _e.mock.On("BlockByNumber", ctx, number)} +} + +func (_c *Client_BlockByNumber_Call) Run(run func(ctx context.Context, number *big.Int)) *Client_BlockByNumber_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*big.Int)) + }) + return _c +} + +func (_c *Client_BlockByNumber_Call) Return(_a0 *types.Block, _a1 error) *Client_BlockByNumber_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Client_BlockByNumber_Call) RunAndReturn(run func(context.Context, *big.Int) (*types.Block, error)) *Client_BlockByNumber_Call { + _c.Call.Return(run) + return _c +} + // CallContext provides a mock function with given fields: ctx, result, method, args func (_m *Client) CallContext(ctx context.Context, result interface{}, method string, args ...interface{}) error { var _ca []interface{} @@ -178,6 +332,44 @@ func (_m *Client) CallContext(ctx context.Context, result interface{}, method st return r0 } +// Client_CallContext_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CallContext' +type Client_CallContext_Call struct { + *mock.Call +} + +// CallContext is a helper method to define mock.On call +// - ctx context.Context +// - result interface{} +// - method string +// - args ...interface{} +func (_e *Client_Expecter) CallContext(ctx interface{}, result interface{}, method interface{}, args ...interface{}) *Client_CallContext_Call { + return &Client_CallContext_Call{Call: _e.mock.On("CallContext", + append([]interface{}{ctx, result, method}, args...)...)} +} + +func (_c *Client_CallContext_Call) Run(run func(ctx context.Context, result interface{}, method string, args ...interface{})) *Client_CallContext_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-3) + for i, a := range args[3:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(args[0].(context.Context), args[1].(interface{}), args[2].(string), variadicArgs...) + }) + return _c +} + +func (_c *Client_CallContext_Call) Return(_a0 error) *Client_CallContext_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Client_CallContext_Call) RunAndReturn(run func(context.Context, interface{}, string, ...interface{}) error) *Client_CallContext_Call { + _c.Call.Return(run) + return _c +} + // CallContract provides a mock function with given fields: ctx, msg, blockNumber func (_m *Client) CallContract(ctx context.Context, msg ethereum.CallMsg, blockNumber *big.Int) ([]byte, error) { ret := _m.Called(ctx, msg, blockNumber) @@ -208,6 +400,36 @@ func (_m *Client) CallContract(ctx context.Context, msg ethereum.CallMsg, blockN return r0, r1 } +// Client_CallContract_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CallContract' +type Client_CallContract_Call struct { + *mock.Call +} + +// CallContract is a helper method to define mock.On call +// - ctx context.Context +// - msg ethereum.CallMsg +// - blockNumber *big.Int +func (_e *Client_Expecter) CallContract(ctx interface{}, msg interface{}, blockNumber interface{}) *Client_CallContract_Call { + return &Client_CallContract_Call{Call: _e.mock.On("CallContract", ctx, msg, blockNumber)} +} + +func (_c *Client_CallContract_Call) Run(run func(ctx context.Context, msg ethereum.CallMsg, blockNumber *big.Int)) *Client_CallContract_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(ethereum.CallMsg), args[2].(*big.Int)) + }) + return _c +} + +func (_c *Client_CallContract_Call) Return(_a0 []byte, _a1 error) *Client_CallContract_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Client_CallContract_Call) RunAndReturn(run func(context.Context, ethereum.CallMsg, *big.Int) ([]byte, error)) *Client_CallContract_Call { + _c.Call.Return(run) + return _c +} + // ChainID provides a mock function with given fields: func (_m *Client) ChainID() (*big.Int, error) { ret := _m.Called() @@ -238,6 +460,33 @@ func (_m *Client) ChainID() (*big.Int, error) { return r0, r1 } +// Client_ChainID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ChainID' +type Client_ChainID_Call struct { + *mock.Call +} + +// ChainID is a helper method to define mock.On call +func (_e *Client_Expecter) ChainID() *Client_ChainID_Call { + return &Client_ChainID_Call{Call: _e.mock.On("ChainID")} +} + +func (_c *Client_ChainID_Call) Run(run func()) *Client_ChainID_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Client_ChainID_Call) Return(_a0 *big.Int, _a1 error) *Client_ChainID_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Client_ChainID_Call) RunAndReturn(run func() (*big.Int, error)) *Client_ChainID_Call { + _c.Call.Return(run) + return _c +} + // CheckTxValidity provides a mock function with given fields: ctx, from, to, data func (_m *Client) CheckTxValidity(ctx context.Context, from common.Address, to common.Address, data []byte) *client.SendError { ret := _m.Called(ctx, from, to, data) @@ -258,11 +507,69 @@ func (_m *Client) CheckTxValidity(ctx context.Context, from common.Address, to c return r0 } +// Client_CheckTxValidity_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CheckTxValidity' +type Client_CheckTxValidity_Call struct { + *mock.Call +} + +// CheckTxValidity is a helper method to define mock.On call +// - ctx context.Context +// - from common.Address +// - to common.Address +// - data []byte +func (_e *Client_Expecter) CheckTxValidity(ctx interface{}, from interface{}, to interface{}, data interface{}) *Client_CheckTxValidity_Call { + return &Client_CheckTxValidity_Call{Call: _e.mock.On("CheckTxValidity", ctx, from, to, data)} +} + +func (_c *Client_CheckTxValidity_Call) Run(run func(ctx context.Context, from common.Address, to common.Address, data []byte)) *Client_CheckTxValidity_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(common.Address), args[2].(common.Address), args[3].([]byte)) + }) + return _c +} + +func (_c *Client_CheckTxValidity_Call) Return(_a0 *client.SendError) *Client_CheckTxValidity_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Client_CheckTxValidity_Call) RunAndReturn(run func(context.Context, common.Address, common.Address, []byte) *client.SendError) *Client_CheckTxValidity_Call { + _c.Call.Return(run) + return _c +} + // Close provides a mock function with given fields: func (_m *Client) Close() { _m.Called() } +// Client_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close' +type Client_Close_Call struct { + *mock.Call +} + +// Close is a helper method to define mock.On call +func (_e *Client_Expecter) Close() *Client_Close_Call { + return &Client_Close_Call{Call: _e.mock.On("Close")} +} + +func (_c *Client_Close_Call) Run(run func()) *Client_Close_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Client_Close_Call) Return() *Client_Close_Call { + _c.Call.Return() + return _c +} + +func (_c *Client_Close_Call) RunAndReturn(run func()) *Client_Close_Call { + _c.Call.Return(run) + return _c +} + // CodeAt provides a mock function with given fields: ctx, account, blockNumber func (_m *Client) CodeAt(ctx context.Context, account common.Address, blockNumber *big.Int) ([]byte, error) { ret := _m.Called(ctx, account, blockNumber) @@ -293,6 +600,36 @@ func (_m *Client) CodeAt(ctx context.Context, account common.Address, blockNumbe return r0, r1 } +// Client_CodeAt_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CodeAt' +type Client_CodeAt_Call struct { + *mock.Call +} + +// CodeAt is a helper method to define mock.On call +// - ctx context.Context +// - account common.Address +// - blockNumber *big.Int +func (_e *Client_Expecter) CodeAt(ctx interface{}, account interface{}, blockNumber interface{}) *Client_CodeAt_Call { + return &Client_CodeAt_Call{Call: _e.mock.On("CodeAt", ctx, account, blockNumber)} +} + +func (_c *Client_CodeAt_Call) Run(run func(ctx context.Context, account common.Address, blockNumber *big.Int)) *Client_CodeAt_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(common.Address), args[2].(*big.Int)) + }) + return _c +} + +func (_c *Client_CodeAt_Call) Return(_a0 []byte, _a1 error) *Client_CodeAt_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Client_CodeAt_Call) RunAndReturn(run func(context.Context, common.Address, *big.Int) ([]byte, error)) *Client_CodeAt_Call { + _c.Call.Return(run) + return _c +} + // ConfiguredChainID provides a mock function with given fields: func (_m *Client) ConfiguredChainID() *big.Int { ret := _m.Called() @@ -313,6 +650,33 @@ func (_m *Client) ConfiguredChainID() *big.Int { return r0 } +// Client_ConfiguredChainID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ConfiguredChainID' +type Client_ConfiguredChainID_Call struct { + *mock.Call +} + +// ConfiguredChainID is a helper method to define mock.On call +func (_e *Client_Expecter) ConfiguredChainID() *Client_ConfiguredChainID_Call { + return &Client_ConfiguredChainID_Call{Call: _e.mock.On("ConfiguredChainID")} +} + +func (_c *Client_ConfiguredChainID_Call) Run(run func()) *Client_ConfiguredChainID_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Client_ConfiguredChainID_Call) Return(_a0 *big.Int) *Client_ConfiguredChainID_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Client_ConfiguredChainID_Call) RunAndReturn(run func() *big.Int) *Client_ConfiguredChainID_Call { + _c.Call.Return(run) + return _c +} + // Dial provides a mock function with given fields: ctx func (_m *Client) Dial(ctx context.Context) error { ret := _m.Called(ctx) @@ -331,6 +695,34 @@ func (_m *Client) Dial(ctx context.Context) error { return r0 } +// Client_Dial_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Dial' +type Client_Dial_Call struct { + *mock.Call +} + +// Dial is a helper method to define mock.On call +// - ctx context.Context +func (_e *Client_Expecter) Dial(ctx interface{}) *Client_Dial_Call { + return &Client_Dial_Call{Call: _e.mock.On("Dial", ctx)} +} + +func (_c *Client_Dial_Call) Run(run func(ctx context.Context)) *Client_Dial_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *Client_Dial_Call) Return(_a0 error) *Client_Dial_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Client_Dial_Call) RunAndReturn(run func(context.Context) error) *Client_Dial_Call { + _c.Call.Return(run) + return _c +} + // EstimateGas provides a mock function with given fields: ctx, call func (_m *Client) EstimateGas(ctx context.Context, call ethereum.CallMsg) (uint64, error) { ret := _m.Called(ctx, call) @@ -359,6 +751,95 @@ func (_m *Client) EstimateGas(ctx context.Context, call ethereum.CallMsg) (uint6 return r0, r1 } +// Client_EstimateGas_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EstimateGas' +type Client_EstimateGas_Call struct { + *mock.Call +} + +// EstimateGas is a helper method to define mock.On call +// - ctx context.Context +// - call ethereum.CallMsg +func (_e *Client_Expecter) EstimateGas(ctx interface{}, call interface{}) *Client_EstimateGas_Call { + return &Client_EstimateGas_Call{Call: _e.mock.On("EstimateGas", ctx, call)} +} + +func (_c *Client_EstimateGas_Call) Run(run func(ctx context.Context, call ethereum.CallMsg)) *Client_EstimateGas_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(ethereum.CallMsg)) + }) + return _c +} + +func (_c *Client_EstimateGas_Call) Return(_a0 uint64, _a1 error) *Client_EstimateGas_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Client_EstimateGas_Call) RunAndReturn(run func(context.Context, ethereum.CallMsg) (uint64, error)) *Client_EstimateGas_Call { + _c.Call.Return(run) + return _c +} + +// FeeHistory provides a mock function with given fields: ctx, blockCount, rewardPercentiles +func (_m *Client) FeeHistory(ctx context.Context, blockCount uint64, rewardPercentiles []float64) (*ethereum.FeeHistory, error) { + ret := _m.Called(ctx, blockCount, rewardPercentiles) + + if len(ret) == 0 { + panic("no return value specified for FeeHistory") + } + + var r0 *ethereum.FeeHistory + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, uint64, []float64) (*ethereum.FeeHistory, error)); ok { + return rf(ctx, blockCount, rewardPercentiles) + } + if rf, ok := ret.Get(0).(func(context.Context, uint64, []float64) *ethereum.FeeHistory); ok { + r0 = rf(ctx, blockCount, rewardPercentiles) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*ethereum.FeeHistory) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, uint64, []float64) error); ok { + r1 = rf(ctx, blockCount, rewardPercentiles) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// Client_FeeHistory_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FeeHistory' +type Client_FeeHistory_Call struct { + *mock.Call +} + +// FeeHistory is a helper method to define mock.On call +// - ctx context.Context +// - blockCount uint64 +// - rewardPercentiles []float64 +func (_e *Client_Expecter) FeeHistory(ctx interface{}, blockCount interface{}, rewardPercentiles interface{}) *Client_FeeHistory_Call { + return &Client_FeeHistory_Call{Call: _e.mock.On("FeeHistory", ctx, blockCount, rewardPercentiles)} +} + +func (_c *Client_FeeHistory_Call) Run(run func(ctx context.Context, blockCount uint64, rewardPercentiles []float64)) *Client_FeeHistory_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(uint64), args[2].([]float64)) + }) + return _c +} + +func (_c *Client_FeeHistory_Call) Return(feeHistory *ethereum.FeeHistory, err error) *Client_FeeHistory_Call { + _c.Call.Return(feeHistory, err) + return _c +} + +func (_c *Client_FeeHistory_Call) RunAndReturn(run func(context.Context, uint64, []float64) (*ethereum.FeeHistory, error)) *Client_FeeHistory_Call { + _c.Call.Return(run) + return _c +} + // FilterLogs provides a mock function with given fields: ctx, q func (_m *Client) FilterLogs(ctx context.Context, q ethereum.FilterQuery) ([]types.Log, error) { ret := _m.Called(ctx, q) @@ -389,6 +870,35 @@ func (_m *Client) FilterLogs(ctx context.Context, q ethereum.FilterQuery) ([]typ return r0, r1 } +// Client_FilterLogs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterLogs' +type Client_FilterLogs_Call struct { + *mock.Call +} + +// FilterLogs is a helper method to define mock.On call +// - ctx context.Context +// - q ethereum.FilterQuery +func (_e *Client_Expecter) FilterLogs(ctx interface{}, q interface{}) *Client_FilterLogs_Call { + return &Client_FilterLogs_Call{Call: _e.mock.On("FilterLogs", ctx, q)} +} + +func (_c *Client_FilterLogs_Call) Run(run func(ctx context.Context, q ethereum.FilterQuery)) *Client_FilterLogs_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(ethereum.FilterQuery)) + }) + return _c +} + +func (_c *Client_FilterLogs_Call) Return(_a0 []types.Log, _a1 error) *Client_FilterLogs_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Client_FilterLogs_Call) RunAndReturn(run func(context.Context, ethereum.FilterQuery) ([]types.Log, error)) *Client_FilterLogs_Call { + _c.Call.Return(run) + return _c +} + // HeadByHash provides a mock function with given fields: ctx, n func (_m *Client) HeadByHash(ctx context.Context, n common.Hash) (*evmtypes.Head, error) { ret := _m.Called(ctx, n) @@ -419,6 +929,35 @@ func (_m *Client) HeadByHash(ctx context.Context, n common.Hash) (*evmtypes.Head return r0, r1 } +// Client_HeadByHash_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HeadByHash' +type Client_HeadByHash_Call struct { + *mock.Call +} + +// HeadByHash is a helper method to define mock.On call +// - ctx context.Context +// - n common.Hash +func (_e *Client_Expecter) HeadByHash(ctx interface{}, n interface{}) *Client_HeadByHash_Call { + return &Client_HeadByHash_Call{Call: _e.mock.On("HeadByHash", ctx, n)} +} + +func (_c *Client_HeadByHash_Call) Run(run func(ctx context.Context, n common.Hash)) *Client_HeadByHash_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(common.Hash)) + }) + return _c +} + +func (_c *Client_HeadByHash_Call) Return(_a0 *evmtypes.Head, _a1 error) *Client_HeadByHash_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Client_HeadByHash_Call) RunAndReturn(run func(context.Context, common.Hash) (*evmtypes.Head, error)) *Client_HeadByHash_Call { + _c.Call.Return(run) + return _c +} + // HeadByNumber provides a mock function with given fields: ctx, n func (_m *Client) HeadByNumber(ctx context.Context, n *big.Int) (*evmtypes.Head, error) { ret := _m.Called(ctx, n) @@ -449,6 +988,35 @@ func (_m *Client) HeadByNumber(ctx context.Context, n *big.Int) (*evmtypes.Head, return r0, r1 } +// Client_HeadByNumber_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HeadByNumber' +type Client_HeadByNumber_Call struct { + *mock.Call +} + +// HeadByNumber is a helper method to define mock.On call +// - ctx context.Context +// - n *big.Int +func (_e *Client_Expecter) HeadByNumber(ctx interface{}, n interface{}) *Client_HeadByNumber_Call { + return &Client_HeadByNumber_Call{Call: _e.mock.On("HeadByNumber", ctx, n)} +} + +func (_c *Client_HeadByNumber_Call) Run(run func(ctx context.Context, n *big.Int)) *Client_HeadByNumber_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*big.Int)) + }) + return _c +} + +func (_c *Client_HeadByNumber_Call) Return(_a0 *evmtypes.Head, _a1 error) *Client_HeadByNumber_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Client_HeadByNumber_Call) RunAndReturn(run func(context.Context, *big.Int) (*evmtypes.Head, error)) *Client_HeadByNumber_Call { + _c.Call.Return(run) + return _c +} + // HeaderByHash provides a mock function with given fields: ctx, h func (_m *Client) HeaderByHash(ctx context.Context, h common.Hash) (*types.Header, error) { ret := _m.Called(ctx, h) @@ -479,6 +1047,35 @@ func (_m *Client) HeaderByHash(ctx context.Context, h common.Hash) (*types.Heade return r0, r1 } +// Client_HeaderByHash_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HeaderByHash' +type Client_HeaderByHash_Call struct { + *mock.Call +} + +// HeaderByHash is a helper method to define mock.On call +// - ctx context.Context +// - h common.Hash +func (_e *Client_Expecter) HeaderByHash(ctx interface{}, h interface{}) *Client_HeaderByHash_Call { + return &Client_HeaderByHash_Call{Call: _e.mock.On("HeaderByHash", ctx, h)} +} + +func (_c *Client_HeaderByHash_Call) Run(run func(ctx context.Context, h common.Hash)) *Client_HeaderByHash_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(common.Hash)) + }) + return _c +} + +func (_c *Client_HeaderByHash_Call) Return(_a0 *types.Header, _a1 error) *Client_HeaderByHash_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Client_HeaderByHash_Call) RunAndReturn(run func(context.Context, common.Hash) (*types.Header, error)) *Client_HeaderByHash_Call { + _c.Call.Return(run) + return _c +} + // HeaderByNumber provides a mock function with given fields: ctx, n func (_m *Client) HeaderByNumber(ctx context.Context, n *big.Int) (*types.Header, error) { ret := _m.Called(ctx, n) @@ -509,6 +1106,35 @@ func (_m *Client) HeaderByNumber(ctx context.Context, n *big.Int) (*types.Header return r0, r1 } +// Client_HeaderByNumber_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HeaderByNumber' +type Client_HeaderByNumber_Call struct { + *mock.Call +} + +// HeaderByNumber is a helper method to define mock.On call +// - ctx context.Context +// - n *big.Int +func (_e *Client_Expecter) HeaderByNumber(ctx interface{}, n interface{}) *Client_HeaderByNumber_Call { + return &Client_HeaderByNumber_Call{Call: _e.mock.On("HeaderByNumber", ctx, n)} +} + +func (_c *Client_HeaderByNumber_Call) Run(run func(ctx context.Context, n *big.Int)) *Client_HeaderByNumber_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*big.Int)) + }) + return _c +} + +func (_c *Client_HeaderByNumber_Call) Return(_a0 *types.Header, _a1 error) *Client_HeaderByNumber_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Client_HeaderByNumber_Call) RunAndReturn(run func(context.Context, *big.Int) (*types.Header, error)) *Client_HeaderByNumber_Call { + _c.Call.Return(run) + return _c +} + // IsL2 provides a mock function with given fields: func (_m *Client) IsL2() bool { ret := _m.Called() @@ -527,6 +1153,33 @@ func (_m *Client) IsL2() bool { return r0 } +// Client_IsL2_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsL2' +type Client_IsL2_Call struct { + *mock.Call +} + +// IsL2 is a helper method to define mock.On call +func (_e *Client_Expecter) IsL2() *Client_IsL2_Call { + return &Client_IsL2_Call{Call: _e.mock.On("IsL2")} +} + +func (_c *Client_IsL2_Call) Run(run func()) *Client_IsL2_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Client_IsL2_Call) Return(_a0 bool) *Client_IsL2_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Client_IsL2_Call) RunAndReturn(run func() bool) *Client_IsL2_Call { + _c.Call.Return(run) + return _c +} + // LINKBalance provides a mock function with given fields: ctx, address, linkAddress func (_m *Client) LINKBalance(ctx context.Context, address common.Address, linkAddress common.Address) (*assets.Link, error) { ret := _m.Called(ctx, address, linkAddress) @@ -557,6 +1210,36 @@ func (_m *Client) LINKBalance(ctx context.Context, address common.Address, linkA return r0, r1 } +// Client_LINKBalance_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LINKBalance' +type Client_LINKBalance_Call struct { + *mock.Call +} + +// LINKBalance is a helper method to define mock.On call +// - ctx context.Context +// - address common.Address +// - linkAddress common.Address +func (_e *Client_Expecter) LINKBalance(ctx interface{}, address interface{}, linkAddress interface{}) *Client_LINKBalance_Call { + return &Client_LINKBalance_Call{Call: _e.mock.On("LINKBalance", ctx, address, linkAddress)} +} + +func (_c *Client_LINKBalance_Call) Run(run func(ctx context.Context, address common.Address, linkAddress common.Address)) *Client_LINKBalance_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(common.Address), args[2].(common.Address)) + }) + return _c +} + +func (_c *Client_LINKBalance_Call) Return(_a0 *assets.Link, _a1 error) *Client_LINKBalance_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Client_LINKBalance_Call) RunAndReturn(run func(context.Context, common.Address, common.Address) (*assets.Link, error)) *Client_LINKBalance_Call { + _c.Call.Return(run) + return _c +} + // LatestBlockHeight provides a mock function with given fields: ctx func (_m *Client) LatestBlockHeight(ctx context.Context) (*big.Int, error) { ret := _m.Called(ctx) @@ -587,6 +1270,34 @@ func (_m *Client) LatestBlockHeight(ctx context.Context) (*big.Int, error) { return r0, r1 } +// Client_LatestBlockHeight_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LatestBlockHeight' +type Client_LatestBlockHeight_Call struct { + *mock.Call +} + +// LatestBlockHeight is a helper method to define mock.On call +// - ctx context.Context +func (_e *Client_Expecter) LatestBlockHeight(ctx interface{}) *Client_LatestBlockHeight_Call { + return &Client_LatestBlockHeight_Call{Call: _e.mock.On("LatestBlockHeight", ctx)} +} + +func (_c *Client_LatestBlockHeight_Call) Run(run func(ctx context.Context)) *Client_LatestBlockHeight_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *Client_LatestBlockHeight_Call) Return(_a0 *big.Int, _a1 error) *Client_LatestBlockHeight_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Client_LatestBlockHeight_Call) RunAndReturn(run func(context.Context) (*big.Int, error)) *Client_LatestBlockHeight_Call { + _c.Call.Return(run) + return _c +} + // LatestFinalizedBlock provides a mock function with given fields: ctx func (_m *Client) LatestFinalizedBlock(ctx context.Context) (*evmtypes.Head, error) { ret := _m.Called(ctx) @@ -617,6 +1328,34 @@ func (_m *Client) LatestFinalizedBlock(ctx context.Context) (*evmtypes.Head, err return r0, r1 } +// Client_LatestFinalizedBlock_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LatestFinalizedBlock' +type Client_LatestFinalizedBlock_Call struct { + *mock.Call +} + +// LatestFinalizedBlock is a helper method to define mock.On call +// - ctx context.Context +func (_e *Client_Expecter) LatestFinalizedBlock(ctx interface{}) *Client_LatestFinalizedBlock_Call { + return &Client_LatestFinalizedBlock_Call{Call: _e.mock.On("LatestFinalizedBlock", ctx)} +} + +func (_c *Client_LatestFinalizedBlock_Call) Run(run func(ctx context.Context)) *Client_LatestFinalizedBlock_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *Client_LatestFinalizedBlock_Call) Return(head *evmtypes.Head, err error) *Client_LatestFinalizedBlock_Call { + _c.Call.Return(head, err) + return _c +} + +func (_c *Client_LatestFinalizedBlock_Call) RunAndReturn(run func(context.Context) (*evmtypes.Head, error)) *Client_LatestFinalizedBlock_Call { + _c.Call.Return(run) + return _c +} + // NodeStates provides a mock function with given fields: func (_m *Client) NodeStates() map[string]string { ret := _m.Called() @@ -637,6 +1376,33 @@ func (_m *Client) NodeStates() map[string]string { return r0 } +// Client_NodeStates_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NodeStates' +type Client_NodeStates_Call struct { + *mock.Call +} + +// NodeStates is a helper method to define mock.On call +func (_e *Client_Expecter) NodeStates() *Client_NodeStates_Call { + return &Client_NodeStates_Call{Call: _e.mock.On("NodeStates")} +} + +func (_c *Client_NodeStates_Call) Run(run func()) *Client_NodeStates_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Client_NodeStates_Call) Return(_a0 map[string]string) *Client_NodeStates_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Client_NodeStates_Call) RunAndReturn(run func() map[string]string) *Client_NodeStates_Call { + _c.Call.Return(run) + return _c +} + // PendingCallContract provides a mock function with given fields: ctx, msg func (_m *Client) PendingCallContract(ctx context.Context, msg ethereum.CallMsg) ([]byte, error) { ret := _m.Called(ctx, msg) @@ -667,6 +1433,35 @@ func (_m *Client) PendingCallContract(ctx context.Context, msg ethereum.CallMsg) return r0, r1 } +// Client_PendingCallContract_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PendingCallContract' +type Client_PendingCallContract_Call struct { + *mock.Call +} + +// PendingCallContract is a helper method to define mock.On call +// - ctx context.Context +// - msg ethereum.CallMsg +func (_e *Client_Expecter) PendingCallContract(ctx interface{}, msg interface{}) *Client_PendingCallContract_Call { + return &Client_PendingCallContract_Call{Call: _e.mock.On("PendingCallContract", ctx, msg)} +} + +func (_c *Client_PendingCallContract_Call) Run(run func(ctx context.Context, msg ethereum.CallMsg)) *Client_PendingCallContract_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(ethereum.CallMsg)) + }) + return _c +} + +func (_c *Client_PendingCallContract_Call) Return(_a0 []byte, _a1 error) *Client_PendingCallContract_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Client_PendingCallContract_Call) RunAndReturn(run func(context.Context, ethereum.CallMsg) ([]byte, error)) *Client_PendingCallContract_Call { + _c.Call.Return(run) + return _c +} + // PendingCodeAt provides a mock function with given fields: ctx, account func (_m *Client) PendingCodeAt(ctx context.Context, account common.Address) ([]byte, error) { ret := _m.Called(ctx, account) @@ -697,6 +1492,35 @@ func (_m *Client) PendingCodeAt(ctx context.Context, account common.Address) ([] return r0, r1 } +// Client_PendingCodeAt_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PendingCodeAt' +type Client_PendingCodeAt_Call struct { + *mock.Call +} + +// PendingCodeAt is a helper method to define mock.On call +// - ctx context.Context +// - account common.Address +func (_e *Client_Expecter) PendingCodeAt(ctx interface{}, account interface{}) *Client_PendingCodeAt_Call { + return &Client_PendingCodeAt_Call{Call: _e.mock.On("PendingCodeAt", ctx, account)} +} + +func (_c *Client_PendingCodeAt_Call) Run(run func(ctx context.Context, account common.Address)) *Client_PendingCodeAt_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(common.Address)) + }) + return _c +} + +func (_c *Client_PendingCodeAt_Call) Return(_a0 []byte, _a1 error) *Client_PendingCodeAt_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Client_PendingCodeAt_Call) RunAndReturn(run func(context.Context, common.Address) ([]byte, error)) *Client_PendingCodeAt_Call { + _c.Call.Return(run) + return _c +} + // PendingNonceAt provides a mock function with given fields: ctx, account func (_m *Client) PendingNonceAt(ctx context.Context, account common.Address) (uint64, error) { ret := _m.Called(ctx, account) @@ -725,6 +1549,35 @@ func (_m *Client) PendingNonceAt(ctx context.Context, account common.Address) (u return r0, r1 } +// Client_PendingNonceAt_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PendingNonceAt' +type Client_PendingNonceAt_Call struct { + *mock.Call +} + +// PendingNonceAt is a helper method to define mock.On call +// - ctx context.Context +// - account common.Address +func (_e *Client_Expecter) PendingNonceAt(ctx interface{}, account interface{}) *Client_PendingNonceAt_Call { + return &Client_PendingNonceAt_Call{Call: _e.mock.On("PendingNonceAt", ctx, account)} +} + +func (_c *Client_PendingNonceAt_Call) Run(run func(ctx context.Context, account common.Address)) *Client_PendingNonceAt_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(common.Address)) + }) + return _c +} + +func (_c *Client_PendingNonceAt_Call) Return(_a0 uint64, _a1 error) *Client_PendingNonceAt_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Client_PendingNonceAt_Call) RunAndReturn(run func(context.Context, common.Address) (uint64, error)) *Client_PendingNonceAt_Call { + _c.Call.Return(run) + return _c +} + // SendTransaction provides a mock function with given fields: ctx, tx func (_m *Client) SendTransaction(ctx context.Context, tx *types.Transaction) error { ret := _m.Called(ctx, tx) @@ -743,6 +1596,35 @@ func (_m *Client) SendTransaction(ctx context.Context, tx *types.Transaction) er return r0 } +// Client_SendTransaction_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SendTransaction' +type Client_SendTransaction_Call struct { + *mock.Call +} + +// SendTransaction is a helper method to define mock.On call +// - ctx context.Context +// - tx *types.Transaction +func (_e *Client_Expecter) SendTransaction(ctx interface{}, tx interface{}) *Client_SendTransaction_Call { + return &Client_SendTransaction_Call{Call: _e.mock.On("SendTransaction", ctx, tx)} +} + +func (_c *Client_SendTransaction_Call) Run(run func(ctx context.Context, tx *types.Transaction)) *Client_SendTransaction_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*types.Transaction)) + }) + return _c +} + +func (_c *Client_SendTransaction_Call) Return(_a0 error) *Client_SendTransaction_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Client_SendTransaction_Call) RunAndReturn(run func(context.Context, *types.Transaction) error) *Client_SendTransaction_Call { + _c.Call.Return(run) + return _c +} + // SendTransactionReturnCode provides a mock function with given fields: ctx, tx, fromAddress func (_m *Client) SendTransactionReturnCode(ctx context.Context, tx *types.Transaction, fromAddress common.Address) (commonclient.SendTxReturnCode, error) { ret := _m.Called(ctx, tx, fromAddress) @@ -771,6 +1653,36 @@ func (_m *Client) SendTransactionReturnCode(ctx context.Context, tx *types.Trans return r0, r1 } +// Client_SendTransactionReturnCode_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SendTransactionReturnCode' +type Client_SendTransactionReturnCode_Call struct { + *mock.Call +} + +// SendTransactionReturnCode is a helper method to define mock.On call +// - ctx context.Context +// - tx *types.Transaction +// - fromAddress common.Address +func (_e *Client_Expecter) SendTransactionReturnCode(ctx interface{}, tx interface{}, fromAddress interface{}) *Client_SendTransactionReturnCode_Call { + return &Client_SendTransactionReturnCode_Call{Call: _e.mock.On("SendTransactionReturnCode", ctx, tx, fromAddress)} +} + +func (_c *Client_SendTransactionReturnCode_Call) Run(run func(ctx context.Context, tx *types.Transaction, fromAddress common.Address)) *Client_SendTransactionReturnCode_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*types.Transaction), args[2].(common.Address)) + }) + return _c +} + +func (_c *Client_SendTransactionReturnCode_Call) Return(_a0 commonclient.SendTxReturnCode, _a1 error) *Client_SendTransactionReturnCode_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Client_SendTransactionReturnCode_Call) RunAndReturn(run func(context.Context, *types.Transaction, common.Address) (commonclient.SendTxReturnCode, error)) *Client_SendTransactionReturnCode_Call { + _c.Call.Return(run) + return _c +} + // SequenceAt provides a mock function with given fields: ctx, account, blockNumber func (_m *Client) SequenceAt(ctx context.Context, account common.Address, blockNumber *big.Int) (evmtypes.Nonce, error) { ret := _m.Called(ctx, account, blockNumber) @@ -799,6 +1711,36 @@ func (_m *Client) SequenceAt(ctx context.Context, account common.Address, blockN return r0, r1 } +// Client_SequenceAt_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SequenceAt' +type Client_SequenceAt_Call struct { + *mock.Call +} + +// SequenceAt is a helper method to define mock.On call +// - ctx context.Context +// - account common.Address +// - blockNumber *big.Int +func (_e *Client_Expecter) SequenceAt(ctx interface{}, account interface{}, blockNumber interface{}) *Client_SequenceAt_Call { + return &Client_SequenceAt_Call{Call: _e.mock.On("SequenceAt", ctx, account, blockNumber)} +} + +func (_c *Client_SequenceAt_Call) Run(run func(ctx context.Context, account common.Address, blockNumber *big.Int)) *Client_SequenceAt_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(common.Address), args[2].(*big.Int)) + }) + return _c +} + +func (_c *Client_SequenceAt_Call) Return(_a0 evmtypes.Nonce, _a1 error) *Client_SequenceAt_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Client_SequenceAt_Call) RunAndReturn(run func(context.Context, common.Address, *big.Int) (evmtypes.Nonce, error)) *Client_SequenceAt_Call { + _c.Call.Return(run) + return _c +} + // SubscribeFilterLogs provides a mock function with given fields: ctx, q, ch func (_m *Client) SubscribeFilterLogs(ctx context.Context, q ethereum.FilterQuery, ch chan<- types.Log) (ethereum.Subscription, error) { ret := _m.Called(ctx, q, ch) @@ -829,6 +1771,36 @@ func (_m *Client) SubscribeFilterLogs(ctx context.Context, q ethereum.FilterQuer return r0, r1 } +// Client_SubscribeFilterLogs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SubscribeFilterLogs' +type Client_SubscribeFilterLogs_Call struct { + *mock.Call +} + +// SubscribeFilterLogs is a helper method to define mock.On call +// - ctx context.Context +// - q ethereum.FilterQuery +// - ch chan<- types.Log +func (_e *Client_Expecter) SubscribeFilterLogs(ctx interface{}, q interface{}, ch interface{}) *Client_SubscribeFilterLogs_Call { + return &Client_SubscribeFilterLogs_Call{Call: _e.mock.On("SubscribeFilterLogs", ctx, q, ch)} +} + +func (_c *Client_SubscribeFilterLogs_Call) Run(run func(ctx context.Context, q ethereum.FilterQuery, ch chan<- types.Log)) *Client_SubscribeFilterLogs_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(ethereum.FilterQuery), args[2].(chan<- types.Log)) + }) + return _c +} + +func (_c *Client_SubscribeFilterLogs_Call) Return(_a0 ethereum.Subscription, _a1 error) *Client_SubscribeFilterLogs_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Client_SubscribeFilterLogs_Call) RunAndReturn(run func(context.Context, ethereum.FilterQuery, chan<- types.Log) (ethereum.Subscription, error)) *Client_SubscribeFilterLogs_Call { + _c.Call.Return(run) + return _c +} + // SubscribeNewHead provides a mock function with given fields: ctx, ch func (_m *Client) SubscribeNewHead(ctx context.Context, ch chan<- *evmtypes.Head) (ethereum.Subscription, error) { ret := _m.Called(ctx, ch) @@ -859,6 +1831,35 @@ func (_m *Client) SubscribeNewHead(ctx context.Context, ch chan<- *evmtypes.Head return r0, r1 } +// Client_SubscribeNewHead_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SubscribeNewHead' +type Client_SubscribeNewHead_Call struct { + *mock.Call +} + +// SubscribeNewHead is a helper method to define mock.On call +// - ctx context.Context +// - ch chan<- *evmtypes.Head +func (_e *Client_Expecter) SubscribeNewHead(ctx interface{}, ch interface{}) *Client_SubscribeNewHead_Call { + return &Client_SubscribeNewHead_Call{Call: _e.mock.On("SubscribeNewHead", ctx, ch)} +} + +func (_c *Client_SubscribeNewHead_Call) Run(run func(ctx context.Context, ch chan<- *evmtypes.Head)) *Client_SubscribeNewHead_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(chan<- *evmtypes.Head)) + }) + return _c +} + +func (_c *Client_SubscribeNewHead_Call) Return(_a0 ethereum.Subscription, _a1 error) *Client_SubscribeNewHead_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Client_SubscribeNewHead_Call) RunAndReturn(run func(context.Context, chan<- *evmtypes.Head) (ethereum.Subscription, error)) *Client_SubscribeNewHead_Call { + _c.Call.Return(run) + return _c +} + // SuggestGasPrice provides a mock function with given fields: ctx func (_m *Client) SuggestGasPrice(ctx context.Context) (*big.Int, error) { ret := _m.Called(ctx) @@ -889,6 +1890,34 @@ func (_m *Client) SuggestGasPrice(ctx context.Context) (*big.Int, error) { return r0, r1 } +// Client_SuggestGasPrice_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SuggestGasPrice' +type Client_SuggestGasPrice_Call struct { + *mock.Call +} + +// SuggestGasPrice is a helper method to define mock.On call +// - ctx context.Context +func (_e *Client_Expecter) SuggestGasPrice(ctx interface{}) *Client_SuggestGasPrice_Call { + return &Client_SuggestGasPrice_Call{Call: _e.mock.On("SuggestGasPrice", ctx)} +} + +func (_c *Client_SuggestGasPrice_Call) Run(run func(ctx context.Context)) *Client_SuggestGasPrice_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *Client_SuggestGasPrice_Call) Return(_a0 *big.Int, _a1 error) *Client_SuggestGasPrice_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Client_SuggestGasPrice_Call) RunAndReturn(run func(context.Context) (*big.Int, error)) *Client_SuggestGasPrice_Call { + _c.Call.Return(run) + return _c +} + // SuggestGasTipCap provides a mock function with given fields: ctx func (_m *Client) SuggestGasTipCap(ctx context.Context) (*big.Int, error) { ret := _m.Called(ctx) @@ -919,6 +1948,34 @@ func (_m *Client) SuggestGasTipCap(ctx context.Context) (*big.Int, error) { return r0, r1 } +// Client_SuggestGasTipCap_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SuggestGasTipCap' +type Client_SuggestGasTipCap_Call struct { + *mock.Call +} + +// SuggestGasTipCap is a helper method to define mock.On call +// - ctx context.Context +func (_e *Client_Expecter) SuggestGasTipCap(ctx interface{}) *Client_SuggestGasTipCap_Call { + return &Client_SuggestGasTipCap_Call{Call: _e.mock.On("SuggestGasTipCap", ctx)} +} + +func (_c *Client_SuggestGasTipCap_Call) Run(run func(ctx context.Context)) *Client_SuggestGasTipCap_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *Client_SuggestGasTipCap_Call) Return(_a0 *big.Int, _a1 error) *Client_SuggestGasTipCap_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Client_SuggestGasTipCap_Call) RunAndReturn(run func(context.Context) (*big.Int, error)) *Client_SuggestGasTipCap_Call { + _c.Call.Return(run) + return _c +} + // TokenBalance provides a mock function with given fields: ctx, address, contractAddress func (_m *Client) TokenBalance(ctx context.Context, address common.Address, contractAddress common.Address) (*big.Int, error) { ret := _m.Called(ctx, address, contractAddress) @@ -949,6 +2006,36 @@ func (_m *Client) TokenBalance(ctx context.Context, address common.Address, cont return r0, r1 } +// Client_TokenBalance_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TokenBalance' +type Client_TokenBalance_Call struct { + *mock.Call +} + +// TokenBalance is a helper method to define mock.On call +// - ctx context.Context +// - address common.Address +// - contractAddress common.Address +func (_e *Client_Expecter) TokenBalance(ctx interface{}, address interface{}, contractAddress interface{}) *Client_TokenBalance_Call { + return &Client_TokenBalance_Call{Call: _e.mock.On("TokenBalance", ctx, address, contractAddress)} +} + +func (_c *Client_TokenBalance_Call) Run(run func(ctx context.Context, address common.Address, contractAddress common.Address)) *Client_TokenBalance_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(common.Address), args[2].(common.Address)) + }) + return _c +} + +func (_c *Client_TokenBalance_Call) Return(_a0 *big.Int, _a1 error) *Client_TokenBalance_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Client_TokenBalance_Call) RunAndReturn(run func(context.Context, common.Address, common.Address) (*big.Int, error)) *Client_TokenBalance_Call { + _c.Call.Return(run) + return _c +} + // TransactionByHash provides a mock function with given fields: ctx, txHash func (_m *Client) TransactionByHash(ctx context.Context, txHash common.Hash) (*types.Transaction, error) { ret := _m.Called(ctx, txHash) @@ -979,6 +2066,35 @@ func (_m *Client) TransactionByHash(ctx context.Context, txHash common.Hash) (*t return r0, r1 } +// Client_TransactionByHash_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TransactionByHash' +type Client_TransactionByHash_Call struct { + *mock.Call +} + +// TransactionByHash is a helper method to define mock.On call +// - ctx context.Context +// - txHash common.Hash +func (_e *Client_Expecter) TransactionByHash(ctx interface{}, txHash interface{}) *Client_TransactionByHash_Call { + return &Client_TransactionByHash_Call{Call: _e.mock.On("TransactionByHash", ctx, txHash)} +} + +func (_c *Client_TransactionByHash_Call) Run(run func(ctx context.Context, txHash common.Hash)) *Client_TransactionByHash_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(common.Hash)) + }) + return _c +} + +func (_c *Client_TransactionByHash_Call) Return(_a0 *types.Transaction, _a1 error) *Client_TransactionByHash_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Client_TransactionByHash_Call) RunAndReturn(run func(context.Context, common.Hash) (*types.Transaction, error)) *Client_TransactionByHash_Call { + _c.Call.Return(run) + return _c +} + // TransactionReceipt provides a mock function with given fields: ctx, txHash func (_m *Client) TransactionReceipt(ctx context.Context, txHash common.Hash) (*types.Receipt, error) { ret := _m.Called(ctx, txHash) @@ -1009,6 +2125,35 @@ func (_m *Client) TransactionReceipt(ctx context.Context, txHash common.Hash) (* return r0, r1 } +// Client_TransactionReceipt_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TransactionReceipt' +type Client_TransactionReceipt_Call struct { + *mock.Call +} + +// TransactionReceipt is a helper method to define mock.On call +// - ctx context.Context +// - txHash common.Hash +func (_e *Client_Expecter) TransactionReceipt(ctx interface{}, txHash interface{}) *Client_TransactionReceipt_Call { + return &Client_TransactionReceipt_Call{Call: _e.mock.On("TransactionReceipt", ctx, txHash)} +} + +func (_c *Client_TransactionReceipt_Call) Run(run func(ctx context.Context, txHash common.Hash)) *Client_TransactionReceipt_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(common.Hash)) + }) + return _c +} + +func (_c *Client_TransactionReceipt_Call) Return(_a0 *types.Receipt, _a1 error) *Client_TransactionReceipt_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Client_TransactionReceipt_Call) RunAndReturn(run func(context.Context, common.Hash) (*types.Receipt, error)) *Client_TransactionReceipt_Call { + _c.Call.Return(run) + return _c +} + // NewClient creates a new instance of Client. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewClient(t interface { diff --git a/core/chains/evm/client/mocks/rpc_client.go b/core/chains/evm/client/mocks/rpc_client.go index e6cb07af2f2..5567b3f8978 100644 --- a/core/chains/evm/client/mocks/rpc_client.go +++ b/core/chains/evm/client/mocks/rpc_client.go @@ -33,6 +33,14 @@ type RPCClient struct { mock.Mock } +type RPCClient_Expecter struct { + mock *mock.Mock +} + +func (_m *RPCClient) EXPECT() *RPCClient_Expecter { + return &RPCClient_Expecter{mock: &_m.Mock} +} + // BalanceAt provides a mock function with given fields: ctx, accountAddress, blockNumber func (_m *RPCClient) BalanceAt(ctx context.Context, accountAddress common.Address, blockNumber *big.Int) (*big.Int, error) { ret := _m.Called(ctx, accountAddress, blockNumber) @@ -63,6 +71,36 @@ func (_m *RPCClient) BalanceAt(ctx context.Context, accountAddress common.Addres return r0, r1 } +// RPCClient_BalanceAt_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BalanceAt' +type RPCClient_BalanceAt_Call struct { + *mock.Call +} + +// BalanceAt is a helper method to define mock.On call +// - ctx context.Context +// - accountAddress common.Address +// - blockNumber *big.Int +func (_e *RPCClient_Expecter) BalanceAt(ctx interface{}, accountAddress interface{}, blockNumber interface{}) *RPCClient_BalanceAt_Call { + return &RPCClient_BalanceAt_Call{Call: _e.mock.On("BalanceAt", ctx, accountAddress, blockNumber)} +} + +func (_c *RPCClient_BalanceAt_Call) Run(run func(ctx context.Context, accountAddress common.Address, blockNumber *big.Int)) *RPCClient_BalanceAt_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(common.Address), args[2].(*big.Int)) + }) + return _c +} + +func (_c *RPCClient_BalanceAt_Call) Return(_a0 *big.Int, _a1 error) *RPCClient_BalanceAt_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *RPCClient_BalanceAt_Call) RunAndReturn(run func(context.Context, common.Address, *big.Int) (*big.Int, error)) *RPCClient_BalanceAt_Call { + _c.Call.Return(run) + return _c +} + // BatchCallContext provides a mock function with given fields: ctx, b func (_m *RPCClient) BatchCallContext(ctx context.Context, b []rpc.BatchElem) error { ret := _m.Called(ctx, b) @@ -81,6 +119,35 @@ func (_m *RPCClient) BatchCallContext(ctx context.Context, b []rpc.BatchElem) er return r0 } +// RPCClient_BatchCallContext_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BatchCallContext' +type RPCClient_BatchCallContext_Call struct { + *mock.Call +} + +// BatchCallContext is a helper method to define mock.On call +// - ctx context.Context +// - b []rpc.BatchElem +func (_e *RPCClient_Expecter) BatchCallContext(ctx interface{}, b interface{}) *RPCClient_BatchCallContext_Call { + return &RPCClient_BatchCallContext_Call{Call: _e.mock.On("BatchCallContext", ctx, b)} +} + +func (_c *RPCClient_BatchCallContext_Call) Run(run func(ctx context.Context, b []rpc.BatchElem)) *RPCClient_BatchCallContext_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].([]rpc.BatchElem)) + }) + return _c +} + +func (_c *RPCClient_BatchCallContext_Call) Return(_a0 error) *RPCClient_BatchCallContext_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *RPCClient_BatchCallContext_Call) RunAndReturn(run func(context.Context, []rpc.BatchElem) error) *RPCClient_BatchCallContext_Call { + _c.Call.Return(run) + return _c +} + // BlockByHash provides a mock function with given fields: ctx, hash func (_m *RPCClient) BlockByHash(ctx context.Context, hash common.Hash) (*types.Head, error) { ret := _m.Called(ctx, hash) @@ -111,6 +178,35 @@ func (_m *RPCClient) BlockByHash(ctx context.Context, hash common.Hash) (*types. return r0, r1 } +// RPCClient_BlockByHash_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BlockByHash' +type RPCClient_BlockByHash_Call struct { + *mock.Call +} + +// BlockByHash is a helper method to define mock.On call +// - ctx context.Context +// - hash common.Hash +func (_e *RPCClient_Expecter) BlockByHash(ctx interface{}, hash interface{}) *RPCClient_BlockByHash_Call { + return &RPCClient_BlockByHash_Call{Call: _e.mock.On("BlockByHash", ctx, hash)} +} + +func (_c *RPCClient_BlockByHash_Call) Run(run func(ctx context.Context, hash common.Hash)) *RPCClient_BlockByHash_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(common.Hash)) + }) + return _c +} + +func (_c *RPCClient_BlockByHash_Call) Return(_a0 *types.Head, _a1 error) *RPCClient_BlockByHash_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *RPCClient_BlockByHash_Call) RunAndReturn(run func(context.Context, common.Hash) (*types.Head, error)) *RPCClient_BlockByHash_Call { + _c.Call.Return(run) + return _c +} + // BlockByHashGeth provides a mock function with given fields: ctx, hash func (_m *RPCClient) BlockByHashGeth(ctx context.Context, hash common.Hash) (*coretypes.Block, error) { ret := _m.Called(ctx, hash) @@ -141,6 +237,35 @@ func (_m *RPCClient) BlockByHashGeth(ctx context.Context, hash common.Hash) (*co return r0, r1 } +// RPCClient_BlockByHashGeth_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BlockByHashGeth' +type RPCClient_BlockByHashGeth_Call struct { + *mock.Call +} + +// BlockByHashGeth is a helper method to define mock.On call +// - ctx context.Context +// - hash common.Hash +func (_e *RPCClient_Expecter) BlockByHashGeth(ctx interface{}, hash interface{}) *RPCClient_BlockByHashGeth_Call { + return &RPCClient_BlockByHashGeth_Call{Call: _e.mock.On("BlockByHashGeth", ctx, hash)} +} + +func (_c *RPCClient_BlockByHashGeth_Call) Run(run func(ctx context.Context, hash common.Hash)) *RPCClient_BlockByHashGeth_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(common.Hash)) + }) + return _c +} + +func (_c *RPCClient_BlockByHashGeth_Call) Return(b *coretypes.Block, err error) *RPCClient_BlockByHashGeth_Call { + _c.Call.Return(b, err) + return _c +} + +func (_c *RPCClient_BlockByHashGeth_Call) RunAndReturn(run func(context.Context, common.Hash) (*coretypes.Block, error)) *RPCClient_BlockByHashGeth_Call { + _c.Call.Return(run) + return _c +} + // BlockByNumber provides a mock function with given fields: ctx, number func (_m *RPCClient) BlockByNumber(ctx context.Context, number *big.Int) (*types.Head, error) { ret := _m.Called(ctx, number) @@ -171,6 +296,35 @@ func (_m *RPCClient) BlockByNumber(ctx context.Context, number *big.Int) (*types return r0, r1 } +// RPCClient_BlockByNumber_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BlockByNumber' +type RPCClient_BlockByNumber_Call struct { + *mock.Call +} + +// BlockByNumber is a helper method to define mock.On call +// - ctx context.Context +// - number *big.Int +func (_e *RPCClient_Expecter) BlockByNumber(ctx interface{}, number interface{}) *RPCClient_BlockByNumber_Call { + return &RPCClient_BlockByNumber_Call{Call: _e.mock.On("BlockByNumber", ctx, number)} +} + +func (_c *RPCClient_BlockByNumber_Call) Run(run func(ctx context.Context, number *big.Int)) *RPCClient_BlockByNumber_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*big.Int)) + }) + return _c +} + +func (_c *RPCClient_BlockByNumber_Call) Return(_a0 *types.Head, _a1 error) *RPCClient_BlockByNumber_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *RPCClient_BlockByNumber_Call) RunAndReturn(run func(context.Context, *big.Int) (*types.Head, error)) *RPCClient_BlockByNumber_Call { + _c.Call.Return(run) + return _c +} + // BlockByNumberGeth provides a mock function with given fields: ctx, number func (_m *RPCClient) BlockByNumberGeth(ctx context.Context, number *big.Int) (*coretypes.Block, error) { ret := _m.Called(ctx, number) @@ -201,6 +355,35 @@ func (_m *RPCClient) BlockByNumberGeth(ctx context.Context, number *big.Int) (*c return r0, r1 } +// RPCClient_BlockByNumberGeth_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BlockByNumberGeth' +type RPCClient_BlockByNumberGeth_Call struct { + *mock.Call +} + +// BlockByNumberGeth is a helper method to define mock.On call +// - ctx context.Context +// - number *big.Int +func (_e *RPCClient_Expecter) BlockByNumberGeth(ctx interface{}, number interface{}) *RPCClient_BlockByNumberGeth_Call { + return &RPCClient_BlockByNumberGeth_Call{Call: _e.mock.On("BlockByNumberGeth", ctx, number)} +} + +func (_c *RPCClient_BlockByNumberGeth_Call) Run(run func(ctx context.Context, number *big.Int)) *RPCClient_BlockByNumberGeth_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*big.Int)) + }) + return _c +} + +func (_c *RPCClient_BlockByNumberGeth_Call) Return(b *coretypes.Block, err error) *RPCClient_BlockByNumberGeth_Call { + _c.Call.Return(b, err) + return _c +} + +func (_c *RPCClient_BlockByNumberGeth_Call) RunAndReturn(run func(context.Context, *big.Int) (*coretypes.Block, error)) *RPCClient_BlockByNumberGeth_Call { + _c.Call.Return(run) + return _c +} + // CallContext provides a mock function with given fields: ctx, result, method, args func (_m *RPCClient) CallContext(ctx context.Context, result interface{}, method string, args ...interface{}) error { var _ca []interface{} @@ -222,6 +405,44 @@ func (_m *RPCClient) CallContext(ctx context.Context, result interface{}, method return r0 } +// RPCClient_CallContext_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CallContext' +type RPCClient_CallContext_Call struct { + *mock.Call +} + +// CallContext is a helper method to define mock.On call +// - ctx context.Context +// - result interface{} +// - method string +// - args ...interface{} +func (_e *RPCClient_Expecter) CallContext(ctx interface{}, result interface{}, method interface{}, args ...interface{}) *RPCClient_CallContext_Call { + return &RPCClient_CallContext_Call{Call: _e.mock.On("CallContext", + append([]interface{}{ctx, result, method}, args...)...)} +} + +func (_c *RPCClient_CallContext_Call) Run(run func(ctx context.Context, result interface{}, method string, args ...interface{})) *RPCClient_CallContext_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-3) + for i, a := range args[3:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(args[0].(context.Context), args[1].(interface{}), args[2].(string), variadicArgs...) + }) + return _c +} + +func (_c *RPCClient_CallContext_Call) Return(_a0 error) *RPCClient_CallContext_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *RPCClient_CallContext_Call) RunAndReturn(run func(context.Context, interface{}, string, ...interface{}) error) *RPCClient_CallContext_Call { + _c.Call.Return(run) + return _c +} + // CallContract provides a mock function with given fields: ctx, msg, blockNumber func (_m *RPCClient) CallContract(ctx context.Context, msg interface{}, blockNumber *big.Int) ([]byte, error) { ret := _m.Called(ctx, msg, blockNumber) @@ -252,6 +473,36 @@ func (_m *RPCClient) CallContract(ctx context.Context, msg interface{}, blockNum return r0, r1 } +// RPCClient_CallContract_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CallContract' +type RPCClient_CallContract_Call struct { + *mock.Call +} + +// CallContract is a helper method to define mock.On call +// - ctx context.Context +// - msg interface{} +// - blockNumber *big.Int +func (_e *RPCClient_Expecter) CallContract(ctx interface{}, msg interface{}, blockNumber interface{}) *RPCClient_CallContract_Call { + return &RPCClient_CallContract_Call{Call: _e.mock.On("CallContract", ctx, msg, blockNumber)} +} + +func (_c *RPCClient_CallContract_Call) Run(run func(ctx context.Context, msg interface{}, blockNumber *big.Int)) *RPCClient_CallContract_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(interface{}), args[2].(*big.Int)) + }) + return _c +} + +func (_c *RPCClient_CallContract_Call) Return(rpcErr []byte, extractErr error) *RPCClient_CallContract_Call { + _c.Call.Return(rpcErr, extractErr) + return _c +} + +func (_c *RPCClient_CallContract_Call) RunAndReturn(run func(context.Context, interface{}, *big.Int) ([]byte, error)) *RPCClient_CallContract_Call { + _c.Call.Return(run) + return _c +} + // ChainID provides a mock function with given fields: ctx func (_m *RPCClient) ChainID(ctx context.Context) (*big.Int, error) { ret := _m.Called(ctx) @@ -282,6 +533,34 @@ func (_m *RPCClient) ChainID(ctx context.Context) (*big.Int, error) { return r0, r1 } +// RPCClient_ChainID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ChainID' +type RPCClient_ChainID_Call struct { + *mock.Call +} + +// ChainID is a helper method to define mock.On call +// - ctx context.Context +func (_e *RPCClient_Expecter) ChainID(ctx interface{}) *RPCClient_ChainID_Call { + return &RPCClient_ChainID_Call{Call: _e.mock.On("ChainID", ctx)} +} + +func (_c *RPCClient_ChainID_Call) Run(run func(ctx context.Context)) *RPCClient_ChainID_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *RPCClient_ChainID_Call) Return(_a0 *big.Int, _a1 error) *RPCClient_ChainID_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *RPCClient_ChainID_Call) RunAndReturn(run func(context.Context) (*big.Int, error)) *RPCClient_ChainID_Call { + _c.Call.Return(run) + return _c +} + // ClientVersion provides a mock function with given fields: _a0 func (_m *RPCClient) ClientVersion(_a0 context.Context) (string, error) { ret := _m.Called(_a0) @@ -310,11 +589,66 @@ func (_m *RPCClient) ClientVersion(_a0 context.Context) (string, error) { return r0, r1 } +// RPCClient_ClientVersion_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ClientVersion' +type RPCClient_ClientVersion_Call struct { + *mock.Call +} + +// ClientVersion is a helper method to define mock.On call +// - _a0 context.Context +func (_e *RPCClient_Expecter) ClientVersion(_a0 interface{}) *RPCClient_ClientVersion_Call { + return &RPCClient_ClientVersion_Call{Call: _e.mock.On("ClientVersion", _a0)} +} + +func (_c *RPCClient_ClientVersion_Call) Run(run func(_a0 context.Context)) *RPCClient_ClientVersion_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *RPCClient_ClientVersion_Call) Return(_a0 string, _a1 error) *RPCClient_ClientVersion_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *RPCClient_ClientVersion_Call) RunAndReturn(run func(context.Context) (string, error)) *RPCClient_ClientVersion_Call { + _c.Call.Return(run) + return _c +} + // Close provides a mock function with given fields: func (_m *RPCClient) Close() { _m.Called() } +// RPCClient_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close' +type RPCClient_Close_Call struct { + *mock.Call +} + +// Close is a helper method to define mock.On call +func (_e *RPCClient_Expecter) Close() *RPCClient_Close_Call { + return &RPCClient_Close_Call{Call: _e.mock.On("Close")} +} + +func (_c *RPCClient_Close_Call) Run(run func()) *RPCClient_Close_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *RPCClient_Close_Call) Return() *RPCClient_Close_Call { + _c.Call.Return() + return _c +} + +func (_c *RPCClient_Close_Call) RunAndReturn(run func()) *RPCClient_Close_Call { + _c.Call.Return(run) + return _c +} + // CodeAt provides a mock function with given fields: ctx, account, blockNumber func (_m *RPCClient) CodeAt(ctx context.Context, account common.Address, blockNumber *big.Int) ([]byte, error) { ret := _m.Called(ctx, account, blockNumber) @@ -345,6 +679,36 @@ func (_m *RPCClient) CodeAt(ctx context.Context, account common.Address, blockNu return r0, r1 } +// RPCClient_CodeAt_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CodeAt' +type RPCClient_CodeAt_Call struct { + *mock.Call +} + +// CodeAt is a helper method to define mock.On call +// - ctx context.Context +// - account common.Address +// - blockNumber *big.Int +func (_e *RPCClient_Expecter) CodeAt(ctx interface{}, account interface{}, blockNumber interface{}) *RPCClient_CodeAt_Call { + return &RPCClient_CodeAt_Call{Call: _e.mock.On("CodeAt", ctx, account, blockNumber)} +} + +func (_c *RPCClient_CodeAt_Call) Run(run func(ctx context.Context, account common.Address, blockNumber *big.Int)) *RPCClient_CodeAt_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(common.Address), args[2].(*big.Int)) + }) + return _c +} + +func (_c *RPCClient_CodeAt_Call) Return(_a0 []byte, _a1 error) *RPCClient_CodeAt_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *RPCClient_CodeAt_Call) RunAndReturn(run func(context.Context, common.Address, *big.Int) ([]byte, error)) *RPCClient_CodeAt_Call { + _c.Call.Return(run) + return _c +} + // Dial provides a mock function with given fields: ctx func (_m *RPCClient) Dial(ctx context.Context) error { ret := _m.Called(ctx) @@ -363,6 +727,34 @@ func (_m *RPCClient) Dial(ctx context.Context) error { return r0 } +// RPCClient_Dial_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Dial' +type RPCClient_Dial_Call struct { + *mock.Call +} + +// Dial is a helper method to define mock.On call +// - ctx context.Context +func (_e *RPCClient_Expecter) Dial(ctx interface{}) *RPCClient_Dial_Call { + return &RPCClient_Dial_Call{Call: _e.mock.On("Dial", ctx)} +} + +func (_c *RPCClient_Dial_Call) Run(run func(ctx context.Context)) *RPCClient_Dial_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *RPCClient_Dial_Call) Return(_a0 error) *RPCClient_Dial_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *RPCClient_Dial_Call) RunAndReturn(run func(context.Context) error) *RPCClient_Dial_Call { + _c.Call.Return(run) + return _c +} + // DialHTTP provides a mock function with given fields: func (_m *RPCClient) DialHTTP() error { ret := _m.Called() @@ -381,11 +773,65 @@ func (_m *RPCClient) DialHTTP() error { return r0 } +// RPCClient_DialHTTP_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DialHTTP' +type RPCClient_DialHTTP_Call struct { + *mock.Call +} + +// DialHTTP is a helper method to define mock.On call +func (_e *RPCClient_Expecter) DialHTTP() *RPCClient_DialHTTP_Call { + return &RPCClient_DialHTTP_Call{Call: _e.mock.On("DialHTTP")} +} + +func (_c *RPCClient_DialHTTP_Call) Run(run func()) *RPCClient_DialHTTP_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *RPCClient_DialHTTP_Call) Return(_a0 error) *RPCClient_DialHTTP_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *RPCClient_DialHTTP_Call) RunAndReturn(run func() error) *RPCClient_DialHTTP_Call { + _c.Call.Return(run) + return _c +} + // DisconnectAll provides a mock function with given fields: func (_m *RPCClient) DisconnectAll() { _m.Called() } +// RPCClient_DisconnectAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DisconnectAll' +type RPCClient_DisconnectAll_Call struct { + *mock.Call +} + +// DisconnectAll is a helper method to define mock.On call +func (_e *RPCClient_Expecter) DisconnectAll() *RPCClient_DisconnectAll_Call { + return &RPCClient_DisconnectAll_Call{Call: _e.mock.On("DisconnectAll")} +} + +func (_c *RPCClient_DisconnectAll_Call) Run(run func()) *RPCClient_DisconnectAll_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *RPCClient_DisconnectAll_Call) Return() *RPCClient_DisconnectAll_Call { + _c.Call.Return() + return _c +} + +func (_c *RPCClient_DisconnectAll_Call) RunAndReturn(run func()) *RPCClient_DisconnectAll_Call { + _c.Call.Return(run) + return _c +} + // EstimateGas provides a mock function with given fields: ctx, call func (_m *RPCClient) EstimateGas(ctx context.Context, call interface{}) (uint64, error) { ret := _m.Called(ctx, call) @@ -414,6 +860,95 @@ func (_m *RPCClient) EstimateGas(ctx context.Context, call interface{}) (uint64, return r0, r1 } +// RPCClient_EstimateGas_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EstimateGas' +type RPCClient_EstimateGas_Call struct { + *mock.Call +} + +// EstimateGas is a helper method to define mock.On call +// - ctx context.Context +// - call interface{} +func (_e *RPCClient_Expecter) EstimateGas(ctx interface{}, call interface{}) *RPCClient_EstimateGas_Call { + return &RPCClient_EstimateGas_Call{Call: _e.mock.On("EstimateGas", ctx, call)} +} + +func (_c *RPCClient_EstimateGas_Call) Run(run func(ctx context.Context, call interface{})) *RPCClient_EstimateGas_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(interface{})) + }) + return _c +} + +func (_c *RPCClient_EstimateGas_Call) Return(gas uint64, err error) *RPCClient_EstimateGas_Call { + _c.Call.Return(gas, err) + return _c +} + +func (_c *RPCClient_EstimateGas_Call) RunAndReturn(run func(context.Context, interface{}) (uint64, error)) *RPCClient_EstimateGas_Call { + _c.Call.Return(run) + return _c +} + +// FeeHistory provides a mock function with given fields: ctx, blockCount, rewardPercentiles +func (_m *RPCClient) FeeHistory(ctx context.Context, blockCount uint64, rewardPercentiles []float64) (*ethereum.FeeHistory, error) { + ret := _m.Called(ctx, blockCount, rewardPercentiles) + + if len(ret) == 0 { + panic("no return value specified for FeeHistory") + } + + var r0 *ethereum.FeeHistory + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, uint64, []float64) (*ethereum.FeeHistory, error)); ok { + return rf(ctx, blockCount, rewardPercentiles) + } + if rf, ok := ret.Get(0).(func(context.Context, uint64, []float64) *ethereum.FeeHistory); ok { + r0 = rf(ctx, blockCount, rewardPercentiles) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*ethereum.FeeHistory) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, uint64, []float64) error); ok { + r1 = rf(ctx, blockCount, rewardPercentiles) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// RPCClient_FeeHistory_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FeeHistory' +type RPCClient_FeeHistory_Call struct { + *mock.Call +} + +// FeeHistory is a helper method to define mock.On call +// - ctx context.Context +// - blockCount uint64 +// - rewardPercentiles []float64 +func (_e *RPCClient_Expecter) FeeHistory(ctx interface{}, blockCount interface{}, rewardPercentiles interface{}) *RPCClient_FeeHistory_Call { + return &RPCClient_FeeHistory_Call{Call: _e.mock.On("FeeHistory", ctx, blockCount, rewardPercentiles)} +} + +func (_c *RPCClient_FeeHistory_Call) Run(run func(ctx context.Context, blockCount uint64, rewardPercentiles []float64)) *RPCClient_FeeHistory_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(uint64), args[2].([]float64)) + }) + return _c +} + +func (_c *RPCClient_FeeHistory_Call) Return(feeHistory *ethereum.FeeHistory, err error) *RPCClient_FeeHistory_Call { + _c.Call.Return(feeHistory, err) + return _c +} + +func (_c *RPCClient_FeeHistory_Call) RunAndReturn(run func(context.Context, uint64, []float64) (*ethereum.FeeHistory, error)) *RPCClient_FeeHistory_Call { + _c.Call.Return(run) + return _c +} + // FilterEvents provides a mock function with given fields: ctx, query func (_m *RPCClient) FilterEvents(ctx context.Context, query ethereum.FilterQuery) ([]coretypes.Log, error) { ret := _m.Called(ctx, query) @@ -444,6 +979,35 @@ func (_m *RPCClient) FilterEvents(ctx context.Context, query ethereum.FilterQuer return r0, r1 } +// RPCClient_FilterEvents_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterEvents' +type RPCClient_FilterEvents_Call struct { + *mock.Call +} + +// FilterEvents is a helper method to define mock.On call +// - ctx context.Context +// - query ethereum.FilterQuery +func (_e *RPCClient_Expecter) FilterEvents(ctx interface{}, query interface{}) *RPCClient_FilterEvents_Call { + return &RPCClient_FilterEvents_Call{Call: _e.mock.On("FilterEvents", ctx, query)} +} + +func (_c *RPCClient_FilterEvents_Call) Run(run func(ctx context.Context, query ethereum.FilterQuery)) *RPCClient_FilterEvents_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(ethereum.FilterQuery)) + }) + return _c +} + +func (_c *RPCClient_FilterEvents_Call) Return(_a0 []coretypes.Log, _a1 error) *RPCClient_FilterEvents_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *RPCClient_FilterEvents_Call) RunAndReturn(run func(context.Context, ethereum.FilterQuery) ([]coretypes.Log, error)) *RPCClient_FilterEvents_Call { + _c.Call.Return(run) + return _c +} + // GetInterceptedChainInfo provides a mock function with given fields: func (_m *RPCClient) GetInterceptedChainInfo() (commonclient.ChainInfo, commonclient.ChainInfo) { ret := _m.Called() @@ -472,6 +1036,33 @@ func (_m *RPCClient) GetInterceptedChainInfo() (commonclient.ChainInfo, commoncl return r0, r1 } +// RPCClient_GetInterceptedChainInfo_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetInterceptedChainInfo' +type RPCClient_GetInterceptedChainInfo_Call struct { + *mock.Call +} + +// GetInterceptedChainInfo is a helper method to define mock.On call +func (_e *RPCClient_Expecter) GetInterceptedChainInfo() *RPCClient_GetInterceptedChainInfo_Call { + return &RPCClient_GetInterceptedChainInfo_Call{Call: _e.mock.On("GetInterceptedChainInfo")} +} + +func (_c *RPCClient_GetInterceptedChainInfo_Call) Run(run func()) *RPCClient_GetInterceptedChainInfo_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *RPCClient_GetInterceptedChainInfo_Call) Return(latest commonclient.ChainInfo, highestUserObservations commonclient.ChainInfo) *RPCClient_GetInterceptedChainInfo_Call { + _c.Call.Return(latest, highestUserObservations) + return _c +} + +func (_c *RPCClient_GetInterceptedChainInfo_Call) RunAndReturn(run func() (commonclient.ChainInfo, commonclient.ChainInfo)) *RPCClient_GetInterceptedChainInfo_Call { + _c.Call.Return(run) + return _c +} + // HeaderByHash provides a mock function with given fields: ctx, h func (_m *RPCClient) HeaderByHash(ctx context.Context, h common.Hash) (*coretypes.Header, error) { ret := _m.Called(ctx, h) @@ -502,6 +1093,35 @@ func (_m *RPCClient) HeaderByHash(ctx context.Context, h common.Hash) (*coretype return r0, r1 } +// RPCClient_HeaderByHash_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HeaderByHash' +type RPCClient_HeaderByHash_Call struct { + *mock.Call +} + +// HeaderByHash is a helper method to define mock.On call +// - ctx context.Context +// - h common.Hash +func (_e *RPCClient_Expecter) HeaderByHash(ctx interface{}, h interface{}) *RPCClient_HeaderByHash_Call { + return &RPCClient_HeaderByHash_Call{Call: _e.mock.On("HeaderByHash", ctx, h)} +} + +func (_c *RPCClient_HeaderByHash_Call) Run(run func(ctx context.Context, h common.Hash)) *RPCClient_HeaderByHash_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(common.Hash)) + }) + return _c +} + +func (_c *RPCClient_HeaderByHash_Call) Return(head *coretypes.Header, err error) *RPCClient_HeaderByHash_Call { + _c.Call.Return(head, err) + return _c +} + +func (_c *RPCClient_HeaderByHash_Call) RunAndReturn(run func(context.Context, common.Hash) (*coretypes.Header, error)) *RPCClient_HeaderByHash_Call { + _c.Call.Return(run) + return _c +} + // HeaderByNumber provides a mock function with given fields: ctx, n func (_m *RPCClient) HeaderByNumber(ctx context.Context, n *big.Int) (*coretypes.Header, error) { ret := _m.Called(ctx, n) @@ -532,6 +1152,35 @@ func (_m *RPCClient) HeaderByNumber(ctx context.Context, n *big.Int) (*coretypes return r0, r1 } +// RPCClient_HeaderByNumber_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HeaderByNumber' +type RPCClient_HeaderByNumber_Call struct { + *mock.Call +} + +// HeaderByNumber is a helper method to define mock.On call +// - ctx context.Context +// - n *big.Int +func (_e *RPCClient_Expecter) HeaderByNumber(ctx interface{}, n interface{}) *RPCClient_HeaderByNumber_Call { + return &RPCClient_HeaderByNumber_Call{Call: _e.mock.On("HeaderByNumber", ctx, n)} +} + +func (_c *RPCClient_HeaderByNumber_Call) Run(run func(ctx context.Context, n *big.Int)) *RPCClient_HeaderByNumber_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*big.Int)) + }) + return _c +} + +func (_c *RPCClient_HeaderByNumber_Call) Return(head *coretypes.Header, err error) *RPCClient_HeaderByNumber_Call { + _c.Call.Return(head, err) + return _c +} + +func (_c *RPCClient_HeaderByNumber_Call) RunAndReturn(run func(context.Context, *big.Int) (*coretypes.Header, error)) *RPCClient_HeaderByNumber_Call { + _c.Call.Return(run) + return _c +} + // IsSyncing provides a mock function with given fields: ctx func (_m *RPCClient) IsSyncing(ctx context.Context) (bool, error) { ret := _m.Called(ctx) @@ -560,6 +1209,34 @@ func (_m *RPCClient) IsSyncing(ctx context.Context) (bool, error) { return r0, r1 } +// RPCClient_IsSyncing_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsSyncing' +type RPCClient_IsSyncing_Call struct { + *mock.Call +} + +// IsSyncing is a helper method to define mock.On call +// - ctx context.Context +func (_e *RPCClient_Expecter) IsSyncing(ctx interface{}) *RPCClient_IsSyncing_Call { + return &RPCClient_IsSyncing_Call{Call: _e.mock.On("IsSyncing", ctx)} +} + +func (_c *RPCClient_IsSyncing_Call) Run(run func(ctx context.Context)) *RPCClient_IsSyncing_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *RPCClient_IsSyncing_Call) Return(_a0 bool, _a1 error) *RPCClient_IsSyncing_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *RPCClient_IsSyncing_Call) RunAndReturn(run func(context.Context) (bool, error)) *RPCClient_IsSyncing_Call { + _c.Call.Return(run) + return _c +} + // LINKBalance provides a mock function with given fields: ctx, accountAddress, linkAddress func (_m *RPCClient) LINKBalance(ctx context.Context, accountAddress common.Address, linkAddress common.Address) (*assets.Link, error) { ret := _m.Called(ctx, accountAddress, linkAddress) @@ -590,6 +1267,36 @@ func (_m *RPCClient) LINKBalance(ctx context.Context, accountAddress common.Addr return r0, r1 } +// RPCClient_LINKBalance_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LINKBalance' +type RPCClient_LINKBalance_Call struct { + *mock.Call +} + +// LINKBalance is a helper method to define mock.On call +// - ctx context.Context +// - accountAddress common.Address +// - linkAddress common.Address +func (_e *RPCClient_Expecter) LINKBalance(ctx interface{}, accountAddress interface{}, linkAddress interface{}) *RPCClient_LINKBalance_Call { + return &RPCClient_LINKBalance_Call{Call: _e.mock.On("LINKBalance", ctx, accountAddress, linkAddress)} +} + +func (_c *RPCClient_LINKBalance_Call) Run(run func(ctx context.Context, accountAddress common.Address, linkAddress common.Address)) *RPCClient_LINKBalance_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(common.Address), args[2].(common.Address)) + }) + return _c +} + +func (_c *RPCClient_LINKBalance_Call) Return(_a0 *assets.Link, _a1 error) *RPCClient_LINKBalance_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *RPCClient_LINKBalance_Call) RunAndReturn(run func(context.Context, common.Address, common.Address) (*assets.Link, error)) *RPCClient_LINKBalance_Call { + _c.Call.Return(run) + return _c +} + // LatestBlockHeight provides a mock function with given fields: _a0 func (_m *RPCClient) LatestBlockHeight(_a0 context.Context) (*big.Int, error) { ret := _m.Called(_a0) @@ -620,9 +1327,37 @@ func (_m *RPCClient) LatestBlockHeight(_a0 context.Context) (*big.Int, error) { return r0, r1 } -// LatestFinalizedBlock provides a mock function with given fields: ctx -func (_m *RPCClient) LatestFinalizedBlock(ctx context.Context) (*types.Head, error) { - ret := _m.Called(ctx) +// RPCClient_LatestBlockHeight_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LatestBlockHeight' +type RPCClient_LatestBlockHeight_Call struct { + *mock.Call +} + +// LatestBlockHeight is a helper method to define mock.On call +// - _a0 context.Context +func (_e *RPCClient_Expecter) LatestBlockHeight(_a0 interface{}) *RPCClient_LatestBlockHeight_Call { + return &RPCClient_LatestBlockHeight_Call{Call: _e.mock.On("LatestBlockHeight", _a0)} +} + +func (_c *RPCClient_LatestBlockHeight_Call) Run(run func(_a0 context.Context)) *RPCClient_LatestBlockHeight_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *RPCClient_LatestBlockHeight_Call) Return(_a0 *big.Int, _a1 error) *RPCClient_LatestBlockHeight_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *RPCClient_LatestBlockHeight_Call) RunAndReturn(run func(context.Context) (*big.Int, error)) *RPCClient_LatestBlockHeight_Call { + _c.Call.Return(run) + return _c +} + +// LatestFinalizedBlock provides a mock function with given fields: ctx +func (_m *RPCClient) LatestFinalizedBlock(ctx context.Context) (*types.Head, error) { + ret := _m.Called(ctx) if len(ret) == 0 { panic("no return value specified for LatestFinalizedBlock") @@ -650,6 +1385,34 @@ func (_m *RPCClient) LatestFinalizedBlock(ctx context.Context) (*types.Head, err return r0, r1 } +// RPCClient_LatestFinalizedBlock_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LatestFinalizedBlock' +type RPCClient_LatestFinalizedBlock_Call struct { + *mock.Call +} + +// LatestFinalizedBlock is a helper method to define mock.On call +// - ctx context.Context +func (_e *RPCClient_Expecter) LatestFinalizedBlock(ctx interface{}) *RPCClient_LatestFinalizedBlock_Call { + return &RPCClient_LatestFinalizedBlock_Call{Call: _e.mock.On("LatestFinalizedBlock", ctx)} +} + +func (_c *RPCClient_LatestFinalizedBlock_Call) Run(run func(ctx context.Context)) *RPCClient_LatestFinalizedBlock_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *RPCClient_LatestFinalizedBlock_Call) Return(_a0 *types.Head, _a1 error) *RPCClient_LatestFinalizedBlock_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *RPCClient_LatestFinalizedBlock_Call) RunAndReturn(run func(context.Context) (*types.Head, error)) *RPCClient_LatestFinalizedBlock_Call { + _c.Call.Return(run) + return _c +} + // PendingCallContract provides a mock function with given fields: ctx, msg func (_m *RPCClient) PendingCallContract(ctx context.Context, msg interface{}) ([]byte, error) { ret := _m.Called(ctx, msg) @@ -680,6 +1443,35 @@ func (_m *RPCClient) PendingCallContract(ctx context.Context, msg interface{}) ( return r0, r1 } +// RPCClient_PendingCallContract_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PendingCallContract' +type RPCClient_PendingCallContract_Call struct { + *mock.Call +} + +// PendingCallContract is a helper method to define mock.On call +// - ctx context.Context +// - msg interface{} +func (_e *RPCClient_Expecter) PendingCallContract(ctx interface{}, msg interface{}) *RPCClient_PendingCallContract_Call { + return &RPCClient_PendingCallContract_Call{Call: _e.mock.On("PendingCallContract", ctx, msg)} +} + +func (_c *RPCClient_PendingCallContract_Call) Run(run func(ctx context.Context, msg interface{})) *RPCClient_PendingCallContract_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(interface{})) + }) + return _c +} + +func (_c *RPCClient_PendingCallContract_Call) Return(rpcErr []byte, extractErr error) *RPCClient_PendingCallContract_Call { + _c.Call.Return(rpcErr, extractErr) + return _c +} + +func (_c *RPCClient_PendingCallContract_Call) RunAndReturn(run func(context.Context, interface{}) ([]byte, error)) *RPCClient_PendingCallContract_Call { + _c.Call.Return(run) + return _c +} + // PendingCodeAt provides a mock function with given fields: ctx, account func (_m *RPCClient) PendingCodeAt(ctx context.Context, account common.Address) ([]byte, error) { ret := _m.Called(ctx, account) @@ -710,6 +1502,35 @@ func (_m *RPCClient) PendingCodeAt(ctx context.Context, account common.Address) return r0, r1 } +// RPCClient_PendingCodeAt_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PendingCodeAt' +type RPCClient_PendingCodeAt_Call struct { + *mock.Call +} + +// PendingCodeAt is a helper method to define mock.On call +// - ctx context.Context +// - account common.Address +func (_e *RPCClient_Expecter) PendingCodeAt(ctx interface{}, account interface{}) *RPCClient_PendingCodeAt_Call { + return &RPCClient_PendingCodeAt_Call{Call: _e.mock.On("PendingCodeAt", ctx, account)} +} + +func (_c *RPCClient_PendingCodeAt_Call) Run(run func(ctx context.Context, account common.Address)) *RPCClient_PendingCodeAt_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(common.Address)) + }) + return _c +} + +func (_c *RPCClient_PendingCodeAt_Call) Return(b []byte, err error) *RPCClient_PendingCodeAt_Call { + _c.Call.Return(b, err) + return _c +} + +func (_c *RPCClient_PendingCodeAt_Call) RunAndReturn(run func(context.Context, common.Address) ([]byte, error)) *RPCClient_PendingCodeAt_Call { + _c.Call.Return(run) + return _c +} + // PendingSequenceAt provides a mock function with given fields: ctx, addr func (_m *RPCClient) PendingSequenceAt(ctx context.Context, addr common.Address) (types.Nonce, error) { ret := _m.Called(ctx, addr) @@ -738,6 +1559,35 @@ func (_m *RPCClient) PendingSequenceAt(ctx context.Context, addr common.Address) return r0, r1 } +// RPCClient_PendingSequenceAt_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PendingSequenceAt' +type RPCClient_PendingSequenceAt_Call struct { + *mock.Call +} + +// PendingSequenceAt is a helper method to define mock.On call +// - ctx context.Context +// - addr common.Address +func (_e *RPCClient_Expecter) PendingSequenceAt(ctx interface{}, addr interface{}) *RPCClient_PendingSequenceAt_Call { + return &RPCClient_PendingSequenceAt_Call{Call: _e.mock.On("PendingSequenceAt", ctx, addr)} +} + +func (_c *RPCClient_PendingSequenceAt_Call) Run(run func(ctx context.Context, addr common.Address)) *RPCClient_PendingSequenceAt_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(common.Address)) + }) + return _c +} + +func (_c *RPCClient_PendingSequenceAt_Call) Return(_a0 types.Nonce, _a1 error) *RPCClient_PendingSequenceAt_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *RPCClient_PendingSequenceAt_Call) RunAndReturn(run func(context.Context, common.Address) (types.Nonce, error)) *RPCClient_PendingSequenceAt_Call { + _c.Call.Return(run) + return _c +} + // SendEmptyTransaction provides a mock function with given fields: ctx, newTxAttempt, seq, gasLimit, fee, fromAddress func (_m *RPCClient) SendEmptyTransaction(ctx context.Context, newTxAttempt func(types.Nonce, uint32, *evmassets.Wei, common.Address) (interface{}, error), seq types.Nonce, gasLimit uint32, fee *evmassets.Wei, fromAddress common.Address) (string, error) { ret := _m.Called(ctx, newTxAttempt, seq, gasLimit, fee, fromAddress) @@ -766,6 +1616,39 @@ func (_m *RPCClient) SendEmptyTransaction(ctx context.Context, newTxAttempt func return r0, r1 } +// RPCClient_SendEmptyTransaction_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SendEmptyTransaction' +type RPCClient_SendEmptyTransaction_Call struct { + *mock.Call +} + +// SendEmptyTransaction is a helper method to define mock.On call +// - ctx context.Context +// - newTxAttempt func(types.Nonce , uint32 , *evmassets.Wei , common.Address)(interface{} , error) +// - seq types.Nonce +// - gasLimit uint32 +// - fee *evmassets.Wei +// - fromAddress common.Address +func (_e *RPCClient_Expecter) SendEmptyTransaction(ctx interface{}, newTxAttempt interface{}, seq interface{}, gasLimit interface{}, fee interface{}, fromAddress interface{}) *RPCClient_SendEmptyTransaction_Call { + return &RPCClient_SendEmptyTransaction_Call{Call: _e.mock.On("SendEmptyTransaction", ctx, newTxAttempt, seq, gasLimit, fee, fromAddress)} +} + +func (_c *RPCClient_SendEmptyTransaction_Call) Run(run func(ctx context.Context, newTxAttempt func(types.Nonce, uint32, *evmassets.Wei, common.Address) (interface{}, error), seq types.Nonce, gasLimit uint32, fee *evmassets.Wei, fromAddress common.Address)) *RPCClient_SendEmptyTransaction_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(func(types.Nonce, uint32, *evmassets.Wei, common.Address) (interface{}, error)), args[2].(types.Nonce), args[3].(uint32), args[4].(*evmassets.Wei), args[5].(common.Address)) + }) + return _c +} + +func (_c *RPCClient_SendEmptyTransaction_Call) Return(txhash string, err error) *RPCClient_SendEmptyTransaction_Call { + _c.Call.Return(txhash, err) + return _c +} + +func (_c *RPCClient_SendEmptyTransaction_Call) RunAndReturn(run func(context.Context, func(types.Nonce, uint32, *evmassets.Wei, common.Address) (interface{}, error), types.Nonce, uint32, *evmassets.Wei, common.Address) (string, error)) *RPCClient_SendEmptyTransaction_Call { + _c.Call.Return(run) + return _c +} + // SendTransaction provides a mock function with given fields: ctx, tx func (_m *RPCClient) SendTransaction(ctx context.Context, tx *coretypes.Transaction) error { ret := _m.Called(ctx, tx) @@ -784,6 +1667,35 @@ func (_m *RPCClient) SendTransaction(ctx context.Context, tx *coretypes.Transact return r0 } +// RPCClient_SendTransaction_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SendTransaction' +type RPCClient_SendTransaction_Call struct { + *mock.Call +} + +// SendTransaction is a helper method to define mock.On call +// - ctx context.Context +// - tx *coretypes.Transaction +func (_e *RPCClient_Expecter) SendTransaction(ctx interface{}, tx interface{}) *RPCClient_SendTransaction_Call { + return &RPCClient_SendTransaction_Call{Call: _e.mock.On("SendTransaction", ctx, tx)} +} + +func (_c *RPCClient_SendTransaction_Call) Run(run func(ctx context.Context, tx *coretypes.Transaction)) *RPCClient_SendTransaction_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*coretypes.Transaction)) + }) + return _c +} + +func (_c *RPCClient_SendTransaction_Call) Return(_a0 error) *RPCClient_SendTransaction_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *RPCClient_SendTransaction_Call) RunAndReturn(run func(context.Context, *coretypes.Transaction) error) *RPCClient_SendTransaction_Call { + _c.Call.Return(run) + return _c +} + // SequenceAt provides a mock function with given fields: ctx, accountAddress, blockNumber func (_m *RPCClient) SequenceAt(ctx context.Context, accountAddress common.Address, blockNumber *big.Int) (types.Nonce, error) { ret := _m.Called(ctx, accountAddress, blockNumber) @@ -812,11 +1724,69 @@ func (_m *RPCClient) SequenceAt(ctx context.Context, accountAddress common.Addre return r0, r1 } +// RPCClient_SequenceAt_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SequenceAt' +type RPCClient_SequenceAt_Call struct { + *mock.Call +} + +// SequenceAt is a helper method to define mock.On call +// - ctx context.Context +// - accountAddress common.Address +// - blockNumber *big.Int +func (_e *RPCClient_Expecter) SequenceAt(ctx interface{}, accountAddress interface{}, blockNumber interface{}) *RPCClient_SequenceAt_Call { + return &RPCClient_SequenceAt_Call{Call: _e.mock.On("SequenceAt", ctx, accountAddress, blockNumber)} +} + +func (_c *RPCClient_SequenceAt_Call) Run(run func(ctx context.Context, accountAddress common.Address, blockNumber *big.Int)) *RPCClient_SequenceAt_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(common.Address), args[2].(*big.Int)) + }) + return _c +} + +func (_c *RPCClient_SequenceAt_Call) Return(_a0 types.Nonce, _a1 error) *RPCClient_SequenceAt_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *RPCClient_SequenceAt_Call) RunAndReturn(run func(context.Context, common.Address, *big.Int) (types.Nonce, error)) *RPCClient_SequenceAt_Call { + _c.Call.Return(run) + return _c +} + // SetAliveLoopSub provides a mock function with given fields: _a0 func (_m *RPCClient) SetAliveLoopSub(_a0 commontypes.Subscription) { _m.Called(_a0) } +// RPCClient_SetAliveLoopSub_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetAliveLoopSub' +type RPCClient_SetAliveLoopSub_Call struct { + *mock.Call +} + +// SetAliveLoopSub is a helper method to define mock.On call +// - _a0 commontypes.Subscription +func (_e *RPCClient_Expecter) SetAliveLoopSub(_a0 interface{}) *RPCClient_SetAliveLoopSub_Call { + return &RPCClient_SetAliveLoopSub_Call{Call: _e.mock.On("SetAliveLoopSub", _a0)} +} + +func (_c *RPCClient_SetAliveLoopSub_Call) Run(run func(_a0 commontypes.Subscription)) *RPCClient_SetAliveLoopSub_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(commontypes.Subscription)) + }) + return _c +} + +func (_c *RPCClient_SetAliveLoopSub_Call) Return() *RPCClient_SetAliveLoopSub_Call { + _c.Call.Return() + return _c +} + +func (_c *RPCClient_SetAliveLoopSub_Call) RunAndReturn(run func(commontypes.Subscription)) *RPCClient_SetAliveLoopSub_Call { + _c.Call.Return(run) + return _c +} + // SimulateTransaction provides a mock function with given fields: ctx, tx func (_m *RPCClient) SimulateTransaction(ctx context.Context, tx *coretypes.Transaction) error { ret := _m.Called(ctx, tx) @@ -835,6 +1805,35 @@ func (_m *RPCClient) SimulateTransaction(ctx context.Context, tx *coretypes.Tran return r0 } +// RPCClient_SimulateTransaction_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SimulateTransaction' +type RPCClient_SimulateTransaction_Call struct { + *mock.Call +} + +// SimulateTransaction is a helper method to define mock.On call +// - ctx context.Context +// - tx *coretypes.Transaction +func (_e *RPCClient_Expecter) SimulateTransaction(ctx interface{}, tx interface{}) *RPCClient_SimulateTransaction_Call { + return &RPCClient_SimulateTransaction_Call{Call: _e.mock.On("SimulateTransaction", ctx, tx)} +} + +func (_c *RPCClient_SimulateTransaction_Call) Run(run func(ctx context.Context, tx *coretypes.Transaction)) *RPCClient_SimulateTransaction_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*coretypes.Transaction)) + }) + return _c +} + +func (_c *RPCClient_SimulateTransaction_Call) Return(_a0 error) *RPCClient_SimulateTransaction_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *RPCClient_SimulateTransaction_Call) RunAndReturn(run func(context.Context, *coretypes.Transaction) error) *RPCClient_SimulateTransaction_Call { + _c.Call.Return(run) + return _c +} + // SubscribeFilterLogs provides a mock function with given fields: ctx, q, ch func (_m *RPCClient) SubscribeFilterLogs(ctx context.Context, q ethereum.FilterQuery, ch chan<- coretypes.Log) (ethereum.Subscription, error) { ret := _m.Called(ctx, q, ch) @@ -865,6 +1864,36 @@ func (_m *RPCClient) SubscribeFilterLogs(ctx context.Context, q ethereum.FilterQ return r0, r1 } +// RPCClient_SubscribeFilterLogs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SubscribeFilterLogs' +type RPCClient_SubscribeFilterLogs_Call struct { + *mock.Call +} + +// SubscribeFilterLogs is a helper method to define mock.On call +// - ctx context.Context +// - q ethereum.FilterQuery +// - ch chan<- coretypes.Log +func (_e *RPCClient_Expecter) SubscribeFilterLogs(ctx interface{}, q interface{}, ch interface{}) *RPCClient_SubscribeFilterLogs_Call { + return &RPCClient_SubscribeFilterLogs_Call{Call: _e.mock.On("SubscribeFilterLogs", ctx, q, ch)} +} + +func (_c *RPCClient_SubscribeFilterLogs_Call) Run(run func(ctx context.Context, q ethereum.FilterQuery, ch chan<- coretypes.Log)) *RPCClient_SubscribeFilterLogs_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(ethereum.FilterQuery), args[2].(chan<- coretypes.Log)) + }) + return _c +} + +func (_c *RPCClient_SubscribeFilterLogs_Call) Return(s ethereum.Subscription, err error) *RPCClient_SubscribeFilterLogs_Call { + _c.Call.Return(s, err) + return _c +} + +func (_c *RPCClient_SubscribeFilterLogs_Call) RunAndReturn(run func(context.Context, ethereum.FilterQuery, chan<- coretypes.Log) (ethereum.Subscription, error)) *RPCClient_SubscribeFilterLogs_Call { + _c.Call.Return(run) + return _c +} + // SubscribeNewHead provides a mock function with given fields: ctx, channel func (_m *RPCClient) SubscribeNewHead(ctx context.Context, channel chan<- *types.Head) (commontypes.Subscription, error) { ret := _m.Called(ctx, channel) @@ -895,6 +1924,169 @@ func (_m *RPCClient) SubscribeNewHead(ctx context.Context, channel chan<- *types return r0, r1 } +// RPCClient_SubscribeNewHead_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SubscribeNewHead' +type RPCClient_SubscribeNewHead_Call struct { + *mock.Call +} + +// SubscribeNewHead is a helper method to define mock.On call +// - ctx context.Context +// - channel chan<- *types.Head +func (_e *RPCClient_Expecter) SubscribeNewHead(ctx interface{}, channel interface{}) *RPCClient_SubscribeNewHead_Call { + return &RPCClient_SubscribeNewHead_Call{Call: _e.mock.On("SubscribeNewHead", ctx, channel)} +} + +func (_c *RPCClient_SubscribeNewHead_Call) Run(run func(ctx context.Context, channel chan<- *types.Head)) *RPCClient_SubscribeNewHead_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(chan<- *types.Head)) + }) + return _c +} + +func (_c *RPCClient_SubscribeNewHead_Call) Return(s commontypes.Subscription, err error) *RPCClient_SubscribeNewHead_Call { + _c.Call.Return(s, err) + return _c +} + +func (_c *RPCClient_SubscribeNewHead_Call) RunAndReturn(run func(context.Context, chan<- *types.Head) (commontypes.Subscription, error)) *RPCClient_SubscribeNewHead_Call { + _c.Call.Return(run) + return _c +} + +// SubscribeToFinalizedHeads provides a mock function with given fields: _a0 +func (_m *RPCClient) SubscribeToFinalizedHeads(_a0 context.Context) (<-chan *types.Head, commontypes.Subscription, error) { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for SubscribeToFinalizedHeads") + } + + var r0 <-chan *types.Head + var r1 commontypes.Subscription + var r2 error + if rf, ok := ret.Get(0).(func(context.Context) (<-chan *types.Head, commontypes.Subscription, error)); ok { + return rf(_a0) + } + if rf, ok := ret.Get(0).(func(context.Context) <-chan *types.Head); ok { + r0 = rf(_a0) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(<-chan *types.Head) + } + } + + if rf, ok := ret.Get(1).(func(context.Context) commontypes.Subscription); ok { + r1 = rf(_a0) + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).(commontypes.Subscription) + } + } + + if rf, ok := ret.Get(2).(func(context.Context) error); ok { + r2 = rf(_a0) + } else { + r2 = ret.Error(2) + } + + return r0, r1, r2 +} + +// RPCClient_SubscribeToFinalizedHeads_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SubscribeToFinalizedHeads' +type RPCClient_SubscribeToFinalizedHeads_Call struct { + *mock.Call +} + +// SubscribeToFinalizedHeads is a helper method to define mock.On call +// - _a0 context.Context +func (_e *RPCClient_Expecter) SubscribeToFinalizedHeads(_a0 interface{}) *RPCClient_SubscribeToFinalizedHeads_Call { + return &RPCClient_SubscribeToFinalizedHeads_Call{Call: _e.mock.On("SubscribeToFinalizedHeads", _a0)} +} + +func (_c *RPCClient_SubscribeToFinalizedHeads_Call) Run(run func(_a0 context.Context)) *RPCClient_SubscribeToFinalizedHeads_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *RPCClient_SubscribeToFinalizedHeads_Call) Return(_a0 <-chan *types.Head, _a1 commontypes.Subscription, _a2 error) *RPCClient_SubscribeToFinalizedHeads_Call { + _c.Call.Return(_a0, _a1, _a2) + return _c +} + +func (_c *RPCClient_SubscribeToFinalizedHeads_Call) RunAndReturn(run func(context.Context) (<-chan *types.Head, commontypes.Subscription, error)) *RPCClient_SubscribeToFinalizedHeads_Call { + _c.Call.Return(run) + return _c +} + +// SubscribeToHeads provides a mock function with given fields: ctx +func (_m *RPCClient) SubscribeToHeads(ctx context.Context) (<-chan *types.Head, commontypes.Subscription, error) { + ret := _m.Called(ctx) + + if len(ret) == 0 { + panic("no return value specified for SubscribeToHeads") + } + + var r0 <-chan *types.Head + var r1 commontypes.Subscription + var r2 error + if rf, ok := ret.Get(0).(func(context.Context) (<-chan *types.Head, commontypes.Subscription, error)); ok { + return rf(ctx) + } + if rf, ok := ret.Get(0).(func(context.Context) <-chan *types.Head); ok { + r0 = rf(ctx) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(<-chan *types.Head) + } + } + + if rf, ok := ret.Get(1).(func(context.Context) commontypes.Subscription); ok { + r1 = rf(ctx) + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).(commontypes.Subscription) + } + } + + if rf, ok := ret.Get(2).(func(context.Context) error); ok { + r2 = rf(ctx) + } else { + r2 = ret.Error(2) + } + + return r0, r1, r2 +} + +// RPCClient_SubscribeToHeads_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SubscribeToHeads' +type RPCClient_SubscribeToHeads_Call struct { + *mock.Call +} + +// SubscribeToHeads is a helper method to define mock.On call +// - ctx context.Context +func (_e *RPCClient_Expecter) SubscribeToHeads(ctx interface{}) *RPCClient_SubscribeToHeads_Call { + return &RPCClient_SubscribeToHeads_Call{Call: _e.mock.On("SubscribeToHeads", ctx)} +} + +func (_c *RPCClient_SubscribeToHeads_Call) Run(run func(ctx context.Context)) *RPCClient_SubscribeToHeads_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *RPCClient_SubscribeToHeads_Call) Return(ch <-chan *types.Head, sub commontypes.Subscription, err error) *RPCClient_SubscribeToHeads_Call { + _c.Call.Return(ch, sub, err) + return _c +} + +func (_c *RPCClient_SubscribeToHeads_Call) RunAndReturn(run func(context.Context) (<-chan *types.Head, commontypes.Subscription, error)) *RPCClient_SubscribeToHeads_Call { + _c.Call.Return(run) + return _c +} + // SubscribersCount provides a mock function with given fields: func (_m *RPCClient) SubscribersCount() int32 { ret := _m.Called() @@ -913,6 +2105,33 @@ func (_m *RPCClient) SubscribersCount() int32 { return r0 } +// RPCClient_SubscribersCount_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SubscribersCount' +type RPCClient_SubscribersCount_Call struct { + *mock.Call +} + +// SubscribersCount is a helper method to define mock.On call +func (_e *RPCClient_Expecter) SubscribersCount() *RPCClient_SubscribersCount_Call { + return &RPCClient_SubscribersCount_Call{Call: _e.mock.On("SubscribersCount")} +} + +func (_c *RPCClient_SubscribersCount_Call) Run(run func()) *RPCClient_SubscribersCount_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *RPCClient_SubscribersCount_Call) Return(_a0 int32) *RPCClient_SubscribersCount_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *RPCClient_SubscribersCount_Call) RunAndReturn(run func() int32) *RPCClient_SubscribersCount_Call { + _c.Call.Return(run) + return _c +} + // SuggestGasPrice provides a mock function with given fields: ctx func (_m *RPCClient) SuggestGasPrice(ctx context.Context) (*big.Int, error) { ret := _m.Called(ctx) @@ -943,6 +2162,34 @@ func (_m *RPCClient) SuggestGasPrice(ctx context.Context) (*big.Int, error) { return r0, r1 } +// RPCClient_SuggestGasPrice_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SuggestGasPrice' +type RPCClient_SuggestGasPrice_Call struct { + *mock.Call +} + +// SuggestGasPrice is a helper method to define mock.On call +// - ctx context.Context +func (_e *RPCClient_Expecter) SuggestGasPrice(ctx interface{}) *RPCClient_SuggestGasPrice_Call { + return &RPCClient_SuggestGasPrice_Call{Call: _e.mock.On("SuggestGasPrice", ctx)} +} + +func (_c *RPCClient_SuggestGasPrice_Call) Run(run func(ctx context.Context)) *RPCClient_SuggestGasPrice_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *RPCClient_SuggestGasPrice_Call) Return(p *big.Int, err error) *RPCClient_SuggestGasPrice_Call { + _c.Call.Return(p, err) + return _c +} + +func (_c *RPCClient_SuggestGasPrice_Call) RunAndReturn(run func(context.Context) (*big.Int, error)) *RPCClient_SuggestGasPrice_Call { + _c.Call.Return(run) + return _c +} + // SuggestGasTipCap provides a mock function with given fields: ctx func (_m *RPCClient) SuggestGasTipCap(ctx context.Context) (*big.Int, error) { ret := _m.Called(ctx) @@ -973,6 +2220,34 @@ func (_m *RPCClient) SuggestGasTipCap(ctx context.Context) (*big.Int, error) { return r0, r1 } +// RPCClient_SuggestGasTipCap_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SuggestGasTipCap' +type RPCClient_SuggestGasTipCap_Call struct { + *mock.Call +} + +// SuggestGasTipCap is a helper method to define mock.On call +// - ctx context.Context +func (_e *RPCClient_Expecter) SuggestGasTipCap(ctx interface{}) *RPCClient_SuggestGasTipCap_Call { + return &RPCClient_SuggestGasTipCap_Call{Call: _e.mock.On("SuggestGasTipCap", ctx)} +} + +func (_c *RPCClient_SuggestGasTipCap_Call) Run(run func(ctx context.Context)) *RPCClient_SuggestGasTipCap_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *RPCClient_SuggestGasTipCap_Call) Return(t *big.Int, err error) *RPCClient_SuggestGasTipCap_Call { + _c.Call.Return(t, err) + return _c +} + +func (_c *RPCClient_SuggestGasTipCap_Call) RunAndReturn(run func(context.Context) (*big.Int, error)) *RPCClient_SuggestGasTipCap_Call { + _c.Call.Return(run) + return _c +} + // TokenBalance provides a mock function with given fields: ctx, accountAddress, tokenAddress func (_m *RPCClient) TokenBalance(ctx context.Context, accountAddress common.Address, tokenAddress common.Address) (*big.Int, error) { ret := _m.Called(ctx, accountAddress, tokenAddress) @@ -1003,6 +2278,36 @@ func (_m *RPCClient) TokenBalance(ctx context.Context, accountAddress common.Add return r0, r1 } +// RPCClient_TokenBalance_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TokenBalance' +type RPCClient_TokenBalance_Call struct { + *mock.Call +} + +// TokenBalance is a helper method to define mock.On call +// - ctx context.Context +// - accountAddress common.Address +// - tokenAddress common.Address +func (_e *RPCClient_Expecter) TokenBalance(ctx interface{}, accountAddress interface{}, tokenAddress interface{}) *RPCClient_TokenBalance_Call { + return &RPCClient_TokenBalance_Call{Call: _e.mock.On("TokenBalance", ctx, accountAddress, tokenAddress)} +} + +func (_c *RPCClient_TokenBalance_Call) Run(run func(ctx context.Context, accountAddress common.Address, tokenAddress common.Address)) *RPCClient_TokenBalance_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(common.Address), args[2].(common.Address)) + }) + return _c +} + +func (_c *RPCClient_TokenBalance_Call) Return(_a0 *big.Int, _a1 error) *RPCClient_TokenBalance_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *RPCClient_TokenBalance_Call) RunAndReturn(run func(context.Context, common.Address, common.Address) (*big.Int, error)) *RPCClient_TokenBalance_Call { + _c.Call.Return(run) + return _c +} + // TransactionByHash provides a mock function with given fields: ctx, txHash func (_m *RPCClient) TransactionByHash(ctx context.Context, txHash common.Hash) (*coretypes.Transaction, error) { ret := _m.Called(ctx, txHash) @@ -1033,6 +2338,35 @@ func (_m *RPCClient) TransactionByHash(ctx context.Context, txHash common.Hash) return r0, r1 } +// RPCClient_TransactionByHash_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TransactionByHash' +type RPCClient_TransactionByHash_Call struct { + *mock.Call +} + +// TransactionByHash is a helper method to define mock.On call +// - ctx context.Context +// - txHash common.Hash +func (_e *RPCClient_Expecter) TransactionByHash(ctx interface{}, txHash interface{}) *RPCClient_TransactionByHash_Call { + return &RPCClient_TransactionByHash_Call{Call: _e.mock.On("TransactionByHash", ctx, txHash)} +} + +func (_c *RPCClient_TransactionByHash_Call) Run(run func(ctx context.Context, txHash common.Hash)) *RPCClient_TransactionByHash_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(common.Hash)) + }) + return _c +} + +func (_c *RPCClient_TransactionByHash_Call) Return(_a0 *coretypes.Transaction, _a1 error) *RPCClient_TransactionByHash_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *RPCClient_TransactionByHash_Call) RunAndReturn(run func(context.Context, common.Hash) (*coretypes.Transaction, error)) *RPCClient_TransactionByHash_Call { + _c.Call.Return(run) + return _c +} + // TransactionReceipt provides a mock function with given fields: ctx, txHash func (_m *RPCClient) TransactionReceipt(ctx context.Context, txHash common.Hash) (*types.Receipt, error) { ret := _m.Called(ctx, txHash) @@ -1063,6 +2397,35 @@ func (_m *RPCClient) TransactionReceipt(ctx context.Context, txHash common.Hash) return r0, r1 } +// RPCClient_TransactionReceipt_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TransactionReceipt' +type RPCClient_TransactionReceipt_Call struct { + *mock.Call +} + +// TransactionReceipt is a helper method to define mock.On call +// - ctx context.Context +// - txHash common.Hash +func (_e *RPCClient_Expecter) TransactionReceipt(ctx interface{}, txHash interface{}) *RPCClient_TransactionReceipt_Call { + return &RPCClient_TransactionReceipt_Call{Call: _e.mock.On("TransactionReceipt", ctx, txHash)} +} + +func (_c *RPCClient_TransactionReceipt_Call) Run(run func(ctx context.Context, txHash common.Hash)) *RPCClient_TransactionReceipt_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(common.Hash)) + }) + return _c +} + +func (_c *RPCClient_TransactionReceipt_Call) Return(_a0 *types.Receipt, _a1 error) *RPCClient_TransactionReceipt_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *RPCClient_TransactionReceipt_Call) RunAndReturn(run func(context.Context, common.Hash) (*types.Receipt, error)) *RPCClient_TransactionReceipt_Call { + _c.Call.Return(run) + return _c +} + // TransactionReceiptGeth provides a mock function with given fields: ctx, txHash func (_m *RPCClient) TransactionReceiptGeth(ctx context.Context, txHash common.Hash) (*coretypes.Receipt, error) { ret := _m.Called(ctx, txHash) @@ -1093,11 +2456,67 @@ func (_m *RPCClient) TransactionReceiptGeth(ctx context.Context, txHash common.H return r0, r1 } +// RPCClient_TransactionReceiptGeth_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TransactionReceiptGeth' +type RPCClient_TransactionReceiptGeth_Call struct { + *mock.Call +} + +// TransactionReceiptGeth is a helper method to define mock.On call +// - ctx context.Context +// - txHash common.Hash +func (_e *RPCClient_Expecter) TransactionReceiptGeth(ctx interface{}, txHash interface{}) *RPCClient_TransactionReceiptGeth_Call { + return &RPCClient_TransactionReceiptGeth_Call{Call: _e.mock.On("TransactionReceiptGeth", ctx, txHash)} +} + +func (_c *RPCClient_TransactionReceiptGeth_Call) Run(run func(ctx context.Context, txHash common.Hash)) *RPCClient_TransactionReceiptGeth_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(common.Hash)) + }) + return _c +} + +func (_c *RPCClient_TransactionReceiptGeth_Call) Return(r *coretypes.Receipt, err error) *RPCClient_TransactionReceiptGeth_Call { + _c.Call.Return(r, err) + return _c +} + +func (_c *RPCClient_TransactionReceiptGeth_Call) RunAndReturn(run func(context.Context, common.Hash) (*coretypes.Receipt, error)) *RPCClient_TransactionReceiptGeth_Call { + _c.Call.Return(run) + return _c +} + // UnsubscribeAllExceptAliveLoop provides a mock function with given fields: func (_m *RPCClient) UnsubscribeAllExceptAliveLoop() { _m.Called() } +// RPCClient_UnsubscribeAllExceptAliveLoop_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UnsubscribeAllExceptAliveLoop' +type RPCClient_UnsubscribeAllExceptAliveLoop_Call struct { + *mock.Call +} + +// UnsubscribeAllExceptAliveLoop is a helper method to define mock.On call +func (_e *RPCClient_Expecter) UnsubscribeAllExceptAliveLoop() *RPCClient_UnsubscribeAllExceptAliveLoop_Call { + return &RPCClient_UnsubscribeAllExceptAliveLoop_Call{Call: _e.mock.On("UnsubscribeAllExceptAliveLoop")} +} + +func (_c *RPCClient_UnsubscribeAllExceptAliveLoop_Call) Run(run func()) *RPCClient_UnsubscribeAllExceptAliveLoop_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *RPCClient_UnsubscribeAllExceptAliveLoop_Call) Return() *RPCClient_UnsubscribeAllExceptAliveLoop_Call { + _c.Call.Return() + return _c +} + +func (_c *RPCClient_UnsubscribeAllExceptAliveLoop_Call) RunAndReturn(run func()) *RPCClient_UnsubscribeAllExceptAliveLoop_Call { + _c.Call.Return(run) + return _c +} + // NewRPCClient creates a new instance of RPCClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewRPCClient(t interface { diff --git a/core/chains/evm/client/mocks/tx_sender.go b/core/chains/evm/client/mocks/tx_sender.go deleted file mode 100644 index 6c44544508b..00000000000 --- a/core/chains/evm/client/mocks/tx_sender.go +++ /dev/null @@ -1,80 +0,0 @@ -// Code generated by mockery v2.42.2. DO NOT EDIT. - -package mocks - -import ( - big "math/big" - - context "context" - - mock "github.com/stretchr/testify/mock" - - types "github.com/ethereum/go-ethereum/core/types" -) - -// TxSender is an autogenerated mock type for the TxSender type -type TxSender struct { - mock.Mock -} - -// ChainID provides a mock function with given fields: _a0 -func (_m *TxSender) ChainID(_a0 context.Context) (*big.Int, error) { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for ChainID") - } - - var r0 *big.Int - var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (*big.Int, error)); ok { - return rf(_a0) - } - if rf, ok := ret.Get(0).(func(context.Context) *big.Int); ok { - r0 = rf(_a0) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*big.Int) - } - } - - if rf, ok := ret.Get(1).(func(context.Context) error); ok { - r1 = rf(_a0) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// SendTransaction provides a mock function with given fields: ctx, tx -func (_m *TxSender) SendTransaction(ctx context.Context, tx *types.Transaction) error { - ret := _m.Called(ctx, tx) - - if len(ret) == 0 { - panic("no return value specified for SendTransaction") - } - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, *types.Transaction) error); ok { - r0 = rf(ctx, tx) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// NewTxSender creates a new instance of TxSender. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewTxSender(t interface { - mock.TestingT - Cleanup(func()) -}) *TxSender { - mock := &TxSender{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/core/chains/evm/client/null_client.go b/core/chains/evm/client/null_client.go index 3129bcff9b0..5b1a4d7e1bb 100644 --- a/core/chains/evm/client/null_client.go +++ b/core/chains/evm/client/null_client.go @@ -235,3 +235,7 @@ func (nc *NullClient) LatestFinalizedBlock(_ context.Context) (*evmtypes.Head, e func (nc *NullClient) CheckTxValidity(_ context.Context, _ common.Address, _ common.Address, _ []byte) *SendError { return nil } + +func (nc *NullClient) FeeHistory(ctx context.Context, blockCount uint64, rewardPercentiles []float64) (feeHistory *ethereum.FeeHistory, err error) { + return nil, nil +} diff --git a/core/chains/evm/client/rpc_client.go b/core/chains/evm/client/rpc_client.go index 6499b18f795..763348173aa 100644 --- a/core/chains/evm/client/rpc_client.go +++ b/core/chains/evm/client/rpc_client.go @@ -2,6 +2,8 @@ package client import ( "context" + "encoding/json" + "errors" "fmt" "math/big" "net/url" @@ -27,6 +29,7 @@ import ( commonclient "github.com/smartcontractkit/chainlink/v2/common/client" commontypes "github.com/smartcontractkit/chainlink/v2/common/types" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/config/chaintype" evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils" ubig "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils/big" @@ -75,8 +78,6 @@ var ( ) // RPCClient includes all the necessary generalized RPC methods along with any additional chain-specific methods. -// -//go:generate mockery --quiet --name RPCClient --output ./mocks --case=underscore type RPCClient interface { commonclient.RPC[ *big.Int, @@ -102,8 +103,11 @@ type RPCClient interface { SuggestGasTipCap(ctx context.Context) (t *big.Int, err error) TransactionReceiptGeth(ctx context.Context, txHash common.Hash) (r *types.Receipt, err error) GetInterceptedChainInfo() (latest, highestUserObservations commonclient.ChainInfo) + FeeHistory(ctx context.Context, blockCount uint64, rewardPercentiles []float64) (feeHistory *ethereum.FeeHistory, err error) } +const rpcSubscriptionMethodNewHeads = "newHeads" + type rawclient struct { rpc *rpc.Client geth *ethclient.Client @@ -111,11 +115,16 @@ type rawclient struct { } type rpcClient struct { - rpcLog logger.SugaredLogger - name string - id int32 - chainID *big.Int - tier commonclient.NodeTier + rpcLog logger.SugaredLogger + name string + id int32 + chainID *big.Int + tier commonclient.NodeTier + largePayloadRpcTimeout time.Duration + rpcTimeout time.Duration + finalizedBlockPollInterval time.Duration + newHeadsPollInterval time.Duration + chainType chaintype.ChainType ws rawclient http *rawclient @@ -134,6 +143,7 @@ type rpcClient struct { // stateMu since it can happen on state transitions as well as rpcClient Close. chStopInFlight chan struct{} + chainInfoLock sync.RWMutex // intercepted values seen by callers of the rpcClient excluding health check calls. Need to ensure MultiNode provides repeatable read guarantee highestUserObservations commonclient.ChainInfo // most recent chain info observed during current lifecycle (reseted on DisconnectAll) @@ -149,13 +159,24 @@ func NewRPCClient( id int32, chainID *big.Int, tier commonclient.NodeTier, + finalizedBlockPollInterval time.Duration, + newHeadsPollInterval time.Duration, + largePayloadRpcTimeout time.Duration, + rpcTimeout time.Duration, + chainType chaintype.ChainType, ) RPCClient { - r := new(rpcClient) + r := &rpcClient{ + largePayloadRpcTimeout: largePayloadRpcTimeout, + rpcTimeout: rpcTimeout, + chainType: chainType, + } r.name = name r.id = id r.chainID = chainID r.tier = tier r.ws.uri = wsuri + r.finalizedBlockPollInterval = finalizedBlockPollInterval + r.newHeadsPollInterval = newHeadsPollInterval if httpuri != nil { r.http = &rawclient{uri: *httpuri} } @@ -174,7 +195,7 @@ func NewRPCClient( // Not thread-safe, pure dial. func (r *rpcClient) Dial(callerCtx context.Context) error { - ctx, cancel := r.makeQueryCtx(callerCtx) + ctx, cancel := r.makeQueryCtx(callerCtx, r.rpcTimeout) defer cancel() promEVMPoolRPCNodeDials.WithLabelValues(r.chainID.String(), r.name).Inc() @@ -320,7 +341,9 @@ func (r *rpcClient) DisconnectAll() { } r.cancelInflightRequests() r.unsubscribeAll() + r.chainInfoLock.Lock() r.latestChainInfo = commonclient.ChainInfo{} + r.chainInfoLock.Unlock() } // unsubscribeAll unsubscribes all subscriptions @@ -363,7 +386,7 @@ func (r *rpcClient) UnsubscribeAllExceptAliveLoop() { // CallContext implementation func (r *rpcClient) CallContext(ctx context.Context, result interface{}, method string, args ...interface{}) error { - ctx, cancel, ws, http := r.makeLiveQueryCtxAndSafeGetClients(ctx) + ctx, cancel, ws, http := r.makeLiveQueryCtxAndSafeGetClients(ctx, r.largePayloadRpcTimeout) defer cancel() lggr := r.newRqLggr().With( "method", method, @@ -385,8 +408,28 @@ func (r *rpcClient) CallContext(ctx context.Context, result interface{}, method return err } -func (r *rpcClient) BatchCallContext(ctx context.Context, b []rpc.BatchElem) error { - ctx, cancel, ws, http := r.makeLiveQueryCtxAndSafeGetClients(ctx) +func (r *rpcClient) BatchCallContext(rootCtx context.Context, b []rpc.BatchElem) error { + // Astar's finality tags provide weaker finality guarantees than we require. + // Fetch latest finalized block using Astar's custom requests and populate it after batch request completes + var astarRawLatestFinalizedBlock json.RawMessage + var requestedFinalizedBlock bool + if r.chainType == chaintype.ChainAstar { + for _, el := range b { + if !isRequestingFinalizedBlock(el) { + continue + } + + requestedFinalizedBlock = true + err := r.astarLatestFinalizedBlock(rootCtx, &astarRawLatestFinalizedBlock) + if err != nil { + return fmt.Errorf("failed to get astar latest finalized block: %w", err) + } + + break + } + } + + ctx, cancel, ws, http := r.makeLiveQueryCtxAndSafeGetClients(rootCtx, r.largePayloadRpcTimeout) defer cancel() lggr := r.newRqLggr().With("nBatchElems", len(b), "batchElems", b) @@ -401,16 +444,67 @@ func (r *rpcClient) BatchCallContext(ctx context.Context, b []rpc.BatchElem) err duration := time.Since(start) r.logResult(lggr, err, duration, r.getRPCDomain(), "BatchCallContext") + if err != nil { + return err + } - return err + if r.chainType == chaintype.ChainAstar && requestedFinalizedBlock { + // populate requested finalized block with correct value + for _, el := range b { + if !isRequestingFinalizedBlock(el) { + continue + } + + el.Error = nil + err = json.Unmarshal(astarRawLatestFinalizedBlock, el.Result) + if err != nil { + el.Error = fmt.Errorf("failed to unmarshal astar finalized block into provided struct: %w", err) + } + } + } + + return nil } +func isRequestingFinalizedBlock(el rpc.BatchElem) bool { + isGetBlock := el.Method == "eth_getBlockByNumber" && len(el.Args) > 0 + if !isGetBlock { + return false + } + + if el.Args[0] == rpc.FinalizedBlockNumber { + return true + } + + switch arg := el.Args[0].(type) { + case string: + return arg == rpc.FinalizedBlockNumber.String() + case fmt.Stringer: + return arg.String() == rpc.FinalizedBlockNumber.String() + default: + return false + } +} + +// TODO: Full transition from SubscribeNewHead to SubscribeToHeads is done in BCI-2875 func (r *rpcClient) SubscribeNewHead(ctx context.Context, channel chan<- *evmtypes.Head) (_ commontypes.Subscription, err error) { - ctx, cancel, chStopInFlight, ws, _ := r.acquireQueryCtx(ctx) + ctx, cancel, chStopInFlight, ws, _ := r.acquireQueryCtx(ctx, r.rpcTimeout) defer cancel() args := []interface{}{"newHeads"} lggr := r.newRqLggr().With("args", args) + if r.newHeadsPollInterval > 0 { + interval := r.newHeadsPollInterval + timeout := interval + poller, _ := commonclient.NewPoller[*evmtypes.Head](interval, r.latestBlock, timeout, r.rpcLog) + if err = poller.Start(ctx); err != nil { + return nil, err + } + + lggr.Debugf("Polling new heads over http") + return &poller, nil + } + lggr.Debug("RPC call: evmclient.Client#EthSubscribe") start := time.Now() defer func() { @@ -436,6 +530,67 @@ func (r *rpcClient) SubscribeNewHead(ctx context.Context, channel chan<- *evmtyp return subForwarder, nil } +func (r *rpcClient) SubscribeToHeads(ctx context.Context) (ch <-chan *evmtypes.Head, sub commontypes.Subscription, err error) { + ctx, cancel, chStopInFlight, ws, _ := r.acquireQueryCtx(ctx, r.rpcTimeout) + defer cancel() + + args := []interface{}{rpcSubscriptionMethodNewHeads} + start := time.Now() + lggr := r.newRqLggr().With("args", args) + + // if new head based on http polling is enabled, we will replace it for WS newHead subscription + if r.newHeadsPollInterval > 0 { + interval := r.newHeadsPollInterval + timeout := interval + poller, channel := commonclient.NewPoller[*evmtypes.Head](interval, r.latestBlock, timeout, r.rpcLog) + if err = poller.Start(ctx); err != nil { + return nil, nil, err + } + + lggr.Debugf("Polling new heads over http") + return channel, &poller, nil + } + + lggr.Debug("RPC call: evmclient.Client#EthSubscribe") + defer func() { + duration := time.Since(start) + r.logResult(lggr, err, duration, r.getRPCDomain(), "EthSubscribe") + err = r.wrapWS(err) + }() + + channel := make(chan *evmtypes.Head) + forwarder := newSubForwarder(channel, func(head *evmtypes.Head) *evmtypes.Head { + head.EVMChainID = ubig.New(r.chainID) + r.onNewHead(ctx, chStopInFlight, head) + return head + }, r.wrapRPCClientError) + + err = forwarder.start(ws.rpc.EthSubscribe(ctx, forwarder.srcCh, args...)) + if err != nil { + return nil, nil, err + } + + err = r.registerSub(forwarder, chStopInFlight) + if err != nil { + return nil, nil, err + } + + return channel, forwarder, err +} + +func (r *rpcClient) SubscribeToFinalizedHeads(ctx context.Context) (<-chan *evmtypes.Head, commontypes.Subscription, error) { + interval := r.finalizedBlockPollInterval + if interval == 0 { + return nil, nil, errors.New("FinalizedBlockPollInterval is 0") + } + timeout := interval + poller, channel := commonclient.NewPoller[*evmtypes.Head](interval, r.LatestFinalizedBlock, timeout, r.rpcLog) + if err := poller.Start(ctx); err != nil { + return nil, nil, err + } + return channel, &poller, nil +} + // GethClient wrappers func (r *rpcClient) TransactionReceipt(ctx context.Context, txHash common.Hash) (receipt *evmtypes.Receipt, err error) { @@ -451,7 +606,7 @@ func (r *rpcClient) TransactionReceipt(ctx context.Context, txHash common.Hash) } func (r *rpcClient) TransactionReceiptGeth(ctx context.Context, txHash common.Hash) (receipt *types.Receipt, err error) { - ctx, cancel, ws, http := r.makeLiveQueryCtxAndSafeGetClients(ctx) + ctx, cancel, ws, http := r.makeLiveQueryCtxAndSafeGetClients(ctx, r.rpcTimeout) defer cancel() lggr := r.newRqLggr().With("txHash", txHash) @@ -473,8 +628,9 @@ func (r *rpcClient) TransactionReceiptGeth(ctx context.Context, txHash common.Ha return } + func (r *rpcClient) TransactionByHash(ctx context.Context, txHash common.Hash) (tx *types.Transaction, err error) { - ctx, cancel, ws, http := r.makeLiveQueryCtxAndSafeGetClients(ctx) + ctx, cancel, ws, http := r.makeLiveQueryCtxAndSafeGetClients(ctx, r.rpcTimeout) defer cancel() lggr := r.newRqLggr().With("txHash", txHash) @@ -498,7 +654,7 @@ func (r *rpcClient) TransactionByHash(ctx context.Context, txHash common.Hash) ( } func (r *rpcClient) HeaderByNumber(ctx context.Context, number *big.Int) (header *types.Header, err error) { - ctx, cancel, ws, http := r.makeLiveQueryCtxAndSafeGetClients(ctx) + ctx, cancel, ws, http := r.makeLiveQueryCtxAndSafeGetClients(ctx, r.rpcTimeout) defer cancel() lggr := r.newRqLggr().With("number", number) @@ -519,7 +675,7 @@ func (r *rpcClient) HeaderByNumber(ctx context.Context, number *big.Int) (header } func (r *rpcClient) HeaderByHash(ctx context.Context, hash common.Hash) (header *types.Header, err error) { - ctx, cancel, ws, http := r.makeLiveQueryCtxAndSafeGetClients(ctx) + ctx, cancel, ws, http := r.makeLiveQueryCtxAndSafeGetClients(ctx, r.rpcTimeout) defer cancel() lggr := r.newRqLggr().With("hash", hash) @@ -541,17 +697,88 @@ func (r *rpcClient) HeaderByHash(ctx context.Context, hash common.Hash) (header return } -func (r *rpcClient) LatestFinalizedBlock(ctx context.Context) (*evmtypes.Head, error) { - return r.blockByNumber(ctx, rpc.FinalizedBlockNumber.String()) +func (r *rpcClient) LatestFinalizedBlock(ctx context.Context) (head *evmtypes.Head, err error) { + // capture chStopInFlight to ensure we are not updating chainInfo with observations related to previous life cycle + ctx, cancel, chStopInFlight, _, _ := r.acquireQueryCtx(ctx, r.rpcTimeout) + defer cancel() + if r.chainType == chaintype.ChainAstar { + // astar's finality tags provide weaker guarantee. Use their custom request to request latest finalized block + err = r.astarLatestFinalizedBlock(ctx, &head) + } else { + err = r.ethGetBlockByNumber(ctx, rpc.FinalizedBlockNumber.String(), &head) + } + + if err != nil { + return + } + + if head == nil { + err = r.wrapRPCClientError(ethereum.NotFound) + return + } + + head.EVMChainID = ubig.New(r.chainID) + + r.onNewFinalizedHead(ctx, chStopInFlight, head) + return +} + +func (r *rpcClient) latestBlock(ctx context.Context) (head *evmtypes.Head, err error) { + return r.BlockByNumber(ctx, nil) +} + +func (r *rpcClient) astarLatestFinalizedBlock(ctx context.Context, result interface{}) (err error) { + var hashResult string + err = r.CallContext(ctx, &hashResult, "chain_getFinalizedHead") + if err != nil { + return fmt.Errorf("failed to get astar latest finalized hash: %w", err) + } + + var astarHead struct { + Number *hexutil.Big `json:"number"` + } + err = r.CallContext(ctx, &astarHead, "chain_getHeader", hashResult, false) + if err != nil { + return fmt.Errorf("failed to get astar head by hash: %w", err) + } + + if astarHead.Number == nil { + return r.wrapRPCClientError(fmt.Errorf("expected non empty head number of finalized block")) + } + + err = r.ethGetBlockByNumber(ctx, astarHead.Number.String(), result) + if err != nil { + return fmt.Errorf("failed to get astar finalized block: %w", err) + } + + return nil } func (r *rpcClient) BlockByNumber(ctx context.Context, number *big.Int) (head *evmtypes.Head, err error) { - hex := ToBlockNumArg(number) - return r.blockByNumber(ctx, hex) + ctx, cancel, chStopInFlight, _, _ := r.acquireQueryCtx(ctx, r.rpcTimeout) + defer cancel() + hexNumber := ToBlockNumArg(number) + err = r.ethGetBlockByNumber(ctx, hexNumber, &head) + if err != nil { + return + } + + if head == nil { + err = r.wrapRPCClientError(ethereum.NotFound) + return + } + + head.EVMChainID = ubig.New(r.chainID) + + if hexNumber == rpc.LatestBlockNumber.String() { + r.onNewHead(ctx, chStopInFlight, head) + } + + return } -func (r *rpcClient) blockByNumber(ctx context.Context, number string) (head *evmtypes.Head, err error) { - ctx, cancel, chStopInFlight, ws, http := r.acquireQueryCtx(ctx) +func (r *rpcClient) ethGetBlockByNumber(ctx context.Context, number string, result interface{}) (err error) { + ctx, cancel, ws, http := r.makeLiveQueryCtxAndSafeGetClients(ctx, r.rpcTimeout) defer cancel() const method = "eth_getBlockByNumber" args := []interface{}{number, false} @@ -563,30 +790,14 @@ func (r *rpcClient) blockByNumber(ctx context.Context, number string) (head *evm lggr.Debug("RPC call: evmclient.Client#CallContext") start := time.Now() if http != nil { - err = r.wrapHTTP(http.rpc.CallContext(ctx, &head, method, args...)) + err = r.wrapHTTP(http.rpc.CallContext(ctx, result, method, args...)) } else { - err = r.wrapWS(ws.rpc.CallContext(ctx, &head, method, args...)) + err = r.wrapWS(ws.rpc.CallContext(ctx, result, method, args...)) } duration := time.Since(start) r.logResult(lggr, err, duration, r.getRPCDomain(), "CallContext") - if err != nil { - return nil, err - } - if head == nil { - err = r.wrapRPCClientError(ethereum.NotFound) - return - } - head.EVMChainID = ubig.New(r.chainID) - - switch number { - case rpc.FinalizedBlockNumber.String(): - r.onNewFinalizedHead(ctx, chStopInFlight, head) - case rpc.LatestBlockNumber.String(): - r.onNewHead(ctx, chStopInFlight, head) - } - - return + return err } func (r *rpcClient) BlockByHash(ctx context.Context, hash common.Hash) (head *evmtypes.Head, err error) { @@ -603,7 +814,7 @@ func (r *rpcClient) BlockByHash(ctx context.Context, hash common.Hash) (head *ev } func (r *rpcClient) BlockByHashGeth(ctx context.Context, hash common.Hash) (block *types.Block, err error) { - ctx, cancel, ws, http := r.makeLiveQueryCtxAndSafeGetClients(ctx) + ctx, cancel, ws, http := r.makeLiveQueryCtxAndSafeGetClients(ctx, r.rpcTimeout) defer cancel() lggr := r.newRqLggr().With("hash", hash) @@ -626,7 +837,7 @@ func (r *rpcClient) BlockByHashGeth(ctx context.Context, hash common.Hash) (bloc } func (r *rpcClient) BlockByNumberGeth(ctx context.Context, number *big.Int) (block *types.Block, err error) { - ctx, cancel, ws, http := r.makeLiveQueryCtxAndSafeGetClients(ctx) + ctx, cancel, ws, http := r.makeLiveQueryCtxAndSafeGetClients(ctx, r.rpcTimeout) defer cancel() lggr := r.newRqLggr().With("number", number) @@ -649,7 +860,7 @@ func (r *rpcClient) BlockByNumberGeth(ctx context.Context, number *big.Int) (blo } func (r *rpcClient) SendTransaction(ctx context.Context, tx *types.Transaction) error { - ctx, cancel, ws, http := r.makeLiveQueryCtxAndSafeGetClients(ctx) + ctx, cancel, ws, http := r.makeLiveQueryCtxAndSafeGetClients(ctx, r.largePayloadRpcTimeout) defer cancel() lggr := r.newRqLggr().With("tx", tx) @@ -687,7 +898,7 @@ func (r *rpcClient) SendEmptyTransaction( // PendingSequenceAt returns one higher than the highest nonce from both mempool and mined transactions func (r *rpcClient) PendingSequenceAt(ctx context.Context, account common.Address) (nonce evmtypes.Nonce, err error) { - ctx, cancel, ws, http := r.makeLiveQueryCtxAndSafeGetClients(ctx) + ctx, cancel, ws, http := r.makeLiveQueryCtxAndSafeGetClients(ctx, r.rpcTimeout) defer cancel() lggr := r.newRqLggr().With("account", account) @@ -716,7 +927,7 @@ func (r *rpcClient) PendingSequenceAt(ctx context.Context, account common.Addres // mined nonce at the given block number, but it actually returns the total // transaction count which is the highest mined nonce + 1 func (r *rpcClient) SequenceAt(ctx context.Context, account common.Address, blockNumber *big.Int) (nonce evmtypes.Nonce, err error) { - ctx, cancel, ws, http := r.makeLiveQueryCtxAndSafeGetClients(ctx) + ctx, cancel, ws, http := r.makeLiveQueryCtxAndSafeGetClients(ctx, r.rpcTimeout) defer cancel() lggr := r.newRqLggr().With("account", account, "blockNumber", blockNumber) @@ -742,7 +953,7 @@ func (r *rpcClient) SequenceAt(ctx context.Context, account common.Address, bloc } func (r *rpcClient) PendingCodeAt(ctx context.Context, account common.Address) (code []byte, err error) { - ctx, cancel, ws, http := r.makeLiveQueryCtxAndSafeGetClients(ctx) + ctx, cancel, ws, http := r.makeLiveQueryCtxAndSafeGetClients(ctx, r.rpcTimeout) defer cancel() lggr := r.newRqLggr().With("account", account) @@ -765,7 +976,7 @@ func (r *rpcClient) PendingCodeAt(ctx context.Context, account common.Address) ( } func (r *rpcClient) CodeAt(ctx context.Context, account common.Address, blockNumber *big.Int) (code []byte, err error) { - ctx, cancel, ws, http := r.makeLiveQueryCtxAndSafeGetClients(ctx) + ctx, cancel, ws, http := r.makeLiveQueryCtxAndSafeGetClients(ctx, r.rpcTimeout) defer cancel() lggr := r.newRqLggr().With("account", account, "blockNumber", blockNumber) @@ -788,7 +999,7 @@ func (r *rpcClient) CodeAt(ctx context.Context, account common.Address, blockNum } func (r *rpcClient) EstimateGas(ctx context.Context, c interface{}) (gas uint64, err error) { - ctx, cancel, ws, http := r.makeLiveQueryCtxAndSafeGetClients(ctx) + ctx, cancel, ws, http := r.makeLiveQueryCtxAndSafeGetClients(ctx, r.largePayloadRpcTimeout) defer cancel() call := c.(ethereum.CallMsg) lggr := r.newRqLggr().With("call", call) @@ -812,7 +1023,7 @@ func (r *rpcClient) EstimateGas(ctx context.Context, c interface{}) (gas uint64, } func (r *rpcClient) SuggestGasPrice(ctx context.Context) (price *big.Int, err error) { - ctx, cancel, ws, http := r.makeLiveQueryCtxAndSafeGetClients(ctx) + ctx, cancel, ws, http := r.makeLiveQueryCtxAndSafeGetClients(ctx, r.rpcTimeout) defer cancel() lggr := r.newRqLggr() @@ -835,7 +1046,7 @@ func (r *rpcClient) SuggestGasPrice(ctx context.Context) (price *big.Int, err er } func (r *rpcClient) CallContract(ctx context.Context, msg interface{}, blockNumber *big.Int) (val []byte, err error) { - ctx, cancel, ws, http := r.makeLiveQueryCtxAndSafeGetClients(ctx) + ctx, cancel, ws, http := r.makeLiveQueryCtxAndSafeGetClients(ctx, r.largePayloadRpcTimeout) defer cancel() lggr := r.newRqLggr().With("callMsg", msg, "blockNumber", blockNumber) message := msg.(ethereum.CallMsg) @@ -863,7 +1074,7 @@ func (r *rpcClient) CallContract(ctx context.Context, msg interface{}, blockNumb } func (r *rpcClient) PendingCallContract(ctx context.Context, msg interface{}) (val []byte, err error) { - ctx, cancel, ws, http := r.makeLiveQueryCtxAndSafeGetClients(ctx) + ctx, cancel, ws, http := r.makeLiveQueryCtxAndSafeGetClients(ctx, r.largePayloadRpcTimeout) defer cancel() lggr := r.newRqLggr().With("callMsg", msg) message := msg.(ethereum.CallMsg) @@ -897,7 +1108,7 @@ func (r *rpcClient) LatestBlockHeight(ctx context.Context) (*big.Int, error) { } func (r *rpcClient) BlockNumber(ctx context.Context) (height uint64, err error) { - ctx, cancel, ws, http := r.makeLiveQueryCtxAndSafeGetClients(ctx) + ctx, cancel, ws, http := r.makeLiveQueryCtxAndSafeGetClients(ctx, r.rpcTimeout) defer cancel() lggr := r.newRqLggr() @@ -920,7 +1131,7 @@ func (r *rpcClient) BlockNumber(ctx context.Context) (height uint64, err error) } func (r *rpcClient) BalanceAt(ctx context.Context, account common.Address, blockNumber *big.Int) (balance *big.Int, err error) { - ctx, cancel, ws, http := r.makeLiveQueryCtxAndSafeGetClients(ctx) + ctx, cancel, ws, http := r.makeLiveQueryCtxAndSafeGetClients(ctx, r.rpcTimeout) defer cancel() lggr := r.newRqLggr().With("account", account.Hex(), "blockNumber", blockNumber) @@ -942,6 +1153,29 @@ func (r *rpcClient) BalanceAt(ctx context.Context, account common.Address, block return } +func (r *rpcClient) FeeHistory(ctx context.Context, blockCount uint64, rewardPercentiles []float64) (feeHistory *ethereum.FeeHistory, err error) { + ctx, cancel, ws, http := r.makeLiveQueryCtxAndSafeGetClients(ctx, r.rpcTimeout) + defer cancel() + lggr := r.newRqLggr().With("blockCount", blockCount, "rewardPercentiles", rewardPercentiles) + + lggr.Debug("RPC call: evmclient.Client#FeeHistory") + start := time.Now() + if http != nil { + feeHistory, err = http.geth.FeeHistory(ctx, blockCount, nil, rewardPercentiles) + err = r.wrapHTTP(err) + } else { + feeHistory, err = ws.geth.FeeHistory(ctx, blockCount, nil, rewardPercentiles) + err = r.wrapWS(err) + } + duration := time.Since(start) + + r.logResult(lggr, err, duration, r.getRPCDomain(), "FeeHistory", + "feeHistory", feeHistory, + ) + + return +} + // CallArgs represents the data used to call the balance method of a contract. // "To" is the address of the ERC contract. "Data" is the message sent // to the contract. "From" is the sender address. @@ -985,7 +1219,7 @@ func (r *rpcClient) FilterEvents(ctx context.Context, q ethereum.FilterQuery) ([ } func (r *rpcClient) FilterLogs(ctx context.Context, q ethereum.FilterQuery) (l []types.Log, err error) { - ctx, cancel, ws, http := r.makeLiveQueryCtxAndSafeGetClients(ctx) + ctx, cancel, ws, http := r.makeLiveQueryCtxAndSafeGetClients(ctx, r.rpcTimeout) defer cancel() lggr := r.newRqLggr().With("q", q) @@ -1013,7 +1247,7 @@ func (r *rpcClient) ClientVersion(ctx context.Context) (version string, err erro } func (r *rpcClient) SubscribeFilterLogs(ctx context.Context, q ethereum.FilterQuery, ch chan<- types.Log) (_ ethereum.Subscription, err error) { - ctx, cancel, chStopInFlight, ws, _ := r.acquireQueryCtx(ctx) + ctx, cancel, chStopInFlight, ws, _ := r.acquireQueryCtx(ctx, r.rpcTimeout) defer cancel() lggr := r.newRqLggr().With("q", q) @@ -1039,7 +1273,7 @@ func (r *rpcClient) SubscribeFilterLogs(ctx context.Context, q ethereum.FilterQu } func (r *rpcClient) SuggestGasTipCap(ctx context.Context) (tipCap *big.Int, err error) { - ctx, cancel, ws, http := r.makeLiveQueryCtxAndSafeGetClients(ctx) + ctx, cancel, ws, http := r.makeLiveQueryCtxAndSafeGetClients(ctx, r.rpcTimeout) defer cancel() lggr := r.newRqLggr() @@ -1064,7 +1298,7 @@ func (r *rpcClient) SuggestGasTipCap(ctx context.Context) (tipCap *big.Int, err // Returns the ChainID according to the geth client. This is useful for functions like verify() // the common node. func (r *rpcClient) ChainID(ctx context.Context) (chainID *big.Int, err error) { - ctx, cancel, ws, http := r.makeLiveQueryCtxAndSafeGetClients(ctx) + ctx, cancel, ws, http := r.makeLiveQueryCtxAndSafeGetClients(ctx, r.rpcTimeout) defer cancel() @@ -1119,12 +1353,12 @@ func (r *rpcClient) wrapHTTP(err error) error { } // makeLiveQueryCtxAndSafeGetClients wraps makeQueryCtx -func (r *rpcClient) makeLiveQueryCtxAndSafeGetClients(parentCtx context.Context) (ctx context.Context, cancel context.CancelFunc, ws rawclient, http *rawclient) { - ctx, cancel, _, ws, http = r.acquireQueryCtx(parentCtx) +func (r *rpcClient) makeLiveQueryCtxAndSafeGetClients(parentCtx context.Context, timeout time.Duration) (ctx context.Context, cancel context.CancelFunc, ws rawclient, http *rawclient) { + ctx, cancel, _, ws, http = r.acquireQueryCtx(parentCtx, timeout) return } -func (r *rpcClient) acquireQueryCtx(parentCtx context.Context) (ctx context.Context, cancel context.CancelFunc, +func (r *rpcClient) acquireQueryCtx(parentCtx context.Context, timeout time.Duration) (ctx context.Context, cancel context.CancelFunc, chStopInFlight chan struct{}, ws rawclient, http *rawclient) { // Need to wrap in mutex because state transition can cancel and replace the // context @@ -1136,7 +1370,7 @@ func (r *rpcClient) acquireQueryCtx(parentCtx context.Context) (ctx context.Cont http = &cp } r.stateMu.RUnlock() - ctx, cancel = makeQueryCtx(parentCtx, chStopInFlight) + ctx, cancel = makeQueryCtx(parentCtx, chStopInFlight, timeout) return } @@ -1144,10 +1378,10 @@ func (r *rpcClient) acquireQueryCtx(parentCtx context.Context) (ctx context.Cont // 1. Passed in ctx cancels // 2. Passed in channel is closed // 3. Default timeout is reached (queryTimeout) -func makeQueryCtx(ctx context.Context, ch services.StopChan) (context.Context, context.CancelFunc) { +func makeQueryCtx(ctx context.Context, ch services.StopChan, timeout time.Duration) (context.Context, context.CancelFunc) { var chCancel, timeoutCancel context.CancelFunc ctx, chCancel = ch.Ctx(ctx) - ctx, timeoutCancel = context.WithTimeout(ctx, queryTimeout) + ctx, timeoutCancel = context.WithTimeout(ctx, timeout) cancel := func() { chCancel() timeoutCancel() @@ -1155,12 +1389,12 @@ func makeQueryCtx(ctx context.Context, ch services.StopChan) (context.Context, c return ctx, cancel } -func (r *rpcClient) makeQueryCtx(ctx context.Context) (context.Context, context.CancelFunc) { - return makeQueryCtx(ctx, r.getChStopInflight()) +func (r *rpcClient) makeQueryCtx(ctx context.Context, timeout time.Duration) (context.Context, context.CancelFunc) { + return makeQueryCtx(ctx, r.getChStopInflight(), timeout) } func (r *rpcClient) IsSyncing(ctx context.Context) (bool, error) { - ctx, cancel, ws, http := r.makeLiveQueryCtxAndSafeGetClients(ctx) + ctx, cancel, ws, http := r.makeLiveQueryCtxAndSafeGetClients(ctx, r.rpcTimeout) defer cancel() lggr := r.newRqLggr() @@ -1205,8 +1439,8 @@ func (r *rpcClient) onNewHead(ctx context.Context, requestCh <-chan struct{}, he return } - r.stateMu.Lock() - defer r.stateMu.Unlock() + r.chainInfoLock.Lock() + defer r.chainInfoLock.Unlock() if !commonclient.CtxIsHeathCheckRequest(ctx) { r.highestUserObservations.BlockNumber = max(r.highestUserObservations.BlockNumber, head.Number) r.highestUserObservations.TotalDifficulty = commonclient.MaxTotalDifficulty(r.highestUserObservations.TotalDifficulty, head.TotalDifficulty) @@ -1224,8 +1458,8 @@ func (r *rpcClient) onNewFinalizedHead(ctx context.Context, requestCh <-chan str if head == nil { return } - r.stateMu.Lock() - defer r.stateMu.Unlock() + r.chainInfoLock.Lock() + defer r.chainInfoLock.Unlock() if !commonclient.CtxIsHeathCheckRequest(ctx) { r.highestUserObservations.FinalizedBlockNumber = max(r.highestUserObservations.FinalizedBlockNumber, head.Number) } @@ -1238,8 +1472,8 @@ func (r *rpcClient) onNewFinalizedHead(ctx context.Context, requestCh <-chan str } func (r *rpcClient) GetInterceptedChainInfo() (latest, highestUserObservations commonclient.ChainInfo) { - r.stateMu.RLock() - defer r.stateMu.RUnlock() + r.chainInfoLock.RLock() + defer r.chainInfoLock.RUnlock() return r.latestChainInfo, r.highestUserObservations } diff --git a/core/chains/evm/client/rpc_client_test.go b/core/chains/evm/client/rpc_client_test.go index 682c4352457..b594a0ca166 100644 --- a/core/chains/evm/client/rpc_client_test.go +++ b/core/chains/evm/client/rpc_client_test.go @@ -3,13 +3,17 @@ package client_test import ( "context" "encoding/json" + "errors" "fmt" "math/big" "net/url" + "sync" "testing" + "time" "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/rpc" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/tidwall/gjson" @@ -21,6 +25,7 @@ import ( commonclient "github.com/smartcontractkit/chainlink/v2/common/client" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/config/chaintype" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/testutils" evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" ) @@ -56,7 +61,7 @@ func TestRPCClient_SubscribeNewHead(t *testing.T) { server := testutils.NewWSServer(t, chainId, serverCallBack) wsURL := server.WSURL() - rpc := client.NewRPCClient(lggr, *wsURL, nil, "rpc", 1, chainId, commonclient.Primary) + rpc := client.NewRPCClient(lggr, *wsURL, nil, "rpc", 1, chainId, commonclient.Primary, 0, 0, commonclient.QueryTimeout, commonclient.QueryTimeout, "") defer rpc.Close() require.NoError(t, rpc.Dial(ctx)) // set to default values @@ -106,7 +111,7 @@ func TestRPCClient_SubscribeNewHead(t *testing.T) { server := testutils.NewWSServer(t, chainId, serverCallBack) wsURL := server.WSURL() - rpc := client.NewRPCClient(lggr, *wsURL, nil, "rpc", 1, chainId, commonclient.Primary) + rpc := client.NewRPCClient(lggr, *wsURL, nil, "rpc", 1, chainId, commonclient.Primary, 0, 0, commonclient.QueryTimeout, commonclient.QueryTimeout, "") defer rpc.Close() require.NoError(t, rpc.Dial(ctx)) ch := make(chan *evmtypes.Head) @@ -126,10 +131,36 @@ func TestRPCClient_SubscribeNewHead(t *testing.T) { assert.Equal(t, int64(0), highestUserObservations.FinalizedBlockNumber) assert.Equal(t, (*big.Int)(nil), highestUserObservations.TotalDifficulty) }) + t.Run("Concurrent Unsubscribe and onNewHead calls do not lead to a deadlock", func(t *testing.T) { + const numberOfAttempts = 1000 // need a large number to increase the odds of reproducing the issue + server := testutils.NewWSServer(t, chainId, serverCallBack) + wsURL := server.WSURL() + + rpc := client.NewRPCClient(lggr, *wsURL, nil, "rpc", 1, chainId, commonclient.Primary, 0, 0, commonclient.QueryTimeout, commonclient.QueryTimeout, "") + defer rpc.Close() + require.NoError(t, rpc.Dial(ctx)) + var wg sync.WaitGroup + for i := 0; i < numberOfAttempts; i++ { + ch := make(chan *evmtypes.Head) + sub, err := rpc.SubscribeNewHead(tests.Context(t), ch) + require.NoError(t, err) + wg.Add(2) + go func() { + server.MustWriteBinaryMessageSync(t, makeNewHeadWSMessage(&evmtypes.Head{Number: 256, TotalDifficulty: big.NewInt(1000)})) + wg.Done() + }() + go func() { + rpc.UnsubscribeAllExceptAliveLoop() + sub.Unsubscribe() + wg.Done() + }() + wg.Wait() + } + }) t.Run("Block's chain ID matched configured", func(t *testing.T) { server := testutils.NewWSServer(t, chainId, serverCallBack) wsURL := server.WSURL() - rpc := client.NewRPCClient(lggr, *wsURL, nil, "rpc", 1, chainId, commonclient.Primary) + rpc := client.NewRPCClient(lggr, *wsURL, nil, "rpc", 1, chainId, commonclient.Primary, 0, 0, commonclient.QueryTimeout, commonclient.QueryTimeout, "") defer rpc.Close() require.NoError(t, rpc.Dial(ctx)) ch := make(chan *evmtypes.Head) @@ -146,7 +177,7 @@ func TestRPCClient_SubscribeNewHead(t *testing.T) { }) wsURL := server.WSURL() observedLggr, observed := logger.TestObserved(t, zap.DebugLevel) - rpc := client.NewRPCClient(observedLggr, *wsURL, nil, "rpc", 1, chainId, commonclient.Primary) + rpc := client.NewRPCClient(observedLggr, *wsURL, nil, "rpc", 1, chainId, commonclient.Primary, 0, 0, commonclient.QueryTimeout, commonclient.QueryTimeout, "") require.NoError(t, rpc.Dial(ctx)) server.Close() _, err := rpc.SubscribeNewHead(ctx, make(chan *evmtypes.Head)) @@ -156,7 +187,7 @@ func TestRPCClient_SubscribeNewHead(t *testing.T) { t.Run("Subscription error is properly wrapper", func(t *testing.T) { server := testutils.NewWSServer(t, chainId, serverCallBack) wsURL := server.WSURL() - rpc := client.NewRPCClient(lggr, *wsURL, nil, "rpc", 1, chainId, commonclient.Primary) + rpc := client.NewRPCClient(lggr, *wsURL, nil, "rpc", 1, chainId, commonclient.Primary, 0, 0, commonclient.QueryTimeout, commonclient.QueryTimeout, "") defer rpc.Close() require.NoError(t, rpc.Dial(ctx)) sub, err := rpc.SubscribeNewHead(ctx, make(chan *evmtypes.Head)) @@ -184,7 +215,7 @@ func TestRPCClient_SubscribeFilterLogs(t *testing.T) { }) wsURL := server.WSURL() observedLggr, observed := logger.TestObserved(t, zap.DebugLevel) - rpc := client.NewRPCClient(observedLggr, *wsURL, nil, "rpc", 1, chainId, commonclient.Primary) + rpc := client.NewRPCClient(observedLggr, *wsURL, nil, "rpc", 1, chainId, commonclient.Primary, 0, 0, commonclient.QueryTimeout, commonclient.QueryTimeout, "") require.NoError(t, rpc.Dial(ctx)) server.Close() _, err := rpc.SubscribeFilterLogs(ctx, ethereum.FilterQuery{}, make(chan types.Log)) @@ -201,7 +232,7 @@ func TestRPCClient_SubscribeFilterLogs(t *testing.T) { return resp }) wsURL := server.WSURL() - rpc := client.NewRPCClient(lggr, *wsURL, nil, "rpc", 1, chainId, commonclient.Primary) + rpc := client.NewRPCClient(lggr, *wsURL, nil, "rpc", 1, chainId, commonclient.Primary, 0, 0, commonclient.QueryTimeout, commonclient.QueryTimeout, "") defer rpc.Close() require.NoError(t, rpc.Dial(ctx)) sub, err := rpc.SubscribeFilterLogs(ctx, ethereum.FilterQuery{}, make(chan types.Log)) @@ -250,7 +281,7 @@ func TestRPCClient_LatestFinalizedBlock(t *testing.T) { } server := createRPCServer() - rpc := client.NewRPCClient(lggr, *server.URL, nil, "rpc", 1, chainId, commonclient.Primary) + rpc := client.NewRPCClient(lggr, *server.URL, nil, "rpc", 1, chainId, commonclient.Primary, 0, 0, commonclient.QueryTimeout, commonclient.QueryTimeout, "") require.NoError(t, rpc.Dial(ctx)) defer rpc.Close() server.Head = &evmtypes.Head{Number: 128} @@ -298,3 +329,168 @@ func TestRPCClient_LatestFinalizedBlock(t *testing.T) { assert.Equal(t, int64(0), latest.BlockNumber) assert.Equal(t, int64(0), latest.FinalizedBlockNumber) } + +func TestRpcClientLargePayloadTimeout(t *testing.T) { + t.Parallel() + + testCases := []struct { + Name string + Fn func(ctx context.Context, rpc client.RPCClient) error + }{ + { + Name: "SendTransaction", + Fn: func(ctx context.Context, rpc client.RPCClient) error { + return rpc.SendTransaction(ctx, types.NewTx(&types.LegacyTx{})) + }, + }, + { + Name: "EstimateGas", + Fn: func(ctx context.Context, rpc client.RPCClient) error { + _, err := rpc.EstimateGas(ctx, ethereum.CallMsg{}) + return err + }, + }, + { + Name: "CallContract", + Fn: func(ctx context.Context, rpc client.RPCClient) error { + _, err := rpc.CallContract(ctx, ethereum.CallMsg{}, nil) + return err + }, + }, + { + Name: "CallContext", + Fn: func(ctx context.Context, rpc client.RPCClient) error { + err := rpc.CallContext(ctx, nil, "rpc_call", nil) + return err + }, + }, + { + Name: "BatchCallContext", + Fn: func(ctx context.Context, rpc client.RPCClient) error { + err := rpc.BatchCallContext(ctx, nil) + return err + }, + }, + } + for _, testCase := range testCases { + testCase := testCase + t.Run(testCase.Name, func(t *testing.T) { + t.Parallel() + // use background context to ensure that the DeadlineExceeded is caused by timeout we've set on request + // level, instead of one that was set on test level. + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + + chainId := big.NewInt(123456) + rpcURL := testutils.NewWSServer(t, chainId, func(method string, params gjson.Result) (resp testutils.JSONRPCResponse) { + // block until test is done + <-ctx.Done() + return + }).WSURL() + + // use something unreasonably large for RPC timeout to ensure that we use largePayloadRPCTimeout + const rpcTimeout = time.Hour + const largePayloadRPCTimeout = tests.TestInterval + rpc := client.NewRPCClient(logger.Test(t), *rpcURL, nil, "rpc", 1, chainId, commonclient.Primary, 0, 0, largePayloadRPCTimeout, rpcTimeout, "") + require.NoError(t, rpc.Dial(ctx)) + defer rpc.Close() + err := testCase.Fn(ctx, rpc) + assert.True(t, errors.Is(err, context.DeadlineExceeded), fmt.Sprintf("Expected DedlineExceeded error, but got: %v", err)) + }) + } +} + +func TestAstarCustomFinality(t *testing.T) { + t.Parallel() + + chainId := big.NewInt(123456) + // create new server that returns 4 block for Astar custom finality and 8 block for finality tag. + wsURL := testutils.NewWSServer(t, chainId, func(method string, params gjson.Result) (resp testutils.JSONRPCResponse) { + switch method { + case "chain_getFinalizedHead": + resp.Result = `"0xf14c499253fd7bbcba142e5dd77dad8b5ad598c1dc414a66bacdd8dae14a6759"` + case "chain_getHeader": + if assert.True(t, params.IsArray()) && assert.Equal(t, "0xf14c499253fd7bbcba142e5dd77dad8b5ad598c1dc414a66bacdd8dae14a6759", params.Array()[0].String()) { + resp.Result = `{"parentHash":"0x1311773bc6b4efc8f438ed1f094524b2a1233baf8a35396f641fcc42a378fc62","number":"0x4","stateRoot":"0x0e4920dc5516b587e1f74a0b65963134523a12cc11478bb314e52895758fbfa2","extrinsicsRoot":"0x5b02446dcab0659eb07d4a38f28f181c1b78a71b2aba207bb0ea1f0f3468e6bd","digest":{"logs":["0x066175726120ad678e0800000000","0x04525053529023158dc8e8fd0180bf26d88233a3d94eed2f4e43480395f0809f28791965e4d34e9b3905","0x0466726f6e88017441e97acf83f555e0deefef86db636bc8a37eb84747603412884e4df4d2280400","0x056175726101018a0a57edf70cc5474323114a47ee1e7f645b8beea5a1560a996416458e89f42bdf4955e24d32b5da54e1bf628aaa7ce4b8c0fa2b95c175a139d88786af12a88c"]}}` + } + case "eth_getBlockByNumber": + assert.True(t, params.IsArray()) + switch params.Array()[0].String() { + case "0x4": + resp.Result = `{"author":"0x5accb3bf9194a5f81b2087d4bd6ac47c62775d49","baseFeePerGas":"0xb576270823","difficulty":"0x0","extraData":"0x","gasLimit":"0xe4e1c0","gasUsed":"0x0","hash":"0x7441e97acf83f555e0deefef86db636bc8a37eb84747603412884e4df4d22804","logsBloom":"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","miner":"0x5accb3bf9194a5f81b2087d4bd6ac47c62775d49","nonce":"0x0000000000000000","number":"0x4","parentHash":"0x6ba069c318b692bf2cc0bd7ea070a9382a20c2f52413c10554b57c2e381bf2bb","receiptsRoot":"0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421","sha3Uncles":"0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347","size":"0x201","stateRoot":"0x17c46d359b9af773312c747f1d20032c67658d9a2923799f00533b73789cf49b","timestamp":"0x66acdc22","totalDifficulty":"0x0","transactions":[],"transactionsRoot":"0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421","uncles":[]}` + case "finalized": + resp.Result = `{"author":"0x1687736326c9fea17e25fc5287613693c912909c","baseFeePerGas":"0x3b9aca00","difficulty":"0x0","extraData":"0x","gasLimit":"0xe4e1c0","gasUsed":"0x0","hash":"0x62f03413681948b06882e7d9f91c4949bc39ded98d36336ab03faea038ec8e3d","logsBloom":"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","miner":"0x1687736326c9fea17e25fc5287613693c912909c","nonce":"0x0000000000000000","number":"0x8","parentHash":"0x43f504afdc639cbb8daf5fd5328a37762164b73f9c70ed54e1928c1fca6d8f23","receiptsRoot":"0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421","sha3Uncles":"0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347","size":"0x200","stateRoot":"0x0cb938d51ad83bdf401e3f5f7f989e60df64fdea620d394af41a3e72629f7495","timestamp":"0x61bd8d1a","totalDifficulty":"0x0","transactions":[],"transactionsRoot":"0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421","uncles":[]}` + default: + assert.Fail(t, fmt.Sprintf("unexpected eth_getBlockByNumber param: %v", params.Array())) + } + default: + assert.Fail(t, fmt.Sprintf("unexpected method: %s", method)) + } + return + }).WSURL() + + const expectedFinalizedBlockNumber = int64(4) + const expectedFinalizedBlockHash = "0x7441e97acf83f555e0deefef86db636bc8a37eb84747603412884e4df4d22804" + rpcClient := client.NewRPCClient(logger.Test(t), *wsURL, nil, "rpc", 1, chainId, commonclient.Primary, 0, 0, commonclient.QueryTimeout, commonclient.QueryTimeout, chaintype.ChainAstar) + defer rpcClient.Close() + err := rpcClient.Dial(tests.Context(t)) + require.NoError(t, err) + + testCases := []struct { + Name string + GetLatestFinalized func(ctx context.Context) (*evmtypes.Head, error) + }{ + { + Name: "Direct LatestFinalized call", + GetLatestFinalized: func(ctx context.Context) (*evmtypes.Head, error) { + return rpcClient.LatestFinalizedBlock(ctx) + }, + }, + { + Name: "BatchCallContext with Finalized tag as string", + GetLatestFinalized: func(ctx context.Context) (*evmtypes.Head, error) { + result := &evmtypes.Head{} + req := rpc.BatchElem{ + Method: "eth_getBlockByNumber", + Args: []interface{}{rpc.FinalizedBlockNumber.String(), false}, + Result: result, + } + err := rpcClient.BatchCallContext(ctx, []rpc.BatchElem{ + req, + }) + if err != nil { + return nil, err + } + + return result, req.Error + }, + }, + { + Name: "BatchCallContext with Finalized tag as BlockNumber", + GetLatestFinalized: func(ctx context.Context) (*evmtypes.Head, error) { + result := &evmtypes.Head{} + req := rpc.BatchElem{ + Method: "eth_getBlockByNumber", + Args: []interface{}{rpc.FinalizedBlockNumber, false}, + Result: result, + } + err := rpcClient.BatchCallContext(ctx, []rpc.BatchElem{req}) + if err != nil { + return nil, err + } + + return result, req.Error + }, + }, + } + + for _, testCase := range testCases { + t.Run(testCase.Name, func(t *testing.T) { + lf, err := testCase.GetLatestFinalized(tests.Context(t)) + require.NoError(t, err) + require.NotNil(t, lf) + assert.Equal(t, expectedFinalizedBlockHash, lf.Hash.String()) + assert.Equal(t, expectedFinalizedBlockNumber, lf.Number) + }) + } +} diff --git a/core/chains/evm/client/simulated_backend_client.go b/core/chains/evm/client/simulated_backend_client.go index 6bcc1f36960..11828e58710 100644 --- a/core/chains/evm/client/simulated_backend_client.go +++ b/core/chains/evm/client/simulated_backend_client.go @@ -156,6 +156,10 @@ func (c *SimulatedBackendClient) LINKBalance(ctx context.Context, address common panic("not implemented") } +func (c *SimulatedBackendClient) FeeHistory(ctx context.Context, blockCount uint64, rewardPercentiles []float64) (feeHistory *ethereum.FeeHistory, err error) { + panic("not implemented") +} + // TransactionReceipt returns the transaction receipt for the given transaction hash. func (c *SimulatedBackendClient) TransactionReceipt(ctx context.Context, receipt common.Hash) (*types.Receipt, error) { return c.b.TransactionReceipt(ctx, receipt) @@ -316,7 +320,15 @@ func (c *SimulatedBackendClient) SubscribeNewHead( case h := <-ch: var head *evmtypes.Head if h != nil { - head = &evmtypes.Head{Difficulty: h.Difficulty, Timestamp: time.Unix(int64(h.Time), 0), Number: h.Number.Int64(), Hash: h.Hash(), ParentHash: h.ParentHash, Parent: lastHead, EVMChainID: ubig.New(c.chainId)} + head = &evmtypes.Head{ + Difficulty: h.Difficulty, + Timestamp: time.Unix(int64(h.Time), 0), //nolint:gosec + Number: h.Number.Int64(), + Hash: h.Hash(), + ParentHash: h.ParentHash, + EVMChainID: ubig.New(c.chainId), + } + head.Parent.Store(lastHead) lastHead = head } select { @@ -360,9 +372,18 @@ func (c *SimulatedBackendClient) SendTransactionReturnCode(ctx context.Context, // SendTransaction sends a transaction. func (c *SimulatedBackendClient) SendTransaction(ctx context.Context, tx *types.Transaction) error { - sender, err := types.Sender(types.NewLondonSigner(c.chainId), tx) + var ( + sender common.Address + err error + ) + // try to recover the sender from the transaction using the configured chain id + // first. if that fails, try again with the simulated chain id (1337) + sender, err = types.Sender(types.NewLondonSigner(c.chainId), tx) if err != nil { - logger.Test(c.t).Panic(fmt.Errorf("invalid transaction: %v (tx: %#v)", err, tx)) + sender, err = types.Sender(types.NewLondonSigner(big.NewInt(1337)), tx) + if err != nil { + logger.Test(c.t).Panic(fmt.Errorf("invalid transaction: %v (tx: %#v)", err, tx)) + } } pendingNonce, err := c.b.PendingNonceAt(ctx, sender) if err != nil { @@ -406,7 +427,7 @@ func (c *SimulatedBackendClient) CallContract(ctx context.Context, msg ethereum. res, err := c.b.CallContract(ctx, msg, blockNumber) if err != nil { dataErr := revertError{} - if errors.Is(err, &dataErr) { + if errors.As(err, &dataErr) { return nil, &JsonError{Data: dataErr.ErrorData(), Message: dataErr.Error(), Code: 3} } // Generic revert, no data @@ -425,7 +446,7 @@ func (c *SimulatedBackendClient) PendingCallContract(ctx context.Context, msg et res, err := c.b.PendingCallContract(ctx, msg) if err != nil { dataErr := revertError{} - if errors.Is(err, &dataErr) { + if errors.As(err, &dataErr) { return nil, &JsonError{Data: dataErr.ErrorData(), Message: dataErr.Error(), Code: 3} } // Generic revert, no data diff --git a/core/chains/evm/config/chain_scoped.go b/core/chains/evm/config/chain_scoped.go index db598e3e82b..de89272b5e2 100644 --- a/core/chains/evm/config/chain_scoped.go +++ b/core/chains/evm/config/chain_scoped.go @@ -176,6 +176,10 @@ func (e *EVMConfig) OperatorFactoryAddress() string { return e.C.OperatorFactoryAddress.String() } +func (e *EVMConfig) LogBroadcasterEnabled() bool { + return e.C.LogBroadcasterEnabled == nil || *e.C.LogBroadcasterEnabled +} + func (e *EVMConfig) LogPrunePageSize() uint32 { return *e.C.LogPrunePageSize } @@ -183,3 +187,7 @@ func (e *EVMConfig) LogPrunePageSize() uint32 { func (e *EVMConfig) FinalizedBlockOffset() uint32 { return *e.C.FinalizedBlockOffset } + +func (e *EVMConfig) NoNewFinalizedHeadsThreshold() time.Duration { + return e.C.NoNewFinalizedHeadsThreshold.Duration() +} diff --git a/core/chains/evm/config/chain_scoped_client_errors.go b/core/chains/evm/config/chain_scoped_client_errors.go index 53bb04846d2..f9d2096e903 100644 --- a/core/chains/evm/config/chain_scoped_client_errors.go +++ b/core/chains/evm/config/chain_scoped_client_errors.go @@ -48,3 +48,4 @@ func (c *clientErrorsConfig) Fatal() string { return derefOrDefault(c.c.Fatal) } func (c *clientErrorsConfig) ServiceUnavailable() string { return derefOrDefault(c.c.ServiceUnavailable) } +func (c *clientErrorsConfig) TooManyResults() string { return derefOrDefault(c.c.TooManyResults) } diff --git a/core/chains/evm/config/chain_scoped_gas_estimator.go b/core/chains/evm/config/chain_scoped_gas_estimator.go index 689d5e38b81..54c7c360639 100644 --- a/core/chains/evm/config/chain_scoped_gas_estimator.go +++ b/core/chains/evm/config/chain_scoped_gas_estimator.go @@ -1,6 +1,8 @@ package config import ( + "time" + gethcommon "github.com/ethereum/go-ethereum/common" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" @@ -36,6 +38,10 @@ func (g *gasEstimatorConfig) BlockHistory() BlockHistory { return &blockHistoryConfig{c: g.c.BlockHistory, blockDelay: g.blockDelay, bumpThreshold: g.c.BumpThreshold} } +func (g *gasEstimatorConfig) FeeHistory() FeeHistory { + return &feeHistoryConfig{c: g.c.FeeHistory} +} + func (g *gasEstimatorConfig) EIP1559DynamicFees() bool { return *g.c.EIP1559DynamicFees } @@ -108,6 +114,10 @@ func (g *gasEstimatorConfig) LimitJobType() LimitJobType { return &limitJobTypeConfig{c: g.c.LimitJobType} } +func (g *gasEstimatorConfig) EstimateLimit() bool { + return *g.c.EstimateLimit +} + type limitJobTypeConfig struct { c toml.GasLimitJobType } @@ -172,3 +182,11 @@ func (b *blockHistoryConfig) TransactionPercentile() uint16 { func (b *blockHistoryConfig) BlockDelay() uint16 { return *b.blockDelay } + +type feeHistoryConfig struct { + c toml.FeeHistoryEstimator +} + +func (u *feeHistoryConfig) CacheTimeout() time.Duration { + return u.c.CacheTimeout.Duration() +} diff --git a/core/chains/evm/config/chain_scoped_head_tracker.go b/core/chains/evm/config/chain_scoped_head_tracker.go index 8bc1ff188a7..75a630238ec 100644 --- a/core/chains/evm/config/chain_scoped_head_tracker.go +++ b/core/chains/evm/config/chain_scoped_head_tracker.go @@ -29,3 +29,7 @@ func (h *headTrackerConfig) FinalityTagBypass() bool { func (h *headTrackerConfig) MaxAllowedFinalityDepth() uint32 { return *h.c.MaxAllowedFinalityDepth } + +func (h *headTrackerConfig) PersistenceEnabled() bool { + return *h.c.PersistenceEnabled +} diff --git a/core/chains/evm/config/chain_scoped_node_pool.go b/core/chains/evm/config/chain_scoped_node_pool.go index a4974366486..4b1d02d148e 100644 --- a/core/chains/evm/config/chain_scoped_node_pool.go +++ b/core/chains/evm/config/chain_scoped_node_pool.go @@ -38,6 +38,10 @@ func (n *NodePoolConfig) FinalizedBlockPollInterval() time.Duration { return n.C.FinalizedBlockPollInterval.Duration() } +func (n *NodePoolConfig) NewHeadsPollInterval() time.Duration { + return n.C.NewHeadsPollInterval.Duration() +} + func (n *NodePoolConfig) Errors() ClientErrors { return &clientErrorsConfig{c: n.C.Errors} } func (n *NodePoolConfig) EnforceRepeatableRead() bool { diff --git a/core/chains/evm/config/chain_scoped_transactions.go b/core/chains/evm/config/chain_scoped_transactions.go index 87031a4c66e..27edb12648a 100644 --- a/core/chains/evm/config/chain_scoped_transactions.go +++ b/core/chains/evm/config/chain_scoped_transactions.go @@ -47,12 +47,12 @@ func (a *autoPurgeConfig) Enabled() bool { return *a.c.Enabled } -func (a *autoPurgeConfig) Threshold() uint32 { - return *a.c.Threshold +func (a *autoPurgeConfig) Threshold() *uint32 { + return a.c.Threshold } -func (a *autoPurgeConfig) MinAttempts() uint32 { - return *a.c.MinAttempts +func (a *autoPurgeConfig) MinAttempts() *uint32 { + return a.c.MinAttempts } func (a *autoPurgeConfig) DetectionApiUrl() *url.URL { diff --git a/core/chains/evm/config/chain_scoped_workflow.go b/core/chains/evm/config/chain_scoped_workflow.go index 36dcb3ea41c..816270886a4 100644 --- a/core/chains/evm/config/chain_scoped_workflow.go +++ b/core/chains/evm/config/chain_scoped_workflow.go @@ -16,3 +16,7 @@ func (b *workflowConfig) FromAddress() *types.EIP55Address { func (b *workflowConfig) ForwarderAddress() *types.EIP55Address { return b.c.ForwarderAddress } + +func (b *workflowConfig) GasLimitDefault() *uint64 { + return b.c.GasLimitDefault +} diff --git a/core/chains/evm/config/chaintype/chaintype.go b/core/chains/evm/config/chaintype/chaintype.go index 9b845969e4b..f6b84e46555 100644 --- a/core/chains/evm/config/chaintype/chaintype.go +++ b/core/chains/evm/config/chaintype/chaintype.go @@ -9,9 +9,12 @@ type ChainType string const ( ChainArbitrum ChainType = "arbitrum" + ChainAstar ChainType = "astar" ChainCelo ChainType = "celo" ChainGnosis ChainType = "gnosis" + ChainHedera ChainType = "hedera" ChainKroma ChainType = "kroma" + ChainMantle ChainType = "mantle" ChainMetis ChainType = "metis" ChainOptimismBedrock ChainType = "optimismBedrock" ChainScroll ChainType = "scroll" @@ -35,22 +38,28 @@ func (c ChainType) IsL2() bool { func (c ChainType) IsValid() bool { switch c { - case "", ChainArbitrum, ChainCelo, ChainGnosis, ChainKroma, ChainMetis, ChainOptimismBedrock, ChainScroll, ChainWeMix, ChainXLayer, ChainZkEvm, ChainZkSync: + case "", ChainArbitrum, ChainAstar, ChainCelo, ChainGnosis, ChainHedera, ChainKroma, ChainMantle, ChainMetis, ChainOptimismBedrock, ChainScroll, ChainWeMix, ChainXLayer, ChainZkEvm, ChainZkSync: return true } return false } -func ChainTypeFromSlug(slug string) ChainType { +func FromSlug(slug string) ChainType { switch slug { case "arbitrum": return ChainArbitrum + case "astar": + return ChainAstar case "celo": return ChainCelo case "gnosis": return ChainGnosis + case "hedera": + return ChainHedera case "kroma": return ChainKroma + case "mantle": + return ChainMantle case "metis": return ChainMetis case "optimismBedrock": @@ -70,57 +79,60 @@ func ChainTypeFromSlug(slug string) ChainType { } } -type ChainTypeConfig struct { +type Config struct { value ChainType slug string } -func NewChainTypeConfig(slug string) *ChainTypeConfig { - return &ChainTypeConfig{ - value: ChainTypeFromSlug(slug), +func NewConfig(slug string) *Config { + return &Config{ + value: FromSlug(slug), slug: slug, } } -func (c *ChainTypeConfig) MarshalText() ([]byte, error) { +func (c *Config) MarshalText() ([]byte, error) { if c == nil { return nil, nil } return []byte(c.slug), nil } -func (c *ChainTypeConfig) UnmarshalText(b []byte) error { +func (c *Config) UnmarshalText(b []byte) error { c.slug = string(b) - c.value = ChainTypeFromSlug(c.slug) + c.value = FromSlug(c.slug) return nil } -func (c *ChainTypeConfig) Slug() string { +func (c *Config) Slug() string { if c == nil { return "" } return c.slug } -func (c *ChainTypeConfig) ChainType() ChainType { +func (c *Config) ChainType() ChainType { if c == nil { return "" } return c.value } -func (c *ChainTypeConfig) String() string { +func (c *Config) String() string { if c == nil { return "" } return string(c.value) } -var ErrInvalidChainType = fmt.Errorf("must be one of %s or omitted", strings.Join([]string{ +var ErrInvalid = fmt.Errorf("must be one of %s or omitted", strings.Join([]string{ string(ChainArbitrum), + string(ChainAstar), string(ChainCelo), string(ChainGnosis), + string(ChainHedera), string(ChainKroma), + string(ChainMantle), string(ChainMetis), string(ChainOptimismBedrock), string(ChainScroll), diff --git a/core/chains/evm/config/config.go b/core/chains/evm/config/config.go index ffb2a496baf..c886f9fb616 100644 --- a/core/chains/evm/config/config.go +++ b/core/chains/evm/config/config.go @@ -43,9 +43,11 @@ type EVM interface { MinIncomingConfirmations() uint32 NonceAutoSync() bool OperatorFactoryAddress() string + LogBroadcasterEnabled() bool RPCDefaultBatchSize() uint32 NodeNoNewHeadsThreshold() time.Duration FinalizedBlockOffset() uint32 + NoNewFinalizedHeadsThreshold() time.Duration IsEnabled() bool TOMLString() (string, error) @@ -74,6 +76,7 @@ type HeadTracker interface { SamplingInterval() time.Duration FinalityTagBypass() bool MaxAllowedFinalityDepth() uint32 + PersistenceEnabled() bool } type BalanceMonitor interface { @@ -95,6 +98,7 @@ type ClientErrors interface { TransactionAlreadyMined() string Fatal() string ServiceUnavailable() string + TooManyResults() string } type Transactions interface { @@ -109,14 +113,14 @@ type Transactions interface { type AutoPurgeConfig interface { Enabled() bool - Threshold() uint32 - MinAttempts() uint32 + Threshold() *uint32 + MinAttempts() *uint32 DetectionApiUrl() *url.URL } -//go:generate mockery --quiet --name GasEstimator --output ./mocks/ --case=underscore type GasEstimator interface { BlockHistory() BlockHistory + FeeHistory() FeeHistory LimitJobType() LimitJobType EIP1559DynamicFees() bool @@ -136,6 +140,7 @@ type GasEstimator interface { PriceMin() *assets.Wei Mode() string PriceMaxKey(gethcommon.Address) *assets.Wei + EstimateLimit() bool } type LimitJobType interface { @@ -157,9 +162,14 @@ type BlockHistory interface { TransactionPercentile() uint16 } +type FeeHistory interface { + CacheTimeout() time.Duration +} + type Workflow interface { FromAddress() *types.EIP55Address ForwarderAddress() *types.EIP55Address + GasLimitDefault() *uint64 } type NodePool interface { @@ -173,11 +183,10 @@ type NodePool interface { Errors() ClientErrors EnforceRepeatableRead() bool DeathDeclarationDelay() time.Duration + NewHeadsPollInterval() time.Duration } // TODO BCF-2509 does the chainscopedconfig really need the entire app config? -// -//go:generate mockery --quiet --name ChainScopedConfig --output ./mocks/ --case=underscore type ChainScopedConfig interface { EVM() EVM } diff --git a/core/chains/evm/config/config_test.go b/core/chains/evm/config/config_test.go index ba362bda981..53155d7e7d2 100644 --- a/core/chains/evm/config/config_test.go +++ b/core/chains/evm/config/config_test.go @@ -205,6 +205,25 @@ func TestChainScopedConfig(t *testing.T) { assert.Equal(t, val.String(), cfg3.EVM().OperatorFactoryAddress()) }) }) + + t.Run("LogBroadcasterEnabled", func(t *testing.T) { + t.Run("turn on LogBroadcasterEnabled by default", func(t *testing.T) { + assert.Equal(t, true, cfg.EVM().LogBroadcasterEnabled()) + }) + + t.Run("verify LogBroadcasterEnabled is set correctly", func(t *testing.T) { + val := false + cfg3 := testutils.NewTestChainScopedConfig(t, func(c *toml.EVMConfig) { + c.LogBroadcasterEnabled = ptr(val) + }) + + assert.Equal(t, false, cfg3.EVM().LogBroadcasterEnabled()) + }) + + t.Run("use Noop logBroadcaster when LogBroadcaster is disabled", func(t *testing.T) { + + }) + }) } func TestChainScopedConfig_BlockHistory(t *testing.T) { @@ -220,6 +239,13 @@ func TestChainScopedConfig_BlockHistory(t *testing.T) { assert.Equal(t, uint16(1), bh.BlockDelay()) assert.Equal(t, uint16(4), bh.EIP1559FeeCapBufferBlocks()) } +func TestChainScopedConfig_FeeHistory(t *testing.T) { + t.Parallel() + cfg := testutils.NewTestChainScopedConfig(t, nil) + + u := cfg.EVM().GasEstimator().FeeHistory() + assert.Equal(t, 10*time.Second, u.CacheTimeout()) +} func TestChainScopedConfig_GasEstimator(t *testing.T) { t.Parallel() @@ -243,6 +269,7 @@ func TestChainScopedConfig_GasEstimator(t *testing.T) { assert.Equal(t, assets.GWei(100), ge.FeeCapDefault()) assert.Equal(t, assets.NewWeiI(1), ge.TipCapDefault()) assert.Equal(t, assets.NewWeiI(1), ge.TipCapMin()) + assert.Equal(t, false, ge.EstimateLimit()) } func TestChainScopedConfig_BSCDefaults(t *testing.T) { @@ -316,6 +343,7 @@ func TestChainScopedConfig_HeadTracker(t *testing.T) { assert.Equal(t, time.Second, ht.SamplingInterval()) assert.Equal(t, true, ht.FinalityTagBypass()) assert.Equal(t, uint32(10000), ht.MaxAllowedFinalityDepth()) + assert.Equal(t, true, ht.PersistenceEnabled()) } func TestNodePoolConfig(t *testing.T) { @@ -353,6 +381,7 @@ func TestClientErrorsConfig(t *testing.T) { TransactionAlreadyMined: ptr("client error transaction already mined"), Fatal: ptr("client error fatal"), ServiceUnavailable: ptr("client error service unavailable"), + TooManyResults: ptr("client error too many results"), }, } }) @@ -372,6 +401,7 @@ func TestClientErrorsConfig(t *testing.T) { assert.Equal(t, "client error transaction already mined", errors.TransactionAlreadyMined()) assert.Equal(t, "client error fatal", errors.Fatal()) assert.Equal(t, "client error service unavailable", errors.ServiceUnavailable()) + assert.Equal(t, "client error too many results", errors.TooManyResults()) }) } diff --git a/core/chains/evm/config/mocks/chain_scoped_config.go b/core/chains/evm/config/mocks/chain_scoped_config.go index 730c6c61c4e..da6101c44a5 100644 --- a/core/chains/evm/config/mocks/chain_scoped_config.go +++ b/core/chains/evm/config/mocks/chain_scoped_config.go @@ -12,6 +12,14 @@ type ChainScopedConfig struct { mock.Mock } +type ChainScopedConfig_Expecter struct { + mock *mock.Mock +} + +func (_m *ChainScopedConfig) EXPECT() *ChainScopedConfig_Expecter { + return &ChainScopedConfig_Expecter{mock: &_m.Mock} +} + // EVM provides a mock function with given fields: func (_m *ChainScopedConfig) EVM() config.EVM { ret := _m.Called() @@ -32,6 +40,33 @@ func (_m *ChainScopedConfig) EVM() config.EVM { return r0 } +// ChainScopedConfig_EVM_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EVM' +type ChainScopedConfig_EVM_Call struct { + *mock.Call +} + +// EVM is a helper method to define mock.On call +func (_e *ChainScopedConfig_Expecter) EVM() *ChainScopedConfig_EVM_Call { + return &ChainScopedConfig_EVM_Call{Call: _e.mock.On("EVM")} +} + +func (_c *ChainScopedConfig_EVM_Call) Run(run func()) *ChainScopedConfig_EVM_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ChainScopedConfig_EVM_Call) Return(_a0 config.EVM) *ChainScopedConfig_EVM_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ChainScopedConfig_EVM_Call) RunAndReturn(run func() config.EVM) *ChainScopedConfig_EVM_Call { + _c.Call.Return(run) + return _c +} + // NewChainScopedConfig creates a new instance of ChainScopedConfig. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewChainScopedConfig(t interface { diff --git a/core/chains/evm/config/mocks/gas_estimator.go b/core/chains/evm/config/mocks/gas_estimator.go index 9ad7420977d..70b9c18d0bf 100644 --- a/core/chains/evm/config/mocks/gas_estimator.go +++ b/core/chains/evm/config/mocks/gas_estimator.go @@ -16,6 +16,14 @@ type GasEstimator struct { mock.Mock } +type GasEstimator_Expecter struct { + mock *mock.Mock +} + +func (_m *GasEstimator) EXPECT() *GasEstimator_Expecter { + return &GasEstimator_Expecter{mock: &_m.Mock} +} + // BlockHistory provides a mock function with given fields: func (_m *GasEstimator) BlockHistory() config.BlockHistory { ret := _m.Called() @@ -36,6 +44,33 @@ func (_m *GasEstimator) BlockHistory() config.BlockHistory { return r0 } +// GasEstimator_BlockHistory_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BlockHistory' +type GasEstimator_BlockHistory_Call struct { + *mock.Call +} + +// BlockHistory is a helper method to define mock.On call +func (_e *GasEstimator_Expecter) BlockHistory() *GasEstimator_BlockHistory_Call { + return &GasEstimator_BlockHistory_Call{Call: _e.mock.On("BlockHistory")} +} + +func (_c *GasEstimator_BlockHistory_Call) Run(run func()) *GasEstimator_BlockHistory_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *GasEstimator_BlockHistory_Call) Return(_a0 config.BlockHistory) *GasEstimator_BlockHistory_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *GasEstimator_BlockHistory_Call) RunAndReturn(run func() config.BlockHistory) *GasEstimator_BlockHistory_Call { + _c.Call.Return(run) + return _c +} + // BumpMin provides a mock function with given fields: func (_m *GasEstimator) BumpMin() *assets.Wei { ret := _m.Called() @@ -56,6 +91,33 @@ func (_m *GasEstimator) BumpMin() *assets.Wei { return r0 } +// GasEstimator_BumpMin_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BumpMin' +type GasEstimator_BumpMin_Call struct { + *mock.Call +} + +// BumpMin is a helper method to define mock.On call +func (_e *GasEstimator_Expecter) BumpMin() *GasEstimator_BumpMin_Call { + return &GasEstimator_BumpMin_Call{Call: _e.mock.On("BumpMin")} +} + +func (_c *GasEstimator_BumpMin_Call) Run(run func()) *GasEstimator_BumpMin_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *GasEstimator_BumpMin_Call) Return(_a0 *assets.Wei) *GasEstimator_BumpMin_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *GasEstimator_BumpMin_Call) RunAndReturn(run func() *assets.Wei) *GasEstimator_BumpMin_Call { + _c.Call.Return(run) + return _c +} + // BumpPercent provides a mock function with given fields: func (_m *GasEstimator) BumpPercent() uint16 { ret := _m.Called() @@ -74,6 +136,33 @@ func (_m *GasEstimator) BumpPercent() uint16 { return r0 } +// GasEstimator_BumpPercent_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BumpPercent' +type GasEstimator_BumpPercent_Call struct { + *mock.Call +} + +// BumpPercent is a helper method to define mock.On call +func (_e *GasEstimator_Expecter) BumpPercent() *GasEstimator_BumpPercent_Call { + return &GasEstimator_BumpPercent_Call{Call: _e.mock.On("BumpPercent")} +} + +func (_c *GasEstimator_BumpPercent_Call) Run(run func()) *GasEstimator_BumpPercent_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *GasEstimator_BumpPercent_Call) Return(_a0 uint16) *GasEstimator_BumpPercent_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *GasEstimator_BumpPercent_Call) RunAndReturn(run func() uint16) *GasEstimator_BumpPercent_Call { + _c.Call.Return(run) + return _c +} + // BumpThreshold provides a mock function with given fields: func (_m *GasEstimator) BumpThreshold() uint64 { ret := _m.Called() @@ -92,6 +181,33 @@ func (_m *GasEstimator) BumpThreshold() uint64 { return r0 } +// GasEstimator_BumpThreshold_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BumpThreshold' +type GasEstimator_BumpThreshold_Call struct { + *mock.Call +} + +// BumpThreshold is a helper method to define mock.On call +func (_e *GasEstimator_Expecter) BumpThreshold() *GasEstimator_BumpThreshold_Call { + return &GasEstimator_BumpThreshold_Call{Call: _e.mock.On("BumpThreshold")} +} + +func (_c *GasEstimator_BumpThreshold_Call) Run(run func()) *GasEstimator_BumpThreshold_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *GasEstimator_BumpThreshold_Call) Return(_a0 uint64) *GasEstimator_BumpThreshold_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *GasEstimator_BumpThreshold_Call) RunAndReturn(run func() uint64) *GasEstimator_BumpThreshold_Call { + _c.Call.Return(run) + return _c +} + // BumpTxDepth provides a mock function with given fields: func (_m *GasEstimator) BumpTxDepth() uint32 { ret := _m.Called() @@ -110,6 +226,33 @@ func (_m *GasEstimator) BumpTxDepth() uint32 { return r0 } +// GasEstimator_BumpTxDepth_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BumpTxDepth' +type GasEstimator_BumpTxDepth_Call struct { + *mock.Call +} + +// BumpTxDepth is a helper method to define mock.On call +func (_e *GasEstimator_Expecter) BumpTxDepth() *GasEstimator_BumpTxDepth_Call { + return &GasEstimator_BumpTxDepth_Call{Call: _e.mock.On("BumpTxDepth")} +} + +func (_c *GasEstimator_BumpTxDepth_Call) Run(run func()) *GasEstimator_BumpTxDepth_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *GasEstimator_BumpTxDepth_Call) Return(_a0 uint32) *GasEstimator_BumpTxDepth_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *GasEstimator_BumpTxDepth_Call) RunAndReturn(run func() uint32) *GasEstimator_BumpTxDepth_Call { + _c.Call.Return(run) + return _c +} + // EIP1559DynamicFees provides a mock function with given fields: func (_m *GasEstimator) EIP1559DynamicFees() bool { ret := _m.Called() @@ -128,6 +271,78 @@ func (_m *GasEstimator) EIP1559DynamicFees() bool { return r0 } +// GasEstimator_EIP1559DynamicFees_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EIP1559DynamicFees' +type GasEstimator_EIP1559DynamicFees_Call struct { + *mock.Call +} + +// EIP1559DynamicFees is a helper method to define mock.On call +func (_e *GasEstimator_Expecter) EIP1559DynamicFees() *GasEstimator_EIP1559DynamicFees_Call { + return &GasEstimator_EIP1559DynamicFees_Call{Call: _e.mock.On("EIP1559DynamicFees")} +} + +func (_c *GasEstimator_EIP1559DynamicFees_Call) Run(run func()) *GasEstimator_EIP1559DynamicFees_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *GasEstimator_EIP1559DynamicFees_Call) Return(_a0 bool) *GasEstimator_EIP1559DynamicFees_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *GasEstimator_EIP1559DynamicFees_Call) RunAndReturn(run func() bool) *GasEstimator_EIP1559DynamicFees_Call { + _c.Call.Return(run) + return _c +} + +// EstimateLimit provides a mock function with given fields: +func (_m *GasEstimator) EstimateLimit() bool { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for EstimateLimit") + } + + var r0 bool + if rf, ok := ret.Get(0).(func() bool); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(bool) + } + + return r0 +} + +// GasEstimator_EstimateLimit_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EstimateLimit' +type GasEstimator_EstimateLimit_Call struct { + *mock.Call +} + +// EstimateLimit is a helper method to define mock.On call +func (_e *GasEstimator_Expecter) EstimateLimit() *GasEstimator_EstimateLimit_Call { + return &GasEstimator_EstimateLimit_Call{Call: _e.mock.On("EstimateLimit")} +} + +func (_c *GasEstimator_EstimateLimit_Call) Run(run func()) *GasEstimator_EstimateLimit_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *GasEstimator_EstimateLimit_Call) Return(_a0 bool) *GasEstimator_EstimateLimit_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *GasEstimator_EstimateLimit_Call) RunAndReturn(run func() bool) *GasEstimator_EstimateLimit_Call { + _c.Call.Return(run) + return _c +} + // FeeCapDefault provides a mock function with given fields: func (_m *GasEstimator) FeeCapDefault() *assets.Wei { ret := _m.Called() @@ -148,6 +363,80 @@ func (_m *GasEstimator) FeeCapDefault() *assets.Wei { return r0 } +// GasEstimator_FeeCapDefault_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FeeCapDefault' +type GasEstimator_FeeCapDefault_Call struct { + *mock.Call +} + +// FeeCapDefault is a helper method to define mock.On call +func (_e *GasEstimator_Expecter) FeeCapDefault() *GasEstimator_FeeCapDefault_Call { + return &GasEstimator_FeeCapDefault_Call{Call: _e.mock.On("FeeCapDefault")} +} + +func (_c *GasEstimator_FeeCapDefault_Call) Run(run func()) *GasEstimator_FeeCapDefault_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *GasEstimator_FeeCapDefault_Call) Return(_a0 *assets.Wei) *GasEstimator_FeeCapDefault_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *GasEstimator_FeeCapDefault_Call) RunAndReturn(run func() *assets.Wei) *GasEstimator_FeeCapDefault_Call { + _c.Call.Return(run) + return _c +} + +// FeeHistory provides a mock function with given fields: +func (_m *GasEstimator) FeeHistory() config.FeeHistory { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for FeeHistory") + } + + var r0 config.FeeHistory + if rf, ok := ret.Get(0).(func() config.FeeHistory); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(config.FeeHistory) + } + } + + return r0 +} + +// GasEstimator_FeeHistory_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FeeHistory' +type GasEstimator_FeeHistory_Call struct { + *mock.Call +} + +// FeeHistory is a helper method to define mock.On call +func (_e *GasEstimator_Expecter) FeeHistory() *GasEstimator_FeeHistory_Call { + return &GasEstimator_FeeHistory_Call{Call: _e.mock.On("FeeHistory")} +} + +func (_c *GasEstimator_FeeHistory_Call) Run(run func()) *GasEstimator_FeeHistory_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *GasEstimator_FeeHistory_Call) Return(_a0 config.FeeHistory) *GasEstimator_FeeHistory_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *GasEstimator_FeeHistory_Call) RunAndReturn(run func() config.FeeHistory) *GasEstimator_FeeHistory_Call { + _c.Call.Return(run) + return _c +} + // LimitDefault provides a mock function with given fields: func (_m *GasEstimator) LimitDefault() uint64 { ret := _m.Called() @@ -166,6 +455,33 @@ func (_m *GasEstimator) LimitDefault() uint64 { return r0 } +// GasEstimator_LimitDefault_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LimitDefault' +type GasEstimator_LimitDefault_Call struct { + *mock.Call +} + +// LimitDefault is a helper method to define mock.On call +func (_e *GasEstimator_Expecter) LimitDefault() *GasEstimator_LimitDefault_Call { + return &GasEstimator_LimitDefault_Call{Call: _e.mock.On("LimitDefault")} +} + +func (_c *GasEstimator_LimitDefault_Call) Run(run func()) *GasEstimator_LimitDefault_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *GasEstimator_LimitDefault_Call) Return(_a0 uint64) *GasEstimator_LimitDefault_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *GasEstimator_LimitDefault_Call) RunAndReturn(run func() uint64) *GasEstimator_LimitDefault_Call { + _c.Call.Return(run) + return _c +} + // LimitJobType provides a mock function with given fields: func (_m *GasEstimator) LimitJobType() config.LimitJobType { ret := _m.Called() @@ -186,6 +502,33 @@ func (_m *GasEstimator) LimitJobType() config.LimitJobType { return r0 } +// GasEstimator_LimitJobType_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LimitJobType' +type GasEstimator_LimitJobType_Call struct { + *mock.Call +} + +// LimitJobType is a helper method to define mock.On call +func (_e *GasEstimator_Expecter) LimitJobType() *GasEstimator_LimitJobType_Call { + return &GasEstimator_LimitJobType_Call{Call: _e.mock.On("LimitJobType")} +} + +func (_c *GasEstimator_LimitJobType_Call) Run(run func()) *GasEstimator_LimitJobType_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *GasEstimator_LimitJobType_Call) Return(_a0 config.LimitJobType) *GasEstimator_LimitJobType_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *GasEstimator_LimitJobType_Call) RunAndReturn(run func() config.LimitJobType) *GasEstimator_LimitJobType_Call { + _c.Call.Return(run) + return _c +} + // LimitMax provides a mock function with given fields: func (_m *GasEstimator) LimitMax() uint64 { ret := _m.Called() @@ -204,6 +547,33 @@ func (_m *GasEstimator) LimitMax() uint64 { return r0 } +// GasEstimator_LimitMax_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LimitMax' +type GasEstimator_LimitMax_Call struct { + *mock.Call +} + +// LimitMax is a helper method to define mock.On call +func (_e *GasEstimator_Expecter) LimitMax() *GasEstimator_LimitMax_Call { + return &GasEstimator_LimitMax_Call{Call: _e.mock.On("LimitMax")} +} + +func (_c *GasEstimator_LimitMax_Call) Run(run func()) *GasEstimator_LimitMax_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *GasEstimator_LimitMax_Call) Return(_a0 uint64) *GasEstimator_LimitMax_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *GasEstimator_LimitMax_Call) RunAndReturn(run func() uint64) *GasEstimator_LimitMax_Call { + _c.Call.Return(run) + return _c +} + // LimitMultiplier provides a mock function with given fields: func (_m *GasEstimator) LimitMultiplier() float32 { ret := _m.Called() @@ -222,6 +592,33 @@ func (_m *GasEstimator) LimitMultiplier() float32 { return r0 } +// GasEstimator_LimitMultiplier_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LimitMultiplier' +type GasEstimator_LimitMultiplier_Call struct { + *mock.Call +} + +// LimitMultiplier is a helper method to define mock.On call +func (_e *GasEstimator_Expecter) LimitMultiplier() *GasEstimator_LimitMultiplier_Call { + return &GasEstimator_LimitMultiplier_Call{Call: _e.mock.On("LimitMultiplier")} +} + +func (_c *GasEstimator_LimitMultiplier_Call) Run(run func()) *GasEstimator_LimitMultiplier_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *GasEstimator_LimitMultiplier_Call) Return(_a0 float32) *GasEstimator_LimitMultiplier_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *GasEstimator_LimitMultiplier_Call) RunAndReturn(run func() float32) *GasEstimator_LimitMultiplier_Call { + _c.Call.Return(run) + return _c +} + // LimitTransfer provides a mock function with given fields: func (_m *GasEstimator) LimitTransfer() uint64 { ret := _m.Called() @@ -240,6 +637,33 @@ func (_m *GasEstimator) LimitTransfer() uint64 { return r0 } +// GasEstimator_LimitTransfer_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LimitTransfer' +type GasEstimator_LimitTransfer_Call struct { + *mock.Call +} + +// LimitTransfer is a helper method to define mock.On call +func (_e *GasEstimator_Expecter) LimitTransfer() *GasEstimator_LimitTransfer_Call { + return &GasEstimator_LimitTransfer_Call{Call: _e.mock.On("LimitTransfer")} +} + +func (_c *GasEstimator_LimitTransfer_Call) Run(run func()) *GasEstimator_LimitTransfer_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *GasEstimator_LimitTransfer_Call) Return(_a0 uint64) *GasEstimator_LimitTransfer_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *GasEstimator_LimitTransfer_Call) RunAndReturn(run func() uint64) *GasEstimator_LimitTransfer_Call { + _c.Call.Return(run) + return _c +} + // Mode provides a mock function with given fields: func (_m *GasEstimator) Mode() string { ret := _m.Called() @@ -258,6 +682,33 @@ func (_m *GasEstimator) Mode() string { return r0 } +// GasEstimator_Mode_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Mode' +type GasEstimator_Mode_Call struct { + *mock.Call +} + +// Mode is a helper method to define mock.On call +func (_e *GasEstimator_Expecter) Mode() *GasEstimator_Mode_Call { + return &GasEstimator_Mode_Call{Call: _e.mock.On("Mode")} +} + +func (_c *GasEstimator_Mode_Call) Run(run func()) *GasEstimator_Mode_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *GasEstimator_Mode_Call) Return(_a0 string) *GasEstimator_Mode_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *GasEstimator_Mode_Call) RunAndReturn(run func() string) *GasEstimator_Mode_Call { + _c.Call.Return(run) + return _c +} + // PriceDefault provides a mock function with given fields: func (_m *GasEstimator) PriceDefault() *assets.Wei { ret := _m.Called() @@ -278,6 +729,33 @@ func (_m *GasEstimator) PriceDefault() *assets.Wei { return r0 } +// GasEstimator_PriceDefault_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PriceDefault' +type GasEstimator_PriceDefault_Call struct { + *mock.Call +} + +// PriceDefault is a helper method to define mock.On call +func (_e *GasEstimator_Expecter) PriceDefault() *GasEstimator_PriceDefault_Call { + return &GasEstimator_PriceDefault_Call{Call: _e.mock.On("PriceDefault")} +} + +func (_c *GasEstimator_PriceDefault_Call) Run(run func()) *GasEstimator_PriceDefault_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *GasEstimator_PriceDefault_Call) Return(_a0 *assets.Wei) *GasEstimator_PriceDefault_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *GasEstimator_PriceDefault_Call) RunAndReturn(run func() *assets.Wei) *GasEstimator_PriceDefault_Call { + _c.Call.Return(run) + return _c +} + // PriceMax provides a mock function with given fields: func (_m *GasEstimator) PriceMax() *assets.Wei { ret := _m.Called() @@ -298,6 +776,33 @@ func (_m *GasEstimator) PriceMax() *assets.Wei { return r0 } +// GasEstimator_PriceMax_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PriceMax' +type GasEstimator_PriceMax_Call struct { + *mock.Call +} + +// PriceMax is a helper method to define mock.On call +func (_e *GasEstimator_Expecter) PriceMax() *GasEstimator_PriceMax_Call { + return &GasEstimator_PriceMax_Call{Call: _e.mock.On("PriceMax")} +} + +func (_c *GasEstimator_PriceMax_Call) Run(run func()) *GasEstimator_PriceMax_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *GasEstimator_PriceMax_Call) Return(_a0 *assets.Wei) *GasEstimator_PriceMax_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *GasEstimator_PriceMax_Call) RunAndReturn(run func() *assets.Wei) *GasEstimator_PriceMax_Call { + _c.Call.Return(run) + return _c +} + // PriceMaxKey provides a mock function with given fields: _a0 func (_m *GasEstimator) PriceMaxKey(_a0 common.Address) *assets.Wei { ret := _m.Called(_a0) @@ -318,6 +823,34 @@ func (_m *GasEstimator) PriceMaxKey(_a0 common.Address) *assets.Wei { return r0 } +// GasEstimator_PriceMaxKey_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PriceMaxKey' +type GasEstimator_PriceMaxKey_Call struct { + *mock.Call +} + +// PriceMaxKey is a helper method to define mock.On call +// - _a0 common.Address +func (_e *GasEstimator_Expecter) PriceMaxKey(_a0 interface{}) *GasEstimator_PriceMaxKey_Call { + return &GasEstimator_PriceMaxKey_Call{Call: _e.mock.On("PriceMaxKey", _a0)} +} + +func (_c *GasEstimator_PriceMaxKey_Call) Run(run func(_a0 common.Address)) *GasEstimator_PriceMaxKey_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(common.Address)) + }) + return _c +} + +func (_c *GasEstimator_PriceMaxKey_Call) Return(_a0 *assets.Wei) *GasEstimator_PriceMaxKey_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *GasEstimator_PriceMaxKey_Call) RunAndReturn(run func(common.Address) *assets.Wei) *GasEstimator_PriceMaxKey_Call { + _c.Call.Return(run) + return _c +} + // PriceMin provides a mock function with given fields: func (_m *GasEstimator) PriceMin() *assets.Wei { ret := _m.Called() @@ -338,6 +871,33 @@ func (_m *GasEstimator) PriceMin() *assets.Wei { return r0 } +// GasEstimator_PriceMin_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PriceMin' +type GasEstimator_PriceMin_Call struct { + *mock.Call +} + +// PriceMin is a helper method to define mock.On call +func (_e *GasEstimator_Expecter) PriceMin() *GasEstimator_PriceMin_Call { + return &GasEstimator_PriceMin_Call{Call: _e.mock.On("PriceMin")} +} + +func (_c *GasEstimator_PriceMin_Call) Run(run func()) *GasEstimator_PriceMin_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *GasEstimator_PriceMin_Call) Return(_a0 *assets.Wei) *GasEstimator_PriceMin_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *GasEstimator_PriceMin_Call) RunAndReturn(run func() *assets.Wei) *GasEstimator_PriceMin_Call { + _c.Call.Return(run) + return _c +} + // TipCapDefault provides a mock function with given fields: func (_m *GasEstimator) TipCapDefault() *assets.Wei { ret := _m.Called() @@ -358,6 +918,33 @@ func (_m *GasEstimator) TipCapDefault() *assets.Wei { return r0 } +// GasEstimator_TipCapDefault_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TipCapDefault' +type GasEstimator_TipCapDefault_Call struct { + *mock.Call +} + +// TipCapDefault is a helper method to define mock.On call +func (_e *GasEstimator_Expecter) TipCapDefault() *GasEstimator_TipCapDefault_Call { + return &GasEstimator_TipCapDefault_Call{Call: _e.mock.On("TipCapDefault")} +} + +func (_c *GasEstimator_TipCapDefault_Call) Run(run func()) *GasEstimator_TipCapDefault_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *GasEstimator_TipCapDefault_Call) Return(_a0 *assets.Wei) *GasEstimator_TipCapDefault_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *GasEstimator_TipCapDefault_Call) RunAndReturn(run func() *assets.Wei) *GasEstimator_TipCapDefault_Call { + _c.Call.Return(run) + return _c +} + // TipCapMin provides a mock function with given fields: func (_m *GasEstimator) TipCapMin() *assets.Wei { ret := _m.Called() @@ -378,6 +965,33 @@ func (_m *GasEstimator) TipCapMin() *assets.Wei { return r0 } +// GasEstimator_TipCapMin_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TipCapMin' +type GasEstimator_TipCapMin_Call struct { + *mock.Call +} + +// TipCapMin is a helper method to define mock.On call +func (_e *GasEstimator_Expecter) TipCapMin() *GasEstimator_TipCapMin_Call { + return &GasEstimator_TipCapMin_Call{Call: _e.mock.On("TipCapMin")} +} + +func (_c *GasEstimator_TipCapMin_Call) Run(run func()) *GasEstimator_TipCapMin_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *GasEstimator_TipCapMin_Call) Return(_a0 *assets.Wei) *GasEstimator_TipCapMin_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *GasEstimator_TipCapMin_Call) RunAndReturn(run func() *assets.Wei) *GasEstimator_TipCapMin_Call { + _c.Call.Return(run) + return _c +} + // NewGasEstimator creates a new instance of GasEstimator. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewGasEstimator(t interface { diff --git a/core/chains/evm/config/toml/config.go b/core/chains/evm/config/toml/config.go index 3e35bb4b55c..b5008a73607 100644 --- a/core/chains/evm/config/toml/config.go +++ b/core/chains/evm/config/toml/config.go @@ -338,27 +338,29 @@ func (c *EVMConfig) TOMLString() (string, error) { } type Chain struct { - AutoCreateKey *bool - BlockBackfillDepth *uint32 - BlockBackfillSkip *bool - ChainType *chaintype.ChainTypeConfig - FinalityDepth *uint32 - FinalityTagEnabled *bool - FlagsContractAddress *types.EIP55Address - LinkContractAddress *types.EIP55Address - LogBackfillBatchSize *uint32 - LogPollInterval *commonconfig.Duration - LogKeepBlocksDepth *uint32 - LogPrunePageSize *uint32 - BackupLogPollerBlockDelay *uint64 - MinIncomingConfirmations *uint32 - MinContractPayment *commonassets.Link - NonceAutoSync *bool - NoNewHeadsThreshold *commonconfig.Duration - OperatorFactoryAddress *types.EIP55Address - RPCDefaultBatchSize *uint32 - RPCBlockQueryDelay *uint16 - FinalizedBlockOffset *uint32 + AutoCreateKey *bool + BlockBackfillDepth *uint32 + BlockBackfillSkip *bool + ChainType *chaintype.Config + FinalityDepth *uint32 + FinalityTagEnabled *bool + FlagsContractAddress *types.EIP55Address + LinkContractAddress *types.EIP55Address + LogBackfillBatchSize *uint32 + LogPollInterval *commonconfig.Duration + LogKeepBlocksDepth *uint32 + LogPrunePageSize *uint32 + BackupLogPollerBlockDelay *uint64 + MinIncomingConfirmations *uint32 + MinContractPayment *commonassets.Link + NonceAutoSync *bool + NoNewHeadsThreshold *commonconfig.Duration + OperatorFactoryAddress *types.EIP55Address + LogBroadcasterEnabled *bool + RPCDefaultBatchSize *uint32 + RPCBlockQueryDelay *uint16 + FinalizedBlockOffset *uint32 + NoNewFinalizedHeadsThreshold *commonconfig.Duration Transactions Transactions `toml:",omitempty"` BalanceMonitor BalanceMonitor `toml:",omitempty"` @@ -374,7 +376,7 @@ type Chain struct { func (c *Chain) ValidateConfig() (err error) { if !c.ChainType.ChainType().IsValid() { err = multierr.Append(err, commonconfig.ErrInvalid{Name: "ChainType", Value: c.ChainType.ChainType(), - Msg: chaintype.ErrInvalidChainType.Error()}) + Msg: chaintype.ErrInvalid.Error()}) } if c.GasEstimator.BumpTxDepth != nil && *c.GasEstimator.BumpTxDepth > *c.Transactions.MaxInFlight { @@ -411,8 +413,16 @@ func (c *Chain) ValidateConfig() (err error) { err = multierr.Append(err, commonconfig.ErrInvalid{Name: "Transactions.AutoPurge.DetectionApiUrl", Value: c.Transactions.AutoPurge.DetectionApiUrl.Scheme, Msg: "must be http or https"}) } } - case chaintype.ChainZkEvm: - // No other configs are needed + case chaintype.ChainZkEvm, chaintype.ChainXLayer: + // MinAttempts is an optional config that can be used to delay the stuck tx detection for zkEVM or XLayer + // If MinAttempts is set, BumpThreshold cannot be 0 + if c.Transactions.AutoPurge.MinAttempts != nil && *c.Transactions.AutoPurge.MinAttempts != 0 { + if c.GasEstimator.BumpThreshold == nil { + err = multierr.Append(err, commonconfig.ErrMissing{Name: "GasEstimator.BumpThreshold", Msg: fmt.Sprintf("must be set if Transactions.AutoPurge.MinAttempts is set for %s", chainType)}) + } else if *c.GasEstimator.BumpThreshold == 0 { + err = multierr.Append(err, commonconfig.ErrInvalid{Name: "GasEstimator.BumpThreshold", Value: 0, Msg: fmt.Sprintf("cannot be 0 if Transactions.AutoPurge.MinAttempts is set for %s", chainType)}) + } + } default: // Bump Threshold is required because the stuck tx heuristic relies on a minimum number of bump attempts to exist if c.GasEstimator.BumpThreshold == nil { @@ -512,6 +522,7 @@ func (a *Automation) setFrom(f *Automation) { type Workflow struct { FromAddress *types.EIP55Address `toml:",omitempty"` ForwarderAddress *types.EIP55Address `toml:",omitempty"` + GasLimitDefault *uint64 } func (m *Workflow) setFrom(f *Workflow) { @@ -521,6 +532,10 @@ func (m *Workflow) setFrom(f *Workflow) { if v := f.ForwarderAddress; v != nil { m.ForwarderAddress = v } + + if v := f.GasLimitDefault; v != nil { + m.GasLimitDefault = v + } } type BalanceMonitor struct { @@ -545,6 +560,7 @@ type GasEstimator struct { LimitMultiplier *decimal.Decimal LimitTransfer *uint64 LimitJobType GasLimitJobType `toml:",omitempty"` + EstimateLimit *bool BumpMin *assets.Wei BumpPercent *uint16 @@ -558,6 +574,7 @@ type GasEstimator struct { TipCapMin *assets.Wei BlockHistory BlockHistoryEstimator `toml:",omitempty"` + FeeHistory FeeHistoryEstimator `toml:",omitempty"` } func (e *GasEstimator) ValidateConfig() (err error) { @@ -632,6 +649,9 @@ func (e *GasEstimator) setFrom(f *GasEstimator) { if v := f.LimitTransfer; v != nil { e.LimitTransfer = v } + if v := f.EstimateLimit; v != nil { + e.EstimateLimit = v + } if v := f.PriceDefault; v != nil { e.PriceDefault = v } @@ -649,6 +669,7 @@ func (e *GasEstimator) setFrom(f *GasEstimator) { } e.LimitJobType.setFrom(&f.LimitJobType) e.BlockHistory.setFrom(&f.BlockHistory) + e.FeeHistory.setFrom(&f.FeeHistory) } type GasLimitJobType struct { @@ -711,6 +732,16 @@ func (e *BlockHistoryEstimator) setFrom(f *BlockHistoryEstimator) { } } +type FeeHistoryEstimator struct { + CacheTimeout *commonconfig.Duration +} + +func (u *FeeHistoryEstimator) setFrom(f *FeeHistoryEstimator) { + if v := f.CacheTimeout; v != nil { + u.CacheTimeout = v + } +} + type KeySpecificConfig []KeySpecific func (ks KeySpecificConfig) ValidateConfig() (err error) { @@ -747,6 +778,7 @@ type HeadTracker struct { SamplingInterval *commonconfig.Duration MaxAllowedFinalityDepth *uint32 FinalityTagBypass *bool + PersistenceEnabled *bool } func (t *HeadTracker) setFrom(f *HeadTracker) { @@ -765,6 +797,10 @@ func (t *HeadTracker) setFrom(f *HeadTracker) { if v := f.FinalityTagBypass; v != nil { t.FinalityTagBypass = v } + if v := f.PersistenceEnabled; v != nil { + t.PersistenceEnabled = v + } + } func (t *HeadTracker) ValidateConfig() (err error) { @@ -791,6 +827,7 @@ type ClientErrors struct { TransactionAlreadyMined *string `toml:",omitempty"` Fatal *string `toml:",omitempty"` ServiceUnavailable *string `toml:",omitempty"` + TooManyResults *string `toml:",omitempty"` } func (r *ClientErrors) setFrom(f *ClientErrors) bool { @@ -836,6 +873,9 @@ func (r *ClientErrors) setFrom(f *ClientErrors) bool { if v := f.ServiceUnavailable; v != nil { r.ServiceUnavailable = v } + if v := f.TooManyResults; v != nil { + r.TooManyResults = v + } return true } @@ -850,6 +890,7 @@ type NodePool struct { Errors ClientErrors `toml:",omitempty"` EnforceRepeatableRead *bool DeathDeclarationDelay *commonconfig.Duration + NewHeadsPollInterval *commonconfig.Duration } func (p *NodePool) setFrom(f *NodePool) { @@ -882,6 +923,11 @@ func (p *NodePool) setFrom(f *NodePool) { if v := f.DeathDeclarationDelay; v != nil { p.DeathDeclarationDelay = v } + + if v := f.NewHeadsPollInterval; v != nil { + p.NewHeadsPollInterval = v + } + p.Errors.setFrom(&f.Errors) } diff --git a/core/chains/evm/config/toml/defaults.go b/core/chains/evm/config/toml/defaults.go index 38eef40bf76..0885d94e6df 100644 --- a/core/chains/evm/config/toml/defaults.go +++ b/core/chains/evm/config/toml/defaults.go @@ -3,7 +3,10 @@ package toml import ( "bytes" "embed" + "fmt" + "io" "log" + "os" "path/filepath" "slices" "strings" @@ -12,37 +15,43 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/chains/evm/config/chaintype" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils/big" + "github.com/smartcontractkit/chainlink/v2/core/config/env" ) var ( + //go:embed defaults/*.toml defaultsFS embed.FS fallback Chain defaults = map[string]Chain{} defaultNames = map[string]string{} + customDefaults = map[string]Chain{} + // DefaultIDs is the set of chain ids which have defaults. DefaultIDs []*big.Big ) func init() { + // read the defaults first + fes, err := defaultsFS.ReadDir("defaults") if err != nil { log.Fatalf("failed to read defaults/: %v", err) } for _, fe := range fes { path := filepath.Join("defaults", fe.Name()) - b, err := defaultsFS.ReadFile(path) - if err != nil { - log.Fatalf("failed to read %q: %v", path, err) + b, err2 := defaultsFS.ReadFile(path) + if err2 != nil { + log.Fatalf("failed to read %q: %v", path, err2) } var config = struct { ChainID *big.Big Chain }{} - if err := cconfig.DecodeTOML(bytes.NewReader(b), &config); err != nil { - log.Fatalf("failed to decode %q: %v", path, err) + if err3 := cconfig.DecodeTOML(bytes.NewReader(b), &config); err3 != nil { + log.Fatalf("failed to decode %q: %v", path, err3) } if fe.Name() == "fallback.toml" { if config.ChainID != nil { @@ -65,6 +74,63 @@ func init() { slices.SortFunc(DefaultIDs, func(a, b *big.Big) int { return a.Cmp(b) }) + + // read the custom defaults overrides + dir := env.CustomDefaults.Get() + if dir == "" { + // short-circuit; no default overrides provided + return + } + + // use evm overrides specifically + evmDir := fmt.Sprintf("%s/evm", dir) + + // Read directory contents for evm only + entries, err := os.ReadDir(evmDir) + if err != nil { + log.Fatalf("error reading evm custom defaults override directory: %v", err) + return + } + + for _, entry := range entries { + if entry.IsDir() { + // Skip directories + continue + } + + path := evmDir + "/" + entry.Name() + file, err := os.Open(path) + if err != nil { + log.Fatalf("error opening file (name: %v) in custom defaults override directory: %v", entry.Name(), err) + } + + // Read file contents + b, err := io.ReadAll(file) + file.Close() + if err != nil { + log.Fatalf("error reading file (name: %v) contents in custom defaults override directory: %v", entry.Name(), err) + } + + var config = struct { + ChainID *big.Big + Chain + }{} + + if err := cconfig.DecodeTOML(bytes.NewReader(b), &config); err != nil { + log.Fatalf("failed to decode %q in custom defaults override directory: %v", path, err) + } + + if config.ChainID == nil { + log.Fatalf("missing ChainID in: %s in custom defaults override directory. exiting", path) + } + + id := config.ChainID.String() + + if _, ok := customDefaults[id]; ok { + log.Fatalf("%q contains duplicate ChainID: %s", path, id) + } + customDefaults[id] = config.Chain + } } // DefaultsNamed returns the default Chain values, optionally for the given chainID, as well as a name if the chainID is known. @@ -78,6 +144,9 @@ func DefaultsNamed(chainID *big.Big) (c Chain, name string) { c.SetFrom(&d) name = defaultNames[s] } + if overrides, ok := customDefaults[s]; ok { + c.SetFrom(&overrides) + } return } @@ -155,6 +224,9 @@ func (c *Chain) SetFrom(f *Chain) { if v := f.OperatorFactoryAddress; v != nil { c.OperatorFactoryAddress = v } + if v := f.LogBroadcasterEnabled; v != nil { + c.LogBroadcasterEnabled = v + } if v := f.RPCDefaultBatchSize; v != nil { c.RPCDefaultBatchSize = v } @@ -165,6 +237,10 @@ func (c *Chain) SetFrom(f *Chain) { c.FinalizedBlockOffset = v } + if v := f.NoNewFinalizedHeadsThreshold; v != nil { + c.NoNewFinalizedHeadsThreshold = v + } + c.Transactions.setFrom(&f.Transactions) c.BalanceMonitor.setFrom(&f.BalanceMonitor) c.GasEstimator.setFrom(&f.GasEstimator) diff --git a/core/chains/evm/config/toml/defaults/Arbitrum_Mainnet.toml b/core/chains/evm/config/toml/defaults/Arbitrum_Mainnet.toml index e19c06240a6..ae29e1b0301 100644 --- a/core/chains/evm/config/toml/defaults/Arbitrum_Mainnet.toml +++ b/core/chains/evm/config/toml/defaults/Arbitrum_Mainnet.toml @@ -2,6 +2,7 @@ ChainID = '42161' ChainType = 'arbitrum' FinalityDepth = 4350 +FinalityTagEnabled = true LinkContractAddress = "0xf97f4df75117a78c1A5a0DBb814Af92458539FB4" LogPollInterval = '1s' # Arbitrum only emits blocks when a new tx is received, so this method of liveness detection is not useful diff --git a/core/chains/evm/config/toml/defaults/Arbitrum_Sepolia.toml b/core/chains/evm/config/toml/defaults/Arbitrum_Sepolia.toml index 951a7a8b8cd..7254ca77cea 100644 --- a/core/chains/evm/config/toml/defaults/Arbitrum_Sepolia.toml +++ b/core/chains/evm/config/toml/defaults/Arbitrum_Sepolia.toml @@ -1,6 +1,7 @@ ChainID = '421614' FinalityDepth = 4350 ChainType = 'arbitrum' +FinalityTagEnabled = true NoNewHeadsThreshold = '0' OCR.ContractConfirmations = 1 LogPollInterval = '1s' diff --git a/core/chains/evm/config/toml/defaults/Avalanche_Fuji.toml b/core/chains/evm/config/toml/defaults/Avalanche_Fuji.toml index d7cbad8157c..6e95be2c7f7 100644 --- a/core/chains/evm/config/toml/defaults/Avalanche_Fuji.toml +++ b/core/chains/evm/config/toml/defaults/Avalanche_Fuji.toml @@ -1,11 +1,13 @@ ChainID = '43113' FinalityDepth = 10 +FinalityTagEnabled = true LinkContractAddress = '0x0b9d5D9136855f6FEc3c0993feE6E9CE8a297846' LogPollInterval = '3s' MinIncomingConfirmations = 1 NoNewHeadsThreshold = '30s' OCR.ContractConfirmations = 1 RPCBlockQueryDelay = 2 +NoNewFinalizedHeadsThreshold = '1m' [GasEstimator] PriceDefault = '25 gwei' diff --git a/core/chains/evm/config/toml/defaults/Avalanche_Mainnet.toml b/core/chains/evm/config/toml/defaults/Avalanche_Mainnet.toml index 95d4bf75460..930f9a910f6 100644 --- a/core/chains/evm/config/toml/defaults/Avalanche_Mainnet.toml +++ b/core/chains/evm/config/toml/defaults/Avalanche_Mainnet.toml @@ -1,11 +1,13 @@ ChainID = '43114' FinalityDepth = 10 +FinalityTagEnabled = true LinkContractAddress = '0x5947BB275c521040051D82396192181b413227A3' LogPollInterval = '3s' MinIncomingConfirmations = 1 NoNewHeadsThreshold = '30s' OCR.ContractConfirmations = 1 RPCBlockQueryDelay = 2 +NoNewFinalizedHeadsThreshold = '1m' [GasEstimator] PriceDefault = '25 gwei' diff --git a/core/chains/evm/config/toml/defaults/BSC_Mainnet.toml b/core/chains/evm/config/toml/defaults/BSC_Mainnet.toml index 18a56bdb6e5..ea7045b3d5e 100644 --- a/core/chains/evm/config/toml/defaults/BSC_Mainnet.toml +++ b/core/chains/evm/config/toml/defaults/BSC_Mainnet.toml @@ -3,13 +3,17 @@ # There are 21 BSC validators so theoretically finality should occur after 21/2+1 = 11 blocks ChainID = '56' FinalityDepth = 50 +FinalityTagEnabled = true LinkContractAddress = '0x404460C6A5EdE2D891e8297795264fDe62ADBB75' LogPollInterval = '3s' NoNewHeadsThreshold = '30s' RPCBlockQueryDelay = 2 +NoNewFinalizedHeadsThreshold = '45s' [GasEstimator] PriceDefault = '5 gwei' +# Set to the BSC node's default Eth.Miner.GasPrice config +PriceMin = '3 gwei' # 15s delay since feeds update every minute in volatile situations BumpThreshold = 5 diff --git a/core/chains/evm/config/toml/defaults/BSC_Testnet.toml b/core/chains/evm/config/toml/defaults/BSC_Testnet.toml index ce0ad174c0f..d9b1a27b7ef 100644 --- a/core/chains/evm/config/toml/defaults/BSC_Testnet.toml +++ b/core/chains/evm/config/toml/defaults/BSC_Testnet.toml @@ -3,10 +3,12 @@ # There are 21 BSC validators so theoretically finality should occur after 21/2+1 = 11 blocks ChainID = '97' FinalityDepth = 50 +FinalityTagEnabled = true LinkContractAddress = '0x84b9B910527Ad5C03A9Ca831909E21e236EA7b06' LogPollInterval = '3s' NoNewHeadsThreshold = '30s' RPCBlockQueryDelay = 2 +NoNewFinalizedHeadsThreshold = '40s' [GasEstimator] PriceDefault = '5 gwei' diff --git a/core/chains/evm/config/toml/defaults/Base_Mainnet.toml b/core/chains/evm/config/toml/defaults/Base_Mainnet.toml index 314c12f8c54..da38182b194 100644 --- a/core/chains/evm/config/toml/defaults/Base_Mainnet.toml +++ b/core/chains/evm/config/toml/defaults/Base_Mainnet.toml @@ -1,9 +1,11 @@ ChainID = '8453' ChainType = 'optimismBedrock' FinalityDepth = 200 +FinalityTagEnabled = true LogPollInterval = '2s' NoNewHeadsThreshold = '40s' MinIncomingConfirmations = 1 +NoNewFinalizedHeadsThreshold = '15m' [GasEstimator] EIP1559DynamicFees = true diff --git a/core/chains/evm/config/toml/defaults/Base_Sepolia.toml b/core/chains/evm/config/toml/defaults/Base_Sepolia.toml index 6458dda87f7..b4a7eb680ab 100644 --- a/core/chains/evm/config/toml/defaults/Base_Sepolia.toml +++ b/core/chains/evm/config/toml/defaults/Base_Sepolia.toml @@ -1,9 +1,11 @@ ChainID = '84532' ChainType = 'optimismBedrock' FinalityDepth = 200 +FinalityTagEnabled = true LogPollInterval = '2s' NoNewHeadsThreshold = '40s' MinIncomingConfirmations = 1 +NoNewFinalizedHeadsThreshold = '12m' [GasEstimator] EIP1559DynamicFees = true diff --git a/core/chains/evm/config/toml/defaults/Celo_Mainnet.toml b/core/chains/evm/config/toml/defaults/Celo_Mainnet.toml index b48cb25b325..a4948620370 100644 --- a/core/chains/evm/config/toml/defaults/Celo_Mainnet.toml +++ b/core/chains/evm/config/toml/defaults/Celo_Mainnet.toml @@ -5,6 +5,7 @@ LogPollInterval = '5s' MinIncomingConfirmations = 1 NoNewHeadsThreshold = '1m' OCR.ContractConfirmations = 1 +NoNewFinalizedHeadsThreshold = '1m' [GasEstimator] PriceDefault = '5 gwei' diff --git a/core/chains/evm/config/toml/defaults/Celo_Testnet.toml b/core/chains/evm/config/toml/defaults/Celo_Testnet.toml index d3f595baac6..eb43f080b7d 100644 --- a/core/chains/evm/config/toml/defaults/Celo_Testnet.toml +++ b/core/chains/evm/config/toml/defaults/Celo_Testnet.toml @@ -5,6 +5,7 @@ LogPollInterval = '5s' MinIncomingConfirmations = 1 NoNewHeadsThreshold = '1m' OCR.ContractConfirmations = 1 +NoNewFinalizedHeadsThreshold = '1m' [GasEstimator] PriceDefault = '5 gwei' diff --git a/core/chains/evm/config/toml/defaults/Ethereum_Mainnet.toml b/core/chains/evm/config/toml/defaults/Ethereum_Mainnet.toml index a9a359e6a97..8a3e12c2424 100644 --- a/core/chains/evm/config/toml/defaults/Ethereum_Mainnet.toml +++ b/core/chains/evm/config/toml/defaults/Ethereum_Mainnet.toml @@ -1,8 +1,10 @@ ChainID = '1' +FinalityTagEnabled = true LinkContractAddress = '0x514910771AF9Ca656af840dff83E8264EcF986CA' FinalityDepth = 50 MinContractPayment = '0.1 link' OperatorFactoryAddress = '0x3E64Cd889482443324F91bFA9c84fE72A511f48A' +NoNewFinalizedHeadsThreshold = '9m' [GasEstimator] EIP1559DynamicFees = true diff --git a/core/chains/evm/config/toml/defaults/Ethereum_Sepolia.toml b/core/chains/evm/config/toml/defaults/Ethereum_Sepolia.toml index aef70b1506d..f6789ec13a3 100644 --- a/core/chains/evm/config/toml/defaults/Ethereum_Sepolia.toml +++ b/core/chains/evm/config/toml/defaults/Ethereum_Sepolia.toml @@ -1,5 +1,6 @@ ChainID = '11155111' FinalityDepth = 50 +FinalityTagEnabled = true LinkContractAddress = '0x779877A7B0D9E8603169DdbD7836e478b4624789' MinContractPayment = '0.1 link' diff --git a/core/chains/evm/config/toml/defaults/Gnosis_Chiado.toml b/core/chains/evm/config/toml/defaults/Gnosis_Chiado.toml index 1b14da2b540..379377a2266 100644 --- a/core/chains/evm/config/toml/defaults/Gnosis_Chiado.toml +++ b/core/chains/evm/config/toml/defaults/Gnosis_Chiado.toml @@ -3,6 +3,7 @@ ChainID = '10200' FinalityDepth = 100 ChainType = 'gnosis' LogPollInterval = '5s' +NoNewFinalizedHeadsThreshold = '2m' [GasEstimator] EIP1559DynamicFees = true diff --git a/core/chains/evm/config/toml/defaults/Gnosis_Mainnet.toml b/core/chains/evm/config/toml/defaults/Gnosis_Mainnet.toml index bd9a2634623..5f3fe0b3492 100644 --- a/core/chains/evm/config/toml/defaults/Gnosis_Mainnet.toml +++ b/core/chains/evm/config/toml/defaults/Gnosis_Mainnet.toml @@ -10,6 +10,7 @@ FinalityDepth = 50 ChainType = 'gnosis' LinkContractAddress = '0xE2e73A1c69ecF83F464EFCE6A5be353a37cA09b2' LogPollInterval = '5s' +NoNewFinalizedHeadsThreshold = '2m' [GasEstimator] PriceDefault = '1 gwei' diff --git a/core/chains/evm/config/toml/defaults/Hedera_Mainnet.toml b/core/chains/evm/config/toml/defaults/Hedera_Mainnet.toml new file mode 100644 index 00000000000..4d5e48816fa --- /dev/null +++ b/core/chains/evm/config/toml/defaults/Hedera_Mainnet.toml @@ -0,0 +1,31 @@ +ChainID = '295' +ChainType = 'hedera' +# Considering the 3-5 (6 including a buffer) seconds of finality and 2 seconds block production +# We set the depth to 6/2 = 3 blocks, setting to 10 for safety +FinalityDepth = 10 +# Hedera has high TPS, so polling less often +LogPollInterval = '10s' +MinIncomingConfirmations = 1 + +[BalanceMonitor] +Enabled = true + +[GasEstimator] +Mode = 'SuggestedPrice' +# Since Hedera dont have mempool and there's no way for a node to front run or a user to bribe a node to submit the transaction earlier than it's consensus timestamp, +# But they have automated congesting pricing throttling which would mean at high sustained level the gasPrice itself could be increased to prevent malicious behaviour. +# Disabling the Bumpthreshold as TXM now implicity handles the bumping after checking on-chain nonce & re-broadcast for Hedera chain type +BumpThreshold = 0 +BumpMin = '10 gwei' +BumpPercent = 20 + +[Transactions] +# To hit throttling you'd need to maintain 15 m gas /sec over a prolonged period of time. +# Because Hedera's block times are every 2 secs it's less less likely to happen as compared to other chains +# Setting this to little higher even though Hedera has High TPS, We have seen 10-12s to get the trasaction mined & 20-25s incase of failures +# Accounting for Node syncs & avoid re-sending txns before fetching the receipt, setting to 2m +ResendAfterThreshold = '2m' + + +[NodePool] +SyncThreshold = 10 \ No newline at end of file diff --git a/core/chains/evm/config/toml/defaults/Hedera_Testnet.toml b/core/chains/evm/config/toml/defaults/Hedera_Testnet.toml new file mode 100644 index 00000000000..6086a43af2c --- /dev/null +++ b/core/chains/evm/config/toml/defaults/Hedera_Testnet.toml @@ -0,0 +1,31 @@ +ChainID = '296' +ChainType = 'hedera' +# Considering the 3-5 (6 including a buffer) seconds of finality and 2 seconds block production +# We set the depth to 6/2 = 3 blocks, setting to 10 for safety +FinalityDepth = 10 +# Hedera has high TPS, so polling less often +LogPollInterval = '10s' +MinIncomingConfirmations = 1 + +[BalanceMonitor] +Enabled = true + +[GasEstimator] +Mode = 'SuggestedPrice' +# Since Hedera dont have mempool and there's no way for a node to front run or a user to bribe a node to submit the transaction earlier than it's consensus timestamp, +# But they have automated congesting pricing throttling which would mean at high sustained level the gasPrice itself could be increased to prevent malicious behaviour. +# Disabling the Bumpthreshold as TXM now implicity handles the bumping after checking on-chain nonce & re-broadcast for Hedera chain type +BumpThreshold = 0 +BumpMin = '10 gwei' +BumpPercent = 20 + +[Transactions] +# To hit throttling you'd need to maintain 15 m gas /sec over a prolonged period of time. +# Because Hedera's block times are every 2 secs it's less less likely to happen as compared to other chains +# Setting this to little higher even though Hedera has High TPS, We have seen 10-12s to get the trasaction mined & 20-25s incase of failures +# Accounting for Node syncs & avoid re-sending txns before fetching the receipt, setting to 2m +ResendAfterThreshold = '2m' + + +[NodePool] +SyncThreshold = 10 \ No newline at end of file diff --git a/core/chains/evm/config/toml/defaults/Kroma_Mainnet.toml b/core/chains/evm/config/toml/defaults/Kroma_Mainnet.toml index 55154bf766c..3a48aa8ae1b 100644 --- a/core/chains/evm/config/toml/defaults/Kroma_Mainnet.toml +++ b/core/chains/evm/config/toml/defaults/Kroma_Mainnet.toml @@ -1,6 +1,7 @@ ChainID = '255' ChainType = 'kroma' # Kroma is based on the Optimism Bedrock architechture FinalityDepth = 400 +FinalityTagEnabled = true LogPollInterval = '2s' NoNewHeadsThreshold = '40s' MinIncomingConfirmations = 1 diff --git a/core/chains/evm/config/toml/defaults/Kroma_Sepolia.toml b/core/chains/evm/config/toml/defaults/Kroma_Sepolia.toml index 643b0556b32..9609a09e076 100644 --- a/core/chains/evm/config/toml/defaults/Kroma_Sepolia.toml +++ b/core/chains/evm/config/toml/defaults/Kroma_Sepolia.toml @@ -1,6 +1,7 @@ ChainID = '2358' ChainType = 'kroma' # Kroma is based on the Optimism Bedrock architechture FinalityDepth = 400 +FinalityTagEnabled = true LogPollInterval = '2s' NoNewHeadsThreshold = '40s' MinIncomingConfirmations = 1 diff --git a/core/chains/evm/config/toml/defaults/L3X_Mainnet.toml b/core/chains/evm/config/toml/defaults/L3X_Mainnet.toml new file mode 100644 index 00000000000..1fbda42fd2a --- /dev/null +++ b/core/chains/evm/config/toml/defaults/L3X_Mainnet.toml @@ -0,0 +1,18 @@ +ChainID = '12324' +ChainType = 'arbitrum' +FinalityTagEnabled = true +FinalityDepth = 10 +LinkContractAddress = '0x79f531a3D07214304F259DC28c7191513223bcf3' +# Produces blocks on-demand +NoNewHeadsThreshold = '0' +OCR.ContractConfirmations = 1 +LogPollInterval = '10s' + +[GasEstimator] +Mode = 'Arbitrum' +LimitMax = 1_000_000_000 +# Arbitrum-based chains uses the suggested gas price, so we don't want to place any limits on the minimum +PriceMin = '0' +PriceDefault = '0.1 gwei' +FeeCapDefault = '1000 gwei' +BumpThreshold = 5 diff --git a/core/chains/evm/config/toml/defaults/L3X_Sepolia.toml b/core/chains/evm/config/toml/defaults/L3X_Sepolia.toml new file mode 100644 index 00000000000..ee515bb72ba --- /dev/null +++ b/core/chains/evm/config/toml/defaults/L3X_Sepolia.toml @@ -0,0 +1,18 @@ +ChainID = '12325' +ChainType = 'arbitrum' +FinalityTagEnabled = true +FinalityDepth = 10 +LinkContractAddress = '0xa71848C99155DA0b245981E5ebD1C94C4be51c43' +# Produces blocks on-demand +NoNewHeadsThreshold = '0' +OCR.ContractConfirmations = 1 +LogPollInterval = '10s' + +[GasEstimator] +Mode = 'Arbitrum' +LimitMax = 1_000_000_000 +# Arbitrum-based chains uses the suggested gas price, so we don't want to place any limits on the minimum +PriceMin = '0' +PriceDefault = '0.1 gwei' +FeeCapDefault = '1000 gwei' +BumpThreshold = 5 diff --git a/core/chains/evm/config/toml/defaults/Metis_Mainnet.toml b/core/chains/evm/config/toml/defaults/Metis_Mainnet.toml index cfc79f978f5..f057400d014 100644 --- a/core/chains/evm/config/toml/defaults/Metis_Mainnet.toml +++ b/core/chains/evm/config/toml/defaults/Metis_Mainnet.toml @@ -3,6 +3,7 @@ ChainID = '1088' ChainType = 'metis' # Sequencer offers absolute finality FinalityDepth = 10 +FinalityTagEnabled = true MinIncomingConfirmations = 1 NoNewHeadsThreshold = '0' OCR.ContractConfirmations = 1 diff --git a/core/chains/evm/config/toml/defaults/Metis_Sepolia.toml b/core/chains/evm/config/toml/defaults/Metis_Sepolia.toml index 4e6307302f5..286b888e1a8 100644 --- a/core/chains/evm/config/toml/defaults/Metis_Sepolia.toml +++ b/core/chains/evm/config/toml/defaults/Metis_Sepolia.toml @@ -1,6 +1,7 @@ ChainID = '59902' ChainType = 'metis' FinalityDepth = 10 +FinalityTagEnabled = true MinIncomingConfirmations = 1 NoNewHeadsThreshold = '0' OCR.ContractConfirmations = 1 diff --git a/core/chains/evm/config/toml/defaults/Optimism_Mainnet.toml b/core/chains/evm/config/toml/defaults/Optimism_Mainnet.toml index fd4dd9f32f0..b0f56a49d90 100644 --- a/core/chains/evm/config/toml/defaults/Optimism_Mainnet.toml +++ b/core/chains/evm/config/toml/defaults/Optimism_Mainnet.toml @@ -1,10 +1,12 @@ ChainID = '10' ChainType = 'optimismBedrock' FinalityDepth = 200 +FinalityTagEnabled = true LinkContractAddress = '0x350a791Bfc2C21F9Ed5d10980Dad2e2638ffa7f6' LogPollInterval = '2s' NoNewHeadsThreshold = '40s' MinIncomingConfirmations = 1 +NoNewFinalizedHeadsThreshold = '13m' [GasEstimator] EIP1559DynamicFees = true diff --git a/core/chains/evm/config/toml/defaults/Optimism_Sepolia.toml b/core/chains/evm/config/toml/defaults/Optimism_Sepolia.toml index 116ae9d680b..1c71aa5dd83 100644 --- a/core/chains/evm/config/toml/defaults/Optimism_Sepolia.toml +++ b/core/chains/evm/config/toml/defaults/Optimism_Sepolia.toml @@ -1,9 +1,11 @@ ChainID = '11155420' ChainType = 'optimismBedrock' FinalityDepth = 200 +FinalityTagEnabled = true LogPollInterval = '2s' NoNewHeadsThreshold = '40s' MinIncomingConfirmations = 1 +NoNewFinalizedHeadsThreshold = '15m' [GasEstimator] EIP1559DynamicFees = true diff --git a/core/chains/evm/config/toml/defaults/Polygon_Amoy.toml b/core/chains/evm/config/toml/defaults/Polygon_Amoy.toml index 6a1687fec48..bca42d9b403 100644 --- a/core/chains/evm/config/toml/defaults/Polygon_Amoy.toml +++ b/core/chains/evm/config/toml/defaults/Polygon_Amoy.toml @@ -5,13 +5,16 @@ MinIncomingConfirmations = 5 NoNewHeadsThreshold = '30s' RPCBlockQueryDelay = 10 RPCDefaultBatchSize = 100 +NoNewFinalizedHeadsThreshold = '12m' [Transactions] MaxQueued = 5000 [GasEstimator] -EIP1559DynamicFees = true +PriceDefault = '25 gwei' PriceMax = '115792089237316195423570985008687907853269984665.640564039457584007913129639935 tether' +PriceMin = '25 gwei' +EIP1559DynamicFees = true BumpMin = '20 gwei' BumpThreshold = 5 diff --git a/core/chains/evm/config/toml/defaults/Polygon_Mainnet.toml b/core/chains/evm/config/toml/defaults/Polygon_Mainnet.toml index 50057a6893a..bf605cab3c6 100644 --- a/core/chains/evm/config/toml/defaults/Polygon_Mainnet.toml +++ b/core/chains/evm/config/toml/defaults/Polygon_Mainnet.toml @@ -2,6 +2,7 @@ ChainID = '137' # It is quite common to see re-orgs on polygon go several hundred blocks deep. See: https://polygonscan.com/blocks_forked FinalityDepth = 500 +FinalityTagEnabled = true LinkContractAddress = '0xb0897686c545045aFc77CF20eC7A532E3120E0F1' LogPollInterval = '1s' MinIncomingConfirmations = 5 @@ -9,6 +10,7 @@ NoNewHeadsThreshold = '30s' # Must be set to something large here because Polygon has so many re-orgs that otherwise we are constantly refetching RPCBlockQueryDelay = 10 RPCDefaultBatchSize = 100 +NoNewFinalizedHeadsThreshold = '6m' [Transactions] # Matic nodes under high mempool pressure are liable to drop txes, we need to ensure we keep sending them diff --git a/core/chains/evm/config/toml/defaults/Polygon_Mumbai.toml b/core/chains/evm/config/toml/defaults/Polygon_Mumbai.toml index ce0f8861de2..b9c993c6b23 100644 --- a/core/chains/evm/config/toml/defaults/Polygon_Mumbai.toml +++ b/core/chains/evm/config/toml/defaults/Polygon_Mumbai.toml @@ -11,8 +11,9 @@ RPCDefaultBatchSize = 100 MaxQueued = 5000 [GasEstimator] -PriceDefault = '1 gwei' +PriceDefault = '25 gwei' PriceMax = '115792089237316195423570985008687907853269984665.640564039457584007913129639935 tether' +PriceMin = '25 gwei' BumpMin = '20 gwei' BumpThreshold = 5 diff --git a/core/chains/evm/config/toml/defaults/Polygon_Zkevm_Cardona.toml b/core/chains/evm/config/toml/defaults/Polygon_Zkevm_Cardona.toml index cd91465dae6..46ce80e29fc 100644 --- a/core/chains/evm/config/toml/defaults/Polygon_Zkevm_Cardona.toml +++ b/core/chains/evm/config/toml/defaults/Polygon_Zkevm_Cardona.toml @@ -13,12 +13,14 @@ ContractConfirmations = 1 ResendAfterThreshold = '3m' [GasEstimator] -PriceMin = '1 mwei' +Mode = 'FeeHistory' +# The FeeHistory estimator does not enforce PriceMin, setting it to 0 to not place any limits on the price +PriceMin = '0' BumpPercent = 40 -BumpMin = '20 mwei' -[GasEstimator.BlockHistory] -BlockHistorySize = 12 +[GasEstimator.FeeHistory] +# Refresh the suggested price every 4 seconds, to stay slightly below their polling rate of 5s +CacheTimeout = '4s' [HeadTracker] HistoryDepth = 2000 diff --git a/core/chains/evm/config/toml/defaults/Polygon_Zkevm_Goerli.toml b/core/chains/evm/config/toml/defaults/Polygon_Zkevm_Goerli.toml deleted file mode 100644 index 6a9b47190fd..00000000000 --- a/core/chains/evm/config/toml/defaults/Polygon_Zkevm_Goerli.toml +++ /dev/null @@ -1,24 +0,0 @@ -ChainID = '1442' -ChainType = 'zkevm' -FinalityDepth = 500 -NoNewHeadsThreshold = '12m' -MinIncomingConfirmations = 1 -LogPollInterval = '30s' -RPCDefaultBatchSize = 100 - -[OCR] -ContractConfirmations = 1 - -[Transactions] -ResendAfterThreshold = '3m' - -[GasEstimator] -PriceMin = '50 mwei' -BumpPercent = 40 -BumpMin = '20 mwei' - -[GasEstimator.BlockHistory] -BlockHistorySize = 12 - -[HeadTracker] -HistoryDepth = 2000 diff --git a/core/chains/evm/config/toml/defaults/Polygon_Zkevm_Mainnet.toml b/core/chains/evm/config/toml/defaults/Polygon_Zkevm_Mainnet.toml index 79e0cb0fce5..2fef7874d17 100644 --- a/core/chains/evm/config/toml/defaults/Polygon_Zkevm_Mainnet.toml +++ b/core/chains/evm/config/toml/defaults/Polygon_Zkevm_Mainnet.toml @@ -14,12 +14,14 @@ ContractConfirmations = 1 ResendAfterThreshold = '3m' [GasEstimator] -PriceMin = '100 mwei' +Mode = 'FeeHistory' +# The FeeHistory estimator does not enforce PriceMin, setting it to 0 to not place any limits on the price +PriceMin = '0' BumpPercent = 40 -BumpMin = '100 mwei' -[GasEstimator.BlockHistory] -BlockHistorySize = 12 +[GasEstimator.FeeHistory] +# Refresh the suggested price every 4 seconds, to stay slightly below their polling rate of 5s +CacheTimeout = '4s' [HeadTracker] # Polygon suffers from a tremendous number of re-orgs, we need to set this to something very large to be conservative enough diff --git a/core/chains/evm/config/toml/defaults/Soneium_Sepolia.toml b/core/chains/evm/config/toml/defaults/Soneium_Sepolia.toml new file mode 100755 index 00000000000..9f4772dd9a0 --- /dev/null +++ b/core/chains/evm/config/toml/defaults/Soneium_Sepolia.toml @@ -0,0 +1,32 @@ +ChainID = '1946' +ChainType = 'optimismBedrock' +LinkContractAddress = '0x7ea13478Ea3961A0e8b538cb05a9DF0477c79Cd2' +FinalityDepth = 200 +LogPollInterval = '2s' +NoNewHeadsThreshold = '40s' +MinIncomingConfirmations = 1 +NoNewFinalizedHeadsThreshold = '120m' # Soneium can take upto 2Hours to finalize +FinalityTagEnabled = true + +[GasEstimator] +EIP1559DynamicFees = true +PriceMin = '1 wei' +BumpMin = '1 mwei' + +[GasEstimator.BlockHistory] +BlockHistorySize = 60 + +[Transactions] +ResendAfterThreshold = '30s' + +[HeadTracker] +HistoryDepth = 300 + +[NodePool] +SyncThreshold = 10 + +[OCR] +ContractConfirmations = 1 + +[OCR2.Automation] +GasLimit = 6500000 diff --git a/core/chains/evm/config/toml/defaults/WeMix_Mainnet.toml b/core/chains/evm/config/toml/defaults/WeMix_Mainnet.toml index 35cd4a90a2f..4a55450e47e 100644 --- a/core/chains/evm/config/toml/defaults/WeMix_Mainnet.toml +++ b/core/chains/evm/config/toml/defaults/WeMix_Mainnet.toml @@ -1,10 +1,12 @@ ChainID = '1111' ChainType = 'wemix' FinalityDepth = 10 +FinalityTagEnabled = true MinIncomingConfirmations = 1 # WeMix emits a block every 1 second, regardless of transactions LogPollInterval = '3s' NoNewHeadsThreshold = '30s' +NoNewFinalizedHeadsThreshold = '40s' [OCR] ContractConfirmations = 1 diff --git a/core/chains/evm/config/toml/defaults/WeMix_Testnet.toml b/core/chains/evm/config/toml/defaults/WeMix_Testnet.toml index 417718d87eb..d4f829bcfd1 100644 --- a/core/chains/evm/config/toml/defaults/WeMix_Testnet.toml +++ b/core/chains/evm/config/toml/defaults/WeMix_Testnet.toml @@ -1,10 +1,12 @@ ChainID = '1112' ChainType = 'wemix' FinalityDepth = 10 +FinalityTagEnabled = true MinIncomingConfirmations = 1 # WeMix emits a block every 1 second, regardless of transactions LogPollInterval = '3s' NoNewHeadsThreshold = '30s' +NoNewFinalizedHeadsThreshold = '40s' [OCR] ContractConfirmations = 1 diff --git a/core/chains/evm/config/toml/defaults/Zircuit_Mainnet.toml b/core/chains/evm/config/toml/defaults/Zircuit_Mainnet.toml new file mode 100644 index 00000000000..ec336d3efed --- /dev/null +++ b/core/chains/evm/config/toml/defaults/Zircuit_Mainnet.toml @@ -0,0 +1,36 @@ +ChainID = '48900' +ChainType = 'optimismBedrock' +FinalityTagEnabled = true +FinalityDepth = 1000 +LinkContractAddress = '0x5D6d033B4FbD2190D99D930719fAbAcB64d2439a' +LogPollInterval = "2s" +NoNewHeadsThreshold = "40s" +NoNewFinalizedHeadsThreshold = "15m" + +[GasEstimator] +EIP1559DynamicFees = true +PriceMin = '1 wei' +BumpMin = '100 wei' + +[GasEstimator.BlockHistory] +BlockHistorySize = 24 + +[Transactions] +ResendAfterThreshold = '30s' + +[HeadTracker] +HistoryDepth = 2000 + +[NodePool] +SyncThreshold = 10 + +[OCR] +ContractConfirmations = 1 + +[OCR2.Automation] +GasLimit = 6500000 + +[Transactions.AutoPurge] +Enabled = true +Threshold = 90 # 90 blocks at 2s block time ~3 minutes +MinAttempts = 3 \ No newline at end of file diff --git a/core/chains/evm/config/toml/defaults/Zircuit_Sepolia.toml b/core/chains/evm/config/toml/defaults/Zircuit_Sepolia.toml new file mode 100644 index 00000000000..d6934d533dc --- /dev/null +++ b/core/chains/evm/config/toml/defaults/Zircuit_Sepolia.toml @@ -0,0 +1,36 @@ +ChainID = '48899' +ChainType = 'optimismBedrock' +FinalityTagEnabled = true +FinalityDepth = 1000 +LinkContractAddress = '0xDEE94506570cA186BC1e3516fCf4fd719C312cCD' +LogPollInterval = "2s" +NoNewHeadsThreshold = "40s" +NoNewFinalizedHeadsThreshold = "15m" + +[GasEstimator] +EIP1559DynamicFees = true +PriceMin = '1 wei' +BumpMin = '100 wei' + +[GasEstimator.BlockHistory] +BlockHistorySize = 60 + +[Transactions] +ResendAfterThreshold = '30s' + +[HeadTracker] +HistoryDepth = 2000 + +[NodePool] +SyncThreshold = 10 + +[OCR] +ContractConfirmations = 1 + +[OCR2.Automation] +GasLimit = 6500000 + +[Transactions.AutoPurge] +Enabled = true +Threshold = 90 # 90 blocks at 2s block time ~3 minutes +MinAttempts = 3 \ No newline at end of file diff --git a/core/chains/evm/config/toml/defaults/fallback.toml b/core/chains/evm/config/toml/defaults/fallback.toml index 00c06a8df92..788cdd6fdae 100644 --- a/core/chains/evm/config/toml/defaults/fallback.toml +++ b/core/chains/evm/config/toml/defaults/fallback.toml @@ -15,6 +15,8 @@ NoNewHeadsThreshold = '3m' RPCDefaultBatchSize = 250 RPCBlockQueryDelay = 1 FinalizedBlockOffset = 0 +NoNewFinalizedHeadsThreshold = '0' +LogBroadcasterEnabled = true [Transactions] ForwardersEnabled = false @@ -46,6 +48,7 @@ EIP1559DynamicFees = false FeeCapDefault = '100 gwei' TipCapDefault = '1' TipCapMin = '1' +EstimateLimit = false [GasEstimator.BlockHistory] BatchSize = 25 @@ -54,12 +57,16 @@ CheckInclusionBlocks = 12 CheckInclusionPercentile = 90 TransactionPercentile = 60 +[GasEstimator.FeeHistory] +CacheTimeout = '10s' + [HeadTracker] HistoryDepth = 100 MaxBufferSize = 3 SamplingInterval = '1s' FinalityTagBypass = true MaxAllowedFinalityDepth = 10000 +PersistenceEnabled = true [NodePool] PollFailureThreshold = 5 @@ -71,6 +78,7 @@ NodeIsSyncingEnabled = false FinalizedBlockPollInterval = '5s' EnforceRepeatableRead = false DeathDeclarationDelay = '10s' +NewHeadsPollInterval = '0s' [OCR] ContractConfirmations = 4 @@ -82,3 +90,6 @@ ObservationGracePeriod = '1s' [OCR2.Automation] GasLimit = 5400000 + +[Workflow] +GasLimitDefault = 400_000 diff --git a/core/chains/evm/forwarders/forwarder_manager.go b/core/chains/evm/forwarders/forwarder_manager.go index 6436988ba82..0e9f8781c35 100644 --- a/core/chains/evm/forwarders/forwarder_manager.go +++ b/core/chains/evm/forwarders/forwarder_manager.go @@ -33,7 +33,9 @@ type Config interface { } type FwdMgr struct { - services.StateMachine + services.Service + eng *services.Engine + ORM ORM evmClient evmclient.Client cfg Config @@ -48,61 +50,51 @@ type FwdMgr struct { authRcvr authorized_receiver.AuthorizedReceiverInterface offchainAgg offchain_aggregator_wrapper.OffchainAggregatorInterface - stopCh services.StopChan - cacheMu sync.RWMutex - wg sync.WaitGroup } -func NewFwdMgr(ds sqlutil.DataSource, client evmclient.Client, logpoller evmlogpoller.LogPoller, l logger.Logger, cfg Config) *FwdMgr { - lggr := logger.Sugared(logger.Named(l, "EVMForwarderManager")) - fwdMgr := FwdMgr{ - logger: lggr, +func NewFwdMgr(ds sqlutil.DataSource, client evmclient.Client, logpoller evmlogpoller.LogPoller, lggr logger.Logger, cfg Config) *FwdMgr { + fm := FwdMgr{ cfg: cfg, evmClient: client, ORM: NewORM(ds), logpoller: logpoller, sendersCache: make(map[common.Address][]common.Address), } - fwdMgr.stopCh = make(chan struct{}) - return &fwdMgr -} - -func (f *FwdMgr) Name() string { - return f.logger.Name() + fm.Service, fm.eng = services.Config{ + Name: "ForwarderManager", + Start: fm.start, + }.NewServiceEngine(lggr) + fm.logger = logger.Sugared(fm.eng) + return &fm } -// Start starts Forwarder Manager. -func (f *FwdMgr) Start(ctx context.Context) error { - return f.StartOnce("EVMForwarderManager", func() error { - f.logger.Debug("Initializing EVM forwarder manager") - chainId := f.evmClient.ConfiguredChainID() +func (f *FwdMgr) start(ctx context.Context) error { + chainId := f.evmClient.ConfiguredChainID() - fwdrs, err := f.ORM.FindForwardersByChain(ctx, big.Big(*chainId)) - if err != nil { - return pkgerrors.Wrapf(err, "Failed to retrieve forwarders for chain %d", chainId) - } - if len(fwdrs) != 0 { - f.initForwardersCache(ctx, fwdrs) - if err = f.subscribeForwardersLogs(ctx, fwdrs); err != nil { - return err - } + fwdrs, err := f.ORM.FindForwardersByChain(ctx, big.Big(*chainId)) + if err != nil { + return pkgerrors.Wrapf(err, "Failed to retrieve forwarders for chain %d", chainId) + } + if len(fwdrs) != 0 { + f.initForwardersCache(ctx, fwdrs) + if err = f.subscribeForwardersLogs(ctx, fwdrs); err != nil { + return err } + } - f.authRcvr, err = authorized_receiver.NewAuthorizedReceiver(common.Address{}, f.evmClient) - if err != nil { - return pkgerrors.Wrap(err, "Failed to init AuthorizedReceiver") - } + f.authRcvr, err = authorized_receiver.NewAuthorizedReceiver(common.Address{}, f.evmClient) + if err != nil { + return pkgerrors.Wrap(err, "Failed to init AuthorizedReceiver") + } - f.offchainAgg, err = offchain_aggregator_wrapper.NewOffchainAggregator(common.Address{}, f.evmClient) - if err != nil { - return pkgerrors.Wrap(err, "Failed to init OffchainAggregator") - } + f.offchainAgg, err = offchain_aggregator_wrapper.NewOffchainAggregator(common.Address{}, f.evmClient) + if err != nil { + return pkgerrors.Wrap(err, "Failed to init OffchainAggregator") + } - f.wg.Add(1) - go f.runLoop() - return nil - }) + f.eng.Go(f.runLoop) + return nil } func FilterName(addr common.Address) string { @@ -176,7 +168,7 @@ func (f *FwdMgr) ConvertPayload(dest common.Address, origPayload []byte) ([]byte if err != nil { f.logger.AssumptionViolationw("Forwarder encoding failed, this should never happen", "err", err, "to", dest, "payload", origPayload) - f.SvcErrBuffer.Append(err) + f.eng.EmitHealthErr(err) } } return databytes, nil @@ -269,11 +261,7 @@ func (f *FwdMgr) getCachedSenders(addr common.Address) ([]common.Address, bool) return addrs, ok } -func (f *FwdMgr) runLoop() { - defer f.wg.Done() - ctx, cancel := f.stopCh.NewCtx() - defer cancel() - +func (f *FwdMgr) runLoop(ctx context.Context) { ticker := services.NewTicker(time.Minute) defer ticker.Stop() @@ -353,16 +341,3 @@ func (f *FwdMgr) collectAddresses() (addrs []common.Address) { } return } - -// Stop cancels all outgoings calls and stops internal ticker loop. -func (f *FwdMgr) Close() error { - return f.StopOnce("EVMForwarderManager", func() (err error) { - close(f.stopCh) - f.wg.Wait() - return nil - }) -} - -func (f *FwdMgr) HealthReport() map[string]error { - return map[string]error{f.Name(): f.Healthy()} -} diff --git a/core/chains/evm/forwarders/mocks/orm.go b/core/chains/evm/forwarders/mocks/orm.go index 7cffdf171ce..636d6e7a875 100644 --- a/core/chains/evm/forwarders/mocks/orm.go +++ b/core/chains/evm/forwarders/mocks/orm.go @@ -20,6 +20,14 @@ type ORM struct { mock.Mock } +type ORM_Expecter struct { + mock *mock.Mock +} + +func (_m *ORM) EXPECT() *ORM_Expecter { + return &ORM_Expecter{mock: &_m.Mock} +} + // CreateForwarder provides a mock function with given fields: ctx, addr, evmChainId func (_m *ORM) CreateForwarder(ctx context.Context, addr common.Address, evmChainId big.Big) (forwarders.Forwarder, error) { ret := _m.Called(ctx, addr, evmChainId) @@ -48,6 +56,36 @@ func (_m *ORM) CreateForwarder(ctx context.Context, addr common.Address, evmChai return r0, r1 } +// ORM_CreateForwarder_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateForwarder' +type ORM_CreateForwarder_Call struct { + *mock.Call +} + +// CreateForwarder is a helper method to define mock.On call +// - ctx context.Context +// - addr common.Address +// - evmChainId big.Big +func (_e *ORM_Expecter) CreateForwarder(ctx interface{}, addr interface{}, evmChainId interface{}) *ORM_CreateForwarder_Call { + return &ORM_CreateForwarder_Call{Call: _e.mock.On("CreateForwarder", ctx, addr, evmChainId)} +} + +func (_c *ORM_CreateForwarder_Call) Run(run func(ctx context.Context, addr common.Address, evmChainId big.Big)) *ORM_CreateForwarder_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(common.Address), args[2].(big.Big)) + }) + return _c +} + +func (_c *ORM_CreateForwarder_Call) Return(fwd forwarders.Forwarder, err error) *ORM_CreateForwarder_Call { + _c.Call.Return(fwd, err) + return _c +} + +func (_c *ORM_CreateForwarder_Call) RunAndReturn(run func(context.Context, common.Address, big.Big) (forwarders.Forwarder, error)) *ORM_CreateForwarder_Call { + _c.Call.Return(run) + return _c +} + // DeleteForwarder provides a mock function with given fields: ctx, id, cleanup func (_m *ORM) DeleteForwarder(ctx context.Context, id int64, cleanup func(sqlutil.DataSource, int64, common.Address) error) error { ret := _m.Called(ctx, id, cleanup) @@ -66,6 +104,36 @@ func (_m *ORM) DeleteForwarder(ctx context.Context, id int64, cleanup func(sqlut return r0 } +// ORM_DeleteForwarder_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteForwarder' +type ORM_DeleteForwarder_Call struct { + *mock.Call +} + +// DeleteForwarder is a helper method to define mock.On call +// - ctx context.Context +// - id int64 +// - cleanup func(sqlutil.DataSource , int64 , common.Address) error +func (_e *ORM_Expecter) DeleteForwarder(ctx interface{}, id interface{}, cleanup interface{}) *ORM_DeleteForwarder_Call { + return &ORM_DeleteForwarder_Call{Call: _e.mock.On("DeleteForwarder", ctx, id, cleanup)} +} + +func (_c *ORM_DeleteForwarder_Call) Run(run func(ctx context.Context, id int64, cleanup func(sqlutil.DataSource, int64, common.Address) error)) *ORM_DeleteForwarder_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(int64), args[2].(func(sqlutil.DataSource, int64, common.Address) error)) + }) + return _c +} + +func (_c *ORM_DeleteForwarder_Call) Return(_a0 error) *ORM_DeleteForwarder_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ORM_DeleteForwarder_Call) RunAndReturn(run func(context.Context, int64, func(sqlutil.DataSource, int64, common.Address) error) error) *ORM_DeleteForwarder_Call { + _c.Call.Return(run) + return _c +} + // FindForwarders provides a mock function with given fields: ctx, offset, limit func (_m *ORM) FindForwarders(ctx context.Context, offset int, limit int) ([]forwarders.Forwarder, int, error) { ret := _m.Called(ctx, offset, limit) @@ -103,6 +171,36 @@ func (_m *ORM) FindForwarders(ctx context.Context, offset int, limit int) ([]for return r0, r1, r2 } +// ORM_FindForwarders_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindForwarders' +type ORM_FindForwarders_Call struct { + *mock.Call +} + +// FindForwarders is a helper method to define mock.On call +// - ctx context.Context +// - offset int +// - limit int +func (_e *ORM_Expecter) FindForwarders(ctx interface{}, offset interface{}, limit interface{}) *ORM_FindForwarders_Call { + return &ORM_FindForwarders_Call{Call: _e.mock.On("FindForwarders", ctx, offset, limit)} +} + +func (_c *ORM_FindForwarders_Call) Run(run func(ctx context.Context, offset int, limit int)) *ORM_FindForwarders_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(int), args[2].(int)) + }) + return _c +} + +func (_c *ORM_FindForwarders_Call) Return(_a0 []forwarders.Forwarder, _a1 int, _a2 error) *ORM_FindForwarders_Call { + _c.Call.Return(_a0, _a1, _a2) + return _c +} + +func (_c *ORM_FindForwarders_Call) RunAndReturn(run func(context.Context, int, int) ([]forwarders.Forwarder, int, error)) *ORM_FindForwarders_Call { + _c.Call.Return(run) + return _c +} + // FindForwardersByChain provides a mock function with given fields: ctx, evmChainId func (_m *ORM) FindForwardersByChain(ctx context.Context, evmChainId big.Big) ([]forwarders.Forwarder, error) { ret := _m.Called(ctx, evmChainId) @@ -133,6 +231,35 @@ func (_m *ORM) FindForwardersByChain(ctx context.Context, evmChainId big.Big) ([ return r0, r1 } +// ORM_FindForwardersByChain_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindForwardersByChain' +type ORM_FindForwardersByChain_Call struct { + *mock.Call +} + +// FindForwardersByChain is a helper method to define mock.On call +// - ctx context.Context +// - evmChainId big.Big +func (_e *ORM_Expecter) FindForwardersByChain(ctx interface{}, evmChainId interface{}) *ORM_FindForwardersByChain_Call { + return &ORM_FindForwardersByChain_Call{Call: _e.mock.On("FindForwardersByChain", ctx, evmChainId)} +} + +func (_c *ORM_FindForwardersByChain_Call) Run(run func(ctx context.Context, evmChainId big.Big)) *ORM_FindForwardersByChain_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(big.Big)) + }) + return _c +} + +func (_c *ORM_FindForwardersByChain_Call) Return(_a0 []forwarders.Forwarder, _a1 error) *ORM_FindForwardersByChain_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ORM_FindForwardersByChain_Call) RunAndReturn(run func(context.Context, big.Big) ([]forwarders.Forwarder, error)) *ORM_FindForwardersByChain_Call { + _c.Call.Return(run) + return _c +} + // FindForwardersInListByChain provides a mock function with given fields: ctx, evmChainId, addrs func (_m *ORM) FindForwardersInListByChain(ctx context.Context, evmChainId big.Big, addrs []common.Address) ([]forwarders.Forwarder, error) { ret := _m.Called(ctx, evmChainId, addrs) @@ -163,6 +290,36 @@ func (_m *ORM) FindForwardersInListByChain(ctx context.Context, evmChainId big.B return r0, r1 } +// ORM_FindForwardersInListByChain_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindForwardersInListByChain' +type ORM_FindForwardersInListByChain_Call struct { + *mock.Call +} + +// FindForwardersInListByChain is a helper method to define mock.On call +// - ctx context.Context +// - evmChainId big.Big +// - addrs []common.Address +func (_e *ORM_Expecter) FindForwardersInListByChain(ctx interface{}, evmChainId interface{}, addrs interface{}) *ORM_FindForwardersInListByChain_Call { + return &ORM_FindForwardersInListByChain_Call{Call: _e.mock.On("FindForwardersInListByChain", ctx, evmChainId, addrs)} +} + +func (_c *ORM_FindForwardersInListByChain_Call) Run(run func(ctx context.Context, evmChainId big.Big, addrs []common.Address)) *ORM_FindForwardersInListByChain_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(big.Big), args[2].([]common.Address)) + }) + return _c +} + +func (_c *ORM_FindForwardersInListByChain_Call) Return(_a0 []forwarders.Forwarder, _a1 error) *ORM_FindForwardersInListByChain_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ORM_FindForwardersInListByChain_Call) RunAndReturn(run func(context.Context, big.Big, []common.Address) ([]forwarders.Forwarder, error)) *ORM_FindForwardersInListByChain_Call { + _c.Call.Return(run) + return _c +} + // NewORM creates a new instance of ORM. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewORM(t interface { diff --git a/core/chains/evm/forwarders/orm.go b/core/chains/evm/forwarders/orm.go index 8076cba4831..900899da23d 100644 --- a/core/chains/evm/forwarders/orm.go +++ b/core/chains/evm/forwarders/orm.go @@ -13,8 +13,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils/big" ) -//go:generate mockery --quiet --name ORM --output ./mocks/ --case=underscore - type ORM interface { CreateForwarder(ctx context.Context, addr common.Address, evmChainId big.Big) (fwd Forwarder, err error) FindForwarders(ctx context.Context, offset, limit int) ([]Forwarder, int, error) diff --git a/core/chains/evm/gas/block_history_estimator.go b/core/chains/evm/gas/block_history_estimator.go index 16a66e1c8be..0386d92a0d6 100644 --- a/core/chains/evm/gas/block_history_estimator.go +++ b/core/chains/evm/gas/block_history_estimator.go @@ -91,7 +91,6 @@ type estimatorGasEstimatorConfig interface { bumpConfig } -//go:generate mockery --quiet --name Config --output ./mocks/ --case=underscore type BlockHistoryEstimator struct { services.StateMachine ethClient feeEstimatorClient @@ -277,6 +276,8 @@ func (b *BlockHistoryEstimator) setMaxPercentileGasPrice(gasPrice *assets.Wei) { } func (b *BlockHistoryEstimator) getBlockHistoryNumbers() (numsInHistory []int64) { + b.blocksMu.RLock() + defer b.blocksMu.RUnlock() for _, b := range b.blocks { numsInHistory = append(numsInHistory, b.Number) } @@ -654,12 +655,13 @@ func (b *BlockHistoryEstimator) FetchBlocks(ctx context.Context, head *evmtypes. } blocks := make(map[int64]evmtypes.Block) + earliestInChain := head.EarliestInChain() for _, block := range b.getBlocks() { // Make a best-effort to be re-org resistant using the head // chain, refetch blocks that got re-org'd out. // NOTE: Any blocks in the history that are older than the oldest block // in the provided chain will be assumed final. - if block.Number < head.EarliestInChain().BlockNumber() { + if block.Number < earliestInChain.BlockNumber() { blocks[block.Number] = block } else if head.IsInChain(block.Hash) { blocks[block.Number] = block diff --git a/core/chains/evm/gas/block_history_estimator_test.go b/core/chains/evm/gas/block_history_estimator_test.go index c2f4a2219cb..d84137cb7cf 100644 --- a/core/chains/evm/gas/block_history_estimator_test.go +++ b/core/chains/evm/gas/block_history_estimator_test.go @@ -515,7 +515,7 @@ func TestBlockHistoryEstimator_FetchBlocks(t *testing.T) { head2 := evmtypes.NewHead(big.NewInt(2), b2.Hash, b1.Hash, uint64(time.Now().Unix()), ubig.New(testutils.FixtureChainID)) head3 := evmtypes.NewHead(big.NewInt(3), b3.Hash, b2.Hash, uint64(time.Now().Unix()), ubig.New(testutils.FixtureChainID)) - head3.Parent = &head2 + head3.Parent.Store(&head2) err := bhe.FetchBlocks(tests.Context(t), &head3) require.NoError(t, err) @@ -570,7 +570,7 @@ func TestBlockHistoryEstimator_FetchBlocks(t *testing.T) { // RE-ORG, head2 and head3 have different hash than saved b2 and b3 head2 := evmtypes.NewHead(big.NewInt(2), utils.NewHash(), b1.Hash, uint64(time.Now().Unix()), ubig.New(testutils.FixtureChainID)) head3 := evmtypes.NewHead(big.NewInt(3), utils.NewHash(), head2.Hash, uint64(time.Now().Unix()), ubig.New(testutils.FixtureChainID)) - head3.Parent = &head2 + head3.Parent.Store(&head2) ethClient.On("BatchCallContext", mock.Anything, mock.MatchedBy(func(b []rpc.BatchElem) bool { return len(b) == 2 && @@ -643,7 +643,7 @@ func TestBlockHistoryEstimator_FetchBlocks(t *testing.T) { // head2 and head3 have identical hash to saved blocks head2 := evmtypes.NewHead(big.NewInt(2), b2.Hash, b1.Hash, uint64(time.Now().Unix()), ubig.New(testutils.FixtureChainID)) head3 := evmtypes.NewHead(big.NewInt(3), b3.Hash, head2.Hash, uint64(time.Now().Unix()), ubig.New(testutils.FixtureChainID)) - head3.Parent = &head2 + head3.Parent.Store(&head2) err := bhe.FetchBlocks(tests.Context(t), &head3) require.NoError(t, err) diff --git a/core/chains/evm/gas/docs/FEE_HISTORY_ESTIMATOR.md b/core/chains/evm/gas/docs/FEE_HISTORY_ESTIMATOR.md new file mode 100644 index 00000000000..7f541344a32 --- /dev/null +++ b/core/chains/evm/gas/docs/FEE_HISTORY_ESTIMATOR.md @@ -0,0 +1,56 @@ +# Fee History Estimator + +## Overview +`Fee History` estimator is an EVM-based gas estimator that utilizes RPC calls to make gas price estimations. The estimator heavily relies on two RPC calls: `eth_gasPrice` and `eth_feeHistory`. It is built as a service and caches the calculated results in order to minimize overhead. While bumping, it prioritizes using the latest result from most recent blocks if it exceeds the bumped gas price. `Fee History` estimator supports both Legacy and Dynamic(EIP-1559) transactions. It can also handle chains that don't have a mempool and process transactions on an FCFS basis. + +## Configs +- `BumpPercent`: is the percentage by which to bump gas on a transaction. This is used when the estimator's bumping API gets called. +- `CacheTimeout`: is the time to wait to refresh the cached values. A small jitter is applied so the timeout won't be exactly the same each time. +- `EIP1559`: enables EIP-1559 mode and deactivates Legacy estimations. This means the estimator will refresh prices and make estimations only for Dynamic transactions. + +The rest of the configs are only applicable when `EIP1559` is enabled + +- `BlockHistorySize`: controls the number of past blocks to include during gas calculations. If set to 0, the estimator will skip any priority fee calculation and calculate the underlying base fee. This config should be set to 0 for chains that don't have a mempool. +- `RewardPercentile`: specifies which fee percentile to pick from for each processed past block. + +### Validations +During startup, the estimator will perform two config checks: +- `BumpPercent` is equal to or higher than *MinimumBumpPercentage*. *MinimumBumpPercentage* is fixed at 10% and it's the minimum percentage allowed by Geth when bumping a transaction, to prevent spam attacks. Replacing a transaction with a price less than 10% from the previous one will result in an error on the RPC side. Even for chains that don't enforce that rule, a 10% bump seems reasonable. +- `RewardPercentile` is equal or lower than *ConnectivityPercentile*, when `EIP1559` is enabled. *ConnectivityPercentile* is fixed at the 85th percentile and it's the maximum percentile we're willing to bump a transaction's price. This is used as a sanity check method in order to avoid excessive gas bumping when an RPC is not responding. + +## As a Service +`Fee History` estimator is built as a service. This means it will periodically poll the RPC for new prices, perform off-chain calculations, and cache the result for future use. For simplicity, only one type of gas estimation can be enabled at a time, Legacy or Dynamic. The poll interval is controlled by `CacheTimeout`. This value should be close to the block time. For slower chains, like Ethereum, you can set it to 12s, the same as the block time. For faster chains, you can skip a block or two, as prices will be refreshed more frequently. Ideally, 1s should be the absolute minimum. + + +## Legacy Gas Price Estimations +### Fetching +Periodically, `Fee History` estimator will call `eth_gasPrice` RPC method to fetch the gas price reported by the RPC. The parameters of this call can not be controlled by the user, meaning the result can sometimes be stale, especially during sudden gas spikes. It is advisable to use EIP-1559 if the chain supports it. + +### Bumping +During bumping, `Fee History` will refresh the cached value by making a call to the RPC. The bumped value of the original price will be compared with the market price and the highest value will be returned. + +## Dynamic Price Estimations +### Fetching +`Fee History` estimator periodically calls `eth_feeHistory` method to get the most up-to-date information from the RPC (more information about the call can be found [here](https://ethereum.github.io/execution-apis/api-documentation/)). It fetches three things: +- Base Fee of the next block +- The Yth priority fee percentiles of the past X blocks, where Y is controlled by `RewardPercentile` and X by `BlockHistorySize`. +- The 85th priority fee percentiles of the past X blocks. + +The above values are used to construct and cache the following: +- **MaxPriorityFeePerGas**: the average of Yth priority fee percentiles, excluding zero values. +- **MaxFeePerGas**: `baseFee * BaseFeeBufferPercentage + MaxPriorityFeePerGas`. *BaseFeeBufferPercentage* is used as a safety to catch any fluctuations in the Base Fee during the next blocks. +- **PriorityFeeThreshold**: the max out of every 85th priority fee percentile. This value is used to stop the estimator from bumping a price above that threshold and represents the maximum allowed value. + +*Note*: for chains that don't have a mempool (activated with `BlockHistorySize=0`) **MaxPriorityFeePerGas** and **PriorityFeeThreshold** are set to 0 since there is no concept of gas bumping. + +### Bumping +For bumping, `Fee History` estimator bumps both maxPriorityFeePerGas and maxFeePerGas of the original transaction attempt. This is required by Geth, along with the 10% minimum bumping threshold. The bumped price is compared to the cached market prices stored in the estimator and the highest of the two is picked. Finally, the resulting maxPriorityFeePerGas gets compared to the cached PriorityFeeThreshold value. If the bumped value is higher, this indicates a potential connection issue with the RPC, and bumping is skipped, returning an error. + +*Note*: for chains that don't have a mempool (activated with `BlockHistorySize=0`) bumping works differently. Instead, we force-fetch the most up-to-date Base Fee value and embed it in the MaxFeePerGas. MaxPriorityFeePerGas remains 0. + +### Metrics +The following prometheus metrics are exposed: +- **gas_price_updater**: latest Gas Price stored +- **base_fee_updater**: Base Fee of the next block +- **max_priority_fee_per_gas_updater**: latest MaxPriorityFeePerGas stored +- **max_fee_per_gas_updater**: latest MaxFeePerGas stored \ No newline at end of file diff --git a/core/chains/evm/gas/fee_history_estimator.go b/core/chains/evm/gas/fee_history_estimator.go new file mode 100644 index 00000000000..2b2bc66fcb9 --- /dev/null +++ b/core/chains/evm/gas/fee_history_estimator.go @@ -0,0 +1,440 @@ +package gas + +import ( + "context" + "fmt" + "math/big" + "strconv" + "sync" + "time" + + "github.com/ethereum/go-ethereum" + "github.com/prometheus/client_golang/prometheus" + "github.com/prometheus/client_golang/prometheus/promauto" + + "github.com/smartcontractkit/chainlink-common/pkg/logger" + "github.com/smartcontractkit/chainlink-common/pkg/services" + bigmath "github.com/smartcontractkit/chainlink-common/pkg/utils/big_math" + + commonfee "github.com/smartcontractkit/chainlink/v2/common/fee" + feetypes "github.com/smartcontractkit/chainlink/v2/common/fee/types" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" + evmclient "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/gas/rollups" + evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" +) + +// metrics are thread safe +var ( + promFeeHistoryEstimatorGasPrice = promauto.NewGaugeVec(prometheus.GaugeOpts{ + Name: "gas_price_updater", + Help: "Sets latest gas price (in Wei)", + }, + []string{"evmChainID"}, + ) + promFeeHistoryEstimatorBaseFee = promauto.NewGaugeVec(prometheus.GaugeOpts{ + Name: "base_fee_updater", + Help: "Sets latest BaseFee (in Wei)", + }, + []string{"evmChainID"}, + ) + promFeeHistoryEstimatorMaxPriorityFeePerGas = promauto.NewGaugeVec(prometheus.GaugeOpts{ + Name: "max_priority_fee_per_gas_updater", + Help: "Sets latest MaxPriorityFeePerGas (in Wei)", + }, + []string{"evmChainID"}, + ) + promFeeHistoryEstimatorMaxFeePerGas = promauto.NewGaugeVec(prometheus.GaugeOpts{ + Name: "max_fee_per_gas_updater", + Help: "Sets latest MaxFeePerGas (in Wei)", + }, + []string{"evmChainID"}, + ) +) + +const ( + MinimumBumpPercentage = 10 // based on geth's spec + ConnectivityPercentile = 85 + BaseFeeBufferPercentage = 40 +) + +type FeeHistoryEstimatorConfig struct { + BumpPercent uint16 + CacheTimeout time.Duration + + EIP1559 bool + BlockHistorySize uint64 + RewardPercentile float64 +} + +type feeHistoryEstimatorClient interface { + SuggestGasPrice(ctx context.Context) (*big.Int, error) + FeeHistory(ctx context.Context, blockCount uint64, rewardPercentiles []float64) (feeHistory *ethereum.FeeHistory, err error) +} + +type FeeHistoryEstimator struct { + services.StateMachine + + client feeHistoryEstimatorClient + logger logger.Logger + config FeeHistoryEstimatorConfig + chainID *big.Int + + gasPriceMu sync.RWMutex + gasPrice *assets.Wei + + dynamicPriceMu sync.RWMutex + dynamicPrice DynamicFee + + priorityFeeThresholdMu sync.RWMutex + priorityFeeThreshold *assets.Wei + + l1Oracle rollups.L1Oracle + + wg *sync.WaitGroup + stopCh services.StopChan + refreshCh chan struct{} +} + +func NewFeeHistoryEstimator(lggr logger.Logger, client feeHistoryEstimatorClient, cfg FeeHistoryEstimatorConfig, chainID *big.Int, l1Oracle rollups.L1Oracle) *FeeHistoryEstimator { + return &FeeHistoryEstimator{ + client: client, + logger: logger.Named(lggr, "FeeHistoryEstimator"), + config: cfg, + chainID: chainID, + l1Oracle: l1Oracle, + wg: new(sync.WaitGroup), + stopCh: make(chan struct{}), + refreshCh: make(chan struct{}), + } +} + +func (f *FeeHistoryEstimator) Start(context.Context) error { + return f.StartOnce("FeeHistoryEstimator", func() error { + if f.config.BumpPercent < MinimumBumpPercentage { + return fmt.Errorf("BumpPercent: %s is less than minimum allowed percentage: %s", + strconv.FormatUint(uint64(f.config.BumpPercent), 10), strconv.Itoa(MinimumBumpPercentage)) + } + if f.config.EIP1559 && f.config.RewardPercentile > ConnectivityPercentile { + return fmt.Errorf("RewardPercentile: %s is greater than maximum allowed percentile: %s", + strconv.FormatUint(uint64(f.config.RewardPercentile), 10), strconv.Itoa(ConnectivityPercentile)) + } + f.wg.Add(1) + go f.run() + + return nil + }) +} + +func (f *FeeHistoryEstimator) Close() error { + return f.StopOnce("FeeHistoryEstimator", func() error { + close(f.stopCh) + f.wg.Wait() + return nil + }) +} + +func (f *FeeHistoryEstimator) run() { + defer f.wg.Done() + + t := services.TickerConfig{ + JitterPct: services.DefaultJitter, + }.NewTicker(f.config.CacheTimeout) + + for { + select { + case <-f.stopCh: + return + case <-f.refreshCh: + t.Reset() + case <-t.C: + if f.config.EIP1559 { + if err := f.RefreshDynamicPrice(); err != nil { + f.logger.Error(err) + } + } else { + if _, err := f.RefreshGasPrice(); err != nil { + f.logger.Error(err) + } + } + } + } +} + +// GetLegacyGas will fetch the cached gas price value. +func (f *FeeHistoryEstimator) GetLegacyGas(ctx context.Context, _ []byte, gasLimit uint64, maxPrice *assets.Wei, opts ...feetypes.Opt) (gasPrice *assets.Wei, chainSpecificGasLimit uint64, err error) { + chainSpecificGasLimit = gasLimit + if gasPrice, err = f.getGasPrice(); err != nil { + return + } + + if gasPrice.Cmp(maxPrice) > 0 { + f.logger.Warnf("estimated gas price: %s is greater than the maximum gas price configured: %s, returning the maximum price instead.", gasPrice, maxPrice) + return maxPrice, chainSpecificGasLimit, nil + } + return +} + +// RefreshGasPrice will use eth_gasPrice to fetch and cache the latest gas price from the RPC. +func (f *FeeHistoryEstimator) RefreshGasPrice() (*assets.Wei, error) { + ctx, cancel := f.stopCh.CtxCancel(evmclient.ContextWithDefaultTimeout()) + defer cancel() + + gasPrice, err := f.client.SuggestGasPrice(ctx) + if err != nil { + return nil, err + } + + promFeeHistoryEstimatorGasPrice.WithLabelValues(f.chainID.String()).Set(float64(gasPrice.Int64())) + + gasPriceWei := assets.NewWei(gasPrice) + + f.logger.Debugf("fetched new gas price: %v", gasPriceWei) + + f.gasPriceMu.Lock() + defer f.gasPriceMu.Unlock() + f.gasPrice = gasPriceWei + return f.gasPrice, nil +} + +func (f *FeeHistoryEstimator) getGasPrice() (*assets.Wei, error) { + f.gasPriceMu.RLock() + defer f.gasPriceMu.RUnlock() + if f.gasPrice == nil { + return f.gasPrice, fmt.Errorf("gas price not set") + } + return f.gasPrice, nil +} + +// GetDynamicFee will fetch the cached dynamic prices. +func (f *FeeHistoryEstimator) GetDynamicFee(ctx context.Context, maxPrice *assets.Wei) (fee DynamicFee, err error) { + if fee, err = f.getDynamicPrice(); err != nil { + return + } + + if fee.FeeCap.Cmp(maxPrice) > 0 { + f.logger.Warnf("estimated maxFeePerGas: %v is greater than the maximum price configured: %v, returning the maximum price instead.", + fee.FeeCap, maxPrice) + fee.FeeCap = maxPrice + if fee.TipCap.Cmp(maxPrice) > 0 { + f.logger.Warnf("estimated maxPriorityFeePerGas: %v is greater than the maximum price configured: %v, returning the maximum price instead.", + fee.TipCap, maxPrice) + fee.TipCap = maxPrice + } + } + + return +} + +// RefreshDynamicPrice uses eth_feeHistory to fetch the baseFee of the next block and the Nth maxPriorityFeePerGas percentiles +// of the past X blocks. It also fetches the highest 85th maxPriorityFeePerGas percentile of the past X blocks, which represents +// the highest percentile we're willing to pay. A buffer is added on top of the latest baseFee to catch fluctuations in the next +// blocks. On Ethereum the increase is baseFee * 1.125 per block, however in some chains that may vary. +func (f *FeeHistoryEstimator) RefreshDynamicPrice() error { + ctx, cancel := f.stopCh.CtxCancel(evmclient.ContextWithDefaultTimeout()) + defer cancel() + + // RewardPercentile will be used for maxPriorityFeePerGas estimations and connectivityPercentile to set the highest threshold for bumping. + feeHistory, err := f.client.FeeHistory(ctx, max(f.config.BlockHistorySize, 1), []float64{f.config.RewardPercentile, ConnectivityPercentile}) + if err != nil { + return err + } + + // eth_feeHistory doesn't return the latest baseFee of the range but rather the latest + 1, because it can be derived from the existing + // values. Source: https://github.com/ethereum/go-ethereum/blob/b0f66e34ca2a4ea7ae23475224451c8c9a569826/eth/gasprice/feehistory.go#L235 + // nextBlock is the latest returned + 1 to be aligned with the base fee value. + nextBaseFee := assets.NewWei(feeHistory.BaseFee[len(feeHistory.BaseFee)-1]) + nextBlock := big.NewInt(0).Add(feeHistory.OldestBlock, big.NewInt(int64(f.config.BlockHistorySize))) + + // If BlockHistorySize is 0 it means priority fees will be ignored from the calculations, so we set them to 0. + // If it's not we exclude 0 priced priority fees from the RPC response, even though some networks allow them. For empty blocks, eth_feeHistory + // returns priority fees with 0 values so it's safer to discard them in order to pick values from a more representative sample. + maxPriorityFeePerGas := assets.NewWeiI(0) + priorityFeeThresholdWei := assets.NewWeiI(0) + if f.config.BlockHistorySize > 0 { + var nonZeroRewardsLen int64 + priorityFee := big.NewInt(0) + priorityFeeThreshold := big.NewInt(0) + for _, reward := range feeHistory.Reward { + // reward needs to have values for two percentiles + if len(reward) < 2 { + return fmt.Errorf("reward size incorrect: %d", len(reward)) + } + // We'll calculate the average of non-zero priority fees + if reward[0].Cmp(big.NewInt(0)) > 0 { + priorityFee = priorityFee.Add(priorityFee, reward[0]) + nonZeroRewardsLen++ + } + // We take the max value for the bumping threshold + if reward[1].Cmp(big.NewInt(0)) > 0 { + priorityFeeThreshold = bigmath.Max(priorityFeeThreshold, reward[1]) + } + } + + if nonZeroRewardsLen == 0 || priorityFeeThreshold.Cmp(big.NewInt(0)) == 0 { + return nil + } + priorityFeeThresholdWei = assets.NewWei(priorityFeeThreshold) + maxPriorityFeePerGas = assets.NewWei(priorityFee.Div(priorityFee, big.NewInt(nonZeroRewardsLen))) + } + // BaseFeeBufferPercentage is used as a safety to catch any fluctuations in the Base Fee during the next blocks. + maxFeePerGas := nextBaseFee.AddPercentage(BaseFeeBufferPercentage).Add(maxPriorityFeePerGas) + + promFeeHistoryEstimatorBaseFee.WithLabelValues(f.chainID.String()).Set(float64(nextBaseFee.Int64())) + promFeeHistoryEstimatorMaxPriorityFeePerGas.WithLabelValues(f.chainID.String()).Set(float64(maxPriorityFeePerGas.Int64())) + promFeeHistoryEstimatorMaxFeePerGas.WithLabelValues(f.chainID.String()).Set(float64(maxFeePerGas.Int64())) + + f.logger.Debugf("Fetched new dynamic prices, nextBlock#: %v - oldestBlock#: %v - nextBaseFee: %v - maxFeePerGas: %v - maxPriorityFeePerGas: %v - maxPriorityFeeThreshold: %v", + nextBlock, feeHistory.OldestBlock, nextBaseFee, maxFeePerGas, maxPriorityFeePerGas, priorityFeeThresholdWei) + + f.priorityFeeThresholdMu.Lock() + f.priorityFeeThreshold = priorityFeeThresholdWei + f.priorityFeeThresholdMu.Unlock() + + f.dynamicPriceMu.Lock() + defer f.dynamicPriceMu.Unlock() + f.dynamicPrice.FeeCap = maxFeePerGas + f.dynamicPrice.TipCap = maxPriorityFeePerGas + return nil +} + +func (f *FeeHistoryEstimator) getDynamicPrice() (fee DynamicFee, err error) { + f.dynamicPriceMu.RLock() + defer f.dynamicPriceMu.RUnlock() + if f.dynamicPrice.FeeCap == nil || f.dynamicPrice.TipCap == nil { + return fee, fmt.Errorf("dynamic price not set") + } + return f.dynamicPrice, nil +} + +// BumpLegacyGas provides a bumped gas price value by bumping the previous one by BumpPercent. +// If the original value is higher than the max price it returns an error as there is no room for bumping. +// It aggregates the market, bumped, and max gas price to provide a correct value. +func (f *FeeHistoryEstimator) BumpLegacyGas(ctx context.Context, originalGasPrice *assets.Wei, gasLimit uint64, maxPrice *assets.Wei, _ []EvmPriorAttempt) (*assets.Wei, uint64, error) { + // Sanitize original fee input + if originalGasPrice == nil || originalGasPrice.Cmp(maxPrice) >= 0 { + return nil, 0, fmt.Errorf("%w: error while retrieving original gas price: originalGasPrice: %s. Maximum price configured: %s", + commonfee.ErrBump, originalGasPrice, maxPrice) + } + + currentGasPrice, err := f.RefreshGasPrice() + if err != nil { + return nil, 0, err + } + f.IfStarted(func() { f.refreshCh <- struct{}{} }) + + bumpedGasPrice := originalGasPrice.AddPercentage(f.config.BumpPercent) + bumpedGasPrice, err = LimitBumpedFee(originalGasPrice, currentGasPrice, bumpedGasPrice, maxPrice) + if err != nil { + return nil, 0, fmt.Errorf("failed to limit gas price: %w", err) + } + + f.logger.Debugw("bumped gas price", "originalGasPrice", originalGasPrice, "marketGasPrice", currentGasPrice, "bumpedGasPrice", bumpedGasPrice) + + return bumpedGasPrice, gasLimit, nil +} + +// BumpDynamicFee provides a bumped dynamic fee by bumping the previous one by BumpPercent. +// If the original values are higher than the max price it returns an error as there is no room for bumping. If maxPriorityFeePerGas is bumped +// above the priority fee threshold then there is a good chance there is a connectivity issue and we shouldn't bump. +// Both maxFeePerGas as well as maxPriorityFeePerGas need to be bumped otherwise the RPC won't accept the transaction and throw an error. +// See: https://github.com/ethereum/go-ethereum/issues/24284 +// It aggregates the market, bumped, and max price to provide a correct value, for both maxFeePerGas as well as maxPriorityFerPergas. +func (f *FeeHistoryEstimator) BumpDynamicFee(ctx context.Context, originalFee DynamicFee, maxPrice *assets.Wei, _ []EvmPriorAttempt) (bumped DynamicFee, err error) { + // For chains that don't have a mempool there is no concept of gas bumping so we force-call RefreshDynamicPrice to update the underlying base fee value + if f.config.BlockHistorySize == 0 { + if !f.IfStarted(func() { + if refreshErr := f.RefreshDynamicPrice(); refreshErr != nil { + err = refreshErr + return + } + f.refreshCh <- struct{}{} + bumped, err = f.GetDynamicFee(ctx, maxPrice) + }) { + return bumped, fmt.Errorf("estimator not started") + } + return bumped, err + } + + // Sanitize original fee input + // According to geth's spec we need to bump both maxFeePerGas and maxPriorityFeePerGas for the new attempt to be accepted by the RPC + if originalFee.FeeCap == nil || + originalFee.TipCap == nil || + ((originalFee.TipCap.Cmp(originalFee.FeeCap)) > 0) || + (originalFee.FeeCap.Cmp(maxPrice) >= 0) { + return bumped, fmt.Errorf("%w: error while retrieving original dynamic fees: (originalFeePerGas: %s - originalPriorityFeePerGas: %s). Maximum price configured: %s", + commonfee.ErrBump, originalFee.FeeCap, originalFee.TipCap, maxPrice) + } + + currentDynamicPrice, err := f.getDynamicPrice() + if err != nil { + return + } + + bumpedMaxPriorityFeePerGas := originalFee.TipCap.AddPercentage(f.config.BumpPercent) + bumpedMaxFeePerGas := originalFee.FeeCap.AddPercentage(f.config.BumpPercent) + + bumpedMaxPriorityFeePerGas, err = LimitBumpedFee(originalFee.TipCap, currentDynamicPrice.TipCap, bumpedMaxPriorityFeePerGas, maxPrice) + if err != nil { + return bumped, fmt.Errorf("failed to limit maxPriorityFeePerGas: %w", err) + } + + priorityFeeThreshold, e := f.getPriorityFeeThreshold() + if e != nil { + return bumped, e + } + + if bumpedMaxPriorityFeePerGas.Cmp(priorityFeeThreshold) > 0 { + return bumped, fmt.Errorf("bumpedMaxPriorityFeePerGas: %s is above market's %sth percentile: %s, bumping is halted", + bumpedMaxPriorityFeePerGas, strconv.Itoa(ConnectivityPercentile), priorityFeeThreshold) + } + + bumpedMaxFeePerGas, err = LimitBumpedFee(originalFee.FeeCap, currentDynamicPrice.FeeCap, bumpedMaxFeePerGas, maxPrice) + if err != nil { + return bumped, fmt.Errorf("failed to limit maxFeePerGas: %w", err) + } + + bumpedFee := DynamicFee{FeeCap: bumpedMaxFeePerGas, TipCap: bumpedMaxPriorityFeePerGas} + f.logger.Debugw("bumped dynamic fee", "originalFee", originalFee, "marketFee", currentDynamicPrice, "bumpedFee", bumpedFee) + + return bumpedFee, nil +} + +// LimitBumpedFee selects the maximum value between the bumped attempt and the current fee, if there is one. If the result is higher than the max price it gets capped. +// Geth's implementation has a hard 10% minimum limit for the bumped values, otherwise it rejects the transaction with an error. +// See: https://github.com/ethereum/go-ethereum/blob/bff330335b94af3643ac2fb809793f77de3069d4/core/tx_list.go#L298 +// +// Note: for chains that support EIP-1559 but we still choose to send Legacy transactions to them, the limit is still enforcable due to the fact that Legacy transactions +// are treated the same way as Dynamic transactions under the hood. For chains that don't support EIP-1559 at all, the limit isn't enforcable but a 10% minimum bump percentage +// makes sense anyway. +func LimitBumpedFee(originalFee *assets.Wei, currentFee *assets.Wei, bumpedFee *assets.Wei, maxPrice *assets.Wei) (*assets.Wei, error) { + if currentFee != nil { + bumpedFee = assets.WeiMax(currentFee, bumpedFee) + } + bumpedFee = assets.WeiMin(bumpedFee, maxPrice) + + // The first check is added for the following edge case: + // If originalFee is below 10 wei, then adding the minimum bump percentage won't have any effect on the final value because of rounding down. + // Similarly for bumpedFee, it can have the exact same value as the originalFee, even if we bumped, given an originalFee of less than 10 wei + // and a small enough BumpPercent. + if bumpedFee.Cmp(originalFee) == 0 || + bumpedFee.Cmp(originalFee.AddPercentage(MinimumBumpPercentage)) < 0 { + return nil, fmt.Errorf("%w: %s is bumped less than minimum allowed percentage(%s) from originalFee: %s - maxPrice: %s", + commonfee.ErrBump, bumpedFee, strconv.Itoa(MinimumBumpPercentage), originalFee, maxPrice) + } + return bumpedFee, nil +} + +func (f *FeeHistoryEstimator) getPriorityFeeThreshold() (*assets.Wei, error) { + f.priorityFeeThresholdMu.RLock() + defer f.priorityFeeThresholdMu.RUnlock() + if f.priorityFeeThreshold == nil { + return f.priorityFeeThreshold, fmt.Errorf("priorityFeeThreshold not set") + } + return f.priorityFeeThreshold, nil +} + +func (f *FeeHistoryEstimator) Name() string { return f.logger.Name() } +func (f *FeeHistoryEstimator) L1Oracle() rollups.L1Oracle { return f.l1Oracle } +func (f *FeeHistoryEstimator) HealthReport() map[string]error { return map[string]error{f.Name(): nil} } +func (f *FeeHistoryEstimator) OnNewLongestChain(context.Context, *evmtypes.Head) {} diff --git a/core/chains/evm/gas/fee_history_estimator_test.go b/core/chains/evm/gas/fee_history_estimator_test.go new file mode 100644 index 00000000000..6e42e0e2094 --- /dev/null +++ b/core/chains/evm/gas/fee_history_estimator_test.go @@ -0,0 +1,513 @@ +package gas_test + +import ( + "math/big" + "testing" + "time" + + "github.com/ethereum/go-ethereum" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + + "github.com/smartcontractkit/chainlink-common/pkg/logger" + "github.com/smartcontractkit/chainlink-common/pkg/services/servicetest" + "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/gas" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/gas/mocks" +) + +func TestFeeHistoryEstimatorLifecycle(t *testing.T) { + t.Parallel() + var gasLimit uint64 = 21000 + maxPrice := assets.NewWeiI(100) + chainID := big.NewInt(0) + + t.Run("fails if you fetch gas price before the estimator starts", func(t *testing.T) { + cfg := gas.FeeHistoryEstimatorConfig{ + BumpPercent: 20, + RewardPercentile: 60, + EIP1559: false, + } + + u := gas.NewFeeHistoryEstimator(logger.Test(t), nil, cfg, chainID, nil) + _, _, err := u.GetLegacyGas(tests.Context(t), nil, gasLimit, maxPrice) + assert.ErrorContains(t, err, "gas price not set") + }) + + t.Run("fails to start if BumpPercent is lower than the minimum cap", func(t *testing.T) { + cfg := gas.FeeHistoryEstimatorConfig{BumpPercent: 9} + + u := gas.NewFeeHistoryEstimator(logger.Test(t), nil, cfg, chainID, nil) + assert.ErrorContains(t, u.Start(tests.Context(t)), "BumpPercent") + }) + + t.Run("fails to start if RewardPercentile is higher than ConnectivityPercentile in EIP-1559", func(t *testing.T) { + cfg := gas.FeeHistoryEstimatorConfig{ + BumpPercent: 20, + RewardPercentile: 99, + EIP1559: true, + } + + u := gas.NewFeeHistoryEstimator(logger.Test(t), nil, cfg, chainID, nil) + assert.ErrorContains(t, u.Start(tests.Context(t)), "RewardPercentile") + }) + + t.Run("starts if configs are correct", func(t *testing.T) { + client := mocks.NewFeeHistoryEstimatorClient(t) + client.On("SuggestGasPrice", mock.Anything).Return(big.NewInt(10), nil).Maybe() + + cfg := gas.FeeHistoryEstimatorConfig{ + BumpPercent: 20, + RewardPercentile: 10, + CacheTimeout: 10 * time.Second, + } + + u := gas.NewFeeHistoryEstimator(logger.Test(t), nil, cfg, chainID, nil) + err := u.Start(tests.Context(t)) + assert.NoError(t, err) + err = u.Close() + assert.NoError(t, err) + }) +} + +func TestFeeHistoryEstimatorGetLegacyGas(t *testing.T) { + t.Parallel() + + var gasLimit uint64 = 21000 + maxPrice := assets.NewWeiI(100) + chainID := big.NewInt(0) + + t.Run("fetches a new gas price when first called", func(t *testing.T) { + client := mocks.NewFeeHistoryEstimatorClient(t) + client.On("SuggestGasPrice", mock.Anything).Return(big.NewInt(10), nil).Once() + + cfg := gas.FeeHistoryEstimatorConfig{} + + u := gas.NewFeeHistoryEstimator(logger.Test(t), client, cfg, chainID, nil) + _, err := u.RefreshGasPrice() + assert.NoError(t, err) + gasPrice, _, err := u.GetLegacyGas(tests.Context(t), nil, gasLimit, maxPrice) + assert.NoError(t, err) + assert.Equal(t, assets.NewWeiI(10), gasPrice) + }) + + t.Run("will return max price if estimation exceeds it", func(t *testing.T) { + client := mocks.NewFeeHistoryEstimatorClient(t) + client.On("SuggestGasPrice", mock.Anything).Return(big.NewInt(10), nil).Once() + + cfg := gas.FeeHistoryEstimatorConfig{} + + maxPrice := assets.NewWeiI(1) + u := gas.NewFeeHistoryEstimator(logger.Test(t), client, cfg, chainID, nil) + _, err := u.RefreshGasPrice() + assert.NoError(t, err) + gas1, _, err := u.GetLegacyGas(tests.Context(t), nil, gasLimit, maxPrice) + assert.NoError(t, err) + assert.Equal(t, maxPrice, gas1) + }) + + t.Run("fails if gas price has not been set yet", func(t *testing.T) { + cfg := gas.FeeHistoryEstimatorConfig{} + + maxPrice := assets.NewWeiI(1) + u := gas.NewFeeHistoryEstimator(logger.Test(t), nil, cfg, chainID, nil) + _, _, err := u.GetLegacyGas(tests.Context(t), nil, gasLimit, maxPrice) + assert.Error(t, err) + assert.ErrorContains(t, err, "gas price not set") + }) +} + +func TestFeeHistoryEstimatorBumpLegacyGas(t *testing.T) { + t.Parallel() + + var gasLimit uint64 = 21000 + maxPrice := assets.NewWeiI(100) + chainID := big.NewInt(0) + + t.Run("bumps a previous attempt by BumpPercent", func(t *testing.T) { + client := mocks.NewFeeHistoryEstimatorClient(t) + originalGasPrice := assets.NewWeiI(10) + client.On("SuggestGasPrice", mock.Anything).Return(big.NewInt(10), nil) + + cfg := gas.FeeHistoryEstimatorConfig{BumpPercent: 50, CacheTimeout: 5 * time.Second} + + u := gas.NewFeeHistoryEstimator(logger.Test(t), client, cfg, chainID, nil) + servicetest.RunHealthy(t, u) + gasPrice, _, err := u.BumpLegacyGas(tests.Context(t), originalGasPrice, gasLimit, maxPrice, nil) + assert.NoError(t, err) + assert.Equal(t, assets.NewWeiI(15), gasPrice) + }) + + t.Run("fails if the original attempt is nil, or equal or higher than the max price", func(t *testing.T) { + client := mocks.NewFeeHistoryEstimatorClient(t) + + cfg := gas.FeeHistoryEstimatorConfig{} + u := gas.NewFeeHistoryEstimator(logger.Test(t), client, cfg, chainID, nil) + + var originalPrice *assets.Wei + _, _, err := u.BumpLegacyGas(tests.Context(t), originalPrice, gasLimit, maxPrice, nil) + assert.Error(t, err) + + originalPrice = assets.NewWeiI(100) + _, _, err = u.BumpLegacyGas(tests.Context(t), originalPrice, gasLimit, maxPrice, nil) + assert.Error(t, err) + }) + + t.Run("returns market gas price if bumped original fee is lower", func(t *testing.T) { + client := mocks.NewFeeHistoryEstimatorClient(t) + client.On("SuggestGasPrice", mock.Anything).Return(big.NewInt(80), nil).Once() + originalGasPrice := assets.NewWeiI(10) + + cfg := gas.FeeHistoryEstimatorConfig{} + + u := gas.NewFeeHistoryEstimator(logger.Test(t), client, cfg, chainID, nil) + gas, _, err := u.BumpLegacyGas(tests.Context(t), originalGasPrice, gasLimit, maxPrice, nil) + assert.NoError(t, err) + assert.Equal(t, assets.NewWeiI(80), gas) + }) + + t.Run("returns max gas price if bumped original fee is higher", func(t *testing.T) { + client := mocks.NewFeeHistoryEstimatorClient(t) + client.On("SuggestGasPrice", mock.Anything).Return(big.NewInt(1), nil).Once() + originalGasPrice := assets.NewWeiI(10) + + cfg := gas.FeeHistoryEstimatorConfig{BumpPercent: 50} + + maxPrice := assets.NewWeiI(14) + u := gas.NewFeeHistoryEstimator(logger.Test(t), client, cfg, chainID, nil) + gas, _, err := u.BumpLegacyGas(tests.Context(t), originalGasPrice, gasLimit, maxPrice, nil) + assert.NoError(t, err) + assert.Equal(t, maxPrice, gas) + }) + + t.Run("returns max gas price if the aggregation of max and original bumped fee is higher", func(t *testing.T) { + client := mocks.NewFeeHistoryEstimatorClient(t) + client.On("SuggestGasPrice", mock.Anything).Return(big.NewInt(1), nil).Once() + originalGasPrice := assets.NewWeiI(10) + + cfg := gas.FeeHistoryEstimatorConfig{BumpPercent: 50} + + maxPrice := assets.NewWeiI(14) + u := gas.NewFeeHistoryEstimator(logger.Test(t), client, cfg, chainID, nil) + gas, _, err := u.BumpLegacyGas(tests.Context(t), originalGasPrice, gasLimit, maxPrice, nil) + assert.NoError(t, err) + assert.Equal(t, maxPrice, gas) + }) + + t.Run("fails if the bumped gas price is lower than the minimum bump percentage", func(t *testing.T) { + client := mocks.NewFeeHistoryEstimatorClient(t) + client.On("SuggestGasPrice", mock.Anything).Return(big.NewInt(100), nil).Once() + originalGasPrice := assets.NewWeiI(100) + + cfg := gas.FeeHistoryEstimatorConfig{BumpPercent: 20} + + // Price will be capped by the max price + maxPrice := assets.NewWeiI(101) + u := gas.NewFeeHistoryEstimator(logger.Test(t), client, cfg, chainID, nil) + _, _, err := u.BumpLegacyGas(tests.Context(t), originalGasPrice, gasLimit, maxPrice, nil) + assert.Error(t, err) + }) +} + +func TestFeeHistoryEstimatorGetDynamicFee(t *testing.T) { + t.Parallel() + + maxPrice := assets.NewWeiI(100) + chainID := big.NewInt(0) + + t.Run("fetches a new dynamic fee when first called", func(t *testing.T) { + client := mocks.NewFeeHistoryEstimatorClient(t) + baseFee := big.NewInt(5) + maxPriorityFeePerGas1 := big.NewInt(33) + maxPriorityFeePerGas2 := big.NewInt(20) + + feeHistoryResult := ðereum.FeeHistory{ + OldestBlock: big.NewInt(1), + Reward: [][]*big.Int{{maxPriorityFeePerGas1, big.NewInt(5)}, {maxPriorityFeePerGas2, big.NewInt(5)}}, // first one represents market price and second one connectivity price + BaseFee: []*big.Int{baseFee, baseFee}, + GasUsedRatio: nil, + } + client.On("FeeHistory", mock.Anything, mock.Anything, mock.Anything).Return(feeHistoryResult, nil).Once() + + blockHistoryLength := 2 + cfg := gas.FeeHistoryEstimatorConfig{BlockHistorySize: uint64(blockHistoryLength)} + avrgPriorityFee := big.NewInt(0) + avrgPriorityFee.Add(maxPriorityFeePerGas1, maxPriorityFeePerGas2).Div(avrgPriorityFee, big.NewInt(int64(blockHistoryLength))) + maxFee := (*assets.Wei)(baseFee).AddPercentage(gas.BaseFeeBufferPercentage).Add((*assets.Wei)(avrgPriorityFee)) + + u := gas.NewFeeHistoryEstimator(logger.Test(t), client, cfg, chainID, nil) + err := u.RefreshDynamicPrice() + assert.NoError(t, err) + dynamicFee, err := u.GetDynamicFee(tests.Context(t), maxPrice) + assert.NoError(t, err) + assert.Equal(t, maxFee, dynamicFee.FeeCap) + assert.Equal(t, (*assets.Wei)(avrgPriorityFee), dynamicFee.TipCap) + }) + + t.Run("fails if dynamic prices have not been set yet", func(t *testing.T) { + cfg := gas.FeeHistoryEstimatorConfig{} + + maxPrice := assets.NewWeiI(1) + u := gas.NewFeeHistoryEstimator(logger.Test(t), nil, cfg, chainID, nil) + _, err := u.GetDynamicFee(tests.Context(t), maxPrice) + assert.Error(t, err) + assert.ErrorContains(t, err, "dynamic price not set") + }) + + t.Run("will return max price if tip cap or fee cap exceed it", func(t *testing.T) { + client := mocks.NewFeeHistoryEstimatorClient(t) + baseFee := big.NewInt(1) + maxPriorityFeePerGas := big.NewInt(3) + maxPrice := assets.NewWeiI(2) + + feeHistoryResult := ðereum.FeeHistory{ + OldestBlock: big.NewInt(1), + Reward: [][]*big.Int{{maxPriorityFeePerGas, big.NewInt(5)}}, // first one represents market price and second one connectivity price + BaseFee: []*big.Int{baseFee}, + GasUsedRatio: nil, + } + client.On("FeeHistory", mock.Anything, mock.Anything, mock.Anything).Return(feeHistoryResult, nil).Once() + + cfg := gas.FeeHistoryEstimatorConfig{BlockHistorySize: 1} + + u := gas.NewFeeHistoryEstimator(logger.Test(t), client, cfg, chainID, nil) + err := u.RefreshDynamicPrice() + assert.NoError(t, err) + dynamicFee, err := u.GetDynamicFee(tests.Context(t), maxPrice) + assert.NoError(t, err) + assert.Equal(t, maxPrice, dynamicFee.FeeCap) + assert.Equal(t, maxPrice, dynamicFee.TipCap) + }) +} + +func TestFeeHistoryEstimatorBumpDynamicFee(t *testing.T) { + t.Parallel() + + globalMaxPrice := assets.NewWeiI(100) + chainID := big.NewInt(0) + + t.Run("bumps a previous attempt by BumpPercent", func(t *testing.T) { + client := mocks.NewFeeHistoryEstimatorClient(t) + originalFee := gas.DynamicFee{ + FeeCap: assets.NewWeiI(20), + TipCap: assets.NewWeiI(10), + } + + // These values will be ignored because they are lower prices than the originalFee + feeHistoryResult := ðereum.FeeHistory{ + OldestBlock: big.NewInt(1), + Reward: [][]*big.Int{{big.NewInt(5), big.NewInt(50)}}, // first one represents market price and second one connectivity price + BaseFee: []*big.Int{big.NewInt(5)}, + GasUsedRatio: nil, + } + client.On("FeeHistory", mock.Anything, mock.Anything, mock.Anything).Return(feeHistoryResult, nil).Once() + + cfg := gas.FeeHistoryEstimatorConfig{ + BlockHistorySize: 2, + BumpPercent: 50, + } + + expectedFeeCap := originalFee.FeeCap.AddPercentage(cfg.BumpPercent) + expectedTipCap := originalFee.TipCap.AddPercentage(cfg.BumpPercent) + + u := gas.NewFeeHistoryEstimator(logger.Test(t), client, cfg, chainID, nil) + err := u.RefreshDynamicPrice() + assert.NoError(t, err) + dynamicFee, err := u.BumpDynamicFee(tests.Context(t), originalFee, globalMaxPrice, nil) + assert.NoError(t, err) + assert.Equal(t, expectedFeeCap, dynamicFee.FeeCap) + assert.Equal(t, expectedTipCap, dynamicFee.TipCap) + }) + + t.Run("fails if the original attempt is invalid", func(t *testing.T) { + client := mocks.NewFeeHistoryEstimatorClient(t) + maxPrice := assets.NewWeiI(20) + cfg := gas.FeeHistoryEstimatorConfig{BlockHistorySize: 1} + + u := gas.NewFeeHistoryEstimator(logger.Test(t), client, cfg, chainID, nil) + // nil original fee + var originalFee gas.DynamicFee + _, err := u.BumpDynamicFee(tests.Context(t), originalFee, maxPrice, nil) + assert.Error(t, err) + + // tip cap is higher than fee cap + originalFee = gas.DynamicFee{ + FeeCap: assets.NewWeiI(10), + TipCap: assets.NewWeiI(11), + } + _, err = u.BumpDynamicFee(tests.Context(t), originalFee, maxPrice, nil) + assert.Error(t, err) + + // fee cap is equal or higher to max price + originalFee = gas.DynamicFee{ + FeeCap: assets.NewWeiI(20), + TipCap: assets.NewWeiI(10), + } + _, err = u.BumpDynamicFee(tests.Context(t), originalFee, maxPrice, nil) + assert.Error(t, err) + }) + + t.Run("returns market prices if bumped original fee is lower", func(t *testing.T) { + client := mocks.NewFeeHistoryEstimatorClient(t) + originalFee := gas.DynamicFee{ + FeeCap: assets.NewWeiI(20), + TipCap: assets.NewWeiI(10), + } + + // Market fees + baseFee := big.NewInt(5) + maxPriorityFeePerGas := big.NewInt(33) + feeHistoryResult := ðereum.FeeHistory{ + OldestBlock: big.NewInt(1), + Reward: [][]*big.Int{{maxPriorityFeePerGas, big.NewInt(100)}}, // first one represents market price and second one connectivity price + BaseFee: []*big.Int{baseFee}, + GasUsedRatio: nil, + } + client.On("FeeHistory", mock.Anything, mock.Anything, mock.Anything).Return(feeHistoryResult, nil).Once() + + maxFee := (*assets.Wei)(baseFee).AddPercentage(gas.BaseFeeBufferPercentage).Add((*assets.Wei)(maxPriorityFeePerGas)) + + cfg := gas.FeeHistoryEstimatorConfig{ + BlockHistorySize: 1, + BumpPercent: 50, + } + + u := gas.NewFeeHistoryEstimator(logger.Test(t), client, cfg, chainID, nil) + err := u.RefreshDynamicPrice() + assert.NoError(t, err) + bumpedFee, err := u.BumpDynamicFee(tests.Context(t), originalFee, globalMaxPrice, nil) + assert.NoError(t, err) + assert.Equal(t, (*assets.Wei)(maxPriorityFeePerGas), bumpedFee.TipCap) + assert.Equal(t, maxFee, bumpedFee.FeeCap) + }) + + t.Run("fails if connectivity percentile value is reached", func(t *testing.T) { + client := mocks.NewFeeHistoryEstimatorClient(t) + originalFee := gas.DynamicFee{ + FeeCap: assets.NewWeiI(20), + TipCap: assets.NewWeiI(10), + } + + // Market fees + baseFee := big.NewInt(5) + maxPriorityFeePerGas := big.NewInt(33) + feeHistoryResult := ðereum.FeeHistory{ + OldestBlock: big.NewInt(1), + Reward: [][]*big.Int{{maxPriorityFeePerGas, big.NewInt(30)}}, // first one represents market price and second one connectivity price + BaseFee: []*big.Int{baseFee}, + GasUsedRatio: nil, + } + client.On("FeeHistory", mock.Anything, mock.Anything, mock.Anything).Return(feeHistoryResult, nil).Once() + + cfg := gas.FeeHistoryEstimatorConfig{ + BlockHistorySize: 1, + BumpPercent: 50, + } + + u := gas.NewFeeHistoryEstimator(logger.Test(t), client, cfg, chainID, nil) + err := u.RefreshDynamicPrice() + assert.NoError(t, err) + _, err = u.BumpDynamicFee(tests.Context(t), originalFee, globalMaxPrice, nil) + assert.Error(t, err) + }) + + t.Run("returns max price if the aggregation of max and original bumped fee is higher", func(t *testing.T) { + client := mocks.NewFeeHistoryEstimatorClient(t) + originalFee := gas.DynamicFee{ + FeeCap: assets.NewWeiI(20), + TipCap: assets.NewWeiI(18), + } + + maxPrice := assets.NewWeiI(25) + // Market fees + baseFee := big.NewInt(1) + maxPriorityFeePerGas := big.NewInt(1) + feeHistoryResult := ðereum.FeeHistory{ + OldestBlock: big.NewInt(1), + Reward: [][]*big.Int{{maxPriorityFeePerGas, big.NewInt(30)}}, // first one represents market price and second one connectivity price + BaseFee: []*big.Int{baseFee}, + GasUsedRatio: nil, + } + client.On("FeeHistory", mock.Anything, mock.Anything, mock.Anything).Return(feeHistoryResult, nil).Once() + + cfg := gas.FeeHistoryEstimatorConfig{ + BlockHistorySize: 1, + BumpPercent: 50, + } + + u := gas.NewFeeHistoryEstimator(logger.Test(t), client, cfg, chainID, nil) + err := u.RefreshDynamicPrice() + assert.NoError(t, err) + bumpedFee, err := u.BumpDynamicFee(tests.Context(t), originalFee, maxPrice, nil) + assert.NoError(t, err) + assert.Equal(t, maxPrice, bumpedFee.TipCap) + assert.Equal(t, maxPrice, bumpedFee.FeeCap) + }) + + t.Run("fails if the bumped gas price is lower than the minimum bump percentage", func(t *testing.T) { + client := mocks.NewFeeHistoryEstimatorClient(t) + originalFee := gas.DynamicFee{ + FeeCap: assets.NewWeiI(20), + TipCap: assets.NewWeiI(18), + } + + maxPrice := assets.NewWeiI(21) + // Market fees + baseFee := big.NewInt(1) + maxPriorityFeePerGas := big.NewInt(1) + feeHistoryResult := ðereum.FeeHistory{ + OldestBlock: big.NewInt(1), + Reward: [][]*big.Int{{maxPriorityFeePerGas, big.NewInt(30)}}, // first one represents market price and second one connectivity price + BaseFee: []*big.Int{baseFee}, + GasUsedRatio: nil, + } + client.On("FeeHistory", mock.Anything, mock.Anything, mock.Anything).Return(feeHistoryResult, nil).Once() + + cfg := gas.FeeHistoryEstimatorConfig{ + BlockHistorySize: 1, + BumpPercent: 50, + } + + u := gas.NewFeeHistoryEstimator(logger.Test(t), client, cfg, chainID, nil) + err := u.RefreshDynamicPrice() + assert.NoError(t, err) + _, err = u.BumpDynamicFee(tests.Context(t), originalFee, maxPrice, nil) + assert.Error(t, err) + }) + + t.Run("ignores maxPriorityFeePerGas if there is no mempool and forces refetch", func(t *testing.T) { + client := mocks.NewFeeHistoryEstimatorClient(t) + originalFee := gas.DynamicFee{ + FeeCap: assets.NewWeiI(40), + TipCap: assets.NewWeiI(0), + } + + // Market fees + baseFee := big.NewInt(10) + maxPriorityFeePerGas := big.NewInt(0) + feeHistoryResult := ðereum.FeeHistory{ + OldestBlock: big.NewInt(1), + Reward: [][]*big.Int{{maxPriorityFeePerGas, big.NewInt(0)}}, // first one represents market price and second one connectivity price + BaseFee: []*big.Int{baseFee}, + GasUsedRatio: nil, + } + client.On("FeeHistory", mock.Anything, mock.Anything, mock.Anything).Return(feeHistoryResult, nil) + + cfg := gas.FeeHistoryEstimatorConfig{ + BlockHistorySize: 0, + BumpPercent: 20, + CacheTimeout: 10 * time.Second, + EIP1559: true, + } + + maxFeePerGas := assets.NewWei(baseFee).AddPercentage(gas.BaseFeeBufferPercentage) + u := gas.NewFeeHistoryEstimator(logger.Test(t), client, cfg, chainID, nil) + servicetest.RunHealthy(t, u) + bumpedFee, err := u.BumpDynamicFee(tests.Context(t), originalFee, globalMaxPrice, nil) + assert.NoError(t, err) + assert.Equal(t, assets.NewWeiI(0), (*assets.Wei)(maxPriorityFeePerGas)) + assert.Equal(t, maxFeePerGas, bumpedFee.FeeCap) + }) +} diff --git a/core/chains/evm/gas/helpers_test.go b/core/chains/evm/gas/helpers_test.go index 2c12ed426a6..0c9a74a18dc 100644 --- a/core/chains/evm/gas/helpers_test.go +++ b/core/chains/evm/gas/helpers_test.go @@ -157,6 +157,7 @@ type MockGasEstimatorConfig struct { FeeCapDefaultF *assets.Wei LimitMaxF uint64 ModeF string + EstimateLimitF bool } func NewMockGasConfig() *MockGasEstimatorConfig { @@ -214,3 +215,7 @@ func (m *MockGasEstimatorConfig) LimitMax() uint64 { func (m *MockGasEstimatorConfig) Mode() string { return m.ModeF } + +func (m *MockGasEstimatorConfig) EstimateLimit() bool { + return m.EstimateLimitF +} diff --git a/core/chains/evm/gas/mocks/config.go b/core/chains/evm/gas/mocks/config.go index b4a5e40f2f7..95c3eda171d 100644 --- a/core/chains/evm/gas/mocks/config.go +++ b/core/chains/evm/gas/mocks/config.go @@ -13,6 +13,14 @@ type Config struct { mock.Mock } +type Config_Expecter struct { + mock *mock.Mock +} + +func (_m *Config) EXPECT() *Config_Expecter { + return &Config_Expecter{mock: &_m.Mock} +} + // ChainType provides a mock function with given fields: func (_m *Config) ChainType() chaintype.ChainType { ret := _m.Called() @@ -31,6 +39,33 @@ func (_m *Config) ChainType() chaintype.ChainType { return r0 } +// Config_ChainType_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ChainType' +type Config_ChainType_Call struct { + *mock.Call +} + +// ChainType is a helper method to define mock.On call +func (_e *Config_Expecter) ChainType() *Config_ChainType_Call { + return &Config_ChainType_Call{Call: _e.mock.On("ChainType")} +} + +func (_c *Config_ChainType_Call) Run(run func()) *Config_ChainType_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Config_ChainType_Call) Return(_a0 chaintype.ChainType) *Config_ChainType_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Config_ChainType_Call) RunAndReturn(run func() chaintype.ChainType) *Config_ChainType_Call { + _c.Call.Return(run) + return _c +} + // FinalityDepth provides a mock function with given fields: func (_m *Config) FinalityDepth() uint32 { ret := _m.Called() @@ -49,6 +84,33 @@ func (_m *Config) FinalityDepth() uint32 { return r0 } +// Config_FinalityDepth_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FinalityDepth' +type Config_FinalityDepth_Call struct { + *mock.Call +} + +// FinalityDepth is a helper method to define mock.On call +func (_e *Config_Expecter) FinalityDepth() *Config_FinalityDepth_Call { + return &Config_FinalityDepth_Call{Call: _e.mock.On("FinalityDepth")} +} + +func (_c *Config_FinalityDepth_Call) Run(run func()) *Config_FinalityDepth_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Config_FinalityDepth_Call) Return(_a0 uint32) *Config_FinalityDepth_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Config_FinalityDepth_Call) RunAndReturn(run func() uint32) *Config_FinalityDepth_Call { + _c.Call.Return(run) + return _c +} + // FinalityTagEnabled provides a mock function with given fields: func (_m *Config) FinalityTagEnabled() bool { ret := _m.Called() @@ -67,6 +129,33 @@ func (_m *Config) FinalityTagEnabled() bool { return r0 } +// Config_FinalityTagEnabled_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FinalityTagEnabled' +type Config_FinalityTagEnabled_Call struct { + *mock.Call +} + +// FinalityTagEnabled is a helper method to define mock.On call +func (_e *Config_Expecter) FinalityTagEnabled() *Config_FinalityTagEnabled_Call { + return &Config_FinalityTagEnabled_Call{Call: _e.mock.On("FinalityTagEnabled")} +} + +func (_c *Config_FinalityTagEnabled_Call) Run(run func()) *Config_FinalityTagEnabled_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Config_FinalityTagEnabled_Call) Return(_a0 bool) *Config_FinalityTagEnabled_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Config_FinalityTagEnabled_Call) RunAndReturn(run func() bool) *Config_FinalityTagEnabled_Call { + _c.Call.Return(run) + return _c +} + // NewConfig creates a new instance of Config. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewConfig(t interface { diff --git a/core/chains/evm/gas/mocks/eth_client.go b/core/chains/evm/gas/mocks/eth_client.go deleted file mode 100644 index a8cc5afa8d9..00000000000 --- a/core/chains/evm/gas/mocks/eth_client.go +++ /dev/null @@ -1,61 +0,0 @@ -// Code generated by mockery v2.42.2. DO NOT EDIT. - -package mocks - -import ( - context "context" - big "math/big" - - ethereum "github.com/ethereum/go-ethereum" - - mock "github.com/stretchr/testify/mock" -) - -// ETHClient is an autogenerated mock type for the ethClient type -type ETHClient struct { - mock.Mock -} - -// CallContract provides a mock function with given fields: ctx, msg, blockNumber -func (_m *ETHClient) CallContract(ctx context.Context, msg ethereum.CallMsg, blockNumber *big.Int) ([]byte, error) { - ret := _m.Called(ctx, msg, blockNumber) - - if len(ret) == 0 { - panic("no return value specified for CallContract") - } - - var r0 []byte - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, ethereum.CallMsg, *big.Int) ([]byte, error)); ok { - return rf(ctx, msg, blockNumber) - } - if rf, ok := ret.Get(0).(func(context.Context, ethereum.CallMsg, *big.Int) []byte); ok { - r0 = rf(ctx, msg, blockNumber) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]byte) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, ethereum.CallMsg, *big.Int) error); ok { - r1 = rf(ctx, msg, blockNumber) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// NewETHClient creates a new instance of ETHClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewETHClient(t interface { - mock.TestingT - Cleanup(func()) -}) *ETHClient { - mock := ÐClient{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/core/chains/evm/gas/mocks/evm_estimator.go b/core/chains/evm/gas/mocks/evm_estimator.go index 8c8693413f1..12e2f934c48 100644 --- a/core/chains/evm/gas/mocks/evm_estimator.go +++ b/core/chains/evm/gas/mocks/evm_estimator.go @@ -23,6 +23,14 @@ type EvmEstimator struct { mock.Mock } +type EvmEstimator_Expecter struct { + mock *mock.Mock +} + +func (_m *EvmEstimator) EXPECT() *EvmEstimator_Expecter { + return &EvmEstimator_Expecter{mock: &_m.Mock} +} + // BumpDynamicFee provides a mock function with given fields: ctx, original, maxGasPriceWei, attempts func (_m *EvmEstimator) BumpDynamicFee(ctx context.Context, original gas.DynamicFee, maxGasPriceWei *assets.Wei, attempts []gas.EvmPriorAttempt) (gas.DynamicFee, error) { ret := _m.Called(ctx, original, maxGasPriceWei, attempts) @@ -51,6 +59,37 @@ func (_m *EvmEstimator) BumpDynamicFee(ctx context.Context, original gas.Dynamic return r0, r1 } +// EvmEstimator_BumpDynamicFee_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BumpDynamicFee' +type EvmEstimator_BumpDynamicFee_Call struct { + *mock.Call +} + +// BumpDynamicFee is a helper method to define mock.On call +// - ctx context.Context +// - original gas.DynamicFee +// - maxGasPriceWei *assets.Wei +// - attempts []gas.EvmPriorAttempt +func (_e *EvmEstimator_Expecter) BumpDynamicFee(ctx interface{}, original interface{}, maxGasPriceWei interface{}, attempts interface{}) *EvmEstimator_BumpDynamicFee_Call { + return &EvmEstimator_BumpDynamicFee_Call{Call: _e.mock.On("BumpDynamicFee", ctx, original, maxGasPriceWei, attempts)} +} + +func (_c *EvmEstimator_BumpDynamicFee_Call) Run(run func(ctx context.Context, original gas.DynamicFee, maxGasPriceWei *assets.Wei, attempts []gas.EvmPriorAttempt)) *EvmEstimator_BumpDynamicFee_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(gas.DynamicFee), args[2].(*assets.Wei), args[3].([]gas.EvmPriorAttempt)) + }) + return _c +} + +func (_c *EvmEstimator_BumpDynamicFee_Call) Return(bumped gas.DynamicFee, err error) *EvmEstimator_BumpDynamicFee_Call { + _c.Call.Return(bumped, err) + return _c +} + +func (_c *EvmEstimator_BumpDynamicFee_Call) RunAndReturn(run func(context.Context, gas.DynamicFee, *assets.Wei, []gas.EvmPriorAttempt) (gas.DynamicFee, error)) *EvmEstimator_BumpDynamicFee_Call { + _c.Call.Return(run) + return _c +} + // BumpLegacyGas provides a mock function with given fields: ctx, originalGasPrice, gasLimit, maxGasPriceWei, attempts func (_m *EvmEstimator) BumpLegacyGas(ctx context.Context, originalGasPrice *assets.Wei, gasLimit uint64, maxGasPriceWei *assets.Wei, attempts []gas.EvmPriorAttempt) (*assets.Wei, uint64, error) { ret := _m.Called(ctx, originalGasPrice, gasLimit, maxGasPriceWei, attempts) @@ -88,6 +127,38 @@ func (_m *EvmEstimator) BumpLegacyGas(ctx context.Context, originalGasPrice *ass return r0, r1, r2 } +// EvmEstimator_BumpLegacyGas_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BumpLegacyGas' +type EvmEstimator_BumpLegacyGas_Call struct { + *mock.Call +} + +// BumpLegacyGas is a helper method to define mock.On call +// - ctx context.Context +// - originalGasPrice *assets.Wei +// - gasLimit uint64 +// - maxGasPriceWei *assets.Wei +// - attempts []gas.EvmPriorAttempt +func (_e *EvmEstimator_Expecter) BumpLegacyGas(ctx interface{}, originalGasPrice interface{}, gasLimit interface{}, maxGasPriceWei interface{}, attempts interface{}) *EvmEstimator_BumpLegacyGas_Call { + return &EvmEstimator_BumpLegacyGas_Call{Call: _e.mock.On("BumpLegacyGas", ctx, originalGasPrice, gasLimit, maxGasPriceWei, attempts)} +} + +func (_c *EvmEstimator_BumpLegacyGas_Call) Run(run func(ctx context.Context, originalGasPrice *assets.Wei, gasLimit uint64, maxGasPriceWei *assets.Wei, attempts []gas.EvmPriorAttempt)) *EvmEstimator_BumpLegacyGas_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*assets.Wei), args[2].(uint64), args[3].(*assets.Wei), args[4].([]gas.EvmPriorAttempt)) + }) + return _c +} + +func (_c *EvmEstimator_BumpLegacyGas_Call) Return(bumpedGasPrice *assets.Wei, chainSpecificGasLimit uint64, err error) *EvmEstimator_BumpLegacyGas_Call { + _c.Call.Return(bumpedGasPrice, chainSpecificGasLimit, err) + return _c +} + +func (_c *EvmEstimator_BumpLegacyGas_Call) RunAndReturn(run func(context.Context, *assets.Wei, uint64, *assets.Wei, []gas.EvmPriorAttempt) (*assets.Wei, uint64, error)) *EvmEstimator_BumpLegacyGas_Call { + _c.Call.Return(run) + return _c +} + // Close provides a mock function with given fields: func (_m *EvmEstimator) Close() error { ret := _m.Called() @@ -106,6 +177,33 @@ func (_m *EvmEstimator) Close() error { return r0 } +// EvmEstimator_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close' +type EvmEstimator_Close_Call struct { + *mock.Call +} + +// Close is a helper method to define mock.On call +func (_e *EvmEstimator_Expecter) Close() *EvmEstimator_Close_Call { + return &EvmEstimator_Close_Call{Call: _e.mock.On("Close")} +} + +func (_c *EvmEstimator_Close_Call) Run(run func()) *EvmEstimator_Close_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *EvmEstimator_Close_Call) Return(_a0 error) *EvmEstimator_Close_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *EvmEstimator_Close_Call) RunAndReturn(run func() error) *EvmEstimator_Close_Call { + _c.Call.Return(run) + return _c +} + // GetDynamicFee provides a mock function with given fields: ctx, maxGasPriceWei func (_m *EvmEstimator) GetDynamicFee(ctx context.Context, maxGasPriceWei *assets.Wei) (gas.DynamicFee, error) { ret := _m.Called(ctx, maxGasPriceWei) @@ -134,6 +232,35 @@ func (_m *EvmEstimator) GetDynamicFee(ctx context.Context, maxGasPriceWei *asset return r0, r1 } +// EvmEstimator_GetDynamicFee_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetDynamicFee' +type EvmEstimator_GetDynamicFee_Call struct { + *mock.Call +} + +// GetDynamicFee is a helper method to define mock.On call +// - ctx context.Context +// - maxGasPriceWei *assets.Wei +func (_e *EvmEstimator_Expecter) GetDynamicFee(ctx interface{}, maxGasPriceWei interface{}) *EvmEstimator_GetDynamicFee_Call { + return &EvmEstimator_GetDynamicFee_Call{Call: _e.mock.On("GetDynamicFee", ctx, maxGasPriceWei)} +} + +func (_c *EvmEstimator_GetDynamicFee_Call) Run(run func(ctx context.Context, maxGasPriceWei *assets.Wei)) *EvmEstimator_GetDynamicFee_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*assets.Wei)) + }) + return _c +} + +func (_c *EvmEstimator_GetDynamicFee_Call) Return(fee gas.DynamicFee, err error) *EvmEstimator_GetDynamicFee_Call { + _c.Call.Return(fee, err) + return _c +} + +func (_c *EvmEstimator_GetDynamicFee_Call) RunAndReturn(run func(context.Context, *assets.Wei) (gas.DynamicFee, error)) *EvmEstimator_GetDynamicFee_Call { + _c.Call.Return(run) + return _c +} + // GetLegacyGas provides a mock function with given fields: ctx, calldata, gasLimit, maxGasPriceWei, opts func (_m *EvmEstimator) GetLegacyGas(ctx context.Context, calldata []byte, gasLimit uint64, maxGasPriceWei *assets.Wei, opts ...types.Opt) (*assets.Wei, uint64, error) { _va := make([]interface{}, len(opts)) @@ -178,6 +305,45 @@ func (_m *EvmEstimator) GetLegacyGas(ctx context.Context, calldata []byte, gasLi return r0, r1, r2 } +// EvmEstimator_GetLegacyGas_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetLegacyGas' +type EvmEstimator_GetLegacyGas_Call struct { + *mock.Call +} + +// GetLegacyGas is a helper method to define mock.On call +// - ctx context.Context +// - calldata []byte +// - gasLimit uint64 +// - maxGasPriceWei *assets.Wei +// - opts ...types.Opt +func (_e *EvmEstimator_Expecter) GetLegacyGas(ctx interface{}, calldata interface{}, gasLimit interface{}, maxGasPriceWei interface{}, opts ...interface{}) *EvmEstimator_GetLegacyGas_Call { + return &EvmEstimator_GetLegacyGas_Call{Call: _e.mock.On("GetLegacyGas", + append([]interface{}{ctx, calldata, gasLimit, maxGasPriceWei}, opts...)...)} +} + +func (_c *EvmEstimator_GetLegacyGas_Call) Run(run func(ctx context.Context, calldata []byte, gasLimit uint64, maxGasPriceWei *assets.Wei, opts ...types.Opt)) *EvmEstimator_GetLegacyGas_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]types.Opt, len(args)-4) + for i, a := range args[4:] { + if a != nil { + variadicArgs[i] = a.(types.Opt) + } + } + run(args[0].(context.Context), args[1].([]byte), args[2].(uint64), args[3].(*assets.Wei), variadicArgs...) + }) + return _c +} + +func (_c *EvmEstimator_GetLegacyGas_Call) Return(gasPrice *assets.Wei, chainSpecificGasLimit uint64, err error) *EvmEstimator_GetLegacyGas_Call { + _c.Call.Return(gasPrice, chainSpecificGasLimit, err) + return _c +} + +func (_c *EvmEstimator_GetLegacyGas_Call) RunAndReturn(run func(context.Context, []byte, uint64, *assets.Wei, ...types.Opt) (*assets.Wei, uint64, error)) *EvmEstimator_GetLegacyGas_Call { + _c.Call.Return(run) + return _c +} + // HealthReport provides a mock function with given fields: func (_m *EvmEstimator) HealthReport() map[string]error { ret := _m.Called() @@ -198,6 +364,33 @@ func (_m *EvmEstimator) HealthReport() map[string]error { return r0 } +// EvmEstimator_HealthReport_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HealthReport' +type EvmEstimator_HealthReport_Call struct { + *mock.Call +} + +// HealthReport is a helper method to define mock.On call +func (_e *EvmEstimator_Expecter) HealthReport() *EvmEstimator_HealthReport_Call { + return &EvmEstimator_HealthReport_Call{Call: _e.mock.On("HealthReport")} +} + +func (_c *EvmEstimator_HealthReport_Call) Run(run func()) *EvmEstimator_HealthReport_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *EvmEstimator_HealthReport_Call) Return(_a0 map[string]error) *EvmEstimator_HealthReport_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *EvmEstimator_HealthReport_Call) RunAndReturn(run func() map[string]error) *EvmEstimator_HealthReport_Call { + _c.Call.Return(run) + return _c +} + // L1Oracle provides a mock function with given fields: func (_m *EvmEstimator) L1Oracle() rollups.L1Oracle { ret := _m.Called() @@ -218,6 +411,33 @@ func (_m *EvmEstimator) L1Oracle() rollups.L1Oracle { return r0 } +// EvmEstimator_L1Oracle_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'L1Oracle' +type EvmEstimator_L1Oracle_Call struct { + *mock.Call +} + +// L1Oracle is a helper method to define mock.On call +func (_e *EvmEstimator_Expecter) L1Oracle() *EvmEstimator_L1Oracle_Call { + return &EvmEstimator_L1Oracle_Call{Call: _e.mock.On("L1Oracle")} +} + +func (_c *EvmEstimator_L1Oracle_Call) Run(run func()) *EvmEstimator_L1Oracle_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *EvmEstimator_L1Oracle_Call) Return(_a0 rollups.L1Oracle) *EvmEstimator_L1Oracle_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *EvmEstimator_L1Oracle_Call) RunAndReturn(run func() rollups.L1Oracle) *EvmEstimator_L1Oracle_Call { + _c.Call.Return(run) + return _c +} + // Name provides a mock function with given fields: func (_m *EvmEstimator) Name() string { ret := _m.Called() @@ -236,11 +456,67 @@ func (_m *EvmEstimator) Name() string { return r0 } +// EvmEstimator_Name_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Name' +type EvmEstimator_Name_Call struct { + *mock.Call +} + +// Name is a helper method to define mock.On call +func (_e *EvmEstimator_Expecter) Name() *EvmEstimator_Name_Call { + return &EvmEstimator_Name_Call{Call: _e.mock.On("Name")} +} + +func (_c *EvmEstimator_Name_Call) Run(run func()) *EvmEstimator_Name_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *EvmEstimator_Name_Call) Return(_a0 string) *EvmEstimator_Name_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *EvmEstimator_Name_Call) RunAndReturn(run func() string) *EvmEstimator_Name_Call { + _c.Call.Return(run) + return _c +} + // OnNewLongestChain provides a mock function with given fields: ctx, head func (_m *EvmEstimator) OnNewLongestChain(ctx context.Context, head *evmtypes.Head) { _m.Called(ctx, head) } +// EvmEstimator_OnNewLongestChain_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OnNewLongestChain' +type EvmEstimator_OnNewLongestChain_Call struct { + *mock.Call +} + +// OnNewLongestChain is a helper method to define mock.On call +// - ctx context.Context +// - head *evmtypes.Head +func (_e *EvmEstimator_Expecter) OnNewLongestChain(ctx interface{}, head interface{}) *EvmEstimator_OnNewLongestChain_Call { + return &EvmEstimator_OnNewLongestChain_Call{Call: _e.mock.On("OnNewLongestChain", ctx, head)} +} + +func (_c *EvmEstimator_OnNewLongestChain_Call) Run(run func(ctx context.Context, head *evmtypes.Head)) *EvmEstimator_OnNewLongestChain_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*evmtypes.Head)) + }) + return _c +} + +func (_c *EvmEstimator_OnNewLongestChain_Call) Return() *EvmEstimator_OnNewLongestChain_Call { + _c.Call.Return() + return _c +} + +func (_c *EvmEstimator_OnNewLongestChain_Call) RunAndReturn(run func(context.Context, *evmtypes.Head)) *EvmEstimator_OnNewLongestChain_Call { + _c.Call.Return(run) + return _c +} + // Ready provides a mock function with given fields: func (_m *EvmEstimator) Ready() error { ret := _m.Called() @@ -259,6 +535,33 @@ func (_m *EvmEstimator) Ready() error { return r0 } +// EvmEstimator_Ready_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Ready' +type EvmEstimator_Ready_Call struct { + *mock.Call +} + +// Ready is a helper method to define mock.On call +func (_e *EvmEstimator_Expecter) Ready() *EvmEstimator_Ready_Call { + return &EvmEstimator_Ready_Call{Call: _e.mock.On("Ready")} +} + +func (_c *EvmEstimator_Ready_Call) Run(run func()) *EvmEstimator_Ready_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *EvmEstimator_Ready_Call) Return(_a0 error) *EvmEstimator_Ready_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *EvmEstimator_Ready_Call) RunAndReturn(run func() error) *EvmEstimator_Ready_Call { + _c.Call.Return(run) + return _c +} + // Start provides a mock function with given fields: _a0 func (_m *EvmEstimator) Start(_a0 context.Context) error { ret := _m.Called(_a0) @@ -277,6 +580,34 @@ func (_m *EvmEstimator) Start(_a0 context.Context) error { return r0 } +// EvmEstimator_Start_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Start' +type EvmEstimator_Start_Call struct { + *mock.Call +} + +// Start is a helper method to define mock.On call +// - _a0 context.Context +func (_e *EvmEstimator_Expecter) Start(_a0 interface{}) *EvmEstimator_Start_Call { + return &EvmEstimator_Start_Call{Call: _e.mock.On("Start", _a0)} +} + +func (_c *EvmEstimator_Start_Call) Run(run func(_a0 context.Context)) *EvmEstimator_Start_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *EvmEstimator_Start_Call) Return(_a0 error) *EvmEstimator_Start_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *EvmEstimator_Start_Call) RunAndReturn(run func(context.Context) error) *EvmEstimator_Start_Call { + _c.Call.Return(run) + return _c +} + // NewEvmEstimator creates a new instance of EvmEstimator. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewEvmEstimator(t interface { diff --git a/core/chains/evm/gas/mocks/evm_fee_estimator.go b/core/chains/evm/gas/mocks/evm_fee_estimator.go index 73821335617..a7deca2c639 100644 --- a/core/chains/evm/gas/mocks/evm_fee_estimator.go +++ b/core/chains/evm/gas/mocks/evm_fee_estimator.go @@ -7,6 +7,8 @@ import ( assets "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" + common "github.com/ethereum/go-ethereum/common" + context "context" evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" @@ -25,6 +27,14 @@ type EvmFeeEstimator struct { mock.Mock } +type EvmFeeEstimator_Expecter struct { + mock *mock.Mock +} + +func (_m *EvmFeeEstimator) EXPECT() *EvmFeeEstimator_Expecter { + return &EvmFeeEstimator_Expecter{mock: &_m.Mock} +} + // BumpFee provides a mock function with given fields: ctx, originalFee, feeLimit, maxFeePrice, attempts func (_m *EvmFeeEstimator) BumpFee(ctx context.Context, originalFee gas.EvmFee, feeLimit uint64, maxFeePrice *assets.Wei, attempts []gas.EvmPriorAttempt) (gas.EvmFee, uint64, error) { ret := _m.Called(ctx, originalFee, feeLimit, maxFeePrice, attempts) @@ -60,6 +70,38 @@ func (_m *EvmFeeEstimator) BumpFee(ctx context.Context, originalFee gas.EvmFee, return r0, r1, r2 } +// EvmFeeEstimator_BumpFee_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BumpFee' +type EvmFeeEstimator_BumpFee_Call struct { + *mock.Call +} + +// BumpFee is a helper method to define mock.On call +// - ctx context.Context +// - originalFee gas.EvmFee +// - feeLimit uint64 +// - maxFeePrice *assets.Wei +// - attempts []gas.EvmPriorAttempt +func (_e *EvmFeeEstimator_Expecter) BumpFee(ctx interface{}, originalFee interface{}, feeLimit interface{}, maxFeePrice interface{}, attempts interface{}) *EvmFeeEstimator_BumpFee_Call { + return &EvmFeeEstimator_BumpFee_Call{Call: _e.mock.On("BumpFee", ctx, originalFee, feeLimit, maxFeePrice, attempts)} +} + +func (_c *EvmFeeEstimator_BumpFee_Call) Run(run func(ctx context.Context, originalFee gas.EvmFee, feeLimit uint64, maxFeePrice *assets.Wei, attempts []gas.EvmPriorAttempt)) *EvmFeeEstimator_BumpFee_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(gas.EvmFee), args[2].(uint64), args[3].(*assets.Wei), args[4].([]gas.EvmPriorAttempt)) + }) + return _c +} + +func (_c *EvmFeeEstimator_BumpFee_Call) Return(bumpedFee gas.EvmFee, chainSpecificFeeLimit uint64, err error) *EvmFeeEstimator_BumpFee_Call { + _c.Call.Return(bumpedFee, chainSpecificFeeLimit, err) + return _c +} + +func (_c *EvmFeeEstimator_BumpFee_Call) RunAndReturn(run func(context.Context, gas.EvmFee, uint64, *assets.Wei, []gas.EvmPriorAttempt) (gas.EvmFee, uint64, error)) *EvmFeeEstimator_BumpFee_Call { + _c.Call.Return(run) + return _c +} + // Close provides a mock function with given fields: func (_m *EvmFeeEstimator) Close() error { ret := _m.Called() @@ -78,14 +120,41 @@ func (_m *EvmFeeEstimator) Close() error { return r0 } -// GetFee provides a mock function with given fields: ctx, calldata, feeLimit, maxFeePrice, opts -func (_m *EvmFeeEstimator) GetFee(ctx context.Context, calldata []byte, feeLimit uint64, maxFeePrice *assets.Wei, opts ...types.Opt) (gas.EvmFee, uint64, error) { +// EvmFeeEstimator_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close' +type EvmFeeEstimator_Close_Call struct { + *mock.Call +} + +// Close is a helper method to define mock.On call +func (_e *EvmFeeEstimator_Expecter) Close() *EvmFeeEstimator_Close_Call { + return &EvmFeeEstimator_Close_Call{Call: _e.mock.On("Close")} +} + +func (_c *EvmFeeEstimator_Close_Call) Run(run func()) *EvmFeeEstimator_Close_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *EvmFeeEstimator_Close_Call) Return(_a0 error) *EvmFeeEstimator_Close_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *EvmFeeEstimator_Close_Call) RunAndReturn(run func() error) *EvmFeeEstimator_Close_Call { + _c.Call.Return(run) + return _c +} + +// GetFee provides a mock function with given fields: ctx, calldata, feeLimit, maxFeePrice, fromAddress, toAddress, opts +func (_m *EvmFeeEstimator) GetFee(ctx context.Context, calldata []byte, feeLimit uint64, maxFeePrice *assets.Wei, fromAddress *common.Address, toAddress *common.Address, opts ...types.Opt) (gas.EvmFee, uint64, error) { _va := make([]interface{}, len(opts)) for _i := range opts { _va[_i] = opts[_i] } var _ca []interface{} - _ca = append(_ca, ctx, calldata, feeLimit, maxFeePrice) + _ca = append(_ca, ctx, calldata, feeLimit, maxFeePrice, fromAddress, toAddress) _ca = append(_ca, _va...) ret := _m.Called(_ca...) @@ -96,23 +165,23 @@ func (_m *EvmFeeEstimator) GetFee(ctx context.Context, calldata []byte, feeLimit var r0 gas.EvmFee var r1 uint64 var r2 error - if rf, ok := ret.Get(0).(func(context.Context, []byte, uint64, *assets.Wei, ...types.Opt) (gas.EvmFee, uint64, error)); ok { - return rf(ctx, calldata, feeLimit, maxFeePrice, opts...) + if rf, ok := ret.Get(0).(func(context.Context, []byte, uint64, *assets.Wei, *common.Address, *common.Address, ...types.Opt) (gas.EvmFee, uint64, error)); ok { + return rf(ctx, calldata, feeLimit, maxFeePrice, fromAddress, toAddress, opts...) } - if rf, ok := ret.Get(0).(func(context.Context, []byte, uint64, *assets.Wei, ...types.Opt) gas.EvmFee); ok { - r0 = rf(ctx, calldata, feeLimit, maxFeePrice, opts...) + if rf, ok := ret.Get(0).(func(context.Context, []byte, uint64, *assets.Wei, *common.Address, *common.Address, ...types.Opt) gas.EvmFee); ok { + r0 = rf(ctx, calldata, feeLimit, maxFeePrice, fromAddress, toAddress, opts...) } else { r0 = ret.Get(0).(gas.EvmFee) } - if rf, ok := ret.Get(1).(func(context.Context, []byte, uint64, *assets.Wei, ...types.Opt) uint64); ok { - r1 = rf(ctx, calldata, feeLimit, maxFeePrice, opts...) + if rf, ok := ret.Get(1).(func(context.Context, []byte, uint64, *assets.Wei, *common.Address, *common.Address, ...types.Opt) uint64); ok { + r1 = rf(ctx, calldata, feeLimit, maxFeePrice, fromAddress, toAddress, opts...) } else { r1 = ret.Get(1).(uint64) } - if rf, ok := ret.Get(2).(func(context.Context, []byte, uint64, *assets.Wei, ...types.Opt) error); ok { - r2 = rf(ctx, calldata, feeLimit, maxFeePrice, opts...) + if rf, ok := ret.Get(2).(func(context.Context, []byte, uint64, *assets.Wei, *common.Address, *common.Address, ...types.Opt) error); ok { + r2 = rf(ctx, calldata, feeLimit, maxFeePrice, fromAddress, toAddress, opts...) } else { r2 = ret.Error(2) } @@ -120,14 +189,55 @@ func (_m *EvmFeeEstimator) GetFee(ctx context.Context, calldata []byte, feeLimit return r0, r1, r2 } -// GetMaxCost provides a mock function with given fields: ctx, amount, calldata, feeLimit, maxFeePrice, opts -func (_m *EvmFeeEstimator) GetMaxCost(ctx context.Context, amount assets.Eth, calldata []byte, feeLimit uint64, maxFeePrice *assets.Wei, opts ...types.Opt) (*big.Int, error) { +// EvmFeeEstimator_GetFee_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetFee' +type EvmFeeEstimator_GetFee_Call struct { + *mock.Call +} + +// GetFee is a helper method to define mock.On call +// - ctx context.Context +// - calldata []byte +// - feeLimit uint64 +// - maxFeePrice *assets.Wei +// - fromAddress *common.Address +// - toAddress *common.Address +// - opts ...types.Opt +func (_e *EvmFeeEstimator_Expecter) GetFee(ctx interface{}, calldata interface{}, feeLimit interface{}, maxFeePrice interface{}, fromAddress interface{}, toAddress interface{}, opts ...interface{}) *EvmFeeEstimator_GetFee_Call { + return &EvmFeeEstimator_GetFee_Call{Call: _e.mock.On("GetFee", + append([]interface{}{ctx, calldata, feeLimit, maxFeePrice, fromAddress, toAddress}, opts...)...)} +} + +func (_c *EvmFeeEstimator_GetFee_Call) Run(run func(ctx context.Context, calldata []byte, feeLimit uint64, maxFeePrice *assets.Wei, fromAddress *common.Address, toAddress *common.Address, opts ...types.Opt)) *EvmFeeEstimator_GetFee_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]types.Opt, len(args)-6) + for i, a := range args[6:] { + if a != nil { + variadicArgs[i] = a.(types.Opt) + } + } + run(args[0].(context.Context), args[1].([]byte), args[2].(uint64), args[3].(*assets.Wei), args[4].(*common.Address), args[5].(*common.Address), variadicArgs...) + }) + return _c +} + +func (_c *EvmFeeEstimator_GetFee_Call) Return(fee gas.EvmFee, estimatedFeeLimit uint64, err error) *EvmFeeEstimator_GetFee_Call { + _c.Call.Return(fee, estimatedFeeLimit, err) + return _c +} + +func (_c *EvmFeeEstimator_GetFee_Call) RunAndReturn(run func(context.Context, []byte, uint64, *assets.Wei, *common.Address, *common.Address, ...types.Opt) (gas.EvmFee, uint64, error)) *EvmFeeEstimator_GetFee_Call { + _c.Call.Return(run) + return _c +} + +// GetMaxCost provides a mock function with given fields: ctx, amount, calldata, feeLimit, maxFeePrice, fromAddress, toAddress, opts +func (_m *EvmFeeEstimator) GetMaxCost(ctx context.Context, amount assets.Eth, calldata []byte, feeLimit uint64, maxFeePrice *assets.Wei, fromAddress *common.Address, toAddress *common.Address, opts ...types.Opt) (*big.Int, error) { _va := make([]interface{}, len(opts)) for _i := range opts { _va[_i] = opts[_i] } var _ca []interface{} - _ca = append(_ca, ctx, amount, calldata, feeLimit, maxFeePrice) + _ca = append(_ca, ctx, amount, calldata, feeLimit, maxFeePrice, fromAddress, toAddress) _ca = append(_ca, _va...) ret := _m.Called(_ca...) @@ -137,19 +247,19 @@ func (_m *EvmFeeEstimator) GetMaxCost(ctx context.Context, amount assets.Eth, ca var r0 *big.Int var r1 error - if rf, ok := ret.Get(0).(func(context.Context, assets.Eth, []byte, uint64, *assets.Wei, ...types.Opt) (*big.Int, error)); ok { - return rf(ctx, amount, calldata, feeLimit, maxFeePrice, opts...) + if rf, ok := ret.Get(0).(func(context.Context, assets.Eth, []byte, uint64, *assets.Wei, *common.Address, *common.Address, ...types.Opt) (*big.Int, error)); ok { + return rf(ctx, amount, calldata, feeLimit, maxFeePrice, fromAddress, toAddress, opts...) } - if rf, ok := ret.Get(0).(func(context.Context, assets.Eth, []byte, uint64, *assets.Wei, ...types.Opt) *big.Int); ok { - r0 = rf(ctx, amount, calldata, feeLimit, maxFeePrice, opts...) + if rf, ok := ret.Get(0).(func(context.Context, assets.Eth, []byte, uint64, *assets.Wei, *common.Address, *common.Address, ...types.Opt) *big.Int); ok { + r0 = rf(ctx, amount, calldata, feeLimit, maxFeePrice, fromAddress, toAddress, opts...) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*big.Int) } } - if rf, ok := ret.Get(1).(func(context.Context, assets.Eth, []byte, uint64, *assets.Wei, ...types.Opt) error); ok { - r1 = rf(ctx, amount, calldata, feeLimit, maxFeePrice, opts...) + if rf, ok := ret.Get(1).(func(context.Context, assets.Eth, []byte, uint64, *assets.Wei, *common.Address, *common.Address, ...types.Opt) error); ok { + r1 = rf(ctx, amount, calldata, feeLimit, maxFeePrice, fromAddress, toAddress, opts...) } else { r1 = ret.Error(1) } @@ -157,6 +267,48 @@ func (_m *EvmFeeEstimator) GetMaxCost(ctx context.Context, amount assets.Eth, ca return r0, r1 } +// EvmFeeEstimator_GetMaxCost_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetMaxCost' +type EvmFeeEstimator_GetMaxCost_Call struct { + *mock.Call +} + +// GetMaxCost is a helper method to define mock.On call +// - ctx context.Context +// - amount assets.Eth +// - calldata []byte +// - feeLimit uint64 +// - maxFeePrice *assets.Wei +// - fromAddress *common.Address +// - toAddress *common.Address +// - opts ...types.Opt +func (_e *EvmFeeEstimator_Expecter) GetMaxCost(ctx interface{}, amount interface{}, calldata interface{}, feeLimit interface{}, maxFeePrice interface{}, fromAddress interface{}, toAddress interface{}, opts ...interface{}) *EvmFeeEstimator_GetMaxCost_Call { + return &EvmFeeEstimator_GetMaxCost_Call{Call: _e.mock.On("GetMaxCost", + append([]interface{}{ctx, amount, calldata, feeLimit, maxFeePrice, fromAddress, toAddress}, opts...)...)} +} + +func (_c *EvmFeeEstimator_GetMaxCost_Call) Run(run func(ctx context.Context, amount assets.Eth, calldata []byte, feeLimit uint64, maxFeePrice *assets.Wei, fromAddress *common.Address, toAddress *common.Address, opts ...types.Opt)) *EvmFeeEstimator_GetMaxCost_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]types.Opt, len(args)-7) + for i, a := range args[7:] { + if a != nil { + variadicArgs[i] = a.(types.Opt) + } + } + run(args[0].(context.Context), args[1].(assets.Eth), args[2].([]byte), args[3].(uint64), args[4].(*assets.Wei), args[5].(*common.Address), args[6].(*common.Address), variadicArgs...) + }) + return _c +} + +func (_c *EvmFeeEstimator_GetMaxCost_Call) Return(_a0 *big.Int, _a1 error) *EvmFeeEstimator_GetMaxCost_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EvmFeeEstimator_GetMaxCost_Call) RunAndReturn(run func(context.Context, assets.Eth, []byte, uint64, *assets.Wei, *common.Address, *common.Address, ...types.Opt) (*big.Int, error)) *EvmFeeEstimator_GetMaxCost_Call { + _c.Call.Return(run) + return _c +} + // HealthReport provides a mock function with given fields: func (_m *EvmFeeEstimator) HealthReport() map[string]error { ret := _m.Called() @@ -177,6 +329,33 @@ func (_m *EvmFeeEstimator) HealthReport() map[string]error { return r0 } +// EvmFeeEstimator_HealthReport_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HealthReport' +type EvmFeeEstimator_HealthReport_Call struct { + *mock.Call +} + +// HealthReport is a helper method to define mock.On call +func (_e *EvmFeeEstimator_Expecter) HealthReport() *EvmFeeEstimator_HealthReport_Call { + return &EvmFeeEstimator_HealthReport_Call{Call: _e.mock.On("HealthReport")} +} + +func (_c *EvmFeeEstimator_HealthReport_Call) Run(run func()) *EvmFeeEstimator_HealthReport_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *EvmFeeEstimator_HealthReport_Call) Return(_a0 map[string]error) *EvmFeeEstimator_HealthReport_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *EvmFeeEstimator_HealthReport_Call) RunAndReturn(run func() map[string]error) *EvmFeeEstimator_HealthReport_Call { + _c.Call.Return(run) + return _c +} + // L1Oracle provides a mock function with given fields: func (_m *EvmFeeEstimator) L1Oracle() rollups.L1Oracle { ret := _m.Called() @@ -197,6 +376,33 @@ func (_m *EvmFeeEstimator) L1Oracle() rollups.L1Oracle { return r0 } +// EvmFeeEstimator_L1Oracle_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'L1Oracle' +type EvmFeeEstimator_L1Oracle_Call struct { + *mock.Call +} + +// L1Oracle is a helper method to define mock.On call +func (_e *EvmFeeEstimator_Expecter) L1Oracle() *EvmFeeEstimator_L1Oracle_Call { + return &EvmFeeEstimator_L1Oracle_Call{Call: _e.mock.On("L1Oracle")} +} + +func (_c *EvmFeeEstimator_L1Oracle_Call) Run(run func()) *EvmFeeEstimator_L1Oracle_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *EvmFeeEstimator_L1Oracle_Call) Return(_a0 rollups.L1Oracle) *EvmFeeEstimator_L1Oracle_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *EvmFeeEstimator_L1Oracle_Call) RunAndReturn(run func() rollups.L1Oracle) *EvmFeeEstimator_L1Oracle_Call { + _c.Call.Return(run) + return _c +} + // Name provides a mock function with given fields: func (_m *EvmFeeEstimator) Name() string { ret := _m.Called() @@ -215,11 +421,67 @@ func (_m *EvmFeeEstimator) Name() string { return r0 } +// EvmFeeEstimator_Name_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Name' +type EvmFeeEstimator_Name_Call struct { + *mock.Call +} + +// Name is a helper method to define mock.On call +func (_e *EvmFeeEstimator_Expecter) Name() *EvmFeeEstimator_Name_Call { + return &EvmFeeEstimator_Name_Call{Call: _e.mock.On("Name")} +} + +func (_c *EvmFeeEstimator_Name_Call) Run(run func()) *EvmFeeEstimator_Name_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *EvmFeeEstimator_Name_Call) Return(_a0 string) *EvmFeeEstimator_Name_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *EvmFeeEstimator_Name_Call) RunAndReturn(run func() string) *EvmFeeEstimator_Name_Call { + _c.Call.Return(run) + return _c +} + // OnNewLongestChain provides a mock function with given fields: ctx, head func (_m *EvmFeeEstimator) OnNewLongestChain(ctx context.Context, head *evmtypes.Head) { _m.Called(ctx, head) } +// EvmFeeEstimator_OnNewLongestChain_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OnNewLongestChain' +type EvmFeeEstimator_OnNewLongestChain_Call struct { + *mock.Call +} + +// OnNewLongestChain is a helper method to define mock.On call +// - ctx context.Context +// - head *evmtypes.Head +func (_e *EvmFeeEstimator_Expecter) OnNewLongestChain(ctx interface{}, head interface{}) *EvmFeeEstimator_OnNewLongestChain_Call { + return &EvmFeeEstimator_OnNewLongestChain_Call{Call: _e.mock.On("OnNewLongestChain", ctx, head)} +} + +func (_c *EvmFeeEstimator_OnNewLongestChain_Call) Run(run func(ctx context.Context, head *evmtypes.Head)) *EvmFeeEstimator_OnNewLongestChain_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*evmtypes.Head)) + }) + return _c +} + +func (_c *EvmFeeEstimator_OnNewLongestChain_Call) Return() *EvmFeeEstimator_OnNewLongestChain_Call { + _c.Call.Return() + return _c +} + +func (_c *EvmFeeEstimator_OnNewLongestChain_Call) RunAndReturn(run func(context.Context, *evmtypes.Head)) *EvmFeeEstimator_OnNewLongestChain_Call { + _c.Call.Return(run) + return _c +} + // Ready provides a mock function with given fields: func (_m *EvmFeeEstimator) Ready() error { ret := _m.Called() @@ -238,6 +500,33 @@ func (_m *EvmFeeEstimator) Ready() error { return r0 } +// EvmFeeEstimator_Ready_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Ready' +type EvmFeeEstimator_Ready_Call struct { + *mock.Call +} + +// Ready is a helper method to define mock.On call +func (_e *EvmFeeEstimator_Expecter) Ready() *EvmFeeEstimator_Ready_Call { + return &EvmFeeEstimator_Ready_Call{Call: _e.mock.On("Ready")} +} + +func (_c *EvmFeeEstimator_Ready_Call) Run(run func()) *EvmFeeEstimator_Ready_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *EvmFeeEstimator_Ready_Call) Return(_a0 error) *EvmFeeEstimator_Ready_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *EvmFeeEstimator_Ready_Call) RunAndReturn(run func() error) *EvmFeeEstimator_Ready_Call { + _c.Call.Return(run) + return _c +} + // Start provides a mock function with given fields: _a0 func (_m *EvmFeeEstimator) Start(_a0 context.Context) error { ret := _m.Called(_a0) @@ -256,6 +545,34 @@ func (_m *EvmFeeEstimator) Start(_a0 context.Context) error { return r0 } +// EvmFeeEstimator_Start_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Start' +type EvmFeeEstimator_Start_Call struct { + *mock.Call +} + +// Start is a helper method to define mock.On call +// - _a0 context.Context +func (_e *EvmFeeEstimator_Expecter) Start(_a0 interface{}) *EvmFeeEstimator_Start_Call { + return &EvmFeeEstimator_Start_Call{Call: _e.mock.On("Start", _a0)} +} + +func (_c *EvmFeeEstimator_Start_Call) Run(run func(_a0 context.Context)) *EvmFeeEstimator_Start_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *EvmFeeEstimator_Start_Call) Return(_a0 error) *EvmFeeEstimator_Start_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *EvmFeeEstimator_Start_Call) RunAndReturn(run func(context.Context) error) *EvmFeeEstimator_Start_Call { + _c.Call.Return(run) + return _c +} + // NewEvmFeeEstimator creates a new instance of EvmFeeEstimator. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewEvmFeeEstimator(t interface { diff --git a/core/chains/evm/gas/mocks/fee_estimator_client.go b/core/chains/evm/gas/mocks/fee_estimator_client.go index d375b478a70..f5ca52ec920 100644 --- a/core/chains/evm/gas/mocks/fee_estimator_client.go +++ b/core/chains/evm/gas/mocks/fee_estimator_client.go @@ -20,6 +20,14 @@ type FeeEstimatorClient struct { mock.Mock } +type FeeEstimatorClient_Expecter struct { + mock *mock.Mock +} + +func (_m *FeeEstimatorClient) EXPECT() *FeeEstimatorClient_Expecter { + return &FeeEstimatorClient_Expecter{mock: &_m.Mock} +} + // BatchCallContext provides a mock function with given fields: ctx, b func (_m *FeeEstimatorClient) BatchCallContext(ctx context.Context, b []rpc.BatchElem) error { ret := _m.Called(ctx, b) @@ -38,6 +46,35 @@ func (_m *FeeEstimatorClient) BatchCallContext(ctx context.Context, b []rpc.Batc return r0 } +// FeeEstimatorClient_BatchCallContext_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BatchCallContext' +type FeeEstimatorClient_BatchCallContext_Call struct { + *mock.Call +} + +// BatchCallContext is a helper method to define mock.On call +// - ctx context.Context +// - b []rpc.BatchElem +func (_e *FeeEstimatorClient_Expecter) BatchCallContext(ctx interface{}, b interface{}) *FeeEstimatorClient_BatchCallContext_Call { + return &FeeEstimatorClient_BatchCallContext_Call{Call: _e.mock.On("BatchCallContext", ctx, b)} +} + +func (_c *FeeEstimatorClient_BatchCallContext_Call) Run(run func(ctx context.Context, b []rpc.BatchElem)) *FeeEstimatorClient_BatchCallContext_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].([]rpc.BatchElem)) + }) + return _c +} + +func (_c *FeeEstimatorClient_BatchCallContext_Call) Return(_a0 error) *FeeEstimatorClient_BatchCallContext_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *FeeEstimatorClient_BatchCallContext_Call) RunAndReturn(run func(context.Context, []rpc.BatchElem) error) *FeeEstimatorClient_BatchCallContext_Call { + _c.Call.Return(run) + return _c +} + // CallContext provides a mock function with given fields: ctx, result, method, args func (_m *FeeEstimatorClient) CallContext(ctx context.Context, result interface{}, method string, args ...interface{}) error { var _ca []interface{} @@ -59,6 +96,44 @@ func (_m *FeeEstimatorClient) CallContext(ctx context.Context, result interface{ return r0 } +// FeeEstimatorClient_CallContext_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CallContext' +type FeeEstimatorClient_CallContext_Call struct { + *mock.Call +} + +// CallContext is a helper method to define mock.On call +// - ctx context.Context +// - result interface{} +// - method string +// - args ...interface{} +func (_e *FeeEstimatorClient_Expecter) CallContext(ctx interface{}, result interface{}, method interface{}, args ...interface{}) *FeeEstimatorClient_CallContext_Call { + return &FeeEstimatorClient_CallContext_Call{Call: _e.mock.On("CallContext", + append([]interface{}{ctx, result, method}, args...)...)} +} + +func (_c *FeeEstimatorClient_CallContext_Call) Run(run func(ctx context.Context, result interface{}, method string, args ...interface{})) *FeeEstimatorClient_CallContext_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-3) + for i, a := range args[3:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(args[0].(context.Context), args[1].(interface{}), args[2].(string), variadicArgs...) + }) + return _c +} + +func (_c *FeeEstimatorClient_CallContext_Call) Return(_a0 error) *FeeEstimatorClient_CallContext_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *FeeEstimatorClient_CallContext_Call) RunAndReturn(run func(context.Context, interface{}, string, ...interface{}) error) *FeeEstimatorClient_CallContext_Call { + _c.Call.Return(run) + return _c +} + // CallContract provides a mock function with given fields: ctx, msg, blockNumber func (_m *FeeEstimatorClient) CallContract(ctx context.Context, msg ethereum.CallMsg, blockNumber *big.Int) ([]byte, error) { ret := _m.Called(ctx, msg, blockNumber) @@ -89,6 +164,36 @@ func (_m *FeeEstimatorClient) CallContract(ctx context.Context, msg ethereum.Cal return r0, r1 } +// FeeEstimatorClient_CallContract_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CallContract' +type FeeEstimatorClient_CallContract_Call struct { + *mock.Call +} + +// CallContract is a helper method to define mock.On call +// - ctx context.Context +// - msg ethereum.CallMsg +// - blockNumber *big.Int +func (_e *FeeEstimatorClient_Expecter) CallContract(ctx interface{}, msg interface{}, blockNumber interface{}) *FeeEstimatorClient_CallContract_Call { + return &FeeEstimatorClient_CallContract_Call{Call: _e.mock.On("CallContract", ctx, msg, blockNumber)} +} + +func (_c *FeeEstimatorClient_CallContract_Call) Run(run func(ctx context.Context, msg ethereum.CallMsg, blockNumber *big.Int)) *FeeEstimatorClient_CallContract_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(ethereum.CallMsg), args[2].(*big.Int)) + }) + return _c +} + +func (_c *FeeEstimatorClient_CallContract_Call) Return(_a0 []byte, _a1 error) *FeeEstimatorClient_CallContract_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FeeEstimatorClient_CallContract_Call) RunAndReturn(run func(context.Context, ethereum.CallMsg, *big.Int) ([]byte, error)) *FeeEstimatorClient_CallContract_Call { + _c.Call.Return(run) + return _c +} + // ConfiguredChainID provides a mock function with given fields: func (_m *FeeEstimatorClient) ConfiguredChainID() *big.Int { ret := _m.Called() @@ -109,6 +214,150 @@ func (_m *FeeEstimatorClient) ConfiguredChainID() *big.Int { return r0 } +// FeeEstimatorClient_ConfiguredChainID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ConfiguredChainID' +type FeeEstimatorClient_ConfiguredChainID_Call struct { + *mock.Call +} + +// ConfiguredChainID is a helper method to define mock.On call +func (_e *FeeEstimatorClient_Expecter) ConfiguredChainID() *FeeEstimatorClient_ConfiguredChainID_Call { + return &FeeEstimatorClient_ConfiguredChainID_Call{Call: _e.mock.On("ConfiguredChainID")} +} + +func (_c *FeeEstimatorClient_ConfiguredChainID_Call) Run(run func()) *FeeEstimatorClient_ConfiguredChainID_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *FeeEstimatorClient_ConfiguredChainID_Call) Return(_a0 *big.Int) *FeeEstimatorClient_ConfiguredChainID_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *FeeEstimatorClient_ConfiguredChainID_Call) RunAndReturn(run func() *big.Int) *FeeEstimatorClient_ConfiguredChainID_Call { + _c.Call.Return(run) + return _c +} + +// EstimateGas provides a mock function with given fields: ctx, call +func (_m *FeeEstimatorClient) EstimateGas(ctx context.Context, call ethereum.CallMsg) (uint64, error) { + ret := _m.Called(ctx, call) + + if len(ret) == 0 { + panic("no return value specified for EstimateGas") + } + + var r0 uint64 + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, ethereum.CallMsg) (uint64, error)); ok { + return rf(ctx, call) + } + if rf, ok := ret.Get(0).(func(context.Context, ethereum.CallMsg) uint64); ok { + r0 = rf(ctx, call) + } else { + r0 = ret.Get(0).(uint64) + } + + if rf, ok := ret.Get(1).(func(context.Context, ethereum.CallMsg) error); ok { + r1 = rf(ctx, call) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// FeeEstimatorClient_EstimateGas_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EstimateGas' +type FeeEstimatorClient_EstimateGas_Call struct { + *mock.Call +} + +// EstimateGas is a helper method to define mock.On call +// - ctx context.Context +// - call ethereum.CallMsg +func (_e *FeeEstimatorClient_Expecter) EstimateGas(ctx interface{}, call interface{}) *FeeEstimatorClient_EstimateGas_Call { + return &FeeEstimatorClient_EstimateGas_Call{Call: _e.mock.On("EstimateGas", ctx, call)} +} + +func (_c *FeeEstimatorClient_EstimateGas_Call) Run(run func(ctx context.Context, call ethereum.CallMsg)) *FeeEstimatorClient_EstimateGas_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(ethereum.CallMsg)) + }) + return _c +} + +func (_c *FeeEstimatorClient_EstimateGas_Call) Return(_a0 uint64, _a1 error) *FeeEstimatorClient_EstimateGas_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FeeEstimatorClient_EstimateGas_Call) RunAndReturn(run func(context.Context, ethereum.CallMsg) (uint64, error)) *FeeEstimatorClient_EstimateGas_Call { + _c.Call.Return(run) + return _c +} + +// FeeHistory provides a mock function with given fields: ctx, blockCount, rewardPercentiles +func (_m *FeeEstimatorClient) FeeHistory(ctx context.Context, blockCount uint64, rewardPercentiles []float64) (*ethereum.FeeHistory, error) { + ret := _m.Called(ctx, blockCount, rewardPercentiles) + + if len(ret) == 0 { + panic("no return value specified for FeeHistory") + } + + var r0 *ethereum.FeeHistory + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, uint64, []float64) (*ethereum.FeeHistory, error)); ok { + return rf(ctx, blockCount, rewardPercentiles) + } + if rf, ok := ret.Get(0).(func(context.Context, uint64, []float64) *ethereum.FeeHistory); ok { + r0 = rf(ctx, blockCount, rewardPercentiles) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*ethereum.FeeHistory) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, uint64, []float64) error); ok { + r1 = rf(ctx, blockCount, rewardPercentiles) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// FeeEstimatorClient_FeeHistory_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FeeHistory' +type FeeEstimatorClient_FeeHistory_Call struct { + *mock.Call +} + +// FeeHistory is a helper method to define mock.On call +// - ctx context.Context +// - blockCount uint64 +// - rewardPercentiles []float64 +func (_e *FeeEstimatorClient_Expecter) FeeHistory(ctx interface{}, blockCount interface{}, rewardPercentiles interface{}) *FeeEstimatorClient_FeeHistory_Call { + return &FeeEstimatorClient_FeeHistory_Call{Call: _e.mock.On("FeeHistory", ctx, blockCount, rewardPercentiles)} +} + +func (_c *FeeEstimatorClient_FeeHistory_Call) Run(run func(ctx context.Context, blockCount uint64, rewardPercentiles []float64)) *FeeEstimatorClient_FeeHistory_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(uint64), args[2].([]float64)) + }) + return _c +} + +func (_c *FeeEstimatorClient_FeeHistory_Call) Return(feeHistory *ethereum.FeeHistory, err error) *FeeEstimatorClient_FeeHistory_Call { + _c.Call.Return(feeHistory, err) + return _c +} + +func (_c *FeeEstimatorClient_FeeHistory_Call) RunAndReturn(run func(context.Context, uint64, []float64) (*ethereum.FeeHistory, error)) *FeeEstimatorClient_FeeHistory_Call { + _c.Call.Return(run) + return _c +} + // HeadByNumber provides a mock function with given fields: ctx, n func (_m *FeeEstimatorClient) HeadByNumber(ctx context.Context, n *big.Int) (*types.Head, error) { ret := _m.Called(ctx, n) @@ -139,6 +388,93 @@ func (_m *FeeEstimatorClient) HeadByNumber(ctx context.Context, n *big.Int) (*ty return r0, r1 } +// FeeEstimatorClient_HeadByNumber_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HeadByNumber' +type FeeEstimatorClient_HeadByNumber_Call struct { + *mock.Call +} + +// HeadByNumber is a helper method to define mock.On call +// - ctx context.Context +// - n *big.Int +func (_e *FeeEstimatorClient_Expecter) HeadByNumber(ctx interface{}, n interface{}) *FeeEstimatorClient_HeadByNumber_Call { + return &FeeEstimatorClient_HeadByNumber_Call{Call: _e.mock.On("HeadByNumber", ctx, n)} +} + +func (_c *FeeEstimatorClient_HeadByNumber_Call) Run(run func(ctx context.Context, n *big.Int)) *FeeEstimatorClient_HeadByNumber_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*big.Int)) + }) + return _c +} + +func (_c *FeeEstimatorClient_HeadByNumber_Call) Return(_a0 *types.Head, _a1 error) *FeeEstimatorClient_HeadByNumber_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FeeEstimatorClient_HeadByNumber_Call) RunAndReturn(run func(context.Context, *big.Int) (*types.Head, error)) *FeeEstimatorClient_HeadByNumber_Call { + _c.Call.Return(run) + return _c +} + +// SuggestGasPrice provides a mock function with given fields: ctx +func (_m *FeeEstimatorClient) SuggestGasPrice(ctx context.Context) (*big.Int, error) { + ret := _m.Called(ctx) + + if len(ret) == 0 { + panic("no return value specified for SuggestGasPrice") + } + + var r0 *big.Int + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (*big.Int, error)); ok { + return rf(ctx) + } + if rf, ok := ret.Get(0).(func(context.Context) *big.Int); ok { + r0 = rf(ctx) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*big.Int) + } + } + + if rf, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = rf(ctx) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// FeeEstimatorClient_SuggestGasPrice_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SuggestGasPrice' +type FeeEstimatorClient_SuggestGasPrice_Call struct { + *mock.Call +} + +// SuggestGasPrice is a helper method to define mock.On call +// - ctx context.Context +func (_e *FeeEstimatorClient_Expecter) SuggestGasPrice(ctx interface{}) *FeeEstimatorClient_SuggestGasPrice_Call { + return &FeeEstimatorClient_SuggestGasPrice_Call{Call: _e.mock.On("SuggestGasPrice", ctx)} +} + +func (_c *FeeEstimatorClient_SuggestGasPrice_Call) Run(run func(ctx context.Context)) *FeeEstimatorClient_SuggestGasPrice_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *FeeEstimatorClient_SuggestGasPrice_Call) Return(_a0 *big.Int, _a1 error) *FeeEstimatorClient_SuggestGasPrice_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FeeEstimatorClient_SuggestGasPrice_Call) RunAndReturn(run func(context.Context) (*big.Int, error)) *FeeEstimatorClient_SuggestGasPrice_Call { + _c.Call.Return(run) + return _c +} + // NewFeeEstimatorClient creates a new instance of FeeEstimatorClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewFeeEstimatorClient(t interface { diff --git a/core/chains/evm/gas/mocks/fee_history_estimator_client.go b/core/chains/evm/gas/mocks/fee_history_estimator_client.go new file mode 100644 index 00000000000..74862145016 --- /dev/null +++ b/core/chains/evm/gas/mocks/fee_history_estimator_client.go @@ -0,0 +1,157 @@ +// Code generated by mockery v2.43.2. DO NOT EDIT. + +package mocks + +import ( + context "context" + big "math/big" + + ethereum "github.com/ethereum/go-ethereum" + + mock "github.com/stretchr/testify/mock" +) + +// FeeHistoryEstimatorClient is an autogenerated mock type for the feeHistoryEstimatorClient type +type FeeHistoryEstimatorClient struct { + mock.Mock +} + +type FeeHistoryEstimatorClient_Expecter struct { + mock *mock.Mock +} + +func (_m *FeeHistoryEstimatorClient) EXPECT() *FeeHistoryEstimatorClient_Expecter { + return &FeeHistoryEstimatorClient_Expecter{mock: &_m.Mock} +} + +// FeeHistory provides a mock function with given fields: ctx, blockCount, rewardPercentiles +func (_m *FeeHistoryEstimatorClient) FeeHistory(ctx context.Context, blockCount uint64, rewardPercentiles []float64) (*ethereum.FeeHistory, error) { + ret := _m.Called(ctx, blockCount, rewardPercentiles) + + if len(ret) == 0 { + panic("no return value specified for FeeHistory") + } + + var r0 *ethereum.FeeHistory + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, uint64, []float64) (*ethereum.FeeHistory, error)); ok { + return rf(ctx, blockCount, rewardPercentiles) + } + if rf, ok := ret.Get(0).(func(context.Context, uint64, []float64) *ethereum.FeeHistory); ok { + r0 = rf(ctx, blockCount, rewardPercentiles) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*ethereum.FeeHistory) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, uint64, []float64) error); ok { + r1 = rf(ctx, blockCount, rewardPercentiles) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// FeeHistoryEstimatorClient_FeeHistory_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FeeHistory' +type FeeHistoryEstimatorClient_FeeHistory_Call struct { + *mock.Call +} + +// FeeHistory is a helper method to define mock.On call +// - ctx context.Context +// - blockCount uint64 +// - rewardPercentiles []float64 +func (_e *FeeHistoryEstimatorClient_Expecter) FeeHistory(ctx interface{}, blockCount interface{}, rewardPercentiles interface{}) *FeeHistoryEstimatorClient_FeeHistory_Call { + return &FeeHistoryEstimatorClient_FeeHistory_Call{Call: _e.mock.On("FeeHistory", ctx, blockCount, rewardPercentiles)} +} + +func (_c *FeeHistoryEstimatorClient_FeeHistory_Call) Run(run func(ctx context.Context, blockCount uint64, rewardPercentiles []float64)) *FeeHistoryEstimatorClient_FeeHistory_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(uint64), args[2].([]float64)) + }) + return _c +} + +func (_c *FeeHistoryEstimatorClient_FeeHistory_Call) Return(feeHistory *ethereum.FeeHistory, err error) *FeeHistoryEstimatorClient_FeeHistory_Call { + _c.Call.Return(feeHistory, err) + return _c +} + +func (_c *FeeHistoryEstimatorClient_FeeHistory_Call) RunAndReturn(run func(context.Context, uint64, []float64) (*ethereum.FeeHistory, error)) *FeeHistoryEstimatorClient_FeeHistory_Call { + _c.Call.Return(run) + return _c +} + +// SuggestGasPrice provides a mock function with given fields: ctx +func (_m *FeeHistoryEstimatorClient) SuggestGasPrice(ctx context.Context) (*big.Int, error) { + ret := _m.Called(ctx) + + if len(ret) == 0 { + panic("no return value specified for SuggestGasPrice") + } + + var r0 *big.Int + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (*big.Int, error)); ok { + return rf(ctx) + } + if rf, ok := ret.Get(0).(func(context.Context) *big.Int); ok { + r0 = rf(ctx) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*big.Int) + } + } + + if rf, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = rf(ctx) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// FeeHistoryEstimatorClient_SuggestGasPrice_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SuggestGasPrice' +type FeeHistoryEstimatorClient_SuggestGasPrice_Call struct { + *mock.Call +} + +// SuggestGasPrice is a helper method to define mock.On call +// - ctx context.Context +func (_e *FeeHistoryEstimatorClient_Expecter) SuggestGasPrice(ctx interface{}) *FeeHistoryEstimatorClient_SuggestGasPrice_Call { + return &FeeHistoryEstimatorClient_SuggestGasPrice_Call{Call: _e.mock.On("SuggestGasPrice", ctx)} +} + +func (_c *FeeHistoryEstimatorClient_SuggestGasPrice_Call) Run(run func(ctx context.Context)) *FeeHistoryEstimatorClient_SuggestGasPrice_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *FeeHistoryEstimatorClient_SuggestGasPrice_Call) Return(_a0 *big.Int, _a1 error) *FeeHistoryEstimatorClient_SuggestGasPrice_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FeeHistoryEstimatorClient_SuggestGasPrice_Call) RunAndReturn(run func(context.Context) (*big.Int, error)) *FeeHistoryEstimatorClient_SuggestGasPrice_Call { + _c.Call.Return(run) + return _c +} + +// NewFeeHistoryEstimatorClient creates a new instance of FeeHistoryEstimatorClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewFeeHistoryEstimatorClient(t interface { + mock.TestingT + Cleanup(func()) +}) *FeeHistoryEstimatorClient { + mock := &FeeHistoryEstimatorClient{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/core/chains/evm/gas/mocks/rpc_client.go b/core/chains/evm/gas/mocks/rpc_client.go deleted file mode 100644 index 826fd66c463..00000000000 --- a/core/chains/evm/gas/mocks/rpc_client.go +++ /dev/null @@ -1,49 +0,0 @@ -// Code generated by mockery v2.42.2. DO NOT EDIT. - -package mocks - -import ( - context "context" - - mock "github.com/stretchr/testify/mock" -) - -// RPCClient is an autogenerated mock type for the rpcClient type -type RPCClient struct { - mock.Mock -} - -// CallContext provides a mock function with given fields: ctx, result, method, args -func (_m *RPCClient) CallContext(ctx context.Context, result interface{}, method string, args ...interface{}) error { - var _ca []interface{} - _ca = append(_ca, ctx, result, method) - _ca = append(_ca, args...) - ret := _m.Called(_ca...) - - if len(ret) == 0 { - panic("no return value specified for CallContext") - } - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, interface{}, string, ...interface{}) error); ok { - r0 = rf(ctx, result, method, args...) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// NewRPCClient creates a new instance of RPCClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewRPCClient(t interface { - mock.TestingT - Cleanup(func()) -}) *RPCClient { - mock := &RPCClient{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/core/chains/evm/gas/models.go b/core/chains/evm/gas/models.go index 8c1d19280ae..b2f3bf02fdd 100644 --- a/core/chains/evm/gas/models.go +++ b/core/chains/evm/gas/models.go @@ -26,29 +26,32 @@ import ( evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" ) +// EstimateGasBuffer is a multiplier applied to estimated gas when the EstimateLimit feature is enabled +const EstimateGasBuffer = float32(1.15) + // EvmFeeEstimator provides a unified interface that wraps EvmEstimator and can determine if legacy or dynamic fee estimation should be used -// -//go:generate mockery --quiet --name EvmFeeEstimator --output ./mocks/ --case=underscore type EvmFeeEstimator interface { services.Service headtracker.HeadTrackable[*evmtypes.Head, common.Hash] // L1Oracle returns the L1 gas price oracle only if the chain has one, e.g. OP stack L2s and Arbitrum. L1Oracle() rollups.L1Oracle - GetFee(ctx context.Context, calldata []byte, feeLimit uint64, maxFeePrice *assets.Wei, opts ...feetypes.Opt) (fee EvmFee, chainSpecificFeeLimit uint64, err error) + GetFee(ctx context.Context, calldata []byte, feeLimit uint64, maxFeePrice *assets.Wei, fromAddress, toAddress *common.Address, opts ...feetypes.Opt) (fee EvmFee, estimatedFeeLimit uint64, err error) BumpFee(ctx context.Context, originalFee EvmFee, feeLimit uint64, maxFeePrice *assets.Wei, attempts []EvmPriorAttempt) (bumpedFee EvmFee, chainSpecificFeeLimit uint64, err error) // GetMaxCost returns the total value = max price x fee units + transferred value - GetMaxCost(ctx context.Context, amount assets.Eth, calldata []byte, feeLimit uint64, maxFeePrice *assets.Wei, opts ...feetypes.Opt) (*big.Int, error) + GetMaxCost(ctx context.Context, amount assets.Eth, calldata []byte, feeLimit uint64, maxFeePrice *assets.Wei, fromAddress, toAddress *common.Address, opts ...feetypes.Opt) (*big.Int, error) } -//go:generate mockery --quiet --name feeEstimatorClient --output ./mocks/ --case=underscore --structname FeeEstimatorClient type feeEstimatorClient interface { CallContract(ctx context.Context, msg ethereum.CallMsg, blockNumber *big.Int) ([]byte, error) BatchCallContext(ctx context.Context, b []rpc.BatchElem) error CallContext(ctx context.Context, result interface{}, method string, args ...interface{}) error ConfiguredChainID() *big.Int HeadByNumber(ctx context.Context, n *big.Int) (*evmtypes.Head, error) + EstimateGas(ctx context.Context, call ethereum.CallMsg) (uint64, error) + SuggestGasPrice(ctx context.Context) (*big.Int, error) + FeeHistory(ctx context.Context, blockCount uint64, rewardPercentiles []float64) (feeHistory *ethereum.FeeHistory, err error) } // NewEstimator returns the estimator for a given config @@ -73,6 +76,7 @@ func NewEstimator(lggr logger.Logger, ethClient feeEstimatorClient, cfg Config, "tipCapMin", geCfg.TipCapMin(), "priceMax", geCfg.PriceMax(), "priceMin", geCfg.PriceMin(), + "estimateLimit", geCfg.EstimateLimit(), ) df := geCfg.EIP1559DynamicFees() @@ -107,13 +111,25 @@ func NewEstimator(lggr logger.Logger, ethClient feeEstimatorClient, cfg Config, newEstimator = func(l logger.Logger) EvmEstimator { return NewSuggestedPriceEstimator(lggr, ethClient, geCfg, l1Oracle) } + case "FeeHistory": + newEstimator = func(l logger.Logger) EvmEstimator { + ccfg := FeeHistoryEstimatorConfig{ + BumpPercent: geCfg.BumpPercent(), + CacheTimeout: geCfg.FeeHistory().CacheTimeout(), + EIP1559: geCfg.EIP1559DynamicFees(), + BlockHistorySize: uint64(geCfg.BlockHistory().BlockHistorySize()), + RewardPercentile: float64(geCfg.BlockHistory().TransactionPercentile()), + } + return NewFeeHistoryEstimator(lggr, ethClient, ccfg, ethClient.ConfiguredChainID(), l1Oracle) + } + default: lggr.Warnf("GasEstimator: unrecognised mode '%s', falling back to FixedPriceEstimator", s) newEstimator = func(l logger.Logger) EvmEstimator { return NewFixedPriceEstimator(geCfg, ethClient, bh, lggr, l1Oracle) } } - return NewEvmFeeEstimator(lggr, newEstimator, df, geCfg), nil + return NewEvmFeeEstimator(lggr, newEstimator, df, geCfg, ethClient), nil } // DynamicFee encompasses both FeeCap and TipCap for EIP1559 transactions @@ -132,8 +148,6 @@ type EvmPriorAttempt struct { } // Estimator provides an interface for estimating gas price and limit -// -//go:generate mockery --quiet --name EvmEstimator --output ./mocks/ --case=underscore type EvmEstimator interface { headtracker.HeadTrackable[*evmtypes.Head, common.Hash] services.Service @@ -186,17 +200,19 @@ type evmFeeEstimator struct { EvmEstimator EIP1559Enabled bool geCfg GasEstimatorConfig + ethClient feeEstimatorClient } var _ EvmFeeEstimator = (*evmFeeEstimator)(nil) -func NewEvmFeeEstimator(lggr logger.Logger, newEstimator func(logger.Logger) EvmEstimator, eip1559Enabled bool, geCfg GasEstimatorConfig) EvmFeeEstimator { +func NewEvmFeeEstimator(lggr logger.Logger, newEstimator func(logger.Logger) EvmEstimator, eip1559Enabled bool, geCfg GasEstimatorConfig, ethClient feeEstimatorClient) EvmFeeEstimator { lggr = logger.Named(lggr, "WrappedEvmEstimator") return &evmFeeEstimator{ lggr: lggr, EvmEstimator: newEstimator(lggr), EIP1559Enabled: eip1559Enabled, geCfg: geCfg, + ethClient: ethClient, } } @@ -266,7 +282,10 @@ func (e *evmFeeEstimator) L1Oracle() rollups.L1Oracle { return e.EvmEstimator.L1Oracle() } -func (e *evmFeeEstimator) GetFee(ctx context.Context, calldata []byte, feeLimit uint64, maxFeePrice *assets.Wei, opts ...feetypes.Opt) (fee EvmFee, chainSpecificFeeLimit uint64, err error) { +// GetFee returns an initial estimated gas price and gas limit for a transaction +// The gas limit provided by the caller can be adjusted by gas estimation or for 2D fees +func (e *evmFeeEstimator) GetFee(ctx context.Context, calldata []byte, feeLimit uint64, maxFeePrice *assets.Wei, fromAddress, toAddress *common.Address, opts ...feetypes.Opt) (fee EvmFee, estimatedFeeLimit uint64, err error) { + var chainSpecificFeeLimit uint64 // get dynamic fee if e.EIP1559Enabled { var dynamicFee DynamicFee @@ -274,24 +293,23 @@ func (e *evmFeeEstimator) GetFee(ctx context.Context, calldata []byte, feeLimit if err != nil { return } - chainSpecificFeeLimit, err = commonfee.ApplyMultiplier(feeLimit, e.geCfg.LimitMultiplier()) fee.DynamicFeeCap = dynamicFee.FeeCap fee.DynamicTipCap = dynamicFee.TipCap - return - } - - // get legacy fee - fee.Legacy, chainSpecificFeeLimit, err = e.EvmEstimator.GetLegacyGas(ctx, calldata, feeLimit, maxFeePrice, opts...) - if err != nil { - return + chainSpecificFeeLimit = feeLimit + } else { + // get legacy fee + fee.Legacy, chainSpecificFeeLimit, err = e.EvmEstimator.GetLegacyGas(ctx, calldata, feeLimit, maxFeePrice, opts...) + if err != nil { + return + } } - chainSpecificFeeLimit, err = commonfee.ApplyMultiplier(chainSpecificFeeLimit, e.geCfg.LimitMultiplier()) + estimatedFeeLimit, err = e.estimateFeeLimit(ctx, chainSpecificFeeLimit, calldata, fromAddress, toAddress) return } -func (e *evmFeeEstimator) GetMaxCost(ctx context.Context, amount assets.Eth, calldata []byte, feeLimit uint64, maxFeePrice *assets.Wei, opts ...feetypes.Opt) (*big.Int, error) { - fees, gasLimit, err := e.GetFee(ctx, calldata, feeLimit, maxFeePrice, opts...) +func (e *evmFeeEstimator) GetMaxCost(ctx context.Context, amount assets.Eth, calldata []byte, feeLimit uint64, maxFeePrice *assets.Wei, fromAddress, toAddress *common.Address, opts ...feetypes.Opt) (*big.Int, error) { + fees, gasLimit, err := e.GetFee(ctx, calldata, feeLimit, maxFeePrice, fromAddress, toAddress, opts...) if err != nil { return nil, err } @@ -342,9 +360,57 @@ func (e *evmFeeEstimator) BumpFee(ctx context.Context, originalFee EvmFee, feeLi return } +func (e *evmFeeEstimator) estimateFeeLimit(ctx context.Context, feeLimit uint64, calldata []byte, fromAddress, toAddress *common.Address) (estimatedFeeLimit uint64, err error) { + // Use the feeLimit * LimitMultiplier as the provided gas limit since this multiplier is applied on top of the caller specified gas limit + providedGasLimit, err := commonfee.ApplyMultiplier(feeLimit, e.geCfg.LimitMultiplier()) + if err != nil { + return estimatedFeeLimit, err + } + // Use provided fee limit by default if EstimateLimit is disabled + if !e.geCfg.EstimateLimit() { + return providedGasLimit, nil + } + // Create call msg for gas limit estimation + // Skip setting Gas to avoid capping the results of the estimation + callMsg := ethereum.CallMsg{ + To: toAddress, + Data: calldata, + } + if fromAddress != nil { + callMsg.From = *fromAddress + } + estimatedGas, estimateErr := e.ethClient.EstimateGas(ctx, callMsg) + if estimateErr != nil { + if providedGasLimit > 0 { + // Do not return error if estimate gas failed, we can still use the provided limit instead since it is an upper limit + e.lggr.Errorw("failed to estimate gas limit. falling back to the provided gas limit with multiplier", "callMsg", callMsg, "providedGasLimitWithMultiplier", providedGasLimit, "error", estimateErr) + return providedGasLimit, nil + } + return estimatedFeeLimit, fmt.Errorf("gas estimation failed and provided gas limit is 0: %w", estimateErr) + } + e.lggr.Debugw("estimated gas", "estimatedGas", estimatedGas, "providedGasLimitWithMultiplier", providedGasLimit) + // Return error if estimated gas without the buffer exceeds the provided gas limit, if provided + // Transaction would be destined to run out of gas and fail + if providedGasLimit > 0 && estimatedGas > providedGasLimit { + e.lggr.Errorw("estimated gas exceeds provided gas limit with multiplier", "estimatedGas", estimatedGas, "providedGasLimitWithMultiplier", providedGasLimit) + return estimatedFeeLimit, commonfee.ErrFeeLimitTooLow + } + // Apply EstimateGasBuffer to the estimated gas limit + estimatedFeeLimit, err = commonfee.ApplyMultiplier(estimatedGas, EstimateGasBuffer) + if err != nil { + return + } + // If provided gas limit is not 0, fallback to it if the buffer causes the estimated gas limit to exceed it + // The provided gas limit should be used as an upper bound to avoid unexpected behavior for products + if providedGasLimit > 0 && estimatedFeeLimit > providedGasLimit { + e.lggr.Debugw("estimated gas limit with buffer exceeds the provided gas limit with multiplier. falling back to the provided gas limit with multiplier", "estimatedGasLimit", estimatedFeeLimit, "providedGasLimitWithMultiplier", providedGasLimit) + estimatedFeeLimit = providedGasLimit + } + + return +} + // Config defines an interface for configuration in the gas package -// -//go:generate mockery --quiet --name Config --output ./mocks/ --case=underscore type Config interface { ChainType() chaintype.ChainType FinalityDepth() uint32 @@ -365,6 +431,7 @@ type GasEstimatorConfig interface { PriceMin() *assets.Wei PriceMax() *assets.Wei Mode() string + EstimateLimit() bool } type BlockHistoryConfig interface { diff --git a/core/chains/evm/gas/models_test.go b/core/chains/evm/gas/models_test.go index 92ea901596f..f2afc26c854 100644 --- a/core/chains/evm/gas/models_test.go +++ b/core/chains/evm/gas/models_test.go @@ -1,6 +1,7 @@ package gas_test import ( + "errors" "math/big" "testing" @@ -12,12 +13,14 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" + commonfee "github.com/smartcontractkit/chainlink/v2/common/fee" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/config/chaintype" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/gas" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/gas/mocks" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/gas/rollups" rollupMocks "github.com/smartcontractkit/chainlink/v2/core/chains/evm/gas/rollups/mocks" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/testutils" ) func TestWrappedEvmEstimator(t *testing.T) { @@ -35,9 +38,9 @@ func TestWrappedEvmEstimator(t *testing.T) { est := mocks.NewEvmEstimator(t) est.On("GetDynamicFee", mock.Anything, mock.Anything). - Return(dynamicFee, nil).Twice() + Return(dynamicFee, nil).Times(6) est.On("GetLegacyGas", mock.Anything, mock.Anything, mock.Anything, mock.Anything). - Return(legacyFee, gasLimit, nil).Twice() + Return(legacyFee, gasLimit, nil).Times(6) est.On("BumpDynamicFee", mock.Anything, mock.Anything, mock.Anything, mock.Anything). Return(dynamicFee, nil).Once() est.On("BumpLegacyGas", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything). @@ -49,6 +52,9 @@ func TestWrappedEvmEstimator(t *testing.T) { mockEstimatorName := "WrappedEvmEstimator" mockEvmEstimatorName := "WrappedEvmEstimator.MockEstimator" + fromAddress := testutils.NewAddress() + toAddress := testutils.NewAddress() + // L1Oracle returns the correct L1Oracle interface t.Run("L1Oracle", func(t *testing.T) { lggr := logger.Test(t) @@ -59,7 +65,7 @@ func TestWrappedEvmEstimator(t *testing.T) { getEst := func(logger.Logger) gas.EvmEstimator { return evmEstimator } // expect nil - estimator := gas.NewEvmFeeEstimator(lggr, getEst, false, nil) + estimator := gas.NewEvmFeeEstimator(lggr, getEst, false, nil, nil) l1Oracle := estimator.L1Oracle() assert.Nil(t, l1Oracle) @@ -68,7 +74,7 @@ func TestWrappedEvmEstimator(t *testing.T) { oracle, err := rollups.NewL1GasOracle(lggr, nil, chaintype.ChainOptimismBedrock) require.NoError(t, err) // cast oracle to L1Oracle interface - estimator = gas.NewEvmFeeEstimator(lggr, getEst, false, geCfg) + estimator = gas.NewEvmFeeEstimator(lggr, getEst, false, geCfg, nil) evmEstimator.On("L1Oracle").Return(oracle).Once() l1Oracle = estimator.L1Oracle() @@ -80,8 +86,8 @@ func TestWrappedEvmEstimator(t *testing.T) { lggr := logger.Test(t) // expect legacy fee data dynamicFees := false - estimator := gas.NewEvmFeeEstimator(lggr, getRootEst, dynamicFees, geCfg) - fee, max, err := estimator.GetFee(ctx, nil, 0, nil) + estimator := gas.NewEvmFeeEstimator(lggr, getRootEst, dynamicFees, geCfg, nil) + fee, max, err := estimator.GetFee(ctx, nil, 0, nil, nil, nil) require.NoError(t, err) assert.Equal(t, uint64(float32(gasLimit)*limitMultiplier), max) assert.True(t, legacyFee.Equal(fee.Legacy)) @@ -90,8 +96,8 @@ func TestWrappedEvmEstimator(t *testing.T) { // expect dynamic fee data dynamicFees = true - estimator = gas.NewEvmFeeEstimator(lggr, getRootEst, dynamicFees, geCfg) - fee, max, err = estimator.GetFee(ctx, nil, gasLimit, nil) + estimator = gas.NewEvmFeeEstimator(lggr, getRootEst, dynamicFees, geCfg, nil) + fee, max, err = estimator.GetFee(ctx, nil, gasLimit, nil, nil, nil) require.NoError(t, err) assert.Equal(t, uint64(float32(gasLimit)*limitMultiplier), max) assert.True(t, dynamicFee.FeeCap.Equal(fee.DynamicFeeCap)) @@ -103,7 +109,7 @@ func TestWrappedEvmEstimator(t *testing.T) { t.Run("BumpFee", func(t *testing.T) { lggr := logger.Test(t) dynamicFees := false - estimator := gas.NewEvmFeeEstimator(lggr, getRootEst, dynamicFees, geCfg) + estimator := gas.NewEvmFeeEstimator(lggr, getRootEst, dynamicFees, geCfg, nil) // expect legacy fee data fee, max, err := estimator.BumpFee(ctx, gas.EvmFee{Legacy: assets.NewWeiI(0)}, 0, nil, nil) @@ -141,8 +147,8 @@ func TestWrappedEvmEstimator(t *testing.T) { // expect legacy fee data dynamicFees := false - estimator := gas.NewEvmFeeEstimator(lggr, getRootEst, dynamicFees, geCfg) - total, err := estimator.GetMaxCost(ctx, val, nil, gasLimit, nil) + estimator := gas.NewEvmFeeEstimator(lggr, getRootEst, dynamicFees, geCfg, nil) + total, err := estimator.GetMaxCost(ctx, val, nil, gasLimit, nil, nil, nil) require.NoError(t, err) fee := new(big.Int).Mul(legacyFee.ToInt(), big.NewInt(int64(gasLimit))) fee, _ = new(big.Float).Mul(new(big.Float).SetInt(fee), big.NewFloat(float64(limitMultiplier))).Int(nil) @@ -150,8 +156,8 @@ func TestWrappedEvmEstimator(t *testing.T) { // expect dynamic fee data dynamicFees = true - estimator = gas.NewEvmFeeEstimator(lggr, getRootEst, dynamicFees, geCfg) - total, err = estimator.GetMaxCost(ctx, val, nil, gasLimit, nil) + estimator = gas.NewEvmFeeEstimator(lggr, getRootEst, dynamicFees, geCfg, nil) + total, err = estimator.GetMaxCost(ctx, val, nil, gasLimit, nil, nil, nil) require.NoError(t, err) fee = new(big.Int).Mul(dynamicFee.FeeCap.ToInt(), big.NewInt(int64(gasLimit))) fee, _ = new(big.Float).Mul(new(big.Float).SetInt(fee), big.NewFloat(float64(limitMultiplier))).Int(nil) @@ -166,7 +172,7 @@ func TestWrappedEvmEstimator(t *testing.T) { estimator := gas.NewEvmFeeEstimator(lggr, func(logger.Logger) gas.EvmEstimator { return evmEstimator - }, false, geCfg) + }, false, geCfg, nil) require.Equal(t, mockEstimatorName, estimator.Name()) require.Equal(t, mockEvmEstimatorName, evmEstimator.Name()) @@ -185,7 +191,7 @@ func TestWrappedEvmEstimator(t *testing.T) { evmEstimator.On("L1Oracle", mock.Anything).Return(nil).Twice() - estimator := gas.NewEvmFeeEstimator(lggr, getEst, false, geCfg) + estimator := gas.NewEvmFeeEstimator(lggr, getEst, false, geCfg, nil) err := estimator.Start(ctx) require.NoError(t, err) err = estimator.Close() @@ -193,7 +199,7 @@ func TestWrappedEvmEstimator(t *testing.T) { evmEstimator.On("L1Oracle", mock.Anything).Return(oracle).Twice() - estimator = gas.NewEvmFeeEstimator(lggr, getEst, false, geCfg) + estimator = gas.NewEvmFeeEstimator(lggr, getEst, false, geCfg, nil) err = estimator.Start(ctx) require.NoError(t, err) err = estimator.Close() @@ -210,11 +216,11 @@ func TestWrappedEvmEstimator(t *testing.T) { oracle.On("Ready").Return(nil).Twice() getEst := func(logger.Logger) gas.EvmEstimator { return evmEstimator } - estimator := gas.NewEvmFeeEstimator(lggr, getEst, false, geCfg) + estimator := gas.NewEvmFeeEstimator(lggr, getEst, false, geCfg, nil) err := estimator.Ready() require.NoError(t, err) - estimator = gas.NewEvmFeeEstimator(lggr, getEst, false, geCfg) + estimator = gas.NewEvmFeeEstimator(lggr, getEst, false, geCfg, nil) err = estimator.Ready() require.NoError(t, err) }) @@ -235,7 +241,7 @@ func TestWrappedEvmEstimator(t *testing.T) { oracle.On("HealthReport").Return(map[string]error{oracleKey: oracleError}).Once() getEst := func(logger.Logger) gas.EvmEstimator { return evmEstimator } - estimator := gas.NewEvmFeeEstimator(lggr, getEst, false, geCfg) + estimator := gas.NewEvmFeeEstimator(lggr, getEst, false, geCfg, nil) report := estimator.HealthReport() require.True(t, pkgerrors.Is(report[evmEstimatorKey], evmEstimatorError)) require.Nil(t, report[oracleKey]) @@ -243,10 +249,160 @@ func TestWrappedEvmEstimator(t *testing.T) { evmEstimator.On("L1Oracle").Return(oracle).Once() - estimator = gas.NewEvmFeeEstimator(lggr, getEst, false, geCfg) + estimator = gas.NewEvmFeeEstimator(lggr, getEst, false, geCfg, nil) report = estimator.HealthReport() require.True(t, pkgerrors.Is(report[evmEstimatorKey], evmEstimatorError)) require.True(t, pkgerrors.Is(report[oracleKey], oracleError)) require.NotNil(t, report[mockEstimatorName]) }) + + t.Run("GetFee, estimate gas limit enabled, succeeds", func(t *testing.T) { + estimatedGasLimit := uint64(5) + lggr := logger.Test(t) + // expect legacy fee data + dynamicFees := false + geCfg.EstimateLimitF = true + ethClient := testutils.NewEthClientMockWithDefaultChain(t) + ethClient.On("EstimateGas", mock.Anything, mock.Anything).Return(estimatedGasLimit, nil).Twice() + estimator := gas.NewEvmFeeEstimator(lggr, getRootEst, dynamicFees, geCfg, ethClient) + fee, limit, err := estimator.GetFee(ctx, []byte{}, gasLimit, nil, &fromAddress, &toAddress) + require.NoError(t, err) + assert.Equal(t, uint64(float32(estimatedGasLimit)*gas.EstimateGasBuffer), limit) + assert.True(t, legacyFee.Equal(fee.Legacy)) + assert.Nil(t, fee.DynamicTipCap) + assert.Nil(t, fee.DynamicFeeCap) + + // expect dynamic fee data + dynamicFees = true + estimator = gas.NewEvmFeeEstimator(lggr, getRootEst, dynamicFees, geCfg, ethClient) + fee, limit, err = estimator.GetFee(ctx, []byte{}, gasLimit, nil, &fromAddress, &toAddress) + require.NoError(t, err) + assert.Equal(t, uint64(float32(estimatedGasLimit)*gas.EstimateGasBuffer), limit) + assert.True(t, dynamicFee.FeeCap.Equal(fee.DynamicFeeCap)) + assert.True(t, dynamicFee.TipCap.Equal(fee.DynamicTipCap)) + assert.Nil(t, fee.Legacy) + }) + + t.Run("GetFee, estimate gas limit enabled, estimate exceeds provided limit, returns error", func(t *testing.T) { + estimatedGasLimit := uint64(100) + lggr := logger.Test(t) + // expect legacy fee data + dynamicFees := false + geCfg.EstimateLimitF = true + ethClient := testutils.NewEthClientMockWithDefaultChain(t) + ethClient.On("EstimateGas", mock.Anything, mock.Anything).Return(estimatedGasLimit, nil).Twice() + estimator := gas.NewEvmFeeEstimator(lggr, getRootEst, dynamicFees, geCfg, ethClient) + _, _, err := estimator.GetFee(ctx, []byte{}, gasLimit, nil, &fromAddress, &toAddress) + require.ErrorIs(t, err, commonfee.ErrFeeLimitTooLow) + + // expect dynamic fee data + dynamicFees = true + estimator = gas.NewEvmFeeEstimator(lggr, getRootEst, dynamicFees, geCfg, ethClient) + _, _, err = estimator.GetFee(ctx, []byte{}, gasLimit, nil, &fromAddress, &toAddress) + require.ErrorIs(t, err, commonfee.ErrFeeLimitTooLow) + }) + + t.Run("GetFee, estimate gas limit enabled, buffer exceeds provided limit, fallsback to provided limit", func(t *testing.T) { + estimatedGasLimit := uint64(15) // same as provided limit + lggr := logger.Test(t) + dynamicFees := false // expect legacy fee data + geCfg.EstimateLimitF = true + ethClient := testutils.NewEthClientMockWithDefaultChain(t) + ethClient.On("EstimateGas", mock.Anything, mock.Anything).Return(estimatedGasLimit, nil).Twice() + estimator := gas.NewEvmFeeEstimator(lggr, getRootEst, dynamicFees, geCfg, ethClient) + fee, limit, err := estimator.GetFee(ctx, []byte{}, gasLimit, nil, &fromAddress, &toAddress) + require.NoError(t, err) + assert.Equal(t, uint64(float32(gasLimit)*limitMultiplier), limit) + assert.True(t, legacyFee.Equal(fee.Legacy)) + assert.Nil(t, fee.DynamicTipCap) + assert.Nil(t, fee.DynamicFeeCap) + + dynamicFees = true // expect dynamic fee data + estimator = gas.NewEvmFeeEstimator(lggr, getRootEst, dynamicFees, geCfg, ethClient) + fee, limit, err = estimator.GetFee(ctx, []byte{}, gasLimit, nil, &fromAddress, &toAddress) + require.NoError(t, err) + assert.Equal(t, uint64(float32(gasLimit)*limitMultiplier), limit) + assert.True(t, dynamicFee.FeeCap.Equal(fee.DynamicFeeCap)) + assert.True(t, dynamicFee.TipCap.Equal(fee.DynamicTipCap)) + assert.Nil(t, fee.Legacy) + }) + + t.Run("GetFee, estimate gas limit enabled, RPC fails and fallsback to provided gas limit", func(t *testing.T) { + lggr := logger.Test(t) + // expect legacy fee data + dynamicFees := false + geCfg.EstimateLimitF = true + ethClient := testutils.NewEthClientMockWithDefaultChain(t) + ethClient.On("EstimateGas", mock.Anything, mock.Anything).Return(uint64(0), errors.New("something broke")).Twice() + estimator := gas.NewEvmFeeEstimator(lggr, getRootEst, dynamicFees, geCfg, ethClient) + fee, limit, err := estimator.GetFee(ctx, []byte{}, gasLimit, nil, &fromAddress, &toAddress) + require.NoError(t, err) + assert.Equal(t, uint64(float32(gasLimit)*limitMultiplier), limit) + assert.True(t, legacyFee.Equal(fee.Legacy)) + assert.Nil(t, fee.DynamicTipCap) + assert.Nil(t, fee.DynamicFeeCap) + + // expect dynamic fee data + dynamicFees = true + estimator = gas.NewEvmFeeEstimator(lggr, getRootEst, dynamicFees, geCfg, ethClient) + fee, limit, err = estimator.GetFee(ctx, []byte{}, gasLimit, nil, &fromAddress, &toAddress) + require.NoError(t, err) + assert.Equal(t, uint64(float32(gasLimit)*limitMultiplier), limit) + assert.True(t, dynamicFee.FeeCap.Equal(fee.DynamicFeeCap)) + assert.True(t, dynamicFee.TipCap.Equal(fee.DynamicTipCap)) + assert.Nil(t, fee.Legacy) + }) + + t.Run("GetFee, estimate gas limit enabled, provided fee limit 0, returns uncapped estimation", func(t *testing.T) { + est.On("GetDynamicFee", mock.Anything, mock.Anything). + Return(dynamicFee, nil).Once() + est.On("GetLegacyGas", mock.Anything, mock.Anything, uint64(0), mock.Anything). + Return(legacyFee, uint64(0), nil).Once() + estimatedGasLimit := uint64(100) // same as provided limit + lggr := logger.Test(t) + // expect legacy fee data + dynamicFees := false + geCfg.EstimateLimitF = true + ethClient := testutils.NewEthClientMockWithDefaultChain(t) + ethClient.On("EstimateGas", mock.Anything, mock.Anything).Return(estimatedGasLimit, nil).Twice() + estimator := gas.NewEvmFeeEstimator(lggr, getRootEst, dynamicFees, geCfg, ethClient) + fee, limit, err := estimator.GetFee(ctx, []byte{}, uint64(0), nil, &fromAddress, &toAddress) + require.NoError(t, err) + assert.Equal(t, uint64(float32(estimatedGasLimit)*gas.EstimateGasBuffer), limit) + assert.True(t, legacyFee.Equal(fee.Legacy)) + assert.Nil(t, fee.DynamicTipCap) + assert.Nil(t, fee.DynamicFeeCap) + + // expect dynamic fee data + dynamicFees = true + estimator = gas.NewEvmFeeEstimator(lggr, getRootEst, dynamicFees, geCfg, ethClient) + fee, limit, err = estimator.GetFee(ctx, []byte{}, 0, nil, &fromAddress, &toAddress) + require.NoError(t, err) + assert.Equal(t, uint64(float32(estimatedGasLimit)*gas.EstimateGasBuffer), limit) + assert.True(t, dynamicFee.FeeCap.Equal(fee.DynamicFeeCap)) + assert.True(t, dynamicFee.TipCap.Equal(fee.DynamicTipCap)) + assert.Nil(t, fee.Legacy) + }) + + t.Run("GetFee, estimate gas limit enabled, provided fee limit 0, returns error on failure", func(t *testing.T) { + est.On("GetDynamicFee", mock.Anything, mock.Anything). + Return(dynamicFee, nil).Once() + est.On("GetLegacyGas", mock.Anything, mock.Anything, uint64(0), mock.Anything). + Return(legacyFee, uint64(0), nil).Once() + lggr := logger.Test(t) + // expect legacy fee data + dynamicFees := false + geCfg.EstimateLimitF = true + ethClient := testutils.NewEthClientMockWithDefaultChain(t) + ethClient.On("EstimateGas", mock.Anything, mock.Anything).Return(uint64(0), errors.New("something broke")).Twice() + estimator := gas.NewEvmFeeEstimator(lggr, getRootEst, dynamicFees, geCfg, ethClient) + _, _, err := estimator.GetFee(ctx, []byte{}, 0, nil, &fromAddress, &toAddress) + require.Error(t, err) + + // expect dynamic fee data + dynamicFees = true + estimator = gas.NewEvmFeeEstimator(lggr, getRootEst, dynamicFees, geCfg, ethClient) + _, _, err = estimator.GetFee(ctx, []byte{}, 0, nil, &fromAddress, &toAddress) + require.Error(t, err) + }) } diff --git a/core/chains/evm/gas/rollups/arbitrum_l1_oracle.go b/core/chains/evm/gas/rollups/arbitrum_l1_oracle.go index c01244db70c..d758dc711e9 100644 --- a/core/chains/evm/gas/rollups/arbitrum_l1_oracle.go +++ b/core/chains/evm/gas/rollups/arbitrum_l1_oracle.go @@ -112,6 +112,10 @@ func (o *arbitrumL1Oracle) Name() string { return o.logger.Name() } +func (o *arbitrumL1Oracle) ChainType(_ context.Context) chaintype.ChainType { + return o.chainType +} + func (o *arbitrumL1Oracle) Start(ctx context.Context) error { return o.StartOnce(o.Name(), func() error { go o.run() diff --git a/core/chains/evm/gas/rollups/l1_oracle.go b/core/chains/evm/gas/rollups/l1_oracle.go index 234ddd9fdc9..41951755986 100644 --- a/core/chains/evm/gas/rollups/l1_oracle.go +++ b/core/chains/evm/gas/rollups/l1_oracle.go @@ -21,16 +21,14 @@ import ( // L1Oracle provides interface for fetching L1-specific fee components if the chain is an L2. // For example, on Optimistic Rollups, this oracle can return rollup-specific l1BaseFee -// -//go:generate mockery --quiet --name L1Oracle --output ./mocks/ --case=underscore type L1Oracle interface { services.Service GasPrice(ctx context.Context) (*assets.Wei, error) GetGasCost(ctx context.Context, tx *types.Transaction, blockNum *big.Int) (*assets.Wei, error) + ChainType(ctx context.Context) chaintype.ChainType } -//go:generate mockery --quiet --name l1OracleClient --output ./mocks/ --case=underscore --structname L1OracleClient type l1OracleClient interface { CallContract(ctx context.Context, msg ethereum.CallMsg, blockNumber *big.Int) ([]byte, error) BatchCallContext(ctx context.Context, b []rpc.BatchElem) error @@ -46,7 +44,7 @@ const ( PollPeriod = 6 * time.Second ) -var supportedChainTypes = []chaintype.ChainType{chaintype.ChainArbitrum, chaintype.ChainOptimismBedrock, chaintype.ChainKroma, chaintype.ChainScroll, chaintype.ChainZkSync} +var supportedChainTypes = []chaintype.ChainType{chaintype.ChainArbitrum, chaintype.ChainOptimismBedrock, chaintype.ChainKroma, chaintype.ChainScroll, chaintype.ChainZkSync, chaintype.ChainMantle} func IsRollupWithL1Support(chainType chaintype.ChainType) bool { return slices.Contains(supportedChainTypes, chainType) @@ -59,7 +57,7 @@ func NewL1GasOracle(lggr logger.Logger, ethClient l1OracleClient, chainType chai var l1Oracle L1Oracle var err error switch chainType { - case chaintype.ChainOptimismBedrock, chaintype.ChainKroma, chaintype.ChainScroll: + case chaintype.ChainOptimismBedrock, chaintype.ChainKroma, chaintype.ChainScroll, chaintype.ChainMantle: l1Oracle, err = NewOpStackL1GasOracle(lggr, ethClient, chainType) case chaintype.ChainArbitrum: l1Oracle, err = NewArbitrumL1GasOracle(lggr, ethClient) diff --git a/core/chains/evm/gas/rollups/mocks/l1_oracle.go b/core/chains/evm/gas/rollups/mocks/l1_oracle.go index f9f0a34b8a7..25bb3a2db59 100644 --- a/core/chains/evm/gas/rollups/mocks/l1_oracle.go +++ b/core/chains/evm/gas/rollups/mocks/l1_oracle.go @@ -7,6 +7,8 @@ import ( assets "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" + chaintype "github.com/smartcontractkit/chainlink/v2/core/chains/evm/config/chaintype" + context "context" mock "github.com/stretchr/testify/mock" @@ -19,6 +21,60 @@ type L1Oracle struct { mock.Mock } +type L1Oracle_Expecter struct { + mock *mock.Mock +} + +func (_m *L1Oracle) EXPECT() *L1Oracle_Expecter { + return &L1Oracle_Expecter{mock: &_m.Mock} +} + +// ChainType provides a mock function with given fields: ctx +func (_m *L1Oracle) ChainType(ctx context.Context) chaintype.ChainType { + ret := _m.Called(ctx) + + if len(ret) == 0 { + panic("no return value specified for ChainType") + } + + var r0 chaintype.ChainType + if rf, ok := ret.Get(0).(func(context.Context) chaintype.ChainType); ok { + r0 = rf(ctx) + } else { + r0 = ret.Get(0).(chaintype.ChainType) + } + + return r0 +} + +// L1Oracle_ChainType_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ChainType' +type L1Oracle_ChainType_Call struct { + *mock.Call +} + +// ChainType is a helper method to define mock.On call +// - ctx context.Context +func (_e *L1Oracle_Expecter) ChainType(ctx interface{}) *L1Oracle_ChainType_Call { + return &L1Oracle_ChainType_Call{Call: _e.mock.On("ChainType", ctx)} +} + +func (_c *L1Oracle_ChainType_Call) Run(run func(ctx context.Context)) *L1Oracle_ChainType_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *L1Oracle_ChainType_Call) Return(_a0 chaintype.ChainType) *L1Oracle_ChainType_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *L1Oracle_ChainType_Call) RunAndReturn(run func(context.Context) chaintype.ChainType) *L1Oracle_ChainType_Call { + _c.Call.Return(run) + return _c +} + // Close provides a mock function with given fields: func (_m *L1Oracle) Close() error { ret := _m.Called() @@ -37,6 +93,33 @@ func (_m *L1Oracle) Close() error { return r0 } +// L1Oracle_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close' +type L1Oracle_Close_Call struct { + *mock.Call +} + +// Close is a helper method to define mock.On call +func (_e *L1Oracle_Expecter) Close() *L1Oracle_Close_Call { + return &L1Oracle_Close_Call{Call: _e.mock.On("Close")} +} + +func (_c *L1Oracle_Close_Call) Run(run func()) *L1Oracle_Close_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *L1Oracle_Close_Call) Return(_a0 error) *L1Oracle_Close_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *L1Oracle_Close_Call) RunAndReturn(run func() error) *L1Oracle_Close_Call { + _c.Call.Return(run) + return _c +} + // GasPrice provides a mock function with given fields: ctx func (_m *L1Oracle) GasPrice(ctx context.Context) (*assets.Wei, error) { ret := _m.Called(ctx) @@ -67,6 +150,34 @@ func (_m *L1Oracle) GasPrice(ctx context.Context) (*assets.Wei, error) { return r0, r1 } +// L1Oracle_GasPrice_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GasPrice' +type L1Oracle_GasPrice_Call struct { + *mock.Call +} + +// GasPrice is a helper method to define mock.On call +// - ctx context.Context +func (_e *L1Oracle_Expecter) GasPrice(ctx interface{}) *L1Oracle_GasPrice_Call { + return &L1Oracle_GasPrice_Call{Call: _e.mock.On("GasPrice", ctx)} +} + +func (_c *L1Oracle_GasPrice_Call) Run(run func(ctx context.Context)) *L1Oracle_GasPrice_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *L1Oracle_GasPrice_Call) Return(_a0 *assets.Wei, _a1 error) *L1Oracle_GasPrice_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *L1Oracle_GasPrice_Call) RunAndReturn(run func(context.Context) (*assets.Wei, error)) *L1Oracle_GasPrice_Call { + _c.Call.Return(run) + return _c +} + // GetGasCost provides a mock function with given fields: ctx, tx, blockNum func (_m *L1Oracle) GetGasCost(ctx context.Context, tx *types.Transaction, blockNum *big.Int) (*assets.Wei, error) { ret := _m.Called(ctx, tx, blockNum) @@ -97,6 +208,36 @@ func (_m *L1Oracle) GetGasCost(ctx context.Context, tx *types.Transaction, block return r0, r1 } +// L1Oracle_GetGasCost_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetGasCost' +type L1Oracle_GetGasCost_Call struct { + *mock.Call +} + +// GetGasCost is a helper method to define mock.On call +// - ctx context.Context +// - tx *types.Transaction +// - blockNum *big.Int +func (_e *L1Oracle_Expecter) GetGasCost(ctx interface{}, tx interface{}, blockNum interface{}) *L1Oracle_GetGasCost_Call { + return &L1Oracle_GetGasCost_Call{Call: _e.mock.On("GetGasCost", ctx, tx, blockNum)} +} + +func (_c *L1Oracle_GetGasCost_Call) Run(run func(ctx context.Context, tx *types.Transaction, blockNum *big.Int)) *L1Oracle_GetGasCost_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*types.Transaction), args[2].(*big.Int)) + }) + return _c +} + +func (_c *L1Oracle_GetGasCost_Call) Return(_a0 *assets.Wei, _a1 error) *L1Oracle_GetGasCost_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *L1Oracle_GetGasCost_Call) RunAndReturn(run func(context.Context, *types.Transaction, *big.Int) (*assets.Wei, error)) *L1Oracle_GetGasCost_Call { + _c.Call.Return(run) + return _c +} + // HealthReport provides a mock function with given fields: func (_m *L1Oracle) HealthReport() map[string]error { ret := _m.Called() @@ -117,6 +258,33 @@ func (_m *L1Oracle) HealthReport() map[string]error { return r0 } +// L1Oracle_HealthReport_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HealthReport' +type L1Oracle_HealthReport_Call struct { + *mock.Call +} + +// HealthReport is a helper method to define mock.On call +func (_e *L1Oracle_Expecter) HealthReport() *L1Oracle_HealthReport_Call { + return &L1Oracle_HealthReport_Call{Call: _e.mock.On("HealthReport")} +} + +func (_c *L1Oracle_HealthReport_Call) Run(run func()) *L1Oracle_HealthReport_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *L1Oracle_HealthReport_Call) Return(_a0 map[string]error) *L1Oracle_HealthReport_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *L1Oracle_HealthReport_Call) RunAndReturn(run func() map[string]error) *L1Oracle_HealthReport_Call { + _c.Call.Return(run) + return _c +} + // Name provides a mock function with given fields: func (_m *L1Oracle) Name() string { ret := _m.Called() @@ -135,6 +303,33 @@ func (_m *L1Oracle) Name() string { return r0 } +// L1Oracle_Name_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Name' +type L1Oracle_Name_Call struct { + *mock.Call +} + +// Name is a helper method to define mock.On call +func (_e *L1Oracle_Expecter) Name() *L1Oracle_Name_Call { + return &L1Oracle_Name_Call{Call: _e.mock.On("Name")} +} + +func (_c *L1Oracle_Name_Call) Run(run func()) *L1Oracle_Name_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *L1Oracle_Name_Call) Return(_a0 string) *L1Oracle_Name_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *L1Oracle_Name_Call) RunAndReturn(run func() string) *L1Oracle_Name_Call { + _c.Call.Return(run) + return _c +} + // Ready provides a mock function with given fields: func (_m *L1Oracle) Ready() error { ret := _m.Called() @@ -153,6 +348,33 @@ func (_m *L1Oracle) Ready() error { return r0 } +// L1Oracle_Ready_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Ready' +type L1Oracle_Ready_Call struct { + *mock.Call +} + +// Ready is a helper method to define mock.On call +func (_e *L1Oracle_Expecter) Ready() *L1Oracle_Ready_Call { + return &L1Oracle_Ready_Call{Call: _e.mock.On("Ready")} +} + +func (_c *L1Oracle_Ready_Call) Run(run func()) *L1Oracle_Ready_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *L1Oracle_Ready_Call) Return(_a0 error) *L1Oracle_Ready_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *L1Oracle_Ready_Call) RunAndReturn(run func() error) *L1Oracle_Ready_Call { + _c.Call.Return(run) + return _c +} + // Start provides a mock function with given fields: _a0 func (_m *L1Oracle) Start(_a0 context.Context) error { ret := _m.Called(_a0) @@ -171,6 +393,34 @@ func (_m *L1Oracle) Start(_a0 context.Context) error { return r0 } +// L1Oracle_Start_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Start' +type L1Oracle_Start_Call struct { + *mock.Call +} + +// Start is a helper method to define mock.On call +// - _a0 context.Context +func (_e *L1Oracle_Expecter) Start(_a0 interface{}) *L1Oracle_Start_Call { + return &L1Oracle_Start_Call{Call: _e.mock.On("Start", _a0)} +} + +func (_c *L1Oracle_Start_Call) Run(run func(_a0 context.Context)) *L1Oracle_Start_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *L1Oracle_Start_Call) Return(_a0 error) *L1Oracle_Start_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *L1Oracle_Start_Call) RunAndReturn(run func(context.Context) error) *L1Oracle_Start_Call { + _c.Call.Return(run) + return _c +} + // NewL1Oracle creates a new instance of L1Oracle. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewL1Oracle(t interface { diff --git a/core/chains/evm/gas/rollups/mocks/l1_oracle_client.go b/core/chains/evm/gas/rollups/mocks/l1_oracle_client.go index 9225c247ca4..1b678b8843a 100644 --- a/core/chains/evm/gas/rollups/mocks/l1_oracle_client.go +++ b/core/chains/evm/gas/rollups/mocks/l1_oracle_client.go @@ -18,6 +18,14 @@ type L1OracleClient struct { mock.Mock } +type L1OracleClient_Expecter struct { + mock *mock.Mock +} + +func (_m *L1OracleClient) EXPECT() *L1OracleClient_Expecter { + return &L1OracleClient_Expecter{mock: &_m.Mock} +} + // BatchCallContext provides a mock function with given fields: ctx, b func (_m *L1OracleClient) BatchCallContext(ctx context.Context, b []rpc.BatchElem) error { ret := _m.Called(ctx, b) @@ -36,6 +44,35 @@ func (_m *L1OracleClient) BatchCallContext(ctx context.Context, b []rpc.BatchEle return r0 } +// L1OracleClient_BatchCallContext_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BatchCallContext' +type L1OracleClient_BatchCallContext_Call struct { + *mock.Call +} + +// BatchCallContext is a helper method to define mock.On call +// - ctx context.Context +// - b []rpc.BatchElem +func (_e *L1OracleClient_Expecter) BatchCallContext(ctx interface{}, b interface{}) *L1OracleClient_BatchCallContext_Call { + return &L1OracleClient_BatchCallContext_Call{Call: _e.mock.On("BatchCallContext", ctx, b)} +} + +func (_c *L1OracleClient_BatchCallContext_Call) Run(run func(ctx context.Context, b []rpc.BatchElem)) *L1OracleClient_BatchCallContext_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].([]rpc.BatchElem)) + }) + return _c +} + +func (_c *L1OracleClient_BatchCallContext_Call) Return(_a0 error) *L1OracleClient_BatchCallContext_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *L1OracleClient_BatchCallContext_Call) RunAndReturn(run func(context.Context, []rpc.BatchElem) error) *L1OracleClient_BatchCallContext_Call { + _c.Call.Return(run) + return _c +} + // CallContract provides a mock function with given fields: ctx, msg, blockNumber func (_m *L1OracleClient) CallContract(ctx context.Context, msg ethereum.CallMsg, blockNumber *big.Int) ([]byte, error) { ret := _m.Called(ctx, msg, blockNumber) @@ -66,6 +103,36 @@ func (_m *L1OracleClient) CallContract(ctx context.Context, msg ethereum.CallMsg return r0, r1 } +// L1OracleClient_CallContract_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CallContract' +type L1OracleClient_CallContract_Call struct { + *mock.Call +} + +// CallContract is a helper method to define mock.On call +// - ctx context.Context +// - msg ethereum.CallMsg +// - blockNumber *big.Int +func (_e *L1OracleClient_Expecter) CallContract(ctx interface{}, msg interface{}, blockNumber interface{}) *L1OracleClient_CallContract_Call { + return &L1OracleClient_CallContract_Call{Call: _e.mock.On("CallContract", ctx, msg, blockNumber)} +} + +func (_c *L1OracleClient_CallContract_Call) Run(run func(ctx context.Context, msg ethereum.CallMsg, blockNumber *big.Int)) *L1OracleClient_CallContract_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(ethereum.CallMsg), args[2].(*big.Int)) + }) + return _c +} + +func (_c *L1OracleClient_CallContract_Call) Return(_a0 []byte, _a1 error) *L1OracleClient_CallContract_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *L1OracleClient_CallContract_Call) RunAndReturn(run func(context.Context, ethereum.CallMsg, *big.Int) ([]byte, error)) *L1OracleClient_CallContract_Call { + _c.Call.Return(run) + return _c +} + // NewL1OracleClient creates a new instance of L1OracleClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewL1OracleClient(t interface { diff --git a/core/chains/evm/gas/rollups/op_l1_oracle.go b/core/chains/evm/gas/rollups/op_l1_oracle.go index 6805cd7095b..11babc5ca5d 100644 --- a/core/chains/evm/gas/rollups/op_l1_oracle.go +++ b/core/chains/evm/gas/rollups/op_l1_oracle.go @@ -50,6 +50,7 @@ type optimismL1Oracle struct { blobBaseFeeCalldata []byte blobBaseFeeScalarCalldata []byte decimalsCalldata []byte + tokenRatioCalldata []byte isEcotoneCalldata []byte isEcotoneMethodAbi abi.ABI isFjordCalldata []byte @@ -87,7 +88,7 @@ const ( // decimals is a hex encoded call to: // `function decimals() public pure returns (uint256);` decimalsMethod = "decimals" - // OPGasOracleAddress is the address of the precompiled contract that exists on Optimism and Base. + // OPGasOracleAddress is the address of the precompiled contract that exists on Optimism, Base and Mantle. OPGasOracleAddress = "0x420000000000000000000000000000000000000F" // KromaGasOracleAddress is the address of the precompiled contract that exists on Kroma. KromaGasOracleAddress = "0x4200000000000000000000000000000000000005" @@ -98,7 +99,7 @@ const ( func NewOpStackL1GasOracle(lggr logger.Logger, ethClient l1OracleClient, chainType chaintype.ChainType) (*optimismL1Oracle, error) { var precompileAddress string switch chainType { - case chaintype.ChainOptimismBedrock: + case chaintype.ChainOptimismBedrock, chaintype.ChainMantle: precompileAddress = OPGasOracleAddress case chaintype.ChainKroma: precompileAddress = KromaGasOracleAddress @@ -219,6 +220,10 @@ func (o *optimismL1Oracle) Name() string { return o.logger.Name() } +func (o *optimismL1Oracle) ChainType(_ context.Context) chaintype.ChainType { + return o.chainType +} + func (o *optimismL1Oracle) Start(ctx context.Context) error { return o.StartOnce(o.Name(), func() error { go o.run() diff --git a/core/chains/evm/gas/rollups/zkSync_l1_oracle.go b/core/chains/evm/gas/rollups/zkSync_l1_oracle.go index 31d93bc587d..c2941233545 100644 --- a/core/chains/evm/gas/rollups/zkSync_l1_oracle.go +++ b/core/chains/evm/gas/rollups/zkSync_l1_oracle.go @@ -83,6 +83,10 @@ func (o *zkSyncL1Oracle) Name() string { return o.logger.Name() } +func (o *zkSyncL1Oracle) ChainType(_ context.Context) chaintype.ChainType { + return o.chainType +} + func (o *zkSyncL1Oracle) Start(ctx context.Context) error { return o.StartOnce(o.Name(), func() error { go o.run() diff --git a/core/chains/evm/headtracker/head_listener.go b/core/chains/evm/headtracker/head_listener.go deleted file mode 100644 index 04535a34868..00000000000 --- a/core/chains/evm/headtracker/head_listener.go +++ /dev/null @@ -1,28 +0,0 @@ -package headtracker - -import ( - "math/big" - - "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/common" - - "github.com/smartcontractkit/chainlink-common/pkg/logger" - "github.com/smartcontractkit/chainlink/v2/common/headtracker" - - htrktypes "github.com/smartcontractkit/chainlink/v2/common/headtracker/types" - evmclient "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" - evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" -) - -type headListener = headtracker.HeadListener[*evmtypes.Head, common.Hash] - -func NewHeadListener( - lggr logger.Logger, - ethClient evmclient.Client, - config htrktypes.Config, chStop chan struct{}, -) headListener { - return headtracker.NewHeadListener[ - *evmtypes.Head, - ethereum.Subscription, *big.Int, common.Hash, - ](lggr, ethClient, config, chStop) -} diff --git a/core/chains/evm/headtracker/head_listener_test.go b/core/chains/evm/headtracker/head_listener_test.go index 29b090bbffe..2e459af2a2b 100644 --- a/core/chains/evm/headtracker/head_listener_test.go +++ b/core/chains/evm/headtracker/head_listener_test.go @@ -16,9 +16,9 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" + "github.com/smartcontractkit/chainlink/v2/common/headtracker" commonmocks "github.com/smartcontractkit/chainlink/v2/common/types/mocks" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/config/toml" - "github.com/smartcontractkit/chainlink/v2/core/chains/evm/headtracker" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/testutils" evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" ) @@ -40,17 +40,10 @@ func Test_HeadListener_HappyPath(t *testing.T) { evmcfg := testutils.NewTestChainScopedConfig(t, func(c *toml.EVMConfig) { c.NoNewHeadsThreshold = &commonconfig.Duration{} }) - chStop := make(chan struct{}) - hl := headtracker.NewHeadListener(lggr, ethClient, evmcfg.EVM(), chStop) var headCount atomic.Int32 - handler := func(context.Context, *evmtypes.Head) error { - headCount.Add(1) - return nil - } - - subscribeAwaiter := testutils.NewAwaiter() unsubscribeAwaiter := testutils.NewAwaiter() + subscribeAwaiter := testutils.NewAwaiter() var chHeads chan<- *evmtypes.Head var chErr = make(chan error) var chSubErr <-chan error = chErr @@ -66,23 +59,23 @@ func Test_HeadListener_HappyPath(t *testing.T) { close(chErr) }) - doneAwaiter := testutils.NewAwaiter() - done := func() { - doneAwaiter.ItHappened() - } - go hl.ListenForNewHeads(func() {}, handler, done) - - subscribeAwaiter.AwaitOrFail(t, tests.WaitTimeout(t)) - require.Eventually(t, hl.Connected, tests.WaitTimeout(t), tests.TestInterval) + func() { + hl := headtracker.NewHeadListener(lggr, ethClient, evmcfg.EVM(), nil, func(context.Context, *evmtypes.Head) error { + headCount.Add(1) + return nil + }) + require.NoError(t, hl.Start(tests.Context(t))) + defer func() { assert.NoError(t, hl.Close()) }() - chHeads <- testutils.Head(0) - chHeads <- testutils.Head(1) - chHeads <- testutils.Head(2) + subscribeAwaiter.AwaitOrFail(t, tests.WaitTimeout(t)) + require.Eventually(t, hl.Connected, tests.WaitTimeout(t), tests.TestInterval) - require.True(t, hl.ReceivingHeads()) + chHeads <- testutils.Head(0) + chHeads <- testutils.Head(1) + chHeads <- testutils.Head(2) - close(chStop) - doneAwaiter.AwaitOrFail(t) + require.True(t, hl.ReceivingHeads()) + }() unsubscribeAwaiter.AwaitOrFail(t) require.Equal(t, int32(3), headCount.Load()) @@ -101,14 +94,8 @@ func Test_HeadListener_NotReceivingHeads(t *testing.T) { evmcfg := testutils.NewTestChainScopedConfig(t, func(c *toml.EVMConfig) { c.NoNewHeadsThreshold = commonconfig.MustNewDuration(time.Second) }) - chStop := make(chan struct{}) - hl := headtracker.NewHeadListener(lggr, ethClient, evmcfg.EVM(), chStop) firstHeadAwaiter := testutils.NewAwaiter() - handler := func(context.Context, *evmtypes.Head) error { - firstHeadAwaiter.ItHappened() - return nil - } subscribeAwaiter := testutils.NewAwaiter() var chHeads chan<- *evmtypes.Head @@ -125,25 +112,25 @@ func Test_HeadListener_NotReceivingHeads(t *testing.T) { close(chErr) }) - doneAwaiter := testutils.NewAwaiter() - done := func() { - doneAwaiter.ItHappened() - } - go hl.ListenForNewHeads(func() {}, handler, done) - - subscribeAwaiter.AwaitOrFail(t, tests.WaitTimeout(t)) + func() { + hl := headtracker.NewHeadListener(lggr, ethClient, evmcfg.EVM(), nil, func(context.Context, *evmtypes.Head) error { + firstHeadAwaiter.ItHappened() + return nil + }) + require.NoError(t, hl.Start(tests.Context(t))) + defer func() { assert.NoError(t, hl.Close()) }() - chHeads <- testutils.Head(0) - firstHeadAwaiter.AwaitOrFail(t) + subscribeAwaiter.AwaitOrFail(t, tests.WaitTimeout(t)) - require.True(t, hl.ReceivingHeads()) + chHeads <- testutils.Head(0) + firstHeadAwaiter.AwaitOrFail(t) - time.Sleep(time.Second * 2) + require.True(t, hl.ReceivingHeads()) - require.False(t, hl.ReceivingHeads()) + time.Sleep(time.Second * 2) - close(chStop) - doneAwaiter.AwaitOrFail(t) + require.False(t, hl.ReceivingHeads()) + }() } func Test_HeadListener_SubscriptionErr(t *testing.T) { @@ -161,19 +148,11 @@ func Test_HeadListener_SubscriptionErr(t *testing.T) { for _, test := range cases { test := test t.Run(test.name, func(t *testing.T) { - l := logger.Test(t) + lggr := logger.Test(t) ethClient := testutils.NewEthClientMockWithDefaultChain(t) evmcfg := testutils.NewTestChainScopedConfig(t, nil) - chStop := make(chan struct{}) - hl := headtracker.NewHeadListener(l, ethClient, evmcfg.EVM(), chStop) hnhCalled := make(chan *evmtypes.Head) - hnh := func(_ context.Context, header *evmtypes.Head) error { - hnhCalled <- header - return nil - } - doneAwaiter := testutils.NewAwaiter() - done := doneAwaiter.ItHappened chSubErrTest := make(chan error) var chSubErr <-chan error = chSubErrTest @@ -189,63 +168,66 @@ func Test_HeadListener_SubscriptionErr(t *testing.T) { headsCh = args.Get(1).(chan<- *evmtypes.Head) subscribeAwaiter.ItHappened() }) - go func() { - hl.ListenForNewHeads(func() {}, hnh, done) - }() - - // Put a head on the channel to ensure we test all code paths - subscribeAwaiter.AwaitOrFail(t, tests.WaitTimeout(t)) - head := testutils.Head(0) - headsCh <- head - - h := <-hnhCalled - assert.Equal(t, head, h) - - // Expect a call to unsubscribe on error - sub.On("Unsubscribe").Once().Run(func(_ mock.Arguments) { - close(headsCh) - // geth guarantees that Unsubscribe closes the errors channel - if !test.closeErr { + func() { + hl := headtracker.NewHeadListener(lggr, ethClient, evmcfg.EVM(), nil, func(_ context.Context, header *evmtypes.Head) error { + hnhCalled <- header + return nil + }) + require.NoError(t, hl.Start(tests.Context(t))) + defer func() { assert.NoError(t, hl.Close()) }() + + // Put a head on the channel to ensure we test all code paths + subscribeAwaiter.AwaitOrFail(t, tests.WaitTimeout(t)) + head := testutils.Head(0) + headsCh <- head + + h := <-hnhCalled + assert.Equal(t, head, h) + + // Expect a call to unsubscribe on error + sub.On("Unsubscribe").Once().Run(func(_ mock.Arguments) { + close(headsCh) + // geth guarantees that Unsubscribe closes the errors channel + if !test.closeErr { + close(chSubErrTest) + } + }) + // Expect a resubscribe + chSubErrTest2 := make(chan error) + var chSubErr2 <-chan error = chSubErrTest2 + sub2 := commonmocks.NewSubscription(t) + sub2.On("Err").Return(chSubErr2) + subscribeAwaiter2 := testutils.NewAwaiter() + + var headsCh2 chan<- *evmtypes.Head + ethClient.On("SubscribeNewHead", mock.Anything, mock.AnythingOfType("chan<- *types.Head")).Return(sub2, nil).Once().Run(func(args mock.Arguments) { + headsCh2 = args.Get(1).(chan<- *evmtypes.Head) + subscribeAwaiter2.ItHappened() + }) + + // Sending test error + if test.closeErr { close(chSubErrTest) + } else { + chSubErrTest <- test.err } - }) - // Expect a resubscribe - chSubErrTest2 := make(chan error) - var chSubErr2 <-chan error = chSubErrTest2 - sub2 := commonmocks.NewSubscription(t) - sub2.On("Err").Return(chSubErr2) - subscribeAwaiter2 := testutils.NewAwaiter() - - var headsCh2 chan<- *evmtypes.Head - ethClient.On("SubscribeNewHead", mock.Anything, mock.AnythingOfType("chan<- *types.Head")).Return(sub2, nil).Once().Run(func(args mock.Arguments) { - headsCh2 = args.Get(1).(chan<- *evmtypes.Head) - subscribeAwaiter2.ItHappened() - }) - - // Sending test error - if test.closeErr { - close(chSubErrTest) - } else { - chSubErrTest <- test.err - } - // Wait for it to resubscribe - subscribeAwaiter2.AwaitOrFail(t, tests.WaitTimeout(t)) + // Wait for it to resubscribe + subscribeAwaiter2.AwaitOrFail(t, tests.WaitTimeout(t)) - head2 := testutils.Head(1) - headsCh2 <- head2 + head2 := testutils.Head(1) + headsCh2 <- head2 - h2 := <-hnhCalled - assert.Equal(t, head2, h2) + h2 := <-hnhCalled + assert.Equal(t, head2, h2) - // Second call to unsubscribe on close - sub2.On("Unsubscribe").Once().Run(func(_ mock.Arguments) { - close(headsCh2) - // geth guarantees that Unsubscribe closes the errors channel - close(chSubErrTest2) - }) - close(chStop) - doneAwaiter.AwaitOrFail(t) + // Second call to unsubscribe on close + sub2.On("Unsubscribe").Once().Run(func(_ mock.Arguments) { + close(headsCh2) + // geth guarantees that Unsubscribe closes the errors channel + close(chSubErrTest2) + }) + }() }) } } diff --git a/core/chains/evm/headtracker/head_saver.go b/core/chains/evm/headtracker/head_saver.go index 320e88a19bc..f2613334c49 100644 --- a/core/chains/evm/headtracker/head_saver.go +++ b/core/chains/evm/headtracker/head_saver.go @@ -35,13 +35,12 @@ func NewHeadSaver(lggr logger.Logger, orm ORM, config commontypes.Config, htConf } func (hs *headSaver) Save(ctx context.Context, head *evmtypes.Head) error { - if err := hs.orm.IdempotentInsertHead(ctx, head); err != nil { + // adding new head might form a cycle, so it's better to validate cached chain before persisting it + if err := hs.heads.AddHeads(head); err != nil { return err } - hs.heads.AddHeads(head) - - return nil + return hs.orm.IdempotentInsertHead(ctx, head) } func (hs *headSaver) Load(ctx context.Context, latestFinalized int64) (chain *evmtypes.Head, err error) { @@ -51,7 +50,10 @@ func (hs *headSaver) Load(ctx context.Context, latestFinalized int64) (chain *ev return nil, err } - hs.heads.AddHeads(heads...) + err = hs.heads.AddHeads(heads...) + if err != nil { + return nil, fmt.Errorf("failed to populate cache with loaded heads: %w", err) + } return hs.heads.LatestHead(), nil } diff --git a/core/chains/evm/headtracker/head_saver_test.go b/core/chains/evm/headtracker/head_saver_test.go index 43e79235e90..266172b67df 100644 --- a/core/chains/evm/headtracker/head_saver_test.go +++ b/core/chains/evm/headtracker/head_saver_test.go @@ -42,6 +42,9 @@ func (h *headTrackerConfig) FinalityTagBypass() bool { func (h *headTrackerConfig) MaxAllowedFinalityDepth() uint32 { return 10000 } +func (h *headTrackerConfig) PersistenceEnabled() bool { + return true +} type config struct { finalityDepth uint32 diff --git a/core/chains/evm/headtracker/head_tracker.go b/core/chains/evm/headtracker/head_tracker.go index d6c2cdc64e7..bb39b3b5c79 100644 --- a/core/chains/evm/headtracker/head_tracker.go +++ b/core/chains/evm/headtracker/head_tracker.go @@ -2,10 +2,8 @@ package headtracker import ( "context" - "math/big" "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/common" "go.uber.org/zap/zapcore" "github.com/smartcontractkit/chainlink-common/pkg/logger" @@ -13,21 +11,20 @@ import ( "github.com/smartcontractkit/chainlink/v2/common/headtracker" commontypes "github.com/smartcontractkit/chainlink/v2/common/headtracker/types" - evmclient "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" httypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/headtracker/types" evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" ) func NewHeadTracker( lggr logger.Logger, - ethClient evmclient.Client, + ethClient httypes.Client, config commontypes.Config, htConfig commontypes.HeadTrackerConfig, headBroadcaster httypes.HeadBroadcaster, headSaver httypes.HeadSaver, mailMon *mailbox.Monitor, ) httypes.HeadTracker { - return headtracker.NewHeadTracker[*evmtypes.Head, ethereum.Subscription, *big.Int, common.Hash]( + return headtracker.NewHeadTracker[*evmtypes.Head, ethereum.Subscription]( lggr, ethClient, config, diff --git a/core/chains/evm/headtracker/head_tracker_test.go b/core/chains/evm/headtracker/head_tracker_test.go index 21ff1b1a929..8e846d3122c 100644 --- a/core/chains/evm/headtracker/head_tracker_test.go +++ b/core/chains/evm/headtracker/head_tracker_test.go @@ -12,7 +12,6 @@ import ( "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/common" - gethTypes "github.com/ethereum/go-ethereum/core/types" "github.com/onsi/gomega" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" @@ -21,21 +20,19 @@ import ( "go.uber.org/zap/zaptest/observer" "golang.org/x/exp/maps" + commonconfig "github.com/smartcontractkit/chainlink-common/pkg/config" + "github.com/smartcontractkit/chainlink-common/pkg/services" + "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink-common/pkg/utils/mailbox/mailboxtest" "github.com/jmoiron/sqlx" - commonconfig "github.com/smartcontractkit/chainlink-common/pkg/config" - "github.com/smartcontractkit/chainlink-common/pkg/services" "github.com/smartcontractkit/chainlink-common/pkg/utils/mailbox" "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" htmocks "github.com/smartcontractkit/chainlink/v2/common/headtracker/mocks" commontypes "github.com/smartcontractkit/chainlink/v2/common/headtracker/types" - "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/evmtest" - - evmclient "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" evmclimocks "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client/mocks" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/config/toml" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/headtracker" @@ -45,11 +42,13 @@ import ( evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils" ubig "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils/big" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/evmtest" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/pgtest" ) -func firstHead(t *testing.T, db *sqlx.DB) (h evmtypes.Head) { - if err := db.Get(&h, `SELECT * FROM evm.heads ORDER BY number ASC LIMIT 1`); err != nil { +func firstHead(t *testing.T, db *sqlx.DB) *evmtypes.Head { + h := new(evmtypes.Head) + if err := db.Get(h, `SELECT * FROM evm.heads ORDER BY number ASC LIMIT 1`); err != nil { t.Fatal(err) } return h @@ -222,9 +221,9 @@ func TestHeadTracker_Start(t *testing.T) { FinalityTagEnable *bool MaxAllowedFinalityDepth *uint32 FinalityTagBypass *bool + ORM headtracker.ORM } newHeadTracker := func(t *testing.T, opts opts) *headTrackerUniverse { - db := pgtest.NewSqlxDB(t) config := testutils.NewTestChainScopedConfig(t, func(c *toml.EVMConfig) { if opts.FinalityTagEnable != nil { c.FinalityTagEnabled = opts.FinalityTagEnable @@ -239,12 +238,15 @@ func TestHeadTracker_Start(t *testing.T) { c.HeadTracker.FinalityTagBypass = opts.FinalityTagBypass } }) - orm := headtracker.NewORM(*testutils.FixtureChainID, db) + if opts.ORM == nil { + db := pgtest.NewSqlxDB(t) + opts.ORM = headtracker.NewORM(*testutils.FixtureChainID, db) + } ethClient := evmtest.NewEthClientMockWithDefaultChain(t) mockEth := &testutils.MockEth{EthClient: ethClient} sub := mockEth.NewSub(t) ethClient.On("SubscribeNewHead", mock.Anything, mock.Anything).Return(sub, nil).Maybe() - return createHeadTracker(t, ethClient, config.EVM(), config.EVM().HeadTracker(), orm) + return createHeadTracker(t, ethClient, config.EVM(), config.EVM().HeadTracker(), opts.ORM) } t.Run("Starts even if failed to get initialHead", func(t *testing.T) { ht := newHeadTracker(t, opts{}) @@ -275,9 +277,9 @@ func TestHeadTracker_Start(t *testing.T) { ht.Start(t) tests.AssertLogEventually(t, ht.observer, "Error handling initial head") }) - t.Run("Happy path (finality tag)", func(t *testing.T) { + happyPathFT := func(t *testing.T, opts opts) { head := testutils.Head(1000) - ht := newHeadTracker(t, opts{FinalityTagEnable: ptr(true), FinalityTagBypass: ptr(false)}) + ht := newHeadTracker(t, opts) ctx := tests.Context(t) require.NoError(t, ht.orm.IdempotentInsertHead(ctx, testutils.Head(799))) ht.ethClient.On("HeadByNumber", mock.Anything, (*big.Int)(nil)).Return(head, nil).Once() @@ -288,8 +290,12 @@ func TestHeadTracker_Start(t *testing.T) { ht.ethClient.On("LatestFinalizedBlock", mock.Anything).Return(nil, errors.New("backfill call to finalized failed")).Maybe() ht.ethClient.On("SubscribeNewHead", mock.Anything, mock.Anything).Return(nil, errors.New("failed to connect")).Maybe() ht.Start(t) - tests.AssertLogEventually(t, ht.observer, "Loaded chain from DB") - }) + tests.AssertLogEventually(t, ht.observer, "Received new head") + tests.AssertEventually(t, func() bool { + latest := ht.headTracker.LatestChain() + return latest != nil && latest.Number == head.Number + }) + } happyPathFD := func(t *testing.T, opts opts) { head := testutils.Head(1000) ht := newHeadTracker(t, opts) @@ -302,28 +308,46 @@ func TestHeadTracker_Start(t *testing.T) { ht.ethClient.On("HeadByNumber", mock.Anything, mock.Anything).Return(nil, errors.New("backfill call to finalized failed")).Maybe() ht.ethClient.On("SubscribeNewHead", mock.Anything, mock.Anything).Return(nil, errors.New("failed to connect")).Maybe() ht.Start(t) - tests.AssertLogEventually(t, ht.observer, "Loaded chain from DB") + tests.AssertLogEventually(t, ht.observer, "Received new head") + tests.AssertEventually(t, func() bool { + latest := ht.headTracker.LatestChain() + return latest != nil && latest.Number == head.Number + }) } testCases := []struct { Name string Opts opts + Run func(t *testing.T, opts opts) }{ { Name: "Happy path (Chain FT is disabled & HeadTracker's FT is disabled)", Opts: opts{FinalityTagEnable: ptr(false), FinalityTagBypass: ptr(true)}, + Run: happyPathFD, }, { Name: "Happy path (Chain FT is disabled & HeadTracker's FT is enabled, but ignored)", Opts: opts{FinalityTagEnable: ptr(false), FinalityTagBypass: ptr(false)}, + Run: happyPathFD, }, { Name: "Happy path (Chain FT is enabled & HeadTracker's FT is disabled)", Opts: opts{FinalityTagEnable: ptr(true), FinalityTagBypass: ptr(true)}, + Run: happyPathFD, + }, + { + Name: "Happy path (Chain FT is enabled)", + Opts: opts{FinalityTagEnable: ptr(true), FinalityTagBypass: ptr(false)}, + Run: happyPathFT, }, } for _, tc := range testCases { t.Run(tc.Name, func(t *testing.T) { - happyPathFD(t, tc.Opts) + tc.Run(t, tc.Opts) + }) + t.Run("Disabled Persistence "+tc.Name, func(t *testing.T) { + opts := tc.Opts + opts.ORM = headtracker.NewNullORM() + tc.Run(t, opts) }) } } @@ -578,27 +602,10 @@ func TestHeadTracker_SwitchesToLongestChainWithHeadSamplingEnabled(t *testing.T) checker.On("OnNewLongestChain", mock.Anything, mock.Anything). Run(func(args mock.Arguments) { h := args.Get(1).(*evmtypes.Head) + // This is the new longest chain [0, 5], check that it came with its parents + assert.Equal(t, uint32(6), h.ChainLength()) + assertChainWithParents(t, blocksForked, 5, 1, h) - assert.Equal(t, int64(5), h.Number) - assert.Equal(t, blocksForked.Head(5).Hash, h.Hash) - - // This is the new longest chain, check that it came with its parents - if !assert.NotNil(t, h.Parent) { - return - } - assert.Equal(t, h.Parent.Hash, blocksForked.Head(4).Hash) - if !assert.NotNil(t, h.Parent.Parent) { - return - } - assert.Equal(t, h.Parent.Parent.Hash, blocksForked.Head(3).Hash) - if !assert.NotNil(t, h.Parent.Parent.Parent) { - return - } - assert.Equal(t, h.Parent.Parent.Parent.Hash, blocksForked.Head(2).Hash) - if !assert.NotNil(t, h.Parent.Parent.Parent.Parent) { - return - } - assert.Equal(t, h.Parent.Parent.Parent.Parent.Hash, blocksForked.Head(1).Hash) lastLongestChainAwaiter.ItHappened() }).Return().Once() @@ -639,6 +646,16 @@ func TestHeadTracker_SwitchesToLongestChainWithHeadSamplingEnabled(t *testing.T) } } +func assertChainWithParents(t testing.TB, blocks *blocks, startBN, endBN uint64, h *evmtypes.Head) { + for blockNumber := startBN; blockNumber >= endBN; blockNumber-- { + assert.NotNil(t, h) + assert.Equal(t, blockNumber, uint64(h.Number)) + assert.Equal(t, blocks.Head(blockNumber).Hash, h.Hash) + // move to parent + h = h.Parent.Load() + } +} + func TestHeadTracker_SwitchesToLongestChainWithHeadSamplingDisabled(t *testing.T) { t.Parallel() @@ -725,34 +742,13 @@ func TestHeadTracker_SwitchesToLongestChainWithHeadSamplingDisabled(t *testing.T checker.On("OnNewLongestChain", mock.Anything, mock.Anything). Run(func(args mock.Arguments) { h := args.Get(1).(*evmtypes.Head) - require.Equal(t, int64(4), h.Number) - require.Equal(t, blocks.Head(4).Hash, h.Hash) - - // Check that the block came with its parents - require.NotNil(t, h.Parent) - require.Equal(t, h.Parent.Hash, blocks.Head(3).Hash) - require.NotNil(t, h.Parent.Parent.Hash) - require.Equal(t, h.Parent.Parent.Hash, blocks.Head(2).Hash) - require.NotNil(t, h.Parent.Parent.Parent) - require.Equal(t, h.Parent.Parent.Parent.Hash, blocks.Head(1).Hash) + assertChainWithParents(t, blocks, 4, 1, h) }).Return().Once() checker.On("OnNewLongestChain", mock.Anything, mock.Anything). Run(func(args mock.Arguments) { h := args.Get(1).(*evmtypes.Head) - - require.Equal(t, int64(5), h.Number) - require.Equal(t, blocksForked.Head(5).Hash, h.Hash) - - // This is the new longest chain, check that it came with its parents - require.NotNil(t, h.Parent) - require.Equal(t, h.Parent.Hash, blocksForked.Head(4).Hash) - require.NotNil(t, h.Parent.Parent) - require.Equal(t, h.Parent.Parent.Hash, blocksForked.Head(3).Hash) - require.NotNil(t, h.Parent.Parent.Parent) - require.Equal(t, h.Parent.Parent.Parent.Hash, blocksForked.Head(2).Hash) - require.NotNil(t, h.Parent.Parent.Parent.Parent) - require.Equal(t, h.Parent.Parent.Parent.Parent.Hash, blocksForked.Head(1).Hash) + assertChainWithParents(t, blocksForked, 5, 1, h) lastLongestChainAwaiter.ItHappened() }).Return().Once() @@ -798,7 +794,20 @@ func TestHeadTracker_SwitchesToLongestChainWithHeadSamplingDisabled(t *testing.T func TestHeadTracker_Backfill(t *testing.T) { t.Parallel() + t.Run("Enabled Persistence", func(t *testing.T) { + testHeadTrackerBackfill(t, func(t *testing.T) headtracker.ORM { + db := pgtest.NewSqlxDB(t) + return headtracker.NewORM(*testutils.FixtureChainID, db) + }) + }) + t.Run("Disabled Persistence", func(t *testing.T) { + testHeadTrackerBackfill(t, func(t *testing.T) headtracker.ORM { + return headtracker.NewNullORM() + }) + }) +} +func testHeadTrackerBackfill(t *testing.T, newORM func(t *testing.T) headtracker.ORM) { // Heads are arranged as follows: // headN indicates an unpersisted ethereum header // hN indicates a persisted head record @@ -811,52 +820,37 @@ func TestHeadTracker_Backfill(t *testing.T) { now := uint64(time.Now().UTC().Unix()) - gethHead0 := &gethTypes.Header{ - Number: big.NewInt(0), - ParentHash: common.BigToHash(big.NewInt(0)), - Time: now, - } - head0 := evmtypes.NewHead(gethHead0.Number, utils.NewHash(), gethHead0.ParentHash, gethHead0.Time, ubig.New(testutils.FixtureChainID)) + head0 := evmtypes.NewHead(big.NewInt(0), utils.NewHash(), common.BigToHash(big.NewInt(0)), now, ubig.New(testutils.FixtureChainID)) - h1 := *testutils.Head(1) + h1 := testutils.Head(1) h1.ParentHash = head0.Hash - gethHead8 := &gethTypes.Header{ - Number: big.NewInt(8), - ParentHash: utils.NewHash(), - Time: now, - } - head8 := evmtypes.NewHead(gethHead8.Number, utils.NewHash(), gethHead8.ParentHash, gethHead8.Time, ubig.New(testutils.FixtureChainID)) + head8 := evmtypes.NewHead(big.NewInt(8), utils.NewHash(), utils.NewHash(), now, ubig.New(testutils.FixtureChainID)) - h9 := *testutils.Head(9) + h9 := testutils.Head(9) h9.ParentHash = head8.Hash - gethHead10 := &gethTypes.Header{ - Number: big.NewInt(10), - ParentHash: h9.Hash, - Time: now, - } - head10 := evmtypes.NewHead(gethHead10.Number, utils.NewHash(), gethHead10.ParentHash, gethHead10.Time, ubig.New(testutils.FixtureChainID)) + head10 := evmtypes.NewHead(big.NewInt(10), utils.NewHash(), h9.Hash, now, ubig.New(testutils.FixtureChainID)) - h11 := *testutils.Head(11) + h11 := testutils.Head(11) h11.ParentHash = head10.Hash - h12 := *testutils.Head(12) + h12 := testutils.Head(12) h12.ParentHash = h11.Hash - h13 := *testutils.Head(13) + h13 := testutils.Head(13) h13.ParentHash = h12.Hash - h14Orphaned := *testutils.Head(14) + h14Orphaned := testutils.Head(14) h14Orphaned.ParentHash = h13.Hash - h14 := *testutils.Head(14) + h14 := testutils.Head(14) h14.ParentHash = h13.Hash - h15 := *testutils.Head(15) + h15 := testutils.Head(15) h15.ParentHash = h14.Hash - heads := []evmtypes.Head{ + heads := []*evmtypes.Head{ h9, h11, h12, @@ -869,7 +863,7 @@ func TestHeadTracker_Backfill(t *testing.T) { ctx := tests.Context(t) type opts struct { - Heads []evmtypes.Head + Heads []*evmtypes.Head FinalityTagEnabled bool FinalizedBlockOffset uint32 FinalityDepth uint32 @@ -886,14 +880,12 @@ func TestHeadTracker_Backfill(t *testing.T) { } }) - db := pgtest.NewSqlxDB(t) - orm := headtracker.NewORM(*testutils.FixtureChainID, db) - for i := range opts.Heads { - require.NoError(t, orm.IdempotentInsertHead(tests.Context(t), &opts.Heads[i])) - } ethClient := testutils.NewEthClientMock(t) ethClient.On("ConfiguredChainID", mock.Anything).Return(evmcfg.EVM().ChainID(), nil) - ht := createHeadTracker(t, ethClient, evmcfg.EVM(), evmcfg.EVM().HeadTracker(), orm) + ht := createHeadTracker(t, ethClient, evmcfg.EVM(), evmcfg.EVM().HeadTracker(), newORM(t)) + for i := range opts.Heads { + require.NoError(t, ht.headSaver.Save(tests.Context(t), opts.Heads[i])) + } _, err := ht.headSaver.Load(tests.Context(t), 0) require.NoError(t, err) return ht @@ -904,74 +896,72 @@ func TestHeadTracker_Backfill(t *testing.T) { const expectedError = "failed to fetch latest finalized block" htu.ethClient.On("LatestFinalizedBlock", mock.Anything).Return(nil, errors.New(expectedError)).Once() - err := htu.headTracker.Backfill(ctx, &h12) + err := htu.headTracker.Backfill(ctx, h12) require.ErrorContains(t, err, expectedError) }) t.Run("returns error if latestFinalized is not valid", func(t *testing.T) { htu := newHeadTrackerUniverse(t, opts{FinalityTagEnabled: true}) htu.ethClient.On("LatestFinalizedBlock", mock.Anything).Return(nil, nil).Once() - err := htu.headTracker.Backfill(ctx, &h12) + err := htu.headTracker.Backfill(ctx, h12) require.EqualError(t, err, "failed to calculate finalized block: failed to get valid latest finalized block") }) t.Run("Returns error if finality gap is too big", func(t *testing.T) { htu := newHeadTrackerUniverse(t, opts{FinalityTagEnabled: true, MaxAllowedFinalityDepth: 2}) - htu.ethClient.On("LatestFinalizedBlock", mock.Anything).Return(&h9, nil).Once() + htu.ethClient.On("LatestFinalizedBlock", mock.Anything).Return(h9, nil).Once() - err := htu.headTracker.Backfill(ctx, &h12) + err := htu.headTracker.Backfill(ctx, h12) require.EqualError(t, err, "gap between latest finalized block (9) and current head (12) is too large (> 2)") }) t.Run("Returns error if finalized head is ahead of canonical", func(t *testing.T) { htu := newHeadTrackerUniverse(t, opts{FinalityTagEnabled: true}) - htu.ethClient.On("LatestFinalizedBlock", mock.Anything).Return(&h14Orphaned, nil).Once() + htu.ethClient.On("LatestFinalizedBlock", mock.Anything).Return(h14Orphaned, nil).Once() - err := htu.headTracker.Backfill(ctx, &h12) + err := htu.headTracker.Backfill(ctx, h12) require.EqualError(t, err, "invariant violation: expected head of canonical chain to be ahead of the latestFinalized") }) t.Run("Returns error if finalizedHead is not present in the canonical chain", func(t *testing.T) { htu := newHeadTrackerUniverse(t, opts{Heads: heads, FinalityTagEnabled: true}) - htu.ethClient.On("LatestFinalizedBlock", mock.Anything).Return(&h14Orphaned, nil).Once() + htu.ethClient.On("LatestFinalizedBlock", mock.Anything).Return(h14Orphaned, nil).Once() - err := htu.headTracker.Backfill(ctx, &h15) + err := htu.headTracker.Backfill(ctx, h15) require.EqualError(t, err, "expected finalized block to be present in canonical chain") }) t.Run("Marks all blocks in chain that are older than finalized", func(t *testing.T) { htu := newHeadTrackerUniverse(t, opts{Heads: heads, FinalityTagEnabled: true}) - assertFinalized := func(expectedFinalized bool, msg string, heads ...evmtypes.Head) { + assertFinalized := func(expectedFinalized bool, msg string, heads ...*evmtypes.Head) { for _, h := range heads { storedHead := htu.headSaver.Chain(h.Hash) - assert.Equal(t, expectedFinalized, storedHead != nil && storedHead.IsFinalized, msg, "block_number", h.Number) + assert.Equal(t, expectedFinalized, storedHead != nil && storedHead.IsFinalized.Load(), msg, "block_number", h.Number) } } - htu.ethClient.On("LatestFinalizedBlock", mock.Anything).Return(&h14, nil).Once() - err := htu.headTracker.Backfill(ctx, &h15) + htu.ethClient.On("LatestFinalizedBlock", mock.Anything).Return(h14, nil).Once() + err := htu.headTracker.Backfill(ctx, h15) require.NoError(t, err) assertFinalized(true, "expected heads to be marked as finalized after backfill", h14, h13, h12, h11) - assertFinalized(false, "expected heads to remain unfinalized", h15, head10) + assertFinalized(false, "expected heads to remain unfinalized", h15, &head10) }) t.Run("fetches a missing head", func(t *testing.T) { htu := newHeadTrackerUniverse(t, opts{Heads: heads, FinalityTagEnabled: true}) - htu.ethClient.On("LatestFinalizedBlock", mock.Anything).Return(&h9, nil).Once() + htu.ethClient.On("LatestFinalizedBlock", mock.Anything).Return(h9, nil).Once() htu.ethClient.On("HeadByHash", mock.Anything, head10.Hash). Return(&head10, nil) - err := htu.headTracker.Backfill(ctx, &h12) + err := htu.headTracker.Backfill(ctx, h12) require.NoError(t, err) h := htu.headSaver.Chain(h12.Hash) - assert.Equal(t, int64(12), h.Number) - require.NotNil(t, h.Parent) - assert.Equal(t, int64(11), h.Parent.Number) - require.NotNil(t, h.Parent.Parent) - assert.Equal(t, int64(10), h.Parent.Parent.Number) - require.NotNil(t, h.Parent.Parent.Parent) - assert.Equal(t, int64(9), h.Parent.Parent.Parent.Number) + for expectedBlockNumber := int64(12); expectedBlockNumber >= 9; expectedBlockNumber-- { + require.NotNil(t, h) + assert.Equal(t, expectedBlockNumber, h.Number) + h = h.Parent.Load() + } - writtenHead, err := htu.orm.HeadByHash(tests.Context(t), head10.Hash) + writtenHead := htu.headSaver.Chain(head10.Hash) require.NoError(t, err) assert.Equal(t, int64(10), writtenHead.Number) }) @@ -984,7 +974,7 @@ func TestHeadTracker_Backfill(t *testing.T) { htu.ethClient.On("HeadByHash", mock.Anything, head8.Hash). Return(&head8, nil) - err := htu.headTracker.Backfill(ctx, &h15) + err := htu.headTracker.Backfill(ctx, h15) require.NoError(t, err) h := htu.headSaver.Chain(h15.Hash) @@ -1005,7 +995,7 @@ func TestHeadTracker_Backfill(t *testing.T) { Return(nil, ethereum.NotFound). Once() - err := htu.headTracker.Backfill(ctx, &h12) + err := htu.headTracker.Backfill(ctx, h12) require.Error(t, err) require.ErrorContains(t, err, "fetchAndSaveHead failed: not found") @@ -1027,7 +1017,7 @@ func TestHeadTracker_Backfill(t *testing.T) { cancel() }) - err := htu.headTracker.Backfill(lctx, &h12) + err := htu.headTracker.Backfill(lctx, h12) require.Error(t, err) require.ErrorContains(t, err, "fetchAndSaveHead failed: context canceled") @@ -1039,12 +1029,12 @@ func TestHeadTracker_Backfill(t *testing.T) { }) t.Run("abandons backfill and returns error when fetching a block by hash fails, indicating a reorg", func(t *testing.T) { htu := newHeadTrackerUniverse(t, opts{FinalityTagEnabled: true}) - htu.ethClient.On("LatestFinalizedBlock", mock.Anything).Return(&h11, nil).Once() - htu.ethClient.On("HeadByHash", mock.Anything, h14.Hash).Return(&h14, nil).Once() - htu.ethClient.On("HeadByHash", mock.Anything, h13.Hash).Return(&h13, nil).Once() + htu.ethClient.On("LatestFinalizedBlock", mock.Anything).Return(h11, nil).Once() + htu.ethClient.On("HeadByHash", mock.Anything, h14.Hash).Return(h14, nil).Once() + htu.ethClient.On("HeadByHash", mock.Anything, h13.Hash).Return(h13, nil).Once() htu.ethClient.On("HeadByHash", mock.Anything, h12.Hash).Return(nil, errors.New("not found")).Once() - err := htu.headTracker.Backfill(ctx, &h15) + err := htu.headTracker.Backfill(ctx, h15) require.Error(t, err) require.ErrorContains(t, err, "fetchAndSaveHead failed: not found") @@ -1056,83 +1046,83 @@ func TestHeadTracker_Backfill(t *testing.T) { assert.Equal(t, int64(13), h.EarliestInChain().BlockNumber()) }) t.Run("marks head as finalized, if latestHead = finalizedHead (0 finality depth)", func(t *testing.T) { - htu := newHeadTrackerUniverse(t, opts{Heads: []evmtypes.Head{h15}, FinalityTagEnabled: true}) + htu := newHeadTrackerUniverse(t, opts{Heads: []*evmtypes.Head{h15}, FinalityTagEnabled: true}) finalizedH15 := h15 // copy h15 to have different addresses - htu.ethClient.On("LatestFinalizedBlock", mock.Anything).Return(&finalizedH15, nil).Once() - err := htu.headTracker.Backfill(ctx, &h15) + htu.ethClient.On("LatestFinalizedBlock", mock.Anything).Return(finalizedH15, nil).Once() + err := htu.headTracker.Backfill(ctx, h15) require.NoError(t, err) h := htu.headSaver.LatestChain() // Should contain 14, 13 (15 was never added). When trying to get the parent of h13 by hash, a reorg happened and backfill exited. assert.Equal(t, 1, int(h.ChainLength())) - assert.True(t, h.IsFinalized) + assert.True(t, h.IsFinalized.Load()) assert.Equal(t, h15.BlockNumber(), h.BlockNumber()) assert.Equal(t, h15.Hash, h.Hash) }) t.Run("marks block as finalized according to FinalizedBlockOffset (finality tag)", func(t *testing.T) { - htu := newHeadTrackerUniverse(t, opts{Heads: []evmtypes.Head{h15}, FinalityTagEnabled: true, FinalizedBlockOffset: 2}) - htu.ethClient.On("LatestFinalizedBlock", mock.Anything).Return(&h14, nil).Once() + htu := newHeadTrackerUniverse(t, opts{Heads: []*evmtypes.Head{h15}, FinalityTagEnabled: true, FinalizedBlockOffset: 2}) + htu.ethClient.On("LatestFinalizedBlock", mock.Anything).Return(h14, nil).Once() // calculateLatestFinalizedBlock fetches blocks at LatestFinalized - FinalizedBlockOffset - htu.ethClient.On("HeadByNumber", mock.Anything, big.NewInt(h12.Number)).Return(&h12, nil).Once() + htu.ethClient.On("HeadByNumber", mock.Anything, big.NewInt(h12.Number)).Return(h12, nil).Once() // backfill from 15 to 12 - htu.ethClient.On("HeadByHash", mock.Anything, h12.Hash).Return(&h12, nil).Once() - htu.ethClient.On("HeadByHash", mock.Anything, h13.Hash).Return(&h13, nil).Once() - htu.ethClient.On("HeadByHash", mock.Anything, h14.Hash).Return(&h14, nil).Once() - err := htu.headTracker.Backfill(ctx, &h15) + htu.ethClient.On("HeadByHash", mock.Anything, h12.Hash).Return(h12, nil).Once() + htu.ethClient.On("HeadByHash", mock.Anything, h13.Hash).Return(h13, nil).Once() + htu.ethClient.On("HeadByHash", mock.Anything, h14.Hash).Return(h14, nil).Once() + err := htu.headTracker.Backfill(ctx, h15) require.NoError(t, err) h := htu.headSaver.LatestChain() // h - must contain 15, 14, 13, 12 and only 12 is finalized assert.Equal(t, 4, int(h.ChainLength())) - for ; h.Hash != h12.Hash; h = h.Parent { - assert.False(t, h.IsFinalized) + for ; h.Hash != h12.Hash; h = h.Parent.Load() { + assert.False(t, h.IsFinalized.Load()) } - assert.True(t, h.IsFinalized) + assert.True(t, h.IsFinalized.Load()) assert.Equal(t, h12.BlockNumber(), h.BlockNumber()) assert.Equal(t, h12.Hash, h.Hash) }) t.Run("marks block as finalized according to FinalizedBlockOffset (finality depth)", func(t *testing.T) { - htu := newHeadTrackerUniverse(t, opts{Heads: []evmtypes.Head{h15}, FinalityDepth: 1, FinalizedBlockOffset: 2}) - htu.ethClient.On("HeadByNumber", mock.Anything, big.NewInt(12)).Return(&h12, nil).Once() + htu := newHeadTrackerUniverse(t, opts{Heads: []*evmtypes.Head{h15}, FinalityDepth: 1, FinalizedBlockOffset: 2}) + htu.ethClient.On("HeadByNumber", mock.Anything, big.NewInt(12)).Return(h12, nil).Once() // backfill from 15 to 12 - htu.ethClient.On("HeadByHash", mock.Anything, h14.Hash).Return(&h14, nil).Once() - htu.ethClient.On("HeadByHash", mock.Anything, h13.Hash).Return(&h13, nil).Once() - htu.ethClient.On("HeadByHash", mock.Anything, h12.Hash).Return(&h12, nil).Once() - err := htu.headTracker.Backfill(ctx, &h15) + htu.ethClient.On("HeadByHash", mock.Anything, h14.Hash).Return(h14, nil).Once() + htu.ethClient.On("HeadByHash", mock.Anything, h13.Hash).Return(h13, nil).Once() + htu.ethClient.On("HeadByHash", mock.Anything, h12.Hash).Return(h12, nil).Once() + err := htu.headTracker.Backfill(ctx, h15) require.NoError(t, err) h := htu.headSaver.LatestChain() // h - must contain 15, 14, 13, 12 and only 12 is finalized assert.Equal(t, 4, int(h.ChainLength())) - for ; h.Hash != h12.Hash; h = h.Parent { - assert.False(t, h.IsFinalized) + for ; h.Hash != h12.Hash; h = h.Parent.Load() { + assert.False(t, h.IsFinalized.Load()) } - assert.True(t, h.IsFinalized) + assert.True(t, h.IsFinalized.Load()) assert.Equal(t, h12.BlockNumber(), h.BlockNumber()) assert.Equal(t, h12.Hash, h.Hash) }) t.Run("marks block as finalized according to FinalizedBlockOffset even with instant finality", func(t *testing.T) { - htu := newHeadTrackerUniverse(t, opts{Heads: []evmtypes.Head{h15}, FinalityDepth: 0, FinalizedBlockOffset: 2}) - htu.ethClient.On("HeadByNumber", mock.Anything, big.NewInt(13)).Return(&h13, nil).Once() + htu := newHeadTrackerUniverse(t, opts{Heads: []*evmtypes.Head{h15}, FinalityDepth: 0, FinalizedBlockOffset: 2}) + htu.ethClient.On("HeadByNumber", mock.Anything, big.NewInt(13)).Return(h13, nil).Once() // backfill from 15 to 13 - htu.ethClient.On("HeadByHash", mock.Anything, h14.Hash).Return(&h14, nil).Once() - htu.ethClient.On("HeadByHash", mock.Anything, h13.Hash).Return(&h13, nil).Once() - err := htu.headTracker.Backfill(ctx, &h15) + htu.ethClient.On("HeadByHash", mock.Anything, h14.Hash).Return(h14, nil).Once() + htu.ethClient.On("HeadByHash", mock.Anything, h13.Hash).Return(h13, nil).Once() + err := htu.headTracker.Backfill(ctx, h15) require.NoError(t, err) h := htu.headSaver.LatestChain() // h - must contain 15, 14, 13, only 13 is finalized assert.Equal(t, 3, int(h.ChainLength())) - for ; h.Hash != h13.Hash; h = h.Parent { - assert.False(t, h.IsFinalized) + for ; h.Hash != h13.Hash; h = h.Parent.Load() { + assert.False(t, h.IsFinalized.Load()) } - assert.True(t, h.IsFinalized) + assert.True(t, h.IsFinalized.Load()) assert.Equal(t, h13.BlockNumber(), h.BlockNumber()) assert.Equal(t, h13.Hash, h.Hash) }) @@ -1153,7 +1143,7 @@ func TestHeadTracker_LatestAndFinalizedBlock(t *testing.T) { h13.ParentHash = h12.Hash type opts struct { - Heads []evmtypes.Head + Heads []*evmtypes.Head FinalityTagEnabled bool FinalizedBlockOffset uint32 FinalityDepth uint32 @@ -1169,7 +1159,7 @@ func TestHeadTracker_LatestAndFinalizedBlock(t *testing.T) { db := pgtest.NewSqlxDB(t) orm := headtracker.NewORM(*testutils.FixtureChainID, db) for i := range opts.Heads { - require.NoError(t, orm.IdempotentInsertHead(tests.Context(t), &opts.Heads[i])) + require.NoError(t, orm.IdempotentInsertHead(tests.Context(t), opts.Heads[i])) } ethClient := evmtest.NewEthClientMock(t) ethClient.On("ConfiguredChainID", mock.Anything).Return(testutils.FixtureChainID, nil) @@ -1221,7 +1211,7 @@ func TestHeadTracker_LatestAndFinalizedBlock(t *testing.T) { assert.Equal(t, actualLF, h11) }) t.Run("returns latest finalized block with offset from cache (finality tag)", func(t *testing.T) { - htu := newHeadTrackerUniverse(t, opts{FinalityTagEnabled: true, FinalizedBlockOffset: 1, Heads: []evmtypes.Head{*h13, *h12, *h11}}) + htu := newHeadTrackerUniverse(t, opts{FinalityTagEnabled: true, FinalizedBlockOffset: 1, Heads: []*evmtypes.Head{h13, h12, h11}}) htu.ethClient.On("HeadByNumber", mock.Anything, (*big.Int)(nil)).Return(h13, nil).Once() htu.ethClient.On("LatestFinalizedBlock", mock.Anything).Return(h12, nil).Once() @@ -1231,7 +1221,7 @@ func TestHeadTracker_LatestAndFinalizedBlock(t *testing.T) { assert.Equal(t, actualLF.Number, h11.Number) }) t.Run("returns latest finalized block with offset from RPC (finality tag)", func(t *testing.T) { - htu := newHeadTrackerUniverse(t, opts{FinalityTagEnabled: true, FinalizedBlockOffset: 2, Heads: []evmtypes.Head{*h13, *h12, *h11}}) + htu := newHeadTrackerUniverse(t, opts{FinalityTagEnabled: true, FinalizedBlockOffset: 2, Heads: []*evmtypes.Head{h13, h12, h11}}) htu.ethClient.On("HeadByNumber", mock.Anything, (*big.Int)(nil)).Return(h13, nil).Once() htu.ethClient.On("LatestFinalizedBlock", mock.Anything).Return(h12, nil).Once() h10 := testutils.Head(10) @@ -1252,7 +1242,7 @@ func TestHeadTracker_LatestAndFinalizedBlock(t *testing.T) { assert.Equal(t, actualLF.Number, h13.Number) }) t.Run("returns latest finalized block with offset from cache (finality depth)", func(t *testing.T) { - htu := newHeadTrackerUniverse(t, opts{FinalityDepth: 1, FinalizedBlockOffset: 1, Heads: []evmtypes.Head{*h13, *h12, *h11}}) + htu := newHeadTrackerUniverse(t, opts{FinalityDepth: 1, FinalizedBlockOffset: 1, Heads: []*evmtypes.Head{h13, h12, h11}}) htu.ethClient.On("HeadByNumber", mock.Anything, (*big.Int)(nil)).Return(h13, nil).Once() actualL, actualLF, err := htu.headTracker.LatestAndFinalizedBlock(ctx) @@ -1261,7 +1251,7 @@ func TestHeadTracker_LatestAndFinalizedBlock(t *testing.T) { assert.Equal(t, actualLF.Number, h11.Number) }) t.Run("returns latest finalized block with offset from RPC (finality depth)", func(t *testing.T) { - htu := newHeadTrackerUniverse(t, opts{FinalityDepth: 1, FinalizedBlockOffset: 2, Heads: []evmtypes.Head{*h13, *h12, *h11}}) + htu := newHeadTrackerUniverse(t, opts{FinalityDepth: 1, FinalizedBlockOffset: 2, Heads: []*evmtypes.Head{h13, h12, h11}}) htu.ethClient.On("HeadByNumber", mock.Anything, (*big.Int)(nil)).Return(h13, nil).Once() h10 := testutils.Head(10) htu.ethClient.On("HeadByNumber", mock.Anything, big.NewInt(10)).Return(h10, nil).Once() @@ -1273,47 +1263,6 @@ func TestHeadTracker_LatestAndFinalizedBlock(t *testing.T) { }) } -// BenchmarkHeadTracker_Backfill - benchmarks HeadTracker's Backfill with focus on efficiency after initial -// backfill on start up -func BenchmarkHeadTracker_Backfill(b *testing.B) { - evmcfg := testutils.NewTestChainScopedConfig(b, func(c *toml.EVMConfig) { - c.FinalityTagEnabled = ptr(true) - }) - db := pgtest.NewSqlxDB(b) - chainID := big.NewInt(evmclient.NullClientChainID) - orm := headtracker.NewORM(*chainID, db) - ethClient := evmclimocks.NewClient(b) - ethClient.On("ConfiguredChainID").Return(chainID) - ht := createHeadTracker(b, ethClient, evmcfg.EVM(), evmcfg.EVM().HeadTracker(), orm) - ctx := tests.Context(b) - makeHash := func(n int64) common.Hash { - return common.BigToHash(big.NewInt(n)) - } - const finalityDepth = 12000 // observed value on Arbitrum - makeBlock := func(n int64) *evmtypes.Head { - return &evmtypes.Head{Number: n, Hash: makeHash(n), ParentHash: makeHash(n - 1)} - } - latest := makeBlock(finalityDepth) - finalized := makeBlock(1) - ethClient.On("HeadByHash", mock.Anything, mock.Anything).Return(func(_ context.Context, hash common.Hash) (*evmtypes.Head, error) { - number := hash.Big().Int64() - return makeBlock(number), nil - }) - ethClient.On("LatestFinalizedBlock", mock.Anything).Return(finalized, nil).Once() - // run initial backfill to populate the database - err := ht.headTracker.Backfill(ctx, latest) - require.NoError(b, err) - b.ResetTimer() - // focus benchmark on processing of a new latest block - for i := 0; i < b.N; i++ { - latest = makeBlock(int64(finalityDepth + i)) - finalized = makeBlock(int64(i + 1)) - ethClient.On("LatestFinalizedBlock", mock.Anything).Return(finalized, nil).Once() - err := ht.headTracker.Backfill(ctx, latest) - require.NoError(b, err) - } -} - func createHeadTracker(t testing.TB, ethClient *evmclimocks.Client, config commontypes.Config, htConfig commontypes.HeadTrackerConfig, orm headtracker.ORM) *headTrackerUniverse { lggr, ob := logger.TestObserved(t, zap.DebugLevel) hb := headtracker.NewHeadBroadcaster(lggr) @@ -1417,15 +1366,15 @@ func (hb *headBuffer) Append(head *evmtypes.Head) { Number: head.Number, Hash: head.Hash, ParentHash: head.ParentHash, - Parent: head.Parent, Timestamp: time.Unix(int64(len(hb.Heads)), 0), EVMChainID: head.EVMChainID, } + cloned.Parent.Store(head.Parent.Load()) hb.Heads = append(hb.Heads, cloned) } type blocks struct { - t *testing.T + t testing.TB Hashes []common.Hash mHashes map[int64]common.Hash Heads map[int64]*evmtypes.Head @@ -1435,7 +1384,7 @@ func (b *blocks) Head(number uint64) *evmtypes.Head { return b.Heads[int64(number)] } -func NewBlocks(t *testing.T, numHashes int) *blocks { +func NewBlocks(t testing.TB, numHashes int) *blocks { hashes := make([]common.Hash, 0) heads := make(map[int64]*evmtypes.Head) for i := int64(0); i < int64(numHashes); i++ { @@ -1445,7 +1394,7 @@ func NewBlocks(t *testing.T, numHashes int) *blocks { heads[i] = &evmtypes.Head{Hash: hash, Number: i, Timestamp: time.Unix(i, 0), EVMChainID: ubig.New(testutils.FixtureChainID)} if i > 0 { parent := heads[i-1] - heads[i].Parent = parent + heads[i].Parent.Store(parent) heads[i].ParentHash = parent.Hash } } @@ -1474,7 +1423,7 @@ func (b *blocks) ForkAt(t *testing.T, blockNum int64, numHashes int) *blocks { } forked.Heads[blockNum].ParentHash = b.Heads[blockNum].ParentHash - forked.Heads[blockNum].Parent = b.Heads[blockNum].Parent + forked.Heads[blockNum].Parent.Store(b.Heads[blockNum].Parent.Load()) return forked } @@ -1488,9 +1437,9 @@ func (b *blocks) NewHead(number uint64) *evmtypes.Head { Number: parent.Number + 1, Hash: testutils.NewHash(), ParentHash: parent.Hash, - Parent: parent, Timestamp: time.Unix(parent.Number+1, 0), EVMChainID: ubig.New(testutils.FixtureChainID), } + head.Parent.Store(parent) return head } diff --git a/core/chains/evm/headtracker/heads.go b/core/chains/evm/headtracker/heads.go index a61e55dcd28..c3492f9a595 100644 --- a/core/chains/evm/headtracker/heads.go +++ b/core/chains/evm/headtracker/heads.go @@ -1,7 +1,8 @@ package headtracker import ( - "sort" + "container/heap" + "fmt" "sync" "github.com/ethereum/go-ethereum/common" @@ -17,7 +18,7 @@ type Heads interface { HeadByHash(hash common.Hash) *evmtypes.Head // AddHeads adds newHeads to the collection, eliminates duplicates, // sorts by head number, fixes parents and cuts off old heads (historyDepth). - AddHeads(newHeads ...*evmtypes.Head) + AddHeads(newHeads ...*evmtypes.Head) error // Count returns number of heads in the collection. Count() int // MarkFinalized - finds `finalized` in the LatestHead and marks it and all direct ancestors as finalized. @@ -26,114 +27,158 @@ type Heads interface { } type heads struct { - heads []*evmtypes.Head - headsMap map[common.Hash]*evmtypes.Head - mu sync.RWMutex + highest *evmtypes.Head + headsAsc *headsHeap + headsByHash map[common.Hash]*evmtypes.Head + headsByParent map[common.Hash]map[common.Hash]*evmtypes.Head + mu sync.RWMutex } func NewHeads() Heads { - return &heads{} + return &heads{ + headsAsc: &headsHeap{}, + headsByHash: make(map[common.Hash]*evmtypes.Head), + headsByParent: map[common.Hash]map[common.Hash]*evmtypes.Head{}, + } } func (h *heads) LatestHead() *evmtypes.Head { h.mu.RLock() defer h.mu.RUnlock() - if len(h.heads) == 0 { - return nil - } - return h.heads[0] + return h.highest } func (h *heads) HeadByHash(hash common.Hash) *evmtypes.Head { h.mu.RLock() defer h.mu.RUnlock() - if h.headsMap == nil { + if h.headsByHash == nil { return nil } - return h.headsMap[hash] + return h.headsByHash[hash] } func (h *heads) Count() int { h.mu.RLock() defer h.mu.RUnlock() - return len(h.heads) + return h.headsAsc.Len() } -// MarkFinalized - marks block with has equal to finalized and all it's direct ancestors as finalized. +// MarkFinalized - marks block with hash equal to finalized and all it's direct ancestors as finalized. // Trims old blocks whose height is smaller than minBlockToKeep func (h *heads) MarkFinalized(finalized common.Hash, minBlockToKeep int64) bool { h.mu.Lock() defer h.mu.Unlock() - if len(h.heads) == 0 { + if len(h.headsByHash) == 0 { return false } - // deep copy to avoid race on head.Parent - h.heads, h.headsMap = deepCopy(h.heads, minBlockToKeep) - - finalizedHead, ok := h.headsMap[finalized] + finalizedHead, ok := h.headsByHash[finalized] if !ok { return false } - for finalizedHead != nil { - finalizedHead.IsFinalized = true - finalizedHead = finalizedHead.Parent + + markFinalized(finalizedHead) + + // remove all blocks that are older than minBlockToKeep + for h.headsAsc.Len() > 0 && h.headsAsc.Peek().Number < minBlockToKeep { + oldBlock := heap.Pop(h.headsAsc).(*evmtypes.Head) + delete(h.headsByHash, oldBlock.Hash) + // clear .Parent in oldBlock's children + for _, oldBlockChildren := range h.headsByParent[oldBlock.Hash] { + oldBlockChildren.Parent.Store(nil) + } + // headsByParent are expected to be of the same height, so we can remove them all at once + delete(h.headsByParent, oldBlock.ParentHash) + } + + if h.highest.Number < minBlockToKeep { + h.highest = nil } return true } -func deepCopy(oldHeads []*evmtypes.Head, minBlockToKeep int64) ([]*evmtypes.Head, map[common.Hash]*evmtypes.Head) { - headsMap := make(map[common.Hash]*evmtypes.Head, len(oldHeads)) - heads := make([]*evmtypes.Head, 0, len(headsMap)) - for _, head := range oldHeads { - if head.Hash == head.ParentHash { - // shouldn't happen but it is untrusted input - continue - } - if head.BlockNumber() < minBlockToKeep { - // trim redundant blocks - continue - } - // copy all head objects to avoid races when a previous head chain is used - // elsewhere (since we mutate Parent here) - headCopy := *head - headCopy.Parent = nil // always build it from scratch in case it points to a head too old to be included - // map eliminates duplicates - // prefer head that was already in heads as it might have been marked as finalized on previous run - if _, ok := headsMap[head.Hash]; !ok { - headsMap[head.Hash] = &headCopy - heads = append(heads, &headCopy) +func markFinalized(head *evmtypes.Head) { + // we can assume that if a head was previously marked as finalized all its ancestors were marked as finalized + for head != nil && !head.IsFinalized.Load() { + head.IsFinalized.Store(true) + head = head.Parent.Load() + } +} + +func (h *heads) ensureNoCycles(newHead *evmtypes.Head) error { + if newHead.ParentHash == newHead.Hash { + return fmt.Errorf("cycle detected: newHeads reference itself newHead(%s)", newHead.String()) + } + if parent, ok := h.headsByHash[newHead.ParentHash]; ok { + if parent.Number >= newHead.Number { + return fmt.Errorf("potential cycle detected while adding newHead as child: %w", newPotentialCycleError(parent, newHead)) } } - // sort the heads as original slice might be out of order - sort.SliceStable(heads, func(i, j int) bool { - // sorting from the highest number to lowest - return heads[i].Number > heads[j].Number - }) - - // assign parents - for i := 0; i < len(heads); i++ { - head := heads[i] - parent, exists := headsMap[head.ParentHash] - if exists { - head.Parent = parent + for _, child := range h.headsByParent[newHead.Hash] { + if newHead.Number >= child.Number { + return fmt.Errorf("potential cycle detected while adding newHead as parent: %w", newPotentialCycleError(newHead, child)) } } - return heads, headsMap + return nil } -func (h *heads) AddHeads(newHeads ...*evmtypes.Head) { +func (h *heads) AddHeads(newHeads ...*evmtypes.Head) error { h.mu.Lock() defer h.mu.Unlock() - // deep copy to avoid race on head.Parent - h.heads, h.headsMap = deepCopy(append(h.heads, newHeads...), 0) + for _, newHead := range newHeads { + // skip blocks that were previously added + if _, ok := h.headsByHash[newHead.Hash]; ok { + continue + } + + if err := h.ensureNoCycles(newHead); err != nil { + return err + } + + // heads now owns the newHead - reset values that are populated by heads + newHead.IsFinalized.Store(false) + newHead.Parent.Store(nil) + + // prefer newer head to set as highest + if h.highest == nil || h.highest.Number <= newHead.Number { + h.highest = newHead + } + + heap.Push(h.headsAsc, newHead) + h.headsByHash[newHead.Hash] = newHead + siblings, ok := h.headsByParent[newHead.ParentHash] + if !ok { + siblings = make(map[common.Hash]*evmtypes.Head) + h.headsByParent[newHead.ParentHash] = siblings + } + siblings[newHead.Hash] = newHead + // populate reference to parent + if parent, ok := h.headsByHash[newHead.ParentHash]; ok { + newHead.Parent.Store(parent) + } + for _, child := range h.headsByParent[newHead.Hash] { + // ensure all children have reference to newHead + child.Parent.Store(newHead) + if child.IsFinalized.Load() { + // mark newHead as finalized if any of its children is finalized + markFinalized(newHead) + } + } + } + + return nil +} + +func newPotentialCycleError(parent, child *evmtypes.Head) error { + return fmt.Errorf("expected head number to strictly decrease in 'child -> parent' relation: "+ + "child(%s), parent(%s)", child.String(), parent.String()) } diff --git a/core/chains/evm/headtracker/heads_test.go b/core/chains/evm/headtracker/heads_test.go index 6c02c528ba2..92e4015d8c3 100644 --- a/core/chains/evm/headtracker/heads_test.go +++ b/core/chains/evm/headtracker/heads_test.go @@ -20,21 +20,29 @@ func TestHeads_LatestHead(t *testing.T) { t.Parallel() heads := headtracker.NewHeads() - heads.AddHeads(testutils.Head(100), testutils.Head(200), testutils.Head(300)) + assert.NoError(t, heads.AddHeads(testutils.Head(100), testutils.Head(200), testutils.Head(300))) latest := heads.LatestHead() require.NotNil(t, latest) require.Equal(t, int64(300), latest.Number) - heads.AddHeads(testutils.Head(250)) + assert.NoError(t, heads.AddHeads(testutils.Head(250))) latest = heads.LatestHead() require.NotNil(t, latest) require.Equal(t, int64(300), latest.Number) - heads.AddHeads(testutils.Head(400)) + assert.NoError(t, heads.AddHeads(testutils.Head(400))) latest = heads.LatestHead() require.NotNil(t, latest) require.Equal(t, int64(400), latest.Number) + + // if heads have the same height, LatestHead prefers most recent + newerH400 := testutils.Head(400) + assert.NoError(t, heads.AddHeads(newerH400)) + latest = heads.LatestHead() + require.NotNil(t, latest) + require.Equal(t, int64(400), latest.Number) + require.Equal(t, newerH400.Hash, latest.Hash) } func TestHeads_HeadByHash(t *testing.T) { @@ -46,7 +54,7 @@ func TestHeads_HeadByHash(t *testing.T) { testutils.Head(300), } heads := headtracker.NewHeads() - heads.AddHeads(testHeads...) + assert.NoError(t, heads.AddHeads(testHeads...)) head := heads.HeadByHash(testHeads[1].Hash) require.NotNil(t, head) @@ -62,10 +70,10 @@ func TestHeads_Count(t *testing.T) { heads := headtracker.NewHeads() require.Zero(t, heads.Count()) - heads.AddHeads(testutils.Head(100), testutils.Head(200), testutils.Head(300)) + assert.NoError(t, heads.AddHeads(testutils.Head(100), testutils.Head(200), testutils.Head(300))) require.Equal(t, 3, heads.Count()) - heads.AddHeads(testutils.Head(400)) + assert.NoError(t, heads.AddHeads(testutils.Head(400))) require.Equal(t, 4, heads.Count()) } @@ -77,11 +85,11 @@ func TestHeads_AddHeads(t *testing.T) { var testHeads []*evmtypes.Head var parentHash common.Hash - for i := 0; i < 5; i++ { - hash := utils.NewHash() + for i := 1; i < 6; i++ { + hash := common.BigToHash(big.NewInt(int64(i))) h := evmtypes.NewHead(big.NewInt(int64(i)), hash, parentHash, uint64(time.Now().Unix()), ubig.NewI(0)) testHeads = append(testHeads, &h) - if i == 2 { + if i == 3 { // uncled block h := evmtypes.NewHead(big.NewInt(int64(i)), uncleHash, parentHash, uint64(time.Now().Unix()), ubig.NewI(0)) testHeads = append(testHeads, &h) @@ -89,10 +97,10 @@ func TestHeads_AddHeads(t *testing.T) { parentHash = hash } - heads.AddHeads(testHeads...) + assert.NoError(t, heads.AddHeads(testHeads...)) require.Equal(t, 6, heads.Count()) // Add duplicates (should be ignored) - heads.AddHeads(testHeads[2:5]...) + assert.NoError(t, heads.AddHeads(testHeads[2:5]...)) require.Equal(t, 6, heads.Count()) head := heads.LatestHead() @@ -102,6 +110,26 @@ func TestHeads_AddHeads(t *testing.T) { head = heads.HeadByHash(uncleHash) require.NotNil(t, head) require.Equal(t, 3, int(head.ChainLength())) + // returns an error, if newHead creates cycle + t.Run("Returns an error, if newHead create cycle", func(t *testing.T) { + cycleHead := &evmtypes.Head{ + Hash: heads.LatestHead().EarliestInChain().ParentHash, + ParentHash: heads.LatestHead().Hash, + } + // 1. try adding in front + cycleHead.Number = heads.LatestHead().Number + 1 + assert.EqualError(t, heads.AddHeads(cycleHead), "potential cycle detected while adding newHead as parent: expected head number to strictly decrease in 'child -> parent' relation: child(Head{Number: 1, Hash: 0x0000000000000000000000000000000000000000000000000000000000000001, ParentHash: 0x0000000000000000000000000000000000000000000000000000000000000000}), parent(Head{Number: 6, Hash: 0x0000000000000000000000000000000000000000000000000000000000000000, ParentHash: 0x0000000000000000000000000000000000000000000000000000000000000005})") + // 2. try adding to back + cycleHead.Number = heads.LatestHead().EarliestInChain().Number - 1 + assert.EqualError(t, heads.AddHeads(cycleHead), "potential cycle detected while adding newHead as child: expected head number to strictly decrease in 'child -> parent' relation: child(Head{Number: 0, Hash: 0x0000000000000000000000000000000000000000000000000000000000000000, ParentHash: 0x0000000000000000000000000000000000000000000000000000000000000005}), parent(Head{Number: 5, Hash: 0x0000000000000000000000000000000000000000000000000000000000000005, ParentHash: 0x0000000000000000000000000000000000000000000000000000000000000004})") + // 3. try adding to back with reference to self + cycleHead = &evmtypes.Head{ + Number: 1000, + Hash: common.BigToHash(big.NewInt(1000)), + ParentHash: common.BigToHash(big.NewInt(1000)), + } + assert.EqualError(t, heads.AddHeads(cycleHead), "cycle detected: newHeads reference itself newHead(Head{Number: 1000, Hash: 0x00000000000000000000000000000000000000000000000000000000000003e8, ParentHash: 0x00000000000000000000000000000000000000000000000000000000000003e8})") + }) } func TestHeads_MarkFinalized(t *testing.T) { @@ -110,7 +138,7 @@ func TestHeads_MarkFinalized(t *testing.T) { heads := headtracker.NewHeads() // create chain - // H0 <- H1 <- H2 <- H3 <- H4 <- H5 + // H0 <- H1 <- H2 <- H3 <- H4 <- H5 - Canonical // \ \ // H1Uncle H2Uncle // @@ -127,35 +155,80 @@ func TestHeads_MarkFinalized(t *testing.T) { h5 := newHead(5, h4.Hash) h2Uncle := newHead(2, h1.Hash) - allHeads := []*evmtypes.Head{h0, h1, h1Uncle, h2, h2Uncle, h3, h4, h5} - heads.AddHeads(allHeads...) + assert.NoError(t, heads.AddHeads(h0, h1, h1Uncle, h2, h2Uncle, h3, h4, h5)) // mark h3 and all ancestors as finalized require.True(t, heads.MarkFinalized(h3.Hash, h1.BlockNumber()), "expected MarkFinalized succeed") - // original heads remain unchanged - for _, h := range allHeads { - assert.False(t, h.IsFinalized, "expected original heads to remain unfinalized") - } - // h0 is too old. It should not be available directly or through its children assert.Nil(t, heads.HeadByHash(h0.Hash)) - assert.Nil(t, heads.HeadByHash(h1.Hash).Parent) - assert.Nil(t, heads.HeadByHash(h1Uncle.Hash).Parent) - assert.Nil(t, heads.HeadByHash(h2Uncle.Hash).Parent.Parent) + assert.Nil(t, heads.HeadByHash(h1.Hash).Parent.Load()) + assert.Nil(t, heads.HeadByHash(h1Uncle.Hash).Parent.Load()) + assert.Nil(t, heads.HeadByHash(h2Uncle.Hash).Parent.Load().Parent.Load()) require.False(t, heads.MarkFinalized(utils.NewHash(), 0), "expected false if finalized hash was not found in existing LatestHead chain") ensureProperFinalization := func(t *testing.T) { t.Helper() for _, head := range []*evmtypes.Head{h5, h4} { - require.False(t, heads.HeadByHash(head.Hash).IsFinalized, "expected h4-h5 not to be finalized", head.BlockNumber()) + require.False(t, heads.HeadByHash(head.Hash).IsFinalized.Load(), "expected h4-h5 not to be finalized", head.BlockNumber()) } for _, head := range []*evmtypes.Head{h3, h2, h1} { - require.True(t, heads.HeadByHash(head.Hash).IsFinalized, "expected h3 and all ancestors to be finalized", head.BlockNumber()) + require.True(t, heads.HeadByHash(head.Hash).IsFinalized.Load(), "expected h3 and all ancestors to be finalized", head.BlockNumber()) } - require.False(t, heads.HeadByHash(h2Uncle.Hash).IsFinalized, "expected uncle block not to be marked as finalized") + require.False(t, heads.HeadByHash(h2Uncle.Hash).IsFinalized.Load(), "expected uncle block not to be marked as finalized") } t.Run("blocks were correctly marked as finalized", ensureProperFinalization) - heads.AddHeads(h0, h1, h2, h2Uncle, h3, h4, h5) + assert.NoError(t, heads.AddHeads(h0, h1, h2, h2Uncle, h3, h4, h5)) t.Run("blocks remain finalized after re adding them to the Heads", ensureProperFinalization) + + // ensure that IsFinalized is propagated, when older blocks are added + // 1. remove all blocks older than 3 + heads.MarkFinalized(h3.Hash, 3) + // 2. ensure that h2 and h1 are no longer present + assert.Nil(t, heads.HeadByHash(h2.Hash)) + assert.Nil(t, heads.HeadByHash(h1.Hash)) + // 3. add blocks back, starting from older + assert.NoError(t, heads.AddHeads(h1)) + assert.False(t, heads.HeadByHash(h1.Hash).IsFinalized.Load(), "expected h1 to not be finalized as it was not explicitly marked and there no path to h3") + assert.NoError(t, heads.AddHeads(h2)) + // 4. now h2 and h1 must be marked as finalized + assert.True(t, heads.HeadByHash(h1.Hash).IsFinalized.Load()) + assert.True(t, heads.HeadByHash(h2.Hash).IsFinalized.Load()) +} + +func BenchmarkEarliestHeadInChain(b *testing.B) { + const latestBlockNum = 200_000 + blocks := NewBlocks(b, latestBlockNum+1) + b.ResetTimer() + for i := 0; i < b.N; i++ { + latest := blocks.Head(latestBlockNum) + earliest := latest.EarliestHeadInChain() + // perform sanity check + assert.NotEqual(b, latest.BlockNumber(), earliest.BlockNumber()) + assert.NotEqual(b, latest.BlockHash(), earliest.BlockHash()) + } +} + +// BenchmarkSimulated_Backfill - benchmarks AddHeads & MarkFinalized as if it was performed by HeadTracker's backfill +func BenchmarkHeads_SimulatedBackfill(b *testing.B) { + makeHash := func(n int64) common.Hash { + return common.BigToHash(big.NewInt(n)) + } + makeHead := func(n int64) *evmtypes.Head { + return &evmtypes.Head{Number: n, Hash: makeHash(n), ParentHash: makeHash(n - 1)} + } + + const finalityDepth = 16_000 // observed value on Arbitrum + // populate with initial values + heads := headtracker.NewHeads() + for i := int64(1); i <= finalityDepth; i++ { + assert.NoError(b, heads.AddHeads(makeHead(i))) + } + heads.MarkFinalized(makeHash(1), 1) + // focus benchmark on processing of a new latest block + b.ResetTimer() + for i := int64(1); i <= int64(b.N); i++ { + assert.NoError(b, heads.AddHeads(makeHead(finalityDepth+i))) + heads.MarkFinalized(makeHash(i), i) + } } diff --git a/core/chains/evm/headtracker/heap.go b/core/chains/evm/headtracker/heap.go new file mode 100644 index 00000000000..572ed541dfa --- /dev/null +++ b/core/chains/evm/headtracker/heap.go @@ -0,0 +1,35 @@ +package headtracker + +import evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" + +type headsHeap struct { + values []*evmtypes.Head +} + +func (h *headsHeap) Len() int { + return len(h.values) +} + +func (h *headsHeap) Swap(i, j int) { + h.values[i], h.values[j] = h.values[j], h.values[i] +} + +func (h *headsHeap) Less(i, j int) bool { + return h.values[i].Number < h.values[j].Number +} + +func (h *headsHeap) Pop() any { + n := len(h.values) - 1 + old := h.values[n] + h.values[n] = nil + h.values = h.values[:n] + return old +} + +func (h *headsHeap) Push(v any) { + h.values = append(h.values, v.(*evmtypes.Head)) +} + +func (h *headsHeap) Peek() *evmtypes.Head { + return h.values[0] +} diff --git a/core/chains/evm/headtracker/orm.go b/core/chains/evm/headtracker/orm.go index 9d569ade08d..5595fc7366a 100644 --- a/core/chains/evm/headtracker/orm.go +++ b/core/chains/evm/headtracker/orm.go @@ -9,6 +9,7 @@ import ( pkgerrors "github.com/pkg/errors" "github.com/smartcontractkit/chainlink-common/pkg/sqlutil" + evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" ubig "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils/big" ) @@ -82,3 +83,29 @@ func (orm *DbORM) HeadByHash(ctx context.Context, hash common.Hash) (head *evmty } return head, err } + +type nullORM struct{} + +func NewNullORM() ORM { + return &nullORM{} +} + +func (orm *nullORM) IdempotentInsertHead(ctx context.Context, head *evmtypes.Head) error { + return nil +} + +func (orm *nullORM) TrimOldHeads(ctx context.Context, minBlockNumber int64) (err error) { + return nil +} + +func (orm *nullORM) LatestHead(ctx context.Context) (head *evmtypes.Head, err error) { + return nil, nil +} + +func (orm *nullORM) LatestHeads(ctx context.Context, minBlockNumer int64) (heads []*evmtypes.Head, err error) { + return nil, nil +} + +func (orm *nullORM) HeadByHash(ctx context.Context, hash common.Hash) (head *evmtypes.Head, err error) { + return nil, nil +} diff --git a/core/chains/evm/headtracker/simulated_head_tracker.go b/core/chains/evm/headtracker/simulated_head_tracker.go index e1e550de992..62bb4968c2f 100644 --- a/core/chains/evm/headtracker/simulated_head_tracker.go +++ b/core/chains/evm/headtracker/simulated_head_tracker.go @@ -2,6 +2,7 @@ package headtracker import ( "context" + "errors" "fmt" "math/big" @@ -51,3 +52,31 @@ func (ht *simulatedHeadTracker) LatestAndFinalizedBlock(ctx context.Context) (*e return latest, finalizedBlock, nil } + +func (ht *simulatedHeadTracker) LatestChain() *evmtypes.Head { + return nil +} + +func (ht *simulatedHeadTracker) HealthReport() map[string]error { + return nil +} + +func (ht *simulatedHeadTracker) Start(_ context.Context) error { + return nil +} + +func (ht *simulatedHeadTracker) Close() error { + return nil +} + +func (ht *simulatedHeadTracker) Backfill(_ context.Context, _ *evmtypes.Head) error { + return errors.New("unimplemented") +} + +func (ht *simulatedHeadTracker) Name() string { + return "SimulatedHeadTracker" +} + +func (ht *simulatedHeadTracker) Ready() error { + return nil +} diff --git a/core/chains/evm/headtracker/types/types.go b/core/chains/evm/headtracker/types/types.go index 1a03f3cec6f..ca5a79fc68d 100644 --- a/core/chains/evm/headtracker/types/types.go +++ b/core/chains/evm/headtracker/types/types.go @@ -2,10 +2,13 @@ package types import ( "context" + "math/big" + "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/common" "github.com/smartcontractkit/chainlink/v2/common/headtracker" + htrktypes "github.com/smartcontractkit/chainlink/v2/common/headtracker/types" evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" ) @@ -22,4 +25,5 @@ type ( HeadTrackable = headtracker.HeadTrackable[*evmtypes.Head, common.Hash] HeadListener = headtracker.HeadListener[*evmtypes.Head, common.Hash] HeadBroadcaster = headtracker.HeadBroadcaster[*evmtypes.Head, common.Hash] + Client = htrktypes.Client[*evmtypes.Head, ethereum.Subscription, *big.Int, common.Hash] ) diff --git a/core/chains/evm/keystore/eth.go b/core/chains/evm/keystore/eth.go index 1e2b0c439bc..ff71e0a4f18 100644 --- a/core/chains/evm/keystore/eth.go +++ b/core/chains/evm/keystore/eth.go @@ -9,8 +9,6 @@ import ( ) // Eth is the external interface for EthKeyStore -// -//go:generate mockery --quiet --name Eth --output mocks/ --case=underscore type Eth interface { CheckEnabled(ctx context.Context, address common.Address, chainID *big.Int) error EnabledAddressesForChain(ctx context.Context, chainID *big.Int) (addresses []common.Address, err error) diff --git a/core/chains/evm/keystore/mocks/eth.go b/core/chains/evm/keystore/mocks/eth.go index df46adb2022..d0563702b7b 100644 --- a/core/chains/evm/keystore/mocks/eth.go +++ b/core/chains/evm/keystore/mocks/eth.go @@ -18,6 +18,14 @@ type Eth struct { mock.Mock } +type Eth_Expecter struct { + mock *mock.Mock +} + +func (_m *Eth) EXPECT() *Eth_Expecter { + return &Eth_Expecter{mock: &_m.Mock} +} + // CheckEnabled provides a mock function with given fields: ctx, address, chainID func (_m *Eth) CheckEnabled(ctx context.Context, address common.Address, chainID *big.Int) error { ret := _m.Called(ctx, address, chainID) @@ -36,6 +44,36 @@ func (_m *Eth) CheckEnabled(ctx context.Context, address common.Address, chainID return r0 } +// Eth_CheckEnabled_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CheckEnabled' +type Eth_CheckEnabled_Call struct { + *mock.Call +} + +// CheckEnabled is a helper method to define mock.On call +// - ctx context.Context +// - address common.Address +// - chainID *big.Int +func (_e *Eth_Expecter) CheckEnabled(ctx interface{}, address interface{}, chainID interface{}) *Eth_CheckEnabled_Call { + return &Eth_CheckEnabled_Call{Call: _e.mock.On("CheckEnabled", ctx, address, chainID)} +} + +func (_c *Eth_CheckEnabled_Call) Run(run func(ctx context.Context, address common.Address, chainID *big.Int)) *Eth_CheckEnabled_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(common.Address), args[2].(*big.Int)) + }) + return _c +} + +func (_c *Eth_CheckEnabled_Call) Return(_a0 error) *Eth_CheckEnabled_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Eth_CheckEnabled_Call) RunAndReturn(run func(context.Context, common.Address, *big.Int) error) *Eth_CheckEnabled_Call { + _c.Call.Return(run) + return _c +} + // EnabledAddressesForChain provides a mock function with given fields: ctx, chainID func (_m *Eth) EnabledAddressesForChain(ctx context.Context, chainID *big.Int) ([]common.Address, error) { ret := _m.Called(ctx, chainID) @@ -66,6 +104,35 @@ func (_m *Eth) EnabledAddressesForChain(ctx context.Context, chainID *big.Int) ( return r0, r1 } +// Eth_EnabledAddressesForChain_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EnabledAddressesForChain' +type Eth_EnabledAddressesForChain_Call struct { + *mock.Call +} + +// EnabledAddressesForChain is a helper method to define mock.On call +// - ctx context.Context +// - chainID *big.Int +func (_e *Eth_Expecter) EnabledAddressesForChain(ctx interface{}, chainID interface{}) *Eth_EnabledAddressesForChain_Call { + return &Eth_EnabledAddressesForChain_Call{Call: _e.mock.On("EnabledAddressesForChain", ctx, chainID)} +} + +func (_c *Eth_EnabledAddressesForChain_Call) Run(run func(ctx context.Context, chainID *big.Int)) *Eth_EnabledAddressesForChain_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*big.Int)) + }) + return _c +} + +func (_c *Eth_EnabledAddressesForChain_Call) Return(addresses []common.Address, err error) *Eth_EnabledAddressesForChain_Call { + _c.Call.Return(addresses, err) + return _c +} + +func (_c *Eth_EnabledAddressesForChain_Call) RunAndReturn(run func(context.Context, *big.Int) ([]common.Address, error)) *Eth_EnabledAddressesForChain_Call { + _c.Call.Return(run) + return _c +} + // SignTx provides a mock function with given fields: ctx, fromAddress, tx, chainID func (_m *Eth) SignTx(ctx context.Context, fromAddress common.Address, tx *types.Transaction, chainID *big.Int) (*types.Transaction, error) { ret := _m.Called(ctx, fromAddress, tx, chainID) @@ -96,6 +163,37 @@ func (_m *Eth) SignTx(ctx context.Context, fromAddress common.Address, tx *types return r0, r1 } +// Eth_SignTx_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SignTx' +type Eth_SignTx_Call struct { + *mock.Call +} + +// SignTx is a helper method to define mock.On call +// - ctx context.Context +// - fromAddress common.Address +// - tx *types.Transaction +// - chainID *big.Int +func (_e *Eth_Expecter) SignTx(ctx interface{}, fromAddress interface{}, tx interface{}, chainID interface{}) *Eth_SignTx_Call { + return &Eth_SignTx_Call{Call: _e.mock.On("SignTx", ctx, fromAddress, tx, chainID)} +} + +func (_c *Eth_SignTx_Call) Run(run func(ctx context.Context, fromAddress common.Address, tx *types.Transaction, chainID *big.Int)) *Eth_SignTx_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(common.Address), args[2].(*types.Transaction), args[3].(*big.Int)) + }) + return _c +} + +func (_c *Eth_SignTx_Call) Return(_a0 *types.Transaction, _a1 error) *Eth_SignTx_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Eth_SignTx_Call) RunAndReturn(run func(context.Context, common.Address, *types.Transaction, *big.Int) (*types.Transaction, error)) *Eth_SignTx_Call { + _c.Call.Return(run) + return _c +} + // SubscribeToKeyChanges provides a mock function with given fields: ctx func (_m *Eth) SubscribeToKeyChanges(ctx context.Context) (chan struct{}, func()) { ret := _m.Called(ctx) @@ -128,6 +226,34 @@ func (_m *Eth) SubscribeToKeyChanges(ctx context.Context) (chan struct{}, func() return r0, r1 } +// Eth_SubscribeToKeyChanges_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SubscribeToKeyChanges' +type Eth_SubscribeToKeyChanges_Call struct { + *mock.Call +} + +// SubscribeToKeyChanges is a helper method to define mock.On call +// - ctx context.Context +func (_e *Eth_Expecter) SubscribeToKeyChanges(ctx interface{}) *Eth_SubscribeToKeyChanges_Call { + return &Eth_SubscribeToKeyChanges_Call{Call: _e.mock.On("SubscribeToKeyChanges", ctx)} +} + +func (_c *Eth_SubscribeToKeyChanges_Call) Run(run func(ctx context.Context)) *Eth_SubscribeToKeyChanges_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *Eth_SubscribeToKeyChanges_Call) Return(ch chan struct{}, unsub func()) *Eth_SubscribeToKeyChanges_Call { + _c.Call.Return(ch, unsub) + return _c +} + +func (_c *Eth_SubscribeToKeyChanges_Call) RunAndReturn(run func(context.Context) (chan struct{}, func())) *Eth_SubscribeToKeyChanges_Call { + _c.Call.Return(run) + return _c +} + // NewEth creates a new instance of Eth. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewEth(t interface { diff --git a/core/chains/evm/log/broadcaster.go b/core/chains/evm/log/broadcaster.go index 148c36148c2..3e37678bee3 100644 --- a/core/chains/evm/log/broadcaster.go +++ b/core/chains/evm/log/broadcaster.go @@ -26,8 +26,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" ) -//go:generate mockery --quiet --name Broadcaster --output ./mocks/ --case=underscore --structname Broadcaster --filename broadcaster.go - type ( // The Broadcaster manages log subscription requests for the Chainlink node. Instead // of creating a new subscription for each request, it multiplexes all subscriptions @@ -592,7 +590,7 @@ func (b *broadcaster) onNewHeads() { b.logger.Errorf("Failed to query for log broadcasts, %v", err) return } - b.registrations.sendLogs(ctx, logs, *latestHead, broadcasts, b.orm) + b.registrations.sendLogs(ctx, logs, latestHead, broadcasts, b.orm) if err := b.orm.SetPendingMinBlock(ctx, nil); err != nil { b.logger.Errorw("Failed to set pending broadcasts number null", "err", err) } @@ -607,7 +605,7 @@ func (b *broadcaster) onNewHeads() { return } - b.registrations.sendLogs(ctx, logs, *latestHead, broadcasts, b.orm) + b.registrations.sendLogs(ctx, logs, latestHead, broadcasts, b.orm) } newMin := b.logPool.deleteOlderLogs(keptDepth) if err := b.orm.SetPendingMinBlock(ctx, newMin); err != nil { diff --git a/core/chains/evm/log/mocks/abigen_contract.go b/core/chains/evm/log/mocks/abigen_contract.go index 31e268cd859..b247afc36fc 100644 --- a/core/chains/evm/log/mocks/abigen_contract.go +++ b/core/chains/evm/log/mocks/abigen_contract.go @@ -16,6 +16,14 @@ type AbigenContract struct { mock.Mock } +type AbigenContract_Expecter struct { + mock *mock.Mock +} + +func (_m *AbigenContract) EXPECT() *AbigenContract_Expecter { + return &AbigenContract_Expecter{mock: &_m.Mock} +} + // Address provides a mock function with given fields: func (_m *AbigenContract) Address() common.Address { ret := _m.Called() @@ -36,6 +44,33 @@ func (_m *AbigenContract) Address() common.Address { return r0 } +// AbigenContract_Address_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Address' +type AbigenContract_Address_Call struct { + *mock.Call +} + +// Address is a helper method to define mock.On call +func (_e *AbigenContract_Expecter) Address() *AbigenContract_Address_Call { + return &AbigenContract_Address_Call{Call: _e.mock.On("Address")} +} + +func (_c *AbigenContract_Address_Call) Run(run func()) *AbigenContract_Address_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *AbigenContract_Address_Call) Return(_a0 common.Address) *AbigenContract_Address_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *AbigenContract_Address_Call) RunAndReturn(run func() common.Address) *AbigenContract_Address_Call { + _c.Call.Return(run) + return _c +} + // ParseLog provides a mock function with given fields: _a0 func (_m *AbigenContract) ParseLog(_a0 types.Log) (generated.AbigenLog, error) { ret := _m.Called(_a0) @@ -66,6 +101,34 @@ func (_m *AbigenContract) ParseLog(_a0 types.Log) (generated.AbigenLog, error) { return r0, r1 } +// AbigenContract_ParseLog_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseLog' +type AbigenContract_ParseLog_Call struct { + *mock.Call +} + +// ParseLog is a helper method to define mock.On call +// - _a0 types.Log +func (_e *AbigenContract_Expecter) ParseLog(_a0 interface{}) *AbigenContract_ParseLog_Call { + return &AbigenContract_ParseLog_Call{Call: _e.mock.On("ParseLog", _a0)} +} + +func (_c *AbigenContract_ParseLog_Call) Run(run func(_a0 types.Log)) *AbigenContract_ParseLog_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *AbigenContract_ParseLog_Call) Return(_a0 generated.AbigenLog, _a1 error) *AbigenContract_ParseLog_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *AbigenContract_ParseLog_Call) RunAndReturn(run func(types.Log) (generated.AbigenLog, error)) *AbigenContract_ParseLog_Call { + _c.Call.Return(run) + return _c +} + // NewAbigenContract creates a new instance of AbigenContract. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewAbigenContract(t interface { diff --git a/core/chains/evm/log/mocks/broadcast.go b/core/chains/evm/log/mocks/broadcast.go index c7dfb90055a..8ce800976e8 100644 --- a/core/chains/evm/log/mocks/broadcast.go +++ b/core/chains/evm/log/mocks/broadcast.go @@ -17,6 +17,14 @@ type Broadcast struct { mock.Mock } +type Broadcast_Expecter struct { + mock *mock.Mock +} + +func (_m *Broadcast) EXPECT() *Broadcast_Expecter { + return &Broadcast_Expecter{mock: &_m.Mock} +} + // DecodedLog provides a mock function with given fields: func (_m *Broadcast) DecodedLog() interface{} { ret := _m.Called() @@ -37,6 +45,33 @@ func (_m *Broadcast) DecodedLog() interface{} { return r0 } +// Broadcast_DecodedLog_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DecodedLog' +type Broadcast_DecodedLog_Call struct { + *mock.Call +} + +// DecodedLog is a helper method to define mock.On call +func (_e *Broadcast_Expecter) DecodedLog() *Broadcast_DecodedLog_Call { + return &Broadcast_DecodedLog_Call{Call: _e.mock.On("DecodedLog")} +} + +func (_c *Broadcast_DecodedLog_Call) Run(run func()) *Broadcast_DecodedLog_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Broadcast_DecodedLog_Call) Return(_a0 interface{}) *Broadcast_DecodedLog_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Broadcast_DecodedLog_Call) RunAndReturn(run func() interface{}) *Broadcast_DecodedLog_Call { + _c.Call.Return(run) + return _c +} + // EVMChainID provides a mock function with given fields: func (_m *Broadcast) EVMChainID() big.Int { ret := _m.Called() @@ -55,6 +90,33 @@ func (_m *Broadcast) EVMChainID() big.Int { return r0 } +// Broadcast_EVMChainID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EVMChainID' +type Broadcast_EVMChainID_Call struct { + *mock.Call +} + +// EVMChainID is a helper method to define mock.On call +func (_e *Broadcast_Expecter) EVMChainID() *Broadcast_EVMChainID_Call { + return &Broadcast_EVMChainID_Call{Call: _e.mock.On("EVMChainID")} +} + +func (_c *Broadcast_EVMChainID_Call) Run(run func()) *Broadcast_EVMChainID_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Broadcast_EVMChainID_Call) Return(_a0 big.Int) *Broadcast_EVMChainID_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Broadcast_EVMChainID_Call) RunAndReturn(run func() big.Int) *Broadcast_EVMChainID_Call { + _c.Call.Return(run) + return _c +} + // JobID provides a mock function with given fields: func (_m *Broadcast) JobID() int32 { ret := _m.Called() @@ -73,6 +135,33 @@ func (_m *Broadcast) JobID() int32 { return r0 } +// Broadcast_JobID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'JobID' +type Broadcast_JobID_Call struct { + *mock.Call +} + +// JobID is a helper method to define mock.On call +func (_e *Broadcast_Expecter) JobID() *Broadcast_JobID_Call { + return &Broadcast_JobID_Call{Call: _e.mock.On("JobID")} +} + +func (_c *Broadcast_JobID_Call) Run(run func()) *Broadcast_JobID_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Broadcast_JobID_Call) Return(_a0 int32) *Broadcast_JobID_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Broadcast_JobID_Call) RunAndReturn(run func() int32) *Broadcast_JobID_Call { + _c.Call.Return(run) + return _c +} + // LatestBlockHash provides a mock function with given fields: func (_m *Broadcast) LatestBlockHash() common.Hash { ret := _m.Called() @@ -93,6 +182,33 @@ func (_m *Broadcast) LatestBlockHash() common.Hash { return r0 } +// Broadcast_LatestBlockHash_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LatestBlockHash' +type Broadcast_LatestBlockHash_Call struct { + *mock.Call +} + +// LatestBlockHash is a helper method to define mock.On call +func (_e *Broadcast_Expecter) LatestBlockHash() *Broadcast_LatestBlockHash_Call { + return &Broadcast_LatestBlockHash_Call{Call: _e.mock.On("LatestBlockHash")} +} + +func (_c *Broadcast_LatestBlockHash_Call) Run(run func()) *Broadcast_LatestBlockHash_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Broadcast_LatestBlockHash_Call) Return(_a0 common.Hash) *Broadcast_LatestBlockHash_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Broadcast_LatestBlockHash_Call) RunAndReturn(run func() common.Hash) *Broadcast_LatestBlockHash_Call { + _c.Call.Return(run) + return _c +} + // LatestBlockNumber provides a mock function with given fields: func (_m *Broadcast) LatestBlockNumber() uint64 { ret := _m.Called() @@ -111,6 +227,33 @@ func (_m *Broadcast) LatestBlockNumber() uint64 { return r0 } +// Broadcast_LatestBlockNumber_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LatestBlockNumber' +type Broadcast_LatestBlockNumber_Call struct { + *mock.Call +} + +// LatestBlockNumber is a helper method to define mock.On call +func (_e *Broadcast_Expecter) LatestBlockNumber() *Broadcast_LatestBlockNumber_Call { + return &Broadcast_LatestBlockNumber_Call{Call: _e.mock.On("LatestBlockNumber")} +} + +func (_c *Broadcast_LatestBlockNumber_Call) Run(run func()) *Broadcast_LatestBlockNumber_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Broadcast_LatestBlockNumber_Call) Return(_a0 uint64) *Broadcast_LatestBlockNumber_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Broadcast_LatestBlockNumber_Call) RunAndReturn(run func() uint64) *Broadcast_LatestBlockNumber_Call { + _c.Call.Return(run) + return _c +} + // RawLog provides a mock function with given fields: func (_m *Broadcast) RawLog() types.Log { ret := _m.Called() @@ -129,6 +272,33 @@ func (_m *Broadcast) RawLog() types.Log { return r0 } +// Broadcast_RawLog_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RawLog' +type Broadcast_RawLog_Call struct { + *mock.Call +} + +// RawLog is a helper method to define mock.On call +func (_e *Broadcast_Expecter) RawLog() *Broadcast_RawLog_Call { + return &Broadcast_RawLog_Call{Call: _e.mock.On("RawLog")} +} + +func (_c *Broadcast_RawLog_Call) Run(run func()) *Broadcast_RawLog_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Broadcast_RawLog_Call) Return(_a0 types.Log) *Broadcast_RawLog_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Broadcast_RawLog_Call) RunAndReturn(run func() types.Log) *Broadcast_RawLog_Call { + _c.Call.Return(run) + return _c +} + // ReceiptsRoot provides a mock function with given fields: func (_m *Broadcast) ReceiptsRoot() common.Hash { ret := _m.Called() @@ -149,6 +319,33 @@ func (_m *Broadcast) ReceiptsRoot() common.Hash { return r0 } +// Broadcast_ReceiptsRoot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ReceiptsRoot' +type Broadcast_ReceiptsRoot_Call struct { + *mock.Call +} + +// ReceiptsRoot is a helper method to define mock.On call +func (_e *Broadcast_Expecter) ReceiptsRoot() *Broadcast_ReceiptsRoot_Call { + return &Broadcast_ReceiptsRoot_Call{Call: _e.mock.On("ReceiptsRoot")} +} + +func (_c *Broadcast_ReceiptsRoot_Call) Run(run func()) *Broadcast_ReceiptsRoot_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Broadcast_ReceiptsRoot_Call) Return(_a0 common.Hash) *Broadcast_ReceiptsRoot_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Broadcast_ReceiptsRoot_Call) RunAndReturn(run func() common.Hash) *Broadcast_ReceiptsRoot_Call { + _c.Call.Return(run) + return _c +} + // StateRoot provides a mock function with given fields: func (_m *Broadcast) StateRoot() common.Hash { ret := _m.Called() @@ -169,6 +366,33 @@ func (_m *Broadcast) StateRoot() common.Hash { return r0 } +// Broadcast_StateRoot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StateRoot' +type Broadcast_StateRoot_Call struct { + *mock.Call +} + +// StateRoot is a helper method to define mock.On call +func (_e *Broadcast_Expecter) StateRoot() *Broadcast_StateRoot_Call { + return &Broadcast_StateRoot_Call{Call: _e.mock.On("StateRoot")} +} + +func (_c *Broadcast_StateRoot_Call) Run(run func()) *Broadcast_StateRoot_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Broadcast_StateRoot_Call) Return(_a0 common.Hash) *Broadcast_StateRoot_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Broadcast_StateRoot_Call) RunAndReturn(run func() common.Hash) *Broadcast_StateRoot_Call { + _c.Call.Return(run) + return _c +} + // String provides a mock function with given fields: func (_m *Broadcast) String() string { ret := _m.Called() @@ -187,6 +411,33 @@ func (_m *Broadcast) String() string { return r0 } +// Broadcast_String_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'String' +type Broadcast_String_Call struct { + *mock.Call +} + +// String is a helper method to define mock.On call +func (_e *Broadcast_Expecter) String() *Broadcast_String_Call { + return &Broadcast_String_Call{Call: _e.mock.On("String")} +} + +func (_c *Broadcast_String_Call) Run(run func()) *Broadcast_String_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Broadcast_String_Call) Return(_a0 string) *Broadcast_String_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Broadcast_String_Call) RunAndReturn(run func() string) *Broadcast_String_Call { + _c.Call.Return(run) + return _c +} + // TransactionsRoot provides a mock function with given fields: func (_m *Broadcast) TransactionsRoot() common.Hash { ret := _m.Called() @@ -207,6 +458,33 @@ func (_m *Broadcast) TransactionsRoot() common.Hash { return r0 } +// Broadcast_TransactionsRoot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TransactionsRoot' +type Broadcast_TransactionsRoot_Call struct { + *mock.Call +} + +// TransactionsRoot is a helper method to define mock.On call +func (_e *Broadcast_Expecter) TransactionsRoot() *Broadcast_TransactionsRoot_Call { + return &Broadcast_TransactionsRoot_Call{Call: _e.mock.On("TransactionsRoot")} +} + +func (_c *Broadcast_TransactionsRoot_Call) Run(run func()) *Broadcast_TransactionsRoot_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Broadcast_TransactionsRoot_Call) Return(_a0 common.Hash) *Broadcast_TransactionsRoot_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Broadcast_TransactionsRoot_Call) RunAndReturn(run func() common.Hash) *Broadcast_TransactionsRoot_Call { + _c.Call.Return(run) + return _c +} + // NewBroadcast creates a new instance of Broadcast. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewBroadcast(t interface { diff --git a/core/chains/evm/log/mocks/broadcaster.go b/core/chains/evm/log/mocks/broadcaster.go index 4571ba4babf..a2dc15cc4fd 100644 --- a/core/chains/evm/log/mocks/broadcaster.go +++ b/core/chains/evm/log/mocks/broadcaster.go @@ -18,11 +18,47 @@ type Broadcaster struct { mock.Mock } +type Broadcaster_Expecter struct { + mock *mock.Mock +} + +func (_m *Broadcaster) EXPECT() *Broadcaster_Expecter { + return &Broadcaster_Expecter{mock: &_m.Mock} +} + // AddDependents provides a mock function with given fields: n func (_m *Broadcaster) AddDependents(n int) { _m.Called(n) } +// Broadcaster_AddDependents_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddDependents' +type Broadcaster_AddDependents_Call struct { + *mock.Call +} + +// AddDependents is a helper method to define mock.On call +// - n int +func (_e *Broadcaster_Expecter) AddDependents(n interface{}) *Broadcaster_AddDependents_Call { + return &Broadcaster_AddDependents_Call{Call: _e.mock.On("AddDependents", n)} +} + +func (_c *Broadcaster_AddDependents_Call) Run(run func(n int)) *Broadcaster_AddDependents_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(int)) + }) + return _c +} + +func (_c *Broadcaster_AddDependents_Call) Return() *Broadcaster_AddDependents_Call { + _c.Call.Return() + return _c +} + +func (_c *Broadcaster_AddDependents_Call) RunAndReturn(run func(int)) *Broadcaster_AddDependents_Call { + _c.Call.Return(run) + return _c +} + // AwaitDependents provides a mock function with given fields: func (_m *Broadcaster) AwaitDependents() <-chan struct{} { ret := _m.Called() @@ -43,6 +79,33 @@ func (_m *Broadcaster) AwaitDependents() <-chan struct{} { return r0 } +// Broadcaster_AwaitDependents_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AwaitDependents' +type Broadcaster_AwaitDependents_Call struct { + *mock.Call +} + +// AwaitDependents is a helper method to define mock.On call +func (_e *Broadcaster_Expecter) AwaitDependents() *Broadcaster_AwaitDependents_Call { + return &Broadcaster_AwaitDependents_Call{Call: _e.mock.On("AwaitDependents")} +} + +func (_c *Broadcaster_AwaitDependents_Call) Run(run func()) *Broadcaster_AwaitDependents_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Broadcaster_AwaitDependents_Call) Return(_a0 <-chan struct{}) *Broadcaster_AwaitDependents_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Broadcaster_AwaitDependents_Call) RunAndReturn(run func() <-chan struct{}) *Broadcaster_AwaitDependents_Call { + _c.Call.Return(run) + return _c +} + // Close provides a mock function with given fields: func (_m *Broadcaster) Close() error { ret := _m.Called() @@ -61,11 +124,65 @@ func (_m *Broadcaster) Close() error { return r0 } +// Broadcaster_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close' +type Broadcaster_Close_Call struct { + *mock.Call +} + +// Close is a helper method to define mock.On call +func (_e *Broadcaster_Expecter) Close() *Broadcaster_Close_Call { + return &Broadcaster_Close_Call{Call: _e.mock.On("Close")} +} + +func (_c *Broadcaster_Close_Call) Run(run func()) *Broadcaster_Close_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Broadcaster_Close_Call) Return(_a0 error) *Broadcaster_Close_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Broadcaster_Close_Call) RunAndReturn(run func() error) *Broadcaster_Close_Call { + _c.Call.Return(run) + return _c +} + // DependentReady provides a mock function with given fields: func (_m *Broadcaster) DependentReady() { _m.Called() } +// Broadcaster_DependentReady_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DependentReady' +type Broadcaster_DependentReady_Call struct { + *mock.Call +} + +// DependentReady is a helper method to define mock.On call +func (_e *Broadcaster_Expecter) DependentReady() *Broadcaster_DependentReady_Call { + return &Broadcaster_DependentReady_Call{Call: _e.mock.On("DependentReady")} +} + +func (_c *Broadcaster_DependentReady_Call) Run(run func()) *Broadcaster_DependentReady_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Broadcaster_DependentReady_Call) Return() *Broadcaster_DependentReady_Call { + _c.Call.Return() + return _c +} + +func (_c *Broadcaster_DependentReady_Call) RunAndReturn(run func()) *Broadcaster_DependentReady_Call { + _c.Call.Return(run) + return _c +} + // HealthReport provides a mock function with given fields: func (_m *Broadcaster) HealthReport() map[string]error { ret := _m.Called() @@ -86,6 +203,33 @@ func (_m *Broadcaster) HealthReport() map[string]error { return r0 } +// Broadcaster_HealthReport_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HealthReport' +type Broadcaster_HealthReport_Call struct { + *mock.Call +} + +// HealthReport is a helper method to define mock.On call +func (_e *Broadcaster_Expecter) HealthReport() *Broadcaster_HealthReport_Call { + return &Broadcaster_HealthReport_Call{Call: _e.mock.On("HealthReport")} +} + +func (_c *Broadcaster_HealthReport_Call) Run(run func()) *Broadcaster_HealthReport_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Broadcaster_HealthReport_Call) Return(_a0 map[string]error) *Broadcaster_HealthReport_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Broadcaster_HealthReport_Call) RunAndReturn(run func() map[string]error) *Broadcaster_HealthReport_Call { + _c.Call.Return(run) + return _c +} + // IsConnected provides a mock function with given fields: func (_m *Broadcaster) IsConnected() bool { ret := _m.Called() @@ -104,6 +248,33 @@ func (_m *Broadcaster) IsConnected() bool { return r0 } +// Broadcaster_IsConnected_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsConnected' +type Broadcaster_IsConnected_Call struct { + *mock.Call +} + +// IsConnected is a helper method to define mock.On call +func (_e *Broadcaster_Expecter) IsConnected() *Broadcaster_IsConnected_Call { + return &Broadcaster_IsConnected_Call{Call: _e.mock.On("IsConnected")} +} + +func (_c *Broadcaster_IsConnected_Call) Run(run func()) *Broadcaster_IsConnected_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Broadcaster_IsConnected_Call) Return(_a0 bool) *Broadcaster_IsConnected_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Broadcaster_IsConnected_Call) RunAndReturn(run func() bool) *Broadcaster_IsConnected_Call { + _c.Call.Return(run) + return _c +} + // MarkConsumed provides a mock function with given fields: ctx, ds, lb func (_m *Broadcaster) MarkConsumed(ctx context.Context, ds sqlutil.DataSource, lb log.Broadcast) error { ret := _m.Called(ctx, ds, lb) @@ -122,6 +293,36 @@ func (_m *Broadcaster) MarkConsumed(ctx context.Context, ds sqlutil.DataSource, return r0 } +// Broadcaster_MarkConsumed_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MarkConsumed' +type Broadcaster_MarkConsumed_Call struct { + *mock.Call +} + +// MarkConsumed is a helper method to define mock.On call +// - ctx context.Context +// - ds sqlutil.DataSource +// - lb log.Broadcast +func (_e *Broadcaster_Expecter) MarkConsumed(ctx interface{}, ds interface{}, lb interface{}) *Broadcaster_MarkConsumed_Call { + return &Broadcaster_MarkConsumed_Call{Call: _e.mock.On("MarkConsumed", ctx, ds, lb)} +} + +func (_c *Broadcaster_MarkConsumed_Call) Run(run func(ctx context.Context, ds sqlutil.DataSource, lb log.Broadcast)) *Broadcaster_MarkConsumed_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(sqlutil.DataSource), args[2].(log.Broadcast)) + }) + return _c +} + +func (_c *Broadcaster_MarkConsumed_Call) Return(_a0 error) *Broadcaster_MarkConsumed_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Broadcaster_MarkConsumed_Call) RunAndReturn(run func(context.Context, sqlutil.DataSource, log.Broadcast) error) *Broadcaster_MarkConsumed_Call { + _c.Call.Return(run) + return _c +} + // Name provides a mock function with given fields: func (_m *Broadcaster) Name() string { ret := _m.Called() @@ -140,11 +341,67 @@ func (_m *Broadcaster) Name() string { return r0 } +// Broadcaster_Name_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Name' +type Broadcaster_Name_Call struct { + *mock.Call +} + +// Name is a helper method to define mock.On call +func (_e *Broadcaster_Expecter) Name() *Broadcaster_Name_Call { + return &Broadcaster_Name_Call{Call: _e.mock.On("Name")} +} + +func (_c *Broadcaster_Name_Call) Run(run func()) *Broadcaster_Name_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Broadcaster_Name_Call) Return(_a0 string) *Broadcaster_Name_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Broadcaster_Name_Call) RunAndReturn(run func() string) *Broadcaster_Name_Call { + _c.Call.Return(run) + return _c +} + // OnNewLongestChain provides a mock function with given fields: ctx, head func (_m *Broadcaster) OnNewLongestChain(ctx context.Context, head *types.Head) { _m.Called(ctx, head) } +// Broadcaster_OnNewLongestChain_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OnNewLongestChain' +type Broadcaster_OnNewLongestChain_Call struct { + *mock.Call +} + +// OnNewLongestChain is a helper method to define mock.On call +// - ctx context.Context +// - head *types.Head +func (_e *Broadcaster_Expecter) OnNewLongestChain(ctx interface{}, head interface{}) *Broadcaster_OnNewLongestChain_Call { + return &Broadcaster_OnNewLongestChain_Call{Call: _e.mock.On("OnNewLongestChain", ctx, head)} +} + +func (_c *Broadcaster_OnNewLongestChain_Call) Run(run func(ctx context.Context, head *types.Head)) *Broadcaster_OnNewLongestChain_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*types.Head)) + }) + return _c +} + +func (_c *Broadcaster_OnNewLongestChain_Call) Return() *Broadcaster_OnNewLongestChain_Call { + _c.Call.Return() + return _c +} + +func (_c *Broadcaster_OnNewLongestChain_Call) RunAndReturn(run func(context.Context, *types.Head)) *Broadcaster_OnNewLongestChain_Call { + _c.Call.Return(run) + return _c +} + // Ready provides a mock function with given fields: func (_m *Broadcaster) Ready() error { ret := _m.Called() @@ -163,6 +420,33 @@ func (_m *Broadcaster) Ready() error { return r0 } +// Broadcaster_Ready_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Ready' +type Broadcaster_Ready_Call struct { + *mock.Call +} + +// Ready is a helper method to define mock.On call +func (_e *Broadcaster_Expecter) Ready() *Broadcaster_Ready_Call { + return &Broadcaster_Ready_Call{Call: _e.mock.On("Ready")} +} + +func (_c *Broadcaster_Ready_Call) Run(run func()) *Broadcaster_Ready_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Broadcaster_Ready_Call) Return(_a0 error) *Broadcaster_Ready_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Broadcaster_Ready_Call) RunAndReturn(run func() error) *Broadcaster_Ready_Call { + _c.Call.Return(run) + return _c +} + // Register provides a mock function with given fields: listener, opts func (_m *Broadcaster) Register(listener log.Listener, opts log.ListenerOpts) func() { ret := _m.Called(listener, opts) @@ -183,11 +467,69 @@ func (_m *Broadcaster) Register(listener log.Listener, opts log.ListenerOpts) fu return r0 } +// Broadcaster_Register_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Register' +type Broadcaster_Register_Call struct { + *mock.Call +} + +// Register is a helper method to define mock.On call +// - listener log.Listener +// - opts log.ListenerOpts +func (_e *Broadcaster_Expecter) Register(listener interface{}, opts interface{}) *Broadcaster_Register_Call { + return &Broadcaster_Register_Call{Call: _e.mock.On("Register", listener, opts)} +} + +func (_c *Broadcaster_Register_Call) Run(run func(listener log.Listener, opts log.ListenerOpts)) *Broadcaster_Register_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(log.Listener), args[1].(log.ListenerOpts)) + }) + return _c +} + +func (_c *Broadcaster_Register_Call) Return(unsubscribe func()) *Broadcaster_Register_Call { + _c.Call.Return(unsubscribe) + return _c +} + +func (_c *Broadcaster_Register_Call) RunAndReturn(run func(log.Listener, log.ListenerOpts) func()) *Broadcaster_Register_Call { + _c.Call.Return(run) + return _c +} + // ReplayFromBlock provides a mock function with given fields: number, forceBroadcast func (_m *Broadcaster) ReplayFromBlock(number int64, forceBroadcast bool) { _m.Called(number, forceBroadcast) } +// Broadcaster_ReplayFromBlock_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ReplayFromBlock' +type Broadcaster_ReplayFromBlock_Call struct { + *mock.Call +} + +// ReplayFromBlock is a helper method to define mock.On call +// - number int64 +// - forceBroadcast bool +func (_e *Broadcaster_Expecter) ReplayFromBlock(number interface{}, forceBroadcast interface{}) *Broadcaster_ReplayFromBlock_Call { + return &Broadcaster_ReplayFromBlock_Call{Call: _e.mock.On("ReplayFromBlock", number, forceBroadcast)} +} + +func (_c *Broadcaster_ReplayFromBlock_Call) Run(run func(number int64, forceBroadcast bool)) *Broadcaster_ReplayFromBlock_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(int64), args[1].(bool)) + }) + return _c +} + +func (_c *Broadcaster_ReplayFromBlock_Call) Return() *Broadcaster_ReplayFromBlock_Call { + _c.Call.Return() + return _c +} + +func (_c *Broadcaster_ReplayFromBlock_Call) RunAndReturn(run func(int64, bool)) *Broadcaster_ReplayFromBlock_Call { + _c.Call.Return(run) + return _c +} + // Start provides a mock function with given fields: _a0 func (_m *Broadcaster) Start(_a0 context.Context) error { ret := _m.Called(_a0) @@ -206,6 +548,34 @@ func (_m *Broadcaster) Start(_a0 context.Context) error { return r0 } +// Broadcaster_Start_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Start' +type Broadcaster_Start_Call struct { + *mock.Call +} + +// Start is a helper method to define mock.On call +// - _a0 context.Context +func (_e *Broadcaster_Expecter) Start(_a0 interface{}) *Broadcaster_Start_Call { + return &Broadcaster_Start_Call{Call: _e.mock.On("Start", _a0)} +} + +func (_c *Broadcaster_Start_Call) Run(run func(_a0 context.Context)) *Broadcaster_Start_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *Broadcaster_Start_Call) Return(_a0 error) *Broadcaster_Start_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Broadcaster_Start_Call) RunAndReturn(run func(context.Context) error) *Broadcaster_Start_Call { + _c.Call.Return(run) + return _c +} + // WasAlreadyConsumed provides a mock function with given fields: ctx, lb func (_m *Broadcaster) WasAlreadyConsumed(ctx context.Context, lb log.Broadcast) (bool, error) { ret := _m.Called(ctx, lb) @@ -234,6 +604,35 @@ func (_m *Broadcaster) WasAlreadyConsumed(ctx context.Context, lb log.Broadcast) return r0, r1 } +// Broadcaster_WasAlreadyConsumed_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WasAlreadyConsumed' +type Broadcaster_WasAlreadyConsumed_Call struct { + *mock.Call +} + +// WasAlreadyConsumed is a helper method to define mock.On call +// - ctx context.Context +// - lb log.Broadcast +func (_e *Broadcaster_Expecter) WasAlreadyConsumed(ctx interface{}, lb interface{}) *Broadcaster_WasAlreadyConsumed_Call { + return &Broadcaster_WasAlreadyConsumed_Call{Call: _e.mock.On("WasAlreadyConsumed", ctx, lb)} +} + +func (_c *Broadcaster_WasAlreadyConsumed_Call) Run(run func(ctx context.Context, lb log.Broadcast)) *Broadcaster_WasAlreadyConsumed_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(log.Broadcast)) + }) + return _c +} + +func (_c *Broadcaster_WasAlreadyConsumed_Call) Return(_a0 bool, _a1 error) *Broadcaster_WasAlreadyConsumed_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Broadcaster_WasAlreadyConsumed_Call) RunAndReturn(run func(context.Context, log.Broadcast) (bool, error)) *Broadcaster_WasAlreadyConsumed_Call { + _c.Call.Return(run) + return _c +} + // NewBroadcaster creates a new instance of Broadcaster. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewBroadcaster(t interface { diff --git a/core/chains/evm/log/models.go b/core/chains/evm/log/models.go index e14c45cb505..c4f0de9c5d2 100644 --- a/core/chains/evm/log/models.go +++ b/core/chains/evm/log/models.go @@ -10,8 +10,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" ) -//go:generate mockery --quiet --name Broadcast --output ./mocks/ --case=underscore --structname Broadcast --filename broadcast.go - type ( // The Broadcast type wraps a types.Log but provides additional functionality // for determining whether or not the log has been consumed and for marking @@ -100,8 +98,6 @@ func NewLogBroadcast(rawLog types.Log, evmChainID big.Int, decodedLog interface{ } } -//go:generate mockery --quiet --name AbigenContract --output ./mocks --case=underscore - type AbigenContract interface { Address() common.Address ParseLog(log types.Log) (generated.AbigenLog, error) diff --git a/core/chains/evm/log/registrations.go b/core/chains/evm/log/registrations.go index 68dd93b9d88..01104349a6f 100644 --- a/core/chains/evm/log/registrations.go +++ b/core/chains/evm/log/registrations.go @@ -11,6 +11,7 @@ import ( pkgerrors "github.com/pkg/errors" "github.com/smartcontractkit/chainlink-common/pkg/logger" + evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" @@ -215,7 +216,7 @@ func (r *registrations) isAddressRegistered(address common.Address) bool { return false } -func (r *registrations) sendLogs(ctx context.Context, logsToSend []logsOnBlock, latestHead evmtypes.Head, broadcasts []LogBroadcast, bc broadcastCreator) { +func (r *registrations) sendLogs(ctx context.Context, logsToSend []logsOnBlock, latestHead *evmtypes.Head, broadcasts []LogBroadcast, bc broadcastCreator) { broadcastsExisting := make(map[LogBroadcastAsKey]bool) for _, b := range broadcasts { broadcastsExisting[b.AsKey()] = b.Consumed @@ -387,7 +388,7 @@ type broadcastCreator interface { CreateBroadcast(ctx context.Context, blockHash common.Hash, blockNumber uint64, logIndex uint, jobID int32) error } -func (r *handler) sendLog(ctx context.Context, log types.Log, latestHead evmtypes.Head, +func (r *handler) sendLog(ctx context.Context, log types.Log, latestHead *evmtypes.Head, broadcasts map[LogBroadcastAsKey]bool, bc broadcastCreator, logger logger.Logger) { diff --git a/core/chains/evm/logpoller/disabled.go b/core/chains/evm/logpoller/disabled.go index f30837bcfee..a29dd5ea11a 100644 --- a/core/chains/evm/logpoller/disabled.go +++ b/core/chains/evm/logpoller/disabled.go @@ -118,7 +118,7 @@ func (d disabled) LogsDataWordBetween(ctx context.Context, eventSig common.Hash, return nil, ErrDisabled } -func (d disabled) FilteredLogs(_ context.Context, _ query.KeyFilter, _ query.LimitAndSort, _ string) ([]Log, error) { +func (d disabled) FilteredLogs(_ context.Context, _ []query.Expression, _ query.LimitAndSort, _ string) ([]Log, error) { return nil, ErrDisabled } diff --git a/core/chains/evm/logpoller/log_poller.go b/core/chains/evm/logpoller/log_poller.go index 459aa592c02..dd7e0c5242b 100644 --- a/core/chains/evm/logpoller/log_poller.go +++ b/core/chains/evm/logpoller/log_poller.go @@ -29,11 +29,11 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/utils/mathutil" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/config" evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" ubig "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils/big" ) -//go:generate mockery --quiet --name LogPoller --output ./mocks/ --case=underscore --structname LogPoller --filename log_poller.go type LogPoller interface { services.Service Healthy() error @@ -69,7 +69,7 @@ type LogPoller interface { LogsDataWordBetween(ctx context.Context, eventSig common.Hash, address common.Address, wordIndexMin, wordIndexMax int, wordValue common.Hash, confs evmtypes.Confirmations) ([]Log, error) // chainlink-common query filtering - FilteredLogs(ctx context.Context, filter query.KeyFilter, limitAndSort query.LimitAndSort, queryName string) ([]Log, error) + FilteredLogs(ctx context.Context, filter []query.Expression, limitAndSort query.LimitAndSort, queryName string) ([]Log, error) } type LogPollerTest interface { @@ -114,6 +114,7 @@ type logPoller struct { backfillBatchSize int64 // batch size to use when backfilling finalized logs rpcBatchSize int64 // batch size to use for fallback RPC calls made in GetBlocks logPrunePageSize int64 + clientErrors config.ClientErrors backupPollerNextBlock int64 // next block to be processed by Backup LogPoller backupPollerBlockDelay int64 // how far behind regular LogPoller should BackupLogPoller run. 0 = disabled @@ -144,6 +145,7 @@ type Opts struct { KeepFinalizedBlocksDepth int64 BackupPollerBlockDelay int64 LogPrunePageSize int64 + ClientErrors config.ClientErrors } // NewLogPoller creates a log poller. Note there is an assumption @@ -173,6 +175,7 @@ func NewLogPoller(orm ORM, ec Client, lggr logger.Logger, headTracker HeadTracke rpcBatchSize: opts.RpcBatchSize, keepFinalizedBlocksDepth: opts.KeepFinalizedBlocksDepth, logPrunePageSize: opts.LogPrunePageSize, + clientErrors: opts.ClientErrors, filters: make(map[string]Filter), filterDirty: true, // Always build Filter on first call to cache an empty filter if nothing registered yet. finalityViolated: new(atomic.Bool), @@ -595,18 +598,11 @@ func (lp *logPoller) run() { } // Otherwise this is the first poll _ever_ on a new chain. // Only safe thing to do is to start at the first finalized block. - latestBlock, latestFinalizedBlockNumber, err := lp.latestBlocks(ctx) + _, latestFinalizedBlockNumber, err := lp.latestBlocks(ctx) if err != nil { lp.lggr.Warnw("Unable to get latest for first poll", "err", err) continue } - // Do not support polling chains which don't even have finality depth worth of blocks. - // Could conceivably support this but not worth the effort. - // Need last finalized block number to be higher than 0 - if latestFinalizedBlockNumber <= 0 { - lp.lggr.Warnw("Insufficient number of blocks on chain, waiting for finality depth", "err", err, "latest", latestBlock.Number) - continue - } // Starting at the first finalized block. We do not backfill the first finalized block. start = latestFinalizedBlockNumber } else { @@ -795,8 +791,6 @@ func (lp *logPoller) blocksFromLogs(ctx context.Context, logs []types.Log, endBl return lp.GetBlocksRange(ctx, numbers) } -const jsonRpcLimitExceeded = -32005 // See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1474.md - // backfill will query FilterLogs in batches for logs in the // block range [start, end] and save them to the db. // Retries until ctx cancelled. Will return an error if cancelled @@ -808,13 +802,11 @@ func (lp *logPoller) backfill(ctx context.Context, start, end int64) error { gethLogs, err := lp.ec.FilterLogs(ctx, lp.Filter(big.NewInt(from), big.NewInt(to), nil)) if err != nil { - var rpcErr client.JsonError - if pkgerrors.As(err, &rpcErr) { - if rpcErr.Code != jsonRpcLimitExceeded { - lp.lggr.Errorw("Unable to query for logs", "err", err, "from", from, "to", to) - return err - } + if !client.IsTooManyResults(err, lp.clientErrors) { + lp.lggr.Errorw("Unable to query for logs", "err", err, "from", from, "to", to) + return err } + if batchSize == 1 { lp.lggr.Criticalw("Too many log results in a single block, failed to retrieve logs! Node may be running in a degraded state.", "err", err, "from", from, "to", to, "LogBackfillBatchSize", lp.backfillBatchSize) return err @@ -1024,8 +1016,16 @@ func (lp *logPoller) latestBlocks(ctx context.Context) (*evmtypes.Head, int64, e return nil, 0, fmt.Errorf("failed to get latest and latest finalized block from HeadTracker: %w", err) } - lp.lggr.Debugw("Latest blocks read from chain", "latest", latest.Number, "finalized", finalized.BlockNumber()) - return latest, finalized.BlockNumber(), nil + finalizedBN := finalized.BlockNumber() + // This is a dirty trick that allows LogPoller to function properly in tests where chain needs significant time to + // reach finality depth. An alternative to this one-liner is a database migration that drops restriction + // LogPollerBlock.FinalizedBlockNumber > 0 (which we actually want to keep to spot cases when FinalizedBlockNumber was simply not populated) + // and refactoring of queries that assume that restriction still holds. + if finalizedBN == 0 { + finalizedBN = 1 + } + lp.lggr.Debugw("Latest blocks read from chain", "latest", latest.Number, "finalized", finalizedBN) + return latest, finalizedBN, nil } // Find the first place where our chain and their chain have the same block, @@ -1037,7 +1037,7 @@ func (lp *logPoller) findBlockAfterLCA(ctx context.Context, current *evmtypes.He if err != nil { return nil, err } - blockAfterLCA := *current + blockAfterLCA := current // We expect reorgs up to the block after latestFinalizedBlock // We loop via parent instead of current so current always holds the LCA+1. // If the parent block number becomes < the first finalized block our reorg is too deep. @@ -1049,10 +1049,10 @@ func (lp *logPoller) findBlockAfterLCA(ctx context.Context, current *evmtypes.He } if parent.Hash == ourParentBlockHash.BlockHash { // If we do have the blockhash, return blockAfterLCA - return &blockAfterLCA, nil + return blockAfterLCA, nil } // Otherwise get a new parent and update blockAfterLCA. - blockAfterLCA = *parent + blockAfterLCA = parent parent, err = lp.ec.HeadByHash(ctx, parent.ParentHash) if err != nil { return nil, err @@ -1277,11 +1277,12 @@ func (lp *logPoller) fillRemainingBlocksFromRPC( logPollerBlocks := make(map[uint64]LogPollerBlock) for _, head := range evmBlocks { logPollerBlocks[uint64(head.Number)] = LogPollerBlock{ - EvmChainId: head.EVMChainID, - BlockHash: head.Hash, - BlockNumber: head.Number, - BlockTimestamp: head.Timestamp, - CreatedAt: head.Timestamp, + EvmChainId: head.EVMChainID, + BlockHash: head.Hash, + BlockNumber: head.Number, + BlockTimestamp: head.Timestamp, + FinalizedBlockNumber: head.Number, // always finalized; only matters if this block is returned by LatestBlock() + CreatedAt: head.Timestamp, } } return logPollerBlocks, nil @@ -1518,6 +1519,25 @@ func EvmWord(i uint64) common.Hash { return common.BytesToHash(b) } -func (lp *logPoller) FilteredLogs(ctx context.Context, queryFilter query.KeyFilter, limitAndSort query.LimitAndSort, queryName string) ([]Log, error) { +func (lp *logPoller) FilteredLogs(ctx context.Context, queryFilter []query.Expression, limitAndSort query.LimitAndSort, queryName string) ([]Log, error) { return lp.orm.FilteredLogs(ctx, queryFilter, limitAndSort, queryName) } + +// Where is a query.Where wrapper that ignores the Key and returns a slice of query.Expression rather than query.KeyFilter. +// If no expressions are provided, or an error occurs, an empty slice is returned. +func Where(expressions ...query.Expression) ([]query.Expression, error) { + filter, err := query.Where( + "", + expressions..., + ) + + if err != nil { + return []query.Expression{}, err + } + + if filter.Expressions == nil { + return []query.Expression{}, nil + } + + return filter.Expressions, nil +} diff --git a/core/chains/evm/logpoller/log_poller_internal_test.go b/core/chains/evm/logpoller/log_poller_internal_test.go index 448710b93f3..620bbf14f41 100644 --- a/core/chains/evm/logpoller/log_poller_internal_test.go +++ b/core/chains/evm/logpoller/log_poller_internal_test.go @@ -7,6 +7,7 @@ import ( "math/big" "strings" "sync" + "sync/atomic" "testing" "time" @@ -287,12 +288,14 @@ func TestLogPoller_Replay(t *testing.T) { db := pgtest.NewSqlxDB(t) orm := NewORM(chainID, db, lggr) - head := evmtypes.Head{Number: 4} + var head atomic.Pointer[evmtypes.Head] + head.Store(&evmtypes.Head{Number: 4}) + events := []common.Hash{EmitterABI.Events["Log1"].ID} log1 := types.Log{ Index: 0, BlockHash: common.Hash{}, - BlockNumber: uint64(head.Number), + BlockNumber: uint64(head.Load().Number), Topics: events, Address: addr, TxHash: common.HexToHash("0x1234"), @@ -301,8 +304,7 @@ func TestLogPoller_Replay(t *testing.T) { ec := evmclimocks.NewClient(t) ec.On("HeadByNumber", mock.Anything, mock.Anything).Return(func(context.Context, *big.Int) (*evmtypes.Head, error) { - headCopy := head - return &headCopy, nil + return head.Load(), nil }) ec.On("FilterLogs", mock.Anything, mock.Anything).Return([]types.Log{log1}, nil).Once() ec.On("ConfiguredChainID").Return(chainID, nil) @@ -318,9 +320,9 @@ func TestLogPoller_Replay(t *testing.T) { headTracker := htMocks.NewHeadTracker[*evmtypes.Head, common.Hash](t) headTracker.On("LatestAndFinalizedBlock", mock.Anything).Return(func(ctx context.Context) (*evmtypes.Head, *evmtypes.Head, error) { - headCopy := head - finalized := &evmtypes.Head{Number: headCopy.Number - lpOpts.FinalityDepth} - return &headCopy, finalized, nil + h := head.Load() + finalized := &evmtypes.Head{Number: h.Number - lpOpts.FinalityDepth} + return h, finalized, nil }) lp := NewLogPoller(orm, ec, lggr, headTracker, lpOpts) @@ -394,7 +396,7 @@ func TestLogPoller_Replay(t *testing.T) { var wg sync.WaitGroup defer func() { wg.Wait() }() ec.On("FilterLogs", mock.Anything, mock.Anything).Once().Return([]types.Log{log1}, nil).Run(func(args mock.Arguments) { - head = evmtypes.Head{Number: 4} + head.Store(&evmtypes.Head{Number: 4}) wg.Add(1) go func() { defer wg.Done() @@ -421,7 +423,7 @@ func TestLogPoller_Replay(t *testing.T) { ec.On("FilterLogs", mock.Anything, mock.Anything).Return([]types.Log{log1}, nil).Maybe() // in case task gets delayed by >= 100ms - head = evmtypes.Head{Number: 5} + head.Store(&evmtypes.Head{Number: 5}) t.Cleanup(lp.reset) servicetest.Run(t, lp) @@ -448,7 +450,7 @@ func TestLogPoller_Replay(t *testing.T) { go func() { defer close(done) - head = evmtypes.Head{Number: 4} // Restore latest block to 4, so this matches the fromBlock requested + head.Store(&evmtypes.Head{Number: 4}) // Restore latest block to 4, so this matches the fromBlock requested select { case lp.replayStart <- 4: case <-ctx.Done(): @@ -469,7 +471,7 @@ func TestLogPoller_Replay(t *testing.T) { ec.On("FilterLogs", mock.Anything, mock.Anything).Return([]types.Log{log1}, nil) t.Cleanup(lp.reset) - head = evmtypes.Head{Number: 5} // Latest block must be > lastProcessed in order for SaveAndPollLogs() to call FilterLogs() + head.Store(&evmtypes.Head{Number: 5}) // Latest block must be > lastProcessed in order for SaveAndPollLogs() to call FilterLogs() servicetest.Run(t, lp) select { @@ -482,7 +484,8 @@ func TestLogPoller_Replay(t *testing.T) { // ReplayAsync should return as soon as replayStart is received t.Run("ReplayAsync success", func(t *testing.T) { t.Cleanup(lp.reset) - head = evmtypes.Head{Number: 5} + + head.Store(&evmtypes.Head{Number: 5}) ec.On("FilterLogs", mock.Anything, mock.Anything).Return([]types.Log{log1}, nil) mockBatchCallContext(t, ec) servicetest.Run(t, lp) @@ -496,7 +499,7 @@ func TestLogPoller_Replay(t *testing.T) { ctx := testutils.Context(t) t.Cleanup(lp.reset) servicetest.Run(t, lp) - head = evmtypes.Head{Number: 4} + head.Store(&evmtypes.Head{Number: 4}) anyErr := pkgerrors.New("async error") observedLogs.TakeAll() @@ -528,7 +531,8 @@ func TestLogPoller_Replay(t *testing.T) { err := lp.orm.DeleteLogsAndBlocksAfter(ctx, 0) require.NoError(t, err) - err = lp.orm.InsertBlock(ctx, head.Hash, head.Number, head.Timestamp, head.Number) + h := head.Load() + err = lp.orm.InsertBlock(ctx, h.Hash, h.Number, h.Timestamp, h.Number) require.NoError(t, err) ec.On("FilterLogs", mock.Anything, mock.Anything).Return([]types.Log{log1}, nil) @@ -565,7 +569,8 @@ func Test_latestBlockAndFinalityDepth(t *testing.T) { }) t.Run("headTracker returns valid chain", func(t *testing.T) { headTracker := htMocks.NewHeadTracker[*evmtypes.Head, common.Hash](t) - finalizedBlock := &evmtypes.Head{Number: 2, IsFinalized: true} + finalizedBlock := &evmtypes.Head{Number: 2} + finalizedBlock.IsFinalized.Store(true) head := &evmtypes.Head{Number: 10} headTracker.On("LatestAndFinalizedBlock", mock.Anything).Return(head, finalizedBlock, nil) diff --git a/core/chains/evm/logpoller/log_poller_test.go b/core/chains/evm/logpoller/log_poller_test.go index c83efc83b39..1ab548063a7 100644 --- a/core/chains/evm/logpoller/log_poller_test.go +++ b/core/chains/evm/logpoller/log_poller_test.go @@ -26,6 +26,8 @@ import ( "go.uber.org/zap/zapcore" "github.com/smartcontractkit/chainlink-common/pkg/logger" + "github.com/smartcontractkit/chainlink-common/pkg/types/query" + "github.com/smartcontractkit/chainlink-common/pkg/types/query/primitives" commonutils "github.com/smartcontractkit/chainlink-common/pkg/utils" htMocks "github.com/smartcontractkit/chainlink/v2/common/headtracker/mocks" @@ -36,10 +38,10 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils" ubig "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils/big" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/log_emitter" - "github.com/smartcontractkit/chainlink/v2/core/internal/cltest/heavyweight" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/evmtest" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/pgtest" + "github.com/smartcontractkit/chainlink/v2/core/utils/testutils/heavyweight" ) func logRuntime(t testing.TB, start time.Time) { @@ -1342,6 +1344,7 @@ func TestLogPoller_GetBlocks_Range(t *testing.T) { require.NoError(t, err) assert.Equal(t, 1, len(blocks)) assert.Equal(t, 1, int(blocks[0].BlockNumber)) + assert.Equal(t, 1, int(blocks[0].FinalizedBlockNumber)) // LP fails to return block 2 because it hasn't been finalized yet blockNums = []uint64{2} @@ -1360,6 +1363,7 @@ func TestLogPoller_GetBlocks_Range(t *testing.T) { require.NoError(t, err) assert.Equal(t, 1, len(rpcBlocks)) assert.Equal(t, 2, int(rpcBlocks[0].BlockNumber)) + assert.Equal(t, 2, int(rpcBlocks[0].FinalizedBlockNumber)) th.Client.Commit() // commit block #5 so that #3 becomes finalized @@ -1374,6 +1378,7 @@ func TestLogPoller_GetBlocks_Range(t *testing.T) { assert.Equal(t, 2, len(rpcBlocks2)) assert.Equal(t, 1, int(rpcBlocks2[0].BlockNumber)) assert.Equal(t, 3, int(rpcBlocks2[1].BlockNumber)) + assert.Equal(t, 3, int(rpcBlocks2[1].FinalizedBlockNumber)) // after calling PollAndSaveLogs, block 3 (latest finalized block) is persisted in DB th.LogPoller.PollAndSaveLogs(testutils.Context(t), 1) @@ -1387,6 +1392,7 @@ func TestLogPoller_GetBlocks_Range(t *testing.T) { assert.Equal(t, 1, len(lpBlocks)) assert.Equal(t, rpcBlocks[0].BlockNumber, lpBlocks[0].BlockNumber) assert.Equal(t, rpcBlocks[0].BlockHash, lpBlocks[0].BlockHash) + assert.Equal(t, rpcBlocks[0].FinalizedBlockNumber, lpBlocks[0].FinalizedBlockNumber) // getBlocksRange return multiple blocks blockNums = []uint64{1, 2} @@ -1396,6 +1402,7 @@ func TestLogPoller_GetBlocks_Range(t *testing.T) { assert.NotEmpty(t, blocks[0].BlockHash) assert.Equal(t, 2, int(blocks[1].BlockNumber)) assert.NotEmpty(t, blocks[1].BlockHash) + assert.Equal(t, 2, int(blocks[1].FinalizedBlockNumber)) // getBlocksRange return blocks in requested order blockNums = []uint64{2, 1} @@ -1537,6 +1544,8 @@ type getLogErrData struct { } func TestTooManyLogResults(t *testing.T) { + t.Parallel() + ctx := testutils.Context(t) ec := evmtest.NewEthClientMockWithDefaultChain(t) lggr, obs := logger.TestObserved(t, zapcore.DebugLevel) @@ -1556,89 +1565,126 @@ func TestTooManyLogResults(t *testing.T) { lp := logpoller.NewLogPoller(o, ec, lggr, headTracker, lpOpts) expected := []int64{10, 5, 2, 1} - clientErr := client.JsonError{ + tooLargeErr := client.JsonError{ Code: -32005, Data: getLogErrData{"0x100E698", "0x100E6D4", 10000}, Message: "query returned more than 10000 results. Try with this block range [0x100E698, 0x100E6D4].", } - // Simulate currentBlock = 300 - head := &evmtypes.Head{Number: 300} - finalized := &evmtypes.Head{Number: head.Number - lpOpts.FinalityDepth} - headTracker.On("LatestAndFinalizedBlock", mock.Anything).Return(head, finalized, nil).Once() - call1 := ec.On("HeadByNumber", mock.Anything, mock.Anything).Return(func(ctx context.Context, blockNumber *big.Int) (*evmtypes.Head, error) { + var filterLogsCall *mock.Call + head := &evmtypes.Head{} + finalized := &evmtypes.Head{} + + ec.On("HeadByNumber", mock.Anything, mock.Anything).Return(func(ctx context.Context, blockNumber *big.Int) (*evmtypes.Head, error) { if blockNumber == nil { require.FailNow(t, "unexpected call to get current head") } return &evmtypes.Head{Number: blockNumber.Int64()}, nil }) - call2 := ec.On("FilterLogs", mock.Anything, mock.Anything).Return(func(ctx context.Context, fq ethereum.FilterQuery) (logs []types.Log, err error) { - if fq.BlockHash != nil { - return []types.Log{}, nil // succeed when single block requested - } - from := fq.FromBlock.Uint64() - to := fq.ToBlock.Uint64() - if to-from >= 4 { - return []types.Log{}, &clientErr // return "too many results" error if block range spans 4 or more blocks - } - return logs, err - }) + t.Run("halves size until small enough, then succeeds", func(t *testing.T) { + // Simulate currentBlock = 300 + head.Number = 300 + finalized.Number = head.Number - lpOpts.FinalityDepth + headTracker.On("LatestAndFinalizedBlock", mock.Anything).Return(head, finalized, nil).Once() - addr := testutils.NewAddress() - err := lp.RegisterFilter(ctx, logpoller.Filter{ - Name: "Integration test", - EventSigs: []common.Hash{EmitterABI.Events["Log1"].ID}, - Addresses: []common.Address{addr}, - }) - require.NoError(t, err) - lp.PollAndSaveLogs(ctx, 5) - block, err2 := o.SelectLatestBlock(ctx) - require.NoError(t, err2) - assert.Equal(t, int64(298), block.BlockNumber) - - logs := obs.FilterLevelExact(zapcore.WarnLevel).FilterMessageSnippet("halving block range batch size").FilterFieldKey("newBatchSize").All() - // Should have tried again 3 times--first reducing batch size to 10, then 5, then 2 - require.Len(t, logs, 3) - for i, s := range expected[:3] { - assert.Equal(t, s, logs[i].ContextMap()["newBatchSize"]) - } + filterLogsCall = ec.On("FilterLogs", mock.Anything, mock.Anything).Return(func(ctx context.Context, fq ethereum.FilterQuery) (logs []types.Log, err error) { + if fq.BlockHash != nil { + return []types.Log{}, nil // succeed when single block requested + } + from := fq.FromBlock.Uint64() + to := fq.ToBlock.Uint64() + if to-from >= 4 { + return []types.Log{}, tooLargeErr // return "too many results" error if block range spans 4 or more blocks + } + return logs, err + }) - obs.TakeAll() - call1.Unset() - call2.Unset() + addr := testutils.NewAddress() + err := lp.RegisterFilter(ctx, logpoller.Filter{ + Name: "Integration test", + EventSigs: []common.Hash{EmitterABI.Events["Log1"].ID}, + Addresses: []common.Address{addr}, + }) + require.NoError(t, err) + lp.PollAndSaveLogs(ctx, 5) + block, err2 := o.SelectLatestBlock(ctx) + require.NoError(t, err2) + assert.Equal(t, int64(298), block.BlockNumber) - // Now jump to block 500, but return error no matter how small the block range gets. - // Should exit the loop with a critical error instead of hanging. - head = &evmtypes.Head{Number: 500} - finalized = &evmtypes.Head{Number: head.Number - lpOpts.FinalityDepth} - headTracker.On("LatestAndFinalizedBlock", mock.Anything).Return(head, finalized, nil).Once() - call1.On("HeadByNumber", mock.Anything, mock.Anything).Return(func(ctx context.Context, blockNumber *big.Int) (*evmtypes.Head, error) { - if blockNumber == nil { - require.FailNow(t, "unexpected call to get current head") + logs := obs.FilterLevelExact(zapcore.WarnLevel).FilterMessageSnippet("halving block range batch size").FilterFieldKey("newBatchSize").All() + // Should have tried again 3 times--first reducing batch size to 10, then 5, then 2 + require.Len(t, logs, 3) + for i, s := range expected[:3] { + assert.Equal(t, s, logs[i].ContextMap()["newBatchSize"]) } - return &evmtypes.Head{Number: blockNumber.Int64()}, nil + filterLogsCall.Unset() }) - call2.On("FilterLogs", mock.Anything, mock.Anything).Return(func(ctx context.Context, fq ethereum.FilterQuery) (logs []types.Log, err error) { - if fq.BlockHash != nil { - return []types.Log{}, nil // succeed when single block requested + + t.Run("Halves size until single block, then reports critical error", func(t *testing.T) { + obs.TakeAll() + + // Now jump to block 500, but return error no matter how small the block range gets. + // Should exit the loop with a critical error instead of hanging. + head.Number = 500 + finalized.Number = head.Number - lpOpts.FinalityDepth + headTracker.On("LatestAndFinalizedBlock", mock.Anything).Return(head, finalized, nil).Once() + filterLogsCall = ec.On("FilterLogs", mock.Anything, mock.Anything).Return(func(ctx context.Context, fq ethereum.FilterQuery) (logs []types.Log, err error) { + if fq.BlockHash != nil { + return []types.Log{}, nil // succeed when single block requested + } + return []types.Log{}, tooLargeErr // return "too many results" error if block range spans 4 or more blocks + }) + + lp.PollAndSaveLogs(ctx, 298) + block, err := o.SelectLatestBlock(ctx) + if err != nil { + assert.ErrorContains(t, err, "no rows") // In case this subtest is run by itself + } else { + assert.Equal(t, int64(298), block.BlockNumber) + } + warns := obs.FilterMessageSnippet("halving block range").FilterLevelExact(zapcore.WarnLevel).All() + crit := obs.FilterMessageSnippet("failed to retrieve logs").FilterLevelExact(zapcore.DPanicLevel).All() + require.Len(t, warns, 4) + for i, s := range expected { + assert.Equal(t, s, warns[i].ContextMap()["newBatchSize"]) } - return []types.Log{}, &clientErr // return "too many results" error if block range spans 4 or more blocks + + require.Len(t, crit, 1) + assert.Contains(t, crit[0].Message, "Too many log results in a single block") + filterLogsCall.Unset() }) - lp.PollAndSaveLogs(ctx, 298) - block, err2 = o.SelectLatestBlock(ctx) - require.NoError(t, err2) - assert.Equal(t, int64(298), block.BlockNumber) - warns := obs.FilterMessageSnippet("halving block range").FilterLevelExact(zapcore.WarnLevel).All() - crit := obs.FilterMessageSnippet("failed to retrieve logs").FilterLevelExact(zapcore.DPanicLevel).All() - require.Len(t, warns, 4) - for i, s := range expected { - assert.Equal(t, s, warns[i].ContextMap()["newBatchSize"]) - } + t.Run("Unrelated error are retried without adjusting size", func(t *testing.T) { + unrelatedError := fmt.Errorf("Unrelated to the size of the request") + head.Number = 500 + finalized.Number = head.Number - lpOpts.FinalityDepth + + obs.TakeAll() + filterLogsCall = ec.On("FilterLogs", mock.Anything, mock.Anything).Return(func(ctx context.Context, fq ethereum.FilterQuery) (logs []types.Log, err error) { + if fq.BlockHash != nil { + return []types.Log{}, nil // succeed when single block requested + } + return []types.Log{}, unrelatedError // return an unrelated error that should just be retried with same size + }) + headTracker.On("LatestAndFinalizedBlock", mock.Anything).Return(head, finalized, nil).Once() - require.Len(t, crit, 1) - assert.Contains(t, crit[0].Message, "Too many log results in a single block") + lp.PollAndSaveLogs(ctx, 298) + block, err := o.SelectLatestBlock(ctx) + if err != nil { + assert.ErrorContains(t, err, "no rows") // In case this subtest is run by itself + } else { + assert.Equal(t, int64(298), block.BlockNumber) + } + crit := obs.FilterLevelExact(zapcore.DPanicLevel).All() + errors := obs.FilterLevelExact(zapcore.ErrorLevel).All() + warns := obs.FilterLevelExact(zapcore.WarnLevel).All() + assert.Len(t, crit, 0) + require.Len(t, errors, 1) + assert.Equal(t, errors[0].Message, "Unable to query for logs") + require.Len(t, warns, 1) + assert.Contains(t, warns[0].Message, "retrying later") + }) } func Test_PollAndQueryFinalizedBlocks(t *testing.T) { @@ -1728,7 +1774,7 @@ func Test_PollAndSavePersistsFinalityInBlocks(t *testing.T) { name: "setting last finalized block number to 0 if finality is too deep", useFinalityTag: false, finalityDepth: 20, - expectedFinalizedBlock: 0, + expectedFinalizedBlock: 1, }, { name: "using finality from chain", @@ -2047,3 +2093,39 @@ func TestFindLCA(t *testing.T) { }) } } + +func TestWhere(t *testing.T) { + address := common.HexToAddress("0x1234567890abcdef1234567890abcdef12345678") + eventSig := common.HexToHash("0xabcdef1234567890abcdef1234567890abcdef1234") + ts := time.Now() + + expr1 := logpoller.NewAddressFilter(address) + expr2 := logpoller.NewEventSigFilter(eventSig) + expr3 := query.Timestamp(uint64(ts.Unix()), primitives.Gte) + expr4 := logpoller.NewConfirmationsFilter(evmtypes.Confirmations(0)) + + t.Run("Valid combination of filters", func(t *testing.T) { + result, err := logpoller.Where(expr1, expr2, expr3, expr4) + assert.NoError(t, err) + assert.Equal(t, []query.Expression{expr1, expr2, expr3, expr4}, result) + }) + + t.Run("No expressions (should return empty slice)", func(t *testing.T) { + result, err := logpoller.Where() + assert.NoError(t, err) + assert.Equal(t, []query.Expression{}, result) + }) + + t.Run("Invalid boolean expression", func(t *testing.T) { + invalidExpr := query.Expression{ + BoolExpression: query.BoolExpression{ + Expressions: []query.Expression{}, + }, + } + + result, err := logpoller.Where(invalidExpr) + assert.Error(t, err) + assert.EqualError(t, err, "all boolean expressions should have at least 2 expressions") + assert.Equal(t, []query.Expression{}, result) + }) +} diff --git a/core/chains/evm/logpoller/mocks/log_poller.go b/core/chains/evm/logpoller/mocks/log_poller.go index 76442c8e941..9ae4d9767c9 100644 --- a/core/chains/evm/logpoller/mocks/log_poller.go +++ b/core/chains/evm/logpoller/mocks/log_poller.go @@ -23,6 +23,14 @@ type LogPoller struct { mock.Mock } +type LogPoller_Expecter struct { + mock *mock.Mock +} + +func (_m *LogPoller) EXPECT() *LogPoller_Expecter { + return &LogPoller_Expecter{mock: &_m.Mock} +} + // Close provides a mock function with given fields: func (_m *LogPoller) Close() error { ret := _m.Called() @@ -41,6 +49,33 @@ func (_m *LogPoller) Close() error { return r0 } +// LogPoller_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close' +type LogPoller_Close_Call struct { + *mock.Call +} + +// Close is a helper method to define mock.On call +func (_e *LogPoller_Expecter) Close() *LogPoller_Close_Call { + return &LogPoller_Close_Call{Call: _e.mock.On("Close")} +} + +func (_c *LogPoller_Close_Call) Run(run func()) *LogPoller_Close_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *LogPoller_Close_Call) Return(_a0 error) *LogPoller_Close_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *LogPoller_Close_Call) RunAndReturn(run func() error) *LogPoller_Close_Call { + _c.Call.Return(run) + return _c +} + // DeleteLogsAndBlocksAfter provides a mock function with given fields: ctx, start func (_m *LogPoller) DeleteLogsAndBlocksAfter(ctx context.Context, start int64) error { ret := _m.Called(ctx, start) @@ -59,8 +94,37 @@ func (_m *LogPoller) DeleteLogsAndBlocksAfter(ctx context.Context, start int64) return r0 } +// LogPoller_DeleteLogsAndBlocksAfter_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteLogsAndBlocksAfter' +type LogPoller_DeleteLogsAndBlocksAfter_Call struct { + *mock.Call +} + +// DeleteLogsAndBlocksAfter is a helper method to define mock.On call +// - ctx context.Context +// - start int64 +func (_e *LogPoller_Expecter) DeleteLogsAndBlocksAfter(ctx interface{}, start interface{}) *LogPoller_DeleteLogsAndBlocksAfter_Call { + return &LogPoller_DeleteLogsAndBlocksAfter_Call{Call: _e.mock.On("DeleteLogsAndBlocksAfter", ctx, start)} +} + +func (_c *LogPoller_DeleteLogsAndBlocksAfter_Call) Run(run func(ctx context.Context, start int64)) *LogPoller_DeleteLogsAndBlocksAfter_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(int64)) + }) + return _c +} + +func (_c *LogPoller_DeleteLogsAndBlocksAfter_Call) Return(_a0 error) *LogPoller_DeleteLogsAndBlocksAfter_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *LogPoller_DeleteLogsAndBlocksAfter_Call) RunAndReturn(run func(context.Context, int64) error) *LogPoller_DeleteLogsAndBlocksAfter_Call { + _c.Call.Return(run) + return _c +} + // FilteredLogs provides a mock function with given fields: ctx, filter, limitAndSort, queryName -func (_m *LogPoller) FilteredLogs(ctx context.Context, filter query.KeyFilter, limitAndSort query.LimitAndSort, queryName string) ([]logpoller.Log, error) { +func (_m *LogPoller) FilteredLogs(ctx context.Context, filter []query.Expression, limitAndSort query.LimitAndSort, queryName string) ([]logpoller.Log, error) { ret := _m.Called(ctx, filter, limitAndSort, queryName) if len(ret) == 0 { @@ -69,10 +133,10 @@ func (_m *LogPoller) FilteredLogs(ctx context.Context, filter query.KeyFilter, l var r0 []logpoller.Log var r1 error - if rf, ok := ret.Get(0).(func(context.Context, query.KeyFilter, query.LimitAndSort, string) ([]logpoller.Log, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, []query.Expression, query.LimitAndSort, string) ([]logpoller.Log, error)); ok { return rf(ctx, filter, limitAndSort, queryName) } - if rf, ok := ret.Get(0).(func(context.Context, query.KeyFilter, query.LimitAndSort, string) []logpoller.Log); ok { + if rf, ok := ret.Get(0).(func(context.Context, []query.Expression, query.LimitAndSort, string) []logpoller.Log); ok { r0 = rf(ctx, filter, limitAndSort, queryName) } else { if ret.Get(0) != nil { @@ -80,7 +144,7 @@ func (_m *LogPoller) FilteredLogs(ctx context.Context, filter query.KeyFilter, l } } - if rf, ok := ret.Get(1).(func(context.Context, query.KeyFilter, query.LimitAndSort, string) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, []query.Expression, query.LimitAndSort, string) error); ok { r1 = rf(ctx, filter, limitAndSort, queryName) } else { r1 = ret.Error(1) @@ -89,6 +153,37 @@ func (_m *LogPoller) FilteredLogs(ctx context.Context, filter query.KeyFilter, l return r0, r1 } +// LogPoller_FilteredLogs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilteredLogs' +type LogPoller_FilteredLogs_Call struct { + *mock.Call +} + +// FilteredLogs is a helper method to define mock.On call +// - ctx context.Context +// - filter []query.Expression +// - limitAndSort query.LimitAndSort +// - queryName string +func (_e *LogPoller_Expecter) FilteredLogs(ctx interface{}, filter interface{}, limitAndSort interface{}, queryName interface{}) *LogPoller_FilteredLogs_Call { + return &LogPoller_FilteredLogs_Call{Call: _e.mock.On("FilteredLogs", ctx, filter, limitAndSort, queryName)} +} + +func (_c *LogPoller_FilteredLogs_Call) Run(run func(ctx context.Context, filter []query.Expression, limitAndSort query.LimitAndSort, queryName string)) *LogPoller_FilteredLogs_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].([]query.Expression), args[2].(query.LimitAndSort), args[3].(string)) + }) + return _c +} + +func (_c *LogPoller_FilteredLogs_Call) Return(_a0 []logpoller.Log, _a1 error) *LogPoller_FilteredLogs_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *LogPoller_FilteredLogs_Call) RunAndReturn(run func(context.Context, []query.Expression, query.LimitAndSort, string) ([]logpoller.Log, error)) *LogPoller_FilteredLogs_Call { + _c.Call.Return(run) + return _c +} + // FindLCA provides a mock function with given fields: ctx func (_m *LogPoller) FindLCA(ctx context.Context) (*logpoller.LogPollerBlock, error) { ret := _m.Called(ctx) @@ -119,6 +214,34 @@ func (_m *LogPoller) FindLCA(ctx context.Context) (*logpoller.LogPollerBlock, er return r0, r1 } +// LogPoller_FindLCA_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindLCA' +type LogPoller_FindLCA_Call struct { + *mock.Call +} + +// FindLCA is a helper method to define mock.On call +// - ctx context.Context +func (_e *LogPoller_Expecter) FindLCA(ctx interface{}) *LogPoller_FindLCA_Call { + return &LogPoller_FindLCA_Call{Call: _e.mock.On("FindLCA", ctx)} +} + +func (_c *LogPoller_FindLCA_Call) Run(run func(ctx context.Context)) *LogPoller_FindLCA_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *LogPoller_FindLCA_Call) Return(_a0 *logpoller.LogPollerBlock, _a1 error) *LogPoller_FindLCA_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *LogPoller_FindLCA_Call) RunAndReturn(run func(context.Context) (*logpoller.LogPollerBlock, error)) *LogPoller_FindLCA_Call { + _c.Call.Return(run) + return _c +} + // GetBlocksRange provides a mock function with given fields: ctx, numbers func (_m *LogPoller) GetBlocksRange(ctx context.Context, numbers []uint64) ([]logpoller.LogPollerBlock, error) { ret := _m.Called(ctx, numbers) @@ -149,6 +272,35 @@ func (_m *LogPoller) GetBlocksRange(ctx context.Context, numbers []uint64) ([]lo return r0, r1 } +// LogPoller_GetBlocksRange_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetBlocksRange' +type LogPoller_GetBlocksRange_Call struct { + *mock.Call +} + +// GetBlocksRange is a helper method to define mock.On call +// - ctx context.Context +// - numbers []uint64 +func (_e *LogPoller_Expecter) GetBlocksRange(ctx interface{}, numbers interface{}) *LogPoller_GetBlocksRange_Call { + return &LogPoller_GetBlocksRange_Call{Call: _e.mock.On("GetBlocksRange", ctx, numbers)} +} + +func (_c *LogPoller_GetBlocksRange_Call) Run(run func(ctx context.Context, numbers []uint64)) *LogPoller_GetBlocksRange_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].([]uint64)) + }) + return _c +} + +func (_c *LogPoller_GetBlocksRange_Call) Return(_a0 []logpoller.LogPollerBlock, _a1 error) *LogPoller_GetBlocksRange_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *LogPoller_GetBlocksRange_Call) RunAndReturn(run func(context.Context, []uint64) ([]logpoller.LogPollerBlock, error)) *LogPoller_GetBlocksRange_Call { + _c.Call.Return(run) + return _c +} + // GetFilters provides a mock function with given fields: func (_m *LogPoller) GetFilters() map[string]logpoller.Filter { ret := _m.Called() @@ -169,6 +321,33 @@ func (_m *LogPoller) GetFilters() map[string]logpoller.Filter { return r0 } +// LogPoller_GetFilters_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetFilters' +type LogPoller_GetFilters_Call struct { + *mock.Call +} + +// GetFilters is a helper method to define mock.On call +func (_e *LogPoller_Expecter) GetFilters() *LogPoller_GetFilters_Call { + return &LogPoller_GetFilters_Call{Call: _e.mock.On("GetFilters")} +} + +func (_c *LogPoller_GetFilters_Call) Run(run func()) *LogPoller_GetFilters_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *LogPoller_GetFilters_Call) Return(_a0 map[string]logpoller.Filter) *LogPoller_GetFilters_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *LogPoller_GetFilters_Call) RunAndReturn(run func() map[string]logpoller.Filter) *LogPoller_GetFilters_Call { + _c.Call.Return(run) + return _c +} + // HasFilter provides a mock function with given fields: name func (_m *LogPoller) HasFilter(name string) bool { ret := _m.Called(name) @@ -187,6 +366,34 @@ func (_m *LogPoller) HasFilter(name string) bool { return r0 } +// LogPoller_HasFilter_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HasFilter' +type LogPoller_HasFilter_Call struct { + *mock.Call +} + +// HasFilter is a helper method to define mock.On call +// - name string +func (_e *LogPoller_Expecter) HasFilter(name interface{}) *LogPoller_HasFilter_Call { + return &LogPoller_HasFilter_Call{Call: _e.mock.On("HasFilter", name)} +} + +func (_c *LogPoller_HasFilter_Call) Run(run func(name string)) *LogPoller_HasFilter_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *LogPoller_HasFilter_Call) Return(_a0 bool) *LogPoller_HasFilter_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *LogPoller_HasFilter_Call) RunAndReturn(run func(string) bool) *LogPoller_HasFilter_Call { + _c.Call.Return(run) + return _c +} + // HealthReport provides a mock function with given fields: func (_m *LogPoller) HealthReport() map[string]error { ret := _m.Called() @@ -207,6 +414,33 @@ func (_m *LogPoller) HealthReport() map[string]error { return r0 } +// LogPoller_HealthReport_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HealthReport' +type LogPoller_HealthReport_Call struct { + *mock.Call +} + +// HealthReport is a helper method to define mock.On call +func (_e *LogPoller_Expecter) HealthReport() *LogPoller_HealthReport_Call { + return &LogPoller_HealthReport_Call{Call: _e.mock.On("HealthReport")} +} + +func (_c *LogPoller_HealthReport_Call) Run(run func()) *LogPoller_HealthReport_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *LogPoller_HealthReport_Call) Return(_a0 map[string]error) *LogPoller_HealthReport_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *LogPoller_HealthReport_Call) RunAndReturn(run func() map[string]error) *LogPoller_HealthReport_Call { + _c.Call.Return(run) + return _c +} + // Healthy provides a mock function with given fields: func (_m *LogPoller) Healthy() error { ret := _m.Called() @@ -225,6 +459,33 @@ func (_m *LogPoller) Healthy() error { return r0 } +// LogPoller_Healthy_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Healthy' +type LogPoller_Healthy_Call struct { + *mock.Call +} + +// Healthy is a helper method to define mock.On call +func (_e *LogPoller_Expecter) Healthy() *LogPoller_Healthy_Call { + return &LogPoller_Healthy_Call{Call: _e.mock.On("Healthy")} +} + +func (_c *LogPoller_Healthy_Call) Run(run func()) *LogPoller_Healthy_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *LogPoller_Healthy_Call) Return(_a0 error) *LogPoller_Healthy_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *LogPoller_Healthy_Call) RunAndReturn(run func() error) *LogPoller_Healthy_Call { + _c.Call.Return(run) + return _c +} + // IndexedLogs provides a mock function with given fields: ctx, eventSig, address, topicIndex, topicValues, confs func (_m *LogPoller) IndexedLogs(ctx context.Context, eventSig common.Hash, address common.Address, topicIndex int, topicValues []common.Hash, confs types.Confirmations) ([]logpoller.Log, error) { ret := _m.Called(ctx, eventSig, address, topicIndex, topicValues, confs) @@ -255,6 +516,39 @@ func (_m *LogPoller) IndexedLogs(ctx context.Context, eventSig common.Hash, addr return r0, r1 } +// LogPoller_IndexedLogs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IndexedLogs' +type LogPoller_IndexedLogs_Call struct { + *mock.Call +} + +// IndexedLogs is a helper method to define mock.On call +// - ctx context.Context +// - eventSig common.Hash +// - address common.Address +// - topicIndex int +// - topicValues []common.Hash +// - confs types.Confirmations +func (_e *LogPoller_Expecter) IndexedLogs(ctx interface{}, eventSig interface{}, address interface{}, topicIndex interface{}, topicValues interface{}, confs interface{}) *LogPoller_IndexedLogs_Call { + return &LogPoller_IndexedLogs_Call{Call: _e.mock.On("IndexedLogs", ctx, eventSig, address, topicIndex, topicValues, confs)} +} + +func (_c *LogPoller_IndexedLogs_Call) Run(run func(ctx context.Context, eventSig common.Hash, address common.Address, topicIndex int, topicValues []common.Hash, confs types.Confirmations)) *LogPoller_IndexedLogs_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(common.Hash), args[2].(common.Address), args[3].(int), args[4].([]common.Hash), args[5].(types.Confirmations)) + }) + return _c +} + +func (_c *LogPoller_IndexedLogs_Call) Return(_a0 []logpoller.Log, _a1 error) *LogPoller_IndexedLogs_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *LogPoller_IndexedLogs_Call) RunAndReturn(run func(context.Context, common.Hash, common.Address, int, []common.Hash, types.Confirmations) ([]logpoller.Log, error)) *LogPoller_IndexedLogs_Call { + _c.Call.Return(run) + return _c +} + // IndexedLogsByBlockRange provides a mock function with given fields: ctx, start, end, eventSig, address, topicIndex, topicValues func (_m *LogPoller) IndexedLogsByBlockRange(ctx context.Context, start int64, end int64, eventSig common.Hash, address common.Address, topicIndex int, topicValues []common.Hash) ([]logpoller.Log, error) { ret := _m.Called(ctx, start, end, eventSig, address, topicIndex, topicValues) @@ -285,6 +579,40 @@ func (_m *LogPoller) IndexedLogsByBlockRange(ctx context.Context, start int64, e return r0, r1 } +// LogPoller_IndexedLogsByBlockRange_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IndexedLogsByBlockRange' +type LogPoller_IndexedLogsByBlockRange_Call struct { + *mock.Call +} + +// IndexedLogsByBlockRange is a helper method to define mock.On call +// - ctx context.Context +// - start int64 +// - end int64 +// - eventSig common.Hash +// - address common.Address +// - topicIndex int +// - topicValues []common.Hash +func (_e *LogPoller_Expecter) IndexedLogsByBlockRange(ctx interface{}, start interface{}, end interface{}, eventSig interface{}, address interface{}, topicIndex interface{}, topicValues interface{}) *LogPoller_IndexedLogsByBlockRange_Call { + return &LogPoller_IndexedLogsByBlockRange_Call{Call: _e.mock.On("IndexedLogsByBlockRange", ctx, start, end, eventSig, address, topicIndex, topicValues)} +} + +func (_c *LogPoller_IndexedLogsByBlockRange_Call) Run(run func(ctx context.Context, start int64, end int64, eventSig common.Hash, address common.Address, topicIndex int, topicValues []common.Hash)) *LogPoller_IndexedLogsByBlockRange_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(int64), args[2].(int64), args[3].(common.Hash), args[4].(common.Address), args[5].(int), args[6].([]common.Hash)) + }) + return _c +} + +func (_c *LogPoller_IndexedLogsByBlockRange_Call) Return(_a0 []logpoller.Log, _a1 error) *LogPoller_IndexedLogsByBlockRange_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *LogPoller_IndexedLogsByBlockRange_Call) RunAndReturn(run func(context.Context, int64, int64, common.Hash, common.Address, int, []common.Hash) ([]logpoller.Log, error)) *LogPoller_IndexedLogsByBlockRange_Call { + _c.Call.Return(run) + return _c +} + // IndexedLogsByTxHash provides a mock function with given fields: ctx, eventSig, address, txHash func (_m *LogPoller) IndexedLogsByTxHash(ctx context.Context, eventSig common.Hash, address common.Address, txHash common.Hash) ([]logpoller.Log, error) { ret := _m.Called(ctx, eventSig, address, txHash) @@ -315,6 +643,37 @@ func (_m *LogPoller) IndexedLogsByTxHash(ctx context.Context, eventSig common.Ha return r0, r1 } +// LogPoller_IndexedLogsByTxHash_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IndexedLogsByTxHash' +type LogPoller_IndexedLogsByTxHash_Call struct { + *mock.Call +} + +// IndexedLogsByTxHash is a helper method to define mock.On call +// - ctx context.Context +// - eventSig common.Hash +// - address common.Address +// - txHash common.Hash +func (_e *LogPoller_Expecter) IndexedLogsByTxHash(ctx interface{}, eventSig interface{}, address interface{}, txHash interface{}) *LogPoller_IndexedLogsByTxHash_Call { + return &LogPoller_IndexedLogsByTxHash_Call{Call: _e.mock.On("IndexedLogsByTxHash", ctx, eventSig, address, txHash)} +} + +func (_c *LogPoller_IndexedLogsByTxHash_Call) Run(run func(ctx context.Context, eventSig common.Hash, address common.Address, txHash common.Hash)) *LogPoller_IndexedLogsByTxHash_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(common.Hash), args[2].(common.Address), args[3].(common.Hash)) + }) + return _c +} + +func (_c *LogPoller_IndexedLogsByTxHash_Call) Return(_a0 []logpoller.Log, _a1 error) *LogPoller_IndexedLogsByTxHash_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *LogPoller_IndexedLogsByTxHash_Call) RunAndReturn(run func(context.Context, common.Hash, common.Address, common.Hash) ([]logpoller.Log, error)) *LogPoller_IndexedLogsByTxHash_Call { + _c.Call.Return(run) + return _c +} + // IndexedLogsCreatedAfter provides a mock function with given fields: ctx, eventSig, address, topicIndex, topicValues, after, confs func (_m *LogPoller) IndexedLogsCreatedAfter(ctx context.Context, eventSig common.Hash, address common.Address, topicIndex int, topicValues []common.Hash, after time.Time, confs types.Confirmations) ([]logpoller.Log, error) { ret := _m.Called(ctx, eventSig, address, topicIndex, topicValues, after, confs) @@ -345,6 +704,40 @@ func (_m *LogPoller) IndexedLogsCreatedAfter(ctx context.Context, eventSig commo return r0, r1 } +// LogPoller_IndexedLogsCreatedAfter_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IndexedLogsCreatedAfter' +type LogPoller_IndexedLogsCreatedAfter_Call struct { + *mock.Call +} + +// IndexedLogsCreatedAfter is a helper method to define mock.On call +// - ctx context.Context +// - eventSig common.Hash +// - address common.Address +// - topicIndex int +// - topicValues []common.Hash +// - after time.Time +// - confs types.Confirmations +func (_e *LogPoller_Expecter) IndexedLogsCreatedAfter(ctx interface{}, eventSig interface{}, address interface{}, topicIndex interface{}, topicValues interface{}, after interface{}, confs interface{}) *LogPoller_IndexedLogsCreatedAfter_Call { + return &LogPoller_IndexedLogsCreatedAfter_Call{Call: _e.mock.On("IndexedLogsCreatedAfter", ctx, eventSig, address, topicIndex, topicValues, after, confs)} +} + +func (_c *LogPoller_IndexedLogsCreatedAfter_Call) Run(run func(ctx context.Context, eventSig common.Hash, address common.Address, topicIndex int, topicValues []common.Hash, after time.Time, confs types.Confirmations)) *LogPoller_IndexedLogsCreatedAfter_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(common.Hash), args[2].(common.Address), args[3].(int), args[4].([]common.Hash), args[5].(time.Time), args[6].(types.Confirmations)) + }) + return _c +} + +func (_c *LogPoller_IndexedLogsCreatedAfter_Call) Return(_a0 []logpoller.Log, _a1 error) *LogPoller_IndexedLogsCreatedAfter_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *LogPoller_IndexedLogsCreatedAfter_Call) RunAndReturn(run func(context.Context, common.Hash, common.Address, int, []common.Hash, time.Time, types.Confirmations) ([]logpoller.Log, error)) *LogPoller_IndexedLogsCreatedAfter_Call { + _c.Call.Return(run) + return _c +} + // IndexedLogsTopicGreaterThan provides a mock function with given fields: ctx, eventSig, address, topicIndex, topicValueMin, confs func (_m *LogPoller) IndexedLogsTopicGreaterThan(ctx context.Context, eventSig common.Hash, address common.Address, topicIndex int, topicValueMin common.Hash, confs types.Confirmations) ([]logpoller.Log, error) { ret := _m.Called(ctx, eventSig, address, topicIndex, topicValueMin, confs) @@ -375,6 +768,39 @@ func (_m *LogPoller) IndexedLogsTopicGreaterThan(ctx context.Context, eventSig c return r0, r1 } +// LogPoller_IndexedLogsTopicGreaterThan_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IndexedLogsTopicGreaterThan' +type LogPoller_IndexedLogsTopicGreaterThan_Call struct { + *mock.Call +} + +// IndexedLogsTopicGreaterThan is a helper method to define mock.On call +// - ctx context.Context +// - eventSig common.Hash +// - address common.Address +// - topicIndex int +// - topicValueMin common.Hash +// - confs types.Confirmations +func (_e *LogPoller_Expecter) IndexedLogsTopicGreaterThan(ctx interface{}, eventSig interface{}, address interface{}, topicIndex interface{}, topicValueMin interface{}, confs interface{}) *LogPoller_IndexedLogsTopicGreaterThan_Call { + return &LogPoller_IndexedLogsTopicGreaterThan_Call{Call: _e.mock.On("IndexedLogsTopicGreaterThan", ctx, eventSig, address, topicIndex, topicValueMin, confs)} +} + +func (_c *LogPoller_IndexedLogsTopicGreaterThan_Call) Run(run func(ctx context.Context, eventSig common.Hash, address common.Address, topicIndex int, topicValueMin common.Hash, confs types.Confirmations)) *LogPoller_IndexedLogsTopicGreaterThan_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(common.Hash), args[2].(common.Address), args[3].(int), args[4].(common.Hash), args[5].(types.Confirmations)) + }) + return _c +} + +func (_c *LogPoller_IndexedLogsTopicGreaterThan_Call) Return(_a0 []logpoller.Log, _a1 error) *LogPoller_IndexedLogsTopicGreaterThan_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *LogPoller_IndexedLogsTopicGreaterThan_Call) RunAndReturn(run func(context.Context, common.Hash, common.Address, int, common.Hash, types.Confirmations) ([]logpoller.Log, error)) *LogPoller_IndexedLogsTopicGreaterThan_Call { + _c.Call.Return(run) + return _c +} + // IndexedLogsTopicRange provides a mock function with given fields: ctx, eventSig, address, topicIndex, topicValueMin, topicValueMax, confs func (_m *LogPoller) IndexedLogsTopicRange(ctx context.Context, eventSig common.Hash, address common.Address, topicIndex int, topicValueMin common.Hash, topicValueMax common.Hash, confs types.Confirmations) ([]logpoller.Log, error) { ret := _m.Called(ctx, eventSig, address, topicIndex, topicValueMin, topicValueMax, confs) @@ -405,6 +831,40 @@ func (_m *LogPoller) IndexedLogsTopicRange(ctx context.Context, eventSig common. return r0, r1 } +// LogPoller_IndexedLogsTopicRange_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IndexedLogsTopicRange' +type LogPoller_IndexedLogsTopicRange_Call struct { + *mock.Call +} + +// IndexedLogsTopicRange is a helper method to define mock.On call +// - ctx context.Context +// - eventSig common.Hash +// - address common.Address +// - topicIndex int +// - topicValueMin common.Hash +// - topicValueMax common.Hash +// - confs types.Confirmations +func (_e *LogPoller_Expecter) IndexedLogsTopicRange(ctx interface{}, eventSig interface{}, address interface{}, topicIndex interface{}, topicValueMin interface{}, topicValueMax interface{}, confs interface{}) *LogPoller_IndexedLogsTopicRange_Call { + return &LogPoller_IndexedLogsTopicRange_Call{Call: _e.mock.On("IndexedLogsTopicRange", ctx, eventSig, address, topicIndex, topicValueMin, topicValueMax, confs)} +} + +func (_c *LogPoller_IndexedLogsTopicRange_Call) Run(run func(ctx context.Context, eventSig common.Hash, address common.Address, topicIndex int, topicValueMin common.Hash, topicValueMax common.Hash, confs types.Confirmations)) *LogPoller_IndexedLogsTopicRange_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(common.Hash), args[2].(common.Address), args[3].(int), args[4].(common.Hash), args[5].(common.Hash), args[6].(types.Confirmations)) + }) + return _c +} + +func (_c *LogPoller_IndexedLogsTopicRange_Call) Return(_a0 []logpoller.Log, _a1 error) *LogPoller_IndexedLogsTopicRange_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *LogPoller_IndexedLogsTopicRange_Call) RunAndReturn(run func(context.Context, common.Hash, common.Address, int, common.Hash, common.Hash, types.Confirmations) ([]logpoller.Log, error)) *LogPoller_IndexedLogsTopicRange_Call { + _c.Call.Return(run) + return _c +} + // IndexedLogsWithSigsExcluding provides a mock function with given fields: ctx, address, eventSigA, eventSigB, topicIndex, fromBlock, toBlock, confs func (_m *LogPoller) IndexedLogsWithSigsExcluding(ctx context.Context, address common.Address, eventSigA common.Hash, eventSigB common.Hash, topicIndex int, fromBlock int64, toBlock int64, confs types.Confirmations) ([]logpoller.Log, error) { ret := _m.Called(ctx, address, eventSigA, eventSigB, topicIndex, fromBlock, toBlock, confs) @@ -435,6 +895,41 @@ func (_m *LogPoller) IndexedLogsWithSigsExcluding(ctx context.Context, address c return r0, r1 } +// LogPoller_IndexedLogsWithSigsExcluding_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IndexedLogsWithSigsExcluding' +type LogPoller_IndexedLogsWithSigsExcluding_Call struct { + *mock.Call +} + +// IndexedLogsWithSigsExcluding is a helper method to define mock.On call +// - ctx context.Context +// - address common.Address +// - eventSigA common.Hash +// - eventSigB common.Hash +// - topicIndex int +// - fromBlock int64 +// - toBlock int64 +// - confs types.Confirmations +func (_e *LogPoller_Expecter) IndexedLogsWithSigsExcluding(ctx interface{}, address interface{}, eventSigA interface{}, eventSigB interface{}, topicIndex interface{}, fromBlock interface{}, toBlock interface{}, confs interface{}) *LogPoller_IndexedLogsWithSigsExcluding_Call { + return &LogPoller_IndexedLogsWithSigsExcluding_Call{Call: _e.mock.On("IndexedLogsWithSigsExcluding", ctx, address, eventSigA, eventSigB, topicIndex, fromBlock, toBlock, confs)} +} + +func (_c *LogPoller_IndexedLogsWithSigsExcluding_Call) Run(run func(ctx context.Context, address common.Address, eventSigA common.Hash, eventSigB common.Hash, topicIndex int, fromBlock int64, toBlock int64, confs types.Confirmations)) *LogPoller_IndexedLogsWithSigsExcluding_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(common.Address), args[2].(common.Hash), args[3].(common.Hash), args[4].(int), args[5].(int64), args[6].(int64), args[7].(types.Confirmations)) + }) + return _c +} + +func (_c *LogPoller_IndexedLogsWithSigsExcluding_Call) Return(_a0 []logpoller.Log, _a1 error) *LogPoller_IndexedLogsWithSigsExcluding_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *LogPoller_IndexedLogsWithSigsExcluding_Call) RunAndReturn(run func(context.Context, common.Address, common.Hash, common.Hash, int, int64, int64, types.Confirmations) ([]logpoller.Log, error)) *LogPoller_IndexedLogsWithSigsExcluding_Call { + _c.Call.Return(run) + return _c +} + // LatestBlock provides a mock function with given fields: ctx func (_m *LogPoller) LatestBlock(ctx context.Context) (logpoller.LogPollerBlock, error) { ret := _m.Called(ctx) @@ -463,6 +958,34 @@ func (_m *LogPoller) LatestBlock(ctx context.Context) (logpoller.LogPollerBlock, return r0, r1 } +// LogPoller_LatestBlock_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LatestBlock' +type LogPoller_LatestBlock_Call struct { + *mock.Call +} + +// LatestBlock is a helper method to define mock.On call +// - ctx context.Context +func (_e *LogPoller_Expecter) LatestBlock(ctx interface{}) *LogPoller_LatestBlock_Call { + return &LogPoller_LatestBlock_Call{Call: _e.mock.On("LatestBlock", ctx)} +} + +func (_c *LogPoller_LatestBlock_Call) Run(run func(ctx context.Context)) *LogPoller_LatestBlock_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *LogPoller_LatestBlock_Call) Return(_a0 logpoller.LogPollerBlock, _a1 error) *LogPoller_LatestBlock_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *LogPoller_LatestBlock_Call) RunAndReturn(run func(context.Context) (logpoller.LogPollerBlock, error)) *LogPoller_LatestBlock_Call { + _c.Call.Return(run) + return _c +} + // LatestBlockByEventSigsAddrsWithConfs provides a mock function with given fields: ctx, fromBlock, eventSigs, addresses, confs func (_m *LogPoller) LatestBlockByEventSigsAddrsWithConfs(ctx context.Context, fromBlock int64, eventSigs []common.Hash, addresses []common.Address, confs types.Confirmations) (int64, error) { ret := _m.Called(ctx, fromBlock, eventSigs, addresses, confs) @@ -491,6 +1014,38 @@ func (_m *LogPoller) LatestBlockByEventSigsAddrsWithConfs(ctx context.Context, f return r0, r1 } +// LogPoller_LatestBlockByEventSigsAddrsWithConfs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LatestBlockByEventSigsAddrsWithConfs' +type LogPoller_LatestBlockByEventSigsAddrsWithConfs_Call struct { + *mock.Call +} + +// LatestBlockByEventSigsAddrsWithConfs is a helper method to define mock.On call +// - ctx context.Context +// - fromBlock int64 +// - eventSigs []common.Hash +// - addresses []common.Address +// - confs types.Confirmations +func (_e *LogPoller_Expecter) LatestBlockByEventSigsAddrsWithConfs(ctx interface{}, fromBlock interface{}, eventSigs interface{}, addresses interface{}, confs interface{}) *LogPoller_LatestBlockByEventSigsAddrsWithConfs_Call { + return &LogPoller_LatestBlockByEventSigsAddrsWithConfs_Call{Call: _e.mock.On("LatestBlockByEventSigsAddrsWithConfs", ctx, fromBlock, eventSigs, addresses, confs)} +} + +func (_c *LogPoller_LatestBlockByEventSigsAddrsWithConfs_Call) Run(run func(ctx context.Context, fromBlock int64, eventSigs []common.Hash, addresses []common.Address, confs types.Confirmations)) *LogPoller_LatestBlockByEventSigsAddrsWithConfs_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(int64), args[2].([]common.Hash), args[3].([]common.Address), args[4].(types.Confirmations)) + }) + return _c +} + +func (_c *LogPoller_LatestBlockByEventSigsAddrsWithConfs_Call) Return(_a0 int64, _a1 error) *LogPoller_LatestBlockByEventSigsAddrsWithConfs_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *LogPoller_LatestBlockByEventSigsAddrsWithConfs_Call) RunAndReturn(run func(context.Context, int64, []common.Hash, []common.Address, types.Confirmations) (int64, error)) *LogPoller_LatestBlockByEventSigsAddrsWithConfs_Call { + _c.Call.Return(run) + return _c +} + // LatestLogByEventSigWithConfs provides a mock function with given fields: ctx, eventSig, address, confs func (_m *LogPoller) LatestLogByEventSigWithConfs(ctx context.Context, eventSig common.Hash, address common.Address, confs types.Confirmations) (*logpoller.Log, error) { ret := _m.Called(ctx, eventSig, address, confs) @@ -521,6 +1076,37 @@ func (_m *LogPoller) LatestLogByEventSigWithConfs(ctx context.Context, eventSig return r0, r1 } +// LogPoller_LatestLogByEventSigWithConfs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LatestLogByEventSigWithConfs' +type LogPoller_LatestLogByEventSigWithConfs_Call struct { + *mock.Call +} + +// LatestLogByEventSigWithConfs is a helper method to define mock.On call +// - ctx context.Context +// - eventSig common.Hash +// - address common.Address +// - confs types.Confirmations +func (_e *LogPoller_Expecter) LatestLogByEventSigWithConfs(ctx interface{}, eventSig interface{}, address interface{}, confs interface{}) *LogPoller_LatestLogByEventSigWithConfs_Call { + return &LogPoller_LatestLogByEventSigWithConfs_Call{Call: _e.mock.On("LatestLogByEventSigWithConfs", ctx, eventSig, address, confs)} +} + +func (_c *LogPoller_LatestLogByEventSigWithConfs_Call) Run(run func(ctx context.Context, eventSig common.Hash, address common.Address, confs types.Confirmations)) *LogPoller_LatestLogByEventSigWithConfs_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(common.Hash), args[2].(common.Address), args[3].(types.Confirmations)) + }) + return _c +} + +func (_c *LogPoller_LatestLogByEventSigWithConfs_Call) Return(_a0 *logpoller.Log, _a1 error) *LogPoller_LatestLogByEventSigWithConfs_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *LogPoller_LatestLogByEventSigWithConfs_Call) RunAndReturn(run func(context.Context, common.Hash, common.Address, types.Confirmations) (*logpoller.Log, error)) *LogPoller_LatestLogByEventSigWithConfs_Call { + _c.Call.Return(run) + return _c +} + // LatestLogEventSigsAddrsWithConfs provides a mock function with given fields: ctx, fromBlock, eventSigs, addresses, confs func (_m *LogPoller) LatestLogEventSigsAddrsWithConfs(ctx context.Context, fromBlock int64, eventSigs []common.Hash, addresses []common.Address, confs types.Confirmations) ([]logpoller.Log, error) { ret := _m.Called(ctx, fromBlock, eventSigs, addresses, confs) @@ -551,6 +1137,38 @@ func (_m *LogPoller) LatestLogEventSigsAddrsWithConfs(ctx context.Context, fromB return r0, r1 } +// LogPoller_LatestLogEventSigsAddrsWithConfs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LatestLogEventSigsAddrsWithConfs' +type LogPoller_LatestLogEventSigsAddrsWithConfs_Call struct { + *mock.Call +} + +// LatestLogEventSigsAddrsWithConfs is a helper method to define mock.On call +// - ctx context.Context +// - fromBlock int64 +// - eventSigs []common.Hash +// - addresses []common.Address +// - confs types.Confirmations +func (_e *LogPoller_Expecter) LatestLogEventSigsAddrsWithConfs(ctx interface{}, fromBlock interface{}, eventSigs interface{}, addresses interface{}, confs interface{}) *LogPoller_LatestLogEventSigsAddrsWithConfs_Call { + return &LogPoller_LatestLogEventSigsAddrsWithConfs_Call{Call: _e.mock.On("LatestLogEventSigsAddrsWithConfs", ctx, fromBlock, eventSigs, addresses, confs)} +} + +func (_c *LogPoller_LatestLogEventSigsAddrsWithConfs_Call) Run(run func(ctx context.Context, fromBlock int64, eventSigs []common.Hash, addresses []common.Address, confs types.Confirmations)) *LogPoller_LatestLogEventSigsAddrsWithConfs_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(int64), args[2].([]common.Hash), args[3].([]common.Address), args[4].(types.Confirmations)) + }) + return _c +} + +func (_c *LogPoller_LatestLogEventSigsAddrsWithConfs_Call) Return(_a0 []logpoller.Log, _a1 error) *LogPoller_LatestLogEventSigsAddrsWithConfs_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *LogPoller_LatestLogEventSigsAddrsWithConfs_Call) RunAndReturn(run func(context.Context, int64, []common.Hash, []common.Address, types.Confirmations) ([]logpoller.Log, error)) *LogPoller_LatestLogEventSigsAddrsWithConfs_Call { + _c.Call.Return(run) + return _c +} + // Logs provides a mock function with given fields: ctx, start, end, eventSig, address func (_m *LogPoller) Logs(ctx context.Context, start int64, end int64, eventSig common.Hash, address common.Address) ([]logpoller.Log, error) { ret := _m.Called(ctx, start, end, eventSig, address) @@ -581,6 +1199,38 @@ func (_m *LogPoller) Logs(ctx context.Context, start int64, end int64, eventSig return r0, r1 } +// LogPoller_Logs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Logs' +type LogPoller_Logs_Call struct { + *mock.Call +} + +// Logs is a helper method to define mock.On call +// - ctx context.Context +// - start int64 +// - end int64 +// - eventSig common.Hash +// - address common.Address +func (_e *LogPoller_Expecter) Logs(ctx interface{}, start interface{}, end interface{}, eventSig interface{}, address interface{}) *LogPoller_Logs_Call { + return &LogPoller_Logs_Call{Call: _e.mock.On("Logs", ctx, start, end, eventSig, address)} +} + +func (_c *LogPoller_Logs_Call) Run(run func(ctx context.Context, start int64, end int64, eventSig common.Hash, address common.Address)) *LogPoller_Logs_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(int64), args[2].(int64), args[3].(common.Hash), args[4].(common.Address)) + }) + return _c +} + +func (_c *LogPoller_Logs_Call) Return(_a0 []logpoller.Log, _a1 error) *LogPoller_Logs_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *LogPoller_Logs_Call) RunAndReturn(run func(context.Context, int64, int64, common.Hash, common.Address) ([]logpoller.Log, error)) *LogPoller_Logs_Call { + _c.Call.Return(run) + return _c +} + // LogsCreatedAfter provides a mock function with given fields: ctx, eventSig, address, _a3, confs func (_m *LogPoller) LogsCreatedAfter(ctx context.Context, eventSig common.Hash, address common.Address, _a3 time.Time, confs types.Confirmations) ([]logpoller.Log, error) { ret := _m.Called(ctx, eventSig, address, _a3, confs) @@ -611,6 +1261,38 @@ func (_m *LogPoller) LogsCreatedAfter(ctx context.Context, eventSig common.Hash, return r0, r1 } +// LogPoller_LogsCreatedAfter_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LogsCreatedAfter' +type LogPoller_LogsCreatedAfter_Call struct { + *mock.Call +} + +// LogsCreatedAfter is a helper method to define mock.On call +// - ctx context.Context +// - eventSig common.Hash +// - address common.Address +// - _a3 time.Time +// - confs types.Confirmations +func (_e *LogPoller_Expecter) LogsCreatedAfter(ctx interface{}, eventSig interface{}, address interface{}, _a3 interface{}, confs interface{}) *LogPoller_LogsCreatedAfter_Call { + return &LogPoller_LogsCreatedAfter_Call{Call: _e.mock.On("LogsCreatedAfter", ctx, eventSig, address, _a3, confs)} +} + +func (_c *LogPoller_LogsCreatedAfter_Call) Run(run func(ctx context.Context, eventSig common.Hash, address common.Address, _a3 time.Time, confs types.Confirmations)) *LogPoller_LogsCreatedAfter_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(common.Hash), args[2].(common.Address), args[3].(time.Time), args[4].(types.Confirmations)) + }) + return _c +} + +func (_c *LogPoller_LogsCreatedAfter_Call) Return(_a0 []logpoller.Log, _a1 error) *LogPoller_LogsCreatedAfter_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *LogPoller_LogsCreatedAfter_Call) RunAndReturn(run func(context.Context, common.Hash, common.Address, time.Time, types.Confirmations) ([]logpoller.Log, error)) *LogPoller_LogsCreatedAfter_Call { + _c.Call.Return(run) + return _c +} + // LogsDataWordBetween provides a mock function with given fields: ctx, eventSig, address, wordIndexMin, wordIndexMax, wordValue, confs func (_m *LogPoller) LogsDataWordBetween(ctx context.Context, eventSig common.Hash, address common.Address, wordIndexMin int, wordIndexMax int, wordValue common.Hash, confs types.Confirmations) ([]logpoller.Log, error) { ret := _m.Called(ctx, eventSig, address, wordIndexMin, wordIndexMax, wordValue, confs) @@ -641,6 +1323,40 @@ func (_m *LogPoller) LogsDataWordBetween(ctx context.Context, eventSig common.Ha return r0, r1 } +// LogPoller_LogsDataWordBetween_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LogsDataWordBetween' +type LogPoller_LogsDataWordBetween_Call struct { + *mock.Call +} + +// LogsDataWordBetween is a helper method to define mock.On call +// - ctx context.Context +// - eventSig common.Hash +// - address common.Address +// - wordIndexMin int +// - wordIndexMax int +// - wordValue common.Hash +// - confs types.Confirmations +func (_e *LogPoller_Expecter) LogsDataWordBetween(ctx interface{}, eventSig interface{}, address interface{}, wordIndexMin interface{}, wordIndexMax interface{}, wordValue interface{}, confs interface{}) *LogPoller_LogsDataWordBetween_Call { + return &LogPoller_LogsDataWordBetween_Call{Call: _e.mock.On("LogsDataWordBetween", ctx, eventSig, address, wordIndexMin, wordIndexMax, wordValue, confs)} +} + +func (_c *LogPoller_LogsDataWordBetween_Call) Run(run func(ctx context.Context, eventSig common.Hash, address common.Address, wordIndexMin int, wordIndexMax int, wordValue common.Hash, confs types.Confirmations)) *LogPoller_LogsDataWordBetween_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(common.Hash), args[2].(common.Address), args[3].(int), args[4].(int), args[5].(common.Hash), args[6].(types.Confirmations)) + }) + return _c +} + +func (_c *LogPoller_LogsDataWordBetween_Call) Return(_a0 []logpoller.Log, _a1 error) *LogPoller_LogsDataWordBetween_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *LogPoller_LogsDataWordBetween_Call) RunAndReturn(run func(context.Context, common.Hash, common.Address, int, int, common.Hash, types.Confirmations) ([]logpoller.Log, error)) *LogPoller_LogsDataWordBetween_Call { + _c.Call.Return(run) + return _c +} + // LogsDataWordGreaterThan provides a mock function with given fields: ctx, eventSig, address, wordIndex, wordValueMin, confs func (_m *LogPoller) LogsDataWordGreaterThan(ctx context.Context, eventSig common.Hash, address common.Address, wordIndex int, wordValueMin common.Hash, confs types.Confirmations) ([]logpoller.Log, error) { ret := _m.Called(ctx, eventSig, address, wordIndex, wordValueMin, confs) @@ -671,6 +1387,39 @@ func (_m *LogPoller) LogsDataWordGreaterThan(ctx context.Context, eventSig commo return r0, r1 } +// LogPoller_LogsDataWordGreaterThan_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LogsDataWordGreaterThan' +type LogPoller_LogsDataWordGreaterThan_Call struct { + *mock.Call +} + +// LogsDataWordGreaterThan is a helper method to define mock.On call +// - ctx context.Context +// - eventSig common.Hash +// - address common.Address +// - wordIndex int +// - wordValueMin common.Hash +// - confs types.Confirmations +func (_e *LogPoller_Expecter) LogsDataWordGreaterThan(ctx interface{}, eventSig interface{}, address interface{}, wordIndex interface{}, wordValueMin interface{}, confs interface{}) *LogPoller_LogsDataWordGreaterThan_Call { + return &LogPoller_LogsDataWordGreaterThan_Call{Call: _e.mock.On("LogsDataWordGreaterThan", ctx, eventSig, address, wordIndex, wordValueMin, confs)} +} + +func (_c *LogPoller_LogsDataWordGreaterThan_Call) Run(run func(ctx context.Context, eventSig common.Hash, address common.Address, wordIndex int, wordValueMin common.Hash, confs types.Confirmations)) *LogPoller_LogsDataWordGreaterThan_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(common.Hash), args[2].(common.Address), args[3].(int), args[4].(common.Hash), args[5].(types.Confirmations)) + }) + return _c +} + +func (_c *LogPoller_LogsDataWordGreaterThan_Call) Return(_a0 []logpoller.Log, _a1 error) *LogPoller_LogsDataWordGreaterThan_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *LogPoller_LogsDataWordGreaterThan_Call) RunAndReturn(run func(context.Context, common.Hash, common.Address, int, common.Hash, types.Confirmations) ([]logpoller.Log, error)) *LogPoller_LogsDataWordGreaterThan_Call { + _c.Call.Return(run) + return _c +} + // LogsDataWordRange provides a mock function with given fields: ctx, eventSig, address, wordIndex, wordValueMin, wordValueMax, confs func (_m *LogPoller) LogsDataWordRange(ctx context.Context, eventSig common.Hash, address common.Address, wordIndex int, wordValueMin common.Hash, wordValueMax common.Hash, confs types.Confirmations) ([]logpoller.Log, error) { ret := _m.Called(ctx, eventSig, address, wordIndex, wordValueMin, wordValueMax, confs) @@ -701,6 +1450,40 @@ func (_m *LogPoller) LogsDataWordRange(ctx context.Context, eventSig common.Hash return r0, r1 } +// LogPoller_LogsDataWordRange_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LogsDataWordRange' +type LogPoller_LogsDataWordRange_Call struct { + *mock.Call +} + +// LogsDataWordRange is a helper method to define mock.On call +// - ctx context.Context +// - eventSig common.Hash +// - address common.Address +// - wordIndex int +// - wordValueMin common.Hash +// - wordValueMax common.Hash +// - confs types.Confirmations +func (_e *LogPoller_Expecter) LogsDataWordRange(ctx interface{}, eventSig interface{}, address interface{}, wordIndex interface{}, wordValueMin interface{}, wordValueMax interface{}, confs interface{}) *LogPoller_LogsDataWordRange_Call { + return &LogPoller_LogsDataWordRange_Call{Call: _e.mock.On("LogsDataWordRange", ctx, eventSig, address, wordIndex, wordValueMin, wordValueMax, confs)} +} + +func (_c *LogPoller_LogsDataWordRange_Call) Run(run func(ctx context.Context, eventSig common.Hash, address common.Address, wordIndex int, wordValueMin common.Hash, wordValueMax common.Hash, confs types.Confirmations)) *LogPoller_LogsDataWordRange_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(common.Hash), args[2].(common.Address), args[3].(int), args[4].(common.Hash), args[5].(common.Hash), args[6].(types.Confirmations)) + }) + return _c +} + +func (_c *LogPoller_LogsDataWordRange_Call) Return(_a0 []logpoller.Log, _a1 error) *LogPoller_LogsDataWordRange_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *LogPoller_LogsDataWordRange_Call) RunAndReturn(run func(context.Context, common.Hash, common.Address, int, common.Hash, common.Hash, types.Confirmations) ([]logpoller.Log, error)) *LogPoller_LogsDataWordRange_Call { + _c.Call.Return(run) + return _c +} + // LogsWithSigs provides a mock function with given fields: ctx, start, end, eventSigs, address func (_m *LogPoller) LogsWithSigs(ctx context.Context, start int64, end int64, eventSigs []common.Hash, address common.Address) ([]logpoller.Log, error) { ret := _m.Called(ctx, start, end, eventSigs, address) @@ -731,6 +1514,38 @@ func (_m *LogPoller) LogsWithSigs(ctx context.Context, start int64, end int64, e return r0, r1 } +// LogPoller_LogsWithSigs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LogsWithSigs' +type LogPoller_LogsWithSigs_Call struct { + *mock.Call +} + +// LogsWithSigs is a helper method to define mock.On call +// - ctx context.Context +// - start int64 +// - end int64 +// - eventSigs []common.Hash +// - address common.Address +func (_e *LogPoller_Expecter) LogsWithSigs(ctx interface{}, start interface{}, end interface{}, eventSigs interface{}, address interface{}) *LogPoller_LogsWithSigs_Call { + return &LogPoller_LogsWithSigs_Call{Call: _e.mock.On("LogsWithSigs", ctx, start, end, eventSigs, address)} +} + +func (_c *LogPoller_LogsWithSigs_Call) Run(run func(ctx context.Context, start int64, end int64, eventSigs []common.Hash, address common.Address)) *LogPoller_LogsWithSigs_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(int64), args[2].(int64), args[3].([]common.Hash), args[4].(common.Address)) + }) + return _c +} + +func (_c *LogPoller_LogsWithSigs_Call) Return(_a0 []logpoller.Log, _a1 error) *LogPoller_LogsWithSigs_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *LogPoller_LogsWithSigs_Call) RunAndReturn(run func(context.Context, int64, int64, []common.Hash, common.Address) ([]logpoller.Log, error)) *LogPoller_LogsWithSigs_Call { + _c.Call.Return(run) + return _c +} + // Name provides a mock function with given fields: func (_m *LogPoller) Name() string { ret := _m.Called() @@ -749,6 +1564,33 @@ func (_m *LogPoller) Name() string { return r0 } +// LogPoller_Name_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Name' +type LogPoller_Name_Call struct { + *mock.Call +} + +// Name is a helper method to define mock.On call +func (_e *LogPoller_Expecter) Name() *LogPoller_Name_Call { + return &LogPoller_Name_Call{Call: _e.mock.On("Name")} +} + +func (_c *LogPoller_Name_Call) Run(run func()) *LogPoller_Name_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *LogPoller_Name_Call) Return(_a0 string) *LogPoller_Name_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *LogPoller_Name_Call) RunAndReturn(run func() string) *LogPoller_Name_Call { + _c.Call.Return(run) + return _c +} + // Ready provides a mock function with given fields: func (_m *LogPoller) Ready() error { ret := _m.Called() @@ -767,6 +1609,33 @@ func (_m *LogPoller) Ready() error { return r0 } +// LogPoller_Ready_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Ready' +type LogPoller_Ready_Call struct { + *mock.Call +} + +// Ready is a helper method to define mock.On call +func (_e *LogPoller_Expecter) Ready() *LogPoller_Ready_Call { + return &LogPoller_Ready_Call{Call: _e.mock.On("Ready")} +} + +func (_c *LogPoller_Ready_Call) Run(run func()) *LogPoller_Ready_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *LogPoller_Ready_Call) Return(_a0 error) *LogPoller_Ready_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *LogPoller_Ready_Call) RunAndReturn(run func() error) *LogPoller_Ready_Call { + _c.Call.Return(run) + return _c +} + // RegisterFilter provides a mock function with given fields: ctx, filter func (_m *LogPoller) RegisterFilter(ctx context.Context, filter logpoller.Filter) error { ret := _m.Called(ctx, filter) @@ -785,6 +1654,35 @@ func (_m *LogPoller) RegisterFilter(ctx context.Context, filter logpoller.Filter return r0 } +// LogPoller_RegisterFilter_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RegisterFilter' +type LogPoller_RegisterFilter_Call struct { + *mock.Call +} + +// RegisterFilter is a helper method to define mock.On call +// - ctx context.Context +// - filter logpoller.Filter +func (_e *LogPoller_Expecter) RegisterFilter(ctx interface{}, filter interface{}) *LogPoller_RegisterFilter_Call { + return &LogPoller_RegisterFilter_Call{Call: _e.mock.On("RegisterFilter", ctx, filter)} +} + +func (_c *LogPoller_RegisterFilter_Call) Run(run func(ctx context.Context, filter logpoller.Filter)) *LogPoller_RegisterFilter_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(logpoller.Filter)) + }) + return _c +} + +func (_c *LogPoller_RegisterFilter_Call) Return(_a0 error) *LogPoller_RegisterFilter_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *LogPoller_RegisterFilter_Call) RunAndReturn(run func(context.Context, logpoller.Filter) error) *LogPoller_RegisterFilter_Call { + _c.Call.Return(run) + return _c +} + // Replay provides a mock function with given fields: ctx, fromBlock func (_m *LogPoller) Replay(ctx context.Context, fromBlock int64) error { ret := _m.Called(ctx, fromBlock) @@ -803,11 +1701,68 @@ func (_m *LogPoller) Replay(ctx context.Context, fromBlock int64) error { return r0 } +// LogPoller_Replay_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Replay' +type LogPoller_Replay_Call struct { + *mock.Call +} + +// Replay is a helper method to define mock.On call +// - ctx context.Context +// - fromBlock int64 +func (_e *LogPoller_Expecter) Replay(ctx interface{}, fromBlock interface{}) *LogPoller_Replay_Call { + return &LogPoller_Replay_Call{Call: _e.mock.On("Replay", ctx, fromBlock)} +} + +func (_c *LogPoller_Replay_Call) Run(run func(ctx context.Context, fromBlock int64)) *LogPoller_Replay_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(int64)) + }) + return _c +} + +func (_c *LogPoller_Replay_Call) Return(_a0 error) *LogPoller_Replay_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *LogPoller_Replay_Call) RunAndReturn(run func(context.Context, int64) error) *LogPoller_Replay_Call { + _c.Call.Return(run) + return _c +} + // ReplayAsync provides a mock function with given fields: fromBlock func (_m *LogPoller) ReplayAsync(fromBlock int64) { _m.Called(fromBlock) } +// LogPoller_ReplayAsync_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ReplayAsync' +type LogPoller_ReplayAsync_Call struct { + *mock.Call +} + +// ReplayAsync is a helper method to define mock.On call +// - fromBlock int64 +func (_e *LogPoller_Expecter) ReplayAsync(fromBlock interface{}) *LogPoller_ReplayAsync_Call { + return &LogPoller_ReplayAsync_Call{Call: _e.mock.On("ReplayAsync", fromBlock)} +} + +func (_c *LogPoller_ReplayAsync_Call) Run(run func(fromBlock int64)) *LogPoller_ReplayAsync_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(int64)) + }) + return _c +} + +func (_c *LogPoller_ReplayAsync_Call) Return() *LogPoller_ReplayAsync_Call { + _c.Call.Return() + return _c +} + +func (_c *LogPoller_ReplayAsync_Call) RunAndReturn(run func(int64)) *LogPoller_ReplayAsync_Call { + _c.Call.Return(run) + return _c +} + // Start provides a mock function with given fields: _a0 func (_m *LogPoller) Start(_a0 context.Context) error { ret := _m.Called(_a0) @@ -826,6 +1781,34 @@ func (_m *LogPoller) Start(_a0 context.Context) error { return r0 } +// LogPoller_Start_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Start' +type LogPoller_Start_Call struct { + *mock.Call +} + +// Start is a helper method to define mock.On call +// - _a0 context.Context +func (_e *LogPoller_Expecter) Start(_a0 interface{}) *LogPoller_Start_Call { + return &LogPoller_Start_Call{Call: _e.mock.On("Start", _a0)} +} + +func (_c *LogPoller_Start_Call) Run(run func(_a0 context.Context)) *LogPoller_Start_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *LogPoller_Start_Call) Return(_a0 error) *LogPoller_Start_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *LogPoller_Start_Call) RunAndReturn(run func(context.Context) error) *LogPoller_Start_Call { + _c.Call.Return(run) + return _c +} + // UnregisterFilter provides a mock function with given fields: ctx, name func (_m *LogPoller) UnregisterFilter(ctx context.Context, name string) error { ret := _m.Called(ctx, name) @@ -844,6 +1827,35 @@ func (_m *LogPoller) UnregisterFilter(ctx context.Context, name string) error { return r0 } +// LogPoller_UnregisterFilter_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UnregisterFilter' +type LogPoller_UnregisterFilter_Call struct { + *mock.Call +} + +// UnregisterFilter is a helper method to define mock.On call +// - ctx context.Context +// - name string +func (_e *LogPoller_Expecter) UnregisterFilter(ctx interface{}, name interface{}) *LogPoller_UnregisterFilter_Call { + return &LogPoller_UnregisterFilter_Call{Call: _e.mock.On("UnregisterFilter", ctx, name)} +} + +func (_c *LogPoller_UnregisterFilter_Call) Run(run func(ctx context.Context, name string)) *LogPoller_UnregisterFilter_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *LogPoller_UnregisterFilter_Call) Return(_a0 error) *LogPoller_UnregisterFilter_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *LogPoller_UnregisterFilter_Call) RunAndReturn(run func(context.Context, string) error) *LogPoller_UnregisterFilter_Call { + _c.Call.Return(run) + return _c +} + // NewLogPoller creates a new instance of LogPoller. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewLogPoller(t interface { diff --git a/core/chains/evm/logpoller/observability.go b/core/chains/evm/logpoller/observability.go index 7842a060eca..e0ed0cc4786 100644 --- a/core/chains/evm/logpoller/observability.go +++ b/core/chains/evm/logpoller/observability.go @@ -262,7 +262,7 @@ func (o *ObservedORM) SelectIndexedLogsTopicRange(ctx context.Context, address c }) } -func (o *ObservedORM) FilteredLogs(ctx context.Context, filter query.KeyFilter, limitAndSort query.LimitAndSort, queryName string) ([]Log, error) { +func (o *ObservedORM) FilteredLogs(ctx context.Context, filter []query.Expression, limitAndSort query.LimitAndSort, queryName string) ([]Log, error) { return withObservedQueryAndResults(o, queryName, func() ([]Log, error) { return o.ORM.FilteredLogs(ctx, filter, limitAndSort, queryName) }) @@ -285,7 +285,7 @@ func withObservedExecAndRowsAffected(o *ObservedORM, queryName string, queryType WithLabelValues(o.chainId, queryName, string(queryType)). Observe(float64(time.Since(queryStarted))) - if err != nil { + if err == nil { o.datasetSize. WithLabelValues(o.chainId, queryName, string(queryType)). Set(float64(rowsAffected)) diff --git a/core/chains/evm/logpoller/observability_test.go b/core/chains/evm/logpoller/observability_test.go index 78c27b4b8f7..4ea7adceab0 100644 --- a/core/chains/evm/logpoller/observability_test.go +++ b/core/chains/evm/logpoller/observability_test.go @@ -16,6 +16,7 @@ import ( "github.com/prometheus/client_golang/prometheus/testutil" "github.com/smartcontractkit/chainlink-common/pkg/logger" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils" ubig "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils/big" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" @@ -117,6 +118,16 @@ func TestCountersAreProperlyPopulatedForWrites(t *testing.T) { assert.Equal(t, float64(20), testutil.ToFloat64(orm.logsInserted.WithLabelValues("420"))) assert.Equal(t, float64(2), testutil.ToFloat64(orm.blocksInserted.WithLabelValues("420"))) + rowsAffected, err := orm.DeleteExpiredLogs(ctx, 3) + require.NoError(t, err) + require.Equal(t, int64(3), rowsAffected) + assert.Equal(t, 3, counterFromGaugeByLabels(orm.datasetSize, "420", "DeleteExpiredLogs", "delete")) + + rowsAffected, err = orm.DeleteBlocksBefore(ctx, 30, 0) + require.NoError(t, err) + require.Equal(t, int64(2), rowsAffected) + assert.Equal(t, 2, counterFromGaugeByLabels(orm.datasetSize, "420", "DeleteBlocksBefore", "delete")) + // Don't update counters in case of an error require.Error(t, orm.InsertLogsWithBlock(ctx, logs, NewLogPollerBlock(utils.RandomBytes32(), 0, time.Now(), 0))) assert.Equal(t, float64(20), testutil.ToFloat64(orm.logsInserted.WithLabelValues("420"))) diff --git a/core/chains/evm/logpoller/orm.go b/core/chains/evm/logpoller/orm.go index 1d249760736..e40fb80f108 100644 --- a/core/chains/evm/logpoller/orm.go +++ b/core/chains/evm/logpoller/orm.go @@ -15,6 +15,7 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/types/query" "github.com/smartcontractkit/chainlink-common/pkg/sqlutil" + evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" @@ -63,7 +64,7 @@ type ORM interface { SelectLogsDataWordBetween(ctx context.Context, address common.Address, eventSig common.Hash, wordIndexMin int, wordIndexMax int, wordValue common.Hash, confs evmtypes.Confirmations) ([]Log, error) // FilteredLogs accepts chainlink-common filtering DSL. - FilteredLogs(ctx context.Context, filter query.KeyFilter, limitAndSort query.LimitAndSort, queryName string) ([]Log, error) + FilteredLogs(ctx context.Context, filter []query.Expression, limitAndSort query.LimitAndSort, queryName string) ([]Log, error) } type DSORM struct { @@ -313,34 +314,30 @@ type Exp struct { ShouldDelete bool } +// DeleteExpiredLogs removes any logs which either: +// - don't match any currently registered filters, or +// - have a timestamp older than any matching filter's retention, UNLESS there is at +// least one matching filter with retention=0 func (o *DSORM) DeleteExpiredLogs(ctx context.Context, limit int64) (int64, error) { var err error var result sql.Result - if limit > 0 { - result, err = o.ds.ExecContext(ctx, ` - DELETE FROM evm.logs + query := `DELETE FROM evm.logs WHERE (evm_chain_id, address, event_sig, block_number) IN ( SELECT l.evm_chain_id, l.address, l.event_sig, l.block_number FROM evm.logs l - INNER JOIN ( - SELECT address, event, MAX(retention) AS retention + LEFT JOIN ( + SELECT address, event, CASE WHEN MIN(retention) = 0 THEN 0 ELSE MAX(retention) END AS retention FROM evm.log_poller_filters WHERE evm_chain_id = $1 GROUP BY evm_chain_id, address, event - HAVING NOT 0 = ANY(ARRAY_AGG(retention)) - ) r ON l.evm_chain_id = $1 AND l.address = r.address AND l.event_sig = r.event - AND l.block_timestamp <= STATEMENT_TIMESTAMP() - (r.retention / 10^9 * interval '1 second') - LIMIT $2 - )`, ubig.New(o.chainID), limit) + ) r ON l.address = r.address AND l.event_sig = r.event + WHERE l.evm_chain_id = $1 AND -- Must be WHERE rather than ON due to LEFT JOIN + r.retention IS NULL OR (r.retention != 0 AND l.block_timestamp <= STATEMENT_TIMESTAMP() - (r.retention / 10^9 * interval '1 second')) %s)` + + if limit > 0 { + result, err = o.ds.ExecContext(ctx, fmt.Sprintf(query, "LIMIT $2"), ubig.New(o.chainID), limit) } else { - result, err = o.ds.ExecContext(ctx, `WITH r AS - ( SELECT address, event, MAX(retention) AS retention - FROM evm.log_poller_filters WHERE evm_chain_id=$1 - GROUP BY evm_chain_id,address, event HAVING NOT 0 = ANY(ARRAY_AGG(retention)) - ) DELETE FROM evm.logs l USING r - WHERE l.evm_chain_id = $1 AND l.address=r.address AND l.event_sig=r.event - AND l.block_timestamp <= STATEMENT_TIMESTAMP() - (r.retention / 10^9 * interval '1 second')`, // retention is in nanoseconds (time.Duration aka BIGINT) - ubig.New(o.chainID)) + result, err = o.ds.ExecContext(ctx, fmt.Sprintf(query, ""), ubig.New(o.chainID)) } if err != nil { @@ -393,7 +390,7 @@ func (o *DSORM) insertLogsWithinTx(ctx context.Context, logs []Log, tx sqlutil.D (:evm_chain_id, :log_index, :block_hash, :block_number, :block_timestamp, :address, :event_sig, :topics, :tx_hash, :data, NOW()) ON CONFLICT DO NOTHING` - _, err := o.ds.NamedExecContext(ctx, query, logs[start:end]) + _, err := tx.NamedExecContext(ctx, query, logs[start:end]) if err != nil { if pkgerrors.Is(err, context.DeadlineExceeded) && batchInsertSize > 500 { // In case of DB timeouts, try to insert again with a smaller batch upto a limit @@ -968,9 +965,8 @@ func (o *DSORM) SelectIndexedLogsWithSigsExcluding(ctx context.Context, sigA, si return logs, nil } -// TODO flaky BCF-3258 -func (o *DSORM) FilteredLogs(ctx context.Context, filter query.KeyFilter, limitAndSort query.LimitAndSort, _ string) ([]Log, error) { - qs, args, err := (&pgDSLParser{}).buildQuery(o.chainID, filter.Expressions, limitAndSort) +func (o *DSORM) FilteredLogs(ctx context.Context, filter []query.Expression, limitAndSort query.LimitAndSort, _ string) ([]Log, error) { + qs, args, err := (&pgDSLParser{}).buildQuery(o.chainID, filter, limitAndSort) if err != nil { return nil, err } diff --git a/core/chains/evm/logpoller/orm_test.go b/core/chains/evm/logpoller/orm_test.go index ce56c799226..14f6bbeb6aa 100644 --- a/core/chains/evm/logpoller/orm_test.go +++ b/core/chains/evm/logpoller/orm_test.go @@ -7,6 +7,7 @@ import ( "fmt" "math" "math/big" + "strconv" "testing" "time" @@ -27,8 +28,8 @@ import ( evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils" ubig "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils/big" - "github.com/smartcontractkit/chainlink/v2/core/internal/cltest/heavyweight" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" + "github.com/smartcontractkit/chainlink/v2/core/utils/testutils/heavyweight" ) type block struct { @@ -186,6 +187,7 @@ func TestORM_GetBlocks_From_Range_Recent_Blocks(t *testing.T) { } func TestORM(t *testing.T) { + t.Parallel() th := SetupTH(t, lpOpts) o1 := th.ORM o2 := th.ORM2 @@ -333,6 +335,36 @@ func TestORM(t *testing.T) { }, })) + // Insert a couple logs on a different chain, to make sure + // these aren't affected by any operations on the chain LogPoller + // is managing. + require.NoError(t, o2.InsertLogs(ctx, []logpoller.Log{ + { + EvmChainId: ubig.New(th.ChainID2), + LogIndex: 8, + BlockHash: common.HexToHash("0x1238"), + BlockNumber: int64(17), + EventSig: topic2, + Topics: [][]byte{topic2[:]}, + Address: common.HexToAddress("0x1236"), + TxHash: common.HexToHash("0x1888"), + Data: []byte("same log on unrelated chain"), + BlockTimestamp: time.Now(), + }, + { + EvmChainId: ubig.New(th.ChainID2), + LogIndex: 9, + BlockHash: common.HexToHash("0x1999"), + BlockNumber: int64(18), + EventSig: topic, + Topics: [][]byte{topic[:], topic2[:]}, + Address: common.HexToAddress("0x5555"), + TxHash: common.HexToHash("0x1543"), + Data: []byte("different log on unrelated chain"), + BlockTimestamp: time.Now(), + }, + })) + t.Log(latest.BlockNumber) logs, err := o1.SelectLogsByBlockRange(ctx, 1, 17) require.NoError(t, err) @@ -453,24 +485,38 @@ func TestORM(t *testing.T) { require.NoError(t, err) require.Len(t, logs, 8) - // Delete expired logs + // Delete expired logs with page limit time.Sleep(2 * time.Millisecond) // just in case we haven't reached the end of the 1ms retention period - deleted, err := o1.DeleteExpiredLogs(ctx, 0) + deleted, err := o1.DeleteExpiredLogs(ctx, 2) require.NoError(t, err) - assert.Equal(t, int64(1), deleted) + assert.Equal(t, int64(2), deleted) + + // Delete expired logs without page limit + deleted, err = o1.DeleteExpiredLogs(ctx, 0) + require.NoError(t, err) + assert.Equal(t, int64(2), deleted) + + // Ensure that both of the logs from the second chain are still there + logs, err = o2.SelectLogs(ctx, 0, 100, common.HexToAddress("0x1236"), topic2) + require.NoError(t, err) + assert.Len(t, logs, 1) + logs, err = o2.SelectLogs(ctx, 0, 100, common.HexToAddress("0x5555"), topic) + require.NoError(t, err) + assert.Len(t, logs, 1) + logs, err = o1.SelectLogsByBlockRange(ctx, 1, latest.BlockNumber) require.NoError(t, err) - // The only log which should be deleted is the one which matches filter1 (ret=1ms) but not filter12 (ret=1 hour) - // Importantly, it shouldn't delete any logs matching only filter0 (ret=0 meaning permanent retention). Anything - // matching filter12 should be kept regardless of what other filters it matches. - assert.Len(t, logs, 7) + // It should have retained the log matching filter0 (due to ret=0 meaning permanent retention) as well as all + // 3 logs matching filter12 (ret=1 hour). It should have deleted 3 logs not matching any filter, as well as 1 + // of the 2 logs matching filter1 (ret=1ms)--the one that doesn't also match filter12. + assert.Len(t, logs, 4) // Delete logs after should delete all logs. err = o1.DeleteLogsAndBlocksAfter(ctx, 1) require.NoError(t, err) logs, err = o1.SelectLogsByBlockRange(ctx, 1, latest.BlockNumber) require.NoError(t, err) - require.Zero(t, len(logs)) + assert.Zero(t, len(logs)) } type PgxLogger struct { @@ -604,8 +650,8 @@ func TestORM_IndexedLogs(t *testing.T) { } for idx, value := range topicValues { - topicFilters.Expressions[idx] = logpoller.NewEventByTopicFilter(topicIdx, []primitives.ValueComparator{ - {Value: logpoller.EvmWord(value).Hex(), Operator: primitives.Eq}, + topicFilters.Expressions[idx] = logpoller.NewEventByTopicFilter(topicIdx, []logpoller.HashedValueComparator{ + {Value: logpoller.EvmWord(value), Operator: primitives.Eq}, }) } @@ -629,7 +675,7 @@ func TestORM_IndexedLogs(t *testing.T) { require.Equal(t, 1, len(lgs)) assert.Equal(t, logpoller.EvmWord(1).Bytes(), lgs[0].GetTopics()[1].Bytes()) - lgs, err = o1.FilteredLogs(ctx, standardFilter(1, []uint64{1}), limiter, "") + lgs, err = o1.FilteredLogs(ctx, standardFilter(1, []uint64{1}).Expressions, limiter, "") require.NoError(t, err) require.Equal(t, 1, len(lgs)) assert.Equal(t, logpoller.EvmWord(1).Bytes(), lgs[0].GetTopics()[1].Bytes()) @@ -638,19 +684,17 @@ func TestORM_IndexedLogs(t *testing.T) { require.NoError(t, err) assert.Equal(t, 2, len(lgs)) - lgs, err = o1.FilteredLogs(ctx, standardFilter(1, []uint64{1, 2}), limiter, "") + lgs, err = o1.FilteredLogs(ctx, standardFilter(1, []uint64{1, 2}).Expressions, limiter, "") require.NoError(t, err) assert.Equal(t, 2, len(lgs)) - blockRangeFilter := func(start, end uint64, topicIdx uint64, topicValues []uint64) query.KeyFilter { - return query.KeyFilter{ - Expressions: []query.Expression{ - logpoller.NewAddressFilter(addr), - logpoller.NewEventSigFilter(eventSig), - filtersForTopics(topicIdx, topicValues), - query.Block(start, primitives.Gte), - query.Block(end, primitives.Lte), - }, + blockRangeFilter := func(start, end string, topicIdx uint64, topicValues []uint64) []query.Expression { + return []query.Expression{ + logpoller.NewAddressFilter(addr), + logpoller.NewEventSigFilter(eventSig), + filtersForTopics(topicIdx, topicValues), + query.Block(start, primitives.Gte), + query.Block(end, primitives.Lte), } } @@ -658,7 +702,7 @@ func TestORM_IndexedLogs(t *testing.T) { require.NoError(t, err) assert.Equal(t, 1, len(lgs)) - lgs, err = o1.FilteredLogs(ctx, blockRangeFilter(1, 1, 1, []uint64{1}), limiter, "") + lgs, err = o1.FilteredLogs(ctx, blockRangeFilter("1", "1", 1, []uint64{1}), limiter, "") require.NoError(t, err) assert.Equal(t, 1, len(lgs)) @@ -666,7 +710,7 @@ func TestORM_IndexedLogs(t *testing.T) { require.NoError(t, err) assert.Equal(t, 1, len(lgs)) - lgs, err = o1.FilteredLogs(ctx, blockRangeFilter(1, 2, 1, []uint64{2}), limiter, "") + lgs, err = o1.FilteredLogs(ctx, blockRangeFilter("1", "2", 1, []uint64{2}), limiter, "") require.NoError(t, err) assert.Equal(t, 1, len(lgs)) @@ -674,7 +718,7 @@ func TestORM_IndexedLogs(t *testing.T) { require.NoError(t, err) assert.Equal(t, 1, len(lgs)) - lgs, err = o1.FilteredLogs(ctx, blockRangeFilter(1, 2, 1, []uint64{1}), limiter, "") + lgs, err = o1.FilteredLogs(ctx, blockRangeFilter("1", "2", 1, []uint64{1}), limiter, "") require.NoError(t, err) assert.Equal(t, 1, len(lgs)) @@ -682,7 +726,7 @@ func TestORM_IndexedLogs(t *testing.T) { require.Error(t, err) assert.Contains(t, err.Error(), "invalid index for topic: 0") - _, err = o1.FilteredLogs(ctx, blockRangeFilter(1, 2, 0, []uint64{1}), limiter, "") + _, err = o1.FilteredLogs(ctx, blockRangeFilter("1", "2", 0, []uint64{1}), limiter, "") require.Error(t, err) assert.Contains(t, err.Error(), "invalid index for topic: 0") @@ -690,7 +734,7 @@ func TestORM_IndexedLogs(t *testing.T) { require.Error(t, err) assert.Contains(t, err.Error(), "invalid index for topic: 4") - _, err = o1.FilteredLogs(ctx, blockRangeFilter(1, 2, 4, []uint64{1}), limiter, "") + _, err = o1.FilteredLogs(ctx, blockRangeFilter("1", "2", 4, []uint64{1}), limiter, "") require.Error(t, err) assert.Contains(t, err.Error(), "invalid index for topic: 4") @@ -702,30 +746,28 @@ func TestORM_IndexedLogs(t *testing.T) { Expressions: []query.Expression{ logpoller.NewAddressFilter(addr), logpoller.NewEventSigFilter(eventSig), - logpoller.NewEventByTopicFilter(1, []primitives.ValueComparator{ - {Value: logpoller.EvmWord(2).Hex(), Operator: primitives.Gte}, + logpoller.NewEventByTopicFilter(1, []logpoller.HashedValueComparator{ + {Value: logpoller.EvmWord(2), Operator: primitives.Gte}, }), query.Confidence(primitives.Unconfirmed), }, } - lgs, err = o1.FilteredLogs(ctx, filter, limiter, "") + lgs, err = o1.FilteredLogs(ctx, filter.Expressions, limiter, "") require.NoError(t, err) assert.Equal(t, 2, len(lgs)) - rangeFilter := func(topicIdx uint64, min, max uint64) query.KeyFilter { - return query.KeyFilter{ - Expressions: []query.Expression{ - logpoller.NewAddressFilter(addr), - logpoller.NewEventSigFilter(eventSig), - logpoller.NewEventByTopicFilter(topicIdx, []primitives.ValueComparator{ - {Value: logpoller.EvmWord(min).Hex(), Operator: primitives.Gte}, - }), - logpoller.NewEventByTopicFilter(topicIdx, []primitives.ValueComparator{ - {Value: logpoller.EvmWord(max).Hex(), Operator: primitives.Lte}, - }), - query.Confidence(primitives.Unconfirmed), - }, + rangeFilter := func(topicIdx uint64, min, max uint64) []query.Expression { + return []query.Expression{ + logpoller.NewAddressFilter(addr), + logpoller.NewEventSigFilter(eventSig), + logpoller.NewEventByTopicFilter(topicIdx, []logpoller.HashedValueComparator{ + {Value: logpoller.EvmWord(min), Operator: primitives.Gte}, + }), + logpoller.NewEventByTopicFilter(topicIdx, []logpoller.HashedValueComparator{ + {Value: logpoller.EvmWord(max), Operator: primitives.Lte}, + }), + query.Confidence(primitives.Unconfirmed), } } @@ -833,7 +875,7 @@ func TestORM_SelectIndexedLogsByTxHash(t *testing.T) { }, } - retrievedLogs, err = o1.FilteredLogs(ctx, filter, limiter, "") + retrievedLogs, err = o1.FilteredLogs(ctx, filter.Expressions, limiter, "") require.NoError(t, err) require.Equal(t, 2, len(retrievedLogs)) @@ -874,19 +916,17 @@ func TestORM_DataWords(t *testing.T) { }, })) - wordFilter := func(wordIdx uint8, word1, word2 uint64) query.KeyFilter { - return query.KeyFilter{ - Expressions: []query.Expression{ - logpoller.NewAddressFilter(addr), - logpoller.NewEventSigFilter(eventSig), - logpoller.NewEventByWordFilter(eventSig, wordIdx, []primitives.ValueComparator{ - {Value: logpoller.EvmWord(word1).Hex(), Operator: primitives.Gte}, - }), - logpoller.NewEventByWordFilter(eventSig, wordIdx, []primitives.ValueComparator{ - {Value: logpoller.EvmWord(word2).Hex(), Operator: primitives.Lte}, - }), - query.Confidence(primitives.Unconfirmed), - }, + wordFilter := func(wordIdx int, word1, word2 uint64) []query.Expression { + return []query.Expression{ + logpoller.NewAddressFilter(addr), + logpoller.NewEventSigFilter(eventSig), + logpoller.NewEventByWordFilter(wordIdx, []logpoller.HashedValueComparator{ + {Value: logpoller.EvmWord(word1), Operator: primitives.Gte}, + }), + logpoller.NewEventByWordFilter(wordIdx, []logpoller.HashedValueComparator{ + {Value: logpoller.EvmWord(word2), Operator: primitives.Lte}, + }), + query.Confidence(primitives.Unconfirmed), } } @@ -945,15 +985,13 @@ func TestORM_DataWords(t *testing.T) { require.NoError(t, err) assert.Equal(t, 2, len(lgs)) - filter := query.KeyFilter{ - Expressions: []query.Expression{ - logpoller.NewAddressFilter(addr), - logpoller.NewEventSigFilter(eventSig), - logpoller.NewEventByWordFilter(eventSig, 0, []primitives.ValueComparator{ - {Value: logpoller.EvmWord(1).Hex(), Operator: primitives.Gte}, - }), - query.Confidence(primitives.Unconfirmed), - }, + filter := []query.Expression{ + logpoller.NewAddressFilter(addr), + logpoller.NewEventSigFilter(eventSig), + logpoller.NewEventByWordFilter(0, []logpoller.HashedValueComparator{ + {Value: logpoller.EvmWord(1), Operator: primitives.Gte}, + }), + query.Confidence(primitives.Unconfirmed), } lgs, err = o1.FilteredLogs(ctx, filter, limiter, "") @@ -1042,7 +1080,7 @@ func TestORM_SelectLogsWithSigsByBlockRangeFilter(t *testing.T) { } require.NoError(t, o1.InsertLogs(ctx, inputLogs)) - filter := func(sigs []common.Hash, startBlock, endBlock int64) query.KeyFilter { + filter := func(sigs []common.Hash, startBlock, endBlock string) query.KeyFilter { filters := []query.Expression{ logpoller.NewAddressFilter(sourceAddr), } @@ -1064,8 +1102,8 @@ func TestORM_SelectLogsWithSigsByBlockRangeFilter(t *testing.T) { filters = append(filters, query.Expression{ BoolExpression: query.BoolExpression{ Expressions: []query.Expression{ - query.Block(uint64(startBlock), primitives.Gte), - query.Block(uint64(endBlock), primitives.Lte), + query.Block(startBlock, primitives.Gte), + query.Block(endBlock, primitives.Lte), }, BoolOperator: query.AND, }, @@ -1097,8 +1135,7 @@ func TestORM_SelectLogsWithSigsByBlockRangeFilter(t *testing.T) { }) assertion(t, logs, err, startBlock, endBlock) - - logs, err = th.ORM.FilteredLogs(ctx, filter([]common.Hash{topic, topic2}, startBlock, endBlock), limiter, "") + logs, err = th.ORM.FilteredLogs(ctx, filter([]common.Hash{topic, topic2}, strconv.Itoa(int(startBlock)), strconv.Itoa(int(endBlock))).Expressions, limiter, "") assertion(t, logs, err, startBlock, endBlock) } @@ -1160,14 +1197,12 @@ func TestLogPoller_Logs(t *testing.T) { assert.Equal(t, "0x0000000000000000000000000000000000000000000000000000000000000005", lgs[4].BlockHash.String()) assert.Equal(t, "0x0000000000000000000000000000000000000000000000000000000000000005", lgs[5].BlockHash.String()) - logFilter := func(start, end uint64, address common.Address) query.KeyFilter { - return query.KeyFilter{ - Expressions: []query.Expression{ - logpoller.NewAddressFilter(address), - logpoller.NewEventSigFilter(event1), - query.Block(start, primitives.Gte), - query.Block(end, primitives.Lte), - }, + logFilter := func(start, end string, address common.Address) []query.Expression { + return []query.Expression{ + logpoller.NewAddressFilter(address), + logpoller.NewEventSigFilter(event1), + query.Block(start, primitives.Gte), + query.Block(end, primitives.Lte), } } @@ -1181,7 +1216,7 @@ func TestLogPoller_Logs(t *testing.T) { assert.Equal(t, "0x0000000000000000000000000000000000000000000000000000000000000005", lgs[1].BlockHash.String()) assert.Equal(t, address1, lgs[1].Address) - lgs, err = th.ORM.FilteredLogs(ctx, logFilter(1, 3, address1), query.LimitAndSort{ + lgs, err = th.ORM.FilteredLogs(ctx, logFilter("1", "3", address1), query.LimitAndSort{ SortBy: []query.SortBy{query.NewSortBySequence(query.Asc)}, }, "") require.NoError(t, err) @@ -1201,7 +1236,7 @@ func TestLogPoller_Logs(t *testing.T) { assert.Equal(t, address2, lgs[0].Address) assert.Equal(t, event1.Bytes(), lgs[0].Topics[0]) - lgs, err = th.ORM.FilteredLogs(ctx, logFilter(2, 2, address2), query.LimitAndSort{ + lgs, err = th.ORM.FilteredLogs(ctx, logFilter("2", "2", address2), query.LimitAndSort{ SortBy: []query.SortBy{query.NewSortBySequence(query.Asc)}, }, "") require.NoError(t, err) @@ -1676,8 +1711,8 @@ func TestSelectLogsCreatedAfter(t *testing.T) { if len(topicVals) > 0 { exp := make([]query.Expression, len(topicVals)) for idx, val := range topicVals { - exp[idx] = logpoller.NewEventByTopicFilter(uint64(topicIdx), []primitives.ValueComparator{ - {Value: val.String(), Operator: primitives.Eq}, + exp[idx] = logpoller.NewEventByTopicFilter(uint64(topicIdx), []logpoller.HashedValueComparator{ + {Value: val, Operator: primitives.Eq}, }) } @@ -1721,7 +1756,7 @@ func TestSelectLogsCreatedAfter(t *testing.T) { assertion(t, logs, err, tt.expectedLogs) - logs, err = th.ORM.FilteredLogs(ctx, filter(tt.after, tt.confs, 0, nil), limiter, "") + logs, err = th.ORM.FilteredLogs(ctx, filter(tt.after, tt.confs, 0, nil).Expressions, limiter, "") assertion(t, logs, err, tt.expectedLogs) }) @@ -1734,7 +1769,7 @@ func TestSelectLogsCreatedAfter(t *testing.T) { assertion(t, logs, err, tt.expectedLogs) - logs, err = th.ORM.FilteredLogs(ctx, filter(tt.after, tt.confs, 1, []common.Hash{event}), limiter, "") + logs, err = th.ORM.FilteredLogs(ctx, filter(tt.after, tt.confs, 1, []common.Hash{event}).Expressions, limiter, "") assertion(t, logs, err, tt.expectedLogs) }) @@ -1964,11 +1999,11 @@ func TestSelectLogsDataWordBetween(t *testing.T) { Expressions: []query.Expression{ logpoller.NewAddressFilter(address), logpoller.NewEventSigFilter(eventSig), - logpoller.NewEventByWordFilter(eventSig, 0, []primitives.ValueComparator{ - {Value: logpoller.EvmWord(word).Hex(), Operator: primitives.Lte}, + logpoller.NewEventByWordFilter(0, []logpoller.HashedValueComparator{ + {Value: logpoller.EvmWord(word), Operator: primitives.Lte}, }), - logpoller.NewEventByWordFilter(eventSig, 1, []primitives.ValueComparator{ - {Value: logpoller.EvmWord(word).Hex(), Operator: primitives.Gte}, + logpoller.NewEventByWordFilter(1, []logpoller.HashedValueComparator{ + {Value: logpoller.EvmWord(word), Operator: primitives.Gte}, }), query.Confidence(primitives.Unconfirmed), }, @@ -1990,7 +2025,7 @@ func TestSelectLogsDataWordBetween(t *testing.T) { assertion(t, logs, err, tt.expectedLogs) - logs, err = th.ORM.FilteredLogs(ctx, wordFilter(tt.wordValue), limiter, "") + logs, err = th.ORM.FilteredLogs(ctx, wordFilter(tt.wordValue).Expressions, limiter, "") assertion(t, logs, err, tt.expectedLogs) }) diff --git a/core/chains/evm/logpoller/parser.go b/core/chains/evm/logpoller/parser.go index e08ea93da73..19302c89192 100644 --- a/core/chains/evm/logpoller/parser.go +++ b/core/chains/evm/logpoller/parser.go @@ -151,11 +151,11 @@ func (v *pgDSLParser) nestedConfQuery(finalized bool, confs uint64) string { } func (v *pgDSLParser) VisitEventByWordFilter(p *eventByWordFilter) { - if len(p.ValueComparers) > 0 { + if len(p.HashedValueComparers) > 0 { wordIdx := v.args.withIndexedField("word_index", p.WordIndex) - comps := make([]string, len(p.ValueComparers)) - for idx, comp := range p.ValueComparers { + comps := make([]string, len(p.HashedValueComparers)) + for idx, comp := range p.HashedValueComparers { comps[idx], v.err = makeComp(comp, v.args, "word_value", wordIdx, "substring(data from 32*:%s+1 for 32) %s :%s") if v.err != nil { return @@ -199,7 +199,7 @@ func (v *pgDSLParser) VisitConfirmationsFilter(p *confirmationsFilter) { } } -func makeComp(comp primitives.ValueComparator, args *queryArgs, field, subfield, pattern string) (string, error) { +func makeComp(comp HashedValueComparator, args *queryArgs, field, subfield, pattern string) (string, error) { cmp, err := cmpOpToString(comp.Operator) if err != nil { return "", err @@ -209,7 +209,7 @@ func makeComp(comp primitives.ValueComparator, args *queryArgs, field, subfield, pattern, subfield, cmp, - args.withIndexedField(field, common.HexToHash(comp.Value)), + args.withIndexedField(field, comp.Value), ), nil } @@ -432,6 +432,12 @@ func orderToString(dir query.SortDirection) (string, error) { } } +// MakeContractReaderCursor is exported to ensure cursor structure remains consistent. +func FormatContractReaderCursor(log Log) string { + return fmt.Sprintf("%d-%d-%s", log.BlockNumber, log.LogIndex, log.TxHash) +} + +// ensure valuesFromCursor remains consistent with the function above that creates a cursor func valuesFromCursor(cursor string) (int64, int, []byte, error) { partCount := 3 @@ -492,17 +498,20 @@ func (f *eventSigFilter) Accept(visitor primitives.Visitor) { } } +type HashedValueComparator struct { + Value common.Hash + Operator primitives.ComparisonOperator +} + type eventByWordFilter struct { - EventSig common.Hash - WordIndex uint8 - ValueComparers []primitives.ValueComparator + WordIndex int + HashedValueComparers []HashedValueComparator } -func NewEventByWordFilter(eventSig common.Hash, wordIndex uint8, valueComparers []primitives.ValueComparator) query.Expression { +func NewEventByWordFilter(wordIndex int, valueComparers []HashedValueComparator) query.Expression { return query.Expression{Primitive: &eventByWordFilter{ - EventSig: eventSig, - WordIndex: wordIndex, - ValueComparers: valueComparers, + WordIndex: wordIndex, + HashedValueComparers: valueComparers, }} } @@ -515,10 +524,10 @@ func (f *eventByWordFilter) Accept(visitor primitives.Visitor) { type eventByTopicFilter struct { Topic uint64 - ValueComparers []primitives.ValueComparator + ValueComparers []HashedValueComparator } -func NewEventByTopicFilter(topicIndex uint64, valueComparers []primitives.ValueComparator) query.Expression { +func NewEventByTopicFilter(topicIndex uint64, valueComparers []HashedValueComparator) query.Expression { return query.Expression{Primitive: &eventByTopicFilter{ Topic: topicIndex, ValueComparers: valueComparers, diff --git a/core/chains/evm/logpoller/parser_test.go b/core/chains/evm/logpoller/parser_test.go index 5e99ec7ba82..f37497600bd 100644 --- a/core/chains/evm/logpoller/parser_test.go +++ b/core/chains/evm/logpoller/parser_test.go @@ -141,7 +141,7 @@ func TestDSLParser(t *testing.T) { expressions := []query.Expression{ query.Timestamp(10, primitives.Eq), query.TxHash(common.HexToHash("0x84").String()), - query.Block(99, primitives.Neq), + query.Block("99", primitives.Neq), query.Confidence(primitives.Finalized), } limiter := query.NewLimitAndSort(query.CursorLimit("10-20-0x42", query.CursorPrevious, 20)) @@ -233,8 +233,8 @@ func TestDSLParser(t *testing.T) { t.Run("query for event by word", func(t *testing.T) { t.Parallel() - wordFilter := NewEventByWordFilter(common.HexToHash("0x42"), 8, []primitives.ValueComparator{ - {Value: "", Operator: primitives.Gt}, + wordFilter := NewEventByWordFilter(8, []HashedValueComparator{ + {Value: common.HexToHash(""), Operator: primitives.Gt}, }) parser := &pgDSLParser{} @@ -257,9 +257,9 @@ func TestDSLParser(t *testing.T) { t.Run("query for event topic", func(t *testing.T) { t.Parallel() - topicFilter := NewEventByTopicFilter(2, []primitives.ValueComparator{ - {Value: "a", Operator: primitives.Gt}, - {Value: "b", Operator: primitives.Lt}, + topicFilter := NewEventByTopicFilter(2, []HashedValueComparator{ + {Value: common.HexToHash("a"), Operator: primitives.Gt}, + {Value: common.HexToHash("b"), Operator: primitives.Lt}, }) parser := &pgDSLParser{} @@ -321,9 +321,9 @@ func TestDSLParser(t *testing.T) { t.Run("nested query deep", func(t *testing.T) { t.Parallel() - wordFilter := NewEventByWordFilter(common.HexToHash("0x42"), 8, []primitives.ValueComparator{ - {Value: "a", Operator: primitives.Gt}, - {Value: "b", Operator: primitives.Lte}, + wordFilter := NewEventByWordFilter(8, []HashedValueComparator{ + {Value: common.HexToHash("a"), Operator: primitives.Gt}, + {Value: common.HexToHash("b"), Operator: primitives.Lte}, }) parser := &pgDSLParser{} diff --git a/core/chains/evm/mocks/balance_monitor.go b/core/chains/evm/mocks/balance_monitor.go index 2bf4898ef27..a0e4e845343 100644 --- a/core/chains/evm/mocks/balance_monitor.go +++ b/core/chains/evm/mocks/balance_monitor.go @@ -18,6 +18,14 @@ type BalanceMonitor struct { mock.Mock } +type BalanceMonitor_Expecter struct { + mock *mock.Mock +} + +func (_m *BalanceMonitor) EXPECT() *BalanceMonitor_Expecter { + return &BalanceMonitor_Expecter{mock: &_m.Mock} +} + // Close provides a mock function with given fields: func (_m *BalanceMonitor) Close() error { ret := _m.Called() @@ -36,6 +44,33 @@ func (_m *BalanceMonitor) Close() error { return r0 } +// BalanceMonitor_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close' +type BalanceMonitor_Close_Call struct { + *mock.Call +} + +// Close is a helper method to define mock.On call +func (_e *BalanceMonitor_Expecter) Close() *BalanceMonitor_Close_Call { + return &BalanceMonitor_Close_Call{Call: _e.mock.On("Close")} +} + +func (_c *BalanceMonitor_Close_Call) Run(run func()) *BalanceMonitor_Close_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *BalanceMonitor_Close_Call) Return(_a0 error) *BalanceMonitor_Close_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *BalanceMonitor_Close_Call) RunAndReturn(run func() error) *BalanceMonitor_Close_Call { + _c.Call.Return(run) + return _c +} + // GetEthBalance provides a mock function with given fields: _a0 func (_m *BalanceMonitor) GetEthBalance(_a0 common.Address) *assets.Eth { ret := _m.Called(_a0) @@ -56,6 +91,34 @@ func (_m *BalanceMonitor) GetEthBalance(_a0 common.Address) *assets.Eth { return r0 } +// BalanceMonitor_GetEthBalance_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetEthBalance' +type BalanceMonitor_GetEthBalance_Call struct { + *mock.Call +} + +// GetEthBalance is a helper method to define mock.On call +// - _a0 common.Address +func (_e *BalanceMonitor_Expecter) GetEthBalance(_a0 interface{}) *BalanceMonitor_GetEthBalance_Call { + return &BalanceMonitor_GetEthBalance_Call{Call: _e.mock.On("GetEthBalance", _a0)} +} + +func (_c *BalanceMonitor_GetEthBalance_Call) Run(run func(_a0 common.Address)) *BalanceMonitor_GetEthBalance_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(common.Address)) + }) + return _c +} + +func (_c *BalanceMonitor_GetEthBalance_Call) Return(_a0 *assets.Eth) *BalanceMonitor_GetEthBalance_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *BalanceMonitor_GetEthBalance_Call) RunAndReturn(run func(common.Address) *assets.Eth) *BalanceMonitor_GetEthBalance_Call { + _c.Call.Return(run) + return _c +} + // HealthReport provides a mock function with given fields: func (_m *BalanceMonitor) HealthReport() map[string]error { ret := _m.Called() @@ -76,6 +139,33 @@ func (_m *BalanceMonitor) HealthReport() map[string]error { return r0 } +// BalanceMonitor_HealthReport_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HealthReport' +type BalanceMonitor_HealthReport_Call struct { + *mock.Call +} + +// HealthReport is a helper method to define mock.On call +func (_e *BalanceMonitor_Expecter) HealthReport() *BalanceMonitor_HealthReport_Call { + return &BalanceMonitor_HealthReport_Call{Call: _e.mock.On("HealthReport")} +} + +func (_c *BalanceMonitor_HealthReport_Call) Run(run func()) *BalanceMonitor_HealthReport_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *BalanceMonitor_HealthReport_Call) Return(_a0 map[string]error) *BalanceMonitor_HealthReport_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *BalanceMonitor_HealthReport_Call) RunAndReturn(run func() map[string]error) *BalanceMonitor_HealthReport_Call { + _c.Call.Return(run) + return _c +} + // Name provides a mock function with given fields: func (_m *BalanceMonitor) Name() string { ret := _m.Called() @@ -94,11 +184,67 @@ func (_m *BalanceMonitor) Name() string { return r0 } +// BalanceMonitor_Name_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Name' +type BalanceMonitor_Name_Call struct { + *mock.Call +} + +// Name is a helper method to define mock.On call +func (_e *BalanceMonitor_Expecter) Name() *BalanceMonitor_Name_Call { + return &BalanceMonitor_Name_Call{Call: _e.mock.On("Name")} +} + +func (_c *BalanceMonitor_Name_Call) Run(run func()) *BalanceMonitor_Name_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *BalanceMonitor_Name_Call) Return(_a0 string) *BalanceMonitor_Name_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *BalanceMonitor_Name_Call) RunAndReturn(run func() string) *BalanceMonitor_Name_Call { + _c.Call.Return(run) + return _c +} + // OnNewLongestChain provides a mock function with given fields: ctx, head func (_m *BalanceMonitor) OnNewLongestChain(ctx context.Context, head *types.Head) { _m.Called(ctx, head) } +// BalanceMonitor_OnNewLongestChain_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OnNewLongestChain' +type BalanceMonitor_OnNewLongestChain_Call struct { + *mock.Call +} + +// OnNewLongestChain is a helper method to define mock.On call +// - ctx context.Context +// - head *types.Head +func (_e *BalanceMonitor_Expecter) OnNewLongestChain(ctx interface{}, head interface{}) *BalanceMonitor_OnNewLongestChain_Call { + return &BalanceMonitor_OnNewLongestChain_Call{Call: _e.mock.On("OnNewLongestChain", ctx, head)} +} + +func (_c *BalanceMonitor_OnNewLongestChain_Call) Run(run func(ctx context.Context, head *types.Head)) *BalanceMonitor_OnNewLongestChain_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*types.Head)) + }) + return _c +} + +func (_c *BalanceMonitor_OnNewLongestChain_Call) Return() *BalanceMonitor_OnNewLongestChain_Call { + _c.Call.Return() + return _c +} + +func (_c *BalanceMonitor_OnNewLongestChain_Call) RunAndReturn(run func(context.Context, *types.Head)) *BalanceMonitor_OnNewLongestChain_Call { + _c.Call.Return(run) + return _c +} + // Ready provides a mock function with given fields: func (_m *BalanceMonitor) Ready() error { ret := _m.Called() @@ -117,6 +263,33 @@ func (_m *BalanceMonitor) Ready() error { return r0 } +// BalanceMonitor_Ready_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Ready' +type BalanceMonitor_Ready_Call struct { + *mock.Call +} + +// Ready is a helper method to define mock.On call +func (_e *BalanceMonitor_Expecter) Ready() *BalanceMonitor_Ready_Call { + return &BalanceMonitor_Ready_Call{Call: _e.mock.On("Ready")} +} + +func (_c *BalanceMonitor_Ready_Call) Run(run func()) *BalanceMonitor_Ready_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *BalanceMonitor_Ready_Call) Return(_a0 error) *BalanceMonitor_Ready_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *BalanceMonitor_Ready_Call) RunAndReturn(run func() error) *BalanceMonitor_Ready_Call { + _c.Call.Return(run) + return _c +} + // Start provides a mock function with given fields: _a0 func (_m *BalanceMonitor) Start(_a0 context.Context) error { ret := _m.Called(_a0) @@ -135,6 +308,34 @@ func (_m *BalanceMonitor) Start(_a0 context.Context) error { return r0 } +// BalanceMonitor_Start_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Start' +type BalanceMonitor_Start_Call struct { + *mock.Call +} + +// Start is a helper method to define mock.On call +// - _a0 context.Context +func (_e *BalanceMonitor_Expecter) Start(_a0 interface{}) *BalanceMonitor_Start_Call { + return &BalanceMonitor_Start_Call{Call: _e.mock.On("Start", _a0)} +} + +func (_c *BalanceMonitor_Start_Call) Run(run func(_a0 context.Context)) *BalanceMonitor_Start_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *BalanceMonitor_Start_Call) Return(_a0 error) *BalanceMonitor_Start_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *BalanceMonitor_Start_Call) RunAndReturn(run func(context.Context) error) *BalanceMonitor_Start_Call { + _c.Call.Return(run) + return _c +} + // NewBalanceMonitor creates a new instance of BalanceMonitor. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewBalanceMonitor(t interface { diff --git a/core/chains/evm/monitor/balance.go b/core/chains/evm/monitor/balance.go index 5ef41b63be1..1f5275c13fb 100644 --- a/core/chains/evm/monitor/balance.go +++ b/core/chains/evm/monitor/balance.go @@ -24,7 +24,6 @@ import ( evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" ) -//go:generate mockery --quiet --name BalanceMonitor --output ../mocks/ --case=underscore type ( // BalanceMonitor checks the balance for each key on every new head BalanceMonitor interface { @@ -34,14 +33,15 @@ type ( } balanceMonitor struct { - services.StateMachine - logger logger.Logger + services.Service + eng *services.Engine + ethClient evmclient.Client chainID *big.Int chainIDStr string ethKeyStore keystore.Eth ethBalances map[gethCommon.Address]*assets.Eth - ethBalancesMtx *sync.RWMutex + ethBalancesMtx sync.RWMutex sleeperTask *utils.SleeperTask } @@ -54,62 +54,41 @@ var _ BalanceMonitor = (*balanceMonitor)(nil) func NewBalanceMonitor(ethClient evmclient.Client, ethKeyStore keystore.Eth, lggr logger.Logger) *balanceMonitor { chainId := ethClient.ConfiguredChainID() bm := &balanceMonitor{ - services.StateMachine{}, - logger.Named(lggr, "BalanceMonitor"), - ethClient, - chainId, - chainId.String(), - ethKeyStore, - make(map[gethCommon.Address]*assets.Eth), - new(sync.RWMutex), - nil, + ethClient: ethClient, + chainID: chainId, + chainIDStr: chainId.String(), + ethKeyStore: ethKeyStore, + ethBalances: make(map[gethCommon.Address]*assets.Eth), } + bm.Service, bm.eng = services.Config{ + Name: "BalanceMonitor", + Start: bm.start, + Close: bm.close, + }.NewServiceEngine(lggr) bm.sleeperTask = utils.NewSleeperTask(&worker{bm: bm}) return bm } -func (bm *balanceMonitor) Start(ctx context.Context) error { - return bm.StartOnce("BalanceMonitor", func() error { - // Always query latest balance on start - (&worker{bm}).WorkCtx(ctx) - return nil - }) -} - -// Close shuts down the BalanceMonitor, should not be used after this -func (bm *balanceMonitor) Close() error { - return bm.StopOnce("BalanceMonitor", func() error { - return bm.sleeperTask.Stop() - }) -} - -func (bm *balanceMonitor) Ready() error { +func (bm *balanceMonitor) start(ctx context.Context) error { + // Always query latest balance on start + (&worker{bm}).WorkCtx(ctx) return nil } -func (bm *balanceMonitor) Name() string { - return bm.logger.Name() -} - -func (bm *balanceMonitor) HealthReport() map[string]error { - return map[string]error{bm.Name(): bm.Healthy()} +// Close shuts down the BalanceMonitor, should not be used after this +func (bm *balanceMonitor) close() error { + return bm.sleeperTask.Stop() } // OnNewLongestChain checks the balance for each key -func (bm *balanceMonitor) OnNewLongestChain(_ context.Context, head *evmtypes.Head) { - ok := bm.IfStarted(func() { - bm.checkBalance(head) - }) +func (bm *balanceMonitor) OnNewLongestChain(_ context.Context, _ *evmtypes.Head) { + bm.eng.Debugw("BalanceMonitor: signalling balance worker") + ok := bm.sleeperTask.WakeUpIfStarted() if !ok { - bm.logger.Debugw("BalanceMonitor: ignoring OnNewLongestChain call, balance monitor is not started", "state", bm.State()) + bm.eng.Debugw("BalanceMonitor: ignoring OnNewLongestChain call, balance monitor is not started", "state", bm.sleeperTask.State()) } } -func (bm *balanceMonitor) checkBalance(head *evmtypes.Head) { - bm.logger.Debugw("BalanceMonitor: signalling balance worker") - bm.sleeperTask.WakeUp() -} - func (bm *balanceMonitor) updateBalance(ethBal assets.Eth, address gethCommon.Address) { bm.promUpdateEthBalance(ðBal, address) @@ -118,7 +97,7 @@ func (bm *balanceMonitor) updateBalance(ethBal assets.Eth, address gethCommon.Ad bm.ethBalances[address] = ðBal bm.ethBalancesMtx.Unlock() - lgr := logger.Named(bm.logger, "BalanceLog") + lgr := logger.Named(bm.eng, "BalanceLog") lgr = logger.With(lgr, "address", address.Hex(), "ethBalance", ethBal.String(), @@ -152,7 +131,7 @@ func (bm *balanceMonitor) promUpdateEthBalance(balance *assets.Eth, from gethCom balanceFloat, err := ApproximateFloat64(balance) if err != nil { - bm.logger.Error(fmt.Errorf("updatePrometheusEthBalance: %v", err)) + bm.eng.Error(fmt.Errorf("updatePrometheusEthBalance: %v", err)) return } @@ -175,7 +154,7 @@ func (w *worker) Work() { func (w *worker) WorkCtx(ctx context.Context) { enabledAddresses, err := w.bm.ethKeyStore.EnabledAddressesForChain(ctx, w.bm.chainID) if err != nil { - w.bm.logger.Error("BalanceMonitor: error getting keys", err) + w.bm.eng.Error("BalanceMonitor: error getting keys", err) } var wg sync.WaitGroup @@ -199,12 +178,12 @@ func (w *worker) checkAccountBalance(ctx context.Context, address gethCommon.Add bal, err := w.bm.ethClient.BalanceAt(ctx, address, nil) if err != nil { - w.bm.logger.Errorw(fmt.Sprintf("BalanceMonitor: error getting balance for key %s", address.Hex()), + w.bm.eng.Errorw(fmt.Sprintf("BalanceMonitor: error getting balance for key %s", address.Hex()), "err", err, "address", address, ) } else if bal == nil { - w.bm.logger.Errorw(fmt.Sprintf("BalanceMonitor: error getting balance for key %s: invariant violation, bal may not be nil", address.Hex()), + w.bm.eng.Errorw(fmt.Sprintf("BalanceMonitor: error getting balance for key %s: invariant violation, bal may not be nil", address.Hex()), "err", err, "address", address, ) diff --git a/core/chains/evm/testutils/client.go b/core/chains/evm/testutils/client.go index 89c97b01e6d..1e5523fbff9 100644 --- a/core/chains/evm/testutils/client.go +++ b/core/chains/evm/testutils/client.go @@ -148,8 +148,12 @@ func (ts *testWSServer) newWSHandler(chainID *big.Int, callback JSONRPCHandler) ts.t.Log("Received message", string(data)) req := gjson.ParseBytes(data) if !req.IsObject() { - ts.t.Logf("Request must be object: %v", req.Type) - return + if isSingleObjectArray := req.IsArray() && len(req.Array()) == 1; !isSingleObjectArray { + ts.t.Logf("Request must be object: %v", req.Type) + return + } + + req = req.Array()[0] } if e := req.Get("error"); e.Exists() { ts.t.Logf("Received jsonrpc error: %v", e) diff --git a/core/chains/evm/txmgr/attempts.go b/core/chains/evm/txmgr/attempts.go index 8566adcb5c5..2fc444071e7 100644 --- a/core/chains/evm/txmgr/attempts.go +++ b/core/chains/evm/txmgr/attempts.go @@ -34,8 +34,6 @@ type evmTxAttemptBuilder struct { type evmTxAttemptBuilderFeeConfig interface { EIP1559DynamicFees() bool - TipCapMin() *assets.Wei - PriceMin() *assets.Wei PriceMaxKey(common.Address) *assets.Wei LimitDefault() uint64 } @@ -58,7 +56,7 @@ func (c *evmTxAttemptBuilder) NewTxAttempt(ctx context.Context, etx Tx, lggr log // used for L2 re-estimation on broadcasting (note EIP1559 must be disabled otherwise this will fail with mismatched fees + tx type) func (c *evmTxAttemptBuilder) NewTxAttemptWithType(ctx context.Context, etx Tx, lggr logger.Logger, txType int, opts ...feetypes.Opt) (attempt TxAttempt, fee gas.EvmFee, feeLimit uint64, retryable bool, err error) { keySpecificMaxGasPriceWei := c.feeConfig.PriceMaxKey(etx.FromAddress) - fee, feeLimit, err = c.EvmFeeEstimator.GetFee(ctx, etx.EncodedPayload, etx.FeeLimit, keySpecificMaxGasPriceWei, opts...) + fee, feeLimit, err = c.EvmFeeEstimator.GetFee(ctx, etx.EncodedPayload, etx.FeeLimit, keySpecificMaxGasPriceWei, &etx.FromAddress, &etx.ToAddress, opts...) if err != nil { return attempt, fee, feeLimit, true, pkgerrors.Wrap(err, "failed to get fee") // estimator errors are retryable } @@ -71,8 +69,8 @@ func (c *evmTxAttemptBuilder) NewTxAttemptWithType(ctx context.Context, etx Tx, // used in the txm broadcaster + confirmer when tx ix rejected for too low fee or is not included in a timely manner func (c *evmTxAttemptBuilder) NewBumpTxAttempt(ctx context.Context, etx Tx, previousAttempt TxAttempt, priorAttempts []TxAttempt, lggr logger.Logger) (attempt TxAttempt, bumpedFee gas.EvmFee, bumpedFeeLimit uint64, retryable bool, err error) { keySpecificMaxGasPriceWei := c.feeConfig.PriceMaxKey(etx.FromAddress) - - bumpedFee, bumpedFeeLimit, err = c.EvmFeeEstimator.BumpFee(ctx, previousAttempt.TxFee, etx.FeeLimit, keySpecificMaxGasPriceWei, newEvmPriorAttempts(priorAttempts)) + // Use the fee limit from the previous attempt to maintain limits adjusted for 2D fees or by estimation + bumpedFee, bumpedFeeLimit, err = c.EvmFeeEstimator.BumpFee(ctx, previousAttempt.TxFee, previousAttempt.ChainSpecificFeeLimit, keySpecificMaxGasPriceWei, newEvmPriorAttempts(priorAttempts)) if err != nil { return attempt, bumpedFee, bumpedFeeLimit, true, pkgerrors.Wrap(err, "failed to bump fee") // estimator errors are retryable } @@ -172,7 +170,7 @@ func (c *evmTxAttemptBuilder) NewEmptyTxAttempt(ctx context.Context, nonce evmty } func (c *evmTxAttemptBuilder) newDynamicFeeAttempt(ctx context.Context, etx Tx, fee gas.DynamicFee, gasLimit uint64) (attempt TxAttempt, err error) { - if err = validateDynamicFeeGas(c.feeConfig, c.feeConfig.TipCapMin(), fee, etx); err != nil { + if err = validateDynamicFeeGas(c.feeConfig, fee, etx); err != nil { return attempt, pkgerrors.Wrap(err, "error validating gas") } @@ -208,7 +206,7 @@ type keySpecificEstimator interface { // validateDynamicFeeGas is a sanity check - we have other checks elsewhere, but this // makes sure we _never_ create an invalid attempt -func validateDynamicFeeGas(kse keySpecificEstimator, tipCapMinimum *assets.Wei, fee gas.DynamicFee, etx Tx) error { +func validateDynamicFeeGas(kse keySpecificEstimator, fee gas.DynamicFee, etx Tx) error { gasTipCap, gasFeeCap := fee.TipCap, fee.FeeCap if gasTipCap == nil { @@ -235,11 +233,6 @@ func validateDynamicFeeGas(kse keySpecificEstimator, tipCapMinimum *assets.Wei, if gasFeeCap.Cmp(max) > 0 { return pkgerrors.Errorf("cannot create tx attempt: specified gas fee cap of %s would exceed max configured gas price of %s for key %s", gasFeeCap.String(), max.String(), etx.FromAddress.String()) } - // Tip must be above minimum - minTip := tipCapMinimum - if gasTipCap.Cmp(minTip) < 0 { - return pkgerrors.Errorf("cannot create tx attempt: specified gas tip cap of %s is below min configured gas tip of %s for key %s", gasTipCap.String(), minTip.String(), etx.FromAddress.String()) - } return nil } @@ -257,7 +250,7 @@ func newDynamicFeeTransaction(nonce uint64, to common.Address, value *big.Int, g } func (c *evmTxAttemptBuilder) newLegacyAttempt(ctx context.Context, etx Tx, gasPrice *assets.Wei, gasLimit uint64) (attempt TxAttempt, err error) { - if err = validateLegacyGas(c.feeConfig, c.feeConfig.PriceMin(), gasPrice, etx); err != nil { + if err = validateLegacyGas(c.feeConfig, gasPrice, etx); err != nil { return attempt, pkgerrors.Wrap(err, "error validating gas") } @@ -290,7 +283,7 @@ func (c *evmTxAttemptBuilder) newLegacyAttempt(ctx context.Context, etx Tx, gasP // validateLegacyGas is a sanity check - we have other checks elsewhere, but this // makes sure we _never_ create an invalid attempt -func validateLegacyGas(kse keySpecificEstimator, minGasPriceWei, gasPrice *assets.Wei, etx Tx) error { +func validateLegacyGas(kse keySpecificEstimator, gasPrice *assets.Wei, etx Tx) error { if gasPrice == nil { panic("gas price missing") } @@ -298,10 +291,6 @@ func validateLegacyGas(kse keySpecificEstimator, minGasPriceWei, gasPrice *asset if gasPrice.Cmp(max) > 0 { return pkgerrors.Errorf("cannot create tx attempt: specified gas price of %s would exceed max configured gas price of %s for key %s", gasPrice.String(), max.String(), etx.FromAddress.String()) } - min := minGasPriceWei - if gasPrice.Cmp(min) < 0 { - return pkgerrors.Errorf("cannot create tx attempt: specified gas price of %s is below min configured gas price of %s for key %s", gasPrice.String(), min.String(), etx.FromAddress.String()) - } return nil } diff --git a/core/chains/evm/txmgr/attempts_test.go b/core/chains/evm/txmgr/attempts_test.go index 6be8cd7067b..df88835384f 100644 --- a/core/chains/evm/txmgr/attempts_test.go +++ b/core/chains/evm/txmgr/attempts_test.go @@ -171,9 +171,6 @@ func TestTxm_NewDynamicFeeTx(t *testing.T) { {"ignores global min gas price", assets.GWei(5), assets.GWei(5), func(c *toml.EVMConfig) { c.GasEstimator.PriceMin = assets.GWei(6) }, ""}, - {"tip cap below min allowed", assets.GWei(5), assets.GWei(5), func(c *toml.EVMConfig) { - c.GasEstimator.TipCapMin = assets.GWei(6) - }, "specified gas tip cap of 5 gwei is below min configured gas tip of 6 gwei"}, } for _, tt := range cases { @@ -339,7 +336,7 @@ func TestTxm_NewCustomTxAttempt_NonRetryableErrors(t *testing.T) { func TestTxm_EvmTxAttemptBuilder_RetryableEstimatorError(t *testing.T) { est := gasmocks.NewEvmFeeEstimator(t) - est.On("GetFee", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(gas.EvmFee{}, uint64(0), pkgerrors.New("fail")) + est.On("GetFee", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(gas.EvmFee{}, uint64(0), pkgerrors.New("fail")) est.On("BumpFee", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(gas.EvmFee{}, uint64(0), pkgerrors.New("fail")) kst := ksmocks.NewEth(t) diff --git a/core/chains/evm/txmgr/broadcaster_test.go b/core/chains/evm/txmgr/broadcaster_test.go index 3559c329dee..439076cfa88 100644 --- a/core/chains/evm/txmgr/broadcaster_test.go +++ b/core/chains/evm/txmgr/broadcaster_test.go @@ -29,11 +29,14 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" commonclient "github.com/smartcontractkit/chainlink/v2/common/client" + commmonfee "github.com/smartcontractkit/chainlink/v2/common/fee" txmgrcommon "github.com/smartcontractkit/chainlink/v2/common/txmgr" txmgrtypes "github.com/smartcontractkit/chainlink/v2/common/txmgr/types" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" evmconfig "github.com/smartcontractkit/chainlink/v2/core/chains/evm/config" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/config/chaintype" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/gas" gasmocks "github.com/smartcontractkit/chainlink/v2/core/chains/evm/gas/mocks" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/keystore" @@ -42,11 +45,11 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/chains/evm/txmgr" evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" - "github.com/smartcontractkit/chainlink/v2/core/internal/cltest/heavyweight" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/configtest" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/evmtest" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/pgtest" "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" + "github.com/smartcontractkit/chainlink/v2/core/utils/testutils/heavyweight" ) // NewEthBroadcaster creates a new txmgr.EthBroadcaster for use in testing. @@ -68,9 +71,9 @@ func NewTestEthBroadcaster( estimator := gas.NewEvmFeeEstimator(lggr, func(lggr logger.Logger) gas.EvmEstimator { return gas.NewFixedPriceEstimator(config.EVM().GasEstimator(), nil, ge.BlockHistory(), lggr, nil) - }, ge.EIP1559DynamicFees(), ge) + }, ge.EIP1559DynamicFees(), ge, ethClient) txBuilder := txmgr.NewEvmTxAttemptBuilder(*ethClient.ConfiguredChainID(), ge, keyStore, estimator) - ethBroadcaster := txmgrcommon.NewBroadcaster(txStore, txmgr.NewEvmTxmClient(ethClient, nil), txmgr.NewEvmTxmConfig(config.EVM()), txmgr.NewEvmTxmFeeConfig(config.EVM().GasEstimator()), config.EVM().Transactions(), gconfig.Database().Listener(), keyStore, txBuilder, nonceTracker, lggr, checkerFactory, nonceAutoSync) + ethBroadcaster := txmgrcommon.NewBroadcaster(txStore, txmgr.NewEvmTxmClient(ethClient, nil), txmgr.NewEvmTxmConfig(config.EVM()), txmgr.NewEvmTxmFeeConfig(config.EVM().GasEstimator()), config.EVM().Transactions(), gconfig.Database().Listener(), keyStore, txBuilder, nonceTracker, lggr, checkerFactory, nonceAutoSync, "") // Mark instance as test ethBroadcaster.XXXTestDisableUnstartedTxAutoProcessing() @@ -101,6 +104,7 @@ func TestEthBroadcaster_Lifecycle(t *testing.T) { logger.Test(t), &testCheckerFactory{}, false, + "", ) // Can't close an unstarted instance @@ -159,6 +163,7 @@ func TestEthBroadcaster_LoadNextSequenceMapFailure_StartupSuccess(t *testing.T) logger.Test(t), &testCheckerFactory{}, false, + "", ) // Instance starts without error even if loading next sequence map fails @@ -518,6 +523,25 @@ func TestEthBroadcaster_ProcessUnstartedEthTxs_Success(t *testing.T) { assert.True(t, ethTx.Error.Valid) assert.Equal(t, "transaction reverted during simulation: json-rpc error { Code = 42, Message = 'oh no, it reverted', Data = 'KqYi' }", ethTx.Error.String) }) + + t.Run("terminally stuck transaction is marked as fatal", func(t *testing.T) { + terminallyStuckError := "failed to add tx to the pool: not enough step counters to continue the execution" + etx := mustCreateUnstartedTx(t, txStore, fromAddress, toAddress, []byte{42, 42, 0}, gasLimit, big.Int(assets.NewEthValue(243)), testutils.FixtureChainID) + ethClient.On("SendTransactionReturnCode", mock.Anything, mock.MatchedBy(func(tx *gethTypes.Transaction) bool { + return tx.Nonce() == uint64(346) && tx.Value().Cmp(big.NewInt(243)) == 0 + }), fromAddress).Return(commonclient.Fatal, errors.New(terminallyStuckError)).Once() + + // Start processing unstarted transactions + retryable, err := eb.ProcessUnstartedTxs(tests.Context(t), fromAddress) + assert.NoError(t, err) + assert.False(t, retryable) + + dbTx, err := txStore.FindTxWithAttempts(ctx, etx.ID) + require.NoError(t, err) + assert.Equal(t, txmgrcommon.TxFatalError, dbTx.State) + assert.True(t, dbTx.Error.Valid) + assert.Equal(t, terminallyStuckError, dbTx.Error.String) + }) }) } @@ -620,7 +644,7 @@ func TestEthBroadcaster_ProcessUnstartedEthTxs_OptimisticLockingOnEthTx(t *testi chStartEstimate := make(chan struct{}) chBlock := make(chan struct{}) - estimator.On("GetFee", mock.Anything, mock.Anything, mock.Anything, ccfg.EVM().GasEstimator().PriceMaxKey(fromAddress)).Return(gas.EvmFee{Legacy: assets.GWei(32)}, uint64(500), nil).Run(func(_ mock.Arguments) { + estimator.On("GetFee", mock.Anything, mock.Anything, mock.Anything, ccfg.EVM().GasEstimator().PriceMaxKey(fromAddress), mock.Anything, mock.Anything).Return(gas.EvmFee{Legacy: assets.GWei(32)}, uint64(500), nil).Run(func(_ mock.Arguments) { close(chStartEstimate) <-chBlock }).Once() @@ -638,6 +662,7 @@ func TestEthBroadcaster_ProcessUnstartedEthTxs_OptimisticLockingOnEthTx(t *testi logger.Test(t), &testCheckerFactory{}, false, + "", ) eb.XXXTestDisableUnstartedTxAutoProcessing() @@ -1154,10 +1179,10 @@ func TestEthBroadcaster_ProcessUnstartedEthTxs_Errors(t *testing.T) { t.Run("callback set by ctor", func(t *testing.T) { estimator := gas.NewEvmFeeEstimator(lggr, func(lggr logger.Logger) gas.EvmEstimator { return gas.NewFixedPriceEstimator(evmcfg.EVM().GasEstimator(), nil, evmcfg.EVM().GasEstimator().BlockHistory(), lggr, nil) - }, evmcfg.EVM().GasEstimator().EIP1559DynamicFees(), evmcfg.EVM().GasEstimator()) + }, evmcfg.EVM().GasEstimator().EIP1559DynamicFees(), evmcfg.EVM().GasEstimator(), ethClient) txBuilder := txmgr.NewEvmTxAttemptBuilder(*ethClient.ConfiguredChainID(), evmcfg.EVM().GasEstimator(), ethKeyStore, estimator) localNextNonce = getLocalNextNonce(t, nonceTracker, fromAddress) - eb2 := txmgr.NewEvmBroadcaster(txStore, txmClient, txmgr.NewEvmTxmConfig(evmcfg.EVM()), txmgr.NewEvmTxmFeeConfig(evmcfg.EVM().GasEstimator()), evmcfg.EVM().Transactions(), cfg.Database().Listener(), ethKeyStore, txBuilder, lggr, &testCheckerFactory{}, false) + eb2 := txmgr.NewEvmBroadcaster(txStore, txmClient, txmgr.NewEvmTxmConfig(evmcfg.EVM()), txmgr.NewEvmTxmFeeConfig(evmcfg.EVM().GasEstimator()), evmcfg.EVM().Transactions(), cfg.Database().Listener(), ethKeyStore, txBuilder, lggr, &testCheckerFactory{}, false, "") retryable, err := eb2.ProcessUnstartedTxs(ctx, fromAddress) assert.NoError(t, err) assert.False(t, retryable) @@ -1499,7 +1524,7 @@ func TestEthBroadcaster_ProcessUnstartedEthTxs_Errors(t *testing.T) { pgtest.MustExec(t, db, `DELETE FROM evm.txes WHERE nonce = $1`, localNextNonce) }) - t.Run("eth tx is left in progress if eth node returns insufficient eth", func(t *testing.T) { + t.Run("tx is left in progress and its attempt gets replaced with a new re-estimated attempt if node returns insufficient eth", func(t *testing.T) { insufficientEthError := "insufficient funds for transfer" localNextNonce := getLocalNextNonce(t, nonceTracker, fromAddress) etx := mustCreateUnstartedTx(t, txStore, fromAddress, toAddress, encodedPayload, gasLimit, value, testutils.FixtureChainID) @@ -1595,31 +1620,17 @@ func TestEthBroadcaster_ProcessUnstartedEthTxs_Errors(t *testing.T) { // configured for the transaction pool. // This is a configuration error by the node operator, since it means they set the base gas level too low. underpricedError := "transaction underpriced" - localNextNonce := getLocalNextNonce(t, nonceTracker, fromAddress) mustCreateUnstartedTx(t, txStore, fromAddress, toAddress, encodedPayload, gasLimit, value, testutils.FixtureChainID) - // Check gas tip cap verification - evmcfg2 := evmtest.NewChainScopedConfig(t, configtest.NewGeneralConfig(t, func(c *chainlink.Config, s *chainlink.Secrets) { - c.EVM[0].GasEstimator.EIP1559DynamicFees = ptr(true) - c.EVM[0].GasEstimator.TipCapDefault = assets.NewWeiI(0) - })) - ethClient.On("PendingNonceAt", mock.Anything, fromAddress).Return(localNextNonce, nil).Once() - eb2 := NewTestEthBroadcaster(t, txStore, ethClient, ethKeyStore, cfg, evmcfg2, &testCheckerFactory{}, false, nonceTracker) - - retryable, err := eb2.ProcessUnstartedTxs(ctx, fromAddress) - require.Error(t, err) - require.Contains(t, err.Error(), "specified gas tip cap of 0 is below min configured gas tip of 1 wei for key") - assert.True(t, retryable) - gasTipCapDefault := assets.NewWeiI(42) - evmcfg2 = evmtest.NewChainScopedConfig(t, configtest.NewGeneralConfig(t, func(c *chainlink.Config, s *chainlink.Secrets) { + evmcfg2 := evmtest.NewChainScopedConfig(t, configtest.NewGeneralConfig(t, func(c *chainlink.Config, s *chainlink.Secrets) { c.EVM[0].GasEstimator.EIP1559DynamicFees = ptr(true) c.EVM[0].GasEstimator.TipCapDefault = gasTipCapDefault })) - localNextNonce = getLocalNextNonce(t, nonceTracker, fromAddress) + localNextNonce := getLocalNextNonce(t, nonceTracker, fromAddress) ethClient.On("PendingNonceAt", mock.Anything, fromAddress).Return(localNextNonce, nil).Once() - eb2 = NewTestEthBroadcaster(t, txStore, ethClient, ethKeyStore, cfg, evmcfg2, &testCheckerFactory{}, false, nonceTracker) + eb2 := NewTestEthBroadcaster(t, txStore, ethClient, ethKeyStore, cfg, evmcfg2, &testCheckerFactory{}, false, nonceTracker) // Second was underpriced but above minimum ethClient.On("SendTransactionReturnCode", mock.Anything, mock.MatchedBy(func(tx *gethTypes.Transaction) bool { @@ -1634,7 +1645,7 @@ func TestEthBroadcaster_ProcessUnstartedEthTxs_Errors(t *testing.T) { return tx.Nonce() == localNextNonce && tx.GasTipCap().Cmp(big.NewInt(0).Add(gasTipCapDefault.ToInt(), big.NewInt(0).Mul(evmcfg2.EVM().GasEstimator().BumpMin().ToInt(), big.NewInt(2)))) == 0 }), fromAddress).Return(commonclient.Successful, nil).Once() - retryable, err = eb2.ProcessUnstartedTxs(ctx, fromAddress) + retryable, err := eb2.ProcessUnstartedTxs(ctx, fromAddress) require.NoError(t, err) assert.False(t, retryable) @@ -1643,6 +1654,73 @@ func TestEthBroadcaster_ProcessUnstartedEthTxs_Errors(t *testing.T) { }) } +func TestEthBroadcaster_ProcessUnstartedEthTxs_GasEstimationError(t *testing.T) { + toAddress := testutils.NewAddress() + value := big.Int(assets.NewEthValue(142)) + gasLimit := uint64(242) + encodedPayload := []byte{0, 1} + + db := pgtest.NewSqlxDB(t) + cfg := configtest.NewTestGeneralConfig(t) + cfg.EVMConfigs()[0].GasEstimator.EstimateLimit = ptr(true) // Enabled gas limit estimation + limitMultiplier := float32(1.25) + cfg.EVMConfigs()[0].GasEstimator.LimitMultiplier = ptr(decimal.NewFromFloat32(limitMultiplier)) // Set LimitMultiplier for the buffer + txStore := cltest.NewTestTxStore(t, db) + + ethKeyStore := cltest.NewKeyStore(t, db).Eth() + _, fromAddress := cltest.MustInsertRandomKey(t, ethKeyStore) + + config := evmtest.NewChainScopedConfig(t, cfg) + ethClient := testutils.NewEthClientMockWithDefaultChain(t) + ethClient.On("PendingNonceAt", mock.Anything, fromAddress).Return(uint64(0), nil).Once() + lggr := logger.Test(t) + txmClient := txmgr.NewEvmTxmClient(ethClient, nil) + nonceTracker := txmgr.NewNonceTracker(lggr, txStore, txmClient) + ge := config.EVM().GasEstimator() + estimator := gas.NewEvmFeeEstimator(lggr, func(lggr logger.Logger) gas.EvmEstimator { + return gas.NewFixedPriceEstimator(ge, nil, ge.BlockHistory(), lggr, nil) + }, ge.EIP1559DynamicFees(), ge, ethClient) + txBuilder := txmgr.NewEvmTxAttemptBuilder(*ethClient.ConfiguredChainID(), ge, ethKeyStore, estimator) + eb := txmgrcommon.NewBroadcaster(txStore, txmgr.NewEvmTxmClient(ethClient, nil), txmgr.NewEvmTxmConfig(config.EVM()), txmgr.NewEvmTxmFeeConfig(config.EVM().GasEstimator()), config.EVM().Transactions(), cfg.Database().Listener(), ethKeyStore, txBuilder, nonceTracker, lggr, &testCheckerFactory{}, false, "") + + // Mark instance as test + eb.XXXTestDisableUnstartedTxAutoProcessing() + servicetest.Run(t, eb) + ctx := tests.Context(t) + t.Run("gas limit lowered after estimation", func(t *testing.T) { + estimatedGasLimit := uint64(100) + etx := mustCreateUnstartedTx(t, txStore, fromAddress, toAddress, encodedPayload, gasLimit, value, testutils.FixtureChainID) + ethClient.On("EstimateGas", mock.Anything, mock.Anything).Return(estimatedGasLimit, nil).Once() + ethClient.On("SendTransactionReturnCode", mock.Anything, mock.MatchedBy(func(tx *gethTypes.Transaction) bool { + return tx.Nonce() == uint64(0) + }), fromAddress).Return(commonclient.Successful, nil).Once() + + // Do the thing + retryable, err := eb.ProcessUnstartedTxs(ctx, fromAddress) + assert.NoError(t, err) + assert.False(t, retryable) + + dbEtx, err := txStore.FindTxWithAttempts(ctx, etx.ID) + require.NoError(t, err) + attempt := dbEtx.TxAttempts[0] + require.Equal(t, uint64(float32(estimatedGasLimit)*gas.EstimateGasBuffer), attempt.ChainSpecificFeeLimit) + }) + t.Run("provided gas limit too low, transaction marked as fatal error", func(t *testing.T) { + etx := mustCreateUnstartedTx(t, txStore, fromAddress, toAddress, encodedPayload, gasLimit, value, testutils.FixtureChainID) + ethClient.On("EstimateGas", mock.Anything, mock.Anything).Return(uint64(float32(gasLimit)*limitMultiplier)+1, nil).Once() + + // Do the thing + retryable, err := eb.ProcessUnstartedTxs(ctx, fromAddress) + assert.NoError(t, err) + assert.False(t, retryable) + + dbEtx, err := txStore.FindTxWithAttempts(ctx, etx.ID) + require.NoError(t, err) + require.Equal(t, txmgrcommon.TxFatalError, dbEtx.State) + require.Equal(t, commmonfee.ErrFeeLimitTooLow.Error(), dbEtx.Error.String) + }) +} + func TestEthBroadcaster_ProcessUnstartedEthTxs_KeystoreErrors(t *testing.T) { toAddress := gethCommon.HexToAddress("0x6C03DDA95a2AEd917EeCc6eddD4b9D16E6380411") value := big.Int(assets.NewEthValue(142)) @@ -1737,15 +1815,15 @@ func TestEthBroadcaster_SyncNonce(t *testing.T) { kst := cltest.NewKeyStore(t, db).Eth() _, fromAddress := cltest.RandomKey{Disabled: false}.MustInsertWithState(t, kst) + ethClient := testutils.NewEthClientMockWithDefaultChain(t) estimator := gas.NewEvmFeeEstimator(lggr, func(lggr logger.Logger) gas.EvmEstimator { return gas.NewFixedPriceEstimator(evmcfg.EVM().GasEstimator(), nil, evmcfg.EVM().GasEstimator().BlockHistory(), lggr, nil) - }, evmcfg.EVM().GasEstimator().EIP1559DynamicFees(), evmcfg.EVM().GasEstimator()) + }, evmcfg.EVM().GasEstimator().EIP1559DynamicFees(), evmcfg.EVM().GasEstimator(), ethClient) checkerFactory := &testCheckerFactory{} ge := evmcfg.EVM().GasEstimator() t.Run("does nothing if nonce sync is disabled", func(t *testing.T) { - ethClient := testutils.NewEthClientMockWithDefaultChain(t) txBuilder := txmgr.NewEvmTxAttemptBuilder(*ethClient.ConfiguredChainID(), ge, kst, estimator) kst := ksmocks.NewEth(t) @@ -1753,7 +1831,7 @@ func TestEthBroadcaster_SyncNonce(t *testing.T) { kst.On("EnabledAddressesForChain", mock.Anything, testutils.FixtureChainID).Return(addresses, nil).Once() ethClient.On("PendingNonceAt", mock.Anything, fromAddress).Return(uint64(0), nil).Once() txmClient := txmgr.NewEvmTxmClient(ethClient, nil) - eb := txmgr.NewEvmBroadcaster(txStore, txmClient, evmTxmCfg, txmgr.NewEvmTxmFeeConfig(ge), evmcfg.EVM().Transactions(), cfg.Database().Listener(), kst, txBuilder, lggr, checkerFactory, false) + eb := txmgr.NewEvmBroadcaster(txStore, txmClient, evmTxmCfg, txmgr.NewEvmTxmFeeConfig(ge), evmcfg.EVM().Transactions(), cfg.Database().Listener(), kst, txBuilder, lggr, checkerFactory, false, "") err := eb.Start(ctx) assert.NoError(t, err) @@ -1802,6 +1880,94 @@ func TestEthBroadcaster_NonceTracker_InProgressTx(t *testing.T) { }) } +func TestEthBroadcaster_HederaBroadcastValidation(t *testing.T) { + t.Parallel() + + db := pgtest.NewSqlxDB(t) + cfg := configtest.NewTestGeneralConfig(t) + txStore := cltest.NewTestTxStore(t, db) + ethKeyStore := cltest.NewKeyStore(t, db).Eth() + evmcfg := evmtest.NewChainScopedConfig(t, cfg) + ethClient := testutils.NewEthClientMockWithDefaultChain(t) + lggr, observed := logger.TestObserved(t, zapcore.DebugLevel) + ge := evmcfg.EVM().GasEstimator() + estimator := gas.NewEvmFeeEstimator(lggr, func(lggr logger.Logger) gas.EvmEstimator { + return gas.NewFixedPriceEstimator(evmcfg.EVM().GasEstimator(), nil, ge.BlockHistory(), lggr, nil) + }, ge.EIP1559DynamicFees(), ge, ethClient) + txBuilder := txmgr.NewEvmTxAttemptBuilder(*ethClient.ConfiguredChainID(), ge, ethKeyStore, estimator) + checkerFactory := &txmgr.CheckerFactory{Client: ethClient} + ctx := tests.Context(t) + + t.Run("transaction successfully broadcasted and increments on-chain nonce", func(t *testing.T) { + _, fromAddress := cltest.MustInsertRandomKey(t, ethKeyStore) + localNonce := uint64(0) + ethClient.On("SendTransactionReturnCode", mock.Anything, mock.MatchedBy(func(tx *gethTypes.Transaction) bool { + return tx.Nonce() == localNonce + }), fromAddress).Return(commonclient.Successful, nil).Once() + ethClient.On("SequenceAt", mock.Anything, fromAddress, mock.Anything).Return(evmtypes.Nonce(1), nil).Once() + + mustInsertInProgressEthTxWithAttempt(t, txStore, evmtypes.Nonce(localNonce), fromAddress) + nonceTracker := txmgr.NewNonceTracker(lggr, txStore, txmgr.NewEvmTxmClient(ethClient, nil)) + eb := txmgrcommon.NewBroadcaster(txStore, txmgr.NewEvmTxmClient(ethClient, nil), txmgr.NewEvmTxmConfig(evmcfg.EVM()), txmgr.NewEvmTxmFeeConfig(evmcfg.EVM().GasEstimator()), evmcfg.EVM().Transactions(), cfg.Database().Listener(), ethKeyStore, txBuilder, nonceTracker, lggr, checkerFactory, false, string(chaintype.ChainHedera)) + // Mark instance as test + eb.XXXTestDisableUnstartedTxAutoProcessing() + servicetest.Run(t, eb) + + retryable, err := eb.ProcessUnstartedTxs(ctx, fromAddress) + require.NoError(t, err) + require.False(t, retryable) + }) + + t.Run("transaction successfully broadcasted, failed to increment on-chain nonce, succeeded on bumped retry attempt", func(t *testing.T) { + _, fromAddress := cltest.MustInsertRandomKey(t, ethKeyStore) + localNonce := uint64(0) + ethClient.On("SendTransactionReturnCode", mock.Anything, mock.MatchedBy(func(tx *gethTypes.Transaction) bool { + return tx.Nonce() == localNonce + }), fromAddress).Return(commonclient.Successful, nil).Twice() + ethClient.On("SequenceAt", mock.Anything, fromAddress, mock.Anything).Return(evmtypes.Nonce(0), nil).Once() + ethClient.On("SequenceAt", mock.Anything, fromAddress, mock.Anything).Return(evmtypes.Nonce(1), nil).Once() + + mustInsertInProgressEthTxWithAttempt(t, txStore, evmtypes.Nonce(localNonce), fromAddress) + nonceTracker := txmgr.NewNonceTracker(lggr, txStore, txmgr.NewEvmTxmClient(ethClient, nil)) + eb := txmgrcommon.NewBroadcaster(txStore, txmgr.NewEvmTxmClient(ethClient, nil), txmgr.NewEvmTxmConfig(evmcfg.EVM()), txmgr.NewEvmTxmFeeConfig(evmcfg.EVM().GasEstimator()), evmcfg.EVM().Transactions(), cfg.Database().Listener(), ethKeyStore, txBuilder, nonceTracker, lggr, checkerFactory, false, string(chaintype.ChainHedera)) + // Mark instance as test + eb.XXXTestDisableUnstartedTxAutoProcessing() + servicetest.Run(t, eb) + + retryable, err := eb.ProcessUnstartedTxs(ctx, fromAddress) + tests.AssertLogEventually(t, observed, "Bumped fee on initial send") + require.NoError(t, err) + require.False(t, retryable) + }) + + t.Run("transaction successfully broadcasted, failed to increment on-chain nonce on every retry", func(t *testing.T) { + _, fromAddress := cltest.MustInsertRandomKey(t, ethKeyStore) + localNonce := uint64(0) + ethClient.On("SendTransactionReturnCode", mock.Anything, mock.MatchedBy(func(tx *gethTypes.Transaction) bool { + return tx.Nonce() == localNonce + }), fromAddress).Return(commonclient.Successful, nil).Times(4) + ethClient.On("SequenceAt", mock.Anything, fromAddress, mock.Anything).Return(evmtypes.Nonce(0), nil).Times(4) + + etx := mustInsertInProgressEthTxWithAttempt(t, txStore, evmtypes.Nonce(localNonce), fromAddress) + nonceTracker := txmgr.NewNonceTracker(lggr, txStore, txmgr.NewEvmTxmClient(ethClient, nil)) + eb := txmgrcommon.NewBroadcaster(txStore, txmgr.NewEvmTxmClient(ethClient, nil), txmgr.NewEvmTxmConfig(evmcfg.EVM()), txmgr.NewEvmTxmFeeConfig(evmcfg.EVM().GasEstimator()), evmcfg.EVM().Transactions(), cfg.Database().Listener(), ethKeyStore, txBuilder, nonceTracker, lggr, checkerFactory, false, string(chaintype.ChainHedera)) + // Mark instance as test + eb.XXXTestDisableUnstartedTxAutoProcessing() + servicetest.Run(t, eb) + + retryable, err := eb.ProcessUnstartedTxs(ctx, fromAddress) + tests.AssertLogEventually(t, observed, "Bumped fee on initial send") + require.NoError(t, err) + require.False(t, retryable) + tests.AssertLogEventually(t, observed, "failed to broadcast transaction on hedera after 3 retries") + + etx, err = txStore.FindTxWithAttempts(ctx, etx.ID) + require.NoError(t, err) + require.Equal(t, txmgrcommon.TxFatalError, etx.State) + require.Error(t, etx.GetError(), "failed to broadcast transaction on hedera after 3 retries") + }) +} + type testCheckerFactory struct { err error } diff --git a/core/chains/evm/txmgr/builder.go b/core/chains/evm/txmgr/builder.go index dcf15a4fa23..cbfb8775cfb 100644 --- a/core/chains/evm/txmgr/builder.go +++ b/core/chains/evm/txmgr/builder.go @@ -1,6 +1,7 @@ package txmgr import ( + "context" "math/big" "time" @@ -10,6 +11,7 @@ import ( txmgrtypes "github.com/smartcontractkit/chainlink/v2/common/txmgr/types" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/config" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/config/chaintype" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/forwarders" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/gas" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/keystore" @@ -17,6 +19,10 @@ import ( evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" ) +type latestAndFinalizedBlockHeadTracker interface { + LatestAndFinalizedBlock(ctx context.Context) (latest, finalized *evmtypes.Head, err error) +} + // NewTxm constructs the necessary dependencies for the EvmTxm (broadcaster, confirmer, etc) and returns a new EvmTxManager func NewTxm( ds sqlutil.DataSource, @@ -31,6 +37,7 @@ func NewTxm( logPoller logpoller.LogPoller, keyStore keystore.Eth, estimator gas.EvmFeeEstimator, + headTracker latestAndFinalizedBlockHeadTracker, ) (txm TxManager, err error, ) { @@ -49,15 +56,16 @@ func NewTxm( feeCfg := NewEvmTxmFeeConfig(fCfg) // wrap Evm specific config txmClient := NewEvmTxmClient(client, clientErrors) // wrap Evm specific client chainID := txmClient.ConfiguredChainID() - evmBroadcaster := NewEvmBroadcaster(txStore, txmClient, txmCfg, feeCfg, txConfig, listenerConfig, keyStore, txAttemptBuilder, lggr, checker, chainConfig.NonceAutoSync()) + evmBroadcaster := NewEvmBroadcaster(txStore, txmClient, txmCfg, feeCfg, txConfig, listenerConfig, keyStore, txAttemptBuilder, lggr, checker, chainConfig.NonceAutoSync(), chainConfig.ChainType()) evmTracker := NewEvmTracker(txStore, keyStore, chainID, lggr) stuckTxDetector := NewStuckTxDetector(lggr, client.ConfiguredChainID(), chainConfig.ChainType(), fCfg.PriceMax(), txConfig.AutoPurge(), estimator, txStore, client) - evmConfirmer := NewEvmConfirmer(txStore, txmClient, txmCfg, feeCfg, txConfig, dbConfig, keyStore, txAttemptBuilder, lggr, stuckTxDetector) + evmConfirmer := NewEvmConfirmer(txStore, txmClient, txmCfg, feeCfg, txConfig, dbConfig, keyStore, txAttemptBuilder, lggr, stuckTxDetector, headTracker) + evmFinalizer := NewEvmFinalizer(lggr, client.ConfiguredChainID(), chainConfig.RPCDefaultBatchSize(), txStore, client, headTracker) var evmResender *Resender if txConfig.ResendAfterThreshold() > 0 { evmResender = NewEvmResender(lggr, txStore, txmClient, evmTracker, keyStore, txmgr.DefaultResenderPollInterval, chainConfig, txConfig) } - txm = NewEvmTxm(chainID, txmCfg, txConfig, keyStore, lggr, checker, fwdMgr, txAttemptBuilder, txStore, evmBroadcaster, evmConfirmer, evmResender, evmTracker) + txm = NewEvmTxm(chainID, txmCfg, txConfig, keyStore, lggr, checker, fwdMgr, txAttemptBuilder, txStore, evmBroadcaster, evmConfirmer, evmResender, evmTracker, evmFinalizer) return txm, nil } @@ -76,8 +84,9 @@ func NewEvmTxm( confirmer *Confirmer, resender *Resender, tracker *Tracker, + finalizer Finalizer, ) *Txm { - return txmgr.NewTxm(chainId, cfg, txCfg, keyStore, lggr, checkerFactory, fwdMgr, txAttemptBuilder, txStore, broadcaster, confirmer, resender, tracker, client.NewTxError) + return txmgr.NewTxm(chainId, cfg, txCfg, keyStore, lggr, checkerFactory, fwdMgr, txAttemptBuilder, txStore, broadcaster, confirmer, resender, tracker, finalizer, client.NewTxError) } // NewEvmResender creates a new concrete EvmResender @@ -95,8 +104,8 @@ func NewEvmResender( } // NewEvmReaper instantiates a new EVM-specific reaper object -func NewEvmReaper(lggr logger.Logger, store txmgrtypes.TxHistoryReaper[*big.Int], config EvmReaperConfig, txConfig txmgrtypes.ReaperTransactionsConfig, chainID *big.Int) *Reaper { - return txmgr.NewReaper(lggr, store, config, txConfig, chainID) +func NewEvmReaper(lggr logger.Logger, store txmgrtypes.TxHistoryReaper[*big.Int], txConfig txmgrtypes.ReaperTransactionsConfig, chainID *big.Int) *Reaper { + return txmgr.NewReaper(lggr, store, txConfig, chainID) } // NewEvmConfirmer instantiates a new EVM confirmer @@ -111,8 +120,9 @@ func NewEvmConfirmer( txAttemptBuilder TxAttemptBuilder, lggr logger.Logger, stuckTxDetector StuckTxDetector, + headTracker latestAndFinalizedBlockHeadTracker, ) *Confirmer { - return txmgr.NewConfirmer(txStore, client, chainConfig, feeConfig, txConfig, dbConfig, keystore, txAttemptBuilder, lggr, func(r *evmtypes.Receipt) bool { return r == nil }, stuckTxDetector) + return txmgr.NewConfirmer(txStore, client, chainConfig, feeConfig, txConfig, dbConfig, keystore, txAttemptBuilder, lggr, func(r *evmtypes.Receipt) bool { return r == nil }, stuckTxDetector, headTracker) } // NewEvmTracker instantiates a new EVM tracker for abandoned transactions @@ -138,7 +148,8 @@ func NewEvmBroadcaster( logger logger.Logger, checkerFactory TransmitCheckerFactory, autoSyncNonce bool, + chainType chaintype.ChainType, ) *Broadcaster { nonceTracker := NewNonceTracker(logger, txStore, client) - return txmgr.NewBroadcaster(txStore, client, chainConfig, feeConfig, txConfig, listenerConfig, keystore, txAttemptBuilder, nonceTracker, logger, checkerFactory, autoSyncNonce) + return txmgr.NewBroadcaster(txStore, client, chainConfig, feeConfig, txConfig, listenerConfig, keystore, txAttemptBuilder, nonceTracker, logger, checkerFactory, autoSyncNonce, string(chainType)) } diff --git a/core/chains/evm/txmgr/client.go b/core/chains/evm/txmgr/client.go index 661a180af50..e995080a260 100644 --- a/core/chains/evm/txmgr/client.go +++ b/core/chains/evm/txmgr/client.go @@ -183,3 +183,7 @@ func (c *evmTxmClient) CallContract(ctx context.Context, a TxAttempt, blockNumbe }, blockNumber) return client.ExtractRPCError(errCall) } + +func (c *evmTxmClient) HeadByHash(ctx context.Context, hash common.Hash) (*evmtypes.Head, error) { + return c.client.HeadByHash(ctx, hash) +} diff --git a/core/chains/evm/txmgr/config.go b/core/chains/evm/txmgr/config.go index c34de17369e..af20c9a5901 100644 --- a/core/chains/evm/txmgr/config.go +++ b/core/chains/evm/txmgr/config.go @@ -12,8 +12,6 @@ import ( // ChainConfig encompasses config used by txmgr package // Unless otherwise specified, these should support changing at runtime -// -//go:generate mockery --quiet --recursive --name ChainConfig --output ./mocks/ --case=underscore --structname Config --filename config.go type ChainConfig interface { ChainType() chaintype.ChainType FinalityDepth() uint32 @@ -50,7 +48,6 @@ type ( EvmBroadcasterConfig txmgrtypes.BroadcasterChainConfig EvmConfirmerConfig txmgrtypes.ConfirmerChainConfig EvmResenderConfig txmgrtypes.ResenderChainConfig - EvmReaperConfig txmgrtypes.ReaperChainConfig ) var _ EvmTxmConfig = (*evmTxmConfig)(nil) diff --git a/core/chains/evm/txmgr/confirmer_test.go b/core/chains/evm/txmgr/confirmer_test.go index 6b107b222a6..d63f0cf1de0 100644 --- a/core/chains/evm/txmgr/confirmer_test.go +++ b/core/chains/evm/txmgr/confirmer_test.go @@ -34,6 +34,7 @@ import ( evmconfig "github.com/smartcontractkit/chainlink/v2/core/chains/evm/config" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/gas" gasmocks "github.com/smartcontractkit/chainlink/v2/core/chains/evm/gas/mocks" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/headtracker" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/keystore" ksmocks "github.com/smartcontractkit/chainlink/v2/core/chains/evm/keystore/mocks" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/testutils" @@ -128,10 +129,11 @@ func TestEthConfirmer_Lifecycle(t *testing.T) { newEst := func(logger.Logger) gas.EvmEstimator { return estimator } lggr := logger.Test(t) ge := config.EVM().GasEstimator() - feeEstimator := gas.NewEvmFeeEstimator(lggr, newEst, ge.EIP1559DynamicFees(), ge) + feeEstimator := gas.NewEvmFeeEstimator(lggr, newEst, ge.EIP1559DynamicFees(), ge, ethClient) txBuilder := txmgr.NewEvmTxAttemptBuilder(*ethClient.ConfiguredChainID(), ge, ethKeyStore, feeEstimator) stuckTxDetector := txmgr.NewStuckTxDetector(lggr, testutils.FixtureChainID, "", assets.NewWei(assets.NewEth(100).ToInt()), config.EVM().Transactions().AutoPurge(), feeEstimator, txStore, ethClient) - ec := txmgr.NewEvmConfirmer(txStore, txmgr.NewEvmTxmClient(ethClient, nil), txmgr.NewEvmTxmConfig(config.EVM()), txmgr.NewEvmTxmFeeConfig(ge), config.EVM().Transactions(), gconfig.Database(), ethKeyStore, txBuilder, lggr, stuckTxDetector) + ht := headtracker.NewSimulatedHeadTracker(ethClient, true, 0) + ec := txmgr.NewEvmConfirmer(txStore, txmgr.NewEvmTxmClient(ethClient, nil), txmgr.NewEvmTxmConfig(config.EVM()), txmgr.NewEvmTxmFeeConfig(ge), config.EVM().Transactions(), gconfig.Database(), ethKeyStore, txBuilder, lggr, stuckTxDetector, ht) ctx := tests.Context(t) // Can't close unstarted instance @@ -145,20 +147,29 @@ func TestEthConfirmer_Lifecycle(t *testing.T) { // Can't start an already started instance err = ec.Start(ctx) require.Error(t, err) - head := evmtypes.Head{ + + latestFinalizedHead := &evmtypes.Head{ + Number: 8, + Hash: testutils.NewHash(), + } + // We are guaranteed to receive a latestFinalizedHead. + latestFinalizedHead.IsFinalized.Store(true) + + h9 := &evmtypes.Head{ + Hash: testutils.NewHash(), + Number: 9, + } + h9.Parent.Store(latestFinalizedHead) + head := &evmtypes.Head{ Hash: testutils.NewHash(), Number: 10, - Parent: &evmtypes.Head{ - Hash: testutils.NewHash(), - Number: 9, - Parent: &evmtypes.Head{ - Number: 8, - Hash: testutils.NewHash(), - Parent: nil, - }, - }, } - err = ec.ProcessHead(ctx, &head) + head.Parent.Store(h9) + + ethClient.On("HeadByNumber", mock.Anything, (*big.Int)(nil)).Return(head, nil).Once() + ethClient.On("LatestFinalizedBlock", mock.Anything).Return(latestFinalizedHead, nil).Once() + + err = ec.ProcessHead(ctx, head) require.NoError(t, err) // Can successfully close once err = ec.Close() @@ -199,6 +210,7 @@ func TestEthConfirmer_CheckForReceipts(t *testing.T) { nonce := int64(0) ctx := tests.Context(t) blockNum := int64(0) + latestFinalizedBlockNum := int64(0) t.Run("only finds eth_txes in unconfirmed state with at least one broadcast attempt", func(t *testing.T) { mustInsertFatalErrorEthTx(t, txStore, fromAddress) @@ -211,7 +223,7 @@ func TestEthConfirmer_CheckForReceipts(t *testing.T) { mustCreateUnstartedGeneratedTx(t, txStore, fromAddress, config.EVM().ChainID()) // Do the thing - require.NoError(t, ec.CheckForReceipts(ctx, blockNum)) + require.NoError(t, ec.CheckForReceipts(ctx, blockNum, latestFinalizedBlockNum)) }) etx1 := cltest.MustInsertUnconfirmedEthTxWithBroadcastLegacyAttempt(t, txStore, nonce, fromAddress) @@ -232,7 +244,7 @@ func TestEthConfirmer_CheckForReceipts(t *testing.T) { }).Once() // Do the thing - require.NoError(t, ec.CheckForReceipts(ctx, blockNum)) + require.NoError(t, ec.CheckForReceipts(ctx, blockNum, latestFinalizedBlockNum)) var err error etx1, err = txStore.FindTxWithAttempts(ctx, etx1.ID) @@ -261,7 +273,7 @@ func TestEthConfirmer_CheckForReceipts(t *testing.T) { }).Once() // No error because it is merely logged - require.NoError(t, ec.CheckForReceipts(ctx, blockNum)) + require.NoError(t, ec.CheckForReceipts(ctx, blockNum, latestFinalizedBlockNum)) etx, err := txStore.FindTxWithAttempts(ctx, etx1.ID) require.NoError(t, err) @@ -289,7 +301,7 @@ func TestEthConfirmer_CheckForReceipts(t *testing.T) { }).Once() // No error because it is merely logged - require.NoError(t, ec.CheckForReceipts(ctx, blockNum)) + require.NoError(t, ec.CheckForReceipts(ctx, blockNum, latestFinalizedBlockNum)) etx, err := txStore.FindTxWithAttempts(ctx, etx1.ID) require.NoError(t, err) @@ -326,7 +338,7 @@ func TestEthConfirmer_CheckForReceipts(t *testing.T) { }).Once() // Do the thing - require.NoError(t, ec.CheckForReceipts(ctx, blockNum)) + require.NoError(t, ec.CheckForReceipts(ctx, blockNum, latestFinalizedBlockNum)) // Check that the receipt was saved etx, err := txStore.FindTxWithAttempts(ctx, etx1.ID) @@ -388,7 +400,7 @@ func TestEthConfirmer_CheckForReceipts(t *testing.T) { }).Once() // Do the thing - require.NoError(t, ec.CheckForReceipts(ctx, blockNum)) + require.NoError(t, ec.CheckForReceipts(ctx, blockNum, latestFinalizedBlockNum)) // Check that the state was updated etx, err := txStore.FindTxWithAttempts(ctx, etx2.ID) @@ -416,7 +428,7 @@ func TestEthConfirmer_CheckForReceipts(t *testing.T) { }).Once() // Do the thing - require.NoError(t, ec.CheckForReceipts(ctx, blockNum)) + require.NoError(t, ec.CheckForReceipts(ctx, blockNum, latestFinalizedBlockNum)) // No receipt, but no error either etx, err := txStore.FindTxWithAttempts(ctx, etx3.ID) @@ -443,7 +455,7 @@ func TestEthConfirmer_CheckForReceipts(t *testing.T) { }).Once() // Do the thing - require.NoError(t, ec.CheckForReceipts(ctx, blockNum)) + require.NoError(t, ec.CheckForReceipts(ctx, blockNum, latestFinalizedBlockNum)) // No receipt, but no error either etx, err := txStore.FindTxWithAttempts(ctx, etx3.ID) @@ -472,7 +484,7 @@ func TestEthConfirmer_CheckForReceipts(t *testing.T) { }).Once() // Do the thing - require.NoError(t, ec.CheckForReceipts(ctx, blockNum)) + require.NoError(t, ec.CheckForReceipts(ctx, blockNum, latestFinalizedBlockNum)) // Check that the receipt was unchanged etx, err := txStore.FindTxWithAttempts(ctx, etx3.ID) @@ -523,7 +535,7 @@ func TestEthConfirmer_CheckForReceipts(t *testing.T) { }).Once() // Do the thing - require.NoError(t, ec.CheckForReceipts(ctx, blockNum)) + require.NoError(t, ec.CheckForReceipts(ctx, blockNum, latestFinalizedBlockNum)) // Check that the state was updated var err error @@ -576,7 +588,7 @@ func TestEthConfirmer_CheckForReceipts(t *testing.T) { }).Once() // Do the thing - require.NoError(t, ec.CheckForReceipts(ctx, blockNum)) + require.NoError(t, ec.CheckForReceipts(ctx, blockNum, latestFinalizedBlockNum)) // Check that the state was updated etx5, err = txStore.FindTxWithAttempts(ctx, etx5.ID) @@ -614,6 +626,7 @@ func TestEthConfirmer_CheckForReceipts_batching(t *testing.T) { etx := cltest.MustInsertUnconfirmedEthTx(t, txStore, 0, fromAddress) var attempts []txmgr.TxAttempt + latestFinalizedBlockNum := int64(0) // Total of 5 attempts should lead to 3 batched fetches (2, 2, 1) for i := 0; i < 5; i++ { @@ -650,7 +663,7 @@ func TestEthConfirmer_CheckForReceipts_batching(t *testing.T) { elems[0].Result = &evmtypes.Receipt{} }).Once() - require.NoError(t, ec.CheckForReceipts(ctx, 42)) + require.NoError(t, ec.CheckForReceipts(ctx, 42, latestFinalizedBlockNum)) } func TestEthConfirmer_CheckForReceipts_HandlesNonFwdTxsWithForwardingEnabled(t *testing.T) { @@ -671,6 +684,8 @@ func TestEthConfirmer_CheckForReceipts_HandlesNonFwdTxsWithForwardingEnabled(t * _, fromAddress := cltest.MustInsertRandomKeyReturningState(t, ethKeyStore) ec := newEthConfirmer(t, txStore, ethClient, cfg, evmcfg, ethKeyStore, nil) ctx := tests.Context(t) + latestFinalizedBlockNum := int64(0) + // tx is not forwarded and doesn't have meta set. EthConfirmer should handle nil meta values etx := cltest.MustInsertUnconfirmedEthTx(t, txStore, 0, fromAddress) attempt := newBroadcastLegacyEthTxAttempt(t, etx.ID, 2) @@ -697,7 +712,7 @@ func TestEthConfirmer_CheckForReceipts_HandlesNonFwdTxsWithForwardingEnabled(t * *(elems[0].Result.(*evmtypes.Receipt)) = txmReceipt // confirmed }).Once() - require.NoError(t, ec.CheckForReceipts(ctx, 42)) + require.NoError(t, ec.CheckForReceipts(ctx, 42, latestFinalizedBlockNum)) // Check receipt is inserted correctly. dbtx, err = txStore.FindTxWithAttempts(ctx, etx.ID) @@ -724,6 +739,7 @@ func TestEthConfirmer_CheckForReceipts_only_likely_confirmed(t *testing.T) { ec := newEthConfirmer(t, txStore, ethClient, cfg, evmcfg, ethKeyStore, nil) ctx := tests.Context(t) + latestFinalizedBlockNum := int64(0) var attempts []txmgr.TxAttempt // inserting in DESC nonce order to test DB ASC ordering @@ -755,7 +771,7 @@ func TestEthConfirmer_CheckForReceipts_only_likely_confirmed(t *testing.T) { elems[3].Result = &evmtypes.Receipt{} }).Once() - require.NoError(t, ec.CheckForReceipts(ctx, 42)) + require.NoError(t, ec.CheckForReceipts(ctx, 42, latestFinalizedBlockNum)) cltest.BatchElemMustMatchParams(t, captured[0], attempts[0].Hash, "eth_getTransactionReceipt") cltest.BatchElemMustMatchParams(t, captured[1], attempts[1].Hash, "eth_getTransactionReceipt") @@ -778,6 +794,7 @@ func TestEthConfirmer_CheckForReceipts_should_not_check_for_likely_unconfirmed(t ec := newEthConfirmer(t, txStore, ethClient, gconfig, config, ethKeyStore, nil) ctx := tests.Context(t) + latestFinalizedBlockNum := int64(0) etx := cltest.MustInsertUnconfirmedEthTx(t, txStore, 1, fromAddress) for i := 0; i < 4; i++ { @@ -788,7 +805,7 @@ func TestEthConfirmer_CheckForReceipts_should_not_check_for_likely_unconfirmed(t // latest nonce is lower that all attempts' nonces ethClient.On("SequenceAt", mock.Anything, mock.Anything, mock.Anything).Return(evmtypes.Nonce(0), nil) - require.NoError(t, ec.CheckForReceipts(ctx, 42)) + require.NoError(t, ec.CheckForReceipts(ctx, 42, latestFinalizedBlockNum)) } func TestEthConfirmer_CheckForReceipts_confirmed_missing_receipt_scoped_to_key(t *testing.T) { @@ -809,6 +826,7 @@ func TestEthConfirmer_CheckForReceipts_confirmed_missing_receipt_scoped_to_key(t ec := newEthConfirmer(t, txStore, ethClient, cfg, evmcfg, ethKeyStore, nil) ctx := tests.Context(t) + latestFinalizedBlockNum := int64(0) // STATE // key 1, tx with nonce 0 is unconfirmed @@ -832,7 +850,7 @@ func TestEthConfirmer_CheckForReceipts_confirmed_missing_receipt_scoped_to_key(t *(elems[0].Result.(*evmtypes.Receipt)) = txmReceipt2_9 }).Once() - require.NoError(t, ec.CheckForReceipts(ctx, 10)) + require.NoError(t, ec.CheckForReceipts(ctx, 10, latestFinalizedBlockNum)) mustTxBeInState(t, txStore, etx1_0, txmgrcommon.TxUnconfirmed) mustTxBeInState(t, txStore, etx1_1, txmgrcommon.TxUnconfirmed) @@ -850,7 +868,7 @@ func TestEthConfirmer_CheckForReceipts_confirmed_missing_receipt_scoped_to_key(t *(elems[0].Result.(*evmtypes.Receipt)) = txmReceipt1_1 }).Once() - require.NoError(t, ec.CheckForReceipts(ctx, 11)) + require.NoError(t, ec.CheckForReceipts(ctx, 11, latestFinalizedBlockNum)) mustTxBeInState(t, txStore, etx1_0, txmgrcommon.TxConfirmedMissingReceipt) mustTxBeInState(t, txStore, etx1_1, txmgrcommon.TxConfirmed) @@ -861,9 +879,7 @@ func TestEthConfirmer_CheckForReceipts_confirmed_missing_receipt(t *testing.T) { t.Parallel() db := pgtest.NewSqlxDB(t) - cfg := configtest.NewGeneralConfig(t, func(c *chainlink.Config, s *chainlink.Secrets) { - c.EVM[0].FinalityDepth = ptr[uint32](50) - }) + cfg := configtest.NewGeneralConfig(t, func(c *chainlink.Config, s *chainlink.Secrets) {}) txStore := cltest.NewTestTxStore(t, db) ethKeyStore := cltest.NewKeyStore(t, db).Eth() @@ -876,6 +892,7 @@ func TestEthConfirmer_CheckForReceipts_confirmed_missing_receipt(t *testing.T) { ec := newEthConfirmer(t, txStore, ethClient, cfg, evmcfg, ethKeyStore, nil) ctx := tests.Context(t) + latestFinalizedBlockNum := int64(0) // STATE // eth_txes with nonce 0 has two attempts (broadcast before block 21 and 41) the first of which will get a receipt @@ -949,7 +966,7 @@ func TestEthConfirmer_CheckForReceipts_confirmed_missing_receipt(t *testing.T) { // PERFORM // Block num of 43 is one higher than the receipt (as would generally be expected) - require.NoError(t, ec.CheckForReceipts(ctx, 43)) + require.NoError(t, ec.CheckForReceipts(ctx, 43, latestFinalizedBlockNum)) // Expected state is that the "top" eth_tx is now confirmed, with the // two below it "confirmed_missing_receipt" and the "bottom" eth_tx also confirmed @@ -1009,7 +1026,7 @@ func TestEthConfirmer_CheckForReceipts_confirmed_missing_receipt(t *testing.T) { // PERFORM // Block num of 44 is one higher than the receipt (as would generally be expected) - require.NoError(t, ec.CheckForReceipts(ctx, 44)) + require.NoError(t, ec.CheckForReceipts(ctx, 44, latestFinalizedBlockNum)) // Expected state is that the "top" two eth_txes are now confirmed, with the // one below it still "confirmed_missing_receipt" and the bottom one remains confirmed @@ -1038,7 +1055,7 @@ func TestEthConfirmer_CheckForReceipts_confirmed_missing_receipt(t *testing.T) { // eth_txes with nonce 2 is confirmed // eth_txes with nonce 3 is confirmed - t.Run("continues to leave eth_txes with state 'confirmed_missing_receipt' unchanged if at least one attempt is above EVM.FinalityDepth", func(t *testing.T) { + t.Run("continues to leave eth_txes with state 'confirmed_missing_receipt' unchanged if at least one attempt is above LatestFinalizedBlockNum", func(t *testing.T) { ethClient.On("SequenceAt", mock.Anything, mock.Anything, mock.Anything).Return(evmtypes.Nonce(10), nil) ethClient.On("BatchCallContext", mock.Anything, mock.MatchedBy(func(b []rpc.BatchElem) bool { return len(b) == 2 && @@ -1051,9 +1068,11 @@ func TestEthConfirmer_CheckForReceipts_confirmed_missing_receipt(t *testing.T) { elems[1].Result = &evmtypes.Receipt{} }).Once() + latestFinalizedBlockNum = 30 + // PERFORM // Block num of 80 puts the first attempt (21) below threshold but second attempt (41) still above - require.NoError(t, ec.CheckForReceipts(ctx, 80)) + require.NoError(t, ec.CheckForReceipts(ctx, 80, latestFinalizedBlockNum)) // Expected state is that the "top" two eth_txes are now confirmed, with the // one below it still "confirmed_missing_receipt" and the bottom one remains confirmed @@ -1078,7 +1097,7 @@ func TestEthConfirmer_CheckForReceipts_confirmed_missing_receipt(t *testing.T) { // eth_txes with nonce 2 is confirmed // eth_txes with nonce 3 is confirmed - t.Run("marks eth_Txes with state 'confirmed_missing_receipt' as 'errored' if a receipt fails to show up and all attempts are buried deeper than EVM.FinalityDepth", func(t *testing.T) { + t.Run("marks eth_Txes with state 'confirmed_missing_receipt' as 'errored' if a receipt fails to show up and all attempts are buried deeper than LatestFinalizedBlockNum", func(t *testing.T) { ethClient.On("SequenceAt", mock.Anything, mock.Anything, mock.Anything).Return(evmtypes.Nonce(10), nil) ethClient.On("BatchCallContext", mock.Anything, mock.MatchedBy(func(b []rpc.BatchElem) bool { return len(b) == 2 && @@ -1091,9 +1110,11 @@ func TestEthConfirmer_CheckForReceipts_confirmed_missing_receipt(t *testing.T) { elems[1].Result = &evmtypes.Receipt{} }).Once() + latestFinalizedBlockNum = 50 + // PERFORM // Block num of 100 puts the first attempt (21) and second attempt (41) below threshold - require.NoError(t, ec.CheckForReceipts(ctx, 100)) + require.NoError(t, ec.CheckForReceipts(ctx, 100, latestFinalizedBlockNum)) // Expected state is that the "top" two eth_txes are now confirmed, with the // one below it marked as "fatal_error" and the bottom one remains confirmed @@ -1117,9 +1138,7 @@ func TestEthConfirmer_CheckConfirmedMissingReceipt(t *testing.T) { t.Parallel() db := pgtest.NewSqlxDB(t) - cfg := configtest.NewGeneralConfig(t, func(c *chainlink.Config, s *chainlink.Secrets) { - c.EVM[0].FinalityDepth = ptr[uint32](50) - }) + cfg := configtest.NewGeneralConfig(t, func(c *chainlink.Config, s *chainlink.Secrets) {}) txStore := cltest.NewTestTxStore(t, db) ethKeyStore := cltest.NewKeyStore(t, db).Eth() @@ -1197,9 +1216,7 @@ func TestEthConfirmer_CheckConfirmedMissingReceipt_batchSendTransactions_fails(t t.Parallel() db := pgtest.NewSqlxDB(t) - cfg := configtest.NewGeneralConfig(t, func(c *chainlink.Config, s *chainlink.Secrets) { - c.EVM[0].FinalityDepth = ptr[uint32](50) - }) + cfg := configtest.NewGeneralConfig(t, func(c *chainlink.Config, s *chainlink.Secrets) {}) txStore := cltest.NewTestTxStore(t, db) ethKeyStore := cltest.NewKeyStore(t, db).Eth() @@ -1262,7 +1279,6 @@ func TestEthConfirmer_CheckConfirmedMissingReceipt_smallEvmRPCBatchSize_middleBa db := pgtest.NewSqlxDB(t) cfg := configtest.NewGeneralConfig(t, func(c *chainlink.Config, s *chainlink.Secrets) { - c.EVM[0].FinalityDepth = ptr[uint32](50) c.EVM[0].RPCDefaultBatchSize = ptr[uint32](1) }) txStore := cltest.NewTestTxStore(t, db) @@ -1646,13 +1662,14 @@ func TestEthConfirmer_RebroadcastWhereNecessary_WithConnectivityCheck(t *testing newEst := func(logger.Logger) gas.EvmEstimator { return estimator } estimator.On("BumpLegacyGas", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(nil, uint64(0), pkgerrors.Wrapf(commonfee.ErrConnectivity, "transaction...")) ge := ccfg.EVM().GasEstimator() - feeEstimator := gas.NewEvmFeeEstimator(lggr, newEst, ge.EIP1559DynamicFees(), ge) + feeEstimator := gas.NewEvmFeeEstimator(lggr, newEst, ge.EIP1559DynamicFees(), ge, ethClient) txBuilder := txmgr.NewEvmTxAttemptBuilder(*ethClient.ConfiguredChainID(), ge, kst, feeEstimator) addresses := []gethCommon.Address{fromAddress} kst.On("EnabledAddressesForChain", mock.Anything, &cltest.FixtureChainID).Return(addresses, nil).Maybe() stuckTxDetector := txmgr.NewStuckTxDetector(lggr, testutils.FixtureChainID, "", assets.NewWei(assets.NewEth(100).ToInt()), ccfg.EVM().Transactions().AutoPurge(), feeEstimator, txStore, ethClient) + ht := headtracker.NewSimulatedHeadTracker(ethClient, true, 0) // Create confirmer with necessary state - ec := txmgr.NewEvmConfirmer(txStore, txmgr.NewEvmTxmClient(ethClient, nil), ccfg.EVM(), txmgr.NewEvmTxmFeeConfig(ccfg.EVM().GasEstimator()), ccfg.EVM().Transactions(), cfg.Database(), kst, txBuilder, lggr, stuckTxDetector) + ec := txmgr.NewEvmConfirmer(txStore, txmgr.NewEvmTxmClient(ethClient, nil), ccfg.EVM(), txmgr.NewEvmTxmFeeConfig(ccfg.EVM().GasEstimator()), ccfg.EVM().Transactions(), cfg.Database(), kst, txBuilder, lggr, stuckTxDetector, ht) servicetest.Run(t, ec) currentHead := int64(30) oldEnough := int64(15) @@ -1695,12 +1712,13 @@ func TestEthConfirmer_RebroadcastWhereNecessary_WithConnectivityCheck(t *testing newEst := func(logger.Logger) gas.EvmEstimator { return estimator } // Create confirmer with necessary state ge := ccfg.EVM().GasEstimator() - feeEstimator := gas.NewEvmFeeEstimator(lggr, newEst, ge.EIP1559DynamicFees(), ge) + feeEstimator := gas.NewEvmFeeEstimator(lggr, newEst, ge.EIP1559DynamicFees(), ge, ethClient) txBuilder := txmgr.NewEvmTxAttemptBuilder(*ethClient.ConfiguredChainID(), ge, kst, feeEstimator) addresses := []gethCommon.Address{fromAddress} kst.On("EnabledAddressesForChain", mock.Anything, &cltest.FixtureChainID).Return(addresses, nil).Maybe() stuckTxDetector := txmgr.NewStuckTxDetector(lggr, testutils.FixtureChainID, "", assets.NewWei(assets.NewEth(100).ToInt()), ccfg.EVM().Transactions().AutoPurge(), feeEstimator, txStore, ethClient) - ec := txmgr.NewEvmConfirmer(txStore, txmgr.NewEvmTxmClient(ethClient, nil), ccfg.EVM(), txmgr.NewEvmTxmFeeConfig(ccfg.EVM().GasEstimator()), ccfg.EVM().Transactions(), cfg.Database(), kst, txBuilder, lggr, stuckTxDetector) + ht := headtracker.NewSimulatedHeadTracker(ethClient, true, 0) + ec := txmgr.NewEvmConfirmer(txStore, txmgr.NewEvmTxmClient(ethClient, nil), ccfg.EVM(), txmgr.NewEvmTxmFeeConfig(ccfg.EVM().GasEstimator()), ccfg.EVM().Transactions(), cfg.Database(), kst, txBuilder, lggr, stuckTxDetector, ht) servicetest.Run(t, ec) currentHead := int64(30) oldEnough := int64(15) @@ -2656,6 +2674,58 @@ func TestEthConfirmer_RebroadcastWhereNecessary_WhenOutOfEth(t *testing.T) { }) } +func TestEthConfirmer_RebroadcastWhereNecessary_TerminallyStuckError(t *testing.T) { + t.Parallel() + + db := pgtest.NewSqlxDB(t) + cfg := configtest.NewGeneralConfig(t, func(c *chainlink.Config, s *chainlink.Secrets) { + c.EVM[0].GasEstimator.PriceMax = assets.GWei(500) + }) + txStore := cltest.NewTestTxStore(t, db) + ctx := tests.Context(t) + + ethClient := testutils.NewEthClientMockWithDefaultChain(t) + ethKeyStore := cltest.NewKeyStore(t, db).Eth() + _, fromAddress := cltest.MustInsertRandomKey(t, ethKeyStore) + + evmcfg := evmtest.NewChainScopedConfig(t, cfg) + + // Use a mock keystore for this test + ec := newEthConfirmer(t, txStore, ethClient, cfg, evmcfg, ethKeyStore, nil) + currentHead := int64(30) + oldEnough := int64(19) + nonce := int64(0) + terminallyStuckError := "failed to add tx to the pool: not enough step counters to continue the execution" + + t.Run("terminally stuck transaction replaced with purge attempt", func(t *testing.T) { + originalBroadcastAt := time.Unix(1616509100, 0) + etx := cltest.MustInsertUnconfirmedEthTxWithBroadcastLegacyAttempt(t, txStore, nonce, fromAddress, originalBroadcastAt) + nonce++ + attempt1_1 := etx.TxAttempts[0] + var dbAttempt txmgr.DbEthTxAttempt + require.NoError(t, db.Get(&dbAttempt, `UPDATE evm.tx_attempts SET broadcast_before_block_num=$1 WHERE id=$2 RETURNING *`, oldEnough, attempt1_1.ID)) + + // Return terminally stuck error on first rebroadcast + ethClient.On("SendTransactionReturnCode", mock.Anything, mock.MatchedBy(func(tx *types.Transaction) bool { + return tx.Nonce() == uint64(*etx.Sequence) + }), fromAddress).Return(commonclient.TerminallyStuck, errors.New(terminallyStuckError)).Once() + // Return successful for purge attempt + ethClient.On("SendTransactionReturnCode", mock.Anything, mock.MatchedBy(func(tx *types.Transaction) bool { + return tx.Nonce() == uint64(*etx.Sequence) + }), fromAddress).Return(commonclient.Successful, nil).Once() + + // Start processing transactions for rebroadcast + require.NoError(t, ec.RebroadcastWhereNecessary(tests.Context(t), currentHead)) + var err error + etx, err = txStore.FindTxWithAttempts(ctx, etx.ID) + require.NoError(t, err) + + require.Len(t, etx.TxAttempts, 2) + purgeAttempt := etx.TxAttempts[0] + require.True(t, purgeAttempt.IsPurgeAttempt) + }) +} + func TestEthConfirmer_EnsureConfirmedTransactionsInLongestChain(t *testing.T) { t.Parallel() @@ -2672,29 +2742,34 @@ func TestEthConfirmer_EnsureConfirmedTransactionsInLongestChain(t *testing.T) { gconfig, config := newTestChainScopedConfig(t) ec := newEthConfirmer(t, txStore, ethClient, gconfig, config, ethKeyStore, nil) - head := evmtypes.Head{ + latestFinalizedHead := evmtypes.Head{ + Number: 8, Hash: testutils.NewHash(), - Number: 10, - Parent: &evmtypes.Head{ - Hash: testutils.NewHash(), - Number: 9, - Parent: &evmtypes.Head{ - Number: 8, - Hash: testutils.NewHash(), - Parent: nil, - }, - }, } + h8 := &evmtypes.Head{ + Number: 8, + Hash: testutils.NewHash(), + } + h9 := &evmtypes.Head{ + Hash: testutils.NewHash(), + Number: 9, + } + h9.Parent.Store(h8) + head := &evmtypes.Head{ + Hash: testutils.NewHash(), + Number: 10, + } + head.Parent.Store(h9) t.Run("does nothing if there aren't any transactions", func(t *testing.T) { - require.NoError(t, ec.EnsureConfirmedTransactionsInLongestChain(tests.Context(t), &head)) + require.NoError(t, ec.EnsureConfirmedTransactionsInLongestChain(tests.Context(t), head, latestFinalizedHead.BlockNumber())) }) t.Run("does nothing to unconfirmed transactions", func(t *testing.T) { etx := cltest.MustInsertUnconfirmedEthTxWithBroadcastLegacyAttempt(t, txStore, 0, fromAddress) // Do the thing - require.NoError(t, ec.EnsureConfirmedTransactionsInLongestChain(tests.Context(t), &head)) + require.NoError(t, ec.EnsureConfirmedTransactionsInLongestChain(tests.Context(t), head, latestFinalizedHead.BlockNumber())) etx, err := txStore.FindTxWithAttempts(ctx, etx.ID) require.NoError(t, err) @@ -2706,7 +2781,7 @@ func TestEthConfirmer_EnsureConfirmedTransactionsInLongestChain(t *testing.T) { mustInsertEthReceipt(t, txStore, head.Number, head.Hash, etx.TxAttempts[0].Hash) // Do the thing - require.NoError(t, ec.EnsureConfirmedTransactionsInLongestChain(tests.Context(t), &head)) + require.NoError(t, ec.EnsureConfirmedTransactionsInLongestChain(tests.Context(t), head, latestFinalizedHead.BlockNumber())) etx, err := txStore.FindTxWithAttempts(ctx, etx.ID) require.NoError(t, err) @@ -2716,10 +2791,10 @@ func TestEthConfirmer_EnsureConfirmedTransactionsInLongestChain(t *testing.T) { t.Run("does nothing to confirmed transactions that only have receipts older than the start of the chain", func(t *testing.T) { etx := cltest.MustInsertConfirmedEthTxWithLegacyAttempt(t, txStore, 3, 1, fromAddress) // Add receipt that is older than the lowest block of the chain - mustInsertEthReceipt(t, txStore, head.Parent.Parent.Number-1, testutils.NewHash(), etx.TxAttempts[0].Hash) + mustInsertEthReceipt(t, txStore, h8.Number-1, testutils.NewHash(), etx.TxAttempts[0].Hash) // Do the thing - require.NoError(t, ec.EnsureConfirmedTransactionsInLongestChain(tests.Context(t), &head)) + require.NoError(t, ec.EnsureConfirmedTransactionsInLongestChain(tests.Context(t), head, latestFinalizedHead.BlockNumber())) etx, err := txStore.FindTxWithAttempts(ctx, etx.ID) require.NoError(t, err) @@ -2730,7 +2805,7 @@ func TestEthConfirmer_EnsureConfirmedTransactionsInLongestChain(t *testing.T) { etx := cltest.MustInsertConfirmedEthTxWithLegacyAttempt(t, txStore, 4, 1, fromAddress) attempt := etx.TxAttempts[0] // Include one within head height but a different block hash - mustInsertEthReceipt(t, txStore, head.Parent.Number, testutils.NewHash(), attempt.Hash) + mustInsertEthReceipt(t, txStore, head.Parent.Load().Number, testutils.NewHash(), attempt.Hash) ethClient.On("SendTransactionReturnCode", mock.Anything, mock.MatchedBy(func(tx *types.Transaction) bool { atx, err := txmgr.GetGethSignedTx(attempt.SignedRawTx) @@ -2740,7 +2815,7 @@ func TestEthConfirmer_EnsureConfirmedTransactionsInLongestChain(t *testing.T) { }), fromAddress).Return(commonclient.Successful, nil).Once() // Do the thing - require.NoError(t, ec.EnsureConfirmedTransactionsInLongestChain(tests.Context(t), &head)) + require.NoError(t, ec.EnsureConfirmedTransactionsInLongestChain(tests.Context(t), head, latestFinalizedHead.BlockNumber())) etx, err := txStore.FindTxWithAttempts(ctx, etx.ID) require.NoError(t, err) @@ -2755,15 +2830,15 @@ func TestEthConfirmer_EnsureConfirmedTransactionsInLongestChain(t *testing.T) { attempt := etx.TxAttempts[0] attemptHash := attempt.Hash // Add receipt that is older than the lowest block of the chain - mustInsertEthReceipt(t, txStore, head.Parent.Parent.Number-1, testutils.NewHash(), attemptHash) + mustInsertEthReceipt(t, txStore, h8.Number-1, testutils.NewHash(), attemptHash) // Include one within head height but a different block hash - mustInsertEthReceipt(t, txStore, head.Parent.Number, testutils.NewHash(), attemptHash) + mustInsertEthReceipt(t, txStore, head.Parent.Load().Number, testutils.NewHash(), attemptHash) ethClient.On("SendTransactionReturnCode", mock.Anything, mock.Anything, fromAddress).Return( commonclient.Successful, nil).Once() // Do the thing - require.NoError(t, ec.EnsureConfirmedTransactionsInLongestChain(tests.Context(t), &head)) + require.NoError(t, ec.EnsureConfirmedTransactionsInLongestChain(tests.Context(t), head, latestFinalizedHead.BlockNumber())) etx, err := txStore.FindTxWithAttempts(ctx, etx.ID) require.NoError(t, err) @@ -2787,9 +2862,9 @@ func TestEthConfirmer_EnsureConfirmedTransactionsInLongestChain(t *testing.T) { require.NoError(t, txStore.InsertTxAttempt(ctx, &attempt3)) // Receipt is within head height but a different block hash - mustInsertEthReceipt(t, txStore, head.Parent.Number, testutils.NewHash(), attempt2.Hash) + mustInsertEthReceipt(t, txStore, head.Parent.Load().Number, testutils.NewHash(), attempt2.Hash) // Receipt is within head height but a different block hash - mustInsertEthReceipt(t, txStore, head.Parent.Number, testutils.NewHash(), attempt3.Hash) + mustInsertEthReceipt(t, txStore, head.Parent.Load().Number, testutils.NewHash(), attempt3.Hash) ethClient.On("SendTransactionReturnCode", mock.Anything, mock.MatchedBy(func(tx *types.Transaction) bool { s, err := txmgr.GetGethSignedTx(attempt3.SignedRawTx) @@ -2798,7 +2873,7 @@ func TestEthConfirmer_EnsureConfirmedTransactionsInLongestChain(t *testing.T) { }), fromAddress).Return(commonclient.Successful, nil).Once() // Do the thing - require.NoError(t, ec.EnsureConfirmedTransactionsInLongestChain(tests.Context(t), &head)) + require.NoError(t, ec.EnsureConfirmedTransactionsInLongestChain(tests.Context(t), head, latestFinalizedHead.BlockNumber())) etx, err := txStore.FindTxWithAttempts(ctx, etx.ID) require.NoError(t, err) @@ -2818,7 +2893,7 @@ func TestEthConfirmer_EnsureConfirmedTransactionsInLongestChain(t *testing.T) { // Add receipt that is higher than head mustInsertEthReceipt(t, txStore, head.Number+1, testutils.NewHash(), attempt.Hash) - require.NoError(t, ec.EnsureConfirmedTransactionsInLongestChain(tests.Context(t), &head)) + require.NoError(t, ec.EnsureConfirmedTransactionsInLongestChain(tests.Context(t), head, latestFinalizedHead.BlockNumber())) etx, err := txStore.FindTxWithAttempts(ctx, etx.ID) require.NoError(t, err) @@ -2945,19 +3020,20 @@ func TestEthConfirmer_ResumePendingRuns(t *testing.T) { evmcfg := evmtest.NewChainScopedConfig(t, config) + h8 := &evmtypes.Head{ + Number: 8, + Hash: testutils.NewHash(), + } + h9 := &evmtypes.Head{ + Hash: testutils.NewHash(), + Number: 9, + } + h9.Parent.Store(h8) head := evmtypes.Head{ Hash: testutils.NewHash(), Number: 10, - Parent: &evmtypes.Head{ - Hash: testutils.NewHash(), - Number: 9, - Parent: &evmtypes.Head{ - Number: 8, - Hash: testutils.NewHash(), - Parent: nil, - }, - }, } + head.Parent.Store(h9) minConfirmations := int64(2) @@ -3143,7 +3219,7 @@ func TestEthConfirmer_ProcessStuckTransactions(t *testing.T) { fee := gas.EvmFee{Legacy: marketGasPrice} bumpedLegacy := assets.GWei(30) bumpedFee := gas.EvmFee{Legacy: bumpedLegacy} - feeEstimator.On("GetFee", mock.Anything, []byte{}, uint64(0), mock.Anything).Return(fee, uint64(0), nil) + feeEstimator.On("GetFee", mock.Anything, []byte{}, uint64(0), mock.Anything, mock.Anything, mock.Anything).Return(fee, uint64(0), nil) feeEstimator.On("BumpFee", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(bumpedFee, uint64(10_000), nil) autoPurgeThreshold := uint32(5) autoPurgeMinAttempts := uint32(3) @@ -3158,7 +3234,13 @@ func TestEthConfirmer_ProcessStuckTransactions(t *testing.T) { ge := evmcfg.EVM().GasEstimator() txBuilder := txmgr.NewEvmTxAttemptBuilder(*ethClient.ConfiguredChainID(), ge, ethKeyStore, feeEstimator) stuckTxDetector := txmgr.NewStuckTxDetector(lggr, testutils.FixtureChainID, "", assets.NewWei(assets.NewEth(100).ToInt()), evmcfg.EVM().Transactions().AutoPurge(), feeEstimator, txStore, ethClient) - ec := txmgr.NewEvmConfirmer(txStore, txmgr.NewEvmTxmClient(ethClient, nil), txmgr.NewEvmTxmConfig(evmcfg.EVM()), txmgr.NewEvmTxmFeeConfig(ge), evmcfg.EVM().Transactions(), cfg.Database(), ethKeyStore, txBuilder, lggr, stuckTxDetector) + ht := headtracker.NewSimulatedHeadTracker(ethClient, true, 0) + ec := txmgr.NewEvmConfirmer(txStore, txmgr.NewEvmTxmClient(ethClient, nil), txmgr.NewEvmTxmConfig(evmcfg.EVM()), txmgr.NewEvmTxmFeeConfig(ge), evmcfg.EVM().Transactions(), cfg.Database(), ethKeyStore, txBuilder, lggr, stuckTxDetector, ht) + fn := func(ctx context.Context, id uuid.UUID, result interface{}, err error) error { + require.ErrorContains(t, err, client.TerminallyStuckMsg) + return nil + } + ec.SetResumeCallback(fn) servicetest.Run(t, ec) ctx := tests.Context(t) @@ -3170,11 +3252,16 @@ func TestEthConfirmer_ProcessStuckTransactions(t *testing.T) { // Create autoPurgeMinAttempts number of attempts to ensure the broadcast attempt count check is not being triggered // Create attempts broadcasted autoPurgeThreshold block ago to ensure broadcast block num check is not being triggered tx := mustInsertUnconfirmedTxWithBroadcastAttempts(t, txStore, nonce, fromAddress, autoPurgeMinAttempts, blockNum-int64(autoPurgeThreshold), marketGasPrice.Add(oneGwei)) - + // Update tx to signal callback once it is identified as terminally stuck + pgtest.MustExec(t, db, `UPDATE evm.txes SET pipeline_task_run_id = $1, signal_callback = TRUE WHERE id = $2`, uuid.New(), tx.ID) head := evmtypes.Head{ Hash: testutils.NewHash(), Number: blockNum, } + head.IsFinalized.Store(true) + + ethClient.On("HeadByNumber", mock.Anything, (*big.Int)(nil)).Return(&head, nil).Once() + ethClient.On("LatestFinalizedBlock", mock.Anything).Return(&head, nil).Once() ethClient.On("SequenceAt", mock.Anything, mock.Anything, mock.Anything).Return(evmtypes.Nonce(0), nil).Once() ethClient.On("BatchCallContext", mock.Anything, mock.Anything).Return(nil).Once() @@ -3199,6 +3286,9 @@ func TestEthConfirmer_ProcessStuckTransactions(t *testing.T) { Hash: testutils.NewHash(), Number: blockNum + 1, } + head.IsFinalized.Store(true) + ethClient.On("HeadByNumber", mock.Anything, (*big.Int)(nil)).Return(&head, nil).Once() + ethClient.On("LatestFinalizedBlock", mock.Anything).Return(&head, nil).Once() ethClient.On("SequenceAt", mock.Anything, mock.Anything, mock.Anything).Return(evmtypes.Nonce(1), nil) ethClient.On("BatchCallContext", mock.Anything, mock.MatchedBy(func(b []rpc.BatchElem) bool { return len(b) == 4 && cltest.BatchElemMatchesParams(b[0], latestAttempt.Hash, "eth_getTransactionReceipt") @@ -3224,6 +3314,7 @@ func TestEthConfirmer_ProcessStuckTransactions(t *testing.T) { require.NotNil(t, dbTx) require.Equal(t, txmgrcommon.TxFatalError, dbTx.State) require.Equal(t, client.TerminallyStuckMsg, dbTx.Error.String) + require.Equal(t, true, dbTx.CallbackCompleted) }) } @@ -3234,10 +3325,11 @@ func newEthConfirmer(t testing.TB, txStore txmgr.EvmTxStore, ethClient client.Cl ge := config.EVM().GasEstimator() estimator := gas.NewEvmFeeEstimator(lggr, func(lggr logger.Logger) gas.EvmEstimator { return gas.NewFixedPriceEstimator(ge, nil, ge.BlockHistory(), lggr, nil) - }, ge.EIP1559DynamicFees(), ge) + }, ge.EIP1559DynamicFees(), ge, ethClient) txBuilder := txmgr.NewEvmTxAttemptBuilder(*ethClient.ConfiguredChainID(), ge, ks, estimator) stuckTxDetector := txmgr.NewStuckTxDetector(lggr, testutils.FixtureChainID, "", assets.NewWei(assets.NewEth(100).ToInt()), config.EVM().Transactions().AutoPurge(), estimator, txStore, ethClient) - ec := txmgr.NewEvmConfirmer(txStore, txmgr.NewEvmTxmClient(ethClient, nil), txmgr.NewEvmTxmConfig(config.EVM()), txmgr.NewEvmTxmFeeConfig(ge), config.EVM().Transactions(), gconfig.Database(), ks, txBuilder, lggr, stuckTxDetector) + ht := headtracker.NewSimulatedHeadTracker(ethClient, true, 0) + ec := txmgr.NewEvmConfirmer(txStore, txmgr.NewEvmTxmClient(ethClient, nil), txmgr.NewEvmTxmConfig(config.EVM()), txmgr.NewEvmTxmFeeConfig(ge), config.EVM().Transactions(), gconfig.Database(), ks, txBuilder, lggr, stuckTxDetector, ht) ec.SetResumeCallback(fn) servicetest.Run(t, ec) return ec diff --git a/core/chains/evm/txmgr/evm_tx_store.go b/core/chains/evm/txmgr/evm_tx_store.go index fd38eb7a8c9..fa2251168d9 100644 --- a/core/chains/evm/txmgr/evm_tx_store.go +++ b/core/chains/evm/txmgr/evm_tx_store.go @@ -34,18 +34,20 @@ import ( var ( ErrKeyNotUpdated = errors.New("evmTxStore: Key not updated") - // ErrCouldNotGetReceipt is the error string we save if we reach our finality depth for a confirmed transaction without ever getting a receipt - // This most likely happened because an external wallet used the account for this nonce + // ErrCouldNotGetReceipt is the error string we save if we reach our LatestFinalizedBlockNum for a confirmed transaction + // without ever getting a receipt. This most likely happened because an external wallet used the account for this nonce ErrCouldNotGetReceipt = "could not get receipt" ) // EvmTxStore combines the txmgr tx store interface and the interface needed for the API to read from the tx DB -// -//go:generate mockery --quiet --name EvmTxStore --output ./mocks/ --case=underscore type EvmTxStore interface { // redeclare TxStore for mockery txmgrtypes.TxStore[common.Address, *big.Int, common.Hash, common.Hash, *evmtypes.Receipt, evmtypes.Nonce, gas.EvmFee] TxStoreWebApi + + // methods used solely in EVM components + FindConfirmedTxesReceipts(ctx context.Context, finalizedBlockNum int64, chainID *big.Int) (receipts []Receipt, err error) + UpdateTxStatesToFinalizedUsingReceiptIds(ctx context.Context, etxIDs []int64, chainId *big.Int) error } // TxStoreWebApi encapsulates the methods that are not used by the txmgr and only used by the various web controllers, readers, or evm specific components @@ -89,7 +91,7 @@ var _ TestEvmTxStore = (*evmTxStore)(nil) // Directly maps to columns of database table "evm.receipts". // Do not modify type unless you // intend to modify the database schema -type dbReceipt struct { +type DbReceipt struct { ID int64 TxHash common.Hash BlockHash common.Hash @@ -99,8 +101,8 @@ type dbReceipt struct { CreatedAt time.Time } -func DbReceiptFromEvmReceipt(evmReceipt *evmtypes.Receipt) dbReceipt { - return dbReceipt{ +func DbReceiptFromEvmReceipt(evmReceipt *evmtypes.Receipt) DbReceipt { + return DbReceipt{ TxHash: evmReceipt.TxHash, BlockHash: evmReceipt.BlockHash, BlockNumber: evmReceipt.BlockNumber.Int64(), @@ -109,7 +111,7 @@ func DbReceiptFromEvmReceipt(evmReceipt *evmtypes.Receipt) dbReceipt { } } -func DbReceiptToEvmReceipt(receipt *dbReceipt) *evmtypes.Receipt { +func DbReceiptToEvmReceipt(receipt *DbReceipt) *evmtypes.Receipt { return &receipt.Receipt } @@ -133,7 +135,7 @@ type dbReceiptPlus struct { FailOnRevert bool `db:"FailOnRevert"` } -func fromDBReceipts(rs []dbReceipt) []*evmtypes.Receipt { +func fromDBReceipts(rs []DbReceipt) []*evmtypes.Receipt { receipts := make([]*evmtypes.Receipt, len(rs)) for i := 0; i < len(rs); i++ { receipts[i] = DbReceiptToEvmReceipt(&rs[i]) @@ -667,10 +669,8 @@ func (o *evmTxStore) loadEthTxAttemptsReceipts(ctx context.Context, etx *Tx) (er return o.loadEthTxesAttemptsReceipts(ctx, []*Tx{etx}) } -func (o *evmTxStore) loadEthTxesAttemptsReceipts(ctx context.Context, etxs []*Tx) (err error) { - if len(etxs) == 0 { - return nil - } +// initEthTxesAttempts takes an input txes slice, return an initialized attempt map and attemptHashes slice +func initEthTxesAttempts(etxs []*Tx) (map[common.Hash]*TxAttempt, [][]byte) { attemptHashM := make(map[common.Hash]*TxAttempt, len(etxs)) // len here is lower bound attemptHashes := make([][]byte, len(etxs)) // len here is lower bound for _, etx := range etxs { @@ -679,7 +679,17 @@ func (o *evmTxStore) loadEthTxesAttemptsReceipts(ctx context.Context, etxs []*Tx attemptHashes = append(attemptHashes, attempt.Hash.Bytes()) } } - var rs []dbReceipt + + return attemptHashM, attemptHashes +} + +func (o *evmTxStore) loadEthTxesAttemptsReceipts(ctx context.Context, etxs []*Tx) (err error) { + if len(etxs) == 0 { + return nil + } + + attemptHashM, attemptHashes := initEthTxesAttempts(etxs) + var rs []DbReceipt if err = o.q.SelectContext(ctx, &rs, `SELECT * FROM evm.receipts WHERE tx_hash = ANY($1)`, pq.Array(attemptHashes)); err != nil { return pkgerrors.Wrap(err, "loadEthTxesAttemptsReceipts failed to load evm.receipts") } @@ -695,6 +705,37 @@ func (o *evmTxStore) loadEthTxesAttemptsReceipts(ctx context.Context, etxs []*Tx return nil } +// loadEthTxesAttemptsWithPartialReceipts loads ethTxes with attempts and partial receipts values for optimization +func (o *evmTxStore) loadEthTxesAttemptsWithPartialReceipts(ctx context.Context, etxs []*Tx) (err error) { + if len(etxs) == 0 { + return nil + } + + attemptHashM, attemptHashes := initEthTxesAttempts(etxs) + var rs []DbReceipt + if err = o.q.SelectContext(ctx, &rs, `SELECT evm.receipts.block_hash, evm.receipts.block_number, evm.receipts.transaction_index, evm.receipts.tx_hash FROM evm.receipts WHERE tx_hash = ANY($1)`, pq.Array(attemptHashes)); err != nil { + return pkgerrors.Wrap(err, "loadEthTxesAttemptsReceipts failed to load evm.receipts") + } + + receipts := make([]*evmtypes.Receipt, len(rs)) + for i := 0; i < len(rs); i++ { + receipts[i] = &evmtypes.Receipt{ + BlockHash: rs[i].BlockHash, + BlockNumber: big.NewInt(rs[i].BlockNumber), + TransactionIndex: rs[i].TransactionIndex, + TxHash: rs[i].TxHash, + } + } + + for _, receipt := range receipts { + attempt := attemptHashM[receipt.TxHash] + // Although the attempts struct supports multiple receipts, the expectation for EVM is that there is only one receipt + // per tx and therefore attempt too. + attempt.Receipts = append(attempt.Receipts, receipt) + } + return nil +} + func loadConfirmedAttemptsReceipts(ctx context.Context, q sqlutil.DataSource, attempts []TxAttempt) error { byHash := make(map[string]*TxAttempt, len(attempts)) hashes := make([][]byte, len(attempts)) @@ -702,7 +743,7 @@ func loadConfirmedAttemptsReceipts(ctx context.Context, q sqlutil.DataSource, at byHash[attempt.Hash.String()] = &attempts[i] hashes = append(hashes, attempt.Hash.Bytes()) } - var rs []dbReceipt + var rs []DbReceipt if err := q.SelectContext(ctx, &rs, `SELECT * FROM evm.receipts WHERE tx_hash = ANY($1)`, pq.Array(hashes)); err != nil { return pkgerrors.Wrap(err, "loadConfirmedAttemptsReceipts failed to load evm.receipts") } @@ -957,11 +998,11 @@ func (o *evmTxStore) SaveFetchedReceipts(ctx context.Context, r []*evmtypes.Rece // NOTE: We continue to attempt to resend evm.txes in this state on // every head to guard against the extremely rare scenario of nonce gap due to // reorg that excludes the transaction (from another wallet) that had this -// nonce (until finality depth is reached, after which we make the explicit +// nonce (until LatestFinalizedBlockNum is reached, after which we make the explicit // decision to give up). This is done in the EthResender. // // We will continue to try to fetch a receipt for these attempts until all -// attempts are below the finality depth from current head. +// attempts are equal to or below the LatestFinalizedBlockNum from current head. func (o *evmTxStore) MarkAllConfirmedMissingReceipt(ctx context.Context, chainID *big.Int) (err error) { var cancel context.CancelFunc ctx, cancel = o.stopCh.Ctx(ctx) @@ -1118,7 +1159,7 @@ func updateEthTxAttemptUnbroadcast(ctx context.Context, orm *evmTxStore, attempt func updateEthTxUnconfirm(ctx context.Context, orm *evmTxStore, etx Tx) error { if etx.State != txmgr.TxConfirmed { - return errors.New("expected eth_tx state to be confirmed") + return errors.New("expected tx state to be confirmed") } _, err := orm.q.ExecContext(ctx, `UPDATE evm.txes SET state = 'unconfirmed' WHERE id = $1`, etx.ID) return pkgerrors.Wrap(err, "updateEthTxUnconfirm failed") @@ -1170,7 +1211,9 @@ ORDER BY nonce ASC if err = orm.LoadTxesAttempts(ctx, etxs); err != nil { return pkgerrors.Wrap(err, "FindTransactionsConfirmedInBlockRange failed to load evm.tx_attempts") } - err = orm.loadEthTxesAttemptsReceipts(ctx, etxs) + + // retrieve tx with attempts and partial receipt values for optimization purpose + err = orm.loadEthTxesAttemptsWithPartialReceipts(ctx, etxs) return pkgerrors.Wrap(err, "FindTransactionsConfirmedInBlockRange failed to load evm.receipts") }) return etxs, pkgerrors.Wrap(err, "FindTransactionsConfirmedInBlockRange failed") @@ -1207,24 +1250,6 @@ AND evm_chain_id = $1`, chainID.String()).Scan(&earliestUnconfirmedTxBlock) return earliestUnconfirmedTxBlock, err } -func (o *evmTxStore) IsTxFinalized(ctx context.Context, blockHeight int64, txID int64, chainID *big.Int) (finalized bool, err error) { - var cancel context.CancelFunc - ctx, cancel = o.stopCh.Ctx(ctx) - defer cancel() - - var count int32 - err = o.q.GetContext(ctx, &count, ` - SELECT COUNT(evm.receipts.receipt) FROM evm.txes - INNER JOIN evm.tx_attempts ON evm.txes.id = evm.tx_attempts.eth_tx_id - INNER JOIN evm.receipts ON evm.tx_attempts.hash = evm.receipts.tx_hash - WHERE evm.receipts.block_number <= ($1 - evm.txes.min_confirmations) - AND evm.txes.id = $2 AND evm.txes.evm_chain_id = $3`, blockHeight, txID, chainID.String()) - if err != nil { - return false, fmt.Errorf("failed to retrieve transaction reciepts: %w", err) - } - return count > 0, nil -} - func (o *evmTxStore) saveAttemptWithNewState(ctx context.Context, attempt TxAttempt, broadcastAt time.Time) error { var dbAttempt DbEthTxAttempt dbAttempt.FromTxAttempt(&attempt) @@ -1446,23 +1471,18 @@ ORDER BY nonce ASC // markOldTxesMissingReceiptAsErrored // -// Once eth_tx has all of its attempts broadcast before some cutoff threshold +// Once eth_tx has all of its attempts broadcast equal to or before latestFinalizedBlockNum // without receiving any receipts, we mark it as fatally errored (never sent). // // The job run will also be marked as errored in this case since we never got a // receipt and thus cannot pass on any transaction hash -func (o *evmTxStore) MarkOldTxesMissingReceiptAsErrored(ctx context.Context, blockNum int64, finalityDepth uint32, chainID *big.Int) error { +func (o *evmTxStore) MarkOldTxesMissingReceiptAsErrored(ctx context.Context, blockNum int64, latestFinalizedBlockNum int64, chainID *big.Int) error { var cancel context.CancelFunc ctx, cancel = o.stopCh.Ctx(ctx) defer cancel() - // cutoffBlockNum is a block height - // Any 'confirmed_missing_receipt' eth_tx with all attempts older than this block height will be marked as errored - // We will not try to query for receipts for this transaction any more - cutoff := blockNum - int64(finalityDepth) - if cutoff <= 0 { - return nil - } - if cutoff <= 0 { + // Any 'confirmed_missing_receipt' eth_tx with all attempts equal to or older than latestFinalizedBlockNum will be marked as errored + // We will not try to query for receipts for this transaction anymore + if latestFinalizedBlockNum <= 0 { return nil } // note: if QOpt passes in a sql.Tx this will reuse it @@ -1482,12 +1502,12 @@ FROM ( WHERE e2.state = 'confirmed_missing_receipt' AND e2.evm_chain_id = $3 GROUP BY e2.id - HAVING max(evm.tx_attempts.broadcast_before_block_num) < $2 + HAVING max(evm.tx_attempts.broadcast_before_block_num) <= $2 ) FOR UPDATE OF e1 ) e0 WHERE e0.id = evm.txes.id -RETURNING e0.id, e0.nonce`, ErrCouldNotGetReceipt, cutoff, chainID.String()) +RETURNING e0.id, e0.nonce`, ErrCouldNotGetReceipt, latestFinalizedBlockNum, chainID.String()) if err != nil { return pkgerrors.Wrap(err, "markOldTxesMissingReceiptAsErrored failed to query") @@ -1706,9 +1726,7 @@ func (o *evmTxStore) UpdateTxUnstartedToInProgress(ctx context.Context, etx *Tx, pqErr.ConstraintName == "eth_tx_attempts_eth_tx_id_fkey" { return txmgr.ErrTxRemoved } - if err != nil { - return pkgerrors.Wrap(err, "UpdateTxUnstartedToInProgress failed to create eth_tx_attempt") - } + return pkgerrors.Wrap(err, "UpdateTxUnstartedToInProgress failed to create eth_tx_attempt") } dbAttempt.ToTxAttempt(attempt) var dbEtx DbEthTx @@ -1876,7 +1894,7 @@ id < ( return } -func (o *evmTxStore) ReapTxHistory(ctx context.Context, minBlockNumberToKeep int64, timeThreshold time.Time, chainID *big.Int) error { +func (o *evmTxStore) ReapTxHistory(ctx context.Context, timeThreshold time.Time, chainID *big.Int) error { var cancel context.CancelFunc ctx, cancel = o.stopCh.Ctx(ctx) defer cancel() @@ -1889,19 +1907,18 @@ func (o *evmTxStore) ReapTxHistory(ctx context.Context, minBlockNumberToKeep int res, err := o.q.ExecContext(ctx, ` WITH old_enough_receipts AS ( SELECT tx_hash FROM evm.receipts - WHERE block_number < $1 ORDER BY block_number ASC, id ASC - LIMIT $2 + LIMIT $1 ) DELETE FROM evm.txes USING old_enough_receipts, evm.tx_attempts WHERE evm.tx_attempts.eth_tx_id = evm.txes.id AND evm.tx_attempts.hash = old_enough_receipts.tx_hash -AND evm.txes.created_at < $3 -AND evm.txes.state = 'confirmed' -AND evm_chain_id = $4`, minBlockNumberToKeep, limit, timeThreshold, chainID.String()) +AND evm.txes.created_at < $2 +AND evm.txes.state = 'finalized' +AND evm_chain_id = $3`, limit, timeThreshold, chainID.String()) if err != nil { - return count, pkgerrors.Wrap(err, "ReapTxes failed to delete old confirmed evm.txes") + return count, pkgerrors.Wrap(err, "ReapTxes failed to delete old finalized evm.txes") } rowsAffected, err := res.RowsAffected() if err != nil { @@ -1910,7 +1927,7 @@ AND evm_chain_id = $4`, minBlockNumberToKeep, limit, timeThreshold, chainID.Stri return uint(rowsAffected), err }, batchSize) if err != nil { - return pkgerrors.Wrap(err, "TxmReaper#reapEthTxes batch delete of confirmed evm.txes failed") + return pkgerrors.Wrap(err, "TxmReaper#reapEthTxes batch delete of finalized evm.txes failed") } // Delete old 'fatal_error' evm.txes err = sqlutil.Batch(func(_, limit uint) (count uint, err error) { @@ -1931,6 +1948,38 @@ AND evm_chain_id = $2`, timeThreshold, chainID.String()) if err != nil { return pkgerrors.Wrap(err, "TxmReaper#reapEthTxes batch delete of fatally errored evm.txes failed") } + // Delete old 'confirmed' evm.txes that were never finalized + // This query should never result in changes but added just in case transactions slip through the cracks + // to avoid them building up in the DB + err = sqlutil.Batch(func(_, limit uint) (count uint, err error) { + res, err := o.q.ExecContext(ctx, ` +WITH old_enough_receipts AS ( + SELECT tx_hash FROM evm.receipts + ORDER BY block_number ASC, id ASC + LIMIT $1 +) +DELETE FROM evm.txes +USING old_enough_receipts, evm.tx_attempts +WHERE evm.tx_attempts.eth_tx_id = evm.txes.id +AND evm.tx_attempts.hash = old_enough_receipts.tx_hash +AND evm.txes.created_at < $2 +AND evm.txes.state = 'confirmed' +AND evm_chain_id = $3`, limit, timeThreshold, chainID.String()) + if err != nil { + return count, pkgerrors.Wrap(err, "ReapTxes failed to delete old confirmed evm.txes") + } + rowsAffected, err := res.RowsAffected() + if err != nil { + return count, pkgerrors.Wrap(err, "ReapTxes failed to get rows affected") + } + if rowsAffected > 0 { + o.logger.Errorf("%d confirmed transactions were reaped before being marked as finalized. This should never happen unless the threshold is set too low or the transactions were lost track of", rowsAffected) + } + return uint(rowsAffected), err + }, batchSize) + if err != nil { + return pkgerrors.Wrap(err, "TxmReaper#reapEthTxes batch delete of confirmed evm.txes failed") + } return nil } @@ -2059,3 +2108,36 @@ func (o *evmTxStore) UpdateTxAttemptBroadcastBeforeBlockNum(ctx context.Context, _, err := o.q.ExecContext(ctx, sql, blockNum, id) return err } + +// FindConfirmedTxesReceipts Returns all confirmed transactions with receipt block nums older than or equal to the finalized block number +func (o *evmTxStore) FindConfirmedTxesReceipts(ctx context.Context, finalizedBlockNum int64, chainID *big.Int) (receipts []Receipt, err error) { + var cancel context.CancelFunc + ctx, cancel = o.stopCh.Ctx(ctx) + defer cancel() + + // note the receipts are partially loaded for performance reason + query := `SELECT evm.receipts.id, evm.receipts.tx_hash, evm.receipts.block_hash, evm.receipts.block_number FROM evm.receipts + INNER JOIN evm.tx_attempts ON evm.tx_attempts.hash = evm.receipts.tx_hash + INNER JOIN evm.txes ON evm.txes.id = evm.tx_attempts.eth_tx_id + WHERE evm.txes.state = 'confirmed' AND evm.receipts.block_number <= $1 AND evm.txes.evm_chain_id = $2` + err = o.q.SelectContext(ctx, &receipts, query, finalizedBlockNum, chainID.String()) + return receipts, err +} + +// Mark transactions corresponding to receipt IDs as finalized +func (o *evmTxStore) UpdateTxStatesToFinalizedUsingReceiptIds(ctx context.Context, receiptIDs []int64, chainId *big.Int) error { + if len(receiptIDs) == 0 { + return nil + } + var cancel context.CancelFunc + ctx, cancel = o.stopCh.Ctx(ctx) + defer cancel() + sql := ` +UPDATE evm.txes SET state = 'finalized' WHERE evm.txes.evm_chain_id = $1 AND evm.txes.id IN (SELECT evm.txes.id FROM evm.txes + INNER JOIN evm.tx_attempts ON evm.tx_attempts.eth_tx_id = evm.txes.id + INNER JOIN evm.receipts ON evm.receipts.tx_hash = evm.tx_attempts.hash + WHERE evm.receipts.id = ANY($2)) +` + _, err := o.q.ExecContext(ctx, sql, chainId.String(), pq.Array(receiptIDs)) + return err +} diff --git a/core/chains/evm/txmgr/evm_tx_store_test.go b/core/chains/evm/txmgr/evm_tx_store_test.go index afb8de4ca52..e47387fb8d3 100644 --- a/core/chains/evm/txmgr/evm_tx_store_test.go +++ b/core/chains/evm/txmgr/evm_tx_store_test.go @@ -628,19 +628,20 @@ func TestORM_FindTxesPendingCallback(t *testing.T) { pgtest.MustExec(t, db, `SET CONSTRAINTS fk_pipeline_runs_pruning_key DEFERRED`) pgtest.MustExec(t, db, `SET CONSTRAINTS pipeline_runs_pipeline_spec_id_fkey DEFERRED`) + h8 := &evmtypes.Head{ + Number: 8, + Hash: testutils.NewHash(), + } + h9 := &evmtypes.Head{ + Hash: testutils.NewHash(), + Number: 9, + } + h9.Parent.Store(h8) head := evmtypes.Head{ - Hash: utils.NewHash(), + Hash: testutils.NewHash(), Number: 10, - Parent: &evmtypes.Head{ - Hash: utils.NewHash(), - Number: 9, - Parent: &evmtypes.Head{ - Number: 8, - Hash: utils.NewHash(), - Parent: nil, - }, - }, } + head.Parent.Store(h9) minConfirmations := int64(2) @@ -783,30 +784,6 @@ func TestORM_UpdateTxForRebroadcast(t *testing.T) { }) } -func TestORM_IsTxFinalized(t *testing.T) { - t.Parallel() - - db := pgtest.NewSqlxDB(t) - txStore := cltest.NewTestTxStore(t, db) - ethClient := evmtest.NewEthClientMockWithDefaultChain(t) - - t.Run("confirmed tx not past finality_depth", func(t *testing.T) { - confirmedAddr := cltest.MustGenerateRandomKey(t).Address - tx := mustInsertConfirmedEthTxWithReceipt(t, txStore, confirmedAddr, 123, 1) - finalized, err := txStore.IsTxFinalized(tests.Context(t), 2, tx.ID, ethClient.ConfiguredChainID()) - require.NoError(t, err) - require.False(t, finalized) - }) - - t.Run("confirmed tx past finality_depth", func(t *testing.T) { - confirmedAddr := cltest.MustGenerateRandomKey(t).Address - tx := mustInsertConfirmedEthTxWithReceipt(t, txStore, confirmedAddr, 123, 1) - finalized, err := txStore.IsTxFinalized(tests.Context(t), 10, tx.ID, ethClient.ConfiguredChainID()) - require.NoError(t, err) - require.True(t, finalized) - }) -} - func TestORM_FindTransactionsConfirmedInBlockRange(t *testing.T) { t.Parallel() @@ -816,19 +793,20 @@ func TestORM_FindTransactionsConfirmedInBlockRange(t *testing.T) { ethClient := evmtest.NewEthClientMockWithDefaultChain(t) _, fromAddress := cltest.MustInsertRandomKeyReturningState(t, ethKeyStore) + h8 := &evmtypes.Head{ + Number: 8, + Hash: testutils.NewHash(), + } + h9 := &evmtypes.Head{ + Hash: testutils.NewHash(), + Number: 9, + } + h9.Parent.Store(h8) head := evmtypes.Head{ - Hash: utils.NewHash(), + Hash: testutils.NewHash(), Number: 10, - Parent: &evmtypes.Head{ - Hash: utils.NewHash(), - Number: 9, - Parent: &evmtypes.Head{ - Number: 8, - Hash: utils.NewHash(), - Parent: nil, - }, - }, } + head.Parent.Store(h9) t.Run("find all transactions confirmed in range", func(t *testing.T) { etx_8 := mustInsertConfirmedEthTxWithReceipt(t, txStore, fromAddress, 700, 8) @@ -840,6 +818,12 @@ func TestORM_FindTransactionsConfirmedInBlockRange(t *testing.T) { assert.Equal(t, etxes[0].Sequence, etx_8.Sequence) assert.Equal(t, etxes[1].Sequence, etx_9.Sequence) }) + + t.Run("return empty txes when no transactions in range found", func(t *testing.T) { + etxes, err := txStore.FindTransactionsConfirmedInBlockRange(tests.Context(t), 0, 0, ethClient.ConfiguredChainID()) + require.NoError(t, err) + assert.Len(t, etxes, 0) + }) } func TestORM_FindEarliestUnconfirmedBroadcastTime(t *testing.T) { @@ -1141,13 +1125,14 @@ func TestORM_MarkOldTxesMissingReceiptAsErrored(t *testing.T) { ethKeyStore := cltest.NewKeyStore(t, db).Eth() ethClient := evmtest.NewEthClientMockWithDefaultChain(t) _, fromAddress := cltest.MustInsertRandomKeyReturningState(t, ethKeyStore) + latestFinalizedBlockNum := int64(8) // tx state should be confirmed missing receipt - // attempt should be broadcast before cutoff time + // attempt should be before latestFinalizedBlockNum t.Run("successfully mark errored transactions", func(t *testing.T) { etx := mustInsertConfirmedMissingReceiptEthTxWithLegacyAttempt(t, txStore, 1, 7, time.Now(), fromAddress) - err := txStore.MarkOldTxesMissingReceiptAsErrored(tests.Context(t), 10, 2, ethClient.ConfiguredChainID()) + err := txStore.MarkOldTxesMissingReceiptAsErrored(tests.Context(t), 10, latestFinalizedBlockNum, ethClient.ConfiguredChainID()) require.NoError(t, err) etx, err = txStore.FindTxWithAttempts(ctx, etx.ID) @@ -1157,7 +1142,7 @@ func TestORM_MarkOldTxesMissingReceiptAsErrored(t *testing.T) { t.Run("successfully mark errored transactions w/ qopt passing in sql.Tx", func(t *testing.T) { etx := mustInsertConfirmedMissingReceiptEthTxWithLegacyAttempt(t, txStore, 1, 7, time.Now(), fromAddress) - err := txStore.MarkOldTxesMissingReceiptAsErrored(tests.Context(t), 10, 2, ethClient.ConfiguredChainID()) + err := txStore.MarkOldTxesMissingReceiptAsErrored(tests.Context(t), 10, latestFinalizedBlockNum, ethClient.ConfiguredChainID()) require.NoError(t, err) // must run other query outside of postgres transaction so changes are committed @@ -1382,7 +1367,7 @@ func TestORM_UpdateTxUnstartedToInProgress(t *testing.T) { evmTxmCfg := txmgr.NewEvmTxmConfig(ccfg.EVM()) ec := evmtest.NewEthClientMockWithDefaultChain(t) txMgr := txmgr.NewEvmTxm(ec.ConfiguredChainID(), evmTxmCfg, ccfg.EVM().Transactions(), nil, logger.Test(t), nil, nil, - nil, txStore, nil, nil, nil, nil) + nil, txStore, nil, nil, nil, nil, nil) err := txMgr.XXXTestAbandon(fromAddress) // mark transaction as abandoned require.NoError(t, err) @@ -1871,3 +1856,60 @@ func AssertCountPerSubject(t *testing.T, txStore txmgr.TestEvmTxStore, expected require.NoError(t, err) require.Equal(t, int(expected), count) } + +func TestORM_FindTransactionsByState(t *testing.T) { + t.Parallel() + + ctx := tests.Context(t) + db := pgtest.NewSqlxDB(t) + txStore := cltest.NewTestTxStore(t, db) + kst := cltest.NewKeyStore(t, db) + _, fromAddress := cltest.MustInsertRandomKey(t, kst.Eth()) + finalizedBlockNum := int64(100) + + mustInsertUnstartedTx(t, txStore, fromAddress) + mustInsertInProgressEthTxWithAttempt(t, txStore, 0, fromAddress) + mustInsertUnconfirmedEthTxWithAttemptState(t, txStore, 1, fromAddress, txmgrtypes.TxAttemptBroadcast) + mustInsertConfirmedMissingReceiptEthTxWithLegacyAttempt(t, txStore, 2, finalizedBlockNum, time.Now(), fromAddress) + mustInsertConfirmedEthTxWithReceipt(t, txStore, fromAddress, 3, finalizedBlockNum+1) + mustInsertConfirmedEthTxWithReceipt(t, txStore, fromAddress, 4, finalizedBlockNum) + mustInsertFatalErrorEthTx(t, txStore, fromAddress) + + receipts, err := txStore.FindConfirmedTxesReceipts(ctx, finalizedBlockNum, testutils.FixtureChainID) + require.NoError(t, err) + require.Len(t, receipts, 1) +} + +func TestORM_UpdateTxesFinalized(t *testing.T) { + t.Parallel() + + ctx := tests.Context(t) + db := pgtest.NewSqlxDB(t) + txStore := cltest.NewTestTxStore(t, db) + kst := cltest.NewKeyStore(t, db) + broadcast := time.Now() + _, fromAddress := cltest.MustInsertRandomKey(t, kst.Eth()) + + t.Run("successfully finalizes a confirmed transaction", func(t *testing.T) { + nonce := evmtypes.Nonce(0) + tx := &txmgr.Tx{ + Sequence: &nonce, + FromAddress: fromAddress, + EncodedPayload: []byte{1, 2, 3}, + State: txmgrcommon.TxConfirmed, + BroadcastAt: &broadcast, + InitialBroadcastAt: &broadcast, + } + err := txStore.InsertTx(ctx, tx) + require.NoError(t, err) + attempt := newBroadcastLegacyEthTxAttempt(t, tx.ID) + err = txStore.InsertTxAttempt(ctx, &attempt) + require.NoError(t, err) + receipt := mustInsertEthReceipt(t, txStore, 100, testutils.NewHash(), attempt.Hash) + err = txStore.UpdateTxStatesToFinalizedUsingReceiptIds(ctx, []int64{receipt.ID}, testutils.FixtureChainID) + require.NoError(t, err) + etx, err := txStore.FindTxWithAttempts(ctx, tx.ID) + require.NoError(t, err) + require.Equal(t, txmgrcommon.TxFinalized, etx.State) + }) +} diff --git a/core/chains/evm/txmgr/finalizer.go b/core/chains/evm/txmgr/finalizer.go new file mode 100644 index 00000000000..60744636159 --- /dev/null +++ b/core/chains/evm/txmgr/finalizer.go @@ -0,0 +1,295 @@ +package txmgr + +import ( + "context" + "fmt" + "math/big" + "sync" + "time" + + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/rpc" + + "github.com/smartcontractkit/chainlink-common/pkg/logger" + "github.com/smartcontractkit/chainlink-common/pkg/services" + "github.com/smartcontractkit/chainlink-common/pkg/utils/mailbox" + + evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils" +) + +var _ Finalizer = (*evmFinalizer)(nil) + +// processHeadTimeout represents a sanity limit on how long ProcessHead should take to complete +const processHeadTimeout = 10 * time.Minute + +type finalizerTxStore interface { + FindConfirmedTxesReceipts(ctx context.Context, finalizedBlockNum int64, chainID *big.Int) ([]Receipt, error) + UpdateTxStatesToFinalizedUsingReceiptIds(ctx context.Context, txs []int64, chainId *big.Int) error +} + +type finalizerChainClient interface { + BatchCallContext(ctx context.Context, elems []rpc.BatchElem) error +} + +type finalizerHeadTracker interface { + LatestAndFinalizedBlock(ctx context.Context) (latest, finalized *evmtypes.Head, err error) +} + +// Finalizer handles processing new finalized blocks and marking transactions as finalized accordingly in the TXM DB +type evmFinalizer struct { + services.StateMachine + lggr logger.SugaredLogger + chainId *big.Int + rpcBatchSize int + + txStore finalizerTxStore + client finalizerChainClient + headTracker finalizerHeadTracker + + mb *mailbox.Mailbox[*evmtypes.Head] + stopCh services.StopChan + wg sync.WaitGroup + + lastProcessedFinalizedBlockNum int64 +} + +func NewEvmFinalizer( + lggr logger.Logger, + chainId *big.Int, + rpcBatchSize uint32, + txStore finalizerTxStore, + client finalizerChainClient, + headTracker finalizerHeadTracker, +) *evmFinalizer { + lggr = logger.Named(lggr, "Finalizer") + return &evmFinalizer{ + lggr: logger.Sugared(lggr), + chainId: chainId, + rpcBatchSize: int(rpcBatchSize), + txStore: txStore, + client: client, + headTracker: headTracker, + mb: mailbox.NewSingle[*evmtypes.Head](), + } +} + +// Start the finalizer +func (f *evmFinalizer) Start(ctx context.Context) error { + return f.StartOnce("Finalizer", func() error { + f.lggr.Debugf("started Finalizer with RPC batch size limit: %d", f.rpcBatchSize) + f.stopCh = make(chan struct{}) + f.wg.Add(1) + go f.runLoop() + return nil + }) +} + +// Close the finalizer +func (f *evmFinalizer) Close() error { + return f.StopOnce("Finalizer", func() error { + f.lggr.Debug("closing Finalizer") + close(f.stopCh) + f.wg.Wait() + return nil + }) +} + +func (f *evmFinalizer) Name() string { + return f.lggr.Name() +} + +func (f *evmFinalizer) HealthReport() map[string]error { + return map[string]error{f.Name(): f.Healthy()} +} + +func (f *evmFinalizer) runLoop() { + defer f.wg.Done() + ctx, cancel := f.stopCh.NewCtx() + defer cancel() + for { + select { + case <-f.mb.Notify(): + for { + if ctx.Err() != nil { + return + } + head, exists := f.mb.Retrieve() + if !exists { + break + } + if err := f.ProcessHead(ctx, head); err != nil { + f.lggr.Errorw("Error processing head", "err", err) + f.SvcErrBuffer.Append(err) + continue + } + } + case <-ctx.Done(): + return + } + } +} + +func (f *evmFinalizer) DeliverLatestHead(head *evmtypes.Head) bool { + return f.mb.Deliver(head) +} + +func (f *evmFinalizer) ProcessHead(ctx context.Context, head *evmtypes.Head) error { + ctx, cancel := context.WithTimeout(ctx, processHeadTimeout) + defer cancel() + _, latestFinalizedHead, err := f.headTracker.LatestAndFinalizedBlock(ctx) + if err != nil { + return fmt.Errorf("failed to retrieve latest finalized head: %w", err) + } + return f.processFinalizedHead(ctx, latestFinalizedHead) +} + +// Determines if any confirmed transactions can be marked as finalized by comparing their receipts against the latest finalized block +func (f *evmFinalizer) processFinalizedHead(ctx context.Context, latestFinalizedHead *evmtypes.Head) error { + // Cannot determine finality without a finalized head for comparison + if latestFinalizedHead == nil || !latestFinalizedHead.IsValid() { + return fmt.Errorf("invalid latestFinalizedHead") + } + // Only continue processing if the latestFinalizedHead has not already been processed + // Helps avoid unnecessary processing on every head if blocks are finalized in batches + if latestFinalizedHead.BlockNumber() == f.lastProcessedFinalizedBlockNum { + return nil + } + if latestFinalizedHead.BlockNumber() < f.lastProcessedFinalizedBlockNum { + f.lggr.Errorw("Received finalized block older than one already processed. This should never happen and could be an issue with RPCs.", "lastProcessedFinalizedBlockNum", f.lastProcessedFinalizedBlockNum, "retrievedFinalizedBlockNum", latestFinalizedHead.BlockNumber()) + return nil + } + + earliestBlockNumInChain := latestFinalizedHead.EarliestHeadInChain().BlockNumber() + f.lggr.Debugw("processing latest finalized head", "blockNum", latestFinalizedHead.BlockNumber(), "blockHash", latestFinalizedHead.BlockHash(), "earliestBlockNumInChain", earliestBlockNumInChain) + + // Retrieve all confirmed transactions with receipts older than or equal to the finalized block, loaded with attempts and receipts + unfinalizedReceipts, err := f.txStore.FindConfirmedTxesReceipts(ctx, latestFinalizedHead.BlockNumber(), f.chainId) + if err != nil { + return fmt.Errorf("failed to retrieve receipts for confirmed, unfinalized transactions: %w", err) + } + + var finalizedReceipts []Receipt + // Group by block hash transactions whose receipts cannot be validated using the cached heads + blockNumToReceiptsMap := make(map[int64][]Receipt) + // Find transactions with receipt block nums older than the latest finalized block num and block hashes still in chain + for _, receipt := range unfinalizedReceipts { + // The tx store query ensures transactions have receipts but leaving this check here for a belts and braces approach + if receipt.TxHash == utils.EmptyHash || receipt.BlockHash == utils.EmptyHash { + f.lggr.AssumptionViolationw("invalid receipt found for confirmed transaction", "receipt", receipt) + continue + } + // The tx store query only returns transactions with receipts older than or equal to the finalized block but leaving this check here for a belts and braces approach + if receipt.BlockNumber > latestFinalizedHead.BlockNumber() { + continue + } + // Receipt block num older than earliest head in chain. Validate hash using RPC call later + if receipt.BlockNumber < earliestBlockNumInChain { + blockNumToReceiptsMap[receipt.BlockNumber] = append(blockNumToReceiptsMap[receipt.BlockNumber], receipt) + continue + } + blockHashInChain := latestFinalizedHead.HashAtHeight(receipt.BlockNumber) + // Receipt block hash does not match the block hash in chain. Transaction has been re-org'd out but DB state has not been updated yet + if blockHashInChain.String() != receipt.BlockHash.String() { + // Log error if a transaction is marked as confirmed with a receipt older than the finalized block + // This scenario could potentially point to a re-org'd transaction the Confirmer has lost track of + f.lggr.Errorw("found confirmed transaction with re-org'd receipt older than finalized block", "receipt", receipt, "onchainBlockHash", blockHashInChain.String()) + continue + } + finalizedReceipts = append(finalizedReceipts, receipt) + } + + // Check if block hashes exist for receipts on-chain older than the earliest cached head + // Transactions are grouped by their receipt block hash to avoid repeat requests on the same hash in case transactions were confirmed in the same block + validatedReceipts := f.batchCheckReceiptHashesOnchain(ctx, blockNumToReceiptsMap) + finalizedReceipts = append(finalizedReceipts, validatedReceipts...) + + receiptIDs := f.buildReceiptIdList(finalizedReceipts) + + err = f.txStore.UpdateTxStatesToFinalizedUsingReceiptIds(ctx, receiptIDs, f.chainId) + if err != nil { + return fmt.Errorf("failed to update transactions as finalized: %w", err) + } + // Update lastProcessedFinalizedBlockNum after processing has completed to allow failed processing to retry on subsequent heads + // Does not need to be protected with mutex lock because the Finalizer only runs in a single loop + f.lastProcessedFinalizedBlockNum = latestFinalizedHead.BlockNumber() + return nil +} + +func (f *evmFinalizer) batchCheckReceiptHashesOnchain(ctx context.Context, blockNumToReceiptsMap map[int64][]Receipt) []Receipt { + if len(blockNumToReceiptsMap) == 0 { + return nil + } + // Group the RPC batch calls in groups of rpcBatchSize + var rpcBatchGroups [][]rpc.BatchElem + var rpcBatch []rpc.BatchElem + for blockNum := range blockNumToReceiptsMap { + elem := rpc.BatchElem{ + Method: "eth_getBlockByNumber", + Args: []any{ + hexutil.EncodeBig(big.NewInt(blockNum)), + false, + }, + Result: new(evmtypes.Head), + } + rpcBatch = append(rpcBatch, elem) + if len(rpcBatch) >= f.rpcBatchSize { + rpcBatchGroups = append(rpcBatchGroups, rpcBatch) + rpcBatch = []rpc.BatchElem{} + } + } + if len(rpcBatch) > 0 { + rpcBatchGroups = append(rpcBatchGroups, rpcBatch) + } + + var finalizedReceipts []Receipt + for _, rpcBatch := range rpcBatchGroups { + err := f.client.BatchCallContext(ctx, rpcBatch) + if err != nil { + // Continue if batch RPC call failed so other batches can still be considered for finalization + f.lggr.Errorw("failed to find blocks due to batch call failure", "error", err) + continue + } + for _, req := range rpcBatch { + if req.Error != nil { + // Continue if particular RPC call failed so other txs can still be considered for finalization + f.lggr.Errorw("failed to find block by number", "blockNum", req.Args[0], "error", req.Error) + continue + } + head, ok := req.Result.(*evmtypes.Head) + if !ok || !head.IsValid() { + // Continue if particular RPC call yielded a nil block so other txs can still be considered for finalization + f.lggr.Errorw("retrieved nil head for block number", "blockNum", req.Args[0]) + continue + } + receipts := blockNumToReceiptsMap[head.BlockNumber()] + // Check if transaction receipts match the block hash at the given block num + // If they do not, the transactions may have been re-org'd out + // The expectation is for the Confirmer to pick up on these re-orgs and get the transaction included + for _, receipt := range receipts { + if receipt.BlockHash.String() == head.BlockHash().String() { + finalizedReceipts = append(finalizedReceipts, receipt) + } else { + // Log error if a transaction is marked as confirmed with a receipt older than the finalized block + // This scenario could potentially point to a re-org'd transaction the Confirmer has lost track of + f.lggr.Errorw("found confirmed transaction with re-org'd receipt older than finalized block", "receipt", receipt, "onchainBlockHash", head.BlockHash().String()) + } + } + } + } + return finalizedReceipts +} + +// Build list of transaction IDs +func (f *evmFinalizer) buildReceiptIdList(finalizedReceipts []Receipt) []int64 { + receiptIds := make([]int64, len(finalizedReceipts)) + for i, receipt := range finalizedReceipts { + f.lggr.Debugw("transaction considered finalized", + "txHash", receipt.TxHash.String(), + "receiptBlockNum", receipt.BlockNumber, + "receiptBlockHash", receipt.BlockHash.String(), + ) + receiptIds[i] = receipt.ID + } + return receiptIds +} diff --git a/core/chains/evm/txmgr/finalizer_test.go b/core/chains/evm/txmgr/finalizer_test.go new file mode 100644 index 00000000000..b91121d773f --- /dev/null +++ b/core/chains/evm/txmgr/finalizer_test.go @@ -0,0 +1,241 @@ +package txmgr_test + +import ( + "errors" + "math/big" + "testing" + "time" + + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/rpc" + "github.com/google/uuid" + "github.com/stretchr/testify/mock" + "github.com/stretchr/testify/require" + + "github.com/smartcontractkit/chainlink-common/pkg/logger" + "github.com/smartcontractkit/chainlink-common/pkg/services/servicetest" + "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" + + txmgrcommon "github.com/smartcontractkit/chainlink/v2/common/txmgr" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/headtracker" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/testutils" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/txmgr" + evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils" + "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/pgtest" +) + +func TestFinalizer_MarkTxFinalized(t *testing.T) { + t.Parallel() + ctx := tests.Context(t) + db := pgtest.NewSqlxDB(t) + txStore := cltest.NewTestTxStore(t, db) + ethKeyStore := cltest.NewKeyStore(t, db).Eth() + feeLimit := uint64(10_000) + ethClient := testutils.NewEthClientMockWithDefaultChain(t) + rpcBatchSize := uint32(1) + ht := headtracker.NewSimulatedHeadTracker(ethClient, true, 0) + + h99 := &evmtypes.Head{ + Hash: utils.NewHash(), + Number: 99, + } + h99.IsFinalized.Store(true) + head := &evmtypes.Head{ + Hash: utils.NewHash(), + Number: 100, + } + head.Parent.Store(h99) + + t.Run("returns not finalized for tx with receipt newer than finalized block", func(t *testing.T) { + finalizer := txmgr.NewEvmFinalizer(logger.Test(t), testutils.FixtureChainID, rpcBatchSize, txStore, ethClient, ht) + servicetest.Run(t, finalizer) + + idempotencyKey := uuid.New().String() + _, fromAddress := cltest.MustInsertRandomKey(t, ethKeyStore) + nonce := evmtypes.Nonce(0) + broadcast := time.Now() + tx := &txmgr.Tx{ + Sequence: &nonce, + IdempotencyKey: &idempotencyKey, + FromAddress: fromAddress, + EncodedPayload: []byte{1, 2, 3}, + FeeLimit: feeLimit, + State: txmgrcommon.TxConfirmed, + BroadcastAt: &broadcast, + InitialBroadcastAt: &broadcast, + } + attemptHash := insertTxAndAttemptWithIdempotencyKey(t, txStore, tx, idempotencyKey) + // Insert receipt for unfinalized block num + mustInsertEthReceipt(t, txStore, head.Number, head.Hash, attemptHash) + ethClient.On("HeadByNumber", mock.Anything, mock.Anything).Return(head, nil).Once() + ethClient.On("LatestFinalizedBlock", mock.Anything).Return(head.Parent.Load(), nil).Once() + err := finalizer.ProcessHead(ctx, head) + require.NoError(t, err) + tx, err = txStore.FindTxWithIdempotencyKey(ctx, idempotencyKey, testutils.FixtureChainID) + require.NoError(t, err) + require.Equal(t, txmgrcommon.TxConfirmed, tx.State) + }) + + t.Run("returns not finalized for tx with receipt re-org'd out", func(t *testing.T) { + finalizer := txmgr.NewEvmFinalizer(logger.Test(t), testutils.FixtureChainID, rpcBatchSize, txStore, ethClient, ht) + servicetest.Run(t, finalizer) + + idempotencyKey := uuid.New().String() + _, fromAddress := cltest.MustInsertRandomKey(t, ethKeyStore) + nonce := evmtypes.Nonce(0) + broadcast := time.Now() + tx := &txmgr.Tx{ + Sequence: &nonce, + IdempotencyKey: &idempotencyKey, + FromAddress: fromAddress, + EncodedPayload: []byte{1, 2, 3}, + FeeLimit: feeLimit, + State: txmgrcommon.TxConfirmed, + BroadcastAt: &broadcast, + InitialBroadcastAt: &broadcast, + } + attemptHash := insertTxAndAttemptWithIdempotencyKey(t, txStore, tx, idempotencyKey) + // Insert receipt for finalized block num + mustInsertEthReceipt(t, txStore, head.Parent.Load().Number, utils.NewHash(), attemptHash) + ethClient.On("HeadByNumber", mock.Anything, mock.Anything).Return(head, nil).Once() + ethClient.On("LatestFinalizedBlock", mock.Anything).Return(head.Parent.Load(), nil).Once() + err := finalizer.ProcessHead(ctx, head) + require.NoError(t, err) + tx, err = txStore.FindTxWithIdempotencyKey(ctx, idempotencyKey, testutils.FixtureChainID) + require.NoError(t, err) + require.Equal(t, txmgrcommon.TxConfirmed, tx.State) + }) + + t.Run("returns finalized for tx with receipt in a finalized block", func(t *testing.T) { + finalizer := txmgr.NewEvmFinalizer(logger.Test(t), testutils.FixtureChainID, rpcBatchSize, txStore, ethClient, ht) + servicetest.Run(t, finalizer) + + idempotencyKey := uuid.New().String() + _, fromAddress := cltest.MustInsertRandomKey(t, ethKeyStore) + nonce := evmtypes.Nonce(0) + broadcast := time.Now() + tx := &txmgr.Tx{ + Sequence: &nonce, + IdempotencyKey: &idempotencyKey, + FromAddress: fromAddress, + EncodedPayload: []byte{1, 2, 3}, + FeeLimit: feeLimit, + State: txmgrcommon.TxConfirmed, + BroadcastAt: &broadcast, + InitialBroadcastAt: &broadcast, + } + attemptHash := insertTxAndAttemptWithIdempotencyKey(t, txStore, tx, idempotencyKey) + // Insert receipt for finalized block num + mustInsertEthReceipt(t, txStore, head.Parent.Load().Number, head.Parent.Load().Hash, attemptHash) + ethClient.On("HeadByNumber", mock.Anything, mock.Anything).Return(head, nil).Once() + ethClient.On("LatestFinalizedBlock", mock.Anything).Return(head.Parent.Load(), nil).Once() + err := finalizer.ProcessHead(ctx, head) + require.NoError(t, err) + tx, err = txStore.FindTxWithIdempotencyKey(ctx, idempotencyKey, testutils.FixtureChainID) + require.NoError(t, err) + require.Equal(t, txmgrcommon.TxFinalized, tx.State) + }) + + t.Run("returns finalized for tx with receipt older than block history depth", func(t *testing.T) { + finalizer := txmgr.NewEvmFinalizer(logger.Test(t), testutils.FixtureChainID, rpcBatchSize, txStore, ethClient, ht) + servicetest.Run(t, finalizer) + + idempotencyKey := uuid.New().String() + _, fromAddress := cltest.MustInsertRandomKey(t, ethKeyStore) + nonce := evmtypes.Nonce(0) + broadcast := time.Now() + tx := &txmgr.Tx{ + Sequence: &nonce, + IdempotencyKey: &idempotencyKey, + FromAddress: fromAddress, + EncodedPayload: []byte{1, 2, 3}, + FeeLimit: feeLimit, + State: txmgrcommon.TxConfirmed, + BroadcastAt: &broadcast, + InitialBroadcastAt: &broadcast, + } + attemptHash := insertTxAndAttemptWithIdempotencyKey(t, txStore, tx, idempotencyKey) + // Insert receipt for finalized block num + receiptBlockHash1 := utils.NewHash() + mustInsertEthReceipt(t, txStore, head.Parent.Load().Number-2, receiptBlockHash1, attemptHash) + idempotencyKey = uuid.New().String() + nonce = evmtypes.Nonce(1) + tx = &txmgr.Tx{ + Sequence: &nonce, + IdempotencyKey: &idempotencyKey, + FromAddress: fromAddress, + EncodedPayload: []byte{1, 2, 3}, + FeeLimit: feeLimit, + State: txmgrcommon.TxConfirmed, + BroadcastAt: &broadcast, + InitialBroadcastAt: &broadcast, + } + attemptHash = insertTxAndAttemptWithIdempotencyKey(t, txStore, tx, idempotencyKey) + // Insert receipt for finalized block num + receiptBlockHash2 := utils.NewHash() + mustInsertEthReceipt(t, txStore, head.Parent.Load().Number-1, receiptBlockHash2, attemptHash) + // Separate batch calls will be made for each tx due to RPC batch size set to 1 when finalizer initialized above + ethClient.On("BatchCallContext", mock.Anything, mock.IsType([]rpc.BatchElem{})).Run(func(args mock.Arguments) { + rpcElements := args.Get(1).([]rpc.BatchElem) + require.Equal(t, 1, len(rpcElements)) + + require.Equal(t, "eth_getBlockByNumber", rpcElements[0].Method) + require.Equal(t, false, rpcElements[0].Args[1]) + + reqBlockNum := rpcElements[0].Args[0].(string) + req1BlockNum := hexutil.EncodeBig(big.NewInt(head.Parent.Load().Number - 2)) + req2BlockNum := hexutil.EncodeBig(big.NewInt(head.Parent.Load().Number - 1)) + var headResult evmtypes.Head + if req1BlockNum == reqBlockNum { + headResult = evmtypes.Head{Number: head.Parent.Load().Number - 2, Hash: receiptBlockHash1} + } else if req2BlockNum == reqBlockNum { + headResult = evmtypes.Head{Number: head.Parent.Load().Number - 1, Hash: receiptBlockHash2} + } else { + require.Fail(t, "unrecognized block hash") + } + rpcElements[0].Result = &headResult + }).Return(nil).Twice() + ethClient.On("HeadByNumber", mock.Anything, mock.Anything).Return(head, nil).Once() + ethClient.On("LatestFinalizedBlock", mock.Anything).Return(head.Parent.Load(), nil).Once() + err := finalizer.ProcessHead(ctx, head) + require.NoError(t, err) + tx, err = txStore.FindTxWithIdempotencyKey(ctx, idempotencyKey, testutils.FixtureChainID) + require.NoError(t, err) + require.Equal(t, txmgrcommon.TxFinalized, tx.State) + }) + + t.Run("returns error if failed to retrieve latest head in headtracker", func(t *testing.T) { + finalizer := txmgr.NewEvmFinalizer(logger.Test(t), testutils.FixtureChainID, rpcBatchSize, txStore, ethClient, ht) + servicetest.Run(t, finalizer) + + ethClient.On("HeadByNumber", mock.Anything, mock.Anything).Return(nil, errors.New("failed to get latest head")).Once() + err := finalizer.ProcessHead(ctx, head) + require.Error(t, err) + }) + + t.Run("returns error if failed to calculate latest finalized head in headtracker", func(t *testing.T) { + finalizer := txmgr.NewEvmFinalizer(logger.Test(t), testutils.FixtureChainID, rpcBatchSize, txStore, ethClient, ht) + servicetest.Run(t, finalizer) + + ethClient.On("HeadByNumber", mock.Anything, mock.Anything).Return(head, nil).Once() + ethClient.On("LatestFinalizedBlock", mock.Anything).Return(nil, errors.New("failed to calculate latest finalized head")).Once() + err := finalizer.ProcessHead(ctx, head) + require.Error(t, err) + }) +} + +func insertTxAndAttemptWithIdempotencyKey(t *testing.T, txStore txmgr.TestEvmTxStore, tx *txmgr.Tx, idempotencyKey string) common.Hash { + ctx := tests.Context(t) + err := txStore.InsertTx(ctx, tx) + require.NoError(t, err) + tx, err = txStore.FindTxWithIdempotencyKey(ctx, idempotencyKey, testutils.FixtureChainID) + require.NoError(t, err) + attempt := cltest.NewLegacyEthTxAttempt(t, tx.ID) + err = txStore.InsertTxAttempt(ctx, &attempt) + require.NoError(t, err) + return attempt.Hash +} diff --git a/core/chains/evm/txmgr/mocks/config.go b/core/chains/evm/txmgr/mocks/config.go index efaaab68afa..887bd175469 100644 --- a/core/chains/evm/txmgr/mocks/config.go +++ b/core/chains/evm/txmgr/mocks/config.go @@ -12,6 +12,14 @@ type Config struct { mock.Mock } +type Config_Expecter struct { + mock *mock.Mock +} + +func (_m *Config) EXPECT() *Config_Expecter { + return &Config_Expecter{mock: &_m.Mock} +} + // ChainType provides a mock function with given fields: func (_m *Config) ChainType() chaintype.ChainType { ret := _m.Called() @@ -30,6 +38,33 @@ func (_m *Config) ChainType() chaintype.ChainType { return r0 } +// Config_ChainType_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ChainType' +type Config_ChainType_Call struct { + *mock.Call +} + +// ChainType is a helper method to define mock.On call +func (_e *Config_Expecter) ChainType() *Config_ChainType_Call { + return &Config_ChainType_Call{Call: _e.mock.On("ChainType")} +} + +func (_c *Config_ChainType_Call) Run(run func()) *Config_ChainType_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Config_ChainType_Call) Return(_a0 chaintype.ChainType) *Config_ChainType_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Config_ChainType_Call) RunAndReturn(run func() chaintype.ChainType) *Config_ChainType_Call { + _c.Call.Return(run) + return _c +} + // FinalityDepth provides a mock function with given fields: func (_m *Config) FinalityDepth() uint32 { ret := _m.Called() @@ -48,6 +83,33 @@ func (_m *Config) FinalityDepth() uint32 { return r0 } +// Config_FinalityDepth_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FinalityDepth' +type Config_FinalityDepth_Call struct { + *mock.Call +} + +// FinalityDepth is a helper method to define mock.On call +func (_e *Config_Expecter) FinalityDepth() *Config_FinalityDepth_Call { + return &Config_FinalityDepth_Call{Call: _e.mock.On("FinalityDepth")} +} + +func (_c *Config_FinalityDepth_Call) Run(run func()) *Config_FinalityDepth_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Config_FinalityDepth_Call) Return(_a0 uint32) *Config_FinalityDepth_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Config_FinalityDepth_Call) RunAndReturn(run func() uint32) *Config_FinalityDepth_Call { + _c.Call.Return(run) + return _c +} + // FinalityTagEnabled provides a mock function with given fields: func (_m *Config) FinalityTagEnabled() bool { ret := _m.Called() @@ -66,6 +128,33 @@ func (_m *Config) FinalityTagEnabled() bool { return r0 } +// Config_FinalityTagEnabled_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FinalityTagEnabled' +type Config_FinalityTagEnabled_Call struct { + *mock.Call +} + +// FinalityTagEnabled is a helper method to define mock.On call +func (_e *Config_Expecter) FinalityTagEnabled() *Config_FinalityTagEnabled_Call { + return &Config_FinalityTagEnabled_Call{Call: _e.mock.On("FinalityTagEnabled")} +} + +func (_c *Config_FinalityTagEnabled_Call) Run(run func()) *Config_FinalityTagEnabled_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Config_FinalityTagEnabled_Call) Return(_a0 bool) *Config_FinalityTagEnabled_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Config_FinalityTagEnabled_Call) RunAndReturn(run func() bool) *Config_FinalityTagEnabled_Call { + _c.Call.Return(run) + return _c +} + // NonceAutoSync provides a mock function with given fields: func (_m *Config) NonceAutoSync() bool { ret := _m.Called() @@ -84,6 +173,33 @@ func (_m *Config) NonceAutoSync() bool { return r0 } +// Config_NonceAutoSync_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NonceAutoSync' +type Config_NonceAutoSync_Call struct { + *mock.Call +} + +// NonceAutoSync is a helper method to define mock.On call +func (_e *Config_Expecter) NonceAutoSync() *Config_NonceAutoSync_Call { + return &Config_NonceAutoSync_Call{Call: _e.mock.On("NonceAutoSync")} +} + +func (_c *Config_NonceAutoSync_Call) Run(run func()) *Config_NonceAutoSync_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Config_NonceAutoSync_Call) Return(_a0 bool) *Config_NonceAutoSync_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Config_NonceAutoSync_Call) RunAndReturn(run func() bool) *Config_NonceAutoSync_Call { + _c.Call.Return(run) + return _c +} + // RPCDefaultBatchSize provides a mock function with given fields: func (_m *Config) RPCDefaultBatchSize() uint32 { ret := _m.Called() @@ -102,6 +218,33 @@ func (_m *Config) RPCDefaultBatchSize() uint32 { return r0 } +// Config_RPCDefaultBatchSize_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RPCDefaultBatchSize' +type Config_RPCDefaultBatchSize_Call struct { + *mock.Call +} + +// RPCDefaultBatchSize is a helper method to define mock.On call +func (_e *Config_Expecter) RPCDefaultBatchSize() *Config_RPCDefaultBatchSize_Call { + return &Config_RPCDefaultBatchSize_Call{Call: _e.mock.On("RPCDefaultBatchSize")} +} + +func (_c *Config_RPCDefaultBatchSize_Call) Run(run func()) *Config_RPCDefaultBatchSize_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Config_RPCDefaultBatchSize_Call) Return(_a0 uint32) *Config_RPCDefaultBatchSize_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Config_RPCDefaultBatchSize_Call) RunAndReturn(run func() uint32) *Config_RPCDefaultBatchSize_Call { + _c.Call.Return(run) + return _c +} + // NewConfig creates a new instance of Config. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewConfig(t interface { diff --git a/core/chains/evm/txmgr/mocks/evm_tx_store.go b/core/chains/evm/txmgr/mocks/evm_tx_store.go index 5a699f71bf9..a9a175e3d94 100644 --- a/core/chains/evm/txmgr/mocks/evm_tx_store.go +++ b/core/chains/evm/txmgr/mocks/evm_tx_store.go @@ -18,6 +18,8 @@ import ( time "time" + txmgr "github.com/smartcontractkit/chainlink/v2/core/chains/evm/txmgr" + types "github.com/smartcontractkit/chainlink/v2/common/txmgr/types" uuid "github.com/google/uuid" @@ -28,6 +30,14 @@ type EvmTxStore struct { mock.Mock } +type EvmTxStore_Expecter struct { + mock *mock.Mock +} + +func (_m *EvmTxStore) EXPECT() *EvmTxStore_Expecter { + return &EvmTxStore_Expecter{mock: &_m.Mock} +} + // Abandon provides a mock function with given fields: ctx, id, addr func (_m *EvmTxStore) Abandon(ctx context.Context, id *big.Int, addr common.Address) error { ret := _m.Called(ctx, id, addr) @@ -46,6 +56,36 @@ func (_m *EvmTxStore) Abandon(ctx context.Context, id *big.Int, addr common.Addr return r0 } +// EvmTxStore_Abandon_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Abandon' +type EvmTxStore_Abandon_Call struct { + *mock.Call +} + +// Abandon is a helper method to define mock.On call +// - ctx context.Context +// - id *big.Int +// - addr common.Address +func (_e *EvmTxStore_Expecter) Abandon(ctx interface{}, id interface{}, addr interface{}) *EvmTxStore_Abandon_Call { + return &EvmTxStore_Abandon_Call{Call: _e.mock.On("Abandon", ctx, id, addr)} +} + +func (_c *EvmTxStore_Abandon_Call) Run(run func(ctx context.Context, id *big.Int, addr common.Address)) *EvmTxStore_Abandon_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*big.Int), args[2].(common.Address)) + }) + return _c +} + +func (_c *EvmTxStore_Abandon_Call) Return(_a0 error) *EvmTxStore_Abandon_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *EvmTxStore_Abandon_Call) RunAndReturn(run func(context.Context, *big.Int, common.Address) error) *EvmTxStore_Abandon_Call { + _c.Call.Return(run) + return _c +} + // CheckTxQueueCapacity provides a mock function with given fields: ctx, fromAddress, maxQueuedTransactions, chainID func (_m *EvmTxStore) CheckTxQueueCapacity(ctx context.Context, fromAddress common.Address, maxQueuedTransactions uint64, chainID *big.Int) error { ret := _m.Called(ctx, fromAddress, maxQueuedTransactions, chainID) @@ -64,11 +104,69 @@ func (_m *EvmTxStore) CheckTxQueueCapacity(ctx context.Context, fromAddress comm return r0 } +// EvmTxStore_CheckTxQueueCapacity_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CheckTxQueueCapacity' +type EvmTxStore_CheckTxQueueCapacity_Call struct { + *mock.Call +} + +// CheckTxQueueCapacity is a helper method to define mock.On call +// - ctx context.Context +// - fromAddress common.Address +// - maxQueuedTransactions uint64 +// - chainID *big.Int +func (_e *EvmTxStore_Expecter) CheckTxQueueCapacity(ctx interface{}, fromAddress interface{}, maxQueuedTransactions interface{}, chainID interface{}) *EvmTxStore_CheckTxQueueCapacity_Call { + return &EvmTxStore_CheckTxQueueCapacity_Call{Call: _e.mock.On("CheckTxQueueCapacity", ctx, fromAddress, maxQueuedTransactions, chainID)} +} + +func (_c *EvmTxStore_CheckTxQueueCapacity_Call) Run(run func(ctx context.Context, fromAddress common.Address, maxQueuedTransactions uint64, chainID *big.Int)) *EvmTxStore_CheckTxQueueCapacity_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(common.Address), args[2].(uint64), args[3].(*big.Int)) + }) + return _c +} + +func (_c *EvmTxStore_CheckTxQueueCapacity_Call) Return(err error) *EvmTxStore_CheckTxQueueCapacity_Call { + _c.Call.Return(err) + return _c +} + +func (_c *EvmTxStore_CheckTxQueueCapacity_Call) RunAndReturn(run func(context.Context, common.Address, uint64, *big.Int) error) *EvmTxStore_CheckTxQueueCapacity_Call { + _c.Call.Return(run) + return _c +} + // Close provides a mock function with given fields: func (_m *EvmTxStore) Close() { _m.Called() } +// EvmTxStore_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close' +type EvmTxStore_Close_Call struct { + *mock.Call +} + +// Close is a helper method to define mock.On call +func (_e *EvmTxStore_Expecter) Close() *EvmTxStore_Close_Call { + return &EvmTxStore_Close_Call{Call: _e.mock.On("Close")} +} + +func (_c *EvmTxStore_Close_Call) Run(run func()) *EvmTxStore_Close_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *EvmTxStore_Close_Call) Return() *EvmTxStore_Close_Call { + _c.Call.Return() + return _c +} + +func (_c *EvmTxStore_Close_Call) RunAndReturn(run func()) *EvmTxStore_Close_Call { + _c.Call.Return(run) + return _c +} + // CountTransactionsByState provides a mock function with given fields: ctx, state, chainID func (_m *EvmTxStore) CountTransactionsByState(ctx context.Context, state types.TxState, chainID *big.Int) (uint32, error) { ret := _m.Called(ctx, state, chainID) @@ -97,6 +195,36 @@ func (_m *EvmTxStore) CountTransactionsByState(ctx context.Context, state types. return r0, r1 } +// EvmTxStore_CountTransactionsByState_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CountTransactionsByState' +type EvmTxStore_CountTransactionsByState_Call struct { + *mock.Call +} + +// CountTransactionsByState is a helper method to define mock.On call +// - ctx context.Context +// - state types.TxState +// - chainID *big.Int +func (_e *EvmTxStore_Expecter) CountTransactionsByState(ctx interface{}, state interface{}, chainID interface{}) *EvmTxStore_CountTransactionsByState_Call { + return &EvmTxStore_CountTransactionsByState_Call{Call: _e.mock.On("CountTransactionsByState", ctx, state, chainID)} +} + +func (_c *EvmTxStore_CountTransactionsByState_Call) Run(run func(ctx context.Context, state types.TxState, chainID *big.Int)) *EvmTxStore_CountTransactionsByState_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(types.TxState), args[2].(*big.Int)) + }) + return _c +} + +func (_c *EvmTxStore_CountTransactionsByState_Call) Return(count uint32, err error) *EvmTxStore_CountTransactionsByState_Call { + _c.Call.Return(count, err) + return _c +} + +func (_c *EvmTxStore_CountTransactionsByState_Call) RunAndReturn(run func(context.Context, types.TxState, *big.Int) (uint32, error)) *EvmTxStore_CountTransactionsByState_Call { + _c.Call.Return(run) + return _c +} + // CountUnconfirmedTransactions provides a mock function with given fields: ctx, fromAddress, chainID func (_m *EvmTxStore) CountUnconfirmedTransactions(ctx context.Context, fromAddress common.Address, chainID *big.Int) (uint32, error) { ret := _m.Called(ctx, fromAddress, chainID) @@ -125,6 +253,36 @@ func (_m *EvmTxStore) CountUnconfirmedTransactions(ctx context.Context, fromAddr return r0, r1 } +// EvmTxStore_CountUnconfirmedTransactions_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CountUnconfirmedTransactions' +type EvmTxStore_CountUnconfirmedTransactions_Call struct { + *mock.Call +} + +// CountUnconfirmedTransactions is a helper method to define mock.On call +// - ctx context.Context +// - fromAddress common.Address +// - chainID *big.Int +func (_e *EvmTxStore_Expecter) CountUnconfirmedTransactions(ctx interface{}, fromAddress interface{}, chainID interface{}) *EvmTxStore_CountUnconfirmedTransactions_Call { + return &EvmTxStore_CountUnconfirmedTransactions_Call{Call: _e.mock.On("CountUnconfirmedTransactions", ctx, fromAddress, chainID)} +} + +func (_c *EvmTxStore_CountUnconfirmedTransactions_Call) Run(run func(ctx context.Context, fromAddress common.Address, chainID *big.Int)) *EvmTxStore_CountUnconfirmedTransactions_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(common.Address), args[2].(*big.Int)) + }) + return _c +} + +func (_c *EvmTxStore_CountUnconfirmedTransactions_Call) Return(count uint32, err error) *EvmTxStore_CountUnconfirmedTransactions_Call { + _c.Call.Return(count, err) + return _c +} + +func (_c *EvmTxStore_CountUnconfirmedTransactions_Call) RunAndReturn(run func(context.Context, common.Address, *big.Int) (uint32, error)) *EvmTxStore_CountUnconfirmedTransactions_Call { + _c.Call.Return(run) + return _c +} + // CountUnstartedTransactions provides a mock function with given fields: ctx, fromAddress, chainID func (_m *EvmTxStore) CountUnstartedTransactions(ctx context.Context, fromAddress common.Address, chainID *big.Int) (uint32, error) { ret := _m.Called(ctx, fromAddress, chainID) @@ -153,6 +311,36 @@ func (_m *EvmTxStore) CountUnstartedTransactions(ctx context.Context, fromAddres return r0, r1 } +// EvmTxStore_CountUnstartedTransactions_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CountUnstartedTransactions' +type EvmTxStore_CountUnstartedTransactions_Call struct { + *mock.Call +} + +// CountUnstartedTransactions is a helper method to define mock.On call +// - ctx context.Context +// - fromAddress common.Address +// - chainID *big.Int +func (_e *EvmTxStore_Expecter) CountUnstartedTransactions(ctx interface{}, fromAddress interface{}, chainID interface{}) *EvmTxStore_CountUnstartedTransactions_Call { + return &EvmTxStore_CountUnstartedTransactions_Call{Call: _e.mock.On("CountUnstartedTransactions", ctx, fromAddress, chainID)} +} + +func (_c *EvmTxStore_CountUnstartedTransactions_Call) Run(run func(ctx context.Context, fromAddress common.Address, chainID *big.Int)) *EvmTxStore_CountUnstartedTransactions_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(common.Address), args[2].(*big.Int)) + }) + return _c +} + +func (_c *EvmTxStore_CountUnstartedTransactions_Call) Return(count uint32, err error) *EvmTxStore_CountUnstartedTransactions_Call { + _c.Call.Return(count, err) + return _c +} + +func (_c *EvmTxStore_CountUnstartedTransactions_Call) RunAndReturn(run func(context.Context, common.Address, *big.Int) (uint32, error)) *EvmTxStore_CountUnstartedTransactions_Call { + _c.Call.Return(run) + return _c +} + // CreateTransaction provides a mock function with given fields: ctx, txRequest, chainID func (_m *EvmTxStore) CreateTransaction(ctx context.Context, txRequest types.TxRequest[common.Address, common.Hash], chainID *big.Int) (types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], error) { ret := _m.Called(ctx, txRequest, chainID) @@ -181,6 +369,36 @@ func (_m *EvmTxStore) CreateTransaction(ctx context.Context, txRequest types.TxR return r0, r1 } +// EvmTxStore_CreateTransaction_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateTransaction' +type EvmTxStore_CreateTransaction_Call struct { + *mock.Call +} + +// CreateTransaction is a helper method to define mock.On call +// - ctx context.Context +// - txRequest types.TxRequest[common.Address,common.Hash] +// - chainID *big.Int +func (_e *EvmTxStore_Expecter) CreateTransaction(ctx interface{}, txRequest interface{}, chainID interface{}) *EvmTxStore_CreateTransaction_Call { + return &EvmTxStore_CreateTransaction_Call{Call: _e.mock.On("CreateTransaction", ctx, txRequest, chainID)} +} + +func (_c *EvmTxStore_CreateTransaction_Call) Run(run func(ctx context.Context, txRequest types.TxRequest[common.Address, common.Hash], chainID *big.Int)) *EvmTxStore_CreateTransaction_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(types.TxRequest[common.Address, common.Hash]), args[2].(*big.Int)) + }) + return _c +} + +func (_c *EvmTxStore_CreateTransaction_Call) Return(tx types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], err error) *EvmTxStore_CreateTransaction_Call { + _c.Call.Return(tx, err) + return _c +} + +func (_c *EvmTxStore_CreateTransaction_Call) RunAndReturn(run func(context.Context, types.TxRequest[common.Address, common.Hash], *big.Int) (types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], error)) *EvmTxStore_CreateTransaction_Call { + _c.Call.Return(run) + return _c +} + // DeleteInProgressAttempt provides a mock function with given fields: ctx, attempt func (_m *EvmTxStore) DeleteInProgressAttempt(ctx context.Context, attempt types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee]) error { ret := _m.Called(ctx, attempt) @@ -199,6 +417,95 @@ func (_m *EvmTxStore) DeleteInProgressAttempt(ctx context.Context, attempt types return r0 } +// EvmTxStore_DeleteInProgressAttempt_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteInProgressAttempt' +type EvmTxStore_DeleteInProgressAttempt_Call struct { + *mock.Call +} + +// DeleteInProgressAttempt is a helper method to define mock.On call +// - ctx context.Context +// - attempt types.TxAttempt[*big.Int,common.Address,common.Hash,common.Hash,evmtypes.Nonce,gas.EvmFee] +func (_e *EvmTxStore_Expecter) DeleteInProgressAttempt(ctx interface{}, attempt interface{}) *EvmTxStore_DeleteInProgressAttempt_Call { + return &EvmTxStore_DeleteInProgressAttempt_Call{Call: _e.mock.On("DeleteInProgressAttempt", ctx, attempt)} +} + +func (_c *EvmTxStore_DeleteInProgressAttempt_Call) Run(run func(ctx context.Context, attempt types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee])) *EvmTxStore_DeleteInProgressAttempt_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee])) + }) + return _c +} + +func (_c *EvmTxStore_DeleteInProgressAttempt_Call) Return(_a0 error) *EvmTxStore_DeleteInProgressAttempt_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *EvmTxStore_DeleteInProgressAttempt_Call) RunAndReturn(run func(context.Context, types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee]) error) *EvmTxStore_DeleteInProgressAttempt_Call { + _c.Call.Return(run) + return _c +} + +// FindConfirmedTxesReceipts provides a mock function with given fields: ctx, finalizedBlockNum, chainID +func (_m *EvmTxStore) FindConfirmedTxesReceipts(ctx context.Context, finalizedBlockNum int64, chainID *big.Int) ([]txmgr.DbReceipt, error) { + ret := _m.Called(ctx, finalizedBlockNum, chainID) + + if len(ret) == 0 { + panic("no return value specified for FindConfirmedTxesReceipts") + } + + var r0 []txmgr.DbReceipt + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, int64, *big.Int) ([]txmgr.DbReceipt, error)); ok { + return rf(ctx, finalizedBlockNum, chainID) + } + if rf, ok := ret.Get(0).(func(context.Context, int64, *big.Int) []txmgr.DbReceipt); ok { + r0 = rf(ctx, finalizedBlockNum, chainID) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]txmgr.DbReceipt) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, int64, *big.Int) error); ok { + r1 = rf(ctx, finalizedBlockNum, chainID) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EvmTxStore_FindConfirmedTxesReceipts_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindConfirmedTxesReceipts' +type EvmTxStore_FindConfirmedTxesReceipts_Call struct { + *mock.Call +} + +// FindConfirmedTxesReceipts is a helper method to define mock.On call +// - ctx context.Context +// - finalizedBlockNum int64 +// - chainID *big.Int +func (_e *EvmTxStore_Expecter) FindConfirmedTxesReceipts(ctx interface{}, finalizedBlockNum interface{}, chainID interface{}) *EvmTxStore_FindConfirmedTxesReceipts_Call { + return &EvmTxStore_FindConfirmedTxesReceipts_Call{Call: _e.mock.On("FindConfirmedTxesReceipts", ctx, finalizedBlockNum, chainID)} +} + +func (_c *EvmTxStore_FindConfirmedTxesReceipts_Call) Run(run func(ctx context.Context, finalizedBlockNum int64, chainID *big.Int)) *EvmTxStore_FindConfirmedTxesReceipts_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(int64), args[2].(*big.Int)) + }) + return _c +} + +func (_c *EvmTxStore_FindConfirmedTxesReceipts_Call) Return(receipts []txmgr.DbReceipt, err error) *EvmTxStore_FindConfirmedTxesReceipts_Call { + _c.Call.Return(receipts, err) + return _c +} + +func (_c *EvmTxStore_FindConfirmedTxesReceipts_Call) RunAndReturn(run func(context.Context, int64, *big.Int) ([]txmgr.DbReceipt, error)) *EvmTxStore_FindConfirmedTxesReceipts_Call { + _c.Call.Return(run) + return _c +} + // FindEarliestUnconfirmedBroadcastTime provides a mock function with given fields: ctx, chainID func (_m *EvmTxStore) FindEarliestUnconfirmedBroadcastTime(ctx context.Context, chainID *big.Int) (null.Time, error) { ret := _m.Called(ctx, chainID) @@ -227,6 +534,35 @@ func (_m *EvmTxStore) FindEarliestUnconfirmedBroadcastTime(ctx context.Context, return r0, r1 } +// EvmTxStore_FindEarliestUnconfirmedBroadcastTime_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindEarliestUnconfirmedBroadcastTime' +type EvmTxStore_FindEarliestUnconfirmedBroadcastTime_Call struct { + *mock.Call +} + +// FindEarliestUnconfirmedBroadcastTime is a helper method to define mock.On call +// - ctx context.Context +// - chainID *big.Int +func (_e *EvmTxStore_Expecter) FindEarliestUnconfirmedBroadcastTime(ctx interface{}, chainID interface{}) *EvmTxStore_FindEarliestUnconfirmedBroadcastTime_Call { + return &EvmTxStore_FindEarliestUnconfirmedBroadcastTime_Call{Call: _e.mock.On("FindEarliestUnconfirmedBroadcastTime", ctx, chainID)} +} + +func (_c *EvmTxStore_FindEarliestUnconfirmedBroadcastTime_Call) Run(run func(ctx context.Context, chainID *big.Int)) *EvmTxStore_FindEarliestUnconfirmedBroadcastTime_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*big.Int)) + }) + return _c +} + +func (_c *EvmTxStore_FindEarliestUnconfirmedBroadcastTime_Call) Return(_a0 null.Time, _a1 error) *EvmTxStore_FindEarliestUnconfirmedBroadcastTime_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EvmTxStore_FindEarliestUnconfirmedBroadcastTime_Call) RunAndReturn(run func(context.Context, *big.Int) (null.Time, error)) *EvmTxStore_FindEarliestUnconfirmedBroadcastTime_Call { + _c.Call.Return(run) + return _c +} + // FindEarliestUnconfirmedTxAttemptBlock provides a mock function with given fields: ctx, chainID func (_m *EvmTxStore) FindEarliestUnconfirmedTxAttemptBlock(ctx context.Context, chainID *big.Int) (null.Int, error) { ret := _m.Called(ctx, chainID) @@ -255,6 +591,35 @@ func (_m *EvmTxStore) FindEarliestUnconfirmedTxAttemptBlock(ctx context.Context, return r0, r1 } +// EvmTxStore_FindEarliestUnconfirmedTxAttemptBlock_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindEarliestUnconfirmedTxAttemptBlock' +type EvmTxStore_FindEarliestUnconfirmedTxAttemptBlock_Call struct { + *mock.Call +} + +// FindEarliestUnconfirmedTxAttemptBlock is a helper method to define mock.On call +// - ctx context.Context +// - chainID *big.Int +func (_e *EvmTxStore_Expecter) FindEarliestUnconfirmedTxAttemptBlock(ctx interface{}, chainID interface{}) *EvmTxStore_FindEarliestUnconfirmedTxAttemptBlock_Call { + return &EvmTxStore_FindEarliestUnconfirmedTxAttemptBlock_Call{Call: _e.mock.On("FindEarliestUnconfirmedTxAttemptBlock", ctx, chainID)} +} + +func (_c *EvmTxStore_FindEarliestUnconfirmedTxAttemptBlock_Call) Run(run func(ctx context.Context, chainID *big.Int)) *EvmTxStore_FindEarliestUnconfirmedTxAttemptBlock_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*big.Int)) + }) + return _c +} + +func (_c *EvmTxStore_FindEarliestUnconfirmedTxAttemptBlock_Call) Return(_a0 null.Int, _a1 error) *EvmTxStore_FindEarliestUnconfirmedTxAttemptBlock_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EvmTxStore_FindEarliestUnconfirmedTxAttemptBlock_Call) RunAndReturn(run func(context.Context, *big.Int) (null.Int, error)) *EvmTxStore_FindEarliestUnconfirmedTxAttemptBlock_Call { + _c.Call.Return(run) + return _c +} + // FindLatestSequence provides a mock function with given fields: ctx, fromAddress, chainId func (_m *EvmTxStore) FindLatestSequence(ctx context.Context, fromAddress common.Address, chainId *big.Int) (evmtypes.Nonce, error) { ret := _m.Called(ctx, fromAddress, chainId) @@ -283,6 +648,36 @@ func (_m *EvmTxStore) FindLatestSequence(ctx context.Context, fromAddress common return r0, r1 } +// EvmTxStore_FindLatestSequence_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindLatestSequence' +type EvmTxStore_FindLatestSequence_Call struct { + *mock.Call +} + +// FindLatestSequence is a helper method to define mock.On call +// - ctx context.Context +// - fromAddress common.Address +// - chainId *big.Int +func (_e *EvmTxStore_Expecter) FindLatestSequence(ctx interface{}, fromAddress interface{}, chainId interface{}) *EvmTxStore_FindLatestSequence_Call { + return &EvmTxStore_FindLatestSequence_Call{Call: _e.mock.On("FindLatestSequence", ctx, fromAddress, chainId)} +} + +func (_c *EvmTxStore_FindLatestSequence_Call) Run(run func(ctx context.Context, fromAddress common.Address, chainId *big.Int)) *EvmTxStore_FindLatestSequence_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(common.Address), args[2].(*big.Int)) + }) + return _c +} + +func (_c *EvmTxStore_FindLatestSequence_Call) Return(_a0 evmtypes.Nonce, _a1 error) *EvmTxStore_FindLatestSequence_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EvmTxStore_FindLatestSequence_Call) RunAndReturn(run func(context.Context, common.Address, *big.Int) (evmtypes.Nonce, error)) *EvmTxStore_FindLatestSequence_Call { + _c.Call.Return(run) + return _c +} + // FindNextUnstartedTransactionFromAddress provides a mock function with given fields: ctx, fromAddress, chainID func (_m *EvmTxStore) FindNextUnstartedTransactionFromAddress(ctx context.Context, fromAddress common.Address, chainID *big.Int) (*types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], error) { ret := _m.Called(ctx, fromAddress, chainID) @@ -313,6 +708,36 @@ func (_m *EvmTxStore) FindNextUnstartedTransactionFromAddress(ctx context.Contex return r0, r1 } +// EvmTxStore_FindNextUnstartedTransactionFromAddress_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindNextUnstartedTransactionFromAddress' +type EvmTxStore_FindNextUnstartedTransactionFromAddress_Call struct { + *mock.Call +} + +// FindNextUnstartedTransactionFromAddress is a helper method to define mock.On call +// - ctx context.Context +// - fromAddress common.Address +// - chainID *big.Int +func (_e *EvmTxStore_Expecter) FindNextUnstartedTransactionFromAddress(ctx interface{}, fromAddress interface{}, chainID interface{}) *EvmTxStore_FindNextUnstartedTransactionFromAddress_Call { + return &EvmTxStore_FindNextUnstartedTransactionFromAddress_Call{Call: _e.mock.On("FindNextUnstartedTransactionFromAddress", ctx, fromAddress, chainID)} +} + +func (_c *EvmTxStore_FindNextUnstartedTransactionFromAddress_Call) Run(run func(ctx context.Context, fromAddress common.Address, chainID *big.Int)) *EvmTxStore_FindNextUnstartedTransactionFromAddress_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(common.Address), args[2].(*big.Int)) + }) + return _c +} + +func (_c *EvmTxStore_FindNextUnstartedTransactionFromAddress_Call) Return(_a0 *types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], _a1 error) *EvmTxStore_FindNextUnstartedTransactionFromAddress_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EvmTxStore_FindNextUnstartedTransactionFromAddress_Call) RunAndReturn(run func(context.Context, common.Address, *big.Int) (*types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], error)) *EvmTxStore_FindNextUnstartedTransactionFromAddress_Call { + _c.Call.Return(run) + return _c +} + // FindTransactionsConfirmedInBlockRange provides a mock function with given fields: ctx, highBlockNumber, lowBlockNumber, chainID func (_m *EvmTxStore) FindTransactionsConfirmedInBlockRange(ctx context.Context, highBlockNumber int64, lowBlockNumber int64, chainID *big.Int) ([]*types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], error) { ret := _m.Called(ctx, highBlockNumber, lowBlockNumber, chainID) @@ -343,6 +768,37 @@ func (_m *EvmTxStore) FindTransactionsConfirmedInBlockRange(ctx context.Context, return r0, r1 } +// EvmTxStore_FindTransactionsConfirmedInBlockRange_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindTransactionsConfirmedInBlockRange' +type EvmTxStore_FindTransactionsConfirmedInBlockRange_Call struct { + *mock.Call +} + +// FindTransactionsConfirmedInBlockRange is a helper method to define mock.On call +// - ctx context.Context +// - highBlockNumber int64 +// - lowBlockNumber int64 +// - chainID *big.Int +func (_e *EvmTxStore_Expecter) FindTransactionsConfirmedInBlockRange(ctx interface{}, highBlockNumber interface{}, lowBlockNumber interface{}, chainID interface{}) *EvmTxStore_FindTransactionsConfirmedInBlockRange_Call { + return &EvmTxStore_FindTransactionsConfirmedInBlockRange_Call{Call: _e.mock.On("FindTransactionsConfirmedInBlockRange", ctx, highBlockNumber, lowBlockNumber, chainID)} +} + +func (_c *EvmTxStore_FindTransactionsConfirmedInBlockRange_Call) Run(run func(ctx context.Context, highBlockNumber int64, lowBlockNumber int64, chainID *big.Int)) *EvmTxStore_FindTransactionsConfirmedInBlockRange_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(int64), args[2].(int64), args[3].(*big.Int)) + }) + return _c +} + +func (_c *EvmTxStore_FindTransactionsConfirmedInBlockRange_Call) Return(etxs []*types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], err error) *EvmTxStore_FindTransactionsConfirmedInBlockRange_Call { + _c.Call.Return(etxs, err) + return _c +} + +func (_c *EvmTxStore_FindTransactionsConfirmedInBlockRange_Call) RunAndReturn(run func(context.Context, int64, int64, *big.Int) ([]*types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], error)) *EvmTxStore_FindTransactionsConfirmedInBlockRange_Call { + _c.Call.Return(run) + return _c +} + // FindTxAttempt provides a mock function with given fields: ctx, hash func (_m *EvmTxStore) FindTxAttempt(ctx context.Context, hash common.Hash) (*types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], error) { ret := _m.Called(ctx, hash) @@ -373,6 +829,35 @@ func (_m *EvmTxStore) FindTxAttempt(ctx context.Context, hash common.Hash) (*typ return r0, r1 } +// EvmTxStore_FindTxAttempt_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindTxAttempt' +type EvmTxStore_FindTxAttempt_Call struct { + *mock.Call +} + +// FindTxAttempt is a helper method to define mock.On call +// - ctx context.Context +// - hash common.Hash +func (_e *EvmTxStore_Expecter) FindTxAttempt(ctx interface{}, hash interface{}) *EvmTxStore_FindTxAttempt_Call { + return &EvmTxStore_FindTxAttempt_Call{Call: _e.mock.On("FindTxAttempt", ctx, hash)} +} + +func (_c *EvmTxStore_FindTxAttempt_Call) Run(run func(ctx context.Context, hash common.Hash)) *EvmTxStore_FindTxAttempt_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(common.Hash)) + }) + return _c +} + +func (_c *EvmTxStore_FindTxAttempt_Call) Return(_a0 *types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], _a1 error) *EvmTxStore_FindTxAttempt_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EvmTxStore_FindTxAttempt_Call) RunAndReturn(run func(context.Context, common.Hash) (*types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], error)) *EvmTxStore_FindTxAttempt_Call { + _c.Call.Return(run) + return _c +} + // FindTxAttemptConfirmedByTxIDs provides a mock function with given fields: ctx, ids func (_m *EvmTxStore) FindTxAttemptConfirmedByTxIDs(ctx context.Context, ids []int64) ([]types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], error) { ret := _m.Called(ctx, ids) @@ -403,6 +888,35 @@ func (_m *EvmTxStore) FindTxAttemptConfirmedByTxIDs(ctx context.Context, ids []i return r0, r1 } +// EvmTxStore_FindTxAttemptConfirmedByTxIDs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindTxAttemptConfirmedByTxIDs' +type EvmTxStore_FindTxAttemptConfirmedByTxIDs_Call struct { + *mock.Call +} + +// FindTxAttemptConfirmedByTxIDs is a helper method to define mock.On call +// - ctx context.Context +// - ids []int64 +func (_e *EvmTxStore_Expecter) FindTxAttemptConfirmedByTxIDs(ctx interface{}, ids interface{}) *EvmTxStore_FindTxAttemptConfirmedByTxIDs_Call { + return &EvmTxStore_FindTxAttemptConfirmedByTxIDs_Call{Call: _e.mock.On("FindTxAttemptConfirmedByTxIDs", ctx, ids)} +} + +func (_c *EvmTxStore_FindTxAttemptConfirmedByTxIDs_Call) Run(run func(ctx context.Context, ids []int64)) *EvmTxStore_FindTxAttemptConfirmedByTxIDs_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].([]int64)) + }) + return _c +} + +func (_c *EvmTxStore_FindTxAttemptConfirmedByTxIDs_Call) Return(_a0 []types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], _a1 error) *EvmTxStore_FindTxAttemptConfirmedByTxIDs_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EvmTxStore_FindTxAttemptConfirmedByTxIDs_Call) RunAndReturn(run func(context.Context, []int64) ([]types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], error)) *EvmTxStore_FindTxAttemptConfirmedByTxIDs_Call { + _c.Call.Return(run) + return _c +} + // FindTxAttemptsConfirmedMissingReceipt provides a mock function with given fields: ctx, chainID func (_m *EvmTxStore) FindTxAttemptsConfirmedMissingReceipt(ctx context.Context, chainID *big.Int) ([]types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], error) { ret := _m.Called(ctx, chainID) @@ -433,6 +947,35 @@ func (_m *EvmTxStore) FindTxAttemptsConfirmedMissingReceipt(ctx context.Context, return r0, r1 } +// EvmTxStore_FindTxAttemptsConfirmedMissingReceipt_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindTxAttemptsConfirmedMissingReceipt' +type EvmTxStore_FindTxAttemptsConfirmedMissingReceipt_Call struct { + *mock.Call +} + +// FindTxAttemptsConfirmedMissingReceipt is a helper method to define mock.On call +// - ctx context.Context +// - chainID *big.Int +func (_e *EvmTxStore_Expecter) FindTxAttemptsConfirmedMissingReceipt(ctx interface{}, chainID interface{}) *EvmTxStore_FindTxAttemptsConfirmedMissingReceipt_Call { + return &EvmTxStore_FindTxAttemptsConfirmedMissingReceipt_Call{Call: _e.mock.On("FindTxAttemptsConfirmedMissingReceipt", ctx, chainID)} +} + +func (_c *EvmTxStore_FindTxAttemptsConfirmedMissingReceipt_Call) Run(run func(ctx context.Context, chainID *big.Int)) *EvmTxStore_FindTxAttemptsConfirmedMissingReceipt_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*big.Int)) + }) + return _c +} + +func (_c *EvmTxStore_FindTxAttemptsConfirmedMissingReceipt_Call) Return(attempts []types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], err error) *EvmTxStore_FindTxAttemptsConfirmedMissingReceipt_Call { + _c.Call.Return(attempts, err) + return _c +} + +func (_c *EvmTxStore_FindTxAttemptsConfirmedMissingReceipt_Call) RunAndReturn(run func(context.Context, *big.Int) ([]types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], error)) *EvmTxStore_FindTxAttemptsConfirmedMissingReceipt_Call { + _c.Call.Return(run) + return _c +} + // FindTxAttemptsRequiringReceiptFetch provides a mock function with given fields: ctx, chainID func (_m *EvmTxStore) FindTxAttemptsRequiringReceiptFetch(ctx context.Context, chainID *big.Int) ([]types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], error) { ret := _m.Called(ctx, chainID) @@ -463,6 +1006,35 @@ func (_m *EvmTxStore) FindTxAttemptsRequiringReceiptFetch(ctx context.Context, c return r0, r1 } +// EvmTxStore_FindTxAttemptsRequiringReceiptFetch_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindTxAttemptsRequiringReceiptFetch' +type EvmTxStore_FindTxAttemptsRequiringReceiptFetch_Call struct { + *mock.Call +} + +// FindTxAttemptsRequiringReceiptFetch is a helper method to define mock.On call +// - ctx context.Context +// - chainID *big.Int +func (_e *EvmTxStore_Expecter) FindTxAttemptsRequiringReceiptFetch(ctx interface{}, chainID interface{}) *EvmTxStore_FindTxAttemptsRequiringReceiptFetch_Call { + return &EvmTxStore_FindTxAttemptsRequiringReceiptFetch_Call{Call: _e.mock.On("FindTxAttemptsRequiringReceiptFetch", ctx, chainID)} +} + +func (_c *EvmTxStore_FindTxAttemptsRequiringReceiptFetch_Call) Run(run func(ctx context.Context, chainID *big.Int)) *EvmTxStore_FindTxAttemptsRequiringReceiptFetch_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*big.Int)) + }) + return _c +} + +func (_c *EvmTxStore_FindTxAttemptsRequiringReceiptFetch_Call) Return(attempts []types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], err error) *EvmTxStore_FindTxAttemptsRequiringReceiptFetch_Call { + _c.Call.Return(attempts, err) + return _c +} + +func (_c *EvmTxStore_FindTxAttemptsRequiringReceiptFetch_Call) RunAndReturn(run func(context.Context, *big.Int) ([]types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], error)) *EvmTxStore_FindTxAttemptsRequiringReceiptFetch_Call { + _c.Call.Return(run) + return _c +} + // FindTxAttemptsRequiringResend provides a mock function with given fields: ctx, olderThan, maxInFlightTransactions, chainID, address func (_m *EvmTxStore) FindTxAttemptsRequiringResend(ctx context.Context, olderThan time.Time, maxInFlightTransactions uint32, chainID *big.Int, address common.Address) ([]types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], error) { ret := _m.Called(ctx, olderThan, maxInFlightTransactions, chainID, address) @@ -493,6 +1065,38 @@ func (_m *EvmTxStore) FindTxAttemptsRequiringResend(ctx context.Context, olderTh return r0, r1 } +// EvmTxStore_FindTxAttemptsRequiringResend_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindTxAttemptsRequiringResend' +type EvmTxStore_FindTxAttemptsRequiringResend_Call struct { + *mock.Call +} + +// FindTxAttemptsRequiringResend is a helper method to define mock.On call +// - ctx context.Context +// - olderThan time.Time +// - maxInFlightTransactions uint32 +// - chainID *big.Int +// - address common.Address +func (_e *EvmTxStore_Expecter) FindTxAttemptsRequiringResend(ctx interface{}, olderThan interface{}, maxInFlightTransactions interface{}, chainID interface{}, address interface{}) *EvmTxStore_FindTxAttemptsRequiringResend_Call { + return &EvmTxStore_FindTxAttemptsRequiringResend_Call{Call: _e.mock.On("FindTxAttemptsRequiringResend", ctx, olderThan, maxInFlightTransactions, chainID, address)} +} + +func (_c *EvmTxStore_FindTxAttemptsRequiringResend_Call) Run(run func(ctx context.Context, olderThan time.Time, maxInFlightTransactions uint32, chainID *big.Int, address common.Address)) *EvmTxStore_FindTxAttemptsRequiringResend_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(time.Time), args[2].(uint32), args[3].(*big.Int), args[4].(common.Address)) + }) + return _c +} + +func (_c *EvmTxStore_FindTxAttemptsRequiringResend_Call) Return(attempts []types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], err error) *EvmTxStore_FindTxAttemptsRequiringResend_Call { + _c.Call.Return(attempts, err) + return _c +} + +func (_c *EvmTxStore_FindTxAttemptsRequiringResend_Call) RunAndReturn(run func(context.Context, time.Time, uint32, *big.Int, common.Address) ([]types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], error)) *EvmTxStore_FindTxAttemptsRequiringResend_Call { + _c.Call.Return(run) + return _c +} + // FindTxByHash provides a mock function with given fields: ctx, hash func (_m *EvmTxStore) FindTxByHash(ctx context.Context, hash common.Hash) (*types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], error) { ret := _m.Called(ctx, hash) @@ -523,6 +1127,35 @@ func (_m *EvmTxStore) FindTxByHash(ctx context.Context, hash common.Hash) (*type return r0, r1 } +// EvmTxStore_FindTxByHash_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindTxByHash' +type EvmTxStore_FindTxByHash_Call struct { + *mock.Call +} + +// FindTxByHash is a helper method to define mock.On call +// - ctx context.Context +// - hash common.Hash +func (_e *EvmTxStore_Expecter) FindTxByHash(ctx interface{}, hash interface{}) *EvmTxStore_FindTxByHash_Call { + return &EvmTxStore_FindTxByHash_Call{Call: _e.mock.On("FindTxByHash", ctx, hash)} +} + +func (_c *EvmTxStore_FindTxByHash_Call) Run(run func(ctx context.Context, hash common.Hash)) *EvmTxStore_FindTxByHash_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(common.Hash)) + }) + return _c +} + +func (_c *EvmTxStore_FindTxByHash_Call) Return(_a0 *types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], _a1 error) *EvmTxStore_FindTxByHash_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EvmTxStore_FindTxByHash_Call) RunAndReturn(run func(context.Context, common.Hash) (*types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], error)) *EvmTxStore_FindTxByHash_Call { + _c.Call.Return(run) + return _c +} + // FindTxWithAttempts provides a mock function with given fields: ctx, etxID func (_m *EvmTxStore) FindTxWithAttempts(ctx context.Context, etxID int64) (types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], error) { ret := _m.Called(ctx, etxID) @@ -551,6 +1184,35 @@ func (_m *EvmTxStore) FindTxWithAttempts(ctx context.Context, etxID int64) (type return r0, r1 } +// EvmTxStore_FindTxWithAttempts_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindTxWithAttempts' +type EvmTxStore_FindTxWithAttempts_Call struct { + *mock.Call +} + +// FindTxWithAttempts is a helper method to define mock.On call +// - ctx context.Context +// - etxID int64 +func (_e *EvmTxStore_Expecter) FindTxWithAttempts(ctx interface{}, etxID interface{}) *EvmTxStore_FindTxWithAttempts_Call { + return &EvmTxStore_FindTxWithAttempts_Call{Call: _e.mock.On("FindTxWithAttempts", ctx, etxID)} +} + +func (_c *EvmTxStore_FindTxWithAttempts_Call) Run(run func(ctx context.Context, etxID int64)) *EvmTxStore_FindTxWithAttempts_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(int64)) + }) + return _c +} + +func (_c *EvmTxStore_FindTxWithAttempts_Call) Return(etx types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], err error) *EvmTxStore_FindTxWithAttempts_Call { + _c.Call.Return(etx, err) + return _c +} + +func (_c *EvmTxStore_FindTxWithAttempts_Call) RunAndReturn(run func(context.Context, int64) (types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], error)) *EvmTxStore_FindTxWithAttempts_Call { + _c.Call.Return(run) + return _c +} + // FindTxWithIdempotencyKey provides a mock function with given fields: ctx, idempotencyKey, chainID func (_m *EvmTxStore) FindTxWithIdempotencyKey(ctx context.Context, idempotencyKey string, chainID *big.Int) (*types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], error) { ret := _m.Called(ctx, idempotencyKey, chainID) @@ -581,6 +1243,36 @@ func (_m *EvmTxStore) FindTxWithIdempotencyKey(ctx context.Context, idempotencyK return r0, r1 } +// EvmTxStore_FindTxWithIdempotencyKey_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindTxWithIdempotencyKey' +type EvmTxStore_FindTxWithIdempotencyKey_Call struct { + *mock.Call +} + +// FindTxWithIdempotencyKey is a helper method to define mock.On call +// - ctx context.Context +// - idempotencyKey string +// - chainID *big.Int +func (_e *EvmTxStore_Expecter) FindTxWithIdempotencyKey(ctx interface{}, idempotencyKey interface{}, chainID interface{}) *EvmTxStore_FindTxWithIdempotencyKey_Call { + return &EvmTxStore_FindTxWithIdempotencyKey_Call{Call: _e.mock.On("FindTxWithIdempotencyKey", ctx, idempotencyKey, chainID)} +} + +func (_c *EvmTxStore_FindTxWithIdempotencyKey_Call) Run(run func(ctx context.Context, idempotencyKey string, chainID *big.Int)) *EvmTxStore_FindTxWithIdempotencyKey_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(*big.Int)) + }) + return _c +} + +func (_c *EvmTxStore_FindTxWithIdempotencyKey_Call) Return(tx *types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], err error) *EvmTxStore_FindTxWithIdempotencyKey_Call { + _c.Call.Return(tx, err) + return _c +} + +func (_c *EvmTxStore_FindTxWithIdempotencyKey_Call) RunAndReturn(run func(context.Context, string, *big.Int) (*types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], error)) *EvmTxStore_FindTxWithIdempotencyKey_Call { + _c.Call.Return(run) + return _c +} + // FindTxWithSequence provides a mock function with given fields: ctx, fromAddress, seq func (_m *EvmTxStore) FindTxWithSequence(ctx context.Context, fromAddress common.Address, seq evmtypes.Nonce) (*types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], error) { ret := _m.Called(ctx, fromAddress, seq) @@ -611,6 +1303,36 @@ func (_m *EvmTxStore) FindTxWithSequence(ctx context.Context, fromAddress common return r0, r1 } +// EvmTxStore_FindTxWithSequence_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindTxWithSequence' +type EvmTxStore_FindTxWithSequence_Call struct { + *mock.Call +} + +// FindTxWithSequence is a helper method to define mock.On call +// - ctx context.Context +// - fromAddress common.Address +// - seq evmtypes.Nonce +func (_e *EvmTxStore_Expecter) FindTxWithSequence(ctx interface{}, fromAddress interface{}, seq interface{}) *EvmTxStore_FindTxWithSequence_Call { + return &EvmTxStore_FindTxWithSequence_Call{Call: _e.mock.On("FindTxWithSequence", ctx, fromAddress, seq)} +} + +func (_c *EvmTxStore_FindTxWithSequence_Call) Run(run func(ctx context.Context, fromAddress common.Address, seq evmtypes.Nonce)) *EvmTxStore_FindTxWithSequence_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(common.Address), args[2].(evmtypes.Nonce)) + }) + return _c +} + +func (_c *EvmTxStore_FindTxWithSequence_Call) Return(etx *types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], err error) *EvmTxStore_FindTxWithSequence_Call { + _c.Call.Return(etx, err) + return _c +} + +func (_c *EvmTxStore_FindTxWithSequence_Call) RunAndReturn(run func(context.Context, common.Address, evmtypes.Nonce) (*types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], error)) *EvmTxStore_FindTxWithSequence_Call { + _c.Call.Return(run) + return _c +} + // FindTxesByMetaFieldAndStates provides a mock function with given fields: ctx, metaField, metaValue, states, chainID func (_m *EvmTxStore) FindTxesByMetaFieldAndStates(ctx context.Context, metaField string, metaValue string, states []types.TxState, chainID *big.Int) ([]*types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], error) { ret := _m.Called(ctx, metaField, metaValue, states, chainID) @@ -641,8 +1363,40 @@ func (_m *EvmTxStore) FindTxesByMetaFieldAndStates(ctx context.Context, metaFiel return r0, r1 } -// FindTxesPendingCallback provides a mock function with given fields: ctx, blockNum, chainID -func (_m *EvmTxStore) FindTxesPendingCallback(ctx context.Context, blockNum int64, chainID *big.Int) ([]types.ReceiptPlus[*evmtypes.Receipt], error) { +// EvmTxStore_FindTxesByMetaFieldAndStates_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindTxesByMetaFieldAndStates' +type EvmTxStore_FindTxesByMetaFieldAndStates_Call struct { + *mock.Call +} + +// FindTxesByMetaFieldAndStates is a helper method to define mock.On call +// - ctx context.Context +// - metaField string +// - metaValue string +// - states []types.TxState +// - chainID *big.Int +func (_e *EvmTxStore_Expecter) FindTxesByMetaFieldAndStates(ctx interface{}, metaField interface{}, metaValue interface{}, states interface{}, chainID interface{}) *EvmTxStore_FindTxesByMetaFieldAndStates_Call { + return &EvmTxStore_FindTxesByMetaFieldAndStates_Call{Call: _e.mock.On("FindTxesByMetaFieldAndStates", ctx, metaField, metaValue, states, chainID)} +} + +func (_c *EvmTxStore_FindTxesByMetaFieldAndStates_Call) Run(run func(ctx context.Context, metaField string, metaValue string, states []types.TxState, chainID *big.Int)) *EvmTxStore_FindTxesByMetaFieldAndStates_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string), args[3].([]types.TxState), args[4].(*big.Int)) + }) + return _c +} + +func (_c *EvmTxStore_FindTxesByMetaFieldAndStates_Call) Return(tx []*types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], err error) *EvmTxStore_FindTxesByMetaFieldAndStates_Call { + _c.Call.Return(tx, err) + return _c +} + +func (_c *EvmTxStore_FindTxesByMetaFieldAndStates_Call) RunAndReturn(run func(context.Context, string, string, []types.TxState, *big.Int) ([]*types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], error)) *EvmTxStore_FindTxesByMetaFieldAndStates_Call { + _c.Call.Return(run) + return _c +} + +// FindTxesPendingCallback provides a mock function with given fields: ctx, blockNum, chainID +func (_m *EvmTxStore) FindTxesPendingCallback(ctx context.Context, blockNum int64, chainID *big.Int) ([]types.ReceiptPlus[*evmtypes.Receipt], error) { ret := _m.Called(ctx, blockNum, chainID) if len(ret) == 0 { @@ -671,6 +1425,36 @@ func (_m *EvmTxStore) FindTxesPendingCallback(ctx context.Context, blockNum int6 return r0, r1 } +// EvmTxStore_FindTxesPendingCallback_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindTxesPendingCallback' +type EvmTxStore_FindTxesPendingCallback_Call struct { + *mock.Call +} + +// FindTxesPendingCallback is a helper method to define mock.On call +// - ctx context.Context +// - blockNum int64 +// - chainID *big.Int +func (_e *EvmTxStore_Expecter) FindTxesPendingCallback(ctx interface{}, blockNum interface{}, chainID interface{}) *EvmTxStore_FindTxesPendingCallback_Call { + return &EvmTxStore_FindTxesPendingCallback_Call{Call: _e.mock.On("FindTxesPendingCallback", ctx, blockNum, chainID)} +} + +func (_c *EvmTxStore_FindTxesPendingCallback_Call) Run(run func(ctx context.Context, blockNum int64, chainID *big.Int)) *EvmTxStore_FindTxesPendingCallback_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(int64), args[2].(*big.Int)) + }) + return _c +} + +func (_c *EvmTxStore_FindTxesPendingCallback_Call) Return(receiptsPlus []types.ReceiptPlus[*evmtypes.Receipt], err error) *EvmTxStore_FindTxesPendingCallback_Call { + _c.Call.Return(receiptsPlus, err) + return _c +} + +func (_c *EvmTxStore_FindTxesPendingCallback_Call) RunAndReturn(run func(context.Context, int64, *big.Int) ([]types.ReceiptPlus[*evmtypes.Receipt], error)) *EvmTxStore_FindTxesPendingCallback_Call { + _c.Call.Return(run) + return _c +} + // FindTxesWithAttemptsAndReceiptsByIdsAndState provides a mock function with given fields: ctx, ids, states, chainID func (_m *EvmTxStore) FindTxesWithAttemptsAndReceiptsByIdsAndState(ctx context.Context, ids []int64, states []types.TxState, chainID *big.Int) ([]*types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], error) { ret := _m.Called(ctx, ids, states, chainID) @@ -701,6 +1485,37 @@ func (_m *EvmTxStore) FindTxesWithAttemptsAndReceiptsByIdsAndState(ctx context.C return r0, r1 } +// EvmTxStore_FindTxesWithAttemptsAndReceiptsByIdsAndState_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindTxesWithAttemptsAndReceiptsByIdsAndState' +type EvmTxStore_FindTxesWithAttemptsAndReceiptsByIdsAndState_Call struct { + *mock.Call +} + +// FindTxesWithAttemptsAndReceiptsByIdsAndState is a helper method to define mock.On call +// - ctx context.Context +// - ids []int64 +// - states []types.TxState +// - chainID *big.Int +func (_e *EvmTxStore_Expecter) FindTxesWithAttemptsAndReceiptsByIdsAndState(ctx interface{}, ids interface{}, states interface{}, chainID interface{}) *EvmTxStore_FindTxesWithAttemptsAndReceiptsByIdsAndState_Call { + return &EvmTxStore_FindTxesWithAttemptsAndReceiptsByIdsAndState_Call{Call: _e.mock.On("FindTxesWithAttemptsAndReceiptsByIdsAndState", ctx, ids, states, chainID)} +} + +func (_c *EvmTxStore_FindTxesWithAttemptsAndReceiptsByIdsAndState_Call) Run(run func(ctx context.Context, ids []int64, states []types.TxState, chainID *big.Int)) *EvmTxStore_FindTxesWithAttemptsAndReceiptsByIdsAndState_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].([]int64), args[2].([]types.TxState), args[3].(*big.Int)) + }) + return _c +} + +func (_c *EvmTxStore_FindTxesWithAttemptsAndReceiptsByIdsAndState_Call) Return(tx []*types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], err error) *EvmTxStore_FindTxesWithAttemptsAndReceiptsByIdsAndState_Call { + _c.Call.Return(tx, err) + return _c +} + +func (_c *EvmTxStore_FindTxesWithAttemptsAndReceiptsByIdsAndState_Call) RunAndReturn(run func(context.Context, []int64, []types.TxState, *big.Int) ([]*types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], error)) *EvmTxStore_FindTxesWithAttemptsAndReceiptsByIdsAndState_Call { + _c.Call.Return(run) + return _c +} + // FindTxesWithMetaFieldByReceiptBlockNum provides a mock function with given fields: ctx, metaField, blockNum, chainID func (_m *EvmTxStore) FindTxesWithMetaFieldByReceiptBlockNum(ctx context.Context, metaField string, blockNum int64, chainID *big.Int) ([]*types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], error) { ret := _m.Called(ctx, metaField, blockNum, chainID) @@ -731,6 +1546,37 @@ func (_m *EvmTxStore) FindTxesWithMetaFieldByReceiptBlockNum(ctx context.Context return r0, r1 } +// EvmTxStore_FindTxesWithMetaFieldByReceiptBlockNum_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindTxesWithMetaFieldByReceiptBlockNum' +type EvmTxStore_FindTxesWithMetaFieldByReceiptBlockNum_Call struct { + *mock.Call +} + +// FindTxesWithMetaFieldByReceiptBlockNum is a helper method to define mock.On call +// - ctx context.Context +// - metaField string +// - blockNum int64 +// - chainID *big.Int +func (_e *EvmTxStore_Expecter) FindTxesWithMetaFieldByReceiptBlockNum(ctx interface{}, metaField interface{}, blockNum interface{}, chainID interface{}) *EvmTxStore_FindTxesWithMetaFieldByReceiptBlockNum_Call { + return &EvmTxStore_FindTxesWithMetaFieldByReceiptBlockNum_Call{Call: _e.mock.On("FindTxesWithMetaFieldByReceiptBlockNum", ctx, metaField, blockNum, chainID)} +} + +func (_c *EvmTxStore_FindTxesWithMetaFieldByReceiptBlockNum_Call) Run(run func(ctx context.Context, metaField string, blockNum int64, chainID *big.Int)) *EvmTxStore_FindTxesWithMetaFieldByReceiptBlockNum_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(int64), args[3].(*big.Int)) + }) + return _c +} + +func (_c *EvmTxStore_FindTxesWithMetaFieldByReceiptBlockNum_Call) Return(tx []*types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], err error) *EvmTxStore_FindTxesWithMetaFieldByReceiptBlockNum_Call { + _c.Call.Return(tx, err) + return _c +} + +func (_c *EvmTxStore_FindTxesWithMetaFieldByReceiptBlockNum_Call) RunAndReturn(run func(context.Context, string, int64, *big.Int) ([]*types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], error)) *EvmTxStore_FindTxesWithMetaFieldByReceiptBlockNum_Call { + _c.Call.Return(run) + return _c +} + // FindTxesWithMetaFieldByStates provides a mock function with given fields: ctx, metaField, states, chainID func (_m *EvmTxStore) FindTxesWithMetaFieldByStates(ctx context.Context, metaField string, states []types.TxState, chainID *big.Int) ([]*types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], error) { ret := _m.Called(ctx, metaField, states, chainID) @@ -761,6 +1607,37 @@ func (_m *EvmTxStore) FindTxesWithMetaFieldByStates(ctx context.Context, metaFie return r0, r1 } +// EvmTxStore_FindTxesWithMetaFieldByStates_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindTxesWithMetaFieldByStates' +type EvmTxStore_FindTxesWithMetaFieldByStates_Call struct { + *mock.Call +} + +// FindTxesWithMetaFieldByStates is a helper method to define mock.On call +// - ctx context.Context +// - metaField string +// - states []types.TxState +// - chainID *big.Int +func (_e *EvmTxStore_Expecter) FindTxesWithMetaFieldByStates(ctx interface{}, metaField interface{}, states interface{}, chainID interface{}) *EvmTxStore_FindTxesWithMetaFieldByStates_Call { + return &EvmTxStore_FindTxesWithMetaFieldByStates_Call{Call: _e.mock.On("FindTxesWithMetaFieldByStates", ctx, metaField, states, chainID)} +} + +func (_c *EvmTxStore_FindTxesWithMetaFieldByStates_Call) Run(run func(ctx context.Context, metaField string, states []types.TxState, chainID *big.Int)) *EvmTxStore_FindTxesWithMetaFieldByStates_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].([]types.TxState), args[3].(*big.Int)) + }) + return _c +} + +func (_c *EvmTxStore_FindTxesWithMetaFieldByStates_Call) Return(tx []*types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], err error) *EvmTxStore_FindTxesWithMetaFieldByStates_Call { + _c.Call.Return(tx, err) + return _c +} + +func (_c *EvmTxStore_FindTxesWithMetaFieldByStates_Call) RunAndReturn(run func(context.Context, string, []types.TxState, *big.Int) ([]*types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], error)) *EvmTxStore_FindTxesWithMetaFieldByStates_Call { + _c.Call.Return(run) + return _c +} + // FindTxsByStateAndFromAddresses provides a mock function with given fields: ctx, addresses, state, chainID func (_m *EvmTxStore) FindTxsByStateAndFromAddresses(ctx context.Context, addresses []common.Address, state types.TxState, chainID *big.Int) ([]*types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], error) { ret := _m.Called(ctx, addresses, state, chainID) @@ -791,6 +1668,37 @@ func (_m *EvmTxStore) FindTxsByStateAndFromAddresses(ctx context.Context, addres return r0, r1 } +// EvmTxStore_FindTxsByStateAndFromAddresses_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindTxsByStateAndFromAddresses' +type EvmTxStore_FindTxsByStateAndFromAddresses_Call struct { + *mock.Call +} + +// FindTxsByStateAndFromAddresses is a helper method to define mock.On call +// - ctx context.Context +// - addresses []common.Address +// - state types.TxState +// - chainID *big.Int +func (_e *EvmTxStore_Expecter) FindTxsByStateAndFromAddresses(ctx interface{}, addresses interface{}, state interface{}, chainID interface{}) *EvmTxStore_FindTxsByStateAndFromAddresses_Call { + return &EvmTxStore_FindTxsByStateAndFromAddresses_Call{Call: _e.mock.On("FindTxsByStateAndFromAddresses", ctx, addresses, state, chainID)} +} + +func (_c *EvmTxStore_FindTxsByStateAndFromAddresses_Call) Run(run func(ctx context.Context, addresses []common.Address, state types.TxState, chainID *big.Int)) *EvmTxStore_FindTxsByStateAndFromAddresses_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].([]common.Address), args[2].(types.TxState), args[3].(*big.Int)) + }) + return _c +} + +func (_c *EvmTxStore_FindTxsByStateAndFromAddresses_Call) Return(txs []*types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], err error) *EvmTxStore_FindTxsByStateAndFromAddresses_Call { + _c.Call.Return(txs, err) + return _c +} + +func (_c *EvmTxStore_FindTxsByStateAndFromAddresses_Call) RunAndReturn(run func(context.Context, []common.Address, types.TxState, *big.Int) ([]*types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], error)) *EvmTxStore_FindTxsByStateAndFromAddresses_Call { + _c.Call.Return(run) + return _c +} + // FindTxsRequiringGasBump provides a mock function with given fields: ctx, address, blockNum, gasBumpThreshold, depth, chainID func (_m *EvmTxStore) FindTxsRequiringGasBump(ctx context.Context, address common.Address, blockNum int64, gasBumpThreshold int64, depth int64, chainID *big.Int) ([]*types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], error) { ret := _m.Called(ctx, address, blockNum, gasBumpThreshold, depth, chainID) @@ -821,6 +1729,39 @@ func (_m *EvmTxStore) FindTxsRequiringGasBump(ctx context.Context, address commo return r0, r1 } +// EvmTxStore_FindTxsRequiringGasBump_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindTxsRequiringGasBump' +type EvmTxStore_FindTxsRequiringGasBump_Call struct { + *mock.Call +} + +// FindTxsRequiringGasBump is a helper method to define mock.On call +// - ctx context.Context +// - address common.Address +// - blockNum int64 +// - gasBumpThreshold int64 +// - depth int64 +// - chainID *big.Int +func (_e *EvmTxStore_Expecter) FindTxsRequiringGasBump(ctx interface{}, address interface{}, blockNum interface{}, gasBumpThreshold interface{}, depth interface{}, chainID interface{}) *EvmTxStore_FindTxsRequiringGasBump_Call { + return &EvmTxStore_FindTxsRequiringGasBump_Call{Call: _e.mock.On("FindTxsRequiringGasBump", ctx, address, blockNum, gasBumpThreshold, depth, chainID)} +} + +func (_c *EvmTxStore_FindTxsRequiringGasBump_Call) Run(run func(ctx context.Context, address common.Address, blockNum int64, gasBumpThreshold int64, depth int64, chainID *big.Int)) *EvmTxStore_FindTxsRequiringGasBump_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(common.Address), args[2].(int64), args[3].(int64), args[4].(int64), args[5].(*big.Int)) + }) + return _c +} + +func (_c *EvmTxStore_FindTxsRequiringGasBump_Call) Return(etxs []*types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], err error) *EvmTxStore_FindTxsRequiringGasBump_Call { + _c.Call.Return(etxs, err) + return _c +} + +func (_c *EvmTxStore_FindTxsRequiringGasBump_Call) RunAndReturn(run func(context.Context, common.Address, int64, int64, int64, *big.Int) ([]*types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], error)) *EvmTxStore_FindTxsRequiringGasBump_Call { + _c.Call.Return(run) + return _c +} + // FindTxsRequiringResubmissionDueToInsufficientFunds provides a mock function with given fields: ctx, address, chainID func (_m *EvmTxStore) FindTxsRequiringResubmissionDueToInsufficientFunds(ctx context.Context, address common.Address, chainID *big.Int) ([]*types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], error) { ret := _m.Called(ctx, address, chainID) @@ -851,6 +1792,36 @@ func (_m *EvmTxStore) FindTxsRequiringResubmissionDueToInsufficientFunds(ctx con return r0, r1 } +// EvmTxStore_FindTxsRequiringResubmissionDueToInsufficientFunds_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindTxsRequiringResubmissionDueToInsufficientFunds' +type EvmTxStore_FindTxsRequiringResubmissionDueToInsufficientFunds_Call struct { + *mock.Call +} + +// FindTxsRequiringResubmissionDueToInsufficientFunds is a helper method to define mock.On call +// - ctx context.Context +// - address common.Address +// - chainID *big.Int +func (_e *EvmTxStore_Expecter) FindTxsRequiringResubmissionDueToInsufficientFunds(ctx interface{}, address interface{}, chainID interface{}) *EvmTxStore_FindTxsRequiringResubmissionDueToInsufficientFunds_Call { + return &EvmTxStore_FindTxsRequiringResubmissionDueToInsufficientFunds_Call{Call: _e.mock.On("FindTxsRequiringResubmissionDueToInsufficientFunds", ctx, address, chainID)} +} + +func (_c *EvmTxStore_FindTxsRequiringResubmissionDueToInsufficientFunds_Call) Run(run func(ctx context.Context, address common.Address, chainID *big.Int)) *EvmTxStore_FindTxsRequiringResubmissionDueToInsufficientFunds_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(common.Address), args[2].(*big.Int)) + }) + return _c +} + +func (_c *EvmTxStore_FindTxsRequiringResubmissionDueToInsufficientFunds_Call) Return(etxs []*types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], err error) *EvmTxStore_FindTxsRequiringResubmissionDueToInsufficientFunds_Call { + _c.Call.Return(etxs, err) + return _c +} + +func (_c *EvmTxStore_FindTxsRequiringResubmissionDueToInsufficientFunds_Call) RunAndReturn(run func(context.Context, common.Address, *big.Int) ([]*types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], error)) *EvmTxStore_FindTxsRequiringResubmissionDueToInsufficientFunds_Call { + _c.Call.Return(run) + return _c +} + // GetAbandonedTransactionsByBatch provides a mock function with given fields: ctx, chainID, enabledAddrs, offset, limit func (_m *EvmTxStore) GetAbandonedTransactionsByBatch(ctx context.Context, chainID *big.Int, enabledAddrs []common.Address, offset uint, limit uint) ([]*types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], error) { ret := _m.Called(ctx, chainID, enabledAddrs, offset, limit) @@ -881,6 +1852,38 @@ func (_m *EvmTxStore) GetAbandonedTransactionsByBatch(ctx context.Context, chain return r0, r1 } +// EvmTxStore_GetAbandonedTransactionsByBatch_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAbandonedTransactionsByBatch' +type EvmTxStore_GetAbandonedTransactionsByBatch_Call struct { + *mock.Call +} + +// GetAbandonedTransactionsByBatch is a helper method to define mock.On call +// - ctx context.Context +// - chainID *big.Int +// - enabledAddrs []common.Address +// - offset uint +// - limit uint +func (_e *EvmTxStore_Expecter) GetAbandonedTransactionsByBatch(ctx interface{}, chainID interface{}, enabledAddrs interface{}, offset interface{}, limit interface{}) *EvmTxStore_GetAbandonedTransactionsByBatch_Call { + return &EvmTxStore_GetAbandonedTransactionsByBatch_Call{Call: _e.mock.On("GetAbandonedTransactionsByBatch", ctx, chainID, enabledAddrs, offset, limit)} +} + +func (_c *EvmTxStore_GetAbandonedTransactionsByBatch_Call) Run(run func(ctx context.Context, chainID *big.Int, enabledAddrs []common.Address, offset uint, limit uint)) *EvmTxStore_GetAbandonedTransactionsByBatch_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*big.Int), args[2].([]common.Address), args[3].(uint), args[4].(uint)) + }) + return _c +} + +func (_c *EvmTxStore_GetAbandonedTransactionsByBatch_Call) Return(txs []*types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], err error) *EvmTxStore_GetAbandonedTransactionsByBatch_Call { + _c.Call.Return(txs, err) + return _c +} + +func (_c *EvmTxStore_GetAbandonedTransactionsByBatch_Call) RunAndReturn(run func(context.Context, *big.Int, []common.Address, uint, uint) ([]*types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], error)) *EvmTxStore_GetAbandonedTransactionsByBatch_Call { + _c.Call.Return(run) + return _c +} + // GetInProgressTxAttempts provides a mock function with given fields: ctx, address, chainID func (_m *EvmTxStore) GetInProgressTxAttempts(ctx context.Context, address common.Address, chainID *big.Int) ([]types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], error) { ret := _m.Called(ctx, address, chainID) @@ -911,6 +1914,36 @@ func (_m *EvmTxStore) GetInProgressTxAttempts(ctx context.Context, address commo return r0, r1 } +// EvmTxStore_GetInProgressTxAttempts_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetInProgressTxAttempts' +type EvmTxStore_GetInProgressTxAttempts_Call struct { + *mock.Call +} + +// GetInProgressTxAttempts is a helper method to define mock.On call +// - ctx context.Context +// - address common.Address +// - chainID *big.Int +func (_e *EvmTxStore_Expecter) GetInProgressTxAttempts(ctx interface{}, address interface{}, chainID interface{}) *EvmTxStore_GetInProgressTxAttempts_Call { + return &EvmTxStore_GetInProgressTxAttempts_Call{Call: _e.mock.On("GetInProgressTxAttempts", ctx, address, chainID)} +} + +func (_c *EvmTxStore_GetInProgressTxAttempts_Call) Run(run func(ctx context.Context, address common.Address, chainID *big.Int)) *EvmTxStore_GetInProgressTxAttempts_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(common.Address), args[2].(*big.Int)) + }) + return _c +} + +func (_c *EvmTxStore_GetInProgressTxAttempts_Call) Return(attempts []types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], err error) *EvmTxStore_GetInProgressTxAttempts_Call { + _c.Call.Return(attempts, err) + return _c +} + +func (_c *EvmTxStore_GetInProgressTxAttempts_Call) RunAndReturn(run func(context.Context, common.Address, *big.Int) ([]types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], error)) *EvmTxStore_GetInProgressTxAttempts_Call { + _c.Call.Return(run) + return _c +} + // GetTxByID provides a mock function with given fields: ctx, id func (_m *EvmTxStore) GetTxByID(ctx context.Context, id int64) (*types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], error) { ret := _m.Called(ctx, id) @@ -941,6 +1974,35 @@ func (_m *EvmTxStore) GetTxByID(ctx context.Context, id int64) (*types.Tx[*big.I return r0, r1 } +// EvmTxStore_GetTxByID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetTxByID' +type EvmTxStore_GetTxByID_Call struct { + *mock.Call +} + +// GetTxByID is a helper method to define mock.On call +// - ctx context.Context +// - id int64 +func (_e *EvmTxStore_Expecter) GetTxByID(ctx interface{}, id interface{}) *EvmTxStore_GetTxByID_Call { + return &EvmTxStore_GetTxByID_Call{Call: _e.mock.On("GetTxByID", ctx, id)} +} + +func (_c *EvmTxStore_GetTxByID_Call) Run(run func(ctx context.Context, id int64)) *EvmTxStore_GetTxByID_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(int64)) + }) + return _c +} + +func (_c *EvmTxStore_GetTxByID_Call) Return(tx *types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], err error) *EvmTxStore_GetTxByID_Call { + _c.Call.Return(tx, err) + return _c +} + +func (_c *EvmTxStore_GetTxByID_Call) RunAndReturn(run func(context.Context, int64) (*types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], error)) *EvmTxStore_GetTxByID_Call { + _c.Call.Return(run) + return _c +} + // GetTxInProgress provides a mock function with given fields: ctx, fromAddress func (_m *EvmTxStore) GetTxInProgress(ctx context.Context, fromAddress common.Address) (*types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], error) { ret := _m.Called(ctx, fromAddress) @@ -971,6 +2033,35 @@ func (_m *EvmTxStore) GetTxInProgress(ctx context.Context, fromAddress common.Ad return r0, r1 } +// EvmTxStore_GetTxInProgress_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetTxInProgress' +type EvmTxStore_GetTxInProgress_Call struct { + *mock.Call +} + +// GetTxInProgress is a helper method to define mock.On call +// - ctx context.Context +// - fromAddress common.Address +func (_e *EvmTxStore_Expecter) GetTxInProgress(ctx interface{}, fromAddress interface{}) *EvmTxStore_GetTxInProgress_Call { + return &EvmTxStore_GetTxInProgress_Call{Call: _e.mock.On("GetTxInProgress", ctx, fromAddress)} +} + +func (_c *EvmTxStore_GetTxInProgress_Call) Run(run func(ctx context.Context, fromAddress common.Address)) *EvmTxStore_GetTxInProgress_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(common.Address)) + }) + return _c +} + +func (_c *EvmTxStore_GetTxInProgress_Call) Return(etx *types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], err error) *EvmTxStore_GetTxInProgress_Call { + _c.Call.Return(etx, err) + return _c +} + +func (_c *EvmTxStore_GetTxInProgress_Call) RunAndReturn(run func(context.Context, common.Address) (*types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], error)) *EvmTxStore_GetTxInProgress_Call { + _c.Call.Return(run) + return _c +} + // HasInProgressTransaction provides a mock function with given fields: ctx, account, chainID func (_m *EvmTxStore) HasInProgressTransaction(ctx context.Context, account common.Address, chainID *big.Int) (bool, error) { ret := _m.Called(ctx, account, chainID) @@ -999,32 +2090,34 @@ func (_m *EvmTxStore) HasInProgressTransaction(ctx context.Context, account comm return r0, r1 } -// IsTxFinalized provides a mock function with given fields: ctx, blockHeight, txID, chainID -func (_m *EvmTxStore) IsTxFinalized(ctx context.Context, blockHeight int64, txID int64, chainID *big.Int) (bool, error) { - ret := _m.Called(ctx, blockHeight, txID, chainID) +// EvmTxStore_HasInProgressTransaction_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HasInProgressTransaction' +type EvmTxStore_HasInProgressTransaction_Call struct { + *mock.Call +} - if len(ret) == 0 { - panic("no return value specified for IsTxFinalized") - } +// HasInProgressTransaction is a helper method to define mock.On call +// - ctx context.Context +// - account common.Address +// - chainID *big.Int +func (_e *EvmTxStore_Expecter) HasInProgressTransaction(ctx interface{}, account interface{}, chainID interface{}) *EvmTxStore_HasInProgressTransaction_Call { + return &EvmTxStore_HasInProgressTransaction_Call{Call: _e.mock.On("HasInProgressTransaction", ctx, account, chainID)} +} - var r0 bool - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, int64, int64, *big.Int) (bool, error)); ok { - return rf(ctx, blockHeight, txID, chainID) - } - if rf, ok := ret.Get(0).(func(context.Context, int64, int64, *big.Int) bool); ok { - r0 = rf(ctx, blockHeight, txID, chainID) - } else { - r0 = ret.Get(0).(bool) - } +func (_c *EvmTxStore_HasInProgressTransaction_Call) Run(run func(ctx context.Context, account common.Address, chainID *big.Int)) *EvmTxStore_HasInProgressTransaction_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(common.Address), args[2].(*big.Int)) + }) + return _c +} - if rf, ok := ret.Get(1).(func(context.Context, int64, int64, *big.Int) error); ok { - r1 = rf(ctx, blockHeight, txID, chainID) - } else { - r1 = ret.Error(1) - } +func (_c *EvmTxStore_HasInProgressTransaction_Call) Return(exists bool, err error) *EvmTxStore_HasInProgressTransaction_Call { + _c.Call.Return(exists, err) + return _c +} - return r0, r1 +func (_c *EvmTxStore_HasInProgressTransaction_Call) RunAndReturn(run func(context.Context, common.Address, *big.Int) (bool, error)) *EvmTxStore_HasInProgressTransaction_Call { + _c.Call.Return(run) + return _c } // LoadTxAttempts provides a mock function with given fields: ctx, etx @@ -1045,6 +2138,35 @@ func (_m *EvmTxStore) LoadTxAttempts(ctx context.Context, etx *types.Tx[*big.Int return r0 } +// EvmTxStore_LoadTxAttempts_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LoadTxAttempts' +type EvmTxStore_LoadTxAttempts_Call struct { + *mock.Call +} + +// LoadTxAttempts is a helper method to define mock.On call +// - ctx context.Context +// - etx *types.Tx[*big.Int,common.Address,common.Hash,common.Hash,evmtypes.Nonce,gas.EvmFee] +func (_e *EvmTxStore_Expecter) LoadTxAttempts(ctx interface{}, etx interface{}) *EvmTxStore_LoadTxAttempts_Call { + return &EvmTxStore_LoadTxAttempts_Call{Call: _e.mock.On("LoadTxAttempts", ctx, etx)} +} + +func (_c *EvmTxStore_LoadTxAttempts_Call) Run(run func(ctx context.Context, etx *types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee])) *EvmTxStore_LoadTxAttempts_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee])) + }) + return _c +} + +func (_c *EvmTxStore_LoadTxAttempts_Call) Return(_a0 error) *EvmTxStore_LoadTxAttempts_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *EvmTxStore_LoadTxAttempts_Call) RunAndReturn(run func(context.Context, *types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee]) error) *EvmTxStore_LoadTxAttempts_Call { + _c.Call.Return(run) + return _c +} + // MarkAllConfirmedMissingReceipt provides a mock function with given fields: ctx, chainID func (_m *EvmTxStore) MarkAllConfirmedMissingReceipt(ctx context.Context, chainID *big.Int) error { ret := _m.Called(ctx, chainID) @@ -1063,17 +2185,46 @@ func (_m *EvmTxStore) MarkAllConfirmedMissingReceipt(ctx context.Context, chainI return r0 } -// MarkOldTxesMissingReceiptAsErrored provides a mock function with given fields: ctx, blockNum, finalityDepth, chainID -func (_m *EvmTxStore) MarkOldTxesMissingReceiptAsErrored(ctx context.Context, blockNum int64, finalityDepth uint32, chainID *big.Int) error { - ret := _m.Called(ctx, blockNum, finalityDepth, chainID) +// EvmTxStore_MarkAllConfirmedMissingReceipt_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MarkAllConfirmedMissingReceipt' +type EvmTxStore_MarkAllConfirmedMissingReceipt_Call struct { + *mock.Call +} + +// MarkAllConfirmedMissingReceipt is a helper method to define mock.On call +// - ctx context.Context +// - chainID *big.Int +func (_e *EvmTxStore_Expecter) MarkAllConfirmedMissingReceipt(ctx interface{}, chainID interface{}) *EvmTxStore_MarkAllConfirmedMissingReceipt_Call { + return &EvmTxStore_MarkAllConfirmedMissingReceipt_Call{Call: _e.mock.On("MarkAllConfirmedMissingReceipt", ctx, chainID)} +} + +func (_c *EvmTxStore_MarkAllConfirmedMissingReceipt_Call) Run(run func(ctx context.Context, chainID *big.Int)) *EvmTxStore_MarkAllConfirmedMissingReceipt_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*big.Int)) + }) + return _c +} + +func (_c *EvmTxStore_MarkAllConfirmedMissingReceipt_Call) Return(err error) *EvmTxStore_MarkAllConfirmedMissingReceipt_Call { + _c.Call.Return(err) + return _c +} + +func (_c *EvmTxStore_MarkAllConfirmedMissingReceipt_Call) RunAndReturn(run func(context.Context, *big.Int) error) *EvmTxStore_MarkAllConfirmedMissingReceipt_Call { + _c.Call.Return(run) + return _c +} + +// MarkOldTxesMissingReceiptAsErrored provides a mock function with given fields: ctx, blockNum, latestFinalizedBlockNum, chainID +func (_m *EvmTxStore) MarkOldTxesMissingReceiptAsErrored(ctx context.Context, blockNum int64, latestFinalizedBlockNum int64, chainID *big.Int) error { + ret := _m.Called(ctx, blockNum, latestFinalizedBlockNum, chainID) if len(ret) == 0 { panic("no return value specified for MarkOldTxesMissingReceiptAsErrored") } var r0 error - if rf, ok := ret.Get(0).(func(context.Context, int64, uint32, *big.Int) error); ok { - r0 = rf(ctx, blockNum, finalityDepth, chainID) + if rf, ok := ret.Get(0).(func(context.Context, int64, int64, *big.Int) error); ok { + r0 = rf(ctx, blockNum, latestFinalizedBlockNum, chainID) } else { r0 = ret.Error(0) } @@ -1081,6 +2232,37 @@ func (_m *EvmTxStore) MarkOldTxesMissingReceiptAsErrored(ctx context.Context, bl return r0 } +// EvmTxStore_MarkOldTxesMissingReceiptAsErrored_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MarkOldTxesMissingReceiptAsErrored' +type EvmTxStore_MarkOldTxesMissingReceiptAsErrored_Call struct { + *mock.Call +} + +// MarkOldTxesMissingReceiptAsErrored is a helper method to define mock.On call +// - ctx context.Context +// - blockNum int64 +// - latestFinalizedBlockNum int64 +// - chainID *big.Int +func (_e *EvmTxStore_Expecter) MarkOldTxesMissingReceiptAsErrored(ctx interface{}, blockNum interface{}, latestFinalizedBlockNum interface{}, chainID interface{}) *EvmTxStore_MarkOldTxesMissingReceiptAsErrored_Call { + return &EvmTxStore_MarkOldTxesMissingReceiptAsErrored_Call{Call: _e.mock.On("MarkOldTxesMissingReceiptAsErrored", ctx, blockNum, latestFinalizedBlockNum, chainID)} +} + +func (_c *EvmTxStore_MarkOldTxesMissingReceiptAsErrored_Call) Run(run func(ctx context.Context, blockNum int64, latestFinalizedBlockNum int64, chainID *big.Int)) *EvmTxStore_MarkOldTxesMissingReceiptAsErrored_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(int64), args[2].(int64), args[3].(*big.Int)) + }) + return _c +} + +func (_c *EvmTxStore_MarkOldTxesMissingReceiptAsErrored_Call) Return(_a0 error) *EvmTxStore_MarkOldTxesMissingReceiptAsErrored_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *EvmTxStore_MarkOldTxesMissingReceiptAsErrored_Call) RunAndReturn(run func(context.Context, int64, int64, *big.Int) error) *EvmTxStore_MarkOldTxesMissingReceiptAsErrored_Call { + _c.Call.Return(run) + return _c +} + // PreloadTxes provides a mock function with given fields: ctx, attempts func (_m *EvmTxStore) PreloadTxes(ctx context.Context, attempts []types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee]) error { ret := _m.Called(ctx, attempts) @@ -1099,6 +2281,35 @@ func (_m *EvmTxStore) PreloadTxes(ctx context.Context, attempts []types.TxAttemp return r0 } +// EvmTxStore_PreloadTxes_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PreloadTxes' +type EvmTxStore_PreloadTxes_Call struct { + *mock.Call +} + +// PreloadTxes is a helper method to define mock.On call +// - ctx context.Context +// - attempts []types.TxAttempt[*big.Int,common.Address,common.Hash,common.Hash,evmtypes.Nonce,gas.EvmFee] +func (_e *EvmTxStore_Expecter) PreloadTxes(ctx interface{}, attempts interface{}) *EvmTxStore_PreloadTxes_Call { + return &EvmTxStore_PreloadTxes_Call{Call: _e.mock.On("PreloadTxes", ctx, attempts)} +} + +func (_c *EvmTxStore_PreloadTxes_Call) Run(run func(ctx context.Context, attempts []types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee])) *EvmTxStore_PreloadTxes_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].([]types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee])) + }) + return _c +} + +func (_c *EvmTxStore_PreloadTxes_Call) Return(_a0 error) *EvmTxStore_PreloadTxes_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *EvmTxStore_PreloadTxes_Call) RunAndReturn(run func(context.Context, []types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee]) error) *EvmTxStore_PreloadTxes_Call { + _c.Call.Return(run) + return _c +} + // PruneUnstartedTxQueue provides a mock function with given fields: ctx, queueSize, subject func (_m *EvmTxStore) PruneUnstartedTxQueue(ctx context.Context, queueSize uint32, subject uuid.UUID) ([]int64, error) { ret := _m.Called(ctx, queueSize, subject) @@ -1129,17 +2340,47 @@ func (_m *EvmTxStore) PruneUnstartedTxQueue(ctx context.Context, queueSize uint3 return r0, r1 } -// ReapTxHistory provides a mock function with given fields: ctx, minBlockNumberToKeep, timeThreshold, chainID -func (_m *EvmTxStore) ReapTxHistory(ctx context.Context, minBlockNumberToKeep int64, timeThreshold time.Time, chainID *big.Int) error { - ret := _m.Called(ctx, minBlockNumberToKeep, timeThreshold, chainID) +// EvmTxStore_PruneUnstartedTxQueue_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PruneUnstartedTxQueue' +type EvmTxStore_PruneUnstartedTxQueue_Call struct { + *mock.Call +} + +// PruneUnstartedTxQueue is a helper method to define mock.On call +// - ctx context.Context +// - queueSize uint32 +// - subject uuid.UUID +func (_e *EvmTxStore_Expecter) PruneUnstartedTxQueue(ctx interface{}, queueSize interface{}, subject interface{}) *EvmTxStore_PruneUnstartedTxQueue_Call { + return &EvmTxStore_PruneUnstartedTxQueue_Call{Call: _e.mock.On("PruneUnstartedTxQueue", ctx, queueSize, subject)} +} + +func (_c *EvmTxStore_PruneUnstartedTxQueue_Call) Run(run func(ctx context.Context, queueSize uint32, subject uuid.UUID)) *EvmTxStore_PruneUnstartedTxQueue_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(uint32), args[2].(uuid.UUID)) + }) + return _c +} + +func (_c *EvmTxStore_PruneUnstartedTxQueue_Call) Return(ids []int64, err error) *EvmTxStore_PruneUnstartedTxQueue_Call { + _c.Call.Return(ids, err) + return _c +} + +func (_c *EvmTxStore_PruneUnstartedTxQueue_Call) RunAndReturn(run func(context.Context, uint32, uuid.UUID) ([]int64, error)) *EvmTxStore_PruneUnstartedTxQueue_Call { + _c.Call.Return(run) + return _c +} + +// ReapTxHistory provides a mock function with given fields: ctx, timeThreshold, chainID +func (_m *EvmTxStore) ReapTxHistory(ctx context.Context, timeThreshold time.Time, chainID *big.Int) error { + ret := _m.Called(ctx, timeThreshold, chainID) if len(ret) == 0 { panic("no return value specified for ReapTxHistory") } var r0 error - if rf, ok := ret.Get(0).(func(context.Context, int64, time.Time, *big.Int) error); ok { - r0 = rf(ctx, minBlockNumberToKeep, timeThreshold, chainID) + if rf, ok := ret.Get(0).(func(context.Context, time.Time, *big.Int) error); ok { + r0 = rf(ctx, timeThreshold, chainID) } else { r0 = ret.Error(0) } @@ -1147,6 +2388,36 @@ func (_m *EvmTxStore) ReapTxHistory(ctx context.Context, minBlockNumberToKeep in return r0 } +// EvmTxStore_ReapTxHistory_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ReapTxHistory' +type EvmTxStore_ReapTxHistory_Call struct { + *mock.Call +} + +// ReapTxHistory is a helper method to define mock.On call +// - ctx context.Context +// - timeThreshold time.Time +// - chainID *big.Int +func (_e *EvmTxStore_Expecter) ReapTxHistory(ctx interface{}, timeThreshold interface{}, chainID interface{}) *EvmTxStore_ReapTxHistory_Call { + return &EvmTxStore_ReapTxHistory_Call{Call: _e.mock.On("ReapTxHistory", ctx, timeThreshold, chainID)} +} + +func (_c *EvmTxStore_ReapTxHistory_Call) Run(run func(ctx context.Context, timeThreshold time.Time, chainID *big.Int)) *EvmTxStore_ReapTxHistory_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(time.Time), args[2].(*big.Int)) + }) + return _c +} + +func (_c *EvmTxStore_ReapTxHistory_Call) Return(_a0 error) *EvmTxStore_ReapTxHistory_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *EvmTxStore_ReapTxHistory_Call) RunAndReturn(run func(context.Context, time.Time, *big.Int) error) *EvmTxStore_ReapTxHistory_Call { + _c.Call.Return(run) + return _c +} + // SaveConfirmedMissingReceiptAttempt provides a mock function with given fields: ctx, timeout, attempt, broadcastAt func (_m *EvmTxStore) SaveConfirmedMissingReceiptAttempt(ctx context.Context, timeout time.Duration, attempt *types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], broadcastAt time.Time) error { ret := _m.Called(ctx, timeout, attempt, broadcastAt) @@ -1165,6 +2436,37 @@ func (_m *EvmTxStore) SaveConfirmedMissingReceiptAttempt(ctx context.Context, ti return r0 } +// EvmTxStore_SaveConfirmedMissingReceiptAttempt_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SaveConfirmedMissingReceiptAttempt' +type EvmTxStore_SaveConfirmedMissingReceiptAttempt_Call struct { + *mock.Call +} + +// SaveConfirmedMissingReceiptAttempt is a helper method to define mock.On call +// - ctx context.Context +// - timeout time.Duration +// - attempt *types.TxAttempt[*big.Int,common.Address,common.Hash,common.Hash,evmtypes.Nonce,gas.EvmFee] +// - broadcastAt time.Time +func (_e *EvmTxStore_Expecter) SaveConfirmedMissingReceiptAttempt(ctx interface{}, timeout interface{}, attempt interface{}, broadcastAt interface{}) *EvmTxStore_SaveConfirmedMissingReceiptAttempt_Call { + return &EvmTxStore_SaveConfirmedMissingReceiptAttempt_Call{Call: _e.mock.On("SaveConfirmedMissingReceiptAttempt", ctx, timeout, attempt, broadcastAt)} +} + +func (_c *EvmTxStore_SaveConfirmedMissingReceiptAttempt_Call) Run(run func(ctx context.Context, timeout time.Duration, attempt *types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], broadcastAt time.Time)) *EvmTxStore_SaveConfirmedMissingReceiptAttempt_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(time.Duration), args[2].(*types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee]), args[3].(time.Time)) + }) + return _c +} + +func (_c *EvmTxStore_SaveConfirmedMissingReceiptAttempt_Call) Return(_a0 error) *EvmTxStore_SaveConfirmedMissingReceiptAttempt_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *EvmTxStore_SaveConfirmedMissingReceiptAttempt_Call) RunAndReturn(run func(context.Context, time.Duration, *types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], time.Time) error) *EvmTxStore_SaveConfirmedMissingReceiptAttempt_Call { + _c.Call.Return(run) + return _c +} + // SaveFetchedReceipts provides a mock function with given fields: ctx, r, state, errorMsg, chainID func (_m *EvmTxStore) SaveFetchedReceipts(ctx context.Context, r []*evmtypes.Receipt, state types.TxState, errorMsg *string, chainID *big.Int) error { ret := _m.Called(ctx, r, state, errorMsg, chainID) @@ -1183,6 +2485,38 @@ func (_m *EvmTxStore) SaveFetchedReceipts(ctx context.Context, r []*evmtypes.Rec return r0 } +// EvmTxStore_SaveFetchedReceipts_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SaveFetchedReceipts' +type EvmTxStore_SaveFetchedReceipts_Call struct { + *mock.Call +} + +// SaveFetchedReceipts is a helper method to define mock.On call +// - ctx context.Context +// - r []*evmtypes.Receipt +// - state types.TxState +// - errorMsg *string +// - chainID *big.Int +func (_e *EvmTxStore_Expecter) SaveFetchedReceipts(ctx interface{}, r interface{}, state interface{}, errorMsg interface{}, chainID interface{}) *EvmTxStore_SaveFetchedReceipts_Call { + return &EvmTxStore_SaveFetchedReceipts_Call{Call: _e.mock.On("SaveFetchedReceipts", ctx, r, state, errorMsg, chainID)} +} + +func (_c *EvmTxStore_SaveFetchedReceipts_Call) Run(run func(ctx context.Context, r []*evmtypes.Receipt, state types.TxState, errorMsg *string, chainID *big.Int)) *EvmTxStore_SaveFetchedReceipts_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].([]*evmtypes.Receipt), args[2].(types.TxState), args[3].(*string), args[4].(*big.Int)) + }) + return _c +} + +func (_c *EvmTxStore_SaveFetchedReceipts_Call) Return(_a0 error) *EvmTxStore_SaveFetchedReceipts_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *EvmTxStore_SaveFetchedReceipts_Call) RunAndReturn(run func(context.Context, []*evmtypes.Receipt, types.TxState, *string, *big.Int) error) *EvmTxStore_SaveFetchedReceipts_Call { + _c.Call.Return(run) + return _c +} + // SaveInProgressAttempt provides a mock function with given fields: ctx, attempt func (_m *EvmTxStore) SaveInProgressAttempt(ctx context.Context, attempt *types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee]) error { ret := _m.Called(ctx, attempt) @@ -1201,6 +2535,35 @@ func (_m *EvmTxStore) SaveInProgressAttempt(ctx context.Context, attempt *types. return r0 } +// EvmTxStore_SaveInProgressAttempt_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SaveInProgressAttempt' +type EvmTxStore_SaveInProgressAttempt_Call struct { + *mock.Call +} + +// SaveInProgressAttempt is a helper method to define mock.On call +// - ctx context.Context +// - attempt *types.TxAttempt[*big.Int,common.Address,common.Hash,common.Hash,evmtypes.Nonce,gas.EvmFee] +func (_e *EvmTxStore_Expecter) SaveInProgressAttempt(ctx interface{}, attempt interface{}) *EvmTxStore_SaveInProgressAttempt_Call { + return &EvmTxStore_SaveInProgressAttempt_Call{Call: _e.mock.On("SaveInProgressAttempt", ctx, attempt)} +} + +func (_c *EvmTxStore_SaveInProgressAttempt_Call) Run(run func(ctx context.Context, attempt *types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee])) *EvmTxStore_SaveInProgressAttempt_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee])) + }) + return _c +} + +func (_c *EvmTxStore_SaveInProgressAttempt_Call) Return(_a0 error) *EvmTxStore_SaveInProgressAttempt_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *EvmTxStore_SaveInProgressAttempt_Call) RunAndReturn(run func(context.Context, *types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee]) error) *EvmTxStore_SaveInProgressAttempt_Call { + _c.Call.Return(run) + return _c +} + // SaveInsufficientFundsAttempt provides a mock function with given fields: ctx, timeout, attempt, broadcastAt func (_m *EvmTxStore) SaveInsufficientFundsAttempt(ctx context.Context, timeout time.Duration, attempt *types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], broadcastAt time.Time) error { ret := _m.Called(ctx, timeout, attempt, broadcastAt) @@ -1219,6 +2582,37 @@ func (_m *EvmTxStore) SaveInsufficientFundsAttempt(ctx context.Context, timeout return r0 } +// EvmTxStore_SaveInsufficientFundsAttempt_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SaveInsufficientFundsAttempt' +type EvmTxStore_SaveInsufficientFundsAttempt_Call struct { + *mock.Call +} + +// SaveInsufficientFundsAttempt is a helper method to define mock.On call +// - ctx context.Context +// - timeout time.Duration +// - attempt *types.TxAttempt[*big.Int,common.Address,common.Hash,common.Hash,evmtypes.Nonce,gas.EvmFee] +// - broadcastAt time.Time +func (_e *EvmTxStore_Expecter) SaveInsufficientFundsAttempt(ctx interface{}, timeout interface{}, attempt interface{}, broadcastAt interface{}) *EvmTxStore_SaveInsufficientFundsAttempt_Call { + return &EvmTxStore_SaveInsufficientFundsAttempt_Call{Call: _e.mock.On("SaveInsufficientFundsAttempt", ctx, timeout, attempt, broadcastAt)} +} + +func (_c *EvmTxStore_SaveInsufficientFundsAttempt_Call) Run(run func(ctx context.Context, timeout time.Duration, attempt *types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], broadcastAt time.Time)) *EvmTxStore_SaveInsufficientFundsAttempt_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(time.Duration), args[2].(*types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee]), args[3].(time.Time)) + }) + return _c +} + +func (_c *EvmTxStore_SaveInsufficientFundsAttempt_Call) Return(_a0 error) *EvmTxStore_SaveInsufficientFundsAttempt_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *EvmTxStore_SaveInsufficientFundsAttempt_Call) RunAndReturn(run func(context.Context, time.Duration, *types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], time.Time) error) *EvmTxStore_SaveInsufficientFundsAttempt_Call { + _c.Call.Return(run) + return _c +} + // SaveReplacementInProgressAttempt provides a mock function with given fields: ctx, oldAttempt, replacementAttempt func (_m *EvmTxStore) SaveReplacementInProgressAttempt(ctx context.Context, oldAttempt types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], replacementAttempt *types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee]) error { ret := _m.Called(ctx, oldAttempt, replacementAttempt) @@ -1237,6 +2631,36 @@ func (_m *EvmTxStore) SaveReplacementInProgressAttempt(ctx context.Context, oldA return r0 } +// EvmTxStore_SaveReplacementInProgressAttempt_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SaveReplacementInProgressAttempt' +type EvmTxStore_SaveReplacementInProgressAttempt_Call struct { + *mock.Call +} + +// SaveReplacementInProgressAttempt is a helper method to define mock.On call +// - ctx context.Context +// - oldAttempt types.TxAttempt[*big.Int,common.Address,common.Hash,common.Hash,evmtypes.Nonce,gas.EvmFee] +// - replacementAttempt *types.TxAttempt[*big.Int,common.Address,common.Hash,common.Hash,evmtypes.Nonce,gas.EvmFee] +func (_e *EvmTxStore_Expecter) SaveReplacementInProgressAttempt(ctx interface{}, oldAttempt interface{}, replacementAttempt interface{}) *EvmTxStore_SaveReplacementInProgressAttempt_Call { + return &EvmTxStore_SaveReplacementInProgressAttempt_Call{Call: _e.mock.On("SaveReplacementInProgressAttempt", ctx, oldAttempt, replacementAttempt)} +} + +func (_c *EvmTxStore_SaveReplacementInProgressAttempt_Call) Run(run func(ctx context.Context, oldAttempt types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], replacementAttempt *types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee])) *EvmTxStore_SaveReplacementInProgressAttempt_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee]), args[2].(*types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee])) + }) + return _c +} + +func (_c *EvmTxStore_SaveReplacementInProgressAttempt_Call) Return(_a0 error) *EvmTxStore_SaveReplacementInProgressAttempt_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *EvmTxStore_SaveReplacementInProgressAttempt_Call) RunAndReturn(run func(context.Context, types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], *types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee]) error) *EvmTxStore_SaveReplacementInProgressAttempt_Call { + _c.Call.Return(run) + return _c +} + // SaveSentAttempt provides a mock function with given fields: ctx, timeout, attempt, broadcastAt func (_m *EvmTxStore) SaveSentAttempt(ctx context.Context, timeout time.Duration, attempt *types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], broadcastAt time.Time) error { ret := _m.Called(ctx, timeout, attempt, broadcastAt) @@ -1255,6 +2679,37 @@ func (_m *EvmTxStore) SaveSentAttempt(ctx context.Context, timeout time.Duration return r0 } +// EvmTxStore_SaveSentAttempt_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SaveSentAttempt' +type EvmTxStore_SaveSentAttempt_Call struct { + *mock.Call +} + +// SaveSentAttempt is a helper method to define mock.On call +// - ctx context.Context +// - timeout time.Duration +// - attempt *types.TxAttempt[*big.Int,common.Address,common.Hash,common.Hash,evmtypes.Nonce,gas.EvmFee] +// - broadcastAt time.Time +func (_e *EvmTxStore_Expecter) SaveSentAttempt(ctx interface{}, timeout interface{}, attempt interface{}, broadcastAt interface{}) *EvmTxStore_SaveSentAttempt_Call { + return &EvmTxStore_SaveSentAttempt_Call{Call: _e.mock.On("SaveSentAttempt", ctx, timeout, attempt, broadcastAt)} +} + +func (_c *EvmTxStore_SaveSentAttempt_Call) Run(run func(ctx context.Context, timeout time.Duration, attempt *types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], broadcastAt time.Time)) *EvmTxStore_SaveSentAttempt_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(time.Duration), args[2].(*types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee]), args[3].(time.Time)) + }) + return _c +} + +func (_c *EvmTxStore_SaveSentAttempt_Call) Return(_a0 error) *EvmTxStore_SaveSentAttempt_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *EvmTxStore_SaveSentAttempt_Call) RunAndReturn(run func(context.Context, time.Duration, *types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], time.Time) error) *EvmTxStore_SaveSentAttempt_Call { + _c.Call.Return(run) + return _c +} + // SetBroadcastBeforeBlockNum provides a mock function with given fields: ctx, blockNum, chainID func (_m *EvmTxStore) SetBroadcastBeforeBlockNum(ctx context.Context, blockNum int64, chainID *big.Int) error { ret := _m.Called(ctx, blockNum, chainID) @@ -1273,6 +2728,36 @@ func (_m *EvmTxStore) SetBroadcastBeforeBlockNum(ctx context.Context, blockNum i return r0 } +// EvmTxStore_SetBroadcastBeforeBlockNum_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetBroadcastBeforeBlockNum' +type EvmTxStore_SetBroadcastBeforeBlockNum_Call struct { + *mock.Call +} + +// SetBroadcastBeforeBlockNum is a helper method to define mock.On call +// - ctx context.Context +// - blockNum int64 +// - chainID *big.Int +func (_e *EvmTxStore_Expecter) SetBroadcastBeforeBlockNum(ctx interface{}, blockNum interface{}, chainID interface{}) *EvmTxStore_SetBroadcastBeforeBlockNum_Call { + return &EvmTxStore_SetBroadcastBeforeBlockNum_Call{Call: _e.mock.On("SetBroadcastBeforeBlockNum", ctx, blockNum, chainID)} +} + +func (_c *EvmTxStore_SetBroadcastBeforeBlockNum_Call) Run(run func(ctx context.Context, blockNum int64, chainID *big.Int)) *EvmTxStore_SetBroadcastBeforeBlockNum_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(int64), args[2].(*big.Int)) + }) + return _c +} + +func (_c *EvmTxStore_SetBroadcastBeforeBlockNum_Call) Return(_a0 error) *EvmTxStore_SetBroadcastBeforeBlockNum_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *EvmTxStore_SetBroadcastBeforeBlockNum_Call) RunAndReturn(run func(context.Context, int64, *big.Int) error) *EvmTxStore_SetBroadcastBeforeBlockNum_Call { + _c.Call.Return(run) + return _c +} + // Transactions provides a mock function with given fields: ctx, offset, limit func (_m *EvmTxStore) Transactions(ctx context.Context, offset int, limit int) ([]types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], int, error) { ret := _m.Called(ctx, offset, limit) @@ -1310,6 +2795,36 @@ func (_m *EvmTxStore) Transactions(ctx context.Context, offset int, limit int) ( return r0, r1, r2 } +// EvmTxStore_Transactions_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Transactions' +type EvmTxStore_Transactions_Call struct { + *mock.Call +} + +// Transactions is a helper method to define mock.On call +// - ctx context.Context +// - offset int +// - limit int +func (_e *EvmTxStore_Expecter) Transactions(ctx interface{}, offset interface{}, limit interface{}) *EvmTxStore_Transactions_Call { + return &EvmTxStore_Transactions_Call{Call: _e.mock.On("Transactions", ctx, offset, limit)} +} + +func (_c *EvmTxStore_Transactions_Call) Run(run func(ctx context.Context, offset int, limit int)) *EvmTxStore_Transactions_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(int), args[2].(int)) + }) + return _c +} + +func (_c *EvmTxStore_Transactions_Call) Return(_a0 []types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], _a1 int, _a2 error) *EvmTxStore_Transactions_Call { + _c.Call.Return(_a0, _a1, _a2) + return _c +} + +func (_c *EvmTxStore_Transactions_Call) RunAndReturn(run func(context.Context, int, int) ([]types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], int, error)) *EvmTxStore_Transactions_Call { + _c.Call.Return(run) + return _c +} + // TransactionsWithAttempts provides a mock function with given fields: ctx, offset, limit func (_m *EvmTxStore) TransactionsWithAttempts(ctx context.Context, offset int, limit int) ([]types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], int, error) { ret := _m.Called(ctx, offset, limit) @@ -1347,6 +2862,36 @@ func (_m *EvmTxStore) TransactionsWithAttempts(ctx context.Context, offset int, return r0, r1, r2 } +// EvmTxStore_TransactionsWithAttempts_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TransactionsWithAttempts' +type EvmTxStore_TransactionsWithAttempts_Call struct { + *mock.Call +} + +// TransactionsWithAttempts is a helper method to define mock.On call +// - ctx context.Context +// - offset int +// - limit int +func (_e *EvmTxStore_Expecter) TransactionsWithAttempts(ctx interface{}, offset interface{}, limit interface{}) *EvmTxStore_TransactionsWithAttempts_Call { + return &EvmTxStore_TransactionsWithAttempts_Call{Call: _e.mock.On("TransactionsWithAttempts", ctx, offset, limit)} +} + +func (_c *EvmTxStore_TransactionsWithAttempts_Call) Run(run func(ctx context.Context, offset int, limit int)) *EvmTxStore_TransactionsWithAttempts_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(int), args[2].(int)) + }) + return _c +} + +func (_c *EvmTxStore_TransactionsWithAttempts_Call) Return(_a0 []types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], _a1 int, _a2 error) *EvmTxStore_TransactionsWithAttempts_Call { + _c.Call.Return(_a0, _a1, _a2) + return _c +} + +func (_c *EvmTxStore_TransactionsWithAttempts_Call) RunAndReturn(run func(context.Context, int, int) ([]types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], int, error)) *EvmTxStore_TransactionsWithAttempts_Call { + _c.Call.Return(run) + return _c +} + // TxAttempts provides a mock function with given fields: ctx, offset, limit func (_m *EvmTxStore) TxAttempts(ctx context.Context, offset int, limit int) ([]types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], int, error) { ret := _m.Called(ctx, offset, limit) @@ -1384,6 +2929,36 @@ func (_m *EvmTxStore) TxAttempts(ctx context.Context, offset int, limit int) ([] return r0, r1, r2 } +// EvmTxStore_TxAttempts_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TxAttempts' +type EvmTxStore_TxAttempts_Call struct { + *mock.Call +} + +// TxAttempts is a helper method to define mock.On call +// - ctx context.Context +// - offset int +// - limit int +func (_e *EvmTxStore_Expecter) TxAttempts(ctx interface{}, offset interface{}, limit interface{}) *EvmTxStore_TxAttempts_Call { + return &EvmTxStore_TxAttempts_Call{Call: _e.mock.On("TxAttempts", ctx, offset, limit)} +} + +func (_c *EvmTxStore_TxAttempts_Call) Run(run func(ctx context.Context, offset int, limit int)) *EvmTxStore_TxAttempts_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(int), args[2].(int)) + }) + return _c +} + +func (_c *EvmTxStore_TxAttempts_Call) Return(_a0 []types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], _a1 int, _a2 error) *EvmTxStore_TxAttempts_Call { + _c.Call.Return(_a0, _a1, _a2) + return _c +} + +func (_c *EvmTxStore_TxAttempts_Call) RunAndReturn(run func(context.Context, int, int) ([]types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], int, error)) *EvmTxStore_TxAttempts_Call { + _c.Call.Return(run) + return _c +} + // UpdateBroadcastAts provides a mock function with given fields: ctx, now, etxIDs func (_m *EvmTxStore) UpdateBroadcastAts(ctx context.Context, now time.Time, etxIDs []int64) error { ret := _m.Called(ctx, now, etxIDs) @@ -1402,6 +2977,36 @@ func (_m *EvmTxStore) UpdateBroadcastAts(ctx context.Context, now time.Time, etx return r0 } +// EvmTxStore_UpdateBroadcastAts_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateBroadcastAts' +type EvmTxStore_UpdateBroadcastAts_Call struct { + *mock.Call +} + +// UpdateBroadcastAts is a helper method to define mock.On call +// - ctx context.Context +// - now time.Time +// - etxIDs []int64 +func (_e *EvmTxStore_Expecter) UpdateBroadcastAts(ctx interface{}, now interface{}, etxIDs interface{}) *EvmTxStore_UpdateBroadcastAts_Call { + return &EvmTxStore_UpdateBroadcastAts_Call{Call: _e.mock.On("UpdateBroadcastAts", ctx, now, etxIDs)} +} + +func (_c *EvmTxStore_UpdateBroadcastAts_Call) Run(run func(ctx context.Context, now time.Time, etxIDs []int64)) *EvmTxStore_UpdateBroadcastAts_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(time.Time), args[2].([]int64)) + }) + return _c +} + +func (_c *EvmTxStore_UpdateBroadcastAts_Call) Return(_a0 error) *EvmTxStore_UpdateBroadcastAts_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *EvmTxStore_UpdateBroadcastAts_Call) RunAndReturn(run func(context.Context, time.Time, []int64) error) *EvmTxStore_UpdateBroadcastAts_Call { + _c.Call.Return(run) + return _c +} + // UpdateTxAttemptInProgressToBroadcast provides a mock function with given fields: ctx, etx, attempt, NewAttemptState func (_m *EvmTxStore) UpdateTxAttemptInProgressToBroadcast(ctx context.Context, etx *types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], attempt types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], NewAttemptState types.TxAttemptState) error { ret := _m.Called(ctx, etx, attempt, NewAttemptState) @@ -1420,6 +3025,37 @@ func (_m *EvmTxStore) UpdateTxAttemptInProgressToBroadcast(ctx context.Context, return r0 } +// EvmTxStore_UpdateTxAttemptInProgressToBroadcast_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateTxAttemptInProgressToBroadcast' +type EvmTxStore_UpdateTxAttemptInProgressToBroadcast_Call struct { + *mock.Call +} + +// UpdateTxAttemptInProgressToBroadcast is a helper method to define mock.On call +// - ctx context.Context +// - etx *types.Tx[*big.Int,common.Address,common.Hash,common.Hash,evmtypes.Nonce,gas.EvmFee] +// - attempt types.TxAttempt[*big.Int,common.Address,common.Hash,common.Hash,evmtypes.Nonce,gas.EvmFee] +// - NewAttemptState types.TxAttemptState +func (_e *EvmTxStore_Expecter) UpdateTxAttemptInProgressToBroadcast(ctx interface{}, etx interface{}, attempt interface{}, NewAttemptState interface{}) *EvmTxStore_UpdateTxAttemptInProgressToBroadcast_Call { + return &EvmTxStore_UpdateTxAttemptInProgressToBroadcast_Call{Call: _e.mock.On("UpdateTxAttemptInProgressToBroadcast", ctx, etx, attempt, NewAttemptState)} +} + +func (_c *EvmTxStore_UpdateTxAttemptInProgressToBroadcast_Call) Run(run func(ctx context.Context, etx *types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], attempt types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], NewAttemptState types.TxAttemptState)) *EvmTxStore_UpdateTxAttemptInProgressToBroadcast_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee]), args[2].(types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee]), args[3].(types.TxAttemptState)) + }) + return _c +} + +func (_c *EvmTxStore_UpdateTxAttemptInProgressToBroadcast_Call) Return(_a0 error) *EvmTxStore_UpdateTxAttemptInProgressToBroadcast_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *EvmTxStore_UpdateTxAttemptInProgressToBroadcast_Call) RunAndReturn(run func(context.Context, *types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], types.TxAttemptState) error) *EvmTxStore_UpdateTxAttemptInProgressToBroadcast_Call { + _c.Call.Return(run) + return _c +} + // UpdateTxCallbackCompleted provides a mock function with given fields: ctx, pipelineTaskRunRid, chainId func (_m *EvmTxStore) UpdateTxCallbackCompleted(ctx context.Context, pipelineTaskRunRid uuid.UUID, chainId *big.Int) error { ret := _m.Called(ctx, pipelineTaskRunRid, chainId) @@ -1438,6 +3074,36 @@ func (_m *EvmTxStore) UpdateTxCallbackCompleted(ctx context.Context, pipelineTas return r0 } +// EvmTxStore_UpdateTxCallbackCompleted_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateTxCallbackCompleted' +type EvmTxStore_UpdateTxCallbackCompleted_Call struct { + *mock.Call +} + +// UpdateTxCallbackCompleted is a helper method to define mock.On call +// - ctx context.Context +// - pipelineTaskRunRid uuid.UUID +// - chainId *big.Int +func (_e *EvmTxStore_Expecter) UpdateTxCallbackCompleted(ctx interface{}, pipelineTaskRunRid interface{}, chainId interface{}) *EvmTxStore_UpdateTxCallbackCompleted_Call { + return &EvmTxStore_UpdateTxCallbackCompleted_Call{Call: _e.mock.On("UpdateTxCallbackCompleted", ctx, pipelineTaskRunRid, chainId)} +} + +func (_c *EvmTxStore_UpdateTxCallbackCompleted_Call) Run(run func(ctx context.Context, pipelineTaskRunRid uuid.UUID, chainId *big.Int)) *EvmTxStore_UpdateTxCallbackCompleted_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(uuid.UUID), args[2].(*big.Int)) + }) + return _c +} + +func (_c *EvmTxStore_UpdateTxCallbackCompleted_Call) Return(_a0 error) *EvmTxStore_UpdateTxCallbackCompleted_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *EvmTxStore_UpdateTxCallbackCompleted_Call) RunAndReturn(run func(context.Context, uuid.UUID, *big.Int) error) *EvmTxStore_UpdateTxCallbackCompleted_Call { + _c.Call.Return(run) + return _c +} + // UpdateTxFatalError provides a mock function with given fields: ctx, etx func (_m *EvmTxStore) UpdateTxFatalError(ctx context.Context, etx *types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee]) error { ret := _m.Called(ctx, etx) @@ -1456,6 +3122,35 @@ func (_m *EvmTxStore) UpdateTxFatalError(ctx context.Context, etx *types.Tx[*big return r0 } +// EvmTxStore_UpdateTxFatalError_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateTxFatalError' +type EvmTxStore_UpdateTxFatalError_Call struct { + *mock.Call +} + +// UpdateTxFatalError is a helper method to define mock.On call +// - ctx context.Context +// - etx *types.Tx[*big.Int,common.Address,common.Hash,common.Hash,evmtypes.Nonce,gas.EvmFee] +func (_e *EvmTxStore_Expecter) UpdateTxFatalError(ctx interface{}, etx interface{}) *EvmTxStore_UpdateTxFatalError_Call { + return &EvmTxStore_UpdateTxFatalError_Call{Call: _e.mock.On("UpdateTxFatalError", ctx, etx)} +} + +func (_c *EvmTxStore_UpdateTxFatalError_Call) Run(run func(ctx context.Context, etx *types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee])) *EvmTxStore_UpdateTxFatalError_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee])) + }) + return _c +} + +func (_c *EvmTxStore_UpdateTxFatalError_Call) Return(_a0 error) *EvmTxStore_UpdateTxFatalError_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *EvmTxStore_UpdateTxFatalError_Call) RunAndReturn(run func(context.Context, *types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee]) error) *EvmTxStore_UpdateTxFatalError_Call { + _c.Call.Return(run) + return _c +} + // UpdateTxForRebroadcast provides a mock function with given fields: ctx, etx, etxAttempt func (_m *EvmTxStore) UpdateTxForRebroadcast(ctx context.Context, etx types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], etxAttempt types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee]) error { ret := _m.Called(ctx, etx, etxAttempt) @@ -1474,6 +3169,84 @@ func (_m *EvmTxStore) UpdateTxForRebroadcast(ctx context.Context, etx types.Tx[* return r0 } +// EvmTxStore_UpdateTxForRebroadcast_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateTxForRebroadcast' +type EvmTxStore_UpdateTxForRebroadcast_Call struct { + *mock.Call +} + +// UpdateTxForRebroadcast is a helper method to define mock.On call +// - ctx context.Context +// - etx types.Tx[*big.Int,common.Address,common.Hash,common.Hash,evmtypes.Nonce,gas.EvmFee] +// - etxAttempt types.TxAttempt[*big.Int,common.Address,common.Hash,common.Hash,evmtypes.Nonce,gas.EvmFee] +func (_e *EvmTxStore_Expecter) UpdateTxForRebroadcast(ctx interface{}, etx interface{}, etxAttempt interface{}) *EvmTxStore_UpdateTxForRebroadcast_Call { + return &EvmTxStore_UpdateTxForRebroadcast_Call{Call: _e.mock.On("UpdateTxForRebroadcast", ctx, etx, etxAttempt)} +} + +func (_c *EvmTxStore_UpdateTxForRebroadcast_Call) Run(run func(ctx context.Context, etx types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], etxAttempt types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee])) *EvmTxStore_UpdateTxForRebroadcast_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee]), args[2].(types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee])) + }) + return _c +} + +func (_c *EvmTxStore_UpdateTxForRebroadcast_Call) Return(_a0 error) *EvmTxStore_UpdateTxForRebroadcast_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *EvmTxStore_UpdateTxForRebroadcast_Call) RunAndReturn(run func(context.Context, types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee]) error) *EvmTxStore_UpdateTxForRebroadcast_Call { + _c.Call.Return(run) + return _c +} + +// UpdateTxStatesToFinalizedUsingReceiptIds provides a mock function with given fields: ctx, etxIDs, chainId +func (_m *EvmTxStore) UpdateTxStatesToFinalizedUsingReceiptIds(ctx context.Context, etxIDs []int64, chainId *big.Int) error { + ret := _m.Called(ctx, etxIDs, chainId) + + if len(ret) == 0 { + panic("no return value specified for UpdateTxStatesToFinalizedUsingReceiptIds") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, []int64, *big.Int) error); ok { + r0 = rf(ctx, etxIDs, chainId) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// EvmTxStore_UpdateTxStatesToFinalizedUsingReceiptIds_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateTxStatesToFinalizedUsingReceiptIds' +type EvmTxStore_UpdateTxStatesToFinalizedUsingReceiptIds_Call struct { + *mock.Call +} + +// UpdateTxStatesToFinalizedUsingReceiptIds is a helper method to define mock.On call +// - ctx context.Context +// - etxIDs []int64 +// - chainId *big.Int +func (_e *EvmTxStore_Expecter) UpdateTxStatesToFinalizedUsingReceiptIds(ctx interface{}, etxIDs interface{}, chainId interface{}) *EvmTxStore_UpdateTxStatesToFinalizedUsingReceiptIds_Call { + return &EvmTxStore_UpdateTxStatesToFinalizedUsingReceiptIds_Call{Call: _e.mock.On("UpdateTxStatesToFinalizedUsingReceiptIds", ctx, etxIDs, chainId)} +} + +func (_c *EvmTxStore_UpdateTxStatesToFinalizedUsingReceiptIds_Call) Run(run func(ctx context.Context, etxIDs []int64, chainId *big.Int)) *EvmTxStore_UpdateTxStatesToFinalizedUsingReceiptIds_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].([]int64), args[2].(*big.Int)) + }) + return _c +} + +func (_c *EvmTxStore_UpdateTxStatesToFinalizedUsingReceiptIds_Call) Return(_a0 error) *EvmTxStore_UpdateTxStatesToFinalizedUsingReceiptIds_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *EvmTxStore_UpdateTxStatesToFinalizedUsingReceiptIds_Call) RunAndReturn(run func(context.Context, []int64, *big.Int) error) *EvmTxStore_UpdateTxStatesToFinalizedUsingReceiptIds_Call { + _c.Call.Return(run) + return _c +} + // UpdateTxUnstartedToInProgress provides a mock function with given fields: ctx, etx, attempt func (_m *EvmTxStore) UpdateTxUnstartedToInProgress(ctx context.Context, etx *types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], attempt *types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee]) error { ret := _m.Called(ctx, etx, attempt) @@ -1492,6 +3265,36 @@ func (_m *EvmTxStore) UpdateTxUnstartedToInProgress(ctx context.Context, etx *ty return r0 } +// EvmTxStore_UpdateTxUnstartedToInProgress_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateTxUnstartedToInProgress' +type EvmTxStore_UpdateTxUnstartedToInProgress_Call struct { + *mock.Call +} + +// UpdateTxUnstartedToInProgress is a helper method to define mock.On call +// - ctx context.Context +// - etx *types.Tx[*big.Int,common.Address,common.Hash,common.Hash,evmtypes.Nonce,gas.EvmFee] +// - attempt *types.TxAttempt[*big.Int,common.Address,common.Hash,common.Hash,evmtypes.Nonce,gas.EvmFee] +func (_e *EvmTxStore_Expecter) UpdateTxUnstartedToInProgress(ctx interface{}, etx interface{}, attempt interface{}) *EvmTxStore_UpdateTxUnstartedToInProgress_Call { + return &EvmTxStore_UpdateTxUnstartedToInProgress_Call{Call: _e.mock.On("UpdateTxUnstartedToInProgress", ctx, etx, attempt)} +} + +func (_c *EvmTxStore_UpdateTxUnstartedToInProgress_Call) Run(run func(ctx context.Context, etx *types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], attempt *types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee])) *EvmTxStore_UpdateTxUnstartedToInProgress_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee]), args[2].(*types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee])) + }) + return _c +} + +func (_c *EvmTxStore_UpdateTxUnstartedToInProgress_Call) Return(_a0 error) *EvmTxStore_UpdateTxUnstartedToInProgress_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *EvmTxStore_UpdateTxUnstartedToInProgress_Call) RunAndReturn(run func(context.Context, *types.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee], *types.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee]) error) *EvmTxStore_UpdateTxUnstartedToInProgress_Call { + _c.Call.Return(run) + return _c +} + // UpdateTxsUnconfirmed provides a mock function with given fields: ctx, ids func (_m *EvmTxStore) UpdateTxsUnconfirmed(ctx context.Context, ids []int64) error { ret := _m.Called(ctx, ids) @@ -1510,6 +3313,35 @@ func (_m *EvmTxStore) UpdateTxsUnconfirmed(ctx context.Context, ids []int64) err return r0 } +// EvmTxStore_UpdateTxsUnconfirmed_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateTxsUnconfirmed' +type EvmTxStore_UpdateTxsUnconfirmed_Call struct { + *mock.Call +} + +// UpdateTxsUnconfirmed is a helper method to define mock.On call +// - ctx context.Context +// - ids []int64 +func (_e *EvmTxStore_Expecter) UpdateTxsUnconfirmed(ctx interface{}, ids interface{}) *EvmTxStore_UpdateTxsUnconfirmed_Call { + return &EvmTxStore_UpdateTxsUnconfirmed_Call{Call: _e.mock.On("UpdateTxsUnconfirmed", ctx, ids)} +} + +func (_c *EvmTxStore_UpdateTxsUnconfirmed_Call) Run(run func(ctx context.Context, ids []int64)) *EvmTxStore_UpdateTxsUnconfirmed_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].([]int64)) + }) + return _c +} + +func (_c *EvmTxStore_UpdateTxsUnconfirmed_Call) Return(_a0 error) *EvmTxStore_UpdateTxsUnconfirmed_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *EvmTxStore_UpdateTxsUnconfirmed_Call) RunAndReturn(run func(context.Context, []int64) error) *EvmTxStore_UpdateTxsUnconfirmed_Call { + _c.Call.Return(run) + return _c +} + // NewEvmTxStore creates a new instance of EvmTxStore. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewEvmTxStore(t interface { diff --git a/core/chains/evm/txmgr/models.go b/core/chains/evm/txmgr/models.go index f8682ffd500..1ba3d193cba 100644 --- a/core/chains/evm/txmgr/models.go +++ b/core/chains/evm/txmgr/models.go @@ -36,12 +36,13 @@ type ( Tx = txmgrtypes.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee] TxMeta = txmgrtypes.TxMeta[common.Address, common.Hash] TxAttempt = txmgrtypes.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee] - Receipt = dbReceipt // EvmReceipt is the exported DB table model for receipts + Receipt = DbReceipt // DbReceipt is the exported DB table model for receipts ReceiptPlus = txmgrtypes.ReceiptPlus[*evmtypes.Receipt] StuckTxDetector = txmgrtypes.StuckTxDetector[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee] TxmClient = txmgrtypes.TxmClient[*big.Int, common.Address, common.Hash, common.Hash, *evmtypes.Receipt, evmtypes.Nonce, gas.EvmFee] TransactionClient = txmgrtypes.TransactionClient[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee] ChainReceipt = txmgrtypes.ChainReceipt[common.Hash, common.Hash] + Finalizer = txmgrtypes.Finalizer[common.Hash, *evmtypes.Head] ) var _ KeyStore = (keystore.Eth)(nil) // check interface in txmgr to avoid circular import diff --git a/core/chains/evm/txmgr/reaper_test.go b/core/chains/evm/txmgr/reaper_test.go index b3ce48b702c..cfaccdf04eb 100644 --- a/core/chains/evm/txmgr/reaper_test.go +++ b/core/chains/evm/txmgr/reaper_test.go @@ -12,18 +12,17 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/utils" txmgrtypes "github.com/smartcontractkit/chainlink/v2/common/txmgr/types" - txmgrmocks "github.com/smartcontractkit/chainlink/v2/common/txmgr/types/mocks" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/txmgr" "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/pgtest" ) -func newReaperWithChainID(t *testing.T, db txmgrtypes.TxHistoryReaper[*big.Int], cfg txmgrtypes.ReaperChainConfig, txConfig txmgrtypes.ReaperTransactionsConfig, cid *big.Int) *txmgr.Reaper { - return txmgr.NewEvmReaper(logger.Test(t), db, cfg, txConfig, cid) +func newReaperWithChainID(t *testing.T, db txmgrtypes.TxHistoryReaper[*big.Int], txConfig txmgrtypes.ReaperTransactionsConfig, cid *big.Int) *txmgr.Reaper { + return txmgr.NewEvmReaper(logger.Test(t), db, txConfig, cid) } -func newReaper(t *testing.T, db txmgrtypes.TxHistoryReaper[*big.Int], cfg txmgrtypes.ReaperChainConfig, txConfig txmgrtypes.ReaperTransactionsConfig) *txmgr.Reaper { - return newReaperWithChainID(t, db, cfg, txConfig, &cltest.FixtureChainID) +func newReaper(t *testing.T, db txmgrtypes.TxHistoryReaper[*big.Int], txConfig txmgrtypes.ReaperTransactionsConfig) *txmgr.Reaper { + return newReaperWithChainID(t, db, txConfig, &cltest.FixtureChainID) } type reaperConfig struct { @@ -51,12 +50,9 @@ func TestReaper_ReapTxes(t *testing.T) { oneDayAgo := time.Now().Add(-24 * time.Hour) t.Run("with nothing in the database, doesn't error", func(t *testing.T) { - config := txmgrmocks.NewReaperConfig(t) - config.On("FinalityDepth").Return(uint32(10)) - tc := &reaperConfig{reaperThreshold: 1 * time.Hour} - r := newReaper(t, txStore, config, tc) + r := newReaper(t, txStore, tc) err := r.ReapTxes(42) assert.NoError(t, err) @@ -66,11 +62,9 @@ func TestReaper_ReapTxes(t *testing.T) { mustInsertConfirmedEthTxWithReceipt(t, txStore, from, nonce, 5) t.Run("skips if threshold=0", func(t *testing.T) { - config := txmgrmocks.NewReaperConfig(t) - tc := &reaperConfig{reaperThreshold: 0 * time.Second} - r := newReaper(t, txStore, config, tc) + r := newReaper(t, txStore, tc) err := r.ReapTxes(42) assert.NoError(t, err) @@ -79,12 +73,9 @@ func TestReaper_ReapTxes(t *testing.T) { }) t.Run("doesn't touch ethtxes with different chain ID", func(t *testing.T) { - config := txmgrmocks.NewReaperConfig(t) - config.On("FinalityDepth").Return(uint32(10)) - tc := &reaperConfig{reaperThreshold: 1 * time.Hour} - r := newReaperWithChainID(t, txStore, config, tc, big.NewInt(42)) + r := newReaperWithChainID(t, txStore, tc, big.NewInt(42)) err := r.ReapTxes(42) assert.NoError(t, err) @@ -92,41 +83,30 @@ func TestReaper_ReapTxes(t *testing.T) { cltest.AssertCount(t, db, "evm.txes", 1) }) - t.Run("deletes confirmed evm.txes that exceed the age threshold with at least EVM.FinalityDepth blocks above their receipt", func(t *testing.T) { - config := txmgrmocks.NewReaperConfig(t) - config.On("FinalityDepth").Return(uint32(10)) - + t.Run("deletes finalized evm.txes that exceed the age threshold", func(t *testing.T) { tc := &reaperConfig{reaperThreshold: 1 * time.Hour} - r := newReaper(t, txStore, config, tc) + r := newReaper(t, txStore, tc) err := r.ReapTxes(42) assert.NoError(t, err) // Didn't delete because eth_tx was not old enough cltest.AssertCount(t, db, "evm.txes", 1) - pgtest.MustExec(t, db, `UPDATE evm.txes SET created_at=$1`, oneDayAgo) - - err = r.ReapTxes(12) - assert.NoError(t, err) - // Didn't delete because eth_tx although old enough, was still within EVM.FinalityDepth of the current head - cltest.AssertCount(t, db, "evm.txes", 1) + pgtest.MustExec(t, db, `UPDATE evm.txes SET created_at=$1, state='finalized'`, oneDayAgo) err = r.ReapTxes(42) assert.NoError(t, err) - // Now it deleted because the eth_tx was past EVM.FinalityDepth + // Now it deleted because the eth_tx was past the age threshold cltest.AssertCount(t, db, "evm.txes", 0) }) mustInsertFatalErrorEthTx(t, txStore, from) t.Run("deletes errored evm.txes that exceed the age threshold", func(t *testing.T) { - config := txmgrmocks.NewReaperConfig(t) - config.On("FinalityDepth").Return(uint32(10)) - tc := &reaperConfig{reaperThreshold: 1 * time.Hour} - r := newReaper(t, txStore, config, tc) + r := newReaper(t, txStore, tc) err := r.ReapTxes(42) assert.NoError(t, err) @@ -140,4 +120,24 @@ func TestReaper_ReapTxes(t *testing.T) { // Deleted because it is old enough now cltest.AssertCount(t, db, "evm.txes", 0) }) + + mustInsertConfirmedEthTxWithReceipt(t, txStore, from, 0, 42) + + t.Run("deletes confirmed evm.txes that exceed the age threshold", func(t *testing.T) { + tc := &reaperConfig{reaperThreshold: 1 * time.Hour} + + r := newReaper(t, txStore, tc) + + err := r.ReapTxes(42) + assert.NoError(t, err) + // Didn't delete because eth_tx was not old enough + cltest.AssertCount(t, db, "evm.txes", 1) + + pgtest.MustExec(t, db, `UPDATE evm.txes SET created_at=$1`, oneDayAgo) + + err = r.ReapTxes(42) + assert.NoError(t, err) + // Now it deleted because the eth_tx was past the age threshold + cltest.AssertCount(t, db, "evm.txes", 0) + }) } diff --git a/core/chains/evm/txmgr/stuck_tx_detector.go b/core/chains/evm/txmgr/stuck_tx_detector.go index 1beb857af8f..26d7643c15a 100644 --- a/core/chains/evm/txmgr/stuck_tx_detector.go +++ b/core/chains/evm/txmgr/stuck_tx_detector.go @@ -4,6 +4,7 @@ import ( "bytes" "context" "encoding/json" + "errors" "fmt" "math/big" "net/http" @@ -24,7 +25,7 @@ import ( ) type stuckTxDetectorGasEstimator interface { - GetFee(ctx context.Context, calldata []byte, feeLimit uint64, maxFeePrice *assets.Wei, opts ...feetypes.Opt) (fee gas.EvmFee, chainSpecificFeeLimit uint64, err error) + GetFee(ctx context.Context, calldata []byte, feeLimit uint64, maxFeePrice *assets.Wei, fromAddress, toAddress *common.Address, opts ...feetypes.Opt) (fee gas.EvmFee, chainSpecificFeeLimit uint64, err error) } type stuckTxDetectorClient interface { @@ -37,13 +38,13 @@ type stuckTxDetectorTxStore interface { type stuckTxDetectorConfig interface { Enabled() bool - Threshold() uint32 - MinAttempts() uint32 + Threshold() *uint32 + MinAttempts() *uint32 DetectionApiUrl() *url.URL } type stuckTxDetector struct { - lggr logger.Logger + lggr logger.SugaredLogger chainID *big.Int chainType chaintype.ChainType maxPrice *assets.Wei @@ -63,7 +64,7 @@ func NewStuckTxDetector(lggr logger.Logger, chainID *big.Int, chainType chaintyp t.DisableCompression = true httpClient := &http.Client{Transport: t} return &stuckTxDetector{ - lggr: lggr, + lggr: logger.Sugared(lggr), chainID: chainID, chainType: chainType, maxPrice: maxPrice, @@ -78,7 +79,7 @@ func NewStuckTxDetector(lggr logger.Logger, chainID *big.Int, chainType chaintyp func (d *stuckTxDetector) LoadPurgeBlockNumMap(ctx context.Context, addresses []common.Address) error { // Skip loading purge block num map if auto-purge feature disabled or Threshold is set to 0 - if !d.cfg.Enabled() || d.cfg.Threshold() == 0 { + if !d.cfg.Enabled() || d.cfg.Threshold() == nil || *d.cfg.Threshold() == 0 { return nil } d.purgeBlockNumLock.Lock() @@ -127,7 +128,7 @@ func (d *stuckTxDetector) DetectStuckTransactions(ctx context.Context, enabledAd switch d.chainType { case chaintype.ChainScroll: return d.detectStuckTransactionsScroll(ctx, txs) - case chaintype.ChainZkEvm: + case chaintype.ChainZkEvm, chaintype.ChainXLayer: return d.detectStuckTransactionsZkEVM(ctx, txs) default: return d.detectStuckTransactionsHeuristic(ctx, txs, blockNum) @@ -152,11 +153,28 @@ func (d *stuckTxDetector) FindUnconfirmedTxWithLowestNonce(ctx context.Context, } } - // Build list of potentially stuck tx but exclude any that are already marked for purge + // Build list of potentially stuck tx but exclude any that are already marked for purge or have non-broadcasted attempts var stuckTxs []Tx for _, tx := range lowestNonceTxMap { - // Attempts are loaded newest to oldest so one marked for purge will always be first - if len(tx.TxAttempts) > 0 && !tx.TxAttempts[0].IsPurgeAttempt { + if len(tx.TxAttempts) == 0 { + d.lggr.AssumptionViolationw("encountered an unconfirmed transaction without an attempt", "tx", tx) + continue + } + // Check the transaction's attempts in case any are already marked for purge or if any are not broadcasted + // We can only have one non-broadcasted attempt for a transaction at a time + // Skip purge detection until all attempts are broadcasted to avoid conflicts with the purge attempt + var foundPurgeAttempt, foundNonBroadcastAttempt bool + for _, attempt := range tx.TxAttempts { + if attempt.IsPurgeAttempt { + foundPurgeAttempt = true + break + } + if attempt.State != types.TxAttemptBroadcast { + foundNonBroadcastAttempt = true + break + } + } + if !foundPurgeAttempt && !foundNonBroadcastAttempt { stuckTxs = append(stuckTxs, tx) } } @@ -172,11 +190,16 @@ func (d *stuckTxDetector) FindUnconfirmedTxWithLowestNonce(ctx context.Context, // 4. If 3 is true, check if the latest attempt's gas price is higher than what our gas estimator's GetFee method returns // 5. If 4 is true, the transaction is likely stuck due to overflow func (d *stuckTxDetector) detectStuckTransactionsHeuristic(ctx context.Context, txs []Tx, blockNum int64) ([]Tx, error) { + if d.cfg.Threshold() == nil || d.cfg.MinAttempts() == nil { + err := errors.New("missing required configs for the stuck transaction heuristic. Transactions.AutoPurge.Threshold and Transactions.AutoPurge.MinAttempts are required") + d.lggr.Error(err.Error()) + return txs, err + } d.purgeBlockNumLock.RLock() defer d.purgeBlockNumLock.RUnlock() // Get gas price from internal gas estimator // Send with max gas price time 2 to prevent the results from being capped. Need the market gas price here. - marketGasPrice, _, err := d.gasEstimator.GetFee(ctx, []byte{}, 0, d.maxPrice.Mul(big.NewInt(2))) + marketGasPrice, _, err := d.gasEstimator.GetFee(ctx, []byte{}, 0, d.maxPrice.Mul(big.NewInt(2)), nil, nil) if err != nil { return txs, fmt.Errorf("failed to get market gas price for overflow detection: %w", err) } @@ -187,17 +210,17 @@ func (d *stuckTxDetector) detectStuckTransactionsHeuristic(ctx context.Context, d.purgeBlockNumLock.RLock() lastPurgeBlockNum := d.purgeBlockNumMap[tx.FromAddress] d.purgeBlockNumLock.RUnlock() - if lastPurgeBlockNum > blockNum-int64(d.cfg.Threshold()) { + if lastPurgeBlockNum > blockNum-int64(*d.cfg.Threshold()) { continue } // Tx attempts are loaded from newest to oldest oldestBroadcastAttempt, newestBroadcastAttempt, broadcastedAttemptsCount := findBroadcastedAttempts(tx) // 2. Check if Threshold amount of blocks have passed since the oldest attempt's broadcast block num - if *oldestBroadcastAttempt.BroadcastBeforeBlockNum > blockNum-int64(d.cfg.Threshold()) { + if *oldestBroadcastAttempt.BroadcastBeforeBlockNum > blockNum-int64(*d.cfg.Threshold()) { continue } // 3. Check if the transaction has at least MinAttempts amount of broadcasted attempts - if broadcastedAttemptsCount < d.cfg.MinAttempts() { + if broadcastedAttemptsCount < *d.cfg.MinAttempts() { continue } // 4. Check if the newest broadcasted attempt's gas price is higher than what our gas estimator's GetFee method returns @@ -278,6 +301,10 @@ func (d *stuckTxDetector) detectStuckTransactionsScroll(ctx context.Context, txs if err != nil { return nil, fmt.Errorf("failed to make new request with context: %w", err) } + + // Add Content-Type header + postReq.Header.Add("Content-Type", "application/json") + // Send request resp, err := d.httpClient.Do(postReq) if err != nil { @@ -287,6 +314,7 @@ func (d *stuckTxDetector) detectStuckTransactionsScroll(ctx context.Context, txs if resp.StatusCode != 200 { return nil, fmt.Errorf("request failed with status %d", resp.StatusCode) } + // Decode the response into expected type scrollResp := new(scrollResponse) err = json.NewDecoder(resp.Body).Decode(scrollResp) @@ -311,14 +339,32 @@ func (d *stuckTxDetector) detectStuckTransactionsScroll(ctx context.Context, txs // Uses eth_getTransactionByHash to detect that a transaction has been discarded due to overflow // Currently only used by zkEVM but if other chains follow the same behavior in the future func (d *stuckTxDetector) detectStuckTransactionsZkEVM(ctx context.Context, txs []Tx) ([]Tx, error) { - txReqs := make([]rpc.BatchElem, len(txs)) + minAttempts := 0 + if d.cfg.MinAttempts() != nil { + minAttempts = int(*d.cfg.MinAttempts()) + } + // Check transactions have MinAttempts to ensure it has enough time to return results for getTransactionByHash + // zkEVM has a significant delay between broadcasting a transaction and getting a proper result from the RPC + var filteredTx []Tx + for _, tx := range txs { + if len(tx.TxAttempts) >= minAttempts { + filteredTx = append(filteredTx, tx) + } + } + + // No transactions to process + if len(filteredTx) == 0 { + return filteredTx, nil + } + + txReqs := make([]rpc.BatchElem, len(filteredTx)) txHashMap := make(map[common.Hash]Tx) - txRes := make([]*map[string]interface{}, len(txs)) + txRes := make([]*map[string]interface{}, len(filteredTx)) // Build batch request elems to perform // Does not need to be separated out into smaller batches // Max number of transactions to check is equal to the number of enabled addresses which is a relatively small amount - for i, tx := range txs { + for i, tx := range filteredTx { latestAttemptHash := tx.TxAttempts[0].Hash var result map[string]interface{} txReqs[i] = rpc.BatchElem{ @@ -363,7 +409,6 @@ func (d *stuckTxDetector) SetPurgeBlockNum(fromAddress common.Address, blockNum d.purgeBlockNumMap[fromAddress] = blockNum } -func (d *stuckTxDetector) StuckTxFatalError() *string { - errorMsg := client.TerminallyStuckMsg - return &errorMsg +func (d *stuckTxDetector) StuckTxFatalError() string { + return client.TerminallyStuckMsg } diff --git a/core/chains/evm/txmgr/stuck_tx_detector_test.go b/core/chains/evm/txmgr/stuck_tx_detector_test.go index e980527c989..eb22830ef35 100644 --- a/core/chains/evm/txmgr/stuck_tx_detector_test.go +++ b/core/chains/evm/txmgr/stuck_tx_detector_test.go @@ -73,13 +73,13 @@ func TestStuckTxDetector_LoadPurgeBlockNumMap(t *testing.T) { feeEstimator := gasmocks.NewEvmFeeEstimator(t) marketGasPrice := assets.GWei(15) fee := gas.EvmFee{Legacy: marketGasPrice} - feeEstimator.On("GetFee", mock.Anything, []byte{}, uint64(0), mock.Anything).Return(fee, uint64(0), nil) + feeEstimator.On("GetFee", mock.Anything, []byte{}, uint64(0), mock.Anything, mock.Anything, mock.Anything).Return(fee, uint64(0), nil) autoPurgeThreshold := uint32(5) autoPurgeMinAttempts := uint32(3) autoPurgeCfg := testAutoPurgeConfig{ enabled: true, // Enable auto-purge feature for testing - threshold: autoPurgeThreshold, - minAttempts: autoPurgeMinAttempts, + threshold: &autoPurgeThreshold, + minAttempts: &autoPurgeMinAttempts, } stuckTxDetector := txmgr.NewStuckTxDetector(lggr, testutils.FixtureChainID, "", assets.NewWei(assets.NewEth(100).ToInt()), autoPurgeCfg, feeEstimator, txStore, ethClient) @@ -155,6 +155,30 @@ func TestStuckTxDetector_FindPotentialStuckTxs(t *testing.T) { require.NoError(t, err) require.Len(t, stuckTxs, 0) }) + + t.Run("excludes transactions with a in-progress attempt", func(t *testing.T) { + _, fromAddress := cltest.MustInsertRandomKey(t, ethKeyStore) + etx := cltest.MustInsertUnconfirmedEthTxWithBroadcastLegacyAttempt(t, txStore, 0, fromAddress) + attempt := cltest.NewLegacyEthTxAttempt(t, etx.ID) + attempt.TxFee.Legacy = assets.NewWeiI(2) + attempt.State = txmgrtypes.TxAttemptInProgress + require.NoError(t, txStore.InsertTxAttempt(ctx, &attempt)) + stuckTxs, err := stuckTxDetector.FindUnconfirmedTxWithLowestNonce(ctx, []common.Address{fromAddress}) + require.NoError(t, err) + require.Len(t, stuckTxs, 0) + }) + + t.Run("excludes transactions with an insufficient funds attempt", func(t *testing.T) { + _, fromAddress := cltest.MustInsertRandomKey(t, ethKeyStore) + etx := cltest.MustInsertUnconfirmedEthTxWithBroadcastLegacyAttempt(t, txStore, 0, fromAddress) + attempt := cltest.NewLegacyEthTxAttempt(t, etx.ID) + attempt.TxFee.Legacy = assets.NewWeiI(2) + attempt.State = txmgrtypes.TxAttemptInsufficientFunds + require.NoError(t, txStore.InsertTxAttempt(ctx, &attempt)) + stuckTxs, err := stuckTxDetector.FindUnconfirmedTxWithLowestNonce(ctx, []common.Address{fromAddress}) + require.NoError(t, err) + require.Len(t, stuckTxs, 0) + }) } func TestStuckTxDetector_DetectStuckTransactionsHeuristic(t *testing.T) { @@ -170,14 +194,14 @@ func TestStuckTxDetector_DetectStuckTransactionsHeuristic(t *testing.T) { // Return 10 gwei as market gas price marketGasPrice := tenGwei fee := gas.EvmFee{Legacy: marketGasPrice} - feeEstimator.On("GetFee", mock.Anything, []byte{}, uint64(0), mock.Anything).Return(fee, uint64(0), nil) + feeEstimator.On("GetFee", mock.Anything, []byte{}, uint64(0), mock.Anything, mock.Anything, mock.Anything).Return(fee, uint64(0), nil) ethClient := testutils.NewEthClientMockWithDefaultChain(t) autoPurgeThreshold := uint32(5) autoPurgeMinAttempts := uint32(3) autoPurgeCfg := testAutoPurgeConfig{ enabled: true, // Enable auto-purge feature for testing - threshold: autoPurgeThreshold, - minAttempts: autoPurgeMinAttempts, + threshold: &autoPurgeThreshold, + minAttempts: &autoPurgeMinAttempts, } blockNum := int64(100) stuckTxDetector := txmgr.NewStuckTxDetector(lggr, testutils.FixtureChainID, "", assets.NewWei(assets.NewEth(100).ToInt()), autoPurgeCfg, feeEstimator, txStore, ethClient) @@ -271,8 +295,9 @@ func TestStuckTxDetector_DetectStuckTransactionsZkEVM(t *testing.T) { enabled: true, } blockNum := int64(100) - stuckTxDetector := txmgr.NewStuckTxDetector(lggr, testutils.FixtureChainID, chaintype.ChainZkEvm, assets.NewWei(assets.NewEth(100).ToInt()), autoPurgeCfg, feeEstimator, txStore, ethClient) + t.Run("returns empty list if no stuck transactions identified", func(t *testing.T) { + stuckTxDetector := txmgr.NewStuckTxDetector(lggr, testutils.FixtureChainID, chaintype.ChainZkEvm, assets.NewWei(assets.NewEth(100).ToInt()), autoPurgeCfg, feeEstimator, txStore, ethClient) _, fromAddress := cltest.MustInsertRandomKey(t, ethKeyStore) tx := mustInsertUnconfirmedTxWithBroadcastAttempts(t, txStore, 0, fromAddress, 1, blockNum, tenGwei) attempts := tx.TxAttempts[0] @@ -292,6 +317,7 @@ func TestStuckTxDetector_DetectStuckTransactionsZkEVM(t *testing.T) { }) t.Run("returns stuck transactions discarded by chain", func(t *testing.T) { + stuckTxDetector := txmgr.NewStuckTxDetector(lggr, testutils.FixtureChainID, chaintype.ChainZkEvm, assets.NewWei(assets.NewEth(100).ToInt()), autoPurgeCfg, feeEstimator, txStore, ethClient) // Insert tx that will be mocked as stuck _, fromAddress1 := cltest.MustInsertRandomKey(t, ethKeyStore) mustInsertUnconfirmedTxWithBroadcastAttempts(t, txStore, 0, fromAddress1, 1, blockNum, tenGwei) @@ -316,6 +342,34 @@ func TestStuckTxDetector_DetectStuckTransactionsZkEVM(t *testing.T) { // Expect only 1 tx to return as stuck due to nil eth_getTransactionByHash response require.Len(t, txs, 1) }) + + t.Run("skips stuck tx detection for transactions that do not have enough attempts", func(t *testing.T) { + autoPurgeCfg.minAttempts = ptr(uint32(2)) + stuckTxDetector := txmgr.NewStuckTxDetector(lggr, testutils.FixtureChainID, chaintype.ChainZkEvm, assets.NewWei(assets.NewEth(100).ToInt()), autoPurgeCfg, feeEstimator, txStore, ethClient) + // Insert tx with enough attempts for detection + _, fromAddress1 := cltest.MustInsertRandomKey(t, ethKeyStore) + etx1 := mustInsertUnconfirmedTxWithBroadcastAttempts(t, txStore, 0, fromAddress1, 1, blockNum, tenGwei) + attempt := cltest.NewLegacyEthTxAttempt(t, etx1.ID) + attempt.TxFee.Legacy = assets.NewWeiI(2) + attempt.State = txmgrtypes.TxAttemptBroadcast + require.NoError(t, txStore.InsertTxAttempt(ctx, &attempt)) + + // Insert tx that will be skipped for too few attempts + _, fromAddress2 := cltest.MustInsertRandomKey(t, ethKeyStore) + mustInsertUnconfirmedTxWithBroadcastAttempts(t, txStore, 0, fromAddress2, 1, blockNum, tenGwei) + + // Return nil response for a tx and a normal response for the other + ethClient.On("BatchCallContext", mock.Anything, mock.MatchedBy(func(b []rpc.BatchElem) bool { + return len(b) == 1 + })).Return(nil).Run(func(args mock.Arguments) { + elems := args.Get(1).([]rpc.BatchElem) + elems[0].Result = nil // Return nil to signal discarded tx + }).Once() + + txs, err := stuckTxDetector.DetectStuckTransactions(ctx, []common.Address{fromAddress1, fromAddress2}, blockNum) + require.NoError(t, err) + require.Len(t, txs, 1) + }) } func TestStuckTxDetector_DetectStuckTransactionsScroll(t *testing.T) { @@ -423,12 +477,12 @@ func mustInsertUnconfirmedEthTxWithBroadcastPurgeAttempt(t *testing.T, txStore t type testAutoPurgeConfig struct { enabled bool - threshold uint32 - minAttempts uint32 + threshold *uint32 + minAttempts *uint32 detectionApiUrl *url.URL } func (t testAutoPurgeConfig) Enabled() bool { return t.enabled } -func (t testAutoPurgeConfig) Threshold() uint32 { return t.threshold } -func (t testAutoPurgeConfig) MinAttempts() uint32 { return t.minAttempts } +func (t testAutoPurgeConfig) Threshold() *uint32 { return t.threshold } +func (t testAutoPurgeConfig) MinAttempts() *uint32 { return t.minAttempts } func (t testAutoPurgeConfig) DetectionApiUrl() *url.URL { return t.detectionApiUrl } diff --git a/core/chains/evm/txmgr/test_helpers.go b/core/chains/evm/txmgr/test_helpers.go index 3b3584a988b..a66727ce133 100644 --- a/core/chains/evm/txmgr/test_helpers.go +++ b/core/chains/evm/txmgr/test_helpers.go @@ -53,6 +53,7 @@ type TestEvmConfig struct { Threshold uint32 MinAttempts uint32 DetectionApiUrl *url.URL + RpcDefaultBatchSize uint32 } func (e *TestEvmConfig) Transactions() evmconfig.Transactions { @@ -65,6 +66,8 @@ func (e *TestEvmConfig) FinalityDepth() uint32 { return 42 } func (e *TestEvmConfig) ChainType() chaintype.ChainType { return "" } +func (e *TestEvmConfig) RPCDefaultBatchSize() uint32 { return e.RpcDefaultBatchSize } + type TestGasEstimatorConfig struct { bumpThreshold uint64 } @@ -73,6 +76,10 @@ func (g *TestGasEstimatorConfig) BlockHistory() evmconfig.BlockHistory { return &TestBlockHistoryConfig{} } +func (g *TestGasEstimatorConfig) FeeHistory() evmconfig.FeeHistory { + return &TestFeeHistoryConfig{} +} + func (g *TestGasEstimatorConfig) EIP1559DynamicFees() bool { return false } func (g *TestGasEstimatorConfig) LimitDefault() uint64 { return 42 } func (g *TestGasEstimatorConfig) BumpPercent() uint16 { return 42 } @@ -89,6 +96,7 @@ func (g *TestGasEstimatorConfig) LimitTransfer() uint64 { return 42 } func (g *TestGasEstimatorConfig) PriceMax() *assets.Wei { return assets.NewWeiI(42) } func (g *TestGasEstimatorConfig) PriceMin() *assets.Wei { return assets.NewWeiI(42) } func (g *TestGasEstimatorConfig) Mode() string { return "FixedPrice" } +func (g *TestGasEstimatorConfig) EstimateLimit() bool { return false } func (g *TestGasEstimatorConfig) LimitJobType() evmconfig.LimitJobType { return &TestLimitJobTypeConfig{} } @@ -120,6 +128,12 @@ func (b *TestBlockHistoryConfig) BlockHistorySize() uint16 { return 42 func (b *TestBlockHistoryConfig) EIP1559FeeCapBufferBlocks() uint16 { return 42 } func (b *TestBlockHistoryConfig) TransactionPercentile() uint16 { return 42 } +type TestFeeHistoryConfig struct { + evmconfig.FeeHistory +} + +func (b *TestFeeHistoryConfig) CacheTimeout() time.Duration { return 0 * time.Second } + type transactionsConfig struct { evmconfig.Transactions e *TestEvmConfig @@ -141,10 +155,9 @@ type autoPurgeConfig struct { func (a *autoPurgeConfig) Enabled() bool { return false } type MockConfig struct { - EvmConfig *TestEvmConfig - RpcDefaultBatchSize uint32 - finalityDepth uint32 - finalityTagEnabled bool + EvmConfig *TestEvmConfig + finalityDepth uint32 + finalityTagEnabled bool } func (c *MockConfig) EVM() evmconfig.EVM { @@ -156,11 +169,10 @@ func (c *MockConfig) ChainType() chaintype.ChainType { return "" } func (c *MockConfig) FinalityDepth() uint32 { return c.finalityDepth } func (c *MockConfig) SetFinalityDepth(fd uint32) { c.finalityDepth = fd } func (c *MockConfig) FinalityTagEnabled() bool { return c.finalityTagEnabled } -func (c *MockConfig) RPCDefaultBatchSize() uint32 { return c.RpcDefaultBatchSize } func MakeTestConfigs(t *testing.T) (*MockConfig, *TestDatabaseConfig, *TestEvmConfig) { db := &TestDatabaseConfig{defaultQueryTimeout: utils.DefaultQueryTimeout} - ec := &TestEvmConfig{BumpThreshold: 42, MaxInFlight: uint32(42), MaxQueued: uint64(0), ReaperInterval: time.Duration(0), ReaperThreshold: time.Duration(0)} + ec := &TestEvmConfig{BumpThreshold: 42, MaxInFlight: uint32(42), MaxQueued: uint64(0), ReaperInterval: time.Duration(0), ReaperThreshold: time.Duration(0), RpcDefaultBatchSize: uint32(250)} config := &MockConfig{EvmConfig: ec} return config, db, ec } diff --git a/core/chains/evm/txmgr/tracker_test.go b/core/chains/evm/txmgr/tracker_test.go index 904a10d48c3..3e5ab6ed2ef 100644 --- a/core/chains/evm/txmgr/tracker_test.go +++ b/core/chains/evm/txmgr/tracker_test.go @@ -2,6 +2,7 @@ package txmgr_test import ( "math/big" + "slices" "testing" "time" @@ -19,8 +20,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/pgtest" ) -const waitTime = 5 * time.Millisecond - func newTestEvmTrackerSetup(t *testing.T) (*txmgr.Tracker, txmgr.TestEvmTxStore, keystore.Eth, []common.Address) { db := pgtest.NewSqlxDB(t) txStore := cltest.NewTestTxStore(t, db) @@ -81,11 +80,12 @@ func TestEvmTracker_AddressTracking(t *testing.T) { require.NoError(t, err) }(tracker) - time.Sleep(waitTime) - addrs := tracker.GetAbandonedAddresses() - require.NotContains(t, addrs, inProgressAddr) - require.NotContains(t, addrs, unstartedAddr) - require.Contains(t, addrs, unconfirmedAddr) + require.Eventually(t, func() bool { + addrs := tracker.GetAbandonedAddresses() + return !slices.Contains(addrs, inProgressAddr) && + !slices.Contains(addrs, unstartedAddr) && + slices.Contains(addrs, unconfirmedAddr) + }, tests.WaitTimeout(t), 100*time.Millisecond) }) /* TODO: finalized tx state https://smartcontract-it.atlassian.net/browse/BCI-2920 @@ -137,12 +137,15 @@ func TestEvmTracker_ExceedingTTL(t *testing.T) { require.NoError(t, err) }(tracker) - time.Sleep(100 * waitTime) - require.NotContains(t, tracker.GetAbandonedAddresses(), addr1, addr2) + require.Eventually(t, func() bool { + addrs := tracker.GetAbandonedAddresses() + return !slices.Contains(addrs, addr1) && !slices.Contains(addrs, addr2) + }, tests.WaitTimeout(t), 100*time.Millisecond) - fatalTxes, err := txStore.GetFatalTransactions(ctx) - require.NoError(t, err) - require.True(t, containsID(fatalTxes, tx1.ID)) - require.True(t, containsID(fatalTxes, tx2.ID)) + require.Eventually(t, func() bool { + fatalTxes, err := txStore.GetFatalTransactions(ctx) + require.NoError(t, err) + return containsID(fatalTxes, tx1.ID) && containsID(fatalTxes, tx2.ID) + }, tests.WaitTimeout(t), 100*time.Millisecond) }) } diff --git a/core/chains/evm/txmgr/txmgr_test.go b/core/chains/evm/txmgr/txmgr_test.go index 40df5616c99..e9437960312 100644 --- a/core/chains/evm/txmgr/txmgr_test.go +++ b/core/chains/evm/txmgr/txmgr_test.go @@ -85,7 +85,8 @@ func makeTestEvmTxm( lggr, lp, keyStore, - estimator) + estimator, + ht) } func TestTxm_SendNativeToken_DoesNotSendToZero(t *testing.T) { @@ -489,14 +490,20 @@ func TestTxm_Lifecycle(t *testing.T) { config, dbConfig, evmConfig := txmgr.MakeTestConfigs(t) config.SetFinalityDepth(uint32(42)) - config.RpcDefaultBatchSize = uint32(4) + evmConfig.RpcDefaultBatchSize = uint32(4) evmConfig.ResendAfterThreshold = 1 * time.Hour evmConfig.ReaperThreshold = 1 * time.Hour evmConfig.ReaperInterval = 1 * time.Hour kst.On("EnabledAddressesForChain", mock.Anything, &cltest.FixtureChainID).Return([]common.Address{}, nil) + head := cltest.Head(42) + finalizedHead := cltest.Head(0) + + ethClient.On("HeadByNumber", mock.Anything, mock.Anything).Return(head, nil).Once() + ethClient.On("HeadByNumber", mock.Anything, mock.Anything).Return(finalizedHead, nil).Once() + keyChangeCh := make(chan struct{}) unsub := cltest.NewAwaiter() kst.On("SubscribeToKeyChanges", mock.Anything).Return(keyChangeCh, unsub.ItHappened) @@ -505,7 +512,6 @@ func TestTxm_Lifecycle(t *testing.T) { txm, err := makeTestEvmTxm(t, db, ethClient, estimator, evmConfig, evmConfig.GasEstimator(), evmConfig.Transactions(), dbConfig, dbConfig.Listener(), kst) require.NoError(t, err) - head := cltest.Head(42) // It should not hang or panic txm.OnNewLongestChain(tests.Context(t), head) @@ -607,8 +613,22 @@ func TestTxm_GetTransactionStatus(t *testing.T) { gcfg := configtest.NewTestGeneralConfig(t) cfg := evmtest.NewChainScopedConfig(t, gcfg) + h99 := &evmtypes.Head{ + Hash: utils.NewHash(), + Number: 99, + } + h99.IsFinalized.Store(true) + head := &evmtypes.Head{ + Hash: utils.NewHash(), + Number: 100, + } + head.Parent.Store(h99) + ethClient := evmtest.NewEthClientMockWithDefaultChain(t) ethClient.On("PendingNonceAt", mock.Anything, mock.Anything).Return(uint64(0), nil).Maybe() + ethClient.On("HeadByNumber", mock.Anything, mock.Anything).Return(head, nil).Once() + ethClient.On("HeadByNumber", mock.Anything, mock.Anything).Return(head.Parent.Load(), nil).Once() + ethClient.On("HeadByNumber", mock.Anything, mock.Anything).Return(head, nil) feeEstimator := gasmocks.NewEvmFeeEstimator(t) feeEstimator.On("Start", mock.Anything).Return(nil).Once() feeEstimator.On("Close", mock.Anything).Return(nil).Once() @@ -617,15 +637,6 @@ func TestTxm_GetTransactionStatus(t *testing.T) { require.NoError(t, err) servicetest.Run(t, txm) - head := &evmtypes.Head{ - Hash: utils.NewHash(), - Number: 100, - Parent: &evmtypes.Head{ - Hash: utils.NewHash(), - Number: 99, - IsFinalized: true, - }, - } txm.OnNewLongestChain(ctx, head) t.Run("returns error if transaction not found", func(t *testing.T) { @@ -671,7 +682,7 @@ func TestTxm_GetTransactionStatus(t *testing.T) { require.Equal(t, commontypes.Unknown, state) }) - t.Run("returns unconfirmed for unconfirmed state", func(t *testing.T) { + t.Run("returns pending for unconfirmed state", func(t *testing.T) { idempotencyKey := uuid.New().String() _, fromAddress := cltest.MustInsertRandomKey(t, ethKeyStore) nonce := evmtypes.Nonce(0) @@ -690,7 +701,7 @@ func TestTxm_GetTransactionStatus(t *testing.T) { require.NoError(t, err) state, err := txm.GetTransactionStatus(ctx, idempotencyKey) require.NoError(t, err) - require.Equal(t, commontypes.Unconfirmed, state) + require.Equal(t, commontypes.Pending, state) }) t.Run("returns unconfirmed for confirmed state", func(t *testing.T) { @@ -715,14 +726,43 @@ func TestTxm_GetTransactionStatus(t *testing.T) { attempt := cltest.NewLegacyEthTxAttempt(t, tx.ID) err = txStore.InsertTxAttempt(ctx, &attempt) require.NoError(t, err) - // Insert receipt for finalized block num - mustInsertEthReceipt(t, txStore, head.Parent.Number, head.ParentHash, attempt.Hash) + // Insert receipt for unfinalized block num + mustInsertEthReceipt(t, txStore, head.Number, head.Hash, attempt.Hash) state, err := txm.GetTransactionStatus(ctx, idempotencyKey) require.NoError(t, err) require.Equal(t, commontypes.Unconfirmed, state) }) - t.Run("returns unconfirmed for confirmed missing receipt state", func(t *testing.T) { + t.Run("returns finalized for finalized state", func(t *testing.T) { + idempotencyKey := uuid.New().String() + _, fromAddress := cltest.MustInsertRandomKey(t, ethKeyStore) + nonce := evmtypes.Nonce(0) + broadcast := time.Now() + tx := &txmgr.Tx{ + Sequence: &nonce, + IdempotencyKey: &idempotencyKey, + FromAddress: fromAddress, + EncodedPayload: []byte{1, 2, 3}, + FeeLimit: feeLimit, + State: txmgrcommon.TxFinalized, + BroadcastAt: &broadcast, + InitialBroadcastAt: &broadcast, + } + err := txStore.InsertTx(ctx, tx) + require.NoError(t, err) + tx, err = txStore.FindTxWithIdempotencyKey(ctx, idempotencyKey, testutils.FixtureChainID) + require.NoError(t, err) + attempt := cltest.NewLegacyEthTxAttempt(t, tx.ID) + err = txStore.InsertTxAttempt(ctx, &attempt) + require.NoError(t, err) + // Insert receipt for finalized block num + mustInsertEthReceipt(t, txStore, head.Parent.Load().Number, head.Parent.Load().Hash, attempt.Hash) + state, err := txm.GetTransactionStatus(ctx, idempotencyKey) + require.NoError(t, err) + require.Equal(t, commontypes.Finalized, state) + }) + + t.Run("returns pending for confirmed missing receipt state", func(t *testing.T) { idempotencyKey := uuid.New().String() _, fromAddress := cltest.MustInsertRandomKey(t, ethKeyStore) nonce := evmtypes.Nonce(0) @@ -741,12 +781,13 @@ func TestTxm_GetTransactionStatus(t *testing.T) { require.NoError(t, err) state, err := txm.GetTransactionStatus(ctx, idempotencyKey) require.NoError(t, err) - require.Equal(t, commontypes.Unconfirmed, state) + require.Equal(t, commontypes.Pending, state) }) t.Run("returns fatal for fatal error state with terminally stuck error", func(t *testing.T) { idempotencyKey := uuid.New().String() _, fromAddress := cltest.MustInsertRandomKey(t, ethKeyStore) + // Test the internal terminally stuck error returns Fatal nonce := evmtypes.Nonce(0) broadcast := time.Now() tx := &txmgr.Tx{ @@ -764,7 +805,30 @@ func TestTxm_GetTransactionStatus(t *testing.T) { require.NoError(t, err) state, err := txm.GetTransactionStatus(ctx, idempotencyKey) require.Equal(t, commontypes.Fatal, state) - require.Error(t, err, evmclient.TerminallyStuckMsg) + require.Error(t, err) + require.Equal(t, evmclient.TerminallyStuckMsg, err.Error()) + + // Test a terminally stuck client error returns Fatal + nonce = evmtypes.Nonce(1) + idempotencyKey = uuid.New().String() + terminallyStuckClientError := "failed to add tx to the pool: not enough step counters to continue the execution" + tx = &txmgr.Tx{ + Sequence: &nonce, + IdempotencyKey: &idempotencyKey, + FromAddress: fromAddress, + EncodedPayload: []byte{1, 2, 3}, + FeeLimit: feeLimit, + State: txmgrcommon.TxFatalError, + Error: null.NewString(terminallyStuckClientError, true), + BroadcastAt: &broadcast, + InitialBroadcastAt: &broadcast, + } + err = txStore.InsertTx(ctx, tx) + require.NoError(t, err) + state, err = txm.GetTransactionStatus(ctx, idempotencyKey) + require.Equal(t, commontypes.Fatal, state) + require.Error(t, err) + require.Equal(t, terminallyStuckClientError, err.Error()) }) t.Run("returns failed for fatal error state with other error", func(t *testing.T) { @@ -1018,6 +1082,12 @@ func mustCreateUnstartedTxFromEvmTxRequest(t testing.TB, txStore txmgr.EvmTxStor return tx } +func mustInsertUnstartedTx(t testing.TB, txStore txmgr.TestEvmTxStore, fromAddress common.Address) { + etx := cltest.NewEthTx(fromAddress) + ctx := tests.Context(t) + require.NoError(t, txStore.InsertTx(ctx, &etx)) +} + func txRequestWithStrategy(strategy txmgrtypes.TxStrategy) func(*txmgr.TxRequest) { return func(tx *txmgr.TxRequest) { tx.Strategy = strategy diff --git a/core/chains/evm/types/head_test.go b/core/chains/evm/types/head_test.go index 97c536a3444..5d887c43c82 100644 --- a/core/chains/evm/types/head_test.go +++ b/core/chains/evm/types/head_test.go @@ -9,6 +9,11 @@ import ( func TestHead_LatestFinalizedHead(t *testing.T) { t.Parallel() + newFinalizedHead := func(num int64) *Head { + result := &Head{Number: num} + result.IsFinalized.Store(true) + return result + } cases := []struct { Name string Head *Head @@ -21,17 +26,17 @@ func TestHead_LatestFinalizedHead(t *testing.T) { }, { Name: "Chain without finalized returns nil", - Head: &Head{Parent: &Head{Parent: &Head{}}}, + Head: sliceToChain(&Head{}, &Head{}, &Head{}), Finalized: nil, }, { Name: "Returns head if it's finalized", - Head: &Head{Number: 2, IsFinalized: true, Parent: &Head{Number: 1, IsFinalized: true}}, + Head: sliceToChain(newFinalizedHead(2), newFinalizedHead(1)), Finalized: &Head{Number: 2}, }, { Name: "Returns first block in chain if it's finalized", - Head: &Head{Number: 3, IsFinalized: false, Parent: &Head{Number: 2, IsFinalized: true, Parent: &Head{Number: 1, IsFinalized: true}}}, + Head: sliceToChain(&Head{Number: 3}, newFinalizedHead(2), newFinalizedHead(1)), Finalized: &Head{Number: 2}, }, } @@ -48,3 +53,43 @@ func TestHead_LatestFinalizedHead(t *testing.T) { }) } } + +func TestHead_ChainString(t *testing.T) { + cases := []struct { + Name string + Chain *Head + ExpectedResult string + }{ + { + Name: "Empty chain", + ExpectedResult: "->nil", + }, + { + Name: "Single head", + Chain: &Head{Number: 1}, + ExpectedResult: "Head{Number: 1, Hash: 0x0000000000000000000000000000000000000000000000000000000000000000, ParentHash: 0x0000000000000000000000000000000000000000000000000000000000000000}->nil", + }, + { + Name: "Multiple heads", + Chain: sliceToChain(&Head{Number: 1}, &Head{Number: 2}, &Head{Number: 3}), + ExpectedResult: "Head{Number: 1, Hash: 0x0000000000000000000000000000000000000000000000000000000000000000, ParentHash: 0x0000000000000000000000000000000000000000000000000000000000000000}->Head{Number: 2, Hash: 0x0000000000000000000000000000000000000000000000000000000000000000, ParentHash: 0x0000000000000000000000000000000000000000000000000000000000000000}->Head{Number: 3, Hash: 0x0000000000000000000000000000000000000000000000000000000000000000, ParentHash: 0x0000000000000000000000000000000000000000000000000000000000000000}->nil", + }, + } + for _, testCase := range cases { + t.Run(testCase.Name, func(t *testing.T) { + assert.Equal(t, testCase.ExpectedResult, testCase.Chain.ChainString()) + }) + } +} + +func sliceToChain(heads ...*Head) *Head { + if len(heads) == 0 { + return nil + } + + for i := 1; i < len(heads); i++ { + heads[i-1].Parent.Store(heads[i]) + } + + return heads[0] +} diff --git a/core/chains/evm/types/models.go b/core/chains/evm/types/models.go index a9e5cd5841b..1da8754cec4 100644 --- a/core/chains/evm/types/models.go +++ b/core/chains/evm/types/models.go @@ -9,6 +9,7 @@ import ( "math/big" "regexp" "strings" + "sync/atomic" "time" "github.com/ethereum/go-ethereum/common" @@ -34,7 +35,7 @@ type Head struct { Number int64 L1BlockNumber sql.NullInt64 ParentHash common.Hash - Parent *Head + Parent atomic.Pointer[Head] EVMChainID *ubig.Big Timestamp time.Time CreatedAt time.Time @@ -44,7 +45,7 @@ type Head struct { StateRoot common.Hash Difficulty *big.Int TotalDifficulty *big.Int - IsFinalized bool + IsFinalized atomic.Bool } var _ commontypes.Head[common.Hash] = &Head{} @@ -74,10 +75,11 @@ func (h *Head) GetParentHash() common.Hash { } func (h *Head) GetParent() commontypes.Head[common.Hash] { - if h.Parent == nil { - return nil + if parent := h.Parent.Load(); parent != nil { + return parent } - return h.Parent + // explicitly return nil to avoid *Head(nil) + return nil } func (h *Head) GetTimestamp() time.Time { @@ -90,10 +92,11 @@ func (h *Head) BlockDifficulty() *big.Int { // EarliestInChain recurses through parents until it finds the earliest one func (h *Head) EarliestInChain() *Head { - for h.Parent != nil { - h = h.Parent + var earliestInChain *Head + for cur := h; cur != nil; cur = cur.Parent.Load() { + earliestInChain = cur } - return h + return earliestInChain } // EarliestHeadInChain recurses through parents until it finds the earliest one @@ -103,14 +106,10 @@ func (h *Head) EarliestHeadInChain() commontypes.Head[common.Hash] { // IsInChain returns true if the given hash matches the hash of a head in the chain func (h *Head) IsInChain(blockHash common.Hash) bool { - for { - if h.Hash == blockHash { + for cur := h; cur != nil; cur = cur.Parent.Load() { + if cur.Hash == blockHash { return true } - if h.Parent == nil { - break - } - h = h.Parent } return false } @@ -127,32 +126,19 @@ func (h *Head) HashAtHeight(blockNum int64) common.Hash { } func (h *Head) HeadAtHeight(blockNum int64) (commontypes.Head[common.Hash], error) { - for h != nil { - if h.Number == blockNum { - return h, nil + for cur := h; cur != nil; cur = cur.Parent.Load() { + if cur.Number == blockNum { + return cur, nil } - - h = h.Parent } return nil, fmt.Errorf("failed to find head at height %d", blockNum) } // ChainLength returns the length of the chain followed by recursively looking up parents func (h *Head) ChainLength() uint32 { - if h == nil { - return 0 - } - l := uint32(1) - - for { - if h.Parent == nil { - break - } + l := uint32(0) + for cur := h; cur != nil; cur = cur.Parent.Load() { l++ - if h == h.Parent { - panic("circular reference detected") - } - h = h.Parent } return l } @@ -160,29 +146,19 @@ func (h *Head) ChainLength() uint32 { // ChainHashes returns an array of block hashes by recursively looking up parents func (h *Head) ChainHashes() []common.Hash { var hashes []common.Hash - - for { - hashes = append(hashes, h.Hash) - if h.Parent == nil { - break - } - if h == h.Parent { - panic("circular reference detected") - } - h = h.Parent + for cur := h; cur != nil; cur = cur.Parent.Load() { + hashes = append(hashes, cur.Hash) } + return hashes } func (h *Head) LatestFinalizedHead() commontypes.Head[common.Hash] { - for h != nil { - if h.IsFinalized { - return h + for cur := h; cur != nil; cur = cur.Parent.Load() { + if cur.IsFinalized.Load() { + return cur } - - h = h.Parent } - return nil } @@ -200,18 +176,13 @@ func (h *Head) IsValid() bool { func (h *Head) ChainString() string { var sb strings.Builder - - for { - sb.WriteString(h.String()) - if h.Parent == nil { - break - } - if h == h.Parent { - panic("circular reference detected") + for cur := h; cur != nil; cur = cur.Parent.Load() { + if sb.Len() > 0 { + sb.WriteString("->") } - sb.WriteString("->") - h = h.Parent + sb.WriteString(cur.String()) } + sb.WriteString("->nil") return sb.String() } @@ -255,11 +226,11 @@ func (h *Head) AsSlice(k int) (heads []*Head) { if k < 1 || h == nil { return } - heads = make([]*Head, 1) - heads[0] = h - for len(heads) < k && h.Parent != nil { - h = h.Parent - heads = append(heads, h) + heads = make([]*Head, 0, k) + for cur := h; cur != nil; cur = cur.Parent.Load() { + if len(heads) < k { + heads = append(heads, cur) + } } return } diff --git a/core/chains/evm/types/models_test.go b/core/chains/evm/types/models_test.go index 6018d68f962..a54f1f58f5b 100644 --- a/core/chains/evm/types/models_test.go +++ b/core/chains/evm/types/models_test.go @@ -116,11 +116,9 @@ func TestEthTxAttempt_GetSignedTx(t *testing.T) { } func TestHead_ChainLength(t *testing.T) { - head := evmtypes.Head{ - Parent: &evmtypes.Head{ - Parent: &evmtypes.Head{}, - }, - } + head := evmtypes.Head{} + head.Parent.Store(&evmtypes.Head{}) + head.Parent.Load().Parent.Store(&evmtypes.Head{}) assert.Equal(t, uint32(3), head.ChainLength()) @@ -134,12 +132,12 @@ func TestHead_AsSlice(t *testing.T) { } h2 := &evmtypes.Head{ Number: 2, - Parent: h1, } + h2.Parent.Store(h1) h3 := &evmtypes.Head{ Number: 3, - Parent: h2, } + h3.Parent.Store(h2) assert.Len(t, (*evmtypes.Head)(nil).AsSlice(0), 0) assert.Len(t, (*evmtypes.Head)(nil).AsSlice(1), 0) @@ -234,36 +232,35 @@ func TestSafeByteSlice_Error(t *testing.T) { } func TestHead_EarliestInChain(t *testing.T) { - head := evmtypes.Head{ + h3 := evmtypes.Head{ Number: 3, - Parent: &evmtypes.Head{ - Number: 2, - Parent: &evmtypes.Head{ - Number: 1, - }, - }, } + h2 := &evmtypes.Head{Number: 2} + h3.Parent.Store(h2) + h1 := &evmtypes.Head{Number: 1} + h2.Parent.Store(h1) - assert.Equal(t, int64(1), head.EarliestInChain().BlockNumber()) + assert.Equal(t, int64(1), h3.EarliestInChain().BlockNumber()) } func TestHead_HeadAtHeight(t *testing.T) { - expectedResult := &evmtypes.Head{ + h1 := &evmtypes.Head{ + Number: 1, + } + h2 := &evmtypes.Head{ Hash: common.BigToHash(big.NewInt(10)), Number: 2, - Parent: &evmtypes.Head{ - Number: 1, - }, } - head := evmtypes.Head{ + h2.Parent.Store(h1) + h3 := evmtypes.Head{ Number: 3, - Parent: expectedResult, } + h3.Parent.Store(h2) - headAtHeight, err := head.HeadAtHeight(2) + headAtHeight, err := h3.HeadAtHeight(2) require.NoError(t, err) - assert.Equal(t, expectedResult, headAtHeight) - _, err = head.HeadAtHeight(0) + assert.Equal(t, h2, headAtHeight) + _, err = h3.HeadAtHeight(0) assert.Error(t, err, "expected to get an error if head is not in the chain") } @@ -271,25 +268,27 @@ func TestHead_IsInChain(t *testing.T) { hash1 := utils.NewHash() hash2 := utils.NewHash() hash3 := utils.NewHash() - - head := evmtypes.Head{ - Number: 3, + h1 := &evmtypes.Head{ + Number: 1, + Hash: hash1, + } + h2 := &evmtypes.Head{ + Hash: hash2, + ParentHash: hash1, + Number: 2, + } + h2.Parent.Store(h1) + h3 := evmtypes.Head{ Hash: hash3, - Parent: &evmtypes.Head{ - Hash: hash2, - Number: 2, - Parent: &evmtypes.Head{ - Hash: hash1, - Number: 1, - }, - }, + Number: 3, } + h3.Parent.Store(h2) - assert.True(t, head.IsInChain(hash1)) - assert.True(t, head.IsInChain(hash2)) - assert.True(t, head.IsInChain(hash3)) - assert.False(t, head.IsInChain(utils.NewHash())) - assert.False(t, head.IsInChain(common.Hash{})) + assert.True(t, h3.IsInChain(hash1)) + assert.True(t, h3.IsInChain(hash2)) + assert.True(t, h3.IsInChain(hash3)) + assert.False(t, h3.IsInChain(utils.NewHash())) + assert.False(t, h3.IsInChain(common.Hash{})) } func TestTxReceipt_ReceiptIndicatesRunLogFulfillment(t *testing.T) { @@ -316,11 +315,11 @@ func TestHead_UnmarshalJSON(t *testing.T) { tests := []struct { name string json string - expected evmtypes.Head + expected *evmtypes.Head }{ {"geth", `{"difficulty":"0xf3a00","extraData":"0xd883010503846765746887676f312e372e318664617277696e","gasLimit":"0xffc001","gasUsed":"0x0","hash":"0x41800b5c3f1717687d85fc9018faac0a6e90b39deaa0b99e7fe4fe796ddeb26a","logsBloom":"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","miner":"0xd1aeb42885a43b72b518182ef893125814811048","mixHash":"0x0f98b15f1a4901a7e9204f3c500a7bd527b3fb2c3340e12176a44b83e414a69e","nonce":"0x0ece08ea8c49dfd9","number":"0x100","parentHash":"0x41941023680923e0fe4d74a34bdac8141f2540e3ae90623718e47d66d1ca4a2d","receiptsRoot":"0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421","sha3Uncles":"0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347","size":"0x218","stateRoot":"0xc7b01007a10da045eacb90385887dd0c38fcb5db7393006bdde24b93873c334b","timestamp":"0x58318da2","totalDifficulty":"0x1f3a00","transactions":[],"transactionsRoot":"0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421","uncles":[]}`, - evmtypes.Head{ + &evmtypes.Head{ Hash: common.HexToHash("0x41800b5c3f1717687d85fc9018faac0a6e90b39deaa0b99e7fe4fe796ddeb26a"), Number: 0x100, ParentHash: common.HexToHash("0x41941023680923e0fe4d74a34bdac8141f2540e3ae90623718e47d66d1ca4a2d"), @@ -332,7 +331,7 @@ func TestHead_UnmarshalJSON(t *testing.T) { }, {"parity", `{"author":"0xd1aeb42885a43b72b518182ef893125814811048","difficulty":"0xf3a00","extraData":"0xd883010503846765746887676f312e372e318664617277696e","gasLimit":"0xffc001","gasUsed":"0x0","hash":"0x41800b5c3f1717687d85fc9018faac0a6e90b39deaa0b99e7fe4fe796ddeb26a","logsBloom":"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","miner":"0xd1aeb42885a43b72b518182ef893125814811048","mixHash":"0x0f98b15f1a4901a7e9204f3c500a7bd527b3fb2c3340e12176a44b83e414a69e","nonce":"0x0ece08ea8c49dfd9","number":"0x100","parentHash":"0x41941023680923e0fe4d74a34bdac8141f2540e3ae90623718e47d66d1ca4a2d","receiptsRoot":"0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421","sealFields":["0xa00f98b15f1a4901a7e9204f3c500a7bd527b3fb2c3340e12176a44b83e414a69e","0x880ece08ea8c49dfd9"],"sha3Uncles":"0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347","size":"0x218","stateRoot":"0xc7b01007a10da045eacb90385887dd0c38fcb5db7393006bdde24b93873c334b","timestamp":"0x58318da2","totalDifficulty":"0x1f3a00","transactions":[],"transactionsRoot":"0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421","uncles":[]}`, - evmtypes.Head{ + &evmtypes.Head{ Hash: common.HexToHash("0x41800b5c3f1717687d85fc9018faac0a6e90b39deaa0b99e7fe4fe796ddeb26a"), Number: 0x100, ParentHash: common.HexToHash("0x41941023680923e0fe4d74a34bdac8141f2540e3ae90623718e47d66d1ca4a2d"), @@ -344,7 +343,7 @@ func TestHead_UnmarshalJSON(t *testing.T) { }, {"arbitrum", `{"number":"0x15156","hash":"0x752dab43f7a2482db39227d46cd307623b26167841e2207e93e7566ab7ab7871","parentHash":"0x923ad1e27c1d43cb2d2fb09e26d2502ca4b4914a2e0599161d279c6c06117d34","mixHash":"0x0000000000000000000000000000000000000000000000000000000000000000","nonce":"0x0000000000000000","sha3Uncles":"0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347","logsBloom":"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","transactionsRoot":"0x71448077f5ce420a8e24db62d4d58e8d8e6ad2c7e76318868e089d41f7e0faf3","stateRoot":"0x0000000000000000000000000000000000000000000000000000000000000000","receiptsRoot":"0x2c292672b8fc9d223647a2569e19721f0757c96a1421753a93e141f8e56cf504","miner":"0x0000000000000000000000000000000000000000","difficulty":"0x0","totalDifficulty":"0x0","extraData":"0x","size":"0x0","gasLimit":"0x11278208","gasUsed":"0x3d1fe9","timestamp":"0x60d0952d","transactions":["0xa1ea93556b93ed3b45cb24f21c8deb584e6a9049c35209242651bf3533c23b98","0xfc6593c45ba92351d17173aa1381e84734d252ab0169887783039212c4a41024","0x85ee9d04fd0ebb5f62191eeb53cb45d9c0945d43eba444c3548de2ac8421682f","0x50d120936473e5b75f6e04829ad4eeca7a1df7d3c5026ebb5d34af936a39b29c"],"uncles":[],"l1BlockNumber":"0x8652f9"}`, - evmtypes.Head{ + &evmtypes.Head{ Hash: common.HexToHash("0x752dab43f7a2482db39227d46cd307623b26167841e2207e93e7566ab7ab7871"), Number: 0x15156, ParentHash: common.HexToHash("0x923ad1e27c1d43cb2d2fb09e26d2502ca4b4914a2e0599161d279c6c06117d34"), @@ -357,7 +356,7 @@ func TestHead_UnmarshalJSON(t *testing.T) { }, {"arbitrum_empty_l1BlockNumber", `{"number":"0x15156","hash":"0x752dab43f7a2482db39227d46cd307623b26167841e2207e93e7566ab7ab7871","parentHash":"0x923ad1e27c1d43cb2d2fb09e26d2502ca4b4914a2e0599161d279c6c06117d34","mixHash":"0x0000000000000000000000000000000000000000000000000000000000000000","nonce":"0x0000000000000000","sha3Uncles":"0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347","logsBloom":"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","transactionsRoot":"0x71448077f5ce420a8e24db62d4d58e8d8e6ad2c7e76318868e089d41f7e0faf3","stateRoot":"0x0000000000000000000000000000000000000000000000000000000000000000","receiptsRoot":"0x2c292672b8fc9d223647a2569e19721f0757c96a1421753a93e141f8e56cf504","miner":"0x0000000000000000000000000000000000000000","difficulty":"0x0","totalDifficulty":"0x0","extraData":"0x","size":"0x0","gasLimit":"0x11278208","gasUsed":"0x3d1fe9","timestamp":"0x60d0952d","transactions":["0xa1ea93556b93ed3b45cb24f21c8deb584e6a9049c35209242651bf3533c23b98","0xfc6593c45ba92351d17173aa1381e84734d252ab0169887783039212c4a41024","0x85ee9d04fd0ebb5f62191eeb53cb45d9c0945d43eba444c3548de2ac8421682f","0x50d120936473e5b75f6e04829ad4eeca7a1df7d3c5026ebb5d34af936a39b29c"],"uncles":[]}`, - evmtypes.Head{ + &evmtypes.Head{ Hash: common.HexToHash("0x752dab43f7a2482db39227d46cd307623b26167841e2207e93e7566ab7ab7871"), Number: 0x15156, ParentHash: common.HexToHash("0x923ad1e27c1d43cb2d2fb09e26d2502ca4b4914a2e0599161d279c6c06117d34"), @@ -370,7 +369,7 @@ func TestHead_UnmarshalJSON(t *testing.T) { }, {"not found", `null`, - evmtypes.Head{}, + &evmtypes.Head{}, }, } @@ -395,11 +394,11 @@ func TestHead_UnmarshalJSON(t *testing.T) { func TestHead_MarshalJSON(t *testing.T) { tests := []struct { name string - head evmtypes.Head + head *evmtypes.Head expected string }{ {"happy", - evmtypes.Head{ + &evmtypes.Head{ Hash: common.HexToHash("0x41800b5c3f1717687d85fc9018faac0a6e90b39deaa0b99e7fe4fe796ddeb26a"), Number: 0x100, ParentHash: common.HexToHash("0x41941023680923e0fe4d74a34bdac8141f2540e3ae90623718e47d66d1ca4a2d"), @@ -411,7 +410,7 @@ func TestHead_MarshalJSON(t *testing.T) { `{"hash":"0x41800b5c3f1717687d85fc9018faac0a6e90b39deaa0b99e7fe4fe796ddeb26a","number":"0x100","parentHash":"0x41941023680923e0fe4d74a34bdac8141f2540e3ae90623718e47d66d1ca4a2d","timestamp":"0x58318da2","receiptsRoot":"0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421","transactionsRoot":"0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421","stateRoot":"0xc7b01007a10da045eacb90385887dd0c38fcb5db7393006bdde24b93873c334b"}`, }, {"empty", - evmtypes.Head{}, + &evmtypes.Head{}, `{"number":"0x0"}`, }, } diff --git a/core/chains/evm/types/types.go b/core/chains/evm/types/types.go index 57a53bce67a..c834ffeb866 100644 --- a/core/chains/evm/types/types.go +++ b/core/chains/evm/types/types.go @@ -63,6 +63,7 @@ type Receipt struct { BlockHash common.Hash `json:"blockHash,omitempty"` BlockNumber *big.Int `json:"blockNumber,omitempty"` TransactionIndex uint `json:"transactionIndex"` + RevertReason []byte `json:"revertReason,omitempty"` // Only provided by Hedera } // FromGethReceipt converts a gethTypes.Receipt to a Receipt @@ -86,6 +87,7 @@ func FromGethReceipt(gr *gethTypes.Receipt) *Receipt { gr.BlockHash, gr.BlockNumber, gr.TransactionIndex, + nil, } } @@ -119,6 +121,7 @@ func (r Receipt) MarshalJSON() ([]byte, error) { BlockHash common.Hash `json:"blockHash,omitempty"` BlockNumber *hexutil.Big `json:"blockNumber,omitempty"` TransactionIndex hexutil.Uint `json:"transactionIndex"` + RevertReason hexutil.Bytes `json:"revertReason,omitempty"` // Only provided by Hedera } var enc Receipt enc.PostState = r.PostState @@ -132,6 +135,7 @@ func (r Receipt) MarshalJSON() ([]byte, error) { enc.BlockHash = r.BlockHash enc.BlockNumber = (*hexutil.Big)(r.BlockNumber) enc.TransactionIndex = hexutil.Uint(r.TransactionIndex) + enc.RevertReason = r.RevertReason return json.Marshal(&enc) } @@ -149,6 +153,7 @@ func (r *Receipt) UnmarshalJSON(input []byte) error { BlockHash *common.Hash `json:"blockHash,omitempty"` BlockNumber *hexutil.Big `json:"blockNumber,omitempty"` TransactionIndex *hexutil.Uint `json:"transactionIndex"` + RevertReason *hexutil.Bytes `json:"revertReason,omitempty"` // Only provided by Hedera } var dec Receipt if err := json.Unmarshal(input, &dec); err != nil { @@ -185,6 +190,9 @@ func (r *Receipt) UnmarshalJSON(input []byte) error { if dec.TransactionIndex != nil { r.TransactionIndex = uint(*dec.TransactionIndex) } + if dec.RevertReason != nil { + r.RevertReason = *dec.RevertReason + } return nil } @@ -225,6 +233,14 @@ func (r *Receipt) GetBlockHash() common.Hash { return r.BlockHash } +func (r *Receipt) GetRevertReason() *string { + if len(r.RevertReason) == 0 { + return nil + } + revertReason := string(r.RevertReason) + return &revertReason +} + type Confirmations int const ( diff --git a/core/chains/evm/utils/big/big.go b/core/chains/evm/utils/big/big.go index 4bb51e27323..5706fda45b6 100644 --- a/core/chains/evm/utils/big/big.go +++ b/core/chains/evm/utils/big/big.go @@ -188,3 +188,8 @@ func (b *Big) Sub(c *Big) *Big { func (b *Big) Mod(c *Big) *Big { return New(bigmath.Mod(b.ToInt(), c.ToInt())) } + +// IsZero returns true if b is zero +func (b *Big) IsZero() bool { + return b.ToInt().Sign() == 0 +} diff --git a/core/chains/legacyevm/chain.go b/core/chains/legacyevm/chain.go index b38cd2c4508..a6fae4ec5b4 100644 --- a/core/chains/legacyevm/chain.go +++ b/core/chains/legacyevm/chain.go @@ -5,6 +5,7 @@ import ( "errors" "fmt" "math/big" + "strconv" gotoml "github.com/pelletier/go-toml/v2" "go.uber.org/multierr" @@ -33,7 +34,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/logger" ) -//go:generate mockery --quiet --name Chain --output ./mocks/ --case=underscore type Chain interface { types.ChainService @@ -64,8 +64,6 @@ type LegacyChains struct { } // LegacyChainContainer is container for EVM chains. -// -//go:generate mockery --quiet --name LegacyChainContainer --output ./mocks/ --case=underscore type LegacyChainContainer interface { Get(id string) (Chain, error) Len() int @@ -223,7 +221,12 @@ func newChain(ctx context.Context, cfg *evmconfig.ChainScoped, nodes []*toml.Nod if !opts.AppConfig.EVMRPCEnabled() { headTracker = headtracker.NullTracker } else if opts.GenHeadTracker == nil { - orm := headtracker.NewORM(*chainID, opts.DS) + var orm headtracker.ORM + if cfg.EVM().HeadTracker().PersistenceEnabled() { + orm = headtracker.NewORM(*chainID, opts.DS) + } else { + orm = headtracker.NewNullORM() + } headSaver = headtracker.NewHeadSaver(l, orm, cfg.EVM(), cfg.EVM().HeadTracker()) headTracker = headtracker.NewHeadTracker(l, client, cfg.EVM(), cfg.EVM().HeadTracker(), headBroadcaster, headSaver, opts.MailMon) } else { @@ -244,13 +247,14 @@ func newChain(ctx context.Context, cfg *evmconfig.ChainScoped, nodes []*toml.Nod KeepFinalizedBlocksDepth: int64(cfg.EVM().LogKeepBlocksDepth()), LogPrunePageSize: int64(cfg.EVM().LogPrunePageSize()), BackupPollerBlockDelay: int64(cfg.EVM().BackupLogPollerBlockDelay()), + ClientErrors: cfg.EVM().NodePool().Errors(), } logPoller = logpoller.NewLogPoller(logpoller.NewObservedORM(chainID, opts.DS, l), client, l, headTracker, lpOpts) } } // note: gas estimator is started as a part of the txm - txm, gasEstimator, err := newEvmTxm(opts.DS, cfg.EVM(), opts.AppConfig.EVMRPCEnabled(), opts.AppConfig.Database(), opts.AppConfig.Database().Listener(), client, l, logPoller, opts) + txm, gasEstimator, err := newEvmTxm(opts.DS, cfg.EVM(), opts.AppConfig.EVMRPCEnabled(), opts.AppConfig.Database(), opts.AppConfig.Database().Listener(), client, l, logPoller, opts, headTracker) if err != nil { return nil, fmt.Errorf("failed to instantiate EvmTxm for chain with ID %s: %w", chainID.String(), err) } @@ -272,6 +276,8 @@ func newChain(ctx context.Context, cfg *evmconfig.ChainScoped, nodes []*toml.Nod var logBroadcaster log.Broadcaster if !opts.AppConfig.EVMRPCEnabled() { logBroadcaster = &log.NullBroadcaster{ErrMsg: fmt.Sprintf("Ethereum is disabled for chain %d", chainID)} + } else if !cfg.EVM().LogBroadcasterEnabled() { + logBroadcaster = &log.NullBroadcaster{ErrMsg: fmt.Sprintf("LogBroadcaster disabled for chain %d", chainID)} } else if opts.GenLogBroadcaster == nil { logORM := log.NewORM(opts.DS, *chainID) logBroadcaster = log.NewBroadcaster(logORM, client, cfg.EVM(), l, highestSeenHead, opts.MailMon) @@ -393,6 +399,19 @@ func (c *chain) SendTx(ctx context.Context, from, to string, amount *big.Int, ba return c.Transact(ctx, from, to, amount, balanceCheck) } +func (c *chain) LatestHead(_ context.Context) (types.Head, error) { + latestChain := c.headTracker.LatestChain() + if latestChain == nil { + return types.Head{}, errors.New("latest chain not found") + } + + return types.Head{ + Height: strconv.FormatInt(latestChain.BlockNumber(), 10), + Hash: latestChain.Hash.Bytes(), + Timestamp: uint64(latestChain.Timestamp.Unix()), + }, nil +} + func (c *chain) GetChainStatus(ctx context.Context) (types.ChainStatus, error) { toml, err := c.cfg.EVM().TOMLString() if err != nil { diff --git a/core/chains/legacyevm/evm_txm.go b/core/chains/legacyevm/evm_txm.go index cecfd4ffafe..ab116749665 100644 --- a/core/chains/legacyevm/evm_txm.go +++ b/core/chains/legacyevm/evm_txm.go @@ -7,6 +7,7 @@ import ( evmclient "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" evmconfig "github.com/smartcontractkit/chainlink/v2/core/chains/evm/config" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/gas" + httypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/headtracker/types" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/txmgr" "github.com/smartcontractkit/chainlink/v2/core/logger" @@ -22,6 +23,7 @@ func newEvmTxm( lggr logger.Logger, logPoller logpoller.LogPoller, opts ChainRelayExtenderConfig, + headTracker httypes.HeadTracker, ) (txm txmgr.TxManager, estimator gas.EvmFeeEstimator, err error, @@ -63,7 +65,8 @@ func newEvmTxm( lggr, logPoller, opts.KeyStore, - estimator) + estimator, + headTracker) } else { txm = opts.GenTxManager(chainID) } diff --git a/core/chains/legacyevm/mocks/chain.go b/core/chains/legacyevm/mocks/chain.go index 93f7c40fe0c..3c6bd97d7a9 100644 --- a/core/chains/legacyevm/mocks/chain.go +++ b/core/chains/legacyevm/mocks/chain.go @@ -38,6 +38,14 @@ type Chain struct { mock.Mock } +type Chain_Expecter struct { + mock *mock.Mock +} + +func (_m *Chain) EXPECT() *Chain_Expecter { + return &Chain_Expecter{mock: &_m.Mock} +} + // BalanceMonitor provides a mock function with given fields: func (_m *Chain) BalanceMonitor() monitor.BalanceMonitor { ret := _m.Called() @@ -58,6 +66,33 @@ func (_m *Chain) BalanceMonitor() monitor.BalanceMonitor { return r0 } +// Chain_BalanceMonitor_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BalanceMonitor' +type Chain_BalanceMonitor_Call struct { + *mock.Call +} + +// BalanceMonitor is a helper method to define mock.On call +func (_e *Chain_Expecter) BalanceMonitor() *Chain_BalanceMonitor_Call { + return &Chain_BalanceMonitor_Call{Call: _e.mock.On("BalanceMonitor")} +} + +func (_c *Chain_BalanceMonitor_Call) Run(run func()) *Chain_BalanceMonitor_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Chain_BalanceMonitor_Call) Return(_a0 monitor.BalanceMonitor) *Chain_BalanceMonitor_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Chain_BalanceMonitor_Call) RunAndReturn(run func() monitor.BalanceMonitor) *Chain_BalanceMonitor_Call { + _c.Call.Return(run) + return _c +} + // Client provides a mock function with given fields: func (_m *Chain) Client() client.Client { ret := _m.Called() @@ -78,6 +113,33 @@ func (_m *Chain) Client() client.Client { return r0 } +// Chain_Client_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Client' +type Chain_Client_Call struct { + *mock.Call +} + +// Client is a helper method to define mock.On call +func (_e *Chain_Expecter) Client() *Chain_Client_Call { + return &Chain_Client_Call{Call: _e.mock.On("Client")} +} + +func (_c *Chain_Client_Call) Run(run func()) *Chain_Client_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Chain_Client_Call) Return(_a0 client.Client) *Chain_Client_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Chain_Client_Call) RunAndReturn(run func() client.Client) *Chain_Client_Call { + _c.Call.Return(run) + return _c +} + // Close provides a mock function with given fields: func (_m *Chain) Close() error { ret := _m.Called() @@ -96,6 +158,33 @@ func (_m *Chain) Close() error { return r0 } +// Chain_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close' +type Chain_Close_Call struct { + *mock.Call +} + +// Close is a helper method to define mock.On call +func (_e *Chain_Expecter) Close() *Chain_Close_Call { + return &Chain_Close_Call{Call: _e.mock.On("Close")} +} + +func (_c *Chain_Close_Call) Run(run func()) *Chain_Close_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Chain_Close_Call) Return(_a0 error) *Chain_Close_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Chain_Close_Call) RunAndReturn(run func() error) *Chain_Close_Call { + _c.Call.Return(run) + return _c +} + // Config provides a mock function with given fields: func (_m *Chain) Config() config.ChainScopedConfig { ret := _m.Called() @@ -116,6 +205,33 @@ func (_m *Chain) Config() config.ChainScopedConfig { return r0 } +// Chain_Config_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Config' +type Chain_Config_Call struct { + *mock.Call +} + +// Config is a helper method to define mock.On call +func (_e *Chain_Expecter) Config() *Chain_Config_Call { + return &Chain_Config_Call{Call: _e.mock.On("Config")} +} + +func (_c *Chain_Config_Call) Run(run func()) *Chain_Config_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Chain_Config_Call) Return(_a0 config.ChainScopedConfig) *Chain_Config_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Chain_Config_Call) RunAndReturn(run func() config.ChainScopedConfig) *Chain_Config_Call { + _c.Call.Return(run) + return _c +} + // GasEstimator provides a mock function with given fields: func (_m *Chain) GasEstimator() gas.EvmFeeEstimator { ret := _m.Called() @@ -136,6 +252,33 @@ func (_m *Chain) GasEstimator() gas.EvmFeeEstimator { return r0 } +// Chain_GasEstimator_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GasEstimator' +type Chain_GasEstimator_Call struct { + *mock.Call +} + +// GasEstimator is a helper method to define mock.On call +func (_e *Chain_Expecter) GasEstimator() *Chain_GasEstimator_Call { + return &Chain_GasEstimator_Call{Call: _e.mock.On("GasEstimator")} +} + +func (_c *Chain_GasEstimator_Call) Run(run func()) *Chain_GasEstimator_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Chain_GasEstimator_Call) Return(_a0 gas.EvmFeeEstimator) *Chain_GasEstimator_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Chain_GasEstimator_Call) RunAndReturn(run func() gas.EvmFeeEstimator) *Chain_GasEstimator_Call { + _c.Call.Return(run) + return _c +} + // GetChainStatus provides a mock function with given fields: ctx func (_m *Chain) GetChainStatus(ctx context.Context) (types.ChainStatus, error) { ret := _m.Called(ctx) @@ -164,6 +307,34 @@ func (_m *Chain) GetChainStatus(ctx context.Context) (types.ChainStatus, error) return r0, r1 } +// Chain_GetChainStatus_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetChainStatus' +type Chain_GetChainStatus_Call struct { + *mock.Call +} + +// GetChainStatus is a helper method to define mock.On call +// - ctx context.Context +func (_e *Chain_Expecter) GetChainStatus(ctx interface{}) *Chain_GetChainStatus_Call { + return &Chain_GetChainStatus_Call{Call: _e.mock.On("GetChainStatus", ctx)} +} + +func (_c *Chain_GetChainStatus_Call) Run(run func(ctx context.Context)) *Chain_GetChainStatus_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *Chain_GetChainStatus_Call) Return(_a0 types.ChainStatus, _a1 error) *Chain_GetChainStatus_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Chain_GetChainStatus_Call) RunAndReturn(run func(context.Context) (types.ChainStatus, error)) *Chain_GetChainStatus_Call { + _c.Call.Return(run) + return _c +} + // HeadBroadcaster provides a mock function with given fields: func (_m *Chain) HeadBroadcaster() headtracker.HeadBroadcaster[*evmtypes.Head, common.Hash] { ret := _m.Called() @@ -184,6 +355,33 @@ func (_m *Chain) HeadBroadcaster() headtracker.HeadBroadcaster[*evmtypes.Head, c return r0 } +// Chain_HeadBroadcaster_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HeadBroadcaster' +type Chain_HeadBroadcaster_Call struct { + *mock.Call +} + +// HeadBroadcaster is a helper method to define mock.On call +func (_e *Chain_Expecter) HeadBroadcaster() *Chain_HeadBroadcaster_Call { + return &Chain_HeadBroadcaster_Call{Call: _e.mock.On("HeadBroadcaster")} +} + +func (_c *Chain_HeadBroadcaster_Call) Run(run func()) *Chain_HeadBroadcaster_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Chain_HeadBroadcaster_Call) Return(_a0 headtracker.HeadBroadcaster[*evmtypes.Head, common.Hash]) *Chain_HeadBroadcaster_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Chain_HeadBroadcaster_Call) RunAndReturn(run func() headtracker.HeadBroadcaster[*evmtypes.Head, common.Hash]) *Chain_HeadBroadcaster_Call { + _c.Call.Return(run) + return _c +} + // HeadTracker provides a mock function with given fields: func (_m *Chain) HeadTracker() headtracker.HeadTracker[*evmtypes.Head, common.Hash] { ret := _m.Called() @@ -204,6 +402,33 @@ func (_m *Chain) HeadTracker() headtracker.HeadTracker[*evmtypes.Head, common.Ha return r0 } +// Chain_HeadTracker_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HeadTracker' +type Chain_HeadTracker_Call struct { + *mock.Call +} + +// HeadTracker is a helper method to define mock.On call +func (_e *Chain_Expecter) HeadTracker() *Chain_HeadTracker_Call { + return &Chain_HeadTracker_Call{Call: _e.mock.On("HeadTracker")} +} + +func (_c *Chain_HeadTracker_Call) Run(run func()) *Chain_HeadTracker_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Chain_HeadTracker_Call) Return(_a0 headtracker.HeadTracker[*evmtypes.Head, common.Hash]) *Chain_HeadTracker_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Chain_HeadTracker_Call) RunAndReturn(run func() headtracker.HeadTracker[*evmtypes.Head, common.Hash]) *Chain_HeadTracker_Call { + _c.Call.Return(run) + return _c +} + // HealthReport provides a mock function with given fields: func (_m *Chain) HealthReport() map[string]error { ret := _m.Called() @@ -224,6 +449,33 @@ func (_m *Chain) HealthReport() map[string]error { return r0 } +// Chain_HealthReport_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HealthReport' +type Chain_HealthReport_Call struct { + *mock.Call +} + +// HealthReport is a helper method to define mock.On call +func (_e *Chain_Expecter) HealthReport() *Chain_HealthReport_Call { + return &Chain_HealthReport_Call{Call: _e.mock.On("HealthReport")} +} + +func (_c *Chain_HealthReport_Call) Run(run func()) *Chain_HealthReport_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Chain_HealthReport_Call) Return(_a0 map[string]error) *Chain_HealthReport_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Chain_HealthReport_Call) RunAndReturn(run func() map[string]error) *Chain_HealthReport_Call { + _c.Call.Return(run) + return _c +} + // ID provides a mock function with given fields: func (_m *Chain) ID() *big.Int { ret := _m.Called() @@ -244,6 +496,89 @@ func (_m *Chain) ID() *big.Int { return r0 } +// Chain_ID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ID' +type Chain_ID_Call struct { + *mock.Call +} + +// ID is a helper method to define mock.On call +func (_e *Chain_Expecter) ID() *Chain_ID_Call { + return &Chain_ID_Call{Call: _e.mock.On("ID")} +} + +func (_c *Chain_ID_Call) Run(run func()) *Chain_ID_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Chain_ID_Call) Return(_a0 *big.Int) *Chain_ID_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Chain_ID_Call) RunAndReturn(run func() *big.Int) *Chain_ID_Call { + _c.Call.Return(run) + return _c +} + +// LatestHead provides a mock function with given fields: ctx +func (_m *Chain) LatestHead(ctx context.Context) (types.Head, error) { + ret := _m.Called(ctx) + + if len(ret) == 0 { + panic("no return value specified for LatestHead") + } + + var r0 types.Head + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (types.Head, error)); ok { + return rf(ctx) + } + if rf, ok := ret.Get(0).(func(context.Context) types.Head); ok { + r0 = rf(ctx) + } else { + r0 = ret.Get(0).(types.Head) + } + + if rf, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = rf(ctx) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// Chain_LatestHead_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LatestHead' +type Chain_LatestHead_Call struct { + *mock.Call +} + +// LatestHead is a helper method to define mock.On call +// - ctx context.Context +func (_e *Chain_Expecter) LatestHead(ctx interface{}) *Chain_LatestHead_Call { + return &Chain_LatestHead_Call{Call: _e.mock.On("LatestHead", ctx)} +} + +func (_c *Chain_LatestHead_Call) Run(run func(ctx context.Context)) *Chain_LatestHead_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *Chain_LatestHead_Call) Return(_a0 types.Head, _a1 error) *Chain_LatestHead_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Chain_LatestHead_Call) RunAndReturn(run func(context.Context) (types.Head, error)) *Chain_LatestHead_Call { + _c.Call.Return(run) + return _c +} + // ListNodeStatuses provides a mock function with given fields: ctx, pageSize, pageToken func (_m *Chain) ListNodeStatuses(ctx context.Context, pageSize int32, pageToken string) ([]types.NodeStatus, string, int, error) { ret := _m.Called(ctx, pageSize, pageToken) @@ -288,6 +623,36 @@ func (_m *Chain) ListNodeStatuses(ctx context.Context, pageSize int32, pageToken return r0, r1, r2, r3 } +// Chain_ListNodeStatuses_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListNodeStatuses' +type Chain_ListNodeStatuses_Call struct { + *mock.Call +} + +// ListNodeStatuses is a helper method to define mock.On call +// - ctx context.Context +// - pageSize int32 +// - pageToken string +func (_e *Chain_Expecter) ListNodeStatuses(ctx interface{}, pageSize interface{}, pageToken interface{}) *Chain_ListNodeStatuses_Call { + return &Chain_ListNodeStatuses_Call{Call: _e.mock.On("ListNodeStatuses", ctx, pageSize, pageToken)} +} + +func (_c *Chain_ListNodeStatuses_Call) Run(run func(ctx context.Context, pageSize int32, pageToken string)) *Chain_ListNodeStatuses_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(int32), args[2].(string)) + }) + return _c +} + +func (_c *Chain_ListNodeStatuses_Call) Return(stats []types.NodeStatus, nextPageToken string, total int, err error) *Chain_ListNodeStatuses_Call { + _c.Call.Return(stats, nextPageToken, total, err) + return _c +} + +func (_c *Chain_ListNodeStatuses_Call) RunAndReturn(run func(context.Context, int32, string) ([]types.NodeStatus, string, int, error)) *Chain_ListNodeStatuses_Call { + _c.Call.Return(run) + return _c +} + // LogBroadcaster provides a mock function with given fields: func (_m *Chain) LogBroadcaster() log.Broadcaster { ret := _m.Called() @@ -308,6 +673,33 @@ func (_m *Chain) LogBroadcaster() log.Broadcaster { return r0 } +// Chain_LogBroadcaster_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LogBroadcaster' +type Chain_LogBroadcaster_Call struct { + *mock.Call +} + +// LogBroadcaster is a helper method to define mock.On call +func (_e *Chain_Expecter) LogBroadcaster() *Chain_LogBroadcaster_Call { + return &Chain_LogBroadcaster_Call{Call: _e.mock.On("LogBroadcaster")} +} + +func (_c *Chain_LogBroadcaster_Call) Run(run func()) *Chain_LogBroadcaster_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Chain_LogBroadcaster_Call) Return(_a0 log.Broadcaster) *Chain_LogBroadcaster_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Chain_LogBroadcaster_Call) RunAndReturn(run func() log.Broadcaster) *Chain_LogBroadcaster_Call { + _c.Call.Return(run) + return _c +} + // LogPoller provides a mock function with given fields: func (_m *Chain) LogPoller() logpoller.LogPoller { ret := _m.Called() @@ -328,6 +720,33 @@ func (_m *Chain) LogPoller() logpoller.LogPoller { return r0 } +// Chain_LogPoller_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LogPoller' +type Chain_LogPoller_Call struct { + *mock.Call +} + +// LogPoller is a helper method to define mock.On call +func (_e *Chain_Expecter) LogPoller() *Chain_LogPoller_Call { + return &Chain_LogPoller_Call{Call: _e.mock.On("LogPoller")} +} + +func (_c *Chain_LogPoller_Call) Run(run func()) *Chain_LogPoller_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Chain_LogPoller_Call) Return(_a0 logpoller.LogPoller) *Chain_LogPoller_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Chain_LogPoller_Call) RunAndReturn(run func() logpoller.LogPoller) *Chain_LogPoller_Call { + _c.Call.Return(run) + return _c +} + // Logger provides a mock function with given fields: func (_m *Chain) Logger() logger.Logger { ret := _m.Called() @@ -348,6 +767,33 @@ func (_m *Chain) Logger() logger.Logger { return r0 } +// Chain_Logger_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Logger' +type Chain_Logger_Call struct { + *mock.Call +} + +// Logger is a helper method to define mock.On call +func (_e *Chain_Expecter) Logger() *Chain_Logger_Call { + return &Chain_Logger_Call{Call: _e.mock.On("Logger")} +} + +func (_c *Chain_Logger_Call) Run(run func()) *Chain_Logger_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Chain_Logger_Call) Return(_a0 logger.Logger) *Chain_Logger_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Chain_Logger_Call) RunAndReturn(run func() logger.Logger) *Chain_Logger_Call { + _c.Call.Return(run) + return _c +} + // Name provides a mock function with given fields: func (_m *Chain) Name() string { ret := _m.Called() @@ -366,6 +812,33 @@ func (_m *Chain) Name() string { return r0 } +// Chain_Name_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Name' +type Chain_Name_Call struct { + *mock.Call +} + +// Name is a helper method to define mock.On call +func (_e *Chain_Expecter) Name() *Chain_Name_Call { + return &Chain_Name_Call{Call: _e.mock.On("Name")} +} + +func (_c *Chain_Name_Call) Run(run func()) *Chain_Name_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Chain_Name_Call) Return(_a0 string) *Chain_Name_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Chain_Name_Call) RunAndReturn(run func() string) *Chain_Name_Call { + _c.Call.Return(run) + return _c +} + // Ready provides a mock function with given fields: func (_m *Chain) Ready() error { ret := _m.Called() @@ -384,6 +857,33 @@ func (_m *Chain) Ready() error { return r0 } +// Chain_Ready_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Ready' +type Chain_Ready_Call struct { + *mock.Call +} + +// Ready is a helper method to define mock.On call +func (_e *Chain_Expecter) Ready() *Chain_Ready_Call { + return &Chain_Ready_Call{Call: _e.mock.On("Ready")} +} + +func (_c *Chain_Ready_Call) Run(run func()) *Chain_Ready_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Chain_Ready_Call) Return(_a0 error) *Chain_Ready_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Chain_Ready_Call) RunAndReturn(run func() error) *Chain_Ready_Call { + _c.Call.Return(run) + return _c +} + // Start provides a mock function with given fields: _a0 func (_m *Chain) Start(_a0 context.Context) error { ret := _m.Called(_a0) @@ -402,6 +902,34 @@ func (_m *Chain) Start(_a0 context.Context) error { return r0 } +// Chain_Start_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Start' +type Chain_Start_Call struct { + *mock.Call +} + +// Start is a helper method to define mock.On call +// - _a0 context.Context +func (_e *Chain_Expecter) Start(_a0 interface{}) *Chain_Start_Call { + return &Chain_Start_Call{Call: _e.mock.On("Start", _a0)} +} + +func (_c *Chain_Start_Call) Run(run func(_a0 context.Context)) *Chain_Start_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *Chain_Start_Call) Return(_a0 error) *Chain_Start_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Chain_Start_Call) RunAndReturn(run func(context.Context) error) *Chain_Start_Call { + _c.Call.Return(run) + return _c +} + // Transact provides a mock function with given fields: ctx, from, to, amount, balanceCheck func (_m *Chain) Transact(ctx context.Context, from string, to string, amount *big.Int, balanceCheck bool) error { ret := _m.Called(ctx, from, to, amount, balanceCheck) @@ -420,6 +948,38 @@ func (_m *Chain) Transact(ctx context.Context, from string, to string, amount *b return r0 } +// Chain_Transact_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Transact' +type Chain_Transact_Call struct { + *mock.Call +} + +// Transact is a helper method to define mock.On call +// - ctx context.Context +// - from string +// - to string +// - amount *big.Int +// - balanceCheck bool +func (_e *Chain_Expecter) Transact(ctx interface{}, from interface{}, to interface{}, amount interface{}, balanceCheck interface{}) *Chain_Transact_Call { + return &Chain_Transact_Call{Call: _e.mock.On("Transact", ctx, from, to, amount, balanceCheck)} +} + +func (_c *Chain_Transact_Call) Run(run func(ctx context.Context, from string, to string, amount *big.Int, balanceCheck bool)) *Chain_Transact_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string), args[3].(*big.Int), args[4].(bool)) + }) + return _c +} + +func (_c *Chain_Transact_Call) Return(_a0 error) *Chain_Transact_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Chain_Transact_Call) RunAndReturn(run func(context.Context, string, string, *big.Int, bool) error) *Chain_Transact_Call { + _c.Call.Return(run) + return _c +} + // TxManager provides a mock function with given fields: func (_m *Chain) TxManager() txmgr.TxManager[*big.Int, *evmtypes.Head, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee] { ret := _m.Called() @@ -440,6 +1000,33 @@ func (_m *Chain) TxManager() txmgr.TxManager[*big.Int, *evmtypes.Head, common.Ad return r0 } +// Chain_TxManager_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TxManager' +type Chain_TxManager_Call struct { + *mock.Call +} + +// TxManager is a helper method to define mock.On call +func (_e *Chain_Expecter) TxManager() *Chain_TxManager_Call { + return &Chain_TxManager_Call{Call: _e.mock.On("TxManager")} +} + +func (_c *Chain_TxManager_Call) Run(run func()) *Chain_TxManager_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Chain_TxManager_Call) Return(_a0 txmgr.TxManager[*big.Int, *evmtypes.Head, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee]) *Chain_TxManager_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Chain_TxManager_Call) RunAndReturn(run func() txmgr.TxManager[*big.Int, *evmtypes.Head, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee]) *Chain_TxManager_Call { + _c.Call.Return(run) + return _c +} + // NewChain creates a new instance of Chain. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewChain(t interface { diff --git a/core/chains/legacyevm/mocks/legacy_chain_container.go b/core/chains/legacyevm/mocks/legacy_chain_container.go index ff73a4e1393..4f9716e0a98 100644 --- a/core/chains/legacyevm/mocks/legacy_chain_container.go +++ b/core/chains/legacyevm/mocks/legacy_chain_container.go @@ -14,6 +14,14 @@ type LegacyChainContainer struct { mock.Mock } +type LegacyChainContainer_Expecter struct { + mock *mock.Mock +} + +func (_m *LegacyChainContainer) EXPECT() *LegacyChainContainer_Expecter { + return &LegacyChainContainer_Expecter{mock: &_m.Mock} +} + // ChainNodeConfigs provides a mock function with given fields: func (_m *LegacyChainContainer) ChainNodeConfigs() types.Configs { ret := _m.Called() @@ -34,6 +42,33 @@ func (_m *LegacyChainContainer) ChainNodeConfigs() types.Configs { return r0 } +// LegacyChainContainer_ChainNodeConfigs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ChainNodeConfigs' +type LegacyChainContainer_ChainNodeConfigs_Call struct { + *mock.Call +} + +// ChainNodeConfigs is a helper method to define mock.On call +func (_e *LegacyChainContainer_Expecter) ChainNodeConfigs() *LegacyChainContainer_ChainNodeConfigs_Call { + return &LegacyChainContainer_ChainNodeConfigs_Call{Call: _e.mock.On("ChainNodeConfigs")} +} + +func (_c *LegacyChainContainer_ChainNodeConfigs_Call) Run(run func()) *LegacyChainContainer_ChainNodeConfigs_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *LegacyChainContainer_ChainNodeConfigs_Call) Return(_a0 types.Configs) *LegacyChainContainer_ChainNodeConfigs_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *LegacyChainContainer_ChainNodeConfigs_Call) RunAndReturn(run func() types.Configs) *LegacyChainContainer_ChainNodeConfigs_Call { + _c.Call.Return(run) + return _c +} + // Get provides a mock function with given fields: id func (_m *LegacyChainContainer) Get(id string) (legacyevm.Chain, error) { ret := _m.Called(id) @@ -64,6 +99,34 @@ func (_m *LegacyChainContainer) Get(id string) (legacyevm.Chain, error) { return r0, r1 } +// LegacyChainContainer_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' +type LegacyChainContainer_Get_Call struct { + *mock.Call +} + +// Get is a helper method to define mock.On call +// - id string +func (_e *LegacyChainContainer_Expecter) Get(id interface{}) *LegacyChainContainer_Get_Call { + return &LegacyChainContainer_Get_Call{Call: _e.mock.On("Get", id)} +} + +func (_c *LegacyChainContainer_Get_Call) Run(run func(id string)) *LegacyChainContainer_Get_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *LegacyChainContainer_Get_Call) Return(_a0 legacyevm.Chain, _a1 error) *LegacyChainContainer_Get_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *LegacyChainContainer_Get_Call) RunAndReturn(run func(string) (legacyevm.Chain, error)) *LegacyChainContainer_Get_Call { + _c.Call.Return(run) + return _c +} + // Len provides a mock function with given fields: func (_m *LegacyChainContainer) Len() int { ret := _m.Called() @@ -82,6 +145,33 @@ func (_m *LegacyChainContainer) Len() int { return r0 } +// LegacyChainContainer_Len_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Len' +type LegacyChainContainer_Len_Call struct { + *mock.Call +} + +// Len is a helper method to define mock.On call +func (_e *LegacyChainContainer_Expecter) Len() *LegacyChainContainer_Len_Call { + return &LegacyChainContainer_Len_Call{Call: _e.mock.On("Len")} +} + +func (_c *LegacyChainContainer_Len_Call) Run(run func()) *LegacyChainContainer_Len_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *LegacyChainContainer_Len_Call) Return(_a0 int) *LegacyChainContainer_Len_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *LegacyChainContainer_Len_Call) RunAndReturn(run func() int) *LegacyChainContainer_Len_Call { + _c.Call.Return(run) + return _c +} + // List provides a mock function with given fields: ids func (_m *LegacyChainContainer) List(ids ...string) ([]legacyevm.Chain, error) { _va := make([]interface{}, len(ids)) @@ -118,6 +208,41 @@ func (_m *LegacyChainContainer) List(ids ...string) ([]legacyevm.Chain, error) { return r0, r1 } +// LegacyChainContainer_List_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'List' +type LegacyChainContainer_List_Call struct { + *mock.Call +} + +// List is a helper method to define mock.On call +// - ids ...string +func (_e *LegacyChainContainer_Expecter) List(ids ...interface{}) *LegacyChainContainer_List_Call { + return &LegacyChainContainer_List_Call{Call: _e.mock.On("List", + append([]interface{}{}, ids...)...)} +} + +func (_c *LegacyChainContainer_List_Call) Run(run func(ids ...string)) *LegacyChainContainer_List_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]string, len(args)-0) + for i, a := range args[0:] { + if a != nil { + variadicArgs[i] = a.(string) + } + } + run(variadicArgs...) + }) + return _c +} + +func (_c *LegacyChainContainer_List_Call) Return(_a0 []legacyevm.Chain, _a1 error) *LegacyChainContainer_List_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *LegacyChainContainer_List_Call) RunAndReturn(run func(...string) ([]legacyevm.Chain, error)) *LegacyChainContainer_List_Call { + _c.Call.Return(run) + return _c +} + // Slice provides a mock function with given fields: func (_m *LegacyChainContainer) Slice() []legacyevm.Chain { ret := _m.Called() @@ -138,6 +263,33 @@ func (_m *LegacyChainContainer) Slice() []legacyevm.Chain { return r0 } +// LegacyChainContainer_Slice_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Slice' +type LegacyChainContainer_Slice_Call struct { + *mock.Call +} + +// Slice is a helper method to define mock.On call +func (_e *LegacyChainContainer_Expecter) Slice() *LegacyChainContainer_Slice_Call { + return &LegacyChainContainer_Slice_Call{Call: _e.mock.On("Slice")} +} + +func (_c *LegacyChainContainer_Slice_Call) Run(run func()) *LegacyChainContainer_Slice_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *LegacyChainContainer_Slice_Call) Return(_a0 []legacyevm.Chain) *LegacyChainContainer_Slice_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *LegacyChainContainer_Slice_Call) RunAndReturn(run func() []legacyevm.Chain) *LegacyChainContainer_Slice_Call { + _c.Call.Return(run) + return _c +} + // NewLegacyChainContainer creates a new instance of LegacyChainContainer. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewLegacyChainContainer(t interface { diff --git a/core/cmd/app.go b/core/cmd/app.go index 1ccb3da9a01..53c96980de4 100644 --- a/core/cmd/app.go +++ b/core/cmd/app.go @@ -168,6 +168,10 @@ func NewApp(s *Shell) *cli.App { Usage: "Prints a health report", Action: s.Health, Flags: []cli.Flag{ + cli.BoolFlag{ + Name: "failing, f", + Usage: "filter for failing services", + }, cli.BoolFlag{ Name: "json, j", Usage: "json output", diff --git a/core/cmd/forwarders_commands_test.go b/core/cmd/forwarders_commands_test.go index b5a96a73aa8..dfd8272d8a4 100644 --- a/core/cmd/forwarders_commands_test.go +++ b/core/cmd/forwarders_commands_test.go @@ -22,7 +22,7 @@ func TestEVMForwarderPresenter_RenderTable(t *testing.T) { t.Parallel() var ( - id = "1" + id = "ID:" address = utils.RandomAddress() evmChainID = big.NewI(4) createdAt = time.Now() diff --git a/core/cmd/mocks/prompter.go b/core/cmd/mocks/prompter.go index c2dff9fa61f..f13deacdbc9 100644 --- a/core/cmd/mocks/prompter.go +++ b/core/cmd/mocks/prompter.go @@ -9,6 +9,14 @@ type Prompter struct { mock.Mock } +type Prompter_Expecter struct { + mock *mock.Mock +} + +func (_m *Prompter) EXPECT() *Prompter_Expecter { + return &Prompter_Expecter{mock: &_m.Mock} +} + // IsTerminal provides a mock function with given fields: func (_m *Prompter) IsTerminal() bool { ret := _m.Called() @@ -27,6 +35,33 @@ func (_m *Prompter) IsTerminal() bool { return r0 } +// Prompter_IsTerminal_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsTerminal' +type Prompter_IsTerminal_Call struct { + *mock.Call +} + +// IsTerminal is a helper method to define mock.On call +func (_e *Prompter_Expecter) IsTerminal() *Prompter_IsTerminal_Call { + return &Prompter_IsTerminal_Call{Call: _e.mock.On("IsTerminal")} +} + +func (_c *Prompter_IsTerminal_Call) Run(run func()) *Prompter_IsTerminal_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Prompter_IsTerminal_Call) Return(_a0 bool) *Prompter_IsTerminal_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Prompter_IsTerminal_Call) RunAndReturn(run func() bool) *Prompter_IsTerminal_Call { + _c.Call.Return(run) + return _c +} + // PasswordPrompt provides a mock function with given fields: _a0 func (_m *Prompter) PasswordPrompt(_a0 string) string { ret := _m.Called(_a0) @@ -45,6 +80,34 @@ func (_m *Prompter) PasswordPrompt(_a0 string) string { return r0 } +// Prompter_PasswordPrompt_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PasswordPrompt' +type Prompter_PasswordPrompt_Call struct { + *mock.Call +} + +// PasswordPrompt is a helper method to define mock.On call +// - _a0 string +func (_e *Prompter_Expecter) PasswordPrompt(_a0 interface{}) *Prompter_PasswordPrompt_Call { + return &Prompter_PasswordPrompt_Call{Call: _e.mock.On("PasswordPrompt", _a0)} +} + +func (_c *Prompter_PasswordPrompt_Call) Run(run func(_a0 string)) *Prompter_PasswordPrompt_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Prompter_PasswordPrompt_Call) Return(_a0 string) *Prompter_PasswordPrompt_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Prompter_PasswordPrompt_Call) RunAndReturn(run func(string) string) *Prompter_PasswordPrompt_Call { + _c.Call.Return(run) + return _c +} + // Prompt provides a mock function with given fields: _a0 func (_m *Prompter) Prompt(_a0 string) string { ret := _m.Called(_a0) @@ -63,6 +126,34 @@ func (_m *Prompter) Prompt(_a0 string) string { return r0 } +// Prompter_Prompt_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Prompt' +type Prompter_Prompt_Call struct { + *mock.Call +} + +// Prompt is a helper method to define mock.On call +// - _a0 string +func (_e *Prompter_Expecter) Prompt(_a0 interface{}) *Prompter_Prompt_Call { + return &Prompter_Prompt_Call{Call: _e.mock.On("Prompt", _a0)} +} + +func (_c *Prompter_Prompt_Call) Run(run func(_a0 string)) *Prompter_Prompt_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Prompter_Prompt_Call) Return(_a0 string) *Prompter_Prompt_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Prompter_Prompt_Call) RunAndReturn(run func(string) string) *Prompter_Prompt_Call { + _c.Call.Return(run) + return _c +} + // NewPrompter creates a new instance of Prompter. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewPrompter(t interface { diff --git a/core/cmd/prompter.go b/core/cmd/prompter.go index 6e98fd9272b..84f930c6243 100644 --- a/core/cmd/prompter.go +++ b/core/cmd/prompter.go @@ -11,8 +11,6 @@ import ( "golang.org/x/term" ) -//go:generate mockery --quiet --name Prompter --output ./mocks/ --case=underscore - // Prompter implements the Prompt function to be used to display at // the console. type Prompter interface { diff --git a/core/cmd/shell.go b/core/cmd/shell.go index c79fb703107..c862b936140 100644 --- a/core/cmd/shell.go +++ b/core/cmd/shell.go @@ -23,14 +23,16 @@ import ( "github.com/Masterminds/semver/v3" "github.com/getsentry/sentry-go" "github.com/gin-gonic/gin" + "github.com/jmoiron/sqlx" "github.com/pkg/errors" "github.com/urfave/cli" + "go.opentelemetry.io/otel" + "go.opentelemetry.io/otel/attribute" "go.uber.org/multierr" "go.uber.org/zap/zapcore" "golang.org/x/sync/errgroup" - "github.com/jmoiron/sqlx" - + "github.com/smartcontractkit/chainlink-common/pkg/beholder" "github.com/smartcontractkit/chainlink-common/pkg/loop" "github.com/smartcontractkit/chainlink-common/pkg/sqlutil" "github.com/smartcontractkit/chainlink-common/pkg/utils/mailbox" @@ -63,19 +65,59 @@ var ( grpcOpts loop.GRPCOpts ) -func initGlobals(cfgProm config.Prometheus, cfgTracing config.Tracing, logger logger.Logger) error { +func initGlobals(cfgProm config.Prometheus, cfgTracing config.Tracing, cfgTelemetry config.Telemetry, lggr logger.Logger) error { // Avoid double initializations, but does not prevent relay methods from being called multiple times. var err error initGlobalsOnce.Do(func() { - prometheus = ginprom.New(ginprom.Namespace("service"), ginprom.Token(cfgProm.AuthToken())) - grpcOpts = loop.NewGRPCOpts(nil) // default prometheus.Registerer - err = loop.SetupTracing(loop.TracingConfig{ - Enabled: cfgTracing.Enabled(), - CollectorTarget: cfgTracing.CollectorTarget(), - NodeAttributes: cfgTracing.Attributes(), - SamplingRatio: cfgTracing.SamplingRatio(), - OnDialError: func(error) { logger.Errorw("Failed to dial", "err", err) }, - }) + err = func() error { + prometheus = ginprom.New(ginprom.Namespace("service"), ginprom.Token(cfgProm.AuthToken())) + grpcOpts = loop.NewGRPCOpts(nil) // default prometheus.Registerer + + otel.SetErrorHandler(otel.ErrorHandlerFunc(func(err error) { + lggr.Errorw("Telemetry error", "err", err) + })) + + tracingCfg := loop.TracingConfig{ + Enabled: cfgTracing.Enabled(), + CollectorTarget: cfgTracing.CollectorTarget(), + NodeAttributes: cfgTracing.Attributes(), + SamplingRatio: cfgTracing.SamplingRatio(), + TLSCertPath: cfgTracing.TLSCertPath(), + OnDialError: func(error) { lggr.Errorw("Failed to dial", "err", err) }, + } + if !cfgTelemetry.Enabled() { + return loop.SetupTracing(tracingCfg) + } + + var attributes []attribute.KeyValue + if tracingCfg.Enabled { + attributes = tracingCfg.Attributes() + } + for k, v := range cfgTelemetry.ResourceAttributes() { + attributes = append(attributes, attribute.String(k, v)) + } + clientCfg := beholder.Config{ + InsecureConnection: cfgTelemetry.InsecureConnection(), + CACertFile: cfgTelemetry.CACertFile(), + OtelExporterGRPCEndpoint: cfgTelemetry.OtelExporterGRPCEndpoint(), + ResourceAttributes: attributes, + TraceSampleRatio: cfgTelemetry.TraceSampleRatio(), + } + if tracingCfg.Enabled { + clientCfg.TraceSpanExporter, err = tracingCfg.NewSpanExporter() + if err != nil { + return err + } + } + var beholderClient *beholder.Client + beholderClient, err = beholder.NewClient(clientCfg) + if err != nil { + return err + } + beholder.SetClient(beholderClient) + beholder.SetGlobalOtelProviders() + return nil + }() }) return err } @@ -138,7 +180,7 @@ type ChainlinkAppFactory struct{} // NewApplication returns a new instance of the node with the given config. func (n ChainlinkAppFactory) NewApplication(ctx context.Context, cfg chainlink.GeneralConfig, appLggr logger.Logger, db *sqlx.DB) (app chainlink.Application, err error) { - err = initGlobals(cfg.Prometheus(), cfg.Tracing(), appLggr) + err = initGlobals(cfg.Prometheus(), cfg.Tracing(), cfg.Telemetry(), appLggr) if err != nil { appLggr.Errorf("Failed to initialize globals: %v", err) } @@ -158,7 +200,7 @@ func (n ChainlinkAppFactory) NewApplication(ctx context.Context, cfg chainlink.G keyStore := keystore.New(ds, utils.GetScryptParams(cfg), appLggr) mailMon := mailbox.NewMonitor(cfg.AppID().String(), appLggr.Named("Mailbox")) - loopRegistry := plugins.NewLoopRegistry(appLggr, cfg.Tracing()) + loopRegistry := plugins.NewLoopRegistry(appLggr, cfg.Tracing(), cfg.Telemetry()) mercuryPool := wsrpc.NewPool(appLggr, cache.Config{ LatestReportTTL: cfg.Mercury().Cache().LatestReportTTL(), @@ -168,6 +210,7 @@ func (n ChainlinkAppFactory) NewApplication(ctx context.Context, cfg chainlink.G capabilitiesRegistry := capabilities.NewRegistry(appLggr) + unrestrictedClient := clhttp.NewUnrestrictedHTTPClient() // create the relayer-chain interoperators from application configuration relayerFactory := chainlink.RelayerFactory{ Logger: appLggr, @@ -175,6 +218,7 @@ func (n ChainlinkAppFactory) NewApplication(ctx context.Context, cfg chainlink.G GRPCOpts: grpcOpts, MercuryPool: mercuryPool, CapabilitiesRegistry: capabilitiesRegistry, + HTTPClient: unrestrictedClient, } evmFactoryCfg := chainlink.EVMFactoryConfig{ @@ -208,6 +252,13 @@ func (n ChainlinkAppFactory) NewApplication(ctx context.Context, cfg chainlink.G } initOps = append(initOps, chainlink.InitStarknet(ctx, relayerFactory, starkCfg)) } + if cfg.AptosEnabled() { + aptosCfg := chainlink.AptosFactoryConfig{ + Keystore: keyStore.Aptos(), + TOMLConfigs: cfg.AptosConfigs(), + } + initOps = append(initOps, chainlink.InitAptos(ctx, relayerFactory, aptosCfg)) + } relayChainInterops, err := chainlink.NewCoreRelayerChainInteroperators(initOps...) if err != nil { @@ -221,7 +272,6 @@ func (n ChainlinkAppFactory) NewApplication(ctx context.Context, cfg chainlink.G } restrictedClient := clhttp.NewRestrictedHTTPClient(cfg.Database(), appLggr) - unrestrictedClient := clhttp.NewUnrestrictedHTTPClient() externalInitiatorManager := webhook.NewExternalInitiatorManager(ds, unrestrictedClient) return chainlink.NewApplication(chainlink.ApplicationOpts{ Config: cfg, @@ -248,6 +298,9 @@ func handleNodeVersioning(ctx context.Context, db *sqlx.DB, appLggr logger.Logge var err error // Set up the versioning Configs verORM := versioning.NewORM(db, appLggr) + ibhr := services.NewStartUpHealthReport(healthReportPort, appLggr) + ibhr.Start() + defer ibhr.Stop() if static.Version != static.Unset { var appv, dbv *semver.Version @@ -312,9 +365,6 @@ func takeBackupIfVersionUpgrade(dbUrl url.URL, rootDir string, cfg periodicbacku //Because backups can take a long time we must start a "fake" health report to prevent //node shutdown because of healthcheck fail/timeout - ibhr := services.NewInBackupHealthReport(healthReportPort, lggr) - ibhr.Start() - defer ibhr.Stop() err = databaseBackup.RunBackup(appv.String()) return err } diff --git a/core/cmd/shell_local.go b/core/cmd/shell_local.go index 3ecd3eed402..fedd83dec8a 100644 --- a/core/cmd/shell_local.go +++ b/core/cmd/shell_local.go @@ -22,9 +22,8 @@ import ( gethCommon "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" "github.com/fatih/color" - "github.com/lib/pq" - "github.com/kylelemons/godebug/diff" + "github.com/lib/pq" "github.com/pkg/errors" "github.com/urfave/cli" "go.uber.org/multierr" @@ -435,6 +434,9 @@ func (s *Shell) runNode(c *cli.Context) error { if s.Config.StarkNetEnabled() { enabledChains = append(enabledChains, chaintype.StarkNet) } + if s.Config.AptosEnabled() { + enabledChains = append(enabledChains, chaintype.Aptos) + } err2 := app.GetKeyStore().OCR2().EnsureKeys(rootCtx, enabledChains...) if err2 != nil { return errors.Wrap(err2, "failed to ensure ocr key") @@ -464,6 +466,12 @@ func (s *Shell) runNode(c *cli.Context) error { return errors.Wrap(err2, "failed to ensure starknet key") } } + if s.Config.AptosEnabled() { + err2 := app.GetKeyStore().Aptos().EnsureKey(rootCtx) + if err2 != nil { + return errors.Wrap(err2, "failed to ensure aptos key") + } + } err2 := app.GetKeyStore().CSA().EnsureKey(rootCtx) if err2 != nil { @@ -669,7 +677,7 @@ func (s *Shell) RebroadcastTransactions(c *cli.Context) (err error) { feeCfg := txmgr.NewEvmTxmFeeConfig(chain.Config().EVM().GasEstimator()) stuckTxDetector := txmgr.NewStuckTxDetector(lggr, ethClient.ConfiguredChainID(), "", assets.NewWei(assets.NewEth(100).ToInt()), chain.Config().EVM().Transactions().AutoPurge(), nil, orm, ethClient) ec := txmgr.NewEvmConfirmer(orm, txmgr.NewEvmTxmClient(ethClient, chain.Config().EVM().NodePool().Errors()), - cfg, feeCfg, chain.Config().EVM().Transactions(), app.GetConfig().Database(), keyStore.Eth(), txBuilder, chain.Logger(), stuckTxDetector) + cfg, feeCfg, chain.Config().EVM().Transactions(), app.GetConfig().Database(), keyStore.Eth(), txBuilder, chain.Logger(), stuckTxDetector, chain.HeadTracker()) totalNonces := endingNonce - beginningNonce + 1 nonces := make([]evmtypes.Nonce, totalNonces) for i := int64(0); i < totalNonces; i++ { @@ -768,7 +776,7 @@ func (s *Shell) ResetDatabase(c *cli.Context) error { return s.errorOut(err) } lggr.Debugf("Migrating database: %#v", parsed.String()) - if err := migrateDB(ctx, cfg, lggr); err != nil { + if err := migrateDB(ctx, cfg); err != nil { return s.errorOut(err) } schema, err := dumpSchema(parsed) @@ -777,7 +785,7 @@ func (s *Shell) ResetDatabase(c *cli.Context) error { } lggr.Debugf("Testing rollback and re-migrate for database: %#v", parsed.String()) var baseVersionID int64 = 54 - if err := downAndUpDB(ctx, cfg, lggr, baseVersionID); err != nil { + if err := downAndUpDB(ctx, cfg, baseVersionID); err != nil { return s.errorOut(err) } if err := checkSchema(parsed, schema); err != nil { @@ -931,7 +939,7 @@ func (s *Shell) MigrateDatabase(_ *cli.Context) error { } s.Logger.Infof("Migrating database: %#v", parsed.String()) - if err := migrateDB(ctx, cfg, s.Logger); err != nil { + if err := migrateDB(ctx, cfg); err != nil { return s.errorOut(err) } return nil @@ -1131,7 +1139,7 @@ func dropAndCreatePristineDB(db *sqlx.DB, template string) (err error) { return nil } -func migrateDB(ctx context.Context, config dbConfig, lggr logger.Logger) error { +func migrateDB(ctx context.Context, config dbConfig) error { db, err := newConnection(config) if err != nil { return fmt.Errorf("failed to initialize orm: %v", err) @@ -1143,7 +1151,7 @@ func migrateDB(ctx context.Context, config dbConfig, lggr logger.Logger) error { return db.Close() } -func downAndUpDB(ctx context.Context, cfg dbConfig, lggr logger.Logger, baseVersionID int64) error { +func downAndUpDB(ctx context.Context, cfg dbConfig, baseVersionID int64) error { db, err := newConnection(cfg) if err != nil { return fmt.Errorf("failed to initialize orm: %v", err) diff --git a/core/cmd/shell_local_test.go b/core/cmd/shell_local_test.go index 5fbbff4260f..6f4907a5a6f 100644 --- a/core/cmd/shell_local_test.go +++ b/core/cmd/shell_local_test.go @@ -13,11 +13,11 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/utils/mailbox" "github.com/smartcontractkit/chainlink/v2/common/client" + "github.com/smartcontractkit/chainlink/v2/core/capabilities" "github.com/smartcontractkit/chainlink/v2/core/chains/legacyevm" "github.com/smartcontractkit/chainlink/v2/core/cmd" cmdMocks "github.com/smartcontractkit/chainlink/v2/core/cmd/mocks" "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" - "github.com/smartcontractkit/chainlink/v2/core/internal/cltest/heavyweight" "github.com/smartcontractkit/chainlink/v2/core/internal/mocks" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/configtest" @@ -32,6 +32,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/store/dialects" "github.com/smartcontractkit/chainlink/v2/core/store/models" "github.com/smartcontractkit/chainlink/v2/core/utils" + "github.com/smartcontractkit/chainlink/v2/core/utils/testutils/heavyweight" "github.com/smartcontractkit/chainlink/v2/plugins" gethTypes "github.com/ethereum/go-ethereum/core/types" @@ -44,8 +45,9 @@ import ( func genTestEVMRelayers(t *testing.T, opts legacyevm.ChainRelayExtenderConfig, ks evmrelayer.CSAETHKeystore) *chainlink.CoreRelayerChainInteroperators { f := chainlink.RelayerFactory{ - Logger: opts.Logger, - LoopRegistry: plugins.NewLoopRegistry(opts.Logger, opts.AppConfig.Tracing()), + Logger: opts.Logger, + LoopRegistry: plugins.NewLoopRegistry(opts.Logger, opts.AppConfig.Tracing(), opts.AppConfig.Telemetry()), + CapabilitiesRegistry: capabilities.NewRegistry(opts.Logger), } relayers, err := chainlink.NewCoreRelayerChainInteroperators(chainlink.InitEVM(testutils.Context(t), f, chainlink.EVMFactoryConfig{ diff --git a/core/cmd/shell_remote.go b/core/cmd/shell_remote.go index aab4a94da6f..0aa3f3837dc 100644 --- a/core/cmd/shell_remote.go +++ b/core/cmd/shell_remote.go @@ -517,7 +517,11 @@ func (s *Shell) Health(c *cli.Context) error { if c.Bool("json") { mime = gin.MIMEJSON } - resp, err := s.HTTP.Get(s.ctx(), "/health", map[string]string{"Accept": mime}) + u := "/health" + if c.Bool("failing") { + u += "?failing" + } + resp, err := s.HTTP.Get(s.ctx(), u, map[string]string{"Accept": mime}) if err != nil { return s.errorOut(err) } diff --git a/core/cmd/shell_test.go b/core/cmd/shell_test.go index 6ecdc4a34de..a93be2fb9ea 100644 --- a/core/cmd/shell_test.go +++ b/core/cmd/shell_test.go @@ -351,7 +351,7 @@ func TestNewUserCache(t *testing.T) { func TestSetupSolanaRelayer(t *testing.T) { lggr := logger.TestLogger(t) - reg := plugins.NewLoopRegistry(lggr, nil) + reg := plugins.NewLoopRegistry(lggr, nil, nil) ks := mocks.NewSolana(t) // config 3 chains but only enable 2 => should only be 2 relayer @@ -466,7 +466,7 @@ func TestSetupSolanaRelayer(t *testing.T) { func TestSetupStarkNetRelayer(t *testing.T) { lggr := logger.TestLogger(t) - reg := plugins.NewLoopRegistry(lggr, nil) + reg := plugins.NewLoopRegistry(lggr, nil, nil) ks := mocks.NewStarkNet(t) // config 3 chains but only enable 2 => should only be 2 relayer nEnabledChains := 2 diff --git a/core/cmd/solana_node_commands_test.go b/core/cmd/solana_node_commands_test.go index adc699de79b..bc4aa15f7bc 100644 --- a/core/cmd/solana_node_commands_test.go +++ b/core/cmd/solana_node_commands_test.go @@ -20,7 +20,7 @@ import ( func solanaStartNewApplication(t *testing.T, cfgs ...*solcfg.TOMLConfig) *cltest.TestApplication { for i := range cfgs { - cfgs[i].SetDefaults() + cfgs[i].Chain.SetDefaults() } return startNewApplicationV2(t, func(c *chainlink.Config, s *chainlink.Secrets) { c.Solana = cfgs @@ -72,17 +72,17 @@ func TestShell_IndexSolanaNodes(t *testing.T) { rt := cmd.RendererTable{b} require.NoError(t, nodes.RenderTable(rt)) renderLines := strings.Split(b.String(), "\n") - assert.Equal(t, 17, len(renderLines)) + assert.Equal(t, 19, len(renderLines)) assert.Contains(t, renderLines[2], "Name") assert.Contains(t, renderLines[2], n1.Name) assert.Contains(t, renderLines[3], "Chain ID") assert.Contains(t, renderLines[3], n1.ChainID) assert.Contains(t, renderLines[4], "State") assert.Contains(t, renderLines[4], n1.State) - assert.Contains(t, renderLines[9], "Name") - assert.Contains(t, renderLines[9], n2.Name) - assert.Contains(t, renderLines[10], "Chain ID") - assert.Contains(t, renderLines[10], n2.ChainID) - assert.Contains(t, renderLines[11], "State") - assert.Contains(t, renderLines[11], n2.State) + assert.Contains(t, renderLines[10], "Name") + assert.Contains(t, renderLines[10], n2.Name) + assert.Contains(t, renderLines[11], "Chain ID") + assert.Contains(t, renderLines[11], n2.ChainID) + assert.Contains(t, renderLines[12], "State") + assert.Contains(t, renderLines[12], n2.State) } diff --git a/core/config/app_config.go b/core/config/app_config.go index 112e242636f..4cb7f1f610c 100644 --- a/core/config/app_config.go +++ b/core/config/app_config.go @@ -56,6 +56,7 @@ type AppConfig interface { Threshold() Threshold WebServer() WebServer Tracing() Tracing + Telemetry() Telemetry } type DatabaseBackupMode string diff --git a/core/config/capabilities_config.go b/core/config/capabilities_config.go index ae542c062c5..b7e5a3b86a7 100644 --- a/core/config/capabilities_config.go +++ b/core/config/capabilities_config.go @@ -11,7 +11,24 @@ type CapabilitiesExternalRegistry interface { RelayID() types.RelayID } +type GatewayConnector interface { + ChainIDForNodeKey() string + NodeAddress() string + DonID() string + Gateways() []ConnectorGateway + WSHandshakeTimeoutMillis() uint32 + AuthMinChallengeLen() int + AuthTimestampToleranceSec() uint32 +} + +type ConnectorGateway interface { + ID() string + URL() string +} + type Capabilities interface { Peering() P2P + Dispatcher() Dispatcher ExternalRegistry() CapabilitiesExternalRegistry + GatewayConnector() GatewayConnector } diff --git a/core/config/dispatcher_config.go b/core/config/dispatcher_config.go new file mode 100644 index 00000000000..ec6f13e8f4a --- /dev/null +++ b/core/config/dispatcher_config.go @@ -0,0 +1,14 @@ +package config + +type DispatcherRateLimit interface { + GlobalRPS() float64 + GlobalBurst() int + PerSenderRPS() float64 + PerSenderBurst() int +} + +type Dispatcher interface { + SupportedVersion() int + ReceiverBufferSize() int + RateLimit() DispatcherRateLimit +} diff --git a/core/config/docs/chains-evm.toml b/core/config/docs/chains-evm.toml index 38c8cb8354f..660b3e4a7dd 100644 --- a/core/config/docs/chains-evm.toml +++ b/core/config/docs/chains-evm.toml @@ -14,7 +14,7 @@ BlockBackfillDepth = 10 # Default # BlockBackfillSkip enables skipping of very long backfills. BlockBackfillSkip = false # Default # ChainType is automatically detected from chain ID. Set this to force a certain chain type regardless of chain ID. -# Available types: `arbitrum`, `celo`, `gnosis`, `kroma`, `metis`, `optimismBedrock`, `scroll`, `wemix`, `xlayer`, `zksync` +# Available types: `arbitrum`, `celo`, `gnosis`, `hedera`, `kroma`, `metis`, `optimismBedrock`, `scroll`, `wemix`, `xlayer`, `zksync` ChainType = 'arbitrum' # Example # FinalityDepth is the number of blocks after which an ethereum transaction is considered "final". Note that the default is automatically set based on chain ID, so it should not be necessary to change this under normal operation. # BlocksConsideredFinal determines how deeply we look back to ensure that transactions are confirmed onto the longest chain @@ -97,6 +97,13 @@ RPCBlockQueryDelay = 1 # Default # Block 64 will be treated as finalized by CL Node only when chain's latest finalized block is 65. As chain finalizes blocks in batches of 32, # CL Node has to wait for a whole new batch to be finalized to treat block 64 as finalized. FinalizedBlockOffset = 0 # Default +# LogBroadcasterEnabled is a feature flag for LogBroadcaster, by default it's true. +LogBroadcasterEnabled = true # Default +# NoNewFinalizedHeadsThreshold controls how long to wait for new finalized block before `NodePool` marks rpc endpoints as +# out-of-sync. Only applicable if `FinalityTagEnabled=true` +# +# Set to zero to disable. +NoNewFinalizedHeadsThreshold = '0' # Default [EVM.Transactions] # ForwardersEnabled enables or disables sending transactions through forwarder contracts. @@ -188,6 +195,8 @@ LimitMax = 500_000 # Default LimitMultiplier = '1.0' # Default # LimitTransfer is the gas limit used for an ordinary ETH transfer. LimitTransfer = 21_000 # Default +# EstimateLimit enables estimating gas limits for transactions. This feature respects the gas limit provided during transaction creation as an upper bound. +EstimateLimit = false # Default # BumpMin is the minimum fixed amount of wei by which gas is bumped on each transaction attempt. BumpMin = '5 gwei' # Default # BumpPercent is the percentage by which to bump gas on a transaction that has exceeded `BumpThreshold`. The larger of `BumpPercent` and `BumpMin` is taken for gas bumps. @@ -304,6 +313,15 @@ EIP1559FeeCapBufferBlocks = 13 # Example # Setting it lower will tend to set lower gas prices. TransactionPercentile = 60 # Default +[EVM.GasEstimator.FeeHistory] +# CacheTimeout is the time to wait in order to refresh the cached values stored in the FeeHistory estimator. A small jitter is applied so the timeout won't be exactly the same each time. +# +# You want this value to be close to the block time. For slower chains, like Ethereum, you can set it to 12s, the same as the block time. For faster chains you can skip a block or two +# and set it to two times the block time i.e. on Optimism you can set it to 4s. Ideally, you don't want to go lower than 1s since the RTT times of the RPC requests will be comparable to +# the timeout. The estimator is already adding a buffer to account for a potential increase in prices within one or two blocks. On the other hand, slower frequency will fail to refresh +# the prices and end up in stale values. +CacheTimeout = '10s' # Default + # The head tracker continually listens for new heads from the chain. # # In addition to these settings, it log warnings if `EVM.NoNewHeadsThreshold` is exceeded without any new blocks being emitted. @@ -329,6 +347,11 @@ FinalityTagBypass = true # Default # If actual finality depth exceeds this number, HeadTracker aborts backfill and returns an error. # Has no effect if `FinalityTagsEnabled` = false MaxAllowedFinalityDepth = 10000 # Default +# PersistenceEnabled defines whether HeadTracker needs to store heads in the database. +# Persistence is helpful on chains with large finality depth, where fetching blocks from the latest to the latest finalized takes a lot of time. +# On chains with fast finality, the persistence layer does not improve the chain's load time and only consumes database resources (mainly IO). +# NOTE: persistence should not be disabled for products that use LogBroadcaster, as it might lead to missed on-chain events. +PersistenceEnabled = true # Default [[EVM.KeySpecific]] # Key is the account to apply these settings to @@ -391,6 +414,10 @@ EnforceRepeatableRead = false # Default # trigger declaration of `FinalizedBlockOutOfSync` due to insignificant network delays in broadcasting of the finalized state among RPCs. # RPC will not be picked to handle a request even if this option is set to a nonzero value. DeathDeclarationDelay = '10s' # Default +# NewHeadsPollInterval define an interval for polling new block periodically using http client rather than subscribe to ws feed +# +# Set to 0 to disable. +NewHeadsPollInterval = '0s' # Default # **ADVANCED** # Errors enable the node to provide custom regex patterns to match against error messages from RPCs. [EVM.NodePool.Errors] @@ -422,6 +449,8 @@ TransactionAlreadyMined = '(: |^)transaction already mined' # Example Fatal = '(: |^)fatal' # Example # ServiceUnavailable is a regex pattern to match against service unavailable errors. ServiceUnavailable = '(: |^)service unavailable' # Example +# TooManyResults is a regex pattern to match an eth_getLogs error indicating the result set is too large to return +TooManyResults = '(: |^)too many results' # Example [EVM.OCR] # ContractConfirmations sets `OCR.ContractConfirmations` for this EVM chain. @@ -462,3 +491,5 @@ GasLimit = 5400000 # Default FromAddress = '0x2a3e23c6f242F5345320814aC8a1b4E58707D292' # Example # ForwarderAddress is the keystone forwarder contract address on chain. ForwarderAddress = '0x2a3e23c6f242F5345320814aC8a1b4E58707D292' # Example +# GasLimitDefault is the default gas limit for workflow transactions. +GasLimitDefault = 400_000 # Default diff --git a/core/config/docs/chains-solana.toml b/core/config/docs/chains-solana.toml index 9376445061a..98b777f11c2 100644 --- a/core/config/docs/chains-solana.toml +++ b/core/config/docs/chains-solana.toml @@ -36,9 +36,13 @@ ComputeUnitPriceDefault = 0 # Default FeeBumpPeriod = '3s' # Default # BlockHistoryPollPeriod is the rate to poll for blocks in the block history fee estimator BlockHistoryPollPeriod = '5s' # Default +# ComputeUnitLimitDefault is the compute units limit applied to transactions unless overriden during the txm enqueue +ComputeUnitLimitDefault = 200_000 # Default [[Solana.Nodes]] # Name is a unique (per-chain) identifier for this node. Name = 'primary' # Example # URL is the HTTP(S) endpoint for this node. URL = 'http://solana.web' # Example +# SendOnly is a multinode config that only sends transactions to a node and does not read state +SendOnly = false # Default diff --git a/core/config/docs/core.toml b/core/config/docs/core.toml index d1b922cf291..dde898ed3b1 100644 --- a/core/config/docs/core.toml +++ b/core/config/docs/core.toml @@ -13,6 +13,10 @@ FeedsManager = true # Default LogPoller = false # Default # UICSAKeys enables CSA Keys in the UI. UICSAKeys = false # Default +# CCIP enables the CCIP service. +CCIP = true # Default +# MultiFeedsManagers enables support for multiple feeds manager connections. +MultiFeedsManagers = false # Default [Database] # DefaultIdleInTxSessionTimeout is the maximum time allowed for a transaction to be open and idle before timing out. See Postgres `idle_in_transaction_session_timeout` for more details. @@ -85,7 +89,7 @@ LeaseRefreshInterval = '1s' # Default [TelemetryIngress] # UniConn toggles which ws connection style is used. -UniConn = true # Default +UniConn = false # Default # Logging toggles verbose logging of the raw telemetry messages being sent. Logging = false # Default # BufferSize is the number of telemetry messages to buffer before dropping new ones. @@ -448,6 +452,22 @@ NetworkID = 'evm' # Default # ChainID identifies the target chain id where the remote registry is located. ChainID = '1' # Default +[Capabilities.Dispatcher] +# SupportedVersion is the version of the version of message schema. +SupportedVersion = 1 # Default +# ReceiverBufferSize is the size of the buffer for incoming messages. +ReceiverBufferSize = 10000 # Default + +[Capabilities.Dispatcher.RateLimit] +# GlobalRPS is the global rate limit for the dispatcher. +GlobalRPS = 800 # Default +# GlobalBurst is the global burst limit for the dispatcher. +GlobalBurst = 1000 # Default +# PerSenderRPS is the per-sender rate limit for the dispatcher. +PerSenderRPS = 10 # Default +# PerSenderBurst is the per-sender burst limit for the dispatcher. +PerSenderBurst = 50 # Default + [Capabilities.Peering] # IncomingMessageBufferSize is the per-remote number of incoming # messages to buffer. Any additional messages received on top of those @@ -489,6 +509,26 @@ DeltaReconcile = '1m' # Default # but the host and port must be fully specified and cannot be empty. You can specify `0.0.0.0` (IPv4) or `::` (IPv6) to listen on all interfaces, but that is not recommended. ListenAddresses = ['1.2.3.4:9999', '[a52d:0:a88:1274::abcd]:1337'] # Example +[Capabilities.GatewayConnector] +# ChainIDForNodeKey is the ChainID of the network associated with a private key to be used for authentication with Gateway nodes +ChainIDForNodeKey = '11155111' # Example +# NodeAddress is the address of the desired private key to be used for authentication with Gateway nodes +NodeAddress = '0x68902d681c28119f9b2531473a417088bf008e59' # Example +# DonID is the Id of the Don +DonID = 'example_don' # Example +# WSHandshakeTimeoutMillis is Websocket handshake timeout +WSHandshakeTimeoutMillis = 1000 # Example +# AuthMinChallengeLen is the minimum number of bytes in authentication challenge payload +AuthMinChallengeLen = 10 # Example +# AuthTimestampToleranceSec is Authentication timestamp tolerance +AuthTimestampToleranceSec = 10 # Example + +[[Capabilities.GatewayConnector.Gateways]] +# ID of the Gateway +ID = 'example_gateway' # Example +# URL of the Gateway +URL = 'wss://localhost:8081/node' # Example + [Keeper] # **ADVANCED** # DefaultTransactionQueueDepth controls the queue size for `DropOldestStrategy` in Keeper. Set to 0 to use `SendEvery` strategy instead. @@ -649,3 +689,25 @@ TransmitQueueMaxSize = 10_000 # Default # when sending a message to the mercury server, before aborting and considering # the transmission to be failed. TransmitTimeout = "5s" # Default + +# Telemetry holds OTEL settings. +# This data includes open telemetry metrics, traces, & logs. +# It does not currently include prometheus metrics or standard out logs, but may in the future. +[Telemetry] +# Enabled turns telemetry collection on or off. +Enabled = false # Default +# Endpoint of the OTEL Collector. +Endpoint = 'example.com/collector' # Example +# CACertFile is the file path of the TLS certificate used for secure communication with the OTEL Collector. +# Required unless InescureConnection is true. +CACertFile = 'cert-file' # Example +# InsecureConnection bypasses the TLS CACertFile requirement and uses an insecure connection instead. +# Only available in dev mode. +InsecureConnection = false # Default +# TraceSampleRatio is the rate at which to sample traces. Must be between 0 and 1. +TraceSampleRatio = 0.01 # Default + +# ResourceAttributes are global metadata to include with all telemetry. +[Telemetry.ResourceAttributes] +# foo is an example resource attribute +foo = "bar" # Example diff --git a/core/config/docs/docs_test.go b/core/config/docs/docs_test.go index 5d50149cbc6..2084363c4b0 100644 --- a/core/config/docs/docs_test.go +++ b/core/config/docs/docs_test.go @@ -83,8 +83,12 @@ func TestDoc(t *testing.T) { docDefaults.OperatorFactoryAddress = nil require.Empty(t, docDefaults.Workflow.FromAddress) require.Empty(t, docDefaults.Workflow.ForwarderAddress) + gasLimitDefault := uint64(400_000) + require.Equal(t, &gasLimitDefault, docDefaults.Workflow.GasLimitDefault) + docDefaults.Workflow.FromAddress = nil docDefaults.Workflow.ForwarderAddress = nil + docDefaults.Workflow.GasLimitDefault = &gasLimitDefault docDefaults.NodePool.Errors = evmcfg.ClientErrors{} // Transactions.AutoPurge configs are only set if the feature is enabled diff --git a/core/config/env/env.go b/core/config/env/env.go index 0ebfc357bf3..c34cd7f4f5e 100644 --- a/core/config/env/env.go +++ b/core/config/env/env.go @@ -20,6 +20,7 @@ var ( ThresholdKeyShare = Secret("CL_THRESHOLD_KEY_SHARE") // Migrations env vars EVMChainIDNotNullMigration0195 = "CL_EVM_CHAINID_NOT_NULL_MIGRATION_0195" + CustomDefaults = Var("CL_CHAIN_DEFAULTS") ) // LOOPP commands and vars diff --git a/core/config/feature_config.go b/core/config/feature_config.go index fbb3a4ea541..200a1fd8ed8 100644 --- a/core/config/feature_config.go +++ b/core/config/feature_config.go @@ -4,4 +4,5 @@ type Feature interface { FeedsManager() bool UICSAKeys() bool LogPoller() bool + MultiFeedsManagers() bool } diff --git a/core/config/mocks/telemetry_ingress.go b/core/config/mocks/telemetry_ingress.go index 43889566c70..32dc4498a71 100644 --- a/core/config/mocks/telemetry_ingress.go +++ b/core/config/mocks/telemetry_ingress.go @@ -14,6 +14,14 @@ type TelemetryIngress struct { mock.Mock } +type TelemetryIngress_Expecter struct { + mock *mock.Mock +} + +func (_m *TelemetryIngress) EXPECT() *TelemetryIngress_Expecter { + return &TelemetryIngress_Expecter{mock: &_m.Mock} +} + // BufferSize provides a mock function with given fields: func (_m *TelemetryIngress) BufferSize() uint { ret := _m.Called() @@ -32,6 +40,33 @@ func (_m *TelemetryIngress) BufferSize() uint { return r0 } +// TelemetryIngress_BufferSize_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BufferSize' +type TelemetryIngress_BufferSize_Call struct { + *mock.Call +} + +// BufferSize is a helper method to define mock.On call +func (_e *TelemetryIngress_Expecter) BufferSize() *TelemetryIngress_BufferSize_Call { + return &TelemetryIngress_BufferSize_Call{Call: _e.mock.On("BufferSize")} +} + +func (_c *TelemetryIngress_BufferSize_Call) Run(run func()) *TelemetryIngress_BufferSize_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *TelemetryIngress_BufferSize_Call) Return(_a0 uint) *TelemetryIngress_BufferSize_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *TelemetryIngress_BufferSize_Call) RunAndReturn(run func() uint) *TelemetryIngress_BufferSize_Call { + _c.Call.Return(run) + return _c +} + // Endpoints provides a mock function with given fields: func (_m *TelemetryIngress) Endpoints() []config.TelemetryIngressEndpoint { ret := _m.Called() @@ -52,6 +87,33 @@ func (_m *TelemetryIngress) Endpoints() []config.TelemetryIngressEndpoint { return r0 } +// TelemetryIngress_Endpoints_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Endpoints' +type TelemetryIngress_Endpoints_Call struct { + *mock.Call +} + +// Endpoints is a helper method to define mock.On call +func (_e *TelemetryIngress_Expecter) Endpoints() *TelemetryIngress_Endpoints_Call { + return &TelemetryIngress_Endpoints_Call{Call: _e.mock.On("Endpoints")} +} + +func (_c *TelemetryIngress_Endpoints_Call) Run(run func()) *TelemetryIngress_Endpoints_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *TelemetryIngress_Endpoints_Call) Return(_a0 []config.TelemetryIngressEndpoint) *TelemetryIngress_Endpoints_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *TelemetryIngress_Endpoints_Call) RunAndReturn(run func() []config.TelemetryIngressEndpoint) *TelemetryIngress_Endpoints_Call { + _c.Call.Return(run) + return _c +} + // Logging provides a mock function with given fields: func (_m *TelemetryIngress) Logging() bool { ret := _m.Called() @@ -70,6 +132,33 @@ func (_m *TelemetryIngress) Logging() bool { return r0 } +// TelemetryIngress_Logging_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Logging' +type TelemetryIngress_Logging_Call struct { + *mock.Call +} + +// Logging is a helper method to define mock.On call +func (_e *TelemetryIngress_Expecter) Logging() *TelemetryIngress_Logging_Call { + return &TelemetryIngress_Logging_Call{Call: _e.mock.On("Logging")} +} + +func (_c *TelemetryIngress_Logging_Call) Run(run func()) *TelemetryIngress_Logging_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *TelemetryIngress_Logging_Call) Return(_a0 bool) *TelemetryIngress_Logging_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *TelemetryIngress_Logging_Call) RunAndReturn(run func() bool) *TelemetryIngress_Logging_Call { + _c.Call.Return(run) + return _c +} + // MaxBatchSize provides a mock function with given fields: func (_m *TelemetryIngress) MaxBatchSize() uint { ret := _m.Called() @@ -88,6 +177,33 @@ func (_m *TelemetryIngress) MaxBatchSize() uint { return r0 } +// TelemetryIngress_MaxBatchSize_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MaxBatchSize' +type TelemetryIngress_MaxBatchSize_Call struct { + *mock.Call +} + +// MaxBatchSize is a helper method to define mock.On call +func (_e *TelemetryIngress_Expecter) MaxBatchSize() *TelemetryIngress_MaxBatchSize_Call { + return &TelemetryIngress_MaxBatchSize_Call{Call: _e.mock.On("MaxBatchSize")} +} + +func (_c *TelemetryIngress_MaxBatchSize_Call) Run(run func()) *TelemetryIngress_MaxBatchSize_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *TelemetryIngress_MaxBatchSize_Call) Return(_a0 uint) *TelemetryIngress_MaxBatchSize_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *TelemetryIngress_MaxBatchSize_Call) RunAndReturn(run func() uint) *TelemetryIngress_MaxBatchSize_Call { + _c.Call.Return(run) + return _c +} + // SendInterval provides a mock function with given fields: func (_m *TelemetryIngress) SendInterval() time.Duration { ret := _m.Called() @@ -106,6 +222,33 @@ func (_m *TelemetryIngress) SendInterval() time.Duration { return r0 } +// TelemetryIngress_SendInterval_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SendInterval' +type TelemetryIngress_SendInterval_Call struct { + *mock.Call +} + +// SendInterval is a helper method to define mock.On call +func (_e *TelemetryIngress_Expecter) SendInterval() *TelemetryIngress_SendInterval_Call { + return &TelemetryIngress_SendInterval_Call{Call: _e.mock.On("SendInterval")} +} + +func (_c *TelemetryIngress_SendInterval_Call) Run(run func()) *TelemetryIngress_SendInterval_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *TelemetryIngress_SendInterval_Call) Return(_a0 time.Duration) *TelemetryIngress_SendInterval_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *TelemetryIngress_SendInterval_Call) RunAndReturn(run func() time.Duration) *TelemetryIngress_SendInterval_Call { + _c.Call.Return(run) + return _c +} + // SendTimeout provides a mock function with given fields: func (_m *TelemetryIngress) SendTimeout() time.Duration { ret := _m.Called() @@ -124,6 +267,33 @@ func (_m *TelemetryIngress) SendTimeout() time.Duration { return r0 } +// TelemetryIngress_SendTimeout_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SendTimeout' +type TelemetryIngress_SendTimeout_Call struct { + *mock.Call +} + +// SendTimeout is a helper method to define mock.On call +func (_e *TelemetryIngress_Expecter) SendTimeout() *TelemetryIngress_SendTimeout_Call { + return &TelemetryIngress_SendTimeout_Call{Call: _e.mock.On("SendTimeout")} +} + +func (_c *TelemetryIngress_SendTimeout_Call) Run(run func()) *TelemetryIngress_SendTimeout_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *TelemetryIngress_SendTimeout_Call) Return(_a0 time.Duration) *TelemetryIngress_SendTimeout_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *TelemetryIngress_SendTimeout_Call) RunAndReturn(run func() time.Duration) *TelemetryIngress_SendTimeout_Call { + _c.Call.Return(run) + return _c +} + // UniConn provides a mock function with given fields: func (_m *TelemetryIngress) UniConn() bool { ret := _m.Called() @@ -142,6 +312,33 @@ func (_m *TelemetryIngress) UniConn() bool { return r0 } +// TelemetryIngress_UniConn_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UniConn' +type TelemetryIngress_UniConn_Call struct { + *mock.Call +} + +// UniConn is a helper method to define mock.On call +func (_e *TelemetryIngress_Expecter) UniConn() *TelemetryIngress_UniConn_Call { + return &TelemetryIngress_UniConn_Call{Call: _e.mock.On("UniConn")} +} + +func (_c *TelemetryIngress_UniConn_Call) Run(run func()) *TelemetryIngress_UniConn_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *TelemetryIngress_UniConn_Call) Return(_a0 bool) *TelemetryIngress_UniConn_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *TelemetryIngress_UniConn_Call) RunAndReturn(run func() bool) *TelemetryIngress_UniConn_Call { + _c.Call.Return(run) + return _c +} + // UseBatchSend provides a mock function with given fields: func (_m *TelemetryIngress) UseBatchSend() bool { ret := _m.Called() @@ -160,6 +357,33 @@ func (_m *TelemetryIngress) UseBatchSend() bool { return r0 } +// TelemetryIngress_UseBatchSend_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UseBatchSend' +type TelemetryIngress_UseBatchSend_Call struct { + *mock.Call +} + +// UseBatchSend is a helper method to define mock.On call +func (_e *TelemetryIngress_Expecter) UseBatchSend() *TelemetryIngress_UseBatchSend_Call { + return &TelemetryIngress_UseBatchSend_Call{Call: _e.mock.On("UseBatchSend")} +} + +func (_c *TelemetryIngress_UseBatchSend_Call) Run(run func()) *TelemetryIngress_UseBatchSend_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *TelemetryIngress_UseBatchSend_Call) Return(_a0 bool) *TelemetryIngress_UseBatchSend_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *TelemetryIngress_UseBatchSend_Call) RunAndReturn(run func() bool) *TelemetryIngress_UseBatchSend_Call { + _c.Call.Return(run) + return _c +} + // NewTelemetryIngress creates a new instance of TelemetryIngress. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewTelemetryIngress(t interface { diff --git a/core/config/mocks/telemetry_ingress_endpoint.go b/core/config/mocks/telemetry_ingress_endpoint.go index 11eebd373ef..4a6651f1315 100644 --- a/core/config/mocks/telemetry_ingress_endpoint.go +++ b/core/config/mocks/telemetry_ingress_endpoint.go @@ -13,6 +13,14 @@ type TelemetryIngressEndpoint struct { mock.Mock } +type TelemetryIngressEndpoint_Expecter struct { + mock *mock.Mock +} + +func (_m *TelemetryIngressEndpoint) EXPECT() *TelemetryIngressEndpoint_Expecter { + return &TelemetryIngressEndpoint_Expecter{mock: &_m.Mock} +} + // ChainID provides a mock function with given fields: func (_m *TelemetryIngressEndpoint) ChainID() string { ret := _m.Called() @@ -31,6 +39,33 @@ func (_m *TelemetryIngressEndpoint) ChainID() string { return r0 } +// TelemetryIngressEndpoint_ChainID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ChainID' +type TelemetryIngressEndpoint_ChainID_Call struct { + *mock.Call +} + +// ChainID is a helper method to define mock.On call +func (_e *TelemetryIngressEndpoint_Expecter) ChainID() *TelemetryIngressEndpoint_ChainID_Call { + return &TelemetryIngressEndpoint_ChainID_Call{Call: _e.mock.On("ChainID")} +} + +func (_c *TelemetryIngressEndpoint_ChainID_Call) Run(run func()) *TelemetryIngressEndpoint_ChainID_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *TelemetryIngressEndpoint_ChainID_Call) Return(_a0 string) *TelemetryIngressEndpoint_ChainID_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *TelemetryIngressEndpoint_ChainID_Call) RunAndReturn(run func() string) *TelemetryIngressEndpoint_ChainID_Call { + _c.Call.Return(run) + return _c +} + // Network provides a mock function with given fields: func (_m *TelemetryIngressEndpoint) Network() string { ret := _m.Called() @@ -49,6 +84,33 @@ func (_m *TelemetryIngressEndpoint) Network() string { return r0 } +// TelemetryIngressEndpoint_Network_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Network' +type TelemetryIngressEndpoint_Network_Call struct { + *mock.Call +} + +// Network is a helper method to define mock.On call +func (_e *TelemetryIngressEndpoint_Expecter) Network() *TelemetryIngressEndpoint_Network_Call { + return &TelemetryIngressEndpoint_Network_Call{Call: _e.mock.On("Network")} +} + +func (_c *TelemetryIngressEndpoint_Network_Call) Run(run func()) *TelemetryIngressEndpoint_Network_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *TelemetryIngressEndpoint_Network_Call) Return(_a0 string) *TelemetryIngressEndpoint_Network_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *TelemetryIngressEndpoint_Network_Call) RunAndReturn(run func() string) *TelemetryIngressEndpoint_Network_Call { + _c.Call.Return(run) + return _c +} + // ServerPubKey provides a mock function with given fields: func (_m *TelemetryIngressEndpoint) ServerPubKey() string { ret := _m.Called() @@ -67,6 +129,33 @@ func (_m *TelemetryIngressEndpoint) ServerPubKey() string { return r0 } +// TelemetryIngressEndpoint_ServerPubKey_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ServerPubKey' +type TelemetryIngressEndpoint_ServerPubKey_Call struct { + *mock.Call +} + +// ServerPubKey is a helper method to define mock.On call +func (_e *TelemetryIngressEndpoint_Expecter) ServerPubKey() *TelemetryIngressEndpoint_ServerPubKey_Call { + return &TelemetryIngressEndpoint_ServerPubKey_Call{Call: _e.mock.On("ServerPubKey")} +} + +func (_c *TelemetryIngressEndpoint_ServerPubKey_Call) Run(run func()) *TelemetryIngressEndpoint_ServerPubKey_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *TelemetryIngressEndpoint_ServerPubKey_Call) Return(_a0 string) *TelemetryIngressEndpoint_ServerPubKey_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *TelemetryIngressEndpoint_ServerPubKey_Call) RunAndReturn(run func() string) *TelemetryIngressEndpoint_ServerPubKey_Call { + _c.Call.Return(run) + return _c +} + // URL provides a mock function with given fields: func (_m *TelemetryIngressEndpoint) URL() *url.URL { ret := _m.Called() @@ -87,6 +176,33 @@ func (_m *TelemetryIngressEndpoint) URL() *url.URL { return r0 } +// TelemetryIngressEndpoint_URL_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'URL' +type TelemetryIngressEndpoint_URL_Call struct { + *mock.Call +} + +// URL is a helper method to define mock.On call +func (_e *TelemetryIngressEndpoint_Expecter) URL() *TelemetryIngressEndpoint_URL_Call { + return &TelemetryIngressEndpoint_URL_Call{Call: _e.mock.On("URL")} +} + +func (_c *TelemetryIngressEndpoint_URL_Call) Run(run func()) *TelemetryIngressEndpoint_URL_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *TelemetryIngressEndpoint_URL_Call) Return(_a0 *url.URL) *TelemetryIngressEndpoint_URL_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *TelemetryIngressEndpoint_URL_Call) RunAndReturn(run func() *url.URL) *TelemetryIngressEndpoint_URL_Call { + _c.Call.Return(run) + return _c +} + // NewTelemetryIngressEndpoint creates a new instance of TelemetryIngressEndpoint. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewTelemetryIngressEndpoint(t interface { diff --git a/core/config/telemetry_config.go b/core/config/telemetry_config.go new file mode 100644 index 00000000000..5440e70b43b --- /dev/null +++ b/core/config/telemetry_config.go @@ -0,0 +1,10 @@ +package config + +type Telemetry interface { + Enabled() bool + InsecureConnection() bool + CACertFile() string + OtelExporterGRPCEndpoint() string + ResourceAttributes() map[string]string + TraceSampleRatio() float64 +} diff --git a/core/config/telemetry_ingress_config.go b/core/config/telemetry_ingress_config.go index a4923391011..dde42c2d355 100644 --- a/core/config/telemetry_ingress_config.go +++ b/core/config/telemetry_ingress_config.go @@ -5,8 +5,6 @@ import ( "time" ) -//go:generate mockery --quiet --name TelemetryIngress --output ./mocks/ --case=underscore --filename telemetry_ingress.go - type TelemetryIngress interface { Logging() bool UniConn() bool @@ -18,7 +16,6 @@ type TelemetryIngress interface { Endpoints() []TelemetryIngressEndpoint } -//go:generate mockery --quiet --name TelemetryIngressEndpoint --output ./mocks/ --case=underscore --filename telemetry_ingress_endpoint.go type TelemetryIngressEndpoint interface { Network() string ChainID() string diff --git a/core/config/toml/types.go b/core/config/toml/types.go index f827f086225..497e33d5ddd 100644 --- a/core/config/toml/types.go +++ b/core/config/toml/types.go @@ -5,6 +5,7 @@ import ( "fmt" "net" "net/url" + "reflect" "regexp" "strings" @@ -25,6 +26,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/store/dialects" "github.com/smartcontractkit/chainlink/v2/core/store/models" "github.com/smartcontractkit/chainlink/v2/core/utils" + configutils "github.com/smartcontractkit/chainlink/v2/core/utils/config" ) @@ -57,6 +59,7 @@ type Core struct { Tracing Tracing `toml:",omitempty"` Mercury Mercury `toml:",omitempty"` Capabilities Capabilities `toml:",omitempty"` + Telemetry Telemetry `toml:",omitempty"` } // SetFrom updates c with any non-nil values from f. (currently TOML field only!) @@ -93,11 +96,12 @@ func (c *Core) SetFrom(f *Core) { c.Sentry.setFrom(&f.Sentry) c.Insecure.setFrom(&f.Insecure) c.Tracing.setFrom(&f.Tracing) + c.Telemetry.setFrom(&f.Telemetry) } func (c *Core) ValidateConfig() (err error) { _, verr := parse.HomeDir(*c.RootDir) - if err != nil { + if verr != nil { err = multierr.Append(err, configutils.ErrInvalid{Name: "RootDir", Value: true, Msg: fmt.Sprintf("Failed to expand RootDir. Please use an explicit path: %s", verr)}) } @@ -105,6 +109,12 @@ func (c *Core) ValidateConfig() (err error) { err = multierr.Append(err, configutils.ErrInvalid{Name: "P2P.V2.Enabled", Value: false, Msg: "P2P required for OCR or OCR2. Please enable P2P or disable OCR/OCR2."}) } + if *c.Tracing.Enabled && *c.Telemetry.Enabled { + if c.Tracing.CollectorTarget == c.Telemetry.Endpoint { + err = multierr.Append(err, configutils.ErrInvalid{Name: "Tracing.CollectorTarget", Value: *c.Tracing.CollectorTarget, Msg: "Same as Telemetry.Endpoint. Must be different or disabled."}) + } + } + return err } @@ -300,9 +310,11 @@ func (p *PrometheusSecrets) validateMerge(f *PrometheusSecrets) (err error) { } type Feature struct { - FeedsManager *bool - LogPoller *bool - UICSAKeys *bool + FeedsManager *bool + LogPoller *bool + UICSAKeys *bool + CCIP *bool + MultiFeedsManagers *bool } func (f *Feature) setFrom(f2 *Feature) { @@ -315,6 +327,12 @@ func (f *Feature) setFrom(f2 *Feature) { if v := f2.UICSAKeys; v != nil { f.UICSAKeys = v } + if v := f2.CCIP; v != nil { + f.CCIP = v + } + if v := f2.MultiFeedsManagers; v != nil { + f.MultiFeedsManagers = v + } } type Database struct { @@ -1430,14 +1448,103 @@ func (r *ExternalRegistry) setFrom(f *ExternalRegistry) { } } +type Dispatcher struct { + SupportedVersion *int + ReceiverBufferSize *int + RateLimit DispatcherRateLimit +} + +func (d *Dispatcher) setFrom(f *Dispatcher) { + d.RateLimit.setFrom(&f.RateLimit) + + if f.ReceiverBufferSize != nil { + d.ReceiverBufferSize = f.ReceiverBufferSize + } + + if f.SupportedVersion != nil { + d.SupportedVersion = f.SupportedVersion + } +} + +type DispatcherRateLimit struct { + GlobalRPS *float64 + GlobalBurst *int + PerSenderRPS *float64 + PerSenderBurst *int +} + +func (drl *DispatcherRateLimit) setFrom(f *DispatcherRateLimit) { + if f.GlobalRPS != nil { + drl.GlobalRPS = f.GlobalRPS + } + if f.GlobalBurst != nil { + drl.GlobalBurst = f.GlobalBurst + } + if f.PerSenderRPS != nil { + drl.PerSenderRPS = f.PerSenderRPS + } + if f.PerSenderBurst != nil { + drl.PerSenderBurst = f.PerSenderBurst + } +} + +type GatewayConnector struct { + ChainIDForNodeKey *string + NodeAddress *string + DonID *string + Gateways []ConnectorGateway + WSHandshakeTimeoutMillis *uint32 + AuthMinChallengeLen *int + AuthTimestampToleranceSec *uint32 +} + +func (r *GatewayConnector) setFrom(f *GatewayConnector) { + if f.ChainIDForNodeKey != nil { + r.ChainIDForNodeKey = f.ChainIDForNodeKey + } + + if f.NodeAddress != nil { + r.NodeAddress = f.NodeAddress + } + + if f.DonID != nil { + r.DonID = f.DonID + } + + if f.Gateways != nil { + r.Gateways = f.Gateways + } + + if !reflect.ValueOf(f.WSHandshakeTimeoutMillis).IsZero() { + r.WSHandshakeTimeoutMillis = f.WSHandshakeTimeoutMillis + } + + if f.AuthMinChallengeLen != nil { + r.AuthMinChallengeLen = f.AuthMinChallengeLen + } + + if f.AuthTimestampToleranceSec != nil { + r.AuthTimestampToleranceSec = f.AuthTimestampToleranceSec + } +} + +type ConnectorGateway struct { + ID *string + URL *string +} + type Capabilities struct { Peering P2P `toml:",omitempty"` + Dispatcher Dispatcher `toml:",omitempty"` ExternalRegistry ExternalRegistry `toml:",omitempty"` + GatewayConnector GatewayConnector `toml:",omitempty"` } func (c *Capabilities) setFrom(f *Capabilities) { c.Peering.setFrom(&f.Peering) c.ExternalRegistry.setFrom(&f.ExternalRegistry) + c.Dispatcher.setFrom(&f.Dispatcher) + c.GatewayConnector.setFrom(&f.GatewayConnector) } type ThresholdKeyShareSecrets struct { @@ -1477,25 +1584,25 @@ type Tracing struct { func (t *Tracing) setFrom(f *Tracing) { if v := f.Enabled; v != nil { - t.Enabled = f.Enabled + t.Enabled = v } if v := f.CollectorTarget; v != nil { - t.CollectorTarget = f.CollectorTarget + t.CollectorTarget = v } if v := f.NodeID; v != nil { - t.NodeID = f.NodeID + t.NodeID = v } if v := f.Attributes; v != nil { - t.Attributes = f.Attributes + t.Attributes = v } if v := f.SamplingRatio; v != nil { - t.SamplingRatio = f.SamplingRatio + t.SamplingRatio = v } if v := f.Mode; v != nil { - t.Mode = f.Mode + t.Mode = v } if v := f.TLSCertPath; v != nil { - t.TLSCertPath = f.TLSCertPath + t.TLSCertPath = v } } @@ -1549,6 +1656,59 @@ func (t *Tracing) ValidateConfig() (err error) { return err } +type Telemetry struct { + Enabled *bool + CACertFile *string + Endpoint *string + InsecureConnection *bool + ResourceAttributes map[string]string `toml:",omitempty"` + TraceSampleRatio *float64 +} + +func (b *Telemetry) setFrom(f *Telemetry) { + if v := f.Enabled; v != nil { + b.Enabled = v + } + if v := f.CACertFile; v != nil { + b.CACertFile = v + } + if v := f.Endpoint; v != nil { + b.Endpoint = v + } + if v := f.InsecureConnection; v != nil { + b.InsecureConnection = v + } + if v := f.ResourceAttributes; v != nil { + b.ResourceAttributes = v + } + if v := f.TraceSampleRatio; v != nil { + b.TraceSampleRatio = v + } +} + +func (b *Telemetry) ValidateConfig() (err error) { + if b.Enabled == nil || !*b.Enabled { + return nil + } + if b.Endpoint == nil || *b.Endpoint == "" { + err = multierr.Append(err, configutils.ErrMissing{Name: "Endpoint", Msg: "must be set when Telemetry is enabled"}) + } + if b.InsecureConnection != nil && *b.InsecureConnection { + if build.IsProd() { + err = multierr.Append(err, configutils.ErrInvalid{Name: "InsecureConnection", Value: true, Msg: "cannot be used in production builds"}) + } + } else { + if b.CACertFile == nil || *b.CACertFile == "" { + err = multierr.Append(err, configutils.ErrMissing{Name: "CACertFile", Msg: "must be set, unless InsecureConnection is used"}) + } + } + if ratio := b.TraceSampleRatio; ratio != nil && (*ratio < 0 || *ratio > 1) { + err = multierr.Append(err, configutils.ErrInvalid{Name: "TraceSampleRatio", Value: *ratio, Msg: "must be between 0 and 1"}) + } + + return err +} + var hostnameRegex = regexp.MustCompile(`^[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*$`) // Validates uri is valid external or local URI diff --git a/core/gethwrappers/ccip/deployment_test/deployment_test.go b/core/gethwrappers/ccip/deployment_test/deployment_test.go new file mode 100644 index 00000000000..c89ca239175 --- /dev/null +++ b/core/gethwrappers/ccip/deployment_test/deployment_test.go @@ -0,0 +1,97 @@ +package deploymenttest + +import ( + "math/big" + "testing" + "time" + + "github.com/ethereum/go-ethereum/accounts/abi/bind/backends" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core" + "github.com/stretchr/testify/require" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/fee_quoter" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/nonce_manager" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/offramp" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/onramp" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/router" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/token_admin_registry" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" +) + +// This tests ensures that all of the compiled contracts can be +// deployed to an actual blockchain (i.e no "max code size exceeded" errors). +// It does not attempt to correctly set up the contracts, so bogus inputs are used. +func TestDeployAllV1_6(t *testing.T) { + owner := testutils.MustNewSimTransactor(t) + chain := backends.NewSimulatedBackend(core.GenesisAlloc{ + owner.From: {Balance: assets.Ether(100).ToInt()}, + }, 30e6) + + // router + _, _, _, err := router.DeployRouter(owner, chain, common.HexToAddress("0x1"), common.HexToAddress("0x2")) + require.NoError(t, err) + chain.Commit() + + // nonce manager + _, _, _, err = nonce_manager.DeployNonceManager(owner, chain, []common.Address{common.HexToAddress("0x1")}) + require.NoError(t, err) + chain.Commit() + + // offramp + _, _, _, err = offramp.DeployOffRamp(owner, chain, offramp.OffRampStaticConfig{ + ChainSelector: 1, + Rmn: common.HexToAddress("0x1"), + TokenAdminRegistry: common.HexToAddress("0x2"), + NonceManager: common.HexToAddress("0x3"), + }, offramp.OffRampDynamicConfig{ + FeeQuoter: common.HexToAddress("0x4"), + PermissionLessExecutionThresholdSeconds: uint32((8 * time.Hour).Seconds()), + MaxTokenTransferGas: 50_000, + MaxPoolReleaseOrMintGas: 50_000, + MessageValidator: common.HexToAddress("0x5"), + }, nil) + require.NoError(t, err) + chain.Commit() + + // onramp + _, _, _, err = onramp.DeployOnRamp(owner, chain, onramp.OnRampStaticConfig{ + ChainSelector: 1, + Rmn: common.HexToAddress("0x1"), + NonceManager: common.HexToAddress("0x2"), + TokenAdminRegistry: common.HexToAddress("0x3"), + }, onramp.OnRampDynamicConfig{ + FeeQuoter: common.HexToAddress("0x4"), + MessageValidator: common.HexToAddress("0x5"), + FeeAggregator: common.HexToAddress("0x6"), + AllowListAdmin: common.HexToAddress("0x7"), + }, nil) + require.NoError(t, err) + chain.Commit() + + // fee quoter + _, _, _, err = fee_quoter.DeployFeeQuoter( + owner, + chain, + fee_quoter.FeeQuoterStaticConfig{ + MaxFeeJuelsPerMsg: big.NewInt(1e18), + LinkToken: common.HexToAddress("0x1"), + StalenessThreshold: 10, + }, + []common.Address{common.HexToAddress("0x1")}, + []common.Address{common.HexToAddress("0x2")}, + []fee_quoter.FeeQuoterTokenPriceFeedUpdate{}, + []fee_quoter.FeeQuoterTokenTransferFeeConfigArgs{}, + []fee_quoter.FeeQuoterPremiumMultiplierWeiPerEthArgs{}, + []fee_quoter.FeeQuoterDestChainConfigArgs{}) + require.NoError(t, err) + chain.Commit() + + // token admin registry + _, _, _, err = token_admin_registry.DeployTokenAdminRegistry(owner, chain) + require.NoError(t, err) + chain.Commit() + + // TODO: add rmn home and rmn remote +} diff --git a/core/gethwrappers/ccip/generated/burn_from_mint_token_pool/burn_from_mint_token_pool.go b/core/gethwrappers/ccip/generated/burn_from_mint_token_pool/burn_from_mint_token_pool.go new file mode 100644 index 00000000000..1553ba62b05 --- /dev/null +++ b/core/gethwrappers/ccip/generated/burn_from_mint_token_pool/burn_from_mint_token_pool.go @@ -0,0 +1,2818 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package burn_from_mint_token_pool + +import ( + "errors" + "fmt" + "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" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" +) + +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +type PoolLockOrBurnInV1 struct { + Receiver []byte + RemoteChainSelector uint64 + OriginalSender common.Address + Amount *big.Int + LocalToken common.Address +} + +type PoolLockOrBurnOutV1 struct { + DestTokenAddress []byte + DestPoolData []byte +} + +type PoolReleaseOrMintInV1 struct { + OriginalSender []byte + RemoteChainSelector uint64 + Receiver common.Address + Amount *big.Int + LocalToken common.Address + SourcePoolAddress []byte + SourcePoolData []byte + OffchainTokenData []byte +} + +type PoolReleaseOrMintOutV1 struct { + DestinationAmount *big.Int +} + +type RateLimiterConfig struct { + IsEnabled bool + Capacity *big.Int + Rate *big.Int +} + +type RateLimiterTokenBucket struct { + Tokens *big.Int + LastUpdated uint32 + IsEnabled bool + Capacity *big.Int + Rate *big.Int +} + +type TokenPoolChainUpdate struct { + RemoteChainSelector uint64 + Allowed bool + RemotePoolAddress []byte + RemoteTokenAddress []byte + OutboundRateLimiterConfig RateLimiterConfig + InboundRateLimiterConfig RateLimiterConfig +} + +var BurnFromMintTokenPoolMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"internalType\":\"contractIBurnMintERC20\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"allowlist\",\"type\":\"address[]\"},{\"internalType\":\"address\",\"name\":\"rmnProxy\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"router\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"capacity\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"requested\",\"type\":\"uint256\"}],\"name\":\"AggregateValueMaxCapacityExceeded\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"minWaitInSeconds\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"available\",\"type\":\"uint256\"}],\"name\":\"AggregateValueRateLimitReached\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"AllowListNotEnabled\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"BucketOverfilled\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"}],\"name\":\"CallerIsNotARampOnRouter\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"}],\"name\":\"ChainAlreadyExists\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"ChainNotAllowed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"CursedByRMN\",\"type\":\"error\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"config\",\"type\":\"tuple\"}],\"name\":\"DisabledNonZeroRateLimit\",\"type\":\"error\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"rateLimiterConfig\",\"type\":\"tuple\"}],\"name\":\"InvalidRateLimitRate\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"sourcePoolAddress\",\"type\":\"bytes\"}],\"name\":\"InvalidSourcePoolAddress\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"InvalidToken\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"NonExistentChain\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RateLimitMustBeDisabled\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"SenderNotAllowed\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"capacity\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"requested\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"}],\"name\":\"TokenMaxCapacityExceeded\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"minWaitInSeconds\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"available\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"}],\"name\":\"TokenRateLimitReached\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"}],\"name\":\"Unauthorized\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddressNotAllowed\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"AllowListAdd\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"AllowListRemove\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Burned\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"remoteToken\",\"type\":\"bytes\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"indexed\":false,\"internalType\":\"structRateLimiter.Config\",\"name\":\"outboundRateLimiterConfig\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"indexed\":false,\"internalType\":\"structRateLimiter.Config\",\"name\":\"inboundRateLimiterConfig\",\"type\":\"tuple\"}],\"name\":\"ChainAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"indexed\":false,\"internalType\":\"structRateLimiter.Config\",\"name\":\"outboundRateLimiterConfig\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"indexed\":false,\"internalType\":\"structRateLimiter.Config\",\"name\":\"inboundRateLimiterConfig\",\"type\":\"tuple\"}],\"name\":\"ChainConfigured\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"ChainRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"indexed\":false,\"internalType\":\"structRateLimiter.Config\",\"name\":\"config\",\"type\":\"tuple\"}],\"name\":\"ConfigChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Locked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Minted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Released\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"previousPoolAddress\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"remotePoolAddress\",\"type\":\"bytes\"}],\"name\":\"RemotePoolSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"oldRouter\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newRouter\",\"type\":\"address\"}],\"name\":\"RouterUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"}],\"name\":\"TokensConsumed\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"removes\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"adds\",\"type\":\"address[]\"}],\"name\":\"applyAllowListUpdates\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"bool\",\"name\":\"allowed\",\"type\":\"bool\"},{\"internalType\":\"bytes\",\"name\":\"remotePoolAddress\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"remoteTokenAddress\",\"type\":\"bytes\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"outboundRateLimiterConfig\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"inboundRateLimiterConfig\",\"type\":\"tuple\"}],\"internalType\":\"structTokenPool.ChainUpdate[]\",\"name\":\"chains\",\"type\":\"tuple[]\"}],\"name\":\"applyChainUpdates\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAllowList\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAllowListEnabled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"getCurrentInboundRateLimiterState\",\"outputs\":[{\"components\":[{\"internalType\":\"uint128\",\"name\":\"tokens\",\"type\":\"uint128\"},{\"internalType\":\"uint32\",\"name\":\"lastUpdated\",\"type\":\"uint32\"},{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.TokenBucket\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"getCurrentOutboundRateLimiterState\",\"outputs\":[{\"components\":[{\"internalType\":\"uint128\",\"name\":\"tokens\",\"type\":\"uint128\"},{\"internalType\":\"uint32\",\"name\":\"lastUpdated\",\"type\":\"uint32\"},{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.TokenBucket\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRateLimitAdmin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"getRemotePool\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"getRemoteToken\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRmnProxy\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"rmnProxy\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRouter\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"router\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getSupportedChains\",\"outputs\":[{\"internalType\":\"uint64[]\",\"name\":\"\",\"type\":\"uint64[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getToken\",\"outputs\":[{\"internalType\":\"contractIERC20\",\"name\":\"token\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"isSupportedChain\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"isSupportedToken\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes\",\"name\":\"receiver\",\"type\":\"bytes\"},{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"originalSender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"localToken\",\"type\":\"address\"}],\"internalType\":\"structPool.LockOrBurnInV1\",\"name\":\"lockOrBurnIn\",\"type\":\"tuple\"}],\"name\":\"lockOrBurn\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes\",\"name\":\"destTokenAddress\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"destPoolData\",\"type\":\"bytes\"}],\"internalType\":\"structPool.LockOrBurnOutV1\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes\",\"name\":\"originalSender\",\"type\":\"bytes\"},{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"localToken\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"sourcePoolAddress\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"sourcePoolData\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"offchainTokenData\",\"type\":\"bytes\"}],\"internalType\":\"structPool.ReleaseOrMintInV1\",\"name\":\"releaseOrMintIn\",\"type\":\"tuple\"}],\"name\":\"releaseOrMint\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"destinationAmount\",\"type\":\"uint256\"}],\"internalType\":\"structPool.ReleaseOrMintOutV1\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"outboundConfig\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"inboundConfig\",\"type\":\"tuple\"}],\"name\":\"setChainRateLimiterConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"rateLimitAdmin\",\"type\":\"address\"}],\"name\":\"setRateLimitAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"remotePoolAddress\",\"type\":\"bytes\"}],\"name\":\"setRemotePool\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newRouter\",\"type\":\"address\"}],\"name\":\"setRouter\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", + Bin: "0x60e06040523480156200001157600080fd5b506040516200450b3803806200450b8339810160408190526200003491620008c0565b8383838333806000816200008f5760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000c257620000c2816200018f565b5050506001600160a01b0384161580620000e357506001600160a01b038116155b80620000f657506001600160a01b038216155b1562000115576040516342bcdf7f60e11b815260040160405180910390fd5b6001600160a01b0384811660805282811660a052600480546001600160a01b031916918316919091179055825115801560c05262000168576040805160008152602081019091526200016890846200023a565b5062000185925050506001600160a01b0385163060001962000397565b5050505062000afc565b336001600160a01b03821603620001e95760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640162000086565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b60c0516200025b576040516335f4a7b360e01b815260040160405180910390fd5b60005b8251811015620002e65760008382815181106200027f576200027f620009d0565b60209081029190910101519050620002996002826200047d565b15620002dc576040516001600160a01b03821681527f800671136ab6cfee9fbe5ed1fb7ca417811aca3cf864800d127b927adedf75669060200160405180910390a15b506001016200025e565b5060005b8151811015620003925760008282815181106200030b576200030b620009d0565b6020026020010151905060006001600160a01b0316816001600160a01b03160362000337575062000389565b620003446002826200049d565b1562000387576040516001600160a01b03821681527f2640d4d76caf8bf478aabfa982fa4e1c4eb71a37f93cd15e80dbc657911546d89060200160405180910390a15b505b600101620002ea565b505050565b604051636eb1769f60e11b81523060048201526001600160a01b038381166024830152600091839186169063dd62ed3e90604401602060405180830381865afa158015620003e9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200040f9190620009e6565b6200041b919062000a16565b604080516001600160a01b038616602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b0390811663095ea7b360e01b179091529192506200047791869190620004b416565b50505050565b600062000494836001600160a01b03841662000585565b90505b92915050565b600062000494836001600160a01b03841662000689565b6040805180820190915260208082527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65649082015260009062000503906001600160a01b038516908490620006db565b80519091501562000392578080602001905181019062000524919062000a2c565b620003925760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840162000086565b600081815260018301602052604081205480156200067e576000620005ac60018362000a57565b8554909150600090620005c29060019062000a57565b90508082146200062e576000866000018281548110620005e657620005e6620009d0565b90600052602060002001549050808760000184815481106200060c576200060c620009d0565b6000918252602080832090910192909255918252600188019052604090208390555b855486908062000642576200064262000a6d565b60019003818190600052602060002001600090559055856001016000868152602001908152602001600020600090556001935050505062000497565b600091505062000497565b6000818152600183016020526040812054620006d25750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915562000497565b50600062000497565b6060620006ec8484600085620006f4565b949350505050565b606082471015620007575760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840162000086565b600080866001600160a01b0316858760405162000775919062000aa9565b60006040518083038185875af1925050503d8060008114620007b4576040519150601f19603f3d011682016040523d82523d6000602084013e620007b9565b606091505b509092509050620007cd87838387620007d8565b979650505050505050565b606083156200084c57825160000362000844576001600160a01b0385163b620008445760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640162000086565b5081620006ec565b620006ec8383815115620008635781518083602001fd5b8060405162461bcd60e51b815260040162000086919062000ac7565b6001600160a01b03811681146200089557600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b8051620008bb816200087f565b919050565b60008060008060808587031215620008d757600080fd5b8451620008e4816200087f565b602086810151919550906001600160401b03808211156200090457600080fd5b818801915088601f8301126200091957600080fd5b8151818111156200092e576200092e62000898565b8060051b604051601f19603f8301168101818110858211171562000956576200095662000898565b60405291825284820192508381018501918b8311156200097557600080fd5b938501935b828510156200099e576200098e85620008ae565b845293850193928501926200097a565b809850505050505050620009b560408601620008ae565b9150620009c560608601620008ae565b905092959194509250565b634e487b7160e01b600052603260045260246000fd5b600060208284031215620009f957600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b8082018082111562000497576200049762000a00565b60006020828403121562000a3f57600080fd5b8151801515811462000a5057600080fd5b9392505050565b8181038181111562000497576200049762000a00565b634e487b7160e01b600052603160045260246000fd5b60005b8381101562000aa057818101518382015260200162000a86565b50506000910152565b6000825162000abd81846020870162000a83565b9190910192915050565b602081526000825180602084015262000ae881604085016020870162000a83565b601f01601f19169190910160400192915050565b60805160a05160c05161399262000b79600039600081816104dd01528181611777015261215b0152600081816104b7015281816115a80152611a2d0152600081816102390152818161028e015281816106e0015281816114c80152818161194d01528181611b45015281816120f1015261234601526139926000f3fe608060405234801561001057600080fd5b50600436106101ae5760003560e01c80639a4575b9116100ee578063c4bffe2b11610097578063db6327dc11610071578063db6327dc146104a2578063dc0bd971146104b5578063e0351e13146104db578063f2fde38b1461050157600080fd5b8063c4bffe2b14610467578063c75eea9c1461047c578063cf7401f31461048f57600080fd5b8063b0f479a1116100c8578063b0f479a114610423578063b794658014610441578063c0d786551461045457600080fd5b80639a4575b91461037f578063a7cd63b71461039f578063af58d59f146103b457600080fd5b806354c8a4f31161015b57806379ba50971161013557806379ba5097146103335780637d54534e1461033b5780638926f54f1461034e5780638da5cb5b1461036157600080fd5b806354c8a4f3146102ed5780636d3d1a581461030257806378a010b21461032057600080fd5b806321df0da71161018c57806321df0da714610237578063240028e81461027e57806339077537146102cb57600080fd5b806301ffc9a7146101b35780630a2fd493146101db578063181f5a77146101fb575b600080fd5b6101c66101c1366004612ae9565b610514565b60405190151581526020015b60405180910390f35b6101ee6101e9366004612b48565b6105f9565b6040516101d29190612bc7565b6101ee6040518060400160405280601b81526020017f4275726e46726f6d4d696e74546f6b656e506f6f6c20312e352e30000000000081525081565b7f00000000000000000000000000000000000000000000000000000000000000005b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101d2565b6101c661028c366004612c07565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff90811691161490565b6102de6102d9366004612c24565b6106a9565b604051905181526020016101d2565b6103006102fb366004612cac565b61082f565b005b60085473ffffffffffffffffffffffffffffffffffffffff16610259565b61030061032e366004612d18565b6108aa565b610300610a1e565b610300610349366004612c07565b610b1b565b6101c661035c366004612b48565b610b6a565b60005473ffffffffffffffffffffffffffffffffffffffff16610259565b61039261038d366004612d9b565b610b81565b6040516101d29190612dd6565b6103a7610c28565b6040516101d29190612e36565b6103c76103c2366004612b48565b610c39565b6040516101d2919081516fffffffffffffffffffffffffffffffff908116825260208084015163ffffffff1690830152604080840151151590830152606080840151821690830152608092830151169181019190915260a00190565b60045473ffffffffffffffffffffffffffffffffffffffff16610259565b6101ee61044f366004612b48565b610d0e565b610300610462366004612c07565b610d39565b61046f610e14565b6040516101d29190612e90565b6103c761048a366004612b48565b610ecc565b61030061049d366004612ff8565b610f9e565b6103006104b036600461303d565b611027565b7f0000000000000000000000000000000000000000000000000000000000000000610259565b7f00000000000000000000000000000000000000000000000000000000000000006101c6565b61030061050f366004612c07565b6114ad565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167faff2afbf0000000000000000000000000000000000000000000000000000000014806105a757507fffffffff0000000000000000000000000000000000000000000000000000000082167f0e64dd2900000000000000000000000000000000000000000000000000000000145b806105f357507fffffffff0000000000000000000000000000000000000000000000000000000082167f01ffc9a700000000000000000000000000000000000000000000000000000000145b92915050565b67ffffffffffffffff811660009081526007602052604090206004018054606091906106249061307f565b80601f01602080910402602001604051908101604052809291908181526020018280546106509061307f565b801561069d5780601f106106725761010080835404028352916020019161069d565b820191906000526020600020905b81548152906001019060200180831161068057829003601f168201915b50505050509050919050565b6040805160208101909152600081526106c96106c48361317d565b6114c1565b73ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000166340c10f196107156060850160408601612c07565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b16815273ffffffffffffffffffffffffffffffffffffffff909116600482015260608501356024820152604401600060405180830381600087803b15801561078557600080fd5b505af1158015610799573d6000803e3d6000fd5b506107ae925050506060830160408401612c07565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f9d228d69b5fdb8d273a2336f8fb8612d039631024ea9bf09c424a9503aa078f0846060013560405161081091815260200190565b60405180910390a3506040805160208101909152606090910135815290565b6108376116f2565b6108a48484808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152505060408051602080880282810182019093528782529093508792508691829185019084908082843760009201919091525061177592505050565b50505050565b6108b26116f2565b6108bb83610b6a565b610902576040517f1e670e4b00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff841660048201526024015b60405180910390fd5b67ffffffffffffffff8316600090815260076020526040812060040180546109299061307f565b80601f01602080910402602001604051908101604052809291908181526020018280546109559061307f565b80156109a25780601f10610977576101008083540402835291602001916109a2565b820191906000526020600020905b81548152906001019060200180831161098557829003601f168201915b5050505067ffffffffffffffff86166000908152600760205260409020919250506004016109d18385836132c2565b508367ffffffffffffffff167fdb4d6220746a38cbc5335f7e108f7de80f482f4d23350253dfd0917df75a14bf828585604051610a10939291906133dc565b60405180910390a250505050565b60015473ffffffffffffffffffffffffffffffffffffffff163314610a9f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e65720000000000000000000060448201526064016108f9565b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b610b236116f2565b600880547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60006105f3600567ffffffffffffffff841661192b565b6040805180820190915260608082526020820152610ba6610ba183613440565b611946565b610bb38260600135611b10565b6040516060830135815233907f696de425f79f4a40bc6d2122ca50507f0efbeabbff86a84871b7196ab8ea8df79060200160405180910390a26040518060400160405280610c0d84602001602081019061044f9190612b48565b81526040805160208181019092526000815291015292915050565b6060610c346002611bb9565b905090565b6040805160a08101825260008082526020820181905291810182905260608101829052608081019190915267ffffffffffffffff8216600090815260076020908152604091829020825160a08101845260028201546fffffffffffffffffffffffffffffffff808216835270010000000000000000000000000000000080830463ffffffff16958401959095527401000000000000000000000000000000000000000090910460ff1615159482019490945260039091015480841660608301529190910490911660808201526105f390611bc6565b67ffffffffffffffff811660009081526007602052604090206005018054606091906106249061307f565b610d416116f2565b73ffffffffffffffffffffffffffffffffffffffff8116610d8e576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6004805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff000000000000000000000000000000000000000083168117909355604080519190921680825260208201939093527f02dc5c233404867c793b749c6d644beb2277536d18a7e7974d3f238e4c6f1684910160405180910390a15050565b60606000610e226005611bb9565b90506000815167ffffffffffffffff811115610e4057610e40612ed2565b604051908082528060200260200182016040528015610e69578160200160208202803683370190505b50905060005b8251811015610ec557828181518110610e8a57610e8a6134e2565b6020026020010151828281518110610ea457610ea46134e2565b67ffffffffffffffff90921660209283029190910190910152600101610e6f565b5092915050565b6040805160a08101825260008082526020820181905291810182905260608101829052608081019190915267ffffffffffffffff8216600090815260076020908152604091829020825160a08101845281546fffffffffffffffffffffffffffffffff808216835270010000000000000000000000000000000080830463ffffffff16958401959095527401000000000000000000000000000000000000000090910460ff1615159482019490945260019091015480841660608301529190910490911660808201526105f390611bc6565b60085473ffffffffffffffffffffffffffffffffffffffff163314801590610fde575060005473ffffffffffffffffffffffffffffffffffffffff163314155b15611017576040517f8e4a23d60000000000000000000000000000000000000000000000000000000081523360048201526024016108f9565b611022838383611c78565b505050565b61102f6116f2565b60005b8181101561102257600083838381811061104e5761104e6134e2565b90506020028101906110609190613511565b6110699061354f565b905061107e8160800151826020015115611d62565b6110918160a00151826020015115611d62565b80602001511561138d5780516110b39060059067ffffffffffffffff16611e9b565b6110f85780516040517f1d5ad3c500000000000000000000000000000000000000000000000000000000815267ffffffffffffffff90911660048201526024016108f9565b604081015151158061110d5750606081015151155b15611144576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040805161012081018252608083810180516020908101516fffffffffffffffffffffffffffffffff9081168486019081524263ffffffff90811660a0808901829052865151151560c08a01528651860151851660e08a015295518901518416610100890152918752875180860189529489018051850151841686528585019290925281515115158589015281518401518316606080870191909152915188015183168587015283870194855288880151878901908152828a015183890152895167ffffffffffffffff1660009081526007865289902088518051825482890151838e01519289167fffffffffffffffffffffffff0000000000000000000000000000000000000000928316177001000000000000000000000000000000009188168202177fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff90811674010000000000000000000000000000000000000000941515850217865584890151948d0151948a16948a168202949094176001860155995180516002860180549b8301519f830151918b169b9093169a909a179d9096168a029c909c179091169615150295909517909855908101519401519381169316909102919091176003820155915190919060048201906113259082613603565b506060820151600582019061133a9082613603565b505081516060830151608084015160a08501516040517f8d340f17e19058004c20453540862a9c62778504476f6756755cb33bcd6c38c29550611380949392919061371d565b60405180910390a16114a4565b80516113a59060059067ffffffffffffffff16611ea7565b6113ea5780516040517f1e670e4b00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff90911660048201526024016108f9565b805167ffffffffffffffff16600090815260076020526040812080547fffffffffffffffffffffff000000000000000000000000000000000000000000908116825560018201839055600282018054909116905560038101829055906114536004830182612a9b565b611461600583016000612a9b565b5050805160405167ffffffffffffffff90911681527f5204aec90a3c794d8e90fded8b46ae9c7c552803e7e832e0c1d358396d8599169060200160405180910390a15b50600101611032565b6114b56116f2565b6114be81611eb3565b50565b60808101517f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff9081169116146115565760808101516040517f961c9a4f00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff90911660048201526024016108f9565b60208101516040517f2cbc26bb00000000000000000000000000000000000000000000000000000000815260809190911b77ffffffffffffffff000000000000000000000000000000001660048201527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1690632cbc26bb90602401602060405180830381865afa158015611604573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061162891906137b6565b1561165f576040517f53ad11d800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61166c8160200151611fa8565b600061167b82602001516105f9565b905080516000148061169f575080805190602001208260a001518051906020012014155b156116dc578160a001516040517f24eb47e50000000000000000000000000000000000000000000000000000000081526004016108f99190612bc7565b6116ee826020015183606001516120ce565b5050565b60005473ffffffffffffffffffffffffffffffffffffffff163314611773576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e65720000000000000000000060448201526064016108f9565b565b7f00000000000000000000000000000000000000000000000000000000000000006117cc576040517f35f4a7b300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b82518110156118625760008382815181106117ec576117ec6134e2565b6020026020010151905061180a81600261211590919063ffffffff16565b156118595760405173ffffffffffffffffffffffffffffffffffffffff821681527f800671136ab6cfee9fbe5ed1fb7ca417811aca3cf864800d127b927adedf75669060200160405180910390a15b506001016117cf565b5060005b8151811015611022576000828281518110611883576118836134e2565b60200260200101519050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036118c75750611923565b6118d2600282612137565b156119215760405173ffffffffffffffffffffffffffffffffffffffff821681527f2640d4d76caf8bf478aabfa982fa4e1c4eb71a37f93cd15e80dbc657911546d89060200160405180910390a15b505b600101611866565b600081815260018301602052604081205415155b9392505050565b60808101517f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff9081169116146119db5760808101516040517f961c9a4f00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff90911660048201526024016108f9565b60208101516040517f2cbc26bb00000000000000000000000000000000000000000000000000000000815260809190911b77ffffffffffffffff000000000000000000000000000000001660048201527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1690632cbc26bb90602401602060405180830381865afa158015611a89573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611aad91906137b6565b15611ae4576040517f53ad11d800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611af18160400151612159565b611afe81602001516121d8565b6114be81602001518260600151612326565b6040517f79cc6790000000000000000000000000000000000000000000000000000000008152306004820152602481018290527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16906379cc679090604401600060405180830381600087803b158015611b9e57600080fd5b505af1158015611bb2573d6000803e3d6000fd5b5050505050565b6060600061193f8361236a565b6040805160a081018252600080825260208201819052918101829052606081018290526080810191909152611c5482606001516fffffffffffffffffffffffffffffffff1683600001516fffffffffffffffffffffffffffffffff16846020015163ffffffff1642611c389190613802565b85608001516fffffffffffffffffffffffffffffffff166123c5565b6fffffffffffffffffffffffffffffffff1682525063ffffffff4216602082015290565b611c8183610b6a565b611cc3576040517f1e670e4b00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff841660048201526024016108f9565b611cce826000611d62565b67ffffffffffffffff83166000908152600760205260409020611cf190836123ef565b611cfc816000611d62565b67ffffffffffffffff83166000908152600760205260409020611d2290600201826123ef565b7f0350d63aa5f270e01729d00d627eeb8f3429772b1818c016c66a588a864f912b838383604051611d5593929190613815565b60405180910390a1505050565b815115611e295781602001516fffffffffffffffffffffffffffffffff1682604001516fffffffffffffffffffffffffffffffff16101580611db8575060408201516fffffffffffffffffffffffffffffffff16155b15611df157816040517f8020d1240000000000000000000000000000000000000000000000000000000081526004016108f99190613898565b80156116ee576040517f433fc33d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60408201516fffffffffffffffffffffffffffffffff16151580611e62575060208201516fffffffffffffffffffffffffffffffff1615155b156116ee57816040517fd68af9cc0000000000000000000000000000000000000000000000000000000081526004016108f99190613898565b600061193f8383612591565b600061193f83836125e0565b3373ffffffffffffffffffffffffffffffffffffffff821603611f32576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c6600000000000000000060448201526064016108f9565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b611fb181610b6a565b611ff3576040517fa9902c7e00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff821660048201526024016108f9565b600480546040517f83826b2b00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff84169281019290925233602483015273ffffffffffffffffffffffffffffffffffffffff16906383826b2b90604401602060405180830381865afa158015612072573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061209691906137b6565b6114be576040517f728fe07b0000000000000000000000000000000000000000000000000000000081523360048201526024016108f9565b67ffffffffffffffff821660009081526007602052604090206116ee90600201827f00000000000000000000000000000000000000000000000000000000000000006126d3565b600061193f8373ffffffffffffffffffffffffffffffffffffffff84166125e0565b600061193f8373ffffffffffffffffffffffffffffffffffffffff8416612591565b7f0000000000000000000000000000000000000000000000000000000000000000156114be5761218a600282612a56565b6114be576040517fd0d2597600000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff821660048201526024016108f9565b6121e181610b6a565b612223576040517fa9902c7e00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff821660048201526024016108f9565b600480546040517fa8d87a3b00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff84169281019290925273ffffffffffffffffffffffffffffffffffffffff169063a8d87a3b90602401602060405180830381865afa15801561229c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122c091906138d4565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146114be576040517f728fe07b0000000000000000000000000000000000000000000000000000000081523360048201526024016108f9565b67ffffffffffffffff821660009081526007602052604090206116ee90827f00000000000000000000000000000000000000000000000000000000000000006126d3565b60608160000180548060200260200160405190810160405280929190818152602001828054801561069d57602002820191906000526020600020905b8154815260200190600101908083116123a65750505050509050919050565b60006123e4856123d584866138f1565b6123df9087613908565b612a85565b90505b949350505050565b815460009061241890700100000000000000000000000000000000900463ffffffff1642613802565b905080156124ba5760018301548354612460916fffffffffffffffffffffffffffffffff808216928116918591700100000000000000000000000000000000909104166123c5565b83546fffffffffffffffffffffffffffffffff919091167fffffffffffffffffffffffff0000000000000000000000000000000000000000909116177001000000000000000000000000000000004263ffffffff16021783555b602082015183546124e0916fffffffffffffffffffffffffffffffff9081169116612a85565b83548351151574010000000000000000000000000000000000000000027fffffffffffffffffffffff00ffffffff000000000000000000000000000000009091166fffffffffffffffffffffffffffffffff92831617178455602083015160408085015183167001000000000000000000000000000000000291909216176001850155517f9ea3374b67bf275e6bb9c8ae68f9cae023e1c528b4b27e092f0bb209d3531c1990611d55908490613898565b60008181526001830160205260408120546125d8575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556105f3565b5060006105f3565b600081815260018301602052604081205480156126c9576000612604600183613802565b855490915060009061261890600190613802565b905080821461267d576000866000018281548110612638576126386134e2565b906000526020600020015490508087600001848154811061265b5761265b6134e2565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061268e5761268e61391b565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506105f3565b60009150506105f3565b825474010000000000000000000000000000000000000000900460ff1615806126fa575081155b1561270457505050565b825460018401546fffffffffffffffffffffffffffffffff8083169291169060009061274a90700100000000000000000000000000000000900463ffffffff1642613802565b9050801561280a578183111561278c576040517f9725942a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60018601546127c69083908590849070010000000000000000000000000000000090046fffffffffffffffffffffffffffffffff166123c5565b86547fffffffffffffffffffffffff00000000ffffffffffffffffffffffffffffffff167001000000000000000000000000000000004263ffffffff160217875592505b848210156128c15773ffffffffffffffffffffffffffffffffffffffff8416612869576040517ff94ebcd100000000000000000000000000000000000000000000000000000000815260048101839052602481018690526044016108f9565b6040517f1a76572a000000000000000000000000000000000000000000000000000000008152600481018390526024810186905273ffffffffffffffffffffffffffffffffffffffff851660448201526064016108f9565b848310156129d45760018681015470010000000000000000000000000000000090046fffffffffffffffffffffffffffffffff169060009082906129059082613802565b61290f878a613802565b6129199190613908565b612923919061394a565b905073ffffffffffffffffffffffffffffffffffffffff861661297c576040517f15279c0800000000000000000000000000000000000000000000000000000000815260048101829052602481018690526044016108f9565b6040517fd0c8d23a000000000000000000000000000000000000000000000000000000008152600481018290526024810186905273ffffffffffffffffffffffffffffffffffffffff871660448201526064016108f9565b6129de8584613802565b86547fffffffffffffffffffffffffffffffff00000000000000000000000000000000166fffffffffffffffffffffffffffffffff82161787556040518681529093507f1871cdf8010e63f2eb8384381a68dfa7416dc571a5517e66e88b2d2d0c0a690a9060200160405180910390a1505050505050565b73ffffffffffffffffffffffffffffffffffffffff81166000908152600183016020526040812054151561193f565b6000818310612a94578161193f565b5090919050565b508054612aa79061307f565b6000825580601f10612ab7575050565b601f0160209004906000526020600020908101906114be91905b80821115612ae55760008155600101612ad1565b5090565b600060208284031215612afb57600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461193f57600080fd5b803567ffffffffffffffff81168114612b4357600080fd5b919050565b600060208284031215612b5a57600080fd5b61193f82612b2b565b6000815180845260005b81811015612b8957602081850181015186830182015201612b6d565b5060006020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b60208152600061193f6020830184612b63565b73ffffffffffffffffffffffffffffffffffffffff811681146114be57600080fd5b8035612b4381612bda565b600060208284031215612c1957600080fd5b813561193f81612bda565b600060208284031215612c3657600080fd5b813567ffffffffffffffff811115612c4d57600080fd5b8201610100818503121561193f57600080fd5b60008083601f840112612c7257600080fd5b50813567ffffffffffffffff811115612c8a57600080fd5b6020830191508360208260051b8501011115612ca557600080fd5b9250929050565b60008060008060408587031215612cc257600080fd5b843567ffffffffffffffff80821115612cda57600080fd5b612ce688838901612c60565b90965094506020870135915080821115612cff57600080fd5b50612d0c87828801612c60565b95989497509550505050565b600080600060408486031215612d2d57600080fd5b612d3684612b2b565b9250602084013567ffffffffffffffff80821115612d5357600080fd5b818601915086601f830112612d6757600080fd5b813581811115612d7657600080fd5b876020828501011115612d8857600080fd5b6020830194508093505050509250925092565b600060208284031215612dad57600080fd5b813567ffffffffffffffff811115612dc457600080fd5b820160a0818503121561193f57600080fd5b602081526000825160406020840152612df26060840182612b63565b905060208401517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0848303016040850152612e2d8282612b63565b95945050505050565b6020808252825182820181905260009190848201906040850190845b81811015612e8457835173ffffffffffffffffffffffffffffffffffffffff1683529284019291840191600101612e52565b50909695505050505050565b6020808252825182820181905260009190848201906040850190845b81811015612e8457835167ffffffffffffffff1683529284019291840191600101612eac565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051610100810167ffffffffffffffff81118282101715612f2557612f25612ed2565b60405290565b60405160c0810167ffffffffffffffff81118282101715612f2557612f25612ed2565b80151581146114be57600080fd5b8035612b4381612f4e565b80356fffffffffffffffffffffffffffffffff81168114612b4357600080fd5b600060608284031215612f9957600080fd5b6040516060810181811067ffffffffffffffff82111715612fbc57612fbc612ed2565b6040529050808235612fcd81612f4e565b8152612fdb60208401612f67565b6020820152612fec60408401612f67565b60408201525092915050565b600080600060e0848603121561300d57600080fd5b61301684612b2b565b92506130258560208601612f87565b91506130348560808601612f87565b90509250925092565b6000806020838503121561305057600080fd5b823567ffffffffffffffff81111561306757600080fd5b61307385828601612c60565b90969095509350505050565b600181811c9082168061309357607f821691505b6020821081036130cc577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b600082601f8301126130e357600080fd5b813567ffffffffffffffff808211156130fe576130fe612ed2565b604051601f83017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810190828211818310171561314457613144612ed2565b8160405283815286602085880101111561315d57600080fd5b836020870160208301376000602085830101528094505050505092915050565b6000610100823603121561319057600080fd5b613198612f01565b823567ffffffffffffffff808211156131b057600080fd5b6131bc368387016130d2565b83526131ca60208601612b2b565b60208401526131db60408601612bfc565b6040840152606085013560608401526131f660808601612bfc565b608084015260a085013591508082111561320f57600080fd5b61321b368387016130d2565b60a084015260c085013591508082111561323457600080fd5b613240368387016130d2565b60c084015260e085013591508082111561325957600080fd5b50613266368286016130d2565b60e08301525092915050565b601f821115611022576000816000526020600020601f850160051c8101602086101561329b5750805b601f850160051c820191505b818110156132ba578281556001016132a7565b505050505050565b67ffffffffffffffff8311156132da576132da612ed2565b6132ee836132e8835461307f565b83613272565b6000601f841160018114613340576000851561330a5750838201355b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600387901b1c1916600186901b178355611bb2565b6000838152602090207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0861690835b8281101561338f578685013582556020948501946001909201910161336f565b50868210156133ca577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60f88860031b161c19848701351681555b505060018560011b0183555050505050565b6040815260006133ef6040830186612b63565b82810360208401528381528385602083013760006020858301015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f860116820101915050949350505050565b600060a0823603121561345257600080fd5b60405160a0810167ffffffffffffffff828210818311171561347657613476612ed2565b81604052843591508082111561348b57600080fd5b50613498368286016130d2565b8252506134a760208401612b2b565b602082015260408301356134ba81612bda565b60408201526060838101359082015260808301356134d781612bda565b608082015292915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600082357ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec183360301811261354557600080fd5b9190910192915050565b6000610140823603121561356257600080fd5b61356a612f2b565b61357383612b2b565b815261358160208401612f5c565b6020820152604083013567ffffffffffffffff808211156135a157600080fd5b6135ad368387016130d2565b604084015260608501359150808211156135c657600080fd5b506135d3368286016130d2565b6060830152506135e63660808501612f87565b60808201526135f83660e08501612f87565b60a082015292915050565b815167ffffffffffffffff81111561361d5761361d612ed2565b6136318161362b845461307f565b84613272565b602080601f831160018114613684576000841561364e5750858301515b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600386901b1c1916600185901b1785556132ba565b6000858152602081207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08616915b828110156136d1578886015182559484019460019091019084016136b2565b508582101561370d57878501517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600388901b60f8161c191681555b5050505050600190811b01905550565b600061010067ffffffffffffffff8716835280602084015261374181840187612b63565b8551151560408581019190915260208701516fffffffffffffffffffffffffffffffff908116606087015290870151166080850152915061377f9050565b8251151560a083015260208301516fffffffffffffffffffffffffffffffff90811660c084015260408401511660e0830152612e2d565b6000602082840312156137c857600080fd5b815161193f81612f4e565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b818103818111156105f3576105f36137d3565b67ffffffffffffffff8416815260e0810161386160208301858051151582526020808201516fffffffffffffffffffffffffffffffff9081169184019190915260409182015116910152565b82511515608083015260208301516fffffffffffffffffffffffffffffffff90811660a084015260408401511660c08301526123e7565b606081016105f382848051151582526020808201516fffffffffffffffffffffffffffffffff9081169184019190915260409182015116910152565b6000602082840312156138e657600080fd5b815161193f81612bda565b80820281158282048414176105f3576105f36137d3565b808201808211156105f3576105f36137d3565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b600082613980577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b50049056fea164736f6c6343000818000a", +} + +var BurnFromMintTokenPoolABI = BurnFromMintTokenPoolMetaData.ABI + +var BurnFromMintTokenPoolBin = BurnFromMintTokenPoolMetaData.Bin + +func DeployBurnFromMintTokenPool(auth *bind.TransactOpts, backend bind.ContractBackend, token common.Address, allowlist []common.Address, rmnProxy common.Address, router common.Address) (common.Address, *types.Transaction, *BurnFromMintTokenPool, error) { + parsed, err := BurnFromMintTokenPoolMetaData.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(BurnFromMintTokenPoolBin), backend, token, allowlist, rmnProxy, router) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &BurnFromMintTokenPool{address: address, abi: *parsed, BurnFromMintTokenPoolCaller: BurnFromMintTokenPoolCaller{contract: contract}, BurnFromMintTokenPoolTransactor: BurnFromMintTokenPoolTransactor{contract: contract}, BurnFromMintTokenPoolFilterer: BurnFromMintTokenPoolFilterer{contract: contract}}, nil +} + +type BurnFromMintTokenPool struct { + address common.Address + abi abi.ABI + BurnFromMintTokenPoolCaller + BurnFromMintTokenPoolTransactor + BurnFromMintTokenPoolFilterer +} + +type BurnFromMintTokenPoolCaller struct { + contract *bind.BoundContract +} + +type BurnFromMintTokenPoolTransactor struct { + contract *bind.BoundContract +} + +type BurnFromMintTokenPoolFilterer struct { + contract *bind.BoundContract +} + +type BurnFromMintTokenPoolSession struct { + Contract *BurnFromMintTokenPool + CallOpts bind.CallOpts + TransactOpts bind.TransactOpts +} + +type BurnFromMintTokenPoolCallerSession struct { + Contract *BurnFromMintTokenPoolCaller + CallOpts bind.CallOpts +} + +type BurnFromMintTokenPoolTransactorSession struct { + Contract *BurnFromMintTokenPoolTransactor + TransactOpts bind.TransactOpts +} + +type BurnFromMintTokenPoolRaw struct { + Contract *BurnFromMintTokenPool +} + +type BurnFromMintTokenPoolCallerRaw struct { + Contract *BurnFromMintTokenPoolCaller +} + +type BurnFromMintTokenPoolTransactorRaw struct { + Contract *BurnFromMintTokenPoolTransactor +} + +func NewBurnFromMintTokenPool(address common.Address, backend bind.ContractBackend) (*BurnFromMintTokenPool, error) { + abi, err := abi.JSON(strings.NewReader(BurnFromMintTokenPoolABI)) + if err != nil { + return nil, err + } + contract, err := bindBurnFromMintTokenPool(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &BurnFromMintTokenPool{address: address, abi: abi, BurnFromMintTokenPoolCaller: BurnFromMintTokenPoolCaller{contract: contract}, BurnFromMintTokenPoolTransactor: BurnFromMintTokenPoolTransactor{contract: contract}, BurnFromMintTokenPoolFilterer: BurnFromMintTokenPoolFilterer{contract: contract}}, nil +} + +func NewBurnFromMintTokenPoolCaller(address common.Address, caller bind.ContractCaller) (*BurnFromMintTokenPoolCaller, error) { + contract, err := bindBurnFromMintTokenPool(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &BurnFromMintTokenPoolCaller{contract: contract}, nil +} + +func NewBurnFromMintTokenPoolTransactor(address common.Address, transactor bind.ContractTransactor) (*BurnFromMintTokenPoolTransactor, error) { + contract, err := bindBurnFromMintTokenPool(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &BurnFromMintTokenPoolTransactor{contract: contract}, nil +} + +func NewBurnFromMintTokenPoolFilterer(address common.Address, filterer bind.ContractFilterer) (*BurnFromMintTokenPoolFilterer, error) { + contract, err := bindBurnFromMintTokenPool(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &BurnFromMintTokenPoolFilterer{contract: contract}, nil +} + +func bindBurnFromMintTokenPool(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := BurnFromMintTokenPoolMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _BurnFromMintTokenPool.Contract.BurnFromMintTokenPoolCaller.contract.Call(opts, result, method, params...) +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _BurnFromMintTokenPool.Contract.BurnFromMintTokenPoolTransactor.contract.Transfer(opts) +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _BurnFromMintTokenPool.Contract.BurnFromMintTokenPoolTransactor.contract.Transact(opts, method, params...) +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _BurnFromMintTokenPool.Contract.contract.Call(opts, result, method, params...) +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _BurnFromMintTokenPool.Contract.contract.Transfer(opts) +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _BurnFromMintTokenPool.Contract.contract.Transact(opts, method, params...) +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolCaller) GetAllowList(opts *bind.CallOpts) ([]common.Address, error) { + var out []interface{} + err := _BurnFromMintTokenPool.contract.Call(opts, &out, "getAllowList") + + if err != nil { + return *new([]common.Address), err + } + + out0 := *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) + + return out0, err + +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolSession) GetAllowList() ([]common.Address, error) { + return _BurnFromMintTokenPool.Contract.GetAllowList(&_BurnFromMintTokenPool.CallOpts) +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolCallerSession) GetAllowList() ([]common.Address, error) { + return _BurnFromMintTokenPool.Contract.GetAllowList(&_BurnFromMintTokenPool.CallOpts) +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolCaller) GetAllowListEnabled(opts *bind.CallOpts) (bool, error) { + var out []interface{} + err := _BurnFromMintTokenPool.contract.Call(opts, &out, "getAllowListEnabled") + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolSession) GetAllowListEnabled() (bool, error) { + return _BurnFromMintTokenPool.Contract.GetAllowListEnabled(&_BurnFromMintTokenPool.CallOpts) +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolCallerSession) GetAllowListEnabled() (bool, error) { + return _BurnFromMintTokenPool.Contract.GetAllowListEnabled(&_BurnFromMintTokenPool.CallOpts) +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolCaller) GetCurrentInboundRateLimiterState(opts *bind.CallOpts, remoteChainSelector uint64) (RateLimiterTokenBucket, error) { + var out []interface{} + err := _BurnFromMintTokenPool.contract.Call(opts, &out, "getCurrentInboundRateLimiterState", remoteChainSelector) + + if err != nil { + return *new(RateLimiterTokenBucket), err + } + + out0 := *abi.ConvertType(out[0], new(RateLimiterTokenBucket)).(*RateLimiterTokenBucket) + + return out0, err + +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolSession) GetCurrentInboundRateLimiterState(remoteChainSelector uint64) (RateLimiterTokenBucket, error) { + return _BurnFromMintTokenPool.Contract.GetCurrentInboundRateLimiterState(&_BurnFromMintTokenPool.CallOpts, remoteChainSelector) +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolCallerSession) GetCurrentInboundRateLimiterState(remoteChainSelector uint64) (RateLimiterTokenBucket, error) { + return _BurnFromMintTokenPool.Contract.GetCurrentInboundRateLimiterState(&_BurnFromMintTokenPool.CallOpts, remoteChainSelector) +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolCaller) GetCurrentOutboundRateLimiterState(opts *bind.CallOpts, remoteChainSelector uint64) (RateLimiterTokenBucket, error) { + var out []interface{} + err := _BurnFromMintTokenPool.contract.Call(opts, &out, "getCurrentOutboundRateLimiterState", remoteChainSelector) + + if err != nil { + return *new(RateLimiterTokenBucket), err + } + + out0 := *abi.ConvertType(out[0], new(RateLimiterTokenBucket)).(*RateLimiterTokenBucket) + + return out0, err + +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolSession) GetCurrentOutboundRateLimiterState(remoteChainSelector uint64) (RateLimiterTokenBucket, error) { + return _BurnFromMintTokenPool.Contract.GetCurrentOutboundRateLimiterState(&_BurnFromMintTokenPool.CallOpts, remoteChainSelector) +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolCallerSession) GetCurrentOutboundRateLimiterState(remoteChainSelector uint64) (RateLimiterTokenBucket, error) { + return _BurnFromMintTokenPool.Contract.GetCurrentOutboundRateLimiterState(&_BurnFromMintTokenPool.CallOpts, remoteChainSelector) +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolCaller) GetRateLimitAdmin(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _BurnFromMintTokenPool.contract.Call(opts, &out, "getRateLimitAdmin") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolSession) GetRateLimitAdmin() (common.Address, error) { + return _BurnFromMintTokenPool.Contract.GetRateLimitAdmin(&_BurnFromMintTokenPool.CallOpts) +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolCallerSession) GetRateLimitAdmin() (common.Address, error) { + return _BurnFromMintTokenPool.Contract.GetRateLimitAdmin(&_BurnFromMintTokenPool.CallOpts) +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolCaller) GetRemotePool(opts *bind.CallOpts, remoteChainSelector uint64) ([]byte, error) { + var out []interface{} + err := _BurnFromMintTokenPool.contract.Call(opts, &out, "getRemotePool", remoteChainSelector) + + if err != nil { + return *new([]byte), err + } + + out0 := *abi.ConvertType(out[0], new([]byte)).(*[]byte) + + return out0, err + +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolSession) GetRemotePool(remoteChainSelector uint64) ([]byte, error) { + return _BurnFromMintTokenPool.Contract.GetRemotePool(&_BurnFromMintTokenPool.CallOpts, remoteChainSelector) +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolCallerSession) GetRemotePool(remoteChainSelector uint64) ([]byte, error) { + return _BurnFromMintTokenPool.Contract.GetRemotePool(&_BurnFromMintTokenPool.CallOpts, remoteChainSelector) +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolCaller) GetRemoteToken(opts *bind.CallOpts, remoteChainSelector uint64) ([]byte, error) { + var out []interface{} + err := _BurnFromMintTokenPool.contract.Call(opts, &out, "getRemoteToken", remoteChainSelector) + + if err != nil { + return *new([]byte), err + } + + out0 := *abi.ConvertType(out[0], new([]byte)).(*[]byte) + + return out0, err + +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolSession) GetRemoteToken(remoteChainSelector uint64) ([]byte, error) { + return _BurnFromMintTokenPool.Contract.GetRemoteToken(&_BurnFromMintTokenPool.CallOpts, remoteChainSelector) +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolCallerSession) GetRemoteToken(remoteChainSelector uint64) ([]byte, error) { + return _BurnFromMintTokenPool.Contract.GetRemoteToken(&_BurnFromMintTokenPool.CallOpts, remoteChainSelector) +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolCaller) GetRmnProxy(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _BurnFromMintTokenPool.contract.Call(opts, &out, "getRmnProxy") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolSession) GetRmnProxy() (common.Address, error) { + return _BurnFromMintTokenPool.Contract.GetRmnProxy(&_BurnFromMintTokenPool.CallOpts) +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolCallerSession) GetRmnProxy() (common.Address, error) { + return _BurnFromMintTokenPool.Contract.GetRmnProxy(&_BurnFromMintTokenPool.CallOpts) +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolCaller) GetRouter(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _BurnFromMintTokenPool.contract.Call(opts, &out, "getRouter") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolSession) GetRouter() (common.Address, error) { + return _BurnFromMintTokenPool.Contract.GetRouter(&_BurnFromMintTokenPool.CallOpts) +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolCallerSession) GetRouter() (common.Address, error) { + return _BurnFromMintTokenPool.Contract.GetRouter(&_BurnFromMintTokenPool.CallOpts) +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolCaller) GetSupportedChains(opts *bind.CallOpts) ([]uint64, error) { + var out []interface{} + err := _BurnFromMintTokenPool.contract.Call(opts, &out, "getSupportedChains") + + if err != nil { + return *new([]uint64), err + } + + out0 := *abi.ConvertType(out[0], new([]uint64)).(*[]uint64) + + return out0, err + +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolSession) GetSupportedChains() ([]uint64, error) { + return _BurnFromMintTokenPool.Contract.GetSupportedChains(&_BurnFromMintTokenPool.CallOpts) +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolCallerSession) GetSupportedChains() ([]uint64, error) { + return _BurnFromMintTokenPool.Contract.GetSupportedChains(&_BurnFromMintTokenPool.CallOpts) +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolCaller) GetToken(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _BurnFromMintTokenPool.contract.Call(opts, &out, "getToken") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolSession) GetToken() (common.Address, error) { + return _BurnFromMintTokenPool.Contract.GetToken(&_BurnFromMintTokenPool.CallOpts) +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolCallerSession) GetToken() (common.Address, error) { + return _BurnFromMintTokenPool.Contract.GetToken(&_BurnFromMintTokenPool.CallOpts) +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolCaller) IsSupportedChain(opts *bind.CallOpts, remoteChainSelector uint64) (bool, error) { + var out []interface{} + err := _BurnFromMintTokenPool.contract.Call(opts, &out, "isSupportedChain", remoteChainSelector) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolSession) IsSupportedChain(remoteChainSelector uint64) (bool, error) { + return _BurnFromMintTokenPool.Contract.IsSupportedChain(&_BurnFromMintTokenPool.CallOpts, remoteChainSelector) +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolCallerSession) IsSupportedChain(remoteChainSelector uint64) (bool, error) { + return _BurnFromMintTokenPool.Contract.IsSupportedChain(&_BurnFromMintTokenPool.CallOpts, remoteChainSelector) +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolCaller) IsSupportedToken(opts *bind.CallOpts, token common.Address) (bool, error) { + var out []interface{} + err := _BurnFromMintTokenPool.contract.Call(opts, &out, "isSupportedToken", token) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolSession) IsSupportedToken(token common.Address) (bool, error) { + return _BurnFromMintTokenPool.Contract.IsSupportedToken(&_BurnFromMintTokenPool.CallOpts, token) +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolCallerSession) IsSupportedToken(token common.Address) (bool, error) { + return _BurnFromMintTokenPool.Contract.IsSupportedToken(&_BurnFromMintTokenPool.CallOpts, token) +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolCaller) Owner(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _BurnFromMintTokenPool.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 + +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolSession) Owner() (common.Address, error) { + return _BurnFromMintTokenPool.Contract.Owner(&_BurnFromMintTokenPool.CallOpts) +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolCallerSession) Owner() (common.Address, error) { + return _BurnFromMintTokenPool.Contract.Owner(&_BurnFromMintTokenPool.CallOpts) +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolCaller) SupportsInterface(opts *bind.CallOpts, interfaceId [4]byte) (bool, error) { + var out []interface{} + err := _BurnFromMintTokenPool.contract.Call(opts, &out, "supportsInterface", interfaceId) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolSession) SupportsInterface(interfaceId [4]byte) (bool, error) { + return _BurnFromMintTokenPool.Contract.SupportsInterface(&_BurnFromMintTokenPool.CallOpts, interfaceId) +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolCallerSession) SupportsInterface(interfaceId [4]byte) (bool, error) { + return _BurnFromMintTokenPool.Contract.SupportsInterface(&_BurnFromMintTokenPool.CallOpts, interfaceId) +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolCaller) TypeAndVersion(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _BurnFromMintTokenPool.contract.Call(opts, &out, "typeAndVersion") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolSession) TypeAndVersion() (string, error) { + return _BurnFromMintTokenPool.Contract.TypeAndVersion(&_BurnFromMintTokenPool.CallOpts) +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolCallerSession) TypeAndVersion() (string, error) { + return _BurnFromMintTokenPool.Contract.TypeAndVersion(&_BurnFromMintTokenPool.CallOpts) +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolTransactor) AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + return _BurnFromMintTokenPool.contract.Transact(opts, "acceptOwnership") +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolSession) AcceptOwnership() (*types.Transaction, error) { + return _BurnFromMintTokenPool.Contract.AcceptOwnership(&_BurnFromMintTokenPool.TransactOpts) +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolTransactorSession) AcceptOwnership() (*types.Transaction, error) { + return _BurnFromMintTokenPool.Contract.AcceptOwnership(&_BurnFromMintTokenPool.TransactOpts) +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolTransactor) ApplyAllowListUpdates(opts *bind.TransactOpts, removes []common.Address, adds []common.Address) (*types.Transaction, error) { + return _BurnFromMintTokenPool.contract.Transact(opts, "applyAllowListUpdates", removes, adds) +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolSession) ApplyAllowListUpdates(removes []common.Address, adds []common.Address) (*types.Transaction, error) { + return _BurnFromMintTokenPool.Contract.ApplyAllowListUpdates(&_BurnFromMintTokenPool.TransactOpts, removes, adds) +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolTransactorSession) ApplyAllowListUpdates(removes []common.Address, adds []common.Address) (*types.Transaction, error) { + return _BurnFromMintTokenPool.Contract.ApplyAllowListUpdates(&_BurnFromMintTokenPool.TransactOpts, removes, adds) +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolTransactor) ApplyChainUpdates(opts *bind.TransactOpts, chains []TokenPoolChainUpdate) (*types.Transaction, error) { + return _BurnFromMintTokenPool.contract.Transact(opts, "applyChainUpdates", chains) +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolSession) ApplyChainUpdates(chains []TokenPoolChainUpdate) (*types.Transaction, error) { + return _BurnFromMintTokenPool.Contract.ApplyChainUpdates(&_BurnFromMintTokenPool.TransactOpts, chains) +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolTransactorSession) ApplyChainUpdates(chains []TokenPoolChainUpdate) (*types.Transaction, error) { + return _BurnFromMintTokenPool.Contract.ApplyChainUpdates(&_BurnFromMintTokenPool.TransactOpts, chains) +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolTransactor) LockOrBurn(opts *bind.TransactOpts, lockOrBurnIn PoolLockOrBurnInV1) (*types.Transaction, error) { + return _BurnFromMintTokenPool.contract.Transact(opts, "lockOrBurn", lockOrBurnIn) +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolSession) LockOrBurn(lockOrBurnIn PoolLockOrBurnInV1) (*types.Transaction, error) { + return _BurnFromMintTokenPool.Contract.LockOrBurn(&_BurnFromMintTokenPool.TransactOpts, lockOrBurnIn) +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolTransactorSession) LockOrBurn(lockOrBurnIn PoolLockOrBurnInV1) (*types.Transaction, error) { + return _BurnFromMintTokenPool.Contract.LockOrBurn(&_BurnFromMintTokenPool.TransactOpts, lockOrBurnIn) +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolTransactor) ReleaseOrMint(opts *bind.TransactOpts, releaseOrMintIn PoolReleaseOrMintInV1) (*types.Transaction, error) { + return _BurnFromMintTokenPool.contract.Transact(opts, "releaseOrMint", releaseOrMintIn) +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolSession) ReleaseOrMint(releaseOrMintIn PoolReleaseOrMintInV1) (*types.Transaction, error) { + return _BurnFromMintTokenPool.Contract.ReleaseOrMint(&_BurnFromMintTokenPool.TransactOpts, releaseOrMintIn) +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolTransactorSession) ReleaseOrMint(releaseOrMintIn PoolReleaseOrMintInV1) (*types.Transaction, error) { + return _BurnFromMintTokenPool.Contract.ReleaseOrMint(&_BurnFromMintTokenPool.TransactOpts, releaseOrMintIn) +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolTransactor) SetChainRateLimiterConfig(opts *bind.TransactOpts, remoteChainSelector uint64, outboundConfig RateLimiterConfig, inboundConfig RateLimiterConfig) (*types.Transaction, error) { + return _BurnFromMintTokenPool.contract.Transact(opts, "setChainRateLimiterConfig", remoteChainSelector, outboundConfig, inboundConfig) +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolSession) SetChainRateLimiterConfig(remoteChainSelector uint64, outboundConfig RateLimiterConfig, inboundConfig RateLimiterConfig) (*types.Transaction, error) { + return _BurnFromMintTokenPool.Contract.SetChainRateLimiterConfig(&_BurnFromMintTokenPool.TransactOpts, remoteChainSelector, outboundConfig, inboundConfig) +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolTransactorSession) SetChainRateLimiterConfig(remoteChainSelector uint64, outboundConfig RateLimiterConfig, inboundConfig RateLimiterConfig) (*types.Transaction, error) { + return _BurnFromMintTokenPool.Contract.SetChainRateLimiterConfig(&_BurnFromMintTokenPool.TransactOpts, remoteChainSelector, outboundConfig, inboundConfig) +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolTransactor) SetRateLimitAdmin(opts *bind.TransactOpts, rateLimitAdmin common.Address) (*types.Transaction, error) { + return _BurnFromMintTokenPool.contract.Transact(opts, "setRateLimitAdmin", rateLimitAdmin) +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolSession) SetRateLimitAdmin(rateLimitAdmin common.Address) (*types.Transaction, error) { + return _BurnFromMintTokenPool.Contract.SetRateLimitAdmin(&_BurnFromMintTokenPool.TransactOpts, rateLimitAdmin) +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolTransactorSession) SetRateLimitAdmin(rateLimitAdmin common.Address) (*types.Transaction, error) { + return _BurnFromMintTokenPool.Contract.SetRateLimitAdmin(&_BurnFromMintTokenPool.TransactOpts, rateLimitAdmin) +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolTransactor) SetRemotePool(opts *bind.TransactOpts, remoteChainSelector uint64, remotePoolAddress []byte) (*types.Transaction, error) { + return _BurnFromMintTokenPool.contract.Transact(opts, "setRemotePool", remoteChainSelector, remotePoolAddress) +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolSession) SetRemotePool(remoteChainSelector uint64, remotePoolAddress []byte) (*types.Transaction, error) { + return _BurnFromMintTokenPool.Contract.SetRemotePool(&_BurnFromMintTokenPool.TransactOpts, remoteChainSelector, remotePoolAddress) +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolTransactorSession) SetRemotePool(remoteChainSelector uint64, remotePoolAddress []byte) (*types.Transaction, error) { + return _BurnFromMintTokenPool.Contract.SetRemotePool(&_BurnFromMintTokenPool.TransactOpts, remoteChainSelector, remotePoolAddress) +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolTransactor) SetRouter(opts *bind.TransactOpts, newRouter common.Address) (*types.Transaction, error) { + return _BurnFromMintTokenPool.contract.Transact(opts, "setRouter", newRouter) +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolSession) SetRouter(newRouter common.Address) (*types.Transaction, error) { + return _BurnFromMintTokenPool.Contract.SetRouter(&_BurnFromMintTokenPool.TransactOpts, newRouter) +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolTransactorSession) SetRouter(newRouter common.Address) (*types.Transaction, error) { + return _BurnFromMintTokenPool.Contract.SetRouter(&_BurnFromMintTokenPool.TransactOpts, newRouter) +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolTransactor) TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) { + return _BurnFromMintTokenPool.contract.Transact(opts, "transferOwnership", to) +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolSession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _BurnFromMintTokenPool.Contract.TransferOwnership(&_BurnFromMintTokenPool.TransactOpts, to) +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolTransactorSession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _BurnFromMintTokenPool.Contract.TransferOwnership(&_BurnFromMintTokenPool.TransactOpts, to) +} + +type BurnFromMintTokenPoolAllowListAddIterator struct { + Event *BurnFromMintTokenPoolAllowListAdd + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *BurnFromMintTokenPoolAllowListAddIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(BurnFromMintTokenPoolAllowListAdd) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(BurnFromMintTokenPoolAllowListAdd) + 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() + } +} + +func (it *BurnFromMintTokenPoolAllowListAddIterator) Error() error { + return it.fail +} + +func (it *BurnFromMintTokenPoolAllowListAddIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type BurnFromMintTokenPoolAllowListAdd struct { + Sender common.Address + Raw types.Log +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolFilterer) FilterAllowListAdd(opts *bind.FilterOpts) (*BurnFromMintTokenPoolAllowListAddIterator, error) { + + logs, sub, err := _BurnFromMintTokenPool.contract.FilterLogs(opts, "AllowListAdd") + if err != nil { + return nil, err + } + return &BurnFromMintTokenPoolAllowListAddIterator{contract: _BurnFromMintTokenPool.contract, event: "AllowListAdd", logs: logs, sub: sub}, nil +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolFilterer) WatchAllowListAdd(opts *bind.WatchOpts, sink chan<- *BurnFromMintTokenPoolAllowListAdd) (event.Subscription, error) { + + logs, sub, err := _BurnFromMintTokenPool.contract.WatchLogs(opts, "AllowListAdd") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(BurnFromMintTokenPoolAllowListAdd) + if err := _BurnFromMintTokenPool.contract.UnpackLog(event, "AllowListAdd", 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 +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolFilterer) ParseAllowListAdd(log types.Log) (*BurnFromMintTokenPoolAllowListAdd, error) { + event := new(BurnFromMintTokenPoolAllowListAdd) + if err := _BurnFromMintTokenPool.contract.UnpackLog(event, "AllowListAdd", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type BurnFromMintTokenPoolAllowListRemoveIterator struct { + Event *BurnFromMintTokenPoolAllowListRemove + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *BurnFromMintTokenPoolAllowListRemoveIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(BurnFromMintTokenPoolAllowListRemove) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(BurnFromMintTokenPoolAllowListRemove) + 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() + } +} + +func (it *BurnFromMintTokenPoolAllowListRemoveIterator) Error() error { + return it.fail +} + +func (it *BurnFromMintTokenPoolAllowListRemoveIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type BurnFromMintTokenPoolAllowListRemove struct { + Sender common.Address + Raw types.Log +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolFilterer) FilterAllowListRemove(opts *bind.FilterOpts) (*BurnFromMintTokenPoolAllowListRemoveIterator, error) { + + logs, sub, err := _BurnFromMintTokenPool.contract.FilterLogs(opts, "AllowListRemove") + if err != nil { + return nil, err + } + return &BurnFromMintTokenPoolAllowListRemoveIterator{contract: _BurnFromMintTokenPool.contract, event: "AllowListRemove", logs: logs, sub: sub}, nil +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolFilterer) WatchAllowListRemove(opts *bind.WatchOpts, sink chan<- *BurnFromMintTokenPoolAllowListRemove) (event.Subscription, error) { + + logs, sub, err := _BurnFromMintTokenPool.contract.WatchLogs(opts, "AllowListRemove") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(BurnFromMintTokenPoolAllowListRemove) + if err := _BurnFromMintTokenPool.contract.UnpackLog(event, "AllowListRemove", 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 +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolFilterer) ParseAllowListRemove(log types.Log) (*BurnFromMintTokenPoolAllowListRemove, error) { + event := new(BurnFromMintTokenPoolAllowListRemove) + if err := _BurnFromMintTokenPool.contract.UnpackLog(event, "AllowListRemove", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type BurnFromMintTokenPoolBurnedIterator struct { + Event *BurnFromMintTokenPoolBurned + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *BurnFromMintTokenPoolBurnedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(BurnFromMintTokenPoolBurned) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(BurnFromMintTokenPoolBurned) + 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() + } +} + +func (it *BurnFromMintTokenPoolBurnedIterator) Error() error { + return it.fail +} + +func (it *BurnFromMintTokenPoolBurnedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type BurnFromMintTokenPoolBurned struct { + Sender common.Address + Amount *big.Int + Raw types.Log +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolFilterer) FilterBurned(opts *bind.FilterOpts, sender []common.Address) (*BurnFromMintTokenPoolBurnedIterator, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _BurnFromMintTokenPool.contract.FilterLogs(opts, "Burned", senderRule) + if err != nil { + return nil, err + } + return &BurnFromMintTokenPoolBurnedIterator{contract: _BurnFromMintTokenPool.contract, event: "Burned", logs: logs, sub: sub}, nil +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolFilterer) WatchBurned(opts *bind.WatchOpts, sink chan<- *BurnFromMintTokenPoolBurned, sender []common.Address) (event.Subscription, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _BurnFromMintTokenPool.contract.WatchLogs(opts, "Burned", senderRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(BurnFromMintTokenPoolBurned) + if err := _BurnFromMintTokenPool.contract.UnpackLog(event, "Burned", 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 +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolFilterer) ParseBurned(log types.Log) (*BurnFromMintTokenPoolBurned, error) { + event := new(BurnFromMintTokenPoolBurned) + if err := _BurnFromMintTokenPool.contract.UnpackLog(event, "Burned", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type BurnFromMintTokenPoolChainAddedIterator struct { + Event *BurnFromMintTokenPoolChainAdded + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *BurnFromMintTokenPoolChainAddedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(BurnFromMintTokenPoolChainAdded) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(BurnFromMintTokenPoolChainAdded) + 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() + } +} + +func (it *BurnFromMintTokenPoolChainAddedIterator) Error() error { + return it.fail +} + +func (it *BurnFromMintTokenPoolChainAddedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type BurnFromMintTokenPoolChainAdded struct { + RemoteChainSelector uint64 + RemoteToken []byte + OutboundRateLimiterConfig RateLimiterConfig + InboundRateLimiterConfig RateLimiterConfig + Raw types.Log +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolFilterer) FilterChainAdded(opts *bind.FilterOpts) (*BurnFromMintTokenPoolChainAddedIterator, error) { + + logs, sub, err := _BurnFromMintTokenPool.contract.FilterLogs(opts, "ChainAdded") + if err != nil { + return nil, err + } + return &BurnFromMintTokenPoolChainAddedIterator{contract: _BurnFromMintTokenPool.contract, event: "ChainAdded", logs: logs, sub: sub}, nil +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolFilterer) WatchChainAdded(opts *bind.WatchOpts, sink chan<- *BurnFromMintTokenPoolChainAdded) (event.Subscription, error) { + + logs, sub, err := _BurnFromMintTokenPool.contract.WatchLogs(opts, "ChainAdded") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(BurnFromMintTokenPoolChainAdded) + if err := _BurnFromMintTokenPool.contract.UnpackLog(event, "ChainAdded", 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 +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolFilterer) ParseChainAdded(log types.Log) (*BurnFromMintTokenPoolChainAdded, error) { + event := new(BurnFromMintTokenPoolChainAdded) + if err := _BurnFromMintTokenPool.contract.UnpackLog(event, "ChainAdded", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type BurnFromMintTokenPoolChainConfiguredIterator struct { + Event *BurnFromMintTokenPoolChainConfigured + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *BurnFromMintTokenPoolChainConfiguredIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(BurnFromMintTokenPoolChainConfigured) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(BurnFromMintTokenPoolChainConfigured) + 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() + } +} + +func (it *BurnFromMintTokenPoolChainConfiguredIterator) Error() error { + return it.fail +} + +func (it *BurnFromMintTokenPoolChainConfiguredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type BurnFromMintTokenPoolChainConfigured struct { + RemoteChainSelector uint64 + OutboundRateLimiterConfig RateLimiterConfig + InboundRateLimiterConfig RateLimiterConfig + Raw types.Log +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolFilterer) FilterChainConfigured(opts *bind.FilterOpts) (*BurnFromMintTokenPoolChainConfiguredIterator, error) { + + logs, sub, err := _BurnFromMintTokenPool.contract.FilterLogs(opts, "ChainConfigured") + if err != nil { + return nil, err + } + return &BurnFromMintTokenPoolChainConfiguredIterator{contract: _BurnFromMintTokenPool.contract, event: "ChainConfigured", logs: logs, sub: sub}, nil +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolFilterer) WatchChainConfigured(opts *bind.WatchOpts, sink chan<- *BurnFromMintTokenPoolChainConfigured) (event.Subscription, error) { + + logs, sub, err := _BurnFromMintTokenPool.contract.WatchLogs(opts, "ChainConfigured") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(BurnFromMintTokenPoolChainConfigured) + if err := _BurnFromMintTokenPool.contract.UnpackLog(event, "ChainConfigured", 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 +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolFilterer) ParseChainConfigured(log types.Log) (*BurnFromMintTokenPoolChainConfigured, error) { + event := new(BurnFromMintTokenPoolChainConfigured) + if err := _BurnFromMintTokenPool.contract.UnpackLog(event, "ChainConfigured", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type BurnFromMintTokenPoolChainRemovedIterator struct { + Event *BurnFromMintTokenPoolChainRemoved + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *BurnFromMintTokenPoolChainRemovedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(BurnFromMintTokenPoolChainRemoved) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(BurnFromMintTokenPoolChainRemoved) + 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() + } +} + +func (it *BurnFromMintTokenPoolChainRemovedIterator) Error() error { + return it.fail +} + +func (it *BurnFromMintTokenPoolChainRemovedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type BurnFromMintTokenPoolChainRemoved struct { + RemoteChainSelector uint64 + Raw types.Log +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolFilterer) FilterChainRemoved(opts *bind.FilterOpts) (*BurnFromMintTokenPoolChainRemovedIterator, error) { + + logs, sub, err := _BurnFromMintTokenPool.contract.FilterLogs(opts, "ChainRemoved") + if err != nil { + return nil, err + } + return &BurnFromMintTokenPoolChainRemovedIterator{contract: _BurnFromMintTokenPool.contract, event: "ChainRemoved", logs: logs, sub: sub}, nil +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolFilterer) WatchChainRemoved(opts *bind.WatchOpts, sink chan<- *BurnFromMintTokenPoolChainRemoved) (event.Subscription, error) { + + logs, sub, err := _BurnFromMintTokenPool.contract.WatchLogs(opts, "ChainRemoved") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(BurnFromMintTokenPoolChainRemoved) + if err := _BurnFromMintTokenPool.contract.UnpackLog(event, "ChainRemoved", 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 +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolFilterer) ParseChainRemoved(log types.Log) (*BurnFromMintTokenPoolChainRemoved, error) { + event := new(BurnFromMintTokenPoolChainRemoved) + if err := _BurnFromMintTokenPool.contract.UnpackLog(event, "ChainRemoved", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type BurnFromMintTokenPoolConfigChangedIterator struct { + Event *BurnFromMintTokenPoolConfigChanged + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *BurnFromMintTokenPoolConfigChangedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(BurnFromMintTokenPoolConfigChanged) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(BurnFromMintTokenPoolConfigChanged) + 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() + } +} + +func (it *BurnFromMintTokenPoolConfigChangedIterator) Error() error { + return it.fail +} + +func (it *BurnFromMintTokenPoolConfigChangedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type BurnFromMintTokenPoolConfigChanged struct { + Config RateLimiterConfig + Raw types.Log +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolFilterer) FilterConfigChanged(opts *bind.FilterOpts) (*BurnFromMintTokenPoolConfigChangedIterator, error) { + + logs, sub, err := _BurnFromMintTokenPool.contract.FilterLogs(opts, "ConfigChanged") + if err != nil { + return nil, err + } + return &BurnFromMintTokenPoolConfigChangedIterator{contract: _BurnFromMintTokenPool.contract, event: "ConfigChanged", logs: logs, sub: sub}, nil +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolFilterer) WatchConfigChanged(opts *bind.WatchOpts, sink chan<- *BurnFromMintTokenPoolConfigChanged) (event.Subscription, error) { + + logs, sub, err := _BurnFromMintTokenPool.contract.WatchLogs(opts, "ConfigChanged") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(BurnFromMintTokenPoolConfigChanged) + if err := _BurnFromMintTokenPool.contract.UnpackLog(event, "ConfigChanged", 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 +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolFilterer) ParseConfigChanged(log types.Log) (*BurnFromMintTokenPoolConfigChanged, error) { + event := new(BurnFromMintTokenPoolConfigChanged) + if err := _BurnFromMintTokenPool.contract.UnpackLog(event, "ConfigChanged", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type BurnFromMintTokenPoolLockedIterator struct { + Event *BurnFromMintTokenPoolLocked + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *BurnFromMintTokenPoolLockedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(BurnFromMintTokenPoolLocked) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(BurnFromMintTokenPoolLocked) + 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() + } +} + +func (it *BurnFromMintTokenPoolLockedIterator) Error() error { + return it.fail +} + +func (it *BurnFromMintTokenPoolLockedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type BurnFromMintTokenPoolLocked struct { + Sender common.Address + Amount *big.Int + Raw types.Log +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolFilterer) FilterLocked(opts *bind.FilterOpts, sender []common.Address) (*BurnFromMintTokenPoolLockedIterator, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _BurnFromMintTokenPool.contract.FilterLogs(opts, "Locked", senderRule) + if err != nil { + return nil, err + } + return &BurnFromMintTokenPoolLockedIterator{contract: _BurnFromMintTokenPool.contract, event: "Locked", logs: logs, sub: sub}, nil +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolFilterer) WatchLocked(opts *bind.WatchOpts, sink chan<- *BurnFromMintTokenPoolLocked, sender []common.Address) (event.Subscription, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _BurnFromMintTokenPool.contract.WatchLogs(opts, "Locked", senderRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(BurnFromMintTokenPoolLocked) + if err := _BurnFromMintTokenPool.contract.UnpackLog(event, "Locked", 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 +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolFilterer) ParseLocked(log types.Log) (*BurnFromMintTokenPoolLocked, error) { + event := new(BurnFromMintTokenPoolLocked) + if err := _BurnFromMintTokenPool.contract.UnpackLog(event, "Locked", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type BurnFromMintTokenPoolMintedIterator struct { + Event *BurnFromMintTokenPoolMinted + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *BurnFromMintTokenPoolMintedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(BurnFromMintTokenPoolMinted) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(BurnFromMintTokenPoolMinted) + 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() + } +} + +func (it *BurnFromMintTokenPoolMintedIterator) Error() error { + return it.fail +} + +func (it *BurnFromMintTokenPoolMintedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type BurnFromMintTokenPoolMinted struct { + Sender common.Address + Recipient common.Address + Amount *big.Int + Raw types.Log +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolFilterer) FilterMinted(opts *bind.FilterOpts, sender []common.Address, recipient []common.Address) (*BurnFromMintTokenPoolMintedIterator, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + var recipientRule []interface{} + for _, recipientItem := range recipient { + recipientRule = append(recipientRule, recipientItem) + } + + logs, sub, err := _BurnFromMintTokenPool.contract.FilterLogs(opts, "Minted", senderRule, recipientRule) + if err != nil { + return nil, err + } + return &BurnFromMintTokenPoolMintedIterator{contract: _BurnFromMintTokenPool.contract, event: "Minted", logs: logs, sub: sub}, nil +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolFilterer) WatchMinted(opts *bind.WatchOpts, sink chan<- *BurnFromMintTokenPoolMinted, sender []common.Address, recipient []common.Address) (event.Subscription, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + var recipientRule []interface{} + for _, recipientItem := range recipient { + recipientRule = append(recipientRule, recipientItem) + } + + logs, sub, err := _BurnFromMintTokenPool.contract.WatchLogs(opts, "Minted", senderRule, recipientRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(BurnFromMintTokenPoolMinted) + if err := _BurnFromMintTokenPool.contract.UnpackLog(event, "Minted", 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 +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolFilterer) ParseMinted(log types.Log) (*BurnFromMintTokenPoolMinted, error) { + event := new(BurnFromMintTokenPoolMinted) + if err := _BurnFromMintTokenPool.contract.UnpackLog(event, "Minted", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type BurnFromMintTokenPoolOwnershipTransferRequestedIterator struct { + Event *BurnFromMintTokenPoolOwnershipTransferRequested + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *BurnFromMintTokenPoolOwnershipTransferRequestedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(BurnFromMintTokenPoolOwnershipTransferRequested) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(BurnFromMintTokenPoolOwnershipTransferRequested) + 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() + } +} + +func (it *BurnFromMintTokenPoolOwnershipTransferRequestedIterator) Error() error { + return it.fail +} + +func (it *BurnFromMintTokenPoolOwnershipTransferRequestedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type BurnFromMintTokenPoolOwnershipTransferRequested struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolFilterer) FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*BurnFromMintTokenPoolOwnershipTransferRequestedIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _BurnFromMintTokenPool.contract.FilterLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return &BurnFromMintTokenPoolOwnershipTransferRequestedIterator{contract: _BurnFromMintTokenPool.contract, event: "OwnershipTransferRequested", logs: logs, sub: sub}, nil +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolFilterer) WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *BurnFromMintTokenPoolOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _BurnFromMintTokenPool.contract.WatchLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(BurnFromMintTokenPoolOwnershipTransferRequested) + if err := _BurnFromMintTokenPool.contract.UnpackLog(event, "OwnershipTransferRequested", 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 +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolFilterer) ParseOwnershipTransferRequested(log types.Log) (*BurnFromMintTokenPoolOwnershipTransferRequested, error) { + event := new(BurnFromMintTokenPoolOwnershipTransferRequested) + if err := _BurnFromMintTokenPool.contract.UnpackLog(event, "OwnershipTransferRequested", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type BurnFromMintTokenPoolOwnershipTransferredIterator struct { + Event *BurnFromMintTokenPoolOwnershipTransferred + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *BurnFromMintTokenPoolOwnershipTransferredIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(BurnFromMintTokenPoolOwnershipTransferred) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(BurnFromMintTokenPoolOwnershipTransferred) + 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() + } +} + +func (it *BurnFromMintTokenPoolOwnershipTransferredIterator) Error() error { + return it.fail +} + +func (it *BurnFromMintTokenPoolOwnershipTransferredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type BurnFromMintTokenPoolOwnershipTransferred struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*BurnFromMintTokenPoolOwnershipTransferredIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _BurnFromMintTokenPool.contract.FilterLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return &BurnFromMintTokenPoolOwnershipTransferredIterator{contract: _BurnFromMintTokenPool.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *BurnFromMintTokenPoolOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _BurnFromMintTokenPool.contract.WatchLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(BurnFromMintTokenPoolOwnershipTransferred) + if err := _BurnFromMintTokenPool.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 +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolFilterer) ParseOwnershipTransferred(log types.Log) (*BurnFromMintTokenPoolOwnershipTransferred, error) { + event := new(BurnFromMintTokenPoolOwnershipTransferred) + if err := _BurnFromMintTokenPool.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type BurnFromMintTokenPoolReleasedIterator struct { + Event *BurnFromMintTokenPoolReleased + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *BurnFromMintTokenPoolReleasedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(BurnFromMintTokenPoolReleased) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(BurnFromMintTokenPoolReleased) + 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() + } +} + +func (it *BurnFromMintTokenPoolReleasedIterator) Error() error { + return it.fail +} + +func (it *BurnFromMintTokenPoolReleasedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type BurnFromMintTokenPoolReleased struct { + Sender common.Address + Recipient common.Address + Amount *big.Int + Raw types.Log +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolFilterer) FilterReleased(opts *bind.FilterOpts, sender []common.Address, recipient []common.Address) (*BurnFromMintTokenPoolReleasedIterator, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + var recipientRule []interface{} + for _, recipientItem := range recipient { + recipientRule = append(recipientRule, recipientItem) + } + + logs, sub, err := _BurnFromMintTokenPool.contract.FilterLogs(opts, "Released", senderRule, recipientRule) + if err != nil { + return nil, err + } + return &BurnFromMintTokenPoolReleasedIterator{contract: _BurnFromMintTokenPool.contract, event: "Released", logs: logs, sub: sub}, nil +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolFilterer) WatchReleased(opts *bind.WatchOpts, sink chan<- *BurnFromMintTokenPoolReleased, sender []common.Address, recipient []common.Address) (event.Subscription, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + var recipientRule []interface{} + for _, recipientItem := range recipient { + recipientRule = append(recipientRule, recipientItem) + } + + logs, sub, err := _BurnFromMintTokenPool.contract.WatchLogs(opts, "Released", senderRule, recipientRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(BurnFromMintTokenPoolReleased) + if err := _BurnFromMintTokenPool.contract.UnpackLog(event, "Released", 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 +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolFilterer) ParseReleased(log types.Log) (*BurnFromMintTokenPoolReleased, error) { + event := new(BurnFromMintTokenPoolReleased) + if err := _BurnFromMintTokenPool.contract.UnpackLog(event, "Released", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type BurnFromMintTokenPoolRemotePoolSetIterator struct { + Event *BurnFromMintTokenPoolRemotePoolSet + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *BurnFromMintTokenPoolRemotePoolSetIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(BurnFromMintTokenPoolRemotePoolSet) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(BurnFromMintTokenPoolRemotePoolSet) + 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() + } +} + +func (it *BurnFromMintTokenPoolRemotePoolSetIterator) Error() error { + return it.fail +} + +func (it *BurnFromMintTokenPoolRemotePoolSetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type BurnFromMintTokenPoolRemotePoolSet struct { + RemoteChainSelector uint64 + PreviousPoolAddress []byte + RemotePoolAddress []byte + Raw types.Log +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolFilterer) FilterRemotePoolSet(opts *bind.FilterOpts, remoteChainSelector []uint64) (*BurnFromMintTokenPoolRemotePoolSetIterator, error) { + + var remoteChainSelectorRule []interface{} + for _, remoteChainSelectorItem := range remoteChainSelector { + remoteChainSelectorRule = append(remoteChainSelectorRule, remoteChainSelectorItem) + } + + logs, sub, err := _BurnFromMintTokenPool.contract.FilterLogs(opts, "RemotePoolSet", remoteChainSelectorRule) + if err != nil { + return nil, err + } + return &BurnFromMintTokenPoolRemotePoolSetIterator{contract: _BurnFromMintTokenPool.contract, event: "RemotePoolSet", logs: logs, sub: sub}, nil +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolFilterer) WatchRemotePoolSet(opts *bind.WatchOpts, sink chan<- *BurnFromMintTokenPoolRemotePoolSet, remoteChainSelector []uint64) (event.Subscription, error) { + + var remoteChainSelectorRule []interface{} + for _, remoteChainSelectorItem := range remoteChainSelector { + remoteChainSelectorRule = append(remoteChainSelectorRule, remoteChainSelectorItem) + } + + logs, sub, err := _BurnFromMintTokenPool.contract.WatchLogs(opts, "RemotePoolSet", remoteChainSelectorRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(BurnFromMintTokenPoolRemotePoolSet) + if err := _BurnFromMintTokenPool.contract.UnpackLog(event, "RemotePoolSet", 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 +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolFilterer) ParseRemotePoolSet(log types.Log) (*BurnFromMintTokenPoolRemotePoolSet, error) { + event := new(BurnFromMintTokenPoolRemotePoolSet) + if err := _BurnFromMintTokenPool.contract.UnpackLog(event, "RemotePoolSet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type BurnFromMintTokenPoolRouterUpdatedIterator struct { + Event *BurnFromMintTokenPoolRouterUpdated + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *BurnFromMintTokenPoolRouterUpdatedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(BurnFromMintTokenPoolRouterUpdated) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(BurnFromMintTokenPoolRouterUpdated) + 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() + } +} + +func (it *BurnFromMintTokenPoolRouterUpdatedIterator) Error() error { + return it.fail +} + +func (it *BurnFromMintTokenPoolRouterUpdatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type BurnFromMintTokenPoolRouterUpdated struct { + OldRouter common.Address + NewRouter common.Address + Raw types.Log +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolFilterer) FilterRouterUpdated(opts *bind.FilterOpts) (*BurnFromMintTokenPoolRouterUpdatedIterator, error) { + + logs, sub, err := _BurnFromMintTokenPool.contract.FilterLogs(opts, "RouterUpdated") + if err != nil { + return nil, err + } + return &BurnFromMintTokenPoolRouterUpdatedIterator{contract: _BurnFromMintTokenPool.contract, event: "RouterUpdated", logs: logs, sub: sub}, nil +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolFilterer) WatchRouterUpdated(opts *bind.WatchOpts, sink chan<- *BurnFromMintTokenPoolRouterUpdated) (event.Subscription, error) { + + logs, sub, err := _BurnFromMintTokenPool.contract.WatchLogs(opts, "RouterUpdated") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(BurnFromMintTokenPoolRouterUpdated) + if err := _BurnFromMintTokenPool.contract.UnpackLog(event, "RouterUpdated", 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 +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolFilterer) ParseRouterUpdated(log types.Log) (*BurnFromMintTokenPoolRouterUpdated, error) { + event := new(BurnFromMintTokenPoolRouterUpdated) + if err := _BurnFromMintTokenPool.contract.UnpackLog(event, "RouterUpdated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type BurnFromMintTokenPoolTokensConsumedIterator struct { + Event *BurnFromMintTokenPoolTokensConsumed + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *BurnFromMintTokenPoolTokensConsumedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(BurnFromMintTokenPoolTokensConsumed) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(BurnFromMintTokenPoolTokensConsumed) + 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() + } +} + +func (it *BurnFromMintTokenPoolTokensConsumedIterator) Error() error { + return it.fail +} + +func (it *BurnFromMintTokenPoolTokensConsumedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type BurnFromMintTokenPoolTokensConsumed struct { + Tokens *big.Int + Raw types.Log +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolFilterer) FilterTokensConsumed(opts *bind.FilterOpts) (*BurnFromMintTokenPoolTokensConsumedIterator, error) { + + logs, sub, err := _BurnFromMintTokenPool.contract.FilterLogs(opts, "TokensConsumed") + if err != nil { + return nil, err + } + return &BurnFromMintTokenPoolTokensConsumedIterator{contract: _BurnFromMintTokenPool.contract, event: "TokensConsumed", logs: logs, sub: sub}, nil +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolFilterer) WatchTokensConsumed(opts *bind.WatchOpts, sink chan<- *BurnFromMintTokenPoolTokensConsumed) (event.Subscription, error) { + + logs, sub, err := _BurnFromMintTokenPool.contract.WatchLogs(opts, "TokensConsumed") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(BurnFromMintTokenPoolTokensConsumed) + if err := _BurnFromMintTokenPool.contract.UnpackLog(event, "TokensConsumed", 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 +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPoolFilterer) ParseTokensConsumed(log types.Log) (*BurnFromMintTokenPoolTokensConsumed, error) { + event := new(BurnFromMintTokenPoolTokensConsumed) + if err := _BurnFromMintTokenPool.contract.UnpackLog(event, "TokensConsumed", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPool) ParseLog(log types.Log) (generated.AbigenLog, error) { + switch log.Topics[0] { + case _BurnFromMintTokenPool.abi.Events["AllowListAdd"].ID: + return _BurnFromMintTokenPool.ParseAllowListAdd(log) + case _BurnFromMintTokenPool.abi.Events["AllowListRemove"].ID: + return _BurnFromMintTokenPool.ParseAllowListRemove(log) + case _BurnFromMintTokenPool.abi.Events["Burned"].ID: + return _BurnFromMintTokenPool.ParseBurned(log) + case _BurnFromMintTokenPool.abi.Events["ChainAdded"].ID: + return _BurnFromMintTokenPool.ParseChainAdded(log) + case _BurnFromMintTokenPool.abi.Events["ChainConfigured"].ID: + return _BurnFromMintTokenPool.ParseChainConfigured(log) + case _BurnFromMintTokenPool.abi.Events["ChainRemoved"].ID: + return _BurnFromMintTokenPool.ParseChainRemoved(log) + case _BurnFromMintTokenPool.abi.Events["ConfigChanged"].ID: + return _BurnFromMintTokenPool.ParseConfigChanged(log) + case _BurnFromMintTokenPool.abi.Events["Locked"].ID: + return _BurnFromMintTokenPool.ParseLocked(log) + case _BurnFromMintTokenPool.abi.Events["Minted"].ID: + return _BurnFromMintTokenPool.ParseMinted(log) + case _BurnFromMintTokenPool.abi.Events["OwnershipTransferRequested"].ID: + return _BurnFromMintTokenPool.ParseOwnershipTransferRequested(log) + case _BurnFromMintTokenPool.abi.Events["OwnershipTransferred"].ID: + return _BurnFromMintTokenPool.ParseOwnershipTransferred(log) + case _BurnFromMintTokenPool.abi.Events["Released"].ID: + return _BurnFromMintTokenPool.ParseReleased(log) + case _BurnFromMintTokenPool.abi.Events["RemotePoolSet"].ID: + return _BurnFromMintTokenPool.ParseRemotePoolSet(log) + case _BurnFromMintTokenPool.abi.Events["RouterUpdated"].ID: + return _BurnFromMintTokenPool.ParseRouterUpdated(log) + case _BurnFromMintTokenPool.abi.Events["TokensConsumed"].ID: + return _BurnFromMintTokenPool.ParseTokensConsumed(log) + + default: + return nil, fmt.Errorf("abigen wrapper received unknown log topic: %v", log.Topics[0]) + } +} + +func (BurnFromMintTokenPoolAllowListAdd) Topic() common.Hash { + return common.HexToHash("0x2640d4d76caf8bf478aabfa982fa4e1c4eb71a37f93cd15e80dbc657911546d8") +} + +func (BurnFromMintTokenPoolAllowListRemove) Topic() common.Hash { + return common.HexToHash("0x800671136ab6cfee9fbe5ed1fb7ca417811aca3cf864800d127b927adedf7566") +} + +func (BurnFromMintTokenPoolBurned) Topic() common.Hash { + return common.HexToHash("0x696de425f79f4a40bc6d2122ca50507f0efbeabbff86a84871b7196ab8ea8df7") +} + +func (BurnFromMintTokenPoolChainAdded) Topic() common.Hash { + return common.HexToHash("0x8d340f17e19058004c20453540862a9c62778504476f6756755cb33bcd6c38c2") +} + +func (BurnFromMintTokenPoolChainConfigured) Topic() common.Hash { + return common.HexToHash("0x0350d63aa5f270e01729d00d627eeb8f3429772b1818c016c66a588a864f912b") +} + +func (BurnFromMintTokenPoolChainRemoved) Topic() common.Hash { + return common.HexToHash("0x5204aec90a3c794d8e90fded8b46ae9c7c552803e7e832e0c1d358396d859916") +} + +func (BurnFromMintTokenPoolConfigChanged) Topic() common.Hash { + return common.HexToHash("0x9ea3374b67bf275e6bb9c8ae68f9cae023e1c528b4b27e092f0bb209d3531c19") +} + +func (BurnFromMintTokenPoolLocked) Topic() common.Hash { + return common.HexToHash("0x9f1ec8c880f76798e7b793325d625e9b60e4082a553c98f42b6cda368dd60008") +} + +func (BurnFromMintTokenPoolMinted) Topic() common.Hash { + return common.HexToHash("0x9d228d69b5fdb8d273a2336f8fb8612d039631024ea9bf09c424a9503aa078f0") +} + +func (BurnFromMintTokenPoolOwnershipTransferRequested) Topic() common.Hash { + return common.HexToHash("0xed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae1278") +} + +func (BurnFromMintTokenPoolOwnershipTransferred) Topic() common.Hash { + return common.HexToHash("0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0") +} + +func (BurnFromMintTokenPoolReleased) Topic() common.Hash { + return common.HexToHash("0x2d87480f50083e2b2759522a8fdda59802650a8055e609a7772cf70c07748f52") +} + +func (BurnFromMintTokenPoolRemotePoolSet) Topic() common.Hash { + return common.HexToHash("0xdb4d6220746a38cbc5335f7e108f7de80f482f4d23350253dfd0917df75a14bf") +} + +func (BurnFromMintTokenPoolRouterUpdated) Topic() common.Hash { + return common.HexToHash("0x02dc5c233404867c793b749c6d644beb2277536d18a7e7974d3f238e4c6f1684") +} + +func (BurnFromMintTokenPoolTokensConsumed) Topic() common.Hash { + return common.HexToHash("0x1871cdf8010e63f2eb8384381a68dfa7416dc571a5517e66e88b2d2d0c0a690a") +} + +func (_BurnFromMintTokenPool *BurnFromMintTokenPool) Address() common.Address { + return _BurnFromMintTokenPool.address +} + +type BurnFromMintTokenPoolInterface interface { + GetAllowList(opts *bind.CallOpts) ([]common.Address, error) + + GetAllowListEnabled(opts *bind.CallOpts) (bool, error) + + GetCurrentInboundRateLimiterState(opts *bind.CallOpts, remoteChainSelector uint64) (RateLimiterTokenBucket, error) + + GetCurrentOutboundRateLimiterState(opts *bind.CallOpts, remoteChainSelector uint64) (RateLimiterTokenBucket, error) + + GetRateLimitAdmin(opts *bind.CallOpts) (common.Address, error) + + GetRemotePool(opts *bind.CallOpts, remoteChainSelector uint64) ([]byte, error) + + GetRemoteToken(opts *bind.CallOpts, remoteChainSelector uint64) ([]byte, error) + + GetRmnProxy(opts *bind.CallOpts) (common.Address, error) + + GetRouter(opts *bind.CallOpts) (common.Address, error) + + GetSupportedChains(opts *bind.CallOpts) ([]uint64, error) + + GetToken(opts *bind.CallOpts) (common.Address, error) + + IsSupportedChain(opts *bind.CallOpts, remoteChainSelector uint64) (bool, error) + + IsSupportedToken(opts *bind.CallOpts, token common.Address) (bool, error) + + Owner(opts *bind.CallOpts) (common.Address, error) + + SupportsInterface(opts *bind.CallOpts, interfaceId [4]byte) (bool, error) + + TypeAndVersion(opts *bind.CallOpts) (string, error) + + AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) + + ApplyAllowListUpdates(opts *bind.TransactOpts, removes []common.Address, adds []common.Address) (*types.Transaction, error) + + ApplyChainUpdates(opts *bind.TransactOpts, chains []TokenPoolChainUpdate) (*types.Transaction, error) + + LockOrBurn(opts *bind.TransactOpts, lockOrBurnIn PoolLockOrBurnInV1) (*types.Transaction, error) + + ReleaseOrMint(opts *bind.TransactOpts, releaseOrMintIn PoolReleaseOrMintInV1) (*types.Transaction, error) + + SetChainRateLimiterConfig(opts *bind.TransactOpts, remoteChainSelector uint64, outboundConfig RateLimiterConfig, inboundConfig RateLimiterConfig) (*types.Transaction, error) + + SetRateLimitAdmin(opts *bind.TransactOpts, rateLimitAdmin common.Address) (*types.Transaction, error) + + SetRemotePool(opts *bind.TransactOpts, remoteChainSelector uint64, remotePoolAddress []byte) (*types.Transaction, error) + + SetRouter(opts *bind.TransactOpts, newRouter common.Address) (*types.Transaction, error) + + TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) + + FilterAllowListAdd(opts *bind.FilterOpts) (*BurnFromMintTokenPoolAllowListAddIterator, error) + + WatchAllowListAdd(opts *bind.WatchOpts, sink chan<- *BurnFromMintTokenPoolAllowListAdd) (event.Subscription, error) + + ParseAllowListAdd(log types.Log) (*BurnFromMintTokenPoolAllowListAdd, error) + + FilterAllowListRemove(opts *bind.FilterOpts) (*BurnFromMintTokenPoolAllowListRemoveIterator, error) + + WatchAllowListRemove(opts *bind.WatchOpts, sink chan<- *BurnFromMintTokenPoolAllowListRemove) (event.Subscription, error) + + ParseAllowListRemove(log types.Log) (*BurnFromMintTokenPoolAllowListRemove, error) + + FilterBurned(opts *bind.FilterOpts, sender []common.Address) (*BurnFromMintTokenPoolBurnedIterator, error) + + WatchBurned(opts *bind.WatchOpts, sink chan<- *BurnFromMintTokenPoolBurned, sender []common.Address) (event.Subscription, error) + + ParseBurned(log types.Log) (*BurnFromMintTokenPoolBurned, error) + + FilterChainAdded(opts *bind.FilterOpts) (*BurnFromMintTokenPoolChainAddedIterator, error) + + WatchChainAdded(opts *bind.WatchOpts, sink chan<- *BurnFromMintTokenPoolChainAdded) (event.Subscription, error) + + ParseChainAdded(log types.Log) (*BurnFromMintTokenPoolChainAdded, error) + + FilterChainConfigured(opts *bind.FilterOpts) (*BurnFromMintTokenPoolChainConfiguredIterator, error) + + WatchChainConfigured(opts *bind.WatchOpts, sink chan<- *BurnFromMintTokenPoolChainConfigured) (event.Subscription, error) + + ParseChainConfigured(log types.Log) (*BurnFromMintTokenPoolChainConfigured, error) + + FilterChainRemoved(opts *bind.FilterOpts) (*BurnFromMintTokenPoolChainRemovedIterator, error) + + WatchChainRemoved(opts *bind.WatchOpts, sink chan<- *BurnFromMintTokenPoolChainRemoved) (event.Subscription, error) + + ParseChainRemoved(log types.Log) (*BurnFromMintTokenPoolChainRemoved, error) + + FilterConfigChanged(opts *bind.FilterOpts) (*BurnFromMintTokenPoolConfigChangedIterator, error) + + WatchConfigChanged(opts *bind.WatchOpts, sink chan<- *BurnFromMintTokenPoolConfigChanged) (event.Subscription, error) + + ParseConfigChanged(log types.Log) (*BurnFromMintTokenPoolConfigChanged, error) + + FilterLocked(opts *bind.FilterOpts, sender []common.Address) (*BurnFromMintTokenPoolLockedIterator, error) + + WatchLocked(opts *bind.WatchOpts, sink chan<- *BurnFromMintTokenPoolLocked, sender []common.Address) (event.Subscription, error) + + ParseLocked(log types.Log) (*BurnFromMintTokenPoolLocked, error) + + FilterMinted(opts *bind.FilterOpts, sender []common.Address, recipient []common.Address) (*BurnFromMintTokenPoolMintedIterator, error) + + WatchMinted(opts *bind.WatchOpts, sink chan<- *BurnFromMintTokenPoolMinted, sender []common.Address, recipient []common.Address) (event.Subscription, error) + + ParseMinted(log types.Log) (*BurnFromMintTokenPoolMinted, error) + + FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*BurnFromMintTokenPoolOwnershipTransferRequestedIterator, error) + + WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *BurnFromMintTokenPoolOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferRequested(log types.Log) (*BurnFromMintTokenPoolOwnershipTransferRequested, error) + + FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*BurnFromMintTokenPoolOwnershipTransferredIterator, error) + + WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *BurnFromMintTokenPoolOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferred(log types.Log) (*BurnFromMintTokenPoolOwnershipTransferred, error) + + FilterReleased(opts *bind.FilterOpts, sender []common.Address, recipient []common.Address) (*BurnFromMintTokenPoolReleasedIterator, error) + + WatchReleased(opts *bind.WatchOpts, sink chan<- *BurnFromMintTokenPoolReleased, sender []common.Address, recipient []common.Address) (event.Subscription, error) + + ParseReleased(log types.Log) (*BurnFromMintTokenPoolReleased, error) + + FilterRemotePoolSet(opts *bind.FilterOpts, remoteChainSelector []uint64) (*BurnFromMintTokenPoolRemotePoolSetIterator, error) + + WatchRemotePoolSet(opts *bind.WatchOpts, sink chan<- *BurnFromMintTokenPoolRemotePoolSet, remoteChainSelector []uint64) (event.Subscription, error) + + ParseRemotePoolSet(log types.Log) (*BurnFromMintTokenPoolRemotePoolSet, error) + + FilterRouterUpdated(opts *bind.FilterOpts) (*BurnFromMintTokenPoolRouterUpdatedIterator, error) + + WatchRouterUpdated(opts *bind.WatchOpts, sink chan<- *BurnFromMintTokenPoolRouterUpdated) (event.Subscription, error) + + ParseRouterUpdated(log types.Log) (*BurnFromMintTokenPoolRouterUpdated, error) + + FilterTokensConsumed(opts *bind.FilterOpts) (*BurnFromMintTokenPoolTokensConsumedIterator, error) + + WatchTokensConsumed(opts *bind.WatchOpts, sink chan<- *BurnFromMintTokenPoolTokensConsumed) (event.Subscription, error) + + ParseTokensConsumed(log types.Log) (*BurnFromMintTokenPoolTokensConsumed, error) + + ParseLog(log types.Log) (generated.AbigenLog, error) + + Address() common.Address +} diff --git a/core/gethwrappers/ccip/generated/burn_mint_token_pool/burn_mint_token_pool.go b/core/gethwrappers/ccip/generated/burn_mint_token_pool/burn_mint_token_pool.go new file mode 100644 index 00000000000..244f04596a2 --- /dev/null +++ b/core/gethwrappers/ccip/generated/burn_mint_token_pool/burn_mint_token_pool.go @@ -0,0 +1,2818 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package burn_mint_token_pool + +import ( + "errors" + "fmt" + "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" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" +) + +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +type PoolLockOrBurnInV1 struct { + Receiver []byte + RemoteChainSelector uint64 + OriginalSender common.Address + Amount *big.Int + LocalToken common.Address +} + +type PoolLockOrBurnOutV1 struct { + DestTokenAddress []byte + DestPoolData []byte +} + +type PoolReleaseOrMintInV1 struct { + OriginalSender []byte + RemoteChainSelector uint64 + Receiver common.Address + Amount *big.Int + LocalToken common.Address + SourcePoolAddress []byte + SourcePoolData []byte + OffchainTokenData []byte +} + +type PoolReleaseOrMintOutV1 struct { + DestinationAmount *big.Int +} + +type RateLimiterConfig struct { + IsEnabled bool + Capacity *big.Int + Rate *big.Int +} + +type RateLimiterTokenBucket struct { + Tokens *big.Int + LastUpdated uint32 + IsEnabled bool + Capacity *big.Int + Rate *big.Int +} + +type TokenPoolChainUpdate struct { + RemoteChainSelector uint64 + Allowed bool + RemotePoolAddress []byte + RemoteTokenAddress []byte + OutboundRateLimiterConfig RateLimiterConfig + InboundRateLimiterConfig RateLimiterConfig +} + +var BurnMintTokenPoolMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"internalType\":\"contractIBurnMintERC20\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"allowlist\",\"type\":\"address[]\"},{\"internalType\":\"address\",\"name\":\"rmnProxy\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"router\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"capacity\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"requested\",\"type\":\"uint256\"}],\"name\":\"AggregateValueMaxCapacityExceeded\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"minWaitInSeconds\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"available\",\"type\":\"uint256\"}],\"name\":\"AggregateValueRateLimitReached\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"AllowListNotEnabled\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"BucketOverfilled\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"}],\"name\":\"CallerIsNotARampOnRouter\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"}],\"name\":\"ChainAlreadyExists\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"ChainNotAllowed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"CursedByRMN\",\"type\":\"error\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"config\",\"type\":\"tuple\"}],\"name\":\"DisabledNonZeroRateLimit\",\"type\":\"error\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"rateLimiterConfig\",\"type\":\"tuple\"}],\"name\":\"InvalidRateLimitRate\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"sourcePoolAddress\",\"type\":\"bytes\"}],\"name\":\"InvalidSourcePoolAddress\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"InvalidToken\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"NonExistentChain\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RateLimitMustBeDisabled\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"SenderNotAllowed\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"capacity\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"requested\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"}],\"name\":\"TokenMaxCapacityExceeded\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"minWaitInSeconds\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"available\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"}],\"name\":\"TokenRateLimitReached\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"}],\"name\":\"Unauthorized\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddressNotAllowed\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"AllowListAdd\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"AllowListRemove\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Burned\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"remoteToken\",\"type\":\"bytes\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"indexed\":false,\"internalType\":\"structRateLimiter.Config\",\"name\":\"outboundRateLimiterConfig\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"indexed\":false,\"internalType\":\"structRateLimiter.Config\",\"name\":\"inboundRateLimiterConfig\",\"type\":\"tuple\"}],\"name\":\"ChainAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"indexed\":false,\"internalType\":\"structRateLimiter.Config\",\"name\":\"outboundRateLimiterConfig\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"indexed\":false,\"internalType\":\"structRateLimiter.Config\",\"name\":\"inboundRateLimiterConfig\",\"type\":\"tuple\"}],\"name\":\"ChainConfigured\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"ChainRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"indexed\":false,\"internalType\":\"structRateLimiter.Config\",\"name\":\"config\",\"type\":\"tuple\"}],\"name\":\"ConfigChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Locked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Minted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Released\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"previousPoolAddress\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"remotePoolAddress\",\"type\":\"bytes\"}],\"name\":\"RemotePoolSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"oldRouter\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newRouter\",\"type\":\"address\"}],\"name\":\"RouterUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"}],\"name\":\"TokensConsumed\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"removes\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"adds\",\"type\":\"address[]\"}],\"name\":\"applyAllowListUpdates\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"bool\",\"name\":\"allowed\",\"type\":\"bool\"},{\"internalType\":\"bytes\",\"name\":\"remotePoolAddress\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"remoteTokenAddress\",\"type\":\"bytes\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"outboundRateLimiterConfig\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"inboundRateLimiterConfig\",\"type\":\"tuple\"}],\"internalType\":\"structTokenPool.ChainUpdate[]\",\"name\":\"chains\",\"type\":\"tuple[]\"}],\"name\":\"applyChainUpdates\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAllowList\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAllowListEnabled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"getCurrentInboundRateLimiterState\",\"outputs\":[{\"components\":[{\"internalType\":\"uint128\",\"name\":\"tokens\",\"type\":\"uint128\"},{\"internalType\":\"uint32\",\"name\":\"lastUpdated\",\"type\":\"uint32\"},{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.TokenBucket\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"getCurrentOutboundRateLimiterState\",\"outputs\":[{\"components\":[{\"internalType\":\"uint128\",\"name\":\"tokens\",\"type\":\"uint128\"},{\"internalType\":\"uint32\",\"name\":\"lastUpdated\",\"type\":\"uint32\"},{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.TokenBucket\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRateLimitAdmin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"getRemotePool\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"getRemoteToken\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRmnProxy\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"rmnProxy\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRouter\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"router\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getSupportedChains\",\"outputs\":[{\"internalType\":\"uint64[]\",\"name\":\"\",\"type\":\"uint64[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getToken\",\"outputs\":[{\"internalType\":\"contractIERC20\",\"name\":\"token\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"isSupportedChain\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"isSupportedToken\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes\",\"name\":\"receiver\",\"type\":\"bytes\"},{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"originalSender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"localToken\",\"type\":\"address\"}],\"internalType\":\"structPool.LockOrBurnInV1\",\"name\":\"lockOrBurnIn\",\"type\":\"tuple\"}],\"name\":\"lockOrBurn\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes\",\"name\":\"destTokenAddress\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"destPoolData\",\"type\":\"bytes\"}],\"internalType\":\"structPool.LockOrBurnOutV1\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes\",\"name\":\"originalSender\",\"type\":\"bytes\"},{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"localToken\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"sourcePoolAddress\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"sourcePoolData\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"offchainTokenData\",\"type\":\"bytes\"}],\"internalType\":\"structPool.ReleaseOrMintInV1\",\"name\":\"releaseOrMintIn\",\"type\":\"tuple\"}],\"name\":\"releaseOrMint\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"destinationAmount\",\"type\":\"uint256\"}],\"internalType\":\"structPool.ReleaseOrMintOutV1\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"outboundConfig\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"inboundConfig\",\"type\":\"tuple\"}],\"name\":\"setChainRateLimiterConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"rateLimitAdmin\",\"type\":\"address\"}],\"name\":\"setRateLimitAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"remotePoolAddress\",\"type\":\"bytes\"}],\"name\":\"setRemotePool\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newRouter\",\"type\":\"address\"}],\"name\":\"setRouter\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", + Bin: "0x60e06040523480156200001157600080fd5b50604051620040b3380380620040b383398101604081905262000034916200054c565b8383838333806000816200008f5760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000c257620000c28162000176565b5050506001600160a01b0384161580620000e357506001600160a01b038116155b80620000f657506001600160a01b038216155b1562000115576040516342bcdf7f60e11b815260040160405180910390fd5b6001600160a01b0384811660805282811660a052600480546001600160a01b031916918316919091179055825115801560c052620001685760408051600081526020810190915262000168908462000221565b5050505050505050620006aa565b336001600160a01b03821603620001d05760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640162000086565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b60c05162000242576040516335f4a7b360e01b815260040160405180910390fd5b60005b8251811015620002cd5760008382815181106200026657620002666200065c565b60209081029190910101519050620002806002826200037e565b15620002c3576040516001600160a01b03821681527f800671136ab6cfee9fbe5ed1fb7ca417811aca3cf864800d127b927adedf75669060200160405180910390a15b5060010162000245565b5060005b815181101562000379576000828281518110620002f257620002f26200065c565b6020026020010151905060006001600160a01b0316816001600160a01b0316036200031e575062000370565b6200032b6002826200039e565b156200036e576040516001600160a01b03821681527f2640d4d76caf8bf478aabfa982fa4e1c4eb71a37f93cd15e80dbc657911546d89060200160405180910390a15b505b600101620002d1565b505050565b600062000395836001600160a01b038416620003b5565b90505b92915050565b600062000395836001600160a01b038416620004b9565b60008181526001830160205260408120548015620004ae576000620003dc60018362000672565b8554909150600090620003f29060019062000672565b90508082146200045e5760008660000182815481106200041657620004166200065c565b90600052602060002001549050808760000184815481106200043c576200043c6200065c565b6000918252602080832090910192909255918252600188019052604090208390555b855486908062000472576200047262000694565b60019003818190600052602060002001600090559055856001016000868152602001908152602001600020600090556001935050505062000398565b600091505062000398565b6000818152600183016020526040812054620005025750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915562000398565b50600062000398565b6001600160a01b03811681146200052157600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b805162000547816200050b565b919050565b600080600080608085870312156200056357600080fd5b845162000570816200050b565b602086810151919550906001600160401b03808211156200059057600080fd5b818801915088601f830112620005a557600080fd5b815181811115620005ba57620005ba62000524565b8060051b604051601f19603f83011681018181108582111715620005e257620005e262000524565b60405291825284820192508381018501918b8311156200060157600080fd5b938501935b828510156200062a576200061a856200053a565b8452938501939285019262000606565b80985050505050505062000641604086016200053a565b915062000651606086016200053a565b905092959194509250565b634e487b7160e01b600052603260045260246000fd5b818103818111156200039857634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603160045260246000fd5b60805160a05160c05161398c62000727600039600081816104dd0152818161177701526121550152600081816104b7015281816115a80152611a2d0152600081816102390152818161028e015281816106e0015281816114c80152818161194d01528181611b3f015281816120eb0152612340015261398c6000f3fe608060405234801561001057600080fd5b50600436106101ae5760003560e01c80639a4575b9116100ee578063c4bffe2b11610097578063db6327dc11610071578063db6327dc146104a2578063dc0bd971146104b5578063e0351e13146104db578063f2fde38b1461050157600080fd5b8063c4bffe2b14610467578063c75eea9c1461047c578063cf7401f31461048f57600080fd5b8063b0f479a1116100c8578063b0f479a114610423578063b794658014610441578063c0d786551461045457600080fd5b80639a4575b91461037f578063a7cd63b71461039f578063af58d59f146103b457600080fd5b806354c8a4f31161015b57806379ba50971161013557806379ba5097146103335780637d54534e1461033b5780638926f54f1461034e5780638da5cb5b1461036157600080fd5b806354c8a4f3146102ed5780636d3d1a581461030257806378a010b21461032057600080fd5b806321df0da71161018c57806321df0da714610237578063240028e81461027e57806339077537146102cb57600080fd5b806301ffc9a7146101b35780630a2fd493146101db578063181f5a77146101fb575b600080fd5b6101c66101c1366004612ae3565b610514565b60405190151581526020015b60405180910390f35b6101ee6101e9366004612b42565b6105f9565b6040516101d29190612bc1565b6101ee6040518060400160405280601781526020017f4275726e4d696e74546f6b656e506f6f6c20312e352e3000000000000000000081525081565b7f00000000000000000000000000000000000000000000000000000000000000005b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101d2565b6101c661028c366004612c01565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff90811691161490565b6102de6102d9366004612c1e565b6106a9565b604051905181526020016101d2565b6103006102fb366004612ca6565b61082f565b005b60085473ffffffffffffffffffffffffffffffffffffffff16610259565b61030061032e366004612d12565b6108aa565b610300610a1e565b610300610349366004612c01565b610b1b565b6101c661035c366004612b42565b610b6a565b60005473ffffffffffffffffffffffffffffffffffffffff16610259565b61039261038d366004612d95565b610b81565b6040516101d29190612dd0565b6103a7610c28565b6040516101d29190612e30565b6103c76103c2366004612b42565b610c39565b6040516101d2919081516fffffffffffffffffffffffffffffffff908116825260208084015163ffffffff1690830152604080840151151590830152606080840151821690830152608092830151169181019190915260a00190565b60045473ffffffffffffffffffffffffffffffffffffffff16610259565b6101ee61044f366004612b42565b610d0e565b610300610462366004612c01565b610d39565b61046f610e14565b6040516101d29190612e8a565b6103c761048a366004612b42565b610ecc565b61030061049d366004612ff2565b610f9e565b6103006104b0366004613037565b611027565b7f0000000000000000000000000000000000000000000000000000000000000000610259565b7f00000000000000000000000000000000000000000000000000000000000000006101c6565b61030061050f366004612c01565b6114ad565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167faff2afbf0000000000000000000000000000000000000000000000000000000014806105a757507fffffffff0000000000000000000000000000000000000000000000000000000082167f0e64dd2900000000000000000000000000000000000000000000000000000000145b806105f357507fffffffff0000000000000000000000000000000000000000000000000000000082167f01ffc9a700000000000000000000000000000000000000000000000000000000145b92915050565b67ffffffffffffffff8116600090815260076020526040902060040180546060919061062490613079565b80601f016020809104026020016040519081016040528092919081815260200182805461065090613079565b801561069d5780601f106106725761010080835404028352916020019161069d565b820191906000526020600020905b81548152906001019060200180831161068057829003601f168201915b50505050509050919050565b6040805160208101909152600081526106c96106c483613177565b6114c1565b73ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000166340c10f196107156060850160408601612c01565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b16815273ffffffffffffffffffffffffffffffffffffffff909116600482015260608501356024820152604401600060405180830381600087803b15801561078557600080fd5b505af1158015610799573d6000803e3d6000fd5b506107ae925050506060830160408401612c01565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f9d228d69b5fdb8d273a2336f8fb8612d039631024ea9bf09c424a9503aa078f0846060013560405161081091815260200190565b60405180910390a3506040805160208101909152606090910135815290565b6108376116f2565b6108a48484808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152505060408051602080880282810182019093528782529093508792508691829185019084908082843760009201919091525061177592505050565b50505050565b6108b26116f2565b6108bb83610b6a565b610902576040517f1e670e4b00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff841660048201526024015b60405180910390fd5b67ffffffffffffffff83166000908152600760205260408120600401805461092990613079565b80601f016020809104026020016040519081016040528092919081815260200182805461095590613079565b80156109a25780601f10610977576101008083540402835291602001916109a2565b820191906000526020600020905b81548152906001019060200180831161098557829003601f168201915b5050505067ffffffffffffffff86166000908152600760205260409020919250506004016109d18385836132bc565b508367ffffffffffffffff167fdb4d6220746a38cbc5335f7e108f7de80f482f4d23350253dfd0917df75a14bf828585604051610a10939291906133d6565b60405180910390a250505050565b60015473ffffffffffffffffffffffffffffffffffffffff163314610a9f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e65720000000000000000000060448201526064016108f9565b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b610b236116f2565b600880547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60006105f3600567ffffffffffffffff841661192b565b6040805180820190915260608082526020820152610ba6610ba18361343a565b611946565b610bb38260600135611b10565b6040516060830135815233907f696de425f79f4a40bc6d2122ca50507f0efbeabbff86a84871b7196ab8ea8df79060200160405180910390a26040518060400160405280610c0d84602001602081019061044f9190612b42565b81526040805160208181019092526000815291015292915050565b6060610c346002611bb3565b905090565b6040805160a08101825260008082526020820181905291810182905260608101829052608081019190915267ffffffffffffffff8216600090815260076020908152604091829020825160a08101845260028201546fffffffffffffffffffffffffffffffff808216835270010000000000000000000000000000000080830463ffffffff16958401959095527401000000000000000000000000000000000000000090910460ff1615159482019490945260039091015480841660608301529190910490911660808201526105f390611bc0565b67ffffffffffffffff8116600090815260076020526040902060050180546060919061062490613079565b610d416116f2565b73ffffffffffffffffffffffffffffffffffffffff8116610d8e576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6004805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff000000000000000000000000000000000000000083168117909355604080519190921680825260208201939093527f02dc5c233404867c793b749c6d644beb2277536d18a7e7974d3f238e4c6f1684910160405180910390a15050565b60606000610e226005611bb3565b90506000815167ffffffffffffffff811115610e4057610e40612ecc565b604051908082528060200260200182016040528015610e69578160200160208202803683370190505b50905060005b8251811015610ec557828181518110610e8a57610e8a6134dc565b6020026020010151828281518110610ea457610ea46134dc565b67ffffffffffffffff90921660209283029190910190910152600101610e6f565b5092915050565b6040805160a08101825260008082526020820181905291810182905260608101829052608081019190915267ffffffffffffffff8216600090815260076020908152604091829020825160a08101845281546fffffffffffffffffffffffffffffffff808216835270010000000000000000000000000000000080830463ffffffff16958401959095527401000000000000000000000000000000000000000090910460ff1615159482019490945260019091015480841660608301529190910490911660808201526105f390611bc0565b60085473ffffffffffffffffffffffffffffffffffffffff163314801590610fde575060005473ffffffffffffffffffffffffffffffffffffffff163314155b15611017576040517f8e4a23d60000000000000000000000000000000000000000000000000000000081523360048201526024016108f9565b611022838383611c72565b505050565b61102f6116f2565b60005b8181101561102257600083838381811061104e5761104e6134dc565b9050602002810190611060919061350b565b61106990613549565b905061107e8160800151826020015115611d5c565b6110918160a00151826020015115611d5c565b80602001511561138d5780516110b39060059067ffffffffffffffff16611e95565b6110f85780516040517f1d5ad3c500000000000000000000000000000000000000000000000000000000815267ffffffffffffffff90911660048201526024016108f9565b604081015151158061110d5750606081015151155b15611144576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040805161012081018252608083810180516020908101516fffffffffffffffffffffffffffffffff9081168486019081524263ffffffff90811660a0808901829052865151151560c08a01528651860151851660e08a015295518901518416610100890152918752875180860189529489018051850151841686528585019290925281515115158589015281518401518316606080870191909152915188015183168587015283870194855288880151878901908152828a015183890152895167ffffffffffffffff1660009081526007865289902088518051825482890151838e01519289167fffffffffffffffffffffffff0000000000000000000000000000000000000000928316177001000000000000000000000000000000009188168202177fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff90811674010000000000000000000000000000000000000000941515850217865584890151948d0151948a16948a168202949094176001860155995180516002860180549b8301519f830151918b169b9093169a909a179d9096168a029c909c1790911696151502959095179098559081015194015193811693169091029190911760038201559151909190600482019061132590826135fd565b506060820151600582019061133a90826135fd565b505081516060830151608084015160a08501516040517f8d340f17e19058004c20453540862a9c62778504476f6756755cb33bcd6c38c295506113809493929190613717565b60405180910390a16114a4565b80516113a59060059067ffffffffffffffff16611ea1565b6113ea5780516040517f1e670e4b00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff90911660048201526024016108f9565b805167ffffffffffffffff16600090815260076020526040812080547fffffffffffffffffffffff000000000000000000000000000000000000000000908116825560018201839055600282018054909116905560038101829055906114536004830182612a95565b611461600583016000612a95565b5050805160405167ffffffffffffffff90911681527f5204aec90a3c794d8e90fded8b46ae9c7c552803e7e832e0c1d358396d8599169060200160405180910390a15b50600101611032565b6114b56116f2565b6114be81611ead565b50565b60808101517f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff9081169116146115565760808101516040517f961c9a4f00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff90911660048201526024016108f9565b60208101516040517f2cbc26bb00000000000000000000000000000000000000000000000000000000815260809190911b77ffffffffffffffff000000000000000000000000000000001660048201527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1690632cbc26bb90602401602060405180830381865afa158015611604573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061162891906137b0565b1561165f576040517f53ad11d800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61166c8160200151611fa2565b600061167b82602001516105f9565b905080516000148061169f575080805190602001208260a001518051906020012014155b156116dc578160a001516040517f24eb47e50000000000000000000000000000000000000000000000000000000081526004016108f99190612bc1565b6116ee826020015183606001516120c8565b5050565b60005473ffffffffffffffffffffffffffffffffffffffff163314611773576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e65720000000000000000000060448201526064016108f9565b565b7f00000000000000000000000000000000000000000000000000000000000000006117cc576040517f35f4a7b300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b82518110156118625760008382815181106117ec576117ec6134dc565b6020026020010151905061180a81600261210f90919063ffffffff16565b156118595760405173ffffffffffffffffffffffffffffffffffffffff821681527f800671136ab6cfee9fbe5ed1fb7ca417811aca3cf864800d127b927adedf75669060200160405180910390a15b506001016117cf565b5060005b8151811015611022576000828281518110611883576118836134dc565b60200260200101519050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036118c75750611923565b6118d2600282612131565b156119215760405173ffffffffffffffffffffffffffffffffffffffff821681527f2640d4d76caf8bf478aabfa982fa4e1c4eb71a37f93cd15e80dbc657911546d89060200160405180910390a15b505b600101611866565b600081815260018301602052604081205415155b9392505050565b60808101517f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff9081169116146119db5760808101516040517f961c9a4f00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff90911660048201526024016108f9565b60208101516040517f2cbc26bb00000000000000000000000000000000000000000000000000000000815260809190911b77ffffffffffffffff000000000000000000000000000000001660048201527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1690632cbc26bb90602401602060405180830381865afa158015611a89573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611aad91906137b0565b15611ae4576040517f53ad11d800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611af18160400151612153565b611afe81602001516121d2565b6114be81602001518260600151612320565b6040517f42966c68000000000000000000000000000000000000000000000000000000008152600481018290527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16906342966c6890602401600060405180830381600087803b158015611b9857600080fd5b505af1158015611bac573d6000803e3d6000fd5b5050505050565b6060600061193f83612364565b6040805160a081018252600080825260208201819052918101829052606081018290526080810191909152611c4e82606001516fffffffffffffffffffffffffffffffff1683600001516fffffffffffffffffffffffffffffffff16846020015163ffffffff1642611c3291906137fc565b85608001516fffffffffffffffffffffffffffffffff166123bf565b6fffffffffffffffffffffffffffffffff1682525063ffffffff4216602082015290565b611c7b83610b6a565b611cbd576040517f1e670e4b00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff841660048201526024016108f9565b611cc8826000611d5c565b67ffffffffffffffff83166000908152600760205260409020611ceb90836123e9565b611cf6816000611d5c565b67ffffffffffffffff83166000908152600760205260409020611d1c90600201826123e9565b7f0350d63aa5f270e01729d00d627eeb8f3429772b1818c016c66a588a864f912b838383604051611d4f9392919061380f565b60405180910390a1505050565b815115611e235781602001516fffffffffffffffffffffffffffffffff1682604001516fffffffffffffffffffffffffffffffff16101580611db2575060408201516fffffffffffffffffffffffffffffffff16155b15611deb57816040517f8020d1240000000000000000000000000000000000000000000000000000000081526004016108f99190613892565b80156116ee576040517f433fc33d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60408201516fffffffffffffffffffffffffffffffff16151580611e5c575060208201516fffffffffffffffffffffffffffffffff1615155b156116ee57816040517fd68af9cc0000000000000000000000000000000000000000000000000000000081526004016108f99190613892565b600061193f838361258b565b600061193f83836125da565b3373ffffffffffffffffffffffffffffffffffffffff821603611f2c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c6600000000000000000060448201526064016108f9565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b611fab81610b6a565b611fed576040517fa9902c7e00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff821660048201526024016108f9565b600480546040517f83826b2b00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff84169281019290925233602483015273ffffffffffffffffffffffffffffffffffffffff16906383826b2b90604401602060405180830381865afa15801561206c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061209091906137b0565b6114be576040517f728fe07b0000000000000000000000000000000000000000000000000000000081523360048201526024016108f9565b67ffffffffffffffff821660009081526007602052604090206116ee90600201827f00000000000000000000000000000000000000000000000000000000000000006126cd565b600061193f8373ffffffffffffffffffffffffffffffffffffffff84166125da565b600061193f8373ffffffffffffffffffffffffffffffffffffffff841661258b565b7f0000000000000000000000000000000000000000000000000000000000000000156114be57612184600282612a50565b6114be576040517fd0d2597600000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff821660048201526024016108f9565b6121db81610b6a565b61221d576040517fa9902c7e00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff821660048201526024016108f9565b600480546040517fa8d87a3b00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff84169281019290925273ffffffffffffffffffffffffffffffffffffffff169063a8d87a3b90602401602060405180830381865afa158015612296573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122ba91906138ce565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146114be576040517f728fe07b0000000000000000000000000000000000000000000000000000000081523360048201526024016108f9565b67ffffffffffffffff821660009081526007602052604090206116ee90827f00000000000000000000000000000000000000000000000000000000000000006126cd565b60608160000180548060200260200160405190810160405280929190818152602001828054801561069d57602002820191906000526020600020905b8154815260200190600101908083116123a05750505050509050919050565b60006123de856123cf84866138eb565b6123d99087613902565b612a7f565b90505b949350505050565b815460009061241290700100000000000000000000000000000000900463ffffffff16426137fc565b905080156124b4576001830154835461245a916fffffffffffffffffffffffffffffffff808216928116918591700100000000000000000000000000000000909104166123bf565b83546fffffffffffffffffffffffffffffffff919091167fffffffffffffffffffffffff0000000000000000000000000000000000000000909116177001000000000000000000000000000000004263ffffffff16021783555b602082015183546124da916fffffffffffffffffffffffffffffffff9081169116612a7f565b83548351151574010000000000000000000000000000000000000000027fffffffffffffffffffffff00ffffffff000000000000000000000000000000009091166fffffffffffffffffffffffffffffffff92831617178455602083015160408085015183167001000000000000000000000000000000000291909216176001850155517f9ea3374b67bf275e6bb9c8ae68f9cae023e1c528b4b27e092f0bb209d3531c1990611d4f908490613892565b60008181526001830160205260408120546125d2575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556105f3565b5060006105f3565b600081815260018301602052604081205480156126c35760006125fe6001836137fc565b8554909150600090612612906001906137fc565b9050808214612677576000866000018281548110612632576126326134dc565b9060005260206000200154905080876000018481548110612655576126556134dc565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061268857612688613915565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506105f3565b60009150506105f3565b825474010000000000000000000000000000000000000000900460ff1615806126f4575081155b156126fe57505050565b825460018401546fffffffffffffffffffffffffffffffff8083169291169060009061274490700100000000000000000000000000000000900463ffffffff16426137fc565b905080156128045781831115612786576040517f9725942a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60018601546127c09083908590849070010000000000000000000000000000000090046fffffffffffffffffffffffffffffffff166123bf565b86547fffffffffffffffffffffffff00000000ffffffffffffffffffffffffffffffff167001000000000000000000000000000000004263ffffffff160217875592505b848210156128bb5773ffffffffffffffffffffffffffffffffffffffff8416612863576040517ff94ebcd100000000000000000000000000000000000000000000000000000000815260048101839052602481018690526044016108f9565b6040517f1a76572a000000000000000000000000000000000000000000000000000000008152600481018390526024810186905273ffffffffffffffffffffffffffffffffffffffff851660448201526064016108f9565b848310156129ce5760018681015470010000000000000000000000000000000090046fffffffffffffffffffffffffffffffff169060009082906128ff90826137fc565b612909878a6137fc565b6129139190613902565b61291d9190613944565b905073ffffffffffffffffffffffffffffffffffffffff8616612976576040517f15279c0800000000000000000000000000000000000000000000000000000000815260048101829052602481018690526044016108f9565b6040517fd0c8d23a000000000000000000000000000000000000000000000000000000008152600481018290526024810186905273ffffffffffffffffffffffffffffffffffffffff871660448201526064016108f9565b6129d885846137fc565b86547fffffffffffffffffffffffffffffffff00000000000000000000000000000000166fffffffffffffffffffffffffffffffff82161787556040518681529093507f1871cdf8010e63f2eb8384381a68dfa7416dc571a5517e66e88b2d2d0c0a690a9060200160405180910390a1505050505050565b73ffffffffffffffffffffffffffffffffffffffff81166000908152600183016020526040812054151561193f565b6000818310612a8e578161193f565b5090919050565b508054612aa190613079565b6000825580601f10612ab1575050565b601f0160209004906000526020600020908101906114be91905b80821115612adf5760008155600101612acb565b5090565b600060208284031215612af557600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461193f57600080fd5b803567ffffffffffffffff81168114612b3d57600080fd5b919050565b600060208284031215612b5457600080fd5b61193f82612b25565b6000815180845260005b81811015612b8357602081850181015186830182015201612b67565b5060006020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b60208152600061193f6020830184612b5d565b73ffffffffffffffffffffffffffffffffffffffff811681146114be57600080fd5b8035612b3d81612bd4565b600060208284031215612c1357600080fd5b813561193f81612bd4565b600060208284031215612c3057600080fd5b813567ffffffffffffffff811115612c4757600080fd5b8201610100818503121561193f57600080fd5b60008083601f840112612c6c57600080fd5b50813567ffffffffffffffff811115612c8457600080fd5b6020830191508360208260051b8501011115612c9f57600080fd5b9250929050565b60008060008060408587031215612cbc57600080fd5b843567ffffffffffffffff80821115612cd457600080fd5b612ce088838901612c5a565b90965094506020870135915080821115612cf957600080fd5b50612d0687828801612c5a565b95989497509550505050565b600080600060408486031215612d2757600080fd5b612d3084612b25565b9250602084013567ffffffffffffffff80821115612d4d57600080fd5b818601915086601f830112612d6157600080fd5b813581811115612d7057600080fd5b876020828501011115612d8257600080fd5b6020830194508093505050509250925092565b600060208284031215612da757600080fd5b813567ffffffffffffffff811115612dbe57600080fd5b820160a0818503121561193f57600080fd5b602081526000825160406020840152612dec6060840182612b5d565b905060208401517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0848303016040850152612e278282612b5d565b95945050505050565b6020808252825182820181905260009190848201906040850190845b81811015612e7e57835173ffffffffffffffffffffffffffffffffffffffff1683529284019291840191600101612e4c565b50909695505050505050565b6020808252825182820181905260009190848201906040850190845b81811015612e7e57835167ffffffffffffffff1683529284019291840191600101612ea6565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051610100810167ffffffffffffffff81118282101715612f1f57612f1f612ecc565b60405290565b60405160c0810167ffffffffffffffff81118282101715612f1f57612f1f612ecc565b80151581146114be57600080fd5b8035612b3d81612f48565b80356fffffffffffffffffffffffffffffffff81168114612b3d57600080fd5b600060608284031215612f9357600080fd5b6040516060810181811067ffffffffffffffff82111715612fb657612fb6612ecc565b6040529050808235612fc781612f48565b8152612fd560208401612f61565b6020820152612fe660408401612f61565b60408201525092915050565b600080600060e0848603121561300757600080fd5b61301084612b25565b925061301f8560208601612f81565b915061302e8560808601612f81565b90509250925092565b6000806020838503121561304a57600080fd5b823567ffffffffffffffff81111561306157600080fd5b61306d85828601612c5a565b90969095509350505050565b600181811c9082168061308d57607f821691505b6020821081036130c6577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b600082601f8301126130dd57600080fd5b813567ffffffffffffffff808211156130f8576130f8612ecc565b604051601f83017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810190828211818310171561313e5761313e612ecc565b8160405283815286602085880101111561315757600080fd5b836020870160208301376000602085830101528094505050505092915050565b6000610100823603121561318a57600080fd5b613192612efb565b823567ffffffffffffffff808211156131aa57600080fd5b6131b6368387016130cc565b83526131c460208601612b25565b60208401526131d560408601612bf6565b6040840152606085013560608401526131f060808601612bf6565b608084015260a085013591508082111561320957600080fd5b613215368387016130cc565b60a084015260c085013591508082111561322e57600080fd5b61323a368387016130cc565b60c084015260e085013591508082111561325357600080fd5b50613260368286016130cc565b60e08301525092915050565b601f821115611022576000816000526020600020601f850160051c810160208610156132955750805b601f850160051c820191505b818110156132b4578281556001016132a1565b505050505050565b67ffffffffffffffff8311156132d4576132d4612ecc565b6132e8836132e28354613079565b8361326c565b6000601f84116001811461333a57600085156133045750838201355b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600387901b1c1916600186901b178355611bac565b6000838152602090207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0861690835b828110156133895786850135825560209485019460019092019101613369565b50868210156133c4577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60f88860031b161c19848701351681555b505060018560011b0183555050505050565b6040815260006133e96040830186612b5d565b82810360208401528381528385602083013760006020858301015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f860116820101915050949350505050565b600060a0823603121561344c57600080fd5b60405160a0810167ffffffffffffffff828210818311171561347057613470612ecc565b81604052843591508082111561348557600080fd5b50613492368286016130cc565b8252506134a160208401612b25565b602082015260408301356134b481612bd4565b60408201526060838101359082015260808301356134d181612bd4565b608082015292915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600082357ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec183360301811261353f57600080fd5b9190910192915050565b6000610140823603121561355c57600080fd5b613564612f25565b61356d83612b25565b815261357b60208401612f56565b6020820152604083013567ffffffffffffffff8082111561359b57600080fd5b6135a7368387016130cc565b604084015260608501359150808211156135c057600080fd5b506135cd368286016130cc565b6060830152506135e03660808501612f81565b60808201526135f23660e08501612f81565b60a082015292915050565b815167ffffffffffffffff81111561361757613617612ecc565b61362b816136258454613079565b8461326c565b602080601f83116001811461367e57600084156136485750858301515b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600386901b1c1916600185901b1785556132b4565b6000858152602081207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08616915b828110156136cb578886015182559484019460019091019084016136ac565b508582101561370757878501517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600388901b60f8161c191681555b5050505050600190811b01905550565b600061010067ffffffffffffffff8716835280602084015261373b81840187612b5d565b8551151560408581019190915260208701516fffffffffffffffffffffffffffffffff90811660608701529087015116608085015291506137799050565b8251151560a083015260208301516fffffffffffffffffffffffffffffffff90811660c084015260408401511660e0830152612e27565b6000602082840312156137c257600080fd5b815161193f81612f48565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b818103818111156105f3576105f36137cd565b67ffffffffffffffff8416815260e0810161385b60208301858051151582526020808201516fffffffffffffffffffffffffffffffff9081169184019190915260409182015116910152565b82511515608083015260208301516fffffffffffffffffffffffffffffffff90811660a084015260408401511660c08301526123e1565b606081016105f382848051151582526020808201516fffffffffffffffffffffffffffffffff9081169184019190915260409182015116910152565b6000602082840312156138e057600080fd5b815161193f81612bd4565b80820281158282048414176105f3576105f36137cd565b808201808211156105f3576105f36137cd565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b60008261397a577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b50049056fea164736f6c6343000818000a", +} + +var BurnMintTokenPoolABI = BurnMintTokenPoolMetaData.ABI + +var BurnMintTokenPoolBin = BurnMintTokenPoolMetaData.Bin + +func DeployBurnMintTokenPool(auth *bind.TransactOpts, backend bind.ContractBackend, token common.Address, allowlist []common.Address, rmnProxy common.Address, router common.Address) (common.Address, *types.Transaction, *BurnMintTokenPool, error) { + parsed, err := BurnMintTokenPoolMetaData.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(BurnMintTokenPoolBin), backend, token, allowlist, rmnProxy, router) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &BurnMintTokenPool{address: address, abi: *parsed, BurnMintTokenPoolCaller: BurnMintTokenPoolCaller{contract: contract}, BurnMintTokenPoolTransactor: BurnMintTokenPoolTransactor{contract: contract}, BurnMintTokenPoolFilterer: BurnMintTokenPoolFilterer{contract: contract}}, nil +} + +type BurnMintTokenPool struct { + address common.Address + abi abi.ABI + BurnMintTokenPoolCaller + BurnMintTokenPoolTransactor + BurnMintTokenPoolFilterer +} + +type BurnMintTokenPoolCaller struct { + contract *bind.BoundContract +} + +type BurnMintTokenPoolTransactor struct { + contract *bind.BoundContract +} + +type BurnMintTokenPoolFilterer struct { + contract *bind.BoundContract +} + +type BurnMintTokenPoolSession struct { + Contract *BurnMintTokenPool + CallOpts bind.CallOpts + TransactOpts bind.TransactOpts +} + +type BurnMintTokenPoolCallerSession struct { + Contract *BurnMintTokenPoolCaller + CallOpts bind.CallOpts +} + +type BurnMintTokenPoolTransactorSession struct { + Contract *BurnMintTokenPoolTransactor + TransactOpts bind.TransactOpts +} + +type BurnMintTokenPoolRaw struct { + Contract *BurnMintTokenPool +} + +type BurnMintTokenPoolCallerRaw struct { + Contract *BurnMintTokenPoolCaller +} + +type BurnMintTokenPoolTransactorRaw struct { + Contract *BurnMintTokenPoolTransactor +} + +func NewBurnMintTokenPool(address common.Address, backend bind.ContractBackend) (*BurnMintTokenPool, error) { + abi, err := abi.JSON(strings.NewReader(BurnMintTokenPoolABI)) + if err != nil { + return nil, err + } + contract, err := bindBurnMintTokenPool(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &BurnMintTokenPool{address: address, abi: abi, BurnMintTokenPoolCaller: BurnMintTokenPoolCaller{contract: contract}, BurnMintTokenPoolTransactor: BurnMintTokenPoolTransactor{contract: contract}, BurnMintTokenPoolFilterer: BurnMintTokenPoolFilterer{contract: contract}}, nil +} + +func NewBurnMintTokenPoolCaller(address common.Address, caller bind.ContractCaller) (*BurnMintTokenPoolCaller, error) { + contract, err := bindBurnMintTokenPool(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &BurnMintTokenPoolCaller{contract: contract}, nil +} + +func NewBurnMintTokenPoolTransactor(address common.Address, transactor bind.ContractTransactor) (*BurnMintTokenPoolTransactor, error) { + contract, err := bindBurnMintTokenPool(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &BurnMintTokenPoolTransactor{contract: contract}, nil +} + +func NewBurnMintTokenPoolFilterer(address common.Address, filterer bind.ContractFilterer) (*BurnMintTokenPoolFilterer, error) { + contract, err := bindBurnMintTokenPool(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &BurnMintTokenPoolFilterer{contract: contract}, nil +} + +func bindBurnMintTokenPool(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := BurnMintTokenPoolMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +func (_BurnMintTokenPool *BurnMintTokenPoolRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _BurnMintTokenPool.Contract.BurnMintTokenPoolCaller.contract.Call(opts, result, method, params...) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _BurnMintTokenPool.Contract.BurnMintTokenPoolTransactor.contract.Transfer(opts) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _BurnMintTokenPool.Contract.BurnMintTokenPoolTransactor.contract.Transact(opts, method, params...) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _BurnMintTokenPool.Contract.contract.Call(opts, result, method, params...) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _BurnMintTokenPool.Contract.contract.Transfer(opts) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _BurnMintTokenPool.Contract.contract.Transact(opts, method, params...) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolCaller) GetAllowList(opts *bind.CallOpts) ([]common.Address, error) { + var out []interface{} + err := _BurnMintTokenPool.contract.Call(opts, &out, "getAllowList") + + if err != nil { + return *new([]common.Address), err + } + + out0 := *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) + + return out0, err + +} + +func (_BurnMintTokenPool *BurnMintTokenPoolSession) GetAllowList() ([]common.Address, error) { + return _BurnMintTokenPool.Contract.GetAllowList(&_BurnMintTokenPool.CallOpts) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolCallerSession) GetAllowList() ([]common.Address, error) { + return _BurnMintTokenPool.Contract.GetAllowList(&_BurnMintTokenPool.CallOpts) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolCaller) GetAllowListEnabled(opts *bind.CallOpts) (bool, error) { + var out []interface{} + err := _BurnMintTokenPool.contract.Call(opts, &out, "getAllowListEnabled") + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_BurnMintTokenPool *BurnMintTokenPoolSession) GetAllowListEnabled() (bool, error) { + return _BurnMintTokenPool.Contract.GetAllowListEnabled(&_BurnMintTokenPool.CallOpts) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolCallerSession) GetAllowListEnabled() (bool, error) { + return _BurnMintTokenPool.Contract.GetAllowListEnabled(&_BurnMintTokenPool.CallOpts) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolCaller) GetCurrentInboundRateLimiterState(opts *bind.CallOpts, remoteChainSelector uint64) (RateLimiterTokenBucket, error) { + var out []interface{} + err := _BurnMintTokenPool.contract.Call(opts, &out, "getCurrentInboundRateLimiterState", remoteChainSelector) + + if err != nil { + return *new(RateLimiterTokenBucket), err + } + + out0 := *abi.ConvertType(out[0], new(RateLimiterTokenBucket)).(*RateLimiterTokenBucket) + + return out0, err + +} + +func (_BurnMintTokenPool *BurnMintTokenPoolSession) GetCurrentInboundRateLimiterState(remoteChainSelector uint64) (RateLimiterTokenBucket, error) { + return _BurnMintTokenPool.Contract.GetCurrentInboundRateLimiterState(&_BurnMintTokenPool.CallOpts, remoteChainSelector) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolCallerSession) GetCurrentInboundRateLimiterState(remoteChainSelector uint64) (RateLimiterTokenBucket, error) { + return _BurnMintTokenPool.Contract.GetCurrentInboundRateLimiterState(&_BurnMintTokenPool.CallOpts, remoteChainSelector) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolCaller) GetCurrentOutboundRateLimiterState(opts *bind.CallOpts, remoteChainSelector uint64) (RateLimiterTokenBucket, error) { + var out []interface{} + err := _BurnMintTokenPool.contract.Call(opts, &out, "getCurrentOutboundRateLimiterState", remoteChainSelector) + + if err != nil { + return *new(RateLimiterTokenBucket), err + } + + out0 := *abi.ConvertType(out[0], new(RateLimiterTokenBucket)).(*RateLimiterTokenBucket) + + return out0, err + +} + +func (_BurnMintTokenPool *BurnMintTokenPoolSession) GetCurrentOutboundRateLimiterState(remoteChainSelector uint64) (RateLimiterTokenBucket, error) { + return _BurnMintTokenPool.Contract.GetCurrentOutboundRateLimiterState(&_BurnMintTokenPool.CallOpts, remoteChainSelector) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolCallerSession) GetCurrentOutboundRateLimiterState(remoteChainSelector uint64) (RateLimiterTokenBucket, error) { + return _BurnMintTokenPool.Contract.GetCurrentOutboundRateLimiterState(&_BurnMintTokenPool.CallOpts, remoteChainSelector) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolCaller) GetRateLimitAdmin(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _BurnMintTokenPool.contract.Call(opts, &out, "getRateLimitAdmin") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_BurnMintTokenPool *BurnMintTokenPoolSession) GetRateLimitAdmin() (common.Address, error) { + return _BurnMintTokenPool.Contract.GetRateLimitAdmin(&_BurnMintTokenPool.CallOpts) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolCallerSession) GetRateLimitAdmin() (common.Address, error) { + return _BurnMintTokenPool.Contract.GetRateLimitAdmin(&_BurnMintTokenPool.CallOpts) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolCaller) GetRemotePool(opts *bind.CallOpts, remoteChainSelector uint64) ([]byte, error) { + var out []interface{} + err := _BurnMintTokenPool.contract.Call(opts, &out, "getRemotePool", remoteChainSelector) + + if err != nil { + return *new([]byte), err + } + + out0 := *abi.ConvertType(out[0], new([]byte)).(*[]byte) + + return out0, err + +} + +func (_BurnMintTokenPool *BurnMintTokenPoolSession) GetRemotePool(remoteChainSelector uint64) ([]byte, error) { + return _BurnMintTokenPool.Contract.GetRemotePool(&_BurnMintTokenPool.CallOpts, remoteChainSelector) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolCallerSession) GetRemotePool(remoteChainSelector uint64) ([]byte, error) { + return _BurnMintTokenPool.Contract.GetRemotePool(&_BurnMintTokenPool.CallOpts, remoteChainSelector) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolCaller) GetRemoteToken(opts *bind.CallOpts, remoteChainSelector uint64) ([]byte, error) { + var out []interface{} + err := _BurnMintTokenPool.contract.Call(opts, &out, "getRemoteToken", remoteChainSelector) + + if err != nil { + return *new([]byte), err + } + + out0 := *abi.ConvertType(out[0], new([]byte)).(*[]byte) + + return out0, err + +} + +func (_BurnMintTokenPool *BurnMintTokenPoolSession) GetRemoteToken(remoteChainSelector uint64) ([]byte, error) { + return _BurnMintTokenPool.Contract.GetRemoteToken(&_BurnMintTokenPool.CallOpts, remoteChainSelector) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolCallerSession) GetRemoteToken(remoteChainSelector uint64) ([]byte, error) { + return _BurnMintTokenPool.Contract.GetRemoteToken(&_BurnMintTokenPool.CallOpts, remoteChainSelector) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolCaller) GetRmnProxy(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _BurnMintTokenPool.contract.Call(opts, &out, "getRmnProxy") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_BurnMintTokenPool *BurnMintTokenPoolSession) GetRmnProxy() (common.Address, error) { + return _BurnMintTokenPool.Contract.GetRmnProxy(&_BurnMintTokenPool.CallOpts) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolCallerSession) GetRmnProxy() (common.Address, error) { + return _BurnMintTokenPool.Contract.GetRmnProxy(&_BurnMintTokenPool.CallOpts) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolCaller) GetRouter(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _BurnMintTokenPool.contract.Call(opts, &out, "getRouter") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_BurnMintTokenPool *BurnMintTokenPoolSession) GetRouter() (common.Address, error) { + return _BurnMintTokenPool.Contract.GetRouter(&_BurnMintTokenPool.CallOpts) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolCallerSession) GetRouter() (common.Address, error) { + return _BurnMintTokenPool.Contract.GetRouter(&_BurnMintTokenPool.CallOpts) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolCaller) GetSupportedChains(opts *bind.CallOpts) ([]uint64, error) { + var out []interface{} + err := _BurnMintTokenPool.contract.Call(opts, &out, "getSupportedChains") + + if err != nil { + return *new([]uint64), err + } + + out0 := *abi.ConvertType(out[0], new([]uint64)).(*[]uint64) + + return out0, err + +} + +func (_BurnMintTokenPool *BurnMintTokenPoolSession) GetSupportedChains() ([]uint64, error) { + return _BurnMintTokenPool.Contract.GetSupportedChains(&_BurnMintTokenPool.CallOpts) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolCallerSession) GetSupportedChains() ([]uint64, error) { + return _BurnMintTokenPool.Contract.GetSupportedChains(&_BurnMintTokenPool.CallOpts) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolCaller) GetToken(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _BurnMintTokenPool.contract.Call(opts, &out, "getToken") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_BurnMintTokenPool *BurnMintTokenPoolSession) GetToken() (common.Address, error) { + return _BurnMintTokenPool.Contract.GetToken(&_BurnMintTokenPool.CallOpts) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolCallerSession) GetToken() (common.Address, error) { + return _BurnMintTokenPool.Contract.GetToken(&_BurnMintTokenPool.CallOpts) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolCaller) IsSupportedChain(opts *bind.CallOpts, remoteChainSelector uint64) (bool, error) { + var out []interface{} + err := _BurnMintTokenPool.contract.Call(opts, &out, "isSupportedChain", remoteChainSelector) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_BurnMintTokenPool *BurnMintTokenPoolSession) IsSupportedChain(remoteChainSelector uint64) (bool, error) { + return _BurnMintTokenPool.Contract.IsSupportedChain(&_BurnMintTokenPool.CallOpts, remoteChainSelector) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolCallerSession) IsSupportedChain(remoteChainSelector uint64) (bool, error) { + return _BurnMintTokenPool.Contract.IsSupportedChain(&_BurnMintTokenPool.CallOpts, remoteChainSelector) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolCaller) IsSupportedToken(opts *bind.CallOpts, token common.Address) (bool, error) { + var out []interface{} + err := _BurnMintTokenPool.contract.Call(opts, &out, "isSupportedToken", token) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_BurnMintTokenPool *BurnMintTokenPoolSession) IsSupportedToken(token common.Address) (bool, error) { + return _BurnMintTokenPool.Contract.IsSupportedToken(&_BurnMintTokenPool.CallOpts, token) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolCallerSession) IsSupportedToken(token common.Address) (bool, error) { + return _BurnMintTokenPool.Contract.IsSupportedToken(&_BurnMintTokenPool.CallOpts, token) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolCaller) Owner(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _BurnMintTokenPool.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 + +} + +func (_BurnMintTokenPool *BurnMintTokenPoolSession) Owner() (common.Address, error) { + return _BurnMintTokenPool.Contract.Owner(&_BurnMintTokenPool.CallOpts) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolCallerSession) Owner() (common.Address, error) { + return _BurnMintTokenPool.Contract.Owner(&_BurnMintTokenPool.CallOpts) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolCaller) SupportsInterface(opts *bind.CallOpts, interfaceId [4]byte) (bool, error) { + var out []interface{} + err := _BurnMintTokenPool.contract.Call(opts, &out, "supportsInterface", interfaceId) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_BurnMintTokenPool *BurnMintTokenPoolSession) SupportsInterface(interfaceId [4]byte) (bool, error) { + return _BurnMintTokenPool.Contract.SupportsInterface(&_BurnMintTokenPool.CallOpts, interfaceId) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolCallerSession) SupportsInterface(interfaceId [4]byte) (bool, error) { + return _BurnMintTokenPool.Contract.SupportsInterface(&_BurnMintTokenPool.CallOpts, interfaceId) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolCaller) TypeAndVersion(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _BurnMintTokenPool.contract.Call(opts, &out, "typeAndVersion") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +func (_BurnMintTokenPool *BurnMintTokenPoolSession) TypeAndVersion() (string, error) { + return _BurnMintTokenPool.Contract.TypeAndVersion(&_BurnMintTokenPool.CallOpts) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolCallerSession) TypeAndVersion() (string, error) { + return _BurnMintTokenPool.Contract.TypeAndVersion(&_BurnMintTokenPool.CallOpts) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolTransactor) AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + return _BurnMintTokenPool.contract.Transact(opts, "acceptOwnership") +} + +func (_BurnMintTokenPool *BurnMintTokenPoolSession) AcceptOwnership() (*types.Transaction, error) { + return _BurnMintTokenPool.Contract.AcceptOwnership(&_BurnMintTokenPool.TransactOpts) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolTransactorSession) AcceptOwnership() (*types.Transaction, error) { + return _BurnMintTokenPool.Contract.AcceptOwnership(&_BurnMintTokenPool.TransactOpts) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolTransactor) ApplyAllowListUpdates(opts *bind.TransactOpts, removes []common.Address, adds []common.Address) (*types.Transaction, error) { + return _BurnMintTokenPool.contract.Transact(opts, "applyAllowListUpdates", removes, adds) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolSession) ApplyAllowListUpdates(removes []common.Address, adds []common.Address) (*types.Transaction, error) { + return _BurnMintTokenPool.Contract.ApplyAllowListUpdates(&_BurnMintTokenPool.TransactOpts, removes, adds) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolTransactorSession) ApplyAllowListUpdates(removes []common.Address, adds []common.Address) (*types.Transaction, error) { + return _BurnMintTokenPool.Contract.ApplyAllowListUpdates(&_BurnMintTokenPool.TransactOpts, removes, adds) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolTransactor) ApplyChainUpdates(opts *bind.TransactOpts, chains []TokenPoolChainUpdate) (*types.Transaction, error) { + return _BurnMintTokenPool.contract.Transact(opts, "applyChainUpdates", chains) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolSession) ApplyChainUpdates(chains []TokenPoolChainUpdate) (*types.Transaction, error) { + return _BurnMintTokenPool.Contract.ApplyChainUpdates(&_BurnMintTokenPool.TransactOpts, chains) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolTransactorSession) ApplyChainUpdates(chains []TokenPoolChainUpdate) (*types.Transaction, error) { + return _BurnMintTokenPool.Contract.ApplyChainUpdates(&_BurnMintTokenPool.TransactOpts, chains) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolTransactor) LockOrBurn(opts *bind.TransactOpts, lockOrBurnIn PoolLockOrBurnInV1) (*types.Transaction, error) { + return _BurnMintTokenPool.contract.Transact(opts, "lockOrBurn", lockOrBurnIn) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolSession) LockOrBurn(lockOrBurnIn PoolLockOrBurnInV1) (*types.Transaction, error) { + return _BurnMintTokenPool.Contract.LockOrBurn(&_BurnMintTokenPool.TransactOpts, lockOrBurnIn) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolTransactorSession) LockOrBurn(lockOrBurnIn PoolLockOrBurnInV1) (*types.Transaction, error) { + return _BurnMintTokenPool.Contract.LockOrBurn(&_BurnMintTokenPool.TransactOpts, lockOrBurnIn) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolTransactor) ReleaseOrMint(opts *bind.TransactOpts, releaseOrMintIn PoolReleaseOrMintInV1) (*types.Transaction, error) { + return _BurnMintTokenPool.contract.Transact(opts, "releaseOrMint", releaseOrMintIn) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolSession) ReleaseOrMint(releaseOrMintIn PoolReleaseOrMintInV1) (*types.Transaction, error) { + return _BurnMintTokenPool.Contract.ReleaseOrMint(&_BurnMintTokenPool.TransactOpts, releaseOrMintIn) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolTransactorSession) ReleaseOrMint(releaseOrMintIn PoolReleaseOrMintInV1) (*types.Transaction, error) { + return _BurnMintTokenPool.Contract.ReleaseOrMint(&_BurnMintTokenPool.TransactOpts, releaseOrMintIn) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolTransactor) SetChainRateLimiterConfig(opts *bind.TransactOpts, remoteChainSelector uint64, outboundConfig RateLimiterConfig, inboundConfig RateLimiterConfig) (*types.Transaction, error) { + return _BurnMintTokenPool.contract.Transact(opts, "setChainRateLimiterConfig", remoteChainSelector, outboundConfig, inboundConfig) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolSession) SetChainRateLimiterConfig(remoteChainSelector uint64, outboundConfig RateLimiterConfig, inboundConfig RateLimiterConfig) (*types.Transaction, error) { + return _BurnMintTokenPool.Contract.SetChainRateLimiterConfig(&_BurnMintTokenPool.TransactOpts, remoteChainSelector, outboundConfig, inboundConfig) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolTransactorSession) SetChainRateLimiterConfig(remoteChainSelector uint64, outboundConfig RateLimiterConfig, inboundConfig RateLimiterConfig) (*types.Transaction, error) { + return _BurnMintTokenPool.Contract.SetChainRateLimiterConfig(&_BurnMintTokenPool.TransactOpts, remoteChainSelector, outboundConfig, inboundConfig) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolTransactor) SetRateLimitAdmin(opts *bind.TransactOpts, rateLimitAdmin common.Address) (*types.Transaction, error) { + return _BurnMintTokenPool.contract.Transact(opts, "setRateLimitAdmin", rateLimitAdmin) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolSession) SetRateLimitAdmin(rateLimitAdmin common.Address) (*types.Transaction, error) { + return _BurnMintTokenPool.Contract.SetRateLimitAdmin(&_BurnMintTokenPool.TransactOpts, rateLimitAdmin) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolTransactorSession) SetRateLimitAdmin(rateLimitAdmin common.Address) (*types.Transaction, error) { + return _BurnMintTokenPool.Contract.SetRateLimitAdmin(&_BurnMintTokenPool.TransactOpts, rateLimitAdmin) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolTransactor) SetRemotePool(opts *bind.TransactOpts, remoteChainSelector uint64, remotePoolAddress []byte) (*types.Transaction, error) { + return _BurnMintTokenPool.contract.Transact(opts, "setRemotePool", remoteChainSelector, remotePoolAddress) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolSession) SetRemotePool(remoteChainSelector uint64, remotePoolAddress []byte) (*types.Transaction, error) { + return _BurnMintTokenPool.Contract.SetRemotePool(&_BurnMintTokenPool.TransactOpts, remoteChainSelector, remotePoolAddress) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolTransactorSession) SetRemotePool(remoteChainSelector uint64, remotePoolAddress []byte) (*types.Transaction, error) { + return _BurnMintTokenPool.Contract.SetRemotePool(&_BurnMintTokenPool.TransactOpts, remoteChainSelector, remotePoolAddress) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolTransactor) SetRouter(opts *bind.TransactOpts, newRouter common.Address) (*types.Transaction, error) { + return _BurnMintTokenPool.contract.Transact(opts, "setRouter", newRouter) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolSession) SetRouter(newRouter common.Address) (*types.Transaction, error) { + return _BurnMintTokenPool.Contract.SetRouter(&_BurnMintTokenPool.TransactOpts, newRouter) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolTransactorSession) SetRouter(newRouter common.Address) (*types.Transaction, error) { + return _BurnMintTokenPool.Contract.SetRouter(&_BurnMintTokenPool.TransactOpts, newRouter) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolTransactor) TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) { + return _BurnMintTokenPool.contract.Transact(opts, "transferOwnership", to) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolSession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _BurnMintTokenPool.Contract.TransferOwnership(&_BurnMintTokenPool.TransactOpts, to) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolTransactorSession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _BurnMintTokenPool.Contract.TransferOwnership(&_BurnMintTokenPool.TransactOpts, to) +} + +type BurnMintTokenPoolAllowListAddIterator struct { + Event *BurnMintTokenPoolAllowListAdd + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *BurnMintTokenPoolAllowListAddIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolAllowListAdd) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolAllowListAdd) + 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() + } +} + +func (it *BurnMintTokenPoolAllowListAddIterator) Error() error { + return it.fail +} + +func (it *BurnMintTokenPoolAllowListAddIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type BurnMintTokenPoolAllowListAdd struct { + Sender common.Address + Raw types.Log +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) FilterAllowListAdd(opts *bind.FilterOpts) (*BurnMintTokenPoolAllowListAddIterator, error) { + + logs, sub, err := _BurnMintTokenPool.contract.FilterLogs(opts, "AllowListAdd") + if err != nil { + return nil, err + } + return &BurnMintTokenPoolAllowListAddIterator{contract: _BurnMintTokenPool.contract, event: "AllowListAdd", logs: logs, sub: sub}, nil +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) WatchAllowListAdd(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolAllowListAdd) (event.Subscription, error) { + + logs, sub, err := _BurnMintTokenPool.contract.WatchLogs(opts, "AllowListAdd") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(BurnMintTokenPoolAllowListAdd) + if err := _BurnMintTokenPool.contract.UnpackLog(event, "AllowListAdd", 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 +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) ParseAllowListAdd(log types.Log) (*BurnMintTokenPoolAllowListAdd, error) { + event := new(BurnMintTokenPoolAllowListAdd) + if err := _BurnMintTokenPool.contract.UnpackLog(event, "AllowListAdd", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type BurnMintTokenPoolAllowListRemoveIterator struct { + Event *BurnMintTokenPoolAllowListRemove + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *BurnMintTokenPoolAllowListRemoveIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolAllowListRemove) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolAllowListRemove) + 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() + } +} + +func (it *BurnMintTokenPoolAllowListRemoveIterator) Error() error { + return it.fail +} + +func (it *BurnMintTokenPoolAllowListRemoveIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type BurnMintTokenPoolAllowListRemove struct { + Sender common.Address + Raw types.Log +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) FilterAllowListRemove(opts *bind.FilterOpts) (*BurnMintTokenPoolAllowListRemoveIterator, error) { + + logs, sub, err := _BurnMintTokenPool.contract.FilterLogs(opts, "AllowListRemove") + if err != nil { + return nil, err + } + return &BurnMintTokenPoolAllowListRemoveIterator{contract: _BurnMintTokenPool.contract, event: "AllowListRemove", logs: logs, sub: sub}, nil +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) WatchAllowListRemove(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolAllowListRemove) (event.Subscription, error) { + + logs, sub, err := _BurnMintTokenPool.contract.WatchLogs(opts, "AllowListRemove") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(BurnMintTokenPoolAllowListRemove) + if err := _BurnMintTokenPool.contract.UnpackLog(event, "AllowListRemove", 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 +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) ParseAllowListRemove(log types.Log) (*BurnMintTokenPoolAllowListRemove, error) { + event := new(BurnMintTokenPoolAllowListRemove) + if err := _BurnMintTokenPool.contract.UnpackLog(event, "AllowListRemove", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type BurnMintTokenPoolBurnedIterator struct { + Event *BurnMintTokenPoolBurned + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *BurnMintTokenPoolBurnedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolBurned) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolBurned) + 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() + } +} + +func (it *BurnMintTokenPoolBurnedIterator) Error() error { + return it.fail +} + +func (it *BurnMintTokenPoolBurnedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type BurnMintTokenPoolBurned struct { + Sender common.Address + Amount *big.Int + Raw types.Log +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) FilterBurned(opts *bind.FilterOpts, sender []common.Address) (*BurnMintTokenPoolBurnedIterator, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _BurnMintTokenPool.contract.FilterLogs(opts, "Burned", senderRule) + if err != nil { + return nil, err + } + return &BurnMintTokenPoolBurnedIterator{contract: _BurnMintTokenPool.contract, event: "Burned", logs: logs, sub: sub}, nil +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) WatchBurned(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolBurned, sender []common.Address) (event.Subscription, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _BurnMintTokenPool.contract.WatchLogs(opts, "Burned", senderRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(BurnMintTokenPoolBurned) + if err := _BurnMintTokenPool.contract.UnpackLog(event, "Burned", 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 +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) ParseBurned(log types.Log) (*BurnMintTokenPoolBurned, error) { + event := new(BurnMintTokenPoolBurned) + if err := _BurnMintTokenPool.contract.UnpackLog(event, "Burned", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type BurnMintTokenPoolChainAddedIterator struct { + Event *BurnMintTokenPoolChainAdded + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *BurnMintTokenPoolChainAddedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolChainAdded) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolChainAdded) + 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() + } +} + +func (it *BurnMintTokenPoolChainAddedIterator) Error() error { + return it.fail +} + +func (it *BurnMintTokenPoolChainAddedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type BurnMintTokenPoolChainAdded struct { + RemoteChainSelector uint64 + RemoteToken []byte + OutboundRateLimiterConfig RateLimiterConfig + InboundRateLimiterConfig RateLimiterConfig + Raw types.Log +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) FilterChainAdded(opts *bind.FilterOpts) (*BurnMintTokenPoolChainAddedIterator, error) { + + logs, sub, err := _BurnMintTokenPool.contract.FilterLogs(opts, "ChainAdded") + if err != nil { + return nil, err + } + return &BurnMintTokenPoolChainAddedIterator{contract: _BurnMintTokenPool.contract, event: "ChainAdded", logs: logs, sub: sub}, nil +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) WatchChainAdded(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolChainAdded) (event.Subscription, error) { + + logs, sub, err := _BurnMintTokenPool.contract.WatchLogs(opts, "ChainAdded") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(BurnMintTokenPoolChainAdded) + if err := _BurnMintTokenPool.contract.UnpackLog(event, "ChainAdded", 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 +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) ParseChainAdded(log types.Log) (*BurnMintTokenPoolChainAdded, error) { + event := new(BurnMintTokenPoolChainAdded) + if err := _BurnMintTokenPool.contract.UnpackLog(event, "ChainAdded", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type BurnMintTokenPoolChainConfiguredIterator struct { + Event *BurnMintTokenPoolChainConfigured + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *BurnMintTokenPoolChainConfiguredIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolChainConfigured) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolChainConfigured) + 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() + } +} + +func (it *BurnMintTokenPoolChainConfiguredIterator) Error() error { + return it.fail +} + +func (it *BurnMintTokenPoolChainConfiguredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type BurnMintTokenPoolChainConfigured struct { + RemoteChainSelector uint64 + OutboundRateLimiterConfig RateLimiterConfig + InboundRateLimiterConfig RateLimiterConfig + Raw types.Log +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) FilterChainConfigured(opts *bind.FilterOpts) (*BurnMintTokenPoolChainConfiguredIterator, error) { + + logs, sub, err := _BurnMintTokenPool.contract.FilterLogs(opts, "ChainConfigured") + if err != nil { + return nil, err + } + return &BurnMintTokenPoolChainConfiguredIterator{contract: _BurnMintTokenPool.contract, event: "ChainConfigured", logs: logs, sub: sub}, nil +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) WatchChainConfigured(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolChainConfigured) (event.Subscription, error) { + + logs, sub, err := _BurnMintTokenPool.contract.WatchLogs(opts, "ChainConfigured") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(BurnMintTokenPoolChainConfigured) + if err := _BurnMintTokenPool.contract.UnpackLog(event, "ChainConfigured", 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 +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) ParseChainConfigured(log types.Log) (*BurnMintTokenPoolChainConfigured, error) { + event := new(BurnMintTokenPoolChainConfigured) + if err := _BurnMintTokenPool.contract.UnpackLog(event, "ChainConfigured", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type BurnMintTokenPoolChainRemovedIterator struct { + Event *BurnMintTokenPoolChainRemoved + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *BurnMintTokenPoolChainRemovedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolChainRemoved) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolChainRemoved) + 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() + } +} + +func (it *BurnMintTokenPoolChainRemovedIterator) Error() error { + return it.fail +} + +func (it *BurnMintTokenPoolChainRemovedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type BurnMintTokenPoolChainRemoved struct { + RemoteChainSelector uint64 + Raw types.Log +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) FilterChainRemoved(opts *bind.FilterOpts) (*BurnMintTokenPoolChainRemovedIterator, error) { + + logs, sub, err := _BurnMintTokenPool.contract.FilterLogs(opts, "ChainRemoved") + if err != nil { + return nil, err + } + return &BurnMintTokenPoolChainRemovedIterator{contract: _BurnMintTokenPool.contract, event: "ChainRemoved", logs: logs, sub: sub}, nil +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) WatchChainRemoved(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolChainRemoved) (event.Subscription, error) { + + logs, sub, err := _BurnMintTokenPool.contract.WatchLogs(opts, "ChainRemoved") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(BurnMintTokenPoolChainRemoved) + if err := _BurnMintTokenPool.contract.UnpackLog(event, "ChainRemoved", 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 +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) ParseChainRemoved(log types.Log) (*BurnMintTokenPoolChainRemoved, error) { + event := new(BurnMintTokenPoolChainRemoved) + if err := _BurnMintTokenPool.contract.UnpackLog(event, "ChainRemoved", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type BurnMintTokenPoolConfigChangedIterator struct { + Event *BurnMintTokenPoolConfigChanged + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *BurnMintTokenPoolConfigChangedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolConfigChanged) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolConfigChanged) + 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() + } +} + +func (it *BurnMintTokenPoolConfigChangedIterator) Error() error { + return it.fail +} + +func (it *BurnMintTokenPoolConfigChangedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type BurnMintTokenPoolConfigChanged struct { + Config RateLimiterConfig + Raw types.Log +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) FilterConfigChanged(opts *bind.FilterOpts) (*BurnMintTokenPoolConfigChangedIterator, error) { + + logs, sub, err := _BurnMintTokenPool.contract.FilterLogs(opts, "ConfigChanged") + if err != nil { + return nil, err + } + return &BurnMintTokenPoolConfigChangedIterator{contract: _BurnMintTokenPool.contract, event: "ConfigChanged", logs: logs, sub: sub}, nil +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) WatchConfigChanged(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolConfigChanged) (event.Subscription, error) { + + logs, sub, err := _BurnMintTokenPool.contract.WatchLogs(opts, "ConfigChanged") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(BurnMintTokenPoolConfigChanged) + if err := _BurnMintTokenPool.contract.UnpackLog(event, "ConfigChanged", 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 +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) ParseConfigChanged(log types.Log) (*BurnMintTokenPoolConfigChanged, error) { + event := new(BurnMintTokenPoolConfigChanged) + if err := _BurnMintTokenPool.contract.UnpackLog(event, "ConfigChanged", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type BurnMintTokenPoolLockedIterator struct { + Event *BurnMintTokenPoolLocked + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *BurnMintTokenPoolLockedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolLocked) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolLocked) + 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() + } +} + +func (it *BurnMintTokenPoolLockedIterator) Error() error { + return it.fail +} + +func (it *BurnMintTokenPoolLockedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type BurnMintTokenPoolLocked struct { + Sender common.Address + Amount *big.Int + Raw types.Log +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) FilterLocked(opts *bind.FilterOpts, sender []common.Address) (*BurnMintTokenPoolLockedIterator, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _BurnMintTokenPool.contract.FilterLogs(opts, "Locked", senderRule) + if err != nil { + return nil, err + } + return &BurnMintTokenPoolLockedIterator{contract: _BurnMintTokenPool.contract, event: "Locked", logs: logs, sub: sub}, nil +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) WatchLocked(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolLocked, sender []common.Address) (event.Subscription, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _BurnMintTokenPool.contract.WatchLogs(opts, "Locked", senderRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(BurnMintTokenPoolLocked) + if err := _BurnMintTokenPool.contract.UnpackLog(event, "Locked", 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 +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) ParseLocked(log types.Log) (*BurnMintTokenPoolLocked, error) { + event := new(BurnMintTokenPoolLocked) + if err := _BurnMintTokenPool.contract.UnpackLog(event, "Locked", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type BurnMintTokenPoolMintedIterator struct { + Event *BurnMintTokenPoolMinted + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *BurnMintTokenPoolMintedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolMinted) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolMinted) + 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() + } +} + +func (it *BurnMintTokenPoolMintedIterator) Error() error { + return it.fail +} + +func (it *BurnMintTokenPoolMintedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type BurnMintTokenPoolMinted struct { + Sender common.Address + Recipient common.Address + Amount *big.Int + Raw types.Log +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) FilterMinted(opts *bind.FilterOpts, sender []common.Address, recipient []common.Address) (*BurnMintTokenPoolMintedIterator, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + var recipientRule []interface{} + for _, recipientItem := range recipient { + recipientRule = append(recipientRule, recipientItem) + } + + logs, sub, err := _BurnMintTokenPool.contract.FilterLogs(opts, "Minted", senderRule, recipientRule) + if err != nil { + return nil, err + } + return &BurnMintTokenPoolMintedIterator{contract: _BurnMintTokenPool.contract, event: "Minted", logs: logs, sub: sub}, nil +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) WatchMinted(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolMinted, sender []common.Address, recipient []common.Address) (event.Subscription, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + var recipientRule []interface{} + for _, recipientItem := range recipient { + recipientRule = append(recipientRule, recipientItem) + } + + logs, sub, err := _BurnMintTokenPool.contract.WatchLogs(opts, "Minted", senderRule, recipientRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(BurnMintTokenPoolMinted) + if err := _BurnMintTokenPool.contract.UnpackLog(event, "Minted", 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 +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) ParseMinted(log types.Log) (*BurnMintTokenPoolMinted, error) { + event := new(BurnMintTokenPoolMinted) + if err := _BurnMintTokenPool.contract.UnpackLog(event, "Minted", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type BurnMintTokenPoolOwnershipTransferRequestedIterator struct { + Event *BurnMintTokenPoolOwnershipTransferRequested + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *BurnMintTokenPoolOwnershipTransferRequestedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolOwnershipTransferRequested) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolOwnershipTransferRequested) + 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() + } +} + +func (it *BurnMintTokenPoolOwnershipTransferRequestedIterator) Error() error { + return it.fail +} + +func (it *BurnMintTokenPoolOwnershipTransferRequestedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type BurnMintTokenPoolOwnershipTransferRequested struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*BurnMintTokenPoolOwnershipTransferRequestedIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _BurnMintTokenPool.contract.FilterLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return &BurnMintTokenPoolOwnershipTransferRequestedIterator{contract: _BurnMintTokenPool.contract, event: "OwnershipTransferRequested", logs: logs, sub: sub}, nil +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _BurnMintTokenPool.contract.WatchLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(BurnMintTokenPoolOwnershipTransferRequested) + if err := _BurnMintTokenPool.contract.UnpackLog(event, "OwnershipTransferRequested", 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 +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) ParseOwnershipTransferRequested(log types.Log) (*BurnMintTokenPoolOwnershipTransferRequested, error) { + event := new(BurnMintTokenPoolOwnershipTransferRequested) + if err := _BurnMintTokenPool.contract.UnpackLog(event, "OwnershipTransferRequested", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type BurnMintTokenPoolOwnershipTransferredIterator struct { + Event *BurnMintTokenPoolOwnershipTransferred + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *BurnMintTokenPoolOwnershipTransferredIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolOwnershipTransferred) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolOwnershipTransferred) + 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() + } +} + +func (it *BurnMintTokenPoolOwnershipTransferredIterator) Error() error { + return it.fail +} + +func (it *BurnMintTokenPoolOwnershipTransferredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type BurnMintTokenPoolOwnershipTransferred struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*BurnMintTokenPoolOwnershipTransferredIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _BurnMintTokenPool.contract.FilterLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return &BurnMintTokenPoolOwnershipTransferredIterator{contract: _BurnMintTokenPool.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _BurnMintTokenPool.contract.WatchLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(BurnMintTokenPoolOwnershipTransferred) + if err := _BurnMintTokenPool.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 +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) ParseOwnershipTransferred(log types.Log) (*BurnMintTokenPoolOwnershipTransferred, error) { + event := new(BurnMintTokenPoolOwnershipTransferred) + if err := _BurnMintTokenPool.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type BurnMintTokenPoolReleasedIterator struct { + Event *BurnMintTokenPoolReleased + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *BurnMintTokenPoolReleasedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolReleased) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolReleased) + 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() + } +} + +func (it *BurnMintTokenPoolReleasedIterator) Error() error { + return it.fail +} + +func (it *BurnMintTokenPoolReleasedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type BurnMintTokenPoolReleased struct { + Sender common.Address + Recipient common.Address + Amount *big.Int + Raw types.Log +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) FilterReleased(opts *bind.FilterOpts, sender []common.Address, recipient []common.Address) (*BurnMintTokenPoolReleasedIterator, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + var recipientRule []interface{} + for _, recipientItem := range recipient { + recipientRule = append(recipientRule, recipientItem) + } + + logs, sub, err := _BurnMintTokenPool.contract.FilterLogs(opts, "Released", senderRule, recipientRule) + if err != nil { + return nil, err + } + return &BurnMintTokenPoolReleasedIterator{contract: _BurnMintTokenPool.contract, event: "Released", logs: logs, sub: sub}, nil +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) WatchReleased(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolReleased, sender []common.Address, recipient []common.Address) (event.Subscription, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + var recipientRule []interface{} + for _, recipientItem := range recipient { + recipientRule = append(recipientRule, recipientItem) + } + + logs, sub, err := _BurnMintTokenPool.contract.WatchLogs(opts, "Released", senderRule, recipientRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(BurnMintTokenPoolReleased) + if err := _BurnMintTokenPool.contract.UnpackLog(event, "Released", 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 +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) ParseReleased(log types.Log) (*BurnMintTokenPoolReleased, error) { + event := new(BurnMintTokenPoolReleased) + if err := _BurnMintTokenPool.contract.UnpackLog(event, "Released", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type BurnMintTokenPoolRemotePoolSetIterator struct { + Event *BurnMintTokenPoolRemotePoolSet + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *BurnMintTokenPoolRemotePoolSetIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolRemotePoolSet) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolRemotePoolSet) + 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() + } +} + +func (it *BurnMintTokenPoolRemotePoolSetIterator) Error() error { + return it.fail +} + +func (it *BurnMintTokenPoolRemotePoolSetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type BurnMintTokenPoolRemotePoolSet struct { + RemoteChainSelector uint64 + PreviousPoolAddress []byte + RemotePoolAddress []byte + Raw types.Log +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) FilterRemotePoolSet(opts *bind.FilterOpts, remoteChainSelector []uint64) (*BurnMintTokenPoolRemotePoolSetIterator, error) { + + var remoteChainSelectorRule []interface{} + for _, remoteChainSelectorItem := range remoteChainSelector { + remoteChainSelectorRule = append(remoteChainSelectorRule, remoteChainSelectorItem) + } + + logs, sub, err := _BurnMintTokenPool.contract.FilterLogs(opts, "RemotePoolSet", remoteChainSelectorRule) + if err != nil { + return nil, err + } + return &BurnMintTokenPoolRemotePoolSetIterator{contract: _BurnMintTokenPool.contract, event: "RemotePoolSet", logs: logs, sub: sub}, nil +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) WatchRemotePoolSet(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolRemotePoolSet, remoteChainSelector []uint64) (event.Subscription, error) { + + var remoteChainSelectorRule []interface{} + for _, remoteChainSelectorItem := range remoteChainSelector { + remoteChainSelectorRule = append(remoteChainSelectorRule, remoteChainSelectorItem) + } + + logs, sub, err := _BurnMintTokenPool.contract.WatchLogs(opts, "RemotePoolSet", remoteChainSelectorRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(BurnMintTokenPoolRemotePoolSet) + if err := _BurnMintTokenPool.contract.UnpackLog(event, "RemotePoolSet", 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 +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) ParseRemotePoolSet(log types.Log) (*BurnMintTokenPoolRemotePoolSet, error) { + event := new(BurnMintTokenPoolRemotePoolSet) + if err := _BurnMintTokenPool.contract.UnpackLog(event, "RemotePoolSet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type BurnMintTokenPoolRouterUpdatedIterator struct { + Event *BurnMintTokenPoolRouterUpdated + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *BurnMintTokenPoolRouterUpdatedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolRouterUpdated) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolRouterUpdated) + 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() + } +} + +func (it *BurnMintTokenPoolRouterUpdatedIterator) Error() error { + return it.fail +} + +func (it *BurnMintTokenPoolRouterUpdatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type BurnMintTokenPoolRouterUpdated struct { + OldRouter common.Address + NewRouter common.Address + Raw types.Log +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) FilterRouterUpdated(opts *bind.FilterOpts) (*BurnMintTokenPoolRouterUpdatedIterator, error) { + + logs, sub, err := _BurnMintTokenPool.contract.FilterLogs(opts, "RouterUpdated") + if err != nil { + return nil, err + } + return &BurnMintTokenPoolRouterUpdatedIterator{contract: _BurnMintTokenPool.contract, event: "RouterUpdated", logs: logs, sub: sub}, nil +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) WatchRouterUpdated(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolRouterUpdated) (event.Subscription, error) { + + logs, sub, err := _BurnMintTokenPool.contract.WatchLogs(opts, "RouterUpdated") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(BurnMintTokenPoolRouterUpdated) + if err := _BurnMintTokenPool.contract.UnpackLog(event, "RouterUpdated", 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 +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) ParseRouterUpdated(log types.Log) (*BurnMintTokenPoolRouterUpdated, error) { + event := new(BurnMintTokenPoolRouterUpdated) + if err := _BurnMintTokenPool.contract.UnpackLog(event, "RouterUpdated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type BurnMintTokenPoolTokensConsumedIterator struct { + Event *BurnMintTokenPoolTokensConsumed + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *BurnMintTokenPoolTokensConsumedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolTokensConsumed) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolTokensConsumed) + 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() + } +} + +func (it *BurnMintTokenPoolTokensConsumedIterator) Error() error { + return it.fail +} + +func (it *BurnMintTokenPoolTokensConsumedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type BurnMintTokenPoolTokensConsumed struct { + Tokens *big.Int + Raw types.Log +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) FilterTokensConsumed(opts *bind.FilterOpts) (*BurnMintTokenPoolTokensConsumedIterator, error) { + + logs, sub, err := _BurnMintTokenPool.contract.FilterLogs(opts, "TokensConsumed") + if err != nil { + return nil, err + } + return &BurnMintTokenPoolTokensConsumedIterator{contract: _BurnMintTokenPool.contract, event: "TokensConsumed", logs: logs, sub: sub}, nil +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) WatchTokensConsumed(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolTokensConsumed) (event.Subscription, error) { + + logs, sub, err := _BurnMintTokenPool.contract.WatchLogs(opts, "TokensConsumed") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(BurnMintTokenPoolTokensConsumed) + if err := _BurnMintTokenPool.contract.UnpackLog(event, "TokensConsumed", 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 +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) ParseTokensConsumed(log types.Log) (*BurnMintTokenPoolTokensConsumed, error) { + event := new(BurnMintTokenPoolTokensConsumed) + if err := _BurnMintTokenPool.contract.UnpackLog(event, "TokensConsumed", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +func (_BurnMintTokenPool *BurnMintTokenPool) ParseLog(log types.Log) (generated.AbigenLog, error) { + switch log.Topics[0] { + case _BurnMintTokenPool.abi.Events["AllowListAdd"].ID: + return _BurnMintTokenPool.ParseAllowListAdd(log) + case _BurnMintTokenPool.abi.Events["AllowListRemove"].ID: + return _BurnMintTokenPool.ParseAllowListRemove(log) + case _BurnMintTokenPool.abi.Events["Burned"].ID: + return _BurnMintTokenPool.ParseBurned(log) + case _BurnMintTokenPool.abi.Events["ChainAdded"].ID: + return _BurnMintTokenPool.ParseChainAdded(log) + case _BurnMintTokenPool.abi.Events["ChainConfigured"].ID: + return _BurnMintTokenPool.ParseChainConfigured(log) + case _BurnMintTokenPool.abi.Events["ChainRemoved"].ID: + return _BurnMintTokenPool.ParseChainRemoved(log) + case _BurnMintTokenPool.abi.Events["ConfigChanged"].ID: + return _BurnMintTokenPool.ParseConfigChanged(log) + case _BurnMintTokenPool.abi.Events["Locked"].ID: + return _BurnMintTokenPool.ParseLocked(log) + case _BurnMintTokenPool.abi.Events["Minted"].ID: + return _BurnMintTokenPool.ParseMinted(log) + case _BurnMintTokenPool.abi.Events["OwnershipTransferRequested"].ID: + return _BurnMintTokenPool.ParseOwnershipTransferRequested(log) + case _BurnMintTokenPool.abi.Events["OwnershipTransferred"].ID: + return _BurnMintTokenPool.ParseOwnershipTransferred(log) + case _BurnMintTokenPool.abi.Events["Released"].ID: + return _BurnMintTokenPool.ParseReleased(log) + case _BurnMintTokenPool.abi.Events["RemotePoolSet"].ID: + return _BurnMintTokenPool.ParseRemotePoolSet(log) + case _BurnMintTokenPool.abi.Events["RouterUpdated"].ID: + return _BurnMintTokenPool.ParseRouterUpdated(log) + case _BurnMintTokenPool.abi.Events["TokensConsumed"].ID: + return _BurnMintTokenPool.ParseTokensConsumed(log) + + default: + return nil, fmt.Errorf("abigen wrapper received unknown log topic: %v", log.Topics[0]) + } +} + +func (BurnMintTokenPoolAllowListAdd) Topic() common.Hash { + return common.HexToHash("0x2640d4d76caf8bf478aabfa982fa4e1c4eb71a37f93cd15e80dbc657911546d8") +} + +func (BurnMintTokenPoolAllowListRemove) Topic() common.Hash { + return common.HexToHash("0x800671136ab6cfee9fbe5ed1fb7ca417811aca3cf864800d127b927adedf7566") +} + +func (BurnMintTokenPoolBurned) Topic() common.Hash { + return common.HexToHash("0x696de425f79f4a40bc6d2122ca50507f0efbeabbff86a84871b7196ab8ea8df7") +} + +func (BurnMintTokenPoolChainAdded) Topic() common.Hash { + return common.HexToHash("0x8d340f17e19058004c20453540862a9c62778504476f6756755cb33bcd6c38c2") +} + +func (BurnMintTokenPoolChainConfigured) Topic() common.Hash { + return common.HexToHash("0x0350d63aa5f270e01729d00d627eeb8f3429772b1818c016c66a588a864f912b") +} + +func (BurnMintTokenPoolChainRemoved) Topic() common.Hash { + return common.HexToHash("0x5204aec90a3c794d8e90fded8b46ae9c7c552803e7e832e0c1d358396d859916") +} + +func (BurnMintTokenPoolConfigChanged) Topic() common.Hash { + return common.HexToHash("0x9ea3374b67bf275e6bb9c8ae68f9cae023e1c528b4b27e092f0bb209d3531c19") +} + +func (BurnMintTokenPoolLocked) Topic() common.Hash { + return common.HexToHash("0x9f1ec8c880f76798e7b793325d625e9b60e4082a553c98f42b6cda368dd60008") +} + +func (BurnMintTokenPoolMinted) Topic() common.Hash { + return common.HexToHash("0x9d228d69b5fdb8d273a2336f8fb8612d039631024ea9bf09c424a9503aa078f0") +} + +func (BurnMintTokenPoolOwnershipTransferRequested) Topic() common.Hash { + return common.HexToHash("0xed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae1278") +} + +func (BurnMintTokenPoolOwnershipTransferred) Topic() common.Hash { + return common.HexToHash("0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0") +} + +func (BurnMintTokenPoolReleased) Topic() common.Hash { + return common.HexToHash("0x2d87480f50083e2b2759522a8fdda59802650a8055e609a7772cf70c07748f52") +} + +func (BurnMintTokenPoolRemotePoolSet) Topic() common.Hash { + return common.HexToHash("0xdb4d6220746a38cbc5335f7e108f7de80f482f4d23350253dfd0917df75a14bf") +} + +func (BurnMintTokenPoolRouterUpdated) Topic() common.Hash { + return common.HexToHash("0x02dc5c233404867c793b749c6d644beb2277536d18a7e7974d3f238e4c6f1684") +} + +func (BurnMintTokenPoolTokensConsumed) Topic() common.Hash { + return common.HexToHash("0x1871cdf8010e63f2eb8384381a68dfa7416dc571a5517e66e88b2d2d0c0a690a") +} + +func (_BurnMintTokenPool *BurnMintTokenPool) Address() common.Address { + return _BurnMintTokenPool.address +} + +type BurnMintTokenPoolInterface interface { + GetAllowList(opts *bind.CallOpts) ([]common.Address, error) + + GetAllowListEnabled(opts *bind.CallOpts) (bool, error) + + GetCurrentInboundRateLimiterState(opts *bind.CallOpts, remoteChainSelector uint64) (RateLimiterTokenBucket, error) + + GetCurrentOutboundRateLimiterState(opts *bind.CallOpts, remoteChainSelector uint64) (RateLimiterTokenBucket, error) + + GetRateLimitAdmin(opts *bind.CallOpts) (common.Address, error) + + GetRemotePool(opts *bind.CallOpts, remoteChainSelector uint64) ([]byte, error) + + GetRemoteToken(opts *bind.CallOpts, remoteChainSelector uint64) ([]byte, error) + + GetRmnProxy(opts *bind.CallOpts) (common.Address, error) + + GetRouter(opts *bind.CallOpts) (common.Address, error) + + GetSupportedChains(opts *bind.CallOpts) ([]uint64, error) + + GetToken(opts *bind.CallOpts) (common.Address, error) + + IsSupportedChain(opts *bind.CallOpts, remoteChainSelector uint64) (bool, error) + + IsSupportedToken(opts *bind.CallOpts, token common.Address) (bool, error) + + Owner(opts *bind.CallOpts) (common.Address, error) + + SupportsInterface(opts *bind.CallOpts, interfaceId [4]byte) (bool, error) + + TypeAndVersion(opts *bind.CallOpts) (string, error) + + AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) + + ApplyAllowListUpdates(opts *bind.TransactOpts, removes []common.Address, adds []common.Address) (*types.Transaction, error) + + ApplyChainUpdates(opts *bind.TransactOpts, chains []TokenPoolChainUpdate) (*types.Transaction, error) + + LockOrBurn(opts *bind.TransactOpts, lockOrBurnIn PoolLockOrBurnInV1) (*types.Transaction, error) + + ReleaseOrMint(opts *bind.TransactOpts, releaseOrMintIn PoolReleaseOrMintInV1) (*types.Transaction, error) + + SetChainRateLimiterConfig(opts *bind.TransactOpts, remoteChainSelector uint64, outboundConfig RateLimiterConfig, inboundConfig RateLimiterConfig) (*types.Transaction, error) + + SetRateLimitAdmin(opts *bind.TransactOpts, rateLimitAdmin common.Address) (*types.Transaction, error) + + SetRemotePool(opts *bind.TransactOpts, remoteChainSelector uint64, remotePoolAddress []byte) (*types.Transaction, error) + + SetRouter(opts *bind.TransactOpts, newRouter common.Address) (*types.Transaction, error) + + TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) + + FilterAllowListAdd(opts *bind.FilterOpts) (*BurnMintTokenPoolAllowListAddIterator, error) + + WatchAllowListAdd(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolAllowListAdd) (event.Subscription, error) + + ParseAllowListAdd(log types.Log) (*BurnMintTokenPoolAllowListAdd, error) + + FilterAllowListRemove(opts *bind.FilterOpts) (*BurnMintTokenPoolAllowListRemoveIterator, error) + + WatchAllowListRemove(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolAllowListRemove) (event.Subscription, error) + + ParseAllowListRemove(log types.Log) (*BurnMintTokenPoolAllowListRemove, error) + + FilterBurned(opts *bind.FilterOpts, sender []common.Address) (*BurnMintTokenPoolBurnedIterator, error) + + WatchBurned(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolBurned, sender []common.Address) (event.Subscription, error) + + ParseBurned(log types.Log) (*BurnMintTokenPoolBurned, error) + + FilterChainAdded(opts *bind.FilterOpts) (*BurnMintTokenPoolChainAddedIterator, error) + + WatchChainAdded(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolChainAdded) (event.Subscription, error) + + ParseChainAdded(log types.Log) (*BurnMintTokenPoolChainAdded, error) + + FilterChainConfigured(opts *bind.FilterOpts) (*BurnMintTokenPoolChainConfiguredIterator, error) + + WatchChainConfigured(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolChainConfigured) (event.Subscription, error) + + ParseChainConfigured(log types.Log) (*BurnMintTokenPoolChainConfigured, error) + + FilterChainRemoved(opts *bind.FilterOpts) (*BurnMintTokenPoolChainRemovedIterator, error) + + WatchChainRemoved(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolChainRemoved) (event.Subscription, error) + + ParseChainRemoved(log types.Log) (*BurnMintTokenPoolChainRemoved, error) + + FilterConfigChanged(opts *bind.FilterOpts) (*BurnMintTokenPoolConfigChangedIterator, error) + + WatchConfigChanged(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolConfigChanged) (event.Subscription, error) + + ParseConfigChanged(log types.Log) (*BurnMintTokenPoolConfigChanged, error) + + FilterLocked(opts *bind.FilterOpts, sender []common.Address) (*BurnMintTokenPoolLockedIterator, error) + + WatchLocked(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolLocked, sender []common.Address) (event.Subscription, error) + + ParseLocked(log types.Log) (*BurnMintTokenPoolLocked, error) + + FilterMinted(opts *bind.FilterOpts, sender []common.Address, recipient []common.Address) (*BurnMintTokenPoolMintedIterator, error) + + WatchMinted(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolMinted, sender []common.Address, recipient []common.Address) (event.Subscription, error) + + ParseMinted(log types.Log) (*BurnMintTokenPoolMinted, error) + + FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*BurnMintTokenPoolOwnershipTransferRequestedIterator, error) + + WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferRequested(log types.Log) (*BurnMintTokenPoolOwnershipTransferRequested, error) + + FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*BurnMintTokenPoolOwnershipTransferredIterator, error) + + WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferred(log types.Log) (*BurnMintTokenPoolOwnershipTransferred, error) + + FilterReleased(opts *bind.FilterOpts, sender []common.Address, recipient []common.Address) (*BurnMintTokenPoolReleasedIterator, error) + + WatchReleased(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolReleased, sender []common.Address, recipient []common.Address) (event.Subscription, error) + + ParseReleased(log types.Log) (*BurnMintTokenPoolReleased, error) + + FilterRemotePoolSet(opts *bind.FilterOpts, remoteChainSelector []uint64) (*BurnMintTokenPoolRemotePoolSetIterator, error) + + WatchRemotePoolSet(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolRemotePoolSet, remoteChainSelector []uint64) (event.Subscription, error) + + ParseRemotePoolSet(log types.Log) (*BurnMintTokenPoolRemotePoolSet, error) + + FilterRouterUpdated(opts *bind.FilterOpts) (*BurnMintTokenPoolRouterUpdatedIterator, error) + + WatchRouterUpdated(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolRouterUpdated) (event.Subscription, error) + + ParseRouterUpdated(log types.Log) (*BurnMintTokenPoolRouterUpdated, error) + + FilterTokensConsumed(opts *bind.FilterOpts) (*BurnMintTokenPoolTokensConsumedIterator, error) + + WatchTokensConsumed(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolTokensConsumed) (event.Subscription, error) + + ParseTokensConsumed(log types.Log) (*BurnMintTokenPoolTokensConsumed, error) + + ParseLog(log types.Log) (generated.AbigenLog, error) + + Address() common.Address +} diff --git a/core/gethwrappers/ccip/generated/burn_mint_token_pool_1_2_0/burn_mint_token_pool_1_2_0.go b/core/gethwrappers/ccip/generated/burn_mint_token_pool_1_2_0/burn_mint_token_pool_1_2_0.go new file mode 100644 index 00000000000..d11a7db6e60 --- /dev/null +++ b/core/gethwrappers/ccip/generated/burn_mint_token_pool_1_2_0/burn_mint_token_pool_1_2_0.go @@ -0,0 +1,2544 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package burn_mint_token_pool_1_2_0 + +import ( + "errors" + "fmt" + "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" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" +) + +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +type RateLimiterConfig struct { + IsEnabled bool + Capacity *big.Int + Rate *big.Int +} + +type RateLimiterTokenBucket struct { + Tokens *big.Int + LastUpdated uint32 + IsEnabled bool + Capacity *big.Int + Rate *big.Int +} + +type TokenPoolRampUpdate struct { + Ramp common.Address + Allowed bool + RateLimiterConfig RateLimiterConfig +} + +var BurnMintTokenPoolMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"internalType\":\"contractIBurnMintERC20\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"allowlist\",\"type\":\"address[]\"},{\"internalType\":\"address\",\"name\":\"armProxy\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"capacity\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"requested\",\"type\":\"uint256\"}],\"name\":\"AggregateValueMaxCapacityExceeded\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"minWaitInSeconds\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"available\",\"type\":\"uint256\"}],\"name\":\"AggregateValueRateLimitReached\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"AllowListNotEnabled\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"BadARMSignal\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"BucketOverfilled\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"ramp\",\"type\":\"address\"}],\"name\":\"NonExistentRamp\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"PermissionsError\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"ramp\",\"type\":\"address\"}],\"name\":\"RampAlreadyExists\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"SenderNotAllowed\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"capacity\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"requested\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"}],\"name\":\"TokenMaxCapacityExceeded\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"minWaitInSeconds\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"available\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"}],\"name\":\"TokenRateLimitReached\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddressNotAllowed\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"AllowListAdd\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"AllowListRemove\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Burned\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Locked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Minted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"offRamp\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"indexed\":false,\"internalType\":\"structRateLimiter.Config\",\"name\":\"rateLimiterConfig\",\"type\":\"tuple\"}],\"name\":\"OffRampAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"offRamp\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"indexed\":false,\"internalType\":\"structRateLimiter.Config\",\"name\":\"rateLimiterConfig\",\"type\":\"tuple\"}],\"name\":\"OffRampConfigured\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"offRamp\",\"type\":\"address\"}],\"name\":\"OffRampRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"onRamp\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"indexed\":false,\"internalType\":\"structRateLimiter.Config\",\"name\":\"rateLimiterConfig\",\"type\":\"tuple\"}],\"name\":\"OnRampAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"onRamp\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"indexed\":false,\"internalType\":\"structRateLimiter.Config\",\"name\":\"rateLimiterConfig\",\"type\":\"tuple\"}],\"name\":\"OnRampConfigured\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"onRamp\",\"type\":\"address\"}],\"name\":\"OnRampRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Released\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"removes\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"adds\",\"type\":\"address[]\"}],\"name\":\"applyAllowListUpdates\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"ramp\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"allowed\",\"type\":\"bool\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"rateLimiterConfig\",\"type\":\"tuple\"}],\"internalType\":\"structTokenPool.RampUpdate[]\",\"name\":\"onRamps\",\"type\":\"tuple[]\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"ramp\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"allowed\",\"type\":\"bool\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"rateLimiterConfig\",\"type\":\"tuple\"}],\"internalType\":\"structTokenPool.RampUpdate[]\",\"name\":\"offRamps\",\"type\":\"tuple[]\"}],\"name\":\"applyRampUpdates\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"offRamp\",\"type\":\"address\"}],\"name\":\"currentOffRampRateLimiterState\",\"outputs\":[{\"components\":[{\"internalType\":\"uint128\",\"name\":\"tokens\",\"type\":\"uint128\"},{\"internalType\":\"uint32\",\"name\":\"lastUpdated\",\"type\":\"uint32\"},{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.TokenBucket\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"onRamp\",\"type\":\"address\"}],\"name\":\"currentOnRampRateLimiterState\",\"outputs\":[{\"components\":[{\"internalType\":\"uint128\",\"name\":\"tokens\",\"type\":\"uint128\"},{\"internalType\":\"uint32\",\"name\":\"lastUpdated\",\"type\":\"uint32\"},{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.TokenBucket\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAllowList\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAllowListEnabled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getArmProxy\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"armProxy\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getOffRamps\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getOnRamps\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getToken\",\"outputs\":[{\"internalType\":\"contractIERC20\",\"name\":\"token\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"offRamp\",\"type\":\"address\"}],\"name\":\"isOffRamp\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"onRamp\",\"type\":\"address\"}],\"name\":\"isOnRamp\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"originalSender\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"lockOrBurn\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"releaseOrMint\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"offRamp\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"config\",\"type\":\"tuple\"}],\"name\":\"setOffRampRateLimiterConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"onRamp\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"config\",\"type\":\"tuple\"}],\"name\":\"setOnRampRateLimiterConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", + Bin: "0x60e06040523480156200001157600080fd5b5060405162002f3338038062002f3383398101604081905262000034916200051d565b82828233806000816200008e5760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000c157620000c18162000133565b5050506001600160a01b038316620000ec576040516342bcdf7f60e11b815260040160405180910390fd5b6001600160a01b03808416608052811660a052815115801560c0526200012757604080516000815260208101909152620001279083620001de565b5050505050506200068e565b336001600160a01b038216036200018d5760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640162000085565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b60c051620001ff576040516335f4a7b360e01b815260040160405180910390fd5b60005b8251811015620002945760008382815181106200022357620002236200061a565b602090810291909101015190506200023d6002826200034f565b1562000280576040516001600160a01b03821681527f800671136ab6cfee9fbe5ed1fb7ca417811aca3cf864800d127b927adedf75669060200160405180910390a15b506200028c8162000646565b905062000202565b5060005b81518110156200034a576000828281518110620002b957620002b96200061a565b6020026020010151905060006001600160a01b0316816001600160a01b031603620002e5575062000337565b620002f26002826200036f565b1562000335576040516001600160a01b03821681527f2640d4d76caf8bf478aabfa982fa4e1c4eb71a37f93cd15e80dbc657911546d89060200160405180910390a15b505b620003428162000646565b905062000298565b505050565b600062000366836001600160a01b03841662000386565b90505b92915050565b600062000366836001600160a01b0384166200048a565b600081815260018301602052604081205480156200047f576000620003ad60018362000662565b8554909150600090620003c39060019062000662565b90508181146200042f576000866000018281548110620003e757620003e76200061a565b90600052602060002001549050808760000184815481106200040d576200040d6200061a565b6000918252602080832090910192909255918252600188019052604090208390555b855486908062000443576200044362000678565b60019003818190600052602060002001600090559055856001016000868152602001908152602001600020600090556001935050505062000369565b600091505062000369565b6000818152600183016020526040812054620004d35750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915562000369565b50600062000369565b6001600160a01b0381168114620004f257600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b80516200051881620004dc565b919050565b6000806000606084860312156200053357600080fd5b83516200054081620004dc565b602085810151919450906001600160401b03808211156200056057600080fd5b818701915087601f8301126200057557600080fd5b8151818111156200058a576200058a620004f5565b8060051b604051601f19603f83011681018181108582111715620005b257620005b2620004f5565b60405291825284820192508381018501918a831115620005d157600080fd5b938501935b82851015620005fa57620005ea856200050b565b84529385019392850192620005d6565b80975050505050505062000611604085016200050b565b90509250925092565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016200065b576200065b62000630565b5060010190565b8181038181111562000369576200036962000630565b634e487b7160e01b600052603160045260246000fd5b60805160a05160c05161283d620006f6600039600081816103c301528181610a320152610e71015260008181610249015281816107d50152610ab60152600081816102020152818161092d015281816112b1015281816112f8015261134b015261283d6000f3fe608060405234801561001057600080fd5b50600436106101775760003560e01c80638627fad6116100d8578063a7cd63b71161008c578063d612b94511610066578063d612b945146103ae578063e0351e13146103c1578063f2fde38b146103e757600080fd5b8063a7cd63b714610380578063b3a3fb4114610388578063c49907b51461039b57600080fd5b80638da5cb5b116100bd5780638da5cb5b146103475780639687544514610365578063a40e69c71461037857600080fd5b80638627fad61461031f578063873813141461033257600080fd5b806354c8a4f31161012f5780637448b3c7116101145780637448b3c7146102955780637787e7ab146102a857806379ba50971461031757600080fd5b806354c8a4f31461026d5780636f32b8721461028257600080fd5b80631d7a74a0116101605780631d7a74a0146101ed57806321df0da7146102005780635246492f1461024757600080fd5b806301ffc9a71461017c578063181f5a77146101a4575b600080fd5b61018f61018a366004612000565b6103fa565b60405190151581526020015b60405180910390f35b6101e06040518060400160405280601781526020017f4275726e4d696e74546f6b656e506f6f6c20312e322e3000000000000000000081525081565b60405161019b91906120a6565b61018f6101fb3660046120e2565b610493565b7f00000000000000000000000000000000000000000000000000000000000000005b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161019b565b7f0000000000000000000000000000000000000000000000000000000000000000610222565b61028061027b366004612149565b6104a0565b005b61018f6102903660046120e2565b61051b565b6102806102a336600461228c565b610528565b6102bb6102b63660046120e2565b6105f8565b60405161019b919081516fffffffffffffffffffffffffffffffff908116825260208084015163ffffffff1690830152604080840151151590830152606080840151821690830152608092830151169181019190915260a00190565b6102806106d6565b61028061032d366004612383565b6107d3565b61033a6109dd565b60405161019b9190612412565b60005473ffffffffffffffffffffffffffffffffffffffff16610222565b6101e06103733660046124ae565b6109ee565b61033a610bdd565b61033a610be9565b6102bb6103963660046120e2565b610bf5565b6102806103a9366004612591565b610cd3565b6102806103bc36600461228c565b610ce7565b7f000000000000000000000000000000000000000000000000000000000000000061018f565b6102806103f53660046120e2565b610da6565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f317fa33400000000000000000000000000000000000000000000000000000000148061048d57507fffffffff0000000000000000000000000000000000000000000000000000000082167f01ffc9a700000000000000000000000000000000000000000000000000000000145b92915050565b600061048d600783610dba565b6104a8610dec565b61051584848080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808802828101820190935287825290935087925086918291850190849080828437600092019190915250610e6f92505050565b50505050565b600061048d600483610dba565b610530610dec565b6105398261051b565b61058c576040517f498f12f600000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff831660048201526024015b60405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff821660009081526006602052604090206105bb908261103a565b7f578db78e348076074dbff64a94073a83e9a65aa6766b8c75fdc89282b0e30ed682826040516105ec9291906125f1565b60405180910390a15050565b6040805160a08101825260008082526020820181905291810182905260608101829052608081019190915273ffffffffffffffffffffffffffffffffffffffff8216600090815260066020908152604091829020825160a08101845281546fffffffffffffffffffffffffffffffff808216835270010000000000000000000000000000000080830463ffffffff16958401959095527401000000000000000000000000000000000000000090910460ff16151594820194909452600190910154808416606083015291909104909116608082015261048d906111e9565b60015473ffffffffffffffffffffffffffffffffffffffff163314610757576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e6572000000000000000000006044820152606401610583565b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663397796f76040518163ffffffff1660e01b8152600401602060405180830381865afa15801561083e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108629190612649565b15610899576040517fc148371500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6108a233610493565b6108d8576040517f5307f5ab00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6108e18361129b565b6040517f40c10f1900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8581166004830152602482018590527f000000000000000000000000000000000000000000000000000000000000000016906340c10f1990604401600060405180830381600087803b15801561097157600080fd5b505af1158015610985573d6000803e3d6000fd5b505060405185815273ffffffffffffffffffffffffffffffffffffffff871692503391507f9d228d69b5fdb8d273a2336f8fb8612d039631024ea9bf09c424a9503aa078f09060200160405180910390a35050505050565b60606109e960046112d5565b905090565b60606109f93361051b565b610a2f576040517f5307f5ab00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b877f00000000000000000000000000000000000000000000000000000000000000008015610a655750610a63600282610dba565b155b15610ab4576040517fd0d2597600000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff82166004820152602401610583565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663397796f76040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b1f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b439190612649565b15610b7a576040517fc148371500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610b83866112e2565b610b8c8661131c565b60405186815233907f696de425f79f4a40bc6d2122ca50507f0efbeabbff86a84871b7196ab8ea8df79060200160405180910390a25050604080516020810190915260008152979650505050505050565b60606109e960076112d5565b60606109e960026112d5565b6040805160a08101825260008082526020820181905291810182905260608101829052608081019190915273ffffffffffffffffffffffffffffffffffffffff8216600090815260096020908152604091829020825160a08101845281546fffffffffffffffffffffffffffffffff808216835270010000000000000000000000000000000080830463ffffffff16958401959095527401000000000000000000000000000000000000000090910460ff16151594820194909452600190910154808416606083015291909104909116608082015261048d906111e9565b610cdb610dec565b610515848484846113bf565b610cef610dec565b610cf882610493565b610d46576040517f498f12f600000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff83166004820152602401610583565b73ffffffffffffffffffffffffffffffffffffffff82166000908152600960205260409020610d75908261103a565b7fb3ba339cfbb8ef80d7a29ce5493051cb90e64fcfa85d7124efc1adfa4c68399f82826040516105ec9291906125f1565b610dae610dec565b610db781611968565b50565b73ffffffffffffffffffffffffffffffffffffffff8116600090815260018301602052604081205415155b9392505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314610e6d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e6572000000000000000000006044820152606401610583565b565b7f0000000000000000000000000000000000000000000000000000000000000000610ec6576040517f35f4a7b300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b8251811015610f64576000838281518110610ee657610ee6612666565b60200260200101519050610f04816002611a5d90919063ffffffff16565b15610f535760405173ffffffffffffffffffffffffffffffffffffffff821681527f800671136ab6cfee9fbe5ed1fb7ca417811aca3cf864800d127b927adedf75669060200160405180910390a15b50610f5d816126c4565b9050610ec9565b5060005b8151811015611035576000828281518110610f8557610f85612666565b60200260200101519050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610fc95750611025565b610fd4600282611a7f565b156110235760405173ffffffffffffffffffffffffffffffffffffffff821681527f2640d4d76caf8bf478aabfa982fa4e1c4eb71a37f93cd15e80dbc657911546d89060200160405180910390a15b505b61102e816126c4565b9050610f68565b505050565b815460009061106390700100000000000000000000000000000000900463ffffffff16426126fc565b9050801561110557600183015483546110ab916fffffffffffffffffffffffffffffffff80821692811691859170010000000000000000000000000000000090910416611aa1565b83546fffffffffffffffffffffffffffffffff919091167fffffffffffffffffffffffff0000000000000000000000000000000000000000909116177001000000000000000000000000000000004263ffffffff16021783555b6020820151835461112b916fffffffffffffffffffffffffffffffff9081169116611ac9565b83548351151574010000000000000000000000000000000000000000027fffffffffffffffffffffff00ffffffff000000000000000000000000000000009091166fffffffffffffffffffffffffffffffff92831617178455602083015160408085015183167001000000000000000000000000000000000291909216176001850155517f9ea3374b67bf275e6bb9c8ae68f9cae023e1c528b4b27e092f0bb209d3531c19906111dc90849061270f565b60405180910390a1505050565b6040805160a08101825260008082526020820181905291810182905260608101829052608081019190915261127782606001516fffffffffffffffffffffffffffffffff1683600001516fffffffffffffffffffffffffffffffff16846020015163ffffffff164261125b91906126fc565b85608001516fffffffffffffffffffffffffffffffff16611aa1565b6fffffffffffffffffffffffffffffffff1682525063ffffffff4216602082015290565b336000908152600960205260409020610db790827f0000000000000000000000000000000000000000000000000000000000000000611adf565b60606000610de583611e62565b336000908152600660205260409020610db790827f0000000000000000000000000000000000000000000000000000000000000000611adf565b6040517f42966c68000000000000000000000000000000000000000000000000000000008152600481018290527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16906342966c6890602401600060405180830381600087803b1580156113a457600080fd5b505af11580156113b8573d6000803e3d6000fd5b5050505050565b6113c7610dec565b60005b838110156116e45760008585838181106113e6576113e6612666565b905060a002018036038101906113fc919061274b565b90508060200151156115d457805161141690600490611a7f565b15611587576040805160a08101825282820180516020908101516fffffffffffffffffffffffffffffffff908116845263ffffffff4281168386019081528451511515868801908152855185015184166060880190815286518901518516608089019081528a5173ffffffffffffffffffffffffffffffffffffffff1660009081526006909752958990209751885493519251151574010000000000000000000000000000000000000000027fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff939095167001000000000000000000000000000000009081027fffffffffffffffffffffffff0000000000000000000000000000000000000000909516918716919091179390931791909116929092178655905192518216029116176001909201919091558251905191517f0b594bb0555ff7b252e0c789ccc9d8903fec294172064308727d570505cee1ac9261157a92916125f1565b60405180910390a16116d3565b80516040517fd3eb6bc500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9091166004820152602401610583565b80516115e290600490611a5d565b1561168657805173ffffffffffffffffffffffffffffffffffffffff1660009081526006602052604080822080547fffffffffffffffffffffff00000000000000000000000000000000000000000016815560010191909155815190517f7fd064821314ad863a0714a3f1229375ace6b6427ed5544b7b2ba1c47b1b52949161157a9173ffffffffffffffffffffffffffffffffffffffff91909116815260200190565b80516040517f498f12f600000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9091166004820152602401610583565b506116dd816126c4565b90506113ca565b5060005b818110156113b857600083838381811061170457611704612666565b905060a0020180360381019061171a919061274b565b90508060200151156118a557805161173490600790611a7f565b15611587576040805160a08101825282820180516020908101516fffffffffffffffffffffffffffffffff908116845263ffffffff4281168386019081528451511515868801908152855185015184166060880190815286518901518516608089019081528a5173ffffffffffffffffffffffffffffffffffffffff1660009081526009909752958990209751885493519251151574010000000000000000000000000000000000000000027fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff939095167001000000000000000000000000000000009081027fffffffffffffffffffffffff0000000000000000000000000000000000000000909516918716919091179390931791909116929092178655905192518216029116176001909201919091558251905191517f395b7374909d2b54e5796f53c898ebf41d767c86c78ea86519acf2b805852d889261189892916125f1565b60405180910390a1611957565b80516118b390600790611a5d565b1561168657805173ffffffffffffffffffffffffffffffffffffffff1660009081526009602052604080822080547fffffffffffffffffffffff00000000000000000000000000000000000000000016815560010191909155815190517fcf91daec21e3510e2f2aea4b09d08c235d5c6844980be709f282ef591dbf420c916118989173ffffffffffffffffffffffffffffffffffffffff91909116815260200190565b50611961816126c4565b90506116e8565b3373ffffffffffffffffffffffffffffffffffffffff8216036119e7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c660000000000000000006044820152606401610583565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b6000610de58373ffffffffffffffffffffffffffffffffffffffff8416611ebe565b6000610de58373ffffffffffffffffffffffffffffffffffffffff8416611fb1565b6000611ac085611ab1848661279c565b611abb90876127b3565b611ac9565b95945050505050565b6000818310611ad85781610de5565b5090919050565b825474010000000000000000000000000000000000000000900460ff161580611b06575081155b15611b1057505050565b825460018401546fffffffffffffffffffffffffffffffff80831692911690600090611b5690700100000000000000000000000000000000900463ffffffff16426126fc565b90508015611c165781831115611b98576040517f9725942a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001860154611bd29083908590849070010000000000000000000000000000000090046fffffffffffffffffffffffffffffffff16611aa1565b86547fffffffffffffffffffffffff00000000ffffffffffffffffffffffffffffffff167001000000000000000000000000000000004263ffffffff160217875592505b84821015611ccd5773ffffffffffffffffffffffffffffffffffffffff8416611c75576040517ff94ebcd10000000000000000000000000000000000000000000000000000000081526004810183905260248101869052604401610583565b6040517f1a76572a000000000000000000000000000000000000000000000000000000008152600481018390526024810186905273ffffffffffffffffffffffffffffffffffffffff85166044820152606401610583565b84831015611de05760018681015470010000000000000000000000000000000090046fffffffffffffffffffffffffffffffff16906000908290611d1190826126fc565b611d1b878a6126fc565b611d2591906127b3565b611d2f91906127c6565b905073ffffffffffffffffffffffffffffffffffffffff8616611d88576040517f15279c080000000000000000000000000000000000000000000000000000000081526004810182905260248101869052604401610583565b6040517fd0c8d23a000000000000000000000000000000000000000000000000000000008152600481018290526024810186905273ffffffffffffffffffffffffffffffffffffffff87166044820152606401610583565b611dea85846126fc565b86547fffffffffffffffffffffffffffffffff00000000000000000000000000000000166fffffffffffffffffffffffffffffffff82161787556040518681529093507f1871cdf8010e63f2eb8384381a68dfa7416dc571a5517e66e88b2d2d0c0a690a9060200160405180910390a1505050505050565b606081600001805480602002602001604051908101604052809291908181526020018280548015611eb257602002820191906000526020600020905b815481526020019060010190808311611e9e575b50505050509050919050565b60008181526001830160205260408120548015611fa7576000611ee26001836126fc565b8554909150600090611ef6906001906126fc565b9050818114611f5b576000866000018281548110611f1657611f16612666565b9060005260206000200154905080876000018481548110611f3957611f39612666565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080611f6c57611f6c612801565b60019003818190600052602060002001600090559055856001016000868152602001908152602001600020600090556001935050505061048d565b600091505061048d565b6000818152600183016020526040812054611ff85750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915561048d565b50600061048d565b60006020828403121561201257600080fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114610de557600080fd5b6000815180845260005b818110156120685760208185018101518683018201520161204c565b5060006020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b602081526000610de56020830184612042565b803573ffffffffffffffffffffffffffffffffffffffff811681146120dd57600080fd5b919050565b6000602082840312156120f457600080fd5b610de5826120b9565b60008083601f84011261210f57600080fd5b50813567ffffffffffffffff81111561212757600080fd5b6020830191508360208260051b850101111561214257600080fd5b9250929050565b6000806000806040858703121561215f57600080fd5b843567ffffffffffffffff8082111561217757600080fd5b612183888389016120fd565b9096509450602087013591508082111561219c57600080fd5b506121a9878288016120fd565b95989497509550505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040516060810167ffffffffffffffff81118282101715612207576122076121b5565b60405290565b8015158114610db757600080fd5b80356fffffffffffffffffffffffffffffffff811681146120dd57600080fd5b60006060828403121561224d57600080fd5b6122556121e4565b905081356122628161220d565b81526122706020830161221b565b60208201526122816040830161221b565b604082015292915050565b6000806080838503121561229f57600080fd5b6122a8836120b9565b91506122b7846020850161223b565b90509250929050565b600082601f8301126122d157600080fd5b813567ffffffffffffffff808211156122ec576122ec6121b5565b604051601f83017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f01168101908282118183101715612332576123326121b5565b8160405283815286602085880101111561234b57600080fd5b836020870160208301376000602085830101528094505050505092915050565b803567ffffffffffffffff811681146120dd57600080fd5b600080600080600060a0868803121561239b57600080fd5b853567ffffffffffffffff808211156123b357600080fd5b6123bf89838a016122c0565b96506123cd602089016120b9565b9550604088013594506123e26060890161236b565b935060808801359150808211156123f857600080fd5b50612405888289016122c0565b9150509295509295909350565b6020808252825182820181905260009190848201906040850190845b8181101561246057835173ffffffffffffffffffffffffffffffffffffffff168352928401929184019160010161242e565b50909695505050505050565b60008083601f84011261247e57600080fd5b50813567ffffffffffffffff81111561249657600080fd5b60208301915083602082850101111561214257600080fd5b600080600080600080600060a0888a0312156124c957600080fd5b6124d2886120b9565b9650602088013567ffffffffffffffff808211156124ef57600080fd5b6124fb8b838c0161246c565b909850965060408a0135955086915061251660608b0161236b565b945060808a013591508082111561252c57600080fd5b506125398a828b0161246c565b989b979a50959850939692959293505050565b60008083601f84011261255e57600080fd5b50813567ffffffffffffffff81111561257657600080fd5b60208301915083602060a08302850101111561214257600080fd5b600080600080604085870312156125a757600080fd5b843567ffffffffffffffff808211156125bf57600080fd5b6125cb8883890161254c565b909650945060208701359150808211156125e457600080fd5b506121a98782880161254c565b73ffffffffffffffffffffffffffffffffffffffff8316815260808101610de560208301848051151582526020808201516fffffffffffffffffffffffffffffffff9081169184019190915260409182015116910152565b60006020828403121561265b57600080fd5b8151610de58161220d565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036126f5576126f5612695565b5060010190565b8181038181111561048d5761048d612695565b6060810161048d82848051151582526020808201516fffffffffffffffffffffffffffffffff9081169184019190915260409182015116910152565b600060a0828403121561275d57600080fd5b6127656121e4565b61276e836120b9565b8152602083013561277e8161220d565b6020820152612790846040850161223b565b60408201529392505050565b808202811582820484141761048d5761048d612695565b8082018082111561048d5761048d612695565b6000826127fc577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fdfea164736f6c6343000813000a", +} + +var BurnMintTokenPoolABI = BurnMintTokenPoolMetaData.ABI + +var BurnMintTokenPoolBin = BurnMintTokenPoolMetaData.Bin + +func DeployBurnMintTokenPool(auth *bind.TransactOpts, backend bind.ContractBackend, token common.Address, allowlist []common.Address, armProxy common.Address) (common.Address, *types.Transaction, *BurnMintTokenPool, error) { + parsed, err := BurnMintTokenPoolMetaData.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(BurnMintTokenPoolBin), backend, token, allowlist, armProxy) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &BurnMintTokenPool{address: address, abi: *parsed, BurnMintTokenPoolCaller: BurnMintTokenPoolCaller{contract: contract}, BurnMintTokenPoolTransactor: BurnMintTokenPoolTransactor{contract: contract}, BurnMintTokenPoolFilterer: BurnMintTokenPoolFilterer{contract: contract}}, nil +} + +type BurnMintTokenPool struct { + address common.Address + abi abi.ABI + BurnMintTokenPoolCaller + BurnMintTokenPoolTransactor + BurnMintTokenPoolFilterer +} + +type BurnMintTokenPoolCaller struct { + contract *bind.BoundContract +} + +type BurnMintTokenPoolTransactor struct { + contract *bind.BoundContract +} + +type BurnMintTokenPoolFilterer struct { + contract *bind.BoundContract +} + +type BurnMintTokenPoolSession struct { + Contract *BurnMintTokenPool + CallOpts bind.CallOpts + TransactOpts bind.TransactOpts +} + +type BurnMintTokenPoolCallerSession struct { + Contract *BurnMintTokenPoolCaller + CallOpts bind.CallOpts +} + +type BurnMintTokenPoolTransactorSession struct { + Contract *BurnMintTokenPoolTransactor + TransactOpts bind.TransactOpts +} + +type BurnMintTokenPoolRaw struct { + Contract *BurnMintTokenPool +} + +type BurnMintTokenPoolCallerRaw struct { + Contract *BurnMintTokenPoolCaller +} + +type BurnMintTokenPoolTransactorRaw struct { + Contract *BurnMintTokenPoolTransactor +} + +func NewBurnMintTokenPool(address common.Address, backend bind.ContractBackend) (*BurnMintTokenPool, error) { + abi, err := abi.JSON(strings.NewReader(BurnMintTokenPoolABI)) + if err != nil { + return nil, err + } + contract, err := bindBurnMintTokenPool(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &BurnMintTokenPool{address: address, abi: abi, BurnMintTokenPoolCaller: BurnMintTokenPoolCaller{contract: contract}, BurnMintTokenPoolTransactor: BurnMintTokenPoolTransactor{contract: contract}, BurnMintTokenPoolFilterer: BurnMintTokenPoolFilterer{contract: contract}}, nil +} + +func NewBurnMintTokenPoolCaller(address common.Address, caller bind.ContractCaller) (*BurnMintTokenPoolCaller, error) { + contract, err := bindBurnMintTokenPool(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &BurnMintTokenPoolCaller{contract: contract}, nil +} + +func NewBurnMintTokenPoolTransactor(address common.Address, transactor bind.ContractTransactor) (*BurnMintTokenPoolTransactor, error) { + contract, err := bindBurnMintTokenPool(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &BurnMintTokenPoolTransactor{contract: contract}, nil +} + +func NewBurnMintTokenPoolFilterer(address common.Address, filterer bind.ContractFilterer) (*BurnMintTokenPoolFilterer, error) { + contract, err := bindBurnMintTokenPool(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &BurnMintTokenPoolFilterer{contract: contract}, nil +} + +func bindBurnMintTokenPool(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := BurnMintTokenPoolMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +func (_BurnMintTokenPool *BurnMintTokenPoolRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _BurnMintTokenPool.Contract.BurnMintTokenPoolCaller.contract.Call(opts, result, method, params...) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _BurnMintTokenPool.Contract.BurnMintTokenPoolTransactor.contract.Transfer(opts) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _BurnMintTokenPool.Contract.BurnMintTokenPoolTransactor.contract.Transact(opts, method, params...) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _BurnMintTokenPool.Contract.contract.Call(opts, result, method, params...) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _BurnMintTokenPool.Contract.contract.Transfer(opts) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _BurnMintTokenPool.Contract.contract.Transact(opts, method, params...) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolCaller) CurrentOffRampRateLimiterState(opts *bind.CallOpts, offRamp common.Address) (RateLimiterTokenBucket, error) { + var out []interface{} + err := _BurnMintTokenPool.contract.Call(opts, &out, "currentOffRampRateLimiterState", offRamp) + + if err != nil { + return *new(RateLimiterTokenBucket), err + } + + out0 := *abi.ConvertType(out[0], new(RateLimiterTokenBucket)).(*RateLimiterTokenBucket) + + return out0, err + +} + +func (_BurnMintTokenPool *BurnMintTokenPoolSession) CurrentOffRampRateLimiterState(offRamp common.Address) (RateLimiterTokenBucket, error) { + return _BurnMintTokenPool.Contract.CurrentOffRampRateLimiterState(&_BurnMintTokenPool.CallOpts, offRamp) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolCallerSession) CurrentOffRampRateLimiterState(offRamp common.Address) (RateLimiterTokenBucket, error) { + return _BurnMintTokenPool.Contract.CurrentOffRampRateLimiterState(&_BurnMintTokenPool.CallOpts, offRamp) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolCaller) CurrentOnRampRateLimiterState(opts *bind.CallOpts, onRamp common.Address) (RateLimiterTokenBucket, error) { + var out []interface{} + err := _BurnMintTokenPool.contract.Call(opts, &out, "currentOnRampRateLimiterState", onRamp) + + if err != nil { + return *new(RateLimiterTokenBucket), err + } + + out0 := *abi.ConvertType(out[0], new(RateLimiterTokenBucket)).(*RateLimiterTokenBucket) + + return out0, err + +} + +func (_BurnMintTokenPool *BurnMintTokenPoolSession) CurrentOnRampRateLimiterState(onRamp common.Address) (RateLimiterTokenBucket, error) { + return _BurnMintTokenPool.Contract.CurrentOnRampRateLimiterState(&_BurnMintTokenPool.CallOpts, onRamp) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolCallerSession) CurrentOnRampRateLimiterState(onRamp common.Address) (RateLimiterTokenBucket, error) { + return _BurnMintTokenPool.Contract.CurrentOnRampRateLimiterState(&_BurnMintTokenPool.CallOpts, onRamp) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolCaller) GetAllowList(opts *bind.CallOpts) ([]common.Address, error) { + var out []interface{} + err := _BurnMintTokenPool.contract.Call(opts, &out, "getAllowList") + + if err != nil { + return *new([]common.Address), err + } + + out0 := *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) + + return out0, err + +} + +func (_BurnMintTokenPool *BurnMintTokenPoolSession) GetAllowList() ([]common.Address, error) { + return _BurnMintTokenPool.Contract.GetAllowList(&_BurnMintTokenPool.CallOpts) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolCallerSession) GetAllowList() ([]common.Address, error) { + return _BurnMintTokenPool.Contract.GetAllowList(&_BurnMintTokenPool.CallOpts) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolCaller) GetAllowListEnabled(opts *bind.CallOpts) (bool, error) { + var out []interface{} + err := _BurnMintTokenPool.contract.Call(opts, &out, "getAllowListEnabled") + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_BurnMintTokenPool *BurnMintTokenPoolSession) GetAllowListEnabled() (bool, error) { + return _BurnMintTokenPool.Contract.GetAllowListEnabled(&_BurnMintTokenPool.CallOpts) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolCallerSession) GetAllowListEnabled() (bool, error) { + return _BurnMintTokenPool.Contract.GetAllowListEnabled(&_BurnMintTokenPool.CallOpts) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolCaller) GetArmProxy(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _BurnMintTokenPool.contract.Call(opts, &out, "getArmProxy") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_BurnMintTokenPool *BurnMintTokenPoolSession) GetArmProxy() (common.Address, error) { + return _BurnMintTokenPool.Contract.GetArmProxy(&_BurnMintTokenPool.CallOpts) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolCallerSession) GetArmProxy() (common.Address, error) { + return _BurnMintTokenPool.Contract.GetArmProxy(&_BurnMintTokenPool.CallOpts) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolCaller) GetOffRamps(opts *bind.CallOpts) ([]common.Address, error) { + var out []interface{} + err := _BurnMintTokenPool.contract.Call(opts, &out, "getOffRamps") + + if err != nil { + return *new([]common.Address), err + } + + out0 := *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) + + return out0, err + +} + +func (_BurnMintTokenPool *BurnMintTokenPoolSession) GetOffRamps() ([]common.Address, error) { + return _BurnMintTokenPool.Contract.GetOffRamps(&_BurnMintTokenPool.CallOpts) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolCallerSession) GetOffRamps() ([]common.Address, error) { + return _BurnMintTokenPool.Contract.GetOffRamps(&_BurnMintTokenPool.CallOpts) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolCaller) GetOnRamps(opts *bind.CallOpts) ([]common.Address, error) { + var out []interface{} + err := _BurnMintTokenPool.contract.Call(opts, &out, "getOnRamps") + + if err != nil { + return *new([]common.Address), err + } + + out0 := *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) + + return out0, err + +} + +func (_BurnMintTokenPool *BurnMintTokenPoolSession) GetOnRamps() ([]common.Address, error) { + return _BurnMintTokenPool.Contract.GetOnRamps(&_BurnMintTokenPool.CallOpts) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolCallerSession) GetOnRamps() ([]common.Address, error) { + return _BurnMintTokenPool.Contract.GetOnRamps(&_BurnMintTokenPool.CallOpts) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolCaller) GetToken(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _BurnMintTokenPool.contract.Call(opts, &out, "getToken") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_BurnMintTokenPool *BurnMintTokenPoolSession) GetToken() (common.Address, error) { + return _BurnMintTokenPool.Contract.GetToken(&_BurnMintTokenPool.CallOpts) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolCallerSession) GetToken() (common.Address, error) { + return _BurnMintTokenPool.Contract.GetToken(&_BurnMintTokenPool.CallOpts) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolCaller) IsOffRamp(opts *bind.CallOpts, offRamp common.Address) (bool, error) { + var out []interface{} + err := _BurnMintTokenPool.contract.Call(opts, &out, "isOffRamp", offRamp) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_BurnMintTokenPool *BurnMintTokenPoolSession) IsOffRamp(offRamp common.Address) (bool, error) { + return _BurnMintTokenPool.Contract.IsOffRamp(&_BurnMintTokenPool.CallOpts, offRamp) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolCallerSession) IsOffRamp(offRamp common.Address) (bool, error) { + return _BurnMintTokenPool.Contract.IsOffRamp(&_BurnMintTokenPool.CallOpts, offRamp) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolCaller) IsOnRamp(opts *bind.CallOpts, onRamp common.Address) (bool, error) { + var out []interface{} + err := _BurnMintTokenPool.contract.Call(opts, &out, "isOnRamp", onRamp) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_BurnMintTokenPool *BurnMintTokenPoolSession) IsOnRamp(onRamp common.Address) (bool, error) { + return _BurnMintTokenPool.Contract.IsOnRamp(&_BurnMintTokenPool.CallOpts, onRamp) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolCallerSession) IsOnRamp(onRamp common.Address) (bool, error) { + return _BurnMintTokenPool.Contract.IsOnRamp(&_BurnMintTokenPool.CallOpts, onRamp) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolCaller) Owner(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _BurnMintTokenPool.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 + +} + +func (_BurnMintTokenPool *BurnMintTokenPoolSession) Owner() (common.Address, error) { + return _BurnMintTokenPool.Contract.Owner(&_BurnMintTokenPool.CallOpts) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolCallerSession) Owner() (common.Address, error) { + return _BurnMintTokenPool.Contract.Owner(&_BurnMintTokenPool.CallOpts) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolCaller) SupportsInterface(opts *bind.CallOpts, interfaceId [4]byte) (bool, error) { + var out []interface{} + err := _BurnMintTokenPool.contract.Call(opts, &out, "supportsInterface", interfaceId) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_BurnMintTokenPool *BurnMintTokenPoolSession) SupportsInterface(interfaceId [4]byte) (bool, error) { + return _BurnMintTokenPool.Contract.SupportsInterface(&_BurnMintTokenPool.CallOpts, interfaceId) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolCallerSession) SupportsInterface(interfaceId [4]byte) (bool, error) { + return _BurnMintTokenPool.Contract.SupportsInterface(&_BurnMintTokenPool.CallOpts, interfaceId) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolCaller) TypeAndVersion(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _BurnMintTokenPool.contract.Call(opts, &out, "typeAndVersion") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +func (_BurnMintTokenPool *BurnMintTokenPoolSession) TypeAndVersion() (string, error) { + return _BurnMintTokenPool.Contract.TypeAndVersion(&_BurnMintTokenPool.CallOpts) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolCallerSession) TypeAndVersion() (string, error) { + return _BurnMintTokenPool.Contract.TypeAndVersion(&_BurnMintTokenPool.CallOpts) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolTransactor) AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + return _BurnMintTokenPool.contract.Transact(opts, "acceptOwnership") +} + +func (_BurnMintTokenPool *BurnMintTokenPoolSession) AcceptOwnership() (*types.Transaction, error) { + return _BurnMintTokenPool.Contract.AcceptOwnership(&_BurnMintTokenPool.TransactOpts) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolTransactorSession) AcceptOwnership() (*types.Transaction, error) { + return _BurnMintTokenPool.Contract.AcceptOwnership(&_BurnMintTokenPool.TransactOpts) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolTransactor) ApplyAllowListUpdates(opts *bind.TransactOpts, removes []common.Address, adds []common.Address) (*types.Transaction, error) { + return _BurnMintTokenPool.contract.Transact(opts, "applyAllowListUpdates", removes, adds) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolSession) ApplyAllowListUpdates(removes []common.Address, adds []common.Address) (*types.Transaction, error) { + return _BurnMintTokenPool.Contract.ApplyAllowListUpdates(&_BurnMintTokenPool.TransactOpts, removes, adds) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolTransactorSession) ApplyAllowListUpdates(removes []common.Address, adds []common.Address) (*types.Transaction, error) { + return _BurnMintTokenPool.Contract.ApplyAllowListUpdates(&_BurnMintTokenPool.TransactOpts, removes, adds) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolTransactor) ApplyRampUpdates(opts *bind.TransactOpts, onRamps []TokenPoolRampUpdate, offRamps []TokenPoolRampUpdate) (*types.Transaction, error) { + return _BurnMintTokenPool.contract.Transact(opts, "applyRampUpdates", onRamps, offRamps) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolSession) ApplyRampUpdates(onRamps []TokenPoolRampUpdate, offRamps []TokenPoolRampUpdate) (*types.Transaction, error) { + return _BurnMintTokenPool.Contract.ApplyRampUpdates(&_BurnMintTokenPool.TransactOpts, onRamps, offRamps) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolTransactorSession) ApplyRampUpdates(onRamps []TokenPoolRampUpdate, offRamps []TokenPoolRampUpdate) (*types.Transaction, error) { + return _BurnMintTokenPool.Contract.ApplyRampUpdates(&_BurnMintTokenPool.TransactOpts, onRamps, offRamps) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolTransactor) LockOrBurn(opts *bind.TransactOpts, originalSender common.Address, arg1 []byte, amount *big.Int, arg3 uint64, arg4 []byte) (*types.Transaction, error) { + return _BurnMintTokenPool.contract.Transact(opts, "lockOrBurn", originalSender, arg1, amount, arg3, arg4) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolSession) LockOrBurn(originalSender common.Address, arg1 []byte, amount *big.Int, arg3 uint64, arg4 []byte) (*types.Transaction, error) { + return _BurnMintTokenPool.Contract.LockOrBurn(&_BurnMintTokenPool.TransactOpts, originalSender, arg1, amount, arg3, arg4) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolTransactorSession) LockOrBurn(originalSender common.Address, arg1 []byte, amount *big.Int, arg3 uint64, arg4 []byte) (*types.Transaction, error) { + return _BurnMintTokenPool.Contract.LockOrBurn(&_BurnMintTokenPool.TransactOpts, originalSender, arg1, amount, arg3, arg4) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolTransactor) ReleaseOrMint(opts *bind.TransactOpts, arg0 []byte, receiver common.Address, amount *big.Int, arg3 uint64, arg4 []byte) (*types.Transaction, error) { + return _BurnMintTokenPool.contract.Transact(opts, "releaseOrMint", arg0, receiver, amount, arg3, arg4) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolSession) ReleaseOrMint(arg0 []byte, receiver common.Address, amount *big.Int, arg3 uint64, arg4 []byte) (*types.Transaction, error) { + return _BurnMintTokenPool.Contract.ReleaseOrMint(&_BurnMintTokenPool.TransactOpts, arg0, receiver, amount, arg3, arg4) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolTransactorSession) ReleaseOrMint(arg0 []byte, receiver common.Address, amount *big.Int, arg3 uint64, arg4 []byte) (*types.Transaction, error) { + return _BurnMintTokenPool.Contract.ReleaseOrMint(&_BurnMintTokenPool.TransactOpts, arg0, receiver, amount, arg3, arg4) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolTransactor) SetOffRampRateLimiterConfig(opts *bind.TransactOpts, offRamp common.Address, config RateLimiterConfig) (*types.Transaction, error) { + return _BurnMintTokenPool.contract.Transact(opts, "setOffRampRateLimiterConfig", offRamp, config) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolSession) SetOffRampRateLimiterConfig(offRamp common.Address, config RateLimiterConfig) (*types.Transaction, error) { + return _BurnMintTokenPool.Contract.SetOffRampRateLimiterConfig(&_BurnMintTokenPool.TransactOpts, offRamp, config) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolTransactorSession) SetOffRampRateLimiterConfig(offRamp common.Address, config RateLimiterConfig) (*types.Transaction, error) { + return _BurnMintTokenPool.Contract.SetOffRampRateLimiterConfig(&_BurnMintTokenPool.TransactOpts, offRamp, config) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolTransactor) SetOnRampRateLimiterConfig(opts *bind.TransactOpts, onRamp common.Address, config RateLimiterConfig) (*types.Transaction, error) { + return _BurnMintTokenPool.contract.Transact(opts, "setOnRampRateLimiterConfig", onRamp, config) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolSession) SetOnRampRateLimiterConfig(onRamp common.Address, config RateLimiterConfig) (*types.Transaction, error) { + return _BurnMintTokenPool.Contract.SetOnRampRateLimiterConfig(&_BurnMintTokenPool.TransactOpts, onRamp, config) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolTransactorSession) SetOnRampRateLimiterConfig(onRamp common.Address, config RateLimiterConfig) (*types.Transaction, error) { + return _BurnMintTokenPool.Contract.SetOnRampRateLimiterConfig(&_BurnMintTokenPool.TransactOpts, onRamp, config) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolTransactor) TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) { + return _BurnMintTokenPool.contract.Transact(opts, "transferOwnership", to) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolSession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _BurnMintTokenPool.Contract.TransferOwnership(&_BurnMintTokenPool.TransactOpts, to) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolTransactorSession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _BurnMintTokenPool.Contract.TransferOwnership(&_BurnMintTokenPool.TransactOpts, to) +} + +type BurnMintTokenPoolAllowListAddIterator struct { + Event *BurnMintTokenPoolAllowListAdd + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *BurnMintTokenPoolAllowListAddIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolAllowListAdd) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolAllowListAdd) + 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() + } +} + +func (it *BurnMintTokenPoolAllowListAddIterator) Error() error { + return it.fail +} + +func (it *BurnMintTokenPoolAllowListAddIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type BurnMintTokenPoolAllowListAdd struct { + Sender common.Address + Raw types.Log +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) FilterAllowListAdd(opts *bind.FilterOpts) (*BurnMintTokenPoolAllowListAddIterator, error) { + + logs, sub, err := _BurnMintTokenPool.contract.FilterLogs(opts, "AllowListAdd") + if err != nil { + return nil, err + } + return &BurnMintTokenPoolAllowListAddIterator{contract: _BurnMintTokenPool.contract, event: "AllowListAdd", logs: logs, sub: sub}, nil +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) WatchAllowListAdd(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolAllowListAdd) (event.Subscription, error) { + + logs, sub, err := _BurnMintTokenPool.contract.WatchLogs(opts, "AllowListAdd") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(BurnMintTokenPoolAllowListAdd) + if err := _BurnMintTokenPool.contract.UnpackLog(event, "AllowListAdd", 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 +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) ParseAllowListAdd(log types.Log) (*BurnMintTokenPoolAllowListAdd, error) { + event := new(BurnMintTokenPoolAllowListAdd) + if err := _BurnMintTokenPool.contract.UnpackLog(event, "AllowListAdd", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type BurnMintTokenPoolAllowListRemoveIterator struct { + Event *BurnMintTokenPoolAllowListRemove + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *BurnMintTokenPoolAllowListRemoveIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolAllowListRemove) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolAllowListRemove) + 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() + } +} + +func (it *BurnMintTokenPoolAllowListRemoveIterator) Error() error { + return it.fail +} + +func (it *BurnMintTokenPoolAllowListRemoveIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type BurnMintTokenPoolAllowListRemove struct { + Sender common.Address + Raw types.Log +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) FilterAllowListRemove(opts *bind.FilterOpts) (*BurnMintTokenPoolAllowListRemoveIterator, error) { + + logs, sub, err := _BurnMintTokenPool.contract.FilterLogs(opts, "AllowListRemove") + if err != nil { + return nil, err + } + return &BurnMintTokenPoolAllowListRemoveIterator{contract: _BurnMintTokenPool.contract, event: "AllowListRemove", logs: logs, sub: sub}, nil +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) WatchAllowListRemove(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolAllowListRemove) (event.Subscription, error) { + + logs, sub, err := _BurnMintTokenPool.contract.WatchLogs(opts, "AllowListRemove") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(BurnMintTokenPoolAllowListRemove) + if err := _BurnMintTokenPool.contract.UnpackLog(event, "AllowListRemove", 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 +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) ParseAllowListRemove(log types.Log) (*BurnMintTokenPoolAllowListRemove, error) { + event := new(BurnMintTokenPoolAllowListRemove) + if err := _BurnMintTokenPool.contract.UnpackLog(event, "AllowListRemove", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type BurnMintTokenPoolBurnedIterator struct { + Event *BurnMintTokenPoolBurned + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *BurnMintTokenPoolBurnedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolBurned) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolBurned) + 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() + } +} + +func (it *BurnMintTokenPoolBurnedIterator) Error() error { + return it.fail +} + +func (it *BurnMintTokenPoolBurnedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type BurnMintTokenPoolBurned struct { + Sender common.Address + Amount *big.Int + Raw types.Log +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) FilterBurned(opts *bind.FilterOpts, sender []common.Address) (*BurnMintTokenPoolBurnedIterator, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _BurnMintTokenPool.contract.FilterLogs(opts, "Burned", senderRule) + if err != nil { + return nil, err + } + return &BurnMintTokenPoolBurnedIterator{contract: _BurnMintTokenPool.contract, event: "Burned", logs: logs, sub: sub}, nil +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) WatchBurned(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolBurned, sender []common.Address) (event.Subscription, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _BurnMintTokenPool.contract.WatchLogs(opts, "Burned", senderRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(BurnMintTokenPoolBurned) + if err := _BurnMintTokenPool.contract.UnpackLog(event, "Burned", 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 +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) ParseBurned(log types.Log) (*BurnMintTokenPoolBurned, error) { + event := new(BurnMintTokenPoolBurned) + if err := _BurnMintTokenPool.contract.UnpackLog(event, "Burned", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type BurnMintTokenPoolLockedIterator struct { + Event *BurnMintTokenPoolLocked + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *BurnMintTokenPoolLockedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolLocked) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolLocked) + 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() + } +} + +func (it *BurnMintTokenPoolLockedIterator) Error() error { + return it.fail +} + +func (it *BurnMintTokenPoolLockedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type BurnMintTokenPoolLocked struct { + Sender common.Address + Amount *big.Int + Raw types.Log +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) FilterLocked(opts *bind.FilterOpts, sender []common.Address) (*BurnMintTokenPoolLockedIterator, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _BurnMintTokenPool.contract.FilterLogs(opts, "Locked", senderRule) + if err != nil { + return nil, err + } + return &BurnMintTokenPoolLockedIterator{contract: _BurnMintTokenPool.contract, event: "Locked", logs: logs, sub: sub}, nil +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) WatchLocked(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolLocked, sender []common.Address) (event.Subscription, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _BurnMintTokenPool.contract.WatchLogs(opts, "Locked", senderRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(BurnMintTokenPoolLocked) + if err := _BurnMintTokenPool.contract.UnpackLog(event, "Locked", 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 +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) ParseLocked(log types.Log) (*BurnMintTokenPoolLocked, error) { + event := new(BurnMintTokenPoolLocked) + if err := _BurnMintTokenPool.contract.UnpackLog(event, "Locked", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type BurnMintTokenPoolMintedIterator struct { + Event *BurnMintTokenPoolMinted + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *BurnMintTokenPoolMintedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolMinted) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolMinted) + 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() + } +} + +func (it *BurnMintTokenPoolMintedIterator) Error() error { + return it.fail +} + +func (it *BurnMintTokenPoolMintedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type BurnMintTokenPoolMinted struct { + Sender common.Address + Recipient common.Address + Amount *big.Int + Raw types.Log +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) FilterMinted(opts *bind.FilterOpts, sender []common.Address, recipient []common.Address) (*BurnMintTokenPoolMintedIterator, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + var recipientRule []interface{} + for _, recipientItem := range recipient { + recipientRule = append(recipientRule, recipientItem) + } + + logs, sub, err := _BurnMintTokenPool.contract.FilterLogs(opts, "Minted", senderRule, recipientRule) + if err != nil { + return nil, err + } + return &BurnMintTokenPoolMintedIterator{contract: _BurnMintTokenPool.contract, event: "Minted", logs: logs, sub: sub}, nil +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) WatchMinted(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolMinted, sender []common.Address, recipient []common.Address) (event.Subscription, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + var recipientRule []interface{} + for _, recipientItem := range recipient { + recipientRule = append(recipientRule, recipientItem) + } + + logs, sub, err := _BurnMintTokenPool.contract.WatchLogs(opts, "Minted", senderRule, recipientRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(BurnMintTokenPoolMinted) + if err := _BurnMintTokenPool.contract.UnpackLog(event, "Minted", 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 +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) ParseMinted(log types.Log) (*BurnMintTokenPoolMinted, error) { + event := new(BurnMintTokenPoolMinted) + if err := _BurnMintTokenPool.contract.UnpackLog(event, "Minted", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type BurnMintTokenPoolOffRampAddedIterator struct { + Event *BurnMintTokenPoolOffRampAdded + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *BurnMintTokenPoolOffRampAddedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolOffRampAdded) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolOffRampAdded) + 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() + } +} + +func (it *BurnMintTokenPoolOffRampAddedIterator) Error() error { + return it.fail +} + +func (it *BurnMintTokenPoolOffRampAddedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type BurnMintTokenPoolOffRampAdded struct { + OffRamp common.Address + RateLimiterConfig RateLimiterConfig + Raw types.Log +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) FilterOffRampAdded(opts *bind.FilterOpts) (*BurnMintTokenPoolOffRampAddedIterator, error) { + + logs, sub, err := _BurnMintTokenPool.contract.FilterLogs(opts, "OffRampAdded") + if err != nil { + return nil, err + } + return &BurnMintTokenPoolOffRampAddedIterator{contract: _BurnMintTokenPool.contract, event: "OffRampAdded", logs: logs, sub: sub}, nil +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) WatchOffRampAdded(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolOffRampAdded) (event.Subscription, error) { + + logs, sub, err := _BurnMintTokenPool.contract.WatchLogs(opts, "OffRampAdded") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(BurnMintTokenPoolOffRampAdded) + if err := _BurnMintTokenPool.contract.UnpackLog(event, "OffRampAdded", 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 +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) ParseOffRampAdded(log types.Log) (*BurnMintTokenPoolOffRampAdded, error) { + event := new(BurnMintTokenPoolOffRampAdded) + if err := _BurnMintTokenPool.contract.UnpackLog(event, "OffRampAdded", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type BurnMintTokenPoolOffRampConfiguredIterator struct { + Event *BurnMintTokenPoolOffRampConfigured + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *BurnMintTokenPoolOffRampConfiguredIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolOffRampConfigured) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolOffRampConfigured) + 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() + } +} + +func (it *BurnMintTokenPoolOffRampConfiguredIterator) Error() error { + return it.fail +} + +func (it *BurnMintTokenPoolOffRampConfiguredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type BurnMintTokenPoolOffRampConfigured struct { + OffRamp common.Address + RateLimiterConfig RateLimiterConfig + Raw types.Log +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) FilterOffRampConfigured(opts *bind.FilterOpts) (*BurnMintTokenPoolOffRampConfiguredIterator, error) { + + logs, sub, err := _BurnMintTokenPool.contract.FilterLogs(opts, "OffRampConfigured") + if err != nil { + return nil, err + } + return &BurnMintTokenPoolOffRampConfiguredIterator{contract: _BurnMintTokenPool.contract, event: "OffRampConfigured", logs: logs, sub: sub}, nil +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) WatchOffRampConfigured(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolOffRampConfigured) (event.Subscription, error) { + + logs, sub, err := _BurnMintTokenPool.contract.WatchLogs(opts, "OffRampConfigured") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(BurnMintTokenPoolOffRampConfigured) + if err := _BurnMintTokenPool.contract.UnpackLog(event, "OffRampConfigured", 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 +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) ParseOffRampConfigured(log types.Log) (*BurnMintTokenPoolOffRampConfigured, error) { + event := new(BurnMintTokenPoolOffRampConfigured) + if err := _BurnMintTokenPool.contract.UnpackLog(event, "OffRampConfigured", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type BurnMintTokenPoolOffRampRemovedIterator struct { + Event *BurnMintTokenPoolOffRampRemoved + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *BurnMintTokenPoolOffRampRemovedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolOffRampRemoved) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolOffRampRemoved) + 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() + } +} + +func (it *BurnMintTokenPoolOffRampRemovedIterator) Error() error { + return it.fail +} + +func (it *BurnMintTokenPoolOffRampRemovedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type BurnMintTokenPoolOffRampRemoved struct { + OffRamp common.Address + Raw types.Log +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) FilterOffRampRemoved(opts *bind.FilterOpts) (*BurnMintTokenPoolOffRampRemovedIterator, error) { + + logs, sub, err := _BurnMintTokenPool.contract.FilterLogs(opts, "OffRampRemoved") + if err != nil { + return nil, err + } + return &BurnMintTokenPoolOffRampRemovedIterator{contract: _BurnMintTokenPool.contract, event: "OffRampRemoved", logs: logs, sub: sub}, nil +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) WatchOffRampRemoved(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolOffRampRemoved) (event.Subscription, error) { + + logs, sub, err := _BurnMintTokenPool.contract.WatchLogs(opts, "OffRampRemoved") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(BurnMintTokenPoolOffRampRemoved) + if err := _BurnMintTokenPool.contract.UnpackLog(event, "OffRampRemoved", 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 +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) ParseOffRampRemoved(log types.Log) (*BurnMintTokenPoolOffRampRemoved, error) { + event := new(BurnMintTokenPoolOffRampRemoved) + if err := _BurnMintTokenPool.contract.UnpackLog(event, "OffRampRemoved", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type BurnMintTokenPoolOnRampAddedIterator struct { + Event *BurnMintTokenPoolOnRampAdded + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *BurnMintTokenPoolOnRampAddedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolOnRampAdded) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolOnRampAdded) + 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() + } +} + +func (it *BurnMintTokenPoolOnRampAddedIterator) Error() error { + return it.fail +} + +func (it *BurnMintTokenPoolOnRampAddedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type BurnMintTokenPoolOnRampAdded struct { + OnRamp common.Address + RateLimiterConfig RateLimiterConfig + Raw types.Log +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) FilterOnRampAdded(opts *bind.FilterOpts) (*BurnMintTokenPoolOnRampAddedIterator, error) { + + logs, sub, err := _BurnMintTokenPool.contract.FilterLogs(opts, "OnRampAdded") + if err != nil { + return nil, err + } + return &BurnMintTokenPoolOnRampAddedIterator{contract: _BurnMintTokenPool.contract, event: "OnRampAdded", logs: logs, sub: sub}, nil +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) WatchOnRampAdded(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolOnRampAdded) (event.Subscription, error) { + + logs, sub, err := _BurnMintTokenPool.contract.WatchLogs(opts, "OnRampAdded") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(BurnMintTokenPoolOnRampAdded) + if err := _BurnMintTokenPool.contract.UnpackLog(event, "OnRampAdded", 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 +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) ParseOnRampAdded(log types.Log) (*BurnMintTokenPoolOnRampAdded, error) { + event := new(BurnMintTokenPoolOnRampAdded) + if err := _BurnMintTokenPool.contract.UnpackLog(event, "OnRampAdded", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type BurnMintTokenPoolOnRampConfiguredIterator struct { + Event *BurnMintTokenPoolOnRampConfigured + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *BurnMintTokenPoolOnRampConfiguredIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolOnRampConfigured) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolOnRampConfigured) + 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() + } +} + +func (it *BurnMintTokenPoolOnRampConfiguredIterator) Error() error { + return it.fail +} + +func (it *BurnMintTokenPoolOnRampConfiguredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type BurnMintTokenPoolOnRampConfigured struct { + OnRamp common.Address + RateLimiterConfig RateLimiterConfig + Raw types.Log +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) FilterOnRampConfigured(opts *bind.FilterOpts) (*BurnMintTokenPoolOnRampConfiguredIterator, error) { + + logs, sub, err := _BurnMintTokenPool.contract.FilterLogs(opts, "OnRampConfigured") + if err != nil { + return nil, err + } + return &BurnMintTokenPoolOnRampConfiguredIterator{contract: _BurnMintTokenPool.contract, event: "OnRampConfigured", logs: logs, sub: sub}, nil +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) WatchOnRampConfigured(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolOnRampConfigured) (event.Subscription, error) { + + logs, sub, err := _BurnMintTokenPool.contract.WatchLogs(opts, "OnRampConfigured") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(BurnMintTokenPoolOnRampConfigured) + if err := _BurnMintTokenPool.contract.UnpackLog(event, "OnRampConfigured", 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 +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) ParseOnRampConfigured(log types.Log) (*BurnMintTokenPoolOnRampConfigured, error) { + event := new(BurnMintTokenPoolOnRampConfigured) + if err := _BurnMintTokenPool.contract.UnpackLog(event, "OnRampConfigured", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type BurnMintTokenPoolOnRampRemovedIterator struct { + Event *BurnMintTokenPoolOnRampRemoved + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *BurnMintTokenPoolOnRampRemovedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolOnRampRemoved) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolOnRampRemoved) + 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() + } +} + +func (it *BurnMintTokenPoolOnRampRemovedIterator) Error() error { + return it.fail +} + +func (it *BurnMintTokenPoolOnRampRemovedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type BurnMintTokenPoolOnRampRemoved struct { + OnRamp common.Address + Raw types.Log +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) FilterOnRampRemoved(opts *bind.FilterOpts) (*BurnMintTokenPoolOnRampRemovedIterator, error) { + + logs, sub, err := _BurnMintTokenPool.contract.FilterLogs(opts, "OnRampRemoved") + if err != nil { + return nil, err + } + return &BurnMintTokenPoolOnRampRemovedIterator{contract: _BurnMintTokenPool.contract, event: "OnRampRemoved", logs: logs, sub: sub}, nil +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) WatchOnRampRemoved(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolOnRampRemoved) (event.Subscription, error) { + + logs, sub, err := _BurnMintTokenPool.contract.WatchLogs(opts, "OnRampRemoved") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(BurnMintTokenPoolOnRampRemoved) + if err := _BurnMintTokenPool.contract.UnpackLog(event, "OnRampRemoved", 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 +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) ParseOnRampRemoved(log types.Log) (*BurnMintTokenPoolOnRampRemoved, error) { + event := new(BurnMintTokenPoolOnRampRemoved) + if err := _BurnMintTokenPool.contract.UnpackLog(event, "OnRampRemoved", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type BurnMintTokenPoolOwnershipTransferRequestedIterator struct { + Event *BurnMintTokenPoolOwnershipTransferRequested + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *BurnMintTokenPoolOwnershipTransferRequestedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolOwnershipTransferRequested) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolOwnershipTransferRequested) + 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() + } +} + +func (it *BurnMintTokenPoolOwnershipTransferRequestedIterator) Error() error { + return it.fail +} + +func (it *BurnMintTokenPoolOwnershipTransferRequestedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type BurnMintTokenPoolOwnershipTransferRequested struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*BurnMintTokenPoolOwnershipTransferRequestedIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _BurnMintTokenPool.contract.FilterLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return &BurnMintTokenPoolOwnershipTransferRequestedIterator{contract: _BurnMintTokenPool.contract, event: "OwnershipTransferRequested", logs: logs, sub: sub}, nil +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _BurnMintTokenPool.contract.WatchLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(BurnMintTokenPoolOwnershipTransferRequested) + if err := _BurnMintTokenPool.contract.UnpackLog(event, "OwnershipTransferRequested", 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 +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) ParseOwnershipTransferRequested(log types.Log) (*BurnMintTokenPoolOwnershipTransferRequested, error) { + event := new(BurnMintTokenPoolOwnershipTransferRequested) + if err := _BurnMintTokenPool.contract.UnpackLog(event, "OwnershipTransferRequested", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type BurnMintTokenPoolOwnershipTransferredIterator struct { + Event *BurnMintTokenPoolOwnershipTransferred + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *BurnMintTokenPoolOwnershipTransferredIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolOwnershipTransferred) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolOwnershipTransferred) + 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() + } +} + +func (it *BurnMintTokenPoolOwnershipTransferredIterator) Error() error { + return it.fail +} + +func (it *BurnMintTokenPoolOwnershipTransferredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type BurnMintTokenPoolOwnershipTransferred struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*BurnMintTokenPoolOwnershipTransferredIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _BurnMintTokenPool.contract.FilterLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return &BurnMintTokenPoolOwnershipTransferredIterator{contract: _BurnMintTokenPool.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _BurnMintTokenPool.contract.WatchLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(BurnMintTokenPoolOwnershipTransferred) + if err := _BurnMintTokenPool.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 +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) ParseOwnershipTransferred(log types.Log) (*BurnMintTokenPoolOwnershipTransferred, error) { + event := new(BurnMintTokenPoolOwnershipTransferred) + if err := _BurnMintTokenPool.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type BurnMintTokenPoolReleasedIterator struct { + Event *BurnMintTokenPoolReleased + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *BurnMintTokenPoolReleasedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolReleased) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolReleased) + 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() + } +} + +func (it *BurnMintTokenPoolReleasedIterator) Error() error { + return it.fail +} + +func (it *BurnMintTokenPoolReleasedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type BurnMintTokenPoolReleased struct { + Sender common.Address + Recipient common.Address + Amount *big.Int + Raw types.Log +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) FilterReleased(opts *bind.FilterOpts, sender []common.Address, recipient []common.Address) (*BurnMintTokenPoolReleasedIterator, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + var recipientRule []interface{} + for _, recipientItem := range recipient { + recipientRule = append(recipientRule, recipientItem) + } + + logs, sub, err := _BurnMintTokenPool.contract.FilterLogs(opts, "Released", senderRule, recipientRule) + if err != nil { + return nil, err + } + return &BurnMintTokenPoolReleasedIterator{contract: _BurnMintTokenPool.contract, event: "Released", logs: logs, sub: sub}, nil +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) WatchReleased(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolReleased, sender []common.Address, recipient []common.Address) (event.Subscription, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + var recipientRule []interface{} + for _, recipientItem := range recipient { + recipientRule = append(recipientRule, recipientItem) + } + + logs, sub, err := _BurnMintTokenPool.contract.WatchLogs(opts, "Released", senderRule, recipientRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(BurnMintTokenPoolReleased) + if err := _BurnMintTokenPool.contract.UnpackLog(event, "Released", 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 +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) ParseReleased(log types.Log) (*BurnMintTokenPoolReleased, error) { + event := new(BurnMintTokenPoolReleased) + if err := _BurnMintTokenPool.contract.UnpackLog(event, "Released", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +func (_BurnMintTokenPool *BurnMintTokenPool) ParseLog(log types.Log) (generated.AbigenLog, error) { + switch log.Topics[0] { + case _BurnMintTokenPool.abi.Events["AllowListAdd"].ID: + return _BurnMintTokenPool.ParseAllowListAdd(log) + case _BurnMintTokenPool.abi.Events["AllowListRemove"].ID: + return _BurnMintTokenPool.ParseAllowListRemove(log) + case _BurnMintTokenPool.abi.Events["Burned"].ID: + return _BurnMintTokenPool.ParseBurned(log) + case _BurnMintTokenPool.abi.Events["Locked"].ID: + return _BurnMintTokenPool.ParseLocked(log) + case _BurnMintTokenPool.abi.Events["Minted"].ID: + return _BurnMintTokenPool.ParseMinted(log) + case _BurnMintTokenPool.abi.Events["OffRampAdded"].ID: + return _BurnMintTokenPool.ParseOffRampAdded(log) + case _BurnMintTokenPool.abi.Events["OffRampConfigured"].ID: + return _BurnMintTokenPool.ParseOffRampConfigured(log) + case _BurnMintTokenPool.abi.Events["OffRampRemoved"].ID: + return _BurnMintTokenPool.ParseOffRampRemoved(log) + case _BurnMintTokenPool.abi.Events["OnRampAdded"].ID: + return _BurnMintTokenPool.ParseOnRampAdded(log) + case _BurnMintTokenPool.abi.Events["OnRampConfigured"].ID: + return _BurnMintTokenPool.ParseOnRampConfigured(log) + case _BurnMintTokenPool.abi.Events["OnRampRemoved"].ID: + return _BurnMintTokenPool.ParseOnRampRemoved(log) + case _BurnMintTokenPool.abi.Events["OwnershipTransferRequested"].ID: + return _BurnMintTokenPool.ParseOwnershipTransferRequested(log) + case _BurnMintTokenPool.abi.Events["OwnershipTransferred"].ID: + return _BurnMintTokenPool.ParseOwnershipTransferred(log) + case _BurnMintTokenPool.abi.Events["Released"].ID: + return _BurnMintTokenPool.ParseReleased(log) + + default: + return nil, fmt.Errorf("abigen wrapper received unknown log topic: %v", log.Topics[0]) + } +} + +func (BurnMintTokenPoolAllowListAdd) Topic() common.Hash { + return common.HexToHash("0x2640d4d76caf8bf478aabfa982fa4e1c4eb71a37f93cd15e80dbc657911546d8") +} + +func (BurnMintTokenPoolAllowListRemove) Topic() common.Hash { + return common.HexToHash("0x800671136ab6cfee9fbe5ed1fb7ca417811aca3cf864800d127b927adedf7566") +} + +func (BurnMintTokenPoolBurned) Topic() common.Hash { + return common.HexToHash("0x696de425f79f4a40bc6d2122ca50507f0efbeabbff86a84871b7196ab8ea8df7") +} + +func (BurnMintTokenPoolLocked) Topic() common.Hash { + return common.HexToHash("0x9f1ec8c880f76798e7b793325d625e9b60e4082a553c98f42b6cda368dd60008") +} + +func (BurnMintTokenPoolMinted) Topic() common.Hash { + return common.HexToHash("0x9d228d69b5fdb8d273a2336f8fb8612d039631024ea9bf09c424a9503aa078f0") +} + +func (BurnMintTokenPoolOffRampAdded) Topic() common.Hash { + return common.HexToHash("0x395b7374909d2b54e5796f53c898ebf41d767c86c78ea86519acf2b805852d88") +} + +func (BurnMintTokenPoolOffRampConfigured) Topic() common.Hash { + return common.HexToHash("0xb3ba339cfbb8ef80d7a29ce5493051cb90e64fcfa85d7124efc1adfa4c68399f") +} + +func (BurnMintTokenPoolOffRampRemoved) Topic() common.Hash { + return common.HexToHash("0xcf91daec21e3510e2f2aea4b09d08c235d5c6844980be709f282ef591dbf420c") +} + +func (BurnMintTokenPoolOnRampAdded) Topic() common.Hash { + return common.HexToHash("0x0b594bb0555ff7b252e0c789ccc9d8903fec294172064308727d570505cee1ac") +} + +func (BurnMintTokenPoolOnRampConfigured) Topic() common.Hash { + return common.HexToHash("0x578db78e348076074dbff64a94073a83e9a65aa6766b8c75fdc89282b0e30ed6") +} + +func (BurnMintTokenPoolOnRampRemoved) Topic() common.Hash { + return common.HexToHash("0x7fd064821314ad863a0714a3f1229375ace6b6427ed5544b7b2ba1c47b1b5294") +} + +func (BurnMintTokenPoolOwnershipTransferRequested) Topic() common.Hash { + return common.HexToHash("0xed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae1278") +} + +func (BurnMintTokenPoolOwnershipTransferred) Topic() common.Hash { + return common.HexToHash("0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0") +} + +func (BurnMintTokenPoolReleased) Topic() common.Hash { + return common.HexToHash("0x2d87480f50083e2b2759522a8fdda59802650a8055e609a7772cf70c07748f52") +} + +func (_BurnMintTokenPool *BurnMintTokenPool) Address() common.Address { + return _BurnMintTokenPool.address +} + +type BurnMintTokenPoolInterface interface { + CurrentOffRampRateLimiterState(opts *bind.CallOpts, offRamp common.Address) (RateLimiterTokenBucket, error) + + CurrentOnRampRateLimiterState(opts *bind.CallOpts, onRamp common.Address) (RateLimiterTokenBucket, error) + + GetAllowList(opts *bind.CallOpts) ([]common.Address, error) + + GetAllowListEnabled(opts *bind.CallOpts) (bool, error) + + GetArmProxy(opts *bind.CallOpts) (common.Address, error) + + GetOffRamps(opts *bind.CallOpts) ([]common.Address, error) + + GetOnRamps(opts *bind.CallOpts) ([]common.Address, error) + + GetToken(opts *bind.CallOpts) (common.Address, error) + + IsOffRamp(opts *bind.CallOpts, offRamp common.Address) (bool, error) + + IsOnRamp(opts *bind.CallOpts, onRamp common.Address) (bool, error) + + Owner(opts *bind.CallOpts) (common.Address, error) + + SupportsInterface(opts *bind.CallOpts, interfaceId [4]byte) (bool, error) + + TypeAndVersion(opts *bind.CallOpts) (string, error) + + AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) + + ApplyAllowListUpdates(opts *bind.TransactOpts, removes []common.Address, adds []common.Address) (*types.Transaction, error) + + ApplyRampUpdates(opts *bind.TransactOpts, onRamps []TokenPoolRampUpdate, offRamps []TokenPoolRampUpdate) (*types.Transaction, error) + + LockOrBurn(opts *bind.TransactOpts, originalSender common.Address, arg1 []byte, amount *big.Int, arg3 uint64, arg4 []byte) (*types.Transaction, error) + + ReleaseOrMint(opts *bind.TransactOpts, arg0 []byte, receiver common.Address, amount *big.Int, arg3 uint64, arg4 []byte) (*types.Transaction, error) + + SetOffRampRateLimiterConfig(opts *bind.TransactOpts, offRamp common.Address, config RateLimiterConfig) (*types.Transaction, error) + + SetOnRampRateLimiterConfig(opts *bind.TransactOpts, onRamp common.Address, config RateLimiterConfig) (*types.Transaction, error) + + TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) + + FilterAllowListAdd(opts *bind.FilterOpts) (*BurnMintTokenPoolAllowListAddIterator, error) + + WatchAllowListAdd(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolAllowListAdd) (event.Subscription, error) + + ParseAllowListAdd(log types.Log) (*BurnMintTokenPoolAllowListAdd, error) + + FilterAllowListRemove(opts *bind.FilterOpts) (*BurnMintTokenPoolAllowListRemoveIterator, error) + + WatchAllowListRemove(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolAllowListRemove) (event.Subscription, error) + + ParseAllowListRemove(log types.Log) (*BurnMintTokenPoolAllowListRemove, error) + + FilterBurned(opts *bind.FilterOpts, sender []common.Address) (*BurnMintTokenPoolBurnedIterator, error) + + WatchBurned(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolBurned, sender []common.Address) (event.Subscription, error) + + ParseBurned(log types.Log) (*BurnMintTokenPoolBurned, error) + + FilterLocked(opts *bind.FilterOpts, sender []common.Address) (*BurnMintTokenPoolLockedIterator, error) + + WatchLocked(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolLocked, sender []common.Address) (event.Subscription, error) + + ParseLocked(log types.Log) (*BurnMintTokenPoolLocked, error) + + FilterMinted(opts *bind.FilterOpts, sender []common.Address, recipient []common.Address) (*BurnMintTokenPoolMintedIterator, error) + + WatchMinted(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolMinted, sender []common.Address, recipient []common.Address) (event.Subscription, error) + + ParseMinted(log types.Log) (*BurnMintTokenPoolMinted, error) + + FilterOffRampAdded(opts *bind.FilterOpts) (*BurnMintTokenPoolOffRampAddedIterator, error) + + WatchOffRampAdded(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolOffRampAdded) (event.Subscription, error) + + ParseOffRampAdded(log types.Log) (*BurnMintTokenPoolOffRampAdded, error) + + FilterOffRampConfigured(opts *bind.FilterOpts) (*BurnMintTokenPoolOffRampConfiguredIterator, error) + + WatchOffRampConfigured(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolOffRampConfigured) (event.Subscription, error) + + ParseOffRampConfigured(log types.Log) (*BurnMintTokenPoolOffRampConfigured, error) + + FilterOffRampRemoved(opts *bind.FilterOpts) (*BurnMintTokenPoolOffRampRemovedIterator, error) + + WatchOffRampRemoved(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolOffRampRemoved) (event.Subscription, error) + + ParseOffRampRemoved(log types.Log) (*BurnMintTokenPoolOffRampRemoved, error) + + FilterOnRampAdded(opts *bind.FilterOpts) (*BurnMintTokenPoolOnRampAddedIterator, error) + + WatchOnRampAdded(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolOnRampAdded) (event.Subscription, error) + + ParseOnRampAdded(log types.Log) (*BurnMintTokenPoolOnRampAdded, error) + + FilterOnRampConfigured(opts *bind.FilterOpts) (*BurnMintTokenPoolOnRampConfiguredIterator, error) + + WatchOnRampConfigured(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolOnRampConfigured) (event.Subscription, error) + + ParseOnRampConfigured(log types.Log) (*BurnMintTokenPoolOnRampConfigured, error) + + FilterOnRampRemoved(opts *bind.FilterOpts) (*BurnMintTokenPoolOnRampRemovedIterator, error) + + WatchOnRampRemoved(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolOnRampRemoved) (event.Subscription, error) + + ParseOnRampRemoved(log types.Log) (*BurnMintTokenPoolOnRampRemoved, error) + + FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*BurnMintTokenPoolOwnershipTransferRequestedIterator, error) + + WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferRequested(log types.Log) (*BurnMintTokenPoolOwnershipTransferRequested, error) + + FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*BurnMintTokenPoolOwnershipTransferredIterator, error) + + WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferred(log types.Log) (*BurnMintTokenPoolOwnershipTransferred, error) + + FilterReleased(opts *bind.FilterOpts, sender []common.Address, recipient []common.Address) (*BurnMintTokenPoolReleasedIterator, error) + + WatchReleased(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolReleased, sender []common.Address, recipient []common.Address) (event.Subscription, error) + + ParseReleased(log types.Log) (*BurnMintTokenPoolReleased, error) + + ParseLog(log types.Log) (generated.AbigenLog, error) + + Address() common.Address +} diff --git a/core/gethwrappers/ccip/generated/burn_mint_token_pool_1_4_0/burn_mint_token_pool_1_4_0.go b/core/gethwrappers/ccip/generated/burn_mint_token_pool_1_4_0/burn_mint_token_pool_1_4_0.go new file mode 100644 index 00000000000..5beb58e096d --- /dev/null +++ b/core/gethwrappers/ccip/generated/burn_mint_token_pool_1_4_0/burn_mint_token_pool_1_4_0.go @@ -0,0 +1,2264 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package burn_mint_token_pool_1_4_0 + +import ( + "errors" + "fmt" + "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" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" +) + +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +type RateLimiterConfig struct { + IsEnabled bool + Capacity *big.Int + Rate *big.Int +} + +type RateLimiterTokenBucket struct { + Tokens *big.Int + LastUpdated uint32 + IsEnabled bool + Capacity *big.Int + Rate *big.Int +} + +type TokenPoolChainUpdate struct { + RemoteChainSelector uint64 + Allowed bool + OutboundRateLimiterConfig RateLimiterConfig + InboundRateLimiterConfig RateLimiterConfig +} + +var BurnMintTokenPoolMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"internalType\":\"contractIBurnMintERC20\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"allowlist\",\"type\":\"address[]\"},{\"internalType\":\"address\",\"name\":\"armProxy\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"router\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"capacity\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"requested\",\"type\":\"uint256\"}],\"name\":\"AggregateValueMaxCapacityExceeded\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"minWaitInSeconds\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"available\",\"type\":\"uint256\"}],\"name\":\"AggregateValueRateLimitReached\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"AllowListNotEnabled\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"BadARMSignal\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"BucketOverfilled\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"}],\"name\":\"CallerIsNotARampOnRouter\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"}],\"name\":\"ChainAlreadyExists\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"ChainNotAllowed\",\"type\":\"error\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"config\",\"type\":\"tuple\"}],\"name\":\"DisabledNonZeroRateLimit\",\"type\":\"error\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"rateLimiterConfig\",\"type\":\"tuple\"}],\"name\":\"InvalidRatelimitRate\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"NonExistentChain\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RateLimitMustBeDisabled\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"SenderNotAllowed\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"capacity\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"requested\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"}],\"name\":\"TokenMaxCapacityExceeded\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"minWaitInSeconds\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"available\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"}],\"name\":\"TokenRateLimitReached\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddressNotAllowed\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"AllowListAdd\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"AllowListRemove\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Burned\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"indexed\":false,\"internalType\":\"structRateLimiter.Config\",\"name\":\"outboundRateLimiterConfig\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"indexed\":false,\"internalType\":\"structRateLimiter.Config\",\"name\":\"inboundRateLimiterConfig\",\"type\":\"tuple\"}],\"name\":\"ChainAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"indexed\":false,\"internalType\":\"structRateLimiter.Config\",\"name\":\"outboundRateLimiterConfig\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"indexed\":false,\"internalType\":\"structRateLimiter.Config\",\"name\":\"inboundRateLimiterConfig\",\"type\":\"tuple\"}],\"name\":\"ChainConfigured\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"ChainRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Locked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Minted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Released\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"oldRouter\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newRouter\",\"type\":\"address\"}],\"name\":\"RouterUpdated\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"removes\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"adds\",\"type\":\"address[]\"}],\"name\":\"applyAllowListUpdates\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"bool\",\"name\":\"allowed\",\"type\":\"bool\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"outboundRateLimiterConfig\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"inboundRateLimiterConfig\",\"type\":\"tuple\"}],\"internalType\":\"structTokenPool.ChainUpdate[]\",\"name\":\"chains\",\"type\":\"tuple[]\"}],\"name\":\"applyChainUpdates\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAllowList\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAllowListEnabled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getArmProxy\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"armProxy\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"getCurrentInboundRateLimiterState\",\"outputs\":[{\"components\":[{\"internalType\":\"uint128\",\"name\":\"tokens\",\"type\":\"uint128\"},{\"internalType\":\"uint32\",\"name\":\"lastUpdated\",\"type\":\"uint32\"},{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.TokenBucket\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"getCurrentOutboundRateLimiterState\",\"outputs\":[{\"components\":[{\"internalType\":\"uint128\",\"name\":\"tokens\",\"type\":\"uint128\"},{\"internalType\":\"uint32\",\"name\":\"lastUpdated\",\"type\":\"uint32\"},{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.TokenBucket\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRouter\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"router\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getSupportedChains\",\"outputs\":[{\"internalType\":\"uint64[]\",\"name\":\"\",\"type\":\"uint64[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getToken\",\"outputs\":[{\"internalType\":\"contractIERC20\",\"name\":\"token\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"isSupportedChain\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"originalSender\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"lockOrBurn\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"releaseOrMint\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"outboundConfig\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"inboundConfig\",\"type\":\"tuple\"}],\"name\":\"setChainRateLimiterConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newRouter\",\"type\":\"address\"}],\"name\":\"setRouter\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", + Bin: "0x60e06040523480156200001157600080fd5b50604051620034503803806200345083398101604081905262000034916200054d565b8383838333806000816200008f5760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000c257620000c28162000163565b5050506001600160a01b0384161580620000e357506001600160a01b038116155b1562000102576040516342bcdf7f60e11b815260040160405180910390fd5b6001600160a01b0384811660805282811660a052600480546001600160a01b031916918316919091179055825115801560c05262000155576040805160008152602081019091526200015590846200020e565b5050505050505050620006d1565b336001600160a01b03821603620001bd5760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640162000086565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b60c0516200022f576040516335f4a7b360e01b815260040160405180910390fd5b60005b8251811015620002c45760008382815181106200025357620002536200065d565b602090810291909101015190506200026d6002826200037f565b15620002b0576040516001600160a01b03821681527f800671136ab6cfee9fbe5ed1fb7ca417811aca3cf864800d127b927adedf75669060200160405180910390a15b50620002bc8162000689565b905062000232565b5060005b81518110156200037a576000828281518110620002e957620002e96200065d565b6020026020010151905060006001600160a01b0316816001600160a01b03160362000315575062000367565b620003226002826200039f565b1562000365576040516001600160a01b03821681527f2640d4d76caf8bf478aabfa982fa4e1c4eb71a37f93cd15e80dbc657911546d89060200160405180910390a15b505b620003728162000689565b9050620002c8565b505050565b600062000396836001600160a01b038416620003b6565b90505b92915050565b600062000396836001600160a01b038416620004ba565b60008181526001830160205260408120548015620004af576000620003dd600183620006a5565b8554909150600090620003f390600190620006a5565b90508181146200045f5760008660000182815481106200041757620004176200065d565b90600052602060002001549050808760000184815481106200043d576200043d6200065d565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080620004735762000473620006bb565b60019003818190600052602060002001600090559055856001016000868152602001908152602001600020600090556001935050505062000399565b600091505062000399565b6000818152600183016020526040812054620005035750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915562000399565b50600062000399565b6001600160a01b03811681146200052257600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b805162000548816200050c565b919050565b600080600080608085870312156200056457600080fd5b845162000571816200050c565b602086810151919550906001600160401b03808211156200059157600080fd5b818801915088601f830112620005a657600080fd5b815181811115620005bb57620005bb62000525565b8060051b604051601f19603f83011681018181108582111715620005e357620005e362000525565b60405291825284820192508381018501918b8311156200060257600080fd5b938501935b828510156200062b576200061b856200053b565b8452938501939285019262000607565b80985050505050505062000642604086016200053b565b915062000652606086016200053b565b905092959194509250565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016200069e576200069e62000673565b5060010190565b8181038181111562000399576200039962000673565b634e487b7160e01b600052603160045260246000fd5b60805160a05160c051612d1762000739600039600081816103c80152818161100c01526115b501526000818161022b01528181610baf01526110900152600081816101e401528181610df0015281816118f50152818161198001526119d30152612d176000f3fe608060405234801561001057600080fd5b506004361061016c5760003560e01c806396875445116100cd578063c4bffe2b11610081578063cf7401f311610066578063cf7401f3146103b3578063e0351e13146103c6578063f2fde38b146103ec57600080fd5b8063c4bffe2b1461038b578063c75eea9c146103a057600080fd5b8063af58d59f116100b2578063af58d59f146102eb578063b0f479a11461035a578063c0d786551461037857600080fd5b806396875445146102c3578063a7cd63b7146102d657600080fd5b80635995f063116101245780638627fad6116101095780638627fad61461027f5780638926f54f146102925780638da5cb5b146102a557600080fd5b80635995f0631461026457806379ba50971461027757600080fd5b806321df0da71161015557806321df0da7146101e25780635246492f1461022957806354c8a4f31461024f57600080fd5b806301ffc9a714610171578063181f5a7714610199575b600080fd5b61018461017f366004612425565b6103ff565b60405190151581526020015b60405180910390f35b6101d56040518060400160405280601781526020017f4275726e4d696e74546f6b656e506f6f6c20312e342e3000000000000000000081525081565b60405161019091906124cb565b7f00000000000000000000000000000000000000000000000000000000000000005b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610190565b7f0000000000000000000000000000000000000000000000000000000000000000610204565b61026261025d36600461252a565b610498565b005b610262610272366004612596565b610513565b610262610ab0565b61026261028d366004612724565b610bad565b6101846102a03660046127b8565b610ea1565b60005473ffffffffffffffffffffffffffffffffffffffff16610204565b6101d56102d1366004612815565b610eb8565b6102de6111b9565b60405161019091906128b5565b6102fe6102f93660046127b8565b6111ca565b604051610190919081516fffffffffffffffffffffffffffffffff908116825260208084015163ffffffff1690830152604080840151151590830152606080840151821690830152608092830151169181019190915260a00190565b60045473ffffffffffffffffffffffffffffffffffffffff16610204565b61026261038636600461290f565b61129c565b610393611377565b604051610190919061292c565b6102fe6103ae3660046127b8565b611437565b6102626103c1366004612a0d565b611509565b7f0000000000000000000000000000000000000000000000000000000000000000610184565b6102626103fa36600461290f565b61151c565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f317fa33400000000000000000000000000000000000000000000000000000000148061049257507fffffffff0000000000000000000000000000000000000000000000000000000082167f01ffc9a700000000000000000000000000000000000000000000000000000000145b92915050565b6104a0611530565b61050d848480806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250506040805160208088028281018201909352878252909350879250869182918501908490808284376000920191909152506115b392505050565b50505050565b61051b611530565b60005b81811015610aab57600083838381811061053a5761053a612a52565b905061010002018036038101906105519190612a81565b90506105668160400151826020015115611779565b6105798160600151826020015115611779565b80602001511561099f57805161059b9060059067ffffffffffffffff166118b6565b6105e55780516040517f1d5ad3c500000000000000000000000000000000000000000000000000000000815267ffffffffffffffff90911660048201526024015b60405180910390fd5b6040518060a001604052808260400151602001516fffffffffffffffffffffffffffffffff1681526020014263ffffffff168152602001826040015160000151151581526020018260400151602001516fffffffffffffffffffffffffffffffff1681526020018260400151604001516fffffffffffffffffffffffffffffffff1681525060076000836000015167ffffffffffffffff1667ffffffffffffffff16815260200190815260200160002060008201518160000160006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555060208201518160000160106101000a81548163ffffffff021916908363ffffffff16021790555060408201518160000160146101000a81548160ff02191690831515021790555060608201518160010160006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555060808201518160010160106101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff1602179055509050506040518060a001604052808260600151602001516fffffffffffffffffffffffffffffffff1681526020014263ffffffff168152602001826060015160000151151581526020018260600151602001516fffffffffffffffffffffffffffffffff1681526020018260600151604001516fffffffffffffffffffffffffffffffff1681525060086000836000015167ffffffffffffffff1667ffffffffffffffff16815260200190815260200160002060008201518160000160006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555060208201518160000160106101000a81548163ffffffff021916908363ffffffff16021790555060408201518160000160146101000a81548160ff02191690831515021790555060608201518160010160006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555060808201518160010160106101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff1602179055509050507f0f135cbb9afa12a8bf3bbd071c117bcca4ddeca6160ef7f33d012a81b9c0c47181600001518260400151836060015160405161099293929190612b03565b60405180910390a1610a9a565b80516109b79060059067ffffffffffffffff166118c9565b6109fc5780516040517f1e670e4b00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff90911660048201526024016105dc565b805167ffffffffffffffff908116600090815260086020908152604080832080547fffffffffffffffffffffff0000000000000000000000000000000000000000009081168255600191820185905586518616855260078452828520805490911681550192909255835191519190921681527f5204aec90a3c794d8e90fded8b46ae9c7c552803e7e832e0c1d358396d859916910160405180910390a15b50610aa481612bb5565b905061051e565b505050565b60015473ffffffffffffffffffffffffffffffffffffffff163314610b31576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e65720000000000000000000060448201526064016105dc565b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663397796f76040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c18573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c3c9190612bed565b15610c73576040517fc148371500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b81610c7d81610ea1565b610cbf576040517fa9902c7e00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff821660048201526024016105dc565b600480546040517f83826b2b00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff84169281019290925233602483015273ffffffffffffffffffffffffffffffffffffffff16906383826b2b90604401602060405180830381865afa158015610d3e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d629190612bed565b610d9a576040517f728fe07b0000000000000000000000000000000000000000000000000000000081523360048201526024016105dc565b610da483856118d5565b6040517f40c10f1900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8681166004830152602482018690527f000000000000000000000000000000000000000000000000000000000000000016906340c10f1990604401600060405180830381600087803b158015610e3457600080fd5b505af1158015610e48573d6000803e3d6000fd5b505060405186815273ffffffffffffffffffffffffffffffffffffffff881692503391507f9d228d69b5fdb8d273a2336f8fb8612d039631024ea9bf09c424a9503aa078f09060200160405180910390a3505050505050565b6000610492600567ffffffffffffffff8416611919565b606083610ec481610ea1565b610f06576040517fa9902c7e00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff821660048201526024016105dc565b600480546040517fa8d87a3b00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff84169281019290925273ffffffffffffffffffffffffffffffffffffffff169063a8d87a3b90602401602060405180830381865afa158015610f7f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fa39190612c0a565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611009576040517f728fe07b0000000000000000000000000000000000000000000000000000000081523360048201526024016105dc565b887f0000000000000000000000000000000000000000000000000000000000000000801561103f575061103d600282611931565b155b1561108e576040517fd0d2597600000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff821660048201526024016105dc565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663397796f76040518163ffffffff1660e01b8152600401602060405180830381865afa1580156110f9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061111d9190612bed565b15611154576040517fc148371500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61115e8688611960565b611167876119a4565b60405187815233907f696de425f79f4a40bc6d2122ca50507f0efbeabbff86a84871b7196ab8ea8df79060200160405180910390a2505060408051602081019091526000815298975050505050505050565b60606111c56002611a47565b905090565b6040805160a08101825260008082526020820181905291810182905260608101829052608081019190915267ffffffffffffffff8216600090815260086020908152604091829020825160a08101845281546fffffffffffffffffffffffffffffffff808216835270010000000000000000000000000000000080830463ffffffff16958401959095527401000000000000000000000000000000000000000090910460ff16151594820194909452600190910154808416606083015291909104909116608082015261049290611a54565b6112a4611530565b73ffffffffffffffffffffffffffffffffffffffff81166112f1576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6004805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff000000000000000000000000000000000000000083168117909355604080519190921680825260208201939093527f02dc5c233404867c793b749c6d644beb2277536d18a7e7974d3f238e4c6f1684910160405180910390a15050565b606060006113856005611a47565b90506000815167ffffffffffffffff8111156113a3576113a361260b565b6040519080825280602002602001820160405280156113cc578160200160208202803683370190505b50905060005b8251811015611430578281815181106113ed576113ed612a52565b602002602001015182828151811061140757611407612a52565b67ffffffffffffffff9092166020928302919091019091015261142981612bb5565b90506113d2565b5092915050565b6040805160a08101825260008082526020820181905291810182905260608101829052608081019190915267ffffffffffffffff8216600090815260076020908152604091829020825160a08101845281546fffffffffffffffffffffffffffffffff808216835270010000000000000000000000000000000080830463ffffffff16958401959095527401000000000000000000000000000000000000000090910460ff16151594820194909452600190910154808416606083015291909104909116608082015261049290611a54565b611511611530565b610aab838383611b06565b611524611530565b61152d81611bed565b50565b60005473ffffffffffffffffffffffffffffffffffffffff1633146115b1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e65720000000000000000000060448201526064016105dc565b565b7f000000000000000000000000000000000000000000000000000000000000000061160a576040517f35f4a7b300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b82518110156116a857600083828151811061162a5761162a612a52565b60200260200101519050611648816002611ce290919063ffffffff16565b156116975760405173ffffffffffffffffffffffffffffffffffffffff821681527f800671136ab6cfee9fbe5ed1fb7ca417811aca3cf864800d127b927adedf75669060200160405180910390a15b506116a181612bb5565b905061160d565b5060005b8151811015610aab5760008282815181106116c9576116c9612a52565b60200260200101519050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff160361170d5750611769565b611718600282611d04565b156117675760405173ffffffffffffffffffffffffffffffffffffffff821681527f2640d4d76caf8bf478aabfa982fa4e1c4eb71a37f93cd15e80dbc657911546d89060200160405180910390a15b505b61177281612bb5565b90506116ac565b8151156118445781602001516fffffffffffffffffffffffffffffffff1682604001516fffffffffffffffffffffffffffffffff161015806117cf575060408201516fffffffffffffffffffffffffffffffff16155b1561180857816040517f70505e560000000000000000000000000000000000000000000000000000000081526004016105dc9190612c27565b8015611840576040517f433fc33d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5050565b60408201516fffffffffffffffffffffffffffffffff1615158061187d575060208201516fffffffffffffffffffffffffffffffff1615155b1561184057816040517fd68af9cc0000000000000000000000000000000000000000000000000000000081526004016105dc9190612c27565b60006118c28383611d22565b9392505050565b60006118c28383611d71565b67ffffffffffffffff8216600090815260086020526040902061184090827f0000000000000000000000000000000000000000000000000000000000000000611e64565b600081815260018301602052604081205415156118c2565b73ffffffffffffffffffffffffffffffffffffffff8116600090815260018301602052604081205415156118c2565b67ffffffffffffffff8216600090815260076020526040902061184090827f0000000000000000000000000000000000000000000000000000000000000000611e64565b6040517f42966c68000000000000000000000000000000000000000000000000000000008152600481018290527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16906342966c6890602401600060405180830381600087803b158015611a2c57600080fd5b505af1158015611a40573d6000803e3d6000fd5b5050505050565b606060006118c2836121e7565b6040805160a081018252600080825260208201819052918101829052606081018290526080810191909152611ae282606001516fffffffffffffffffffffffffffffffff1683600001516fffffffffffffffffffffffffffffffff16846020015163ffffffff1642611ac69190612c63565b85608001516fffffffffffffffffffffffffffffffff16612243565b6fffffffffffffffffffffffffffffffff1682525063ffffffff4216602082015290565b611b0f83610ea1565b611b51576040517f1e670e4b00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff841660048201526024016105dc565b611b5c826000611779565b67ffffffffffffffff83166000908152600760205260409020611b7f908361226d565b611b8a816000611779565b67ffffffffffffffff83166000908152600860205260409020611bad908261226d565b7f0350d63aa5f270e01729d00d627eeb8f3429772b1818c016c66a588a864f912b838383604051611be093929190612b03565b60405180910390a1505050565b3373ffffffffffffffffffffffffffffffffffffffff821603611c6c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c6600000000000000000060448201526064016105dc565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b60006118c28373ffffffffffffffffffffffffffffffffffffffff8416611d71565b60006118c28373ffffffffffffffffffffffffffffffffffffffff84165b6000818152600183016020526040812054611d6957508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610492565b506000610492565b60008181526001830160205260408120548015611e5a576000611d95600183612c63565b8554909150600090611da990600190612c63565b9050818114611e0e576000866000018281548110611dc957611dc9612a52565b9060005260206000200154905080876000018481548110611dec57611dec612a52565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080611e1f57611e1f612c76565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610492565b6000915050610492565b825474010000000000000000000000000000000000000000900460ff161580611e8b575081155b15611e9557505050565b825460018401546fffffffffffffffffffffffffffffffff80831692911690600090611edb90700100000000000000000000000000000000900463ffffffff1642612c63565b90508015611f9b5781831115611f1d576040517f9725942a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001860154611f579083908590849070010000000000000000000000000000000090046fffffffffffffffffffffffffffffffff16612243565b86547fffffffffffffffffffffffff00000000ffffffffffffffffffffffffffffffff167001000000000000000000000000000000004263ffffffff160217875592505b848210156120525773ffffffffffffffffffffffffffffffffffffffff8416611ffa576040517ff94ebcd100000000000000000000000000000000000000000000000000000000815260048101839052602481018690526044016105dc565b6040517f1a76572a000000000000000000000000000000000000000000000000000000008152600481018390526024810186905273ffffffffffffffffffffffffffffffffffffffff851660448201526064016105dc565b848310156121655760018681015470010000000000000000000000000000000090046fffffffffffffffffffffffffffffffff169060009082906120969082612c63565b6120a0878a612c63565b6120aa9190612ca5565b6120b49190612cb8565b905073ffffffffffffffffffffffffffffffffffffffff861661210d576040517f15279c0800000000000000000000000000000000000000000000000000000000815260048101829052602481018690526044016105dc565b6040517fd0c8d23a000000000000000000000000000000000000000000000000000000008152600481018290526024810186905273ffffffffffffffffffffffffffffffffffffffff871660448201526064016105dc565b61216f8584612c63565b86547fffffffffffffffffffffffffffffffff00000000000000000000000000000000166fffffffffffffffffffffffffffffffff82161787556040518681529093507f1871cdf8010e63f2eb8384381a68dfa7416dc571a5517e66e88b2d2d0c0a690a9060200160405180910390a1505050505050565b60608160000180548060200260200160405190810160405280929190818152602001828054801561223757602002820191906000526020600020905b815481526020019060010190808311612223575b50505050509050919050565b6000612262856122538486612cf3565b61225d9087612ca5565b61240f565b90505b949350505050565b815460009061229690700100000000000000000000000000000000900463ffffffff1642612c63565b9050801561233857600183015483546122de916fffffffffffffffffffffffffffffffff80821692811691859170010000000000000000000000000000000090910416612243565b83546fffffffffffffffffffffffffffffffff919091167fffffffffffffffffffffffff0000000000000000000000000000000000000000909116177001000000000000000000000000000000004263ffffffff16021783555b6020820151835461235e916fffffffffffffffffffffffffffffffff908116911661240f565b83548351151574010000000000000000000000000000000000000000027fffffffffffffffffffffff00ffffffff000000000000000000000000000000009091166fffffffffffffffffffffffffffffffff92831617178455602083015160408085015183167001000000000000000000000000000000000291909216176001850155517f9ea3374b67bf275e6bb9c8ae68f9cae023e1c528b4b27e092f0bb209d3531c1990611be0908490612c27565b600081831061241e57816118c2565b5090919050565b60006020828403121561243757600080fd5b81357fffffffff00000000000000000000000000000000000000000000000000000000811681146118c257600080fd5b6000815180845260005b8181101561248d57602081850181015186830182015201612471565b5060006020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b6020815260006118c26020830184612467565b60008083601f8401126124f057600080fd5b50813567ffffffffffffffff81111561250857600080fd5b6020830191508360208260051b850101111561252357600080fd5b9250929050565b6000806000806040858703121561254057600080fd5b843567ffffffffffffffff8082111561255857600080fd5b612564888389016124de565b9096509450602087013591508082111561257d57600080fd5b5061258a878288016124de565b95989497509550505050565b600080602083850312156125a957600080fd5b823567ffffffffffffffff808211156125c157600080fd5b818501915085601f8301126125d557600080fd5b8135818111156125e457600080fd5b8660208260081b85010111156125f957600080fd5b60209290920196919550909350505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600082601f83011261264b57600080fd5b813567ffffffffffffffff808211156126665761266661260b565b604051601f83017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f011681019082821181831017156126ac576126ac61260b565b816040528381528660208588010111156126c557600080fd5b836020870160208301376000602085830101528094505050505092915050565b73ffffffffffffffffffffffffffffffffffffffff8116811461152d57600080fd5b803567ffffffffffffffff8116811461271f57600080fd5b919050565b600080600080600060a0868803121561273c57600080fd5b853567ffffffffffffffff8082111561275457600080fd5b61276089838a0161263a565b965060208801359150612772826126e5565b8195506040880135945061278860608901612707565b9350608088013591508082111561279e57600080fd5b506127ab8882890161263a565b9150509295509295909350565b6000602082840312156127ca57600080fd5b6118c282612707565b60008083601f8401126127e557600080fd5b50813567ffffffffffffffff8111156127fd57600080fd5b60208301915083602082850101111561252357600080fd5b600080600080600080600060a0888a03121561283057600080fd5b873561283b816126e5565b9650602088013567ffffffffffffffff8082111561285857600080fd5b6128648b838c016127d3565b909850965060408a0135955086915061287f60608b01612707565b945060808a013591508082111561289557600080fd5b506128a28a828b016127d3565b989b979a50959850939692959293505050565b6020808252825182820181905260009190848201906040850190845b8181101561290357835173ffffffffffffffffffffffffffffffffffffffff16835292840192918401916001016128d1565b50909695505050505050565b60006020828403121561292157600080fd5b81356118c2816126e5565b6020808252825182820181905260009190848201906040850190845b8181101561290357835167ffffffffffffffff1683529284019291840191600101612948565b801515811461152d57600080fd5b80356fffffffffffffffffffffffffffffffff8116811461271f57600080fd5b6000606082840312156129ae57600080fd5b6040516060810181811067ffffffffffffffff821117156129d1576129d161260b565b60405290508082356129e28161296e565b81526129f06020840161297c565b6020820152612a016040840161297c565b60408201525092915050565b600080600060e08486031215612a2257600080fd5b612a2b84612707565b9250612a3a856020860161299c565b9150612a49856080860161299c565b90509250925092565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60006101008284031215612a9457600080fd5b6040516080810181811067ffffffffffffffff82111715612ab757612ab761260b565b604052612ac383612707565b81526020830135612ad38161296e565b6020820152612ae5846040850161299c565b6040820152612af78460a0850161299c565b60608201529392505050565b67ffffffffffffffff8416815260e08101612b4f60208301858051151582526020808201516fffffffffffffffffffffffffffffffff9081169184019190915260409182015116910152565b82511515608083015260208301516fffffffffffffffffffffffffffffffff90811660a084015260408401511660c0830152612265565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203612be657612be6612b86565b5060010190565b600060208284031215612bff57600080fd5b81516118c28161296e565b600060208284031215612c1c57600080fd5b81516118c2816126e5565b6060810161049282848051151582526020808201516fffffffffffffffffffffffffffffffff9081169184019190915260409182015116910152565b8181038181111561049257610492612b86565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b8082018082111561049257610492612b86565b600082612cee577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b808202811582820484141761049257610492612b8656fea164736f6c6343000813000a", +} + +var BurnMintTokenPoolABI = BurnMintTokenPoolMetaData.ABI + +var BurnMintTokenPoolBin = BurnMintTokenPoolMetaData.Bin + +func DeployBurnMintTokenPool(auth *bind.TransactOpts, backend bind.ContractBackend, token common.Address, allowlist []common.Address, armProxy common.Address, router common.Address) (common.Address, *types.Transaction, *BurnMintTokenPool, error) { + parsed, err := BurnMintTokenPoolMetaData.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(BurnMintTokenPoolBin), backend, token, allowlist, armProxy, router) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &BurnMintTokenPool{address: address, abi: *parsed, BurnMintTokenPoolCaller: BurnMintTokenPoolCaller{contract: contract}, BurnMintTokenPoolTransactor: BurnMintTokenPoolTransactor{contract: contract}, BurnMintTokenPoolFilterer: BurnMintTokenPoolFilterer{contract: contract}}, nil +} + +type BurnMintTokenPool struct { + address common.Address + abi abi.ABI + BurnMintTokenPoolCaller + BurnMintTokenPoolTransactor + BurnMintTokenPoolFilterer +} + +type BurnMintTokenPoolCaller struct { + contract *bind.BoundContract +} + +type BurnMintTokenPoolTransactor struct { + contract *bind.BoundContract +} + +type BurnMintTokenPoolFilterer struct { + contract *bind.BoundContract +} + +type BurnMintTokenPoolSession struct { + Contract *BurnMintTokenPool + CallOpts bind.CallOpts + TransactOpts bind.TransactOpts +} + +type BurnMintTokenPoolCallerSession struct { + Contract *BurnMintTokenPoolCaller + CallOpts bind.CallOpts +} + +type BurnMintTokenPoolTransactorSession struct { + Contract *BurnMintTokenPoolTransactor + TransactOpts bind.TransactOpts +} + +type BurnMintTokenPoolRaw struct { + Contract *BurnMintTokenPool +} + +type BurnMintTokenPoolCallerRaw struct { + Contract *BurnMintTokenPoolCaller +} + +type BurnMintTokenPoolTransactorRaw struct { + Contract *BurnMintTokenPoolTransactor +} + +func NewBurnMintTokenPool(address common.Address, backend bind.ContractBackend) (*BurnMintTokenPool, error) { + abi, err := abi.JSON(strings.NewReader(BurnMintTokenPoolABI)) + if err != nil { + return nil, err + } + contract, err := bindBurnMintTokenPool(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &BurnMintTokenPool{address: address, abi: abi, BurnMintTokenPoolCaller: BurnMintTokenPoolCaller{contract: contract}, BurnMintTokenPoolTransactor: BurnMintTokenPoolTransactor{contract: contract}, BurnMintTokenPoolFilterer: BurnMintTokenPoolFilterer{contract: contract}}, nil +} + +func NewBurnMintTokenPoolCaller(address common.Address, caller bind.ContractCaller) (*BurnMintTokenPoolCaller, error) { + contract, err := bindBurnMintTokenPool(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &BurnMintTokenPoolCaller{contract: contract}, nil +} + +func NewBurnMintTokenPoolTransactor(address common.Address, transactor bind.ContractTransactor) (*BurnMintTokenPoolTransactor, error) { + contract, err := bindBurnMintTokenPool(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &BurnMintTokenPoolTransactor{contract: contract}, nil +} + +func NewBurnMintTokenPoolFilterer(address common.Address, filterer bind.ContractFilterer) (*BurnMintTokenPoolFilterer, error) { + contract, err := bindBurnMintTokenPool(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &BurnMintTokenPoolFilterer{contract: contract}, nil +} + +func bindBurnMintTokenPool(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := BurnMintTokenPoolMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +func (_BurnMintTokenPool *BurnMintTokenPoolRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _BurnMintTokenPool.Contract.BurnMintTokenPoolCaller.contract.Call(opts, result, method, params...) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _BurnMintTokenPool.Contract.BurnMintTokenPoolTransactor.contract.Transfer(opts) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _BurnMintTokenPool.Contract.BurnMintTokenPoolTransactor.contract.Transact(opts, method, params...) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _BurnMintTokenPool.Contract.contract.Call(opts, result, method, params...) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _BurnMintTokenPool.Contract.contract.Transfer(opts) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _BurnMintTokenPool.Contract.contract.Transact(opts, method, params...) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolCaller) GetAllowList(opts *bind.CallOpts) ([]common.Address, error) { + var out []interface{} + err := _BurnMintTokenPool.contract.Call(opts, &out, "getAllowList") + + if err != nil { + return *new([]common.Address), err + } + + out0 := *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) + + return out0, err + +} + +func (_BurnMintTokenPool *BurnMintTokenPoolSession) GetAllowList() ([]common.Address, error) { + return _BurnMintTokenPool.Contract.GetAllowList(&_BurnMintTokenPool.CallOpts) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolCallerSession) GetAllowList() ([]common.Address, error) { + return _BurnMintTokenPool.Contract.GetAllowList(&_BurnMintTokenPool.CallOpts) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolCaller) GetAllowListEnabled(opts *bind.CallOpts) (bool, error) { + var out []interface{} + err := _BurnMintTokenPool.contract.Call(opts, &out, "getAllowListEnabled") + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_BurnMintTokenPool *BurnMintTokenPoolSession) GetAllowListEnabled() (bool, error) { + return _BurnMintTokenPool.Contract.GetAllowListEnabled(&_BurnMintTokenPool.CallOpts) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolCallerSession) GetAllowListEnabled() (bool, error) { + return _BurnMintTokenPool.Contract.GetAllowListEnabled(&_BurnMintTokenPool.CallOpts) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolCaller) GetArmProxy(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _BurnMintTokenPool.contract.Call(opts, &out, "getArmProxy") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_BurnMintTokenPool *BurnMintTokenPoolSession) GetArmProxy() (common.Address, error) { + return _BurnMintTokenPool.Contract.GetArmProxy(&_BurnMintTokenPool.CallOpts) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolCallerSession) GetArmProxy() (common.Address, error) { + return _BurnMintTokenPool.Contract.GetArmProxy(&_BurnMintTokenPool.CallOpts) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolCaller) GetCurrentInboundRateLimiterState(opts *bind.CallOpts, remoteChainSelector uint64) (RateLimiterTokenBucket, error) { + var out []interface{} + err := _BurnMintTokenPool.contract.Call(opts, &out, "getCurrentInboundRateLimiterState", remoteChainSelector) + + if err != nil { + return *new(RateLimiterTokenBucket), err + } + + out0 := *abi.ConvertType(out[0], new(RateLimiterTokenBucket)).(*RateLimiterTokenBucket) + + return out0, err + +} + +func (_BurnMintTokenPool *BurnMintTokenPoolSession) GetCurrentInboundRateLimiterState(remoteChainSelector uint64) (RateLimiterTokenBucket, error) { + return _BurnMintTokenPool.Contract.GetCurrentInboundRateLimiterState(&_BurnMintTokenPool.CallOpts, remoteChainSelector) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolCallerSession) GetCurrentInboundRateLimiterState(remoteChainSelector uint64) (RateLimiterTokenBucket, error) { + return _BurnMintTokenPool.Contract.GetCurrentInboundRateLimiterState(&_BurnMintTokenPool.CallOpts, remoteChainSelector) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolCaller) GetCurrentOutboundRateLimiterState(opts *bind.CallOpts, remoteChainSelector uint64) (RateLimiterTokenBucket, error) { + var out []interface{} + err := _BurnMintTokenPool.contract.Call(opts, &out, "getCurrentOutboundRateLimiterState", remoteChainSelector) + + if err != nil { + return *new(RateLimiterTokenBucket), err + } + + out0 := *abi.ConvertType(out[0], new(RateLimiterTokenBucket)).(*RateLimiterTokenBucket) + + return out0, err + +} + +func (_BurnMintTokenPool *BurnMintTokenPoolSession) GetCurrentOutboundRateLimiterState(remoteChainSelector uint64) (RateLimiterTokenBucket, error) { + return _BurnMintTokenPool.Contract.GetCurrentOutboundRateLimiterState(&_BurnMintTokenPool.CallOpts, remoteChainSelector) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolCallerSession) GetCurrentOutboundRateLimiterState(remoteChainSelector uint64) (RateLimiterTokenBucket, error) { + return _BurnMintTokenPool.Contract.GetCurrentOutboundRateLimiterState(&_BurnMintTokenPool.CallOpts, remoteChainSelector) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolCaller) GetRouter(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _BurnMintTokenPool.contract.Call(opts, &out, "getRouter") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_BurnMintTokenPool *BurnMintTokenPoolSession) GetRouter() (common.Address, error) { + return _BurnMintTokenPool.Contract.GetRouter(&_BurnMintTokenPool.CallOpts) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolCallerSession) GetRouter() (common.Address, error) { + return _BurnMintTokenPool.Contract.GetRouter(&_BurnMintTokenPool.CallOpts) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolCaller) GetSupportedChains(opts *bind.CallOpts) ([]uint64, error) { + var out []interface{} + err := _BurnMintTokenPool.contract.Call(opts, &out, "getSupportedChains") + + if err != nil { + return *new([]uint64), err + } + + out0 := *abi.ConvertType(out[0], new([]uint64)).(*[]uint64) + + return out0, err + +} + +func (_BurnMintTokenPool *BurnMintTokenPoolSession) GetSupportedChains() ([]uint64, error) { + return _BurnMintTokenPool.Contract.GetSupportedChains(&_BurnMintTokenPool.CallOpts) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolCallerSession) GetSupportedChains() ([]uint64, error) { + return _BurnMintTokenPool.Contract.GetSupportedChains(&_BurnMintTokenPool.CallOpts) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolCaller) GetToken(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _BurnMintTokenPool.contract.Call(opts, &out, "getToken") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_BurnMintTokenPool *BurnMintTokenPoolSession) GetToken() (common.Address, error) { + return _BurnMintTokenPool.Contract.GetToken(&_BurnMintTokenPool.CallOpts) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolCallerSession) GetToken() (common.Address, error) { + return _BurnMintTokenPool.Contract.GetToken(&_BurnMintTokenPool.CallOpts) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolCaller) IsSupportedChain(opts *bind.CallOpts, remoteChainSelector uint64) (bool, error) { + var out []interface{} + err := _BurnMintTokenPool.contract.Call(opts, &out, "isSupportedChain", remoteChainSelector) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_BurnMintTokenPool *BurnMintTokenPoolSession) IsSupportedChain(remoteChainSelector uint64) (bool, error) { + return _BurnMintTokenPool.Contract.IsSupportedChain(&_BurnMintTokenPool.CallOpts, remoteChainSelector) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolCallerSession) IsSupportedChain(remoteChainSelector uint64) (bool, error) { + return _BurnMintTokenPool.Contract.IsSupportedChain(&_BurnMintTokenPool.CallOpts, remoteChainSelector) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolCaller) Owner(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _BurnMintTokenPool.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 + +} + +func (_BurnMintTokenPool *BurnMintTokenPoolSession) Owner() (common.Address, error) { + return _BurnMintTokenPool.Contract.Owner(&_BurnMintTokenPool.CallOpts) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolCallerSession) Owner() (common.Address, error) { + return _BurnMintTokenPool.Contract.Owner(&_BurnMintTokenPool.CallOpts) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolCaller) SupportsInterface(opts *bind.CallOpts, interfaceId [4]byte) (bool, error) { + var out []interface{} + err := _BurnMintTokenPool.contract.Call(opts, &out, "supportsInterface", interfaceId) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_BurnMintTokenPool *BurnMintTokenPoolSession) SupportsInterface(interfaceId [4]byte) (bool, error) { + return _BurnMintTokenPool.Contract.SupportsInterface(&_BurnMintTokenPool.CallOpts, interfaceId) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolCallerSession) SupportsInterface(interfaceId [4]byte) (bool, error) { + return _BurnMintTokenPool.Contract.SupportsInterface(&_BurnMintTokenPool.CallOpts, interfaceId) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolCaller) TypeAndVersion(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _BurnMintTokenPool.contract.Call(opts, &out, "typeAndVersion") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +func (_BurnMintTokenPool *BurnMintTokenPoolSession) TypeAndVersion() (string, error) { + return _BurnMintTokenPool.Contract.TypeAndVersion(&_BurnMintTokenPool.CallOpts) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolCallerSession) TypeAndVersion() (string, error) { + return _BurnMintTokenPool.Contract.TypeAndVersion(&_BurnMintTokenPool.CallOpts) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolTransactor) AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + return _BurnMintTokenPool.contract.Transact(opts, "acceptOwnership") +} + +func (_BurnMintTokenPool *BurnMintTokenPoolSession) AcceptOwnership() (*types.Transaction, error) { + return _BurnMintTokenPool.Contract.AcceptOwnership(&_BurnMintTokenPool.TransactOpts) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolTransactorSession) AcceptOwnership() (*types.Transaction, error) { + return _BurnMintTokenPool.Contract.AcceptOwnership(&_BurnMintTokenPool.TransactOpts) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolTransactor) ApplyAllowListUpdates(opts *bind.TransactOpts, removes []common.Address, adds []common.Address) (*types.Transaction, error) { + return _BurnMintTokenPool.contract.Transact(opts, "applyAllowListUpdates", removes, adds) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolSession) ApplyAllowListUpdates(removes []common.Address, adds []common.Address) (*types.Transaction, error) { + return _BurnMintTokenPool.Contract.ApplyAllowListUpdates(&_BurnMintTokenPool.TransactOpts, removes, adds) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolTransactorSession) ApplyAllowListUpdates(removes []common.Address, adds []common.Address) (*types.Transaction, error) { + return _BurnMintTokenPool.Contract.ApplyAllowListUpdates(&_BurnMintTokenPool.TransactOpts, removes, adds) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolTransactor) ApplyChainUpdates(opts *bind.TransactOpts, chains []TokenPoolChainUpdate) (*types.Transaction, error) { + return _BurnMintTokenPool.contract.Transact(opts, "applyChainUpdates", chains) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolSession) ApplyChainUpdates(chains []TokenPoolChainUpdate) (*types.Transaction, error) { + return _BurnMintTokenPool.Contract.ApplyChainUpdates(&_BurnMintTokenPool.TransactOpts, chains) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolTransactorSession) ApplyChainUpdates(chains []TokenPoolChainUpdate) (*types.Transaction, error) { + return _BurnMintTokenPool.Contract.ApplyChainUpdates(&_BurnMintTokenPool.TransactOpts, chains) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolTransactor) LockOrBurn(opts *bind.TransactOpts, originalSender common.Address, arg1 []byte, amount *big.Int, remoteChainSelector uint64, arg4 []byte) (*types.Transaction, error) { + return _BurnMintTokenPool.contract.Transact(opts, "lockOrBurn", originalSender, arg1, amount, remoteChainSelector, arg4) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolSession) LockOrBurn(originalSender common.Address, arg1 []byte, amount *big.Int, remoteChainSelector uint64, arg4 []byte) (*types.Transaction, error) { + return _BurnMintTokenPool.Contract.LockOrBurn(&_BurnMintTokenPool.TransactOpts, originalSender, arg1, amount, remoteChainSelector, arg4) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolTransactorSession) LockOrBurn(originalSender common.Address, arg1 []byte, amount *big.Int, remoteChainSelector uint64, arg4 []byte) (*types.Transaction, error) { + return _BurnMintTokenPool.Contract.LockOrBurn(&_BurnMintTokenPool.TransactOpts, originalSender, arg1, amount, remoteChainSelector, arg4) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolTransactor) ReleaseOrMint(opts *bind.TransactOpts, arg0 []byte, receiver common.Address, amount *big.Int, remoteChainSelector uint64, arg4 []byte) (*types.Transaction, error) { + return _BurnMintTokenPool.contract.Transact(opts, "releaseOrMint", arg0, receiver, amount, remoteChainSelector, arg4) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolSession) ReleaseOrMint(arg0 []byte, receiver common.Address, amount *big.Int, remoteChainSelector uint64, arg4 []byte) (*types.Transaction, error) { + return _BurnMintTokenPool.Contract.ReleaseOrMint(&_BurnMintTokenPool.TransactOpts, arg0, receiver, amount, remoteChainSelector, arg4) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolTransactorSession) ReleaseOrMint(arg0 []byte, receiver common.Address, amount *big.Int, remoteChainSelector uint64, arg4 []byte) (*types.Transaction, error) { + return _BurnMintTokenPool.Contract.ReleaseOrMint(&_BurnMintTokenPool.TransactOpts, arg0, receiver, amount, remoteChainSelector, arg4) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolTransactor) SetChainRateLimiterConfig(opts *bind.TransactOpts, remoteChainSelector uint64, outboundConfig RateLimiterConfig, inboundConfig RateLimiterConfig) (*types.Transaction, error) { + return _BurnMintTokenPool.contract.Transact(opts, "setChainRateLimiterConfig", remoteChainSelector, outboundConfig, inboundConfig) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolSession) SetChainRateLimiterConfig(remoteChainSelector uint64, outboundConfig RateLimiterConfig, inboundConfig RateLimiterConfig) (*types.Transaction, error) { + return _BurnMintTokenPool.Contract.SetChainRateLimiterConfig(&_BurnMintTokenPool.TransactOpts, remoteChainSelector, outboundConfig, inboundConfig) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolTransactorSession) SetChainRateLimiterConfig(remoteChainSelector uint64, outboundConfig RateLimiterConfig, inboundConfig RateLimiterConfig) (*types.Transaction, error) { + return _BurnMintTokenPool.Contract.SetChainRateLimiterConfig(&_BurnMintTokenPool.TransactOpts, remoteChainSelector, outboundConfig, inboundConfig) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolTransactor) SetRouter(opts *bind.TransactOpts, newRouter common.Address) (*types.Transaction, error) { + return _BurnMintTokenPool.contract.Transact(opts, "setRouter", newRouter) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolSession) SetRouter(newRouter common.Address) (*types.Transaction, error) { + return _BurnMintTokenPool.Contract.SetRouter(&_BurnMintTokenPool.TransactOpts, newRouter) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolTransactorSession) SetRouter(newRouter common.Address) (*types.Transaction, error) { + return _BurnMintTokenPool.Contract.SetRouter(&_BurnMintTokenPool.TransactOpts, newRouter) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolTransactor) TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) { + return _BurnMintTokenPool.contract.Transact(opts, "transferOwnership", to) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolSession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _BurnMintTokenPool.Contract.TransferOwnership(&_BurnMintTokenPool.TransactOpts, to) +} + +func (_BurnMintTokenPool *BurnMintTokenPoolTransactorSession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _BurnMintTokenPool.Contract.TransferOwnership(&_BurnMintTokenPool.TransactOpts, to) +} + +type BurnMintTokenPoolAllowListAddIterator struct { + Event *BurnMintTokenPoolAllowListAdd + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *BurnMintTokenPoolAllowListAddIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolAllowListAdd) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolAllowListAdd) + 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() + } +} + +func (it *BurnMintTokenPoolAllowListAddIterator) Error() error { + return it.fail +} + +func (it *BurnMintTokenPoolAllowListAddIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type BurnMintTokenPoolAllowListAdd struct { + Sender common.Address + Raw types.Log +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) FilterAllowListAdd(opts *bind.FilterOpts) (*BurnMintTokenPoolAllowListAddIterator, error) { + + logs, sub, err := _BurnMintTokenPool.contract.FilterLogs(opts, "AllowListAdd") + if err != nil { + return nil, err + } + return &BurnMintTokenPoolAllowListAddIterator{contract: _BurnMintTokenPool.contract, event: "AllowListAdd", logs: logs, sub: sub}, nil +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) WatchAllowListAdd(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolAllowListAdd) (event.Subscription, error) { + + logs, sub, err := _BurnMintTokenPool.contract.WatchLogs(opts, "AllowListAdd") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(BurnMintTokenPoolAllowListAdd) + if err := _BurnMintTokenPool.contract.UnpackLog(event, "AllowListAdd", 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 +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) ParseAllowListAdd(log types.Log) (*BurnMintTokenPoolAllowListAdd, error) { + event := new(BurnMintTokenPoolAllowListAdd) + if err := _BurnMintTokenPool.contract.UnpackLog(event, "AllowListAdd", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type BurnMintTokenPoolAllowListRemoveIterator struct { + Event *BurnMintTokenPoolAllowListRemove + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *BurnMintTokenPoolAllowListRemoveIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolAllowListRemove) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolAllowListRemove) + 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() + } +} + +func (it *BurnMintTokenPoolAllowListRemoveIterator) Error() error { + return it.fail +} + +func (it *BurnMintTokenPoolAllowListRemoveIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type BurnMintTokenPoolAllowListRemove struct { + Sender common.Address + Raw types.Log +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) FilterAllowListRemove(opts *bind.FilterOpts) (*BurnMintTokenPoolAllowListRemoveIterator, error) { + + logs, sub, err := _BurnMintTokenPool.contract.FilterLogs(opts, "AllowListRemove") + if err != nil { + return nil, err + } + return &BurnMintTokenPoolAllowListRemoveIterator{contract: _BurnMintTokenPool.contract, event: "AllowListRemove", logs: logs, sub: sub}, nil +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) WatchAllowListRemove(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolAllowListRemove) (event.Subscription, error) { + + logs, sub, err := _BurnMintTokenPool.contract.WatchLogs(opts, "AllowListRemove") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(BurnMintTokenPoolAllowListRemove) + if err := _BurnMintTokenPool.contract.UnpackLog(event, "AllowListRemove", 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 +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) ParseAllowListRemove(log types.Log) (*BurnMintTokenPoolAllowListRemove, error) { + event := new(BurnMintTokenPoolAllowListRemove) + if err := _BurnMintTokenPool.contract.UnpackLog(event, "AllowListRemove", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type BurnMintTokenPoolBurnedIterator struct { + Event *BurnMintTokenPoolBurned + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *BurnMintTokenPoolBurnedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolBurned) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolBurned) + 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() + } +} + +func (it *BurnMintTokenPoolBurnedIterator) Error() error { + return it.fail +} + +func (it *BurnMintTokenPoolBurnedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type BurnMintTokenPoolBurned struct { + Sender common.Address + Amount *big.Int + Raw types.Log +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) FilterBurned(opts *bind.FilterOpts, sender []common.Address) (*BurnMintTokenPoolBurnedIterator, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _BurnMintTokenPool.contract.FilterLogs(opts, "Burned", senderRule) + if err != nil { + return nil, err + } + return &BurnMintTokenPoolBurnedIterator{contract: _BurnMintTokenPool.contract, event: "Burned", logs: logs, sub: sub}, nil +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) WatchBurned(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolBurned, sender []common.Address) (event.Subscription, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _BurnMintTokenPool.contract.WatchLogs(opts, "Burned", senderRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(BurnMintTokenPoolBurned) + if err := _BurnMintTokenPool.contract.UnpackLog(event, "Burned", 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 +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) ParseBurned(log types.Log) (*BurnMintTokenPoolBurned, error) { + event := new(BurnMintTokenPoolBurned) + if err := _BurnMintTokenPool.contract.UnpackLog(event, "Burned", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type BurnMintTokenPoolChainAddedIterator struct { + Event *BurnMintTokenPoolChainAdded + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *BurnMintTokenPoolChainAddedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolChainAdded) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolChainAdded) + 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() + } +} + +func (it *BurnMintTokenPoolChainAddedIterator) Error() error { + return it.fail +} + +func (it *BurnMintTokenPoolChainAddedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type BurnMintTokenPoolChainAdded struct { + RemoteChainSelector uint64 + OutboundRateLimiterConfig RateLimiterConfig + InboundRateLimiterConfig RateLimiterConfig + Raw types.Log +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) FilterChainAdded(opts *bind.FilterOpts) (*BurnMintTokenPoolChainAddedIterator, error) { + + logs, sub, err := _BurnMintTokenPool.contract.FilterLogs(opts, "ChainAdded") + if err != nil { + return nil, err + } + return &BurnMintTokenPoolChainAddedIterator{contract: _BurnMintTokenPool.contract, event: "ChainAdded", logs: logs, sub: sub}, nil +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) WatchChainAdded(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolChainAdded) (event.Subscription, error) { + + logs, sub, err := _BurnMintTokenPool.contract.WatchLogs(opts, "ChainAdded") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(BurnMintTokenPoolChainAdded) + if err := _BurnMintTokenPool.contract.UnpackLog(event, "ChainAdded", 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 +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) ParseChainAdded(log types.Log) (*BurnMintTokenPoolChainAdded, error) { + event := new(BurnMintTokenPoolChainAdded) + if err := _BurnMintTokenPool.contract.UnpackLog(event, "ChainAdded", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type BurnMintTokenPoolChainConfiguredIterator struct { + Event *BurnMintTokenPoolChainConfigured + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *BurnMintTokenPoolChainConfiguredIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolChainConfigured) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolChainConfigured) + 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() + } +} + +func (it *BurnMintTokenPoolChainConfiguredIterator) Error() error { + return it.fail +} + +func (it *BurnMintTokenPoolChainConfiguredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type BurnMintTokenPoolChainConfigured struct { + RemoteChainSelector uint64 + OutboundRateLimiterConfig RateLimiterConfig + InboundRateLimiterConfig RateLimiterConfig + Raw types.Log +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) FilterChainConfigured(opts *bind.FilterOpts) (*BurnMintTokenPoolChainConfiguredIterator, error) { + + logs, sub, err := _BurnMintTokenPool.contract.FilterLogs(opts, "ChainConfigured") + if err != nil { + return nil, err + } + return &BurnMintTokenPoolChainConfiguredIterator{contract: _BurnMintTokenPool.contract, event: "ChainConfigured", logs: logs, sub: sub}, nil +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) WatchChainConfigured(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolChainConfigured) (event.Subscription, error) { + + logs, sub, err := _BurnMintTokenPool.contract.WatchLogs(opts, "ChainConfigured") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(BurnMintTokenPoolChainConfigured) + if err := _BurnMintTokenPool.contract.UnpackLog(event, "ChainConfigured", 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 +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) ParseChainConfigured(log types.Log) (*BurnMintTokenPoolChainConfigured, error) { + event := new(BurnMintTokenPoolChainConfigured) + if err := _BurnMintTokenPool.contract.UnpackLog(event, "ChainConfigured", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type BurnMintTokenPoolChainRemovedIterator struct { + Event *BurnMintTokenPoolChainRemoved + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *BurnMintTokenPoolChainRemovedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolChainRemoved) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolChainRemoved) + 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() + } +} + +func (it *BurnMintTokenPoolChainRemovedIterator) Error() error { + return it.fail +} + +func (it *BurnMintTokenPoolChainRemovedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type BurnMintTokenPoolChainRemoved struct { + RemoteChainSelector uint64 + Raw types.Log +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) FilterChainRemoved(opts *bind.FilterOpts) (*BurnMintTokenPoolChainRemovedIterator, error) { + + logs, sub, err := _BurnMintTokenPool.contract.FilterLogs(opts, "ChainRemoved") + if err != nil { + return nil, err + } + return &BurnMintTokenPoolChainRemovedIterator{contract: _BurnMintTokenPool.contract, event: "ChainRemoved", logs: logs, sub: sub}, nil +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) WatchChainRemoved(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolChainRemoved) (event.Subscription, error) { + + logs, sub, err := _BurnMintTokenPool.contract.WatchLogs(opts, "ChainRemoved") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(BurnMintTokenPoolChainRemoved) + if err := _BurnMintTokenPool.contract.UnpackLog(event, "ChainRemoved", 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 +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) ParseChainRemoved(log types.Log) (*BurnMintTokenPoolChainRemoved, error) { + event := new(BurnMintTokenPoolChainRemoved) + if err := _BurnMintTokenPool.contract.UnpackLog(event, "ChainRemoved", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type BurnMintTokenPoolLockedIterator struct { + Event *BurnMintTokenPoolLocked + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *BurnMintTokenPoolLockedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolLocked) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolLocked) + 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() + } +} + +func (it *BurnMintTokenPoolLockedIterator) Error() error { + return it.fail +} + +func (it *BurnMintTokenPoolLockedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type BurnMintTokenPoolLocked struct { + Sender common.Address + Amount *big.Int + Raw types.Log +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) FilterLocked(opts *bind.FilterOpts, sender []common.Address) (*BurnMintTokenPoolLockedIterator, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _BurnMintTokenPool.contract.FilterLogs(opts, "Locked", senderRule) + if err != nil { + return nil, err + } + return &BurnMintTokenPoolLockedIterator{contract: _BurnMintTokenPool.contract, event: "Locked", logs: logs, sub: sub}, nil +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) WatchLocked(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolLocked, sender []common.Address) (event.Subscription, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _BurnMintTokenPool.contract.WatchLogs(opts, "Locked", senderRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(BurnMintTokenPoolLocked) + if err := _BurnMintTokenPool.contract.UnpackLog(event, "Locked", 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 +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) ParseLocked(log types.Log) (*BurnMintTokenPoolLocked, error) { + event := new(BurnMintTokenPoolLocked) + if err := _BurnMintTokenPool.contract.UnpackLog(event, "Locked", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type BurnMintTokenPoolMintedIterator struct { + Event *BurnMintTokenPoolMinted + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *BurnMintTokenPoolMintedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolMinted) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolMinted) + 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() + } +} + +func (it *BurnMintTokenPoolMintedIterator) Error() error { + return it.fail +} + +func (it *BurnMintTokenPoolMintedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type BurnMintTokenPoolMinted struct { + Sender common.Address + Recipient common.Address + Amount *big.Int + Raw types.Log +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) FilterMinted(opts *bind.FilterOpts, sender []common.Address, recipient []common.Address) (*BurnMintTokenPoolMintedIterator, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + var recipientRule []interface{} + for _, recipientItem := range recipient { + recipientRule = append(recipientRule, recipientItem) + } + + logs, sub, err := _BurnMintTokenPool.contract.FilterLogs(opts, "Minted", senderRule, recipientRule) + if err != nil { + return nil, err + } + return &BurnMintTokenPoolMintedIterator{contract: _BurnMintTokenPool.contract, event: "Minted", logs: logs, sub: sub}, nil +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) WatchMinted(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolMinted, sender []common.Address, recipient []common.Address) (event.Subscription, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + var recipientRule []interface{} + for _, recipientItem := range recipient { + recipientRule = append(recipientRule, recipientItem) + } + + logs, sub, err := _BurnMintTokenPool.contract.WatchLogs(opts, "Minted", senderRule, recipientRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(BurnMintTokenPoolMinted) + if err := _BurnMintTokenPool.contract.UnpackLog(event, "Minted", 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 +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) ParseMinted(log types.Log) (*BurnMintTokenPoolMinted, error) { + event := new(BurnMintTokenPoolMinted) + if err := _BurnMintTokenPool.contract.UnpackLog(event, "Minted", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type BurnMintTokenPoolOwnershipTransferRequestedIterator struct { + Event *BurnMintTokenPoolOwnershipTransferRequested + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *BurnMintTokenPoolOwnershipTransferRequestedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolOwnershipTransferRequested) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolOwnershipTransferRequested) + 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() + } +} + +func (it *BurnMintTokenPoolOwnershipTransferRequestedIterator) Error() error { + return it.fail +} + +func (it *BurnMintTokenPoolOwnershipTransferRequestedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type BurnMintTokenPoolOwnershipTransferRequested struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*BurnMintTokenPoolOwnershipTransferRequestedIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _BurnMintTokenPool.contract.FilterLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return &BurnMintTokenPoolOwnershipTransferRequestedIterator{contract: _BurnMintTokenPool.contract, event: "OwnershipTransferRequested", logs: logs, sub: sub}, nil +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _BurnMintTokenPool.contract.WatchLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(BurnMintTokenPoolOwnershipTransferRequested) + if err := _BurnMintTokenPool.contract.UnpackLog(event, "OwnershipTransferRequested", 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 +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) ParseOwnershipTransferRequested(log types.Log) (*BurnMintTokenPoolOwnershipTransferRequested, error) { + event := new(BurnMintTokenPoolOwnershipTransferRequested) + if err := _BurnMintTokenPool.contract.UnpackLog(event, "OwnershipTransferRequested", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type BurnMintTokenPoolOwnershipTransferredIterator struct { + Event *BurnMintTokenPoolOwnershipTransferred + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *BurnMintTokenPoolOwnershipTransferredIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolOwnershipTransferred) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolOwnershipTransferred) + 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() + } +} + +func (it *BurnMintTokenPoolOwnershipTransferredIterator) Error() error { + return it.fail +} + +func (it *BurnMintTokenPoolOwnershipTransferredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type BurnMintTokenPoolOwnershipTransferred struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*BurnMintTokenPoolOwnershipTransferredIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _BurnMintTokenPool.contract.FilterLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return &BurnMintTokenPoolOwnershipTransferredIterator{contract: _BurnMintTokenPool.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _BurnMintTokenPool.contract.WatchLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(BurnMintTokenPoolOwnershipTransferred) + if err := _BurnMintTokenPool.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 +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) ParseOwnershipTransferred(log types.Log) (*BurnMintTokenPoolOwnershipTransferred, error) { + event := new(BurnMintTokenPoolOwnershipTransferred) + if err := _BurnMintTokenPool.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type BurnMintTokenPoolReleasedIterator struct { + Event *BurnMintTokenPoolReleased + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *BurnMintTokenPoolReleasedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolReleased) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolReleased) + 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() + } +} + +func (it *BurnMintTokenPoolReleasedIterator) Error() error { + return it.fail +} + +func (it *BurnMintTokenPoolReleasedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type BurnMintTokenPoolReleased struct { + Sender common.Address + Recipient common.Address + Amount *big.Int + Raw types.Log +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) FilterReleased(opts *bind.FilterOpts, sender []common.Address, recipient []common.Address) (*BurnMintTokenPoolReleasedIterator, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + var recipientRule []interface{} + for _, recipientItem := range recipient { + recipientRule = append(recipientRule, recipientItem) + } + + logs, sub, err := _BurnMintTokenPool.contract.FilterLogs(opts, "Released", senderRule, recipientRule) + if err != nil { + return nil, err + } + return &BurnMintTokenPoolReleasedIterator{contract: _BurnMintTokenPool.contract, event: "Released", logs: logs, sub: sub}, nil +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) WatchReleased(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolReleased, sender []common.Address, recipient []common.Address) (event.Subscription, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + var recipientRule []interface{} + for _, recipientItem := range recipient { + recipientRule = append(recipientRule, recipientItem) + } + + logs, sub, err := _BurnMintTokenPool.contract.WatchLogs(opts, "Released", senderRule, recipientRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(BurnMintTokenPoolReleased) + if err := _BurnMintTokenPool.contract.UnpackLog(event, "Released", 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 +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) ParseReleased(log types.Log) (*BurnMintTokenPoolReleased, error) { + event := new(BurnMintTokenPoolReleased) + if err := _BurnMintTokenPool.contract.UnpackLog(event, "Released", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type BurnMintTokenPoolRouterUpdatedIterator struct { + Event *BurnMintTokenPoolRouterUpdated + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *BurnMintTokenPoolRouterUpdatedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolRouterUpdated) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolRouterUpdated) + 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() + } +} + +func (it *BurnMintTokenPoolRouterUpdatedIterator) Error() error { + return it.fail +} + +func (it *BurnMintTokenPoolRouterUpdatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type BurnMintTokenPoolRouterUpdated struct { + OldRouter common.Address + NewRouter common.Address + Raw types.Log +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) FilterRouterUpdated(opts *bind.FilterOpts) (*BurnMintTokenPoolRouterUpdatedIterator, error) { + + logs, sub, err := _BurnMintTokenPool.contract.FilterLogs(opts, "RouterUpdated") + if err != nil { + return nil, err + } + return &BurnMintTokenPoolRouterUpdatedIterator{contract: _BurnMintTokenPool.contract, event: "RouterUpdated", logs: logs, sub: sub}, nil +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) WatchRouterUpdated(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolRouterUpdated) (event.Subscription, error) { + + logs, sub, err := _BurnMintTokenPool.contract.WatchLogs(opts, "RouterUpdated") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(BurnMintTokenPoolRouterUpdated) + if err := _BurnMintTokenPool.contract.UnpackLog(event, "RouterUpdated", 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 +} + +func (_BurnMintTokenPool *BurnMintTokenPoolFilterer) ParseRouterUpdated(log types.Log) (*BurnMintTokenPoolRouterUpdated, error) { + event := new(BurnMintTokenPoolRouterUpdated) + if err := _BurnMintTokenPool.contract.UnpackLog(event, "RouterUpdated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +func (_BurnMintTokenPool *BurnMintTokenPool) ParseLog(log types.Log) (generated.AbigenLog, error) { + switch log.Topics[0] { + case _BurnMintTokenPool.abi.Events["AllowListAdd"].ID: + return _BurnMintTokenPool.ParseAllowListAdd(log) + case _BurnMintTokenPool.abi.Events["AllowListRemove"].ID: + return _BurnMintTokenPool.ParseAllowListRemove(log) + case _BurnMintTokenPool.abi.Events["Burned"].ID: + return _BurnMintTokenPool.ParseBurned(log) + case _BurnMintTokenPool.abi.Events["ChainAdded"].ID: + return _BurnMintTokenPool.ParseChainAdded(log) + case _BurnMintTokenPool.abi.Events["ChainConfigured"].ID: + return _BurnMintTokenPool.ParseChainConfigured(log) + case _BurnMintTokenPool.abi.Events["ChainRemoved"].ID: + return _BurnMintTokenPool.ParseChainRemoved(log) + case _BurnMintTokenPool.abi.Events["Locked"].ID: + return _BurnMintTokenPool.ParseLocked(log) + case _BurnMintTokenPool.abi.Events["Minted"].ID: + return _BurnMintTokenPool.ParseMinted(log) + case _BurnMintTokenPool.abi.Events["OwnershipTransferRequested"].ID: + return _BurnMintTokenPool.ParseOwnershipTransferRequested(log) + case _BurnMintTokenPool.abi.Events["OwnershipTransferred"].ID: + return _BurnMintTokenPool.ParseOwnershipTransferred(log) + case _BurnMintTokenPool.abi.Events["Released"].ID: + return _BurnMintTokenPool.ParseReleased(log) + case _BurnMintTokenPool.abi.Events["RouterUpdated"].ID: + return _BurnMintTokenPool.ParseRouterUpdated(log) + + default: + return nil, fmt.Errorf("abigen wrapper received unknown log topic: %v", log.Topics[0]) + } +} + +func (BurnMintTokenPoolAllowListAdd) Topic() common.Hash { + return common.HexToHash("0x2640d4d76caf8bf478aabfa982fa4e1c4eb71a37f93cd15e80dbc657911546d8") +} + +func (BurnMintTokenPoolAllowListRemove) Topic() common.Hash { + return common.HexToHash("0x800671136ab6cfee9fbe5ed1fb7ca417811aca3cf864800d127b927adedf7566") +} + +func (BurnMintTokenPoolBurned) Topic() common.Hash { + return common.HexToHash("0x696de425f79f4a40bc6d2122ca50507f0efbeabbff86a84871b7196ab8ea8df7") +} + +func (BurnMintTokenPoolChainAdded) Topic() common.Hash { + return common.HexToHash("0x0f135cbb9afa12a8bf3bbd071c117bcca4ddeca6160ef7f33d012a81b9c0c471") +} + +func (BurnMintTokenPoolChainConfigured) Topic() common.Hash { + return common.HexToHash("0x0350d63aa5f270e01729d00d627eeb8f3429772b1818c016c66a588a864f912b") +} + +func (BurnMintTokenPoolChainRemoved) Topic() common.Hash { + return common.HexToHash("0x5204aec90a3c794d8e90fded8b46ae9c7c552803e7e832e0c1d358396d859916") +} + +func (BurnMintTokenPoolLocked) Topic() common.Hash { + return common.HexToHash("0x9f1ec8c880f76798e7b793325d625e9b60e4082a553c98f42b6cda368dd60008") +} + +func (BurnMintTokenPoolMinted) Topic() common.Hash { + return common.HexToHash("0x9d228d69b5fdb8d273a2336f8fb8612d039631024ea9bf09c424a9503aa078f0") +} + +func (BurnMintTokenPoolOwnershipTransferRequested) Topic() common.Hash { + return common.HexToHash("0xed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae1278") +} + +func (BurnMintTokenPoolOwnershipTransferred) Topic() common.Hash { + return common.HexToHash("0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0") +} + +func (BurnMintTokenPoolReleased) Topic() common.Hash { + return common.HexToHash("0x2d87480f50083e2b2759522a8fdda59802650a8055e609a7772cf70c07748f52") +} + +func (BurnMintTokenPoolRouterUpdated) Topic() common.Hash { + return common.HexToHash("0x02dc5c233404867c793b749c6d644beb2277536d18a7e7974d3f238e4c6f1684") +} + +func (_BurnMintTokenPool *BurnMintTokenPool) Address() common.Address { + return _BurnMintTokenPool.address +} + +type BurnMintTokenPoolInterface interface { + GetAllowList(opts *bind.CallOpts) ([]common.Address, error) + + GetAllowListEnabled(opts *bind.CallOpts) (bool, error) + + GetArmProxy(opts *bind.CallOpts) (common.Address, error) + + GetCurrentInboundRateLimiterState(opts *bind.CallOpts, remoteChainSelector uint64) (RateLimiterTokenBucket, error) + + GetCurrentOutboundRateLimiterState(opts *bind.CallOpts, remoteChainSelector uint64) (RateLimiterTokenBucket, error) + + GetRouter(opts *bind.CallOpts) (common.Address, error) + + GetSupportedChains(opts *bind.CallOpts) ([]uint64, error) + + GetToken(opts *bind.CallOpts) (common.Address, error) + + IsSupportedChain(opts *bind.CallOpts, remoteChainSelector uint64) (bool, error) + + Owner(opts *bind.CallOpts) (common.Address, error) + + SupportsInterface(opts *bind.CallOpts, interfaceId [4]byte) (bool, error) + + TypeAndVersion(opts *bind.CallOpts) (string, error) + + AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) + + ApplyAllowListUpdates(opts *bind.TransactOpts, removes []common.Address, adds []common.Address) (*types.Transaction, error) + + ApplyChainUpdates(opts *bind.TransactOpts, chains []TokenPoolChainUpdate) (*types.Transaction, error) + + LockOrBurn(opts *bind.TransactOpts, originalSender common.Address, arg1 []byte, amount *big.Int, remoteChainSelector uint64, arg4 []byte) (*types.Transaction, error) + + ReleaseOrMint(opts *bind.TransactOpts, arg0 []byte, receiver common.Address, amount *big.Int, remoteChainSelector uint64, arg4 []byte) (*types.Transaction, error) + + SetChainRateLimiterConfig(opts *bind.TransactOpts, remoteChainSelector uint64, outboundConfig RateLimiterConfig, inboundConfig RateLimiterConfig) (*types.Transaction, error) + + SetRouter(opts *bind.TransactOpts, newRouter common.Address) (*types.Transaction, error) + + TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) + + FilterAllowListAdd(opts *bind.FilterOpts) (*BurnMintTokenPoolAllowListAddIterator, error) + + WatchAllowListAdd(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolAllowListAdd) (event.Subscription, error) + + ParseAllowListAdd(log types.Log) (*BurnMintTokenPoolAllowListAdd, error) + + FilterAllowListRemove(opts *bind.FilterOpts) (*BurnMintTokenPoolAllowListRemoveIterator, error) + + WatchAllowListRemove(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolAllowListRemove) (event.Subscription, error) + + ParseAllowListRemove(log types.Log) (*BurnMintTokenPoolAllowListRemove, error) + + FilterBurned(opts *bind.FilterOpts, sender []common.Address) (*BurnMintTokenPoolBurnedIterator, error) + + WatchBurned(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolBurned, sender []common.Address) (event.Subscription, error) + + ParseBurned(log types.Log) (*BurnMintTokenPoolBurned, error) + + FilterChainAdded(opts *bind.FilterOpts) (*BurnMintTokenPoolChainAddedIterator, error) + + WatchChainAdded(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolChainAdded) (event.Subscription, error) + + ParseChainAdded(log types.Log) (*BurnMintTokenPoolChainAdded, error) + + FilterChainConfigured(opts *bind.FilterOpts) (*BurnMintTokenPoolChainConfiguredIterator, error) + + WatchChainConfigured(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolChainConfigured) (event.Subscription, error) + + ParseChainConfigured(log types.Log) (*BurnMintTokenPoolChainConfigured, error) + + FilterChainRemoved(opts *bind.FilterOpts) (*BurnMintTokenPoolChainRemovedIterator, error) + + WatchChainRemoved(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolChainRemoved) (event.Subscription, error) + + ParseChainRemoved(log types.Log) (*BurnMintTokenPoolChainRemoved, error) + + FilterLocked(opts *bind.FilterOpts, sender []common.Address) (*BurnMintTokenPoolLockedIterator, error) + + WatchLocked(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolLocked, sender []common.Address) (event.Subscription, error) + + ParseLocked(log types.Log) (*BurnMintTokenPoolLocked, error) + + FilterMinted(opts *bind.FilterOpts, sender []common.Address, recipient []common.Address) (*BurnMintTokenPoolMintedIterator, error) + + WatchMinted(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolMinted, sender []common.Address, recipient []common.Address) (event.Subscription, error) + + ParseMinted(log types.Log) (*BurnMintTokenPoolMinted, error) + + FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*BurnMintTokenPoolOwnershipTransferRequestedIterator, error) + + WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferRequested(log types.Log) (*BurnMintTokenPoolOwnershipTransferRequested, error) + + FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*BurnMintTokenPoolOwnershipTransferredIterator, error) + + WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferred(log types.Log) (*BurnMintTokenPoolOwnershipTransferred, error) + + FilterReleased(opts *bind.FilterOpts, sender []common.Address, recipient []common.Address) (*BurnMintTokenPoolReleasedIterator, error) + + WatchReleased(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolReleased, sender []common.Address, recipient []common.Address) (event.Subscription, error) + + ParseReleased(log types.Log) (*BurnMintTokenPoolReleased, error) + + FilterRouterUpdated(opts *bind.FilterOpts) (*BurnMintTokenPoolRouterUpdatedIterator, error) + + WatchRouterUpdated(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolRouterUpdated) (event.Subscription, error) + + ParseRouterUpdated(log types.Log) (*BurnMintTokenPoolRouterUpdated, error) + + ParseLog(log types.Log) (generated.AbigenLog, error) + + Address() common.Address +} diff --git a/core/gethwrappers/ccip/generated/burn_mint_token_pool_and_proxy/burn_mint_token_pool_and_proxy.go b/core/gethwrappers/ccip/generated/burn_mint_token_pool_and_proxy/burn_mint_token_pool_and_proxy.go new file mode 100644 index 00000000000..4797421171c --- /dev/null +++ b/core/gethwrappers/ccip/generated/burn_mint_token_pool_and_proxy/burn_mint_token_pool_and_proxy.go @@ -0,0 +1,3034 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package burn_mint_token_pool_and_proxy + +import ( + "errors" + "fmt" + "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" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" +) + +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +type PoolLockOrBurnInV1 struct { + Receiver []byte + RemoteChainSelector uint64 + OriginalSender common.Address + Amount *big.Int + LocalToken common.Address +} + +type PoolLockOrBurnOutV1 struct { + DestTokenAddress []byte + DestPoolData []byte +} + +type PoolReleaseOrMintInV1 struct { + OriginalSender []byte + RemoteChainSelector uint64 + Receiver common.Address + Amount *big.Int + LocalToken common.Address + SourcePoolAddress []byte + SourcePoolData []byte + OffchainTokenData []byte +} + +type PoolReleaseOrMintOutV1 struct { + DestinationAmount *big.Int +} + +type RateLimiterConfig struct { + IsEnabled bool + Capacity *big.Int + Rate *big.Int +} + +type RateLimiterTokenBucket struct { + Tokens *big.Int + LastUpdated uint32 + IsEnabled bool + Capacity *big.Int + Rate *big.Int +} + +type TokenPoolChainUpdate struct { + RemoteChainSelector uint64 + Allowed bool + RemotePoolAddress []byte + RemoteTokenAddress []byte + OutboundRateLimiterConfig RateLimiterConfig + InboundRateLimiterConfig RateLimiterConfig +} + +var BurnMintTokenPoolAndProxyMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"internalType\":\"contractIBurnMintERC20\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"allowlist\",\"type\":\"address[]\"},{\"internalType\":\"address\",\"name\":\"rmnProxy\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"router\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"capacity\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"requested\",\"type\":\"uint256\"}],\"name\":\"AggregateValueMaxCapacityExceeded\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"minWaitInSeconds\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"available\",\"type\":\"uint256\"}],\"name\":\"AggregateValueRateLimitReached\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"AllowListNotEnabled\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"BucketOverfilled\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"}],\"name\":\"CallerIsNotARampOnRouter\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"}],\"name\":\"ChainAlreadyExists\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"ChainNotAllowed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"CursedByRMN\",\"type\":\"error\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"config\",\"type\":\"tuple\"}],\"name\":\"DisabledNonZeroRateLimit\",\"type\":\"error\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"rateLimiterConfig\",\"type\":\"tuple\"}],\"name\":\"InvalidRateLimitRate\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"sourcePoolAddress\",\"type\":\"bytes\"}],\"name\":\"InvalidSourcePoolAddress\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"InvalidToken\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"NonExistentChain\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RateLimitMustBeDisabled\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"SenderNotAllowed\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"capacity\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"requested\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"}],\"name\":\"TokenMaxCapacityExceeded\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"minWaitInSeconds\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"available\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"}],\"name\":\"TokenRateLimitReached\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"}],\"name\":\"Unauthorized\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddressNotAllowed\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"AllowListAdd\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"AllowListRemove\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Burned\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"remoteToken\",\"type\":\"bytes\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"indexed\":false,\"internalType\":\"structRateLimiter.Config\",\"name\":\"outboundRateLimiterConfig\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"indexed\":false,\"internalType\":\"structRateLimiter.Config\",\"name\":\"inboundRateLimiterConfig\",\"type\":\"tuple\"}],\"name\":\"ChainAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"indexed\":false,\"internalType\":\"structRateLimiter.Config\",\"name\":\"outboundRateLimiterConfig\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"indexed\":false,\"internalType\":\"structRateLimiter.Config\",\"name\":\"inboundRateLimiterConfig\",\"type\":\"tuple\"}],\"name\":\"ChainConfigured\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"ChainRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"indexed\":false,\"internalType\":\"structRateLimiter.Config\",\"name\":\"config\",\"type\":\"tuple\"}],\"name\":\"ConfigChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"contractIPoolPriorTo1_5\",\"name\":\"oldPool\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"contractIPoolPriorTo1_5\",\"name\":\"newPool\",\"type\":\"address\"}],\"name\":\"LegacyPoolChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Locked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Minted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Released\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"previousPoolAddress\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"remotePoolAddress\",\"type\":\"bytes\"}],\"name\":\"RemotePoolSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"oldRouter\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newRouter\",\"type\":\"address\"}],\"name\":\"RouterUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"}],\"name\":\"TokensConsumed\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"removes\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"adds\",\"type\":\"address[]\"}],\"name\":\"applyAllowListUpdates\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"bool\",\"name\":\"allowed\",\"type\":\"bool\"},{\"internalType\":\"bytes\",\"name\":\"remotePoolAddress\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"remoteTokenAddress\",\"type\":\"bytes\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"outboundRateLimiterConfig\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"inboundRateLimiterConfig\",\"type\":\"tuple\"}],\"internalType\":\"structTokenPool.ChainUpdate[]\",\"name\":\"chains\",\"type\":\"tuple[]\"}],\"name\":\"applyChainUpdates\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAllowList\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAllowListEnabled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"getCurrentInboundRateLimiterState\",\"outputs\":[{\"components\":[{\"internalType\":\"uint128\",\"name\":\"tokens\",\"type\":\"uint128\"},{\"internalType\":\"uint32\",\"name\":\"lastUpdated\",\"type\":\"uint32\"},{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.TokenBucket\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"getCurrentOutboundRateLimiterState\",\"outputs\":[{\"components\":[{\"internalType\":\"uint128\",\"name\":\"tokens\",\"type\":\"uint128\"},{\"internalType\":\"uint32\",\"name\":\"lastUpdated\",\"type\":\"uint32\"},{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.TokenBucket\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"name\":\"getOnRamp\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"onRampAddress\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getPreviousPool\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRateLimitAdmin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"getRemotePool\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"getRemoteToken\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRmnProxy\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"rmnProxy\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRouter\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"router\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getSupportedChains\",\"outputs\":[{\"internalType\":\"uint64[]\",\"name\":\"\",\"type\":\"uint64[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getToken\",\"outputs\":[{\"internalType\":\"contractIERC20\",\"name\":\"token\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"offRamp\",\"type\":\"address\"}],\"name\":\"isOffRamp\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"isSupportedChain\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"isSupportedToken\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes\",\"name\":\"receiver\",\"type\":\"bytes\"},{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"originalSender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"localToken\",\"type\":\"address\"}],\"internalType\":\"structPool.LockOrBurnInV1\",\"name\":\"lockOrBurnIn\",\"type\":\"tuple\"}],\"name\":\"lockOrBurn\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes\",\"name\":\"destTokenAddress\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"destPoolData\",\"type\":\"bytes\"}],\"internalType\":\"structPool.LockOrBurnOutV1\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes\",\"name\":\"originalSender\",\"type\":\"bytes\"},{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"localToken\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"sourcePoolAddress\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"sourcePoolData\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"offchainTokenData\",\"type\":\"bytes\"}],\"internalType\":\"structPool.ReleaseOrMintInV1\",\"name\":\"releaseOrMintIn\",\"type\":\"tuple\"}],\"name\":\"releaseOrMint\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"destinationAmount\",\"type\":\"uint256\"}],\"internalType\":\"structPool.ReleaseOrMintOutV1\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"outboundConfig\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"inboundConfig\",\"type\":\"tuple\"}],\"name\":\"setChainRateLimiterConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractIPoolPriorTo1_5\",\"name\":\"prevPool\",\"type\":\"address\"}],\"name\":\"setPreviousPool\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"rateLimitAdmin\",\"type\":\"address\"}],\"name\":\"setRateLimitAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"remotePoolAddress\",\"type\":\"bytes\"}],\"name\":\"setRemotePool\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newRouter\",\"type\":\"address\"}],\"name\":\"setRouter\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", + Bin: "0x60e06040523480156200001157600080fd5b506040516200497338038062004973833981016040819052620000349162000554565b83838383838383833380600081620000935760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000c657620000c6816200017e565b5050506001600160a01b0384161580620000e757506001600160a01b038116155b80620000fa57506001600160a01b038216155b1562000119576040516342bcdf7f60e11b815260040160405180910390fd5b6001600160a01b0384811660805282811660a052600480546001600160a01b031916918316919091179055825115801560c0526200016c576040805160008152602081019091526200016c908462000229565b505050505050505050505050620006b2565b336001600160a01b03821603620001d85760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c6600000000000000000060448201526064016200008a565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b60c0516200024a576040516335f4a7b360e01b815260040160405180910390fd5b60005b8251811015620002d55760008382815181106200026e576200026e62000664565b602090810291909101015190506200028860028262000386565b15620002cb576040516001600160a01b03821681527f800671136ab6cfee9fbe5ed1fb7ca417811aca3cf864800d127b927adedf75669060200160405180910390a15b506001016200024d565b5060005b815181101562000381576000828281518110620002fa57620002fa62000664565b6020026020010151905060006001600160a01b0316816001600160a01b03160362000326575062000378565b62000333600282620003a6565b1562000376576040516001600160a01b03821681527f2640d4d76caf8bf478aabfa982fa4e1c4eb71a37f93cd15e80dbc657911546d89060200160405180910390a15b505b600101620002d9565b505050565b60006200039d836001600160a01b038416620003bd565b90505b92915050565b60006200039d836001600160a01b038416620004c1565b60008181526001830160205260408120548015620004b6576000620003e46001836200067a565b8554909150600090620003fa906001906200067a565b9050808214620004665760008660000182815481106200041e576200041e62000664565b906000526020600020015490508087600001848154811062000444576200044462000664565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806200047a576200047a6200069c565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050620003a0565b6000915050620003a0565b60008181526001830160205260408120546200050a57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155620003a0565b506000620003a0565b6001600160a01b03811681146200052957600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b80516200054f8162000513565b919050565b600080600080608085870312156200056b57600080fd5b8451620005788162000513565b602086810151919550906001600160401b03808211156200059857600080fd5b818801915088601f830112620005ad57600080fd5b815181811115620005c257620005c26200052c565b8060051b604051601f19603f83011681018181108582111715620005ea57620005ea6200052c565b60405291825284820192508381018501918b8311156200060957600080fd5b938501935b828510156200063257620006228562000542565b845293850193928501926200060e565b809850505050505050620006496040860162000542565b9150620006596060860162000542565b905092959194509250565b634e487b7160e01b600052603260045260246000fd5b81810381811115620003a057634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603160045260246000fd5b60805160a05160c05161423d620007366000396000818161056001528181611ae8015261253a01526000818161053a0152818161187b0152611d9b015260008181610265015281816102ba0152818161078001528181610e060152818161179b01528181611cbb01528181611ea1015281816124d00152612725015261423d6000f3fe608060405234801561001057600080fd5b50600436106101da5760003560e01c80639a4575b911610104578063c0d78655116100a2578063db6327dc11610071578063db6327dc14610525578063dc0bd97114610538578063e0351e131461055e578063f2fde38b1461058457600080fd5b8063c0d78655146104d7578063c4bffe2b146104ea578063c75eea9c146104ff578063cf7401f31461051257600080fd5b8063a8d87a3b116100de578063a8d87a3b14610424578063af58d59f14610437578063b0f479a1146104a6578063b7946580146104c457600080fd5b80639a4575b9146103d1578063a2b261d8146103f1578063a7cd63b71461040f57600080fd5b80636d3d1a581161017c57806383826b2b1161014b57806383826b2b1461037a5780638926f54f1461038d5780638da5cb5b146103a05780639766b932146103be57600080fd5b80636d3d1a581461032e57806378a010b21461034c57806379ba50971461035f5780637d54534e1461036757600080fd5b806321df0da7116101b857806321df0da714610263578063240028e8146102aa57806339077537146102f757806354c8a4f31461031957600080fd5b806301ffc9a7146101df5780630a2fd49314610207578063181f5a7714610227575b600080fd5b6101f26101ed3660046131d2565b610597565b60405190151581526020015b60405180910390f35b61021a610215366004613231565b61067c565b6040516101fe91906132ba565b61021a6040518060400160405280601f81526020017f4275726e4d696e74546f6b656e506f6f6c416e6450726f787920312e352e300081525081565b7f00000000000000000000000000000000000000000000000000000000000000005b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101fe565b6101f26102b83660046132fa565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff90811691161490565b61030a610305366004613317565b61072c565b604051905181526020016101fe565b61032c61032736600461339f565b6108e4565b005b60085473ffffffffffffffffffffffffffffffffffffffff16610285565b61032c61035a36600461340b565b61095f565b61032c610ad3565b61032c6103753660046132fa565b610bd0565b6101f261038836600461348e565b610c1f565b6101f261039b366004613231565b610cec565b60005473ffffffffffffffffffffffffffffffffffffffff16610285565b61032c6103cc3660046132fa565b610d03565b6103e46103df3660046134c5565b610d92565b6040516101fe9190613500565b60095473ffffffffffffffffffffffffffffffffffffffff16610285565b610417610f02565b6040516101fe9190613560565b610285610432366004613231565b503090565b61044a610445366004613231565b610f13565b6040516101fe919081516fffffffffffffffffffffffffffffffff908116825260208084015163ffffffff1690830152604080840151151590830152606080840151821690830152608092830151169181019190915260a00190565b60045473ffffffffffffffffffffffffffffffffffffffff16610285565b61021a6104d2366004613231565b610fe8565b61032c6104e53660046132fa565b611013565b6104f26110e7565b6040516101fe91906135ba565b61044a61050d366004613231565b61119f565b61032c610520366004613771565b611271565b61032c6105333660046137b6565b6112fa565b7f0000000000000000000000000000000000000000000000000000000000000000610285565b7f00000000000000000000000000000000000000000000000000000000000000006101f2565b61032c6105923660046132fa565b611780565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167faff2afbf00000000000000000000000000000000000000000000000000000000148061062a57507fffffffff0000000000000000000000000000000000000000000000000000000082167f0e64dd2900000000000000000000000000000000000000000000000000000000145b8061067657507fffffffff0000000000000000000000000000000000000000000000000000000082167f01ffc9a700000000000000000000000000000000000000000000000000000000145b92915050565b67ffffffffffffffff811660009081526007602052604090206004018054606091906106a7906137f8565b80601f01602080910402602001604051908101604052809291908181526020018280546106d3906137f8565b80156107205780601f106106f557610100808354040283529160200191610720565b820191906000526020600020905b81548152906001019060200180831161070357829003601f168201915b50505050509050919050565b60408051602081019091526000815261074c610747836138e7565b611794565b60095473ffffffffffffffffffffffffffffffffffffffff166108425773ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000166340c10f196107b560608501604086016132fa565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b16815273ffffffffffffffffffffffffffffffffffffffff909116600482015260608501356024820152604401600060405180830381600087803b15801561082557600080fd5b505af1158015610839573d6000803e3d6000fd5b50505050610853565b61085361084e836138e7565b6119c5565b61086360608301604084016132fa565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f9d228d69b5fdb8d273a2336f8fb8612d039631024ea9bf09c424a9503aa078f084606001356040516108c591815260200190565b60405180910390a3506040805160208101909152606090910135815290565b6108ec611a63565b61095984848080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808802828101820190935287825290935087925086918291850190849080828437600092019190915250611ae692505050565b50505050565b610967611a63565b61097083610cec565b6109b7576040517f1e670e4b00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff841660048201526024015b60405180910390fd5b67ffffffffffffffff8316600090815260076020526040812060040180546109de906137f8565b80601f0160208091040260200160405190810160405280929190818152602001828054610a0a906137f8565b8015610a575780601f10610a2c57610100808354040283529160200191610a57565b820191906000526020600020905b815481529060010190602001808311610a3a57829003601f168201915b5050505067ffffffffffffffff8616600090815260076020526040902091925050600401610a86838583613a2c565b508367ffffffffffffffff167fdb4d6220746a38cbc5335f7e108f7de80f482f4d23350253dfd0917df75a14bf828585604051610ac593929190613b46565b60405180910390a250505050565b60015473ffffffffffffffffffffffffffffffffffffffff163314610b54576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e65720000000000000000000060448201526064016109ae565b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b610bd8611a63565b600880547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b600073ffffffffffffffffffffffffffffffffffffffff8216301480610ce55750600480546040517f83826b2b00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff86169281019290925273ffffffffffffffffffffffffffffffffffffffff848116602484015216906383826b2b90604401602060405180830381865afa158015610cc1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ce59190613baa565b9392505050565b6000610676600567ffffffffffffffff8416611c9c565b610d0b611a63565b6009805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff000000000000000000000000000000000000000083168117909355604080519190921680825260208201939093527f81accd0a7023865eaa51b3399dd0eafc488bf3ba238402911e1659cfe860f22891015b60405180910390a15050565b6040805180820190915260608082526020820152610db7610db283613bc7565b611cb4565b60095473ffffffffffffffffffffffffffffffffffffffff16610e7c576040517f42966c68000000000000000000000000000000000000000000000000000000008152606083013560048201527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16906342966c6890602401600060405180830381600087803b158015610e5f57600080fd5b505af1158015610e73573d6000803e3d6000fd5b50505050610e8d565b610e8d610e8883613bc7565b611e7e565b6040516060830135815233907f696de425f79f4a40bc6d2122ca50507f0efbeabbff86a84871b7196ab8ea8df79060200160405180910390a26040518060400160405280610ee78460200160208101906104d29190613231565b81526040805160208181019092526000815291015292915050565b6060610f0e6002611f98565b905090565b6040805160a08101825260008082526020820181905291810182905260608101829052608081019190915267ffffffffffffffff8216600090815260076020908152604091829020825160a08101845260028201546fffffffffffffffffffffffffffffffff808216835270010000000000000000000000000000000080830463ffffffff16958401959095527401000000000000000000000000000000000000000090910460ff16151594820194909452600390910154808416606083015291909104909116608082015261067690611fa5565b67ffffffffffffffff811660009081526007602052604090206005018054606091906106a7906137f8565b61101b611a63565b73ffffffffffffffffffffffffffffffffffffffff8116611068576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6004805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff000000000000000000000000000000000000000083168117909355604080519190921680825260208201939093527f02dc5c233404867c793b749c6d644beb2277536d18a7e7974d3f238e4c6f16849101610d86565b606060006110f56005611f98565b90506000815167ffffffffffffffff811115611113576111136135fc565b60405190808252806020026020018201604052801561113c578160200160208202803683370190505b50905060005b82518110156111985782818151811061115d5761115d613c69565b602002602001015182828151811061117757611177613c69565b67ffffffffffffffff90921660209283029190910190910152600101611142565b5092915050565b6040805160a08101825260008082526020820181905291810182905260608101829052608081019190915267ffffffffffffffff8216600090815260076020908152604091829020825160a08101845281546fffffffffffffffffffffffffffffffff808216835270010000000000000000000000000000000080830463ffffffff16958401959095527401000000000000000000000000000000000000000090910460ff16151594820194909452600190910154808416606083015291909104909116608082015261067690611fa5565b60085473ffffffffffffffffffffffffffffffffffffffff1633148015906112b1575060005473ffffffffffffffffffffffffffffffffffffffff163314155b156112ea576040517f8e4a23d60000000000000000000000000000000000000000000000000000000081523360048201526024016109ae565b6112f5838383612057565b505050565b611302611a63565b60005b818110156112f557600083838381811061132157611321613c69565b90506020028101906113339190613c98565b61133c90613cd6565b90506113518160800151826020015115612141565b6113648160a00151826020015115612141565b8060200151156116605780516113869060059067ffffffffffffffff1661227a565b6113cb5780516040517f1d5ad3c500000000000000000000000000000000000000000000000000000000815267ffffffffffffffff90911660048201526024016109ae565b60408101515115806113e05750606081015151155b15611417576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040805161012081018252608083810180516020908101516fffffffffffffffffffffffffffffffff9081168486019081524263ffffffff90811660a0808901829052865151151560c08a01528651860151851660e08a015295518901518416610100890152918752875180860189529489018051850151841686528585019290925281515115158589015281518401518316606080870191909152915188015183168587015283870194855288880151878901908152828a015183890152895167ffffffffffffffff1660009081526007865289902088518051825482890151838e01519289167fffffffffffffffffffffffff0000000000000000000000000000000000000000928316177001000000000000000000000000000000009188168202177fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff90811674010000000000000000000000000000000000000000941515850217865584890151948d0151948a16948a168202949094176001860155995180516002860180549b8301519f830151918b169b9093169a909a179d9096168a029c909c179091169615150295909517909855908101519401519381169316909102919091176003820155915190919060048201906115f89082613d8a565b506060820151600582019061160d9082613d8a565b505081516060830151608084015160a08501516040517f8d340f17e19058004c20453540862a9c62778504476f6756755cb33bcd6c38c295506116539493929190613ea4565b60405180910390a1611777565b80516116789060059067ffffffffffffffff16612286565b6116bd5780516040517f1e670e4b00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff90911660048201526024016109ae565b805167ffffffffffffffff16600090815260076020526040812080547fffffffffffffffffffffff000000000000000000000000000000000000000000908116825560018201839055600282018054909116905560038101829055906117266004830182613184565b611734600583016000613184565b5050805160405167ffffffffffffffff90911681527f5204aec90a3c794d8e90fded8b46ae9c7c552803e7e832e0c1d358396d8599169060200160405180910390a15b50600101611305565b611788611a63565b61179181612292565b50565b60808101517f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff9081169116146118295760808101516040517f961c9a4f00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff90911660048201526024016109ae565b60208101516040517f2cbc26bb00000000000000000000000000000000000000000000000000000000815260809190911b77ffffffffffffffff000000000000000000000000000000001660048201527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1690632cbc26bb90602401602060405180830381865afa1580156118d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118fb9190613baa565b15611932576040517f53ad11d800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61193f8160200151612387565b600061194e826020015161067c565b9050805160001480611972575080805190602001208260a001518051906020012014155b156119af578160a001516040517f24eb47e50000000000000000000000000000000000000000000000000000000081526004016109ae91906132ba565b6119c1826020015183606001516124ad565b5050565b60095481516040808401516060850151602086015192517f8627fad600000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff90951694638627fad694611a2e9490939291600401613f3d565b600060405180830381600087803b158015611a4857600080fd5b505af1158015611a5c573d6000803e3d6000fd5b5050505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314611ae4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e65720000000000000000000060448201526064016109ae565b565b7f0000000000000000000000000000000000000000000000000000000000000000611b3d576040517f35f4a7b300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b8251811015611bd3576000838281518110611b5d57611b5d613c69565b60200260200101519050611b7b8160026124f490919063ffffffff16565b15611bca5760405173ffffffffffffffffffffffffffffffffffffffff821681527f800671136ab6cfee9fbe5ed1fb7ca417811aca3cf864800d127b927adedf75669060200160405180910390a15b50600101611b40565b5060005b81518110156112f5576000828281518110611bf457611bf4613c69565b60200260200101519050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603611c385750611c94565b611c43600282612516565b15611c925760405173ffffffffffffffffffffffffffffffffffffffff821681527f2640d4d76caf8bf478aabfa982fa4e1c4eb71a37f93cd15e80dbc657911546d89060200160405180910390a15b505b600101611bd7565b60008181526001830160205260408120541515610ce5565b60808101517f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff908116911614611d495760808101516040517f961c9a4f00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff90911660048201526024016109ae565b60208101516040517f2cbc26bb00000000000000000000000000000000000000000000000000000000815260809190911b77ffffffffffffffff000000000000000000000000000000001660048201527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1690632cbc26bb90602401602060405180830381865afa158015611df7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e1b9190613baa565b15611e52576040517f53ad11d800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611e5f8160400151612538565b611e6c81602001516125b7565b61179181602001518260600151612705565b6009546060820151611ecb9173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000811692911690612749565b60095460408083015183516060850151602086015193517f9687544500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff90951694639687544594611f3394939291600401613f9e565b6000604051808303816000875af1158015611f52573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682016040526119c19190810190613ffe565b60606000610ce5836127d6565b6040805160a08101825260008082526020820181905291810182905260608101829052608081019190915261203382606001516fffffffffffffffffffffffffffffffff1683600001516fffffffffffffffffffffffffffffffff16846020015163ffffffff1642612017919061409b565b85608001516fffffffffffffffffffffffffffffffff16612831565b6fffffffffffffffffffffffffffffffff1682525063ffffffff4216602082015290565b61206083610cec565b6120a2576040517f1e670e4b00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff841660048201526024016109ae565b6120ad826000612141565b67ffffffffffffffff831660009081526007602052604090206120d0908361285b565b6120db816000612141565b67ffffffffffffffff83166000908152600760205260409020612101906002018261285b565b7f0350d63aa5f270e01729d00d627eeb8f3429772b1818c016c66a588a864f912b838383604051612134939291906140ae565b60405180910390a1505050565b8151156122085781602001516fffffffffffffffffffffffffffffffff1682604001516fffffffffffffffffffffffffffffffff16101580612197575060408201516fffffffffffffffffffffffffffffffff16155b156121d057816040517f8020d1240000000000000000000000000000000000000000000000000000000081526004016109ae9190614131565b80156119c1576040517f433fc33d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60408201516fffffffffffffffffffffffffffffffff16151580612241575060208201516fffffffffffffffffffffffffffffffff1615155b156119c157816040517fd68af9cc0000000000000000000000000000000000000000000000000000000081526004016109ae9190614131565b6000610ce583836129fd565b6000610ce58383612a4c565b3373ffffffffffffffffffffffffffffffffffffffff821603612311576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c6600000000000000000060448201526064016109ae565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b61239081610cec565b6123d2576040517fa9902c7e00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff821660048201526024016109ae565b600480546040517f83826b2b00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff84169281019290925233602483015273ffffffffffffffffffffffffffffffffffffffff16906383826b2b90604401602060405180830381865afa158015612451573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124759190613baa565b611791576040517f728fe07b0000000000000000000000000000000000000000000000000000000081523360048201526024016109ae565b67ffffffffffffffff821660009081526007602052604090206119c190600201827f0000000000000000000000000000000000000000000000000000000000000000612b3f565b6000610ce58373ffffffffffffffffffffffffffffffffffffffff8416612a4c565b6000610ce58373ffffffffffffffffffffffffffffffffffffffff84166129fd565b7f00000000000000000000000000000000000000000000000000000000000000001561179157612569600282612ec2565b611791576040517fd0d2597600000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff821660048201526024016109ae565b6125c081610cec565b612602576040517fa9902c7e00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff821660048201526024016109ae565b600480546040517fa8d87a3b00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff84169281019290925273ffffffffffffffffffffffffffffffffffffffff169063a8d87a3b90602401602060405180830381865afa15801561267b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061269f919061416d565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611791576040517f728fe07b0000000000000000000000000000000000000000000000000000000081523360048201526024016109ae565b67ffffffffffffffff821660009081526007602052604090206119c190827f0000000000000000000000000000000000000000000000000000000000000000612b3f565b6040805173ffffffffffffffffffffffffffffffffffffffff8416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb000000000000000000000000000000000000000000000000000000001790526112f5908490612ef1565b60608160000180548060200260200160405190810160405280929190818152602001828054801561072057602002820191906000526020600020905b8154815260200190600101908083116128125750505050509050919050565b600061285085612841848661418a565b61284b90876141a1565b612ffd565b90505b949350505050565b815460009061288490700100000000000000000000000000000000900463ffffffff164261409b565b9050801561292657600183015483546128cc916fffffffffffffffffffffffffffffffff80821692811691859170010000000000000000000000000000000090910416612831565b83546fffffffffffffffffffffffffffffffff919091167fffffffffffffffffffffffff0000000000000000000000000000000000000000909116177001000000000000000000000000000000004263ffffffff16021783555b6020820151835461294c916fffffffffffffffffffffffffffffffff9081169116612ffd565b83548351151574010000000000000000000000000000000000000000027fffffffffffffffffffffff00ffffffff000000000000000000000000000000009091166fffffffffffffffffffffffffffffffff92831617178455602083015160408085015183167001000000000000000000000000000000000291909216176001850155517f9ea3374b67bf275e6bb9c8ae68f9cae023e1c528b4b27e092f0bb209d3531c1990612134908490614131565b6000818152600183016020526040812054612a4457508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610676565b506000610676565b60008181526001830160205260408120548015612b35576000612a7060018361409b565b8554909150600090612a849060019061409b565b9050808214612ae9576000866000018281548110612aa457612aa4613c69565b9060005260206000200154905080876000018481548110612ac757612ac7613c69565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080612afa57612afa6141b4565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610676565b6000915050610676565b825474010000000000000000000000000000000000000000900460ff161580612b66575081155b15612b7057505050565b825460018401546fffffffffffffffffffffffffffffffff80831692911690600090612bb690700100000000000000000000000000000000900463ffffffff164261409b565b90508015612c765781831115612bf8576040517f9725942a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001860154612c329083908590849070010000000000000000000000000000000090046fffffffffffffffffffffffffffffffff16612831565b86547fffffffffffffffffffffffff00000000ffffffffffffffffffffffffffffffff167001000000000000000000000000000000004263ffffffff160217875592505b84821015612d2d5773ffffffffffffffffffffffffffffffffffffffff8416612cd5576040517ff94ebcd100000000000000000000000000000000000000000000000000000000815260048101839052602481018690526044016109ae565b6040517f1a76572a000000000000000000000000000000000000000000000000000000008152600481018390526024810186905273ffffffffffffffffffffffffffffffffffffffff851660448201526064016109ae565b84831015612e405760018681015470010000000000000000000000000000000090046fffffffffffffffffffffffffffffffff16906000908290612d71908261409b565b612d7b878a61409b565b612d8591906141a1565b612d8f91906141e3565b905073ffffffffffffffffffffffffffffffffffffffff8616612de8576040517f15279c0800000000000000000000000000000000000000000000000000000000815260048101829052602481018690526044016109ae565b6040517fd0c8d23a000000000000000000000000000000000000000000000000000000008152600481018290526024810186905273ffffffffffffffffffffffffffffffffffffffff871660448201526064016109ae565b612e4a858461409b565b86547fffffffffffffffffffffffffffffffff00000000000000000000000000000000166fffffffffffffffffffffffffffffffff82161787556040518681529093507f1871cdf8010e63f2eb8384381a68dfa7416dc571a5517e66e88b2d2d0c0a690a9060200160405180910390a1505050505050565b73ffffffffffffffffffffffffffffffffffffffff811660009081526001830160205260408120541515610ce5565b6000612f53826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166130139092919063ffffffff16565b8051909150156112f55780806020019051810190612f719190613baa565b6112f5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f7420737563636565640000000000000000000000000000000000000000000060648201526084016109ae565b600081831061300c5781610ce5565b5090919050565b60606128538484600085856000808673ffffffffffffffffffffffffffffffffffffffff168587604051613047919061421e565b60006040518083038185875af1925050503d8060008114613084576040519150601f19603f3d011682016040523d82523d6000602084013e613089565b606091505b509150915061309a878383876130a5565b979650505050505050565b6060831561313b5782516000036131345773ffffffffffffffffffffffffffffffffffffffff85163b613134576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016109ae565b5081612853565b61285383838151156131505781518083602001fd5b806040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109ae91906132ba565b508054613190906137f8565b6000825580601f106131a0575050565b601f01602090049060005260206000209081019061179191905b808211156131ce57600081556001016131ba565b5090565b6000602082840312156131e457600080fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114610ce557600080fd5b803567ffffffffffffffff8116811461322c57600080fd5b919050565b60006020828403121561324357600080fd5b610ce582613214565b60005b8381101561326757818101518382015260200161324f565b50506000910152565b6000815180845261328881602086016020860161324c565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b602081526000610ce56020830184613270565b73ffffffffffffffffffffffffffffffffffffffff8116811461179157600080fd5b803561322c816132cd565b60006020828403121561330c57600080fd5b8135610ce5816132cd565b60006020828403121561332957600080fd5b813567ffffffffffffffff81111561334057600080fd5b82016101008185031215610ce557600080fd5b60008083601f84011261336557600080fd5b50813567ffffffffffffffff81111561337d57600080fd5b6020830191508360208260051b850101111561339857600080fd5b9250929050565b600080600080604085870312156133b557600080fd5b843567ffffffffffffffff808211156133cd57600080fd5b6133d988838901613353565b909650945060208701359150808211156133f257600080fd5b506133ff87828801613353565b95989497509550505050565b60008060006040848603121561342057600080fd5b61342984613214565b9250602084013567ffffffffffffffff8082111561344657600080fd5b818601915086601f83011261345a57600080fd5b81358181111561346957600080fd5b87602082850101111561347b57600080fd5b6020830194508093505050509250925092565b600080604083850312156134a157600080fd5b6134aa83613214565b915060208301356134ba816132cd565b809150509250929050565b6000602082840312156134d757600080fd5b813567ffffffffffffffff8111156134ee57600080fd5b820160a08185031215610ce557600080fd5b60208152600082516040602084015261351c6060840182613270565b905060208401517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08483030160408501526135578282613270565b95945050505050565b6020808252825182820181905260009190848201906040850190845b818110156135ae57835173ffffffffffffffffffffffffffffffffffffffff168352928401929184019160010161357c565b50909695505050505050565b6020808252825182820181905260009190848201906040850190845b818110156135ae57835167ffffffffffffffff16835292840192918401916001016135d6565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051610100810167ffffffffffffffff8111828210171561364f5761364f6135fc565b60405290565b60405160c0810167ffffffffffffffff8111828210171561364f5761364f6135fc565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff811182821017156136bf576136bf6135fc565b604052919050565b801515811461179157600080fd5b803561322c816136c7565b80356fffffffffffffffffffffffffffffffff8116811461322c57600080fd5b60006060828403121561371257600080fd5b6040516060810181811067ffffffffffffffff82111715613735576137356135fc565b6040529050808235613746816136c7565b8152613754602084016136e0565b6020820152613765604084016136e0565b60408201525092915050565b600080600060e0848603121561378657600080fd5b61378f84613214565b925061379e8560208601613700565b91506137ad8560808601613700565b90509250925092565b600080602083850312156137c957600080fd5b823567ffffffffffffffff8111156137e057600080fd5b6137ec85828601613353565b90969095509350505050565b600181811c9082168061380c57607f821691505b602082108103613845577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b600067ffffffffffffffff821115613865576138656135fc565b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b600082601f8301126138a257600080fd5b81356138b56138b08261384b565b613678565b8181528460208386010111156138ca57600080fd5b816020850160208301376000918101602001919091529392505050565b600061010082360312156138fa57600080fd5b61390261362b565b823567ffffffffffffffff8082111561391a57600080fd5b61392636838701613891565b835261393460208601613214565b6020840152613945604086016132ef565b604084015260608501356060840152613960608086016132ef565b608084015260a085013591508082111561397957600080fd5b61398536838701613891565b60a084015260c085013591508082111561399e57600080fd5b6139aa36838701613891565b60c084015260e08501359150808211156139c357600080fd5b506139d036828601613891565b60e08301525092915050565b601f8211156112f5576000816000526020600020601f850160051c81016020861015613a055750805b601f850160051c820191505b81811015613a2457828155600101613a11565b505050505050565b67ffffffffffffffff831115613a4457613a446135fc565b613a5883613a5283546137f8565b836139dc565b6000601f841160018114613aaa5760008515613a745750838201355b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600387901b1c1916600186901b178355611a5c565b6000838152602090207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0861690835b82811015613af95786850135825560209485019460019092019101613ad9565b5086821015613b34577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60f88860031b161c19848701351681555b505060018560011b0183555050505050565b604081526000613b596040830186613270565b82810360208401528381528385602083013760006020858301015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f860116820101915050949350505050565b600060208284031215613bbc57600080fd5b8151610ce5816136c7565b600060a08236031215613bd957600080fd5b60405160a0810167ffffffffffffffff8282108183111715613bfd57613bfd6135fc565b816040528435915080821115613c1257600080fd5b50613c1f36828601613891565b825250613c2e60208401613214565b60208201526040830135613c41816132cd565b6040820152606083810135908201526080830135613c5e816132cd565b608082015292915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600082357ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec1833603018112613ccc57600080fd5b9190910192915050565b60006101408236031215613ce957600080fd5b613cf1613655565b613cfa83613214565b8152613d08602084016136d5565b6020820152604083013567ffffffffffffffff80821115613d2857600080fd5b613d3436838701613891565b60408401526060850135915080821115613d4d57600080fd5b50613d5a36828601613891565b606083015250613d6d3660808501613700565b6080820152613d7f3660e08501613700565b60a082015292915050565b815167ffffffffffffffff811115613da457613da46135fc565b613db881613db284546137f8565b846139dc565b602080601f831160018114613e0b5760008415613dd55750858301515b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600386901b1c1916600185901b178555613a24565b6000858152602081207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08616915b82811015613e5857888601518255948401946001909101908401613e39565b5085821015613e9457878501517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600388901b60f8161c191681555b5050505050600190811b01905550565b600061010067ffffffffffffffff87168352806020840152613ec881840187613270565b8551151560408581019190915260208701516fffffffffffffffffffffffffffffffff9081166060870152908701511660808501529150613f069050565b8251151560a083015260208301516fffffffffffffffffffffffffffffffff90811660c084015260408401511660e0830152613557565b60a081526000613f5060a0830187613270565b73ffffffffffffffffffffffffffffffffffffffff8616602084015284604084015267ffffffffffffffff841660608401528281036080840152600081526020810191505095945050505050565b73ffffffffffffffffffffffffffffffffffffffff8516815260a060208201526000613fcd60a0830186613270565b60408301949094525067ffffffffffffffff9190911660608201528082036080909101526000815260200192915050565b60006020828403121561401057600080fd5b815167ffffffffffffffff81111561402757600080fd5b8201601f8101841361403857600080fd5b80516140466138b08261384b565b81815285602083850101111561405b57600080fd5b61355782602083016020860161324c565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b818103818111156106765761067661406c565b67ffffffffffffffff8416815260e081016140fa60208301858051151582526020808201516fffffffffffffffffffffffffffffffff9081169184019190915260409182015116910152565b82511515608083015260208301516fffffffffffffffffffffffffffffffff90811660a084015260408401511660c0830152612853565b6060810161067682848051151582526020808201516fffffffffffffffffffffffffffffffff9081169184019190915260409182015116910152565b60006020828403121561417f57600080fd5b8151610ce5816132cd565b80820281158282048414176106765761067661406c565b808201808211156106765761067661406c565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b600082614219577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b60008251613ccc81846020870161324c56fea164736f6c6343000818000a", +} + +var BurnMintTokenPoolAndProxyABI = BurnMintTokenPoolAndProxyMetaData.ABI + +var BurnMintTokenPoolAndProxyBin = BurnMintTokenPoolAndProxyMetaData.Bin + +func DeployBurnMintTokenPoolAndProxy(auth *bind.TransactOpts, backend bind.ContractBackend, token common.Address, allowlist []common.Address, rmnProxy common.Address, router common.Address) (common.Address, *types.Transaction, *BurnMintTokenPoolAndProxy, error) { + parsed, err := BurnMintTokenPoolAndProxyMetaData.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(BurnMintTokenPoolAndProxyBin), backend, token, allowlist, rmnProxy, router) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &BurnMintTokenPoolAndProxy{address: address, abi: *parsed, BurnMintTokenPoolAndProxyCaller: BurnMintTokenPoolAndProxyCaller{contract: contract}, BurnMintTokenPoolAndProxyTransactor: BurnMintTokenPoolAndProxyTransactor{contract: contract}, BurnMintTokenPoolAndProxyFilterer: BurnMintTokenPoolAndProxyFilterer{contract: contract}}, nil +} + +type BurnMintTokenPoolAndProxy struct { + address common.Address + abi abi.ABI + BurnMintTokenPoolAndProxyCaller + BurnMintTokenPoolAndProxyTransactor + BurnMintTokenPoolAndProxyFilterer +} + +type BurnMintTokenPoolAndProxyCaller struct { + contract *bind.BoundContract +} + +type BurnMintTokenPoolAndProxyTransactor struct { + contract *bind.BoundContract +} + +type BurnMintTokenPoolAndProxyFilterer struct { + contract *bind.BoundContract +} + +type BurnMintTokenPoolAndProxySession struct { + Contract *BurnMintTokenPoolAndProxy + CallOpts bind.CallOpts + TransactOpts bind.TransactOpts +} + +type BurnMintTokenPoolAndProxyCallerSession struct { + Contract *BurnMintTokenPoolAndProxyCaller + CallOpts bind.CallOpts +} + +type BurnMintTokenPoolAndProxyTransactorSession struct { + Contract *BurnMintTokenPoolAndProxyTransactor + TransactOpts bind.TransactOpts +} + +type BurnMintTokenPoolAndProxyRaw struct { + Contract *BurnMintTokenPoolAndProxy +} + +type BurnMintTokenPoolAndProxyCallerRaw struct { + Contract *BurnMintTokenPoolAndProxyCaller +} + +type BurnMintTokenPoolAndProxyTransactorRaw struct { + Contract *BurnMintTokenPoolAndProxyTransactor +} + +func NewBurnMintTokenPoolAndProxy(address common.Address, backend bind.ContractBackend) (*BurnMintTokenPoolAndProxy, error) { + abi, err := abi.JSON(strings.NewReader(BurnMintTokenPoolAndProxyABI)) + if err != nil { + return nil, err + } + contract, err := bindBurnMintTokenPoolAndProxy(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &BurnMintTokenPoolAndProxy{address: address, abi: abi, BurnMintTokenPoolAndProxyCaller: BurnMintTokenPoolAndProxyCaller{contract: contract}, BurnMintTokenPoolAndProxyTransactor: BurnMintTokenPoolAndProxyTransactor{contract: contract}, BurnMintTokenPoolAndProxyFilterer: BurnMintTokenPoolAndProxyFilterer{contract: contract}}, nil +} + +func NewBurnMintTokenPoolAndProxyCaller(address common.Address, caller bind.ContractCaller) (*BurnMintTokenPoolAndProxyCaller, error) { + contract, err := bindBurnMintTokenPoolAndProxy(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &BurnMintTokenPoolAndProxyCaller{contract: contract}, nil +} + +func NewBurnMintTokenPoolAndProxyTransactor(address common.Address, transactor bind.ContractTransactor) (*BurnMintTokenPoolAndProxyTransactor, error) { + contract, err := bindBurnMintTokenPoolAndProxy(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &BurnMintTokenPoolAndProxyTransactor{contract: contract}, nil +} + +func NewBurnMintTokenPoolAndProxyFilterer(address common.Address, filterer bind.ContractFilterer) (*BurnMintTokenPoolAndProxyFilterer, error) { + contract, err := bindBurnMintTokenPoolAndProxy(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &BurnMintTokenPoolAndProxyFilterer{contract: contract}, nil +} + +func bindBurnMintTokenPoolAndProxy(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := BurnMintTokenPoolAndProxyMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _BurnMintTokenPoolAndProxy.Contract.BurnMintTokenPoolAndProxyCaller.contract.Call(opts, result, method, params...) +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _BurnMintTokenPoolAndProxy.Contract.BurnMintTokenPoolAndProxyTransactor.contract.Transfer(opts) +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _BurnMintTokenPoolAndProxy.Contract.BurnMintTokenPoolAndProxyTransactor.contract.Transact(opts, method, params...) +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _BurnMintTokenPoolAndProxy.Contract.contract.Call(opts, result, method, params...) +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _BurnMintTokenPoolAndProxy.Contract.contract.Transfer(opts) +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _BurnMintTokenPoolAndProxy.Contract.contract.Transact(opts, method, params...) +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyCaller) GetAllowList(opts *bind.CallOpts) ([]common.Address, error) { + var out []interface{} + err := _BurnMintTokenPoolAndProxy.contract.Call(opts, &out, "getAllowList") + + if err != nil { + return *new([]common.Address), err + } + + out0 := *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) + + return out0, err + +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxySession) GetAllowList() ([]common.Address, error) { + return _BurnMintTokenPoolAndProxy.Contract.GetAllowList(&_BurnMintTokenPoolAndProxy.CallOpts) +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyCallerSession) GetAllowList() ([]common.Address, error) { + return _BurnMintTokenPoolAndProxy.Contract.GetAllowList(&_BurnMintTokenPoolAndProxy.CallOpts) +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyCaller) GetAllowListEnabled(opts *bind.CallOpts) (bool, error) { + var out []interface{} + err := _BurnMintTokenPoolAndProxy.contract.Call(opts, &out, "getAllowListEnabled") + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxySession) GetAllowListEnabled() (bool, error) { + return _BurnMintTokenPoolAndProxy.Contract.GetAllowListEnabled(&_BurnMintTokenPoolAndProxy.CallOpts) +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyCallerSession) GetAllowListEnabled() (bool, error) { + return _BurnMintTokenPoolAndProxy.Contract.GetAllowListEnabled(&_BurnMintTokenPoolAndProxy.CallOpts) +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyCaller) GetCurrentInboundRateLimiterState(opts *bind.CallOpts, remoteChainSelector uint64) (RateLimiterTokenBucket, error) { + var out []interface{} + err := _BurnMintTokenPoolAndProxy.contract.Call(opts, &out, "getCurrentInboundRateLimiterState", remoteChainSelector) + + if err != nil { + return *new(RateLimiterTokenBucket), err + } + + out0 := *abi.ConvertType(out[0], new(RateLimiterTokenBucket)).(*RateLimiterTokenBucket) + + return out0, err + +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxySession) GetCurrentInboundRateLimiterState(remoteChainSelector uint64) (RateLimiterTokenBucket, error) { + return _BurnMintTokenPoolAndProxy.Contract.GetCurrentInboundRateLimiterState(&_BurnMintTokenPoolAndProxy.CallOpts, remoteChainSelector) +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyCallerSession) GetCurrentInboundRateLimiterState(remoteChainSelector uint64) (RateLimiterTokenBucket, error) { + return _BurnMintTokenPoolAndProxy.Contract.GetCurrentInboundRateLimiterState(&_BurnMintTokenPoolAndProxy.CallOpts, remoteChainSelector) +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyCaller) GetCurrentOutboundRateLimiterState(opts *bind.CallOpts, remoteChainSelector uint64) (RateLimiterTokenBucket, error) { + var out []interface{} + err := _BurnMintTokenPoolAndProxy.contract.Call(opts, &out, "getCurrentOutboundRateLimiterState", remoteChainSelector) + + if err != nil { + return *new(RateLimiterTokenBucket), err + } + + out0 := *abi.ConvertType(out[0], new(RateLimiterTokenBucket)).(*RateLimiterTokenBucket) + + return out0, err + +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxySession) GetCurrentOutboundRateLimiterState(remoteChainSelector uint64) (RateLimiterTokenBucket, error) { + return _BurnMintTokenPoolAndProxy.Contract.GetCurrentOutboundRateLimiterState(&_BurnMintTokenPoolAndProxy.CallOpts, remoteChainSelector) +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyCallerSession) GetCurrentOutboundRateLimiterState(remoteChainSelector uint64) (RateLimiterTokenBucket, error) { + return _BurnMintTokenPoolAndProxy.Contract.GetCurrentOutboundRateLimiterState(&_BurnMintTokenPoolAndProxy.CallOpts, remoteChainSelector) +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyCaller) GetOnRamp(opts *bind.CallOpts, arg0 uint64) (common.Address, error) { + var out []interface{} + err := _BurnMintTokenPoolAndProxy.contract.Call(opts, &out, "getOnRamp", arg0) + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxySession) GetOnRamp(arg0 uint64) (common.Address, error) { + return _BurnMintTokenPoolAndProxy.Contract.GetOnRamp(&_BurnMintTokenPoolAndProxy.CallOpts, arg0) +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyCallerSession) GetOnRamp(arg0 uint64) (common.Address, error) { + return _BurnMintTokenPoolAndProxy.Contract.GetOnRamp(&_BurnMintTokenPoolAndProxy.CallOpts, arg0) +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyCaller) GetPreviousPool(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _BurnMintTokenPoolAndProxy.contract.Call(opts, &out, "getPreviousPool") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxySession) GetPreviousPool() (common.Address, error) { + return _BurnMintTokenPoolAndProxy.Contract.GetPreviousPool(&_BurnMintTokenPoolAndProxy.CallOpts) +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyCallerSession) GetPreviousPool() (common.Address, error) { + return _BurnMintTokenPoolAndProxy.Contract.GetPreviousPool(&_BurnMintTokenPoolAndProxy.CallOpts) +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyCaller) GetRateLimitAdmin(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _BurnMintTokenPoolAndProxy.contract.Call(opts, &out, "getRateLimitAdmin") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxySession) GetRateLimitAdmin() (common.Address, error) { + return _BurnMintTokenPoolAndProxy.Contract.GetRateLimitAdmin(&_BurnMintTokenPoolAndProxy.CallOpts) +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyCallerSession) GetRateLimitAdmin() (common.Address, error) { + return _BurnMintTokenPoolAndProxy.Contract.GetRateLimitAdmin(&_BurnMintTokenPoolAndProxy.CallOpts) +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyCaller) GetRemotePool(opts *bind.CallOpts, remoteChainSelector uint64) ([]byte, error) { + var out []interface{} + err := _BurnMintTokenPoolAndProxy.contract.Call(opts, &out, "getRemotePool", remoteChainSelector) + + if err != nil { + return *new([]byte), err + } + + out0 := *abi.ConvertType(out[0], new([]byte)).(*[]byte) + + return out0, err + +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxySession) GetRemotePool(remoteChainSelector uint64) ([]byte, error) { + return _BurnMintTokenPoolAndProxy.Contract.GetRemotePool(&_BurnMintTokenPoolAndProxy.CallOpts, remoteChainSelector) +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyCallerSession) GetRemotePool(remoteChainSelector uint64) ([]byte, error) { + return _BurnMintTokenPoolAndProxy.Contract.GetRemotePool(&_BurnMintTokenPoolAndProxy.CallOpts, remoteChainSelector) +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyCaller) GetRemoteToken(opts *bind.CallOpts, remoteChainSelector uint64) ([]byte, error) { + var out []interface{} + err := _BurnMintTokenPoolAndProxy.contract.Call(opts, &out, "getRemoteToken", remoteChainSelector) + + if err != nil { + return *new([]byte), err + } + + out0 := *abi.ConvertType(out[0], new([]byte)).(*[]byte) + + return out0, err + +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxySession) GetRemoteToken(remoteChainSelector uint64) ([]byte, error) { + return _BurnMintTokenPoolAndProxy.Contract.GetRemoteToken(&_BurnMintTokenPoolAndProxy.CallOpts, remoteChainSelector) +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyCallerSession) GetRemoteToken(remoteChainSelector uint64) ([]byte, error) { + return _BurnMintTokenPoolAndProxy.Contract.GetRemoteToken(&_BurnMintTokenPoolAndProxy.CallOpts, remoteChainSelector) +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyCaller) GetRmnProxy(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _BurnMintTokenPoolAndProxy.contract.Call(opts, &out, "getRmnProxy") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxySession) GetRmnProxy() (common.Address, error) { + return _BurnMintTokenPoolAndProxy.Contract.GetRmnProxy(&_BurnMintTokenPoolAndProxy.CallOpts) +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyCallerSession) GetRmnProxy() (common.Address, error) { + return _BurnMintTokenPoolAndProxy.Contract.GetRmnProxy(&_BurnMintTokenPoolAndProxy.CallOpts) +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyCaller) GetRouter(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _BurnMintTokenPoolAndProxy.contract.Call(opts, &out, "getRouter") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxySession) GetRouter() (common.Address, error) { + return _BurnMintTokenPoolAndProxy.Contract.GetRouter(&_BurnMintTokenPoolAndProxy.CallOpts) +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyCallerSession) GetRouter() (common.Address, error) { + return _BurnMintTokenPoolAndProxy.Contract.GetRouter(&_BurnMintTokenPoolAndProxy.CallOpts) +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyCaller) GetSupportedChains(opts *bind.CallOpts) ([]uint64, error) { + var out []interface{} + err := _BurnMintTokenPoolAndProxy.contract.Call(opts, &out, "getSupportedChains") + + if err != nil { + return *new([]uint64), err + } + + out0 := *abi.ConvertType(out[0], new([]uint64)).(*[]uint64) + + return out0, err + +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxySession) GetSupportedChains() ([]uint64, error) { + return _BurnMintTokenPoolAndProxy.Contract.GetSupportedChains(&_BurnMintTokenPoolAndProxy.CallOpts) +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyCallerSession) GetSupportedChains() ([]uint64, error) { + return _BurnMintTokenPoolAndProxy.Contract.GetSupportedChains(&_BurnMintTokenPoolAndProxy.CallOpts) +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyCaller) GetToken(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _BurnMintTokenPoolAndProxy.contract.Call(opts, &out, "getToken") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxySession) GetToken() (common.Address, error) { + return _BurnMintTokenPoolAndProxy.Contract.GetToken(&_BurnMintTokenPoolAndProxy.CallOpts) +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyCallerSession) GetToken() (common.Address, error) { + return _BurnMintTokenPoolAndProxy.Contract.GetToken(&_BurnMintTokenPoolAndProxy.CallOpts) +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyCaller) IsOffRamp(opts *bind.CallOpts, sourceChainSelector uint64, offRamp common.Address) (bool, error) { + var out []interface{} + err := _BurnMintTokenPoolAndProxy.contract.Call(opts, &out, "isOffRamp", sourceChainSelector, offRamp) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxySession) IsOffRamp(sourceChainSelector uint64, offRamp common.Address) (bool, error) { + return _BurnMintTokenPoolAndProxy.Contract.IsOffRamp(&_BurnMintTokenPoolAndProxy.CallOpts, sourceChainSelector, offRamp) +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyCallerSession) IsOffRamp(sourceChainSelector uint64, offRamp common.Address) (bool, error) { + return _BurnMintTokenPoolAndProxy.Contract.IsOffRamp(&_BurnMintTokenPoolAndProxy.CallOpts, sourceChainSelector, offRamp) +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyCaller) IsSupportedChain(opts *bind.CallOpts, remoteChainSelector uint64) (bool, error) { + var out []interface{} + err := _BurnMintTokenPoolAndProxy.contract.Call(opts, &out, "isSupportedChain", remoteChainSelector) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxySession) IsSupportedChain(remoteChainSelector uint64) (bool, error) { + return _BurnMintTokenPoolAndProxy.Contract.IsSupportedChain(&_BurnMintTokenPoolAndProxy.CallOpts, remoteChainSelector) +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyCallerSession) IsSupportedChain(remoteChainSelector uint64) (bool, error) { + return _BurnMintTokenPoolAndProxy.Contract.IsSupportedChain(&_BurnMintTokenPoolAndProxy.CallOpts, remoteChainSelector) +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyCaller) IsSupportedToken(opts *bind.CallOpts, token common.Address) (bool, error) { + var out []interface{} + err := _BurnMintTokenPoolAndProxy.contract.Call(opts, &out, "isSupportedToken", token) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxySession) IsSupportedToken(token common.Address) (bool, error) { + return _BurnMintTokenPoolAndProxy.Contract.IsSupportedToken(&_BurnMintTokenPoolAndProxy.CallOpts, token) +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyCallerSession) IsSupportedToken(token common.Address) (bool, error) { + return _BurnMintTokenPoolAndProxy.Contract.IsSupportedToken(&_BurnMintTokenPoolAndProxy.CallOpts, token) +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyCaller) Owner(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _BurnMintTokenPoolAndProxy.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 + +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxySession) Owner() (common.Address, error) { + return _BurnMintTokenPoolAndProxy.Contract.Owner(&_BurnMintTokenPoolAndProxy.CallOpts) +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyCallerSession) Owner() (common.Address, error) { + return _BurnMintTokenPoolAndProxy.Contract.Owner(&_BurnMintTokenPoolAndProxy.CallOpts) +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyCaller) SupportsInterface(opts *bind.CallOpts, interfaceId [4]byte) (bool, error) { + var out []interface{} + err := _BurnMintTokenPoolAndProxy.contract.Call(opts, &out, "supportsInterface", interfaceId) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxySession) SupportsInterface(interfaceId [4]byte) (bool, error) { + return _BurnMintTokenPoolAndProxy.Contract.SupportsInterface(&_BurnMintTokenPoolAndProxy.CallOpts, interfaceId) +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyCallerSession) SupportsInterface(interfaceId [4]byte) (bool, error) { + return _BurnMintTokenPoolAndProxy.Contract.SupportsInterface(&_BurnMintTokenPoolAndProxy.CallOpts, interfaceId) +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyCaller) TypeAndVersion(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _BurnMintTokenPoolAndProxy.contract.Call(opts, &out, "typeAndVersion") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxySession) TypeAndVersion() (string, error) { + return _BurnMintTokenPoolAndProxy.Contract.TypeAndVersion(&_BurnMintTokenPoolAndProxy.CallOpts) +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyCallerSession) TypeAndVersion() (string, error) { + return _BurnMintTokenPoolAndProxy.Contract.TypeAndVersion(&_BurnMintTokenPoolAndProxy.CallOpts) +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyTransactor) AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + return _BurnMintTokenPoolAndProxy.contract.Transact(opts, "acceptOwnership") +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxySession) AcceptOwnership() (*types.Transaction, error) { + return _BurnMintTokenPoolAndProxy.Contract.AcceptOwnership(&_BurnMintTokenPoolAndProxy.TransactOpts) +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyTransactorSession) AcceptOwnership() (*types.Transaction, error) { + return _BurnMintTokenPoolAndProxy.Contract.AcceptOwnership(&_BurnMintTokenPoolAndProxy.TransactOpts) +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyTransactor) ApplyAllowListUpdates(opts *bind.TransactOpts, removes []common.Address, adds []common.Address) (*types.Transaction, error) { + return _BurnMintTokenPoolAndProxy.contract.Transact(opts, "applyAllowListUpdates", removes, adds) +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxySession) ApplyAllowListUpdates(removes []common.Address, adds []common.Address) (*types.Transaction, error) { + return _BurnMintTokenPoolAndProxy.Contract.ApplyAllowListUpdates(&_BurnMintTokenPoolAndProxy.TransactOpts, removes, adds) +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyTransactorSession) ApplyAllowListUpdates(removes []common.Address, adds []common.Address) (*types.Transaction, error) { + return _BurnMintTokenPoolAndProxy.Contract.ApplyAllowListUpdates(&_BurnMintTokenPoolAndProxy.TransactOpts, removes, adds) +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyTransactor) ApplyChainUpdates(opts *bind.TransactOpts, chains []TokenPoolChainUpdate) (*types.Transaction, error) { + return _BurnMintTokenPoolAndProxy.contract.Transact(opts, "applyChainUpdates", chains) +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxySession) ApplyChainUpdates(chains []TokenPoolChainUpdate) (*types.Transaction, error) { + return _BurnMintTokenPoolAndProxy.Contract.ApplyChainUpdates(&_BurnMintTokenPoolAndProxy.TransactOpts, chains) +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyTransactorSession) ApplyChainUpdates(chains []TokenPoolChainUpdate) (*types.Transaction, error) { + return _BurnMintTokenPoolAndProxy.Contract.ApplyChainUpdates(&_BurnMintTokenPoolAndProxy.TransactOpts, chains) +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyTransactor) LockOrBurn(opts *bind.TransactOpts, lockOrBurnIn PoolLockOrBurnInV1) (*types.Transaction, error) { + return _BurnMintTokenPoolAndProxy.contract.Transact(opts, "lockOrBurn", lockOrBurnIn) +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxySession) LockOrBurn(lockOrBurnIn PoolLockOrBurnInV1) (*types.Transaction, error) { + return _BurnMintTokenPoolAndProxy.Contract.LockOrBurn(&_BurnMintTokenPoolAndProxy.TransactOpts, lockOrBurnIn) +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyTransactorSession) LockOrBurn(lockOrBurnIn PoolLockOrBurnInV1) (*types.Transaction, error) { + return _BurnMintTokenPoolAndProxy.Contract.LockOrBurn(&_BurnMintTokenPoolAndProxy.TransactOpts, lockOrBurnIn) +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyTransactor) ReleaseOrMint(opts *bind.TransactOpts, releaseOrMintIn PoolReleaseOrMintInV1) (*types.Transaction, error) { + return _BurnMintTokenPoolAndProxy.contract.Transact(opts, "releaseOrMint", releaseOrMintIn) +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxySession) ReleaseOrMint(releaseOrMintIn PoolReleaseOrMintInV1) (*types.Transaction, error) { + return _BurnMintTokenPoolAndProxy.Contract.ReleaseOrMint(&_BurnMintTokenPoolAndProxy.TransactOpts, releaseOrMintIn) +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyTransactorSession) ReleaseOrMint(releaseOrMintIn PoolReleaseOrMintInV1) (*types.Transaction, error) { + return _BurnMintTokenPoolAndProxy.Contract.ReleaseOrMint(&_BurnMintTokenPoolAndProxy.TransactOpts, releaseOrMintIn) +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyTransactor) SetChainRateLimiterConfig(opts *bind.TransactOpts, remoteChainSelector uint64, outboundConfig RateLimiterConfig, inboundConfig RateLimiterConfig) (*types.Transaction, error) { + return _BurnMintTokenPoolAndProxy.contract.Transact(opts, "setChainRateLimiterConfig", remoteChainSelector, outboundConfig, inboundConfig) +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxySession) SetChainRateLimiterConfig(remoteChainSelector uint64, outboundConfig RateLimiterConfig, inboundConfig RateLimiterConfig) (*types.Transaction, error) { + return _BurnMintTokenPoolAndProxy.Contract.SetChainRateLimiterConfig(&_BurnMintTokenPoolAndProxy.TransactOpts, remoteChainSelector, outboundConfig, inboundConfig) +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyTransactorSession) SetChainRateLimiterConfig(remoteChainSelector uint64, outboundConfig RateLimiterConfig, inboundConfig RateLimiterConfig) (*types.Transaction, error) { + return _BurnMintTokenPoolAndProxy.Contract.SetChainRateLimiterConfig(&_BurnMintTokenPoolAndProxy.TransactOpts, remoteChainSelector, outboundConfig, inboundConfig) +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyTransactor) SetPreviousPool(opts *bind.TransactOpts, prevPool common.Address) (*types.Transaction, error) { + return _BurnMintTokenPoolAndProxy.contract.Transact(opts, "setPreviousPool", prevPool) +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxySession) SetPreviousPool(prevPool common.Address) (*types.Transaction, error) { + return _BurnMintTokenPoolAndProxy.Contract.SetPreviousPool(&_BurnMintTokenPoolAndProxy.TransactOpts, prevPool) +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyTransactorSession) SetPreviousPool(prevPool common.Address) (*types.Transaction, error) { + return _BurnMintTokenPoolAndProxy.Contract.SetPreviousPool(&_BurnMintTokenPoolAndProxy.TransactOpts, prevPool) +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyTransactor) SetRateLimitAdmin(opts *bind.TransactOpts, rateLimitAdmin common.Address) (*types.Transaction, error) { + return _BurnMintTokenPoolAndProxy.contract.Transact(opts, "setRateLimitAdmin", rateLimitAdmin) +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxySession) SetRateLimitAdmin(rateLimitAdmin common.Address) (*types.Transaction, error) { + return _BurnMintTokenPoolAndProxy.Contract.SetRateLimitAdmin(&_BurnMintTokenPoolAndProxy.TransactOpts, rateLimitAdmin) +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyTransactorSession) SetRateLimitAdmin(rateLimitAdmin common.Address) (*types.Transaction, error) { + return _BurnMintTokenPoolAndProxy.Contract.SetRateLimitAdmin(&_BurnMintTokenPoolAndProxy.TransactOpts, rateLimitAdmin) +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyTransactor) SetRemotePool(opts *bind.TransactOpts, remoteChainSelector uint64, remotePoolAddress []byte) (*types.Transaction, error) { + return _BurnMintTokenPoolAndProxy.contract.Transact(opts, "setRemotePool", remoteChainSelector, remotePoolAddress) +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxySession) SetRemotePool(remoteChainSelector uint64, remotePoolAddress []byte) (*types.Transaction, error) { + return _BurnMintTokenPoolAndProxy.Contract.SetRemotePool(&_BurnMintTokenPoolAndProxy.TransactOpts, remoteChainSelector, remotePoolAddress) +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyTransactorSession) SetRemotePool(remoteChainSelector uint64, remotePoolAddress []byte) (*types.Transaction, error) { + return _BurnMintTokenPoolAndProxy.Contract.SetRemotePool(&_BurnMintTokenPoolAndProxy.TransactOpts, remoteChainSelector, remotePoolAddress) +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyTransactor) SetRouter(opts *bind.TransactOpts, newRouter common.Address) (*types.Transaction, error) { + return _BurnMintTokenPoolAndProxy.contract.Transact(opts, "setRouter", newRouter) +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxySession) SetRouter(newRouter common.Address) (*types.Transaction, error) { + return _BurnMintTokenPoolAndProxy.Contract.SetRouter(&_BurnMintTokenPoolAndProxy.TransactOpts, newRouter) +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyTransactorSession) SetRouter(newRouter common.Address) (*types.Transaction, error) { + return _BurnMintTokenPoolAndProxy.Contract.SetRouter(&_BurnMintTokenPoolAndProxy.TransactOpts, newRouter) +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyTransactor) TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) { + return _BurnMintTokenPoolAndProxy.contract.Transact(opts, "transferOwnership", to) +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxySession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _BurnMintTokenPoolAndProxy.Contract.TransferOwnership(&_BurnMintTokenPoolAndProxy.TransactOpts, to) +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyTransactorSession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _BurnMintTokenPoolAndProxy.Contract.TransferOwnership(&_BurnMintTokenPoolAndProxy.TransactOpts, to) +} + +type BurnMintTokenPoolAndProxyAllowListAddIterator struct { + Event *BurnMintTokenPoolAndProxyAllowListAdd + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *BurnMintTokenPoolAndProxyAllowListAddIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolAndProxyAllowListAdd) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolAndProxyAllowListAdd) + 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() + } +} + +func (it *BurnMintTokenPoolAndProxyAllowListAddIterator) Error() error { + return it.fail +} + +func (it *BurnMintTokenPoolAndProxyAllowListAddIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type BurnMintTokenPoolAndProxyAllowListAdd struct { + Sender common.Address + Raw types.Log +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyFilterer) FilterAllowListAdd(opts *bind.FilterOpts) (*BurnMintTokenPoolAndProxyAllowListAddIterator, error) { + + logs, sub, err := _BurnMintTokenPoolAndProxy.contract.FilterLogs(opts, "AllowListAdd") + if err != nil { + return nil, err + } + return &BurnMintTokenPoolAndProxyAllowListAddIterator{contract: _BurnMintTokenPoolAndProxy.contract, event: "AllowListAdd", logs: logs, sub: sub}, nil +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyFilterer) WatchAllowListAdd(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolAndProxyAllowListAdd) (event.Subscription, error) { + + logs, sub, err := _BurnMintTokenPoolAndProxy.contract.WatchLogs(opts, "AllowListAdd") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(BurnMintTokenPoolAndProxyAllowListAdd) + if err := _BurnMintTokenPoolAndProxy.contract.UnpackLog(event, "AllowListAdd", 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 +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyFilterer) ParseAllowListAdd(log types.Log) (*BurnMintTokenPoolAndProxyAllowListAdd, error) { + event := new(BurnMintTokenPoolAndProxyAllowListAdd) + if err := _BurnMintTokenPoolAndProxy.contract.UnpackLog(event, "AllowListAdd", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type BurnMintTokenPoolAndProxyAllowListRemoveIterator struct { + Event *BurnMintTokenPoolAndProxyAllowListRemove + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *BurnMintTokenPoolAndProxyAllowListRemoveIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolAndProxyAllowListRemove) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolAndProxyAllowListRemove) + 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() + } +} + +func (it *BurnMintTokenPoolAndProxyAllowListRemoveIterator) Error() error { + return it.fail +} + +func (it *BurnMintTokenPoolAndProxyAllowListRemoveIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type BurnMintTokenPoolAndProxyAllowListRemove struct { + Sender common.Address + Raw types.Log +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyFilterer) FilterAllowListRemove(opts *bind.FilterOpts) (*BurnMintTokenPoolAndProxyAllowListRemoveIterator, error) { + + logs, sub, err := _BurnMintTokenPoolAndProxy.contract.FilterLogs(opts, "AllowListRemove") + if err != nil { + return nil, err + } + return &BurnMintTokenPoolAndProxyAllowListRemoveIterator{contract: _BurnMintTokenPoolAndProxy.contract, event: "AllowListRemove", logs: logs, sub: sub}, nil +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyFilterer) WatchAllowListRemove(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolAndProxyAllowListRemove) (event.Subscription, error) { + + logs, sub, err := _BurnMintTokenPoolAndProxy.contract.WatchLogs(opts, "AllowListRemove") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(BurnMintTokenPoolAndProxyAllowListRemove) + if err := _BurnMintTokenPoolAndProxy.contract.UnpackLog(event, "AllowListRemove", 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 +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyFilterer) ParseAllowListRemove(log types.Log) (*BurnMintTokenPoolAndProxyAllowListRemove, error) { + event := new(BurnMintTokenPoolAndProxyAllowListRemove) + if err := _BurnMintTokenPoolAndProxy.contract.UnpackLog(event, "AllowListRemove", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type BurnMintTokenPoolAndProxyBurnedIterator struct { + Event *BurnMintTokenPoolAndProxyBurned + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *BurnMintTokenPoolAndProxyBurnedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolAndProxyBurned) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolAndProxyBurned) + 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() + } +} + +func (it *BurnMintTokenPoolAndProxyBurnedIterator) Error() error { + return it.fail +} + +func (it *BurnMintTokenPoolAndProxyBurnedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type BurnMintTokenPoolAndProxyBurned struct { + Sender common.Address + Amount *big.Int + Raw types.Log +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyFilterer) FilterBurned(opts *bind.FilterOpts, sender []common.Address) (*BurnMintTokenPoolAndProxyBurnedIterator, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _BurnMintTokenPoolAndProxy.contract.FilterLogs(opts, "Burned", senderRule) + if err != nil { + return nil, err + } + return &BurnMintTokenPoolAndProxyBurnedIterator{contract: _BurnMintTokenPoolAndProxy.contract, event: "Burned", logs: logs, sub: sub}, nil +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyFilterer) WatchBurned(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolAndProxyBurned, sender []common.Address) (event.Subscription, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _BurnMintTokenPoolAndProxy.contract.WatchLogs(opts, "Burned", senderRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(BurnMintTokenPoolAndProxyBurned) + if err := _BurnMintTokenPoolAndProxy.contract.UnpackLog(event, "Burned", 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 +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyFilterer) ParseBurned(log types.Log) (*BurnMintTokenPoolAndProxyBurned, error) { + event := new(BurnMintTokenPoolAndProxyBurned) + if err := _BurnMintTokenPoolAndProxy.contract.UnpackLog(event, "Burned", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type BurnMintTokenPoolAndProxyChainAddedIterator struct { + Event *BurnMintTokenPoolAndProxyChainAdded + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *BurnMintTokenPoolAndProxyChainAddedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolAndProxyChainAdded) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolAndProxyChainAdded) + 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() + } +} + +func (it *BurnMintTokenPoolAndProxyChainAddedIterator) Error() error { + return it.fail +} + +func (it *BurnMintTokenPoolAndProxyChainAddedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type BurnMintTokenPoolAndProxyChainAdded struct { + RemoteChainSelector uint64 + RemoteToken []byte + OutboundRateLimiterConfig RateLimiterConfig + InboundRateLimiterConfig RateLimiterConfig + Raw types.Log +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyFilterer) FilterChainAdded(opts *bind.FilterOpts) (*BurnMintTokenPoolAndProxyChainAddedIterator, error) { + + logs, sub, err := _BurnMintTokenPoolAndProxy.contract.FilterLogs(opts, "ChainAdded") + if err != nil { + return nil, err + } + return &BurnMintTokenPoolAndProxyChainAddedIterator{contract: _BurnMintTokenPoolAndProxy.contract, event: "ChainAdded", logs: logs, sub: sub}, nil +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyFilterer) WatchChainAdded(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolAndProxyChainAdded) (event.Subscription, error) { + + logs, sub, err := _BurnMintTokenPoolAndProxy.contract.WatchLogs(opts, "ChainAdded") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(BurnMintTokenPoolAndProxyChainAdded) + if err := _BurnMintTokenPoolAndProxy.contract.UnpackLog(event, "ChainAdded", 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 +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyFilterer) ParseChainAdded(log types.Log) (*BurnMintTokenPoolAndProxyChainAdded, error) { + event := new(BurnMintTokenPoolAndProxyChainAdded) + if err := _BurnMintTokenPoolAndProxy.contract.UnpackLog(event, "ChainAdded", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type BurnMintTokenPoolAndProxyChainConfiguredIterator struct { + Event *BurnMintTokenPoolAndProxyChainConfigured + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *BurnMintTokenPoolAndProxyChainConfiguredIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolAndProxyChainConfigured) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolAndProxyChainConfigured) + 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() + } +} + +func (it *BurnMintTokenPoolAndProxyChainConfiguredIterator) Error() error { + return it.fail +} + +func (it *BurnMintTokenPoolAndProxyChainConfiguredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type BurnMintTokenPoolAndProxyChainConfigured struct { + RemoteChainSelector uint64 + OutboundRateLimiterConfig RateLimiterConfig + InboundRateLimiterConfig RateLimiterConfig + Raw types.Log +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyFilterer) FilterChainConfigured(opts *bind.FilterOpts) (*BurnMintTokenPoolAndProxyChainConfiguredIterator, error) { + + logs, sub, err := _BurnMintTokenPoolAndProxy.contract.FilterLogs(opts, "ChainConfigured") + if err != nil { + return nil, err + } + return &BurnMintTokenPoolAndProxyChainConfiguredIterator{contract: _BurnMintTokenPoolAndProxy.contract, event: "ChainConfigured", logs: logs, sub: sub}, nil +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyFilterer) WatchChainConfigured(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolAndProxyChainConfigured) (event.Subscription, error) { + + logs, sub, err := _BurnMintTokenPoolAndProxy.contract.WatchLogs(opts, "ChainConfigured") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(BurnMintTokenPoolAndProxyChainConfigured) + if err := _BurnMintTokenPoolAndProxy.contract.UnpackLog(event, "ChainConfigured", 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 +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyFilterer) ParseChainConfigured(log types.Log) (*BurnMintTokenPoolAndProxyChainConfigured, error) { + event := new(BurnMintTokenPoolAndProxyChainConfigured) + if err := _BurnMintTokenPoolAndProxy.contract.UnpackLog(event, "ChainConfigured", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type BurnMintTokenPoolAndProxyChainRemovedIterator struct { + Event *BurnMintTokenPoolAndProxyChainRemoved + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *BurnMintTokenPoolAndProxyChainRemovedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolAndProxyChainRemoved) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolAndProxyChainRemoved) + 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() + } +} + +func (it *BurnMintTokenPoolAndProxyChainRemovedIterator) Error() error { + return it.fail +} + +func (it *BurnMintTokenPoolAndProxyChainRemovedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type BurnMintTokenPoolAndProxyChainRemoved struct { + RemoteChainSelector uint64 + Raw types.Log +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyFilterer) FilterChainRemoved(opts *bind.FilterOpts) (*BurnMintTokenPoolAndProxyChainRemovedIterator, error) { + + logs, sub, err := _BurnMintTokenPoolAndProxy.contract.FilterLogs(opts, "ChainRemoved") + if err != nil { + return nil, err + } + return &BurnMintTokenPoolAndProxyChainRemovedIterator{contract: _BurnMintTokenPoolAndProxy.contract, event: "ChainRemoved", logs: logs, sub: sub}, nil +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyFilterer) WatchChainRemoved(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolAndProxyChainRemoved) (event.Subscription, error) { + + logs, sub, err := _BurnMintTokenPoolAndProxy.contract.WatchLogs(opts, "ChainRemoved") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(BurnMintTokenPoolAndProxyChainRemoved) + if err := _BurnMintTokenPoolAndProxy.contract.UnpackLog(event, "ChainRemoved", 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 +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyFilterer) ParseChainRemoved(log types.Log) (*BurnMintTokenPoolAndProxyChainRemoved, error) { + event := new(BurnMintTokenPoolAndProxyChainRemoved) + if err := _BurnMintTokenPoolAndProxy.contract.UnpackLog(event, "ChainRemoved", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type BurnMintTokenPoolAndProxyConfigChangedIterator struct { + Event *BurnMintTokenPoolAndProxyConfigChanged + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *BurnMintTokenPoolAndProxyConfigChangedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolAndProxyConfigChanged) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolAndProxyConfigChanged) + 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() + } +} + +func (it *BurnMintTokenPoolAndProxyConfigChangedIterator) Error() error { + return it.fail +} + +func (it *BurnMintTokenPoolAndProxyConfigChangedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type BurnMintTokenPoolAndProxyConfigChanged struct { + Config RateLimiterConfig + Raw types.Log +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyFilterer) FilterConfigChanged(opts *bind.FilterOpts) (*BurnMintTokenPoolAndProxyConfigChangedIterator, error) { + + logs, sub, err := _BurnMintTokenPoolAndProxy.contract.FilterLogs(opts, "ConfigChanged") + if err != nil { + return nil, err + } + return &BurnMintTokenPoolAndProxyConfigChangedIterator{contract: _BurnMintTokenPoolAndProxy.contract, event: "ConfigChanged", logs: logs, sub: sub}, nil +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyFilterer) WatchConfigChanged(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolAndProxyConfigChanged) (event.Subscription, error) { + + logs, sub, err := _BurnMintTokenPoolAndProxy.contract.WatchLogs(opts, "ConfigChanged") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(BurnMintTokenPoolAndProxyConfigChanged) + if err := _BurnMintTokenPoolAndProxy.contract.UnpackLog(event, "ConfigChanged", 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 +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyFilterer) ParseConfigChanged(log types.Log) (*BurnMintTokenPoolAndProxyConfigChanged, error) { + event := new(BurnMintTokenPoolAndProxyConfigChanged) + if err := _BurnMintTokenPoolAndProxy.contract.UnpackLog(event, "ConfigChanged", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type BurnMintTokenPoolAndProxyLegacyPoolChangedIterator struct { + Event *BurnMintTokenPoolAndProxyLegacyPoolChanged + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *BurnMintTokenPoolAndProxyLegacyPoolChangedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolAndProxyLegacyPoolChanged) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolAndProxyLegacyPoolChanged) + 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() + } +} + +func (it *BurnMintTokenPoolAndProxyLegacyPoolChangedIterator) Error() error { + return it.fail +} + +func (it *BurnMintTokenPoolAndProxyLegacyPoolChangedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type BurnMintTokenPoolAndProxyLegacyPoolChanged struct { + OldPool common.Address + NewPool common.Address + Raw types.Log +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyFilterer) FilterLegacyPoolChanged(opts *bind.FilterOpts) (*BurnMintTokenPoolAndProxyLegacyPoolChangedIterator, error) { + + logs, sub, err := _BurnMintTokenPoolAndProxy.contract.FilterLogs(opts, "LegacyPoolChanged") + if err != nil { + return nil, err + } + return &BurnMintTokenPoolAndProxyLegacyPoolChangedIterator{contract: _BurnMintTokenPoolAndProxy.contract, event: "LegacyPoolChanged", logs: logs, sub: sub}, nil +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyFilterer) WatchLegacyPoolChanged(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolAndProxyLegacyPoolChanged) (event.Subscription, error) { + + logs, sub, err := _BurnMintTokenPoolAndProxy.contract.WatchLogs(opts, "LegacyPoolChanged") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(BurnMintTokenPoolAndProxyLegacyPoolChanged) + if err := _BurnMintTokenPoolAndProxy.contract.UnpackLog(event, "LegacyPoolChanged", 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 +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyFilterer) ParseLegacyPoolChanged(log types.Log) (*BurnMintTokenPoolAndProxyLegacyPoolChanged, error) { + event := new(BurnMintTokenPoolAndProxyLegacyPoolChanged) + if err := _BurnMintTokenPoolAndProxy.contract.UnpackLog(event, "LegacyPoolChanged", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type BurnMintTokenPoolAndProxyLockedIterator struct { + Event *BurnMintTokenPoolAndProxyLocked + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *BurnMintTokenPoolAndProxyLockedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolAndProxyLocked) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolAndProxyLocked) + 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() + } +} + +func (it *BurnMintTokenPoolAndProxyLockedIterator) Error() error { + return it.fail +} + +func (it *BurnMintTokenPoolAndProxyLockedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type BurnMintTokenPoolAndProxyLocked struct { + Sender common.Address + Amount *big.Int + Raw types.Log +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyFilterer) FilterLocked(opts *bind.FilterOpts, sender []common.Address) (*BurnMintTokenPoolAndProxyLockedIterator, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _BurnMintTokenPoolAndProxy.contract.FilterLogs(opts, "Locked", senderRule) + if err != nil { + return nil, err + } + return &BurnMintTokenPoolAndProxyLockedIterator{contract: _BurnMintTokenPoolAndProxy.contract, event: "Locked", logs: logs, sub: sub}, nil +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyFilterer) WatchLocked(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolAndProxyLocked, sender []common.Address) (event.Subscription, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _BurnMintTokenPoolAndProxy.contract.WatchLogs(opts, "Locked", senderRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(BurnMintTokenPoolAndProxyLocked) + if err := _BurnMintTokenPoolAndProxy.contract.UnpackLog(event, "Locked", 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 +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyFilterer) ParseLocked(log types.Log) (*BurnMintTokenPoolAndProxyLocked, error) { + event := new(BurnMintTokenPoolAndProxyLocked) + if err := _BurnMintTokenPoolAndProxy.contract.UnpackLog(event, "Locked", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type BurnMintTokenPoolAndProxyMintedIterator struct { + Event *BurnMintTokenPoolAndProxyMinted + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *BurnMintTokenPoolAndProxyMintedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolAndProxyMinted) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolAndProxyMinted) + 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() + } +} + +func (it *BurnMintTokenPoolAndProxyMintedIterator) Error() error { + return it.fail +} + +func (it *BurnMintTokenPoolAndProxyMintedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type BurnMintTokenPoolAndProxyMinted struct { + Sender common.Address + Recipient common.Address + Amount *big.Int + Raw types.Log +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyFilterer) FilterMinted(opts *bind.FilterOpts, sender []common.Address, recipient []common.Address) (*BurnMintTokenPoolAndProxyMintedIterator, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + var recipientRule []interface{} + for _, recipientItem := range recipient { + recipientRule = append(recipientRule, recipientItem) + } + + logs, sub, err := _BurnMintTokenPoolAndProxy.contract.FilterLogs(opts, "Minted", senderRule, recipientRule) + if err != nil { + return nil, err + } + return &BurnMintTokenPoolAndProxyMintedIterator{contract: _BurnMintTokenPoolAndProxy.contract, event: "Minted", logs: logs, sub: sub}, nil +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyFilterer) WatchMinted(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolAndProxyMinted, sender []common.Address, recipient []common.Address) (event.Subscription, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + var recipientRule []interface{} + for _, recipientItem := range recipient { + recipientRule = append(recipientRule, recipientItem) + } + + logs, sub, err := _BurnMintTokenPoolAndProxy.contract.WatchLogs(opts, "Minted", senderRule, recipientRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(BurnMintTokenPoolAndProxyMinted) + if err := _BurnMintTokenPoolAndProxy.contract.UnpackLog(event, "Minted", 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 +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyFilterer) ParseMinted(log types.Log) (*BurnMintTokenPoolAndProxyMinted, error) { + event := new(BurnMintTokenPoolAndProxyMinted) + if err := _BurnMintTokenPoolAndProxy.contract.UnpackLog(event, "Minted", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type BurnMintTokenPoolAndProxyOwnershipTransferRequestedIterator struct { + Event *BurnMintTokenPoolAndProxyOwnershipTransferRequested + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *BurnMintTokenPoolAndProxyOwnershipTransferRequestedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolAndProxyOwnershipTransferRequested) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolAndProxyOwnershipTransferRequested) + 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() + } +} + +func (it *BurnMintTokenPoolAndProxyOwnershipTransferRequestedIterator) Error() error { + return it.fail +} + +func (it *BurnMintTokenPoolAndProxyOwnershipTransferRequestedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type BurnMintTokenPoolAndProxyOwnershipTransferRequested struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyFilterer) FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*BurnMintTokenPoolAndProxyOwnershipTransferRequestedIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _BurnMintTokenPoolAndProxy.contract.FilterLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return &BurnMintTokenPoolAndProxyOwnershipTransferRequestedIterator{contract: _BurnMintTokenPoolAndProxy.contract, event: "OwnershipTransferRequested", logs: logs, sub: sub}, nil +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyFilterer) WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolAndProxyOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _BurnMintTokenPoolAndProxy.contract.WatchLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(BurnMintTokenPoolAndProxyOwnershipTransferRequested) + if err := _BurnMintTokenPoolAndProxy.contract.UnpackLog(event, "OwnershipTransferRequested", 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 +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyFilterer) ParseOwnershipTransferRequested(log types.Log) (*BurnMintTokenPoolAndProxyOwnershipTransferRequested, error) { + event := new(BurnMintTokenPoolAndProxyOwnershipTransferRequested) + if err := _BurnMintTokenPoolAndProxy.contract.UnpackLog(event, "OwnershipTransferRequested", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type BurnMintTokenPoolAndProxyOwnershipTransferredIterator struct { + Event *BurnMintTokenPoolAndProxyOwnershipTransferred + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *BurnMintTokenPoolAndProxyOwnershipTransferredIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolAndProxyOwnershipTransferred) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolAndProxyOwnershipTransferred) + 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() + } +} + +func (it *BurnMintTokenPoolAndProxyOwnershipTransferredIterator) Error() error { + return it.fail +} + +func (it *BurnMintTokenPoolAndProxyOwnershipTransferredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type BurnMintTokenPoolAndProxyOwnershipTransferred struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*BurnMintTokenPoolAndProxyOwnershipTransferredIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _BurnMintTokenPoolAndProxy.contract.FilterLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return &BurnMintTokenPoolAndProxyOwnershipTransferredIterator{contract: _BurnMintTokenPoolAndProxy.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolAndProxyOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _BurnMintTokenPoolAndProxy.contract.WatchLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(BurnMintTokenPoolAndProxyOwnershipTransferred) + if err := _BurnMintTokenPoolAndProxy.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 +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyFilterer) ParseOwnershipTransferred(log types.Log) (*BurnMintTokenPoolAndProxyOwnershipTransferred, error) { + event := new(BurnMintTokenPoolAndProxyOwnershipTransferred) + if err := _BurnMintTokenPoolAndProxy.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type BurnMintTokenPoolAndProxyReleasedIterator struct { + Event *BurnMintTokenPoolAndProxyReleased + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *BurnMintTokenPoolAndProxyReleasedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolAndProxyReleased) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolAndProxyReleased) + 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() + } +} + +func (it *BurnMintTokenPoolAndProxyReleasedIterator) Error() error { + return it.fail +} + +func (it *BurnMintTokenPoolAndProxyReleasedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type BurnMintTokenPoolAndProxyReleased struct { + Sender common.Address + Recipient common.Address + Amount *big.Int + Raw types.Log +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyFilterer) FilterReleased(opts *bind.FilterOpts, sender []common.Address, recipient []common.Address) (*BurnMintTokenPoolAndProxyReleasedIterator, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + var recipientRule []interface{} + for _, recipientItem := range recipient { + recipientRule = append(recipientRule, recipientItem) + } + + logs, sub, err := _BurnMintTokenPoolAndProxy.contract.FilterLogs(opts, "Released", senderRule, recipientRule) + if err != nil { + return nil, err + } + return &BurnMintTokenPoolAndProxyReleasedIterator{contract: _BurnMintTokenPoolAndProxy.contract, event: "Released", logs: logs, sub: sub}, nil +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyFilterer) WatchReleased(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolAndProxyReleased, sender []common.Address, recipient []common.Address) (event.Subscription, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + var recipientRule []interface{} + for _, recipientItem := range recipient { + recipientRule = append(recipientRule, recipientItem) + } + + logs, sub, err := _BurnMintTokenPoolAndProxy.contract.WatchLogs(opts, "Released", senderRule, recipientRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(BurnMintTokenPoolAndProxyReleased) + if err := _BurnMintTokenPoolAndProxy.contract.UnpackLog(event, "Released", 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 +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyFilterer) ParseReleased(log types.Log) (*BurnMintTokenPoolAndProxyReleased, error) { + event := new(BurnMintTokenPoolAndProxyReleased) + if err := _BurnMintTokenPoolAndProxy.contract.UnpackLog(event, "Released", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type BurnMintTokenPoolAndProxyRemotePoolSetIterator struct { + Event *BurnMintTokenPoolAndProxyRemotePoolSet + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *BurnMintTokenPoolAndProxyRemotePoolSetIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolAndProxyRemotePoolSet) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolAndProxyRemotePoolSet) + 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() + } +} + +func (it *BurnMintTokenPoolAndProxyRemotePoolSetIterator) Error() error { + return it.fail +} + +func (it *BurnMintTokenPoolAndProxyRemotePoolSetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type BurnMintTokenPoolAndProxyRemotePoolSet struct { + RemoteChainSelector uint64 + PreviousPoolAddress []byte + RemotePoolAddress []byte + Raw types.Log +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyFilterer) FilterRemotePoolSet(opts *bind.FilterOpts, remoteChainSelector []uint64) (*BurnMintTokenPoolAndProxyRemotePoolSetIterator, error) { + + var remoteChainSelectorRule []interface{} + for _, remoteChainSelectorItem := range remoteChainSelector { + remoteChainSelectorRule = append(remoteChainSelectorRule, remoteChainSelectorItem) + } + + logs, sub, err := _BurnMintTokenPoolAndProxy.contract.FilterLogs(opts, "RemotePoolSet", remoteChainSelectorRule) + if err != nil { + return nil, err + } + return &BurnMintTokenPoolAndProxyRemotePoolSetIterator{contract: _BurnMintTokenPoolAndProxy.contract, event: "RemotePoolSet", logs: logs, sub: sub}, nil +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyFilterer) WatchRemotePoolSet(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolAndProxyRemotePoolSet, remoteChainSelector []uint64) (event.Subscription, error) { + + var remoteChainSelectorRule []interface{} + for _, remoteChainSelectorItem := range remoteChainSelector { + remoteChainSelectorRule = append(remoteChainSelectorRule, remoteChainSelectorItem) + } + + logs, sub, err := _BurnMintTokenPoolAndProxy.contract.WatchLogs(opts, "RemotePoolSet", remoteChainSelectorRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(BurnMintTokenPoolAndProxyRemotePoolSet) + if err := _BurnMintTokenPoolAndProxy.contract.UnpackLog(event, "RemotePoolSet", 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 +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyFilterer) ParseRemotePoolSet(log types.Log) (*BurnMintTokenPoolAndProxyRemotePoolSet, error) { + event := new(BurnMintTokenPoolAndProxyRemotePoolSet) + if err := _BurnMintTokenPoolAndProxy.contract.UnpackLog(event, "RemotePoolSet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type BurnMintTokenPoolAndProxyRouterUpdatedIterator struct { + Event *BurnMintTokenPoolAndProxyRouterUpdated + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *BurnMintTokenPoolAndProxyRouterUpdatedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolAndProxyRouterUpdated) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolAndProxyRouterUpdated) + 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() + } +} + +func (it *BurnMintTokenPoolAndProxyRouterUpdatedIterator) Error() error { + return it.fail +} + +func (it *BurnMintTokenPoolAndProxyRouterUpdatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type BurnMintTokenPoolAndProxyRouterUpdated struct { + OldRouter common.Address + NewRouter common.Address + Raw types.Log +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyFilterer) FilterRouterUpdated(opts *bind.FilterOpts) (*BurnMintTokenPoolAndProxyRouterUpdatedIterator, error) { + + logs, sub, err := _BurnMintTokenPoolAndProxy.contract.FilterLogs(opts, "RouterUpdated") + if err != nil { + return nil, err + } + return &BurnMintTokenPoolAndProxyRouterUpdatedIterator{contract: _BurnMintTokenPoolAndProxy.contract, event: "RouterUpdated", logs: logs, sub: sub}, nil +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyFilterer) WatchRouterUpdated(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolAndProxyRouterUpdated) (event.Subscription, error) { + + logs, sub, err := _BurnMintTokenPoolAndProxy.contract.WatchLogs(opts, "RouterUpdated") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(BurnMintTokenPoolAndProxyRouterUpdated) + if err := _BurnMintTokenPoolAndProxy.contract.UnpackLog(event, "RouterUpdated", 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 +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyFilterer) ParseRouterUpdated(log types.Log) (*BurnMintTokenPoolAndProxyRouterUpdated, error) { + event := new(BurnMintTokenPoolAndProxyRouterUpdated) + if err := _BurnMintTokenPoolAndProxy.contract.UnpackLog(event, "RouterUpdated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type BurnMintTokenPoolAndProxyTokensConsumedIterator struct { + Event *BurnMintTokenPoolAndProxyTokensConsumed + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *BurnMintTokenPoolAndProxyTokensConsumedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolAndProxyTokensConsumed) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(BurnMintTokenPoolAndProxyTokensConsumed) + 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() + } +} + +func (it *BurnMintTokenPoolAndProxyTokensConsumedIterator) Error() error { + return it.fail +} + +func (it *BurnMintTokenPoolAndProxyTokensConsumedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type BurnMintTokenPoolAndProxyTokensConsumed struct { + Tokens *big.Int + Raw types.Log +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyFilterer) FilterTokensConsumed(opts *bind.FilterOpts) (*BurnMintTokenPoolAndProxyTokensConsumedIterator, error) { + + logs, sub, err := _BurnMintTokenPoolAndProxy.contract.FilterLogs(opts, "TokensConsumed") + if err != nil { + return nil, err + } + return &BurnMintTokenPoolAndProxyTokensConsumedIterator{contract: _BurnMintTokenPoolAndProxy.contract, event: "TokensConsumed", logs: logs, sub: sub}, nil +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyFilterer) WatchTokensConsumed(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolAndProxyTokensConsumed) (event.Subscription, error) { + + logs, sub, err := _BurnMintTokenPoolAndProxy.contract.WatchLogs(opts, "TokensConsumed") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(BurnMintTokenPoolAndProxyTokensConsumed) + if err := _BurnMintTokenPoolAndProxy.contract.UnpackLog(event, "TokensConsumed", 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 +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxyFilterer) ParseTokensConsumed(log types.Log) (*BurnMintTokenPoolAndProxyTokensConsumed, error) { + event := new(BurnMintTokenPoolAndProxyTokensConsumed) + if err := _BurnMintTokenPoolAndProxy.contract.UnpackLog(event, "TokensConsumed", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxy) ParseLog(log types.Log) (generated.AbigenLog, error) { + switch log.Topics[0] { + case _BurnMintTokenPoolAndProxy.abi.Events["AllowListAdd"].ID: + return _BurnMintTokenPoolAndProxy.ParseAllowListAdd(log) + case _BurnMintTokenPoolAndProxy.abi.Events["AllowListRemove"].ID: + return _BurnMintTokenPoolAndProxy.ParseAllowListRemove(log) + case _BurnMintTokenPoolAndProxy.abi.Events["Burned"].ID: + return _BurnMintTokenPoolAndProxy.ParseBurned(log) + case _BurnMintTokenPoolAndProxy.abi.Events["ChainAdded"].ID: + return _BurnMintTokenPoolAndProxy.ParseChainAdded(log) + case _BurnMintTokenPoolAndProxy.abi.Events["ChainConfigured"].ID: + return _BurnMintTokenPoolAndProxy.ParseChainConfigured(log) + case _BurnMintTokenPoolAndProxy.abi.Events["ChainRemoved"].ID: + return _BurnMintTokenPoolAndProxy.ParseChainRemoved(log) + case _BurnMintTokenPoolAndProxy.abi.Events["ConfigChanged"].ID: + return _BurnMintTokenPoolAndProxy.ParseConfigChanged(log) + case _BurnMintTokenPoolAndProxy.abi.Events["LegacyPoolChanged"].ID: + return _BurnMintTokenPoolAndProxy.ParseLegacyPoolChanged(log) + case _BurnMintTokenPoolAndProxy.abi.Events["Locked"].ID: + return _BurnMintTokenPoolAndProxy.ParseLocked(log) + case _BurnMintTokenPoolAndProxy.abi.Events["Minted"].ID: + return _BurnMintTokenPoolAndProxy.ParseMinted(log) + case _BurnMintTokenPoolAndProxy.abi.Events["OwnershipTransferRequested"].ID: + return _BurnMintTokenPoolAndProxy.ParseOwnershipTransferRequested(log) + case _BurnMintTokenPoolAndProxy.abi.Events["OwnershipTransferred"].ID: + return _BurnMintTokenPoolAndProxy.ParseOwnershipTransferred(log) + case _BurnMintTokenPoolAndProxy.abi.Events["Released"].ID: + return _BurnMintTokenPoolAndProxy.ParseReleased(log) + case _BurnMintTokenPoolAndProxy.abi.Events["RemotePoolSet"].ID: + return _BurnMintTokenPoolAndProxy.ParseRemotePoolSet(log) + case _BurnMintTokenPoolAndProxy.abi.Events["RouterUpdated"].ID: + return _BurnMintTokenPoolAndProxy.ParseRouterUpdated(log) + case _BurnMintTokenPoolAndProxy.abi.Events["TokensConsumed"].ID: + return _BurnMintTokenPoolAndProxy.ParseTokensConsumed(log) + + default: + return nil, fmt.Errorf("abigen wrapper received unknown log topic: %v", log.Topics[0]) + } +} + +func (BurnMintTokenPoolAndProxyAllowListAdd) Topic() common.Hash { + return common.HexToHash("0x2640d4d76caf8bf478aabfa982fa4e1c4eb71a37f93cd15e80dbc657911546d8") +} + +func (BurnMintTokenPoolAndProxyAllowListRemove) Topic() common.Hash { + return common.HexToHash("0x800671136ab6cfee9fbe5ed1fb7ca417811aca3cf864800d127b927adedf7566") +} + +func (BurnMintTokenPoolAndProxyBurned) Topic() common.Hash { + return common.HexToHash("0x696de425f79f4a40bc6d2122ca50507f0efbeabbff86a84871b7196ab8ea8df7") +} + +func (BurnMintTokenPoolAndProxyChainAdded) Topic() common.Hash { + return common.HexToHash("0x8d340f17e19058004c20453540862a9c62778504476f6756755cb33bcd6c38c2") +} + +func (BurnMintTokenPoolAndProxyChainConfigured) Topic() common.Hash { + return common.HexToHash("0x0350d63aa5f270e01729d00d627eeb8f3429772b1818c016c66a588a864f912b") +} + +func (BurnMintTokenPoolAndProxyChainRemoved) Topic() common.Hash { + return common.HexToHash("0x5204aec90a3c794d8e90fded8b46ae9c7c552803e7e832e0c1d358396d859916") +} + +func (BurnMintTokenPoolAndProxyConfigChanged) Topic() common.Hash { + return common.HexToHash("0x9ea3374b67bf275e6bb9c8ae68f9cae023e1c528b4b27e092f0bb209d3531c19") +} + +func (BurnMintTokenPoolAndProxyLegacyPoolChanged) Topic() common.Hash { + return common.HexToHash("0x81accd0a7023865eaa51b3399dd0eafc488bf3ba238402911e1659cfe860f228") +} + +func (BurnMintTokenPoolAndProxyLocked) Topic() common.Hash { + return common.HexToHash("0x9f1ec8c880f76798e7b793325d625e9b60e4082a553c98f42b6cda368dd60008") +} + +func (BurnMintTokenPoolAndProxyMinted) Topic() common.Hash { + return common.HexToHash("0x9d228d69b5fdb8d273a2336f8fb8612d039631024ea9bf09c424a9503aa078f0") +} + +func (BurnMintTokenPoolAndProxyOwnershipTransferRequested) Topic() common.Hash { + return common.HexToHash("0xed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae1278") +} + +func (BurnMintTokenPoolAndProxyOwnershipTransferred) Topic() common.Hash { + return common.HexToHash("0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0") +} + +func (BurnMintTokenPoolAndProxyReleased) Topic() common.Hash { + return common.HexToHash("0x2d87480f50083e2b2759522a8fdda59802650a8055e609a7772cf70c07748f52") +} + +func (BurnMintTokenPoolAndProxyRemotePoolSet) Topic() common.Hash { + return common.HexToHash("0xdb4d6220746a38cbc5335f7e108f7de80f482f4d23350253dfd0917df75a14bf") +} + +func (BurnMintTokenPoolAndProxyRouterUpdated) Topic() common.Hash { + return common.HexToHash("0x02dc5c233404867c793b749c6d644beb2277536d18a7e7974d3f238e4c6f1684") +} + +func (BurnMintTokenPoolAndProxyTokensConsumed) Topic() common.Hash { + return common.HexToHash("0x1871cdf8010e63f2eb8384381a68dfa7416dc571a5517e66e88b2d2d0c0a690a") +} + +func (_BurnMintTokenPoolAndProxy *BurnMintTokenPoolAndProxy) Address() common.Address { + return _BurnMintTokenPoolAndProxy.address +} + +type BurnMintTokenPoolAndProxyInterface interface { + GetAllowList(opts *bind.CallOpts) ([]common.Address, error) + + GetAllowListEnabled(opts *bind.CallOpts) (bool, error) + + GetCurrentInboundRateLimiterState(opts *bind.CallOpts, remoteChainSelector uint64) (RateLimiterTokenBucket, error) + + GetCurrentOutboundRateLimiterState(opts *bind.CallOpts, remoteChainSelector uint64) (RateLimiterTokenBucket, error) + + GetOnRamp(opts *bind.CallOpts, arg0 uint64) (common.Address, error) + + GetPreviousPool(opts *bind.CallOpts) (common.Address, error) + + GetRateLimitAdmin(opts *bind.CallOpts) (common.Address, error) + + GetRemotePool(opts *bind.CallOpts, remoteChainSelector uint64) ([]byte, error) + + GetRemoteToken(opts *bind.CallOpts, remoteChainSelector uint64) ([]byte, error) + + GetRmnProxy(opts *bind.CallOpts) (common.Address, error) + + GetRouter(opts *bind.CallOpts) (common.Address, error) + + GetSupportedChains(opts *bind.CallOpts) ([]uint64, error) + + GetToken(opts *bind.CallOpts) (common.Address, error) + + IsOffRamp(opts *bind.CallOpts, sourceChainSelector uint64, offRamp common.Address) (bool, error) + + IsSupportedChain(opts *bind.CallOpts, remoteChainSelector uint64) (bool, error) + + IsSupportedToken(opts *bind.CallOpts, token common.Address) (bool, error) + + Owner(opts *bind.CallOpts) (common.Address, error) + + SupportsInterface(opts *bind.CallOpts, interfaceId [4]byte) (bool, error) + + TypeAndVersion(opts *bind.CallOpts) (string, error) + + AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) + + ApplyAllowListUpdates(opts *bind.TransactOpts, removes []common.Address, adds []common.Address) (*types.Transaction, error) + + ApplyChainUpdates(opts *bind.TransactOpts, chains []TokenPoolChainUpdate) (*types.Transaction, error) + + LockOrBurn(opts *bind.TransactOpts, lockOrBurnIn PoolLockOrBurnInV1) (*types.Transaction, error) + + ReleaseOrMint(opts *bind.TransactOpts, releaseOrMintIn PoolReleaseOrMintInV1) (*types.Transaction, error) + + SetChainRateLimiterConfig(opts *bind.TransactOpts, remoteChainSelector uint64, outboundConfig RateLimiterConfig, inboundConfig RateLimiterConfig) (*types.Transaction, error) + + SetPreviousPool(opts *bind.TransactOpts, prevPool common.Address) (*types.Transaction, error) + + SetRateLimitAdmin(opts *bind.TransactOpts, rateLimitAdmin common.Address) (*types.Transaction, error) + + SetRemotePool(opts *bind.TransactOpts, remoteChainSelector uint64, remotePoolAddress []byte) (*types.Transaction, error) + + SetRouter(opts *bind.TransactOpts, newRouter common.Address) (*types.Transaction, error) + + TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) + + FilterAllowListAdd(opts *bind.FilterOpts) (*BurnMintTokenPoolAndProxyAllowListAddIterator, error) + + WatchAllowListAdd(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolAndProxyAllowListAdd) (event.Subscription, error) + + ParseAllowListAdd(log types.Log) (*BurnMintTokenPoolAndProxyAllowListAdd, error) + + FilterAllowListRemove(opts *bind.FilterOpts) (*BurnMintTokenPoolAndProxyAllowListRemoveIterator, error) + + WatchAllowListRemove(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolAndProxyAllowListRemove) (event.Subscription, error) + + ParseAllowListRemove(log types.Log) (*BurnMintTokenPoolAndProxyAllowListRemove, error) + + FilterBurned(opts *bind.FilterOpts, sender []common.Address) (*BurnMintTokenPoolAndProxyBurnedIterator, error) + + WatchBurned(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolAndProxyBurned, sender []common.Address) (event.Subscription, error) + + ParseBurned(log types.Log) (*BurnMintTokenPoolAndProxyBurned, error) + + FilterChainAdded(opts *bind.FilterOpts) (*BurnMintTokenPoolAndProxyChainAddedIterator, error) + + WatchChainAdded(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolAndProxyChainAdded) (event.Subscription, error) + + ParseChainAdded(log types.Log) (*BurnMintTokenPoolAndProxyChainAdded, error) + + FilterChainConfigured(opts *bind.FilterOpts) (*BurnMintTokenPoolAndProxyChainConfiguredIterator, error) + + WatchChainConfigured(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolAndProxyChainConfigured) (event.Subscription, error) + + ParseChainConfigured(log types.Log) (*BurnMintTokenPoolAndProxyChainConfigured, error) + + FilterChainRemoved(opts *bind.FilterOpts) (*BurnMintTokenPoolAndProxyChainRemovedIterator, error) + + WatchChainRemoved(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolAndProxyChainRemoved) (event.Subscription, error) + + ParseChainRemoved(log types.Log) (*BurnMintTokenPoolAndProxyChainRemoved, error) + + FilterConfigChanged(opts *bind.FilterOpts) (*BurnMintTokenPoolAndProxyConfigChangedIterator, error) + + WatchConfigChanged(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolAndProxyConfigChanged) (event.Subscription, error) + + ParseConfigChanged(log types.Log) (*BurnMintTokenPoolAndProxyConfigChanged, error) + + FilterLegacyPoolChanged(opts *bind.FilterOpts) (*BurnMintTokenPoolAndProxyLegacyPoolChangedIterator, error) + + WatchLegacyPoolChanged(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolAndProxyLegacyPoolChanged) (event.Subscription, error) + + ParseLegacyPoolChanged(log types.Log) (*BurnMintTokenPoolAndProxyLegacyPoolChanged, error) + + FilterLocked(opts *bind.FilterOpts, sender []common.Address) (*BurnMintTokenPoolAndProxyLockedIterator, error) + + WatchLocked(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolAndProxyLocked, sender []common.Address) (event.Subscription, error) + + ParseLocked(log types.Log) (*BurnMintTokenPoolAndProxyLocked, error) + + FilterMinted(opts *bind.FilterOpts, sender []common.Address, recipient []common.Address) (*BurnMintTokenPoolAndProxyMintedIterator, error) + + WatchMinted(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolAndProxyMinted, sender []common.Address, recipient []common.Address) (event.Subscription, error) + + ParseMinted(log types.Log) (*BurnMintTokenPoolAndProxyMinted, error) + + FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*BurnMintTokenPoolAndProxyOwnershipTransferRequestedIterator, error) + + WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolAndProxyOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferRequested(log types.Log) (*BurnMintTokenPoolAndProxyOwnershipTransferRequested, error) + + FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*BurnMintTokenPoolAndProxyOwnershipTransferredIterator, error) + + WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolAndProxyOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferred(log types.Log) (*BurnMintTokenPoolAndProxyOwnershipTransferred, error) + + FilterReleased(opts *bind.FilterOpts, sender []common.Address, recipient []common.Address) (*BurnMintTokenPoolAndProxyReleasedIterator, error) + + WatchReleased(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolAndProxyReleased, sender []common.Address, recipient []common.Address) (event.Subscription, error) + + ParseReleased(log types.Log) (*BurnMintTokenPoolAndProxyReleased, error) + + FilterRemotePoolSet(opts *bind.FilterOpts, remoteChainSelector []uint64) (*BurnMintTokenPoolAndProxyRemotePoolSetIterator, error) + + WatchRemotePoolSet(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolAndProxyRemotePoolSet, remoteChainSelector []uint64) (event.Subscription, error) + + ParseRemotePoolSet(log types.Log) (*BurnMintTokenPoolAndProxyRemotePoolSet, error) + + FilterRouterUpdated(opts *bind.FilterOpts) (*BurnMintTokenPoolAndProxyRouterUpdatedIterator, error) + + WatchRouterUpdated(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolAndProxyRouterUpdated) (event.Subscription, error) + + ParseRouterUpdated(log types.Log) (*BurnMintTokenPoolAndProxyRouterUpdated, error) + + FilterTokensConsumed(opts *bind.FilterOpts) (*BurnMintTokenPoolAndProxyTokensConsumedIterator, error) + + WatchTokensConsumed(opts *bind.WatchOpts, sink chan<- *BurnMintTokenPoolAndProxyTokensConsumed) (event.Subscription, error) + + ParseTokensConsumed(log types.Log) (*BurnMintTokenPoolAndProxyTokensConsumed, error) + + ParseLog(log types.Log) (generated.AbigenLog, error) + + Address() common.Address +} diff --git a/core/gethwrappers/ccip/generated/burn_with_from_mint_token_pool/burn_with_from_mint_token_pool.go b/core/gethwrappers/ccip/generated/burn_with_from_mint_token_pool/burn_with_from_mint_token_pool.go new file mode 100644 index 00000000000..9ba0cacd458 --- /dev/null +++ b/core/gethwrappers/ccip/generated/burn_with_from_mint_token_pool/burn_with_from_mint_token_pool.go @@ -0,0 +1,2818 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package burn_with_from_mint_token_pool + +import ( + "errors" + "fmt" + "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" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" +) + +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +type PoolLockOrBurnInV1 struct { + Receiver []byte + RemoteChainSelector uint64 + OriginalSender common.Address + Amount *big.Int + LocalToken common.Address +} + +type PoolLockOrBurnOutV1 struct { + DestTokenAddress []byte + DestPoolData []byte +} + +type PoolReleaseOrMintInV1 struct { + OriginalSender []byte + RemoteChainSelector uint64 + Receiver common.Address + Amount *big.Int + LocalToken common.Address + SourcePoolAddress []byte + SourcePoolData []byte + OffchainTokenData []byte +} + +type PoolReleaseOrMintOutV1 struct { + DestinationAmount *big.Int +} + +type RateLimiterConfig struct { + IsEnabled bool + Capacity *big.Int + Rate *big.Int +} + +type RateLimiterTokenBucket struct { + Tokens *big.Int + LastUpdated uint32 + IsEnabled bool + Capacity *big.Int + Rate *big.Int +} + +type TokenPoolChainUpdate struct { + RemoteChainSelector uint64 + Allowed bool + RemotePoolAddress []byte + RemoteTokenAddress []byte + OutboundRateLimiterConfig RateLimiterConfig + InboundRateLimiterConfig RateLimiterConfig +} + +var BurnWithFromMintTokenPoolMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"internalType\":\"contractIBurnMintERC20\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"allowlist\",\"type\":\"address[]\"},{\"internalType\":\"address\",\"name\":\"rmnProxy\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"router\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"capacity\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"requested\",\"type\":\"uint256\"}],\"name\":\"AggregateValueMaxCapacityExceeded\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"minWaitInSeconds\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"available\",\"type\":\"uint256\"}],\"name\":\"AggregateValueRateLimitReached\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"AllowListNotEnabled\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"BucketOverfilled\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"}],\"name\":\"CallerIsNotARampOnRouter\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"}],\"name\":\"ChainAlreadyExists\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"ChainNotAllowed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"CursedByRMN\",\"type\":\"error\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"config\",\"type\":\"tuple\"}],\"name\":\"DisabledNonZeroRateLimit\",\"type\":\"error\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"rateLimiterConfig\",\"type\":\"tuple\"}],\"name\":\"InvalidRateLimitRate\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"sourcePoolAddress\",\"type\":\"bytes\"}],\"name\":\"InvalidSourcePoolAddress\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"InvalidToken\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"NonExistentChain\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RateLimitMustBeDisabled\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"SenderNotAllowed\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"capacity\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"requested\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"}],\"name\":\"TokenMaxCapacityExceeded\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"minWaitInSeconds\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"available\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"}],\"name\":\"TokenRateLimitReached\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"}],\"name\":\"Unauthorized\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddressNotAllowed\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"AllowListAdd\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"AllowListRemove\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Burned\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"remoteToken\",\"type\":\"bytes\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"indexed\":false,\"internalType\":\"structRateLimiter.Config\",\"name\":\"outboundRateLimiterConfig\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"indexed\":false,\"internalType\":\"structRateLimiter.Config\",\"name\":\"inboundRateLimiterConfig\",\"type\":\"tuple\"}],\"name\":\"ChainAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"indexed\":false,\"internalType\":\"structRateLimiter.Config\",\"name\":\"outboundRateLimiterConfig\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"indexed\":false,\"internalType\":\"structRateLimiter.Config\",\"name\":\"inboundRateLimiterConfig\",\"type\":\"tuple\"}],\"name\":\"ChainConfigured\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"ChainRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"indexed\":false,\"internalType\":\"structRateLimiter.Config\",\"name\":\"config\",\"type\":\"tuple\"}],\"name\":\"ConfigChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Locked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Minted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Released\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"previousPoolAddress\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"remotePoolAddress\",\"type\":\"bytes\"}],\"name\":\"RemotePoolSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"oldRouter\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newRouter\",\"type\":\"address\"}],\"name\":\"RouterUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"}],\"name\":\"TokensConsumed\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"removes\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"adds\",\"type\":\"address[]\"}],\"name\":\"applyAllowListUpdates\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"bool\",\"name\":\"allowed\",\"type\":\"bool\"},{\"internalType\":\"bytes\",\"name\":\"remotePoolAddress\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"remoteTokenAddress\",\"type\":\"bytes\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"outboundRateLimiterConfig\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"inboundRateLimiterConfig\",\"type\":\"tuple\"}],\"internalType\":\"structTokenPool.ChainUpdate[]\",\"name\":\"chains\",\"type\":\"tuple[]\"}],\"name\":\"applyChainUpdates\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAllowList\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAllowListEnabled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"getCurrentInboundRateLimiterState\",\"outputs\":[{\"components\":[{\"internalType\":\"uint128\",\"name\":\"tokens\",\"type\":\"uint128\"},{\"internalType\":\"uint32\",\"name\":\"lastUpdated\",\"type\":\"uint32\"},{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.TokenBucket\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"getCurrentOutboundRateLimiterState\",\"outputs\":[{\"components\":[{\"internalType\":\"uint128\",\"name\":\"tokens\",\"type\":\"uint128\"},{\"internalType\":\"uint32\",\"name\":\"lastUpdated\",\"type\":\"uint32\"},{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.TokenBucket\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRateLimitAdmin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"getRemotePool\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"getRemoteToken\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRmnProxy\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"rmnProxy\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRouter\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"router\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getSupportedChains\",\"outputs\":[{\"internalType\":\"uint64[]\",\"name\":\"\",\"type\":\"uint64[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getToken\",\"outputs\":[{\"internalType\":\"contractIERC20\",\"name\":\"token\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"isSupportedChain\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"isSupportedToken\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes\",\"name\":\"receiver\",\"type\":\"bytes\"},{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"originalSender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"localToken\",\"type\":\"address\"}],\"internalType\":\"structPool.LockOrBurnInV1\",\"name\":\"lockOrBurnIn\",\"type\":\"tuple\"}],\"name\":\"lockOrBurn\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes\",\"name\":\"destTokenAddress\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"destPoolData\",\"type\":\"bytes\"}],\"internalType\":\"structPool.LockOrBurnOutV1\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes\",\"name\":\"originalSender\",\"type\":\"bytes\"},{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"localToken\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"sourcePoolAddress\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"sourcePoolData\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"offchainTokenData\",\"type\":\"bytes\"}],\"internalType\":\"structPool.ReleaseOrMintInV1\",\"name\":\"releaseOrMintIn\",\"type\":\"tuple\"}],\"name\":\"releaseOrMint\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"destinationAmount\",\"type\":\"uint256\"}],\"internalType\":\"structPool.ReleaseOrMintOutV1\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"outboundConfig\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"inboundConfig\",\"type\":\"tuple\"}],\"name\":\"setChainRateLimiterConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"rateLimitAdmin\",\"type\":\"address\"}],\"name\":\"setRateLimitAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"remotePoolAddress\",\"type\":\"bytes\"}],\"name\":\"setRemotePool\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newRouter\",\"type\":\"address\"}],\"name\":\"setRouter\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", + Bin: "0x60e06040523480156200001157600080fd5b506040516200450b3803806200450b8339810160408190526200003491620008c0565b8383838333806000816200008f5760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000c257620000c2816200018f565b5050506001600160a01b0384161580620000e357506001600160a01b038116155b80620000f657506001600160a01b038216155b1562000115576040516342bcdf7f60e11b815260040160405180910390fd5b6001600160a01b0384811660805282811660a052600480546001600160a01b031916918316919091179055825115801560c05262000168576040805160008152602081019091526200016890846200023a565b5062000185925050506001600160a01b0385163060001962000397565b5050505062000afc565b336001600160a01b03821603620001e95760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640162000086565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b60c0516200025b576040516335f4a7b360e01b815260040160405180910390fd5b60005b8251811015620002e65760008382815181106200027f576200027f620009d0565b60209081029190910101519050620002996002826200047d565b15620002dc576040516001600160a01b03821681527f800671136ab6cfee9fbe5ed1fb7ca417811aca3cf864800d127b927adedf75669060200160405180910390a15b506001016200025e565b5060005b8151811015620003925760008282815181106200030b576200030b620009d0565b6020026020010151905060006001600160a01b0316816001600160a01b03160362000337575062000389565b620003446002826200049d565b1562000387576040516001600160a01b03821681527f2640d4d76caf8bf478aabfa982fa4e1c4eb71a37f93cd15e80dbc657911546d89060200160405180910390a15b505b600101620002ea565b505050565b604051636eb1769f60e11b81523060048201526001600160a01b038381166024830152600091839186169063dd62ed3e90604401602060405180830381865afa158015620003e9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200040f9190620009e6565b6200041b919062000a16565b604080516001600160a01b038616602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b0390811663095ea7b360e01b179091529192506200047791869190620004b416565b50505050565b600062000494836001600160a01b03841662000585565b90505b92915050565b600062000494836001600160a01b03841662000689565b6040805180820190915260208082527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65649082015260009062000503906001600160a01b038516908490620006db565b80519091501562000392578080602001905181019062000524919062000a2c565b620003925760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840162000086565b600081815260018301602052604081205480156200067e576000620005ac60018362000a57565b8554909150600090620005c29060019062000a57565b90508082146200062e576000866000018281548110620005e657620005e6620009d0565b90600052602060002001549050808760000184815481106200060c576200060c620009d0565b6000918252602080832090910192909255918252600188019052604090208390555b855486908062000642576200064262000a6d565b60019003818190600052602060002001600090559055856001016000868152602001908152602001600020600090556001935050505062000497565b600091505062000497565b6000818152600183016020526040812054620006d25750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915562000497565b50600062000497565b6060620006ec8484600085620006f4565b949350505050565b606082471015620007575760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840162000086565b600080866001600160a01b0316858760405162000775919062000aa9565b60006040518083038185875af1925050503d8060008114620007b4576040519150601f19603f3d011682016040523d82523d6000602084013e620007b9565b606091505b509092509050620007cd87838387620007d8565b979650505050505050565b606083156200084c57825160000362000844576001600160a01b0385163b620008445760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640162000086565b5081620006ec565b620006ec8383815115620008635781518083602001fd5b8060405162461bcd60e51b815260040162000086919062000ac7565b6001600160a01b03811681146200089557600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b8051620008bb816200087f565b919050565b60008060008060808587031215620008d757600080fd5b8451620008e4816200087f565b602086810151919550906001600160401b03808211156200090457600080fd5b818801915088601f8301126200091957600080fd5b8151818111156200092e576200092e62000898565b8060051b604051601f19603f8301168101818110858211171562000956576200095662000898565b60405291825284820192508381018501918b8311156200097557600080fd5b938501935b828510156200099e576200098e85620008ae565b845293850193928501926200097a565b809850505050505050620009b560408601620008ae565b9150620009c560608601620008ae565b905092959194509250565b634e487b7160e01b600052603260045260246000fd5b600060208284031215620009f957600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b8082018082111562000497576200049762000a00565b60006020828403121562000a3f57600080fd5b8151801515811462000a5057600080fd5b9392505050565b8181038181111562000497576200049762000a00565b634e487b7160e01b600052603160045260246000fd5b60005b8381101562000aa057818101518382015260200162000a86565b50506000910152565b6000825162000abd81846020870162000a83565b9190910192915050565b602081526000825180602084015262000ae881604085016020870162000a83565b601f01601f19169190910160400192915050565b60805160a05160c05161399262000b79600039600081816104dd01528181611777015261215b0152600081816104b7015281816115a80152611a2d0152600081816102390152818161028e015281816106e0015281816114c80152818161194d01528181611b45015281816120f1015261234601526139926000f3fe608060405234801561001057600080fd5b50600436106101ae5760003560e01c80639a4575b9116100ee578063c4bffe2b11610097578063db6327dc11610071578063db6327dc146104a2578063dc0bd971146104b5578063e0351e13146104db578063f2fde38b1461050157600080fd5b8063c4bffe2b14610467578063c75eea9c1461047c578063cf7401f31461048f57600080fd5b8063b0f479a1116100c8578063b0f479a114610423578063b794658014610441578063c0d786551461045457600080fd5b80639a4575b91461037f578063a7cd63b71461039f578063af58d59f146103b457600080fd5b806354c8a4f31161015b57806379ba50971161013557806379ba5097146103335780637d54534e1461033b5780638926f54f1461034e5780638da5cb5b1461036157600080fd5b806354c8a4f3146102ed5780636d3d1a581461030257806378a010b21461032057600080fd5b806321df0da71161018c57806321df0da714610237578063240028e81461027e57806339077537146102cb57600080fd5b806301ffc9a7146101b35780630a2fd493146101db578063181f5a77146101fb575b600080fd5b6101c66101c1366004612ae9565b610514565b60405190151581526020015b60405180910390f35b6101ee6101e9366004612b48565b6105f9565b6040516101d29190612bc7565b6101ee6040518060400160405280601f81526020017f4275726e5769746846726f6d4d696e74546f6b656e506f6f6c20312e352e300081525081565b7f00000000000000000000000000000000000000000000000000000000000000005b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101d2565b6101c661028c366004612c07565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff90811691161490565b6102de6102d9366004612c24565b6106a9565b604051905181526020016101d2565b6103006102fb366004612cac565b61082f565b005b60085473ffffffffffffffffffffffffffffffffffffffff16610259565b61030061032e366004612d18565b6108aa565b610300610a1e565b610300610349366004612c07565b610b1b565b6101c661035c366004612b48565b610b6a565b60005473ffffffffffffffffffffffffffffffffffffffff16610259565b61039261038d366004612d9b565b610b81565b6040516101d29190612dd6565b6103a7610c28565b6040516101d29190612e36565b6103c76103c2366004612b48565b610c39565b6040516101d2919081516fffffffffffffffffffffffffffffffff908116825260208084015163ffffffff1690830152604080840151151590830152606080840151821690830152608092830151169181019190915260a00190565b60045473ffffffffffffffffffffffffffffffffffffffff16610259565b6101ee61044f366004612b48565b610d0e565b610300610462366004612c07565b610d39565b61046f610e14565b6040516101d29190612e90565b6103c761048a366004612b48565b610ecc565b61030061049d366004612ff8565b610f9e565b6103006104b036600461303d565b611027565b7f0000000000000000000000000000000000000000000000000000000000000000610259565b7f00000000000000000000000000000000000000000000000000000000000000006101c6565b61030061050f366004612c07565b6114ad565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167faff2afbf0000000000000000000000000000000000000000000000000000000014806105a757507fffffffff0000000000000000000000000000000000000000000000000000000082167f0e64dd2900000000000000000000000000000000000000000000000000000000145b806105f357507fffffffff0000000000000000000000000000000000000000000000000000000082167f01ffc9a700000000000000000000000000000000000000000000000000000000145b92915050565b67ffffffffffffffff811660009081526007602052604090206004018054606091906106249061307f565b80601f01602080910402602001604051908101604052809291908181526020018280546106509061307f565b801561069d5780601f106106725761010080835404028352916020019161069d565b820191906000526020600020905b81548152906001019060200180831161068057829003601f168201915b50505050509050919050565b6040805160208101909152600081526106c96106c48361317d565b6114c1565b73ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000166340c10f196107156060850160408601612c07565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b16815273ffffffffffffffffffffffffffffffffffffffff909116600482015260608501356024820152604401600060405180830381600087803b15801561078557600080fd5b505af1158015610799573d6000803e3d6000fd5b506107ae925050506060830160408401612c07565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f9d228d69b5fdb8d273a2336f8fb8612d039631024ea9bf09c424a9503aa078f0846060013560405161081091815260200190565b60405180910390a3506040805160208101909152606090910135815290565b6108376116f2565b6108a48484808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152505060408051602080880282810182019093528782529093508792508691829185019084908082843760009201919091525061177592505050565b50505050565b6108b26116f2565b6108bb83610b6a565b610902576040517f1e670e4b00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff841660048201526024015b60405180910390fd5b67ffffffffffffffff8316600090815260076020526040812060040180546109299061307f565b80601f01602080910402602001604051908101604052809291908181526020018280546109559061307f565b80156109a25780601f10610977576101008083540402835291602001916109a2565b820191906000526020600020905b81548152906001019060200180831161098557829003601f168201915b5050505067ffffffffffffffff86166000908152600760205260409020919250506004016109d18385836132c2565b508367ffffffffffffffff167fdb4d6220746a38cbc5335f7e108f7de80f482f4d23350253dfd0917df75a14bf828585604051610a10939291906133dc565b60405180910390a250505050565b60015473ffffffffffffffffffffffffffffffffffffffff163314610a9f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e65720000000000000000000060448201526064016108f9565b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b610b236116f2565b600880547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60006105f3600567ffffffffffffffff841661192b565b6040805180820190915260608082526020820152610ba6610ba183613440565b611946565b610bb38260600135611b10565b6040516060830135815233907f696de425f79f4a40bc6d2122ca50507f0efbeabbff86a84871b7196ab8ea8df79060200160405180910390a26040518060400160405280610c0d84602001602081019061044f9190612b48565b81526040805160208181019092526000815291015292915050565b6060610c346002611bb9565b905090565b6040805160a08101825260008082526020820181905291810182905260608101829052608081019190915267ffffffffffffffff8216600090815260076020908152604091829020825160a08101845260028201546fffffffffffffffffffffffffffffffff808216835270010000000000000000000000000000000080830463ffffffff16958401959095527401000000000000000000000000000000000000000090910460ff1615159482019490945260039091015480841660608301529190910490911660808201526105f390611bc6565b67ffffffffffffffff811660009081526007602052604090206005018054606091906106249061307f565b610d416116f2565b73ffffffffffffffffffffffffffffffffffffffff8116610d8e576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6004805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff000000000000000000000000000000000000000083168117909355604080519190921680825260208201939093527f02dc5c233404867c793b749c6d644beb2277536d18a7e7974d3f238e4c6f1684910160405180910390a15050565b60606000610e226005611bb9565b90506000815167ffffffffffffffff811115610e4057610e40612ed2565b604051908082528060200260200182016040528015610e69578160200160208202803683370190505b50905060005b8251811015610ec557828181518110610e8a57610e8a6134e2565b6020026020010151828281518110610ea457610ea46134e2565b67ffffffffffffffff90921660209283029190910190910152600101610e6f565b5092915050565b6040805160a08101825260008082526020820181905291810182905260608101829052608081019190915267ffffffffffffffff8216600090815260076020908152604091829020825160a08101845281546fffffffffffffffffffffffffffffffff808216835270010000000000000000000000000000000080830463ffffffff16958401959095527401000000000000000000000000000000000000000090910460ff1615159482019490945260019091015480841660608301529190910490911660808201526105f390611bc6565b60085473ffffffffffffffffffffffffffffffffffffffff163314801590610fde575060005473ffffffffffffffffffffffffffffffffffffffff163314155b15611017576040517f8e4a23d60000000000000000000000000000000000000000000000000000000081523360048201526024016108f9565b611022838383611c78565b505050565b61102f6116f2565b60005b8181101561102257600083838381811061104e5761104e6134e2565b90506020028101906110609190613511565b6110699061354f565b905061107e8160800151826020015115611d62565b6110918160a00151826020015115611d62565b80602001511561138d5780516110b39060059067ffffffffffffffff16611e9b565b6110f85780516040517f1d5ad3c500000000000000000000000000000000000000000000000000000000815267ffffffffffffffff90911660048201526024016108f9565b604081015151158061110d5750606081015151155b15611144576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040805161012081018252608083810180516020908101516fffffffffffffffffffffffffffffffff9081168486019081524263ffffffff90811660a0808901829052865151151560c08a01528651860151851660e08a015295518901518416610100890152918752875180860189529489018051850151841686528585019290925281515115158589015281518401518316606080870191909152915188015183168587015283870194855288880151878901908152828a015183890152895167ffffffffffffffff1660009081526007865289902088518051825482890151838e01519289167fffffffffffffffffffffffff0000000000000000000000000000000000000000928316177001000000000000000000000000000000009188168202177fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff90811674010000000000000000000000000000000000000000941515850217865584890151948d0151948a16948a168202949094176001860155995180516002860180549b8301519f830151918b169b9093169a909a179d9096168a029c909c179091169615150295909517909855908101519401519381169316909102919091176003820155915190919060048201906113259082613603565b506060820151600582019061133a9082613603565b505081516060830151608084015160a08501516040517f8d340f17e19058004c20453540862a9c62778504476f6756755cb33bcd6c38c29550611380949392919061371d565b60405180910390a16114a4565b80516113a59060059067ffffffffffffffff16611ea7565b6113ea5780516040517f1e670e4b00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff90911660048201526024016108f9565b805167ffffffffffffffff16600090815260076020526040812080547fffffffffffffffffffffff000000000000000000000000000000000000000000908116825560018201839055600282018054909116905560038101829055906114536004830182612a9b565b611461600583016000612a9b565b5050805160405167ffffffffffffffff90911681527f5204aec90a3c794d8e90fded8b46ae9c7c552803e7e832e0c1d358396d8599169060200160405180910390a15b50600101611032565b6114b56116f2565b6114be81611eb3565b50565b60808101517f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff9081169116146115565760808101516040517f961c9a4f00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff90911660048201526024016108f9565b60208101516040517f2cbc26bb00000000000000000000000000000000000000000000000000000000815260809190911b77ffffffffffffffff000000000000000000000000000000001660048201527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1690632cbc26bb90602401602060405180830381865afa158015611604573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061162891906137b6565b1561165f576040517f53ad11d800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61166c8160200151611fa8565b600061167b82602001516105f9565b905080516000148061169f575080805190602001208260a001518051906020012014155b156116dc578160a001516040517f24eb47e50000000000000000000000000000000000000000000000000000000081526004016108f99190612bc7565b6116ee826020015183606001516120ce565b5050565b60005473ffffffffffffffffffffffffffffffffffffffff163314611773576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e65720000000000000000000060448201526064016108f9565b565b7f00000000000000000000000000000000000000000000000000000000000000006117cc576040517f35f4a7b300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b82518110156118625760008382815181106117ec576117ec6134e2565b6020026020010151905061180a81600261211590919063ffffffff16565b156118595760405173ffffffffffffffffffffffffffffffffffffffff821681527f800671136ab6cfee9fbe5ed1fb7ca417811aca3cf864800d127b927adedf75669060200160405180910390a15b506001016117cf565b5060005b8151811015611022576000828281518110611883576118836134e2565b60200260200101519050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036118c75750611923565b6118d2600282612137565b156119215760405173ffffffffffffffffffffffffffffffffffffffff821681527f2640d4d76caf8bf478aabfa982fa4e1c4eb71a37f93cd15e80dbc657911546d89060200160405180910390a15b505b600101611866565b600081815260018301602052604081205415155b9392505050565b60808101517f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff9081169116146119db5760808101516040517f961c9a4f00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff90911660048201526024016108f9565b60208101516040517f2cbc26bb00000000000000000000000000000000000000000000000000000000815260809190911b77ffffffffffffffff000000000000000000000000000000001660048201527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1690632cbc26bb90602401602060405180830381865afa158015611a89573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611aad91906137b6565b15611ae4576040517f53ad11d800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611af18160400151612159565b611afe81602001516121d8565b6114be81602001518260600151612326565b6040517f9dc29fac000000000000000000000000000000000000000000000000000000008152306004820152602481018290527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1690639dc29fac90604401600060405180830381600087803b158015611b9e57600080fd5b505af1158015611bb2573d6000803e3d6000fd5b5050505050565b6060600061193f8361236a565b6040805160a081018252600080825260208201819052918101829052606081018290526080810191909152611c5482606001516fffffffffffffffffffffffffffffffff1683600001516fffffffffffffffffffffffffffffffff16846020015163ffffffff1642611c389190613802565b85608001516fffffffffffffffffffffffffffffffff166123c5565b6fffffffffffffffffffffffffffffffff1682525063ffffffff4216602082015290565b611c8183610b6a565b611cc3576040517f1e670e4b00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff841660048201526024016108f9565b611cce826000611d62565b67ffffffffffffffff83166000908152600760205260409020611cf190836123ef565b611cfc816000611d62565b67ffffffffffffffff83166000908152600760205260409020611d2290600201826123ef565b7f0350d63aa5f270e01729d00d627eeb8f3429772b1818c016c66a588a864f912b838383604051611d5593929190613815565b60405180910390a1505050565b815115611e295781602001516fffffffffffffffffffffffffffffffff1682604001516fffffffffffffffffffffffffffffffff16101580611db8575060408201516fffffffffffffffffffffffffffffffff16155b15611df157816040517f8020d1240000000000000000000000000000000000000000000000000000000081526004016108f99190613898565b80156116ee576040517f433fc33d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60408201516fffffffffffffffffffffffffffffffff16151580611e62575060208201516fffffffffffffffffffffffffffffffff1615155b156116ee57816040517fd68af9cc0000000000000000000000000000000000000000000000000000000081526004016108f99190613898565b600061193f8383612591565b600061193f83836125e0565b3373ffffffffffffffffffffffffffffffffffffffff821603611f32576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c6600000000000000000060448201526064016108f9565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b611fb181610b6a565b611ff3576040517fa9902c7e00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff821660048201526024016108f9565b600480546040517f83826b2b00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff84169281019290925233602483015273ffffffffffffffffffffffffffffffffffffffff16906383826b2b90604401602060405180830381865afa158015612072573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061209691906137b6565b6114be576040517f728fe07b0000000000000000000000000000000000000000000000000000000081523360048201526024016108f9565b67ffffffffffffffff821660009081526007602052604090206116ee90600201827f00000000000000000000000000000000000000000000000000000000000000006126d3565b600061193f8373ffffffffffffffffffffffffffffffffffffffff84166125e0565b600061193f8373ffffffffffffffffffffffffffffffffffffffff8416612591565b7f0000000000000000000000000000000000000000000000000000000000000000156114be5761218a600282612a56565b6114be576040517fd0d2597600000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff821660048201526024016108f9565b6121e181610b6a565b612223576040517fa9902c7e00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff821660048201526024016108f9565b600480546040517fa8d87a3b00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff84169281019290925273ffffffffffffffffffffffffffffffffffffffff169063a8d87a3b90602401602060405180830381865afa15801561229c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122c091906138d4565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146114be576040517f728fe07b0000000000000000000000000000000000000000000000000000000081523360048201526024016108f9565b67ffffffffffffffff821660009081526007602052604090206116ee90827f00000000000000000000000000000000000000000000000000000000000000006126d3565b60608160000180548060200260200160405190810160405280929190818152602001828054801561069d57602002820191906000526020600020905b8154815260200190600101908083116123a65750505050509050919050565b60006123e4856123d584866138f1565b6123df9087613908565b612a85565b90505b949350505050565b815460009061241890700100000000000000000000000000000000900463ffffffff1642613802565b905080156124ba5760018301548354612460916fffffffffffffffffffffffffffffffff808216928116918591700100000000000000000000000000000000909104166123c5565b83546fffffffffffffffffffffffffffffffff919091167fffffffffffffffffffffffff0000000000000000000000000000000000000000909116177001000000000000000000000000000000004263ffffffff16021783555b602082015183546124e0916fffffffffffffffffffffffffffffffff9081169116612a85565b83548351151574010000000000000000000000000000000000000000027fffffffffffffffffffffff00ffffffff000000000000000000000000000000009091166fffffffffffffffffffffffffffffffff92831617178455602083015160408085015183167001000000000000000000000000000000000291909216176001850155517f9ea3374b67bf275e6bb9c8ae68f9cae023e1c528b4b27e092f0bb209d3531c1990611d55908490613898565b60008181526001830160205260408120546125d8575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556105f3565b5060006105f3565b600081815260018301602052604081205480156126c9576000612604600183613802565b855490915060009061261890600190613802565b905080821461267d576000866000018281548110612638576126386134e2565b906000526020600020015490508087600001848154811061265b5761265b6134e2565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061268e5761268e61391b565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506105f3565b60009150506105f3565b825474010000000000000000000000000000000000000000900460ff1615806126fa575081155b1561270457505050565b825460018401546fffffffffffffffffffffffffffffffff8083169291169060009061274a90700100000000000000000000000000000000900463ffffffff1642613802565b9050801561280a578183111561278c576040517f9725942a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60018601546127c69083908590849070010000000000000000000000000000000090046fffffffffffffffffffffffffffffffff166123c5565b86547fffffffffffffffffffffffff00000000ffffffffffffffffffffffffffffffff167001000000000000000000000000000000004263ffffffff160217875592505b848210156128c15773ffffffffffffffffffffffffffffffffffffffff8416612869576040517ff94ebcd100000000000000000000000000000000000000000000000000000000815260048101839052602481018690526044016108f9565b6040517f1a76572a000000000000000000000000000000000000000000000000000000008152600481018390526024810186905273ffffffffffffffffffffffffffffffffffffffff851660448201526064016108f9565b848310156129d45760018681015470010000000000000000000000000000000090046fffffffffffffffffffffffffffffffff169060009082906129059082613802565b61290f878a613802565b6129199190613908565b612923919061394a565b905073ffffffffffffffffffffffffffffffffffffffff861661297c576040517f15279c0800000000000000000000000000000000000000000000000000000000815260048101829052602481018690526044016108f9565b6040517fd0c8d23a000000000000000000000000000000000000000000000000000000008152600481018290526024810186905273ffffffffffffffffffffffffffffffffffffffff871660448201526064016108f9565b6129de8584613802565b86547fffffffffffffffffffffffffffffffff00000000000000000000000000000000166fffffffffffffffffffffffffffffffff82161787556040518681529093507f1871cdf8010e63f2eb8384381a68dfa7416dc571a5517e66e88b2d2d0c0a690a9060200160405180910390a1505050505050565b73ffffffffffffffffffffffffffffffffffffffff81166000908152600183016020526040812054151561193f565b6000818310612a94578161193f565b5090919050565b508054612aa79061307f565b6000825580601f10612ab7575050565b601f0160209004906000526020600020908101906114be91905b80821115612ae55760008155600101612ad1565b5090565b600060208284031215612afb57600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461193f57600080fd5b803567ffffffffffffffff81168114612b4357600080fd5b919050565b600060208284031215612b5a57600080fd5b61193f82612b2b565b6000815180845260005b81811015612b8957602081850181015186830182015201612b6d565b5060006020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b60208152600061193f6020830184612b63565b73ffffffffffffffffffffffffffffffffffffffff811681146114be57600080fd5b8035612b4381612bda565b600060208284031215612c1957600080fd5b813561193f81612bda565b600060208284031215612c3657600080fd5b813567ffffffffffffffff811115612c4d57600080fd5b8201610100818503121561193f57600080fd5b60008083601f840112612c7257600080fd5b50813567ffffffffffffffff811115612c8a57600080fd5b6020830191508360208260051b8501011115612ca557600080fd5b9250929050565b60008060008060408587031215612cc257600080fd5b843567ffffffffffffffff80821115612cda57600080fd5b612ce688838901612c60565b90965094506020870135915080821115612cff57600080fd5b50612d0c87828801612c60565b95989497509550505050565b600080600060408486031215612d2d57600080fd5b612d3684612b2b565b9250602084013567ffffffffffffffff80821115612d5357600080fd5b818601915086601f830112612d6757600080fd5b813581811115612d7657600080fd5b876020828501011115612d8857600080fd5b6020830194508093505050509250925092565b600060208284031215612dad57600080fd5b813567ffffffffffffffff811115612dc457600080fd5b820160a0818503121561193f57600080fd5b602081526000825160406020840152612df26060840182612b63565b905060208401517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0848303016040850152612e2d8282612b63565b95945050505050565b6020808252825182820181905260009190848201906040850190845b81811015612e8457835173ffffffffffffffffffffffffffffffffffffffff1683529284019291840191600101612e52565b50909695505050505050565b6020808252825182820181905260009190848201906040850190845b81811015612e8457835167ffffffffffffffff1683529284019291840191600101612eac565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051610100810167ffffffffffffffff81118282101715612f2557612f25612ed2565b60405290565b60405160c0810167ffffffffffffffff81118282101715612f2557612f25612ed2565b80151581146114be57600080fd5b8035612b4381612f4e565b80356fffffffffffffffffffffffffffffffff81168114612b4357600080fd5b600060608284031215612f9957600080fd5b6040516060810181811067ffffffffffffffff82111715612fbc57612fbc612ed2565b6040529050808235612fcd81612f4e565b8152612fdb60208401612f67565b6020820152612fec60408401612f67565b60408201525092915050565b600080600060e0848603121561300d57600080fd5b61301684612b2b565b92506130258560208601612f87565b91506130348560808601612f87565b90509250925092565b6000806020838503121561305057600080fd5b823567ffffffffffffffff81111561306757600080fd5b61307385828601612c60565b90969095509350505050565b600181811c9082168061309357607f821691505b6020821081036130cc577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b600082601f8301126130e357600080fd5b813567ffffffffffffffff808211156130fe576130fe612ed2565b604051601f83017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810190828211818310171561314457613144612ed2565b8160405283815286602085880101111561315d57600080fd5b836020870160208301376000602085830101528094505050505092915050565b6000610100823603121561319057600080fd5b613198612f01565b823567ffffffffffffffff808211156131b057600080fd5b6131bc368387016130d2565b83526131ca60208601612b2b565b60208401526131db60408601612bfc565b6040840152606085013560608401526131f660808601612bfc565b608084015260a085013591508082111561320f57600080fd5b61321b368387016130d2565b60a084015260c085013591508082111561323457600080fd5b613240368387016130d2565b60c084015260e085013591508082111561325957600080fd5b50613266368286016130d2565b60e08301525092915050565b601f821115611022576000816000526020600020601f850160051c8101602086101561329b5750805b601f850160051c820191505b818110156132ba578281556001016132a7565b505050505050565b67ffffffffffffffff8311156132da576132da612ed2565b6132ee836132e8835461307f565b83613272565b6000601f841160018114613340576000851561330a5750838201355b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600387901b1c1916600186901b178355611bb2565b6000838152602090207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0861690835b8281101561338f578685013582556020948501946001909201910161336f565b50868210156133ca577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60f88860031b161c19848701351681555b505060018560011b0183555050505050565b6040815260006133ef6040830186612b63565b82810360208401528381528385602083013760006020858301015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f860116820101915050949350505050565b600060a0823603121561345257600080fd5b60405160a0810167ffffffffffffffff828210818311171561347657613476612ed2565b81604052843591508082111561348b57600080fd5b50613498368286016130d2565b8252506134a760208401612b2b565b602082015260408301356134ba81612bda565b60408201526060838101359082015260808301356134d781612bda565b608082015292915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600082357ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec183360301811261354557600080fd5b9190910192915050565b6000610140823603121561356257600080fd5b61356a612f2b565b61357383612b2b565b815261358160208401612f5c565b6020820152604083013567ffffffffffffffff808211156135a157600080fd5b6135ad368387016130d2565b604084015260608501359150808211156135c657600080fd5b506135d3368286016130d2565b6060830152506135e63660808501612f87565b60808201526135f83660e08501612f87565b60a082015292915050565b815167ffffffffffffffff81111561361d5761361d612ed2565b6136318161362b845461307f565b84613272565b602080601f831160018114613684576000841561364e5750858301515b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600386901b1c1916600185901b1785556132ba565b6000858152602081207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08616915b828110156136d1578886015182559484019460019091019084016136b2565b508582101561370d57878501517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600388901b60f8161c191681555b5050505050600190811b01905550565b600061010067ffffffffffffffff8716835280602084015261374181840187612b63565b8551151560408581019190915260208701516fffffffffffffffffffffffffffffffff908116606087015290870151166080850152915061377f9050565b8251151560a083015260208301516fffffffffffffffffffffffffffffffff90811660c084015260408401511660e0830152612e2d565b6000602082840312156137c857600080fd5b815161193f81612f4e565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b818103818111156105f3576105f36137d3565b67ffffffffffffffff8416815260e0810161386160208301858051151582526020808201516fffffffffffffffffffffffffffffffff9081169184019190915260409182015116910152565b82511515608083015260208301516fffffffffffffffffffffffffffffffff90811660a084015260408401511660c08301526123e7565b606081016105f382848051151582526020808201516fffffffffffffffffffffffffffffffff9081169184019190915260409182015116910152565b6000602082840312156138e657600080fd5b815161193f81612bda565b80820281158282048414176105f3576105f36137d3565b808201808211156105f3576105f36137d3565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b600082613980577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b50049056fea164736f6c6343000818000a", +} + +var BurnWithFromMintTokenPoolABI = BurnWithFromMintTokenPoolMetaData.ABI + +var BurnWithFromMintTokenPoolBin = BurnWithFromMintTokenPoolMetaData.Bin + +func DeployBurnWithFromMintTokenPool(auth *bind.TransactOpts, backend bind.ContractBackend, token common.Address, allowlist []common.Address, rmnProxy common.Address, router common.Address) (common.Address, *types.Transaction, *BurnWithFromMintTokenPool, error) { + parsed, err := BurnWithFromMintTokenPoolMetaData.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(BurnWithFromMintTokenPoolBin), backend, token, allowlist, rmnProxy, router) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &BurnWithFromMintTokenPool{address: address, abi: *parsed, BurnWithFromMintTokenPoolCaller: BurnWithFromMintTokenPoolCaller{contract: contract}, BurnWithFromMintTokenPoolTransactor: BurnWithFromMintTokenPoolTransactor{contract: contract}, BurnWithFromMintTokenPoolFilterer: BurnWithFromMintTokenPoolFilterer{contract: contract}}, nil +} + +type BurnWithFromMintTokenPool struct { + address common.Address + abi abi.ABI + BurnWithFromMintTokenPoolCaller + BurnWithFromMintTokenPoolTransactor + BurnWithFromMintTokenPoolFilterer +} + +type BurnWithFromMintTokenPoolCaller struct { + contract *bind.BoundContract +} + +type BurnWithFromMintTokenPoolTransactor struct { + contract *bind.BoundContract +} + +type BurnWithFromMintTokenPoolFilterer struct { + contract *bind.BoundContract +} + +type BurnWithFromMintTokenPoolSession struct { + Contract *BurnWithFromMintTokenPool + CallOpts bind.CallOpts + TransactOpts bind.TransactOpts +} + +type BurnWithFromMintTokenPoolCallerSession struct { + Contract *BurnWithFromMintTokenPoolCaller + CallOpts bind.CallOpts +} + +type BurnWithFromMintTokenPoolTransactorSession struct { + Contract *BurnWithFromMintTokenPoolTransactor + TransactOpts bind.TransactOpts +} + +type BurnWithFromMintTokenPoolRaw struct { + Contract *BurnWithFromMintTokenPool +} + +type BurnWithFromMintTokenPoolCallerRaw struct { + Contract *BurnWithFromMintTokenPoolCaller +} + +type BurnWithFromMintTokenPoolTransactorRaw struct { + Contract *BurnWithFromMintTokenPoolTransactor +} + +func NewBurnWithFromMintTokenPool(address common.Address, backend bind.ContractBackend) (*BurnWithFromMintTokenPool, error) { + abi, err := abi.JSON(strings.NewReader(BurnWithFromMintTokenPoolABI)) + if err != nil { + return nil, err + } + contract, err := bindBurnWithFromMintTokenPool(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &BurnWithFromMintTokenPool{address: address, abi: abi, BurnWithFromMintTokenPoolCaller: BurnWithFromMintTokenPoolCaller{contract: contract}, BurnWithFromMintTokenPoolTransactor: BurnWithFromMintTokenPoolTransactor{contract: contract}, BurnWithFromMintTokenPoolFilterer: BurnWithFromMintTokenPoolFilterer{contract: contract}}, nil +} + +func NewBurnWithFromMintTokenPoolCaller(address common.Address, caller bind.ContractCaller) (*BurnWithFromMintTokenPoolCaller, error) { + contract, err := bindBurnWithFromMintTokenPool(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &BurnWithFromMintTokenPoolCaller{contract: contract}, nil +} + +func NewBurnWithFromMintTokenPoolTransactor(address common.Address, transactor bind.ContractTransactor) (*BurnWithFromMintTokenPoolTransactor, error) { + contract, err := bindBurnWithFromMintTokenPool(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &BurnWithFromMintTokenPoolTransactor{contract: contract}, nil +} + +func NewBurnWithFromMintTokenPoolFilterer(address common.Address, filterer bind.ContractFilterer) (*BurnWithFromMintTokenPoolFilterer, error) { + contract, err := bindBurnWithFromMintTokenPool(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &BurnWithFromMintTokenPoolFilterer{contract: contract}, nil +} + +func bindBurnWithFromMintTokenPool(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := BurnWithFromMintTokenPoolMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _BurnWithFromMintTokenPool.Contract.BurnWithFromMintTokenPoolCaller.contract.Call(opts, result, method, params...) +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _BurnWithFromMintTokenPool.Contract.BurnWithFromMintTokenPoolTransactor.contract.Transfer(opts) +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _BurnWithFromMintTokenPool.Contract.BurnWithFromMintTokenPoolTransactor.contract.Transact(opts, method, params...) +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _BurnWithFromMintTokenPool.Contract.contract.Call(opts, result, method, params...) +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _BurnWithFromMintTokenPool.Contract.contract.Transfer(opts) +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _BurnWithFromMintTokenPool.Contract.contract.Transact(opts, method, params...) +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolCaller) GetAllowList(opts *bind.CallOpts) ([]common.Address, error) { + var out []interface{} + err := _BurnWithFromMintTokenPool.contract.Call(opts, &out, "getAllowList") + + if err != nil { + return *new([]common.Address), err + } + + out0 := *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) + + return out0, err + +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolSession) GetAllowList() ([]common.Address, error) { + return _BurnWithFromMintTokenPool.Contract.GetAllowList(&_BurnWithFromMintTokenPool.CallOpts) +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolCallerSession) GetAllowList() ([]common.Address, error) { + return _BurnWithFromMintTokenPool.Contract.GetAllowList(&_BurnWithFromMintTokenPool.CallOpts) +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolCaller) GetAllowListEnabled(opts *bind.CallOpts) (bool, error) { + var out []interface{} + err := _BurnWithFromMintTokenPool.contract.Call(opts, &out, "getAllowListEnabled") + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolSession) GetAllowListEnabled() (bool, error) { + return _BurnWithFromMintTokenPool.Contract.GetAllowListEnabled(&_BurnWithFromMintTokenPool.CallOpts) +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolCallerSession) GetAllowListEnabled() (bool, error) { + return _BurnWithFromMintTokenPool.Contract.GetAllowListEnabled(&_BurnWithFromMintTokenPool.CallOpts) +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolCaller) GetCurrentInboundRateLimiterState(opts *bind.CallOpts, remoteChainSelector uint64) (RateLimiterTokenBucket, error) { + var out []interface{} + err := _BurnWithFromMintTokenPool.contract.Call(opts, &out, "getCurrentInboundRateLimiterState", remoteChainSelector) + + if err != nil { + return *new(RateLimiterTokenBucket), err + } + + out0 := *abi.ConvertType(out[0], new(RateLimiterTokenBucket)).(*RateLimiterTokenBucket) + + return out0, err + +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolSession) GetCurrentInboundRateLimiterState(remoteChainSelector uint64) (RateLimiterTokenBucket, error) { + return _BurnWithFromMintTokenPool.Contract.GetCurrentInboundRateLimiterState(&_BurnWithFromMintTokenPool.CallOpts, remoteChainSelector) +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolCallerSession) GetCurrentInboundRateLimiterState(remoteChainSelector uint64) (RateLimiterTokenBucket, error) { + return _BurnWithFromMintTokenPool.Contract.GetCurrentInboundRateLimiterState(&_BurnWithFromMintTokenPool.CallOpts, remoteChainSelector) +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolCaller) GetCurrentOutboundRateLimiterState(opts *bind.CallOpts, remoteChainSelector uint64) (RateLimiterTokenBucket, error) { + var out []interface{} + err := _BurnWithFromMintTokenPool.contract.Call(opts, &out, "getCurrentOutboundRateLimiterState", remoteChainSelector) + + if err != nil { + return *new(RateLimiterTokenBucket), err + } + + out0 := *abi.ConvertType(out[0], new(RateLimiterTokenBucket)).(*RateLimiterTokenBucket) + + return out0, err + +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolSession) GetCurrentOutboundRateLimiterState(remoteChainSelector uint64) (RateLimiterTokenBucket, error) { + return _BurnWithFromMintTokenPool.Contract.GetCurrentOutboundRateLimiterState(&_BurnWithFromMintTokenPool.CallOpts, remoteChainSelector) +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolCallerSession) GetCurrentOutboundRateLimiterState(remoteChainSelector uint64) (RateLimiterTokenBucket, error) { + return _BurnWithFromMintTokenPool.Contract.GetCurrentOutboundRateLimiterState(&_BurnWithFromMintTokenPool.CallOpts, remoteChainSelector) +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolCaller) GetRateLimitAdmin(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _BurnWithFromMintTokenPool.contract.Call(opts, &out, "getRateLimitAdmin") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolSession) GetRateLimitAdmin() (common.Address, error) { + return _BurnWithFromMintTokenPool.Contract.GetRateLimitAdmin(&_BurnWithFromMintTokenPool.CallOpts) +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolCallerSession) GetRateLimitAdmin() (common.Address, error) { + return _BurnWithFromMintTokenPool.Contract.GetRateLimitAdmin(&_BurnWithFromMintTokenPool.CallOpts) +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolCaller) GetRemotePool(opts *bind.CallOpts, remoteChainSelector uint64) ([]byte, error) { + var out []interface{} + err := _BurnWithFromMintTokenPool.contract.Call(opts, &out, "getRemotePool", remoteChainSelector) + + if err != nil { + return *new([]byte), err + } + + out0 := *abi.ConvertType(out[0], new([]byte)).(*[]byte) + + return out0, err + +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolSession) GetRemotePool(remoteChainSelector uint64) ([]byte, error) { + return _BurnWithFromMintTokenPool.Contract.GetRemotePool(&_BurnWithFromMintTokenPool.CallOpts, remoteChainSelector) +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolCallerSession) GetRemotePool(remoteChainSelector uint64) ([]byte, error) { + return _BurnWithFromMintTokenPool.Contract.GetRemotePool(&_BurnWithFromMintTokenPool.CallOpts, remoteChainSelector) +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolCaller) GetRemoteToken(opts *bind.CallOpts, remoteChainSelector uint64) ([]byte, error) { + var out []interface{} + err := _BurnWithFromMintTokenPool.contract.Call(opts, &out, "getRemoteToken", remoteChainSelector) + + if err != nil { + return *new([]byte), err + } + + out0 := *abi.ConvertType(out[0], new([]byte)).(*[]byte) + + return out0, err + +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolSession) GetRemoteToken(remoteChainSelector uint64) ([]byte, error) { + return _BurnWithFromMintTokenPool.Contract.GetRemoteToken(&_BurnWithFromMintTokenPool.CallOpts, remoteChainSelector) +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolCallerSession) GetRemoteToken(remoteChainSelector uint64) ([]byte, error) { + return _BurnWithFromMintTokenPool.Contract.GetRemoteToken(&_BurnWithFromMintTokenPool.CallOpts, remoteChainSelector) +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolCaller) GetRmnProxy(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _BurnWithFromMintTokenPool.contract.Call(opts, &out, "getRmnProxy") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolSession) GetRmnProxy() (common.Address, error) { + return _BurnWithFromMintTokenPool.Contract.GetRmnProxy(&_BurnWithFromMintTokenPool.CallOpts) +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolCallerSession) GetRmnProxy() (common.Address, error) { + return _BurnWithFromMintTokenPool.Contract.GetRmnProxy(&_BurnWithFromMintTokenPool.CallOpts) +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolCaller) GetRouter(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _BurnWithFromMintTokenPool.contract.Call(opts, &out, "getRouter") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolSession) GetRouter() (common.Address, error) { + return _BurnWithFromMintTokenPool.Contract.GetRouter(&_BurnWithFromMintTokenPool.CallOpts) +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolCallerSession) GetRouter() (common.Address, error) { + return _BurnWithFromMintTokenPool.Contract.GetRouter(&_BurnWithFromMintTokenPool.CallOpts) +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolCaller) GetSupportedChains(opts *bind.CallOpts) ([]uint64, error) { + var out []interface{} + err := _BurnWithFromMintTokenPool.contract.Call(opts, &out, "getSupportedChains") + + if err != nil { + return *new([]uint64), err + } + + out0 := *abi.ConvertType(out[0], new([]uint64)).(*[]uint64) + + return out0, err + +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolSession) GetSupportedChains() ([]uint64, error) { + return _BurnWithFromMintTokenPool.Contract.GetSupportedChains(&_BurnWithFromMintTokenPool.CallOpts) +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolCallerSession) GetSupportedChains() ([]uint64, error) { + return _BurnWithFromMintTokenPool.Contract.GetSupportedChains(&_BurnWithFromMintTokenPool.CallOpts) +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolCaller) GetToken(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _BurnWithFromMintTokenPool.contract.Call(opts, &out, "getToken") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolSession) GetToken() (common.Address, error) { + return _BurnWithFromMintTokenPool.Contract.GetToken(&_BurnWithFromMintTokenPool.CallOpts) +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolCallerSession) GetToken() (common.Address, error) { + return _BurnWithFromMintTokenPool.Contract.GetToken(&_BurnWithFromMintTokenPool.CallOpts) +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolCaller) IsSupportedChain(opts *bind.CallOpts, remoteChainSelector uint64) (bool, error) { + var out []interface{} + err := _BurnWithFromMintTokenPool.contract.Call(opts, &out, "isSupportedChain", remoteChainSelector) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolSession) IsSupportedChain(remoteChainSelector uint64) (bool, error) { + return _BurnWithFromMintTokenPool.Contract.IsSupportedChain(&_BurnWithFromMintTokenPool.CallOpts, remoteChainSelector) +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolCallerSession) IsSupportedChain(remoteChainSelector uint64) (bool, error) { + return _BurnWithFromMintTokenPool.Contract.IsSupportedChain(&_BurnWithFromMintTokenPool.CallOpts, remoteChainSelector) +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolCaller) IsSupportedToken(opts *bind.CallOpts, token common.Address) (bool, error) { + var out []interface{} + err := _BurnWithFromMintTokenPool.contract.Call(opts, &out, "isSupportedToken", token) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolSession) IsSupportedToken(token common.Address) (bool, error) { + return _BurnWithFromMintTokenPool.Contract.IsSupportedToken(&_BurnWithFromMintTokenPool.CallOpts, token) +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolCallerSession) IsSupportedToken(token common.Address) (bool, error) { + return _BurnWithFromMintTokenPool.Contract.IsSupportedToken(&_BurnWithFromMintTokenPool.CallOpts, token) +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolCaller) Owner(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _BurnWithFromMintTokenPool.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 + +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolSession) Owner() (common.Address, error) { + return _BurnWithFromMintTokenPool.Contract.Owner(&_BurnWithFromMintTokenPool.CallOpts) +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolCallerSession) Owner() (common.Address, error) { + return _BurnWithFromMintTokenPool.Contract.Owner(&_BurnWithFromMintTokenPool.CallOpts) +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolCaller) SupportsInterface(opts *bind.CallOpts, interfaceId [4]byte) (bool, error) { + var out []interface{} + err := _BurnWithFromMintTokenPool.contract.Call(opts, &out, "supportsInterface", interfaceId) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolSession) SupportsInterface(interfaceId [4]byte) (bool, error) { + return _BurnWithFromMintTokenPool.Contract.SupportsInterface(&_BurnWithFromMintTokenPool.CallOpts, interfaceId) +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolCallerSession) SupportsInterface(interfaceId [4]byte) (bool, error) { + return _BurnWithFromMintTokenPool.Contract.SupportsInterface(&_BurnWithFromMintTokenPool.CallOpts, interfaceId) +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolCaller) TypeAndVersion(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _BurnWithFromMintTokenPool.contract.Call(opts, &out, "typeAndVersion") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolSession) TypeAndVersion() (string, error) { + return _BurnWithFromMintTokenPool.Contract.TypeAndVersion(&_BurnWithFromMintTokenPool.CallOpts) +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolCallerSession) TypeAndVersion() (string, error) { + return _BurnWithFromMintTokenPool.Contract.TypeAndVersion(&_BurnWithFromMintTokenPool.CallOpts) +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolTransactor) AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + return _BurnWithFromMintTokenPool.contract.Transact(opts, "acceptOwnership") +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolSession) AcceptOwnership() (*types.Transaction, error) { + return _BurnWithFromMintTokenPool.Contract.AcceptOwnership(&_BurnWithFromMintTokenPool.TransactOpts) +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolTransactorSession) AcceptOwnership() (*types.Transaction, error) { + return _BurnWithFromMintTokenPool.Contract.AcceptOwnership(&_BurnWithFromMintTokenPool.TransactOpts) +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolTransactor) ApplyAllowListUpdates(opts *bind.TransactOpts, removes []common.Address, adds []common.Address) (*types.Transaction, error) { + return _BurnWithFromMintTokenPool.contract.Transact(opts, "applyAllowListUpdates", removes, adds) +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolSession) ApplyAllowListUpdates(removes []common.Address, adds []common.Address) (*types.Transaction, error) { + return _BurnWithFromMintTokenPool.Contract.ApplyAllowListUpdates(&_BurnWithFromMintTokenPool.TransactOpts, removes, adds) +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolTransactorSession) ApplyAllowListUpdates(removes []common.Address, adds []common.Address) (*types.Transaction, error) { + return _BurnWithFromMintTokenPool.Contract.ApplyAllowListUpdates(&_BurnWithFromMintTokenPool.TransactOpts, removes, adds) +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolTransactor) ApplyChainUpdates(opts *bind.TransactOpts, chains []TokenPoolChainUpdate) (*types.Transaction, error) { + return _BurnWithFromMintTokenPool.contract.Transact(opts, "applyChainUpdates", chains) +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolSession) ApplyChainUpdates(chains []TokenPoolChainUpdate) (*types.Transaction, error) { + return _BurnWithFromMintTokenPool.Contract.ApplyChainUpdates(&_BurnWithFromMintTokenPool.TransactOpts, chains) +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolTransactorSession) ApplyChainUpdates(chains []TokenPoolChainUpdate) (*types.Transaction, error) { + return _BurnWithFromMintTokenPool.Contract.ApplyChainUpdates(&_BurnWithFromMintTokenPool.TransactOpts, chains) +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolTransactor) LockOrBurn(opts *bind.TransactOpts, lockOrBurnIn PoolLockOrBurnInV1) (*types.Transaction, error) { + return _BurnWithFromMintTokenPool.contract.Transact(opts, "lockOrBurn", lockOrBurnIn) +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolSession) LockOrBurn(lockOrBurnIn PoolLockOrBurnInV1) (*types.Transaction, error) { + return _BurnWithFromMintTokenPool.Contract.LockOrBurn(&_BurnWithFromMintTokenPool.TransactOpts, lockOrBurnIn) +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolTransactorSession) LockOrBurn(lockOrBurnIn PoolLockOrBurnInV1) (*types.Transaction, error) { + return _BurnWithFromMintTokenPool.Contract.LockOrBurn(&_BurnWithFromMintTokenPool.TransactOpts, lockOrBurnIn) +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolTransactor) ReleaseOrMint(opts *bind.TransactOpts, releaseOrMintIn PoolReleaseOrMintInV1) (*types.Transaction, error) { + return _BurnWithFromMintTokenPool.contract.Transact(opts, "releaseOrMint", releaseOrMintIn) +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolSession) ReleaseOrMint(releaseOrMintIn PoolReleaseOrMintInV1) (*types.Transaction, error) { + return _BurnWithFromMintTokenPool.Contract.ReleaseOrMint(&_BurnWithFromMintTokenPool.TransactOpts, releaseOrMintIn) +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolTransactorSession) ReleaseOrMint(releaseOrMintIn PoolReleaseOrMintInV1) (*types.Transaction, error) { + return _BurnWithFromMintTokenPool.Contract.ReleaseOrMint(&_BurnWithFromMintTokenPool.TransactOpts, releaseOrMintIn) +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolTransactor) SetChainRateLimiterConfig(opts *bind.TransactOpts, remoteChainSelector uint64, outboundConfig RateLimiterConfig, inboundConfig RateLimiterConfig) (*types.Transaction, error) { + return _BurnWithFromMintTokenPool.contract.Transact(opts, "setChainRateLimiterConfig", remoteChainSelector, outboundConfig, inboundConfig) +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolSession) SetChainRateLimiterConfig(remoteChainSelector uint64, outboundConfig RateLimiterConfig, inboundConfig RateLimiterConfig) (*types.Transaction, error) { + return _BurnWithFromMintTokenPool.Contract.SetChainRateLimiterConfig(&_BurnWithFromMintTokenPool.TransactOpts, remoteChainSelector, outboundConfig, inboundConfig) +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolTransactorSession) SetChainRateLimiterConfig(remoteChainSelector uint64, outboundConfig RateLimiterConfig, inboundConfig RateLimiterConfig) (*types.Transaction, error) { + return _BurnWithFromMintTokenPool.Contract.SetChainRateLimiterConfig(&_BurnWithFromMintTokenPool.TransactOpts, remoteChainSelector, outboundConfig, inboundConfig) +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolTransactor) SetRateLimitAdmin(opts *bind.TransactOpts, rateLimitAdmin common.Address) (*types.Transaction, error) { + return _BurnWithFromMintTokenPool.contract.Transact(opts, "setRateLimitAdmin", rateLimitAdmin) +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolSession) SetRateLimitAdmin(rateLimitAdmin common.Address) (*types.Transaction, error) { + return _BurnWithFromMintTokenPool.Contract.SetRateLimitAdmin(&_BurnWithFromMintTokenPool.TransactOpts, rateLimitAdmin) +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolTransactorSession) SetRateLimitAdmin(rateLimitAdmin common.Address) (*types.Transaction, error) { + return _BurnWithFromMintTokenPool.Contract.SetRateLimitAdmin(&_BurnWithFromMintTokenPool.TransactOpts, rateLimitAdmin) +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolTransactor) SetRemotePool(opts *bind.TransactOpts, remoteChainSelector uint64, remotePoolAddress []byte) (*types.Transaction, error) { + return _BurnWithFromMintTokenPool.contract.Transact(opts, "setRemotePool", remoteChainSelector, remotePoolAddress) +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolSession) SetRemotePool(remoteChainSelector uint64, remotePoolAddress []byte) (*types.Transaction, error) { + return _BurnWithFromMintTokenPool.Contract.SetRemotePool(&_BurnWithFromMintTokenPool.TransactOpts, remoteChainSelector, remotePoolAddress) +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolTransactorSession) SetRemotePool(remoteChainSelector uint64, remotePoolAddress []byte) (*types.Transaction, error) { + return _BurnWithFromMintTokenPool.Contract.SetRemotePool(&_BurnWithFromMintTokenPool.TransactOpts, remoteChainSelector, remotePoolAddress) +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolTransactor) SetRouter(opts *bind.TransactOpts, newRouter common.Address) (*types.Transaction, error) { + return _BurnWithFromMintTokenPool.contract.Transact(opts, "setRouter", newRouter) +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolSession) SetRouter(newRouter common.Address) (*types.Transaction, error) { + return _BurnWithFromMintTokenPool.Contract.SetRouter(&_BurnWithFromMintTokenPool.TransactOpts, newRouter) +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolTransactorSession) SetRouter(newRouter common.Address) (*types.Transaction, error) { + return _BurnWithFromMintTokenPool.Contract.SetRouter(&_BurnWithFromMintTokenPool.TransactOpts, newRouter) +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolTransactor) TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) { + return _BurnWithFromMintTokenPool.contract.Transact(opts, "transferOwnership", to) +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolSession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _BurnWithFromMintTokenPool.Contract.TransferOwnership(&_BurnWithFromMintTokenPool.TransactOpts, to) +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolTransactorSession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _BurnWithFromMintTokenPool.Contract.TransferOwnership(&_BurnWithFromMintTokenPool.TransactOpts, to) +} + +type BurnWithFromMintTokenPoolAllowListAddIterator struct { + Event *BurnWithFromMintTokenPoolAllowListAdd + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *BurnWithFromMintTokenPoolAllowListAddIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(BurnWithFromMintTokenPoolAllowListAdd) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(BurnWithFromMintTokenPoolAllowListAdd) + 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() + } +} + +func (it *BurnWithFromMintTokenPoolAllowListAddIterator) Error() error { + return it.fail +} + +func (it *BurnWithFromMintTokenPoolAllowListAddIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type BurnWithFromMintTokenPoolAllowListAdd struct { + Sender common.Address + Raw types.Log +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolFilterer) FilterAllowListAdd(opts *bind.FilterOpts) (*BurnWithFromMintTokenPoolAllowListAddIterator, error) { + + logs, sub, err := _BurnWithFromMintTokenPool.contract.FilterLogs(opts, "AllowListAdd") + if err != nil { + return nil, err + } + return &BurnWithFromMintTokenPoolAllowListAddIterator{contract: _BurnWithFromMintTokenPool.contract, event: "AllowListAdd", logs: logs, sub: sub}, nil +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolFilterer) WatchAllowListAdd(opts *bind.WatchOpts, sink chan<- *BurnWithFromMintTokenPoolAllowListAdd) (event.Subscription, error) { + + logs, sub, err := _BurnWithFromMintTokenPool.contract.WatchLogs(opts, "AllowListAdd") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(BurnWithFromMintTokenPoolAllowListAdd) + if err := _BurnWithFromMintTokenPool.contract.UnpackLog(event, "AllowListAdd", 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 +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolFilterer) ParseAllowListAdd(log types.Log) (*BurnWithFromMintTokenPoolAllowListAdd, error) { + event := new(BurnWithFromMintTokenPoolAllowListAdd) + if err := _BurnWithFromMintTokenPool.contract.UnpackLog(event, "AllowListAdd", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type BurnWithFromMintTokenPoolAllowListRemoveIterator struct { + Event *BurnWithFromMintTokenPoolAllowListRemove + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *BurnWithFromMintTokenPoolAllowListRemoveIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(BurnWithFromMintTokenPoolAllowListRemove) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(BurnWithFromMintTokenPoolAllowListRemove) + 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() + } +} + +func (it *BurnWithFromMintTokenPoolAllowListRemoveIterator) Error() error { + return it.fail +} + +func (it *BurnWithFromMintTokenPoolAllowListRemoveIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type BurnWithFromMintTokenPoolAllowListRemove struct { + Sender common.Address + Raw types.Log +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolFilterer) FilterAllowListRemove(opts *bind.FilterOpts) (*BurnWithFromMintTokenPoolAllowListRemoveIterator, error) { + + logs, sub, err := _BurnWithFromMintTokenPool.contract.FilterLogs(opts, "AllowListRemove") + if err != nil { + return nil, err + } + return &BurnWithFromMintTokenPoolAllowListRemoveIterator{contract: _BurnWithFromMintTokenPool.contract, event: "AllowListRemove", logs: logs, sub: sub}, nil +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolFilterer) WatchAllowListRemove(opts *bind.WatchOpts, sink chan<- *BurnWithFromMintTokenPoolAllowListRemove) (event.Subscription, error) { + + logs, sub, err := _BurnWithFromMintTokenPool.contract.WatchLogs(opts, "AllowListRemove") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(BurnWithFromMintTokenPoolAllowListRemove) + if err := _BurnWithFromMintTokenPool.contract.UnpackLog(event, "AllowListRemove", 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 +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolFilterer) ParseAllowListRemove(log types.Log) (*BurnWithFromMintTokenPoolAllowListRemove, error) { + event := new(BurnWithFromMintTokenPoolAllowListRemove) + if err := _BurnWithFromMintTokenPool.contract.UnpackLog(event, "AllowListRemove", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type BurnWithFromMintTokenPoolBurnedIterator struct { + Event *BurnWithFromMintTokenPoolBurned + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *BurnWithFromMintTokenPoolBurnedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(BurnWithFromMintTokenPoolBurned) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(BurnWithFromMintTokenPoolBurned) + 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() + } +} + +func (it *BurnWithFromMintTokenPoolBurnedIterator) Error() error { + return it.fail +} + +func (it *BurnWithFromMintTokenPoolBurnedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type BurnWithFromMintTokenPoolBurned struct { + Sender common.Address + Amount *big.Int + Raw types.Log +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolFilterer) FilterBurned(opts *bind.FilterOpts, sender []common.Address) (*BurnWithFromMintTokenPoolBurnedIterator, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _BurnWithFromMintTokenPool.contract.FilterLogs(opts, "Burned", senderRule) + if err != nil { + return nil, err + } + return &BurnWithFromMintTokenPoolBurnedIterator{contract: _BurnWithFromMintTokenPool.contract, event: "Burned", logs: logs, sub: sub}, nil +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolFilterer) WatchBurned(opts *bind.WatchOpts, sink chan<- *BurnWithFromMintTokenPoolBurned, sender []common.Address) (event.Subscription, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _BurnWithFromMintTokenPool.contract.WatchLogs(opts, "Burned", senderRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(BurnWithFromMintTokenPoolBurned) + if err := _BurnWithFromMintTokenPool.contract.UnpackLog(event, "Burned", 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 +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolFilterer) ParseBurned(log types.Log) (*BurnWithFromMintTokenPoolBurned, error) { + event := new(BurnWithFromMintTokenPoolBurned) + if err := _BurnWithFromMintTokenPool.contract.UnpackLog(event, "Burned", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type BurnWithFromMintTokenPoolChainAddedIterator struct { + Event *BurnWithFromMintTokenPoolChainAdded + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *BurnWithFromMintTokenPoolChainAddedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(BurnWithFromMintTokenPoolChainAdded) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(BurnWithFromMintTokenPoolChainAdded) + 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() + } +} + +func (it *BurnWithFromMintTokenPoolChainAddedIterator) Error() error { + return it.fail +} + +func (it *BurnWithFromMintTokenPoolChainAddedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type BurnWithFromMintTokenPoolChainAdded struct { + RemoteChainSelector uint64 + RemoteToken []byte + OutboundRateLimiterConfig RateLimiterConfig + InboundRateLimiterConfig RateLimiterConfig + Raw types.Log +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolFilterer) FilterChainAdded(opts *bind.FilterOpts) (*BurnWithFromMintTokenPoolChainAddedIterator, error) { + + logs, sub, err := _BurnWithFromMintTokenPool.contract.FilterLogs(opts, "ChainAdded") + if err != nil { + return nil, err + } + return &BurnWithFromMintTokenPoolChainAddedIterator{contract: _BurnWithFromMintTokenPool.contract, event: "ChainAdded", logs: logs, sub: sub}, nil +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolFilterer) WatchChainAdded(opts *bind.WatchOpts, sink chan<- *BurnWithFromMintTokenPoolChainAdded) (event.Subscription, error) { + + logs, sub, err := _BurnWithFromMintTokenPool.contract.WatchLogs(opts, "ChainAdded") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(BurnWithFromMintTokenPoolChainAdded) + if err := _BurnWithFromMintTokenPool.contract.UnpackLog(event, "ChainAdded", 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 +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolFilterer) ParseChainAdded(log types.Log) (*BurnWithFromMintTokenPoolChainAdded, error) { + event := new(BurnWithFromMintTokenPoolChainAdded) + if err := _BurnWithFromMintTokenPool.contract.UnpackLog(event, "ChainAdded", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type BurnWithFromMintTokenPoolChainConfiguredIterator struct { + Event *BurnWithFromMintTokenPoolChainConfigured + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *BurnWithFromMintTokenPoolChainConfiguredIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(BurnWithFromMintTokenPoolChainConfigured) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(BurnWithFromMintTokenPoolChainConfigured) + 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() + } +} + +func (it *BurnWithFromMintTokenPoolChainConfiguredIterator) Error() error { + return it.fail +} + +func (it *BurnWithFromMintTokenPoolChainConfiguredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type BurnWithFromMintTokenPoolChainConfigured struct { + RemoteChainSelector uint64 + OutboundRateLimiterConfig RateLimiterConfig + InboundRateLimiterConfig RateLimiterConfig + Raw types.Log +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolFilterer) FilterChainConfigured(opts *bind.FilterOpts) (*BurnWithFromMintTokenPoolChainConfiguredIterator, error) { + + logs, sub, err := _BurnWithFromMintTokenPool.contract.FilterLogs(opts, "ChainConfigured") + if err != nil { + return nil, err + } + return &BurnWithFromMintTokenPoolChainConfiguredIterator{contract: _BurnWithFromMintTokenPool.contract, event: "ChainConfigured", logs: logs, sub: sub}, nil +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolFilterer) WatchChainConfigured(opts *bind.WatchOpts, sink chan<- *BurnWithFromMintTokenPoolChainConfigured) (event.Subscription, error) { + + logs, sub, err := _BurnWithFromMintTokenPool.contract.WatchLogs(opts, "ChainConfigured") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(BurnWithFromMintTokenPoolChainConfigured) + if err := _BurnWithFromMintTokenPool.contract.UnpackLog(event, "ChainConfigured", 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 +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolFilterer) ParseChainConfigured(log types.Log) (*BurnWithFromMintTokenPoolChainConfigured, error) { + event := new(BurnWithFromMintTokenPoolChainConfigured) + if err := _BurnWithFromMintTokenPool.contract.UnpackLog(event, "ChainConfigured", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type BurnWithFromMintTokenPoolChainRemovedIterator struct { + Event *BurnWithFromMintTokenPoolChainRemoved + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *BurnWithFromMintTokenPoolChainRemovedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(BurnWithFromMintTokenPoolChainRemoved) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(BurnWithFromMintTokenPoolChainRemoved) + 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() + } +} + +func (it *BurnWithFromMintTokenPoolChainRemovedIterator) Error() error { + return it.fail +} + +func (it *BurnWithFromMintTokenPoolChainRemovedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type BurnWithFromMintTokenPoolChainRemoved struct { + RemoteChainSelector uint64 + Raw types.Log +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolFilterer) FilterChainRemoved(opts *bind.FilterOpts) (*BurnWithFromMintTokenPoolChainRemovedIterator, error) { + + logs, sub, err := _BurnWithFromMintTokenPool.contract.FilterLogs(opts, "ChainRemoved") + if err != nil { + return nil, err + } + return &BurnWithFromMintTokenPoolChainRemovedIterator{contract: _BurnWithFromMintTokenPool.contract, event: "ChainRemoved", logs: logs, sub: sub}, nil +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolFilterer) WatchChainRemoved(opts *bind.WatchOpts, sink chan<- *BurnWithFromMintTokenPoolChainRemoved) (event.Subscription, error) { + + logs, sub, err := _BurnWithFromMintTokenPool.contract.WatchLogs(opts, "ChainRemoved") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(BurnWithFromMintTokenPoolChainRemoved) + if err := _BurnWithFromMintTokenPool.contract.UnpackLog(event, "ChainRemoved", 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 +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolFilterer) ParseChainRemoved(log types.Log) (*BurnWithFromMintTokenPoolChainRemoved, error) { + event := new(BurnWithFromMintTokenPoolChainRemoved) + if err := _BurnWithFromMintTokenPool.contract.UnpackLog(event, "ChainRemoved", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type BurnWithFromMintTokenPoolConfigChangedIterator struct { + Event *BurnWithFromMintTokenPoolConfigChanged + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *BurnWithFromMintTokenPoolConfigChangedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(BurnWithFromMintTokenPoolConfigChanged) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(BurnWithFromMintTokenPoolConfigChanged) + 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() + } +} + +func (it *BurnWithFromMintTokenPoolConfigChangedIterator) Error() error { + return it.fail +} + +func (it *BurnWithFromMintTokenPoolConfigChangedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type BurnWithFromMintTokenPoolConfigChanged struct { + Config RateLimiterConfig + Raw types.Log +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolFilterer) FilterConfigChanged(opts *bind.FilterOpts) (*BurnWithFromMintTokenPoolConfigChangedIterator, error) { + + logs, sub, err := _BurnWithFromMintTokenPool.contract.FilterLogs(opts, "ConfigChanged") + if err != nil { + return nil, err + } + return &BurnWithFromMintTokenPoolConfigChangedIterator{contract: _BurnWithFromMintTokenPool.contract, event: "ConfigChanged", logs: logs, sub: sub}, nil +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolFilterer) WatchConfigChanged(opts *bind.WatchOpts, sink chan<- *BurnWithFromMintTokenPoolConfigChanged) (event.Subscription, error) { + + logs, sub, err := _BurnWithFromMintTokenPool.contract.WatchLogs(opts, "ConfigChanged") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(BurnWithFromMintTokenPoolConfigChanged) + if err := _BurnWithFromMintTokenPool.contract.UnpackLog(event, "ConfigChanged", 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 +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolFilterer) ParseConfigChanged(log types.Log) (*BurnWithFromMintTokenPoolConfigChanged, error) { + event := new(BurnWithFromMintTokenPoolConfigChanged) + if err := _BurnWithFromMintTokenPool.contract.UnpackLog(event, "ConfigChanged", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type BurnWithFromMintTokenPoolLockedIterator struct { + Event *BurnWithFromMintTokenPoolLocked + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *BurnWithFromMintTokenPoolLockedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(BurnWithFromMintTokenPoolLocked) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(BurnWithFromMintTokenPoolLocked) + 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() + } +} + +func (it *BurnWithFromMintTokenPoolLockedIterator) Error() error { + return it.fail +} + +func (it *BurnWithFromMintTokenPoolLockedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type BurnWithFromMintTokenPoolLocked struct { + Sender common.Address + Amount *big.Int + Raw types.Log +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolFilterer) FilterLocked(opts *bind.FilterOpts, sender []common.Address) (*BurnWithFromMintTokenPoolLockedIterator, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _BurnWithFromMintTokenPool.contract.FilterLogs(opts, "Locked", senderRule) + if err != nil { + return nil, err + } + return &BurnWithFromMintTokenPoolLockedIterator{contract: _BurnWithFromMintTokenPool.contract, event: "Locked", logs: logs, sub: sub}, nil +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolFilterer) WatchLocked(opts *bind.WatchOpts, sink chan<- *BurnWithFromMintTokenPoolLocked, sender []common.Address) (event.Subscription, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _BurnWithFromMintTokenPool.contract.WatchLogs(opts, "Locked", senderRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(BurnWithFromMintTokenPoolLocked) + if err := _BurnWithFromMintTokenPool.contract.UnpackLog(event, "Locked", 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 +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolFilterer) ParseLocked(log types.Log) (*BurnWithFromMintTokenPoolLocked, error) { + event := new(BurnWithFromMintTokenPoolLocked) + if err := _BurnWithFromMintTokenPool.contract.UnpackLog(event, "Locked", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type BurnWithFromMintTokenPoolMintedIterator struct { + Event *BurnWithFromMintTokenPoolMinted + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *BurnWithFromMintTokenPoolMintedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(BurnWithFromMintTokenPoolMinted) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(BurnWithFromMintTokenPoolMinted) + 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() + } +} + +func (it *BurnWithFromMintTokenPoolMintedIterator) Error() error { + return it.fail +} + +func (it *BurnWithFromMintTokenPoolMintedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type BurnWithFromMintTokenPoolMinted struct { + Sender common.Address + Recipient common.Address + Amount *big.Int + Raw types.Log +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolFilterer) FilterMinted(opts *bind.FilterOpts, sender []common.Address, recipient []common.Address) (*BurnWithFromMintTokenPoolMintedIterator, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + var recipientRule []interface{} + for _, recipientItem := range recipient { + recipientRule = append(recipientRule, recipientItem) + } + + logs, sub, err := _BurnWithFromMintTokenPool.contract.FilterLogs(opts, "Minted", senderRule, recipientRule) + if err != nil { + return nil, err + } + return &BurnWithFromMintTokenPoolMintedIterator{contract: _BurnWithFromMintTokenPool.contract, event: "Minted", logs: logs, sub: sub}, nil +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolFilterer) WatchMinted(opts *bind.WatchOpts, sink chan<- *BurnWithFromMintTokenPoolMinted, sender []common.Address, recipient []common.Address) (event.Subscription, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + var recipientRule []interface{} + for _, recipientItem := range recipient { + recipientRule = append(recipientRule, recipientItem) + } + + logs, sub, err := _BurnWithFromMintTokenPool.contract.WatchLogs(opts, "Minted", senderRule, recipientRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(BurnWithFromMintTokenPoolMinted) + if err := _BurnWithFromMintTokenPool.contract.UnpackLog(event, "Minted", 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 +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolFilterer) ParseMinted(log types.Log) (*BurnWithFromMintTokenPoolMinted, error) { + event := new(BurnWithFromMintTokenPoolMinted) + if err := _BurnWithFromMintTokenPool.contract.UnpackLog(event, "Minted", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type BurnWithFromMintTokenPoolOwnershipTransferRequestedIterator struct { + Event *BurnWithFromMintTokenPoolOwnershipTransferRequested + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *BurnWithFromMintTokenPoolOwnershipTransferRequestedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(BurnWithFromMintTokenPoolOwnershipTransferRequested) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(BurnWithFromMintTokenPoolOwnershipTransferRequested) + 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() + } +} + +func (it *BurnWithFromMintTokenPoolOwnershipTransferRequestedIterator) Error() error { + return it.fail +} + +func (it *BurnWithFromMintTokenPoolOwnershipTransferRequestedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type BurnWithFromMintTokenPoolOwnershipTransferRequested struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolFilterer) FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*BurnWithFromMintTokenPoolOwnershipTransferRequestedIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _BurnWithFromMintTokenPool.contract.FilterLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return &BurnWithFromMintTokenPoolOwnershipTransferRequestedIterator{contract: _BurnWithFromMintTokenPool.contract, event: "OwnershipTransferRequested", logs: logs, sub: sub}, nil +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolFilterer) WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *BurnWithFromMintTokenPoolOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _BurnWithFromMintTokenPool.contract.WatchLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(BurnWithFromMintTokenPoolOwnershipTransferRequested) + if err := _BurnWithFromMintTokenPool.contract.UnpackLog(event, "OwnershipTransferRequested", 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 +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolFilterer) ParseOwnershipTransferRequested(log types.Log) (*BurnWithFromMintTokenPoolOwnershipTransferRequested, error) { + event := new(BurnWithFromMintTokenPoolOwnershipTransferRequested) + if err := _BurnWithFromMintTokenPool.contract.UnpackLog(event, "OwnershipTransferRequested", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type BurnWithFromMintTokenPoolOwnershipTransferredIterator struct { + Event *BurnWithFromMintTokenPoolOwnershipTransferred + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *BurnWithFromMintTokenPoolOwnershipTransferredIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(BurnWithFromMintTokenPoolOwnershipTransferred) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(BurnWithFromMintTokenPoolOwnershipTransferred) + 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() + } +} + +func (it *BurnWithFromMintTokenPoolOwnershipTransferredIterator) Error() error { + return it.fail +} + +func (it *BurnWithFromMintTokenPoolOwnershipTransferredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type BurnWithFromMintTokenPoolOwnershipTransferred struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*BurnWithFromMintTokenPoolOwnershipTransferredIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _BurnWithFromMintTokenPool.contract.FilterLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return &BurnWithFromMintTokenPoolOwnershipTransferredIterator{contract: _BurnWithFromMintTokenPool.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *BurnWithFromMintTokenPoolOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _BurnWithFromMintTokenPool.contract.WatchLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(BurnWithFromMintTokenPoolOwnershipTransferred) + if err := _BurnWithFromMintTokenPool.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 +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolFilterer) ParseOwnershipTransferred(log types.Log) (*BurnWithFromMintTokenPoolOwnershipTransferred, error) { + event := new(BurnWithFromMintTokenPoolOwnershipTransferred) + if err := _BurnWithFromMintTokenPool.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type BurnWithFromMintTokenPoolReleasedIterator struct { + Event *BurnWithFromMintTokenPoolReleased + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *BurnWithFromMintTokenPoolReleasedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(BurnWithFromMintTokenPoolReleased) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(BurnWithFromMintTokenPoolReleased) + 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() + } +} + +func (it *BurnWithFromMintTokenPoolReleasedIterator) Error() error { + return it.fail +} + +func (it *BurnWithFromMintTokenPoolReleasedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type BurnWithFromMintTokenPoolReleased struct { + Sender common.Address + Recipient common.Address + Amount *big.Int + Raw types.Log +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolFilterer) FilterReleased(opts *bind.FilterOpts, sender []common.Address, recipient []common.Address) (*BurnWithFromMintTokenPoolReleasedIterator, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + var recipientRule []interface{} + for _, recipientItem := range recipient { + recipientRule = append(recipientRule, recipientItem) + } + + logs, sub, err := _BurnWithFromMintTokenPool.contract.FilterLogs(opts, "Released", senderRule, recipientRule) + if err != nil { + return nil, err + } + return &BurnWithFromMintTokenPoolReleasedIterator{contract: _BurnWithFromMintTokenPool.contract, event: "Released", logs: logs, sub: sub}, nil +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolFilterer) WatchReleased(opts *bind.WatchOpts, sink chan<- *BurnWithFromMintTokenPoolReleased, sender []common.Address, recipient []common.Address) (event.Subscription, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + var recipientRule []interface{} + for _, recipientItem := range recipient { + recipientRule = append(recipientRule, recipientItem) + } + + logs, sub, err := _BurnWithFromMintTokenPool.contract.WatchLogs(opts, "Released", senderRule, recipientRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(BurnWithFromMintTokenPoolReleased) + if err := _BurnWithFromMintTokenPool.contract.UnpackLog(event, "Released", 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 +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolFilterer) ParseReleased(log types.Log) (*BurnWithFromMintTokenPoolReleased, error) { + event := new(BurnWithFromMintTokenPoolReleased) + if err := _BurnWithFromMintTokenPool.contract.UnpackLog(event, "Released", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type BurnWithFromMintTokenPoolRemotePoolSetIterator struct { + Event *BurnWithFromMintTokenPoolRemotePoolSet + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *BurnWithFromMintTokenPoolRemotePoolSetIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(BurnWithFromMintTokenPoolRemotePoolSet) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(BurnWithFromMintTokenPoolRemotePoolSet) + 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() + } +} + +func (it *BurnWithFromMintTokenPoolRemotePoolSetIterator) Error() error { + return it.fail +} + +func (it *BurnWithFromMintTokenPoolRemotePoolSetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type BurnWithFromMintTokenPoolRemotePoolSet struct { + RemoteChainSelector uint64 + PreviousPoolAddress []byte + RemotePoolAddress []byte + Raw types.Log +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolFilterer) FilterRemotePoolSet(opts *bind.FilterOpts, remoteChainSelector []uint64) (*BurnWithFromMintTokenPoolRemotePoolSetIterator, error) { + + var remoteChainSelectorRule []interface{} + for _, remoteChainSelectorItem := range remoteChainSelector { + remoteChainSelectorRule = append(remoteChainSelectorRule, remoteChainSelectorItem) + } + + logs, sub, err := _BurnWithFromMintTokenPool.contract.FilterLogs(opts, "RemotePoolSet", remoteChainSelectorRule) + if err != nil { + return nil, err + } + return &BurnWithFromMintTokenPoolRemotePoolSetIterator{contract: _BurnWithFromMintTokenPool.contract, event: "RemotePoolSet", logs: logs, sub: sub}, nil +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolFilterer) WatchRemotePoolSet(opts *bind.WatchOpts, sink chan<- *BurnWithFromMintTokenPoolRemotePoolSet, remoteChainSelector []uint64) (event.Subscription, error) { + + var remoteChainSelectorRule []interface{} + for _, remoteChainSelectorItem := range remoteChainSelector { + remoteChainSelectorRule = append(remoteChainSelectorRule, remoteChainSelectorItem) + } + + logs, sub, err := _BurnWithFromMintTokenPool.contract.WatchLogs(opts, "RemotePoolSet", remoteChainSelectorRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(BurnWithFromMintTokenPoolRemotePoolSet) + if err := _BurnWithFromMintTokenPool.contract.UnpackLog(event, "RemotePoolSet", 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 +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolFilterer) ParseRemotePoolSet(log types.Log) (*BurnWithFromMintTokenPoolRemotePoolSet, error) { + event := new(BurnWithFromMintTokenPoolRemotePoolSet) + if err := _BurnWithFromMintTokenPool.contract.UnpackLog(event, "RemotePoolSet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type BurnWithFromMintTokenPoolRouterUpdatedIterator struct { + Event *BurnWithFromMintTokenPoolRouterUpdated + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *BurnWithFromMintTokenPoolRouterUpdatedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(BurnWithFromMintTokenPoolRouterUpdated) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(BurnWithFromMintTokenPoolRouterUpdated) + 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() + } +} + +func (it *BurnWithFromMintTokenPoolRouterUpdatedIterator) Error() error { + return it.fail +} + +func (it *BurnWithFromMintTokenPoolRouterUpdatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type BurnWithFromMintTokenPoolRouterUpdated struct { + OldRouter common.Address + NewRouter common.Address + Raw types.Log +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolFilterer) FilterRouterUpdated(opts *bind.FilterOpts) (*BurnWithFromMintTokenPoolRouterUpdatedIterator, error) { + + logs, sub, err := _BurnWithFromMintTokenPool.contract.FilterLogs(opts, "RouterUpdated") + if err != nil { + return nil, err + } + return &BurnWithFromMintTokenPoolRouterUpdatedIterator{contract: _BurnWithFromMintTokenPool.contract, event: "RouterUpdated", logs: logs, sub: sub}, nil +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolFilterer) WatchRouterUpdated(opts *bind.WatchOpts, sink chan<- *BurnWithFromMintTokenPoolRouterUpdated) (event.Subscription, error) { + + logs, sub, err := _BurnWithFromMintTokenPool.contract.WatchLogs(opts, "RouterUpdated") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(BurnWithFromMintTokenPoolRouterUpdated) + if err := _BurnWithFromMintTokenPool.contract.UnpackLog(event, "RouterUpdated", 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 +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolFilterer) ParseRouterUpdated(log types.Log) (*BurnWithFromMintTokenPoolRouterUpdated, error) { + event := new(BurnWithFromMintTokenPoolRouterUpdated) + if err := _BurnWithFromMintTokenPool.contract.UnpackLog(event, "RouterUpdated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type BurnWithFromMintTokenPoolTokensConsumedIterator struct { + Event *BurnWithFromMintTokenPoolTokensConsumed + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *BurnWithFromMintTokenPoolTokensConsumedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(BurnWithFromMintTokenPoolTokensConsumed) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(BurnWithFromMintTokenPoolTokensConsumed) + 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() + } +} + +func (it *BurnWithFromMintTokenPoolTokensConsumedIterator) Error() error { + return it.fail +} + +func (it *BurnWithFromMintTokenPoolTokensConsumedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type BurnWithFromMintTokenPoolTokensConsumed struct { + Tokens *big.Int + Raw types.Log +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolFilterer) FilterTokensConsumed(opts *bind.FilterOpts) (*BurnWithFromMintTokenPoolTokensConsumedIterator, error) { + + logs, sub, err := _BurnWithFromMintTokenPool.contract.FilterLogs(opts, "TokensConsumed") + if err != nil { + return nil, err + } + return &BurnWithFromMintTokenPoolTokensConsumedIterator{contract: _BurnWithFromMintTokenPool.contract, event: "TokensConsumed", logs: logs, sub: sub}, nil +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolFilterer) WatchTokensConsumed(opts *bind.WatchOpts, sink chan<- *BurnWithFromMintTokenPoolTokensConsumed) (event.Subscription, error) { + + logs, sub, err := _BurnWithFromMintTokenPool.contract.WatchLogs(opts, "TokensConsumed") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(BurnWithFromMintTokenPoolTokensConsumed) + if err := _BurnWithFromMintTokenPool.contract.UnpackLog(event, "TokensConsumed", 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 +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPoolFilterer) ParseTokensConsumed(log types.Log) (*BurnWithFromMintTokenPoolTokensConsumed, error) { + event := new(BurnWithFromMintTokenPoolTokensConsumed) + if err := _BurnWithFromMintTokenPool.contract.UnpackLog(event, "TokensConsumed", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPool) ParseLog(log types.Log) (generated.AbigenLog, error) { + switch log.Topics[0] { + case _BurnWithFromMintTokenPool.abi.Events["AllowListAdd"].ID: + return _BurnWithFromMintTokenPool.ParseAllowListAdd(log) + case _BurnWithFromMintTokenPool.abi.Events["AllowListRemove"].ID: + return _BurnWithFromMintTokenPool.ParseAllowListRemove(log) + case _BurnWithFromMintTokenPool.abi.Events["Burned"].ID: + return _BurnWithFromMintTokenPool.ParseBurned(log) + case _BurnWithFromMintTokenPool.abi.Events["ChainAdded"].ID: + return _BurnWithFromMintTokenPool.ParseChainAdded(log) + case _BurnWithFromMintTokenPool.abi.Events["ChainConfigured"].ID: + return _BurnWithFromMintTokenPool.ParseChainConfigured(log) + case _BurnWithFromMintTokenPool.abi.Events["ChainRemoved"].ID: + return _BurnWithFromMintTokenPool.ParseChainRemoved(log) + case _BurnWithFromMintTokenPool.abi.Events["ConfigChanged"].ID: + return _BurnWithFromMintTokenPool.ParseConfigChanged(log) + case _BurnWithFromMintTokenPool.abi.Events["Locked"].ID: + return _BurnWithFromMintTokenPool.ParseLocked(log) + case _BurnWithFromMintTokenPool.abi.Events["Minted"].ID: + return _BurnWithFromMintTokenPool.ParseMinted(log) + case _BurnWithFromMintTokenPool.abi.Events["OwnershipTransferRequested"].ID: + return _BurnWithFromMintTokenPool.ParseOwnershipTransferRequested(log) + case _BurnWithFromMintTokenPool.abi.Events["OwnershipTransferred"].ID: + return _BurnWithFromMintTokenPool.ParseOwnershipTransferred(log) + case _BurnWithFromMintTokenPool.abi.Events["Released"].ID: + return _BurnWithFromMintTokenPool.ParseReleased(log) + case _BurnWithFromMintTokenPool.abi.Events["RemotePoolSet"].ID: + return _BurnWithFromMintTokenPool.ParseRemotePoolSet(log) + case _BurnWithFromMintTokenPool.abi.Events["RouterUpdated"].ID: + return _BurnWithFromMintTokenPool.ParseRouterUpdated(log) + case _BurnWithFromMintTokenPool.abi.Events["TokensConsumed"].ID: + return _BurnWithFromMintTokenPool.ParseTokensConsumed(log) + + default: + return nil, fmt.Errorf("abigen wrapper received unknown log topic: %v", log.Topics[0]) + } +} + +func (BurnWithFromMintTokenPoolAllowListAdd) Topic() common.Hash { + return common.HexToHash("0x2640d4d76caf8bf478aabfa982fa4e1c4eb71a37f93cd15e80dbc657911546d8") +} + +func (BurnWithFromMintTokenPoolAllowListRemove) Topic() common.Hash { + return common.HexToHash("0x800671136ab6cfee9fbe5ed1fb7ca417811aca3cf864800d127b927adedf7566") +} + +func (BurnWithFromMintTokenPoolBurned) Topic() common.Hash { + return common.HexToHash("0x696de425f79f4a40bc6d2122ca50507f0efbeabbff86a84871b7196ab8ea8df7") +} + +func (BurnWithFromMintTokenPoolChainAdded) Topic() common.Hash { + return common.HexToHash("0x8d340f17e19058004c20453540862a9c62778504476f6756755cb33bcd6c38c2") +} + +func (BurnWithFromMintTokenPoolChainConfigured) Topic() common.Hash { + return common.HexToHash("0x0350d63aa5f270e01729d00d627eeb8f3429772b1818c016c66a588a864f912b") +} + +func (BurnWithFromMintTokenPoolChainRemoved) Topic() common.Hash { + return common.HexToHash("0x5204aec90a3c794d8e90fded8b46ae9c7c552803e7e832e0c1d358396d859916") +} + +func (BurnWithFromMintTokenPoolConfigChanged) Topic() common.Hash { + return common.HexToHash("0x9ea3374b67bf275e6bb9c8ae68f9cae023e1c528b4b27e092f0bb209d3531c19") +} + +func (BurnWithFromMintTokenPoolLocked) Topic() common.Hash { + return common.HexToHash("0x9f1ec8c880f76798e7b793325d625e9b60e4082a553c98f42b6cda368dd60008") +} + +func (BurnWithFromMintTokenPoolMinted) Topic() common.Hash { + return common.HexToHash("0x9d228d69b5fdb8d273a2336f8fb8612d039631024ea9bf09c424a9503aa078f0") +} + +func (BurnWithFromMintTokenPoolOwnershipTransferRequested) Topic() common.Hash { + return common.HexToHash("0xed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae1278") +} + +func (BurnWithFromMintTokenPoolOwnershipTransferred) Topic() common.Hash { + return common.HexToHash("0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0") +} + +func (BurnWithFromMintTokenPoolReleased) Topic() common.Hash { + return common.HexToHash("0x2d87480f50083e2b2759522a8fdda59802650a8055e609a7772cf70c07748f52") +} + +func (BurnWithFromMintTokenPoolRemotePoolSet) Topic() common.Hash { + return common.HexToHash("0xdb4d6220746a38cbc5335f7e108f7de80f482f4d23350253dfd0917df75a14bf") +} + +func (BurnWithFromMintTokenPoolRouterUpdated) Topic() common.Hash { + return common.HexToHash("0x02dc5c233404867c793b749c6d644beb2277536d18a7e7974d3f238e4c6f1684") +} + +func (BurnWithFromMintTokenPoolTokensConsumed) Topic() common.Hash { + return common.HexToHash("0x1871cdf8010e63f2eb8384381a68dfa7416dc571a5517e66e88b2d2d0c0a690a") +} + +func (_BurnWithFromMintTokenPool *BurnWithFromMintTokenPool) Address() common.Address { + return _BurnWithFromMintTokenPool.address +} + +type BurnWithFromMintTokenPoolInterface interface { + GetAllowList(opts *bind.CallOpts) ([]common.Address, error) + + GetAllowListEnabled(opts *bind.CallOpts) (bool, error) + + GetCurrentInboundRateLimiterState(opts *bind.CallOpts, remoteChainSelector uint64) (RateLimiterTokenBucket, error) + + GetCurrentOutboundRateLimiterState(opts *bind.CallOpts, remoteChainSelector uint64) (RateLimiterTokenBucket, error) + + GetRateLimitAdmin(opts *bind.CallOpts) (common.Address, error) + + GetRemotePool(opts *bind.CallOpts, remoteChainSelector uint64) ([]byte, error) + + GetRemoteToken(opts *bind.CallOpts, remoteChainSelector uint64) ([]byte, error) + + GetRmnProxy(opts *bind.CallOpts) (common.Address, error) + + GetRouter(opts *bind.CallOpts) (common.Address, error) + + GetSupportedChains(opts *bind.CallOpts) ([]uint64, error) + + GetToken(opts *bind.CallOpts) (common.Address, error) + + IsSupportedChain(opts *bind.CallOpts, remoteChainSelector uint64) (bool, error) + + IsSupportedToken(opts *bind.CallOpts, token common.Address) (bool, error) + + Owner(opts *bind.CallOpts) (common.Address, error) + + SupportsInterface(opts *bind.CallOpts, interfaceId [4]byte) (bool, error) + + TypeAndVersion(opts *bind.CallOpts) (string, error) + + AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) + + ApplyAllowListUpdates(opts *bind.TransactOpts, removes []common.Address, adds []common.Address) (*types.Transaction, error) + + ApplyChainUpdates(opts *bind.TransactOpts, chains []TokenPoolChainUpdate) (*types.Transaction, error) + + LockOrBurn(opts *bind.TransactOpts, lockOrBurnIn PoolLockOrBurnInV1) (*types.Transaction, error) + + ReleaseOrMint(opts *bind.TransactOpts, releaseOrMintIn PoolReleaseOrMintInV1) (*types.Transaction, error) + + SetChainRateLimiterConfig(opts *bind.TransactOpts, remoteChainSelector uint64, outboundConfig RateLimiterConfig, inboundConfig RateLimiterConfig) (*types.Transaction, error) + + SetRateLimitAdmin(opts *bind.TransactOpts, rateLimitAdmin common.Address) (*types.Transaction, error) + + SetRemotePool(opts *bind.TransactOpts, remoteChainSelector uint64, remotePoolAddress []byte) (*types.Transaction, error) + + SetRouter(opts *bind.TransactOpts, newRouter common.Address) (*types.Transaction, error) + + TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) + + FilterAllowListAdd(opts *bind.FilterOpts) (*BurnWithFromMintTokenPoolAllowListAddIterator, error) + + WatchAllowListAdd(opts *bind.WatchOpts, sink chan<- *BurnWithFromMintTokenPoolAllowListAdd) (event.Subscription, error) + + ParseAllowListAdd(log types.Log) (*BurnWithFromMintTokenPoolAllowListAdd, error) + + FilterAllowListRemove(opts *bind.FilterOpts) (*BurnWithFromMintTokenPoolAllowListRemoveIterator, error) + + WatchAllowListRemove(opts *bind.WatchOpts, sink chan<- *BurnWithFromMintTokenPoolAllowListRemove) (event.Subscription, error) + + ParseAllowListRemove(log types.Log) (*BurnWithFromMintTokenPoolAllowListRemove, error) + + FilterBurned(opts *bind.FilterOpts, sender []common.Address) (*BurnWithFromMintTokenPoolBurnedIterator, error) + + WatchBurned(opts *bind.WatchOpts, sink chan<- *BurnWithFromMintTokenPoolBurned, sender []common.Address) (event.Subscription, error) + + ParseBurned(log types.Log) (*BurnWithFromMintTokenPoolBurned, error) + + FilterChainAdded(opts *bind.FilterOpts) (*BurnWithFromMintTokenPoolChainAddedIterator, error) + + WatchChainAdded(opts *bind.WatchOpts, sink chan<- *BurnWithFromMintTokenPoolChainAdded) (event.Subscription, error) + + ParseChainAdded(log types.Log) (*BurnWithFromMintTokenPoolChainAdded, error) + + FilterChainConfigured(opts *bind.FilterOpts) (*BurnWithFromMintTokenPoolChainConfiguredIterator, error) + + WatchChainConfigured(opts *bind.WatchOpts, sink chan<- *BurnWithFromMintTokenPoolChainConfigured) (event.Subscription, error) + + ParseChainConfigured(log types.Log) (*BurnWithFromMintTokenPoolChainConfigured, error) + + FilterChainRemoved(opts *bind.FilterOpts) (*BurnWithFromMintTokenPoolChainRemovedIterator, error) + + WatchChainRemoved(opts *bind.WatchOpts, sink chan<- *BurnWithFromMintTokenPoolChainRemoved) (event.Subscription, error) + + ParseChainRemoved(log types.Log) (*BurnWithFromMintTokenPoolChainRemoved, error) + + FilterConfigChanged(opts *bind.FilterOpts) (*BurnWithFromMintTokenPoolConfigChangedIterator, error) + + WatchConfigChanged(opts *bind.WatchOpts, sink chan<- *BurnWithFromMintTokenPoolConfigChanged) (event.Subscription, error) + + ParseConfigChanged(log types.Log) (*BurnWithFromMintTokenPoolConfigChanged, error) + + FilterLocked(opts *bind.FilterOpts, sender []common.Address) (*BurnWithFromMintTokenPoolLockedIterator, error) + + WatchLocked(opts *bind.WatchOpts, sink chan<- *BurnWithFromMintTokenPoolLocked, sender []common.Address) (event.Subscription, error) + + ParseLocked(log types.Log) (*BurnWithFromMintTokenPoolLocked, error) + + FilterMinted(opts *bind.FilterOpts, sender []common.Address, recipient []common.Address) (*BurnWithFromMintTokenPoolMintedIterator, error) + + WatchMinted(opts *bind.WatchOpts, sink chan<- *BurnWithFromMintTokenPoolMinted, sender []common.Address, recipient []common.Address) (event.Subscription, error) + + ParseMinted(log types.Log) (*BurnWithFromMintTokenPoolMinted, error) + + FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*BurnWithFromMintTokenPoolOwnershipTransferRequestedIterator, error) + + WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *BurnWithFromMintTokenPoolOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferRequested(log types.Log) (*BurnWithFromMintTokenPoolOwnershipTransferRequested, error) + + FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*BurnWithFromMintTokenPoolOwnershipTransferredIterator, error) + + WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *BurnWithFromMintTokenPoolOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferred(log types.Log) (*BurnWithFromMintTokenPoolOwnershipTransferred, error) + + FilterReleased(opts *bind.FilterOpts, sender []common.Address, recipient []common.Address) (*BurnWithFromMintTokenPoolReleasedIterator, error) + + WatchReleased(opts *bind.WatchOpts, sink chan<- *BurnWithFromMintTokenPoolReleased, sender []common.Address, recipient []common.Address) (event.Subscription, error) + + ParseReleased(log types.Log) (*BurnWithFromMintTokenPoolReleased, error) + + FilterRemotePoolSet(opts *bind.FilterOpts, remoteChainSelector []uint64) (*BurnWithFromMintTokenPoolRemotePoolSetIterator, error) + + WatchRemotePoolSet(opts *bind.WatchOpts, sink chan<- *BurnWithFromMintTokenPoolRemotePoolSet, remoteChainSelector []uint64) (event.Subscription, error) + + ParseRemotePoolSet(log types.Log) (*BurnWithFromMintTokenPoolRemotePoolSet, error) + + FilterRouterUpdated(opts *bind.FilterOpts) (*BurnWithFromMintTokenPoolRouterUpdatedIterator, error) + + WatchRouterUpdated(opts *bind.WatchOpts, sink chan<- *BurnWithFromMintTokenPoolRouterUpdated) (event.Subscription, error) + + ParseRouterUpdated(log types.Log) (*BurnWithFromMintTokenPoolRouterUpdated, error) + + FilterTokensConsumed(opts *bind.FilterOpts) (*BurnWithFromMintTokenPoolTokensConsumedIterator, error) + + WatchTokensConsumed(opts *bind.WatchOpts, sink chan<- *BurnWithFromMintTokenPoolTokensConsumed) (event.Subscription, error) + + ParseTokensConsumed(log types.Log) (*BurnWithFromMintTokenPoolTokensConsumed, error) + + ParseLog(log types.Log) (generated.AbigenLog, error) + + Address() common.Address +} diff --git a/core/gethwrappers/ccip/generated/burn_with_from_mint_token_pool_and_proxy/burn_with_from_mint_token_pool_and_proxy.go b/core/gethwrappers/ccip/generated/burn_with_from_mint_token_pool_and_proxy/burn_with_from_mint_token_pool_and_proxy.go new file mode 100644 index 00000000000..60de3dcdac3 --- /dev/null +++ b/core/gethwrappers/ccip/generated/burn_with_from_mint_token_pool_and_proxy/burn_with_from_mint_token_pool_and_proxy.go @@ -0,0 +1,3034 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package burn_with_from_mint_token_pool_and_proxy + +import ( + "errors" + "fmt" + "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" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" +) + +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +type PoolLockOrBurnInV1 struct { + Receiver []byte + RemoteChainSelector uint64 + OriginalSender common.Address + Amount *big.Int + LocalToken common.Address +} + +type PoolLockOrBurnOutV1 struct { + DestTokenAddress []byte + DestPoolData []byte +} + +type PoolReleaseOrMintInV1 struct { + OriginalSender []byte + RemoteChainSelector uint64 + Receiver common.Address + Amount *big.Int + LocalToken common.Address + SourcePoolAddress []byte + SourcePoolData []byte + OffchainTokenData []byte +} + +type PoolReleaseOrMintOutV1 struct { + DestinationAmount *big.Int +} + +type RateLimiterConfig struct { + IsEnabled bool + Capacity *big.Int + Rate *big.Int +} + +type RateLimiterTokenBucket struct { + Tokens *big.Int + LastUpdated uint32 + IsEnabled bool + Capacity *big.Int + Rate *big.Int +} + +type TokenPoolChainUpdate struct { + RemoteChainSelector uint64 + Allowed bool + RemotePoolAddress []byte + RemoteTokenAddress []byte + OutboundRateLimiterConfig RateLimiterConfig + InboundRateLimiterConfig RateLimiterConfig +} + +var BurnWithFromMintTokenPoolAndProxyMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"internalType\":\"contractIBurnMintERC20\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"allowlist\",\"type\":\"address[]\"},{\"internalType\":\"address\",\"name\":\"rmnProxy\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"router\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"capacity\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"requested\",\"type\":\"uint256\"}],\"name\":\"AggregateValueMaxCapacityExceeded\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"minWaitInSeconds\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"available\",\"type\":\"uint256\"}],\"name\":\"AggregateValueRateLimitReached\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"AllowListNotEnabled\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"BucketOverfilled\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"}],\"name\":\"CallerIsNotARampOnRouter\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"}],\"name\":\"ChainAlreadyExists\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"ChainNotAllowed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"CursedByRMN\",\"type\":\"error\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"config\",\"type\":\"tuple\"}],\"name\":\"DisabledNonZeroRateLimit\",\"type\":\"error\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"rateLimiterConfig\",\"type\":\"tuple\"}],\"name\":\"InvalidRateLimitRate\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"sourcePoolAddress\",\"type\":\"bytes\"}],\"name\":\"InvalidSourcePoolAddress\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"InvalidToken\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"NonExistentChain\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RateLimitMustBeDisabled\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"SenderNotAllowed\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"capacity\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"requested\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"}],\"name\":\"TokenMaxCapacityExceeded\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"minWaitInSeconds\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"available\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"}],\"name\":\"TokenRateLimitReached\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"}],\"name\":\"Unauthorized\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddressNotAllowed\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"AllowListAdd\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"AllowListRemove\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Burned\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"remoteToken\",\"type\":\"bytes\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"indexed\":false,\"internalType\":\"structRateLimiter.Config\",\"name\":\"outboundRateLimiterConfig\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"indexed\":false,\"internalType\":\"structRateLimiter.Config\",\"name\":\"inboundRateLimiterConfig\",\"type\":\"tuple\"}],\"name\":\"ChainAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"indexed\":false,\"internalType\":\"structRateLimiter.Config\",\"name\":\"outboundRateLimiterConfig\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"indexed\":false,\"internalType\":\"structRateLimiter.Config\",\"name\":\"inboundRateLimiterConfig\",\"type\":\"tuple\"}],\"name\":\"ChainConfigured\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"ChainRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"indexed\":false,\"internalType\":\"structRateLimiter.Config\",\"name\":\"config\",\"type\":\"tuple\"}],\"name\":\"ConfigChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"contractIPoolPriorTo1_5\",\"name\":\"oldPool\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"contractIPoolPriorTo1_5\",\"name\":\"newPool\",\"type\":\"address\"}],\"name\":\"LegacyPoolChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Locked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Minted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Released\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"previousPoolAddress\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"remotePoolAddress\",\"type\":\"bytes\"}],\"name\":\"RemotePoolSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"oldRouter\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newRouter\",\"type\":\"address\"}],\"name\":\"RouterUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"}],\"name\":\"TokensConsumed\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"removes\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"adds\",\"type\":\"address[]\"}],\"name\":\"applyAllowListUpdates\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"bool\",\"name\":\"allowed\",\"type\":\"bool\"},{\"internalType\":\"bytes\",\"name\":\"remotePoolAddress\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"remoteTokenAddress\",\"type\":\"bytes\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"outboundRateLimiterConfig\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"inboundRateLimiterConfig\",\"type\":\"tuple\"}],\"internalType\":\"structTokenPool.ChainUpdate[]\",\"name\":\"chains\",\"type\":\"tuple[]\"}],\"name\":\"applyChainUpdates\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAllowList\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAllowListEnabled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"getCurrentInboundRateLimiterState\",\"outputs\":[{\"components\":[{\"internalType\":\"uint128\",\"name\":\"tokens\",\"type\":\"uint128\"},{\"internalType\":\"uint32\",\"name\":\"lastUpdated\",\"type\":\"uint32\"},{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.TokenBucket\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"getCurrentOutboundRateLimiterState\",\"outputs\":[{\"components\":[{\"internalType\":\"uint128\",\"name\":\"tokens\",\"type\":\"uint128\"},{\"internalType\":\"uint32\",\"name\":\"lastUpdated\",\"type\":\"uint32\"},{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.TokenBucket\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"name\":\"getOnRamp\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"onRampAddress\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getPreviousPool\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRateLimitAdmin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"getRemotePool\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"getRemoteToken\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRmnProxy\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"rmnProxy\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRouter\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"router\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getSupportedChains\",\"outputs\":[{\"internalType\":\"uint64[]\",\"name\":\"\",\"type\":\"uint64[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getToken\",\"outputs\":[{\"internalType\":\"contractIERC20\",\"name\":\"token\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"offRamp\",\"type\":\"address\"}],\"name\":\"isOffRamp\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"isSupportedChain\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"isSupportedToken\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes\",\"name\":\"receiver\",\"type\":\"bytes\"},{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"originalSender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"localToken\",\"type\":\"address\"}],\"internalType\":\"structPool.LockOrBurnInV1\",\"name\":\"lockOrBurnIn\",\"type\":\"tuple\"}],\"name\":\"lockOrBurn\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes\",\"name\":\"destTokenAddress\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"destPoolData\",\"type\":\"bytes\"}],\"internalType\":\"structPool.LockOrBurnOutV1\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes\",\"name\":\"originalSender\",\"type\":\"bytes\"},{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"localToken\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"sourcePoolAddress\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"sourcePoolData\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"offchainTokenData\",\"type\":\"bytes\"}],\"internalType\":\"structPool.ReleaseOrMintInV1\",\"name\":\"releaseOrMintIn\",\"type\":\"tuple\"}],\"name\":\"releaseOrMint\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"destinationAmount\",\"type\":\"uint256\"}],\"internalType\":\"structPool.ReleaseOrMintOutV1\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"outboundConfig\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"inboundConfig\",\"type\":\"tuple\"}],\"name\":\"setChainRateLimiterConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractIPoolPriorTo1_5\",\"name\":\"prevPool\",\"type\":\"address\"}],\"name\":\"setPreviousPool\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"rateLimitAdmin\",\"type\":\"address\"}],\"name\":\"setRateLimitAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"remotePoolAddress\",\"type\":\"bytes\"}],\"name\":\"setRemotePool\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newRouter\",\"type\":\"address\"}],\"name\":\"setRouter\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", + Bin: "0x60e06040523480156200001157600080fd5b5060405162004dda38038062004dda8339810160408190526200003491620008cc565b83838383838383833380600081620000935760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000c657620000c6816200019b565b5050506001600160a01b0384161580620000e757506001600160a01b038116155b80620000fa57506001600160a01b038216155b1562000119576040516342bcdf7f60e11b815260040160405180910390fd5b6001600160a01b0384811660805282811660a052600480546001600160a01b031916918316919091179055825115801560c0526200016c576040805160008152602081019091526200016c908462000246565b50620001919650506001600160a01b038a169450309350600019925050620003a39050565b5050505062000b08565b336001600160a01b03821603620001f55760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c6600000000000000000060448201526064016200008a565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b60c05162000267576040516335f4a7b360e01b815260040160405180910390fd5b60005b8251811015620002f25760008382815181106200028b576200028b620009dc565b60209081029190910101519050620002a560028262000489565b15620002e8576040516001600160a01b03821681527f800671136ab6cfee9fbe5ed1fb7ca417811aca3cf864800d127b927adedf75669060200160405180910390a15b506001016200026a565b5060005b81518110156200039e576000828281518110620003175762000317620009dc565b6020026020010151905060006001600160a01b0316816001600160a01b03160362000343575062000395565b62000350600282620004a9565b1562000393576040516001600160a01b03821681527f2640d4d76caf8bf478aabfa982fa4e1c4eb71a37f93cd15e80dbc657911546d89060200160405180910390a15b505b600101620002f6565b505050565b604051636eb1769f60e11b81523060048201526001600160a01b038381166024830152600091839186169063dd62ed3e90604401602060405180830381865afa158015620003f5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200041b9190620009f2565b62000427919062000a22565b604080516001600160a01b038616602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b0390811663095ea7b360e01b179091529192506200048391869190620004c016565b50505050565b6000620004a0836001600160a01b03841662000591565b90505b92915050565b6000620004a0836001600160a01b03841662000695565b6040805180820190915260208082527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564908201526000906200050f906001600160a01b038516908490620006e7565b8051909150156200039e578080602001905181019062000530919062000a38565b6200039e5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016200008a565b600081815260018301602052604081205480156200068a576000620005b860018362000a63565b8554909150600090620005ce9060019062000a63565b90508082146200063a576000866000018281548110620005f257620005f2620009dc565b9060005260206000200154905080876000018481548110620006185762000618620009dc565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806200064e576200064e62000a79565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050620004a3565b6000915050620004a3565b6000818152600183016020526040812054620006de57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155620004a3565b506000620004a3565b6060620006f8848460008562000700565b949350505050565b606082471015620007635760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016200008a565b600080866001600160a01b0316858760405162000781919062000ab5565b60006040518083038185875af1925050503d8060008114620007c0576040519150601f19603f3d011682016040523d82523d6000602084013e620007c5565b606091505b509092509050620007d987838387620007e4565b979650505050505050565b606083156200085857825160000362000850576001600160a01b0385163b620008505760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016200008a565b5081620006f8565b620006f883838151156200086f5781518083602001fd5b8060405162461bcd60e51b81526004016200008a919062000ad3565b6001600160a01b0381168114620008a157600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b8051620008c7816200088b565b919050565b60008060008060808587031215620008e357600080fd5b8451620008f0816200088b565b602086810151919550906001600160401b03808211156200091057600080fd5b818801915088601f8301126200092557600080fd5b8151818111156200093a576200093a620008a4565b8060051b604051601f19603f83011681018181108582111715620009625762000962620008a4565b60405291825284820192508381018501918b8311156200098157600080fd5b938501935b82851015620009aa576200099a85620008ba565b8452938501939285019262000986565b809850505050505050620009c160408601620008ba565b9150620009d160608601620008ba565b905092959194509250565b634e487b7160e01b600052603260045260246000fd5b60006020828403121562000a0557600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b80820180821115620004a357620004a362000a0c565b60006020828403121562000a4b57600080fd5b8151801515811462000a5c57600080fd5b9392505050565b81810381811115620004a357620004a362000a0c565b634e487b7160e01b600052603160045260246000fd5b60005b8381101562000aac57818101518382015260200162000a92565b50506000910152565b6000825162000ac981846020870162000a8f565b9190910192915050565b602081526000825180602084015262000af481604085016020870162000a8f565b601f01601f19169190910160400192915050565b60805160a05160c05161424e62000b8c6000396000818161052c01528181611ad60152612528015260008181610506015281816118690152611d89015260008181610231015281816102860152818161076801528181610df40152818161178901528181611ca901528181611e8f015281816124be0152612713015261424e6000f3fe608060405234801561001057600080fd5b50600436106101da5760003560e01c80639a4575b911610104578063c0d78655116100a2578063db6327dc11610071578063db6327dc146104f1578063dc0bd97114610504578063e0351e131461052a578063f2fde38b1461055057600080fd5b8063c0d78655146104a3578063c4bffe2b146104b6578063c75eea9c146104cb578063cf7401f3146104de57600080fd5b8063a8d87a3b116100de578063a8d87a3b146103f0578063af58d59f14610403578063b0f479a114610472578063b79465801461049057600080fd5b80639a4575b91461039d578063a2b261d8146103bd578063a7cd63b7146103db57600080fd5b80636d3d1a581161017c57806383826b2b1161014b57806383826b2b146103465780638926f54f146103595780638da5cb5b1461036c5780639766b9321461038a57600080fd5b80636d3d1a58146102fa57806378a010b21461031857806379ba50971461032b5780637d54534e1461033357600080fd5b806321df0da7116101b857806321df0da71461022f578063240028e81461027657806339077537146102c357806354c8a4f3146102e557600080fd5b806301ffc9a7146101df5780630a2fd49314610207578063181f5a7714610227575b600080fd5b6101f26101ed3660046131c0565b610563565b60405190151581526020015b60405180910390f35b61021a61021536600461321f565b610648565b6040516101fe91906132a8565b61021a6106f8565b7f00000000000000000000000000000000000000000000000000000000000000005b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101fe565b6101f26102843660046132e8565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff90811691161490565b6102d66102d1366004613305565b610714565b604051905181526020016101fe565b6102f86102f336600461338d565b6108cc565b005b60085473ffffffffffffffffffffffffffffffffffffffff16610251565b6102f86103263660046133f9565b610947565b6102f8610abb565b6102f86103413660046132e8565b610bb8565b6101f261035436600461347c565b610c07565b6101f261036736600461321f565b610cd4565b60005473ffffffffffffffffffffffffffffffffffffffff16610251565b6102f86103983660046132e8565b610ceb565b6103b06103ab3660046134b3565b610d7a565b6040516101fe91906134ee565b60095473ffffffffffffffffffffffffffffffffffffffff16610251565b6103e3610ef0565b6040516101fe919061354e565b6102516103fe36600461321f565b503090565b61041661041136600461321f565b610f01565b6040516101fe919081516fffffffffffffffffffffffffffffffff908116825260208084015163ffffffff1690830152604080840151151590830152606080840151821690830152608092830151169181019190915260a00190565b60045473ffffffffffffffffffffffffffffffffffffffff16610251565b61021a61049e36600461321f565b610fd6565b6102f86104b13660046132e8565b611001565b6104be6110d5565b6040516101fe91906135a8565b6104166104d936600461321f565b61118d565b6102f86104ec36600461375f565b61125f565b6102f86104ff3660046137a4565b6112e8565b7f0000000000000000000000000000000000000000000000000000000000000000610251565b7f00000000000000000000000000000000000000000000000000000000000000006101f2565b6102f861055e3660046132e8565b61176e565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167faff2afbf0000000000000000000000000000000000000000000000000000000014806105f657507fffffffff0000000000000000000000000000000000000000000000000000000082167f0e64dd2900000000000000000000000000000000000000000000000000000000145b8061064257507fffffffff0000000000000000000000000000000000000000000000000000000082167f01ffc9a700000000000000000000000000000000000000000000000000000000145b92915050565b67ffffffffffffffff81166000908152600760205260409020600401805460609190610673906137e6565b80601f016020809104026020016040519081016040528092919081815260200182805461069f906137e6565b80156106ec5780601f106106c1576101008083540402835291602001916106ec565b820191906000526020600020905b8154815290600101906020018083116106cf57829003601f168201915b50505050509050919050565b60405180606001604052806023815260200161421f6023913981565b60408051602081019091526000815261073461072f836138d5565b611782565b60095473ffffffffffffffffffffffffffffffffffffffff1661082a5773ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000166340c10f1961079d60608501604086016132e8565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b16815273ffffffffffffffffffffffffffffffffffffffff909116600482015260608501356024820152604401600060405180830381600087803b15801561080d57600080fd5b505af1158015610821573d6000803e3d6000fd5b5050505061083b565b61083b610836836138d5565b6119b3565b61084b60608301604084016132e8565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f9d228d69b5fdb8d273a2336f8fb8612d039631024ea9bf09c424a9503aa078f084606001356040516108ad91815260200190565b60405180910390a3506040805160208101909152606090910135815290565b6108d4611a51565b61094184848080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808802828101820190935287825290935087925086918291850190849080828437600092019190915250611ad492505050565b50505050565b61094f611a51565b61095883610cd4565b61099f576040517f1e670e4b00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff841660048201526024015b60405180910390fd5b67ffffffffffffffff8316600090815260076020526040812060040180546109c6906137e6565b80601f01602080910402602001604051908101604052809291908181526020018280546109f2906137e6565b8015610a3f5780601f10610a1457610100808354040283529160200191610a3f565b820191906000526020600020905b815481529060010190602001808311610a2257829003601f168201915b5050505067ffffffffffffffff8616600090815260076020526040902091925050600401610a6e838583613a1a565b508367ffffffffffffffff167fdb4d6220746a38cbc5335f7e108f7de80f482f4d23350253dfd0917df75a14bf828585604051610aad93929190613b34565b60405180910390a250505050565b60015473ffffffffffffffffffffffffffffffffffffffff163314610b3c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e6572000000000000000000006044820152606401610996565b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b610bc0611a51565b600880547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b600073ffffffffffffffffffffffffffffffffffffffff8216301480610ccd5750600480546040517f83826b2b00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff86169281019290925273ffffffffffffffffffffffffffffffffffffffff848116602484015216906383826b2b90604401602060405180830381865afa158015610ca9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ccd9190613b98565b9392505050565b6000610642600567ffffffffffffffff8416611c8a565b610cf3611a51565b6009805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff000000000000000000000000000000000000000083168117909355604080519190921680825260208201939093527f81accd0a7023865eaa51b3399dd0eafc488bf3ba238402911e1659cfe860f22891015b60405180910390a15050565b6040805180820190915260608082526020820152610d9f610d9a83613bb5565b611ca2565b60095473ffffffffffffffffffffffffffffffffffffffff16610e6a576040517f79cc6790000000000000000000000000000000000000000000000000000000008152306004820152606083013560248201527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16906379cc679090604401600060405180830381600087803b158015610e4d57600080fd5b505af1158015610e61573d6000803e3d6000fd5b50505050610e7b565b610e7b610e7683613bb5565b611e6c565b6040516060830135815233907f696de425f79f4a40bc6d2122ca50507f0efbeabbff86a84871b7196ab8ea8df79060200160405180910390a26040518060400160405280610ed584602001602081019061049e919061321f565b81526040805160208181019092526000815291015292915050565b6060610efc6002611f86565b905090565b6040805160a08101825260008082526020820181905291810182905260608101829052608081019190915267ffffffffffffffff8216600090815260076020908152604091829020825160a08101845260028201546fffffffffffffffffffffffffffffffff808216835270010000000000000000000000000000000080830463ffffffff16958401959095527401000000000000000000000000000000000000000090910460ff16151594820194909452600390910154808416606083015291909104909116608082015261064290611f93565b67ffffffffffffffff81166000908152600760205260409020600501805460609190610673906137e6565b611009611a51565b73ffffffffffffffffffffffffffffffffffffffff8116611056576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6004805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff000000000000000000000000000000000000000083168117909355604080519190921680825260208201939093527f02dc5c233404867c793b749c6d644beb2277536d18a7e7974d3f238e4c6f16849101610d6e565b606060006110e36005611f86565b90506000815167ffffffffffffffff811115611101576111016135ea565b60405190808252806020026020018201604052801561112a578160200160208202803683370190505b50905060005b82518110156111865782818151811061114b5761114b613c57565b602002602001015182828151811061116557611165613c57565b67ffffffffffffffff90921660209283029190910190910152600101611130565b5092915050565b6040805160a08101825260008082526020820181905291810182905260608101829052608081019190915267ffffffffffffffff8216600090815260076020908152604091829020825160a08101845281546fffffffffffffffffffffffffffffffff808216835270010000000000000000000000000000000080830463ffffffff16958401959095527401000000000000000000000000000000000000000090910460ff16151594820194909452600190910154808416606083015291909104909116608082015261064290611f93565b60085473ffffffffffffffffffffffffffffffffffffffff16331480159061129f575060005473ffffffffffffffffffffffffffffffffffffffff163314155b156112d8576040517f8e4a23d6000000000000000000000000000000000000000000000000000000008152336004820152602401610996565b6112e3838383612045565b505050565b6112f0611a51565b60005b818110156112e357600083838381811061130f5761130f613c57565b90506020028101906113219190613c86565b61132a90613cc4565b905061133f816080015182602001511561212f565b6113528160a0015182602001511561212f565b80602001511561164e5780516113749060059067ffffffffffffffff16612268565b6113b95780516040517f1d5ad3c500000000000000000000000000000000000000000000000000000000815267ffffffffffffffff9091166004820152602401610996565b60408101515115806113ce5750606081015151155b15611405576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040805161012081018252608083810180516020908101516fffffffffffffffffffffffffffffffff9081168486019081524263ffffffff90811660a0808901829052865151151560c08a01528651860151851660e08a015295518901518416610100890152918752875180860189529489018051850151841686528585019290925281515115158589015281518401518316606080870191909152915188015183168587015283870194855288880151878901908152828a015183890152895167ffffffffffffffff1660009081526007865289902088518051825482890151838e01519289167fffffffffffffffffffffffff0000000000000000000000000000000000000000928316177001000000000000000000000000000000009188168202177fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff90811674010000000000000000000000000000000000000000941515850217865584890151948d0151948a16948a168202949094176001860155995180516002860180549b8301519f830151918b169b9093169a909a179d9096168a029c909c179091169615150295909517909855908101519401519381169316909102919091176003820155915190919060048201906115e69082613d78565b50606082015160058201906115fb9082613d78565b505081516060830151608084015160a08501516040517f8d340f17e19058004c20453540862a9c62778504476f6756755cb33bcd6c38c295506116419493929190613e92565b60405180910390a1611765565b80516116669060059067ffffffffffffffff16612274565b6116ab5780516040517f1e670e4b00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff9091166004820152602401610996565b805167ffffffffffffffff16600090815260076020526040812080547fffffffffffffffffffffff000000000000000000000000000000000000000000908116825560018201839055600282018054909116905560038101829055906117146004830182613172565b611722600583016000613172565b5050805160405167ffffffffffffffff90911681527f5204aec90a3c794d8e90fded8b46ae9c7c552803e7e832e0c1d358396d8599169060200160405180910390a15b506001016112f3565b611776611a51565b61177f81612280565b50565b60808101517f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff9081169116146118175760808101516040517f961c9a4f00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9091166004820152602401610996565b60208101516040517f2cbc26bb00000000000000000000000000000000000000000000000000000000815260809190911b77ffffffffffffffff000000000000000000000000000000001660048201527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1690632cbc26bb90602401602060405180830381865afa1580156118c5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118e99190613b98565b15611920576040517f53ad11d800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61192d8160200151612375565b600061193c8260200151610648565b9050805160001480611960575080805190602001208260a001518051906020012014155b1561199d578160a001516040517f24eb47e500000000000000000000000000000000000000000000000000000000815260040161099691906132a8565b6119af8260200151836060015161249b565b5050565b60095481516040808401516060850151602086015192517f8627fad600000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff90951694638627fad694611a1c9490939291600401613f2b565b600060405180830381600087803b158015611a3657600080fd5b505af1158015611a4a573d6000803e3d6000fd5b5050505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314611ad2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e6572000000000000000000006044820152606401610996565b565b7f0000000000000000000000000000000000000000000000000000000000000000611b2b576040517f35f4a7b300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b8251811015611bc1576000838281518110611b4b57611b4b613c57565b60200260200101519050611b698160026124e290919063ffffffff16565b15611bb85760405173ffffffffffffffffffffffffffffffffffffffff821681527f800671136ab6cfee9fbe5ed1fb7ca417811aca3cf864800d127b927adedf75669060200160405180910390a15b50600101611b2e565b5060005b81518110156112e3576000828281518110611be257611be2613c57565b60200260200101519050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603611c265750611c82565b611c31600282612504565b15611c805760405173ffffffffffffffffffffffffffffffffffffffff821681527f2640d4d76caf8bf478aabfa982fa4e1c4eb71a37f93cd15e80dbc657911546d89060200160405180910390a15b505b600101611bc5565b60008181526001830160205260408120541515610ccd565b60808101517f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff908116911614611d375760808101516040517f961c9a4f00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9091166004820152602401610996565b60208101516040517f2cbc26bb00000000000000000000000000000000000000000000000000000000815260809190911b77ffffffffffffffff000000000000000000000000000000001660048201527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1690632cbc26bb90602401602060405180830381865afa158015611de5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e099190613b98565b15611e40576040517f53ad11d800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611e4d8160400151612526565b611e5a81602001516125a5565b61177f816020015182606001516126f3565b6009546060820151611eb99173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000811692911690612737565b60095460408083015183516060850151602086015193517f9687544500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff90951694639687544594611f2194939291600401613f8c565b6000604051808303816000875af1158015611f40573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682016040526119af9190810190613fec565b60606000610ccd836127c4565b6040805160a08101825260008082526020820181905291810182905260608101829052608081019190915261202182606001516fffffffffffffffffffffffffffffffff1683600001516fffffffffffffffffffffffffffffffff16846020015163ffffffff16426120059190614089565b85608001516fffffffffffffffffffffffffffffffff1661281f565b6fffffffffffffffffffffffffffffffff1682525063ffffffff4216602082015290565b61204e83610cd4565b612090576040517f1e670e4b00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff84166004820152602401610996565b61209b82600061212f565b67ffffffffffffffff831660009081526007602052604090206120be9083612849565b6120c981600061212f565b67ffffffffffffffff831660009081526007602052604090206120ef9060020182612849565b7f0350d63aa5f270e01729d00d627eeb8f3429772b1818c016c66a588a864f912b8383836040516121229392919061409c565b60405180910390a1505050565b8151156121f65781602001516fffffffffffffffffffffffffffffffff1682604001516fffffffffffffffffffffffffffffffff16101580612185575060408201516fffffffffffffffffffffffffffffffff16155b156121be57816040517f8020d124000000000000000000000000000000000000000000000000000000008152600401610996919061411f565b80156119af576040517f433fc33d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60408201516fffffffffffffffffffffffffffffffff1615158061222f575060208201516fffffffffffffffffffffffffffffffff1615155b156119af57816040517fd68af9cc000000000000000000000000000000000000000000000000000000008152600401610996919061411f565b6000610ccd83836129eb565b6000610ccd8383612a3a565b3373ffffffffffffffffffffffffffffffffffffffff8216036122ff576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c660000000000000000006044820152606401610996565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b61237e81610cd4565b6123c0576040517fa9902c7e00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff82166004820152602401610996565b600480546040517f83826b2b00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff84169281019290925233602483015273ffffffffffffffffffffffffffffffffffffffff16906383826b2b90604401602060405180830381865afa15801561243f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124639190613b98565b61177f576040517f728fe07b000000000000000000000000000000000000000000000000000000008152336004820152602401610996565b67ffffffffffffffff821660009081526007602052604090206119af90600201827f0000000000000000000000000000000000000000000000000000000000000000612b2d565b6000610ccd8373ffffffffffffffffffffffffffffffffffffffff8416612a3a565b6000610ccd8373ffffffffffffffffffffffffffffffffffffffff84166129eb565b7f00000000000000000000000000000000000000000000000000000000000000001561177f57612557600282612eb0565b61177f576040517fd0d2597600000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff82166004820152602401610996565b6125ae81610cd4565b6125f0576040517fa9902c7e00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff82166004820152602401610996565b600480546040517fa8d87a3b00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff84169281019290925273ffffffffffffffffffffffffffffffffffffffff169063a8d87a3b90602401602060405180830381865afa158015612669573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061268d919061415b565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461177f576040517f728fe07b000000000000000000000000000000000000000000000000000000008152336004820152602401610996565b67ffffffffffffffff821660009081526007602052604090206119af90827f0000000000000000000000000000000000000000000000000000000000000000612b2d565b6040805173ffffffffffffffffffffffffffffffffffffffff8416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb000000000000000000000000000000000000000000000000000000001790526112e3908490612edf565b6060816000018054806020026020016040519081016040528092919081815260200182805480156106ec57602002820191906000526020600020905b8154815260200190600101908083116128005750505050509050919050565b600061283e8561282f8486614178565b612839908761418f565b612feb565b90505b949350505050565b815460009061287290700100000000000000000000000000000000900463ffffffff1642614089565b9050801561291457600183015483546128ba916fffffffffffffffffffffffffffffffff8082169281169185917001000000000000000000000000000000009091041661281f565b83546fffffffffffffffffffffffffffffffff919091167fffffffffffffffffffffffff0000000000000000000000000000000000000000909116177001000000000000000000000000000000004263ffffffff16021783555b6020820151835461293a916fffffffffffffffffffffffffffffffff9081169116612feb565b83548351151574010000000000000000000000000000000000000000027fffffffffffffffffffffff00ffffffff000000000000000000000000000000009091166fffffffffffffffffffffffffffffffff92831617178455602083015160408085015183167001000000000000000000000000000000000291909216176001850155517f9ea3374b67bf275e6bb9c8ae68f9cae023e1c528b4b27e092f0bb209d3531c199061212290849061411f565b6000818152600183016020526040812054612a3257508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610642565b506000610642565b60008181526001830160205260408120548015612b23576000612a5e600183614089565b8554909150600090612a7290600190614089565b9050808214612ad7576000866000018281548110612a9257612a92613c57565b9060005260206000200154905080876000018481548110612ab557612ab5613c57565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080612ae857612ae86141a2565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610642565b6000915050610642565b825474010000000000000000000000000000000000000000900460ff161580612b54575081155b15612b5e57505050565b825460018401546fffffffffffffffffffffffffffffffff80831692911690600090612ba490700100000000000000000000000000000000900463ffffffff1642614089565b90508015612c645781831115612be6576040517f9725942a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001860154612c209083908590849070010000000000000000000000000000000090046fffffffffffffffffffffffffffffffff1661281f565b86547fffffffffffffffffffffffff00000000ffffffffffffffffffffffffffffffff167001000000000000000000000000000000004263ffffffff160217875592505b84821015612d1b5773ffffffffffffffffffffffffffffffffffffffff8416612cc3576040517ff94ebcd10000000000000000000000000000000000000000000000000000000081526004810183905260248101869052604401610996565b6040517f1a76572a000000000000000000000000000000000000000000000000000000008152600481018390526024810186905273ffffffffffffffffffffffffffffffffffffffff85166044820152606401610996565b84831015612e2e5760018681015470010000000000000000000000000000000090046fffffffffffffffffffffffffffffffff16906000908290612d5f9082614089565b612d69878a614089565b612d73919061418f565b612d7d91906141d1565b905073ffffffffffffffffffffffffffffffffffffffff8616612dd6576040517f15279c080000000000000000000000000000000000000000000000000000000081526004810182905260248101869052604401610996565b6040517fd0c8d23a000000000000000000000000000000000000000000000000000000008152600481018290526024810186905273ffffffffffffffffffffffffffffffffffffffff87166044820152606401610996565b612e388584614089565b86547fffffffffffffffffffffffffffffffff00000000000000000000000000000000166fffffffffffffffffffffffffffffffff82161787556040518681529093507f1871cdf8010e63f2eb8384381a68dfa7416dc571a5517e66e88b2d2d0c0a690a9060200160405180910390a1505050505050565b73ffffffffffffffffffffffffffffffffffffffff811660009081526001830160205260408120541515610ccd565b6000612f41826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166130019092919063ffffffff16565b8051909150156112e35780806020019051810190612f5f9190613b98565b6112e3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610996565b6000818310612ffa5781610ccd565b5090919050565b60606128418484600085856000808673ffffffffffffffffffffffffffffffffffffffff168587604051613035919061420c565b60006040518083038185875af1925050503d8060008114613072576040519150601f19603f3d011682016040523d82523d6000602084013e613077565b606091505b509150915061308887838387613093565b979650505050505050565b606083156131295782516000036131225773ffffffffffffffffffffffffffffffffffffffff85163b613122576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610996565b5081612841565b612841838381511561313e5781518083602001fd5b806040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161099691906132a8565b50805461317e906137e6565b6000825580601f1061318e575050565b601f01602090049060005260206000209081019061177f91905b808211156131bc57600081556001016131a8565b5090565b6000602082840312156131d257600080fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114610ccd57600080fd5b803567ffffffffffffffff8116811461321a57600080fd5b919050565b60006020828403121561323157600080fd5b610ccd82613202565b60005b8381101561325557818101518382015260200161323d565b50506000910152565b6000815180845261327681602086016020860161323a565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b602081526000610ccd602083018461325e565b73ffffffffffffffffffffffffffffffffffffffff8116811461177f57600080fd5b803561321a816132bb565b6000602082840312156132fa57600080fd5b8135610ccd816132bb565b60006020828403121561331757600080fd5b813567ffffffffffffffff81111561332e57600080fd5b82016101008185031215610ccd57600080fd5b60008083601f84011261335357600080fd5b50813567ffffffffffffffff81111561336b57600080fd5b6020830191508360208260051b850101111561338657600080fd5b9250929050565b600080600080604085870312156133a357600080fd5b843567ffffffffffffffff808211156133bb57600080fd5b6133c788838901613341565b909650945060208701359150808211156133e057600080fd5b506133ed87828801613341565b95989497509550505050565b60008060006040848603121561340e57600080fd5b61341784613202565b9250602084013567ffffffffffffffff8082111561343457600080fd5b818601915086601f83011261344857600080fd5b81358181111561345757600080fd5b87602082850101111561346957600080fd5b6020830194508093505050509250925092565b6000806040838503121561348f57600080fd5b61349883613202565b915060208301356134a8816132bb565b809150509250929050565b6000602082840312156134c557600080fd5b813567ffffffffffffffff8111156134dc57600080fd5b820160a08185031215610ccd57600080fd5b60208152600082516040602084015261350a606084018261325e565b905060208401517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0848303016040850152613545828261325e565b95945050505050565b6020808252825182820181905260009190848201906040850190845b8181101561359c57835173ffffffffffffffffffffffffffffffffffffffff168352928401929184019160010161356a565b50909695505050505050565b6020808252825182820181905260009190848201906040850190845b8181101561359c57835167ffffffffffffffff16835292840192918401916001016135c4565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051610100810167ffffffffffffffff8111828210171561363d5761363d6135ea565b60405290565b60405160c0810167ffffffffffffffff8111828210171561363d5761363d6135ea565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff811182821017156136ad576136ad6135ea565b604052919050565b801515811461177f57600080fd5b803561321a816136b5565b80356fffffffffffffffffffffffffffffffff8116811461321a57600080fd5b60006060828403121561370057600080fd5b6040516060810181811067ffffffffffffffff82111715613723576137236135ea565b6040529050808235613734816136b5565b8152613742602084016136ce565b6020820152613753604084016136ce565b60408201525092915050565b600080600060e0848603121561377457600080fd5b61377d84613202565b925061378c85602086016136ee565b915061379b85608086016136ee565b90509250925092565b600080602083850312156137b757600080fd5b823567ffffffffffffffff8111156137ce57600080fd5b6137da85828601613341565b90969095509350505050565b600181811c908216806137fa57607f821691505b602082108103613833577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b600067ffffffffffffffff821115613853576138536135ea565b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b600082601f83011261389057600080fd5b81356138a361389e82613839565b613666565b8181528460208386010111156138b857600080fd5b816020850160208301376000918101602001919091529392505050565b600061010082360312156138e857600080fd5b6138f0613619565b823567ffffffffffffffff8082111561390857600080fd5b6139143683870161387f565b835261392260208601613202565b6020840152613933604086016132dd565b60408401526060850135606084015261394e608086016132dd565b608084015260a085013591508082111561396757600080fd5b6139733683870161387f565b60a084015260c085013591508082111561398c57600080fd5b6139983683870161387f565b60c084015260e08501359150808211156139b157600080fd5b506139be3682860161387f565b60e08301525092915050565b601f8211156112e3576000816000526020600020601f850160051c810160208610156139f35750805b601f850160051c820191505b81811015613a12578281556001016139ff565b505050505050565b67ffffffffffffffff831115613a3257613a326135ea565b613a4683613a4083546137e6565b836139ca565b6000601f841160018114613a985760008515613a625750838201355b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600387901b1c1916600186901b178355611a4a565b6000838152602090207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0861690835b82811015613ae75786850135825560209485019460019092019101613ac7565b5086821015613b22577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60f88860031b161c19848701351681555b505060018560011b0183555050505050565b604081526000613b47604083018661325e565b82810360208401528381528385602083013760006020858301015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f860116820101915050949350505050565b600060208284031215613baa57600080fd5b8151610ccd816136b5565b600060a08236031215613bc757600080fd5b60405160a0810167ffffffffffffffff8282108183111715613beb57613beb6135ea565b816040528435915080821115613c0057600080fd5b50613c0d3682860161387f565b825250613c1c60208401613202565b60208201526040830135613c2f816132bb565b6040820152606083810135908201526080830135613c4c816132bb565b608082015292915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600082357ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec1833603018112613cba57600080fd5b9190910192915050565b60006101408236031215613cd757600080fd5b613cdf613643565b613ce883613202565b8152613cf6602084016136c3565b6020820152604083013567ffffffffffffffff80821115613d1657600080fd5b613d223683870161387f565b60408401526060850135915080821115613d3b57600080fd5b50613d483682860161387f565b606083015250613d5b36608085016136ee565b6080820152613d6d3660e085016136ee565b60a082015292915050565b815167ffffffffffffffff811115613d9257613d926135ea565b613da681613da084546137e6565b846139ca565b602080601f831160018114613df95760008415613dc35750858301515b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600386901b1c1916600185901b178555613a12565b6000858152602081207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08616915b82811015613e4657888601518255948401946001909101908401613e27565b5085821015613e8257878501517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600388901b60f8161c191681555b5050505050600190811b01905550565b600061010067ffffffffffffffff87168352806020840152613eb68184018761325e565b8551151560408581019190915260208701516fffffffffffffffffffffffffffffffff9081166060870152908701511660808501529150613ef49050565b8251151560a083015260208301516fffffffffffffffffffffffffffffffff90811660c084015260408401511660e0830152613545565b60a081526000613f3e60a083018761325e565b73ffffffffffffffffffffffffffffffffffffffff8616602084015284604084015267ffffffffffffffff841660608401528281036080840152600081526020810191505095945050505050565b73ffffffffffffffffffffffffffffffffffffffff8516815260a060208201526000613fbb60a083018661325e565b60408301949094525067ffffffffffffffff9190911660608201528082036080909101526000815260200192915050565b600060208284031215613ffe57600080fd5b815167ffffffffffffffff81111561401557600080fd5b8201601f8101841361402657600080fd5b805161403461389e82613839565b81815285602083850101111561404957600080fd5b61354582602083016020860161323a565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b818103818111156106425761064261405a565b67ffffffffffffffff8416815260e081016140e860208301858051151582526020808201516fffffffffffffffffffffffffffffffff9081169184019190915260409182015116910152565b82511515608083015260208301516fffffffffffffffffffffffffffffffff90811660a084015260408401511660c0830152612841565b6060810161064282848051151582526020808201516fffffffffffffffffffffffffffffffff9081169184019190915260409182015116910152565b60006020828403121561416d57600080fd5b8151610ccd816132bb565b80820281158282048414176106425761064261405a565b808201808211156106425761064261405a565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b600082614207577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b60008251613cba81846020870161323a56fe4275726e46726f6d4d696e74546f6b656e506f6f6c416e6450726f787920312e352e30a164736f6c6343000818000a", +} + +var BurnWithFromMintTokenPoolAndProxyABI = BurnWithFromMintTokenPoolAndProxyMetaData.ABI + +var BurnWithFromMintTokenPoolAndProxyBin = BurnWithFromMintTokenPoolAndProxyMetaData.Bin + +func DeployBurnWithFromMintTokenPoolAndProxy(auth *bind.TransactOpts, backend bind.ContractBackend, token common.Address, allowlist []common.Address, rmnProxy common.Address, router common.Address) (common.Address, *types.Transaction, *BurnWithFromMintTokenPoolAndProxy, error) { + parsed, err := BurnWithFromMintTokenPoolAndProxyMetaData.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(BurnWithFromMintTokenPoolAndProxyBin), backend, token, allowlist, rmnProxy, router) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &BurnWithFromMintTokenPoolAndProxy{address: address, abi: *parsed, BurnWithFromMintTokenPoolAndProxyCaller: BurnWithFromMintTokenPoolAndProxyCaller{contract: contract}, BurnWithFromMintTokenPoolAndProxyTransactor: BurnWithFromMintTokenPoolAndProxyTransactor{contract: contract}, BurnWithFromMintTokenPoolAndProxyFilterer: BurnWithFromMintTokenPoolAndProxyFilterer{contract: contract}}, nil +} + +type BurnWithFromMintTokenPoolAndProxy struct { + address common.Address + abi abi.ABI + BurnWithFromMintTokenPoolAndProxyCaller + BurnWithFromMintTokenPoolAndProxyTransactor + BurnWithFromMintTokenPoolAndProxyFilterer +} + +type BurnWithFromMintTokenPoolAndProxyCaller struct { + contract *bind.BoundContract +} + +type BurnWithFromMintTokenPoolAndProxyTransactor struct { + contract *bind.BoundContract +} + +type BurnWithFromMintTokenPoolAndProxyFilterer struct { + contract *bind.BoundContract +} + +type BurnWithFromMintTokenPoolAndProxySession struct { + Contract *BurnWithFromMintTokenPoolAndProxy + CallOpts bind.CallOpts + TransactOpts bind.TransactOpts +} + +type BurnWithFromMintTokenPoolAndProxyCallerSession struct { + Contract *BurnWithFromMintTokenPoolAndProxyCaller + CallOpts bind.CallOpts +} + +type BurnWithFromMintTokenPoolAndProxyTransactorSession struct { + Contract *BurnWithFromMintTokenPoolAndProxyTransactor + TransactOpts bind.TransactOpts +} + +type BurnWithFromMintTokenPoolAndProxyRaw struct { + Contract *BurnWithFromMintTokenPoolAndProxy +} + +type BurnWithFromMintTokenPoolAndProxyCallerRaw struct { + Contract *BurnWithFromMintTokenPoolAndProxyCaller +} + +type BurnWithFromMintTokenPoolAndProxyTransactorRaw struct { + Contract *BurnWithFromMintTokenPoolAndProxyTransactor +} + +func NewBurnWithFromMintTokenPoolAndProxy(address common.Address, backend bind.ContractBackend) (*BurnWithFromMintTokenPoolAndProxy, error) { + abi, err := abi.JSON(strings.NewReader(BurnWithFromMintTokenPoolAndProxyABI)) + if err != nil { + return nil, err + } + contract, err := bindBurnWithFromMintTokenPoolAndProxy(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &BurnWithFromMintTokenPoolAndProxy{address: address, abi: abi, BurnWithFromMintTokenPoolAndProxyCaller: BurnWithFromMintTokenPoolAndProxyCaller{contract: contract}, BurnWithFromMintTokenPoolAndProxyTransactor: BurnWithFromMintTokenPoolAndProxyTransactor{contract: contract}, BurnWithFromMintTokenPoolAndProxyFilterer: BurnWithFromMintTokenPoolAndProxyFilterer{contract: contract}}, nil +} + +func NewBurnWithFromMintTokenPoolAndProxyCaller(address common.Address, caller bind.ContractCaller) (*BurnWithFromMintTokenPoolAndProxyCaller, error) { + contract, err := bindBurnWithFromMintTokenPoolAndProxy(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &BurnWithFromMintTokenPoolAndProxyCaller{contract: contract}, nil +} + +func NewBurnWithFromMintTokenPoolAndProxyTransactor(address common.Address, transactor bind.ContractTransactor) (*BurnWithFromMintTokenPoolAndProxyTransactor, error) { + contract, err := bindBurnWithFromMintTokenPoolAndProxy(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &BurnWithFromMintTokenPoolAndProxyTransactor{contract: contract}, nil +} + +func NewBurnWithFromMintTokenPoolAndProxyFilterer(address common.Address, filterer bind.ContractFilterer) (*BurnWithFromMintTokenPoolAndProxyFilterer, error) { + contract, err := bindBurnWithFromMintTokenPoolAndProxy(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &BurnWithFromMintTokenPoolAndProxyFilterer{contract: contract}, nil +} + +func bindBurnWithFromMintTokenPoolAndProxy(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := BurnWithFromMintTokenPoolAndProxyMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _BurnWithFromMintTokenPoolAndProxy.Contract.BurnWithFromMintTokenPoolAndProxyCaller.contract.Call(opts, result, method, params...) +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _BurnWithFromMintTokenPoolAndProxy.Contract.BurnWithFromMintTokenPoolAndProxyTransactor.contract.Transfer(opts) +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _BurnWithFromMintTokenPoolAndProxy.Contract.BurnWithFromMintTokenPoolAndProxyTransactor.contract.Transact(opts, method, params...) +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _BurnWithFromMintTokenPoolAndProxy.Contract.contract.Call(opts, result, method, params...) +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _BurnWithFromMintTokenPoolAndProxy.Contract.contract.Transfer(opts) +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _BurnWithFromMintTokenPoolAndProxy.Contract.contract.Transact(opts, method, params...) +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyCaller) GetAllowList(opts *bind.CallOpts) ([]common.Address, error) { + var out []interface{} + err := _BurnWithFromMintTokenPoolAndProxy.contract.Call(opts, &out, "getAllowList") + + if err != nil { + return *new([]common.Address), err + } + + out0 := *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) + + return out0, err + +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxySession) GetAllowList() ([]common.Address, error) { + return _BurnWithFromMintTokenPoolAndProxy.Contract.GetAllowList(&_BurnWithFromMintTokenPoolAndProxy.CallOpts) +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyCallerSession) GetAllowList() ([]common.Address, error) { + return _BurnWithFromMintTokenPoolAndProxy.Contract.GetAllowList(&_BurnWithFromMintTokenPoolAndProxy.CallOpts) +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyCaller) GetAllowListEnabled(opts *bind.CallOpts) (bool, error) { + var out []interface{} + err := _BurnWithFromMintTokenPoolAndProxy.contract.Call(opts, &out, "getAllowListEnabled") + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxySession) GetAllowListEnabled() (bool, error) { + return _BurnWithFromMintTokenPoolAndProxy.Contract.GetAllowListEnabled(&_BurnWithFromMintTokenPoolAndProxy.CallOpts) +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyCallerSession) GetAllowListEnabled() (bool, error) { + return _BurnWithFromMintTokenPoolAndProxy.Contract.GetAllowListEnabled(&_BurnWithFromMintTokenPoolAndProxy.CallOpts) +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyCaller) GetCurrentInboundRateLimiterState(opts *bind.CallOpts, remoteChainSelector uint64) (RateLimiterTokenBucket, error) { + var out []interface{} + err := _BurnWithFromMintTokenPoolAndProxy.contract.Call(opts, &out, "getCurrentInboundRateLimiterState", remoteChainSelector) + + if err != nil { + return *new(RateLimiterTokenBucket), err + } + + out0 := *abi.ConvertType(out[0], new(RateLimiterTokenBucket)).(*RateLimiterTokenBucket) + + return out0, err + +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxySession) GetCurrentInboundRateLimiterState(remoteChainSelector uint64) (RateLimiterTokenBucket, error) { + return _BurnWithFromMintTokenPoolAndProxy.Contract.GetCurrentInboundRateLimiterState(&_BurnWithFromMintTokenPoolAndProxy.CallOpts, remoteChainSelector) +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyCallerSession) GetCurrentInboundRateLimiterState(remoteChainSelector uint64) (RateLimiterTokenBucket, error) { + return _BurnWithFromMintTokenPoolAndProxy.Contract.GetCurrentInboundRateLimiterState(&_BurnWithFromMintTokenPoolAndProxy.CallOpts, remoteChainSelector) +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyCaller) GetCurrentOutboundRateLimiterState(opts *bind.CallOpts, remoteChainSelector uint64) (RateLimiterTokenBucket, error) { + var out []interface{} + err := _BurnWithFromMintTokenPoolAndProxy.contract.Call(opts, &out, "getCurrentOutboundRateLimiterState", remoteChainSelector) + + if err != nil { + return *new(RateLimiterTokenBucket), err + } + + out0 := *abi.ConvertType(out[0], new(RateLimiterTokenBucket)).(*RateLimiterTokenBucket) + + return out0, err + +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxySession) GetCurrentOutboundRateLimiterState(remoteChainSelector uint64) (RateLimiterTokenBucket, error) { + return _BurnWithFromMintTokenPoolAndProxy.Contract.GetCurrentOutboundRateLimiterState(&_BurnWithFromMintTokenPoolAndProxy.CallOpts, remoteChainSelector) +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyCallerSession) GetCurrentOutboundRateLimiterState(remoteChainSelector uint64) (RateLimiterTokenBucket, error) { + return _BurnWithFromMintTokenPoolAndProxy.Contract.GetCurrentOutboundRateLimiterState(&_BurnWithFromMintTokenPoolAndProxy.CallOpts, remoteChainSelector) +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyCaller) GetOnRamp(opts *bind.CallOpts, arg0 uint64) (common.Address, error) { + var out []interface{} + err := _BurnWithFromMintTokenPoolAndProxy.contract.Call(opts, &out, "getOnRamp", arg0) + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxySession) GetOnRamp(arg0 uint64) (common.Address, error) { + return _BurnWithFromMintTokenPoolAndProxy.Contract.GetOnRamp(&_BurnWithFromMintTokenPoolAndProxy.CallOpts, arg0) +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyCallerSession) GetOnRamp(arg0 uint64) (common.Address, error) { + return _BurnWithFromMintTokenPoolAndProxy.Contract.GetOnRamp(&_BurnWithFromMintTokenPoolAndProxy.CallOpts, arg0) +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyCaller) GetPreviousPool(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _BurnWithFromMintTokenPoolAndProxy.contract.Call(opts, &out, "getPreviousPool") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxySession) GetPreviousPool() (common.Address, error) { + return _BurnWithFromMintTokenPoolAndProxy.Contract.GetPreviousPool(&_BurnWithFromMintTokenPoolAndProxy.CallOpts) +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyCallerSession) GetPreviousPool() (common.Address, error) { + return _BurnWithFromMintTokenPoolAndProxy.Contract.GetPreviousPool(&_BurnWithFromMintTokenPoolAndProxy.CallOpts) +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyCaller) GetRateLimitAdmin(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _BurnWithFromMintTokenPoolAndProxy.contract.Call(opts, &out, "getRateLimitAdmin") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxySession) GetRateLimitAdmin() (common.Address, error) { + return _BurnWithFromMintTokenPoolAndProxy.Contract.GetRateLimitAdmin(&_BurnWithFromMintTokenPoolAndProxy.CallOpts) +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyCallerSession) GetRateLimitAdmin() (common.Address, error) { + return _BurnWithFromMintTokenPoolAndProxy.Contract.GetRateLimitAdmin(&_BurnWithFromMintTokenPoolAndProxy.CallOpts) +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyCaller) GetRemotePool(opts *bind.CallOpts, remoteChainSelector uint64) ([]byte, error) { + var out []interface{} + err := _BurnWithFromMintTokenPoolAndProxy.contract.Call(opts, &out, "getRemotePool", remoteChainSelector) + + if err != nil { + return *new([]byte), err + } + + out0 := *abi.ConvertType(out[0], new([]byte)).(*[]byte) + + return out0, err + +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxySession) GetRemotePool(remoteChainSelector uint64) ([]byte, error) { + return _BurnWithFromMintTokenPoolAndProxy.Contract.GetRemotePool(&_BurnWithFromMintTokenPoolAndProxy.CallOpts, remoteChainSelector) +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyCallerSession) GetRemotePool(remoteChainSelector uint64) ([]byte, error) { + return _BurnWithFromMintTokenPoolAndProxy.Contract.GetRemotePool(&_BurnWithFromMintTokenPoolAndProxy.CallOpts, remoteChainSelector) +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyCaller) GetRemoteToken(opts *bind.CallOpts, remoteChainSelector uint64) ([]byte, error) { + var out []interface{} + err := _BurnWithFromMintTokenPoolAndProxy.contract.Call(opts, &out, "getRemoteToken", remoteChainSelector) + + if err != nil { + return *new([]byte), err + } + + out0 := *abi.ConvertType(out[0], new([]byte)).(*[]byte) + + return out0, err + +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxySession) GetRemoteToken(remoteChainSelector uint64) ([]byte, error) { + return _BurnWithFromMintTokenPoolAndProxy.Contract.GetRemoteToken(&_BurnWithFromMintTokenPoolAndProxy.CallOpts, remoteChainSelector) +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyCallerSession) GetRemoteToken(remoteChainSelector uint64) ([]byte, error) { + return _BurnWithFromMintTokenPoolAndProxy.Contract.GetRemoteToken(&_BurnWithFromMintTokenPoolAndProxy.CallOpts, remoteChainSelector) +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyCaller) GetRmnProxy(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _BurnWithFromMintTokenPoolAndProxy.contract.Call(opts, &out, "getRmnProxy") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxySession) GetRmnProxy() (common.Address, error) { + return _BurnWithFromMintTokenPoolAndProxy.Contract.GetRmnProxy(&_BurnWithFromMintTokenPoolAndProxy.CallOpts) +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyCallerSession) GetRmnProxy() (common.Address, error) { + return _BurnWithFromMintTokenPoolAndProxy.Contract.GetRmnProxy(&_BurnWithFromMintTokenPoolAndProxy.CallOpts) +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyCaller) GetRouter(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _BurnWithFromMintTokenPoolAndProxy.contract.Call(opts, &out, "getRouter") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxySession) GetRouter() (common.Address, error) { + return _BurnWithFromMintTokenPoolAndProxy.Contract.GetRouter(&_BurnWithFromMintTokenPoolAndProxy.CallOpts) +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyCallerSession) GetRouter() (common.Address, error) { + return _BurnWithFromMintTokenPoolAndProxy.Contract.GetRouter(&_BurnWithFromMintTokenPoolAndProxy.CallOpts) +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyCaller) GetSupportedChains(opts *bind.CallOpts) ([]uint64, error) { + var out []interface{} + err := _BurnWithFromMintTokenPoolAndProxy.contract.Call(opts, &out, "getSupportedChains") + + if err != nil { + return *new([]uint64), err + } + + out0 := *abi.ConvertType(out[0], new([]uint64)).(*[]uint64) + + return out0, err + +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxySession) GetSupportedChains() ([]uint64, error) { + return _BurnWithFromMintTokenPoolAndProxy.Contract.GetSupportedChains(&_BurnWithFromMintTokenPoolAndProxy.CallOpts) +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyCallerSession) GetSupportedChains() ([]uint64, error) { + return _BurnWithFromMintTokenPoolAndProxy.Contract.GetSupportedChains(&_BurnWithFromMintTokenPoolAndProxy.CallOpts) +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyCaller) GetToken(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _BurnWithFromMintTokenPoolAndProxy.contract.Call(opts, &out, "getToken") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxySession) GetToken() (common.Address, error) { + return _BurnWithFromMintTokenPoolAndProxy.Contract.GetToken(&_BurnWithFromMintTokenPoolAndProxy.CallOpts) +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyCallerSession) GetToken() (common.Address, error) { + return _BurnWithFromMintTokenPoolAndProxy.Contract.GetToken(&_BurnWithFromMintTokenPoolAndProxy.CallOpts) +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyCaller) IsOffRamp(opts *bind.CallOpts, sourceChainSelector uint64, offRamp common.Address) (bool, error) { + var out []interface{} + err := _BurnWithFromMintTokenPoolAndProxy.contract.Call(opts, &out, "isOffRamp", sourceChainSelector, offRamp) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxySession) IsOffRamp(sourceChainSelector uint64, offRamp common.Address) (bool, error) { + return _BurnWithFromMintTokenPoolAndProxy.Contract.IsOffRamp(&_BurnWithFromMintTokenPoolAndProxy.CallOpts, sourceChainSelector, offRamp) +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyCallerSession) IsOffRamp(sourceChainSelector uint64, offRamp common.Address) (bool, error) { + return _BurnWithFromMintTokenPoolAndProxy.Contract.IsOffRamp(&_BurnWithFromMintTokenPoolAndProxy.CallOpts, sourceChainSelector, offRamp) +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyCaller) IsSupportedChain(opts *bind.CallOpts, remoteChainSelector uint64) (bool, error) { + var out []interface{} + err := _BurnWithFromMintTokenPoolAndProxy.contract.Call(opts, &out, "isSupportedChain", remoteChainSelector) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxySession) IsSupportedChain(remoteChainSelector uint64) (bool, error) { + return _BurnWithFromMintTokenPoolAndProxy.Contract.IsSupportedChain(&_BurnWithFromMintTokenPoolAndProxy.CallOpts, remoteChainSelector) +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyCallerSession) IsSupportedChain(remoteChainSelector uint64) (bool, error) { + return _BurnWithFromMintTokenPoolAndProxy.Contract.IsSupportedChain(&_BurnWithFromMintTokenPoolAndProxy.CallOpts, remoteChainSelector) +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyCaller) IsSupportedToken(opts *bind.CallOpts, token common.Address) (bool, error) { + var out []interface{} + err := _BurnWithFromMintTokenPoolAndProxy.contract.Call(opts, &out, "isSupportedToken", token) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxySession) IsSupportedToken(token common.Address) (bool, error) { + return _BurnWithFromMintTokenPoolAndProxy.Contract.IsSupportedToken(&_BurnWithFromMintTokenPoolAndProxy.CallOpts, token) +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyCallerSession) IsSupportedToken(token common.Address) (bool, error) { + return _BurnWithFromMintTokenPoolAndProxy.Contract.IsSupportedToken(&_BurnWithFromMintTokenPoolAndProxy.CallOpts, token) +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyCaller) Owner(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _BurnWithFromMintTokenPoolAndProxy.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 + +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxySession) Owner() (common.Address, error) { + return _BurnWithFromMintTokenPoolAndProxy.Contract.Owner(&_BurnWithFromMintTokenPoolAndProxy.CallOpts) +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyCallerSession) Owner() (common.Address, error) { + return _BurnWithFromMintTokenPoolAndProxy.Contract.Owner(&_BurnWithFromMintTokenPoolAndProxy.CallOpts) +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyCaller) SupportsInterface(opts *bind.CallOpts, interfaceId [4]byte) (bool, error) { + var out []interface{} + err := _BurnWithFromMintTokenPoolAndProxy.contract.Call(opts, &out, "supportsInterface", interfaceId) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxySession) SupportsInterface(interfaceId [4]byte) (bool, error) { + return _BurnWithFromMintTokenPoolAndProxy.Contract.SupportsInterface(&_BurnWithFromMintTokenPoolAndProxy.CallOpts, interfaceId) +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyCallerSession) SupportsInterface(interfaceId [4]byte) (bool, error) { + return _BurnWithFromMintTokenPoolAndProxy.Contract.SupportsInterface(&_BurnWithFromMintTokenPoolAndProxy.CallOpts, interfaceId) +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyCaller) TypeAndVersion(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _BurnWithFromMintTokenPoolAndProxy.contract.Call(opts, &out, "typeAndVersion") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxySession) TypeAndVersion() (string, error) { + return _BurnWithFromMintTokenPoolAndProxy.Contract.TypeAndVersion(&_BurnWithFromMintTokenPoolAndProxy.CallOpts) +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyCallerSession) TypeAndVersion() (string, error) { + return _BurnWithFromMintTokenPoolAndProxy.Contract.TypeAndVersion(&_BurnWithFromMintTokenPoolAndProxy.CallOpts) +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyTransactor) AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + return _BurnWithFromMintTokenPoolAndProxy.contract.Transact(opts, "acceptOwnership") +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxySession) AcceptOwnership() (*types.Transaction, error) { + return _BurnWithFromMintTokenPoolAndProxy.Contract.AcceptOwnership(&_BurnWithFromMintTokenPoolAndProxy.TransactOpts) +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyTransactorSession) AcceptOwnership() (*types.Transaction, error) { + return _BurnWithFromMintTokenPoolAndProxy.Contract.AcceptOwnership(&_BurnWithFromMintTokenPoolAndProxy.TransactOpts) +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyTransactor) ApplyAllowListUpdates(opts *bind.TransactOpts, removes []common.Address, adds []common.Address) (*types.Transaction, error) { + return _BurnWithFromMintTokenPoolAndProxy.contract.Transact(opts, "applyAllowListUpdates", removes, adds) +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxySession) ApplyAllowListUpdates(removes []common.Address, adds []common.Address) (*types.Transaction, error) { + return _BurnWithFromMintTokenPoolAndProxy.Contract.ApplyAllowListUpdates(&_BurnWithFromMintTokenPoolAndProxy.TransactOpts, removes, adds) +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyTransactorSession) ApplyAllowListUpdates(removes []common.Address, adds []common.Address) (*types.Transaction, error) { + return _BurnWithFromMintTokenPoolAndProxy.Contract.ApplyAllowListUpdates(&_BurnWithFromMintTokenPoolAndProxy.TransactOpts, removes, adds) +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyTransactor) ApplyChainUpdates(opts *bind.TransactOpts, chains []TokenPoolChainUpdate) (*types.Transaction, error) { + return _BurnWithFromMintTokenPoolAndProxy.contract.Transact(opts, "applyChainUpdates", chains) +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxySession) ApplyChainUpdates(chains []TokenPoolChainUpdate) (*types.Transaction, error) { + return _BurnWithFromMintTokenPoolAndProxy.Contract.ApplyChainUpdates(&_BurnWithFromMintTokenPoolAndProxy.TransactOpts, chains) +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyTransactorSession) ApplyChainUpdates(chains []TokenPoolChainUpdate) (*types.Transaction, error) { + return _BurnWithFromMintTokenPoolAndProxy.Contract.ApplyChainUpdates(&_BurnWithFromMintTokenPoolAndProxy.TransactOpts, chains) +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyTransactor) LockOrBurn(opts *bind.TransactOpts, lockOrBurnIn PoolLockOrBurnInV1) (*types.Transaction, error) { + return _BurnWithFromMintTokenPoolAndProxy.contract.Transact(opts, "lockOrBurn", lockOrBurnIn) +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxySession) LockOrBurn(lockOrBurnIn PoolLockOrBurnInV1) (*types.Transaction, error) { + return _BurnWithFromMintTokenPoolAndProxy.Contract.LockOrBurn(&_BurnWithFromMintTokenPoolAndProxy.TransactOpts, lockOrBurnIn) +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyTransactorSession) LockOrBurn(lockOrBurnIn PoolLockOrBurnInV1) (*types.Transaction, error) { + return _BurnWithFromMintTokenPoolAndProxy.Contract.LockOrBurn(&_BurnWithFromMintTokenPoolAndProxy.TransactOpts, lockOrBurnIn) +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyTransactor) ReleaseOrMint(opts *bind.TransactOpts, releaseOrMintIn PoolReleaseOrMintInV1) (*types.Transaction, error) { + return _BurnWithFromMintTokenPoolAndProxy.contract.Transact(opts, "releaseOrMint", releaseOrMintIn) +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxySession) ReleaseOrMint(releaseOrMintIn PoolReleaseOrMintInV1) (*types.Transaction, error) { + return _BurnWithFromMintTokenPoolAndProxy.Contract.ReleaseOrMint(&_BurnWithFromMintTokenPoolAndProxy.TransactOpts, releaseOrMintIn) +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyTransactorSession) ReleaseOrMint(releaseOrMintIn PoolReleaseOrMintInV1) (*types.Transaction, error) { + return _BurnWithFromMintTokenPoolAndProxy.Contract.ReleaseOrMint(&_BurnWithFromMintTokenPoolAndProxy.TransactOpts, releaseOrMintIn) +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyTransactor) SetChainRateLimiterConfig(opts *bind.TransactOpts, remoteChainSelector uint64, outboundConfig RateLimiterConfig, inboundConfig RateLimiterConfig) (*types.Transaction, error) { + return _BurnWithFromMintTokenPoolAndProxy.contract.Transact(opts, "setChainRateLimiterConfig", remoteChainSelector, outboundConfig, inboundConfig) +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxySession) SetChainRateLimiterConfig(remoteChainSelector uint64, outboundConfig RateLimiterConfig, inboundConfig RateLimiterConfig) (*types.Transaction, error) { + return _BurnWithFromMintTokenPoolAndProxy.Contract.SetChainRateLimiterConfig(&_BurnWithFromMintTokenPoolAndProxy.TransactOpts, remoteChainSelector, outboundConfig, inboundConfig) +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyTransactorSession) SetChainRateLimiterConfig(remoteChainSelector uint64, outboundConfig RateLimiterConfig, inboundConfig RateLimiterConfig) (*types.Transaction, error) { + return _BurnWithFromMintTokenPoolAndProxy.Contract.SetChainRateLimiterConfig(&_BurnWithFromMintTokenPoolAndProxy.TransactOpts, remoteChainSelector, outboundConfig, inboundConfig) +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyTransactor) SetPreviousPool(opts *bind.TransactOpts, prevPool common.Address) (*types.Transaction, error) { + return _BurnWithFromMintTokenPoolAndProxy.contract.Transact(opts, "setPreviousPool", prevPool) +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxySession) SetPreviousPool(prevPool common.Address) (*types.Transaction, error) { + return _BurnWithFromMintTokenPoolAndProxy.Contract.SetPreviousPool(&_BurnWithFromMintTokenPoolAndProxy.TransactOpts, prevPool) +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyTransactorSession) SetPreviousPool(prevPool common.Address) (*types.Transaction, error) { + return _BurnWithFromMintTokenPoolAndProxy.Contract.SetPreviousPool(&_BurnWithFromMintTokenPoolAndProxy.TransactOpts, prevPool) +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyTransactor) SetRateLimitAdmin(opts *bind.TransactOpts, rateLimitAdmin common.Address) (*types.Transaction, error) { + return _BurnWithFromMintTokenPoolAndProxy.contract.Transact(opts, "setRateLimitAdmin", rateLimitAdmin) +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxySession) SetRateLimitAdmin(rateLimitAdmin common.Address) (*types.Transaction, error) { + return _BurnWithFromMintTokenPoolAndProxy.Contract.SetRateLimitAdmin(&_BurnWithFromMintTokenPoolAndProxy.TransactOpts, rateLimitAdmin) +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyTransactorSession) SetRateLimitAdmin(rateLimitAdmin common.Address) (*types.Transaction, error) { + return _BurnWithFromMintTokenPoolAndProxy.Contract.SetRateLimitAdmin(&_BurnWithFromMintTokenPoolAndProxy.TransactOpts, rateLimitAdmin) +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyTransactor) SetRemotePool(opts *bind.TransactOpts, remoteChainSelector uint64, remotePoolAddress []byte) (*types.Transaction, error) { + return _BurnWithFromMintTokenPoolAndProxy.contract.Transact(opts, "setRemotePool", remoteChainSelector, remotePoolAddress) +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxySession) SetRemotePool(remoteChainSelector uint64, remotePoolAddress []byte) (*types.Transaction, error) { + return _BurnWithFromMintTokenPoolAndProxy.Contract.SetRemotePool(&_BurnWithFromMintTokenPoolAndProxy.TransactOpts, remoteChainSelector, remotePoolAddress) +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyTransactorSession) SetRemotePool(remoteChainSelector uint64, remotePoolAddress []byte) (*types.Transaction, error) { + return _BurnWithFromMintTokenPoolAndProxy.Contract.SetRemotePool(&_BurnWithFromMintTokenPoolAndProxy.TransactOpts, remoteChainSelector, remotePoolAddress) +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyTransactor) SetRouter(opts *bind.TransactOpts, newRouter common.Address) (*types.Transaction, error) { + return _BurnWithFromMintTokenPoolAndProxy.contract.Transact(opts, "setRouter", newRouter) +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxySession) SetRouter(newRouter common.Address) (*types.Transaction, error) { + return _BurnWithFromMintTokenPoolAndProxy.Contract.SetRouter(&_BurnWithFromMintTokenPoolAndProxy.TransactOpts, newRouter) +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyTransactorSession) SetRouter(newRouter common.Address) (*types.Transaction, error) { + return _BurnWithFromMintTokenPoolAndProxy.Contract.SetRouter(&_BurnWithFromMintTokenPoolAndProxy.TransactOpts, newRouter) +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyTransactor) TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) { + return _BurnWithFromMintTokenPoolAndProxy.contract.Transact(opts, "transferOwnership", to) +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxySession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _BurnWithFromMintTokenPoolAndProxy.Contract.TransferOwnership(&_BurnWithFromMintTokenPoolAndProxy.TransactOpts, to) +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyTransactorSession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _BurnWithFromMintTokenPoolAndProxy.Contract.TransferOwnership(&_BurnWithFromMintTokenPoolAndProxy.TransactOpts, to) +} + +type BurnWithFromMintTokenPoolAndProxyAllowListAddIterator struct { + Event *BurnWithFromMintTokenPoolAndProxyAllowListAdd + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *BurnWithFromMintTokenPoolAndProxyAllowListAddIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(BurnWithFromMintTokenPoolAndProxyAllowListAdd) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(BurnWithFromMintTokenPoolAndProxyAllowListAdd) + 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() + } +} + +func (it *BurnWithFromMintTokenPoolAndProxyAllowListAddIterator) Error() error { + return it.fail +} + +func (it *BurnWithFromMintTokenPoolAndProxyAllowListAddIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type BurnWithFromMintTokenPoolAndProxyAllowListAdd struct { + Sender common.Address + Raw types.Log +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyFilterer) FilterAllowListAdd(opts *bind.FilterOpts) (*BurnWithFromMintTokenPoolAndProxyAllowListAddIterator, error) { + + logs, sub, err := _BurnWithFromMintTokenPoolAndProxy.contract.FilterLogs(opts, "AllowListAdd") + if err != nil { + return nil, err + } + return &BurnWithFromMintTokenPoolAndProxyAllowListAddIterator{contract: _BurnWithFromMintTokenPoolAndProxy.contract, event: "AllowListAdd", logs: logs, sub: sub}, nil +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyFilterer) WatchAllowListAdd(opts *bind.WatchOpts, sink chan<- *BurnWithFromMintTokenPoolAndProxyAllowListAdd) (event.Subscription, error) { + + logs, sub, err := _BurnWithFromMintTokenPoolAndProxy.contract.WatchLogs(opts, "AllowListAdd") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(BurnWithFromMintTokenPoolAndProxyAllowListAdd) + if err := _BurnWithFromMintTokenPoolAndProxy.contract.UnpackLog(event, "AllowListAdd", 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 +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyFilterer) ParseAllowListAdd(log types.Log) (*BurnWithFromMintTokenPoolAndProxyAllowListAdd, error) { + event := new(BurnWithFromMintTokenPoolAndProxyAllowListAdd) + if err := _BurnWithFromMintTokenPoolAndProxy.contract.UnpackLog(event, "AllowListAdd", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type BurnWithFromMintTokenPoolAndProxyAllowListRemoveIterator struct { + Event *BurnWithFromMintTokenPoolAndProxyAllowListRemove + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *BurnWithFromMintTokenPoolAndProxyAllowListRemoveIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(BurnWithFromMintTokenPoolAndProxyAllowListRemove) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(BurnWithFromMintTokenPoolAndProxyAllowListRemove) + 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() + } +} + +func (it *BurnWithFromMintTokenPoolAndProxyAllowListRemoveIterator) Error() error { + return it.fail +} + +func (it *BurnWithFromMintTokenPoolAndProxyAllowListRemoveIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type BurnWithFromMintTokenPoolAndProxyAllowListRemove struct { + Sender common.Address + Raw types.Log +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyFilterer) FilterAllowListRemove(opts *bind.FilterOpts) (*BurnWithFromMintTokenPoolAndProxyAllowListRemoveIterator, error) { + + logs, sub, err := _BurnWithFromMintTokenPoolAndProxy.contract.FilterLogs(opts, "AllowListRemove") + if err != nil { + return nil, err + } + return &BurnWithFromMintTokenPoolAndProxyAllowListRemoveIterator{contract: _BurnWithFromMintTokenPoolAndProxy.contract, event: "AllowListRemove", logs: logs, sub: sub}, nil +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyFilterer) WatchAllowListRemove(opts *bind.WatchOpts, sink chan<- *BurnWithFromMintTokenPoolAndProxyAllowListRemove) (event.Subscription, error) { + + logs, sub, err := _BurnWithFromMintTokenPoolAndProxy.contract.WatchLogs(opts, "AllowListRemove") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(BurnWithFromMintTokenPoolAndProxyAllowListRemove) + if err := _BurnWithFromMintTokenPoolAndProxy.contract.UnpackLog(event, "AllowListRemove", 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 +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyFilterer) ParseAllowListRemove(log types.Log) (*BurnWithFromMintTokenPoolAndProxyAllowListRemove, error) { + event := new(BurnWithFromMintTokenPoolAndProxyAllowListRemove) + if err := _BurnWithFromMintTokenPoolAndProxy.contract.UnpackLog(event, "AllowListRemove", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type BurnWithFromMintTokenPoolAndProxyBurnedIterator struct { + Event *BurnWithFromMintTokenPoolAndProxyBurned + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *BurnWithFromMintTokenPoolAndProxyBurnedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(BurnWithFromMintTokenPoolAndProxyBurned) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(BurnWithFromMintTokenPoolAndProxyBurned) + 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() + } +} + +func (it *BurnWithFromMintTokenPoolAndProxyBurnedIterator) Error() error { + return it.fail +} + +func (it *BurnWithFromMintTokenPoolAndProxyBurnedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type BurnWithFromMintTokenPoolAndProxyBurned struct { + Sender common.Address + Amount *big.Int + Raw types.Log +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyFilterer) FilterBurned(opts *bind.FilterOpts, sender []common.Address) (*BurnWithFromMintTokenPoolAndProxyBurnedIterator, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _BurnWithFromMintTokenPoolAndProxy.contract.FilterLogs(opts, "Burned", senderRule) + if err != nil { + return nil, err + } + return &BurnWithFromMintTokenPoolAndProxyBurnedIterator{contract: _BurnWithFromMintTokenPoolAndProxy.contract, event: "Burned", logs: logs, sub: sub}, nil +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyFilterer) WatchBurned(opts *bind.WatchOpts, sink chan<- *BurnWithFromMintTokenPoolAndProxyBurned, sender []common.Address) (event.Subscription, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _BurnWithFromMintTokenPoolAndProxy.contract.WatchLogs(opts, "Burned", senderRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(BurnWithFromMintTokenPoolAndProxyBurned) + if err := _BurnWithFromMintTokenPoolAndProxy.contract.UnpackLog(event, "Burned", 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 +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyFilterer) ParseBurned(log types.Log) (*BurnWithFromMintTokenPoolAndProxyBurned, error) { + event := new(BurnWithFromMintTokenPoolAndProxyBurned) + if err := _BurnWithFromMintTokenPoolAndProxy.contract.UnpackLog(event, "Burned", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type BurnWithFromMintTokenPoolAndProxyChainAddedIterator struct { + Event *BurnWithFromMintTokenPoolAndProxyChainAdded + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *BurnWithFromMintTokenPoolAndProxyChainAddedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(BurnWithFromMintTokenPoolAndProxyChainAdded) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(BurnWithFromMintTokenPoolAndProxyChainAdded) + 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() + } +} + +func (it *BurnWithFromMintTokenPoolAndProxyChainAddedIterator) Error() error { + return it.fail +} + +func (it *BurnWithFromMintTokenPoolAndProxyChainAddedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type BurnWithFromMintTokenPoolAndProxyChainAdded struct { + RemoteChainSelector uint64 + RemoteToken []byte + OutboundRateLimiterConfig RateLimiterConfig + InboundRateLimiterConfig RateLimiterConfig + Raw types.Log +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyFilterer) FilterChainAdded(opts *bind.FilterOpts) (*BurnWithFromMintTokenPoolAndProxyChainAddedIterator, error) { + + logs, sub, err := _BurnWithFromMintTokenPoolAndProxy.contract.FilterLogs(opts, "ChainAdded") + if err != nil { + return nil, err + } + return &BurnWithFromMintTokenPoolAndProxyChainAddedIterator{contract: _BurnWithFromMintTokenPoolAndProxy.contract, event: "ChainAdded", logs: logs, sub: sub}, nil +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyFilterer) WatchChainAdded(opts *bind.WatchOpts, sink chan<- *BurnWithFromMintTokenPoolAndProxyChainAdded) (event.Subscription, error) { + + logs, sub, err := _BurnWithFromMintTokenPoolAndProxy.contract.WatchLogs(opts, "ChainAdded") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(BurnWithFromMintTokenPoolAndProxyChainAdded) + if err := _BurnWithFromMintTokenPoolAndProxy.contract.UnpackLog(event, "ChainAdded", 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 +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyFilterer) ParseChainAdded(log types.Log) (*BurnWithFromMintTokenPoolAndProxyChainAdded, error) { + event := new(BurnWithFromMintTokenPoolAndProxyChainAdded) + if err := _BurnWithFromMintTokenPoolAndProxy.contract.UnpackLog(event, "ChainAdded", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type BurnWithFromMintTokenPoolAndProxyChainConfiguredIterator struct { + Event *BurnWithFromMintTokenPoolAndProxyChainConfigured + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *BurnWithFromMintTokenPoolAndProxyChainConfiguredIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(BurnWithFromMintTokenPoolAndProxyChainConfigured) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(BurnWithFromMintTokenPoolAndProxyChainConfigured) + 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() + } +} + +func (it *BurnWithFromMintTokenPoolAndProxyChainConfiguredIterator) Error() error { + return it.fail +} + +func (it *BurnWithFromMintTokenPoolAndProxyChainConfiguredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type BurnWithFromMintTokenPoolAndProxyChainConfigured struct { + RemoteChainSelector uint64 + OutboundRateLimiterConfig RateLimiterConfig + InboundRateLimiterConfig RateLimiterConfig + Raw types.Log +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyFilterer) FilterChainConfigured(opts *bind.FilterOpts) (*BurnWithFromMintTokenPoolAndProxyChainConfiguredIterator, error) { + + logs, sub, err := _BurnWithFromMintTokenPoolAndProxy.contract.FilterLogs(opts, "ChainConfigured") + if err != nil { + return nil, err + } + return &BurnWithFromMintTokenPoolAndProxyChainConfiguredIterator{contract: _BurnWithFromMintTokenPoolAndProxy.contract, event: "ChainConfigured", logs: logs, sub: sub}, nil +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyFilterer) WatchChainConfigured(opts *bind.WatchOpts, sink chan<- *BurnWithFromMintTokenPoolAndProxyChainConfigured) (event.Subscription, error) { + + logs, sub, err := _BurnWithFromMintTokenPoolAndProxy.contract.WatchLogs(opts, "ChainConfigured") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(BurnWithFromMintTokenPoolAndProxyChainConfigured) + if err := _BurnWithFromMintTokenPoolAndProxy.contract.UnpackLog(event, "ChainConfigured", 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 +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyFilterer) ParseChainConfigured(log types.Log) (*BurnWithFromMintTokenPoolAndProxyChainConfigured, error) { + event := new(BurnWithFromMintTokenPoolAndProxyChainConfigured) + if err := _BurnWithFromMintTokenPoolAndProxy.contract.UnpackLog(event, "ChainConfigured", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type BurnWithFromMintTokenPoolAndProxyChainRemovedIterator struct { + Event *BurnWithFromMintTokenPoolAndProxyChainRemoved + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *BurnWithFromMintTokenPoolAndProxyChainRemovedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(BurnWithFromMintTokenPoolAndProxyChainRemoved) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(BurnWithFromMintTokenPoolAndProxyChainRemoved) + 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() + } +} + +func (it *BurnWithFromMintTokenPoolAndProxyChainRemovedIterator) Error() error { + return it.fail +} + +func (it *BurnWithFromMintTokenPoolAndProxyChainRemovedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type BurnWithFromMintTokenPoolAndProxyChainRemoved struct { + RemoteChainSelector uint64 + Raw types.Log +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyFilterer) FilterChainRemoved(opts *bind.FilterOpts) (*BurnWithFromMintTokenPoolAndProxyChainRemovedIterator, error) { + + logs, sub, err := _BurnWithFromMintTokenPoolAndProxy.contract.FilterLogs(opts, "ChainRemoved") + if err != nil { + return nil, err + } + return &BurnWithFromMintTokenPoolAndProxyChainRemovedIterator{contract: _BurnWithFromMintTokenPoolAndProxy.contract, event: "ChainRemoved", logs: logs, sub: sub}, nil +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyFilterer) WatchChainRemoved(opts *bind.WatchOpts, sink chan<- *BurnWithFromMintTokenPoolAndProxyChainRemoved) (event.Subscription, error) { + + logs, sub, err := _BurnWithFromMintTokenPoolAndProxy.contract.WatchLogs(opts, "ChainRemoved") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(BurnWithFromMintTokenPoolAndProxyChainRemoved) + if err := _BurnWithFromMintTokenPoolAndProxy.contract.UnpackLog(event, "ChainRemoved", 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 +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyFilterer) ParseChainRemoved(log types.Log) (*BurnWithFromMintTokenPoolAndProxyChainRemoved, error) { + event := new(BurnWithFromMintTokenPoolAndProxyChainRemoved) + if err := _BurnWithFromMintTokenPoolAndProxy.contract.UnpackLog(event, "ChainRemoved", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type BurnWithFromMintTokenPoolAndProxyConfigChangedIterator struct { + Event *BurnWithFromMintTokenPoolAndProxyConfigChanged + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *BurnWithFromMintTokenPoolAndProxyConfigChangedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(BurnWithFromMintTokenPoolAndProxyConfigChanged) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(BurnWithFromMintTokenPoolAndProxyConfigChanged) + 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() + } +} + +func (it *BurnWithFromMintTokenPoolAndProxyConfigChangedIterator) Error() error { + return it.fail +} + +func (it *BurnWithFromMintTokenPoolAndProxyConfigChangedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type BurnWithFromMintTokenPoolAndProxyConfigChanged struct { + Config RateLimiterConfig + Raw types.Log +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyFilterer) FilterConfigChanged(opts *bind.FilterOpts) (*BurnWithFromMintTokenPoolAndProxyConfigChangedIterator, error) { + + logs, sub, err := _BurnWithFromMintTokenPoolAndProxy.contract.FilterLogs(opts, "ConfigChanged") + if err != nil { + return nil, err + } + return &BurnWithFromMintTokenPoolAndProxyConfigChangedIterator{contract: _BurnWithFromMintTokenPoolAndProxy.contract, event: "ConfigChanged", logs: logs, sub: sub}, nil +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyFilterer) WatchConfigChanged(opts *bind.WatchOpts, sink chan<- *BurnWithFromMintTokenPoolAndProxyConfigChanged) (event.Subscription, error) { + + logs, sub, err := _BurnWithFromMintTokenPoolAndProxy.contract.WatchLogs(opts, "ConfigChanged") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(BurnWithFromMintTokenPoolAndProxyConfigChanged) + if err := _BurnWithFromMintTokenPoolAndProxy.contract.UnpackLog(event, "ConfigChanged", 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 +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyFilterer) ParseConfigChanged(log types.Log) (*BurnWithFromMintTokenPoolAndProxyConfigChanged, error) { + event := new(BurnWithFromMintTokenPoolAndProxyConfigChanged) + if err := _BurnWithFromMintTokenPoolAndProxy.contract.UnpackLog(event, "ConfigChanged", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type BurnWithFromMintTokenPoolAndProxyLegacyPoolChangedIterator struct { + Event *BurnWithFromMintTokenPoolAndProxyLegacyPoolChanged + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *BurnWithFromMintTokenPoolAndProxyLegacyPoolChangedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(BurnWithFromMintTokenPoolAndProxyLegacyPoolChanged) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(BurnWithFromMintTokenPoolAndProxyLegacyPoolChanged) + 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() + } +} + +func (it *BurnWithFromMintTokenPoolAndProxyLegacyPoolChangedIterator) Error() error { + return it.fail +} + +func (it *BurnWithFromMintTokenPoolAndProxyLegacyPoolChangedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type BurnWithFromMintTokenPoolAndProxyLegacyPoolChanged struct { + OldPool common.Address + NewPool common.Address + Raw types.Log +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyFilterer) FilterLegacyPoolChanged(opts *bind.FilterOpts) (*BurnWithFromMintTokenPoolAndProxyLegacyPoolChangedIterator, error) { + + logs, sub, err := _BurnWithFromMintTokenPoolAndProxy.contract.FilterLogs(opts, "LegacyPoolChanged") + if err != nil { + return nil, err + } + return &BurnWithFromMintTokenPoolAndProxyLegacyPoolChangedIterator{contract: _BurnWithFromMintTokenPoolAndProxy.contract, event: "LegacyPoolChanged", logs: logs, sub: sub}, nil +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyFilterer) WatchLegacyPoolChanged(opts *bind.WatchOpts, sink chan<- *BurnWithFromMintTokenPoolAndProxyLegacyPoolChanged) (event.Subscription, error) { + + logs, sub, err := _BurnWithFromMintTokenPoolAndProxy.contract.WatchLogs(opts, "LegacyPoolChanged") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(BurnWithFromMintTokenPoolAndProxyLegacyPoolChanged) + if err := _BurnWithFromMintTokenPoolAndProxy.contract.UnpackLog(event, "LegacyPoolChanged", 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 +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyFilterer) ParseLegacyPoolChanged(log types.Log) (*BurnWithFromMintTokenPoolAndProxyLegacyPoolChanged, error) { + event := new(BurnWithFromMintTokenPoolAndProxyLegacyPoolChanged) + if err := _BurnWithFromMintTokenPoolAndProxy.contract.UnpackLog(event, "LegacyPoolChanged", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type BurnWithFromMintTokenPoolAndProxyLockedIterator struct { + Event *BurnWithFromMintTokenPoolAndProxyLocked + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *BurnWithFromMintTokenPoolAndProxyLockedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(BurnWithFromMintTokenPoolAndProxyLocked) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(BurnWithFromMintTokenPoolAndProxyLocked) + 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() + } +} + +func (it *BurnWithFromMintTokenPoolAndProxyLockedIterator) Error() error { + return it.fail +} + +func (it *BurnWithFromMintTokenPoolAndProxyLockedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type BurnWithFromMintTokenPoolAndProxyLocked struct { + Sender common.Address + Amount *big.Int + Raw types.Log +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyFilterer) FilterLocked(opts *bind.FilterOpts, sender []common.Address) (*BurnWithFromMintTokenPoolAndProxyLockedIterator, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _BurnWithFromMintTokenPoolAndProxy.contract.FilterLogs(opts, "Locked", senderRule) + if err != nil { + return nil, err + } + return &BurnWithFromMintTokenPoolAndProxyLockedIterator{contract: _BurnWithFromMintTokenPoolAndProxy.contract, event: "Locked", logs: logs, sub: sub}, nil +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyFilterer) WatchLocked(opts *bind.WatchOpts, sink chan<- *BurnWithFromMintTokenPoolAndProxyLocked, sender []common.Address) (event.Subscription, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _BurnWithFromMintTokenPoolAndProxy.contract.WatchLogs(opts, "Locked", senderRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(BurnWithFromMintTokenPoolAndProxyLocked) + if err := _BurnWithFromMintTokenPoolAndProxy.contract.UnpackLog(event, "Locked", 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 +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyFilterer) ParseLocked(log types.Log) (*BurnWithFromMintTokenPoolAndProxyLocked, error) { + event := new(BurnWithFromMintTokenPoolAndProxyLocked) + if err := _BurnWithFromMintTokenPoolAndProxy.contract.UnpackLog(event, "Locked", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type BurnWithFromMintTokenPoolAndProxyMintedIterator struct { + Event *BurnWithFromMintTokenPoolAndProxyMinted + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *BurnWithFromMintTokenPoolAndProxyMintedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(BurnWithFromMintTokenPoolAndProxyMinted) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(BurnWithFromMintTokenPoolAndProxyMinted) + 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() + } +} + +func (it *BurnWithFromMintTokenPoolAndProxyMintedIterator) Error() error { + return it.fail +} + +func (it *BurnWithFromMintTokenPoolAndProxyMintedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type BurnWithFromMintTokenPoolAndProxyMinted struct { + Sender common.Address + Recipient common.Address + Amount *big.Int + Raw types.Log +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyFilterer) FilterMinted(opts *bind.FilterOpts, sender []common.Address, recipient []common.Address) (*BurnWithFromMintTokenPoolAndProxyMintedIterator, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + var recipientRule []interface{} + for _, recipientItem := range recipient { + recipientRule = append(recipientRule, recipientItem) + } + + logs, sub, err := _BurnWithFromMintTokenPoolAndProxy.contract.FilterLogs(opts, "Minted", senderRule, recipientRule) + if err != nil { + return nil, err + } + return &BurnWithFromMintTokenPoolAndProxyMintedIterator{contract: _BurnWithFromMintTokenPoolAndProxy.contract, event: "Minted", logs: logs, sub: sub}, nil +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyFilterer) WatchMinted(opts *bind.WatchOpts, sink chan<- *BurnWithFromMintTokenPoolAndProxyMinted, sender []common.Address, recipient []common.Address) (event.Subscription, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + var recipientRule []interface{} + for _, recipientItem := range recipient { + recipientRule = append(recipientRule, recipientItem) + } + + logs, sub, err := _BurnWithFromMintTokenPoolAndProxy.contract.WatchLogs(opts, "Minted", senderRule, recipientRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(BurnWithFromMintTokenPoolAndProxyMinted) + if err := _BurnWithFromMintTokenPoolAndProxy.contract.UnpackLog(event, "Minted", 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 +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyFilterer) ParseMinted(log types.Log) (*BurnWithFromMintTokenPoolAndProxyMinted, error) { + event := new(BurnWithFromMintTokenPoolAndProxyMinted) + if err := _BurnWithFromMintTokenPoolAndProxy.contract.UnpackLog(event, "Minted", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type BurnWithFromMintTokenPoolAndProxyOwnershipTransferRequestedIterator struct { + Event *BurnWithFromMintTokenPoolAndProxyOwnershipTransferRequested + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *BurnWithFromMintTokenPoolAndProxyOwnershipTransferRequestedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(BurnWithFromMintTokenPoolAndProxyOwnershipTransferRequested) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(BurnWithFromMintTokenPoolAndProxyOwnershipTransferRequested) + 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() + } +} + +func (it *BurnWithFromMintTokenPoolAndProxyOwnershipTransferRequestedIterator) Error() error { + return it.fail +} + +func (it *BurnWithFromMintTokenPoolAndProxyOwnershipTransferRequestedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type BurnWithFromMintTokenPoolAndProxyOwnershipTransferRequested struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyFilterer) FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*BurnWithFromMintTokenPoolAndProxyOwnershipTransferRequestedIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _BurnWithFromMintTokenPoolAndProxy.contract.FilterLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return &BurnWithFromMintTokenPoolAndProxyOwnershipTransferRequestedIterator{contract: _BurnWithFromMintTokenPoolAndProxy.contract, event: "OwnershipTransferRequested", logs: logs, sub: sub}, nil +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyFilterer) WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *BurnWithFromMintTokenPoolAndProxyOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _BurnWithFromMintTokenPoolAndProxy.contract.WatchLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(BurnWithFromMintTokenPoolAndProxyOwnershipTransferRequested) + if err := _BurnWithFromMintTokenPoolAndProxy.contract.UnpackLog(event, "OwnershipTransferRequested", 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 +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyFilterer) ParseOwnershipTransferRequested(log types.Log) (*BurnWithFromMintTokenPoolAndProxyOwnershipTransferRequested, error) { + event := new(BurnWithFromMintTokenPoolAndProxyOwnershipTransferRequested) + if err := _BurnWithFromMintTokenPoolAndProxy.contract.UnpackLog(event, "OwnershipTransferRequested", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type BurnWithFromMintTokenPoolAndProxyOwnershipTransferredIterator struct { + Event *BurnWithFromMintTokenPoolAndProxyOwnershipTransferred + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *BurnWithFromMintTokenPoolAndProxyOwnershipTransferredIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(BurnWithFromMintTokenPoolAndProxyOwnershipTransferred) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(BurnWithFromMintTokenPoolAndProxyOwnershipTransferred) + 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() + } +} + +func (it *BurnWithFromMintTokenPoolAndProxyOwnershipTransferredIterator) Error() error { + return it.fail +} + +func (it *BurnWithFromMintTokenPoolAndProxyOwnershipTransferredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type BurnWithFromMintTokenPoolAndProxyOwnershipTransferred struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*BurnWithFromMintTokenPoolAndProxyOwnershipTransferredIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _BurnWithFromMintTokenPoolAndProxy.contract.FilterLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return &BurnWithFromMintTokenPoolAndProxyOwnershipTransferredIterator{contract: _BurnWithFromMintTokenPoolAndProxy.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *BurnWithFromMintTokenPoolAndProxyOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _BurnWithFromMintTokenPoolAndProxy.contract.WatchLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(BurnWithFromMintTokenPoolAndProxyOwnershipTransferred) + if err := _BurnWithFromMintTokenPoolAndProxy.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 +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyFilterer) ParseOwnershipTransferred(log types.Log) (*BurnWithFromMintTokenPoolAndProxyOwnershipTransferred, error) { + event := new(BurnWithFromMintTokenPoolAndProxyOwnershipTransferred) + if err := _BurnWithFromMintTokenPoolAndProxy.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type BurnWithFromMintTokenPoolAndProxyReleasedIterator struct { + Event *BurnWithFromMintTokenPoolAndProxyReleased + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *BurnWithFromMintTokenPoolAndProxyReleasedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(BurnWithFromMintTokenPoolAndProxyReleased) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(BurnWithFromMintTokenPoolAndProxyReleased) + 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() + } +} + +func (it *BurnWithFromMintTokenPoolAndProxyReleasedIterator) Error() error { + return it.fail +} + +func (it *BurnWithFromMintTokenPoolAndProxyReleasedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type BurnWithFromMintTokenPoolAndProxyReleased struct { + Sender common.Address + Recipient common.Address + Amount *big.Int + Raw types.Log +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyFilterer) FilterReleased(opts *bind.FilterOpts, sender []common.Address, recipient []common.Address) (*BurnWithFromMintTokenPoolAndProxyReleasedIterator, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + var recipientRule []interface{} + for _, recipientItem := range recipient { + recipientRule = append(recipientRule, recipientItem) + } + + logs, sub, err := _BurnWithFromMintTokenPoolAndProxy.contract.FilterLogs(opts, "Released", senderRule, recipientRule) + if err != nil { + return nil, err + } + return &BurnWithFromMintTokenPoolAndProxyReleasedIterator{contract: _BurnWithFromMintTokenPoolAndProxy.contract, event: "Released", logs: logs, sub: sub}, nil +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyFilterer) WatchReleased(opts *bind.WatchOpts, sink chan<- *BurnWithFromMintTokenPoolAndProxyReleased, sender []common.Address, recipient []common.Address) (event.Subscription, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + var recipientRule []interface{} + for _, recipientItem := range recipient { + recipientRule = append(recipientRule, recipientItem) + } + + logs, sub, err := _BurnWithFromMintTokenPoolAndProxy.contract.WatchLogs(opts, "Released", senderRule, recipientRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(BurnWithFromMintTokenPoolAndProxyReleased) + if err := _BurnWithFromMintTokenPoolAndProxy.contract.UnpackLog(event, "Released", 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 +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyFilterer) ParseReleased(log types.Log) (*BurnWithFromMintTokenPoolAndProxyReleased, error) { + event := new(BurnWithFromMintTokenPoolAndProxyReleased) + if err := _BurnWithFromMintTokenPoolAndProxy.contract.UnpackLog(event, "Released", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type BurnWithFromMintTokenPoolAndProxyRemotePoolSetIterator struct { + Event *BurnWithFromMintTokenPoolAndProxyRemotePoolSet + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *BurnWithFromMintTokenPoolAndProxyRemotePoolSetIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(BurnWithFromMintTokenPoolAndProxyRemotePoolSet) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(BurnWithFromMintTokenPoolAndProxyRemotePoolSet) + 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() + } +} + +func (it *BurnWithFromMintTokenPoolAndProxyRemotePoolSetIterator) Error() error { + return it.fail +} + +func (it *BurnWithFromMintTokenPoolAndProxyRemotePoolSetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type BurnWithFromMintTokenPoolAndProxyRemotePoolSet struct { + RemoteChainSelector uint64 + PreviousPoolAddress []byte + RemotePoolAddress []byte + Raw types.Log +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyFilterer) FilterRemotePoolSet(opts *bind.FilterOpts, remoteChainSelector []uint64) (*BurnWithFromMintTokenPoolAndProxyRemotePoolSetIterator, error) { + + var remoteChainSelectorRule []interface{} + for _, remoteChainSelectorItem := range remoteChainSelector { + remoteChainSelectorRule = append(remoteChainSelectorRule, remoteChainSelectorItem) + } + + logs, sub, err := _BurnWithFromMintTokenPoolAndProxy.contract.FilterLogs(opts, "RemotePoolSet", remoteChainSelectorRule) + if err != nil { + return nil, err + } + return &BurnWithFromMintTokenPoolAndProxyRemotePoolSetIterator{contract: _BurnWithFromMintTokenPoolAndProxy.contract, event: "RemotePoolSet", logs: logs, sub: sub}, nil +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyFilterer) WatchRemotePoolSet(opts *bind.WatchOpts, sink chan<- *BurnWithFromMintTokenPoolAndProxyRemotePoolSet, remoteChainSelector []uint64) (event.Subscription, error) { + + var remoteChainSelectorRule []interface{} + for _, remoteChainSelectorItem := range remoteChainSelector { + remoteChainSelectorRule = append(remoteChainSelectorRule, remoteChainSelectorItem) + } + + logs, sub, err := _BurnWithFromMintTokenPoolAndProxy.contract.WatchLogs(opts, "RemotePoolSet", remoteChainSelectorRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(BurnWithFromMintTokenPoolAndProxyRemotePoolSet) + if err := _BurnWithFromMintTokenPoolAndProxy.contract.UnpackLog(event, "RemotePoolSet", 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 +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyFilterer) ParseRemotePoolSet(log types.Log) (*BurnWithFromMintTokenPoolAndProxyRemotePoolSet, error) { + event := new(BurnWithFromMintTokenPoolAndProxyRemotePoolSet) + if err := _BurnWithFromMintTokenPoolAndProxy.contract.UnpackLog(event, "RemotePoolSet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type BurnWithFromMintTokenPoolAndProxyRouterUpdatedIterator struct { + Event *BurnWithFromMintTokenPoolAndProxyRouterUpdated + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *BurnWithFromMintTokenPoolAndProxyRouterUpdatedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(BurnWithFromMintTokenPoolAndProxyRouterUpdated) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(BurnWithFromMintTokenPoolAndProxyRouterUpdated) + 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() + } +} + +func (it *BurnWithFromMintTokenPoolAndProxyRouterUpdatedIterator) Error() error { + return it.fail +} + +func (it *BurnWithFromMintTokenPoolAndProxyRouterUpdatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type BurnWithFromMintTokenPoolAndProxyRouterUpdated struct { + OldRouter common.Address + NewRouter common.Address + Raw types.Log +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyFilterer) FilterRouterUpdated(opts *bind.FilterOpts) (*BurnWithFromMintTokenPoolAndProxyRouterUpdatedIterator, error) { + + logs, sub, err := _BurnWithFromMintTokenPoolAndProxy.contract.FilterLogs(opts, "RouterUpdated") + if err != nil { + return nil, err + } + return &BurnWithFromMintTokenPoolAndProxyRouterUpdatedIterator{contract: _BurnWithFromMintTokenPoolAndProxy.contract, event: "RouterUpdated", logs: logs, sub: sub}, nil +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyFilterer) WatchRouterUpdated(opts *bind.WatchOpts, sink chan<- *BurnWithFromMintTokenPoolAndProxyRouterUpdated) (event.Subscription, error) { + + logs, sub, err := _BurnWithFromMintTokenPoolAndProxy.contract.WatchLogs(opts, "RouterUpdated") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(BurnWithFromMintTokenPoolAndProxyRouterUpdated) + if err := _BurnWithFromMintTokenPoolAndProxy.contract.UnpackLog(event, "RouterUpdated", 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 +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyFilterer) ParseRouterUpdated(log types.Log) (*BurnWithFromMintTokenPoolAndProxyRouterUpdated, error) { + event := new(BurnWithFromMintTokenPoolAndProxyRouterUpdated) + if err := _BurnWithFromMintTokenPoolAndProxy.contract.UnpackLog(event, "RouterUpdated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type BurnWithFromMintTokenPoolAndProxyTokensConsumedIterator struct { + Event *BurnWithFromMintTokenPoolAndProxyTokensConsumed + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *BurnWithFromMintTokenPoolAndProxyTokensConsumedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(BurnWithFromMintTokenPoolAndProxyTokensConsumed) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(BurnWithFromMintTokenPoolAndProxyTokensConsumed) + 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() + } +} + +func (it *BurnWithFromMintTokenPoolAndProxyTokensConsumedIterator) Error() error { + return it.fail +} + +func (it *BurnWithFromMintTokenPoolAndProxyTokensConsumedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type BurnWithFromMintTokenPoolAndProxyTokensConsumed struct { + Tokens *big.Int + Raw types.Log +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyFilterer) FilterTokensConsumed(opts *bind.FilterOpts) (*BurnWithFromMintTokenPoolAndProxyTokensConsumedIterator, error) { + + logs, sub, err := _BurnWithFromMintTokenPoolAndProxy.contract.FilterLogs(opts, "TokensConsumed") + if err != nil { + return nil, err + } + return &BurnWithFromMintTokenPoolAndProxyTokensConsumedIterator{contract: _BurnWithFromMintTokenPoolAndProxy.contract, event: "TokensConsumed", logs: logs, sub: sub}, nil +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyFilterer) WatchTokensConsumed(opts *bind.WatchOpts, sink chan<- *BurnWithFromMintTokenPoolAndProxyTokensConsumed) (event.Subscription, error) { + + logs, sub, err := _BurnWithFromMintTokenPoolAndProxy.contract.WatchLogs(opts, "TokensConsumed") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(BurnWithFromMintTokenPoolAndProxyTokensConsumed) + if err := _BurnWithFromMintTokenPoolAndProxy.contract.UnpackLog(event, "TokensConsumed", 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 +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxyFilterer) ParseTokensConsumed(log types.Log) (*BurnWithFromMintTokenPoolAndProxyTokensConsumed, error) { + event := new(BurnWithFromMintTokenPoolAndProxyTokensConsumed) + if err := _BurnWithFromMintTokenPoolAndProxy.contract.UnpackLog(event, "TokensConsumed", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxy) ParseLog(log types.Log) (generated.AbigenLog, error) { + switch log.Topics[0] { + case _BurnWithFromMintTokenPoolAndProxy.abi.Events["AllowListAdd"].ID: + return _BurnWithFromMintTokenPoolAndProxy.ParseAllowListAdd(log) + case _BurnWithFromMintTokenPoolAndProxy.abi.Events["AllowListRemove"].ID: + return _BurnWithFromMintTokenPoolAndProxy.ParseAllowListRemove(log) + case _BurnWithFromMintTokenPoolAndProxy.abi.Events["Burned"].ID: + return _BurnWithFromMintTokenPoolAndProxy.ParseBurned(log) + case _BurnWithFromMintTokenPoolAndProxy.abi.Events["ChainAdded"].ID: + return _BurnWithFromMintTokenPoolAndProxy.ParseChainAdded(log) + case _BurnWithFromMintTokenPoolAndProxy.abi.Events["ChainConfigured"].ID: + return _BurnWithFromMintTokenPoolAndProxy.ParseChainConfigured(log) + case _BurnWithFromMintTokenPoolAndProxy.abi.Events["ChainRemoved"].ID: + return _BurnWithFromMintTokenPoolAndProxy.ParseChainRemoved(log) + case _BurnWithFromMintTokenPoolAndProxy.abi.Events["ConfigChanged"].ID: + return _BurnWithFromMintTokenPoolAndProxy.ParseConfigChanged(log) + case _BurnWithFromMintTokenPoolAndProxy.abi.Events["LegacyPoolChanged"].ID: + return _BurnWithFromMintTokenPoolAndProxy.ParseLegacyPoolChanged(log) + case _BurnWithFromMintTokenPoolAndProxy.abi.Events["Locked"].ID: + return _BurnWithFromMintTokenPoolAndProxy.ParseLocked(log) + case _BurnWithFromMintTokenPoolAndProxy.abi.Events["Minted"].ID: + return _BurnWithFromMintTokenPoolAndProxy.ParseMinted(log) + case _BurnWithFromMintTokenPoolAndProxy.abi.Events["OwnershipTransferRequested"].ID: + return _BurnWithFromMintTokenPoolAndProxy.ParseOwnershipTransferRequested(log) + case _BurnWithFromMintTokenPoolAndProxy.abi.Events["OwnershipTransferred"].ID: + return _BurnWithFromMintTokenPoolAndProxy.ParseOwnershipTransferred(log) + case _BurnWithFromMintTokenPoolAndProxy.abi.Events["Released"].ID: + return _BurnWithFromMintTokenPoolAndProxy.ParseReleased(log) + case _BurnWithFromMintTokenPoolAndProxy.abi.Events["RemotePoolSet"].ID: + return _BurnWithFromMintTokenPoolAndProxy.ParseRemotePoolSet(log) + case _BurnWithFromMintTokenPoolAndProxy.abi.Events["RouterUpdated"].ID: + return _BurnWithFromMintTokenPoolAndProxy.ParseRouterUpdated(log) + case _BurnWithFromMintTokenPoolAndProxy.abi.Events["TokensConsumed"].ID: + return _BurnWithFromMintTokenPoolAndProxy.ParseTokensConsumed(log) + + default: + return nil, fmt.Errorf("abigen wrapper received unknown log topic: %v", log.Topics[0]) + } +} + +func (BurnWithFromMintTokenPoolAndProxyAllowListAdd) Topic() common.Hash { + return common.HexToHash("0x2640d4d76caf8bf478aabfa982fa4e1c4eb71a37f93cd15e80dbc657911546d8") +} + +func (BurnWithFromMintTokenPoolAndProxyAllowListRemove) Topic() common.Hash { + return common.HexToHash("0x800671136ab6cfee9fbe5ed1fb7ca417811aca3cf864800d127b927adedf7566") +} + +func (BurnWithFromMintTokenPoolAndProxyBurned) Topic() common.Hash { + return common.HexToHash("0x696de425f79f4a40bc6d2122ca50507f0efbeabbff86a84871b7196ab8ea8df7") +} + +func (BurnWithFromMintTokenPoolAndProxyChainAdded) Topic() common.Hash { + return common.HexToHash("0x8d340f17e19058004c20453540862a9c62778504476f6756755cb33bcd6c38c2") +} + +func (BurnWithFromMintTokenPoolAndProxyChainConfigured) Topic() common.Hash { + return common.HexToHash("0x0350d63aa5f270e01729d00d627eeb8f3429772b1818c016c66a588a864f912b") +} + +func (BurnWithFromMintTokenPoolAndProxyChainRemoved) Topic() common.Hash { + return common.HexToHash("0x5204aec90a3c794d8e90fded8b46ae9c7c552803e7e832e0c1d358396d859916") +} + +func (BurnWithFromMintTokenPoolAndProxyConfigChanged) Topic() common.Hash { + return common.HexToHash("0x9ea3374b67bf275e6bb9c8ae68f9cae023e1c528b4b27e092f0bb209d3531c19") +} + +func (BurnWithFromMintTokenPoolAndProxyLegacyPoolChanged) Topic() common.Hash { + return common.HexToHash("0x81accd0a7023865eaa51b3399dd0eafc488bf3ba238402911e1659cfe860f228") +} + +func (BurnWithFromMintTokenPoolAndProxyLocked) Topic() common.Hash { + return common.HexToHash("0x9f1ec8c880f76798e7b793325d625e9b60e4082a553c98f42b6cda368dd60008") +} + +func (BurnWithFromMintTokenPoolAndProxyMinted) Topic() common.Hash { + return common.HexToHash("0x9d228d69b5fdb8d273a2336f8fb8612d039631024ea9bf09c424a9503aa078f0") +} + +func (BurnWithFromMintTokenPoolAndProxyOwnershipTransferRequested) Topic() common.Hash { + return common.HexToHash("0xed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae1278") +} + +func (BurnWithFromMintTokenPoolAndProxyOwnershipTransferred) Topic() common.Hash { + return common.HexToHash("0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0") +} + +func (BurnWithFromMintTokenPoolAndProxyReleased) Topic() common.Hash { + return common.HexToHash("0x2d87480f50083e2b2759522a8fdda59802650a8055e609a7772cf70c07748f52") +} + +func (BurnWithFromMintTokenPoolAndProxyRemotePoolSet) Topic() common.Hash { + return common.HexToHash("0xdb4d6220746a38cbc5335f7e108f7de80f482f4d23350253dfd0917df75a14bf") +} + +func (BurnWithFromMintTokenPoolAndProxyRouterUpdated) Topic() common.Hash { + return common.HexToHash("0x02dc5c233404867c793b749c6d644beb2277536d18a7e7974d3f238e4c6f1684") +} + +func (BurnWithFromMintTokenPoolAndProxyTokensConsumed) Topic() common.Hash { + return common.HexToHash("0x1871cdf8010e63f2eb8384381a68dfa7416dc571a5517e66e88b2d2d0c0a690a") +} + +func (_BurnWithFromMintTokenPoolAndProxy *BurnWithFromMintTokenPoolAndProxy) Address() common.Address { + return _BurnWithFromMintTokenPoolAndProxy.address +} + +type BurnWithFromMintTokenPoolAndProxyInterface interface { + GetAllowList(opts *bind.CallOpts) ([]common.Address, error) + + GetAllowListEnabled(opts *bind.CallOpts) (bool, error) + + GetCurrentInboundRateLimiterState(opts *bind.CallOpts, remoteChainSelector uint64) (RateLimiterTokenBucket, error) + + GetCurrentOutboundRateLimiterState(opts *bind.CallOpts, remoteChainSelector uint64) (RateLimiterTokenBucket, error) + + GetOnRamp(opts *bind.CallOpts, arg0 uint64) (common.Address, error) + + GetPreviousPool(opts *bind.CallOpts) (common.Address, error) + + GetRateLimitAdmin(opts *bind.CallOpts) (common.Address, error) + + GetRemotePool(opts *bind.CallOpts, remoteChainSelector uint64) ([]byte, error) + + GetRemoteToken(opts *bind.CallOpts, remoteChainSelector uint64) ([]byte, error) + + GetRmnProxy(opts *bind.CallOpts) (common.Address, error) + + GetRouter(opts *bind.CallOpts) (common.Address, error) + + GetSupportedChains(opts *bind.CallOpts) ([]uint64, error) + + GetToken(opts *bind.CallOpts) (common.Address, error) + + IsOffRamp(opts *bind.CallOpts, sourceChainSelector uint64, offRamp common.Address) (bool, error) + + IsSupportedChain(opts *bind.CallOpts, remoteChainSelector uint64) (bool, error) + + IsSupportedToken(opts *bind.CallOpts, token common.Address) (bool, error) + + Owner(opts *bind.CallOpts) (common.Address, error) + + SupportsInterface(opts *bind.CallOpts, interfaceId [4]byte) (bool, error) + + TypeAndVersion(opts *bind.CallOpts) (string, error) + + AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) + + ApplyAllowListUpdates(opts *bind.TransactOpts, removes []common.Address, adds []common.Address) (*types.Transaction, error) + + ApplyChainUpdates(opts *bind.TransactOpts, chains []TokenPoolChainUpdate) (*types.Transaction, error) + + LockOrBurn(opts *bind.TransactOpts, lockOrBurnIn PoolLockOrBurnInV1) (*types.Transaction, error) + + ReleaseOrMint(opts *bind.TransactOpts, releaseOrMintIn PoolReleaseOrMintInV1) (*types.Transaction, error) + + SetChainRateLimiterConfig(opts *bind.TransactOpts, remoteChainSelector uint64, outboundConfig RateLimiterConfig, inboundConfig RateLimiterConfig) (*types.Transaction, error) + + SetPreviousPool(opts *bind.TransactOpts, prevPool common.Address) (*types.Transaction, error) + + SetRateLimitAdmin(opts *bind.TransactOpts, rateLimitAdmin common.Address) (*types.Transaction, error) + + SetRemotePool(opts *bind.TransactOpts, remoteChainSelector uint64, remotePoolAddress []byte) (*types.Transaction, error) + + SetRouter(opts *bind.TransactOpts, newRouter common.Address) (*types.Transaction, error) + + TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) + + FilterAllowListAdd(opts *bind.FilterOpts) (*BurnWithFromMintTokenPoolAndProxyAllowListAddIterator, error) + + WatchAllowListAdd(opts *bind.WatchOpts, sink chan<- *BurnWithFromMintTokenPoolAndProxyAllowListAdd) (event.Subscription, error) + + ParseAllowListAdd(log types.Log) (*BurnWithFromMintTokenPoolAndProxyAllowListAdd, error) + + FilterAllowListRemove(opts *bind.FilterOpts) (*BurnWithFromMintTokenPoolAndProxyAllowListRemoveIterator, error) + + WatchAllowListRemove(opts *bind.WatchOpts, sink chan<- *BurnWithFromMintTokenPoolAndProxyAllowListRemove) (event.Subscription, error) + + ParseAllowListRemove(log types.Log) (*BurnWithFromMintTokenPoolAndProxyAllowListRemove, error) + + FilterBurned(opts *bind.FilterOpts, sender []common.Address) (*BurnWithFromMintTokenPoolAndProxyBurnedIterator, error) + + WatchBurned(opts *bind.WatchOpts, sink chan<- *BurnWithFromMintTokenPoolAndProxyBurned, sender []common.Address) (event.Subscription, error) + + ParseBurned(log types.Log) (*BurnWithFromMintTokenPoolAndProxyBurned, error) + + FilterChainAdded(opts *bind.FilterOpts) (*BurnWithFromMintTokenPoolAndProxyChainAddedIterator, error) + + WatchChainAdded(opts *bind.WatchOpts, sink chan<- *BurnWithFromMintTokenPoolAndProxyChainAdded) (event.Subscription, error) + + ParseChainAdded(log types.Log) (*BurnWithFromMintTokenPoolAndProxyChainAdded, error) + + FilterChainConfigured(opts *bind.FilterOpts) (*BurnWithFromMintTokenPoolAndProxyChainConfiguredIterator, error) + + WatchChainConfigured(opts *bind.WatchOpts, sink chan<- *BurnWithFromMintTokenPoolAndProxyChainConfigured) (event.Subscription, error) + + ParseChainConfigured(log types.Log) (*BurnWithFromMintTokenPoolAndProxyChainConfigured, error) + + FilterChainRemoved(opts *bind.FilterOpts) (*BurnWithFromMintTokenPoolAndProxyChainRemovedIterator, error) + + WatchChainRemoved(opts *bind.WatchOpts, sink chan<- *BurnWithFromMintTokenPoolAndProxyChainRemoved) (event.Subscription, error) + + ParseChainRemoved(log types.Log) (*BurnWithFromMintTokenPoolAndProxyChainRemoved, error) + + FilterConfigChanged(opts *bind.FilterOpts) (*BurnWithFromMintTokenPoolAndProxyConfigChangedIterator, error) + + WatchConfigChanged(opts *bind.WatchOpts, sink chan<- *BurnWithFromMintTokenPoolAndProxyConfigChanged) (event.Subscription, error) + + ParseConfigChanged(log types.Log) (*BurnWithFromMintTokenPoolAndProxyConfigChanged, error) + + FilterLegacyPoolChanged(opts *bind.FilterOpts) (*BurnWithFromMintTokenPoolAndProxyLegacyPoolChangedIterator, error) + + WatchLegacyPoolChanged(opts *bind.WatchOpts, sink chan<- *BurnWithFromMintTokenPoolAndProxyLegacyPoolChanged) (event.Subscription, error) + + ParseLegacyPoolChanged(log types.Log) (*BurnWithFromMintTokenPoolAndProxyLegacyPoolChanged, error) + + FilterLocked(opts *bind.FilterOpts, sender []common.Address) (*BurnWithFromMintTokenPoolAndProxyLockedIterator, error) + + WatchLocked(opts *bind.WatchOpts, sink chan<- *BurnWithFromMintTokenPoolAndProxyLocked, sender []common.Address) (event.Subscription, error) + + ParseLocked(log types.Log) (*BurnWithFromMintTokenPoolAndProxyLocked, error) + + FilterMinted(opts *bind.FilterOpts, sender []common.Address, recipient []common.Address) (*BurnWithFromMintTokenPoolAndProxyMintedIterator, error) + + WatchMinted(opts *bind.WatchOpts, sink chan<- *BurnWithFromMintTokenPoolAndProxyMinted, sender []common.Address, recipient []common.Address) (event.Subscription, error) + + ParseMinted(log types.Log) (*BurnWithFromMintTokenPoolAndProxyMinted, error) + + FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*BurnWithFromMintTokenPoolAndProxyOwnershipTransferRequestedIterator, error) + + WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *BurnWithFromMintTokenPoolAndProxyOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferRequested(log types.Log) (*BurnWithFromMintTokenPoolAndProxyOwnershipTransferRequested, error) + + FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*BurnWithFromMintTokenPoolAndProxyOwnershipTransferredIterator, error) + + WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *BurnWithFromMintTokenPoolAndProxyOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferred(log types.Log) (*BurnWithFromMintTokenPoolAndProxyOwnershipTransferred, error) + + FilterReleased(opts *bind.FilterOpts, sender []common.Address, recipient []common.Address) (*BurnWithFromMintTokenPoolAndProxyReleasedIterator, error) + + WatchReleased(opts *bind.WatchOpts, sink chan<- *BurnWithFromMintTokenPoolAndProxyReleased, sender []common.Address, recipient []common.Address) (event.Subscription, error) + + ParseReleased(log types.Log) (*BurnWithFromMintTokenPoolAndProxyReleased, error) + + FilterRemotePoolSet(opts *bind.FilterOpts, remoteChainSelector []uint64) (*BurnWithFromMintTokenPoolAndProxyRemotePoolSetIterator, error) + + WatchRemotePoolSet(opts *bind.WatchOpts, sink chan<- *BurnWithFromMintTokenPoolAndProxyRemotePoolSet, remoteChainSelector []uint64) (event.Subscription, error) + + ParseRemotePoolSet(log types.Log) (*BurnWithFromMintTokenPoolAndProxyRemotePoolSet, error) + + FilterRouterUpdated(opts *bind.FilterOpts) (*BurnWithFromMintTokenPoolAndProxyRouterUpdatedIterator, error) + + WatchRouterUpdated(opts *bind.WatchOpts, sink chan<- *BurnWithFromMintTokenPoolAndProxyRouterUpdated) (event.Subscription, error) + + ParseRouterUpdated(log types.Log) (*BurnWithFromMintTokenPoolAndProxyRouterUpdated, error) + + FilterTokensConsumed(opts *bind.FilterOpts) (*BurnWithFromMintTokenPoolAndProxyTokensConsumedIterator, error) + + WatchTokensConsumed(opts *bind.WatchOpts, sink chan<- *BurnWithFromMintTokenPoolAndProxyTokensConsumed) (event.Subscription, error) + + ParseTokensConsumed(log types.Log) (*BurnWithFromMintTokenPoolAndProxyTokensConsumed, error) + + ParseLog(log types.Log) (generated.AbigenLog, error) + + Address() common.Address +} diff --git a/core/gethwrappers/ccip/generated/ccip_config/ccip_config.go b/core/gethwrappers/ccip/generated/ccip_config/ccip_config.go new file mode 100644 index 00000000000..3c2d44cd302 --- /dev/null +++ b/core/gethwrappers/ccip/generated/ccip_config/ccip_config.go @@ -0,0 +1,1126 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package ccip_config + +import ( + "errors" + "fmt" + "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" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" +) + +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +type CCIPConfigTypesChainConfig struct { + Readers [][32]byte + FChain uint8 + Config []byte +} + +type CCIPConfigTypesChainConfigInfo struct { + ChainSelector uint64 + ChainConfig CCIPConfigTypesChainConfig +} + +type CCIPConfigTypesOCR3Config struct { + PluginType uint8 + ChainSelector uint64 + F uint8 + OffchainConfigVersion uint64 + OfframpAddress []byte + P2pIds [][32]byte + Signers [][]byte + Transmitters [][]byte + OffchainConfig []byte +} + +type CCIPConfigTypesOCR3ConfigWithMeta struct { + Config CCIPConfigTypesOCR3Config + ConfigCount uint64 + ConfigDigest [32]byte +} + +var CCIPConfigMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"capabilitiesRegistry\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"}],\"name\":\"ChainSelectorNotFound\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ChainSelectorNotSet\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FChainMustBePositive\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FMustBePositive\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FTooHigh\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"length\",\"type\":\"uint256\"}],\"name\":\"InvalidConfigLength\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"enumCCIPConfigTypes.ConfigState\",\"name\":\"currentState\",\"type\":\"uint8\"},{\"internalType\":\"enumCCIPConfigTypes.ConfigState\",\"name\":\"proposedState\",\"type\":\"uint8\"}],\"name\":\"InvalidConfigStateTransition\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidPluginType\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"p2pId\",\"type\":\"bytes32\"}],\"name\":\"NodeNotInRegistry\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NonExistentConfigTransition\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"got\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"minimum\",\"type\":\"uint256\"}],\"name\":\"NotEnoughTransmitters\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OfframpAddressCannotBeZero\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCapabilitiesRegistryCanCall\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"p2pIdsLength\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"signersLength\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"transmittersLength\",\"type\":\"uint256\"}],\"name\":\"P2PIdsLengthNotMatching\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TooManyOCR3Configs\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TooManySigners\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"got\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"expected\",\"type\":\"uint64\"}],\"name\":\"WrongConfigCount\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"got\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"expected\",\"type\":\"bytes32\"}],\"name\":\"WrongConfigDigest\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"got\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"expected\",\"type\":\"bytes32\"}],\"name\":\"WrongConfigDigestBlueGreen\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddressNotAllowed\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"CapabilityConfigurationSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"}],\"name\":\"ChainConfigRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"},{\"components\":[{\"internalType\":\"bytes32[]\",\"name\":\"readers\",\"type\":\"bytes32[]\"},{\"internalType\":\"uint8\",\"name\":\"fChain\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"config\",\"type\":\"bytes\"}],\"indexed\":false,\"internalType\":\"structCCIPConfigTypes.ChainConfig\",\"name\":\"chainConfig\",\"type\":\"tuple\"}],\"name\":\"ChainConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64[]\",\"name\":\"chainSelectorRemoves\",\"type\":\"uint64[]\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"},{\"components\":[{\"internalType\":\"bytes32[]\",\"name\":\"readers\",\"type\":\"bytes32[]\"},{\"internalType\":\"uint8\",\"name\":\"fChain\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"config\",\"type\":\"bytes\"}],\"internalType\":\"structCCIPConfigTypes.ChainConfig\",\"name\":\"chainConfig\",\"type\":\"tuple\"}],\"internalType\":\"structCCIPConfigTypes.ChainConfigInfo[]\",\"name\":\"chainConfigAdds\",\"type\":\"tuple[]\"}],\"name\":\"applyChainConfigUpdates\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32[]\",\"name\":\"\",\"type\":\"bytes32[]\"},{\"internalType\":\"bytes\",\"name\":\"config\",\"type\":\"bytes\"},{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"donId\",\"type\":\"uint32\"}],\"name\":\"beforeCapabilityConfigSet\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"pageIndex\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"pageSize\",\"type\":\"uint256\"}],\"name\":\"getAllChainConfigs\",\"outputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"},{\"components\":[{\"internalType\":\"bytes32[]\",\"name\":\"readers\",\"type\":\"bytes32[]\"},{\"internalType\":\"uint8\",\"name\":\"fChain\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"config\",\"type\":\"bytes\"}],\"internalType\":\"structCCIPConfigTypes.ChainConfig\",\"name\":\"chainConfig\",\"type\":\"tuple\"}],\"internalType\":\"structCCIPConfigTypes.ChainConfigInfo[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"name\":\"getCapabilityConfiguration\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"configuration\",\"type\":\"bytes\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getCapabilityRegistry\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"donId\",\"type\":\"uint32\"},{\"internalType\":\"enumInternal.OCRPluginType\",\"name\":\"pluginType\",\"type\":\"uint8\"}],\"name\":\"getOCRConfig\",\"outputs\":[{\"components\":[{\"components\":[{\"internalType\":\"enumInternal.OCRPluginType\",\"name\":\"pluginType\",\"type\":\"uint8\"},{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint8\",\"name\":\"F\",\"type\":\"uint8\"},{\"internalType\":\"uint64\",\"name\":\"offchainConfigVersion\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"offrampAddress\",\"type\":\"bytes\"},{\"internalType\":\"bytes32[]\",\"name\":\"p2pIds\",\"type\":\"bytes32[]\"},{\"internalType\":\"bytes[]\",\"name\":\"signers\",\"type\":\"bytes[]\"},{\"internalType\":\"bytes[]\",\"name\":\"transmitters\",\"type\":\"bytes[]\"},{\"internalType\":\"bytes\",\"name\":\"offchainConfig\",\"type\":\"bytes\"}],\"internalType\":\"structCCIPConfigTypes.OCR3Config\",\"name\":\"config\",\"type\":\"tuple\"},{\"internalType\":\"uint64\",\"name\":\"configCount\",\"type\":\"uint64\"},{\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"}],\"internalType\":\"structCCIPConfigTypes.OCR3ConfigWithMeta[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", + Bin: "0x60a06040523480156200001157600080fd5b5060405162004080380380620040808339810160408190526200003491620001a6565b33806000816200008b5760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000be57620000be81620000fb565b5050506001600160a01b038116620000e9576040516342bcdf7f60e11b815260040160405180910390fd5b6001600160a01b0316608052620001d8565b336001600160a01b03821603620001555760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640162000082565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b600060208284031215620001b957600080fd5b81516001600160a01b0381168114620001d157600080fd5b9392505050565b608051613e7f620002016000396000818160f801528181610ea701526111170152613e7f6000f3fe608060405234801561001057600080fd5b50600436106100c95760003560e01c80638318ed5d11610081578063f2fde38b1161005b578063f2fde38b1461020f578063f442c89a14610222578063fba64a7c1461023557600080fd5b80638318ed5d146101b05780638da5cb5b146101d1578063b74b2356146101ef57600080fd5b8063181f5a77116100b2578063181f5a771461013d5780634bd0473f1461018657806379ba5097146101a657600080fd5b806301ffc9a7146100ce578063020330e6146100f6575b600080fd5b6100e16100dc366004612cbd565b610248565b60405190151581526020015b60405180910390f35b7f00000000000000000000000000000000000000000000000000000000000000005b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016100ed565b6101796040518060400160405280601481526020017f43434950436f6e66696720312e362e302d64657600000000000000000000000081525081565b6040516100ed9190612d63565b610199610194366004612da7565b6102e1565b6040516100ed9190612ec6565b6101ae610759565b005b6101796101be366004613082565b5060408051602081019091526000815290565b60005473ffffffffffffffffffffffffffffffffffffffff16610118565b6102026101fd36600461309f565b61085b565b6040516100ed9190613105565b6101ae61021d366004613195565b610adc565b6101ae610230366004613217565b610af0565b6101ae61024336600461329b565b610e8f565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f78bea7210000000000000000000000000000000000000000000000000000000014806102db57507fffffffff0000000000000000000000000000000000000000000000000000000082167f01ffc9a700000000000000000000000000000000000000000000000000000000145b92915050565b63ffffffff8216600090815260056020526040812060609183600181111561030b5761030b612ddc565b600181111561031c5761031c612ddc565b8152602001908152602001600020805480602002602001604051908101604052809291908181526020016000905b8282101561074d57600084815260209020604080516101808101909152600884029091018054829060608201908390829060ff16600181111561038f5761038f612ddc565b60018111156103a0576103a0612ddc565b8152815467ffffffffffffffff61010082048116602084015260ff690100000000000000000083041660408401526a01000000000000000000009091041660608201526001820180546080909201916103f890613358565b80601f016020809104026020016040519081016040528092919081815260200182805461042490613358565b80156104715780601f1061044657610100808354040283529160200191610471565b820191906000526020600020905b81548152906001019060200180831161045457829003601f168201915b50505050508152602001600282018054806020026020016040519081016040528092919081815260200182805480156104c957602002820191906000526020600020905b8154815260200190600101908083116104b5575b5050505050815260200160038201805480602002602001604051908101604052809291908181526020016000905b828210156105a357838290600052602060002001805461051690613358565b80601f016020809104026020016040519081016040528092919081815260200182805461054290613358565b801561058f5780601f106105645761010080835404028352916020019161058f565b820191906000526020600020905b81548152906001019060200180831161057257829003601f168201915b5050505050815260200190600101906104f7565b50505050815260200160048201805480602002602001604051908101604052809291908181526020016000905b8282101561067c5783829060005260206000200180546105ef90613358565b80601f016020809104026020016040519081016040528092919081815260200182805461061b90613358565b80156106685780601f1061063d57610100808354040283529160200191610668565b820191906000526020600020905b81548152906001019060200180831161064b57829003601f168201915b5050505050815260200190600101906105d0565b50505050815260200160058201805461069490613358565b80601f01602080910402602001604051908101604052809291908181526020018280546106c090613358565b801561070d5780601f106106e25761010080835404028352916020019161070d565b820191906000526020600020905b8154815290600101906020018083116106f057829003601f168201915b505050919092525050508152600682015467ffffffffffffffff16602080830191909152600790920154604090910152908252600192909201910161034a565b50505050905092915050565b60015473ffffffffffffffffffffffffffffffffffffffff1633146107df576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e65720000000000000000000060448201526064015b60405180910390fd5b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b606060006108696003610f4a565b9050600061087784866133da565b90508315806108865750818110155b156108c65760408051600080825260208201909252906108bc565b6108a9612a5c565b8152602001906001900390816108a15790505b50925050506102db565b60006108d28583613420565b9050828111156108df5750815b60006108eb8383613433565b67ffffffffffffffff811115610903576109036133f1565b60405190808252806020026020018201604052801561093c57816020015b610929612a5c565b8152602001906001900390816109215790505b509050600061094b6003610f54565b9050835b83811015610acf57600082828151811061096b5761096b613446565b60209081029190910181015160408051808201825267ffffffffffffffff8316808252600090815260028552829020825181546080818802830181019095526060820181815295975092958601949093919284928491908401828280156109f157602002820191906000526020600020905b8154815260200190600101908083116109dd575b5050509183525050600182015460ff166020820152600282018054604090920191610a1b90613358565b80601f0160208091040260200160405190810160405280929190818152602001828054610a4790613358565b8015610a945780601f10610a6957610100808354040283529160200191610a94565b820191906000526020600020905b815481529060010190602001808311610a7757829003601f168201915b50505091909252505050905284610aab8885613433565b81518110610abb57610abb613446565b60209081029190910101525060010161094f565b5090979650505050505050565b610ae4610f68565b610aed81610feb565b50565b610af8610f68565b60005b83811015610cde57610b3f858583818110610b1857610b18613446565b9050602002016020810190610b2d9190613475565b60039067ffffffffffffffff166110e0565b610ba957848482818110610b5557610b55613446565b9050602002016020810190610b6a9190613475565b6040517f1bd4d2d200000000000000000000000000000000000000000000000000000000815267ffffffffffffffff90911660048201526024016107d6565b60026000868684818110610bbf57610bbf613446565b9050602002016020810190610bd49190613475565b67ffffffffffffffff1681526020810191909152604001600090812090610bfb8282612aa4565b6001820180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055610c33600283016000612ac2565b5050610c71858583818110610c4a57610c4a613446565b9050602002016020810190610c5f9190613475565b60039067ffffffffffffffff166110f8565b507f2a680691fef3b2d105196805935232c661ce703e92d464ef0b94a7bc62d714f0858583818110610ca557610ca5613446565b9050602002016020810190610cba9190613475565b60405167ffffffffffffffff909116815260200160405180910390a1600101610afb565b5060005b81811015610e88576000838383818110610cfe57610cfe613446565b9050602002810190610d109190613490565b610d1e9060208101906134ce565b610d27906136d0565b90506000848484818110610d3d57610d3d613446565b9050602002810190610d4f9190613490565b610d5d906020810190613475565b9050610d6c8260000151611104565b816020015160ff16600003610dad576040517fa9b3766e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b67ffffffffffffffff81166000908152600260209081526040909120835180518593610ddd928492910190612afc565b5060208201516001820180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660ff90921691909117905560408201516002820190610e2a90826137b7565b50610e4491506003905067ffffffffffffffff8316611250565b507f05dd57854af2c291a94ea52e7c43d80bc3be7fa73022f98b735dea86642fa5e08183604051610e769291906138d1565b60405180910390a15050600101610ce2565b5050505050565b3373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614610efe576040517fac7a7efd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600080610f15610f108688018861397c565b61125c565b8151919350915015610f2d57610f2d836000846114a7565b805115610f4057610f40836001836114a7565b5050505050505050565b60006102db825490565b60606000610f6183611c09565b9392505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314610fe9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e65720000000000000000000060448201526064016107d6565b565b3373ffffffffffffffffffffffffffffffffffffffff82160361106a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c6600000000000000000060448201526064016107d6565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b60008181526001830160205260408120541515610f61565b6000610f618383611c65565b60005b815181101561124c5760008019167f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166350c946fe84848151811061116357611163613446565b60200260200101516040518263ffffffff1660e01b815260040161118991815260200190565b600060405180830381865afa1580156111a6573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682016040526111ec9190810190613bc7565b60800151036112445781818151811061120757611207613446565b60200260200101516040517f8907a4fa0000000000000000000000000000000000000000000000000000000081526004016107d691815260200190565b600101611107565b5050565b6000610f618383611d5f565b606080600460ff168351111561129e576040517f8854586400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040805160028082526060820190925290816020015b61131b6040805161012081019091528060008152602001600067ffffffffffffffff168152602001600060ff168152602001600067ffffffffffffffff16815260200160608152602001606081526020016060815260200160608152602001606081525090565b8152602001906001900390816112b457505060408051600280825260608201909252919350602082015b6113ac6040805161012081019091528060008152602001600067ffffffffffffffff168152602001600060ff168152602001600067ffffffffffffffff16815260200160608152602001606081526020016060815260200160608152602001606081525090565b81526020019060019003908161134557905050905060008060005b855181101561149a5760008682815181106113e4576113e4613446565b602002602001015160000151600181111561140157611401612ddc565b0361144e5785818151811061141857611418613446565b602002602001015185848151811061143257611432613446565b60200260200101819052508261144790613c9f565b9250611492565b85818151811061146057611460613446565b602002602001015184838151811061147a5761147a613446565b60200260200101819052508161148f90613c9f565b91505b6001016113c7565b5090835281529092909150565b63ffffffff83166000908152600560205260408120818460018111156114cf576114cf612ddc565b60018111156114e0576114e0612ddc565b8152602001908152602001600020805480602002602001604051908101604052809291908181526020016000905b8282101561191157600084815260209020604080516101808101909152600884029091018054829060608201908390829060ff16600181111561155357611553612ddc565b600181111561156457611564612ddc565b8152815467ffffffffffffffff61010082048116602084015260ff690100000000000000000083041660408401526a01000000000000000000009091041660608201526001820180546080909201916115bc90613358565b80601f01602080910402602001604051908101604052809291908181526020018280546115e890613358565b80156116355780601f1061160a57610100808354040283529160200191611635565b820191906000526020600020905b81548152906001019060200180831161161857829003601f168201915b505050505081526020016002820180548060200260200160405190810160405280929190818152602001828054801561168d57602002820191906000526020600020905b815481526020019060010190808311611679575b5050505050815260200160038201805480602002602001604051908101604052809291908181526020016000905b828210156117675783829060005260206000200180546116da90613358565b80601f016020809104026020016040519081016040528092919081815260200182805461170690613358565b80156117535780601f1061172857610100808354040283529160200191611753565b820191906000526020600020905b81548152906001019060200180831161173657829003601f168201915b5050505050815260200190600101906116bb565b50505050815260200160048201805480602002602001604051908101604052809291908181526020016000905b828210156118405783829060005260206000200180546117b390613358565b80601f01602080910402602001604051908101604052809291908181526020018280546117df90613358565b801561182c5780601f106118015761010080835404028352916020019161182c565b820191906000526020600020905b81548152906001019060200180831161180f57829003601f168201915b505050505081526020019060010190611794565b50505050815260200160058201805461185890613358565b80601f016020809104026020016040519081016040528092919081815260200182805461188490613358565b80156118d15780601f106118a6576101008083540402835291602001916118d1565b820191906000526020600020905b8154815290600101906020018083116118b457829003601f168201915b505050919092525050508152600682015467ffffffffffffffff16602080830191909152600790920154604090910152908252600192909201910161150e565b50505050905060006119238251611dae565b905060006119318451611dae565b905061193d8282611e00565b600061194c8785878686611ebc565b905061195884826122a0565b63ffffffff871660009081526005602052604081209087600181111561198057611980612ddc565b600181111561199157611991612ddc565b815260200190815260200160002060006119ab9190612b47565b60005b8151811015610f405763ffffffff88166000908152600560205260408120908860018111156119df576119df612ddc565b60018111156119f0576119f0612ddc565b8152602001908152602001600020828281518110611a1057611a10613446565b6020908102919091018101518254600181810185556000948552929093208151805160089095029091018054929490939192849283917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016908381811115611a7a57611a7a612ddc565b021790555060208201518154604084015160608501517fffffffffffffffffffffffffffffffffffffffffffff000000000000000000ff90921661010067ffffffffffffffff948516027fffffffffffffffffffffffffffffffffffffffffffff00ffffffffffffffffff1617690100000000000000000060ff90921691909102177fffffffffffffffffffffffffffff0000000000000000ffffffffffffffffffff166a0100000000000000000000929091169190910217815560808201516001820190611b4990826137b7565b5060a08201518051611b65916002840191602090910190612afc565b5060c08201518051611b81916003840191602090910190612b68565b5060e08201518051611b9d916004840191602090910190612b68565b506101008201516005820190611bb390826137b7565b50505060208201516006820180547fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000001667ffffffffffffffff9092169190911790556040909101516007909101556001016119ae565b606081600001805480602002602001604051908101604052809291908181526020018280548015611c5957602002820191906000526020600020905b815481526020019060010190808311611c45575b50505050509050919050565b60008181526001830160205260408120548015611d4e576000611c89600183613433565b8554909150600090611c9d90600190613433565b9050808214611d02576000866000018281548110611cbd57611cbd613446565b9060005260206000200154905080876000018481548110611ce057611ce0613446565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080611d1357611d13613cd7565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506102db565b60009150506102db565b5092915050565b6000818152600183016020526040812054611da6575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556102db565b5060006102db565b60006002821115611dee576040517f3e478526000000000000000000000000000000000000000000000000000000008152600481018390526024016107d6565b8160028111156102db576102db612ddc565b6000826002811115611e1457611e14612ddc565b826002811115611e2657611e26612ddc565b611e309190613d06565b90508060011480611e7c5750807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff148015611e7c57506002836002811115611e7a57611e7a612ddc565b145b15611e8657505050565b82826040517f0a6b675b0000000000000000000000000000000000000000000000000000000081526004016107d6929190613d36565b60606000845167ffffffffffffffff811115611eda57611eda6133f1565b604051908082528060200260200182016040528015611f03578160200160208202803683370190505b5090506000846002811115611f1a57611f1a612ddc565b148015611f3857506001836002811115611f3657611f36612ddc565b145b15611f7957600181600081518110611f5257611f52613446565b602002602001019067ffffffffffffffff16908167ffffffffffffffff16815250506120e1565b6001846002811115611f8d57611f8d612ddc565b148015611fab57506002836002811115611fa957611fa9612ddc565b145b156120425785600081518110611fc357611fc3613446565b60200260200101516020015181600081518110611fe257611fe2613446565b602002602001019067ffffffffffffffff16908167ffffffffffffffff16815250508560008151811061201757612017613446565b602002602001015160200151600161202f9190613d51565b81600181518110611f5257611f52613446565b600284600281111561205657612056612ddc565b1480156120745750600183600281111561207257612072612ddc565b145b156120ab578560018151811061208c5761208c613446565b60200260200101516020015181600081518110611f5257611f52613446565b83836040517f0a6b675b0000000000000000000000000000000000000000000000000000000081526004016107d6929190613d36565b6000855167ffffffffffffffff8111156120fd576120fd6133f1565b6040519080825280602002602001820160405280156121ab57816020015b6040805161018081018252600060608083018281526080840183905260a0840183905260c0840183905260e08401829052610100840182905261012084018290526101408401829052610160840191909152825260208083018290529282015282527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90920191018161211b5790505b50905060005b8251811015612294576121dc8782815181106121cf576121cf613446565b602002602001015161261f565b60405180606001604052808883815181106121f9576121f9613446565b6020026020010151815260200184838151811061221857612218613446565b602002602001015167ffffffffffffffff16815260200161226c8b86858151811061224557612245613446565b60200260200101518b868151811061225f5761225f613446565b602002602001015161298e565b81525082828151811061228157612281613446565b60209081029190910101526001016121b1565b50979650505050505050565b81518151811580156122b25750806001145b1561235457826000815181106122ca576122ca613446565b60200260200101516020015167ffffffffffffffff1660011461234e57826000815181106122fa576122fa613446565b60209081029190910181015101516040517fc1658eb800000000000000000000000000000000000000000000000000000000815267ffffffffffffffff9091166004820152600160248201526044016107d6565b50505050565b8160011480156123645750806002145b1561251a578360008151811061237c5761237c613446565b6020026020010151604001518360008151811061239b5761239b613446565b6020026020010151604001511461242757826000815181106123bf576123bf613446565b602002602001015160400151846000815181106123de576123de613446565b6020026020010151604001516040517fc7ccdd7f0000000000000000000000000000000000000000000000000000000081526004016107d6929190918252602082015260400190565b8360008151811061243a5761243a613446565b60200260200101516020015160016124529190613d51565b67ffffffffffffffff168360018151811061246f5761246f613446565b60200260200101516020015167ffffffffffffffff161461234e578260018151811061249d5761249d613446565b602002602001015160200151846000815181106124bc576124bc613446565b60200260200101516020015160016124d49190613d51565b6040517fc1658eb800000000000000000000000000000000000000000000000000000000815267ffffffffffffffff9283166004820152911660248201526044016107d6565b81600214801561252a5750806001145b156125ed578360018151811061254257612542613446565b6020026020010151604001518360008151811061256157612561613446565b6020026020010151604001511461234e578260008151811061258557612585613446565b602002602001015160400151846001815181106125a4576125a4613446565b6020026020010151604001516040517f9e9756700000000000000000000000000000000000000000000000000000000081526004016107d6929190918252602082015260400190565b6040517f1f1b2bb600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b806020015167ffffffffffffffff16600003612667576040517f698cf8e000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008151600181111561267c5761267c612ddc565b1415801561269d575060018151600181111561269a5761269a612ddc565b14155b156126d4576040517f3302dbd700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6080810151511580612711575060408051600060208201520160405160208183030381529060405280519060200120816080015180519060200120145b15612748576040517f358c192700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60208101516127639060039067ffffffffffffffff166110e0565b6127ab5760208101516040517f1bd4d2d200000000000000000000000000000000000000000000000000000000815267ffffffffffffffff90911660048201526024016107d6565b60208082015167ffffffffffffffff166000908152600290915260408120600101546127db9060ff166003613d72565b6127e6906001613d8e565b60ff169050808260e0015151101561283b5760e0820151516040517f548dd21f0000000000000000000000000000000000000000000000000000000081526004810191909152602481018290526044016107d6565b60c08201515161010081111561287d576040517f1b925da600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8260a00151518114158061289657508260e00151518114155b156128f05760a08301515160c08401515160e0850151516040517fba900f6d0000000000000000000000000000000000000000000000000000000081526004810193909352602483019190915260448201526064016107d6565b826040015160ff16600003612931576040517f39d1a4d000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040830151612941906003613d72565b60ff16811161297c576040517f4856694e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6129898360a00151611104565b505050565b60008082602001518584600001518560800151878760a001518860c001518960e001518a604001518b606001518c61010001516040516020016129db9b9a99989796959493929190613da7565b604080518083037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe001815291905280516020909101207dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167e0a000000000000000000000000000000000000000000000000000000000000179150509392505050565b6040518060400160405280600067ffffffffffffffff168152602001612a9f604051806060016040528060608152602001600060ff168152602001606081525090565b905290565b5080546000825590600052602060002090810190610aed9190612bba565b508054612ace90613358565b6000825580601f10612ade575050565b601f016020900490600052602060002090810190610aed9190612bba565b828054828255906000526020600020908101928215612b37579160200282015b82811115612b37578251825591602001919060010190612b1c565b50612b43929150612bba565b5090565b5080546000825560080290600052602060002090810190610aed9190612bcf565b828054828255906000526020600020908101928215612bae579160200282015b82811115612bae5782518290612b9e90826137b7565b5091602001919060010190612b88565b50612b43929150612c82565b5b80821115612b435760008155600101612bbb565b80821115612b435780547fffffffffffffffffffffffffffff00000000000000000000000000000000000016815560008181612c0e6001830182612ac2565b612c1c600283016000612aa4565b612c2a600383016000612c9f565b612c38600483016000612c9f565b612c46600583016000612ac2565b5050506006810180547fffffffffffffffffffffffffffffffffffffffffffffffff000000000000000016905560006007820155600801612bcf565b80821115612b43576000612c968282612ac2565b50600101612c82565b5080546000825590600052602060002090810190610aed9190612c82565b600060208284031215612ccf57600080fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114610f6157600080fd5b6000815180845260005b81811015612d2557602081850181015186830182015201612d09565b5060006020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b602081526000610f616020830184612cff565b63ffffffff81168114610aed57600080fd5b8035612d9381612d76565b919050565b803560028110612d9357600080fd5b60008060408385031215612dba57600080fd5b8235612dc581612d76565b9150612dd360208401612d98565b90509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b60028110612e1b57612e1b612ddc565b9052565b60008151808452602080850194506020840160005b83811015612e5057815187529582019590820190600101612e34565b509495945050505050565b60008282518085526020808601955060208260051b8401016020860160005b84811015610acf577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0868403018952612eb4838351612cff565b98840198925090830190600101612e7a565b600060208083018184528085518083526040925060408601915060408160051b87010184880160005b83811015613074577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0898403018552815160608151818652612f348287018251612e0b565b898101516080612f4f8189018367ffffffffffffffff169052565b8a830151915060a0612f65818a018460ff169052565b938301519360c09250612f838984018667ffffffffffffffff169052565b818401519450610120915060e082818b0152612fa36101808b0187612cff565b95508185015191507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa0610100818c890301818d0152612fe28885612e1f565b958701518c87038301868e0152959750612ffc8887612e5b565b9750828701519550818c8903016101408d01526130198887612e5b565b975080870151965050808b8803016101608c0152505050505061303c8282612cff565b915050888201516130588a87018267ffffffffffffffff169052565b5090870151938701939093529386019390860190600101612eef565b509098975050505050505050565b60006020828403121561309457600080fd5b8135610f6181612d76565b600080604083850312156130b257600080fd5b50508035926020909101359150565b60008151606084526130d66060850182612e1f565b905060ff6020840151166020850152604083015184820360408601526130fc8282612cff565b95945050505050565b600060208083018184528085518083526040925060408601915060408160051b87010184880160005b83811015613074578883037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc00185528151805167ffffffffffffffff168452870151878401879052613182878501826130c1565b958801959350509086019060010161312e565b6000602082840312156131a757600080fd5b813573ffffffffffffffffffffffffffffffffffffffff81168114610f6157600080fd5b60008083601f8401126131dd57600080fd5b50813567ffffffffffffffff8111156131f557600080fd5b6020830191508360208260051b850101111561321057600080fd5b9250929050565b6000806000806040858703121561322d57600080fd5b843567ffffffffffffffff8082111561324557600080fd5b613251888389016131cb565b9096509450602087013591508082111561326a57600080fd5b50613277878288016131cb565b95989497509550505050565b803567ffffffffffffffff81168114612d9357600080fd5b600080600080600080608087890312156132b457600080fd5b863567ffffffffffffffff808211156132cc57600080fd5b6132d88a838b016131cb565b909850965060208901359150808211156132f157600080fd5b818901915089601f83011261330557600080fd5b81358181111561331457600080fd5b8a602082850101111561332657600080fd5b60208301965080955050505061333e60408801613283565b915061334c60608801612d88565b90509295509295509295565b600181811c9082168061336c57607f821691505b6020821081036133a5577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b80820281158282048414176102db576102db6133ab565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b808201808211156102db576102db6133ab565b818103818111156102db576102db6133ab565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60006020828403121561348757600080fd5b610f6182613283565b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc18336030181126134c457600080fd5b9190910192915050565b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa18336030181126134c457600080fd5b604051610120810167ffffffffffffffff81118282101715613526576135266133f1565b60405290565b60405160e0810167ffffffffffffffff81118282101715613526576135266133f1565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715613596576135966133f1565b604052919050565b600067ffffffffffffffff8211156135b8576135b86133f1565b5060051b60200190565b600082601f8301126135d357600080fd5b813560206135e86135e38361359e565b61354f565b8083825260208201915060208460051b87010193508684111561360a57600080fd5b602086015b84811015613626578035835291830191830161360f565b509695505050505050565b803560ff81168114612d9357600080fd5b600082601f83011261365357600080fd5b813567ffffffffffffffff81111561366d5761366d6133f1565b61369e60207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8401160161354f565b8181528460208386010111156136b357600080fd5b816020850160208301376000918101602001919091529392505050565b6000606082360312156136e257600080fd5b6040516060810167ffffffffffffffff8282108183111715613706576137066133f1565b81604052843591508082111561371b57600080fd5b613727368387016135c2565b835261373560208601613631565b6020840152604085013591508082111561374e57600080fd5b5061375b36828601613642565b60408301525092915050565b601f821115612989576000816000526020600020601f850160051c810160208610156137905750805b601f850160051c820191505b818110156137af5782815560010161379c565b505050505050565b815167ffffffffffffffff8111156137d1576137d16133f1565b6137e5816137df8454613358565b84613767565b602080601f83116001811461383857600084156138025750858301515b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600386901b1c1916600185901b1785556137af565b6000858152602081207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08616915b8281101561388557888601518255948401946001909101908401613866565b50858210156138c157878501517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600388901b60f8161c191681555b5050505050600190811b01905550565b67ffffffffffffffff831681526040602082015260006138f460408301846130c1565b949350505050565b600082601f83011261390d57600080fd5b8135602061391d6135e38361359e565b82815260059290921b8401810191818101908684111561393c57600080fd5b8286015b8481101561362657803567ffffffffffffffff8111156139605760008081fd5b61396e8986838b0101613642565b845250918301918301613940565b6000602080838503121561398f57600080fd5b823567ffffffffffffffff808211156139a757600080fd5b818501915085601f8301126139bb57600080fd5b81356139c96135e38261359e565b81815260059190911b830184019084810190888311156139e857600080fd5b8585015b83811015613b5057803585811115613a0357600080fd5b8601610120818c037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe001811315613a3957600080fd5b613a41613502565b613a4c8a8401612d98565b8152613a5a60408401613283565b8a820152613a6a60608401613631565b6040820152613a7b60808401613283565b606082015260a083013588811115613a9257600080fd5b613aa08e8c83870101613642565b60808301525060c083013588811115613ab857600080fd5b613ac68e8c838701016135c2565b60a08301525060e083013588811115613adf5760008081fd5b613aed8e8c838701016138fc565b60c0830152506101008084013589811115613b085760008081fd5b613b168f8d838801016138fc565b60e084015250918301359188831115613b2f5760008081fd5b613b3d8e8c85870101613642565b90820152855250509186019186016139ec565b5098975050505050505050565b8051612d9381612d76565b600082601f830112613b7957600080fd5b81516020613b896135e38361359e565b8083825260208201915060208460051b870101935086841115613bab57600080fd5b602086015b848110156136265780518352918301918301613bb0565b600060208284031215613bd957600080fd5b815167ffffffffffffffff80821115613bf157600080fd5b9083019060e08286031215613c0557600080fd5b613c0d61352c565b613c1683613b5d565b8152613c2460208401613b5d565b6020820152613c3560408401613b5d565b6040820152606083015160608201526080830151608082015260a083015182811115613c6057600080fd5b613c6c87828601613b68565b60a08301525060c083015182811115613c8457600080fd5b613c9087828601613b68565b60c08301525095945050505050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203613cd057613cd06133ab565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b8181036000831280158383131683831282161715611d5857611d586133ab565b60038110612e1b57612e1b612ddc565b60408101613d448285613d26565b610f616020830184613d26565b67ffffffffffffffff818116838216019080821115611d5857611d586133ab565b60ff8181168382160290811690818114611d5857611d586133ab565b60ff81811683821601908111156102db576102db6133ab565b600061016067ffffffffffffffff8e16835263ffffffff8d166020840152613dd2604084018d612e0b565b806060840152613de48184018c612cff565b67ffffffffffffffff8b166080850152905082810360a0840152613e08818a612e1f565b905082810360c0840152613e1c8189612e5b565b905082810360e0840152613e308188612e5b565b60ff8716610100850152905067ffffffffffffffff8516610120840152828103610140840152613e608185612cff565b9e9d505050505050505050505050505056fea164736f6c6343000818000a", +} + +var CCIPConfigABI = CCIPConfigMetaData.ABI + +var CCIPConfigBin = CCIPConfigMetaData.Bin + +func DeployCCIPConfig(auth *bind.TransactOpts, backend bind.ContractBackend, capabilitiesRegistry common.Address) (common.Address, *types.Transaction, *CCIPConfig, error) { + parsed, err := CCIPConfigMetaData.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(CCIPConfigBin), backend, capabilitiesRegistry) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &CCIPConfig{address: address, abi: *parsed, CCIPConfigCaller: CCIPConfigCaller{contract: contract}, CCIPConfigTransactor: CCIPConfigTransactor{contract: contract}, CCIPConfigFilterer: CCIPConfigFilterer{contract: contract}}, nil +} + +type CCIPConfig struct { + address common.Address + abi abi.ABI + CCIPConfigCaller + CCIPConfigTransactor + CCIPConfigFilterer +} + +type CCIPConfigCaller struct { + contract *bind.BoundContract +} + +type CCIPConfigTransactor struct { + contract *bind.BoundContract +} + +type CCIPConfigFilterer struct { + contract *bind.BoundContract +} + +type CCIPConfigSession struct { + Contract *CCIPConfig + CallOpts bind.CallOpts + TransactOpts bind.TransactOpts +} + +type CCIPConfigCallerSession struct { + Contract *CCIPConfigCaller + CallOpts bind.CallOpts +} + +type CCIPConfigTransactorSession struct { + Contract *CCIPConfigTransactor + TransactOpts bind.TransactOpts +} + +type CCIPConfigRaw struct { + Contract *CCIPConfig +} + +type CCIPConfigCallerRaw struct { + Contract *CCIPConfigCaller +} + +type CCIPConfigTransactorRaw struct { + Contract *CCIPConfigTransactor +} + +func NewCCIPConfig(address common.Address, backend bind.ContractBackend) (*CCIPConfig, error) { + abi, err := abi.JSON(strings.NewReader(CCIPConfigABI)) + if err != nil { + return nil, err + } + contract, err := bindCCIPConfig(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &CCIPConfig{address: address, abi: abi, CCIPConfigCaller: CCIPConfigCaller{contract: contract}, CCIPConfigTransactor: CCIPConfigTransactor{contract: contract}, CCIPConfigFilterer: CCIPConfigFilterer{contract: contract}}, nil +} + +func NewCCIPConfigCaller(address common.Address, caller bind.ContractCaller) (*CCIPConfigCaller, error) { + contract, err := bindCCIPConfig(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &CCIPConfigCaller{contract: contract}, nil +} + +func NewCCIPConfigTransactor(address common.Address, transactor bind.ContractTransactor) (*CCIPConfigTransactor, error) { + contract, err := bindCCIPConfig(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &CCIPConfigTransactor{contract: contract}, nil +} + +func NewCCIPConfigFilterer(address common.Address, filterer bind.ContractFilterer) (*CCIPConfigFilterer, error) { + contract, err := bindCCIPConfig(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &CCIPConfigFilterer{contract: contract}, nil +} + +func bindCCIPConfig(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := CCIPConfigMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +func (_CCIPConfig *CCIPConfigRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _CCIPConfig.Contract.CCIPConfigCaller.contract.Call(opts, result, method, params...) +} + +func (_CCIPConfig *CCIPConfigRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _CCIPConfig.Contract.CCIPConfigTransactor.contract.Transfer(opts) +} + +func (_CCIPConfig *CCIPConfigRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _CCIPConfig.Contract.CCIPConfigTransactor.contract.Transact(opts, method, params...) +} + +func (_CCIPConfig *CCIPConfigCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _CCIPConfig.Contract.contract.Call(opts, result, method, params...) +} + +func (_CCIPConfig *CCIPConfigTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _CCIPConfig.Contract.contract.Transfer(opts) +} + +func (_CCIPConfig *CCIPConfigTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _CCIPConfig.Contract.contract.Transact(opts, method, params...) +} + +func (_CCIPConfig *CCIPConfigCaller) GetAllChainConfigs(opts *bind.CallOpts, pageIndex *big.Int, pageSize *big.Int) ([]CCIPConfigTypesChainConfigInfo, error) { + var out []interface{} + err := _CCIPConfig.contract.Call(opts, &out, "getAllChainConfigs", pageIndex, pageSize) + + if err != nil { + return *new([]CCIPConfigTypesChainConfigInfo), err + } + + out0 := *abi.ConvertType(out[0], new([]CCIPConfigTypesChainConfigInfo)).(*[]CCIPConfigTypesChainConfigInfo) + + return out0, err + +} + +func (_CCIPConfig *CCIPConfigSession) GetAllChainConfigs(pageIndex *big.Int, pageSize *big.Int) ([]CCIPConfigTypesChainConfigInfo, error) { + return _CCIPConfig.Contract.GetAllChainConfigs(&_CCIPConfig.CallOpts, pageIndex, pageSize) +} + +func (_CCIPConfig *CCIPConfigCallerSession) GetAllChainConfigs(pageIndex *big.Int, pageSize *big.Int) ([]CCIPConfigTypesChainConfigInfo, error) { + return _CCIPConfig.Contract.GetAllChainConfigs(&_CCIPConfig.CallOpts, pageIndex, pageSize) +} + +func (_CCIPConfig *CCIPConfigCaller) GetCapabilityConfiguration(opts *bind.CallOpts, arg0 uint32) ([]byte, error) { + var out []interface{} + err := _CCIPConfig.contract.Call(opts, &out, "getCapabilityConfiguration", arg0) + + if err != nil { + return *new([]byte), err + } + + out0 := *abi.ConvertType(out[0], new([]byte)).(*[]byte) + + return out0, err + +} + +func (_CCIPConfig *CCIPConfigSession) GetCapabilityConfiguration(arg0 uint32) ([]byte, error) { + return _CCIPConfig.Contract.GetCapabilityConfiguration(&_CCIPConfig.CallOpts, arg0) +} + +func (_CCIPConfig *CCIPConfigCallerSession) GetCapabilityConfiguration(arg0 uint32) ([]byte, error) { + return _CCIPConfig.Contract.GetCapabilityConfiguration(&_CCIPConfig.CallOpts, arg0) +} + +func (_CCIPConfig *CCIPConfigCaller) GetCapabilityRegistry(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _CCIPConfig.contract.Call(opts, &out, "getCapabilityRegistry") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_CCIPConfig *CCIPConfigSession) GetCapabilityRegistry() (common.Address, error) { + return _CCIPConfig.Contract.GetCapabilityRegistry(&_CCIPConfig.CallOpts) +} + +func (_CCIPConfig *CCIPConfigCallerSession) GetCapabilityRegistry() (common.Address, error) { + return _CCIPConfig.Contract.GetCapabilityRegistry(&_CCIPConfig.CallOpts) +} + +func (_CCIPConfig *CCIPConfigCaller) GetOCRConfig(opts *bind.CallOpts, donId uint32, pluginType uint8) ([]CCIPConfigTypesOCR3ConfigWithMeta, error) { + var out []interface{} + err := _CCIPConfig.contract.Call(opts, &out, "getOCRConfig", donId, pluginType) + + if err != nil { + return *new([]CCIPConfigTypesOCR3ConfigWithMeta), err + } + + out0 := *abi.ConvertType(out[0], new([]CCIPConfigTypesOCR3ConfigWithMeta)).(*[]CCIPConfigTypesOCR3ConfigWithMeta) + + return out0, err + +} + +func (_CCIPConfig *CCIPConfigSession) GetOCRConfig(donId uint32, pluginType uint8) ([]CCIPConfigTypesOCR3ConfigWithMeta, error) { + return _CCIPConfig.Contract.GetOCRConfig(&_CCIPConfig.CallOpts, donId, pluginType) +} + +func (_CCIPConfig *CCIPConfigCallerSession) GetOCRConfig(donId uint32, pluginType uint8) ([]CCIPConfigTypesOCR3ConfigWithMeta, error) { + return _CCIPConfig.Contract.GetOCRConfig(&_CCIPConfig.CallOpts, donId, pluginType) +} + +func (_CCIPConfig *CCIPConfigCaller) Owner(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _CCIPConfig.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 + +} + +func (_CCIPConfig *CCIPConfigSession) Owner() (common.Address, error) { + return _CCIPConfig.Contract.Owner(&_CCIPConfig.CallOpts) +} + +func (_CCIPConfig *CCIPConfigCallerSession) Owner() (common.Address, error) { + return _CCIPConfig.Contract.Owner(&_CCIPConfig.CallOpts) +} + +func (_CCIPConfig *CCIPConfigCaller) SupportsInterface(opts *bind.CallOpts, interfaceId [4]byte) (bool, error) { + var out []interface{} + err := _CCIPConfig.contract.Call(opts, &out, "supportsInterface", interfaceId) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_CCIPConfig *CCIPConfigSession) SupportsInterface(interfaceId [4]byte) (bool, error) { + return _CCIPConfig.Contract.SupportsInterface(&_CCIPConfig.CallOpts, interfaceId) +} + +func (_CCIPConfig *CCIPConfigCallerSession) SupportsInterface(interfaceId [4]byte) (bool, error) { + return _CCIPConfig.Contract.SupportsInterface(&_CCIPConfig.CallOpts, interfaceId) +} + +func (_CCIPConfig *CCIPConfigCaller) TypeAndVersion(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _CCIPConfig.contract.Call(opts, &out, "typeAndVersion") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +func (_CCIPConfig *CCIPConfigSession) TypeAndVersion() (string, error) { + return _CCIPConfig.Contract.TypeAndVersion(&_CCIPConfig.CallOpts) +} + +func (_CCIPConfig *CCIPConfigCallerSession) TypeAndVersion() (string, error) { + return _CCIPConfig.Contract.TypeAndVersion(&_CCIPConfig.CallOpts) +} + +func (_CCIPConfig *CCIPConfigTransactor) AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + return _CCIPConfig.contract.Transact(opts, "acceptOwnership") +} + +func (_CCIPConfig *CCIPConfigSession) AcceptOwnership() (*types.Transaction, error) { + return _CCIPConfig.Contract.AcceptOwnership(&_CCIPConfig.TransactOpts) +} + +func (_CCIPConfig *CCIPConfigTransactorSession) AcceptOwnership() (*types.Transaction, error) { + return _CCIPConfig.Contract.AcceptOwnership(&_CCIPConfig.TransactOpts) +} + +func (_CCIPConfig *CCIPConfigTransactor) ApplyChainConfigUpdates(opts *bind.TransactOpts, chainSelectorRemoves []uint64, chainConfigAdds []CCIPConfigTypesChainConfigInfo) (*types.Transaction, error) { + return _CCIPConfig.contract.Transact(opts, "applyChainConfigUpdates", chainSelectorRemoves, chainConfigAdds) +} + +func (_CCIPConfig *CCIPConfigSession) ApplyChainConfigUpdates(chainSelectorRemoves []uint64, chainConfigAdds []CCIPConfigTypesChainConfigInfo) (*types.Transaction, error) { + return _CCIPConfig.Contract.ApplyChainConfigUpdates(&_CCIPConfig.TransactOpts, chainSelectorRemoves, chainConfigAdds) +} + +func (_CCIPConfig *CCIPConfigTransactorSession) ApplyChainConfigUpdates(chainSelectorRemoves []uint64, chainConfigAdds []CCIPConfigTypesChainConfigInfo) (*types.Transaction, error) { + return _CCIPConfig.Contract.ApplyChainConfigUpdates(&_CCIPConfig.TransactOpts, chainSelectorRemoves, chainConfigAdds) +} + +func (_CCIPConfig *CCIPConfigTransactor) BeforeCapabilityConfigSet(opts *bind.TransactOpts, arg0 [][32]byte, config []byte, arg2 uint64, donId uint32) (*types.Transaction, error) { + return _CCIPConfig.contract.Transact(opts, "beforeCapabilityConfigSet", arg0, config, arg2, donId) +} + +func (_CCIPConfig *CCIPConfigSession) BeforeCapabilityConfigSet(arg0 [][32]byte, config []byte, arg2 uint64, donId uint32) (*types.Transaction, error) { + return _CCIPConfig.Contract.BeforeCapabilityConfigSet(&_CCIPConfig.TransactOpts, arg0, config, arg2, donId) +} + +func (_CCIPConfig *CCIPConfigTransactorSession) BeforeCapabilityConfigSet(arg0 [][32]byte, config []byte, arg2 uint64, donId uint32) (*types.Transaction, error) { + return _CCIPConfig.Contract.BeforeCapabilityConfigSet(&_CCIPConfig.TransactOpts, arg0, config, arg2, donId) +} + +func (_CCIPConfig *CCIPConfigTransactor) TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) { + return _CCIPConfig.contract.Transact(opts, "transferOwnership", to) +} + +func (_CCIPConfig *CCIPConfigSession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _CCIPConfig.Contract.TransferOwnership(&_CCIPConfig.TransactOpts, to) +} + +func (_CCIPConfig *CCIPConfigTransactorSession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _CCIPConfig.Contract.TransferOwnership(&_CCIPConfig.TransactOpts, to) +} + +type CCIPConfigCapabilityConfigurationSetIterator struct { + Event *CCIPConfigCapabilityConfigurationSet + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *CCIPConfigCapabilityConfigurationSetIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(CCIPConfigCapabilityConfigurationSet) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(CCIPConfigCapabilityConfigurationSet) + 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() + } +} + +func (it *CCIPConfigCapabilityConfigurationSetIterator) Error() error { + return it.fail +} + +func (it *CCIPConfigCapabilityConfigurationSetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type CCIPConfigCapabilityConfigurationSet struct { + Raw types.Log +} + +func (_CCIPConfig *CCIPConfigFilterer) FilterCapabilityConfigurationSet(opts *bind.FilterOpts) (*CCIPConfigCapabilityConfigurationSetIterator, error) { + + logs, sub, err := _CCIPConfig.contract.FilterLogs(opts, "CapabilityConfigurationSet") + if err != nil { + return nil, err + } + return &CCIPConfigCapabilityConfigurationSetIterator{contract: _CCIPConfig.contract, event: "CapabilityConfigurationSet", logs: logs, sub: sub}, nil +} + +func (_CCIPConfig *CCIPConfigFilterer) WatchCapabilityConfigurationSet(opts *bind.WatchOpts, sink chan<- *CCIPConfigCapabilityConfigurationSet) (event.Subscription, error) { + + logs, sub, err := _CCIPConfig.contract.WatchLogs(opts, "CapabilityConfigurationSet") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(CCIPConfigCapabilityConfigurationSet) + if err := _CCIPConfig.contract.UnpackLog(event, "CapabilityConfigurationSet", 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 +} + +func (_CCIPConfig *CCIPConfigFilterer) ParseCapabilityConfigurationSet(log types.Log) (*CCIPConfigCapabilityConfigurationSet, error) { + event := new(CCIPConfigCapabilityConfigurationSet) + if err := _CCIPConfig.contract.UnpackLog(event, "CapabilityConfigurationSet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type CCIPConfigChainConfigRemovedIterator struct { + Event *CCIPConfigChainConfigRemoved + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *CCIPConfigChainConfigRemovedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(CCIPConfigChainConfigRemoved) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(CCIPConfigChainConfigRemoved) + 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() + } +} + +func (it *CCIPConfigChainConfigRemovedIterator) Error() error { + return it.fail +} + +func (it *CCIPConfigChainConfigRemovedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type CCIPConfigChainConfigRemoved struct { + ChainSelector uint64 + Raw types.Log +} + +func (_CCIPConfig *CCIPConfigFilterer) FilterChainConfigRemoved(opts *bind.FilterOpts) (*CCIPConfigChainConfigRemovedIterator, error) { + + logs, sub, err := _CCIPConfig.contract.FilterLogs(opts, "ChainConfigRemoved") + if err != nil { + return nil, err + } + return &CCIPConfigChainConfigRemovedIterator{contract: _CCIPConfig.contract, event: "ChainConfigRemoved", logs: logs, sub: sub}, nil +} + +func (_CCIPConfig *CCIPConfigFilterer) WatchChainConfigRemoved(opts *bind.WatchOpts, sink chan<- *CCIPConfigChainConfigRemoved) (event.Subscription, error) { + + logs, sub, err := _CCIPConfig.contract.WatchLogs(opts, "ChainConfigRemoved") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(CCIPConfigChainConfigRemoved) + if err := _CCIPConfig.contract.UnpackLog(event, "ChainConfigRemoved", 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 +} + +func (_CCIPConfig *CCIPConfigFilterer) ParseChainConfigRemoved(log types.Log) (*CCIPConfigChainConfigRemoved, error) { + event := new(CCIPConfigChainConfigRemoved) + if err := _CCIPConfig.contract.UnpackLog(event, "ChainConfigRemoved", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type CCIPConfigChainConfigSetIterator struct { + Event *CCIPConfigChainConfigSet + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *CCIPConfigChainConfigSetIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(CCIPConfigChainConfigSet) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(CCIPConfigChainConfigSet) + 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() + } +} + +func (it *CCIPConfigChainConfigSetIterator) Error() error { + return it.fail +} + +func (it *CCIPConfigChainConfigSetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type CCIPConfigChainConfigSet struct { + ChainSelector uint64 + ChainConfig CCIPConfigTypesChainConfig + Raw types.Log +} + +func (_CCIPConfig *CCIPConfigFilterer) FilterChainConfigSet(opts *bind.FilterOpts) (*CCIPConfigChainConfigSetIterator, error) { + + logs, sub, err := _CCIPConfig.contract.FilterLogs(opts, "ChainConfigSet") + if err != nil { + return nil, err + } + return &CCIPConfigChainConfigSetIterator{contract: _CCIPConfig.contract, event: "ChainConfigSet", logs: logs, sub: sub}, nil +} + +func (_CCIPConfig *CCIPConfigFilterer) WatchChainConfigSet(opts *bind.WatchOpts, sink chan<- *CCIPConfigChainConfigSet) (event.Subscription, error) { + + logs, sub, err := _CCIPConfig.contract.WatchLogs(opts, "ChainConfigSet") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(CCIPConfigChainConfigSet) + if err := _CCIPConfig.contract.UnpackLog(event, "ChainConfigSet", 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 +} + +func (_CCIPConfig *CCIPConfigFilterer) ParseChainConfigSet(log types.Log) (*CCIPConfigChainConfigSet, error) { + event := new(CCIPConfigChainConfigSet) + if err := _CCIPConfig.contract.UnpackLog(event, "ChainConfigSet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type CCIPConfigOwnershipTransferRequestedIterator struct { + Event *CCIPConfigOwnershipTransferRequested + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *CCIPConfigOwnershipTransferRequestedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(CCIPConfigOwnershipTransferRequested) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(CCIPConfigOwnershipTransferRequested) + 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() + } +} + +func (it *CCIPConfigOwnershipTransferRequestedIterator) Error() error { + return it.fail +} + +func (it *CCIPConfigOwnershipTransferRequestedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type CCIPConfigOwnershipTransferRequested struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_CCIPConfig *CCIPConfigFilterer) FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*CCIPConfigOwnershipTransferRequestedIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _CCIPConfig.contract.FilterLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return &CCIPConfigOwnershipTransferRequestedIterator{contract: _CCIPConfig.contract, event: "OwnershipTransferRequested", logs: logs, sub: sub}, nil +} + +func (_CCIPConfig *CCIPConfigFilterer) WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *CCIPConfigOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _CCIPConfig.contract.WatchLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(CCIPConfigOwnershipTransferRequested) + if err := _CCIPConfig.contract.UnpackLog(event, "OwnershipTransferRequested", 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 +} + +func (_CCIPConfig *CCIPConfigFilterer) ParseOwnershipTransferRequested(log types.Log) (*CCIPConfigOwnershipTransferRequested, error) { + event := new(CCIPConfigOwnershipTransferRequested) + if err := _CCIPConfig.contract.UnpackLog(event, "OwnershipTransferRequested", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type CCIPConfigOwnershipTransferredIterator struct { + Event *CCIPConfigOwnershipTransferred + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *CCIPConfigOwnershipTransferredIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(CCIPConfigOwnershipTransferred) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(CCIPConfigOwnershipTransferred) + 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() + } +} + +func (it *CCIPConfigOwnershipTransferredIterator) Error() error { + return it.fail +} + +func (it *CCIPConfigOwnershipTransferredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type CCIPConfigOwnershipTransferred struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_CCIPConfig *CCIPConfigFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*CCIPConfigOwnershipTransferredIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _CCIPConfig.contract.FilterLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return &CCIPConfigOwnershipTransferredIterator{contract: _CCIPConfig.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil +} + +func (_CCIPConfig *CCIPConfigFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *CCIPConfigOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _CCIPConfig.contract.WatchLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(CCIPConfigOwnershipTransferred) + if err := _CCIPConfig.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 +} + +func (_CCIPConfig *CCIPConfigFilterer) ParseOwnershipTransferred(log types.Log) (*CCIPConfigOwnershipTransferred, error) { + event := new(CCIPConfigOwnershipTransferred) + if err := _CCIPConfig.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +func (_CCIPConfig *CCIPConfig) ParseLog(log types.Log) (generated.AbigenLog, error) { + switch log.Topics[0] { + case _CCIPConfig.abi.Events["CapabilityConfigurationSet"].ID: + return _CCIPConfig.ParseCapabilityConfigurationSet(log) + case _CCIPConfig.abi.Events["ChainConfigRemoved"].ID: + return _CCIPConfig.ParseChainConfigRemoved(log) + case _CCIPConfig.abi.Events["ChainConfigSet"].ID: + return _CCIPConfig.ParseChainConfigSet(log) + case _CCIPConfig.abi.Events["OwnershipTransferRequested"].ID: + return _CCIPConfig.ParseOwnershipTransferRequested(log) + case _CCIPConfig.abi.Events["OwnershipTransferred"].ID: + return _CCIPConfig.ParseOwnershipTransferred(log) + + default: + return nil, fmt.Errorf("abigen wrapper received unknown log topic: %v", log.Topics[0]) + } +} + +func (CCIPConfigCapabilityConfigurationSet) Topic() common.Hash { + return common.HexToHash("0x84ad7751b744c9e2ee77da1d902b428aec7f0a343d67a24bbe2142e6f58a8d0f") +} + +func (CCIPConfigChainConfigRemoved) Topic() common.Hash { + return common.HexToHash("0x2a680691fef3b2d105196805935232c661ce703e92d464ef0b94a7bc62d714f0") +} + +func (CCIPConfigChainConfigSet) Topic() common.Hash { + return common.HexToHash("0x05dd57854af2c291a94ea52e7c43d80bc3be7fa73022f98b735dea86642fa5e0") +} + +func (CCIPConfigOwnershipTransferRequested) Topic() common.Hash { + return common.HexToHash("0xed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae1278") +} + +func (CCIPConfigOwnershipTransferred) Topic() common.Hash { + return common.HexToHash("0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0") +} + +func (_CCIPConfig *CCIPConfig) Address() common.Address { + return _CCIPConfig.address +} + +type CCIPConfigInterface interface { + GetAllChainConfigs(opts *bind.CallOpts, pageIndex *big.Int, pageSize *big.Int) ([]CCIPConfigTypesChainConfigInfo, error) + + GetCapabilityConfiguration(opts *bind.CallOpts, arg0 uint32) ([]byte, error) + + GetCapabilityRegistry(opts *bind.CallOpts) (common.Address, error) + + GetOCRConfig(opts *bind.CallOpts, donId uint32, pluginType uint8) ([]CCIPConfigTypesOCR3ConfigWithMeta, error) + + Owner(opts *bind.CallOpts) (common.Address, error) + + SupportsInterface(opts *bind.CallOpts, interfaceId [4]byte) (bool, error) + + TypeAndVersion(opts *bind.CallOpts) (string, error) + + AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) + + ApplyChainConfigUpdates(opts *bind.TransactOpts, chainSelectorRemoves []uint64, chainConfigAdds []CCIPConfigTypesChainConfigInfo) (*types.Transaction, error) + + BeforeCapabilityConfigSet(opts *bind.TransactOpts, arg0 [][32]byte, config []byte, arg2 uint64, donId uint32) (*types.Transaction, error) + + TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) + + FilterCapabilityConfigurationSet(opts *bind.FilterOpts) (*CCIPConfigCapabilityConfigurationSetIterator, error) + + WatchCapabilityConfigurationSet(opts *bind.WatchOpts, sink chan<- *CCIPConfigCapabilityConfigurationSet) (event.Subscription, error) + + ParseCapabilityConfigurationSet(log types.Log) (*CCIPConfigCapabilityConfigurationSet, error) + + FilterChainConfigRemoved(opts *bind.FilterOpts) (*CCIPConfigChainConfigRemovedIterator, error) + + WatchChainConfigRemoved(opts *bind.WatchOpts, sink chan<- *CCIPConfigChainConfigRemoved) (event.Subscription, error) + + ParseChainConfigRemoved(log types.Log) (*CCIPConfigChainConfigRemoved, error) + + FilterChainConfigSet(opts *bind.FilterOpts) (*CCIPConfigChainConfigSetIterator, error) + + WatchChainConfigSet(opts *bind.WatchOpts, sink chan<- *CCIPConfigChainConfigSet) (event.Subscription, error) + + ParseChainConfigSet(log types.Log) (*CCIPConfigChainConfigSet, error) + + FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*CCIPConfigOwnershipTransferRequestedIterator, error) + + WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *CCIPConfigOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferRequested(log types.Log) (*CCIPConfigOwnershipTransferRequested, error) + + FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*CCIPConfigOwnershipTransferredIterator, error) + + WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *CCIPConfigOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferred(log types.Log) (*CCIPConfigOwnershipTransferred, error) + + ParseLog(log types.Log) (generated.AbigenLog, error) + + Address() common.Address +} diff --git a/core/gethwrappers/ccip/generated/ccip_reader_tester/ccip_reader_tester.go b/core/gethwrappers/ccip/generated/ccip_reader_tester/ccip_reader_tester.go new file mode 100644 index 00000000000..562287eaf62 --- /dev/null +++ b/core/gethwrappers/ccip/generated/ccip_reader_tester/ccip_reader_tester.go @@ -0,0 +1,842 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package ccip_reader_tester + +import ( + "errors" + "fmt" + "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" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" +) + +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +type IRMNV2Signature struct { + R [32]byte + S [32]byte +} + +type InternalEVM2AnyRampMessage struct { + Header InternalRampMessageHeader + Sender common.Address + Data []byte + Receiver []byte + ExtraArgs []byte + FeeToken common.Address + FeeTokenAmount *big.Int + TokenAmounts []InternalRampTokenAmount +} + +type InternalGasPriceUpdate struct { + DestChainSelector uint64 + UsdPerUnitGas *big.Int +} + +type InternalMerkleRoot struct { + SourceChainSelector uint64 + MinSeqNr uint64 + MaxSeqNr uint64 + MerkleRoot [32]byte + OnRampAddress []byte +} + +type InternalPriceUpdates struct { + TokenPriceUpdates []InternalTokenPriceUpdate + GasPriceUpdates []InternalGasPriceUpdate +} + +type InternalRampMessageHeader struct { + MessageId [32]byte + SourceChainSelector uint64 + DestChainSelector uint64 + SequenceNumber uint64 + Nonce uint64 +} + +type InternalRampTokenAmount struct { + SourcePoolAddress []byte + DestTokenAddress []byte + ExtraData []byte + Amount *big.Int + DestExecData []byte +} + +type InternalTokenPriceUpdate struct { + SourceToken common.Address + UsdPerToken *big.Int +} + +type OffRampCommitReport struct { + PriceUpdates InternalPriceUpdates + MerkleRoots []InternalMerkleRoot + RmnSignatures []IRMNV2Signature +} + +type OffRampSourceChainConfig struct { + Router common.Address + IsEnabled bool + MinSeqNr uint64 + OnRamp []byte +} + +var CCIPReaderTesterMetaData = &bind.MetaData{ + ABI: "[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"},{\"components\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"messageId\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"sequenceNumber\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"nonce\",\"type\":\"uint64\"}],\"internalType\":\"structInternal.RampMessageHeader\",\"name\":\"header\",\"type\":\"tuple\"},{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"receiver\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"extraArgs\",\"type\":\"bytes\"},{\"internalType\":\"address\",\"name\":\"feeToken\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"feeTokenAmount\",\"type\":\"uint256\"},{\"components\":[{\"internalType\":\"bytes\",\"name\":\"sourcePoolAddress\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"destTokenAddress\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"destExecData\",\"type\":\"bytes\"}],\"internalType\":\"structInternal.RampTokenAmount[]\",\"name\":\"tokenAmounts\",\"type\":\"tuple[]\"}],\"indexed\":false,\"internalType\":\"structInternal.EVM2AnyRampMessage\",\"name\":\"message\",\"type\":\"tuple\"}],\"name\":\"CCIPMessageSent\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"components\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"sourceToken\",\"type\":\"address\"},{\"internalType\":\"uint224\",\"name\":\"usdPerToken\",\"type\":\"uint224\"}],\"internalType\":\"structInternal.TokenPriceUpdate[]\",\"name\":\"tokenPriceUpdates\",\"type\":\"tuple[]\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint224\",\"name\":\"usdPerUnitGas\",\"type\":\"uint224\"}],\"internalType\":\"structInternal.GasPriceUpdate[]\",\"name\":\"gasPriceUpdates\",\"type\":\"tuple[]\"}],\"internalType\":\"structInternal.PriceUpdates\",\"name\":\"priceUpdates\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"minSeqNr\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"maxSeqNr\",\"type\":\"uint64\"},{\"internalType\":\"bytes32\",\"name\":\"merkleRoot\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"onRampAddress\",\"type\":\"bytes\"}],\"internalType\":\"structInternal.MerkleRoot[]\",\"name\":\"merkleRoots\",\"type\":\"tuple[]\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"internalType\":\"structIRMNV2.Signature[]\",\"name\":\"rmnSignatures\",\"type\":\"tuple[]\"}],\"indexed\":false,\"internalType\":\"structOffRamp.CommitReport\",\"name\":\"report\",\"type\":\"tuple\"}],\"name\":\"CommitReportAccepted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"sequenceNumber\",\"type\":\"uint64\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"messageId\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"enumInternal.MessageExecutionState\",\"name\":\"state\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"returnData\",\"type\":\"bytes\"}],\"name\":\"ExecutionStateChanged\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"},{\"components\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"messageId\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"sequenceNumber\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"nonce\",\"type\":\"uint64\"}],\"internalType\":\"structInternal.RampMessageHeader\",\"name\":\"header\",\"type\":\"tuple\"},{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"receiver\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"extraArgs\",\"type\":\"bytes\"},{\"internalType\":\"address\",\"name\":\"feeToken\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"feeTokenAmount\",\"type\":\"uint256\"},{\"components\":[{\"internalType\":\"bytes\",\"name\":\"sourcePoolAddress\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"destTokenAddress\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"destExecData\",\"type\":\"bytes\"}],\"internalType\":\"structInternal.RampTokenAmount[]\",\"name\":\"tokenAmounts\",\"type\":\"tuple[]\"}],\"internalType\":\"structInternal.EVM2AnyRampMessage\",\"name\":\"message\",\"type\":\"tuple\"}],\"name\":\"emitCCIPMessageSent\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"components\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"sourceToken\",\"type\":\"address\"},{\"internalType\":\"uint224\",\"name\":\"usdPerToken\",\"type\":\"uint224\"}],\"internalType\":\"structInternal.TokenPriceUpdate[]\",\"name\":\"tokenPriceUpdates\",\"type\":\"tuple[]\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint224\",\"name\":\"usdPerUnitGas\",\"type\":\"uint224\"}],\"internalType\":\"structInternal.GasPriceUpdate[]\",\"name\":\"gasPriceUpdates\",\"type\":\"tuple[]\"}],\"internalType\":\"structInternal.PriceUpdates\",\"name\":\"priceUpdates\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"minSeqNr\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"maxSeqNr\",\"type\":\"uint64\"},{\"internalType\":\"bytes32\",\"name\":\"merkleRoot\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"onRampAddress\",\"type\":\"bytes\"}],\"internalType\":\"structInternal.MerkleRoot[]\",\"name\":\"merkleRoots\",\"type\":\"tuple[]\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"internalType\":\"structIRMNV2.Signature[]\",\"name\":\"rmnSignatures\",\"type\":\"tuple[]\"}],\"internalType\":\"structOffRamp.CommitReport\",\"name\":\"report\",\"type\":\"tuple\"}],\"name\":\"emitCommitReportAccepted\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"sequenceNumber\",\"type\":\"uint64\"},{\"internalType\":\"bytes32\",\"name\":\"messageId\",\"type\":\"bytes32\"},{\"internalType\":\"enumInternal.MessageExecutionState\",\"name\":\"state\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"returnData\",\"type\":\"bytes\"}],\"name\":\"emitExecutionStateChanged\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"}],\"name\":\"getExpectedNextSequenceNumber\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"sender\",\"type\":\"bytes\"}],\"name\":\"getInboundNonce\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"}],\"name\":\"getSourceChainConfig\",\"outputs\":[{\"components\":[{\"internalType\":\"contractIRouter\",\"name\":\"router\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint64\",\"name\":\"minSeqNr\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"onRamp\",\"type\":\"bytes\"}],\"internalType\":\"structOffRamp.SourceChainConfig\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"sequenceNumber\",\"type\":\"uint64\"}],\"name\":\"setDestChainSeqNr\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"testNonce\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"sender\",\"type\":\"bytes\"}],\"name\":\"setInboundNonce\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"components\":[{\"internalType\":\"contractIRouter\",\"name\":\"router\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint64\",\"name\":\"minSeqNr\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"onRamp\",\"type\":\"bytes\"}],\"internalType\":\"structOffRamp.SourceChainConfig\",\"name\":\"sourceChainConfig\",\"type\":\"tuple\"}],\"name\":\"setSourceChainConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", + Bin: "0x608060405234801561001057600080fd5b50611952806100206000396000f3fe608060405234801561001057600080fd5b50600436106100a35760003560e01c8063a4b0d27c11610076578063c92236251161005b578063c92236251461017c578063e83eabba1461018f578063e9d68a8e146101a257600080fd5b8063a4b0d27c14610114578063c1a5a3551461012757600080fd5b806344f38be5146100a85780634cf66e36146100bd5780639041be3d146100d057806393df286714610101575b600080fd5b6100bb6100b6366004610a52565b6101c2565b005b6100bb6100cb366004610bdd565b6101fc565b6100e36100de366004610c5c565b610253565b60405167ffffffffffffffff90911681526020015b60405180910390f35b6100bb61010f366004610cc7565b610283565b6100bb610122366004610eec565b6102fe565b6100bb61013536600461101b565b67ffffffffffffffff918216600090815260016020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000001691909216179055565b6100e361018a36600461104e565b610344565b6100bb61019d3660046110a1565b610390565b6101b56101b0366004610c5c565b61047a565b6040516100f891906111c1565b7fd7868a16facbdde7b5c020620136316b3c266fffcb4e1e41cb6a662fe14ba3e1816040516101f1919061138a565b60405180910390a150565b828467ffffffffffffffff168667ffffffffffffffff167f8c324ce1367b83031769f6a813e3bb4c117aba2185789d66b98b791405be6df285856040516102449291906114ba565b60405180910390a45050505050565b67ffffffffffffffff8082166000908152600160208190526040822054919261027d92169061150a565b92915050565b67ffffffffffffffff84166000908152600260205260409081902090518491906102b09085908590611559565b908152604051908190036020019020805467ffffffffffffffff929092167fffffffffffffffffffffffffffffffffffffffffffffffff000000000000000090921691909117905550505050565b8167ffffffffffffffff167ff6e86ef8896c7a0d629406168f396e883280680c99e649b9e2d36466fbc9f9e5826040516103389190611639565b60405180910390a25050565b67ffffffffffffffff8316600090815260026020526040808220905161036d9085908590611559565b9081526040519081900360200190205467ffffffffffffffff1690509392505050565b67ffffffffffffffff808316600090815260208181526040918290208451815492860151938601519094167501000000000000000000000000000000000000000000027fffffff0000000000000000ffffffffffffffffffffffffffffffffffffffffff93151574010000000000000000000000000000000000000000027fffffffffffffffffffffff00000000000000000000000000000000000000000090931673ffffffffffffffffffffffffffffffffffffffff90951694909417919091179190911691909117815560608201518291906001820190610473908261182b565b5050505050565b604080516080808201835260008083526020808401829052838501829052606080850181905267ffffffffffffffff87811684528383529286902086519485018752805473ffffffffffffffffffffffffffffffffffffffff8116865274010000000000000000000000000000000000000000810460ff16151593860193909352750100000000000000000000000000000000000000000090920490921694830194909452600184018054939492939184019161053690611787565b80601f016020809104026020016040519081016040528092919081815260200182805461056290611787565b80156105af5780601f10610584576101008083540402835291602001916105af565b820191906000526020600020905b81548152906001019060200180831161059257829003601f168201915b5050505050815250509050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040805190810167ffffffffffffffff81118282101715610611576106116105bf565b60405290565b60405160a0810167ffffffffffffffff81118282101715610611576106116105bf565b6040516060810167ffffffffffffffff81118282101715610611576106116105bf565b604051610100810167ffffffffffffffff81118282101715610611576106116105bf565b6040516080810167ffffffffffffffff81118282101715610611576106116105bf565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff811182821017156106eb576106eb6105bf565b604052919050565b600067ffffffffffffffff82111561070d5761070d6105bf565b5060051b60200190565b73ffffffffffffffffffffffffffffffffffffffff8116811461073957600080fd5b50565b803561074781610717565b919050565b80357bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8116811461074757600080fd5b803567ffffffffffffffff8116811461074757600080fd5b600082601f8301126107a157600080fd5b813560206107b66107b1836106f3565b6106a4565b82815260069290921b840181019181810190868411156107d557600080fd5b8286015b8481101561082257604081890312156107f25760008081fd5b6107fa6105ee565b61080382610778565b815261081085830161074c565b818601528352918301916040016107d9565b509695505050505050565b600082601f83011261083e57600080fd5b813567ffffffffffffffff811115610858576108586105bf565b61088960207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116016106a4565b81815284602083860101111561089e57600080fd5b816020850160208301376000918101602001919091529392505050565b600082601f8301126108cc57600080fd5b813560206108dc6107b1836106f3565b82815260059290921b840181019181810190868411156108fb57600080fd5b8286015b8481101561082257803567ffffffffffffffff808211156109205760008081fd5b818901915060a0807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0848d030112156109595760008081fd5b610961610617565b61096c888501610778565b8152604061097b818601610778565b89830152606061098c818701610778565b8284015260809150818601358184015250828501359250838311156109b15760008081fd5b6109bf8d8a8588010161082d565b9082015286525050509183019183016108ff565b600082601f8301126109e457600080fd5b813560206109f46107b1836106f3565b82815260069290921b84018101918181019086841115610a1357600080fd5b8286015b848110156108225760408189031215610a305760008081fd5b610a386105ee565b813581528482013585820152835291830191604001610a17565b60006020808385031215610a6557600080fd5b823567ffffffffffffffff80821115610a7d57600080fd5b9084019060608287031215610a9157600080fd5b610a9961063a565b823582811115610aa857600080fd5b83016040818903811315610abb57600080fd5b610ac36105ee565b823585811115610ad257600080fd5b8301601f81018b13610ae357600080fd5b8035610af16107b1826106f3565b81815260069190911b8201890190898101908d831115610b1057600080fd5b928a01925b82841015610b605785848f031215610b2d5760008081fd5b610b356105ee565b8435610b4081610717565b8152610b4d858d0161074c565b818d0152825292850192908a0190610b15565b845250505082870135915084821115610b7857600080fd5b610b848a838501610790565b81880152835250508284013582811115610b9d57600080fd5b610ba9888286016108bb565b85830152506040830135935081841115610bc257600080fd5b610bce878585016109d3565b60408201529695505050505050565b600080600080600060a08688031215610bf557600080fd5b610bfe86610778565b9450610c0c60208701610778565b935060408601359250606086013560048110610c2757600080fd5b9150608086013567ffffffffffffffff811115610c4357600080fd5b610c4f8882890161082d565b9150509295509295909350565b600060208284031215610c6e57600080fd5b610c7782610778565b9392505050565b60008083601f840112610c9057600080fd5b50813567ffffffffffffffff811115610ca857600080fd5b602083019150836020828501011115610cc057600080fd5b9250929050565b60008060008060608587031215610cdd57600080fd5b610ce685610778565b9350610cf460208601610778565b9250604085013567ffffffffffffffff811115610d1057600080fd5b610d1c87828801610c7e565b95989497509550505050565b600060a08284031215610d3a57600080fd5b610d42610617565b905081358152610d5460208301610778565b6020820152610d6560408301610778565b6040820152610d7660608301610778565b6060820152610d8760808301610778565b608082015292915050565b600082601f830112610da357600080fd5b81356020610db36107b1836106f3565b82815260059290921b84018101918181019086841115610dd257600080fd5b8286015b8481101561082257803567ffffffffffffffff80821115610df75760008081fd5b818901915060a0807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0848d03011215610e305760008081fd5b610e38610617565b8784013583811115610e4a5760008081fd5b610e588d8a8388010161082d565b82525060408085013584811115610e6f5760008081fd5b610e7d8e8b8389010161082d565b8a8401525060608086013585811115610e965760008081fd5b610ea48f8c838a010161082d565b83850152506080915081860135818401525082850135925083831115610eca5760008081fd5b610ed88d8a8588010161082d565b908201528652505050918301918301610dd6565b60008060408385031215610eff57600080fd5b610f0883610778565b9150602083013567ffffffffffffffff80821115610f2557600080fd5b908401906101808287031215610f3a57600080fd5b610f4261065d565b610f4c8784610d28565b8152610f5a60a0840161073c565b602082015260c083013582811115610f7157600080fd5b610f7d8882860161082d565b60408301525060e083013582811115610f9557600080fd5b610fa18882860161082d565b60608301525061010083013582811115610fba57600080fd5b610fc68882860161082d565b608083015250610fd9610120840161073c565b60a082015261014083013560c082015261016083013582811115610ffc57600080fd5b61100888828601610d92565b60e0830152508093505050509250929050565b6000806040838503121561102e57600080fd5b61103783610778565b915061104560208401610778565b90509250929050565b60008060006040848603121561106357600080fd5b61106c84610778565b9250602084013567ffffffffffffffff81111561108857600080fd5b61109486828701610c7e565b9497909650939450505050565b600080604083850312156110b457600080fd5b6110bd83610778565b9150602083013567ffffffffffffffff808211156110da57600080fd5b90840190608082870312156110ee57600080fd5b6110f6610681565b823561110181610717565b81526020830135801515811461111657600080fd5b602082015261112760408401610778565b604082015260608301358281111561113e57600080fd5b61114a8882860161082d565b6060830152508093505050509250929050565b6000815180845260005b8181101561118357602081850181015186830182015201611167565b5060006020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b6020815273ffffffffffffffffffffffffffffffffffffffff825116602082015260208201511515604082015267ffffffffffffffff60408301511660608201526000606083015160808084015261121c60a084018261115d565b949350505050565b60008151808452602080850194506020840160005b83811015611288578151805167ffffffffffffffff1688528301517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff168388015260409096019590820190600101611239565b509495945050505050565b600082825180855260208086019550808260051b84010181860160005b84811015611341578583037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe00189528151805167ffffffffffffffff908116855285820151811686860152604080830151909116908501526060808201519085015260809081015160a09185018290529061132d8186018361115d565b9a86019a94505050908301906001016112b0565b5090979650505050505050565b60008151808452602080850194506020840160005b83811015611288578151805188528301518388015260409096019590820190600101611363565b602080825282516060838301528051604060808501819052815160c086018190526000949392840191859160e08801905b80841015611418578451805173ffffffffffffffffffffffffffffffffffffffff1683528701517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff16878301529386019360019390930192908201906113bb565b50938501518785037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff800160a0890152936114528186611224565b9450505050508185015191507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0808583030160408601526114938284611293565b92506040860151915080858403016060860152506114b1828261134e565b95945050505050565b6000600484106114f3577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b8382526040602083015261121c604083018461115d565b67ffffffffffffffff818116838216019080821115611552577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b5092915050565b8183823760009101908152919050565b600082825180855260208086019550808260051b84010181860160005b84811015611341577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0868403018952815160a081518186526115ca8287018261115d565b91505085820151858203878701526115e2828261115d565b915050604080830151868303828801526115fc838261115d565b92505050606080830151818701525060808083015192508582038187015250611625818361115d565b9a86019a9450505090830190600101611586565b6020815261168a60208201835180518252602081015167ffffffffffffffff808216602085015280604084015116604085015280606084015116606085015280608084015116608085015250505050565b600060208301516116b360c084018273ffffffffffffffffffffffffffffffffffffffff169052565b5060408301516101808060e08501526116d06101a085018361115d565b915060608501517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0808685030161010087015261170d848361115d565b935060808701519150808685030161012087015261172b848361115d565b935060a0870151915061175761014087018373ffffffffffffffffffffffffffffffffffffffff169052565b60c087015161016087015260e087015191508086850301838701525061177d8382611569565b9695505050505050565b600181811c9082168061179b57607f821691505b6020821081036117d4577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b601f821115611826576000816000526020600020601f850160051c810160208610156118035750805b601f850160051c820191505b818110156118225782815560010161180f565b5050505b505050565b815167ffffffffffffffff811115611845576118456105bf565b611859816118538454611787565b846117da565b602080601f8311600181146118ac57600084156118765750858301515b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600386901b1c1916600185901b178555611822565b6000858152602081207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08616915b828110156118f9578886015182559484019460019091019084016118da565b508582101561193557878501517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600388901b60f8161c191681555b5050505050600190811b0190555056fea164736f6c6343000818000a", +} + +var CCIPReaderTesterABI = CCIPReaderTesterMetaData.ABI + +var CCIPReaderTesterBin = CCIPReaderTesterMetaData.Bin + +func DeployCCIPReaderTester(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *CCIPReaderTester, error) { + parsed, err := CCIPReaderTesterMetaData.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(CCIPReaderTesterBin), backend) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &CCIPReaderTester{address: address, abi: *parsed, CCIPReaderTesterCaller: CCIPReaderTesterCaller{contract: contract}, CCIPReaderTesterTransactor: CCIPReaderTesterTransactor{contract: contract}, CCIPReaderTesterFilterer: CCIPReaderTesterFilterer{contract: contract}}, nil +} + +type CCIPReaderTester struct { + address common.Address + abi abi.ABI + CCIPReaderTesterCaller + CCIPReaderTesterTransactor + CCIPReaderTesterFilterer +} + +type CCIPReaderTesterCaller struct { + contract *bind.BoundContract +} + +type CCIPReaderTesterTransactor struct { + contract *bind.BoundContract +} + +type CCIPReaderTesterFilterer struct { + contract *bind.BoundContract +} + +type CCIPReaderTesterSession struct { + Contract *CCIPReaderTester + CallOpts bind.CallOpts + TransactOpts bind.TransactOpts +} + +type CCIPReaderTesterCallerSession struct { + Contract *CCIPReaderTesterCaller + CallOpts bind.CallOpts +} + +type CCIPReaderTesterTransactorSession struct { + Contract *CCIPReaderTesterTransactor + TransactOpts bind.TransactOpts +} + +type CCIPReaderTesterRaw struct { + Contract *CCIPReaderTester +} + +type CCIPReaderTesterCallerRaw struct { + Contract *CCIPReaderTesterCaller +} + +type CCIPReaderTesterTransactorRaw struct { + Contract *CCIPReaderTesterTransactor +} + +func NewCCIPReaderTester(address common.Address, backend bind.ContractBackend) (*CCIPReaderTester, error) { + abi, err := abi.JSON(strings.NewReader(CCIPReaderTesterABI)) + if err != nil { + return nil, err + } + contract, err := bindCCIPReaderTester(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &CCIPReaderTester{address: address, abi: abi, CCIPReaderTesterCaller: CCIPReaderTesterCaller{contract: contract}, CCIPReaderTesterTransactor: CCIPReaderTesterTransactor{contract: contract}, CCIPReaderTesterFilterer: CCIPReaderTesterFilterer{contract: contract}}, nil +} + +func NewCCIPReaderTesterCaller(address common.Address, caller bind.ContractCaller) (*CCIPReaderTesterCaller, error) { + contract, err := bindCCIPReaderTester(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &CCIPReaderTesterCaller{contract: contract}, nil +} + +func NewCCIPReaderTesterTransactor(address common.Address, transactor bind.ContractTransactor) (*CCIPReaderTesterTransactor, error) { + contract, err := bindCCIPReaderTester(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &CCIPReaderTesterTransactor{contract: contract}, nil +} + +func NewCCIPReaderTesterFilterer(address common.Address, filterer bind.ContractFilterer) (*CCIPReaderTesterFilterer, error) { + contract, err := bindCCIPReaderTester(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &CCIPReaderTesterFilterer{contract: contract}, nil +} + +func bindCCIPReaderTester(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := CCIPReaderTesterMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +func (_CCIPReaderTester *CCIPReaderTesterRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _CCIPReaderTester.Contract.CCIPReaderTesterCaller.contract.Call(opts, result, method, params...) +} + +func (_CCIPReaderTester *CCIPReaderTesterRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _CCIPReaderTester.Contract.CCIPReaderTesterTransactor.contract.Transfer(opts) +} + +func (_CCIPReaderTester *CCIPReaderTesterRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _CCIPReaderTester.Contract.CCIPReaderTesterTransactor.contract.Transact(opts, method, params...) +} + +func (_CCIPReaderTester *CCIPReaderTesterCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _CCIPReaderTester.Contract.contract.Call(opts, result, method, params...) +} + +func (_CCIPReaderTester *CCIPReaderTesterTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _CCIPReaderTester.Contract.contract.Transfer(opts) +} + +func (_CCIPReaderTester *CCIPReaderTesterTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _CCIPReaderTester.Contract.contract.Transact(opts, method, params...) +} + +func (_CCIPReaderTester *CCIPReaderTesterCaller) GetExpectedNextSequenceNumber(opts *bind.CallOpts, destChainSelector uint64) (uint64, error) { + var out []interface{} + err := _CCIPReaderTester.contract.Call(opts, &out, "getExpectedNextSequenceNumber", destChainSelector) + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +func (_CCIPReaderTester *CCIPReaderTesterSession) GetExpectedNextSequenceNumber(destChainSelector uint64) (uint64, error) { + return _CCIPReaderTester.Contract.GetExpectedNextSequenceNumber(&_CCIPReaderTester.CallOpts, destChainSelector) +} + +func (_CCIPReaderTester *CCIPReaderTesterCallerSession) GetExpectedNextSequenceNumber(destChainSelector uint64) (uint64, error) { + return _CCIPReaderTester.Contract.GetExpectedNextSequenceNumber(&_CCIPReaderTester.CallOpts, destChainSelector) +} + +func (_CCIPReaderTester *CCIPReaderTesterCaller) GetInboundNonce(opts *bind.CallOpts, sourceChainSelector uint64, sender []byte) (uint64, error) { + var out []interface{} + err := _CCIPReaderTester.contract.Call(opts, &out, "getInboundNonce", sourceChainSelector, sender) + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +func (_CCIPReaderTester *CCIPReaderTesterSession) GetInboundNonce(sourceChainSelector uint64, sender []byte) (uint64, error) { + return _CCIPReaderTester.Contract.GetInboundNonce(&_CCIPReaderTester.CallOpts, sourceChainSelector, sender) +} + +func (_CCIPReaderTester *CCIPReaderTesterCallerSession) GetInboundNonce(sourceChainSelector uint64, sender []byte) (uint64, error) { + return _CCIPReaderTester.Contract.GetInboundNonce(&_CCIPReaderTester.CallOpts, sourceChainSelector, sender) +} + +func (_CCIPReaderTester *CCIPReaderTesterCaller) GetSourceChainConfig(opts *bind.CallOpts, sourceChainSelector uint64) (OffRampSourceChainConfig, error) { + var out []interface{} + err := _CCIPReaderTester.contract.Call(opts, &out, "getSourceChainConfig", sourceChainSelector) + + if err != nil { + return *new(OffRampSourceChainConfig), err + } + + out0 := *abi.ConvertType(out[0], new(OffRampSourceChainConfig)).(*OffRampSourceChainConfig) + + return out0, err + +} + +func (_CCIPReaderTester *CCIPReaderTesterSession) GetSourceChainConfig(sourceChainSelector uint64) (OffRampSourceChainConfig, error) { + return _CCIPReaderTester.Contract.GetSourceChainConfig(&_CCIPReaderTester.CallOpts, sourceChainSelector) +} + +func (_CCIPReaderTester *CCIPReaderTesterCallerSession) GetSourceChainConfig(sourceChainSelector uint64) (OffRampSourceChainConfig, error) { + return _CCIPReaderTester.Contract.GetSourceChainConfig(&_CCIPReaderTester.CallOpts, sourceChainSelector) +} + +func (_CCIPReaderTester *CCIPReaderTesterTransactor) EmitCCIPMessageSent(opts *bind.TransactOpts, destChainSelector uint64, message InternalEVM2AnyRampMessage) (*types.Transaction, error) { + return _CCIPReaderTester.contract.Transact(opts, "emitCCIPMessageSent", destChainSelector, message) +} + +func (_CCIPReaderTester *CCIPReaderTesterSession) EmitCCIPMessageSent(destChainSelector uint64, message InternalEVM2AnyRampMessage) (*types.Transaction, error) { + return _CCIPReaderTester.Contract.EmitCCIPMessageSent(&_CCIPReaderTester.TransactOpts, destChainSelector, message) +} + +func (_CCIPReaderTester *CCIPReaderTesterTransactorSession) EmitCCIPMessageSent(destChainSelector uint64, message InternalEVM2AnyRampMessage) (*types.Transaction, error) { + return _CCIPReaderTester.Contract.EmitCCIPMessageSent(&_CCIPReaderTester.TransactOpts, destChainSelector, message) +} + +func (_CCIPReaderTester *CCIPReaderTesterTransactor) EmitCommitReportAccepted(opts *bind.TransactOpts, report OffRampCommitReport) (*types.Transaction, error) { + return _CCIPReaderTester.contract.Transact(opts, "emitCommitReportAccepted", report) +} + +func (_CCIPReaderTester *CCIPReaderTesterSession) EmitCommitReportAccepted(report OffRampCommitReport) (*types.Transaction, error) { + return _CCIPReaderTester.Contract.EmitCommitReportAccepted(&_CCIPReaderTester.TransactOpts, report) +} + +func (_CCIPReaderTester *CCIPReaderTesterTransactorSession) EmitCommitReportAccepted(report OffRampCommitReport) (*types.Transaction, error) { + return _CCIPReaderTester.Contract.EmitCommitReportAccepted(&_CCIPReaderTester.TransactOpts, report) +} + +func (_CCIPReaderTester *CCIPReaderTesterTransactor) EmitExecutionStateChanged(opts *bind.TransactOpts, sourceChainSelector uint64, sequenceNumber uint64, messageId [32]byte, state uint8, returnData []byte) (*types.Transaction, error) { + return _CCIPReaderTester.contract.Transact(opts, "emitExecutionStateChanged", sourceChainSelector, sequenceNumber, messageId, state, returnData) +} + +func (_CCIPReaderTester *CCIPReaderTesterSession) EmitExecutionStateChanged(sourceChainSelector uint64, sequenceNumber uint64, messageId [32]byte, state uint8, returnData []byte) (*types.Transaction, error) { + return _CCIPReaderTester.Contract.EmitExecutionStateChanged(&_CCIPReaderTester.TransactOpts, sourceChainSelector, sequenceNumber, messageId, state, returnData) +} + +func (_CCIPReaderTester *CCIPReaderTesterTransactorSession) EmitExecutionStateChanged(sourceChainSelector uint64, sequenceNumber uint64, messageId [32]byte, state uint8, returnData []byte) (*types.Transaction, error) { + return _CCIPReaderTester.Contract.EmitExecutionStateChanged(&_CCIPReaderTester.TransactOpts, sourceChainSelector, sequenceNumber, messageId, state, returnData) +} + +func (_CCIPReaderTester *CCIPReaderTesterTransactor) SetDestChainSeqNr(opts *bind.TransactOpts, destChainSelector uint64, sequenceNumber uint64) (*types.Transaction, error) { + return _CCIPReaderTester.contract.Transact(opts, "setDestChainSeqNr", destChainSelector, sequenceNumber) +} + +func (_CCIPReaderTester *CCIPReaderTesterSession) SetDestChainSeqNr(destChainSelector uint64, sequenceNumber uint64) (*types.Transaction, error) { + return _CCIPReaderTester.Contract.SetDestChainSeqNr(&_CCIPReaderTester.TransactOpts, destChainSelector, sequenceNumber) +} + +func (_CCIPReaderTester *CCIPReaderTesterTransactorSession) SetDestChainSeqNr(destChainSelector uint64, sequenceNumber uint64) (*types.Transaction, error) { + return _CCIPReaderTester.Contract.SetDestChainSeqNr(&_CCIPReaderTester.TransactOpts, destChainSelector, sequenceNumber) +} + +func (_CCIPReaderTester *CCIPReaderTesterTransactor) SetInboundNonce(opts *bind.TransactOpts, sourceChainSelector uint64, testNonce uint64, sender []byte) (*types.Transaction, error) { + return _CCIPReaderTester.contract.Transact(opts, "setInboundNonce", sourceChainSelector, testNonce, sender) +} + +func (_CCIPReaderTester *CCIPReaderTesterSession) SetInboundNonce(sourceChainSelector uint64, testNonce uint64, sender []byte) (*types.Transaction, error) { + return _CCIPReaderTester.Contract.SetInboundNonce(&_CCIPReaderTester.TransactOpts, sourceChainSelector, testNonce, sender) +} + +func (_CCIPReaderTester *CCIPReaderTesterTransactorSession) SetInboundNonce(sourceChainSelector uint64, testNonce uint64, sender []byte) (*types.Transaction, error) { + return _CCIPReaderTester.Contract.SetInboundNonce(&_CCIPReaderTester.TransactOpts, sourceChainSelector, testNonce, sender) +} + +func (_CCIPReaderTester *CCIPReaderTesterTransactor) SetSourceChainConfig(opts *bind.TransactOpts, sourceChainSelector uint64, sourceChainConfig OffRampSourceChainConfig) (*types.Transaction, error) { + return _CCIPReaderTester.contract.Transact(opts, "setSourceChainConfig", sourceChainSelector, sourceChainConfig) +} + +func (_CCIPReaderTester *CCIPReaderTesterSession) SetSourceChainConfig(sourceChainSelector uint64, sourceChainConfig OffRampSourceChainConfig) (*types.Transaction, error) { + return _CCIPReaderTester.Contract.SetSourceChainConfig(&_CCIPReaderTester.TransactOpts, sourceChainSelector, sourceChainConfig) +} + +func (_CCIPReaderTester *CCIPReaderTesterTransactorSession) SetSourceChainConfig(sourceChainSelector uint64, sourceChainConfig OffRampSourceChainConfig) (*types.Transaction, error) { + return _CCIPReaderTester.Contract.SetSourceChainConfig(&_CCIPReaderTester.TransactOpts, sourceChainSelector, sourceChainConfig) +} + +type CCIPReaderTesterCCIPMessageSentIterator struct { + Event *CCIPReaderTesterCCIPMessageSent + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *CCIPReaderTesterCCIPMessageSentIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(CCIPReaderTesterCCIPMessageSent) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(CCIPReaderTesterCCIPMessageSent) + 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() + } +} + +func (it *CCIPReaderTesterCCIPMessageSentIterator) Error() error { + return it.fail +} + +func (it *CCIPReaderTesterCCIPMessageSentIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type CCIPReaderTesterCCIPMessageSent struct { + DestChainSelector uint64 + Message InternalEVM2AnyRampMessage + Raw types.Log +} + +func (_CCIPReaderTester *CCIPReaderTesterFilterer) FilterCCIPMessageSent(opts *bind.FilterOpts, destChainSelector []uint64) (*CCIPReaderTesterCCIPMessageSentIterator, error) { + + var destChainSelectorRule []interface{} + for _, destChainSelectorItem := range destChainSelector { + destChainSelectorRule = append(destChainSelectorRule, destChainSelectorItem) + } + + logs, sub, err := _CCIPReaderTester.contract.FilterLogs(opts, "CCIPMessageSent", destChainSelectorRule) + if err != nil { + return nil, err + } + return &CCIPReaderTesterCCIPMessageSentIterator{contract: _CCIPReaderTester.contract, event: "CCIPMessageSent", logs: logs, sub: sub}, nil +} + +func (_CCIPReaderTester *CCIPReaderTesterFilterer) WatchCCIPMessageSent(opts *bind.WatchOpts, sink chan<- *CCIPReaderTesterCCIPMessageSent, destChainSelector []uint64) (event.Subscription, error) { + + var destChainSelectorRule []interface{} + for _, destChainSelectorItem := range destChainSelector { + destChainSelectorRule = append(destChainSelectorRule, destChainSelectorItem) + } + + logs, sub, err := _CCIPReaderTester.contract.WatchLogs(opts, "CCIPMessageSent", destChainSelectorRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(CCIPReaderTesterCCIPMessageSent) + if err := _CCIPReaderTester.contract.UnpackLog(event, "CCIPMessageSent", 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 +} + +func (_CCIPReaderTester *CCIPReaderTesterFilterer) ParseCCIPMessageSent(log types.Log) (*CCIPReaderTesterCCIPMessageSent, error) { + event := new(CCIPReaderTesterCCIPMessageSent) + if err := _CCIPReaderTester.contract.UnpackLog(event, "CCIPMessageSent", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type CCIPReaderTesterCommitReportAcceptedIterator struct { + Event *CCIPReaderTesterCommitReportAccepted + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *CCIPReaderTesterCommitReportAcceptedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(CCIPReaderTesterCommitReportAccepted) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(CCIPReaderTesterCommitReportAccepted) + 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() + } +} + +func (it *CCIPReaderTesterCommitReportAcceptedIterator) Error() error { + return it.fail +} + +func (it *CCIPReaderTesterCommitReportAcceptedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type CCIPReaderTesterCommitReportAccepted struct { + Report OffRampCommitReport + Raw types.Log +} + +func (_CCIPReaderTester *CCIPReaderTesterFilterer) FilterCommitReportAccepted(opts *bind.FilterOpts) (*CCIPReaderTesterCommitReportAcceptedIterator, error) { + + logs, sub, err := _CCIPReaderTester.contract.FilterLogs(opts, "CommitReportAccepted") + if err != nil { + return nil, err + } + return &CCIPReaderTesterCommitReportAcceptedIterator{contract: _CCIPReaderTester.contract, event: "CommitReportAccepted", logs: logs, sub: sub}, nil +} + +func (_CCIPReaderTester *CCIPReaderTesterFilterer) WatchCommitReportAccepted(opts *bind.WatchOpts, sink chan<- *CCIPReaderTesterCommitReportAccepted) (event.Subscription, error) { + + logs, sub, err := _CCIPReaderTester.contract.WatchLogs(opts, "CommitReportAccepted") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(CCIPReaderTesterCommitReportAccepted) + if err := _CCIPReaderTester.contract.UnpackLog(event, "CommitReportAccepted", 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 +} + +func (_CCIPReaderTester *CCIPReaderTesterFilterer) ParseCommitReportAccepted(log types.Log) (*CCIPReaderTesterCommitReportAccepted, error) { + event := new(CCIPReaderTesterCommitReportAccepted) + if err := _CCIPReaderTester.contract.UnpackLog(event, "CommitReportAccepted", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type CCIPReaderTesterExecutionStateChangedIterator struct { + Event *CCIPReaderTesterExecutionStateChanged + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *CCIPReaderTesterExecutionStateChangedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(CCIPReaderTesterExecutionStateChanged) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(CCIPReaderTesterExecutionStateChanged) + 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() + } +} + +func (it *CCIPReaderTesterExecutionStateChangedIterator) Error() error { + return it.fail +} + +func (it *CCIPReaderTesterExecutionStateChangedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type CCIPReaderTesterExecutionStateChanged struct { + SourceChainSelector uint64 + SequenceNumber uint64 + MessageId [32]byte + State uint8 + ReturnData []byte + Raw types.Log +} + +func (_CCIPReaderTester *CCIPReaderTesterFilterer) FilterExecutionStateChanged(opts *bind.FilterOpts, sourceChainSelector []uint64, sequenceNumber []uint64, messageId [][32]byte) (*CCIPReaderTesterExecutionStateChangedIterator, error) { + + var sourceChainSelectorRule []interface{} + for _, sourceChainSelectorItem := range sourceChainSelector { + sourceChainSelectorRule = append(sourceChainSelectorRule, sourceChainSelectorItem) + } + var sequenceNumberRule []interface{} + for _, sequenceNumberItem := range sequenceNumber { + sequenceNumberRule = append(sequenceNumberRule, sequenceNumberItem) + } + var messageIdRule []interface{} + for _, messageIdItem := range messageId { + messageIdRule = append(messageIdRule, messageIdItem) + } + + logs, sub, err := _CCIPReaderTester.contract.FilterLogs(opts, "ExecutionStateChanged", sourceChainSelectorRule, sequenceNumberRule, messageIdRule) + if err != nil { + return nil, err + } + return &CCIPReaderTesterExecutionStateChangedIterator{contract: _CCIPReaderTester.contract, event: "ExecutionStateChanged", logs: logs, sub: sub}, nil +} + +func (_CCIPReaderTester *CCIPReaderTesterFilterer) WatchExecutionStateChanged(opts *bind.WatchOpts, sink chan<- *CCIPReaderTesterExecutionStateChanged, sourceChainSelector []uint64, sequenceNumber []uint64, messageId [][32]byte) (event.Subscription, error) { + + var sourceChainSelectorRule []interface{} + for _, sourceChainSelectorItem := range sourceChainSelector { + sourceChainSelectorRule = append(sourceChainSelectorRule, sourceChainSelectorItem) + } + var sequenceNumberRule []interface{} + for _, sequenceNumberItem := range sequenceNumber { + sequenceNumberRule = append(sequenceNumberRule, sequenceNumberItem) + } + var messageIdRule []interface{} + for _, messageIdItem := range messageId { + messageIdRule = append(messageIdRule, messageIdItem) + } + + logs, sub, err := _CCIPReaderTester.contract.WatchLogs(opts, "ExecutionStateChanged", sourceChainSelectorRule, sequenceNumberRule, messageIdRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(CCIPReaderTesterExecutionStateChanged) + if err := _CCIPReaderTester.contract.UnpackLog(event, "ExecutionStateChanged", 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 +} + +func (_CCIPReaderTester *CCIPReaderTesterFilterer) ParseExecutionStateChanged(log types.Log) (*CCIPReaderTesterExecutionStateChanged, error) { + event := new(CCIPReaderTesterExecutionStateChanged) + if err := _CCIPReaderTester.contract.UnpackLog(event, "ExecutionStateChanged", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +func (_CCIPReaderTester *CCIPReaderTester) ParseLog(log types.Log) (generated.AbigenLog, error) { + switch log.Topics[0] { + case _CCIPReaderTester.abi.Events["CCIPMessageSent"].ID: + return _CCIPReaderTester.ParseCCIPMessageSent(log) + case _CCIPReaderTester.abi.Events["CommitReportAccepted"].ID: + return _CCIPReaderTester.ParseCommitReportAccepted(log) + case _CCIPReaderTester.abi.Events["ExecutionStateChanged"].ID: + return _CCIPReaderTester.ParseExecutionStateChanged(log) + + default: + return nil, fmt.Errorf("abigen wrapper received unknown log topic: %v", log.Topics[0]) + } +} + +func (CCIPReaderTesterCCIPMessageSent) Topic() common.Hash { + return common.HexToHash("0xf6e86ef8896c7a0d629406168f396e883280680c99e649b9e2d36466fbc9f9e5") +} + +func (CCIPReaderTesterCommitReportAccepted) Topic() common.Hash { + return common.HexToHash("0xd7868a16facbdde7b5c020620136316b3c266fffcb4e1e41cb6a662fe14ba3e1") +} + +func (CCIPReaderTesterExecutionStateChanged) Topic() common.Hash { + return common.HexToHash("0x8c324ce1367b83031769f6a813e3bb4c117aba2185789d66b98b791405be6df2") +} + +func (_CCIPReaderTester *CCIPReaderTester) Address() common.Address { + return _CCIPReaderTester.address +} + +type CCIPReaderTesterInterface interface { + GetExpectedNextSequenceNumber(opts *bind.CallOpts, destChainSelector uint64) (uint64, error) + + GetInboundNonce(opts *bind.CallOpts, sourceChainSelector uint64, sender []byte) (uint64, error) + + GetSourceChainConfig(opts *bind.CallOpts, sourceChainSelector uint64) (OffRampSourceChainConfig, error) + + EmitCCIPMessageSent(opts *bind.TransactOpts, destChainSelector uint64, message InternalEVM2AnyRampMessage) (*types.Transaction, error) + + EmitCommitReportAccepted(opts *bind.TransactOpts, report OffRampCommitReport) (*types.Transaction, error) + + EmitExecutionStateChanged(opts *bind.TransactOpts, sourceChainSelector uint64, sequenceNumber uint64, messageId [32]byte, state uint8, returnData []byte) (*types.Transaction, error) + + SetDestChainSeqNr(opts *bind.TransactOpts, destChainSelector uint64, sequenceNumber uint64) (*types.Transaction, error) + + SetInboundNonce(opts *bind.TransactOpts, sourceChainSelector uint64, testNonce uint64, sender []byte) (*types.Transaction, error) + + SetSourceChainConfig(opts *bind.TransactOpts, sourceChainSelector uint64, sourceChainConfig OffRampSourceChainConfig) (*types.Transaction, error) + + FilterCCIPMessageSent(opts *bind.FilterOpts, destChainSelector []uint64) (*CCIPReaderTesterCCIPMessageSentIterator, error) + + WatchCCIPMessageSent(opts *bind.WatchOpts, sink chan<- *CCIPReaderTesterCCIPMessageSent, destChainSelector []uint64) (event.Subscription, error) + + ParseCCIPMessageSent(log types.Log) (*CCIPReaderTesterCCIPMessageSent, error) + + FilterCommitReportAccepted(opts *bind.FilterOpts) (*CCIPReaderTesterCommitReportAcceptedIterator, error) + + WatchCommitReportAccepted(opts *bind.WatchOpts, sink chan<- *CCIPReaderTesterCommitReportAccepted) (event.Subscription, error) + + ParseCommitReportAccepted(log types.Log) (*CCIPReaderTesterCommitReportAccepted, error) + + FilterExecutionStateChanged(opts *bind.FilterOpts, sourceChainSelector []uint64, sequenceNumber []uint64, messageId [][32]byte) (*CCIPReaderTesterExecutionStateChangedIterator, error) + + WatchExecutionStateChanged(opts *bind.WatchOpts, sink chan<- *CCIPReaderTesterExecutionStateChanged, sourceChainSelector []uint64, sequenceNumber []uint64, messageId [][32]byte) (event.Subscription, error) + + ParseExecutionStateChanged(log types.Log) (*CCIPReaderTesterExecutionStateChanged, error) + + ParseLog(log types.Log) (generated.AbigenLog, error) + + Address() common.Address +} diff --git a/core/gethwrappers/ccip/generated/commit_store/commit_store.go b/core/gethwrappers/ccip/generated/commit_store/commit_store.go new file mode 100644 index 00000000000..b0082a3f0bf --- /dev/null +++ b/core/gethwrappers/ccip/generated/commit_store/commit_store.go @@ -0,0 +1,2191 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package commit_store + +import ( + "errors" + "fmt" + "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" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" +) + +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +type CommitStoreCommitReport struct { + PriceUpdates InternalPriceUpdates + Interval CommitStoreInterval + MerkleRoot [32]byte +} + +type CommitStoreDynamicConfig struct { + PriceRegistry common.Address +} + +type CommitStoreInterval struct { + Min uint64 + Max uint64 +} + +type CommitStoreStaticConfig struct { + ChainSelector uint64 + SourceChainSelector uint64 + OnRamp common.Address + RmnProxy common.Address +} + +type InternalGasPriceUpdate struct { + DestChainSelector uint64 + UsdPerUnitGas *big.Int +} + +type InternalPriceUpdates struct { + TokenPriceUpdates []InternalTokenPriceUpdate + GasPriceUpdates []InternalGasPriceUpdate +} + +type InternalTokenPriceUpdate struct { + SourceToken common.Address + UsdPerToken *big.Int +} + +var CommitStoreMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"onRamp\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"rmnProxy\",\"type\":\"address\"}],\"internalType\":\"structCommitStore.StaticConfig\",\"name\":\"staticConfig\",\"type\":\"tuple\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"expected\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"actual\",\"type\":\"bytes32\"}],\"name\":\"ConfigDigestMismatch\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"CursedByRMN\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expected\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"actual\",\"type\":\"uint256\"}],\"name\":\"ForkedChain\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidCommitStoreConfig\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"enumOCR2Base.InvalidConfigErrorType\",\"name\":\"errorType\",\"type\":\"uint8\"}],\"name\":\"InvalidConfig\",\"type\":\"error\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"min\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"max\",\"type\":\"uint64\"}],\"internalType\":\"structCommitStore.Interval\",\"name\":\"interval\",\"type\":\"tuple\"}],\"name\":\"InvalidInterval\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidProof\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidRoot\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"LeavesCannotBeEmpty\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NonUniqueSignatures\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OracleCannotBeZeroAddress\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"PausedError\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RootAlreadyCommitted\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"SignaturesOutOfRegistration\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"StaleReport\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UnauthorizedSigner\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UnauthorizedTransmitter\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expected\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"actual\",\"type\":\"uint256\"}],\"name\":\"WrongMessageLength\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"WrongNumberOfSignatures\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"onRamp\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"rmnProxy\",\"type\":\"address\"}],\"indexed\":false,\"internalType\":\"structCommitStore.StaticConfig\",\"name\":\"staticConfig\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"priceRegistry\",\"type\":\"address\"}],\"indexed\":false,\"internalType\":\"structCommitStore.DynamicConfig\",\"name\":\"dynamicConfig\",\"type\":\"tuple\"}],\"name\":\"ConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"previousConfigBlockNumber\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"configCount\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"signers\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"transmitters\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"f\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"onchainConfig\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"offchainConfigVersion\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"offchainConfig\",\"type\":\"bytes\"}],\"name\":\"ConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint40\",\"name\":\"oldEpochAndRound\",\"type\":\"uint40\"},{\"indexed\":false,\"internalType\":\"uint40\",\"name\":\"newEpochAndRound\",\"type\":\"uint40\"}],\"name\":\"LatestPriceEpochAndRoundSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"Paused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"components\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"sourceToken\",\"type\":\"address\"},{\"internalType\":\"uint224\",\"name\":\"usdPerToken\",\"type\":\"uint224\"}],\"internalType\":\"structInternal.TokenPriceUpdate[]\",\"name\":\"tokenPriceUpdates\",\"type\":\"tuple[]\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint224\",\"name\":\"usdPerUnitGas\",\"type\":\"uint224\"}],\"internalType\":\"structInternal.GasPriceUpdate[]\",\"name\":\"gasPriceUpdates\",\"type\":\"tuple[]\"}],\"internalType\":\"structInternal.PriceUpdates\",\"name\":\"priceUpdates\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"min\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"max\",\"type\":\"uint64\"}],\"internalType\":\"structCommitStore.Interval\",\"name\":\"interval\",\"type\":\"tuple\"},{\"internalType\":\"bytes32\",\"name\":\"merkleRoot\",\"type\":\"bytes32\"}],\"indexed\":false,\"internalType\":\"structCommitStore.CommitReport\",\"name\":\"report\",\"type\":\"tuple\"}],\"name\":\"ReportAccepted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"root\",\"type\":\"bytes32\"}],\"name\":\"RootRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"oldSeqNum\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"newSeqNum\",\"type\":\"uint64\"}],\"name\":\"SequenceNumberSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"epoch\",\"type\":\"uint32\"}],\"name\":\"Transmitted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"Unpaused\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getDynamicConfig\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"priceRegistry\",\"type\":\"address\"}],\"internalType\":\"structCommitStore.DynamicConfig\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getExpectedNextSequenceNumber\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getLatestPriceEpochAndRound\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"root\",\"type\":\"bytes32\"}],\"name\":\"getMerkleRoot\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getStaticConfig\",\"outputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"onRamp\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"rmnProxy\",\"type\":\"address\"}],\"internalType\":\"structCommitStore.StaticConfig\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getTransmitters\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"root\",\"type\":\"bytes32\"}],\"name\":\"isBlessed\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isUnpausedAndNotCursed\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestConfigDetails\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"configCount\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"blockNumber\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestConfigDigestAndEpoch\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"scanLogs\",\"type\":\"bool\"},{\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"internalType\":\"uint32\",\"name\":\"epoch\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"paused\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32[]\",\"name\":\"rootToReset\",\"type\":\"bytes32[]\"}],\"name\":\"resetUnblessedRoots\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint40\",\"name\":\"latestPriceEpochAndRound\",\"type\":\"uint40\"}],\"name\":\"setLatestPriceEpochAndRound\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"minSeqNr\",\"type\":\"uint64\"}],\"name\":\"setMinSeqNr\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"signers\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"transmitters\",\"type\":\"address[]\"},{\"internalType\":\"uint8\",\"name\":\"f\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"onchainConfig\",\"type\":\"bytes\"},{\"internalType\":\"uint64\",\"name\":\"offchainConfigVersion\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"offchainConfig\",\"type\":\"bytes\"}],\"name\":\"setOCR2Config\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32[3]\",\"name\":\"reportContext\",\"type\":\"bytes32[3]\"},{\"internalType\":\"bytes\",\"name\":\"report\",\"type\":\"bytes\"},{\"internalType\":\"bytes32[]\",\"name\":\"rs\",\"type\":\"bytes32[]\"},{\"internalType\":\"bytes32[]\",\"name\":\"ss\",\"type\":\"bytes32[]\"},{\"internalType\":\"bytes32\",\"name\":\"rawVs\",\"type\":\"bytes32\"}],\"name\":\"transmit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"unpause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32[]\",\"name\":\"hashedLeaves\",\"type\":\"bytes32[]\"},{\"internalType\":\"bytes32[]\",\"name\":\"proofs\",\"type\":\"bytes32[]\"},{\"internalType\":\"uint256\",\"name\":\"proofFlagBits\",\"type\":\"uint256\"}],\"name\":\"verify\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", + Bin: "0x61014060405260098054600165ff000000000160401b03191660011790553480156200002a57600080fd5b506040516200378e3803806200378e8339810160408190526200004d9162000272565b600033808281620000a55760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000d857620000d88162000192565b50505015156080524660a05260408101516001600160a01b0316158062000107575080516001600160401b0316155b806200011e575060208101516001600160401b0316155b8062000135575060608101516001600160a01b0316155b156200015457604051631fc5f15f60e11b815260040160405180910390fd5b80516001600160401b0390811660c05260208201511660e05260408101516001600160a01b0390811661010052606090910151166101205262000306565b336001600160a01b03821603620001ec5760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c6600000000000000000060448201526064016200009c565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b80516001600160401b03811681146200025557600080fd5b919050565b80516001600160a01b03811681146200025557600080fd5b6000608082840312156200028557600080fd5b604051608081016001600160401b0381118282101715620002b657634e487b7160e01b600052604160045260246000fd5b604052620002c4836200023d565b8152620002d4602084016200023d565b6020820152620002e7604084016200025a565b6040820152620002fa606084016200025a565b60608201529392505050565b60805160a05160c05160e05161010051610120516133f26200039c60003960008181610262015281816116c80152818161187c01528181611acb0152611fa50152600081816102260152611aa40152600081816101f60152818161168201528181611a7d0152611f620152600081816101c60152611a4e0152600081816110c801526111140152600061118f01526133f26000f3fe608060405234801561001057600080fd5b506004361061018d5760003560e01c806379ba5097116100e3578063afcb95d71161008c578063f2fde38b11610066578063f2fde38b146104e3578063f47a8690146104f6578063ff888fb11461050957600080fd5b8063afcb95d7146104a8578063b1dc65a4146104c8578063e89d039f146104db57600080fd5b80638da5cb5b116100bd5780638da5cb5b1461044d578063a7206cd614610475578063ad7a22f81461049557600080fd5b806379ba50971461040d57806381ff7048146104155780638456cb591461044557600080fd5b806332048875116101455780635c975abb1161011f5780635c975abb14610391578063666cab8d146103b95780637437ff9f146103ce57600080fd5b806332048875146103565780633f4ba83a146103775780634120fccd1461037f57600080fd5b8063181f5a7711610176578063181f5a77146102e55780631ef381741461032e57806329b980e41461034357600080fd5b806306285c691461019257806310c374ed146102b5575b600080fd5b61029f60408051608081018252600080825260208201819052918101829052606081019190915260405180608001604052807f000000000000000000000000000000000000000000000000000000000000000067ffffffffffffffff1681526020017f000000000000000000000000000000000000000000000000000000000000000067ffffffffffffffff1681526020017f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1681526020017f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16815250905090565b6040516102ac9190612583565b60405180910390f35b60095468010000000000000000900464ffffffffff165b60405167ffffffffffffffff90911681526020016102ac565b6103216040518060400160405280601181526020017f436f6d6d697453746f726520312e352e3000000000000000000000000000000081525081565b6040516102ac9190612640565b61034161033c366004612897565b61051c565b005b610341610351366004612964565b610c00565b6103696103643660046129d7565b610c90565b6040519081526020016102ac565b610341610d86565b60095467ffffffffffffffff166102cc565b6009546d0100000000000000000000000000900460ff165b60405190151581526020016102ac565b6103c1610dec565b6040516102ac9190612a9d565b604080516020808201835260009091528151808201835260085473ffffffffffffffffffffffffffffffffffffffff16908190529151918252016102ac565b610341610e5b565b6004546002546040805163ffffffff808516825264010000000090940490931660208401528201526060016102ac565b610341610f58565b60005460405173ffffffffffffffffffffffffffffffffffffffff90911681526020016102ac565b610369610483366004612ab0565b6000908152600a602052604090205490565b6103416104a3366004612ac9565b610fc8565b6040805160018152600060208201819052918101919091526060016102ac565b6103416104d6366004612ae4565b611043565b6103a961165a565b6103416104f1366004612bc9565b61176e565b610341610504366004612be6565b611782565b6103a9610517366004612ab0565b611819565b855185518560ff16601f83111561056b5760016040517f367f56a20000000000000000000000000000000000000000000000000000000081526004016105629190612c57565b60405180910390fd5b806000036105a85760006040517f367f56a20000000000000000000000000000000000000000000000000000000081526004016105629190612c57565b8183146105e45760046040517f367f56a20000000000000000000000000000000000000000000000000000000081526004016105629190612c57565b6105ef816003612cc7565b831161062a5760026040517f367f56a20000000000000000000000000000000000000000000000000000000081526004016105629190612c57565b6106326118ed565b61063b86611970565b60065460005b8181101561072f57600560006006838154811061066057610660612cde565b600091825260208083209091015473ffffffffffffffffffffffffffffffffffffffff168352820192909252604001812080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000169055600780546005929190849081106106d0576106d0612cde565b600091825260208083209091015473ffffffffffffffffffffffffffffffffffffffff168352820192909252604001902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000169055600101610641565b50895160005b81811015610aa85760008c828151811061075157610751612cde565b602002602001015190506000600281111561076e5761076e612c28565b73ffffffffffffffffffffffffffffffffffffffff8216600090815260056020526040902054610100900460ff1660028111156107ad576107ad612c28565b146107e75760036040517f367f56a20000000000000000000000000000000000000000000000000000000081526004016105629190612c57565b73ffffffffffffffffffffffffffffffffffffffff8116610834576040517fd6c62c9b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040805180820190915260ff83168152602081016001905273ffffffffffffffffffffffffffffffffffffffff821660009081526005602090815260409091208251815460ff9091167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0082168117835592840151919283917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000016176101008360028111156108e4576108e4612c28565b021790555090505060008c838151811061090057610900612cde565b602002602001015190506000600281111561091d5761091d612c28565b73ffffffffffffffffffffffffffffffffffffffff8216600090815260056020526040902054610100900460ff16600281111561095c5761095c612c28565b146109965760036040517f367f56a20000000000000000000000000000000000000000000000000000000081526004016105629190612c57565b73ffffffffffffffffffffffffffffffffffffffff81166109e3576040517fd6c62c9b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040805180820190915260ff84168152602081016002905273ffffffffffffffffffffffffffffffffffffffff821660009081526005602090815260409091208251815460ff9091167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0082168117835592840151919283917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00001617610100836002811115610a9357610a93612c28565b02179055509050505050806001019050610735565b508a51610abc9060069060208e01906124c5565b508951610ad09060079060208d01906124c5565b506003805460ff838116610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000909216908c161717905560048054610b56914691309190600090610b289063ffffffff16612d0d565b91906101000a81548163ffffffff021916908363ffffffff160217905563ffffffff168e8e8e8e8e8e611b20565b600260000181905550600060048054906101000a900463ffffffff169050436004806101000a81548163ffffffff021916908363ffffffff1602179055507f1591690b8638f5fb2dbec82ac741805ac5da8b45dc5263f4875b0496fdce4e0581600260000154600460009054906101000a900463ffffffff168f8f8f8f8f8f604051610bea99989796959493929190612d30565b60405180910390a1505050505050505050505050565b610c086118ed565b6009805464ffffffffff838116680100000000000000008181027fffffffffffffffffffffffffffffffffffffff0000000000ffffffffffffffff85161790945560408051949093049091168084526020840191909152917ff0d557bfce33e354b41885eb9264448726cfe51f486ffa69809d2bf56545644491015b60405180910390a15050565b6009546000906d0100000000000000000000000000900460ff1615610ce1576040517feced32bc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000610d5287878080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808b0282810182019093528a82529093508a925089918291850190849080828437600092019190915250889250611bcb915050565b9050610d5d81611819565b610d6b576000915050610d7d565b6000908152600a602052604090205490505b95945050505050565b610d8e6118ed565b600980547fffffffffffffffffffffffffffffffffffff00ffffffffffffffffffffffffff1690556040513381527f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa906020015b60405180910390a1565b60606007805480602002602001604051908101604052809291908181526020018280548015610e5157602002820191906000526020600020905b815473ffffffffffffffffffffffffffffffffffffffff168152600190910190602001808311610e26575b5050505050905090565b60015473ffffffffffffffffffffffffffffffffffffffff163314610edc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e6572000000000000000000006044820152606401610562565b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b610f606118ed565b600980547fffffffffffffffffffffffffffffffffffff00ffffffffffffffffffffffffff166d01000000000000000000000000001790556040513381527f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25890602001610de2565b610fd06118ed565b6009805467ffffffffffffffff8381167fffffffffffffffffffffffffffffffffffffffffffffffff000000000000000083168117909355604080519190921680825260208201939093527fea59e8027e41fda1525220008cf2416797405065eb21b0ebd417bfc6d361b8de9101610c84565b611052878760208b0135611eec565b6040805160608101825260025480825260035460ff8082166020850152610100909104169282019290925289359182146110c55780516040517f93df584c000000000000000000000000000000000000000000000000000000008152600481019190915260248101839052604401610562565b467f000000000000000000000000000000000000000000000000000000000000000014611146576040517f0f01ce850000000000000000000000000000000000000000000000000000000081527f00000000000000000000000000000000000000000000000000000000000000006004820152466024820152604401610562565b6040805183815260208c81013560081c63ffffffff16908201527fb04e63db38c49950639fa09d29872f21f5d49d614f3a969d8adf3d4b52e41a62910160405180910390a160007f0000000000000000000000000000000000000000000000000000000000000000156111e8576002826020015183604001516111c99190612dc6565b6111d39190612ddf565b6111de906001612dc6565b60ff1690506111fe565b60208201516111f8906001612dc6565b60ff1690505b868114611237576040517f71253a2500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b868514611270576040517fa75d88af00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b3360009081526005602090815260408083208151808301909252805460ff808216845292939192918401916101009091041660028111156112b3576112b3612c28565b60028111156112c4576112c4612c28565b90525090506002816020015160028111156112e1576112e1612c28565b14801561132857506007816000015160ff168154811061130357611303612cde565b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff1633145b61135e576040517fda0f08e800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50600061136c866020612cc7565b611377896020612cc7565b6113838c610144612e28565b61138d9190612e28565b6113979190612e28565b90503681146113db576040517f8e1192e100000000000000000000000000000000000000000000000000000000815260048101829052366024820152604401610562565b5060008a8a6040516113ee929190612e3b565b604051908190038120611405918e90602001612e4b565b60405160208183030381529060405280519060200120905061142561254f565b8860005b818110156116495760006001858a846020811061144857611448612cde565b61145591901a601b612dc6565b8f8f8681811061146757611467612cde565b905060200201358e8e8781811061148057611480612cde565b90506020020135604051600081526020016040526040516114bd949392919093845260ff9290921660208401526040830152606082015260800190565b6020604051602081039080840390855afa1580156114df573d6000803e3d6000fd5b5050604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081015173ffffffffffffffffffffffffffffffffffffffff8116600090815260056020908152848220848601909552845460ff808216865293975091955092939284019161010090910416600281111561156257611562612c28565b600281111561157357611573612c28565b905250905060018160200151600281111561159057611590612c28565b146115c7576040517fca31867a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8051859060ff16601f81106115de576115de612cde565b60200201511561161a576040517ff67bc7c400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600185826000015160ff16601f811061163557611635612cde565b911515602090920201525050600101611429565b505050505050505050505050505050565b6040517f2cbc26bb0000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000060801b77ffffffffffffffff000000000000000000000000000000001660048201526000907f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1690632cbc26bb90602401602060405180830381865afa158015611724573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117489190612e5f565b15801561176957506009546d0100000000000000000000000000900460ff16155b905090565b6117766118ed565b61177f81612355565b50565b61178a6118ed565b60005b818110156118145760008383838181106117a9576117a9612cde565b9050602002013590506117bb81611819565b61180b576000818152600a602052604080822091909155517f202f1139a3e334b6056064c0e9b19fd07e44a88d8f6e5ded571b24cf8c371f12906118029083815260200190565b60405180910390a15b5060010161178d565b505050565b6040805180820182523081526020810183815291517f4d616771000000000000000000000000000000000000000000000000000000008152905173ffffffffffffffffffffffffffffffffffffffff9081166004830152915160248201526000917f00000000000000000000000000000000000000000000000000000000000000001690634d61677190604401602060405180830381865afa1580156118c3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118e79190612e5f565b92915050565b60005473ffffffffffffffffffffffffffffffffffffffff16331461196e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e6572000000000000000000006044820152606401610562565b565b6000818060200190518101906119869190612e81565b805190915073ffffffffffffffffffffffffffffffffffffffff166119d7576040517f3f8be2be00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8051600880547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff928316179055600980547fffffffffffffffffffffffffffffffffffffff0000000000ffffffffffffffff169055604080516080810182527f000000000000000000000000000000000000000000000000000000000000000067ffffffffffffffff90811682527f00000000000000000000000000000000000000000000000000000000000000001660208201527f00000000000000000000000000000000000000000000000000000000000000008316818301527f00000000000000000000000000000000000000000000000000000000000000009092166060830152517fc9d7123efd4203e60b0f0a4b1dbc4800fc97ce63679f71c3a27279b24a7ddec391610c84918490612ecd565b6000808a8a8a8a8a8a8a8a8a604051602001611b4499989796959493929190612f4a565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815291905280516020909101207dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167e01000000000000000000000000000000000000000000000000000000000000179150509998505050505050505050565b8251825160009190818303611c0c576040517f11a6b26400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6101018211801590611c2057506101018111155b611c56576040517f09bde33900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82820101610100811115611cb7576040517f09bde33900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80600003611ce45786600081518110611cd257611cd2612cde565b60200260200101519350505050611ee5565b60008167ffffffffffffffff811115611cff57611cff612653565b604051908082528060200260200182016040528015611d28578160200160208202803683370190505b50905060008080805b85811015611e6b5760006001821b8b811603611d8c5788851015611d75578c5160018601958e918110611d6657611d66612cde565b60200260200101519050611dae565b8551600185019487918110611d6657611d66612cde565b8b5160018401938d918110611da357611da3612cde565b602002602001015190505b600089861015611dde578d5160018701968f918110611dcf57611dcf612cde565b60200260200101519050611e00565b8651600186019588918110611df557611df5612cde565b602002602001015190505b82851115611e3a576040517f09bde33900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611e44828261244a565b878481518110611e5657611e56612cde565b60209081029190910101525050600101611d31565b506001850382148015611e7d57508683145b8015611e8857508581145b611ebe576040517f09bde33900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b836001860381518110611ed357611ed3612cde565b60200260200101519750505050505050505b9392505050565b6009546d0100000000000000000000000000900460ff1615611f3a576040517feced32bc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f2cbc26bb0000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000060801b77ffffffffffffffff000000000000000000000000000000001660048201527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1690632cbc26bb90602401602060405180830381865afa158015612001573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120259190612e5f565b1561205c576040517f53ad11d800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600061206a838501856130d6565b8051515190915015158061208357508051602001515115155b156121bb5760095464ffffffffff8084166801000000000000000090920416101561218057600980547fffffffffffffffffffffffffffffffffffffff0000000000ffffffffffffffff166801000000000000000064ffffffffff85160217905560085481516040517f3937306f00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff90921691633937306f9161213a91600401613329565b600060405180830381600087803b15801561215457600080fd5b505af1158015612168573d6000803e3d6000fd5b50505050604081015161217b5750505050565b6121bb565b60408101516121bb576040517ff803a2ca00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60208101515160095467ffffffffffffffff90811691161415806121f6575060208082015190810151905167ffffffffffffffff9182169116115b156122335780602001516040517fbb1ae18d000000000000000000000000000000000000000000000000000000008152600401610562919061333c565b604081015161226e576040517f504570e300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040808201516000908152600a6020522054156122b7576040517fa0bce24f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60208082015101516122ca906001613361565b600980547fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000001667ffffffffffffffff929092169190911790556040818101516000908152600a602052819020429055517f291698c01aa71f912280535d88a00d2c59fb63530a3f5d0098560468acb9ebf590612347908390613389565b60405180910390a150505050565b3373ffffffffffffffffffffffffffffffffffffffff8216036123d4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c660000000000000000006044820152606401610562565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b600081831061248c5760408051600160208083019190915281830185905260608083018790528351808403909101815260809092019092528051910120611ee5565b60408051600160208083019190915281830186905260608083018690528351808403909101815260809092019092528051910120611ee5565b82805482825590600052602060002090810192821561253f579160200282015b8281111561253f57825182547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff9091161782556020909201916001909101906124e5565b5061254b92915061256e565b5090565b604051806103e00160405280601f906020820280368337509192915050565b5b8082111561254b576000815560010161256f565b608081016118e7828467ffffffffffffffff80825116835280602083015116602084015250604081015173ffffffffffffffffffffffffffffffffffffffff808216604085015280606084015116606085015250505050565b6000815180845260005b81811015612602576020818501810151868301820152016125e6565b5060006020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b602081526000611ee560208301846125dc565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040805190810167ffffffffffffffff811182821017156126a5576126a5612653565b60405290565b6040516060810167ffffffffffffffff811182821017156126a5576126a5612653565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff8111828210171561271557612715612653565b604052919050565b600067ffffffffffffffff82111561273757612737612653565b5060051b60200190565b73ffffffffffffffffffffffffffffffffffffffff8116811461177f57600080fd5b600082601f83011261277457600080fd5b813560206127896127848361271d565b6126ce565b8083825260208201915060208460051b8701019350868411156127ab57600080fd5b602086015b848110156127d05780356127c381612741565b83529183019183016127b0565b509695505050505050565b803560ff811681146127ec57600080fd5b919050565b600082601f83011261280257600080fd5b813567ffffffffffffffff81111561281c5761281c612653565b61284d60207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116016126ce565b81815284602083860101111561286257600080fd5b816020850160208301376000918101602001919091529392505050565b803567ffffffffffffffff811681146127ec57600080fd5b60008060008060008060c087890312156128b057600080fd5b863567ffffffffffffffff808211156128c857600080fd5b6128d48a838b01612763565b975060208901359150808211156128ea57600080fd5b6128f68a838b01612763565b965061290460408a016127db565b9550606089013591508082111561291a57600080fd5b6129268a838b016127f1565b945061293460808a0161287f565b935060a089013591508082111561294a57600080fd5b5061295789828a016127f1565b9150509295509295509295565b60006020828403121561297657600080fd5b813564ffffffffff81168114611ee557600080fd5b60008083601f84011261299d57600080fd5b50813567ffffffffffffffff8111156129b557600080fd5b6020830191508360208260051b85010111156129d057600080fd5b9250929050565b6000806000806000606086880312156129ef57600080fd5b853567ffffffffffffffff80821115612a0757600080fd5b612a1389838a0161298b565b90975095506020880135915080821115612a2c57600080fd5b50612a398882890161298b565b96999598509660400135949350505050565b60008151808452602080850194506020840160005b83811015612a9257815173ffffffffffffffffffffffffffffffffffffffff1687529582019590820190600101612a60565b509495945050505050565b602081526000611ee56020830184612a4b565b600060208284031215612ac257600080fd5b5035919050565b600060208284031215612adb57600080fd5b611ee58261287f565b60008060008060008060008060e0898b031215612b0057600080fd5b606089018a811115612b1157600080fd5b8998503567ffffffffffffffff80821115612b2b57600080fd5b818b0191508b601f830112612b3f57600080fd5b813581811115612b4e57600080fd5b8c6020828501011115612b6057600080fd5b6020830199508098505060808b0135915080821115612b7e57600080fd5b612b8a8c838d0161298b565b909750955060a08b0135915080821115612ba357600080fd5b50612bb08b828c0161298b565b999c989b50969995989497949560c00135949350505050565b600060208284031215612bdb57600080fd5b8135611ee581612741565b60008060208385031215612bf957600080fd5b823567ffffffffffffffff811115612c1057600080fd5b612c1c8582860161298b565b90969095509350505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b6020810160058310612c92577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b91905290565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b80820281158282048414176118e7576118e7612c98565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600063ffffffff808316818103612d2657612d26612c98565b6001019392505050565b600061012063ffffffff808d1684528b6020850152808b16604085015250806060840152612d608184018a612a4b565b90508281036080840152612d748189612a4b565b905060ff871660a084015282810360c0840152612d9181876125dc565b905067ffffffffffffffff851660e0840152828103610100840152612db681856125dc565b9c9b505050505050505050505050565b60ff81811683821601908111156118e7576118e7612c98565b600060ff831680612e19577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b8060ff84160491505092915050565b808201808211156118e7576118e7612c98565b8183823760009101908152919050565b828152606082602083013760800192915050565b600060208284031215612e7157600080fd5b81518015158114611ee557600080fd5b600060208284031215612e9357600080fd5b6040516020810181811067ffffffffffffffff82111715612eb657612eb6612653565b6040528251612ec481612741565b81529392505050565b60a08101612f26828567ffffffffffffffff80825116835280602083015116602084015250604081015173ffffffffffffffffffffffffffffffffffffffff808216604085015280606084015116606085015250505050565b73ffffffffffffffffffffffffffffffffffffffff83511660808301529392505050565b60006101208b835273ffffffffffffffffffffffffffffffffffffffff8b16602084015267ffffffffffffffff808b166040850152816060850152612f918285018b612a4b565b91508382036080850152612fa5828a612a4b565b915060ff881660a085015283820360c0850152612fc282886125dc565b90861660e08501528381036101008501529050612db681856125dc565b80357bffffffffffffffffffffffffffffffffffffffffffffffffffffffff811681146127ec57600080fd5b600082601f83011261301c57600080fd5b8135602061302c6127848361271d565b82815260069290921b8401810191818101908684111561304b57600080fd5b8286015b848110156127d057604081890312156130685760008081fd5b613070612682565b6130798261287f565b8152613086858301612fdf565b8186015283529183019160400161304f565b6000604082840312156130aa57600080fd5b6130b2612682565b90506130bd8261287f565b81526130cb6020830161287f565b602082015292915050565b600060208083850312156130e957600080fd5b823567ffffffffffffffff8082111561310157600080fd5b908401906080828703121561311557600080fd5b61311d6126ab565b82358281111561312c57600080fd5b8301604081890381131561313f57600080fd5b613147612682565b82358581111561315657600080fd5b8301601f81018b1361316757600080fd5b80356131756127848261271d565b81815260069190911b8201890190898101908d83111561319457600080fd5b928a01925b828410156131e45785848f0312156131b15760008081fd5b6131b9612682565b84356131c481612741565b81526131d1858d01612fdf565b818d0152825292850192908a0190613199565b8452505050828701359150848211156131fc57600080fd5b6132088a83850161300b565b8188015283525061321d905087848601613098565b93810193909352506060013560408201529392505050565b805160408084528151848201819052600092602091908201906060870190855b818110156132ae578351805173ffffffffffffffffffffffffffffffffffffffff1684528501517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff16858401529284019291850191600101613255565b50508583015187820388850152805180835290840192506000918401905b8083101561331d578351805167ffffffffffffffff1683528501517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff16858301529284019260019290920191908501906132cc565b50979650505050505050565b602081526000611ee56020830184613235565b604081016118e78284805167ffffffffffffffff908116835260209182015116910152565b67ffffffffffffffff81811683821601908082111561338257613382612c98565b5092915050565b6020815260008251608060208401526133a560a0840182613235565b905060208401516133d06040850182805167ffffffffffffffff908116835260209182015116910152565b5060408401516080840152809150509291505056fea164736f6c6343000818000a", +} + +var CommitStoreABI = CommitStoreMetaData.ABI + +var CommitStoreBin = CommitStoreMetaData.Bin + +func DeployCommitStore(auth *bind.TransactOpts, backend bind.ContractBackend, staticConfig CommitStoreStaticConfig) (common.Address, *types.Transaction, *CommitStore, error) { + parsed, err := CommitStoreMetaData.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(CommitStoreBin), backend, staticConfig) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &CommitStore{address: address, abi: *parsed, CommitStoreCaller: CommitStoreCaller{contract: contract}, CommitStoreTransactor: CommitStoreTransactor{contract: contract}, CommitStoreFilterer: CommitStoreFilterer{contract: contract}}, nil +} + +type CommitStore struct { + address common.Address + abi abi.ABI + CommitStoreCaller + CommitStoreTransactor + CommitStoreFilterer +} + +type CommitStoreCaller struct { + contract *bind.BoundContract +} + +type CommitStoreTransactor struct { + contract *bind.BoundContract +} + +type CommitStoreFilterer struct { + contract *bind.BoundContract +} + +type CommitStoreSession struct { + Contract *CommitStore + CallOpts bind.CallOpts + TransactOpts bind.TransactOpts +} + +type CommitStoreCallerSession struct { + Contract *CommitStoreCaller + CallOpts bind.CallOpts +} + +type CommitStoreTransactorSession struct { + Contract *CommitStoreTransactor + TransactOpts bind.TransactOpts +} + +type CommitStoreRaw struct { + Contract *CommitStore +} + +type CommitStoreCallerRaw struct { + Contract *CommitStoreCaller +} + +type CommitStoreTransactorRaw struct { + Contract *CommitStoreTransactor +} + +func NewCommitStore(address common.Address, backend bind.ContractBackend) (*CommitStore, error) { + abi, err := abi.JSON(strings.NewReader(CommitStoreABI)) + if err != nil { + return nil, err + } + contract, err := bindCommitStore(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &CommitStore{address: address, abi: abi, CommitStoreCaller: CommitStoreCaller{contract: contract}, CommitStoreTransactor: CommitStoreTransactor{contract: contract}, CommitStoreFilterer: CommitStoreFilterer{contract: contract}}, nil +} + +func NewCommitStoreCaller(address common.Address, caller bind.ContractCaller) (*CommitStoreCaller, error) { + contract, err := bindCommitStore(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &CommitStoreCaller{contract: contract}, nil +} + +func NewCommitStoreTransactor(address common.Address, transactor bind.ContractTransactor) (*CommitStoreTransactor, error) { + contract, err := bindCommitStore(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &CommitStoreTransactor{contract: contract}, nil +} + +func NewCommitStoreFilterer(address common.Address, filterer bind.ContractFilterer) (*CommitStoreFilterer, error) { + contract, err := bindCommitStore(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &CommitStoreFilterer{contract: contract}, nil +} + +func bindCommitStore(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := CommitStoreMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +func (_CommitStore *CommitStoreRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _CommitStore.Contract.CommitStoreCaller.contract.Call(opts, result, method, params...) +} + +func (_CommitStore *CommitStoreRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _CommitStore.Contract.CommitStoreTransactor.contract.Transfer(opts) +} + +func (_CommitStore *CommitStoreRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _CommitStore.Contract.CommitStoreTransactor.contract.Transact(opts, method, params...) +} + +func (_CommitStore *CommitStoreCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _CommitStore.Contract.contract.Call(opts, result, method, params...) +} + +func (_CommitStore *CommitStoreTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _CommitStore.Contract.contract.Transfer(opts) +} + +func (_CommitStore *CommitStoreTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _CommitStore.Contract.contract.Transact(opts, method, params...) +} + +func (_CommitStore *CommitStoreCaller) GetDynamicConfig(opts *bind.CallOpts) (CommitStoreDynamicConfig, error) { + var out []interface{} + err := _CommitStore.contract.Call(opts, &out, "getDynamicConfig") + + if err != nil { + return *new(CommitStoreDynamicConfig), err + } + + out0 := *abi.ConvertType(out[0], new(CommitStoreDynamicConfig)).(*CommitStoreDynamicConfig) + + return out0, err + +} + +func (_CommitStore *CommitStoreSession) GetDynamicConfig() (CommitStoreDynamicConfig, error) { + return _CommitStore.Contract.GetDynamicConfig(&_CommitStore.CallOpts) +} + +func (_CommitStore *CommitStoreCallerSession) GetDynamicConfig() (CommitStoreDynamicConfig, error) { + return _CommitStore.Contract.GetDynamicConfig(&_CommitStore.CallOpts) +} + +func (_CommitStore *CommitStoreCaller) GetExpectedNextSequenceNumber(opts *bind.CallOpts) (uint64, error) { + var out []interface{} + err := _CommitStore.contract.Call(opts, &out, "getExpectedNextSequenceNumber") + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +func (_CommitStore *CommitStoreSession) GetExpectedNextSequenceNumber() (uint64, error) { + return _CommitStore.Contract.GetExpectedNextSequenceNumber(&_CommitStore.CallOpts) +} + +func (_CommitStore *CommitStoreCallerSession) GetExpectedNextSequenceNumber() (uint64, error) { + return _CommitStore.Contract.GetExpectedNextSequenceNumber(&_CommitStore.CallOpts) +} + +func (_CommitStore *CommitStoreCaller) GetLatestPriceEpochAndRound(opts *bind.CallOpts) (uint64, error) { + var out []interface{} + err := _CommitStore.contract.Call(opts, &out, "getLatestPriceEpochAndRound") + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +func (_CommitStore *CommitStoreSession) GetLatestPriceEpochAndRound() (uint64, error) { + return _CommitStore.Contract.GetLatestPriceEpochAndRound(&_CommitStore.CallOpts) +} + +func (_CommitStore *CommitStoreCallerSession) GetLatestPriceEpochAndRound() (uint64, error) { + return _CommitStore.Contract.GetLatestPriceEpochAndRound(&_CommitStore.CallOpts) +} + +func (_CommitStore *CommitStoreCaller) GetMerkleRoot(opts *bind.CallOpts, root [32]byte) (*big.Int, error) { + var out []interface{} + err := _CommitStore.contract.Call(opts, &out, "getMerkleRoot", root) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_CommitStore *CommitStoreSession) GetMerkleRoot(root [32]byte) (*big.Int, error) { + return _CommitStore.Contract.GetMerkleRoot(&_CommitStore.CallOpts, root) +} + +func (_CommitStore *CommitStoreCallerSession) GetMerkleRoot(root [32]byte) (*big.Int, error) { + return _CommitStore.Contract.GetMerkleRoot(&_CommitStore.CallOpts, root) +} + +func (_CommitStore *CommitStoreCaller) GetStaticConfig(opts *bind.CallOpts) (CommitStoreStaticConfig, error) { + var out []interface{} + err := _CommitStore.contract.Call(opts, &out, "getStaticConfig") + + if err != nil { + return *new(CommitStoreStaticConfig), err + } + + out0 := *abi.ConvertType(out[0], new(CommitStoreStaticConfig)).(*CommitStoreStaticConfig) + + return out0, err + +} + +func (_CommitStore *CommitStoreSession) GetStaticConfig() (CommitStoreStaticConfig, error) { + return _CommitStore.Contract.GetStaticConfig(&_CommitStore.CallOpts) +} + +func (_CommitStore *CommitStoreCallerSession) GetStaticConfig() (CommitStoreStaticConfig, error) { + return _CommitStore.Contract.GetStaticConfig(&_CommitStore.CallOpts) +} + +func (_CommitStore *CommitStoreCaller) GetTransmitters(opts *bind.CallOpts) ([]common.Address, error) { + var out []interface{} + err := _CommitStore.contract.Call(opts, &out, "getTransmitters") + + if err != nil { + return *new([]common.Address), err + } + + out0 := *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) + + return out0, err + +} + +func (_CommitStore *CommitStoreSession) GetTransmitters() ([]common.Address, error) { + return _CommitStore.Contract.GetTransmitters(&_CommitStore.CallOpts) +} + +func (_CommitStore *CommitStoreCallerSession) GetTransmitters() ([]common.Address, error) { + return _CommitStore.Contract.GetTransmitters(&_CommitStore.CallOpts) +} + +func (_CommitStore *CommitStoreCaller) IsBlessed(opts *bind.CallOpts, root [32]byte) (bool, error) { + var out []interface{} + err := _CommitStore.contract.Call(opts, &out, "isBlessed", root) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_CommitStore *CommitStoreSession) IsBlessed(root [32]byte) (bool, error) { + return _CommitStore.Contract.IsBlessed(&_CommitStore.CallOpts, root) +} + +func (_CommitStore *CommitStoreCallerSession) IsBlessed(root [32]byte) (bool, error) { + return _CommitStore.Contract.IsBlessed(&_CommitStore.CallOpts, root) +} + +func (_CommitStore *CommitStoreCaller) IsUnpausedAndNotCursed(opts *bind.CallOpts) (bool, error) { + var out []interface{} + err := _CommitStore.contract.Call(opts, &out, "isUnpausedAndNotCursed") + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_CommitStore *CommitStoreSession) IsUnpausedAndNotCursed() (bool, error) { + return _CommitStore.Contract.IsUnpausedAndNotCursed(&_CommitStore.CallOpts) +} + +func (_CommitStore *CommitStoreCallerSession) IsUnpausedAndNotCursed() (bool, error) { + return _CommitStore.Contract.IsUnpausedAndNotCursed(&_CommitStore.CallOpts) +} + +func (_CommitStore *CommitStoreCaller) LatestConfigDetails(opts *bind.CallOpts) (LatestConfigDetails, + + error) { + var out []interface{} + err := _CommitStore.contract.Call(opts, &out, "latestConfigDetails") + + outstruct := new(LatestConfigDetails) + if err != nil { + return *outstruct, err + } + + outstruct.ConfigCount = *abi.ConvertType(out[0], new(uint32)).(*uint32) + outstruct.BlockNumber = *abi.ConvertType(out[1], new(uint32)).(*uint32) + outstruct.ConfigDigest = *abi.ConvertType(out[2], new([32]byte)).(*[32]byte) + + return *outstruct, err + +} + +func (_CommitStore *CommitStoreSession) LatestConfigDetails() (LatestConfigDetails, + + error) { + return _CommitStore.Contract.LatestConfigDetails(&_CommitStore.CallOpts) +} + +func (_CommitStore *CommitStoreCallerSession) LatestConfigDetails() (LatestConfigDetails, + + error) { + return _CommitStore.Contract.LatestConfigDetails(&_CommitStore.CallOpts) +} + +func (_CommitStore *CommitStoreCaller) LatestConfigDigestAndEpoch(opts *bind.CallOpts) (LatestConfigDigestAndEpoch, + + error) { + var out []interface{} + err := _CommitStore.contract.Call(opts, &out, "latestConfigDigestAndEpoch") + + outstruct := new(LatestConfigDigestAndEpoch) + if err != nil { + return *outstruct, err + } + + outstruct.ScanLogs = *abi.ConvertType(out[0], new(bool)).(*bool) + outstruct.ConfigDigest = *abi.ConvertType(out[1], new([32]byte)).(*[32]byte) + outstruct.Epoch = *abi.ConvertType(out[2], new(uint32)).(*uint32) + + return *outstruct, err + +} + +func (_CommitStore *CommitStoreSession) LatestConfigDigestAndEpoch() (LatestConfigDigestAndEpoch, + + error) { + return _CommitStore.Contract.LatestConfigDigestAndEpoch(&_CommitStore.CallOpts) +} + +func (_CommitStore *CommitStoreCallerSession) LatestConfigDigestAndEpoch() (LatestConfigDigestAndEpoch, + + error) { + return _CommitStore.Contract.LatestConfigDigestAndEpoch(&_CommitStore.CallOpts) +} + +func (_CommitStore *CommitStoreCaller) Owner(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _CommitStore.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 + +} + +func (_CommitStore *CommitStoreSession) Owner() (common.Address, error) { + return _CommitStore.Contract.Owner(&_CommitStore.CallOpts) +} + +func (_CommitStore *CommitStoreCallerSession) Owner() (common.Address, error) { + return _CommitStore.Contract.Owner(&_CommitStore.CallOpts) +} + +func (_CommitStore *CommitStoreCaller) Paused(opts *bind.CallOpts) (bool, error) { + var out []interface{} + err := _CommitStore.contract.Call(opts, &out, "paused") + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_CommitStore *CommitStoreSession) Paused() (bool, error) { + return _CommitStore.Contract.Paused(&_CommitStore.CallOpts) +} + +func (_CommitStore *CommitStoreCallerSession) Paused() (bool, error) { + return _CommitStore.Contract.Paused(&_CommitStore.CallOpts) +} + +func (_CommitStore *CommitStoreCaller) TypeAndVersion(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _CommitStore.contract.Call(opts, &out, "typeAndVersion") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +func (_CommitStore *CommitStoreSession) TypeAndVersion() (string, error) { + return _CommitStore.Contract.TypeAndVersion(&_CommitStore.CallOpts) +} + +func (_CommitStore *CommitStoreCallerSession) TypeAndVersion() (string, error) { + return _CommitStore.Contract.TypeAndVersion(&_CommitStore.CallOpts) +} + +func (_CommitStore *CommitStoreCaller) Verify(opts *bind.CallOpts, hashedLeaves [][32]byte, proofs [][32]byte, proofFlagBits *big.Int) (*big.Int, error) { + var out []interface{} + err := _CommitStore.contract.Call(opts, &out, "verify", hashedLeaves, proofs, proofFlagBits) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_CommitStore *CommitStoreSession) Verify(hashedLeaves [][32]byte, proofs [][32]byte, proofFlagBits *big.Int) (*big.Int, error) { + return _CommitStore.Contract.Verify(&_CommitStore.CallOpts, hashedLeaves, proofs, proofFlagBits) +} + +func (_CommitStore *CommitStoreCallerSession) Verify(hashedLeaves [][32]byte, proofs [][32]byte, proofFlagBits *big.Int) (*big.Int, error) { + return _CommitStore.Contract.Verify(&_CommitStore.CallOpts, hashedLeaves, proofs, proofFlagBits) +} + +func (_CommitStore *CommitStoreTransactor) AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + return _CommitStore.contract.Transact(opts, "acceptOwnership") +} + +func (_CommitStore *CommitStoreSession) AcceptOwnership() (*types.Transaction, error) { + return _CommitStore.Contract.AcceptOwnership(&_CommitStore.TransactOpts) +} + +func (_CommitStore *CommitStoreTransactorSession) AcceptOwnership() (*types.Transaction, error) { + return _CommitStore.Contract.AcceptOwnership(&_CommitStore.TransactOpts) +} + +func (_CommitStore *CommitStoreTransactor) Pause(opts *bind.TransactOpts) (*types.Transaction, error) { + return _CommitStore.contract.Transact(opts, "pause") +} + +func (_CommitStore *CommitStoreSession) Pause() (*types.Transaction, error) { + return _CommitStore.Contract.Pause(&_CommitStore.TransactOpts) +} + +func (_CommitStore *CommitStoreTransactorSession) Pause() (*types.Transaction, error) { + return _CommitStore.Contract.Pause(&_CommitStore.TransactOpts) +} + +func (_CommitStore *CommitStoreTransactor) ResetUnblessedRoots(opts *bind.TransactOpts, rootToReset [][32]byte) (*types.Transaction, error) { + return _CommitStore.contract.Transact(opts, "resetUnblessedRoots", rootToReset) +} + +func (_CommitStore *CommitStoreSession) ResetUnblessedRoots(rootToReset [][32]byte) (*types.Transaction, error) { + return _CommitStore.Contract.ResetUnblessedRoots(&_CommitStore.TransactOpts, rootToReset) +} + +func (_CommitStore *CommitStoreTransactorSession) ResetUnblessedRoots(rootToReset [][32]byte) (*types.Transaction, error) { + return _CommitStore.Contract.ResetUnblessedRoots(&_CommitStore.TransactOpts, rootToReset) +} + +func (_CommitStore *CommitStoreTransactor) SetLatestPriceEpochAndRound(opts *bind.TransactOpts, latestPriceEpochAndRound *big.Int) (*types.Transaction, error) { + return _CommitStore.contract.Transact(opts, "setLatestPriceEpochAndRound", latestPriceEpochAndRound) +} + +func (_CommitStore *CommitStoreSession) SetLatestPriceEpochAndRound(latestPriceEpochAndRound *big.Int) (*types.Transaction, error) { + return _CommitStore.Contract.SetLatestPriceEpochAndRound(&_CommitStore.TransactOpts, latestPriceEpochAndRound) +} + +func (_CommitStore *CommitStoreTransactorSession) SetLatestPriceEpochAndRound(latestPriceEpochAndRound *big.Int) (*types.Transaction, error) { + return _CommitStore.Contract.SetLatestPriceEpochAndRound(&_CommitStore.TransactOpts, latestPriceEpochAndRound) +} + +func (_CommitStore *CommitStoreTransactor) SetMinSeqNr(opts *bind.TransactOpts, minSeqNr uint64) (*types.Transaction, error) { + return _CommitStore.contract.Transact(opts, "setMinSeqNr", minSeqNr) +} + +func (_CommitStore *CommitStoreSession) SetMinSeqNr(minSeqNr uint64) (*types.Transaction, error) { + return _CommitStore.Contract.SetMinSeqNr(&_CommitStore.TransactOpts, minSeqNr) +} + +func (_CommitStore *CommitStoreTransactorSession) SetMinSeqNr(minSeqNr uint64) (*types.Transaction, error) { + return _CommitStore.Contract.SetMinSeqNr(&_CommitStore.TransactOpts, minSeqNr) +} + +func (_CommitStore *CommitStoreTransactor) SetOCR2Config(opts *bind.TransactOpts, signers []common.Address, transmitters []common.Address, f uint8, onchainConfig []byte, offchainConfigVersion uint64, offchainConfig []byte) (*types.Transaction, error) { + return _CommitStore.contract.Transact(opts, "setOCR2Config", signers, transmitters, f, onchainConfig, offchainConfigVersion, offchainConfig) +} + +func (_CommitStore *CommitStoreSession) SetOCR2Config(signers []common.Address, transmitters []common.Address, f uint8, onchainConfig []byte, offchainConfigVersion uint64, offchainConfig []byte) (*types.Transaction, error) { + return _CommitStore.Contract.SetOCR2Config(&_CommitStore.TransactOpts, signers, transmitters, f, onchainConfig, offchainConfigVersion, offchainConfig) +} + +func (_CommitStore *CommitStoreTransactorSession) SetOCR2Config(signers []common.Address, transmitters []common.Address, f uint8, onchainConfig []byte, offchainConfigVersion uint64, offchainConfig []byte) (*types.Transaction, error) { + return _CommitStore.Contract.SetOCR2Config(&_CommitStore.TransactOpts, signers, transmitters, f, onchainConfig, offchainConfigVersion, offchainConfig) +} + +func (_CommitStore *CommitStoreTransactor) TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) { + return _CommitStore.contract.Transact(opts, "transferOwnership", to) +} + +func (_CommitStore *CommitStoreSession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _CommitStore.Contract.TransferOwnership(&_CommitStore.TransactOpts, to) +} + +func (_CommitStore *CommitStoreTransactorSession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _CommitStore.Contract.TransferOwnership(&_CommitStore.TransactOpts, to) +} + +func (_CommitStore *CommitStoreTransactor) Transmit(opts *bind.TransactOpts, reportContext [3][32]byte, report []byte, rs [][32]byte, ss [][32]byte, rawVs [32]byte) (*types.Transaction, error) { + return _CommitStore.contract.Transact(opts, "transmit", reportContext, report, rs, ss, rawVs) +} + +func (_CommitStore *CommitStoreSession) Transmit(reportContext [3][32]byte, report []byte, rs [][32]byte, ss [][32]byte, rawVs [32]byte) (*types.Transaction, error) { + return _CommitStore.Contract.Transmit(&_CommitStore.TransactOpts, reportContext, report, rs, ss, rawVs) +} + +func (_CommitStore *CommitStoreTransactorSession) Transmit(reportContext [3][32]byte, report []byte, rs [][32]byte, ss [][32]byte, rawVs [32]byte) (*types.Transaction, error) { + return _CommitStore.Contract.Transmit(&_CommitStore.TransactOpts, reportContext, report, rs, ss, rawVs) +} + +func (_CommitStore *CommitStoreTransactor) Unpause(opts *bind.TransactOpts) (*types.Transaction, error) { + return _CommitStore.contract.Transact(opts, "unpause") +} + +func (_CommitStore *CommitStoreSession) Unpause() (*types.Transaction, error) { + return _CommitStore.Contract.Unpause(&_CommitStore.TransactOpts) +} + +func (_CommitStore *CommitStoreTransactorSession) Unpause() (*types.Transaction, error) { + return _CommitStore.Contract.Unpause(&_CommitStore.TransactOpts) +} + +type CommitStoreConfigSetIterator struct { + Event *CommitStoreConfigSet + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *CommitStoreConfigSetIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(CommitStoreConfigSet) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(CommitStoreConfigSet) + 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() + } +} + +func (it *CommitStoreConfigSetIterator) Error() error { + return it.fail +} + +func (it *CommitStoreConfigSetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type CommitStoreConfigSet struct { + StaticConfig CommitStoreStaticConfig + DynamicConfig CommitStoreDynamicConfig + Raw types.Log +} + +func (_CommitStore *CommitStoreFilterer) FilterConfigSet(opts *bind.FilterOpts) (*CommitStoreConfigSetIterator, error) { + + logs, sub, err := _CommitStore.contract.FilterLogs(opts, "ConfigSet") + if err != nil { + return nil, err + } + return &CommitStoreConfigSetIterator{contract: _CommitStore.contract, event: "ConfigSet", logs: logs, sub: sub}, nil +} + +func (_CommitStore *CommitStoreFilterer) WatchConfigSet(opts *bind.WatchOpts, sink chan<- *CommitStoreConfigSet) (event.Subscription, error) { + + logs, sub, err := _CommitStore.contract.WatchLogs(opts, "ConfigSet") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(CommitStoreConfigSet) + if err := _CommitStore.contract.UnpackLog(event, "ConfigSet", 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 +} + +func (_CommitStore *CommitStoreFilterer) ParseConfigSet(log types.Log) (*CommitStoreConfigSet, error) { + event := new(CommitStoreConfigSet) + if err := _CommitStore.contract.UnpackLog(event, "ConfigSet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type CommitStoreConfigSet0Iterator struct { + Event *CommitStoreConfigSet0 + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *CommitStoreConfigSet0Iterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(CommitStoreConfigSet0) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(CommitStoreConfigSet0) + 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() + } +} + +func (it *CommitStoreConfigSet0Iterator) Error() error { + return it.fail +} + +func (it *CommitStoreConfigSet0Iterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type CommitStoreConfigSet0 struct { + PreviousConfigBlockNumber uint32 + ConfigDigest [32]byte + ConfigCount uint64 + Signers []common.Address + Transmitters []common.Address + F uint8 + OnchainConfig []byte + OffchainConfigVersion uint64 + OffchainConfig []byte + Raw types.Log +} + +func (_CommitStore *CommitStoreFilterer) FilterConfigSet0(opts *bind.FilterOpts) (*CommitStoreConfigSet0Iterator, error) { + + logs, sub, err := _CommitStore.contract.FilterLogs(opts, "ConfigSet0") + if err != nil { + return nil, err + } + return &CommitStoreConfigSet0Iterator{contract: _CommitStore.contract, event: "ConfigSet0", logs: logs, sub: sub}, nil +} + +func (_CommitStore *CommitStoreFilterer) WatchConfigSet0(opts *bind.WatchOpts, sink chan<- *CommitStoreConfigSet0) (event.Subscription, error) { + + logs, sub, err := _CommitStore.contract.WatchLogs(opts, "ConfigSet0") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(CommitStoreConfigSet0) + if err := _CommitStore.contract.UnpackLog(event, "ConfigSet0", 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 +} + +func (_CommitStore *CommitStoreFilterer) ParseConfigSet0(log types.Log) (*CommitStoreConfigSet0, error) { + event := new(CommitStoreConfigSet0) + if err := _CommitStore.contract.UnpackLog(event, "ConfigSet0", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type CommitStoreLatestPriceEpochAndRoundSetIterator struct { + Event *CommitStoreLatestPriceEpochAndRoundSet + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *CommitStoreLatestPriceEpochAndRoundSetIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(CommitStoreLatestPriceEpochAndRoundSet) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(CommitStoreLatestPriceEpochAndRoundSet) + 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() + } +} + +func (it *CommitStoreLatestPriceEpochAndRoundSetIterator) Error() error { + return it.fail +} + +func (it *CommitStoreLatestPriceEpochAndRoundSetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type CommitStoreLatestPriceEpochAndRoundSet struct { + OldEpochAndRound *big.Int + NewEpochAndRound *big.Int + Raw types.Log +} + +func (_CommitStore *CommitStoreFilterer) FilterLatestPriceEpochAndRoundSet(opts *bind.FilterOpts) (*CommitStoreLatestPriceEpochAndRoundSetIterator, error) { + + logs, sub, err := _CommitStore.contract.FilterLogs(opts, "LatestPriceEpochAndRoundSet") + if err != nil { + return nil, err + } + return &CommitStoreLatestPriceEpochAndRoundSetIterator{contract: _CommitStore.contract, event: "LatestPriceEpochAndRoundSet", logs: logs, sub: sub}, nil +} + +func (_CommitStore *CommitStoreFilterer) WatchLatestPriceEpochAndRoundSet(opts *bind.WatchOpts, sink chan<- *CommitStoreLatestPriceEpochAndRoundSet) (event.Subscription, error) { + + logs, sub, err := _CommitStore.contract.WatchLogs(opts, "LatestPriceEpochAndRoundSet") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(CommitStoreLatestPriceEpochAndRoundSet) + if err := _CommitStore.contract.UnpackLog(event, "LatestPriceEpochAndRoundSet", 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 +} + +func (_CommitStore *CommitStoreFilterer) ParseLatestPriceEpochAndRoundSet(log types.Log) (*CommitStoreLatestPriceEpochAndRoundSet, error) { + event := new(CommitStoreLatestPriceEpochAndRoundSet) + if err := _CommitStore.contract.UnpackLog(event, "LatestPriceEpochAndRoundSet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type CommitStoreOwnershipTransferRequestedIterator struct { + Event *CommitStoreOwnershipTransferRequested + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *CommitStoreOwnershipTransferRequestedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(CommitStoreOwnershipTransferRequested) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(CommitStoreOwnershipTransferRequested) + 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() + } +} + +func (it *CommitStoreOwnershipTransferRequestedIterator) Error() error { + return it.fail +} + +func (it *CommitStoreOwnershipTransferRequestedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type CommitStoreOwnershipTransferRequested struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_CommitStore *CommitStoreFilterer) FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*CommitStoreOwnershipTransferRequestedIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _CommitStore.contract.FilterLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return &CommitStoreOwnershipTransferRequestedIterator{contract: _CommitStore.contract, event: "OwnershipTransferRequested", logs: logs, sub: sub}, nil +} + +func (_CommitStore *CommitStoreFilterer) WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *CommitStoreOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _CommitStore.contract.WatchLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(CommitStoreOwnershipTransferRequested) + if err := _CommitStore.contract.UnpackLog(event, "OwnershipTransferRequested", 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 +} + +func (_CommitStore *CommitStoreFilterer) ParseOwnershipTransferRequested(log types.Log) (*CommitStoreOwnershipTransferRequested, error) { + event := new(CommitStoreOwnershipTransferRequested) + if err := _CommitStore.contract.UnpackLog(event, "OwnershipTransferRequested", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type CommitStoreOwnershipTransferredIterator struct { + Event *CommitStoreOwnershipTransferred + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *CommitStoreOwnershipTransferredIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(CommitStoreOwnershipTransferred) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(CommitStoreOwnershipTransferred) + 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() + } +} + +func (it *CommitStoreOwnershipTransferredIterator) Error() error { + return it.fail +} + +func (it *CommitStoreOwnershipTransferredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type CommitStoreOwnershipTransferred struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_CommitStore *CommitStoreFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*CommitStoreOwnershipTransferredIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _CommitStore.contract.FilterLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return &CommitStoreOwnershipTransferredIterator{contract: _CommitStore.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil +} + +func (_CommitStore *CommitStoreFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *CommitStoreOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _CommitStore.contract.WatchLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(CommitStoreOwnershipTransferred) + if err := _CommitStore.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 +} + +func (_CommitStore *CommitStoreFilterer) ParseOwnershipTransferred(log types.Log) (*CommitStoreOwnershipTransferred, error) { + event := new(CommitStoreOwnershipTransferred) + if err := _CommitStore.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type CommitStorePausedIterator struct { + Event *CommitStorePaused + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *CommitStorePausedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(CommitStorePaused) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(CommitStorePaused) + 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() + } +} + +func (it *CommitStorePausedIterator) Error() error { + return it.fail +} + +func (it *CommitStorePausedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type CommitStorePaused struct { + Account common.Address + Raw types.Log +} + +func (_CommitStore *CommitStoreFilterer) FilterPaused(opts *bind.FilterOpts) (*CommitStorePausedIterator, error) { + + logs, sub, err := _CommitStore.contract.FilterLogs(opts, "Paused") + if err != nil { + return nil, err + } + return &CommitStorePausedIterator{contract: _CommitStore.contract, event: "Paused", logs: logs, sub: sub}, nil +} + +func (_CommitStore *CommitStoreFilterer) WatchPaused(opts *bind.WatchOpts, sink chan<- *CommitStorePaused) (event.Subscription, error) { + + logs, sub, err := _CommitStore.contract.WatchLogs(opts, "Paused") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(CommitStorePaused) + if err := _CommitStore.contract.UnpackLog(event, "Paused", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +func (_CommitStore *CommitStoreFilterer) ParsePaused(log types.Log) (*CommitStorePaused, error) { + event := new(CommitStorePaused) + if err := _CommitStore.contract.UnpackLog(event, "Paused", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type CommitStoreReportAcceptedIterator struct { + Event *CommitStoreReportAccepted + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *CommitStoreReportAcceptedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(CommitStoreReportAccepted) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(CommitStoreReportAccepted) + 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() + } +} + +func (it *CommitStoreReportAcceptedIterator) Error() error { + return it.fail +} + +func (it *CommitStoreReportAcceptedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type CommitStoreReportAccepted struct { + Report CommitStoreCommitReport + Raw types.Log +} + +func (_CommitStore *CommitStoreFilterer) FilterReportAccepted(opts *bind.FilterOpts) (*CommitStoreReportAcceptedIterator, error) { + + logs, sub, err := _CommitStore.contract.FilterLogs(opts, "ReportAccepted") + if err != nil { + return nil, err + } + return &CommitStoreReportAcceptedIterator{contract: _CommitStore.contract, event: "ReportAccepted", logs: logs, sub: sub}, nil +} + +func (_CommitStore *CommitStoreFilterer) WatchReportAccepted(opts *bind.WatchOpts, sink chan<- *CommitStoreReportAccepted) (event.Subscription, error) { + + logs, sub, err := _CommitStore.contract.WatchLogs(opts, "ReportAccepted") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(CommitStoreReportAccepted) + if err := _CommitStore.contract.UnpackLog(event, "ReportAccepted", 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 +} + +func (_CommitStore *CommitStoreFilterer) ParseReportAccepted(log types.Log) (*CommitStoreReportAccepted, error) { + event := new(CommitStoreReportAccepted) + if err := _CommitStore.contract.UnpackLog(event, "ReportAccepted", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type CommitStoreRootRemovedIterator struct { + Event *CommitStoreRootRemoved + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *CommitStoreRootRemovedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(CommitStoreRootRemoved) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(CommitStoreRootRemoved) + 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() + } +} + +func (it *CommitStoreRootRemovedIterator) Error() error { + return it.fail +} + +func (it *CommitStoreRootRemovedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type CommitStoreRootRemoved struct { + Root [32]byte + Raw types.Log +} + +func (_CommitStore *CommitStoreFilterer) FilterRootRemoved(opts *bind.FilterOpts) (*CommitStoreRootRemovedIterator, error) { + + logs, sub, err := _CommitStore.contract.FilterLogs(opts, "RootRemoved") + if err != nil { + return nil, err + } + return &CommitStoreRootRemovedIterator{contract: _CommitStore.contract, event: "RootRemoved", logs: logs, sub: sub}, nil +} + +func (_CommitStore *CommitStoreFilterer) WatchRootRemoved(opts *bind.WatchOpts, sink chan<- *CommitStoreRootRemoved) (event.Subscription, error) { + + logs, sub, err := _CommitStore.contract.WatchLogs(opts, "RootRemoved") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(CommitStoreRootRemoved) + if err := _CommitStore.contract.UnpackLog(event, "RootRemoved", 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 +} + +func (_CommitStore *CommitStoreFilterer) ParseRootRemoved(log types.Log) (*CommitStoreRootRemoved, error) { + event := new(CommitStoreRootRemoved) + if err := _CommitStore.contract.UnpackLog(event, "RootRemoved", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type CommitStoreSequenceNumberSetIterator struct { + Event *CommitStoreSequenceNumberSet + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *CommitStoreSequenceNumberSetIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(CommitStoreSequenceNumberSet) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(CommitStoreSequenceNumberSet) + 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() + } +} + +func (it *CommitStoreSequenceNumberSetIterator) Error() error { + return it.fail +} + +func (it *CommitStoreSequenceNumberSetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type CommitStoreSequenceNumberSet struct { + OldSeqNum uint64 + NewSeqNum uint64 + Raw types.Log +} + +func (_CommitStore *CommitStoreFilterer) FilterSequenceNumberSet(opts *bind.FilterOpts) (*CommitStoreSequenceNumberSetIterator, error) { + + logs, sub, err := _CommitStore.contract.FilterLogs(opts, "SequenceNumberSet") + if err != nil { + return nil, err + } + return &CommitStoreSequenceNumberSetIterator{contract: _CommitStore.contract, event: "SequenceNumberSet", logs: logs, sub: sub}, nil +} + +func (_CommitStore *CommitStoreFilterer) WatchSequenceNumberSet(opts *bind.WatchOpts, sink chan<- *CommitStoreSequenceNumberSet) (event.Subscription, error) { + + logs, sub, err := _CommitStore.contract.WatchLogs(opts, "SequenceNumberSet") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(CommitStoreSequenceNumberSet) + if err := _CommitStore.contract.UnpackLog(event, "SequenceNumberSet", 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 +} + +func (_CommitStore *CommitStoreFilterer) ParseSequenceNumberSet(log types.Log) (*CommitStoreSequenceNumberSet, error) { + event := new(CommitStoreSequenceNumberSet) + if err := _CommitStore.contract.UnpackLog(event, "SequenceNumberSet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type CommitStoreTransmittedIterator struct { + Event *CommitStoreTransmitted + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *CommitStoreTransmittedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(CommitStoreTransmitted) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(CommitStoreTransmitted) + 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() + } +} + +func (it *CommitStoreTransmittedIterator) Error() error { + return it.fail +} + +func (it *CommitStoreTransmittedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type CommitStoreTransmitted struct { + ConfigDigest [32]byte + Epoch uint32 + Raw types.Log +} + +func (_CommitStore *CommitStoreFilterer) FilterTransmitted(opts *bind.FilterOpts) (*CommitStoreTransmittedIterator, error) { + + logs, sub, err := _CommitStore.contract.FilterLogs(opts, "Transmitted") + if err != nil { + return nil, err + } + return &CommitStoreTransmittedIterator{contract: _CommitStore.contract, event: "Transmitted", logs: logs, sub: sub}, nil +} + +func (_CommitStore *CommitStoreFilterer) WatchTransmitted(opts *bind.WatchOpts, sink chan<- *CommitStoreTransmitted) (event.Subscription, error) { + + logs, sub, err := _CommitStore.contract.WatchLogs(opts, "Transmitted") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(CommitStoreTransmitted) + if err := _CommitStore.contract.UnpackLog(event, "Transmitted", 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 +} + +func (_CommitStore *CommitStoreFilterer) ParseTransmitted(log types.Log) (*CommitStoreTransmitted, error) { + event := new(CommitStoreTransmitted) + if err := _CommitStore.contract.UnpackLog(event, "Transmitted", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type CommitStoreUnpausedIterator struct { + Event *CommitStoreUnpaused + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *CommitStoreUnpausedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(CommitStoreUnpaused) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(CommitStoreUnpaused) + 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() + } +} + +func (it *CommitStoreUnpausedIterator) Error() error { + return it.fail +} + +func (it *CommitStoreUnpausedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type CommitStoreUnpaused struct { + Account common.Address + Raw types.Log +} + +func (_CommitStore *CommitStoreFilterer) FilterUnpaused(opts *bind.FilterOpts) (*CommitStoreUnpausedIterator, error) { + + logs, sub, err := _CommitStore.contract.FilterLogs(opts, "Unpaused") + if err != nil { + return nil, err + } + return &CommitStoreUnpausedIterator{contract: _CommitStore.contract, event: "Unpaused", logs: logs, sub: sub}, nil +} + +func (_CommitStore *CommitStoreFilterer) WatchUnpaused(opts *bind.WatchOpts, sink chan<- *CommitStoreUnpaused) (event.Subscription, error) { + + logs, sub, err := _CommitStore.contract.WatchLogs(opts, "Unpaused") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(CommitStoreUnpaused) + if err := _CommitStore.contract.UnpackLog(event, "Unpaused", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +func (_CommitStore *CommitStoreFilterer) ParseUnpaused(log types.Log) (*CommitStoreUnpaused, error) { + event := new(CommitStoreUnpaused) + if err := _CommitStore.contract.UnpackLog(event, "Unpaused", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type LatestConfigDetails struct { + ConfigCount uint32 + BlockNumber uint32 + ConfigDigest [32]byte +} +type LatestConfigDigestAndEpoch struct { + ScanLogs bool + ConfigDigest [32]byte + Epoch uint32 +} + +func (_CommitStore *CommitStore) ParseLog(log types.Log) (generated.AbigenLog, error) { + switch log.Topics[0] { + case _CommitStore.abi.Events["ConfigSet"].ID: + return _CommitStore.ParseConfigSet(log) + case _CommitStore.abi.Events["ConfigSet0"].ID: + return _CommitStore.ParseConfigSet0(log) + case _CommitStore.abi.Events["LatestPriceEpochAndRoundSet"].ID: + return _CommitStore.ParseLatestPriceEpochAndRoundSet(log) + case _CommitStore.abi.Events["OwnershipTransferRequested"].ID: + return _CommitStore.ParseOwnershipTransferRequested(log) + case _CommitStore.abi.Events["OwnershipTransferred"].ID: + return _CommitStore.ParseOwnershipTransferred(log) + case _CommitStore.abi.Events["Paused"].ID: + return _CommitStore.ParsePaused(log) + case _CommitStore.abi.Events["ReportAccepted"].ID: + return _CommitStore.ParseReportAccepted(log) + case _CommitStore.abi.Events["RootRemoved"].ID: + return _CommitStore.ParseRootRemoved(log) + case _CommitStore.abi.Events["SequenceNumberSet"].ID: + return _CommitStore.ParseSequenceNumberSet(log) + case _CommitStore.abi.Events["Transmitted"].ID: + return _CommitStore.ParseTransmitted(log) + case _CommitStore.abi.Events["Unpaused"].ID: + return _CommitStore.ParseUnpaused(log) + + default: + return nil, fmt.Errorf("abigen wrapper received unknown log topic: %v", log.Topics[0]) + } +} + +func (CommitStoreConfigSet) Topic() common.Hash { + return common.HexToHash("0xc9d7123efd4203e60b0f0a4b1dbc4800fc97ce63679f71c3a27279b24a7ddec3") +} + +func (CommitStoreConfigSet0) Topic() common.Hash { + return common.HexToHash("0x1591690b8638f5fb2dbec82ac741805ac5da8b45dc5263f4875b0496fdce4e05") +} + +func (CommitStoreLatestPriceEpochAndRoundSet) Topic() common.Hash { + return common.HexToHash("0xf0d557bfce33e354b41885eb9264448726cfe51f486ffa69809d2bf565456444") +} + +func (CommitStoreOwnershipTransferRequested) Topic() common.Hash { + return common.HexToHash("0xed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae1278") +} + +func (CommitStoreOwnershipTransferred) Topic() common.Hash { + return common.HexToHash("0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0") +} + +func (CommitStorePaused) Topic() common.Hash { + return common.HexToHash("0x62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258") +} + +func (CommitStoreReportAccepted) Topic() common.Hash { + return common.HexToHash("0x291698c01aa71f912280535d88a00d2c59fb63530a3f5d0098560468acb9ebf5") +} + +func (CommitStoreRootRemoved) Topic() common.Hash { + return common.HexToHash("0x202f1139a3e334b6056064c0e9b19fd07e44a88d8f6e5ded571b24cf8c371f12") +} + +func (CommitStoreSequenceNumberSet) Topic() common.Hash { + return common.HexToHash("0xea59e8027e41fda1525220008cf2416797405065eb21b0ebd417bfc6d361b8de") +} + +func (CommitStoreTransmitted) Topic() common.Hash { + return common.HexToHash("0xb04e63db38c49950639fa09d29872f21f5d49d614f3a969d8adf3d4b52e41a62") +} + +func (CommitStoreUnpaused) Topic() common.Hash { + return common.HexToHash("0x5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa") +} + +func (_CommitStore *CommitStore) Address() common.Address { + return _CommitStore.address +} + +type CommitStoreInterface interface { + GetDynamicConfig(opts *bind.CallOpts) (CommitStoreDynamicConfig, error) + + GetExpectedNextSequenceNumber(opts *bind.CallOpts) (uint64, error) + + GetLatestPriceEpochAndRound(opts *bind.CallOpts) (uint64, error) + + GetMerkleRoot(opts *bind.CallOpts, root [32]byte) (*big.Int, error) + + GetStaticConfig(opts *bind.CallOpts) (CommitStoreStaticConfig, error) + + GetTransmitters(opts *bind.CallOpts) ([]common.Address, error) + + IsBlessed(opts *bind.CallOpts, root [32]byte) (bool, error) + + IsUnpausedAndNotCursed(opts *bind.CallOpts) (bool, error) + + LatestConfigDetails(opts *bind.CallOpts) (LatestConfigDetails, + + error) + + LatestConfigDigestAndEpoch(opts *bind.CallOpts) (LatestConfigDigestAndEpoch, + + error) + + Owner(opts *bind.CallOpts) (common.Address, error) + + Paused(opts *bind.CallOpts) (bool, error) + + TypeAndVersion(opts *bind.CallOpts) (string, error) + + Verify(opts *bind.CallOpts, hashedLeaves [][32]byte, proofs [][32]byte, proofFlagBits *big.Int) (*big.Int, error) + + AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) + + Pause(opts *bind.TransactOpts) (*types.Transaction, error) + + ResetUnblessedRoots(opts *bind.TransactOpts, rootToReset [][32]byte) (*types.Transaction, error) + + SetLatestPriceEpochAndRound(opts *bind.TransactOpts, latestPriceEpochAndRound *big.Int) (*types.Transaction, error) + + SetMinSeqNr(opts *bind.TransactOpts, minSeqNr uint64) (*types.Transaction, error) + + SetOCR2Config(opts *bind.TransactOpts, signers []common.Address, transmitters []common.Address, f uint8, onchainConfig []byte, offchainConfigVersion uint64, offchainConfig []byte) (*types.Transaction, error) + + TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) + + Transmit(opts *bind.TransactOpts, reportContext [3][32]byte, report []byte, rs [][32]byte, ss [][32]byte, rawVs [32]byte) (*types.Transaction, error) + + Unpause(opts *bind.TransactOpts) (*types.Transaction, error) + + FilterConfigSet(opts *bind.FilterOpts) (*CommitStoreConfigSetIterator, error) + + WatchConfigSet(opts *bind.WatchOpts, sink chan<- *CommitStoreConfigSet) (event.Subscription, error) + + ParseConfigSet(log types.Log) (*CommitStoreConfigSet, error) + + FilterConfigSet0(opts *bind.FilterOpts) (*CommitStoreConfigSet0Iterator, error) + + WatchConfigSet0(opts *bind.WatchOpts, sink chan<- *CommitStoreConfigSet0) (event.Subscription, error) + + ParseConfigSet0(log types.Log) (*CommitStoreConfigSet0, error) + + FilterLatestPriceEpochAndRoundSet(opts *bind.FilterOpts) (*CommitStoreLatestPriceEpochAndRoundSetIterator, error) + + WatchLatestPriceEpochAndRoundSet(opts *bind.WatchOpts, sink chan<- *CommitStoreLatestPriceEpochAndRoundSet) (event.Subscription, error) + + ParseLatestPriceEpochAndRoundSet(log types.Log) (*CommitStoreLatestPriceEpochAndRoundSet, error) + + FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*CommitStoreOwnershipTransferRequestedIterator, error) + + WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *CommitStoreOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferRequested(log types.Log) (*CommitStoreOwnershipTransferRequested, error) + + FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*CommitStoreOwnershipTransferredIterator, error) + + WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *CommitStoreOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferred(log types.Log) (*CommitStoreOwnershipTransferred, error) + + FilterPaused(opts *bind.FilterOpts) (*CommitStorePausedIterator, error) + + WatchPaused(opts *bind.WatchOpts, sink chan<- *CommitStorePaused) (event.Subscription, error) + + ParsePaused(log types.Log) (*CommitStorePaused, error) + + FilterReportAccepted(opts *bind.FilterOpts) (*CommitStoreReportAcceptedIterator, error) + + WatchReportAccepted(opts *bind.WatchOpts, sink chan<- *CommitStoreReportAccepted) (event.Subscription, error) + + ParseReportAccepted(log types.Log) (*CommitStoreReportAccepted, error) + + FilterRootRemoved(opts *bind.FilterOpts) (*CommitStoreRootRemovedIterator, error) + + WatchRootRemoved(opts *bind.WatchOpts, sink chan<- *CommitStoreRootRemoved) (event.Subscription, error) + + ParseRootRemoved(log types.Log) (*CommitStoreRootRemoved, error) + + FilterSequenceNumberSet(opts *bind.FilterOpts) (*CommitStoreSequenceNumberSetIterator, error) + + WatchSequenceNumberSet(opts *bind.WatchOpts, sink chan<- *CommitStoreSequenceNumberSet) (event.Subscription, error) + + ParseSequenceNumberSet(log types.Log) (*CommitStoreSequenceNumberSet, error) + + FilterTransmitted(opts *bind.FilterOpts) (*CommitStoreTransmittedIterator, error) + + WatchTransmitted(opts *bind.WatchOpts, sink chan<- *CommitStoreTransmitted) (event.Subscription, error) + + ParseTransmitted(log types.Log) (*CommitStoreTransmitted, error) + + FilterUnpaused(opts *bind.FilterOpts) (*CommitStoreUnpausedIterator, error) + + WatchUnpaused(opts *bind.WatchOpts, sink chan<- *CommitStoreUnpaused) (event.Subscription, error) + + ParseUnpaused(log types.Log) (*CommitStoreUnpaused, error) + + ParseLog(log types.Log) (generated.AbigenLog, error) + + Address() common.Address +} diff --git a/core/gethwrappers/ccip/generated/commit_store_1_0_0/commit_store_1_0_0.go b/core/gethwrappers/ccip/generated/commit_store_1_0_0/commit_store_1_0_0.go new file mode 100644 index 00000000000..30716b257cb --- /dev/null +++ b/core/gethwrappers/ccip/generated/commit_store_1_0_0/commit_store_1_0_0.go @@ -0,0 +1,1951 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package commit_store_1_0_0 + +import ( + "errors" + "fmt" + "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" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" +) + +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +type CommitStoreCommitReport struct { + PriceUpdates InternalPriceUpdates + Interval CommitStoreInterval + MerkleRoot [32]byte +} + +type CommitStoreDynamicConfig struct { + PriceRegistry common.Address +} + +type CommitStoreInterval struct { + Min uint64 + Max uint64 +} + +type CommitStoreStaticConfig struct { + ChainSelector uint64 + SourceChainSelector uint64 + OnRamp common.Address + ArmProxy common.Address +} + +type InternalPriceUpdates struct { + TokenPriceUpdates []InternalTokenPriceUpdate + DestChainSelector uint64 + UsdPerUnitGas *big.Int +} + +type InternalTokenPriceUpdate struct { + SourceToken common.Address + UsdPerToken *big.Int +} + +var CommitStoreMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"onRamp\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"armProxy\",\"type\":\"address\"}],\"internalType\":\"structCommitStore.StaticConfig\",\"name\":\"staticConfig\",\"type\":\"tuple\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"BadARMSignal\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"expected\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"actual\",\"type\":\"bytes32\"}],\"name\":\"ConfigDigestMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expected\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"actual\",\"type\":\"uint256\"}],\"name\":\"ForkedChain\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidCommitStoreConfig\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"message\",\"type\":\"string\"}],\"name\":\"InvalidConfig\",\"type\":\"error\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"min\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"max\",\"type\":\"uint64\"}],\"internalType\":\"structCommitStore.Interval\",\"name\":\"interval\",\"type\":\"tuple\"}],\"name\":\"InvalidInterval\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidProof\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidRoot\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"LeavesCannotBeEmpty\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NonUniqueSignatures\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OracleCannotBeZeroAddress\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"PausedError\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RootAlreadyCommitted\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"SignaturesOutOfRegistration\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"StaleReport\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UnauthorizedSigner\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UnauthorizedTransmitter\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expected\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"actual\",\"type\":\"uint256\"}],\"name\":\"WrongMessageLength\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"WrongNumberOfSignatures\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"onRamp\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"armProxy\",\"type\":\"address\"}],\"indexed\":false,\"internalType\":\"structCommitStore.StaticConfig\",\"name\":\"staticConfig\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"priceRegistry\",\"type\":\"address\"}],\"indexed\":false,\"internalType\":\"structCommitStore.DynamicConfig\",\"name\":\"dynamicConfig\",\"type\":\"tuple\"}],\"name\":\"ConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"previousConfigBlockNumber\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"configCount\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"signers\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"transmitters\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"f\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"onchainConfig\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"offchainConfigVersion\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"offchainConfig\",\"type\":\"bytes\"}],\"name\":\"ConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"Paused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"components\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"sourceToken\",\"type\":\"address\"},{\"internalType\":\"uint192\",\"name\":\"usdPerToken\",\"type\":\"uint192\"}],\"internalType\":\"structInternal.TokenPriceUpdate[]\",\"name\":\"tokenPriceUpdates\",\"type\":\"tuple[]\"},{\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint192\",\"name\":\"usdPerUnitGas\",\"type\":\"uint192\"}],\"internalType\":\"structInternal.PriceUpdates\",\"name\":\"priceUpdates\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"min\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"max\",\"type\":\"uint64\"}],\"internalType\":\"structCommitStore.Interval\",\"name\":\"interval\",\"type\":\"tuple\"},{\"internalType\":\"bytes32\",\"name\":\"merkleRoot\",\"type\":\"bytes32\"}],\"indexed\":false,\"internalType\":\"structCommitStore.CommitReport\",\"name\":\"report\",\"type\":\"tuple\"}],\"name\":\"ReportAccepted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"root\",\"type\":\"bytes32\"}],\"name\":\"RootRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"epoch\",\"type\":\"uint32\"}],\"name\":\"Transmitted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"Unpaused\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getDynamicConfig\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"priceRegistry\",\"type\":\"address\"}],\"internalType\":\"structCommitStore.DynamicConfig\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getExpectedNextSequenceNumber\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getLatestPriceEpochAndRound\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"root\",\"type\":\"bytes32\"}],\"name\":\"getMerkleRoot\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getStaticConfig\",\"outputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"onRamp\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"armProxy\",\"type\":\"address\"}],\"internalType\":\"structCommitStore.StaticConfig\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getTransmitters\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isARMHealthy\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"root\",\"type\":\"bytes32\"}],\"name\":\"isBlessed\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isUnpausedAndARMHealthy\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestConfigDetails\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"configCount\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"blockNumber\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestConfigDigestAndEpoch\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"scanLogs\",\"type\":\"bool\"},{\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"internalType\":\"uint32\",\"name\":\"epoch\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"paused\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32[]\",\"name\":\"rootToReset\",\"type\":\"bytes32[]\"}],\"name\":\"resetUnblessedRoots\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint40\",\"name\":\"latestPriceEpochAndRound\",\"type\":\"uint40\"}],\"name\":\"setLatestPriceEpochAndRound\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"minSeqNr\",\"type\":\"uint64\"}],\"name\":\"setMinSeqNr\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"signers\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"transmitters\",\"type\":\"address[]\"},{\"internalType\":\"uint8\",\"name\":\"f\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"onchainConfig\",\"type\":\"bytes\"},{\"internalType\":\"uint64\",\"name\":\"offchainConfigVersion\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"offchainConfig\",\"type\":\"bytes\"}],\"name\":\"setOCR2Config\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32[3]\",\"name\":\"reportContext\",\"type\":\"bytes32[3]\"},{\"internalType\":\"bytes\",\"name\":\"report\",\"type\":\"bytes\"},{\"internalType\":\"bytes32[]\",\"name\":\"rs\",\"type\":\"bytes32[]\"},{\"internalType\":\"bytes32[]\",\"name\":\"ss\",\"type\":\"bytes32[]\"},{\"internalType\":\"bytes32\",\"name\":\"rawVs\",\"type\":\"bytes32\"}],\"name\":\"transmit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"unpause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32[]\",\"name\":\"hashedLeaves\",\"type\":\"bytes32[]\"},{\"internalType\":\"bytes32[]\",\"name\":\"proofs\",\"type\":\"bytes32[]\"},{\"internalType\":\"uint256\",\"name\":\"proofFlagBits\",\"type\":\"uint256\"}],\"name\":\"verify\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", + Bin: "0x61014060405260098054600165ff000000000160401b03191660011790553480156200002a57600080fd5b5060405162003788380380620037888339810160408190526200004d9162000272565b600033808281620000a55760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000d857620000d88162000192565b50505015156080524660a05260408101516001600160a01b0316158062000107575080516001600160401b0316155b806200011e575060208101516001600160401b0316155b8062000135575060608101516001600160a01b0316155b156200015457604051631fc5f15f60e11b815260040160405180910390fd5b80516001600160401b0390811660c05260208201511660e05260408101516001600160a01b0390811661010052606090910151166101205262000306565b336001600160a01b03821603620001ec5760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c6600000000000000000060448201526064016200009c565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b80516001600160401b03811681146200025557600080fd5b919050565b80516001600160a01b03811681146200025557600080fd5b6000608082840312156200028557600080fd5b604051608081016001600160401b0381118282101715620002b657634e487b7160e01b600052604160045260246000fd5b604052620002c4836200023d565b8152620002d4602084016200023d565b6020820152620002e7604084016200025a565b6040820152620002fa606084016200025a565b60608201529392505050565b60805160a05160c05160e05161010051610120516133f3620003956000396000818161026d01528181610537015281816111730152818161199f01528181611bee015261206b0152600081816102310152611bc70152600081816102010152611ba00152600081816101d10152611b710152600081816112ee015261133a015260006113b501526133f36000f3fe608060405234801561001057600080fd5b50600436106101985760003560e01c806379ba5097116100e3578063ad7a22f81161008c578063f2fde38b11610066578063f2fde38b146104fa578063f47a86901461050d578063ff888fb11461052057600080fd5b8063ad7a22f8146104b4578063afcb95d7146104c7578063b1dc65a4146104e757600080fd5b80638da5cb5b116100bd5780638da5cb5b146104645780638db94e441461048c578063a7206cd61461049457600080fd5b806379ba50971461042457806381ff70481461042c5780638456cb591461045c57600080fd5b806332048875116101455780635c975abb1161011f5780635c975abb146103b4578063666cab8d146103d05780637437ff9f146103e557600080fd5b806332048875146103795780633f4ba83a1461039a5780634120fccd146103a257600080fd5b8063181f5a7711610176578063181f5a77146103085780631ef381741461035157806329b980e41461036657600080fd5b806306285c691461019d5780630a6cd30d146102c057806310c374ed146102d8575b600080fd5b6102aa60408051608081018252600080825260208201819052918101829052606081019190915260405180608001604052807f000000000000000000000000000000000000000000000000000000000000000067ffffffffffffffff1681526020017f000000000000000000000000000000000000000000000000000000000000000067ffffffffffffffff1681526020017f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1681526020017f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16815250905090565b6040516102b7919061265f565b60405180910390f35b6102c8610533565b60405190151581526020016102b7565b60095468010000000000000000900464ffffffffff165b60405167ffffffffffffffff90911681526020016102b7565b6103446040518060400160405280601181526020017f436f6d6d697453746f726520312e302e3000000000000000000000000000000081525081565b6040516102b7919061271c565b61036461035f36600461296f565b6105ca565b005b610364610374366004612a3c565b610deb565b61038c610387366004612aaf565b610e37565b6040519081526020016102b7565b610364610f2d565b60095467ffffffffffffffff166102ef565b6009546d0100000000000000000000000000900460ff166102c8565b6103d8610f93565b6040516102b79190612b74565b604080516020808201835260009091528151808201835260085473ffffffffffffffffffffffffffffffffffffffff16908190529151918252016102b7565b610364611002565b6004546002546040805163ffffffff808516825264010000000090940490931660208401528201526060016102b7565b6103646110ff565b60005460405173ffffffffffffffffffffffffffffffffffffffff90911681526020016102b7565b6102c861116f565b61038c6104a2366004612b87565b6000908152600a602052604090205490565b6103646104c2366004612ba0565b611226565b6040805160018152600060208201819052918101919091526060016102b7565b6103646104f5366004612bbb565b611269565b610364610508366004612ca0565b611889565b61036461051b366004612cbd565b61189d565b6102c861052e366004612b87565b61193c565b60007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663397796f76040518163ffffffff1660e01b8152600401602060405180830381865afa1580156105a0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105c49190612cff565b15905090565b855185518560ff16601f831115610642576040517f89a6198900000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f746f6f206d616e79207369676e6572730000000000000000000000000000000060448201526064015b60405180910390fd5b806000036106ac576040517f89a6198900000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f66206d75737420626520706f73697469766500000000000000000000000000006044820152606401610639565b81831461073a576040517f89a61989000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f6f7261636c6520616464726573736573206f7574206f6620726567697374726160448201527f74696f6e000000000000000000000000000000000000000000000000000000006064820152608401610639565b610745816003612d50565b83116107ad576040517f89a6198900000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f6661756c74792d6f7261636c65206620746f6f206869676800000000000000006044820152606401610639565b6107b5611a10565b6107be86611a93565b60065460005b818110156108ba5760056000600683815481106107e3576107e3612d67565b600091825260208083209091015473ffffffffffffffffffffffffffffffffffffffff168352820192909252604001812080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00001690556007805460059291908490811061085357610853612d67565b600091825260208083209091015473ffffffffffffffffffffffffffffffffffffffff168352820192909252604001902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00001690556108b381612d96565b90506107c4565b50895160005b81811015610c935760008c82815181106108dc576108dc612d67565b60200260200101519050600060028111156108f9576108f9612dce565b73ffffffffffffffffffffffffffffffffffffffff8216600090815260056020526040902054610100900460ff16600281111561093857610938612dce565b1461099f576040517f89a6198900000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f7265706561746564207369676e657220616464726573730000000000000000006044820152606401610639565b73ffffffffffffffffffffffffffffffffffffffff81166109ec576040517fd6c62c9b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040805180820190915260ff83168152602081016001905273ffffffffffffffffffffffffffffffffffffffff821660009081526005602090815260409091208251815460ff9091167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0082168117835592840151919283917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00001617610100836002811115610a9c57610a9c612dce565b021790555090505060008c8381518110610ab857610ab8612d67565b6020026020010151905060006002811115610ad557610ad5612dce565b73ffffffffffffffffffffffffffffffffffffffff8216600090815260056020526040902054610100900460ff166002811115610b1457610b14612dce565b14610b7b576040517f89a6198900000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f7265706561746564207472616e736d69747465722061646472657373000000006044820152606401610639565b73ffffffffffffffffffffffffffffffffffffffff8116610bc8576040517fd6c62c9b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040805180820190915260ff84168152602081016002905273ffffffffffffffffffffffffffffffffffffffff821660009081526005602090815260409091208251815460ff9091167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0082168117835592840151919283917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00001617610100836002811115610c7857610c78612dce565b0217905550905050505080610c8c90612d96565b90506108c0565b508a51610ca79060069060208e01906125a1565b508951610cbb9060079060208d01906125a1565b506003805460ff838116610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000909216908c161717905560048054610d41914691309190600090610d139063ffffffff16612dfd565b91906101000a81548163ffffffff021916908363ffffffff160217905563ffffffff168e8e8e8e8e8e611c4f565b600260000181905550600060048054906101000a900463ffffffff169050436004806101000a81548163ffffffff021916908363ffffffff1602179055507f1591690b8638f5fb2dbec82ac741805ac5da8b45dc5263f4875b0496fdce4e0581600260000154600460009054906101000a900463ffffffff168f8f8f8f8f8f604051610dd599989796959493929190612e20565b60405180910390a1505050505050505050505050565b610df3611a10565b6009805464ffffffffff90921668010000000000000000027fffffffffffffffffffffffffffffffffffffff0000000000ffffffffffffffff909216919091179055565b6009546000906d0100000000000000000000000000900460ff1615610e88576040517feced32bc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000610ef987878080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808b0282810182019093528a82529093508a925089918291850190849080828437600092019190915250889250611cfa915050565b9050610f048161193c565b610f12576000915050610f24565b6000908152600a602052604090205490505b95945050505050565b610f35611a10565b600980547fffffffffffffffffffffffffffffffffffff00ffffffffffffffffffffffffff1690556040513381527f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa906020015b60405180910390a1565b60606007805480602002602001604051908101604052809291908181526020018280548015610ff857602002820191906000526020600020905b815473ffffffffffffffffffffffffffffffffffffffff168152600190910190602001808311610fcd575b5050505050905090565b60015473ffffffffffffffffffffffffffffffffffffffff163314611083576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e6572000000000000000000006044820152606401610639565b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b611107611a10565b600980547fffffffffffffffffffffffffffffffffffff00ffffffffffffffffffffffffff166d01000000000000000000000000001790556040513381527f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25890602001610f89565b60007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663397796f76040518163ffffffff1660e01b8152600401602060405180830381865afa1580156111dc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112009190612cff565b15801561122157506009546d0100000000000000000000000000900460ff16155b905090565b61122e611a10565b600980547fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000001667ffffffffffffffff92909216919091179055565b611278878760208b013561201b565b6040805160608101825260025480825260035460ff8082166020850152610100909104169282019290925289359182146112eb5780516040517f93df584c000000000000000000000000000000000000000000000000000000008152600481019190915260248101839052604401610639565b467f00000000000000000000000000000000000000000000000000000000000000001461136c576040517f0f01ce850000000000000000000000000000000000000000000000000000000081527f00000000000000000000000000000000000000000000000000000000000000006004820152466024820152604401610639565b6040805183815260208c81013560081c63ffffffff16908201527fb04e63db38c49950639fa09d29872f21f5d49d614f3a969d8adf3d4b52e41a62910160405180910390a160007f00000000000000000000000000000000000000000000000000000000000000001561140e576002826020015183604001516113ef9190612eb6565b6113f99190612ecf565b611404906001612eb6565b60ff169050611424565b602082015161141e906001612eb6565b60ff1690505b86811461145d576040517f71253a2500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b868514611496576040517fa75d88af00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b3360009081526005602090815260408083208151808301909252805460ff808216845292939192918401916101009091041660028111156114d9576114d9612dce565b60028111156114ea576114ea612dce565b905250905060028160200151600281111561150757611507612dce565b14801561154e57506007816000015160ff168154811061152957611529612d67565b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff1633145b611584576040517fda0f08e800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b506000611592866020612d50565b61159d896020612d50565b6115a98c610144612f18565b6115b39190612f18565b6115bd9190612f18565b9050368114611601576040517f8e1192e100000000000000000000000000000000000000000000000000000000815260048101829052366024820152604401610639565b5060008a8a604051611614929190612f2b565b60405190819003812061162b918e90602001612f3b565b60405160208183030381529060405280519060200120905061164b61262b565b8860005b818110156118785760006001858a846020811061166e5761166e612d67565b61167b91901a601b612eb6565b8f8f8681811061168d5761168d612d67565b905060200201358e8e878181106116a6576116a6612d67565b90506020020135604051600081526020016040526040516116e3949392919093845260ff9290921660208401526040830152606082015260800190565b6020604051602081039080840390855afa158015611705573d6000803e3d6000fd5b5050604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081015173ffffffffffffffffffffffffffffffffffffffff8116600090815260056020908152848220848601909552845460ff808216865293975091955092939284019161010090910416600281111561178857611788612dce565b600281111561179957611799612dce565b90525090506001816020015160028111156117b6576117b6612dce565b146117ed576040517fca31867a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8051859060ff16601f811061180457611804612d67565b602002015115611840576040517ff67bc7c400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600185826000015160ff16601f811061185b5761185b612d67565b9115156020909202015250611871905081612d96565b905061164f565b505050505050505050505050505050565b611891611a10565b61189a81612431565b50565b6118a5611a10565b60005b818110156119375760008383838181106118c4576118c4612d67565b9050602002013590506118d68161193c565b611926576000818152600a602052604080822091909155517f202f1139a3e334b6056064c0e9b19fd07e44a88d8f6e5ded571b24cf8c371f129061191d9083815260200190565b60405180910390a15b5061193081612d96565b90506118a8565b505050565b6040805180820182523081526020810183815291517f4d616771000000000000000000000000000000000000000000000000000000008152905173ffffffffffffffffffffffffffffffffffffffff9081166004830152915160248201526000917f00000000000000000000000000000000000000000000000000000000000000001690634d61677190604401602060405180830381865afa1580156119e6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a0a9190612cff565b92915050565b60005473ffffffffffffffffffffffffffffffffffffffff163314611a91576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e6572000000000000000000006044820152606401610639565b565b600081806020019051810190611aa99190612f4f565b805190915073ffffffffffffffffffffffffffffffffffffffff16611afa576040517f3f8be2be00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8051600880547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff928316179055600980547fffffffffffffffffffffffffffffffffffffff0000000000ffffffffffffffff169055604080516080810182527f000000000000000000000000000000000000000000000000000000000000000067ffffffffffffffff90811682527f00000000000000000000000000000000000000000000000000000000000000001660208201527f00000000000000000000000000000000000000000000000000000000000000008316818301527f00000000000000000000000000000000000000000000000000000000000000009092166060830152517fc9d7123efd4203e60b0f0a4b1dbc4800fc97ce63679f71c3a27279b24a7ddec391611c43918490612f9b565b60405180910390a15050565b6000808a8a8a8a8a8a8a8a8a604051602001611c7399989796959493929190613018565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815291905280516020909101207dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167e01000000000000000000000000000000000000000000000000000000000000179150509998505050505050505050565b8251825160009190818303611d3b576040517f11a6b26400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6101018211801590611d4f57506101018111155b611d85576040517f09bde33900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82820101610100811115611de6576040517f09bde33900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80600003611e135786600081518110611e0157611e01612d67565b60200260200101519350505050612014565b60008167ffffffffffffffff811115611e2e57611e2e61272f565b604051908082528060200260200182016040528015611e57578160200160208202803683370190505b50905060008080805b85811015611f9a5760006001821b8b811603611ebb5788851015611ea4578c5160018601958e918110611e9557611e95612d67565b60200260200101519050611edd565b8551600185019487918110611e9557611e95612d67565b8b5160018401938d918110611ed257611ed2612d67565b602002602001015190505b600089861015611f0d578d5160018701968f918110611efe57611efe612d67565b60200260200101519050611f2f565b8651600186019588918110611f2457611f24612d67565b602002602001015190505b82851115611f69576040517f09bde33900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611f738282612526565b878481518110611f8557611f85612d67565b60209081029190910101525050600101611e60565b506001850382148015611fac57508683145b8015611fb757508581145b611fed576040517f09bde33900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b83600186038151811061200257612002612d67565b60200260200101519750505050505050505b9392505050565b6009546d0100000000000000000000000000900460ff1615612069576040517feced32bc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663397796f76040518163ffffffff1660e01b8152600401602060405180830381865afa1580156120d4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120f89190612cff565b1561212f576040517fc148371500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600061213d83850185613113565b8051515190915015158061215f575080516020015167ffffffffffffffff1615155b156122975760095464ffffffffff8084166801000000000000000090920416101561225c57600980547fffffffffffffffffffffffffffffffffffffff0000000000ffffffffffffffff166801000000000000000064ffffffffff85160217905560085481516040517f866548c900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9092169163866548c9916122169160040161332a565b600060405180830381600087803b15801561223057600080fd5b505af1158015612244573d6000803e3d6000fd5b5050505060408101516122575750505050565b612297565b6040810151612297576040517ff803a2ca00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60208101515160095467ffffffffffffffff90811691161415806122d2575060208082015190810151905167ffffffffffffffff9182169116115b1561230f5780602001516040517fbb1ae18d000000000000000000000000000000000000000000000000000000008152600401610639919061333d565b604081015161234a576040517f504570e300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040808201516000908152600a602052205415612393576040517fa0bce24f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60208082015101516123a6906001613362565b600980547fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000001667ffffffffffffffff929092169190911790556040818101516000908152600a602052819020429055517fe81b49e583122eb290c46fc255c962b9a2dec468816c00fb7a2e6ebc42dc92d49061242390839061338a565b60405180910390a150505050565b3373ffffffffffffffffffffffffffffffffffffffff8216036124b0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c660000000000000000006044820152606401610639565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b60008183106125685760408051600160208083019190915281830185905260608083018790528351808403909101815260809092019092528051910120612014565b60408051600160208083019190915281830186905260608083018690528351808403909101815260809092019092528051910120612014565b82805482825590600052602060002090810192821561261b579160200282015b8281111561261b57825182547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff9091161782556020909201916001909101906125c1565b5061262792915061264a565b5090565b604051806103e00160405280601f906020820280368337509192915050565b5b80821115612627576000815560010161264b565b60808101611a0a828467ffffffffffffffff80825116835280602083015116602084015250604081015173ffffffffffffffffffffffffffffffffffffffff808216604085015280606084015116606085015250505050565b6000815180845260005b818110156126de576020818501810151868301820152016126c2565b5060006020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b60208152600061201460208301846126b8565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040805190810167ffffffffffffffff811182821017156127815761278161272f565b60405290565b6040516060810167ffffffffffffffff811182821017156127815761278161272f565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff811182821017156127f1576127f161272f565b604052919050565b600067ffffffffffffffff8211156128135761281361272f565b5060051b60200190565b73ffffffffffffffffffffffffffffffffffffffff8116811461189a57600080fd5b600082601f83011261285057600080fd5b81356020612865612860836127f9565b6127aa565b82815260059290921b8401810191818101908684111561288457600080fd5b8286015b848110156128a857803561289b8161281d565b8352918301918301612888565b509695505050505050565b803560ff811681146128c457600080fd5b919050565b600082601f8301126128da57600080fd5b813567ffffffffffffffff8111156128f4576128f461272f565b61292560207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116016127aa565b81815284602083860101111561293a57600080fd5b816020850160208301376000918101602001919091529392505050565b803567ffffffffffffffff811681146128c457600080fd5b60008060008060008060c0878903121561298857600080fd5b863567ffffffffffffffff808211156129a057600080fd5b6129ac8a838b0161283f565b975060208901359150808211156129c257600080fd5b6129ce8a838b0161283f565b96506129dc60408a016128b3565b955060608901359150808211156129f257600080fd5b6129fe8a838b016128c9565b9450612a0c60808a01612957565b935060a0890135915080821115612a2257600080fd5b50612a2f89828a016128c9565b9150509295509295509295565b600060208284031215612a4e57600080fd5b813564ffffffffff8116811461201457600080fd5b60008083601f840112612a7557600080fd5b50813567ffffffffffffffff811115612a8d57600080fd5b6020830191508360208260051b8501011115612aa857600080fd5b9250929050565b600080600080600060608688031215612ac757600080fd5b853567ffffffffffffffff80821115612adf57600080fd5b612aeb89838a01612a63565b90975095506020880135915080821115612b0457600080fd5b50612b1188828901612a63565b96999598509660400135949350505050565b600081518084526020808501945080840160005b83811015612b6957815173ffffffffffffffffffffffffffffffffffffffff1687529582019590820190600101612b37565b509495945050505050565b6020815260006120146020830184612b23565b600060208284031215612b9957600080fd5b5035919050565b600060208284031215612bb257600080fd5b61201482612957565b60008060008060008060008060e0898b031215612bd757600080fd5b606089018a811115612be857600080fd5b8998503567ffffffffffffffff80821115612c0257600080fd5b818b0191508b601f830112612c1657600080fd5b813581811115612c2557600080fd5b8c6020828501011115612c3757600080fd5b6020830199508098505060808b0135915080821115612c5557600080fd5b612c618c838d01612a63565b909750955060a08b0135915080821115612c7a57600080fd5b50612c878b828c01612a63565b999c989b50969995989497949560c00135949350505050565b600060208284031215612cb257600080fd5b81356120148161281d565b60008060208385031215612cd057600080fd5b823567ffffffffffffffff811115612ce757600080fd5b612cf385828601612a63565b90969095509350505050565b600060208284031215612d1157600080fd5b8151801515811461201457600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8082028115828204841417611a0a57611a0a612d21565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203612dc757612dc7612d21565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b600063ffffffff808316818103612e1657612e16612d21565b6001019392505050565b600061012063ffffffff808d1684528b6020850152808b16604085015250806060840152612e508184018a612b23565b90508281036080840152612e648189612b23565b905060ff871660a084015282810360c0840152612e8181876126b8565b905067ffffffffffffffff851660e0840152828103610100840152612ea681856126b8565b9c9b505050505050505050505050565b60ff8181168382160190811115611a0a57611a0a612d21565b600060ff831680612f09577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b8060ff84160491505092915050565b80820180821115611a0a57611a0a612d21565b8183823760009101908152919050565b828152606082602083013760800192915050565b600060208284031215612f6157600080fd5b6040516020810181811067ffffffffffffffff82111715612f8457612f8461272f565b6040528251612f928161281d565b81529392505050565b60a08101612ff4828567ffffffffffffffff80825116835280602083015116602084015250604081015173ffffffffffffffffffffffffffffffffffffffff808216604085015280606084015116606085015250505050565b73ffffffffffffffffffffffffffffffffffffffff83511660808301529392505050565b60006101208b835273ffffffffffffffffffffffffffffffffffffffff8b16602084015267ffffffffffffffff808b16604085015281606085015261305f8285018b612b23565b91508382036080850152613073828a612b23565b915060ff881660a085015283820360c085015261309082886126b8565b90861660e08501528381036101008501529050612ea681856126b8565b803577ffffffffffffffffffffffffffffffffffffffffffffffff811681146128c457600080fd5b6000604082840312156130e757600080fd5b6130ef61275e565b90506130fa82612957565b815261310860208301612957565b602082015292915050565b6000602080838503121561312657600080fd5b823567ffffffffffffffff8082111561313e57600080fd5b908401906080828703121561315257600080fd5b61315a612787565b82358281111561316957600080fd5b83016060818903121561317b57600080fd5b613183612787565b81358481111561319257600080fd5b82019350601f840189136131a557600080fd5b83356131b3612860826127f9565b81815260069190911b8501870190878101908b8311156131d257600080fd5b958801955b82871015613226576040878d0312156131f05760008081fd5b6131f861275e565b87356132038161281d565b8152613210888b016130ad565b818b0152825260409690960195908801906131d7565b8352506132369050828701612957565b86820152613246604083016130ad565b604082015282525061325a878486016130d5565b93810193909352506060013560408201529392505050565b805160608084528151908401819052600091602091908201906080860190845b818110156132e9578351805173ffffffffffffffffffffffffffffffffffffffff16845285015177ffffffffffffffffffffffffffffffffffffffffffffffff168584015292840192604090920191600101613292565b505067ffffffffffffffff83860151168387015260408501519250610f24604087018477ffffffffffffffffffffffffffffffffffffffffffffffff169052565b6020815260006120146020830184613272565b60408101611a0a8284805167ffffffffffffffff908116835260209182015116910152565b67ffffffffffffffff81811683821601908082111561338357613383612d21565b5092915050565b6020815260008251608060208401526133a660a0840182613272565b905060208401516133d16040850182805167ffffffffffffffff908116835260209182015116910152565b5060408401516080840152809150509291505056fea164736f6c6343000813000a", +} + +var CommitStoreABI = CommitStoreMetaData.ABI + +var CommitStoreBin = CommitStoreMetaData.Bin + +func DeployCommitStore(auth *bind.TransactOpts, backend bind.ContractBackend, staticConfig CommitStoreStaticConfig) (common.Address, *types.Transaction, *CommitStore, error) { + parsed, err := CommitStoreMetaData.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(CommitStoreBin), backend, staticConfig) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &CommitStore{CommitStoreCaller: CommitStoreCaller{contract: contract}, CommitStoreTransactor: CommitStoreTransactor{contract: contract}, CommitStoreFilterer: CommitStoreFilterer{contract: contract}}, nil +} + +type CommitStore struct { + address common.Address + abi abi.ABI + CommitStoreCaller + CommitStoreTransactor + CommitStoreFilterer +} + +type CommitStoreCaller struct { + contract *bind.BoundContract +} + +type CommitStoreTransactor struct { + contract *bind.BoundContract +} + +type CommitStoreFilterer struct { + contract *bind.BoundContract +} + +type CommitStoreSession struct { + Contract *CommitStore + CallOpts bind.CallOpts + TransactOpts bind.TransactOpts +} + +type CommitStoreCallerSession struct { + Contract *CommitStoreCaller + CallOpts bind.CallOpts +} + +type CommitStoreTransactorSession struct { + Contract *CommitStoreTransactor + TransactOpts bind.TransactOpts +} + +type CommitStoreRaw struct { + Contract *CommitStore +} + +type CommitStoreCallerRaw struct { + Contract *CommitStoreCaller +} + +type CommitStoreTransactorRaw struct { + Contract *CommitStoreTransactor +} + +func NewCommitStore(address common.Address, backend bind.ContractBackend) (*CommitStore, error) { + abi, err := abi.JSON(strings.NewReader(CommitStoreABI)) + if err != nil { + return nil, err + } + contract, err := bindCommitStore(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &CommitStore{address: address, abi: abi, CommitStoreCaller: CommitStoreCaller{contract: contract}, CommitStoreTransactor: CommitStoreTransactor{contract: contract}, CommitStoreFilterer: CommitStoreFilterer{contract: contract}}, nil +} + +func NewCommitStoreCaller(address common.Address, caller bind.ContractCaller) (*CommitStoreCaller, error) { + contract, err := bindCommitStore(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &CommitStoreCaller{contract: contract}, nil +} + +func NewCommitStoreTransactor(address common.Address, transactor bind.ContractTransactor) (*CommitStoreTransactor, error) { + contract, err := bindCommitStore(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &CommitStoreTransactor{contract: contract}, nil +} + +func NewCommitStoreFilterer(address common.Address, filterer bind.ContractFilterer) (*CommitStoreFilterer, error) { + contract, err := bindCommitStore(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &CommitStoreFilterer{contract: contract}, nil +} + +func bindCommitStore(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := CommitStoreMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +func (_CommitStore *CommitStoreRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _CommitStore.Contract.CommitStoreCaller.contract.Call(opts, result, method, params...) +} + +func (_CommitStore *CommitStoreRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _CommitStore.Contract.CommitStoreTransactor.contract.Transfer(opts) +} + +func (_CommitStore *CommitStoreRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _CommitStore.Contract.CommitStoreTransactor.contract.Transact(opts, method, params...) +} + +func (_CommitStore *CommitStoreCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _CommitStore.Contract.contract.Call(opts, result, method, params...) +} + +func (_CommitStore *CommitStoreTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _CommitStore.Contract.contract.Transfer(opts) +} + +func (_CommitStore *CommitStoreTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _CommitStore.Contract.contract.Transact(opts, method, params...) +} + +func (_CommitStore *CommitStoreCaller) GetDynamicConfig(opts *bind.CallOpts) (CommitStoreDynamicConfig, error) { + var out []interface{} + err := _CommitStore.contract.Call(opts, &out, "getDynamicConfig") + + if err != nil { + return *new(CommitStoreDynamicConfig), err + } + + out0 := *abi.ConvertType(out[0], new(CommitStoreDynamicConfig)).(*CommitStoreDynamicConfig) + + return out0, err + +} + +func (_CommitStore *CommitStoreSession) GetDynamicConfig() (CommitStoreDynamicConfig, error) { + return _CommitStore.Contract.GetDynamicConfig(&_CommitStore.CallOpts) +} + +func (_CommitStore *CommitStoreCallerSession) GetDynamicConfig() (CommitStoreDynamicConfig, error) { + return _CommitStore.Contract.GetDynamicConfig(&_CommitStore.CallOpts) +} + +func (_CommitStore *CommitStoreCaller) GetExpectedNextSequenceNumber(opts *bind.CallOpts) (uint64, error) { + var out []interface{} + err := _CommitStore.contract.Call(opts, &out, "getExpectedNextSequenceNumber") + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +func (_CommitStore *CommitStoreSession) GetExpectedNextSequenceNumber() (uint64, error) { + return _CommitStore.Contract.GetExpectedNextSequenceNumber(&_CommitStore.CallOpts) +} + +func (_CommitStore *CommitStoreCallerSession) GetExpectedNextSequenceNumber() (uint64, error) { + return _CommitStore.Contract.GetExpectedNextSequenceNumber(&_CommitStore.CallOpts) +} + +func (_CommitStore *CommitStoreCaller) GetLatestPriceEpochAndRound(opts *bind.CallOpts) (uint64, error) { + var out []interface{} + err := _CommitStore.contract.Call(opts, &out, "getLatestPriceEpochAndRound") + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +func (_CommitStore *CommitStoreSession) GetLatestPriceEpochAndRound() (uint64, error) { + return _CommitStore.Contract.GetLatestPriceEpochAndRound(&_CommitStore.CallOpts) +} + +func (_CommitStore *CommitStoreCallerSession) GetLatestPriceEpochAndRound() (uint64, error) { + return _CommitStore.Contract.GetLatestPriceEpochAndRound(&_CommitStore.CallOpts) +} + +func (_CommitStore *CommitStoreCaller) GetMerkleRoot(opts *bind.CallOpts, root [32]byte) (*big.Int, error) { + var out []interface{} + err := _CommitStore.contract.Call(opts, &out, "getMerkleRoot", root) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_CommitStore *CommitStoreSession) GetMerkleRoot(root [32]byte) (*big.Int, error) { + return _CommitStore.Contract.GetMerkleRoot(&_CommitStore.CallOpts, root) +} + +func (_CommitStore *CommitStoreCallerSession) GetMerkleRoot(root [32]byte) (*big.Int, error) { + return _CommitStore.Contract.GetMerkleRoot(&_CommitStore.CallOpts, root) +} + +func (_CommitStore *CommitStoreCaller) GetStaticConfig(opts *bind.CallOpts) (CommitStoreStaticConfig, error) { + var out []interface{} + err := _CommitStore.contract.Call(opts, &out, "getStaticConfig") + + if err != nil { + return *new(CommitStoreStaticConfig), err + } + + out0 := *abi.ConvertType(out[0], new(CommitStoreStaticConfig)).(*CommitStoreStaticConfig) + + return out0, err + +} + +func (_CommitStore *CommitStoreSession) GetStaticConfig() (CommitStoreStaticConfig, error) { + return _CommitStore.Contract.GetStaticConfig(&_CommitStore.CallOpts) +} + +func (_CommitStore *CommitStoreCallerSession) GetStaticConfig() (CommitStoreStaticConfig, error) { + return _CommitStore.Contract.GetStaticConfig(&_CommitStore.CallOpts) +} + +func (_CommitStore *CommitStoreCaller) GetTransmitters(opts *bind.CallOpts) ([]common.Address, error) { + var out []interface{} + err := _CommitStore.contract.Call(opts, &out, "getTransmitters") + + if err != nil { + return *new([]common.Address), err + } + + out0 := *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) + + return out0, err + +} + +func (_CommitStore *CommitStoreSession) GetTransmitters() ([]common.Address, error) { + return _CommitStore.Contract.GetTransmitters(&_CommitStore.CallOpts) +} + +func (_CommitStore *CommitStoreCallerSession) GetTransmitters() ([]common.Address, error) { + return _CommitStore.Contract.GetTransmitters(&_CommitStore.CallOpts) +} + +func (_CommitStore *CommitStoreCaller) IsARMHealthy(opts *bind.CallOpts) (bool, error) { + var out []interface{} + err := _CommitStore.contract.Call(opts, &out, "isARMHealthy") + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_CommitStore *CommitStoreSession) IsARMHealthy() (bool, error) { + return _CommitStore.Contract.IsARMHealthy(&_CommitStore.CallOpts) +} + +func (_CommitStore *CommitStoreCallerSession) IsARMHealthy() (bool, error) { + return _CommitStore.Contract.IsARMHealthy(&_CommitStore.CallOpts) +} + +func (_CommitStore *CommitStoreCaller) IsBlessed(opts *bind.CallOpts, root [32]byte) (bool, error) { + var out []interface{} + err := _CommitStore.contract.Call(opts, &out, "isBlessed", root) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_CommitStore *CommitStoreSession) IsBlessed(root [32]byte) (bool, error) { + return _CommitStore.Contract.IsBlessed(&_CommitStore.CallOpts, root) +} + +func (_CommitStore *CommitStoreCallerSession) IsBlessed(root [32]byte) (bool, error) { + return _CommitStore.Contract.IsBlessed(&_CommitStore.CallOpts, root) +} + +func (_CommitStore *CommitStoreCaller) IsUnpausedAndARMHealthy(opts *bind.CallOpts) (bool, error) { + var out []interface{} + err := _CommitStore.contract.Call(opts, &out, "isUnpausedAndARMHealthy") + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_CommitStore *CommitStoreSession) IsUnpausedAndARMHealthy() (bool, error) { + return _CommitStore.Contract.IsUnpausedAndARMHealthy(&_CommitStore.CallOpts) +} + +func (_CommitStore *CommitStoreCallerSession) IsUnpausedAndARMHealthy() (bool, error) { + return _CommitStore.Contract.IsUnpausedAndARMHealthy(&_CommitStore.CallOpts) +} + +func (_CommitStore *CommitStoreCaller) LatestConfigDetails(opts *bind.CallOpts) (LatestConfigDetails, + + error) { + var out []interface{} + err := _CommitStore.contract.Call(opts, &out, "latestConfigDetails") + + outstruct := new(LatestConfigDetails) + if err != nil { + return *outstruct, err + } + + outstruct.ConfigCount = *abi.ConvertType(out[0], new(uint32)).(*uint32) + outstruct.BlockNumber = *abi.ConvertType(out[1], new(uint32)).(*uint32) + outstruct.ConfigDigest = *abi.ConvertType(out[2], new([32]byte)).(*[32]byte) + + return *outstruct, err + +} + +func (_CommitStore *CommitStoreSession) LatestConfigDetails() (LatestConfigDetails, + + error) { + return _CommitStore.Contract.LatestConfigDetails(&_CommitStore.CallOpts) +} + +func (_CommitStore *CommitStoreCallerSession) LatestConfigDetails() (LatestConfigDetails, + + error) { + return _CommitStore.Contract.LatestConfigDetails(&_CommitStore.CallOpts) +} + +func (_CommitStore *CommitStoreCaller) LatestConfigDigestAndEpoch(opts *bind.CallOpts) (LatestConfigDigestAndEpoch, + + error) { + var out []interface{} + err := _CommitStore.contract.Call(opts, &out, "latestConfigDigestAndEpoch") + + outstruct := new(LatestConfigDigestAndEpoch) + if err != nil { + return *outstruct, err + } + + outstruct.ScanLogs = *abi.ConvertType(out[0], new(bool)).(*bool) + outstruct.ConfigDigest = *abi.ConvertType(out[1], new([32]byte)).(*[32]byte) + outstruct.Epoch = *abi.ConvertType(out[2], new(uint32)).(*uint32) + + return *outstruct, err + +} + +func (_CommitStore *CommitStoreSession) LatestConfigDigestAndEpoch() (LatestConfigDigestAndEpoch, + + error) { + return _CommitStore.Contract.LatestConfigDigestAndEpoch(&_CommitStore.CallOpts) +} + +func (_CommitStore *CommitStoreCallerSession) LatestConfigDigestAndEpoch() (LatestConfigDigestAndEpoch, + + error) { + return _CommitStore.Contract.LatestConfigDigestAndEpoch(&_CommitStore.CallOpts) +} + +func (_CommitStore *CommitStoreCaller) Owner(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _CommitStore.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 + +} + +func (_CommitStore *CommitStoreSession) Owner() (common.Address, error) { + return _CommitStore.Contract.Owner(&_CommitStore.CallOpts) +} + +func (_CommitStore *CommitStoreCallerSession) Owner() (common.Address, error) { + return _CommitStore.Contract.Owner(&_CommitStore.CallOpts) +} + +func (_CommitStore *CommitStoreCaller) Paused(opts *bind.CallOpts) (bool, error) { + var out []interface{} + err := _CommitStore.contract.Call(opts, &out, "paused") + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_CommitStore *CommitStoreSession) Paused() (bool, error) { + return _CommitStore.Contract.Paused(&_CommitStore.CallOpts) +} + +func (_CommitStore *CommitStoreCallerSession) Paused() (bool, error) { + return _CommitStore.Contract.Paused(&_CommitStore.CallOpts) +} + +func (_CommitStore *CommitStoreCaller) TypeAndVersion(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _CommitStore.contract.Call(opts, &out, "typeAndVersion") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +func (_CommitStore *CommitStoreSession) TypeAndVersion() (string, error) { + return _CommitStore.Contract.TypeAndVersion(&_CommitStore.CallOpts) +} + +func (_CommitStore *CommitStoreCallerSession) TypeAndVersion() (string, error) { + return _CommitStore.Contract.TypeAndVersion(&_CommitStore.CallOpts) +} + +func (_CommitStore *CommitStoreCaller) Verify(opts *bind.CallOpts, hashedLeaves [][32]byte, proofs [][32]byte, proofFlagBits *big.Int) (*big.Int, error) { + var out []interface{} + err := _CommitStore.contract.Call(opts, &out, "verify", hashedLeaves, proofs, proofFlagBits) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_CommitStore *CommitStoreSession) Verify(hashedLeaves [][32]byte, proofs [][32]byte, proofFlagBits *big.Int) (*big.Int, error) { + return _CommitStore.Contract.Verify(&_CommitStore.CallOpts, hashedLeaves, proofs, proofFlagBits) +} + +func (_CommitStore *CommitStoreCallerSession) Verify(hashedLeaves [][32]byte, proofs [][32]byte, proofFlagBits *big.Int) (*big.Int, error) { + return _CommitStore.Contract.Verify(&_CommitStore.CallOpts, hashedLeaves, proofs, proofFlagBits) +} + +func (_CommitStore *CommitStoreTransactor) AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + return _CommitStore.contract.Transact(opts, "acceptOwnership") +} + +func (_CommitStore *CommitStoreSession) AcceptOwnership() (*types.Transaction, error) { + return _CommitStore.Contract.AcceptOwnership(&_CommitStore.TransactOpts) +} + +func (_CommitStore *CommitStoreTransactorSession) AcceptOwnership() (*types.Transaction, error) { + return _CommitStore.Contract.AcceptOwnership(&_CommitStore.TransactOpts) +} + +func (_CommitStore *CommitStoreTransactor) Pause(opts *bind.TransactOpts) (*types.Transaction, error) { + return _CommitStore.contract.Transact(opts, "pause") +} + +func (_CommitStore *CommitStoreSession) Pause() (*types.Transaction, error) { + return _CommitStore.Contract.Pause(&_CommitStore.TransactOpts) +} + +func (_CommitStore *CommitStoreTransactorSession) Pause() (*types.Transaction, error) { + return _CommitStore.Contract.Pause(&_CommitStore.TransactOpts) +} + +func (_CommitStore *CommitStoreTransactor) ResetUnblessedRoots(opts *bind.TransactOpts, rootToReset [][32]byte) (*types.Transaction, error) { + return _CommitStore.contract.Transact(opts, "resetUnblessedRoots", rootToReset) +} + +func (_CommitStore *CommitStoreSession) ResetUnblessedRoots(rootToReset [][32]byte) (*types.Transaction, error) { + return _CommitStore.Contract.ResetUnblessedRoots(&_CommitStore.TransactOpts, rootToReset) +} + +func (_CommitStore *CommitStoreTransactorSession) ResetUnblessedRoots(rootToReset [][32]byte) (*types.Transaction, error) { + return _CommitStore.Contract.ResetUnblessedRoots(&_CommitStore.TransactOpts, rootToReset) +} + +func (_CommitStore *CommitStoreTransactor) SetLatestPriceEpochAndRound(opts *bind.TransactOpts, latestPriceEpochAndRound *big.Int) (*types.Transaction, error) { + return _CommitStore.contract.Transact(opts, "setLatestPriceEpochAndRound", latestPriceEpochAndRound) +} + +func (_CommitStore *CommitStoreSession) SetLatestPriceEpochAndRound(latestPriceEpochAndRound *big.Int) (*types.Transaction, error) { + return _CommitStore.Contract.SetLatestPriceEpochAndRound(&_CommitStore.TransactOpts, latestPriceEpochAndRound) +} + +func (_CommitStore *CommitStoreTransactorSession) SetLatestPriceEpochAndRound(latestPriceEpochAndRound *big.Int) (*types.Transaction, error) { + return _CommitStore.Contract.SetLatestPriceEpochAndRound(&_CommitStore.TransactOpts, latestPriceEpochAndRound) +} + +func (_CommitStore *CommitStoreTransactor) SetMinSeqNr(opts *bind.TransactOpts, minSeqNr uint64) (*types.Transaction, error) { + return _CommitStore.contract.Transact(opts, "setMinSeqNr", minSeqNr) +} + +func (_CommitStore *CommitStoreSession) SetMinSeqNr(minSeqNr uint64) (*types.Transaction, error) { + return _CommitStore.Contract.SetMinSeqNr(&_CommitStore.TransactOpts, minSeqNr) +} + +func (_CommitStore *CommitStoreTransactorSession) SetMinSeqNr(minSeqNr uint64) (*types.Transaction, error) { + return _CommitStore.Contract.SetMinSeqNr(&_CommitStore.TransactOpts, minSeqNr) +} + +func (_CommitStore *CommitStoreTransactor) SetOCR2Config(opts *bind.TransactOpts, signers []common.Address, transmitters []common.Address, f uint8, onchainConfig []byte, offchainConfigVersion uint64, offchainConfig []byte) (*types.Transaction, error) { + return _CommitStore.contract.Transact(opts, "setOCR2Config", signers, transmitters, f, onchainConfig, offchainConfigVersion, offchainConfig) +} + +func (_CommitStore *CommitStoreSession) SetOCR2Config(signers []common.Address, transmitters []common.Address, f uint8, onchainConfig []byte, offchainConfigVersion uint64, offchainConfig []byte) (*types.Transaction, error) { + return _CommitStore.Contract.SetOCR2Config(&_CommitStore.TransactOpts, signers, transmitters, f, onchainConfig, offchainConfigVersion, offchainConfig) +} + +func (_CommitStore *CommitStoreTransactorSession) SetOCR2Config(signers []common.Address, transmitters []common.Address, f uint8, onchainConfig []byte, offchainConfigVersion uint64, offchainConfig []byte) (*types.Transaction, error) { + return _CommitStore.Contract.SetOCR2Config(&_CommitStore.TransactOpts, signers, transmitters, f, onchainConfig, offchainConfigVersion, offchainConfig) +} + +func (_CommitStore *CommitStoreTransactor) TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) { + return _CommitStore.contract.Transact(opts, "transferOwnership", to) +} + +func (_CommitStore *CommitStoreSession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _CommitStore.Contract.TransferOwnership(&_CommitStore.TransactOpts, to) +} + +func (_CommitStore *CommitStoreTransactorSession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _CommitStore.Contract.TransferOwnership(&_CommitStore.TransactOpts, to) +} + +func (_CommitStore *CommitStoreTransactor) Transmit(opts *bind.TransactOpts, reportContext [3][32]byte, report []byte, rs [][32]byte, ss [][32]byte, rawVs [32]byte) (*types.Transaction, error) { + return _CommitStore.contract.Transact(opts, "transmit", reportContext, report, rs, ss, rawVs) +} + +func (_CommitStore *CommitStoreSession) Transmit(reportContext [3][32]byte, report []byte, rs [][32]byte, ss [][32]byte, rawVs [32]byte) (*types.Transaction, error) { + return _CommitStore.Contract.Transmit(&_CommitStore.TransactOpts, reportContext, report, rs, ss, rawVs) +} + +func (_CommitStore *CommitStoreTransactorSession) Transmit(reportContext [3][32]byte, report []byte, rs [][32]byte, ss [][32]byte, rawVs [32]byte) (*types.Transaction, error) { + return _CommitStore.Contract.Transmit(&_CommitStore.TransactOpts, reportContext, report, rs, ss, rawVs) +} + +func (_CommitStore *CommitStoreTransactor) Unpause(opts *bind.TransactOpts) (*types.Transaction, error) { + return _CommitStore.contract.Transact(opts, "unpause") +} + +func (_CommitStore *CommitStoreSession) Unpause() (*types.Transaction, error) { + return _CommitStore.Contract.Unpause(&_CommitStore.TransactOpts) +} + +func (_CommitStore *CommitStoreTransactorSession) Unpause() (*types.Transaction, error) { + return _CommitStore.Contract.Unpause(&_CommitStore.TransactOpts) +} + +type CommitStoreConfigSetIterator struct { + Event *CommitStoreConfigSet + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *CommitStoreConfigSetIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(CommitStoreConfigSet) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(CommitStoreConfigSet) + 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() + } +} + +func (it *CommitStoreConfigSetIterator) Error() error { + return it.fail +} + +func (it *CommitStoreConfigSetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type CommitStoreConfigSet struct { + StaticConfig CommitStoreStaticConfig + DynamicConfig CommitStoreDynamicConfig + Raw types.Log +} + +func (_CommitStore *CommitStoreFilterer) FilterConfigSet(opts *bind.FilterOpts) (*CommitStoreConfigSetIterator, error) { + + logs, sub, err := _CommitStore.contract.FilterLogs(opts, "ConfigSet") + if err != nil { + return nil, err + } + return &CommitStoreConfigSetIterator{contract: _CommitStore.contract, event: "ConfigSet", logs: logs, sub: sub}, nil +} + +func (_CommitStore *CommitStoreFilterer) WatchConfigSet(opts *bind.WatchOpts, sink chan<- *CommitStoreConfigSet) (event.Subscription, error) { + + logs, sub, err := _CommitStore.contract.WatchLogs(opts, "ConfigSet") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(CommitStoreConfigSet) + if err := _CommitStore.contract.UnpackLog(event, "ConfigSet", 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 +} + +func (_CommitStore *CommitStoreFilterer) ParseConfigSet(log types.Log) (*CommitStoreConfigSet, error) { + event := new(CommitStoreConfigSet) + if err := _CommitStore.contract.UnpackLog(event, "ConfigSet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type CommitStoreConfigSet0Iterator struct { + Event *CommitStoreConfigSet0 + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *CommitStoreConfigSet0Iterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(CommitStoreConfigSet0) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(CommitStoreConfigSet0) + 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() + } +} + +func (it *CommitStoreConfigSet0Iterator) Error() error { + return it.fail +} + +func (it *CommitStoreConfigSet0Iterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type CommitStoreConfigSet0 struct { + PreviousConfigBlockNumber uint32 + ConfigDigest [32]byte + ConfigCount uint64 + Signers []common.Address + Transmitters []common.Address + F uint8 + OnchainConfig []byte + OffchainConfigVersion uint64 + OffchainConfig []byte + Raw types.Log +} + +func (_CommitStore *CommitStoreFilterer) FilterConfigSet0(opts *bind.FilterOpts) (*CommitStoreConfigSet0Iterator, error) { + + logs, sub, err := _CommitStore.contract.FilterLogs(opts, "ConfigSet0") + if err != nil { + return nil, err + } + return &CommitStoreConfigSet0Iterator{contract: _CommitStore.contract, event: "ConfigSet0", logs: logs, sub: sub}, nil +} + +func (_CommitStore *CommitStoreFilterer) WatchConfigSet0(opts *bind.WatchOpts, sink chan<- *CommitStoreConfigSet0) (event.Subscription, error) { + + logs, sub, err := _CommitStore.contract.WatchLogs(opts, "ConfigSet0") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(CommitStoreConfigSet0) + if err := _CommitStore.contract.UnpackLog(event, "ConfigSet0", 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 +} + +func (_CommitStore *CommitStoreFilterer) ParseConfigSet0(log types.Log) (*CommitStoreConfigSet0, error) { + event := new(CommitStoreConfigSet0) + if err := _CommitStore.contract.UnpackLog(event, "ConfigSet0", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type CommitStoreOwnershipTransferRequestedIterator struct { + Event *CommitStoreOwnershipTransferRequested + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *CommitStoreOwnershipTransferRequestedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(CommitStoreOwnershipTransferRequested) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(CommitStoreOwnershipTransferRequested) + 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() + } +} + +func (it *CommitStoreOwnershipTransferRequestedIterator) Error() error { + return it.fail +} + +func (it *CommitStoreOwnershipTransferRequestedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type CommitStoreOwnershipTransferRequested struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_CommitStore *CommitStoreFilterer) FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*CommitStoreOwnershipTransferRequestedIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _CommitStore.contract.FilterLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return &CommitStoreOwnershipTransferRequestedIterator{contract: _CommitStore.contract, event: "OwnershipTransferRequested", logs: logs, sub: sub}, nil +} + +func (_CommitStore *CommitStoreFilterer) WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *CommitStoreOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _CommitStore.contract.WatchLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(CommitStoreOwnershipTransferRequested) + if err := _CommitStore.contract.UnpackLog(event, "OwnershipTransferRequested", 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 +} + +func (_CommitStore *CommitStoreFilterer) ParseOwnershipTransferRequested(log types.Log) (*CommitStoreOwnershipTransferRequested, error) { + event := new(CommitStoreOwnershipTransferRequested) + if err := _CommitStore.contract.UnpackLog(event, "OwnershipTransferRequested", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type CommitStoreOwnershipTransferredIterator struct { + Event *CommitStoreOwnershipTransferred + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *CommitStoreOwnershipTransferredIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(CommitStoreOwnershipTransferred) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(CommitStoreOwnershipTransferred) + 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() + } +} + +func (it *CommitStoreOwnershipTransferredIterator) Error() error { + return it.fail +} + +func (it *CommitStoreOwnershipTransferredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type CommitStoreOwnershipTransferred struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_CommitStore *CommitStoreFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*CommitStoreOwnershipTransferredIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _CommitStore.contract.FilterLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return &CommitStoreOwnershipTransferredIterator{contract: _CommitStore.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil +} + +func (_CommitStore *CommitStoreFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *CommitStoreOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _CommitStore.contract.WatchLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(CommitStoreOwnershipTransferred) + if err := _CommitStore.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 +} + +func (_CommitStore *CommitStoreFilterer) ParseOwnershipTransferred(log types.Log) (*CommitStoreOwnershipTransferred, error) { + event := new(CommitStoreOwnershipTransferred) + if err := _CommitStore.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type CommitStorePausedIterator struct { + Event *CommitStorePaused + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *CommitStorePausedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(CommitStorePaused) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(CommitStorePaused) + 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() + } +} + +func (it *CommitStorePausedIterator) Error() error { + return it.fail +} + +func (it *CommitStorePausedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type CommitStorePaused struct { + Account common.Address + Raw types.Log +} + +func (_CommitStore *CommitStoreFilterer) FilterPaused(opts *bind.FilterOpts) (*CommitStorePausedIterator, error) { + + logs, sub, err := _CommitStore.contract.FilterLogs(opts, "Paused") + if err != nil { + return nil, err + } + return &CommitStorePausedIterator{contract: _CommitStore.contract, event: "Paused", logs: logs, sub: sub}, nil +} + +func (_CommitStore *CommitStoreFilterer) WatchPaused(opts *bind.WatchOpts, sink chan<- *CommitStorePaused) (event.Subscription, error) { + + logs, sub, err := _CommitStore.contract.WatchLogs(opts, "Paused") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(CommitStorePaused) + if err := _CommitStore.contract.UnpackLog(event, "Paused", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +func (_CommitStore *CommitStoreFilterer) ParsePaused(log types.Log) (*CommitStorePaused, error) { + event := new(CommitStorePaused) + if err := _CommitStore.contract.UnpackLog(event, "Paused", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type CommitStoreReportAcceptedIterator struct { + Event *CommitStoreReportAccepted + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *CommitStoreReportAcceptedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(CommitStoreReportAccepted) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(CommitStoreReportAccepted) + 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() + } +} + +func (it *CommitStoreReportAcceptedIterator) Error() error { + return it.fail +} + +func (it *CommitStoreReportAcceptedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type CommitStoreReportAccepted struct { + Report CommitStoreCommitReport + Raw types.Log +} + +func (_CommitStore *CommitStoreFilterer) FilterReportAccepted(opts *bind.FilterOpts) (*CommitStoreReportAcceptedIterator, error) { + + logs, sub, err := _CommitStore.contract.FilterLogs(opts, "ReportAccepted") + if err != nil { + return nil, err + } + return &CommitStoreReportAcceptedIterator{contract: _CommitStore.contract, event: "ReportAccepted", logs: logs, sub: sub}, nil +} + +func (_CommitStore *CommitStoreFilterer) WatchReportAccepted(opts *bind.WatchOpts, sink chan<- *CommitStoreReportAccepted) (event.Subscription, error) { + + logs, sub, err := _CommitStore.contract.WatchLogs(opts, "ReportAccepted") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(CommitStoreReportAccepted) + if err := _CommitStore.contract.UnpackLog(event, "ReportAccepted", 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 +} + +func (_CommitStore *CommitStoreFilterer) ParseReportAccepted(log types.Log) (*CommitStoreReportAccepted, error) { + event := new(CommitStoreReportAccepted) + if err := _CommitStore.contract.UnpackLog(event, "ReportAccepted", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type CommitStoreRootRemovedIterator struct { + Event *CommitStoreRootRemoved + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *CommitStoreRootRemovedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(CommitStoreRootRemoved) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(CommitStoreRootRemoved) + 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() + } +} + +func (it *CommitStoreRootRemovedIterator) Error() error { + return it.fail +} + +func (it *CommitStoreRootRemovedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type CommitStoreRootRemoved struct { + Root [32]byte + Raw types.Log +} + +func (_CommitStore *CommitStoreFilterer) FilterRootRemoved(opts *bind.FilterOpts) (*CommitStoreRootRemovedIterator, error) { + + logs, sub, err := _CommitStore.contract.FilterLogs(opts, "RootRemoved") + if err != nil { + return nil, err + } + return &CommitStoreRootRemovedIterator{contract: _CommitStore.contract, event: "RootRemoved", logs: logs, sub: sub}, nil +} + +func (_CommitStore *CommitStoreFilterer) WatchRootRemoved(opts *bind.WatchOpts, sink chan<- *CommitStoreRootRemoved) (event.Subscription, error) { + + logs, sub, err := _CommitStore.contract.WatchLogs(opts, "RootRemoved") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(CommitStoreRootRemoved) + if err := _CommitStore.contract.UnpackLog(event, "RootRemoved", 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 +} + +func (_CommitStore *CommitStoreFilterer) ParseRootRemoved(log types.Log) (*CommitStoreRootRemoved, error) { + event := new(CommitStoreRootRemoved) + if err := _CommitStore.contract.UnpackLog(event, "RootRemoved", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type CommitStoreTransmittedIterator struct { + Event *CommitStoreTransmitted + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *CommitStoreTransmittedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(CommitStoreTransmitted) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(CommitStoreTransmitted) + 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() + } +} + +func (it *CommitStoreTransmittedIterator) Error() error { + return it.fail +} + +func (it *CommitStoreTransmittedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type CommitStoreTransmitted struct { + ConfigDigest [32]byte + Epoch uint32 + Raw types.Log +} + +func (_CommitStore *CommitStoreFilterer) FilterTransmitted(opts *bind.FilterOpts) (*CommitStoreTransmittedIterator, error) { + + logs, sub, err := _CommitStore.contract.FilterLogs(opts, "Transmitted") + if err != nil { + return nil, err + } + return &CommitStoreTransmittedIterator{contract: _CommitStore.contract, event: "Transmitted", logs: logs, sub: sub}, nil +} + +func (_CommitStore *CommitStoreFilterer) WatchTransmitted(opts *bind.WatchOpts, sink chan<- *CommitStoreTransmitted) (event.Subscription, error) { + + logs, sub, err := _CommitStore.contract.WatchLogs(opts, "Transmitted") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(CommitStoreTransmitted) + if err := _CommitStore.contract.UnpackLog(event, "Transmitted", 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 +} + +func (_CommitStore *CommitStoreFilterer) ParseTransmitted(log types.Log) (*CommitStoreTransmitted, error) { + event := new(CommitStoreTransmitted) + if err := _CommitStore.contract.UnpackLog(event, "Transmitted", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type CommitStoreUnpausedIterator struct { + Event *CommitStoreUnpaused + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *CommitStoreUnpausedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(CommitStoreUnpaused) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(CommitStoreUnpaused) + 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() + } +} + +func (it *CommitStoreUnpausedIterator) Error() error { + return it.fail +} + +func (it *CommitStoreUnpausedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type CommitStoreUnpaused struct { + Account common.Address + Raw types.Log +} + +func (_CommitStore *CommitStoreFilterer) FilterUnpaused(opts *bind.FilterOpts) (*CommitStoreUnpausedIterator, error) { + + logs, sub, err := _CommitStore.contract.FilterLogs(opts, "Unpaused") + if err != nil { + return nil, err + } + return &CommitStoreUnpausedIterator{contract: _CommitStore.contract, event: "Unpaused", logs: logs, sub: sub}, nil +} + +func (_CommitStore *CommitStoreFilterer) WatchUnpaused(opts *bind.WatchOpts, sink chan<- *CommitStoreUnpaused) (event.Subscription, error) { + + logs, sub, err := _CommitStore.contract.WatchLogs(opts, "Unpaused") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(CommitStoreUnpaused) + if err := _CommitStore.contract.UnpackLog(event, "Unpaused", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +func (_CommitStore *CommitStoreFilterer) ParseUnpaused(log types.Log) (*CommitStoreUnpaused, error) { + event := new(CommitStoreUnpaused) + if err := _CommitStore.contract.UnpackLog(event, "Unpaused", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type LatestConfigDetails struct { + ConfigCount uint32 + BlockNumber uint32 + ConfigDigest [32]byte +} +type LatestConfigDigestAndEpoch struct { + ScanLogs bool + ConfigDigest [32]byte + Epoch uint32 +} + +func (_CommitStore *CommitStore) ParseLog(log types.Log) (generated.AbigenLog, error) { + switch log.Topics[0] { + case _CommitStore.abi.Events["ConfigSet"].ID: + return _CommitStore.ParseConfigSet(log) + case _CommitStore.abi.Events["ConfigSet0"].ID: + return _CommitStore.ParseConfigSet0(log) + case _CommitStore.abi.Events["OwnershipTransferRequested"].ID: + return _CommitStore.ParseOwnershipTransferRequested(log) + case _CommitStore.abi.Events["OwnershipTransferred"].ID: + return _CommitStore.ParseOwnershipTransferred(log) + case _CommitStore.abi.Events["Paused"].ID: + return _CommitStore.ParsePaused(log) + case _CommitStore.abi.Events["ReportAccepted"].ID: + return _CommitStore.ParseReportAccepted(log) + case _CommitStore.abi.Events["RootRemoved"].ID: + return _CommitStore.ParseRootRemoved(log) + case _CommitStore.abi.Events["Transmitted"].ID: + return _CommitStore.ParseTransmitted(log) + case _CommitStore.abi.Events["Unpaused"].ID: + return _CommitStore.ParseUnpaused(log) + + default: + return nil, fmt.Errorf("abigen wrapper received unknown log topic: %v", log.Topics[0]) + } +} + +func (CommitStoreConfigSet) Topic() common.Hash { + return common.HexToHash("0xc9d7123efd4203e60b0f0a4b1dbc4800fc97ce63679f71c3a27279b24a7ddec3") +} + +func (CommitStoreConfigSet0) Topic() common.Hash { + return common.HexToHash("0x1591690b8638f5fb2dbec82ac741805ac5da8b45dc5263f4875b0496fdce4e05") +} + +func (CommitStoreOwnershipTransferRequested) Topic() common.Hash { + return common.HexToHash("0xed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae1278") +} + +func (CommitStoreOwnershipTransferred) Topic() common.Hash { + return common.HexToHash("0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0") +} + +func (CommitStorePaused) Topic() common.Hash { + return common.HexToHash("0x62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258") +} + +func (CommitStoreReportAccepted) Topic() common.Hash { + return common.HexToHash("0xe81b49e583122eb290c46fc255c962b9a2dec468816c00fb7a2e6ebc42dc92d4") +} + +func (CommitStoreRootRemoved) Topic() common.Hash { + return common.HexToHash("0x202f1139a3e334b6056064c0e9b19fd07e44a88d8f6e5ded571b24cf8c371f12") +} + +func (CommitStoreTransmitted) Topic() common.Hash { + return common.HexToHash("0xb04e63db38c49950639fa09d29872f21f5d49d614f3a969d8adf3d4b52e41a62") +} + +func (CommitStoreUnpaused) Topic() common.Hash { + return common.HexToHash("0x5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa") +} + +func (_CommitStore *CommitStore) Address() common.Address { + return _CommitStore.address +} + +type CommitStoreInterface interface { + GetDynamicConfig(opts *bind.CallOpts) (CommitStoreDynamicConfig, error) + + GetExpectedNextSequenceNumber(opts *bind.CallOpts) (uint64, error) + + GetLatestPriceEpochAndRound(opts *bind.CallOpts) (uint64, error) + + GetMerkleRoot(opts *bind.CallOpts, root [32]byte) (*big.Int, error) + + GetStaticConfig(opts *bind.CallOpts) (CommitStoreStaticConfig, error) + + GetTransmitters(opts *bind.CallOpts) ([]common.Address, error) + + IsARMHealthy(opts *bind.CallOpts) (bool, error) + + IsBlessed(opts *bind.CallOpts, root [32]byte) (bool, error) + + IsUnpausedAndARMHealthy(opts *bind.CallOpts) (bool, error) + + LatestConfigDetails(opts *bind.CallOpts) (LatestConfigDetails, + + error) + + LatestConfigDigestAndEpoch(opts *bind.CallOpts) (LatestConfigDigestAndEpoch, + + error) + + Owner(opts *bind.CallOpts) (common.Address, error) + + Paused(opts *bind.CallOpts) (bool, error) + + TypeAndVersion(opts *bind.CallOpts) (string, error) + + Verify(opts *bind.CallOpts, hashedLeaves [][32]byte, proofs [][32]byte, proofFlagBits *big.Int) (*big.Int, error) + + AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) + + Pause(opts *bind.TransactOpts) (*types.Transaction, error) + + ResetUnblessedRoots(opts *bind.TransactOpts, rootToReset [][32]byte) (*types.Transaction, error) + + SetLatestPriceEpochAndRound(opts *bind.TransactOpts, latestPriceEpochAndRound *big.Int) (*types.Transaction, error) + + SetMinSeqNr(opts *bind.TransactOpts, minSeqNr uint64) (*types.Transaction, error) + + SetOCR2Config(opts *bind.TransactOpts, signers []common.Address, transmitters []common.Address, f uint8, onchainConfig []byte, offchainConfigVersion uint64, offchainConfig []byte) (*types.Transaction, error) + + TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) + + Transmit(opts *bind.TransactOpts, reportContext [3][32]byte, report []byte, rs [][32]byte, ss [][32]byte, rawVs [32]byte) (*types.Transaction, error) + + Unpause(opts *bind.TransactOpts) (*types.Transaction, error) + + FilterConfigSet(opts *bind.FilterOpts) (*CommitStoreConfigSetIterator, error) + + WatchConfigSet(opts *bind.WatchOpts, sink chan<- *CommitStoreConfigSet) (event.Subscription, error) + + ParseConfigSet(log types.Log) (*CommitStoreConfigSet, error) + + FilterConfigSet0(opts *bind.FilterOpts) (*CommitStoreConfigSet0Iterator, error) + + WatchConfigSet0(opts *bind.WatchOpts, sink chan<- *CommitStoreConfigSet0) (event.Subscription, error) + + ParseConfigSet0(log types.Log) (*CommitStoreConfigSet0, error) + + FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*CommitStoreOwnershipTransferRequestedIterator, error) + + WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *CommitStoreOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferRequested(log types.Log) (*CommitStoreOwnershipTransferRequested, error) + + FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*CommitStoreOwnershipTransferredIterator, error) + + WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *CommitStoreOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferred(log types.Log) (*CommitStoreOwnershipTransferred, error) + + FilterPaused(opts *bind.FilterOpts) (*CommitStorePausedIterator, error) + + WatchPaused(opts *bind.WatchOpts, sink chan<- *CommitStorePaused) (event.Subscription, error) + + ParsePaused(log types.Log) (*CommitStorePaused, error) + + FilterReportAccepted(opts *bind.FilterOpts) (*CommitStoreReportAcceptedIterator, error) + + WatchReportAccepted(opts *bind.WatchOpts, sink chan<- *CommitStoreReportAccepted) (event.Subscription, error) + + ParseReportAccepted(log types.Log) (*CommitStoreReportAccepted, error) + + FilterRootRemoved(opts *bind.FilterOpts) (*CommitStoreRootRemovedIterator, error) + + WatchRootRemoved(opts *bind.WatchOpts, sink chan<- *CommitStoreRootRemoved) (event.Subscription, error) + + ParseRootRemoved(log types.Log) (*CommitStoreRootRemoved, error) + + FilterTransmitted(opts *bind.FilterOpts) (*CommitStoreTransmittedIterator, error) + + WatchTransmitted(opts *bind.WatchOpts, sink chan<- *CommitStoreTransmitted) (event.Subscription, error) + + ParseTransmitted(log types.Log) (*CommitStoreTransmitted, error) + + FilterUnpaused(opts *bind.FilterOpts) (*CommitStoreUnpausedIterator, error) + + WatchUnpaused(opts *bind.WatchOpts, sink chan<- *CommitStoreUnpaused) (event.Subscription, error) + + ParseUnpaused(log types.Log) (*CommitStoreUnpaused, error) + + ParseLog(log types.Log) (generated.AbigenLog, error) + + Address() common.Address +} diff --git a/core/gethwrappers/ccip/generated/commit_store_1_2_0/commit_store.go b/core/gethwrappers/ccip/generated/commit_store_1_2_0/commit_store.go new file mode 100644 index 00000000000..fa757f287d3 --- /dev/null +++ b/core/gethwrappers/ccip/generated/commit_store_1_2_0/commit_store.go @@ -0,0 +1,1955 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package commit_store_1_2_0 + +import ( + "errors" + "fmt" + "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" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" +) + +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +type CommitStoreCommitReport struct { + PriceUpdates InternalPriceUpdates + Interval CommitStoreInterval + MerkleRoot [32]byte +} + +type CommitStoreDynamicConfig struct { + PriceRegistry common.Address +} + +type CommitStoreInterval struct { + Min uint64 + Max uint64 +} + +type CommitStoreStaticConfig struct { + ChainSelector uint64 + SourceChainSelector uint64 + OnRamp common.Address + ArmProxy common.Address +} + +type InternalGasPriceUpdate struct { + DestChainSelector uint64 + UsdPerUnitGas *big.Int +} + +type InternalPriceUpdates struct { + TokenPriceUpdates []InternalTokenPriceUpdate + GasPriceUpdates []InternalGasPriceUpdate +} + +type InternalTokenPriceUpdate struct { + SourceToken common.Address + UsdPerToken *big.Int +} + +var CommitStoreMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"onRamp\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"armProxy\",\"type\":\"address\"}],\"internalType\":\"structCommitStore.StaticConfig\",\"name\":\"staticConfig\",\"type\":\"tuple\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"BadARMSignal\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"expected\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"actual\",\"type\":\"bytes32\"}],\"name\":\"ConfigDigestMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expected\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"actual\",\"type\":\"uint256\"}],\"name\":\"ForkedChain\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidCommitStoreConfig\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"message\",\"type\":\"string\"}],\"name\":\"InvalidConfig\",\"type\":\"error\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"min\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"max\",\"type\":\"uint64\"}],\"internalType\":\"structCommitStore.Interval\",\"name\":\"interval\",\"type\":\"tuple\"}],\"name\":\"InvalidInterval\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidProof\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidRoot\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"LeavesCannotBeEmpty\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NonUniqueSignatures\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OracleCannotBeZeroAddress\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"PausedError\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RootAlreadyCommitted\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"SignaturesOutOfRegistration\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"StaleReport\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UnauthorizedSigner\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UnauthorizedTransmitter\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expected\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"actual\",\"type\":\"uint256\"}],\"name\":\"WrongMessageLength\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"WrongNumberOfSignatures\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"onRamp\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"armProxy\",\"type\":\"address\"}],\"indexed\":false,\"internalType\":\"structCommitStore.StaticConfig\",\"name\":\"staticConfig\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"priceRegistry\",\"type\":\"address\"}],\"indexed\":false,\"internalType\":\"structCommitStore.DynamicConfig\",\"name\":\"dynamicConfig\",\"type\":\"tuple\"}],\"name\":\"ConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"previousConfigBlockNumber\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"configCount\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"signers\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"transmitters\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"f\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"onchainConfig\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"offchainConfigVersion\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"offchainConfig\",\"type\":\"bytes\"}],\"name\":\"ConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"Paused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"components\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"sourceToken\",\"type\":\"address\"},{\"internalType\":\"uint224\",\"name\":\"usdPerToken\",\"type\":\"uint224\"}],\"internalType\":\"structInternal.TokenPriceUpdate[]\",\"name\":\"tokenPriceUpdates\",\"type\":\"tuple[]\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint224\",\"name\":\"usdPerUnitGas\",\"type\":\"uint224\"}],\"internalType\":\"structInternal.GasPriceUpdate[]\",\"name\":\"gasPriceUpdates\",\"type\":\"tuple[]\"}],\"internalType\":\"structInternal.PriceUpdates\",\"name\":\"priceUpdates\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"min\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"max\",\"type\":\"uint64\"}],\"internalType\":\"structCommitStore.Interval\",\"name\":\"interval\",\"type\":\"tuple\"},{\"internalType\":\"bytes32\",\"name\":\"merkleRoot\",\"type\":\"bytes32\"}],\"indexed\":false,\"internalType\":\"structCommitStore.CommitReport\",\"name\":\"report\",\"type\":\"tuple\"}],\"name\":\"ReportAccepted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"root\",\"type\":\"bytes32\"}],\"name\":\"RootRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"epoch\",\"type\":\"uint32\"}],\"name\":\"Transmitted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"Unpaused\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getDynamicConfig\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"priceRegistry\",\"type\":\"address\"}],\"internalType\":\"structCommitStore.DynamicConfig\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getExpectedNextSequenceNumber\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getLatestPriceEpochAndRound\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"root\",\"type\":\"bytes32\"}],\"name\":\"getMerkleRoot\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getStaticConfig\",\"outputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"onRamp\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"armProxy\",\"type\":\"address\"}],\"internalType\":\"structCommitStore.StaticConfig\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getTransmitters\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isARMHealthy\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"root\",\"type\":\"bytes32\"}],\"name\":\"isBlessed\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isUnpausedAndARMHealthy\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestConfigDetails\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"configCount\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"blockNumber\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestConfigDigestAndEpoch\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"scanLogs\",\"type\":\"bool\"},{\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"internalType\":\"uint32\",\"name\":\"epoch\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"paused\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32[]\",\"name\":\"rootToReset\",\"type\":\"bytes32[]\"}],\"name\":\"resetUnblessedRoots\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint40\",\"name\":\"latestPriceEpochAndRound\",\"type\":\"uint40\"}],\"name\":\"setLatestPriceEpochAndRound\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"minSeqNr\",\"type\":\"uint64\"}],\"name\":\"setMinSeqNr\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"signers\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"transmitters\",\"type\":\"address[]\"},{\"internalType\":\"uint8\",\"name\":\"f\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"onchainConfig\",\"type\":\"bytes\"},{\"internalType\":\"uint64\",\"name\":\"offchainConfigVersion\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"offchainConfig\",\"type\":\"bytes\"}],\"name\":\"setOCR2Config\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32[3]\",\"name\":\"reportContext\",\"type\":\"bytes32[3]\"},{\"internalType\":\"bytes\",\"name\":\"report\",\"type\":\"bytes\"},{\"internalType\":\"bytes32[]\",\"name\":\"rs\",\"type\":\"bytes32[]\"},{\"internalType\":\"bytes32[]\",\"name\":\"ss\",\"type\":\"bytes32[]\"},{\"internalType\":\"bytes32\",\"name\":\"rawVs\",\"type\":\"bytes32\"}],\"name\":\"transmit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"unpause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32[]\",\"name\":\"hashedLeaves\",\"type\":\"bytes32[]\"},{\"internalType\":\"bytes32[]\",\"name\":\"proofs\",\"type\":\"bytes32[]\"},{\"internalType\":\"uint256\",\"name\":\"proofFlagBits\",\"type\":\"uint256\"}],\"name\":\"verify\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", + Bin: "0x61014060405260098054600165ff000000000160401b03191660011790553480156200002a57600080fd5b506040516200384c3803806200384c8339810160408190526200004d9162000272565b600033808281620000a55760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000d857620000d88162000192565b50505015156080524660a05260408101516001600160a01b0316158062000107575080516001600160401b0316155b806200011e575060208101516001600160401b0316155b8062000135575060608101516001600160a01b0316155b156200015457604051631fc5f15f60e11b815260040160405180910390fd5b80516001600160401b0390811660c05260208201511660e05260408101516001600160a01b0390811661010052606090910151166101205262000306565b336001600160a01b03821603620001ec5760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c6600000000000000000060448201526064016200009c565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b80516001600160401b03811681146200025557600080fd5b919050565b80516001600160a01b03811681146200025557600080fd5b6000608082840312156200028557600080fd5b604051608081016001600160401b0381118282101715620002b657634e487b7160e01b600052604160045260246000fd5b604052620002c4836200023d565b8152620002d4602084016200023d565b6020820152620002e7604084016200025a565b6040820152620002fa606084016200025a565b60608201529392505050565b60805160a05160c05160e05161010051610120516134b7620003956000396000818161026d01528181610537015281816111730152818161199f01528181611bee015261206b0152600081816102310152611bc70152600081816102010152611ba00152600081816101d10152611b710152600081816112ee015261133a015260006113b501526134b76000f3fe608060405234801561001057600080fd5b50600436106101985760003560e01c806379ba5097116100e3578063ad7a22f81161008c578063f2fde38b11610066578063f2fde38b146104fa578063f47a86901461050d578063ff888fb11461052057600080fd5b8063ad7a22f8146104b4578063afcb95d7146104c7578063b1dc65a4146104e757600080fd5b80638da5cb5b116100bd5780638da5cb5b146104645780638db94e441461048c578063a7206cd61461049457600080fd5b806379ba50971461042457806381ff70481461042c5780638456cb591461045c57600080fd5b806332048875116101455780635c975abb1161011f5780635c975abb146103b4578063666cab8d146103d05780637437ff9f146103e557600080fd5b806332048875146103795780633f4ba83a1461039a5780634120fccd146103a257600080fd5b8063181f5a7711610176578063181f5a77146103085780631ef381741461035157806329b980e41461036657600080fd5b806306285c691461019d5780630a6cd30d146102c057806310c374ed146102d8575b600080fd5b6102aa60408051608081018252600080825260208201819052918101829052606081019190915260405180608001604052807f000000000000000000000000000000000000000000000000000000000000000067ffffffffffffffff1681526020017f000000000000000000000000000000000000000000000000000000000000000067ffffffffffffffff1681526020017f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1681526020017f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16815250905090565b6040516102b79190612656565b60405180910390f35b6102c8610533565b60405190151581526020016102b7565b60095468010000000000000000900464ffffffffff165b60405167ffffffffffffffff90911681526020016102b7565b6103446040518060400160405280601181526020017f436f6d6d697453746f726520312e322e3000000000000000000000000000000081525081565b6040516102b79190612713565b61036461035f366004612966565b6105ca565b005b610364610374366004612a33565b610deb565b61038c610387366004612aa6565b610e37565b6040519081526020016102b7565b610364610f2d565b60095467ffffffffffffffff166102ef565b6009546d0100000000000000000000000000900460ff166102c8565b6103d8610f93565b6040516102b79190612b6b565b604080516020808201835260009091528151808201835260085473ffffffffffffffffffffffffffffffffffffffff16908190529151918252016102b7565b610364611002565b6004546002546040805163ffffffff808516825264010000000090940490931660208401528201526060016102b7565b6103646110ff565b60005460405173ffffffffffffffffffffffffffffffffffffffff90911681526020016102b7565b6102c861116f565b61038c6104a2366004612b7e565b6000908152600a602052604090205490565b6103646104c2366004612b97565b611226565b6040805160018152600060208201819052918101919091526060016102b7565b6103646104f5366004612bb2565b611269565b610364610508366004612c97565b611889565b61036461051b366004612cb4565b61189d565b6102c861052e366004612b7e565b61193c565b60007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663397796f76040518163ffffffff1660e01b8152600401602060405180830381865afa1580156105a0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105c49190612cf6565b15905090565b855185518560ff16601f831115610642576040517f89a6198900000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f746f6f206d616e79207369676e6572730000000000000000000000000000000060448201526064015b60405180910390fd5b806000036106ac576040517f89a6198900000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f66206d75737420626520706f73697469766500000000000000000000000000006044820152606401610639565b81831461073a576040517f89a61989000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f6f7261636c6520616464726573736573206f7574206f6620726567697374726160448201527f74696f6e000000000000000000000000000000000000000000000000000000006064820152608401610639565b610745816003612d47565b83116107ad576040517f89a6198900000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f6661756c74792d6f7261636c65206620746f6f206869676800000000000000006044820152606401610639565b6107b5611a10565b6107be86611a93565b60065460005b818110156108ba5760056000600683815481106107e3576107e3612d5e565b600091825260208083209091015473ffffffffffffffffffffffffffffffffffffffff168352820192909252604001812080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00001690556007805460059291908490811061085357610853612d5e565b600091825260208083209091015473ffffffffffffffffffffffffffffffffffffffff168352820192909252604001902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00001690556108b381612d8d565b90506107c4565b50895160005b81811015610c935760008c82815181106108dc576108dc612d5e565b60200260200101519050600060028111156108f9576108f9612dc5565b73ffffffffffffffffffffffffffffffffffffffff8216600090815260056020526040902054610100900460ff16600281111561093857610938612dc5565b1461099f576040517f89a6198900000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f7265706561746564207369676e657220616464726573730000000000000000006044820152606401610639565b73ffffffffffffffffffffffffffffffffffffffff81166109ec576040517fd6c62c9b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040805180820190915260ff83168152602081016001905273ffffffffffffffffffffffffffffffffffffffff821660009081526005602090815260409091208251815460ff9091167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0082168117835592840151919283917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00001617610100836002811115610a9c57610a9c612dc5565b021790555090505060008c8381518110610ab857610ab8612d5e565b6020026020010151905060006002811115610ad557610ad5612dc5565b73ffffffffffffffffffffffffffffffffffffffff8216600090815260056020526040902054610100900460ff166002811115610b1457610b14612dc5565b14610b7b576040517f89a6198900000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f7265706561746564207472616e736d69747465722061646472657373000000006044820152606401610639565b73ffffffffffffffffffffffffffffffffffffffff8116610bc8576040517fd6c62c9b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040805180820190915260ff84168152602081016002905273ffffffffffffffffffffffffffffffffffffffff821660009081526005602090815260409091208251815460ff9091167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0082168117835592840151919283917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00001617610100836002811115610c7857610c78612dc5565b0217905550905050505080610c8c90612d8d565b90506108c0565b508a51610ca79060069060208e0190612598565b508951610cbb9060079060208d0190612598565b506003805460ff838116610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000909216908c161717905560048054610d41914691309190600090610d139063ffffffff16612df4565b91906101000a81548163ffffffff021916908363ffffffff160217905563ffffffff168e8e8e8e8e8e611c4f565b600260000181905550600060048054906101000a900463ffffffff169050436004806101000a81548163ffffffff021916908363ffffffff1602179055507f1591690b8638f5fb2dbec82ac741805ac5da8b45dc5263f4875b0496fdce4e0581600260000154600460009054906101000a900463ffffffff168f8f8f8f8f8f604051610dd599989796959493929190612e17565b60405180910390a1505050505050505050505050565b610df3611a10565b6009805464ffffffffff90921668010000000000000000027fffffffffffffffffffffffffffffffffffffff0000000000ffffffffffffffff909216919091179055565b6009546000906d0100000000000000000000000000900460ff1615610e88576040517feced32bc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000610ef987878080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808b0282810182019093528a82529093508a925089918291850190849080828437600092019190915250889250611cfa915050565b9050610f048161193c565b610f12576000915050610f24565b6000908152600a602052604090205490505b95945050505050565b610f35611a10565b600980547fffffffffffffffffffffffffffffffffffff00ffffffffffffffffffffffffff1690556040513381527f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa906020015b60405180910390a1565b60606007805480602002602001604051908101604052809291908181526020018280548015610ff857602002820191906000526020600020905b815473ffffffffffffffffffffffffffffffffffffffff168152600190910190602001808311610fcd575b5050505050905090565b60015473ffffffffffffffffffffffffffffffffffffffff163314611083576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e6572000000000000000000006044820152606401610639565b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b611107611a10565b600980547fffffffffffffffffffffffffffffffffffff00ffffffffffffffffffffffffff166d01000000000000000000000000001790556040513381527f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25890602001610f89565b60007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663397796f76040518163ffffffff1660e01b8152600401602060405180830381865afa1580156111dc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112009190612cf6565b15801561122157506009546d0100000000000000000000000000900460ff16155b905090565b61122e611a10565b600980547fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000001667ffffffffffffffff92909216919091179055565b611278878760208b013561201b565b6040805160608101825260025480825260035460ff8082166020850152610100909104169282019290925289359182146112eb5780516040517f93df584c000000000000000000000000000000000000000000000000000000008152600481019190915260248101839052604401610639565b467f00000000000000000000000000000000000000000000000000000000000000001461136c576040517f0f01ce850000000000000000000000000000000000000000000000000000000081527f00000000000000000000000000000000000000000000000000000000000000006004820152466024820152604401610639565b6040805183815260208c81013560081c63ffffffff16908201527fb04e63db38c49950639fa09d29872f21f5d49d614f3a969d8adf3d4b52e41a62910160405180910390a160007f00000000000000000000000000000000000000000000000000000000000000001561140e576002826020015183604001516113ef9190612ead565b6113f99190612ec6565b611404906001612ead565b60ff169050611424565b602082015161141e906001612ead565b60ff1690505b86811461145d576040517f71253a2500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b868514611496576040517fa75d88af00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b3360009081526005602090815260408083208151808301909252805460ff808216845292939192918401916101009091041660028111156114d9576114d9612dc5565b60028111156114ea576114ea612dc5565b905250905060028160200151600281111561150757611507612dc5565b14801561154e57506007816000015160ff168154811061152957611529612d5e565b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff1633145b611584576040517fda0f08e800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b506000611592866020612d47565b61159d896020612d47565b6115a98c610144612f0f565b6115b39190612f0f565b6115bd9190612f0f565b9050368114611601576040517f8e1192e100000000000000000000000000000000000000000000000000000000815260048101829052366024820152604401610639565b5060008a8a604051611614929190612f22565b60405190819003812061162b918e90602001612f32565b60405160208183030381529060405280519060200120905061164b612622565b8860005b818110156118785760006001858a846020811061166e5761166e612d5e565b61167b91901a601b612ead565b8f8f8681811061168d5761168d612d5e565b905060200201358e8e878181106116a6576116a6612d5e565b90506020020135604051600081526020016040526040516116e3949392919093845260ff9290921660208401526040830152606082015260800190565b6020604051602081039080840390855afa158015611705573d6000803e3d6000fd5b5050604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081015173ffffffffffffffffffffffffffffffffffffffff8116600090815260056020908152848220848601909552845460ff808216865293975091955092939284019161010090910416600281111561178857611788612dc5565b600281111561179957611799612dc5565b90525090506001816020015160028111156117b6576117b6612dc5565b146117ed576040517fca31867a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8051859060ff16601f811061180457611804612d5e565b602002015115611840576040517ff67bc7c400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600185826000015160ff16601f811061185b5761185b612d5e565b9115156020909202015250611871905081612d8d565b905061164f565b505050505050505050505050505050565b611891611a10565b61189a81612428565b50565b6118a5611a10565b60005b818110156119375760008383838181106118c4576118c4612d5e565b9050602002013590506118d68161193c565b611926576000818152600a602052604080822091909155517f202f1139a3e334b6056064c0e9b19fd07e44a88d8f6e5ded571b24cf8c371f129061191d9083815260200190565b60405180910390a15b5061193081612d8d565b90506118a8565b505050565b6040805180820182523081526020810183815291517f4d616771000000000000000000000000000000000000000000000000000000008152905173ffffffffffffffffffffffffffffffffffffffff9081166004830152915160248201526000917f00000000000000000000000000000000000000000000000000000000000000001690634d61677190604401602060405180830381865afa1580156119e6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a0a9190612cf6565b92915050565b60005473ffffffffffffffffffffffffffffffffffffffff163314611a91576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e6572000000000000000000006044820152606401610639565b565b600081806020019051810190611aa99190612f46565b805190915073ffffffffffffffffffffffffffffffffffffffff16611afa576040517f3f8be2be00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8051600880547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff928316179055600980547fffffffffffffffffffffffffffffffffffffff0000000000ffffffffffffffff169055604080516080810182527f000000000000000000000000000000000000000000000000000000000000000067ffffffffffffffff90811682527f00000000000000000000000000000000000000000000000000000000000000001660208201527f00000000000000000000000000000000000000000000000000000000000000008316818301527f00000000000000000000000000000000000000000000000000000000000000009092166060830152517fc9d7123efd4203e60b0f0a4b1dbc4800fc97ce63679f71c3a27279b24a7ddec391611c43918490612f92565b60405180910390a15050565b6000808a8a8a8a8a8a8a8a8a604051602001611c739998979695949392919061300f565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815291905280516020909101207dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167e01000000000000000000000000000000000000000000000000000000000000179150509998505050505050505050565b8251825160009190818303611d3b576040517f11a6b26400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6101018211801590611d4f57506101018111155b611d85576040517f09bde33900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82820101610100811115611de6576040517f09bde33900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80600003611e135786600081518110611e0157611e01612d5e565b60200260200101519350505050612014565b60008167ffffffffffffffff811115611e2e57611e2e612726565b604051908082528060200260200182016040528015611e57578160200160208202803683370190505b50905060008080805b85811015611f9a5760006001821b8b811603611ebb5788851015611ea4578c5160018601958e918110611e9557611e95612d5e565b60200260200101519050611edd565b8551600185019487918110611e9557611e95612d5e565b8b5160018401938d918110611ed257611ed2612d5e565b602002602001015190505b600089861015611f0d578d5160018701968f918110611efe57611efe612d5e565b60200260200101519050611f2f565b8651600186019588918110611f2457611f24612d5e565b602002602001015190505b82851115611f69576040517f09bde33900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611f73828261251d565b878481518110611f8557611f85612d5e565b60209081029190910101525050600101611e60565b506001850382148015611fac57508683145b8015611fb757508581145b611fed576040517f09bde33900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b83600186038151811061200257612002612d5e565b60200260200101519750505050505050505b9392505050565b6009546d0100000000000000000000000000900460ff1615612069576040517feced32bc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663397796f76040518163ffffffff1660e01b8152600401602060405180830381865afa1580156120d4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120f89190612cf6565b1561212f576040517fc148371500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600061213d8385018561319b565b8051515190915015158061215657508051602001515115155b1561228e5760095464ffffffffff8084166801000000000000000090920416101561225357600980547fffffffffffffffffffffffffffffffffffffff0000000000ffffffffffffffff166801000000000000000064ffffffffff85160217905560085481516040517f3937306f00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff90921691633937306f9161220d916004016133ee565b600060405180830381600087803b15801561222757600080fd5b505af115801561223b573d6000803e3d6000fd5b50505050604081015161224e5750505050565b61228e565b604081015161228e576040517ff803a2ca00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60208101515160095467ffffffffffffffff90811691161415806122c9575060208082015190810151905167ffffffffffffffff9182169116115b156123065780602001516040517fbb1ae18d0000000000000000000000000000000000000000000000000000000081526004016106399190613401565b6040810151612341576040517f504570e300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040808201516000908152600a60205220541561238a576040517fa0bce24f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b602080820151015161239d906001613426565b600980547fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000001667ffffffffffffffff929092169190911790556040818101516000908152600a602052819020429055517f291698c01aa71f912280535d88a00d2c59fb63530a3f5d0098560468acb9ebf59061241a90839061344e565b60405180910390a150505050565b3373ffffffffffffffffffffffffffffffffffffffff8216036124a7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c660000000000000000006044820152606401610639565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b600081831061255f5760408051600160208083019190915281830185905260608083018790528351808403909101815260809092019092528051910120612014565b60408051600160208083019190915281830186905260608083018690528351808403909101815260809092019092528051910120612014565b828054828255906000526020600020908101928215612612579160200282015b8281111561261257825182547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff9091161782556020909201916001909101906125b8565b5061261e929150612641565b5090565b604051806103e00160405280601f906020820280368337509192915050565b5b8082111561261e5760008155600101612642565b60808101611a0a828467ffffffffffffffff80825116835280602083015116602084015250604081015173ffffffffffffffffffffffffffffffffffffffff808216604085015280606084015116606085015250505050565b6000815180845260005b818110156126d5576020818501810151868301820152016126b9565b5060006020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b60208152600061201460208301846126af565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040805190810167ffffffffffffffff8111828210171561277857612778612726565b60405290565b6040516060810167ffffffffffffffff8111828210171561277857612778612726565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff811182821017156127e8576127e8612726565b604052919050565b600067ffffffffffffffff82111561280a5761280a612726565b5060051b60200190565b73ffffffffffffffffffffffffffffffffffffffff8116811461189a57600080fd5b600082601f83011261284757600080fd5b8135602061285c612857836127f0565b6127a1565b82815260059290921b8401810191818101908684111561287b57600080fd5b8286015b8481101561289f57803561289281612814565b835291830191830161287f565b509695505050505050565b803560ff811681146128bb57600080fd5b919050565b600082601f8301126128d157600080fd5b813567ffffffffffffffff8111156128eb576128eb612726565b61291c60207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116016127a1565b81815284602083860101111561293157600080fd5b816020850160208301376000918101602001919091529392505050565b803567ffffffffffffffff811681146128bb57600080fd5b60008060008060008060c0878903121561297f57600080fd5b863567ffffffffffffffff8082111561299757600080fd5b6129a38a838b01612836565b975060208901359150808211156129b957600080fd5b6129c58a838b01612836565b96506129d360408a016128aa565b955060608901359150808211156129e957600080fd5b6129f58a838b016128c0565b9450612a0360808a0161294e565b935060a0890135915080821115612a1957600080fd5b50612a2689828a016128c0565b9150509295509295509295565b600060208284031215612a4557600080fd5b813564ffffffffff8116811461201457600080fd5b60008083601f840112612a6c57600080fd5b50813567ffffffffffffffff811115612a8457600080fd5b6020830191508360208260051b8501011115612a9f57600080fd5b9250929050565b600080600080600060608688031215612abe57600080fd5b853567ffffffffffffffff80821115612ad657600080fd5b612ae289838a01612a5a565b90975095506020880135915080821115612afb57600080fd5b50612b0888828901612a5a565b96999598509660400135949350505050565b600081518084526020808501945080840160005b83811015612b6057815173ffffffffffffffffffffffffffffffffffffffff1687529582019590820190600101612b2e565b509495945050505050565b6020815260006120146020830184612b1a565b600060208284031215612b9057600080fd5b5035919050565b600060208284031215612ba957600080fd5b6120148261294e565b60008060008060008060008060e0898b031215612bce57600080fd5b606089018a811115612bdf57600080fd5b8998503567ffffffffffffffff80821115612bf957600080fd5b818b0191508b601f830112612c0d57600080fd5b813581811115612c1c57600080fd5b8c6020828501011115612c2e57600080fd5b6020830199508098505060808b0135915080821115612c4c57600080fd5b612c588c838d01612a5a565b909750955060a08b0135915080821115612c7157600080fd5b50612c7e8b828c01612a5a565b999c989b50969995989497949560c00135949350505050565b600060208284031215612ca957600080fd5b813561201481612814565b60008060208385031215612cc757600080fd5b823567ffffffffffffffff811115612cde57600080fd5b612cea85828601612a5a565b90969095509350505050565b600060208284031215612d0857600080fd5b8151801515811461201457600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8082028115828204841417611a0a57611a0a612d18565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203612dbe57612dbe612d18565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b600063ffffffff808316818103612e0d57612e0d612d18565b6001019392505050565b600061012063ffffffff808d1684528b6020850152808b16604085015250806060840152612e478184018a612b1a565b90508281036080840152612e5b8189612b1a565b905060ff871660a084015282810360c0840152612e7881876126af565b905067ffffffffffffffff851660e0840152828103610100840152612e9d81856126af565b9c9b505050505050505050505050565b60ff8181168382160190811115611a0a57611a0a612d18565b600060ff831680612f00577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b8060ff84160491505092915050565b80820180821115611a0a57611a0a612d18565b8183823760009101908152919050565b828152606082602083013760800192915050565b600060208284031215612f5857600080fd5b6040516020810181811067ffffffffffffffff82111715612f7b57612f7b612726565b6040528251612f8981612814565b81529392505050565b60a08101612feb828567ffffffffffffffff80825116835280602083015116602084015250604081015173ffffffffffffffffffffffffffffffffffffffff808216604085015280606084015116606085015250505050565b73ffffffffffffffffffffffffffffffffffffffff83511660808301529392505050565b60006101208b835273ffffffffffffffffffffffffffffffffffffffff8b16602084015267ffffffffffffffff808b1660408501528160608501526130568285018b612b1a565b9150838203608085015261306a828a612b1a565b915060ff881660a085015283820360c085015261308782886126af565b90861660e08501528381036101008501529050612e9d81856126af565b80357bffffffffffffffffffffffffffffffffffffffffffffffffffffffff811681146128bb57600080fd5b600082601f8301126130e157600080fd5b813560206130f1612857836127f0565b82815260069290921b8401810191818101908684111561311057600080fd5b8286015b8481101561289f576040818903121561312d5760008081fd5b613135612755565b61313e8261294e565b815261314b8583016130a4565b81860152835291830191604001613114565b60006040828403121561316f57600080fd5b613177612755565b90506131828261294e565b81526131906020830161294e565b602082015292915050565b600060208083850312156131ae57600080fd5b823567ffffffffffffffff808211156131c657600080fd5b90840190608082870312156131da57600080fd5b6131e261277e565b8235828111156131f157600080fd5b8301604081890381131561320457600080fd5b61320c612755565b82358581111561321b57600080fd5b8301601f81018b1361322c57600080fd5b803561323a612857826127f0565b81815260069190911b8201890190898101908d83111561325957600080fd5b928a01925b828410156132a95785848f0312156132765760008081fd5b61327e612755565b843561328981612814565b8152613296858d016130a4565b818d0152825292850192908a019061325e565b845250505082870135858111156132bf57600080fd5b6132cb8b8286016130d0565b828901525083526132de8986880161315d565b8684015260608501358184015250508094505050505092915050565b805160408084528151848201819052600092602091908201906060870190855b81811015613373578351805173ffffffffffffffffffffffffffffffffffffffff1684528501517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1685840152928401929185019160010161331a565b50508583015187820388850152805180835290840192506000918401905b808310156133e2578351805167ffffffffffffffff1683528501517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1685830152928401926001929092019190850190613391565b50979650505050505050565b60208152600061201460208301846132fa565b60408101611a0a8284805167ffffffffffffffff908116835260209182015116910152565b67ffffffffffffffff81811683821601908082111561344757613447612d18565b5092915050565b60208152600082516080602084015261346a60a08401826132fa565b905060208401516134956040850182805167ffffffffffffffff908116835260209182015116910152565b5060408401516080840152809150509291505056fea164736f6c6343000813000a", +} + +var CommitStoreABI = CommitStoreMetaData.ABI + +var CommitStoreBin = CommitStoreMetaData.Bin + +func DeployCommitStore(auth *bind.TransactOpts, backend bind.ContractBackend, staticConfig CommitStoreStaticConfig) (common.Address, *types.Transaction, *CommitStore, error) { + parsed, err := CommitStoreMetaData.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(CommitStoreBin), backend, staticConfig) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &CommitStore{address: address, abi: *parsed, CommitStoreCaller: CommitStoreCaller{contract: contract}, CommitStoreTransactor: CommitStoreTransactor{contract: contract}, CommitStoreFilterer: CommitStoreFilterer{contract: contract}}, nil +} + +type CommitStore struct { + address common.Address + abi abi.ABI + CommitStoreCaller + CommitStoreTransactor + CommitStoreFilterer +} + +type CommitStoreCaller struct { + contract *bind.BoundContract +} + +type CommitStoreTransactor struct { + contract *bind.BoundContract +} + +type CommitStoreFilterer struct { + contract *bind.BoundContract +} + +type CommitStoreSession struct { + Contract *CommitStore + CallOpts bind.CallOpts + TransactOpts bind.TransactOpts +} + +type CommitStoreCallerSession struct { + Contract *CommitStoreCaller + CallOpts bind.CallOpts +} + +type CommitStoreTransactorSession struct { + Contract *CommitStoreTransactor + TransactOpts bind.TransactOpts +} + +type CommitStoreRaw struct { + Contract *CommitStore +} + +type CommitStoreCallerRaw struct { + Contract *CommitStoreCaller +} + +type CommitStoreTransactorRaw struct { + Contract *CommitStoreTransactor +} + +func NewCommitStore(address common.Address, backend bind.ContractBackend) (*CommitStore, error) { + abi, err := abi.JSON(strings.NewReader(CommitStoreABI)) + if err != nil { + return nil, err + } + contract, err := bindCommitStore(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &CommitStore{address: address, abi: abi, CommitStoreCaller: CommitStoreCaller{contract: contract}, CommitStoreTransactor: CommitStoreTransactor{contract: contract}, CommitStoreFilterer: CommitStoreFilterer{contract: contract}}, nil +} + +func NewCommitStoreCaller(address common.Address, caller bind.ContractCaller) (*CommitStoreCaller, error) { + contract, err := bindCommitStore(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &CommitStoreCaller{contract: contract}, nil +} + +func NewCommitStoreTransactor(address common.Address, transactor bind.ContractTransactor) (*CommitStoreTransactor, error) { + contract, err := bindCommitStore(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &CommitStoreTransactor{contract: contract}, nil +} + +func NewCommitStoreFilterer(address common.Address, filterer bind.ContractFilterer) (*CommitStoreFilterer, error) { + contract, err := bindCommitStore(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &CommitStoreFilterer{contract: contract}, nil +} + +func bindCommitStore(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := CommitStoreMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +func (_CommitStore *CommitStoreRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _CommitStore.Contract.CommitStoreCaller.contract.Call(opts, result, method, params...) +} + +func (_CommitStore *CommitStoreRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _CommitStore.Contract.CommitStoreTransactor.contract.Transfer(opts) +} + +func (_CommitStore *CommitStoreRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _CommitStore.Contract.CommitStoreTransactor.contract.Transact(opts, method, params...) +} + +func (_CommitStore *CommitStoreCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _CommitStore.Contract.contract.Call(opts, result, method, params...) +} + +func (_CommitStore *CommitStoreTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _CommitStore.Contract.contract.Transfer(opts) +} + +func (_CommitStore *CommitStoreTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _CommitStore.Contract.contract.Transact(opts, method, params...) +} + +func (_CommitStore *CommitStoreCaller) GetDynamicConfig(opts *bind.CallOpts) (CommitStoreDynamicConfig, error) { + var out []interface{} + err := _CommitStore.contract.Call(opts, &out, "getDynamicConfig") + + if err != nil { + return *new(CommitStoreDynamicConfig), err + } + + out0 := *abi.ConvertType(out[0], new(CommitStoreDynamicConfig)).(*CommitStoreDynamicConfig) + + return out0, err + +} + +func (_CommitStore *CommitStoreSession) GetDynamicConfig() (CommitStoreDynamicConfig, error) { + return _CommitStore.Contract.GetDynamicConfig(&_CommitStore.CallOpts) +} + +func (_CommitStore *CommitStoreCallerSession) GetDynamicConfig() (CommitStoreDynamicConfig, error) { + return _CommitStore.Contract.GetDynamicConfig(&_CommitStore.CallOpts) +} + +func (_CommitStore *CommitStoreCaller) GetExpectedNextSequenceNumber(opts *bind.CallOpts) (uint64, error) { + var out []interface{} + err := _CommitStore.contract.Call(opts, &out, "getExpectedNextSequenceNumber") + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +func (_CommitStore *CommitStoreSession) GetExpectedNextSequenceNumber() (uint64, error) { + return _CommitStore.Contract.GetExpectedNextSequenceNumber(&_CommitStore.CallOpts) +} + +func (_CommitStore *CommitStoreCallerSession) GetExpectedNextSequenceNumber() (uint64, error) { + return _CommitStore.Contract.GetExpectedNextSequenceNumber(&_CommitStore.CallOpts) +} + +func (_CommitStore *CommitStoreCaller) GetLatestPriceEpochAndRound(opts *bind.CallOpts) (uint64, error) { + var out []interface{} + err := _CommitStore.contract.Call(opts, &out, "getLatestPriceEpochAndRound") + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +func (_CommitStore *CommitStoreSession) GetLatestPriceEpochAndRound() (uint64, error) { + return _CommitStore.Contract.GetLatestPriceEpochAndRound(&_CommitStore.CallOpts) +} + +func (_CommitStore *CommitStoreCallerSession) GetLatestPriceEpochAndRound() (uint64, error) { + return _CommitStore.Contract.GetLatestPriceEpochAndRound(&_CommitStore.CallOpts) +} + +func (_CommitStore *CommitStoreCaller) GetMerkleRoot(opts *bind.CallOpts, root [32]byte) (*big.Int, error) { + var out []interface{} + err := _CommitStore.contract.Call(opts, &out, "getMerkleRoot", root) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_CommitStore *CommitStoreSession) GetMerkleRoot(root [32]byte) (*big.Int, error) { + return _CommitStore.Contract.GetMerkleRoot(&_CommitStore.CallOpts, root) +} + +func (_CommitStore *CommitStoreCallerSession) GetMerkleRoot(root [32]byte) (*big.Int, error) { + return _CommitStore.Contract.GetMerkleRoot(&_CommitStore.CallOpts, root) +} + +func (_CommitStore *CommitStoreCaller) GetStaticConfig(opts *bind.CallOpts) (CommitStoreStaticConfig, error) { + var out []interface{} + err := _CommitStore.contract.Call(opts, &out, "getStaticConfig") + + if err != nil { + return *new(CommitStoreStaticConfig), err + } + + out0 := *abi.ConvertType(out[0], new(CommitStoreStaticConfig)).(*CommitStoreStaticConfig) + + return out0, err + +} + +func (_CommitStore *CommitStoreSession) GetStaticConfig() (CommitStoreStaticConfig, error) { + return _CommitStore.Contract.GetStaticConfig(&_CommitStore.CallOpts) +} + +func (_CommitStore *CommitStoreCallerSession) GetStaticConfig() (CommitStoreStaticConfig, error) { + return _CommitStore.Contract.GetStaticConfig(&_CommitStore.CallOpts) +} + +func (_CommitStore *CommitStoreCaller) GetTransmitters(opts *bind.CallOpts) ([]common.Address, error) { + var out []interface{} + err := _CommitStore.contract.Call(opts, &out, "getTransmitters") + + if err != nil { + return *new([]common.Address), err + } + + out0 := *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) + + return out0, err + +} + +func (_CommitStore *CommitStoreSession) GetTransmitters() ([]common.Address, error) { + return _CommitStore.Contract.GetTransmitters(&_CommitStore.CallOpts) +} + +func (_CommitStore *CommitStoreCallerSession) GetTransmitters() ([]common.Address, error) { + return _CommitStore.Contract.GetTransmitters(&_CommitStore.CallOpts) +} + +func (_CommitStore *CommitStoreCaller) IsARMHealthy(opts *bind.CallOpts) (bool, error) { + var out []interface{} + err := _CommitStore.contract.Call(opts, &out, "isARMHealthy") + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_CommitStore *CommitStoreSession) IsARMHealthy() (bool, error) { + return _CommitStore.Contract.IsARMHealthy(&_CommitStore.CallOpts) +} + +func (_CommitStore *CommitStoreCallerSession) IsARMHealthy() (bool, error) { + return _CommitStore.Contract.IsARMHealthy(&_CommitStore.CallOpts) +} + +func (_CommitStore *CommitStoreCaller) IsBlessed(opts *bind.CallOpts, root [32]byte) (bool, error) { + var out []interface{} + err := _CommitStore.contract.Call(opts, &out, "isBlessed", root) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_CommitStore *CommitStoreSession) IsBlessed(root [32]byte) (bool, error) { + return _CommitStore.Contract.IsBlessed(&_CommitStore.CallOpts, root) +} + +func (_CommitStore *CommitStoreCallerSession) IsBlessed(root [32]byte) (bool, error) { + return _CommitStore.Contract.IsBlessed(&_CommitStore.CallOpts, root) +} + +func (_CommitStore *CommitStoreCaller) IsUnpausedAndARMHealthy(opts *bind.CallOpts) (bool, error) { + var out []interface{} + err := _CommitStore.contract.Call(opts, &out, "isUnpausedAndARMHealthy") + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_CommitStore *CommitStoreSession) IsUnpausedAndARMHealthy() (bool, error) { + return _CommitStore.Contract.IsUnpausedAndARMHealthy(&_CommitStore.CallOpts) +} + +func (_CommitStore *CommitStoreCallerSession) IsUnpausedAndARMHealthy() (bool, error) { + return _CommitStore.Contract.IsUnpausedAndARMHealthy(&_CommitStore.CallOpts) +} + +func (_CommitStore *CommitStoreCaller) LatestConfigDetails(opts *bind.CallOpts) (LatestConfigDetails, + + error) { + var out []interface{} + err := _CommitStore.contract.Call(opts, &out, "latestConfigDetails") + + outstruct := new(LatestConfigDetails) + if err != nil { + return *outstruct, err + } + + outstruct.ConfigCount = *abi.ConvertType(out[0], new(uint32)).(*uint32) + outstruct.BlockNumber = *abi.ConvertType(out[1], new(uint32)).(*uint32) + outstruct.ConfigDigest = *abi.ConvertType(out[2], new([32]byte)).(*[32]byte) + + return *outstruct, err + +} + +func (_CommitStore *CommitStoreSession) LatestConfigDetails() (LatestConfigDetails, + + error) { + return _CommitStore.Contract.LatestConfigDetails(&_CommitStore.CallOpts) +} + +func (_CommitStore *CommitStoreCallerSession) LatestConfigDetails() (LatestConfigDetails, + + error) { + return _CommitStore.Contract.LatestConfigDetails(&_CommitStore.CallOpts) +} + +func (_CommitStore *CommitStoreCaller) LatestConfigDigestAndEpoch(opts *bind.CallOpts) (LatestConfigDigestAndEpoch, + + error) { + var out []interface{} + err := _CommitStore.contract.Call(opts, &out, "latestConfigDigestAndEpoch") + + outstruct := new(LatestConfigDigestAndEpoch) + if err != nil { + return *outstruct, err + } + + outstruct.ScanLogs = *abi.ConvertType(out[0], new(bool)).(*bool) + outstruct.ConfigDigest = *abi.ConvertType(out[1], new([32]byte)).(*[32]byte) + outstruct.Epoch = *abi.ConvertType(out[2], new(uint32)).(*uint32) + + return *outstruct, err + +} + +func (_CommitStore *CommitStoreSession) LatestConfigDigestAndEpoch() (LatestConfigDigestAndEpoch, + + error) { + return _CommitStore.Contract.LatestConfigDigestAndEpoch(&_CommitStore.CallOpts) +} + +func (_CommitStore *CommitStoreCallerSession) LatestConfigDigestAndEpoch() (LatestConfigDigestAndEpoch, + + error) { + return _CommitStore.Contract.LatestConfigDigestAndEpoch(&_CommitStore.CallOpts) +} + +func (_CommitStore *CommitStoreCaller) Owner(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _CommitStore.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 + +} + +func (_CommitStore *CommitStoreSession) Owner() (common.Address, error) { + return _CommitStore.Contract.Owner(&_CommitStore.CallOpts) +} + +func (_CommitStore *CommitStoreCallerSession) Owner() (common.Address, error) { + return _CommitStore.Contract.Owner(&_CommitStore.CallOpts) +} + +func (_CommitStore *CommitStoreCaller) Paused(opts *bind.CallOpts) (bool, error) { + var out []interface{} + err := _CommitStore.contract.Call(opts, &out, "paused") + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_CommitStore *CommitStoreSession) Paused() (bool, error) { + return _CommitStore.Contract.Paused(&_CommitStore.CallOpts) +} + +func (_CommitStore *CommitStoreCallerSession) Paused() (bool, error) { + return _CommitStore.Contract.Paused(&_CommitStore.CallOpts) +} + +func (_CommitStore *CommitStoreCaller) TypeAndVersion(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _CommitStore.contract.Call(opts, &out, "typeAndVersion") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +func (_CommitStore *CommitStoreSession) TypeAndVersion() (string, error) { + return _CommitStore.Contract.TypeAndVersion(&_CommitStore.CallOpts) +} + +func (_CommitStore *CommitStoreCallerSession) TypeAndVersion() (string, error) { + return _CommitStore.Contract.TypeAndVersion(&_CommitStore.CallOpts) +} + +func (_CommitStore *CommitStoreCaller) Verify(opts *bind.CallOpts, hashedLeaves [][32]byte, proofs [][32]byte, proofFlagBits *big.Int) (*big.Int, error) { + var out []interface{} + err := _CommitStore.contract.Call(opts, &out, "verify", hashedLeaves, proofs, proofFlagBits) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_CommitStore *CommitStoreSession) Verify(hashedLeaves [][32]byte, proofs [][32]byte, proofFlagBits *big.Int) (*big.Int, error) { + return _CommitStore.Contract.Verify(&_CommitStore.CallOpts, hashedLeaves, proofs, proofFlagBits) +} + +func (_CommitStore *CommitStoreCallerSession) Verify(hashedLeaves [][32]byte, proofs [][32]byte, proofFlagBits *big.Int) (*big.Int, error) { + return _CommitStore.Contract.Verify(&_CommitStore.CallOpts, hashedLeaves, proofs, proofFlagBits) +} + +func (_CommitStore *CommitStoreTransactor) AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + return _CommitStore.contract.Transact(opts, "acceptOwnership") +} + +func (_CommitStore *CommitStoreSession) AcceptOwnership() (*types.Transaction, error) { + return _CommitStore.Contract.AcceptOwnership(&_CommitStore.TransactOpts) +} + +func (_CommitStore *CommitStoreTransactorSession) AcceptOwnership() (*types.Transaction, error) { + return _CommitStore.Contract.AcceptOwnership(&_CommitStore.TransactOpts) +} + +func (_CommitStore *CommitStoreTransactor) Pause(opts *bind.TransactOpts) (*types.Transaction, error) { + return _CommitStore.contract.Transact(opts, "pause") +} + +func (_CommitStore *CommitStoreSession) Pause() (*types.Transaction, error) { + return _CommitStore.Contract.Pause(&_CommitStore.TransactOpts) +} + +func (_CommitStore *CommitStoreTransactorSession) Pause() (*types.Transaction, error) { + return _CommitStore.Contract.Pause(&_CommitStore.TransactOpts) +} + +func (_CommitStore *CommitStoreTransactor) ResetUnblessedRoots(opts *bind.TransactOpts, rootToReset [][32]byte) (*types.Transaction, error) { + return _CommitStore.contract.Transact(opts, "resetUnblessedRoots", rootToReset) +} + +func (_CommitStore *CommitStoreSession) ResetUnblessedRoots(rootToReset [][32]byte) (*types.Transaction, error) { + return _CommitStore.Contract.ResetUnblessedRoots(&_CommitStore.TransactOpts, rootToReset) +} + +func (_CommitStore *CommitStoreTransactorSession) ResetUnblessedRoots(rootToReset [][32]byte) (*types.Transaction, error) { + return _CommitStore.Contract.ResetUnblessedRoots(&_CommitStore.TransactOpts, rootToReset) +} + +func (_CommitStore *CommitStoreTransactor) SetLatestPriceEpochAndRound(opts *bind.TransactOpts, latestPriceEpochAndRound *big.Int) (*types.Transaction, error) { + return _CommitStore.contract.Transact(opts, "setLatestPriceEpochAndRound", latestPriceEpochAndRound) +} + +func (_CommitStore *CommitStoreSession) SetLatestPriceEpochAndRound(latestPriceEpochAndRound *big.Int) (*types.Transaction, error) { + return _CommitStore.Contract.SetLatestPriceEpochAndRound(&_CommitStore.TransactOpts, latestPriceEpochAndRound) +} + +func (_CommitStore *CommitStoreTransactorSession) SetLatestPriceEpochAndRound(latestPriceEpochAndRound *big.Int) (*types.Transaction, error) { + return _CommitStore.Contract.SetLatestPriceEpochAndRound(&_CommitStore.TransactOpts, latestPriceEpochAndRound) +} + +func (_CommitStore *CommitStoreTransactor) SetMinSeqNr(opts *bind.TransactOpts, minSeqNr uint64) (*types.Transaction, error) { + return _CommitStore.contract.Transact(opts, "setMinSeqNr", minSeqNr) +} + +func (_CommitStore *CommitStoreSession) SetMinSeqNr(minSeqNr uint64) (*types.Transaction, error) { + return _CommitStore.Contract.SetMinSeqNr(&_CommitStore.TransactOpts, minSeqNr) +} + +func (_CommitStore *CommitStoreTransactorSession) SetMinSeqNr(minSeqNr uint64) (*types.Transaction, error) { + return _CommitStore.Contract.SetMinSeqNr(&_CommitStore.TransactOpts, minSeqNr) +} + +func (_CommitStore *CommitStoreTransactor) SetOCR2Config(opts *bind.TransactOpts, signers []common.Address, transmitters []common.Address, f uint8, onchainConfig []byte, offchainConfigVersion uint64, offchainConfig []byte) (*types.Transaction, error) { + return _CommitStore.contract.Transact(opts, "setOCR2Config", signers, transmitters, f, onchainConfig, offchainConfigVersion, offchainConfig) +} + +func (_CommitStore *CommitStoreSession) SetOCR2Config(signers []common.Address, transmitters []common.Address, f uint8, onchainConfig []byte, offchainConfigVersion uint64, offchainConfig []byte) (*types.Transaction, error) { + return _CommitStore.Contract.SetOCR2Config(&_CommitStore.TransactOpts, signers, transmitters, f, onchainConfig, offchainConfigVersion, offchainConfig) +} + +func (_CommitStore *CommitStoreTransactorSession) SetOCR2Config(signers []common.Address, transmitters []common.Address, f uint8, onchainConfig []byte, offchainConfigVersion uint64, offchainConfig []byte) (*types.Transaction, error) { + return _CommitStore.Contract.SetOCR2Config(&_CommitStore.TransactOpts, signers, transmitters, f, onchainConfig, offchainConfigVersion, offchainConfig) +} + +func (_CommitStore *CommitStoreTransactor) TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) { + return _CommitStore.contract.Transact(opts, "transferOwnership", to) +} + +func (_CommitStore *CommitStoreSession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _CommitStore.Contract.TransferOwnership(&_CommitStore.TransactOpts, to) +} + +func (_CommitStore *CommitStoreTransactorSession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _CommitStore.Contract.TransferOwnership(&_CommitStore.TransactOpts, to) +} + +func (_CommitStore *CommitStoreTransactor) Transmit(opts *bind.TransactOpts, reportContext [3][32]byte, report []byte, rs [][32]byte, ss [][32]byte, rawVs [32]byte) (*types.Transaction, error) { + return _CommitStore.contract.Transact(opts, "transmit", reportContext, report, rs, ss, rawVs) +} + +func (_CommitStore *CommitStoreSession) Transmit(reportContext [3][32]byte, report []byte, rs [][32]byte, ss [][32]byte, rawVs [32]byte) (*types.Transaction, error) { + return _CommitStore.Contract.Transmit(&_CommitStore.TransactOpts, reportContext, report, rs, ss, rawVs) +} + +func (_CommitStore *CommitStoreTransactorSession) Transmit(reportContext [3][32]byte, report []byte, rs [][32]byte, ss [][32]byte, rawVs [32]byte) (*types.Transaction, error) { + return _CommitStore.Contract.Transmit(&_CommitStore.TransactOpts, reportContext, report, rs, ss, rawVs) +} + +func (_CommitStore *CommitStoreTransactor) Unpause(opts *bind.TransactOpts) (*types.Transaction, error) { + return _CommitStore.contract.Transact(opts, "unpause") +} + +func (_CommitStore *CommitStoreSession) Unpause() (*types.Transaction, error) { + return _CommitStore.Contract.Unpause(&_CommitStore.TransactOpts) +} + +func (_CommitStore *CommitStoreTransactorSession) Unpause() (*types.Transaction, error) { + return _CommitStore.Contract.Unpause(&_CommitStore.TransactOpts) +} + +type CommitStoreConfigSetIterator struct { + Event *CommitStoreConfigSet + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *CommitStoreConfigSetIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(CommitStoreConfigSet) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(CommitStoreConfigSet) + 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() + } +} + +func (it *CommitStoreConfigSetIterator) Error() error { + return it.fail +} + +func (it *CommitStoreConfigSetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type CommitStoreConfigSet struct { + StaticConfig CommitStoreStaticConfig + DynamicConfig CommitStoreDynamicConfig + Raw types.Log +} + +func (_CommitStore *CommitStoreFilterer) FilterConfigSet(opts *bind.FilterOpts) (*CommitStoreConfigSetIterator, error) { + + logs, sub, err := _CommitStore.contract.FilterLogs(opts, "ConfigSet") + if err != nil { + return nil, err + } + return &CommitStoreConfigSetIterator{contract: _CommitStore.contract, event: "ConfigSet", logs: logs, sub: sub}, nil +} + +func (_CommitStore *CommitStoreFilterer) WatchConfigSet(opts *bind.WatchOpts, sink chan<- *CommitStoreConfigSet) (event.Subscription, error) { + + logs, sub, err := _CommitStore.contract.WatchLogs(opts, "ConfigSet") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(CommitStoreConfigSet) + if err := _CommitStore.contract.UnpackLog(event, "ConfigSet", 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 +} + +func (_CommitStore *CommitStoreFilterer) ParseConfigSet(log types.Log) (*CommitStoreConfigSet, error) { + event := new(CommitStoreConfigSet) + if err := _CommitStore.contract.UnpackLog(event, "ConfigSet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type CommitStoreConfigSet0Iterator struct { + Event *CommitStoreConfigSet0 + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *CommitStoreConfigSet0Iterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(CommitStoreConfigSet0) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(CommitStoreConfigSet0) + 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() + } +} + +func (it *CommitStoreConfigSet0Iterator) Error() error { + return it.fail +} + +func (it *CommitStoreConfigSet0Iterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type CommitStoreConfigSet0 struct { + PreviousConfigBlockNumber uint32 + ConfigDigest [32]byte + ConfigCount uint64 + Signers []common.Address + Transmitters []common.Address + F uint8 + OnchainConfig []byte + OffchainConfigVersion uint64 + OffchainConfig []byte + Raw types.Log +} + +func (_CommitStore *CommitStoreFilterer) FilterConfigSet0(opts *bind.FilterOpts) (*CommitStoreConfigSet0Iterator, error) { + + logs, sub, err := _CommitStore.contract.FilterLogs(opts, "ConfigSet0") + if err != nil { + return nil, err + } + return &CommitStoreConfigSet0Iterator{contract: _CommitStore.contract, event: "ConfigSet0", logs: logs, sub: sub}, nil +} + +func (_CommitStore *CommitStoreFilterer) WatchConfigSet0(opts *bind.WatchOpts, sink chan<- *CommitStoreConfigSet0) (event.Subscription, error) { + + logs, sub, err := _CommitStore.contract.WatchLogs(opts, "ConfigSet0") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(CommitStoreConfigSet0) + if err := _CommitStore.contract.UnpackLog(event, "ConfigSet0", 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 +} + +func (_CommitStore *CommitStoreFilterer) ParseConfigSet0(log types.Log) (*CommitStoreConfigSet0, error) { + event := new(CommitStoreConfigSet0) + if err := _CommitStore.contract.UnpackLog(event, "ConfigSet0", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type CommitStoreOwnershipTransferRequestedIterator struct { + Event *CommitStoreOwnershipTransferRequested + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *CommitStoreOwnershipTransferRequestedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(CommitStoreOwnershipTransferRequested) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(CommitStoreOwnershipTransferRequested) + 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() + } +} + +func (it *CommitStoreOwnershipTransferRequestedIterator) Error() error { + return it.fail +} + +func (it *CommitStoreOwnershipTransferRequestedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type CommitStoreOwnershipTransferRequested struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_CommitStore *CommitStoreFilterer) FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*CommitStoreOwnershipTransferRequestedIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _CommitStore.contract.FilterLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return &CommitStoreOwnershipTransferRequestedIterator{contract: _CommitStore.contract, event: "OwnershipTransferRequested", logs: logs, sub: sub}, nil +} + +func (_CommitStore *CommitStoreFilterer) WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *CommitStoreOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _CommitStore.contract.WatchLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(CommitStoreOwnershipTransferRequested) + if err := _CommitStore.contract.UnpackLog(event, "OwnershipTransferRequested", 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 +} + +func (_CommitStore *CommitStoreFilterer) ParseOwnershipTransferRequested(log types.Log) (*CommitStoreOwnershipTransferRequested, error) { + event := new(CommitStoreOwnershipTransferRequested) + if err := _CommitStore.contract.UnpackLog(event, "OwnershipTransferRequested", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type CommitStoreOwnershipTransferredIterator struct { + Event *CommitStoreOwnershipTransferred + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *CommitStoreOwnershipTransferredIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(CommitStoreOwnershipTransferred) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(CommitStoreOwnershipTransferred) + 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() + } +} + +func (it *CommitStoreOwnershipTransferredIterator) Error() error { + return it.fail +} + +func (it *CommitStoreOwnershipTransferredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type CommitStoreOwnershipTransferred struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_CommitStore *CommitStoreFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*CommitStoreOwnershipTransferredIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _CommitStore.contract.FilterLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return &CommitStoreOwnershipTransferredIterator{contract: _CommitStore.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil +} + +func (_CommitStore *CommitStoreFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *CommitStoreOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _CommitStore.contract.WatchLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(CommitStoreOwnershipTransferred) + if err := _CommitStore.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 +} + +func (_CommitStore *CommitStoreFilterer) ParseOwnershipTransferred(log types.Log) (*CommitStoreOwnershipTransferred, error) { + event := new(CommitStoreOwnershipTransferred) + if err := _CommitStore.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type CommitStorePausedIterator struct { + Event *CommitStorePaused + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *CommitStorePausedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(CommitStorePaused) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(CommitStorePaused) + 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() + } +} + +func (it *CommitStorePausedIterator) Error() error { + return it.fail +} + +func (it *CommitStorePausedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type CommitStorePaused struct { + Account common.Address + Raw types.Log +} + +func (_CommitStore *CommitStoreFilterer) FilterPaused(opts *bind.FilterOpts) (*CommitStorePausedIterator, error) { + + logs, sub, err := _CommitStore.contract.FilterLogs(opts, "Paused") + if err != nil { + return nil, err + } + return &CommitStorePausedIterator{contract: _CommitStore.contract, event: "Paused", logs: logs, sub: sub}, nil +} + +func (_CommitStore *CommitStoreFilterer) WatchPaused(opts *bind.WatchOpts, sink chan<- *CommitStorePaused) (event.Subscription, error) { + + logs, sub, err := _CommitStore.contract.WatchLogs(opts, "Paused") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(CommitStorePaused) + if err := _CommitStore.contract.UnpackLog(event, "Paused", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +func (_CommitStore *CommitStoreFilterer) ParsePaused(log types.Log) (*CommitStorePaused, error) { + event := new(CommitStorePaused) + if err := _CommitStore.contract.UnpackLog(event, "Paused", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type CommitStoreReportAcceptedIterator struct { + Event *CommitStoreReportAccepted + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *CommitStoreReportAcceptedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(CommitStoreReportAccepted) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(CommitStoreReportAccepted) + 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() + } +} + +func (it *CommitStoreReportAcceptedIterator) Error() error { + return it.fail +} + +func (it *CommitStoreReportAcceptedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type CommitStoreReportAccepted struct { + Report CommitStoreCommitReport + Raw types.Log +} + +func (_CommitStore *CommitStoreFilterer) FilterReportAccepted(opts *bind.FilterOpts) (*CommitStoreReportAcceptedIterator, error) { + + logs, sub, err := _CommitStore.contract.FilterLogs(opts, "ReportAccepted") + if err != nil { + return nil, err + } + return &CommitStoreReportAcceptedIterator{contract: _CommitStore.contract, event: "ReportAccepted", logs: logs, sub: sub}, nil +} + +func (_CommitStore *CommitStoreFilterer) WatchReportAccepted(opts *bind.WatchOpts, sink chan<- *CommitStoreReportAccepted) (event.Subscription, error) { + + logs, sub, err := _CommitStore.contract.WatchLogs(opts, "ReportAccepted") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(CommitStoreReportAccepted) + if err := _CommitStore.contract.UnpackLog(event, "ReportAccepted", 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 +} + +func (_CommitStore *CommitStoreFilterer) ParseReportAccepted(log types.Log) (*CommitStoreReportAccepted, error) { + event := new(CommitStoreReportAccepted) + if err := _CommitStore.contract.UnpackLog(event, "ReportAccepted", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type CommitStoreRootRemovedIterator struct { + Event *CommitStoreRootRemoved + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *CommitStoreRootRemovedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(CommitStoreRootRemoved) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(CommitStoreRootRemoved) + 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() + } +} + +func (it *CommitStoreRootRemovedIterator) Error() error { + return it.fail +} + +func (it *CommitStoreRootRemovedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type CommitStoreRootRemoved struct { + Root [32]byte + Raw types.Log +} + +func (_CommitStore *CommitStoreFilterer) FilterRootRemoved(opts *bind.FilterOpts) (*CommitStoreRootRemovedIterator, error) { + + logs, sub, err := _CommitStore.contract.FilterLogs(opts, "RootRemoved") + if err != nil { + return nil, err + } + return &CommitStoreRootRemovedIterator{contract: _CommitStore.contract, event: "RootRemoved", logs: logs, sub: sub}, nil +} + +func (_CommitStore *CommitStoreFilterer) WatchRootRemoved(opts *bind.WatchOpts, sink chan<- *CommitStoreRootRemoved) (event.Subscription, error) { + + logs, sub, err := _CommitStore.contract.WatchLogs(opts, "RootRemoved") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(CommitStoreRootRemoved) + if err := _CommitStore.contract.UnpackLog(event, "RootRemoved", 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 +} + +func (_CommitStore *CommitStoreFilterer) ParseRootRemoved(log types.Log) (*CommitStoreRootRemoved, error) { + event := new(CommitStoreRootRemoved) + if err := _CommitStore.contract.UnpackLog(event, "RootRemoved", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type CommitStoreTransmittedIterator struct { + Event *CommitStoreTransmitted + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *CommitStoreTransmittedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(CommitStoreTransmitted) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(CommitStoreTransmitted) + 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() + } +} + +func (it *CommitStoreTransmittedIterator) Error() error { + return it.fail +} + +func (it *CommitStoreTransmittedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type CommitStoreTransmitted struct { + ConfigDigest [32]byte + Epoch uint32 + Raw types.Log +} + +func (_CommitStore *CommitStoreFilterer) FilterTransmitted(opts *bind.FilterOpts) (*CommitStoreTransmittedIterator, error) { + + logs, sub, err := _CommitStore.contract.FilterLogs(opts, "Transmitted") + if err != nil { + return nil, err + } + return &CommitStoreTransmittedIterator{contract: _CommitStore.contract, event: "Transmitted", logs: logs, sub: sub}, nil +} + +func (_CommitStore *CommitStoreFilterer) WatchTransmitted(opts *bind.WatchOpts, sink chan<- *CommitStoreTransmitted) (event.Subscription, error) { + + logs, sub, err := _CommitStore.contract.WatchLogs(opts, "Transmitted") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(CommitStoreTransmitted) + if err := _CommitStore.contract.UnpackLog(event, "Transmitted", 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 +} + +func (_CommitStore *CommitStoreFilterer) ParseTransmitted(log types.Log) (*CommitStoreTransmitted, error) { + event := new(CommitStoreTransmitted) + if err := _CommitStore.contract.UnpackLog(event, "Transmitted", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type CommitStoreUnpausedIterator struct { + Event *CommitStoreUnpaused + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *CommitStoreUnpausedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(CommitStoreUnpaused) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(CommitStoreUnpaused) + 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() + } +} + +func (it *CommitStoreUnpausedIterator) Error() error { + return it.fail +} + +func (it *CommitStoreUnpausedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type CommitStoreUnpaused struct { + Account common.Address + Raw types.Log +} + +func (_CommitStore *CommitStoreFilterer) FilterUnpaused(opts *bind.FilterOpts) (*CommitStoreUnpausedIterator, error) { + + logs, sub, err := _CommitStore.contract.FilterLogs(opts, "Unpaused") + if err != nil { + return nil, err + } + return &CommitStoreUnpausedIterator{contract: _CommitStore.contract, event: "Unpaused", logs: logs, sub: sub}, nil +} + +func (_CommitStore *CommitStoreFilterer) WatchUnpaused(opts *bind.WatchOpts, sink chan<- *CommitStoreUnpaused) (event.Subscription, error) { + + logs, sub, err := _CommitStore.contract.WatchLogs(opts, "Unpaused") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(CommitStoreUnpaused) + if err := _CommitStore.contract.UnpackLog(event, "Unpaused", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +func (_CommitStore *CommitStoreFilterer) ParseUnpaused(log types.Log) (*CommitStoreUnpaused, error) { + event := new(CommitStoreUnpaused) + if err := _CommitStore.contract.UnpackLog(event, "Unpaused", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type LatestConfigDetails struct { + ConfigCount uint32 + BlockNumber uint32 + ConfigDigest [32]byte +} +type LatestConfigDigestAndEpoch struct { + ScanLogs bool + ConfigDigest [32]byte + Epoch uint32 +} + +func (_CommitStore *CommitStore) ParseLog(log types.Log) (generated.AbigenLog, error) { + switch log.Topics[0] { + case _CommitStore.abi.Events["ConfigSet"].ID: + return _CommitStore.ParseConfigSet(log) + case _CommitStore.abi.Events["ConfigSet0"].ID: + return _CommitStore.ParseConfigSet0(log) + case _CommitStore.abi.Events["OwnershipTransferRequested"].ID: + return _CommitStore.ParseOwnershipTransferRequested(log) + case _CommitStore.abi.Events["OwnershipTransferred"].ID: + return _CommitStore.ParseOwnershipTransferred(log) + case _CommitStore.abi.Events["Paused"].ID: + return _CommitStore.ParsePaused(log) + case _CommitStore.abi.Events["ReportAccepted"].ID: + return _CommitStore.ParseReportAccepted(log) + case _CommitStore.abi.Events["RootRemoved"].ID: + return _CommitStore.ParseRootRemoved(log) + case _CommitStore.abi.Events["Transmitted"].ID: + return _CommitStore.ParseTransmitted(log) + case _CommitStore.abi.Events["Unpaused"].ID: + return _CommitStore.ParseUnpaused(log) + + default: + return nil, fmt.Errorf("abigen wrapper received unknown log topic: %v", log.Topics[0]) + } +} + +func (CommitStoreConfigSet) Topic() common.Hash { + return common.HexToHash("0xc9d7123efd4203e60b0f0a4b1dbc4800fc97ce63679f71c3a27279b24a7ddec3") +} + +func (CommitStoreConfigSet0) Topic() common.Hash { + return common.HexToHash("0x1591690b8638f5fb2dbec82ac741805ac5da8b45dc5263f4875b0496fdce4e05") +} + +func (CommitStoreOwnershipTransferRequested) Topic() common.Hash { + return common.HexToHash("0xed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae1278") +} + +func (CommitStoreOwnershipTransferred) Topic() common.Hash { + return common.HexToHash("0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0") +} + +func (CommitStorePaused) Topic() common.Hash { + return common.HexToHash("0x62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258") +} + +func (CommitStoreReportAccepted) Topic() common.Hash { + return common.HexToHash("0x291698c01aa71f912280535d88a00d2c59fb63530a3f5d0098560468acb9ebf5") +} + +func (CommitStoreRootRemoved) Topic() common.Hash { + return common.HexToHash("0x202f1139a3e334b6056064c0e9b19fd07e44a88d8f6e5ded571b24cf8c371f12") +} + +func (CommitStoreTransmitted) Topic() common.Hash { + return common.HexToHash("0xb04e63db38c49950639fa09d29872f21f5d49d614f3a969d8adf3d4b52e41a62") +} + +func (CommitStoreUnpaused) Topic() common.Hash { + return common.HexToHash("0x5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa") +} + +func (_CommitStore *CommitStore) Address() common.Address { + return _CommitStore.address +} + +type CommitStoreInterface interface { + GetDynamicConfig(opts *bind.CallOpts) (CommitStoreDynamicConfig, error) + + GetExpectedNextSequenceNumber(opts *bind.CallOpts) (uint64, error) + + GetLatestPriceEpochAndRound(opts *bind.CallOpts) (uint64, error) + + GetMerkleRoot(opts *bind.CallOpts, root [32]byte) (*big.Int, error) + + GetStaticConfig(opts *bind.CallOpts) (CommitStoreStaticConfig, error) + + GetTransmitters(opts *bind.CallOpts) ([]common.Address, error) + + IsARMHealthy(opts *bind.CallOpts) (bool, error) + + IsBlessed(opts *bind.CallOpts, root [32]byte) (bool, error) + + IsUnpausedAndARMHealthy(opts *bind.CallOpts) (bool, error) + + LatestConfigDetails(opts *bind.CallOpts) (LatestConfigDetails, + + error) + + LatestConfigDigestAndEpoch(opts *bind.CallOpts) (LatestConfigDigestAndEpoch, + + error) + + Owner(opts *bind.CallOpts) (common.Address, error) + + Paused(opts *bind.CallOpts) (bool, error) + + TypeAndVersion(opts *bind.CallOpts) (string, error) + + Verify(opts *bind.CallOpts, hashedLeaves [][32]byte, proofs [][32]byte, proofFlagBits *big.Int) (*big.Int, error) + + AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) + + Pause(opts *bind.TransactOpts) (*types.Transaction, error) + + ResetUnblessedRoots(opts *bind.TransactOpts, rootToReset [][32]byte) (*types.Transaction, error) + + SetLatestPriceEpochAndRound(opts *bind.TransactOpts, latestPriceEpochAndRound *big.Int) (*types.Transaction, error) + + SetMinSeqNr(opts *bind.TransactOpts, minSeqNr uint64) (*types.Transaction, error) + + SetOCR2Config(opts *bind.TransactOpts, signers []common.Address, transmitters []common.Address, f uint8, onchainConfig []byte, offchainConfigVersion uint64, offchainConfig []byte) (*types.Transaction, error) + + TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) + + Transmit(opts *bind.TransactOpts, reportContext [3][32]byte, report []byte, rs [][32]byte, ss [][32]byte, rawVs [32]byte) (*types.Transaction, error) + + Unpause(opts *bind.TransactOpts) (*types.Transaction, error) + + FilterConfigSet(opts *bind.FilterOpts) (*CommitStoreConfigSetIterator, error) + + WatchConfigSet(opts *bind.WatchOpts, sink chan<- *CommitStoreConfigSet) (event.Subscription, error) + + ParseConfigSet(log types.Log) (*CommitStoreConfigSet, error) + + FilterConfigSet0(opts *bind.FilterOpts) (*CommitStoreConfigSet0Iterator, error) + + WatchConfigSet0(opts *bind.WatchOpts, sink chan<- *CommitStoreConfigSet0) (event.Subscription, error) + + ParseConfigSet0(log types.Log) (*CommitStoreConfigSet0, error) + + FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*CommitStoreOwnershipTransferRequestedIterator, error) + + WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *CommitStoreOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferRequested(log types.Log) (*CommitStoreOwnershipTransferRequested, error) + + FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*CommitStoreOwnershipTransferredIterator, error) + + WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *CommitStoreOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferred(log types.Log) (*CommitStoreOwnershipTransferred, error) + + FilterPaused(opts *bind.FilterOpts) (*CommitStorePausedIterator, error) + + WatchPaused(opts *bind.WatchOpts, sink chan<- *CommitStorePaused) (event.Subscription, error) + + ParsePaused(log types.Log) (*CommitStorePaused, error) + + FilterReportAccepted(opts *bind.FilterOpts) (*CommitStoreReportAcceptedIterator, error) + + WatchReportAccepted(opts *bind.WatchOpts, sink chan<- *CommitStoreReportAccepted) (event.Subscription, error) + + ParseReportAccepted(log types.Log) (*CommitStoreReportAccepted, error) + + FilterRootRemoved(opts *bind.FilterOpts) (*CommitStoreRootRemovedIterator, error) + + WatchRootRemoved(opts *bind.WatchOpts, sink chan<- *CommitStoreRootRemoved) (event.Subscription, error) + + ParseRootRemoved(log types.Log) (*CommitStoreRootRemoved, error) + + FilterTransmitted(opts *bind.FilterOpts) (*CommitStoreTransmittedIterator, error) + + WatchTransmitted(opts *bind.WatchOpts, sink chan<- *CommitStoreTransmitted) (event.Subscription, error) + + ParseTransmitted(log types.Log) (*CommitStoreTransmitted, error) + + FilterUnpaused(opts *bind.FilterOpts) (*CommitStoreUnpausedIterator, error) + + WatchUnpaused(opts *bind.WatchOpts, sink chan<- *CommitStoreUnpaused) (event.Subscription, error) + + ParseUnpaused(log types.Log) (*CommitStoreUnpaused, error) + + ParseLog(log types.Log) (generated.AbigenLog, error) + + Address() common.Address +} diff --git a/core/gethwrappers/ccip/generated/commit_store_helper/commit_store_helper.go b/core/gethwrappers/ccip/generated/commit_store_helper/commit_store_helper.go new file mode 100644 index 00000000000..3c9b22d67d5 --- /dev/null +++ b/core/gethwrappers/ccip/generated/commit_store_helper/commit_store_helper.go @@ -0,0 +1,2205 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package commit_store_helper + +import ( + "errors" + "fmt" + "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" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" +) + +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +type CommitStoreCommitReport struct { + PriceUpdates InternalPriceUpdates + Interval CommitStoreInterval + MerkleRoot [32]byte +} + +type CommitStoreDynamicConfig struct { + PriceRegistry common.Address +} + +type CommitStoreInterval struct { + Min uint64 + Max uint64 +} + +type CommitStoreStaticConfig struct { + ChainSelector uint64 + SourceChainSelector uint64 + OnRamp common.Address + RmnProxy common.Address +} + +type InternalGasPriceUpdate struct { + DestChainSelector uint64 + UsdPerUnitGas *big.Int +} + +type InternalPriceUpdates struct { + TokenPriceUpdates []InternalTokenPriceUpdate + GasPriceUpdates []InternalGasPriceUpdate +} + +type InternalTokenPriceUpdate struct { + SourceToken common.Address + UsdPerToken *big.Int +} + +var CommitStoreHelperMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"onRamp\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"rmnProxy\",\"type\":\"address\"}],\"internalType\":\"structCommitStore.StaticConfig\",\"name\":\"staticConfig\",\"type\":\"tuple\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"expected\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"actual\",\"type\":\"bytes32\"}],\"name\":\"ConfigDigestMismatch\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"CursedByRMN\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expected\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"actual\",\"type\":\"uint256\"}],\"name\":\"ForkedChain\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidCommitStoreConfig\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"enumOCR2Base.InvalidConfigErrorType\",\"name\":\"errorType\",\"type\":\"uint8\"}],\"name\":\"InvalidConfig\",\"type\":\"error\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"min\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"max\",\"type\":\"uint64\"}],\"internalType\":\"structCommitStore.Interval\",\"name\":\"interval\",\"type\":\"tuple\"}],\"name\":\"InvalidInterval\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidProof\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidRoot\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"LeavesCannotBeEmpty\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NonUniqueSignatures\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OracleCannotBeZeroAddress\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"PausedError\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RootAlreadyCommitted\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"SignaturesOutOfRegistration\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"StaleReport\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UnauthorizedSigner\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UnauthorizedTransmitter\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expected\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"actual\",\"type\":\"uint256\"}],\"name\":\"WrongMessageLength\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"WrongNumberOfSignatures\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"onRamp\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"rmnProxy\",\"type\":\"address\"}],\"indexed\":false,\"internalType\":\"structCommitStore.StaticConfig\",\"name\":\"staticConfig\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"priceRegistry\",\"type\":\"address\"}],\"indexed\":false,\"internalType\":\"structCommitStore.DynamicConfig\",\"name\":\"dynamicConfig\",\"type\":\"tuple\"}],\"name\":\"ConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"previousConfigBlockNumber\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"configCount\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"signers\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"transmitters\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"f\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"onchainConfig\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"offchainConfigVersion\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"offchainConfig\",\"type\":\"bytes\"}],\"name\":\"ConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint40\",\"name\":\"oldEpochAndRound\",\"type\":\"uint40\"},{\"indexed\":false,\"internalType\":\"uint40\",\"name\":\"newEpochAndRound\",\"type\":\"uint40\"}],\"name\":\"LatestPriceEpochAndRoundSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"Paused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"components\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"sourceToken\",\"type\":\"address\"},{\"internalType\":\"uint224\",\"name\":\"usdPerToken\",\"type\":\"uint224\"}],\"internalType\":\"structInternal.TokenPriceUpdate[]\",\"name\":\"tokenPriceUpdates\",\"type\":\"tuple[]\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint224\",\"name\":\"usdPerUnitGas\",\"type\":\"uint224\"}],\"internalType\":\"structInternal.GasPriceUpdate[]\",\"name\":\"gasPriceUpdates\",\"type\":\"tuple[]\"}],\"internalType\":\"structInternal.PriceUpdates\",\"name\":\"priceUpdates\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"min\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"max\",\"type\":\"uint64\"}],\"internalType\":\"structCommitStore.Interval\",\"name\":\"interval\",\"type\":\"tuple\"},{\"internalType\":\"bytes32\",\"name\":\"merkleRoot\",\"type\":\"bytes32\"}],\"indexed\":false,\"internalType\":\"structCommitStore.CommitReport\",\"name\":\"report\",\"type\":\"tuple\"}],\"name\":\"ReportAccepted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"root\",\"type\":\"bytes32\"}],\"name\":\"RootRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"oldSeqNum\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"newSeqNum\",\"type\":\"uint64\"}],\"name\":\"SequenceNumberSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"epoch\",\"type\":\"uint32\"}],\"name\":\"Transmitted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"Unpaused\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getDynamicConfig\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"priceRegistry\",\"type\":\"address\"}],\"internalType\":\"structCommitStore.DynamicConfig\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getExpectedNextSequenceNumber\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getLatestPriceEpochAndRound\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"root\",\"type\":\"bytes32\"}],\"name\":\"getMerkleRoot\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getStaticConfig\",\"outputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"onRamp\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"rmnProxy\",\"type\":\"address\"}],\"internalType\":\"structCommitStore.StaticConfig\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getTransmitters\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"root\",\"type\":\"bytes32\"}],\"name\":\"isBlessed\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isUnpausedAndNotCursed\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestConfigDetails\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"configCount\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"blockNumber\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestConfigDigestAndEpoch\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"scanLogs\",\"type\":\"bool\"},{\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"internalType\":\"uint32\",\"name\":\"epoch\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"paused\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"commitReport\",\"type\":\"bytes\"},{\"internalType\":\"uint40\",\"name\":\"epochAndRound\",\"type\":\"uint40\"}],\"name\":\"report\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32[]\",\"name\":\"rootToReset\",\"type\":\"bytes32[]\"}],\"name\":\"resetUnblessedRoots\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint40\",\"name\":\"latestPriceEpochAndRound\",\"type\":\"uint40\"}],\"name\":\"setLatestPriceEpochAndRound\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"minSeqNr\",\"type\":\"uint64\"}],\"name\":\"setMinSeqNr\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"signers\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"transmitters\",\"type\":\"address[]\"},{\"internalType\":\"uint8\",\"name\":\"f\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"onchainConfig\",\"type\":\"bytes\"},{\"internalType\":\"uint64\",\"name\":\"offchainConfigVersion\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"offchainConfig\",\"type\":\"bytes\"}],\"name\":\"setOCR2Config\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32[3]\",\"name\":\"reportContext\",\"type\":\"bytes32[3]\"},{\"internalType\":\"bytes\",\"name\":\"report\",\"type\":\"bytes\"},{\"internalType\":\"bytes32[]\",\"name\":\"rs\",\"type\":\"bytes32[]\"},{\"internalType\":\"bytes32[]\",\"name\":\"ss\",\"type\":\"bytes32[]\"},{\"internalType\":\"bytes32\",\"name\":\"rawVs\",\"type\":\"bytes32\"}],\"name\":\"transmit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"unpause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32[]\",\"name\":\"hashedLeaves\",\"type\":\"bytes32[]\"},{\"internalType\":\"bytes32[]\",\"name\":\"proofs\",\"type\":\"bytes32[]\"},{\"internalType\":\"uint256\",\"name\":\"proofFlagBits\",\"type\":\"uint256\"}],\"name\":\"verify\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", + Bin: "0x61014060405260098054600165ff000000000160401b03191660011790553480156200002a57600080fd5b506040516200382a3803806200382a8339810160408190526200004d9162000274565b80600033808281620000a65760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000d957620000d98162000194565b50505015156080524660a05260408101516001600160a01b0316158062000108575080516001600160401b0316155b806200011f575060208101516001600160401b0316155b8062000136575060608101516001600160a01b0316155b156200015557604051631fc5f15f60e11b815260040160405180910390fd5b80516001600160401b0390811660c05260208201511660e05260408101516001600160a01b039081166101005260609091015116610120525062000308565b336001600160a01b03821603620001ee5760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c6600000000000000000060448201526064016200009d565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b80516001600160401b03811681146200025757600080fd5b919050565b80516001600160a01b03811681146200025757600080fd5b6000608082840312156200028757600080fd5b604051608081016001600160401b0381118282101715620002b857634e487b7160e01b600052604160045260246000fd5b604052620002c6836200023f565b8152620002d6602084016200023f565b6020820152620002e9604084016200025c565b6040820152620002fc606084016200025c565b60608201529392505050565b60805160a05160c05160e051610100516101205161348c6200039e6000396000818161026d015281816116f6015281816118a5015281816119cf0152611f5d0152600081816102310152611f36015260008181610201015281816116b00152818161198c0152611f0f0152600081816101d10152611ee00152600081816110f60152611142015260006111bd015261348c6000f3fe608060405234801561001057600080fd5b50600436106101985760003560e01c806379ba5097116100e3578063afcb95d71161008c578063f2fde38b11610066578063f2fde38b14610501578063f47a869014610514578063ff888fb11461052757600080fd5b8063afcb95d7146104c6578063b1dc65a4146104e6578063e89d039f146104f957600080fd5b80638da5cb5b116100bd5780638da5cb5b1461046b578063a7206cd614610493578063ad7a22f8146104b357600080fd5b806379ba50971461042b57806381ff7048146104335780638456cb591461046357600080fd5b806332048875116101455780635c975abb1161011f5780635c975abb146103af578063666cab8d146103d75780637437ff9f146103ec57600080fd5b806332048875146103745780633f4ba83a146103955780634120fccd1461039d57600080fd5b80631dc18e56116101765780631dc18e56146103395780631ef381741461034e57806329b980e41461036157600080fd5b806306285c691461019d57806310c374ed146102c0578063181f5a77146102f0575b600080fd5b6102aa60408051608081018252600080825260208201819052918101829052606081019190915260405180608001604052807f000000000000000000000000000000000000000000000000000000000000000067ffffffffffffffff1681526020017f000000000000000000000000000000000000000000000000000000000000000067ffffffffffffffff1681526020017f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1681526020017f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16815250905090565b6040516102b791906125ac565b60405180910390f35b60095468010000000000000000900464ffffffffff165b60405167ffffffffffffffff90911681526020016102b7565b61032c6040518060400160405280601181526020017f436f6d6d697453746f726520312e352e3000000000000000000000000000000081525081565b6040516102b79190612669565b61034c6103473660046126df565b61053a565b005b61034c61035c366004612972565b61054a565b61034c61036f366004612a3f565b610c2e565b610387610382366004612a9f565b610cbe565b6040519081526020016102b7565b61034c610db4565b60095467ffffffffffffffff166102d7565b6009546d0100000000000000000000000000900460ff165b60405190151581526020016102b7565b6103df610e1a565b6040516102b79190612b65565b604080516020808201835260009091528151808201835260085473ffffffffffffffffffffffffffffffffffffffff16908190529151918252016102b7565b61034c610e89565b6004546002546040805163ffffffff808516825264010000000090940490931660208401528201526060016102b7565b61034c610f86565b60005460405173ffffffffffffffffffffffffffffffffffffffff90911681526020016102b7565b6103876104a1366004612b78565b6000908152600a602052604090205490565b61034c6104c1366004612b91565b610ff6565b6040805160018152600060208201819052918101919091526060016102b7565b61034c6104f4366004612bac565b611071565b6103c7611688565b61034c61050f366004612c63565b61179c565b61034c610522366004612c80565b6117b0565b6103c7610535366004612b78565b611842565b610545838383611916565b505050565b855185518560ff16601f8311156105995760016040517f367f56a20000000000000000000000000000000000000000000000000000000081526004016105909190612cf1565b60405180910390fd5b806000036105d65760006040517f367f56a20000000000000000000000000000000000000000000000000000000081526004016105909190612cf1565b8183146106125760046040517f367f56a20000000000000000000000000000000000000000000000000000000081526004016105909190612cf1565b61061d816003612d61565b83116106585760026040517f367f56a20000000000000000000000000000000000000000000000000000000081526004016105909190612cf1565b610660611d7f565b61066986611e02565b60065460005b8181101561075d57600560006006838154811061068e5761068e612d78565b600091825260208083209091015473ffffffffffffffffffffffffffffffffffffffff168352820192909252604001812080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000169055600780546005929190849081106106fe576106fe612d78565b600091825260208083209091015473ffffffffffffffffffffffffffffffffffffffff168352820192909252604001902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000016905560010161066f565b50895160005b81811015610ad65760008c828151811061077f5761077f612d78565b602002602001015190506000600281111561079c5761079c612cc2565b73ffffffffffffffffffffffffffffffffffffffff8216600090815260056020526040902054610100900460ff1660028111156107db576107db612cc2565b146108155760036040517f367f56a20000000000000000000000000000000000000000000000000000000081526004016105909190612cf1565b73ffffffffffffffffffffffffffffffffffffffff8116610862576040517fd6c62c9b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040805180820190915260ff83168152602081016001905273ffffffffffffffffffffffffffffffffffffffff821660009081526005602090815260409091208251815460ff9091167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0082168117835592840151919283917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000161761010083600281111561091257610912612cc2565b021790555090505060008c838151811061092e5761092e612d78565b602002602001015190506000600281111561094b5761094b612cc2565b73ffffffffffffffffffffffffffffffffffffffff8216600090815260056020526040902054610100900460ff16600281111561098a5761098a612cc2565b146109c45760036040517f367f56a20000000000000000000000000000000000000000000000000000000081526004016105909190612cf1565b73ffffffffffffffffffffffffffffffffffffffff8116610a11576040517fd6c62c9b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040805180820190915260ff84168152602081016002905273ffffffffffffffffffffffffffffffffffffffff821660009081526005602090815260409091208251815460ff9091167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0082168117835592840151919283917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00001617610100836002811115610ac157610ac1612cc2565b02179055509050505050806001019050610763565b508a51610aea9060069060208e01906124ee565b508951610afe9060079060208d01906124ee565b506003805460ff838116610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000909216908c161717905560048054610b84914691309190600090610b569063ffffffff16612da7565b91906101000a81548163ffffffff021916908363ffffffff160217905563ffffffff168e8e8e8e8e8e611fb2565b600260000181905550600060048054906101000a900463ffffffff169050436004806101000a81548163ffffffff021916908363ffffffff1602179055507f1591690b8638f5fb2dbec82ac741805ac5da8b45dc5263f4875b0496fdce4e0581600260000154600460009054906101000a900463ffffffff168f8f8f8f8f8f604051610c1899989796959493929190612dca565b60405180910390a1505050505050505050505050565b610c36611d7f565b6009805464ffffffffff838116680100000000000000008181027fffffffffffffffffffffffffffffffffffffff0000000000ffffffffffffffff85161790945560408051949093049091168084526020840191909152917ff0d557bfce33e354b41885eb9264448726cfe51f486ffa69809d2bf56545644491015b60405180910390a15050565b6009546000906d0100000000000000000000000000900460ff1615610d0f576040517feced32bc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000610d8087878080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808b0282810182019093528a82529093508a92508991829185019084908082843760009201919091525088925061205d915050565b9050610d8b81611842565b610d99576000915050610dab565b6000908152600a602052604090205490505b95945050505050565b610dbc611d7f565b600980547fffffffffffffffffffffffffffffffffffff00ffffffffffffffffffffffffff1690556040513381527f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa906020015b60405180910390a1565b60606007805480602002602001604051908101604052809291908181526020018280548015610e7f57602002820191906000526020600020905b815473ffffffffffffffffffffffffffffffffffffffff168152600190910190602001808311610e54575b5050505050905090565b60015473ffffffffffffffffffffffffffffffffffffffff163314610f0a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e6572000000000000000000006044820152606401610590565b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b610f8e611d7f565b600980547fffffffffffffffffffffffffffffffffffff00ffffffffffffffffffffffffff166d01000000000000000000000000001790556040513381527f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25890602001610e10565b610ffe611d7f565b6009805467ffffffffffffffff8381167fffffffffffffffffffffffffffffffffffffffffffffffff000000000000000083168117909355604080519190921680825260208201939093527fea59e8027e41fda1525220008cf2416797405065eb21b0ebd417bfc6d361b8de9101610cb2565b611080878760208b0135611916565b6040805160608101825260025480825260035460ff8082166020850152610100909104169282019290925289359182146110f35780516040517f93df584c000000000000000000000000000000000000000000000000000000008152600481019190915260248101839052604401610590565b467f000000000000000000000000000000000000000000000000000000000000000014611174576040517f0f01ce850000000000000000000000000000000000000000000000000000000081527f00000000000000000000000000000000000000000000000000000000000000006004820152466024820152604401610590565b6040805183815260208c81013560081c63ffffffff16908201527fb04e63db38c49950639fa09d29872f21f5d49d614f3a969d8adf3d4b52e41a62910160405180910390a160007f000000000000000000000000000000000000000000000000000000000000000015611216576002826020015183604001516111f79190612e60565b6112019190612e79565b61120c906001612e60565b60ff16905061122c565b6020820151611226906001612e60565b60ff1690505b868114611265576040517f71253a2500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b86851461129e576040517fa75d88af00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b3360009081526005602090815260408083208151808301909252805460ff808216845292939192918401916101009091041660028111156112e1576112e1612cc2565b60028111156112f2576112f2612cc2565b905250905060028160200151600281111561130f5761130f612cc2565b14801561135657506007816000015160ff168154811061133157611331612d78565b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff1633145b61138c576040517fda0f08e800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50600061139a866020612d61565b6113a5896020612d61565b6113b18c610144612ec2565b6113bb9190612ec2565b6113c59190612ec2565b9050368114611409576040517f8e1192e100000000000000000000000000000000000000000000000000000000815260048101829052366024820152604401610590565b5060008a8a60405161141c929190612ed5565b604051908190038120611433918e90602001612ee5565b604051602081830303815290604052805190602001209050611453612578565b8860005b818110156116775760006001858a846020811061147657611476612d78565b61148391901a601b612e60565b8f8f8681811061149557611495612d78565b905060200201358e8e878181106114ae576114ae612d78565b90506020020135604051600081526020016040526040516114eb949392919093845260ff9290921660208401526040830152606082015260800190565b6020604051602081039080840390855afa15801561150d573d6000803e3d6000fd5b5050604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081015173ffffffffffffffffffffffffffffffffffffffff8116600090815260056020908152848220848601909552845460ff808216865293975091955092939284019161010090910416600281111561159057611590612cc2565b60028111156115a1576115a1612cc2565b90525090506001816020015160028111156115be576115be612cc2565b146115f5576040517fca31867a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8051859060ff16601f811061160c5761160c612d78565b602002015115611648576040517ff67bc7c400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600185826000015160ff16601f811061166357611663612d78565b911515602090920201525050600101611457565b505050505050505050505050505050565b6040517f2cbc26bb0000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000060801b77ffffffffffffffff000000000000000000000000000000001660048201526000907f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1690632cbc26bb90602401602060405180830381865afa158015611752573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117769190612ef9565b15801561179757506009546d0100000000000000000000000000900460ff16155b905090565b6117a4611d7f565b6117ad8161237e565b50565b6117b8611d7f565b60005b818110156105455760008383838181106117d7576117d7612d78565b9050602002013590506117e981611842565b611839576000818152600a602052604080822091909155517f202f1139a3e334b6056064c0e9b19fd07e44a88d8f6e5ded571b24cf8c371f12906118309083815260200190565b60405180910390a15b506001016117bb565b6040805180820182523081526020810183815291517f4d616771000000000000000000000000000000000000000000000000000000008152905173ffffffffffffffffffffffffffffffffffffffff9081166004830152915160248201526000917f00000000000000000000000000000000000000000000000000000000000000001690634d61677190604401602060405180830381865afa1580156118ec573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119109190612ef9565b92915050565b6009546d0100000000000000000000000000900460ff1615611964576040517feced32bc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f2cbc26bb0000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000060801b77ffffffffffffffff000000000000000000000000000000001660048201527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1690632cbc26bb90602401602060405180830381865afa158015611a2b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a4f9190612ef9565b15611a86576040517f53ad11d800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000611a9483850185613012565b80515151909150151580611aad57508051602001515115155b15611be55760095464ffffffffff80841668010000000000000000909204161015611baa57600980547fffffffffffffffffffffffffffffffffffffff0000000000ffffffffffffffff166801000000000000000064ffffffffff85160217905560085481516040517f3937306f00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff90921691633937306f91611b6491600401613265565b600060405180830381600087803b158015611b7e57600080fd5b505af1158015611b92573d6000803e3d6000fd5b505050506040810151611ba55750505050565b611be5565b6040810151611be5576040517ff803a2ca00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60208101515160095467ffffffffffffffff9081169116141580611c20575060208082015190810151905167ffffffffffffffff9182169116115b15611c5d5780602001516040517fbb1ae18d0000000000000000000000000000000000000000000000000000000081526004016105909190613278565b6040810151611c98576040517f504570e300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040808201516000908152600a602052205415611ce1576040517fa0bce24f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6020808201510151611cf490600161329d565b600980547fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000001667ffffffffffffffff929092169190911790556040818101516000908152600a602052819020429055517f291698c01aa71f912280535d88a00d2c59fb63530a3f5d0098560468acb9ebf590611d719083906132c5565b60405180910390a150505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314611e00576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e6572000000000000000000006044820152606401610590565b565b600081806020019051810190611e189190613321565b805190915073ffffffffffffffffffffffffffffffffffffffff16611e69576040517f3f8be2be00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8051600880547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff928316179055600980547fffffffffffffffffffffffffffffffffffffff0000000000ffffffffffffffff169055604080516080810182527f000000000000000000000000000000000000000000000000000000000000000067ffffffffffffffff90811682527f00000000000000000000000000000000000000000000000000000000000000001660208201527f00000000000000000000000000000000000000000000000000000000000000008316818301527f00000000000000000000000000000000000000000000000000000000000000009092166060830152517fc9d7123efd4203e60b0f0a4b1dbc4800fc97ce63679f71c3a27279b24a7ddec391610cb291849061336d565b6000808a8a8a8a8a8a8a8a8a604051602001611fd6999897969594939291906133ea565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815291905280516020909101207dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167e01000000000000000000000000000000000000000000000000000000000000179150509998505050505050505050565b825182516000919081830361209e576040517f11a6b26400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61010182118015906120b257506101018111155b6120e8576040517f09bde33900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82820101610100811115612149576040517f09bde33900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80600003612176578660008151811061216457612164612d78565b60200260200101519350505050612377565b60008167ffffffffffffffff81111561219157612191612733565b6040519080825280602002602001820160405280156121ba578160200160208202803683370190505b50905060008080805b858110156122fd5760006001821b8b81160361221e5788851015612207578c5160018601958e9181106121f8576121f8612d78565b60200260200101519050612240565b85516001850194879181106121f8576121f8612d78565b8b5160018401938d91811061223557612235612d78565b602002602001015190505b600089861015612270578d5160018701968f91811061226157612261612d78565b60200260200101519050612292565b865160018601958891811061228757612287612d78565b602002602001015190505b828511156122cc576040517f09bde33900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6122d68282612473565b8784815181106122e8576122e8612d78565b602090810291909101015250506001016121c3565b50600185038214801561230f57508683145b801561231a57508581145b612350576040517f09bde33900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b83600186038151811061236557612365612d78565b60200260200101519750505050505050505b9392505050565b3373ffffffffffffffffffffffffffffffffffffffff8216036123fd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c660000000000000000006044820152606401610590565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b60008183106124b55760408051600160208083019190915281830185905260608083018790528351808403909101815260809092019092528051910120612377565b60408051600160208083019190915281830186905260608083018690528351808403909101815260809092019092528051910120612377565b828054828255906000526020600020908101928215612568579160200282015b8281111561256857825182547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff90911617825560209092019160019091019061250e565b50612574929150612597565b5090565b604051806103e00160405280601f906020820280368337509192915050565b5b808211156125745760008155600101612598565b60808101611910828467ffffffffffffffff80825116835280602083015116602084015250604081015173ffffffffffffffffffffffffffffffffffffffff808216604085015280606084015116606085015250505050565b6000815180845260005b8181101561262b5760208185018101518683018201520161260f565b5060006020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b6020815260006123776020830184612605565b60008083601f84011261268e57600080fd5b50813567ffffffffffffffff8111156126a657600080fd5b6020830191508360208285010111156126be57600080fd5b9250929050565b803564ffffffffff811681146126da57600080fd5b919050565b6000806000604084860312156126f457600080fd5b833567ffffffffffffffff81111561270b57600080fd5b6127178682870161267c565b909450925061272a9050602085016126c5565b90509250925092565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040805190810167ffffffffffffffff8111828210171561278557612785612733565b60405290565b6040516060810167ffffffffffffffff8111828210171561278557612785612733565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff811182821017156127f5576127f5612733565b604052919050565b600067ffffffffffffffff82111561281757612817612733565b5060051b60200190565b73ffffffffffffffffffffffffffffffffffffffff811681146117ad57600080fd5b600082601f83011261285457600080fd5b81356020612869612864836127fd565b6127ae565b8083825260208201915060208460051b87010193508684111561288b57600080fd5b602086015b848110156128b05780356128a381612821565b8352918301918301612890565b509695505050505050565b803560ff811681146126da57600080fd5b600082601f8301126128dd57600080fd5b813567ffffffffffffffff8111156128f7576128f7612733565b61292860207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116016127ae565b81815284602083860101111561293d57600080fd5b816020850160208301376000918101602001919091529392505050565b803567ffffffffffffffff811681146126da57600080fd5b60008060008060008060c0878903121561298b57600080fd5b863567ffffffffffffffff808211156129a357600080fd5b6129af8a838b01612843565b975060208901359150808211156129c557600080fd5b6129d18a838b01612843565b96506129df60408a016128bb565b955060608901359150808211156129f557600080fd5b612a018a838b016128cc565b9450612a0f60808a0161295a565b935060a0890135915080821115612a2557600080fd5b50612a3289828a016128cc565b9150509295509295509295565b600060208284031215612a5157600080fd5b612377826126c5565b60008083601f840112612a6c57600080fd5b50813567ffffffffffffffff811115612a8457600080fd5b6020830191508360208260051b85010111156126be57600080fd5b600080600080600060608688031215612ab757600080fd5b853567ffffffffffffffff80821115612acf57600080fd5b612adb89838a01612a5a565b90975095506020880135915080821115612af457600080fd5b50612b0188828901612a5a565b96999598509660400135949350505050565b60008151808452602080850194506020840160005b83811015612b5a57815173ffffffffffffffffffffffffffffffffffffffff1687529582019590820190600101612b28565b509495945050505050565b6020815260006123776020830184612b13565b600060208284031215612b8a57600080fd5b5035919050565b600060208284031215612ba357600080fd5b6123778261295a565b60008060008060008060008060e0898b031215612bc857600080fd5b606089018a811115612bd957600080fd5b8998503567ffffffffffffffff80821115612bf357600080fd5b612bff8c838d0161267c565b909950975060808b0135915080821115612c1857600080fd5b612c248c838d01612a5a565b909750955060a08b0135915080821115612c3d57600080fd5b50612c4a8b828c01612a5a565b999c989b50969995989497949560c00135949350505050565b600060208284031215612c7557600080fd5b813561237781612821565b60008060208385031215612c9357600080fd5b823567ffffffffffffffff811115612caa57600080fd5b612cb685828601612a5a565b90969095509350505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b6020810160058310612d2c577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b91905290565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b808202811582820484141761191057611910612d32565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600063ffffffff808316818103612dc057612dc0612d32565b6001019392505050565b600061012063ffffffff808d1684528b6020850152808b16604085015250806060840152612dfa8184018a612b13565b90508281036080840152612e0e8189612b13565b905060ff871660a084015282810360c0840152612e2b8187612605565b905067ffffffffffffffff851660e0840152828103610100840152612e508185612605565b9c9b505050505050505050505050565b60ff818116838216019081111561191057611910612d32565b600060ff831680612eb3577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b8060ff84160491505092915050565b8082018082111561191057611910612d32565b8183823760009101908152919050565b828152606082602083013760800192915050565b600060208284031215612f0b57600080fd5b8151801515811461237757600080fd5b80357bffffffffffffffffffffffffffffffffffffffffffffffffffffffff811681146126da57600080fd5b600082601f830112612f5857600080fd5b81356020612f68612864836127fd565b82815260069290921b84018101918181019086841115612f8757600080fd5b8286015b848110156128b05760408189031215612fa45760008081fd5b612fac612762565b612fb58261295a565b8152612fc2858301612f1b565b81860152835291830191604001612f8b565b600060408284031215612fe657600080fd5b612fee612762565b9050612ff98261295a565b81526130076020830161295a565b602082015292915050565b6000602080838503121561302557600080fd5b823567ffffffffffffffff8082111561303d57600080fd5b908401906080828703121561305157600080fd5b61305961278b565b82358281111561306857600080fd5b8301604081890381131561307b57600080fd5b613083612762565b82358581111561309257600080fd5b8301601f81018b136130a357600080fd5b80356130b1612864826127fd565b81815260069190911b8201890190898101908d8311156130d057600080fd5b928a01925b828410156131205785848f0312156130ed5760008081fd5b6130f5612762565b843561310081612821565b815261310d858d01612f1b565b818d0152825292850192908a01906130d5565b84525050508287013591508482111561313857600080fd5b6131448a838501612f47565b81880152835250613159905087848601612fd4565b93810193909352506060013560408201529392505050565b805160408084528151848201819052600092602091908201906060870190855b818110156131ea578351805173ffffffffffffffffffffffffffffffffffffffff1684528501517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff16858401529284019291850191600101613191565b50508583015187820388850152805180835290840192506000918401905b80831015613259578351805167ffffffffffffffff1683528501517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1685830152928401926001929092019190850190613208565b50979650505050505050565b6020815260006123776020830184613171565b604081016119108284805167ffffffffffffffff908116835260209182015116910152565b67ffffffffffffffff8181168382160190808211156132be576132be612d32565b5092915050565b6020815260008251608060208401526132e160a0840182613171565b9050602084015161330c6040850182805167ffffffffffffffff908116835260209182015116910152565b50604084015160808401528091505092915050565b60006020828403121561333357600080fd5b6040516020810181811067ffffffffffffffff8211171561335657613356612733565b604052825161336481612821565b81529392505050565b60a081016133c6828567ffffffffffffffff80825116835280602083015116602084015250604081015173ffffffffffffffffffffffffffffffffffffffff808216604085015280606084015116606085015250505050565b73ffffffffffffffffffffffffffffffffffffffff83511660808301529392505050565b60006101208b835273ffffffffffffffffffffffffffffffffffffffff8b16602084015267ffffffffffffffff808b1660408501528160608501526134318285018b612b13565b91508382036080850152613445828a612b13565b915060ff881660a085015283820360c08501526134628288612605565b90861660e08501528381036101008501529050612e50818561260556fea164736f6c6343000818000a", +} + +var CommitStoreHelperABI = CommitStoreHelperMetaData.ABI + +var CommitStoreHelperBin = CommitStoreHelperMetaData.Bin + +func DeployCommitStoreHelper(auth *bind.TransactOpts, backend bind.ContractBackend, staticConfig CommitStoreStaticConfig) (common.Address, *types.Transaction, *CommitStoreHelper, error) { + parsed, err := CommitStoreHelperMetaData.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(CommitStoreHelperBin), backend, staticConfig) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &CommitStoreHelper{address: address, abi: *parsed, CommitStoreHelperCaller: CommitStoreHelperCaller{contract: contract}, CommitStoreHelperTransactor: CommitStoreHelperTransactor{contract: contract}, CommitStoreHelperFilterer: CommitStoreHelperFilterer{contract: contract}}, nil +} + +type CommitStoreHelper struct { + address common.Address + abi abi.ABI + CommitStoreHelperCaller + CommitStoreHelperTransactor + CommitStoreHelperFilterer +} + +type CommitStoreHelperCaller struct { + contract *bind.BoundContract +} + +type CommitStoreHelperTransactor struct { + contract *bind.BoundContract +} + +type CommitStoreHelperFilterer struct { + contract *bind.BoundContract +} + +type CommitStoreHelperSession struct { + Contract *CommitStoreHelper + CallOpts bind.CallOpts + TransactOpts bind.TransactOpts +} + +type CommitStoreHelperCallerSession struct { + Contract *CommitStoreHelperCaller + CallOpts bind.CallOpts +} + +type CommitStoreHelperTransactorSession struct { + Contract *CommitStoreHelperTransactor + TransactOpts bind.TransactOpts +} + +type CommitStoreHelperRaw struct { + Contract *CommitStoreHelper +} + +type CommitStoreHelperCallerRaw struct { + Contract *CommitStoreHelperCaller +} + +type CommitStoreHelperTransactorRaw struct { + Contract *CommitStoreHelperTransactor +} + +func NewCommitStoreHelper(address common.Address, backend bind.ContractBackend) (*CommitStoreHelper, error) { + abi, err := abi.JSON(strings.NewReader(CommitStoreHelperABI)) + if err != nil { + return nil, err + } + contract, err := bindCommitStoreHelper(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &CommitStoreHelper{address: address, abi: abi, CommitStoreHelperCaller: CommitStoreHelperCaller{contract: contract}, CommitStoreHelperTransactor: CommitStoreHelperTransactor{contract: contract}, CommitStoreHelperFilterer: CommitStoreHelperFilterer{contract: contract}}, nil +} + +func NewCommitStoreHelperCaller(address common.Address, caller bind.ContractCaller) (*CommitStoreHelperCaller, error) { + contract, err := bindCommitStoreHelper(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &CommitStoreHelperCaller{contract: contract}, nil +} + +func NewCommitStoreHelperTransactor(address common.Address, transactor bind.ContractTransactor) (*CommitStoreHelperTransactor, error) { + contract, err := bindCommitStoreHelper(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &CommitStoreHelperTransactor{contract: contract}, nil +} + +func NewCommitStoreHelperFilterer(address common.Address, filterer bind.ContractFilterer) (*CommitStoreHelperFilterer, error) { + contract, err := bindCommitStoreHelper(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &CommitStoreHelperFilterer{contract: contract}, nil +} + +func bindCommitStoreHelper(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := CommitStoreHelperMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +func (_CommitStoreHelper *CommitStoreHelperRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _CommitStoreHelper.Contract.CommitStoreHelperCaller.contract.Call(opts, result, method, params...) +} + +func (_CommitStoreHelper *CommitStoreHelperRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _CommitStoreHelper.Contract.CommitStoreHelperTransactor.contract.Transfer(opts) +} + +func (_CommitStoreHelper *CommitStoreHelperRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _CommitStoreHelper.Contract.CommitStoreHelperTransactor.contract.Transact(opts, method, params...) +} + +func (_CommitStoreHelper *CommitStoreHelperCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _CommitStoreHelper.Contract.contract.Call(opts, result, method, params...) +} + +func (_CommitStoreHelper *CommitStoreHelperTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _CommitStoreHelper.Contract.contract.Transfer(opts) +} + +func (_CommitStoreHelper *CommitStoreHelperTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _CommitStoreHelper.Contract.contract.Transact(opts, method, params...) +} + +func (_CommitStoreHelper *CommitStoreHelperCaller) GetDynamicConfig(opts *bind.CallOpts) (CommitStoreDynamicConfig, error) { + var out []interface{} + err := _CommitStoreHelper.contract.Call(opts, &out, "getDynamicConfig") + + if err != nil { + return *new(CommitStoreDynamicConfig), err + } + + out0 := *abi.ConvertType(out[0], new(CommitStoreDynamicConfig)).(*CommitStoreDynamicConfig) + + return out0, err + +} + +func (_CommitStoreHelper *CommitStoreHelperSession) GetDynamicConfig() (CommitStoreDynamicConfig, error) { + return _CommitStoreHelper.Contract.GetDynamicConfig(&_CommitStoreHelper.CallOpts) +} + +func (_CommitStoreHelper *CommitStoreHelperCallerSession) GetDynamicConfig() (CommitStoreDynamicConfig, error) { + return _CommitStoreHelper.Contract.GetDynamicConfig(&_CommitStoreHelper.CallOpts) +} + +func (_CommitStoreHelper *CommitStoreHelperCaller) GetExpectedNextSequenceNumber(opts *bind.CallOpts) (uint64, error) { + var out []interface{} + err := _CommitStoreHelper.contract.Call(opts, &out, "getExpectedNextSequenceNumber") + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +func (_CommitStoreHelper *CommitStoreHelperSession) GetExpectedNextSequenceNumber() (uint64, error) { + return _CommitStoreHelper.Contract.GetExpectedNextSequenceNumber(&_CommitStoreHelper.CallOpts) +} + +func (_CommitStoreHelper *CommitStoreHelperCallerSession) GetExpectedNextSequenceNumber() (uint64, error) { + return _CommitStoreHelper.Contract.GetExpectedNextSequenceNumber(&_CommitStoreHelper.CallOpts) +} + +func (_CommitStoreHelper *CommitStoreHelperCaller) GetLatestPriceEpochAndRound(opts *bind.CallOpts) (uint64, error) { + var out []interface{} + err := _CommitStoreHelper.contract.Call(opts, &out, "getLatestPriceEpochAndRound") + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +func (_CommitStoreHelper *CommitStoreHelperSession) GetLatestPriceEpochAndRound() (uint64, error) { + return _CommitStoreHelper.Contract.GetLatestPriceEpochAndRound(&_CommitStoreHelper.CallOpts) +} + +func (_CommitStoreHelper *CommitStoreHelperCallerSession) GetLatestPriceEpochAndRound() (uint64, error) { + return _CommitStoreHelper.Contract.GetLatestPriceEpochAndRound(&_CommitStoreHelper.CallOpts) +} + +func (_CommitStoreHelper *CommitStoreHelperCaller) GetMerkleRoot(opts *bind.CallOpts, root [32]byte) (*big.Int, error) { + var out []interface{} + err := _CommitStoreHelper.contract.Call(opts, &out, "getMerkleRoot", root) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_CommitStoreHelper *CommitStoreHelperSession) GetMerkleRoot(root [32]byte) (*big.Int, error) { + return _CommitStoreHelper.Contract.GetMerkleRoot(&_CommitStoreHelper.CallOpts, root) +} + +func (_CommitStoreHelper *CommitStoreHelperCallerSession) GetMerkleRoot(root [32]byte) (*big.Int, error) { + return _CommitStoreHelper.Contract.GetMerkleRoot(&_CommitStoreHelper.CallOpts, root) +} + +func (_CommitStoreHelper *CommitStoreHelperCaller) GetStaticConfig(opts *bind.CallOpts) (CommitStoreStaticConfig, error) { + var out []interface{} + err := _CommitStoreHelper.contract.Call(opts, &out, "getStaticConfig") + + if err != nil { + return *new(CommitStoreStaticConfig), err + } + + out0 := *abi.ConvertType(out[0], new(CommitStoreStaticConfig)).(*CommitStoreStaticConfig) + + return out0, err + +} + +func (_CommitStoreHelper *CommitStoreHelperSession) GetStaticConfig() (CommitStoreStaticConfig, error) { + return _CommitStoreHelper.Contract.GetStaticConfig(&_CommitStoreHelper.CallOpts) +} + +func (_CommitStoreHelper *CommitStoreHelperCallerSession) GetStaticConfig() (CommitStoreStaticConfig, error) { + return _CommitStoreHelper.Contract.GetStaticConfig(&_CommitStoreHelper.CallOpts) +} + +func (_CommitStoreHelper *CommitStoreHelperCaller) GetTransmitters(opts *bind.CallOpts) ([]common.Address, error) { + var out []interface{} + err := _CommitStoreHelper.contract.Call(opts, &out, "getTransmitters") + + if err != nil { + return *new([]common.Address), err + } + + out0 := *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) + + return out0, err + +} + +func (_CommitStoreHelper *CommitStoreHelperSession) GetTransmitters() ([]common.Address, error) { + return _CommitStoreHelper.Contract.GetTransmitters(&_CommitStoreHelper.CallOpts) +} + +func (_CommitStoreHelper *CommitStoreHelperCallerSession) GetTransmitters() ([]common.Address, error) { + return _CommitStoreHelper.Contract.GetTransmitters(&_CommitStoreHelper.CallOpts) +} + +func (_CommitStoreHelper *CommitStoreHelperCaller) IsBlessed(opts *bind.CallOpts, root [32]byte) (bool, error) { + var out []interface{} + err := _CommitStoreHelper.contract.Call(opts, &out, "isBlessed", root) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_CommitStoreHelper *CommitStoreHelperSession) IsBlessed(root [32]byte) (bool, error) { + return _CommitStoreHelper.Contract.IsBlessed(&_CommitStoreHelper.CallOpts, root) +} + +func (_CommitStoreHelper *CommitStoreHelperCallerSession) IsBlessed(root [32]byte) (bool, error) { + return _CommitStoreHelper.Contract.IsBlessed(&_CommitStoreHelper.CallOpts, root) +} + +func (_CommitStoreHelper *CommitStoreHelperCaller) IsUnpausedAndNotCursed(opts *bind.CallOpts) (bool, error) { + var out []interface{} + err := _CommitStoreHelper.contract.Call(opts, &out, "isUnpausedAndNotCursed") + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_CommitStoreHelper *CommitStoreHelperSession) IsUnpausedAndNotCursed() (bool, error) { + return _CommitStoreHelper.Contract.IsUnpausedAndNotCursed(&_CommitStoreHelper.CallOpts) +} + +func (_CommitStoreHelper *CommitStoreHelperCallerSession) IsUnpausedAndNotCursed() (bool, error) { + return _CommitStoreHelper.Contract.IsUnpausedAndNotCursed(&_CommitStoreHelper.CallOpts) +} + +func (_CommitStoreHelper *CommitStoreHelperCaller) LatestConfigDetails(opts *bind.CallOpts) (LatestConfigDetails, + + error) { + var out []interface{} + err := _CommitStoreHelper.contract.Call(opts, &out, "latestConfigDetails") + + outstruct := new(LatestConfigDetails) + if err != nil { + return *outstruct, err + } + + outstruct.ConfigCount = *abi.ConvertType(out[0], new(uint32)).(*uint32) + outstruct.BlockNumber = *abi.ConvertType(out[1], new(uint32)).(*uint32) + outstruct.ConfigDigest = *abi.ConvertType(out[2], new([32]byte)).(*[32]byte) + + return *outstruct, err + +} + +func (_CommitStoreHelper *CommitStoreHelperSession) LatestConfigDetails() (LatestConfigDetails, + + error) { + return _CommitStoreHelper.Contract.LatestConfigDetails(&_CommitStoreHelper.CallOpts) +} + +func (_CommitStoreHelper *CommitStoreHelperCallerSession) LatestConfigDetails() (LatestConfigDetails, + + error) { + return _CommitStoreHelper.Contract.LatestConfigDetails(&_CommitStoreHelper.CallOpts) +} + +func (_CommitStoreHelper *CommitStoreHelperCaller) LatestConfigDigestAndEpoch(opts *bind.CallOpts) (LatestConfigDigestAndEpoch, + + error) { + var out []interface{} + err := _CommitStoreHelper.contract.Call(opts, &out, "latestConfigDigestAndEpoch") + + outstruct := new(LatestConfigDigestAndEpoch) + if err != nil { + return *outstruct, err + } + + outstruct.ScanLogs = *abi.ConvertType(out[0], new(bool)).(*bool) + outstruct.ConfigDigest = *abi.ConvertType(out[1], new([32]byte)).(*[32]byte) + outstruct.Epoch = *abi.ConvertType(out[2], new(uint32)).(*uint32) + + return *outstruct, err + +} + +func (_CommitStoreHelper *CommitStoreHelperSession) LatestConfigDigestAndEpoch() (LatestConfigDigestAndEpoch, + + error) { + return _CommitStoreHelper.Contract.LatestConfigDigestAndEpoch(&_CommitStoreHelper.CallOpts) +} + +func (_CommitStoreHelper *CommitStoreHelperCallerSession) LatestConfigDigestAndEpoch() (LatestConfigDigestAndEpoch, + + error) { + return _CommitStoreHelper.Contract.LatestConfigDigestAndEpoch(&_CommitStoreHelper.CallOpts) +} + +func (_CommitStoreHelper *CommitStoreHelperCaller) Owner(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _CommitStoreHelper.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 + +} + +func (_CommitStoreHelper *CommitStoreHelperSession) Owner() (common.Address, error) { + return _CommitStoreHelper.Contract.Owner(&_CommitStoreHelper.CallOpts) +} + +func (_CommitStoreHelper *CommitStoreHelperCallerSession) Owner() (common.Address, error) { + return _CommitStoreHelper.Contract.Owner(&_CommitStoreHelper.CallOpts) +} + +func (_CommitStoreHelper *CommitStoreHelperCaller) Paused(opts *bind.CallOpts) (bool, error) { + var out []interface{} + err := _CommitStoreHelper.contract.Call(opts, &out, "paused") + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_CommitStoreHelper *CommitStoreHelperSession) Paused() (bool, error) { + return _CommitStoreHelper.Contract.Paused(&_CommitStoreHelper.CallOpts) +} + +func (_CommitStoreHelper *CommitStoreHelperCallerSession) Paused() (bool, error) { + return _CommitStoreHelper.Contract.Paused(&_CommitStoreHelper.CallOpts) +} + +func (_CommitStoreHelper *CommitStoreHelperCaller) TypeAndVersion(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _CommitStoreHelper.contract.Call(opts, &out, "typeAndVersion") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +func (_CommitStoreHelper *CommitStoreHelperSession) TypeAndVersion() (string, error) { + return _CommitStoreHelper.Contract.TypeAndVersion(&_CommitStoreHelper.CallOpts) +} + +func (_CommitStoreHelper *CommitStoreHelperCallerSession) TypeAndVersion() (string, error) { + return _CommitStoreHelper.Contract.TypeAndVersion(&_CommitStoreHelper.CallOpts) +} + +func (_CommitStoreHelper *CommitStoreHelperCaller) Verify(opts *bind.CallOpts, hashedLeaves [][32]byte, proofs [][32]byte, proofFlagBits *big.Int) (*big.Int, error) { + var out []interface{} + err := _CommitStoreHelper.contract.Call(opts, &out, "verify", hashedLeaves, proofs, proofFlagBits) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_CommitStoreHelper *CommitStoreHelperSession) Verify(hashedLeaves [][32]byte, proofs [][32]byte, proofFlagBits *big.Int) (*big.Int, error) { + return _CommitStoreHelper.Contract.Verify(&_CommitStoreHelper.CallOpts, hashedLeaves, proofs, proofFlagBits) +} + +func (_CommitStoreHelper *CommitStoreHelperCallerSession) Verify(hashedLeaves [][32]byte, proofs [][32]byte, proofFlagBits *big.Int) (*big.Int, error) { + return _CommitStoreHelper.Contract.Verify(&_CommitStoreHelper.CallOpts, hashedLeaves, proofs, proofFlagBits) +} + +func (_CommitStoreHelper *CommitStoreHelperTransactor) AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + return _CommitStoreHelper.contract.Transact(opts, "acceptOwnership") +} + +func (_CommitStoreHelper *CommitStoreHelperSession) AcceptOwnership() (*types.Transaction, error) { + return _CommitStoreHelper.Contract.AcceptOwnership(&_CommitStoreHelper.TransactOpts) +} + +func (_CommitStoreHelper *CommitStoreHelperTransactorSession) AcceptOwnership() (*types.Transaction, error) { + return _CommitStoreHelper.Contract.AcceptOwnership(&_CommitStoreHelper.TransactOpts) +} + +func (_CommitStoreHelper *CommitStoreHelperTransactor) Pause(opts *bind.TransactOpts) (*types.Transaction, error) { + return _CommitStoreHelper.contract.Transact(opts, "pause") +} + +func (_CommitStoreHelper *CommitStoreHelperSession) Pause() (*types.Transaction, error) { + return _CommitStoreHelper.Contract.Pause(&_CommitStoreHelper.TransactOpts) +} + +func (_CommitStoreHelper *CommitStoreHelperTransactorSession) Pause() (*types.Transaction, error) { + return _CommitStoreHelper.Contract.Pause(&_CommitStoreHelper.TransactOpts) +} + +func (_CommitStoreHelper *CommitStoreHelperTransactor) Report(opts *bind.TransactOpts, commitReport []byte, epochAndRound *big.Int) (*types.Transaction, error) { + return _CommitStoreHelper.contract.Transact(opts, "report", commitReport, epochAndRound) +} + +func (_CommitStoreHelper *CommitStoreHelperSession) Report(commitReport []byte, epochAndRound *big.Int) (*types.Transaction, error) { + return _CommitStoreHelper.Contract.Report(&_CommitStoreHelper.TransactOpts, commitReport, epochAndRound) +} + +func (_CommitStoreHelper *CommitStoreHelperTransactorSession) Report(commitReport []byte, epochAndRound *big.Int) (*types.Transaction, error) { + return _CommitStoreHelper.Contract.Report(&_CommitStoreHelper.TransactOpts, commitReport, epochAndRound) +} + +func (_CommitStoreHelper *CommitStoreHelperTransactor) ResetUnblessedRoots(opts *bind.TransactOpts, rootToReset [][32]byte) (*types.Transaction, error) { + return _CommitStoreHelper.contract.Transact(opts, "resetUnblessedRoots", rootToReset) +} + +func (_CommitStoreHelper *CommitStoreHelperSession) ResetUnblessedRoots(rootToReset [][32]byte) (*types.Transaction, error) { + return _CommitStoreHelper.Contract.ResetUnblessedRoots(&_CommitStoreHelper.TransactOpts, rootToReset) +} + +func (_CommitStoreHelper *CommitStoreHelperTransactorSession) ResetUnblessedRoots(rootToReset [][32]byte) (*types.Transaction, error) { + return _CommitStoreHelper.Contract.ResetUnblessedRoots(&_CommitStoreHelper.TransactOpts, rootToReset) +} + +func (_CommitStoreHelper *CommitStoreHelperTransactor) SetLatestPriceEpochAndRound(opts *bind.TransactOpts, latestPriceEpochAndRound *big.Int) (*types.Transaction, error) { + return _CommitStoreHelper.contract.Transact(opts, "setLatestPriceEpochAndRound", latestPriceEpochAndRound) +} + +func (_CommitStoreHelper *CommitStoreHelperSession) SetLatestPriceEpochAndRound(latestPriceEpochAndRound *big.Int) (*types.Transaction, error) { + return _CommitStoreHelper.Contract.SetLatestPriceEpochAndRound(&_CommitStoreHelper.TransactOpts, latestPriceEpochAndRound) +} + +func (_CommitStoreHelper *CommitStoreHelperTransactorSession) SetLatestPriceEpochAndRound(latestPriceEpochAndRound *big.Int) (*types.Transaction, error) { + return _CommitStoreHelper.Contract.SetLatestPriceEpochAndRound(&_CommitStoreHelper.TransactOpts, latestPriceEpochAndRound) +} + +func (_CommitStoreHelper *CommitStoreHelperTransactor) SetMinSeqNr(opts *bind.TransactOpts, minSeqNr uint64) (*types.Transaction, error) { + return _CommitStoreHelper.contract.Transact(opts, "setMinSeqNr", minSeqNr) +} + +func (_CommitStoreHelper *CommitStoreHelperSession) SetMinSeqNr(minSeqNr uint64) (*types.Transaction, error) { + return _CommitStoreHelper.Contract.SetMinSeqNr(&_CommitStoreHelper.TransactOpts, minSeqNr) +} + +func (_CommitStoreHelper *CommitStoreHelperTransactorSession) SetMinSeqNr(minSeqNr uint64) (*types.Transaction, error) { + return _CommitStoreHelper.Contract.SetMinSeqNr(&_CommitStoreHelper.TransactOpts, minSeqNr) +} + +func (_CommitStoreHelper *CommitStoreHelperTransactor) SetOCR2Config(opts *bind.TransactOpts, signers []common.Address, transmitters []common.Address, f uint8, onchainConfig []byte, offchainConfigVersion uint64, offchainConfig []byte) (*types.Transaction, error) { + return _CommitStoreHelper.contract.Transact(opts, "setOCR2Config", signers, transmitters, f, onchainConfig, offchainConfigVersion, offchainConfig) +} + +func (_CommitStoreHelper *CommitStoreHelperSession) SetOCR2Config(signers []common.Address, transmitters []common.Address, f uint8, onchainConfig []byte, offchainConfigVersion uint64, offchainConfig []byte) (*types.Transaction, error) { + return _CommitStoreHelper.Contract.SetOCR2Config(&_CommitStoreHelper.TransactOpts, signers, transmitters, f, onchainConfig, offchainConfigVersion, offchainConfig) +} + +func (_CommitStoreHelper *CommitStoreHelperTransactorSession) SetOCR2Config(signers []common.Address, transmitters []common.Address, f uint8, onchainConfig []byte, offchainConfigVersion uint64, offchainConfig []byte) (*types.Transaction, error) { + return _CommitStoreHelper.Contract.SetOCR2Config(&_CommitStoreHelper.TransactOpts, signers, transmitters, f, onchainConfig, offchainConfigVersion, offchainConfig) +} + +func (_CommitStoreHelper *CommitStoreHelperTransactor) TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) { + return _CommitStoreHelper.contract.Transact(opts, "transferOwnership", to) +} + +func (_CommitStoreHelper *CommitStoreHelperSession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _CommitStoreHelper.Contract.TransferOwnership(&_CommitStoreHelper.TransactOpts, to) +} + +func (_CommitStoreHelper *CommitStoreHelperTransactorSession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _CommitStoreHelper.Contract.TransferOwnership(&_CommitStoreHelper.TransactOpts, to) +} + +func (_CommitStoreHelper *CommitStoreHelperTransactor) Transmit(opts *bind.TransactOpts, reportContext [3][32]byte, report []byte, rs [][32]byte, ss [][32]byte, rawVs [32]byte) (*types.Transaction, error) { + return _CommitStoreHelper.contract.Transact(opts, "transmit", reportContext, report, rs, ss, rawVs) +} + +func (_CommitStoreHelper *CommitStoreHelperSession) Transmit(reportContext [3][32]byte, report []byte, rs [][32]byte, ss [][32]byte, rawVs [32]byte) (*types.Transaction, error) { + return _CommitStoreHelper.Contract.Transmit(&_CommitStoreHelper.TransactOpts, reportContext, report, rs, ss, rawVs) +} + +func (_CommitStoreHelper *CommitStoreHelperTransactorSession) Transmit(reportContext [3][32]byte, report []byte, rs [][32]byte, ss [][32]byte, rawVs [32]byte) (*types.Transaction, error) { + return _CommitStoreHelper.Contract.Transmit(&_CommitStoreHelper.TransactOpts, reportContext, report, rs, ss, rawVs) +} + +func (_CommitStoreHelper *CommitStoreHelperTransactor) Unpause(opts *bind.TransactOpts) (*types.Transaction, error) { + return _CommitStoreHelper.contract.Transact(opts, "unpause") +} + +func (_CommitStoreHelper *CommitStoreHelperSession) Unpause() (*types.Transaction, error) { + return _CommitStoreHelper.Contract.Unpause(&_CommitStoreHelper.TransactOpts) +} + +func (_CommitStoreHelper *CommitStoreHelperTransactorSession) Unpause() (*types.Transaction, error) { + return _CommitStoreHelper.Contract.Unpause(&_CommitStoreHelper.TransactOpts) +} + +type CommitStoreHelperConfigSetIterator struct { + Event *CommitStoreHelperConfigSet + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *CommitStoreHelperConfigSetIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(CommitStoreHelperConfigSet) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(CommitStoreHelperConfigSet) + 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() + } +} + +func (it *CommitStoreHelperConfigSetIterator) Error() error { + return it.fail +} + +func (it *CommitStoreHelperConfigSetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type CommitStoreHelperConfigSet struct { + StaticConfig CommitStoreStaticConfig + DynamicConfig CommitStoreDynamicConfig + Raw types.Log +} + +func (_CommitStoreHelper *CommitStoreHelperFilterer) FilterConfigSet(opts *bind.FilterOpts) (*CommitStoreHelperConfigSetIterator, error) { + + logs, sub, err := _CommitStoreHelper.contract.FilterLogs(opts, "ConfigSet") + if err != nil { + return nil, err + } + return &CommitStoreHelperConfigSetIterator{contract: _CommitStoreHelper.contract, event: "ConfigSet", logs: logs, sub: sub}, nil +} + +func (_CommitStoreHelper *CommitStoreHelperFilterer) WatchConfigSet(opts *bind.WatchOpts, sink chan<- *CommitStoreHelperConfigSet) (event.Subscription, error) { + + logs, sub, err := _CommitStoreHelper.contract.WatchLogs(opts, "ConfigSet") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(CommitStoreHelperConfigSet) + if err := _CommitStoreHelper.contract.UnpackLog(event, "ConfigSet", 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 +} + +func (_CommitStoreHelper *CommitStoreHelperFilterer) ParseConfigSet(log types.Log) (*CommitStoreHelperConfigSet, error) { + event := new(CommitStoreHelperConfigSet) + if err := _CommitStoreHelper.contract.UnpackLog(event, "ConfigSet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type CommitStoreHelperConfigSet0Iterator struct { + Event *CommitStoreHelperConfigSet0 + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *CommitStoreHelperConfigSet0Iterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(CommitStoreHelperConfigSet0) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(CommitStoreHelperConfigSet0) + 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() + } +} + +func (it *CommitStoreHelperConfigSet0Iterator) Error() error { + return it.fail +} + +func (it *CommitStoreHelperConfigSet0Iterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type CommitStoreHelperConfigSet0 struct { + PreviousConfigBlockNumber uint32 + ConfigDigest [32]byte + ConfigCount uint64 + Signers []common.Address + Transmitters []common.Address + F uint8 + OnchainConfig []byte + OffchainConfigVersion uint64 + OffchainConfig []byte + Raw types.Log +} + +func (_CommitStoreHelper *CommitStoreHelperFilterer) FilterConfigSet0(opts *bind.FilterOpts) (*CommitStoreHelperConfigSet0Iterator, error) { + + logs, sub, err := _CommitStoreHelper.contract.FilterLogs(opts, "ConfigSet0") + if err != nil { + return nil, err + } + return &CommitStoreHelperConfigSet0Iterator{contract: _CommitStoreHelper.contract, event: "ConfigSet0", logs: logs, sub: sub}, nil +} + +func (_CommitStoreHelper *CommitStoreHelperFilterer) WatchConfigSet0(opts *bind.WatchOpts, sink chan<- *CommitStoreHelperConfigSet0) (event.Subscription, error) { + + logs, sub, err := _CommitStoreHelper.contract.WatchLogs(opts, "ConfigSet0") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(CommitStoreHelperConfigSet0) + if err := _CommitStoreHelper.contract.UnpackLog(event, "ConfigSet0", 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 +} + +func (_CommitStoreHelper *CommitStoreHelperFilterer) ParseConfigSet0(log types.Log) (*CommitStoreHelperConfigSet0, error) { + event := new(CommitStoreHelperConfigSet0) + if err := _CommitStoreHelper.contract.UnpackLog(event, "ConfigSet0", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type CommitStoreHelperLatestPriceEpochAndRoundSetIterator struct { + Event *CommitStoreHelperLatestPriceEpochAndRoundSet + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *CommitStoreHelperLatestPriceEpochAndRoundSetIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(CommitStoreHelperLatestPriceEpochAndRoundSet) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(CommitStoreHelperLatestPriceEpochAndRoundSet) + 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() + } +} + +func (it *CommitStoreHelperLatestPriceEpochAndRoundSetIterator) Error() error { + return it.fail +} + +func (it *CommitStoreHelperLatestPriceEpochAndRoundSetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type CommitStoreHelperLatestPriceEpochAndRoundSet struct { + OldEpochAndRound *big.Int + NewEpochAndRound *big.Int + Raw types.Log +} + +func (_CommitStoreHelper *CommitStoreHelperFilterer) FilterLatestPriceEpochAndRoundSet(opts *bind.FilterOpts) (*CommitStoreHelperLatestPriceEpochAndRoundSetIterator, error) { + + logs, sub, err := _CommitStoreHelper.contract.FilterLogs(opts, "LatestPriceEpochAndRoundSet") + if err != nil { + return nil, err + } + return &CommitStoreHelperLatestPriceEpochAndRoundSetIterator{contract: _CommitStoreHelper.contract, event: "LatestPriceEpochAndRoundSet", logs: logs, sub: sub}, nil +} + +func (_CommitStoreHelper *CommitStoreHelperFilterer) WatchLatestPriceEpochAndRoundSet(opts *bind.WatchOpts, sink chan<- *CommitStoreHelperLatestPriceEpochAndRoundSet) (event.Subscription, error) { + + logs, sub, err := _CommitStoreHelper.contract.WatchLogs(opts, "LatestPriceEpochAndRoundSet") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(CommitStoreHelperLatestPriceEpochAndRoundSet) + if err := _CommitStoreHelper.contract.UnpackLog(event, "LatestPriceEpochAndRoundSet", 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 +} + +func (_CommitStoreHelper *CommitStoreHelperFilterer) ParseLatestPriceEpochAndRoundSet(log types.Log) (*CommitStoreHelperLatestPriceEpochAndRoundSet, error) { + event := new(CommitStoreHelperLatestPriceEpochAndRoundSet) + if err := _CommitStoreHelper.contract.UnpackLog(event, "LatestPriceEpochAndRoundSet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type CommitStoreHelperOwnershipTransferRequestedIterator struct { + Event *CommitStoreHelperOwnershipTransferRequested + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *CommitStoreHelperOwnershipTransferRequestedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(CommitStoreHelperOwnershipTransferRequested) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(CommitStoreHelperOwnershipTransferRequested) + 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() + } +} + +func (it *CommitStoreHelperOwnershipTransferRequestedIterator) Error() error { + return it.fail +} + +func (it *CommitStoreHelperOwnershipTransferRequestedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type CommitStoreHelperOwnershipTransferRequested struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_CommitStoreHelper *CommitStoreHelperFilterer) FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*CommitStoreHelperOwnershipTransferRequestedIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _CommitStoreHelper.contract.FilterLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return &CommitStoreHelperOwnershipTransferRequestedIterator{contract: _CommitStoreHelper.contract, event: "OwnershipTransferRequested", logs: logs, sub: sub}, nil +} + +func (_CommitStoreHelper *CommitStoreHelperFilterer) WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *CommitStoreHelperOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _CommitStoreHelper.contract.WatchLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(CommitStoreHelperOwnershipTransferRequested) + if err := _CommitStoreHelper.contract.UnpackLog(event, "OwnershipTransferRequested", 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 +} + +func (_CommitStoreHelper *CommitStoreHelperFilterer) ParseOwnershipTransferRequested(log types.Log) (*CommitStoreHelperOwnershipTransferRequested, error) { + event := new(CommitStoreHelperOwnershipTransferRequested) + if err := _CommitStoreHelper.contract.UnpackLog(event, "OwnershipTransferRequested", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type CommitStoreHelperOwnershipTransferredIterator struct { + Event *CommitStoreHelperOwnershipTransferred + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *CommitStoreHelperOwnershipTransferredIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(CommitStoreHelperOwnershipTransferred) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(CommitStoreHelperOwnershipTransferred) + 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() + } +} + +func (it *CommitStoreHelperOwnershipTransferredIterator) Error() error { + return it.fail +} + +func (it *CommitStoreHelperOwnershipTransferredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type CommitStoreHelperOwnershipTransferred struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_CommitStoreHelper *CommitStoreHelperFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*CommitStoreHelperOwnershipTransferredIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _CommitStoreHelper.contract.FilterLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return &CommitStoreHelperOwnershipTransferredIterator{contract: _CommitStoreHelper.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil +} + +func (_CommitStoreHelper *CommitStoreHelperFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *CommitStoreHelperOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _CommitStoreHelper.contract.WatchLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(CommitStoreHelperOwnershipTransferred) + if err := _CommitStoreHelper.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 +} + +func (_CommitStoreHelper *CommitStoreHelperFilterer) ParseOwnershipTransferred(log types.Log) (*CommitStoreHelperOwnershipTransferred, error) { + event := new(CommitStoreHelperOwnershipTransferred) + if err := _CommitStoreHelper.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type CommitStoreHelperPausedIterator struct { + Event *CommitStoreHelperPaused + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *CommitStoreHelperPausedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(CommitStoreHelperPaused) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(CommitStoreHelperPaused) + 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() + } +} + +func (it *CommitStoreHelperPausedIterator) Error() error { + return it.fail +} + +func (it *CommitStoreHelperPausedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type CommitStoreHelperPaused struct { + Account common.Address + Raw types.Log +} + +func (_CommitStoreHelper *CommitStoreHelperFilterer) FilterPaused(opts *bind.FilterOpts) (*CommitStoreHelperPausedIterator, error) { + + logs, sub, err := _CommitStoreHelper.contract.FilterLogs(opts, "Paused") + if err != nil { + return nil, err + } + return &CommitStoreHelperPausedIterator{contract: _CommitStoreHelper.contract, event: "Paused", logs: logs, sub: sub}, nil +} + +func (_CommitStoreHelper *CommitStoreHelperFilterer) WatchPaused(opts *bind.WatchOpts, sink chan<- *CommitStoreHelperPaused) (event.Subscription, error) { + + logs, sub, err := _CommitStoreHelper.contract.WatchLogs(opts, "Paused") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(CommitStoreHelperPaused) + if err := _CommitStoreHelper.contract.UnpackLog(event, "Paused", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +func (_CommitStoreHelper *CommitStoreHelperFilterer) ParsePaused(log types.Log) (*CommitStoreHelperPaused, error) { + event := new(CommitStoreHelperPaused) + if err := _CommitStoreHelper.contract.UnpackLog(event, "Paused", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type CommitStoreHelperReportAcceptedIterator struct { + Event *CommitStoreHelperReportAccepted + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *CommitStoreHelperReportAcceptedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(CommitStoreHelperReportAccepted) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(CommitStoreHelperReportAccepted) + 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() + } +} + +func (it *CommitStoreHelperReportAcceptedIterator) Error() error { + return it.fail +} + +func (it *CommitStoreHelperReportAcceptedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type CommitStoreHelperReportAccepted struct { + Report CommitStoreCommitReport + Raw types.Log +} + +func (_CommitStoreHelper *CommitStoreHelperFilterer) FilterReportAccepted(opts *bind.FilterOpts) (*CommitStoreHelperReportAcceptedIterator, error) { + + logs, sub, err := _CommitStoreHelper.contract.FilterLogs(opts, "ReportAccepted") + if err != nil { + return nil, err + } + return &CommitStoreHelperReportAcceptedIterator{contract: _CommitStoreHelper.contract, event: "ReportAccepted", logs: logs, sub: sub}, nil +} + +func (_CommitStoreHelper *CommitStoreHelperFilterer) WatchReportAccepted(opts *bind.WatchOpts, sink chan<- *CommitStoreHelperReportAccepted) (event.Subscription, error) { + + logs, sub, err := _CommitStoreHelper.contract.WatchLogs(opts, "ReportAccepted") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(CommitStoreHelperReportAccepted) + if err := _CommitStoreHelper.contract.UnpackLog(event, "ReportAccepted", 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 +} + +func (_CommitStoreHelper *CommitStoreHelperFilterer) ParseReportAccepted(log types.Log) (*CommitStoreHelperReportAccepted, error) { + event := new(CommitStoreHelperReportAccepted) + if err := _CommitStoreHelper.contract.UnpackLog(event, "ReportAccepted", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type CommitStoreHelperRootRemovedIterator struct { + Event *CommitStoreHelperRootRemoved + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *CommitStoreHelperRootRemovedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(CommitStoreHelperRootRemoved) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(CommitStoreHelperRootRemoved) + 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() + } +} + +func (it *CommitStoreHelperRootRemovedIterator) Error() error { + return it.fail +} + +func (it *CommitStoreHelperRootRemovedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type CommitStoreHelperRootRemoved struct { + Root [32]byte + Raw types.Log +} + +func (_CommitStoreHelper *CommitStoreHelperFilterer) FilterRootRemoved(opts *bind.FilterOpts) (*CommitStoreHelperRootRemovedIterator, error) { + + logs, sub, err := _CommitStoreHelper.contract.FilterLogs(opts, "RootRemoved") + if err != nil { + return nil, err + } + return &CommitStoreHelperRootRemovedIterator{contract: _CommitStoreHelper.contract, event: "RootRemoved", logs: logs, sub: sub}, nil +} + +func (_CommitStoreHelper *CommitStoreHelperFilterer) WatchRootRemoved(opts *bind.WatchOpts, sink chan<- *CommitStoreHelperRootRemoved) (event.Subscription, error) { + + logs, sub, err := _CommitStoreHelper.contract.WatchLogs(opts, "RootRemoved") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(CommitStoreHelperRootRemoved) + if err := _CommitStoreHelper.contract.UnpackLog(event, "RootRemoved", 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 +} + +func (_CommitStoreHelper *CommitStoreHelperFilterer) ParseRootRemoved(log types.Log) (*CommitStoreHelperRootRemoved, error) { + event := new(CommitStoreHelperRootRemoved) + if err := _CommitStoreHelper.contract.UnpackLog(event, "RootRemoved", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type CommitStoreHelperSequenceNumberSetIterator struct { + Event *CommitStoreHelperSequenceNumberSet + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *CommitStoreHelperSequenceNumberSetIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(CommitStoreHelperSequenceNumberSet) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(CommitStoreHelperSequenceNumberSet) + 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() + } +} + +func (it *CommitStoreHelperSequenceNumberSetIterator) Error() error { + return it.fail +} + +func (it *CommitStoreHelperSequenceNumberSetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type CommitStoreHelperSequenceNumberSet struct { + OldSeqNum uint64 + NewSeqNum uint64 + Raw types.Log +} + +func (_CommitStoreHelper *CommitStoreHelperFilterer) FilterSequenceNumberSet(opts *bind.FilterOpts) (*CommitStoreHelperSequenceNumberSetIterator, error) { + + logs, sub, err := _CommitStoreHelper.contract.FilterLogs(opts, "SequenceNumberSet") + if err != nil { + return nil, err + } + return &CommitStoreHelperSequenceNumberSetIterator{contract: _CommitStoreHelper.contract, event: "SequenceNumberSet", logs: logs, sub: sub}, nil +} + +func (_CommitStoreHelper *CommitStoreHelperFilterer) WatchSequenceNumberSet(opts *bind.WatchOpts, sink chan<- *CommitStoreHelperSequenceNumberSet) (event.Subscription, error) { + + logs, sub, err := _CommitStoreHelper.contract.WatchLogs(opts, "SequenceNumberSet") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(CommitStoreHelperSequenceNumberSet) + if err := _CommitStoreHelper.contract.UnpackLog(event, "SequenceNumberSet", 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 +} + +func (_CommitStoreHelper *CommitStoreHelperFilterer) ParseSequenceNumberSet(log types.Log) (*CommitStoreHelperSequenceNumberSet, error) { + event := new(CommitStoreHelperSequenceNumberSet) + if err := _CommitStoreHelper.contract.UnpackLog(event, "SequenceNumberSet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type CommitStoreHelperTransmittedIterator struct { + Event *CommitStoreHelperTransmitted + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *CommitStoreHelperTransmittedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(CommitStoreHelperTransmitted) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(CommitStoreHelperTransmitted) + 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() + } +} + +func (it *CommitStoreHelperTransmittedIterator) Error() error { + return it.fail +} + +func (it *CommitStoreHelperTransmittedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type CommitStoreHelperTransmitted struct { + ConfigDigest [32]byte + Epoch uint32 + Raw types.Log +} + +func (_CommitStoreHelper *CommitStoreHelperFilterer) FilterTransmitted(opts *bind.FilterOpts) (*CommitStoreHelperTransmittedIterator, error) { + + logs, sub, err := _CommitStoreHelper.contract.FilterLogs(opts, "Transmitted") + if err != nil { + return nil, err + } + return &CommitStoreHelperTransmittedIterator{contract: _CommitStoreHelper.contract, event: "Transmitted", logs: logs, sub: sub}, nil +} + +func (_CommitStoreHelper *CommitStoreHelperFilterer) WatchTransmitted(opts *bind.WatchOpts, sink chan<- *CommitStoreHelperTransmitted) (event.Subscription, error) { + + logs, sub, err := _CommitStoreHelper.contract.WatchLogs(opts, "Transmitted") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(CommitStoreHelperTransmitted) + if err := _CommitStoreHelper.contract.UnpackLog(event, "Transmitted", 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 +} + +func (_CommitStoreHelper *CommitStoreHelperFilterer) ParseTransmitted(log types.Log) (*CommitStoreHelperTransmitted, error) { + event := new(CommitStoreHelperTransmitted) + if err := _CommitStoreHelper.contract.UnpackLog(event, "Transmitted", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type CommitStoreHelperUnpausedIterator struct { + Event *CommitStoreHelperUnpaused + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *CommitStoreHelperUnpausedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(CommitStoreHelperUnpaused) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(CommitStoreHelperUnpaused) + 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() + } +} + +func (it *CommitStoreHelperUnpausedIterator) Error() error { + return it.fail +} + +func (it *CommitStoreHelperUnpausedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type CommitStoreHelperUnpaused struct { + Account common.Address + Raw types.Log +} + +func (_CommitStoreHelper *CommitStoreHelperFilterer) FilterUnpaused(opts *bind.FilterOpts) (*CommitStoreHelperUnpausedIterator, error) { + + logs, sub, err := _CommitStoreHelper.contract.FilterLogs(opts, "Unpaused") + if err != nil { + return nil, err + } + return &CommitStoreHelperUnpausedIterator{contract: _CommitStoreHelper.contract, event: "Unpaused", logs: logs, sub: sub}, nil +} + +func (_CommitStoreHelper *CommitStoreHelperFilterer) WatchUnpaused(opts *bind.WatchOpts, sink chan<- *CommitStoreHelperUnpaused) (event.Subscription, error) { + + logs, sub, err := _CommitStoreHelper.contract.WatchLogs(opts, "Unpaused") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(CommitStoreHelperUnpaused) + if err := _CommitStoreHelper.contract.UnpackLog(event, "Unpaused", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +func (_CommitStoreHelper *CommitStoreHelperFilterer) ParseUnpaused(log types.Log) (*CommitStoreHelperUnpaused, error) { + event := new(CommitStoreHelperUnpaused) + if err := _CommitStoreHelper.contract.UnpackLog(event, "Unpaused", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type LatestConfigDetails struct { + ConfigCount uint32 + BlockNumber uint32 + ConfigDigest [32]byte +} +type LatestConfigDigestAndEpoch struct { + ScanLogs bool + ConfigDigest [32]byte + Epoch uint32 +} + +func (_CommitStoreHelper *CommitStoreHelper) ParseLog(log types.Log) (generated.AbigenLog, error) { + switch log.Topics[0] { + case _CommitStoreHelper.abi.Events["ConfigSet"].ID: + return _CommitStoreHelper.ParseConfigSet(log) + case _CommitStoreHelper.abi.Events["ConfigSet0"].ID: + return _CommitStoreHelper.ParseConfigSet0(log) + case _CommitStoreHelper.abi.Events["LatestPriceEpochAndRoundSet"].ID: + return _CommitStoreHelper.ParseLatestPriceEpochAndRoundSet(log) + case _CommitStoreHelper.abi.Events["OwnershipTransferRequested"].ID: + return _CommitStoreHelper.ParseOwnershipTransferRequested(log) + case _CommitStoreHelper.abi.Events["OwnershipTransferred"].ID: + return _CommitStoreHelper.ParseOwnershipTransferred(log) + case _CommitStoreHelper.abi.Events["Paused"].ID: + return _CommitStoreHelper.ParsePaused(log) + case _CommitStoreHelper.abi.Events["ReportAccepted"].ID: + return _CommitStoreHelper.ParseReportAccepted(log) + case _CommitStoreHelper.abi.Events["RootRemoved"].ID: + return _CommitStoreHelper.ParseRootRemoved(log) + case _CommitStoreHelper.abi.Events["SequenceNumberSet"].ID: + return _CommitStoreHelper.ParseSequenceNumberSet(log) + case _CommitStoreHelper.abi.Events["Transmitted"].ID: + return _CommitStoreHelper.ParseTransmitted(log) + case _CommitStoreHelper.abi.Events["Unpaused"].ID: + return _CommitStoreHelper.ParseUnpaused(log) + + default: + return nil, fmt.Errorf("abigen wrapper received unknown log topic: %v", log.Topics[0]) + } +} + +func (CommitStoreHelperConfigSet) Topic() common.Hash { + return common.HexToHash("0xc9d7123efd4203e60b0f0a4b1dbc4800fc97ce63679f71c3a27279b24a7ddec3") +} + +func (CommitStoreHelperConfigSet0) Topic() common.Hash { + return common.HexToHash("0x1591690b8638f5fb2dbec82ac741805ac5da8b45dc5263f4875b0496fdce4e05") +} + +func (CommitStoreHelperLatestPriceEpochAndRoundSet) Topic() common.Hash { + return common.HexToHash("0xf0d557bfce33e354b41885eb9264448726cfe51f486ffa69809d2bf565456444") +} + +func (CommitStoreHelperOwnershipTransferRequested) Topic() common.Hash { + return common.HexToHash("0xed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae1278") +} + +func (CommitStoreHelperOwnershipTransferred) Topic() common.Hash { + return common.HexToHash("0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0") +} + +func (CommitStoreHelperPaused) Topic() common.Hash { + return common.HexToHash("0x62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258") +} + +func (CommitStoreHelperReportAccepted) Topic() common.Hash { + return common.HexToHash("0x291698c01aa71f912280535d88a00d2c59fb63530a3f5d0098560468acb9ebf5") +} + +func (CommitStoreHelperRootRemoved) Topic() common.Hash { + return common.HexToHash("0x202f1139a3e334b6056064c0e9b19fd07e44a88d8f6e5ded571b24cf8c371f12") +} + +func (CommitStoreHelperSequenceNumberSet) Topic() common.Hash { + return common.HexToHash("0xea59e8027e41fda1525220008cf2416797405065eb21b0ebd417bfc6d361b8de") +} + +func (CommitStoreHelperTransmitted) Topic() common.Hash { + return common.HexToHash("0xb04e63db38c49950639fa09d29872f21f5d49d614f3a969d8adf3d4b52e41a62") +} + +func (CommitStoreHelperUnpaused) Topic() common.Hash { + return common.HexToHash("0x5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa") +} + +func (_CommitStoreHelper *CommitStoreHelper) Address() common.Address { + return _CommitStoreHelper.address +} + +type CommitStoreHelperInterface interface { + GetDynamicConfig(opts *bind.CallOpts) (CommitStoreDynamicConfig, error) + + GetExpectedNextSequenceNumber(opts *bind.CallOpts) (uint64, error) + + GetLatestPriceEpochAndRound(opts *bind.CallOpts) (uint64, error) + + GetMerkleRoot(opts *bind.CallOpts, root [32]byte) (*big.Int, error) + + GetStaticConfig(opts *bind.CallOpts) (CommitStoreStaticConfig, error) + + GetTransmitters(opts *bind.CallOpts) ([]common.Address, error) + + IsBlessed(opts *bind.CallOpts, root [32]byte) (bool, error) + + IsUnpausedAndNotCursed(opts *bind.CallOpts) (bool, error) + + LatestConfigDetails(opts *bind.CallOpts) (LatestConfigDetails, + + error) + + LatestConfigDigestAndEpoch(opts *bind.CallOpts) (LatestConfigDigestAndEpoch, + + error) + + Owner(opts *bind.CallOpts) (common.Address, error) + + Paused(opts *bind.CallOpts) (bool, error) + + TypeAndVersion(opts *bind.CallOpts) (string, error) + + Verify(opts *bind.CallOpts, hashedLeaves [][32]byte, proofs [][32]byte, proofFlagBits *big.Int) (*big.Int, error) + + AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) + + Pause(opts *bind.TransactOpts) (*types.Transaction, error) + + Report(opts *bind.TransactOpts, commitReport []byte, epochAndRound *big.Int) (*types.Transaction, error) + + ResetUnblessedRoots(opts *bind.TransactOpts, rootToReset [][32]byte) (*types.Transaction, error) + + SetLatestPriceEpochAndRound(opts *bind.TransactOpts, latestPriceEpochAndRound *big.Int) (*types.Transaction, error) + + SetMinSeqNr(opts *bind.TransactOpts, minSeqNr uint64) (*types.Transaction, error) + + SetOCR2Config(opts *bind.TransactOpts, signers []common.Address, transmitters []common.Address, f uint8, onchainConfig []byte, offchainConfigVersion uint64, offchainConfig []byte) (*types.Transaction, error) + + TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) + + Transmit(opts *bind.TransactOpts, reportContext [3][32]byte, report []byte, rs [][32]byte, ss [][32]byte, rawVs [32]byte) (*types.Transaction, error) + + Unpause(opts *bind.TransactOpts) (*types.Transaction, error) + + FilterConfigSet(opts *bind.FilterOpts) (*CommitStoreHelperConfigSetIterator, error) + + WatchConfigSet(opts *bind.WatchOpts, sink chan<- *CommitStoreHelperConfigSet) (event.Subscription, error) + + ParseConfigSet(log types.Log) (*CommitStoreHelperConfigSet, error) + + FilterConfigSet0(opts *bind.FilterOpts) (*CommitStoreHelperConfigSet0Iterator, error) + + WatchConfigSet0(opts *bind.WatchOpts, sink chan<- *CommitStoreHelperConfigSet0) (event.Subscription, error) + + ParseConfigSet0(log types.Log) (*CommitStoreHelperConfigSet0, error) + + FilterLatestPriceEpochAndRoundSet(opts *bind.FilterOpts) (*CommitStoreHelperLatestPriceEpochAndRoundSetIterator, error) + + WatchLatestPriceEpochAndRoundSet(opts *bind.WatchOpts, sink chan<- *CommitStoreHelperLatestPriceEpochAndRoundSet) (event.Subscription, error) + + ParseLatestPriceEpochAndRoundSet(log types.Log) (*CommitStoreHelperLatestPriceEpochAndRoundSet, error) + + FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*CommitStoreHelperOwnershipTransferRequestedIterator, error) + + WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *CommitStoreHelperOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferRequested(log types.Log) (*CommitStoreHelperOwnershipTransferRequested, error) + + FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*CommitStoreHelperOwnershipTransferredIterator, error) + + WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *CommitStoreHelperOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferred(log types.Log) (*CommitStoreHelperOwnershipTransferred, error) + + FilterPaused(opts *bind.FilterOpts) (*CommitStoreHelperPausedIterator, error) + + WatchPaused(opts *bind.WatchOpts, sink chan<- *CommitStoreHelperPaused) (event.Subscription, error) + + ParsePaused(log types.Log) (*CommitStoreHelperPaused, error) + + FilterReportAccepted(opts *bind.FilterOpts) (*CommitStoreHelperReportAcceptedIterator, error) + + WatchReportAccepted(opts *bind.WatchOpts, sink chan<- *CommitStoreHelperReportAccepted) (event.Subscription, error) + + ParseReportAccepted(log types.Log) (*CommitStoreHelperReportAccepted, error) + + FilterRootRemoved(opts *bind.FilterOpts) (*CommitStoreHelperRootRemovedIterator, error) + + WatchRootRemoved(opts *bind.WatchOpts, sink chan<- *CommitStoreHelperRootRemoved) (event.Subscription, error) + + ParseRootRemoved(log types.Log) (*CommitStoreHelperRootRemoved, error) + + FilterSequenceNumberSet(opts *bind.FilterOpts) (*CommitStoreHelperSequenceNumberSetIterator, error) + + WatchSequenceNumberSet(opts *bind.WatchOpts, sink chan<- *CommitStoreHelperSequenceNumberSet) (event.Subscription, error) + + ParseSequenceNumberSet(log types.Log) (*CommitStoreHelperSequenceNumberSet, error) + + FilterTransmitted(opts *bind.FilterOpts) (*CommitStoreHelperTransmittedIterator, error) + + WatchTransmitted(opts *bind.WatchOpts, sink chan<- *CommitStoreHelperTransmitted) (event.Subscription, error) + + ParseTransmitted(log types.Log) (*CommitStoreHelperTransmitted, error) + + FilterUnpaused(opts *bind.FilterOpts) (*CommitStoreHelperUnpausedIterator, error) + + WatchUnpaused(opts *bind.WatchOpts, sink chan<- *CommitStoreHelperUnpaused) (event.Subscription, error) + + ParseUnpaused(log types.Log) (*CommitStoreHelperUnpaused, error) + + ParseLog(log types.Log) (generated.AbigenLog, error) + + Address() common.Address +} diff --git a/core/gethwrappers/ccip/generated/commit_store_helper_1_0_0/commit_store_helper_1_0_0.go b/core/gethwrappers/ccip/generated/commit_store_helper_1_0_0/commit_store_helper_1_0_0.go new file mode 100644 index 00000000000..5a1e15b2530 --- /dev/null +++ b/core/gethwrappers/ccip/generated/commit_store_helper_1_0_0/commit_store_helper_1_0_0.go @@ -0,0 +1,1966 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package commit_store_helper_1_0_0 + +import ( + "errors" + "fmt" + "math/big" + "strings" + + "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" + + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" +) + +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +type CommitStoreCommitReport struct { + PriceUpdates InternalPriceUpdates + Interval CommitStoreInterval + MerkleRoot [32]byte +} + +type CommitStoreDynamicConfig struct { + PriceRegistry common.Address +} + +type CommitStoreInterval struct { + Min uint64 + Max uint64 +} + +type CommitStoreStaticConfig struct { + ChainSelector uint64 + SourceChainSelector uint64 + OnRamp common.Address + ArmProxy common.Address +} + +type InternalPriceUpdates struct { + TokenPriceUpdates []InternalTokenPriceUpdate + DestChainSelector uint64 + UsdPerUnitGas *big.Int +} + +type InternalTokenPriceUpdate struct { + SourceToken common.Address + UsdPerToken *big.Int +} + +var CommitStoreHelperMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"onRamp\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"armProxy\",\"type\":\"address\"}],\"internalType\":\"structCommitStore.StaticConfig\",\"name\":\"staticConfig\",\"type\":\"tuple\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"BadARMSignal\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"expected\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"actual\",\"type\":\"bytes32\"}],\"name\":\"ConfigDigestMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expected\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"actual\",\"type\":\"uint256\"}],\"name\":\"ForkedChain\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidCommitStoreConfig\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"message\",\"type\":\"string\"}],\"name\":\"InvalidConfig\",\"type\":\"error\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"min\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"max\",\"type\":\"uint64\"}],\"internalType\":\"structCommitStore.Interval\",\"name\":\"interval\",\"type\":\"tuple\"}],\"name\":\"InvalidInterval\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidProof\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidRoot\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"LeavesCannotBeEmpty\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NonUniqueSignatures\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OracleCannotBeZeroAddress\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"PausedError\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RootAlreadyCommitted\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"SignaturesOutOfRegistration\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"StaleReport\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UnauthorizedSigner\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UnauthorizedTransmitter\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expected\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"actual\",\"type\":\"uint256\"}],\"name\":\"WrongMessageLength\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"WrongNumberOfSignatures\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"onRamp\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"armProxy\",\"type\":\"address\"}],\"indexed\":false,\"internalType\":\"structCommitStore.StaticConfig\",\"name\":\"staticConfig\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"priceRegistry\",\"type\":\"address\"}],\"indexed\":false,\"internalType\":\"structCommitStore.DynamicConfig\",\"name\":\"dynamicConfig\",\"type\":\"tuple\"}],\"name\":\"ConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"previousConfigBlockNumber\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"configCount\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"signers\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"transmitters\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"f\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"onchainConfig\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"offchainConfigVersion\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"offchainConfig\",\"type\":\"bytes\"}],\"name\":\"ConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"Paused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"components\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"sourceToken\",\"type\":\"address\"},{\"internalType\":\"uint192\",\"name\":\"usdPerToken\",\"type\":\"uint192\"}],\"internalType\":\"structInternal.TokenPriceUpdate[]\",\"name\":\"tokenPriceUpdates\",\"type\":\"tuple[]\"},{\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint192\",\"name\":\"usdPerUnitGas\",\"type\":\"uint192\"}],\"internalType\":\"structInternal.PriceUpdates\",\"name\":\"priceUpdates\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"min\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"max\",\"type\":\"uint64\"}],\"internalType\":\"structCommitStore.Interval\",\"name\":\"interval\",\"type\":\"tuple\"},{\"internalType\":\"bytes32\",\"name\":\"merkleRoot\",\"type\":\"bytes32\"}],\"indexed\":false,\"internalType\":\"structCommitStore.CommitReport\",\"name\":\"report\",\"type\":\"tuple\"}],\"name\":\"ReportAccepted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"root\",\"type\":\"bytes32\"}],\"name\":\"RootRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"epoch\",\"type\":\"uint32\"}],\"name\":\"Transmitted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"Unpaused\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getDynamicConfig\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"priceRegistry\",\"type\":\"address\"}],\"internalType\":\"structCommitStore.DynamicConfig\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getExpectedNextSequenceNumber\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getLatestPriceEpochAndRound\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"root\",\"type\":\"bytes32\"}],\"name\":\"getMerkleRoot\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getStaticConfig\",\"outputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"onRamp\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"armProxy\",\"type\":\"address\"}],\"internalType\":\"structCommitStore.StaticConfig\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getTransmitters\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isARMHealthy\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"root\",\"type\":\"bytes32\"}],\"name\":\"isBlessed\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isUnpausedAndARMHealthy\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestConfigDetails\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"configCount\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"blockNumber\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestConfigDigestAndEpoch\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"scanLogs\",\"type\":\"bool\"},{\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"internalType\":\"uint32\",\"name\":\"epoch\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"paused\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"commitReport\",\"type\":\"bytes\"},{\"internalType\":\"uint40\",\"name\":\"epochAndRound\",\"type\":\"uint40\"}],\"name\":\"report\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32[]\",\"name\":\"rootToReset\",\"type\":\"bytes32[]\"}],\"name\":\"resetUnblessedRoots\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint40\",\"name\":\"latestPriceEpochAndRound\",\"type\":\"uint40\"}],\"name\":\"setLatestPriceEpochAndRound\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"minSeqNr\",\"type\":\"uint64\"}],\"name\":\"setMinSeqNr\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"signers\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"transmitters\",\"type\":\"address[]\"},{\"internalType\":\"uint8\",\"name\":\"f\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"onchainConfig\",\"type\":\"bytes\"},{\"internalType\":\"uint64\",\"name\":\"offchainConfigVersion\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"offchainConfig\",\"type\":\"bytes\"}],\"name\":\"setOCR2Config\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32[3]\",\"name\":\"reportContext\",\"type\":\"bytes32[3]\"},{\"internalType\":\"bytes\",\"name\":\"report\",\"type\":\"bytes\"},{\"internalType\":\"bytes32[]\",\"name\":\"rs\",\"type\":\"bytes32[]\"},{\"internalType\":\"bytes32[]\",\"name\":\"ss\",\"type\":\"bytes32[]\"},{\"internalType\":\"bytes32\",\"name\":\"rawVs\",\"type\":\"bytes32\"}],\"name\":\"transmit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"unpause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32[]\",\"name\":\"hashedLeaves\",\"type\":\"bytes32[]\"},{\"internalType\":\"bytes32[]\",\"name\":\"proofs\",\"type\":\"bytes32[]\"},{\"internalType\":\"uint256\",\"name\":\"proofFlagBits\",\"type\":\"uint256\"}],\"name\":\"verify\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", + Bin: "0x61014060405260098054600165ff000000000160401b03191660011790553480156200002a57600080fd5b5060405162003824380380620038248339810160408190526200004d9162000274565b80600033808281620000a65760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000d957620000d98162000194565b50505015156080524660a05260408101516001600160a01b0316158062000108575080516001600160401b0316155b806200011f575060208101516001600160401b0316155b8062000136575060608101516001600160a01b0316155b156200015557604051631fc5f15f60e11b815260040160405180910390fd5b80516001600160401b0390811660c05260208201511660e05260408101516001600160a01b039081166101005260609091015116610120525062000308565b336001600160a01b03821603620001ee5760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c6600000000000000000060448201526064016200009d565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b80516001600160401b03811681146200025757600080fd5b919050565b80516001600160a01b03811681146200025757600080fd5b6000608082840312156200028757600080fd5b604051608081016001600160401b0381118282101715620002b857634e487b7160e01b600052604160045260246000fd5b604052620002c6836200023f565b8152620002d6602084016200023f565b6020820152620002e9604084016200025c565b6040820152620002fc606084016200025c565b60608201529392505050565b60805160a05160c05160e051610100516101205161348d620003976000396000818161027801528181610555015281816111a1015281816119c801528181611a89015261202d01526000818161023c015261200601526000818161020c0152611fdf0152600081816101dc0152611fb001526000818161131c0152611368015260006113e3015261348d6000f3fe608060405234801561001057600080fd5b50600436106101a35760003560e01c80637437ff9f116100ee578063a7206cd611610097578063b1dc65a411610071578063b1dc65a414610505578063f2fde38b14610518578063f47a86901461052b578063ff888fb11461053e57600080fd5b8063a7206cd6146104b2578063ad7a22f8146104d2578063afcb95d7146104e557600080fd5b80638456cb59116100c85780638456cb591461047a5780638da5cb5b146104825780638db94e44146104aa57600080fd5b80637437ff9f1461040357806379ba50971461044257806381ff70481461044a57600080fd5b806329b980e4116101505780634120fccd1161012a5780634120fccd146103c05780635c975abb146103d2578063666cab8d146103ee57600080fd5b806329b980e41461038457806332048875146103975780633f4ba83a146103b857600080fd5b8063181f5a7711610181578063181f5a77146103135780631dc18e561461035c5780631ef381741461037157600080fd5b806306285c69146101a85780630a6cd30d146102cb57806310c374ed146102e3575b600080fd5b6102b560408051608081018252600080825260208201819052918101829052606081019190915260405180608001604052807f000000000000000000000000000000000000000000000000000000000000000067ffffffffffffffff1681526020017f000000000000000000000000000000000000000000000000000000000000000067ffffffffffffffff1681526020017f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1681526020017f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16815250905090565b6040516102c29190612688565b60405180910390f35b6102d3610551565b60405190151581526020016102c2565b60095468010000000000000000900464ffffffffff165b60405167ffffffffffffffff90911681526020016102c2565b61034f6040518060400160405280601181526020017f436f6d6d697453746f726520312e302e3000000000000000000000000000000081525081565b6040516102c29190612745565b61036f61036a3660046127bb565b6105e8565b005b61036f61037f366004612a4a565b6105f8565b61036f610392366004612b17565b610e19565b6103aa6103a5366004612b77565b610e65565b6040519081526020016102c2565b61036f610f5b565b60095467ffffffffffffffff166102fa565b6009546d0100000000000000000000000000900460ff166102d3565b6103f6610fc1565b6040516102c29190612c3c565b604080516020808201835260009091528151808201835260085473ffffffffffffffffffffffffffffffffffffffff16908190529151918252016102c2565b61036f611030565b6004546002546040805163ffffffff808516825264010000000090940490931660208401528201526060016102c2565b61036f61112d565b60005460405173ffffffffffffffffffffffffffffffffffffffff90911681526020016102c2565b6102d361119d565b6103aa6104c0366004612c4f565b6000908152600a602052604090205490565b61036f6104e0366004612c68565b611254565b6040805160018152600060208201819052918101919091526060016102c2565b61036f610513366004612c83565b611297565b61036f610526366004612d3a565b6118b7565b61036f610539366004612d57565b6118cb565b6102d361054c366004612c4f565b611965565b60007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663397796f76040518163ffffffff1660e01b8152600401602060405180830381865afa1580156105be573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105e29190612d99565b15905090565b6105f3838383611a39565b505050565b855185518560ff16601f831115610670576040517f89a6198900000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f746f6f206d616e79207369676e6572730000000000000000000000000000000060448201526064015b60405180910390fd5b806000036106da576040517f89a6198900000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f66206d75737420626520706f73697469766500000000000000000000000000006044820152606401610667565b818314610768576040517f89a61989000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f6f7261636c6520616464726573736573206f7574206f6620726567697374726160448201527f74696f6e000000000000000000000000000000000000000000000000000000006064820152608401610667565b610773816003612dea565b83116107db576040517f89a6198900000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f6661756c74792d6f7261636c65206620746f6f206869676800000000000000006044820152606401610667565b6107e3611e4f565b6107ec86611ed2565b60065460005b818110156108e857600560006006838154811061081157610811612e01565b600091825260208083209091015473ffffffffffffffffffffffffffffffffffffffff168352820192909252604001812080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00001690556007805460059291908490811061088157610881612e01565b600091825260208083209091015473ffffffffffffffffffffffffffffffffffffffff168352820192909252604001902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00001690556108e181612e30565b90506107f2565b50895160005b81811015610cc15760008c828151811061090a5761090a612e01565b602002602001015190506000600281111561092757610927612e68565b73ffffffffffffffffffffffffffffffffffffffff8216600090815260056020526040902054610100900460ff16600281111561096657610966612e68565b146109cd576040517f89a6198900000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f7265706561746564207369676e657220616464726573730000000000000000006044820152606401610667565b73ffffffffffffffffffffffffffffffffffffffff8116610a1a576040517fd6c62c9b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040805180820190915260ff83168152602081016001905273ffffffffffffffffffffffffffffffffffffffff821660009081526005602090815260409091208251815460ff9091167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0082168117835592840151919283917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00001617610100836002811115610aca57610aca612e68565b021790555090505060008c8381518110610ae657610ae6612e01565b6020026020010151905060006002811115610b0357610b03612e68565b73ffffffffffffffffffffffffffffffffffffffff8216600090815260056020526040902054610100900460ff166002811115610b4257610b42612e68565b14610ba9576040517f89a6198900000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f7265706561746564207472616e736d69747465722061646472657373000000006044820152606401610667565b73ffffffffffffffffffffffffffffffffffffffff8116610bf6576040517fd6c62c9b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040805180820190915260ff84168152602081016002905273ffffffffffffffffffffffffffffffffffffffff821660009081526005602090815260409091208251815460ff9091167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0082168117835592840151919283917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00001617610100836002811115610ca657610ca6612e68565b0217905550905050505080610cba90612e30565b90506108ee565b508a51610cd59060069060208e01906125ca565b508951610ce99060079060208d01906125ca565b506003805460ff838116610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000909216908c161717905560048054610d6f914691309190600090610d419063ffffffff16612e97565b91906101000a81548163ffffffff021916908363ffffffff160217905563ffffffff168e8e8e8e8e8e61208e565b600260000181905550600060048054906101000a900463ffffffff169050436004806101000a81548163ffffffff021916908363ffffffff1602179055507f1591690b8638f5fb2dbec82ac741805ac5da8b45dc5263f4875b0496fdce4e0581600260000154600460009054906101000a900463ffffffff168f8f8f8f8f8f604051610e0399989796959493929190612eba565b60405180910390a1505050505050505050505050565b610e21611e4f565b6009805464ffffffffff90921668010000000000000000027fffffffffffffffffffffffffffffffffffffff0000000000ffffffffffffffff909216919091179055565b6009546000906d0100000000000000000000000000900460ff1615610eb6576040517feced32bc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000610f2787878080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808b0282810182019093528a82529093508a925089918291850190849080828437600092019190915250889250612139915050565b9050610f3281611965565b610f40576000915050610f52565b6000908152600a602052604090205490505b95945050505050565b610f63611e4f565b600980547fffffffffffffffffffffffffffffffffffff00ffffffffffffffffffffffffff1690556040513381527f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa906020015b60405180910390a1565b6060600780548060200260200160405190810160405280929190818152602001828054801561102657602002820191906000526020600020905b815473ffffffffffffffffffffffffffffffffffffffff168152600190910190602001808311610ffb575b5050505050905090565b60015473ffffffffffffffffffffffffffffffffffffffff1633146110b1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e6572000000000000000000006044820152606401610667565b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b611135611e4f565b600980547fffffffffffffffffffffffffffffffffffff00ffffffffffffffffffffffffff166d01000000000000000000000000001790556040513381527f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25890602001610fb7565b60007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663397796f76040518163ffffffff1660e01b8152600401602060405180830381865afa15801561120a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061122e9190612d99565b15801561124f57506009546d0100000000000000000000000000900460ff16155b905090565b61125c611e4f565b600980547fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000001667ffffffffffffffff92909216919091179055565b6112a6878760208b0135611a39565b6040805160608101825260025480825260035460ff8082166020850152610100909104169282019290925289359182146113195780516040517f93df584c000000000000000000000000000000000000000000000000000000008152600481019190915260248101839052604401610667565b467f00000000000000000000000000000000000000000000000000000000000000001461139a576040517f0f01ce850000000000000000000000000000000000000000000000000000000081527f00000000000000000000000000000000000000000000000000000000000000006004820152466024820152604401610667565b6040805183815260208c81013560081c63ffffffff16908201527fb04e63db38c49950639fa09d29872f21f5d49d614f3a969d8adf3d4b52e41a62910160405180910390a160007f00000000000000000000000000000000000000000000000000000000000000001561143c5760028260200151836040015161141d9190612f50565b6114279190612f69565b611432906001612f50565b60ff169050611452565b602082015161144c906001612f50565b60ff1690505b86811461148b576040517f71253a2500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8685146114c4576040517fa75d88af00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b3360009081526005602090815260408083208151808301909252805460ff8082168452929391929184019161010090910416600281111561150757611507612e68565b600281111561151857611518612e68565b905250905060028160200151600281111561153557611535612e68565b14801561157c57506007816000015160ff168154811061155757611557612e01565b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff1633145b6115b2576040517fda0f08e800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5060006115c0866020612dea565b6115cb896020612dea565b6115d78c610144612fb2565b6115e19190612fb2565b6115eb9190612fb2565b905036811461162f576040517f8e1192e100000000000000000000000000000000000000000000000000000000815260048101829052366024820152604401610667565b5060008a8a604051611642929190612fc5565b604051908190038120611659918e90602001612fd5565b604051602081830303815290604052805190602001209050611679612654565b8860005b818110156118a65760006001858a846020811061169c5761169c612e01565b6116a991901a601b612f50565b8f8f868181106116bb576116bb612e01565b905060200201358e8e878181106116d4576116d4612e01565b9050602002013560405160008152602001604052604051611711949392919093845260ff9290921660208401526040830152606082015260800190565b6020604051602081039080840390855afa158015611733573d6000803e3d6000fd5b5050604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081015173ffffffffffffffffffffffffffffffffffffffff8116600090815260056020908152848220848601909552845460ff80821686529397509195509293928401916101009091041660028111156117b6576117b6612e68565b60028111156117c7576117c7612e68565b90525090506001816020015160028111156117e4576117e4612e68565b1461181b576040517fca31867a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8051859060ff16601f811061183257611832612e01565b60200201511561186e576040517ff67bc7c400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600185826000015160ff16601f811061188957611889612e01565b911515602090920201525061189f905081612e30565b905061167d565b505050505050505050505050505050565b6118bf611e4f565b6118c88161245a565b50565b6118d3611e4f565b60005b818110156105f35760008383838181106118f2576118f2612e01565b90506020020135905061190481611965565b611954576000818152600a602052604080822091909155517f202f1139a3e334b6056064c0e9b19fd07e44a88d8f6e5ded571b24cf8c371f129061194b9083815260200190565b60405180910390a15b5061195e81612e30565b90506118d6565b6040805180820182523081526020810183815291517f4d616771000000000000000000000000000000000000000000000000000000008152905173ffffffffffffffffffffffffffffffffffffffff9081166004830152915160248201526000917f00000000000000000000000000000000000000000000000000000000000000001690634d61677190604401602060405180830381865afa158015611a0f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a339190612d99565b92915050565b6009546d0100000000000000000000000000900460ff1615611a87576040517feced32bc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663397796f76040518163ffffffff1660e01b8152600401602060405180830381865afa158015611af2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b169190612d99565b15611b4d576040517fc148371500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000611b5b8385018561304f565b80515151909150151580611b7d575080516020015167ffffffffffffffff1615155b15611cb55760095464ffffffffff80841668010000000000000000909204161015611c7a57600980547fffffffffffffffffffffffffffffffffffffff0000000000ffffffffffffffff166801000000000000000064ffffffffff85160217905560085481516040517f866548c900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9092169163866548c991611c3491600401613266565b600060405180830381600087803b158015611c4e57600080fd5b505af1158015611c62573d6000803e3d6000fd5b505050506040810151611c755750505050565b611cb5565b6040810151611cb5576040517ff803a2ca00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60208101515160095467ffffffffffffffff9081169116141580611cf0575060208082015190810151905167ffffffffffffffff9182169116115b15611d2d5780602001516040517fbb1ae18d0000000000000000000000000000000000000000000000000000000081526004016106679190613279565b6040810151611d68576040517f504570e300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040808201516000908152600a602052205415611db1576040517fa0bce24f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6020808201510151611dc490600161329e565b600980547fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000001667ffffffffffffffff929092169190911790556040818101516000908152600a602052819020429055517fe81b49e583122eb290c46fc255c962b9a2dec468816c00fb7a2e6ebc42dc92d490611e419083906132c6565b60405180910390a150505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314611ed0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e6572000000000000000000006044820152606401610667565b565b600081806020019051810190611ee89190613322565b805190915073ffffffffffffffffffffffffffffffffffffffff16611f39576040517f3f8be2be00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8051600880547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff928316179055600980547fffffffffffffffffffffffffffffffffffffff0000000000ffffffffffffffff169055604080516080810182527f000000000000000000000000000000000000000000000000000000000000000067ffffffffffffffff90811682527f00000000000000000000000000000000000000000000000000000000000000001660208201527f00000000000000000000000000000000000000000000000000000000000000008316818301527f00000000000000000000000000000000000000000000000000000000000000009092166060830152517fc9d7123efd4203e60b0f0a4b1dbc4800fc97ce63679f71c3a27279b24a7ddec39161208291849061336e565b60405180910390a15050565b6000808a8a8a8a8a8a8a8a8a6040516020016120b2999897969594939291906133eb565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815291905280516020909101207dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167e01000000000000000000000000000000000000000000000000000000000000179150509998505050505050505050565b825182516000919081830361217a576040517f11a6b26400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610101821180159061218e57506101018111155b6121c4576040517f09bde33900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82820101610100811115612225576040517f09bde33900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80600003612252578660008151811061224057612240612e01565b60200260200101519350505050612453565b60008167ffffffffffffffff81111561226d5761226d61280f565b604051908082528060200260200182016040528015612296578160200160208202803683370190505b50905060008080805b858110156123d95760006001821b8b8116036122fa57888510156122e3578c5160018601958e9181106122d4576122d4612e01565b6020026020010151905061231c565b85516001850194879181106122d4576122d4612e01565b8b5160018401938d91811061231157612311612e01565b602002602001015190505b60008986101561234c578d5160018701968f91811061233d5761233d612e01565b6020026020010151905061236e565b865160018601958891811061236357612363612e01565b602002602001015190505b828511156123a8576040517f09bde33900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6123b2828261254f565b8784815181106123c4576123c4612e01565b6020908102919091010152505060010161229f565b5060018503821480156123eb57508683145b80156123f657508581145b61242c576040517f09bde33900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b83600186038151811061244157612441612e01565b60200260200101519750505050505050505b9392505050565b3373ffffffffffffffffffffffffffffffffffffffff8216036124d9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c660000000000000000006044820152606401610667565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b60008183106125915760408051600160208083019190915281830185905260608083018790528351808403909101815260809092019092528051910120612453565b60408051600160208083019190915281830186905260608083018690528351808403909101815260809092019092528051910120612453565b828054828255906000526020600020908101928215612644579160200282015b8281111561264457825182547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff9091161782556020909201916001909101906125ea565b50612650929150612673565b5090565b604051806103e00160405280601f906020820280368337509192915050565b5b808211156126505760008155600101612674565b60808101611a33828467ffffffffffffffff80825116835280602083015116602084015250604081015173ffffffffffffffffffffffffffffffffffffffff808216604085015280606084015116606085015250505050565b6000815180845260005b81811015612707576020818501810151868301820152016126eb565b5060006020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b60208152600061245360208301846126e1565b60008083601f84011261276a57600080fd5b50813567ffffffffffffffff81111561278257600080fd5b60208301915083602082850101111561279a57600080fd5b9250929050565b803564ffffffffff811681146127b657600080fd5b919050565b6000806000604084860312156127d057600080fd5b833567ffffffffffffffff8111156127e757600080fd5b6127f386828701612758565b90945092506128069050602085016127a1565b90509250925092565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040805190810167ffffffffffffffff811182821017156128615761286161280f565b60405290565b6040516060810167ffffffffffffffff811182821017156128615761286161280f565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff811182821017156128d1576128d161280f565b604052919050565b600067ffffffffffffffff8211156128f3576128f361280f565b5060051b60200190565b73ffffffffffffffffffffffffffffffffffffffff811681146118c857600080fd5b600082601f83011261293057600080fd5b81356020612945612940836128d9565b61288a565b82815260059290921b8401810191818101908684111561296457600080fd5b8286015b8481101561298857803561297b816128fd565b8352918301918301612968565b509695505050505050565b803560ff811681146127b657600080fd5b600082601f8301126129b557600080fd5b813567ffffffffffffffff8111156129cf576129cf61280f565b612a0060207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8401160161288a565b818152846020838601011115612a1557600080fd5b816020850160208301376000918101602001919091529392505050565b803567ffffffffffffffff811681146127b657600080fd5b60008060008060008060c08789031215612a6357600080fd5b863567ffffffffffffffff80821115612a7b57600080fd5b612a878a838b0161291f565b97506020890135915080821115612a9d57600080fd5b612aa98a838b0161291f565b9650612ab760408a01612993565b95506060890135915080821115612acd57600080fd5b612ad98a838b016129a4565b9450612ae760808a01612a32565b935060a0890135915080821115612afd57600080fd5b50612b0a89828a016129a4565b9150509295509295509295565b600060208284031215612b2957600080fd5b612453826127a1565b60008083601f840112612b4457600080fd5b50813567ffffffffffffffff811115612b5c57600080fd5b6020830191508360208260051b850101111561279a57600080fd5b600080600080600060608688031215612b8f57600080fd5b853567ffffffffffffffff80821115612ba757600080fd5b612bb389838a01612b32565b90975095506020880135915080821115612bcc57600080fd5b50612bd988828901612b32565b96999598509660400135949350505050565b600081518084526020808501945080840160005b83811015612c3157815173ffffffffffffffffffffffffffffffffffffffff1687529582019590820190600101612bff565b509495945050505050565b6020815260006124536020830184612beb565b600060208284031215612c6157600080fd5b5035919050565b600060208284031215612c7a57600080fd5b61245382612a32565b60008060008060008060008060e0898b031215612c9f57600080fd5b606089018a811115612cb057600080fd5b8998503567ffffffffffffffff80821115612cca57600080fd5b612cd68c838d01612758565b909950975060808b0135915080821115612cef57600080fd5b612cfb8c838d01612b32565b909750955060a08b0135915080821115612d1457600080fd5b50612d218b828c01612b32565b999c989b50969995989497949560c00135949350505050565b600060208284031215612d4c57600080fd5b8135612453816128fd565b60008060208385031215612d6a57600080fd5b823567ffffffffffffffff811115612d8157600080fd5b612d8d85828601612b32565b90969095509350505050565b600060208284031215612dab57600080fd5b8151801515811461245357600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8082028115828204841417611a3357611a33612dbb565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203612e6157612e61612dbb565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b600063ffffffff808316818103612eb057612eb0612dbb565b6001019392505050565b600061012063ffffffff808d1684528b6020850152808b16604085015250806060840152612eea8184018a612beb565b90508281036080840152612efe8189612beb565b905060ff871660a084015282810360c0840152612f1b81876126e1565b905067ffffffffffffffff851660e0840152828103610100840152612f4081856126e1565b9c9b505050505050505050505050565b60ff8181168382160190811115611a3357611a33612dbb565b600060ff831680612fa3577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b8060ff84160491505092915050565b80820180821115611a3357611a33612dbb565b8183823760009101908152919050565b828152606082602083013760800192915050565b803577ffffffffffffffffffffffffffffffffffffffffffffffff811681146127b657600080fd5b60006040828403121561302357600080fd5b61302b61283e565b905061303682612a32565b815261304460208301612a32565b602082015292915050565b6000602080838503121561306257600080fd5b823567ffffffffffffffff8082111561307a57600080fd5b908401906080828703121561308e57600080fd5b613096612867565b8235828111156130a557600080fd5b8301606081890312156130b757600080fd5b6130bf612867565b8135848111156130ce57600080fd5b82019350601f840189136130e157600080fd5b83356130ef612940826128d9565b81815260069190911b8501870190878101908b83111561310e57600080fd5b958801955b82871015613162576040878d03121561312c5760008081fd5b61313461283e565b873561313f816128fd565b815261314c888b01612fe9565b818b015282526040969096019590880190613113565b8352506131729050828701612a32565b8682015261318260408301612fe9565b604082015282525061319687848601613011565b93810193909352506060013560408201529392505050565b805160608084528151908401819052600091602091908201906080860190845b81811015613225578351805173ffffffffffffffffffffffffffffffffffffffff16845285015177ffffffffffffffffffffffffffffffffffffffffffffffff1685840152928401926040909201916001016131ce565b505067ffffffffffffffff83860151168387015260408501519250610f52604087018477ffffffffffffffffffffffffffffffffffffffffffffffff169052565b60208152600061245360208301846131ae565b60408101611a338284805167ffffffffffffffff908116835260209182015116910152565b67ffffffffffffffff8181168382160190808211156132bf576132bf612dbb565b5092915050565b6020815260008251608060208401526132e260a08401826131ae565b9050602084015161330d6040850182805167ffffffffffffffff908116835260209182015116910152565b50604084015160808401528091505092915050565b60006020828403121561333457600080fd5b6040516020810181811067ffffffffffffffff821117156133575761335761280f565b6040528251613365816128fd565b81529392505050565b60a081016133c7828567ffffffffffffffff80825116835280602083015116602084015250604081015173ffffffffffffffffffffffffffffffffffffffff808216604085015280606084015116606085015250505050565b73ffffffffffffffffffffffffffffffffffffffff83511660808301529392505050565b60006101208b835273ffffffffffffffffffffffffffffffffffffffff8b16602084015267ffffffffffffffff808b1660408501528160608501526134328285018b612beb565b91508382036080850152613446828a612beb565b915060ff881660a085015283820360c085015261346382886126e1565b90861660e08501528381036101008501529050612f4081856126e156fea164736f6c6343000813000a", +} + +var CommitStoreHelperABI = CommitStoreHelperMetaData.ABI + +var CommitStoreHelperBin = CommitStoreHelperMetaData.Bin + +func DeployCommitStoreHelper(auth *bind.TransactOpts, backend bind.ContractBackend, staticConfig CommitStoreStaticConfig) (common.Address, *types.Transaction, *CommitStoreHelper, error) { + parsed, err := CommitStoreHelperMetaData.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(CommitStoreHelperBin), backend, staticConfig) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &CommitStoreHelper{CommitStoreHelperCaller: CommitStoreHelperCaller{contract: contract}, CommitStoreHelperTransactor: CommitStoreHelperTransactor{contract: contract}, CommitStoreHelperFilterer: CommitStoreHelperFilterer{contract: contract}}, nil +} + +type CommitStoreHelper struct { + address common.Address + abi abi.ABI + CommitStoreHelperCaller + CommitStoreHelperTransactor + CommitStoreHelperFilterer +} + +type CommitStoreHelperCaller struct { + contract *bind.BoundContract +} + +type CommitStoreHelperTransactor struct { + contract *bind.BoundContract +} + +type CommitStoreHelperFilterer struct { + contract *bind.BoundContract +} + +type CommitStoreHelperSession struct { + Contract *CommitStoreHelper + CallOpts bind.CallOpts + TransactOpts bind.TransactOpts +} + +type CommitStoreHelperCallerSession struct { + Contract *CommitStoreHelperCaller + CallOpts bind.CallOpts +} + +type CommitStoreHelperTransactorSession struct { + Contract *CommitStoreHelperTransactor + TransactOpts bind.TransactOpts +} + +type CommitStoreHelperRaw struct { + Contract *CommitStoreHelper +} + +type CommitStoreHelperCallerRaw struct { + Contract *CommitStoreHelperCaller +} + +type CommitStoreHelperTransactorRaw struct { + Contract *CommitStoreHelperTransactor +} + +func NewCommitStoreHelper(address common.Address, backend bind.ContractBackend) (*CommitStoreHelper, error) { + abi, err := abi.JSON(strings.NewReader(CommitStoreHelperABI)) + if err != nil { + return nil, err + } + contract, err := bindCommitStoreHelper(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &CommitStoreHelper{address: address, abi: abi, CommitStoreHelperCaller: CommitStoreHelperCaller{contract: contract}, CommitStoreHelperTransactor: CommitStoreHelperTransactor{contract: contract}, CommitStoreHelperFilterer: CommitStoreHelperFilterer{contract: contract}}, nil +} + +func NewCommitStoreHelperCaller(address common.Address, caller bind.ContractCaller) (*CommitStoreHelperCaller, error) { + contract, err := bindCommitStoreHelper(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &CommitStoreHelperCaller{contract: contract}, nil +} + +func NewCommitStoreHelperTransactor(address common.Address, transactor bind.ContractTransactor) (*CommitStoreHelperTransactor, error) { + contract, err := bindCommitStoreHelper(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &CommitStoreHelperTransactor{contract: contract}, nil +} + +func NewCommitStoreHelperFilterer(address common.Address, filterer bind.ContractFilterer) (*CommitStoreHelperFilterer, error) { + contract, err := bindCommitStoreHelper(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &CommitStoreHelperFilterer{contract: contract}, nil +} + +func bindCommitStoreHelper(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := CommitStoreHelperMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +func (_CommitStoreHelper *CommitStoreHelperRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _CommitStoreHelper.Contract.CommitStoreHelperCaller.contract.Call(opts, result, method, params...) +} + +func (_CommitStoreHelper *CommitStoreHelperRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _CommitStoreHelper.Contract.CommitStoreHelperTransactor.contract.Transfer(opts) +} + +func (_CommitStoreHelper *CommitStoreHelperRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _CommitStoreHelper.Contract.CommitStoreHelperTransactor.contract.Transact(opts, method, params...) +} + +func (_CommitStoreHelper *CommitStoreHelperCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _CommitStoreHelper.Contract.contract.Call(opts, result, method, params...) +} + +func (_CommitStoreHelper *CommitStoreHelperTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _CommitStoreHelper.Contract.contract.Transfer(opts) +} + +func (_CommitStoreHelper *CommitStoreHelperTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _CommitStoreHelper.Contract.contract.Transact(opts, method, params...) +} + +func (_CommitStoreHelper *CommitStoreHelperCaller) GetDynamicConfig(opts *bind.CallOpts) (CommitStoreDynamicConfig, error) { + var out []interface{} + err := _CommitStoreHelper.contract.Call(opts, &out, "getDynamicConfig") + + if err != nil { + return *new(CommitStoreDynamicConfig), err + } + + out0 := *abi.ConvertType(out[0], new(CommitStoreDynamicConfig)).(*CommitStoreDynamicConfig) + + return out0, err + +} + +func (_CommitStoreHelper *CommitStoreHelperSession) GetDynamicConfig() (CommitStoreDynamicConfig, error) { + return _CommitStoreHelper.Contract.GetDynamicConfig(&_CommitStoreHelper.CallOpts) +} + +func (_CommitStoreHelper *CommitStoreHelperCallerSession) GetDynamicConfig() (CommitStoreDynamicConfig, error) { + return _CommitStoreHelper.Contract.GetDynamicConfig(&_CommitStoreHelper.CallOpts) +} + +func (_CommitStoreHelper *CommitStoreHelperCaller) GetExpectedNextSequenceNumber(opts *bind.CallOpts) (uint64, error) { + var out []interface{} + err := _CommitStoreHelper.contract.Call(opts, &out, "getExpectedNextSequenceNumber") + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +func (_CommitStoreHelper *CommitStoreHelperSession) GetExpectedNextSequenceNumber() (uint64, error) { + return _CommitStoreHelper.Contract.GetExpectedNextSequenceNumber(&_CommitStoreHelper.CallOpts) +} + +func (_CommitStoreHelper *CommitStoreHelperCallerSession) GetExpectedNextSequenceNumber() (uint64, error) { + return _CommitStoreHelper.Contract.GetExpectedNextSequenceNumber(&_CommitStoreHelper.CallOpts) +} + +func (_CommitStoreHelper *CommitStoreHelperCaller) GetLatestPriceEpochAndRound(opts *bind.CallOpts) (uint64, error) { + var out []interface{} + err := _CommitStoreHelper.contract.Call(opts, &out, "getLatestPriceEpochAndRound") + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +func (_CommitStoreHelper *CommitStoreHelperSession) GetLatestPriceEpochAndRound() (uint64, error) { + return _CommitStoreHelper.Contract.GetLatestPriceEpochAndRound(&_CommitStoreHelper.CallOpts) +} + +func (_CommitStoreHelper *CommitStoreHelperCallerSession) GetLatestPriceEpochAndRound() (uint64, error) { + return _CommitStoreHelper.Contract.GetLatestPriceEpochAndRound(&_CommitStoreHelper.CallOpts) +} + +func (_CommitStoreHelper *CommitStoreHelperCaller) GetMerkleRoot(opts *bind.CallOpts, root [32]byte) (*big.Int, error) { + var out []interface{} + err := _CommitStoreHelper.contract.Call(opts, &out, "getMerkleRoot", root) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_CommitStoreHelper *CommitStoreHelperSession) GetMerkleRoot(root [32]byte) (*big.Int, error) { + return _CommitStoreHelper.Contract.GetMerkleRoot(&_CommitStoreHelper.CallOpts, root) +} + +func (_CommitStoreHelper *CommitStoreHelperCallerSession) GetMerkleRoot(root [32]byte) (*big.Int, error) { + return _CommitStoreHelper.Contract.GetMerkleRoot(&_CommitStoreHelper.CallOpts, root) +} + +func (_CommitStoreHelper *CommitStoreHelperCaller) GetStaticConfig(opts *bind.CallOpts) (CommitStoreStaticConfig, error) { + var out []interface{} + err := _CommitStoreHelper.contract.Call(opts, &out, "getStaticConfig") + + if err != nil { + return *new(CommitStoreStaticConfig), err + } + + out0 := *abi.ConvertType(out[0], new(CommitStoreStaticConfig)).(*CommitStoreStaticConfig) + + return out0, err + +} + +func (_CommitStoreHelper *CommitStoreHelperSession) GetStaticConfig() (CommitStoreStaticConfig, error) { + return _CommitStoreHelper.Contract.GetStaticConfig(&_CommitStoreHelper.CallOpts) +} + +func (_CommitStoreHelper *CommitStoreHelperCallerSession) GetStaticConfig() (CommitStoreStaticConfig, error) { + return _CommitStoreHelper.Contract.GetStaticConfig(&_CommitStoreHelper.CallOpts) +} + +func (_CommitStoreHelper *CommitStoreHelperCaller) GetTransmitters(opts *bind.CallOpts) ([]common.Address, error) { + var out []interface{} + err := _CommitStoreHelper.contract.Call(opts, &out, "getTransmitters") + + if err != nil { + return *new([]common.Address), err + } + + out0 := *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) + + return out0, err + +} + +func (_CommitStoreHelper *CommitStoreHelperSession) GetTransmitters() ([]common.Address, error) { + return _CommitStoreHelper.Contract.GetTransmitters(&_CommitStoreHelper.CallOpts) +} + +func (_CommitStoreHelper *CommitStoreHelperCallerSession) GetTransmitters() ([]common.Address, error) { + return _CommitStoreHelper.Contract.GetTransmitters(&_CommitStoreHelper.CallOpts) +} + +func (_CommitStoreHelper *CommitStoreHelperCaller) IsARMHealthy(opts *bind.CallOpts) (bool, error) { + var out []interface{} + err := _CommitStoreHelper.contract.Call(opts, &out, "isARMHealthy") + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_CommitStoreHelper *CommitStoreHelperSession) IsARMHealthy() (bool, error) { + return _CommitStoreHelper.Contract.IsARMHealthy(&_CommitStoreHelper.CallOpts) +} + +func (_CommitStoreHelper *CommitStoreHelperCallerSession) IsARMHealthy() (bool, error) { + return _CommitStoreHelper.Contract.IsARMHealthy(&_CommitStoreHelper.CallOpts) +} + +func (_CommitStoreHelper *CommitStoreHelperCaller) IsBlessed(opts *bind.CallOpts, root [32]byte) (bool, error) { + var out []interface{} + err := _CommitStoreHelper.contract.Call(opts, &out, "isBlessed", root) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_CommitStoreHelper *CommitStoreHelperSession) IsBlessed(root [32]byte) (bool, error) { + return _CommitStoreHelper.Contract.IsBlessed(&_CommitStoreHelper.CallOpts, root) +} + +func (_CommitStoreHelper *CommitStoreHelperCallerSession) IsBlessed(root [32]byte) (bool, error) { + return _CommitStoreHelper.Contract.IsBlessed(&_CommitStoreHelper.CallOpts, root) +} + +func (_CommitStoreHelper *CommitStoreHelperCaller) IsUnpausedAndARMHealthy(opts *bind.CallOpts) (bool, error) { + var out []interface{} + err := _CommitStoreHelper.contract.Call(opts, &out, "isUnpausedAndARMHealthy") + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_CommitStoreHelper *CommitStoreHelperSession) IsUnpausedAndARMHealthy() (bool, error) { + return _CommitStoreHelper.Contract.IsUnpausedAndARMHealthy(&_CommitStoreHelper.CallOpts) +} + +func (_CommitStoreHelper *CommitStoreHelperCallerSession) IsUnpausedAndARMHealthy() (bool, error) { + return _CommitStoreHelper.Contract.IsUnpausedAndARMHealthy(&_CommitStoreHelper.CallOpts) +} + +func (_CommitStoreHelper *CommitStoreHelperCaller) LatestConfigDetails(opts *bind.CallOpts) (LatestConfigDetails, + + error) { + var out []interface{} + err := _CommitStoreHelper.contract.Call(opts, &out, "latestConfigDetails") + + outstruct := new(LatestConfigDetails) + if err != nil { + return *outstruct, err + } + + outstruct.ConfigCount = *abi.ConvertType(out[0], new(uint32)).(*uint32) + outstruct.BlockNumber = *abi.ConvertType(out[1], new(uint32)).(*uint32) + outstruct.ConfigDigest = *abi.ConvertType(out[2], new([32]byte)).(*[32]byte) + + return *outstruct, err + +} + +func (_CommitStoreHelper *CommitStoreHelperSession) LatestConfigDetails() (LatestConfigDetails, + + error) { + return _CommitStoreHelper.Contract.LatestConfigDetails(&_CommitStoreHelper.CallOpts) +} + +func (_CommitStoreHelper *CommitStoreHelperCallerSession) LatestConfigDetails() (LatestConfigDetails, + + error) { + return _CommitStoreHelper.Contract.LatestConfigDetails(&_CommitStoreHelper.CallOpts) +} + +func (_CommitStoreHelper *CommitStoreHelperCaller) LatestConfigDigestAndEpoch(opts *bind.CallOpts) (LatestConfigDigestAndEpoch, + + error) { + var out []interface{} + err := _CommitStoreHelper.contract.Call(opts, &out, "latestConfigDigestAndEpoch") + + outstruct := new(LatestConfigDigestAndEpoch) + if err != nil { + return *outstruct, err + } + + outstruct.ScanLogs = *abi.ConvertType(out[0], new(bool)).(*bool) + outstruct.ConfigDigest = *abi.ConvertType(out[1], new([32]byte)).(*[32]byte) + outstruct.Epoch = *abi.ConvertType(out[2], new(uint32)).(*uint32) + + return *outstruct, err + +} + +func (_CommitStoreHelper *CommitStoreHelperSession) LatestConfigDigestAndEpoch() (LatestConfigDigestAndEpoch, + + error) { + return _CommitStoreHelper.Contract.LatestConfigDigestAndEpoch(&_CommitStoreHelper.CallOpts) +} + +func (_CommitStoreHelper *CommitStoreHelperCallerSession) LatestConfigDigestAndEpoch() (LatestConfigDigestAndEpoch, + + error) { + return _CommitStoreHelper.Contract.LatestConfigDigestAndEpoch(&_CommitStoreHelper.CallOpts) +} + +func (_CommitStoreHelper *CommitStoreHelperCaller) Owner(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _CommitStoreHelper.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 + +} + +func (_CommitStoreHelper *CommitStoreHelperSession) Owner() (common.Address, error) { + return _CommitStoreHelper.Contract.Owner(&_CommitStoreHelper.CallOpts) +} + +func (_CommitStoreHelper *CommitStoreHelperCallerSession) Owner() (common.Address, error) { + return _CommitStoreHelper.Contract.Owner(&_CommitStoreHelper.CallOpts) +} + +func (_CommitStoreHelper *CommitStoreHelperCaller) Paused(opts *bind.CallOpts) (bool, error) { + var out []interface{} + err := _CommitStoreHelper.contract.Call(opts, &out, "paused") + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_CommitStoreHelper *CommitStoreHelperSession) Paused() (bool, error) { + return _CommitStoreHelper.Contract.Paused(&_CommitStoreHelper.CallOpts) +} + +func (_CommitStoreHelper *CommitStoreHelperCallerSession) Paused() (bool, error) { + return _CommitStoreHelper.Contract.Paused(&_CommitStoreHelper.CallOpts) +} + +func (_CommitStoreHelper *CommitStoreHelperCaller) TypeAndVersion(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _CommitStoreHelper.contract.Call(opts, &out, "typeAndVersion") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +func (_CommitStoreHelper *CommitStoreHelperSession) TypeAndVersion() (string, error) { + return _CommitStoreHelper.Contract.TypeAndVersion(&_CommitStoreHelper.CallOpts) +} + +func (_CommitStoreHelper *CommitStoreHelperCallerSession) TypeAndVersion() (string, error) { + return _CommitStoreHelper.Contract.TypeAndVersion(&_CommitStoreHelper.CallOpts) +} + +func (_CommitStoreHelper *CommitStoreHelperCaller) Verify(opts *bind.CallOpts, hashedLeaves [][32]byte, proofs [][32]byte, proofFlagBits *big.Int) (*big.Int, error) { + var out []interface{} + err := _CommitStoreHelper.contract.Call(opts, &out, "verify", hashedLeaves, proofs, proofFlagBits) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_CommitStoreHelper *CommitStoreHelperSession) Verify(hashedLeaves [][32]byte, proofs [][32]byte, proofFlagBits *big.Int) (*big.Int, error) { + return _CommitStoreHelper.Contract.Verify(&_CommitStoreHelper.CallOpts, hashedLeaves, proofs, proofFlagBits) +} + +func (_CommitStoreHelper *CommitStoreHelperCallerSession) Verify(hashedLeaves [][32]byte, proofs [][32]byte, proofFlagBits *big.Int) (*big.Int, error) { + return _CommitStoreHelper.Contract.Verify(&_CommitStoreHelper.CallOpts, hashedLeaves, proofs, proofFlagBits) +} + +func (_CommitStoreHelper *CommitStoreHelperTransactor) AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + return _CommitStoreHelper.contract.Transact(opts, "acceptOwnership") +} + +func (_CommitStoreHelper *CommitStoreHelperSession) AcceptOwnership() (*types.Transaction, error) { + return _CommitStoreHelper.Contract.AcceptOwnership(&_CommitStoreHelper.TransactOpts) +} + +func (_CommitStoreHelper *CommitStoreHelperTransactorSession) AcceptOwnership() (*types.Transaction, error) { + return _CommitStoreHelper.Contract.AcceptOwnership(&_CommitStoreHelper.TransactOpts) +} + +func (_CommitStoreHelper *CommitStoreHelperTransactor) Pause(opts *bind.TransactOpts) (*types.Transaction, error) { + return _CommitStoreHelper.contract.Transact(opts, "pause") +} + +func (_CommitStoreHelper *CommitStoreHelperSession) Pause() (*types.Transaction, error) { + return _CommitStoreHelper.Contract.Pause(&_CommitStoreHelper.TransactOpts) +} + +func (_CommitStoreHelper *CommitStoreHelperTransactorSession) Pause() (*types.Transaction, error) { + return _CommitStoreHelper.Contract.Pause(&_CommitStoreHelper.TransactOpts) +} + +func (_CommitStoreHelper *CommitStoreHelperTransactor) Report(opts *bind.TransactOpts, commitReport []byte, epochAndRound *big.Int) (*types.Transaction, error) { + return _CommitStoreHelper.contract.Transact(opts, "report", commitReport, epochAndRound) +} + +func (_CommitStoreHelper *CommitStoreHelperSession) Report(commitReport []byte, epochAndRound *big.Int) (*types.Transaction, error) { + return _CommitStoreHelper.Contract.Report(&_CommitStoreHelper.TransactOpts, commitReport, epochAndRound) +} + +func (_CommitStoreHelper *CommitStoreHelperTransactorSession) Report(commitReport []byte, epochAndRound *big.Int) (*types.Transaction, error) { + return _CommitStoreHelper.Contract.Report(&_CommitStoreHelper.TransactOpts, commitReport, epochAndRound) +} + +func (_CommitStoreHelper *CommitStoreHelperTransactor) ResetUnblessedRoots(opts *bind.TransactOpts, rootToReset [][32]byte) (*types.Transaction, error) { + return _CommitStoreHelper.contract.Transact(opts, "resetUnblessedRoots", rootToReset) +} + +func (_CommitStoreHelper *CommitStoreHelperSession) ResetUnblessedRoots(rootToReset [][32]byte) (*types.Transaction, error) { + return _CommitStoreHelper.Contract.ResetUnblessedRoots(&_CommitStoreHelper.TransactOpts, rootToReset) +} + +func (_CommitStoreHelper *CommitStoreHelperTransactorSession) ResetUnblessedRoots(rootToReset [][32]byte) (*types.Transaction, error) { + return _CommitStoreHelper.Contract.ResetUnblessedRoots(&_CommitStoreHelper.TransactOpts, rootToReset) +} + +func (_CommitStoreHelper *CommitStoreHelperTransactor) SetLatestPriceEpochAndRound(opts *bind.TransactOpts, latestPriceEpochAndRound *big.Int) (*types.Transaction, error) { + return _CommitStoreHelper.contract.Transact(opts, "setLatestPriceEpochAndRound", latestPriceEpochAndRound) +} + +func (_CommitStoreHelper *CommitStoreHelperSession) SetLatestPriceEpochAndRound(latestPriceEpochAndRound *big.Int) (*types.Transaction, error) { + return _CommitStoreHelper.Contract.SetLatestPriceEpochAndRound(&_CommitStoreHelper.TransactOpts, latestPriceEpochAndRound) +} + +func (_CommitStoreHelper *CommitStoreHelperTransactorSession) SetLatestPriceEpochAndRound(latestPriceEpochAndRound *big.Int) (*types.Transaction, error) { + return _CommitStoreHelper.Contract.SetLatestPriceEpochAndRound(&_CommitStoreHelper.TransactOpts, latestPriceEpochAndRound) +} + +func (_CommitStoreHelper *CommitStoreHelperTransactor) SetMinSeqNr(opts *bind.TransactOpts, minSeqNr uint64) (*types.Transaction, error) { + return _CommitStoreHelper.contract.Transact(opts, "setMinSeqNr", minSeqNr) +} + +func (_CommitStoreHelper *CommitStoreHelperSession) SetMinSeqNr(minSeqNr uint64) (*types.Transaction, error) { + return _CommitStoreHelper.Contract.SetMinSeqNr(&_CommitStoreHelper.TransactOpts, minSeqNr) +} + +func (_CommitStoreHelper *CommitStoreHelperTransactorSession) SetMinSeqNr(minSeqNr uint64) (*types.Transaction, error) { + return _CommitStoreHelper.Contract.SetMinSeqNr(&_CommitStoreHelper.TransactOpts, minSeqNr) +} + +func (_CommitStoreHelper *CommitStoreHelperTransactor) SetOCR2Config(opts *bind.TransactOpts, signers []common.Address, transmitters []common.Address, f uint8, onchainConfig []byte, offchainConfigVersion uint64, offchainConfig []byte) (*types.Transaction, error) { + return _CommitStoreHelper.contract.Transact(opts, "setOCR2Config", signers, transmitters, f, onchainConfig, offchainConfigVersion, offchainConfig) +} + +func (_CommitStoreHelper *CommitStoreHelperSession) SetOCR2Config(signers []common.Address, transmitters []common.Address, f uint8, onchainConfig []byte, offchainConfigVersion uint64, offchainConfig []byte) (*types.Transaction, error) { + return _CommitStoreHelper.Contract.SetOCR2Config(&_CommitStoreHelper.TransactOpts, signers, transmitters, f, onchainConfig, offchainConfigVersion, offchainConfig) +} + +func (_CommitStoreHelper *CommitStoreHelperTransactorSession) SetOCR2Config(signers []common.Address, transmitters []common.Address, f uint8, onchainConfig []byte, offchainConfigVersion uint64, offchainConfig []byte) (*types.Transaction, error) { + return _CommitStoreHelper.Contract.SetOCR2Config(&_CommitStoreHelper.TransactOpts, signers, transmitters, f, onchainConfig, offchainConfigVersion, offchainConfig) +} + +func (_CommitStoreHelper *CommitStoreHelperTransactor) TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) { + return _CommitStoreHelper.contract.Transact(opts, "transferOwnership", to) +} + +func (_CommitStoreHelper *CommitStoreHelperSession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _CommitStoreHelper.Contract.TransferOwnership(&_CommitStoreHelper.TransactOpts, to) +} + +func (_CommitStoreHelper *CommitStoreHelperTransactorSession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _CommitStoreHelper.Contract.TransferOwnership(&_CommitStoreHelper.TransactOpts, to) +} + +func (_CommitStoreHelper *CommitStoreHelperTransactor) Transmit(opts *bind.TransactOpts, reportContext [3][32]byte, report []byte, rs [][32]byte, ss [][32]byte, rawVs [32]byte) (*types.Transaction, error) { + return _CommitStoreHelper.contract.Transact(opts, "transmit", reportContext, report, rs, ss, rawVs) +} + +func (_CommitStoreHelper *CommitStoreHelperSession) Transmit(reportContext [3][32]byte, report []byte, rs [][32]byte, ss [][32]byte, rawVs [32]byte) (*types.Transaction, error) { + return _CommitStoreHelper.Contract.Transmit(&_CommitStoreHelper.TransactOpts, reportContext, report, rs, ss, rawVs) +} + +func (_CommitStoreHelper *CommitStoreHelperTransactorSession) Transmit(reportContext [3][32]byte, report []byte, rs [][32]byte, ss [][32]byte, rawVs [32]byte) (*types.Transaction, error) { + return _CommitStoreHelper.Contract.Transmit(&_CommitStoreHelper.TransactOpts, reportContext, report, rs, ss, rawVs) +} + +func (_CommitStoreHelper *CommitStoreHelperTransactor) Unpause(opts *bind.TransactOpts) (*types.Transaction, error) { + return _CommitStoreHelper.contract.Transact(opts, "unpause") +} + +func (_CommitStoreHelper *CommitStoreHelperSession) Unpause() (*types.Transaction, error) { + return _CommitStoreHelper.Contract.Unpause(&_CommitStoreHelper.TransactOpts) +} + +func (_CommitStoreHelper *CommitStoreHelperTransactorSession) Unpause() (*types.Transaction, error) { + return _CommitStoreHelper.Contract.Unpause(&_CommitStoreHelper.TransactOpts) +} + +type CommitStoreHelperConfigSetIterator struct { + Event *CommitStoreHelperConfigSet + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *CommitStoreHelperConfigSetIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(CommitStoreHelperConfigSet) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(CommitStoreHelperConfigSet) + 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() + } +} + +func (it *CommitStoreHelperConfigSetIterator) Error() error { + return it.fail +} + +func (it *CommitStoreHelperConfigSetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type CommitStoreHelperConfigSet struct { + StaticConfig CommitStoreStaticConfig + DynamicConfig CommitStoreDynamicConfig + Raw types.Log +} + +func (_CommitStoreHelper *CommitStoreHelperFilterer) FilterConfigSet(opts *bind.FilterOpts) (*CommitStoreHelperConfigSetIterator, error) { + + logs, sub, err := _CommitStoreHelper.contract.FilterLogs(opts, "ConfigSet") + if err != nil { + return nil, err + } + return &CommitStoreHelperConfigSetIterator{contract: _CommitStoreHelper.contract, event: "ConfigSet", logs: logs, sub: sub}, nil +} + +func (_CommitStoreHelper *CommitStoreHelperFilterer) WatchConfigSet(opts *bind.WatchOpts, sink chan<- *CommitStoreHelperConfigSet) (event.Subscription, error) { + + logs, sub, err := _CommitStoreHelper.contract.WatchLogs(opts, "ConfigSet") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(CommitStoreHelperConfigSet) + if err := _CommitStoreHelper.contract.UnpackLog(event, "ConfigSet", 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 +} + +func (_CommitStoreHelper *CommitStoreHelperFilterer) ParseConfigSet(log types.Log) (*CommitStoreHelperConfigSet, error) { + event := new(CommitStoreHelperConfigSet) + if err := _CommitStoreHelper.contract.UnpackLog(event, "ConfigSet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type CommitStoreHelperConfigSet0Iterator struct { + Event *CommitStoreHelperConfigSet0 + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *CommitStoreHelperConfigSet0Iterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(CommitStoreHelperConfigSet0) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(CommitStoreHelperConfigSet0) + 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() + } +} + +func (it *CommitStoreHelperConfigSet0Iterator) Error() error { + return it.fail +} + +func (it *CommitStoreHelperConfigSet0Iterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type CommitStoreHelperConfigSet0 struct { + PreviousConfigBlockNumber uint32 + ConfigDigest [32]byte + ConfigCount uint64 + Signers []common.Address + Transmitters []common.Address + F uint8 + OnchainConfig []byte + OffchainConfigVersion uint64 + OffchainConfig []byte + Raw types.Log +} + +func (_CommitStoreHelper *CommitStoreHelperFilterer) FilterConfigSet0(opts *bind.FilterOpts) (*CommitStoreHelperConfigSet0Iterator, error) { + + logs, sub, err := _CommitStoreHelper.contract.FilterLogs(opts, "ConfigSet0") + if err != nil { + return nil, err + } + return &CommitStoreHelperConfigSet0Iterator{contract: _CommitStoreHelper.contract, event: "ConfigSet0", logs: logs, sub: sub}, nil +} + +func (_CommitStoreHelper *CommitStoreHelperFilterer) WatchConfigSet0(opts *bind.WatchOpts, sink chan<- *CommitStoreHelperConfigSet0) (event.Subscription, error) { + + logs, sub, err := _CommitStoreHelper.contract.WatchLogs(opts, "ConfigSet0") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(CommitStoreHelperConfigSet0) + if err := _CommitStoreHelper.contract.UnpackLog(event, "ConfigSet0", 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 +} + +func (_CommitStoreHelper *CommitStoreHelperFilterer) ParseConfigSet0(log types.Log) (*CommitStoreHelperConfigSet0, error) { + event := new(CommitStoreHelperConfigSet0) + if err := _CommitStoreHelper.contract.UnpackLog(event, "ConfigSet0", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type CommitStoreHelperOwnershipTransferRequestedIterator struct { + Event *CommitStoreHelperOwnershipTransferRequested + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *CommitStoreHelperOwnershipTransferRequestedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(CommitStoreHelperOwnershipTransferRequested) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(CommitStoreHelperOwnershipTransferRequested) + 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() + } +} + +func (it *CommitStoreHelperOwnershipTransferRequestedIterator) Error() error { + return it.fail +} + +func (it *CommitStoreHelperOwnershipTransferRequestedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type CommitStoreHelperOwnershipTransferRequested struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_CommitStoreHelper *CommitStoreHelperFilterer) FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*CommitStoreHelperOwnershipTransferRequestedIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _CommitStoreHelper.contract.FilterLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return &CommitStoreHelperOwnershipTransferRequestedIterator{contract: _CommitStoreHelper.contract, event: "OwnershipTransferRequested", logs: logs, sub: sub}, nil +} + +func (_CommitStoreHelper *CommitStoreHelperFilterer) WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *CommitStoreHelperOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _CommitStoreHelper.contract.WatchLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(CommitStoreHelperOwnershipTransferRequested) + if err := _CommitStoreHelper.contract.UnpackLog(event, "OwnershipTransferRequested", 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 +} + +func (_CommitStoreHelper *CommitStoreHelperFilterer) ParseOwnershipTransferRequested(log types.Log) (*CommitStoreHelperOwnershipTransferRequested, error) { + event := new(CommitStoreHelperOwnershipTransferRequested) + if err := _CommitStoreHelper.contract.UnpackLog(event, "OwnershipTransferRequested", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type CommitStoreHelperOwnershipTransferredIterator struct { + Event *CommitStoreHelperOwnershipTransferred + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *CommitStoreHelperOwnershipTransferredIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(CommitStoreHelperOwnershipTransferred) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(CommitStoreHelperOwnershipTransferred) + 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() + } +} + +func (it *CommitStoreHelperOwnershipTransferredIterator) Error() error { + return it.fail +} + +func (it *CommitStoreHelperOwnershipTransferredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type CommitStoreHelperOwnershipTransferred struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_CommitStoreHelper *CommitStoreHelperFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*CommitStoreHelperOwnershipTransferredIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _CommitStoreHelper.contract.FilterLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return &CommitStoreHelperOwnershipTransferredIterator{contract: _CommitStoreHelper.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil +} + +func (_CommitStoreHelper *CommitStoreHelperFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *CommitStoreHelperOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _CommitStoreHelper.contract.WatchLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(CommitStoreHelperOwnershipTransferred) + if err := _CommitStoreHelper.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 +} + +func (_CommitStoreHelper *CommitStoreHelperFilterer) ParseOwnershipTransferred(log types.Log) (*CommitStoreHelperOwnershipTransferred, error) { + event := new(CommitStoreHelperOwnershipTransferred) + if err := _CommitStoreHelper.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type CommitStoreHelperPausedIterator struct { + Event *CommitStoreHelperPaused + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *CommitStoreHelperPausedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(CommitStoreHelperPaused) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(CommitStoreHelperPaused) + 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() + } +} + +func (it *CommitStoreHelperPausedIterator) Error() error { + return it.fail +} + +func (it *CommitStoreHelperPausedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type CommitStoreHelperPaused struct { + Account common.Address + Raw types.Log +} + +func (_CommitStoreHelper *CommitStoreHelperFilterer) FilterPaused(opts *bind.FilterOpts) (*CommitStoreHelperPausedIterator, error) { + + logs, sub, err := _CommitStoreHelper.contract.FilterLogs(opts, "Paused") + if err != nil { + return nil, err + } + return &CommitStoreHelperPausedIterator{contract: _CommitStoreHelper.contract, event: "Paused", logs: logs, sub: sub}, nil +} + +func (_CommitStoreHelper *CommitStoreHelperFilterer) WatchPaused(opts *bind.WatchOpts, sink chan<- *CommitStoreHelperPaused) (event.Subscription, error) { + + logs, sub, err := _CommitStoreHelper.contract.WatchLogs(opts, "Paused") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(CommitStoreHelperPaused) + if err := _CommitStoreHelper.contract.UnpackLog(event, "Paused", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +func (_CommitStoreHelper *CommitStoreHelperFilterer) ParsePaused(log types.Log) (*CommitStoreHelperPaused, error) { + event := new(CommitStoreHelperPaused) + if err := _CommitStoreHelper.contract.UnpackLog(event, "Paused", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type CommitStoreHelperReportAcceptedIterator struct { + Event *CommitStoreHelperReportAccepted + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *CommitStoreHelperReportAcceptedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(CommitStoreHelperReportAccepted) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(CommitStoreHelperReportAccepted) + 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() + } +} + +func (it *CommitStoreHelperReportAcceptedIterator) Error() error { + return it.fail +} + +func (it *CommitStoreHelperReportAcceptedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type CommitStoreHelperReportAccepted struct { + Report CommitStoreCommitReport + Raw types.Log +} + +func (_CommitStoreHelper *CommitStoreHelperFilterer) FilterReportAccepted(opts *bind.FilterOpts) (*CommitStoreHelperReportAcceptedIterator, error) { + + logs, sub, err := _CommitStoreHelper.contract.FilterLogs(opts, "ReportAccepted") + if err != nil { + return nil, err + } + return &CommitStoreHelperReportAcceptedIterator{contract: _CommitStoreHelper.contract, event: "ReportAccepted", logs: logs, sub: sub}, nil +} + +func (_CommitStoreHelper *CommitStoreHelperFilterer) WatchReportAccepted(opts *bind.WatchOpts, sink chan<- *CommitStoreHelperReportAccepted) (event.Subscription, error) { + + logs, sub, err := _CommitStoreHelper.contract.WatchLogs(opts, "ReportAccepted") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(CommitStoreHelperReportAccepted) + if err := _CommitStoreHelper.contract.UnpackLog(event, "ReportAccepted", 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 +} + +func (_CommitStoreHelper *CommitStoreHelperFilterer) ParseReportAccepted(log types.Log) (*CommitStoreHelperReportAccepted, error) { + event := new(CommitStoreHelperReportAccepted) + if err := _CommitStoreHelper.contract.UnpackLog(event, "ReportAccepted", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type CommitStoreHelperRootRemovedIterator struct { + Event *CommitStoreHelperRootRemoved + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *CommitStoreHelperRootRemovedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(CommitStoreHelperRootRemoved) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(CommitStoreHelperRootRemoved) + 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() + } +} + +func (it *CommitStoreHelperRootRemovedIterator) Error() error { + return it.fail +} + +func (it *CommitStoreHelperRootRemovedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type CommitStoreHelperRootRemoved struct { + Root [32]byte + Raw types.Log +} + +func (_CommitStoreHelper *CommitStoreHelperFilterer) FilterRootRemoved(opts *bind.FilterOpts) (*CommitStoreHelperRootRemovedIterator, error) { + + logs, sub, err := _CommitStoreHelper.contract.FilterLogs(opts, "RootRemoved") + if err != nil { + return nil, err + } + return &CommitStoreHelperRootRemovedIterator{contract: _CommitStoreHelper.contract, event: "RootRemoved", logs: logs, sub: sub}, nil +} + +func (_CommitStoreHelper *CommitStoreHelperFilterer) WatchRootRemoved(opts *bind.WatchOpts, sink chan<- *CommitStoreHelperRootRemoved) (event.Subscription, error) { + + logs, sub, err := _CommitStoreHelper.contract.WatchLogs(opts, "RootRemoved") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(CommitStoreHelperRootRemoved) + if err := _CommitStoreHelper.contract.UnpackLog(event, "RootRemoved", 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 +} + +func (_CommitStoreHelper *CommitStoreHelperFilterer) ParseRootRemoved(log types.Log) (*CommitStoreHelperRootRemoved, error) { + event := new(CommitStoreHelperRootRemoved) + if err := _CommitStoreHelper.contract.UnpackLog(event, "RootRemoved", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type CommitStoreHelperTransmittedIterator struct { + Event *CommitStoreHelperTransmitted + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *CommitStoreHelperTransmittedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(CommitStoreHelperTransmitted) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(CommitStoreHelperTransmitted) + 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() + } +} + +func (it *CommitStoreHelperTransmittedIterator) Error() error { + return it.fail +} + +func (it *CommitStoreHelperTransmittedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type CommitStoreHelperTransmitted struct { + ConfigDigest [32]byte + Epoch uint32 + Raw types.Log +} + +func (_CommitStoreHelper *CommitStoreHelperFilterer) FilterTransmitted(opts *bind.FilterOpts) (*CommitStoreHelperTransmittedIterator, error) { + + logs, sub, err := _CommitStoreHelper.contract.FilterLogs(opts, "Transmitted") + if err != nil { + return nil, err + } + return &CommitStoreHelperTransmittedIterator{contract: _CommitStoreHelper.contract, event: "Transmitted", logs: logs, sub: sub}, nil +} + +func (_CommitStoreHelper *CommitStoreHelperFilterer) WatchTransmitted(opts *bind.WatchOpts, sink chan<- *CommitStoreHelperTransmitted) (event.Subscription, error) { + + logs, sub, err := _CommitStoreHelper.contract.WatchLogs(opts, "Transmitted") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(CommitStoreHelperTransmitted) + if err := _CommitStoreHelper.contract.UnpackLog(event, "Transmitted", 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 +} + +func (_CommitStoreHelper *CommitStoreHelperFilterer) ParseTransmitted(log types.Log) (*CommitStoreHelperTransmitted, error) { + event := new(CommitStoreHelperTransmitted) + if err := _CommitStoreHelper.contract.UnpackLog(event, "Transmitted", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type CommitStoreHelperUnpausedIterator struct { + Event *CommitStoreHelperUnpaused + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *CommitStoreHelperUnpausedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(CommitStoreHelperUnpaused) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(CommitStoreHelperUnpaused) + 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() + } +} + +func (it *CommitStoreHelperUnpausedIterator) Error() error { + return it.fail +} + +func (it *CommitStoreHelperUnpausedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type CommitStoreHelperUnpaused struct { + Account common.Address + Raw types.Log +} + +func (_CommitStoreHelper *CommitStoreHelperFilterer) FilterUnpaused(opts *bind.FilterOpts) (*CommitStoreHelperUnpausedIterator, error) { + + logs, sub, err := _CommitStoreHelper.contract.FilterLogs(opts, "Unpaused") + if err != nil { + return nil, err + } + return &CommitStoreHelperUnpausedIterator{contract: _CommitStoreHelper.contract, event: "Unpaused", logs: logs, sub: sub}, nil +} + +func (_CommitStoreHelper *CommitStoreHelperFilterer) WatchUnpaused(opts *bind.WatchOpts, sink chan<- *CommitStoreHelperUnpaused) (event.Subscription, error) { + + logs, sub, err := _CommitStoreHelper.contract.WatchLogs(opts, "Unpaused") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(CommitStoreHelperUnpaused) + if err := _CommitStoreHelper.contract.UnpackLog(event, "Unpaused", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +func (_CommitStoreHelper *CommitStoreHelperFilterer) ParseUnpaused(log types.Log) (*CommitStoreHelperUnpaused, error) { + event := new(CommitStoreHelperUnpaused) + if err := _CommitStoreHelper.contract.UnpackLog(event, "Unpaused", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type LatestConfigDetails struct { + ConfigCount uint32 + BlockNumber uint32 + ConfigDigest [32]byte +} +type LatestConfigDigestAndEpoch struct { + ScanLogs bool + ConfigDigest [32]byte + Epoch uint32 +} + +func (_CommitStoreHelper *CommitStoreHelper) ParseLog(log types.Log) (generated.AbigenLog, error) { + switch log.Topics[0] { + case _CommitStoreHelper.abi.Events["ConfigSet"].ID: + return _CommitStoreHelper.ParseConfigSet(log) + case _CommitStoreHelper.abi.Events["ConfigSet0"].ID: + return _CommitStoreHelper.ParseConfigSet0(log) + case _CommitStoreHelper.abi.Events["OwnershipTransferRequested"].ID: + return _CommitStoreHelper.ParseOwnershipTransferRequested(log) + case _CommitStoreHelper.abi.Events["OwnershipTransferred"].ID: + return _CommitStoreHelper.ParseOwnershipTransferred(log) + case _CommitStoreHelper.abi.Events["Paused"].ID: + return _CommitStoreHelper.ParsePaused(log) + case _CommitStoreHelper.abi.Events["ReportAccepted"].ID: + return _CommitStoreHelper.ParseReportAccepted(log) + case _CommitStoreHelper.abi.Events["RootRemoved"].ID: + return _CommitStoreHelper.ParseRootRemoved(log) + case _CommitStoreHelper.abi.Events["Transmitted"].ID: + return _CommitStoreHelper.ParseTransmitted(log) + case _CommitStoreHelper.abi.Events["Unpaused"].ID: + return _CommitStoreHelper.ParseUnpaused(log) + + default: + return nil, fmt.Errorf("abigen wrapper received unknown log topic: %v", log.Topics[0]) + } +} + +func (CommitStoreHelperConfigSet) Topic() common.Hash { + return common.HexToHash("0xc9d7123efd4203e60b0f0a4b1dbc4800fc97ce63679f71c3a27279b24a7ddec3") +} + +func (CommitStoreHelperConfigSet0) Topic() common.Hash { + return common.HexToHash("0x1591690b8638f5fb2dbec82ac741805ac5da8b45dc5263f4875b0496fdce4e05") +} + +func (CommitStoreHelperOwnershipTransferRequested) Topic() common.Hash { + return common.HexToHash("0xed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae1278") +} + +func (CommitStoreHelperOwnershipTransferred) Topic() common.Hash { + return common.HexToHash("0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0") +} + +func (CommitStoreHelperPaused) Topic() common.Hash { + return common.HexToHash("0x62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258") +} + +func (CommitStoreHelperReportAccepted) Topic() common.Hash { + return common.HexToHash("0xe81b49e583122eb290c46fc255c962b9a2dec468816c00fb7a2e6ebc42dc92d4") +} + +func (CommitStoreHelperRootRemoved) Topic() common.Hash { + return common.HexToHash("0x202f1139a3e334b6056064c0e9b19fd07e44a88d8f6e5ded571b24cf8c371f12") +} + +func (CommitStoreHelperTransmitted) Topic() common.Hash { + return common.HexToHash("0xb04e63db38c49950639fa09d29872f21f5d49d614f3a969d8adf3d4b52e41a62") +} + +func (CommitStoreHelperUnpaused) Topic() common.Hash { + return common.HexToHash("0x5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa") +} + +func (_CommitStoreHelper *CommitStoreHelper) Address() common.Address { + return _CommitStoreHelper.address +} + +type CommitStoreHelperInterface interface { + GetDynamicConfig(opts *bind.CallOpts) (CommitStoreDynamicConfig, error) + + GetExpectedNextSequenceNumber(opts *bind.CallOpts) (uint64, error) + + GetLatestPriceEpochAndRound(opts *bind.CallOpts) (uint64, error) + + GetMerkleRoot(opts *bind.CallOpts, root [32]byte) (*big.Int, error) + + GetStaticConfig(opts *bind.CallOpts) (CommitStoreStaticConfig, error) + + GetTransmitters(opts *bind.CallOpts) ([]common.Address, error) + + IsARMHealthy(opts *bind.CallOpts) (bool, error) + + IsBlessed(opts *bind.CallOpts, root [32]byte) (bool, error) + + IsUnpausedAndARMHealthy(opts *bind.CallOpts) (bool, error) + + LatestConfigDetails(opts *bind.CallOpts) (LatestConfigDetails, + + error) + + LatestConfigDigestAndEpoch(opts *bind.CallOpts) (LatestConfigDigestAndEpoch, + + error) + + Owner(opts *bind.CallOpts) (common.Address, error) + + Paused(opts *bind.CallOpts) (bool, error) + + TypeAndVersion(opts *bind.CallOpts) (string, error) + + Verify(opts *bind.CallOpts, hashedLeaves [][32]byte, proofs [][32]byte, proofFlagBits *big.Int) (*big.Int, error) + + AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) + + Pause(opts *bind.TransactOpts) (*types.Transaction, error) + + Report(opts *bind.TransactOpts, commitReport []byte, epochAndRound *big.Int) (*types.Transaction, error) + + ResetUnblessedRoots(opts *bind.TransactOpts, rootToReset [][32]byte) (*types.Transaction, error) + + SetLatestPriceEpochAndRound(opts *bind.TransactOpts, latestPriceEpochAndRound *big.Int) (*types.Transaction, error) + + SetMinSeqNr(opts *bind.TransactOpts, minSeqNr uint64) (*types.Transaction, error) + + SetOCR2Config(opts *bind.TransactOpts, signers []common.Address, transmitters []common.Address, f uint8, onchainConfig []byte, offchainConfigVersion uint64, offchainConfig []byte) (*types.Transaction, error) + + TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) + + Transmit(opts *bind.TransactOpts, reportContext [3][32]byte, report []byte, rs [][32]byte, ss [][32]byte, rawVs [32]byte) (*types.Transaction, error) + + Unpause(opts *bind.TransactOpts) (*types.Transaction, error) + + FilterConfigSet(opts *bind.FilterOpts) (*CommitStoreHelperConfigSetIterator, error) + + WatchConfigSet(opts *bind.WatchOpts, sink chan<- *CommitStoreHelperConfigSet) (event.Subscription, error) + + ParseConfigSet(log types.Log) (*CommitStoreHelperConfigSet, error) + + FilterConfigSet0(opts *bind.FilterOpts) (*CommitStoreHelperConfigSet0Iterator, error) + + WatchConfigSet0(opts *bind.WatchOpts, sink chan<- *CommitStoreHelperConfigSet0) (event.Subscription, error) + + ParseConfigSet0(log types.Log) (*CommitStoreHelperConfigSet0, error) + + FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*CommitStoreHelperOwnershipTransferRequestedIterator, error) + + WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *CommitStoreHelperOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferRequested(log types.Log) (*CommitStoreHelperOwnershipTransferRequested, error) + + FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*CommitStoreHelperOwnershipTransferredIterator, error) + + WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *CommitStoreHelperOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferred(log types.Log) (*CommitStoreHelperOwnershipTransferred, error) + + FilterPaused(opts *bind.FilterOpts) (*CommitStoreHelperPausedIterator, error) + + WatchPaused(opts *bind.WatchOpts, sink chan<- *CommitStoreHelperPaused) (event.Subscription, error) + + ParsePaused(log types.Log) (*CommitStoreHelperPaused, error) + + FilterReportAccepted(opts *bind.FilterOpts) (*CommitStoreHelperReportAcceptedIterator, error) + + WatchReportAccepted(opts *bind.WatchOpts, sink chan<- *CommitStoreHelperReportAccepted) (event.Subscription, error) + + ParseReportAccepted(log types.Log) (*CommitStoreHelperReportAccepted, error) + + FilterRootRemoved(opts *bind.FilterOpts) (*CommitStoreHelperRootRemovedIterator, error) + + WatchRootRemoved(opts *bind.WatchOpts, sink chan<- *CommitStoreHelperRootRemoved) (event.Subscription, error) + + ParseRootRemoved(log types.Log) (*CommitStoreHelperRootRemoved, error) + + FilterTransmitted(opts *bind.FilterOpts) (*CommitStoreHelperTransmittedIterator, error) + + WatchTransmitted(opts *bind.WatchOpts, sink chan<- *CommitStoreHelperTransmitted) (event.Subscription, error) + + ParseTransmitted(log types.Log) (*CommitStoreHelperTransmitted, error) + + FilterUnpaused(opts *bind.FilterOpts) (*CommitStoreHelperUnpausedIterator, error) + + WatchUnpaused(opts *bind.WatchOpts, sink chan<- *CommitStoreHelperUnpaused) (event.Subscription, error) + + ParseUnpaused(log types.Log) (*CommitStoreHelperUnpaused, error) + + ParseLog(log types.Log) (generated.AbigenLog, error) + + Address() common.Address +} diff --git a/core/gethwrappers/ccip/generated/commit_store_helper_1_2_0/commit_store_helper_1_2_0.go b/core/gethwrappers/ccip/generated/commit_store_helper_1_2_0/commit_store_helper_1_2_0.go new file mode 100644 index 00000000000..be974665981 --- /dev/null +++ b/core/gethwrappers/ccip/generated/commit_store_helper_1_2_0/commit_store_helper_1_2_0.go @@ -0,0 +1,1969 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package commit_store_helper_1_2_0 + +import ( + "errors" + "fmt" + "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" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" +) + +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +type CommitStoreCommitReport struct { + PriceUpdates InternalPriceUpdates + Interval CommitStoreInterval + MerkleRoot [32]byte +} + +type CommitStoreDynamicConfig struct { + PriceRegistry common.Address +} + +type CommitStoreInterval struct { + Min uint64 + Max uint64 +} + +type CommitStoreStaticConfig struct { + ChainSelector uint64 + SourceChainSelector uint64 + OnRamp common.Address + ArmProxy common.Address +} + +type InternalGasPriceUpdate struct { + DestChainSelector uint64 + UsdPerUnitGas *big.Int +} + +type InternalPriceUpdates struct { + TokenPriceUpdates []InternalTokenPriceUpdate + GasPriceUpdates []InternalGasPriceUpdate +} + +type InternalTokenPriceUpdate struct { + SourceToken common.Address + UsdPerToken *big.Int +} + +var CommitStoreHelperMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"onRamp\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"armProxy\",\"type\":\"address\"}],\"internalType\":\"structCommitStore.StaticConfig\",\"name\":\"staticConfig\",\"type\":\"tuple\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"BadARMSignal\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"expected\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"actual\",\"type\":\"bytes32\"}],\"name\":\"ConfigDigestMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expected\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"actual\",\"type\":\"uint256\"}],\"name\":\"ForkedChain\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidCommitStoreConfig\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"message\",\"type\":\"string\"}],\"name\":\"InvalidConfig\",\"type\":\"error\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"min\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"max\",\"type\":\"uint64\"}],\"internalType\":\"structCommitStore.Interval\",\"name\":\"interval\",\"type\":\"tuple\"}],\"name\":\"InvalidInterval\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidProof\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidRoot\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"LeavesCannotBeEmpty\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NonUniqueSignatures\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OracleCannotBeZeroAddress\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"PausedError\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RootAlreadyCommitted\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"SignaturesOutOfRegistration\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"StaleReport\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UnauthorizedSigner\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UnauthorizedTransmitter\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expected\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"actual\",\"type\":\"uint256\"}],\"name\":\"WrongMessageLength\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"WrongNumberOfSignatures\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"onRamp\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"armProxy\",\"type\":\"address\"}],\"indexed\":false,\"internalType\":\"structCommitStore.StaticConfig\",\"name\":\"staticConfig\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"priceRegistry\",\"type\":\"address\"}],\"indexed\":false,\"internalType\":\"structCommitStore.DynamicConfig\",\"name\":\"dynamicConfig\",\"type\":\"tuple\"}],\"name\":\"ConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"previousConfigBlockNumber\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"configCount\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"signers\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"transmitters\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"f\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"onchainConfig\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"offchainConfigVersion\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"offchainConfig\",\"type\":\"bytes\"}],\"name\":\"ConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"Paused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"components\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"sourceToken\",\"type\":\"address\"},{\"internalType\":\"uint224\",\"name\":\"usdPerToken\",\"type\":\"uint224\"}],\"internalType\":\"structInternal.TokenPriceUpdate[]\",\"name\":\"tokenPriceUpdates\",\"type\":\"tuple[]\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint224\",\"name\":\"usdPerUnitGas\",\"type\":\"uint224\"}],\"internalType\":\"structInternal.GasPriceUpdate[]\",\"name\":\"gasPriceUpdates\",\"type\":\"tuple[]\"}],\"internalType\":\"structInternal.PriceUpdates\",\"name\":\"priceUpdates\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"min\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"max\",\"type\":\"uint64\"}],\"internalType\":\"structCommitStore.Interval\",\"name\":\"interval\",\"type\":\"tuple\"},{\"internalType\":\"bytes32\",\"name\":\"merkleRoot\",\"type\":\"bytes32\"}],\"indexed\":false,\"internalType\":\"structCommitStore.CommitReport\",\"name\":\"report\",\"type\":\"tuple\"}],\"name\":\"ReportAccepted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"root\",\"type\":\"bytes32\"}],\"name\":\"RootRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"epoch\",\"type\":\"uint32\"}],\"name\":\"Transmitted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"Unpaused\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getDynamicConfig\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"priceRegistry\",\"type\":\"address\"}],\"internalType\":\"structCommitStore.DynamicConfig\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getExpectedNextSequenceNumber\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getLatestPriceEpochAndRound\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"root\",\"type\":\"bytes32\"}],\"name\":\"getMerkleRoot\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getStaticConfig\",\"outputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"onRamp\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"armProxy\",\"type\":\"address\"}],\"internalType\":\"structCommitStore.StaticConfig\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getTransmitters\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isARMHealthy\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"root\",\"type\":\"bytes32\"}],\"name\":\"isBlessed\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isUnpausedAndARMHealthy\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestConfigDetails\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"configCount\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"blockNumber\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestConfigDigestAndEpoch\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"scanLogs\",\"type\":\"bool\"},{\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"internalType\":\"uint32\",\"name\":\"epoch\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"paused\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"commitReport\",\"type\":\"bytes\"},{\"internalType\":\"uint40\",\"name\":\"epochAndRound\",\"type\":\"uint40\"}],\"name\":\"report\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32[]\",\"name\":\"rootToReset\",\"type\":\"bytes32[]\"}],\"name\":\"resetUnblessedRoots\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint40\",\"name\":\"latestPriceEpochAndRound\",\"type\":\"uint40\"}],\"name\":\"setLatestPriceEpochAndRound\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"minSeqNr\",\"type\":\"uint64\"}],\"name\":\"setMinSeqNr\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"signers\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"transmitters\",\"type\":\"address[]\"},{\"internalType\":\"uint8\",\"name\":\"f\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"onchainConfig\",\"type\":\"bytes\"},{\"internalType\":\"uint64\",\"name\":\"offchainConfigVersion\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"offchainConfig\",\"type\":\"bytes\"}],\"name\":\"setOCR2Config\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32[3]\",\"name\":\"reportContext\",\"type\":\"bytes32[3]\"},{\"internalType\":\"bytes\",\"name\":\"report\",\"type\":\"bytes\"},{\"internalType\":\"bytes32[]\",\"name\":\"rs\",\"type\":\"bytes32[]\"},{\"internalType\":\"bytes32[]\",\"name\":\"ss\",\"type\":\"bytes32[]\"},{\"internalType\":\"bytes32\",\"name\":\"rawVs\",\"type\":\"bytes32\"}],\"name\":\"transmit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"unpause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32[]\",\"name\":\"hashedLeaves\",\"type\":\"bytes32[]\"},{\"internalType\":\"bytes32[]\",\"name\":\"proofs\",\"type\":\"bytes32[]\"},{\"internalType\":\"uint256\",\"name\":\"proofFlagBits\",\"type\":\"uint256\"}],\"name\":\"verify\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", + Bin: "0x61014060405260098054600165ff000000000160401b03191660011790553480156200002a57600080fd5b50604051620038e8380380620038e88339810160408190526200004d9162000274565b80600033808281620000a65760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000d957620000d98162000194565b50505015156080524660a05260408101516001600160a01b0316158062000108575080516001600160401b0316155b806200011f575060208101516001600160401b0316155b8062000136575060608101516001600160a01b0316155b156200015557604051631fc5f15f60e11b815260040160405180910390fd5b80516001600160401b0390811660c05260208201511660e05260408101516001600160a01b039081166101005260609091015116610120525062000308565b336001600160a01b03821603620001ee5760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c6600000000000000000060448201526064016200009d565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b80516001600160401b03811681146200025757600080fd5b919050565b80516001600160a01b03811681146200025757600080fd5b6000608082840312156200028757600080fd5b604051608081016001600160401b0381118282101715620002b857634e487b7160e01b600052604160045260246000fd5b604052620002c6836200023f565b8152620002d6602084016200023f565b6020820152620002e9604084016200025c565b6040820152620002fc606084016200025c565b60608201529392505050565b60805160a05160c05160e0516101005161012051613551620003976000396000818161027801528181610555015281816111a1015281816119c801528181611a89015261202401526000818161023c0152611ffd01526000818161020c0152611fd60152600081816101dc0152611fa701526000818161131c0152611368015260006113e301526135516000f3fe608060405234801561001057600080fd5b50600436106101a35760003560e01c80637437ff9f116100ee578063a7206cd611610097578063b1dc65a411610071578063b1dc65a414610505578063f2fde38b14610518578063f47a86901461052b578063ff888fb11461053e57600080fd5b8063a7206cd6146104b2578063ad7a22f8146104d2578063afcb95d7146104e557600080fd5b80638456cb59116100c85780638456cb591461047a5780638da5cb5b146104825780638db94e44146104aa57600080fd5b80637437ff9f1461040357806379ba50971461044257806381ff70481461044a57600080fd5b806329b980e4116101505780634120fccd1161012a5780634120fccd146103c05780635c975abb146103d2578063666cab8d146103ee57600080fd5b806329b980e41461038457806332048875146103975780633f4ba83a146103b857600080fd5b8063181f5a7711610181578063181f5a77146103135780631dc18e561461035c5780631ef381741461037157600080fd5b806306285c69146101a85780630a6cd30d146102cb57806310c374ed146102e3575b600080fd5b6102b560408051608081018252600080825260208201819052918101829052606081019190915260405180608001604052807f000000000000000000000000000000000000000000000000000000000000000067ffffffffffffffff1681526020017f000000000000000000000000000000000000000000000000000000000000000067ffffffffffffffff1681526020017f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1681526020017f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16815250905090565b6040516102c2919061267f565b60405180910390f35b6102d3610551565b60405190151581526020016102c2565b60095468010000000000000000900464ffffffffff165b60405167ffffffffffffffff90911681526020016102c2565b61034f6040518060400160405280601181526020017f436f6d6d697453746f726520312e322e3000000000000000000000000000000081525081565b6040516102c2919061273c565b61036f61036a3660046127b2565b6105e8565b005b61036f61037f366004612a41565b6105f8565b61036f610392366004612b0e565b610e19565b6103aa6103a5366004612b6e565b610e65565b6040519081526020016102c2565b61036f610f5b565b60095467ffffffffffffffff166102fa565b6009546d0100000000000000000000000000900460ff166102d3565b6103f6610fc1565b6040516102c29190612c33565b604080516020808201835260009091528151808201835260085473ffffffffffffffffffffffffffffffffffffffff16908190529151918252016102c2565b61036f611030565b6004546002546040805163ffffffff808516825264010000000090940490931660208401528201526060016102c2565b61036f61112d565b60005460405173ffffffffffffffffffffffffffffffffffffffff90911681526020016102c2565b6102d361119d565b6103aa6104c0366004612c46565b6000908152600a602052604090205490565b61036f6104e0366004612c5f565b611254565b6040805160018152600060208201819052918101919091526060016102c2565b61036f610513366004612c7a565b611297565b61036f610526366004612d31565b6118b7565b61036f610539366004612d4e565b6118cb565b6102d361054c366004612c46565b611965565b60007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663397796f76040518163ffffffff1660e01b8152600401602060405180830381865afa1580156105be573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105e29190612d90565b15905090565b6105f3838383611a39565b505050565b855185518560ff16601f831115610670576040517f89a6198900000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f746f6f206d616e79207369676e6572730000000000000000000000000000000060448201526064015b60405180910390fd5b806000036106da576040517f89a6198900000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f66206d75737420626520706f73697469766500000000000000000000000000006044820152606401610667565b818314610768576040517f89a61989000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f6f7261636c6520616464726573736573206f7574206f6620726567697374726160448201527f74696f6e000000000000000000000000000000000000000000000000000000006064820152608401610667565b610773816003612de1565b83116107db576040517f89a6198900000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f6661756c74792d6f7261636c65206620746f6f206869676800000000000000006044820152606401610667565b6107e3611e46565b6107ec86611ec9565b60065460005b818110156108e857600560006006838154811061081157610811612df8565b600091825260208083209091015473ffffffffffffffffffffffffffffffffffffffff168352820192909252604001812080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00001690556007805460059291908490811061088157610881612df8565b600091825260208083209091015473ffffffffffffffffffffffffffffffffffffffff168352820192909252604001902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00001690556108e181612e27565b90506107f2565b50895160005b81811015610cc15760008c828151811061090a5761090a612df8565b602002602001015190506000600281111561092757610927612e5f565b73ffffffffffffffffffffffffffffffffffffffff8216600090815260056020526040902054610100900460ff16600281111561096657610966612e5f565b146109cd576040517f89a6198900000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f7265706561746564207369676e657220616464726573730000000000000000006044820152606401610667565b73ffffffffffffffffffffffffffffffffffffffff8116610a1a576040517fd6c62c9b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040805180820190915260ff83168152602081016001905273ffffffffffffffffffffffffffffffffffffffff821660009081526005602090815260409091208251815460ff9091167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0082168117835592840151919283917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00001617610100836002811115610aca57610aca612e5f565b021790555090505060008c8381518110610ae657610ae6612df8565b6020026020010151905060006002811115610b0357610b03612e5f565b73ffffffffffffffffffffffffffffffffffffffff8216600090815260056020526040902054610100900460ff166002811115610b4257610b42612e5f565b14610ba9576040517f89a6198900000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f7265706561746564207472616e736d69747465722061646472657373000000006044820152606401610667565b73ffffffffffffffffffffffffffffffffffffffff8116610bf6576040517fd6c62c9b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040805180820190915260ff84168152602081016002905273ffffffffffffffffffffffffffffffffffffffff821660009081526005602090815260409091208251815460ff9091167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0082168117835592840151919283917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00001617610100836002811115610ca657610ca6612e5f565b0217905550905050505080610cba90612e27565b90506108ee565b508a51610cd59060069060208e01906125c1565b508951610ce99060079060208d01906125c1565b506003805460ff838116610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000909216908c161717905560048054610d6f914691309190600090610d419063ffffffff16612e8e565b91906101000a81548163ffffffff021916908363ffffffff160217905563ffffffff168e8e8e8e8e8e612085565b600260000181905550600060048054906101000a900463ffffffff169050436004806101000a81548163ffffffff021916908363ffffffff1602179055507f1591690b8638f5fb2dbec82ac741805ac5da8b45dc5263f4875b0496fdce4e0581600260000154600460009054906101000a900463ffffffff168f8f8f8f8f8f604051610e0399989796959493929190612eb1565b60405180910390a1505050505050505050505050565b610e21611e46565b6009805464ffffffffff90921668010000000000000000027fffffffffffffffffffffffffffffffffffffff0000000000ffffffffffffffff909216919091179055565b6009546000906d0100000000000000000000000000900460ff1615610eb6576040517feced32bc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000610f2787878080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808b0282810182019093528a82529093508a925089918291850190849080828437600092019190915250889250612130915050565b9050610f3281611965565b610f40576000915050610f52565b6000908152600a602052604090205490505b95945050505050565b610f63611e46565b600980547fffffffffffffffffffffffffffffffffffff00ffffffffffffffffffffffffff1690556040513381527f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa906020015b60405180910390a1565b6060600780548060200260200160405190810160405280929190818152602001828054801561102657602002820191906000526020600020905b815473ffffffffffffffffffffffffffffffffffffffff168152600190910190602001808311610ffb575b5050505050905090565b60015473ffffffffffffffffffffffffffffffffffffffff1633146110b1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e6572000000000000000000006044820152606401610667565b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b611135611e46565b600980547fffffffffffffffffffffffffffffffffffff00ffffffffffffffffffffffffff166d01000000000000000000000000001790556040513381527f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25890602001610fb7565b60007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663397796f76040518163ffffffff1660e01b8152600401602060405180830381865afa15801561120a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061122e9190612d90565b15801561124f57506009546d0100000000000000000000000000900460ff16155b905090565b61125c611e46565b600980547fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000001667ffffffffffffffff92909216919091179055565b6112a6878760208b0135611a39565b6040805160608101825260025480825260035460ff8082166020850152610100909104169282019290925289359182146113195780516040517f93df584c000000000000000000000000000000000000000000000000000000008152600481019190915260248101839052604401610667565b467f00000000000000000000000000000000000000000000000000000000000000001461139a576040517f0f01ce850000000000000000000000000000000000000000000000000000000081527f00000000000000000000000000000000000000000000000000000000000000006004820152466024820152604401610667565b6040805183815260208c81013560081c63ffffffff16908201527fb04e63db38c49950639fa09d29872f21f5d49d614f3a969d8adf3d4b52e41a62910160405180910390a160007f00000000000000000000000000000000000000000000000000000000000000001561143c5760028260200151836040015161141d9190612f47565b6114279190612f60565b611432906001612f47565b60ff169050611452565b602082015161144c906001612f47565b60ff1690505b86811461148b576040517f71253a2500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8685146114c4576040517fa75d88af00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b3360009081526005602090815260408083208151808301909252805460ff8082168452929391929184019161010090910416600281111561150757611507612e5f565b600281111561151857611518612e5f565b905250905060028160200151600281111561153557611535612e5f565b14801561157c57506007816000015160ff168154811061155757611557612df8565b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff1633145b6115b2576040517fda0f08e800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5060006115c0866020612de1565b6115cb896020612de1565b6115d78c610144612fa9565b6115e19190612fa9565b6115eb9190612fa9565b905036811461162f576040517f8e1192e100000000000000000000000000000000000000000000000000000000815260048101829052366024820152604401610667565b5060008a8a604051611642929190612fbc565b604051908190038120611659918e90602001612fcc565b60405160208183030381529060405280519060200120905061167961264b565b8860005b818110156118a65760006001858a846020811061169c5761169c612df8565b6116a991901a601b612f47565b8f8f868181106116bb576116bb612df8565b905060200201358e8e878181106116d4576116d4612df8565b9050602002013560405160008152602001604052604051611711949392919093845260ff9290921660208401526040830152606082015260800190565b6020604051602081039080840390855afa158015611733573d6000803e3d6000fd5b5050604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081015173ffffffffffffffffffffffffffffffffffffffff8116600090815260056020908152848220848601909552845460ff80821686529397509195509293928401916101009091041660028111156117b6576117b6612e5f565b60028111156117c7576117c7612e5f565b90525090506001816020015160028111156117e4576117e4612e5f565b1461181b576040517fca31867a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8051859060ff16601f811061183257611832612df8565b60200201511561186e576040517ff67bc7c400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600185826000015160ff16601f811061188957611889612df8565b911515602090920201525061189f905081612e27565b905061167d565b505050505050505050505050505050565b6118bf611e46565b6118c881612451565b50565b6118d3611e46565b60005b818110156105f35760008383838181106118f2576118f2612df8565b90506020020135905061190481611965565b611954576000818152600a602052604080822091909155517f202f1139a3e334b6056064c0e9b19fd07e44a88d8f6e5ded571b24cf8c371f129061194b9083815260200190565b60405180910390a15b5061195e81612e27565b90506118d6565b6040805180820182523081526020810183815291517f4d616771000000000000000000000000000000000000000000000000000000008152905173ffffffffffffffffffffffffffffffffffffffff9081166004830152915160248201526000917f00000000000000000000000000000000000000000000000000000000000000001690634d61677190604401602060405180830381865afa158015611a0f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a339190612d90565b92915050565b6009546d0100000000000000000000000000900460ff1615611a87576040517feced32bc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663397796f76040518163ffffffff1660e01b8152600401602060405180830381865afa158015611af2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b169190612d90565b15611b4d576040517fc148371500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000611b5b838501856130d7565b80515151909150151580611b7457508051602001515115155b15611cac5760095464ffffffffff80841668010000000000000000909204161015611c7157600980547fffffffffffffffffffffffffffffffffffffff0000000000ffffffffffffffff166801000000000000000064ffffffffff85160217905560085481516040517f3937306f00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff90921691633937306f91611c2b9160040161332a565b600060405180830381600087803b158015611c4557600080fd5b505af1158015611c59573d6000803e3d6000fd5b505050506040810151611c6c5750505050565b611cac565b6040810151611cac576040517ff803a2ca00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60208101515160095467ffffffffffffffff9081169116141580611ce7575060208082015190810151905167ffffffffffffffff9182169116115b15611d245780602001516040517fbb1ae18d000000000000000000000000000000000000000000000000000000008152600401610667919061333d565b6040810151611d5f576040517f504570e300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040808201516000908152600a602052205415611da8576040517fa0bce24f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6020808201510151611dbb906001613362565b600980547fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000001667ffffffffffffffff929092169190911790556040818101516000908152600a602052819020429055517f291698c01aa71f912280535d88a00d2c59fb63530a3f5d0098560468acb9ebf590611e3890839061338a565b60405180910390a150505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314611ec7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e6572000000000000000000006044820152606401610667565b565b600081806020019051810190611edf91906133e6565b805190915073ffffffffffffffffffffffffffffffffffffffff16611f30576040517f3f8be2be00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8051600880547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff928316179055600980547fffffffffffffffffffffffffffffffffffffff0000000000ffffffffffffffff169055604080516080810182527f000000000000000000000000000000000000000000000000000000000000000067ffffffffffffffff90811682527f00000000000000000000000000000000000000000000000000000000000000001660208201527f00000000000000000000000000000000000000000000000000000000000000008316818301527f00000000000000000000000000000000000000000000000000000000000000009092166060830152517fc9d7123efd4203e60b0f0a4b1dbc4800fc97ce63679f71c3a27279b24a7ddec391612079918490613432565b60405180910390a15050565b6000808a8a8a8a8a8a8a8a8a6040516020016120a9999897969594939291906134af565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815291905280516020909101207dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167e01000000000000000000000000000000000000000000000000000000000000179150509998505050505050505050565b8251825160009190818303612171576040517f11a6b26400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610101821180159061218557506101018111155b6121bb576040517f09bde33900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8282010161010081111561221c576040517f09bde33900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80600003612249578660008151811061223757612237612df8565b6020026020010151935050505061244a565b60008167ffffffffffffffff81111561226457612264612806565b60405190808252806020026020018201604052801561228d578160200160208202803683370190505b50905060008080805b858110156123d05760006001821b8b8116036122f157888510156122da578c5160018601958e9181106122cb576122cb612df8565b60200260200101519050612313565b85516001850194879181106122cb576122cb612df8565b8b5160018401938d91811061230857612308612df8565b602002602001015190505b600089861015612343578d5160018701968f91811061233457612334612df8565b60200260200101519050612365565b865160018601958891811061235a5761235a612df8565b602002602001015190505b8285111561239f576040517f09bde33900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6123a98282612546565b8784815181106123bb576123bb612df8565b60209081029190910101525050600101612296565b5060018503821480156123e257508683145b80156123ed57508581145b612423576040517f09bde33900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b83600186038151811061243857612438612df8565b60200260200101519750505050505050505b9392505050565b3373ffffffffffffffffffffffffffffffffffffffff8216036124d0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c660000000000000000006044820152606401610667565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b6000818310612588576040805160016020808301919091528183018590526060808301879052835180840390910181526080909201909252805191012061244a565b6040805160016020808301919091528183018690526060808301869052835180840390910181526080909201909252805191012061244a565b82805482825590600052602060002090810192821561263b579160200282015b8281111561263b57825182547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff9091161782556020909201916001909101906125e1565b5061264792915061266a565b5090565b604051806103e00160405280601f906020820280368337509192915050565b5b80821115612647576000815560010161266b565b60808101611a33828467ffffffffffffffff80825116835280602083015116602084015250604081015173ffffffffffffffffffffffffffffffffffffffff808216604085015280606084015116606085015250505050565b6000815180845260005b818110156126fe576020818501810151868301820152016126e2565b5060006020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b60208152600061244a60208301846126d8565b60008083601f84011261276157600080fd5b50813567ffffffffffffffff81111561277957600080fd5b60208301915083602082850101111561279157600080fd5b9250929050565b803564ffffffffff811681146127ad57600080fd5b919050565b6000806000604084860312156127c757600080fd5b833567ffffffffffffffff8111156127de57600080fd5b6127ea8682870161274f565b90945092506127fd905060208501612798565b90509250925092565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040805190810167ffffffffffffffff8111828210171561285857612858612806565b60405290565b6040516060810167ffffffffffffffff8111828210171561285857612858612806565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff811182821017156128c8576128c8612806565b604052919050565b600067ffffffffffffffff8211156128ea576128ea612806565b5060051b60200190565b73ffffffffffffffffffffffffffffffffffffffff811681146118c857600080fd5b600082601f83011261292757600080fd5b8135602061293c612937836128d0565b612881565b82815260059290921b8401810191818101908684111561295b57600080fd5b8286015b8481101561297f578035612972816128f4565b835291830191830161295f565b509695505050505050565b803560ff811681146127ad57600080fd5b600082601f8301126129ac57600080fd5b813567ffffffffffffffff8111156129c6576129c6612806565b6129f760207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f84011601612881565b818152846020838601011115612a0c57600080fd5b816020850160208301376000918101602001919091529392505050565b803567ffffffffffffffff811681146127ad57600080fd5b60008060008060008060c08789031215612a5a57600080fd5b863567ffffffffffffffff80821115612a7257600080fd5b612a7e8a838b01612916565b97506020890135915080821115612a9457600080fd5b612aa08a838b01612916565b9650612aae60408a0161298a565b95506060890135915080821115612ac457600080fd5b612ad08a838b0161299b565b9450612ade60808a01612a29565b935060a0890135915080821115612af457600080fd5b50612b0189828a0161299b565b9150509295509295509295565b600060208284031215612b2057600080fd5b61244a82612798565b60008083601f840112612b3b57600080fd5b50813567ffffffffffffffff811115612b5357600080fd5b6020830191508360208260051b850101111561279157600080fd5b600080600080600060608688031215612b8657600080fd5b853567ffffffffffffffff80821115612b9e57600080fd5b612baa89838a01612b29565b90975095506020880135915080821115612bc357600080fd5b50612bd088828901612b29565b96999598509660400135949350505050565b600081518084526020808501945080840160005b83811015612c2857815173ffffffffffffffffffffffffffffffffffffffff1687529582019590820190600101612bf6565b509495945050505050565b60208152600061244a6020830184612be2565b600060208284031215612c5857600080fd5b5035919050565b600060208284031215612c7157600080fd5b61244a82612a29565b60008060008060008060008060e0898b031215612c9657600080fd5b606089018a811115612ca757600080fd5b8998503567ffffffffffffffff80821115612cc157600080fd5b612ccd8c838d0161274f565b909950975060808b0135915080821115612ce657600080fd5b612cf28c838d01612b29565b909750955060a08b0135915080821115612d0b57600080fd5b50612d188b828c01612b29565b999c989b50969995989497949560c00135949350505050565b600060208284031215612d4357600080fd5b813561244a816128f4565b60008060208385031215612d6157600080fd5b823567ffffffffffffffff811115612d7857600080fd5b612d8485828601612b29565b90969095509350505050565b600060208284031215612da257600080fd5b8151801515811461244a57600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8082028115828204841417611a3357611a33612db2565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203612e5857612e58612db2565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b600063ffffffff808316818103612ea757612ea7612db2565b6001019392505050565b600061012063ffffffff808d1684528b6020850152808b16604085015250806060840152612ee18184018a612be2565b90508281036080840152612ef58189612be2565b905060ff871660a084015282810360c0840152612f1281876126d8565b905067ffffffffffffffff851660e0840152828103610100840152612f3781856126d8565b9c9b505050505050505050505050565b60ff8181168382160190811115611a3357611a33612db2565b600060ff831680612f9a577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b8060ff84160491505092915050565b80820180821115611a3357611a33612db2565b8183823760009101908152919050565b828152606082602083013760800192915050565b80357bffffffffffffffffffffffffffffffffffffffffffffffffffffffff811681146127ad57600080fd5b600082601f83011261301d57600080fd5b8135602061302d612937836128d0565b82815260069290921b8401810191818101908684111561304c57600080fd5b8286015b8481101561297f57604081890312156130695760008081fd5b613071612835565b61307a82612a29565b8152613087858301612fe0565b81860152835291830191604001613050565b6000604082840312156130ab57600080fd5b6130b3612835565b90506130be82612a29565b81526130cc60208301612a29565b602082015292915050565b600060208083850312156130ea57600080fd5b823567ffffffffffffffff8082111561310257600080fd5b908401906080828703121561311657600080fd5b61311e61285e565b82358281111561312d57600080fd5b8301604081890381131561314057600080fd5b613148612835565b82358581111561315757600080fd5b8301601f81018b1361316857600080fd5b8035613176612937826128d0565b81815260069190911b8201890190898101908d83111561319557600080fd5b928a01925b828410156131e55785848f0312156131b25760008081fd5b6131ba612835565b84356131c5816128f4565b81526131d2858d01612fe0565b818d0152825292850192908a019061319a565b845250505082870135858111156131fb57600080fd5b6132078b82860161300c565b8289015250835261321a89868801613099565b8684015260608501358184015250508094505050505092915050565b805160408084528151848201819052600092602091908201906060870190855b818110156132af578351805173ffffffffffffffffffffffffffffffffffffffff1684528501517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff16858401529284019291850191600101613256565b50508583015187820388850152805180835290840192506000918401905b8083101561331e578351805167ffffffffffffffff1683528501517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff16858301529284019260019290920191908501906132cd565b50979650505050505050565b60208152600061244a6020830184613236565b60408101611a338284805167ffffffffffffffff908116835260209182015116910152565b67ffffffffffffffff81811683821601908082111561338357613383612db2565b5092915050565b6020815260008251608060208401526133a660a0840182613236565b905060208401516133d16040850182805167ffffffffffffffff908116835260209182015116910152565b50604084015160808401528091505092915050565b6000602082840312156133f857600080fd5b6040516020810181811067ffffffffffffffff8211171561341b5761341b612806565b6040528251613429816128f4565b81529392505050565b60a0810161348b828567ffffffffffffffff80825116835280602083015116602084015250604081015173ffffffffffffffffffffffffffffffffffffffff808216604085015280606084015116606085015250505050565b73ffffffffffffffffffffffffffffffffffffffff83511660808301529392505050565b60006101208b835273ffffffffffffffffffffffffffffffffffffffff8b16602084015267ffffffffffffffff808b1660408501528160608501526134f68285018b612be2565b9150838203608085015261350a828a612be2565b915060ff881660a085015283820360c085015261352782886126d8565b90861660e08501528381036101008501529050612f3781856126d856fea164736f6c6343000813000a", +} + +var CommitStoreHelperABI = CommitStoreHelperMetaData.ABI + +var CommitStoreHelperBin = CommitStoreHelperMetaData.Bin + +func DeployCommitStoreHelper(auth *bind.TransactOpts, backend bind.ContractBackend, staticConfig CommitStoreStaticConfig) (common.Address, *types.Transaction, *CommitStoreHelper, error) { + parsed, err := CommitStoreHelperMetaData.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(CommitStoreHelperBin), backend, staticConfig) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &CommitStoreHelper{address: address, abi: *parsed, CommitStoreHelperCaller: CommitStoreHelperCaller{contract: contract}, CommitStoreHelperTransactor: CommitStoreHelperTransactor{contract: contract}, CommitStoreHelperFilterer: CommitStoreHelperFilterer{contract: contract}}, nil +} + +type CommitStoreHelper struct { + address common.Address + abi abi.ABI + CommitStoreHelperCaller + CommitStoreHelperTransactor + CommitStoreHelperFilterer +} + +type CommitStoreHelperCaller struct { + contract *bind.BoundContract +} + +type CommitStoreHelperTransactor struct { + contract *bind.BoundContract +} + +type CommitStoreHelperFilterer struct { + contract *bind.BoundContract +} + +type CommitStoreHelperSession struct { + Contract *CommitStoreHelper + CallOpts bind.CallOpts + TransactOpts bind.TransactOpts +} + +type CommitStoreHelperCallerSession struct { + Contract *CommitStoreHelperCaller + CallOpts bind.CallOpts +} + +type CommitStoreHelperTransactorSession struct { + Contract *CommitStoreHelperTransactor + TransactOpts bind.TransactOpts +} + +type CommitStoreHelperRaw struct { + Contract *CommitStoreHelper +} + +type CommitStoreHelperCallerRaw struct { + Contract *CommitStoreHelperCaller +} + +type CommitStoreHelperTransactorRaw struct { + Contract *CommitStoreHelperTransactor +} + +func NewCommitStoreHelper(address common.Address, backend bind.ContractBackend) (*CommitStoreHelper, error) { + abi, err := abi.JSON(strings.NewReader(CommitStoreHelperABI)) + if err != nil { + return nil, err + } + contract, err := bindCommitStoreHelper(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &CommitStoreHelper{address: address, abi: abi, CommitStoreHelperCaller: CommitStoreHelperCaller{contract: contract}, CommitStoreHelperTransactor: CommitStoreHelperTransactor{contract: contract}, CommitStoreHelperFilterer: CommitStoreHelperFilterer{contract: contract}}, nil +} + +func NewCommitStoreHelperCaller(address common.Address, caller bind.ContractCaller) (*CommitStoreHelperCaller, error) { + contract, err := bindCommitStoreHelper(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &CommitStoreHelperCaller{contract: contract}, nil +} + +func NewCommitStoreHelperTransactor(address common.Address, transactor bind.ContractTransactor) (*CommitStoreHelperTransactor, error) { + contract, err := bindCommitStoreHelper(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &CommitStoreHelperTransactor{contract: contract}, nil +} + +func NewCommitStoreHelperFilterer(address common.Address, filterer bind.ContractFilterer) (*CommitStoreHelperFilterer, error) { + contract, err := bindCommitStoreHelper(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &CommitStoreHelperFilterer{contract: contract}, nil +} + +func bindCommitStoreHelper(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := CommitStoreHelperMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +func (_CommitStoreHelper *CommitStoreHelperRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _CommitStoreHelper.Contract.CommitStoreHelperCaller.contract.Call(opts, result, method, params...) +} + +func (_CommitStoreHelper *CommitStoreHelperRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _CommitStoreHelper.Contract.CommitStoreHelperTransactor.contract.Transfer(opts) +} + +func (_CommitStoreHelper *CommitStoreHelperRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _CommitStoreHelper.Contract.CommitStoreHelperTransactor.contract.Transact(opts, method, params...) +} + +func (_CommitStoreHelper *CommitStoreHelperCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _CommitStoreHelper.Contract.contract.Call(opts, result, method, params...) +} + +func (_CommitStoreHelper *CommitStoreHelperTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _CommitStoreHelper.Contract.contract.Transfer(opts) +} + +func (_CommitStoreHelper *CommitStoreHelperTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _CommitStoreHelper.Contract.contract.Transact(opts, method, params...) +} + +func (_CommitStoreHelper *CommitStoreHelperCaller) GetDynamicConfig(opts *bind.CallOpts) (CommitStoreDynamicConfig, error) { + var out []interface{} + err := _CommitStoreHelper.contract.Call(opts, &out, "getDynamicConfig") + + if err != nil { + return *new(CommitStoreDynamicConfig), err + } + + out0 := *abi.ConvertType(out[0], new(CommitStoreDynamicConfig)).(*CommitStoreDynamicConfig) + + return out0, err + +} + +func (_CommitStoreHelper *CommitStoreHelperSession) GetDynamicConfig() (CommitStoreDynamicConfig, error) { + return _CommitStoreHelper.Contract.GetDynamicConfig(&_CommitStoreHelper.CallOpts) +} + +func (_CommitStoreHelper *CommitStoreHelperCallerSession) GetDynamicConfig() (CommitStoreDynamicConfig, error) { + return _CommitStoreHelper.Contract.GetDynamicConfig(&_CommitStoreHelper.CallOpts) +} + +func (_CommitStoreHelper *CommitStoreHelperCaller) GetExpectedNextSequenceNumber(opts *bind.CallOpts) (uint64, error) { + var out []interface{} + err := _CommitStoreHelper.contract.Call(opts, &out, "getExpectedNextSequenceNumber") + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +func (_CommitStoreHelper *CommitStoreHelperSession) GetExpectedNextSequenceNumber() (uint64, error) { + return _CommitStoreHelper.Contract.GetExpectedNextSequenceNumber(&_CommitStoreHelper.CallOpts) +} + +func (_CommitStoreHelper *CommitStoreHelperCallerSession) GetExpectedNextSequenceNumber() (uint64, error) { + return _CommitStoreHelper.Contract.GetExpectedNextSequenceNumber(&_CommitStoreHelper.CallOpts) +} + +func (_CommitStoreHelper *CommitStoreHelperCaller) GetLatestPriceEpochAndRound(opts *bind.CallOpts) (uint64, error) { + var out []interface{} + err := _CommitStoreHelper.contract.Call(opts, &out, "getLatestPriceEpochAndRound") + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +func (_CommitStoreHelper *CommitStoreHelperSession) GetLatestPriceEpochAndRound() (uint64, error) { + return _CommitStoreHelper.Contract.GetLatestPriceEpochAndRound(&_CommitStoreHelper.CallOpts) +} + +func (_CommitStoreHelper *CommitStoreHelperCallerSession) GetLatestPriceEpochAndRound() (uint64, error) { + return _CommitStoreHelper.Contract.GetLatestPriceEpochAndRound(&_CommitStoreHelper.CallOpts) +} + +func (_CommitStoreHelper *CommitStoreHelperCaller) GetMerkleRoot(opts *bind.CallOpts, root [32]byte) (*big.Int, error) { + var out []interface{} + err := _CommitStoreHelper.contract.Call(opts, &out, "getMerkleRoot", root) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_CommitStoreHelper *CommitStoreHelperSession) GetMerkleRoot(root [32]byte) (*big.Int, error) { + return _CommitStoreHelper.Contract.GetMerkleRoot(&_CommitStoreHelper.CallOpts, root) +} + +func (_CommitStoreHelper *CommitStoreHelperCallerSession) GetMerkleRoot(root [32]byte) (*big.Int, error) { + return _CommitStoreHelper.Contract.GetMerkleRoot(&_CommitStoreHelper.CallOpts, root) +} + +func (_CommitStoreHelper *CommitStoreHelperCaller) GetStaticConfig(opts *bind.CallOpts) (CommitStoreStaticConfig, error) { + var out []interface{} + err := _CommitStoreHelper.contract.Call(opts, &out, "getStaticConfig") + + if err != nil { + return *new(CommitStoreStaticConfig), err + } + + out0 := *abi.ConvertType(out[0], new(CommitStoreStaticConfig)).(*CommitStoreStaticConfig) + + return out0, err + +} + +func (_CommitStoreHelper *CommitStoreHelperSession) GetStaticConfig() (CommitStoreStaticConfig, error) { + return _CommitStoreHelper.Contract.GetStaticConfig(&_CommitStoreHelper.CallOpts) +} + +func (_CommitStoreHelper *CommitStoreHelperCallerSession) GetStaticConfig() (CommitStoreStaticConfig, error) { + return _CommitStoreHelper.Contract.GetStaticConfig(&_CommitStoreHelper.CallOpts) +} + +func (_CommitStoreHelper *CommitStoreHelperCaller) GetTransmitters(opts *bind.CallOpts) ([]common.Address, error) { + var out []interface{} + err := _CommitStoreHelper.contract.Call(opts, &out, "getTransmitters") + + if err != nil { + return *new([]common.Address), err + } + + out0 := *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) + + return out0, err + +} + +func (_CommitStoreHelper *CommitStoreHelperSession) GetTransmitters() ([]common.Address, error) { + return _CommitStoreHelper.Contract.GetTransmitters(&_CommitStoreHelper.CallOpts) +} + +func (_CommitStoreHelper *CommitStoreHelperCallerSession) GetTransmitters() ([]common.Address, error) { + return _CommitStoreHelper.Contract.GetTransmitters(&_CommitStoreHelper.CallOpts) +} + +func (_CommitStoreHelper *CommitStoreHelperCaller) IsARMHealthy(opts *bind.CallOpts) (bool, error) { + var out []interface{} + err := _CommitStoreHelper.contract.Call(opts, &out, "isARMHealthy") + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_CommitStoreHelper *CommitStoreHelperSession) IsARMHealthy() (bool, error) { + return _CommitStoreHelper.Contract.IsARMHealthy(&_CommitStoreHelper.CallOpts) +} + +func (_CommitStoreHelper *CommitStoreHelperCallerSession) IsARMHealthy() (bool, error) { + return _CommitStoreHelper.Contract.IsARMHealthy(&_CommitStoreHelper.CallOpts) +} + +func (_CommitStoreHelper *CommitStoreHelperCaller) IsBlessed(opts *bind.CallOpts, root [32]byte) (bool, error) { + var out []interface{} + err := _CommitStoreHelper.contract.Call(opts, &out, "isBlessed", root) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_CommitStoreHelper *CommitStoreHelperSession) IsBlessed(root [32]byte) (bool, error) { + return _CommitStoreHelper.Contract.IsBlessed(&_CommitStoreHelper.CallOpts, root) +} + +func (_CommitStoreHelper *CommitStoreHelperCallerSession) IsBlessed(root [32]byte) (bool, error) { + return _CommitStoreHelper.Contract.IsBlessed(&_CommitStoreHelper.CallOpts, root) +} + +func (_CommitStoreHelper *CommitStoreHelperCaller) IsUnpausedAndARMHealthy(opts *bind.CallOpts) (bool, error) { + var out []interface{} + err := _CommitStoreHelper.contract.Call(opts, &out, "isUnpausedAndARMHealthy") + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_CommitStoreHelper *CommitStoreHelperSession) IsUnpausedAndARMHealthy() (bool, error) { + return _CommitStoreHelper.Contract.IsUnpausedAndARMHealthy(&_CommitStoreHelper.CallOpts) +} + +func (_CommitStoreHelper *CommitStoreHelperCallerSession) IsUnpausedAndARMHealthy() (bool, error) { + return _CommitStoreHelper.Contract.IsUnpausedAndARMHealthy(&_CommitStoreHelper.CallOpts) +} + +func (_CommitStoreHelper *CommitStoreHelperCaller) LatestConfigDetails(opts *bind.CallOpts) (LatestConfigDetails, + + error) { + var out []interface{} + err := _CommitStoreHelper.contract.Call(opts, &out, "latestConfigDetails") + + outstruct := new(LatestConfigDetails) + if err != nil { + return *outstruct, err + } + + outstruct.ConfigCount = *abi.ConvertType(out[0], new(uint32)).(*uint32) + outstruct.BlockNumber = *abi.ConvertType(out[1], new(uint32)).(*uint32) + outstruct.ConfigDigest = *abi.ConvertType(out[2], new([32]byte)).(*[32]byte) + + return *outstruct, err + +} + +func (_CommitStoreHelper *CommitStoreHelperSession) LatestConfigDetails() (LatestConfigDetails, + + error) { + return _CommitStoreHelper.Contract.LatestConfigDetails(&_CommitStoreHelper.CallOpts) +} + +func (_CommitStoreHelper *CommitStoreHelperCallerSession) LatestConfigDetails() (LatestConfigDetails, + + error) { + return _CommitStoreHelper.Contract.LatestConfigDetails(&_CommitStoreHelper.CallOpts) +} + +func (_CommitStoreHelper *CommitStoreHelperCaller) LatestConfigDigestAndEpoch(opts *bind.CallOpts) (LatestConfigDigestAndEpoch, + + error) { + var out []interface{} + err := _CommitStoreHelper.contract.Call(opts, &out, "latestConfigDigestAndEpoch") + + outstruct := new(LatestConfigDigestAndEpoch) + if err != nil { + return *outstruct, err + } + + outstruct.ScanLogs = *abi.ConvertType(out[0], new(bool)).(*bool) + outstruct.ConfigDigest = *abi.ConvertType(out[1], new([32]byte)).(*[32]byte) + outstruct.Epoch = *abi.ConvertType(out[2], new(uint32)).(*uint32) + + return *outstruct, err + +} + +func (_CommitStoreHelper *CommitStoreHelperSession) LatestConfigDigestAndEpoch() (LatestConfigDigestAndEpoch, + + error) { + return _CommitStoreHelper.Contract.LatestConfigDigestAndEpoch(&_CommitStoreHelper.CallOpts) +} + +func (_CommitStoreHelper *CommitStoreHelperCallerSession) LatestConfigDigestAndEpoch() (LatestConfigDigestAndEpoch, + + error) { + return _CommitStoreHelper.Contract.LatestConfigDigestAndEpoch(&_CommitStoreHelper.CallOpts) +} + +func (_CommitStoreHelper *CommitStoreHelperCaller) Owner(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _CommitStoreHelper.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 + +} + +func (_CommitStoreHelper *CommitStoreHelperSession) Owner() (common.Address, error) { + return _CommitStoreHelper.Contract.Owner(&_CommitStoreHelper.CallOpts) +} + +func (_CommitStoreHelper *CommitStoreHelperCallerSession) Owner() (common.Address, error) { + return _CommitStoreHelper.Contract.Owner(&_CommitStoreHelper.CallOpts) +} + +func (_CommitStoreHelper *CommitStoreHelperCaller) Paused(opts *bind.CallOpts) (bool, error) { + var out []interface{} + err := _CommitStoreHelper.contract.Call(opts, &out, "paused") + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_CommitStoreHelper *CommitStoreHelperSession) Paused() (bool, error) { + return _CommitStoreHelper.Contract.Paused(&_CommitStoreHelper.CallOpts) +} + +func (_CommitStoreHelper *CommitStoreHelperCallerSession) Paused() (bool, error) { + return _CommitStoreHelper.Contract.Paused(&_CommitStoreHelper.CallOpts) +} + +func (_CommitStoreHelper *CommitStoreHelperCaller) TypeAndVersion(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _CommitStoreHelper.contract.Call(opts, &out, "typeAndVersion") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +func (_CommitStoreHelper *CommitStoreHelperSession) TypeAndVersion() (string, error) { + return _CommitStoreHelper.Contract.TypeAndVersion(&_CommitStoreHelper.CallOpts) +} + +func (_CommitStoreHelper *CommitStoreHelperCallerSession) TypeAndVersion() (string, error) { + return _CommitStoreHelper.Contract.TypeAndVersion(&_CommitStoreHelper.CallOpts) +} + +func (_CommitStoreHelper *CommitStoreHelperCaller) Verify(opts *bind.CallOpts, hashedLeaves [][32]byte, proofs [][32]byte, proofFlagBits *big.Int) (*big.Int, error) { + var out []interface{} + err := _CommitStoreHelper.contract.Call(opts, &out, "verify", hashedLeaves, proofs, proofFlagBits) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_CommitStoreHelper *CommitStoreHelperSession) Verify(hashedLeaves [][32]byte, proofs [][32]byte, proofFlagBits *big.Int) (*big.Int, error) { + return _CommitStoreHelper.Contract.Verify(&_CommitStoreHelper.CallOpts, hashedLeaves, proofs, proofFlagBits) +} + +func (_CommitStoreHelper *CommitStoreHelperCallerSession) Verify(hashedLeaves [][32]byte, proofs [][32]byte, proofFlagBits *big.Int) (*big.Int, error) { + return _CommitStoreHelper.Contract.Verify(&_CommitStoreHelper.CallOpts, hashedLeaves, proofs, proofFlagBits) +} + +func (_CommitStoreHelper *CommitStoreHelperTransactor) AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + return _CommitStoreHelper.contract.Transact(opts, "acceptOwnership") +} + +func (_CommitStoreHelper *CommitStoreHelperSession) AcceptOwnership() (*types.Transaction, error) { + return _CommitStoreHelper.Contract.AcceptOwnership(&_CommitStoreHelper.TransactOpts) +} + +func (_CommitStoreHelper *CommitStoreHelperTransactorSession) AcceptOwnership() (*types.Transaction, error) { + return _CommitStoreHelper.Contract.AcceptOwnership(&_CommitStoreHelper.TransactOpts) +} + +func (_CommitStoreHelper *CommitStoreHelperTransactor) Pause(opts *bind.TransactOpts) (*types.Transaction, error) { + return _CommitStoreHelper.contract.Transact(opts, "pause") +} + +func (_CommitStoreHelper *CommitStoreHelperSession) Pause() (*types.Transaction, error) { + return _CommitStoreHelper.Contract.Pause(&_CommitStoreHelper.TransactOpts) +} + +func (_CommitStoreHelper *CommitStoreHelperTransactorSession) Pause() (*types.Transaction, error) { + return _CommitStoreHelper.Contract.Pause(&_CommitStoreHelper.TransactOpts) +} + +func (_CommitStoreHelper *CommitStoreHelperTransactor) Report(opts *bind.TransactOpts, commitReport []byte, epochAndRound *big.Int) (*types.Transaction, error) { + return _CommitStoreHelper.contract.Transact(opts, "report", commitReport, epochAndRound) +} + +func (_CommitStoreHelper *CommitStoreHelperSession) Report(commitReport []byte, epochAndRound *big.Int) (*types.Transaction, error) { + return _CommitStoreHelper.Contract.Report(&_CommitStoreHelper.TransactOpts, commitReport, epochAndRound) +} + +func (_CommitStoreHelper *CommitStoreHelperTransactorSession) Report(commitReport []byte, epochAndRound *big.Int) (*types.Transaction, error) { + return _CommitStoreHelper.Contract.Report(&_CommitStoreHelper.TransactOpts, commitReport, epochAndRound) +} + +func (_CommitStoreHelper *CommitStoreHelperTransactor) ResetUnblessedRoots(opts *bind.TransactOpts, rootToReset [][32]byte) (*types.Transaction, error) { + return _CommitStoreHelper.contract.Transact(opts, "resetUnblessedRoots", rootToReset) +} + +func (_CommitStoreHelper *CommitStoreHelperSession) ResetUnblessedRoots(rootToReset [][32]byte) (*types.Transaction, error) { + return _CommitStoreHelper.Contract.ResetUnblessedRoots(&_CommitStoreHelper.TransactOpts, rootToReset) +} + +func (_CommitStoreHelper *CommitStoreHelperTransactorSession) ResetUnblessedRoots(rootToReset [][32]byte) (*types.Transaction, error) { + return _CommitStoreHelper.Contract.ResetUnblessedRoots(&_CommitStoreHelper.TransactOpts, rootToReset) +} + +func (_CommitStoreHelper *CommitStoreHelperTransactor) SetLatestPriceEpochAndRound(opts *bind.TransactOpts, latestPriceEpochAndRound *big.Int) (*types.Transaction, error) { + return _CommitStoreHelper.contract.Transact(opts, "setLatestPriceEpochAndRound", latestPriceEpochAndRound) +} + +func (_CommitStoreHelper *CommitStoreHelperSession) SetLatestPriceEpochAndRound(latestPriceEpochAndRound *big.Int) (*types.Transaction, error) { + return _CommitStoreHelper.Contract.SetLatestPriceEpochAndRound(&_CommitStoreHelper.TransactOpts, latestPriceEpochAndRound) +} + +func (_CommitStoreHelper *CommitStoreHelperTransactorSession) SetLatestPriceEpochAndRound(latestPriceEpochAndRound *big.Int) (*types.Transaction, error) { + return _CommitStoreHelper.Contract.SetLatestPriceEpochAndRound(&_CommitStoreHelper.TransactOpts, latestPriceEpochAndRound) +} + +func (_CommitStoreHelper *CommitStoreHelperTransactor) SetMinSeqNr(opts *bind.TransactOpts, minSeqNr uint64) (*types.Transaction, error) { + return _CommitStoreHelper.contract.Transact(opts, "setMinSeqNr", minSeqNr) +} + +func (_CommitStoreHelper *CommitStoreHelperSession) SetMinSeqNr(minSeqNr uint64) (*types.Transaction, error) { + return _CommitStoreHelper.Contract.SetMinSeqNr(&_CommitStoreHelper.TransactOpts, minSeqNr) +} + +func (_CommitStoreHelper *CommitStoreHelperTransactorSession) SetMinSeqNr(minSeqNr uint64) (*types.Transaction, error) { + return _CommitStoreHelper.Contract.SetMinSeqNr(&_CommitStoreHelper.TransactOpts, minSeqNr) +} + +func (_CommitStoreHelper *CommitStoreHelperTransactor) SetOCR2Config(opts *bind.TransactOpts, signers []common.Address, transmitters []common.Address, f uint8, onchainConfig []byte, offchainConfigVersion uint64, offchainConfig []byte) (*types.Transaction, error) { + return _CommitStoreHelper.contract.Transact(opts, "setOCR2Config", signers, transmitters, f, onchainConfig, offchainConfigVersion, offchainConfig) +} + +func (_CommitStoreHelper *CommitStoreHelperSession) SetOCR2Config(signers []common.Address, transmitters []common.Address, f uint8, onchainConfig []byte, offchainConfigVersion uint64, offchainConfig []byte) (*types.Transaction, error) { + return _CommitStoreHelper.Contract.SetOCR2Config(&_CommitStoreHelper.TransactOpts, signers, transmitters, f, onchainConfig, offchainConfigVersion, offchainConfig) +} + +func (_CommitStoreHelper *CommitStoreHelperTransactorSession) SetOCR2Config(signers []common.Address, transmitters []common.Address, f uint8, onchainConfig []byte, offchainConfigVersion uint64, offchainConfig []byte) (*types.Transaction, error) { + return _CommitStoreHelper.Contract.SetOCR2Config(&_CommitStoreHelper.TransactOpts, signers, transmitters, f, onchainConfig, offchainConfigVersion, offchainConfig) +} + +func (_CommitStoreHelper *CommitStoreHelperTransactor) TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) { + return _CommitStoreHelper.contract.Transact(opts, "transferOwnership", to) +} + +func (_CommitStoreHelper *CommitStoreHelperSession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _CommitStoreHelper.Contract.TransferOwnership(&_CommitStoreHelper.TransactOpts, to) +} + +func (_CommitStoreHelper *CommitStoreHelperTransactorSession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _CommitStoreHelper.Contract.TransferOwnership(&_CommitStoreHelper.TransactOpts, to) +} + +func (_CommitStoreHelper *CommitStoreHelperTransactor) Transmit(opts *bind.TransactOpts, reportContext [3][32]byte, report []byte, rs [][32]byte, ss [][32]byte, rawVs [32]byte) (*types.Transaction, error) { + return _CommitStoreHelper.contract.Transact(opts, "transmit", reportContext, report, rs, ss, rawVs) +} + +func (_CommitStoreHelper *CommitStoreHelperSession) Transmit(reportContext [3][32]byte, report []byte, rs [][32]byte, ss [][32]byte, rawVs [32]byte) (*types.Transaction, error) { + return _CommitStoreHelper.Contract.Transmit(&_CommitStoreHelper.TransactOpts, reportContext, report, rs, ss, rawVs) +} + +func (_CommitStoreHelper *CommitStoreHelperTransactorSession) Transmit(reportContext [3][32]byte, report []byte, rs [][32]byte, ss [][32]byte, rawVs [32]byte) (*types.Transaction, error) { + return _CommitStoreHelper.Contract.Transmit(&_CommitStoreHelper.TransactOpts, reportContext, report, rs, ss, rawVs) +} + +func (_CommitStoreHelper *CommitStoreHelperTransactor) Unpause(opts *bind.TransactOpts) (*types.Transaction, error) { + return _CommitStoreHelper.contract.Transact(opts, "unpause") +} + +func (_CommitStoreHelper *CommitStoreHelperSession) Unpause() (*types.Transaction, error) { + return _CommitStoreHelper.Contract.Unpause(&_CommitStoreHelper.TransactOpts) +} + +func (_CommitStoreHelper *CommitStoreHelperTransactorSession) Unpause() (*types.Transaction, error) { + return _CommitStoreHelper.Contract.Unpause(&_CommitStoreHelper.TransactOpts) +} + +type CommitStoreHelperConfigSetIterator struct { + Event *CommitStoreHelperConfigSet + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *CommitStoreHelperConfigSetIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(CommitStoreHelperConfigSet) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(CommitStoreHelperConfigSet) + 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() + } +} + +func (it *CommitStoreHelperConfigSetIterator) Error() error { + return it.fail +} + +func (it *CommitStoreHelperConfigSetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type CommitStoreHelperConfigSet struct { + StaticConfig CommitStoreStaticConfig + DynamicConfig CommitStoreDynamicConfig + Raw types.Log +} + +func (_CommitStoreHelper *CommitStoreHelperFilterer) FilterConfigSet(opts *bind.FilterOpts) (*CommitStoreHelperConfigSetIterator, error) { + + logs, sub, err := _CommitStoreHelper.contract.FilterLogs(opts, "ConfigSet") + if err != nil { + return nil, err + } + return &CommitStoreHelperConfigSetIterator{contract: _CommitStoreHelper.contract, event: "ConfigSet", logs: logs, sub: sub}, nil +} + +func (_CommitStoreHelper *CommitStoreHelperFilterer) WatchConfigSet(opts *bind.WatchOpts, sink chan<- *CommitStoreHelperConfigSet) (event.Subscription, error) { + + logs, sub, err := _CommitStoreHelper.contract.WatchLogs(opts, "ConfigSet") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(CommitStoreHelperConfigSet) + if err := _CommitStoreHelper.contract.UnpackLog(event, "ConfigSet", 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 +} + +func (_CommitStoreHelper *CommitStoreHelperFilterer) ParseConfigSet(log types.Log) (*CommitStoreHelperConfigSet, error) { + event := new(CommitStoreHelperConfigSet) + if err := _CommitStoreHelper.contract.UnpackLog(event, "ConfigSet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type CommitStoreHelperConfigSet0Iterator struct { + Event *CommitStoreHelperConfigSet0 + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *CommitStoreHelperConfigSet0Iterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(CommitStoreHelperConfigSet0) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(CommitStoreHelperConfigSet0) + 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() + } +} + +func (it *CommitStoreHelperConfigSet0Iterator) Error() error { + return it.fail +} + +func (it *CommitStoreHelperConfigSet0Iterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type CommitStoreHelperConfigSet0 struct { + PreviousConfigBlockNumber uint32 + ConfigDigest [32]byte + ConfigCount uint64 + Signers []common.Address + Transmitters []common.Address + F uint8 + OnchainConfig []byte + OffchainConfigVersion uint64 + OffchainConfig []byte + Raw types.Log +} + +func (_CommitStoreHelper *CommitStoreHelperFilterer) FilterConfigSet0(opts *bind.FilterOpts) (*CommitStoreHelperConfigSet0Iterator, error) { + + logs, sub, err := _CommitStoreHelper.contract.FilterLogs(opts, "ConfigSet0") + if err != nil { + return nil, err + } + return &CommitStoreHelperConfigSet0Iterator{contract: _CommitStoreHelper.contract, event: "ConfigSet0", logs: logs, sub: sub}, nil +} + +func (_CommitStoreHelper *CommitStoreHelperFilterer) WatchConfigSet0(opts *bind.WatchOpts, sink chan<- *CommitStoreHelperConfigSet0) (event.Subscription, error) { + + logs, sub, err := _CommitStoreHelper.contract.WatchLogs(opts, "ConfigSet0") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(CommitStoreHelperConfigSet0) + if err := _CommitStoreHelper.contract.UnpackLog(event, "ConfigSet0", 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 +} + +func (_CommitStoreHelper *CommitStoreHelperFilterer) ParseConfigSet0(log types.Log) (*CommitStoreHelperConfigSet0, error) { + event := new(CommitStoreHelperConfigSet0) + if err := _CommitStoreHelper.contract.UnpackLog(event, "ConfigSet0", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type CommitStoreHelperOwnershipTransferRequestedIterator struct { + Event *CommitStoreHelperOwnershipTransferRequested + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *CommitStoreHelperOwnershipTransferRequestedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(CommitStoreHelperOwnershipTransferRequested) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(CommitStoreHelperOwnershipTransferRequested) + 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() + } +} + +func (it *CommitStoreHelperOwnershipTransferRequestedIterator) Error() error { + return it.fail +} + +func (it *CommitStoreHelperOwnershipTransferRequestedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type CommitStoreHelperOwnershipTransferRequested struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_CommitStoreHelper *CommitStoreHelperFilterer) FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*CommitStoreHelperOwnershipTransferRequestedIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _CommitStoreHelper.contract.FilterLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return &CommitStoreHelperOwnershipTransferRequestedIterator{contract: _CommitStoreHelper.contract, event: "OwnershipTransferRequested", logs: logs, sub: sub}, nil +} + +func (_CommitStoreHelper *CommitStoreHelperFilterer) WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *CommitStoreHelperOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _CommitStoreHelper.contract.WatchLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(CommitStoreHelperOwnershipTransferRequested) + if err := _CommitStoreHelper.contract.UnpackLog(event, "OwnershipTransferRequested", 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 +} + +func (_CommitStoreHelper *CommitStoreHelperFilterer) ParseOwnershipTransferRequested(log types.Log) (*CommitStoreHelperOwnershipTransferRequested, error) { + event := new(CommitStoreHelperOwnershipTransferRequested) + if err := _CommitStoreHelper.contract.UnpackLog(event, "OwnershipTransferRequested", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type CommitStoreHelperOwnershipTransferredIterator struct { + Event *CommitStoreHelperOwnershipTransferred + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *CommitStoreHelperOwnershipTransferredIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(CommitStoreHelperOwnershipTransferred) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(CommitStoreHelperOwnershipTransferred) + 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() + } +} + +func (it *CommitStoreHelperOwnershipTransferredIterator) Error() error { + return it.fail +} + +func (it *CommitStoreHelperOwnershipTransferredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type CommitStoreHelperOwnershipTransferred struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_CommitStoreHelper *CommitStoreHelperFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*CommitStoreHelperOwnershipTransferredIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _CommitStoreHelper.contract.FilterLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return &CommitStoreHelperOwnershipTransferredIterator{contract: _CommitStoreHelper.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil +} + +func (_CommitStoreHelper *CommitStoreHelperFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *CommitStoreHelperOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _CommitStoreHelper.contract.WatchLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(CommitStoreHelperOwnershipTransferred) + if err := _CommitStoreHelper.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 +} + +func (_CommitStoreHelper *CommitStoreHelperFilterer) ParseOwnershipTransferred(log types.Log) (*CommitStoreHelperOwnershipTransferred, error) { + event := new(CommitStoreHelperOwnershipTransferred) + if err := _CommitStoreHelper.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type CommitStoreHelperPausedIterator struct { + Event *CommitStoreHelperPaused + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *CommitStoreHelperPausedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(CommitStoreHelperPaused) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(CommitStoreHelperPaused) + 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() + } +} + +func (it *CommitStoreHelperPausedIterator) Error() error { + return it.fail +} + +func (it *CommitStoreHelperPausedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type CommitStoreHelperPaused struct { + Account common.Address + Raw types.Log +} + +func (_CommitStoreHelper *CommitStoreHelperFilterer) FilterPaused(opts *bind.FilterOpts) (*CommitStoreHelperPausedIterator, error) { + + logs, sub, err := _CommitStoreHelper.contract.FilterLogs(opts, "Paused") + if err != nil { + return nil, err + } + return &CommitStoreHelperPausedIterator{contract: _CommitStoreHelper.contract, event: "Paused", logs: logs, sub: sub}, nil +} + +func (_CommitStoreHelper *CommitStoreHelperFilterer) WatchPaused(opts *bind.WatchOpts, sink chan<- *CommitStoreHelperPaused) (event.Subscription, error) { + + logs, sub, err := _CommitStoreHelper.contract.WatchLogs(opts, "Paused") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(CommitStoreHelperPaused) + if err := _CommitStoreHelper.contract.UnpackLog(event, "Paused", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +func (_CommitStoreHelper *CommitStoreHelperFilterer) ParsePaused(log types.Log) (*CommitStoreHelperPaused, error) { + event := new(CommitStoreHelperPaused) + if err := _CommitStoreHelper.contract.UnpackLog(event, "Paused", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type CommitStoreHelperReportAcceptedIterator struct { + Event *CommitStoreHelperReportAccepted + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *CommitStoreHelperReportAcceptedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(CommitStoreHelperReportAccepted) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(CommitStoreHelperReportAccepted) + 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() + } +} + +func (it *CommitStoreHelperReportAcceptedIterator) Error() error { + return it.fail +} + +func (it *CommitStoreHelperReportAcceptedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type CommitStoreHelperReportAccepted struct { + Report CommitStoreCommitReport + Raw types.Log +} + +func (_CommitStoreHelper *CommitStoreHelperFilterer) FilterReportAccepted(opts *bind.FilterOpts) (*CommitStoreHelperReportAcceptedIterator, error) { + + logs, sub, err := _CommitStoreHelper.contract.FilterLogs(opts, "ReportAccepted") + if err != nil { + return nil, err + } + return &CommitStoreHelperReportAcceptedIterator{contract: _CommitStoreHelper.contract, event: "ReportAccepted", logs: logs, sub: sub}, nil +} + +func (_CommitStoreHelper *CommitStoreHelperFilterer) WatchReportAccepted(opts *bind.WatchOpts, sink chan<- *CommitStoreHelperReportAccepted) (event.Subscription, error) { + + logs, sub, err := _CommitStoreHelper.contract.WatchLogs(opts, "ReportAccepted") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(CommitStoreHelperReportAccepted) + if err := _CommitStoreHelper.contract.UnpackLog(event, "ReportAccepted", 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 +} + +func (_CommitStoreHelper *CommitStoreHelperFilterer) ParseReportAccepted(log types.Log) (*CommitStoreHelperReportAccepted, error) { + event := new(CommitStoreHelperReportAccepted) + if err := _CommitStoreHelper.contract.UnpackLog(event, "ReportAccepted", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type CommitStoreHelperRootRemovedIterator struct { + Event *CommitStoreHelperRootRemoved + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *CommitStoreHelperRootRemovedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(CommitStoreHelperRootRemoved) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(CommitStoreHelperRootRemoved) + 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() + } +} + +func (it *CommitStoreHelperRootRemovedIterator) Error() error { + return it.fail +} + +func (it *CommitStoreHelperRootRemovedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type CommitStoreHelperRootRemoved struct { + Root [32]byte + Raw types.Log +} + +func (_CommitStoreHelper *CommitStoreHelperFilterer) FilterRootRemoved(opts *bind.FilterOpts) (*CommitStoreHelperRootRemovedIterator, error) { + + logs, sub, err := _CommitStoreHelper.contract.FilterLogs(opts, "RootRemoved") + if err != nil { + return nil, err + } + return &CommitStoreHelperRootRemovedIterator{contract: _CommitStoreHelper.contract, event: "RootRemoved", logs: logs, sub: sub}, nil +} + +func (_CommitStoreHelper *CommitStoreHelperFilterer) WatchRootRemoved(opts *bind.WatchOpts, sink chan<- *CommitStoreHelperRootRemoved) (event.Subscription, error) { + + logs, sub, err := _CommitStoreHelper.contract.WatchLogs(opts, "RootRemoved") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(CommitStoreHelperRootRemoved) + if err := _CommitStoreHelper.contract.UnpackLog(event, "RootRemoved", 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 +} + +func (_CommitStoreHelper *CommitStoreHelperFilterer) ParseRootRemoved(log types.Log) (*CommitStoreHelperRootRemoved, error) { + event := new(CommitStoreHelperRootRemoved) + if err := _CommitStoreHelper.contract.UnpackLog(event, "RootRemoved", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type CommitStoreHelperTransmittedIterator struct { + Event *CommitStoreHelperTransmitted + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *CommitStoreHelperTransmittedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(CommitStoreHelperTransmitted) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(CommitStoreHelperTransmitted) + 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() + } +} + +func (it *CommitStoreHelperTransmittedIterator) Error() error { + return it.fail +} + +func (it *CommitStoreHelperTransmittedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type CommitStoreHelperTransmitted struct { + ConfigDigest [32]byte + Epoch uint32 + Raw types.Log +} + +func (_CommitStoreHelper *CommitStoreHelperFilterer) FilterTransmitted(opts *bind.FilterOpts) (*CommitStoreHelperTransmittedIterator, error) { + + logs, sub, err := _CommitStoreHelper.contract.FilterLogs(opts, "Transmitted") + if err != nil { + return nil, err + } + return &CommitStoreHelperTransmittedIterator{contract: _CommitStoreHelper.contract, event: "Transmitted", logs: logs, sub: sub}, nil +} + +func (_CommitStoreHelper *CommitStoreHelperFilterer) WatchTransmitted(opts *bind.WatchOpts, sink chan<- *CommitStoreHelperTransmitted) (event.Subscription, error) { + + logs, sub, err := _CommitStoreHelper.contract.WatchLogs(opts, "Transmitted") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(CommitStoreHelperTransmitted) + if err := _CommitStoreHelper.contract.UnpackLog(event, "Transmitted", 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 +} + +func (_CommitStoreHelper *CommitStoreHelperFilterer) ParseTransmitted(log types.Log) (*CommitStoreHelperTransmitted, error) { + event := new(CommitStoreHelperTransmitted) + if err := _CommitStoreHelper.contract.UnpackLog(event, "Transmitted", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type CommitStoreHelperUnpausedIterator struct { + Event *CommitStoreHelperUnpaused + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *CommitStoreHelperUnpausedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(CommitStoreHelperUnpaused) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(CommitStoreHelperUnpaused) + 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() + } +} + +func (it *CommitStoreHelperUnpausedIterator) Error() error { + return it.fail +} + +func (it *CommitStoreHelperUnpausedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type CommitStoreHelperUnpaused struct { + Account common.Address + Raw types.Log +} + +func (_CommitStoreHelper *CommitStoreHelperFilterer) FilterUnpaused(opts *bind.FilterOpts) (*CommitStoreHelperUnpausedIterator, error) { + + logs, sub, err := _CommitStoreHelper.contract.FilterLogs(opts, "Unpaused") + if err != nil { + return nil, err + } + return &CommitStoreHelperUnpausedIterator{contract: _CommitStoreHelper.contract, event: "Unpaused", logs: logs, sub: sub}, nil +} + +func (_CommitStoreHelper *CommitStoreHelperFilterer) WatchUnpaused(opts *bind.WatchOpts, sink chan<- *CommitStoreHelperUnpaused) (event.Subscription, error) { + + logs, sub, err := _CommitStoreHelper.contract.WatchLogs(opts, "Unpaused") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(CommitStoreHelperUnpaused) + if err := _CommitStoreHelper.contract.UnpackLog(event, "Unpaused", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +func (_CommitStoreHelper *CommitStoreHelperFilterer) ParseUnpaused(log types.Log) (*CommitStoreHelperUnpaused, error) { + event := new(CommitStoreHelperUnpaused) + if err := _CommitStoreHelper.contract.UnpackLog(event, "Unpaused", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type LatestConfigDetails struct { + ConfigCount uint32 + BlockNumber uint32 + ConfigDigest [32]byte +} +type LatestConfigDigestAndEpoch struct { + ScanLogs bool + ConfigDigest [32]byte + Epoch uint32 +} + +func (_CommitStoreHelper *CommitStoreHelper) ParseLog(log types.Log) (generated.AbigenLog, error) { + switch log.Topics[0] { + case _CommitStoreHelper.abi.Events["ConfigSet"].ID: + return _CommitStoreHelper.ParseConfigSet(log) + case _CommitStoreHelper.abi.Events["ConfigSet0"].ID: + return _CommitStoreHelper.ParseConfigSet0(log) + case _CommitStoreHelper.abi.Events["OwnershipTransferRequested"].ID: + return _CommitStoreHelper.ParseOwnershipTransferRequested(log) + case _CommitStoreHelper.abi.Events["OwnershipTransferred"].ID: + return _CommitStoreHelper.ParseOwnershipTransferred(log) + case _CommitStoreHelper.abi.Events["Paused"].ID: + return _CommitStoreHelper.ParsePaused(log) + case _CommitStoreHelper.abi.Events["ReportAccepted"].ID: + return _CommitStoreHelper.ParseReportAccepted(log) + case _CommitStoreHelper.abi.Events["RootRemoved"].ID: + return _CommitStoreHelper.ParseRootRemoved(log) + case _CommitStoreHelper.abi.Events["Transmitted"].ID: + return _CommitStoreHelper.ParseTransmitted(log) + case _CommitStoreHelper.abi.Events["Unpaused"].ID: + return _CommitStoreHelper.ParseUnpaused(log) + + default: + return nil, fmt.Errorf("abigen wrapper received unknown log topic: %v", log.Topics[0]) + } +} + +func (CommitStoreHelperConfigSet) Topic() common.Hash { + return common.HexToHash("0xc9d7123efd4203e60b0f0a4b1dbc4800fc97ce63679f71c3a27279b24a7ddec3") +} + +func (CommitStoreHelperConfigSet0) Topic() common.Hash { + return common.HexToHash("0x1591690b8638f5fb2dbec82ac741805ac5da8b45dc5263f4875b0496fdce4e05") +} + +func (CommitStoreHelperOwnershipTransferRequested) Topic() common.Hash { + return common.HexToHash("0xed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae1278") +} + +func (CommitStoreHelperOwnershipTransferred) Topic() common.Hash { + return common.HexToHash("0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0") +} + +func (CommitStoreHelperPaused) Topic() common.Hash { + return common.HexToHash("0x62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258") +} + +func (CommitStoreHelperReportAccepted) Topic() common.Hash { + return common.HexToHash("0x291698c01aa71f912280535d88a00d2c59fb63530a3f5d0098560468acb9ebf5") +} + +func (CommitStoreHelperRootRemoved) Topic() common.Hash { + return common.HexToHash("0x202f1139a3e334b6056064c0e9b19fd07e44a88d8f6e5ded571b24cf8c371f12") +} + +func (CommitStoreHelperTransmitted) Topic() common.Hash { + return common.HexToHash("0xb04e63db38c49950639fa09d29872f21f5d49d614f3a969d8adf3d4b52e41a62") +} + +func (CommitStoreHelperUnpaused) Topic() common.Hash { + return common.HexToHash("0x5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa") +} + +func (_CommitStoreHelper *CommitStoreHelper) Address() common.Address { + return _CommitStoreHelper.address +} + +type CommitStoreHelperInterface interface { + GetDynamicConfig(opts *bind.CallOpts) (CommitStoreDynamicConfig, error) + + GetExpectedNextSequenceNumber(opts *bind.CallOpts) (uint64, error) + + GetLatestPriceEpochAndRound(opts *bind.CallOpts) (uint64, error) + + GetMerkleRoot(opts *bind.CallOpts, root [32]byte) (*big.Int, error) + + GetStaticConfig(opts *bind.CallOpts) (CommitStoreStaticConfig, error) + + GetTransmitters(opts *bind.CallOpts) ([]common.Address, error) + + IsARMHealthy(opts *bind.CallOpts) (bool, error) + + IsBlessed(opts *bind.CallOpts, root [32]byte) (bool, error) + + IsUnpausedAndARMHealthy(opts *bind.CallOpts) (bool, error) + + LatestConfigDetails(opts *bind.CallOpts) (LatestConfigDetails, + + error) + + LatestConfigDigestAndEpoch(opts *bind.CallOpts) (LatestConfigDigestAndEpoch, + + error) + + Owner(opts *bind.CallOpts) (common.Address, error) + + Paused(opts *bind.CallOpts) (bool, error) + + TypeAndVersion(opts *bind.CallOpts) (string, error) + + Verify(opts *bind.CallOpts, hashedLeaves [][32]byte, proofs [][32]byte, proofFlagBits *big.Int) (*big.Int, error) + + AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) + + Pause(opts *bind.TransactOpts) (*types.Transaction, error) + + Report(opts *bind.TransactOpts, commitReport []byte, epochAndRound *big.Int) (*types.Transaction, error) + + ResetUnblessedRoots(opts *bind.TransactOpts, rootToReset [][32]byte) (*types.Transaction, error) + + SetLatestPriceEpochAndRound(opts *bind.TransactOpts, latestPriceEpochAndRound *big.Int) (*types.Transaction, error) + + SetMinSeqNr(opts *bind.TransactOpts, minSeqNr uint64) (*types.Transaction, error) + + SetOCR2Config(opts *bind.TransactOpts, signers []common.Address, transmitters []common.Address, f uint8, onchainConfig []byte, offchainConfigVersion uint64, offchainConfig []byte) (*types.Transaction, error) + + TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) + + Transmit(opts *bind.TransactOpts, reportContext [3][32]byte, report []byte, rs [][32]byte, ss [][32]byte, rawVs [32]byte) (*types.Transaction, error) + + Unpause(opts *bind.TransactOpts) (*types.Transaction, error) + + FilterConfigSet(opts *bind.FilterOpts) (*CommitStoreHelperConfigSetIterator, error) + + WatchConfigSet(opts *bind.WatchOpts, sink chan<- *CommitStoreHelperConfigSet) (event.Subscription, error) + + ParseConfigSet(log types.Log) (*CommitStoreHelperConfigSet, error) + + FilterConfigSet0(opts *bind.FilterOpts) (*CommitStoreHelperConfigSet0Iterator, error) + + WatchConfigSet0(opts *bind.WatchOpts, sink chan<- *CommitStoreHelperConfigSet0) (event.Subscription, error) + + ParseConfigSet0(log types.Log) (*CommitStoreHelperConfigSet0, error) + + FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*CommitStoreHelperOwnershipTransferRequestedIterator, error) + + WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *CommitStoreHelperOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferRequested(log types.Log) (*CommitStoreHelperOwnershipTransferRequested, error) + + FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*CommitStoreHelperOwnershipTransferredIterator, error) + + WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *CommitStoreHelperOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferred(log types.Log) (*CommitStoreHelperOwnershipTransferred, error) + + FilterPaused(opts *bind.FilterOpts) (*CommitStoreHelperPausedIterator, error) + + WatchPaused(opts *bind.WatchOpts, sink chan<- *CommitStoreHelperPaused) (event.Subscription, error) + + ParsePaused(log types.Log) (*CommitStoreHelperPaused, error) + + FilterReportAccepted(opts *bind.FilterOpts) (*CommitStoreHelperReportAcceptedIterator, error) + + WatchReportAccepted(opts *bind.WatchOpts, sink chan<- *CommitStoreHelperReportAccepted) (event.Subscription, error) + + ParseReportAccepted(log types.Log) (*CommitStoreHelperReportAccepted, error) + + FilterRootRemoved(opts *bind.FilterOpts) (*CommitStoreHelperRootRemovedIterator, error) + + WatchRootRemoved(opts *bind.WatchOpts, sink chan<- *CommitStoreHelperRootRemoved) (event.Subscription, error) + + ParseRootRemoved(log types.Log) (*CommitStoreHelperRootRemoved, error) + + FilterTransmitted(opts *bind.FilterOpts) (*CommitStoreHelperTransmittedIterator, error) + + WatchTransmitted(opts *bind.WatchOpts, sink chan<- *CommitStoreHelperTransmitted) (event.Subscription, error) + + ParseTransmitted(log types.Log) (*CommitStoreHelperTransmitted, error) + + FilterUnpaused(opts *bind.FilterOpts) (*CommitStoreHelperUnpausedIterator, error) + + WatchUnpaused(opts *bind.WatchOpts, sink chan<- *CommitStoreHelperUnpaused) (event.Subscription, error) + + ParseUnpaused(log types.Log) (*CommitStoreHelperUnpaused, error) + + ParseLog(log types.Log) (generated.AbigenLog, error) + + Address() common.Address +} diff --git a/core/gethwrappers/ccip/generated/ether_sender_receiver/ether_sender_receiver.go b/core/gethwrappers/ccip/generated/ether_sender_receiver/ether_sender_receiver.go new file mode 100644 index 00000000000..505e42e98ec --- /dev/null +++ b/core/gethwrappers/ccip/generated/ether_sender_receiver/ether_sender_receiver.go @@ -0,0 +1,361 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package ether_sender_receiver + +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" +) + +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +type ClientAny2EVMMessage struct { + MessageId [32]byte + SourceChainSelector uint64 + Sender []byte + Data []byte + DestTokenAmounts []ClientEVMTokenAmount +} + +type ClientEVM2AnyMessage struct { + Receiver []byte + Data []byte + TokenAmounts []ClientEVMTokenAmount + FeeToken common.Address + ExtraArgs []byte +} + +type ClientEVMTokenAmount struct { + Token common.Address + Amount *big.Int +} + +var EtherSenderReceiverMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"router\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"router\",\"type\":\"address\"}],\"name\":\"InvalidRouter\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"gotToken\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"expectedToken\",\"type\":\"address\"}],\"name\":\"InvalidToken\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"gotAmounts\",\"type\":\"uint256\"}],\"name\":\"InvalidTokenAmounts\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"gotAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"msgValue\",\"type\":\"uint256\"}],\"name\":\"TokenAmountNotEqualToMsgValue\",\"type\":\"error\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"messageId\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"sender\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"internalType\":\"structClient.EVMTokenAmount[]\",\"name\":\"destTokenAmounts\",\"type\":\"tuple[]\"}],\"internalType\":\"structClient.Any2EVMMessage\",\"name\":\"message\",\"type\":\"tuple\"}],\"name\":\"ccipReceive\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"destinationChainSelector\",\"type\":\"uint64\"},{\"components\":[{\"internalType\":\"bytes\",\"name\":\"receiver\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"internalType\":\"structClient.EVMTokenAmount[]\",\"name\":\"tokenAmounts\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"feeToken\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"extraArgs\",\"type\":\"bytes\"}],\"internalType\":\"structClient.EVM2AnyMessage\",\"name\":\"message\",\"type\":\"tuple\"}],\"name\":\"ccipSend\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"destinationChainSelector\",\"type\":\"uint64\"},{\"components\":[{\"internalType\":\"bytes\",\"name\":\"receiver\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"internalType\":\"structClient.EVMTokenAmount[]\",\"name\":\"tokenAmounts\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"feeToken\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"extraArgs\",\"type\":\"bytes\"}],\"internalType\":\"structClient.EVM2AnyMessage\",\"name\":\"message\",\"type\":\"tuple\"}],\"name\":\"getFee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"fee\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRouter\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"i_weth\",\"outputs\":[{\"internalType\":\"contractIWrappedNative\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]", + Bin: "0x60c06040523480156200001157600080fd5b5060405162001a9838038062001a98833981016040819052620000349162000169565b806001600160a01b03811662000064576040516335fdcccd60e21b81526000600482015260240160405180910390fd5b806001600160a01b03166080816001600160a01b03168152505050806001600160a01b031663e861e9076040518163ffffffff1660e01b8152600401602060405180830381865afa158015620000be573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620000e4919062000169565b6001600160a01b0390811660a081905260405163095ea7b360e01b8152918316600483015260001960248301529063095ea7b3906044016020604051808303816000875af11580156200013b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200016191906200019b565b5050620001bf565b6000602082840312156200017c57600080fd5b81516001600160a01b03811681146200019457600080fd5b9392505050565b600060208284031215620001ae57600080fd5b815180151581146200019457600080fd5b60805160a051611851620002476000396000818161014b015281816104030152818161059401528181610905015281816109cc01528181610a6401528181610b0201528181610bf70152610cbf0152600081816101d6015281816102df01528181610377015281816104ab0152818161060b015281816106ff01526107bf01526118516000f3fe6080604052600436106100745760003560e01c80634dbe7e921161004e5780634dbe7e921461013957806385572ffb1461019257806396f4e9f9146101b4578063b0f479a1146101c757600080fd5b806301ffc9a714610080578063181f5a77146100b557806320487ded1461010b57600080fd5b3661007b57005b600080fd5b34801561008c57600080fd5b506100a061009b3660046110e3565b6101fa565b60405190151581526020015b60405180910390f35b3480156100c157600080fd5b506100fe6040518060400160405280601981526020017f457468657253656e646572526563656976657220312e352e300000000000000081525081565b6040516100ac919061119a565b34801561011757600080fd5b5061012b6101263660046111e2565b610293565b6040519081526020016100ac565b34801561014557600080fd5b5061016d7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016100ac565b34801561019e57600080fd5b506101b26101ad366004611230565b61035f565b005b61012b6101c23660046111e2565b6103e9565b3480156101d357600080fd5b507f000000000000000000000000000000000000000000000000000000000000000061016d565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f85572ffb00000000000000000000000000000000000000000000000000000000148061028d57507fffffffff0000000000000000000000000000000000000000000000000000000082167f01ffc9a700000000000000000000000000000000000000000000000000000000145b92915050565b60008061029f83610844565b6040517f20487ded00000000000000000000000000000000000000000000000000000000815290915073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016906320487ded906103169087908590600401611265565b602060405180830381865afa158015610333573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610357919061137a565b949350505050565b3373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016146103d5576040517fd7f733340000000000000000000000000000000000000000000000000000000081523360048201526024015b60405180910390fd5b6103e66103e1826115c5565b610966565b50565b60006103f482610d38565b60006103ff83610844565b90507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663d0e30db0826040015160008151811061045457610454611672565b6020026020010151602001516040518263ffffffff1660e01b81526004016000604051808303818588803b15801561048b57600080fd5b505af115801561049f573d6000803e3d6000fd5b505050505060006104cd7f000000000000000000000000000000000000000000000000000000000000000090565b73ffffffffffffffffffffffffffffffffffffffff166320487ded86846040518363ffffffff1660e01b8152600401610507929190611265565b602060405180830381865afa158015610524573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610548919061137a565b606083015190915073ffffffffffffffffffffffffffffffffffffffff16156107825760608201516105929073ffffffffffffffffffffffffffffffffffffffff16333084610df0565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16826060015173ffffffffffffffffffffffffffffffffffffffff16146106c257606082015173ffffffffffffffffffffffffffffffffffffffff1663095ea7b37f00000000000000000000000000000000000000000000000000000000000000006040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b16815273ffffffffffffffffffffffffffffffffffffffff9091166004820152602481018490526044016020604051808303816000875af115801561069c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106c091906116a1565b505b6040517f96f4e9f900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016906396f4e9f9906107369088908690600401611265565b6020604051808303816000875af1158015610755573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610779919061137a565b9250505061028d565b6040517f96f4e9f900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016906396f4e9f99047906107f89089908790600401611265565b60206040518083038185885af1158015610816573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061083b919061137a565b95945050505050565b61088c6040518060a00160405280606081526020016060815260200160608152602001600073ffffffffffffffffffffffffffffffffffffffff168152602001606081525090565b6000610897836116c3565b90508060400151516001146108e1578060400151516040517f83b9f0ae0000000000000000000000000000000000000000000000000000000081526004016103cc91815260200190565b604080513360208201520160405160208183030381529060405281602001819052507f0000000000000000000000000000000000000000000000000000000000000000816040015160008151811061093b5761093b611672565b602090810291909101015173ffffffffffffffffffffffffffffffffffffffff909116905292915050565b60008160600151806020019051810190610980919061177f565b90508160800151516001146109ca578160800151516040517f83b9f0ae0000000000000000000000000000000000000000000000000000000081526004016103cc91815260200190565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168260800151600081518110610a1857610a18611672565b60200260200101516000015173ffffffffffffffffffffffffffffffffffffffff1614610ad9578160800151600081518110610a5657610a56611672565b6020026020010151600001517f00000000000000000000000000000000000000000000000000000000000000006040517f0fc746a10000000000000000000000000000000000000000000000000000000081526004016103cc92919073ffffffffffffffffffffffffffffffffffffffff92831681529116602082015260400190565b60008260800151600081518110610af257610af2611672565b60200260200101516020015190507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16632e1a7d4d826040518263ffffffff1660e01b8152600401610b5b91815260200190565b600060405180830381600087803b158015610b7557600080fd5b505af1158015610b89573d6000803e3d6000fd5b5050505060008273ffffffffffffffffffffffffffffffffffffffff168260405160006040518083038185875af1925050503d8060008114610be7576040519150601f19603f3d011682016040523d82523d6000602084013e610bec565b606091505b5050905080610d32577f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663d0e30db0836040518263ffffffff1660e01b81526004016000604051808303818588803b158015610c5d57600080fd5b505af1158015610c71573d6000803e3d6000fd5b50506040517fa9059cbb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8781166004830152602482018790527f000000000000000000000000000000000000000000000000000000000000000016935063a9059cbb925060440190506020604051808303816000875af1158015610d0c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d3091906116a1565b505b50505050565b6000610d47604083018361179c565b6000818110610d5857610d58611672565b905060400201602001359050600073ffffffffffffffffffffffffffffffffffffffff16826060016020810190610d8f919061180b565b73ffffffffffffffffffffffffffffffffffffffff1614610dec57803414610dec576040517fba2f7467000000000000000000000000000000000000000000000000000000008152600481018290523460248201526044016103cc565b5050565b6040805173ffffffffffffffffffffffffffffffffffffffff8581166024830152848116604483015260648083018590528351808403909101815260849092018352602080830180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f23b872dd0000000000000000000000000000000000000000000000000000000017905283518085019094528084527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c656490840152610d3292879291600091610ec3918516908490610f72565b805190915015610f6d5780806020019051810190610ee191906116a1565b610f6d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f7420737563636565640000000000000000000000000000000000000000000060648201526084016103cc565b505050565b60606103578484600085856000808673ffffffffffffffffffffffffffffffffffffffff168587604051610fa69190611828565b60006040518083038185875af1925050503d8060008114610fe3576040519150601f19603f3d011682016040523d82523d6000602084013e610fe8565b606091505b5091509150610ff987838387611004565b979650505050505050565b6060831561109a5782516000036110935773ffffffffffffffffffffffffffffffffffffffff85163b611093576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016103cc565b5081610357565b61035783838151156110af5781518083602001fd5b806040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103cc919061119a565b6000602082840312156110f557600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461112557600080fd5b9392505050565b60005b8381101561114757818101518382015260200161112f565b50506000910152565b6000815180845261116881602086016020860161112c565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b6020815260006111256020830184611150565b803567ffffffffffffffff811681146111c557600080fd5b919050565b600060a082840312156111dc57600080fd5b50919050565b600080604083850312156111f557600080fd5b6111fe836111ad565b9150602083013567ffffffffffffffff81111561121a57600080fd5b611226858286016111ca565b9150509250929050565b60006020828403121561124257600080fd5b813567ffffffffffffffff81111561125957600080fd5b610357848285016111ca565b6000604067ffffffffffffffff851683526020604081850152845160a0604086015261129460e0860182611150565b9050818601517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0808784030160608801526112cf8383611150565b6040890151888203830160808a01528051808352908601945060009350908501905b80841015611330578451805173ffffffffffffffffffffffffffffffffffffffff168352860151868301529385019360019390930192908601906112f1565b50606089015173ffffffffffffffffffffffffffffffffffffffff1660a08901526080890151888203830160c08a0152955061136c8187611150565b9a9950505050505050505050565b60006020828403121561138c57600080fd5b5051919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040805190810167ffffffffffffffff811182821017156113e5576113e5611393565b60405290565b60405160a0810167ffffffffffffffff811182821017156113e5576113e5611393565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff8111828210171561145557611455611393565b604052919050565b600082601f83011261146e57600080fd5b813567ffffffffffffffff81111561148857611488611393565b6114b960207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8401160161140e565b8181528460208386010111156114ce57600080fd5b816020850160208301376000918101602001919091529392505050565b73ffffffffffffffffffffffffffffffffffffffff811681146103e657600080fd5b80356111c5816114eb565b600082601f83011261152957600080fd5b8135602067ffffffffffffffff82111561154557611545611393565b611553818360051b0161140e565b82815260069290921b8401810191818101908684111561157257600080fd5b8286015b848110156115ba576040818903121561158f5760008081fd5b6115976113c2565b81356115a2816114eb565b81528185013585820152835291830191604001611576565b509695505050505050565b600060a082360312156115d757600080fd5b6115df6113eb565b823581526115ef602084016111ad565b6020820152604083013567ffffffffffffffff8082111561160f57600080fd5b61161b3683870161145d565b6040840152606085013591508082111561163457600080fd5b6116403683870161145d565b6060840152608085013591508082111561165957600080fd5b5061166636828601611518565b60808301525092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000602082840312156116b357600080fd5b8151801515811461112557600080fd5b600060a082360312156116d557600080fd5b6116dd6113eb565b823567ffffffffffffffff808211156116f557600080fd5b6117013683870161145d565b8352602085013591508082111561171757600080fd5b6117233683870161145d565b6020840152604085013591508082111561173c57600080fd5b61174836838701611518565b60408401526117596060860161150d565b6060840152608085013591508082111561177257600080fd5b506116663682860161145d565b60006020828403121561179157600080fd5b8151611125816114eb565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe18436030181126117d157600080fd5b83018035915067ffffffffffffffff8211156117ec57600080fd5b6020019150600681901b360382131561180457600080fd5b9250929050565b60006020828403121561181d57600080fd5b8135611125816114eb565b6000825161183a81846020870161112c565b919091019291505056fea164736f6c6343000818000a", +} + +var EtherSenderReceiverABI = EtherSenderReceiverMetaData.ABI + +var EtherSenderReceiverBin = EtherSenderReceiverMetaData.Bin + +func DeployEtherSenderReceiver(auth *bind.TransactOpts, backend bind.ContractBackend, router common.Address) (common.Address, *types.Transaction, *EtherSenderReceiver, error) { + parsed, err := EtherSenderReceiverMetaData.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(EtherSenderReceiverBin), backend, router) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &EtherSenderReceiver{address: address, abi: *parsed, EtherSenderReceiverCaller: EtherSenderReceiverCaller{contract: contract}, EtherSenderReceiverTransactor: EtherSenderReceiverTransactor{contract: contract}, EtherSenderReceiverFilterer: EtherSenderReceiverFilterer{contract: contract}}, nil +} + +type EtherSenderReceiver struct { + address common.Address + abi abi.ABI + EtherSenderReceiverCaller + EtherSenderReceiverTransactor + EtherSenderReceiverFilterer +} + +type EtherSenderReceiverCaller struct { + contract *bind.BoundContract +} + +type EtherSenderReceiverTransactor struct { + contract *bind.BoundContract +} + +type EtherSenderReceiverFilterer struct { + contract *bind.BoundContract +} + +type EtherSenderReceiverSession struct { + Contract *EtherSenderReceiver + CallOpts bind.CallOpts + TransactOpts bind.TransactOpts +} + +type EtherSenderReceiverCallerSession struct { + Contract *EtherSenderReceiverCaller + CallOpts bind.CallOpts +} + +type EtherSenderReceiverTransactorSession struct { + Contract *EtherSenderReceiverTransactor + TransactOpts bind.TransactOpts +} + +type EtherSenderReceiverRaw struct { + Contract *EtherSenderReceiver +} + +type EtherSenderReceiverCallerRaw struct { + Contract *EtherSenderReceiverCaller +} + +type EtherSenderReceiverTransactorRaw struct { + Contract *EtherSenderReceiverTransactor +} + +func NewEtherSenderReceiver(address common.Address, backend bind.ContractBackend) (*EtherSenderReceiver, error) { + abi, err := abi.JSON(strings.NewReader(EtherSenderReceiverABI)) + if err != nil { + return nil, err + } + contract, err := bindEtherSenderReceiver(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &EtherSenderReceiver{address: address, abi: abi, EtherSenderReceiverCaller: EtherSenderReceiverCaller{contract: contract}, EtherSenderReceiverTransactor: EtherSenderReceiverTransactor{contract: contract}, EtherSenderReceiverFilterer: EtherSenderReceiverFilterer{contract: contract}}, nil +} + +func NewEtherSenderReceiverCaller(address common.Address, caller bind.ContractCaller) (*EtherSenderReceiverCaller, error) { + contract, err := bindEtherSenderReceiver(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &EtherSenderReceiverCaller{contract: contract}, nil +} + +func NewEtherSenderReceiverTransactor(address common.Address, transactor bind.ContractTransactor) (*EtherSenderReceiverTransactor, error) { + contract, err := bindEtherSenderReceiver(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &EtherSenderReceiverTransactor{contract: contract}, nil +} + +func NewEtherSenderReceiverFilterer(address common.Address, filterer bind.ContractFilterer) (*EtherSenderReceiverFilterer, error) { + contract, err := bindEtherSenderReceiver(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &EtherSenderReceiverFilterer{contract: contract}, nil +} + +func bindEtherSenderReceiver(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := EtherSenderReceiverMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +func (_EtherSenderReceiver *EtherSenderReceiverRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _EtherSenderReceiver.Contract.EtherSenderReceiverCaller.contract.Call(opts, result, method, params...) +} + +func (_EtherSenderReceiver *EtherSenderReceiverRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _EtherSenderReceiver.Contract.EtherSenderReceiverTransactor.contract.Transfer(opts) +} + +func (_EtherSenderReceiver *EtherSenderReceiverRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _EtherSenderReceiver.Contract.EtherSenderReceiverTransactor.contract.Transact(opts, method, params...) +} + +func (_EtherSenderReceiver *EtherSenderReceiverCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _EtherSenderReceiver.Contract.contract.Call(opts, result, method, params...) +} + +func (_EtherSenderReceiver *EtherSenderReceiverTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _EtherSenderReceiver.Contract.contract.Transfer(opts) +} + +func (_EtherSenderReceiver *EtherSenderReceiverTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _EtherSenderReceiver.Contract.contract.Transact(opts, method, params...) +} + +func (_EtherSenderReceiver *EtherSenderReceiverCaller) GetFee(opts *bind.CallOpts, destinationChainSelector uint64, message ClientEVM2AnyMessage) (*big.Int, error) { + var out []interface{} + err := _EtherSenderReceiver.contract.Call(opts, &out, "getFee", destinationChainSelector, message) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_EtherSenderReceiver *EtherSenderReceiverSession) GetFee(destinationChainSelector uint64, message ClientEVM2AnyMessage) (*big.Int, error) { + return _EtherSenderReceiver.Contract.GetFee(&_EtherSenderReceiver.CallOpts, destinationChainSelector, message) +} + +func (_EtherSenderReceiver *EtherSenderReceiverCallerSession) GetFee(destinationChainSelector uint64, message ClientEVM2AnyMessage) (*big.Int, error) { + return _EtherSenderReceiver.Contract.GetFee(&_EtherSenderReceiver.CallOpts, destinationChainSelector, message) +} + +func (_EtherSenderReceiver *EtherSenderReceiverCaller) GetRouter(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _EtherSenderReceiver.contract.Call(opts, &out, "getRouter") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_EtherSenderReceiver *EtherSenderReceiverSession) GetRouter() (common.Address, error) { + return _EtherSenderReceiver.Contract.GetRouter(&_EtherSenderReceiver.CallOpts) +} + +func (_EtherSenderReceiver *EtherSenderReceiverCallerSession) GetRouter() (common.Address, error) { + return _EtherSenderReceiver.Contract.GetRouter(&_EtherSenderReceiver.CallOpts) +} + +func (_EtherSenderReceiver *EtherSenderReceiverCaller) IWeth(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _EtherSenderReceiver.contract.Call(opts, &out, "i_weth") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_EtherSenderReceiver *EtherSenderReceiverSession) IWeth() (common.Address, error) { + return _EtherSenderReceiver.Contract.IWeth(&_EtherSenderReceiver.CallOpts) +} + +func (_EtherSenderReceiver *EtherSenderReceiverCallerSession) IWeth() (common.Address, error) { + return _EtherSenderReceiver.Contract.IWeth(&_EtherSenderReceiver.CallOpts) +} + +func (_EtherSenderReceiver *EtherSenderReceiverCaller) SupportsInterface(opts *bind.CallOpts, interfaceId [4]byte) (bool, error) { + var out []interface{} + err := _EtherSenderReceiver.contract.Call(opts, &out, "supportsInterface", interfaceId) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_EtherSenderReceiver *EtherSenderReceiverSession) SupportsInterface(interfaceId [4]byte) (bool, error) { + return _EtherSenderReceiver.Contract.SupportsInterface(&_EtherSenderReceiver.CallOpts, interfaceId) +} + +func (_EtherSenderReceiver *EtherSenderReceiverCallerSession) SupportsInterface(interfaceId [4]byte) (bool, error) { + return _EtherSenderReceiver.Contract.SupportsInterface(&_EtherSenderReceiver.CallOpts, interfaceId) +} + +func (_EtherSenderReceiver *EtherSenderReceiverCaller) TypeAndVersion(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _EtherSenderReceiver.contract.Call(opts, &out, "typeAndVersion") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +func (_EtherSenderReceiver *EtherSenderReceiverSession) TypeAndVersion() (string, error) { + return _EtherSenderReceiver.Contract.TypeAndVersion(&_EtherSenderReceiver.CallOpts) +} + +func (_EtherSenderReceiver *EtherSenderReceiverCallerSession) TypeAndVersion() (string, error) { + return _EtherSenderReceiver.Contract.TypeAndVersion(&_EtherSenderReceiver.CallOpts) +} + +func (_EtherSenderReceiver *EtherSenderReceiverTransactor) CcipReceive(opts *bind.TransactOpts, message ClientAny2EVMMessage) (*types.Transaction, error) { + return _EtherSenderReceiver.contract.Transact(opts, "ccipReceive", message) +} + +func (_EtherSenderReceiver *EtherSenderReceiverSession) CcipReceive(message ClientAny2EVMMessage) (*types.Transaction, error) { + return _EtherSenderReceiver.Contract.CcipReceive(&_EtherSenderReceiver.TransactOpts, message) +} + +func (_EtherSenderReceiver *EtherSenderReceiverTransactorSession) CcipReceive(message ClientAny2EVMMessage) (*types.Transaction, error) { + return _EtherSenderReceiver.Contract.CcipReceive(&_EtherSenderReceiver.TransactOpts, message) +} + +func (_EtherSenderReceiver *EtherSenderReceiverTransactor) CcipSend(opts *bind.TransactOpts, destinationChainSelector uint64, message ClientEVM2AnyMessage) (*types.Transaction, error) { + return _EtherSenderReceiver.contract.Transact(opts, "ccipSend", destinationChainSelector, message) +} + +func (_EtherSenderReceiver *EtherSenderReceiverSession) CcipSend(destinationChainSelector uint64, message ClientEVM2AnyMessage) (*types.Transaction, error) { + return _EtherSenderReceiver.Contract.CcipSend(&_EtherSenderReceiver.TransactOpts, destinationChainSelector, message) +} + +func (_EtherSenderReceiver *EtherSenderReceiverTransactorSession) CcipSend(destinationChainSelector uint64, message ClientEVM2AnyMessage) (*types.Transaction, error) { + return _EtherSenderReceiver.Contract.CcipSend(&_EtherSenderReceiver.TransactOpts, destinationChainSelector, message) +} + +func (_EtherSenderReceiver *EtherSenderReceiverTransactor) Receive(opts *bind.TransactOpts) (*types.Transaction, error) { + return _EtherSenderReceiver.contract.RawTransact(opts, nil) +} + +func (_EtherSenderReceiver *EtherSenderReceiverSession) Receive() (*types.Transaction, error) { + return _EtherSenderReceiver.Contract.Receive(&_EtherSenderReceiver.TransactOpts) +} + +func (_EtherSenderReceiver *EtherSenderReceiverTransactorSession) Receive() (*types.Transaction, error) { + return _EtherSenderReceiver.Contract.Receive(&_EtherSenderReceiver.TransactOpts) +} + +func (_EtherSenderReceiver *EtherSenderReceiver) Address() common.Address { + return _EtherSenderReceiver.address +} + +type EtherSenderReceiverInterface interface { + GetFee(opts *bind.CallOpts, destinationChainSelector uint64, message ClientEVM2AnyMessage) (*big.Int, error) + + GetRouter(opts *bind.CallOpts) (common.Address, error) + + IWeth(opts *bind.CallOpts) (common.Address, error) + + SupportsInterface(opts *bind.CallOpts, interfaceId [4]byte) (bool, error) + + TypeAndVersion(opts *bind.CallOpts) (string, error) + + CcipReceive(opts *bind.TransactOpts, message ClientAny2EVMMessage) (*types.Transaction, error) + + CcipSend(opts *bind.TransactOpts, destinationChainSelector uint64, message ClientEVM2AnyMessage) (*types.Transaction, error) + + Receive(opts *bind.TransactOpts) (*types.Transaction, error) + + Address() common.Address +} diff --git a/core/gethwrappers/ccip/generated/evm_2_evm_offramp/evm_2_evm_offramp.go b/core/gethwrappers/ccip/generated/evm_2_evm_offramp/evm_2_evm_offramp.go new file mode 100644 index 00000000000..d1bfc5b47a8 --- /dev/null +++ b/core/gethwrappers/ccip/generated/evm_2_evm_offramp/evm_2_evm_offramp.go @@ -0,0 +1,2805 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package evm_2_evm_offramp + +import ( + "errors" + "fmt" + "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" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" +) + +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +type ClientAny2EVMMessage struct { + MessageId [32]byte + SourceChainSelector uint64 + Sender []byte + Data []byte + DestTokenAmounts []ClientEVMTokenAmount +} + +type ClientEVMTokenAmount struct { + Token common.Address + Amount *big.Int +} + +type EVM2EVMOffRampDynamicConfig struct { + PermissionLessExecutionThresholdSeconds uint32 + MaxDataBytes uint32 + MaxNumberOfTokensPerMsg uint16 + Router common.Address + PriceRegistry common.Address +} + +type EVM2EVMOffRampGasLimitOverride struct { + ReceiverExecutionGasLimit *big.Int + TokenGasOverrides []uint32 +} + +type EVM2EVMOffRampRateLimitToken struct { + SourceToken common.Address + DestToken common.Address +} + +type EVM2EVMOffRampStaticConfig struct { + CommitStore common.Address + ChainSelector uint64 + SourceChainSelector uint64 + OnRamp common.Address + PrevOffRamp common.Address + RmnProxy common.Address + TokenAdminRegistry common.Address +} + +type InternalEVM2EVMMessage struct { + SourceChainSelector uint64 + Sender common.Address + Receiver common.Address + SequenceNumber uint64 + GasLimit *big.Int + Strict bool + Nonce uint64 + FeeToken common.Address + FeeTokenAmount *big.Int + Data []byte + TokenAmounts []ClientEVMTokenAmount + SourceTokenData [][]byte + MessageId [32]byte +} + +type InternalExecutionReport struct { + Messages []InternalEVM2EVMMessage + OffchainTokenData [][][]byte + Proofs [][32]byte + ProofFlagBits *big.Int +} + +type RateLimiterConfig struct { + IsEnabled bool + Capacity *big.Int + Rate *big.Int +} + +type RateLimiterTokenBucket struct { + Tokens *big.Int + LastUpdated uint32 + IsEnabled bool + Capacity *big.Int + Rate *big.Int +} + +var EVM2EVMOffRampMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"commitStore\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"onRamp\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"prevOffRamp\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"rmnProxy\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAdminRegistry\",\"type\":\"address\"}],\"internalType\":\"structEVM2EVMOffRamp.StaticConfig\",\"name\":\"staticConfig\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"rateLimiterConfig\",\"type\":\"tuple\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"capacity\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"requested\",\"type\":\"uint256\"}],\"name\":\"AggregateValueMaxCapacityExceeded\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"minWaitInSeconds\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"available\",\"type\":\"uint256\"}],\"name\":\"AggregateValueRateLimitReached\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"BucketOverfilled\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"CanOnlySelfCall\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"CommitStoreAlreadyInUse\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"expected\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"actual\",\"type\":\"bytes32\"}],\"name\":\"ConfigDigestMismatch\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"CursedByRMN\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"messageId\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"sequenceNumber\",\"type\":\"uint64\"}],\"name\":\"DestinationGasAmountCountMismatch\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"EmptyReport\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"err\",\"type\":\"bytes\"}],\"name\":\"ExecutionError\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expected\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"actual\",\"type\":\"uint256\"}],\"name\":\"ForkedChain\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"enumOCR2BaseNoChecks.InvalidConfigErrorType\",\"name\":\"errorType\",\"type\":\"uint8\"}],\"name\":\"InvalidConfig\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expected\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"got\",\"type\":\"uint256\"}],\"name\":\"InvalidDataLength\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"encodedAddress\",\"type\":\"bytes\"}],\"name\":\"InvalidEVMAddress\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"messageId\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"oldLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"newLimit\",\"type\":\"uint256\"}],\"name\":\"InvalidManualExecutionGasLimit\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidMessageId\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"sequenceNumber\",\"type\":\"uint64\"},{\"internalType\":\"enumInternal.MessageExecutionState\",\"name\":\"newState\",\"type\":\"uint8\"}],\"name\":\"InvalidNewState\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"}],\"name\":\"InvalidSourceChain\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"messageId\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"tokenIndex\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"oldLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"tokenGasOverride\",\"type\":\"uint256\"}],\"name\":\"InvalidTokenGasOverride\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ManualExecutionGasLimitMismatch\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ManualExecutionNotYetEnabled\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"maxSize\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"actualSize\",\"type\":\"uint256\"}],\"name\":\"MessageTooLarge\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"notPool\",\"type\":\"address\"}],\"name\":\"NotACompatiblePool\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCallableByAdminOrOwner\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OracleCannotBeZeroAddress\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"PriceNotFoundForToken\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"err\",\"type\":\"bytes\"}],\"name\":\"ReceiverError\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountReleased\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"balancePre\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"balancePost\",\"type\":\"uint256\"}],\"name\":\"ReleaseOrMintBalanceMismatch\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RootNotCommitted\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"sequenceNumber\",\"type\":\"uint64\"}],\"name\":\"TokenDataMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"err\",\"type\":\"bytes\"}],\"name\":\"TokenHandlingError\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"capacity\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"requested\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"}],\"name\":\"TokenMaxCapacityExceeded\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"minWaitInSeconds\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"available\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"}],\"name\":\"TokenRateLimitReached\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UnauthorizedTransmitter\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UnexpectedTokenData\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"sequenceNumber\",\"type\":\"uint64\"}],\"name\":\"UnsupportedNumberOfTokens\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expected\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"actual\",\"type\":\"uint256\"}],\"name\":\"WrongMessageLength\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddressNotAllowed\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"sequenceNumber\",\"type\":\"uint64\"}],\"name\":\"AlreadyAttempted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"indexed\":false,\"internalType\":\"structRateLimiter.Config\",\"name\":\"config\",\"type\":\"tuple\"}],\"name\":\"ConfigChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"commitStore\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"onRamp\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"prevOffRamp\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"rmnProxy\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAdminRegistry\",\"type\":\"address\"}],\"indexed\":false,\"internalType\":\"structEVM2EVMOffRamp.StaticConfig\",\"name\":\"staticConfig\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint32\",\"name\":\"permissionLessExecutionThresholdSeconds\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"maxDataBytes\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"maxNumberOfTokensPerMsg\",\"type\":\"uint16\"},{\"internalType\":\"address\",\"name\":\"router\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"priceRegistry\",\"type\":\"address\"}],\"indexed\":false,\"internalType\":\"structEVM2EVMOffRamp.DynamicConfig\",\"name\":\"dynamicConfig\",\"type\":\"tuple\"}],\"name\":\"ConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"previousConfigBlockNumber\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"configCount\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"signers\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"transmitters\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"f\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"onchainConfig\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"offchainConfigVersion\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"offchainConfig\",\"type\":\"bytes\"}],\"name\":\"ConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"sequenceNumber\",\"type\":\"uint64\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"messageId\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"enumInternal.MessageExecutionState\",\"name\":\"state\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"returnData\",\"type\":\"bytes\"}],\"name\":\"ExecutionStateChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"sequenceNumber\",\"type\":\"uint64\"}],\"name\":\"SkippedAlreadyExecutedMessage\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"nonce\",\"type\":\"uint64\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"SkippedIncorrectNonce\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"nonce\",\"type\":\"uint64\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"SkippedSenderWithPreviousRampMessageInflight\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"sourceToken\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"destToken\",\"type\":\"address\"}],\"name\":\"TokenAggregateRateLimitAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"sourceToken\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"destToken\",\"type\":\"address\"}],\"name\":\"TokenAggregateRateLimitRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"}],\"name\":\"TokensConsumed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"epoch\",\"type\":\"uint32\"}],\"name\":\"Transmitted\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"messageId\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"sender\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"internalType\":\"structClient.EVMTokenAmount[]\",\"name\":\"destTokenAmounts\",\"type\":\"tuple[]\"}],\"internalType\":\"structClient.Any2EVMMessage\",\"name\":\"\",\"type\":\"tuple\"}],\"name\":\"ccipReceive\",\"outputs\":[],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"currentRateLimiterState\",\"outputs\":[{\"components\":[{\"internalType\":\"uint128\",\"name\":\"tokens\",\"type\":\"uint128\"},{\"internalType\":\"uint32\",\"name\":\"lastUpdated\",\"type\":\"uint32\"},{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.TokenBucket\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"sequenceNumber\",\"type\":\"uint64\"},{\"internalType\":\"uint256\",\"name\":\"gasLimit\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"strict\",\"type\":\"bool\"},{\"internalType\":\"uint64\",\"name\":\"nonce\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"feeToken\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"feeTokenAmount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"internalType\":\"structClient.EVMTokenAmount[]\",\"name\":\"tokenAmounts\",\"type\":\"tuple[]\"},{\"internalType\":\"bytes[]\",\"name\":\"sourceTokenData\",\"type\":\"bytes[]\"},{\"internalType\":\"bytes32\",\"name\":\"messageId\",\"type\":\"bytes32\"}],\"internalType\":\"structInternal.EVM2EVMMessage\",\"name\":\"message\",\"type\":\"tuple\"},{\"internalType\":\"bytes[]\",\"name\":\"offchainTokenData\",\"type\":\"bytes[]\"},{\"internalType\":\"uint32[]\",\"name\":\"tokenGasOverrides\",\"type\":\"uint32[]\"}],\"name\":\"executeSingleMessage\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAllRateLimitTokens\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"sourceTokens\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"destTokens\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getDynamicConfig\",\"outputs\":[{\"components\":[{\"internalType\":\"uint32\",\"name\":\"permissionLessExecutionThresholdSeconds\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"maxDataBytes\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"maxNumberOfTokensPerMsg\",\"type\":\"uint16\"},{\"internalType\":\"address\",\"name\":\"router\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"priceRegistry\",\"type\":\"address\"}],\"internalType\":\"structEVM2EVMOffRamp.DynamicConfig\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"sequenceNumber\",\"type\":\"uint64\"}],\"name\":\"getExecutionState\",\"outputs\":[{\"internalType\":\"enumInternal.MessageExecutionState\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"getSenderNonce\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"nonce\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getStaticConfig\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"commitStore\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"onRamp\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"prevOffRamp\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"rmnProxy\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAdminRegistry\",\"type\":\"address\"}],\"internalType\":\"structEVM2EVMOffRamp.StaticConfig\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getTokenLimitAdmin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getTransmitters\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestConfigDetails\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"configCount\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"blockNumber\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestConfigDigestAndEpoch\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"scanLogs\",\"type\":\"bool\"},{\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"internalType\":\"uint32\",\"name\":\"epoch\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"sequenceNumber\",\"type\":\"uint64\"},{\"internalType\":\"uint256\",\"name\":\"gasLimit\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"strict\",\"type\":\"bool\"},{\"internalType\":\"uint64\",\"name\":\"nonce\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"feeToken\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"feeTokenAmount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"internalType\":\"structClient.EVMTokenAmount[]\",\"name\":\"tokenAmounts\",\"type\":\"tuple[]\"},{\"internalType\":\"bytes[]\",\"name\":\"sourceTokenData\",\"type\":\"bytes[]\"},{\"internalType\":\"bytes32\",\"name\":\"messageId\",\"type\":\"bytes32\"}],\"internalType\":\"structInternal.EVM2EVMMessage[]\",\"name\":\"messages\",\"type\":\"tuple[]\"},{\"internalType\":\"bytes[][]\",\"name\":\"offchainTokenData\",\"type\":\"bytes[][]\"},{\"internalType\":\"bytes32[]\",\"name\":\"proofs\",\"type\":\"bytes32[]\"},{\"internalType\":\"uint256\",\"name\":\"proofFlagBits\",\"type\":\"uint256\"}],\"internalType\":\"structInternal.ExecutionReport\",\"name\":\"report\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"receiverExecutionGasLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint32[]\",\"name\":\"tokenGasOverrides\",\"type\":\"uint32[]\"}],\"internalType\":\"structEVM2EVMOffRamp.GasLimitOverride[]\",\"name\":\"gasLimitOverrides\",\"type\":\"tuple[]\"}],\"name\":\"manuallyExecute\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"setAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"signers\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"transmitters\",\"type\":\"address[]\"},{\"internalType\":\"uint8\",\"name\":\"f\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"onchainConfig\",\"type\":\"bytes\"},{\"internalType\":\"uint64\",\"name\":\"offchainConfigVersion\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"offchainConfig\",\"type\":\"bytes\"}],\"name\":\"setOCR2Config\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"config\",\"type\":\"tuple\"}],\"name\":\"setRateLimiterConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32[3]\",\"name\":\"reportContext\",\"type\":\"bytes32[3]\"},{\"internalType\":\"bytes\",\"name\":\"report\",\"type\":\"bytes\"},{\"internalType\":\"bytes32[]\",\"name\":\"rs\",\"type\":\"bytes32[]\"},{\"internalType\":\"bytes32[]\",\"name\":\"ss\",\"type\":\"bytes32[]\"},{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"transmit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"sourceToken\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"destToken\",\"type\":\"address\"}],\"internalType\":\"structEVM2EVMOffRamp.RateLimitToken[]\",\"name\":\"removes\",\"type\":\"tuple[]\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"sourceToken\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"destToken\",\"type\":\"address\"}],\"internalType\":\"structEVM2EVMOffRamp.RateLimitToken[]\",\"name\":\"adds\",\"type\":\"tuple[]\"}],\"name\":\"updateRateLimitTokens\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", + Bin: "0x6101a06040523480156200001257600080fd5b506040516200660a3803806200660a8339810160408190526200003591620004ec565b8033806000816200008d5760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000c057620000c081620002ca565b50506040805160a081018252602084810180516001600160801b039081168085524263ffffffff169385018490528751151585870181905292518216606080870182905298909601519091166080948501819052600380546001600160a01b031916909217600160801b9485021760ff60a01b1916600160a01b90930292909217905502909117600455469052508201516001600160a01b031615806200016f575081516001600160a01b0316155b8062000186575060c08201516001600160a01b0316155b15620001a5576040516342bcdf7f60e11b815260040160405180910390fd5b81600001516001600160a01b0316634120fccd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015620001e8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200020e9190620005b5565b6001600160401b03166001146200023857604051636fc2a20760e11b815260040160405180910390fd5b81516001600160a01b0390811660a090815260408401516001600160401b0390811660c0908152602086015190911660e05260608501518316610100526080850151831661014052908401518216610160528301511661018052620002bd7f8acd72527118c8324937b1a42e02cd246697c3b633f1742f3cae11de233722b362000375565b6101205250620005da9050565b336001600160a01b03821603620003245760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640162000084565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b60008160c05160e05161010051604051602001620003bf94939291909384526001600160401b039283166020850152911660408301526001600160a01b0316606082015260800190565b604051602081830303815290604052805190602001209050919050565b60405160e081016001600160401b03811182821017156200040d57634e487b7160e01b600052604160045260246000fd5b60405290565b80516001600160a01b03811681146200042b57600080fd5b919050565b80516001600160401b03811681146200042b57600080fd5b80516001600160801b03811681146200042b57600080fd5b6000606082840312156200047357600080fd5b604051606081016001600160401b0381118282101715620004a457634e487b7160e01b600052604160045260246000fd5b806040525080915082518015158114620004bd57600080fd5b8152620004cd6020840162000448565b6020820152620004e06040840162000448565b60408201525092915050565b6000808284036101408112156200050257600080fd5b60e08112156200051157600080fd5b506200051c620003dc565b620005278462000413565b8152620005376020850162000430565b60208201526200054a6040850162000430565b60408201526200055d6060850162000413565b6060820152620005706080850162000413565b60808201526200058360a0850162000413565b60a08201526200059660c0850162000413565b60c08201529150620005ac8460e0850162000460565b90509250929050565b600060208284031215620005c857600080fd5b620005d38262000430565b9392505050565b60805160a05160c05160e0516101005161012051610140516101605161018051615f41620006c9600039600081816102ec01528181611c6a01526133920152600081816102bd01528181611c420152611f2701526000818161028e01528181610d8d01528181610df201528181611c18015281816124a4015261250e015260006120c601526000818161025f0152611bee0152600081816101ff0152611b9201526000818161022f01528181611bc601528181611ee40152818161303b01526134bf0152600081816101d001528181611b6d01526121ac015260008181611e3e0152611e8a0152615f416000f3fe608060405234801561001057600080fd5b50600436106101825760003560e01c806385572ffb116100d8578063afcb95d71161008c578063c92b283211610066578063c92b2832146105f3578063f077b59214610606578063f2fde38b1461061c57600080fd5b8063afcb95d7146105ad578063b1dc65a4146105cd578063b6113fce146105e057600080fd5b8063873504d7116100bd578063873504d7146105765780638926c4ee146105895780638da5cb5b1461059c57600080fd5b806385572ffb1461053c578063856c82471461054a57600080fd5b8063599f64311161013a5780637437ff9f116101145780637437ff9f1461046157806379ba50971461050457806381ff70481461050c57600080fd5b8063599f643114610414578063666cab8d14610439578063704b6c021461044e57600080fd5b8063181f5a771161016b578063181f5a77146103525780631ef381741461039b578063546719cd146103b057600080fd5b806306285c6914610187578063142a98fc14610332575b600080fd5b61031c6040805160e081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c08101919091526040518060e001604052807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031681526020017f000000000000000000000000000000000000000000000000000000000000000067ffffffffffffffff1681526020017f000000000000000000000000000000000000000000000000000000000000000067ffffffffffffffff1681526020017f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031681526020017f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031681526020017f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031681526020017f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316815250905090565b6040516103299190614312565b60405180910390f35b6103456103403660046143a8565b61062f565b6040516103299190614408565b61038e6040518060400160405280601481526020017f45564d3245564d4f666652616d7020312e352e3000000000000000000000000081525081565b6040516103299190614466565b6103ae6103a936600461468f565b6106aa565b005b6103b8610a9e565b604051610329919081516fffffffffffffffffffffffffffffffff908116825260208084015163ffffffff1690830152604080840151151590830152606080840151821690830152608092830151169181019190915260a00190565b6002546001600160a01b03165b6040516001600160a01b039091168152602001610329565b610441610b53565b60405161032991906147a1565b6103ae61045c3660046147b4565b610bb5565b6104f76040805160a081018252600080825260208201819052918101829052606081018290526080810191909152506040805160a081018252600a5463ffffffff8082168352640100000000820416602083015268010000000000000000810461ffff16928201929092526a01000000000000000000009091046001600160a01b039081166060830152600b5416608082015290565b60405161032991906147d1565b6103ae610c7e565b6007546005546040805163ffffffff80851682526401000000009094049093166020840152820152606001610329565b6103ae610182366004614827565b61055d6105583660046147b4565b610d61565b60405167ffffffffffffffff9091168152602001610329565b6103ae6105843660046148f3565b610e64565b6103ae610597366004614e1e565b611037565b6000546001600160a01b0316610421565b604080516001815260006020820181905291810191909152606001610329565b6103ae6105db366004614f75565b61129c565b6103ae6105ee36600461505a565b6114a7565b6103ae610601366004615111565b6117e7565b61060e611852565b60405161032992919061517f565b6103ae61062a3660046147b4565b611978565b600061063d600160046151d3565b600261064a608085615215565b67ffffffffffffffff1661065e919061523c565b6010600061066d608087615253565b67ffffffffffffffff1667ffffffffffffffff16815260200190815260200160002054901c1660038111156106a4576106a46143c5565b92915050565b84518460ff16601f8211156106f75760016040517f367f56a20000000000000000000000000000000000000000000000000000000081526004016106ee919061527a565b60405180910390fd5b806000036107345760006040517f367f56a20000000000000000000000000000000000000000000000000000000081526004016106ee919061527a565b61073c611989565b610745856119ff565b60095460005b818110156107bc57600860006009838154811061076a5761076a615294565b60009182526020808320909101546001600160a01b03168352820192909252604001902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000016905560010161074b565b5050865160005b8181101561095f5760008982815181106107df576107df615294565b60200260200101519050600060028111156107fc576107fc6143c5565b6001600160a01b038216600090815260086020526040902054610100900460ff16600281111561082e5761082e6143c5565b146108685760026040517f367f56a20000000000000000000000000000000000000000000000000000000081526004016106ee919061527a565b6001600160a01b0381166108a8576040517fd6c62c9b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040805180820190915260ff8316815260208101600290526001600160a01b03821660009081526008602090815260409091208251815460ff9091167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0082168117835592840151919283917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000161761010083600281111561094b5761094b6143c5565b0217905550905050508060010190506107c3565b5087516109739060099060208b0190614280565b506006805460ff838116610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000909216908a1617179055600780546109f99146913091906000906109cb9063ffffffff166152c3565b91906101000a81548163ffffffff021916908363ffffffff160217905563ffffffff168c8c8c8c8c8c611cc9565b6005819055600780544363ffffffff9081166401000000009081027fffffffffffffffffffffffffffffffffffffffffffffffff00000000ffffffff841681179094556040519083048216947f1591690b8638f5fb2dbec82ac741805ac5da8b45dc5263f4875b0496fdce4e0594610a8a9487949293918316921691909117908f908f908f908f908f908f906152e6565b60405180910390a150505050505050505050565b6040805160a0810182526000808252602082018190529181018290526060810182905260808101919091526040805160a0810182526003546fffffffffffffffffffffffffffffffff808216835270010000000000000000000000000000000080830463ffffffff1660208501527401000000000000000000000000000000000000000090920460ff161515938301939093526004548084166060840152049091166080820152610b4e90611d56565b905090565b60606009805480602002602001604051908101604052809291908181526020018280548015610bab57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610b8d575b5050505050905090565b6000546001600160a01b03163314801590610bdb57506002546001600160a01b03163314155b15610c12576040517ff6cd562000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600280547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0383169081179091556040519081527f8fe72c3e0020beb3234e76ae6676fa576fbfcae600af1c4fea44784cf0db329c9060200160405180910390a150565b6001546001600160a01b03163314610cf2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e65720000000000000000000060448201526064016106ee565b60008054337fffffffffffffffffffffffff0000000000000000000000000000000000000000808316821784556001805490911690556040516001600160a01b0390921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b6001600160a01b0381166000908152600f602052604081205467ffffffffffffffff168082036106a4577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316156106a4576040517f856c82470000000000000000000000000000000000000000000000000000000081526001600160a01b0384811660048301527f0000000000000000000000000000000000000000000000000000000000000000169063856c824790602401602060405180830381865afa158015610e39573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e5d919061537c565b9392505050565b610e6c611989565b60005b8251811015610f3f57610ea9838281518110610e8d57610e8d615294565b602002602001015160200151600c611e0890919063ffffffff16565b15610f37577fcbf3cbeaed4ac1d605ed30f4af06c35acaeff2379db7f6146c9cceee83d58782838281518110610ee157610ee1615294565b602002602001015160000151848381518110610eff57610eff615294565b602002602001015160200151604051610f2e9291906001600160a01b0392831681529116602082015260400190565b60405180910390a15b600101610e6f565b5060005b815181101561103257610f9c828281518110610f6157610f61615294565b602002602001015160200151838381518110610f7f57610f7f615294565b602002602001015160000151600c611e1d9092919063ffffffff16565b1561102a577ffc23abf7ddbd3c02b1420dafa2355c56c1a06fbb8723862ac14d6bd74177361a828281518110610fd457610fd4615294565b602002602001015160000151838381518110610ff257610ff2615294565b6020026020010151602001516040516110219291906001600160a01b0392831681529116602082015260400190565b60405180910390a15b600101610f43565b505050565b61103f611e3b565b8151518151811461107c576040517f83e3f56400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b818110156112915760008460000151828151811061109f5761109f615294565b6020026020010151905060008483815181106110bd576110bd615294565b60209081029190910101518051909150801561112c57826080015181101561112c5761018083015160808401516040517f9c6db58d00000000000000000000000000000000000000000000000000000000815260048101929092526024820152604481018290526064016106ee565b816020015151836101400151511461118e5761018083015160608401516040517f85d2e5bf000000000000000000000000000000000000000000000000000000008152600481019290925267ffffffffffffffff1660248201526044016106ee565b61016083015160005b846101400151518110156112815760008287815181106111b9576111b9615294565b60200260200101518060200190518101906111d491906153de565b90506000856020015183815181106111ee576111ee615294565b602002602001015163ffffffff169050806000141580156112185750816060015163ffffffff1681105b156112775761018087015160608301516040517fef0c635200000000000000000000000000000000000000000000000000000000815260048101929092526024820185905263ffffffff166044820152606481018290526084016106ee565b5050600101611197565b505050505080600101905061107f565b506110328383611ebc565b6112a6878761290f565b6005548835908082146112ef576040517f93df584c00000000000000000000000000000000000000000000000000000000815260048101829052602481018390526044016106ee565b6112f7611e3b565b6040805183815260208c81013560081c63ffffffff16908201527fb04e63db38c49950639fa09d29872f21f5d49d614f3a969d8adf3d4b52e41a62910160405180910390a13360009081526008602090815260408083208151808301909252805460ff8082168452929391929184019161010090910416600281111561137f5761137f6143c5565b6002811115611390576113906143c5565b90525090506002816020015160028111156113ad576113ad6143c5565b1480156113e757506009816000015160ff16815481106113cf576113cf615294565b6000918252602090912001546001600160a01b031633145b61141d576040517fda0f08e800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50600061142b85602061523c565b61143688602061523c565b6114428b6101446154aa565b61144c91906154aa565b61145691906154aa565b905036811461149a576040517f8e1192e1000000000000000000000000000000000000000000000000000000008152600481018290523660248201526044016106ee565b5050505050505050505050565b3330146114e0576040517f371a732800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b604080516000808252602082019092528161151d565b60408051808201909152600080825260208201528152602001906001900390816114f65790505b50905060006115306101408701876154bd565b905011156115a7576115a46115496101408701876154bd565b6115596040890160208a016147b4565b604080516001600160a01b0390921660208301520160408051601f1981840301815291815261158e9060608b01908b016147b4565b61159c6101608b018b615525565b8a8a8a612966565b90505b6115b561012086018661558d565b15905080156115c657506080850135155b806115e857506115dc60608601604087016147b4565b6001600160a01b03163b155b8061163357506116317f85572ffb0000000000000000000000000000000000000000000000000000000061162260608801604089016147b4565b6001600160a01b031690612b8f565b155b1561163e57506117e1565b600a546040805160a08101909152610180870135815260009182916a01000000000000000000009091046001600160a01b031690633cf979839060208082019061168a908c018c6143a8565b67ffffffffffffffff1681526020018a60200160208101906116ac91906147b4565b604080516001600160a01b0390921660208301520160408051601f1981840301815291905281526020016116e46101208c018c61558d565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050509082525060200186905261138860808b013561173960608d0160408e016147b4565b6040518563ffffffff1660e01b81526004016117589493929190615637565b6000604051808303816000875af1158015611777573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261179f91908101906156fc565b5091509150816117dd57806040517f0a8d6e8c0000000000000000000000000000000000000000000000000000000081526004016106ee9190614466565b5050505b50505050565b6000546001600160a01b0316331480159061180d57506002546001600160a01b03163314155b15611844576040517ff6cd562000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61184f600382612bab565b50565b6060806000611861600c612d90565b90508067ffffffffffffffff81111561187c5761187c614479565b6040519080825280602002602001820160405280156118a5578160200160208202803683370190505b5092508067ffffffffffffffff8111156118c1576118c1614479565b6040519080825280602002602001820160405280156118ea578160200160208202803683370190505b50915060005b8181101561197257600080611906600c84612d9b565b915091508086848151811061191d5761191d615294565b60200260200101906001600160a01b031690816001600160a01b0316815250508185848151811061195057611950615294565b6001600160a01b039092166020928302919091019091015250506001016118f0565b50509091565b611980611989565b61184f81612db9565b6000546001600160a01b031633146119fd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e65720000000000000000000060448201526064016106ee565b565b600081806020019051810190611a159190615756565b60608101519091506001600160a01b0316611a5c576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8051600a805460208085015160408087015160608089015163ffffffff9889167fffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000909716969096176401000000009890941697909702929092177fffff00000000000000000000000000000000000000000000ffffffffffffffff166801000000000000000061ffff909316929092027fffff0000000000000000000000000000000000000000ffffffffffffffffffff16919091176a01000000000000000000006001600160a01b039485160217909355608080860151600b80547fffffffffffffffffffffffff000000000000000000000000000000000000000016918516919091179055835160e0810185527f0000000000000000000000000000000000000000000000000000000000000000841681527f000000000000000000000000000000000000000000000000000000000000000067ffffffffffffffff908116938201939093527f0000000000000000000000000000000000000000000000000000000000000000909216828501527f00000000000000000000000000000000000000000000000000000000000000008316948201949094527f00000000000000000000000000000000000000000000000000000000000000008216938101939093527f0000000000000000000000000000000000000000000000000000000000000000811660a08401527f00000000000000000000000000000000000000000000000000000000000000001660c0830152517f7879e20bb60a503429de4a2c912b5904f08a39f2af054c10fb46434b5d61126091611cbd9184906157f5565b60405180910390a15050565b6000808a8a8a8a8a8a8a8a8a604051602001611ced999897969594939291906158b7565b60408051601f1981840301815291905280516020909101207dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167e01000000000000000000000000000000000000000000000000000000000000179150509998505050505050505050565b6040805160a081018252600080825260208201819052918101829052606081018290526080810191909152611de482606001516fffffffffffffffffffffffffffffffff1683600001516fffffffffffffffffffffffffffffffff16846020015163ffffffff1642611dc891906151d3565b85608001516fffffffffffffffffffffffffffffffff16612e94565b6fffffffffffffffffffffffffffffffff1682525063ffffffff4216602082015290565b6000610e5d836001600160a01b038416612ebc565b6000611e33846001600160a01b03851684612ec8565b949350505050565b467f0000000000000000000000000000000000000000000000000000000000000000146119fd576040517f0f01ce850000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000060048201524660248201526044016106ee565b6040517f2cbc26bb0000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000060801b77ffffffffffffffff000000000000000000000000000000001660048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690632cbc26bb90602401602060405180830381865afa158015611f76573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f9a919061593f565b15611fd1576040517f53ad11d800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b815151600081900361200e576040517ebf199700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b826020015151811461204c576040517f57e0e08300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008167ffffffffffffffff81111561206757612067614479565b604051908082528060200260200182016040528015612090578160200160208202803683370190505b50905060005b82811015612168576000856000015182815181106120b6576120b6615294565b602002602001015190506120ea817f0000000000000000000000000000000000000000000000000000000000000000612ede565b8383815181106120fc576120fc615294565b60200260200101818152505080610180015183838151811061212057612120615294565b60200260200101511461215f576040517f7185cf6b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50600101612096565b508251604080860151606087015191517f32048875000000000000000000000000000000000000000000000000000000008152921515926000926001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016926332048875926121e29288929160040161598d565b602060405180830381865afa1580156121ff573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061222391906159c3565b90508060000361225f576040517fea75680100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b848110156117dd5760008760000151828151811061228257612282615294565b60200260200101519050600061229b826060015161062f565b905060008160038111156122b1576122b16143c5565b14806122ce575060038160038111156122cc576122cc6143c5565b145b61231457816060015167ffffffffffffffff167fe3dd0bec917c965a133ddb2c84874725ee1e2fd8d763c19efa36d6a11cd82b1f60405160405180910390a25050612907565b606085156123fa5788848151811061232e5761232e615294565b6020908102919091018101510151600a5490915060009063ffffffff1661235587426151d3565b119050808061237557506003836003811115612373576123736143c5565b145b6123ab576040517f6358b0d000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8985815181106123bd576123bd615294565b6020026020010151600001516000146123f4578985815181106123e2576123e2615294565b60209081029190910101515160808501525b5061245e565b600082600381111561240e5761240e6143c5565b1461245e57606083015160405167ffffffffffffffff90911681527f67d9ba0f63d427c482c2736300e6d5a34c6691dbcdea8ad35828a1f1ba47e8729060200160405180910390a1505050612907565b60c083015167ffffffffffffffff16156126df576020808401516001600160a01b03166000908152600f909152604081205467ffffffffffffffff1690819003612649577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316156126495760208401516040517f856c82470000000000000000000000000000000000000000000000000000000081526001600160a01b0391821660048201527f00000000000000000000000000000000000000000000000000000000000000009091169063856c824790602401602060405180830381865afa158015612557573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061257b919061537c565b60c085015190915067ffffffffffffffff166125988260016159dc565b67ffffffffffffffff16146125f95783602001516001600160a01b03168460c0015167ffffffffffffffff167fe44a20935573a783dd0d5991c92d7b6a0eb3173566530364db3ec10e9a990b5d60405160405180910390a350505050612907565b6020848101516001600160a01b03166000908152600f9091526040902080547fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000001667ffffffffffffffff83161790555b600083600381111561265d5761265d6143c5565b036126dd5760c084015167ffffffffffffffff1661267c8260016159dc565b67ffffffffffffffff16146126dd5783602001516001600160a01b03168460c0015167ffffffffffffffff167fd32ddb11d71e3d63411d37b09f9a8b28664f1cb1338bfd1413c173b0ebf4123760405160405180910390a350505050612907565b505b60008a6020015185815181106126f7576126f7615294565b602002602001015190506127238460600151856000015186610140015151876101200151518551613039565b612732846060015160016131ba565b600080612740868486613264565b915091506127528660600151836131ba565b88156127be57600382600381111561276c5761276c6143c5565b036127be576000856003811115612785576127856143c5565b146127be57806040517fcf19edfd0000000000000000000000000000000000000000000000000000000081526004016106ee9190614466565b60028260038111156127d2576127d26143c5565b1461282a5760038260038111156127eb576127eb6143c5565b1461282a578560600151826040517f9e2616030000000000000000000000000000000000000000000000000000000081526004016106ee9291906159fd565b60c086015167ffffffffffffffff16156128b2576000856003811115612852576128526143c5565b036128b2576020808701516001600160a01b03166000908152600f90915260408120805467ffffffffffffffff169161288a83615a1b565b91906101000a81548167ffffffffffffffff021916908367ffffffffffffffff160217905550505b856101800151866060015167ffffffffffffffff167fd4f851956a5d67c3997d1c9205045fef79bae2947fdee7e9e2641abc7391ef6584846040516128f8929190615a38565b60405180910390a35050505050505b600101612262565b61296261291e82840184615a58565b604080516000808252602082019092529061295c565b6040805180820190915260008152606060208201528152602001906001900390816129345790505b50611ebc565b5050565b60608989808060200260200160405190810160405280939291908181526020016000905b828210156129b6576129a760408302860136819003810190615a8d565b8152602001906001019061298a565b505050505090506000805b8a811015612b715760008888838181106129dd576129dd615294565b90506020028101906129ef919061558d565b8101906129fc9190615aa9565b90508451600014612a5757848281518110612a1957612a19615294565b602002602001015163ffffffff16600014612a5757848281518110612a4057612a40615294565b602090810291909101015163ffffffff1660608201525b612ad78d8d84818110612a6c57612a6c615294565b905060400201602001358c8c848b8b88818110612a8b57612a8b615294565b9050602002810190612a9d919061558d565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061333192505050565b848381518110612ae957612ae9615294565b6020026020010181905250612b25848381518110612b0957612b09615294565b602002602001015160000151600c6136fd90919063ffffffff16565b15612b6857612b5b848381518110612b3f57612b3f615294565b6020908102919091010151600b546001600160a01b0316613712565b612b6590846154aa565b92505b506001016129c1565b508015612b8157612b8181613833565b509998505050505050505050565b6000612b9a83613840565b8015610e5d5750610e5d83836138a4565b8154600090612bd490700100000000000000000000000000000000900463ffffffff16426151d3565b90508015612c765760018301548354612c1c916fffffffffffffffffffffffffffffffff80821692811691859170010000000000000000000000000000000090910416612e94565b83546fffffffffffffffffffffffffffffffff919091167fffffffffffffffffffffffff0000000000000000000000000000000000000000909116177001000000000000000000000000000000004263ffffffff16021783555b60208201518354612c9c916fffffffffffffffffffffffffffffffff9081169116613974565b83548351151574010000000000000000000000000000000000000000027fffffffffffffffffffffff00ffffffff000000000000000000000000000000009091166fffffffffffffffffffffffffffffffff92831617178455602083015160408085015183167001000000000000000000000000000000000291909216176001850155517f9ea3374b67bf275e6bb9c8ae68f9cae023e1c528b4b27e092f0bb209d3531c1990612d839084908151151581526020808301516fffffffffffffffffffffffffffffffff90811691830191909152604092830151169181019190915260600190565b60405180910390a1505050565b60006106a48261398a565b6000808080612daa8686613995565b909450925050505b9250929050565b336001600160a01b03821603612e2b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c6600000000000000000060448201526064016106ee565b600180547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b6000612eb385612ea4848661523c565b612eae90876154aa565b613974565b95945050505050565b6000610e5d83836139a4565b6000611e3384846001600160a01b0385166139c1565b60008060001b8284602001518560400151866060015187608001518860a001518960c001518a60e001518b6101000151604051602001612f749897969594939291906001600160a01b039889168152968816602088015267ffffffffffffffff95861660408801526060870194909452911515608086015290921660a0840152921660c082015260e08101919091526101000190565b6040516020818303038152906040528051906020012085610120015180519060200120866101400151604051602001612fad9190615b65565b60405160208183030381529060405280519060200120876101600151604051602001612fd99190615bd2565b60408051601f198184030181528282528051602091820120908301979097528101949094526060840192909252608083015260a082015260c081019190915260e00160405160208183030381529060405280519060200120905092915050565b7f000000000000000000000000000000000000000000000000000000000000000067ffffffffffffffff168467ffffffffffffffff16146130b2576040517f1279ec8a00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff851660048201526024016106ee565b600a5468010000000000000000900461ffff1683111561310a576040517f099d3f7200000000000000000000000000000000000000000000000000000000815267ffffffffffffffff861660048201526024016106ee565b80831461314f576040517f8808f8e700000000000000000000000000000000000000000000000000000000815267ffffffffffffffff861660048201526024016106ee565b600a54640100000000900463ffffffff168211156131b357600a546040517f8693378900000000000000000000000000000000000000000000000000000000815264010000000090910463ffffffff166004820152602481018390526044016106ee565b5050505050565b600060026131c9608085615215565b67ffffffffffffffff166131dd919061523c565b905060006010816131ef608087615253565b67ffffffffffffffff168152602081019190915260400160002054905081613219600160046151d3565b901b191681836003811115613230576132306143c5565b901b178060106000613243608088615253565b67ffffffffffffffff16815260208101919091526040016000205550505050565b6040517fb6113fce000000000000000000000000000000000000000000000000000000008152600090606090309063b6113fce906132aa90889088908890600401615c1c565b600060405180830381600087803b1580156132c457600080fd5b505af19250505080156132d5575060015b613314573d808015613303576040519150601f19603f3d011682016040523d82523d6000602084013e613308565b606091505b50600392509050613329565b50506040805160208101909152600081526002905b935093915050565b6040805180820190915260008082526020820152600061335484602001516139de565b6040517fbbe4f6db0000000000000000000000000000000000000000000000000000000081526001600160a01b0380831660048301529192506000917f0000000000000000000000000000000000000000000000000000000000000000169063bbe4f6db90602401602060405180830381865afa1580156133d9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906133fd9190615da5565b90506001600160a01b038116158061344557506134436001600160a01b0382167faff2afbf00000000000000000000000000000000000000000000000000000000612b8f565b155b15613487576040517fae9b4ce90000000000000000000000000000000000000000000000000000000081526001600160a01b03821660048201526024016106ee565b60008061349f8885896060015163ffffffff16613a84565b91509150600080600061359d6040518061010001604052808e81526020017f000000000000000000000000000000000000000000000000000000000000000067ffffffffffffffff1681526020018d6001600160a01b031681526020018f8152602001896001600160a01b031681526020018c6000015181526020018c6040015181526020018b8152506040516024016135399190615dc2565b60408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f390775370000000000000000000000000000000000000000000000000000000017905287866113886084613bc7565b925092509250826135dc57816040517fe1cd55090000000000000000000000000000000000000000000000000000000081526004016106ee9190614466565b81516020146136245781516040517f78ef80240000000000000000000000000000000000000000000000000000000081526020600482015260248101919091526044016106ee565b60008280602001905181019061363a91906159c3565b9050866001600160a01b03168c6001600160a01b0316146136cf57600061366b8d8a613666868a6151d3565b613a84565b5090508681108061368557508161368288836151d3565b14155b156136cd576040517fa966e21f0000000000000000000000000000000000000000000000000000000081526004810183905260248101889052604481018290526064016106ee565b505b604080518082019091526001600160a01b039098168852602088015250949550505050505095945050505050565b6000610e5d836001600160a01b038416613ced565b81516040517fd02641a00000000000000000000000000000000000000000000000000000000081526001600160a01b03918216600482015260009182919084169063d02641a0906024016040805180830381865afa158015613778573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061379c9190615e8f565b5190507bffffffffffffffffffffffffffffffffffffffffffffffffffffffff81166000036138055783516040517f9a655f7b0000000000000000000000000000000000000000000000000000000081526001600160a01b0390911660048201526024016106ee565b6020840151611e33907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff831690613cf9565b61184f6003826000613d36565b600061386c827f01ffc9a7000000000000000000000000000000000000000000000000000000006138a4565b80156106a4575061389d827fffffffff000000000000000000000000000000000000000000000000000000006138a4565b1592915050565b6040517fffffffff0000000000000000000000000000000000000000000000000000000082166024820152600090819060440160408051601f19818403018152919052602080820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f01ffc9a700000000000000000000000000000000000000000000000000000000178152825192935060009283928392909183918a617530fa92503d9150600051905082801561395d575060208210155b80156139695750600081115b979650505050505050565b60008183106139835781610e5d565b5090919050565b60006106a482614085565b6000808080612daa8686614090565b60008181526002830160205260408120819055610e5d83836140bb565b60008281526002840160205260408120829055611e3384846140c7565b60008151602014613a1d57816040517f8d666f600000000000000000000000000000000000000000000000000000000081526004016106ee9190614466565b600082806020019051810190613a3391906159c3565b90506001600160a01b03811180613a4b575061040081105b156106a457826040517f8d666f600000000000000000000000000000000000000000000000000000000081526004016106ee9190614466565b6000806000806000613b1388604051602401613aaf91906001600160a01b0391909116815260200190565b60408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f70a082310000000000000000000000000000000000000000000000000000000017905288886113886084613bc7565b92509250925082613b5257816040517fe1cd55090000000000000000000000000000000000000000000000000000000081526004016106ee9190614466565b6020825114613b9a5781516040517f78ef80240000000000000000000000000000000000000000000000000000000081526020600482015260248101919091526044016106ee565b81806020019051810190613bae91906159c3565b613bb882886151d3565b94509450505050935093915050565b6000606060008361ffff1667ffffffffffffffff811115613bea57613bea614479565b6040519080825280601f01601f191660200182016040528015613c14576020820181803683370190505b509150863b613c47577f0c3b563c0000000000000000000000000000000000000000000000000000000060005260046000fd5b5a85811015613c7a577fafa32a2c0000000000000000000000000000000000000000000000000000000060005260046000fd5b8590036040810481038710613cb3577f37c3be290000000000000000000000000000000000000000000000000000000060005260046000fd5b505a6000808a5160208c0160008c8cf193505a900390503d84811115613cd65750835b808352806000602085013e50955095509592505050565b6000610e5d83836140d3565b6000670de0b6b3a7640000613d2c837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff861661523c565b610e5d9190615ef1565b825474010000000000000000000000000000000000000000900460ff161580613d5d575081155b15613d6757505050565b825460018401546fffffffffffffffffffffffffffffffff80831692911690600090613dad90700100000000000000000000000000000000900463ffffffff16426151d3565b90508015613e6d5781831115613def576040517f9725942a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001860154613e299083908590849070010000000000000000000000000000000090046fffffffffffffffffffffffffffffffff16612e94565b86547fffffffffffffffffffffffff00000000ffffffffffffffffffffffffffffffff167001000000000000000000000000000000004263ffffffff160217875592505b84821015613f0a576001600160a01b038416613ebf576040517ff94ebcd100000000000000000000000000000000000000000000000000000000815260048101839052602481018690526044016106ee565b6040517f1a76572a00000000000000000000000000000000000000000000000000000000815260048101839052602481018690526001600160a01b03851660448201526064016106ee565b848310156140035760018681015470010000000000000000000000000000000090046fffffffffffffffffffffffffffffffff16906000908290613f4e90826151d3565b613f58878a6151d3565b613f6291906154aa565b613f6c9190615ef1565b90506001600160a01b038616613fb8576040517f15279c0800000000000000000000000000000000000000000000000000000000815260048101829052602481018690526044016106ee565b6040517fd0c8d23a00000000000000000000000000000000000000000000000000000000815260048101829052602481018690526001600160a01b03871660448201526064016106ee565b61400d85846151d3565b86547fffffffffffffffffffffffffffffffff00000000000000000000000000000000166fffffffffffffffffffffffffffffffff82161787556040518681529093507f1871cdf8010e63f2eb8384381a68dfa7416dc571a5517e66e88b2d2d0c0a690a9060200160405180910390a1505050505050565b60006106a4826140df565b6000808061409e85856140e9565b600081815260029690960160205260409095205494959350505050565b6000610e5d83836140f5565b6000610e5d83836141ef565b6000610e5d838361423e565b60006106a4825490565b6000610e5d8383614256565b600081815260018301602052604081205480156141de5760006141196001836151d3565b855490915060009061412d906001906151d3565b905081811461419257600086600001828154811061414d5761414d615294565b906000526020600020015490508087600001848154811061417057614170615294565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806141a3576141a3615f05565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506106a4565b60009150506106a4565b5092915050565b6000818152600183016020526040812054614236575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556106a4565b5060006106a4565b60008181526001830160205260408120541515610e5d565b600082600001828154811061426d5761426d615294565b9060005260206000200154905092915050565b8280548282559060005260206000209081019282156142ed579160200282015b828111156142ed57825182547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b039091161782556020909201916001909101906142a0565b506142f99291506142fd565b5090565b5b808211156142f957600081556001016142fe565b60e081016106a482846001600160a01b03808251168352602082015167ffffffffffffffff808216602086015280604085015116604086015250508060608301511660608401528060808301511660808401528060a08301511660a08401528060c08301511660c0840152505050565b67ffffffffffffffff8116811461184f57600080fd5b80356143a381614382565b919050565b6000602082840312156143ba57600080fd5b8135610e5d81614382565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b60048110614404576144046143c5565b9052565b602081016106a482846143f4565b60005b83811015614431578181015183820152602001614419565b50506000910152565b60008151808452614452816020860160208601614416565b601f01601f19169290920160200192915050565b602081526000610e5d602083018461443a565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040805190810167ffffffffffffffff811182821017156144cb576144cb614479565b60405290565b6040516080810167ffffffffffffffff811182821017156144cb576144cb614479565b6040516101a0810167ffffffffffffffff811182821017156144cb576144cb614479565b604051601f8201601f1916810167ffffffffffffffff8111828210171561454157614541614479565b604052919050565b600067ffffffffffffffff82111561456357614563614479565b5060051b60200190565b6001600160a01b038116811461184f57600080fd5b80356143a38161456d565b600082601f83011261459e57600080fd5b813560206145b36145ae83614549565b614518565b8083825260208201915060208460051b8701019350868411156145d557600080fd5b602086015b848110156145fa5780356145ed8161456d565b83529183019183016145da565b509695505050505050565b803560ff811681146143a357600080fd5b600067ffffffffffffffff82111561463057614630614479565b50601f01601f191660200190565b600082601f83011261464f57600080fd5b813561465d6145ae82614616565b81815284602083860101111561467257600080fd5b816020850160208301376000918101602001919091529392505050565b60008060008060008060c087890312156146a857600080fd5b863567ffffffffffffffff808211156146c057600080fd5b6146cc8a838b0161458d565b975060208901359150808211156146e257600080fd5b6146ee8a838b0161458d565b96506146fc60408a01614605565b9550606089013591508082111561471257600080fd5b61471e8a838b0161463e565b945061472c60808a01614398565b935060a089013591508082111561474257600080fd5b5061474f89828a0161463e565b9150509295509295509295565b60008151808452602080850194506020840160005b838110156147965781516001600160a01b031687529582019590820190600101614771565b509495945050505050565b602081526000610e5d602083018461475c565b6000602082840312156147c657600080fd5b8135610e5d8161456d565b60a081016106a4828463ffffffff8082511683528060208301511660208401525061ffff604082015116604083015260608101516001600160a01b03808216606085015280608084015116608085015250505050565b60006020828403121561483957600080fd5b813567ffffffffffffffff81111561485057600080fd5b820160a08185031215610e5d57600080fd5b600082601f83011261487357600080fd5b813560206148836145ae83614549565b82815260069290921b840181019181810190868411156148a257600080fd5b8286015b848110156145fa57604081890312156148bf5760008081fd5b6148c76144a8565b81356148d28161456d565b8152818501356148e18161456d565b818601528352918301916040016148a6565b6000806040838503121561490657600080fd5b823567ffffffffffffffff8082111561491e57600080fd5b61492a86838701614862565b9350602085013591508082111561494057600080fd5b5061494d85828601614862565b9150509250929050565b801515811461184f57600080fd5b80356143a381614957565b60006040828403121561498257600080fd5b61498a6144a8565b905081356149978161456d565b808252506020820135602082015292915050565b600082601f8301126149bc57600080fd5b813560206149cc6145ae83614549565b8083825260208201915060208460061b8701019350868411156149ee57600080fd5b602086015b848110156145fa57614a058882614970565b8352918301916040016149f3565b600082601f830112614a2457600080fd5b81356020614a346145ae83614549565b82815260059290921b84018101918181019086841115614a5357600080fd5b8286015b848110156145fa57803567ffffffffffffffff811115614a775760008081fd5b614a858986838b010161463e565b845250918301918301614a57565b600082601f830112614aa457600080fd5b81356020614ab46145ae83614549565b82815260059290921b84018101918181019086841115614ad357600080fd5b8286015b848110156145fa57803567ffffffffffffffff811115614af75760008081fd5b614b058986838b0101614a13565b845250918301918301614ad7565b600082601f830112614b2457600080fd5b81356020614b346145ae83614549565b8083825260208201915060208460051b870101935086841115614b5657600080fd5b602086015b848110156145fa5780358352918301918301614b5b565b600060808284031215614b8457600080fd5b614b8c6144d1565b9050813567ffffffffffffffff80821115614ba657600080fd5b818401915084601f830112614bba57600080fd5b81356020614bca6145ae83614549565b82815260059290921b84018101918181019088841115614be957600080fd5b8286015b84811015614d4557803586811115614c0457600080fd5b87016101a0818c03601f19011215614c1b57600080fd5b614c236144f4565b614c2e868301614398565b8152614c3c60408301614582565b86820152614c4c60608301614582565b6040820152614c5d60808301614398565b606082015260a08201356080820152614c7860c08301614965565b60a0820152614c8960e08301614398565b60c0820152610100614c9c818401614582565b60e083015261012080840135828401526101409150818401358a811115614cc257600080fd5b614cd08f8a8388010161463e565b828501525050610160808401358a811115614cea57600080fd5b614cf88f8a838801016149ab565b83850152506101809150818401358a811115614d1357600080fd5b614d218f8a83880101614a13565b91840191909152506101a09290920135918101919091528352918301918301614bed565b5086525085810135935082841115614d5c57600080fd5b614d6887858801614a93565b90850152506040840135915080821115614d8157600080fd5b50614d8e84828501614b13565b6040830152506060820135606082015292915050565b63ffffffff8116811461184f57600080fd5b600082601f830112614dc757600080fd5b81356020614dd76145ae83614549565b8083825260208201915060208460051b870101935086841115614df957600080fd5b602086015b848110156145fa578035614e1181614da4565b8352918301918301614dfe565b6000806040808486031215614e3257600080fd5b833567ffffffffffffffff80821115614e4a57600080fd5b614e5687838801614b72565b9450602091508186013581811115614e6d57600080fd5b8601601f81018813614e7e57600080fd5b8035614e8c6145ae82614549565b81815260059190911b8201840190848101908a831115614eab57600080fd5b8584015b83811015614f1e57803586811115614ec75760008081fd5b8501808d03601f1901891315614edd5760008081fd5b614ee56144a8565b8882013581528982013588811115614efd5760008081fd5b614f0b8f8b83860101614db6565b828b015250845250918601918601614eaf565b50809750505050505050509250929050565b60008083601f840112614f4257600080fd5b50813567ffffffffffffffff811115614f5a57600080fd5b6020830191508360208260051b8501011115612db257600080fd5b60008060008060008060008060e0898b031215614f9157600080fd5b606089018a811115614fa257600080fd5b8998503567ffffffffffffffff80821115614fbc57600080fd5b818b0191508b601f830112614fd057600080fd5b813581811115614fdf57600080fd5b8c6020828501011115614ff157600080fd5b6020830199508098505060808b013591508082111561500f57600080fd5b61501b8c838d01614f30565b909750955060a08b013591508082111561503457600080fd5b506150418b828c01614f30565b999c989b50969995989497949560c00135949350505050565b6000806000806060858703121561507057600080fd5b843567ffffffffffffffff8082111561508857600080fd5b908601906101a0828903121561509d57600080fd5b909450602086013590808211156150b357600080fd5b6150bf88838901614f30565b909550935060408701359150808211156150d857600080fd5b506150e587828801614db6565b91505092959194509250565b80356fffffffffffffffffffffffffffffffff811681146143a357600080fd5b60006060828403121561512357600080fd5b6040516060810181811067ffffffffffffffff8211171561514657615146614479565b604052823561515481614957565b8152615162602084016150f1565b6020820152615173604084016150f1565b60408201529392505050565b604081526000615192604083018561475c565b8281036020840152612eb3818561475c565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b818103818111156106a4576106a46151a4565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600067ffffffffffffffff80841680615230576152306151e6565b92169190910692915050565b80820281158282048414176106a4576106a46151a4565b600067ffffffffffffffff8084168061526e5761526e6151e6565b92169190910492915050565b602081016003831061528e5761528e6143c5565b91905290565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600063ffffffff8083168181036152dc576152dc6151a4565b6001019392505050565b600061012063ffffffff808d1684528b6020850152808b166040850152508060608401526153168184018a61475c565b9050828103608084015261532a818961475c565b905060ff871660a084015282810360c0840152615347818761443a565b905067ffffffffffffffff851660e084015282810361010084015261536c818561443a565b9c9b505050505050505050505050565b60006020828403121561538e57600080fd5b8151610e5d81614382565b600082601f8301126153aa57600080fd5b81516153b86145ae82614616565b8181528460208386010111156153cd57600080fd5b611e33826020830160208701614416565b6000602082840312156153f057600080fd5b815167ffffffffffffffff8082111561540857600080fd5b908301906080828603121561541c57600080fd5b6154246144d1565b82518281111561543357600080fd5b61543f87828601615399565b82525060208301518281111561545457600080fd5b61546087828601615399565b60208301525060408301518281111561547857600080fd5b61548487828601615399565b6040830152506060830151925061549a83614da4565b6060810192909252509392505050565b808201808211156106a4576106a46151a4565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe18436030181126154f257600080fd5b83018035915067ffffffffffffffff82111561550d57600080fd5b6020019150600681901b3603821315612db257600080fd5b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe184360301811261555a57600080fd5b83018035915067ffffffffffffffff82111561557557600080fd5b6020019150600581901b3603821315612db257600080fd5b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe18436030181126155c257600080fd5b83018035915067ffffffffffffffff8211156155dd57600080fd5b602001915036819003821315612db257600080fd5b60008151808452602080850194506020840160005b8381101561479657815180516001600160a01b031688528301518388015260409096019590820190600101615607565b608081528451608082015267ffffffffffffffff60208601511660a08201526000604086015160a060c084015261567261012084018261443a565b905060608701517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff80808584030160e08601526156ae838361443a565b9250608089015191508085840301610100860152506156cd82826155f2565b925050506156e1602083018661ffff169052565b836040830152612eb360608301846001600160a01b03169052565b60008060006060848603121561571157600080fd5b835161571c81614957565b602085015190935067ffffffffffffffff81111561573957600080fd5b61574586828701615399565b925050604084015190509250925092565b600060a0828403121561576857600080fd5b60405160a0810181811067ffffffffffffffff8211171561578b5761578b614479565b604052825161579981614da4565b815260208301516157a981614da4565b6020820152604083015161ffff811681146157c357600080fd5b604082015260608301516157d68161456d565b606082015260808301516157e98161456d565b60808201529392505050565b610180810161586682856001600160a01b03808251168352602082015167ffffffffffffffff808216602086015280604085015116604086015250508060608301511660608401528060808301511660808401528060a08301511660a08401528060c08301511660c0840152505050565b825163ffffffff90811660e0840152602084015116610100830152604083015161ffff1661012083015260608301516001600160a01b03908116610140840152608084015116610160830152610e5d565b60006101208b83526001600160a01b038b16602084015267ffffffffffffffff808b1660408501528160608501526158f18285018b61475c565b91508382036080850152615905828a61475c565b915060ff881660a085015283820360c0850152615922828861443a565b90861660e0850152838103610100850152905061536c818561443a565b60006020828403121561595157600080fd5b8151610e5d81614957565b60008151808452602080850194506020840160005b8381101561479657815187529582019590820190600101615971565b6060815260006159a0606083018661595c565b82810360208401526159b2818661595c565b915050826040830152949350505050565b6000602082840312156159d557600080fd5b5051919050565b67ffffffffffffffff8181168382160190808211156141e8576141e86151a4565b67ffffffffffffffff8316815260408101610e5d60208301846143f4565b600067ffffffffffffffff8083168181036152dc576152dc6151a4565b615a4281846143f4565b604060208201526000611e33604083018461443a565b600060208284031215615a6a57600080fd5b813567ffffffffffffffff811115615a8157600080fd5b611e3384828501614b72565b600060408284031215615a9f57600080fd5b610e5d8383614970565b600060208284031215615abb57600080fd5b813567ffffffffffffffff80821115615ad357600080fd5b9083019060808286031215615ae757600080fd5b615aef6144d1565b823582811115615afe57600080fd5b615b0a8782860161463e565b825250602083013582811115615b1f57600080fd5b615b2b8782860161463e565b602083015250604083013582811115615b4357600080fd5b615b4f8782860161463e565b6040830152506060830135925061549a83614da4565b602081526000610e5d60208301846155f2565b60008282518085526020808601955060208260051b8401016020860160005b84811015615bc557601f19868403018952615bb383835161443a565b98840198925090830190600101615b97565b5090979650505050505050565b602081526000610e5d6020830184615b78565b60008151808452602080850194506020840160005b8381101561479657815163ffffffff1687529582019590820190600101615bfa565b60608152615c3760608201855167ffffffffffffffff169052565b60006020850151615c5360808401826001600160a01b03169052565b5060408501516001600160a01b03811660a084015250606085015167ffffffffffffffff811660c084015250608085015160e083015260a0850151610100615c9e8185018315159052565b60c08701519150610120615cbd8186018467ffffffffffffffff169052565b60e08801519250610140615cdb818701856001600160a01b03169052565b828901519350610160925083838701528189015193506101a091506101808281880152615d0c61020088018661443a565b9450818a015191507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa0808887030184890152615d4886846155f2565b948b01518886039091016101c0890152939450615d658585615b78565b9450808a01516101e0880152505050508281036020840152615d878186615b78565b90508281036040840152615d9b8185615be5565b9695505050505050565b600060208284031215615db757600080fd5b8151610e5d8161456d565b6020815260008251610100806020850152615de161012085018361443a565b91506020850151615dfe604086018267ffffffffffffffff169052565b5060408501516001600160a01b038116606086015250606085015160808501526080850151615e3860a08601826001600160a01b03169052565b5060a0850151601f19808685030160c0870152615e55848361443a565b935060c08701519150808685030160e0870152615e72848361443a565b935060e0870151915080868503018387015250615d9b838261443a565b600060408284031215615ea157600080fd5b615ea96144a8565b82517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff81168114615ed557600080fd5b81526020830151615ee581614da4565b60208201529392505050565b600082615f0057615f006151e6565b500490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fdfea164736f6c6343000818000a", +} + +var EVM2EVMOffRampABI = EVM2EVMOffRampMetaData.ABI + +var EVM2EVMOffRampBin = EVM2EVMOffRampMetaData.Bin + +func DeployEVM2EVMOffRamp(auth *bind.TransactOpts, backend bind.ContractBackend, staticConfig EVM2EVMOffRampStaticConfig, rateLimiterConfig RateLimiterConfig) (common.Address, *types.Transaction, *EVM2EVMOffRamp, error) { + parsed, err := EVM2EVMOffRampMetaData.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(EVM2EVMOffRampBin), backend, staticConfig, rateLimiterConfig) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &EVM2EVMOffRamp{address: address, abi: *parsed, EVM2EVMOffRampCaller: EVM2EVMOffRampCaller{contract: contract}, EVM2EVMOffRampTransactor: EVM2EVMOffRampTransactor{contract: contract}, EVM2EVMOffRampFilterer: EVM2EVMOffRampFilterer{contract: contract}}, nil +} + +type EVM2EVMOffRamp struct { + address common.Address + abi abi.ABI + EVM2EVMOffRampCaller + EVM2EVMOffRampTransactor + EVM2EVMOffRampFilterer +} + +type EVM2EVMOffRampCaller struct { + contract *bind.BoundContract +} + +type EVM2EVMOffRampTransactor struct { + contract *bind.BoundContract +} + +type EVM2EVMOffRampFilterer struct { + contract *bind.BoundContract +} + +type EVM2EVMOffRampSession struct { + Contract *EVM2EVMOffRamp + CallOpts bind.CallOpts + TransactOpts bind.TransactOpts +} + +type EVM2EVMOffRampCallerSession struct { + Contract *EVM2EVMOffRampCaller + CallOpts bind.CallOpts +} + +type EVM2EVMOffRampTransactorSession struct { + Contract *EVM2EVMOffRampTransactor + TransactOpts bind.TransactOpts +} + +type EVM2EVMOffRampRaw struct { + Contract *EVM2EVMOffRamp +} + +type EVM2EVMOffRampCallerRaw struct { + Contract *EVM2EVMOffRampCaller +} + +type EVM2EVMOffRampTransactorRaw struct { + Contract *EVM2EVMOffRampTransactor +} + +func NewEVM2EVMOffRamp(address common.Address, backend bind.ContractBackend) (*EVM2EVMOffRamp, error) { + abi, err := abi.JSON(strings.NewReader(EVM2EVMOffRampABI)) + if err != nil { + return nil, err + } + contract, err := bindEVM2EVMOffRamp(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &EVM2EVMOffRamp{address: address, abi: abi, EVM2EVMOffRampCaller: EVM2EVMOffRampCaller{contract: contract}, EVM2EVMOffRampTransactor: EVM2EVMOffRampTransactor{contract: contract}, EVM2EVMOffRampFilterer: EVM2EVMOffRampFilterer{contract: contract}}, nil +} + +func NewEVM2EVMOffRampCaller(address common.Address, caller bind.ContractCaller) (*EVM2EVMOffRampCaller, error) { + contract, err := bindEVM2EVMOffRamp(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &EVM2EVMOffRampCaller{contract: contract}, nil +} + +func NewEVM2EVMOffRampTransactor(address common.Address, transactor bind.ContractTransactor) (*EVM2EVMOffRampTransactor, error) { + contract, err := bindEVM2EVMOffRamp(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &EVM2EVMOffRampTransactor{contract: contract}, nil +} + +func NewEVM2EVMOffRampFilterer(address common.Address, filterer bind.ContractFilterer) (*EVM2EVMOffRampFilterer, error) { + contract, err := bindEVM2EVMOffRamp(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &EVM2EVMOffRampFilterer{contract: contract}, nil +} + +func bindEVM2EVMOffRamp(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := EVM2EVMOffRampMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _EVM2EVMOffRamp.Contract.EVM2EVMOffRampCaller.contract.Call(opts, result, method, params...) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _EVM2EVMOffRamp.Contract.EVM2EVMOffRampTransactor.contract.Transfer(opts) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _EVM2EVMOffRamp.Contract.EVM2EVMOffRampTransactor.contract.Transact(opts, method, params...) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _EVM2EVMOffRamp.Contract.contract.Call(opts, result, method, params...) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _EVM2EVMOffRamp.Contract.contract.Transfer(opts) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _EVM2EVMOffRamp.Contract.contract.Transact(opts, method, params...) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampCaller) CcipReceive(opts *bind.CallOpts, arg0 ClientAny2EVMMessage) error { + var out []interface{} + err := _EVM2EVMOffRamp.contract.Call(opts, &out, "ccipReceive", arg0) + + if err != nil { + return err + } + + return err + +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampSession) CcipReceive(arg0 ClientAny2EVMMessage) error { + return _EVM2EVMOffRamp.Contract.CcipReceive(&_EVM2EVMOffRamp.CallOpts, arg0) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampCallerSession) CcipReceive(arg0 ClientAny2EVMMessage) error { + return _EVM2EVMOffRamp.Contract.CcipReceive(&_EVM2EVMOffRamp.CallOpts, arg0) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampCaller) CurrentRateLimiterState(opts *bind.CallOpts) (RateLimiterTokenBucket, error) { + var out []interface{} + err := _EVM2EVMOffRamp.contract.Call(opts, &out, "currentRateLimiterState") + + if err != nil { + return *new(RateLimiterTokenBucket), err + } + + out0 := *abi.ConvertType(out[0], new(RateLimiterTokenBucket)).(*RateLimiterTokenBucket) + + return out0, err + +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampSession) CurrentRateLimiterState() (RateLimiterTokenBucket, error) { + return _EVM2EVMOffRamp.Contract.CurrentRateLimiterState(&_EVM2EVMOffRamp.CallOpts) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampCallerSession) CurrentRateLimiterState() (RateLimiterTokenBucket, error) { + return _EVM2EVMOffRamp.Contract.CurrentRateLimiterState(&_EVM2EVMOffRamp.CallOpts) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampCaller) GetAllRateLimitTokens(opts *bind.CallOpts) (GetAllRateLimitTokens, + + error) { + var out []interface{} + err := _EVM2EVMOffRamp.contract.Call(opts, &out, "getAllRateLimitTokens") + + outstruct := new(GetAllRateLimitTokens) + if err != nil { + return *outstruct, err + } + + outstruct.SourceTokens = *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) + outstruct.DestTokens = *abi.ConvertType(out[1], new([]common.Address)).(*[]common.Address) + + return *outstruct, err + +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampSession) GetAllRateLimitTokens() (GetAllRateLimitTokens, + + error) { + return _EVM2EVMOffRamp.Contract.GetAllRateLimitTokens(&_EVM2EVMOffRamp.CallOpts) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampCallerSession) GetAllRateLimitTokens() (GetAllRateLimitTokens, + + error) { + return _EVM2EVMOffRamp.Contract.GetAllRateLimitTokens(&_EVM2EVMOffRamp.CallOpts) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampCaller) GetDynamicConfig(opts *bind.CallOpts) (EVM2EVMOffRampDynamicConfig, error) { + var out []interface{} + err := _EVM2EVMOffRamp.contract.Call(opts, &out, "getDynamicConfig") + + if err != nil { + return *new(EVM2EVMOffRampDynamicConfig), err + } + + out0 := *abi.ConvertType(out[0], new(EVM2EVMOffRampDynamicConfig)).(*EVM2EVMOffRampDynamicConfig) + + return out0, err + +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampSession) GetDynamicConfig() (EVM2EVMOffRampDynamicConfig, error) { + return _EVM2EVMOffRamp.Contract.GetDynamicConfig(&_EVM2EVMOffRamp.CallOpts) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampCallerSession) GetDynamicConfig() (EVM2EVMOffRampDynamicConfig, error) { + return _EVM2EVMOffRamp.Contract.GetDynamicConfig(&_EVM2EVMOffRamp.CallOpts) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampCaller) GetExecutionState(opts *bind.CallOpts, sequenceNumber uint64) (uint8, error) { + var out []interface{} + err := _EVM2EVMOffRamp.contract.Call(opts, &out, "getExecutionState", sequenceNumber) + + if err != nil { + return *new(uint8), err + } + + out0 := *abi.ConvertType(out[0], new(uint8)).(*uint8) + + return out0, err + +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampSession) GetExecutionState(sequenceNumber uint64) (uint8, error) { + return _EVM2EVMOffRamp.Contract.GetExecutionState(&_EVM2EVMOffRamp.CallOpts, sequenceNumber) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampCallerSession) GetExecutionState(sequenceNumber uint64) (uint8, error) { + return _EVM2EVMOffRamp.Contract.GetExecutionState(&_EVM2EVMOffRamp.CallOpts, sequenceNumber) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampCaller) GetSenderNonce(opts *bind.CallOpts, sender common.Address) (uint64, error) { + var out []interface{} + err := _EVM2EVMOffRamp.contract.Call(opts, &out, "getSenderNonce", sender) + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampSession) GetSenderNonce(sender common.Address) (uint64, error) { + return _EVM2EVMOffRamp.Contract.GetSenderNonce(&_EVM2EVMOffRamp.CallOpts, sender) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampCallerSession) GetSenderNonce(sender common.Address) (uint64, error) { + return _EVM2EVMOffRamp.Contract.GetSenderNonce(&_EVM2EVMOffRamp.CallOpts, sender) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampCaller) GetStaticConfig(opts *bind.CallOpts) (EVM2EVMOffRampStaticConfig, error) { + var out []interface{} + err := _EVM2EVMOffRamp.contract.Call(opts, &out, "getStaticConfig") + + if err != nil { + return *new(EVM2EVMOffRampStaticConfig), err + } + + out0 := *abi.ConvertType(out[0], new(EVM2EVMOffRampStaticConfig)).(*EVM2EVMOffRampStaticConfig) + + return out0, err + +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampSession) GetStaticConfig() (EVM2EVMOffRampStaticConfig, error) { + return _EVM2EVMOffRamp.Contract.GetStaticConfig(&_EVM2EVMOffRamp.CallOpts) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampCallerSession) GetStaticConfig() (EVM2EVMOffRampStaticConfig, error) { + return _EVM2EVMOffRamp.Contract.GetStaticConfig(&_EVM2EVMOffRamp.CallOpts) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampCaller) GetTokenLimitAdmin(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _EVM2EVMOffRamp.contract.Call(opts, &out, "getTokenLimitAdmin") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampSession) GetTokenLimitAdmin() (common.Address, error) { + return _EVM2EVMOffRamp.Contract.GetTokenLimitAdmin(&_EVM2EVMOffRamp.CallOpts) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampCallerSession) GetTokenLimitAdmin() (common.Address, error) { + return _EVM2EVMOffRamp.Contract.GetTokenLimitAdmin(&_EVM2EVMOffRamp.CallOpts) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampCaller) GetTransmitters(opts *bind.CallOpts) ([]common.Address, error) { + var out []interface{} + err := _EVM2EVMOffRamp.contract.Call(opts, &out, "getTransmitters") + + if err != nil { + return *new([]common.Address), err + } + + out0 := *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) + + return out0, err + +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampSession) GetTransmitters() ([]common.Address, error) { + return _EVM2EVMOffRamp.Contract.GetTransmitters(&_EVM2EVMOffRamp.CallOpts) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampCallerSession) GetTransmitters() ([]common.Address, error) { + return _EVM2EVMOffRamp.Contract.GetTransmitters(&_EVM2EVMOffRamp.CallOpts) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampCaller) LatestConfigDetails(opts *bind.CallOpts) (LatestConfigDetails, + + error) { + var out []interface{} + err := _EVM2EVMOffRamp.contract.Call(opts, &out, "latestConfigDetails") + + outstruct := new(LatestConfigDetails) + if err != nil { + return *outstruct, err + } + + outstruct.ConfigCount = *abi.ConvertType(out[0], new(uint32)).(*uint32) + outstruct.BlockNumber = *abi.ConvertType(out[1], new(uint32)).(*uint32) + outstruct.ConfigDigest = *abi.ConvertType(out[2], new([32]byte)).(*[32]byte) + + return *outstruct, err + +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampSession) LatestConfigDetails() (LatestConfigDetails, + + error) { + return _EVM2EVMOffRamp.Contract.LatestConfigDetails(&_EVM2EVMOffRamp.CallOpts) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampCallerSession) LatestConfigDetails() (LatestConfigDetails, + + error) { + return _EVM2EVMOffRamp.Contract.LatestConfigDetails(&_EVM2EVMOffRamp.CallOpts) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampCaller) LatestConfigDigestAndEpoch(opts *bind.CallOpts) (LatestConfigDigestAndEpoch, + + error) { + var out []interface{} + err := _EVM2EVMOffRamp.contract.Call(opts, &out, "latestConfigDigestAndEpoch") + + outstruct := new(LatestConfigDigestAndEpoch) + if err != nil { + return *outstruct, err + } + + outstruct.ScanLogs = *abi.ConvertType(out[0], new(bool)).(*bool) + outstruct.ConfigDigest = *abi.ConvertType(out[1], new([32]byte)).(*[32]byte) + outstruct.Epoch = *abi.ConvertType(out[2], new(uint32)).(*uint32) + + return *outstruct, err + +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampSession) LatestConfigDigestAndEpoch() (LatestConfigDigestAndEpoch, + + error) { + return _EVM2EVMOffRamp.Contract.LatestConfigDigestAndEpoch(&_EVM2EVMOffRamp.CallOpts) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampCallerSession) LatestConfigDigestAndEpoch() (LatestConfigDigestAndEpoch, + + error) { + return _EVM2EVMOffRamp.Contract.LatestConfigDigestAndEpoch(&_EVM2EVMOffRamp.CallOpts) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampCaller) Owner(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _EVM2EVMOffRamp.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 + +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampSession) Owner() (common.Address, error) { + return _EVM2EVMOffRamp.Contract.Owner(&_EVM2EVMOffRamp.CallOpts) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampCallerSession) Owner() (common.Address, error) { + return _EVM2EVMOffRamp.Contract.Owner(&_EVM2EVMOffRamp.CallOpts) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampCaller) TypeAndVersion(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _EVM2EVMOffRamp.contract.Call(opts, &out, "typeAndVersion") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampSession) TypeAndVersion() (string, error) { + return _EVM2EVMOffRamp.Contract.TypeAndVersion(&_EVM2EVMOffRamp.CallOpts) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampCallerSession) TypeAndVersion() (string, error) { + return _EVM2EVMOffRamp.Contract.TypeAndVersion(&_EVM2EVMOffRamp.CallOpts) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampTransactor) AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + return _EVM2EVMOffRamp.contract.Transact(opts, "acceptOwnership") +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampSession) AcceptOwnership() (*types.Transaction, error) { + return _EVM2EVMOffRamp.Contract.AcceptOwnership(&_EVM2EVMOffRamp.TransactOpts) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampTransactorSession) AcceptOwnership() (*types.Transaction, error) { + return _EVM2EVMOffRamp.Contract.AcceptOwnership(&_EVM2EVMOffRamp.TransactOpts) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampTransactor) ExecuteSingleMessage(opts *bind.TransactOpts, message InternalEVM2EVMMessage, offchainTokenData [][]byte, tokenGasOverrides []uint32) (*types.Transaction, error) { + return _EVM2EVMOffRamp.contract.Transact(opts, "executeSingleMessage", message, offchainTokenData, tokenGasOverrides) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampSession) ExecuteSingleMessage(message InternalEVM2EVMMessage, offchainTokenData [][]byte, tokenGasOverrides []uint32) (*types.Transaction, error) { + return _EVM2EVMOffRamp.Contract.ExecuteSingleMessage(&_EVM2EVMOffRamp.TransactOpts, message, offchainTokenData, tokenGasOverrides) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampTransactorSession) ExecuteSingleMessage(message InternalEVM2EVMMessage, offchainTokenData [][]byte, tokenGasOverrides []uint32) (*types.Transaction, error) { + return _EVM2EVMOffRamp.Contract.ExecuteSingleMessage(&_EVM2EVMOffRamp.TransactOpts, message, offchainTokenData, tokenGasOverrides) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampTransactor) ManuallyExecute(opts *bind.TransactOpts, report InternalExecutionReport, gasLimitOverrides []EVM2EVMOffRampGasLimitOverride) (*types.Transaction, error) { + return _EVM2EVMOffRamp.contract.Transact(opts, "manuallyExecute", report, gasLimitOverrides) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampSession) ManuallyExecute(report InternalExecutionReport, gasLimitOverrides []EVM2EVMOffRampGasLimitOverride) (*types.Transaction, error) { + return _EVM2EVMOffRamp.Contract.ManuallyExecute(&_EVM2EVMOffRamp.TransactOpts, report, gasLimitOverrides) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampTransactorSession) ManuallyExecute(report InternalExecutionReport, gasLimitOverrides []EVM2EVMOffRampGasLimitOverride) (*types.Transaction, error) { + return _EVM2EVMOffRamp.Contract.ManuallyExecute(&_EVM2EVMOffRamp.TransactOpts, report, gasLimitOverrides) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampTransactor) SetAdmin(opts *bind.TransactOpts, newAdmin common.Address) (*types.Transaction, error) { + return _EVM2EVMOffRamp.contract.Transact(opts, "setAdmin", newAdmin) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampSession) SetAdmin(newAdmin common.Address) (*types.Transaction, error) { + return _EVM2EVMOffRamp.Contract.SetAdmin(&_EVM2EVMOffRamp.TransactOpts, newAdmin) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampTransactorSession) SetAdmin(newAdmin common.Address) (*types.Transaction, error) { + return _EVM2EVMOffRamp.Contract.SetAdmin(&_EVM2EVMOffRamp.TransactOpts, newAdmin) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampTransactor) SetOCR2Config(opts *bind.TransactOpts, signers []common.Address, transmitters []common.Address, f uint8, onchainConfig []byte, offchainConfigVersion uint64, offchainConfig []byte) (*types.Transaction, error) { + return _EVM2EVMOffRamp.contract.Transact(opts, "setOCR2Config", signers, transmitters, f, onchainConfig, offchainConfigVersion, offchainConfig) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampSession) SetOCR2Config(signers []common.Address, transmitters []common.Address, f uint8, onchainConfig []byte, offchainConfigVersion uint64, offchainConfig []byte) (*types.Transaction, error) { + return _EVM2EVMOffRamp.Contract.SetOCR2Config(&_EVM2EVMOffRamp.TransactOpts, signers, transmitters, f, onchainConfig, offchainConfigVersion, offchainConfig) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampTransactorSession) SetOCR2Config(signers []common.Address, transmitters []common.Address, f uint8, onchainConfig []byte, offchainConfigVersion uint64, offchainConfig []byte) (*types.Transaction, error) { + return _EVM2EVMOffRamp.Contract.SetOCR2Config(&_EVM2EVMOffRamp.TransactOpts, signers, transmitters, f, onchainConfig, offchainConfigVersion, offchainConfig) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampTransactor) SetRateLimiterConfig(opts *bind.TransactOpts, config RateLimiterConfig) (*types.Transaction, error) { + return _EVM2EVMOffRamp.contract.Transact(opts, "setRateLimiterConfig", config) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampSession) SetRateLimiterConfig(config RateLimiterConfig) (*types.Transaction, error) { + return _EVM2EVMOffRamp.Contract.SetRateLimiterConfig(&_EVM2EVMOffRamp.TransactOpts, config) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampTransactorSession) SetRateLimiterConfig(config RateLimiterConfig) (*types.Transaction, error) { + return _EVM2EVMOffRamp.Contract.SetRateLimiterConfig(&_EVM2EVMOffRamp.TransactOpts, config) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampTransactor) TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) { + return _EVM2EVMOffRamp.contract.Transact(opts, "transferOwnership", to) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampSession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _EVM2EVMOffRamp.Contract.TransferOwnership(&_EVM2EVMOffRamp.TransactOpts, to) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampTransactorSession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _EVM2EVMOffRamp.Contract.TransferOwnership(&_EVM2EVMOffRamp.TransactOpts, to) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampTransactor) Transmit(opts *bind.TransactOpts, reportContext [3][32]byte, report []byte, rs [][32]byte, ss [][32]byte, arg4 [32]byte) (*types.Transaction, error) { + return _EVM2EVMOffRamp.contract.Transact(opts, "transmit", reportContext, report, rs, ss, arg4) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampSession) Transmit(reportContext [3][32]byte, report []byte, rs [][32]byte, ss [][32]byte, arg4 [32]byte) (*types.Transaction, error) { + return _EVM2EVMOffRamp.Contract.Transmit(&_EVM2EVMOffRamp.TransactOpts, reportContext, report, rs, ss, arg4) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampTransactorSession) Transmit(reportContext [3][32]byte, report []byte, rs [][32]byte, ss [][32]byte, arg4 [32]byte) (*types.Transaction, error) { + return _EVM2EVMOffRamp.Contract.Transmit(&_EVM2EVMOffRamp.TransactOpts, reportContext, report, rs, ss, arg4) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampTransactor) UpdateRateLimitTokens(opts *bind.TransactOpts, removes []EVM2EVMOffRampRateLimitToken, adds []EVM2EVMOffRampRateLimitToken) (*types.Transaction, error) { + return _EVM2EVMOffRamp.contract.Transact(opts, "updateRateLimitTokens", removes, adds) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampSession) UpdateRateLimitTokens(removes []EVM2EVMOffRampRateLimitToken, adds []EVM2EVMOffRampRateLimitToken) (*types.Transaction, error) { + return _EVM2EVMOffRamp.Contract.UpdateRateLimitTokens(&_EVM2EVMOffRamp.TransactOpts, removes, adds) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampTransactorSession) UpdateRateLimitTokens(removes []EVM2EVMOffRampRateLimitToken, adds []EVM2EVMOffRampRateLimitToken) (*types.Transaction, error) { + return _EVM2EVMOffRamp.Contract.UpdateRateLimitTokens(&_EVM2EVMOffRamp.TransactOpts, removes, adds) +} + +type EVM2EVMOffRampAdminSetIterator struct { + Event *EVM2EVMOffRampAdminSet + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *EVM2EVMOffRampAdminSetIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOffRampAdminSet) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOffRampAdminSet) + 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() + } +} + +func (it *EVM2EVMOffRampAdminSetIterator) Error() error { + return it.fail +} + +func (it *EVM2EVMOffRampAdminSetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type EVM2EVMOffRampAdminSet struct { + NewAdmin common.Address + Raw types.Log +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) FilterAdminSet(opts *bind.FilterOpts) (*EVM2EVMOffRampAdminSetIterator, error) { + + logs, sub, err := _EVM2EVMOffRamp.contract.FilterLogs(opts, "AdminSet") + if err != nil { + return nil, err + } + return &EVM2EVMOffRampAdminSetIterator{contract: _EVM2EVMOffRamp.contract, event: "AdminSet", logs: logs, sub: sub}, nil +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) WatchAdminSet(opts *bind.WatchOpts, sink chan<- *EVM2EVMOffRampAdminSet) (event.Subscription, error) { + + logs, sub, err := _EVM2EVMOffRamp.contract.WatchLogs(opts, "AdminSet") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(EVM2EVMOffRampAdminSet) + if err := _EVM2EVMOffRamp.contract.UnpackLog(event, "AdminSet", 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 +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) ParseAdminSet(log types.Log) (*EVM2EVMOffRampAdminSet, error) { + event := new(EVM2EVMOffRampAdminSet) + if err := _EVM2EVMOffRamp.contract.UnpackLog(event, "AdminSet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type EVM2EVMOffRampAlreadyAttemptedIterator struct { + Event *EVM2EVMOffRampAlreadyAttempted + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *EVM2EVMOffRampAlreadyAttemptedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOffRampAlreadyAttempted) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOffRampAlreadyAttempted) + 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() + } +} + +func (it *EVM2EVMOffRampAlreadyAttemptedIterator) Error() error { + return it.fail +} + +func (it *EVM2EVMOffRampAlreadyAttemptedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type EVM2EVMOffRampAlreadyAttempted struct { + SequenceNumber uint64 + Raw types.Log +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) FilterAlreadyAttempted(opts *bind.FilterOpts) (*EVM2EVMOffRampAlreadyAttemptedIterator, error) { + + logs, sub, err := _EVM2EVMOffRamp.contract.FilterLogs(opts, "AlreadyAttempted") + if err != nil { + return nil, err + } + return &EVM2EVMOffRampAlreadyAttemptedIterator{contract: _EVM2EVMOffRamp.contract, event: "AlreadyAttempted", logs: logs, sub: sub}, nil +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) WatchAlreadyAttempted(opts *bind.WatchOpts, sink chan<- *EVM2EVMOffRampAlreadyAttempted) (event.Subscription, error) { + + logs, sub, err := _EVM2EVMOffRamp.contract.WatchLogs(opts, "AlreadyAttempted") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(EVM2EVMOffRampAlreadyAttempted) + if err := _EVM2EVMOffRamp.contract.UnpackLog(event, "AlreadyAttempted", 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 +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) ParseAlreadyAttempted(log types.Log) (*EVM2EVMOffRampAlreadyAttempted, error) { + event := new(EVM2EVMOffRampAlreadyAttempted) + if err := _EVM2EVMOffRamp.contract.UnpackLog(event, "AlreadyAttempted", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type EVM2EVMOffRampConfigChangedIterator struct { + Event *EVM2EVMOffRampConfigChanged + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *EVM2EVMOffRampConfigChangedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOffRampConfigChanged) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOffRampConfigChanged) + 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() + } +} + +func (it *EVM2EVMOffRampConfigChangedIterator) Error() error { + return it.fail +} + +func (it *EVM2EVMOffRampConfigChangedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type EVM2EVMOffRampConfigChanged struct { + Config RateLimiterConfig + Raw types.Log +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) FilterConfigChanged(opts *bind.FilterOpts) (*EVM2EVMOffRampConfigChangedIterator, error) { + + logs, sub, err := _EVM2EVMOffRamp.contract.FilterLogs(opts, "ConfigChanged") + if err != nil { + return nil, err + } + return &EVM2EVMOffRampConfigChangedIterator{contract: _EVM2EVMOffRamp.contract, event: "ConfigChanged", logs: logs, sub: sub}, nil +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) WatchConfigChanged(opts *bind.WatchOpts, sink chan<- *EVM2EVMOffRampConfigChanged) (event.Subscription, error) { + + logs, sub, err := _EVM2EVMOffRamp.contract.WatchLogs(opts, "ConfigChanged") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(EVM2EVMOffRampConfigChanged) + if err := _EVM2EVMOffRamp.contract.UnpackLog(event, "ConfigChanged", 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 +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) ParseConfigChanged(log types.Log) (*EVM2EVMOffRampConfigChanged, error) { + event := new(EVM2EVMOffRampConfigChanged) + if err := _EVM2EVMOffRamp.contract.UnpackLog(event, "ConfigChanged", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type EVM2EVMOffRampConfigSetIterator struct { + Event *EVM2EVMOffRampConfigSet + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *EVM2EVMOffRampConfigSetIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOffRampConfigSet) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOffRampConfigSet) + 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() + } +} + +func (it *EVM2EVMOffRampConfigSetIterator) Error() error { + return it.fail +} + +func (it *EVM2EVMOffRampConfigSetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type EVM2EVMOffRampConfigSet struct { + StaticConfig EVM2EVMOffRampStaticConfig + DynamicConfig EVM2EVMOffRampDynamicConfig + Raw types.Log +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) FilterConfigSet(opts *bind.FilterOpts) (*EVM2EVMOffRampConfigSetIterator, error) { + + logs, sub, err := _EVM2EVMOffRamp.contract.FilterLogs(opts, "ConfigSet") + if err != nil { + return nil, err + } + return &EVM2EVMOffRampConfigSetIterator{contract: _EVM2EVMOffRamp.contract, event: "ConfigSet", logs: logs, sub: sub}, nil +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) WatchConfigSet(opts *bind.WatchOpts, sink chan<- *EVM2EVMOffRampConfigSet) (event.Subscription, error) { + + logs, sub, err := _EVM2EVMOffRamp.contract.WatchLogs(opts, "ConfigSet") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(EVM2EVMOffRampConfigSet) + if err := _EVM2EVMOffRamp.contract.UnpackLog(event, "ConfigSet", 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 +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) ParseConfigSet(log types.Log) (*EVM2EVMOffRampConfigSet, error) { + event := new(EVM2EVMOffRampConfigSet) + if err := _EVM2EVMOffRamp.contract.UnpackLog(event, "ConfigSet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type EVM2EVMOffRampConfigSet0Iterator struct { + Event *EVM2EVMOffRampConfigSet0 + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *EVM2EVMOffRampConfigSet0Iterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOffRampConfigSet0) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOffRampConfigSet0) + 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() + } +} + +func (it *EVM2EVMOffRampConfigSet0Iterator) Error() error { + return it.fail +} + +func (it *EVM2EVMOffRampConfigSet0Iterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type EVM2EVMOffRampConfigSet0 struct { + PreviousConfigBlockNumber uint32 + ConfigDigest [32]byte + ConfigCount uint64 + Signers []common.Address + Transmitters []common.Address + F uint8 + OnchainConfig []byte + OffchainConfigVersion uint64 + OffchainConfig []byte + Raw types.Log +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) FilterConfigSet0(opts *bind.FilterOpts) (*EVM2EVMOffRampConfigSet0Iterator, error) { + + logs, sub, err := _EVM2EVMOffRamp.contract.FilterLogs(opts, "ConfigSet0") + if err != nil { + return nil, err + } + return &EVM2EVMOffRampConfigSet0Iterator{contract: _EVM2EVMOffRamp.contract, event: "ConfigSet0", logs: logs, sub: sub}, nil +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) WatchConfigSet0(opts *bind.WatchOpts, sink chan<- *EVM2EVMOffRampConfigSet0) (event.Subscription, error) { + + logs, sub, err := _EVM2EVMOffRamp.contract.WatchLogs(opts, "ConfigSet0") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(EVM2EVMOffRampConfigSet0) + if err := _EVM2EVMOffRamp.contract.UnpackLog(event, "ConfigSet0", 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 +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) ParseConfigSet0(log types.Log) (*EVM2EVMOffRampConfigSet0, error) { + event := new(EVM2EVMOffRampConfigSet0) + if err := _EVM2EVMOffRamp.contract.UnpackLog(event, "ConfigSet0", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type EVM2EVMOffRampExecutionStateChangedIterator struct { + Event *EVM2EVMOffRampExecutionStateChanged + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *EVM2EVMOffRampExecutionStateChangedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOffRampExecutionStateChanged) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOffRampExecutionStateChanged) + 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() + } +} + +func (it *EVM2EVMOffRampExecutionStateChangedIterator) Error() error { + return it.fail +} + +func (it *EVM2EVMOffRampExecutionStateChangedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type EVM2EVMOffRampExecutionStateChanged struct { + SequenceNumber uint64 + MessageId [32]byte + State uint8 + ReturnData []byte + Raw types.Log +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) FilterExecutionStateChanged(opts *bind.FilterOpts, sequenceNumber []uint64, messageId [][32]byte) (*EVM2EVMOffRampExecutionStateChangedIterator, error) { + + var sequenceNumberRule []interface{} + for _, sequenceNumberItem := range sequenceNumber { + sequenceNumberRule = append(sequenceNumberRule, sequenceNumberItem) + } + var messageIdRule []interface{} + for _, messageIdItem := range messageId { + messageIdRule = append(messageIdRule, messageIdItem) + } + + logs, sub, err := _EVM2EVMOffRamp.contract.FilterLogs(opts, "ExecutionStateChanged", sequenceNumberRule, messageIdRule) + if err != nil { + return nil, err + } + return &EVM2EVMOffRampExecutionStateChangedIterator{contract: _EVM2EVMOffRamp.contract, event: "ExecutionStateChanged", logs: logs, sub: sub}, nil +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) WatchExecutionStateChanged(opts *bind.WatchOpts, sink chan<- *EVM2EVMOffRampExecutionStateChanged, sequenceNumber []uint64, messageId [][32]byte) (event.Subscription, error) { + + var sequenceNumberRule []interface{} + for _, sequenceNumberItem := range sequenceNumber { + sequenceNumberRule = append(sequenceNumberRule, sequenceNumberItem) + } + var messageIdRule []interface{} + for _, messageIdItem := range messageId { + messageIdRule = append(messageIdRule, messageIdItem) + } + + logs, sub, err := _EVM2EVMOffRamp.contract.WatchLogs(opts, "ExecutionStateChanged", sequenceNumberRule, messageIdRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(EVM2EVMOffRampExecutionStateChanged) + if err := _EVM2EVMOffRamp.contract.UnpackLog(event, "ExecutionStateChanged", 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 +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) ParseExecutionStateChanged(log types.Log) (*EVM2EVMOffRampExecutionStateChanged, error) { + event := new(EVM2EVMOffRampExecutionStateChanged) + if err := _EVM2EVMOffRamp.contract.UnpackLog(event, "ExecutionStateChanged", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type EVM2EVMOffRampOwnershipTransferRequestedIterator struct { + Event *EVM2EVMOffRampOwnershipTransferRequested + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *EVM2EVMOffRampOwnershipTransferRequestedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOffRampOwnershipTransferRequested) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOffRampOwnershipTransferRequested) + 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() + } +} + +func (it *EVM2EVMOffRampOwnershipTransferRequestedIterator) Error() error { + return it.fail +} + +func (it *EVM2EVMOffRampOwnershipTransferRequestedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type EVM2EVMOffRampOwnershipTransferRequested struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*EVM2EVMOffRampOwnershipTransferRequestedIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _EVM2EVMOffRamp.contract.FilterLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return &EVM2EVMOffRampOwnershipTransferRequestedIterator{contract: _EVM2EVMOffRamp.contract, event: "OwnershipTransferRequested", logs: logs, sub: sub}, nil +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *EVM2EVMOffRampOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _EVM2EVMOffRamp.contract.WatchLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(EVM2EVMOffRampOwnershipTransferRequested) + if err := _EVM2EVMOffRamp.contract.UnpackLog(event, "OwnershipTransferRequested", 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 +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) ParseOwnershipTransferRequested(log types.Log) (*EVM2EVMOffRampOwnershipTransferRequested, error) { + event := new(EVM2EVMOffRampOwnershipTransferRequested) + if err := _EVM2EVMOffRamp.contract.UnpackLog(event, "OwnershipTransferRequested", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type EVM2EVMOffRampOwnershipTransferredIterator struct { + Event *EVM2EVMOffRampOwnershipTransferred + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *EVM2EVMOffRampOwnershipTransferredIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOffRampOwnershipTransferred) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOffRampOwnershipTransferred) + 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() + } +} + +func (it *EVM2EVMOffRampOwnershipTransferredIterator) Error() error { + return it.fail +} + +func (it *EVM2EVMOffRampOwnershipTransferredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type EVM2EVMOffRampOwnershipTransferred struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*EVM2EVMOffRampOwnershipTransferredIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _EVM2EVMOffRamp.contract.FilterLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return &EVM2EVMOffRampOwnershipTransferredIterator{contract: _EVM2EVMOffRamp.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *EVM2EVMOffRampOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _EVM2EVMOffRamp.contract.WatchLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(EVM2EVMOffRampOwnershipTransferred) + if err := _EVM2EVMOffRamp.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 +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) ParseOwnershipTransferred(log types.Log) (*EVM2EVMOffRampOwnershipTransferred, error) { + event := new(EVM2EVMOffRampOwnershipTransferred) + if err := _EVM2EVMOffRamp.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type EVM2EVMOffRampSkippedAlreadyExecutedMessageIterator struct { + Event *EVM2EVMOffRampSkippedAlreadyExecutedMessage + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *EVM2EVMOffRampSkippedAlreadyExecutedMessageIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOffRampSkippedAlreadyExecutedMessage) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOffRampSkippedAlreadyExecutedMessage) + 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() + } +} + +func (it *EVM2EVMOffRampSkippedAlreadyExecutedMessageIterator) Error() error { + return it.fail +} + +func (it *EVM2EVMOffRampSkippedAlreadyExecutedMessageIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type EVM2EVMOffRampSkippedAlreadyExecutedMessage struct { + SequenceNumber uint64 + Raw types.Log +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) FilterSkippedAlreadyExecutedMessage(opts *bind.FilterOpts, sequenceNumber []uint64) (*EVM2EVMOffRampSkippedAlreadyExecutedMessageIterator, error) { + + var sequenceNumberRule []interface{} + for _, sequenceNumberItem := range sequenceNumber { + sequenceNumberRule = append(sequenceNumberRule, sequenceNumberItem) + } + + logs, sub, err := _EVM2EVMOffRamp.contract.FilterLogs(opts, "SkippedAlreadyExecutedMessage", sequenceNumberRule) + if err != nil { + return nil, err + } + return &EVM2EVMOffRampSkippedAlreadyExecutedMessageIterator{contract: _EVM2EVMOffRamp.contract, event: "SkippedAlreadyExecutedMessage", logs: logs, sub: sub}, nil +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) WatchSkippedAlreadyExecutedMessage(opts *bind.WatchOpts, sink chan<- *EVM2EVMOffRampSkippedAlreadyExecutedMessage, sequenceNumber []uint64) (event.Subscription, error) { + + var sequenceNumberRule []interface{} + for _, sequenceNumberItem := range sequenceNumber { + sequenceNumberRule = append(sequenceNumberRule, sequenceNumberItem) + } + + logs, sub, err := _EVM2EVMOffRamp.contract.WatchLogs(opts, "SkippedAlreadyExecutedMessage", sequenceNumberRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(EVM2EVMOffRampSkippedAlreadyExecutedMessage) + if err := _EVM2EVMOffRamp.contract.UnpackLog(event, "SkippedAlreadyExecutedMessage", 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 +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) ParseSkippedAlreadyExecutedMessage(log types.Log) (*EVM2EVMOffRampSkippedAlreadyExecutedMessage, error) { + event := new(EVM2EVMOffRampSkippedAlreadyExecutedMessage) + if err := _EVM2EVMOffRamp.contract.UnpackLog(event, "SkippedAlreadyExecutedMessage", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type EVM2EVMOffRampSkippedIncorrectNonceIterator struct { + Event *EVM2EVMOffRampSkippedIncorrectNonce + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *EVM2EVMOffRampSkippedIncorrectNonceIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOffRampSkippedIncorrectNonce) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOffRampSkippedIncorrectNonce) + 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() + } +} + +func (it *EVM2EVMOffRampSkippedIncorrectNonceIterator) Error() error { + return it.fail +} + +func (it *EVM2EVMOffRampSkippedIncorrectNonceIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type EVM2EVMOffRampSkippedIncorrectNonce struct { + Nonce uint64 + Sender common.Address + Raw types.Log +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) FilterSkippedIncorrectNonce(opts *bind.FilterOpts, nonce []uint64, sender []common.Address) (*EVM2EVMOffRampSkippedIncorrectNonceIterator, error) { + + var nonceRule []interface{} + for _, nonceItem := range nonce { + nonceRule = append(nonceRule, nonceItem) + } + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _EVM2EVMOffRamp.contract.FilterLogs(opts, "SkippedIncorrectNonce", nonceRule, senderRule) + if err != nil { + return nil, err + } + return &EVM2EVMOffRampSkippedIncorrectNonceIterator{contract: _EVM2EVMOffRamp.contract, event: "SkippedIncorrectNonce", logs: logs, sub: sub}, nil +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) WatchSkippedIncorrectNonce(opts *bind.WatchOpts, sink chan<- *EVM2EVMOffRampSkippedIncorrectNonce, nonce []uint64, sender []common.Address) (event.Subscription, error) { + + var nonceRule []interface{} + for _, nonceItem := range nonce { + nonceRule = append(nonceRule, nonceItem) + } + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _EVM2EVMOffRamp.contract.WatchLogs(opts, "SkippedIncorrectNonce", nonceRule, senderRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(EVM2EVMOffRampSkippedIncorrectNonce) + if err := _EVM2EVMOffRamp.contract.UnpackLog(event, "SkippedIncorrectNonce", 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 +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) ParseSkippedIncorrectNonce(log types.Log) (*EVM2EVMOffRampSkippedIncorrectNonce, error) { + event := new(EVM2EVMOffRampSkippedIncorrectNonce) + if err := _EVM2EVMOffRamp.contract.UnpackLog(event, "SkippedIncorrectNonce", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflightIterator struct { + Event *EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflight + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflightIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflight) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflight) + 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() + } +} + +func (it *EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflightIterator) Error() error { + return it.fail +} + +func (it *EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflightIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflight struct { + Nonce uint64 + Sender common.Address + Raw types.Log +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) FilterSkippedSenderWithPreviousRampMessageInflight(opts *bind.FilterOpts, nonce []uint64, sender []common.Address) (*EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflightIterator, error) { + + var nonceRule []interface{} + for _, nonceItem := range nonce { + nonceRule = append(nonceRule, nonceItem) + } + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _EVM2EVMOffRamp.contract.FilterLogs(opts, "SkippedSenderWithPreviousRampMessageInflight", nonceRule, senderRule) + if err != nil { + return nil, err + } + return &EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflightIterator{contract: _EVM2EVMOffRamp.contract, event: "SkippedSenderWithPreviousRampMessageInflight", logs: logs, sub: sub}, nil +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) WatchSkippedSenderWithPreviousRampMessageInflight(opts *bind.WatchOpts, sink chan<- *EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflight, nonce []uint64, sender []common.Address) (event.Subscription, error) { + + var nonceRule []interface{} + for _, nonceItem := range nonce { + nonceRule = append(nonceRule, nonceItem) + } + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _EVM2EVMOffRamp.contract.WatchLogs(opts, "SkippedSenderWithPreviousRampMessageInflight", nonceRule, senderRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflight) + if err := _EVM2EVMOffRamp.contract.UnpackLog(event, "SkippedSenderWithPreviousRampMessageInflight", 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 +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) ParseSkippedSenderWithPreviousRampMessageInflight(log types.Log) (*EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflight, error) { + event := new(EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflight) + if err := _EVM2EVMOffRamp.contract.UnpackLog(event, "SkippedSenderWithPreviousRampMessageInflight", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type EVM2EVMOffRampTokenAggregateRateLimitAddedIterator struct { + Event *EVM2EVMOffRampTokenAggregateRateLimitAdded + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *EVM2EVMOffRampTokenAggregateRateLimitAddedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOffRampTokenAggregateRateLimitAdded) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOffRampTokenAggregateRateLimitAdded) + 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() + } +} + +func (it *EVM2EVMOffRampTokenAggregateRateLimitAddedIterator) Error() error { + return it.fail +} + +func (it *EVM2EVMOffRampTokenAggregateRateLimitAddedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type EVM2EVMOffRampTokenAggregateRateLimitAdded struct { + SourceToken common.Address + DestToken common.Address + Raw types.Log +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) FilterTokenAggregateRateLimitAdded(opts *bind.FilterOpts) (*EVM2EVMOffRampTokenAggregateRateLimitAddedIterator, error) { + + logs, sub, err := _EVM2EVMOffRamp.contract.FilterLogs(opts, "TokenAggregateRateLimitAdded") + if err != nil { + return nil, err + } + return &EVM2EVMOffRampTokenAggregateRateLimitAddedIterator{contract: _EVM2EVMOffRamp.contract, event: "TokenAggregateRateLimitAdded", logs: logs, sub: sub}, nil +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) WatchTokenAggregateRateLimitAdded(opts *bind.WatchOpts, sink chan<- *EVM2EVMOffRampTokenAggregateRateLimitAdded) (event.Subscription, error) { + + logs, sub, err := _EVM2EVMOffRamp.contract.WatchLogs(opts, "TokenAggregateRateLimitAdded") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(EVM2EVMOffRampTokenAggregateRateLimitAdded) + if err := _EVM2EVMOffRamp.contract.UnpackLog(event, "TokenAggregateRateLimitAdded", 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 +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) ParseTokenAggregateRateLimitAdded(log types.Log) (*EVM2EVMOffRampTokenAggregateRateLimitAdded, error) { + event := new(EVM2EVMOffRampTokenAggregateRateLimitAdded) + if err := _EVM2EVMOffRamp.contract.UnpackLog(event, "TokenAggregateRateLimitAdded", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type EVM2EVMOffRampTokenAggregateRateLimitRemovedIterator struct { + Event *EVM2EVMOffRampTokenAggregateRateLimitRemoved + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *EVM2EVMOffRampTokenAggregateRateLimitRemovedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOffRampTokenAggregateRateLimitRemoved) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOffRampTokenAggregateRateLimitRemoved) + 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() + } +} + +func (it *EVM2EVMOffRampTokenAggregateRateLimitRemovedIterator) Error() error { + return it.fail +} + +func (it *EVM2EVMOffRampTokenAggregateRateLimitRemovedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type EVM2EVMOffRampTokenAggregateRateLimitRemoved struct { + SourceToken common.Address + DestToken common.Address + Raw types.Log +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) FilterTokenAggregateRateLimitRemoved(opts *bind.FilterOpts) (*EVM2EVMOffRampTokenAggregateRateLimitRemovedIterator, error) { + + logs, sub, err := _EVM2EVMOffRamp.contract.FilterLogs(opts, "TokenAggregateRateLimitRemoved") + if err != nil { + return nil, err + } + return &EVM2EVMOffRampTokenAggregateRateLimitRemovedIterator{contract: _EVM2EVMOffRamp.contract, event: "TokenAggregateRateLimitRemoved", logs: logs, sub: sub}, nil +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) WatchTokenAggregateRateLimitRemoved(opts *bind.WatchOpts, sink chan<- *EVM2EVMOffRampTokenAggregateRateLimitRemoved) (event.Subscription, error) { + + logs, sub, err := _EVM2EVMOffRamp.contract.WatchLogs(opts, "TokenAggregateRateLimitRemoved") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(EVM2EVMOffRampTokenAggregateRateLimitRemoved) + if err := _EVM2EVMOffRamp.contract.UnpackLog(event, "TokenAggregateRateLimitRemoved", 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 +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) ParseTokenAggregateRateLimitRemoved(log types.Log) (*EVM2EVMOffRampTokenAggregateRateLimitRemoved, error) { + event := new(EVM2EVMOffRampTokenAggregateRateLimitRemoved) + if err := _EVM2EVMOffRamp.contract.UnpackLog(event, "TokenAggregateRateLimitRemoved", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type EVM2EVMOffRampTokensConsumedIterator struct { + Event *EVM2EVMOffRampTokensConsumed + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *EVM2EVMOffRampTokensConsumedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOffRampTokensConsumed) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOffRampTokensConsumed) + 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() + } +} + +func (it *EVM2EVMOffRampTokensConsumedIterator) Error() error { + return it.fail +} + +func (it *EVM2EVMOffRampTokensConsumedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type EVM2EVMOffRampTokensConsumed struct { + Tokens *big.Int + Raw types.Log +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) FilterTokensConsumed(opts *bind.FilterOpts) (*EVM2EVMOffRampTokensConsumedIterator, error) { + + logs, sub, err := _EVM2EVMOffRamp.contract.FilterLogs(opts, "TokensConsumed") + if err != nil { + return nil, err + } + return &EVM2EVMOffRampTokensConsumedIterator{contract: _EVM2EVMOffRamp.contract, event: "TokensConsumed", logs: logs, sub: sub}, nil +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) WatchTokensConsumed(opts *bind.WatchOpts, sink chan<- *EVM2EVMOffRampTokensConsumed) (event.Subscription, error) { + + logs, sub, err := _EVM2EVMOffRamp.contract.WatchLogs(opts, "TokensConsumed") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(EVM2EVMOffRampTokensConsumed) + if err := _EVM2EVMOffRamp.contract.UnpackLog(event, "TokensConsumed", 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 +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) ParseTokensConsumed(log types.Log) (*EVM2EVMOffRampTokensConsumed, error) { + event := new(EVM2EVMOffRampTokensConsumed) + if err := _EVM2EVMOffRamp.contract.UnpackLog(event, "TokensConsumed", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type EVM2EVMOffRampTransmittedIterator struct { + Event *EVM2EVMOffRampTransmitted + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *EVM2EVMOffRampTransmittedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOffRampTransmitted) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOffRampTransmitted) + 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() + } +} + +func (it *EVM2EVMOffRampTransmittedIterator) Error() error { + return it.fail +} + +func (it *EVM2EVMOffRampTransmittedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type EVM2EVMOffRampTransmitted struct { + ConfigDigest [32]byte + Epoch uint32 + Raw types.Log +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) FilterTransmitted(opts *bind.FilterOpts) (*EVM2EVMOffRampTransmittedIterator, error) { + + logs, sub, err := _EVM2EVMOffRamp.contract.FilterLogs(opts, "Transmitted") + if err != nil { + return nil, err + } + return &EVM2EVMOffRampTransmittedIterator{contract: _EVM2EVMOffRamp.contract, event: "Transmitted", logs: logs, sub: sub}, nil +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) WatchTransmitted(opts *bind.WatchOpts, sink chan<- *EVM2EVMOffRampTransmitted) (event.Subscription, error) { + + logs, sub, err := _EVM2EVMOffRamp.contract.WatchLogs(opts, "Transmitted") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(EVM2EVMOffRampTransmitted) + if err := _EVM2EVMOffRamp.contract.UnpackLog(event, "Transmitted", 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 +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) ParseTransmitted(log types.Log) (*EVM2EVMOffRampTransmitted, error) { + event := new(EVM2EVMOffRampTransmitted) + if err := _EVM2EVMOffRamp.contract.UnpackLog(event, "Transmitted", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type GetAllRateLimitTokens struct { + SourceTokens []common.Address + DestTokens []common.Address +} +type LatestConfigDetails struct { + ConfigCount uint32 + BlockNumber uint32 + ConfigDigest [32]byte +} +type LatestConfigDigestAndEpoch struct { + ScanLogs bool + ConfigDigest [32]byte + Epoch uint32 +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRamp) ParseLog(log types.Log) (generated.AbigenLog, error) { + switch log.Topics[0] { + case _EVM2EVMOffRamp.abi.Events["AdminSet"].ID: + return _EVM2EVMOffRamp.ParseAdminSet(log) + case _EVM2EVMOffRamp.abi.Events["AlreadyAttempted"].ID: + return _EVM2EVMOffRamp.ParseAlreadyAttempted(log) + case _EVM2EVMOffRamp.abi.Events["ConfigChanged"].ID: + return _EVM2EVMOffRamp.ParseConfigChanged(log) + case _EVM2EVMOffRamp.abi.Events["ConfigSet"].ID: + return _EVM2EVMOffRamp.ParseConfigSet(log) + case _EVM2EVMOffRamp.abi.Events["ConfigSet0"].ID: + return _EVM2EVMOffRamp.ParseConfigSet0(log) + case _EVM2EVMOffRamp.abi.Events["ExecutionStateChanged"].ID: + return _EVM2EVMOffRamp.ParseExecutionStateChanged(log) + case _EVM2EVMOffRamp.abi.Events["OwnershipTransferRequested"].ID: + return _EVM2EVMOffRamp.ParseOwnershipTransferRequested(log) + case _EVM2EVMOffRamp.abi.Events["OwnershipTransferred"].ID: + return _EVM2EVMOffRamp.ParseOwnershipTransferred(log) + case _EVM2EVMOffRamp.abi.Events["SkippedAlreadyExecutedMessage"].ID: + return _EVM2EVMOffRamp.ParseSkippedAlreadyExecutedMessage(log) + case _EVM2EVMOffRamp.abi.Events["SkippedIncorrectNonce"].ID: + return _EVM2EVMOffRamp.ParseSkippedIncorrectNonce(log) + case _EVM2EVMOffRamp.abi.Events["SkippedSenderWithPreviousRampMessageInflight"].ID: + return _EVM2EVMOffRamp.ParseSkippedSenderWithPreviousRampMessageInflight(log) + case _EVM2EVMOffRamp.abi.Events["TokenAggregateRateLimitAdded"].ID: + return _EVM2EVMOffRamp.ParseTokenAggregateRateLimitAdded(log) + case _EVM2EVMOffRamp.abi.Events["TokenAggregateRateLimitRemoved"].ID: + return _EVM2EVMOffRamp.ParseTokenAggregateRateLimitRemoved(log) + case _EVM2EVMOffRamp.abi.Events["TokensConsumed"].ID: + return _EVM2EVMOffRamp.ParseTokensConsumed(log) + case _EVM2EVMOffRamp.abi.Events["Transmitted"].ID: + return _EVM2EVMOffRamp.ParseTransmitted(log) + + default: + return nil, fmt.Errorf("abigen wrapper received unknown log topic: %v", log.Topics[0]) + } +} + +func (EVM2EVMOffRampAdminSet) Topic() common.Hash { + return common.HexToHash("0x8fe72c3e0020beb3234e76ae6676fa576fbfcae600af1c4fea44784cf0db329c") +} + +func (EVM2EVMOffRampAlreadyAttempted) Topic() common.Hash { + return common.HexToHash("0x67d9ba0f63d427c482c2736300e6d5a34c6691dbcdea8ad35828a1f1ba47e872") +} + +func (EVM2EVMOffRampConfigChanged) Topic() common.Hash { + return common.HexToHash("0x9ea3374b67bf275e6bb9c8ae68f9cae023e1c528b4b27e092f0bb209d3531c19") +} + +func (EVM2EVMOffRampConfigSet) Topic() common.Hash { + return common.HexToHash("0x7879e20bb60a503429de4a2c912b5904f08a39f2af054c10fb46434b5d611260") +} + +func (EVM2EVMOffRampConfigSet0) Topic() common.Hash { + return common.HexToHash("0x1591690b8638f5fb2dbec82ac741805ac5da8b45dc5263f4875b0496fdce4e05") +} + +func (EVM2EVMOffRampExecutionStateChanged) Topic() common.Hash { + return common.HexToHash("0xd4f851956a5d67c3997d1c9205045fef79bae2947fdee7e9e2641abc7391ef65") +} + +func (EVM2EVMOffRampOwnershipTransferRequested) Topic() common.Hash { + return common.HexToHash("0xed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae1278") +} + +func (EVM2EVMOffRampOwnershipTransferred) Topic() common.Hash { + return common.HexToHash("0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0") +} + +func (EVM2EVMOffRampSkippedAlreadyExecutedMessage) Topic() common.Hash { + return common.HexToHash("0xe3dd0bec917c965a133ddb2c84874725ee1e2fd8d763c19efa36d6a11cd82b1f") +} + +func (EVM2EVMOffRampSkippedIncorrectNonce) Topic() common.Hash { + return common.HexToHash("0xd32ddb11d71e3d63411d37b09f9a8b28664f1cb1338bfd1413c173b0ebf41237") +} + +func (EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflight) Topic() common.Hash { + return common.HexToHash("0xe44a20935573a783dd0d5991c92d7b6a0eb3173566530364db3ec10e9a990b5d") +} + +func (EVM2EVMOffRampTokenAggregateRateLimitAdded) Topic() common.Hash { + return common.HexToHash("0xfc23abf7ddbd3c02b1420dafa2355c56c1a06fbb8723862ac14d6bd74177361a") +} + +func (EVM2EVMOffRampTokenAggregateRateLimitRemoved) Topic() common.Hash { + return common.HexToHash("0xcbf3cbeaed4ac1d605ed30f4af06c35acaeff2379db7f6146c9cceee83d58782") +} + +func (EVM2EVMOffRampTokensConsumed) Topic() common.Hash { + return common.HexToHash("0x1871cdf8010e63f2eb8384381a68dfa7416dc571a5517e66e88b2d2d0c0a690a") +} + +func (EVM2EVMOffRampTransmitted) Topic() common.Hash { + return common.HexToHash("0xb04e63db38c49950639fa09d29872f21f5d49d614f3a969d8adf3d4b52e41a62") +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRamp) Address() common.Address { + return _EVM2EVMOffRamp.address +} + +type EVM2EVMOffRampInterface interface { + CcipReceive(opts *bind.CallOpts, arg0 ClientAny2EVMMessage) error + + CurrentRateLimiterState(opts *bind.CallOpts) (RateLimiterTokenBucket, error) + + GetAllRateLimitTokens(opts *bind.CallOpts) (GetAllRateLimitTokens, + + error) + + GetDynamicConfig(opts *bind.CallOpts) (EVM2EVMOffRampDynamicConfig, error) + + GetExecutionState(opts *bind.CallOpts, sequenceNumber uint64) (uint8, error) + + GetSenderNonce(opts *bind.CallOpts, sender common.Address) (uint64, error) + + GetStaticConfig(opts *bind.CallOpts) (EVM2EVMOffRampStaticConfig, error) + + GetTokenLimitAdmin(opts *bind.CallOpts) (common.Address, error) + + GetTransmitters(opts *bind.CallOpts) ([]common.Address, error) + + LatestConfigDetails(opts *bind.CallOpts) (LatestConfigDetails, + + error) + + LatestConfigDigestAndEpoch(opts *bind.CallOpts) (LatestConfigDigestAndEpoch, + + error) + + Owner(opts *bind.CallOpts) (common.Address, error) + + TypeAndVersion(opts *bind.CallOpts) (string, error) + + AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) + + ExecuteSingleMessage(opts *bind.TransactOpts, message InternalEVM2EVMMessage, offchainTokenData [][]byte, tokenGasOverrides []uint32) (*types.Transaction, error) + + ManuallyExecute(opts *bind.TransactOpts, report InternalExecutionReport, gasLimitOverrides []EVM2EVMOffRampGasLimitOverride) (*types.Transaction, error) + + SetAdmin(opts *bind.TransactOpts, newAdmin common.Address) (*types.Transaction, error) + + SetOCR2Config(opts *bind.TransactOpts, signers []common.Address, transmitters []common.Address, f uint8, onchainConfig []byte, offchainConfigVersion uint64, offchainConfig []byte) (*types.Transaction, error) + + SetRateLimiterConfig(opts *bind.TransactOpts, config RateLimiterConfig) (*types.Transaction, error) + + TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) + + Transmit(opts *bind.TransactOpts, reportContext [3][32]byte, report []byte, rs [][32]byte, ss [][32]byte, arg4 [32]byte) (*types.Transaction, error) + + UpdateRateLimitTokens(opts *bind.TransactOpts, removes []EVM2EVMOffRampRateLimitToken, adds []EVM2EVMOffRampRateLimitToken) (*types.Transaction, error) + + FilterAdminSet(opts *bind.FilterOpts) (*EVM2EVMOffRampAdminSetIterator, error) + + WatchAdminSet(opts *bind.WatchOpts, sink chan<- *EVM2EVMOffRampAdminSet) (event.Subscription, error) + + ParseAdminSet(log types.Log) (*EVM2EVMOffRampAdminSet, error) + + FilterAlreadyAttempted(opts *bind.FilterOpts) (*EVM2EVMOffRampAlreadyAttemptedIterator, error) + + WatchAlreadyAttempted(opts *bind.WatchOpts, sink chan<- *EVM2EVMOffRampAlreadyAttempted) (event.Subscription, error) + + ParseAlreadyAttempted(log types.Log) (*EVM2EVMOffRampAlreadyAttempted, error) + + FilterConfigChanged(opts *bind.FilterOpts) (*EVM2EVMOffRampConfigChangedIterator, error) + + WatchConfigChanged(opts *bind.WatchOpts, sink chan<- *EVM2EVMOffRampConfigChanged) (event.Subscription, error) + + ParseConfigChanged(log types.Log) (*EVM2EVMOffRampConfigChanged, error) + + FilterConfigSet(opts *bind.FilterOpts) (*EVM2EVMOffRampConfigSetIterator, error) + + WatchConfigSet(opts *bind.WatchOpts, sink chan<- *EVM2EVMOffRampConfigSet) (event.Subscription, error) + + ParseConfigSet(log types.Log) (*EVM2EVMOffRampConfigSet, error) + + FilterConfigSet0(opts *bind.FilterOpts) (*EVM2EVMOffRampConfigSet0Iterator, error) + + WatchConfigSet0(opts *bind.WatchOpts, sink chan<- *EVM2EVMOffRampConfigSet0) (event.Subscription, error) + + ParseConfigSet0(log types.Log) (*EVM2EVMOffRampConfigSet0, error) + + FilterExecutionStateChanged(opts *bind.FilterOpts, sequenceNumber []uint64, messageId [][32]byte) (*EVM2EVMOffRampExecutionStateChangedIterator, error) + + WatchExecutionStateChanged(opts *bind.WatchOpts, sink chan<- *EVM2EVMOffRampExecutionStateChanged, sequenceNumber []uint64, messageId [][32]byte) (event.Subscription, error) + + ParseExecutionStateChanged(log types.Log) (*EVM2EVMOffRampExecutionStateChanged, error) + + FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*EVM2EVMOffRampOwnershipTransferRequestedIterator, error) + + WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *EVM2EVMOffRampOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferRequested(log types.Log) (*EVM2EVMOffRampOwnershipTransferRequested, error) + + FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*EVM2EVMOffRampOwnershipTransferredIterator, error) + + WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *EVM2EVMOffRampOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferred(log types.Log) (*EVM2EVMOffRampOwnershipTransferred, error) + + FilterSkippedAlreadyExecutedMessage(opts *bind.FilterOpts, sequenceNumber []uint64) (*EVM2EVMOffRampSkippedAlreadyExecutedMessageIterator, error) + + WatchSkippedAlreadyExecutedMessage(opts *bind.WatchOpts, sink chan<- *EVM2EVMOffRampSkippedAlreadyExecutedMessage, sequenceNumber []uint64) (event.Subscription, error) + + ParseSkippedAlreadyExecutedMessage(log types.Log) (*EVM2EVMOffRampSkippedAlreadyExecutedMessage, error) + + FilterSkippedIncorrectNonce(opts *bind.FilterOpts, nonce []uint64, sender []common.Address) (*EVM2EVMOffRampSkippedIncorrectNonceIterator, error) + + WatchSkippedIncorrectNonce(opts *bind.WatchOpts, sink chan<- *EVM2EVMOffRampSkippedIncorrectNonce, nonce []uint64, sender []common.Address) (event.Subscription, error) + + ParseSkippedIncorrectNonce(log types.Log) (*EVM2EVMOffRampSkippedIncorrectNonce, error) + + FilterSkippedSenderWithPreviousRampMessageInflight(opts *bind.FilterOpts, nonce []uint64, sender []common.Address) (*EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflightIterator, error) + + WatchSkippedSenderWithPreviousRampMessageInflight(opts *bind.WatchOpts, sink chan<- *EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflight, nonce []uint64, sender []common.Address) (event.Subscription, error) + + ParseSkippedSenderWithPreviousRampMessageInflight(log types.Log) (*EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflight, error) + + FilterTokenAggregateRateLimitAdded(opts *bind.FilterOpts) (*EVM2EVMOffRampTokenAggregateRateLimitAddedIterator, error) + + WatchTokenAggregateRateLimitAdded(opts *bind.WatchOpts, sink chan<- *EVM2EVMOffRampTokenAggregateRateLimitAdded) (event.Subscription, error) + + ParseTokenAggregateRateLimitAdded(log types.Log) (*EVM2EVMOffRampTokenAggregateRateLimitAdded, error) + + FilterTokenAggregateRateLimitRemoved(opts *bind.FilterOpts) (*EVM2EVMOffRampTokenAggregateRateLimitRemovedIterator, error) + + WatchTokenAggregateRateLimitRemoved(opts *bind.WatchOpts, sink chan<- *EVM2EVMOffRampTokenAggregateRateLimitRemoved) (event.Subscription, error) + + ParseTokenAggregateRateLimitRemoved(log types.Log) (*EVM2EVMOffRampTokenAggregateRateLimitRemoved, error) + + FilterTokensConsumed(opts *bind.FilterOpts) (*EVM2EVMOffRampTokensConsumedIterator, error) + + WatchTokensConsumed(opts *bind.WatchOpts, sink chan<- *EVM2EVMOffRampTokensConsumed) (event.Subscription, error) + + ParseTokensConsumed(log types.Log) (*EVM2EVMOffRampTokensConsumed, error) + + FilterTransmitted(opts *bind.FilterOpts) (*EVM2EVMOffRampTransmittedIterator, error) + + WatchTransmitted(opts *bind.WatchOpts, sink chan<- *EVM2EVMOffRampTransmitted) (event.Subscription, error) + + ParseTransmitted(log types.Log) (*EVM2EVMOffRampTransmitted, error) + + ParseLog(log types.Log) (generated.AbigenLog, error) + + Address() common.Address +} diff --git a/core/gethwrappers/ccip/generated/evm_2_evm_offramp_1_0_0/evm_2_evm_offramp_1_0_0.go b/core/gethwrappers/ccip/generated/evm_2_evm_offramp_1_0_0/evm_2_evm_offramp_1_0_0.go new file mode 100644 index 00000000000..3f140f8a3a5 --- /dev/null +++ b/core/gethwrappers/ccip/generated/evm_2_evm_offramp_1_0_0/evm_2_evm_offramp_1_0_0.go @@ -0,0 +1,2354 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package evm_2_evm_offramp_1_0_0 + +import ( + "errors" + "fmt" + "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" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" +) + +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +type ClientAny2EVMMessage struct { + MessageId [32]byte + SourceChainSelector uint64 + Sender []byte + Data []byte + DestTokenAmounts []ClientEVMTokenAmount +} + +type ClientEVMTokenAmount struct { + Token common.Address + Amount *big.Int +} + +type EVM2EVMOffRampDynamicConfig struct { + PermissionLessExecutionThresholdSeconds uint32 + Router common.Address + PriceRegistry common.Address + MaxTokensLength uint16 + MaxDataSize uint32 +} + +type EVM2EVMOffRampStaticConfig struct { + CommitStore common.Address + ChainSelector uint64 + SourceChainSelector uint64 + OnRamp common.Address + PrevOffRamp common.Address + ArmProxy common.Address +} + +type InternalEVM2EVMMessage struct { + SourceChainSelector uint64 + SequenceNumber uint64 + FeeTokenAmount *big.Int + Sender common.Address + Nonce uint64 + GasLimit *big.Int + Strict bool + Receiver common.Address + Data []byte + TokenAmounts []ClientEVMTokenAmount + FeeToken common.Address + MessageId [32]byte +} + +type InternalExecutionReport struct { + Messages []InternalEVM2EVMMessage + OffchainTokenData [][][]byte + Proofs [][32]byte + ProofFlagBits *big.Int +} + +type InternalPoolUpdate struct { + Token common.Address + Pool common.Address +} + +type RateLimiterConfig struct { + IsEnabled bool + Capacity *big.Int + Rate *big.Int +} + +type RateLimiterTokenBucket struct { + Tokens *big.Int + LastUpdated uint32 + IsEnabled bool + Capacity *big.Int + Rate *big.Int +} + +var EVM2EVMOffRampMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"commitStore\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"onRamp\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"prevOffRamp\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"armProxy\",\"type\":\"address\"}],\"internalType\":\"structEVM2EVMOffRamp.StaticConfig\",\"name\":\"staticConfig\",\"type\":\"tuple\"},{\"internalType\":\"contractIERC20[]\",\"name\":\"sourceTokens\",\"type\":\"address[]\"},{\"internalType\":\"contractIPool[]\",\"name\":\"pools\",\"type\":\"address[]\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"rateLimiterConfig\",\"type\":\"tuple\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"capacity\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"requested\",\"type\":\"uint256\"}],\"name\":\"AggregateValueMaxCapacityExceeded\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"minWaitInSeconds\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"available\",\"type\":\"uint256\"}],\"name\":\"AggregateValueRateLimitReached\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"sequenceNumber\",\"type\":\"uint64\"}],\"name\":\"AlreadyAttempted\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"sequenceNumber\",\"type\":\"uint64\"}],\"name\":\"AlreadyExecuted\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"BadARMSignal\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"BucketOverfilled\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"CanOnlySelfCall\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"CommitStoreAlreadyInUse\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"expected\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"actual\",\"type\":\"bytes32\"}],\"name\":\"ConfigDigestMismatch\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"EmptyReport\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"error\",\"type\":\"bytes\"}],\"name\":\"ExecutionError\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expected\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"actual\",\"type\":\"uint256\"}],\"name\":\"ForkedChain\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"message\",\"type\":\"string\"}],\"name\":\"InvalidConfig\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"newLimit\",\"type\":\"uint256\"}],\"name\":\"InvalidManualExecutionGasLimit\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidMessageId\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"sequenceNumber\",\"type\":\"uint64\"},{\"internalType\":\"enumInternal.MessageExecutionState\",\"name\":\"newState\",\"type\":\"uint8\"}],\"name\":\"InvalidNewState\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"}],\"name\":\"InvalidSourceChain\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidTokenPoolConfig\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ManualExecutionGasLimitMismatch\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ManualExecutionNotYetEnabled\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"maxSize\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"actualSize\",\"type\":\"uint256\"}],\"name\":\"MessageTooLarge\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCallableByAdminOrOwner\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OracleCannotBeZeroAddress\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"PoolAlreadyAdded\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"PoolDoesNotExist\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"PriceNotFoundForToken\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"error\",\"type\":\"bytes\"}],\"name\":\"ReceiverError\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RootNotCommitted\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"sequenceNumber\",\"type\":\"uint64\"}],\"name\":\"TokenDataMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"error\",\"type\":\"bytes\"}],\"name\":\"TokenHandlingError\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"capacity\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"requested\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"}],\"name\":\"TokenMaxCapacityExceeded\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TokenPoolMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"error\",\"type\":\"bytes\"}],\"name\":\"TokenRateLimitError\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"minWaitInSeconds\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"available\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"}],\"name\":\"TokenRateLimitReached\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UnauthorizedTransmitter\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UnexpectedTokenData\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"sequenceNumber\",\"type\":\"uint64\"}],\"name\":\"UnsupportedNumberOfTokens\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"contractIERC20\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"UnsupportedToken\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expected\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"actual\",\"type\":\"uint256\"}],\"name\":\"WrongMessageLength\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddressNotAllowed\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"commitStore\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"onRamp\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"prevOffRamp\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"armProxy\",\"type\":\"address\"}],\"indexed\":false,\"internalType\":\"structEVM2EVMOffRamp.StaticConfig\",\"name\":\"staticConfig\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint32\",\"name\":\"permissionLessExecutionThresholdSeconds\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"router\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"priceRegistry\",\"type\":\"address\"},{\"internalType\":\"uint16\",\"name\":\"maxTokensLength\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"maxDataSize\",\"type\":\"uint32\"}],\"indexed\":false,\"internalType\":\"structEVM2EVMOffRamp.DynamicConfig\",\"name\":\"dynamicConfig\",\"type\":\"tuple\"}],\"name\":\"ConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"previousConfigBlockNumber\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"configCount\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"signers\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"transmitters\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"f\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"onchainConfig\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"offchainConfigVersion\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"offchainConfig\",\"type\":\"bytes\"}],\"name\":\"ConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"sequenceNumber\",\"type\":\"uint64\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"messageId\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"enumInternal.MessageExecutionState\",\"name\":\"state\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"returnData\",\"type\":\"bytes\"}],\"name\":\"ExecutionStateChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"name\":\"PoolAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"name\":\"PoolRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"nonce\",\"type\":\"uint64\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"SkippedIncorrectNonce\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"nonce\",\"type\":\"uint64\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"SkippedSenderWithPreviousRampMessageInflight\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"epoch\",\"type\":\"uint32\"}],\"name\":\"Transmitted\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"internalType\":\"structInternal.PoolUpdate[]\",\"name\":\"removes\",\"type\":\"tuple[]\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"internalType\":\"structInternal.PoolUpdate[]\",\"name\":\"adds\",\"type\":\"tuple[]\"}],\"name\":\"applyPoolUpdates\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"messageId\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"sender\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"internalType\":\"structClient.EVMTokenAmount[]\",\"name\":\"destTokenAmounts\",\"type\":\"tuple[]\"}],\"internalType\":\"structClient.Any2EVMMessage\",\"name\":\"\",\"type\":\"tuple\"}],\"name\":\"ccipReceive\",\"outputs\":[],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"currentRateLimiterState\",\"outputs\":[{\"components\":[{\"internalType\":\"uint128\",\"name\":\"tokens\",\"type\":\"uint128\"},{\"internalType\":\"uint32\",\"name\":\"lastUpdated\",\"type\":\"uint32\"},{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.TokenBucket\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"sequenceNumber\",\"type\":\"uint64\"},{\"internalType\":\"uint256\",\"name\":\"feeTokenAmount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"nonce\",\"type\":\"uint64\"},{\"internalType\":\"uint256\",\"name\":\"gasLimit\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"strict\",\"type\":\"bool\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"internalType\":\"structClient.EVMTokenAmount[]\",\"name\":\"tokenAmounts\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"feeToken\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"messageId\",\"type\":\"bytes32\"}],\"internalType\":\"structInternal.EVM2EVMMessage\",\"name\":\"message\",\"type\":\"tuple\"},{\"internalType\":\"bytes[]\",\"name\":\"offchainTokenData\",\"type\":\"bytes[]\"}],\"name\":\"executeSingleMessage\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractIERC20\",\"name\":\"sourceToken\",\"type\":\"address\"}],\"name\":\"getDestinationToken\",\"outputs\":[{\"internalType\":\"contractIERC20\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getDestinationTokens\",\"outputs\":[{\"internalType\":\"contractIERC20[]\",\"name\":\"destTokens\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getDynamicConfig\",\"outputs\":[{\"components\":[{\"internalType\":\"uint32\",\"name\":\"permissionLessExecutionThresholdSeconds\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"router\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"priceRegistry\",\"type\":\"address\"},{\"internalType\":\"uint16\",\"name\":\"maxTokensLength\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"maxDataSize\",\"type\":\"uint32\"}],\"internalType\":\"structEVM2EVMOffRamp.DynamicConfig\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"sequenceNumber\",\"type\":\"uint64\"}],\"name\":\"getExecutionState\",\"outputs\":[{\"internalType\":\"enumInternal.MessageExecutionState\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractIERC20\",\"name\":\"destToken\",\"type\":\"address\"}],\"name\":\"getPoolByDestToken\",\"outputs\":[{\"internalType\":\"contractIPool\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractIERC20\",\"name\":\"sourceToken\",\"type\":\"address\"}],\"name\":\"getPoolBySourceToken\",\"outputs\":[{\"internalType\":\"contractIPool\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"getSenderNonce\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"nonce\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getStaticConfig\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"commitStore\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"onRamp\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"prevOffRamp\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"armProxy\",\"type\":\"address\"}],\"internalType\":\"structEVM2EVMOffRamp.StaticConfig\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getSupportedTokens\",\"outputs\":[{\"internalType\":\"contractIERC20[]\",\"name\":\"sourceTokens\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getTokenLimitAdmin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getTransmitters\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestConfigDetails\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"configCount\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"blockNumber\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestConfigDigestAndEpoch\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"scanLogs\",\"type\":\"bool\"},{\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"internalType\":\"uint32\",\"name\":\"epoch\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"sequenceNumber\",\"type\":\"uint64\"},{\"internalType\":\"uint256\",\"name\":\"feeTokenAmount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"nonce\",\"type\":\"uint64\"},{\"internalType\":\"uint256\",\"name\":\"gasLimit\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"strict\",\"type\":\"bool\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"internalType\":\"structClient.EVMTokenAmount[]\",\"name\":\"tokenAmounts\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"feeToken\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"messageId\",\"type\":\"bytes32\"}],\"internalType\":\"structInternal.EVM2EVMMessage[]\",\"name\":\"messages\",\"type\":\"tuple[]\"},{\"internalType\":\"bytes[][]\",\"name\":\"offchainTokenData\",\"type\":\"bytes[][]\"},{\"internalType\":\"bytes32[]\",\"name\":\"proofs\",\"type\":\"bytes32[]\"},{\"internalType\":\"uint256\",\"name\":\"proofFlagBits\",\"type\":\"uint256\"}],\"internalType\":\"structInternal.ExecutionReport\",\"name\":\"report\",\"type\":\"tuple\"},{\"internalType\":\"uint256[]\",\"name\":\"gasLimitOverrides\",\"type\":\"uint256[]\"}],\"name\":\"manuallyExecute\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"setAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"signers\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"transmitters\",\"type\":\"address[]\"},{\"internalType\":\"uint8\",\"name\":\"f\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"onchainConfig\",\"type\":\"bytes\"},{\"internalType\":\"uint64\",\"name\":\"offchainConfigVersion\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"offchainConfig\",\"type\":\"bytes\"}],\"name\":\"setOCR2Config\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"config\",\"type\":\"tuple\"}],\"name\":\"setRateLimiterConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32[3]\",\"name\":\"reportContext\",\"type\":\"bytes32[3]\"},{\"internalType\":\"bytes\",\"name\":\"report\",\"type\":\"bytes\"},{\"internalType\":\"bytes32[]\",\"name\":\"rs\",\"type\":\"bytes32[]\"},{\"internalType\":\"bytes32[]\",\"name\":\"ss\",\"type\":\"bytes32[]\"},{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"transmit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", + Bin: "0x6101806040523480156200001257600080fd5b506040516200698638038062006986833981016040819052620000359162000891565b8033806000816200008d5760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000c057620000c08162000478565b50506040805160a081018252602084810180516001600160801b039081168085524263ffffffff169385018490528751151585870181905292518216606086018190529790950151166080938401819052600380546001600160a01b031916909517600160801b9384021760ff60a01b1916600160a01b90920291909117909355909102909217600455504690528151835114620001705760405162d8548360e71b815260040160405180910390fd5b60608401516001600160a01b0316158062000193575083516001600160a01b0316155b15620001b2576040516342bcdf7f60e11b815260040160405180910390fd5b83600001516001600160a01b0316634120fccd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015620001f5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200021b9190620009a8565b6001600160401b03166001146200024557604051636fc2a20760e11b815260040160405180910390fd5b83516001600160a01b0390811660a090815260408601516001600160401b0390811660c05260208701511660e052606086015182166101005260808601518216610140528501511661016052620002bc7fbdd59ac4dd1d82276c9a9c5d2656546346b9dcdb1f9b4204aed4ec15c23d7d3a62000523565b6101205260005b83518110156200046d576200031d848281518110620002e657620002e6620009c6565b6020026020010151848381518110620003035762000303620009c6565b6020026020010151600c6200058a60201b9092919060201c565b50620003d2838281518110620003375762000337620009c6565b60200260200101516001600160a01b03166321df0da76040518163ffffffff1660e01b8152600401602060405180830381865afa1580156200037d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620003a39190620009dc565b848381518110620003b857620003b8620009c6565b6020026020010151600f6200058a60201b9092919060201c565b507f95f865c2808f8b2a85eea2611db7843150ee7835ef1403f9755918a97d76933c848281518110620004095762000409620009c6565b6020026020010151848381518110620004265762000426620009c6565b6020026020010151604051620004529291906001600160a01b0392831681529116602082015260400190565b60405180910390a1620004658162000a03565b9050620002c3565b505050505062000a2b565b336001600160a01b03821603620004d25760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640162000084565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b60008160c05160e051610100516040516020016200056d94939291909384526001600160401b039283166020850152911660408301526001600160a01b0316606082015260800190565b604051602081830303815290604052805190602001209050919050565b6000620005a2846001600160a01b03851684620005aa565b949350505050565b6000620005a284846001600160a01b03851660008281526002840160205260408120829055620005a284846000620005e38383620005ec565b90505b92915050565b60008181526001830160205260408120546200063557508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155620005e6565b506000620005e6565b634e487b7160e01b600052604160045260246000fd5b60405160c081016001600160401b03811182821017156200067957620006796200063e565b60405290565b604051601f8201601f191681016001600160401b0381118282101715620006aa57620006aa6200063e565b604052919050565b6001600160a01b0381168114620006c857600080fd5b50565b80516001600160401b0381168114620006e357600080fd5b919050565b60006001600160401b038211156200070457620007046200063e565b5060051b60200190565b600082601f8301126200072057600080fd5b81516020620007396200073383620006e8565b6200067f565b82815260059290921b840181019181810190868411156200075957600080fd5b8286015b84811015620007815780516200077381620006b2565b83529183019183016200075d565b509695505050505050565b600082601f8301126200079e57600080fd5b81516020620007b16200073383620006e8565b82815260059290921b84018101918181019086841115620007d157600080fd5b8286015b8481101562000781578051620007eb81620006b2565b8352918301918301620007d5565b80516001600160801b0381168114620006e357600080fd5b6000606082840312156200082457600080fd5b604051606081016001600160401b03811182821017156200084957620008496200063e565b8060405250809150825180151581146200086257600080fd5b81526200087260208401620007f9565b60208201526200088560408401620007f9565b60408201525092915050565b600080600080848603610160811215620008aa57600080fd5b60c0811215620008b957600080fd5b50620008c462000654565b8551620008d181620006b2565b8152620008e160208701620006cb565b6020820152620008f460408701620006cb565b604082015260608601516200090981620006b2565b606082015260808601516200091e81620006b2565b608082015260a08601516200093381620006b2565b60a082015260c08601519094506001600160401b03808211156200095657600080fd5b62000964888389016200070e565b945060e08701519150808211156200097b57600080fd5b506200098a878288016200078c565b9250506200099d86610100870162000811565b905092959194509250565b600060208284031215620009bb57600080fd5b620005e382620006cb565b634e487b7160e01b600052603260045260246000fd5b600060208284031215620009ef57600080fd5b8151620009fc81620006b2565b9392505050565b60006001820162000a2457634e487b7160e01b600052601160045260246000fd5b5060010190565b60805160a05160c05160e05161010051610120516101405161016051615e7e62000b0860003960008181610309015281816120ef0152612b0b0152600081816102cd015281816114a001528181611522015281816120c501528181613080015261310701526000612cc4015260008181610291015261209e015260008181610231015261204c01526000818161026101528181612076015281816124650152613a7c0152600081816101f50152818161201e0152612db901526000818161182f0152818161187b01528181611c8f0152611cdb0152615e7e6000f3fe608060405234801561001057600080fd5b50600436106101ae5760003560e01c806381ff7048116100ee578063b1dc65a411610097578063d3c7c2c711610071578063d3c7c2c7146106a7578063d7e2bb50146106af578063e65bf00a146106c2578063f2fde38b146106d557600080fd5b8063b1dc65a41461066e578063b4069b3114610681578063c92b28321461069457600080fd5b80638da5cb5b116100c85780638da5cb5b1461061d578063afa0d3791461063b578063afcb95d71461064e57600080fd5b806381ff7048146105b357806385572ffb146105e3578063856c8247146105f157600080fd5b8063599f64311161015b578063681fba1611610135578063681fba16146104b8578063704b6c02146104cd5780637437ff9f146104e057806379ba5097146105ab57600080fd5b8063599f6431146104515780635d86f14114610490578063666cab8d146104a357600080fd5b80631ef381741161018c5780631ef38174146103c55780633a87ac53146103da578063546719cd146103ed57600080fd5b806306285c69146101b3578063142a98fc1461035c578063181f5a771461037c575b600080fd5b6103466040805160c081018252600080825260208201819052918101829052606081018290526080810182905260a08101919091526040518060c001604052807f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1681526020017f000000000000000000000000000000000000000000000000000000000000000067ffffffffffffffff1681526020017f000000000000000000000000000000000000000000000000000000000000000067ffffffffffffffff1681526020017f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1681526020017f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1681526020017f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16815250905090565b60405161035391906145e8565b60405180910390f35b61036f61036a36600461467f565b6106e8565b6040516103539190614706565b6103b86040518060400160405280601481526020017f45564d3245564d4f666652616d7020312e302e3000000000000000000000000081525081565b6040516103539190614782565b6103d86103d33660046149f0565b610763565b005b6103d86103e8366004614b02565b610c22565b6103f5611032565b604051610353919081516fffffffffffffffffffffffffffffffff908116825260208084015163ffffffff1690830152604080840151151590830152606080840151821690830152608092830151169181019190915260a00190565b60025473ffffffffffffffffffffffffffffffffffffffff165b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610353565b61046b61049e366004614b6e565b6110e7565b6104ab611150565b6040516103539190614bdc565b6104c06111bf565b6040516103539190614bef565b6103d86104db366004614b6e565b611278565b61059e6040805160a081018252600080825260208201819052918101829052606081018290526080810191909152506040805160a081018252600a5463ffffffff808216835273ffffffffffffffffffffffffffffffffffffffff64010000000090920482166020840152600b549182169383019390935261ffff7401000000000000000000000000000000000000000082041660608301527601000000000000000000000000000000000000000000009004909116608082015290565b6040516103539190614c49565b6103d8611368565b6007546005546040805163ffffffff80851682526401000000009094049093166020840152820152606001610353565b6103d86101ae366004614cac565b6106046105ff366004614b6e565b611465565b60405167ffffffffffffffff9091168152602001610353565b60005473ffffffffffffffffffffffffffffffffffffffff1661046b565b6103d8610649366004614f16565b61158d565b604080516001815260006020820181905291810191909152606001610353565b6103d861067c366004614fbf565b6117d9565b61046b61068f366004614b6e565b611a6a565b6103d86106a23660046150c4565b611b43565b6104c0611bc8565b61046b6106bd366004614b6e565b611c7d565b6103d86106d036600461531b565b611c8c565b6103d86106e3366004614b6e565b611e0e565b60006106f660016004615405565b6002610703608085615447565b67ffffffffffffffff16610717919061546e565b60136000610726608087615485565b67ffffffffffffffff1667ffffffffffffffff16815260200190815260200160002054901c16600381111561075d5761075d61469c565b92915050565b84518460ff16601f8211156107d9576040517f89a6198900000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f746f6f206d616e79207472616e736d697474657273000000000000000000000060448201526064015b60405180910390fd5b80600003610843576040517f89a6198900000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f66206d75737420626520706f736974697665000000000000000000000000000060448201526064016107d0565b61084b611e1f565b61085485611ea2565b60095460005b818110156108e0576008600060098381548110610879576108796154ac565b600091825260208083209091015473ffffffffffffffffffffffffffffffffffffffff168352820192909252604001902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00001690556108d9816154db565b905061085a565b50875160005b81811015610adc5760008a8281518110610902576109026154ac565b602002602001015190506000600281111561091f5761091f61469c565b73ffffffffffffffffffffffffffffffffffffffff8216600090815260086020526040902054610100900460ff16600281111561095e5761095e61469c565b146109c5576040517f89a6198900000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f7265706561746564207472616e736d697474657220616464726573730000000060448201526064016107d0565b73ffffffffffffffffffffffffffffffffffffffff8116610a12576040517fd6c62c9b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040805180820190915260ff83168152602081016002905273ffffffffffffffffffffffffffffffffffffffff821660009081526008602090815260409091208251815460ff9091167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0082168117835592840151919283917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00001617610100836002811115610ac257610ac261469c565b02179055509050505080610ad5906154db565b90506108e6565b508851610af09060099060208c0190614552565b506006805460ff838116610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000909216908b161717905560078054610b76914691309190600090610b489063ffffffff16615513565b91906101000a81548163ffffffff021916908363ffffffff160217905563ffffffff168d8d8d8d8d8d61214f565b6005600001819055506000600760049054906101000a900463ffffffff16905043600760046101000a81548163ffffffff021916908363ffffffff1602179055507f1591690b8638f5fb2dbec82ac741805ac5da8b45dc5263f4875b0496fdce4e0581600560000154600760009054906101000a900463ffffffff168e8e8e8e8e8e604051610c0d99989796959493929190615536565b60405180910390a15050505050505050505050565b610c2a611e1f565b60005b83811015610e29576000858583818110610c4957610c496154ac565b610c5f9260206040909202019081019150614b6e565b90506000868684818110610c7557610c756154ac565b9050604002016020016020810190610c8d9190614b6e565b9050610c9a600c836121fa565b610cd0576040517f9c8787c000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8116610cf2600c8461221c565b73ffffffffffffffffffffffffffffffffffffffff1614610d3f576040517f6cc7b99800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610d4a600c8361223e565b50610dc58173ffffffffffffffffffffffffffffffffffffffff166321df0da76040518163ffffffff1660e01b8152600401602060405180830381865afa158015610d99573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dbd91906155cc565b600f9061223e565b506040805173ffffffffffffffffffffffffffffffffffffffff8085168252831660208201527f987eb3c2f78454541205f72f34839b434c306c9eaf4922efd7c0c3060fdb2e4c910160405180910390a1505080610e22906154db565b9050610c2d565b5060005b8181101561102b576000838383818110610e4957610e496154ac565b610e5f9260206040909202019081019150614b6e565b90506000848484818110610e7557610e756154ac565b9050604002016020016020810190610e8d9190614b6e565b905073ffffffffffffffffffffffffffffffffffffffff82161580610ec6575073ffffffffffffffffffffffffffffffffffffffff8116155b15610efd576040517f6c2a418000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610f08600c836121fa565b15610f3f576040517f3caf458500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610f4b600c8383612260565b50610fc78173ffffffffffffffffffffffffffffffffffffffff166321df0da76040518163ffffffff1660e01b8152600401602060405180830381865afa158015610f9a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fbe91906155cc565b600f9083612260565b506040805173ffffffffffffffffffffffffffffffffffffffff8085168252831660208201527f95f865c2808f8b2a85eea2611db7843150ee7835ef1403f9755918a97d76933c910160405180910390a1505080611024906154db565b9050610e2d565b5050505050565b6040805160a0810182526000808252602082018190529181018290526060810182905260808101919091526040805160a0810182526003546fffffffffffffffffffffffffffffffff808216835270010000000000000000000000000000000080830463ffffffff1660208501527401000000000000000000000000000000000000000090920460ff1615159383019390935260045480841660608401520490911660808201526110e290612283565b905090565b600080806110f6600c85612335565b9150915081611149576040517fbf16aab600000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff851660048201526024016107d0565b9392505050565b606060098054806020026020016040519081016040528092919081815260200182805480156111b557602002820191906000526020600020905b815473ffffffffffffffffffffffffffffffffffffffff16815260019091019060200180831161118a575b5050505050905090565b60606111cb600f612364565b67ffffffffffffffff8111156111e3576111e3614795565b60405190808252806020026020018201604052801561120c578160200160208202803683370190505b50905060005b8151811015611274576000611228600f8361236f565b5090508083838151811061123e5761123e6154ac565b73ffffffffffffffffffffffffffffffffffffffff909216602092830291909101909101525061126d816154db565b9050611212565b5090565b60005473ffffffffffffffffffffffffffffffffffffffff1633148015906112b8575060025473ffffffffffffffffffffffffffffffffffffffff163314155b156112ef576040517ff6cd562000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600280547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83169081179091556040519081527f8fe72c3e0020beb3234e76ae6676fa576fbfcae600af1c4fea44784cf0db329c9060200160405180910390a150565b60015473ffffffffffffffffffffffffffffffffffffffff1633146113e9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e65720000000000000000000060448201526064016107d0565b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b73ffffffffffffffffffffffffffffffffffffffff811660009081526012602052604081205467ffffffffffffffff16801580156114d857507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1615155b1561075d576040517f856c824700000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff84811660048301527f0000000000000000000000000000000000000000000000000000000000000000169063856c824790602401602060405180830381865afa158015611569573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061114991906155e9565b3330146115c6576040517f371a732800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040805160008082526020820190925281611603565b60408051808201909152600080825260208201528152602001906001900390816115dc5790505b5061012084015151909150156116625761012083015160608401516040805173ffffffffffffffffffffffffffffffffffffffff909216602083015261165f9291016040516020818303038152906040528560e001518561238b565b90505b60e083015173ffffffffffffffffffffffffffffffffffffffff163b15806116cc575060e08301516116ca9073ffffffffffffffffffffffffffffffffffffffff167f85572ffb00000000000000000000000000000000000000000000000000000000612831565b155b156116d657505050565b600a546000908190640100000000900473ffffffffffffffffffffffffffffffffffffffff16633cf9798361170b878661284d565b6113888860a001518960e001516040518563ffffffff1660e01b81526004016117379493929190615657565b6000604051808303816000875af1158015611756573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820160405261179c9190810190615729565b915091508161102b57806040517f0a8d6e8c0000000000000000000000000000000000000000000000000000000081526004016107d09190614782565b6117e387876128fd565b60055488359080821461182c576040517f93df584c00000000000000000000000000000000000000000000000000000000815260048101829052602481018390526044016107d0565b467f0000000000000000000000000000000000000000000000000000000000000000146118ad576040517f0f01ce850000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000060048201524660248201526044016107d0565b6040805183815260208c81013560081c63ffffffff16908201527fb04e63db38c49950639fa09d29872f21f5d49d614f3a969d8adf3d4b52e41a62910160405180910390a13360009081526008602090815260408083208151808301909252805460ff808216845292939192918401916101009091041660028111156119355761193561469c565b60028111156119465761194661469c565b90525090506002816020015160028111156119635761196361469c565b1480156119aa57506009816000015160ff1681548110611985576119856154ac565b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff1633145b6119e0576040517fda0f08e800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5060006119ee85602061546e565b6119f988602061546e565b611a058b6101446157b6565b611a0f91906157b6565b611a1991906157b6565b9050368114611a5d576040517f8e1192e1000000000000000000000000000000000000000000000000000000008152600481018290523660248201526044016107d0565b5050505050505050505050565b60008080611a79600c85612335565b9150915081611acc576040517fbf16aab600000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff851660048201526024016107d0565b8073ffffffffffffffffffffffffffffffffffffffff166321df0da76040518163ffffffff1660e01b8152600401602060405180830381865afa158015611b17573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b3b91906155cc565b949350505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314801590611b83575060025473ffffffffffffffffffffffffffffffffffffffff163314155b15611bba576040517ff6cd562000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611bc5600382612924565b50565b6060611bd4600c612364565b67ffffffffffffffff811115611bec57611bec614795565b604051908082528060200260200182016040528015611c15578160200160208202803683370190505b50905060005b8151811015611274576000611c31600c8361236f565b50905080838381518110611c4757611c476154ac565b73ffffffffffffffffffffffffffffffffffffffff9092166020928302919091019091015250611c76816154db565b9050611c1b565b600080806110f6600f85612335565b467f000000000000000000000000000000000000000000000000000000000000000014611d17576040517f0f01ce850000000000000000000000000000000000000000000000000000000081527f0000000000000000000000000000000000000000000000000000000000000000600482015267ffffffffffffffff461660248201526044016107d0565b81515181518114611d54576040517f83e3f56400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b81811015611dfe576000838281518110611d7357611d736154ac565b6020026020010151905080600014158015611dac57508451805183908110611d9d57611d9d6154ac565b602002602001015160a0015181105b15611ded576040517f085e39cf00000000000000000000000000000000000000000000000000000000815260048101839052602481018290526044016107d0565b50611df7816154db565b9050611d57565b50611e098383612b09565b505050565b611e16611e1f565b611bc5816134b6565b60005473ffffffffffffffffffffffffffffffffffffffff163314611ea0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e65720000000000000000000060448201526064016107d0565b565b600081806020019051810190611eb891906157dd565b602081015190915073ffffffffffffffffffffffffffffffffffffffff16611f0c576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8051600a805460208085015173ffffffffffffffffffffffffffffffffffffffff908116640100000000027fffffffffffffffff00000000000000000000000000000000000000000000000090931663ffffffff9586161792909217909255604080850151600b80546060808901516080808b0151909916760100000000000000000000000000000000000000000000027fffffffffffff00000000ffffffffffffffffffffffffffffffffffffffffffff61ffff90921674010000000000000000000000000000000000000000027fffffffffffffffffffff00000000000000000000000000000000000000000000909416958816959095179290921791909116929092179055815160c0810183527f00000000000000000000000000000000000000000000000000000000000000008416815267ffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000008116958201959095527f0000000000000000000000000000000000000000000000000000000000000000909416848301527f00000000000000000000000000000000000000000000000000000000000000008316908401527f00000000000000000000000000000000000000000000000000000000000000008216938301939093527f00000000000000000000000000000000000000000000000000000000000000001660a082015290517f737ef22d3f6615e342ed21c69e06620dbc5c8a261ed7cfb2ce214806b1f76eda91612143918490615878565b60405180910390a15050565b6000808a8a8a8a8a8a8a8a8a60405160200161217399989796959493929190615947565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815291905280516020909101207dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167e01000000000000000000000000000000000000000000000000000000000000179150509998505050505050505050565b60006111498373ffffffffffffffffffffffffffffffffffffffff84166135ab565b60006111498373ffffffffffffffffffffffffffffffffffffffff84166135b7565b60006111498373ffffffffffffffffffffffffffffffffffffffff84166135c3565b6000611b3b8473ffffffffffffffffffffffffffffffffffffffff8516846135cf565b6040805160a08101825260008082526020820181905291810182905260608101829052608081019190915261231182606001516fffffffffffffffffffffffffffffffff1683600001516fffffffffffffffffffffffffffffffff16846020015163ffffffff16426122f59190615405565b85608001516fffffffffffffffffffffffffffffffff166135f2565b6fffffffffffffffffffffffffffffffff1682525063ffffffff4216602082015290565b6000806123588473ffffffffffffffffffffffffffffffffffffffff8516613611565b915091505b9250929050565b600061075d82613620565b600080808061237e868661362b565b9097909650945050505050565b60606000855167ffffffffffffffff8111156123a9576123a9614795565b6040519080825280602002602001820160405280156123ee57816020015b60408051808201909152600080825260208201528152602001906001900390816123c75790505b50905060005b8651811015612803576000612425888381518110612414576124146154ac565b6020026020010151600001516110e7565b90508073ffffffffffffffffffffffffffffffffffffffff16638627fad688888b8681518110612457576124576154ac565b6020026020010151602001517f00000000000000000000000000000000000000000000000000000000000000008a8881518110612496576124966154ac565b60200260200101516040518663ffffffff1660e01b81526004016124be9594939291906159dc565b600060405180830381600087803b1580156124d857600080fd5b505af19250505080156124e9575060015b61270c573d808015612517576040519150601f19603f3d011682016040523d82523d6000602084013e61251c565b606091505b50600061252882615a3f565b90507f9725942a000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000821614806125bb57507ff94ebcd1000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008216145b8061260757507f15279c08000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008216145b8061265357507f1a76572a000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008216145b8061269f57507fd0c8d23a000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008216145b156126d857816040517f30dabb590000000000000000000000000000000000000000000000000000000081526004016107d09190614782565b816040517fe1cd55090000000000000000000000000000000000000000000000000000000081526004016107d09190614782565b8073ffffffffffffffffffffffffffffffffffffffff166321df0da76040518163ffffffff1660e01b8152600401602060405180830381865afa158015612757573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061277b91906155cc565b83838151811061278d5761278d6154ac565b602090810291909101015173ffffffffffffffffffffffffffffffffffffffff909116905287518890839081106127c6576127c66154ac565b6020026020010151602001518383815181106127e4576127e46154ac565b6020908102919091018101510152506127fc816154db565b90506123f4565b50600b5461282890829073ffffffffffffffffffffffffffffffffffffffff1661363a565b95945050505050565b600061283c8361381a565b80156111495750611149838361387e565b6040805160a08101825260008082526020820152606091810182905281810182905260808101919091526040518060a001604052808461016001518152602001846000015167ffffffffffffffff16815260200184606001516040516020016128d2919073ffffffffffffffffffffffffffffffffffffffff91909116815260200190565b6040516020818303038152906040528152602001846101000151815260200183815250905092915050565b61292061290c82840184615a8f565b604080516000815260208101909152612b09565b5050565b815460009061294d90700100000000000000000000000000000000900463ffffffff1642615405565b905080156129ef5760018301548354612995916fffffffffffffffffffffffffffffffff808216928116918591700100000000000000000000000000000000909104166135f2565b83546fffffffffffffffffffffffffffffffff919091167fffffffffffffffffffffffff0000000000000000000000000000000000000000909116177001000000000000000000000000000000004263ffffffff16021783555b60208201518354612a15916fffffffffffffffffffffffffffffffff908116911661394d565b83548351151574010000000000000000000000000000000000000000027fffffffffffffffffffffff00ffffffff000000000000000000000000000000009091166fffffffffffffffffffffffffffffffff92831617178455602083015160408085015183167001000000000000000000000000000000000291909216176001850155517f9ea3374b67bf275e6bb9c8ae68f9cae023e1c528b4b27e092f0bb209d3531c1990612afc9084908151151581526020808301516fffffffffffffffffffffffffffffffff90811691830191909152604092830151169181019190915260600190565b60405180910390a1505050565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663397796f76040518163ffffffff1660e01b8152600401602060405180830381865afa158015612b74573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b989190615ac4565b15612bcf576040517fc148371500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8151516000819003612c0c576040517ebf199700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8260200151518114612c4a576040517f57e0e08300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008167ffffffffffffffff811115612c6557612c65614795565b604051908082528060200260200182016040528015612c8e578160200160208202803683370190505b50905060005b82811015612d6e57600085600001518281518110612cb457612cb46154ac565b60200260200101519050612ce8817f0000000000000000000000000000000000000000000000000000000000000000613963565b838381518110612cfa57612cfa6154ac565b602002602001018181525050806101600151838381518110612d1e57612d1e6154ac565b602002602001015114612d5d576040517f7185cf6b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50612d67816154db565b9050612c94565b50604080850151606086015191517f3204887500000000000000000000000000000000000000000000000000000000815260009273ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001692633204887592612def92879291600401615b11565b602060405180830381865afa158015612e0c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e309190615b47565b905080600003612e6c576040517fea75680100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8351151560005b848110156134ad57600087600001518281518110612e9357612e936154ac565b602002602001015190506000612eac82602001516106e8565b90506000816003811115612ec257612ec261469c565b1480612edf57506003816003811115612edd57612edd61469c565b145b612f275760208201516040517f50a6e05200000000000000000000000000000000000000000000000000000000815267ffffffffffffffff90911660048201526024016107d0565b8315612fe457600a5460009063ffffffff16612f438742615405565b1190508080612f6357506003826003811115612f6157612f6161469c565b145b612f99576040517f6358b0d000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b888481518110612fab57612fab6154ac565b6020026020010151600014612fde57888481518110612fcc57612fcc6154ac565b60200260200101518360a00181815250505b50613041565b6000816003811115612ff857612ff861469c565b146130415760208201516040517f67d9ba0f00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff90911660048201526024016107d0565b606082015173ffffffffffffffffffffffffffffffffffffffff1660009081526012602052604090205467ffffffffffffffff16801580156130b857507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1615155b1561325a5760608301516040517f856c824700000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff91821660048201527f00000000000000000000000000000000000000000000000000000000000000009091169063856c824790602401602060405180830381865afa158015613150573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061317491906155e9565b608084015190915067ffffffffffffffff16613191826001615b60565b67ffffffffffffffff16146131fe57826060015173ffffffffffffffffffffffffffffffffffffffff16836080015167ffffffffffffffff167fe44a20935573a783dd0d5991c92d7b6a0eb3173566530364db3ec10e9a990b5d60405160405180910390a350505061349d565b606083015173ffffffffffffffffffffffffffffffffffffffff16600090815260126020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000001667ffffffffffffffff83161790555b600082600381111561326e5761326e61469c565b036132fa57608083015167ffffffffffffffff1661328d826001615b60565b67ffffffffffffffff16146132fa57826060015173ffffffffffffffffffffffffffffffffffffffff16836080015167ffffffffffffffff167fd32ddb11d71e3d63411d37b09f9a8b28664f1cb1338bfd1413c173b0ebf4123760405160405180910390a350505061349d565b60008a602001518581518110613312576133126154ac565b60200260200101519050613327848251613a7a565b61333684602001516001613c50565b6000806133438684613cfa565b91509150613355866020015183613c50565b60038260038111156133695761336961469c565b14158015613389575060028260038111156133865761338661469c565b14155b156133c8578560200151826040517f9e2616030000000000000000000000000000000000000000000000000000000081526004016107d0929190615b81565b60008560038111156133dc576133dc61469c565b0361344857606086015173ffffffffffffffffffffffffffffffffffffffff166000908152601260205260408120805467ffffffffffffffff169161342083615b9f565b91906101000a81548167ffffffffffffffff021916908367ffffffffffffffff160217905550505b856101600151866020015167ffffffffffffffff167fd4f851956a5d67c3997d1c9205045fef79bae2947fdee7e9e2641abc7391ef65848460405161348e929190615bbc565b60405180910390a35050505050505b6134a6816154db565b9050612e73565b50505050505050565b3373ffffffffffffffffffffffffffffffffffffffff821603613535576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c6600000000000000000060448201526064016107d0565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b60006111498383613e9d565b60006111498383613ea9565b60006111498383613f33565b6000611b3b848473ffffffffffffffffffffffffffffffffffffffff8516613f50565b600061282885613602848661546e565b61360c90876157b6565b61394d565b600080808061237e8686613f6d565b600061075d82613fa7565b600080808061237e8686613fb2565b81516000805b828110156138065760008473ffffffffffffffffffffffffffffffffffffffff1663d02641a0878481518110613678576136786154ac565b6020908102919091010151516040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b16815273ffffffffffffffffffffffffffffffffffffffff90911660048201526024016040805180830381865afa1580156136ec573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906137109190615bdc565b51905077ffffffffffffffffffffffffffffffffffffffffffffffff811660000361379e57858281518110613747576137476154ac565b6020908102919091010151516040517f9a655f7b00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff90911660048201526024016107d0565b6137e88683815181106137b3576137b36154ac565b6020026020010151602001518277ffffffffffffffffffffffffffffffffffffffffffffffff16613fdd90919063ffffffff16565b6137f290846157b6565b925050806137ff906154db565b9050613640565b506138146003826000614016565b50505050565b6000613846827f01ffc9a70000000000000000000000000000000000000000000000000000000061387e565b801561075d5750613877827fffffffff0000000000000000000000000000000000000000000000000000000061387e565b1592915050565b604080517fffffffff000000000000000000000000000000000000000000000000000000008316602480830191909152825180830390910181526044909101909152602080820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f01ffc9a700000000000000000000000000000000000000000000000000000000178152825160009392849283928392918391908a617530fa92503d91506000519050828015613936575060208210155b80156139425750600081115b979650505050505050565b600081831061395c5781611149565b5090919050565b60008060001b828460200151856080015186606001518760e00151886101000151805190602001208961012001516040516020016139a19190615c3a565b604051602081830303815290604052805190602001208a60a001518b60c001518c61014001518d60400151604051602001613a5c9c9b9a999897969594939291909b8c5260208c019a909a5267ffffffffffffffff98891660408c01529690971660608a015273ffffffffffffffffffffffffffffffffffffffff94851660808a015292841660a089015260c088019190915260e0870152610100860152911515610120850152166101408301526101608201526101800190565b60405160208183030381529060405280519060200120905092915050565b7f000000000000000000000000000000000000000000000000000000000000000067ffffffffffffffff16826000015167ffffffffffffffff1614613afa5781516040517f1279ec8a00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff90911660048201526024016107d0565b600b54610120830151517401000000000000000000000000000000000000000090910461ffff161015613b6b5760208201516040517f099d3f7200000000000000000000000000000000000000000000000000000000815267ffffffffffffffff90911660048201526024016107d0565b808261012001515114613bbc5760208201516040517f8808f8e700000000000000000000000000000000000000000000000000000000815267ffffffffffffffff90911660048201526024016107d0565b600b546101008301515176010000000000000000000000000000000000000000000090910463ffffffff16101561292057600b54610100830151516040517f8693378900000000000000000000000000000000000000000000000000000000815276010000000000000000000000000000000000000000000090920463ffffffff16600483015260248201526044016107d0565b60006002613c5f608085615447565b67ffffffffffffffff16613c73919061546e565b90506000601381613c85608087615485565b67ffffffffffffffff168152602081019190915260400160002054905081613caf60016004615405565b901b191681836003811115613cc657613cc661469c565b901b178060136000613cd9608088615485565b67ffffffffffffffff16815260208101919091526040016000205550505050565b6040517fafa0d379000000000000000000000000000000000000000000000000000000008152600090606090309063afa0d37990613d3e9087908790600401615cc3565b600060405180830381600087803b158015613d5857600080fd5b505af1925050508015613d69575060015b613e82573d808015613d97576040519150601f19603f3d011682016040523d82523d6000602084013e613d9c565b606091505b50613da681615a3f565b7fffffffff00000000000000000000000000000000000000000000000000000000167f0a8d6e8c000000000000000000000000000000000000000000000000000000001480613e3e5750613df981615a3f565b7fffffffff00000000000000000000000000000000000000000000000000000000167fe1cd550900000000000000000000000000000000000000000000000000000000145b15613e4e5760039250905061235d565b806040517fcf19edfd0000000000000000000000000000000000000000000000000000000081526004016107d09190614782565b50506040805160208101909152600081526002909250929050565b60006111498383614399565b600081815260028301602052604081205480151580613ecd5750613ecd8484613e9d565b611149576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f456e756d657261626c654d61703a206e6f6e6578697374656e74206b6579000060448201526064016107d0565b6000818152600283016020526040812081905561114983836143b1565b60008281526002840160205260408120829055611b3b84846143bd565b6000818152600283016020526040812054819080613f9c57613f8f8585613e9d565b92506000915061235d9050565b60019250905061235d565b600061075d826143c9565b60008080613fc085856143d3565b600081815260029690960160205260409095205494959350505050565b6000670de0b6b3a764000061400c8377ffffffffffffffffffffffffffffffffffffffffffffffff861661546e565b6111499190615e2e565b825474010000000000000000000000000000000000000000900460ff16158061403d575081155b1561404757505050565b825460018401546fffffffffffffffffffffffffffffffff8083169291169060009061408d90700100000000000000000000000000000000900463ffffffff1642615405565b9050801561414d57818311156140cf576040517f9725942a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60018601546141099083908590849070010000000000000000000000000000000090046fffffffffffffffffffffffffffffffff166135f2565b86547fffffffffffffffffffffffff00000000ffffffffffffffffffffffffffffffff167001000000000000000000000000000000004263ffffffff160217875592505b848210156142045773ffffffffffffffffffffffffffffffffffffffff84166141ac576040517ff94ebcd100000000000000000000000000000000000000000000000000000000815260048101839052602481018690526044016107d0565b6040517f1a76572a000000000000000000000000000000000000000000000000000000008152600481018390526024810186905273ffffffffffffffffffffffffffffffffffffffff851660448201526064016107d0565b848310156143175760018681015470010000000000000000000000000000000090046fffffffffffffffffffffffffffffffff169060009082906142489082615405565b614252878a615405565b61425c91906157b6565b6142669190615e2e565b905073ffffffffffffffffffffffffffffffffffffffff86166142bf576040517f15279c0800000000000000000000000000000000000000000000000000000000815260048101829052602481018690526044016107d0565b6040517fd0c8d23a000000000000000000000000000000000000000000000000000000008152600481018290526024810186905273ffffffffffffffffffffffffffffffffffffffff871660448201526064016107d0565b6143218584615405565b86547fffffffffffffffffffffffffffffffff00000000000000000000000000000000166fffffffffffffffffffffffffffffffff82161787556040518681529093507f1871cdf8010e63f2eb8384381a68dfa7416dc571a5517e66e88b2d2d0c0a690a9060200160405180910390a1505050505050565b60008181526001830160205260408120541515611149565b600061114983836143df565b600061114983836144d9565b600061075d825490565b60006111498383614528565b600081815260018301602052604081205480156144c8576000614403600183615405565b855490915060009061441790600190615405565b905081811461447c576000866000018281548110614437576144376154ac565b906000526020600020015490508087600001848154811061445a5761445a6154ac565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061448d5761448d615e42565b60019003818190600052602060002001600090559055856001016000868152602001908152602001600020600090556001935050505061075d565b600091505061075d565b5092915050565b60008181526001830160205260408120546145205750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915561075d565b50600061075d565b600082600001828154811061453f5761453f6154ac565b9060005260206000200154905092915050565b8280548282559060005260206000209081019282156145cc579160200282015b828111156145cc57825182547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff909116178255602090920191600190910190614572565b506112749291505b8082111561127457600081556001016145d4565b60c0810161075d828473ffffffffffffffffffffffffffffffffffffffff808251168352602082015167ffffffffffffffff808216602086015280604085015116604086015250508060608301511660608401528060808301511660808401528060a08301511660a0840152505050565b67ffffffffffffffff81168114611bc557600080fd5b803561467a81614659565b919050565b60006020828403121561469157600080fd5b813561114981614659565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b60048110614702577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b9052565b6020810161075d82846146cb565b60005b8381101561472f578181015183820152602001614717565b50506000910152565b60008151808452614750816020860160208601614714565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b6020815260006111496020830184614738565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040805190810167ffffffffffffffff811182821017156147e7576147e7614795565b60405290565b604051610180810167ffffffffffffffff811182821017156147e7576147e7614795565b6040516080810167ffffffffffffffff811182821017156147e7576147e7614795565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff8111828210171561487b5761487b614795565b604052919050565b600067ffffffffffffffff82111561489d5761489d614795565b5060051b60200190565b73ffffffffffffffffffffffffffffffffffffffff81168114611bc557600080fd5b803561467a816148a7565b600082601f8301126148e557600080fd5b813560206148fa6148f583614883565b614834565b82815260059290921b8401810191818101908684111561491957600080fd5b8286015b8481101561493d578035614930816148a7565b835291830191830161491d565b509695505050505050565b803560ff8116811461467a57600080fd5b600067ffffffffffffffff82111561497357614973614795565b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b600082601f8301126149b057600080fd5b81356149be6148f582614959565b8181528460208386010111156149d357600080fd5b816020850160208301376000918101602001919091529392505050565b60008060008060008060c08789031215614a0957600080fd5b863567ffffffffffffffff80821115614a2157600080fd5b614a2d8a838b016148d4565b97506020890135915080821115614a4357600080fd5b614a4f8a838b016148d4565b9650614a5d60408a01614948565b95506060890135915080821115614a7357600080fd5b614a7f8a838b0161499f565b9450614a8d60808a0161466f565b935060a0890135915080821115614aa357600080fd5b50614ab089828a0161499f565b9150509295509295509295565b60008083601f840112614acf57600080fd5b50813567ffffffffffffffff811115614ae757600080fd5b6020830191508360208260061b850101111561235d57600080fd5b60008060008060408587031215614b1857600080fd5b843567ffffffffffffffff80821115614b3057600080fd5b614b3c88838901614abd565b90965094506020870135915080821115614b5557600080fd5b50614b6287828801614abd565b95989497509550505050565b600060208284031215614b8057600080fd5b8135611149816148a7565b600081518084526020808501945080840160005b83811015614bd157815173ffffffffffffffffffffffffffffffffffffffff1687529582019590820190600101614b9f565b509495945050505050565b6020815260006111496020830184614b8b565b6020808252825182820181905260009190848201906040850190845b81811015614c3d57835173ffffffffffffffffffffffffffffffffffffffff1683529284019291840191600101614c0b565b50909695505050505050565b60a0810161075d828463ffffffff808251168352602082015173ffffffffffffffffffffffffffffffffffffffff8082166020860152806040850151166040860152505061ffff6060830151166060840152806080830151166080840152505050565b600060208284031215614cbe57600080fd5b813567ffffffffffffffff811115614cd557600080fd5b820160a0818503121561114957600080fd5b8015158114611bc557600080fd5b803561467a81614ce7565b600082601f830112614d1157600080fd5b81356020614d216148f583614883565b82815260069290921b84018101918181019086841115614d4057600080fd5b8286015b8481101561493d5760408189031215614d5d5760008081fd5b614d656147c4565b8135614d70816148a7565b81528185013585820152835291830191604001614d44565b60006101808284031215614d9b57600080fd5b614da36147ed565b9050614dae8261466f565b8152614dbc6020830161466f565b602082015260408201356040820152614dd7606083016148c9565b6060820152614de86080830161466f565b608082015260a082013560a0820152614e0360c08301614cf5565b60c0820152614e1460e083016148c9565b60e08201526101008083013567ffffffffffffffff80821115614e3657600080fd5b614e428683870161499f565b83850152610120925082850135915080821115614e5e57600080fd5b50614e6b85828601614d00565b828401525050610140614e7f8184016148c9565b818301525061016080830135818301525092915050565b600082601f830112614ea757600080fd5b81356020614eb76148f583614883565b82815260059290921b84018101918181019086841115614ed657600080fd5b8286015b8481101561493d57803567ffffffffffffffff811115614efa5760008081fd5b614f088986838b010161499f565b845250918301918301614eda565b60008060408385031215614f2957600080fd5b823567ffffffffffffffff80821115614f4157600080fd5b614f4d86838701614d88565b93506020850135915080821115614f6357600080fd5b50614f7085828601614e96565b9150509250929050565b60008083601f840112614f8c57600080fd5b50813567ffffffffffffffff811115614fa457600080fd5b6020830191508360208260051b850101111561235d57600080fd5b60008060008060008060008060e0898b031215614fdb57600080fd5b606089018a811115614fec57600080fd5b8998503567ffffffffffffffff8082111561500657600080fd5b818b0191508b601f83011261501a57600080fd5b81358181111561502957600080fd5b8c602082850101111561503b57600080fd5b6020830199508098505060808b013591508082111561505957600080fd5b6150658c838d01614f7a565b909750955060a08b013591508082111561507e57600080fd5b5061508b8b828c01614f7a565b999c989b50969995989497949560c00135949350505050565b80356fffffffffffffffffffffffffffffffff8116811461467a57600080fd5b6000606082840312156150d657600080fd5b6040516060810181811067ffffffffffffffff821117156150f9576150f9614795565b604052823561510781614ce7565b8152615115602084016150a4565b6020820152615126604084016150a4565b60408201529392505050565b600082601f83011261514357600080fd5b813560206151536148f583614883565b82815260059290921b8401810191818101908684111561517257600080fd5b8286015b8481101561493d57803567ffffffffffffffff8111156151965760008081fd5b6151a48986838b0101614e96565b845250918301918301615176565b600082601f8301126151c357600080fd5b813560206151d36148f583614883565b82815260059290921b840181019181810190868411156151f257600080fd5b8286015b8481101561493d57803583529183019183016151f6565b60006080828403121561521f57600080fd5b615227614811565b9050813567ffffffffffffffff8082111561524157600080fd5b818401915084601f83011261525557600080fd5b813560206152656148f583614883565b82815260059290921b8401810191818101908884111561528457600080fd5b8286015b848110156152bc578035868111156152a05760008081fd5b6152ae8b86838b0101614d88565b845250918301918301615288565b50865250858101359350828411156152d357600080fd5b6152df87858801615132565b908501525060408401359150808211156152f857600080fd5b50615305848285016151b2565b6040830152506060820135606082015292915050565b6000806040838503121561532e57600080fd5b823567ffffffffffffffff8082111561534657600080fd5b6153528683870161520d565b935060209150818501358181111561536957600080fd5b85019050601f8101861361537c57600080fd5b803561538a6148f582614883565b81815260059190911b820183019083810190888311156153a957600080fd5b928401925b828410156153c7578335825292840192908401906153ae565b80955050505050509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8181038181111561075d5761075d6153d6565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600067ffffffffffffffff8084168061546257615462615418565b92169190910692915050565b808202811582820484141761075d5761075d6153d6565b600067ffffffffffffffff808416806154a0576154a0615418565b92169190910492915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361550c5761550c6153d6565b5060010190565b600063ffffffff80831681810361552c5761552c6153d6565b6001019392505050565b600061012063ffffffff808d1684528b6020850152808b166040850152508060608401526155668184018a614b8b565b9050828103608084015261557a8189614b8b565b905060ff871660a084015282810360c08401526155978187614738565b905067ffffffffffffffff851660e08401528281036101008401526155bc8185614738565b9c9b505050505050505050505050565b6000602082840312156155de57600080fd5b8151611149816148a7565b6000602082840312156155fb57600080fd5b815161114981614659565b600081518084526020808501945080840160005b83811015614bd1578151805173ffffffffffffffffffffffffffffffffffffffff168852830151838801526040909601959082019060010161561a565b608081528451608082015267ffffffffffffffff60208601511660a08201526000604086015160a060c0840152615692610120840182614738565b905060608701517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff80808584030160e08601526156ce8383614738565b9250608089015191508085840301610100860152506156ed8282615606565b92505050615701602083018661ffff169052565b836040830152612828606083018473ffffffffffffffffffffffffffffffffffffffff169052565b6000806040838503121561573c57600080fd5b825161574781614ce7565b602084015190925067ffffffffffffffff81111561576457600080fd5b8301601f8101851361577557600080fd5b80516157836148f582614959565b81815286602083850101111561579857600080fd5b6157a9826020830160208601614714565b8093505050509250929050565b8082018082111561075d5761075d6153d6565b805163ffffffff8116811461467a57600080fd5b600060a082840312156157ef57600080fd5b60405160a0810181811067ffffffffffffffff8211171561581257615812614795565b60405261581e836157c9565b8152602083015161582e816148a7565b60208201526040830151615841816148a7565b6040820152606083015161ffff8116811461585b57600080fd5b606082015261586c608084016157c9565b60808201529392505050565b61016081016158ea828573ffffffffffffffffffffffffffffffffffffffff808251168352602082015167ffffffffffffffff808216602086015280604085015116604086015250508060608301511660608401528060808301511660808401528060a08301511660a0840152505050565b825163ffffffff90811660c0840152602084015173ffffffffffffffffffffffffffffffffffffffff90811660e0850152604085015116610100840152606084015161ffff16610120840152608084015116610140830152611149565b60006101208b835273ffffffffffffffffffffffffffffffffffffffff8b16602084015267ffffffffffffffff808b16604085015281606085015261598e8285018b614b8b565b915083820360808501526159a2828a614b8b565b915060ff881660a085015283820360c08501526159bf8288614738565b90861660e085015283810361010085015290506155bc8185614738565b60a0815260006159ef60a0830188614738565b73ffffffffffffffffffffffffffffffffffffffff8716602084015285604084015267ffffffffffffffff851660608401528281036080840152615a338185614738565b98975050505050505050565b6000815160208301517fffffffff0000000000000000000000000000000000000000000000000000000080821693506004831015615a875780818460040360031b1b83161693505b505050919050565b600060208284031215615aa157600080fd5b813567ffffffffffffffff811115615ab857600080fd5b611b3b8482850161520d565b600060208284031215615ad657600080fd5b815161114981614ce7565b600081518084526020808501945080840160005b83811015614bd157815187529582019590820190600101615af5565b606081526000615b246060830186615ae1565b8281036020840152615b368186615ae1565b915050826040830152949350505050565b600060208284031215615b5957600080fd5b5051919050565b67ffffffffffffffff8181168382160190808211156144d2576144d26153d6565b67ffffffffffffffff831681526040810161114960208301846146cb565b600067ffffffffffffffff80831681810361552c5761552c6153d6565b615bc681846146cb565b604060208201526000611b3b6040830184614738565b600060408284031215615bee57600080fd5b615bf66147c4565b825177ffffffffffffffffffffffffffffffffffffffffffffffff81168114615c1e57600080fd5b81526020830151615c2e81614659565b60208201529392505050565b6020815260006111496020830184615606565b600082825180855260208086019550808260051b84010181860160005b84811015615cb6577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0868403018952615ca4838351614738565b98840198925090830190600101615c6a565b5090979650505050505050565b60408152615cde60408201845167ffffffffffffffff169052565b60006020840151615cfb606084018267ffffffffffffffff169052565b5060408401516080830152606084015173ffffffffffffffffffffffffffffffffffffffff811660a084015250608084015167ffffffffffffffff811660c08401525060a084015160e083015260c0840151610100615d5d8185018315159052565b60e08601519150610120615d888186018473ffffffffffffffffffffffffffffffffffffffff169052565b81870151925061018091506101408281870152615da96101c0870185614738565b93508188015191506101607fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc08786030181880152615de78584615606565b9450818901519250615e108488018473ffffffffffffffffffffffffffffffffffffffff169052565b8801516101a087015250505082810360208401526128288185615c4d565b600082615e3d57615e3d615418565b500490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fdfea164736f6c6343000813000a", +} + +var EVM2EVMOffRampABI = EVM2EVMOffRampMetaData.ABI + +var EVM2EVMOffRampBin = EVM2EVMOffRampMetaData.Bin + +func DeployEVM2EVMOffRamp(auth *bind.TransactOpts, backend bind.ContractBackend, staticConfig EVM2EVMOffRampStaticConfig, sourceTokens []common.Address, pools []common.Address, rateLimiterConfig RateLimiterConfig) (common.Address, *types.Transaction, *EVM2EVMOffRamp, error) { + parsed, err := EVM2EVMOffRampMetaData.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(EVM2EVMOffRampBin), backend, staticConfig, sourceTokens, pools, rateLimiterConfig) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &EVM2EVMOffRamp{EVM2EVMOffRampCaller: EVM2EVMOffRampCaller{contract: contract}, EVM2EVMOffRampTransactor: EVM2EVMOffRampTransactor{contract: contract}, EVM2EVMOffRampFilterer: EVM2EVMOffRampFilterer{contract: contract}}, nil +} + +type EVM2EVMOffRamp struct { + address common.Address + abi abi.ABI + EVM2EVMOffRampCaller + EVM2EVMOffRampTransactor + EVM2EVMOffRampFilterer +} + +type EVM2EVMOffRampCaller struct { + contract *bind.BoundContract +} + +type EVM2EVMOffRampTransactor struct { + contract *bind.BoundContract +} + +type EVM2EVMOffRampFilterer struct { + contract *bind.BoundContract +} + +type EVM2EVMOffRampSession struct { + Contract *EVM2EVMOffRamp + CallOpts bind.CallOpts + TransactOpts bind.TransactOpts +} + +type EVM2EVMOffRampCallerSession struct { + Contract *EVM2EVMOffRampCaller + CallOpts bind.CallOpts +} + +type EVM2EVMOffRampTransactorSession struct { + Contract *EVM2EVMOffRampTransactor + TransactOpts bind.TransactOpts +} + +type EVM2EVMOffRampRaw struct { + Contract *EVM2EVMOffRamp +} + +type EVM2EVMOffRampCallerRaw struct { + Contract *EVM2EVMOffRampCaller +} + +type EVM2EVMOffRampTransactorRaw struct { + Contract *EVM2EVMOffRampTransactor +} + +func NewEVM2EVMOffRamp(address common.Address, backend bind.ContractBackend) (*EVM2EVMOffRamp, error) { + abi, err := abi.JSON(strings.NewReader(EVM2EVMOffRampABI)) + if err != nil { + return nil, err + } + contract, err := bindEVM2EVMOffRamp(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &EVM2EVMOffRamp{address: address, abi: abi, EVM2EVMOffRampCaller: EVM2EVMOffRampCaller{contract: contract}, EVM2EVMOffRampTransactor: EVM2EVMOffRampTransactor{contract: contract}, EVM2EVMOffRampFilterer: EVM2EVMOffRampFilterer{contract: contract}}, nil +} + +func NewEVM2EVMOffRampCaller(address common.Address, caller bind.ContractCaller) (*EVM2EVMOffRampCaller, error) { + contract, err := bindEVM2EVMOffRamp(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &EVM2EVMOffRampCaller{contract: contract}, nil +} + +func NewEVM2EVMOffRampTransactor(address common.Address, transactor bind.ContractTransactor) (*EVM2EVMOffRampTransactor, error) { + contract, err := bindEVM2EVMOffRamp(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &EVM2EVMOffRampTransactor{contract: contract}, nil +} + +func NewEVM2EVMOffRampFilterer(address common.Address, filterer bind.ContractFilterer) (*EVM2EVMOffRampFilterer, error) { + contract, err := bindEVM2EVMOffRamp(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &EVM2EVMOffRampFilterer{contract: contract}, nil +} + +func bindEVM2EVMOffRamp(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := EVM2EVMOffRampMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _EVM2EVMOffRamp.Contract.EVM2EVMOffRampCaller.contract.Call(opts, result, method, params...) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _EVM2EVMOffRamp.Contract.EVM2EVMOffRampTransactor.contract.Transfer(opts) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _EVM2EVMOffRamp.Contract.EVM2EVMOffRampTransactor.contract.Transact(opts, method, params...) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _EVM2EVMOffRamp.Contract.contract.Call(opts, result, method, params...) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _EVM2EVMOffRamp.Contract.contract.Transfer(opts) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _EVM2EVMOffRamp.Contract.contract.Transact(opts, method, params...) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampCaller) CcipReceive(opts *bind.CallOpts, arg0 ClientAny2EVMMessage) error { + var out []interface{} + err := _EVM2EVMOffRamp.contract.Call(opts, &out, "ccipReceive", arg0) + + if err != nil { + return err + } + + return err + +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampSession) CcipReceive(arg0 ClientAny2EVMMessage) error { + return _EVM2EVMOffRamp.Contract.CcipReceive(&_EVM2EVMOffRamp.CallOpts, arg0) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampCallerSession) CcipReceive(arg0 ClientAny2EVMMessage) error { + return _EVM2EVMOffRamp.Contract.CcipReceive(&_EVM2EVMOffRamp.CallOpts, arg0) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampCaller) CurrentRateLimiterState(opts *bind.CallOpts) (RateLimiterTokenBucket, error) { + var out []interface{} + err := _EVM2EVMOffRamp.contract.Call(opts, &out, "currentRateLimiterState") + + if err != nil { + return *new(RateLimiterTokenBucket), err + } + + out0 := *abi.ConvertType(out[0], new(RateLimiterTokenBucket)).(*RateLimiterTokenBucket) + + return out0, err + +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampSession) CurrentRateLimiterState() (RateLimiterTokenBucket, error) { + return _EVM2EVMOffRamp.Contract.CurrentRateLimiterState(&_EVM2EVMOffRamp.CallOpts) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampCallerSession) CurrentRateLimiterState() (RateLimiterTokenBucket, error) { + return _EVM2EVMOffRamp.Contract.CurrentRateLimiterState(&_EVM2EVMOffRamp.CallOpts) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampCaller) GetDestinationToken(opts *bind.CallOpts, sourceToken common.Address) (common.Address, error) { + var out []interface{} + err := _EVM2EVMOffRamp.contract.Call(opts, &out, "getDestinationToken", sourceToken) + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampSession) GetDestinationToken(sourceToken common.Address) (common.Address, error) { + return _EVM2EVMOffRamp.Contract.GetDestinationToken(&_EVM2EVMOffRamp.CallOpts, sourceToken) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampCallerSession) GetDestinationToken(sourceToken common.Address) (common.Address, error) { + return _EVM2EVMOffRamp.Contract.GetDestinationToken(&_EVM2EVMOffRamp.CallOpts, sourceToken) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampCaller) GetDestinationTokens(opts *bind.CallOpts) ([]common.Address, error) { + var out []interface{} + err := _EVM2EVMOffRamp.contract.Call(opts, &out, "getDestinationTokens") + + if err != nil { + return *new([]common.Address), err + } + + out0 := *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) + + return out0, err + +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampSession) GetDestinationTokens() ([]common.Address, error) { + return _EVM2EVMOffRamp.Contract.GetDestinationTokens(&_EVM2EVMOffRamp.CallOpts) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampCallerSession) GetDestinationTokens() ([]common.Address, error) { + return _EVM2EVMOffRamp.Contract.GetDestinationTokens(&_EVM2EVMOffRamp.CallOpts) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampCaller) GetDynamicConfig(opts *bind.CallOpts) (EVM2EVMOffRampDynamicConfig, error) { + var out []interface{} + err := _EVM2EVMOffRamp.contract.Call(opts, &out, "getDynamicConfig") + + if err != nil { + return *new(EVM2EVMOffRampDynamicConfig), err + } + + out0 := *abi.ConvertType(out[0], new(EVM2EVMOffRampDynamicConfig)).(*EVM2EVMOffRampDynamicConfig) + + return out0, err + +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampSession) GetDynamicConfig() (EVM2EVMOffRampDynamicConfig, error) { + return _EVM2EVMOffRamp.Contract.GetDynamicConfig(&_EVM2EVMOffRamp.CallOpts) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampCallerSession) GetDynamicConfig() (EVM2EVMOffRampDynamicConfig, error) { + return _EVM2EVMOffRamp.Contract.GetDynamicConfig(&_EVM2EVMOffRamp.CallOpts) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampCaller) GetExecutionState(opts *bind.CallOpts, sequenceNumber uint64) (uint8, error) { + var out []interface{} + err := _EVM2EVMOffRamp.contract.Call(opts, &out, "getExecutionState", sequenceNumber) + + if err != nil { + return *new(uint8), err + } + + out0 := *abi.ConvertType(out[0], new(uint8)).(*uint8) + + return out0, err + +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampSession) GetExecutionState(sequenceNumber uint64) (uint8, error) { + return _EVM2EVMOffRamp.Contract.GetExecutionState(&_EVM2EVMOffRamp.CallOpts, sequenceNumber) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampCallerSession) GetExecutionState(sequenceNumber uint64) (uint8, error) { + return _EVM2EVMOffRamp.Contract.GetExecutionState(&_EVM2EVMOffRamp.CallOpts, sequenceNumber) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampCaller) GetPoolByDestToken(opts *bind.CallOpts, destToken common.Address) (common.Address, error) { + var out []interface{} + err := _EVM2EVMOffRamp.contract.Call(opts, &out, "getPoolByDestToken", destToken) + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampSession) GetPoolByDestToken(destToken common.Address) (common.Address, error) { + return _EVM2EVMOffRamp.Contract.GetPoolByDestToken(&_EVM2EVMOffRamp.CallOpts, destToken) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampCallerSession) GetPoolByDestToken(destToken common.Address) (common.Address, error) { + return _EVM2EVMOffRamp.Contract.GetPoolByDestToken(&_EVM2EVMOffRamp.CallOpts, destToken) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampCaller) GetPoolBySourceToken(opts *bind.CallOpts, sourceToken common.Address) (common.Address, error) { + var out []interface{} + err := _EVM2EVMOffRamp.contract.Call(opts, &out, "getPoolBySourceToken", sourceToken) + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampSession) GetPoolBySourceToken(sourceToken common.Address) (common.Address, error) { + return _EVM2EVMOffRamp.Contract.GetPoolBySourceToken(&_EVM2EVMOffRamp.CallOpts, sourceToken) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampCallerSession) GetPoolBySourceToken(sourceToken common.Address) (common.Address, error) { + return _EVM2EVMOffRamp.Contract.GetPoolBySourceToken(&_EVM2EVMOffRamp.CallOpts, sourceToken) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampCaller) GetSenderNonce(opts *bind.CallOpts, sender common.Address) (uint64, error) { + var out []interface{} + err := _EVM2EVMOffRamp.contract.Call(opts, &out, "getSenderNonce", sender) + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampSession) GetSenderNonce(sender common.Address) (uint64, error) { + return _EVM2EVMOffRamp.Contract.GetSenderNonce(&_EVM2EVMOffRamp.CallOpts, sender) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampCallerSession) GetSenderNonce(sender common.Address) (uint64, error) { + return _EVM2EVMOffRamp.Contract.GetSenderNonce(&_EVM2EVMOffRamp.CallOpts, sender) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampCaller) GetStaticConfig(opts *bind.CallOpts) (EVM2EVMOffRampStaticConfig, error) { + var out []interface{} + err := _EVM2EVMOffRamp.contract.Call(opts, &out, "getStaticConfig") + + if err != nil { + return *new(EVM2EVMOffRampStaticConfig), err + } + + out0 := *abi.ConvertType(out[0], new(EVM2EVMOffRampStaticConfig)).(*EVM2EVMOffRampStaticConfig) + + return out0, err + +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampSession) GetStaticConfig() (EVM2EVMOffRampStaticConfig, error) { + return _EVM2EVMOffRamp.Contract.GetStaticConfig(&_EVM2EVMOffRamp.CallOpts) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampCallerSession) GetStaticConfig() (EVM2EVMOffRampStaticConfig, error) { + return _EVM2EVMOffRamp.Contract.GetStaticConfig(&_EVM2EVMOffRamp.CallOpts) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampCaller) GetSupportedTokens(opts *bind.CallOpts) ([]common.Address, error) { + var out []interface{} + err := _EVM2EVMOffRamp.contract.Call(opts, &out, "getSupportedTokens") + + if err != nil { + return *new([]common.Address), err + } + + out0 := *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) + + return out0, err + +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampSession) GetSupportedTokens() ([]common.Address, error) { + return _EVM2EVMOffRamp.Contract.GetSupportedTokens(&_EVM2EVMOffRamp.CallOpts) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampCallerSession) GetSupportedTokens() ([]common.Address, error) { + return _EVM2EVMOffRamp.Contract.GetSupportedTokens(&_EVM2EVMOffRamp.CallOpts) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampCaller) GetTokenLimitAdmin(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _EVM2EVMOffRamp.contract.Call(opts, &out, "getTokenLimitAdmin") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampSession) GetTokenLimitAdmin() (common.Address, error) { + return _EVM2EVMOffRamp.Contract.GetTokenLimitAdmin(&_EVM2EVMOffRamp.CallOpts) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampCallerSession) GetTokenLimitAdmin() (common.Address, error) { + return _EVM2EVMOffRamp.Contract.GetTokenLimitAdmin(&_EVM2EVMOffRamp.CallOpts) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampCaller) GetTransmitters(opts *bind.CallOpts) ([]common.Address, error) { + var out []interface{} + err := _EVM2EVMOffRamp.contract.Call(opts, &out, "getTransmitters") + + if err != nil { + return *new([]common.Address), err + } + + out0 := *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) + + return out0, err + +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampSession) GetTransmitters() ([]common.Address, error) { + return _EVM2EVMOffRamp.Contract.GetTransmitters(&_EVM2EVMOffRamp.CallOpts) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampCallerSession) GetTransmitters() ([]common.Address, error) { + return _EVM2EVMOffRamp.Contract.GetTransmitters(&_EVM2EVMOffRamp.CallOpts) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampCaller) LatestConfigDetails(opts *bind.CallOpts) (LatestConfigDetails, + + error) { + var out []interface{} + err := _EVM2EVMOffRamp.contract.Call(opts, &out, "latestConfigDetails") + + outstruct := new(LatestConfigDetails) + if err != nil { + return *outstruct, err + } + + outstruct.ConfigCount = *abi.ConvertType(out[0], new(uint32)).(*uint32) + outstruct.BlockNumber = *abi.ConvertType(out[1], new(uint32)).(*uint32) + outstruct.ConfigDigest = *abi.ConvertType(out[2], new([32]byte)).(*[32]byte) + + return *outstruct, err + +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampSession) LatestConfigDetails() (LatestConfigDetails, + + error) { + return _EVM2EVMOffRamp.Contract.LatestConfigDetails(&_EVM2EVMOffRamp.CallOpts) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampCallerSession) LatestConfigDetails() (LatestConfigDetails, + + error) { + return _EVM2EVMOffRamp.Contract.LatestConfigDetails(&_EVM2EVMOffRamp.CallOpts) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampCaller) LatestConfigDigestAndEpoch(opts *bind.CallOpts) (LatestConfigDigestAndEpoch, + + error) { + var out []interface{} + err := _EVM2EVMOffRamp.contract.Call(opts, &out, "latestConfigDigestAndEpoch") + + outstruct := new(LatestConfigDigestAndEpoch) + if err != nil { + return *outstruct, err + } + + outstruct.ScanLogs = *abi.ConvertType(out[0], new(bool)).(*bool) + outstruct.ConfigDigest = *abi.ConvertType(out[1], new([32]byte)).(*[32]byte) + outstruct.Epoch = *abi.ConvertType(out[2], new(uint32)).(*uint32) + + return *outstruct, err + +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampSession) LatestConfigDigestAndEpoch() (LatestConfigDigestAndEpoch, + + error) { + return _EVM2EVMOffRamp.Contract.LatestConfigDigestAndEpoch(&_EVM2EVMOffRamp.CallOpts) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampCallerSession) LatestConfigDigestAndEpoch() (LatestConfigDigestAndEpoch, + + error) { + return _EVM2EVMOffRamp.Contract.LatestConfigDigestAndEpoch(&_EVM2EVMOffRamp.CallOpts) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampCaller) Owner(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _EVM2EVMOffRamp.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 + +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampSession) Owner() (common.Address, error) { + return _EVM2EVMOffRamp.Contract.Owner(&_EVM2EVMOffRamp.CallOpts) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampCallerSession) Owner() (common.Address, error) { + return _EVM2EVMOffRamp.Contract.Owner(&_EVM2EVMOffRamp.CallOpts) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampCaller) TypeAndVersion(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _EVM2EVMOffRamp.contract.Call(opts, &out, "typeAndVersion") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampSession) TypeAndVersion() (string, error) { + return _EVM2EVMOffRamp.Contract.TypeAndVersion(&_EVM2EVMOffRamp.CallOpts) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampCallerSession) TypeAndVersion() (string, error) { + return _EVM2EVMOffRamp.Contract.TypeAndVersion(&_EVM2EVMOffRamp.CallOpts) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampTransactor) AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + return _EVM2EVMOffRamp.contract.Transact(opts, "acceptOwnership") +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampSession) AcceptOwnership() (*types.Transaction, error) { + return _EVM2EVMOffRamp.Contract.AcceptOwnership(&_EVM2EVMOffRamp.TransactOpts) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampTransactorSession) AcceptOwnership() (*types.Transaction, error) { + return _EVM2EVMOffRamp.Contract.AcceptOwnership(&_EVM2EVMOffRamp.TransactOpts) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampTransactor) ApplyPoolUpdates(opts *bind.TransactOpts, removes []InternalPoolUpdate, adds []InternalPoolUpdate) (*types.Transaction, error) { + return _EVM2EVMOffRamp.contract.Transact(opts, "applyPoolUpdates", removes, adds) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampSession) ApplyPoolUpdates(removes []InternalPoolUpdate, adds []InternalPoolUpdate) (*types.Transaction, error) { + return _EVM2EVMOffRamp.Contract.ApplyPoolUpdates(&_EVM2EVMOffRamp.TransactOpts, removes, adds) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampTransactorSession) ApplyPoolUpdates(removes []InternalPoolUpdate, adds []InternalPoolUpdate) (*types.Transaction, error) { + return _EVM2EVMOffRamp.Contract.ApplyPoolUpdates(&_EVM2EVMOffRamp.TransactOpts, removes, adds) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampTransactor) ExecuteSingleMessage(opts *bind.TransactOpts, message InternalEVM2EVMMessage, offchainTokenData [][]byte) (*types.Transaction, error) { + return _EVM2EVMOffRamp.contract.Transact(opts, "executeSingleMessage", message, offchainTokenData) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampSession) ExecuteSingleMessage(message InternalEVM2EVMMessage, offchainTokenData [][]byte) (*types.Transaction, error) { + return _EVM2EVMOffRamp.Contract.ExecuteSingleMessage(&_EVM2EVMOffRamp.TransactOpts, message, offchainTokenData) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampTransactorSession) ExecuteSingleMessage(message InternalEVM2EVMMessage, offchainTokenData [][]byte) (*types.Transaction, error) { + return _EVM2EVMOffRamp.Contract.ExecuteSingleMessage(&_EVM2EVMOffRamp.TransactOpts, message, offchainTokenData) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampTransactor) ManuallyExecute(opts *bind.TransactOpts, report InternalExecutionReport, gasLimitOverrides []*big.Int) (*types.Transaction, error) { + return _EVM2EVMOffRamp.contract.Transact(opts, "manuallyExecute", report, gasLimitOverrides) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampSession) ManuallyExecute(report InternalExecutionReport, gasLimitOverrides []*big.Int) (*types.Transaction, error) { + return _EVM2EVMOffRamp.Contract.ManuallyExecute(&_EVM2EVMOffRamp.TransactOpts, report, gasLimitOverrides) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampTransactorSession) ManuallyExecute(report InternalExecutionReport, gasLimitOverrides []*big.Int) (*types.Transaction, error) { + return _EVM2EVMOffRamp.Contract.ManuallyExecute(&_EVM2EVMOffRamp.TransactOpts, report, gasLimitOverrides) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampTransactor) SetAdmin(opts *bind.TransactOpts, newAdmin common.Address) (*types.Transaction, error) { + return _EVM2EVMOffRamp.contract.Transact(opts, "setAdmin", newAdmin) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampSession) SetAdmin(newAdmin common.Address) (*types.Transaction, error) { + return _EVM2EVMOffRamp.Contract.SetAdmin(&_EVM2EVMOffRamp.TransactOpts, newAdmin) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampTransactorSession) SetAdmin(newAdmin common.Address) (*types.Transaction, error) { + return _EVM2EVMOffRamp.Contract.SetAdmin(&_EVM2EVMOffRamp.TransactOpts, newAdmin) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampTransactor) SetOCR2Config(opts *bind.TransactOpts, signers []common.Address, transmitters []common.Address, f uint8, onchainConfig []byte, offchainConfigVersion uint64, offchainConfig []byte) (*types.Transaction, error) { + return _EVM2EVMOffRamp.contract.Transact(opts, "setOCR2Config", signers, transmitters, f, onchainConfig, offchainConfigVersion, offchainConfig) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampSession) SetOCR2Config(signers []common.Address, transmitters []common.Address, f uint8, onchainConfig []byte, offchainConfigVersion uint64, offchainConfig []byte) (*types.Transaction, error) { + return _EVM2EVMOffRamp.Contract.SetOCR2Config(&_EVM2EVMOffRamp.TransactOpts, signers, transmitters, f, onchainConfig, offchainConfigVersion, offchainConfig) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampTransactorSession) SetOCR2Config(signers []common.Address, transmitters []common.Address, f uint8, onchainConfig []byte, offchainConfigVersion uint64, offchainConfig []byte) (*types.Transaction, error) { + return _EVM2EVMOffRamp.Contract.SetOCR2Config(&_EVM2EVMOffRamp.TransactOpts, signers, transmitters, f, onchainConfig, offchainConfigVersion, offchainConfig) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampTransactor) SetRateLimiterConfig(opts *bind.TransactOpts, config RateLimiterConfig) (*types.Transaction, error) { + return _EVM2EVMOffRamp.contract.Transact(opts, "setRateLimiterConfig", config) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampSession) SetRateLimiterConfig(config RateLimiterConfig) (*types.Transaction, error) { + return _EVM2EVMOffRamp.Contract.SetRateLimiterConfig(&_EVM2EVMOffRamp.TransactOpts, config) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampTransactorSession) SetRateLimiterConfig(config RateLimiterConfig) (*types.Transaction, error) { + return _EVM2EVMOffRamp.Contract.SetRateLimiterConfig(&_EVM2EVMOffRamp.TransactOpts, config) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampTransactor) TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) { + return _EVM2EVMOffRamp.contract.Transact(opts, "transferOwnership", to) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampSession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _EVM2EVMOffRamp.Contract.TransferOwnership(&_EVM2EVMOffRamp.TransactOpts, to) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampTransactorSession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _EVM2EVMOffRamp.Contract.TransferOwnership(&_EVM2EVMOffRamp.TransactOpts, to) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampTransactor) Transmit(opts *bind.TransactOpts, reportContext [3][32]byte, report []byte, rs [][32]byte, ss [][32]byte, arg4 [32]byte) (*types.Transaction, error) { + return _EVM2EVMOffRamp.contract.Transact(opts, "transmit", reportContext, report, rs, ss, arg4) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampSession) Transmit(reportContext [3][32]byte, report []byte, rs [][32]byte, ss [][32]byte, arg4 [32]byte) (*types.Transaction, error) { + return _EVM2EVMOffRamp.Contract.Transmit(&_EVM2EVMOffRamp.TransactOpts, reportContext, report, rs, ss, arg4) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampTransactorSession) Transmit(reportContext [3][32]byte, report []byte, rs [][32]byte, ss [][32]byte, arg4 [32]byte) (*types.Transaction, error) { + return _EVM2EVMOffRamp.Contract.Transmit(&_EVM2EVMOffRamp.TransactOpts, reportContext, report, rs, ss, arg4) +} + +type EVM2EVMOffRampAdminSetIterator struct { + Event *EVM2EVMOffRampAdminSet + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *EVM2EVMOffRampAdminSetIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOffRampAdminSet) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOffRampAdminSet) + 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() + } +} + +func (it *EVM2EVMOffRampAdminSetIterator) Error() error { + return it.fail +} + +func (it *EVM2EVMOffRampAdminSetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type EVM2EVMOffRampAdminSet struct { + NewAdmin common.Address + Raw types.Log +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) FilterAdminSet(opts *bind.FilterOpts) (*EVM2EVMOffRampAdminSetIterator, error) { + + logs, sub, err := _EVM2EVMOffRamp.contract.FilterLogs(opts, "AdminSet") + if err != nil { + return nil, err + } + return &EVM2EVMOffRampAdminSetIterator{contract: _EVM2EVMOffRamp.contract, event: "AdminSet", logs: logs, sub: sub}, nil +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) WatchAdminSet(opts *bind.WatchOpts, sink chan<- *EVM2EVMOffRampAdminSet) (event.Subscription, error) { + + logs, sub, err := _EVM2EVMOffRamp.contract.WatchLogs(opts, "AdminSet") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(EVM2EVMOffRampAdminSet) + if err := _EVM2EVMOffRamp.contract.UnpackLog(event, "AdminSet", 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 +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) ParseAdminSet(log types.Log) (*EVM2EVMOffRampAdminSet, error) { + event := new(EVM2EVMOffRampAdminSet) + if err := _EVM2EVMOffRamp.contract.UnpackLog(event, "AdminSet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type EVM2EVMOffRampConfigSetIterator struct { + Event *EVM2EVMOffRampConfigSet + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *EVM2EVMOffRampConfigSetIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOffRampConfigSet) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOffRampConfigSet) + 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() + } +} + +func (it *EVM2EVMOffRampConfigSetIterator) Error() error { + return it.fail +} + +func (it *EVM2EVMOffRampConfigSetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type EVM2EVMOffRampConfigSet struct { + StaticConfig EVM2EVMOffRampStaticConfig + DynamicConfig EVM2EVMOffRampDynamicConfig + Raw types.Log +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) FilterConfigSet(opts *bind.FilterOpts) (*EVM2EVMOffRampConfigSetIterator, error) { + + logs, sub, err := _EVM2EVMOffRamp.contract.FilterLogs(opts, "ConfigSet") + if err != nil { + return nil, err + } + return &EVM2EVMOffRampConfigSetIterator{contract: _EVM2EVMOffRamp.contract, event: "ConfigSet", logs: logs, sub: sub}, nil +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) WatchConfigSet(opts *bind.WatchOpts, sink chan<- *EVM2EVMOffRampConfigSet) (event.Subscription, error) { + + logs, sub, err := _EVM2EVMOffRamp.contract.WatchLogs(opts, "ConfigSet") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(EVM2EVMOffRampConfigSet) + if err := _EVM2EVMOffRamp.contract.UnpackLog(event, "ConfigSet", 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 +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) ParseConfigSet(log types.Log) (*EVM2EVMOffRampConfigSet, error) { + event := new(EVM2EVMOffRampConfigSet) + if err := _EVM2EVMOffRamp.contract.UnpackLog(event, "ConfigSet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type EVM2EVMOffRampConfigSet0Iterator struct { + Event *EVM2EVMOffRampConfigSet0 + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *EVM2EVMOffRampConfigSet0Iterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOffRampConfigSet0) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOffRampConfigSet0) + 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() + } +} + +func (it *EVM2EVMOffRampConfigSet0Iterator) Error() error { + return it.fail +} + +func (it *EVM2EVMOffRampConfigSet0Iterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type EVM2EVMOffRampConfigSet0 struct { + PreviousConfigBlockNumber uint32 + ConfigDigest [32]byte + ConfigCount uint64 + Signers []common.Address + Transmitters []common.Address + F uint8 + OnchainConfig []byte + OffchainConfigVersion uint64 + OffchainConfig []byte + Raw types.Log +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) FilterConfigSet0(opts *bind.FilterOpts) (*EVM2EVMOffRampConfigSet0Iterator, error) { + + logs, sub, err := _EVM2EVMOffRamp.contract.FilterLogs(opts, "ConfigSet0") + if err != nil { + return nil, err + } + return &EVM2EVMOffRampConfigSet0Iterator{contract: _EVM2EVMOffRamp.contract, event: "ConfigSet0", logs: logs, sub: sub}, nil +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) WatchConfigSet0(opts *bind.WatchOpts, sink chan<- *EVM2EVMOffRampConfigSet0) (event.Subscription, error) { + + logs, sub, err := _EVM2EVMOffRamp.contract.WatchLogs(opts, "ConfigSet0") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(EVM2EVMOffRampConfigSet0) + if err := _EVM2EVMOffRamp.contract.UnpackLog(event, "ConfigSet0", 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 +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) ParseConfigSet0(log types.Log) (*EVM2EVMOffRampConfigSet0, error) { + event := new(EVM2EVMOffRampConfigSet0) + if err := _EVM2EVMOffRamp.contract.UnpackLog(event, "ConfigSet0", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type EVM2EVMOffRampExecutionStateChangedIterator struct { + Event *EVM2EVMOffRampExecutionStateChanged + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *EVM2EVMOffRampExecutionStateChangedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOffRampExecutionStateChanged) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOffRampExecutionStateChanged) + 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() + } +} + +func (it *EVM2EVMOffRampExecutionStateChangedIterator) Error() error { + return it.fail +} + +func (it *EVM2EVMOffRampExecutionStateChangedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type EVM2EVMOffRampExecutionStateChanged struct { + SequenceNumber uint64 + MessageId [32]byte + State uint8 + ReturnData []byte + Raw types.Log +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) FilterExecutionStateChanged(opts *bind.FilterOpts, sequenceNumber []uint64, messageId [][32]byte) (*EVM2EVMOffRampExecutionStateChangedIterator, error) { + + var sequenceNumberRule []interface{} + for _, sequenceNumberItem := range sequenceNumber { + sequenceNumberRule = append(sequenceNumberRule, sequenceNumberItem) + } + var messageIdRule []interface{} + for _, messageIdItem := range messageId { + messageIdRule = append(messageIdRule, messageIdItem) + } + + logs, sub, err := _EVM2EVMOffRamp.contract.FilterLogs(opts, "ExecutionStateChanged", sequenceNumberRule, messageIdRule) + if err != nil { + return nil, err + } + return &EVM2EVMOffRampExecutionStateChangedIterator{contract: _EVM2EVMOffRamp.contract, event: "ExecutionStateChanged", logs: logs, sub: sub}, nil +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) WatchExecutionStateChanged(opts *bind.WatchOpts, sink chan<- *EVM2EVMOffRampExecutionStateChanged, sequenceNumber []uint64, messageId [][32]byte) (event.Subscription, error) { + + var sequenceNumberRule []interface{} + for _, sequenceNumberItem := range sequenceNumber { + sequenceNumberRule = append(sequenceNumberRule, sequenceNumberItem) + } + var messageIdRule []interface{} + for _, messageIdItem := range messageId { + messageIdRule = append(messageIdRule, messageIdItem) + } + + logs, sub, err := _EVM2EVMOffRamp.contract.WatchLogs(opts, "ExecutionStateChanged", sequenceNumberRule, messageIdRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(EVM2EVMOffRampExecutionStateChanged) + if err := _EVM2EVMOffRamp.contract.UnpackLog(event, "ExecutionStateChanged", 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 +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) ParseExecutionStateChanged(log types.Log) (*EVM2EVMOffRampExecutionStateChanged, error) { + event := new(EVM2EVMOffRampExecutionStateChanged) + if err := _EVM2EVMOffRamp.contract.UnpackLog(event, "ExecutionStateChanged", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type EVM2EVMOffRampOwnershipTransferRequestedIterator struct { + Event *EVM2EVMOffRampOwnershipTransferRequested + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *EVM2EVMOffRampOwnershipTransferRequestedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOffRampOwnershipTransferRequested) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOffRampOwnershipTransferRequested) + 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() + } +} + +func (it *EVM2EVMOffRampOwnershipTransferRequestedIterator) Error() error { + return it.fail +} + +func (it *EVM2EVMOffRampOwnershipTransferRequestedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type EVM2EVMOffRampOwnershipTransferRequested struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*EVM2EVMOffRampOwnershipTransferRequestedIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _EVM2EVMOffRamp.contract.FilterLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return &EVM2EVMOffRampOwnershipTransferRequestedIterator{contract: _EVM2EVMOffRamp.contract, event: "OwnershipTransferRequested", logs: logs, sub: sub}, nil +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *EVM2EVMOffRampOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _EVM2EVMOffRamp.contract.WatchLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(EVM2EVMOffRampOwnershipTransferRequested) + if err := _EVM2EVMOffRamp.contract.UnpackLog(event, "OwnershipTransferRequested", 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 +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) ParseOwnershipTransferRequested(log types.Log) (*EVM2EVMOffRampOwnershipTransferRequested, error) { + event := new(EVM2EVMOffRampOwnershipTransferRequested) + if err := _EVM2EVMOffRamp.contract.UnpackLog(event, "OwnershipTransferRequested", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type EVM2EVMOffRampOwnershipTransferredIterator struct { + Event *EVM2EVMOffRampOwnershipTransferred + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *EVM2EVMOffRampOwnershipTransferredIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOffRampOwnershipTransferred) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOffRampOwnershipTransferred) + 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() + } +} + +func (it *EVM2EVMOffRampOwnershipTransferredIterator) Error() error { + return it.fail +} + +func (it *EVM2EVMOffRampOwnershipTransferredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type EVM2EVMOffRampOwnershipTransferred struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*EVM2EVMOffRampOwnershipTransferredIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _EVM2EVMOffRamp.contract.FilterLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return &EVM2EVMOffRampOwnershipTransferredIterator{contract: _EVM2EVMOffRamp.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *EVM2EVMOffRampOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _EVM2EVMOffRamp.contract.WatchLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(EVM2EVMOffRampOwnershipTransferred) + if err := _EVM2EVMOffRamp.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 +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) ParseOwnershipTransferred(log types.Log) (*EVM2EVMOffRampOwnershipTransferred, error) { + event := new(EVM2EVMOffRampOwnershipTransferred) + if err := _EVM2EVMOffRamp.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type EVM2EVMOffRampPoolAddedIterator struct { + Event *EVM2EVMOffRampPoolAdded + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *EVM2EVMOffRampPoolAddedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOffRampPoolAdded) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOffRampPoolAdded) + 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() + } +} + +func (it *EVM2EVMOffRampPoolAddedIterator) Error() error { + return it.fail +} + +func (it *EVM2EVMOffRampPoolAddedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type EVM2EVMOffRampPoolAdded struct { + Token common.Address + Pool common.Address + Raw types.Log +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) FilterPoolAdded(opts *bind.FilterOpts) (*EVM2EVMOffRampPoolAddedIterator, error) { + + logs, sub, err := _EVM2EVMOffRamp.contract.FilterLogs(opts, "PoolAdded") + if err != nil { + return nil, err + } + return &EVM2EVMOffRampPoolAddedIterator{contract: _EVM2EVMOffRamp.contract, event: "PoolAdded", logs: logs, sub: sub}, nil +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) WatchPoolAdded(opts *bind.WatchOpts, sink chan<- *EVM2EVMOffRampPoolAdded) (event.Subscription, error) { + + logs, sub, err := _EVM2EVMOffRamp.contract.WatchLogs(opts, "PoolAdded") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(EVM2EVMOffRampPoolAdded) + if err := _EVM2EVMOffRamp.contract.UnpackLog(event, "PoolAdded", 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 +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) ParsePoolAdded(log types.Log) (*EVM2EVMOffRampPoolAdded, error) { + event := new(EVM2EVMOffRampPoolAdded) + if err := _EVM2EVMOffRamp.contract.UnpackLog(event, "PoolAdded", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type EVM2EVMOffRampPoolRemovedIterator struct { + Event *EVM2EVMOffRampPoolRemoved + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *EVM2EVMOffRampPoolRemovedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOffRampPoolRemoved) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOffRampPoolRemoved) + 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() + } +} + +func (it *EVM2EVMOffRampPoolRemovedIterator) Error() error { + return it.fail +} + +func (it *EVM2EVMOffRampPoolRemovedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type EVM2EVMOffRampPoolRemoved struct { + Token common.Address + Pool common.Address + Raw types.Log +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) FilterPoolRemoved(opts *bind.FilterOpts) (*EVM2EVMOffRampPoolRemovedIterator, error) { + + logs, sub, err := _EVM2EVMOffRamp.contract.FilterLogs(opts, "PoolRemoved") + if err != nil { + return nil, err + } + return &EVM2EVMOffRampPoolRemovedIterator{contract: _EVM2EVMOffRamp.contract, event: "PoolRemoved", logs: logs, sub: sub}, nil +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) WatchPoolRemoved(opts *bind.WatchOpts, sink chan<- *EVM2EVMOffRampPoolRemoved) (event.Subscription, error) { + + logs, sub, err := _EVM2EVMOffRamp.contract.WatchLogs(opts, "PoolRemoved") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(EVM2EVMOffRampPoolRemoved) + if err := _EVM2EVMOffRamp.contract.UnpackLog(event, "PoolRemoved", 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 +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) ParsePoolRemoved(log types.Log) (*EVM2EVMOffRampPoolRemoved, error) { + event := new(EVM2EVMOffRampPoolRemoved) + if err := _EVM2EVMOffRamp.contract.UnpackLog(event, "PoolRemoved", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type EVM2EVMOffRampSkippedIncorrectNonceIterator struct { + Event *EVM2EVMOffRampSkippedIncorrectNonce + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *EVM2EVMOffRampSkippedIncorrectNonceIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOffRampSkippedIncorrectNonce) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOffRampSkippedIncorrectNonce) + 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() + } +} + +func (it *EVM2EVMOffRampSkippedIncorrectNonceIterator) Error() error { + return it.fail +} + +func (it *EVM2EVMOffRampSkippedIncorrectNonceIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type EVM2EVMOffRampSkippedIncorrectNonce struct { + Nonce uint64 + Sender common.Address + Raw types.Log +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) FilterSkippedIncorrectNonce(opts *bind.FilterOpts, nonce []uint64, sender []common.Address) (*EVM2EVMOffRampSkippedIncorrectNonceIterator, error) { + + var nonceRule []interface{} + for _, nonceItem := range nonce { + nonceRule = append(nonceRule, nonceItem) + } + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _EVM2EVMOffRamp.contract.FilterLogs(opts, "SkippedIncorrectNonce", nonceRule, senderRule) + if err != nil { + return nil, err + } + return &EVM2EVMOffRampSkippedIncorrectNonceIterator{contract: _EVM2EVMOffRamp.contract, event: "SkippedIncorrectNonce", logs: logs, sub: sub}, nil +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) WatchSkippedIncorrectNonce(opts *bind.WatchOpts, sink chan<- *EVM2EVMOffRampSkippedIncorrectNonce, nonce []uint64, sender []common.Address) (event.Subscription, error) { + + var nonceRule []interface{} + for _, nonceItem := range nonce { + nonceRule = append(nonceRule, nonceItem) + } + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _EVM2EVMOffRamp.contract.WatchLogs(opts, "SkippedIncorrectNonce", nonceRule, senderRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(EVM2EVMOffRampSkippedIncorrectNonce) + if err := _EVM2EVMOffRamp.contract.UnpackLog(event, "SkippedIncorrectNonce", 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 +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) ParseSkippedIncorrectNonce(log types.Log) (*EVM2EVMOffRampSkippedIncorrectNonce, error) { + event := new(EVM2EVMOffRampSkippedIncorrectNonce) + if err := _EVM2EVMOffRamp.contract.UnpackLog(event, "SkippedIncorrectNonce", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflightIterator struct { + Event *EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflight + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflightIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflight) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflight) + 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() + } +} + +func (it *EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflightIterator) Error() error { + return it.fail +} + +func (it *EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflightIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflight struct { + Nonce uint64 + Sender common.Address + Raw types.Log +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) FilterSkippedSenderWithPreviousRampMessageInflight(opts *bind.FilterOpts, nonce []uint64, sender []common.Address) (*EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflightIterator, error) { + + var nonceRule []interface{} + for _, nonceItem := range nonce { + nonceRule = append(nonceRule, nonceItem) + } + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _EVM2EVMOffRamp.contract.FilterLogs(opts, "SkippedSenderWithPreviousRampMessageInflight", nonceRule, senderRule) + if err != nil { + return nil, err + } + return &EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflightIterator{contract: _EVM2EVMOffRamp.contract, event: "SkippedSenderWithPreviousRampMessageInflight", logs: logs, sub: sub}, nil +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) WatchSkippedSenderWithPreviousRampMessageInflight(opts *bind.WatchOpts, sink chan<- *EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflight, nonce []uint64, sender []common.Address) (event.Subscription, error) { + + var nonceRule []interface{} + for _, nonceItem := range nonce { + nonceRule = append(nonceRule, nonceItem) + } + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _EVM2EVMOffRamp.contract.WatchLogs(opts, "SkippedSenderWithPreviousRampMessageInflight", nonceRule, senderRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflight) + if err := _EVM2EVMOffRamp.contract.UnpackLog(event, "SkippedSenderWithPreviousRampMessageInflight", 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 +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) ParseSkippedSenderWithPreviousRampMessageInflight(log types.Log) (*EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflight, error) { + event := new(EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflight) + if err := _EVM2EVMOffRamp.contract.UnpackLog(event, "SkippedSenderWithPreviousRampMessageInflight", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type EVM2EVMOffRampTransmittedIterator struct { + Event *EVM2EVMOffRampTransmitted + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *EVM2EVMOffRampTransmittedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOffRampTransmitted) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOffRampTransmitted) + 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() + } +} + +func (it *EVM2EVMOffRampTransmittedIterator) Error() error { + return it.fail +} + +func (it *EVM2EVMOffRampTransmittedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type EVM2EVMOffRampTransmitted struct { + ConfigDigest [32]byte + Epoch uint32 + Raw types.Log +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) FilterTransmitted(opts *bind.FilterOpts) (*EVM2EVMOffRampTransmittedIterator, error) { + + logs, sub, err := _EVM2EVMOffRamp.contract.FilterLogs(opts, "Transmitted") + if err != nil { + return nil, err + } + return &EVM2EVMOffRampTransmittedIterator{contract: _EVM2EVMOffRamp.contract, event: "Transmitted", logs: logs, sub: sub}, nil +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) WatchTransmitted(opts *bind.WatchOpts, sink chan<- *EVM2EVMOffRampTransmitted) (event.Subscription, error) { + + logs, sub, err := _EVM2EVMOffRamp.contract.WatchLogs(opts, "Transmitted") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(EVM2EVMOffRampTransmitted) + if err := _EVM2EVMOffRamp.contract.UnpackLog(event, "Transmitted", 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 +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) ParseTransmitted(log types.Log) (*EVM2EVMOffRampTransmitted, error) { + event := new(EVM2EVMOffRampTransmitted) + if err := _EVM2EVMOffRamp.contract.UnpackLog(event, "Transmitted", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type LatestConfigDetails struct { + ConfigCount uint32 + BlockNumber uint32 + ConfigDigest [32]byte +} +type LatestConfigDigestAndEpoch struct { + ScanLogs bool + ConfigDigest [32]byte + Epoch uint32 +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRamp) ParseLog(log types.Log) (generated.AbigenLog, error) { + switch log.Topics[0] { + case _EVM2EVMOffRamp.abi.Events["AdminSet"].ID: + return _EVM2EVMOffRamp.ParseAdminSet(log) + case _EVM2EVMOffRamp.abi.Events["ConfigSet"].ID: + return _EVM2EVMOffRamp.ParseConfigSet(log) + case _EVM2EVMOffRamp.abi.Events["ConfigSet0"].ID: + return _EVM2EVMOffRamp.ParseConfigSet0(log) + case _EVM2EVMOffRamp.abi.Events["ExecutionStateChanged"].ID: + return _EVM2EVMOffRamp.ParseExecutionStateChanged(log) + case _EVM2EVMOffRamp.abi.Events["OwnershipTransferRequested"].ID: + return _EVM2EVMOffRamp.ParseOwnershipTransferRequested(log) + case _EVM2EVMOffRamp.abi.Events["OwnershipTransferred"].ID: + return _EVM2EVMOffRamp.ParseOwnershipTransferred(log) + case _EVM2EVMOffRamp.abi.Events["PoolAdded"].ID: + return _EVM2EVMOffRamp.ParsePoolAdded(log) + case _EVM2EVMOffRamp.abi.Events["PoolRemoved"].ID: + return _EVM2EVMOffRamp.ParsePoolRemoved(log) + case _EVM2EVMOffRamp.abi.Events["SkippedIncorrectNonce"].ID: + return _EVM2EVMOffRamp.ParseSkippedIncorrectNonce(log) + case _EVM2EVMOffRamp.abi.Events["SkippedSenderWithPreviousRampMessageInflight"].ID: + return _EVM2EVMOffRamp.ParseSkippedSenderWithPreviousRampMessageInflight(log) + case _EVM2EVMOffRamp.abi.Events["Transmitted"].ID: + return _EVM2EVMOffRamp.ParseTransmitted(log) + + default: + return nil, fmt.Errorf("abigen wrapper received unknown log topic: %v", log.Topics[0]) + } +} + +func (EVM2EVMOffRampAdminSet) Topic() common.Hash { + return common.HexToHash("0x8fe72c3e0020beb3234e76ae6676fa576fbfcae600af1c4fea44784cf0db329c") +} + +func (EVM2EVMOffRampConfigSet) Topic() common.Hash { + return common.HexToHash("0x737ef22d3f6615e342ed21c69e06620dbc5c8a261ed7cfb2ce214806b1f76eda") +} + +func (EVM2EVMOffRampConfigSet0) Topic() common.Hash { + return common.HexToHash("0x1591690b8638f5fb2dbec82ac741805ac5da8b45dc5263f4875b0496fdce4e05") +} + +func (EVM2EVMOffRampExecutionStateChanged) Topic() common.Hash { + return common.HexToHash("0xd4f851956a5d67c3997d1c9205045fef79bae2947fdee7e9e2641abc7391ef65") +} + +func (EVM2EVMOffRampOwnershipTransferRequested) Topic() common.Hash { + return common.HexToHash("0xed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae1278") +} + +func (EVM2EVMOffRampOwnershipTransferred) Topic() common.Hash { + return common.HexToHash("0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0") +} + +func (EVM2EVMOffRampPoolAdded) Topic() common.Hash { + return common.HexToHash("0x95f865c2808f8b2a85eea2611db7843150ee7835ef1403f9755918a97d76933c") +} + +func (EVM2EVMOffRampPoolRemoved) Topic() common.Hash { + return common.HexToHash("0x987eb3c2f78454541205f72f34839b434c306c9eaf4922efd7c0c3060fdb2e4c") +} + +func (EVM2EVMOffRampSkippedIncorrectNonce) Topic() common.Hash { + return common.HexToHash("0xd32ddb11d71e3d63411d37b09f9a8b28664f1cb1338bfd1413c173b0ebf41237") +} + +func (EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflight) Topic() common.Hash { + return common.HexToHash("0xe44a20935573a783dd0d5991c92d7b6a0eb3173566530364db3ec10e9a990b5d") +} + +func (EVM2EVMOffRampTransmitted) Topic() common.Hash { + return common.HexToHash("0xb04e63db38c49950639fa09d29872f21f5d49d614f3a969d8adf3d4b52e41a62") +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRamp) Address() common.Address { + return _EVM2EVMOffRamp.address +} + +type EVM2EVMOffRampInterface interface { + CcipReceive(opts *bind.CallOpts, arg0 ClientAny2EVMMessage) error + + CurrentRateLimiterState(opts *bind.CallOpts) (RateLimiterTokenBucket, error) + + GetDestinationToken(opts *bind.CallOpts, sourceToken common.Address) (common.Address, error) + + GetDestinationTokens(opts *bind.CallOpts) ([]common.Address, error) + + GetDynamicConfig(opts *bind.CallOpts) (EVM2EVMOffRampDynamicConfig, error) + + GetExecutionState(opts *bind.CallOpts, sequenceNumber uint64) (uint8, error) + + GetPoolByDestToken(opts *bind.CallOpts, destToken common.Address) (common.Address, error) + + GetPoolBySourceToken(opts *bind.CallOpts, sourceToken common.Address) (common.Address, error) + + GetSenderNonce(opts *bind.CallOpts, sender common.Address) (uint64, error) + + GetStaticConfig(opts *bind.CallOpts) (EVM2EVMOffRampStaticConfig, error) + + GetSupportedTokens(opts *bind.CallOpts) ([]common.Address, error) + + GetTokenLimitAdmin(opts *bind.CallOpts) (common.Address, error) + + GetTransmitters(opts *bind.CallOpts) ([]common.Address, error) + + LatestConfigDetails(opts *bind.CallOpts) (LatestConfigDetails, + + error) + + LatestConfigDigestAndEpoch(opts *bind.CallOpts) (LatestConfigDigestAndEpoch, + + error) + + Owner(opts *bind.CallOpts) (common.Address, error) + + TypeAndVersion(opts *bind.CallOpts) (string, error) + + AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) + + ApplyPoolUpdates(opts *bind.TransactOpts, removes []InternalPoolUpdate, adds []InternalPoolUpdate) (*types.Transaction, error) + + ExecuteSingleMessage(opts *bind.TransactOpts, message InternalEVM2EVMMessage, offchainTokenData [][]byte) (*types.Transaction, error) + + ManuallyExecute(opts *bind.TransactOpts, report InternalExecutionReport, gasLimitOverrides []*big.Int) (*types.Transaction, error) + + SetAdmin(opts *bind.TransactOpts, newAdmin common.Address) (*types.Transaction, error) + + SetOCR2Config(opts *bind.TransactOpts, signers []common.Address, transmitters []common.Address, f uint8, onchainConfig []byte, offchainConfigVersion uint64, offchainConfig []byte) (*types.Transaction, error) + + SetRateLimiterConfig(opts *bind.TransactOpts, config RateLimiterConfig) (*types.Transaction, error) + + TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) + + Transmit(opts *bind.TransactOpts, reportContext [3][32]byte, report []byte, rs [][32]byte, ss [][32]byte, arg4 [32]byte) (*types.Transaction, error) + + FilterAdminSet(opts *bind.FilterOpts) (*EVM2EVMOffRampAdminSetIterator, error) + + WatchAdminSet(opts *bind.WatchOpts, sink chan<- *EVM2EVMOffRampAdminSet) (event.Subscription, error) + + ParseAdminSet(log types.Log) (*EVM2EVMOffRampAdminSet, error) + + FilterConfigSet(opts *bind.FilterOpts) (*EVM2EVMOffRampConfigSetIterator, error) + + WatchConfigSet(opts *bind.WatchOpts, sink chan<- *EVM2EVMOffRampConfigSet) (event.Subscription, error) + + ParseConfigSet(log types.Log) (*EVM2EVMOffRampConfigSet, error) + + FilterConfigSet0(opts *bind.FilterOpts) (*EVM2EVMOffRampConfigSet0Iterator, error) + + WatchConfigSet0(opts *bind.WatchOpts, sink chan<- *EVM2EVMOffRampConfigSet0) (event.Subscription, error) + + ParseConfigSet0(log types.Log) (*EVM2EVMOffRampConfigSet0, error) + + FilterExecutionStateChanged(opts *bind.FilterOpts, sequenceNumber []uint64, messageId [][32]byte) (*EVM2EVMOffRampExecutionStateChangedIterator, error) + + WatchExecutionStateChanged(opts *bind.WatchOpts, sink chan<- *EVM2EVMOffRampExecutionStateChanged, sequenceNumber []uint64, messageId [][32]byte) (event.Subscription, error) + + ParseExecutionStateChanged(log types.Log) (*EVM2EVMOffRampExecutionStateChanged, error) + + FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*EVM2EVMOffRampOwnershipTransferRequestedIterator, error) + + WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *EVM2EVMOffRampOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferRequested(log types.Log) (*EVM2EVMOffRampOwnershipTransferRequested, error) + + FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*EVM2EVMOffRampOwnershipTransferredIterator, error) + + WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *EVM2EVMOffRampOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferred(log types.Log) (*EVM2EVMOffRampOwnershipTransferred, error) + + FilterPoolAdded(opts *bind.FilterOpts) (*EVM2EVMOffRampPoolAddedIterator, error) + + WatchPoolAdded(opts *bind.WatchOpts, sink chan<- *EVM2EVMOffRampPoolAdded) (event.Subscription, error) + + ParsePoolAdded(log types.Log) (*EVM2EVMOffRampPoolAdded, error) + + FilterPoolRemoved(opts *bind.FilterOpts) (*EVM2EVMOffRampPoolRemovedIterator, error) + + WatchPoolRemoved(opts *bind.WatchOpts, sink chan<- *EVM2EVMOffRampPoolRemoved) (event.Subscription, error) + + ParsePoolRemoved(log types.Log) (*EVM2EVMOffRampPoolRemoved, error) + + FilterSkippedIncorrectNonce(opts *bind.FilterOpts, nonce []uint64, sender []common.Address) (*EVM2EVMOffRampSkippedIncorrectNonceIterator, error) + + WatchSkippedIncorrectNonce(opts *bind.WatchOpts, sink chan<- *EVM2EVMOffRampSkippedIncorrectNonce, nonce []uint64, sender []common.Address) (event.Subscription, error) + + ParseSkippedIncorrectNonce(log types.Log) (*EVM2EVMOffRampSkippedIncorrectNonce, error) + + FilterSkippedSenderWithPreviousRampMessageInflight(opts *bind.FilterOpts, nonce []uint64, sender []common.Address) (*EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflightIterator, error) + + WatchSkippedSenderWithPreviousRampMessageInflight(opts *bind.WatchOpts, sink chan<- *EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflight, nonce []uint64, sender []common.Address) (event.Subscription, error) + + ParseSkippedSenderWithPreviousRampMessageInflight(log types.Log) (*EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflight, error) + + FilterTransmitted(opts *bind.FilterOpts) (*EVM2EVMOffRampTransmittedIterator, error) + + WatchTransmitted(opts *bind.WatchOpts, sink chan<- *EVM2EVMOffRampTransmitted) (event.Subscription, error) + + ParseTransmitted(log types.Log) (*EVM2EVMOffRampTransmitted, error) + + ParseLog(log types.Log) (generated.AbigenLog, error) + + Address() common.Address +} diff --git a/core/gethwrappers/ccip/generated/evm_2_evm_offramp_1_2_0/evm_2_evm_offramp_1_2_0.go b/core/gethwrappers/ccip/generated/evm_2_evm_offramp_1_2_0/evm_2_evm_offramp_1_2_0.go new file mode 100644 index 00000000000..beeaee1bb76 --- /dev/null +++ b/core/gethwrappers/ccip/generated/evm_2_evm_offramp_1_2_0/evm_2_evm_offramp_1_2_0.go @@ -0,0 +1,2356 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package evm_2_evm_offramp_1_2_0 + +import ( + "errors" + "fmt" + "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" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" +) + +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +type ClientAny2EVMMessage struct { + MessageId [32]byte + SourceChainSelector uint64 + Sender []byte + Data []byte + DestTokenAmounts []ClientEVMTokenAmount +} + +type ClientEVMTokenAmount struct { + Token common.Address + Amount *big.Int +} + +type EVM2EVMOffRampDynamicConfig struct { + PermissionLessExecutionThresholdSeconds uint32 + Router common.Address + PriceRegistry common.Address + MaxNumberOfTokensPerMsg uint16 + MaxDataBytes uint32 + MaxPoolReleaseOrMintGas uint32 +} + +type EVM2EVMOffRampStaticConfig struct { + CommitStore common.Address + ChainSelector uint64 + SourceChainSelector uint64 + OnRamp common.Address + PrevOffRamp common.Address + ArmProxy common.Address +} + +type InternalEVM2EVMMessage struct { + SourceChainSelector uint64 + Sender common.Address + Receiver common.Address + SequenceNumber uint64 + GasLimit *big.Int + Strict bool + Nonce uint64 + FeeToken common.Address + FeeTokenAmount *big.Int + Data []byte + TokenAmounts []ClientEVMTokenAmount + SourceTokenData [][]byte + MessageId [32]byte +} + +type InternalExecutionReport struct { + Messages []InternalEVM2EVMMessage + OffchainTokenData [][][]byte + Proofs [][32]byte + ProofFlagBits *big.Int +} + +type InternalPoolUpdate struct { + Token common.Address + Pool common.Address +} + +type RateLimiterConfig struct { + IsEnabled bool + Capacity *big.Int + Rate *big.Int +} + +type RateLimiterTokenBucket struct { + Tokens *big.Int + LastUpdated uint32 + IsEnabled bool + Capacity *big.Int + Rate *big.Int +} + +var EVM2EVMOffRampMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"commitStore\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"onRamp\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"prevOffRamp\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"armProxy\",\"type\":\"address\"}],\"internalType\":\"structEVM2EVMOffRamp.StaticConfig\",\"name\":\"staticConfig\",\"type\":\"tuple\"},{\"internalType\":\"contractIERC20[]\",\"name\":\"sourceTokens\",\"type\":\"address[]\"},{\"internalType\":\"contractIPool[]\",\"name\":\"pools\",\"type\":\"address[]\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"rateLimiterConfig\",\"type\":\"tuple\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"capacity\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"requested\",\"type\":\"uint256\"}],\"name\":\"AggregateValueMaxCapacityExceeded\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"minWaitInSeconds\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"available\",\"type\":\"uint256\"}],\"name\":\"AggregateValueRateLimitReached\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"sequenceNumber\",\"type\":\"uint64\"}],\"name\":\"AlreadyAttempted\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"sequenceNumber\",\"type\":\"uint64\"}],\"name\":\"AlreadyExecuted\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"BadARMSignal\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"BucketOverfilled\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"CanOnlySelfCall\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"CommitStoreAlreadyInUse\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"expected\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"actual\",\"type\":\"bytes32\"}],\"name\":\"ConfigDigestMismatch\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"EmptyReport\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"error\",\"type\":\"bytes\"}],\"name\":\"ExecutionError\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expected\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"actual\",\"type\":\"uint256\"}],\"name\":\"ForkedChain\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"message\",\"type\":\"string\"}],\"name\":\"InvalidConfig\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"newLimit\",\"type\":\"uint256\"}],\"name\":\"InvalidManualExecutionGasLimit\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidMessageId\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"sequenceNumber\",\"type\":\"uint64\"},{\"internalType\":\"enumInternal.MessageExecutionState\",\"name\":\"newState\",\"type\":\"uint8\"}],\"name\":\"InvalidNewState\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"}],\"name\":\"InvalidSourceChain\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidTokenPoolConfig\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ManualExecutionGasLimitMismatch\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ManualExecutionNotYetEnabled\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"maxSize\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"actualSize\",\"type\":\"uint256\"}],\"name\":\"MessageTooLarge\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCallableByAdminOrOwner\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OracleCannotBeZeroAddress\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"PoolAlreadyAdded\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"PoolDoesNotExist\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"PriceNotFoundForToken\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"error\",\"type\":\"bytes\"}],\"name\":\"ReceiverError\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RootNotCommitted\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"sequenceNumber\",\"type\":\"uint64\"}],\"name\":\"TokenDataMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"error\",\"type\":\"bytes\"}],\"name\":\"TokenHandlingError\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"capacity\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"requested\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"}],\"name\":\"TokenMaxCapacityExceeded\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TokenPoolMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"minWaitInSeconds\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"available\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"}],\"name\":\"TokenRateLimitReached\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UnauthorizedTransmitter\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UnexpectedTokenData\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"sequenceNumber\",\"type\":\"uint64\"}],\"name\":\"UnsupportedNumberOfTokens\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"contractIERC20\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"UnsupportedToken\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expected\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"actual\",\"type\":\"uint256\"}],\"name\":\"WrongMessageLength\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddressNotAllowed\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"commitStore\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"onRamp\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"prevOffRamp\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"armProxy\",\"type\":\"address\"}],\"indexed\":false,\"internalType\":\"structEVM2EVMOffRamp.StaticConfig\",\"name\":\"staticConfig\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint32\",\"name\":\"permissionLessExecutionThresholdSeconds\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"router\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"priceRegistry\",\"type\":\"address\"},{\"internalType\":\"uint16\",\"name\":\"maxNumberOfTokensPerMsg\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"maxDataBytes\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"maxPoolReleaseOrMintGas\",\"type\":\"uint32\"}],\"indexed\":false,\"internalType\":\"structEVM2EVMOffRamp.DynamicConfig\",\"name\":\"dynamicConfig\",\"type\":\"tuple\"}],\"name\":\"ConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"previousConfigBlockNumber\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"configCount\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"signers\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"transmitters\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"f\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"onchainConfig\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"offchainConfigVersion\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"offchainConfig\",\"type\":\"bytes\"}],\"name\":\"ConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"sequenceNumber\",\"type\":\"uint64\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"messageId\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"enumInternal.MessageExecutionState\",\"name\":\"state\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"returnData\",\"type\":\"bytes\"}],\"name\":\"ExecutionStateChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"name\":\"PoolAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"name\":\"PoolRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"nonce\",\"type\":\"uint64\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"SkippedIncorrectNonce\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"nonce\",\"type\":\"uint64\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"SkippedSenderWithPreviousRampMessageInflight\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"epoch\",\"type\":\"uint32\"}],\"name\":\"Transmitted\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"internalType\":\"structInternal.PoolUpdate[]\",\"name\":\"removes\",\"type\":\"tuple[]\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"internalType\":\"structInternal.PoolUpdate[]\",\"name\":\"adds\",\"type\":\"tuple[]\"}],\"name\":\"applyPoolUpdates\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"messageId\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"sender\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"internalType\":\"structClient.EVMTokenAmount[]\",\"name\":\"destTokenAmounts\",\"type\":\"tuple[]\"}],\"internalType\":\"structClient.Any2EVMMessage\",\"name\":\"\",\"type\":\"tuple\"}],\"name\":\"ccipReceive\",\"outputs\":[],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"currentRateLimiterState\",\"outputs\":[{\"components\":[{\"internalType\":\"uint128\",\"name\":\"tokens\",\"type\":\"uint128\"},{\"internalType\":\"uint32\",\"name\":\"lastUpdated\",\"type\":\"uint32\"},{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.TokenBucket\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"sequenceNumber\",\"type\":\"uint64\"},{\"internalType\":\"uint256\",\"name\":\"gasLimit\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"strict\",\"type\":\"bool\"},{\"internalType\":\"uint64\",\"name\":\"nonce\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"feeToken\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"feeTokenAmount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"internalType\":\"structClient.EVMTokenAmount[]\",\"name\":\"tokenAmounts\",\"type\":\"tuple[]\"},{\"internalType\":\"bytes[]\",\"name\":\"sourceTokenData\",\"type\":\"bytes[]\"},{\"internalType\":\"bytes32\",\"name\":\"messageId\",\"type\":\"bytes32\"}],\"internalType\":\"structInternal.EVM2EVMMessage\",\"name\":\"message\",\"type\":\"tuple\"},{\"internalType\":\"bytes[]\",\"name\":\"offchainTokenData\",\"type\":\"bytes[]\"}],\"name\":\"executeSingleMessage\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractIERC20\",\"name\":\"sourceToken\",\"type\":\"address\"}],\"name\":\"getDestinationToken\",\"outputs\":[{\"internalType\":\"contractIERC20\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getDestinationTokens\",\"outputs\":[{\"internalType\":\"contractIERC20[]\",\"name\":\"destTokens\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getDynamicConfig\",\"outputs\":[{\"components\":[{\"internalType\":\"uint32\",\"name\":\"permissionLessExecutionThresholdSeconds\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"router\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"priceRegistry\",\"type\":\"address\"},{\"internalType\":\"uint16\",\"name\":\"maxNumberOfTokensPerMsg\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"maxDataBytes\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"maxPoolReleaseOrMintGas\",\"type\":\"uint32\"}],\"internalType\":\"structEVM2EVMOffRamp.DynamicConfig\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"sequenceNumber\",\"type\":\"uint64\"}],\"name\":\"getExecutionState\",\"outputs\":[{\"internalType\":\"enumInternal.MessageExecutionState\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractIERC20\",\"name\":\"destToken\",\"type\":\"address\"}],\"name\":\"getPoolByDestToken\",\"outputs\":[{\"internalType\":\"contractIPool\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractIERC20\",\"name\":\"sourceToken\",\"type\":\"address\"}],\"name\":\"getPoolBySourceToken\",\"outputs\":[{\"internalType\":\"contractIPool\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"getSenderNonce\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"nonce\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getStaticConfig\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"commitStore\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"onRamp\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"prevOffRamp\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"armProxy\",\"type\":\"address\"}],\"internalType\":\"structEVM2EVMOffRamp.StaticConfig\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getSupportedTokens\",\"outputs\":[{\"internalType\":\"contractIERC20[]\",\"name\":\"sourceTokens\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getTokenLimitAdmin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getTransmitters\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestConfigDetails\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"configCount\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"blockNumber\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestConfigDigestAndEpoch\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"scanLogs\",\"type\":\"bool\"},{\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"internalType\":\"uint32\",\"name\":\"epoch\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"sequenceNumber\",\"type\":\"uint64\"},{\"internalType\":\"uint256\",\"name\":\"gasLimit\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"strict\",\"type\":\"bool\"},{\"internalType\":\"uint64\",\"name\":\"nonce\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"feeToken\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"feeTokenAmount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"internalType\":\"structClient.EVMTokenAmount[]\",\"name\":\"tokenAmounts\",\"type\":\"tuple[]\"},{\"internalType\":\"bytes[]\",\"name\":\"sourceTokenData\",\"type\":\"bytes[]\"},{\"internalType\":\"bytes32\",\"name\":\"messageId\",\"type\":\"bytes32\"}],\"internalType\":\"structInternal.EVM2EVMMessage[]\",\"name\":\"messages\",\"type\":\"tuple[]\"},{\"internalType\":\"bytes[][]\",\"name\":\"offchainTokenData\",\"type\":\"bytes[][]\"},{\"internalType\":\"bytes32[]\",\"name\":\"proofs\",\"type\":\"bytes32[]\"},{\"internalType\":\"uint256\",\"name\":\"proofFlagBits\",\"type\":\"uint256\"}],\"internalType\":\"structInternal.ExecutionReport\",\"name\":\"report\",\"type\":\"tuple\"},{\"internalType\":\"uint256[]\",\"name\":\"gasLimitOverrides\",\"type\":\"uint256[]\"}],\"name\":\"manuallyExecute\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"setAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"signers\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"transmitters\",\"type\":\"address[]\"},{\"internalType\":\"uint8\",\"name\":\"f\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"onchainConfig\",\"type\":\"bytes\"},{\"internalType\":\"uint64\",\"name\":\"offchainConfigVersion\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"offchainConfig\",\"type\":\"bytes\"}],\"name\":\"setOCR2Config\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"config\",\"type\":\"tuple\"}],\"name\":\"setRateLimiterConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32[3]\",\"name\":\"reportContext\",\"type\":\"bytes32[3]\"},{\"internalType\":\"bytes\",\"name\":\"report\",\"type\":\"bytes\"},{\"internalType\":\"bytes32[]\",\"name\":\"rs\",\"type\":\"bytes32[]\"},{\"internalType\":\"bytes32[]\",\"name\":\"ss\",\"type\":\"bytes32[]\"},{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"transmit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", + Bin: "0x6101806040523480156200001257600080fd5b5060405162006ac338038062006ac3833981016040819052620000359162000891565b8033806000816200008d5760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000c057620000c08162000478565b50506040805160a081018252602084810180516001600160801b039081168085524263ffffffff169385018490528751151585870181905292518216606086018190529790950151166080938401819052600380546001600160a01b031916909517600160801b9384021760ff60a01b1916600160a01b90920291909117909355909102909217600455504690528151835114620001705760405162d8548360e71b815260040160405180910390fd5b60608401516001600160a01b0316158062000193575083516001600160a01b0316155b15620001b2576040516342bcdf7f60e11b815260040160405180910390fd5b83600001516001600160a01b0316634120fccd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015620001f5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200021b9190620009a8565b6001600160401b03166001146200024557604051636fc2a20760e11b815260040160405180910390fd5b83516001600160a01b0390811660a090815260408601516001600160401b0390811660c05260208701511660e052606086015182166101005260808601518216610140528501511661016052620002bc7f8acd72527118c8324937b1a42e02cd246697c3b633f1742f3cae11de233722b362000523565b6101205260005b83518110156200046d576200031d848281518110620002e657620002e6620009c6565b6020026020010151848381518110620003035762000303620009c6565b6020026020010151600c6200058a60201b9092919060201c565b50620003d2838281518110620003375762000337620009c6565b60200260200101516001600160a01b03166321df0da76040518163ffffffff1660e01b8152600401602060405180830381865afa1580156200037d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620003a39190620009dc565b848381518110620003b857620003b8620009c6565b6020026020010151600f6200058a60201b9092919060201c565b507f95f865c2808f8b2a85eea2611db7843150ee7835ef1403f9755918a97d76933c848281518110620004095762000409620009c6565b6020026020010151848381518110620004265762000426620009c6565b6020026020010151604051620004529291906001600160a01b0392831681529116602082015260400190565b60405180910390a1620004658162000a03565b9050620002c3565b505050505062000a2b565b336001600160a01b03821603620004d25760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640162000084565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b60008160c05160e051610100516040516020016200056d94939291909384526001600160401b039283166020850152911660408301526001600160a01b0316606082015260800190565b604051602081830303815290604052805190602001209050919050565b6000620005a2846001600160a01b03851684620005aa565b949350505050565b6000620005a284846001600160a01b03851660008281526002840160205260408120829055620005a284846000620005e38383620005ec565b90505b92915050565b60008181526001830160205260408120546200063557508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155620005e6565b506000620005e6565b634e487b7160e01b600052604160045260246000fd5b60405160c081016001600160401b03811182821017156200067957620006796200063e565b60405290565b604051601f8201601f191681016001600160401b0381118282101715620006aa57620006aa6200063e565b604052919050565b6001600160a01b0381168114620006c857600080fd5b50565b80516001600160401b0381168114620006e357600080fd5b919050565b60006001600160401b038211156200070457620007046200063e565b5060051b60200190565b600082601f8301126200072057600080fd5b81516020620007396200073383620006e8565b6200067f565b82815260059290921b840181019181810190868411156200075957600080fd5b8286015b84811015620007815780516200077381620006b2565b83529183019183016200075d565b509695505050505050565b600082601f8301126200079e57600080fd5b81516020620007b16200073383620006e8565b82815260059290921b84018101918181019086841115620007d157600080fd5b8286015b8481101562000781578051620007eb81620006b2565b8352918301918301620007d5565b80516001600160801b0381168114620006e357600080fd5b6000606082840312156200082457600080fd5b604051606081016001600160401b03811182821017156200084957620008496200063e565b8060405250809150825180151581146200086257600080fd5b81526200087260208401620007f9565b60208201526200088560408401620007f9565b60408201525092915050565b600080600080848603610160811215620008aa57600080fd5b60c0811215620008b957600080fd5b50620008c462000654565b8551620008d181620006b2565b8152620008e160208701620006cb565b6020820152620008f460408701620006cb565b604082015260608601516200090981620006b2565b606082015260808601516200091e81620006b2565b608082015260a08601516200093381620006b2565b60a082015260c08601519094506001600160401b03808211156200095657600080fd5b62000964888389016200070e565b945060e08701519150808211156200097b57600080fd5b506200098a878288016200078c565b9250506200099d86610100870162000811565b905092959194509250565b600060208284031215620009bb57600080fd5b620005e382620006cb565b634e487b7160e01b600052603260045260246000fd5b600060208284031215620009ef57600080fd5b8151620009fc81620006b2565b9392505050565b60006001820162000a2457634e487b7160e01b600052601160045260246000fd5b5060010190565b60805160a05160c05160e05161010051610120516101405161016051615fbb62000b08600039600081816103090152818161211a01526123c40152600081816102cd0152818161164e015281816116d0015281816120f30152818161293a01526129c10152600061257d01526000818161029101526120c90152600081816102310152612077015260008181610261015281816120a10152818161315b01526136f80152600081816101f5015281816120490152612672015260008181611397015281816113e30152818161179101526117dd0152615fbb6000f3fe608060405234801561001057600080fd5b50600436106101ae5760003560e01c806379ba5097116100ee578063b1dc65a411610097578063d3c7c2c711610071578063d3c7c2c7146106d3578063d7e2bb50146106db578063f2fde38b146106ee578063f52121a51461070157600080fd5b8063b1dc65a41461069a578063b4069b31146106ad578063c92b2832146106c057600080fd5b8063856c8247116100c8578063856c8247146106305780638da5cb5b1461065c578063afcb95d71461067a57600080fd5b806379ba5097146105ea57806381ff7048146105f257806385572ffb1461062257600080fd5b8063599f64311161015b578063681fba1611610135578063681fba16146104b8578063704b6c02146104cd578063740f4150146104e05780637437ff9f146104f357600080fd5b8063599f6431146104515780635d86f14114610490578063666cab8d146104a357600080fd5b80631ef381741161018c5780631ef38174146103c55780633a87ac53146103da578063546719cd146103ed57600080fd5b806306285c69146101b3578063142a98fc1461035c578063181f5a771461037c575b600080fd5b6103466040805160c081018252600080825260208201819052918101829052606081018290526080810182905260a08101919091526040518060c001604052807f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1681526020017f000000000000000000000000000000000000000000000000000000000000000067ffffffffffffffff1681526020017f000000000000000000000000000000000000000000000000000000000000000067ffffffffffffffff1681526020017f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1681526020017f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1681526020017f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16815250905090565b6040516103539190614693565b60405180910390f35b61036f61036a36600461472a565b610714565b60405161035391906147b1565b6103b86040518060400160405280601481526020017f45564d3245564d4f666652616d7020312e322e3000000000000000000000000081525081565b604051610353919061482d565b6103d86103d3366004614a9b565b61078f565b005b6103d86103e8366004614bad565b610c4e565b6103f561105e565b604051610353919081516fffffffffffffffffffffffffffffffff908116825260208084015163ffffffff1690830152604080840151151590830152606080840151821690830152608092830151169181019190915260a00190565b60025473ffffffffffffffffffffffffffffffffffffffff165b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610353565b61046b61049e366004614c19565b611113565b6104ab61117c565b6040516103539190614c87565b6104c06111eb565b6040516103539190614c9a565b6103d86104db366004614c19565b6112a4565b6103d86104ee366004615133565b611394565b6105dd6040805160c081018252600080825260208201819052918101829052606081018290526080810182905260a0810191909152506040805160c081018252600a5463ffffffff808216835273ffffffffffffffffffffffffffffffffffffffff64010000000090920482166020840152600b549182169383019390935261ffff7401000000000000000000000000000000000000000082041660608301527601000000000000000000000000000000000000000000008104831660808301527a010000000000000000000000000000000000000000000000000000900490911660a082015290565b60405161035391906151ee565b6103d8611516565b6007546005546040805163ffffffff80851682526401000000009094049093166020840152820152606001610353565b6103d86101ae36600461525d565b61064361063e366004614c19565b611613565b60405167ffffffffffffffff9091168152602001610353565b60005473ffffffffffffffffffffffffffffffffffffffff1661046b565b604080516001815260006020820181905291810191909152606001610353565b6103d86106a83660046152dd565b61173b565b61046b6106bb366004614c19565b6119cc565b6103d86106ce3660046153e2565b611a45565b6104c0611aca565b61046b6106e9366004614c19565b611b7f565b6103d86106fc366004614c19565b611b8e565b6103d861070f366004615450565b611b9f565b6000610722600160046154e3565b600261072f608085615525565b67ffffffffffffffff16610743919061554c565b60136000610752608087615563565b67ffffffffffffffff1667ffffffffffffffff16815260200190815260200160002054901c16600381111561078957610789614747565b92915050565b84518460ff16601f821115610805576040517f89a6198900000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f746f6f206d616e79207472616e736d697474657273000000000000000000000060448201526064015b60405180910390fd5b8060000361086f576040517f89a6198900000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f66206d75737420626520706f736974697665000000000000000000000000000060448201526064016107fc565b610877611dfa565b61088085611e7d565b60095460005b8181101561090c5760086000600983815481106108a5576108a561558a565b600091825260208083209091015473ffffffffffffffffffffffffffffffffffffffff168352820192909252604001902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000169055610905816155b9565b9050610886565b50875160005b81811015610b085760008a828151811061092e5761092e61558a565b602002602001015190506000600281111561094b5761094b614747565b73ffffffffffffffffffffffffffffffffffffffff8216600090815260086020526040902054610100900460ff16600281111561098a5761098a614747565b146109f1576040517f89a6198900000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f7265706561746564207472616e736d697474657220616464726573730000000060448201526064016107fc565b73ffffffffffffffffffffffffffffffffffffffff8116610a3e576040517fd6c62c9b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040805180820190915260ff83168152602081016002905273ffffffffffffffffffffffffffffffffffffffff821660009081526008602090815260409091208251815460ff9091167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0082168117835592840151919283917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00001617610100836002811115610aee57610aee614747565b02179055509050505080610b01906155b9565b9050610912565b508851610b1c9060099060208c01906145fd565b506006805460ff838116610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000909216908b161717905560078054610ba2914691309190600090610b749063ffffffff166155f1565b91906101000a81548163ffffffff021916908363ffffffff160217905563ffffffff168d8d8d8d8d8d61217e565b6005600001819055506000600760049054906101000a900463ffffffff16905043600760046101000a81548163ffffffff021916908363ffffffff1602179055507f1591690b8638f5fb2dbec82ac741805ac5da8b45dc5263f4875b0496fdce4e0581600560000154600760009054906101000a900463ffffffff168e8e8e8e8e8e604051610c3999989796959493929190615614565b60405180910390a15050505050505050505050565b610c56611dfa565b60005b83811015610e55576000858583818110610c7557610c7561558a565b610c8b9260206040909202019081019150614c19565b90506000868684818110610ca157610ca161558a565b9050604002016020016020810190610cb99190614c19565b9050610cc6600c83612229565b610cfc576040517f9c8787c000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8116610d1e600c8461224b565b73ffffffffffffffffffffffffffffffffffffffff1614610d6b576040517f6cc7b99800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610d76600c8361226d565b50610df18173ffffffffffffffffffffffffffffffffffffffff166321df0da76040518163ffffffff1660e01b8152600401602060405180830381865afa158015610dc5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610de991906156aa565b600f9061226d565b506040805173ffffffffffffffffffffffffffffffffffffffff8085168252831660208201527f987eb3c2f78454541205f72f34839b434c306c9eaf4922efd7c0c3060fdb2e4c910160405180910390a1505080610e4e906155b9565b9050610c59565b5060005b81811015611057576000838383818110610e7557610e7561558a565b610e8b9260206040909202019081019150614c19565b90506000848484818110610ea157610ea161558a565b9050604002016020016020810190610eb99190614c19565b905073ffffffffffffffffffffffffffffffffffffffff82161580610ef2575073ffffffffffffffffffffffffffffffffffffffff8116155b15610f29576040517f6c2a418000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610f34600c83612229565b15610f6b576040517f3caf458500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610f77600c838361228f565b50610ff38173ffffffffffffffffffffffffffffffffffffffff166321df0da76040518163ffffffff1660e01b8152600401602060405180830381865afa158015610fc6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fea91906156aa565b600f908361228f565b506040805173ffffffffffffffffffffffffffffffffffffffff8085168252831660208201527f95f865c2808f8b2a85eea2611db7843150ee7835ef1403f9755918a97d76933c910160405180910390a1505080611050906155b9565b9050610e59565b5050505050565b6040805160a0810182526000808252602082018190529181018290526060810182905260808101919091526040805160a0810182526003546fffffffffffffffffffffffffffffffff808216835270010000000000000000000000000000000080830463ffffffff1660208501527401000000000000000000000000000000000000000090920460ff16151593830193909352600454808416606084015204909116608082015261110e906122ba565b905090565b60008080611122600c8561236c565b9150915081611175576040517fbf16aab600000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff851660048201526024016107fc565b9392505050565b606060098054806020026020016040519081016040528092919081815260200182805480156111e157602002820191906000526020600020905b815473ffffffffffffffffffffffffffffffffffffffff1681526001909101906020018083116111b6575b5050505050905090565b60606111f7600f61239b565b67ffffffffffffffff81111561120f5761120f614840565b604051908082528060200260200182016040528015611238578160200160208202803683370190505b50905060005b81518110156112a0576000611254600f836123a6565b5090508083838151811061126a5761126a61558a565b73ffffffffffffffffffffffffffffffffffffffff9092166020928302919091019091015250611299816155b9565b905061123e565b5090565b60005473ffffffffffffffffffffffffffffffffffffffff1633148015906112e4575060025473ffffffffffffffffffffffffffffffffffffffff163314155b1561131b576040517ff6cd562000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600280547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83169081179091556040519081527f8fe72c3e0020beb3234e76ae6676fa576fbfcae600af1c4fea44784cf0db329c9060200160405180910390a150565b467f00000000000000000000000000000000000000000000000000000000000000001461141f576040517f0f01ce850000000000000000000000000000000000000000000000000000000081527f0000000000000000000000000000000000000000000000000000000000000000600482015267ffffffffffffffff461660248201526044016107fc565b8151518151811461145c576040517f83e3f56400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b8181101561150657600083828151811061147b5761147b61558a565b60200260200101519050806000141580156114b4575084518051839081106114a5576114a561558a565b60200260200101516080015181105b156114f5576040517f085e39cf00000000000000000000000000000000000000000000000000000000815260048101839052602481018290526044016107fc565b506114ff816155b9565b905061145f565b5061151183836123c2565b505050565b60015473ffffffffffffffffffffffffffffffffffffffff163314611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e65720000000000000000000060448201526064016107fc565b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b73ffffffffffffffffffffffffffffffffffffffff811660009081526012602052604081205467ffffffffffffffff168015801561168657507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1615155b15610789576040517f856c824700000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff84811660048301527f0000000000000000000000000000000000000000000000000000000000000000169063856c824790602401602060405180830381865afa158015611717573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061117591906156c7565b6117458787612d89565b60055488359080821461178e576040517f93df584c00000000000000000000000000000000000000000000000000000000815260048101829052602481018390526044016107fc565b467f00000000000000000000000000000000000000000000000000000000000000001461180f576040517f0f01ce850000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000060048201524660248201526044016107fc565b6040805183815260208c81013560081c63ffffffff16908201527fb04e63db38c49950639fa09d29872f21f5d49d614f3a969d8adf3d4b52e41a62910160405180910390a13360009081526008602090815260408083208151808301909252805460ff8082168452929391929184019161010090910416600281111561189757611897614747565b60028111156118a8576118a8614747565b90525090506002816020015160028111156118c5576118c5614747565b14801561190c57506009816000015160ff16815481106118e7576118e761558a565b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff1633145b611942576040517fda0f08e800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50600061195085602061554c565b61195b88602061554c565b6119678b6101446156e4565b61197191906156e4565b61197b91906156e4565b90503681146119bf576040517f8e1192e1000000000000000000000000000000000000000000000000000000008152600481018290523660248201526044016107fc565b5050505050505050505050565b60006119d782611113565b73ffffffffffffffffffffffffffffffffffffffff166321df0da76040518163ffffffff1660e01b8152600401602060405180830381865afa158015611a21573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061078991906156aa565b60005473ffffffffffffffffffffffffffffffffffffffff163314801590611a85575060025473ffffffffffffffffffffffffffffffffffffffff163314155b15611abc576040517ff6cd562000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611ac7600382612db0565b50565b6060611ad6600c61239b565b67ffffffffffffffff811115611aee57611aee614840565b604051908082528060200260200182016040528015611b17578160200160208202803683370190505b50905060005b81518110156112a0576000611b33600c836123a6565b50905080838381518110611b4957611b4961558a565b73ffffffffffffffffffffffffffffffffffffffff9092166020928302919091019091015250611b78816155b9565b9050611b1d565b60008080611122600f8561236c565b611b96611dfa565b611ac781612f95565b333014611bd8576040517f371a732800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040805160008082526020820190925281611c15565b6040805180820190915260008082526020820152815260200190600190039081611bee5790505b506101408401515190915015611c8257611c7f8361014001518460200151604051602001611c5f919073ffffffffffffffffffffffffffffffffffffffff91909116815260200190565b60405160208183030381529060405285604001518661016001518661308a565b90505b604083015173ffffffffffffffffffffffffffffffffffffffff163b1580611cec57506040830151611cea9073ffffffffffffffffffffffffffffffffffffffff167f85572ffb00000000000000000000000000000000000000000000000000000000613415565b155b15611cf657505050565b600a546000908190640100000000900473ffffffffffffffffffffffffffffffffffffffff16633cf97983611d2b8786613431565b611388886080015189604001516040518563ffffffff1660e01b8152600401611d579493929190615748565b6000604051808303816000875af1158015611d76573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201604052611dbc919081019061581a565b50915091508161105757806040517f0a8d6e8c0000000000000000000000000000000000000000000000000000000081526004016107fc919061482d565b60005473ffffffffffffffffffffffffffffffffffffffff163314611e7b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e65720000000000000000000060448201526064016107fc565b565b600081806020019051810190611e9391906158c4565b602081015190915073ffffffffffffffffffffffffffffffffffffffff16611ee7576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8051600a805460208085015173ffffffffffffffffffffffffffffffffffffffff908116640100000000027fffffffffffffffff00000000000000000000000000000000000000000000000090931663ffffffff9586161792909217909255604080850151600b80546060808901516080808b015160a0808d01518c167a010000000000000000000000000000000000000000000000000000027fffff00000000ffffffffffffffffffffffffffffffffffffffffffffffffffff92909c1676010000000000000000000000000000000000000000000002919091167fffff0000000000000000ffffffffffffffffffffffffffffffffffffffffffff61ffff90941674010000000000000000000000000000000000000000027fffffffffffffffffffff00000000000000000000000000000000000000000000909616978a169790971794909417919091169490941797909717909155825160c0810184527f00000000000000000000000000000000000000000000000000000000000000008516815267ffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000008116968201969096527f0000000000000000000000000000000000000000000000000000000000000000909516858401527f00000000000000000000000000000000000000000000000000000000000000008416958501959095527f00000000000000000000000000000000000000000000000000000000000000008316908401527f00000000000000000000000000000000000000000000000000000000000000009091169282019290925290517fe668e1a4644c1a030b909bbfd837f5cfa914994ed5e0bb2e9c34a5c37753128a91612172918490615970565b60405180910390a15050565b6000808a8a8a8a8a8a8a8a8a6040516020016121a299989796959493929190615a4c565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815291905280516020909101207dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167e01000000000000000000000000000000000000000000000000000000000000179150509998505050505050505050565b60006111758373ffffffffffffffffffffffffffffffffffffffff84166134e1565b60006111758373ffffffffffffffffffffffffffffffffffffffff84166134ed565b60006111758373ffffffffffffffffffffffffffffffffffffffff84166134f9565b60006122b28473ffffffffffffffffffffffffffffffffffffffff851684613505565b949350505050565b6040805160a08101825260008082526020820181905291810182905260608101829052608081019190915261234882606001516fffffffffffffffffffffffffffffffff1683600001516fffffffffffffffffffffffffffffffff16846020015163ffffffff164261232c91906154e3565b85608001516fffffffffffffffffffffffffffffffff16613528565b6fffffffffffffffffffffffffffffffff1682525063ffffffff4216602082015290565b60008061238f8473ffffffffffffffffffffffffffffffffffffffff8516613547565b915091505b9250929050565b600061078982613556565b60008080806123b58686613561565b9097909650945050505050565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663397796f76040518163ffffffff1660e01b8152600401602060405180830381865afa15801561242d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124519190615ae1565b15612488576040517fc148371500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b81515160008190036124c5576040517ebf199700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8260200151518114612503576040517f57e0e08300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008167ffffffffffffffff81111561251e5761251e614840565b604051908082528060200260200182016040528015612547578160200160208202803683370190505b50905060005b828110156126275760008560000151828151811061256d5761256d61558a565b602002602001015190506125a1817f0000000000000000000000000000000000000000000000000000000000000000613570565b8383815181106125b3576125b361558a565b6020026020010181815250508061018001518383815181106125d7576125d761558a565b602002602001015114612616576040517f7185cf6b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50612620816155b9565b905061254d565b50604080850151606086015191517f3204887500000000000000000000000000000000000000000000000000000000815260009273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016926332048875926126a892879291600401615b2e565b602060405180830381865afa1580156126c5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126e99190615b64565b905080600003612725576040517fea75680100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8351151560005b84811015612d805760008760000151828151811061274c5761274c61558a565b6020026020010151905060006127658260600151610714565b9050600081600381111561277b5761277b614747565b14806127985750600381600381111561279657612796614747565b145b6127e05760608201516040517f50a6e05200000000000000000000000000000000000000000000000000000000815267ffffffffffffffff90911660048201526024016107fc565b831561289d57600a5460009063ffffffff166127fc87426154e3565b119050808061281c5750600382600381111561281a5761281a614747565b145b612852576040517f6358b0d000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8884815181106128645761286461558a565b6020026020010151600014612897578884815181106128855761288561558a565b60200260200101518360800181815250505b506128fa565b60008160038111156128b1576128b1614747565b146128fa5760608201516040517f67d9ba0f00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff90911660048201526024016107fc565b60208083015173ffffffffffffffffffffffffffffffffffffffff1660009081526012909152604090205467ffffffffffffffff168015801561297257507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1615155b15612b155760208301516040517f856c824700000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff91821660048201527f00000000000000000000000000000000000000000000000000000000000000009091169063856c824790602401602060405180830381865afa158015612a0a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a2e91906156c7565b60c084015190915067ffffffffffffffff16612a4b826001615b7d565b67ffffffffffffffff1614612ab857826020015173ffffffffffffffffffffffffffffffffffffffff168360c0015167ffffffffffffffff167fe44a20935573a783dd0d5991c92d7b6a0eb3173566530364db3ec10e9a990b5d60405160405180910390a3505050612d70565b60208381015173ffffffffffffffffffffffffffffffffffffffff16600090815260129091526040902080547fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000001667ffffffffffffffff83161790555b6000826003811115612b2957612b29614747565b03612bb55760c083015167ffffffffffffffff16612b48826001615b7d565b67ffffffffffffffff1614612bb557826020015173ffffffffffffffffffffffffffffffffffffffff168360c0015167ffffffffffffffff167fd32ddb11d71e3d63411d37b09f9a8b28664f1cb1338bfd1413c173b0ebf4123760405160405180910390a3505050612d70565b60008a602001518581518110612bcd57612bcd61558a565b60200260200101519050612bf984606001518560000151866101400151518761012001515185516136f6565b612c08846060015160016138a0565b600080612c15868461394a565b91509150612c278660600151836138a0565b6003826003811115612c3b57612c3b614747565b14158015612c5b57506002826003811115612c5857612c58614747565b14155b15612c9a578560600151826040517f9e2616030000000000000000000000000000000000000000000000000000000081526004016107fc929190615b9e565b6000856003811115612cae57612cae614747565b03612d1b5760208087015173ffffffffffffffffffffffffffffffffffffffff166000908152601290915260408120805467ffffffffffffffff1691612cf383615bbc565b91906101000a81548167ffffffffffffffff021916908367ffffffffffffffff160217905550505b856101800151866060015167ffffffffffffffff167fd4f851956a5d67c3997d1c9205045fef79bae2947fdee7e9e2641abc7391ef658484604051612d61929190615bd9565b60405180910390a35050505050505b612d79816155b9565b905061272c565b50505050505050565b612dac612d9882840184615bf9565b6040805160008152602081019091526123c2565b5050565b8154600090612dd990700100000000000000000000000000000000900463ffffffff16426154e3565b90508015612e7b5760018301548354612e21916fffffffffffffffffffffffffffffffff80821692811691859170010000000000000000000000000000000090910416613528565b83546fffffffffffffffffffffffffffffffff919091167fffffffffffffffffffffffff0000000000000000000000000000000000000000909116177001000000000000000000000000000000004263ffffffff16021783555b60208201518354612ea1916fffffffffffffffffffffffffffffffff9081169116613aed565b83548351151574010000000000000000000000000000000000000000027fffffffffffffffffffffff00ffffffff000000000000000000000000000000009091166fffffffffffffffffffffffffffffffff92831617178455602083015160408085015183167001000000000000000000000000000000000291909216176001850155517f9ea3374b67bf275e6bb9c8ae68f9cae023e1c528b4b27e092f0bb209d3531c1990612f889084908151151581526020808301516fffffffffffffffffffffffffffffffff90811691830191909152604092830151169181019190915260600190565b60405180910390a1505050565b3373ffffffffffffffffffffffffffffffffffffffff821603613014576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c6600000000000000000060448201526064016107fc565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b60606000865167ffffffffffffffff8111156130a8576130a8614840565b6040519080825280602002602001820160405280156130ed57816020015b60408051808201909152600080825260208201528152602001906001900390816130c65790505b50905060005b87518110156133e45760006131248983815181106131135761311361558a565b602002602001015160000151611113565b9050600089838151811061313a5761313a61558a565b60200260200101516020015190506000806132af638627fad660e01b8c8c867f00000000000000000000000000000000000000000000000000000000000000008e8b8151811061318c5761318c61558a565b60200260200101518e8c815181106131a6576131a661558a565b60200260200101516040516020016131bf929190615c2e565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152908290526131fe9594939291602401615c53565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152600b54869063ffffffff7a010000000000000000000000000000000000000000000000000000909104166113886084613b03565b5091509150816132ed57806040517fe1cd55090000000000000000000000000000000000000000000000000000000081526004016107fc919061482d565b8373ffffffffffffffffffffffffffffffffffffffff166321df0da76040518163ffffffff1660e01b8152600401602060405180830381865afa158015613338573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061335c91906156aa565b86868151811061336e5761336e61558a565b60200260200101516000019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050828686815181106133bf576133bf61558a565b6020026020010151602001818152505050505050806133dd906155b9565b90506130f3565b50600b5461340990829073ffffffffffffffffffffffffffffffffffffffff16613c29565b90505b95945050505050565b600061342083613e11565b801561117557506111758383613e75565b6040805160a08101825260008082526020820152606091810182905281810182905260808101919091526040518060a001604052808461018001518152602001846000015167ffffffffffffffff16815260200184602001516040516020016134b6919073ffffffffffffffffffffffffffffffffffffffff91909116815260200190565b6040516020818303038152906040528152602001846101200151815260200183815250905092915050565b60006111758383613f44565b60006111758383613f50565b60006111758383613fda565b60006122b2848473ffffffffffffffffffffffffffffffffffffffff8516613ff7565b600061340c85613538848661554c565b61354290876156e4565b613aed565b60008080806123b58686614014565b60006107898261404e565b60008080806123b58686614059565b60008060001b8284602001518560400151866060015187608001518860a001518960c001518a60e001518b610100015160405160200161361398979695949392919073ffffffffffffffffffffffffffffffffffffffff9889168152968816602088015267ffffffffffffffff95861660408801526060870194909452911515608086015290921660a0840152921660c082015260e08101919091526101000190565b604051602081830303815290604052805190602001208561012001518051906020012086610140015160405160200161364c9190615cb6565b604051602081830303815290604052805190602001208761016001516040516020016136789190615d1e565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181528282528051602091820120908301979097528101949094526060840192909252608083015260a082015260c081019190915260e00160405160208183030381529060405280519060200120905092915050565b7f000000000000000000000000000000000000000000000000000000000000000067ffffffffffffffff168467ffffffffffffffff161461376f576040517f1279ec8a00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff851660048201526024016107fc565b600b5474010000000000000000000000000000000000000000900461ffff168311156137d3576040517f099d3f7200000000000000000000000000000000000000000000000000000000815267ffffffffffffffff861660048201526024016107fc565b808314613818576040517f8808f8e700000000000000000000000000000000000000000000000000000000815267ffffffffffffffff861660048201526024016107fc565b600b54760100000000000000000000000000000000000000000000900463ffffffff1682111561105757600b546040517f8693378900000000000000000000000000000000000000000000000000000000815276010000000000000000000000000000000000000000000090910463ffffffff166004820152602481018390526044016107fc565b600060026138af608085615525565b67ffffffffffffffff166138c3919061554c565b905060006013816138d5608087615563565b67ffffffffffffffff1681526020810191909152604001600020549050816138ff600160046154e3565b901b19168183600381111561391657613916614747565b901b178060136000613929608088615563565b67ffffffffffffffff16815260208101919091526040016000205550505050565b6040517ff52121a5000000000000000000000000000000000000000000000000000000008152600090606090309063f52121a59061398e9087908790600401615d31565b600060405180830381600087803b1580156139a857600080fd5b505af19250505080156139b9575060015b613ad2573d8080156139e7576040519150601f19603f3d011682016040523d82523d6000602084013e6139ec565b606091505b506139f681615ebb565b7fffffffff00000000000000000000000000000000000000000000000000000000167f0a8d6e8c000000000000000000000000000000000000000000000000000000001480613a8e5750613a4981615ebb565b7fffffffff00000000000000000000000000000000000000000000000000000000167fe1cd550900000000000000000000000000000000000000000000000000000000145b15613a9e57600392509050612394565b806040517fcf19edfd0000000000000000000000000000000000000000000000000000000081526004016107fc919061482d565b50506040805160208101909152600081526002909250929050565b6000818310613afc5781611175565b5090919050565b6000606060008361ffff1667ffffffffffffffff811115613b2657613b26614840565b6040519080825280601f01601f191660200182016040528015613b50576020820181803683370190505b509150863b613b83577f0c3b563c0000000000000000000000000000000000000000000000000000000060005260046000fd5b5a85811015613bb6577fafa32a2c0000000000000000000000000000000000000000000000000000000060005260046000fd5b8590036040810481038710613bef577f37c3be290000000000000000000000000000000000000000000000000000000060005260046000fd5b505a6000808a5160208c0160008c8cf193505a900390503d84811115613c125750835b808352806000602085013e50955095509592505050565b81516000805b82811015613dfd5760008473ffffffffffffffffffffffffffffffffffffffff1663d02641a0878481518110613c6757613c6761558a565b6020908102919091010151516040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b16815273ffffffffffffffffffffffffffffffffffffffff90911660048201526024016040805180830381865afa158015613cdb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613cff9190615f0b565b5190507bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8116600003613d9157858281518110613d3a57613d3a61558a565b6020908102919091010151516040517f9a655f7b00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff90911660048201526024016107fc565b613ddf868381518110613da657613da661558a565b602002602001015160200151827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1661408490919063ffffffff16565b613de990846156e4565b92505080613df6906155b9565b9050613c2f565b50613e0b60038260006140c1565b50505050565b6000613e3d827f01ffc9a700000000000000000000000000000000000000000000000000000000613e75565b80156107895750613e6e827fffffffff00000000000000000000000000000000000000000000000000000000613e75565b1592915050565b604080517fffffffff000000000000000000000000000000000000000000000000000000008316602480830191909152825180830390910181526044909101909152602080820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f01ffc9a700000000000000000000000000000000000000000000000000000000178152825160009392849283928392918391908a617530fa92503d91506000519050828015613f2d575060208210155b8015613f395750600081115b979650505050505050565b60006111758383614444565b600081815260028301602052604081205480151580613f745750613f748484613f44565b611175576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f456e756d657261626c654d61703a206e6f6e6578697374656e74206b6579000060448201526064016107fc565b60008181526002830160205260408120819055611175838361445c565b600082815260028401602052604081208290556122b28484614468565b6000818152600283016020526040812054819080614043576140368585613f44565b9250600091506123949050565b600192509050612394565b600061078982614474565b60008080614067858561447e565b600081815260029690960160205260409095205494959350505050565b6000670de0b6b3a76400006140b7837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff861661554c565b6111759190615f6b565b825474010000000000000000000000000000000000000000900460ff1615806140e8575081155b156140f257505050565b825460018401546fffffffffffffffffffffffffffffffff8083169291169060009061413890700100000000000000000000000000000000900463ffffffff16426154e3565b905080156141f8578183111561417a576040517f9725942a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60018601546141b49083908590849070010000000000000000000000000000000090046fffffffffffffffffffffffffffffffff16613528565b86547fffffffffffffffffffffffff00000000ffffffffffffffffffffffffffffffff167001000000000000000000000000000000004263ffffffff160217875592505b848210156142af5773ffffffffffffffffffffffffffffffffffffffff8416614257576040517ff94ebcd100000000000000000000000000000000000000000000000000000000815260048101839052602481018690526044016107fc565b6040517f1a76572a000000000000000000000000000000000000000000000000000000008152600481018390526024810186905273ffffffffffffffffffffffffffffffffffffffff851660448201526064016107fc565b848310156143c25760018681015470010000000000000000000000000000000090046fffffffffffffffffffffffffffffffff169060009082906142f390826154e3565b6142fd878a6154e3565b61430791906156e4565b6143119190615f6b565b905073ffffffffffffffffffffffffffffffffffffffff861661436a576040517f15279c0800000000000000000000000000000000000000000000000000000000815260048101829052602481018690526044016107fc565b6040517fd0c8d23a000000000000000000000000000000000000000000000000000000008152600481018290526024810186905273ffffffffffffffffffffffffffffffffffffffff871660448201526064016107fc565b6143cc85846154e3565b86547fffffffffffffffffffffffffffffffff00000000000000000000000000000000166fffffffffffffffffffffffffffffffff82161787556040518681529093507f1871cdf8010e63f2eb8384381a68dfa7416dc571a5517e66e88b2d2d0c0a690a9060200160405180910390a1505050505050565b60008181526001830160205260408120541515611175565b6000611175838361448a565b60006111758383614584565b6000610789825490565b600061117583836145d3565b600081815260018301602052604081205480156145735760006144ae6001836154e3565b85549091506000906144c2906001906154e3565b90508181146145275760008660000182815481106144e2576144e261558a565b90600052602060002001549050808760000184815481106145055761450561558a565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061453857614538615f7f565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610789565b6000915050610789565b5092915050565b60008181526001830160205260408120546145cb57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610789565b506000610789565b60008260000182815481106145ea576145ea61558a565b9060005260206000200154905092915050565b828054828255906000526020600020908101928215614677579160200282015b8281111561467757825182547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff90911617825560209092019160019091019061461d565b506112a09291505b808211156112a0576000815560010161467f565b60c08101610789828473ffffffffffffffffffffffffffffffffffffffff808251168352602082015167ffffffffffffffff808216602086015280604085015116604086015250508060608301511660608401528060808301511660808401528060a08301511660a0840152505050565b67ffffffffffffffff81168114611ac757600080fd5b803561472581614704565b919050565b60006020828403121561473c57600080fd5b813561117581614704565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b600481106147ad577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b9052565b602081016107898284614776565b60005b838110156147da5781810151838201526020016147c2565b50506000910152565b600081518084526147fb8160208601602086016147bf565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b60208152600061117560208301846147e3565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040805190810167ffffffffffffffff8111828210171561489257614892614840565b60405290565b6040516101a0810167ffffffffffffffff8111828210171561489257614892614840565b6040516080810167ffffffffffffffff8111828210171561489257614892614840565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff8111828210171561492657614926614840565b604052919050565b600067ffffffffffffffff82111561494857614948614840565b5060051b60200190565b73ffffffffffffffffffffffffffffffffffffffff81168114611ac757600080fd5b803561472581614952565b600082601f83011261499057600080fd5b813560206149a56149a08361492e565b6148df565b82815260059290921b840181019181810190868411156149c457600080fd5b8286015b848110156149e85780356149db81614952565b83529183019183016149c8565b509695505050505050565b803560ff8116811461472557600080fd5b600067ffffffffffffffff821115614a1e57614a1e614840565b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b600082601f830112614a5b57600080fd5b8135614a696149a082614a04565b818152846020838601011115614a7e57600080fd5b816020850160208301376000918101602001919091529392505050565b60008060008060008060c08789031215614ab457600080fd5b863567ffffffffffffffff80821115614acc57600080fd5b614ad88a838b0161497f565b97506020890135915080821115614aee57600080fd5b614afa8a838b0161497f565b9650614b0860408a016149f3565b95506060890135915080821115614b1e57600080fd5b614b2a8a838b01614a4a565b9450614b3860808a0161471a565b935060a0890135915080821115614b4e57600080fd5b50614b5b89828a01614a4a565b9150509295509295509295565b60008083601f840112614b7a57600080fd5b50813567ffffffffffffffff811115614b9257600080fd5b6020830191508360208260061b850101111561239457600080fd5b60008060008060408587031215614bc357600080fd5b843567ffffffffffffffff80821115614bdb57600080fd5b614be788838901614b68565b90965094506020870135915080821115614c0057600080fd5b50614c0d87828801614b68565b95989497509550505050565b600060208284031215614c2b57600080fd5b813561117581614952565b600081518084526020808501945080840160005b83811015614c7c57815173ffffffffffffffffffffffffffffffffffffffff1687529582019590820190600101614c4a565b509495945050505050565b6020815260006111756020830184614c36565b6020808252825182820181905260009190848201906040850190845b81811015614ce857835173ffffffffffffffffffffffffffffffffffffffff1683529284019291840191600101614cb6565b50909695505050505050565b8015158114611ac757600080fd5b803561472581614cf4565b600082601f830112614d1e57600080fd5b81356020614d2e6149a08361492e565b82815260069290921b84018101918181019086841115614d4d57600080fd5b8286015b848110156149e85760408189031215614d6a5760008081fd5b614d7261486f565b8135614d7d81614952565b81528185013585820152835291830191604001614d51565b600082601f830112614da657600080fd5b81356020614db66149a08361492e565b82815260059290921b84018101918181019086841115614dd557600080fd5b8286015b848110156149e857803567ffffffffffffffff811115614df95760008081fd5b614e078986838b0101614a4a565b845250918301918301614dd9565b60006101a08284031215614e2857600080fd5b614e30614898565b9050614e3b8261471a565b8152614e4960208301614974565b6020820152614e5a60408301614974565b6040820152614e6b6060830161471a565b606082015260808201356080820152614e8660a08301614d02565b60a0820152614e9760c0830161471a565b60c0820152614ea860e08301614974565b60e082015261010082810135908201526101208083013567ffffffffffffffff80821115614ed557600080fd5b614ee186838701614a4a565b83850152610140925082850135915080821115614efd57600080fd5b614f0986838701614d0d565b83850152610160925082850135915080821115614f2557600080fd5b50614f3285828601614d95565b82840152505061018080830135818301525092915050565b600082601f830112614f5b57600080fd5b81356020614f6b6149a08361492e565b82815260059290921b84018101918181019086841115614f8a57600080fd5b8286015b848110156149e857803567ffffffffffffffff811115614fae5760008081fd5b614fbc8986838b0101614d95565b845250918301918301614f8e565b600082601f830112614fdb57600080fd5b81356020614feb6149a08361492e565b82815260059290921b8401810191818101908684111561500a57600080fd5b8286015b848110156149e8578035835291830191830161500e565b60006080828403121561503757600080fd5b61503f6148bc565b9050813567ffffffffffffffff8082111561505957600080fd5b818401915084601f83011261506d57600080fd5b8135602061507d6149a08361492e565b82815260059290921b8401810191818101908884111561509c57600080fd5b8286015b848110156150d4578035868111156150b85760008081fd5b6150c68b86838b0101614e15565b8452509183019183016150a0565b50865250858101359350828411156150eb57600080fd5b6150f787858801614f4a565b9085015250604084013591508082111561511057600080fd5b5061511d84828501614fca565b6040830152506060820135606082015292915050565b6000806040838503121561514657600080fd5b823567ffffffffffffffff8082111561515e57600080fd5b61516a86838701615025565b935060209150818501358181111561518157600080fd5b85019050601f8101861361519457600080fd5b80356151a26149a08261492e565b81815260059190911b820183019083810190888311156151c157600080fd5b928401925b828410156151df578335825292840192908401906151c6565b80955050505050509250929050565b60c08101610789828463ffffffff808251168352602082015173ffffffffffffffffffffffffffffffffffffffff8082166020860152806040850151166040860152505061ffff60608301511660608401528060808301511660808401528060a08301511660a0840152505050565b60006020828403121561526f57600080fd5b813567ffffffffffffffff81111561528657600080fd5b820160a0818503121561117557600080fd5b60008083601f8401126152aa57600080fd5b50813567ffffffffffffffff8111156152c257600080fd5b6020830191508360208260051b850101111561239457600080fd5b60008060008060008060008060e0898b0312156152f957600080fd5b606089018a81111561530a57600080fd5b8998503567ffffffffffffffff8082111561532457600080fd5b818b0191508b601f83011261533857600080fd5b81358181111561534757600080fd5b8c602082850101111561535957600080fd5b6020830199508098505060808b013591508082111561537757600080fd5b6153838c838d01615298565b909750955060a08b013591508082111561539c57600080fd5b506153a98b828c01615298565b999c989b50969995989497949560c00135949350505050565b80356fffffffffffffffffffffffffffffffff8116811461472557600080fd5b6000606082840312156153f457600080fd5b6040516060810181811067ffffffffffffffff8211171561541757615417614840565b604052823561542581614cf4565b8152615433602084016153c2565b6020820152615444604084016153c2565b60408201529392505050565b6000806040838503121561546357600080fd5b823567ffffffffffffffff8082111561547b57600080fd5b61548786838701614e15565b9350602085013591508082111561549d57600080fd5b506154aa85828601614d95565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b81810381811115610789576107896154b4565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600067ffffffffffffffff80841680615540576155406154f6565b92169190910692915050565b8082028115828204841417610789576107896154b4565b600067ffffffffffffffff8084168061557e5761557e6154f6565b92169190910492915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036155ea576155ea6154b4565b5060010190565b600063ffffffff80831681810361560a5761560a6154b4565b6001019392505050565b600061012063ffffffff808d1684528b6020850152808b166040850152508060608401526156448184018a614c36565b905082810360808401526156588189614c36565b905060ff871660a084015282810360c084015261567581876147e3565b905067ffffffffffffffff851660e084015282810361010084015261569a81856147e3565b9c9b505050505050505050505050565b6000602082840312156156bc57600080fd5b815161117581614952565b6000602082840312156156d957600080fd5b815161117581614704565b80820180821115610789576107896154b4565b600081518084526020808501945080840160005b83811015614c7c578151805173ffffffffffffffffffffffffffffffffffffffff168852830151838801526040909601959082019060010161570b565b608081528451608082015267ffffffffffffffff60208601511660a08201526000604086015160a060c08401526157836101208401826147e3565b905060608701517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff80808584030160e08601526157bf83836147e3565b9250608089015191508085840301610100860152506157de82826156f7565b925050506157f2602083018661ffff169052565b83604083015261340c606083018473ffffffffffffffffffffffffffffffffffffffff169052565b60008060006060848603121561582f57600080fd5b835161583a81614cf4565b602085015190935067ffffffffffffffff81111561585757600080fd5b8401601f8101861361586857600080fd5b80516158766149a082614a04565b81815287602083850101111561588b57600080fd5b61589c8260208301602086016147bf565b809450505050604084015190509250925092565b805163ffffffff8116811461472557600080fd5b600060c082840312156158d657600080fd5b60405160c0810181811067ffffffffffffffff821117156158f9576158f9614840565b604052615905836158b0565b8152602083015161591581614952565b6020820152604083015161592881614952565b6040820152606083015161ffff8116811461594257600080fd5b6060820152615953608084016158b0565b608082015261596460a084016158b0565b60a08201529392505050565b61018081016159e2828573ffffffffffffffffffffffffffffffffffffffff808251168352602082015167ffffffffffffffff808216602086015280604085015116604086015250508060608301511660608401528060808301511660808401528060a08301511660a0840152505050565b825163ffffffff90811660c0840152602084015173ffffffffffffffffffffffffffffffffffffffff90811660e0850152604085015116610100840152606084015161ffff166101208401526080840151811661014084015260a084015116610160830152611175565b60006101208b835273ffffffffffffffffffffffffffffffffffffffff8b16602084015267ffffffffffffffff808b166040850152816060850152615a938285018b614c36565b91508382036080850152615aa7828a614c36565b915060ff881660a085015283820360c0850152615ac482886147e3565b90861660e0850152838103610100850152905061569a81856147e3565b600060208284031215615af357600080fd5b815161117581614cf4565b600081518084526020808501945080840160005b83811015614c7c57815187529582019590820190600101615b12565b606081526000615b416060830186615afe565b8281036020840152615b538186615afe565b915050826040830152949350505050565b600060208284031215615b7657600080fd5b5051919050565b67ffffffffffffffff81811683821601908082111561457d5761457d6154b4565b67ffffffffffffffff83168152604081016111756020830184614776565b600067ffffffffffffffff80831681810361560a5761560a6154b4565b615be38184614776565b6040602082015260006122b260408301846147e3565b600060208284031215615c0b57600080fd5b813567ffffffffffffffff811115615c2257600080fd5b6122b284828501615025565b604081526000615c4160408301856147e3565b828103602084015261340c81856147e3565b60a081526000615c6660a08301886147e3565b73ffffffffffffffffffffffffffffffffffffffff8716602084015285604084015267ffffffffffffffff851660608401528281036080840152615caa81856147e3565b98975050505050505050565b60208152600061117560208301846156f7565b600081518084526020808501808196508360051b8101915082860160005b85811015615d11578284038952615cff8483516147e3565b98850198935090840190600101615ce7565b5091979650505050505050565b6020815260006111756020830184615cc9565b60408152615d4c60408201845167ffffffffffffffff169052565b60006020840151615d75606084018273ffffffffffffffffffffffffffffffffffffffff169052565b50604084015173ffffffffffffffffffffffffffffffffffffffff8116608084015250606084015167ffffffffffffffff811660a084015250608084015160c083015260a084015180151560e08401525060c0840151610100615de38185018367ffffffffffffffff169052565b60e08601519150610120615e0e8186018473ffffffffffffffffffffffffffffffffffffffff169052565b81870151925061014091508282860152808701519250506101a06101608181870152615e3e6101e08701856147e3565b93508288015192507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0610180818887030181890152615e7d86866156f7565b9550828a01519450818887030184890152615e988686615cc9565b9550808a01516101c08901525050505050828103602084015261340c8185615cc9565b6000815160208301517fffffffff0000000000000000000000000000000000000000000000000000000080821693506004831015615f035780818460040360031b1b83161693505b505050919050565b600060408284031215615f1d57600080fd5b615f2561486f565b82517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff81168114615f5157600080fd5b8152615f5f602084016158b0565b60208201529392505050565b600082615f7a57615f7a6154f6565b500490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fdfea164736f6c6343000813000a", +} + +var EVM2EVMOffRampABI = EVM2EVMOffRampMetaData.ABI + +var EVM2EVMOffRampBin = EVM2EVMOffRampMetaData.Bin + +func DeployEVM2EVMOffRamp(auth *bind.TransactOpts, backend bind.ContractBackend, staticConfig EVM2EVMOffRampStaticConfig, sourceTokens []common.Address, pools []common.Address, rateLimiterConfig RateLimiterConfig) (common.Address, *types.Transaction, *EVM2EVMOffRamp, error) { + parsed, err := EVM2EVMOffRampMetaData.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(EVM2EVMOffRampBin), backend, staticConfig, sourceTokens, pools, rateLimiterConfig) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &EVM2EVMOffRamp{EVM2EVMOffRampCaller: EVM2EVMOffRampCaller{contract: contract}, EVM2EVMOffRampTransactor: EVM2EVMOffRampTransactor{contract: contract}, EVM2EVMOffRampFilterer: EVM2EVMOffRampFilterer{contract: contract}}, nil +} + +type EVM2EVMOffRamp struct { + address common.Address + abi abi.ABI + EVM2EVMOffRampCaller + EVM2EVMOffRampTransactor + EVM2EVMOffRampFilterer +} + +type EVM2EVMOffRampCaller struct { + contract *bind.BoundContract +} + +type EVM2EVMOffRampTransactor struct { + contract *bind.BoundContract +} + +type EVM2EVMOffRampFilterer struct { + contract *bind.BoundContract +} + +type EVM2EVMOffRampSession struct { + Contract *EVM2EVMOffRamp + CallOpts bind.CallOpts + TransactOpts bind.TransactOpts +} + +type EVM2EVMOffRampCallerSession struct { + Contract *EVM2EVMOffRampCaller + CallOpts bind.CallOpts +} + +type EVM2EVMOffRampTransactorSession struct { + Contract *EVM2EVMOffRampTransactor + TransactOpts bind.TransactOpts +} + +type EVM2EVMOffRampRaw struct { + Contract *EVM2EVMOffRamp +} + +type EVM2EVMOffRampCallerRaw struct { + Contract *EVM2EVMOffRampCaller +} + +type EVM2EVMOffRampTransactorRaw struct { + Contract *EVM2EVMOffRampTransactor +} + +func NewEVM2EVMOffRamp(address common.Address, backend bind.ContractBackend) (*EVM2EVMOffRamp, error) { + abi, err := abi.JSON(strings.NewReader(EVM2EVMOffRampABI)) + if err != nil { + return nil, err + } + contract, err := bindEVM2EVMOffRamp(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &EVM2EVMOffRamp{address: address, abi: abi, EVM2EVMOffRampCaller: EVM2EVMOffRampCaller{contract: contract}, EVM2EVMOffRampTransactor: EVM2EVMOffRampTransactor{contract: contract}, EVM2EVMOffRampFilterer: EVM2EVMOffRampFilterer{contract: contract}}, nil +} + +func NewEVM2EVMOffRampCaller(address common.Address, caller bind.ContractCaller) (*EVM2EVMOffRampCaller, error) { + contract, err := bindEVM2EVMOffRamp(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &EVM2EVMOffRampCaller{contract: contract}, nil +} + +func NewEVM2EVMOffRampTransactor(address common.Address, transactor bind.ContractTransactor) (*EVM2EVMOffRampTransactor, error) { + contract, err := bindEVM2EVMOffRamp(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &EVM2EVMOffRampTransactor{contract: contract}, nil +} + +func NewEVM2EVMOffRampFilterer(address common.Address, filterer bind.ContractFilterer) (*EVM2EVMOffRampFilterer, error) { + contract, err := bindEVM2EVMOffRamp(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &EVM2EVMOffRampFilterer{contract: contract}, nil +} + +func bindEVM2EVMOffRamp(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := EVM2EVMOffRampMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _EVM2EVMOffRamp.Contract.EVM2EVMOffRampCaller.contract.Call(opts, result, method, params...) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _EVM2EVMOffRamp.Contract.EVM2EVMOffRampTransactor.contract.Transfer(opts) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _EVM2EVMOffRamp.Contract.EVM2EVMOffRampTransactor.contract.Transact(opts, method, params...) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _EVM2EVMOffRamp.Contract.contract.Call(opts, result, method, params...) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _EVM2EVMOffRamp.Contract.contract.Transfer(opts) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _EVM2EVMOffRamp.Contract.contract.Transact(opts, method, params...) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampCaller) CcipReceive(opts *bind.CallOpts, arg0 ClientAny2EVMMessage) error { + var out []interface{} + err := _EVM2EVMOffRamp.contract.Call(opts, &out, "ccipReceive", arg0) + + if err != nil { + return err + } + + return err + +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampSession) CcipReceive(arg0 ClientAny2EVMMessage) error { + return _EVM2EVMOffRamp.Contract.CcipReceive(&_EVM2EVMOffRamp.CallOpts, arg0) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampCallerSession) CcipReceive(arg0 ClientAny2EVMMessage) error { + return _EVM2EVMOffRamp.Contract.CcipReceive(&_EVM2EVMOffRamp.CallOpts, arg0) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampCaller) CurrentRateLimiterState(opts *bind.CallOpts) (RateLimiterTokenBucket, error) { + var out []interface{} + err := _EVM2EVMOffRamp.contract.Call(opts, &out, "currentRateLimiterState") + + if err != nil { + return *new(RateLimiterTokenBucket), err + } + + out0 := *abi.ConvertType(out[0], new(RateLimiterTokenBucket)).(*RateLimiterTokenBucket) + + return out0, err + +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampSession) CurrentRateLimiterState() (RateLimiterTokenBucket, error) { + return _EVM2EVMOffRamp.Contract.CurrentRateLimiterState(&_EVM2EVMOffRamp.CallOpts) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampCallerSession) CurrentRateLimiterState() (RateLimiterTokenBucket, error) { + return _EVM2EVMOffRamp.Contract.CurrentRateLimiterState(&_EVM2EVMOffRamp.CallOpts) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampCaller) GetDestinationToken(opts *bind.CallOpts, sourceToken common.Address) (common.Address, error) { + var out []interface{} + err := _EVM2EVMOffRamp.contract.Call(opts, &out, "getDestinationToken", sourceToken) + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampSession) GetDestinationToken(sourceToken common.Address) (common.Address, error) { + return _EVM2EVMOffRamp.Contract.GetDestinationToken(&_EVM2EVMOffRamp.CallOpts, sourceToken) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampCallerSession) GetDestinationToken(sourceToken common.Address) (common.Address, error) { + return _EVM2EVMOffRamp.Contract.GetDestinationToken(&_EVM2EVMOffRamp.CallOpts, sourceToken) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampCaller) GetDestinationTokens(opts *bind.CallOpts) ([]common.Address, error) { + var out []interface{} + err := _EVM2EVMOffRamp.contract.Call(opts, &out, "getDestinationTokens") + + if err != nil { + return *new([]common.Address), err + } + + out0 := *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) + + return out0, err + +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampSession) GetDestinationTokens() ([]common.Address, error) { + return _EVM2EVMOffRamp.Contract.GetDestinationTokens(&_EVM2EVMOffRamp.CallOpts) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampCallerSession) GetDestinationTokens() ([]common.Address, error) { + return _EVM2EVMOffRamp.Contract.GetDestinationTokens(&_EVM2EVMOffRamp.CallOpts) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampCaller) GetDynamicConfig(opts *bind.CallOpts) (EVM2EVMOffRampDynamicConfig, error) { + var out []interface{} + err := _EVM2EVMOffRamp.contract.Call(opts, &out, "getDynamicConfig") + + if err != nil { + return *new(EVM2EVMOffRampDynamicConfig), err + } + + out0 := *abi.ConvertType(out[0], new(EVM2EVMOffRampDynamicConfig)).(*EVM2EVMOffRampDynamicConfig) + + return out0, err + +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampSession) GetDynamicConfig() (EVM2EVMOffRampDynamicConfig, error) { + return _EVM2EVMOffRamp.Contract.GetDynamicConfig(&_EVM2EVMOffRamp.CallOpts) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampCallerSession) GetDynamicConfig() (EVM2EVMOffRampDynamicConfig, error) { + return _EVM2EVMOffRamp.Contract.GetDynamicConfig(&_EVM2EVMOffRamp.CallOpts) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampCaller) GetExecutionState(opts *bind.CallOpts, sequenceNumber uint64) (uint8, error) { + var out []interface{} + err := _EVM2EVMOffRamp.contract.Call(opts, &out, "getExecutionState", sequenceNumber) + + if err != nil { + return *new(uint8), err + } + + out0 := *abi.ConvertType(out[0], new(uint8)).(*uint8) + + return out0, err + +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampSession) GetExecutionState(sequenceNumber uint64) (uint8, error) { + return _EVM2EVMOffRamp.Contract.GetExecutionState(&_EVM2EVMOffRamp.CallOpts, sequenceNumber) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampCallerSession) GetExecutionState(sequenceNumber uint64) (uint8, error) { + return _EVM2EVMOffRamp.Contract.GetExecutionState(&_EVM2EVMOffRamp.CallOpts, sequenceNumber) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampCaller) GetPoolByDestToken(opts *bind.CallOpts, destToken common.Address) (common.Address, error) { + var out []interface{} + err := _EVM2EVMOffRamp.contract.Call(opts, &out, "getPoolByDestToken", destToken) + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampSession) GetPoolByDestToken(destToken common.Address) (common.Address, error) { + return _EVM2EVMOffRamp.Contract.GetPoolByDestToken(&_EVM2EVMOffRamp.CallOpts, destToken) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampCallerSession) GetPoolByDestToken(destToken common.Address) (common.Address, error) { + return _EVM2EVMOffRamp.Contract.GetPoolByDestToken(&_EVM2EVMOffRamp.CallOpts, destToken) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampCaller) GetPoolBySourceToken(opts *bind.CallOpts, sourceToken common.Address) (common.Address, error) { + var out []interface{} + err := _EVM2EVMOffRamp.contract.Call(opts, &out, "getPoolBySourceToken", sourceToken) + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampSession) GetPoolBySourceToken(sourceToken common.Address) (common.Address, error) { + return _EVM2EVMOffRamp.Contract.GetPoolBySourceToken(&_EVM2EVMOffRamp.CallOpts, sourceToken) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampCallerSession) GetPoolBySourceToken(sourceToken common.Address) (common.Address, error) { + return _EVM2EVMOffRamp.Contract.GetPoolBySourceToken(&_EVM2EVMOffRamp.CallOpts, sourceToken) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampCaller) GetSenderNonce(opts *bind.CallOpts, sender common.Address) (uint64, error) { + var out []interface{} + err := _EVM2EVMOffRamp.contract.Call(opts, &out, "getSenderNonce", sender) + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampSession) GetSenderNonce(sender common.Address) (uint64, error) { + return _EVM2EVMOffRamp.Contract.GetSenderNonce(&_EVM2EVMOffRamp.CallOpts, sender) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampCallerSession) GetSenderNonce(sender common.Address) (uint64, error) { + return _EVM2EVMOffRamp.Contract.GetSenderNonce(&_EVM2EVMOffRamp.CallOpts, sender) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampCaller) GetStaticConfig(opts *bind.CallOpts) (EVM2EVMOffRampStaticConfig, error) { + var out []interface{} + err := _EVM2EVMOffRamp.contract.Call(opts, &out, "getStaticConfig") + + if err != nil { + return *new(EVM2EVMOffRampStaticConfig), err + } + + out0 := *abi.ConvertType(out[0], new(EVM2EVMOffRampStaticConfig)).(*EVM2EVMOffRampStaticConfig) + + return out0, err + +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampSession) GetStaticConfig() (EVM2EVMOffRampStaticConfig, error) { + return _EVM2EVMOffRamp.Contract.GetStaticConfig(&_EVM2EVMOffRamp.CallOpts) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampCallerSession) GetStaticConfig() (EVM2EVMOffRampStaticConfig, error) { + return _EVM2EVMOffRamp.Contract.GetStaticConfig(&_EVM2EVMOffRamp.CallOpts) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampCaller) GetSupportedTokens(opts *bind.CallOpts) ([]common.Address, error) { + var out []interface{} + err := _EVM2EVMOffRamp.contract.Call(opts, &out, "getSupportedTokens") + + if err != nil { + return *new([]common.Address), err + } + + out0 := *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) + + return out0, err + +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampSession) GetSupportedTokens() ([]common.Address, error) { + return _EVM2EVMOffRamp.Contract.GetSupportedTokens(&_EVM2EVMOffRamp.CallOpts) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampCallerSession) GetSupportedTokens() ([]common.Address, error) { + return _EVM2EVMOffRamp.Contract.GetSupportedTokens(&_EVM2EVMOffRamp.CallOpts) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampCaller) GetTokenLimitAdmin(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _EVM2EVMOffRamp.contract.Call(opts, &out, "getTokenLimitAdmin") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampSession) GetTokenLimitAdmin() (common.Address, error) { + return _EVM2EVMOffRamp.Contract.GetTokenLimitAdmin(&_EVM2EVMOffRamp.CallOpts) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampCallerSession) GetTokenLimitAdmin() (common.Address, error) { + return _EVM2EVMOffRamp.Contract.GetTokenLimitAdmin(&_EVM2EVMOffRamp.CallOpts) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampCaller) GetTransmitters(opts *bind.CallOpts) ([]common.Address, error) { + var out []interface{} + err := _EVM2EVMOffRamp.contract.Call(opts, &out, "getTransmitters") + + if err != nil { + return *new([]common.Address), err + } + + out0 := *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) + + return out0, err + +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampSession) GetTransmitters() ([]common.Address, error) { + return _EVM2EVMOffRamp.Contract.GetTransmitters(&_EVM2EVMOffRamp.CallOpts) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampCallerSession) GetTransmitters() ([]common.Address, error) { + return _EVM2EVMOffRamp.Contract.GetTransmitters(&_EVM2EVMOffRamp.CallOpts) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampCaller) LatestConfigDetails(opts *bind.CallOpts) (LatestConfigDetails, + + error) { + var out []interface{} + err := _EVM2EVMOffRamp.contract.Call(opts, &out, "latestConfigDetails") + + outstruct := new(LatestConfigDetails) + if err != nil { + return *outstruct, err + } + + outstruct.ConfigCount = *abi.ConvertType(out[0], new(uint32)).(*uint32) + outstruct.BlockNumber = *abi.ConvertType(out[1], new(uint32)).(*uint32) + outstruct.ConfigDigest = *abi.ConvertType(out[2], new([32]byte)).(*[32]byte) + + return *outstruct, err + +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampSession) LatestConfigDetails() (LatestConfigDetails, + + error) { + return _EVM2EVMOffRamp.Contract.LatestConfigDetails(&_EVM2EVMOffRamp.CallOpts) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampCallerSession) LatestConfigDetails() (LatestConfigDetails, + + error) { + return _EVM2EVMOffRamp.Contract.LatestConfigDetails(&_EVM2EVMOffRamp.CallOpts) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampCaller) LatestConfigDigestAndEpoch(opts *bind.CallOpts) (LatestConfigDigestAndEpoch, + + error) { + var out []interface{} + err := _EVM2EVMOffRamp.contract.Call(opts, &out, "latestConfigDigestAndEpoch") + + outstruct := new(LatestConfigDigestAndEpoch) + if err != nil { + return *outstruct, err + } + + outstruct.ScanLogs = *abi.ConvertType(out[0], new(bool)).(*bool) + outstruct.ConfigDigest = *abi.ConvertType(out[1], new([32]byte)).(*[32]byte) + outstruct.Epoch = *abi.ConvertType(out[2], new(uint32)).(*uint32) + + return *outstruct, err + +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampSession) LatestConfigDigestAndEpoch() (LatestConfigDigestAndEpoch, + + error) { + return _EVM2EVMOffRamp.Contract.LatestConfigDigestAndEpoch(&_EVM2EVMOffRamp.CallOpts) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampCallerSession) LatestConfigDigestAndEpoch() (LatestConfigDigestAndEpoch, + + error) { + return _EVM2EVMOffRamp.Contract.LatestConfigDigestAndEpoch(&_EVM2EVMOffRamp.CallOpts) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampCaller) Owner(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _EVM2EVMOffRamp.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 + +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampSession) Owner() (common.Address, error) { + return _EVM2EVMOffRamp.Contract.Owner(&_EVM2EVMOffRamp.CallOpts) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampCallerSession) Owner() (common.Address, error) { + return _EVM2EVMOffRamp.Contract.Owner(&_EVM2EVMOffRamp.CallOpts) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampCaller) TypeAndVersion(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _EVM2EVMOffRamp.contract.Call(opts, &out, "typeAndVersion") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampSession) TypeAndVersion() (string, error) { + return _EVM2EVMOffRamp.Contract.TypeAndVersion(&_EVM2EVMOffRamp.CallOpts) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampCallerSession) TypeAndVersion() (string, error) { + return _EVM2EVMOffRamp.Contract.TypeAndVersion(&_EVM2EVMOffRamp.CallOpts) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampTransactor) AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + return _EVM2EVMOffRamp.contract.Transact(opts, "acceptOwnership") +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampSession) AcceptOwnership() (*types.Transaction, error) { + return _EVM2EVMOffRamp.Contract.AcceptOwnership(&_EVM2EVMOffRamp.TransactOpts) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampTransactorSession) AcceptOwnership() (*types.Transaction, error) { + return _EVM2EVMOffRamp.Contract.AcceptOwnership(&_EVM2EVMOffRamp.TransactOpts) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampTransactor) ApplyPoolUpdates(opts *bind.TransactOpts, removes []InternalPoolUpdate, adds []InternalPoolUpdate) (*types.Transaction, error) { + return _EVM2EVMOffRamp.contract.Transact(opts, "applyPoolUpdates", removes, adds) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampSession) ApplyPoolUpdates(removes []InternalPoolUpdate, adds []InternalPoolUpdate) (*types.Transaction, error) { + return _EVM2EVMOffRamp.Contract.ApplyPoolUpdates(&_EVM2EVMOffRamp.TransactOpts, removes, adds) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampTransactorSession) ApplyPoolUpdates(removes []InternalPoolUpdate, adds []InternalPoolUpdate) (*types.Transaction, error) { + return _EVM2EVMOffRamp.Contract.ApplyPoolUpdates(&_EVM2EVMOffRamp.TransactOpts, removes, adds) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampTransactor) ExecuteSingleMessage(opts *bind.TransactOpts, message InternalEVM2EVMMessage, offchainTokenData [][]byte) (*types.Transaction, error) { + return _EVM2EVMOffRamp.contract.Transact(opts, "executeSingleMessage", message, offchainTokenData) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampSession) ExecuteSingleMessage(message InternalEVM2EVMMessage, offchainTokenData [][]byte) (*types.Transaction, error) { + return _EVM2EVMOffRamp.Contract.ExecuteSingleMessage(&_EVM2EVMOffRamp.TransactOpts, message, offchainTokenData) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampTransactorSession) ExecuteSingleMessage(message InternalEVM2EVMMessage, offchainTokenData [][]byte) (*types.Transaction, error) { + return _EVM2EVMOffRamp.Contract.ExecuteSingleMessage(&_EVM2EVMOffRamp.TransactOpts, message, offchainTokenData) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampTransactor) ManuallyExecute(opts *bind.TransactOpts, report InternalExecutionReport, gasLimitOverrides []*big.Int) (*types.Transaction, error) { + return _EVM2EVMOffRamp.contract.Transact(opts, "manuallyExecute", report, gasLimitOverrides) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampSession) ManuallyExecute(report InternalExecutionReport, gasLimitOverrides []*big.Int) (*types.Transaction, error) { + return _EVM2EVMOffRamp.Contract.ManuallyExecute(&_EVM2EVMOffRamp.TransactOpts, report, gasLimitOverrides) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampTransactorSession) ManuallyExecute(report InternalExecutionReport, gasLimitOverrides []*big.Int) (*types.Transaction, error) { + return _EVM2EVMOffRamp.Contract.ManuallyExecute(&_EVM2EVMOffRamp.TransactOpts, report, gasLimitOverrides) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampTransactor) SetAdmin(opts *bind.TransactOpts, newAdmin common.Address) (*types.Transaction, error) { + return _EVM2EVMOffRamp.contract.Transact(opts, "setAdmin", newAdmin) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampSession) SetAdmin(newAdmin common.Address) (*types.Transaction, error) { + return _EVM2EVMOffRamp.Contract.SetAdmin(&_EVM2EVMOffRamp.TransactOpts, newAdmin) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampTransactorSession) SetAdmin(newAdmin common.Address) (*types.Transaction, error) { + return _EVM2EVMOffRamp.Contract.SetAdmin(&_EVM2EVMOffRamp.TransactOpts, newAdmin) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampTransactor) SetOCR2Config(opts *bind.TransactOpts, signers []common.Address, transmitters []common.Address, f uint8, onchainConfig []byte, offchainConfigVersion uint64, offchainConfig []byte) (*types.Transaction, error) { + return _EVM2EVMOffRamp.contract.Transact(opts, "setOCR2Config", signers, transmitters, f, onchainConfig, offchainConfigVersion, offchainConfig) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampSession) SetOCR2Config(signers []common.Address, transmitters []common.Address, f uint8, onchainConfig []byte, offchainConfigVersion uint64, offchainConfig []byte) (*types.Transaction, error) { + return _EVM2EVMOffRamp.Contract.SetOCR2Config(&_EVM2EVMOffRamp.TransactOpts, signers, transmitters, f, onchainConfig, offchainConfigVersion, offchainConfig) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampTransactorSession) SetOCR2Config(signers []common.Address, transmitters []common.Address, f uint8, onchainConfig []byte, offchainConfigVersion uint64, offchainConfig []byte) (*types.Transaction, error) { + return _EVM2EVMOffRamp.Contract.SetOCR2Config(&_EVM2EVMOffRamp.TransactOpts, signers, transmitters, f, onchainConfig, offchainConfigVersion, offchainConfig) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampTransactor) SetRateLimiterConfig(opts *bind.TransactOpts, config RateLimiterConfig) (*types.Transaction, error) { + return _EVM2EVMOffRamp.contract.Transact(opts, "setRateLimiterConfig", config) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampSession) SetRateLimiterConfig(config RateLimiterConfig) (*types.Transaction, error) { + return _EVM2EVMOffRamp.Contract.SetRateLimiterConfig(&_EVM2EVMOffRamp.TransactOpts, config) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampTransactorSession) SetRateLimiterConfig(config RateLimiterConfig) (*types.Transaction, error) { + return _EVM2EVMOffRamp.Contract.SetRateLimiterConfig(&_EVM2EVMOffRamp.TransactOpts, config) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampTransactor) TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) { + return _EVM2EVMOffRamp.contract.Transact(opts, "transferOwnership", to) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampSession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _EVM2EVMOffRamp.Contract.TransferOwnership(&_EVM2EVMOffRamp.TransactOpts, to) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampTransactorSession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _EVM2EVMOffRamp.Contract.TransferOwnership(&_EVM2EVMOffRamp.TransactOpts, to) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampTransactor) Transmit(opts *bind.TransactOpts, reportContext [3][32]byte, report []byte, rs [][32]byte, ss [][32]byte, arg4 [32]byte) (*types.Transaction, error) { + return _EVM2EVMOffRamp.contract.Transact(opts, "transmit", reportContext, report, rs, ss, arg4) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampSession) Transmit(reportContext [3][32]byte, report []byte, rs [][32]byte, ss [][32]byte, arg4 [32]byte) (*types.Transaction, error) { + return _EVM2EVMOffRamp.Contract.Transmit(&_EVM2EVMOffRamp.TransactOpts, reportContext, report, rs, ss, arg4) +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampTransactorSession) Transmit(reportContext [3][32]byte, report []byte, rs [][32]byte, ss [][32]byte, arg4 [32]byte) (*types.Transaction, error) { + return _EVM2EVMOffRamp.Contract.Transmit(&_EVM2EVMOffRamp.TransactOpts, reportContext, report, rs, ss, arg4) +} + +type EVM2EVMOffRampAdminSetIterator struct { + Event *EVM2EVMOffRampAdminSet + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *EVM2EVMOffRampAdminSetIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOffRampAdminSet) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOffRampAdminSet) + 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() + } +} + +func (it *EVM2EVMOffRampAdminSetIterator) Error() error { + return it.fail +} + +func (it *EVM2EVMOffRampAdminSetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type EVM2EVMOffRampAdminSet struct { + NewAdmin common.Address + Raw types.Log +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) FilterAdminSet(opts *bind.FilterOpts) (*EVM2EVMOffRampAdminSetIterator, error) { + + logs, sub, err := _EVM2EVMOffRamp.contract.FilterLogs(opts, "AdminSet") + if err != nil { + return nil, err + } + return &EVM2EVMOffRampAdminSetIterator{contract: _EVM2EVMOffRamp.contract, event: "AdminSet", logs: logs, sub: sub}, nil +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) WatchAdminSet(opts *bind.WatchOpts, sink chan<- *EVM2EVMOffRampAdminSet) (event.Subscription, error) { + + logs, sub, err := _EVM2EVMOffRamp.contract.WatchLogs(opts, "AdminSet") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(EVM2EVMOffRampAdminSet) + if err := _EVM2EVMOffRamp.contract.UnpackLog(event, "AdminSet", 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 +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) ParseAdminSet(log types.Log) (*EVM2EVMOffRampAdminSet, error) { + event := new(EVM2EVMOffRampAdminSet) + if err := _EVM2EVMOffRamp.contract.UnpackLog(event, "AdminSet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type EVM2EVMOffRampConfigSetIterator struct { + Event *EVM2EVMOffRampConfigSet + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *EVM2EVMOffRampConfigSetIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOffRampConfigSet) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOffRampConfigSet) + 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() + } +} + +func (it *EVM2EVMOffRampConfigSetIterator) Error() error { + return it.fail +} + +func (it *EVM2EVMOffRampConfigSetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type EVM2EVMOffRampConfigSet struct { + StaticConfig EVM2EVMOffRampStaticConfig + DynamicConfig EVM2EVMOffRampDynamicConfig + Raw types.Log +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) FilterConfigSet(opts *bind.FilterOpts) (*EVM2EVMOffRampConfigSetIterator, error) { + + logs, sub, err := _EVM2EVMOffRamp.contract.FilterLogs(opts, "ConfigSet") + if err != nil { + return nil, err + } + return &EVM2EVMOffRampConfigSetIterator{contract: _EVM2EVMOffRamp.contract, event: "ConfigSet", logs: logs, sub: sub}, nil +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) WatchConfigSet(opts *bind.WatchOpts, sink chan<- *EVM2EVMOffRampConfigSet) (event.Subscription, error) { + + logs, sub, err := _EVM2EVMOffRamp.contract.WatchLogs(opts, "ConfigSet") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(EVM2EVMOffRampConfigSet) + if err := _EVM2EVMOffRamp.contract.UnpackLog(event, "ConfigSet", 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 +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) ParseConfigSet(log types.Log) (*EVM2EVMOffRampConfigSet, error) { + event := new(EVM2EVMOffRampConfigSet) + if err := _EVM2EVMOffRamp.contract.UnpackLog(event, "ConfigSet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type EVM2EVMOffRampConfigSet0Iterator struct { + Event *EVM2EVMOffRampConfigSet0 + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *EVM2EVMOffRampConfigSet0Iterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOffRampConfigSet0) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOffRampConfigSet0) + 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() + } +} + +func (it *EVM2EVMOffRampConfigSet0Iterator) Error() error { + return it.fail +} + +func (it *EVM2EVMOffRampConfigSet0Iterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type EVM2EVMOffRampConfigSet0 struct { + PreviousConfigBlockNumber uint32 + ConfigDigest [32]byte + ConfigCount uint64 + Signers []common.Address + Transmitters []common.Address + F uint8 + OnchainConfig []byte + OffchainConfigVersion uint64 + OffchainConfig []byte + Raw types.Log +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) FilterConfigSet0(opts *bind.FilterOpts) (*EVM2EVMOffRampConfigSet0Iterator, error) { + + logs, sub, err := _EVM2EVMOffRamp.contract.FilterLogs(opts, "ConfigSet0") + if err != nil { + return nil, err + } + return &EVM2EVMOffRampConfigSet0Iterator{contract: _EVM2EVMOffRamp.contract, event: "ConfigSet0", logs: logs, sub: sub}, nil +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) WatchConfigSet0(opts *bind.WatchOpts, sink chan<- *EVM2EVMOffRampConfigSet0) (event.Subscription, error) { + + logs, sub, err := _EVM2EVMOffRamp.contract.WatchLogs(opts, "ConfigSet0") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(EVM2EVMOffRampConfigSet0) + if err := _EVM2EVMOffRamp.contract.UnpackLog(event, "ConfigSet0", 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 +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) ParseConfigSet0(log types.Log) (*EVM2EVMOffRampConfigSet0, error) { + event := new(EVM2EVMOffRampConfigSet0) + if err := _EVM2EVMOffRamp.contract.UnpackLog(event, "ConfigSet0", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type EVM2EVMOffRampExecutionStateChangedIterator struct { + Event *EVM2EVMOffRampExecutionStateChanged + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *EVM2EVMOffRampExecutionStateChangedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOffRampExecutionStateChanged) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOffRampExecutionStateChanged) + 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() + } +} + +func (it *EVM2EVMOffRampExecutionStateChangedIterator) Error() error { + return it.fail +} + +func (it *EVM2EVMOffRampExecutionStateChangedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type EVM2EVMOffRampExecutionStateChanged struct { + SequenceNumber uint64 + MessageId [32]byte + State uint8 + ReturnData []byte + Raw types.Log +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) FilterExecutionStateChanged(opts *bind.FilterOpts, sequenceNumber []uint64, messageId [][32]byte) (*EVM2EVMOffRampExecutionStateChangedIterator, error) { + + var sequenceNumberRule []interface{} + for _, sequenceNumberItem := range sequenceNumber { + sequenceNumberRule = append(sequenceNumberRule, sequenceNumberItem) + } + var messageIdRule []interface{} + for _, messageIdItem := range messageId { + messageIdRule = append(messageIdRule, messageIdItem) + } + + logs, sub, err := _EVM2EVMOffRamp.contract.FilterLogs(opts, "ExecutionStateChanged", sequenceNumberRule, messageIdRule) + if err != nil { + return nil, err + } + return &EVM2EVMOffRampExecutionStateChangedIterator{contract: _EVM2EVMOffRamp.contract, event: "ExecutionStateChanged", logs: logs, sub: sub}, nil +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) WatchExecutionStateChanged(opts *bind.WatchOpts, sink chan<- *EVM2EVMOffRampExecutionStateChanged, sequenceNumber []uint64, messageId [][32]byte) (event.Subscription, error) { + + var sequenceNumberRule []interface{} + for _, sequenceNumberItem := range sequenceNumber { + sequenceNumberRule = append(sequenceNumberRule, sequenceNumberItem) + } + var messageIdRule []interface{} + for _, messageIdItem := range messageId { + messageIdRule = append(messageIdRule, messageIdItem) + } + + logs, sub, err := _EVM2EVMOffRamp.contract.WatchLogs(opts, "ExecutionStateChanged", sequenceNumberRule, messageIdRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(EVM2EVMOffRampExecutionStateChanged) + if err := _EVM2EVMOffRamp.contract.UnpackLog(event, "ExecutionStateChanged", 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 +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) ParseExecutionStateChanged(log types.Log) (*EVM2EVMOffRampExecutionStateChanged, error) { + event := new(EVM2EVMOffRampExecutionStateChanged) + if err := _EVM2EVMOffRamp.contract.UnpackLog(event, "ExecutionStateChanged", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type EVM2EVMOffRampOwnershipTransferRequestedIterator struct { + Event *EVM2EVMOffRampOwnershipTransferRequested + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *EVM2EVMOffRampOwnershipTransferRequestedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOffRampOwnershipTransferRequested) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOffRampOwnershipTransferRequested) + 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() + } +} + +func (it *EVM2EVMOffRampOwnershipTransferRequestedIterator) Error() error { + return it.fail +} + +func (it *EVM2EVMOffRampOwnershipTransferRequestedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type EVM2EVMOffRampOwnershipTransferRequested struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*EVM2EVMOffRampOwnershipTransferRequestedIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _EVM2EVMOffRamp.contract.FilterLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return &EVM2EVMOffRampOwnershipTransferRequestedIterator{contract: _EVM2EVMOffRamp.contract, event: "OwnershipTransferRequested", logs: logs, sub: sub}, nil +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *EVM2EVMOffRampOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _EVM2EVMOffRamp.contract.WatchLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(EVM2EVMOffRampOwnershipTransferRequested) + if err := _EVM2EVMOffRamp.contract.UnpackLog(event, "OwnershipTransferRequested", 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 +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) ParseOwnershipTransferRequested(log types.Log) (*EVM2EVMOffRampOwnershipTransferRequested, error) { + event := new(EVM2EVMOffRampOwnershipTransferRequested) + if err := _EVM2EVMOffRamp.contract.UnpackLog(event, "OwnershipTransferRequested", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type EVM2EVMOffRampOwnershipTransferredIterator struct { + Event *EVM2EVMOffRampOwnershipTransferred + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *EVM2EVMOffRampOwnershipTransferredIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOffRampOwnershipTransferred) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOffRampOwnershipTransferred) + 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() + } +} + +func (it *EVM2EVMOffRampOwnershipTransferredIterator) Error() error { + return it.fail +} + +func (it *EVM2EVMOffRampOwnershipTransferredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type EVM2EVMOffRampOwnershipTransferred struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*EVM2EVMOffRampOwnershipTransferredIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _EVM2EVMOffRamp.contract.FilterLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return &EVM2EVMOffRampOwnershipTransferredIterator{contract: _EVM2EVMOffRamp.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *EVM2EVMOffRampOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _EVM2EVMOffRamp.contract.WatchLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(EVM2EVMOffRampOwnershipTransferred) + if err := _EVM2EVMOffRamp.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 +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) ParseOwnershipTransferred(log types.Log) (*EVM2EVMOffRampOwnershipTransferred, error) { + event := new(EVM2EVMOffRampOwnershipTransferred) + if err := _EVM2EVMOffRamp.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type EVM2EVMOffRampPoolAddedIterator struct { + Event *EVM2EVMOffRampPoolAdded + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *EVM2EVMOffRampPoolAddedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOffRampPoolAdded) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOffRampPoolAdded) + 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() + } +} + +func (it *EVM2EVMOffRampPoolAddedIterator) Error() error { + return it.fail +} + +func (it *EVM2EVMOffRampPoolAddedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type EVM2EVMOffRampPoolAdded struct { + Token common.Address + Pool common.Address + Raw types.Log +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) FilterPoolAdded(opts *bind.FilterOpts) (*EVM2EVMOffRampPoolAddedIterator, error) { + + logs, sub, err := _EVM2EVMOffRamp.contract.FilterLogs(opts, "PoolAdded") + if err != nil { + return nil, err + } + return &EVM2EVMOffRampPoolAddedIterator{contract: _EVM2EVMOffRamp.contract, event: "PoolAdded", logs: logs, sub: sub}, nil +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) WatchPoolAdded(opts *bind.WatchOpts, sink chan<- *EVM2EVMOffRampPoolAdded) (event.Subscription, error) { + + logs, sub, err := _EVM2EVMOffRamp.contract.WatchLogs(opts, "PoolAdded") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(EVM2EVMOffRampPoolAdded) + if err := _EVM2EVMOffRamp.contract.UnpackLog(event, "PoolAdded", 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 +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) ParsePoolAdded(log types.Log) (*EVM2EVMOffRampPoolAdded, error) { + event := new(EVM2EVMOffRampPoolAdded) + if err := _EVM2EVMOffRamp.contract.UnpackLog(event, "PoolAdded", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type EVM2EVMOffRampPoolRemovedIterator struct { + Event *EVM2EVMOffRampPoolRemoved + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *EVM2EVMOffRampPoolRemovedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOffRampPoolRemoved) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOffRampPoolRemoved) + 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() + } +} + +func (it *EVM2EVMOffRampPoolRemovedIterator) Error() error { + return it.fail +} + +func (it *EVM2EVMOffRampPoolRemovedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type EVM2EVMOffRampPoolRemoved struct { + Token common.Address + Pool common.Address + Raw types.Log +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) FilterPoolRemoved(opts *bind.FilterOpts) (*EVM2EVMOffRampPoolRemovedIterator, error) { + + logs, sub, err := _EVM2EVMOffRamp.contract.FilterLogs(opts, "PoolRemoved") + if err != nil { + return nil, err + } + return &EVM2EVMOffRampPoolRemovedIterator{contract: _EVM2EVMOffRamp.contract, event: "PoolRemoved", logs: logs, sub: sub}, nil +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) WatchPoolRemoved(opts *bind.WatchOpts, sink chan<- *EVM2EVMOffRampPoolRemoved) (event.Subscription, error) { + + logs, sub, err := _EVM2EVMOffRamp.contract.WatchLogs(opts, "PoolRemoved") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(EVM2EVMOffRampPoolRemoved) + if err := _EVM2EVMOffRamp.contract.UnpackLog(event, "PoolRemoved", 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 +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) ParsePoolRemoved(log types.Log) (*EVM2EVMOffRampPoolRemoved, error) { + event := new(EVM2EVMOffRampPoolRemoved) + if err := _EVM2EVMOffRamp.contract.UnpackLog(event, "PoolRemoved", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type EVM2EVMOffRampSkippedIncorrectNonceIterator struct { + Event *EVM2EVMOffRampSkippedIncorrectNonce + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *EVM2EVMOffRampSkippedIncorrectNonceIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOffRampSkippedIncorrectNonce) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOffRampSkippedIncorrectNonce) + 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() + } +} + +func (it *EVM2EVMOffRampSkippedIncorrectNonceIterator) Error() error { + return it.fail +} + +func (it *EVM2EVMOffRampSkippedIncorrectNonceIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type EVM2EVMOffRampSkippedIncorrectNonce struct { + Nonce uint64 + Sender common.Address + Raw types.Log +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) FilterSkippedIncorrectNonce(opts *bind.FilterOpts, nonce []uint64, sender []common.Address) (*EVM2EVMOffRampSkippedIncorrectNonceIterator, error) { + + var nonceRule []interface{} + for _, nonceItem := range nonce { + nonceRule = append(nonceRule, nonceItem) + } + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _EVM2EVMOffRamp.contract.FilterLogs(opts, "SkippedIncorrectNonce", nonceRule, senderRule) + if err != nil { + return nil, err + } + return &EVM2EVMOffRampSkippedIncorrectNonceIterator{contract: _EVM2EVMOffRamp.contract, event: "SkippedIncorrectNonce", logs: logs, sub: sub}, nil +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) WatchSkippedIncorrectNonce(opts *bind.WatchOpts, sink chan<- *EVM2EVMOffRampSkippedIncorrectNonce, nonce []uint64, sender []common.Address) (event.Subscription, error) { + + var nonceRule []interface{} + for _, nonceItem := range nonce { + nonceRule = append(nonceRule, nonceItem) + } + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _EVM2EVMOffRamp.contract.WatchLogs(opts, "SkippedIncorrectNonce", nonceRule, senderRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(EVM2EVMOffRampSkippedIncorrectNonce) + if err := _EVM2EVMOffRamp.contract.UnpackLog(event, "SkippedIncorrectNonce", 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 +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) ParseSkippedIncorrectNonce(log types.Log) (*EVM2EVMOffRampSkippedIncorrectNonce, error) { + event := new(EVM2EVMOffRampSkippedIncorrectNonce) + if err := _EVM2EVMOffRamp.contract.UnpackLog(event, "SkippedIncorrectNonce", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflightIterator struct { + Event *EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflight + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflightIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflight) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflight) + 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() + } +} + +func (it *EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflightIterator) Error() error { + return it.fail +} + +func (it *EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflightIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflight struct { + Nonce uint64 + Sender common.Address + Raw types.Log +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) FilterSkippedSenderWithPreviousRampMessageInflight(opts *bind.FilterOpts, nonce []uint64, sender []common.Address) (*EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflightIterator, error) { + + var nonceRule []interface{} + for _, nonceItem := range nonce { + nonceRule = append(nonceRule, nonceItem) + } + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _EVM2EVMOffRamp.contract.FilterLogs(opts, "SkippedSenderWithPreviousRampMessageInflight", nonceRule, senderRule) + if err != nil { + return nil, err + } + return &EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflightIterator{contract: _EVM2EVMOffRamp.contract, event: "SkippedSenderWithPreviousRampMessageInflight", logs: logs, sub: sub}, nil +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) WatchSkippedSenderWithPreviousRampMessageInflight(opts *bind.WatchOpts, sink chan<- *EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflight, nonce []uint64, sender []common.Address) (event.Subscription, error) { + + var nonceRule []interface{} + for _, nonceItem := range nonce { + nonceRule = append(nonceRule, nonceItem) + } + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _EVM2EVMOffRamp.contract.WatchLogs(opts, "SkippedSenderWithPreviousRampMessageInflight", nonceRule, senderRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflight) + if err := _EVM2EVMOffRamp.contract.UnpackLog(event, "SkippedSenderWithPreviousRampMessageInflight", 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 +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) ParseSkippedSenderWithPreviousRampMessageInflight(log types.Log) (*EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflight, error) { + event := new(EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflight) + if err := _EVM2EVMOffRamp.contract.UnpackLog(event, "SkippedSenderWithPreviousRampMessageInflight", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type EVM2EVMOffRampTransmittedIterator struct { + Event *EVM2EVMOffRampTransmitted + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *EVM2EVMOffRampTransmittedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOffRampTransmitted) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOffRampTransmitted) + 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() + } +} + +func (it *EVM2EVMOffRampTransmittedIterator) Error() error { + return it.fail +} + +func (it *EVM2EVMOffRampTransmittedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type EVM2EVMOffRampTransmitted struct { + ConfigDigest [32]byte + Epoch uint32 + Raw types.Log +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) FilterTransmitted(opts *bind.FilterOpts) (*EVM2EVMOffRampTransmittedIterator, error) { + + logs, sub, err := _EVM2EVMOffRamp.contract.FilterLogs(opts, "Transmitted") + if err != nil { + return nil, err + } + return &EVM2EVMOffRampTransmittedIterator{contract: _EVM2EVMOffRamp.contract, event: "Transmitted", logs: logs, sub: sub}, nil +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) WatchTransmitted(opts *bind.WatchOpts, sink chan<- *EVM2EVMOffRampTransmitted) (event.Subscription, error) { + + logs, sub, err := _EVM2EVMOffRamp.contract.WatchLogs(opts, "Transmitted") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(EVM2EVMOffRampTransmitted) + if err := _EVM2EVMOffRamp.contract.UnpackLog(event, "Transmitted", 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 +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRampFilterer) ParseTransmitted(log types.Log) (*EVM2EVMOffRampTransmitted, error) { + event := new(EVM2EVMOffRampTransmitted) + if err := _EVM2EVMOffRamp.contract.UnpackLog(event, "Transmitted", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type LatestConfigDetails struct { + ConfigCount uint32 + BlockNumber uint32 + ConfigDigest [32]byte +} +type LatestConfigDigestAndEpoch struct { + ScanLogs bool + ConfigDigest [32]byte + Epoch uint32 +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRamp) ParseLog(log types.Log) (generated.AbigenLog, error) { + switch log.Topics[0] { + case _EVM2EVMOffRamp.abi.Events["AdminSet"].ID: + return _EVM2EVMOffRamp.ParseAdminSet(log) + case _EVM2EVMOffRamp.abi.Events["ConfigSet"].ID: + return _EVM2EVMOffRamp.ParseConfigSet(log) + case _EVM2EVMOffRamp.abi.Events["ConfigSet0"].ID: + return _EVM2EVMOffRamp.ParseConfigSet0(log) + case _EVM2EVMOffRamp.abi.Events["ExecutionStateChanged"].ID: + return _EVM2EVMOffRamp.ParseExecutionStateChanged(log) + case _EVM2EVMOffRamp.abi.Events["OwnershipTransferRequested"].ID: + return _EVM2EVMOffRamp.ParseOwnershipTransferRequested(log) + case _EVM2EVMOffRamp.abi.Events["OwnershipTransferred"].ID: + return _EVM2EVMOffRamp.ParseOwnershipTransferred(log) + case _EVM2EVMOffRamp.abi.Events["PoolAdded"].ID: + return _EVM2EVMOffRamp.ParsePoolAdded(log) + case _EVM2EVMOffRamp.abi.Events["PoolRemoved"].ID: + return _EVM2EVMOffRamp.ParsePoolRemoved(log) + case _EVM2EVMOffRamp.abi.Events["SkippedIncorrectNonce"].ID: + return _EVM2EVMOffRamp.ParseSkippedIncorrectNonce(log) + case _EVM2EVMOffRamp.abi.Events["SkippedSenderWithPreviousRampMessageInflight"].ID: + return _EVM2EVMOffRamp.ParseSkippedSenderWithPreviousRampMessageInflight(log) + case _EVM2EVMOffRamp.abi.Events["Transmitted"].ID: + return _EVM2EVMOffRamp.ParseTransmitted(log) + + default: + return nil, fmt.Errorf("abigen wrapper received unknown log topic: %v", log.Topics[0]) + } +} + +func (EVM2EVMOffRampAdminSet) Topic() common.Hash { + return common.HexToHash("0x8fe72c3e0020beb3234e76ae6676fa576fbfcae600af1c4fea44784cf0db329c") +} + +func (EVM2EVMOffRampConfigSet) Topic() common.Hash { + return common.HexToHash("0xe668e1a4644c1a030b909bbfd837f5cfa914994ed5e0bb2e9c34a5c37753128a") +} + +func (EVM2EVMOffRampConfigSet0) Topic() common.Hash { + return common.HexToHash("0x1591690b8638f5fb2dbec82ac741805ac5da8b45dc5263f4875b0496fdce4e05") +} + +func (EVM2EVMOffRampExecutionStateChanged) Topic() common.Hash { + return common.HexToHash("0xd4f851956a5d67c3997d1c9205045fef79bae2947fdee7e9e2641abc7391ef65") +} + +func (EVM2EVMOffRampOwnershipTransferRequested) Topic() common.Hash { + return common.HexToHash("0xed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae1278") +} + +func (EVM2EVMOffRampOwnershipTransferred) Topic() common.Hash { + return common.HexToHash("0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0") +} + +func (EVM2EVMOffRampPoolAdded) Topic() common.Hash { + return common.HexToHash("0x95f865c2808f8b2a85eea2611db7843150ee7835ef1403f9755918a97d76933c") +} + +func (EVM2EVMOffRampPoolRemoved) Topic() common.Hash { + return common.HexToHash("0x987eb3c2f78454541205f72f34839b434c306c9eaf4922efd7c0c3060fdb2e4c") +} + +func (EVM2EVMOffRampSkippedIncorrectNonce) Topic() common.Hash { + return common.HexToHash("0xd32ddb11d71e3d63411d37b09f9a8b28664f1cb1338bfd1413c173b0ebf41237") +} + +func (EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflight) Topic() common.Hash { + return common.HexToHash("0xe44a20935573a783dd0d5991c92d7b6a0eb3173566530364db3ec10e9a990b5d") +} + +func (EVM2EVMOffRampTransmitted) Topic() common.Hash { + return common.HexToHash("0xb04e63db38c49950639fa09d29872f21f5d49d614f3a969d8adf3d4b52e41a62") +} + +func (_EVM2EVMOffRamp *EVM2EVMOffRamp) Address() common.Address { + return _EVM2EVMOffRamp.address +} + +type EVM2EVMOffRampInterface interface { + CcipReceive(opts *bind.CallOpts, arg0 ClientAny2EVMMessage) error + + CurrentRateLimiterState(opts *bind.CallOpts) (RateLimiterTokenBucket, error) + + GetDestinationToken(opts *bind.CallOpts, sourceToken common.Address) (common.Address, error) + + GetDestinationTokens(opts *bind.CallOpts) ([]common.Address, error) + + GetDynamicConfig(opts *bind.CallOpts) (EVM2EVMOffRampDynamicConfig, error) + + GetExecutionState(opts *bind.CallOpts, sequenceNumber uint64) (uint8, error) + + GetPoolByDestToken(opts *bind.CallOpts, destToken common.Address) (common.Address, error) + + GetPoolBySourceToken(opts *bind.CallOpts, sourceToken common.Address) (common.Address, error) + + GetSenderNonce(opts *bind.CallOpts, sender common.Address) (uint64, error) + + GetStaticConfig(opts *bind.CallOpts) (EVM2EVMOffRampStaticConfig, error) + + GetSupportedTokens(opts *bind.CallOpts) ([]common.Address, error) + + GetTokenLimitAdmin(opts *bind.CallOpts) (common.Address, error) + + GetTransmitters(opts *bind.CallOpts) ([]common.Address, error) + + LatestConfigDetails(opts *bind.CallOpts) (LatestConfigDetails, + + error) + + LatestConfigDigestAndEpoch(opts *bind.CallOpts) (LatestConfigDigestAndEpoch, + + error) + + Owner(opts *bind.CallOpts) (common.Address, error) + + TypeAndVersion(opts *bind.CallOpts) (string, error) + + AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) + + ApplyPoolUpdates(opts *bind.TransactOpts, removes []InternalPoolUpdate, adds []InternalPoolUpdate) (*types.Transaction, error) + + ExecuteSingleMessage(opts *bind.TransactOpts, message InternalEVM2EVMMessage, offchainTokenData [][]byte) (*types.Transaction, error) + + ManuallyExecute(opts *bind.TransactOpts, report InternalExecutionReport, gasLimitOverrides []*big.Int) (*types.Transaction, error) + + SetAdmin(opts *bind.TransactOpts, newAdmin common.Address) (*types.Transaction, error) + + SetOCR2Config(opts *bind.TransactOpts, signers []common.Address, transmitters []common.Address, f uint8, onchainConfig []byte, offchainConfigVersion uint64, offchainConfig []byte) (*types.Transaction, error) + + SetRateLimiterConfig(opts *bind.TransactOpts, config RateLimiterConfig) (*types.Transaction, error) + + TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) + + Transmit(opts *bind.TransactOpts, reportContext [3][32]byte, report []byte, rs [][32]byte, ss [][32]byte, arg4 [32]byte) (*types.Transaction, error) + + FilterAdminSet(opts *bind.FilterOpts) (*EVM2EVMOffRampAdminSetIterator, error) + + WatchAdminSet(opts *bind.WatchOpts, sink chan<- *EVM2EVMOffRampAdminSet) (event.Subscription, error) + + ParseAdminSet(log types.Log) (*EVM2EVMOffRampAdminSet, error) + + FilterConfigSet(opts *bind.FilterOpts) (*EVM2EVMOffRampConfigSetIterator, error) + + WatchConfigSet(opts *bind.WatchOpts, sink chan<- *EVM2EVMOffRampConfigSet) (event.Subscription, error) + + ParseConfigSet(log types.Log) (*EVM2EVMOffRampConfigSet, error) + + FilterConfigSet0(opts *bind.FilterOpts) (*EVM2EVMOffRampConfigSet0Iterator, error) + + WatchConfigSet0(opts *bind.WatchOpts, sink chan<- *EVM2EVMOffRampConfigSet0) (event.Subscription, error) + + ParseConfigSet0(log types.Log) (*EVM2EVMOffRampConfigSet0, error) + + FilterExecutionStateChanged(opts *bind.FilterOpts, sequenceNumber []uint64, messageId [][32]byte) (*EVM2EVMOffRampExecutionStateChangedIterator, error) + + WatchExecutionStateChanged(opts *bind.WatchOpts, sink chan<- *EVM2EVMOffRampExecutionStateChanged, sequenceNumber []uint64, messageId [][32]byte) (event.Subscription, error) + + ParseExecutionStateChanged(log types.Log) (*EVM2EVMOffRampExecutionStateChanged, error) + + FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*EVM2EVMOffRampOwnershipTransferRequestedIterator, error) + + WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *EVM2EVMOffRampOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferRequested(log types.Log) (*EVM2EVMOffRampOwnershipTransferRequested, error) + + FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*EVM2EVMOffRampOwnershipTransferredIterator, error) + + WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *EVM2EVMOffRampOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferred(log types.Log) (*EVM2EVMOffRampOwnershipTransferred, error) + + FilterPoolAdded(opts *bind.FilterOpts) (*EVM2EVMOffRampPoolAddedIterator, error) + + WatchPoolAdded(opts *bind.WatchOpts, sink chan<- *EVM2EVMOffRampPoolAdded) (event.Subscription, error) + + ParsePoolAdded(log types.Log) (*EVM2EVMOffRampPoolAdded, error) + + FilterPoolRemoved(opts *bind.FilterOpts) (*EVM2EVMOffRampPoolRemovedIterator, error) + + WatchPoolRemoved(opts *bind.WatchOpts, sink chan<- *EVM2EVMOffRampPoolRemoved) (event.Subscription, error) + + ParsePoolRemoved(log types.Log) (*EVM2EVMOffRampPoolRemoved, error) + + FilterSkippedIncorrectNonce(opts *bind.FilterOpts, nonce []uint64, sender []common.Address) (*EVM2EVMOffRampSkippedIncorrectNonceIterator, error) + + WatchSkippedIncorrectNonce(opts *bind.WatchOpts, sink chan<- *EVM2EVMOffRampSkippedIncorrectNonce, nonce []uint64, sender []common.Address) (event.Subscription, error) + + ParseSkippedIncorrectNonce(log types.Log) (*EVM2EVMOffRampSkippedIncorrectNonce, error) + + FilterSkippedSenderWithPreviousRampMessageInflight(opts *bind.FilterOpts, nonce []uint64, sender []common.Address) (*EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflightIterator, error) + + WatchSkippedSenderWithPreviousRampMessageInflight(opts *bind.WatchOpts, sink chan<- *EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflight, nonce []uint64, sender []common.Address) (event.Subscription, error) + + ParseSkippedSenderWithPreviousRampMessageInflight(log types.Log) (*EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflight, error) + + FilterTransmitted(opts *bind.FilterOpts) (*EVM2EVMOffRampTransmittedIterator, error) + + WatchTransmitted(opts *bind.WatchOpts, sink chan<- *EVM2EVMOffRampTransmitted) (event.Subscription, error) + + ParseTransmitted(log types.Log) (*EVM2EVMOffRampTransmitted, error) + + ParseLog(log types.Log) (generated.AbigenLog, error) + + Address() common.Address +} diff --git a/core/gethwrappers/ccip/generated/evm_2_evm_onramp/evm_2_evm_onramp.go b/core/gethwrappers/ccip/generated/evm_2_evm_onramp/evm_2_evm_onramp.go new file mode 100644 index 00000000000..38a4152c714 --- /dev/null +++ b/core/gethwrappers/ccip/generated/evm_2_evm_onramp/evm_2_evm_onramp.go @@ -0,0 +1,2452 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package evm_2_evm_onramp + +import ( + "errors" + "fmt" + "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" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" +) + +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +type ClientEVM2AnyMessage struct { + Receiver []byte + Data []byte + TokenAmounts []ClientEVMTokenAmount + FeeToken common.Address + ExtraArgs []byte +} + +type ClientEVMTokenAmount struct { + Token common.Address + Amount *big.Int +} + +type EVM2EVMOnRampDynamicConfig struct { + Router common.Address + MaxNumberOfTokensPerMsg uint16 + DestGasOverhead uint32 + DestGasPerPayloadByte uint16 + DestDataAvailabilityOverheadGas uint32 + DestGasPerDataAvailabilityByte uint16 + DestDataAvailabilityMultiplierBps uint16 + PriceRegistry common.Address + MaxDataBytes uint32 + MaxPerMsgGasLimit uint32 + DefaultTokenFeeUSDCents uint16 + DefaultTokenDestGasOverhead uint32 + EnforceOutOfOrder bool +} + +type EVM2EVMOnRampFeeTokenConfig struct { + NetworkFeeUSDCents uint32 + GasMultiplierWeiPerEth uint64 + PremiumMultiplierWeiPerEth uint64 + Enabled bool +} + +type EVM2EVMOnRampFeeTokenConfigArgs struct { + Token common.Address + NetworkFeeUSDCents uint32 + GasMultiplierWeiPerEth uint64 + PremiumMultiplierWeiPerEth uint64 + Enabled bool +} + +type EVM2EVMOnRampNopAndWeight struct { + Nop common.Address + Weight uint16 +} + +type EVM2EVMOnRampStaticConfig struct { + LinkToken common.Address + ChainSelector uint64 + DestChainSelector uint64 + DefaultTxGasLimit uint64 + MaxNopFeesJuels *big.Int + PrevOnRamp common.Address + RmnProxy common.Address + TokenAdminRegistry common.Address +} + +type EVM2EVMOnRampTokenTransferFeeConfig struct { + MinFeeUSDCents uint32 + MaxFeeUSDCents uint32 + DeciBps uint16 + DestGasOverhead uint32 + DestBytesOverhead uint32 + AggregateRateLimitEnabled bool + IsEnabled bool +} + +type EVM2EVMOnRampTokenTransferFeeConfigArgs struct { + Token common.Address + MinFeeUSDCents uint32 + MaxFeeUSDCents uint32 + DeciBps uint16 + DestGasOverhead uint32 + DestBytesOverhead uint32 + AggregateRateLimitEnabled bool +} + +type InternalEVM2EVMMessage struct { + SourceChainSelector uint64 + Sender common.Address + Receiver common.Address + SequenceNumber uint64 + GasLimit *big.Int + Strict bool + Nonce uint64 + FeeToken common.Address + FeeTokenAmount *big.Int + Data []byte + TokenAmounts []ClientEVMTokenAmount + SourceTokenData [][]byte + MessageId [32]byte +} + +type RateLimiterConfig struct { + IsEnabled bool + Capacity *big.Int + Rate *big.Int +} + +type RateLimiterTokenBucket struct { + Tokens *big.Int + LastUpdated uint32 + IsEnabled bool + Capacity *big.Int + Rate *big.Int +} + +var EVM2EVMOnRampMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"linkToken\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"defaultTxGasLimit\",\"type\":\"uint64\"},{\"internalType\":\"uint96\",\"name\":\"maxNopFeesJuels\",\"type\":\"uint96\"},{\"internalType\":\"address\",\"name\":\"prevOnRamp\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"rmnProxy\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAdminRegistry\",\"type\":\"address\"}],\"internalType\":\"structEVM2EVMOnRamp.StaticConfig\",\"name\":\"staticConfig\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"router\",\"type\":\"address\"},{\"internalType\":\"uint16\",\"name\":\"maxNumberOfTokensPerMsg\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"destGasOverhead\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"destGasPerPayloadByte\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"destDataAvailabilityOverheadGas\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"destGasPerDataAvailabilityByte\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"destDataAvailabilityMultiplierBps\",\"type\":\"uint16\"},{\"internalType\":\"address\",\"name\":\"priceRegistry\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"maxDataBytes\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"maxPerMsgGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"defaultTokenFeeUSDCents\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"defaultTokenDestGasOverhead\",\"type\":\"uint32\"},{\"internalType\":\"bool\",\"name\":\"enforceOutOfOrder\",\"type\":\"bool\"}],\"internalType\":\"structEVM2EVMOnRamp.DynamicConfig\",\"name\":\"dynamicConfig\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"rateLimiterConfig\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"networkFeeUSDCents\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"gasMultiplierWeiPerEth\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"premiumMultiplierWeiPerEth\",\"type\":\"uint64\"},{\"internalType\":\"bool\",\"name\":\"enabled\",\"type\":\"bool\"}],\"internalType\":\"structEVM2EVMOnRamp.FeeTokenConfigArgs[]\",\"name\":\"feeTokenConfigs\",\"type\":\"tuple[]\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"minFeeUSDCents\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"maxFeeUSDCents\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"deciBps\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"destGasOverhead\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"destBytesOverhead\",\"type\":\"uint32\"},{\"internalType\":\"bool\",\"name\":\"aggregateRateLimitEnabled\",\"type\":\"bool\"}],\"internalType\":\"structEVM2EVMOnRamp.TokenTransferFeeConfigArgs[]\",\"name\":\"tokenTransferFeeConfigArgs\",\"type\":\"tuple[]\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"nop\",\"type\":\"address\"},{\"internalType\":\"uint16\",\"name\":\"weight\",\"type\":\"uint16\"}],\"internalType\":\"structEVM2EVMOnRamp.NopAndWeight[]\",\"name\":\"nopsAndWeights\",\"type\":\"tuple[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"capacity\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"requested\",\"type\":\"uint256\"}],\"name\":\"AggregateValueMaxCapacityExceeded\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"minWaitInSeconds\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"available\",\"type\":\"uint256\"}],\"name\":\"AggregateValueRateLimitReached\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"BucketOverfilled\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"CannotSendZeroTokens\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"CursedByRMN\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ExtraArgOutOfOrderExecutionMustBeTrue\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"GetSupportedTokensFunctionalityRemovedCheckAdminRegistry\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InsufficientBalance\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"}],\"name\":\"InvalidChainSelector\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidConfig\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"destBytesOverhead\",\"type\":\"uint32\"}],\"name\":\"InvalidDestBytesOverhead\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"encodedAddress\",\"type\":\"bytes\"}],\"name\":\"InvalidEVMAddress\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidExtraArgsTag\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"nop\",\"type\":\"address\"}],\"name\":\"InvalidNopAddress\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidWithdrawParams\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"LinkBalanceNotSettled\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"MaxFeeBalanceReached\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"MessageGasLimitTooHigh\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"maxSize\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"actualSize\",\"type\":\"uint256\"}],\"name\":\"MessageTooLarge\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"MustBeCalledByRouter\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NoFeesToPay\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NoNopsToPay\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"NotAFeeToken\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCallableByAdminOrOwner\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCallableByOwnerOrAdmin\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCallableByOwnerOrAdminOrNop\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"PriceNotFoundForToken\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RouterMustSetOriginalSender\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"SourceTokenDataTooLarge\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"capacity\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"requested\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"}],\"name\":\"TokenMaxCapacityExceeded\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"minWaitInSeconds\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"available\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"}],\"name\":\"TokenRateLimitReached\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TooManyNops\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UnsupportedNumberOfTokens\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"UnsupportedToken\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"sequenceNumber\",\"type\":\"uint64\"},{\"internalType\":\"uint256\",\"name\":\"gasLimit\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"strict\",\"type\":\"bool\"},{\"internalType\":\"uint64\",\"name\":\"nonce\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"feeToken\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"feeTokenAmount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"internalType\":\"structClient.EVMTokenAmount[]\",\"name\":\"tokenAmounts\",\"type\":\"tuple[]\"},{\"internalType\":\"bytes[]\",\"name\":\"sourceTokenData\",\"type\":\"bytes[]\"},{\"internalType\":\"bytes32\",\"name\":\"messageId\",\"type\":\"bytes32\"}],\"indexed\":false,\"internalType\":\"structInternal.EVM2EVMMessage\",\"name\":\"message\",\"type\":\"tuple\"}],\"name\":\"CCIPSendRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"indexed\":false,\"internalType\":\"structRateLimiter.Config\",\"name\":\"config\",\"type\":\"tuple\"}],\"name\":\"ConfigChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"linkToken\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"defaultTxGasLimit\",\"type\":\"uint64\"},{\"internalType\":\"uint96\",\"name\":\"maxNopFeesJuels\",\"type\":\"uint96\"},{\"internalType\":\"address\",\"name\":\"prevOnRamp\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"rmnProxy\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAdminRegistry\",\"type\":\"address\"}],\"indexed\":false,\"internalType\":\"structEVM2EVMOnRamp.StaticConfig\",\"name\":\"staticConfig\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"router\",\"type\":\"address\"},{\"internalType\":\"uint16\",\"name\":\"maxNumberOfTokensPerMsg\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"destGasOverhead\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"destGasPerPayloadByte\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"destDataAvailabilityOverheadGas\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"destGasPerDataAvailabilityByte\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"destDataAvailabilityMultiplierBps\",\"type\":\"uint16\"},{\"internalType\":\"address\",\"name\":\"priceRegistry\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"maxDataBytes\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"maxPerMsgGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"defaultTokenFeeUSDCents\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"defaultTokenDestGasOverhead\",\"type\":\"uint32\"},{\"internalType\":\"bool\",\"name\":\"enforceOutOfOrder\",\"type\":\"bool\"}],\"indexed\":false,\"internalType\":\"structEVM2EVMOnRamp.DynamicConfig\",\"name\":\"dynamicConfig\",\"type\":\"tuple\"}],\"name\":\"ConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"networkFeeUSDCents\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"gasMultiplierWeiPerEth\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"premiumMultiplierWeiPerEth\",\"type\":\"uint64\"},{\"internalType\":\"bool\",\"name\":\"enabled\",\"type\":\"bool\"}],\"indexed\":false,\"internalType\":\"structEVM2EVMOnRamp.FeeTokenConfigArgs[]\",\"name\":\"feeConfig\",\"type\":\"tuple[]\"}],\"name\":\"FeeConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"nop\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"NopPaid\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"nopWeightsTotal\",\"type\":\"uint256\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"nop\",\"type\":\"address\"},{\"internalType\":\"uint16\",\"name\":\"weight\",\"type\":\"uint16\"}],\"indexed\":false,\"internalType\":\"structEVM2EVMOnRamp.NopAndWeight[]\",\"name\":\"nopsAndWeights\",\"type\":\"tuple[]\"}],\"name\":\"NopsSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"tokens\",\"type\":\"address[]\"}],\"name\":\"TokenTransferFeeConfigDeleted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"minFeeUSDCents\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"maxFeeUSDCents\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"deciBps\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"destGasOverhead\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"destBytesOverhead\",\"type\":\"uint32\"},{\"internalType\":\"bool\",\"name\":\"aggregateRateLimitEnabled\",\"type\":\"bool\"}],\"indexed\":false,\"internalType\":\"structEVM2EVMOnRamp.TokenTransferFeeConfigArgs[]\",\"name\":\"transferFeeConfig\",\"type\":\"tuple[]\"}],\"name\":\"TokenTransferFeeConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"}],\"name\":\"TokensConsumed\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"currentRateLimiterState\",\"outputs\":[{\"components\":[{\"internalType\":\"uint128\",\"name\":\"tokens\",\"type\":\"uint128\"},{\"internalType\":\"uint32\",\"name\":\"lastUpdated\",\"type\":\"uint32\"},{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.TokenBucket\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"},{\"components\":[{\"internalType\":\"bytes\",\"name\":\"receiver\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"internalType\":\"structClient.EVMTokenAmount[]\",\"name\":\"tokenAmounts\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"feeToken\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"extraArgs\",\"type\":\"bytes\"}],\"internalType\":\"structClient.EVM2AnyMessage\",\"name\":\"message\",\"type\":\"tuple\"},{\"internalType\":\"uint256\",\"name\":\"feeTokenAmount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"originalSender\",\"type\":\"address\"}],\"name\":\"forwardFromRouter\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getDynamicConfig\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"router\",\"type\":\"address\"},{\"internalType\":\"uint16\",\"name\":\"maxNumberOfTokensPerMsg\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"destGasOverhead\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"destGasPerPayloadByte\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"destDataAvailabilityOverheadGas\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"destGasPerDataAvailabilityByte\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"destDataAvailabilityMultiplierBps\",\"type\":\"uint16\"},{\"internalType\":\"address\",\"name\":\"priceRegistry\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"maxDataBytes\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"maxPerMsgGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"defaultTokenFeeUSDCents\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"defaultTokenDestGasOverhead\",\"type\":\"uint32\"},{\"internalType\":\"bool\",\"name\":\"enforceOutOfOrder\",\"type\":\"bool\"}],\"internalType\":\"structEVM2EVMOnRamp.DynamicConfig\",\"name\":\"dynamicConfig\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getExpectedNextSequenceNumber\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"},{\"components\":[{\"internalType\":\"bytes\",\"name\":\"receiver\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"internalType\":\"structClient.EVMTokenAmount[]\",\"name\":\"tokenAmounts\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"feeToken\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"extraArgs\",\"type\":\"bytes\"}],\"internalType\":\"structClient.EVM2AnyMessage\",\"name\":\"message\",\"type\":\"tuple\"}],\"name\":\"getFee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"feeTokenAmount\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"getFeeTokenConfig\",\"outputs\":[{\"components\":[{\"internalType\":\"uint32\",\"name\":\"networkFeeUSDCents\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"gasMultiplierWeiPerEth\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"premiumMultiplierWeiPerEth\",\"type\":\"uint64\"},{\"internalType\":\"bool\",\"name\":\"enabled\",\"type\":\"bool\"}],\"internalType\":\"structEVM2EVMOnRamp.FeeTokenConfig\",\"name\":\"feeTokenConfig\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getNopFeesJuels\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"\",\"type\":\"uint96\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getNops\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"nop\",\"type\":\"address\"},{\"internalType\":\"uint16\",\"name\":\"weight\",\"type\":\"uint16\"}],\"internalType\":\"structEVM2EVMOnRamp.NopAndWeight[]\",\"name\":\"nopsAndWeights\",\"type\":\"tuple[]\"},{\"internalType\":\"uint256\",\"name\":\"weightsTotal\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"},{\"internalType\":\"contractIERC20\",\"name\":\"sourceToken\",\"type\":\"address\"}],\"name\":\"getPoolBySourceToken\",\"outputs\":[{\"internalType\":\"contractIPoolV1\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"getSenderNonce\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getStaticConfig\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"linkToken\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"defaultTxGasLimit\",\"type\":\"uint64\"},{\"internalType\":\"uint96\",\"name\":\"maxNopFeesJuels\",\"type\":\"uint96\"},{\"internalType\":\"address\",\"name\":\"prevOnRamp\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"rmnProxy\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAdminRegistry\",\"type\":\"address\"}],\"internalType\":\"structEVM2EVMOnRamp.StaticConfig\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"name\":\"getSupportedTokens\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getTokenLimitAdmin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"getTokenTransferFeeConfig\",\"outputs\":[{\"components\":[{\"internalType\":\"uint32\",\"name\":\"minFeeUSDCents\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"maxFeeUSDCents\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"deciBps\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"destGasOverhead\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"destBytesOverhead\",\"type\":\"uint32\"},{\"internalType\":\"bool\",\"name\":\"aggregateRateLimitEnabled\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"}],\"internalType\":\"structEVM2EVMOnRamp.TokenTransferFeeConfig\",\"name\":\"tokenTransferFeeConfig\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"linkAvailableForPayment\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"payNops\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"setAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"router\",\"type\":\"address\"},{\"internalType\":\"uint16\",\"name\":\"maxNumberOfTokensPerMsg\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"destGasOverhead\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"destGasPerPayloadByte\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"destDataAvailabilityOverheadGas\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"destGasPerDataAvailabilityByte\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"destDataAvailabilityMultiplierBps\",\"type\":\"uint16\"},{\"internalType\":\"address\",\"name\":\"priceRegistry\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"maxDataBytes\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"maxPerMsgGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"defaultTokenFeeUSDCents\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"defaultTokenDestGasOverhead\",\"type\":\"uint32\"},{\"internalType\":\"bool\",\"name\":\"enforceOutOfOrder\",\"type\":\"bool\"}],\"internalType\":\"structEVM2EVMOnRamp.DynamicConfig\",\"name\":\"dynamicConfig\",\"type\":\"tuple\"}],\"name\":\"setDynamicConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"networkFeeUSDCents\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"gasMultiplierWeiPerEth\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"premiumMultiplierWeiPerEth\",\"type\":\"uint64\"},{\"internalType\":\"bool\",\"name\":\"enabled\",\"type\":\"bool\"}],\"internalType\":\"structEVM2EVMOnRamp.FeeTokenConfigArgs[]\",\"name\":\"feeTokenConfigArgs\",\"type\":\"tuple[]\"}],\"name\":\"setFeeTokenConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"nop\",\"type\":\"address\"},{\"internalType\":\"uint16\",\"name\":\"weight\",\"type\":\"uint16\"}],\"internalType\":\"structEVM2EVMOnRamp.NopAndWeight[]\",\"name\":\"nopsAndWeights\",\"type\":\"tuple[]\"}],\"name\":\"setNops\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"config\",\"type\":\"tuple\"}],\"name\":\"setRateLimiterConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"minFeeUSDCents\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"maxFeeUSDCents\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"deciBps\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"destGasOverhead\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"destBytesOverhead\",\"type\":\"uint32\"},{\"internalType\":\"bool\",\"name\":\"aggregateRateLimitEnabled\",\"type\":\"bool\"}],\"internalType\":\"structEVM2EVMOnRamp.TokenTransferFeeConfigArgs[]\",\"name\":\"tokenTransferFeeConfigArgs\",\"type\":\"tuple[]\"},{\"internalType\":\"address[]\",\"name\":\"tokensToUseDefaultFeeConfigs\",\"type\":\"address[]\"}],\"name\":\"setTokenTransferFeeConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"feeToken\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"withdrawNonLinkFees\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", + Bin: "0x6101a06040523480156200001257600080fd5b506040516200822d3803806200822d833981016040819052620000359162001a93565b8333806000816200008d5760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000c057620000c0816200030b565b50506040805160a081018252602084810180516001600160801b039081168085524263ffffffff169385018490528751151585870181905292518216606086018190529790950151166080909301839052600380546001600160a01b031916909417600160801b9283021760ff60a01b1916600160a01b90910217909255029091176004555085516001600160a01b0316158062000169575060208601516001600160401b0316155b8062000180575060408601516001600160401b0316155b8062000197575060608601516001600160401b0316155b80620001ae575060c08601516001600160a01b0316155b80620001c5575060e08601516001600160a01b0316155b15620001e4576040516306b7c75960e31b815260040160405180910390fd5b60208087015160408089015181517f8acd72527118c8324937b1a42e02cd246697c3b633f1742f3cae11de233722b3948101949094526001600160401b039283169184019190915216606082015230608082015260a00160408051601f198184030181529181528151602092830120608090815288516001600160a01b0390811660e0908152938a01516001600160401b0390811661010052928a015183166101205260608a015190921660a0908152908901516001600160601b031660c090815290890151821661014052880151811661016052908701511661018052620002cd85620003b6565b620002d883620006ad565b604080516000815260208101909152620002f4908390620007dd565b620002ff8162000a83565b5050505050506200218a565b336001600160a01b03821603620003655760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640162000084565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b60e08101516001600160a01b0316620003e2576040516306b7c75960e31b815260040160405180910390fd5b80600560008201518160000160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060208201518160000160146101000a81548161ffff021916908361ffff16021790555060408201518160000160166101000a81548163ffffffff021916908363ffffffff160217905550606082015181600001601a6101000a81548161ffff021916908361ffff160217905550608082015181600001601c6101000a81548163ffffffff021916908363ffffffff16021790555060a08201518160010160006101000a81548161ffff021916908361ffff16021790555060c08201518160010160026101000a81548161ffff021916908361ffff16021790555060e08201518160010160046101000a8154816001600160a01b0302191690836001600160a01b031602179055506101008201518160010160186101000a81548163ffffffff021916908363ffffffff16021790555061012082015181600101601c6101000a81548163ffffffff021916908363ffffffff1602179055506101408201518160020160006101000a81548161ffff021916908361ffff1602179055506101608201518160020160026101000a81548163ffffffff021916908363ffffffff1602179055506101808201518160020160066101000a81548160ff0219169083151502179055509050507f45b5ad483aa608464c2c7f278bd413d284d7790cdc836e40652e23a02770822060405180610100016040528060e0516001600160a01b03168152602001610100516001600160401b03168152602001610120516001600160401b0316815260200160a0516001600160401b0316815260200160c0516001600160601b03168152602001610140516001600160a01b03168152602001610160516001600160a01b03168152602001610180516001600160a01b031681525082604051620006a292919062001d1c565b60405180910390a150565b60005b8151811015620007ab576000828281518110620006d157620006d162001de1565b60209081029190910181015160408051608080820183528385015163ffffffff9081168352838501516001600160401b03908116848801908152606080880151831686880190815294880151151590860190815296516001600160a01b03166000908152600b90985294909620925183549451925195511515600160a01b0260ff60a01b199688166c010000000000000000000000000296909616600160601b600160a81b031993909716640100000000026001600160601b031990951691161792909217919091169290921717905550600101620006b0565b507f067924bf9277d905a9a4631a06d959bc032ace86b3caa835ae7e403d4f39010e81604051620006a2919062001df7565b60005b8251811015620009a257600083828151811062000801576200080162001de1565b60200260200101519050602063ffffffff168160a0015163ffffffff1610156200085d57805160a08201516040516312766e0160e11b81526001600160a01b03909216600483015263ffffffff16602482015260440162000084565b6040805160e08101825260208381015163ffffffff908116835284840151811682840190815260608087015161ffff9081168688019081526080808a0151861693880193845260a0808b0151871691890191825260c0808c01511515918a019182526001908a018181529b516001600160a01b03166000908152600c9099529990972097518854955192519451915197519a519087166001600160401b031990961695909517640100000000928716929092029190911765ffffffffffff60401b191668010000000000000000939092169290920263ffffffff60501b1916176a0100000000000000000000918416919091021764ffffffffff60701b1916600160701b939092169290920260ff60901b191617600160901b941515949094029390931760ff60981b1916600160981b931515939093029290921790915501620007e0565b507ff5791bc457b3bb990493cf5f655db46c25ccf5764c9b99b8969b4c72ea7df9d082604051620009d4919062001e86565b60405180910390a160005b815181101562000a3c57600c600083838151811062000a025762000a0262001de1565b6020908102919091018101516001600160a01b0316825281019190915260400160002080546001600160a01b0319169055600101620009df565b5080511562000a7f577ffb95a0042158e60a33e7b5bec100f3d95407b1a71bee6633bd54b8887449750b8160405162000a76919062001f1b565b60405180910390a15b5050565b8051604081111562000aa857604051635ad0867d60e11b815260040160405180910390fd5b600e546c01000000000000000000000000900463ffffffff161562000afb57600e5463ffffffff6c010000000000000000000000008204166001600160601b039091161062000afb5762000afb62000c9e565b600062000b09600862000e8a565b90505b801562000b5557600062000b2f62000b2660018462001f80565b60089062000e9d565b50905062000b3f60088262000ebb565b50508062000b4d9062001f96565b905062000b0c565b506000805b8281101562000c3557600084828151811062000b7a5762000b7a62001de1565b6020026020010151600001519050600085838151811062000b9f5762000b9f62001de1565b602002602001015160200151905060e0516001600160a01b0316826001600160a01b0316148062000bd757506001600160a01b038216155b1562000c0257604051634de938d160e01b81526001600160a01b038316600482015260240162000084565b62000c1460088361ffff841662000ed9565b5062000c2561ffff82168562001fb0565b9350505080600101905062000b5a565b50600e805463ffffffff60601b19166c0100000000000000000000000063ffffffff8416021790556040517f8c337bff38141c507abd25c547606bdde78fe8c12e941ab613f3a565fea6cd249062000c91908390869062001fd0565b60405180910390a1505050565b6000546001600160a01b0316331462000cef576002546001600160a01b0316331462000cef5762000cd160083362000ef9565b62000cef5760405163032bb72b60e31b815260040160405180910390fd5b600e546c01000000000000000000000000900463ffffffff16600081900362000d2b5760405163990e30bf60e01b815260040160405180910390fd5b600e546001600160601b03168181101562000d59576040516311a1ee3b60e31b815260040160405180910390fd5b600062000d6562000f10565b121562000d8557604051631e9acf1760e31b815260040160405180910390fd5b80600062000d94600862000e8a565b905060005b8181101562000e645760008062000db260088462000e9d565b909250905060008762000dcf836001600160601b038a1662002040565b62000ddb91906200205a565b905062000de981876200207d565b60e05190965062000e0e906001600160a01b0316846001600160601b03841662000f9e565b6040516001600160601b03821681526001600160a01b038416907f55fdec2aab60a41fa5abb106670eb1006f5aeaee1ba7afea2bc89b5b3ec7678f9060200160405180910390a250505080600101905062000d99565b5050600e80546001600160601b0319166001600160601b03929092169190911790555050565b600062000e978262000ffb565b92915050565b600080808062000eae868662001008565b9097909650945050505050565b600062000ed2836001600160a01b03841662001035565b9392505050565b600062000ef1846001600160a01b0385168462001054565b949350505050565b600062000ed2836001600160a01b03841662001073565b600e5460e0516040516370a0823160e01b81523060048201526000926001600160601b0316916001600160a01b0316906370a0823190602401602060405180830381865afa15801562000f67573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000f8d9190620020a0565b62000f999190620020ba565b905090565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b0390811663a9059cbb60e01b1790915262000ff69185916200108116565b505050565b600062000e978262001152565b600080806200101885856200115d565b600081815260029690960160205260409095205494959350505050565b6000818152600283016020526040812081905562000ed283836200116b565b6000828152600284016020526040812082905562000ef1848462001179565b600062000ed2838362001187565b6040805180820190915260208082527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c656490820152600090620010d0906001600160a01b038516908490620011a0565b80519091501562000ff65780806020019051810190620010f19190620020dd565b62000ff65760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840162000084565b600062000e97825490565b600062000ed28383620011b1565b600062000ed28383620011de565b600062000ed28383620012e9565b6000818152600183016020526040812054151562000ed2565b606062000ef184846000856200133b565b6000826000018281548110620011cb57620011cb62001de1565b9060005260206000200154905092915050565b60008181526001830160205260408120548015620012d75760006200120560018362001f80565b85549091506000906200121b9060019062001f80565b9050808214620012875760008660000182815481106200123f576200123f62001de1565b906000526020600020015490508087600001848154811062001265576200126562001de1565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806200129b576200129b620020fb565b60019003818190600052602060002001600090559055856001016000868152602001908152602001600020600090556001935050505062000e97565b600091505062000e97565b5092915050565b6000818152600183016020526040812054620013325750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915562000e97565b50600062000e97565b6060824710156200139e5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840162000084565b600080866001600160a01b03168587604051620013bc919062002137565b60006040518083038185875af1925050503d8060008114620013fb576040519150601f19603f3d011682016040523d82523d6000602084013e62001400565b606091505b50909250905062001414878383876200141f565b979650505050505050565b60608315620014935782516000036200148b576001600160a01b0385163b6200148b5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640162000084565b508162000ef1565b62000ef18383815115620014aa5781518083602001fd5b8060405162461bcd60e51b815260040162000084919062002155565b634e487b7160e01b600052604160045260246000fd5b6040516101a081016001600160401b0381118282101715620015025762001502620014c6565b60405290565b60405160a081016001600160401b0381118282101715620015025762001502620014c6565b60405160e081016001600160401b0381118282101715620015025762001502620014c6565b604080519081016001600160401b0381118282101715620015025762001502620014c6565b60405161010081016001600160401b0381118282101715620015025762001502620014c6565b604051601f8201601f191681016001600160401b0381118282101715620015c857620015c8620014c6565b604052919050565b80516001600160a01b0381168114620015e857600080fd5b919050565b80516001600160401b0381168114620015e857600080fd5b805161ffff81168114620015e857600080fd5b805163ffffffff81168114620015e857600080fd5b80518015158114620015e857600080fd5b60006101a082840312156200165257600080fd5b6200165c620014dc565b90506200166982620015d0565b8152620016796020830162001605565b60208201526200168c6040830162001618565b60408201526200169f6060830162001605565b6060820152620016b26080830162001618565b6080820152620016c560a0830162001605565b60a0820152620016d860c0830162001605565b60c0820152620016eb60e08301620015d0565b60e08201526101006200170081840162001618565b908201526101206200171483820162001618565b908201526101406200172883820162001605565b908201526101606200173c83820162001618565b90820152610180620017508382016200162d565b9082015292915050565b80516001600160801b0381168114620015e857600080fd5b6000606082840312156200178557600080fd5b604051606081016001600160401b0381118282101715620017aa57620017aa620014c6565b604052905080620017bb836200162d565b8152620017cb602084016200175a565b6020820152620017de604084016200175a565b60408201525092915050565b60006001600160401b03821115620018065762001806620014c6565b5060051b60200190565b600082601f8301126200182257600080fd5b815160206200183b6200183583620017ea565b6200159d565b82815260a092830285018201928282019190878511156200185b57600080fd5b8387015b85811015620018e85781818a031215620018795760008081fd5b6200188362001508565b6200188e82620015d0565b81526200189d86830162001618565b868201526040620018b0818401620015ed565b908201526060620018c3838201620015ed565b908201526080620018d68382016200162d565b9082015284529284019281016200185f565b5090979650505050505050565b600082601f8301126200190757600080fd5b815160206200191a6200183583620017ea565b82815260e092830285018201928282019190878511156200193a57600080fd5b8387015b85811015620018e85781818a031215620019585760008081fd5b620019626200152d565b6200196d82620015d0565b81526200197c86830162001618565b8682015260406200198f81840162001618565b908201526060620019a283820162001605565b908201526080620019b583820162001618565b9082015260a0620019c883820162001618565b9082015260c0620019db8382016200162d565b9082015284529284019281016200193e565b600082601f830112620019ff57600080fd5b8151602062001a126200183583620017ea565b82815260069290921b8401810191818101908684111562001a3257600080fd5b8286015b8481101562001a88576040818903121562001a515760008081fd5b62001a5b62001552565b62001a6682620015d0565b815262001a7585830162001605565b8186015283529183019160400162001a36565b509695505050505050565b60008060008060008086880361036081121562001aaf57600080fd5b6101008082121562001ac057600080fd5b62001aca62001577565b915062001ad789620015d0565b825262001ae760208a01620015ed565b602083015262001afa60408a01620015ed565b604083015262001b0d60608a01620015ed565b606083015260808901516001600160601b038116811462001b2d57600080fd5b608083015262001b4060a08a01620015d0565b60a083015262001b5360c08a01620015d0565b60c083015262001b6660e08a01620015d0565b60e083015281975062001b7c8a828b016200163e565b9650505062001b90886102a0890162001772565b6103008801519094506001600160401b038082111562001baf57600080fd5b62001bbd8a838b0162001810565b945061032089015191508082111562001bd557600080fd5b62001be38a838b01620018f5565b935061034089015191508082111562001bfb57600080fd5b5062001c0a89828a01620019ed565b9150509295509295509295565b80516001600160a01b03168252602081015162001c3a602084018261ffff169052565b50604081015162001c53604084018263ffffffff169052565b50606081015162001c6a606084018261ffff169052565b50608081015162001c83608084018263ffffffff169052565b5060a081015162001c9a60a084018261ffff169052565b5060c081015162001cb160c084018261ffff169052565b5060e081015162001ccd60e08401826001600160a01b03169052565b506101008181015163ffffffff90811691840191909152610120808301518216908401526101408083015161ffff16908401526101608083015190911690830152610180908101511515910152565b82516001600160a01b031681526020808401516001600160401b0390811691830191909152604080850151821690830152606080850151918216908301526102a082019050608084015162001d7c60808401826001600160601b03169052565b5060a084015162001d9860a08401826001600160a01b03169052565b5060c084015162001db460c08401826001600160a01b03169052565b5060e084015162001dd060e08401826001600160a01b03169052565b5062000ed261010083018462001c17565b634e487b7160e01b600052603260045260246000fd5b602080825282518282018190526000919060409081850190868401855b8281101562001e7957815180516001600160a01b031685528681015163ffffffff1687860152858101516001600160401b03908116878701526060808301519091169086015260809081015115159085015260a0909301929085019060010162001e14565b5091979650505050505050565b602080825282518282018190526000919060409081850190868401855b8281101562001e7957815180516001600160a01b031685528681015163ffffffff908116888701528682015181168787015260608083015161ffff169087015260808083015182169087015260a0808301519091169086015260c09081015115159085015260e0909301929085019060010162001ea3565b6020808252825182820181905260009190848201906040850190845b8181101562001f5e5783516001600160a01b03168352928401929184019160010162001f37565b50909695505050505050565b634e487b7160e01b600052601160045260246000fd5b8181038181111562000e975762000e9762001f6a565b60008162001fa85762001fa862001f6a565b506000190190565b63ffffffff818116838216019080821115620012e257620012e262001f6a565b6000604080830163ffffffff8616845260206040602086015281865180845260608701915060208801935060005b818110156200203257845180516001600160a01b0316845284015161ffff1684840152938301939185019160010162001ffe565b509098975050505050505050565b808202811582820484141762000e975762000e9762001f6a565b6000826200207857634e487b7160e01b600052601260045260246000fd5b500490565b6001600160601b03828116828216039080821115620012e257620012e262001f6a565b600060208284031215620020b357600080fd5b5051919050565b8181036000831280158383131683831282161715620012e257620012e262001f6a565b600060208284031215620020f057600080fd5b62000ed2826200162d565b634e487b7160e01b600052603160045260246000fd5b60005b838110156200212e57818101518382015260200162002114565b50506000910152565b600082516200214b81846020870162002111565b9190910192915050565b60208152600082518060208401526200217681604085016020870162002111565b601f01601f19169190910160400192915050565b60805160a05160c05160e0516101005161012051610140516101605161018051615f75620022b86000396000818161036101528181610efa0152613786015260008181610332015281816116f80152613757015260008181610303015281816113ae0152818161141301528181611c7401528181611d02015261372801526000818161026f01528181610a30015281816118200152818161222201528181612b42015261369401526000818161023f01528181611dd30152613664015260008181610210015281816110a50152818161162401528181611a4101528181611b42015281816126dd015281816136350152613a240152600081816102cf01528181611c0e01526136f401526000818161029f0152818161283801526136c4015260006124b60152615f756000f3fe608060405234801561001057600080fd5b50600436106101b95760003560e01c80637437ff9f116100f9578063c92b283211610097578063eff7cc4811610071578063eff7cc48146109de578063f25561fd146109e6578063f2fde38b146109f9578063fbca3b7414610a0c57600080fd5b8063c92b2832146109b0578063d09dc339146109c3578063df0aa9e9146109cb57600080fd5b8063856c8247116100d3578063856c8247146108825780638da5cb5b146108955780639a113c36146108a6578063b06d41bc1461099a57600080fd5b80637437ff9f146106c057806376f6ae761461086757806379ba50971461087a57600080fd5b806348a98aa411610166578063549e946f11610140578063549e946f1461066957806354b714681461067c578063599f64311461069c578063704b6c02146106ad57600080fd5b806348a98aa4146105c7578063504bffe0146105f2578063546719cd1461060557600080fd5b806320487ded1161019757806320487ded146105705780634120fccd146105915780634816f4f7146105b257600080fd5b806306285c69146101be5780631772047e146103a7578063181f5a7714610527575b600080fd5b6103916040805161010081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e08101919091526040518061010001604052807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031681526020017f000000000000000000000000000000000000000000000000000000000000000067ffffffffffffffff1681526020017f000000000000000000000000000000000000000000000000000000000000000067ffffffffffffffff1681526020017f000000000000000000000000000000000000000000000000000000000000000067ffffffffffffffff1681526020017f00000000000000000000000000000000000000000000000000000000000000006bffffffffffffffffffffffff1681526020017f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031681526020017f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031681526020017f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316815250905090565b60405161039e9190614b86565b60405180910390f35b6104bb6103b5366004614bba565b6040805160e081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810191909152506001600160a01b03166000908152600c6020908152604091829020825160e081018452905463ffffffff8082168352640100000000820481169383019390935261ffff68010000000000000000820416938201939093526a01000000000000000000008304821660608201526e0100000000000000000000000000008304909116608082015260ff720100000000000000000000000000000000000083048116151560a0830152730100000000000000000000000000000000000000909204909116151560c082015290565b60405161039e9190600060e08201905063ffffffff80845116835280602085015116602084015261ffff60408501511660408401528060608501511660608401528060808501511660808401525060a0830151151560a083015260c0830151151560c083015292915050565b6105636040518060400160405280601381526020017f45564d3245564d4f6e52616d7020312e352e300000000000000000000000000081525081565b60405161039e9190614c27565b61058361057e366004614c68565b610a2c565b60405190815260200161039e565b610599610e82565b60405167ffffffffffffffff909116815260200161039e565b6105c56105c0366004614e76565b610ea9565b005b6105da6105d5366004614fb3565b610ebf565b6040516001600160a01b03909116815260200161039e565b6105c5610600366004614fec565b610f6e565b61060d610f82565b60405161039e919081516fffffffffffffffffffffffffffffffff908116825260208084015163ffffffff1690830152604080840151151590830152606080840151821690830152608092830151169181019190915260a00190565b6105c56106773660046150ea565b611014565b600e546040516bffffffffffffffffffffffff909116815260200161039e565b6002546001600160a01b03166105da565b6105c56106bb366004614bba565b61118d565b61085a604080516101a081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e08101829052610100810182905261012081018290526101408101829052610160810182905261018081019190915250604080516101a0810182526005546001600160a01b038082168352600160a01b820461ffff9081166020850152760100000000000000000000000000000000000000000000830463ffffffff908116958501959095527a0100000000000000000000000000000000000000000000000000008304811660608501527c0100000000000000000000000000000000000000000000000000000000928390048516608085015260065480821660a086015262010000808204831660c0870152640100000000820490931660e08601527801000000000000000000000000000000000000000000000000810486166101008601529290920484166101208401526007549182166101408401528104909216610160820152660100000000000090910460ff16151561018082015290565b60405161039e9190615206565b6105c5610875366004615215565b611257565b6105c56112ba565b610599610890366004614bba565b611383565b6000546001600160a01b03166105da565b6109506108b4366004614bba565b604080516080810182526000808252602082018190529181018290526060810191909152506001600160a01b03166000908152600b60209081526040918290208251608081018452905463ffffffff8116825267ffffffffffffffff64010000000082048116938301939093526c0100000000000000000000000081049092169281019290925260ff600160a01b909104161515606082015290565b60408051825163ffffffff16815260208084015167ffffffffffffffff9081169183019190915283830151169181019190915260609182015115159181019190915260800161039e565b6109a261147e565b60405161039e9291906152de565b6105c56109be366004615320565b611579565b6105836115e1565b6105836109d936600461538e565b6116a1565b6105c561252a565b6105c56109f43660046153fa565b6127af565b6105c5610a07366004614bba565b6127c0565b610a1f610a1a3660046154f9565b6127d1565b60405161039e9190615516565b60007f000000000000000000000000000000000000000000000000000000000000000067ffffffffffffffff168367ffffffffffffffff1614610aac576040517fd9a9cd6800000000000000000000000000000000000000000000000000000000815267ffffffffffffffff841660048201526024015b60405180910390fd5b6000610ac3610abe6080850185615563565b612805565b9050610af3610ad56020850185615563565b8351909150610ae760408701876155c8565b90508460200151612992565b6000600b81610b086080870160608801614bba565b6001600160a01b0316815260208082019290925260409081016000208151608081018352905463ffffffff81168252640100000000810467ffffffffffffffff908116948301949094526c01000000000000000000000000810490931691810191909152600160a01b90910460ff16151560608201819052909150610bd557610b976080850160608601614bba565b6040517fa7499d200000000000000000000000000000000000000000000000000000000081526001600160a01b039091166004820152602401610aa3565b600654600090819064010000000090046001600160a01b031663ffdb4b37610c036080890160608a01614bba565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b1681526001600160a01b03909116600482015267ffffffffffffffff8a1660248201526044016040805180830381865afa158015610c6e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c92919061565c565b90925090506000808080610ca960408b018b6155c8565b90501115610ce357610cd7610cc460808b0160608c01614bba565b86610cd260408d018d6155c8565b612af7565b91945092509050610cff565b8551610cfc9063ffffffff16662386f26fc100006156a5565b92505b60065460009062010000900461ffff1615610d5357610d506dffffffffffffffffffffffffffff607087901c16610d3960208d018d615563565b9050610d4860408e018e6155c8565b905085612ec6565b90505b60208781015160055460009267ffffffffffffffff9092169163ffffffff8716917a010000000000000000000000000000000000000000000000000000900461ffff1690610da3908f018f615563565b610dae9291506156a5565b6005548c51610ddd91760100000000000000000000000000000000000000000000900463ffffffff16906156bc565b610de791906156bc565b610df191906156bc565b610e0b906dffffffffffffffffffffffffffff89166156a5565b610e1591906156a5565b9050867bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1682828a6040015167ffffffffffffffff1688610e5291906156a5565b610e5c91906156bc565b610e6691906156bc565b610e7091906156cf565b99505050505050505050505b92915050565b600e54600090610ea490600160801b900467ffffffffffffffff1660016156f1565b905090565b610eb1612f97565b610ebb8282612fef565b5050565b6040517fbbe4f6db0000000000000000000000000000000000000000000000000000000081526001600160a01b0382811660048301526000917f00000000000000000000000000000000000000000000000000000000000000009091169063bbe4f6db90602401602060405180830381865afa158015610f43573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f679190615712565b9392505050565b610f76613371565b610f7f816133cb565b50565b6040805160a0810182526000808252602082018190529181018290526060810182905260808101919091526040805160a0810182526003546fffffffffffffffffffffffffffffffff8082168352600160801b80830463ffffffff166020850152600160a01b90920460ff161515938301939093526004548084166060840152049091166080820152610ea4906137c0565b61101c612f97565b6001600160a01b03811661105c576040517f232cb97f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006110666115e1565b905060008112156110a3576040517f02075e0000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316836001600160a01b0316036110f5576110f06001600160a01b0384168383613872565b505050565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526110f09083906001600160a01b038616906370a0823190602401602060405180830381865afa158015611158573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061117c919061572f565b6001600160a01b0386169190613872565b6000546001600160a01b031633148015906111b357506002546001600160a01b03163314155b156111ea576040517ff6cd562000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600280547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0383169081179091556040519081527f8fe72c3e0020beb3234e76ae6676fa576fbfcae600af1c4fea44784cf0db329c906020015b60405180910390a150565b61125f612f97565b610ebb8282808060200260200160405190810160405280939291908181526020016000905b828210156112b0576112a160408302860136819003810190615748565b81526020019060010190611284565b50505050506138f2565b6001546001600160a01b031633146113145760405162461bcd60e51b815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e6572000000000000000000006044820152606401610aa3565b60008054337fffffffffffffffffffffffff0000000000000000000000000000000000000000808316821784556001805490911690556040516001600160a01b0390921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b6001600160a01b038082166000908152600d6020526040812054909167ffffffffffffffff909116907f00000000000000000000000000000000000000000000000000000000000000001615610e7c5780600003610e7c576040517f856c82470000000000000000000000000000000000000000000000000000000081526001600160a01b0384811660048301527f0000000000000000000000000000000000000000000000000000000000000000169063856c824790602401602060405180830381865afa15801561145a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f679190615787565b606060008061148d6008613b58565b90508067ffffffffffffffff8111156114a8576114a8614cb8565b6040519080825280602002602001820160405280156114ed57816020015b60408051808201909152600080825260208201528152602001906001900390816114c65790505b50925060005b8181101561155657600080611509600884613b63565b915091506040518060400160405280836001600160a01b031681526020018261ffff16815250868481518110611541576115416157a4565b602090810291909101015250506001016114f3565b5050600e5491926c0100000000000000000000000090920463ffffffff16919050565b6000546001600160a01b0316331480159061159f57506002546001600160a01b03163314155b156115d6576040517ff6cd562000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610f7f600382613b81565b600e546040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526000916bffffffffffffffffffffffff16907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa158015611673573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611697919061572f565b610ea491906157ba565b6040517f2cbc26bb00000000000000000000000000000000000000000000000000000000815277ffffffffffffffff00000000000000000000000000000000608086901b1660048201526000906001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690632cbc26bb90602401602060405180830381865afa15801561173f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061176391906157da565b1561179a576040517f53ad11d800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b0382166117da576040517fa4ec747900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6005546001600160a01b0316331461181e576040517f1c0a352900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000067ffffffffffffffff168567ffffffffffffffff1614611897576040517fd9a9cd6800000000000000000000000000000000000000000000000000000000815267ffffffffffffffff86166004820152602401610aa3565b60006118a9610abe6080870187615563565b905060006118ba60408701876155c8565b91506118e090506118ce6020880188615563565b90508360000151838560200151612992565b8015611a37576000805b82811015611a25576118ff60408901896155c8565b8281811061190f5761190f6157a4565b90506040020160200135600003611952576040517f5cf0444900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600c600061196360408b018b6155c8565b84818110611973576119736157a4565b6119899260206040909202019081019150614bba565b6001600160a01b031681526020810191909152604001600020547201000000000000000000000000000000000000900460ff1615611a1d57611a106119d160408a018a6155c8565b838181106119e1576119e16157a4565b9050604002018036038101906119f791906157f7565b60065464010000000090046001600160a01b0316613d14565b611a1a90836156bc565b91505b6001016118ea565b508015611a3557611a3581613e35565b505b6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016611a716080880160608901614bba565b6001600160a01b031603611ad557600e8054869190600090611aa29084906bffffffffffffffffffffffff16615831565b92506101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff160217905550611bfc565b60065464010000000090046001600160a01b03166241e5be611afd6080890160608a01614bba565b60405160e083901b7fffffffff000000000000000000000000000000000000000000000000000000001681526001600160a01b039182166004820152602481018990527f00000000000000000000000000000000000000000000000000000000000000009091166044820152606401602060405180830381865afa158015611b89573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611bad919061572f565b600e8054600090611bcd9084906bffffffffffffffffffffffff16615831565b92506101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055505b600e546bffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000811691161115611c69576040517fe5c7a49100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8160200151611dbd577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031615611dbd576001600160a01b0384166000908152600d602052604081205467ffffffffffffffff169003611dbd576040517f856c82470000000000000000000000000000000000000000000000000000000081526001600160a01b0385811660048301527f0000000000000000000000000000000000000000000000000000000000000000169063856c824790602401602060405180830381865afa158015611d49573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d6d9190615787565b6001600160a01b0385166000908152600d6020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000001667ffffffffffffffff929092169190911790555b604080516101a08101825267ffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001681526001600160a01b03861660208201526000918101611e50611e168a80615563565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250613e4292505050565b6001600160a01b03168152602001600e601081819054906101000a900467ffffffffffffffff16611e8090615856565b91906101000a81548167ffffffffffffffff021916908367ffffffffffffffff160217905567ffffffffffffffff168152602001846000015181526020016000151581526020018460200151611f2a576001600160a01b0387166000908152600d602052604081208054909190611f009067ffffffffffffffff16615856565b91906101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055611f2d565b60005b67ffffffffffffffff168152602001611f4c60808a0160608b01614bba565b6001600160a01b03168152602001878152602001888060200190611f709190615563565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250505090825250602001611fb760408a018a6155c8565b808060200260200160405190810160405280939291908181526020016000905b8282101561200357611ff4604083028601368190038101906157f7565b81526020019060010190611fd7565b505050505081526020018367ffffffffffffffff81111561202657612026614cb8565b60405190808252806020026020018201604052801561205957816020015b60608152602001906001900390816120445790505b508152600060209091018190529091505b828110156124af57600061208160408a018a6155c8565b83818110612091576120916157a4565b9050604002018036038101906120a791906157f7565b905060006120b98b8360000151610ebf565b90506001600160a01b038116158061216f57506040517f01ffc9a70000000000000000000000000000000000000000000000000000000081527faff2afbf0000000000000000000000000000000000000000000000000000000060048201526001600160a01b038216906301ffc9a790602401602060405180830381865afa158015612149573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061216d91906157da565b155b156121b45781516040517fbf16aab60000000000000000000000000000000000000000000000000000000081526001600160a01b039091166004820152602401610aa3565b6000816001600160a01b0316639a4575b96040518060a001604052808e80600001906121e09190615563565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050509082525067ffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000166020808301919091526001600160a01b03808f16604080850191909152918901516060840152885116608090920191909152517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b1681526122ab919060040161587d565b6000604051808303816000875af11580156122ca573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526122f2919081019061594a565b9050602063ffffffff1681602001515111156123895782516001600160a01b03166000908152600c602090815260409091205490820151516e01000000000000000000000000000090910463ffffffff1610156123895782516040517f36f536ca0000000000000000000000000000000000000000000000000000000081526001600160a01b039091166004820152602401610aa3565b805161239490613e42565b5060408051608081019091526001600160a01b03831660a08201528060c0810160408051808303601f190181529181529082528351602080840191909152808501518383015286516001600160a01b03166000908152600c9091522054606090910190730100000000000000000000000000000000000000900460ff166124295760075462010000900463ffffffff16612458565b84516001600160a01b03166000908152600c60205260409020546a0100000000000000000000900463ffffffff165b63ffffffff16905260405161247091906020016159db565b6040516020818303038152906040528561016001518581518110612496576124966157a4565b602002602001018190525050505080600101905061206a565b506124da817f0000000000000000000000000000000000000000000000000000000000000000613ee8565b6101808201526040517fd0c3c799bf9e2639de44391e7f524d229b2b55f5b1ea94b2bf7da42f7243dddd90612510908390615aef565b60405180910390a16101800151925050505b949350505050565b6000546001600160a01b0316331461258f576002546001600160a01b0316331461258f57612559600833614043565b61258f576040517f195db95800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600e546c01000000000000000000000000900463ffffffff1660008190036125e3576040517f990e30bf00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600e546bffffffffffffffffffffffff168181101561262e576040517f8d0f71d800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006126386115e1565b1215612670576040517ff4d678b800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80600061267d6008613b58565b905060005b8181101561276c57600080612698600884613b63565b90925090506000876126b8836bffffffffffffffffffffffff8a166156a5565b6126c291906156cf565b90506126ce8187615c24565b95506127126001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016846bffffffffffffffffffffffff8416613872565b6040516bffffffffffffffffffffffff821681526001600160a01b038416907f55fdec2aab60a41fa5abb106670eb1006f5aeaee1ba7afea2bc89b5b3ec7678f9060200160405180910390a2505050806001019050612682565b5050600e80547fffffffffffffffffffffffffffffffffffffffff000000000000000000000000166bffffffffffffffffffffffff929092169190911790555050565b6127b7612f97565b610f7f81614058565b6127c8613371565b610f7f816141ca565b60606040517f9e7177c800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040805180820190915260008082526020820152600082900361286657506040805180820190915267ffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016815260006020820152610e7c565b60006128728385615c49565b90507fe7e230f0000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008216016128df576128ca8360048187615c91565b8101906128d79190615cbb565b915050610e7c565b7f6859a837000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008216016129605760408051808201909152806129408560048189615c91565b81019061294d9190615ce7565b815260006020909101529150610e7c9050565b6040517f5247fdce00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6006547801000000000000000000000000000000000000000000000000900463ffffffff16808511156129fb576040517f869337890000000000000000000000000000000000000000000000000000000081526004810182905260248101869052604401610aa3565b6006547c0100000000000000000000000000000000000000000000000000000000900463ffffffff16841115612a5d576040517f4c4fc93a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600554600160a01b900461ffff16831115612aa4576040517f4c056b6a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b81612af0576007546601000000000000900460ff1615612af0576040517fee433e9900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5050505050565b6000808083815b81811015612eba576000878783818110612b1a57612b1a6157a4565b905060400201803603810190612b3091906157f7565b905060006001600160a01b0316612b6b7f00000000000000000000000000000000000000000000000000000000000000008360000151610ebf565b6001600160a01b031603612bb95780516040517fbf16aab60000000000000000000000000000000000000000000000000000000081526001600160a01b039091166004820152602401610aa3565b80516001600160a01b03166000908152600c6020908152604091829020825160e081018452905463ffffffff8082168352640100000000820481169383019390935261ffff68010000000000000000820416938201939093526a01000000000000000000008304821660608201526e0100000000000000000000000000008304909116608082015260ff720100000000000000000000000000000000000083048116151560a0830152730100000000000000000000000000000000000000909204909116151560c08201819052612cde57600754612ca29061ffff16662386f26fc100006156a5565b612cac90886156bc565b600754909750612cc89062010000900463ffffffff1687615d00565b9550612cd5602086615d00565b94505050612eb2565b604081015160009061ffff1615612e025760008c6001600160a01b031684600001516001600160a01b031614612da55760065484516040517f4ab35b0b0000000000000000000000000000000000000000000000000000000081526001600160a01b0391821660048201526401000000009092041690634ab35b0b90602401602060405180830381865afa158015612d7a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d9e9190615d1d565b9050612da8565b508a5b620186a0836040015161ffff16612dea8660200151847bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1661428b90919063ffffffff16565b612df491906156a5565b612dfe91906156cf565b9150505b6060820151612e119088615d00565b9650816080015186612e239190615d00565b8251909650600090612e429063ffffffff16662386f26fc100006156a5565b905080821015612e6157612e56818a6156bc565b985050505050612eb2565b6000836020015163ffffffff16662386f26fc10000612e8091906156a5565b905080831115612ea057612e94818b6156bc565b99505050505050612eb2565b612eaa838b6156bc565b995050505050505b600101612afe565b50509450945094915050565b60008063ffffffff8316612edc610180866156a5565b612ee8876102206156bc565b612ef291906156bc565b612efc91906156bc565b6005546006549192506000917c010000000000000000000000000000000000000000000000000000000090910463ffffffff1690612f3e9061ffff16846156a5565b612f4891906156bc565b60065490915062010000900461ffff16612f726dffffffffffffffffffffffffffff8916836156a5565b612f7c91906156a5565b612f8c90655af3107a40006156a5565b979650505050505050565b6000546001600160a01b03163314612fed576002546001600160a01b03163314612fed576040517ffbdb8e5600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b565b60005b825181101561328357600083828151811061300f5761300f6157a4565b60200260200101519050602063ffffffff168160a0015163ffffffff16101561308257805160a08201516040517f24ecdc020000000000000000000000000000000000000000000000000000000081526001600160a01b03909216600483015263ffffffff166024820152604401610aa3565b6040805160e08101825260208381015163ffffffff908116835284840151811682840190815260608087015161ffff9081168688019081526080808a0151861693880193845260a0808b0151871691890191825260c0808c01511515918a019182526001908a018181529b516001600160a01b03166000908152600c9099529990972097518854955192519451915197519a519087167fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000009096169590951764010000000092871692909202919091177fffffffffffffffffffffffffffffffffffff000000000000ffffffffffffffff166801000000000000000093909216929092027fffffffffffffffffffffffffffffffffffff00000000ffffffffffffffffffff16176a010000000000000000000091841691909102177fffffffffffffffffffffffffff0000000000ffffffffffffffffffffffffffff166e01000000000000000000000000000093909216929092027fffffffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffff1617720100000000000000000000000000000000000094151594909402939093177fffffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffff16730100000000000000000000000000000000000000931515939093029290921790915501612ff2565b507ff5791bc457b3bb990493cf5f655db46c25ccf5764c9b99b8969b4c72ea7df9d0826040516132b39190615d38565b60405180910390a160005b815181101561332e57600c60008383815181106132dd576132dd6157a4565b6020908102919091018101516001600160a01b0316825281019190915260400160002080547fffffffffffffffffffffffff00000000000000000000000000000000000000001690556001016132be565b50805115610ebb577ffb95a0042158e60a33e7b5bec100f3d95407b1a71bee6633bd54b8887449750b816040516133659190615516565b60405180910390a15050565b6000546001600160a01b03163314612fed5760405162461bcd60e51b815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e6572000000000000000000006044820152606401610aa3565b60e08101516001600160a01b031661340f576040517f35be3ac800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80600560008201518160000160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060208201518160000160146101000a81548161ffff021916908361ffff16021790555060408201518160000160166101000a81548163ffffffff021916908363ffffffff160217905550606082015181600001601a6101000a81548161ffff021916908361ffff160217905550608082015181600001601c6101000a81548163ffffffff021916908363ffffffff16021790555060a08201518160010160006101000a81548161ffff021916908361ffff16021790555060c08201518160010160026101000a81548161ffff021916908361ffff16021790555060e08201518160010160046101000a8154816001600160a01b0302191690836001600160a01b031602179055506101008201518160010160186101000a81548163ffffffff021916908363ffffffff16021790555061012082015181600101601c6101000a81548163ffffffff021916908363ffffffff1602179055506101408201518160020160006101000a81548161ffff021916908361ffff1602179055506101608201518160020160026101000a81548163ffffffff021916908363ffffffff1602179055506101808201518160020160066101000a81548160ff0219169083151502179055509050507f45b5ad483aa608464c2c7f278bd413d284d7790cdc836e40652e23a0277082206040518061010001604052807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031681526020017f000000000000000000000000000000000000000000000000000000000000000067ffffffffffffffff1681526020017f000000000000000000000000000000000000000000000000000000000000000067ffffffffffffffff1681526020017f000000000000000000000000000000000000000000000000000000000000000067ffffffffffffffff1681526020017f00000000000000000000000000000000000000000000000000000000000000006bffffffffffffffffffffffff1681526020017f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031681526020017f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031681526020017f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152508260405161124c929190615dd8565b6040805160a08101825260008082526020820181905291810182905260608101829052608081019190915261384e82606001516fffffffffffffffffffffffffffffffff1683600001516fffffffffffffffffffffffffffffffff16846020015163ffffffff16426138329190615df5565b85608001516fffffffffffffffffffffffffffffffff166142c8565b6fffffffffffffffffffffffffffffffff1682525063ffffffff4216602082015290565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb000000000000000000000000000000000000000000000000000000001790526110f09084906142f0565b8051604081111561392f576040517fb5a10cfa00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600e546c01000000000000000000000000900463ffffffff161561398357600e5463ffffffff6c010000000000000000000000008204166bffffffffffffffffffffffff909116106139835761398361252a565b600061398f6008613b58565b90505b80156139d15760006139b06139a8600184615df5565b600890613b63565b5090506139be6008826143d5565b5050806139ca90615e08565b9050613992565b506000805b82811015613ad95760008482815181106139f2576139f26157a4565b60200260200101516000015190506000858381518110613a1457613a146157a4565b60200260200101516020015190507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b03161480613a6957506001600160a01b038216155b15613aab576040517f4de938d10000000000000000000000000000000000000000000000000000000081526001600160a01b0383166004820152602401610aa3565b613abb60088361ffff84166143ea565b50613aca61ffff821685615d00565b935050508060010190506139d6565b50600e80547fffffffffffffffffffffffffffffffff00000000ffffffffffffffffffffffff166c0100000000000000000000000063ffffffff8416021790556040517f8c337bff38141c507abd25c547606bdde78fe8c12e941ab613f3a565fea6cd2490613b4b9083908690615e3d565b60405180910390a1505050565b6000610e7c82614400565b6000808080613b72868661440b565b909450925050505b9250929050565b8154600090613b9d90600160801b900463ffffffff1642615df5565b90508015613c255760018301548354613bd8916fffffffffffffffffffffffffffffffff808216928116918591600160801b909104166142c8565b83546fffffffffffffffffffffffffffffffff919091167fffffffffffffffffffffffff000000000000000000000000000000000000000090911617600160801b4263ffffffff16021783555b60208201518354613c4b916fffffffffffffffffffffffffffffffff9081169116614436565b835483511515600160a01b027fffffffffffffffffffffff00ffffffff000000000000000000000000000000009091166fffffffffffffffffffffffffffffffff9283161717845560208301516040808501518316600160801b0291909216176001850155517f9ea3374b67bf275e6bb9c8ae68f9cae023e1c528b4b27e092f0bb209d3531c1990613b4b9084908151151581526020808301516fffffffffffffffffffffffffffffffff90811691830191909152604092830151169181019190915260600190565b81516040517fd02641a00000000000000000000000000000000000000000000000000000000081526001600160a01b03918216600482015260009182919084169063d02641a0906024016040805180830381865afa158015613d7a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613d9e9190615e5c565b5190507bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8116600003613e075783516040517f9a655f7b0000000000000000000000000000000000000000000000000000000081526001600160a01b039091166004820152602401610aa3565b6020840151612522907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83169061428b565b610f7f600382600061444c565b60008151602014613e8157816040517f8d666f60000000000000000000000000000000000000000000000000000000008152600401610aa39190614c27565b600082806020019051810190613e97919061572f565b90506001600160a01b03811180613eaf575061040081105b15610e7c57826040517f8d666f60000000000000000000000000000000000000000000000000000000008152600401610aa39190614c27565b60008060001b8284602001518560400151866060015187608001518860a001518960c001518a60e001518b6101000151604051602001613f7e9897969594939291906001600160a01b039889168152968816602088015267ffffffffffffffff95861660408801526060870194909452911515608086015290921660a0840152921660c082015260e08101919091526101000190565b6040516020818303038152906040528051906020012085610120015180519060200120866101400151604051602001613fb79190615e8f565b60405160208183030381529060405280519060200120876101600151604051602001613fe39190615ea2565b60408051601f198184030181528282528051602091820120908301979097528101949094526060840192909252608083015260a082015260c081019190915260e00160405160208183030381529060405280519060200120905092915050565b6000610f67836001600160a01b038416614756565b60005b815181101561419a576000828281518110614078576140786157a4565b60209081029190910181015160408051608080820183528385015163ffffffff90811683528385015167ffffffffffffffff908116848801908152606080880151831686880190815294880151151590860190815296516001600160a01b03166000908152600b90985294909620925183549451925195511515600160a01b027fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff9688166c0100000000000000000000000002969096167fffffffffffffffffffffff000000000000000000ffffffffffffffffffffffff93909716640100000000027fffffffffffffffffffffffffffffffffffffffff0000000000000000000000009095169116179290921791909116929092171790555060010161405b565b507f067924bf9277d905a9a4631a06d959bc032ace86b3caa835ae7e403d4f39010e8160405161124c9190615eb5565b336001600160a01b038216036142225760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c660000000000000000006044820152606401610aa3565b600180547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b6000670de0b6b3a76400006142be837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff86166156a5565b610f6791906156cf565b60006142e7856142d884866156a5565b6142e290876156bc565b614436565b95945050505050565b6000614345826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166147629092919063ffffffff16565b8051909150156110f0578080602001905181019061436391906157da565b6110f05760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610aa3565b6000610f67836001600160a01b038416614771565b6000612522846001600160a01b0385168461478e565b6000610e7c826147ab565b6000808061441985856147b5565b600081815260029690960160205260409095205494959350505050565b60008183106144455781610f67565b5090919050565b8254600160a01b900460ff161580614462575081155b1561446c57505050565b825460018401546fffffffffffffffffffffffffffffffff808316929116906000906144a590600160801b900463ffffffff1642615df5565b9050801561454b57818311156144e7576040517f9725942a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600186015461451490839085908490600160801b90046fffffffffffffffffffffffffffffffff166142c8565b86547fffffffffffffffffffffffff00000000ffffffffffffffffffffffffffffffff16600160801b4263ffffffff160217875592505b848210156145e8576001600160a01b03841661459d576040517ff94ebcd10000000000000000000000000000000000000000000000000000000081526004810183905260248101869052604401610aa3565b6040517f1a76572a00000000000000000000000000000000000000000000000000000000815260048101839052602481018690526001600160a01b0385166044820152606401610aa3565b848310156146d457600186810154600160801b90046fffffffffffffffffffffffffffffffff1690600090829061461f9082615df5565b614629878a615df5565b61463391906156bc565b61463d91906156cf565b90506001600160a01b038616614689576040517f15279c080000000000000000000000000000000000000000000000000000000081526004810182905260248101869052604401610aa3565b6040517fd0c8d23a00000000000000000000000000000000000000000000000000000000815260048101829052602481018690526001600160a01b0387166044820152606401610aa3565b6146de8584615df5565b86547fffffffffffffffffffffffffffffffff00000000000000000000000000000000166fffffffffffffffffffffffffffffffff82161787556040518681529093507f1871cdf8010e63f2eb8384381a68dfa7416dc571a5517e66e88b2d2d0c0a690a9060200160405180910390a1505050505050565b6000610f6783836147c1565b606061252284846000856147d9565b60008181526002830160205260408120819055610f6783836148c0565b6000828152600284016020526040812082905561252284846148cc565b6000610e7c825490565b6000610f6783836148d8565b60008181526001830160205260408120541515610f67565b6060824710156148515760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610aa3565b600080866001600160a01b0316858760405161486d9190615f36565b60006040518083038185875af1925050503d80600081146148aa576040519150601f19603f3d011682016040523d82523d6000602084013e6148af565b606091505b5091509150612f8c87838387614902565b6000610f67838361497b565b6000610f678383614a75565b60008260000182815481106148ef576148ef6157a4565b9060005260206000200154905092915050565b6060831561497157825160000361496a576001600160a01b0385163b61496a5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610aa3565b5081612522565b6125228383614ac4565b60008181526001830160205260408120548015614a6457600061499f600183615df5565b85549091506000906149b390600190615df5565b9050808214614a185760008660000182815481106149d3576149d36157a4565b90600052602060002001549050808760000184815481106149f6576149f66157a4565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080614a2957614a29615f52565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610e7c565b6000915050610e7c565b5092915050565b6000818152600183016020526040812054614abc57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610e7c565b506000610e7c565b815115614ad45781518083602001fd5b8060405162461bcd60e51b8152600401610aa39190614c27565b6001600160a01b03808251168352602082015167ffffffffffffffff808216602086015280604085015116604086015280606085015116606086015250506bffffffffffffffffffffffff60808301511660808401528060a08301511660a08401525060c0810151614b6b60c08401826001600160a01b03169052565b5060e08101516110f060e08401826001600160a01b03169052565b6101008101610e7c8284614aee565b6001600160a01b0381168114610f7f57600080fd5b8035614bb581614b95565b919050565b600060208284031215614bcc57600080fd5b8135610f6781614b95565b60005b83811015614bf2578181015183820152602001614bda565b50506000910152565b60008151808452614c13816020860160208601614bd7565b601f01601f19169290920160200192915050565b602081526000610f676020830184614bfb565b67ffffffffffffffff81168114610f7f57600080fd5b600060a08284031215614c6257600080fd5b50919050565b60008060408385031215614c7b57600080fd5b8235614c8681614c3a565b9150602083013567ffffffffffffffff811115614ca257600080fd5b614cae85828601614c50565b9150509250929050565b634e487b7160e01b600052604160045260246000fd5b60405160e0810167ffffffffffffffff81118282101715614cf157614cf1614cb8565b60405290565b6040516101a0810167ffffffffffffffff81118282101715614cf157614cf1614cb8565b60405160a0810167ffffffffffffffff81118282101715614cf157614cf1614cb8565b6040805190810167ffffffffffffffff81118282101715614cf157614cf1614cb8565b604051601f8201601f1916810167ffffffffffffffff81118282101715614d8a57614d8a614cb8565b604052919050565b600067ffffffffffffffff821115614dac57614dac614cb8565b5060051b60200190565b63ffffffff81168114610f7f57600080fd5b8035614bb581614db6565b803561ffff81168114614bb557600080fd5b8015158114610f7f57600080fd5b8035614bb581614de5565b600082601f830112614e0f57600080fd5b81356020614e24614e1f83614d92565b614d61565b8083825260208201915060208460051b870101935086841115614e4657600080fd5b602086015b84811015614e6b578035614e5e81614b95565b8352918301918301614e4b565b509695505050505050565b6000806040808486031215614e8a57600080fd5b833567ffffffffffffffff80821115614ea257600080fd5b818601915086601f830112614eb657600080fd5b81356020614ec6614e1f83614d92565b82815260e0928302850182019282820191908b851115614ee557600080fd5b958301955b84871015614f8e5780878d031215614f025760008081fd5b614f0a614cce565b8735614f1581614b95565b815287850135614f2481614db6565b8186015287890135614f3581614db6565b818a01526060614f46898201614dd3565b90820152608088810135614f5981614db6565b9082015260a0614f6a898201614dc8565b9082015260c0614f7b898201614df3565b9082015283529586019591830191614eea565b5097505087013593505080831115614fa557600080fd5b5050614cae85828601614dfe565b60008060408385031215614fc657600080fd5b8235614fd181614c3a565b91506020830135614fe181614b95565b809150509250929050565b60006101a08284031215614fff57600080fd5b615007614cf7565b61501083614baa565b815261501e60208401614dd3565b602082015261502f60408401614dc8565b604082015261504060608401614dd3565b606082015261505160808401614dc8565b608082015261506260a08401614dd3565b60a082015261507360c08401614dd3565b60c082015261508460e08401614baa565b60e0820152610100615097818501614dc8565b908201526101206150a9848201614dc8565b908201526101406150bb848201614dd3565b908201526101606150cd848201614dc8565b908201526101806150df848201614df3565b908201529392505050565b600080604083850312156150fd57600080fd5b8235614fd181614b95565b80516001600160a01b03168252602081015161512a602084018261ffff169052565b506040810151615142604084018263ffffffff169052565b506060810151615158606084018261ffff169052565b506080810151615170608084018263ffffffff169052565b5060a081015161518660a084018261ffff169052565b5060c081015161519c60c084018261ffff169052565b5060e08101516151b760e08401826001600160a01b03169052565b506101008181015163ffffffff90811691840191909152610120808301518216908401526101408083015161ffff16908401526101608083015190911690830152610180908101511515910152565b6101a08101610e7c8284615108565b6000806020838503121561522857600080fd5b823567ffffffffffffffff8082111561524057600080fd5b818501915085601f83011261525457600080fd5b81358181111561526357600080fd5b8660208260061b850101111561527857600080fd5b60209290920196919550909350505050565b60008151808452602080850194506020840160005b838110156152d357815180516001600160a01b0316885283015161ffff16838801526040909601959082019060010161529f565b509495945050505050565b6040815260006152f1604083018561528a565b90508260208301529392505050565b80356fffffffffffffffffffffffffffffffff81168114614bb557600080fd5b60006060828403121561533257600080fd5b6040516060810181811067ffffffffffffffff8211171561535557615355614cb8565b604052823561536381614de5565b815261537160208401615300565b602082015261538260408401615300565b60408201529392505050565b600080600080608085870312156153a457600080fd5b84356153af81614c3a565b9350602085013567ffffffffffffffff8111156153cb57600080fd5b6153d787828801614c50565b9350506040850135915060608501356153ef81614b95565b939692955090935050565b6000602080838503121561540d57600080fd5b823567ffffffffffffffff81111561542457600080fd5b8301601f8101851361543557600080fd5b8035615443614e1f82614d92565b81815260a0918202830184019184820191908884111561546257600080fd5b938501935b838510156154ed5780858a03121561547f5760008081fd5b615487614d1b565b853561549281614b95565b8152858701356154a181614db6565b818801526040868101356154b481614c3a565b908201526060868101356154c781614c3a565b908201526080868101356154da81614de5565b9082015283529384019391850191615467565b50979650505050505050565b60006020828403121561550b57600080fd5b8135610f6781614c3a565b6020808252825182820181905260009190848201906040850190845b818110156155575783516001600160a01b031683529284019291840191600101615532565b50909695505050505050565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe184360301811261559857600080fd5b83018035915067ffffffffffffffff8211156155b357600080fd5b602001915036819003821315613b7a57600080fd5b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe18436030181126155fd57600080fd5b83018035915067ffffffffffffffff82111561561857600080fd5b6020019150600681901b3603821315613b7a57600080fd5b80517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff81168114614bb557600080fd5b6000806040838503121561566f57600080fd5b61567883615630565b915061568660208401615630565b90509250929050565b634e487b7160e01b600052601160045260246000fd5b8082028115828204841417610e7c57610e7c61568f565b80820180821115610e7c57610e7c61568f565b6000826156ec57634e487b7160e01b600052601260045260246000fd5b500490565b67ffffffffffffffff818116838216019080821115614a6e57614a6e61568f565b60006020828403121561572457600080fd5b8151610f6781614b95565b60006020828403121561574157600080fd5b5051919050565b60006040828403121561575a57600080fd5b615762614d3e565b823561576d81614b95565b815261577b60208401614dd3565b60208201529392505050565b60006020828403121561579957600080fd5b8151610f6781614c3a565b634e487b7160e01b600052603260045260246000fd5b8181036000831280158383131683831282161715614a6e57614a6e61568f565b6000602082840312156157ec57600080fd5b8151610f6781614de5565b60006040828403121561580957600080fd5b615811614d3e565b823561581c81614b95565b81526020928301359281019290925250919050565b6bffffffffffffffffffffffff818116838216019080821115614a6e57614a6e61568f565b600067ffffffffffffffff8083168181036158735761587361568f565b6001019392505050565b602081526000825160a0602084015261589960c0840182614bfb565b905067ffffffffffffffff602085015116604084015260408401516001600160a01b038082166060860152606086015160808601528060808701511660a086015250508091505092915050565b600082601f8301126158f757600080fd5b815167ffffffffffffffff81111561591157615911614cb8565b6159246020601f19601f84011601614d61565b81815284602083860101111561593957600080fd5b612522826020830160208701614bd7565b60006020828403121561595c57600080fd5b815167ffffffffffffffff8082111561597457600080fd5b908301906040828603121561598857600080fd5b615990614d3e565b82518281111561599f57600080fd5b6159ab878286016158e6565b8252506020830151828111156159c057600080fd5b6159cc878286016158e6565b60208301525095945050505050565b6020815260008251608060208401526159f760a0840182614bfb565b90506020840151601f1980858403016040860152615a158383614bfb565b9250604086015191508085840301606086015250615a338282614bfb565b91505063ffffffff60608501511660808401528091505092915050565b60008151808452602080850194506020840160005b838110156152d357815180516001600160a01b031688528301518388015260409096019590820190600101615a65565b60008282518085526020808601955060208260051b8401016020860160005b84811015615ae257601f19868403018952615ad0838351614bfb565b98840198925090830190600101615ab4565b5090979650505050505050565b60208152615b0a60208201835167ffffffffffffffff169052565b60006020830151615b2660408401826001600160a01b03169052565b5060408301516001600160a01b038116606084015250606083015167ffffffffffffffff8116608084015250608083015160a083015260a0830151615b6f60c084018215159052565b5060c083015167ffffffffffffffff811660e08401525060e0830151610100615ba2818501836001600160a01b03169052565b840151610120848101919091528401516101a061014080860182905291925090615bd06101c0860184614bfb565b9250808601519050601f19610160818786030181880152615bf18584615a50565b945080880151925050610180818786030181880152615c108584615a95565b970151959092019490945250929392505050565b6bffffffffffffffffffffffff828116828216039080821115614a6e57614a6e61568f565b7fffffffff000000000000000000000000000000000000000000000000000000008135818116916004851015615c895780818660040360031b1b83161692505b505092915050565b60008085851115615ca157600080fd5b83861115615cae57600080fd5b5050820193919092039150565b600060408284031215615ccd57600080fd5b615cd5614d3e565b82358152602083013561577b81614de5565b600060208284031215615cf957600080fd5b5035919050565b63ffffffff818116838216019080821115614a6e57614a6e61568f565b600060208284031215615d2f57600080fd5b610f6782615630565b602080825282518282018190526000919060409081850190868401855b82811015615dcb57815180516001600160a01b031685528681015163ffffffff908116888701528682015181168787015260608083015161ffff169087015260808083015182169087015260a0808301519091169086015260c09081015115159085015260e09093019290850190600101615d55565b5091979650505050505050565b6102a08101615de78285614aee565b610f67610100830184615108565b81810381811115610e7c57610e7c61568f565b600081615e1757615e1761568f565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190565b63ffffffff83168152604060208201526000612522604083018461528a565b600060408284031215615e6e57600080fd5b615e76614d3e565b615e7f83615630565b8152602083015161577b81614db6565b602081526000610f676020830184615a50565b602081526000610f676020830184615a95565b602080825282518282018190526000919060409081850190868401855b82811015615dcb57815180516001600160a01b031685528681015163ffffffff16878601528581015167ffffffffffffffff908116878701526060808301519091169086015260809081015115159085015260a09093019290850190600101615ed2565b60008251615f48818460208701614bd7565b9190910192915050565b634e487b7160e01b600052603160045260246000fdfea164736f6c6343000818000a", +} + +var EVM2EVMOnRampABI = EVM2EVMOnRampMetaData.ABI + +var EVM2EVMOnRampBin = EVM2EVMOnRampMetaData.Bin + +func DeployEVM2EVMOnRamp(auth *bind.TransactOpts, backend bind.ContractBackend, staticConfig EVM2EVMOnRampStaticConfig, dynamicConfig EVM2EVMOnRampDynamicConfig, rateLimiterConfig RateLimiterConfig, feeTokenConfigs []EVM2EVMOnRampFeeTokenConfigArgs, tokenTransferFeeConfigArgs []EVM2EVMOnRampTokenTransferFeeConfigArgs, nopsAndWeights []EVM2EVMOnRampNopAndWeight) (common.Address, *types.Transaction, *EVM2EVMOnRamp, error) { + parsed, err := EVM2EVMOnRampMetaData.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(EVM2EVMOnRampBin), backend, staticConfig, dynamicConfig, rateLimiterConfig, feeTokenConfigs, tokenTransferFeeConfigArgs, nopsAndWeights) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &EVM2EVMOnRamp{address: address, abi: *parsed, EVM2EVMOnRampCaller: EVM2EVMOnRampCaller{contract: contract}, EVM2EVMOnRampTransactor: EVM2EVMOnRampTransactor{contract: contract}, EVM2EVMOnRampFilterer: EVM2EVMOnRampFilterer{contract: contract}}, nil +} + +type EVM2EVMOnRamp struct { + address common.Address + abi abi.ABI + EVM2EVMOnRampCaller + EVM2EVMOnRampTransactor + EVM2EVMOnRampFilterer +} + +type EVM2EVMOnRampCaller struct { + contract *bind.BoundContract +} + +type EVM2EVMOnRampTransactor struct { + contract *bind.BoundContract +} + +type EVM2EVMOnRampFilterer struct { + contract *bind.BoundContract +} + +type EVM2EVMOnRampSession struct { + Contract *EVM2EVMOnRamp + CallOpts bind.CallOpts + TransactOpts bind.TransactOpts +} + +type EVM2EVMOnRampCallerSession struct { + Contract *EVM2EVMOnRampCaller + CallOpts bind.CallOpts +} + +type EVM2EVMOnRampTransactorSession struct { + Contract *EVM2EVMOnRampTransactor + TransactOpts bind.TransactOpts +} + +type EVM2EVMOnRampRaw struct { + Contract *EVM2EVMOnRamp +} + +type EVM2EVMOnRampCallerRaw struct { + Contract *EVM2EVMOnRampCaller +} + +type EVM2EVMOnRampTransactorRaw struct { + Contract *EVM2EVMOnRampTransactor +} + +func NewEVM2EVMOnRamp(address common.Address, backend bind.ContractBackend) (*EVM2EVMOnRamp, error) { + abi, err := abi.JSON(strings.NewReader(EVM2EVMOnRampABI)) + if err != nil { + return nil, err + } + contract, err := bindEVM2EVMOnRamp(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &EVM2EVMOnRamp{address: address, abi: abi, EVM2EVMOnRampCaller: EVM2EVMOnRampCaller{contract: contract}, EVM2EVMOnRampTransactor: EVM2EVMOnRampTransactor{contract: contract}, EVM2EVMOnRampFilterer: EVM2EVMOnRampFilterer{contract: contract}}, nil +} + +func NewEVM2EVMOnRampCaller(address common.Address, caller bind.ContractCaller) (*EVM2EVMOnRampCaller, error) { + contract, err := bindEVM2EVMOnRamp(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &EVM2EVMOnRampCaller{contract: contract}, nil +} + +func NewEVM2EVMOnRampTransactor(address common.Address, transactor bind.ContractTransactor) (*EVM2EVMOnRampTransactor, error) { + contract, err := bindEVM2EVMOnRamp(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &EVM2EVMOnRampTransactor{contract: contract}, nil +} + +func NewEVM2EVMOnRampFilterer(address common.Address, filterer bind.ContractFilterer) (*EVM2EVMOnRampFilterer, error) { + contract, err := bindEVM2EVMOnRamp(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &EVM2EVMOnRampFilterer{contract: contract}, nil +} + +func bindEVM2EVMOnRamp(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := EVM2EVMOnRampMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _EVM2EVMOnRamp.Contract.EVM2EVMOnRampCaller.contract.Call(opts, result, method, params...) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.EVM2EVMOnRampTransactor.contract.Transfer(opts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.EVM2EVMOnRampTransactor.contract.Transact(opts, method, params...) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _EVM2EVMOnRamp.Contract.contract.Call(opts, result, method, params...) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.contract.Transfer(opts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.contract.Transact(opts, method, params...) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCaller) CurrentRateLimiterState(opts *bind.CallOpts) (RateLimiterTokenBucket, error) { + var out []interface{} + err := _EVM2EVMOnRamp.contract.Call(opts, &out, "currentRateLimiterState") + + if err != nil { + return *new(RateLimiterTokenBucket), err + } + + out0 := *abi.ConvertType(out[0], new(RateLimiterTokenBucket)).(*RateLimiterTokenBucket) + + return out0, err + +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) CurrentRateLimiterState() (RateLimiterTokenBucket, error) { + return _EVM2EVMOnRamp.Contract.CurrentRateLimiterState(&_EVM2EVMOnRamp.CallOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCallerSession) CurrentRateLimiterState() (RateLimiterTokenBucket, error) { + return _EVM2EVMOnRamp.Contract.CurrentRateLimiterState(&_EVM2EVMOnRamp.CallOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCaller) GetDynamicConfig(opts *bind.CallOpts) (EVM2EVMOnRampDynamicConfig, error) { + var out []interface{} + err := _EVM2EVMOnRamp.contract.Call(opts, &out, "getDynamicConfig") + + if err != nil { + return *new(EVM2EVMOnRampDynamicConfig), err + } + + out0 := *abi.ConvertType(out[0], new(EVM2EVMOnRampDynamicConfig)).(*EVM2EVMOnRampDynamicConfig) + + return out0, err + +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) GetDynamicConfig() (EVM2EVMOnRampDynamicConfig, error) { + return _EVM2EVMOnRamp.Contract.GetDynamicConfig(&_EVM2EVMOnRamp.CallOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCallerSession) GetDynamicConfig() (EVM2EVMOnRampDynamicConfig, error) { + return _EVM2EVMOnRamp.Contract.GetDynamicConfig(&_EVM2EVMOnRamp.CallOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCaller) GetExpectedNextSequenceNumber(opts *bind.CallOpts) (uint64, error) { + var out []interface{} + err := _EVM2EVMOnRamp.contract.Call(opts, &out, "getExpectedNextSequenceNumber") + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) GetExpectedNextSequenceNumber() (uint64, error) { + return _EVM2EVMOnRamp.Contract.GetExpectedNextSequenceNumber(&_EVM2EVMOnRamp.CallOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCallerSession) GetExpectedNextSequenceNumber() (uint64, error) { + return _EVM2EVMOnRamp.Contract.GetExpectedNextSequenceNumber(&_EVM2EVMOnRamp.CallOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCaller) GetFee(opts *bind.CallOpts, destChainSelector uint64, message ClientEVM2AnyMessage) (*big.Int, error) { + var out []interface{} + err := _EVM2EVMOnRamp.contract.Call(opts, &out, "getFee", destChainSelector, message) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) GetFee(destChainSelector uint64, message ClientEVM2AnyMessage) (*big.Int, error) { + return _EVM2EVMOnRamp.Contract.GetFee(&_EVM2EVMOnRamp.CallOpts, destChainSelector, message) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCallerSession) GetFee(destChainSelector uint64, message ClientEVM2AnyMessage) (*big.Int, error) { + return _EVM2EVMOnRamp.Contract.GetFee(&_EVM2EVMOnRamp.CallOpts, destChainSelector, message) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCaller) GetFeeTokenConfig(opts *bind.CallOpts, token common.Address) (EVM2EVMOnRampFeeTokenConfig, error) { + var out []interface{} + err := _EVM2EVMOnRamp.contract.Call(opts, &out, "getFeeTokenConfig", token) + + if err != nil { + return *new(EVM2EVMOnRampFeeTokenConfig), err + } + + out0 := *abi.ConvertType(out[0], new(EVM2EVMOnRampFeeTokenConfig)).(*EVM2EVMOnRampFeeTokenConfig) + + return out0, err + +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) GetFeeTokenConfig(token common.Address) (EVM2EVMOnRampFeeTokenConfig, error) { + return _EVM2EVMOnRamp.Contract.GetFeeTokenConfig(&_EVM2EVMOnRamp.CallOpts, token) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCallerSession) GetFeeTokenConfig(token common.Address) (EVM2EVMOnRampFeeTokenConfig, error) { + return _EVM2EVMOnRamp.Contract.GetFeeTokenConfig(&_EVM2EVMOnRamp.CallOpts, token) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCaller) GetNopFeesJuels(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _EVM2EVMOnRamp.contract.Call(opts, &out, "getNopFeesJuels") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) GetNopFeesJuels() (*big.Int, error) { + return _EVM2EVMOnRamp.Contract.GetNopFeesJuels(&_EVM2EVMOnRamp.CallOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCallerSession) GetNopFeesJuels() (*big.Int, error) { + return _EVM2EVMOnRamp.Contract.GetNopFeesJuels(&_EVM2EVMOnRamp.CallOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCaller) GetNops(opts *bind.CallOpts) (GetNops, + + error) { + var out []interface{} + err := _EVM2EVMOnRamp.contract.Call(opts, &out, "getNops") + + outstruct := new(GetNops) + if err != nil { + return *outstruct, err + } + + outstruct.NopsAndWeights = *abi.ConvertType(out[0], new([]EVM2EVMOnRampNopAndWeight)).(*[]EVM2EVMOnRampNopAndWeight) + outstruct.WeightsTotal = *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) + + return *outstruct, err + +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) GetNops() (GetNops, + + error) { + return _EVM2EVMOnRamp.Contract.GetNops(&_EVM2EVMOnRamp.CallOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCallerSession) GetNops() (GetNops, + + error) { + return _EVM2EVMOnRamp.Contract.GetNops(&_EVM2EVMOnRamp.CallOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCaller) GetPoolBySourceToken(opts *bind.CallOpts, arg0 uint64, sourceToken common.Address) (common.Address, error) { + var out []interface{} + err := _EVM2EVMOnRamp.contract.Call(opts, &out, "getPoolBySourceToken", arg0, sourceToken) + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) GetPoolBySourceToken(arg0 uint64, sourceToken common.Address) (common.Address, error) { + return _EVM2EVMOnRamp.Contract.GetPoolBySourceToken(&_EVM2EVMOnRamp.CallOpts, arg0, sourceToken) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCallerSession) GetPoolBySourceToken(arg0 uint64, sourceToken common.Address) (common.Address, error) { + return _EVM2EVMOnRamp.Contract.GetPoolBySourceToken(&_EVM2EVMOnRamp.CallOpts, arg0, sourceToken) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCaller) GetSenderNonce(opts *bind.CallOpts, sender common.Address) (uint64, error) { + var out []interface{} + err := _EVM2EVMOnRamp.contract.Call(opts, &out, "getSenderNonce", sender) + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) GetSenderNonce(sender common.Address) (uint64, error) { + return _EVM2EVMOnRamp.Contract.GetSenderNonce(&_EVM2EVMOnRamp.CallOpts, sender) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCallerSession) GetSenderNonce(sender common.Address) (uint64, error) { + return _EVM2EVMOnRamp.Contract.GetSenderNonce(&_EVM2EVMOnRamp.CallOpts, sender) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCaller) GetStaticConfig(opts *bind.CallOpts) (EVM2EVMOnRampStaticConfig, error) { + var out []interface{} + err := _EVM2EVMOnRamp.contract.Call(opts, &out, "getStaticConfig") + + if err != nil { + return *new(EVM2EVMOnRampStaticConfig), err + } + + out0 := *abi.ConvertType(out[0], new(EVM2EVMOnRampStaticConfig)).(*EVM2EVMOnRampStaticConfig) + + return out0, err + +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) GetStaticConfig() (EVM2EVMOnRampStaticConfig, error) { + return _EVM2EVMOnRamp.Contract.GetStaticConfig(&_EVM2EVMOnRamp.CallOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCallerSession) GetStaticConfig() (EVM2EVMOnRampStaticConfig, error) { + return _EVM2EVMOnRamp.Contract.GetStaticConfig(&_EVM2EVMOnRamp.CallOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCaller) GetSupportedTokens(opts *bind.CallOpts, arg0 uint64) ([]common.Address, error) { + var out []interface{} + err := _EVM2EVMOnRamp.contract.Call(opts, &out, "getSupportedTokens", arg0) + + if err != nil { + return *new([]common.Address), err + } + + out0 := *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) + + return out0, err + +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) GetSupportedTokens(arg0 uint64) ([]common.Address, error) { + return _EVM2EVMOnRamp.Contract.GetSupportedTokens(&_EVM2EVMOnRamp.CallOpts, arg0) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCallerSession) GetSupportedTokens(arg0 uint64) ([]common.Address, error) { + return _EVM2EVMOnRamp.Contract.GetSupportedTokens(&_EVM2EVMOnRamp.CallOpts, arg0) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCaller) GetTokenLimitAdmin(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _EVM2EVMOnRamp.contract.Call(opts, &out, "getTokenLimitAdmin") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) GetTokenLimitAdmin() (common.Address, error) { + return _EVM2EVMOnRamp.Contract.GetTokenLimitAdmin(&_EVM2EVMOnRamp.CallOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCallerSession) GetTokenLimitAdmin() (common.Address, error) { + return _EVM2EVMOnRamp.Contract.GetTokenLimitAdmin(&_EVM2EVMOnRamp.CallOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCaller) GetTokenTransferFeeConfig(opts *bind.CallOpts, token common.Address) (EVM2EVMOnRampTokenTransferFeeConfig, error) { + var out []interface{} + err := _EVM2EVMOnRamp.contract.Call(opts, &out, "getTokenTransferFeeConfig", token) + + if err != nil { + return *new(EVM2EVMOnRampTokenTransferFeeConfig), err + } + + out0 := *abi.ConvertType(out[0], new(EVM2EVMOnRampTokenTransferFeeConfig)).(*EVM2EVMOnRampTokenTransferFeeConfig) + + return out0, err + +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) GetTokenTransferFeeConfig(token common.Address) (EVM2EVMOnRampTokenTransferFeeConfig, error) { + return _EVM2EVMOnRamp.Contract.GetTokenTransferFeeConfig(&_EVM2EVMOnRamp.CallOpts, token) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCallerSession) GetTokenTransferFeeConfig(token common.Address) (EVM2EVMOnRampTokenTransferFeeConfig, error) { + return _EVM2EVMOnRamp.Contract.GetTokenTransferFeeConfig(&_EVM2EVMOnRamp.CallOpts, token) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCaller) LinkAvailableForPayment(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _EVM2EVMOnRamp.contract.Call(opts, &out, "linkAvailableForPayment") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) LinkAvailableForPayment() (*big.Int, error) { + return _EVM2EVMOnRamp.Contract.LinkAvailableForPayment(&_EVM2EVMOnRamp.CallOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCallerSession) LinkAvailableForPayment() (*big.Int, error) { + return _EVM2EVMOnRamp.Contract.LinkAvailableForPayment(&_EVM2EVMOnRamp.CallOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCaller) Owner(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _EVM2EVMOnRamp.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 + +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) Owner() (common.Address, error) { + return _EVM2EVMOnRamp.Contract.Owner(&_EVM2EVMOnRamp.CallOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCallerSession) Owner() (common.Address, error) { + return _EVM2EVMOnRamp.Contract.Owner(&_EVM2EVMOnRamp.CallOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCaller) TypeAndVersion(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _EVM2EVMOnRamp.contract.Call(opts, &out, "typeAndVersion") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) TypeAndVersion() (string, error) { + return _EVM2EVMOnRamp.Contract.TypeAndVersion(&_EVM2EVMOnRamp.CallOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCallerSession) TypeAndVersion() (string, error) { + return _EVM2EVMOnRamp.Contract.TypeAndVersion(&_EVM2EVMOnRamp.CallOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactor) AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + return _EVM2EVMOnRamp.contract.Transact(opts, "acceptOwnership") +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) AcceptOwnership() (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.AcceptOwnership(&_EVM2EVMOnRamp.TransactOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactorSession) AcceptOwnership() (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.AcceptOwnership(&_EVM2EVMOnRamp.TransactOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactor) ForwardFromRouter(opts *bind.TransactOpts, destChainSelector uint64, message ClientEVM2AnyMessage, feeTokenAmount *big.Int, originalSender common.Address) (*types.Transaction, error) { + return _EVM2EVMOnRamp.contract.Transact(opts, "forwardFromRouter", destChainSelector, message, feeTokenAmount, originalSender) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) ForwardFromRouter(destChainSelector uint64, message ClientEVM2AnyMessage, feeTokenAmount *big.Int, originalSender common.Address) (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.ForwardFromRouter(&_EVM2EVMOnRamp.TransactOpts, destChainSelector, message, feeTokenAmount, originalSender) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactorSession) ForwardFromRouter(destChainSelector uint64, message ClientEVM2AnyMessage, feeTokenAmount *big.Int, originalSender common.Address) (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.ForwardFromRouter(&_EVM2EVMOnRamp.TransactOpts, destChainSelector, message, feeTokenAmount, originalSender) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactor) PayNops(opts *bind.TransactOpts) (*types.Transaction, error) { + return _EVM2EVMOnRamp.contract.Transact(opts, "payNops") +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) PayNops() (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.PayNops(&_EVM2EVMOnRamp.TransactOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactorSession) PayNops() (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.PayNops(&_EVM2EVMOnRamp.TransactOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactor) SetAdmin(opts *bind.TransactOpts, newAdmin common.Address) (*types.Transaction, error) { + return _EVM2EVMOnRamp.contract.Transact(opts, "setAdmin", newAdmin) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) SetAdmin(newAdmin common.Address) (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.SetAdmin(&_EVM2EVMOnRamp.TransactOpts, newAdmin) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactorSession) SetAdmin(newAdmin common.Address) (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.SetAdmin(&_EVM2EVMOnRamp.TransactOpts, newAdmin) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactor) SetDynamicConfig(opts *bind.TransactOpts, dynamicConfig EVM2EVMOnRampDynamicConfig) (*types.Transaction, error) { + return _EVM2EVMOnRamp.contract.Transact(opts, "setDynamicConfig", dynamicConfig) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) SetDynamicConfig(dynamicConfig EVM2EVMOnRampDynamicConfig) (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.SetDynamicConfig(&_EVM2EVMOnRamp.TransactOpts, dynamicConfig) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactorSession) SetDynamicConfig(dynamicConfig EVM2EVMOnRampDynamicConfig) (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.SetDynamicConfig(&_EVM2EVMOnRamp.TransactOpts, dynamicConfig) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactor) SetFeeTokenConfig(opts *bind.TransactOpts, feeTokenConfigArgs []EVM2EVMOnRampFeeTokenConfigArgs) (*types.Transaction, error) { + return _EVM2EVMOnRamp.contract.Transact(opts, "setFeeTokenConfig", feeTokenConfigArgs) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) SetFeeTokenConfig(feeTokenConfigArgs []EVM2EVMOnRampFeeTokenConfigArgs) (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.SetFeeTokenConfig(&_EVM2EVMOnRamp.TransactOpts, feeTokenConfigArgs) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactorSession) SetFeeTokenConfig(feeTokenConfigArgs []EVM2EVMOnRampFeeTokenConfigArgs) (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.SetFeeTokenConfig(&_EVM2EVMOnRamp.TransactOpts, feeTokenConfigArgs) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactor) SetNops(opts *bind.TransactOpts, nopsAndWeights []EVM2EVMOnRampNopAndWeight) (*types.Transaction, error) { + return _EVM2EVMOnRamp.contract.Transact(opts, "setNops", nopsAndWeights) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) SetNops(nopsAndWeights []EVM2EVMOnRampNopAndWeight) (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.SetNops(&_EVM2EVMOnRamp.TransactOpts, nopsAndWeights) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactorSession) SetNops(nopsAndWeights []EVM2EVMOnRampNopAndWeight) (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.SetNops(&_EVM2EVMOnRamp.TransactOpts, nopsAndWeights) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactor) SetRateLimiterConfig(opts *bind.TransactOpts, config RateLimiterConfig) (*types.Transaction, error) { + return _EVM2EVMOnRamp.contract.Transact(opts, "setRateLimiterConfig", config) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) SetRateLimiterConfig(config RateLimiterConfig) (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.SetRateLimiterConfig(&_EVM2EVMOnRamp.TransactOpts, config) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactorSession) SetRateLimiterConfig(config RateLimiterConfig) (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.SetRateLimiterConfig(&_EVM2EVMOnRamp.TransactOpts, config) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactor) SetTokenTransferFeeConfig(opts *bind.TransactOpts, tokenTransferFeeConfigArgs []EVM2EVMOnRampTokenTransferFeeConfigArgs, tokensToUseDefaultFeeConfigs []common.Address) (*types.Transaction, error) { + return _EVM2EVMOnRamp.contract.Transact(opts, "setTokenTransferFeeConfig", tokenTransferFeeConfigArgs, tokensToUseDefaultFeeConfigs) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) SetTokenTransferFeeConfig(tokenTransferFeeConfigArgs []EVM2EVMOnRampTokenTransferFeeConfigArgs, tokensToUseDefaultFeeConfigs []common.Address) (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.SetTokenTransferFeeConfig(&_EVM2EVMOnRamp.TransactOpts, tokenTransferFeeConfigArgs, tokensToUseDefaultFeeConfigs) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactorSession) SetTokenTransferFeeConfig(tokenTransferFeeConfigArgs []EVM2EVMOnRampTokenTransferFeeConfigArgs, tokensToUseDefaultFeeConfigs []common.Address) (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.SetTokenTransferFeeConfig(&_EVM2EVMOnRamp.TransactOpts, tokenTransferFeeConfigArgs, tokensToUseDefaultFeeConfigs) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactor) TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) { + return _EVM2EVMOnRamp.contract.Transact(opts, "transferOwnership", to) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.TransferOwnership(&_EVM2EVMOnRamp.TransactOpts, to) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactorSession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.TransferOwnership(&_EVM2EVMOnRamp.TransactOpts, to) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactor) WithdrawNonLinkFees(opts *bind.TransactOpts, feeToken common.Address, to common.Address) (*types.Transaction, error) { + return _EVM2EVMOnRamp.contract.Transact(opts, "withdrawNonLinkFees", feeToken, to) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) WithdrawNonLinkFees(feeToken common.Address, to common.Address) (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.WithdrawNonLinkFees(&_EVM2EVMOnRamp.TransactOpts, feeToken, to) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactorSession) WithdrawNonLinkFees(feeToken common.Address, to common.Address) (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.WithdrawNonLinkFees(&_EVM2EVMOnRamp.TransactOpts, feeToken, to) +} + +type EVM2EVMOnRampAdminSetIterator struct { + Event *EVM2EVMOnRampAdminSet + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *EVM2EVMOnRampAdminSetIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOnRampAdminSet) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOnRampAdminSet) + 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() + } +} + +func (it *EVM2EVMOnRampAdminSetIterator) Error() error { + return it.fail +} + +func (it *EVM2EVMOnRampAdminSetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type EVM2EVMOnRampAdminSet struct { + NewAdmin common.Address + Raw types.Log +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) FilterAdminSet(opts *bind.FilterOpts) (*EVM2EVMOnRampAdminSetIterator, error) { + + logs, sub, err := _EVM2EVMOnRamp.contract.FilterLogs(opts, "AdminSet") + if err != nil { + return nil, err + } + return &EVM2EVMOnRampAdminSetIterator{contract: _EVM2EVMOnRamp.contract, event: "AdminSet", logs: logs, sub: sub}, nil +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) WatchAdminSet(opts *bind.WatchOpts, sink chan<- *EVM2EVMOnRampAdminSet) (event.Subscription, error) { + + logs, sub, err := _EVM2EVMOnRamp.contract.WatchLogs(opts, "AdminSet") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(EVM2EVMOnRampAdminSet) + if err := _EVM2EVMOnRamp.contract.UnpackLog(event, "AdminSet", 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 +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) ParseAdminSet(log types.Log) (*EVM2EVMOnRampAdminSet, error) { + event := new(EVM2EVMOnRampAdminSet) + if err := _EVM2EVMOnRamp.contract.UnpackLog(event, "AdminSet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type EVM2EVMOnRampCCIPSendRequestedIterator struct { + Event *EVM2EVMOnRampCCIPSendRequested + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *EVM2EVMOnRampCCIPSendRequestedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOnRampCCIPSendRequested) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOnRampCCIPSendRequested) + 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() + } +} + +func (it *EVM2EVMOnRampCCIPSendRequestedIterator) Error() error { + return it.fail +} + +func (it *EVM2EVMOnRampCCIPSendRequestedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type EVM2EVMOnRampCCIPSendRequested struct { + Message InternalEVM2EVMMessage + Raw types.Log +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) FilterCCIPSendRequested(opts *bind.FilterOpts) (*EVM2EVMOnRampCCIPSendRequestedIterator, error) { + + logs, sub, err := _EVM2EVMOnRamp.contract.FilterLogs(opts, "CCIPSendRequested") + if err != nil { + return nil, err + } + return &EVM2EVMOnRampCCIPSendRequestedIterator{contract: _EVM2EVMOnRamp.contract, event: "CCIPSendRequested", logs: logs, sub: sub}, nil +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) WatchCCIPSendRequested(opts *bind.WatchOpts, sink chan<- *EVM2EVMOnRampCCIPSendRequested) (event.Subscription, error) { + + logs, sub, err := _EVM2EVMOnRamp.contract.WatchLogs(opts, "CCIPSendRequested") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(EVM2EVMOnRampCCIPSendRequested) + if err := _EVM2EVMOnRamp.contract.UnpackLog(event, "CCIPSendRequested", 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 +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) ParseCCIPSendRequested(log types.Log) (*EVM2EVMOnRampCCIPSendRequested, error) { + event := new(EVM2EVMOnRampCCIPSendRequested) + if err := _EVM2EVMOnRamp.contract.UnpackLog(event, "CCIPSendRequested", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type EVM2EVMOnRampConfigChangedIterator struct { + Event *EVM2EVMOnRampConfigChanged + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *EVM2EVMOnRampConfigChangedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOnRampConfigChanged) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOnRampConfigChanged) + 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() + } +} + +func (it *EVM2EVMOnRampConfigChangedIterator) Error() error { + return it.fail +} + +func (it *EVM2EVMOnRampConfigChangedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type EVM2EVMOnRampConfigChanged struct { + Config RateLimiterConfig + Raw types.Log +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) FilterConfigChanged(opts *bind.FilterOpts) (*EVM2EVMOnRampConfigChangedIterator, error) { + + logs, sub, err := _EVM2EVMOnRamp.contract.FilterLogs(opts, "ConfigChanged") + if err != nil { + return nil, err + } + return &EVM2EVMOnRampConfigChangedIterator{contract: _EVM2EVMOnRamp.contract, event: "ConfigChanged", logs: logs, sub: sub}, nil +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) WatchConfigChanged(opts *bind.WatchOpts, sink chan<- *EVM2EVMOnRampConfigChanged) (event.Subscription, error) { + + logs, sub, err := _EVM2EVMOnRamp.contract.WatchLogs(opts, "ConfigChanged") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(EVM2EVMOnRampConfigChanged) + if err := _EVM2EVMOnRamp.contract.UnpackLog(event, "ConfigChanged", 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 +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) ParseConfigChanged(log types.Log) (*EVM2EVMOnRampConfigChanged, error) { + event := new(EVM2EVMOnRampConfigChanged) + if err := _EVM2EVMOnRamp.contract.UnpackLog(event, "ConfigChanged", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type EVM2EVMOnRampConfigSetIterator struct { + Event *EVM2EVMOnRampConfigSet + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *EVM2EVMOnRampConfigSetIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOnRampConfigSet) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOnRampConfigSet) + 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() + } +} + +func (it *EVM2EVMOnRampConfigSetIterator) Error() error { + return it.fail +} + +func (it *EVM2EVMOnRampConfigSetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type EVM2EVMOnRampConfigSet struct { + StaticConfig EVM2EVMOnRampStaticConfig + DynamicConfig EVM2EVMOnRampDynamicConfig + Raw types.Log +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) FilterConfigSet(opts *bind.FilterOpts) (*EVM2EVMOnRampConfigSetIterator, error) { + + logs, sub, err := _EVM2EVMOnRamp.contract.FilterLogs(opts, "ConfigSet") + if err != nil { + return nil, err + } + return &EVM2EVMOnRampConfigSetIterator{contract: _EVM2EVMOnRamp.contract, event: "ConfigSet", logs: logs, sub: sub}, nil +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) WatchConfigSet(opts *bind.WatchOpts, sink chan<- *EVM2EVMOnRampConfigSet) (event.Subscription, error) { + + logs, sub, err := _EVM2EVMOnRamp.contract.WatchLogs(opts, "ConfigSet") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(EVM2EVMOnRampConfigSet) + if err := _EVM2EVMOnRamp.contract.UnpackLog(event, "ConfigSet", 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 +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) ParseConfigSet(log types.Log) (*EVM2EVMOnRampConfigSet, error) { + event := new(EVM2EVMOnRampConfigSet) + if err := _EVM2EVMOnRamp.contract.UnpackLog(event, "ConfigSet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type EVM2EVMOnRampFeeConfigSetIterator struct { + Event *EVM2EVMOnRampFeeConfigSet + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *EVM2EVMOnRampFeeConfigSetIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOnRampFeeConfigSet) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOnRampFeeConfigSet) + 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() + } +} + +func (it *EVM2EVMOnRampFeeConfigSetIterator) Error() error { + return it.fail +} + +func (it *EVM2EVMOnRampFeeConfigSetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type EVM2EVMOnRampFeeConfigSet struct { + FeeConfig []EVM2EVMOnRampFeeTokenConfigArgs + Raw types.Log +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) FilterFeeConfigSet(opts *bind.FilterOpts) (*EVM2EVMOnRampFeeConfigSetIterator, error) { + + logs, sub, err := _EVM2EVMOnRamp.contract.FilterLogs(opts, "FeeConfigSet") + if err != nil { + return nil, err + } + return &EVM2EVMOnRampFeeConfigSetIterator{contract: _EVM2EVMOnRamp.contract, event: "FeeConfigSet", logs: logs, sub: sub}, nil +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) WatchFeeConfigSet(opts *bind.WatchOpts, sink chan<- *EVM2EVMOnRampFeeConfigSet) (event.Subscription, error) { + + logs, sub, err := _EVM2EVMOnRamp.contract.WatchLogs(opts, "FeeConfigSet") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(EVM2EVMOnRampFeeConfigSet) + if err := _EVM2EVMOnRamp.contract.UnpackLog(event, "FeeConfigSet", 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 +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) ParseFeeConfigSet(log types.Log) (*EVM2EVMOnRampFeeConfigSet, error) { + event := new(EVM2EVMOnRampFeeConfigSet) + if err := _EVM2EVMOnRamp.contract.UnpackLog(event, "FeeConfigSet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type EVM2EVMOnRampNopPaidIterator struct { + Event *EVM2EVMOnRampNopPaid + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *EVM2EVMOnRampNopPaidIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOnRampNopPaid) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOnRampNopPaid) + 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() + } +} + +func (it *EVM2EVMOnRampNopPaidIterator) Error() error { + return it.fail +} + +func (it *EVM2EVMOnRampNopPaidIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type EVM2EVMOnRampNopPaid struct { + Nop common.Address + Amount *big.Int + Raw types.Log +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) FilterNopPaid(opts *bind.FilterOpts, nop []common.Address) (*EVM2EVMOnRampNopPaidIterator, error) { + + var nopRule []interface{} + for _, nopItem := range nop { + nopRule = append(nopRule, nopItem) + } + + logs, sub, err := _EVM2EVMOnRamp.contract.FilterLogs(opts, "NopPaid", nopRule) + if err != nil { + return nil, err + } + return &EVM2EVMOnRampNopPaidIterator{contract: _EVM2EVMOnRamp.contract, event: "NopPaid", logs: logs, sub: sub}, nil +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) WatchNopPaid(opts *bind.WatchOpts, sink chan<- *EVM2EVMOnRampNopPaid, nop []common.Address) (event.Subscription, error) { + + var nopRule []interface{} + for _, nopItem := range nop { + nopRule = append(nopRule, nopItem) + } + + logs, sub, err := _EVM2EVMOnRamp.contract.WatchLogs(opts, "NopPaid", nopRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(EVM2EVMOnRampNopPaid) + if err := _EVM2EVMOnRamp.contract.UnpackLog(event, "NopPaid", 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 +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) ParseNopPaid(log types.Log) (*EVM2EVMOnRampNopPaid, error) { + event := new(EVM2EVMOnRampNopPaid) + if err := _EVM2EVMOnRamp.contract.UnpackLog(event, "NopPaid", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type EVM2EVMOnRampNopsSetIterator struct { + Event *EVM2EVMOnRampNopsSet + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *EVM2EVMOnRampNopsSetIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOnRampNopsSet) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOnRampNopsSet) + 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() + } +} + +func (it *EVM2EVMOnRampNopsSetIterator) Error() error { + return it.fail +} + +func (it *EVM2EVMOnRampNopsSetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type EVM2EVMOnRampNopsSet struct { + NopWeightsTotal *big.Int + NopsAndWeights []EVM2EVMOnRampNopAndWeight + Raw types.Log +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) FilterNopsSet(opts *bind.FilterOpts) (*EVM2EVMOnRampNopsSetIterator, error) { + + logs, sub, err := _EVM2EVMOnRamp.contract.FilterLogs(opts, "NopsSet") + if err != nil { + return nil, err + } + return &EVM2EVMOnRampNopsSetIterator{contract: _EVM2EVMOnRamp.contract, event: "NopsSet", logs: logs, sub: sub}, nil +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) WatchNopsSet(opts *bind.WatchOpts, sink chan<- *EVM2EVMOnRampNopsSet) (event.Subscription, error) { + + logs, sub, err := _EVM2EVMOnRamp.contract.WatchLogs(opts, "NopsSet") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(EVM2EVMOnRampNopsSet) + if err := _EVM2EVMOnRamp.contract.UnpackLog(event, "NopsSet", 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 +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) ParseNopsSet(log types.Log) (*EVM2EVMOnRampNopsSet, error) { + event := new(EVM2EVMOnRampNopsSet) + if err := _EVM2EVMOnRamp.contract.UnpackLog(event, "NopsSet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type EVM2EVMOnRampOwnershipTransferRequestedIterator struct { + Event *EVM2EVMOnRampOwnershipTransferRequested + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *EVM2EVMOnRampOwnershipTransferRequestedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOnRampOwnershipTransferRequested) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOnRampOwnershipTransferRequested) + 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() + } +} + +func (it *EVM2EVMOnRampOwnershipTransferRequestedIterator) Error() error { + return it.fail +} + +func (it *EVM2EVMOnRampOwnershipTransferRequestedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type EVM2EVMOnRampOwnershipTransferRequested struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*EVM2EVMOnRampOwnershipTransferRequestedIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _EVM2EVMOnRamp.contract.FilterLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return &EVM2EVMOnRampOwnershipTransferRequestedIterator{contract: _EVM2EVMOnRamp.contract, event: "OwnershipTransferRequested", logs: logs, sub: sub}, nil +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *EVM2EVMOnRampOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _EVM2EVMOnRamp.contract.WatchLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(EVM2EVMOnRampOwnershipTransferRequested) + if err := _EVM2EVMOnRamp.contract.UnpackLog(event, "OwnershipTransferRequested", 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 +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) ParseOwnershipTransferRequested(log types.Log) (*EVM2EVMOnRampOwnershipTransferRequested, error) { + event := new(EVM2EVMOnRampOwnershipTransferRequested) + if err := _EVM2EVMOnRamp.contract.UnpackLog(event, "OwnershipTransferRequested", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type EVM2EVMOnRampOwnershipTransferredIterator struct { + Event *EVM2EVMOnRampOwnershipTransferred + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *EVM2EVMOnRampOwnershipTransferredIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOnRampOwnershipTransferred) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOnRampOwnershipTransferred) + 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() + } +} + +func (it *EVM2EVMOnRampOwnershipTransferredIterator) Error() error { + return it.fail +} + +func (it *EVM2EVMOnRampOwnershipTransferredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type EVM2EVMOnRampOwnershipTransferred struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*EVM2EVMOnRampOwnershipTransferredIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _EVM2EVMOnRamp.contract.FilterLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return &EVM2EVMOnRampOwnershipTransferredIterator{contract: _EVM2EVMOnRamp.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *EVM2EVMOnRampOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _EVM2EVMOnRamp.contract.WatchLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(EVM2EVMOnRampOwnershipTransferred) + if err := _EVM2EVMOnRamp.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 +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) ParseOwnershipTransferred(log types.Log) (*EVM2EVMOnRampOwnershipTransferred, error) { + event := new(EVM2EVMOnRampOwnershipTransferred) + if err := _EVM2EVMOnRamp.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type EVM2EVMOnRampTokenTransferFeeConfigDeletedIterator struct { + Event *EVM2EVMOnRampTokenTransferFeeConfigDeleted + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *EVM2EVMOnRampTokenTransferFeeConfigDeletedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOnRampTokenTransferFeeConfigDeleted) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOnRampTokenTransferFeeConfigDeleted) + 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() + } +} + +func (it *EVM2EVMOnRampTokenTransferFeeConfigDeletedIterator) Error() error { + return it.fail +} + +func (it *EVM2EVMOnRampTokenTransferFeeConfigDeletedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type EVM2EVMOnRampTokenTransferFeeConfigDeleted struct { + Tokens []common.Address + Raw types.Log +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) FilterTokenTransferFeeConfigDeleted(opts *bind.FilterOpts) (*EVM2EVMOnRampTokenTransferFeeConfigDeletedIterator, error) { + + logs, sub, err := _EVM2EVMOnRamp.contract.FilterLogs(opts, "TokenTransferFeeConfigDeleted") + if err != nil { + return nil, err + } + return &EVM2EVMOnRampTokenTransferFeeConfigDeletedIterator{contract: _EVM2EVMOnRamp.contract, event: "TokenTransferFeeConfigDeleted", logs: logs, sub: sub}, nil +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) WatchTokenTransferFeeConfigDeleted(opts *bind.WatchOpts, sink chan<- *EVM2EVMOnRampTokenTransferFeeConfigDeleted) (event.Subscription, error) { + + logs, sub, err := _EVM2EVMOnRamp.contract.WatchLogs(opts, "TokenTransferFeeConfigDeleted") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(EVM2EVMOnRampTokenTransferFeeConfigDeleted) + if err := _EVM2EVMOnRamp.contract.UnpackLog(event, "TokenTransferFeeConfigDeleted", 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 +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) ParseTokenTransferFeeConfigDeleted(log types.Log) (*EVM2EVMOnRampTokenTransferFeeConfigDeleted, error) { + event := new(EVM2EVMOnRampTokenTransferFeeConfigDeleted) + if err := _EVM2EVMOnRamp.contract.UnpackLog(event, "TokenTransferFeeConfigDeleted", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type EVM2EVMOnRampTokenTransferFeeConfigSetIterator struct { + Event *EVM2EVMOnRampTokenTransferFeeConfigSet + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *EVM2EVMOnRampTokenTransferFeeConfigSetIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOnRampTokenTransferFeeConfigSet) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOnRampTokenTransferFeeConfigSet) + 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() + } +} + +func (it *EVM2EVMOnRampTokenTransferFeeConfigSetIterator) Error() error { + return it.fail +} + +func (it *EVM2EVMOnRampTokenTransferFeeConfigSetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type EVM2EVMOnRampTokenTransferFeeConfigSet struct { + TransferFeeConfig []EVM2EVMOnRampTokenTransferFeeConfigArgs + Raw types.Log +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) FilterTokenTransferFeeConfigSet(opts *bind.FilterOpts) (*EVM2EVMOnRampTokenTransferFeeConfigSetIterator, error) { + + logs, sub, err := _EVM2EVMOnRamp.contract.FilterLogs(opts, "TokenTransferFeeConfigSet") + if err != nil { + return nil, err + } + return &EVM2EVMOnRampTokenTransferFeeConfigSetIterator{contract: _EVM2EVMOnRamp.contract, event: "TokenTransferFeeConfigSet", logs: logs, sub: sub}, nil +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) WatchTokenTransferFeeConfigSet(opts *bind.WatchOpts, sink chan<- *EVM2EVMOnRampTokenTransferFeeConfigSet) (event.Subscription, error) { + + logs, sub, err := _EVM2EVMOnRamp.contract.WatchLogs(opts, "TokenTransferFeeConfigSet") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(EVM2EVMOnRampTokenTransferFeeConfigSet) + if err := _EVM2EVMOnRamp.contract.UnpackLog(event, "TokenTransferFeeConfigSet", 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 +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) ParseTokenTransferFeeConfigSet(log types.Log) (*EVM2EVMOnRampTokenTransferFeeConfigSet, error) { + event := new(EVM2EVMOnRampTokenTransferFeeConfigSet) + if err := _EVM2EVMOnRamp.contract.UnpackLog(event, "TokenTransferFeeConfigSet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type EVM2EVMOnRampTokensConsumedIterator struct { + Event *EVM2EVMOnRampTokensConsumed + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *EVM2EVMOnRampTokensConsumedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOnRampTokensConsumed) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOnRampTokensConsumed) + 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() + } +} + +func (it *EVM2EVMOnRampTokensConsumedIterator) Error() error { + return it.fail +} + +func (it *EVM2EVMOnRampTokensConsumedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type EVM2EVMOnRampTokensConsumed struct { + Tokens *big.Int + Raw types.Log +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) FilterTokensConsumed(opts *bind.FilterOpts) (*EVM2EVMOnRampTokensConsumedIterator, error) { + + logs, sub, err := _EVM2EVMOnRamp.contract.FilterLogs(opts, "TokensConsumed") + if err != nil { + return nil, err + } + return &EVM2EVMOnRampTokensConsumedIterator{contract: _EVM2EVMOnRamp.contract, event: "TokensConsumed", logs: logs, sub: sub}, nil +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) WatchTokensConsumed(opts *bind.WatchOpts, sink chan<- *EVM2EVMOnRampTokensConsumed) (event.Subscription, error) { + + logs, sub, err := _EVM2EVMOnRamp.contract.WatchLogs(opts, "TokensConsumed") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(EVM2EVMOnRampTokensConsumed) + if err := _EVM2EVMOnRamp.contract.UnpackLog(event, "TokensConsumed", 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 +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) ParseTokensConsumed(log types.Log) (*EVM2EVMOnRampTokensConsumed, error) { + event := new(EVM2EVMOnRampTokensConsumed) + if err := _EVM2EVMOnRamp.contract.UnpackLog(event, "TokensConsumed", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type GetNops struct { + NopsAndWeights []EVM2EVMOnRampNopAndWeight + WeightsTotal *big.Int +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRamp) ParseLog(log types.Log) (generated.AbigenLog, error) { + switch log.Topics[0] { + case _EVM2EVMOnRamp.abi.Events["AdminSet"].ID: + return _EVM2EVMOnRamp.ParseAdminSet(log) + case _EVM2EVMOnRamp.abi.Events["CCIPSendRequested"].ID: + return _EVM2EVMOnRamp.ParseCCIPSendRequested(log) + case _EVM2EVMOnRamp.abi.Events["ConfigChanged"].ID: + return _EVM2EVMOnRamp.ParseConfigChanged(log) + case _EVM2EVMOnRamp.abi.Events["ConfigSet"].ID: + return _EVM2EVMOnRamp.ParseConfigSet(log) + case _EVM2EVMOnRamp.abi.Events["FeeConfigSet"].ID: + return _EVM2EVMOnRamp.ParseFeeConfigSet(log) + case _EVM2EVMOnRamp.abi.Events["NopPaid"].ID: + return _EVM2EVMOnRamp.ParseNopPaid(log) + case _EVM2EVMOnRamp.abi.Events["NopsSet"].ID: + return _EVM2EVMOnRamp.ParseNopsSet(log) + case _EVM2EVMOnRamp.abi.Events["OwnershipTransferRequested"].ID: + return _EVM2EVMOnRamp.ParseOwnershipTransferRequested(log) + case _EVM2EVMOnRamp.abi.Events["OwnershipTransferred"].ID: + return _EVM2EVMOnRamp.ParseOwnershipTransferred(log) + case _EVM2EVMOnRamp.abi.Events["TokenTransferFeeConfigDeleted"].ID: + return _EVM2EVMOnRamp.ParseTokenTransferFeeConfigDeleted(log) + case _EVM2EVMOnRamp.abi.Events["TokenTransferFeeConfigSet"].ID: + return _EVM2EVMOnRamp.ParseTokenTransferFeeConfigSet(log) + case _EVM2EVMOnRamp.abi.Events["TokensConsumed"].ID: + return _EVM2EVMOnRamp.ParseTokensConsumed(log) + + default: + return nil, fmt.Errorf("abigen wrapper received unknown log topic: %v", log.Topics[0]) + } +} + +func (EVM2EVMOnRampAdminSet) Topic() common.Hash { + return common.HexToHash("0x8fe72c3e0020beb3234e76ae6676fa576fbfcae600af1c4fea44784cf0db329c") +} + +func (EVM2EVMOnRampCCIPSendRequested) Topic() common.Hash { + return common.HexToHash("0xd0c3c799bf9e2639de44391e7f524d229b2b55f5b1ea94b2bf7da42f7243dddd") +} + +func (EVM2EVMOnRampConfigChanged) Topic() common.Hash { + return common.HexToHash("0x9ea3374b67bf275e6bb9c8ae68f9cae023e1c528b4b27e092f0bb209d3531c19") +} + +func (EVM2EVMOnRampConfigSet) Topic() common.Hash { + return common.HexToHash("0x45b5ad483aa608464c2c7f278bd413d284d7790cdc836e40652e23a027708220") +} + +func (EVM2EVMOnRampFeeConfigSet) Topic() common.Hash { + return common.HexToHash("0x067924bf9277d905a9a4631a06d959bc032ace86b3caa835ae7e403d4f39010e") +} + +func (EVM2EVMOnRampNopPaid) Topic() common.Hash { + return common.HexToHash("0x55fdec2aab60a41fa5abb106670eb1006f5aeaee1ba7afea2bc89b5b3ec7678f") +} + +func (EVM2EVMOnRampNopsSet) Topic() common.Hash { + return common.HexToHash("0x8c337bff38141c507abd25c547606bdde78fe8c12e941ab613f3a565fea6cd24") +} + +func (EVM2EVMOnRampOwnershipTransferRequested) Topic() common.Hash { + return common.HexToHash("0xed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae1278") +} + +func (EVM2EVMOnRampOwnershipTransferred) Topic() common.Hash { + return common.HexToHash("0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0") +} + +func (EVM2EVMOnRampTokenTransferFeeConfigDeleted) Topic() common.Hash { + return common.HexToHash("0xfb95a0042158e60a33e7b5bec100f3d95407b1a71bee6633bd54b8887449750b") +} + +func (EVM2EVMOnRampTokenTransferFeeConfigSet) Topic() common.Hash { + return common.HexToHash("0xf5791bc457b3bb990493cf5f655db46c25ccf5764c9b99b8969b4c72ea7df9d0") +} + +func (EVM2EVMOnRampTokensConsumed) Topic() common.Hash { + return common.HexToHash("0x1871cdf8010e63f2eb8384381a68dfa7416dc571a5517e66e88b2d2d0c0a690a") +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRamp) Address() common.Address { + return _EVM2EVMOnRamp.address +} + +type EVM2EVMOnRampInterface interface { + CurrentRateLimiterState(opts *bind.CallOpts) (RateLimiterTokenBucket, error) + + GetDynamicConfig(opts *bind.CallOpts) (EVM2EVMOnRampDynamicConfig, error) + + GetExpectedNextSequenceNumber(opts *bind.CallOpts) (uint64, error) + + GetFee(opts *bind.CallOpts, destChainSelector uint64, message ClientEVM2AnyMessage) (*big.Int, error) + + GetFeeTokenConfig(opts *bind.CallOpts, token common.Address) (EVM2EVMOnRampFeeTokenConfig, error) + + GetNopFeesJuels(opts *bind.CallOpts) (*big.Int, error) + + GetNops(opts *bind.CallOpts) (GetNops, + + error) + + GetPoolBySourceToken(opts *bind.CallOpts, arg0 uint64, sourceToken common.Address) (common.Address, error) + + GetSenderNonce(opts *bind.CallOpts, sender common.Address) (uint64, error) + + GetStaticConfig(opts *bind.CallOpts) (EVM2EVMOnRampStaticConfig, error) + + GetSupportedTokens(opts *bind.CallOpts, arg0 uint64) ([]common.Address, error) + + GetTokenLimitAdmin(opts *bind.CallOpts) (common.Address, error) + + GetTokenTransferFeeConfig(opts *bind.CallOpts, token common.Address) (EVM2EVMOnRampTokenTransferFeeConfig, error) + + LinkAvailableForPayment(opts *bind.CallOpts) (*big.Int, error) + + Owner(opts *bind.CallOpts) (common.Address, error) + + TypeAndVersion(opts *bind.CallOpts) (string, error) + + AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) + + ForwardFromRouter(opts *bind.TransactOpts, destChainSelector uint64, message ClientEVM2AnyMessage, feeTokenAmount *big.Int, originalSender common.Address) (*types.Transaction, error) + + PayNops(opts *bind.TransactOpts) (*types.Transaction, error) + + SetAdmin(opts *bind.TransactOpts, newAdmin common.Address) (*types.Transaction, error) + + SetDynamicConfig(opts *bind.TransactOpts, dynamicConfig EVM2EVMOnRampDynamicConfig) (*types.Transaction, error) + + SetFeeTokenConfig(opts *bind.TransactOpts, feeTokenConfigArgs []EVM2EVMOnRampFeeTokenConfigArgs) (*types.Transaction, error) + + SetNops(opts *bind.TransactOpts, nopsAndWeights []EVM2EVMOnRampNopAndWeight) (*types.Transaction, error) + + SetRateLimiterConfig(opts *bind.TransactOpts, config RateLimiterConfig) (*types.Transaction, error) + + SetTokenTransferFeeConfig(opts *bind.TransactOpts, tokenTransferFeeConfigArgs []EVM2EVMOnRampTokenTransferFeeConfigArgs, tokensToUseDefaultFeeConfigs []common.Address) (*types.Transaction, error) + + TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) + + WithdrawNonLinkFees(opts *bind.TransactOpts, feeToken common.Address, to common.Address) (*types.Transaction, error) + + FilterAdminSet(opts *bind.FilterOpts) (*EVM2EVMOnRampAdminSetIterator, error) + + WatchAdminSet(opts *bind.WatchOpts, sink chan<- *EVM2EVMOnRampAdminSet) (event.Subscription, error) + + ParseAdminSet(log types.Log) (*EVM2EVMOnRampAdminSet, error) + + FilterCCIPSendRequested(opts *bind.FilterOpts) (*EVM2EVMOnRampCCIPSendRequestedIterator, error) + + WatchCCIPSendRequested(opts *bind.WatchOpts, sink chan<- *EVM2EVMOnRampCCIPSendRequested) (event.Subscription, error) + + ParseCCIPSendRequested(log types.Log) (*EVM2EVMOnRampCCIPSendRequested, error) + + FilterConfigChanged(opts *bind.FilterOpts) (*EVM2EVMOnRampConfigChangedIterator, error) + + WatchConfigChanged(opts *bind.WatchOpts, sink chan<- *EVM2EVMOnRampConfigChanged) (event.Subscription, error) + + ParseConfigChanged(log types.Log) (*EVM2EVMOnRampConfigChanged, error) + + FilterConfigSet(opts *bind.FilterOpts) (*EVM2EVMOnRampConfigSetIterator, error) + + WatchConfigSet(opts *bind.WatchOpts, sink chan<- *EVM2EVMOnRampConfigSet) (event.Subscription, error) + + ParseConfigSet(log types.Log) (*EVM2EVMOnRampConfigSet, error) + + FilterFeeConfigSet(opts *bind.FilterOpts) (*EVM2EVMOnRampFeeConfigSetIterator, error) + + WatchFeeConfigSet(opts *bind.WatchOpts, sink chan<- *EVM2EVMOnRampFeeConfigSet) (event.Subscription, error) + + ParseFeeConfigSet(log types.Log) (*EVM2EVMOnRampFeeConfigSet, error) + + FilterNopPaid(opts *bind.FilterOpts, nop []common.Address) (*EVM2EVMOnRampNopPaidIterator, error) + + WatchNopPaid(opts *bind.WatchOpts, sink chan<- *EVM2EVMOnRampNopPaid, nop []common.Address) (event.Subscription, error) + + ParseNopPaid(log types.Log) (*EVM2EVMOnRampNopPaid, error) + + FilterNopsSet(opts *bind.FilterOpts) (*EVM2EVMOnRampNopsSetIterator, error) + + WatchNopsSet(opts *bind.WatchOpts, sink chan<- *EVM2EVMOnRampNopsSet) (event.Subscription, error) + + ParseNopsSet(log types.Log) (*EVM2EVMOnRampNopsSet, error) + + FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*EVM2EVMOnRampOwnershipTransferRequestedIterator, error) + + WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *EVM2EVMOnRampOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferRequested(log types.Log) (*EVM2EVMOnRampOwnershipTransferRequested, error) + + FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*EVM2EVMOnRampOwnershipTransferredIterator, error) + + WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *EVM2EVMOnRampOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferred(log types.Log) (*EVM2EVMOnRampOwnershipTransferred, error) + + FilterTokenTransferFeeConfigDeleted(opts *bind.FilterOpts) (*EVM2EVMOnRampTokenTransferFeeConfigDeletedIterator, error) + + WatchTokenTransferFeeConfigDeleted(opts *bind.WatchOpts, sink chan<- *EVM2EVMOnRampTokenTransferFeeConfigDeleted) (event.Subscription, error) + + ParseTokenTransferFeeConfigDeleted(log types.Log) (*EVM2EVMOnRampTokenTransferFeeConfigDeleted, error) + + FilterTokenTransferFeeConfigSet(opts *bind.FilterOpts) (*EVM2EVMOnRampTokenTransferFeeConfigSetIterator, error) + + WatchTokenTransferFeeConfigSet(opts *bind.WatchOpts, sink chan<- *EVM2EVMOnRampTokenTransferFeeConfigSet) (event.Subscription, error) + + ParseTokenTransferFeeConfigSet(log types.Log) (*EVM2EVMOnRampTokenTransferFeeConfigSet, error) + + FilterTokensConsumed(opts *bind.FilterOpts) (*EVM2EVMOnRampTokensConsumedIterator, error) + + WatchTokensConsumed(opts *bind.WatchOpts, sink chan<- *EVM2EVMOnRampTokensConsumed) (event.Subscription, error) + + ParseTokensConsumed(log types.Log) (*EVM2EVMOnRampTokensConsumed, error) + + ParseLog(log types.Log) (generated.AbigenLog, error) + + Address() common.Address +} diff --git a/core/gethwrappers/ccip/generated/evm_2_evm_onramp_1_0_0/evm_2_evm_onramp_1_0_0.go b/core/gethwrappers/ccip/generated/evm_2_evm_onramp_1_0_0/evm_2_evm_onramp_1_0_0.go new file mode 100644 index 00000000000..6fd05d693a3 --- /dev/null +++ b/core/gethwrappers/ccip/generated/evm_2_evm_onramp_1_0_0/evm_2_evm_onramp_1_0_0.go @@ -0,0 +1,2792 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package evm_2_evm_onramp_1_0_0 + +import ( + "errors" + "fmt" + "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" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" +) + +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +type ClientEVM2AnyMessage struct { + Receiver []byte + Data []byte + TokenAmounts []ClientEVMTokenAmount + FeeToken common.Address + ExtraArgs []byte +} + +type ClientEVMTokenAmount struct { + Token common.Address + Amount *big.Int +} + +type EVM2EVMOnRampDynamicConfig struct { + Router common.Address + MaxTokensLength uint16 + PriceRegistry common.Address + MaxDataSize uint32 + MaxGasLimit uint64 +} + +type EVM2EVMOnRampFeeTokenConfig struct { + NetworkFeeAmountUSD *big.Int + GasMultiplier uint64 + DestGasOverhead uint32 + DestGasPerPayloadByte uint16 + Enabled bool +} + +type EVM2EVMOnRampFeeTokenConfigArgs struct { + Token common.Address + GasMultiplier uint64 + NetworkFeeAmountUSD *big.Int + DestGasOverhead uint32 + DestGasPerPayloadByte uint16 + Enabled bool +} + +type EVM2EVMOnRampNopAndWeight struct { + Nop common.Address + Weight uint16 +} + +type EVM2EVMOnRampStaticConfig struct { + LinkToken common.Address + ChainSelector uint64 + DestChainSelector uint64 + DefaultTxGasLimit uint64 + MaxNopFeesJuels *big.Int + PrevOnRamp common.Address + ArmProxy common.Address +} + +type EVM2EVMOnRampTokenTransferFeeConfig struct { + MinFee uint32 + MaxFee uint32 + Ratio uint16 +} + +type EVM2EVMOnRampTokenTransferFeeConfigArgs struct { + Token common.Address + MinFee uint32 + MaxFee uint32 + Ratio uint16 +} + +type InternalEVM2EVMMessage struct { + SourceChainSelector uint64 + SequenceNumber uint64 + FeeTokenAmount *big.Int + Sender common.Address + Nonce uint64 + GasLimit *big.Int + Strict bool + Receiver common.Address + Data []byte + TokenAmounts []ClientEVMTokenAmount + FeeToken common.Address + MessageId [32]byte +} + +type InternalPoolUpdate struct { + Token common.Address + Pool common.Address +} + +type RateLimiterConfig struct { + IsEnabled bool + Capacity *big.Int + Rate *big.Int +} + +type RateLimiterTokenBucket struct { + Tokens *big.Int + LastUpdated uint32 + IsEnabled bool + Capacity *big.Int + Rate *big.Int +} + +var EVM2EVMOnRampMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"linkToken\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"defaultTxGasLimit\",\"type\":\"uint64\"},{\"internalType\":\"uint96\",\"name\":\"maxNopFeesJuels\",\"type\":\"uint96\"},{\"internalType\":\"address\",\"name\":\"prevOnRamp\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"armProxy\",\"type\":\"address\"}],\"internalType\":\"structEVM2EVMOnRamp.StaticConfig\",\"name\":\"staticConfig\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"router\",\"type\":\"address\"},{\"internalType\":\"uint16\",\"name\":\"maxTokensLength\",\"type\":\"uint16\"},{\"internalType\":\"address\",\"name\":\"priceRegistry\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"maxDataSize\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"maxGasLimit\",\"type\":\"uint64\"}],\"internalType\":\"structEVM2EVMOnRamp.DynamicConfig\",\"name\":\"dynamicConfig\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"internalType\":\"structInternal.PoolUpdate[]\",\"name\":\"tokensAndPools\",\"type\":\"tuple[]\"},{\"internalType\":\"address[]\",\"name\":\"allowlist\",\"type\":\"address[]\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"rateLimiterConfig\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"gasMultiplier\",\"type\":\"uint64\"},{\"internalType\":\"uint96\",\"name\":\"networkFeeAmountUSD\",\"type\":\"uint96\"},{\"internalType\":\"uint32\",\"name\":\"destGasOverhead\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"destGasPerPayloadByte\",\"type\":\"uint16\"},{\"internalType\":\"bool\",\"name\":\"enabled\",\"type\":\"bool\"}],\"internalType\":\"structEVM2EVMOnRamp.FeeTokenConfigArgs[]\",\"name\":\"feeTokenConfigs\",\"type\":\"tuple[]\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"minFee\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"maxFee\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"ratio\",\"type\":\"uint16\"}],\"internalType\":\"structEVM2EVMOnRamp.TokenTransferFeeConfigArgs[]\",\"name\":\"tokenTransferFeeConfigArgs\",\"type\":\"tuple[]\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"nop\",\"type\":\"address\"},{\"internalType\":\"uint16\",\"name\":\"weight\",\"type\":\"uint16\"}],\"internalType\":\"structEVM2EVMOnRamp.NopAndWeight[]\",\"name\":\"nopsAndWeights\",\"type\":\"tuple[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"capacity\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"requested\",\"type\":\"uint256\"}],\"name\":\"AggregateValueMaxCapacityExceeded\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"minWaitInSeconds\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"available\",\"type\":\"uint256\"}],\"name\":\"AggregateValueRateLimitReached\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"BadARMSignal\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"BucketOverfilled\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InsufficientBalance\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"encodedAddress\",\"type\":\"bytes\"}],\"name\":\"InvalidAddress\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidConfig\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidExtraArgsTag\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"nop\",\"type\":\"address\"}],\"name\":\"InvalidNopAddress\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidTokenPoolConfig\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidWithdrawParams\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"LinkBalanceNotSettled\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"MaxFeeBalanceReached\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"MessageGasLimitTooHigh\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"maxSize\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"actualSize\",\"type\":\"uint256\"}],\"name\":\"MessageTooLarge\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"MustBeCalledByRouter\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NoFeesToPay\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NoNopsToPay\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"NotAFeeToken\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCallableByAdminOrOwner\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCallableByOwnerOrAdmin\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCallableByOwnerOrAdminOrNop\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"PoolAlreadyAdded\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"PoolDoesNotExist\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"PriceNotFoundForToken\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RouterMustSetOriginalSender\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"SenderNotAllowed\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"capacity\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"requested\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"}],\"name\":\"TokenMaxCapacityExceeded\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TokenPoolMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"minWaitInSeconds\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"available\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"}],\"name\":\"TokenRateLimitReached\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TooManyNops\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UnsupportedNumberOfTokens\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"contractIERC20\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"UnsupportedToken\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"AllowListAdd\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"enabled\",\"type\":\"bool\"}],\"name\":\"AllowListEnabledSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"AllowListRemove\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"sequenceNumber\",\"type\":\"uint64\"},{\"internalType\":\"uint256\",\"name\":\"feeTokenAmount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"nonce\",\"type\":\"uint64\"},{\"internalType\":\"uint256\",\"name\":\"gasLimit\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"strict\",\"type\":\"bool\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"internalType\":\"structClient.EVMTokenAmount[]\",\"name\":\"tokenAmounts\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"feeToken\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"messageId\",\"type\":\"bytes32\"}],\"indexed\":false,\"internalType\":\"structInternal.EVM2EVMMessage\",\"name\":\"message\",\"type\":\"tuple\"}],\"name\":\"CCIPSendRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"linkToken\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"defaultTxGasLimit\",\"type\":\"uint64\"},{\"internalType\":\"uint96\",\"name\":\"maxNopFeesJuels\",\"type\":\"uint96\"},{\"internalType\":\"address\",\"name\":\"prevOnRamp\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"armProxy\",\"type\":\"address\"}],\"indexed\":false,\"internalType\":\"structEVM2EVMOnRamp.StaticConfig\",\"name\":\"staticConfig\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"router\",\"type\":\"address\"},{\"internalType\":\"uint16\",\"name\":\"maxTokensLength\",\"type\":\"uint16\"},{\"internalType\":\"address\",\"name\":\"priceRegistry\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"maxDataSize\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"maxGasLimit\",\"type\":\"uint64\"}],\"indexed\":false,\"internalType\":\"structEVM2EVMOnRamp.DynamicConfig\",\"name\":\"dynamicConfig\",\"type\":\"tuple\"}],\"name\":\"ConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"gasMultiplier\",\"type\":\"uint64\"},{\"internalType\":\"uint96\",\"name\":\"networkFeeAmountUSD\",\"type\":\"uint96\"},{\"internalType\":\"uint32\",\"name\":\"destGasOverhead\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"destGasPerPayloadByte\",\"type\":\"uint16\"},{\"internalType\":\"bool\",\"name\":\"enabled\",\"type\":\"bool\"}],\"indexed\":false,\"internalType\":\"structEVM2EVMOnRamp.FeeTokenConfigArgs[]\",\"name\":\"feeConfig\",\"type\":\"tuple[]\"}],\"name\":\"FeeConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"nop\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"NopPaid\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"nopWeightsTotal\",\"type\":\"uint256\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"nop\",\"type\":\"address\"},{\"internalType\":\"uint16\",\"name\":\"weight\",\"type\":\"uint16\"}],\"indexed\":false,\"internalType\":\"structEVM2EVMOnRamp.NopAndWeight[]\",\"name\":\"nopsAndWeights\",\"type\":\"tuple[]\"}],\"name\":\"NopsSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"name\":\"PoolAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"name\":\"PoolRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"minFee\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"maxFee\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"ratio\",\"type\":\"uint16\"}],\"indexed\":false,\"internalType\":\"structEVM2EVMOnRamp.TokenTransferFeeConfigArgs[]\",\"name\":\"transferFeeConfig\",\"type\":\"tuple[]\"}],\"name\":\"TokenTransferFeeConfigSet\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"removes\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"adds\",\"type\":\"address[]\"}],\"name\":\"applyAllowListUpdates\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"internalType\":\"structInternal.PoolUpdate[]\",\"name\":\"removes\",\"type\":\"tuple[]\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"internalType\":\"structInternal.PoolUpdate[]\",\"name\":\"adds\",\"type\":\"tuple[]\"}],\"name\":\"applyPoolUpdates\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"currentRateLimiterState\",\"outputs\":[{\"components\":[{\"internalType\":\"uint128\",\"name\":\"tokens\",\"type\":\"uint128\"},{\"internalType\":\"uint32\",\"name\":\"lastUpdated\",\"type\":\"uint32\"},{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.TokenBucket\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes\",\"name\":\"receiver\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"internalType\":\"structClient.EVMTokenAmount[]\",\"name\":\"tokenAmounts\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"feeToken\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"extraArgs\",\"type\":\"bytes\"}],\"internalType\":\"structClient.EVM2AnyMessage\",\"name\":\"message\",\"type\":\"tuple\"},{\"internalType\":\"uint256\",\"name\":\"feeTokenAmount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"originalSender\",\"type\":\"address\"}],\"name\":\"forwardFromRouter\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAllowList\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAllowListEnabled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getDynamicConfig\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"router\",\"type\":\"address\"},{\"internalType\":\"uint16\",\"name\":\"maxTokensLength\",\"type\":\"uint16\"},{\"internalType\":\"address\",\"name\":\"priceRegistry\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"maxDataSize\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"maxGasLimit\",\"type\":\"uint64\"}],\"internalType\":\"structEVM2EVMOnRamp.DynamicConfig\",\"name\":\"dynamicConfig\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getExpectedNextSequenceNumber\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes\",\"name\":\"receiver\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"internalType\":\"structClient.EVMTokenAmount[]\",\"name\":\"tokenAmounts\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"feeToken\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"extraArgs\",\"type\":\"bytes\"}],\"internalType\":\"structClient.EVM2AnyMessage\",\"name\":\"message\",\"type\":\"tuple\"}],\"name\":\"getFee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"getFeeTokenConfig\",\"outputs\":[{\"components\":[{\"internalType\":\"uint96\",\"name\":\"networkFeeAmountUSD\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"gasMultiplier\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"destGasOverhead\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"destGasPerPayloadByte\",\"type\":\"uint16\"},{\"internalType\":\"bool\",\"name\":\"enabled\",\"type\":\"bool\"}],\"internalType\":\"structEVM2EVMOnRamp.FeeTokenConfig\",\"name\":\"feeTokenConfig\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getNopFeesJuels\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"\",\"type\":\"uint96\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getNops\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"nop\",\"type\":\"address\"},{\"internalType\":\"uint16\",\"name\":\"weight\",\"type\":\"uint16\"}],\"internalType\":\"structEVM2EVMOnRamp.NopAndWeight[]\",\"name\":\"nopsAndWeights\",\"type\":\"tuple[]\"},{\"internalType\":\"uint256\",\"name\":\"weightsTotal\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractIERC20\",\"name\":\"sourceToken\",\"type\":\"address\"}],\"name\":\"getPoolBySourceToken\",\"outputs\":[{\"internalType\":\"contractIPool\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"getSenderNonce\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getStaticConfig\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"linkToken\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"defaultTxGasLimit\",\"type\":\"uint64\"},{\"internalType\":\"uint96\",\"name\":\"maxNopFeesJuels\",\"type\":\"uint96\"},{\"internalType\":\"address\",\"name\":\"prevOnRamp\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"armProxy\",\"type\":\"address\"}],\"internalType\":\"structEVM2EVMOnRamp.StaticConfig\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getSupportedTokens\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getTokenLimitAdmin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"getTokenTransferFeeConfig\",\"outputs\":[{\"components\":[{\"internalType\":\"uint32\",\"name\":\"minFee\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"maxFee\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"ratio\",\"type\":\"uint16\"}],\"internalType\":\"structEVM2EVMOnRamp.TokenTransferFeeConfig\",\"name\":\"tokenTransferFeeConfig\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"linkAvailableForPayment\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"payNops\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"setAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bool\",\"name\":\"enabled\",\"type\":\"bool\"}],\"name\":\"setAllowListEnabled\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"router\",\"type\":\"address\"},{\"internalType\":\"uint16\",\"name\":\"maxTokensLength\",\"type\":\"uint16\"},{\"internalType\":\"address\",\"name\":\"priceRegistry\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"maxDataSize\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"maxGasLimit\",\"type\":\"uint64\"}],\"internalType\":\"structEVM2EVMOnRamp.DynamicConfig\",\"name\":\"dynamicConfig\",\"type\":\"tuple\"}],\"name\":\"setDynamicConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"gasMultiplier\",\"type\":\"uint64\"},{\"internalType\":\"uint96\",\"name\":\"networkFeeAmountUSD\",\"type\":\"uint96\"},{\"internalType\":\"uint32\",\"name\":\"destGasOverhead\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"destGasPerPayloadByte\",\"type\":\"uint16\"},{\"internalType\":\"bool\",\"name\":\"enabled\",\"type\":\"bool\"}],\"internalType\":\"structEVM2EVMOnRamp.FeeTokenConfigArgs[]\",\"name\":\"feeTokenConfigArgs\",\"type\":\"tuple[]\"}],\"name\":\"setFeeTokenConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"nop\",\"type\":\"address\"},{\"internalType\":\"uint16\",\"name\":\"weight\",\"type\":\"uint16\"}],\"internalType\":\"structEVM2EVMOnRamp.NopAndWeight[]\",\"name\":\"nopsAndWeights\",\"type\":\"tuple[]\"}],\"name\":\"setNops\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"config\",\"type\":\"tuple\"}],\"name\":\"setRateLimiterConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"minFee\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"maxFee\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"ratio\",\"type\":\"uint16\"}],\"internalType\":\"structEVM2EVMOnRamp.TokenTransferFeeConfigArgs[]\",\"name\":\"tokenTransferFeeConfigArgs\",\"type\":\"tuple[]\"}],\"name\":\"setTokenTransferFeeConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"feeToken\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"withdrawNonLinkFees\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", + Bin: "0x6101806040526012805460ff60c01b191690553480156200001f57600080fd5b50604051620081c9380380620081c9833981016040819052620000429162001eb3565b8333806000816200009a5760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000cd57620000cd8162000369565b50506040805160a081018252602084810180516001600160801b039081168085524263ffffffff169385018490528751151585870181905292518216606086018190529790950151166080909301839052600380546001600160a01b031916909417600160801b9283021760ff60a01b1916600160a01b90910217909255029091176004555087516001600160a01b0316158062000176575060208801516001600160401b0316155b806200018d575060408801516001600160401b0316155b80620001a4575060608801516001600160401b0316155b80620001bb575060c08801516001600160a01b0316155b15620001da576040516306b7c75960e31b815260040160405180910390fd5b6020808901516040808b015181517fbdd59ac4dd1d82276c9a9c5d2656546346b9dcdb1f9b4204aed4ec15c23d7d3a948101949094526001600160401b039283169184019190915216606082015230608082015260a00160408051601f19818403018152918152815160209283012060809081528a516001600160a01b0390811660e052928b01516001600160401b0390811661010052918b015182166101205260608b015190911660a0908152908a01516001600160601b031660c0908152908a01518216610140528901511661016052620002b78762000414565b620002c28362000566565b620002cd82620006d8565b620002d881620007e5565b6040805160008082526020820190925262000323916200031b565b6040805180820190915260008082526020820152815260200190600190039081620002f35790505b508762000a0f565b8451156200035b576012805460ff60c81b1916600160c81b179055604080516000808252602082019092526200035b91508662000d12565b505050505050505062002405565b336001600160a01b03821603620003c35760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640162000091565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b60408101516001600160a01b031662000440576040516306b7c75960e31b815260040160405180910390fd5b8051600580546020808501516001600160a01b039485166001600160b01b031990931692909217600160a01b61ffff909316830217909255604080850151600680546060808901516080808b0151958a166001600160c01b03199094169390931763ffffffff909116909602959095176001600160c01b0316600160c01b6001600160401b039485160217909155825160e080820185525187168152610100518316958101959095526101205182168584015260a080519092169385019390935260c080516001600160601b03169385019390935261014051851690840152610160519093169082015290517fdd226617d8d287f40a64c54741bbcdc492b3e096ef16bc5273a18cb6ab85f124916200055b91849062001fd6565b60405180910390a150565b60005b8151811015620006a65760008282815181106200058a576200058a62002086565b6020908102919091018101516040805160a08082018352828401516001600160601b039081168352848601516001600160401b0390811684880190815260608088015163ffffffff9081168789019081526080808b015161ffff908116948a01948552978b0151151590890190815299516001600160a01b03166000908152600f909b52979099209551865492519751915198511515600160d01b0260ff60d01b1999909616600160c01b0261ffff60c01b1992909a16600160a01b029190911665ffffffffffff60a01b19979093166c01000000000000000000000000026001600160a01b03199092169316929092179190911793909316929092179390931791909116179055506200069e81620020b2565b905062000569565b507ffba339fca97870ffdfaedbae3745db5e6de1a6909dfd0e0dbb56917469ffe236816040516200055b9190620020ce565b60005b8151811015620007b3576000828281518110620006fc57620006fc62002086565b60209081029190910181015160408051606080820183528385015163ffffffff90811683528385015181168387019081529185015161ffff90811684860190815295516001600160a01b031660009081526010909752939095209151825491519451909316680100000000000000000261ffff60401b19948616640100000000026001600160401b03199092169390951692909217919091179190911691909117905550620007ab81620020b2565b9050620006db565b507fcb0c5f472d325cf0c56953fc81870ddd80d0d3c9a3fbfe777002d75f380dfb81816040516200055b91906200216f565b805160408111156200080a57604051635ad0867d60e11b815260040160405180910390fd5b6012546c01000000000000000000000000900463ffffffff161580159062000854575060125463ffffffff6c010000000000000000000000008204166001600160601b0390911610155b1562000864576200086462000e5d565b60006200087260076200105d565b90505b8015620008be576000620008986200088f600184620021de565b60079062001070565b509050620008a86007826200108e565b505080620008b690620021f4565b905062000875565b506000805b82811015620009a6576000848281518110620008e357620008e362002086565b6020026020010151600001519050600085838151811062000908576200090862002086565b602002602001015160200151905060e0516001600160a01b0316826001600160a01b031614806200094057506001600160a01b038216155b156200096b57604051634de938d160e01b81526001600160a01b038316600482015260240162000091565b6200097d60078361ffff8416620010ac565b506200098e61ffff8216856200220e565b93505050806200099e90620020b2565b9050620008c3565b506012805463ffffffff60601b19166c0100000000000000000000000063ffffffff8416021790556040517f8c337bff38141c507abd25c547606bdde78fe8c12e941ab613f3a565fea6cd249062000a0290839086906200222e565b60405180910390a1505050565b60005b825181101562000b4b57600083828151811062000a335762000a3362002086565b6020026020010151600001519050600084838151811062000a585762000a5862002086565b6020908102919091018101510151905062000a75600a83620010cc565b62000a9f576040516373913ebd60e01b81526001600160a01b038316600482015260240162000091565b6001600160a01b03811662000ab6600a84620010e3565b6001600160a01b03161462000ade57604051630d98f73360e31b815260040160405180910390fd5b62000aeb600a83620010fa565b1562000b3557604080516001600160a01b038085168252831660208201527f987eb3c2f78454541205f72f34839b434c306c9eaf4922efd7c0c3060fdb2e4c910160405180910390a15b50508062000b4390620020b2565b905062000a12565b5060005b815181101562000d0d57600082828151811062000b705762000b7062002086565b6020026020010151600001519050600083838151811062000b955762000b9562002086565b602002602001015160200151905060006001600160a01b0316826001600160a01b0316148062000bcc57506001600160a01b038116155b1562000bea5760405162d8548360e71b815260040160405180910390fd5b806001600160a01b03166321df0da76040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000c29573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000c4f91906200229b565b6001600160a01b0316826001600160a01b03161462000c8157604051630d98f73360e31b815260040160405180910390fd5b62000c8f600a838362001111565b1562000cde57604080516001600160a01b038085168252831660208201527f95f865c2808f8b2a85eea2611db7843150ee7835ef1403f9755918a97d76933c910160405180910390a162000cf7565b604051633caf458560e01b815260040160405180910390fd5b50508062000d0590620020b2565b905062000b4f565b505050565b60005b825181101562000da757600083828151811062000d365762000d3662002086565b6020908102919091010151905062000d50600d8262001129565b1562000d93576040516001600160a01b03821681527f800671136ab6cfee9fbe5ed1fb7ca417811aca3cf864800d127b927adedf75669060200160405180910390a15b5062000d9f81620020b2565b905062000d15565b5060005b815181101562000d0d57600082828151811062000dcc5762000dcc62002086565b6020026020010151905060006001600160a01b0316816001600160a01b03160362000df8575062000e4a565b62000e05600d8262001140565b1562000e48576040516001600160a01b03821681527f2640d4d76caf8bf478aabfa982fa4e1c4eb71a37f93cd15e80dbc657911546d89060200160405180910390a15b505b62000e5581620020b2565b905062000dab565b6000546001600160a01b0316331480159062000e8457506002546001600160a01b03163314155b801562000e9b575062000e9960073362001157565b155b1562000eba5760405163032bb72b60e31b815260040160405180910390fd5b6012546c01000000000000000000000000900463ffffffff16600081900362000ef65760405163990e30bf60e01b815260040160405180910390fd5b6012546001600160601b03168181101562000f24576040516311a1ee3b60e31b815260040160405180910390fd5b600062000f306200116e565b121562000f5057604051631e9acf1760e31b815260040160405180910390fd5b80600062000f5f60076200105d565b905060005b81811015620010375760008062000f7d60078462001070565b909250905060008762000f9a836001600160601b038a16620022bb565b62000fa69190620022d5565b905062000fb48187620022f8565b60e05190965062000fd9906001600160a01b0316846001600160601b038416620011fc565b6040516001600160601b03821681526001600160a01b038416907f55fdec2aab60a41fa5abb106670eb1006f5aeaee1ba7afea2bc89b5b3ec7678f9060200160405180910390a2505050806200102f90620020b2565b905062000f64565b5050601280546001600160601b0319166001600160601b03929092169190911790555050565b60006200106a8262001254565b92915050565b600080808062001081868662001261565b9097909650945050505050565b6000620010a5836001600160a01b0384166200128e565b9392505050565b6000620010c4846001600160a01b03851684620012ad565b949350505050565b6000620010a5836001600160a01b038416620012cc565b6000620010a5836001600160a01b038416620012da565b6000620010a5836001600160a01b038416620012e8565b6000620010c4846001600160a01b03851684620012f6565b6000620010a5836001600160a01b0384166200130e565b6000620010a5836001600160a01b03841662001419565b6000620010a5836001600160a01b0384166200146b565b60125460e0516040516370a0823160e01b81523060048201526000926001600160601b0316916001600160a01b0316906370a0823190602401602060405180830381865afa158015620011c5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620011eb91906200231b565b620011f7919062002335565b905090565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b0390811663a9059cbb60e01b1790915262000d0d9185916200147916565b60006200106a826200154a565b6000808062001271858562001555565b600081815260029690960160205260409095205494959350505050565b60008181526002830160205260408120819055620010a5838362001563565b60008281526002840160205260408120829055620010c4848462001571565b6000620010a583836200146b565b6000620010a583836200157f565b6000620010a583836200128e565b6000620010c484846001600160a01b038516620012ad565b600081815260018301602052604081205480156200140757600062001335600183620021de565b85549091506000906200134b90600190620021de565b9050818114620013b75760008660000182815481106200136f576200136f62002086565b906000526020600020015490508087600001848154811062001395576200139562002086565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080620013cb57620013cb62002358565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506200106a565b60009150506200106a565b5092915050565b600081815260018301602052604081205462001462575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556200106a565b5060006200106a565b6000620010a58383620015f4565b6040805180820190915260208082527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c656490820152600090620014c8906001600160a01b0385169084906200160d565b80519091501562000d0d5780806020019051810190620014e991906200236e565b62000d0d5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840162000091565b60006200106a825490565b6000620010a583836200161e565b6000620010a583836200130e565b6000620010a5838362001419565b600081815260028301602052604081205480151580620015a65750620015a684846200146b565b620010a55760405162461bcd60e51b815260206004820152601e60248201527f456e756d657261626c654d61703a206e6f6e6578697374656e74206b65790000604482015260640162000091565b60008181526001830160205260408120541515620010a5565b6060620010c484846000856200164b565b600082600001828154811062001638576200163862002086565b9060005260206000200154905092915050565b606082471015620016ae5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840162000091565b600080866001600160a01b03168587604051620016cc9190620023b2565b60006040518083038185875af1925050503d80600081146200170b576040519150601f19603f3d011682016040523d82523d6000602084013e62001710565b606091505b50909250905062001724878383876200172f565b979650505050505050565b60608315620017a35782516000036200179b576001600160a01b0385163b6200179b5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640162000091565b5081620010c4565b620010c48383815115620017ba5781518083602001fd5b8060405162461bcd60e51b8152600401620000919190620023d0565b634e487b7160e01b600052604160045260246000fd5b604080519081016001600160401b0381118282101715620018115762001811620017d6565b60405290565b60405160c081016001600160401b0381118282101715620018115762001811620017d6565b604051608081016001600160401b0381118282101715620018115762001811620017d6565b604051601f8201601f191681016001600160401b03811182821017156200188c576200188c620017d6565b604052919050565b6001600160a01b0381168114620018aa57600080fd5b50565b80516001600160401b0381168114620018c557600080fd5b919050565b80516001600160601b0381168114620018c557600080fd5b600060e08284031215620018f557600080fd5b60405160e081016001600160401b03811182821017156200191a576200191a620017d6565b806040525080915082516200192f8162001894565b81526200193f60208401620018ad565b60208201526200195260408401620018ad565b60408201526200196560608401620018ad565b60608201526200197860808401620018ca565b608082015260a08301516200198d8162001894565b60a082015260c0830151620019a28162001894565b60c0919091015292915050565b805161ffff81168114620018c557600080fd5b805163ffffffff81168114620018c557600080fd5b600060a08284031215620019ea57600080fd5b60405160a081016001600160401b038111828210171562001a0f5762001a0f620017d6565b8060405250809150825162001a248162001894565b815262001a3460208401620019af565b6020820152604083015162001a498162001894565b604082015262001a5c60608401620019c2565b606082015262001a6f60808401620018ad565b60808201525092915050565b60006001600160401b0382111562001a975762001a97620017d6565b5060051b60200190565b600082601f83011262001ab357600080fd5b8151602062001acc62001ac68362001a7b565b62001861565b82815260069290921b8401810191818101908684111562001aec57600080fd5b8286015b8481101562001b46576040818903121562001b0b5760008081fd5b62001b15620017ec565b815162001b228162001894565b81528185015162001b338162001894565b8186015283529183019160400162001af0565b509695505050505050565b600082601f83011262001b6357600080fd5b8151602062001b7662001ac68362001a7b565b82815260059290921b8401810191818101908684111562001b9657600080fd5b8286015b8481101562001b4657805162001bb08162001894565b835291830191830162001b9a565b80518015158114620018c557600080fd5b80516001600160801b0381168114620018c557600080fd5b60006060828403121562001bfa57600080fd5b604051606081016001600160401b038111828210171562001c1f5762001c1f620017d6565b60405290508062001c308362001bbe565b815262001c406020840162001bcf565b602082015262001c536040840162001bcf565b60408201525092915050565b600082601f83011262001c7157600080fd5b8151602062001c8462001ac68362001a7b565b82815260c0928302850182019282820191908785111562001ca457600080fd5b8387015b8581101562001d465781818a03121562001cc25760008081fd5b62001ccc62001817565b815162001cd98162001894565b815262001ce8828701620018ad565b86820152604062001cfb818401620018ca565b90820152606062001d0e838201620019c2565b90820152608062001d21838201620019af565b9082015260a062001d3483820162001bbe565b90820152845292840192810162001ca8565b5090979650505050505050565b600082601f83011262001d6557600080fd5b8151602062001d7862001ac68362001a7b565b82815260079290921b8401810191818101908684111562001d9857600080fd5b8286015b8481101562001b46576080818903121562001db75760008081fd5b62001dc16200183c565b815162001dce8162001894565b815262001ddd828601620019c2565b85820152604062001df0818401620019c2565b90820152606062001e03838201620019af565b9082015283529183019160800162001d9c565b600082601f83011262001e2857600080fd5b8151602062001e3b62001ac68362001a7b565b82815260069290921b8401810191818101908684111562001e5b57600080fd5b8286015b8481101562001b46576040818903121562001e7a5760008081fd5b62001e84620017ec565b815162001e918162001894565b815262001ea0828601620019af565b8186015283529183019160400162001e5f565b600080600080600080600080610280898b03121562001ed157600080fd5b62001edd8a8a620018e2565b975062001eee8a60e08b01620019d7565b6101808a01519097506001600160401b038082111562001f0d57600080fd5b62001f1b8c838d0162001aa1565b97506101a08b015191508082111562001f3357600080fd5b62001f418c838d0162001b51565b965062001f538c6101c08d0162001be7565b95506102208b015191508082111562001f6b57600080fd5b62001f798c838d0162001c5f565b94506102408b015191508082111562001f9157600080fd5b62001f9f8c838d0162001d53565b93506102608b015191508082111562001fb757600080fd5b5062001fc68b828c0162001e16565b9150509295985092959890939650565b82516001600160a01b0390811682526020808501516001600160401b03908116828501526040808701518216818601526060808801518316818701526080808901516001600160601b03168188015260a0808a015187169088015260c0808a01518716908801528751861660e08801529387015161ffff16610100870152908601519093166101208501529184015163ffffffff16610140840152830151166101608201526101808101620010a5565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201620020c757620020c76200209c565b5060010190565b602080825282518282018190526000919060409081850190868401855b828110156200216257815180516001600160a01b03168552868101516001600160401b031687860152858101516001600160601b03168686015260608082015163ffffffff169086015260808082015161ffff169086015260a09081015115159085015260c09093019290850190600101620020eb565b5091979650505050505050565b602080825282518282018190526000919060409081850190868401855b828110156200216257815180516001600160a01b031685528681015163ffffffff9081168887015286820151168686015260609081015161ffff1690850152608090930192908501906001016200218c565b818103818111156200106a576200106a6200209c565b6000816200220657620022066200209c565b506000190190565b63ffffffff8181168382160190808211156200141257620014126200209c565b6000604080830163ffffffff8616845260208281860152818651808452606087019150828801935060005b818110156200228d57845180516001600160a01b0316845284015161ffff1684840152938301939185019160010162002259565b509098975050505050505050565b600060208284031215620022ae57600080fd5b8151620010a58162001894565b80820281158282048414176200106a576200106a6200209c565b600082620022f357634e487b7160e01b600052601260045260246000fd5b500490565b6001600160601b038281168282160390808211156200141257620014126200209c565b6000602082840312156200232e57600080fd5b5051919050565b81810360008312801583831316838312821617156200141257620014126200209c565b634e487b7160e01b600052603160045260246000fd5b6000602082840312156200238157600080fd5b620010a58262001bbe565b60005b83811015620023a95781810151838201526020016200238f565b50506000910152565b60008251620023c68184602087016200238c565b9190910192915050565b6020815260008251806020840152620023f18160408501602087016200238c565b601f01601f19169190910160400192915050565b60805160a05160c05160e05161010051610120516101405161016051615cbd6200250c600039600081816103600152818161140a0152612c2001526000818161033101528181611320015281816113880152818161185a015281816118c20152612bf801526000818161029d01528181610af901528181611c520152612b7001526000818161026d0152818161198d0152612b4601526000818161023e01528181610dfa0152818161160d01528181611706015281816121a501528181612b2101528181612d6b015261323c0152600081816102fd015281816117d20152612bc20152600081816102cd015281816122bd0152612b9701526000611b6c0152615cbd6000f3fe608060405234801561001057600080fd5b50600436106101f05760003560e01c806376f6ae761161010f578063b06d41bc116100a2578063e0351e1311610071578063e0351e13146108ee578063efeadb6d14610921578063eff7cc4814610934578063f2fde38b1461093c57600080fd5b8063b06d41bc146108b5578063c92b2832146108cb578063d09dc339146108de578063d3c7c2c7146108e657600080fd5b80638da5cb5b116100de5780638da5cb5b146107105780639a113c3614610721578063a7cd63b71461088d578063a7d3e02f146108a257600080fd5b806376f6ae76146106cf578063799c3a67146106e257806379ba5097146106f5578063856c8247146106fd57600080fd5b8063549e946f116101875780635d86f141116101565780635d86f141146105d45780635ebbd9f8146105e7578063704b6c02146105fa5780637437ff9f1461060d57600080fd5b8063549e946f1461056957806354b714681461057c57806354c8a4f31461059c578063599f6431146105af57600080fd5b80633a87ac53116101c35780633a87ac53146104bc5780633a9bf949146104d15780634120fccd146104e4578063546719cd1461050557600080fd5b806306285c69146101f55780631772047e146103a6578063181f5a771461045257806338724a951461049b575b600080fd5b6103906040805160e081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c08101919091526040518060e001604052807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031681526020017f000000000000000000000000000000000000000000000000000000000000000067ffffffffffffffff1681526020017f000000000000000000000000000000000000000000000000000000000000000067ffffffffffffffff1681526020017f000000000000000000000000000000000000000000000000000000000000000067ffffffffffffffff1681526020017f00000000000000000000000000000000000000000000000000000000000000006bffffffffffffffffffffffff1681526020017f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031681526020017f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316815250905090565b60405161039d9190614822565b60405180910390f35b6104216103b43660046148b3565b6040805160608082018352600080835260208084018290529284018190526001600160a01b039490941684526010825292829020825193840183525463ffffffff80821685526401000000008204169184019190915268010000000000000000900461ffff169082015290565b60408051825163ffffffff9081168252602080850151909116908201529181015161ffff169082015260600161039d565b61048e6040518060400160405280601381526020017f45564d3245564d4f6e52616d7020312e302e300000000000000000000000000081525081565b60405161039d919061493e565b6104ae6104a9366004614963565b61094f565b60405190815260200161039d565b6104cf6104ca366004614b4a565b610c8d565b005b6104cf6104df366004614bef565b610ca3565b6104ec610cb7565b60405167ffffffffffffffff909116815260200161039d565b61050d610ceb565b60405161039d919081516fffffffffffffffffffffffffffffffff908116825260208084015163ffffffff1690830152604080840151151590830152606080840151821690830152608092830151169181019190915260a00190565b6104cf610577366004614c83565b610d9b565b6012546040516bffffffffffffffffffffffff909116815260200161039d565b6104cf6105aa366004614d20565b610f50565b6002546001600160a01b03165b6040516001600160a01b03909116815260200161039d565b6105bc6105e23660046148b3565b610f62565b6104cf6105f5366004614d7a565b610fc1565b6104cf6106083660046148b3565b611027565b6106c26040805160a081018252600080825260208201819052918101829052606081018290526080810191909152506040805160a0810182526005546001600160a01b038082168352740100000000000000000000000000000000000000009182900461ffff16602084015260065490811693830193909352820463ffffffff166060820152780100000000000000000000000000000000000000000000000090910467ffffffffffffffff16608082015290565b60405161039d9190614e58565b6104cf6106dd366004614eb2565b6110f1565b6104cf6106f0366004614f40565b6111a9565b6104cf61120f565b6104ec61070b3660046148b3565b6112f2565b6000546001600160a01b03166105bc565b61082761072f3660046148b3565b6040805160a081018252600080825260208201819052918101829052606081018290526080810191909152506001600160a01b03166000908152600f6020908152604091829020825160a08101845290546bffffffffffffffffffffffff811682526c01000000000000000000000000810467ffffffffffffffff169282019290925274010000000000000000000000000000000000000000820463ffffffff16928101929092527801000000000000000000000000000000000000000000000000810461ffff1660608301527a010000000000000000000000000000000000000000000000000000900460ff161515608082015290565b60405161039d9190600060a0820190506bffffffffffffffffffffffff835116825267ffffffffffffffff602084015116602083015263ffffffff604084015116604083015261ffff606084015116606083015260808301511515608083015292915050565b6108956113fa565b60405161039d919061505e565b6104ae6108b03660046150ab565b611406565b6108bd611d39565b60405161039d929190615159565b6104cf6108d936600461519b565b611e3d565b6104ae611ea5565b610895611eaf565b601254790100000000000000000000000000000000000000000000000000900460ff16604051901515815260200161039d565b6104cf61092f366004615209565b611f60565b6104cf611fe6565b6104cf61094a3660046148b3565b61227d565b600080600f8161096560808601606087016148b3565b6001600160a01b031681526020808201929092526040908101600020815160a08101835290546bffffffffffffffffffffffff811682526c01000000000000000000000000810467ffffffffffffffff169382019390935274010000000000000000000000000000000000000000830463ffffffff16918101919091527801000000000000000000000000000000000000000000000000820461ffff1660608201527a01000000000000000000000000000000000000000000000000000090910460ff16151560808201819052909150610a8c57610a4960808401606085016148b3565b6040517fa7499d200000000000000000000000000000000000000000000000000000000081526001600160a01b0390911660048201526024015b60405180910390fd5b60065460009081906001600160a01b031663ffdb4b37610ab260808801606089016148b3565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b1681526001600160a01b03909116600482015267ffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001660248201526044016040805180830381865afa158015610b3d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b61919061524e565b91509150600083600001516bffffffffffffffffffffffff16670de0b6b3a7640000856020015167ffffffffffffffff16866060015161ffff16898060200190610bab9190615281565b610bb6929150615315565b604088015163ffffffff16610bd6610bd160808d018d615281565b61228e565b51610be1919061532c565b610beb919061532c565b610bf59190615315565b610c199077ffffffffffffffffffffffffffffffffffffffffffffffff8616615315565b610c23919061533f565b610c2d919061532c565b9050610c55610c4260808801606089016148b3565b84610c5060408a018a61537a565b612382565b610c7977ffffffffffffffffffffffffffffffffffffffffffffffff8516836125ce565b610c83919061532c565b9695505050505050565b610c95612607565b610c9f828261267d565b5050565b610cab612607565b610cb4816129dd565b50565b601254600090610ce690700100000000000000000000000000000000900467ffffffffffffffff1660016153e2565b905090565b6040805160a0810182526000808252602082018190529181018290526060810182905260808101919091526040805160a0810182526003546fffffffffffffffffffffffffffffffff808216835270010000000000000000000000000000000080830463ffffffff1660208501527401000000000000000000000000000000000000000090920460ff161515938301939093526004548084166060840152049091166080820152610ce690612c76565b6000546001600160a01b03163314801590610dc157506002546001600160a01b03163314155b15610df8576040517ffbdb8e5600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b03161480610e3f57506001600160a01b038116155b15610e76576040517f232cb97f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000610e80612d28565b1215610eb8576040517f02075e0000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152610c9f9082906001600160a01b038516906370a0823190602401602060405180830381865afa158015610f1b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f3f9190615403565b6001600160a01b0385169190612de8565b610f58612607565b610c9f8282612e68565b6000610f6f600a83612fa3565b610fb0576040517fbf16aab60000000000000000000000000000000000000000000000000000000081526001600160a01b0383166004820152602401610a83565b610fbb600a83612fb8565b92915050565b6000546001600160a01b03163314801590610fe757506002546001600160a01b03163314155b1561101e576040517ffbdb8e5600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610cb481612fcd565b6000546001600160a01b0316331480159061104d57506002546001600160a01b03163314155b15611084576040517ff6cd562000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600280547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0383169081179091556040519081527f8fe72c3e0020beb3234e76ae6676fa576fbfcae600af1c4fea44784cf0db329c906020015b60405180910390a150565b6000546001600160a01b0316331480159061111757506002546001600160a01b03163314155b1561114e576040517ffbdb8e5600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610c9f8282808060200260200160405190810160405280939291908181526020016000905b8282101561119f576111906040830286013681900381019061541c565b81526020019060010190611173565b5050505050613103565b6000546001600160a01b031633148015906111cf57506002546001600160a01b03163314155b15611206576040517ffbdb8e5600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610cb481613376565b6001546001600160a01b03163314611283576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e6572000000000000000000006044820152606401610a83565b60008054337fffffffffffffffffffffffff0000000000000000000000000000000000000000808316821784556001805490911690556040516001600160a01b0390921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b6001600160a01b03811660009081526011602052604081205467ffffffffffffffff168015801561134b57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031615155b15610fbb576040517f856c82470000000000000000000000000000000000000000000000000000000081526001600160a01b0384811660048301527f0000000000000000000000000000000000000000000000000000000000000000169063856c824790602401602060405180830381865afa1580156113cf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113f3919061545b565b9392505050565b6060610ce6600d613585565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663397796f76040518163ffffffff1660e01b8152600401602060405180830381865afa158015611466573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061148a9190615478565b156114c1576040517fc148371500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6114cb8480615281565b9050602014611512576114de8480615281565b6040517f370d875f000000000000000000000000000000000000000000000000000000008152600401610a839291906154de565b600061151e8580615281565b81019061152b91906154f2565b90506001600160a01b038111806115425750600a81105b15611551576114de8580615281565b6000611563610bd16080880188615281565b905061158f6115756020880188615281565b835190915061158760408a018a61537a565b905087613592565b61160361159f604088018861537a565b808060200260200160405190810160405280939291908181526020016000905b828210156115eb576115dc6040830286013681900381019061550b565b815260200190600101906115bf565b50506006546001600160a01b031692506137b5915050565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001661163d60808801606089016148b3565b6001600160a01b0316036116a1576012805486919060009061166e9084906bffffffffffffffffffffffff16615545565b92506101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055506117c0565b6006546001600160a01b03166241e5be6116c16080890160608a016148b3565b60405160e083901b7fffffffff000000000000000000000000000000000000000000000000000000001681526001600160a01b039182166004820152602481018990527f00000000000000000000000000000000000000000000000000000000000000009091166044820152606401602060405180830381865afa15801561174d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117719190615403565b601280546000906117919084906bffffffffffffffffffffffff16615545565b92506101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055505b6012546bffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000081169116111561182d576040517fe5c7a49100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b03841660009081526011602052604090205467ffffffffffffffff1615801561188557507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031615155b1561197d576040517f856c82470000000000000000000000000000000000000000000000000000000081526001600160a01b0385811660048301527f0000000000000000000000000000000000000000000000000000000000000000169063856c824790602401602060405180830381865afa158015611909573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061192d919061545b565b6001600160a01b038516600090815260116020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000001667ffffffffffffffff929092169190911790555b60006040518061018001604052807f000000000000000000000000000000000000000000000000000000000000000067ffffffffffffffff1681526020016012601081819054906101000a900467ffffffffffffffff166119dd9061556a565b825467ffffffffffffffff9182166101009390930a8381029083021990911617909255825260208083018a90526001600160a01b03891660408085018290526000918252601190925290812080546060909401939092611a3d911661556a565b91906101000a81548167ffffffffffffffff021916908367ffffffffffffffff160217905567ffffffffffffffff16815260200183600001518152602001600015158152602001846001600160a01b03168152602001888060200190611aa39190615281565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250505090825250602001611aea60408a018a61537a565b808060200260200160405190810160405280939291908181526020016000905b82821015611b3657611b276040830286013681900381019061550b565b81526020019060010190611b0a565b5050509183525050602001611b5160808a0160608b016148b3565b6001600160a01b0316815260006020909101529050611b90817f000000000000000000000000000000000000000000000000000000000000000061396e565b61016082015260005b611ba6604089018961537a565b9050811015611cf2576000611bbe60408a018a61537a565b83818110611bce57611bce615591565b905060400201803603810190611be4919061550b565b9050611bf38160000151610f62565b6001600160a01b0316639687544588611c0c8c80615281565b60208087015160408051928301815260008352517fffffffff0000000000000000000000000000000000000000000000000000000060e088901b168152611c7a959493927f0000000000000000000000000000000000000000000000000000000000000000916004016155c0565b6000604051808303816000875af1158015611c99573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201604052611cdf9190810190615618565b505080611ceb906156ca565b9050611b99565b507faffc45517195d6499808c643bd4a7b0ffeedf95bea5852840d7bfcf63f59e82181604051611d229190615746565b60405180910390a161016001519695505050505050565b6060600080611d486007613a78565b90508067ffffffffffffffff811115611d6357611d63614998565b604051908082528060200260200182016040528015611da857816020015b6040805180820190915260008082526020820152815260200190600190039081611d815790505b50925060005b81811015611e1a57600080611dc4600784613a83565b915091506040518060400160405280836001600160a01b031681526020018261ffff16815250868481518110611dfc57611dfc615591565b6020026020010181905250505080611e13906156ca565b9050611dae565b505060125491926c0100000000000000000000000090920463ffffffff16919050565b6000546001600160a01b03163314801590611e6357506002546001600160a01b03163314155b15611e9a576040517ff6cd562000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610cb4600382613aa1565b6000610ce6612d28565b60606000611ebd600a613c79565b67ffffffffffffffff811115611ed557611ed5614998565b604051908082528060200260200182016040528015611efe578160200160208202803683370190505b50905060005b8151811015611f5a57611f18600a82613c84565b50828281518110611f2b57611f2b615591565b60200260200101816001600160a01b03166001600160a01b03168152505080611f53906156ca565b9050611f04565b50919050565b611f68612607565b60128054821515790100000000000000000000000000000000000000000000000000027fffffffffffff00ffffffffffffffffffffffffffffffffffffffffffffffffff9091161790556040517fccf4daf6ab6430389f26b970595dab82a5881ad454770907e415ede27c8df032906110e690831515815260200190565b6000546001600160a01b0316331480159061200c57506002546001600160a01b03163314155b8015612020575061201e600733613c93565b155b15612057576040517f195db95800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6012546c01000000000000000000000000900463ffffffff1660008190036120ab576040517f990e30bf00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6012546bffffffffffffffffffffffff16818110156120f6576040517f8d0f71d800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000612100612d28565b1215612138576040517ff4d678b800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8060006121456007613a78565b905060005b8181101561223a57600080612160600784613a83565b9092509050600087612180836bffffffffffffffffffffffff8a16615315565b61218a919061533f565b90506121968187615883565b95506121da6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016846bffffffffffffffffffffffff8416612de8565b6040516bffffffffffffffffffffffff821681526001600160a01b038416907f55fdec2aab60a41fa5abb106670eb1006f5aeaee1ba7afea2bc89b5b3ec7678f9060200160405180910390a250505080612233906156ca565b905061214a565b5050601280547fffffffffffffffffffffffffffffffffffffffff000000000000000000000000166bffffffffffffffffffffffff929092169190911790555050565b612285612607565b610cb481613ca8565b60408051602081019091526000815260008290036122e45750604080516020810190915267ffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168152610fbb565b7f97a657c90000000000000000000000000000000000000000000000000000000061230f83856158a8565b7fffffffff000000000000000000000000000000000000000000000000000000001614612368576040517f5247fdce00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61237582600481866158f0565b8101906113f3919061591a565b6000818082036123965760009150506125c6565b60005b818110156125c35760008585838181106123b5576123b5615591565b9050604002018036038101906123cb919061550b565b80516001600160a01b031660009081526010602090815260408083208151606081018352905463ffffffff8082168352640100000000820416938201939093526801000000000000000090920461ffff16908201819052929350911561252257825189906001600160a01b038c81169116146124cc5760065484516040517f4ab35b0b0000000000000000000000000000000000000000000000000000000081526001600160a01b039182166004820152911690634ab35b0b90602401602060405180830381865afa1580156124a5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124c9919061595c565b90505b620186a0836040015161ffff1661250a86602001518477ffffffffffffffffffffffffffffffffffffffffffffffff16613d8390919063ffffffff16565b6125149190615315565b61251e919061533f565b9150505b815160009061253e9063ffffffff16662386f26fc10000615315565b90506000836020015163ffffffff16662386f26fc1000061255f9190615315565b9050818310156125715781925061257d565b8083111561257d578092505b6125a177ffffffffffffffffffffffffffffffffffffffffffffffff8c16846125ce565b6125ab908961532c565b97505050505050806125bc906156ca565b9050612399565b50505b949350505050565b600077ffffffffffffffffffffffffffffffffffffffffffffffff83166125fd83670de0b6b3a7640000615315565b6113f3919061533f565b6000546001600160a01b0316331461267b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e6572000000000000000000006044820152606401610a83565b565b60005b82518110156127de57600083828151811061269d5761269d615591565b602002602001015160000151905060008483815181106126bf576126bf615591565b60200260200101516020015190506126e182600a612fa390919063ffffffff16565b612722576040517f73913ebd0000000000000000000000000000000000000000000000000000000081526001600160a01b0383166004820152602401610a83565b6001600160a01b038116612737600a84612fb8565b6001600160a01b031614612777576040517f6cc7b99800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b612782600a83613db2565b156127cb57604080516001600160a01b038085168252831660208201527f987eb3c2f78454541205f72f34839b434c306c9eaf4922efd7c0c3060fdb2e4c910160405180910390a15b5050806127d7906156ca565b9050612680565b5060005b81518110156129d85760008282815181106127ff576127ff615591565b6020026020010151600001519050600083838151811061282157612821615591565b602002602001015160200151905060006001600160a01b0316826001600160a01b0316148061285757506001600160a01b038116155b1561288e576040517f6c2a418000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b806001600160a01b03166321df0da76040518163ffffffff1660e01b8152600401602060405180830381865afa1580156128cc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128f09190615977565b6001600160a01b0316826001600160a01b03161461293a576040517f6cc7b99800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b612946600a8383613dc7565b1561299357604080516001600160a01b038085168252831660208201527f95f865c2808f8b2a85eea2611db7843150ee7835ef1403f9755918a97d76933c910160405180910390a16129c5565b6040517f3caf458500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5050806129d1906156ca565b90506127e2565b505050565b60408101516001600160a01b0316612a21576040517f35be3ac800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8051600580546020808501516001600160a01b039485167fffffffffffffffffffff00000000000000000000000000000000000000000000909316929092177401000000000000000000000000000000000000000061ffff909316830217909255604080850151600680546060808901516080808b0151958a167fffffffffffffffff0000000000000000000000000000000000000000000000009094169390931763ffffffff9091169096029590951777ffffffffffffffffffffffffffffffffffffffffffffffff16780100000000000000000000000000000000000000000000000067ffffffffffffffff9485160217909155825160e0810184527f0000000000000000000000000000000000000000000000000000000000000000871681527f00000000000000000000000000000000000000000000000000000000000000008316958101959095527f00000000000000000000000000000000000000000000000000000000000000008216858401527f0000000000000000000000000000000000000000000000000000000000000000909116928401929092527f00000000000000000000000000000000000000000000000000000000000000006bffffffffffffffffffffffff16918301919091527f0000000000000000000000000000000000000000000000000000000000000000831660a08301527f000000000000000000000000000000000000000000000000000000000000000090921660c082015290517fdd226617d8d287f40a64c54741bbcdc492b3e096ef16bc5273a18cb6ab85f124916110e6918490615994565b6040805160a081018252600080825260208201819052918101829052606081018290526080810191909152612d0482606001516fffffffffffffffffffffffffffffffff1683600001516fffffffffffffffffffffffffffffffff16846020015163ffffffff1642612ce89190615a69565b85608001516fffffffffffffffffffffffffffffffff16613ddd565b6fffffffffffffffffffffffffffffffff1682525063ffffffff4216602082015290565b6012546040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526000916bffffffffffffffffffffffff16907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa158015612dba573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612dde9190615403565b610ce69190615a7c565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb000000000000000000000000000000000000000000000000000000001790526129d8908490613e05565b60005b8251811015612ef9576000838281518110612e8857612e88615591565b60200260200101519050612ea681600d613f0490919063ffffffff16565b15612ee8576040516001600160a01b03821681527f800671136ab6cfee9fbe5ed1fb7ca417811aca3cf864800d127b927adedf75669060200160405180910390a15b50612ef2816156ca565b9050612e6b565b5060005b81518110156129d8576000828281518110612f1a57612f1a615591565b6020026020010151905060006001600160a01b0316816001600160a01b031603612f445750612f93565b612f4f600d82613f19565b15612f91576040516001600160a01b03821681527f2640d4d76caf8bf478aabfa982fa4e1c4eb71a37f93cd15e80dbc657911546d89060200160405180910390a15b505b612f9c816156ca565b9050612efd565b60006113f3836001600160a01b038416613f2e565b60006113f3836001600160a01b038416613f3a565b60005b81518110156130d3576000828281518110612fed57612fed615591565b60209081029190910181015160408051606080820183528385015163ffffffff90811683528385015181168387019081529185015161ffff90811684860190815295516001600160a01b03166000908152601090975293909520915182549151945190931668010000000000000000027fffffffffffffffffffffffffffffffffffffffffffff0000ffffffffffffffff948616640100000000027fffffffffffffffffffffffffffffffffffffffffffffffff000000000000000090921693909516929092179190911791909116919091179055506130cc816156ca565b9050612fd0565b507fcb0c5f472d325cf0c56953fc81870ddd80d0d3c9a3fbfe777002d75f380dfb81816040516110e69190615a9c565b80516040811115613140576040517fb5a10cfa00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6012546c01000000000000000000000000900463ffffffff161580159061318e575060125463ffffffff6c010000000000000000000000008204166bffffffffffffffffffffffff90911610155b1561319b5761319b611fe6565b60006131a76007613a78565b90505b80156131e95760006131c86131c0600184615a69565b600790613a83565b5090506131d6600782613f46565b5050806131e290615b16565b90506131aa565b506000805b828110156132f757600084828151811061320a5761320a615591565b6020026020010151600001519050600085838151811061322c5761322c615591565b60200260200101516020015190507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b0316148061328157506001600160a01b038216155b156132c3576040517f4de938d10000000000000000000000000000000000000000000000000000000081526001600160a01b0383166004820152602401610a83565b6132d360078361ffff8416613f5b565b506132e261ffff821685615b4b565b93505050806132f0906156ca565b90506131ee565b50601280547fffffffffffffffffffffffffffffffff00000000ffffffffffffffffffffffff166c0100000000000000000000000063ffffffff8416021790556040517f8c337bff38141c507abd25c547606bdde78fe8c12e941ab613f3a565fea6cd24906133699083908690615b68565b60405180910390a1505050565b60005b815181101561355557600082828151811061339657613396615591565b6020908102919091018101516040805160a08082018352828401516bffffffffffffffffffffffff90811683528486015167ffffffffffffffff90811684880190815260608088015163ffffffff9081168789019081526080808b015161ffff908116948a01948552978b0151151590890190815299516001600160a01b03166000908152600f909b529790992095518654925197519151985115157a010000000000000000000000000000000000000000000000000000027fffffffffff00ffffffffffffffffffffffffffffffffffffffffffffffffffff999096167801000000000000000000000000000000000000000000000000027fffffffffffff0000ffffffffffffffffffffffffffffffffffffffffffffffff92909a167401000000000000000000000000000000000000000002919091167fffffffffffff000000000000ffffffffffffffffffffffffffffffffffffffff979093166c01000000000000000000000000027fffffffffffffffffffffffff000000000000000000000000000000000000000090921693169290921791909117939093169290921793909317919091161790555061354e816156ca565b9050613379565b507ffba339fca97870ffdfaedbae3745db5e6de1a6909dfd0e0dbb56917469ffe236816040516110e69190615b87565b606060006113f383613f71565b6001600160a01b0381166135d2576040517fa4ec747900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6005546001600160a01b03163314613616576040517f1c0a352900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60065474010000000000000000000000000000000000000000900463ffffffff168085111561367b576040517f869337890000000000000000000000000000000000000000000000000000000081526004810182905260248101869052604401610a83565b6006547801000000000000000000000000000000000000000000000000900467ffffffffffffffff168411156136dd576040517f4c4fc93a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60055474010000000000000000000000000000000000000000900461ffff16831115613735576040517f4c056b6a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b601254790100000000000000000000000000000000000000000000000000900460ff16801561376c575061376a600d83613fcd565b155b156137ae576040517fd0d259760000000000000000000000000000000000000000000000000000000081526001600160a01b0383166004820152602401610a83565b5050505050565b81516000805b8281101561395a576000846001600160a01b031663d02641a08784815181106137e6576137e6615591565b6020908102919091010151516040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b1681526001600160a01b0390911660048201526024016040805180830381865afa15801561384d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906138719190615c1f565b51905077ffffffffffffffffffffffffffffffffffffffffffffffff81166000036138f2578582815181106138a8576138a8615591565b6020908102919091010151516040517f9a655f7b0000000000000000000000000000000000000000000000000000000081526001600160a01b039091166004820152602401610a83565b61393c86838151811061390757613907615591565b6020026020010151602001518277ffffffffffffffffffffffffffffffffffffffffffffffff16613d8390919063ffffffff16565b613946908461532c565b92505080613953906156ca565b90506137bb565b506139686003826000613fef565b50505050565b60008060001b828460200151856080015186606001518760e00151886101000151805190602001208961012001516040516020016139ac9190615c52565b604051602081830303815290604052805190602001208a60a001518b60c001518c61014001518d60400151604051602001613a5a9c9b9a999897969594939291909b8c5260208c019a909a5267ffffffffffffffff98891660408c01529690971660608a01526001600160a01b0394851660808a015292841660a089015260c088019190915260e0870152610100860152911515610120850152166101408301526101608201526101800190565b60405160208183030381529060405280519060200120905092915050565b6000610fbb8261433e565b6000808080613a928686614349565b909450925050505b9250929050565b8154600090613aca90700100000000000000000000000000000000900463ffffffff1642615a69565b90508015613b6c5760018301548354613b12916fffffffffffffffffffffffffffffffff80821692811691859170010000000000000000000000000000000090910416613ddd565b83546fffffffffffffffffffffffffffffffff919091167fffffffffffffffffffffffff0000000000000000000000000000000000000000909116177001000000000000000000000000000000004263ffffffff16021783555b60208201518354613b92916fffffffffffffffffffffffffffffffff9081169116614374565b83548351151574010000000000000000000000000000000000000000027fffffffffffffffffffffff00ffffffff000000000000000000000000000000009091166fffffffffffffffffffffffffffffffff92831617178455602083015160408085015183167001000000000000000000000000000000000291909216176001850155517f9ea3374b67bf275e6bb9c8ae68f9cae023e1c528b4b27e092f0bb209d3531c19906133699084908151151581526020808301516fffffffffffffffffffffffffffffffff90811691830191909152604092830151169181019190915260600190565b6000610fbb82613a78565b6000808080613a928686613a83565b60006113f3836001600160a01b03841661438a565b336001600160a01b03821603613d1a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c660000000000000000006044820152606401610a83565b600180547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b6000670de0b6b3a76400006125fd8377ffffffffffffffffffffffffffffffffffffffffffffffff8616615315565b60006113f3836001600160a01b038416614396565b60006125c6846001600160a01b038516846143a2565b6000613dfc85613ded8486615315565b613df7908761532c565b614374565b95945050505050565b6000613e5a826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166143b89092919063ffffffff16565b8051909150156129d85780806020019051810190613e789190615478565b6129d8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610a83565b60006113f3836001600160a01b0384166143c7565b60006113f3836001600160a01b0384166144c1565b60006113f3838361438a565b60006113f38383614510565b60006113f3836001600160a01b03841661459a565b60006125c6846001600160a01b038516846145b7565b606081600001805480602002602001604051908101604052809291908181526020018280548015613fc157602002820191906000526020600020905b815481526020019060010190808311613fad575b50505050509050919050565b6001600160a01b038116600090815260018301602052604081205415156113f3565b825474010000000000000000000000000000000000000000900460ff161580614016575081155b1561402057505050565b825460018401546fffffffffffffffffffffffffffffffff8083169291169060009061406690700100000000000000000000000000000000900463ffffffff1642615a69565b9050801561412657818311156140a8576040517f9725942a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60018601546140e29083908590849070010000000000000000000000000000000090046fffffffffffffffffffffffffffffffff16613ddd565b86547fffffffffffffffffffffffff00000000ffffffffffffffffffffffffffffffff167001000000000000000000000000000000004263ffffffff160217875592505b848210156141c3576001600160a01b038416614178576040517ff94ebcd10000000000000000000000000000000000000000000000000000000081526004810183905260248101869052604401610a83565b6040517f1a76572a00000000000000000000000000000000000000000000000000000000815260048101839052602481018690526001600160a01b0385166044820152606401610a83565b848310156142bc5760018681015470010000000000000000000000000000000090046fffffffffffffffffffffffffffffffff169060009082906142079082615a69565b614211878a615a69565b61421b919061532c565b614225919061533f565b90506001600160a01b038616614271576040517f15279c080000000000000000000000000000000000000000000000000000000081526004810182905260248101869052604401610a83565b6040517fd0c8d23a00000000000000000000000000000000000000000000000000000000815260048101829052602481018690526001600160a01b0387166044820152606401610a83565b6142c68584615a69565b86547fffffffffffffffffffffffffffffffff00000000000000000000000000000000166fffffffffffffffffffffffffffffffff82161787556040518681529093507f1871cdf8010e63f2eb8384381a68dfa7416dc571a5517e66e88b2d2d0c0a690a9060200160405180910390a1505050505050565b6000610fbb826145d4565b6000808061435785856145de565b600081815260029690960160205260409095205494959350505050565b600081831061438357816113f3565b5090919050565b60006113f383836145ea565b60006113f3838361459a565b60006125c684846001600160a01b0385166145b7565b60606125c68484600085614602565b600081815260018301602052604081205480156144b05760006143eb600183615a69565b85549091506000906143ff90600190615a69565b905081811461446457600086600001828154811061441f5761441f615591565b906000526020600020015490508087600001848154811061444257614442615591565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061447557614475615c65565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610fbb565b6000915050610fbb565b5092915050565b600081815260018301602052604081205461450857508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610fbb565b506000610fbb565b6000818152600283016020526040812054801515806145345750614534848461438a565b6113f3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f456e756d657261626c654d61703a206e6f6e6578697374656e74206b657900006044820152606401610a83565b600081815260028301602052604081208190556113f3838361470e565b600082815260028401602052604081208290556125c6848461471a565b6000610fbb825490565b60006113f38383614726565b600081815260018301602052604081205415156113f3565b606082471015614694576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610a83565b600080866001600160a01b031685876040516146b09190615c94565b60006040518083038185875af1925050503d80600081146146ed576040519150601f19603f3d011682016040523d82523d6000602084013e6146f2565b606091505b509150915061470387838387614750565b979650505050505050565b60006113f383836143c7565b60006113f383836144c1565b600082600001828154811061473d5761473d615591565b9060005260206000200154905092915050565b606083156147d95782516000036147d2576001600160a01b0385163b6147d2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610a83565b50816125c6565b6125c683838151156147ee5781518083602001fd5b806040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a83919061493e565b60e08101610fbb82846001600160a01b03808251168352602082015167ffffffffffffffff808216602086015280604085015116604086015280606085015116606086015250506bffffffffffffffffffffffff60808301511660808401528060a08301511660a08401528060c08301511660c0840152505050565b6001600160a01b0381168114610cb457600080fd5b6000602082840312156148c557600080fd5b81356113f38161489e565b60005b838110156148eb5781810151838201526020016148d3565b50506000910152565b6000815180845261490c8160208601602086016148d0565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b6020815260006113f360208301846148f4565b600060a08284031215611f5a57600080fd5b60006020828403121561497557600080fd5b813567ffffffffffffffff81111561498c57600080fd5b6125c684828501614951565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040805190810167ffffffffffffffff811182821017156149ea576149ea614998565b60405290565b6040516080810167ffffffffffffffff811182821017156149ea576149ea614998565b60405160c0810167ffffffffffffffff811182821017156149ea576149ea614998565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715614a7d57614a7d614998565b604052919050565b600067ffffffffffffffff821115614a9f57614a9f614998565b5060051b60200190565b600082601f830112614aba57600080fd5b81356020614acf614aca83614a85565b614a36565b82815260069290921b84018101918181019086841115614aee57600080fd5b8286015b84811015614b3f5760408189031215614b0b5760008081fd5b614b136149c7565b8135614b1e8161489e565b815281850135614b2d8161489e565b81860152835291830191604001614af2565b509695505050505050565b60008060408385031215614b5d57600080fd5b823567ffffffffffffffff80821115614b7557600080fd5b614b8186838701614aa9565b93506020850135915080821115614b9757600080fd5b50614ba485828601614aa9565b9150509250929050565b803561ffff81168114614bc057600080fd5b919050565b803563ffffffff81168114614bc057600080fd5b67ffffffffffffffff81168114610cb457600080fd5b600060a08284031215614c0157600080fd5b60405160a0810181811067ffffffffffffffff82111715614c2457614c24614998565b6040528235614c328161489e565b8152614c4060208401614bae565b60208201526040830135614c538161489e565b6040820152614c6460608401614bc5565b60608201526080830135614c7781614bd9565b60808201529392505050565b60008060408385031215614c9657600080fd5b8235614ca18161489e565b91506020830135614cb18161489e565b809150509250929050565b600082601f830112614ccd57600080fd5b81356020614cdd614aca83614a85565b82815260059290921b84018101918181019086841115614cfc57600080fd5b8286015b84811015614b3f578035614d138161489e565b8352918301918301614d00565b60008060408385031215614d3357600080fd5b823567ffffffffffffffff80821115614d4b57600080fd5b614d5786838701614cbc565b93506020850135915080821115614d6d57600080fd5b50614ba485828601614cbc565b60006020808385031215614d8d57600080fd5b823567ffffffffffffffff811115614da457600080fd5b8301601f81018513614db557600080fd5b8035614dc3614aca82614a85565b81815260079190911b82018301908381019087831115614de257600080fd5b928401925b828410156147035760808489031215614e005760008081fd5b614e086149f0565b8435614e138161489e565b8152614e20858701614bc5565b868201526040614e31818701614bc5565b908201526060614e42868201614bae565b9082015282526080939093019290840190614de7565b60a08101610fbb82846001600160a01b0380825116835261ffff60208301511660208401528060408301511660408401525063ffffffff606082015116606083015267ffffffffffffffff60808201511660808301525050565b60008060208385031215614ec557600080fd5b823567ffffffffffffffff80821115614edd57600080fd5b818501915085601f830112614ef157600080fd5b813581811115614f0057600080fd5b8660208260061b8501011115614f1557600080fd5b60209290920196919550909350505050565b8015158114610cb457600080fd5b8035614bc081614f27565b60006020808385031215614f5357600080fd5b823567ffffffffffffffff811115614f6a57600080fd5b8301601f81018513614f7b57600080fd5b8035614f89614aca82614a85565b81815260c09182028301840191848201919088841115614fa857600080fd5b938501935b838510156150525780858a031215614fc55760008081fd5b614fcd614a13565b8535614fd88161489e565b815285870135614fe781614bd9565b818801526040868101356bffffffffffffffffffffffff8116811461500c5760008081fd5b90820152606061501d878201614bc5565b90820152608061502e878201614bae565b9082015260a061503f878201614f35565b9082015283529384019391850191614fad565b50979650505050505050565b6020808252825182820181905260009190848201906040850190845b8181101561509f5783516001600160a01b03168352928401929184019160010161507a565b50909695505050505050565b6000806000606084860312156150c057600080fd5b833567ffffffffffffffff8111156150d757600080fd5b6150e386828701614951565b9350506020840135915060408401356150fb8161489e565b809150509250925092565b600081518084526020808501945080840160005b8381101561514e57815180516001600160a01b0316885283015161ffff16838801526040909601959082019060010161511a565b509495945050505050565b60408152600061516c6040830185615106565b90508260208301529392505050565b80356fffffffffffffffffffffffffffffffff81168114614bc057600080fd5b6000606082840312156151ad57600080fd5b6040516060810181811067ffffffffffffffff821117156151d0576151d0614998565b60405282356151de81614f27565b81526151ec6020840161517b565b60208201526151fd6040840161517b565b60408201529392505050565b60006020828403121561521b57600080fd5b81356113f381614f27565b805177ffffffffffffffffffffffffffffffffffffffffffffffff81168114614bc057600080fd5b6000806040838503121561526157600080fd5b61526a83615226565b915061527860208401615226565b90509250929050565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe18436030181126152b657600080fd5b83018035915067ffffffffffffffff8211156152d157600080fd5b602001915036819003821315613a9a57600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8082028115828204841417610fbb57610fbb6152e6565b80820180821115610fbb57610fbb6152e6565b600082615375577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe18436030181126153af57600080fd5b83018035915067ffffffffffffffff8211156153ca57600080fd5b6020019150600681901b3603821315613a9a57600080fd5b67ffffffffffffffff8181168382160190808211156144ba576144ba6152e6565b60006020828403121561541557600080fd5b5051919050565b60006040828403121561542e57600080fd5b6154366149c7565b82356154418161489e565b815261544f60208401614bae565b60208201529392505050565b60006020828403121561546d57600080fd5b81516113f381614bd9565b60006020828403121561548a57600080fd5b81516113f381614f27565b8183528181602085013750600060208284010152600060207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b6020815260006125c6602083018486615495565b60006020828403121561550457600080fd5b5035919050565b60006040828403121561551d57600080fd5b6155256149c7565b82356155308161489e565b81526020928301359281019290925250919050565b6bffffffffffffffffffffffff8181168382160190808211156144ba576144ba6152e6565b600067ffffffffffffffff808316818103615587576155876152e6565b6001019392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6001600160a01b038716815260a0602082015260006155e360a083018789615495565b85604084015267ffffffffffffffff85166060840152828103608084015261560b81856148f4565b9998505050505050505050565b60006020828403121561562a57600080fd5b815167ffffffffffffffff8082111561564257600080fd5b818401915084601f83011261565657600080fd5b81518181111561566857615668614998565b61569960207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f84011601614a36565b91508082528560208285010111156156b057600080fd5b6156c18160208401602086016148d0565b50949350505050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036156fb576156fb6152e6565b5060010190565b600081518084526020808501945080840160005b8381101561514e57815180516001600160a01b031688528301518388015260409096019590820190600101615716565b6020815261576160208201835167ffffffffffffffff169052565b6000602083015161577e604084018267ffffffffffffffff169052565b506040830151606083015260608301516157a360808401826001600160a01b03169052565b50608083015167ffffffffffffffff811660a08401525060a083015160c083015260c08301516157d760e084018215159052565b5060e08301516101006157f4818501836001600160a01b03169052565b8085015191505061018061012081818601526158146101a08601846148f4565b92508086015190506101407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe086850301818701526158528483615702565b935080870151915050610160615872818701836001600160a01b03169052565b959095015193019290925250919050565b6bffffffffffffffffffffffff8281168282160390808211156144ba576144ba6152e6565b7fffffffff0000000000000000000000000000000000000000000000000000000081358181169160048510156158e85780818660040360031b1b83161692505b505092915050565b6000808585111561590057600080fd5b8386111561590d57600080fd5b5050820193919092039150565b60006020828403121561592c57600080fd5b6040516020810181811067ffffffffffffffff8211171561594f5761594f614998565b6040529135825250919050565b60006020828403121561596e57600080fd5b6113f382615226565b60006020828403121561598957600080fd5b81516113f38161489e565b6101808101615a1182856001600160a01b03808251168352602082015167ffffffffffffffff808216602086015280604085015116604086015280606085015116606086015250506bffffffffffffffffffffffff60808301511660808401528060a08301511660a08401528060c08301511660c0840152505050565b82516001600160a01b0390811660e0840152602084015161ffff16610100840152604084015116610120830152606083015163ffffffff16610140830152608083015167ffffffffffffffff166101608301526113f3565b81810381811115610fbb57610fbb6152e6565b81810360008312801583831316838312821617156144ba576144ba6152e6565b602080825282518282018190526000919060409081850190868401855b82811015615b0957815180516001600160a01b031685528681015163ffffffff9081168887015286820151168686015260609081015161ffff169085015260809093019290850190600101615ab9565b5091979650505050505050565b600081615b2557615b256152e6565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190565b63ffffffff8181168382160190808211156144ba576144ba6152e6565b63ffffffff831681526040602082015260006125c66040830184615106565b602080825282518282018190526000919060409081850190868401855b82811015615b0957815180516001600160a01b031685528681015167ffffffffffffffff1687860152858101516bffffffffffffffffffffffff168686015260608082015163ffffffff169086015260808082015161ffff169086015260a09081015115159085015260c09093019290850190600101615ba4565b600060408284031215615c3157600080fd5b615c396149c7565b615c4283615226565b8152602083015161544f81614bd9565b6020815260006113f36020830184615702565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b60008251615ca68184602087016148d0565b919091019291505056fea164736f6c6343000813000a", +} + +var EVM2EVMOnRampABI = EVM2EVMOnRampMetaData.ABI + +var EVM2EVMOnRampBin = EVM2EVMOnRampMetaData.Bin + +func DeployEVM2EVMOnRamp(auth *bind.TransactOpts, backend bind.ContractBackend, staticConfig EVM2EVMOnRampStaticConfig, dynamicConfig EVM2EVMOnRampDynamicConfig, tokensAndPools []InternalPoolUpdate, allowlist []common.Address, rateLimiterConfig RateLimiterConfig, feeTokenConfigs []EVM2EVMOnRampFeeTokenConfigArgs, tokenTransferFeeConfigArgs []EVM2EVMOnRampTokenTransferFeeConfigArgs, nopsAndWeights []EVM2EVMOnRampNopAndWeight) (common.Address, *types.Transaction, *EVM2EVMOnRamp, error) { + parsed, err := EVM2EVMOnRampMetaData.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(EVM2EVMOnRampBin), backend, staticConfig, dynamicConfig, tokensAndPools, allowlist, rateLimiterConfig, feeTokenConfigs, tokenTransferFeeConfigArgs, nopsAndWeights) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &EVM2EVMOnRamp{EVM2EVMOnRampCaller: EVM2EVMOnRampCaller{contract: contract}, EVM2EVMOnRampTransactor: EVM2EVMOnRampTransactor{contract: contract}, EVM2EVMOnRampFilterer: EVM2EVMOnRampFilterer{contract: contract}}, nil +} + +type EVM2EVMOnRamp struct { + address common.Address + abi abi.ABI + EVM2EVMOnRampCaller + EVM2EVMOnRampTransactor + EVM2EVMOnRampFilterer +} + +type EVM2EVMOnRampCaller struct { + contract *bind.BoundContract +} + +type EVM2EVMOnRampTransactor struct { + contract *bind.BoundContract +} + +type EVM2EVMOnRampFilterer struct { + contract *bind.BoundContract +} + +type EVM2EVMOnRampSession struct { + Contract *EVM2EVMOnRamp + CallOpts bind.CallOpts + TransactOpts bind.TransactOpts +} + +type EVM2EVMOnRampCallerSession struct { + Contract *EVM2EVMOnRampCaller + CallOpts bind.CallOpts +} + +type EVM2EVMOnRampTransactorSession struct { + Contract *EVM2EVMOnRampTransactor + TransactOpts bind.TransactOpts +} + +type EVM2EVMOnRampRaw struct { + Contract *EVM2EVMOnRamp +} + +type EVM2EVMOnRampCallerRaw struct { + Contract *EVM2EVMOnRampCaller +} + +type EVM2EVMOnRampTransactorRaw struct { + Contract *EVM2EVMOnRampTransactor +} + +func NewEVM2EVMOnRamp(address common.Address, backend bind.ContractBackend) (*EVM2EVMOnRamp, error) { + abi, err := abi.JSON(strings.NewReader(EVM2EVMOnRampABI)) + if err != nil { + return nil, err + } + contract, err := bindEVM2EVMOnRamp(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &EVM2EVMOnRamp{address: address, abi: abi, EVM2EVMOnRampCaller: EVM2EVMOnRampCaller{contract: contract}, EVM2EVMOnRampTransactor: EVM2EVMOnRampTransactor{contract: contract}, EVM2EVMOnRampFilterer: EVM2EVMOnRampFilterer{contract: contract}}, nil +} + +func NewEVM2EVMOnRampCaller(address common.Address, caller bind.ContractCaller) (*EVM2EVMOnRampCaller, error) { + contract, err := bindEVM2EVMOnRamp(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &EVM2EVMOnRampCaller{contract: contract}, nil +} + +func NewEVM2EVMOnRampTransactor(address common.Address, transactor bind.ContractTransactor) (*EVM2EVMOnRampTransactor, error) { + contract, err := bindEVM2EVMOnRamp(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &EVM2EVMOnRampTransactor{contract: contract}, nil +} + +func NewEVM2EVMOnRampFilterer(address common.Address, filterer bind.ContractFilterer) (*EVM2EVMOnRampFilterer, error) { + contract, err := bindEVM2EVMOnRamp(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &EVM2EVMOnRampFilterer{contract: contract}, nil +} + +func bindEVM2EVMOnRamp(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := EVM2EVMOnRampMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _EVM2EVMOnRamp.Contract.EVM2EVMOnRampCaller.contract.Call(opts, result, method, params...) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.EVM2EVMOnRampTransactor.contract.Transfer(opts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.EVM2EVMOnRampTransactor.contract.Transact(opts, method, params...) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _EVM2EVMOnRamp.Contract.contract.Call(opts, result, method, params...) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.contract.Transfer(opts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.contract.Transact(opts, method, params...) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCaller) CurrentRateLimiterState(opts *bind.CallOpts) (RateLimiterTokenBucket, error) { + var out []interface{} + err := _EVM2EVMOnRamp.contract.Call(opts, &out, "currentRateLimiterState") + + if err != nil { + return *new(RateLimiterTokenBucket), err + } + + out0 := *abi.ConvertType(out[0], new(RateLimiterTokenBucket)).(*RateLimiterTokenBucket) + + return out0, err + +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) CurrentRateLimiterState() (RateLimiterTokenBucket, error) { + return _EVM2EVMOnRamp.Contract.CurrentRateLimiterState(&_EVM2EVMOnRamp.CallOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCallerSession) CurrentRateLimiterState() (RateLimiterTokenBucket, error) { + return _EVM2EVMOnRamp.Contract.CurrentRateLimiterState(&_EVM2EVMOnRamp.CallOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCaller) GetAllowList(opts *bind.CallOpts) ([]common.Address, error) { + var out []interface{} + err := _EVM2EVMOnRamp.contract.Call(opts, &out, "getAllowList") + + if err != nil { + return *new([]common.Address), err + } + + out0 := *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) + + return out0, err + +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) GetAllowList() ([]common.Address, error) { + return _EVM2EVMOnRamp.Contract.GetAllowList(&_EVM2EVMOnRamp.CallOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCallerSession) GetAllowList() ([]common.Address, error) { + return _EVM2EVMOnRamp.Contract.GetAllowList(&_EVM2EVMOnRamp.CallOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCaller) GetAllowListEnabled(opts *bind.CallOpts) (bool, error) { + var out []interface{} + err := _EVM2EVMOnRamp.contract.Call(opts, &out, "getAllowListEnabled") + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) GetAllowListEnabled() (bool, error) { + return _EVM2EVMOnRamp.Contract.GetAllowListEnabled(&_EVM2EVMOnRamp.CallOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCallerSession) GetAllowListEnabled() (bool, error) { + return _EVM2EVMOnRamp.Contract.GetAllowListEnabled(&_EVM2EVMOnRamp.CallOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCaller) GetDynamicConfig(opts *bind.CallOpts) (EVM2EVMOnRampDynamicConfig, error) { + var out []interface{} + err := _EVM2EVMOnRamp.contract.Call(opts, &out, "getDynamicConfig") + + if err != nil { + return *new(EVM2EVMOnRampDynamicConfig), err + } + + out0 := *abi.ConvertType(out[0], new(EVM2EVMOnRampDynamicConfig)).(*EVM2EVMOnRampDynamicConfig) + + return out0, err + +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) GetDynamicConfig() (EVM2EVMOnRampDynamicConfig, error) { + return _EVM2EVMOnRamp.Contract.GetDynamicConfig(&_EVM2EVMOnRamp.CallOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCallerSession) GetDynamicConfig() (EVM2EVMOnRampDynamicConfig, error) { + return _EVM2EVMOnRamp.Contract.GetDynamicConfig(&_EVM2EVMOnRamp.CallOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCaller) GetExpectedNextSequenceNumber(opts *bind.CallOpts) (uint64, error) { + var out []interface{} + err := _EVM2EVMOnRamp.contract.Call(opts, &out, "getExpectedNextSequenceNumber") + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) GetExpectedNextSequenceNumber() (uint64, error) { + return _EVM2EVMOnRamp.Contract.GetExpectedNextSequenceNumber(&_EVM2EVMOnRamp.CallOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCallerSession) GetExpectedNextSequenceNumber() (uint64, error) { + return _EVM2EVMOnRamp.Contract.GetExpectedNextSequenceNumber(&_EVM2EVMOnRamp.CallOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCaller) GetFee(opts *bind.CallOpts, message ClientEVM2AnyMessage) (*big.Int, error) { + var out []interface{} + err := _EVM2EVMOnRamp.contract.Call(opts, &out, "getFee", message) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) GetFee(message ClientEVM2AnyMessage) (*big.Int, error) { + return _EVM2EVMOnRamp.Contract.GetFee(&_EVM2EVMOnRamp.CallOpts, message) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCallerSession) GetFee(message ClientEVM2AnyMessage) (*big.Int, error) { + return _EVM2EVMOnRamp.Contract.GetFee(&_EVM2EVMOnRamp.CallOpts, message) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCaller) GetFeeTokenConfig(opts *bind.CallOpts, token common.Address) (EVM2EVMOnRampFeeTokenConfig, error) { + var out []interface{} + err := _EVM2EVMOnRamp.contract.Call(opts, &out, "getFeeTokenConfig", token) + + if err != nil { + return *new(EVM2EVMOnRampFeeTokenConfig), err + } + + out0 := *abi.ConvertType(out[0], new(EVM2EVMOnRampFeeTokenConfig)).(*EVM2EVMOnRampFeeTokenConfig) + + return out0, err + +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) GetFeeTokenConfig(token common.Address) (EVM2EVMOnRampFeeTokenConfig, error) { + return _EVM2EVMOnRamp.Contract.GetFeeTokenConfig(&_EVM2EVMOnRamp.CallOpts, token) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCallerSession) GetFeeTokenConfig(token common.Address) (EVM2EVMOnRampFeeTokenConfig, error) { + return _EVM2EVMOnRamp.Contract.GetFeeTokenConfig(&_EVM2EVMOnRamp.CallOpts, token) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCaller) GetNopFeesJuels(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _EVM2EVMOnRamp.contract.Call(opts, &out, "getNopFeesJuels") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) GetNopFeesJuels() (*big.Int, error) { + return _EVM2EVMOnRamp.Contract.GetNopFeesJuels(&_EVM2EVMOnRamp.CallOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCallerSession) GetNopFeesJuels() (*big.Int, error) { + return _EVM2EVMOnRamp.Contract.GetNopFeesJuels(&_EVM2EVMOnRamp.CallOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCaller) GetNops(opts *bind.CallOpts) (GetNops, + + error) { + var out []interface{} + err := _EVM2EVMOnRamp.contract.Call(opts, &out, "getNops") + + outstruct := new(GetNops) + if err != nil { + return *outstruct, err + } + + outstruct.NopsAndWeights = *abi.ConvertType(out[0], new([]EVM2EVMOnRampNopAndWeight)).(*[]EVM2EVMOnRampNopAndWeight) + outstruct.WeightsTotal = *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) + + return *outstruct, err + +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) GetNops() (GetNops, + + error) { + return _EVM2EVMOnRamp.Contract.GetNops(&_EVM2EVMOnRamp.CallOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCallerSession) GetNops() (GetNops, + + error) { + return _EVM2EVMOnRamp.Contract.GetNops(&_EVM2EVMOnRamp.CallOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCaller) GetPoolBySourceToken(opts *bind.CallOpts, sourceToken common.Address) (common.Address, error) { + var out []interface{} + err := _EVM2EVMOnRamp.contract.Call(opts, &out, "getPoolBySourceToken", sourceToken) + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) GetPoolBySourceToken(sourceToken common.Address) (common.Address, error) { + return _EVM2EVMOnRamp.Contract.GetPoolBySourceToken(&_EVM2EVMOnRamp.CallOpts, sourceToken) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCallerSession) GetPoolBySourceToken(sourceToken common.Address) (common.Address, error) { + return _EVM2EVMOnRamp.Contract.GetPoolBySourceToken(&_EVM2EVMOnRamp.CallOpts, sourceToken) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCaller) GetSenderNonce(opts *bind.CallOpts, sender common.Address) (uint64, error) { + var out []interface{} + err := _EVM2EVMOnRamp.contract.Call(opts, &out, "getSenderNonce", sender) + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) GetSenderNonce(sender common.Address) (uint64, error) { + return _EVM2EVMOnRamp.Contract.GetSenderNonce(&_EVM2EVMOnRamp.CallOpts, sender) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCallerSession) GetSenderNonce(sender common.Address) (uint64, error) { + return _EVM2EVMOnRamp.Contract.GetSenderNonce(&_EVM2EVMOnRamp.CallOpts, sender) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCaller) GetStaticConfig(opts *bind.CallOpts) (EVM2EVMOnRampStaticConfig, error) { + var out []interface{} + err := _EVM2EVMOnRamp.contract.Call(opts, &out, "getStaticConfig") + + if err != nil { + return *new(EVM2EVMOnRampStaticConfig), err + } + + out0 := *abi.ConvertType(out[0], new(EVM2EVMOnRampStaticConfig)).(*EVM2EVMOnRampStaticConfig) + + return out0, err + +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) GetStaticConfig() (EVM2EVMOnRampStaticConfig, error) { + return _EVM2EVMOnRamp.Contract.GetStaticConfig(&_EVM2EVMOnRamp.CallOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCallerSession) GetStaticConfig() (EVM2EVMOnRampStaticConfig, error) { + return _EVM2EVMOnRamp.Contract.GetStaticConfig(&_EVM2EVMOnRamp.CallOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCaller) GetSupportedTokens(opts *bind.CallOpts) ([]common.Address, error) { + var out []interface{} + err := _EVM2EVMOnRamp.contract.Call(opts, &out, "getSupportedTokens") + + if err != nil { + return *new([]common.Address), err + } + + out0 := *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) + + return out0, err + +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) GetSupportedTokens() ([]common.Address, error) { + return _EVM2EVMOnRamp.Contract.GetSupportedTokens(&_EVM2EVMOnRamp.CallOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCallerSession) GetSupportedTokens() ([]common.Address, error) { + return _EVM2EVMOnRamp.Contract.GetSupportedTokens(&_EVM2EVMOnRamp.CallOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCaller) GetTokenLimitAdmin(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _EVM2EVMOnRamp.contract.Call(opts, &out, "getTokenLimitAdmin") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) GetTokenLimitAdmin() (common.Address, error) { + return _EVM2EVMOnRamp.Contract.GetTokenLimitAdmin(&_EVM2EVMOnRamp.CallOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCallerSession) GetTokenLimitAdmin() (common.Address, error) { + return _EVM2EVMOnRamp.Contract.GetTokenLimitAdmin(&_EVM2EVMOnRamp.CallOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCaller) GetTokenTransferFeeConfig(opts *bind.CallOpts, token common.Address) (EVM2EVMOnRampTokenTransferFeeConfig, error) { + var out []interface{} + err := _EVM2EVMOnRamp.contract.Call(opts, &out, "getTokenTransferFeeConfig", token) + + if err != nil { + return *new(EVM2EVMOnRampTokenTransferFeeConfig), err + } + + out0 := *abi.ConvertType(out[0], new(EVM2EVMOnRampTokenTransferFeeConfig)).(*EVM2EVMOnRampTokenTransferFeeConfig) + + return out0, err + +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) GetTokenTransferFeeConfig(token common.Address) (EVM2EVMOnRampTokenTransferFeeConfig, error) { + return _EVM2EVMOnRamp.Contract.GetTokenTransferFeeConfig(&_EVM2EVMOnRamp.CallOpts, token) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCallerSession) GetTokenTransferFeeConfig(token common.Address) (EVM2EVMOnRampTokenTransferFeeConfig, error) { + return _EVM2EVMOnRamp.Contract.GetTokenTransferFeeConfig(&_EVM2EVMOnRamp.CallOpts, token) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCaller) LinkAvailableForPayment(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _EVM2EVMOnRamp.contract.Call(opts, &out, "linkAvailableForPayment") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) LinkAvailableForPayment() (*big.Int, error) { + return _EVM2EVMOnRamp.Contract.LinkAvailableForPayment(&_EVM2EVMOnRamp.CallOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCallerSession) LinkAvailableForPayment() (*big.Int, error) { + return _EVM2EVMOnRamp.Contract.LinkAvailableForPayment(&_EVM2EVMOnRamp.CallOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCaller) Owner(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _EVM2EVMOnRamp.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 + +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) Owner() (common.Address, error) { + return _EVM2EVMOnRamp.Contract.Owner(&_EVM2EVMOnRamp.CallOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCallerSession) Owner() (common.Address, error) { + return _EVM2EVMOnRamp.Contract.Owner(&_EVM2EVMOnRamp.CallOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCaller) TypeAndVersion(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _EVM2EVMOnRamp.contract.Call(opts, &out, "typeAndVersion") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) TypeAndVersion() (string, error) { + return _EVM2EVMOnRamp.Contract.TypeAndVersion(&_EVM2EVMOnRamp.CallOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCallerSession) TypeAndVersion() (string, error) { + return _EVM2EVMOnRamp.Contract.TypeAndVersion(&_EVM2EVMOnRamp.CallOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactor) AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + return _EVM2EVMOnRamp.contract.Transact(opts, "acceptOwnership") +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) AcceptOwnership() (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.AcceptOwnership(&_EVM2EVMOnRamp.TransactOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactorSession) AcceptOwnership() (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.AcceptOwnership(&_EVM2EVMOnRamp.TransactOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactor) ApplyAllowListUpdates(opts *bind.TransactOpts, removes []common.Address, adds []common.Address) (*types.Transaction, error) { + return _EVM2EVMOnRamp.contract.Transact(opts, "applyAllowListUpdates", removes, adds) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) ApplyAllowListUpdates(removes []common.Address, adds []common.Address) (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.ApplyAllowListUpdates(&_EVM2EVMOnRamp.TransactOpts, removes, adds) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactorSession) ApplyAllowListUpdates(removes []common.Address, adds []common.Address) (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.ApplyAllowListUpdates(&_EVM2EVMOnRamp.TransactOpts, removes, adds) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactor) ApplyPoolUpdates(opts *bind.TransactOpts, removes []InternalPoolUpdate, adds []InternalPoolUpdate) (*types.Transaction, error) { + return _EVM2EVMOnRamp.contract.Transact(opts, "applyPoolUpdates", removes, adds) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) ApplyPoolUpdates(removes []InternalPoolUpdate, adds []InternalPoolUpdate) (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.ApplyPoolUpdates(&_EVM2EVMOnRamp.TransactOpts, removes, adds) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactorSession) ApplyPoolUpdates(removes []InternalPoolUpdate, adds []InternalPoolUpdate) (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.ApplyPoolUpdates(&_EVM2EVMOnRamp.TransactOpts, removes, adds) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactor) ForwardFromRouter(opts *bind.TransactOpts, message ClientEVM2AnyMessage, feeTokenAmount *big.Int, originalSender common.Address) (*types.Transaction, error) { + return _EVM2EVMOnRamp.contract.Transact(opts, "forwardFromRouter", message, feeTokenAmount, originalSender) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) ForwardFromRouter(message ClientEVM2AnyMessage, feeTokenAmount *big.Int, originalSender common.Address) (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.ForwardFromRouter(&_EVM2EVMOnRamp.TransactOpts, message, feeTokenAmount, originalSender) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactorSession) ForwardFromRouter(message ClientEVM2AnyMessage, feeTokenAmount *big.Int, originalSender common.Address) (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.ForwardFromRouter(&_EVM2EVMOnRamp.TransactOpts, message, feeTokenAmount, originalSender) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactor) PayNops(opts *bind.TransactOpts) (*types.Transaction, error) { + return _EVM2EVMOnRamp.contract.Transact(opts, "payNops") +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) PayNops() (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.PayNops(&_EVM2EVMOnRamp.TransactOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactorSession) PayNops() (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.PayNops(&_EVM2EVMOnRamp.TransactOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactor) SetAdmin(opts *bind.TransactOpts, newAdmin common.Address) (*types.Transaction, error) { + return _EVM2EVMOnRamp.contract.Transact(opts, "setAdmin", newAdmin) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) SetAdmin(newAdmin common.Address) (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.SetAdmin(&_EVM2EVMOnRamp.TransactOpts, newAdmin) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactorSession) SetAdmin(newAdmin common.Address) (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.SetAdmin(&_EVM2EVMOnRamp.TransactOpts, newAdmin) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactor) SetAllowListEnabled(opts *bind.TransactOpts, enabled bool) (*types.Transaction, error) { + return _EVM2EVMOnRamp.contract.Transact(opts, "setAllowListEnabled", enabled) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) SetAllowListEnabled(enabled bool) (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.SetAllowListEnabled(&_EVM2EVMOnRamp.TransactOpts, enabled) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactorSession) SetAllowListEnabled(enabled bool) (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.SetAllowListEnabled(&_EVM2EVMOnRamp.TransactOpts, enabled) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactor) SetDynamicConfig(opts *bind.TransactOpts, dynamicConfig EVM2EVMOnRampDynamicConfig) (*types.Transaction, error) { + return _EVM2EVMOnRamp.contract.Transact(opts, "setDynamicConfig", dynamicConfig) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) SetDynamicConfig(dynamicConfig EVM2EVMOnRampDynamicConfig) (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.SetDynamicConfig(&_EVM2EVMOnRamp.TransactOpts, dynamicConfig) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactorSession) SetDynamicConfig(dynamicConfig EVM2EVMOnRampDynamicConfig) (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.SetDynamicConfig(&_EVM2EVMOnRamp.TransactOpts, dynamicConfig) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactor) SetFeeTokenConfig(opts *bind.TransactOpts, feeTokenConfigArgs []EVM2EVMOnRampFeeTokenConfigArgs) (*types.Transaction, error) { + return _EVM2EVMOnRamp.contract.Transact(opts, "setFeeTokenConfig", feeTokenConfigArgs) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) SetFeeTokenConfig(feeTokenConfigArgs []EVM2EVMOnRampFeeTokenConfigArgs) (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.SetFeeTokenConfig(&_EVM2EVMOnRamp.TransactOpts, feeTokenConfigArgs) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactorSession) SetFeeTokenConfig(feeTokenConfigArgs []EVM2EVMOnRampFeeTokenConfigArgs) (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.SetFeeTokenConfig(&_EVM2EVMOnRamp.TransactOpts, feeTokenConfigArgs) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactor) SetNops(opts *bind.TransactOpts, nopsAndWeights []EVM2EVMOnRampNopAndWeight) (*types.Transaction, error) { + return _EVM2EVMOnRamp.contract.Transact(opts, "setNops", nopsAndWeights) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) SetNops(nopsAndWeights []EVM2EVMOnRampNopAndWeight) (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.SetNops(&_EVM2EVMOnRamp.TransactOpts, nopsAndWeights) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactorSession) SetNops(nopsAndWeights []EVM2EVMOnRampNopAndWeight) (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.SetNops(&_EVM2EVMOnRamp.TransactOpts, nopsAndWeights) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactor) SetRateLimiterConfig(opts *bind.TransactOpts, config RateLimiterConfig) (*types.Transaction, error) { + return _EVM2EVMOnRamp.contract.Transact(opts, "setRateLimiterConfig", config) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) SetRateLimiterConfig(config RateLimiterConfig) (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.SetRateLimiterConfig(&_EVM2EVMOnRamp.TransactOpts, config) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactorSession) SetRateLimiterConfig(config RateLimiterConfig) (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.SetRateLimiterConfig(&_EVM2EVMOnRamp.TransactOpts, config) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactor) SetTokenTransferFeeConfig(opts *bind.TransactOpts, tokenTransferFeeConfigArgs []EVM2EVMOnRampTokenTransferFeeConfigArgs) (*types.Transaction, error) { + return _EVM2EVMOnRamp.contract.Transact(opts, "setTokenTransferFeeConfig", tokenTransferFeeConfigArgs) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) SetTokenTransferFeeConfig(tokenTransferFeeConfigArgs []EVM2EVMOnRampTokenTransferFeeConfigArgs) (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.SetTokenTransferFeeConfig(&_EVM2EVMOnRamp.TransactOpts, tokenTransferFeeConfigArgs) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactorSession) SetTokenTransferFeeConfig(tokenTransferFeeConfigArgs []EVM2EVMOnRampTokenTransferFeeConfigArgs) (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.SetTokenTransferFeeConfig(&_EVM2EVMOnRamp.TransactOpts, tokenTransferFeeConfigArgs) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactor) TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) { + return _EVM2EVMOnRamp.contract.Transact(opts, "transferOwnership", to) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.TransferOwnership(&_EVM2EVMOnRamp.TransactOpts, to) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactorSession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.TransferOwnership(&_EVM2EVMOnRamp.TransactOpts, to) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactor) WithdrawNonLinkFees(opts *bind.TransactOpts, feeToken common.Address, to common.Address) (*types.Transaction, error) { + return _EVM2EVMOnRamp.contract.Transact(opts, "withdrawNonLinkFees", feeToken, to) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) WithdrawNonLinkFees(feeToken common.Address, to common.Address) (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.WithdrawNonLinkFees(&_EVM2EVMOnRamp.TransactOpts, feeToken, to) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactorSession) WithdrawNonLinkFees(feeToken common.Address, to common.Address) (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.WithdrawNonLinkFees(&_EVM2EVMOnRamp.TransactOpts, feeToken, to) +} + +type EVM2EVMOnRampAdminSetIterator struct { + Event *EVM2EVMOnRampAdminSet + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *EVM2EVMOnRampAdminSetIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOnRampAdminSet) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOnRampAdminSet) + 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() + } +} + +func (it *EVM2EVMOnRampAdminSetIterator) Error() error { + return it.fail +} + +func (it *EVM2EVMOnRampAdminSetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type EVM2EVMOnRampAdminSet struct { + NewAdmin common.Address + Raw types.Log +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) FilterAdminSet(opts *bind.FilterOpts) (*EVM2EVMOnRampAdminSetIterator, error) { + + logs, sub, err := _EVM2EVMOnRamp.contract.FilterLogs(opts, "AdminSet") + if err != nil { + return nil, err + } + return &EVM2EVMOnRampAdminSetIterator{contract: _EVM2EVMOnRamp.contract, event: "AdminSet", logs: logs, sub: sub}, nil +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) WatchAdminSet(opts *bind.WatchOpts, sink chan<- *EVM2EVMOnRampAdminSet) (event.Subscription, error) { + + logs, sub, err := _EVM2EVMOnRamp.contract.WatchLogs(opts, "AdminSet") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(EVM2EVMOnRampAdminSet) + if err := _EVM2EVMOnRamp.contract.UnpackLog(event, "AdminSet", 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 +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) ParseAdminSet(log types.Log) (*EVM2EVMOnRampAdminSet, error) { + event := new(EVM2EVMOnRampAdminSet) + if err := _EVM2EVMOnRamp.contract.UnpackLog(event, "AdminSet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type EVM2EVMOnRampAllowListAddIterator struct { + Event *EVM2EVMOnRampAllowListAdd + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *EVM2EVMOnRampAllowListAddIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOnRampAllowListAdd) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOnRampAllowListAdd) + 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() + } +} + +func (it *EVM2EVMOnRampAllowListAddIterator) Error() error { + return it.fail +} + +func (it *EVM2EVMOnRampAllowListAddIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type EVM2EVMOnRampAllowListAdd struct { + Sender common.Address + Raw types.Log +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) FilterAllowListAdd(opts *bind.FilterOpts) (*EVM2EVMOnRampAllowListAddIterator, error) { + + logs, sub, err := _EVM2EVMOnRamp.contract.FilterLogs(opts, "AllowListAdd") + if err != nil { + return nil, err + } + return &EVM2EVMOnRampAllowListAddIterator{contract: _EVM2EVMOnRamp.contract, event: "AllowListAdd", logs: logs, sub: sub}, nil +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) WatchAllowListAdd(opts *bind.WatchOpts, sink chan<- *EVM2EVMOnRampAllowListAdd) (event.Subscription, error) { + + logs, sub, err := _EVM2EVMOnRamp.contract.WatchLogs(opts, "AllowListAdd") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(EVM2EVMOnRampAllowListAdd) + if err := _EVM2EVMOnRamp.contract.UnpackLog(event, "AllowListAdd", 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 +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) ParseAllowListAdd(log types.Log) (*EVM2EVMOnRampAllowListAdd, error) { + event := new(EVM2EVMOnRampAllowListAdd) + if err := _EVM2EVMOnRamp.contract.UnpackLog(event, "AllowListAdd", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type EVM2EVMOnRampAllowListEnabledSetIterator struct { + Event *EVM2EVMOnRampAllowListEnabledSet + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *EVM2EVMOnRampAllowListEnabledSetIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOnRampAllowListEnabledSet) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOnRampAllowListEnabledSet) + 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() + } +} + +func (it *EVM2EVMOnRampAllowListEnabledSetIterator) Error() error { + return it.fail +} + +func (it *EVM2EVMOnRampAllowListEnabledSetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type EVM2EVMOnRampAllowListEnabledSet struct { + Enabled bool + Raw types.Log +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) FilterAllowListEnabledSet(opts *bind.FilterOpts) (*EVM2EVMOnRampAllowListEnabledSetIterator, error) { + + logs, sub, err := _EVM2EVMOnRamp.contract.FilterLogs(opts, "AllowListEnabledSet") + if err != nil { + return nil, err + } + return &EVM2EVMOnRampAllowListEnabledSetIterator{contract: _EVM2EVMOnRamp.contract, event: "AllowListEnabledSet", logs: logs, sub: sub}, nil +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) WatchAllowListEnabledSet(opts *bind.WatchOpts, sink chan<- *EVM2EVMOnRampAllowListEnabledSet) (event.Subscription, error) { + + logs, sub, err := _EVM2EVMOnRamp.contract.WatchLogs(opts, "AllowListEnabledSet") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(EVM2EVMOnRampAllowListEnabledSet) + if err := _EVM2EVMOnRamp.contract.UnpackLog(event, "AllowListEnabledSet", 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 +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) ParseAllowListEnabledSet(log types.Log) (*EVM2EVMOnRampAllowListEnabledSet, error) { + event := new(EVM2EVMOnRampAllowListEnabledSet) + if err := _EVM2EVMOnRamp.contract.UnpackLog(event, "AllowListEnabledSet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type EVM2EVMOnRampAllowListRemoveIterator struct { + Event *EVM2EVMOnRampAllowListRemove + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *EVM2EVMOnRampAllowListRemoveIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOnRampAllowListRemove) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOnRampAllowListRemove) + 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() + } +} + +func (it *EVM2EVMOnRampAllowListRemoveIterator) Error() error { + return it.fail +} + +func (it *EVM2EVMOnRampAllowListRemoveIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type EVM2EVMOnRampAllowListRemove struct { + Sender common.Address + Raw types.Log +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) FilterAllowListRemove(opts *bind.FilterOpts) (*EVM2EVMOnRampAllowListRemoveIterator, error) { + + logs, sub, err := _EVM2EVMOnRamp.contract.FilterLogs(opts, "AllowListRemove") + if err != nil { + return nil, err + } + return &EVM2EVMOnRampAllowListRemoveIterator{contract: _EVM2EVMOnRamp.contract, event: "AllowListRemove", logs: logs, sub: sub}, nil +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) WatchAllowListRemove(opts *bind.WatchOpts, sink chan<- *EVM2EVMOnRampAllowListRemove) (event.Subscription, error) { + + logs, sub, err := _EVM2EVMOnRamp.contract.WatchLogs(opts, "AllowListRemove") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(EVM2EVMOnRampAllowListRemove) + if err := _EVM2EVMOnRamp.contract.UnpackLog(event, "AllowListRemove", 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 +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) ParseAllowListRemove(log types.Log) (*EVM2EVMOnRampAllowListRemove, error) { + event := new(EVM2EVMOnRampAllowListRemove) + if err := _EVM2EVMOnRamp.contract.UnpackLog(event, "AllowListRemove", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type EVM2EVMOnRampCCIPSendRequestedIterator struct { + Event *EVM2EVMOnRampCCIPSendRequested + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *EVM2EVMOnRampCCIPSendRequestedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOnRampCCIPSendRequested) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOnRampCCIPSendRequested) + 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() + } +} + +func (it *EVM2EVMOnRampCCIPSendRequestedIterator) Error() error { + return it.fail +} + +func (it *EVM2EVMOnRampCCIPSendRequestedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type EVM2EVMOnRampCCIPSendRequested struct { + Message InternalEVM2EVMMessage + Raw types.Log +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) FilterCCIPSendRequested(opts *bind.FilterOpts) (*EVM2EVMOnRampCCIPSendRequestedIterator, error) { + + logs, sub, err := _EVM2EVMOnRamp.contract.FilterLogs(opts, "CCIPSendRequested") + if err != nil { + return nil, err + } + return &EVM2EVMOnRampCCIPSendRequestedIterator{contract: _EVM2EVMOnRamp.contract, event: "CCIPSendRequested", logs: logs, sub: sub}, nil +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) WatchCCIPSendRequested(opts *bind.WatchOpts, sink chan<- *EVM2EVMOnRampCCIPSendRequested) (event.Subscription, error) { + + logs, sub, err := _EVM2EVMOnRamp.contract.WatchLogs(opts, "CCIPSendRequested") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(EVM2EVMOnRampCCIPSendRequested) + if err := _EVM2EVMOnRamp.contract.UnpackLog(event, "CCIPSendRequested", 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 +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) ParseCCIPSendRequested(log types.Log) (*EVM2EVMOnRampCCIPSendRequested, error) { + event := new(EVM2EVMOnRampCCIPSendRequested) + if err := _EVM2EVMOnRamp.contract.UnpackLog(event, "CCIPSendRequested", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type EVM2EVMOnRampConfigSetIterator struct { + Event *EVM2EVMOnRampConfigSet + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *EVM2EVMOnRampConfigSetIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOnRampConfigSet) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOnRampConfigSet) + 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() + } +} + +func (it *EVM2EVMOnRampConfigSetIterator) Error() error { + return it.fail +} + +func (it *EVM2EVMOnRampConfigSetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type EVM2EVMOnRampConfigSet struct { + StaticConfig EVM2EVMOnRampStaticConfig + DynamicConfig EVM2EVMOnRampDynamicConfig + Raw types.Log +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) FilterConfigSet(opts *bind.FilterOpts) (*EVM2EVMOnRampConfigSetIterator, error) { + + logs, sub, err := _EVM2EVMOnRamp.contract.FilterLogs(opts, "ConfigSet") + if err != nil { + return nil, err + } + return &EVM2EVMOnRampConfigSetIterator{contract: _EVM2EVMOnRamp.contract, event: "ConfigSet", logs: logs, sub: sub}, nil +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) WatchConfigSet(opts *bind.WatchOpts, sink chan<- *EVM2EVMOnRampConfigSet) (event.Subscription, error) { + + logs, sub, err := _EVM2EVMOnRamp.contract.WatchLogs(opts, "ConfigSet") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(EVM2EVMOnRampConfigSet) + if err := _EVM2EVMOnRamp.contract.UnpackLog(event, "ConfigSet", 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 +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) ParseConfigSet(log types.Log) (*EVM2EVMOnRampConfigSet, error) { + event := new(EVM2EVMOnRampConfigSet) + if err := _EVM2EVMOnRamp.contract.UnpackLog(event, "ConfigSet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type EVM2EVMOnRampFeeConfigSetIterator struct { + Event *EVM2EVMOnRampFeeConfigSet + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *EVM2EVMOnRampFeeConfigSetIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOnRampFeeConfigSet) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOnRampFeeConfigSet) + 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() + } +} + +func (it *EVM2EVMOnRampFeeConfigSetIterator) Error() error { + return it.fail +} + +func (it *EVM2EVMOnRampFeeConfigSetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type EVM2EVMOnRampFeeConfigSet struct { + FeeConfig []EVM2EVMOnRampFeeTokenConfigArgs + Raw types.Log +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) FilterFeeConfigSet(opts *bind.FilterOpts) (*EVM2EVMOnRampFeeConfigSetIterator, error) { + + logs, sub, err := _EVM2EVMOnRamp.contract.FilterLogs(opts, "FeeConfigSet") + if err != nil { + return nil, err + } + return &EVM2EVMOnRampFeeConfigSetIterator{contract: _EVM2EVMOnRamp.contract, event: "FeeConfigSet", logs: logs, sub: sub}, nil +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) WatchFeeConfigSet(opts *bind.WatchOpts, sink chan<- *EVM2EVMOnRampFeeConfigSet) (event.Subscription, error) { + + logs, sub, err := _EVM2EVMOnRamp.contract.WatchLogs(opts, "FeeConfigSet") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(EVM2EVMOnRampFeeConfigSet) + if err := _EVM2EVMOnRamp.contract.UnpackLog(event, "FeeConfigSet", 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 +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) ParseFeeConfigSet(log types.Log) (*EVM2EVMOnRampFeeConfigSet, error) { + event := new(EVM2EVMOnRampFeeConfigSet) + if err := _EVM2EVMOnRamp.contract.UnpackLog(event, "FeeConfigSet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type EVM2EVMOnRampNopPaidIterator struct { + Event *EVM2EVMOnRampNopPaid + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *EVM2EVMOnRampNopPaidIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOnRampNopPaid) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOnRampNopPaid) + 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() + } +} + +func (it *EVM2EVMOnRampNopPaidIterator) Error() error { + return it.fail +} + +func (it *EVM2EVMOnRampNopPaidIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type EVM2EVMOnRampNopPaid struct { + Nop common.Address + Amount *big.Int + Raw types.Log +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) FilterNopPaid(opts *bind.FilterOpts, nop []common.Address) (*EVM2EVMOnRampNopPaidIterator, error) { + + var nopRule []interface{} + for _, nopItem := range nop { + nopRule = append(nopRule, nopItem) + } + + logs, sub, err := _EVM2EVMOnRamp.contract.FilterLogs(opts, "NopPaid", nopRule) + if err != nil { + return nil, err + } + return &EVM2EVMOnRampNopPaidIterator{contract: _EVM2EVMOnRamp.contract, event: "NopPaid", logs: logs, sub: sub}, nil +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) WatchNopPaid(opts *bind.WatchOpts, sink chan<- *EVM2EVMOnRampNopPaid, nop []common.Address) (event.Subscription, error) { + + var nopRule []interface{} + for _, nopItem := range nop { + nopRule = append(nopRule, nopItem) + } + + logs, sub, err := _EVM2EVMOnRamp.contract.WatchLogs(opts, "NopPaid", nopRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(EVM2EVMOnRampNopPaid) + if err := _EVM2EVMOnRamp.contract.UnpackLog(event, "NopPaid", 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 +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) ParseNopPaid(log types.Log) (*EVM2EVMOnRampNopPaid, error) { + event := new(EVM2EVMOnRampNopPaid) + if err := _EVM2EVMOnRamp.contract.UnpackLog(event, "NopPaid", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type EVM2EVMOnRampNopsSetIterator struct { + Event *EVM2EVMOnRampNopsSet + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *EVM2EVMOnRampNopsSetIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOnRampNopsSet) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOnRampNopsSet) + 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() + } +} + +func (it *EVM2EVMOnRampNopsSetIterator) Error() error { + return it.fail +} + +func (it *EVM2EVMOnRampNopsSetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type EVM2EVMOnRampNopsSet struct { + NopWeightsTotal *big.Int + NopsAndWeights []EVM2EVMOnRampNopAndWeight + Raw types.Log +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) FilterNopsSet(opts *bind.FilterOpts) (*EVM2EVMOnRampNopsSetIterator, error) { + + logs, sub, err := _EVM2EVMOnRamp.contract.FilterLogs(opts, "NopsSet") + if err != nil { + return nil, err + } + return &EVM2EVMOnRampNopsSetIterator{contract: _EVM2EVMOnRamp.contract, event: "NopsSet", logs: logs, sub: sub}, nil +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) WatchNopsSet(opts *bind.WatchOpts, sink chan<- *EVM2EVMOnRampNopsSet) (event.Subscription, error) { + + logs, sub, err := _EVM2EVMOnRamp.contract.WatchLogs(opts, "NopsSet") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(EVM2EVMOnRampNopsSet) + if err := _EVM2EVMOnRamp.contract.UnpackLog(event, "NopsSet", 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 +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) ParseNopsSet(log types.Log) (*EVM2EVMOnRampNopsSet, error) { + event := new(EVM2EVMOnRampNopsSet) + if err := _EVM2EVMOnRamp.contract.UnpackLog(event, "NopsSet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type EVM2EVMOnRampOwnershipTransferRequestedIterator struct { + Event *EVM2EVMOnRampOwnershipTransferRequested + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *EVM2EVMOnRampOwnershipTransferRequestedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOnRampOwnershipTransferRequested) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOnRampOwnershipTransferRequested) + 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() + } +} + +func (it *EVM2EVMOnRampOwnershipTransferRequestedIterator) Error() error { + return it.fail +} + +func (it *EVM2EVMOnRampOwnershipTransferRequestedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type EVM2EVMOnRampOwnershipTransferRequested struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*EVM2EVMOnRampOwnershipTransferRequestedIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _EVM2EVMOnRamp.contract.FilterLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return &EVM2EVMOnRampOwnershipTransferRequestedIterator{contract: _EVM2EVMOnRamp.contract, event: "OwnershipTransferRequested", logs: logs, sub: sub}, nil +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *EVM2EVMOnRampOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _EVM2EVMOnRamp.contract.WatchLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(EVM2EVMOnRampOwnershipTransferRequested) + if err := _EVM2EVMOnRamp.contract.UnpackLog(event, "OwnershipTransferRequested", 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 +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) ParseOwnershipTransferRequested(log types.Log) (*EVM2EVMOnRampOwnershipTransferRequested, error) { + event := new(EVM2EVMOnRampOwnershipTransferRequested) + if err := _EVM2EVMOnRamp.contract.UnpackLog(event, "OwnershipTransferRequested", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type EVM2EVMOnRampOwnershipTransferredIterator struct { + Event *EVM2EVMOnRampOwnershipTransferred + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *EVM2EVMOnRampOwnershipTransferredIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOnRampOwnershipTransferred) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOnRampOwnershipTransferred) + 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() + } +} + +func (it *EVM2EVMOnRampOwnershipTransferredIterator) Error() error { + return it.fail +} + +func (it *EVM2EVMOnRampOwnershipTransferredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type EVM2EVMOnRampOwnershipTransferred struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*EVM2EVMOnRampOwnershipTransferredIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _EVM2EVMOnRamp.contract.FilterLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return &EVM2EVMOnRampOwnershipTransferredIterator{contract: _EVM2EVMOnRamp.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *EVM2EVMOnRampOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _EVM2EVMOnRamp.contract.WatchLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(EVM2EVMOnRampOwnershipTransferred) + if err := _EVM2EVMOnRamp.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 +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) ParseOwnershipTransferred(log types.Log) (*EVM2EVMOnRampOwnershipTransferred, error) { + event := new(EVM2EVMOnRampOwnershipTransferred) + if err := _EVM2EVMOnRamp.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type EVM2EVMOnRampPoolAddedIterator struct { + Event *EVM2EVMOnRampPoolAdded + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *EVM2EVMOnRampPoolAddedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOnRampPoolAdded) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOnRampPoolAdded) + 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() + } +} + +func (it *EVM2EVMOnRampPoolAddedIterator) Error() error { + return it.fail +} + +func (it *EVM2EVMOnRampPoolAddedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type EVM2EVMOnRampPoolAdded struct { + Token common.Address + Pool common.Address + Raw types.Log +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) FilterPoolAdded(opts *bind.FilterOpts) (*EVM2EVMOnRampPoolAddedIterator, error) { + + logs, sub, err := _EVM2EVMOnRamp.contract.FilterLogs(opts, "PoolAdded") + if err != nil { + return nil, err + } + return &EVM2EVMOnRampPoolAddedIterator{contract: _EVM2EVMOnRamp.contract, event: "PoolAdded", logs: logs, sub: sub}, nil +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) WatchPoolAdded(opts *bind.WatchOpts, sink chan<- *EVM2EVMOnRampPoolAdded) (event.Subscription, error) { + + logs, sub, err := _EVM2EVMOnRamp.contract.WatchLogs(opts, "PoolAdded") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(EVM2EVMOnRampPoolAdded) + if err := _EVM2EVMOnRamp.contract.UnpackLog(event, "PoolAdded", 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 +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) ParsePoolAdded(log types.Log) (*EVM2EVMOnRampPoolAdded, error) { + event := new(EVM2EVMOnRampPoolAdded) + if err := _EVM2EVMOnRamp.contract.UnpackLog(event, "PoolAdded", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type EVM2EVMOnRampPoolRemovedIterator struct { + Event *EVM2EVMOnRampPoolRemoved + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *EVM2EVMOnRampPoolRemovedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOnRampPoolRemoved) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOnRampPoolRemoved) + 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() + } +} + +func (it *EVM2EVMOnRampPoolRemovedIterator) Error() error { + return it.fail +} + +func (it *EVM2EVMOnRampPoolRemovedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type EVM2EVMOnRampPoolRemoved struct { + Token common.Address + Pool common.Address + Raw types.Log +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) FilterPoolRemoved(opts *bind.FilterOpts) (*EVM2EVMOnRampPoolRemovedIterator, error) { + + logs, sub, err := _EVM2EVMOnRamp.contract.FilterLogs(opts, "PoolRemoved") + if err != nil { + return nil, err + } + return &EVM2EVMOnRampPoolRemovedIterator{contract: _EVM2EVMOnRamp.contract, event: "PoolRemoved", logs: logs, sub: sub}, nil +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) WatchPoolRemoved(opts *bind.WatchOpts, sink chan<- *EVM2EVMOnRampPoolRemoved) (event.Subscription, error) { + + logs, sub, err := _EVM2EVMOnRamp.contract.WatchLogs(opts, "PoolRemoved") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(EVM2EVMOnRampPoolRemoved) + if err := _EVM2EVMOnRamp.contract.UnpackLog(event, "PoolRemoved", 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 +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) ParsePoolRemoved(log types.Log) (*EVM2EVMOnRampPoolRemoved, error) { + event := new(EVM2EVMOnRampPoolRemoved) + if err := _EVM2EVMOnRamp.contract.UnpackLog(event, "PoolRemoved", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type EVM2EVMOnRampTokenTransferFeeConfigSetIterator struct { + Event *EVM2EVMOnRampTokenTransferFeeConfigSet + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *EVM2EVMOnRampTokenTransferFeeConfigSetIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOnRampTokenTransferFeeConfigSet) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOnRampTokenTransferFeeConfigSet) + 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() + } +} + +func (it *EVM2EVMOnRampTokenTransferFeeConfigSetIterator) Error() error { + return it.fail +} + +func (it *EVM2EVMOnRampTokenTransferFeeConfigSetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type EVM2EVMOnRampTokenTransferFeeConfigSet struct { + TransferFeeConfig []EVM2EVMOnRampTokenTransferFeeConfigArgs + Raw types.Log +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) FilterTokenTransferFeeConfigSet(opts *bind.FilterOpts) (*EVM2EVMOnRampTokenTransferFeeConfigSetIterator, error) { + + logs, sub, err := _EVM2EVMOnRamp.contract.FilterLogs(opts, "TokenTransferFeeConfigSet") + if err != nil { + return nil, err + } + return &EVM2EVMOnRampTokenTransferFeeConfigSetIterator{contract: _EVM2EVMOnRamp.contract, event: "TokenTransferFeeConfigSet", logs: logs, sub: sub}, nil +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) WatchTokenTransferFeeConfigSet(opts *bind.WatchOpts, sink chan<- *EVM2EVMOnRampTokenTransferFeeConfigSet) (event.Subscription, error) { + + logs, sub, err := _EVM2EVMOnRamp.contract.WatchLogs(opts, "TokenTransferFeeConfigSet") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(EVM2EVMOnRampTokenTransferFeeConfigSet) + if err := _EVM2EVMOnRamp.contract.UnpackLog(event, "TokenTransferFeeConfigSet", 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 +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) ParseTokenTransferFeeConfigSet(log types.Log) (*EVM2EVMOnRampTokenTransferFeeConfigSet, error) { + event := new(EVM2EVMOnRampTokenTransferFeeConfigSet) + if err := _EVM2EVMOnRamp.contract.UnpackLog(event, "TokenTransferFeeConfigSet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type GetNops struct { + NopsAndWeights []EVM2EVMOnRampNopAndWeight + WeightsTotal *big.Int +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRamp) ParseLog(log types.Log) (generated.AbigenLog, error) { + switch log.Topics[0] { + case _EVM2EVMOnRamp.abi.Events["AdminSet"].ID: + return _EVM2EVMOnRamp.ParseAdminSet(log) + case _EVM2EVMOnRamp.abi.Events["AllowListAdd"].ID: + return _EVM2EVMOnRamp.ParseAllowListAdd(log) + case _EVM2EVMOnRamp.abi.Events["AllowListEnabledSet"].ID: + return _EVM2EVMOnRamp.ParseAllowListEnabledSet(log) + case _EVM2EVMOnRamp.abi.Events["AllowListRemove"].ID: + return _EVM2EVMOnRamp.ParseAllowListRemove(log) + case _EVM2EVMOnRamp.abi.Events["CCIPSendRequested"].ID: + return _EVM2EVMOnRamp.ParseCCIPSendRequested(log) + case _EVM2EVMOnRamp.abi.Events["ConfigSet"].ID: + return _EVM2EVMOnRamp.ParseConfigSet(log) + case _EVM2EVMOnRamp.abi.Events["FeeConfigSet"].ID: + return _EVM2EVMOnRamp.ParseFeeConfigSet(log) + case _EVM2EVMOnRamp.abi.Events["NopPaid"].ID: + return _EVM2EVMOnRamp.ParseNopPaid(log) + case _EVM2EVMOnRamp.abi.Events["NopsSet"].ID: + return _EVM2EVMOnRamp.ParseNopsSet(log) + case _EVM2EVMOnRamp.abi.Events["OwnershipTransferRequested"].ID: + return _EVM2EVMOnRamp.ParseOwnershipTransferRequested(log) + case _EVM2EVMOnRamp.abi.Events["OwnershipTransferred"].ID: + return _EVM2EVMOnRamp.ParseOwnershipTransferred(log) + case _EVM2EVMOnRamp.abi.Events["PoolAdded"].ID: + return _EVM2EVMOnRamp.ParsePoolAdded(log) + case _EVM2EVMOnRamp.abi.Events["PoolRemoved"].ID: + return _EVM2EVMOnRamp.ParsePoolRemoved(log) + case _EVM2EVMOnRamp.abi.Events["TokenTransferFeeConfigSet"].ID: + return _EVM2EVMOnRamp.ParseTokenTransferFeeConfigSet(log) + + default: + return nil, fmt.Errorf("abigen wrapper received unknown log topic: %v", log.Topics[0]) + } +} + +func (EVM2EVMOnRampAdminSet) Topic() common.Hash { + return common.HexToHash("0x8fe72c3e0020beb3234e76ae6676fa576fbfcae600af1c4fea44784cf0db329c") +} + +func (EVM2EVMOnRampAllowListAdd) Topic() common.Hash { + return common.HexToHash("0x2640d4d76caf8bf478aabfa982fa4e1c4eb71a37f93cd15e80dbc657911546d8") +} + +func (EVM2EVMOnRampAllowListEnabledSet) Topic() common.Hash { + return common.HexToHash("0xccf4daf6ab6430389f26b970595dab82a5881ad454770907e415ede27c8df032") +} + +func (EVM2EVMOnRampAllowListRemove) Topic() common.Hash { + return common.HexToHash("0x800671136ab6cfee9fbe5ed1fb7ca417811aca3cf864800d127b927adedf7566") +} + +func (EVM2EVMOnRampCCIPSendRequested) Topic() common.Hash { + return common.HexToHash("0xaffc45517195d6499808c643bd4a7b0ffeedf95bea5852840d7bfcf63f59e821") +} + +func (EVM2EVMOnRampConfigSet) Topic() common.Hash { + return common.HexToHash("0xdd226617d8d287f40a64c54741bbcdc492b3e096ef16bc5273a18cb6ab85f124") +} + +func (EVM2EVMOnRampFeeConfigSet) Topic() common.Hash { + return common.HexToHash("0xfba339fca97870ffdfaedbae3745db5e6de1a6909dfd0e0dbb56917469ffe236") +} + +func (EVM2EVMOnRampNopPaid) Topic() common.Hash { + return common.HexToHash("0x55fdec2aab60a41fa5abb106670eb1006f5aeaee1ba7afea2bc89b5b3ec7678f") +} + +func (EVM2EVMOnRampNopsSet) Topic() common.Hash { + return common.HexToHash("0x8c337bff38141c507abd25c547606bdde78fe8c12e941ab613f3a565fea6cd24") +} + +func (EVM2EVMOnRampOwnershipTransferRequested) Topic() common.Hash { + return common.HexToHash("0xed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae1278") +} + +func (EVM2EVMOnRampOwnershipTransferred) Topic() common.Hash { + return common.HexToHash("0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0") +} + +func (EVM2EVMOnRampPoolAdded) Topic() common.Hash { + return common.HexToHash("0x95f865c2808f8b2a85eea2611db7843150ee7835ef1403f9755918a97d76933c") +} + +func (EVM2EVMOnRampPoolRemoved) Topic() common.Hash { + return common.HexToHash("0x987eb3c2f78454541205f72f34839b434c306c9eaf4922efd7c0c3060fdb2e4c") +} + +func (EVM2EVMOnRampTokenTransferFeeConfigSet) Topic() common.Hash { + return common.HexToHash("0xcb0c5f472d325cf0c56953fc81870ddd80d0d3c9a3fbfe777002d75f380dfb81") +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRamp) Address() common.Address { + return _EVM2EVMOnRamp.address +} + +type EVM2EVMOnRampInterface interface { + CurrentRateLimiterState(opts *bind.CallOpts) (RateLimiterTokenBucket, error) + + GetAllowList(opts *bind.CallOpts) ([]common.Address, error) + + GetAllowListEnabled(opts *bind.CallOpts) (bool, error) + + GetDynamicConfig(opts *bind.CallOpts) (EVM2EVMOnRampDynamicConfig, error) + + GetExpectedNextSequenceNumber(opts *bind.CallOpts) (uint64, error) + + GetFee(opts *bind.CallOpts, message ClientEVM2AnyMessage) (*big.Int, error) + + GetFeeTokenConfig(opts *bind.CallOpts, token common.Address) (EVM2EVMOnRampFeeTokenConfig, error) + + GetNopFeesJuels(opts *bind.CallOpts) (*big.Int, error) + + GetNops(opts *bind.CallOpts) (GetNops, + + error) + + GetPoolBySourceToken(opts *bind.CallOpts, sourceToken common.Address) (common.Address, error) + + GetSenderNonce(opts *bind.CallOpts, sender common.Address) (uint64, error) + + GetStaticConfig(opts *bind.CallOpts) (EVM2EVMOnRampStaticConfig, error) + + GetSupportedTokens(opts *bind.CallOpts) ([]common.Address, error) + + GetTokenLimitAdmin(opts *bind.CallOpts) (common.Address, error) + + GetTokenTransferFeeConfig(opts *bind.CallOpts, token common.Address) (EVM2EVMOnRampTokenTransferFeeConfig, error) + + LinkAvailableForPayment(opts *bind.CallOpts) (*big.Int, error) + + Owner(opts *bind.CallOpts) (common.Address, error) + + TypeAndVersion(opts *bind.CallOpts) (string, error) + + AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) + + ApplyAllowListUpdates(opts *bind.TransactOpts, removes []common.Address, adds []common.Address) (*types.Transaction, error) + + ApplyPoolUpdates(opts *bind.TransactOpts, removes []InternalPoolUpdate, adds []InternalPoolUpdate) (*types.Transaction, error) + + ForwardFromRouter(opts *bind.TransactOpts, message ClientEVM2AnyMessage, feeTokenAmount *big.Int, originalSender common.Address) (*types.Transaction, error) + + PayNops(opts *bind.TransactOpts) (*types.Transaction, error) + + SetAdmin(opts *bind.TransactOpts, newAdmin common.Address) (*types.Transaction, error) + + SetAllowListEnabled(opts *bind.TransactOpts, enabled bool) (*types.Transaction, error) + + SetDynamicConfig(opts *bind.TransactOpts, dynamicConfig EVM2EVMOnRampDynamicConfig) (*types.Transaction, error) + + SetFeeTokenConfig(opts *bind.TransactOpts, feeTokenConfigArgs []EVM2EVMOnRampFeeTokenConfigArgs) (*types.Transaction, error) + + SetNops(opts *bind.TransactOpts, nopsAndWeights []EVM2EVMOnRampNopAndWeight) (*types.Transaction, error) + + SetRateLimiterConfig(opts *bind.TransactOpts, config RateLimiterConfig) (*types.Transaction, error) + + SetTokenTransferFeeConfig(opts *bind.TransactOpts, tokenTransferFeeConfigArgs []EVM2EVMOnRampTokenTransferFeeConfigArgs) (*types.Transaction, error) + + TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) + + WithdrawNonLinkFees(opts *bind.TransactOpts, feeToken common.Address, to common.Address) (*types.Transaction, error) + + FilterAdminSet(opts *bind.FilterOpts) (*EVM2EVMOnRampAdminSetIterator, error) + + WatchAdminSet(opts *bind.WatchOpts, sink chan<- *EVM2EVMOnRampAdminSet) (event.Subscription, error) + + ParseAdminSet(log types.Log) (*EVM2EVMOnRampAdminSet, error) + + FilterAllowListAdd(opts *bind.FilterOpts) (*EVM2EVMOnRampAllowListAddIterator, error) + + WatchAllowListAdd(opts *bind.WatchOpts, sink chan<- *EVM2EVMOnRampAllowListAdd) (event.Subscription, error) + + ParseAllowListAdd(log types.Log) (*EVM2EVMOnRampAllowListAdd, error) + + FilterAllowListEnabledSet(opts *bind.FilterOpts) (*EVM2EVMOnRampAllowListEnabledSetIterator, error) + + WatchAllowListEnabledSet(opts *bind.WatchOpts, sink chan<- *EVM2EVMOnRampAllowListEnabledSet) (event.Subscription, error) + + ParseAllowListEnabledSet(log types.Log) (*EVM2EVMOnRampAllowListEnabledSet, error) + + FilterAllowListRemove(opts *bind.FilterOpts) (*EVM2EVMOnRampAllowListRemoveIterator, error) + + WatchAllowListRemove(opts *bind.WatchOpts, sink chan<- *EVM2EVMOnRampAllowListRemove) (event.Subscription, error) + + ParseAllowListRemove(log types.Log) (*EVM2EVMOnRampAllowListRemove, error) + + FilterCCIPSendRequested(opts *bind.FilterOpts) (*EVM2EVMOnRampCCIPSendRequestedIterator, error) + + WatchCCIPSendRequested(opts *bind.WatchOpts, sink chan<- *EVM2EVMOnRampCCIPSendRequested) (event.Subscription, error) + + ParseCCIPSendRequested(log types.Log) (*EVM2EVMOnRampCCIPSendRequested, error) + + FilterConfigSet(opts *bind.FilterOpts) (*EVM2EVMOnRampConfigSetIterator, error) + + WatchConfigSet(opts *bind.WatchOpts, sink chan<- *EVM2EVMOnRampConfigSet) (event.Subscription, error) + + ParseConfigSet(log types.Log) (*EVM2EVMOnRampConfigSet, error) + + FilterFeeConfigSet(opts *bind.FilterOpts) (*EVM2EVMOnRampFeeConfigSetIterator, error) + + WatchFeeConfigSet(opts *bind.WatchOpts, sink chan<- *EVM2EVMOnRampFeeConfigSet) (event.Subscription, error) + + ParseFeeConfigSet(log types.Log) (*EVM2EVMOnRampFeeConfigSet, error) + + FilterNopPaid(opts *bind.FilterOpts, nop []common.Address) (*EVM2EVMOnRampNopPaidIterator, error) + + WatchNopPaid(opts *bind.WatchOpts, sink chan<- *EVM2EVMOnRampNopPaid, nop []common.Address) (event.Subscription, error) + + ParseNopPaid(log types.Log) (*EVM2EVMOnRampNopPaid, error) + + FilterNopsSet(opts *bind.FilterOpts) (*EVM2EVMOnRampNopsSetIterator, error) + + WatchNopsSet(opts *bind.WatchOpts, sink chan<- *EVM2EVMOnRampNopsSet) (event.Subscription, error) + + ParseNopsSet(log types.Log) (*EVM2EVMOnRampNopsSet, error) + + FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*EVM2EVMOnRampOwnershipTransferRequestedIterator, error) + + WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *EVM2EVMOnRampOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferRequested(log types.Log) (*EVM2EVMOnRampOwnershipTransferRequested, error) + + FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*EVM2EVMOnRampOwnershipTransferredIterator, error) + + WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *EVM2EVMOnRampOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferred(log types.Log) (*EVM2EVMOnRampOwnershipTransferred, error) + + FilterPoolAdded(opts *bind.FilterOpts) (*EVM2EVMOnRampPoolAddedIterator, error) + + WatchPoolAdded(opts *bind.WatchOpts, sink chan<- *EVM2EVMOnRampPoolAdded) (event.Subscription, error) + + ParsePoolAdded(log types.Log) (*EVM2EVMOnRampPoolAdded, error) + + FilterPoolRemoved(opts *bind.FilterOpts) (*EVM2EVMOnRampPoolRemovedIterator, error) + + WatchPoolRemoved(opts *bind.WatchOpts, sink chan<- *EVM2EVMOnRampPoolRemoved) (event.Subscription, error) + + ParsePoolRemoved(log types.Log) (*EVM2EVMOnRampPoolRemoved, error) + + FilterTokenTransferFeeConfigSet(opts *bind.FilterOpts) (*EVM2EVMOnRampTokenTransferFeeConfigSetIterator, error) + + WatchTokenTransferFeeConfigSet(opts *bind.WatchOpts, sink chan<- *EVM2EVMOnRampTokenTransferFeeConfigSet) (event.Subscription, error) + + ParseTokenTransferFeeConfigSet(log types.Log) (*EVM2EVMOnRampTokenTransferFeeConfigSet, error) + + ParseLog(log types.Log) (generated.AbigenLog, error) + + Address() common.Address +} diff --git a/core/gethwrappers/ccip/generated/evm_2_evm_onramp_1_1_0/evm_2_evm_onramp_1_1_0.go b/core/gethwrappers/ccip/generated/evm_2_evm_onramp_1_1_0/evm_2_evm_onramp_1_1_0.go new file mode 100644 index 00000000000..fb5aa512ac9 --- /dev/null +++ b/core/gethwrappers/ccip/generated/evm_2_evm_onramp_1_1_0/evm_2_evm_onramp_1_1_0.go @@ -0,0 +1,2794 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package evm_2_evm_onramp_1_1_0 + +import ( + "errors" + "fmt" + "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" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" +) + +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +type ClientEVM2AnyMessage struct { + Receiver []byte + Data []byte + TokenAmounts []ClientEVMTokenAmount + FeeToken common.Address + ExtraArgs []byte +} + +type ClientEVMTokenAmount struct { + Token common.Address + Amount *big.Int +} + +type EVM2EVMOnRampDynamicConfig struct { + Router common.Address + MaxTokensLength uint16 + DestGasOverhead uint32 + DestGasPerPayloadByte uint16 + PriceRegistry common.Address + MaxDataSize uint32 + MaxGasLimit uint64 +} + +type EVM2EVMOnRampFeeTokenConfig struct { + NetworkFeeUSD uint32 + MinTokenTransferFeeUSD uint32 + MaxTokenTransferFeeUSD uint32 + GasMultiplier uint64 + PremiumMultiplier uint64 + Enabled bool +} + +type EVM2EVMOnRampFeeTokenConfigArgs struct { + Token common.Address + NetworkFeeUSD uint32 + MinTokenTransferFeeUSD uint32 + MaxTokenTransferFeeUSD uint32 + GasMultiplier uint64 + PremiumMultiplier uint64 + Enabled bool +} + +type EVM2EVMOnRampNopAndWeight struct { + Nop common.Address + Weight uint16 +} + +type EVM2EVMOnRampStaticConfig struct { + LinkToken common.Address + ChainSelector uint64 + DestChainSelector uint64 + DefaultTxGasLimit uint64 + MaxNopFeesJuels *big.Int + PrevOnRamp common.Address + ArmProxy common.Address +} + +type EVM2EVMOnRampTokenTransferFeeConfig struct { + Ratio uint16 + DestGasOverhead uint32 +} + +type EVM2EVMOnRampTokenTransferFeeConfigArgs struct { + Token common.Address + Ratio uint16 + DestGasOverhead uint32 +} + +type InternalEVM2EVMMessage struct { + SourceChainSelector uint64 + SequenceNumber uint64 + FeeTokenAmount *big.Int + Sender common.Address + Nonce uint64 + GasLimit *big.Int + Strict bool + Receiver common.Address + Data []byte + TokenAmounts []ClientEVMTokenAmount + FeeToken common.Address + MessageId [32]byte +} + +type InternalPoolUpdate struct { + Token common.Address + Pool common.Address +} + +type RateLimiterConfig struct { + IsEnabled bool + Capacity *big.Int + Rate *big.Int +} + +type RateLimiterTokenBucket struct { + Tokens *big.Int + LastUpdated uint32 + IsEnabled bool + Capacity *big.Int + Rate *big.Int +} + +var EVM2EVMOnRampMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"linkToken\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"defaultTxGasLimit\",\"type\":\"uint64\"},{\"internalType\":\"uint96\",\"name\":\"maxNopFeesJuels\",\"type\":\"uint96\"},{\"internalType\":\"address\",\"name\":\"prevOnRamp\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"armProxy\",\"type\":\"address\"}],\"internalType\":\"structEVM2EVMOnRamp.StaticConfig\",\"name\":\"staticConfig\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"router\",\"type\":\"address\"},{\"internalType\":\"uint16\",\"name\":\"maxTokensLength\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"destGasOverhead\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"destGasPerPayloadByte\",\"type\":\"uint16\"},{\"internalType\":\"address\",\"name\":\"priceRegistry\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"maxDataSize\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"maxGasLimit\",\"type\":\"uint64\"}],\"internalType\":\"structEVM2EVMOnRamp.DynamicConfig\",\"name\":\"dynamicConfig\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"internalType\":\"structInternal.PoolUpdate[]\",\"name\":\"tokensAndPools\",\"type\":\"tuple[]\"},{\"internalType\":\"address[]\",\"name\":\"allowlist\",\"type\":\"address[]\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"rateLimiterConfig\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"networkFeeUSD\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"minTokenTransferFeeUSD\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"maxTokenTransferFeeUSD\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"gasMultiplier\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"premiumMultiplier\",\"type\":\"uint64\"},{\"internalType\":\"bool\",\"name\":\"enabled\",\"type\":\"bool\"}],\"internalType\":\"structEVM2EVMOnRamp.FeeTokenConfigArgs[]\",\"name\":\"feeTokenConfigs\",\"type\":\"tuple[]\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint16\",\"name\":\"ratio\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"destGasOverhead\",\"type\":\"uint32\"}],\"internalType\":\"structEVM2EVMOnRamp.TokenTransferFeeConfigArgs[]\",\"name\":\"tokenTransferFeeConfigArgs\",\"type\":\"tuple[]\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"nop\",\"type\":\"address\"},{\"internalType\":\"uint16\",\"name\":\"weight\",\"type\":\"uint16\"}],\"internalType\":\"structEVM2EVMOnRamp.NopAndWeight[]\",\"name\":\"nopsAndWeights\",\"type\":\"tuple[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"capacity\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"requested\",\"type\":\"uint256\"}],\"name\":\"AggregateValueMaxCapacityExceeded\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"minWaitInSeconds\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"available\",\"type\":\"uint256\"}],\"name\":\"AggregateValueRateLimitReached\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"BadARMSignal\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"BucketOverfilled\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InsufficientBalance\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"encodedAddress\",\"type\":\"bytes\"}],\"name\":\"InvalidAddress\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidConfig\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidExtraArgsTag\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"nop\",\"type\":\"address\"}],\"name\":\"InvalidNopAddress\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidTokenPoolConfig\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidWithdrawParams\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"LinkBalanceNotSettled\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"MaxFeeBalanceReached\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"MessageGasLimitTooHigh\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"maxSize\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"actualSize\",\"type\":\"uint256\"}],\"name\":\"MessageTooLarge\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"MustBeCalledByRouter\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NoFeesToPay\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NoNopsToPay\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"NotAFeeToken\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCallableByAdminOrOwner\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCallableByOwnerOrAdmin\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCallableByOwnerOrAdminOrNop\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"PoolAlreadyAdded\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"PoolDoesNotExist\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"PriceNotFoundForToken\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RouterMustSetOriginalSender\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"SenderNotAllowed\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"capacity\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"requested\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"}],\"name\":\"TokenMaxCapacityExceeded\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TokenPoolMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"minWaitInSeconds\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"available\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"}],\"name\":\"TokenRateLimitReached\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TooManyNops\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UnsupportedNumberOfTokens\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"contractIERC20\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"UnsupportedToken\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"AllowListAdd\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"enabled\",\"type\":\"bool\"}],\"name\":\"AllowListEnabledSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"AllowListRemove\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"sequenceNumber\",\"type\":\"uint64\"},{\"internalType\":\"uint256\",\"name\":\"feeTokenAmount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"nonce\",\"type\":\"uint64\"},{\"internalType\":\"uint256\",\"name\":\"gasLimit\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"strict\",\"type\":\"bool\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"internalType\":\"structClient.EVMTokenAmount[]\",\"name\":\"tokenAmounts\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"feeToken\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"messageId\",\"type\":\"bytes32\"}],\"indexed\":false,\"internalType\":\"structInternal.EVM2EVMMessage\",\"name\":\"message\",\"type\":\"tuple\"}],\"name\":\"CCIPSendRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"linkToken\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"defaultTxGasLimit\",\"type\":\"uint64\"},{\"internalType\":\"uint96\",\"name\":\"maxNopFeesJuels\",\"type\":\"uint96\"},{\"internalType\":\"address\",\"name\":\"prevOnRamp\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"armProxy\",\"type\":\"address\"}],\"indexed\":false,\"internalType\":\"structEVM2EVMOnRamp.StaticConfig\",\"name\":\"staticConfig\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"router\",\"type\":\"address\"},{\"internalType\":\"uint16\",\"name\":\"maxTokensLength\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"destGasOverhead\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"destGasPerPayloadByte\",\"type\":\"uint16\"},{\"internalType\":\"address\",\"name\":\"priceRegistry\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"maxDataSize\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"maxGasLimit\",\"type\":\"uint64\"}],\"indexed\":false,\"internalType\":\"structEVM2EVMOnRamp.DynamicConfig\",\"name\":\"dynamicConfig\",\"type\":\"tuple\"}],\"name\":\"ConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"networkFeeUSD\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"minTokenTransferFeeUSD\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"maxTokenTransferFeeUSD\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"gasMultiplier\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"premiumMultiplier\",\"type\":\"uint64\"},{\"internalType\":\"bool\",\"name\":\"enabled\",\"type\":\"bool\"}],\"indexed\":false,\"internalType\":\"structEVM2EVMOnRamp.FeeTokenConfigArgs[]\",\"name\":\"feeConfig\",\"type\":\"tuple[]\"}],\"name\":\"FeeConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"nop\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"NopPaid\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"nopWeightsTotal\",\"type\":\"uint256\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"nop\",\"type\":\"address\"},{\"internalType\":\"uint16\",\"name\":\"weight\",\"type\":\"uint16\"}],\"indexed\":false,\"internalType\":\"structEVM2EVMOnRamp.NopAndWeight[]\",\"name\":\"nopsAndWeights\",\"type\":\"tuple[]\"}],\"name\":\"NopsSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"name\":\"PoolAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"name\":\"PoolRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint16\",\"name\":\"ratio\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"destGasOverhead\",\"type\":\"uint32\"}],\"indexed\":false,\"internalType\":\"structEVM2EVMOnRamp.TokenTransferFeeConfigArgs[]\",\"name\":\"transferFeeConfig\",\"type\":\"tuple[]\"}],\"name\":\"TokenTransferFeeConfigSet\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"removes\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"adds\",\"type\":\"address[]\"}],\"name\":\"applyAllowListUpdates\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"internalType\":\"structInternal.PoolUpdate[]\",\"name\":\"removes\",\"type\":\"tuple[]\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"internalType\":\"structInternal.PoolUpdate[]\",\"name\":\"adds\",\"type\":\"tuple[]\"}],\"name\":\"applyPoolUpdates\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"currentRateLimiterState\",\"outputs\":[{\"components\":[{\"internalType\":\"uint128\",\"name\":\"tokens\",\"type\":\"uint128\"},{\"internalType\":\"uint32\",\"name\":\"lastUpdated\",\"type\":\"uint32\"},{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.TokenBucket\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes\",\"name\":\"receiver\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"internalType\":\"structClient.EVMTokenAmount[]\",\"name\":\"tokenAmounts\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"feeToken\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"extraArgs\",\"type\":\"bytes\"}],\"internalType\":\"structClient.EVM2AnyMessage\",\"name\":\"message\",\"type\":\"tuple\"},{\"internalType\":\"uint256\",\"name\":\"feeTokenAmount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"originalSender\",\"type\":\"address\"}],\"name\":\"forwardFromRouter\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAllowList\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAllowListEnabled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getDynamicConfig\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"router\",\"type\":\"address\"},{\"internalType\":\"uint16\",\"name\":\"maxTokensLength\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"destGasOverhead\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"destGasPerPayloadByte\",\"type\":\"uint16\"},{\"internalType\":\"address\",\"name\":\"priceRegistry\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"maxDataSize\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"maxGasLimit\",\"type\":\"uint64\"}],\"internalType\":\"structEVM2EVMOnRamp.DynamicConfig\",\"name\":\"dynamicConfig\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getExpectedNextSequenceNumber\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes\",\"name\":\"receiver\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"internalType\":\"structClient.EVMTokenAmount[]\",\"name\":\"tokenAmounts\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"feeToken\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"extraArgs\",\"type\":\"bytes\"}],\"internalType\":\"structClient.EVM2AnyMessage\",\"name\":\"message\",\"type\":\"tuple\"}],\"name\":\"getFee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"getFeeTokenConfig\",\"outputs\":[{\"components\":[{\"internalType\":\"uint32\",\"name\":\"networkFeeUSD\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"minTokenTransferFeeUSD\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"maxTokenTransferFeeUSD\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"gasMultiplier\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"premiumMultiplier\",\"type\":\"uint64\"},{\"internalType\":\"bool\",\"name\":\"enabled\",\"type\":\"bool\"}],\"internalType\":\"structEVM2EVMOnRamp.FeeTokenConfig\",\"name\":\"feeTokenConfig\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getNopFeesJuels\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"\",\"type\":\"uint96\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getNops\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"nop\",\"type\":\"address\"},{\"internalType\":\"uint16\",\"name\":\"weight\",\"type\":\"uint16\"}],\"internalType\":\"structEVM2EVMOnRamp.NopAndWeight[]\",\"name\":\"nopsAndWeights\",\"type\":\"tuple[]\"},{\"internalType\":\"uint256\",\"name\":\"weightsTotal\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractIERC20\",\"name\":\"sourceToken\",\"type\":\"address\"}],\"name\":\"getPoolBySourceToken\",\"outputs\":[{\"internalType\":\"contractIPool\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"getSenderNonce\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getStaticConfig\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"linkToken\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"defaultTxGasLimit\",\"type\":\"uint64\"},{\"internalType\":\"uint96\",\"name\":\"maxNopFeesJuels\",\"type\":\"uint96\"},{\"internalType\":\"address\",\"name\":\"prevOnRamp\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"armProxy\",\"type\":\"address\"}],\"internalType\":\"structEVM2EVMOnRamp.StaticConfig\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getSupportedTokens\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getTokenLimitAdmin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"getTokenTransferFeeConfig\",\"outputs\":[{\"components\":[{\"internalType\":\"uint16\",\"name\":\"ratio\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"destGasOverhead\",\"type\":\"uint32\"}],\"internalType\":\"structEVM2EVMOnRamp.TokenTransferFeeConfig\",\"name\":\"tokenTransferFeeConfig\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"linkAvailableForPayment\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"payNops\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"setAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bool\",\"name\":\"enabled\",\"type\":\"bool\"}],\"name\":\"setAllowListEnabled\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"router\",\"type\":\"address\"},{\"internalType\":\"uint16\",\"name\":\"maxTokensLength\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"destGasOverhead\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"destGasPerPayloadByte\",\"type\":\"uint16\"},{\"internalType\":\"address\",\"name\":\"priceRegistry\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"maxDataSize\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"maxGasLimit\",\"type\":\"uint64\"}],\"internalType\":\"structEVM2EVMOnRamp.DynamicConfig\",\"name\":\"dynamicConfig\",\"type\":\"tuple\"}],\"name\":\"setDynamicConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"networkFeeUSD\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"minTokenTransferFeeUSD\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"maxTokenTransferFeeUSD\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"gasMultiplier\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"premiumMultiplier\",\"type\":\"uint64\"},{\"internalType\":\"bool\",\"name\":\"enabled\",\"type\":\"bool\"}],\"internalType\":\"structEVM2EVMOnRamp.FeeTokenConfigArgs[]\",\"name\":\"feeTokenConfigArgs\",\"type\":\"tuple[]\"}],\"name\":\"setFeeTokenConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"nop\",\"type\":\"address\"},{\"internalType\":\"uint16\",\"name\":\"weight\",\"type\":\"uint16\"}],\"internalType\":\"structEVM2EVMOnRamp.NopAndWeight[]\",\"name\":\"nopsAndWeights\",\"type\":\"tuple[]\"}],\"name\":\"setNops\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"config\",\"type\":\"tuple\"}],\"name\":\"setRateLimiterConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint16\",\"name\":\"ratio\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"destGasOverhead\",\"type\":\"uint32\"}],\"internalType\":\"structEVM2EVMOnRamp.TokenTransferFeeConfigArgs[]\",\"name\":\"tokenTransferFeeConfigArgs\",\"type\":\"tuple[]\"}],\"name\":\"setTokenTransferFeeConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"feeToken\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"withdrawNonLinkFees\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", + Bin: "0x6101806040526012805460ff60c01b191690553480156200001f57600080fd5b506040516200834538038062008345833981016040819052620000429162001e90565b8333806000816200009a5760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000cd57620000cd8162000369565b50506040805160a081018252602084810180516001600160801b039081168085524263ffffffff169385018490528751151585870181905292518216606086018190529790950151166080909301839052600380546001600160a01b031916909417600160801b9283021760ff60a01b1916600160a01b90910217909255029091176004555087516001600160a01b0316158062000176575060208801516001600160401b0316155b806200018d575060408801516001600160401b0316155b80620001a4575060608801516001600160401b0316155b80620001bb575060c08801516001600160a01b0316155b15620001da576040516306b7c75960e31b815260040160405180910390fd5b6020808901516040808b015181517fbdd59ac4dd1d82276c9a9c5d2656546346b9dcdb1f9b4204aed4ec15c23d7d3a948101949094526001600160401b039283169184019190915216606082015230608082015260a00160408051601f19818403018152918152815160209283012060809081528a516001600160a01b0390811660e052928b01516001600160401b0390811661010052918b015182166101205260608b015190911660a0908152908a01516001600160601b031660c0908152908a01518216610140528901511661016052620002b78762000414565b620002c2836200059e565b620002cd8262000739565b620002d88162000810565b6040805160008082526020820190925262000323916200031b565b6040805180820190915260008082526020820152815260200190600190039081620002f35790505b508762000a3a565b8451156200035b576012805460ff60c81b1916600160c81b179055604080516000808252602082019092526200035b91508662000d3d565b505050505050505062002407565b336001600160a01b03821603620003c35760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640162000091565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b60808101516001600160a01b031662000440576040516306b7c75960e31b815260040160405180910390fd5b8051600580546020808501516040808701516060808901516001600160a01b039889166001600160b01b031990971696909617600160a01b61ffff95861681029190911765ffffffffffff60b01b1916600160b01b63ffffffff9485160261ffff60d01b191617600160d01b9590971694909402959095179095556080808801516006805460a0808c015160c0808e0151958d166001600160c01b0319909416939093179a16909602989098176001600160c01b0316600160c01b6001600160401b0393841602179055825160e08082018552518916815261010051821695810195909552610120518116858401528351169484019490945284516001600160601b031693830193909352610140518516908201526101605190931691830191909152517f72c6aaba4dde02f77d291123a76185c418ba63f8c217a2d56b08aec84e9bbfb8916200059391849062001fb3565b60405180910390a150565b60005b815181101562000707576000828281518110620005c257620005c26200207f565b6020908102919091018101516040805160c080820183528385015163ffffffff908116835283850151811683870190815260608087015183168587019081526080808901516001600160401b0390811693880193845260a0808b01518216928901928352968a0151151596880196875298516001600160a01b03166000908152600f909a529690982094518554925198519151965194511515600160e01b0260ff60e01b19958916600160a01b0295909516600160a01b600160e81b0319979098166c0100000000000000000000000002600160601b600160a01b0319928516680100000000000000000292909216600160401b600160a01b0319998516640100000000026001600160401b0319909416919094161791909117969096161794909417919091169190911791909117905550620006ff81620020ab565b9050620005a1565b507f2386f61ab5cafc3fed44f9f614f721ab53479ef64067fd16c1a2491b63ddf1a881604051620005939190620020c7565b60005b8151811015620007de5760008282815181106200075d576200075d6200207f565b6020908102919091018101516040805180820182528284015161ffff90811682528284015163ffffffff90811683870190815294516001600160a01b03166000908152601090965292909420905181549351909216620100000265ffffffffffff19909316919093161717905550620007d681620020ab565b90506200073c565b507f4230c60a9725eb5fb992cf6a215398b4e81b4606d4a1e6be8dfe0b60dc172ec1816040516200059391906200217f565b805160408111156200083557604051635ad0867d60e11b815260040160405180910390fd5b6012546c01000000000000000000000000900463ffffffff16158015906200087f575060125463ffffffff6c010000000000000000000000008204166001600160601b0390911610155b156200088f576200088f62000e88565b60006200089d600762001088565b90505b8015620008e9576000620008c3620008ba600184620021e0565b6007906200109b565b509050620008d3600782620010b9565b505080620008e190620021f6565b9050620008a0565b506000805b82811015620009d15760008482815181106200090e576200090e6200207f565b602002602001015160000151905060008583815181106200093357620009336200207f565b602002602001015160200151905060e0516001600160a01b0316826001600160a01b031614806200096b57506001600160a01b038216155b156200099657604051634de938d160e01b81526001600160a01b038316600482015260240162000091565b620009a860078361ffff8416620010d7565b50620009b961ffff82168562002210565b9350505080620009c990620020ab565b9050620008ee565b506012805463ffffffff60601b19166c0100000000000000000000000063ffffffff8416021790556040517f8c337bff38141c507abd25c547606bdde78fe8c12e941ab613f3a565fea6cd249062000a2d908390869062002230565b60405180910390a1505050565b60005b825181101562000b7657600083828151811062000a5e5762000a5e6200207f565b6020026020010151600001519050600084838151811062000a835762000a836200207f565b6020908102919091018101510151905062000aa0600a83620010f7565b62000aca576040516373913ebd60e01b81526001600160a01b038316600482015260240162000091565b6001600160a01b03811662000ae1600a846200110e565b6001600160a01b03161462000b0957604051630d98f73360e31b815260040160405180910390fd5b62000b16600a8362001125565b1562000b6057604080516001600160a01b038085168252831660208201527f987eb3c2f78454541205f72f34839b434c306c9eaf4922efd7c0c3060fdb2e4c910160405180910390a15b50508062000b6e90620020ab565b905062000a3d565b5060005b815181101562000d3857600082828151811062000b9b5762000b9b6200207f565b6020026020010151600001519050600083838151811062000bc05762000bc06200207f565b602002602001015160200151905060006001600160a01b0316826001600160a01b0316148062000bf757506001600160a01b038116155b1562000c155760405162d8548360e71b815260040160405180910390fd5b806001600160a01b03166321df0da76040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000c54573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000c7a91906200229d565b6001600160a01b0316826001600160a01b03161462000cac57604051630d98f73360e31b815260040160405180910390fd5b62000cba600a83836200113c565b1562000d0957604080516001600160a01b038085168252831660208201527f95f865c2808f8b2a85eea2611db7843150ee7835ef1403f9755918a97d76933c910160405180910390a162000d22565b604051633caf458560e01b815260040160405180910390fd5b50508062000d3090620020ab565b905062000b7a565b505050565b60005b825181101562000dd257600083828151811062000d615762000d616200207f565b6020908102919091010151905062000d7b600d8262001154565b1562000dbe576040516001600160a01b03821681527f800671136ab6cfee9fbe5ed1fb7ca417811aca3cf864800d127b927adedf75669060200160405180910390a15b5062000dca81620020ab565b905062000d40565b5060005b815181101562000d3857600082828151811062000df75762000df76200207f565b6020026020010151905060006001600160a01b0316816001600160a01b03160362000e23575062000e75565b62000e30600d826200116b565b1562000e73576040516001600160a01b03821681527f2640d4d76caf8bf478aabfa982fa4e1c4eb71a37f93cd15e80dbc657911546d89060200160405180910390a15b505b62000e8081620020ab565b905062000dd6565b6000546001600160a01b0316331480159062000eaf57506002546001600160a01b03163314155b801562000ec6575062000ec460073362001182565b155b1562000ee55760405163032bb72b60e31b815260040160405180910390fd5b6012546c01000000000000000000000000900463ffffffff16600081900362000f215760405163990e30bf60e01b815260040160405180910390fd5b6012546001600160601b03168181101562000f4f576040516311a1ee3b60e31b815260040160405180910390fd5b600062000f5b62001199565b121562000f7b57604051631e9acf1760e31b815260040160405180910390fd5b80600062000f8a600762001088565b905060005b81811015620010625760008062000fa86007846200109b565b909250905060008762000fc5836001600160601b038a16620022bd565b62000fd19190620022d7565b905062000fdf8187620022fa565b60e05190965062001004906001600160a01b0316846001600160601b03841662001227565b6040516001600160601b03821681526001600160a01b038416907f55fdec2aab60a41fa5abb106670eb1006f5aeaee1ba7afea2bc89b5b3ec7678f9060200160405180910390a2505050806200105a90620020ab565b905062000f8f565b5050601280546001600160601b0319166001600160601b03929092169190911790555050565b600062001095826200127f565b92915050565b6000808080620010ac86866200128c565b9097909650945050505050565b6000620010d0836001600160a01b038416620012b9565b9392505050565b6000620010ef846001600160a01b03851684620012d8565b949350505050565b6000620010d0836001600160a01b038416620012f7565b6000620010d0836001600160a01b03841662001305565b6000620010d0836001600160a01b03841662001313565b6000620010ef846001600160a01b0385168462001321565b6000620010d0836001600160a01b03841662001339565b6000620010d0836001600160a01b03841662001444565b6000620010d0836001600160a01b03841662001496565b60125460e0516040516370a0823160e01b81523060048201526000926001600160601b0316916001600160a01b0316906370a0823190602401602060405180830381865afa158015620011f0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200121691906200231d565b62001222919062002337565b905090565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b0390811663a9059cbb60e01b1790915262000d38918591620014a416565b6000620010958262001575565b600080806200129c858562001580565b600081815260029690960160205260409095205494959350505050565b60008181526002830160205260408120819055620010d083836200158e565b60008281526002840160205260408120829055620010ef84846200159c565b6000620010d0838362001496565b6000620010d08383620015aa565b6000620010d08383620012b9565b6000620010ef84846001600160a01b038516620012d8565b600081815260018301602052604081205480156200143257600062001360600183620021e0565b85549091506000906200137690600190620021e0565b9050818114620013e25760008660000182815481106200139a576200139a6200207f565b9060005260206000200154905080876000018481548110620013c057620013c06200207f565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080620013f657620013f66200235a565b60019003818190600052602060002001600090559055856001016000868152602001908152602001600020600090556001935050505062001095565b600091505062001095565b5092915050565b60008181526001830160205260408120546200148d5750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915562001095565b50600062001095565b6000620010d083836200161f565b6040805180820190915260208082527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c656490820152600090620014f3906001600160a01b03851690849062001638565b80519091501562000d38578080602001905181019062001514919062002370565b62000d385760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840162000091565b600062001095825490565b6000620010d0838362001649565b6000620010d0838362001339565b6000620010d0838362001444565b600081815260028301602052604081205480151580620015d15750620015d1848462001496565b620010d05760405162461bcd60e51b815260206004820152601e60248201527f456e756d657261626c654d61703a206e6f6e6578697374656e74206b65790000604482015260640162000091565b60008181526001830160205260408120541515620010d0565b6060620010ef848460008562001676565b60008260000182815481106200166357620016636200207f565b9060005260206000200154905092915050565b606082471015620016d95760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840162000091565b600080866001600160a01b03168587604051620016f79190620023b4565b60006040518083038185875af1925050503d806000811462001736576040519150601f19603f3d011682016040523d82523d6000602084013e6200173b565b606091505b5090925090506200174f878383876200175a565b979650505050505050565b60608315620017ce578251600003620017c6576001600160a01b0385163b620017c65760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640162000091565b5081620010ef565b620010ef8383815115620017e55781518083602001fd5b8060405162461bcd60e51b8152600401620000919190620023d2565b634e487b7160e01b600052604160045260246000fd5b60405160e081016001600160401b03811182821017156200183c576200183c62001801565b60405290565b604080519081016001600160401b03811182821017156200183c576200183c62001801565b604051606081016001600160401b03811182821017156200183c576200183c62001801565b604051601f8201601f191681016001600160401b0381118282101715620018b757620018b762001801565b604052919050565b6001600160a01b0381168114620018d557600080fd5b50565b8051620018e581620018bf565b919050565b80516001600160401b0381168114620018e557600080fd5b600060e082840312156200191557600080fd5b6200191f62001817565b905081516200192e81620018bf565b81526200193e60208301620018ea565b60208201526200195160408301620018ea565b60408201526200196460608301620018ea565b606082015260808201516001600160601b03811681146200198457600080fd5b60808201526200199760a08301620018d8565b60a0820152620019aa60c08301620018d8565b60c082015292915050565b805161ffff81168114620018e557600080fd5b805163ffffffff81168114620018e557600080fd5b600060e08284031215620019f057600080fd5b620019fa62001817565b9050815162001a0981620018bf565b815262001a1960208301620019b5565b602082015262001a2c60408301620019c8565b604082015262001a3f60608301620019b5565b6060820152608082015162001a5481620018bf565b608082015262001a6760a08301620019c8565b60a0820152620019aa60c08301620018ea565b60006001600160401b0382111562001a965762001a9662001801565b5060051b60200190565b600082601f83011262001ab257600080fd5b8151602062001acb62001ac58362001a7a565b6200188c565b82815260069290921b8401810191818101908684111562001aeb57600080fd5b8286015b8481101562001b45576040818903121562001b0a5760008081fd5b62001b1462001842565b815162001b2181620018bf565b81528185015162001b3281620018bf565b8186015283529183019160400162001aef565b509695505050505050565b600082601f83011262001b6257600080fd5b8151602062001b7562001ac58362001a7a565b82815260059290921b8401810191818101908684111562001b9557600080fd5b8286015b8481101562001b4557805162001baf81620018bf565b835291830191830162001b99565b80518015158114620018e557600080fd5b80516001600160801b0381168114620018e557600080fd5b60006060828403121562001bf957600080fd5b62001c0362001867565b905062001c108262001bbd565b815262001c206020830162001bce565b602082015262001c336040830162001bce565b604082015292915050565b600082601f83011262001c5057600080fd5b8151602062001c6362001ac58362001a7a565b82815260e0928302850182019282820191908785111562001c8357600080fd5b8387015b8581101562001d385781818a03121562001ca15760008081fd5b62001cab62001817565b815162001cb881620018bf565b815262001cc7828701620019c8565b86820152604062001cda818401620019c8565b90820152606062001ced838201620019c8565b90820152608062001d00838201620018ea565b9082015260a062001d13838201620018ea565b9082015260c062001d2683820162001bbd565b90820152845292840192810162001c87565b5090979650505050505050565b600082601f83011262001d5757600080fd5b8151602062001d6a62001ac58362001a7a565b8281526060928302850182019282820191908785111562001d8a57600080fd5b8387015b8581101562001d385781818a03121562001da85760008081fd5b62001db262001867565b815162001dbf81620018bf565b815262001dce828701620019b5565b86820152604062001de1818401620019c8565b90820152845292840192810162001d8e565b600082601f83011262001e0557600080fd5b8151602062001e1862001ac58362001a7a565b82815260069290921b8401810191818101908684111562001e3857600080fd5b8286015b8481101562001b45576040818903121562001e575760008081fd5b62001e6162001842565b815162001e6e81620018bf565b815262001e7d828601620019b5565b8186015283529183019160400162001e3c565b6000806000806000806000806102c0898b03121562001eae57600080fd5b62001eba8a8a62001902565b975062001ecb8a60e08b01620019dd565b6101c08a01519097506001600160401b038082111562001eea57600080fd5b62001ef88c838d0162001aa0565b97506101e08b015191508082111562001f1057600080fd5b62001f1e8c838d0162001b50565b965062001f308c6102008d0162001be6565b95506102608b015191508082111562001f4857600080fd5b62001f568c838d0162001c3e565b94506102808b015191508082111562001f6e57600080fd5b62001f7c8c838d0162001d45565b93506102a08b015191508082111562001f9457600080fd5b5062001fa38b828c0162001df3565b9150509295985092959890939650565b82516001600160a01b0390811682526020808501516001600160401b03908116828501526040808701518216818601526060808801518316818701526080808901516001600160601b03168188015260a0808a015187168189015260c0808b01518816818a01528951881660e08a01529589015161ffff9081166101008a01529389015163ffffffff9081166101208a015292890151909316610140880152870151909416610160860152850151909216610180840152830151166101a08201526101c08101620010d0565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201620020c057620020c062002095565b5060010190565b602080825282518282018190526000919060409081850190868401855b828110156200217257815180516001600160a01b031685528681015163ffffffff9081168887015286820151811687870152606080830151909116908601526080808201516001600160401b03169086015260a08082015162002151878301826001600160401b03169052565b505060c09081015115159085015260e09093019290850190600101620020e4565b5091979650505050505050565b602080825282518282018190526000919060409081850190868401855b828110156200217257815180516001600160a01b031685528681015161ffff168786015285015163ffffffff1685850152606090930192908501906001016200219c565b8181038181111562001095576200109562002095565b60008162002208576200220862002095565b506000190190565b63ffffffff8181168382160190808211156200143d576200143d62002095565b6000604080830163ffffffff8616845260208281860152818651808452606087019150828801935060005b818110156200228f57845180516001600160a01b0316845284015161ffff168484015293830193918501916001016200225b565b509098975050505050505050565b600060208284031215620022b057600080fd5b8151620010d081620018bf565b808202811582820484141762001095576200109562002095565b600082620022f557634e487b7160e01b600052601260045260246000fd5b500490565b6001600160601b038281168282160390808211156200143d576200143d62002095565b6000602082840312156200233057600080fd5b5051919050565b81810360008312801583831316838312821617156200143d576200143d62002095565b634e487b7160e01b600052603160045260246000fd5b6000602082840312156200238357600080fd5b620010d08262001bbd565b60005b83811015620023ab57818101518382015260200162002391565b50506000910152565b60008251620023c88184602087016200238e565b9190910192915050565b6020815260008251806020840152620023f38160408501602087016200238e565b601f01601f19169190910160400192915050565b60805160a05160c05160e05161010051610120516101405161016051615e376200250e600039600081816103600152818161148701526135700152600081816103310152818161139d01528181611405015281816119cc01528181611a34015261354901526000818161029d01528181610bcf01528181611dc401526134c301526000818161026d01528181611aff015261349901526000818161023e01528181610f320152818161177f015281816118780152818161237d015281816130380152818161347401526137000152600081816102fd0152818161194401526135130152600081816102cd015281816126c401526134ea01526000611cde0152615e376000f3fe608060405234801561001057600080fd5b50600436106101f05760003560e01c806376f6ae761161010f578063c92b2832116100a2578063e76c0b0611610071578063e76c0b0614610943578063efeadb6d14610956578063eff7cc4814610969578063f2fde38b1461097157600080fd5b8063c92b2832146108ed578063d09dc33914610900578063d3c7c2c714610908578063e0351e131461091057600080fd5b80639a113c36116100de5780639a113c3614610742578063a7cd63b7146108af578063a7d3e02f146108c4578063b06d41bc146108d757600080fd5b806376f6ae761461070357806379ba509714610716578063856c82471461071e5780638da5cb5b1461073157600080fd5b8063549e946f116101875780635d86f141116101565780635d86f141146105ae578063704b6c02146105c15780637132721a146105d45780637437ff9f146105e757600080fd5b8063549e946f1461054357806354b714681461055657806354c8a4f314610576578063599f64311461058957600080fd5b806338724a95116101c357806338724a951461048a5780633a87ac53146104ab5780634120fccd146104be578063546719cd146104df57600080fd5b806306285c69146101f55780631772047e146103a6578063181f5a771461042c578063352e4bc814610475575b600080fd5b6103906040805160e081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c08101919091526040518060e001604052807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031681526020017f000000000000000000000000000000000000000000000000000000000000000067ffffffffffffffff1681526020017f000000000000000000000000000000000000000000000000000000000000000067ffffffffffffffff1681526020017f000000000000000000000000000000000000000000000000000000000000000067ffffffffffffffff1681526020017f00000000000000000000000000000000000000000000000000000000000000006bffffffffffffffffffffffff1681526020017f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031681526020017f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316815250905090565b60405161039d919061499d565b60405180910390f35b6104076103b4366004614a2e565b6040805180820190915260008082526020820152506001600160a01b031660009081526010602090815260409182902082518084019093525461ffff8116835262010000900463ffffffff169082015290565b60408051825161ffff16815260209283015163ffffffff16928101929092520161039d565b6104686040518060400160405280601381526020017f45564d3245564d4f6e52616d7020312e312e300000000000000000000000000081525081565b60405161039d9190614ab9565b610488610483366004614c1a565b610984565b005b61049d610498366004614d50565b6109ed565b60405190815260200161039d565b6104886104b9366004614e21565b610dd9565b6104c6610def565b60405167ffffffffffffffff909116815260200161039d565b6104e7610e23565b60405161039d919081516fffffffffffffffffffffffffffffffff908116825260208084015163ffffffff1690830152604080840151151590830152606080840151821690830152608092830151169181019190915260a00190565b610488610551366004614e85565b610ed3565b6012546040516bffffffffffffffffffffffff909116815260200161039d565b610488610584366004614f22565b611088565b6002546001600160a01b03165b6040516001600160a01b03909116815260200161039d565b6105966105bc366004614a2e565b61109a565b6104886105cf366004614a2e565b6110f9565b6104886105e2366004614f8e565b6111c3565b6106f66040805160e081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810191909152506040805160e0810182526005546001600160a01b03808216835261ffff740100000000000000000000000000000000000000008084048216602086015263ffffffff76010000000000000000000000000000000000000000000085048116968601969096527a010000000000000000000000000000000000000000000000000000909304166060840152600654908116608084015290810490921660a082015267ffffffffffffffff78010000000000000000000000000000000000000000000000009092049190911660c082015290565b60405161039d9190615026565b6104886107113660046150a1565b6111d4565b61048861128c565b6104c661072c366004614a2e565b61136f565b6000546001600160a01b0316610596565b610845610750366004614a2e565b6040805160c081018252600080825260208201819052918101829052606081018290526080810182905260a0810191909152506001600160a01b03166000908152600f6020908152604091829020825160c081018452905463ffffffff808216835264010000000082048116938301939093526801000000000000000081049092169281019290925267ffffffffffffffff6c0100000000000000000000000082048116606084015274010000000000000000000000000000000000000000820416608083015260ff7c010000000000000000000000000000000000000000000000000000000090910416151560a082015290565b60405161039d9190600060c08201905063ffffffff80845116835280602085015116602084015280604085015116604084015250606083015167ffffffffffffffff8082166060850152806080860151166080850152505060a0830151151560a083015292915050565b6108b7611477565b60405161039d9190615116565b61049d6108d2366004615163565b611483565b6108df611eab565b60405161039d929190615211565b6104886108fb366004615253565b611faf565b61049d612017565b6108b7612021565b601254790100000000000000000000000000000000000000000000000000900460ff16604051901515815260200161039d565b6104886109513660046152a3565b6120d2565b61048861096436600461536c565b612138565b6104886121be565b61048861097f366004614a2e565b612455565b6000546001600160a01b031633148015906109aa57506002546001600160a01b03163314155b156109e1576040517ffbdb8e5600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6109ea81612466565b50565b600080610a05610a006080850185615389565b612695565b9050610a30610a176020850185615389565b8351909150610a2960408701876153ee565b9050612789565b6000600f81610a456080870160608801614a2e565b6001600160a01b031681526020808201929092526040908101600020815160c081018352905463ffffffff80821683526401000000008204811694830194909452680100000000000000008104909316918101919091526c01000000000000000000000000820467ffffffffffffffff90811660608301527401000000000000000000000000000000000000000083041660808201527c010000000000000000000000000000000000000000000000000000000090910460ff16151560a08201819052909150610b6257610b1f6080850160608601614a2e565b6040517fa7499d200000000000000000000000000000000000000000000000000000000081526001600160a01b0390911660048201526024015b60405180910390fd5b60065460009081906001600160a01b031663ffdb4b37610b886080890160608a01614a2e565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b1681526001600160a01b03909116600482015267ffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001660248201526044016040805180830381865afa158015610c13573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c37919061547e565b909250905060008080610c4d60408a018a6153ee565b90501115610c8657610c7c610c6860808a0160608b01614a2e565b85610c7660408c018c6153ee565b896128ae565b9092509050610ca2565b8451610c9f9063ffffffff16662386f26fc100006154e0565b91505b6080850151610cbb9067ffffffffffffffff16836154e0565b606086015160055491935060009167ffffffffffffffff9091169063ffffffff8416907a010000000000000000000000000000000000000000000000000000900461ffff16610d0d60208d018d615389565b610d189291506154e0565b6005548a51610d4791760100000000000000000000000000000000000000000000900463ffffffff16906154f7565b610d5191906154f7565b610d5b91906154f7565b610d6591906154e0565b610d899077ffffffffffffffffffffffffffffffffffffffffffffffff86166154e0565b9050610dcc670de0b6b3a7640000610da183866154f7565b610dab919061550a565b77ffffffffffffffffffffffffffffffffffffffffffffffff871690612b34565b9998505050505050505050565b610de1612b6d565b610deb8282612be3565b5050565b601254600090610e1e90700100000000000000000000000000000000900467ffffffffffffffff166001615545565b905090565b6040805160a0810182526000808252602082018190529181018290526060810182905260808101919091526040805160a0810182526003546fffffffffffffffffffffffffffffffff808216835270010000000000000000000000000000000080830463ffffffff1660208501527401000000000000000000000000000000000000000090920460ff161515938301939093526004548084166060840152049091166080820152610e1e90612f43565b6000546001600160a01b03163314801590610ef957506002546001600160a01b03163314155b15610f30576040517ffbdb8e5600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b03161480610f7757506001600160a01b038116155b15610fae576040517f232cb97f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000610fb8612ff5565b1215610ff0576040517f02075e0000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152610deb9082906001600160a01b038516906370a0823190602401602060405180830381865afa158015611053573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110779190615566565b6001600160a01b03851691906130b5565b611090612b6d565b610deb8282613135565b60006110a7600a83613270565b6110e8576040517fbf16aab60000000000000000000000000000000000000000000000000000000081526001600160a01b0383166004820152602401610b59565b6110f3600a83613285565b92915050565b6000546001600160a01b0316331480159061111f57506002546001600160a01b03163314155b15611156576040517ff6cd562000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600280547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0383169081179091556040519081527f8fe72c3e0020beb3234e76ae6676fa576fbfcae600af1c4fea44784cf0db329c906020015b60405180910390a150565b6111cb612b6d565b6109ea8161329a565b6000546001600160a01b031633148015906111fa57506002546001600160a01b03163314155b15611231576040517ffbdb8e5600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610deb8282808060200260200160405190810160405280939291908181526020016000905b82821015611282576112736040830286013681900381019061557f565b81526020019060010190611256565b50505050506135c7565b6001546001600160a01b03163314611300576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e6572000000000000000000006044820152606401610b59565b60008054337fffffffffffffffffffffffff0000000000000000000000000000000000000000808316821784556001805490911690556040516001600160a01b0390921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b6001600160a01b03811660009081526011602052604081205467ffffffffffffffff16801580156113c857507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031615155b156110f3576040517f856c82470000000000000000000000000000000000000000000000000000000081526001600160a01b0384811660048301527f0000000000000000000000000000000000000000000000000000000000000000169063856c824790602401602060405180830381865afa15801561144c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061147091906155be565b9392505050565b6060610e1e600d61383a565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663397796f76040518163ffffffff1660e01b8152600401602060405180830381865afa1580156114e3573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061150791906155db565b1561153e576040517fc148371500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b03821661157e576040517fa4ec747900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b601254790100000000000000000000000000000000000000000000000000900460ff1680156115b557506115b3600d83613847565b155b156115f7576040517fd0d259760000000000000000000000000000000000000000000000000000000081526001600160a01b0383166004820152602401610b59565b6005546001600160a01b0316331461163b576040517f1c0a352900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6116458480615389565b905060201461168c576116588480615389565b6040517f370d875f000000000000000000000000000000000000000000000000000000008152600401610b59929190615641565b60006116988580615389565b8101906116a59190615655565b90506001600160a01b038111806116bc5750600a81105b156116cb576116588580615389565b60006116dd610a006080880188615389565b90506117016116ef6020880188615389565b8351909150610a2960408a018a6153ee565b61177561171160408801886153ee565b808060200260200160405190810160405280939291908181526020016000905b8282101561175d5761174e6040830286013681900381019061566e565b81526020019060010190611731565b50506006546001600160a01b03169250613869915050565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000166117af6080880160608901614a2e565b6001600160a01b03160361181357601280548691906000906117e09084906bffffffffffffffffffffffff166156a8565b92506101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff160217905550611932565b6006546001600160a01b03166241e5be6118336080890160608a01614a2e565b60405160e083901b7fffffffff000000000000000000000000000000000000000000000000000000001681526001600160a01b039182166004820152602481018990527f00000000000000000000000000000000000000000000000000000000000000009091166044820152606401602060405180830381865afa1580156118bf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118e39190615566565b601280546000906119039084906bffffffffffffffffffffffff166156a8565b92506101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055505b6012546bffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000081169116111561199f576040517fe5c7a49100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b03841660009081526011602052604090205467ffffffffffffffff161580156119f757507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031615155b15611aef576040517f856c82470000000000000000000000000000000000000000000000000000000081526001600160a01b0385811660048301527f0000000000000000000000000000000000000000000000000000000000000000169063856c824790602401602060405180830381865afa158015611a7b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a9f91906155be565b6001600160a01b038516600090815260116020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000001667ffffffffffffffff929092169190911790555b60006040518061018001604052807f000000000000000000000000000000000000000000000000000000000000000067ffffffffffffffff1681526020016012601081819054906101000a900467ffffffffffffffff16611b4f906156cd565b825467ffffffffffffffff9182166101009390930a8381029083021990911617909255825260208083018a90526001600160a01b03891660408085018290526000918252601190925290812080546060909401939092611baf91166156cd565b91906101000a81548167ffffffffffffffff021916908367ffffffffffffffff160217905567ffffffffffffffff16815260200183600001518152602001600015158152602001846001600160a01b03168152602001888060200190611c159190615389565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250505090825250602001611c5c60408a018a6153ee565b808060200260200160405190810160405280939291908181526020016000905b82821015611ca857611c996040830286013681900381019061566e565b81526020019060010190611c7c565b5050509183525050602001611cc360808a0160608b01614a2e565b6001600160a01b0316815260006020909101529050611d02817f0000000000000000000000000000000000000000000000000000000000000000613a1c565b61016082015260005b611d1860408901896153ee565b9050811015611e64576000611d3060408a018a6153ee565b83818110611d4057611d406156f4565b905060400201803603810190611d56919061566e565b9050611d65816000015161109a565b6001600160a01b0316639687544588611d7e8c80615389565b60208087015160408051928301815260008352517fffffffff0000000000000000000000000000000000000000000000000000000060e088901b168152611dec959493927f000000000000000000000000000000000000000000000000000000000000000091600401615723565b6000604051808303816000875af1158015611e0b573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201604052611e51919081019061576e565b505080611e5d90615820565b9050611d0b565b507faffc45517195d6499808c643bd4a7b0ffeedf95bea5852840d7bfcf63f59e82181604051611e94919061589c565b60405180910390a161016001519695505050505050565b6060600080611eba6007613b26565b90508067ffffffffffffffff811115611ed557611ed5614acc565b604051908082528060200260200182016040528015611f1a57816020015b6040805180820190915260008082526020820152815260200190600190039081611ef35790505b50925060005b81811015611f8c57600080611f36600784613b31565b915091506040518060400160405280836001600160a01b031681526020018261ffff16815250868481518110611f6e57611f6e6156f4565b6020026020010181905250505080611f8590615820565b9050611f20565b505060125491926c0100000000000000000000000090920463ffffffff16919050565b6000546001600160a01b03163314801590611fd557506002546001600160a01b03163314155b1561200c576040517ff6cd562000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6109ea600382613b4f565b6000610e1e612ff5565b6060600061202f600a613d27565b67ffffffffffffffff81111561204757612047614acc565b604051908082528060200260200182016040528015612070578160200160208202803683370190505b50905060005b81518110156120cc5761208a600a82613d32565b5082828151811061209d5761209d6156f4565b60200260200101816001600160a01b03166001600160a01b031681525050806120c590615820565b9050612076565b50919050565b6000546001600160a01b031633148015906120f857506002546001600160a01b03163314155b1561212f576040517ffbdb8e5600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6109ea81613d41565b612140612b6d565b60128054821515790100000000000000000000000000000000000000000000000000027fffffffffffff00ffffffffffffffffffffffffffffffffffffffffffffffffff9091161790556040517fccf4daf6ab6430389f26b970595dab82a5881ad454770907e415ede27c8df032906111b890831515815260200190565b6000546001600160a01b031633148015906121e457506002546001600160a01b03163314155b80156121f857506121f6600733613e28565b155b1561222f576040517f195db95800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6012546c01000000000000000000000000900463ffffffff166000819003612283576040517f990e30bf00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6012546bffffffffffffffffffffffff16818110156122ce576040517f8d0f71d800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006122d8612ff5565b1215612310576040517ff4d678b800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80600061231d6007613b26565b905060005b8181101561241257600080612338600784613b31565b9092509050600087612358836bffffffffffffffffffffffff8a166154e0565b612362919061550a565b905061236e81876159d9565b95506123b26001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016846bffffffffffffffffffffffff84166130b5565b6040516bffffffffffffffffffffffff821681526001600160a01b038416907f55fdec2aab60a41fa5abb106670eb1006f5aeaee1ba7afea2bc89b5b3ec7678f9060200160405180910390a25050508061240b90615820565b9050612322565b5050601280547fffffffffffffffffffffffffffffffffffffffff000000000000000000000000166bffffffffffffffffffffffff929092169190911790555050565b61245d612b6d565b6109ea81613e3d565b60005b8151811015612665576000828281518110612486576124866156f4565b6020908102919091018101516040805160c080820183528385015163ffffffff9081168352838501518116838701908152606080870151831685870190815260808089015167ffffffffffffffff90811693880193845260a0808b01518216928901928352968a0151151596880196875298516001600160a01b03166000908152600f909a5296909820945185549251985191519651945115157c0100000000000000000000000000000000000000000000000000000000027fffffff00ffffffffffffffffffffffffffffffffffffffffffffffffffffffff9589167401000000000000000000000000000000000000000002959095167fffffff000000000000000000ffffffffffffffffffffffffffffffffffffffff979098166c01000000000000000000000000027fffffffffffffffffffffffff0000000000000000ffffffffffffffffffffffff9285166801000000000000000002929092167fffffffffffffffffffffffff000000000000000000000000ffffffffffffffff998516640100000000027fffffffffffffffffffffffffffffffffffffffffffffffff000000000000000090941691909416179190911796909616179490941791909116919091179190911790555061265e81615820565b9050612469565b507f2386f61ab5cafc3fed44f9f614f721ab53479ef64067fd16c1a2491b63ddf1a8816040516111b891906159fe565b60408051602081019091526000815260008290036126eb5750604080516020810190915267ffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001681526110f3565b7f97a657c9000000000000000000000000000000000000000000000000000000006127168385615ab5565b7fffffffff00000000000000000000000000000000000000000000000000000000161461276f576040517f5247fdce00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61277c8260048186615afd565b8101906114709190615b27565b60065474010000000000000000000000000000000000000000900463ffffffff16808411156127ee576040517f869337890000000000000000000000000000000000000000000000000000000081526004810182905260248101859052604401610b59565b6006547801000000000000000000000000000000000000000000000000900467ffffffffffffffff16831115612850576040517f4c4fc93a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60055474010000000000000000000000000000000000000000900461ffff168211156128a8576040517f4c056b6a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50505050565b60008083815b81811015612ac05760008787838181106128d0576128d06156f4565b9050604002018036038101906128e6919061566e565b80516001600160a01b031660009081526010602090815260409182902082518084019093525461ffff8116835263ffffffff620100009091048116918301919091528251929350909161293d91600a919061327016565b6129815781516040517fbf16aab60000000000000000000000000000000000000000000000000000000081526001600160a01b039091166004820152602401610b59565b805160009061ffff1615612a8e5760008c6001600160a01b031684600001516001600160a01b031614612a3d5760065484516040517f4ab35b0b0000000000000000000000000000000000000000000000000000000081526001600160a01b039182166004820152911690634ab35b0b90602401602060405180830381865afa158015612a12573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a369190615b69565b9050612a40565b508a5b82516020850151620186a09161ffff1690612a769077ffffffffffffffffffffffffffffffffffffffffffffffff851690613f18565b612a8091906154e0565b612a8a919061550a565b9150505b612a9881886154f7565b9650816020015186612aaa9190615b84565b955050505080612ab990615820565b90506128b4565b506000846020015163ffffffff16662386f26fc10000612ae091906154e0565b905080841015612af3579250612b2a9050565b6000856040015163ffffffff16662386f26fc10000612b1291906154e0565b905080851115612b26579350612b2a915050565b5050505b9550959350505050565b600077ffffffffffffffffffffffffffffffffffffffffffffffff8316612b6383670de0b6b3a76400006154e0565b611470919061550a565b6000546001600160a01b03163314612be1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e6572000000000000000000006044820152606401610b59565b565b60005b8251811015612d44576000838281518110612c0357612c036156f4565b60200260200101516000015190506000848381518110612c2557612c256156f4565b6020026020010151602001519050612c4782600a61327090919063ffffffff16565b612c88576040517f73913ebd0000000000000000000000000000000000000000000000000000000081526001600160a01b0383166004820152602401610b59565b6001600160a01b038116612c9d600a84613285565b6001600160a01b031614612cdd576040517f6cc7b99800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b612ce8600a83613f47565b15612d3157604080516001600160a01b038085168252831660208201527f987eb3c2f78454541205f72f34839b434c306c9eaf4922efd7c0c3060fdb2e4c910160405180910390a15b505080612d3d90615820565b9050612be6565b5060005b8151811015612f3e576000828281518110612d6557612d656156f4565b60200260200101516000015190506000838381518110612d8757612d876156f4565b602002602001015160200151905060006001600160a01b0316826001600160a01b03161480612dbd57506001600160a01b038116155b15612df4576040517f6c2a418000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b806001600160a01b03166321df0da76040518163ffffffff1660e01b8152600401602060405180830381865afa158015612e32573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e569190615ba1565b6001600160a01b0316826001600160a01b031614612ea0576040517f6cc7b99800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b612eac600a8383613f5c565b15612ef957604080516001600160a01b038085168252831660208201527f95f865c2808f8b2a85eea2611db7843150ee7835ef1403f9755918a97d76933c910160405180910390a1612f2b565b6040517f3caf458500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b505080612f3790615820565b9050612d48565b505050565b6040805160a081018252600080825260208201819052918101829052606081018290526080810191909152612fd182606001516fffffffffffffffffffffffffffffffff1683600001516fffffffffffffffffffffffffffffffff16846020015163ffffffff1642612fb59190615bbe565b85608001516fffffffffffffffffffffffffffffffff16613f7a565b6fffffffffffffffffffffffffffffffff1682525063ffffffff4216602082015290565b6012546040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526000916bffffffffffffffffffffffff16907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa158015613087573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130ab9190615566565b610e1e9190615bd1565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb00000000000000000000000000000000000000000000000000000000179052612f3e908490613fa2565b60005b82518110156131c6576000838281518110613155576131556156f4565b6020026020010151905061317381600d6140a190919063ffffffff16565b156131b5576040516001600160a01b03821681527f800671136ab6cfee9fbe5ed1fb7ca417811aca3cf864800d127b927adedf75669060200160405180910390a15b506131bf81615820565b9050613138565b5060005b8151811015612f3e5760008282815181106131e7576131e76156f4565b6020026020010151905060006001600160a01b0316816001600160a01b0316036132115750613260565b61321c600d826140b6565b1561325e576040516001600160a01b03821681527f2640d4d76caf8bf478aabfa982fa4e1c4eb71a37f93cd15e80dbc657911546d89060200160405180910390a15b505b61326981615820565b90506131ca565b6000611470836001600160a01b0384166140cb565b6000611470836001600160a01b0384166140d7565b60808101516001600160a01b03166132de576040517f35be3ac800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8051600580546020808501516040808701516060808901516001600160a01b039889167fffffffffffffffffffff00000000000000000000000000000000000000000000909716969096177401000000000000000000000000000000000000000061ffff9586168102919091177fffffffff000000000000ffffffffffffffffffffffffffffffffffffffffffff1676010000000000000000000000000000000000000000000063ffffffff948516027fffffffff0000ffffffffffffffffffffffffffffffffffffffffffffffffffff16177a0100000000000000000000000000000000000000000000000000009590971694909402959095179095556080808801516006805460a0808c015160c0808e0151958d167fffffffffffffffff000000000000000000000000000000000000000000000000909416939093179a169096029890981777ffffffffffffffffffffffffffffffffffffffffffffffff16780100000000000000000000000000000000000000000000000067ffffffffffffffff93841602179055825160e0810184527f0000000000000000000000000000000000000000000000000000000000000000891681527f00000000000000000000000000000000000000000000000000000000000000008216958101959095527f00000000000000000000000000000000000000000000000000000000000000008116858401527f000000000000000000000000000000000000000000000000000000000000000016948401949094527f00000000000000000000000000000000000000000000000000000000000000006bffffffffffffffffffffffff16938301939093527f00000000000000000000000000000000000000000000000000000000000000008516908201527f000000000000000000000000000000000000000000000000000000000000000090931691830191909152517f72c6aaba4dde02f77d291123a76185c418ba63f8c217a2d56b08aec84e9bbfb8916111b8918490615bf1565b80516040811115613604576040517fb5a10cfa00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6012546c01000000000000000000000000900463ffffffff1615801590613652575060125463ffffffff6c010000000000000000000000008204166bffffffffffffffffffffffff90911610155b1561365f5761365f6121be565b600061366b6007613b26565b90505b80156136ad57600061368c613684600184615bbe565b600790613b31565b50905061369a6007826140e3565b5050806136a690615ce6565b905061366e565b506000805b828110156137bb5760008482815181106136ce576136ce6156f4565b602002602001015160000151905060008583815181106136f0576136f06156f4565b60200260200101516020015190507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b0316148061374557506001600160a01b038216155b15613787576040517f4de938d10000000000000000000000000000000000000000000000000000000081526001600160a01b0383166004820152602401610b59565b61379760078361ffff84166140f8565b506137a661ffff821685615b84565b93505050806137b490615820565b90506136b2565b50601280547fffffffffffffffffffffffffffffffff00000000ffffffffffffffffffffffff166c0100000000000000000000000063ffffffff8416021790556040517f8c337bff38141c507abd25c547606bdde78fe8c12e941ab613f3a565fea6cd249061382d9083908690615d1b565b60405180910390a1505050565b606060006114708361410e565b6001600160a01b03811660009081526001830160205260408120541515611470565b81516000805b82811015613a0e576000846001600160a01b031663d02641a087848151811061389a5761389a6156f4565b6020908102919091010151516040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b1681526001600160a01b0390911660048201526024016040805180830381865afa158015613901573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906139259190615d3a565b51905077ffffffffffffffffffffffffffffffffffffffffffffffff81166000036139a65785828151811061395c5761395c6156f4565b6020908102919091010151516040517f9a655f7b0000000000000000000000000000000000000000000000000000000081526001600160a01b039091166004820152602401610b59565b6139f08683815181106139bb576139bb6156f4565b6020026020010151602001518277ffffffffffffffffffffffffffffffffffffffffffffffff16613f1890919063ffffffff16565b6139fa90846154f7565b92505080613a0790615820565b905061386f565b506128a8600382600061416a565b60008060001b828460200151856080015186606001518760e0015188610100015180519060200120896101200151604051602001613a5a9190615d6d565b604051602081830303815290604052805190602001208a60a001518b60c001518c61014001518d60400151604051602001613b089c9b9a999897969594939291909b8c5260208c019a909a5267ffffffffffffffff98891660408c01529690971660608a01526001600160a01b0394851660808a015292841660a089015260c088019190915260e0870152610100860152911515610120850152166101408301526101608201526101800190565b60405160208183030381529060405280519060200120905092915050565b60006110f3826144b9565b6000808080613b4086866144c4565b909450925050505b9250929050565b8154600090613b7890700100000000000000000000000000000000900463ffffffff1642615bbe565b90508015613c1a5760018301548354613bc0916fffffffffffffffffffffffffffffffff80821692811691859170010000000000000000000000000000000090910416613f7a565b83546fffffffffffffffffffffffffffffffff919091167fffffffffffffffffffffffff0000000000000000000000000000000000000000909116177001000000000000000000000000000000004263ffffffff16021783555b60208201518354613c40916fffffffffffffffffffffffffffffffff90811691166144ef565b83548351151574010000000000000000000000000000000000000000027fffffffffffffffffffffff00ffffffff000000000000000000000000000000009091166fffffffffffffffffffffffffffffffff92831617178455602083015160408085015183167001000000000000000000000000000000000291909216176001850155517f9ea3374b67bf275e6bb9c8ae68f9cae023e1c528b4b27e092f0bb209d3531c199061382d9084908151151581526020808301516fffffffffffffffffffffffffffffffff90811691830191909152604092830151169181019190915260600190565b60006110f382613b26565b6000808080613b408686613b31565b60005b8151811015613df8576000828281518110613d6157613d616156f4565b6020908102919091018101516040805180820182528284015161ffff90811682528284015163ffffffff90811683870190815294516001600160a01b0316600090815260109096529290942090518154935190921662010000027fffffffffffffffffffffffffffffffffffffffffffffffffffff000000000000909316919093161717905550613df181615820565b9050613d44565b507f4230c60a9725eb5fb992cf6a215398b4e81b4606d4a1e6be8dfe0b60dc172ec1816040516111b89190615d80565b6000611470836001600160a01b038416614505565b336001600160a01b03821603613eaf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c660000000000000000006044820152606401610b59565b600180547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b6000670de0b6b3a7640000612b638377ffffffffffffffffffffffffffffffffffffffffffffffff86166154e0565b6000611470836001600160a01b038416614511565b6000613f72846001600160a01b0385168461451d565b949350505050565b6000613f9985613f8a84866154e0565b613f9490876154f7565b6144ef565b95945050505050565b6000613ff7826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166145339092919063ffffffff16565b805190915015612f3e578080602001905181019061401591906155db565b612f3e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610b59565b6000611470836001600160a01b038416614542565b6000611470836001600160a01b03841661463c565b60006114708383614505565b6000611470838361468b565b6000611470836001600160a01b038416614715565b6000613f72846001600160a01b03851684614732565b60608160000180548060200260200160405190810160405280929190818152602001828054801561415e57602002820191906000526020600020905b81548152602001906001019080831161414a575b50505050509050919050565b825474010000000000000000000000000000000000000000900460ff161580614191575081155b1561419b57505050565b825460018401546fffffffffffffffffffffffffffffffff808316929116906000906141e190700100000000000000000000000000000000900463ffffffff1642615bbe565b905080156142a15781831115614223576040517f9725942a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600186015461425d9083908590849070010000000000000000000000000000000090046fffffffffffffffffffffffffffffffff16613f7a565b86547fffffffffffffffffffffffff00000000ffffffffffffffffffffffffffffffff167001000000000000000000000000000000004263ffffffff160217875592505b8482101561433e576001600160a01b0384166142f3576040517ff94ebcd10000000000000000000000000000000000000000000000000000000081526004810183905260248101869052604401610b59565b6040517f1a76572a00000000000000000000000000000000000000000000000000000000815260048101839052602481018690526001600160a01b0385166044820152606401610b59565b848310156144375760018681015470010000000000000000000000000000000090046fffffffffffffffffffffffffffffffff169060009082906143829082615bbe565b61438c878a615bbe565b61439691906154f7565b6143a0919061550a565b90506001600160a01b0386166143ec576040517f15279c080000000000000000000000000000000000000000000000000000000081526004810182905260248101869052604401610b59565b6040517fd0c8d23a00000000000000000000000000000000000000000000000000000000815260048101829052602481018690526001600160a01b0387166044820152606401610b59565b6144418584615bbe565b86547fffffffffffffffffffffffffffffffff00000000000000000000000000000000166fffffffffffffffffffffffffffffffff82161787556040518681529093507f1871cdf8010e63f2eb8384381a68dfa7416dc571a5517e66e88b2d2d0c0a690a9060200160405180910390a1505050505050565b60006110f38261474f565b600080806144d28585614759565b600081815260029690960160205260409095205494959350505050565b60008183106144fe5781611470565b5090919050565b60006114708383614765565b60006114708383614715565b6000613f7284846001600160a01b038516614732565b6060613f72848460008561477d565b6000818152600183016020526040812054801561462b576000614566600183615bbe565b855490915060009061457a90600190615bbe565b90508181146145df57600086600001828154811061459a5761459a6156f4565b90600052602060002001549050808760000184815481106145bd576145bd6156f4565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806145f0576145f0615ddf565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506110f3565b60009150506110f3565b5092915050565b6000818152600183016020526040812054614683575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556110f3565b5060006110f3565b6000818152600283016020526040812054801515806146af57506146af8484614505565b611470576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f456e756d657261626c654d61703a206e6f6e6578697374656e74206b657900006044820152606401610b59565b600081815260028301602052604081208190556114708383614889565b60008281526002840160205260408120829055613f728484614895565b60006110f3825490565b600061147083836148a1565b60008181526001830160205260408120541515611470565b60608247101561480f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610b59565b600080866001600160a01b0316858760405161482b9190615e0e565b60006040518083038185875af1925050503d8060008114614868576040519150601f19603f3d011682016040523d82523d6000602084013e61486d565b606091505b509150915061487e878383876148cb565b979650505050505050565b60006114708383614542565b6000611470838361463c565b60008260000182815481106148b8576148b86156f4565b9060005260206000200154905092915050565b6060831561495457825160000361494d576001600160a01b0385163b61494d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610b59565b5081613f72565b613f7283838151156149695781518083602001fd5b806040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b599190614ab9565b60e081016110f382846001600160a01b03808251168352602082015167ffffffffffffffff808216602086015280604085015116604086015280606085015116606086015250506bffffffffffffffffffffffff60808301511660808401528060a08301511660a08401528060c08301511660c0840152505050565b6001600160a01b03811681146109ea57600080fd5b600060208284031215614a4057600080fd5b813561147081614a19565b60005b83811015614a66578181015183820152602001614a4e565b50506000910152565b60008151808452614a87816020860160208601614a4b565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b6020815260006114706020830184614a6f565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60405160e0810167ffffffffffffffff81118282101715614b1e57614b1e614acc565b60405290565b6040805190810167ffffffffffffffff81118282101715614b1e57614b1e614acc565b6040516060810167ffffffffffffffff81118282101715614b1e57614b1e614acc565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715614bb157614bb1614acc565b604052919050565b600067ffffffffffffffff821115614bd357614bd3614acc565b5060051b60200190565b803563ffffffff81168114614bf157600080fd5b919050565b67ffffffffffffffff811681146109ea57600080fd5b80151581146109ea57600080fd5b60006020808385031215614c2d57600080fd5b823567ffffffffffffffff811115614c4457600080fd5b8301601f81018513614c5557600080fd5b8035614c68614c6382614bb9565b614b6a565b81815260e09182028301840191848201919088841115614c8757600080fd5b938501935b83851015614d325780858a031215614ca45760008081fd5b614cac614afb565b8535614cb781614a19565b8152614cc4868801614bdd565b878201526040614cd5818801614bdd565b908201526060614ce6878201614bdd565b90820152608086810135614cf981614bf6565b9082015260a086810135614d0c81614bf6565b9082015260c086810135614d1f81614c0c565b9082015283529384019391850191614c8c565b50979650505050505050565b600060a082840312156120cc57600080fd5b600060208284031215614d6257600080fd5b813567ffffffffffffffff811115614d7957600080fd5b613f7284828501614d3e565b600082601f830112614d9657600080fd5b81356020614da6614c6383614bb9565b82815260069290921b84018101918181019086841115614dc557600080fd5b8286015b84811015614e165760408189031215614de25760008081fd5b614dea614b24565b8135614df581614a19565b815281850135614e0481614a19565b81860152835291830191604001614dc9565b509695505050505050565b60008060408385031215614e3457600080fd5b823567ffffffffffffffff80821115614e4c57600080fd5b614e5886838701614d85565b93506020850135915080821115614e6e57600080fd5b50614e7b85828601614d85565b9150509250929050565b60008060408385031215614e9857600080fd5b8235614ea381614a19565b91506020830135614eb381614a19565b809150509250929050565b600082601f830112614ecf57600080fd5b81356020614edf614c6383614bb9565b82815260059290921b84018101918181019086841115614efe57600080fd5b8286015b84811015614e16578035614f1581614a19565b8352918301918301614f02565b60008060408385031215614f3557600080fd5b823567ffffffffffffffff80821115614f4d57600080fd5b614f5986838701614ebe565b93506020850135915080821115614f6f57600080fd5b50614e7b85828601614ebe565b803561ffff81168114614bf157600080fd5b600060e08284031215614fa057600080fd5b614fa8614afb565b8235614fb381614a19565b8152614fc160208401614f7c565b6020820152614fd260408401614bdd565b6040820152614fe360608401614f7c565b60608201526080830135614ff681614a19565b608082015261500760a08401614bdd565b60a082015260c083013561501a81614bf6565b60c08201529392505050565b60e081016110f382846001600160a01b03808251168352602082015161ffff80821660208601526040840151915063ffffffff80831660408701528160608601511660608701528360808601511660808701528060a08601511660a08701525050505067ffffffffffffffff60c08201511660c08301525050565b600080602083850312156150b457600080fd5b823567ffffffffffffffff808211156150cc57600080fd5b818501915085601f8301126150e057600080fd5b8135818111156150ef57600080fd5b8660208260061b850101111561510457600080fd5b60209290920196919550909350505050565b6020808252825182820181905260009190848201906040850190845b818110156151575783516001600160a01b031683529284019291840191600101615132565b50909695505050505050565b60008060006060848603121561517857600080fd5b833567ffffffffffffffff81111561518f57600080fd5b61519b86828701614d3e565b9350506020840135915060408401356151b381614a19565b809150509250925092565b600081518084526020808501945080840160005b8381101561520657815180516001600160a01b0316885283015161ffff1683880152604090960195908201906001016151d2565b509495945050505050565b60408152600061522460408301856151be565b90508260208301529392505050565b80356fffffffffffffffffffffffffffffffff81168114614bf157600080fd5b60006060828403121561526557600080fd5b61526d614b47565b823561527881614c0c565b815261528660208401615233565b602082015261529760408401615233565b60408201529392505050565b600060208083850312156152b657600080fd5b823567ffffffffffffffff8111156152cd57600080fd5b8301601f810185136152de57600080fd5b80356152ec614c6382614bb9565b8181526060918202830184019184820191908884111561530b57600080fd5b938501935b83851015614d325780858a0312156153285760008081fd5b615330614b47565b853561533b81614a19565b8152615348868801614f7c565b878201526040615359818801614bdd565b9082015283529384019391850191615310565b60006020828403121561537e57600080fd5b813561147081614c0c565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe18436030181126153be57600080fd5b83018035915067ffffffffffffffff8211156153d957600080fd5b602001915036819003821315613b4857600080fd5b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe184360301811261542357600080fd5b83018035915067ffffffffffffffff82111561543e57600080fd5b6020019150600681901b3603821315613b4857600080fd5b805177ffffffffffffffffffffffffffffffffffffffffffffffff81168114614bf157600080fd5b6000806040838503121561549157600080fd5b61549a83615456565b91506154a860208401615456565b90509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b80820281158282048414176110f3576110f36154b1565b808201808211156110f3576110f36154b1565b600082615540577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b67ffffffffffffffff818116838216019080821115614635576146356154b1565b60006020828403121561557857600080fd5b5051919050565b60006040828403121561559157600080fd5b615599614b24565b82356155a481614a19565b81526155b260208401614f7c565b60208201529392505050565b6000602082840312156155d057600080fd5b815161147081614bf6565b6000602082840312156155ed57600080fd5b815161147081614c0c565b8183528181602085013750600060208284010152600060207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b602081526000613f726020830184866155f8565b60006020828403121561566757600080fd5b5035919050565b60006040828403121561568057600080fd5b615688614b24565b823561569381614a19565b81526020928301359281019290925250919050565b6bffffffffffffffffffffffff818116838216019080821115614635576146356154b1565b600067ffffffffffffffff8083168181036156ea576156ea6154b1565b6001019392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6001600160a01b038716815260a06020820152600061574660a0830187896155f8565b85604084015267ffffffffffffffff851660608401528281036080840152610dcc8185614a6f565b60006020828403121561578057600080fd5b815167ffffffffffffffff8082111561579857600080fd5b818401915084601f8301126157ac57600080fd5b8151818111156157be576157be614acc565b6157ef60207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f84011601614b6a565b915080825285602082850101111561580657600080fd5b615817816020840160208601614a4b565b50949350505050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203615851576158516154b1565b5060010190565b600081518084526020808501945080840160005b8381101561520657815180516001600160a01b03168852830151838801526040909601959082019060010161586c565b602081526158b760208201835167ffffffffffffffff169052565b600060208301516158d4604084018267ffffffffffffffff169052565b506040830151606083015260608301516158f960808401826001600160a01b03169052565b50608083015167ffffffffffffffff811660a08401525060a083015160c083015260c083015161592d60e084018215159052565b5060e083015161010061594a818501836001600160a01b03169052565b80850151915050610180610120818186015261596a6101a0860184614a6f565b92508086015190506101407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe086850301818701526159a88483615858565b9350808701519150506101606159c8818701836001600160a01b03169052565b959095015193019290925250919050565b6bffffffffffffffffffffffff828116828216039080821115614635576146356154b1565b602080825282518282018190526000919060409081850190868401855b82811015615aa857815180516001600160a01b031685528681015163ffffffff90811688870152868201518116878701526060808301519091169086015260808082015167ffffffffffffffff169086015260a080820151615a888288018267ffffffffffffffff169052565b505060c09081015115159085015260e09093019290850190600101615a1b565b5091979650505050505050565b7fffffffff000000000000000000000000000000000000000000000000000000008135818116916004851015615af55780818660040360031b1b83161692505b505092915050565b60008085851115615b0d57600080fd5b83861115615b1a57600080fd5b5050820193919092039150565b600060208284031215615b3957600080fd5b6040516020810181811067ffffffffffffffff82111715615b5c57615b5c614acc565b6040529135825250919050565b600060208284031215615b7b57600080fd5b61147082615456565b63ffffffff818116838216019080821115614635576146356154b1565b600060208284031215615bb357600080fd5b815161147081614a19565b818103818111156110f3576110f36154b1565b8181036000831280158383131683831282161715614635576146356154b1565b6101c08101615c6e82856001600160a01b03808251168352602082015167ffffffffffffffff808216602086015280604085015116604086015280606085015116606086015250506bffffffffffffffffffffffff60808301511660808401528060a08301511660a08401528060c08301511660c0840152505050565b82516001600160a01b0390811660e0840152602084015161ffff908116610100850152604085015163ffffffff9081166101208601526060860151909116610140850152608085015190911661016084015260a08401511661018083015260c083015167ffffffffffffffff166101a0830152611470565b600081615cf557615cf56154b1565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190565b63ffffffff83168152604060208201526000613f7260408301846151be565b600060408284031215615d4c57600080fd5b615d54614b24565b615d5d83615456565b815260208301516155b281614bf6565b6020815260006114706020830184615858565b602080825282518282018190526000919060409081850190868401855b82811015615aa857815180516001600160a01b031685528681015161ffff168786015285015163ffffffff168585015260609093019290850190600101615d9d565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b60008251615e20818460208701614a4b565b919091019291505056fea164736f6c6343000813000a", +} + +var EVM2EVMOnRampABI = EVM2EVMOnRampMetaData.ABI + +var EVM2EVMOnRampBin = EVM2EVMOnRampMetaData.Bin + +func DeployEVM2EVMOnRamp(auth *bind.TransactOpts, backend bind.ContractBackend, staticConfig EVM2EVMOnRampStaticConfig, dynamicConfig EVM2EVMOnRampDynamicConfig, tokensAndPools []InternalPoolUpdate, allowlist []common.Address, rateLimiterConfig RateLimiterConfig, feeTokenConfigs []EVM2EVMOnRampFeeTokenConfigArgs, tokenTransferFeeConfigArgs []EVM2EVMOnRampTokenTransferFeeConfigArgs, nopsAndWeights []EVM2EVMOnRampNopAndWeight) (common.Address, *types.Transaction, *EVM2EVMOnRamp, error) { + parsed, err := EVM2EVMOnRampMetaData.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(EVM2EVMOnRampBin), backend, staticConfig, dynamicConfig, tokensAndPools, allowlist, rateLimiterConfig, feeTokenConfigs, tokenTransferFeeConfigArgs, nopsAndWeights) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &EVM2EVMOnRamp{EVM2EVMOnRampCaller: EVM2EVMOnRampCaller{contract: contract}, EVM2EVMOnRampTransactor: EVM2EVMOnRampTransactor{contract: contract}, EVM2EVMOnRampFilterer: EVM2EVMOnRampFilterer{contract: contract}}, nil +} + +type EVM2EVMOnRamp struct { + address common.Address + abi abi.ABI + EVM2EVMOnRampCaller + EVM2EVMOnRampTransactor + EVM2EVMOnRampFilterer +} + +type EVM2EVMOnRampCaller struct { + contract *bind.BoundContract +} + +type EVM2EVMOnRampTransactor struct { + contract *bind.BoundContract +} + +type EVM2EVMOnRampFilterer struct { + contract *bind.BoundContract +} + +type EVM2EVMOnRampSession struct { + Contract *EVM2EVMOnRamp + CallOpts bind.CallOpts + TransactOpts bind.TransactOpts +} + +type EVM2EVMOnRampCallerSession struct { + Contract *EVM2EVMOnRampCaller + CallOpts bind.CallOpts +} + +type EVM2EVMOnRampTransactorSession struct { + Contract *EVM2EVMOnRampTransactor + TransactOpts bind.TransactOpts +} + +type EVM2EVMOnRampRaw struct { + Contract *EVM2EVMOnRamp +} + +type EVM2EVMOnRampCallerRaw struct { + Contract *EVM2EVMOnRampCaller +} + +type EVM2EVMOnRampTransactorRaw struct { + Contract *EVM2EVMOnRampTransactor +} + +func NewEVM2EVMOnRamp(address common.Address, backend bind.ContractBackend) (*EVM2EVMOnRamp, error) { + abi, err := abi.JSON(strings.NewReader(EVM2EVMOnRampABI)) + if err != nil { + return nil, err + } + contract, err := bindEVM2EVMOnRamp(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &EVM2EVMOnRamp{address: address, abi: abi, EVM2EVMOnRampCaller: EVM2EVMOnRampCaller{contract: contract}, EVM2EVMOnRampTransactor: EVM2EVMOnRampTransactor{contract: contract}, EVM2EVMOnRampFilterer: EVM2EVMOnRampFilterer{contract: contract}}, nil +} + +func NewEVM2EVMOnRampCaller(address common.Address, caller bind.ContractCaller) (*EVM2EVMOnRampCaller, error) { + contract, err := bindEVM2EVMOnRamp(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &EVM2EVMOnRampCaller{contract: contract}, nil +} + +func NewEVM2EVMOnRampTransactor(address common.Address, transactor bind.ContractTransactor) (*EVM2EVMOnRampTransactor, error) { + contract, err := bindEVM2EVMOnRamp(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &EVM2EVMOnRampTransactor{contract: contract}, nil +} + +func NewEVM2EVMOnRampFilterer(address common.Address, filterer bind.ContractFilterer) (*EVM2EVMOnRampFilterer, error) { + contract, err := bindEVM2EVMOnRamp(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &EVM2EVMOnRampFilterer{contract: contract}, nil +} + +func bindEVM2EVMOnRamp(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := EVM2EVMOnRampMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _EVM2EVMOnRamp.Contract.EVM2EVMOnRampCaller.contract.Call(opts, result, method, params...) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.EVM2EVMOnRampTransactor.contract.Transfer(opts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.EVM2EVMOnRampTransactor.contract.Transact(opts, method, params...) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _EVM2EVMOnRamp.Contract.contract.Call(opts, result, method, params...) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.contract.Transfer(opts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.contract.Transact(opts, method, params...) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCaller) CurrentRateLimiterState(opts *bind.CallOpts) (RateLimiterTokenBucket, error) { + var out []interface{} + err := _EVM2EVMOnRamp.contract.Call(opts, &out, "currentRateLimiterState") + + if err != nil { + return *new(RateLimiterTokenBucket), err + } + + out0 := *abi.ConvertType(out[0], new(RateLimiterTokenBucket)).(*RateLimiterTokenBucket) + + return out0, err + +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) CurrentRateLimiterState() (RateLimiterTokenBucket, error) { + return _EVM2EVMOnRamp.Contract.CurrentRateLimiterState(&_EVM2EVMOnRamp.CallOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCallerSession) CurrentRateLimiterState() (RateLimiterTokenBucket, error) { + return _EVM2EVMOnRamp.Contract.CurrentRateLimiterState(&_EVM2EVMOnRamp.CallOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCaller) GetAllowList(opts *bind.CallOpts) ([]common.Address, error) { + var out []interface{} + err := _EVM2EVMOnRamp.contract.Call(opts, &out, "getAllowList") + + if err != nil { + return *new([]common.Address), err + } + + out0 := *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) + + return out0, err + +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) GetAllowList() ([]common.Address, error) { + return _EVM2EVMOnRamp.Contract.GetAllowList(&_EVM2EVMOnRamp.CallOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCallerSession) GetAllowList() ([]common.Address, error) { + return _EVM2EVMOnRamp.Contract.GetAllowList(&_EVM2EVMOnRamp.CallOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCaller) GetAllowListEnabled(opts *bind.CallOpts) (bool, error) { + var out []interface{} + err := _EVM2EVMOnRamp.contract.Call(opts, &out, "getAllowListEnabled") + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) GetAllowListEnabled() (bool, error) { + return _EVM2EVMOnRamp.Contract.GetAllowListEnabled(&_EVM2EVMOnRamp.CallOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCallerSession) GetAllowListEnabled() (bool, error) { + return _EVM2EVMOnRamp.Contract.GetAllowListEnabled(&_EVM2EVMOnRamp.CallOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCaller) GetDynamicConfig(opts *bind.CallOpts) (EVM2EVMOnRampDynamicConfig, error) { + var out []interface{} + err := _EVM2EVMOnRamp.contract.Call(opts, &out, "getDynamicConfig") + + if err != nil { + return *new(EVM2EVMOnRampDynamicConfig), err + } + + out0 := *abi.ConvertType(out[0], new(EVM2EVMOnRampDynamicConfig)).(*EVM2EVMOnRampDynamicConfig) + + return out0, err + +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) GetDynamicConfig() (EVM2EVMOnRampDynamicConfig, error) { + return _EVM2EVMOnRamp.Contract.GetDynamicConfig(&_EVM2EVMOnRamp.CallOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCallerSession) GetDynamicConfig() (EVM2EVMOnRampDynamicConfig, error) { + return _EVM2EVMOnRamp.Contract.GetDynamicConfig(&_EVM2EVMOnRamp.CallOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCaller) GetExpectedNextSequenceNumber(opts *bind.CallOpts) (uint64, error) { + var out []interface{} + err := _EVM2EVMOnRamp.contract.Call(opts, &out, "getExpectedNextSequenceNumber") + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) GetExpectedNextSequenceNumber() (uint64, error) { + return _EVM2EVMOnRamp.Contract.GetExpectedNextSequenceNumber(&_EVM2EVMOnRamp.CallOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCallerSession) GetExpectedNextSequenceNumber() (uint64, error) { + return _EVM2EVMOnRamp.Contract.GetExpectedNextSequenceNumber(&_EVM2EVMOnRamp.CallOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCaller) GetFee(opts *bind.CallOpts, message ClientEVM2AnyMessage) (*big.Int, error) { + var out []interface{} + err := _EVM2EVMOnRamp.contract.Call(opts, &out, "getFee", message) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) GetFee(message ClientEVM2AnyMessage) (*big.Int, error) { + return _EVM2EVMOnRamp.Contract.GetFee(&_EVM2EVMOnRamp.CallOpts, message) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCallerSession) GetFee(message ClientEVM2AnyMessage) (*big.Int, error) { + return _EVM2EVMOnRamp.Contract.GetFee(&_EVM2EVMOnRamp.CallOpts, message) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCaller) GetFeeTokenConfig(opts *bind.CallOpts, token common.Address) (EVM2EVMOnRampFeeTokenConfig, error) { + var out []interface{} + err := _EVM2EVMOnRamp.contract.Call(opts, &out, "getFeeTokenConfig", token) + + if err != nil { + return *new(EVM2EVMOnRampFeeTokenConfig), err + } + + out0 := *abi.ConvertType(out[0], new(EVM2EVMOnRampFeeTokenConfig)).(*EVM2EVMOnRampFeeTokenConfig) + + return out0, err + +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) GetFeeTokenConfig(token common.Address) (EVM2EVMOnRampFeeTokenConfig, error) { + return _EVM2EVMOnRamp.Contract.GetFeeTokenConfig(&_EVM2EVMOnRamp.CallOpts, token) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCallerSession) GetFeeTokenConfig(token common.Address) (EVM2EVMOnRampFeeTokenConfig, error) { + return _EVM2EVMOnRamp.Contract.GetFeeTokenConfig(&_EVM2EVMOnRamp.CallOpts, token) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCaller) GetNopFeesJuels(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _EVM2EVMOnRamp.contract.Call(opts, &out, "getNopFeesJuels") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) GetNopFeesJuels() (*big.Int, error) { + return _EVM2EVMOnRamp.Contract.GetNopFeesJuels(&_EVM2EVMOnRamp.CallOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCallerSession) GetNopFeesJuels() (*big.Int, error) { + return _EVM2EVMOnRamp.Contract.GetNopFeesJuels(&_EVM2EVMOnRamp.CallOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCaller) GetNops(opts *bind.CallOpts) (GetNops, + + error) { + var out []interface{} + err := _EVM2EVMOnRamp.contract.Call(opts, &out, "getNops") + + outstruct := new(GetNops) + if err != nil { + return *outstruct, err + } + + outstruct.NopsAndWeights = *abi.ConvertType(out[0], new([]EVM2EVMOnRampNopAndWeight)).(*[]EVM2EVMOnRampNopAndWeight) + outstruct.WeightsTotal = *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) + + return *outstruct, err + +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) GetNops() (GetNops, + + error) { + return _EVM2EVMOnRamp.Contract.GetNops(&_EVM2EVMOnRamp.CallOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCallerSession) GetNops() (GetNops, + + error) { + return _EVM2EVMOnRamp.Contract.GetNops(&_EVM2EVMOnRamp.CallOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCaller) GetPoolBySourceToken(opts *bind.CallOpts, sourceToken common.Address) (common.Address, error) { + var out []interface{} + err := _EVM2EVMOnRamp.contract.Call(opts, &out, "getPoolBySourceToken", sourceToken) + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) GetPoolBySourceToken(sourceToken common.Address) (common.Address, error) { + return _EVM2EVMOnRamp.Contract.GetPoolBySourceToken(&_EVM2EVMOnRamp.CallOpts, sourceToken) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCallerSession) GetPoolBySourceToken(sourceToken common.Address) (common.Address, error) { + return _EVM2EVMOnRamp.Contract.GetPoolBySourceToken(&_EVM2EVMOnRamp.CallOpts, sourceToken) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCaller) GetSenderNonce(opts *bind.CallOpts, sender common.Address) (uint64, error) { + var out []interface{} + err := _EVM2EVMOnRamp.contract.Call(opts, &out, "getSenderNonce", sender) + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) GetSenderNonce(sender common.Address) (uint64, error) { + return _EVM2EVMOnRamp.Contract.GetSenderNonce(&_EVM2EVMOnRamp.CallOpts, sender) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCallerSession) GetSenderNonce(sender common.Address) (uint64, error) { + return _EVM2EVMOnRamp.Contract.GetSenderNonce(&_EVM2EVMOnRamp.CallOpts, sender) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCaller) GetStaticConfig(opts *bind.CallOpts) (EVM2EVMOnRampStaticConfig, error) { + var out []interface{} + err := _EVM2EVMOnRamp.contract.Call(opts, &out, "getStaticConfig") + + if err != nil { + return *new(EVM2EVMOnRampStaticConfig), err + } + + out0 := *abi.ConvertType(out[0], new(EVM2EVMOnRampStaticConfig)).(*EVM2EVMOnRampStaticConfig) + + return out0, err + +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) GetStaticConfig() (EVM2EVMOnRampStaticConfig, error) { + return _EVM2EVMOnRamp.Contract.GetStaticConfig(&_EVM2EVMOnRamp.CallOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCallerSession) GetStaticConfig() (EVM2EVMOnRampStaticConfig, error) { + return _EVM2EVMOnRamp.Contract.GetStaticConfig(&_EVM2EVMOnRamp.CallOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCaller) GetSupportedTokens(opts *bind.CallOpts) ([]common.Address, error) { + var out []interface{} + err := _EVM2EVMOnRamp.contract.Call(opts, &out, "getSupportedTokens") + + if err != nil { + return *new([]common.Address), err + } + + out0 := *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) + + return out0, err + +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) GetSupportedTokens() ([]common.Address, error) { + return _EVM2EVMOnRamp.Contract.GetSupportedTokens(&_EVM2EVMOnRamp.CallOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCallerSession) GetSupportedTokens() ([]common.Address, error) { + return _EVM2EVMOnRamp.Contract.GetSupportedTokens(&_EVM2EVMOnRamp.CallOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCaller) GetTokenLimitAdmin(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _EVM2EVMOnRamp.contract.Call(opts, &out, "getTokenLimitAdmin") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) GetTokenLimitAdmin() (common.Address, error) { + return _EVM2EVMOnRamp.Contract.GetTokenLimitAdmin(&_EVM2EVMOnRamp.CallOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCallerSession) GetTokenLimitAdmin() (common.Address, error) { + return _EVM2EVMOnRamp.Contract.GetTokenLimitAdmin(&_EVM2EVMOnRamp.CallOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCaller) GetTokenTransferFeeConfig(opts *bind.CallOpts, token common.Address) (EVM2EVMOnRampTokenTransferFeeConfig, error) { + var out []interface{} + err := _EVM2EVMOnRamp.contract.Call(opts, &out, "getTokenTransferFeeConfig", token) + + if err != nil { + return *new(EVM2EVMOnRampTokenTransferFeeConfig), err + } + + out0 := *abi.ConvertType(out[0], new(EVM2EVMOnRampTokenTransferFeeConfig)).(*EVM2EVMOnRampTokenTransferFeeConfig) + + return out0, err + +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) GetTokenTransferFeeConfig(token common.Address) (EVM2EVMOnRampTokenTransferFeeConfig, error) { + return _EVM2EVMOnRamp.Contract.GetTokenTransferFeeConfig(&_EVM2EVMOnRamp.CallOpts, token) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCallerSession) GetTokenTransferFeeConfig(token common.Address) (EVM2EVMOnRampTokenTransferFeeConfig, error) { + return _EVM2EVMOnRamp.Contract.GetTokenTransferFeeConfig(&_EVM2EVMOnRamp.CallOpts, token) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCaller) LinkAvailableForPayment(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _EVM2EVMOnRamp.contract.Call(opts, &out, "linkAvailableForPayment") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) LinkAvailableForPayment() (*big.Int, error) { + return _EVM2EVMOnRamp.Contract.LinkAvailableForPayment(&_EVM2EVMOnRamp.CallOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCallerSession) LinkAvailableForPayment() (*big.Int, error) { + return _EVM2EVMOnRamp.Contract.LinkAvailableForPayment(&_EVM2EVMOnRamp.CallOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCaller) Owner(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _EVM2EVMOnRamp.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 + +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) Owner() (common.Address, error) { + return _EVM2EVMOnRamp.Contract.Owner(&_EVM2EVMOnRamp.CallOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCallerSession) Owner() (common.Address, error) { + return _EVM2EVMOnRamp.Contract.Owner(&_EVM2EVMOnRamp.CallOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCaller) TypeAndVersion(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _EVM2EVMOnRamp.contract.Call(opts, &out, "typeAndVersion") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) TypeAndVersion() (string, error) { + return _EVM2EVMOnRamp.Contract.TypeAndVersion(&_EVM2EVMOnRamp.CallOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCallerSession) TypeAndVersion() (string, error) { + return _EVM2EVMOnRamp.Contract.TypeAndVersion(&_EVM2EVMOnRamp.CallOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactor) AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + return _EVM2EVMOnRamp.contract.Transact(opts, "acceptOwnership") +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) AcceptOwnership() (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.AcceptOwnership(&_EVM2EVMOnRamp.TransactOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactorSession) AcceptOwnership() (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.AcceptOwnership(&_EVM2EVMOnRamp.TransactOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactor) ApplyAllowListUpdates(opts *bind.TransactOpts, removes []common.Address, adds []common.Address) (*types.Transaction, error) { + return _EVM2EVMOnRamp.contract.Transact(opts, "applyAllowListUpdates", removes, adds) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) ApplyAllowListUpdates(removes []common.Address, adds []common.Address) (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.ApplyAllowListUpdates(&_EVM2EVMOnRamp.TransactOpts, removes, adds) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactorSession) ApplyAllowListUpdates(removes []common.Address, adds []common.Address) (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.ApplyAllowListUpdates(&_EVM2EVMOnRamp.TransactOpts, removes, adds) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactor) ApplyPoolUpdates(opts *bind.TransactOpts, removes []InternalPoolUpdate, adds []InternalPoolUpdate) (*types.Transaction, error) { + return _EVM2EVMOnRamp.contract.Transact(opts, "applyPoolUpdates", removes, adds) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) ApplyPoolUpdates(removes []InternalPoolUpdate, adds []InternalPoolUpdate) (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.ApplyPoolUpdates(&_EVM2EVMOnRamp.TransactOpts, removes, adds) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactorSession) ApplyPoolUpdates(removes []InternalPoolUpdate, adds []InternalPoolUpdate) (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.ApplyPoolUpdates(&_EVM2EVMOnRamp.TransactOpts, removes, adds) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactor) ForwardFromRouter(opts *bind.TransactOpts, message ClientEVM2AnyMessage, feeTokenAmount *big.Int, originalSender common.Address) (*types.Transaction, error) { + return _EVM2EVMOnRamp.contract.Transact(opts, "forwardFromRouter", message, feeTokenAmount, originalSender) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) ForwardFromRouter(message ClientEVM2AnyMessage, feeTokenAmount *big.Int, originalSender common.Address) (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.ForwardFromRouter(&_EVM2EVMOnRamp.TransactOpts, message, feeTokenAmount, originalSender) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactorSession) ForwardFromRouter(message ClientEVM2AnyMessage, feeTokenAmount *big.Int, originalSender common.Address) (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.ForwardFromRouter(&_EVM2EVMOnRamp.TransactOpts, message, feeTokenAmount, originalSender) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactor) PayNops(opts *bind.TransactOpts) (*types.Transaction, error) { + return _EVM2EVMOnRamp.contract.Transact(opts, "payNops") +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) PayNops() (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.PayNops(&_EVM2EVMOnRamp.TransactOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactorSession) PayNops() (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.PayNops(&_EVM2EVMOnRamp.TransactOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactor) SetAdmin(opts *bind.TransactOpts, newAdmin common.Address) (*types.Transaction, error) { + return _EVM2EVMOnRamp.contract.Transact(opts, "setAdmin", newAdmin) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) SetAdmin(newAdmin common.Address) (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.SetAdmin(&_EVM2EVMOnRamp.TransactOpts, newAdmin) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactorSession) SetAdmin(newAdmin common.Address) (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.SetAdmin(&_EVM2EVMOnRamp.TransactOpts, newAdmin) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactor) SetAllowListEnabled(opts *bind.TransactOpts, enabled bool) (*types.Transaction, error) { + return _EVM2EVMOnRamp.contract.Transact(opts, "setAllowListEnabled", enabled) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) SetAllowListEnabled(enabled bool) (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.SetAllowListEnabled(&_EVM2EVMOnRamp.TransactOpts, enabled) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactorSession) SetAllowListEnabled(enabled bool) (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.SetAllowListEnabled(&_EVM2EVMOnRamp.TransactOpts, enabled) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactor) SetDynamicConfig(opts *bind.TransactOpts, dynamicConfig EVM2EVMOnRampDynamicConfig) (*types.Transaction, error) { + return _EVM2EVMOnRamp.contract.Transact(opts, "setDynamicConfig", dynamicConfig) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) SetDynamicConfig(dynamicConfig EVM2EVMOnRampDynamicConfig) (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.SetDynamicConfig(&_EVM2EVMOnRamp.TransactOpts, dynamicConfig) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactorSession) SetDynamicConfig(dynamicConfig EVM2EVMOnRampDynamicConfig) (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.SetDynamicConfig(&_EVM2EVMOnRamp.TransactOpts, dynamicConfig) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactor) SetFeeTokenConfig(opts *bind.TransactOpts, feeTokenConfigArgs []EVM2EVMOnRampFeeTokenConfigArgs) (*types.Transaction, error) { + return _EVM2EVMOnRamp.contract.Transact(opts, "setFeeTokenConfig", feeTokenConfigArgs) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) SetFeeTokenConfig(feeTokenConfigArgs []EVM2EVMOnRampFeeTokenConfigArgs) (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.SetFeeTokenConfig(&_EVM2EVMOnRamp.TransactOpts, feeTokenConfigArgs) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactorSession) SetFeeTokenConfig(feeTokenConfigArgs []EVM2EVMOnRampFeeTokenConfigArgs) (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.SetFeeTokenConfig(&_EVM2EVMOnRamp.TransactOpts, feeTokenConfigArgs) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactor) SetNops(opts *bind.TransactOpts, nopsAndWeights []EVM2EVMOnRampNopAndWeight) (*types.Transaction, error) { + return _EVM2EVMOnRamp.contract.Transact(opts, "setNops", nopsAndWeights) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) SetNops(nopsAndWeights []EVM2EVMOnRampNopAndWeight) (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.SetNops(&_EVM2EVMOnRamp.TransactOpts, nopsAndWeights) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactorSession) SetNops(nopsAndWeights []EVM2EVMOnRampNopAndWeight) (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.SetNops(&_EVM2EVMOnRamp.TransactOpts, nopsAndWeights) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactor) SetRateLimiterConfig(opts *bind.TransactOpts, config RateLimiterConfig) (*types.Transaction, error) { + return _EVM2EVMOnRamp.contract.Transact(opts, "setRateLimiterConfig", config) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) SetRateLimiterConfig(config RateLimiterConfig) (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.SetRateLimiterConfig(&_EVM2EVMOnRamp.TransactOpts, config) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactorSession) SetRateLimiterConfig(config RateLimiterConfig) (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.SetRateLimiterConfig(&_EVM2EVMOnRamp.TransactOpts, config) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactor) SetTokenTransferFeeConfig(opts *bind.TransactOpts, tokenTransferFeeConfigArgs []EVM2EVMOnRampTokenTransferFeeConfigArgs) (*types.Transaction, error) { + return _EVM2EVMOnRamp.contract.Transact(opts, "setTokenTransferFeeConfig", tokenTransferFeeConfigArgs) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) SetTokenTransferFeeConfig(tokenTransferFeeConfigArgs []EVM2EVMOnRampTokenTransferFeeConfigArgs) (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.SetTokenTransferFeeConfig(&_EVM2EVMOnRamp.TransactOpts, tokenTransferFeeConfigArgs) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactorSession) SetTokenTransferFeeConfig(tokenTransferFeeConfigArgs []EVM2EVMOnRampTokenTransferFeeConfigArgs) (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.SetTokenTransferFeeConfig(&_EVM2EVMOnRamp.TransactOpts, tokenTransferFeeConfigArgs) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactor) TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) { + return _EVM2EVMOnRamp.contract.Transact(opts, "transferOwnership", to) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.TransferOwnership(&_EVM2EVMOnRamp.TransactOpts, to) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactorSession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.TransferOwnership(&_EVM2EVMOnRamp.TransactOpts, to) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactor) WithdrawNonLinkFees(opts *bind.TransactOpts, feeToken common.Address, to common.Address) (*types.Transaction, error) { + return _EVM2EVMOnRamp.contract.Transact(opts, "withdrawNonLinkFees", feeToken, to) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) WithdrawNonLinkFees(feeToken common.Address, to common.Address) (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.WithdrawNonLinkFees(&_EVM2EVMOnRamp.TransactOpts, feeToken, to) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactorSession) WithdrawNonLinkFees(feeToken common.Address, to common.Address) (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.WithdrawNonLinkFees(&_EVM2EVMOnRamp.TransactOpts, feeToken, to) +} + +type EVM2EVMOnRampAdminSetIterator struct { + Event *EVM2EVMOnRampAdminSet + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *EVM2EVMOnRampAdminSetIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOnRampAdminSet) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOnRampAdminSet) + 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() + } +} + +func (it *EVM2EVMOnRampAdminSetIterator) Error() error { + return it.fail +} + +func (it *EVM2EVMOnRampAdminSetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type EVM2EVMOnRampAdminSet struct { + NewAdmin common.Address + Raw types.Log +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) FilterAdminSet(opts *bind.FilterOpts) (*EVM2EVMOnRampAdminSetIterator, error) { + + logs, sub, err := _EVM2EVMOnRamp.contract.FilterLogs(opts, "AdminSet") + if err != nil { + return nil, err + } + return &EVM2EVMOnRampAdminSetIterator{contract: _EVM2EVMOnRamp.contract, event: "AdminSet", logs: logs, sub: sub}, nil +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) WatchAdminSet(opts *bind.WatchOpts, sink chan<- *EVM2EVMOnRampAdminSet) (event.Subscription, error) { + + logs, sub, err := _EVM2EVMOnRamp.contract.WatchLogs(opts, "AdminSet") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(EVM2EVMOnRampAdminSet) + if err := _EVM2EVMOnRamp.contract.UnpackLog(event, "AdminSet", 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 +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) ParseAdminSet(log types.Log) (*EVM2EVMOnRampAdminSet, error) { + event := new(EVM2EVMOnRampAdminSet) + if err := _EVM2EVMOnRamp.contract.UnpackLog(event, "AdminSet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type EVM2EVMOnRampAllowListAddIterator struct { + Event *EVM2EVMOnRampAllowListAdd + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *EVM2EVMOnRampAllowListAddIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOnRampAllowListAdd) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOnRampAllowListAdd) + 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() + } +} + +func (it *EVM2EVMOnRampAllowListAddIterator) Error() error { + return it.fail +} + +func (it *EVM2EVMOnRampAllowListAddIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type EVM2EVMOnRampAllowListAdd struct { + Sender common.Address + Raw types.Log +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) FilterAllowListAdd(opts *bind.FilterOpts) (*EVM2EVMOnRampAllowListAddIterator, error) { + + logs, sub, err := _EVM2EVMOnRamp.contract.FilterLogs(opts, "AllowListAdd") + if err != nil { + return nil, err + } + return &EVM2EVMOnRampAllowListAddIterator{contract: _EVM2EVMOnRamp.contract, event: "AllowListAdd", logs: logs, sub: sub}, nil +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) WatchAllowListAdd(opts *bind.WatchOpts, sink chan<- *EVM2EVMOnRampAllowListAdd) (event.Subscription, error) { + + logs, sub, err := _EVM2EVMOnRamp.contract.WatchLogs(opts, "AllowListAdd") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(EVM2EVMOnRampAllowListAdd) + if err := _EVM2EVMOnRamp.contract.UnpackLog(event, "AllowListAdd", 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 +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) ParseAllowListAdd(log types.Log) (*EVM2EVMOnRampAllowListAdd, error) { + event := new(EVM2EVMOnRampAllowListAdd) + if err := _EVM2EVMOnRamp.contract.UnpackLog(event, "AllowListAdd", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type EVM2EVMOnRampAllowListEnabledSetIterator struct { + Event *EVM2EVMOnRampAllowListEnabledSet + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *EVM2EVMOnRampAllowListEnabledSetIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOnRampAllowListEnabledSet) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOnRampAllowListEnabledSet) + 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() + } +} + +func (it *EVM2EVMOnRampAllowListEnabledSetIterator) Error() error { + return it.fail +} + +func (it *EVM2EVMOnRampAllowListEnabledSetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type EVM2EVMOnRampAllowListEnabledSet struct { + Enabled bool + Raw types.Log +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) FilterAllowListEnabledSet(opts *bind.FilterOpts) (*EVM2EVMOnRampAllowListEnabledSetIterator, error) { + + logs, sub, err := _EVM2EVMOnRamp.contract.FilterLogs(opts, "AllowListEnabledSet") + if err != nil { + return nil, err + } + return &EVM2EVMOnRampAllowListEnabledSetIterator{contract: _EVM2EVMOnRamp.contract, event: "AllowListEnabledSet", logs: logs, sub: sub}, nil +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) WatchAllowListEnabledSet(opts *bind.WatchOpts, sink chan<- *EVM2EVMOnRampAllowListEnabledSet) (event.Subscription, error) { + + logs, sub, err := _EVM2EVMOnRamp.contract.WatchLogs(opts, "AllowListEnabledSet") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(EVM2EVMOnRampAllowListEnabledSet) + if err := _EVM2EVMOnRamp.contract.UnpackLog(event, "AllowListEnabledSet", 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 +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) ParseAllowListEnabledSet(log types.Log) (*EVM2EVMOnRampAllowListEnabledSet, error) { + event := new(EVM2EVMOnRampAllowListEnabledSet) + if err := _EVM2EVMOnRamp.contract.UnpackLog(event, "AllowListEnabledSet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type EVM2EVMOnRampAllowListRemoveIterator struct { + Event *EVM2EVMOnRampAllowListRemove + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *EVM2EVMOnRampAllowListRemoveIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOnRampAllowListRemove) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOnRampAllowListRemove) + 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() + } +} + +func (it *EVM2EVMOnRampAllowListRemoveIterator) Error() error { + return it.fail +} + +func (it *EVM2EVMOnRampAllowListRemoveIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type EVM2EVMOnRampAllowListRemove struct { + Sender common.Address + Raw types.Log +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) FilterAllowListRemove(opts *bind.FilterOpts) (*EVM2EVMOnRampAllowListRemoveIterator, error) { + + logs, sub, err := _EVM2EVMOnRamp.contract.FilterLogs(opts, "AllowListRemove") + if err != nil { + return nil, err + } + return &EVM2EVMOnRampAllowListRemoveIterator{contract: _EVM2EVMOnRamp.contract, event: "AllowListRemove", logs: logs, sub: sub}, nil +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) WatchAllowListRemove(opts *bind.WatchOpts, sink chan<- *EVM2EVMOnRampAllowListRemove) (event.Subscription, error) { + + logs, sub, err := _EVM2EVMOnRamp.contract.WatchLogs(opts, "AllowListRemove") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(EVM2EVMOnRampAllowListRemove) + if err := _EVM2EVMOnRamp.contract.UnpackLog(event, "AllowListRemove", 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 +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) ParseAllowListRemove(log types.Log) (*EVM2EVMOnRampAllowListRemove, error) { + event := new(EVM2EVMOnRampAllowListRemove) + if err := _EVM2EVMOnRamp.contract.UnpackLog(event, "AllowListRemove", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type EVM2EVMOnRampCCIPSendRequestedIterator struct { + Event *EVM2EVMOnRampCCIPSendRequested + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *EVM2EVMOnRampCCIPSendRequestedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOnRampCCIPSendRequested) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOnRampCCIPSendRequested) + 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() + } +} + +func (it *EVM2EVMOnRampCCIPSendRequestedIterator) Error() error { + return it.fail +} + +func (it *EVM2EVMOnRampCCIPSendRequestedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type EVM2EVMOnRampCCIPSendRequested struct { + Message InternalEVM2EVMMessage + Raw types.Log +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) FilterCCIPSendRequested(opts *bind.FilterOpts) (*EVM2EVMOnRampCCIPSendRequestedIterator, error) { + + logs, sub, err := _EVM2EVMOnRamp.contract.FilterLogs(opts, "CCIPSendRequested") + if err != nil { + return nil, err + } + return &EVM2EVMOnRampCCIPSendRequestedIterator{contract: _EVM2EVMOnRamp.contract, event: "CCIPSendRequested", logs: logs, sub: sub}, nil +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) WatchCCIPSendRequested(opts *bind.WatchOpts, sink chan<- *EVM2EVMOnRampCCIPSendRequested) (event.Subscription, error) { + + logs, sub, err := _EVM2EVMOnRamp.contract.WatchLogs(opts, "CCIPSendRequested") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(EVM2EVMOnRampCCIPSendRequested) + if err := _EVM2EVMOnRamp.contract.UnpackLog(event, "CCIPSendRequested", 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 +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) ParseCCIPSendRequested(log types.Log) (*EVM2EVMOnRampCCIPSendRequested, error) { + event := new(EVM2EVMOnRampCCIPSendRequested) + if err := _EVM2EVMOnRamp.contract.UnpackLog(event, "CCIPSendRequested", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type EVM2EVMOnRampConfigSetIterator struct { + Event *EVM2EVMOnRampConfigSet + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *EVM2EVMOnRampConfigSetIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOnRampConfigSet) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOnRampConfigSet) + 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() + } +} + +func (it *EVM2EVMOnRampConfigSetIterator) Error() error { + return it.fail +} + +func (it *EVM2EVMOnRampConfigSetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type EVM2EVMOnRampConfigSet struct { + StaticConfig EVM2EVMOnRampStaticConfig + DynamicConfig EVM2EVMOnRampDynamicConfig + Raw types.Log +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) FilterConfigSet(opts *bind.FilterOpts) (*EVM2EVMOnRampConfigSetIterator, error) { + + logs, sub, err := _EVM2EVMOnRamp.contract.FilterLogs(opts, "ConfigSet") + if err != nil { + return nil, err + } + return &EVM2EVMOnRampConfigSetIterator{contract: _EVM2EVMOnRamp.contract, event: "ConfigSet", logs: logs, sub: sub}, nil +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) WatchConfigSet(opts *bind.WatchOpts, sink chan<- *EVM2EVMOnRampConfigSet) (event.Subscription, error) { + + logs, sub, err := _EVM2EVMOnRamp.contract.WatchLogs(opts, "ConfigSet") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(EVM2EVMOnRampConfigSet) + if err := _EVM2EVMOnRamp.contract.UnpackLog(event, "ConfigSet", 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 +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) ParseConfigSet(log types.Log) (*EVM2EVMOnRampConfigSet, error) { + event := new(EVM2EVMOnRampConfigSet) + if err := _EVM2EVMOnRamp.contract.UnpackLog(event, "ConfigSet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type EVM2EVMOnRampFeeConfigSetIterator struct { + Event *EVM2EVMOnRampFeeConfigSet + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *EVM2EVMOnRampFeeConfigSetIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOnRampFeeConfigSet) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOnRampFeeConfigSet) + 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() + } +} + +func (it *EVM2EVMOnRampFeeConfigSetIterator) Error() error { + return it.fail +} + +func (it *EVM2EVMOnRampFeeConfigSetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type EVM2EVMOnRampFeeConfigSet struct { + FeeConfig []EVM2EVMOnRampFeeTokenConfigArgs + Raw types.Log +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) FilterFeeConfigSet(opts *bind.FilterOpts) (*EVM2EVMOnRampFeeConfigSetIterator, error) { + + logs, sub, err := _EVM2EVMOnRamp.contract.FilterLogs(opts, "FeeConfigSet") + if err != nil { + return nil, err + } + return &EVM2EVMOnRampFeeConfigSetIterator{contract: _EVM2EVMOnRamp.contract, event: "FeeConfigSet", logs: logs, sub: sub}, nil +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) WatchFeeConfigSet(opts *bind.WatchOpts, sink chan<- *EVM2EVMOnRampFeeConfigSet) (event.Subscription, error) { + + logs, sub, err := _EVM2EVMOnRamp.contract.WatchLogs(opts, "FeeConfigSet") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(EVM2EVMOnRampFeeConfigSet) + if err := _EVM2EVMOnRamp.contract.UnpackLog(event, "FeeConfigSet", 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 +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) ParseFeeConfigSet(log types.Log) (*EVM2EVMOnRampFeeConfigSet, error) { + event := new(EVM2EVMOnRampFeeConfigSet) + if err := _EVM2EVMOnRamp.contract.UnpackLog(event, "FeeConfigSet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type EVM2EVMOnRampNopPaidIterator struct { + Event *EVM2EVMOnRampNopPaid + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *EVM2EVMOnRampNopPaidIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOnRampNopPaid) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOnRampNopPaid) + 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() + } +} + +func (it *EVM2EVMOnRampNopPaidIterator) Error() error { + return it.fail +} + +func (it *EVM2EVMOnRampNopPaidIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type EVM2EVMOnRampNopPaid struct { + Nop common.Address + Amount *big.Int + Raw types.Log +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) FilterNopPaid(opts *bind.FilterOpts, nop []common.Address) (*EVM2EVMOnRampNopPaidIterator, error) { + + var nopRule []interface{} + for _, nopItem := range nop { + nopRule = append(nopRule, nopItem) + } + + logs, sub, err := _EVM2EVMOnRamp.contract.FilterLogs(opts, "NopPaid", nopRule) + if err != nil { + return nil, err + } + return &EVM2EVMOnRampNopPaidIterator{contract: _EVM2EVMOnRamp.contract, event: "NopPaid", logs: logs, sub: sub}, nil +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) WatchNopPaid(opts *bind.WatchOpts, sink chan<- *EVM2EVMOnRampNopPaid, nop []common.Address) (event.Subscription, error) { + + var nopRule []interface{} + for _, nopItem := range nop { + nopRule = append(nopRule, nopItem) + } + + logs, sub, err := _EVM2EVMOnRamp.contract.WatchLogs(opts, "NopPaid", nopRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(EVM2EVMOnRampNopPaid) + if err := _EVM2EVMOnRamp.contract.UnpackLog(event, "NopPaid", 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 +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) ParseNopPaid(log types.Log) (*EVM2EVMOnRampNopPaid, error) { + event := new(EVM2EVMOnRampNopPaid) + if err := _EVM2EVMOnRamp.contract.UnpackLog(event, "NopPaid", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type EVM2EVMOnRampNopsSetIterator struct { + Event *EVM2EVMOnRampNopsSet + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *EVM2EVMOnRampNopsSetIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOnRampNopsSet) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOnRampNopsSet) + 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() + } +} + +func (it *EVM2EVMOnRampNopsSetIterator) Error() error { + return it.fail +} + +func (it *EVM2EVMOnRampNopsSetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type EVM2EVMOnRampNopsSet struct { + NopWeightsTotal *big.Int + NopsAndWeights []EVM2EVMOnRampNopAndWeight + Raw types.Log +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) FilterNopsSet(opts *bind.FilterOpts) (*EVM2EVMOnRampNopsSetIterator, error) { + + logs, sub, err := _EVM2EVMOnRamp.contract.FilterLogs(opts, "NopsSet") + if err != nil { + return nil, err + } + return &EVM2EVMOnRampNopsSetIterator{contract: _EVM2EVMOnRamp.contract, event: "NopsSet", logs: logs, sub: sub}, nil +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) WatchNopsSet(opts *bind.WatchOpts, sink chan<- *EVM2EVMOnRampNopsSet) (event.Subscription, error) { + + logs, sub, err := _EVM2EVMOnRamp.contract.WatchLogs(opts, "NopsSet") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(EVM2EVMOnRampNopsSet) + if err := _EVM2EVMOnRamp.contract.UnpackLog(event, "NopsSet", 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 +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) ParseNopsSet(log types.Log) (*EVM2EVMOnRampNopsSet, error) { + event := new(EVM2EVMOnRampNopsSet) + if err := _EVM2EVMOnRamp.contract.UnpackLog(event, "NopsSet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type EVM2EVMOnRampOwnershipTransferRequestedIterator struct { + Event *EVM2EVMOnRampOwnershipTransferRequested + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *EVM2EVMOnRampOwnershipTransferRequestedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOnRampOwnershipTransferRequested) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOnRampOwnershipTransferRequested) + 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() + } +} + +func (it *EVM2EVMOnRampOwnershipTransferRequestedIterator) Error() error { + return it.fail +} + +func (it *EVM2EVMOnRampOwnershipTransferRequestedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type EVM2EVMOnRampOwnershipTransferRequested struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*EVM2EVMOnRampOwnershipTransferRequestedIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _EVM2EVMOnRamp.contract.FilterLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return &EVM2EVMOnRampOwnershipTransferRequestedIterator{contract: _EVM2EVMOnRamp.contract, event: "OwnershipTransferRequested", logs: logs, sub: sub}, nil +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *EVM2EVMOnRampOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _EVM2EVMOnRamp.contract.WatchLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(EVM2EVMOnRampOwnershipTransferRequested) + if err := _EVM2EVMOnRamp.contract.UnpackLog(event, "OwnershipTransferRequested", 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 +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) ParseOwnershipTransferRequested(log types.Log) (*EVM2EVMOnRampOwnershipTransferRequested, error) { + event := new(EVM2EVMOnRampOwnershipTransferRequested) + if err := _EVM2EVMOnRamp.contract.UnpackLog(event, "OwnershipTransferRequested", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type EVM2EVMOnRampOwnershipTransferredIterator struct { + Event *EVM2EVMOnRampOwnershipTransferred + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *EVM2EVMOnRampOwnershipTransferredIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOnRampOwnershipTransferred) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOnRampOwnershipTransferred) + 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() + } +} + +func (it *EVM2EVMOnRampOwnershipTransferredIterator) Error() error { + return it.fail +} + +func (it *EVM2EVMOnRampOwnershipTransferredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type EVM2EVMOnRampOwnershipTransferred struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*EVM2EVMOnRampOwnershipTransferredIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _EVM2EVMOnRamp.contract.FilterLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return &EVM2EVMOnRampOwnershipTransferredIterator{contract: _EVM2EVMOnRamp.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *EVM2EVMOnRampOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _EVM2EVMOnRamp.contract.WatchLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(EVM2EVMOnRampOwnershipTransferred) + if err := _EVM2EVMOnRamp.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 +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) ParseOwnershipTransferred(log types.Log) (*EVM2EVMOnRampOwnershipTransferred, error) { + event := new(EVM2EVMOnRampOwnershipTransferred) + if err := _EVM2EVMOnRamp.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type EVM2EVMOnRampPoolAddedIterator struct { + Event *EVM2EVMOnRampPoolAdded + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *EVM2EVMOnRampPoolAddedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOnRampPoolAdded) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOnRampPoolAdded) + 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() + } +} + +func (it *EVM2EVMOnRampPoolAddedIterator) Error() error { + return it.fail +} + +func (it *EVM2EVMOnRampPoolAddedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type EVM2EVMOnRampPoolAdded struct { + Token common.Address + Pool common.Address + Raw types.Log +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) FilterPoolAdded(opts *bind.FilterOpts) (*EVM2EVMOnRampPoolAddedIterator, error) { + + logs, sub, err := _EVM2EVMOnRamp.contract.FilterLogs(opts, "PoolAdded") + if err != nil { + return nil, err + } + return &EVM2EVMOnRampPoolAddedIterator{contract: _EVM2EVMOnRamp.contract, event: "PoolAdded", logs: logs, sub: sub}, nil +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) WatchPoolAdded(opts *bind.WatchOpts, sink chan<- *EVM2EVMOnRampPoolAdded) (event.Subscription, error) { + + logs, sub, err := _EVM2EVMOnRamp.contract.WatchLogs(opts, "PoolAdded") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(EVM2EVMOnRampPoolAdded) + if err := _EVM2EVMOnRamp.contract.UnpackLog(event, "PoolAdded", 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 +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) ParsePoolAdded(log types.Log) (*EVM2EVMOnRampPoolAdded, error) { + event := new(EVM2EVMOnRampPoolAdded) + if err := _EVM2EVMOnRamp.contract.UnpackLog(event, "PoolAdded", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type EVM2EVMOnRampPoolRemovedIterator struct { + Event *EVM2EVMOnRampPoolRemoved + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *EVM2EVMOnRampPoolRemovedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOnRampPoolRemoved) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOnRampPoolRemoved) + 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() + } +} + +func (it *EVM2EVMOnRampPoolRemovedIterator) Error() error { + return it.fail +} + +func (it *EVM2EVMOnRampPoolRemovedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type EVM2EVMOnRampPoolRemoved struct { + Token common.Address + Pool common.Address + Raw types.Log +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) FilterPoolRemoved(opts *bind.FilterOpts) (*EVM2EVMOnRampPoolRemovedIterator, error) { + + logs, sub, err := _EVM2EVMOnRamp.contract.FilterLogs(opts, "PoolRemoved") + if err != nil { + return nil, err + } + return &EVM2EVMOnRampPoolRemovedIterator{contract: _EVM2EVMOnRamp.contract, event: "PoolRemoved", logs: logs, sub: sub}, nil +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) WatchPoolRemoved(opts *bind.WatchOpts, sink chan<- *EVM2EVMOnRampPoolRemoved) (event.Subscription, error) { + + logs, sub, err := _EVM2EVMOnRamp.contract.WatchLogs(opts, "PoolRemoved") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(EVM2EVMOnRampPoolRemoved) + if err := _EVM2EVMOnRamp.contract.UnpackLog(event, "PoolRemoved", 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 +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) ParsePoolRemoved(log types.Log) (*EVM2EVMOnRampPoolRemoved, error) { + event := new(EVM2EVMOnRampPoolRemoved) + if err := _EVM2EVMOnRamp.contract.UnpackLog(event, "PoolRemoved", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type EVM2EVMOnRampTokenTransferFeeConfigSetIterator struct { + Event *EVM2EVMOnRampTokenTransferFeeConfigSet + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *EVM2EVMOnRampTokenTransferFeeConfigSetIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOnRampTokenTransferFeeConfigSet) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOnRampTokenTransferFeeConfigSet) + 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() + } +} + +func (it *EVM2EVMOnRampTokenTransferFeeConfigSetIterator) Error() error { + return it.fail +} + +func (it *EVM2EVMOnRampTokenTransferFeeConfigSetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type EVM2EVMOnRampTokenTransferFeeConfigSet struct { + TransferFeeConfig []EVM2EVMOnRampTokenTransferFeeConfigArgs + Raw types.Log +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) FilterTokenTransferFeeConfigSet(opts *bind.FilterOpts) (*EVM2EVMOnRampTokenTransferFeeConfigSetIterator, error) { + + logs, sub, err := _EVM2EVMOnRamp.contract.FilterLogs(opts, "TokenTransferFeeConfigSet") + if err != nil { + return nil, err + } + return &EVM2EVMOnRampTokenTransferFeeConfigSetIterator{contract: _EVM2EVMOnRamp.contract, event: "TokenTransferFeeConfigSet", logs: logs, sub: sub}, nil +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) WatchTokenTransferFeeConfigSet(opts *bind.WatchOpts, sink chan<- *EVM2EVMOnRampTokenTransferFeeConfigSet) (event.Subscription, error) { + + logs, sub, err := _EVM2EVMOnRamp.contract.WatchLogs(opts, "TokenTransferFeeConfigSet") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(EVM2EVMOnRampTokenTransferFeeConfigSet) + if err := _EVM2EVMOnRamp.contract.UnpackLog(event, "TokenTransferFeeConfigSet", 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 +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) ParseTokenTransferFeeConfigSet(log types.Log) (*EVM2EVMOnRampTokenTransferFeeConfigSet, error) { + event := new(EVM2EVMOnRampTokenTransferFeeConfigSet) + if err := _EVM2EVMOnRamp.contract.UnpackLog(event, "TokenTransferFeeConfigSet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type GetNops struct { + NopsAndWeights []EVM2EVMOnRampNopAndWeight + WeightsTotal *big.Int +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRamp) ParseLog(log types.Log) (generated.AbigenLog, error) { + switch log.Topics[0] { + case _EVM2EVMOnRamp.abi.Events["AdminSet"].ID: + return _EVM2EVMOnRamp.ParseAdminSet(log) + case _EVM2EVMOnRamp.abi.Events["AllowListAdd"].ID: + return _EVM2EVMOnRamp.ParseAllowListAdd(log) + case _EVM2EVMOnRamp.abi.Events["AllowListEnabledSet"].ID: + return _EVM2EVMOnRamp.ParseAllowListEnabledSet(log) + case _EVM2EVMOnRamp.abi.Events["AllowListRemove"].ID: + return _EVM2EVMOnRamp.ParseAllowListRemove(log) + case _EVM2EVMOnRamp.abi.Events["CCIPSendRequested"].ID: + return _EVM2EVMOnRamp.ParseCCIPSendRequested(log) + case _EVM2EVMOnRamp.abi.Events["ConfigSet"].ID: + return _EVM2EVMOnRamp.ParseConfigSet(log) + case _EVM2EVMOnRamp.abi.Events["FeeConfigSet"].ID: + return _EVM2EVMOnRamp.ParseFeeConfigSet(log) + case _EVM2EVMOnRamp.abi.Events["NopPaid"].ID: + return _EVM2EVMOnRamp.ParseNopPaid(log) + case _EVM2EVMOnRamp.abi.Events["NopsSet"].ID: + return _EVM2EVMOnRamp.ParseNopsSet(log) + case _EVM2EVMOnRamp.abi.Events["OwnershipTransferRequested"].ID: + return _EVM2EVMOnRamp.ParseOwnershipTransferRequested(log) + case _EVM2EVMOnRamp.abi.Events["OwnershipTransferred"].ID: + return _EVM2EVMOnRamp.ParseOwnershipTransferred(log) + case _EVM2EVMOnRamp.abi.Events["PoolAdded"].ID: + return _EVM2EVMOnRamp.ParsePoolAdded(log) + case _EVM2EVMOnRamp.abi.Events["PoolRemoved"].ID: + return _EVM2EVMOnRamp.ParsePoolRemoved(log) + case _EVM2EVMOnRamp.abi.Events["TokenTransferFeeConfigSet"].ID: + return _EVM2EVMOnRamp.ParseTokenTransferFeeConfigSet(log) + + default: + return nil, fmt.Errorf("abigen wrapper received unknown log topic: %v", log.Topics[0]) + } +} + +func (EVM2EVMOnRampAdminSet) Topic() common.Hash { + return common.HexToHash("0x8fe72c3e0020beb3234e76ae6676fa576fbfcae600af1c4fea44784cf0db329c") +} + +func (EVM2EVMOnRampAllowListAdd) Topic() common.Hash { + return common.HexToHash("0x2640d4d76caf8bf478aabfa982fa4e1c4eb71a37f93cd15e80dbc657911546d8") +} + +func (EVM2EVMOnRampAllowListEnabledSet) Topic() common.Hash { + return common.HexToHash("0xccf4daf6ab6430389f26b970595dab82a5881ad454770907e415ede27c8df032") +} + +func (EVM2EVMOnRampAllowListRemove) Topic() common.Hash { + return common.HexToHash("0x800671136ab6cfee9fbe5ed1fb7ca417811aca3cf864800d127b927adedf7566") +} + +func (EVM2EVMOnRampCCIPSendRequested) Topic() common.Hash { + return common.HexToHash("0xaffc45517195d6499808c643bd4a7b0ffeedf95bea5852840d7bfcf63f59e821") +} + +func (EVM2EVMOnRampConfigSet) Topic() common.Hash { + return common.HexToHash("0x72c6aaba4dde02f77d291123a76185c418ba63f8c217a2d56b08aec84e9bbfb8") +} + +func (EVM2EVMOnRampFeeConfigSet) Topic() common.Hash { + return common.HexToHash("0x2386f61ab5cafc3fed44f9f614f721ab53479ef64067fd16c1a2491b63ddf1a8") +} + +func (EVM2EVMOnRampNopPaid) Topic() common.Hash { + return common.HexToHash("0x55fdec2aab60a41fa5abb106670eb1006f5aeaee1ba7afea2bc89b5b3ec7678f") +} + +func (EVM2EVMOnRampNopsSet) Topic() common.Hash { + return common.HexToHash("0x8c337bff38141c507abd25c547606bdde78fe8c12e941ab613f3a565fea6cd24") +} + +func (EVM2EVMOnRampOwnershipTransferRequested) Topic() common.Hash { + return common.HexToHash("0xed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae1278") +} + +func (EVM2EVMOnRampOwnershipTransferred) Topic() common.Hash { + return common.HexToHash("0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0") +} + +func (EVM2EVMOnRampPoolAdded) Topic() common.Hash { + return common.HexToHash("0x95f865c2808f8b2a85eea2611db7843150ee7835ef1403f9755918a97d76933c") +} + +func (EVM2EVMOnRampPoolRemoved) Topic() common.Hash { + return common.HexToHash("0x987eb3c2f78454541205f72f34839b434c306c9eaf4922efd7c0c3060fdb2e4c") +} + +func (EVM2EVMOnRampTokenTransferFeeConfigSet) Topic() common.Hash { + return common.HexToHash("0x4230c60a9725eb5fb992cf6a215398b4e81b4606d4a1e6be8dfe0b60dc172ec1") +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRamp) Address() common.Address { + return _EVM2EVMOnRamp.address +} + +type EVM2EVMOnRampInterface interface { + CurrentRateLimiterState(opts *bind.CallOpts) (RateLimiterTokenBucket, error) + + GetAllowList(opts *bind.CallOpts) ([]common.Address, error) + + GetAllowListEnabled(opts *bind.CallOpts) (bool, error) + + GetDynamicConfig(opts *bind.CallOpts) (EVM2EVMOnRampDynamicConfig, error) + + GetExpectedNextSequenceNumber(opts *bind.CallOpts) (uint64, error) + + GetFee(opts *bind.CallOpts, message ClientEVM2AnyMessage) (*big.Int, error) + + GetFeeTokenConfig(opts *bind.CallOpts, token common.Address) (EVM2EVMOnRampFeeTokenConfig, error) + + GetNopFeesJuels(opts *bind.CallOpts) (*big.Int, error) + + GetNops(opts *bind.CallOpts) (GetNops, + + error) + + GetPoolBySourceToken(opts *bind.CallOpts, sourceToken common.Address) (common.Address, error) + + GetSenderNonce(opts *bind.CallOpts, sender common.Address) (uint64, error) + + GetStaticConfig(opts *bind.CallOpts) (EVM2EVMOnRampStaticConfig, error) + + GetSupportedTokens(opts *bind.CallOpts) ([]common.Address, error) + + GetTokenLimitAdmin(opts *bind.CallOpts) (common.Address, error) + + GetTokenTransferFeeConfig(opts *bind.CallOpts, token common.Address) (EVM2EVMOnRampTokenTransferFeeConfig, error) + + LinkAvailableForPayment(opts *bind.CallOpts) (*big.Int, error) + + Owner(opts *bind.CallOpts) (common.Address, error) + + TypeAndVersion(opts *bind.CallOpts) (string, error) + + AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) + + ApplyAllowListUpdates(opts *bind.TransactOpts, removes []common.Address, adds []common.Address) (*types.Transaction, error) + + ApplyPoolUpdates(opts *bind.TransactOpts, removes []InternalPoolUpdate, adds []InternalPoolUpdate) (*types.Transaction, error) + + ForwardFromRouter(opts *bind.TransactOpts, message ClientEVM2AnyMessage, feeTokenAmount *big.Int, originalSender common.Address) (*types.Transaction, error) + + PayNops(opts *bind.TransactOpts) (*types.Transaction, error) + + SetAdmin(opts *bind.TransactOpts, newAdmin common.Address) (*types.Transaction, error) + + SetAllowListEnabled(opts *bind.TransactOpts, enabled bool) (*types.Transaction, error) + + SetDynamicConfig(opts *bind.TransactOpts, dynamicConfig EVM2EVMOnRampDynamicConfig) (*types.Transaction, error) + + SetFeeTokenConfig(opts *bind.TransactOpts, feeTokenConfigArgs []EVM2EVMOnRampFeeTokenConfigArgs) (*types.Transaction, error) + + SetNops(opts *bind.TransactOpts, nopsAndWeights []EVM2EVMOnRampNopAndWeight) (*types.Transaction, error) + + SetRateLimiterConfig(opts *bind.TransactOpts, config RateLimiterConfig) (*types.Transaction, error) + + SetTokenTransferFeeConfig(opts *bind.TransactOpts, tokenTransferFeeConfigArgs []EVM2EVMOnRampTokenTransferFeeConfigArgs) (*types.Transaction, error) + + TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) + + WithdrawNonLinkFees(opts *bind.TransactOpts, feeToken common.Address, to common.Address) (*types.Transaction, error) + + FilterAdminSet(opts *bind.FilterOpts) (*EVM2EVMOnRampAdminSetIterator, error) + + WatchAdminSet(opts *bind.WatchOpts, sink chan<- *EVM2EVMOnRampAdminSet) (event.Subscription, error) + + ParseAdminSet(log types.Log) (*EVM2EVMOnRampAdminSet, error) + + FilterAllowListAdd(opts *bind.FilterOpts) (*EVM2EVMOnRampAllowListAddIterator, error) + + WatchAllowListAdd(opts *bind.WatchOpts, sink chan<- *EVM2EVMOnRampAllowListAdd) (event.Subscription, error) + + ParseAllowListAdd(log types.Log) (*EVM2EVMOnRampAllowListAdd, error) + + FilterAllowListEnabledSet(opts *bind.FilterOpts) (*EVM2EVMOnRampAllowListEnabledSetIterator, error) + + WatchAllowListEnabledSet(opts *bind.WatchOpts, sink chan<- *EVM2EVMOnRampAllowListEnabledSet) (event.Subscription, error) + + ParseAllowListEnabledSet(log types.Log) (*EVM2EVMOnRampAllowListEnabledSet, error) + + FilterAllowListRemove(opts *bind.FilterOpts) (*EVM2EVMOnRampAllowListRemoveIterator, error) + + WatchAllowListRemove(opts *bind.WatchOpts, sink chan<- *EVM2EVMOnRampAllowListRemove) (event.Subscription, error) + + ParseAllowListRemove(log types.Log) (*EVM2EVMOnRampAllowListRemove, error) + + FilterCCIPSendRequested(opts *bind.FilterOpts) (*EVM2EVMOnRampCCIPSendRequestedIterator, error) + + WatchCCIPSendRequested(opts *bind.WatchOpts, sink chan<- *EVM2EVMOnRampCCIPSendRequested) (event.Subscription, error) + + ParseCCIPSendRequested(log types.Log) (*EVM2EVMOnRampCCIPSendRequested, error) + + FilterConfigSet(opts *bind.FilterOpts) (*EVM2EVMOnRampConfigSetIterator, error) + + WatchConfigSet(opts *bind.WatchOpts, sink chan<- *EVM2EVMOnRampConfigSet) (event.Subscription, error) + + ParseConfigSet(log types.Log) (*EVM2EVMOnRampConfigSet, error) + + FilterFeeConfigSet(opts *bind.FilterOpts) (*EVM2EVMOnRampFeeConfigSetIterator, error) + + WatchFeeConfigSet(opts *bind.WatchOpts, sink chan<- *EVM2EVMOnRampFeeConfigSet) (event.Subscription, error) + + ParseFeeConfigSet(log types.Log) (*EVM2EVMOnRampFeeConfigSet, error) + + FilterNopPaid(opts *bind.FilterOpts, nop []common.Address) (*EVM2EVMOnRampNopPaidIterator, error) + + WatchNopPaid(opts *bind.WatchOpts, sink chan<- *EVM2EVMOnRampNopPaid, nop []common.Address) (event.Subscription, error) + + ParseNopPaid(log types.Log) (*EVM2EVMOnRampNopPaid, error) + + FilterNopsSet(opts *bind.FilterOpts) (*EVM2EVMOnRampNopsSetIterator, error) + + WatchNopsSet(opts *bind.WatchOpts, sink chan<- *EVM2EVMOnRampNopsSet) (event.Subscription, error) + + ParseNopsSet(log types.Log) (*EVM2EVMOnRampNopsSet, error) + + FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*EVM2EVMOnRampOwnershipTransferRequestedIterator, error) + + WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *EVM2EVMOnRampOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferRequested(log types.Log) (*EVM2EVMOnRampOwnershipTransferRequested, error) + + FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*EVM2EVMOnRampOwnershipTransferredIterator, error) + + WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *EVM2EVMOnRampOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferred(log types.Log) (*EVM2EVMOnRampOwnershipTransferred, error) + + FilterPoolAdded(opts *bind.FilterOpts) (*EVM2EVMOnRampPoolAddedIterator, error) + + WatchPoolAdded(opts *bind.WatchOpts, sink chan<- *EVM2EVMOnRampPoolAdded) (event.Subscription, error) + + ParsePoolAdded(log types.Log) (*EVM2EVMOnRampPoolAdded, error) + + FilterPoolRemoved(opts *bind.FilterOpts) (*EVM2EVMOnRampPoolRemovedIterator, error) + + WatchPoolRemoved(opts *bind.WatchOpts, sink chan<- *EVM2EVMOnRampPoolRemoved) (event.Subscription, error) + + ParsePoolRemoved(log types.Log) (*EVM2EVMOnRampPoolRemoved, error) + + FilterTokenTransferFeeConfigSet(opts *bind.FilterOpts) (*EVM2EVMOnRampTokenTransferFeeConfigSetIterator, error) + + WatchTokenTransferFeeConfigSet(opts *bind.WatchOpts, sink chan<- *EVM2EVMOnRampTokenTransferFeeConfigSet) (event.Subscription, error) + + ParseTokenTransferFeeConfigSet(log types.Log) (*EVM2EVMOnRampTokenTransferFeeConfigSet, error) + + ParseLog(log types.Log) (generated.AbigenLog, error) + + Address() common.Address +} diff --git a/core/gethwrappers/ccip/generated/evm_2_evm_onramp_1_2_0/evm_2_evm_onramp_1_2_0.go b/core/gethwrappers/ccip/generated/evm_2_evm_onramp_1_2_0/evm_2_evm_onramp_1_2_0.go new file mode 100644 index 00000000000..8c652e140d3 --- /dev/null +++ b/core/gethwrappers/ccip/generated/evm_2_evm_onramp_1_2_0/evm_2_evm_onramp_1_2_0.go @@ -0,0 +1,2337 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package evm_2_evm_onramp_1_2_0 + +import ( + "errors" + "fmt" + "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" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" +) + +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +type ClientEVM2AnyMessage struct { + Receiver []byte + Data []byte + TokenAmounts []ClientEVMTokenAmount + FeeToken common.Address + ExtraArgs []byte +} + +type ClientEVMTokenAmount struct { + Token common.Address + Amount *big.Int +} + +type EVM2EVMOnRampDynamicConfig struct { + Router common.Address + MaxNumberOfTokensPerMsg uint16 + DestGasOverhead uint32 + DestGasPerPayloadByte uint16 + DestDataAvailabilityOverheadGas uint32 + DestGasPerDataAvailabilityByte uint16 + DestDataAvailabilityMultiplierBps uint16 + PriceRegistry common.Address + MaxDataBytes uint32 + MaxPerMsgGasLimit uint32 +} + +type EVM2EVMOnRampFeeTokenConfig struct { + NetworkFeeUSDCents uint32 + GasMultiplierWeiPerEth uint64 + PremiumMultiplierWeiPerEth uint64 + Enabled bool +} + +type EVM2EVMOnRampFeeTokenConfigArgs struct { + Token common.Address + NetworkFeeUSDCents uint32 + GasMultiplierWeiPerEth uint64 + PremiumMultiplierWeiPerEth uint64 + Enabled bool +} + +type EVM2EVMOnRampNopAndWeight struct { + Nop common.Address + Weight uint16 +} + +type EVM2EVMOnRampStaticConfig struct { + LinkToken common.Address + ChainSelector uint64 + DestChainSelector uint64 + DefaultTxGasLimit uint64 + MaxNopFeesJuels *big.Int + PrevOnRamp common.Address + ArmProxy common.Address +} + +type EVM2EVMOnRampTokenTransferFeeConfig struct { + MinFeeUSDCents uint32 + MaxFeeUSDCents uint32 + DeciBps uint16 + DestGasOverhead uint32 + DestBytesOverhead uint32 +} + +type EVM2EVMOnRampTokenTransferFeeConfigArgs struct { + Token common.Address + MinFeeUSDCents uint32 + MaxFeeUSDCents uint32 + DeciBps uint16 + DestGasOverhead uint32 + DestBytesOverhead uint32 +} + +type InternalEVM2EVMMessage struct { + SourceChainSelector uint64 + Sender common.Address + Receiver common.Address + SequenceNumber uint64 + GasLimit *big.Int + Strict bool + Nonce uint64 + FeeToken common.Address + FeeTokenAmount *big.Int + Data []byte + TokenAmounts []ClientEVMTokenAmount + SourceTokenData [][]byte + MessageId [32]byte +} + +type InternalPoolUpdate struct { + Token common.Address + Pool common.Address +} + +type RateLimiterConfig struct { + IsEnabled bool + Capacity *big.Int + Rate *big.Int +} + +type RateLimiterTokenBucket struct { + Tokens *big.Int + LastUpdated uint32 + IsEnabled bool + Capacity *big.Int + Rate *big.Int +} + +var EVM2EVMOnRampMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"linkToken\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"defaultTxGasLimit\",\"type\":\"uint64\"},{\"internalType\":\"uint96\",\"name\":\"maxNopFeesJuels\",\"type\":\"uint96\"},{\"internalType\":\"address\",\"name\":\"prevOnRamp\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"armProxy\",\"type\":\"address\"}],\"internalType\":\"structEVM2EVMOnRamp.StaticConfig\",\"name\":\"staticConfig\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"router\",\"type\":\"address\"},{\"internalType\":\"uint16\",\"name\":\"maxNumberOfTokensPerMsg\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"destGasOverhead\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"destGasPerPayloadByte\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"destDataAvailabilityOverheadGas\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"destGasPerDataAvailabilityByte\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"destDataAvailabilityMultiplierBps\",\"type\":\"uint16\"},{\"internalType\":\"address\",\"name\":\"priceRegistry\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"maxDataBytes\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"maxPerMsgGasLimit\",\"type\":\"uint32\"}],\"internalType\":\"structEVM2EVMOnRamp.DynamicConfig\",\"name\":\"dynamicConfig\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"internalType\":\"structInternal.PoolUpdate[]\",\"name\":\"tokensAndPools\",\"type\":\"tuple[]\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"rateLimiterConfig\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"networkFeeUSDCents\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"gasMultiplierWeiPerEth\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"premiumMultiplierWeiPerEth\",\"type\":\"uint64\"},{\"internalType\":\"bool\",\"name\":\"enabled\",\"type\":\"bool\"}],\"internalType\":\"structEVM2EVMOnRamp.FeeTokenConfigArgs[]\",\"name\":\"feeTokenConfigs\",\"type\":\"tuple[]\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"minFeeUSDCents\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"maxFeeUSDCents\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"deciBps\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"destGasOverhead\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"destBytesOverhead\",\"type\":\"uint32\"}],\"internalType\":\"structEVM2EVMOnRamp.TokenTransferFeeConfigArgs[]\",\"name\":\"tokenTransferFeeConfigArgs\",\"type\":\"tuple[]\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"nop\",\"type\":\"address\"},{\"internalType\":\"uint16\",\"name\":\"weight\",\"type\":\"uint16\"}],\"internalType\":\"structEVM2EVMOnRamp.NopAndWeight[]\",\"name\":\"nopsAndWeights\",\"type\":\"tuple[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"capacity\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"requested\",\"type\":\"uint256\"}],\"name\":\"AggregateValueMaxCapacityExceeded\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"minWaitInSeconds\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"available\",\"type\":\"uint256\"}],\"name\":\"AggregateValueRateLimitReached\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"BadARMSignal\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"BucketOverfilled\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"CannotSendZeroTokens\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InsufficientBalance\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"encodedAddress\",\"type\":\"bytes\"}],\"name\":\"InvalidAddress\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"}],\"name\":\"InvalidChainSelector\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidConfig\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidExtraArgsTag\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"nop\",\"type\":\"address\"}],\"name\":\"InvalidNopAddress\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidTokenPoolConfig\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidWithdrawParams\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"LinkBalanceNotSettled\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"MaxFeeBalanceReached\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"MessageGasLimitTooHigh\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"maxSize\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"actualSize\",\"type\":\"uint256\"}],\"name\":\"MessageTooLarge\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"MustBeCalledByRouter\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NoFeesToPay\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NoNopsToPay\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"NotAFeeToken\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCallableByAdminOrOwner\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCallableByOwnerOrAdmin\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCallableByOwnerOrAdminOrNop\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"PoolAlreadyAdded\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"PoolDoesNotExist\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"PriceNotFoundForToken\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RouterMustSetOriginalSender\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"SourceTokenDataTooLarge\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"capacity\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"requested\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"}],\"name\":\"TokenMaxCapacityExceeded\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TokenPoolMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"minWaitInSeconds\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"available\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"}],\"name\":\"TokenRateLimitReached\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TooManyNops\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UnsupportedNumberOfTokens\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"contractIERC20\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"UnsupportedToken\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"sequenceNumber\",\"type\":\"uint64\"},{\"internalType\":\"uint256\",\"name\":\"gasLimit\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"strict\",\"type\":\"bool\"},{\"internalType\":\"uint64\",\"name\":\"nonce\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"feeToken\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"feeTokenAmount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"internalType\":\"structClient.EVMTokenAmount[]\",\"name\":\"tokenAmounts\",\"type\":\"tuple[]\"},{\"internalType\":\"bytes[]\",\"name\":\"sourceTokenData\",\"type\":\"bytes[]\"},{\"internalType\":\"bytes32\",\"name\":\"messageId\",\"type\":\"bytes32\"}],\"indexed\":false,\"internalType\":\"structInternal.EVM2EVMMessage\",\"name\":\"message\",\"type\":\"tuple\"}],\"name\":\"CCIPSendRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"linkToken\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"defaultTxGasLimit\",\"type\":\"uint64\"},{\"internalType\":\"uint96\",\"name\":\"maxNopFeesJuels\",\"type\":\"uint96\"},{\"internalType\":\"address\",\"name\":\"prevOnRamp\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"armProxy\",\"type\":\"address\"}],\"indexed\":false,\"internalType\":\"structEVM2EVMOnRamp.StaticConfig\",\"name\":\"staticConfig\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"router\",\"type\":\"address\"},{\"internalType\":\"uint16\",\"name\":\"maxNumberOfTokensPerMsg\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"destGasOverhead\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"destGasPerPayloadByte\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"destDataAvailabilityOverheadGas\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"destGasPerDataAvailabilityByte\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"destDataAvailabilityMultiplierBps\",\"type\":\"uint16\"},{\"internalType\":\"address\",\"name\":\"priceRegistry\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"maxDataBytes\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"maxPerMsgGasLimit\",\"type\":\"uint32\"}],\"indexed\":false,\"internalType\":\"structEVM2EVMOnRamp.DynamicConfig\",\"name\":\"dynamicConfig\",\"type\":\"tuple\"}],\"name\":\"ConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"networkFeeUSDCents\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"gasMultiplierWeiPerEth\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"premiumMultiplierWeiPerEth\",\"type\":\"uint64\"},{\"internalType\":\"bool\",\"name\":\"enabled\",\"type\":\"bool\"}],\"indexed\":false,\"internalType\":\"structEVM2EVMOnRamp.FeeTokenConfigArgs[]\",\"name\":\"feeConfig\",\"type\":\"tuple[]\"}],\"name\":\"FeeConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"nop\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"NopPaid\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"nopWeightsTotal\",\"type\":\"uint256\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"nop\",\"type\":\"address\"},{\"internalType\":\"uint16\",\"name\":\"weight\",\"type\":\"uint16\"}],\"indexed\":false,\"internalType\":\"structEVM2EVMOnRamp.NopAndWeight[]\",\"name\":\"nopsAndWeights\",\"type\":\"tuple[]\"}],\"name\":\"NopsSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"name\":\"PoolAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"name\":\"PoolRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"minFeeUSDCents\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"maxFeeUSDCents\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"deciBps\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"destGasOverhead\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"destBytesOverhead\",\"type\":\"uint32\"}],\"indexed\":false,\"internalType\":\"structEVM2EVMOnRamp.TokenTransferFeeConfigArgs[]\",\"name\":\"transferFeeConfig\",\"type\":\"tuple[]\"}],\"name\":\"TokenTransferFeeConfigSet\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"internalType\":\"structInternal.PoolUpdate[]\",\"name\":\"removes\",\"type\":\"tuple[]\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"internalType\":\"structInternal.PoolUpdate[]\",\"name\":\"adds\",\"type\":\"tuple[]\"}],\"name\":\"applyPoolUpdates\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"currentRateLimiterState\",\"outputs\":[{\"components\":[{\"internalType\":\"uint128\",\"name\":\"tokens\",\"type\":\"uint128\"},{\"internalType\":\"uint32\",\"name\":\"lastUpdated\",\"type\":\"uint32\"},{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.TokenBucket\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"},{\"components\":[{\"internalType\":\"bytes\",\"name\":\"receiver\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"internalType\":\"structClient.EVMTokenAmount[]\",\"name\":\"tokenAmounts\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"feeToken\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"extraArgs\",\"type\":\"bytes\"}],\"internalType\":\"structClient.EVM2AnyMessage\",\"name\":\"message\",\"type\":\"tuple\"},{\"internalType\":\"uint256\",\"name\":\"feeTokenAmount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"originalSender\",\"type\":\"address\"}],\"name\":\"forwardFromRouter\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getDynamicConfig\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"router\",\"type\":\"address\"},{\"internalType\":\"uint16\",\"name\":\"maxNumberOfTokensPerMsg\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"destGasOverhead\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"destGasPerPayloadByte\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"destDataAvailabilityOverheadGas\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"destGasPerDataAvailabilityByte\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"destDataAvailabilityMultiplierBps\",\"type\":\"uint16\"},{\"internalType\":\"address\",\"name\":\"priceRegistry\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"maxDataBytes\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"maxPerMsgGasLimit\",\"type\":\"uint32\"}],\"internalType\":\"structEVM2EVMOnRamp.DynamicConfig\",\"name\":\"dynamicConfig\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getExpectedNextSequenceNumber\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"},{\"components\":[{\"internalType\":\"bytes\",\"name\":\"receiver\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"internalType\":\"structClient.EVMTokenAmount[]\",\"name\":\"tokenAmounts\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"feeToken\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"extraArgs\",\"type\":\"bytes\"}],\"internalType\":\"structClient.EVM2AnyMessage\",\"name\":\"message\",\"type\":\"tuple\"}],\"name\":\"getFee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"feeTokenAmount\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"getFeeTokenConfig\",\"outputs\":[{\"components\":[{\"internalType\":\"uint32\",\"name\":\"networkFeeUSDCents\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"gasMultiplierWeiPerEth\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"premiumMultiplierWeiPerEth\",\"type\":\"uint64\"},{\"internalType\":\"bool\",\"name\":\"enabled\",\"type\":\"bool\"}],\"internalType\":\"structEVM2EVMOnRamp.FeeTokenConfig\",\"name\":\"feeTokenConfig\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getNopFeesJuels\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"\",\"type\":\"uint96\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getNops\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"nop\",\"type\":\"address\"},{\"internalType\":\"uint16\",\"name\":\"weight\",\"type\":\"uint16\"}],\"internalType\":\"structEVM2EVMOnRamp.NopAndWeight[]\",\"name\":\"nopsAndWeights\",\"type\":\"tuple[]\"},{\"internalType\":\"uint256\",\"name\":\"weightsTotal\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"},{\"internalType\":\"contractIERC20\",\"name\":\"sourceToken\",\"type\":\"address\"}],\"name\":\"getPoolBySourceToken\",\"outputs\":[{\"internalType\":\"contractIPool\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"getSenderNonce\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getStaticConfig\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"linkToken\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"defaultTxGasLimit\",\"type\":\"uint64\"},{\"internalType\":\"uint96\",\"name\":\"maxNopFeesJuels\",\"type\":\"uint96\"},{\"internalType\":\"address\",\"name\":\"prevOnRamp\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"armProxy\",\"type\":\"address\"}],\"internalType\":\"structEVM2EVMOnRamp.StaticConfig\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"name\":\"getSupportedTokens\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getTokenLimitAdmin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"getTokenTransferFeeConfig\",\"outputs\":[{\"components\":[{\"internalType\":\"uint32\",\"name\":\"minFeeUSDCents\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"maxFeeUSDCents\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"deciBps\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"destGasOverhead\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"destBytesOverhead\",\"type\":\"uint32\"}],\"internalType\":\"structEVM2EVMOnRamp.TokenTransferFeeConfig\",\"name\":\"tokenTransferFeeConfig\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"linkAvailableForPayment\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"payNops\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"setAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"router\",\"type\":\"address\"},{\"internalType\":\"uint16\",\"name\":\"maxNumberOfTokensPerMsg\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"destGasOverhead\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"destGasPerPayloadByte\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"destDataAvailabilityOverheadGas\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"destGasPerDataAvailabilityByte\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"destDataAvailabilityMultiplierBps\",\"type\":\"uint16\"},{\"internalType\":\"address\",\"name\":\"priceRegistry\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"maxDataBytes\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"maxPerMsgGasLimit\",\"type\":\"uint32\"}],\"internalType\":\"structEVM2EVMOnRamp.DynamicConfig\",\"name\":\"dynamicConfig\",\"type\":\"tuple\"}],\"name\":\"setDynamicConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"networkFeeUSDCents\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"gasMultiplierWeiPerEth\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"premiumMultiplierWeiPerEth\",\"type\":\"uint64\"},{\"internalType\":\"bool\",\"name\":\"enabled\",\"type\":\"bool\"}],\"internalType\":\"structEVM2EVMOnRamp.FeeTokenConfigArgs[]\",\"name\":\"feeTokenConfigArgs\",\"type\":\"tuple[]\"}],\"name\":\"setFeeTokenConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"nop\",\"type\":\"address\"},{\"internalType\":\"uint16\",\"name\":\"weight\",\"type\":\"uint16\"}],\"internalType\":\"structEVM2EVMOnRamp.NopAndWeight[]\",\"name\":\"nopsAndWeights\",\"type\":\"tuple[]\"}],\"name\":\"setNops\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"config\",\"type\":\"tuple\"}],\"name\":\"setRateLimiterConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"minFeeUSDCents\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"maxFeeUSDCents\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"deciBps\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"destGasOverhead\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"destBytesOverhead\",\"type\":\"uint32\"}],\"internalType\":\"structEVM2EVMOnRamp.TokenTransferFeeConfigArgs[]\",\"name\":\"tokenTransferFeeConfigArgs\",\"type\":\"tuple[]\"}],\"name\":\"setTokenTransferFeeConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"feeToken\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"withdrawNonLinkFees\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", + Bin: "0x6101806040523480156200001257600080fd5b506040516200849a3803806200849a833981016040819052620000359162001e40565b8333806000816200008d5760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000c057620000c08162000323565b50506040805160a081018252602084810180516001600160801b039081168085524263ffffffff169385018490528751151585870181905292518216606086018190529790950151166080909301839052600380546001600160a01b031916909417600160801b9283021760ff60a01b1916600160a01b90910217909255029091176004555086516001600160a01b0316158062000169575060208701516001600160401b0316155b8062000180575060408701516001600160401b0316155b8062000197575060608701516001600160401b0316155b80620001ae575060c08701516001600160a01b0316155b15620001cd576040516306b7c75960e31b815260040160405180910390fd5b6020808801516040808a015181517f8acd72527118c8324937b1a42e02cd246697c3b633f1742f3cae11de233722b3948101949094526001600160401b039283169184019190915216606082015230608082015260a00160408051601f198184030181529181528151602092830120608090815289516001600160a01b0390811660e052928a01516001600160401b0390811661010052918a015182166101205260608a015190911660a0908152908901516001600160601b031660c0908152908901518216610140528801511661016052620002aa86620003ce565b620002b58362000645565b620002c0826200077f565b620002cb81620008e5565b6040805160008082526020820190925262000316916200030e565b6040805180820190915260008082526020820152815260200190600190039081620002e65790505b508662000b0f565b505050505050506200241a565b336001600160a01b038216036200037d5760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640162000084565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b60e08101516001600160a01b0316620003fa576040516306b7c75960e31b815260040160405180910390fd5b80600560008201518160000160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060208201518160000160146101000a81548161ffff021916908361ffff16021790555060408201518160000160166101000a81548163ffffffff021916908363ffffffff160217905550606082015181600001601a6101000a81548161ffff021916908361ffff160217905550608082015181600001601c6101000a81548163ffffffff021916908363ffffffff16021790555060a08201518160010160006101000a81548161ffff021916908361ffff16021790555060c08201518160010160026101000a81548161ffff021916908361ffff16021790555060e08201518160010160046101000a8154816001600160a01b0302191690836001600160a01b031602179055506101008201518160010160186101000a81548163ffffffff021916908363ffffffff16021790555061012082015181600101601c6101000a81548163ffffffff021916908363ffffffff1602179055509050507f2a57f7c2027cf032c78b77d4d8d2fbd20ad22e5d5e5b5fb23ac7d7820d44adc66040518060e0016040528060e0516001600160a01b03168152602001610100516001600160401b03168152602001610120516001600160401b0316815260200160a0516001600160401b0316815260200160c0516001600160601b03168152602001610140516001600160a01b03168152602001610160516001600160a01b0316815250826040516200063a92919062002015565b60405180910390a150565b60005b81518110156200074d57600082828151811062000669576200066962002095565b60209081029190910181015160408051608080820183528385015163ffffffff9081168352838501516001600160401b03908116848801908152606080880151831686880190815294880151151590860190815296516001600160a01b03166000908152600d90985294909620925183549451925195511515600160a01b0260ff60a01b199688166c010000000000000000000000000296909616600160601b600160a81b031993909716640100000000026001600160601b0319909516911617929092179190911692909217179055506200074581620020c1565b905062000648565b507f067924bf9277d905a9a4631a06d959bc032ace86b3caa835ae7e403d4f39010e816040516200063a9190620020dd565b60005b8151811015620008b3576000828281518110620007a357620007a362002095565b6020908102919091018101516040805160a080820183528385015163ffffffff908116835283850151811683870190815260608087015161ffff9081168688019081526080808a0151861693880193845295890151851695870195865297516001600160a01b03166000908152600e909952959097209351845491519651975193518316600160701b0263ffffffff60701b199484166a01000000000000000000000263ffffffff60501b199990971668010000000000000000029890981665ffffffffffff60401b19978416640100000000026001600160401b03199093169190931617179490941693909317919091179190911691909117905550620008ab81620020c1565b905062000782565b507f555c74101f7a15746d31c6731170310e667bcc607996b2fc0b981a7b26a416e9816040516200063a91906200216c565b805160408111156200090a57604051635ad0867d60e11b815260040160405180910390fd5b6010546c01000000000000000000000000900463ffffffff161580159062000954575060105463ffffffff6c010000000000000000000000008204166001600160601b0390911610155b1562000964576200096462000e12565b600062000972600762001012565b90505b8015620009be576000620009986200098f600184620021f3565b60079062001025565b509050620009a860078262001043565b505080620009b69062002209565b905062000975565b506000805b8281101562000aa6576000848281518110620009e357620009e362002095565b6020026020010151600001519050600085838151811062000a085762000a0862002095565b602002602001015160200151905060e0516001600160a01b0316826001600160a01b0316148062000a4057506001600160a01b038216155b1562000a6b57604051634de938d160e01b81526001600160a01b038316600482015260240162000084565b62000a7d60078361ffff841662001061565b5062000a8e61ffff82168562002223565b935050508062000a9e90620020c1565b9050620009c3565b506010805463ffffffff60601b19166c0100000000000000000000000063ffffffff8416021790556040517f8c337bff38141c507abd25c547606bdde78fe8c12e941ab613f3a565fea6cd249062000b02908390869062002243565b60405180910390a1505050565b60005b825181101562000c4b57600083828151811062000b335762000b3362002095565b6020026020010151600001519050600084838151811062000b585762000b5862002095565b6020908102919091018101510151905062000b75600a8362001081565b62000b9f576040516373913ebd60e01b81526001600160a01b038316600482015260240162000084565b6001600160a01b03811662000bb6600a8462001098565b6001600160a01b03161462000bde57604051630d98f73360e31b815260040160405180910390fd5b62000beb600a83620010af565b1562000c3557604080516001600160a01b038085168252831660208201527f987eb3c2f78454541205f72f34839b434c306c9eaf4922efd7c0c3060fdb2e4c910160405180910390a15b50508062000c4390620020c1565b905062000b12565b5060005b815181101562000e0d57600082828151811062000c705762000c7062002095565b6020026020010151600001519050600083838151811062000c955762000c9562002095565b602002602001015160200151905060006001600160a01b0316826001600160a01b0316148062000ccc57506001600160a01b038116155b1562000cea5760405162d8548360e71b815260040160405180910390fd5b806001600160a01b03166321df0da76040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000d29573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000d4f9190620022b0565b6001600160a01b0316826001600160a01b03161462000d8157604051630d98f73360e31b815260040160405180910390fd5b62000d8f600a8383620010c6565b1562000dde57604080516001600160a01b038085168252831660208201527f95f865c2808f8b2a85eea2611db7843150ee7835ef1403f9755918a97d76933c910160405180910390a162000df7565b604051633caf458560e01b815260040160405180910390fd5b50508062000e0590620020c1565b905062000c4f565b505050565b6000546001600160a01b0316331480159062000e3957506002546001600160a01b03163314155b801562000e50575062000e4e600733620010de565b155b1562000e6f5760405163032bb72b60e31b815260040160405180910390fd5b6010546c01000000000000000000000000900463ffffffff16600081900362000eab5760405163990e30bf60e01b815260040160405180910390fd5b6010546001600160601b03168181101562000ed9576040516311a1ee3b60e31b815260040160405180910390fd5b600062000ee5620010f5565b121562000f0557604051631e9acf1760e31b815260040160405180910390fd5b80600062000f14600762001012565b905060005b8181101562000fec5760008062000f3260078462001025565b909250905060008762000f4f836001600160601b038a16620022d0565b62000f5b9190620022ea565b905062000f6981876200230d565b60e05190965062000f8e906001600160a01b0316846001600160601b03841662001183565b6040516001600160601b03821681526001600160a01b038416907f55fdec2aab60a41fa5abb106670eb1006f5aeaee1ba7afea2bc89b5b3ec7678f9060200160405180910390a25050508062000fe490620020c1565b905062000f19565b5050601080546001600160601b0319166001600160601b03929092169190911790555050565b60006200101f82620011db565b92915050565b6000808080620010368686620011e8565b9097909650945050505050565b60006200105a836001600160a01b03841662001215565b9392505050565b600062001079846001600160a01b0385168462001234565b949350505050565b60006200105a836001600160a01b03841662001253565b60006200105a836001600160a01b03841662001261565b60006200105a836001600160a01b0384166200126f565b600062001079846001600160a01b038516846200127d565b60006200105a836001600160a01b03841662001295565b60105460e0516040516370a0823160e01b81523060048201526000926001600160601b0316916001600160a01b0316906370a0823190602401602060405180830381865afa1580156200114c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062001172919062002330565b6200117e91906200234a565b905090565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b0390811663a9059cbb60e01b1790915262000e0d918591620012a316565b60006200101f8262001374565b60008080620011f885856200137f565b600081815260029690960160205260409095205494959350505050565b600081815260028301602052604081208190556200105a83836200138d565b600082815260028401602052604081208290556200107984846200139b565b60006200105a838362001295565b60006200105a8383620013a9565b60006200105a838362001215565b60006200107984846001600160a01b03851662001234565b60006200105a83836200141e565b6040805180820190915260208082527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c656490820152600090620012f2906001600160a01b03851690849062001437565b80519091501562000e0d57808060200190518101906200131391906200236d565b62000e0d5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840162000084565b60006200101f825490565b60006200105a838362001448565b60006200105a838362001475565b60006200105a838362001580565b600081815260028301602052604081205480151580620013d05750620013d0848462001295565b6200105a5760405162461bcd60e51b815260206004820152601e60248201527f456e756d657261626c654d61703a206e6f6e6578697374656e74206b65790000604482015260640162000084565b600081815260018301602052604081205415156200105a565b6060620010798484600085620015d2565b600082600001828154811062001462576200146262002095565b9060005260206000200154905092915050565b600081815260018301602052604081205480156200156e5760006200149c600183620021f3565b8554909150600090620014b290600190620021f3565b90508181146200151e576000866000018281548110620014d657620014d662002095565b9060005260206000200154905080876000018481548110620014fc57620014fc62002095565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806200153257620015326200238b565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506200101f565b60009150506200101f565b5092915050565b6000818152600183016020526040812054620015c9575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556200101f565b5060006200101f565b606082471015620016355760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840162000084565b600080866001600160a01b03168587604051620016539190620023c7565b60006040518083038185875af1925050503d806000811462001692576040519150601f19603f3d011682016040523d82523d6000602084013e62001697565b606091505b509092509050620016ab87838387620016b6565b979650505050505050565b606083156200172a57825160000362001722576001600160a01b0385163b620017225760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640162000084565b508162001079565b620010798383815115620017415781518083602001fd5b8060405162461bcd60e51b8152600401620000849190620023e5565b634e487b7160e01b600052604160045260246000fd5b60405160e081016001600160401b03811182821017156200179857620017986200175d565b60405290565b60405161014081016001600160401b03811182821017156200179857620017986200175d565b604080519081016001600160401b03811182821017156200179857620017986200175d565b60405160a081016001600160401b03811182821017156200179857620017986200175d565b60405160c081016001600160401b03811182821017156200179857620017986200175d565b604051601f8201601f191681016001600160401b03811182821017156200185e576200185e6200175d565b604052919050565b6001600160a01b03811681146200187c57600080fd5b50565b80516200188c8162001866565b919050565b80516001600160401b03811681146200188c57600080fd5b600060e08284031215620018bc57600080fd5b620018c662001773565b90508151620018d58162001866565b8152620018e56020830162001891565b6020820152620018f86040830162001891565b60408201526200190b6060830162001891565b606082015260808201516001600160601b03811681146200192b57600080fd5b60808201526200193e60a083016200187f565b60a08201526200195160c083016200187f565b60c082015292915050565b805161ffff811681146200188c57600080fd5b805163ffffffff811681146200188c57600080fd5b600061014082840312156200199857600080fd5b620019a26200179e565b9050620019af826200187f565b8152620019bf602083016200195c565b6020820152620019d2604083016200196f565b6040820152620019e5606083016200195c565b6060820152620019f8608083016200196f565b608082015262001a0b60a083016200195c565b60a082015262001a1e60c083016200195c565b60c082015262001a3160e083016200187f565b60e082015261010062001a468184016200196f565b9082015261012062001a5a8382016200196f565b9082015292915050565b60006001600160401b0382111562001a805762001a806200175d565b5060051b60200190565b600082601f83011262001a9c57600080fd5b8151602062001ab562001aaf8362001a64565b62001833565b82815260069290921b8401810191818101908684111562001ad557600080fd5b8286015b8481101562001b2f576040818903121562001af45760008081fd5b62001afe620017c4565b815162001b0b8162001866565b81528185015162001b1c8162001866565b8186015283529183019160400162001ad9565b509695505050505050565b805180151581146200188c57600080fd5b80516001600160801b03811681146200188c57600080fd5b60006060828403121562001b7657600080fd5b604051606081016001600160401b038111828210171562001b9b5762001b9b6200175d565b60405290508062001bac8362001b3a565b815262001bbc6020840162001b4b565b602082015262001bcf6040840162001b4b565b60408201525092915050565b600082601f83011262001bed57600080fd5b8151602062001c0062001aaf8362001a64565b82815260a0928302850182019282820191908785111562001c2057600080fd5b8387015b8581101562001caf5781818a03121562001c3e5760008081fd5b62001c48620017e9565b815162001c558162001866565b815262001c648287016200196f565b86820152604062001c7781840162001891565b90820152606062001c8a83820162001891565b90820152608062001c9d83820162001b3a565b90820152845292840192810162001c24565b5090979650505050505050565b600082601f83011262001cce57600080fd5b8151602062001ce162001aaf8362001a64565b82815260c0928302850182019282820191908785111562001d0157600080fd5b8387015b8581101562001caf5781818a03121562001d1f5760008081fd5b62001d296200180e565b815162001d368162001866565b815262001d458287016200196f565b86820152604062001d588184016200196f565b90820152606062001d6b8382016200195c565b90820152608062001d7e8382016200196f565b9082015260a062001d918382016200196f565b90820152845292840192810162001d05565b600082601f83011262001db557600080fd5b8151602062001dc862001aaf8362001a64565b82815260069290921b8401810191818101908684111562001de857600080fd5b8286015b8481101562001b2f576040818903121562001e075760008081fd5b62001e11620017c4565b815162001e1e8162001866565b815262001e2d8286016200195c565b8186015283529183019160400162001dec565b6000806000806000806000610300888a03121562001e5d57600080fd5b62001e698989620018a9565b965062001e7a8960e08a0162001984565b6102208901519096506001600160401b038082111562001e9957600080fd5b62001ea78b838c0162001a8a565b965062001eb98b6102408c0162001b63565b95506102a08a015191508082111562001ed157600080fd5b62001edf8b838c0162001bdb565b94506102c08a015191508082111562001ef757600080fd5b62001f058b838c0162001cbc565b93506102e08a015191508082111562001f1d57600080fd5b5062001f2c8a828b0162001da3565b91505092959891949750929550565b80516001600160a01b03168252602081015162001f5e602084018261ffff169052565b50604081015162001f77604084018263ffffffff169052565b50606081015162001f8e606084018261ffff169052565b50608081015162001fa7608084018263ffffffff169052565b5060a081015162001fbe60a084018261ffff169052565b5060c081015162001fd560c084018261ffff169052565b5060e081015162001ff160e08401826001600160a01b03169052565b506101008181015163ffffffff908116918401919091526101209182015116910152565b82516001600160a01b0390811682526020808501516001600160401b0390811691840191909152604080860151821690840152606080860151909116908301526080808501516001600160601b03169083015260a08085015182169083015260c0808501519091169082015261022081016200105a60e083018462001f3b565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201620020d657620020d6620020ab565b5060010190565b602080825282518282018190526000919060409081850190868401855b828110156200215f57815180516001600160a01b031685528681015163ffffffff1687860152858101516001600160401b03908116878701526060808301519091169086015260809081015115159085015260a09093019290850190600101620020fa565b5091979650505050505050565b602080825282518282018190526000919060409081850190868401855b828110156200215f57815180516001600160a01b031685528681015163ffffffff908116888701528682015181168787015260608083015161ffff169087015260808083015182169087015260a091820151169085015260c0909301929085019060010162002189565b818103818111156200101f576200101f620020ab565b6000816200221b576200221b620020ab565b506000190190565b63ffffffff818116838216019080821115620015795762001579620020ab565b6000604080830163ffffffff8616845260208281860152818651808452606087019150828801935060005b81811015620022a257845180516001600160a01b0316845284015161ffff168484015293830193918501916001016200226e565b509098975050505050505050565b600060208284031215620022c357600080fd5b81516200105a8162001866565b80820281158282048414176200101f576200101f620020ab565b6000826200230857634e487b7160e01b600052601260045260246000fd5b500490565b6001600160601b03828116828216039080821115620015795762001579620020ab565b6000602082840312156200234357600080fd5b5051919050565b8181036000831280158383131683831282161715620015795762001579620020ab565b6000602082840312156200238057600080fd5b6200105a8262001b3a565b634e487b7160e01b600052603160045260246000fd5b60005b83811015620023be578181015183820152602001620023a4565b50506000910152565b60008251620023db818460208701620023a1565b9190910192915050565b602081526000825180602084015262002406816040850160208701620023a1565b601f01601f19169190910160400192915050565b60805160a05160c05160e05161010051610120516101405161016051615f726200252860003960008181610334015281816116530152613dfb015260008181610305015281816114060152818161146e01528181611c3501528181611c9d0152613dcc0152600081816102710152818161097f01528181611790015281816120350152613d3801526000818161024101528181611d680152613d0801526000818161021201528181610fb4015281816119e001528181611ae1015281816123a301528181613090015281816132c60152613cd90152600081816102d101528181611bad0152613d980152600081816102a1015281816125d30152613d680152600061215e0152615f726000f3fe608060405234801561001057600080fd5b50600436106101c45760003560e01c806379ba5097116100f9578063d09dc33911610097578063eff7cc4811610071578063eff7cc481461092d578063f25561fd14610935578063f2fde38b14610948578063fbca3b741461095b57600080fd5b8063d09dc339146108ff578063df0aa9e914610907578063e687b40a1461091a57600080fd5b80638da5cb5b116100d35780638da5cb5b146107c05780639a113c36146107d1578063b06d41bc146108d6578063c92b2832146108ec57600080fd5b806379ba5097146107925780637ec757511461079a578063856c8247146107ad57600080fd5b8063546719cd11610166578063599f643111610140578063599f6431146105ec578063704b6c02146105fd5780637437ff9f1461061057806376f6ae761461077f57600080fd5b8063546719cd14610555578063549e946f146105b957806354b71468146105cc57600080fd5b806320487ded116101a257806320487ded146104d35780633a87ac53146104f45780634120fccd1461050957806348a98aa41461052a57600080fd5b806306285c69146101c95780631772047e1461037a578063181f5a771461048a575b600080fd5b6103646040805160e081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c08101919091526040518060e001604052807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031681526020017f000000000000000000000000000000000000000000000000000000000000000067ffffffffffffffff1681526020017f000000000000000000000000000000000000000000000000000000000000000067ffffffffffffffff1681526020017f000000000000000000000000000000000000000000000000000000000000000067ffffffffffffffff1681526020017f00000000000000000000000000000000000000000000000000000000000000006bffffffffffffffffffffffff1681526020017f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031681526020017f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316815250905090565b6040516103719190614ac2565b60405180910390f35b61043c610388366004614b63565b6040805160a081018252600080825260208201819052918101829052606081018290526080810191909152506001600160a01b03166000908152600e6020908152604091829020825160a081018452905463ffffffff8082168352640100000000820481169383019390935261ffff68010000000000000000820416938201939093526a01000000000000000000008304821660608201526e01000000000000000000000000000090920416608082015290565b6040516103719190815163ffffffff908116825260208084015182169083015260408084015161ffff1690830152606080840151821690830152608092830151169181019190915260a00190565b6104c66040518060400160405280601381526020017f45564d3245564d4f6e52616d7020312e322e300000000000000000000000000081525081565b6040516103719190614bd0565b6104e66104e1366004614c11565b61097b565b604051908152602001610371565b610507610502366004614e19565b610dfb565b005b610511610e11565b60405167ffffffffffffffff9091168152602001610371565b61053d610538366004614e73565b610e45565b6040516001600160a01b039091168152602001610371565b61055d610ea5565b604051610371919081516fffffffffffffffffffffffffffffffff908116825260208084015163ffffffff1690830152604080840151151590830152606080840151821690830152608092830151169181019190915260a00190565b6105076105c7366004614eac565b610f55565b6010546040516bffffffffffffffffffffffff9091168152602001610371565b6002546001600160a01b031661053d565b61050761060b366004614b63565b61110a565b6107726040805161014081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e0810182905261010081018290526101208101919091525060408051610140810182526005546001600160a01b03808216835261ffff7401000000000000000000000000000000000000000083048116602085015263ffffffff76010000000000000000000000000000000000000000000084048116958501959095527a0100000000000000000000000000000000000000000000000000008304811660608501527c0100000000000000000000000000000000000000000000000000000000928390048516608085015260065480821660a086015262010000810490911660c0850152640100000000810490911660e08401527801000000000000000000000000000000000000000000000000810484166101008401520490911661012082015290565b6040516103719190614fa5565b61050761078d366004614fb4565b6111d4565b61050761128c565b6105076107a8366004615058565b61136f565b6105116107bb366004614b63565b6113d8565b6000546001600160a01b031661053d565b61088c6107df366004614b63565b604080516080810182526000808252602082018190529181018290526060810191909152506001600160a01b03166000908152600d60209081526040918290208251608081018452905463ffffffff8116825267ffffffffffffffff64010000000082048116938301939093526c0100000000000000000000000081049092169281019290925260ff74010000000000000000000000000000000000000000909104161515606082015290565b60408051825163ffffffff16815260208084015167ffffffffffffffff90811691830191909152838301511691810191909152606091820151151591810191909152608001610371565b6108de6114d9565b6040516103719291906151bb565b6105076108fa36600461520b565b6115dd565b6104e6611645565b6104e6610915366004615279565b61164f565b6105076109283660046152e5565b6121d3565b6105076121e4565b6105076109433660046153ad565b61247b565b610507610956366004614b63565b6124e1565b61096e6109693660046154a0565b6124f2565b60405161037191906154bd565b60007f000000000000000000000000000000000000000000000000000000000000000067ffffffffffffffff168367ffffffffffffffff16146109fb576040517fd9a9cd6800000000000000000000000000000000000000000000000000000000815267ffffffffffffffff841660048201526024015b60405180910390fd5b6000610a12610a0d608085018561550a565b6125a4565b519050610a3c610a25602085018561550a565b905082610a35604087018761556f565b9050612698565b6000600d81610a516080870160608801614b63565b6001600160a01b0316815260208082019290925260409081016000208151608081018352905463ffffffff81168252640100000000810467ffffffffffffffff908116948301949094526c010000000000000000000000008104909316918101919091527401000000000000000000000000000000000000000090910460ff16151560608201819052909150610b2f57610af16080850160608601614b63565b6040517fa7499d200000000000000000000000000000000000000000000000000000000081526001600160a01b0390911660048201526024016109f2565b600654600090819064010000000090046001600160a01b031663ffdb4b37610b5d6080890160608a01614b63565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b1681526001600160a01b03909116600482015267ffffffffffffffff8a1660248201526044016040805180830381865afa158015610bc8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bec9190615603565b9092509050806000808080610c0460408c018c61556f565b90501115610c3e57610c32610c1f60808c0160608d01614b63565b87610c2d60408e018e61556f565b6127c1565b91945092509050610c5a565b8651610c579063ffffffff16662386f26fc10000615665565b92505b6040870151610c739067ffffffffffffffff1684615665565b60208881015160055492955060009267ffffffffffffffff9091169163ffffffff8616917a010000000000000000000000000000000000000000000000000000900461ffff1690610cc6908f018f61550a565b610cd1929150615665565b600554610cfe90760100000000000000000000000000000000000000000000900463ffffffff168d61567c565b610d08919061567c565b610d12919061567c565b610d1c9190615665565b610d36906dffffffffffffffffffffffffffff8716615665565b60065490915060009062010000900461ffff1615610daa576000607060ff16887bffffffffffffffffffffffffffffffffffffffffffffffffffffffff16901c9050610da6818e8060200190610d8c919061550a565b90508f8060400190610d9e919061556f565b905087612acb565b9150505b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff881681610dd4848861567c565b610dde919061567c565b610de8919061568f565b9a50505050505050505050505b92915050565b610e03612b9b565b610e0d8282612c11565b5050565b601054600090610e4090700100000000000000000000000000000000900467ffffffffffffffff1660016156ca565b905090565b6000610e52600a83612f71565b610e93576040517fbf16aab60000000000000000000000000000000000000000000000000000000081526001600160a01b03831660048201526024016109f2565b610e9e600a83612f86565b9392505050565b6040805160a0810182526000808252602082018190529181018290526060810182905260808101919091526040805160a0810182526003546fffffffffffffffffffffffffffffffff808216835270010000000000000000000000000000000080830463ffffffff1660208501527401000000000000000000000000000000000000000090920460ff161515938301939093526004548084166060840152049091166080820152610e4090612f9b565b6000546001600160a01b03163314801590610f7b57506002546001600160a01b03163314155b15610fb2576040517ffbdb8e5600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b03161480610ff957506001600160a01b038116155b15611030576040517f232cb97f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600061103a61304d565b1215611072576040517f02075e0000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152610e0d9082906001600160a01b038516906370a0823190602401602060405180830381865afa1580156110d5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110f991906156eb565b6001600160a01b038516919061310d565b6000546001600160a01b0316331480159061113057506002546001600160a01b03163314155b15611167576040517ff6cd562000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600280547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0383169081179091556040519081527f8fe72c3e0020beb3234e76ae6676fa576fbfcae600af1c4fea44784cf0db329c906020015b60405180910390a150565b6000546001600160a01b031633148015906111fa57506002546001600160a01b03163314155b15611231576040517ffbdb8e5600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610e0d8282808060200260200160405190810160405280939291908181526020016000905b828210156112825761127360408302860136819003810190615704565b81526020019060010190611256565b505050505061318d565b6001546001600160a01b03163314611300576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e65720000000000000000000060448201526064016109f2565b60008054337fffffffffffffffffffffffff0000000000000000000000000000000000000000808316821784556001805490911690556040516001600160a01b0390921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b6000546001600160a01b0316331480159061139557506002546001600160a01b03163314155b156113cc576040517ffbdb8e5600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6113d581613400565b50565b6001600160a01b0381166000908152600f602052604081205467ffffffffffffffff168015801561143157507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031615155b15610df5576040517f856c82470000000000000000000000000000000000000000000000000000000081526001600160a01b0384811660048301527f0000000000000000000000000000000000000000000000000000000000000000169063856c824790602401602060405180830381865afa1580156114b5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e9e9190615743565b60606000806114e860076135c6565b90508067ffffffffffffffff81111561150357611503614c61565b60405190808252806020026020018201604052801561154857816020015b60408051808201909152600080825260208201528152602001906001900390816115215790505b50925060005b818110156115ba576000806115646007846135d1565b915091506040518060400160405280836001600160a01b031681526020018261ffff1681525086848151811061159c5761159c615760565b60200260200101819052505050806115b39061578f565b905061154e565b505060105491926c0100000000000000000000000090920463ffffffff16919050565b6000546001600160a01b0316331480159061160357506002546001600160a01b03163314155b1561163a576040517ff6cd562000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6113d56003826135ef565b6000610e4061304d565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663397796f76040518163ffffffff1660e01b8152600401602060405180830381865afa1580156116af573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116d391906157c7565b1561170a576040517fc148371500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b03821661174a576040517fa4ec747900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6005546001600160a01b0316331461178e576040517f1c0a352900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000067ffffffffffffffff168567ffffffffffffffff1614611807576040517fd9a9cd6800000000000000000000000000000000000000000000000000000000815267ffffffffffffffff861660048201526024016109f2565b611811848061550a565b905060201461185857611824848061550a565b6040517f370d875f0000000000000000000000000000000000000000000000000000000081526004016109f292919061580f565b6000611864858061550a565b8101906118719190615823565b90506001600160a01b038111806118885750600a81105b1561189757611824858061550a565b60006118a9610a0d608088018861550a565b51905060006118bb604088018861556f565b91506118d890506118cf602089018961550a565b90508383612698565b80156119d65760005b81811015611959576118f6604089018961556f565b8281811061190657611906615760565b90506040020160200135600003611949576040517f5cf0444900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6119528161578f565b90506118e1565b506119d661196a604089018961556f565b808060200260200160405190810160405280939291908181526020016000905b828210156119b6576119a76040830286013681900381019061583c565b8152602001906001019061198a565b505060065464010000000090046001600160a01b031692506137c7915050565b6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016611a106080890160608a01614b63565b6001600160a01b031603611a745760108054879190600090611a419084906bffffffffffffffffffffffff16615876565b92506101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff160217905550611b9b565b60065464010000000090046001600160a01b03166241e5be611a9c60808a0160608b01614b63565b60405160e083901b7fffffffff000000000000000000000000000000000000000000000000000000001681526001600160a01b039182166004820152602481018a90527f00000000000000000000000000000000000000000000000000000000000000009091166044820152606401602060405180830381865afa158015611b28573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b4c91906156eb565b60108054600090611b6c9084906bffffffffffffffffffffffff16615876565b92506101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055505b6010546bffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000811691161115611c08576040517fe5c7a49100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b0385166000908152600f602052604090205467ffffffffffffffff16158015611c6057507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031615155b15611d58576040517f856c82470000000000000000000000000000000000000000000000000000000081526001600160a01b0386811660048301527f0000000000000000000000000000000000000000000000000000000000000000169063856c824790602401602060405180830381865afa158015611ce4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d089190615743565b6001600160a01b0386166000908152600f6020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000001667ffffffffffffffff929092169190911790555b6000604051806101a001604052807f000000000000000000000000000000000000000000000000000000000000000067ffffffffffffffff168152602001876001600160a01b03168152602001856001600160a01b0316815260200160108081819054906101000a900467ffffffffffffffff16611dd59061589b565b825467ffffffffffffffff9182166101009390930a838102908302199091161790925582526020808301879052600060408085018290526001600160a01b038c168252600f90925290812080546060909401939092611e34911661589b565b825467ffffffffffffffff9182166101009390930a83810292021916179091558152602001611e6960808b0160608c01614b63565b6001600160a01b03168152602001888152602001898060200190611e8d919061550a565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250505090825250602001611ed460408b018b61556f565b808060200260200160405190810160405280939291908181526020016000905b82821015611f2057611f116040830286013681900381019061583c565b81526020019060010190611ef4565b505050505081526020018367ffffffffffffffff811115611f4357611f43614c61565b604051908082528060200260200182016040528015611f7657816020015b6060815260200190600190039081611f615790505b508152600060209091018190529091505b82811015612157576000611f9e60408b018b61556f565b83818110611fae57611fae615760565b905060400201803603810190611fc4919061583c565b90506000611fd68c8360000151610e45565b6001600160a01b031663968754458a611fef8e8061550a565b60208088015160408051928301815260008352517fffffffff0000000000000000000000000000000000000000000000000000000060e088901b16815261205d959493927f0000000000000000000000000000000000000000000000000000000000000000916004016158c2565b6000604051808303816000875af115801561207c573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526120a4919081019061591a565b82516001600160a01b03166000908152600e602052604090205481519192506e010000000000000000000000000000900463ffffffff1610156121215781516040517f36f536ca0000000000000000000000000000000000000000000000000000000081526001600160a01b0390911660048201526024016109f2565b80846101600151848151811061213957612139615760565b60200260200101819052505050806121509061578f565b9050611f87565b50612182817f0000000000000000000000000000000000000000000000000000000000000000613982565b6101808201526040517fd0c3c799bf9e2639de44391e7f524d229b2b55f5b1ea94b2bf7da42f7243dddd906121b8908390615a47565b60405180910390a1610180015193505050505b949350505050565b6121db612b9b565b6113d581613add565b6000546001600160a01b0316331480159061220a57506002546001600160a01b03163314155b801561221e575061221c600733613e35565b155b15612255576040517f195db95800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6010546c01000000000000000000000000900463ffffffff1660008190036122a9576040517f990e30bf00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6010546bffffffffffffffffffffffff16818110156122f4576040517f8d0f71d800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006122fe61304d565b1215612336576040517ff4d678b800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80600061234360076135c6565b905060005b818110156124385760008061235e6007846135d1565b909250905060008761237e836bffffffffffffffffffffffff8a16615665565b612388919061568f565b90506123948187615b7c565b95506123d86001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016846bffffffffffffffffffffffff841661310d565b6040516bffffffffffffffffffffffff821681526001600160a01b038416907f55fdec2aab60a41fa5abb106670eb1006f5aeaee1ba7afea2bc89b5b3ec7678f9060200160405180910390a2505050806124319061578f565b9050612348565b5050601080547fffffffffffffffffffffffffffffffffffffffff000000000000000000000000166bffffffffffffffffffffffff929092169190911790555050565b6000546001600160a01b031633148015906124a157506002546001600160a01b03163314155b156124d8576040517ffbdb8e5600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6113d581613e4a565b6124e9612b9b565b6113d581613fd5565b60606000612500600a6140b0565b67ffffffffffffffff81111561251857612518614c61565b604051908082528060200260200182016040528015612541578160200160208202803683370190505b50905060005b815181101561259d5761255b600a826140bb565b5082828151811061256e5761256e615760565b60200260200101816001600160a01b03166001600160a01b031681525050806125969061578f565b9050612547565b5092915050565b60408051602081019091526000815260008290036125fa5750604080516020810190915267ffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168152610df5565b7f97a657c9000000000000000000000000000000000000000000000000000000006126258385615ba1565b7fffffffff00000000000000000000000000000000000000000000000000000000161461267e576040517f5247fdce00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61268b8260048186615be9565b810190610e9e9190615c13565b6006547801000000000000000000000000000000000000000000000000900463ffffffff1680841115612701576040517f8693378900000000000000000000000000000000000000000000000000000000815260048101829052602481018590526044016109f2565b6006547c0100000000000000000000000000000000000000000000000000000000900463ffffffff16831115612763576040517f4c4fc93a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60055474010000000000000000000000000000000000000000900461ffff168211156127bb576040517f4c056b6a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50505050565b6000808083815b81811015612abf5760008787838181106127e4576127e4615760565b9050604002018036038101906127fa919061583c565b80516001600160a01b03166000908152600e6020908152604091829020825160a081018452905463ffffffff8082168352640100000000820481169383019390935261ffff68010000000000000000820416938201939093526a01000000000000000000008304821660608201526e010000000000000000000000000000909204811660808301528251929350909161289791600a9190612f7116565b6128db5781516040517fbf16aab60000000000000000000000000000000000000000000000000000000081526001600160a01b0390911660048201526024016109f2565b604081015160009061ffff16156129ff5760008c6001600160a01b031684600001516001600160a01b0316146129a25760065484516040517f4ab35b0b0000000000000000000000000000000000000000000000000000000081526001600160a01b0391821660048201526401000000009092041690634ab35b0b90602401602060405180830381865afa158015612977573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061299b9190615c55565b90506129a5565b508a5b620186a0836040015161ffff166129e78660200151847bffffffffffffffffffffffffffffffffffffffffffffffffffffffff166140ca90919063ffffffff16565b6129f19190615665565b6129fb919061568f565b9150505b6060820151612a0e9088615c70565b9650816080015186612a209190615c70565b8251909650600090612a3f9063ffffffff16662386f26fc10000615665565b905080821015612a5e57612a53818a61567c565b985050505050612aaf565b6000836020015163ffffffff16662386f26fc10000612a7d9190615665565b905080831115612a9d57612a91818b61567c565b99505050505050612aaf565b612aa7838b61567c565b995050505050505b612ab88161578f565b90506127c8565b50509450945094915050565b60008063ffffffff8316612ae0608086615665565b612aec8761022061567c565b612af6919061567c565b612b00919061567c565b6005546006549192506000917c010000000000000000000000000000000000000000000000000000000090910463ffffffff1690612b429061ffff1684615665565b612b4c919061567c565b60065490915062010000900461ffff16612b766dffffffffffffffffffffffffffff891683615665565b612b809190615665565b612b9090655af3107a4000615665565b979650505050505050565b6000546001600160a01b03163314612c0f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e65720000000000000000000060448201526064016109f2565b565b60005b8251811015612d72576000838281518110612c3157612c31615760565b60200260200101516000015190506000848381518110612c5357612c53615760565b6020026020010151602001519050612c7582600a612f7190919063ffffffff16565b612cb6576040517f73913ebd0000000000000000000000000000000000000000000000000000000081526001600160a01b03831660048201526024016109f2565b6001600160a01b038116612ccb600a84612f86565b6001600160a01b031614612d0b576040517f6cc7b99800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b612d16600a83614107565b15612d5f57604080516001600160a01b038085168252831660208201527f987eb3c2f78454541205f72f34839b434c306c9eaf4922efd7c0c3060fdb2e4c910160405180910390a15b505080612d6b9061578f565b9050612c14565b5060005b8151811015612f6c576000828281518110612d9357612d93615760565b60200260200101516000015190506000838381518110612db557612db5615760565b602002602001015160200151905060006001600160a01b0316826001600160a01b03161480612deb57506001600160a01b038116155b15612e22576040517f6c2a418000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b806001600160a01b03166321df0da76040518163ffffffff1660e01b8152600401602060405180830381865afa158015612e60573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e849190615c8d565b6001600160a01b0316826001600160a01b031614612ece576040517f6cc7b99800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b612eda600a838361411c565b15612f2757604080516001600160a01b038085168252831660208201527f95f865c2808f8b2a85eea2611db7843150ee7835ef1403f9755918a97d76933c910160405180910390a1612f59565b6040517f3caf458500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b505080612f659061578f565b9050612d76565b505050565b6000610e9e836001600160a01b038416614132565b6000610e9e836001600160a01b03841661413e565b6040805160a08101825260008082526020820181905291810182905260608101829052608081019190915261302982606001516fffffffffffffffffffffffffffffffff1683600001516fffffffffffffffffffffffffffffffff16846020015163ffffffff164261300d9190615caa565b85608001516fffffffffffffffffffffffffffffffff1661414a565b6fffffffffffffffffffffffffffffffff1682525063ffffffff4216602082015290565b6010546040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526000916bffffffffffffffffffffffff16907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa1580156130df573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061310391906156eb565b610e409190615cbd565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb00000000000000000000000000000000000000000000000000000000179052612f6c908490614172565b805160408111156131ca576040517fb5a10cfa00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6010546c01000000000000000000000000900463ffffffff1615801590613218575060105463ffffffff6c010000000000000000000000008204166bffffffffffffffffffffffff90911610155b15613225576132256121e4565b600061323160076135c6565b90505b801561327357600061325261324a600184615caa565b6007906135d1565b509050613260600782614271565b50508061326c90615cdd565b9050613234565b506000805b8281101561338157600084828151811061329457613294615760565b602002602001015160000151905060008583815181106132b6576132b6615760565b60200260200101516020015190507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b0316148061330b57506001600160a01b038216155b1561334d576040517f4de938d10000000000000000000000000000000000000000000000000000000081526001600160a01b03831660048201526024016109f2565b61335d60078361ffff8416614286565b5061336c61ffff821685615c70565b935050508061337a9061578f565b9050613278565b50601080547fffffffffffffffffffffffffffffffff00000000ffffffffffffffffffffffff166c0100000000000000000000000063ffffffff8416021790556040517f8c337bff38141c507abd25c547606bdde78fe8c12e941ab613f3a565fea6cd24906133f39083908690615d12565b60405180910390a1505050565b60005b815181101561359657600082828151811061342057613420615760565b6020908102919091018101516040805160a080820183528385015163ffffffff908116835283850151811683870190815260608087015161ffff9081168688019081526080808a0151861693880193845295890151851695870195865297516001600160a01b03166000908152600e9099529590972093518454915196519751935183166e010000000000000000000000000000027fffffffffffffffffffffffffffff00000000ffffffffffffffffffffffffffff9484166a0100000000000000000000027fffffffffffffffffffffffffffffffffffff00000000ffffffffffffffffffff999097166801000000000000000002989098167fffffffffffffffffffffffffffffffffffff000000000000ffffffffffffffff978416640100000000027fffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000909316919093161717949094169390931791909117919091169190911790555061358f8161578f565b9050613403565b507f555c74101f7a15746d31c6731170310e667bcc607996b2fc0b981a7b26a416e9816040516111c99190615d31565b6000610df58261429c565b60008080806135e086866142a7565b909450925050505b9250929050565b815460009061361890700100000000000000000000000000000000900463ffffffff1642615caa565b905080156136ba5760018301548354613660916fffffffffffffffffffffffffffffffff8082169281169185917001000000000000000000000000000000009091041661414a565b83546fffffffffffffffffffffffffffffffff919091167fffffffffffffffffffffffff0000000000000000000000000000000000000000909116177001000000000000000000000000000000004263ffffffff16021783555b602082015183546136e0916fffffffffffffffffffffffffffffffff90811691166142d2565b83548351151574010000000000000000000000000000000000000000027fffffffffffffffffffffff00ffffffff000000000000000000000000000000009091166fffffffffffffffffffffffffffffffff92831617178455602083015160408085015183167001000000000000000000000000000000000291909216176001850155517f9ea3374b67bf275e6bb9c8ae68f9cae023e1c528b4b27e092f0bb209d3531c19906133f39084908151151581526020808301516fffffffffffffffffffffffffffffffff90811691830191909152604092830151169181019190915260600190565b81516000805b82811015613974576000846001600160a01b031663d02641a08784815181106137f8576137f8615760565b6020908102919091010151516040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b1681526001600160a01b0390911660048201526024016040805180830381865afa15801561385f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906138839190615db6565b5190507bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8116600003613908578582815181106138be576138be615760565b6020908102919091010151516040517f9a655f7b0000000000000000000000000000000000000000000000000000000081526001600160a01b0390911660048201526024016109f2565b61395686838151811061391d5761391d615760565b602002602001015160200151827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff166140ca90919063ffffffff16565b613960908461567c565b9250508061396d9061578f565b90506137cd565b506127bb60038260006142e8565b60008060001b8284602001518560400151866060015187608001518860a001518960c001518a60e001518b6101000151604051602001613a189897969594939291906001600160a01b039889168152968816602088015267ffffffffffffffff95861660408801526060870194909452911515608086015290921660a0840152921660c082015260e08101919091526101000190565b6040516020818303038152906040528051906020012085610120015180519060200120866101400151604051602001613a519190615de9565b60405160208183030381529060405280519060200120876101600151604051602001613a7d9190615dfc565b60408051601f198184030181528282528051602091820120908301979097528101949094526060840192909252608083015260a082015260c081019190915260e00160405160208183030381529060405280519060200120905092915050565b60e08101516001600160a01b0316613b21576040517f35be3ac800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80600560008201518160000160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060208201518160000160146101000a81548161ffff021916908361ffff16021790555060408201518160000160166101000a81548163ffffffff021916908363ffffffff160217905550606082015181600001601a6101000a81548161ffff021916908361ffff160217905550608082015181600001601c6101000a81548163ffffffff021916908363ffffffff16021790555060a08201518160010160006101000a81548161ffff021916908361ffff16021790555060c08201518160010160026101000a81548161ffff021916908361ffff16021790555060e08201518160010160046101000a8154816001600160a01b0302191690836001600160a01b031602179055506101008201518160010160186101000a81548163ffffffff021916908363ffffffff16021790555061012082015181600101601c6101000a81548163ffffffff021916908363ffffffff1602179055509050507f2a57f7c2027cf032c78b77d4d8d2fbd20ad22e5d5e5b5fb23ac7d7820d44adc66040518060e001604052807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031681526020017f000000000000000000000000000000000000000000000000000000000000000067ffffffffffffffff1681526020017f000000000000000000000000000000000000000000000000000000000000000067ffffffffffffffff1681526020017f000000000000000000000000000000000000000000000000000000000000000067ffffffffffffffff1681526020017f00000000000000000000000000000000000000000000000000000000000000006bffffffffffffffffffffffff1681526020017f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031681526020017f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316815250826040516111c9929190615e0f565b6000610e9e836001600160a01b038416614637565b60005b8151811015613fa5576000828281518110613e6a57613e6a615760565b60209081029190910181015160408051608080820183528385015163ffffffff90811683528385015167ffffffffffffffff908116848801908152606080880151831686880190815294880151151590860190815296516001600160a01b03166000908152600d9098529490962092518354945192519551151574010000000000000000000000000000000000000000027fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff9688166c0100000000000000000000000002969096167fffffffffffffffffffffff000000000000000000ffffffffffffffffffffffff93909716640100000000027fffffffffffffffffffffffffffffffffffffffff00000000000000000000000090951691161792909217919091169290921717905550613f9e8161578f565b9050613e4d565b507f067924bf9277d905a9a4631a06d959bc032ace86b3caa835ae7e403d4f39010e816040516111c99190615e99565b336001600160a01b03821603614047576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c6600000000000000000060448201526064016109f2565b600180547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b6000610df5826135c6565b60008080806135e086866135d1565b6000670de0b6b3a76400006140fd837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8616615665565b610e9e919061568f565b6000610e9e836001600160a01b038416614643565b60006121cb846001600160a01b0385168461464f565b6000610e9e8383614637565b6000610e9e8383614665565b60006141698561415a8486615665565b614164908761567c565b6142d2565b95945050505050565b60006141c7826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166146ef9092919063ffffffff16565b805190915015612f6c57808060200190518101906141e591906157c7565b612f6c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f7420737563636565640000000000000000000000000000000000000000000060648201526084016109f2565b6000610e9e836001600160a01b0384166146fe565b60006121cb846001600160a01b0385168461471b565b6000610df582614738565b600080806142b58585614742565b600081815260029690960160205260409095205494959350505050565b60008183106142e15781610e9e565b5090919050565b825474010000000000000000000000000000000000000000900460ff16158061430f575081155b1561431957505050565b825460018401546fffffffffffffffffffffffffffffffff8083169291169060009061435f90700100000000000000000000000000000000900463ffffffff1642615caa565b9050801561441f57818311156143a1576040517f9725942a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60018601546143db9083908590849070010000000000000000000000000000000090046fffffffffffffffffffffffffffffffff1661414a565b86547fffffffffffffffffffffffff00000000ffffffffffffffffffffffffffffffff167001000000000000000000000000000000004263ffffffff160217875592505b848210156144bc576001600160a01b038416614471576040517ff94ebcd100000000000000000000000000000000000000000000000000000000815260048101839052602481018690526044016109f2565b6040517f1a76572a00000000000000000000000000000000000000000000000000000000815260048101839052602481018690526001600160a01b03851660448201526064016109f2565b848310156145b55760018681015470010000000000000000000000000000000090046fffffffffffffffffffffffffffffffff169060009082906145009082615caa565b61450a878a615caa565b614514919061567c565b61451e919061568f565b90506001600160a01b03861661456a576040517f15279c0800000000000000000000000000000000000000000000000000000000815260048101829052602481018690526044016109f2565b6040517fd0c8d23a00000000000000000000000000000000000000000000000000000000815260048101829052602481018690526001600160a01b03871660448201526064016109f2565b6145bf8584615caa565b86547fffffffffffffffffffffffffffffffff00000000000000000000000000000000166fffffffffffffffffffffffffffffffff82161787556040518681529093507f1871cdf8010e63f2eb8384381a68dfa7416dc571a5517e66e88b2d2d0c0a690a9060200160405180910390a1505050505050565b6000610e9e838361474e565b6000610e9e83836146fe565b60006121cb84846001600160a01b03851661471b565b60008181526002830160205260408120548015158061468957506146898484614637565b610e9e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f456e756d657261626c654d61703a206e6f6e6578697374656e74206b6579000060448201526064016109f2565b60606121cb8484600085614766565b60008181526002830160205260408120819055610e9e8383614867565b600082815260028401602052604081208290556121cb8484614873565b6000610df5825490565b6000610e9e838361487f565b60008181526001830160205260408120541515610e9e565b6060824710156147f8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c000000000000000000000000000000000000000000000000000060648201526084016109f2565b600080866001600160a01b031685876040516148149190615f1a565b60006040518083038185875af1925050503d8060008114614851576040519150601f19603f3d011682016040523d82523d6000602084013e614856565b606091505b5091509150612b90878383876148a9565b6000610e9e838361493c565b6000610e9e8383614a2f565b600082600001828154811061489657614896615760565b9060005260206000200154905092915050565b6060831561493257825160000361492b576001600160a01b0385163b61492b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016109f2565b50816121cb565b6121cb8383614a7e565b60008181526001830160205260408120548015614a25576000614960600183615caa565b855490915060009061497490600190615caa565b90508181146149d957600086600001828154811061499457614994615760565b90600052602060002001549050808760000184815481106149b7576149b7615760565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806149ea576149ea615f36565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610df5565b6000915050610df5565b6000818152600183016020526040812054614a7657508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610df5565b506000610df5565b815115614a8e5781518083602001fd5b806040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109f29190614bd0565b60e08101610df582846001600160a01b03808251168352602082015167ffffffffffffffff808216602086015280604085015116604086015280606085015116606086015250506bffffffffffffffffffffffff60808301511660808401528060a08301511660a08401528060c08301511660c0840152505050565b6001600160a01b03811681146113d557600080fd5b8035614b5e81614b3e565b919050565b600060208284031215614b7557600080fd5b8135610e9e81614b3e565b60005b83811015614b9b578181015183820152602001614b83565b50506000910152565b60008151808452614bbc816020860160208601614b80565b601f01601f19169290920160200192915050565b602081526000610e9e6020830184614ba4565b67ffffffffffffffff811681146113d557600080fd5b600060a08284031215614c0b57600080fd5b50919050565b60008060408385031215614c2457600080fd5b8235614c2f81614be3565b9150602083013567ffffffffffffffff811115614c4b57600080fd5b614c5785828601614bf9565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040805190810167ffffffffffffffff81118282101715614cb357614cb3614c61565b60405290565b60405160c0810167ffffffffffffffff81118282101715614cb357614cb3614c61565b604051610140810167ffffffffffffffff81118282101715614cb357614cb3614c61565b60405160a0810167ffffffffffffffff81118282101715614cb357614cb3614c61565b604051601f8201601f1916810167ffffffffffffffff81118282101715614d4c57614d4c614c61565b604052919050565b600067ffffffffffffffff821115614d6e57614d6e614c61565b5060051b60200190565b600082601f830112614d8957600080fd5b81356020614d9e614d9983614d54565b614d23565b82815260069290921b84018101918181019086841115614dbd57600080fd5b8286015b84811015614e0e5760408189031215614dda5760008081fd5b614de2614c90565b8135614ded81614b3e565b815281850135614dfc81614b3e565b81860152835291830191604001614dc1565b509695505050505050565b60008060408385031215614e2c57600080fd5b823567ffffffffffffffff80821115614e4457600080fd5b614e5086838701614d78565b93506020850135915080821115614e6657600080fd5b50614c5785828601614d78565b60008060408385031215614e8657600080fd5b8235614e9181614be3565b91506020830135614ea181614b3e565b809150509250929050565b60008060408385031215614ebf57600080fd5b8235614e9181614b3e565b80516001600160a01b031682526020810151614eec602084018261ffff169052565b506040810151614f04604084018263ffffffff169052565b506060810151614f1a606084018261ffff169052565b506080810151614f32608084018263ffffffff169052565b5060a0810151614f4860a084018261ffff169052565b5060c0810151614f5e60c084018261ffff169052565b5060e0810151614f7960e08401826001600160a01b03169052565b506101008181015163ffffffff81168483015250506101208181015163ffffffff8116848301526127bb565b6101408101610df58284614eca565b60008060208385031215614fc757600080fd5b823567ffffffffffffffff80821115614fdf57600080fd5b818501915085601f830112614ff357600080fd5b81358181111561500257600080fd5b8660208260061b850101111561501757600080fd5b60209290920196919550909350505050565b63ffffffff811681146113d557600080fd5b8035614b5e81615029565b803561ffff81168114614b5e57600080fd5b6000602080838503121561506b57600080fd5b823567ffffffffffffffff81111561508257600080fd5b8301601f8101851361509357600080fd5b80356150a1614d9982614d54565b81815260c091820283018401918482019190888411156150c057600080fd5b938501935b8385101561515c5780858a0312156150dd5760008081fd5b6150e5614cb9565b85356150f081614b3e565b8152858701356150ff81615029565b8188015260408681013561511281615029565b908201526060615123878201615046565b9082015260808681013561513681615029565b9082015260a08681013561514981615029565b90820152835293840193918501916150c5565b50979650505050505050565b600081518084526020808501945080840160005b838110156151b057815180516001600160a01b0316885283015161ffff16838801526040909601959082019060010161517c565b509495945050505050565b6040815260006151ce6040830185615168565b90508260208301529392505050565b80151581146113d557600080fd5b80356fffffffffffffffffffffffffffffffff81168114614b5e57600080fd5b60006060828403121561521d57600080fd5b6040516060810181811067ffffffffffffffff8211171561524057615240614c61565b604052823561524e816151dd565b815261525c602084016151eb565b602082015261526d604084016151eb565b60408201529392505050565b6000806000806080858703121561528f57600080fd5b843561529a81614be3565b9350602085013567ffffffffffffffff8111156152b657600080fd5b6152c287828801614bf9565b9350506040850135915060608501356152da81614b3e565b939692955090935050565b600061014082840312156152f857600080fd5b615300614cdc565b61530983614b53565b815261531760208401615046565b60208201526153286040840161503b565b604082015261533960608401615046565b606082015261534a6080840161503b565b608082015261535b60a08401615046565b60a082015261536c60c08401615046565b60c082015261537d60e08401614b53565b60e082015261010061539081850161503b565b908201526101206153a284820161503b565b908201529392505050565b600060208083850312156153c057600080fd5b823567ffffffffffffffff8111156153d757600080fd5b8301601f810185136153e857600080fd5b80356153f6614d9982614d54565b81815260a0918202830184019184820191908884111561541557600080fd5b938501935b8385101561515c5780858a0312156154325760008081fd5b61543a614d00565b853561544581614b3e565b81528587013561545481615029565b8188015260408681013561546781614be3565b9082015260608681013561547a81614be3565b9082015260808681013561548d816151dd565b908201528352938401939185019161541a565b6000602082840312156154b257600080fd5b8135610e9e81614be3565b6020808252825182820181905260009190848201906040850190845b818110156154fe5783516001600160a01b0316835292840192918401916001016154d9565b50909695505050505050565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe184360301811261553f57600080fd5b83018035915067ffffffffffffffff82111561555a57600080fd5b6020019150368190038213156135e857600080fd5b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe18436030181126155a457600080fd5b83018035915067ffffffffffffffff8211156155bf57600080fd5b6020019150600681901b36038213156135e857600080fd5b80517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff81168114614b5e57600080fd5b6000806040838503121561561657600080fd5b61561f836155d7565b915061562d602084016155d7565b90509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8082028115828204841417610df557610df5615636565b80820180821115610df557610df5615636565b6000826156c5577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b67ffffffffffffffff81811683821601908082111561259d5761259d615636565b6000602082840312156156fd57600080fd5b5051919050565b60006040828403121561571657600080fd5b61571e614c90565b823561572981614b3e565b815261573760208401615046565b60208201529392505050565b60006020828403121561575557600080fd5b8151610e9e81614be3565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036157c0576157c0615636565b5060010190565b6000602082840312156157d957600080fd5b8151610e9e816151dd565b818352818160208501375060006020828401015260006020601f19601f840116840101905092915050565b6020815260006121cb6020830184866157e4565b60006020828403121561583557600080fd5b5035919050565b60006040828403121561584e57600080fd5b615856614c90565b823561586181614b3e565b81526020928301359281019290925250919050565b6bffffffffffffffffffffffff81811683821601908082111561259d5761259d615636565b600067ffffffffffffffff8083168181036158b8576158b8615636565b6001019392505050565b6001600160a01b038716815260a0602082015260006158e560a0830187896157e4565b85604084015267ffffffffffffffff85166060840152828103608084015261590d8185614ba4565b9998505050505050505050565b60006020828403121561592c57600080fd5b815167ffffffffffffffff8082111561594457600080fd5b818401915084601f83011261595857600080fd5b81518181111561596a5761596a614c61565b61597d6020601f19601f84011601614d23565b915080825285602082850101111561599457600080fd5b6159a5816020840160208601614b80565b50949350505050565b600081518084526020808501945080840160005b838110156151b057815180516001600160a01b0316885283015183880152604090960195908201906001016159c2565b600081518084526020808501808196508360051b8101915082860160005b85811015615a3a578284038952615a28848351614ba4565b98850198935090840190600101615a10565b5091979650505050505050565b60208152615a6260208201835167ffffffffffffffff169052565b60006020830151615a7e60408401826001600160a01b03169052565b5060408301516001600160a01b038116606084015250606083015167ffffffffffffffff8116608084015250608083015160a083015260a0830151615ac760c084018215159052565b5060c083015167ffffffffffffffff811660e08401525060e0830151610100615afa818501836001600160a01b03169052565b840151610120848101919091528401516101a061014080860182905291925090615b286101c0860184614ba4565b9250808601519050601f19610160818786030181880152615b4985846159ae565b945080880151925050610180818786030181880152615b6885846159f2565b970151959092019490945250929392505050565b6bffffffffffffffffffffffff82811682821603908082111561259d5761259d615636565b7fffffffff000000000000000000000000000000000000000000000000000000008135818116916004851015615be15780818660040360031b1b83161692505b505092915050565b60008085851115615bf957600080fd5b83861115615c0657600080fd5b5050820193919092039150565b600060208284031215615c2557600080fd5b6040516020810181811067ffffffffffffffff82111715615c4857615c48614c61565b6040529135825250919050565b600060208284031215615c6757600080fd5b610e9e826155d7565b63ffffffff81811683821601908082111561259d5761259d615636565b600060208284031215615c9f57600080fd5b8151610e9e81614b3e565b81810381811115610df557610df5615636565b818103600083128015838313168383128216171561259d5761259d615636565b600081615cec57615cec615636565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190565b63ffffffff831681526040602082015260006121cb6040830184615168565b602080825282518282018190526000919060409081850190868401855b82811015615a3a57815180516001600160a01b031685528681015163ffffffff908116888701528682015181168787015260608083015161ffff169087015260808083015182169087015260a091820151169085015260c09093019290850190600101615d4e565b600060408284031215615dc857600080fd5b615dd0614c90565b615dd9836155d7565b8152602083015161573781615029565b602081526000610e9e60208301846159ae565b602081526000610e9e60208301846159f2565b6102208101615e8c82856001600160a01b03808251168352602082015167ffffffffffffffff808216602086015280604085015116604086015280606085015116606086015250506bffffffffffffffffffffffff60808301511660808401528060a08301511660a08401528060c08301511660c0840152505050565b610e9e60e0830184614eca565b602080825282518282018190526000919060409081850190868401855b82811015615a3a57815180516001600160a01b031685528681015163ffffffff16878601528581015167ffffffffffffffff908116878701526060808301519091169086015260809081015115159085015260a09093019290850190600101615eb6565b60008251615f2c818460208701614b80565b9190910192915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fdfea164736f6c6343000813000a", +} + +var EVM2EVMOnRampABI = EVM2EVMOnRampMetaData.ABI + +var EVM2EVMOnRampBin = EVM2EVMOnRampMetaData.Bin + +func DeployEVM2EVMOnRamp(auth *bind.TransactOpts, backend bind.ContractBackend, staticConfig EVM2EVMOnRampStaticConfig, dynamicConfig EVM2EVMOnRampDynamicConfig, tokensAndPools []InternalPoolUpdate, rateLimiterConfig RateLimiterConfig, feeTokenConfigs []EVM2EVMOnRampFeeTokenConfigArgs, tokenTransferFeeConfigArgs []EVM2EVMOnRampTokenTransferFeeConfigArgs, nopsAndWeights []EVM2EVMOnRampNopAndWeight) (common.Address, *types.Transaction, *EVM2EVMOnRamp, error) { + parsed, err := EVM2EVMOnRampMetaData.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(EVM2EVMOnRampBin), backend, staticConfig, dynamicConfig, tokensAndPools, rateLimiterConfig, feeTokenConfigs, tokenTransferFeeConfigArgs, nopsAndWeights) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &EVM2EVMOnRamp{EVM2EVMOnRampCaller: EVM2EVMOnRampCaller{contract: contract}, EVM2EVMOnRampTransactor: EVM2EVMOnRampTransactor{contract: contract}, EVM2EVMOnRampFilterer: EVM2EVMOnRampFilterer{contract: contract}}, nil +} + +type EVM2EVMOnRamp struct { + address common.Address + abi abi.ABI + EVM2EVMOnRampCaller + EVM2EVMOnRampTransactor + EVM2EVMOnRampFilterer +} + +type EVM2EVMOnRampCaller struct { + contract *bind.BoundContract +} + +type EVM2EVMOnRampTransactor struct { + contract *bind.BoundContract +} + +type EVM2EVMOnRampFilterer struct { + contract *bind.BoundContract +} + +type EVM2EVMOnRampSession struct { + Contract *EVM2EVMOnRamp + CallOpts bind.CallOpts + TransactOpts bind.TransactOpts +} + +type EVM2EVMOnRampCallerSession struct { + Contract *EVM2EVMOnRampCaller + CallOpts bind.CallOpts +} + +type EVM2EVMOnRampTransactorSession struct { + Contract *EVM2EVMOnRampTransactor + TransactOpts bind.TransactOpts +} + +type EVM2EVMOnRampRaw struct { + Contract *EVM2EVMOnRamp +} + +type EVM2EVMOnRampCallerRaw struct { + Contract *EVM2EVMOnRampCaller +} + +type EVM2EVMOnRampTransactorRaw struct { + Contract *EVM2EVMOnRampTransactor +} + +func NewEVM2EVMOnRamp(address common.Address, backend bind.ContractBackend) (*EVM2EVMOnRamp, error) { + abi, err := abi.JSON(strings.NewReader(EVM2EVMOnRampABI)) + if err != nil { + return nil, err + } + contract, err := bindEVM2EVMOnRamp(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &EVM2EVMOnRamp{address: address, abi: abi, EVM2EVMOnRampCaller: EVM2EVMOnRampCaller{contract: contract}, EVM2EVMOnRampTransactor: EVM2EVMOnRampTransactor{contract: contract}, EVM2EVMOnRampFilterer: EVM2EVMOnRampFilterer{contract: contract}}, nil +} + +func NewEVM2EVMOnRampCaller(address common.Address, caller bind.ContractCaller) (*EVM2EVMOnRampCaller, error) { + contract, err := bindEVM2EVMOnRamp(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &EVM2EVMOnRampCaller{contract: contract}, nil +} + +func NewEVM2EVMOnRampTransactor(address common.Address, transactor bind.ContractTransactor) (*EVM2EVMOnRampTransactor, error) { + contract, err := bindEVM2EVMOnRamp(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &EVM2EVMOnRampTransactor{contract: contract}, nil +} + +func NewEVM2EVMOnRampFilterer(address common.Address, filterer bind.ContractFilterer) (*EVM2EVMOnRampFilterer, error) { + contract, err := bindEVM2EVMOnRamp(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &EVM2EVMOnRampFilterer{contract: contract}, nil +} + +func bindEVM2EVMOnRamp(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := EVM2EVMOnRampMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _EVM2EVMOnRamp.Contract.EVM2EVMOnRampCaller.contract.Call(opts, result, method, params...) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.EVM2EVMOnRampTransactor.contract.Transfer(opts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.EVM2EVMOnRampTransactor.contract.Transact(opts, method, params...) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _EVM2EVMOnRamp.Contract.contract.Call(opts, result, method, params...) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.contract.Transfer(opts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.contract.Transact(opts, method, params...) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCaller) CurrentRateLimiterState(opts *bind.CallOpts) (RateLimiterTokenBucket, error) { + var out []interface{} + err := _EVM2EVMOnRamp.contract.Call(opts, &out, "currentRateLimiterState") + + if err != nil { + return *new(RateLimiterTokenBucket), err + } + + out0 := *abi.ConvertType(out[0], new(RateLimiterTokenBucket)).(*RateLimiterTokenBucket) + + return out0, err + +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) CurrentRateLimiterState() (RateLimiterTokenBucket, error) { + return _EVM2EVMOnRamp.Contract.CurrentRateLimiterState(&_EVM2EVMOnRamp.CallOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCallerSession) CurrentRateLimiterState() (RateLimiterTokenBucket, error) { + return _EVM2EVMOnRamp.Contract.CurrentRateLimiterState(&_EVM2EVMOnRamp.CallOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCaller) GetDynamicConfig(opts *bind.CallOpts) (EVM2EVMOnRampDynamicConfig, error) { + var out []interface{} + err := _EVM2EVMOnRamp.contract.Call(opts, &out, "getDynamicConfig") + + if err != nil { + return *new(EVM2EVMOnRampDynamicConfig), err + } + + out0 := *abi.ConvertType(out[0], new(EVM2EVMOnRampDynamicConfig)).(*EVM2EVMOnRampDynamicConfig) + + return out0, err + +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) GetDynamicConfig() (EVM2EVMOnRampDynamicConfig, error) { + return _EVM2EVMOnRamp.Contract.GetDynamicConfig(&_EVM2EVMOnRamp.CallOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCallerSession) GetDynamicConfig() (EVM2EVMOnRampDynamicConfig, error) { + return _EVM2EVMOnRamp.Contract.GetDynamicConfig(&_EVM2EVMOnRamp.CallOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCaller) GetExpectedNextSequenceNumber(opts *bind.CallOpts) (uint64, error) { + var out []interface{} + err := _EVM2EVMOnRamp.contract.Call(opts, &out, "getExpectedNextSequenceNumber") + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) GetExpectedNextSequenceNumber() (uint64, error) { + return _EVM2EVMOnRamp.Contract.GetExpectedNextSequenceNumber(&_EVM2EVMOnRamp.CallOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCallerSession) GetExpectedNextSequenceNumber() (uint64, error) { + return _EVM2EVMOnRamp.Contract.GetExpectedNextSequenceNumber(&_EVM2EVMOnRamp.CallOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCaller) GetFee(opts *bind.CallOpts, destChainSelector uint64, message ClientEVM2AnyMessage) (*big.Int, error) { + var out []interface{} + err := _EVM2EVMOnRamp.contract.Call(opts, &out, "getFee", destChainSelector, message) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) GetFee(destChainSelector uint64, message ClientEVM2AnyMessage) (*big.Int, error) { + return _EVM2EVMOnRamp.Contract.GetFee(&_EVM2EVMOnRamp.CallOpts, destChainSelector, message) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCallerSession) GetFee(destChainSelector uint64, message ClientEVM2AnyMessage) (*big.Int, error) { + return _EVM2EVMOnRamp.Contract.GetFee(&_EVM2EVMOnRamp.CallOpts, destChainSelector, message) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCaller) GetFeeTokenConfig(opts *bind.CallOpts, token common.Address) (EVM2EVMOnRampFeeTokenConfig, error) { + var out []interface{} + err := _EVM2EVMOnRamp.contract.Call(opts, &out, "getFeeTokenConfig", token) + + if err != nil { + return *new(EVM2EVMOnRampFeeTokenConfig), err + } + + out0 := *abi.ConvertType(out[0], new(EVM2EVMOnRampFeeTokenConfig)).(*EVM2EVMOnRampFeeTokenConfig) + + return out0, err + +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) GetFeeTokenConfig(token common.Address) (EVM2EVMOnRampFeeTokenConfig, error) { + return _EVM2EVMOnRamp.Contract.GetFeeTokenConfig(&_EVM2EVMOnRamp.CallOpts, token) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCallerSession) GetFeeTokenConfig(token common.Address) (EVM2EVMOnRampFeeTokenConfig, error) { + return _EVM2EVMOnRamp.Contract.GetFeeTokenConfig(&_EVM2EVMOnRamp.CallOpts, token) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCaller) GetNopFeesJuels(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _EVM2EVMOnRamp.contract.Call(opts, &out, "getNopFeesJuels") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) GetNopFeesJuels() (*big.Int, error) { + return _EVM2EVMOnRamp.Contract.GetNopFeesJuels(&_EVM2EVMOnRamp.CallOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCallerSession) GetNopFeesJuels() (*big.Int, error) { + return _EVM2EVMOnRamp.Contract.GetNopFeesJuels(&_EVM2EVMOnRamp.CallOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCaller) GetNops(opts *bind.CallOpts) (GetNops, + + error) { + var out []interface{} + err := _EVM2EVMOnRamp.contract.Call(opts, &out, "getNops") + + outstruct := new(GetNops) + if err != nil { + return *outstruct, err + } + + outstruct.NopsAndWeights = *abi.ConvertType(out[0], new([]EVM2EVMOnRampNopAndWeight)).(*[]EVM2EVMOnRampNopAndWeight) + outstruct.WeightsTotal = *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) + + return *outstruct, err + +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) GetNops() (GetNops, + + error) { + return _EVM2EVMOnRamp.Contract.GetNops(&_EVM2EVMOnRamp.CallOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCallerSession) GetNops() (GetNops, + + error) { + return _EVM2EVMOnRamp.Contract.GetNops(&_EVM2EVMOnRamp.CallOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCaller) GetPoolBySourceToken(opts *bind.CallOpts, arg0 uint64, sourceToken common.Address) (common.Address, error) { + var out []interface{} + err := _EVM2EVMOnRamp.contract.Call(opts, &out, "getPoolBySourceToken", arg0, sourceToken) + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) GetPoolBySourceToken(arg0 uint64, sourceToken common.Address) (common.Address, error) { + return _EVM2EVMOnRamp.Contract.GetPoolBySourceToken(&_EVM2EVMOnRamp.CallOpts, arg0, sourceToken) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCallerSession) GetPoolBySourceToken(arg0 uint64, sourceToken common.Address) (common.Address, error) { + return _EVM2EVMOnRamp.Contract.GetPoolBySourceToken(&_EVM2EVMOnRamp.CallOpts, arg0, sourceToken) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCaller) GetSenderNonce(opts *bind.CallOpts, sender common.Address) (uint64, error) { + var out []interface{} + err := _EVM2EVMOnRamp.contract.Call(opts, &out, "getSenderNonce", sender) + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) GetSenderNonce(sender common.Address) (uint64, error) { + return _EVM2EVMOnRamp.Contract.GetSenderNonce(&_EVM2EVMOnRamp.CallOpts, sender) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCallerSession) GetSenderNonce(sender common.Address) (uint64, error) { + return _EVM2EVMOnRamp.Contract.GetSenderNonce(&_EVM2EVMOnRamp.CallOpts, sender) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCaller) GetStaticConfig(opts *bind.CallOpts) (EVM2EVMOnRampStaticConfig, error) { + var out []interface{} + err := _EVM2EVMOnRamp.contract.Call(opts, &out, "getStaticConfig") + + if err != nil { + return *new(EVM2EVMOnRampStaticConfig), err + } + + out0 := *abi.ConvertType(out[0], new(EVM2EVMOnRampStaticConfig)).(*EVM2EVMOnRampStaticConfig) + + return out0, err + +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) GetStaticConfig() (EVM2EVMOnRampStaticConfig, error) { + return _EVM2EVMOnRamp.Contract.GetStaticConfig(&_EVM2EVMOnRamp.CallOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCallerSession) GetStaticConfig() (EVM2EVMOnRampStaticConfig, error) { + return _EVM2EVMOnRamp.Contract.GetStaticConfig(&_EVM2EVMOnRamp.CallOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCaller) GetSupportedTokens(opts *bind.CallOpts, arg0 uint64) ([]common.Address, error) { + var out []interface{} + err := _EVM2EVMOnRamp.contract.Call(opts, &out, "getSupportedTokens", arg0) + + if err != nil { + return *new([]common.Address), err + } + + out0 := *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) + + return out0, err + +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) GetSupportedTokens(arg0 uint64) ([]common.Address, error) { + return _EVM2EVMOnRamp.Contract.GetSupportedTokens(&_EVM2EVMOnRamp.CallOpts, arg0) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCallerSession) GetSupportedTokens(arg0 uint64) ([]common.Address, error) { + return _EVM2EVMOnRamp.Contract.GetSupportedTokens(&_EVM2EVMOnRamp.CallOpts, arg0) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCaller) GetTokenLimitAdmin(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _EVM2EVMOnRamp.contract.Call(opts, &out, "getTokenLimitAdmin") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) GetTokenLimitAdmin() (common.Address, error) { + return _EVM2EVMOnRamp.Contract.GetTokenLimitAdmin(&_EVM2EVMOnRamp.CallOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCallerSession) GetTokenLimitAdmin() (common.Address, error) { + return _EVM2EVMOnRamp.Contract.GetTokenLimitAdmin(&_EVM2EVMOnRamp.CallOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCaller) GetTokenTransferFeeConfig(opts *bind.CallOpts, token common.Address) (EVM2EVMOnRampTokenTransferFeeConfig, error) { + var out []interface{} + err := _EVM2EVMOnRamp.contract.Call(opts, &out, "getTokenTransferFeeConfig", token) + + if err != nil { + return *new(EVM2EVMOnRampTokenTransferFeeConfig), err + } + + out0 := *abi.ConvertType(out[0], new(EVM2EVMOnRampTokenTransferFeeConfig)).(*EVM2EVMOnRampTokenTransferFeeConfig) + + return out0, err + +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) GetTokenTransferFeeConfig(token common.Address) (EVM2EVMOnRampTokenTransferFeeConfig, error) { + return _EVM2EVMOnRamp.Contract.GetTokenTransferFeeConfig(&_EVM2EVMOnRamp.CallOpts, token) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCallerSession) GetTokenTransferFeeConfig(token common.Address) (EVM2EVMOnRampTokenTransferFeeConfig, error) { + return _EVM2EVMOnRamp.Contract.GetTokenTransferFeeConfig(&_EVM2EVMOnRamp.CallOpts, token) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCaller) LinkAvailableForPayment(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _EVM2EVMOnRamp.contract.Call(opts, &out, "linkAvailableForPayment") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) LinkAvailableForPayment() (*big.Int, error) { + return _EVM2EVMOnRamp.Contract.LinkAvailableForPayment(&_EVM2EVMOnRamp.CallOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCallerSession) LinkAvailableForPayment() (*big.Int, error) { + return _EVM2EVMOnRamp.Contract.LinkAvailableForPayment(&_EVM2EVMOnRamp.CallOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCaller) Owner(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _EVM2EVMOnRamp.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 + +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) Owner() (common.Address, error) { + return _EVM2EVMOnRamp.Contract.Owner(&_EVM2EVMOnRamp.CallOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCallerSession) Owner() (common.Address, error) { + return _EVM2EVMOnRamp.Contract.Owner(&_EVM2EVMOnRamp.CallOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCaller) TypeAndVersion(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _EVM2EVMOnRamp.contract.Call(opts, &out, "typeAndVersion") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) TypeAndVersion() (string, error) { + return _EVM2EVMOnRamp.Contract.TypeAndVersion(&_EVM2EVMOnRamp.CallOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampCallerSession) TypeAndVersion() (string, error) { + return _EVM2EVMOnRamp.Contract.TypeAndVersion(&_EVM2EVMOnRamp.CallOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactor) AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + return _EVM2EVMOnRamp.contract.Transact(opts, "acceptOwnership") +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) AcceptOwnership() (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.AcceptOwnership(&_EVM2EVMOnRamp.TransactOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactorSession) AcceptOwnership() (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.AcceptOwnership(&_EVM2EVMOnRamp.TransactOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactor) ApplyPoolUpdates(opts *bind.TransactOpts, removes []InternalPoolUpdate, adds []InternalPoolUpdate) (*types.Transaction, error) { + return _EVM2EVMOnRamp.contract.Transact(opts, "applyPoolUpdates", removes, adds) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) ApplyPoolUpdates(removes []InternalPoolUpdate, adds []InternalPoolUpdate) (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.ApplyPoolUpdates(&_EVM2EVMOnRamp.TransactOpts, removes, adds) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactorSession) ApplyPoolUpdates(removes []InternalPoolUpdate, adds []InternalPoolUpdate) (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.ApplyPoolUpdates(&_EVM2EVMOnRamp.TransactOpts, removes, adds) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactor) ForwardFromRouter(opts *bind.TransactOpts, destChainSelector uint64, message ClientEVM2AnyMessage, feeTokenAmount *big.Int, originalSender common.Address) (*types.Transaction, error) { + return _EVM2EVMOnRamp.contract.Transact(opts, "forwardFromRouter", destChainSelector, message, feeTokenAmount, originalSender) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) ForwardFromRouter(destChainSelector uint64, message ClientEVM2AnyMessage, feeTokenAmount *big.Int, originalSender common.Address) (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.ForwardFromRouter(&_EVM2EVMOnRamp.TransactOpts, destChainSelector, message, feeTokenAmount, originalSender) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactorSession) ForwardFromRouter(destChainSelector uint64, message ClientEVM2AnyMessage, feeTokenAmount *big.Int, originalSender common.Address) (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.ForwardFromRouter(&_EVM2EVMOnRamp.TransactOpts, destChainSelector, message, feeTokenAmount, originalSender) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactor) PayNops(opts *bind.TransactOpts) (*types.Transaction, error) { + return _EVM2EVMOnRamp.contract.Transact(opts, "payNops") +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) PayNops() (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.PayNops(&_EVM2EVMOnRamp.TransactOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactorSession) PayNops() (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.PayNops(&_EVM2EVMOnRamp.TransactOpts) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactor) SetAdmin(opts *bind.TransactOpts, newAdmin common.Address) (*types.Transaction, error) { + return _EVM2EVMOnRamp.contract.Transact(opts, "setAdmin", newAdmin) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) SetAdmin(newAdmin common.Address) (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.SetAdmin(&_EVM2EVMOnRamp.TransactOpts, newAdmin) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactorSession) SetAdmin(newAdmin common.Address) (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.SetAdmin(&_EVM2EVMOnRamp.TransactOpts, newAdmin) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactor) SetDynamicConfig(opts *bind.TransactOpts, dynamicConfig EVM2EVMOnRampDynamicConfig) (*types.Transaction, error) { + return _EVM2EVMOnRamp.contract.Transact(opts, "setDynamicConfig", dynamicConfig) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) SetDynamicConfig(dynamicConfig EVM2EVMOnRampDynamicConfig) (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.SetDynamicConfig(&_EVM2EVMOnRamp.TransactOpts, dynamicConfig) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactorSession) SetDynamicConfig(dynamicConfig EVM2EVMOnRampDynamicConfig) (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.SetDynamicConfig(&_EVM2EVMOnRamp.TransactOpts, dynamicConfig) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactor) SetFeeTokenConfig(opts *bind.TransactOpts, feeTokenConfigArgs []EVM2EVMOnRampFeeTokenConfigArgs) (*types.Transaction, error) { + return _EVM2EVMOnRamp.contract.Transact(opts, "setFeeTokenConfig", feeTokenConfigArgs) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) SetFeeTokenConfig(feeTokenConfigArgs []EVM2EVMOnRampFeeTokenConfigArgs) (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.SetFeeTokenConfig(&_EVM2EVMOnRamp.TransactOpts, feeTokenConfigArgs) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactorSession) SetFeeTokenConfig(feeTokenConfigArgs []EVM2EVMOnRampFeeTokenConfigArgs) (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.SetFeeTokenConfig(&_EVM2EVMOnRamp.TransactOpts, feeTokenConfigArgs) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactor) SetNops(opts *bind.TransactOpts, nopsAndWeights []EVM2EVMOnRampNopAndWeight) (*types.Transaction, error) { + return _EVM2EVMOnRamp.contract.Transact(opts, "setNops", nopsAndWeights) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) SetNops(nopsAndWeights []EVM2EVMOnRampNopAndWeight) (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.SetNops(&_EVM2EVMOnRamp.TransactOpts, nopsAndWeights) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactorSession) SetNops(nopsAndWeights []EVM2EVMOnRampNopAndWeight) (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.SetNops(&_EVM2EVMOnRamp.TransactOpts, nopsAndWeights) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactor) SetRateLimiterConfig(opts *bind.TransactOpts, config RateLimiterConfig) (*types.Transaction, error) { + return _EVM2EVMOnRamp.contract.Transact(opts, "setRateLimiterConfig", config) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) SetRateLimiterConfig(config RateLimiterConfig) (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.SetRateLimiterConfig(&_EVM2EVMOnRamp.TransactOpts, config) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactorSession) SetRateLimiterConfig(config RateLimiterConfig) (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.SetRateLimiterConfig(&_EVM2EVMOnRamp.TransactOpts, config) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactor) SetTokenTransferFeeConfig(opts *bind.TransactOpts, tokenTransferFeeConfigArgs []EVM2EVMOnRampTokenTransferFeeConfigArgs) (*types.Transaction, error) { + return _EVM2EVMOnRamp.contract.Transact(opts, "setTokenTransferFeeConfig", tokenTransferFeeConfigArgs) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) SetTokenTransferFeeConfig(tokenTransferFeeConfigArgs []EVM2EVMOnRampTokenTransferFeeConfigArgs) (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.SetTokenTransferFeeConfig(&_EVM2EVMOnRamp.TransactOpts, tokenTransferFeeConfigArgs) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactorSession) SetTokenTransferFeeConfig(tokenTransferFeeConfigArgs []EVM2EVMOnRampTokenTransferFeeConfigArgs) (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.SetTokenTransferFeeConfig(&_EVM2EVMOnRamp.TransactOpts, tokenTransferFeeConfigArgs) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactor) TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) { + return _EVM2EVMOnRamp.contract.Transact(opts, "transferOwnership", to) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.TransferOwnership(&_EVM2EVMOnRamp.TransactOpts, to) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactorSession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.TransferOwnership(&_EVM2EVMOnRamp.TransactOpts, to) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactor) WithdrawNonLinkFees(opts *bind.TransactOpts, feeToken common.Address, to common.Address) (*types.Transaction, error) { + return _EVM2EVMOnRamp.contract.Transact(opts, "withdrawNonLinkFees", feeToken, to) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampSession) WithdrawNonLinkFees(feeToken common.Address, to common.Address) (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.WithdrawNonLinkFees(&_EVM2EVMOnRamp.TransactOpts, feeToken, to) +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampTransactorSession) WithdrawNonLinkFees(feeToken common.Address, to common.Address) (*types.Transaction, error) { + return _EVM2EVMOnRamp.Contract.WithdrawNonLinkFees(&_EVM2EVMOnRamp.TransactOpts, feeToken, to) +} + +type EVM2EVMOnRampAdminSetIterator struct { + Event *EVM2EVMOnRampAdminSet + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *EVM2EVMOnRampAdminSetIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOnRampAdminSet) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOnRampAdminSet) + 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() + } +} + +func (it *EVM2EVMOnRampAdminSetIterator) Error() error { + return it.fail +} + +func (it *EVM2EVMOnRampAdminSetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type EVM2EVMOnRampAdminSet struct { + NewAdmin common.Address + Raw types.Log +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) FilterAdminSet(opts *bind.FilterOpts) (*EVM2EVMOnRampAdminSetIterator, error) { + + logs, sub, err := _EVM2EVMOnRamp.contract.FilterLogs(opts, "AdminSet") + if err != nil { + return nil, err + } + return &EVM2EVMOnRampAdminSetIterator{contract: _EVM2EVMOnRamp.contract, event: "AdminSet", logs: logs, sub: sub}, nil +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) WatchAdminSet(opts *bind.WatchOpts, sink chan<- *EVM2EVMOnRampAdminSet) (event.Subscription, error) { + + logs, sub, err := _EVM2EVMOnRamp.contract.WatchLogs(opts, "AdminSet") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(EVM2EVMOnRampAdminSet) + if err := _EVM2EVMOnRamp.contract.UnpackLog(event, "AdminSet", 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 +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) ParseAdminSet(log types.Log) (*EVM2EVMOnRampAdminSet, error) { + event := new(EVM2EVMOnRampAdminSet) + if err := _EVM2EVMOnRamp.contract.UnpackLog(event, "AdminSet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type EVM2EVMOnRampCCIPSendRequestedIterator struct { + Event *EVM2EVMOnRampCCIPSendRequested + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *EVM2EVMOnRampCCIPSendRequestedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOnRampCCIPSendRequested) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOnRampCCIPSendRequested) + 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() + } +} + +func (it *EVM2EVMOnRampCCIPSendRequestedIterator) Error() error { + return it.fail +} + +func (it *EVM2EVMOnRampCCIPSendRequestedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type EVM2EVMOnRampCCIPSendRequested struct { + Message InternalEVM2EVMMessage + Raw types.Log +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) FilterCCIPSendRequested(opts *bind.FilterOpts) (*EVM2EVMOnRampCCIPSendRequestedIterator, error) { + + logs, sub, err := _EVM2EVMOnRamp.contract.FilterLogs(opts, "CCIPSendRequested") + if err != nil { + return nil, err + } + return &EVM2EVMOnRampCCIPSendRequestedIterator{contract: _EVM2EVMOnRamp.contract, event: "CCIPSendRequested", logs: logs, sub: sub}, nil +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) WatchCCIPSendRequested(opts *bind.WatchOpts, sink chan<- *EVM2EVMOnRampCCIPSendRequested) (event.Subscription, error) { + + logs, sub, err := _EVM2EVMOnRamp.contract.WatchLogs(opts, "CCIPSendRequested") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(EVM2EVMOnRampCCIPSendRequested) + if err := _EVM2EVMOnRamp.contract.UnpackLog(event, "CCIPSendRequested", 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 +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) ParseCCIPSendRequested(log types.Log) (*EVM2EVMOnRampCCIPSendRequested, error) { + event := new(EVM2EVMOnRampCCIPSendRequested) + if err := _EVM2EVMOnRamp.contract.UnpackLog(event, "CCIPSendRequested", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type EVM2EVMOnRampConfigSetIterator struct { + Event *EVM2EVMOnRampConfigSet + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *EVM2EVMOnRampConfigSetIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOnRampConfigSet) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOnRampConfigSet) + 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() + } +} + +func (it *EVM2EVMOnRampConfigSetIterator) Error() error { + return it.fail +} + +func (it *EVM2EVMOnRampConfigSetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type EVM2EVMOnRampConfigSet struct { + StaticConfig EVM2EVMOnRampStaticConfig + DynamicConfig EVM2EVMOnRampDynamicConfig + Raw types.Log +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) FilterConfigSet(opts *bind.FilterOpts) (*EVM2EVMOnRampConfigSetIterator, error) { + + logs, sub, err := _EVM2EVMOnRamp.contract.FilterLogs(opts, "ConfigSet") + if err != nil { + return nil, err + } + return &EVM2EVMOnRampConfigSetIterator{contract: _EVM2EVMOnRamp.contract, event: "ConfigSet", logs: logs, sub: sub}, nil +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) WatchConfigSet(opts *bind.WatchOpts, sink chan<- *EVM2EVMOnRampConfigSet) (event.Subscription, error) { + + logs, sub, err := _EVM2EVMOnRamp.contract.WatchLogs(opts, "ConfigSet") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(EVM2EVMOnRampConfigSet) + if err := _EVM2EVMOnRamp.contract.UnpackLog(event, "ConfigSet", 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 +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) ParseConfigSet(log types.Log) (*EVM2EVMOnRampConfigSet, error) { + event := new(EVM2EVMOnRampConfigSet) + if err := _EVM2EVMOnRamp.contract.UnpackLog(event, "ConfigSet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type EVM2EVMOnRampFeeConfigSetIterator struct { + Event *EVM2EVMOnRampFeeConfigSet + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *EVM2EVMOnRampFeeConfigSetIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOnRampFeeConfigSet) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOnRampFeeConfigSet) + 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() + } +} + +func (it *EVM2EVMOnRampFeeConfigSetIterator) Error() error { + return it.fail +} + +func (it *EVM2EVMOnRampFeeConfigSetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type EVM2EVMOnRampFeeConfigSet struct { + FeeConfig []EVM2EVMOnRampFeeTokenConfigArgs + Raw types.Log +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) FilterFeeConfigSet(opts *bind.FilterOpts) (*EVM2EVMOnRampFeeConfigSetIterator, error) { + + logs, sub, err := _EVM2EVMOnRamp.contract.FilterLogs(opts, "FeeConfigSet") + if err != nil { + return nil, err + } + return &EVM2EVMOnRampFeeConfigSetIterator{contract: _EVM2EVMOnRamp.contract, event: "FeeConfigSet", logs: logs, sub: sub}, nil +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) WatchFeeConfigSet(opts *bind.WatchOpts, sink chan<- *EVM2EVMOnRampFeeConfigSet) (event.Subscription, error) { + + logs, sub, err := _EVM2EVMOnRamp.contract.WatchLogs(opts, "FeeConfigSet") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(EVM2EVMOnRampFeeConfigSet) + if err := _EVM2EVMOnRamp.contract.UnpackLog(event, "FeeConfigSet", 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 +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) ParseFeeConfigSet(log types.Log) (*EVM2EVMOnRampFeeConfigSet, error) { + event := new(EVM2EVMOnRampFeeConfigSet) + if err := _EVM2EVMOnRamp.contract.UnpackLog(event, "FeeConfigSet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type EVM2EVMOnRampNopPaidIterator struct { + Event *EVM2EVMOnRampNopPaid + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *EVM2EVMOnRampNopPaidIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOnRampNopPaid) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOnRampNopPaid) + 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() + } +} + +func (it *EVM2EVMOnRampNopPaidIterator) Error() error { + return it.fail +} + +func (it *EVM2EVMOnRampNopPaidIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type EVM2EVMOnRampNopPaid struct { + Nop common.Address + Amount *big.Int + Raw types.Log +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) FilterNopPaid(opts *bind.FilterOpts, nop []common.Address) (*EVM2EVMOnRampNopPaidIterator, error) { + + var nopRule []interface{} + for _, nopItem := range nop { + nopRule = append(nopRule, nopItem) + } + + logs, sub, err := _EVM2EVMOnRamp.contract.FilterLogs(opts, "NopPaid", nopRule) + if err != nil { + return nil, err + } + return &EVM2EVMOnRampNopPaidIterator{contract: _EVM2EVMOnRamp.contract, event: "NopPaid", logs: logs, sub: sub}, nil +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) WatchNopPaid(opts *bind.WatchOpts, sink chan<- *EVM2EVMOnRampNopPaid, nop []common.Address) (event.Subscription, error) { + + var nopRule []interface{} + for _, nopItem := range nop { + nopRule = append(nopRule, nopItem) + } + + logs, sub, err := _EVM2EVMOnRamp.contract.WatchLogs(opts, "NopPaid", nopRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(EVM2EVMOnRampNopPaid) + if err := _EVM2EVMOnRamp.contract.UnpackLog(event, "NopPaid", 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 +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) ParseNopPaid(log types.Log) (*EVM2EVMOnRampNopPaid, error) { + event := new(EVM2EVMOnRampNopPaid) + if err := _EVM2EVMOnRamp.contract.UnpackLog(event, "NopPaid", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type EVM2EVMOnRampNopsSetIterator struct { + Event *EVM2EVMOnRampNopsSet + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *EVM2EVMOnRampNopsSetIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOnRampNopsSet) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOnRampNopsSet) + 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() + } +} + +func (it *EVM2EVMOnRampNopsSetIterator) Error() error { + return it.fail +} + +func (it *EVM2EVMOnRampNopsSetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type EVM2EVMOnRampNopsSet struct { + NopWeightsTotal *big.Int + NopsAndWeights []EVM2EVMOnRampNopAndWeight + Raw types.Log +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) FilterNopsSet(opts *bind.FilterOpts) (*EVM2EVMOnRampNopsSetIterator, error) { + + logs, sub, err := _EVM2EVMOnRamp.contract.FilterLogs(opts, "NopsSet") + if err != nil { + return nil, err + } + return &EVM2EVMOnRampNopsSetIterator{contract: _EVM2EVMOnRamp.contract, event: "NopsSet", logs: logs, sub: sub}, nil +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) WatchNopsSet(opts *bind.WatchOpts, sink chan<- *EVM2EVMOnRampNopsSet) (event.Subscription, error) { + + logs, sub, err := _EVM2EVMOnRamp.contract.WatchLogs(opts, "NopsSet") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(EVM2EVMOnRampNopsSet) + if err := _EVM2EVMOnRamp.contract.UnpackLog(event, "NopsSet", 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 +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) ParseNopsSet(log types.Log) (*EVM2EVMOnRampNopsSet, error) { + event := new(EVM2EVMOnRampNopsSet) + if err := _EVM2EVMOnRamp.contract.UnpackLog(event, "NopsSet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type EVM2EVMOnRampOwnershipTransferRequestedIterator struct { + Event *EVM2EVMOnRampOwnershipTransferRequested + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *EVM2EVMOnRampOwnershipTransferRequestedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOnRampOwnershipTransferRequested) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOnRampOwnershipTransferRequested) + 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() + } +} + +func (it *EVM2EVMOnRampOwnershipTransferRequestedIterator) Error() error { + return it.fail +} + +func (it *EVM2EVMOnRampOwnershipTransferRequestedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type EVM2EVMOnRampOwnershipTransferRequested struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*EVM2EVMOnRampOwnershipTransferRequestedIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _EVM2EVMOnRamp.contract.FilterLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return &EVM2EVMOnRampOwnershipTransferRequestedIterator{contract: _EVM2EVMOnRamp.contract, event: "OwnershipTransferRequested", logs: logs, sub: sub}, nil +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *EVM2EVMOnRampOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _EVM2EVMOnRamp.contract.WatchLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(EVM2EVMOnRampOwnershipTransferRequested) + if err := _EVM2EVMOnRamp.contract.UnpackLog(event, "OwnershipTransferRequested", 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 +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) ParseOwnershipTransferRequested(log types.Log) (*EVM2EVMOnRampOwnershipTransferRequested, error) { + event := new(EVM2EVMOnRampOwnershipTransferRequested) + if err := _EVM2EVMOnRamp.contract.UnpackLog(event, "OwnershipTransferRequested", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type EVM2EVMOnRampOwnershipTransferredIterator struct { + Event *EVM2EVMOnRampOwnershipTransferred + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *EVM2EVMOnRampOwnershipTransferredIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOnRampOwnershipTransferred) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOnRampOwnershipTransferred) + 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() + } +} + +func (it *EVM2EVMOnRampOwnershipTransferredIterator) Error() error { + return it.fail +} + +func (it *EVM2EVMOnRampOwnershipTransferredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type EVM2EVMOnRampOwnershipTransferred struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*EVM2EVMOnRampOwnershipTransferredIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _EVM2EVMOnRamp.contract.FilterLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return &EVM2EVMOnRampOwnershipTransferredIterator{contract: _EVM2EVMOnRamp.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *EVM2EVMOnRampOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _EVM2EVMOnRamp.contract.WatchLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(EVM2EVMOnRampOwnershipTransferred) + if err := _EVM2EVMOnRamp.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 +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) ParseOwnershipTransferred(log types.Log) (*EVM2EVMOnRampOwnershipTransferred, error) { + event := new(EVM2EVMOnRampOwnershipTransferred) + if err := _EVM2EVMOnRamp.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type EVM2EVMOnRampPoolAddedIterator struct { + Event *EVM2EVMOnRampPoolAdded + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *EVM2EVMOnRampPoolAddedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOnRampPoolAdded) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOnRampPoolAdded) + 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() + } +} + +func (it *EVM2EVMOnRampPoolAddedIterator) Error() error { + return it.fail +} + +func (it *EVM2EVMOnRampPoolAddedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type EVM2EVMOnRampPoolAdded struct { + Token common.Address + Pool common.Address + Raw types.Log +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) FilterPoolAdded(opts *bind.FilterOpts) (*EVM2EVMOnRampPoolAddedIterator, error) { + + logs, sub, err := _EVM2EVMOnRamp.contract.FilterLogs(opts, "PoolAdded") + if err != nil { + return nil, err + } + return &EVM2EVMOnRampPoolAddedIterator{contract: _EVM2EVMOnRamp.contract, event: "PoolAdded", logs: logs, sub: sub}, nil +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) WatchPoolAdded(opts *bind.WatchOpts, sink chan<- *EVM2EVMOnRampPoolAdded) (event.Subscription, error) { + + logs, sub, err := _EVM2EVMOnRamp.contract.WatchLogs(opts, "PoolAdded") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(EVM2EVMOnRampPoolAdded) + if err := _EVM2EVMOnRamp.contract.UnpackLog(event, "PoolAdded", 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 +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) ParsePoolAdded(log types.Log) (*EVM2EVMOnRampPoolAdded, error) { + event := new(EVM2EVMOnRampPoolAdded) + if err := _EVM2EVMOnRamp.contract.UnpackLog(event, "PoolAdded", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type EVM2EVMOnRampPoolRemovedIterator struct { + Event *EVM2EVMOnRampPoolRemoved + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *EVM2EVMOnRampPoolRemovedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOnRampPoolRemoved) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOnRampPoolRemoved) + 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() + } +} + +func (it *EVM2EVMOnRampPoolRemovedIterator) Error() error { + return it.fail +} + +func (it *EVM2EVMOnRampPoolRemovedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type EVM2EVMOnRampPoolRemoved struct { + Token common.Address + Pool common.Address + Raw types.Log +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) FilterPoolRemoved(opts *bind.FilterOpts) (*EVM2EVMOnRampPoolRemovedIterator, error) { + + logs, sub, err := _EVM2EVMOnRamp.contract.FilterLogs(opts, "PoolRemoved") + if err != nil { + return nil, err + } + return &EVM2EVMOnRampPoolRemovedIterator{contract: _EVM2EVMOnRamp.contract, event: "PoolRemoved", logs: logs, sub: sub}, nil +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) WatchPoolRemoved(opts *bind.WatchOpts, sink chan<- *EVM2EVMOnRampPoolRemoved) (event.Subscription, error) { + + logs, sub, err := _EVM2EVMOnRamp.contract.WatchLogs(opts, "PoolRemoved") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(EVM2EVMOnRampPoolRemoved) + if err := _EVM2EVMOnRamp.contract.UnpackLog(event, "PoolRemoved", 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 +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) ParsePoolRemoved(log types.Log) (*EVM2EVMOnRampPoolRemoved, error) { + event := new(EVM2EVMOnRampPoolRemoved) + if err := _EVM2EVMOnRamp.contract.UnpackLog(event, "PoolRemoved", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type EVM2EVMOnRampTokenTransferFeeConfigSetIterator struct { + Event *EVM2EVMOnRampTokenTransferFeeConfigSet + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *EVM2EVMOnRampTokenTransferFeeConfigSetIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOnRampTokenTransferFeeConfigSet) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(EVM2EVMOnRampTokenTransferFeeConfigSet) + 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() + } +} + +func (it *EVM2EVMOnRampTokenTransferFeeConfigSetIterator) Error() error { + return it.fail +} + +func (it *EVM2EVMOnRampTokenTransferFeeConfigSetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type EVM2EVMOnRampTokenTransferFeeConfigSet struct { + TransferFeeConfig []EVM2EVMOnRampTokenTransferFeeConfigArgs + Raw types.Log +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) FilterTokenTransferFeeConfigSet(opts *bind.FilterOpts) (*EVM2EVMOnRampTokenTransferFeeConfigSetIterator, error) { + + logs, sub, err := _EVM2EVMOnRamp.contract.FilterLogs(opts, "TokenTransferFeeConfigSet") + if err != nil { + return nil, err + } + return &EVM2EVMOnRampTokenTransferFeeConfigSetIterator{contract: _EVM2EVMOnRamp.contract, event: "TokenTransferFeeConfigSet", logs: logs, sub: sub}, nil +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) WatchTokenTransferFeeConfigSet(opts *bind.WatchOpts, sink chan<- *EVM2EVMOnRampTokenTransferFeeConfigSet) (event.Subscription, error) { + + logs, sub, err := _EVM2EVMOnRamp.contract.WatchLogs(opts, "TokenTransferFeeConfigSet") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(EVM2EVMOnRampTokenTransferFeeConfigSet) + if err := _EVM2EVMOnRamp.contract.UnpackLog(event, "TokenTransferFeeConfigSet", 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 +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRampFilterer) ParseTokenTransferFeeConfigSet(log types.Log) (*EVM2EVMOnRampTokenTransferFeeConfigSet, error) { + event := new(EVM2EVMOnRampTokenTransferFeeConfigSet) + if err := _EVM2EVMOnRamp.contract.UnpackLog(event, "TokenTransferFeeConfigSet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type GetNops struct { + NopsAndWeights []EVM2EVMOnRampNopAndWeight + WeightsTotal *big.Int +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRamp) ParseLog(log types.Log) (generated.AbigenLog, error) { + switch log.Topics[0] { + case _EVM2EVMOnRamp.abi.Events["AdminSet"].ID: + return _EVM2EVMOnRamp.ParseAdminSet(log) + case _EVM2EVMOnRamp.abi.Events["CCIPSendRequested"].ID: + return _EVM2EVMOnRamp.ParseCCIPSendRequested(log) + case _EVM2EVMOnRamp.abi.Events["ConfigSet"].ID: + return _EVM2EVMOnRamp.ParseConfigSet(log) + case _EVM2EVMOnRamp.abi.Events["FeeConfigSet"].ID: + return _EVM2EVMOnRamp.ParseFeeConfigSet(log) + case _EVM2EVMOnRamp.abi.Events["NopPaid"].ID: + return _EVM2EVMOnRamp.ParseNopPaid(log) + case _EVM2EVMOnRamp.abi.Events["NopsSet"].ID: + return _EVM2EVMOnRamp.ParseNopsSet(log) + case _EVM2EVMOnRamp.abi.Events["OwnershipTransferRequested"].ID: + return _EVM2EVMOnRamp.ParseOwnershipTransferRequested(log) + case _EVM2EVMOnRamp.abi.Events["OwnershipTransferred"].ID: + return _EVM2EVMOnRamp.ParseOwnershipTransferred(log) + case _EVM2EVMOnRamp.abi.Events["PoolAdded"].ID: + return _EVM2EVMOnRamp.ParsePoolAdded(log) + case _EVM2EVMOnRamp.abi.Events["PoolRemoved"].ID: + return _EVM2EVMOnRamp.ParsePoolRemoved(log) + case _EVM2EVMOnRamp.abi.Events["TokenTransferFeeConfigSet"].ID: + return _EVM2EVMOnRamp.ParseTokenTransferFeeConfigSet(log) + + default: + return nil, fmt.Errorf("abigen wrapper received unknown log topic: %v", log.Topics[0]) + } +} + +func (EVM2EVMOnRampAdminSet) Topic() common.Hash { + return common.HexToHash("0x8fe72c3e0020beb3234e76ae6676fa576fbfcae600af1c4fea44784cf0db329c") +} + +func (EVM2EVMOnRampCCIPSendRequested) Topic() common.Hash { + return common.HexToHash("0xd0c3c799bf9e2639de44391e7f524d229b2b55f5b1ea94b2bf7da42f7243dddd") +} + +func (EVM2EVMOnRampConfigSet) Topic() common.Hash { + return common.HexToHash("0x2a57f7c2027cf032c78b77d4d8d2fbd20ad22e5d5e5b5fb23ac7d7820d44adc6") +} + +func (EVM2EVMOnRampFeeConfigSet) Topic() common.Hash { + return common.HexToHash("0x067924bf9277d905a9a4631a06d959bc032ace86b3caa835ae7e403d4f39010e") +} + +func (EVM2EVMOnRampNopPaid) Topic() common.Hash { + return common.HexToHash("0x55fdec2aab60a41fa5abb106670eb1006f5aeaee1ba7afea2bc89b5b3ec7678f") +} + +func (EVM2EVMOnRampNopsSet) Topic() common.Hash { + return common.HexToHash("0x8c337bff38141c507abd25c547606bdde78fe8c12e941ab613f3a565fea6cd24") +} + +func (EVM2EVMOnRampOwnershipTransferRequested) Topic() common.Hash { + return common.HexToHash("0xed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae1278") +} + +func (EVM2EVMOnRampOwnershipTransferred) Topic() common.Hash { + return common.HexToHash("0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0") +} + +func (EVM2EVMOnRampPoolAdded) Topic() common.Hash { + return common.HexToHash("0x95f865c2808f8b2a85eea2611db7843150ee7835ef1403f9755918a97d76933c") +} + +func (EVM2EVMOnRampPoolRemoved) Topic() common.Hash { + return common.HexToHash("0x987eb3c2f78454541205f72f34839b434c306c9eaf4922efd7c0c3060fdb2e4c") +} + +func (EVM2EVMOnRampTokenTransferFeeConfigSet) Topic() common.Hash { + return common.HexToHash("0x555c74101f7a15746d31c6731170310e667bcc607996b2fc0b981a7b26a416e9") +} + +func (_EVM2EVMOnRamp *EVM2EVMOnRamp) Address() common.Address { + return _EVM2EVMOnRamp.address +} + +type EVM2EVMOnRampInterface interface { + CurrentRateLimiterState(opts *bind.CallOpts) (RateLimiterTokenBucket, error) + + GetDynamicConfig(opts *bind.CallOpts) (EVM2EVMOnRampDynamicConfig, error) + + GetExpectedNextSequenceNumber(opts *bind.CallOpts) (uint64, error) + + GetFee(opts *bind.CallOpts, destChainSelector uint64, message ClientEVM2AnyMessage) (*big.Int, error) + + GetFeeTokenConfig(opts *bind.CallOpts, token common.Address) (EVM2EVMOnRampFeeTokenConfig, error) + + GetNopFeesJuels(opts *bind.CallOpts) (*big.Int, error) + + GetNops(opts *bind.CallOpts) (GetNops, + + error) + + GetPoolBySourceToken(opts *bind.CallOpts, arg0 uint64, sourceToken common.Address) (common.Address, error) + + GetSenderNonce(opts *bind.CallOpts, sender common.Address) (uint64, error) + + GetStaticConfig(opts *bind.CallOpts) (EVM2EVMOnRampStaticConfig, error) + + GetSupportedTokens(opts *bind.CallOpts, arg0 uint64) ([]common.Address, error) + + GetTokenLimitAdmin(opts *bind.CallOpts) (common.Address, error) + + GetTokenTransferFeeConfig(opts *bind.CallOpts, token common.Address) (EVM2EVMOnRampTokenTransferFeeConfig, error) + + LinkAvailableForPayment(opts *bind.CallOpts) (*big.Int, error) + + Owner(opts *bind.CallOpts) (common.Address, error) + + TypeAndVersion(opts *bind.CallOpts) (string, error) + + AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) + + ApplyPoolUpdates(opts *bind.TransactOpts, removes []InternalPoolUpdate, adds []InternalPoolUpdate) (*types.Transaction, error) + + ForwardFromRouter(opts *bind.TransactOpts, destChainSelector uint64, message ClientEVM2AnyMessage, feeTokenAmount *big.Int, originalSender common.Address) (*types.Transaction, error) + + PayNops(opts *bind.TransactOpts) (*types.Transaction, error) + + SetAdmin(opts *bind.TransactOpts, newAdmin common.Address) (*types.Transaction, error) + + SetDynamicConfig(opts *bind.TransactOpts, dynamicConfig EVM2EVMOnRampDynamicConfig) (*types.Transaction, error) + + SetFeeTokenConfig(opts *bind.TransactOpts, feeTokenConfigArgs []EVM2EVMOnRampFeeTokenConfigArgs) (*types.Transaction, error) + + SetNops(opts *bind.TransactOpts, nopsAndWeights []EVM2EVMOnRampNopAndWeight) (*types.Transaction, error) + + SetRateLimiterConfig(opts *bind.TransactOpts, config RateLimiterConfig) (*types.Transaction, error) + + SetTokenTransferFeeConfig(opts *bind.TransactOpts, tokenTransferFeeConfigArgs []EVM2EVMOnRampTokenTransferFeeConfigArgs) (*types.Transaction, error) + + TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) + + WithdrawNonLinkFees(opts *bind.TransactOpts, feeToken common.Address, to common.Address) (*types.Transaction, error) + + FilterAdminSet(opts *bind.FilterOpts) (*EVM2EVMOnRampAdminSetIterator, error) + + WatchAdminSet(opts *bind.WatchOpts, sink chan<- *EVM2EVMOnRampAdminSet) (event.Subscription, error) + + ParseAdminSet(log types.Log) (*EVM2EVMOnRampAdminSet, error) + + FilterCCIPSendRequested(opts *bind.FilterOpts) (*EVM2EVMOnRampCCIPSendRequestedIterator, error) + + WatchCCIPSendRequested(opts *bind.WatchOpts, sink chan<- *EVM2EVMOnRampCCIPSendRequested) (event.Subscription, error) + + ParseCCIPSendRequested(log types.Log) (*EVM2EVMOnRampCCIPSendRequested, error) + + FilterConfigSet(opts *bind.FilterOpts) (*EVM2EVMOnRampConfigSetIterator, error) + + WatchConfigSet(opts *bind.WatchOpts, sink chan<- *EVM2EVMOnRampConfigSet) (event.Subscription, error) + + ParseConfigSet(log types.Log) (*EVM2EVMOnRampConfigSet, error) + + FilterFeeConfigSet(opts *bind.FilterOpts) (*EVM2EVMOnRampFeeConfigSetIterator, error) + + WatchFeeConfigSet(opts *bind.WatchOpts, sink chan<- *EVM2EVMOnRampFeeConfigSet) (event.Subscription, error) + + ParseFeeConfigSet(log types.Log) (*EVM2EVMOnRampFeeConfigSet, error) + + FilterNopPaid(opts *bind.FilterOpts, nop []common.Address) (*EVM2EVMOnRampNopPaidIterator, error) + + WatchNopPaid(opts *bind.WatchOpts, sink chan<- *EVM2EVMOnRampNopPaid, nop []common.Address) (event.Subscription, error) + + ParseNopPaid(log types.Log) (*EVM2EVMOnRampNopPaid, error) + + FilterNopsSet(opts *bind.FilterOpts) (*EVM2EVMOnRampNopsSetIterator, error) + + WatchNopsSet(opts *bind.WatchOpts, sink chan<- *EVM2EVMOnRampNopsSet) (event.Subscription, error) + + ParseNopsSet(log types.Log) (*EVM2EVMOnRampNopsSet, error) + + FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*EVM2EVMOnRampOwnershipTransferRequestedIterator, error) + + WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *EVM2EVMOnRampOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferRequested(log types.Log) (*EVM2EVMOnRampOwnershipTransferRequested, error) + + FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*EVM2EVMOnRampOwnershipTransferredIterator, error) + + WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *EVM2EVMOnRampOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferred(log types.Log) (*EVM2EVMOnRampOwnershipTransferred, error) + + FilterPoolAdded(opts *bind.FilterOpts) (*EVM2EVMOnRampPoolAddedIterator, error) + + WatchPoolAdded(opts *bind.WatchOpts, sink chan<- *EVM2EVMOnRampPoolAdded) (event.Subscription, error) + + ParsePoolAdded(log types.Log) (*EVM2EVMOnRampPoolAdded, error) + + FilterPoolRemoved(opts *bind.FilterOpts) (*EVM2EVMOnRampPoolRemovedIterator, error) + + WatchPoolRemoved(opts *bind.WatchOpts, sink chan<- *EVM2EVMOnRampPoolRemoved) (event.Subscription, error) + + ParsePoolRemoved(log types.Log) (*EVM2EVMOnRampPoolRemoved, error) + + FilterTokenTransferFeeConfigSet(opts *bind.FilterOpts) (*EVM2EVMOnRampTokenTransferFeeConfigSetIterator, error) + + WatchTokenTransferFeeConfigSet(opts *bind.WatchOpts, sink chan<- *EVM2EVMOnRampTokenTransferFeeConfigSet) (event.Subscription, error) + + ParseTokenTransferFeeConfigSet(log types.Log) (*EVM2EVMOnRampTokenTransferFeeConfigSet, error) + + ParseLog(log types.Log) (generated.AbigenLog, error) + + Address() common.Address +} diff --git a/core/gethwrappers/ccip/generated/fee_quoter/fee_quoter.go b/core/gethwrappers/ccip/generated/fee_quoter/fee_quoter.go new file mode 100644 index 00000000000..d8f616053a8 --- /dev/null +++ b/core/gethwrappers/ccip/generated/fee_quoter/fee_quoter.go @@ -0,0 +1,3041 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package fee_quoter + +import ( + "errors" + "fmt" + "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" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" +) + +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +type AuthorizedCallersAuthorizedCallerArgs struct { + AddedCallers []common.Address + RemovedCallers []common.Address +} + +type ClientEVM2AnyMessage struct { + Receiver []byte + Data []byte + TokenAmounts []ClientEVMTokenAmount + FeeToken common.Address + ExtraArgs []byte +} + +type ClientEVMTokenAmount struct { + Token common.Address + Amount *big.Int +} + +type FeeQuoterDestChainConfig struct { + IsEnabled bool + MaxNumberOfTokensPerMsg uint16 + MaxDataBytes uint32 + MaxPerMsgGasLimit uint32 + DestGasOverhead uint32 + DestGasPerPayloadByte uint16 + DestDataAvailabilityOverheadGas uint32 + DestGasPerDataAvailabilityByte uint16 + DestDataAvailabilityMultiplierBps uint16 + DefaultTokenFeeUSDCents uint16 + DefaultTokenDestGasOverhead uint32 + DefaultTxGasLimit uint32 + GasMultiplierWeiPerEth uint64 + NetworkFeeUSDCents uint32 + EnforceOutOfOrder bool + ChainFamilySelector [4]byte +} + +type FeeQuoterDestChainConfigArgs struct { + DestChainSelector uint64 + DestChainConfig FeeQuoterDestChainConfig +} + +type FeeQuoterPremiumMultiplierWeiPerEthArgs struct { + Token common.Address + PremiumMultiplierWeiPerEth uint64 +} + +type FeeQuoterStaticConfig struct { + MaxFeeJuelsPerMsg *big.Int + LinkToken common.Address + StalenessThreshold uint32 +} + +type FeeQuoterTokenPriceFeedUpdate struct { + SourceToken common.Address + FeedConfig IFeeQuoterTokenPriceFeedConfig +} + +type FeeQuoterTokenTransferFeeConfig struct { + MinFeeUSDCents uint32 + MaxFeeUSDCents uint32 + DeciBps uint16 + DestGasOverhead uint32 + DestBytesOverhead uint32 + IsEnabled bool +} + +type FeeQuoterTokenTransferFeeConfigArgs struct { + DestChainSelector uint64 + TokenTransferFeeConfigs []FeeQuoterTokenTransferFeeConfigSingleTokenArgs +} + +type FeeQuoterTokenTransferFeeConfigRemoveArgs struct { + DestChainSelector uint64 + Token common.Address +} + +type FeeQuoterTokenTransferFeeConfigSingleTokenArgs struct { + Token common.Address + TokenTransferFeeConfig FeeQuoterTokenTransferFeeConfig +} + +type IFeeQuoterTokenPriceFeedConfig struct { + DataFeedAddress common.Address + TokenDecimals uint8 +} + +type InternalGasPriceUpdate struct { + DestChainSelector uint64 + UsdPerUnitGas *big.Int +} + +type InternalPriceUpdates struct { + TokenPriceUpdates []InternalTokenPriceUpdate + GasPriceUpdates []InternalGasPriceUpdate +} + +type InternalRampTokenAmount struct { + SourcePoolAddress []byte + DestTokenAddress []byte + ExtraData []byte + Amount *big.Int + DestExecData []byte +} + +type InternalTimestampedPackedUint224 struct { + Value *big.Int + Timestamp uint32 +} + +type InternalTokenPriceUpdate struct { + SourceToken common.Address + UsdPerToken *big.Int +} + +type KeystoneFeedsPermissionHandlerPermission struct { + Forwarder common.Address + WorkflowName [10]byte + ReportName [2]byte + WorkflowOwner common.Address + IsAllowed bool +} + +var FeeQuoterMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"components\":[{\"internalType\":\"uint96\",\"name\":\"maxFeeJuelsPerMsg\",\"type\":\"uint96\"},{\"internalType\":\"address\",\"name\":\"linkToken\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"stalenessThreshold\",\"type\":\"uint32\"}],\"internalType\":\"structFeeQuoter.StaticConfig\",\"name\":\"staticConfig\",\"type\":\"tuple\"},{\"internalType\":\"address[]\",\"name\":\"priceUpdaters\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"feeTokens\",\"type\":\"address[]\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"sourceToken\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"dataFeedAddress\",\"type\":\"address\"},{\"internalType\":\"uint8\",\"name\":\"tokenDecimals\",\"type\":\"uint8\"}],\"internalType\":\"structIFeeQuoter.TokenPriceFeedConfig\",\"name\":\"feedConfig\",\"type\":\"tuple\"}],\"internalType\":\"structFeeQuoter.TokenPriceFeedUpdate[]\",\"name\":\"tokenPriceFeeds\",\"type\":\"tuple[]\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"uint32\",\"name\":\"minFeeUSDCents\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"maxFeeUSDCents\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"deciBps\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"destGasOverhead\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"destBytesOverhead\",\"type\":\"uint32\"},{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"}],\"internalType\":\"structFeeQuoter.TokenTransferFeeConfig\",\"name\":\"tokenTransferFeeConfig\",\"type\":\"tuple\"}],\"internalType\":\"structFeeQuoter.TokenTransferFeeConfigSingleTokenArgs[]\",\"name\":\"tokenTransferFeeConfigs\",\"type\":\"tuple[]\"}],\"internalType\":\"structFeeQuoter.TokenTransferFeeConfigArgs[]\",\"name\":\"tokenTransferFeeConfigArgs\",\"type\":\"tuple[]\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"premiumMultiplierWeiPerEth\",\"type\":\"uint64\"}],\"internalType\":\"structFeeQuoter.PremiumMultiplierWeiPerEthArgs[]\",\"name\":\"premiumMultiplierWeiPerEthArgs\",\"type\":\"tuple[]\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint16\",\"name\":\"maxNumberOfTokensPerMsg\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"maxDataBytes\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"maxPerMsgGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"destGasOverhead\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"destGasPerPayloadByte\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"destDataAvailabilityOverheadGas\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"destGasPerDataAvailabilityByte\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"destDataAvailabilityMultiplierBps\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"defaultTokenFeeUSDCents\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"defaultTokenDestGasOverhead\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"defaultTxGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"gasMultiplierWeiPerEth\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"networkFeeUSDCents\",\"type\":\"uint32\"},{\"internalType\":\"bool\",\"name\":\"enforceOutOfOrder\",\"type\":\"bool\"},{\"internalType\":\"bytes4\",\"name\":\"chainFamilySelector\",\"type\":\"bytes4\"}],\"internalType\":\"structFeeQuoter.DestChainConfig\",\"name\":\"destChainConfig\",\"type\":\"tuple\"}],\"internalType\":\"structFeeQuoter.DestChainConfigArgs[]\",\"name\":\"destChainConfigArgs\",\"type\":\"tuple[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"chain\",\"type\":\"uint64\"}],\"name\":\"ChainNotSupported\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DataFeedValueOutOfUint224Range\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"}],\"name\":\"DestinationChainNotEnabled\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ExtraArgOutOfOrderExecutionMustBeTrue\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"FeeTokenNotSupported\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"destBytesOverhead\",\"type\":\"uint32\"}],\"name\":\"InvalidDestBytesOverhead\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"}],\"name\":\"InvalidDestChainConfig\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"encodedAddress\",\"type\":\"bytes\"}],\"name\":\"InvalidEVMAddress\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidExtraArgsTag\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidStaticConfig\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"msgFeeJuels\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxFeeJuelsPerMsg\",\"type\":\"uint256\"}],\"name\":\"MessageFeeTooHigh\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"MessageGasLimitTooHigh\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"maxSize\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"actualSize\",\"type\":\"uint256\"}],\"name\":\"MessageTooLarge\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"forwarder\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"workflowOwner\",\"type\":\"address\"},{\"internalType\":\"bytes10\",\"name\":\"workflowName\",\"type\":\"bytes10\"},{\"internalType\":\"bytes2\",\"name\":\"reportName\",\"type\":\"bytes2\"}],\"name\":\"ReportForwarderUnauthorized\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"SourceTokenDataTooLarge\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint256\",\"name\":\"threshold\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"timePassed\",\"type\":\"uint256\"}],\"name\":\"StaleGasPrice\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"feedTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"storedTimeStamp\",\"type\":\"uint256\"}],\"name\":\"StaleKeystoneUpdate\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"TokenNotSupported\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"}],\"name\":\"UnauthorizedCaller\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UnsupportedNumberOfTokens\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddressNotAllowed\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"}],\"name\":\"AuthorizedCallerAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"}],\"name\":\"AuthorizedCallerRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint16\",\"name\":\"maxNumberOfTokensPerMsg\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"maxDataBytes\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"maxPerMsgGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"destGasOverhead\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"destGasPerPayloadByte\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"destDataAvailabilityOverheadGas\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"destGasPerDataAvailabilityByte\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"destDataAvailabilityMultiplierBps\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"defaultTokenFeeUSDCents\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"defaultTokenDestGasOverhead\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"defaultTxGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"gasMultiplierWeiPerEth\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"networkFeeUSDCents\",\"type\":\"uint32\"},{\"internalType\":\"bool\",\"name\":\"enforceOutOfOrder\",\"type\":\"bool\"},{\"internalType\":\"bytes4\",\"name\":\"chainFamilySelector\",\"type\":\"bytes4\"}],\"indexed\":false,\"internalType\":\"structFeeQuoter.DestChainConfig\",\"name\":\"destChainConfig\",\"type\":\"tuple\"}],\"name\":\"DestChainAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint16\",\"name\":\"maxNumberOfTokensPerMsg\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"maxDataBytes\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"maxPerMsgGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"destGasOverhead\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"destGasPerPayloadByte\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"destDataAvailabilityOverheadGas\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"destGasPerDataAvailabilityByte\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"destDataAvailabilityMultiplierBps\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"defaultTokenFeeUSDCents\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"defaultTokenDestGasOverhead\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"defaultTxGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"gasMultiplierWeiPerEth\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"networkFeeUSDCents\",\"type\":\"uint32\"},{\"internalType\":\"bool\",\"name\":\"enforceOutOfOrder\",\"type\":\"bool\"},{\"internalType\":\"bytes4\",\"name\":\"chainFamilySelector\",\"type\":\"bytes4\"}],\"indexed\":false,\"internalType\":\"structFeeQuoter.DestChainConfig\",\"name\":\"destChainConfig\",\"type\":\"tuple\"}],\"name\":\"DestChainConfigUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"feeToken\",\"type\":\"address\"}],\"name\":\"FeeTokenAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"feeToken\",\"type\":\"address\"}],\"name\":\"FeeTokenRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"premiumMultiplierWeiPerEth\",\"type\":\"uint64\"}],\"name\":\"PremiumMultiplierWeiPerEthUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"dataFeedAddress\",\"type\":\"address\"},{\"internalType\":\"uint8\",\"name\":\"tokenDecimals\",\"type\":\"uint8\"}],\"indexed\":false,\"internalType\":\"structIFeeQuoter.TokenPriceFeedConfig\",\"name\":\"priceFeedConfig\",\"type\":\"tuple\"}],\"name\":\"PriceFeedPerTokenUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"reportId\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"forwarder\",\"type\":\"address\"},{\"internalType\":\"bytes10\",\"name\":\"workflowName\",\"type\":\"bytes10\"},{\"internalType\":\"bytes2\",\"name\":\"reportName\",\"type\":\"bytes2\"},{\"internalType\":\"address\",\"name\":\"workflowOwner\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"isAllowed\",\"type\":\"bool\"}],\"indexed\":false,\"internalType\":\"structKeystoneFeedsPermissionHandler.Permission\",\"name\":\"permission\",\"type\":\"tuple\"}],\"name\":\"ReportPermissionSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"TokenTransferFeeConfigDeleted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"uint32\",\"name\":\"minFeeUSDCents\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"maxFeeUSDCents\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"deciBps\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"destGasOverhead\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"destBytesOverhead\",\"type\":\"uint32\"},{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"}],\"indexed\":false,\"internalType\":\"structFeeQuoter.TokenTransferFeeConfig\",\"name\":\"tokenTransferFeeConfig\",\"type\":\"tuple\"}],\"name\":\"TokenTransferFeeConfigUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"name\":\"UsdPerTokenUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"destChain\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"name\":\"UsdPerUnitGasUpdated\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address[]\",\"name\":\"addedCallers\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"removedCallers\",\"type\":\"address[]\"}],\"internalType\":\"structAuthorizedCallers.AuthorizedCallerArgs\",\"name\":\"authorizedCallerArgs\",\"type\":\"tuple\"}],\"name\":\"applyAuthorizedCallerUpdates\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint16\",\"name\":\"maxNumberOfTokensPerMsg\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"maxDataBytes\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"maxPerMsgGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"destGasOverhead\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"destGasPerPayloadByte\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"destDataAvailabilityOverheadGas\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"destGasPerDataAvailabilityByte\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"destDataAvailabilityMultiplierBps\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"defaultTokenFeeUSDCents\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"defaultTokenDestGasOverhead\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"defaultTxGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"gasMultiplierWeiPerEth\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"networkFeeUSDCents\",\"type\":\"uint32\"},{\"internalType\":\"bool\",\"name\":\"enforceOutOfOrder\",\"type\":\"bool\"},{\"internalType\":\"bytes4\",\"name\":\"chainFamilySelector\",\"type\":\"bytes4\"}],\"internalType\":\"structFeeQuoter.DestChainConfig\",\"name\":\"destChainConfig\",\"type\":\"tuple\"}],\"internalType\":\"structFeeQuoter.DestChainConfigArgs[]\",\"name\":\"destChainConfigArgs\",\"type\":\"tuple[]\"}],\"name\":\"applyDestChainConfigUpdates\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"feeTokensToAdd\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"feeTokensToRemove\",\"type\":\"address[]\"}],\"name\":\"applyFeeTokensUpdates\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"premiumMultiplierWeiPerEth\",\"type\":\"uint64\"}],\"internalType\":\"structFeeQuoter.PremiumMultiplierWeiPerEthArgs[]\",\"name\":\"premiumMultiplierWeiPerEthArgs\",\"type\":\"tuple[]\"}],\"name\":\"applyPremiumMultiplierWeiPerEthUpdates\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"uint32\",\"name\":\"minFeeUSDCents\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"maxFeeUSDCents\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"deciBps\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"destGasOverhead\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"destBytesOverhead\",\"type\":\"uint32\"},{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"}],\"internalType\":\"structFeeQuoter.TokenTransferFeeConfig\",\"name\":\"tokenTransferFeeConfig\",\"type\":\"tuple\"}],\"internalType\":\"structFeeQuoter.TokenTransferFeeConfigSingleTokenArgs[]\",\"name\":\"tokenTransferFeeConfigs\",\"type\":\"tuple[]\"}],\"internalType\":\"structFeeQuoter.TokenTransferFeeConfigArgs[]\",\"name\":\"tokenTransferFeeConfigArgs\",\"type\":\"tuple[]\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"internalType\":\"structFeeQuoter.TokenTransferFeeConfigRemoveArgs[]\",\"name\":\"tokensToUseDefaultFeeConfigs\",\"type\":\"tuple[]\"}],\"name\":\"applyTokenTransferFeeConfigUpdates\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"fromToken\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"fromTokenAmount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"toToken\",\"type\":\"address\"}],\"name\":\"convertTokenAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAllAuthorizedCallers\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"}],\"name\":\"getDestChainConfig\",\"outputs\":[{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint16\",\"name\":\"maxNumberOfTokensPerMsg\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"maxDataBytes\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"maxPerMsgGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"destGasOverhead\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"destGasPerPayloadByte\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"destDataAvailabilityOverheadGas\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"destGasPerDataAvailabilityByte\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"destDataAvailabilityMultiplierBps\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"defaultTokenFeeUSDCents\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"defaultTokenDestGasOverhead\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"defaultTxGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"gasMultiplierWeiPerEth\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"networkFeeUSDCents\",\"type\":\"uint32\"},{\"internalType\":\"bool\",\"name\":\"enforceOutOfOrder\",\"type\":\"bool\"},{\"internalType\":\"bytes4\",\"name\":\"chainFamilySelector\",\"type\":\"bytes4\"}],\"internalType\":\"structFeeQuoter.DestChainConfig\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"}],\"name\":\"getDestinationChainGasPrice\",\"outputs\":[{\"components\":[{\"internalType\":\"uint224\",\"name\":\"value\",\"type\":\"uint224\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"}],\"internalType\":\"structInternal.TimestampedPackedUint224\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getFeeTokens\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"getPremiumMultiplierWeiPerEth\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"premiumMultiplierWeiPerEth\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getStaticConfig\",\"outputs\":[{\"components\":[{\"internalType\":\"uint96\",\"name\":\"maxFeeJuelsPerMsg\",\"type\":\"uint96\"},{\"internalType\":\"address\",\"name\":\"linkToken\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"stalenessThreshold\",\"type\":\"uint32\"}],\"internalType\":\"structFeeQuoter.StaticConfig\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"}],\"name\":\"getTokenAndGasPrices\",\"outputs\":[{\"internalType\":\"uint224\",\"name\":\"tokenPrice\",\"type\":\"uint224\"},{\"internalType\":\"uint224\",\"name\":\"gasPriceValue\",\"type\":\"uint224\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"getTokenPrice\",\"outputs\":[{\"components\":[{\"internalType\":\"uint224\",\"name\":\"value\",\"type\":\"uint224\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"}],\"internalType\":\"structInternal.TimestampedPackedUint224\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"getTokenPriceFeedConfig\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"dataFeedAddress\",\"type\":\"address\"},{\"internalType\":\"uint8\",\"name\":\"tokenDecimals\",\"type\":\"uint8\"}],\"internalType\":\"structIFeeQuoter.TokenPriceFeedConfig\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"tokens\",\"type\":\"address[]\"}],\"name\":\"getTokenPrices\",\"outputs\":[{\"components\":[{\"internalType\":\"uint224\",\"name\":\"value\",\"type\":\"uint224\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"}],\"internalType\":\"structInternal.TimestampedPackedUint224[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"getTokenTransferFeeConfig\",\"outputs\":[{\"components\":[{\"internalType\":\"uint32\",\"name\":\"minFeeUSDCents\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"maxFeeUSDCents\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"deciBps\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"destGasOverhead\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"destBytesOverhead\",\"type\":\"uint32\"},{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"}],\"internalType\":\"structFeeQuoter.TokenTransferFeeConfig\",\"name\":\"tokenTransferFeeConfig\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"},{\"components\":[{\"internalType\":\"bytes\",\"name\":\"receiver\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"internalType\":\"structClient.EVMTokenAmount[]\",\"name\":\"tokenAmounts\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"feeToken\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"extraArgs\",\"type\":\"bytes\"}],\"internalType\":\"structClient.EVM2AnyMessage\",\"name\":\"message\",\"type\":\"tuple\"}],\"name\":\"getValidatedFee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"feeTokenAmount\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"getValidatedTokenPrice\",\"outputs\":[{\"internalType\":\"uint224\",\"name\":\"\",\"type\":\"uint224\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"metadata\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"report\",\"type\":\"bytes\"}],\"name\":\"onReport\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"feeToken\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"feeTokenAmount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"extraArgs\",\"type\":\"bytes\"}],\"name\":\"processMessageArgs\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"msgFeeJuels\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"isOutOfOrderExecution\",\"type\":\"bool\"},{\"internalType\":\"bytes\",\"name\":\"convertedExtraArgs\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"},{\"components\":[{\"internalType\":\"bytes\",\"name\":\"sourcePoolAddress\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"destTokenAddress\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"destExecData\",\"type\":\"bytes\"}],\"internalType\":\"structInternal.RampTokenAmount[]\",\"name\":\"rampTokenAmounts\",\"type\":\"tuple[]\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"internalType\":\"structClient.EVMTokenAmount[]\",\"name\":\"sourceTokenAmounts\",\"type\":\"tuple[]\"}],\"name\":\"processPoolReturnData\",\"outputs\":[{\"internalType\":\"bytes[]\",\"name\":\"destExecDataPerToken\",\"type\":\"bytes[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"forwarder\",\"type\":\"address\"},{\"internalType\":\"bytes10\",\"name\":\"workflowName\",\"type\":\"bytes10\"},{\"internalType\":\"bytes2\",\"name\":\"reportName\",\"type\":\"bytes2\"},{\"internalType\":\"address\",\"name\":\"workflowOwner\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"isAllowed\",\"type\":\"bool\"}],\"internalType\":\"structKeystoneFeedsPermissionHandler.Permission[]\",\"name\":\"permissions\",\"type\":\"tuple[]\"}],\"name\":\"setReportPermissions\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"sourceToken\",\"type\":\"address\"},{\"internalType\":\"uint224\",\"name\":\"usdPerToken\",\"type\":\"uint224\"}],\"internalType\":\"structInternal.TokenPriceUpdate[]\",\"name\":\"tokenPriceUpdates\",\"type\":\"tuple[]\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint224\",\"name\":\"usdPerUnitGas\",\"type\":\"uint224\"}],\"internalType\":\"structInternal.GasPriceUpdate[]\",\"name\":\"gasPriceUpdates\",\"type\":\"tuple[]\"}],\"internalType\":\"structInternal.PriceUpdates\",\"name\":\"priceUpdates\",\"type\":\"tuple\"}],\"name\":\"updatePrices\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"sourceToken\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"dataFeedAddress\",\"type\":\"address\"},{\"internalType\":\"uint8\",\"name\":\"tokenDecimals\",\"type\":\"uint8\"}],\"internalType\":\"structIFeeQuoter.TokenPriceFeedConfig\",\"name\":\"feedConfig\",\"type\":\"tuple\"}],\"internalType\":\"structFeeQuoter.TokenPriceFeedUpdate[]\",\"name\":\"tokenPriceFeedUpdates\",\"type\":\"tuple[]\"}],\"name\":\"updateTokenPriceFeeds\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", + Bin: "0x60e06040523480156200001157600080fd5b506040516200774438038062007744833981016040819052620000349162001834565b8533806000816200008c5760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000bf57620000bf8162000207565b5050604080518082018252838152815160008152602080820190935291810191909152620000ee9150620002b2565b5060208701516001600160a01b0316158062000112575086516001600160601b0316155b80620001265750604087015163ffffffff16155b15620001455760405163d794ef9560e01b815260040160405180910390fd5b6020878101516001600160a01b031660a05287516001600160601b031660805260408089015163ffffffff1660c05280516000815291820190526200018c90869062000401565b620001978462000549565b620001a2816200061a565b620001ad8262000a5a565b60408051600080825260208201909252620001fa91859190620001f3565b6040805180820190915260008082526020820152815260200190600190039081620001cb5790505b5062000b26565b5050505050505062001ae5565b336001600160a01b03821603620002615760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640162000083565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b602081015160005b815181101562000342576000828281518110620002db57620002db62001953565b60209081029190910101519050620002f560028262000e5f565b1562000338576040516001600160a01b03821681527fc3803387881faad271c47728894e3e36fac830ffc8602ca6fc07733cbda775809060200160405180910390a15b50600101620002ba565b50815160005b8151811015620003fb57600082828151811062000369576200036962001953565b6020026020010151905060006001600160a01b0316816001600160a01b031603620003a7576040516342bcdf7f60e11b815260040160405180910390fd5b620003b460028262000e7f565b506040516001600160a01b03821681527feb1b9b92e50b7f88f9ff25d56765095ac6e91540eee214906f4036a908ffbdef9060200160405180910390a15060010162000348565b50505050565b60005b8251811015620004a2576200044083828151811062000427576200042762001953565b6020026020010151600b62000e7f60201b90919060201c565b1562000499578281815181106200045b576200045b62001953565b60200260200101516001600160a01b03167fdf1b1bd32a69711488d71554706bb130b1fc63a5fa1a2cd85e8440f84065ba2360405160405180910390a25b60010162000404565b5060005b81518110156200054457620004e2828281518110620004c957620004c962001953565b6020026020010151600b62000e9660201b90919060201c565b156200053b57818181518110620004fd57620004fd62001953565b60200260200101516001600160a01b03167f1795838dc8ab2ffc5f431a1729a6afa0b587f982f7b2be0b9d7187a1ef547f9160405160405180910390a25b600101620004a6565b505050565b60005b8151811015620006165760008282815181106200056d576200056d62001953565b6020908102919091018101518051818301516001600160a01b0380831660008181526007875260409081902084518154868a018051929096166001600160a81b03199091168117600160a01b60ff9384160217909255825191825293519093169683019690965293955091939092917f08a5f7f5bb38a81d8e43aca13ecd76431dbf8816ae4699affff7b00b2fc1c464910160405180910390a25050508060010190506200054c565b5050565b60005b8151811015620006165760008282815181106200063e576200063e62001953565b6020026020010151905060008383815181106200065f576200065f62001953565b6020026020010151600001519050600082602001519050816001600160401b03166000148062000698575061016081015163ffffffff16155b80620006ba57506101e08101516001600160e01b031916630a04b54b60e21b14155b80620006da5750806060015163ffffffff1681610160015163ffffffff16115b15620007055760405163c35aa79d60e01b81526001600160401b038316600482015260240162000083565b6001600160401b038216600090815260096020526040812060010154600160881b900460e01b6001600160e01b03191690036200078557816001600160401b03167fd31c671936387b2f84ed402b553bd50c0e9c20408ea4e91a836d77b8180fb7248260405162000777919062001969565b60405180910390a2620007c9565b816001600160401b03167f1edd6f3553cfa16f10b95b195abae3a1cfca4783de4843f95d674b1e1df5ab2082604051620007c0919062001969565b60405180910390a25b8060096000846001600160401b03166001600160401b0316815260200190815260200160002060008201518160000160006101000a81548160ff02191690831515021790555060208201518160000160016101000a81548161ffff021916908361ffff16021790555060408201518160000160036101000a81548163ffffffff021916908363ffffffff16021790555060608201518160000160076101000a81548163ffffffff021916908363ffffffff160217905550608082015181600001600b6101000a81548163ffffffff021916908363ffffffff16021790555060a082015181600001600f6101000a81548161ffff021916908361ffff16021790555060c08201518160000160116101000a81548163ffffffff021916908363ffffffff16021790555060e08201518160000160156101000a81548161ffff021916908361ffff1602179055506101008201518160000160176101000a81548161ffff021916908361ffff1602179055506101208201518160000160196101000a81548161ffff021916908361ffff16021790555061014082015181600001601b6101000a81548163ffffffff021916908363ffffffff1602179055506101608201518160010160006101000a81548163ffffffff021916908363ffffffff1602179055506101808201518160010160046101000a8154816001600160401b0302191690836001600160401b031602179055506101a082015181600101600c6101000a81548163ffffffff021916908363ffffffff1602179055506101c08201518160010160106101000a81548160ff0219169083151502179055506101e08201518160010160116101000a81548163ffffffff021916908360e01c02179055509050505050508060010190506200061d565b60005b81518110156200061657600082828151811062000a7e5762000a7e62001953565b6020026020010151600001519050600083838151811062000aa35762000aa362001953565b6020908102919091018101518101516001600160a01b03841660008181526008845260409081902080546001600160401b0319166001600160401b0385169081179091559051908152919350917fbb77da6f7210cdd16904228a9360133d1d7dfff99b1bc75f128da5b53e28f97d910160405180910390a2505060010162000a5d565b60005b825181101562000d9957600083828151811062000b4a5762000b4a62001953565b6020026020010151905060008160000151905060005b82602001515181101562000d8a5760008360200151828151811062000b895762000b8962001953565b602002602001015160200151905060008460200151838151811062000bb25762000bb262001953565b6020026020010151600001519050602063ffffffff16826080015163ffffffff16101562000c115760808201516040516312766e0160e11b81526001600160a01b038316600482015263ffffffff909116602482015260440162000083565b6001600160401b0384166000818152600a602090815260408083206001600160a01b0386168085529083529281902086518154938801518389015160608a015160808b015160a08c01511515600160901b0260ff60901b1963ffffffff928316600160701b021664ffffffffff60701b199383166a01000000000000000000000263ffffffff60501b1961ffff90961668010000000000000000029590951665ffffffffffff60401b19968416640100000000026001600160401b0319909b16939097169290921798909817939093169390931717919091161792909217909155519091907f94967ae9ea7729ad4f54021c1981765d2b1d954f7c92fbec340aa0a54f46b8b59062000d77908690600060c08201905063ffffffff80845116835280602085015116602084015261ffff60408501511660408401528060608501511660608401528060808501511660808401525060a0830151151560a083015292915050565b60405180910390a3505060010162000b60565b50505080600101905062000b29565b5060005b81518110156200054457600082828151811062000dbe5762000dbe62001953565b6020026020010151600001519050600083838151811062000de35762000de362001953565b6020908102919091018101518101516001600160401b0384166000818152600a845260408082206001600160a01b038516808452955280822080546001600160981b03191690555192945090917f4de5b1bcbca6018c11303a2c3f4a4b4f22a1c741d8c4ba430d246ac06c5ddf8b9190a3505060010162000d9d565b600062000e76836001600160a01b03841662000ead565b90505b92915050565b600062000e76836001600160a01b03841662000fb1565b600062000e76836001600160a01b03841662001003565b6000818152600183016020526040812054801562000fa657600062000ed460018362001aad565b855490915060009062000eea9060019062001aad565b905081811462000f5657600086600001828154811062000f0e5762000f0e62001953565b906000526020600020015490508087600001848154811062000f345762000f3462001953565b6000918252602080832090910192909255918252600188019052604090208390555b855486908062000f6a5762000f6a62001acf565b60019003818190600052602060002001600090559055856001016000868152602001908152602001600020600090556001935050505062000e79565b600091505062000e79565b600081815260018301602052604081205462000ffa5750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915562000e79565b50600062000e79565b6000818152600183016020526040812054801562000fa65760006200102a60018362001aad565b8554909150600090620010409060019062001aad565b905080821462000f5657600086600001828154811062000f0e5762000f0e62001953565b634e487b7160e01b600052604160045260246000fd5b604080519081016001600160401b03811182821017156200109f576200109f62001064565b60405290565b60405160c081016001600160401b03811182821017156200109f576200109f62001064565b60405161020081016001600160401b03811182821017156200109f576200109f62001064565b604051601f8201601f191681016001600160401b03811182821017156200111b576200111b62001064565b604052919050565b80516001600160a01b03811681146200113b57600080fd5b919050565b805163ffffffff811681146200113b57600080fd5b6000606082840312156200116857600080fd5b604051606081016001600160401b03811182821017156200118d576200118d62001064565b604052825190915081906001600160601b0381168114620011ad57600080fd5b8152620011bd6020840162001123565b6020820152620011d06040840162001140565b60408201525092915050565b60006001600160401b03821115620011f857620011f862001064565b5060051b60200190565b600082601f8301126200121457600080fd5b815160206200122d6200122783620011dc565b620010f0565b8083825260208201915060208460051b8701019350868411156200125057600080fd5b602086015b848110156200127757620012698162001123565b835291830191830162001255565b509695505050505050565b600082601f8301126200129457600080fd5b81516020620012a76200122783620011dc565b82815260609283028501820192828201919087851115620012c757600080fd5b8387015b858110156200135a5780890382811215620012e65760008081fd5b620012f06200107a565b620012fb8362001123565b8152604080601f1984011215620013125760008081fd5b6200131c6200107a565b92506200132b88850162001123565b835283015160ff81168114620013415760008081fd5b82880152808701919091528452928401928101620012cb565b5090979650505050505050565b80516001600160401b03811681146200113b57600080fd5b805161ffff811681146200113b57600080fd5b805180151581146200113b57600080fd5b600082601f830112620013b557600080fd5b81516020620013c86200122783620011dc565b82815260059290921b84018101918181019086841115620013e857600080fd5b8286015b84811015620012775780516001600160401b03808211156200140d57600080fd5b908801906040601f19838c0381018213156200142857600080fd5b620014326200107a565b6200143f89860162001367565b815282850151848111156200145357600080fd5b8086019550508c603f8601126200146957600080fd5b8885015193506200147e6200122785620011dc565b84815260e09094028501830193898101908e8611156200149d57600080fd5b958401955b858710156200157657868f0360e0811215620014bd57600080fd5b620014c76200107a565b620014d28962001123565b815260c08683011215620014e557600080fd5b620014ef620010a5565b9150620014fe8d8a0162001140565b82526200150d878a0162001140565b8d8301526200151f60608a016200137f565b878301526200153160808a0162001140565b60608301526200154460a08a0162001140565b60808301526200155760c08a0162001392565b60a0830152808d0191909152825260e09690960195908a0190620014a2565b828b015250875250505092840192508301620013ec565b600082601f8301126200159f57600080fd5b81516020620015b26200122783620011dc565b82815260069290921b84018101918181019086841115620015d257600080fd5b8286015b84811015620012775760408189031215620015f15760008081fd5b620015fb6200107a565b620016068262001123565b81526200161585830162001367565b81860152835291830191604001620015d6565b80516001600160e01b0319811681146200113b57600080fd5b600082601f8301126200165357600080fd5b81516020620016666200122783620011dc565b82815261022092830285018201928282019190878511156200168757600080fd5b8387015b858110156200135a5780890382811215620016a65760008081fd5b620016b06200107a565b620016bb8362001367565b815261020080601f1984011215620016d35760008081fd5b620016dd620010ca565b9250620016ec88850162001392565b83526040620016fd8186016200137f565b8985015260606200171081870162001140565b82860152608091506200172582870162001140565b9085015260a06200173886820162001140565b8286015260c091506200174d8287016200137f565b9085015260e06200176086820162001140565b828601526101009150620017768287016200137f565b908501526101206200178a8682016200137f565b828601526101409150620017a08287016200137f565b90850152610160620017b486820162001140565b828601526101809150620017ca82870162001140565b908501526101a0620017de86820162001367565b828601526101c09150620017f482870162001140565b908501526101e06200180886820162001392565b828601526200181983870162001628565b9085015250508087019190915284529284019281016200168b565b6000806000806000806000610120888a0312156200185157600080fd5b6200185d898962001155565b60608901519097506001600160401b03808211156200187b57600080fd5b620018898b838c0162001202565b975060808a0151915080821115620018a057600080fd5b620018ae8b838c0162001202565b965060a08a0151915080821115620018c557600080fd5b620018d38b838c0162001282565b955060c08a0151915080821115620018ea57600080fd5b620018f88b838c01620013a3565b945060e08a01519150808211156200190f57600080fd5b6200191d8b838c016200158d565b93506101008a01519150808211156200193557600080fd5b50620019448a828b0162001641565b91505092959891949750929550565b634e487b7160e01b600052603260045260246000fd5b815115158152610200810160208301516200198a602084018261ffff169052565b506040830151620019a3604084018263ffffffff169052565b506060830151620019bc606084018263ffffffff169052565b506080830151620019d5608084018263ffffffff169052565b5060a0830151620019ec60a084018261ffff169052565b5060c083015162001a0560c084018263ffffffff169052565b5060e083015162001a1c60e084018261ffff169052565b506101008381015161ffff9081169184019190915261012080850151909116908301526101408084015163ffffffff9081169184019190915261016080850151821690840152610180808501516001600160401b0316908401526101a080850151909116908301526101c0808401511515908301526101e0928301516001600160e01b031916929091019190915290565b8181038181111562000e7957634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603160045260246000fd5b60805160a05160c051615c0562001b3f600039600081816102ef015281816121fd01526122660152600081816102b301528181611917015261197701526000818161027f015281816119a00152611a100152615c056000f3fe608060405234801561001057600080fd5b50600436106101ce5760003560e01c806379ba509711610104578063a69c64c0116100a2578063d02641a011610071578063d02641a014610a81578063d8694ccd14610a94578063f2fde38b14610aa7578063ffdb4b3714610aba57600080fd5b8063a69c64c014610997578063bf78e03f146109aa578063c4276bfc14610a57578063cdc73d5114610a7957600080fd5b806382b49eb0116100de57806382b49eb0146107d95780638da5cb5b1461094957806391a2749a146109715780639ea600261461098457600080fd5b806379ba5097146107ab5780637afac322146107b3578063805f2132146107c657600080fd5b8063407e1086116101715780634ab35b0b1161014b5780634ab35b0b14610441578063514e8cff146104815780636def4ce714610524578063770e2dc41461079857600080fd5b8063407e1086146103fb57806341ed29e71461040e57806345ac924d1461042157600080fd5b8063085318f8116101ad578063085318f814610368578063181f5a77146103885780632451a627146103d15780633937306f146103e657600080fd5b806241e5be146101d3578063061877e3146101f957806306285c6914610252575b600080fd5b6101e66101e13660046142bc565b610b02565b6040519081526020015b60405180910390f35b6102396102073660046142f8565b73ffffffffffffffffffffffffffffffffffffffff1660009081526008602052604090205467ffffffffffffffff1690565b60405167ffffffffffffffff90911681526020016101f0565b61031c604080516060810182526000808252602082018190529181019190915260405180606001604052807f00000000000000000000000000000000000000000000000000000000000000006bffffffffffffffffffffffff1681526020017f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1681526020017f000000000000000000000000000000000000000000000000000000000000000063ffffffff16815250905090565b6040805182516bffffffffffffffffffffffff16815260208084015173ffffffffffffffffffffffffffffffffffffffff16908201529181015163ffffffff16908201526060016101f0565b61037b610376366004614370565b610b70565b6040516101f09190614482565b6103c46040518060400160405280601381526020017f46656551756f74657220312e362e302d6465760000000000000000000000000081525081565b6040516101f09190614504565b6103d9610ee2565b6040516101f09190614517565b6103f96103f4366004614571565b610ef3565b005b6103f9610409366004614713565b6111a8565b6103f961041c366004614845565b6111bc565b61043461042f366004614980565b6111fe565b6040516101f091906149c2565b61045461044f3660046142f8565b6112c9565b6040517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff90911681526020016101f0565b61051761048f366004614a3d565b60408051808201909152600080825260208201525067ffffffffffffffff166000908152600560209081526040918290208251808401909352547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff811683527c0100000000000000000000000000000000000000000000000000000000900463ffffffff169082015290565b6040516101f09190614a58565b61078b610532366004614a3d565b6040805161020081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e08101829052610100810182905261012081018290526101408101829052610160810182905261018081018290526101a081018290526101c081018290526101e08101919091525067ffffffffffffffff908116600090815260096020908152604091829020825161020081018452815460ff8082161515835261ffff61010080840482169685019690965263ffffffff630100000084048116978501979097526701000000000000008304871660608501526b0100000000000000000000008304871660808501526f010000000000000000000000000000008304811660a085015271010000000000000000000000000000000000808404881660c086015275010000000000000000000000000000000000000000008404821660e08087019190915277010000000000000000000000000000000000000000000000850483169786019790975279010000000000000000000000000000000000000000000000000084049091166101208501527b01000000000000000000000000000000000000000000000000000000909204861661014084015260019093015480861661016084015264010000000081049096166101808301526c0100000000000000000000000086049094166101a0820152700100000000000000000000000000000000850490911615156101c08201527fffffffff0000000000000000000000000000000000000000000000000000000092909304901b166101e082015290565b6040516101f09190614a93565b6103f96107a6366004614caa565b6112d4565b6103f96112e6565b6103f96107c1366004614fc4565b6113e3565b6103f96107d436600461506a565b6113f5565b6108e96107e73660046150d6565b6040805160c081018252600080825260208201819052918101829052606081018290526080810182905260a08101919091525067ffffffffffffffff919091166000908152600a6020908152604080832073ffffffffffffffffffffffffffffffffffffffff94909416835292815290829020825160c081018452905463ffffffff8082168352640100000000820481169383019390935268010000000000000000810461ffff16938201939093526a01000000000000000000008304821660608201526e01000000000000000000000000000083049091166080820152720100000000000000000000000000000000000090910460ff16151560a082015290565b6040516101f09190600060c08201905063ffffffff80845116835280602085015116602084015261ffff60408501511660408401528060608501511660608401528060808501511660808401525060a0830151151560a083015292915050565b60005460405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101f0565b6103f961097f366004615100565b6118dd565b6103f96109923660046151c1565b6118ee565b6103f96109a53660046153ce565b6118ff565b610a236109b83660046142f8565b6040805180820182526000808252602091820181905273ffffffffffffffffffffffffffffffffffffffff93841681526007825282902082518084019093525492831682527401000000000000000000000000000000000000000090920460ff169181019190915290565b60408051825173ffffffffffffffffffffffffffffffffffffffff16815260209283015160ff1692810192909252016101f0565b610a6a610a65366004615493565b611910565b6040516101f093929190615502565b6103d9611b06565b610517610a8f3660046142f8565b611b12565b6101e6610aa2366004615523565b611c0e565b6103f9610ab53660046142f8565b612118565b610acd610ac8366004615578565b612129565b604080517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff9384168152929091166020830152016101f0565b6000610b0d826122b4565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff16610b34856122b4565b610b5c907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff16856155d1565b610b6691906155e8565b90505b9392505050565b67ffffffffffffffff8086166000908152600960205260409020600101546060917101000000000000000000000000000000000090910460e01b908590811115610bbc57610bbc6145ac565b604051908082528060200260200182016040528015610bef57816020015b6060815260200190600190039081610bda5790505b50915060005b85811015610ed7576000858583818110610c1157610c11615623565b610c2792602060409092020190810191506142f8565b90506000888884818110610c3d57610c3d615623565b9050602002810190610c4f9190615652565b610c5d906040810190615690565b9150506020811115610d125767ffffffffffffffff8a166000908152600a6020908152604080832073ffffffffffffffffffffffffffffffffffffffff861684529091529020546e010000000000000000000000000000900463ffffffff16811115610d12576040517f36f536ca00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff831660048201526024015b60405180910390fd5b610d82848a8a86818110610d2857610d28615623565b9050602002810190610d3a9190615652565b610d48906020810190615690565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061234e92505050565b67ffffffffffffffff8a166000818152600a6020908152604080832073ffffffffffffffffffffffffffffffffffffffff871684528252808320815160c081018352905463ffffffff8082168352640100000000820481168386015268010000000000000000820461ffff16838501526a01000000000000000000008204811660608401526e010000000000000000000000000000820481166080840152720100000000000000000000000000000000000090910460ff16151560a08301908152958552600990935290832054935190937b0100000000000000000000000000000000000000000000000000000090049091169190610e815781610e87565b82606001515b6040805163ffffffff8316602082015291925001604051602081830303815290604052888781518110610ebc57610ebc615623565b60200260200101819052505050505050806001019050610bf5565b505095945050505050565b6060610eee60026123a5565b905090565b610efb6123b2565b6000610f0782806156f5565b9050905060005b81811015611051576000610f2284806156f5565b83818110610f3257610f32615623565b905060400201803603810190610f489190615789565b604080518082018252602080840180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff908116845263ffffffff42818116858701908152885173ffffffffffffffffffffffffffffffffffffffff9081166000908152600690975295889020965190519092167c010000000000000000000000000000000000000000000000000000000002919092161790935584519051935194955016927f52f50aa6d1a95a4595361ecf953d095f125d442e4673716dede699e049de148a926110409290917bffffffffffffffffffffffffffffffffffffffffffffffffffffffff929092168252602082015260400190565b60405180910390a250600101610f0e565b50600061106160208401846156f5565b9050905060005b818110156111a257600061107f60208601866156f5565b8381811061108f5761108f615623565b9050604002018036038101906110a591906157c6565b604080518082018252602080840180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff908116845263ffffffff42818116858701908152885167ffffffffffffffff9081166000908152600590975295889020965190519092167c010000000000000000000000000000000000000000000000000000000002919092161790935584519051935194955016927fdd84a3fa9ef9409f550d54d6affec7e9c480c878c6ab27b78912a03e1b371c6e926111919290917bffffffffffffffffffffffffffffffffffffffffffffffffffffffff929092168252602082015260400190565b60405180910390a250600101611068565b50505050565b6111b06123f7565b6111b981612478565b50565b6111c46123f7565b60005b81518110156111fa576111f28282815181106111e5576111e5615623565b6020026020010151612576565b6001016111c7565b5050565b60608160008167ffffffffffffffff81111561121c5761121c6145ac565b60405190808252806020026020018201604052801561126157816020015b604080518082019091526000808252602082015281526020019060019003908161123a5790505b50905060005b828110156112be5761129986868381811061128457611284615623565b9050602002016020810190610a8f91906142f8565b8282815181106112ab576112ab615623565b6020908102919091010152600101611267565b509150505b92915050565b60006112c3826122b4565b6112dc6123f7565b6111fa8282612748565b60015473ffffffffffffffffffffffffffffffffffffffff163314611367576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e6572000000000000000000006044820152606401610d09565b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b6113eb6123f7565b6111fa8282612b55565b600080600061143987878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250612c9c92505050565b92509250925061144b33838584612cb7565b6000611459858701876157e9565b905060005b81518110156118d25760006007600084848151811061147f5761147f615623565b6020908102919091018101515173ffffffffffffffffffffffffffffffffffffffff16825281019190915260400160009081205474010000000000000000000000000000000000000000900460ff169150819003611540578282815181106114e9576114e9615623565b6020908102919091010151516040517f06439c6b00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9091166004820152602401610d09565b600061158960128386868151811061155a5761155a615623565b6020026020010151602001517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff16612e0f565b9050600660008585815181106115a1576115a1615623565b60200260200101516000015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001601c9054906101000a900463ffffffff1663ffffffff1684848151811061161357611613615623565b60200260200101516040015163ffffffff16101561171d5783838151811061163d5761163d615623565b60200260200101516000015184848151811061165b5761165b615623565b6020026020010151604001516006600087878151811061167d5761167d615623565b6020908102919091018101515173ffffffffffffffffffffffffffffffffffffffff90811683529082019290925260409081016000205490517f191ec70600000000000000000000000000000000000000000000000000000000815293909116600484015263ffffffff91821660248401527c01000000000000000000000000000000000000000000000000000000009004166044820152606401610d09565b6040518060400160405280827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff16815260200185858151811061175e5761175e615623565b60200260200101516040015163ffffffff168152506006600086868151811061178957611789615623565b6020908102919091018101515173ffffffffffffffffffffffffffffffffffffffff168252818101929092526040016000208251929091015163ffffffff167c0100000000000000000000000000000000000000000000000000000000027bffffffffffffffffffffffffffffffffffffffffffffffffffffffff909216919091179055835184908490811061182157611821615623565b60200260200101516000015173ffffffffffffffffffffffffffffffffffffffff167f52f50aa6d1a95a4595361ecf953d095f125d442e4673716dede699e049de148a8286868151811061187757611877615623565b6020026020010151604001516040516118c09291907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff92909216825263ffffffff16602082015260400190565b60405180910390a2505060010161145e565b505050505050505050565b6118e56123f7565b6111b981612ed5565b6118f66123f7565b6111b981613061565b6119076123f7565b6111b981613507565b60008060607f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff16036119705785925061199e565b61199b87877f0000000000000000000000000000000000000000000000000000000000000000610b02565b92505b7f00000000000000000000000000000000000000000000000000000000000000006bffffffffffffffffffffffff16831115611a3d576040517f6a92a483000000000000000000000000000000000000000000000000000000008152600481018490526bffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000166024820152604401610d09565b67ffffffffffffffff881660009081526009602052604081206001015463ffffffff1690611a6c8787846135f1565b9050806020015193508484611af3836040805182516024820152602092830151151560448083019190915282518083039091018152606490910190915290810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f181dcf100000000000000000000000000000000000000000000000000000000017905290565b9450945094505050955095509592505050565b6060610eee600b6123a5565b604080518082019091526000808252602082015273ffffffffffffffffffffffffffffffffffffffff8281166000908152600760209081526040918290208251808401909352549283168083527401000000000000000000000000000000000000000090930460ff169082015290611c0557505073ffffffffffffffffffffffffffffffffffffffff166000908152600660209081526040918290208251808401909352547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff811683527c0100000000000000000000000000000000000000000000000000000000900463ffffffff169082015290565b610b698161379a565b67ffffffffffffffff8083166000908152600960209081526040808320815161020081018352815460ff808216151580845261ffff61010080850482169886019890985263ffffffff630100000085048116978601979097526701000000000000008404871660608601526b0100000000000000000000008404871660808601526f010000000000000000000000000000008404811660a086015271010000000000000000000000000000000000808504881660c087015275010000000000000000000000000000000000000000008504821660e08088019190915277010000000000000000000000000000000000000000000000860483169987019990995279010000000000000000000000000000000000000000000000000085049091166101208601527b01000000000000000000000000000000000000000000000000000000909304861661014085015260019094015480861661016085015264010000000081049098166101808401526c0100000000000000000000000088049094166101a0830152700100000000000000000000000000000000870490931615156101c08201527fffffffff000000000000000000000000000000000000000000000000000000009290950490921b166101e0840152909190611e28576040517f99ac52f200000000000000000000000000000000000000000000000000000000815267ffffffffffffffff85166004820152602401610d09565b611e43611e3b60808501606086016142f8565b600b90613929565b611ea257611e5760808401606085016142f8565b6040517f2502348c00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9091166004820152602401610d09565b6000611eb160408501856156f5565b9150611f0d905082611ec66020870187615690565b905083611ed38880615690565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061395892505050565b600080611f29611f2360808801606089016142f8565b88612129565b9092509050600080808515611f6c57611f60878b611f4d60808d0160608e016142f8565b88611f5b60408f018f6156f5565b613a02565b91945092509050611f8c565b6101a0870151611f899063ffffffff16662386f26fc100006155d1565b92505b61010087015160009061ffff1615611fd057611fcd886dffffffffffffffffffffffffffff607088901c16611fc460208e018e615690565b90508a86613cda565b90505b61018088015160009067ffffffffffffffff16611ff9611ff360808e018e615690565b8c613d8a565b600001518563ffffffff168b60a0015161ffff168e806020019061201d9190615690565b6120289291506155d1565b8c6080015163ffffffff1661203d91906158b0565b61204791906158b0565b61205191906158b0565b61206b906dffffffffffffffffffffffffffff89166155d1565b61207591906155d1565b9050867bffffffffffffffffffffffffffffffffffffffffffffffffffffffff168282600860008f60600160208101906120af91906142f8565b73ffffffffffffffffffffffffffffffffffffffff1681526020810191909152604001600020546120ea9067ffffffffffffffff16896155d1565b6120f491906158b0565b6120fe91906158b0565b61210891906155e8565b9c9b505050505050505050505050565b6121206123f7565b6111b981613e4b565b67ffffffffffffffff811660009081526005602090815260408083208151808301909252547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff811682527c0100000000000000000000000000000000000000000000000000000000900463ffffffff16918101829052829182036121e1576040517f2e59db3a00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff85166004820152602401610d09565b6000816020015163ffffffff16426121f991906158c3565b90507f000000000000000000000000000000000000000000000000000000000000000063ffffffff1681111561229a576040517ff08bcb3e00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff8616600482015263ffffffff7f000000000000000000000000000000000000000000000000000000000000000016602482015260448101829052606401610d09565b6122a3866122b4565b9151919350909150505b9250929050565b6000806122c083611b12565b9050806020015163ffffffff16600014806122f8575080517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff16155b15612347576040517f06439c6b00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff84166004820152602401610d09565b5192915050565b7fd7ed2ad4000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316016111fa576123a081613f40565b505050565b60606000610b6983613ff3565b6123bd600233613929565b6123f5576040517fd86ad9cf000000000000000000000000000000000000000000000000000000008152336004820152602401610d09565b565b60005473ffffffffffffffffffffffffffffffffffffffff1633146123f5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e6572000000000000000000006044820152606401610d09565b60005b81518110156111fa57600082828151811061249857612498615623565b60209081029190910181015180518183015173ffffffffffffffffffffffffffffffffffffffff80831660008181526007875260409081902084518154868a018051929096167fffffffffffffffffffffff00000000000000000000000000000000000000000090911681177401000000000000000000000000000000000000000060ff9384160217909255825191825293519093169683019690965293955091939092917f08a5f7f5bb38a81d8e43aca13ecd76431dbf8816ae4699affff7b00b2fc1c464910160405180910390a250505080600101905061247b565b600061262f82600001518360600151846020015185604001516040805173ffffffffffffffffffffffffffffffffffffffff80871660208301528516918101919091527fffffffffffffffffffff00000000000000000000000000000000000000000000831660608201527fffff0000000000000000000000000000000000000000000000000000000000008216608082015260009060a001604051602081830303815290604052805190602001209050949350505050565b60808301516000828152600460205260409081902080549215157fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00909316929092179091555190915081907f32a4ba3fa3351b11ad555d4c8ec70a744e8705607077a946807030d64b6ab1a39061273c908590600060a08201905073ffffffffffffffffffffffffffffffffffffffff8084511683527fffffffffffffffffffff0000000000000000000000000000000000000000000060208501511660208401527fffff00000000000000000000000000000000000000000000000000000000000060408501511660408401528060608501511660608401525060808301511515608083015292915050565b60405180910390a25050565b60005b8251811015612a7157600083828151811061276857612768615623565b6020026020010151905060008160000151905060005b826020015151811015612a63576000836020015182815181106127a3576127a3615623565b60200260200101516020015190506000846020015183815181106127c9576127c9615623565b6020026020010151600001519050602063ffffffff16826080015163ffffffff16101561284c5760808201516040517f24ecdc0200000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8316600482015263ffffffff9091166024820152604401610d09565b67ffffffffffffffff84166000818152600a6020908152604080832073ffffffffffffffffffffffffffffffffffffffff86168085529083529281902086518154938801518389015160608a015160808b015160a08c015115157201000000000000000000000000000000000000027fffffffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffff63ffffffff9283166e01000000000000000000000000000002167fffffffffffffffffffffffffff0000000000ffffffffffffffffffffffffffff9383166a0100000000000000000000027fffffffffffffffffffffffffffffffffffff00000000ffffffffffffffffffff61ffff9096166801000000000000000002959095167fffffffffffffffffffffffffffffffffffff000000000000ffffffffffffffff968416640100000000027fffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000909b16939097169290921798909817939093169390931717919091161792909217909155519091907f94967ae9ea7729ad4f54021c1981765d2b1d954f7c92fbec340aa0a54f46b8b590612a51908690600060c08201905063ffffffff80845116835280602085015116602084015261ffff60408501511660408401528060608501511660608401528060808501511660808401525060a0830151151560a083015292915050565b60405180910390a3505060010161277e565b50505080600101905061274b565b5060005b81518110156123a0576000828281518110612a9257612a92615623565b60200260200101516000015190506000838381518110612ab457612ab4615623565b60209081029190910181015181015167ffffffffffffffff84166000818152600a8452604080822073ffffffffffffffffffffffffffffffffffffffff8516808452955280822080547fffffffffffffffffffffffffff000000000000000000000000000000000000001690555192945090917f4de5b1bcbca6018c11303a2c3f4a4b4f22a1c741d8c4ba430d246ac06c5ddf8b9190a35050600101612a75565b60005b8251811015612bf857612b8e838281518110612b7657612b76615623565b6020026020010151600b61404f90919063ffffffff16565b15612bf057828181518110612ba557612ba5615623565b602002602001015173ffffffffffffffffffffffffffffffffffffffff167fdf1b1bd32a69711488d71554706bb130b1fc63a5fa1a2cd85e8440f84065ba2360405160405180910390a25b600101612b58565b5060005b81518110156123a057612c32828281518110612c1a57612c1a615623565b6020026020010151600b61407190919063ffffffff16565b15612c9457818181518110612c4957612c49615623565b602002602001015173ffffffffffffffffffffffffffffffffffffffff167f1795838dc8ab2ffc5f431a1729a6afa0b587f982f7b2be0b9d7187a1ef547f9160405160405180910390a25b600101612bfc565b6040810151604a820151605e90920151909260609290921c91565b6040805173ffffffffffffffffffffffffffffffffffffffff868116602080840191909152908616828401527fffffffffffffffffffff00000000000000000000000000000000000000000000851660608301527fffff00000000000000000000000000000000000000000000000000000000000084166080808401919091528351808403909101815260a09092018352815191810191909120600081815260049092529190205460ff16612e08576040517f097e17ff00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8087166004830152851660248201527fffffffffffffffffffff00000000000000000000000000000000000000000000841660448201527fffff00000000000000000000000000000000000000000000000000000000000083166064820152608401610d09565b5050505050565b600080612e1c84866158d6565b9050600060248260ff161115612e5357612e376024836158ef565b612e4290600a615a28565b612e4c90856155e8565b9050612e76565b612e5e8260246158ef565b612e6990600a615a28565b612e7390856155d1565b90505b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff811115612ecc576040517f10cb51d100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b95945050505050565b602081015160005b8151811015612f70576000828281518110612efa57612efa615623565b60200260200101519050612f1881600261409390919063ffffffff16565b15612f675760405173ffffffffffffffffffffffffffffffffffffffff821681527fc3803387881faad271c47728894e3e36fac830ffc8602ca6fc07733cbda775809060200160405180910390a15b50600101612edd565b50815160005b81518110156111a2576000828281518110612f9357612f93615623565b60200260200101519050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603613003576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61300e60028261404f565b5060405173ffffffffffffffffffffffffffffffffffffffff821681527feb1b9b92e50b7f88f9ff25d56765095ac6e91540eee214906f4036a908ffbdef9060200160405180910390a150600101612f76565b60005b81518110156111fa57600082828151811061308157613081615623565b60200260200101519050600083838151811061309f5761309f615623565b60200260200101516000015190506000826020015190508167ffffffffffffffff16600014806130d8575061016081015163ffffffff16155b8061312a57506101e08101517fffffffff00000000000000000000000000000000000000000000000000000000167f2812d52c0000000000000000000000000000000000000000000000000000000014155b806131495750806060015163ffffffff1681610160015163ffffffff16115b1561318c576040517fc35aa79d00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff83166004820152602401610d09565b67ffffffffffffffff821660009081526009602052604081206001015471010000000000000000000000000000000000900460e01b7fffffffff00000000000000000000000000000000000000000000000000000000169003613230578167ffffffffffffffff167fd31c671936387b2f84ed402b553bd50c0e9c20408ea4e91a836d77b8180fb724826040516132239190614a93565b60405180910390a2613273565b8167ffffffffffffffff167f1edd6f3553cfa16f10b95b195abae3a1cfca4783de4843f95d674b1e1df5ab208260405161326a9190614a93565b60405180910390a25b80600960008467ffffffffffffffff1667ffffffffffffffff16815260200190815260200160002060008201518160000160006101000a81548160ff02191690831515021790555060208201518160000160016101000a81548161ffff021916908361ffff16021790555060408201518160000160036101000a81548163ffffffff021916908363ffffffff16021790555060608201518160000160076101000a81548163ffffffff021916908363ffffffff160217905550608082015181600001600b6101000a81548163ffffffff021916908363ffffffff16021790555060a082015181600001600f6101000a81548161ffff021916908361ffff16021790555060c08201518160000160116101000a81548163ffffffff021916908363ffffffff16021790555060e08201518160000160156101000a81548161ffff021916908361ffff1602179055506101008201518160000160176101000a81548161ffff021916908361ffff1602179055506101208201518160000160196101000a81548161ffff021916908361ffff16021790555061014082015181600001601b6101000a81548163ffffffff021916908363ffffffff1602179055506101608201518160010160006101000a81548163ffffffff021916908363ffffffff1602179055506101808201518160010160046101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055506101a082015181600101600c6101000a81548163ffffffff021916908363ffffffff1602179055506101c08201518160010160106101000a81548160ff0219169083151502179055506101e08201518160010160116101000a81548163ffffffff021916908360e01c0217905550905050505050806001019050613064565b60005b81518110156111fa57600082828151811061352757613527615623565b6020026020010151600001519050600083838151811061354957613549615623565b60209081029190910181015181015173ffffffffffffffffffffffffffffffffffffffff841660008181526008845260409081902080547fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000001667ffffffffffffffff85169081179091559051908152919350917fbb77da6f7210cdd16904228a9360133d1d7dfff99b1bc75f128da5b53e28f97d910160405180910390a2505060010161350a565b6040805180820190915260008082526020820152600083900361363257506040805180820190915267ffffffffffffffff8216815260006020820152610b69565b600061363e8486615a37565b9050600061364f8560048189615a7d565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509293505050507fffffffff0000000000000000000000000000000000000000000000000000000082167fe7e230f000000000000000000000000000000000000000000000000000000000016136ec57808060200190518101906136e39190615aa7565b92505050610b69565b7f6859a837000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000831601613768576040518060400160405280828060200190518101906137549190615ad3565b815260006020909101529250610b69915050565b6040517f5247fdce00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b604080518082019091526000808252602082015260008260000151905060008173ffffffffffffffffffffffffffffffffffffffff1663feaf968c6040518163ffffffff1660e01b815260040160a060405180830381865afa158015613804573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906138289190615b06565b5050509150506000811215613869576040517f10cb51d100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006138e88373ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa1580156138b9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906138dd9190615b56565b866020015184612e0f565b604080518082019091527bffffffffffffffffffffffffffffffffffffffffffffffffffffffff909116815263ffffffff4216602082015295945050505050565b73ffffffffffffffffffffffffffffffffffffffff811660009081526001830160205260408120541515610b69565b836040015163ffffffff168311156139b15760408085015190517f8693378900000000000000000000000000000000000000000000000000000000815263ffffffff909116600482015260248101849052604401610d09565b836020015161ffff168211156139f3576040517f4c056b6a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6111a2846101e001518261234e565b6000808083815b81811015613ccc576000878783818110613a2557613a25615623565b905060400201803603810190613a3b9190615b73565b67ffffffffffffffff8c166000908152600a60209081526040808320845173ffffffffffffffffffffffffffffffffffffffff168452825291829020825160c081018452905463ffffffff8082168352640100000000820481169383019390935268010000000000000000810461ffff16938201939093526a01000000000000000000008304821660608201526e01000000000000000000000000000083049091166080820152720100000000000000000000000000000000000090910460ff16151560a0820181905291925090613b5b576101208d0151613b289061ffff16662386f26fc100006155d1565b613b3290886158b0565b96508c610140015186613b459190615bac565b9550613b52602086615bac565b94505050613cc4565b604081015160009061ffff1615613c145760008c73ffffffffffffffffffffffffffffffffffffffff16846000015173ffffffffffffffffffffffffffffffffffffffff1614613bb7578351613bb0906122b4565b9050613bba565b508a5b620186a0836040015161ffff16613bfc8660200151847bffffffffffffffffffffffffffffffffffffffffffffffffffffffff166140b590919063ffffffff16565b613c0691906155d1565b613c1091906155e8565b9150505b6060820151613c239088615bac565b9650816080015186613c359190615bac565b8251909650600090613c549063ffffffff16662386f26fc100006155d1565b905080821015613c7357613c68818a6158b0565b985050505050613cc4565b6000836020015163ffffffff16662386f26fc10000613c9291906155d1565b905080831115613cb257613ca6818b6158b0565b99505050505050613cc4565b613cbc838b6158b0565b995050505050505b600101613a09565b505096509650969350505050565b60008063ffffffff8316613cf0610160866155d1565b613cfc876101c06158b0565b613d0691906158b0565b613d1091906158b0565b905060008760c0015163ffffffff168860e0015161ffff1683613d3391906155d1565b613d3d91906158b0565b61010089015190915061ffff16613d646dffffffffffffffffffffffffffff8916836155d1565b613d6e91906155d1565b613d7e90655af3107a40006155d1565b98975050505050505050565b60408051808201909152600080825260208201526000613db6858585610160015163ffffffff166135f1565b9050826060015163ffffffff1681600001511115613e00576040517f4c4fc93a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b826101c001518015613e1457508060200151155b15610b66576040517fee433e9900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b3373ffffffffffffffffffffffffffffffffffffffff821603613eca576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c660000000000000000006044820152606401610d09565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b60008151602014613f7f57816040517f8d666f60000000000000000000000000000000000000000000000000000000008152600401610d099190614504565b600082806020019051810190613f959190615ad3565b905073ffffffffffffffffffffffffffffffffffffffff811180613fba575061040081105b156112c357826040517f8d666f60000000000000000000000000000000000000000000000000000000008152600401610d099190614504565b60608160000180548060200260200160405190810160405280929190818152602001828054801561404357602002820191906000526020600020905b81548152602001906001019080831161402f575b50505050509050919050565b6000610b698373ffffffffffffffffffffffffffffffffffffffff84166140f2565b6000610b698373ffffffffffffffffffffffffffffffffffffffff8416614141565b6000610b698373ffffffffffffffffffffffffffffffffffffffff841661423b565b6000670de0b6b3a76400006140e8837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff86166155d1565b610b6991906155e8565b6000818152600183016020526040812054614139575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556112c3565b5060006112c3565b6000818152600183016020526040812054801561422a5760006141656001836158c3565b8554909150600090614179906001906158c3565b90508082146141de57600086600001828154811061419957614199615623565b90600052602060002001549050808760000184815481106141bc576141bc615623565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806141ef576141ef615bc9565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506112c3565b60009150506112c3565b5092915050565b6000818152600183016020526040812054801561422a57600061425f6001836158c3565b8554909150600090614273906001906158c3565b90508181146141de57600086600001828154811061419957614199615623565b803573ffffffffffffffffffffffffffffffffffffffff811681146142b757600080fd5b919050565b6000806000606084860312156142d157600080fd5b6142da84614293565b9250602084013591506142ef60408501614293565b90509250925092565b60006020828403121561430a57600080fd5b610b6982614293565b803567ffffffffffffffff811681146142b757600080fd5b60008083601f84011261433d57600080fd5b50813567ffffffffffffffff81111561435557600080fd5b6020830191508360208260051b85010111156122ad57600080fd5b60008060008060006060868803121561438857600080fd5b61439186614313565b9450602086013567ffffffffffffffff808211156143ae57600080fd5b6143ba89838a0161432b565b909650945060408801359150808211156143d357600080fd5b818801915088601f8301126143e757600080fd5b8135818111156143f657600080fd5b8960208260061b850101111561440b57600080fd5b9699959850939650602001949392505050565b6000815180845260005b8181101561444457602081850181015186830182015201614428565b5060006020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b600060208083016020845280855180835260408601915060408160051b87010192506020870160005b828110156144f7577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc08886030184526144e585835161441e565b945092850192908501906001016144ab565b5092979650505050505050565b602081526000610b69602083018461441e565b6020808252825182820181905260009190848201906040850190845b8181101561456557835173ffffffffffffffffffffffffffffffffffffffff1683529284019291840191600101614533565b50909695505050505050565b60006020828403121561458357600080fd5b813567ffffffffffffffff81111561459a57600080fd5b820160408185031215610b6957600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040805190810167ffffffffffffffff811182821017156145fe576145fe6145ac565b60405290565b60405160a0810167ffffffffffffffff811182821017156145fe576145fe6145ac565b60405160c0810167ffffffffffffffff811182821017156145fe576145fe6145ac565b604051610200810167ffffffffffffffff811182821017156145fe576145fe6145ac565b6040516060810167ffffffffffffffff811182821017156145fe576145fe6145ac565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff811182821017156146d8576146d86145ac565b604052919050565b600067ffffffffffffffff8211156146fa576146fa6145ac565b5060051b60200190565b60ff811681146111b957600080fd5b6000602080838503121561472657600080fd5b823567ffffffffffffffff81111561473d57600080fd5b8301601f8101851361474e57600080fd5b803561476161475c826146e0565b614691565b8181526060918202830184019184820191908884111561478057600080fd5b938501935b83851015614820578489038181121561479e5760008081fd5b6147a66145db565b6147af87614293565b81526040807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0840112156147e35760008081fd5b6147eb6145db565b92506147f8898901614293565b835287013561480681614704565b828901528088019190915283529384019391850191614785565b50979650505050505050565b80151581146111b957600080fd5b80356142b78161482c565b6000602080838503121561485857600080fd5b823567ffffffffffffffff81111561486f57600080fd5b8301601f8101851361488057600080fd5b803561488e61475c826146e0565b81815260a091820283018401918482019190888411156148ad57600080fd5b938501935b838510156148205780858a0312156148ca5760008081fd5b6148d2614604565b6148db86614293565b8152868601357fffffffffffffffffffff00000000000000000000000000000000000000000000811681146149105760008081fd5b818801526040868101357fffff000000000000000000000000000000000000000000000000000000000000811681146149495760008081fd5b90820152606061495a878201614293565b9082015260808681013561496d8161482c565b90820152835293840193918501916148b2565b6000806020838503121561499357600080fd5b823567ffffffffffffffff8111156149aa57600080fd5b6149b68582860161432b565b90969095509350505050565b602080825282518282018190526000919060409081850190868401855b82811015614a3057614a2084835180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff16825260209081015163ffffffff16910152565b92840192908501906001016149df565b5091979650505050505050565b600060208284031215614a4f57600080fd5b610b6982614313565b81517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff16815260208083015163ffffffff1690820152604081016112c3565b81511515815261020081016020830151614ab3602084018261ffff169052565b506040830151614acb604084018263ffffffff169052565b506060830151614ae3606084018263ffffffff169052565b506080830151614afb608084018263ffffffff169052565b5060a0830151614b1160a084018261ffff169052565b5060c0830151614b2960c084018263ffffffff169052565b5060e0830151614b3f60e084018261ffff169052565b506101008381015161ffff9081169184019190915261012080850151909116908301526101408084015163ffffffff90811691840191909152610160808501518216908401526101808085015167ffffffffffffffff16908401526101a080850151909116908301526101c0808401511515908301526101e0808401517fffffffff000000000000000000000000000000000000000000000000000000008116828501525b505092915050565b803563ffffffff811681146142b757600080fd5b803561ffff811681146142b757600080fd5b600082601f830112614c2357600080fd5b81356020614c3361475c836146e0565b82815260069290921b84018101918181019086841115614c5257600080fd5b8286015b84811015614c9f5760408189031215614c6f5760008081fd5b614c776145db565b614c8082614313565b8152614c8d858301614293565b81860152835291830191604001614c56565b509695505050505050565b60008060408385031215614cbd57600080fd5b67ffffffffffffffff83351115614cd357600080fd5b83601f843585010112614ce557600080fd5b614cf561475c84358501356146e0565b8335840180358083526020808401939260059290921b90910101861015614d1b57600080fd5b602085358601015b85358601803560051b01602001811015614f285767ffffffffffffffff81351115614d4d57600080fd5b8035863587010160407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0828a03011215614d8657600080fd5b614d8e6145db565b614d9a60208301614313565b815267ffffffffffffffff60408301351115614db557600080fd5b88603f604084013584010112614dca57600080fd5b614de061475c60206040850135850101356146e0565b6020604084810135850182810135808552928401939260e00201018b1015614e0757600080fd5b6040808501358501015b6040858101358601602081013560e0020101811015614f095760e0818d031215614e3a57600080fd5b614e426145db565b614e4b82614293565b815260c07fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0838f03011215614e7f57600080fd5b614e87614627565b614e9360208401614bec565b8152614ea160408401614bec565b6020820152614eb260608401614c00565b6040820152614ec360808401614bec565b6060820152614ed460a08401614bec565b6080820152614ee660c084013561482c565b60c083013560a0820152602082810191909152908452929092019160e001614e11565b5080602084015250508085525050602083019250602081019050614d23565b5092505067ffffffffffffffff60208401351115614f4557600080fd5b614f558460208501358501614c12565b90509250929050565b600082601f830112614f6f57600080fd5b81356020614f7f61475c836146e0565b8083825260208201915060208460051b870101935086841115614fa157600080fd5b602086015b84811015614c9f57614fb781614293565b8352918301918301614fa6565b60008060408385031215614fd757600080fd5b823567ffffffffffffffff80821115614fef57600080fd5b614ffb86838701614f5e565b9350602085013591508082111561501157600080fd5b5061501e85828601614f5e565b9150509250929050565b60008083601f84011261503a57600080fd5b50813567ffffffffffffffff81111561505257600080fd5b6020830191508360208285010111156122ad57600080fd5b6000806000806040858703121561508057600080fd5b843567ffffffffffffffff8082111561509857600080fd5b6150a488838901615028565b909650945060208701359150808211156150bd57600080fd5b506150ca87828801615028565b95989497509550505050565b600080604083850312156150e957600080fd5b6150f283614313565b9150614f5560208401614293565b60006020828403121561511257600080fd5b813567ffffffffffffffff8082111561512a57600080fd5b908301906040828603121561513e57600080fd5b6151466145db565b82358281111561515557600080fd5b61516187828601614f5e565b82525060208301358281111561517657600080fd5b61518287828601614f5e565b60208301525095945050505050565b80357fffffffff00000000000000000000000000000000000000000000000000000000811681146142b757600080fd5b600060208083850312156151d457600080fd5b823567ffffffffffffffff8111156151eb57600080fd5b8301601f810185136151fc57600080fd5b803561520a61475c826146e0565b818152610220918202830184019184820191908884111561522a57600080fd5b938501935b8385101561482057848903818112156152485760008081fd5b6152506145db565b61525987614313565b8152610200807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08401121561528e5760008081fd5b61529661464a565b92506152a389890161483a565b835260406152b2818a01614c00565b8a85015260606152c3818b01614bec565b82860152608091506152d6828b01614bec565b9085015260a06152e78a8201614bec565b8286015260c091506152fa828b01614c00565b9085015260e061530b8a8201614bec565b82860152610100915061531f828b01614c00565b908501526101206153318a8201614c00565b828601526101409150615345828b01614c00565b908501526101606153578a8201614bec565b82860152610180915061536b828b01614bec565b908501526101a061537d8a8201614313565b828601526101c09150615391828b01614bec565b908501526101e06153a38a820161483a565b828601526153b2838b01615191565b908501525050808801919091528352938401939185019161522f565b600060208083850312156153e157600080fd5b823567ffffffffffffffff8111156153f857600080fd5b8301601f8101851361540957600080fd5b803561541761475c826146e0565b81815260069190911b8201830190838101908783111561543657600080fd5b928401925b8284101561548857604084890312156154545760008081fd5b61545c6145db565b61546585614293565b8152615472868601614313565b818701528252604093909301929084019061543b565b979650505050505050565b6000806000806000608086880312156154ab57600080fd5b6154b486614313565b94506154c260208701614293565b935060408601359250606086013567ffffffffffffffff8111156154e557600080fd5b6154f188828901615028565b969995985093965092949392505050565b8381528215156020820152606060408201526000612ecc606083018461441e565b6000806040838503121561553657600080fd5b61553f83614313565b9150602083013567ffffffffffffffff81111561555b57600080fd5b830160a0818603121561556d57600080fd5b809150509250929050565b6000806040838503121561558b57600080fd5b61559483614293565b9150614f5560208401614313565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b80820281158282048414176112c3576112c36155a2565b60008261561e577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6183360301811261568657600080fd5b9190910192915050565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe18436030181126156c557600080fd5b83018035915067ffffffffffffffff8211156156e057600080fd5b6020019150368190038213156122ad57600080fd5b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe184360301811261572a57600080fd5b83018035915067ffffffffffffffff82111561574557600080fd5b6020019150600681901b36038213156122ad57600080fd5b80357bffffffffffffffffffffffffffffffffffffffffffffffffffffffff811681146142b757600080fd5b60006040828403121561579b57600080fd5b6157a36145db565b6157ac83614293565b81526157ba6020840161575d565b60208201529392505050565b6000604082840312156157d857600080fd5b6157e06145db565b6157ac83614313565b600060208083850312156157fc57600080fd5b823567ffffffffffffffff81111561581357600080fd5b8301601f8101851361582457600080fd5b803561583261475c826146e0565b8181526060918202830184019184820191908884111561585157600080fd5b938501935b838510156148205780858a03121561586e5760008081fd5b61587661466e565b61587f86614293565b815261588c87870161575d565b87820152604061589d818801614bec565b9082015283529384019391850191615856565b808201808211156112c3576112c36155a2565b818103818111156112c3576112c36155a2565b60ff81811683821601908111156112c3576112c36155a2565b60ff82811682821603908111156112c3576112c36155a2565b600181815b8085111561596157817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04821115615947576159476155a2565b8085161561595457918102915b93841c939080029061590d565b509250929050565b600082615978575060016112c3565b81615985575060006112c3565b816001811461599b57600281146159a5576159c1565b60019150506112c3565b60ff8411156159b6576159b66155a2565b50506001821b6112c3565b5060208310610133831016604e8410600b84101617156159e4575081810a6112c3565b6159ee8383615908565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04821115615a2057615a206155a2565b029392505050565b6000610b6960ff841683615969565b7fffffffff000000000000000000000000000000000000000000000000000000008135818116916004851015614be45760049490940360031b84901b1690921692915050565b60008085851115615a8d57600080fd5b83861115615a9a57600080fd5b5050820193919092039150565b600060408284031215615ab957600080fd5b615ac16145db565b8251815260208301516157ba8161482c565b600060208284031215615ae557600080fd5b5051919050565b805169ffffffffffffffffffff811681146142b757600080fd5b600080600080600060a08688031215615b1e57600080fd5b615b2786615aec565b9450602086015193506040860151925060608601519150615b4a60808701615aec565b90509295509295909350565b600060208284031215615b6857600080fd5b8151610b6981614704565b600060408284031215615b8557600080fd5b615b8d6145db565b615b9683614293565b8152602083013560208201528091505092915050565b63ffffffff818116838216019080821115614234576142346155a2565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fdfea164736f6c6343000818000a", +} + +var FeeQuoterABI = FeeQuoterMetaData.ABI + +var FeeQuoterBin = FeeQuoterMetaData.Bin + +func DeployFeeQuoter(auth *bind.TransactOpts, backend bind.ContractBackend, staticConfig FeeQuoterStaticConfig, priceUpdaters []common.Address, feeTokens []common.Address, tokenPriceFeeds []FeeQuoterTokenPriceFeedUpdate, tokenTransferFeeConfigArgs []FeeQuoterTokenTransferFeeConfigArgs, premiumMultiplierWeiPerEthArgs []FeeQuoterPremiumMultiplierWeiPerEthArgs, destChainConfigArgs []FeeQuoterDestChainConfigArgs) (common.Address, *types.Transaction, *FeeQuoter, error) { + parsed, err := FeeQuoterMetaData.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(FeeQuoterBin), backend, staticConfig, priceUpdaters, feeTokens, tokenPriceFeeds, tokenTransferFeeConfigArgs, premiumMultiplierWeiPerEthArgs, destChainConfigArgs) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &FeeQuoter{address: address, abi: *parsed, FeeQuoterCaller: FeeQuoterCaller{contract: contract}, FeeQuoterTransactor: FeeQuoterTransactor{contract: contract}, FeeQuoterFilterer: FeeQuoterFilterer{contract: contract}}, nil +} + +type FeeQuoter struct { + address common.Address + abi abi.ABI + FeeQuoterCaller + FeeQuoterTransactor + FeeQuoterFilterer +} + +type FeeQuoterCaller struct { + contract *bind.BoundContract +} + +type FeeQuoterTransactor struct { + contract *bind.BoundContract +} + +type FeeQuoterFilterer struct { + contract *bind.BoundContract +} + +type FeeQuoterSession struct { + Contract *FeeQuoter + CallOpts bind.CallOpts + TransactOpts bind.TransactOpts +} + +type FeeQuoterCallerSession struct { + Contract *FeeQuoterCaller + CallOpts bind.CallOpts +} + +type FeeQuoterTransactorSession struct { + Contract *FeeQuoterTransactor + TransactOpts bind.TransactOpts +} + +type FeeQuoterRaw struct { + Contract *FeeQuoter +} + +type FeeQuoterCallerRaw struct { + Contract *FeeQuoterCaller +} + +type FeeQuoterTransactorRaw struct { + Contract *FeeQuoterTransactor +} + +func NewFeeQuoter(address common.Address, backend bind.ContractBackend) (*FeeQuoter, error) { + abi, err := abi.JSON(strings.NewReader(FeeQuoterABI)) + if err != nil { + return nil, err + } + contract, err := bindFeeQuoter(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &FeeQuoter{address: address, abi: abi, FeeQuoterCaller: FeeQuoterCaller{contract: contract}, FeeQuoterTransactor: FeeQuoterTransactor{contract: contract}, FeeQuoterFilterer: FeeQuoterFilterer{contract: contract}}, nil +} + +func NewFeeQuoterCaller(address common.Address, caller bind.ContractCaller) (*FeeQuoterCaller, error) { + contract, err := bindFeeQuoter(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &FeeQuoterCaller{contract: contract}, nil +} + +func NewFeeQuoterTransactor(address common.Address, transactor bind.ContractTransactor) (*FeeQuoterTransactor, error) { + contract, err := bindFeeQuoter(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &FeeQuoterTransactor{contract: contract}, nil +} + +func NewFeeQuoterFilterer(address common.Address, filterer bind.ContractFilterer) (*FeeQuoterFilterer, error) { + contract, err := bindFeeQuoter(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &FeeQuoterFilterer{contract: contract}, nil +} + +func bindFeeQuoter(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := FeeQuoterMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +func (_FeeQuoter *FeeQuoterRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _FeeQuoter.Contract.FeeQuoterCaller.contract.Call(opts, result, method, params...) +} + +func (_FeeQuoter *FeeQuoterRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _FeeQuoter.Contract.FeeQuoterTransactor.contract.Transfer(opts) +} + +func (_FeeQuoter *FeeQuoterRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _FeeQuoter.Contract.FeeQuoterTransactor.contract.Transact(opts, method, params...) +} + +func (_FeeQuoter *FeeQuoterCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _FeeQuoter.Contract.contract.Call(opts, result, method, params...) +} + +func (_FeeQuoter *FeeQuoterTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _FeeQuoter.Contract.contract.Transfer(opts) +} + +func (_FeeQuoter *FeeQuoterTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _FeeQuoter.Contract.contract.Transact(opts, method, params...) +} + +func (_FeeQuoter *FeeQuoterCaller) ConvertTokenAmount(opts *bind.CallOpts, fromToken common.Address, fromTokenAmount *big.Int, toToken common.Address) (*big.Int, error) { + var out []interface{} + err := _FeeQuoter.contract.Call(opts, &out, "convertTokenAmount", fromToken, fromTokenAmount, toToken) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_FeeQuoter *FeeQuoterSession) ConvertTokenAmount(fromToken common.Address, fromTokenAmount *big.Int, toToken common.Address) (*big.Int, error) { + return _FeeQuoter.Contract.ConvertTokenAmount(&_FeeQuoter.CallOpts, fromToken, fromTokenAmount, toToken) +} + +func (_FeeQuoter *FeeQuoterCallerSession) ConvertTokenAmount(fromToken common.Address, fromTokenAmount *big.Int, toToken common.Address) (*big.Int, error) { + return _FeeQuoter.Contract.ConvertTokenAmount(&_FeeQuoter.CallOpts, fromToken, fromTokenAmount, toToken) +} + +func (_FeeQuoter *FeeQuoterCaller) GetAllAuthorizedCallers(opts *bind.CallOpts) ([]common.Address, error) { + var out []interface{} + err := _FeeQuoter.contract.Call(opts, &out, "getAllAuthorizedCallers") + + if err != nil { + return *new([]common.Address), err + } + + out0 := *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) + + return out0, err + +} + +func (_FeeQuoter *FeeQuoterSession) GetAllAuthorizedCallers() ([]common.Address, error) { + return _FeeQuoter.Contract.GetAllAuthorizedCallers(&_FeeQuoter.CallOpts) +} + +func (_FeeQuoter *FeeQuoterCallerSession) GetAllAuthorizedCallers() ([]common.Address, error) { + return _FeeQuoter.Contract.GetAllAuthorizedCallers(&_FeeQuoter.CallOpts) +} + +func (_FeeQuoter *FeeQuoterCaller) GetDestChainConfig(opts *bind.CallOpts, destChainSelector uint64) (FeeQuoterDestChainConfig, error) { + var out []interface{} + err := _FeeQuoter.contract.Call(opts, &out, "getDestChainConfig", destChainSelector) + + if err != nil { + return *new(FeeQuoterDestChainConfig), err + } + + out0 := *abi.ConvertType(out[0], new(FeeQuoterDestChainConfig)).(*FeeQuoterDestChainConfig) + + return out0, err + +} + +func (_FeeQuoter *FeeQuoterSession) GetDestChainConfig(destChainSelector uint64) (FeeQuoterDestChainConfig, error) { + return _FeeQuoter.Contract.GetDestChainConfig(&_FeeQuoter.CallOpts, destChainSelector) +} + +func (_FeeQuoter *FeeQuoterCallerSession) GetDestChainConfig(destChainSelector uint64) (FeeQuoterDestChainConfig, error) { + return _FeeQuoter.Contract.GetDestChainConfig(&_FeeQuoter.CallOpts, destChainSelector) +} + +func (_FeeQuoter *FeeQuoterCaller) GetDestinationChainGasPrice(opts *bind.CallOpts, destChainSelector uint64) (InternalTimestampedPackedUint224, error) { + var out []interface{} + err := _FeeQuoter.contract.Call(opts, &out, "getDestinationChainGasPrice", destChainSelector) + + if err != nil { + return *new(InternalTimestampedPackedUint224), err + } + + out0 := *abi.ConvertType(out[0], new(InternalTimestampedPackedUint224)).(*InternalTimestampedPackedUint224) + + return out0, err + +} + +func (_FeeQuoter *FeeQuoterSession) GetDestinationChainGasPrice(destChainSelector uint64) (InternalTimestampedPackedUint224, error) { + return _FeeQuoter.Contract.GetDestinationChainGasPrice(&_FeeQuoter.CallOpts, destChainSelector) +} + +func (_FeeQuoter *FeeQuoterCallerSession) GetDestinationChainGasPrice(destChainSelector uint64) (InternalTimestampedPackedUint224, error) { + return _FeeQuoter.Contract.GetDestinationChainGasPrice(&_FeeQuoter.CallOpts, destChainSelector) +} + +func (_FeeQuoter *FeeQuoterCaller) GetFeeTokens(opts *bind.CallOpts) ([]common.Address, error) { + var out []interface{} + err := _FeeQuoter.contract.Call(opts, &out, "getFeeTokens") + + if err != nil { + return *new([]common.Address), err + } + + out0 := *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) + + return out0, err + +} + +func (_FeeQuoter *FeeQuoterSession) GetFeeTokens() ([]common.Address, error) { + return _FeeQuoter.Contract.GetFeeTokens(&_FeeQuoter.CallOpts) +} + +func (_FeeQuoter *FeeQuoterCallerSession) GetFeeTokens() ([]common.Address, error) { + return _FeeQuoter.Contract.GetFeeTokens(&_FeeQuoter.CallOpts) +} + +func (_FeeQuoter *FeeQuoterCaller) GetPremiumMultiplierWeiPerEth(opts *bind.CallOpts, token common.Address) (uint64, error) { + var out []interface{} + err := _FeeQuoter.contract.Call(opts, &out, "getPremiumMultiplierWeiPerEth", token) + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +func (_FeeQuoter *FeeQuoterSession) GetPremiumMultiplierWeiPerEth(token common.Address) (uint64, error) { + return _FeeQuoter.Contract.GetPremiumMultiplierWeiPerEth(&_FeeQuoter.CallOpts, token) +} + +func (_FeeQuoter *FeeQuoterCallerSession) GetPremiumMultiplierWeiPerEth(token common.Address) (uint64, error) { + return _FeeQuoter.Contract.GetPremiumMultiplierWeiPerEth(&_FeeQuoter.CallOpts, token) +} + +func (_FeeQuoter *FeeQuoterCaller) GetStaticConfig(opts *bind.CallOpts) (FeeQuoterStaticConfig, error) { + var out []interface{} + err := _FeeQuoter.contract.Call(opts, &out, "getStaticConfig") + + if err != nil { + return *new(FeeQuoterStaticConfig), err + } + + out0 := *abi.ConvertType(out[0], new(FeeQuoterStaticConfig)).(*FeeQuoterStaticConfig) + + return out0, err + +} + +func (_FeeQuoter *FeeQuoterSession) GetStaticConfig() (FeeQuoterStaticConfig, error) { + return _FeeQuoter.Contract.GetStaticConfig(&_FeeQuoter.CallOpts) +} + +func (_FeeQuoter *FeeQuoterCallerSession) GetStaticConfig() (FeeQuoterStaticConfig, error) { + return _FeeQuoter.Contract.GetStaticConfig(&_FeeQuoter.CallOpts) +} + +func (_FeeQuoter *FeeQuoterCaller) GetTokenAndGasPrices(opts *bind.CallOpts, token common.Address, destChainSelector uint64) (GetTokenAndGasPrices, + + error) { + var out []interface{} + err := _FeeQuoter.contract.Call(opts, &out, "getTokenAndGasPrices", token, destChainSelector) + + outstruct := new(GetTokenAndGasPrices) + if err != nil { + return *outstruct, err + } + + outstruct.TokenPrice = *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + outstruct.GasPriceValue = *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) + + return *outstruct, err + +} + +func (_FeeQuoter *FeeQuoterSession) GetTokenAndGasPrices(token common.Address, destChainSelector uint64) (GetTokenAndGasPrices, + + error) { + return _FeeQuoter.Contract.GetTokenAndGasPrices(&_FeeQuoter.CallOpts, token, destChainSelector) +} + +func (_FeeQuoter *FeeQuoterCallerSession) GetTokenAndGasPrices(token common.Address, destChainSelector uint64) (GetTokenAndGasPrices, + + error) { + return _FeeQuoter.Contract.GetTokenAndGasPrices(&_FeeQuoter.CallOpts, token, destChainSelector) +} + +func (_FeeQuoter *FeeQuoterCaller) GetTokenPrice(opts *bind.CallOpts, token common.Address) (InternalTimestampedPackedUint224, error) { + var out []interface{} + err := _FeeQuoter.contract.Call(opts, &out, "getTokenPrice", token) + + if err != nil { + return *new(InternalTimestampedPackedUint224), err + } + + out0 := *abi.ConvertType(out[0], new(InternalTimestampedPackedUint224)).(*InternalTimestampedPackedUint224) + + return out0, err + +} + +func (_FeeQuoter *FeeQuoterSession) GetTokenPrice(token common.Address) (InternalTimestampedPackedUint224, error) { + return _FeeQuoter.Contract.GetTokenPrice(&_FeeQuoter.CallOpts, token) +} + +func (_FeeQuoter *FeeQuoterCallerSession) GetTokenPrice(token common.Address) (InternalTimestampedPackedUint224, error) { + return _FeeQuoter.Contract.GetTokenPrice(&_FeeQuoter.CallOpts, token) +} + +func (_FeeQuoter *FeeQuoterCaller) GetTokenPriceFeedConfig(opts *bind.CallOpts, token common.Address) (IFeeQuoterTokenPriceFeedConfig, error) { + var out []interface{} + err := _FeeQuoter.contract.Call(opts, &out, "getTokenPriceFeedConfig", token) + + if err != nil { + return *new(IFeeQuoterTokenPriceFeedConfig), err + } + + out0 := *abi.ConvertType(out[0], new(IFeeQuoterTokenPriceFeedConfig)).(*IFeeQuoterTokenPriceFeedConfig) + + return out0, err + +} + +func (_FeeQuoter *FeeQuoterSession) GetTokenPriceFeedConfig(token common.Address) (IFeeQuoterTokenPriceFeedConfig, error) { + return _FeeQuoter.Contract.GetTokenPriceFeedConfig(&_FeeQuoter.CallOpts, token) +} + +func (_FeeQuoter *FeeQuoterCallerSession) GetTokenPriceFeedConfig(token common.Address) (IFeeQuoterTokenPriceFeedConfig, error) { + return _FeeQuoter.Contract.GetTokenPriceFeedConfig(&_FeeQuoter.CallOpts, token) +} + +func (_FeeQuoter *FeeQuoterCaller) GetTokenPrices(opts *bind.CallOpts, tokens []common.Address) ([]InternalTimestampedPackedUint224, error) { + var out []interface{} + err := _FeeQuoter.contract.Call(opts, &out, "getTokenPrices", tokens) + + if err != nil { + return *new([]InternalTimestampedPackedUint224), err + } + + out0 := *abi.ConvertType(out[0], new([]InternalTimestampedPackedUint224)).(*[]InternalTimestampedPackedUint224) + + return out0, err + +} + +func (_FeeQuoter *FeeQuoterSession) GetTokenPrices(tokens []common.Address) ([]InternalTimestampedPackedUint224, error) { + return _FeeQuoter.Contract.GetTokenPrices(&_FeeQuoter.CallOpts, tokens) +} + +func (_FeeQuoter *FeeQuoterCallerSession) GetTokenPrices(tokens []common.Address) ([]InternalTimestampedPackedUint224, error) { + return _FeeQuoter.Contract.GetTokenPrices(&_FeeQuoter.CallOpts, tokens) +} + +func (_FeeQuoter *FeeQuoterCaller) GetTokenTransferFeeConfig(opts *bind.CallOpts, destChainSelector uint64, token common.Address) (FeeQuoterTokenTransferFeeConfig, error) { + var out []interface{} + err := _FeeQuoter.contract.Call(opts, &out, "getTokenTransferFeeConfig", destChainSelector, token) + + if err != nil { + return *new(FeeQuoterTokenTransferFeeConfig), err + } + + out0 := *abi.ConvertType(out[0], new(FeeQuoterTokenTransferFeeConfig)).(*FeeQuoterTokenTransferFeeConfig) + + return out0, err + +} + +func (_FeeQuoter *FeeQuoterSession) GetTokenTransferFeeConfig(destChainSelector uint64, token common.Address) (FeeQuoterTokenTransferFeeConfig, error) { + return _FeeQuoter.Contract.GetTokenTransferFeeConfig(&_FeeQuoter.CallOpts, destChainSelector, token) +} + +func (_FeeQuoter *FeeQuoterCallerSession) GetTokenTransferFeeConfig(destChainSelector uint64, token common.Address) (FeeQuoterTokenTransferFeeConfig, error) { + return _FeeQuoter.Contract.GetTokenTransferFeeConfig(&_FeeQuoter.CallOpts, destChainSelector, token) +} + +func (_FeeQuoter *FeeQuoterCaller) GetValidatedFee(opts *bind.CallOpts, destChainSelector uint64, message ClientEVM2AnyMessage) (*big.Int, error) { + var out []interface{} + err := _FeeQuoter.contract.Call(opts, &out, "getValidatedFee", destChainSelector, message) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_FeeQuoter *FeeQuoterSession) GetValidatedFee(destChainSelector uint64, message ClientEVM2AnyMessage) (*big.Int, error) { + return _FeeQuoter.Contract.GetValidatedFee(&_FeeQuoter.CallOpts, destChainSelector, message) +} + +func (_FeeQuoter *FeeQuoterCallerSession) GetValidatedFee(destChainSelector uint64, message ClientEVM2AnyMessage) (*big.Int, error) { + return _FeeQuoter.Contract.GetValidatedFee(&_FeeQuoter.CallOpts, destChainSelector, message) +} + +func (_FeeQuoter *FeeQuoterCaller) GetValidatedTokenPrice(opts *bind.CallOpts, token common.Address) (*big.Int, error) { + var out []interface{} + err := _FeeQuoter.contract.Call(opts, &out, "getValidatedTokenPrice", token) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_FeeQuoter *FeeQuoterSession) GetValidatedTokenPrice(token common.Address) (*big.Int, error) { + return _FeeQuoter.Contract.GetValidatedTokenPrice(&_FeeQuoter.CallOpts, token) +} + +func (_FeeQuoter *FeeQuoterCallerSession) GetValidatedTokenPrice(token common.Address) (*big.Int, error) { + return _FeeQuoter.Contract.GetValidatedTokenPrice(&_FeeQuoter.CallOpts, token) +} + +func (_FeeQuoter *FeeQuoterCaller) Owner(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _FeeQuoter.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 + +} + +func (_FeeQuoter *FeeQuoterSession) Owner() (common.Address, error) { + return _FeeQuoter.Contract.Owner(&_FeeQuoter.CallOpts) +} + +func (_FeeQuoter *FeeQuoterCallerSession) Owner() (common.Address, error) { + return _FeeQuoter.Contract.Owner(&_FeeQuoter.CallOpts) +} + +func (_FeeQuoter *FeeQuoterCaller) ProcessMessageArgs(opts *bind.CallOpts, destChainSelector uint64, feeToken common.Address, feeTokenAmount *big.Int, extraArgs []byte) (ProcessMessageArgs, + + error) { + var out []interface{} + err := _FeeQuoter.contract.Call(opts, &out, "processMessageArgs", destChainSelector, feeToken, feeTokenAmount, extraArgs) + + outstruct := new(ProcessMessageArgs) + if err != nil { + return *outstruct, err + } + + outstruct.MsgFeeJuels = *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + outstruct.IsOutOfOrderExecution = *abi.ConvertType(out[1], new(bool)).(*bool) + outstruct.ConvertedExtraArgs = *abi.ConvertType(out[2], new([]byte)).(*[]byte) + + return *outstruct, err + +} + +func (_FeeQuoter *FeeQuoterSession) ProcessMessageArgs(destChainSelector uint64, feeToken common.Address, feeTokenAmount *big.Int, extraArgs []byte) (ProcessMessageArgs, + + error) { + return _FeeQuoter.Contract.ProcessMessageArgs(&_FeeQuoter.CallOpts, destChainSelector, feeToken, feeTokenAmount, extraArgs) +} + +func (_FeeQuoter *FeeQuoterCallerSession) ProcessMessageArgs(destChainSelector uint64, feeToken common.Address, feeTokenAmount *big.Int, extraArgs []byte) (ProcessMessageArgs, + + error) { + return _FeeQuoter.Contract.ProcessMessageArgs(&_FeeQuoter.CallOpts, destChainSelector, feeToken, feeTokenAmount, extraArgs) +} + +func (_FeeQuoter *FeeQuoterCaller) ProcessPoolReturnData(opts *bind.CallOpts, destChainSelector uint64, rampTokenAmounts []InternalRampTokenAmount, sourceTokenAmounts []ClientEVMTokenAmount) ([][]byte, error) { + var out []interface{} + err := _FeeQuoter.contract.Call(opts, &out, "processPoolReturnData", destChainSelector, rampTokenAmounts, sourceTokenAmounts) + + if err != nil { + return *new([][]byte), err + } + + out0 := *abi.ConvertType(out[0], new([][]byte)).(*[][]byte) + + return out0, err + +} + +func (_FeeQuoter *FeeQuoterSession) ProcessPoolReturnData(destChainSelector uint64, rampTokenAmounts []InternalRampTokenAmount, sourceTokenAmounts []ClientEVMTokenAmount) ([][]byte, error) { + return _FeeQuoter.Contract.ProcessPoolReturnData(&_FeeQuoter.CallOpts, destChainSelector, rampTokenAmounts, sourceTokenAmounts) +} + +func (_FeeQuoter *FeeQuoterCallerSession) ProcessPoolReturnData(destChainSelector uint64, rampTokenAmounts []InternalRampTokenAmount, sourceTokenAmounts []ClientEVMTokenAmount) ([][]byte, error) { + return _FeeQuoter.Contract.ProcessPoolReturnData(&_FeeQuoter.CallOpts, destChainSelector, rampTokenAmounts, sourceTokenAmounts) +} + +func (_FeeQuoter *FeeQuoterCaller) TypeAndVersion(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _FeeQuoter.contract.Call(opts, &out, "typeAndVersion") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +func (_FeeQuoter *FeeQuoterSession) TypeAndVersion() (string, error) { + return _FeeQuoter.Contract.TypeAndVersion(&_FeeQuoter.CallOpts) +} + +func (_FeeQuoter *FeeQuoterCallerSession) TypeAndVersion() (string, error) { + return _FeeQuoter.Contract.TypeAndVersion(&_FeeQuoter.CallOpts) +} + +func (_FeeQuoter *FeeQuoterTransactor) AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + return _FeeQuoter.contract.Transact(opts, "acceptOwnership") +} + +func (_FeeQuoter *FeeQuoterSession) AcceptOwnership() (*types.Transaction, error) { + return _FeeQuoter.Contract.AcceptOwnership(&_FeeQuoter.TransactOpts) +} + +func (_FeeQuoter *FeeQuoterTransactorSession) AcceptOwnership() (*types.Transaction, error) { + return _FeeQuoter.Contract.AcceptOwnership(&_FeeQuoter.TransactOpts) +} + +func (_FeeQuoter *FeeQuoterTransactor) ApplyAuthorizedCallerUpdates(opts *bind.TransactOpts, authorizedCallerArgs AuthorizedCallersAuthorizedCallerArgs) (*types.Transaction, error) { + return _FeeQuoter.contract.Transact(opts, "applyAuthorizedCallerUpdates", authorizedCallerArgs) +} + +func (_FeeQuoter *FeeQuoterSession) ApplyAuthorizedCallerUpdates(authorizedCallerArgs AuthorizedCallersAuthorizedCallerArgs) (*types.Transaction, error) { + return _FeeQuoter.Contract.ApplyAuthorizedCallerUpdates(&_FeeQuoter.TransactOpts, authorizedCallerArgs) +} + +func (_FeeQuoter *FeeQuoterTransactorSession) ApplyAuthorizedCallerUpdates(authorizedCallerArgs AuthorizedCallersAuthorizedCallerArgs) (*types.Transaction, error) { + return _FeeQuoter.Contract.ApplyAuthorizedCallerUpdates(&_FeeQuoter.TransactOpts, authorizedCallerArgs) +} + +func (_FeeQuoter *FeeQuoterTransactor) ApplyDestChainConfigUpdates(opts *bind.TransactOpts, destChainConfigArgs []FeeQuoterDestChainConfigArgs) (*types.Transaction, error) { + return _FeeQuoter.contract.Transact(opts, "applyDestChainConfigUpdates", destChainConfigArgs) +} + +func (_FeeQuoter *FeeQuoterSession) ApplyDestChainConfigUpdates(destChainConfigArgs []FeeQuoterDestChainConfigArgs) (*types.Transaction, error) { + return _FeeQuoter.Contract.ApplyDestChainConfigUpdates(&_FeeQuoter.TransactOpts, destChainConfigArgs) +} + +func (_FeeQuoter *FeeQuoterTransactorSession) ApplyDestChainConfigUpdates(destChainConfigArgs []FeeQuoterDestChainConfigArgs) (*types.Transaction, error) { + return _FeeQuoter.Contract.ApplyDestChainConfigUpdates(&_FeeQuoter.TransactOpts, destChainConfigArgs) +} + +func (_FeeQuoter *FeeQuoterTransactor) ApplyFeeTokensUpdates(opts *bind.TransactOpts, feeTokensToAdd []common.Address, feeTokensToRemove []common.Address) (*types.Transaction, error) { + return _FeeQuoter.contract.Transact(opts, "applyFeeTokensUpdates", feeTokensToAdd, feeTokensToRemove) +} + +func (_FeeQuoter *FeeQuoterSession) ApplyFeeTokensUpdates(feeTokensToAdd []common.Address, feeTokensToRemove []common.Address) (*types.Transaction, error) { + return _FeeQuoter.Contract.ApplyFeeTokensUpdates(&_FeeQuoter.TransactOpts, feeTokensToAdd, feeTokensToRemove) +} + +func (_FeeQuoter *FeeQuoterTransactorSession) ApplyFeeTokensUpdates(feeTokensToAdd []common.Address, feeTokensToRemove []common.Address) (*types.Transaction, error) { + return _FeeQuoter.Contract.ApplyFeeTokensUpdates(&_FeeQuoter.TransactOpts, feeTokensToAdd, feeTokensToRemove) +} + +func (_FeeQuoter *FeeQuoterTransactor) ApplyPremiumMultiplierWeiPerEthUpdates(opts *bind.TransactOpts, premiumMultiplierWeiPerEthArgs []FeeQuoterPremiumMultiplierWeiPerEthArgs) (*types.Transaction, error) { + return _FeeQuoter.contract.Transact(opts, "applyPremiumMultiplierWeiPerEthUpdates", premiumMultiplierWeiPerEthArgs) +} + +func (_FeeQuoter *FeeQuoterSession) ApplyPremiumMultiplierWeiPerEthUpdates(premiumMultiplierWeiPerEthArgs []FeeQuoterPremiumMultiplierWeiPerEthArgs) (*types.Transaction, error) { + return _FeeQuoter.Contract.ApplyPremiumMultiplierWeiPerEthUpdates(&_FeeQuoter.TransactOpts, premiumMultiplierWeiPerEthArgs) +} + +func (_FeeQuoter *FeeQuoterTransactorSession) ApplyPremiumMultiplierWeiPerEthUpdates(premiumMultiplierWeiPerEthArgs []FeeQuoterPremiumMultiplierWeiPerEthArgs) (*types.Transaction, error) { + return _FeeQuoter.Contract.ApplyPremiumMultiplierWeiPerEthUpdates(&_FeeQuoter.TransactOpts, premiumMultiplierWeiPerEthArgs) +} + +func (_FeeQuoter *FeeQuoterTransactor) ApplyTokenTransferFeeConfigUpdates(opts *bind.TransactOpts, tokenTransferFeeConfigArgs []FeeQuoterTokenTransferFeeConfigArgs, tokensToUseDefaultFeeConfigs []FeeQuoterTokenTransferFeeConfigRemoveArgs) (*types.Transaction, error) { + return _FeeQuoter.contract.Transact(opts, "applyTokenTransferFeeConfigUpdates", tokenTransferFeeConfigArgs, tokensToUseDefaultFeeConfigs) +} + +func (_FeeQuoter *FeeQuoterSession) ApplyTokenTransferFeeConfigUpdates(tokenTransferFeeConfigArgs []FeeQuoterTokenTransferFeeConfigArgs, tokensToUseDefaultFeeConfigs []FeeQuoterTokenTransferFeeConfigRemoveArgs) (*types.Transaction, error) { + return _FeeQuoter.Contract.ApplyTokenTransferFeeConfigUpdates(&_FeeQuoter.TransactOpts, tokenTransferFeeConfigArgs, tokensToUseDefaultFeeConfigs) +} + +func (_FeeQuoter *FeeQuoterTransactorSession) ApplyTokenTransferFeeConfigUpdates(tokenTransferFeeConfigArgs []FeeQuoterTokenTransferFeeConfigArgs, tokensToUseDefaultFeeConfigs []FeeQuoterTokenTransferFeeConfigRemoveArgs) (*types.Transaction, error) { + return _FeeQuoter.Contract.ApplyTokenTransferFeeConfigUpdates(&_FeeQuoter.TransactOpts, tokenTransferFeeConfigArgs, tokensToUseDefaultFeeConfigs) +} + +func (_FeeQuoter *FeeQuoterTransactor) OnReport(opts *bind.TransactOpts, metadata []byte, report []byte) (*types.Transaction, error) { + return _FeeQuoter.contract.Transact(opts, "onReport", metadata, report) +} + +func (_FeeQuoter *FeeQuoterSession) OnReport(metadata []byte, report []byte) (*types.Transaction, error) { + return _FeeQuoter.Contract.OnReport(&_FeeQuoter.TransactOpts, metadata, report) +} + +func (_FeeQuoter *FeeQuoterTransactorSession) OnReport(metadata []byte, report []byte) (*types.Transaction, error) { + return _FeeQuoter.Contract.OnReport(&_FeeQuoter.TransactOpts, metadata, report) +} + +func (_FeeQuoter *FeeQuoterTransactor) SetReportPermissions(opts *bind.TransactOpts, permissions []KeystoneFeedsPermissionHandlerPermission) (*types.Transaction, error) { + return _FeeQuoter.contract.Transact(opts, "setReportPermissions", permissions) +} + +func (_FeeQuoter *FeeQuoterSession) SetReportPermissions(permissions []KeystoneFeedsPermissionHandlerPermission) (*types.Transaction, error) { + return _FeeQuoter.Contract.SetReportPermissions(&_FeeQuoter.TransactOpts, permissions) +} + +func (_FeeQuoter *FeeQuoterTransactorSession) SetReportPermissions(permissions []KeystoneFeedsPermissionHandlerPermission) (*types.Transaction, error) { + return _FeeQuoter.Contract.SetReportPermissions(&_FeeQuoter.TransactOpts, permissions) +} + +func (_FeeQuoter *FeeQuoterTransactor) TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) { + return _FeeQuoter.contract.Transact(opts, "transferOwnership", to) +} + +func (_FeeQuoter *FeeQuoterSession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _FeeQuoter.Contract.TransferOwnership(&_FeeQuoter.TransactOpts, to) +} + +func (_FeeQuoter *FeeQuoterTransactorSession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _FeeQuoter.Contract.TransferOwnership(&_FeeQuoter.TransactOpts, to) +} + +func (_FeeQuoter *FeeQuoterTransactor) UpdatePrices(opts *bind.TransactOpts, priceUpdates InternalPriceUpdates) (*types.Transaction, error) { + return _FeeQuoter.contract.Transact(opts, "updatePrices", priceUpdates) +} + +func (_FeeQuoter *FeeQuoterSession) UpdatePrices(priceUpdates InternalPriceUpdates) (*types.Transaction, error) { + return _FeeQuoter.Contract.UpdatePrices(&_FeeQuoter.TransactOpts, priceUpdates) +} + +func (_FeeQuoter *FeeQuoterTransactorSession) UpdatePrices(priceUpdates InternalPriceUpdates) (*types.Transaction, error) { + return _FeeQuoter.Contract.UpdatePrices(&_FeeQuoter.TransactOpts, priceUpdates) +} + +func (_FeeQuoter *FeeQuoterTransactor) UpdateTokenPriceFeeds(opts *bind.TransactOpts, tokenPriceFeedUpdates []FeeQuoterTokenPriceFeedUpdate) (*types.Transaction, error) { + return _FeeQuoter.contract.Transact(opts, "updateTokenPriceFeeds", tokenPriceFeedUpdates) +} + +func (_FeeQuoter *FeeQuoterSession) UpdateTokenPriceFeeds(tokenPriceFeedUpdates []FeeQuoterTokenPriceFeedUpdate) (*types.Transaction, error) { + return _FeeQuoter.Contract.UpdateTokenPriceFeeds(&_FeeQuoter.TransactOpts, tokenPriceFeedUpdates) +} + +func (_FeeQuoter *FeeQuoterTransactorSession) UpdateTokenPriceFeeds(tokenPriceFeedUpdates []FeeQuoterTokenPriceFeedUpdate) (*types.Transaction, error) { + return _FeeQuoter.Contract.UpdateTokenPriceFeeds(&_FeeQuoter.TransactOpts, tokenPriceFeedUpdates) +} + +type FeeQuoterAuthorizedCallerAddedIterator struct { + Event *FeeQuoterAuthorizedCallerAdded + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *FeeQuoterAuthorizedCallerAddedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(FeeQuoterAuthorizedCallerAdded) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(FeeQuoterAuthorizedCallerAdded) + 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() + } +} + +func (it *FeeQuoterAuthorizedCallerAddedIterator) Error() error { + return it.fail +} + +func (it *FeeQuoterAuthorizedCallerAddedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type FeeQuoterAuthorizedCallerAdded struct { + Caller common.Address + Raw types.Log +} + +func (_FeeQuoter *FeeQuoterFilterer) FilterAuthorizedCallerAdded(opts *bind.FilterOpts) (*FeeQuoterAuthorizedCallerAddedIterator, error) { + + logs, sub, err := _FeeQuoter.contract.FilterLogs(opts, "AuthorizedCallerAdded") + if err != nil { + return nil, err + } + return &FeeQuoterAuthorizedCallerAddedIterator{contract: _FeeQuoter.contract, event: "AuthorizedCallerAdded", logs: logs, sub: sub}, nil +} + +func (_FeeQuoter *FeeQuoterFilterer) WatchAuthorizedCallerAdded(opts *bind.WatchOpts, sink chan<- *FeeQuoterAuthorizedCallerAdded) (event.Subscription, error) { + + logs, sub, err := _FeeQuoter.contract.WatchLogs(opts, "AuthorizedCallerAdded") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(FeeQuoterAuthorizedCallerAdded) + if err := _FeeQuoter.contract.UnpackLog(event, "AuthorizedCallerAdded", 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 +} + +func (_FeeQuoter *FeeQuoterFilterer) ParseAuthorizedCallerAdded(log types.Log) (*FeeQuoterAuthorizedCallerAdded, error) { + event := new(FeeQuoterAuthorizedCallerAdded) + if err := _FeeQuoter.contract.UnpackLog(event, "AuthorizedCallerAdded", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type FeeQuoterAuthorizedCallerRemovedIterator struct { + Event *FeeQuoterAuthorizedCallerRemoved + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *FeeQuoterAuthorizedCallerRemovedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(FeeQuoterAuthorizedCallerRemoved) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(FeeQuoterAuthorizedCallerRemoved) + 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() + } +} + +func (it *FeeQuoterAuthorizedCallerRemovedIterator) Error() error { + return it.fail +} + +func (it *FeeQuoterAuthorizedCallerRemovedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type FeeQuoterAuthorizedCallerRemoved struct { + Caller common.Address + Raw types.Log +} + +func (_FeeQuoter *FeeQuoterFilterer) FilterAuthorizedCallerRemoved(opts *bind.FilterOpts) (*FeeQuoterAuthorizedCallerRemovedIterator, error) { + + logs, sub, err := _FeeQuoter.contract.FilterLogs(opts, "AuthorizedCallerRemoved") + if err != nil { + return nil, err + } + return &FeeQuoterAuthorizedCallerRemovedIterator{contract: _FeeQuoter.contract, event: "AuthorizedCallerRemoved", logs: logs, sub: sub}, nil +} + +func (_FeeQuoter *FeeQuoterFilterer) WatchAuthorizedCallerRemoved(opts *bind.WatchOpts, sink chan<- *FeeQuoterAuthorizedCallerRemoved) (event.Subscription, error) { + + logs, sub, err := _FeeQuoter.contract.WatchLogs(opts, "AuthorizedCallerRemoved") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(FeeQuoterAuthorizedCallerRemoved) + if err := _FeeQuoter.contract.UnpackLog(event, "AuthorizedCallerRemoved", 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 +} + +func (_FeeQuoter *FeeQuoterFilterer) ParseAuthorizedCallerRemoved(log types.Log) (*FeeQuoterAuthorizedCallerRemoved, error) { + event := new(FeeQuoterAuthorizedCallerRemoved) + if err := _FeeQuoter.contract.UnpackLog(event, "AuthorizedCallerRemoved", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type FeeQuoterDestChainAddedIterator struct { + Event *FeeQuoterDestChainAdded + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *FeeQuoterDestChainAddedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(FeeQuoterDestChainAdded) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(FeeQuoterDestChainAdded) + 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() + } +} + +func (it *FeeQuoterDestChainAddedIterator) Error() error { + return it.fail +} + +func (it *FeeQuoterDestChainAddedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type FeeQuoterDestChainAdded struct { + DestChainSelector uint64 + DestChainConfig FeeQuoterDestChainConfig + Raw types.Log +} + +func (_FeeQuoter *FeeQuoterFilterer) FilterDestChainAdded(opts *bind.FilterOpts, destChainSelector []uint64) (*FeeQuoterDestChainAddedIterator, error) { + + var destChainSelectorRule []interface{} + for _, destChainSelectorItem := range destChainSelector { + destChainSelectorRule = append(destChainSelectorRule, destChainSelectorItem) + } + + logs, sub, err := _FeeQuoter.contract.FilterLogs(opts, "DestChainAdded", destChainSelectorRule) + if err != nil { + return nil, err + } + return &FeeQuoterDestChainAddedIterator{contract: _FeeQuoter.contract, event: "DestChainAdded", logs: logs, sub: sub}, nil +} + +func (_FeeQuoter *FeeQuoterFilterer) WatchDestChainAdded(opts *bind.WatchOpts, sink chan<- *FeeQuoterDestChainAdded, destChainSelector []uint64) (event.Subscription, error) { + + var destChainSelectorRule []interface{} + for _, destChainSelectorItem := range destChainSelector { + destChainSelectorRule = append(destChainSelectorRule, destChainSelectorItem) + } + + logs, sub, err := _FeeQuoter.contract.WatchLogs(opts, "DestChainAdded", destChainSelectorRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(FeeQuoterDestChainAdded) + if err := _FeeQuoter.contract.UnpackLog(event, "DestChainAdded", 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 +} + +func (_FeeQuoter *FeeQuoterFilterer) ParseDestChainAdded(log types.Log) (*FeeQuoterDestChainAdded, error) { + event := new(FeeQuoterDestChainAdded) + if err := _FeeQuoter.contract.UnpackLog(event, "DestChainAdded", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type FeeQuoterDestChainConfigUpdatedIterator struct { + Event *FeeQuoterDestChainConfigUpdated + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *FeeQuoterDestChainConfigUpdatedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(FeeQuoterDestChainConfigUpdated) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(FeeQuoterDestChainConfigUpdated) + 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() + } +} + +func (it *FeeQuoterDestChainConfigUpdatedIterator) Error() error { + return it.fail +} + +func (it *FeeQuoterDestChainConfigUpdatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type FeeQuoterDestChainConfigUpdated struct { + DestChainSelector uint64 + DestChainConfig FeeQuoterDestChainConfig + Raw types.Log +} + +func (_FeeQuoter *FeeQuoterFilterer) FilterDestChainConfigUpdated(opts *bind.FilterOpts, destChainSelector []uint64) (*FeeQuoterDestChainConfigUpdatedIterator, error) { + + var destChainSelectorRule []interface{} + for _, destChainSelectorItem := range destChainSelector { + destChainSelectorRule = append(destChainSelectorRule, destChainSelectorItem) + } + + logs, sub, err := _FeeQuoter.contract.FilterLogs(opts, "DestChainConfigUpdated", destChainSelectorRule) + if err != nil { + return nil, err + } + return &FeeQuoterDestChainConfigUpdatedIterator{contract: _FeeQuoter.contract, event: "DestChainConfigUpdated", logs: logs, sub: sub}, nil +} + +func (_FeeQuoter *FeeQuoterFilterer) WatchDestChainConfigUpdated(opts *bind.WatchOpts, sink chan<- *FeeQuoterDestChainConfigUpdated, destChainSelector []uint64) (event.Subscription, error) { + + var destChainSelectorRule []interface{} + for _, destChainSelectorItem := range destChainSelector { + destChainSelectorRule = append(destChainSelectorRule, destChainSelectorItem) + } + + logs, sub, err := _FeeQuoter.contract.WatchLogs(opts, "DestChainConfigUpdated", destChainSelectorRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(FeeQuoterDestChainConfigUpdated) + if err := _FeeQuoter.contract.UnpackLog(event, "DestChainConfigUpdated", 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 +} + +func (_FeeQuoter *FeeQuoterFilterer) ParseDestChainConfigUpdated(log types.Log) (*FeeQuoterDestChainConfigUpdated, error) { + event := new(FeeQuoterDestChainConfigUpdated) + if err := _FeeQuoter.contract.UnpackLog(event, "DestChainConfigUpdated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type FeeQuoterFeeTokenAddedIterator struct { + Event *FeeQuoterFeeTokenAdded + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *FeeQuoterFeeTokenAddedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(FeeQuoterFeeTokenAdded) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(FeeQuoterFeeTokenAdded) + 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() + } +} + +func (it *FeeQuoterFeeTokenAddedIterator) Error() error { + return it.fail +} + +func (it *FeeQuoterFeeTokenAddedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type FeeQuoterFeeTokenAdded struct { + FeeToken common.Address + Raw types.Log +} + +func (_FeeQuoter *FeeQuoterFilterer) FilterFeeTokenAdded(opts *bind.FilterOpts, feeToken []common.Address) (*FeeQuoterFeeTokenAddedIterator, error) { + + var feeTokenRule []interface{} + for _, feeTokenItem := range feeToken { + feeTokenRule = append(feeTokenRule, feeTokenItem) + } + + logs, sub, err := _FeeQuoter.contract.FilterLogs(opts, "FeeTokenAdded", feeTokenRule) + if err != nil { + return nil, err + } + return &FeeQuoterFeeTokenAddedIterator{contract: _FeeQuoter.contract, event: "FeeTokenAdded", logs: logs, sub: sub}, nil +} + +func (_FeeQuoter *FeeQuoterFilterer) WatchFeeTokenAdded(opts *bind.WatchOpts, sink chan<- *FeeQuoterFeeTokenAdded, feeToken []common.Address) (event.Subscription, error) { + + var feeTokenRule []interface{} + for _, feeTokenItem := range feeToken { + feeTokenRule = append(feeTokenRule, feeTokenItem) + } + + logs, sub, err := _FeeQuoter.contract.WatchLogs(opts, "FeeTokenAdded", feeTokenRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(FeeQuoterFeeTokenAdded) + if err := _FeeQuoter.contract.UnpackLog(event, "FeeTokenAdded", 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 +} + +func (_FeeQuoter *FeeQuoterFilterer) ParseFeeTokenAdded(log types.Log) (*FeeQuoterFeeTokenAdded, error) { + event := new(FeeQuoterFeeTokenAdded) + if err := _FeeQuoter.contract.UnpackLog(event, "FeeTokenAdded", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type FeeQuoterFeeTokenRemovedIterator struct { + Event *FeeQuoterFeeTokenRemoved + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *FeeQuoterFeeTokenRemovedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(FeeQuoterFeeTokenRemoved) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(FeeQuoterFeeTokenRemoved) + 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() + } +} + +func (it *FeeQuoterFeeTokenRemovedIterator) Error() error { + return it.fail +} + +func (it *FeeQuoterFeeTokenRemovedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type FeeQuoterFeeTokenRemoved struct { + FeeToken common.Address + Raw types.Log +} + +func (_FeeQuoter *FeeQuoterFilterer) FilterFeeTokenRemoved(opts *bind.FilterOpts, feeToken []common.Address) (*FeeQuoterFeeTokenRemovedIterator, error) { + + var feeTokenRule []interface{} + for _, feeTokenItem := range feeToken { + feeTokenRule = append(feeTokenRule, feeTokenItem) + } + + logs, sub, err := _FeeQuoter.contract.FilterLogs(opts, "FeeTokenRemoved", feeTokenRule) + if err != nil { + return nil, err + } + return &FeeQuoterFeeTokenRemovedIterator{contract: _FeeQuoter.contract, event: "FeeTokenRemoved", logs: logs, sub: sub}, nil +} + +func (_FeeQuoter *FeeQuoterFilterer) WatchFeeTokenRemoved(opts *bind.WatchOpts, sink chan<- *FeeQuoterFeeTokenRemoved, feeToken []common.Address) (event.Subscription, error) { + + var feeTokenRule []interface{} + for _, feeTokenItem := range feeToken { + feeTokenRule = append(feeTokenRule, feeTokenItem) + } + + logs, sub, err := _FeeQuoter.contract.WatchLogs(opts, "FeeTokenRemoved", feeTokenRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(FeeQuoterFeeTokenRemoved) + if err := _FeeQuoter.contract.UnpackLog(event, "FeeTokenRemoved", 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 +} + +func (_FeeQuoter *FeeQuoterFilterer) ParseFeeTokenRemoved(log types.Log) (*FeeQuoterFeeTokenRemoved, error) { + event := new(FeeQuoterFeeTokenRemoved) + if err := _FeeQuoter.contract.UnpackLog(event, "FeeTokenRemoved", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type FeeQuoterOwnershipTransferRequestedIterator struct { + Event *FeeQuoterOwnershipTransferRequested + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *FeeQuoterOwnershipTransferRequestedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(FeeQuoterOwnershipTransferRequested) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(FeeQuoterOwnershipTransferRequested) + 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() + } +} + +func (it *FeeQuoterOwnershipTransferRequestedIterator) Error() error { + return it.fail +} + +func (it *FeeQuoterOwnershipTransferRequestedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type FeeQuoterOwnershipTransferRequested struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_FeeQuoter *FeeQuoterFilterer) FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*FeeQuoterOwnershipTransferRequestedIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _FeeQuoter.contract.FilterLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return &FeeQuoterOwnershipTransferRequestedIterator{contract: _FeeQuoter.contract, event: "OwnershipTransferRequested", logs: logs, sub: sub}, nil +} + +func (_FeeQuoter *FeeQuoterFilterer) WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *FeeQuoterOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _FeeQuoter.contract.WatchLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(FeeQuoterOwnershipTransferRequested) + if err := _FeeQuoter.contract.UnpackLog(event, "OwnershipTransferRequested", 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 +} + +func (_FeeQuoter *FeeQuoterFilterer) ParseOwnershipTransferRequested(log types.Log) (*FeeQuoterOwnershipTransferRequested, error) { + event := new(FeeQuoterOwnershipTransferRequested) + if err := _FeeQuoter.contract.UnpackLog(event, "OwnershipTransferRequested", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type FeeQuoterOwnershipTransferredIterator struct { + Event *FeeQuoterOwnershipTransferred + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *FeeQuoterOwnershipTransferredIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(FeeQuoterOwnershipTransferred) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(FeeQuoterOwnershipTransferred) + 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() + } +} + +func (it *FeeQuoterOwnershipTransferredIterator) Error() error { + return it.fail +} + +func (it *FeeQuoterOwnershipTransferredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type FeeQuoterOwnershipTransferred struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_FeeQuoter *FeeQuoterFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*FeeQuoterOwnershipTransferredIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _FeeQuoter.contract.FilterLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return &FeeQuoterOwnershipTransferredIterator{contract: _FeeQuoter.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil +} + +func (_FeeQuoter *FeeQuoterFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *FeeQuoterOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _FeeQuoter.contract.WatchLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(FeeQuoterOwnershipTransferred) + if err := _FeeQuoter.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 +} + +func (_FeeQuoter *FeeQuoterFilterer) ParseOwnershipTransferred(log types.Log) (*FeeQuoterOwnershipTransferred, error) { + event := new(FeeQuoterOwnershipTransferred) + if err := _FeeQuoter.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type FeeQuoterPremiumMultiplierWeiPerEthUpdatedIterator struct { + Event *FeeQuoterPremiumMultiplierWeiPerEthUpdated + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *FeeQuoterPremiumMultiplierWeiPerEthUpdatedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(FeeQuoterPremiumMultiplierWeiPerEthUpdated) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(FeeQuoterPremiumMultiplierWeiPerEthUpdated) + 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() + } +} + +func (it *FeeQuoterPremiumMultiplierWeiPerEthUpdatedIterator) Error() error { + return it.fail +} + +func (it *FeeQuoterPremiumMultiplierWeiPerEthUpdatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type FeeQuoterPremiumMultiplierWeiPerEthUpdated struct { + Token common.Address + PremiumMultiplierWeiPerEth uint64 + Raw types.Log +} + +func (_FeeQuoter *FeeQuoterFilterer) FilterPremiumMultiplierWeiPerEthUpdated(opts *bind.FilterOpts, token []common.Address) (*FeeQuoterPremiumMultiplierWeiPerEthUpdatedIterator, error) { + + var tokenRule []interface{} + for _, tokenItem := range token { + tokenRule = append(tokenRule, tokenItem) + } + + logs, sub, err := _FeeQuoter.contract.FilterLogs(opts, "PremiumMultiplierWeiPerEthUpdated", tokenRule) + if err != nil { + return nil, err + } + return &FeeQuoterPremiumMultiplierWeiPerEthUpdatedIterator{contract: _FeeQuoter.contract, event: "PremiumMultiplierWeiPerEthUpdated", logs: logs, sub: sub}, nil +} + +func (_FeeQuoter *FeeQuoterFilterer) WatchPremiumMultiplierWeiPerEthUpdated(opts *bind.WatchOpts, sink chan<- *FeeQuoterPremiumMultiplierWeiPerEthUpdated, token []common.Address) (event.Subscription, error) { + + var tokenRule []interface{} + for _, tokenItem := range token { + tokenRule = append(tokenRule, tokenItem) + } + + logs, sub, err := _FeeQuoter.contract.WatchLogs(opts, "PremiumMultiplierWeiPerEthUpdated", tokenRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(FeeQuoterPremiumMultiplierWeiPerEthUpdated) + if err := _FeeQuoter.contract.UnpackLog(event, "PremiumMultiplierWeiPerEthUpdated", 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 +} + +func (_FeeQuoter *FeeQuoterFilterer) ParsePremiumMultiplierWeiPerEthUpdated(log types.Log) (*FeeQuoterPremiumMultiplierWeiPerEthUpdated, error) { + event := new(FeeQuoterPremiumMultiplierWeiPerEthUpdated) + if err := _FeeQuoter.contract.UnpackLog(event, "PremiumMultiplierWeiPerEthUpdated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type FeeQuoterPriceFeedPerTokenUpdatedIterator struct { + Event *FeeQuoterPriceFeedPerTokenUpdated + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *FeeQuoterPriceFeedPerTokenUpdatedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(FeeQuoterPriceFeedPerTokenUpdated) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(FeeQuoterPriceFeedPerTokenUpdated) + 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() + } +} + +func (it *FeeQuoterPriceFeedPerTokenUpdatedIterator) Error() error { + return it.fail +} + +func (it *FeeQuoterPriceFeedPerTokenUpdatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type FeeQuoterPriceFeedPerTokenUpdated struct { + Token common.Address + PriceFeedConfig IFeeQuoterTokenPriceFeedConfig + Raw types.Log +} + +func (_FeeQuoter *FeeQuoterFilterer) FilterPriceFeedPerTokenUpdated(opts *bind.FilterOpts, token []common.Address) (*FeeQuoterPriceFeedPerTokenUpdatedIterator, error) { + + var tokenRule []interface{} + for _, tokenItem := range token { + tokenRule = append(tokenRule, tokenItem) + } + + logs, sub, err := _FeeQuoter.contract.FilterLogs(opts, "PriceFeedPerTokenUpdated", tokenRule) + if err != nil { + return nil, err + } + return &FeeQuoterPriceFeedPerTokenUpdatedIterator{contract: _FeeQuoter.contract, event: "PriceFeedPerTokenUpdated", logs: logs, sub: sub}, nil +} + +func (_FeeQuoter *FeeQuoterFilterer) WatchPriceFeedPerTokenUpdated(opts *bind.WatchOpts, sink chan<- *FeeQuoterPriceFeedPerTokenUpdated, token []common.Address) (event.Subscription, error) { + + var tokenRule []interface{} + for _, tokenItem := range token { + tokenRule = append(tokenRule, tokenItem) + } + + logs, sub, err := _FeeQuoter.contract.WatchLogs(opts, "PriceFeedPerTokenUpdated", tokenRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(FeeQuoterPriceFeedPerTokenUpdated) + if err := _FeeQuoter.contract.UnpackLog(event, "PriceFeedPerTokenUpdated", 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 +} + +func (_FeeQuoter *FeeQuoterFilterer) ParsePriceFeedPerTokenUpdated(log types.Log) (*FeeQuoterPriceFeedPerTokenUpdated, error) { + event := new(FeeQuoterPriceFeedPerTokenUpdated) + if err := _FeeQuoter.contract.UnpackLog(event, "PriceFeedPerTokenUpdated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type FeeQuoterReportPermissionSetIterator struct { + Event *FeeQuoterReportPermissionSet + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *FeeQuoterReportPermissionSetIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(FeeQuoterReportPermissionSet) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(FeeQuoterReportPermissionSet) + 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() + } +} + +func (it *FeeQuoterReportPermissionSetIterator) Error() error { + return it.fail +} + +func (it *FeeQuoterReportPermissionSetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type FeeQuoterReportPermissionSet struct { + ReportId [32]byte + Permission KeystoneFeedsPermissionHandlerPermission + Raw types.Log +} + +func (_FeeQuoter *FeeQuoterFilterer) FilterReportPermissionSet(opts *bind.FilterOpts, reportId [][32]byte) (*FeeQuoterReportPermissionSetIterator, error) { + + var reportIdRule []interface{} + for _, reportIdItem := range reportId { + reportIdRule = append(reportIdRule, reportIdItem) + } + + logs, sub, err := _FeeQuoter.contract.FilterLogs(opts, "ReportPermissionSet", reportIdRule) + if err != nil { + return nil, err + } + return &FeeQuoterReportPermissionSetIterator{contract: _FeeQuoter.contract, event: "ReportPermissionSet", logs: logs, sub: sub}, nil +} + +func (_FeeQuoter *FeeQuoterFilterer) WatchReportPermissionSet(opts *bind.WatchOpts, sink chan<- *FeeQuoterReportPermissionSet, reportId [][32]byte) (event.Subscription, error) { + + var reportIdRule []interface{} + for _, reportIdItem := range reportId { + reportIdRule = append(reportIdRule, reportIdItem) + } + + logs, sub, err := _FeeQuoter.contract.WatchLogs(opts, "ReportPermissionSet", reportIdRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(FeeQuoterReportPermissionSet) + if err := _FeeQuoter.contract.UnpackLog(event, "ReportPermissionSet", 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 +} + +func (_FeeQuoter *FeeQuoterFilterer) ParseReportPermissionSet(log types.Log) (*FeeQuoterReportPermissionSet, error) { + event := new(FeeQuoterReportPermissionSet) + if err := _FeeQuoter.contract.UnpackLog(event, "ReportPermissionSet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type FeeQuoterTokenTransferFeeConfigDeletedIterator struct { + Event *FeeQuoterTokenTransferFeeConfigDeleted + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *FeeQuoterTokenTransferFeeConfigDeletedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(FeeQuoterTokenTransferFeeConfigDeleted) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(FeeQuoterTokenTransferFeeConfigDeleted) + 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() + } +} + +func (it *FeeQuoterTokenTransferFeeConfigDeletedIterator) Error() error { + return it.fail +} + +func (it *FeeQuoterTokenTransferFeeConfigDeletedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type FeeQuoterTokenTransferFeeConfigDeleted struct { + DestChainSelector uint64 + Token common.Address + Raw types.Log +} + +func (_FeeQuoter *FeeQuoterFilterer) FilterTokenTransferFeeConfigDeleted(opts *bind.FilterOpts, destChainSelector []uint64, token []common.Address) (*FeeQuoterTokenTransferFeeConfigDeletedIterator, error) { + + var destChainSelectorRule []interface{} + for _, destChainSelectorItem := range destChainSelector { + destChainSelectorRule = append(destChainSelectorRule, destChainSelectorItem) + } + var tokenRule []interface{} + for _, tokenItem := range token { + tokenRule = append(tokenRule, tokenItem) + } + + logs, sub, err := _FeeQuoter.contract.FilterLogs(opts, "TokenTransferFeeConfigDeleted", destChainSelectorRule, tokenRule) + if err != nil { + return nil, err + } + return &FeeQuoterTokenTransferFeeConfigDeletedIterator{contract: _FeeQuoter.contract, event: "TokenTransferFeeConfigDeleted", logs: logs, sub: sub}, nil +} + +func (_FeeQuoter *FeeQuoterFilterer) WatchTokenTransferFeeConfigDeleted(opts *bind.WatchOpts, sink chan<- *FeeQuoterTokenTransferFeeConfigDeleted, destChainSelector []uint64, token []common.Address) (event.Subscription, error) { + + var destChainSelectorRule []interface{} + for _, destChainSelectorItem := range destChainSelector { + destChainSelectorRule = append(destChainSelectorRule, destChainSelectorItem) + } + var tokenRule []interface{} + for _, tokenItem := range token { + tokenRule = append(tokenRule, tokenItem) + } + + logs, sub, err := _FeeQuoter.contract.WatchLogs(opts, "TokenTransferFeeConfigDeleted", destChainSelectorRule, tokenRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(FeeQuoterTokenTransferFeeConfigDeleted) + if err := _FeeQuoter.contract.UnpackLog(event, "TokenTransferFeeConfigDeleted", 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 +} + +func (_FeeQuoter *FeeQuoterFilterer) ParseTokenTransferFeeConfigDeleted(log types.Log) (*FeeQuoterTokenTransferFeeConfigDeleted, error) { + event := new(FeeQuoterTokenTransferFeeConfigDeleted) + if err := _FeeQuoter.contract.UnpackLog(event, "TokenTransferFeeConfigDeleted", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type FeeQuoterTokenTransferFeeConfigUpdatedIterator struct { + Event *FeeQuoterTokenTransferFeeConfigUpdated + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *FeeQuoterTokenTransferFeeConfigUpdatedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(FeeQuoterTokenTransferFeeConfigUpdated) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(FeeQuoterTokenTransferFeeConfigUpdated) + 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() + } +} + +func (it *FeeQuoterTokenTransferFeeConfigUpdatedIterator) Error() error { + return it.fail +} + +func (it *FeeQuoterTokenTransferFeeConfigUpdatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type FeeQuoterTokenTransferFeeConfigUpdated struct { + DestChainSelector uint64 + Token common.Address + TokenTransferFeeConfig FeeQuoterTokenTransferFeeConfig + Raw types.Log +} + +func (_FeeQuoter *FeeQuoterFilterer) FilterTokenTransferFeeConfigUpdated(opts *bind.FilterOpts, destChainSelector []uint64, token []common.Address) (*FeeQuoterTokenTransferFeeConfigUpdatedIterator, error) { + + var destChainSelectorRule []interface{} + for _, destChainSelectorItem := range destChainSelector { + destChainSelectorRule = append(destChainSelectorRule, destChainSelectorItem) + } + var tokenRule []interface{} + for _, tokenItem := range token { + tokenRule = append(tokenRule, tokenItem) + } + + logs, sub, err := _FeeQuoter.contract.FilterLogs(opts, "TokenTransferFeeConfigUpdated", destChainSelectorRule, tokenRule) + if err != nil { + return nil, err + } + return &FeeQuoterTokenTransferFeeConfigUpdatedIterator{contract: _FeeQuoter.contract, event: "TokenTransferFeeConfigUpdated", logs: logs, sub: sub}, nil +} + +func (_FeeQuoter *FeeQuoterFilterer) WatchTokenTransferFeeConfigUpdated(opts *bind.WatchOpts, sink chan<- *FeeQuoterTokenTransferFeeConfigUpdated, destChainSelector []uint64, token []common.Address) (event.Subscription, error) { + + var destChainSelectorRule []interface{} + for _, destChainSelectorItem := range destChainSelector { + destChainSelectorRule = append(destChainSelectorRule, destChainSelectorItem) + } + var tokenRule []interface{} + for _, tokenItem := range token { + tokenRule = append(tokenRule, tokenItem) + } + + logs, sub, err := _FeeQuoter.contract.WatchLogs(opts, "TokenTransferFeeConfigUpdated", destChainSelectorRule, tokenRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(FeeQuoterTokenTransferFeeConfigUpdated) + if err := _FeeQuoter.contract.UnpackLog(event, "TokenTransferFeeConfigUpdated", 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 +} + +func (_FeeQuoter *FeeQuoterFilterer) ParseTokenTransferFeeConfigUpdated(log types.Log) (*FeeQuoterTokenTransferFeeConfigUpdated, error) { + event := new(FeeQuoterTokenTransferFeeConfigUpdated) + if err := _FeeQuoter.contract.UnpackLog(event, "TokenTransferFeeConfigUpdated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type FeeQuoterUsdPerTokenUpdatedIterator struct { + Event *FeeQuoterUsdPerTokenUpdated + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *FeeQuoterUsdPerTokenUpdatedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(FeeQuoterUsdPerTokenUpdated) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(FeeQuoterUsdPerTokenUpdated) + 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() + } +} + +func (it *FeeQuoterUsdPerTokenUpdatedIterator) Error() error { + return it.fail +} + +func (it *FeeQuoterUsdPerTokenUpdatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type FeeQuoterUsdPerTokenUpdated struct { + Token common.Address + Value *big.Int + Timestamp *big.Int + Raw types.Log +} + +func (_FeeQuoter *FeeQuoterFilterer) FilterUsdPerTokenUpdated(opts *bind.FilterOpts, token []common.Address) (*FeeQuoterUsdPerTokenUpdatedIterator, error) { + + var tokenRule []interface{} + for _, tokenItem := range token { + tokenRule = append(tokenRule, tokenItem) + } + + logs, sub, err := _FeeQuoter.contract.FilterLogs(opts, "UsdPerTokenUpdated", tokenRule) + if err != nil { + return nil, err + } + return &FeeQuoterUsdPerTokenUpdatedIterator{contract: _FeeQuoter.contract, event: "UsdPerTokenUpdated", logs: logs, sub: sub}, nil +} + +func (_FeeQuoter *FeeQuoterFilterer) WatchUsdPerTokenUpdated(opts *bind.WatchOpts, sink chan<- *FeeQuoterUsdPerTokenUpdated, token []common.Address) (event.Subscription, error) { + + var tokenRule []interface{} + for _, tokenItem := range token { + tokenRule = append(tokenRule, tokenItem) + } + + logs, sub, err := _FeeQuoter.contract.WatchLogs(opts, "UsdPerTokenUpdated", tokenRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(FeeQuoterUsdPerTokenUpdated) + if err := _FeeQuoter.contract.UnpackLog(event, "UsdPerTokenUpdated", 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 +} + +func (_FeeQuoter *FeeQuoterFilterer) ParseUsdPerTokenUpdated(log types.Log) (*FeeQuoterUsdPerTokenUpdated, error) { + event := new(FeeQuoterUsdPerTokenUpdated) + if err := _FeeQuoter.contract.UnpackLog(event, "UsdPerTokenUpdated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type FeeQuoterUsdPerUnitGasUpdatedIterator struct { + Event *FeeQuoterUsdPerUnitGasUpdated + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *FeeQuoterUsdPerUnitGasUpdatedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(FeeQuoterUsdPerUnitGasUpdated) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(FeeQuoterUsdPerUnitGasUpdated) + 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() + } +} + +func (it *FeeQuoterUsdPerUnitGasUpdatedIterator) Error() error { + return it.fail +} + +func (it *FeeQuoterUsdPerUnitGasUpdatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type FeeQuoterUsdPerUnitGasUpdated struct { + DestChain uint64 + Value *big.Int + Timestamp *big.Int + Raw types.Log +} + +func (_FeeQuoter *FeeQuoterFilterer) FilterUsdPerUnitGasUpdated(opts *bind.FilterOpts, destChain []uint64) (*FeeQuoterUsdPerUnitGasUpdatedIterator, error) { + + var destChainRule []interface{} + for _, destChainItem := range destChain { + destChainRule = append(destChainRule, destChainItem) + } + + logs, sub, err := _FeeQuoter.contract.FilterLogs(opts, "UsdPerUnitGasUpdated", destChainRule) + if err != nil { + return nil, err + } + return &FeeQuoterUsdPerUnitGasUpdatedIterator{contract: _FeeQuoter.contract, event: "UsdPerUnitGasUpdated", logs: logs, sub: sub}, nil +} + +func (_FeeQuoter *FeeQuoterFilterer) WatchUsdPerUnitGasUpdated(opts *bind.WatchOpts, sink chan<- *FeeQuoterUsdPerUnitGasUpdated, destChain []uint64) (event.Subscription, error) { + + var destChainRule []interface{} + for _, destChainItem := range destChain { + destChainRule = append(destChainRule, destChainItem) + } + + logs, sub, err := _FeeQuoter.contract.WatchLogs(opts, "UsdPerUnitGasUpdated", destChainRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(FeeQuoterUsdPerUnitGasUpdated) + if err := _FeeQuoter.contract.UnpackLog(event, "UsdPerUnitGasUpdated", 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 +} + +func (_FeeQuoter *FeeQuoterFilterer) ParseUsdPerUnitGasUpdated(log types.Log) (*FeeQuoterUsdPerUnitGasUpdated, error) { + event := new(FeeQuoterUsdPerUnitGasUpdated) + if err := _FeeQuoter.contract.UnpackLog(event, "UsdPerUnitGasUpdated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type GetTokenAndGasPrices struct { + TokenPrice *big.Int + GasPriceValue *big.Int +} +type ProcessMessageArgs struct { + MsgFeeJuels *big.Int + IsOutOfOrderExecution bool + ConvertedExtraArgs []byte +} + +func (_FeeQuoter *FeeQuoter) ParseLog(log types.Log) (generated.AbigenLog, error) { + switch log.Topics[0] { + case _FeeQuoter.abi.Events["AuthorizedCallerAdded"].ID: + return _FeeQuoter.ParseAuthorizedCallerAdded(log) + case _FeeQuoter.abi.Events["AuthorizedCallerRemoved"].ID: + return _FeeQuoter.ParseAuthorizedCallerRemoved(log) + case _FeeQuoter.abi.Events["DestChainAdded"].ID: + return _FeeQuoter.ParseDestChainAdded(log) + case _FeeQuoter.abi.Events["DestChainConfigUpdated"].ID: + return _FeeQuoter.ParseDestChainConfigUpdated(log) + case _FeeQuoter.abi.Events["FeeTokenAdded"].ID: + return _FeeQuoter.ParseFeeTokenAdded(log) + case _FeeQuoter.abi.Events["FeeTokenRemoved"].ID: + return _FeeQuoter.ParseFeeTokenRemoved(log) + case _FeeQuoter.abi.Events["OwnershipTransferRequested"].ID: + return _FeeQuoter.ParseOwnershipTransferRequested(log) + case _FeeQuoter.abi.Events["OwnershipTransferred"].ID: + return _FeeQuoter.ParseOwnershipTransferred(log) + case _FeeQuoter.abi.Events["PremiumMultiplierWeiPerEthUpdated"].ID: + return _FeeQuoter.ParsePremiumMultiplierWeiPerEthUpdated(log) + case _FeeQuoter.abi.Events["PriceFeedPerTokenUpdated"].ID: + return _FeeQuoter.ParsePriceFeedPerTokenUpdated(log) + case _FeeQuoter.abi.Events["ReportPermissionSet"].ID: + return _FeeQuoter.ParseReportPermissionSet(log) + case _FeeQuoter.abi.Events["TokenTransferFeeConfigDeleted"].ID: + return _FeeQuoter.ParseTokenTransferFeeConfigDeleted(log) + case _FeeQuoter.abi.Events["TokenTransferFeeConfigUpdated"].ID: + return _FeeQuoter.ParseTokenTransferFeeConfigUpdated(log) + case _FeeQuoter.abi.Events["UsdPerTokenUpdated"].ID: + return _FeeQuoter.ParseUsdPerTokenUpdated(log) + case _FeeQuoter.abi.Events["UsdPerUnitGasUpdated"].ID: + return _FeeQuoter.ParseUsdPerUnitGasUpdated(log) + + default: + return nil, fmt.Errorf("abigen wrapper received unknown log topic: %v", log.Topics[0]) + } +} + +func (FeeQuoterAuthorizedCallerAdded) Topic() common.Hash { + return common.HexToHash("0xeb1b9b92e50b7f88f9ff25d56765095ac6e91540eee214906f4036a908ffbdef") +} + +func (FeeQuoterAuthorizedCallerRemoved) Topic() common.Hash { + return common.HexToHash("0xc3803387881faad271c47728894e3e36fac830ffc8602ca6fc07733cbda77580") +} + +func (FeeQuoterDestChainAdded) Topic() common.Hash { + return common.HexToHash("0xd31c671936387b2f84ed402b553bd50c0e9c20408ea4e91a836d77b8180fb724") +} + +func (FeeQuoterDestChainConfigUpdated) Topic() common.Hash { + return common.HexToHash("0x1edd6f3553cfa16f10b95b195abae3a1cfca4783de4843f95d674b1e1df5ab20") +} + +func (FeeQuoterFeeTokenAdded) Topic() common.Hash { + return common.HexToHash("0xdf1b1bd32a69711488d71554706bb130b1fc63a5fa1a2cd85e8440f84065ba23") +} + +func (FeeQuoterFeeTokenRemoved) Topic() common.Hash { + return common.HexToHash("0x1795838dc8ab2ffc5f431a1729a6afa0b587f982f7b2be0b9d7187a1ef547f91") +} + +func (FeeQuoterOwnershipTransferRequested) Topic() common.Hash { + return common.HexToHash("0xed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae1278") +} + +func (FeeQuoterOwnershipTransferred) Topic() common.Hash { + return common.HexToHash("0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0") +} + +func (FeeQuoterPremiumMultiplierWeiPerEthUpdated) Topic() common.Hash { + return common.HexToHash("0xbb77da6f7210cdd16904228a9360133d1d7dfff99b1bc75f128da5b53e28f97d") +} + +func (FeeQuoterPriceFeedPerTokenUpdated) Topic() common.Hash { + return common.HexToHash("0x08a5f7f5bb38a81d8e43aca13ecd76431dbf8816ae4699affff7b00b2fc1c464") +} + +func (FeeQuoterReportPermissionSet) Topic() common.Hash { + return common.HexToHash("0x32a4ba3fa3351b11ad555d4c8ec70a744e8705607077a946807030d64b6ab1a3") +} + +func (FeeQuoterTokenTransferFeeConfigDeleted) Topic() common.Hash { + return common.HexToHash("0x4de5b1bcbca6018c11303a2c3f4a4b4f22a1c741d8c4ba430d246ac06c5ddf8b") +} + +func (FeeQuoterTokenTransferFeeConfigUpdated) Topic() common.Hash { + return common.HexToHash("0x94967ae9ea7729ad4f54021c1981765d2b1d954f7c92fbec340aa0a54f46b8b5") +} + +func (FeeQuoterUsdPerTokenUpdated) Topic() common.Hash { + return common.HexToHash("0x52f50aa6d1a95a4595361ecf953d095f125d442e4673716dede699e049de148a") +} + +func (FeeQuoterUsdPerUnitGasUpdated) Topic() common.Hash { + return common.HexToHash("0xdd84a3fa9ef9409f550d54d6affec7e9c480c878c6ab27b78912a03e1b371c6e") +} + +func (_FeeQuoter *FeeQuoter) Address() common.Address { + return _FeeQuoter.address +} + +type FeeQuoterInterface interface { + ConvertTokenAmount(opts *bind.CallOpts, fromToken common.Address, fromTokenAmount *big.Int, toToken common.Address) (*big.Int, error) + + GetAllAuthorizedCallers(opts *bind.CallOpts) ([]common.Address, error) + + GetDestChainConfig(opts *bind.CallOpts, destChainSelector uint64) (FeeQuoterDestChainConfig, error) + + GetDestinationChainGasPrice(opts *bind.CallOpts, destChainSelector uint64) (InternalTimestampedPackedUint224, error) + + GetFeeTokens(opts *bind.CallOpts) ([]common.Address, error) + + GetPremiumMultiplierWeiPerEth(opts *bind.CallOpts, token common.Address) (uint64, error) + + GetStaticConfig(opts *bind.CallOpts) (FeeQuoterStaticConfig, error) + + GetTokenAndGasPrices(opts *bind.CallOpts, token common.Address, destChainSelector uint64) (GetTokenAndGasPrices, + + error) + + GetTokenPrice(opts *bind.CallOpts, token common.Address) (InternalTimestampedPackedUint224, error) + + GetTokenPriceFeedConfig(opts *bind.CallOpts, token common.Address) (IFeeQuoterTokenPriceFeedConfig, error) + + GetTokenPrices(opts *bind.CallOpts, tokens []common.Address) ([]InternalTimestampedPackedUint224, error) + + GetTokenTransferFeeConfig(opts *bind.CallOpts, destChainSelector uint64, token common.Address) (FeeQuoterTokenTransferFeeConfig, error) + + GetValidatedFee(opts *bind.CallOpts, destChainSelector uint64, message ClientEVM2AnyMessage) (*big.Int, error) + + GetValidatedTokenPrice(opts *bind.CallOpts, token common.Address) (*big.Int, error) + + Owner(opts *bind.CallOpts) (common.Address, error) + + ProcessMessageArgs(opts *bind.CallOpts, destChainSelector uint64, feeToken common.Address, feeTokenAmount *big.Int, extraArgs []byte) (ProcessMessageArgs, + + error) + + ProcessPoolReturnData(opts *bind.CallOpts, destChainSelector uint64, rampTokenAmounts []InternalRampTokenAmount, sourceTokenAmounts []ClientEVMTokenAmount) ([][]byte, error) + + TypeAndVersion(opts *bind.CallOpts) (string, error) + + AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) + + ApplyAuthorizedCallerUpdates(opts *bind.TransactOpts, authorizedCallerArgs AuthorizedCallersAuthorizedCallerArgs) (*types.Transaction, error) + + ApplyDestChainConfigUpdates(opts *bind.TransactOpts, destChainConfigArgs []FeeQuoterDestChainConfigArgs) (*types.Transaction, error) + + ApplyFeeTokensUpdates(opts *bind.TransactOpts, feeTokensToAdd []common.Address, feeTokensToRemove []common.Address) (*types.Transaction, error) + + ApplyPremiumMultiplierWeiPerEthUpdates(opts *bind.TransactOpts, premiumMultiplierWeiPerEthArgs []FeeQuoterPremiumMultiplierWeiPerEthArgs) (*types.Transaction, error) + + ApplyTokenTransferFeeConfigUpdates(opts *bind.TransactOpts, tokenTransferFeeConfigArgs []FeeQuoterTokenTransferFeeConfigArgs, tokensToUseDefaultFeeConfigs []FeeQuoterTokenTransferFeeConfigRemoveArgs) (*types.Transaction, error) + + OnReport(opts *bind.TransactOpts, metadata []byte, report []byte) (*types.Transaction, error) + + SetReportPermissions(opts *bind.TransactOpts, permissions []KeystoneFeedsPermissionHandlerPermission) (*types.Transaction, error) + + TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) + + UpdatePrices(opts *bind.TransactOpts, priceUpdates InternalPriceUpdates) (*types.Transaction, error) + + UpdateTokenPriceFeeds(opts *bind.TransactOpts, tokenPriceFeedUpdates []FeeQuoterTokenPriceFeedUpdate) (*types.Transaction, error) + + FilterAuthorizedCallerAdded(opts *bind.FilterOpts) (*FeeQuoterAuthorizedCallerAddedIterator, error) + + WatchAuthorizedCallerAdded(opts *bind.WatchOpts, sink chan<- *FeeQuoterAuthorizedCallerAdded) (event.Subscription, error) + + ParseAuthorizedCallerAdded(log types.Log) (*FeeQuoterAuthorizedCallerAdded, error) + + FilterAuthorizedCallerRemoved(opts *bind.FilterOpts) (*FeeQuoterAuthorizedCallerRemovedIterator, error) + + WatchAuthorizedCallerRemoved(opts *bind.WatchOpts, sink chan<- *FeeQuoterAuthorizedCallerRemoved) (event.Subscription, error) + + ParseAuthorizedCallerRemoved(log types.Log) (*FeeQuoterAuthorizedCallerRemoved, error) + + FilterDestChainAdded(opts *bind.FilterOpts, destChainSelector []uint64) (*FeeQuoterDestChainAddedIterator, error) + + WatchDestChainAdded(opts *bind.WatchOpts, sink chan<- *FeeQuoterDestChainAdded, destChainSelector []uint64) (event.Subscription, error) + + ParseDestChainAdded(log types.Log) (*FeeQuoterDestChainAdded, error) + + FilterDestChainConfigUpdated(opts *bind.FilterOpts, destChainSelector []uint64) (*FeeQuoterDestChainConfigUpdatedIterator, error) + + WatchDestChainConfigUpdated(opts *bind.WatchOpts, sink chan<- *FeeQuoterDestChainConfigUpdated, destChainSelector []uint64) (event.Subscription, error) + + ParseDestChainConfigUpdated(log types.Log) (*FeeQuoterDestChainConfigUpdated, error) + + FilterFeeTokenAdded(opts *bind.FilterOpts, feeToken []common.Address) (*FeeQuoterFeeTokenAddedIterator, error) + + WatchFeeTokenAdded(opts *bind.WatchOpts, sink chan<- *FeeQuoterFeeTokenAdded, feeToken []common.Address) (event.Subscription, error) + + ParseFeeTokenAdded(log types.Log) (*FeeQuoterFeeTokenAdded, error) + + FilterFeeTokenRemoved(opts *bind.FilterOpts, feeToken []common.Address) (*FeeQuoterFeeTokenRemovedIterator, error) + + WatchFeeTokenRemoved(opts *bind.WatchOpts, sink chan<- *FeeQuoterFeeTokenRemoved, feeToken []common.Address) (event.Subscription, error) + + ParseFeeTokenRemoved(log types.Log) (*FeeQuoterFeeTokenRemoved, error) + + FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*FeeQuoterOwnershipTransferRequestedIterator, error) + + WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *FeeQuoterOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferRequested(log types.Log) (*FeeQuoterOwnershipTransferRequested, error) + + FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*FeeQuoterOwnershipTransferredIterator, error) + + WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *FeeQuoterOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferred(log types.Log) (*FeeQuoterOwnershipTransferred, error) + + FilterPremiumMultiplierWeiPerEthUpdated(opts *bind.FilterOpts, token []common.Address) (*FeeQuoterPremiumMultiplierWeiPerEthUpdatedIterator, error) + + WatchPremiumMultiplierWeiPerEthUpdated(opts *bind.WatchOpts, sink chan<- *FeeQuoterPremiumMultiplierWeiPerEthUpdated, token []common.Address) (event.Subscription, error) + + ParsePremiumMultiplierWeiPerEthUpdated(log types.Log) (*FeeQuoterPremiumMultiplierWeiPerEthUpdated, error) + + FilterPriceFeedPerTokenUpdated(opts *bind.FilterOpts, token []common.Address) (*FeeQuoterPriceFeedPerTokenUpdatedIterator, error) + + WatchPriceFeedPerTokenUpdated(opts *bind.WatchOpts, sink chan<- *FeeQuoterPriceFeedPerTokenUpdated, token []common.Address) (event.Subscription, error) + + ParsePriceFeedPerTokenUpdated(log types.Log) (*FeeQuoterPriceFeedPerTokenUpdated, error) + + FilterReportPermissionSet(opts *bind.FilterOpts, reportId [][32]byte) (*FeeQuoterReportPermissionSetIterator, error) + + WatchReportPermissionSet(opts *bind.WatchOpts, sink chan<- *FeeQuoterReportPermissionSet, reportId [][32]byte) (event.Subscription, error) + + ParseReportPermissionSet(log types.Log) (*FeeQuoterReportPermissionSet, error) + + FilterTokenTransferFeeConfigDeleted(opts *bind.FilterOpts, destChainSelector []uint64, token []common.Address) (*FeeQuoterTokenTransferFeeConfigDeletedIterator, error) + + WatchTokenTransferFeeConfigDeleted(opts *bind.WatchOpts, sink chan<- *FeeQuoterTokenTransferFeeConfigDeleted, destChainSelector []uint64, token []common.Address) (event.Subscription, error) + + ParseTokenTransferFeeConfigDeleted(log types.Log) (*FeeQuoterTokenTransferFeeConfigDeleted, error) + + FilterTokenTransferFeeConfigUpdated(opts *bind.FilterOpts, destChainSelector []uint64, token []common.Address) (*FeeQuoterTokenTransferFeeConfigUpdatedIterator, error) + + WatchTokenTransferFeeConfigUpdated(opts *bind.WatchOpts, sink chan<- *FeeQuoterTokenTransferFeeConfigUpdated, destChainSelector []uint64, token []common.Address) (event.Subscription, error) + + ParseTokenTransferFeeConfigUpdated(log types.Log) (*FeeQuoterTokenTransferFeeConfigUpdated, error) + + FilterUsdPerTokenUpdated(opts *bind.FilterOpts, token []common.Address) (*FeeQuoterUsdPerTokenUpdatedIterator, error) + + WatchUsdPerTokenUpdated(opts *bind.WatchOpts, sink chan<- *FeeQuoterUsdPerTokenUpdated, token []common.Address) (event.Subscription, error) + + ParseUsdPerTokenUpdated(log types.Log) (*FeeQuoterUsdPerTokenUpdated, error) + + FilterUsdPerUnitGasUpdated(opts *bind.FilterOpts, destChain []uint64) (*FeeQuoterUsdPerUnitGasUpdatedIterator, error) + + WatchUsdPerUnitGasUpdated(opts *bind.WatchOpts, sink chan<- *FeeQuoterUsdPerUnitGasUpdated, destChain []uint64) (event.Subscription, error) + + ParseUsdPerUnitGasUpdated(log types.Log) (*FeeQuoterUsdPerUnitGasUpdated, error) + + ParseLog(log types.Log) (generated.AbigenLog, error) + + Address() common.Address +} diff --git a/core/gethwrappers/ccip/generated/lock_release_token_pool/lock_release_token_pool.go b/core/gethwrappers/ccip/generated/lock_release_token_pool/lock_release_token_pool.go new file mode 100644 index 00000000000..275f9c7a389 --- /dev/null +++ b/core/gethwrappers/ccip/generated/lock_release_token_pool/lock_release_token_pool.go @@ -0,0 +1,3358 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package lock_release_token_pool + +import ( + "errors" + "fmt" + "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" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" +) + +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +type PoolLockOrBurnInV1 struct { + Receiver []byte + RemoteChainSelector uint64 + OriginalSender common.Address + Amount *big.Int + LocalToken common.Address +} + +type PoolLockOrBurnOutV1 struct { + DestTokenAddress []byte + DestPoolData []byte +} + +type PoolReleaseOrMintInV1 struct { + OriginalSender []byte + RemoteChainSelector uint64 + Receiver common.Address + Amount *big.Int + LocalToken common.Address + SourcePoolAddress []byte + SourcePoolData []byte + OffchainTokenData []byte +} + +type PoolReleaseOrMintOutV1 struct { + DestinationAmount *big.Int +} + +type RateLimiterConfig struct { + IsEnabled bool + Capacity *big.Int + Rate *big.Int +} + +type RateLimiterTokenBucket struct { + Tokens *big.Int + LastUpdated uint32 + IsEnabled bool + Capacity *big.Int + Rate *big.Int +} + +type TokenPoolChainUpdate struct { + RemoteChainSelector uint64 + Allowed bool + RemotePoolAddress []byte + RemoteTokenAddress []byte + OutboundRateLimiterConfig RateLimiterConfig + InboundRateLimiterConfig RateLimiterConfig +} + +var LockReleaseTokenPoolMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"internalType\":\"contractIERC20\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"allowlist\",\"type\":\"address[]\"},{\"internalType\":\"address\",\"name\":\"rmnProxy\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"acceptLiquidity\",\"type\":\"bool\"},{\"internalType\":\"address\",\"name\":\"router\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"capacity\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"requested\",\"type\":\"uint256\"}],\"name\":\"AggregateValueMaxCapacityExceeded\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"minWaitInSeconds\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"available\",\"type\":\"uint256\"}],\"name\":\"AggregateValueRateLimitReached\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"AllowListNotEnabled\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"BucketOverfilled\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"}],\"name\":\"CallerIsNotARampOnRouter\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"}],\"name\":\"ChainAlreadyExists\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"ChainNotAllowed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"CursedByRMN\",\"type\":\"error\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"config\",\"type\":\"tuple\"}],\"name\":\"DisabledNonZeroRateLimit\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InsufficientLiquidity\",\"type\":\"error\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"rateLimiterConfig\",\"type\":\"tuple\"}],\"name\":\"InvalidRateLimitRate\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"sourcePoolAddress\",\"type\":\"bytes\"}],\"name\":\"InvalidSourcePoolAddress\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"InvalidToken\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"LiquidityNotAccepted\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"NonExistentChain\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RateLimitMustBeDisabled\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"SenderNotAllowed\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"capacity\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"requested\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"}],\"name\":\"TokenMaxCapacityExceeded\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"minWaitInSeconds\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"available\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"}],\"name\":\"TokenRateLimitReached\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"}],\"name\":\"Unauthorized\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddressNotAllowed\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"AllowListAdd\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"AllowListRemove\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Burned\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"remoteToken\",\"type\":\"bytes\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"indexed\":false,\"internalType\":\"structRateLimiter.Config\",\"name\":\"outboundRateLimiterConfig\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"indexed\":false,\"internalType\":\"structRateLimiter.Config\",\"name\":\"inboundRateLimiterConfig\",\"type\":\"tuple\"}],\"name\":\"ChainAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"indexed\":false,\"internalType\":\"structRateLimiter.Config\",\"name\":\"outboundRateLimiterConfig\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"indexed\":false,\"internalType\":\"structRateLimiter.Config\",\"name\":\"inboundRateLimiterConfig\",\"type\":\"tuple\"}],\"name\":\"ChainConfigured\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"ChainRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"indexed\":false,\"internalType\":\"structRateLimiter.Config\",\"name\":\"config\",\"type\":\"tuple\"}],\"name\":\"ConfigChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"provider\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"LiquidityAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"provider\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"LiquidityRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"LiquidityTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Locked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Minted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Released\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"previousPoolAddress\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"remotePoolAddress\",\"type\":\"bytes\"}],\"name\":\"RemotePoolSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"oldRouter\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newRouter\",\"type\":\"address\"}],\"name\":\"RouterUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"}],\"name\":\"TokensConsumed\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"removes\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"adds\",\"type\":\"address[]\"}],\"name\":\"applyAllowListUpdates\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"bool\",\"name\":\"allowed\",\"type\":\"bool\"},{\"internalType\":\"bytes\",\"name\":\"remotePoolAddress\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"remoteTokenAddress\",\"type\":\"bytes\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"outboundRateLimiterConfig\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"inboundRateLimiterConfig\",\"type\":\"tuple\"}],\"internalType\":\"structTokenPool.ChainUpdate[]\",\"name\":\"chains\",\"type\":\"tuple[]\"}],\"name\":\"applyChainUpdates\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"canAcceptLiquidity\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAllowList\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAllowListEnabled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"getCurrentInboundRateLimiterState\",\"outputs\":[{\"components\":[{\"internalType\":\"uint128\",\"name\":\"tokens\",\"type\":\"uint128\"},{\"internalType\":\"uint32\",\"name\":\"lastUpdated\",\"type\":\"uint32\"},{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.TokenBucket\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"getCurrentOutboundRateLimiterState\",\"outputs\":[{\"components\":[{\"internalType\":\"uint128\",\"name\":\"tokens\",\"type\":\"uint128\"},{\"internalType\":\"uint32\",\"name\":\"lastUpdated\",\"type\":\"uint32\"},{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.TokenBucket\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRateLimitAdmin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRebalancer\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"getRemotePool\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"getRemoteToken\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRmnProxy\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"rmnProxy\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRouter\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"router\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getSupportedChains\",\"outputs\":[{\"internalType\":\"uint64[]\",\"name\":\"\",\"type\":\"uint64[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getToken\",\"outputs\":[{\"internalType\":\"contractIERC20\",\"name\":\"token\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"isSupportedChain\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"isSupportedToken\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes\",\"name\":\"receiver\",\"type\":\"bytes\"},{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"originalSender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"localToken\",\"type\":\"address\"}],\"internalType\":\"structPool.LockOrBurnInV1\",\"name\":\"lockOrBurnIn\",\"type\":\"tuple\"}],\"name\":\"lockOrBurn\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes\",\"name\":\"destTokenAddress\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"destPoolData\",\"type\":\"bytes\"}],\"internalType\":\"structPool.LockOrBurnOutV1\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"provideLiquidity\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes\",\"name\":\"originalSender\",\"type\":\"bytes\"},{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"localToken\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"sourcePoolAddress\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"sourcePoolData\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"offchainTokenData\",\"type\":\"bytes\"}],\"internalType\":\"structPool.ReleaseOrMintInV1\",\"name\":\"releaseOrMintIn\",\"type\":\"tuple\"}],\"name\":\"releaseOrMint\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"destinationAmount\",\"type\":\"uint256\"}],\"internalType\":\"structPool.ReleaseOrMintOutV1\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"outboundConfig\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"inboundConfig\",\"type\":\"tuple\"}],\"name\":\"setChainRateLimiterConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"rateLimitAdmin\",\"type\":\"address\"}],\"name\":\"setRateLimitAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"rebalancer\",\"type\":\"address\"}],\"name\":\"setRebalancer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"remotePoolAddress\",\"type\":\"bytes\"}],\"name\":\"setRemotePool\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newRouter\",\"type\":\"address\"}],\"name\":\"setRouter\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transferLiquidity\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"withdrawLiquidity\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", + Bin: "0x6101006040523480156200001257600080fd5b50604051620049ae380380620049ae833981016040819052620000359162000565565b848484833380600081620000905760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000c357620000c3816200017e565b5050506001600160a01b0384161580620000e457506001600160a01b038116155b80620000f757506001600160a01b038216155b1562000116576040516342bcdf7f60e11b815260040160405180910390fd5b6001600160a01b0384811660805282811660a052600480546001600160a01b031916918316919091179055825115801560c052620001695760408051600081526020810190915262000169908462000229565b5050505090151560e05250620006d692505050565b336001600160a01b03821603620001d85760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640162000087565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b60c0516200024a576040516335f4a7b360e01b815260040160405180910390fd5b60005b8251811015620002d55760008382815181106200026e576200026e62000688565b602090810291909101015190506200028860028262000386565b15620002cb576040516001600160a01b03821681527f800671136ab6cfee9fbe5ed1fb7ca417811aca3cf864800d127b927adedf75669060200160405180910390a15b506001016200024d565b5060005b815181101562000381576000828281518110620002fa57620002fa62000688565b6020026020010151905060006001600160a01b0316816001600160a01b03160362000326575062000378565b62000333600282620003a6565b1562000376576040516001600160a01b03821681527f2640d4d76caf8bf478aabfa982fa4e1c4eb71a37f93cd15e80dbc657911546d89060200160405180910390a15b505b600101620002d9565b505050565b60006200039d836001600160a01b038416620003bd565b90505b92915050565b60006200039d836001600160a01b038416620004c1565b60008181526001830160205260408120548015620004b6576000620003e46001836200069e565b8554909150600090620003fa906001906200069e565b9050808214620004665760008660000182815481106200041e576200041e62000688565b906000526020600020015490508087600001848154811062000444576200044462000688565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806200047a576200047a620006c0565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050620003a0565b6000915050620003a0565b60008181526001830160205260408120546200050a57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155620003a0565b506000620003a0565b6001600160a01b03811681146200052957600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b80516200054f8162000513565b919050565b805180151581146200054f57600080fd5b600080600080600060a086880312156200057e57600080fd5b85516200058b8162000513565b602087810151919650906001600160401b0380821115620005ab57600080fd5b818901915089601f830112620005c057600080fd5b815181811115620005d557620005d56200052c565b8060051b604051601f19603f83011681018181108582111715620005fd57620005fd6200052c565b60405291825284820192508381018501918c8311156200061c57600080fd5b938501935b828510156200064557620006358562000542565b8452938501939285019262000621565b8099505050505050506200065c6040870162000542565b92506200066c6060870162000554565b91506200067c6080870162000542565b90509295509295909350565b634e487b7160e01b600052603260045260246000fd5b81810381811115620003a057634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603160045260246000fd5b60805160a05160c05160e05161423c62000772600039600081816104ef015261174201526000818161059c01528181611cde015261278301526000818161057601528181611b0f0152611f94015260008181610290015281816102e50152818161077a0152818161084c015281816108ed0152818161180401528181611a2f01528181611eb401528181612719015261296e015261423c6000f3fe608060405234801561001057600080fd5b50600436106101f05760003560e01c80638da5cb5b1161010f578063c4bffe2b116100a2578063dc0bd97111610071578063dc0bd97114610574578063e0351e131461059a578063eb521a4c146105c0578063f2fde38b146105d357600080fd5b8063c4bffe2b14610526578063c75eea9c1461053b578063cf7401f31461054e578063db6327dc1461056157600080fd5b8063b0f479a1116100de578063b0f479a1146104bc578063b7946580146104da578063bb98546b146104ed578063c0d786551461051357600080fd5b80638da5cb5b146103fa5780639a4575b914610418578063a7cd63b714610438578063af58d59f1461044d57600080fd5b806354c8a4f31161018757806378a010b21161015657806378a010b2146103b957806379ba5097146103cc5780637d54534e146103d45780638926f54f146103e757600080fd5b806354c8a4f31461036257806366320087146103755780636cfd1553146103885780636d3d1a581461039b57600080fd5b806321df0da7116101c357806321df0da71461028e578063240028e8146102d55780633907753714610322578063432a6ba31461034457600080fd5b806301ffc9a7146101f55780630a2fd4931461021d5780630a861f2a1461023d578063181f5a7714610252575b600080fd5b610208610203366004613318565b6105e6565b60405190151581526020015b60405180910390f35b61023061022b366004613377565b610642565b6040516102149190613400565b61025061024b366004613413565b6106f2565b005b6102306040518060400160405280601a81526020017f4c6f636b52656c65617365546f6b656e506f6f6c20312e352e3000000000000081525081565b7f00000000000000000000000000000000000000000000000000000000000000005b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610214565b6102086102e3366004613459565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff90811691161490565b610335610330366004613476565b6108a3565b60405190518152602001610214565b60095473ffffffffffffffffffffffffffffffffffffffff166102b0565b6102506103703660046134fe565b6109a9565b61025061038336600461356a565b610a24565b610250610396366004613459565b610b00565b60085473ffffffffffffffffffffffffffffffffffffffff166102b0565b6102506103c7366004613596565b610b4f565b610250610cbe565b6102506103e2366004613459565b610dbb565b6102086103f5366004613377565b610e0a565b60005473ffffffffffffffffffffffffffffffffffffffff166102b0565b61042b610426366004613619565b610e21565b6040516102149190613654565b610440610ebb565b60405161021491906136b4565b61046061045b366004613377565b610ecc565b604051610214919081516fffffffffffffffffffffffffffffffff908116825260208084015163ffffffff1690830152604080840151151590830152606080840151821690830152608092830151169181019190915260a00190565b60045473ffffffffffffffffffffffffffffffffffffffff166102b0565b6102306104e8366004613377565b610fa1565b7f0000000000000000000000000000000000000000000000000000000000000000610208565b610250610521366004613459565b610fcc565b61052e6110a7565b604051610214919061370e565b610460610549366004613377565b61115f565b61025061055c366004613876565b611231565b61025061056f3660046138bb565b6112ba565b7f00000000000000000000000000000000000000000000000000000000000000006102b0565b7f0000000000000000000000000000000000000000000000000000000000000000610208565b6102506105ce366004613413565b611740565b6102506105e1366004613459565b61185c565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167fe1d4056600000000000000000000000000000000000000000000000000000000148061063c575061063c82611870565b92915050565b67ffffffffffffffff8116600090815260076020526040902060040180546060919061066d906138fd565b80601f0160208091040260200160405190810160405280929190818152602001828054610699906138fd565b80156106e65780601f106106bb576101008083540402835291602001916106e6565b820191906000526020600020905b8154815290600101906020018083116106c957829003601f168201915b50505050509050919050565b60095473ffffffffffffffffffffffffffffffffffffffff16331461074a576040517f8e4a23d60000000000000000000000000000000000000000000000000000000081523360048201526024015b60405180910390fd5b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015281907f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16906370a0823190602401602060405180830381865afa1580156107d6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107fa9190613950565b1015610832576040517fbb55fd2700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61087373ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000163383611954565b604051819033907fc2c3f06e49b9f15e7b4af9055e183b0d73362e033ad82a07dec9bf984017171990600090a350565b6040805160208101909152600081526108c36108be83613a14565b611a28565b6109186108d66060840160408501613459565b73ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016906060850135611954565b6109286060830160408401613459565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f2d87480f50083e2b2759522a8fdda59802650a8055e609a7772cf70c07748f52846060013560405161098a91815260200190565b60405180910390a3506040805160208101909152606090910135815290565b6109b1611c59565b610a1e84848080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808802828101820190935287825290935087925086918291850190849080828437600092019190915250611cdc92505050565b50505050565b610a2c611c59565b6040517f0a861f2a0000000000000000000000000000000000000000000000000000000081526004810182905273ffffffffffffffffffffffffffffffffffffffff831690630a861f2a90602401600060405180830381600087803b158015610a9457600080fd5b505af1158015610aa8573d6000803e3d6000fd5b505050508173ffffffffffffffffffffffffffffffffffffffff167f6fa7abcf1345d1d478e5ea0da6b5f26a90eadb0546ef15ed3833944fbfd1db6282604051610af491815260200190565b60405180910390a25050565b610b08611c59565b600980547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b610b57611c59565b610b6083610e0a565b610ba2576040517f1e670e4b00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff84166004820152602401610741565b67ffffffffffffffff831660009081526007602052604081206004018054610bc9906138fd565b80601f0160208091040260200160405190810160405280929190818152602001828054610bf5906138fd565b8015610c425780601f10610c1757610100808354040283529160200191610c42565b820191906000526020600020905b815481529060010190602001808311610c2557829003601f168201915b5050505067ffffffffffffffff8616600090815260076020526040902091925050600401610c71838583613b59565b508367ffffffffffffffff167fdb4d6220746a38cbc5335f7e108f7de80f482f4d23350253dfd0917df75a14bf828585604051610cb093929190613c74565b60405180910390a250505050565b60015473ffffffffffffffffffffffffffffffffffffffff163314610d3f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e6572000000000000000000006044820152606401610741565b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b610dc3611c59565b600880547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b600061063c600567ffffffffffffffff8416611e92565b6040805180820190915260608082526020820152610e46610e4183613cd8565b611ead565b6040516060830135815233907f9f1ec8c880f76798e7b793325d625e9b60e4082a553c98f42b6cda368dd600089060200160405180910390a26040518060400160405280610ea08460200160208101906104e89190613377565b81526040805160208181019092526000815291015292915050565b6060610ec76002612077565b905090565b6040805160a08101825260008082526020820181905291810182905260608101829052608081019190915267ffffffffffffffff8216600090815260076020908152604091829020825160a08101845260028201546fffffffffffffffffffffffffffffffff808216835270010000000000000000000000000000000080830463ffffffff16958401959095527401000000000000000000000000000000000000000090910460ff16151594820194909452600390910154808416606083015291909104909116608082015261063c90612084565b67ffffffffffffffff8116600090815260076020526040902060050180546060919061066d906138fd565b610fd4611c59565b73ffffffffffffffffffffffffffffffffffffffff8116611021576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6004805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff000000000000000000000000000000000000000083168117909355604080519190921680825260208201939093527f02dc5c233404867c793b749c6d644beb2277536d18a7e7974d3f238e4c6f1684910160405180910390a15050565b606060006110b56005612077565b90506000815167ffffffffffffffff8111156110d3576110d3613750565b6040519080825280602002602001820160405280156110fc578160200160208202803683370190505b50905060005b82518110156111585782818151811061111d5761111d613d7a565b602002602001015182828151811061113757611137613d7a565b67ffffffffffffffff90921660209283029190910190910152600101611102565b5092915050565b6040805160a08101825260008082526020820181905291810182905260608101829052608081019190915267ffffffffffffffff8216600090815260076020908152604091829020825160a08101845281546fffffffffffffffffffffffffffffffff808216835270010000000000000000000000000000000080830463ffffffff16958401959095527401000000000000000000000000000000000000000090910460ff16151594820194909452600190910154808416606083015291909104909116608082015261063c90612084565b60085473ffffffffffffffffffffffffffffffffffffffff163314801590611271575060005473ffffffffffffffffffffffffffffffffffffffff163314155b156112aa576040517f8e4a23d6000000000000000000000000000000000000000000000000000000008152336004820152602401610741565b6112b5838383612136565b505050565b6112c2611c59565b60005b818110156112b55760008383838181106112e1576112e1613d7a565b90506020028101906112f39190613da9565b6112fc90613de7565b90506113118160800151826020015115612220565b6113248160a00151826020015115612220565b8060200151156116205780516113469060059067ffffffffffffffff16612359565b61138b5780516040517f1d5ad3c500000000000000000000000000000000000000000000000000000000815267ffffffffffffffff9091166004820152602401610741565b60408101515115806113a05750606081015151155b156113d7576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040805161012081018252608083810180516020908101516fffffffffffffffffffffffffffffffff9081168486019081524263ffffffff90811660a0808901829052865151151560c08a01528651860151851660e08a015295518901518416610100890152918752875180860189529489018051850151841686528585019290925281515115158589015281518401518316606080870191909152915188015183168587015283870194855288880151878901908152828a015183890152895167ffffffffffffffff1660009081526007865289902088518051825482890151838e01519289167fffffffffffffffffffffffff0000000000000000000000000000000000000000928316177001000000000000000000000000000000009188168202177fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff90811674010000000000000000000000000000000000000000941515850217865584890151948d0151948a16948a168202949094176001860155995180516002860180549b8301519f830151918b169b9093169a909a179d9096168a029c909c179091169615150295909517909855908101519401519381169316909102919091176003820155915190919060048201906115b89082613e9b565b50606082015160058201906115cd9082613e9b565b505081516060830151608084015160a08501516040517f8d340f17e19058004c20453540862a9c62778504476f6756755cb33bcd6c38c295506116139493929190613fb5565b60405180910390a1611737565b80516116389060059067ffffffffffffffff16612365565b61167d5780516040517f1e670e4b00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff9091166004820152602401610741565b805167ffffffffffffffff16600090815260076020526040812080547fffffffffffffffffffffff000000000000000000000000000000000000000000908116825560018201839055600282018054909116905560038101829055906116e660048301826132ca565b6116f46005830160006132ca565b5050805160405167ffffffffffffffff90911681527f5204aec90a3c794d8e90fded8b46ae9c7c552803e7e832e0c1d358396d8599169060200160405180910390a15b506001016112c5565b7f0000000000000000000000000000000000000000000000000000000000000000611797576040517fe93f8fa400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60095473ffffffffffffffffffffffffffffffffffffffff1633146117ea576040517f8e4a23d6000000000000000000000000000000000000000000000000000000008152336004820152602401610741565b61182c73ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016333084612371565b604051819033907fc17cea59c2955cb181b03393209566960365771dbba9dc3d510180e7cb31208890600090a350565b611864611c59565b61186d816123cf565b50565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167faff2afbf00000000000000000000000000000000000000000000000000000000148061190357507fffffffff0000000000000000000000000000000000000000000000000000000082167f0e64dd2900000000000000000000000000000000000000000000000000000000145b8061063c57507fffffffff0000000000000000000000000000000000000000000000000000000082167f01ffc9a7000000000000000000000000000000000000000000000000000000001492915050565b60405173ffffffffffffffffffffffffffffffffffffffff83166024820152604481018290526112b59084907fa9059cbb00000000000000000000000000000000000000000000000000000000906064015b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff00000000000000000000000000000000000000000000000000000000909316929092179091526124c4565b60808101517f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff908116911614611abd5760808101516040517f961c9a4f00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9091166004820152602401610741565b60208101516040517f2cbc26bb00000000000000000000000000000000000000000000000000000000815260809190911b77ffffffffffffffff000000000000000000000000000000001660048201527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1690632cbc26bb90602401602060405180830381865afa158015611b6b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b8f919061404e565b15611bc6576040517f53ad11d800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611bd381602001516125d0565b6000611be28260200151610642565b9050805160001480611c06575080805190602001208260a001518051906020012014155b15611c43578160a001516040517f24eb47e50000000000000000000000000000000000000000000000000000000081526004016107419190613400565b611c55826020015183606001516126f6565b5050565b60005473ffffffffffffffffffffffffffffffffffffffff163314611cda576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e6572000000000000000000006044820152606401610741565b565b7f0000000000000000000000000000000000000000000000000000000000000000611d33576040517f35f4a7b300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b8251811015611dc9576000838281518110611d5357611d53613d7a565b60200260200101519050611d7181600261273d90919063ffffffff16565b15611dc05760405173ffffffffffffffffffffffffffffffffffffffff821681527f800671136ab6cfee9fbe5ed1fb7ca417811aca3cf864800d127b927adedf75669060200160405180910390a15b50600101611d36565b5060005b81518110156112b5576000828281518110611dea57611dea613d7a565b60200260200101519050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603611e2e5750611e8a565b611e3960028261275f565b15611e885760405173ffffffffffffffffffffffffffffffffffffffff821681527f2640d4d76caf8bf478aabfa982fa4e1c4eb71a37f93cd15e80dbc657911546d89060200160405180910390a15b505b600101611dcd565b600081815260018301602052604081205415155b9392505050565b60808101517f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff908116911614611f425760808101516040517f961c9a4f00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9091166004820152602401610741565b60208101516040517f2cbc26bb00000000000000000000000000000000000000000000000000000000815260809190911b77ffffffffffffffff000000000000000000000000000000001660048201527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1690632cbc26bb90602401602060405180830381865afa158015611ff0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612014919061404e565b1561204b576040517f53ad11d800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6120588160400151612781565b6120658160200151612800565b61186d8160200151826060015161294e565b60606000611ea683612992565b6040805160a08101825260008082526020820181905291810182905260608101829052608081019190915261211282606001516fffffffffffffffffffffffffffffffff1683600001516fffffffffffffffffffffffffffffffff16846020015163ffffffff16426120f6919061409a565b85608001516fffffffffffffffffffffffffffffffff166129ed565b6fffffffffffffffffffffffffffffffff1682525063ffffffff4216602082015290565b61213f83610e0a565b612181576040517f1e670e4b00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff84166004820152602401610741565b61218c826000612220565b67ffffffffffffffff831660009081526007602052604090206121af9083612a17565b6121ba816000612220565b67ffffffffffffffff831660009081526007602052604090206121e09060020182612a17565b7f0350d63aa5f270e01729d00d627eeb8f3429772b1818c016c66a588a864f912b838383604051612213939291906140ad565b60405180910390a1505050565b8151156122e75781602001516fffffffffffffffffffffffffffffffff1682604001516fffffffffffffffffffffffffffffffff16101580612276575060408201516fffffffffffffffffffffffffffffffff16155b156122af57816040517f8020d1240000000000000000000000000000000000000000000000000000000081526004016107419190614130565b8015611c55576040517f433fc33d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60408201516fffffffffffffffffffffffffffffffff16151580612320575060208201516fffffffffffffffffffffffffffffffff1615155b15611c5557816040517fd68af9cc0000000000000000000000000000000000000000000000000000000081526004016107419190614130565b6000611ea68383612bb9565b6000611ea68383612c08565b60405173ffffffffffffffffffffffffffffffffffffffff80851660248301528316604482015260648101829052610a1e9085907f23b872dd00000000000000000000000000000000000000000000000000000000906084016119a6565b3373ffffffffffffffffffffffffffffffffffffffff82160361244e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c660000000000000000006044820152606401610741565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b6000612526826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16612cfb9092919063ffffffff16565b8051909150156112b55780806020019051810190612544919061404e565b6112b5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610741565b6125d981610e0a565b61261b576040517fa9902c7e00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff82166004820152602401610741565b600480546040517f83826b2b00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff84169281019290925233602483015273ffffffffffffffffffffffffffffffffffffffff16906383826b2b90604401602060405180830381865afa15801561269a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126be919061404e565b61186d576040517f728fe07b000000000000000000000000000000000000000000000000000000008152336004820152602401610741565b67ffffffffffffffff82166000908152600760205260409020611c5590600201827f0000000000000000000000000000000000000000000000000000000000000000612d0a565b6000611ea68373ffffffffffffffffffffffffffffffffffffffff8416612c08565b6000611ea68373ffffffffffffffffffffffffffffffffffffffff8416612bb9565b7f00000000000000000000000000000000000000000000000000000000000000001561186d576127b260028261308d565b61186d576040517fd0d2597600000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff82166004820152602401610741565b61280981610e0a565b61284b576040517fa9902c7e00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff82166004820152602401610741565b600480546040517fa8d87a3b00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff84169281019290925273ffffffffffffffffffffffffffffffffffffffff169063a8d87a3b90602401602060405180830381865afa1580156128c4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128e8919061416c565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461186d576040517f728fe07b000000000000000000000000000000000000000000000000000000008152336004820152602401610741565b67ffffffffffffffff82166000908152600760205260409020611c5590827f0000000000000000000000000000000000000000000000000000000000000000612d0a565b6060816000018054806020026020016040519081016040528092919081815260200182805480156106e657602002820191906000526020600020905b8154815260200190600101908083116129ce5750505050509050919050565b6000612a0c856129fd8486614189565b612a0790876141a0565b6130bc565b90505b949350505050565b8154600090612a4090700100000000000000000000000000000000900463ffffffff164261409a565b90508015612ae25760018301548354612a88916fffffffffffffffffffffffffffffffff808216928116918591700100000000000000000000000000000000909104166129ed565b83546fffffffffffffffffffffffffffffffff919091167fffffffffffffffffffffffff0000000000000000000000000000000000000000909116177001000000000000000000000000000000004263ffffffff16021783555b60208201518354612b08916fffffffffffffffffffffffffffffffff90811691166130bc565b83548351151574010000000000000000000000000000000000000000027fffffffffffffffffffffff00ffffffff000000000000000000000000000000009091166fffffffffffffffffffffffffffffffff92831617178455602083015160408085015183167001000000000000000000000000000000000291909216176001850155517f9ea3374b67bf275e6bb9c8ae68f9cae023e1c528b4b27e092f0bb209d3531c1990612213908490614130565b6000818152600183016020526040812054612c005750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915561063c565b50600061063c565b60008181526001830160205260408120548015612cf1576000612c2c60018361409a565b8554909150600090612c409060019061409a565b9050808214612ca5576000866000018281548110612c6057612c60613d7a565b9060005260206000200154905080876000018481548110612c8357612c83613d7a565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080612cb657612cb66141b3565b60019003818190600052602060002001600090559055856001016000868152602001908152602001600020600090556001935050505061063c565b600091505061063c565b6060612a0f84846000856130d2565b825474010000000000000000000000000000000000000000900460ff161580612d31575081155b15612d3b57505050565b825460018401546fffffffffffffffffffffffffffffffff80831692911690600090612d8190700100000000000000000000000000000000900463ffffffff164261409a565b90508015612e415781831115612dc3576040517f9725942a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001860154612dfd9083908590849070010000000000000000000000000000000090046fffffffffffffffffffffffffffffffff166129ed565b86547fffffffffffffffffffffffff00000000ffffffffffffffffffffffffffffffff167001000000000000000000000000000000004263ffffffff160217875592505b84821015612ef85773ffffffffffffffffffffffffffffffffffffffff8416612ea0576040517ff94ebcd10000000000000000000000000000000000000000000000000000000081526004810183905260248101869052604401610741565b6040517f1a76572a000000000000000000000000000000000000000000000000000000008152600481018390526024810186905273ffffffffffffffffffffffffffffffffffffffff85166044820152606401610741565b8483101561300b5760018681015470010000000000000000000000000000000090046fffffffffffffffffffffffffffffffff16906000908290612f3c908261409a565b612f46878a61409a565b612f5091906141a0565b612f5a91906141e2565b905073ffffffffffffffffffffffffffffffffffffffff8616612fb3576040517f15279c080000000000000000000000000000000000000000000000000000000081526004810182905260248101869052604401610741565b6040517fd0c8d23a000000000000000000000000000000000000000000000000000000008152600481018290526024810186905273ffffffffffffffffffffffffffffffffffffffff87166044820152606401610741565b613015858461409a565b86547fffffffffffffffffffffffffffffffff00000000000000000000000000000000166fffffffffffffffffffffffffffffffff82161787556040518681529093507f1871cdf8010e63f2eb8384381a68dfa7416dc571a5517e66e88b2d2d0c0a690a9060200160405180910390a1505050505050565b73ffffffffffffffffffffffffffffffffffffffff811660009081526001830160205260408120541515611ea6565b60008183106130cb5781611ea6565b5090919050565b606082471015613164576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610741565b6000808673ffffffffffffffffffffffffffffffffffffffff16858760405161318d919061421d565b60006040518083038185875af1925050503d80600081146131ca576040519150601f19603f3d011682016040523d82523d6000602084013e6131cf565b606091505b50915091506131e0878383876131eb565b979650505050505050565b6060831561328157825160000361327a5773ffffffffffffffffffffffffffffffffffffffff85163b61327a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610741565b5081612a0f565b612a0f83838151156132965781518083602001fd5b806040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107419190613400565b5080546132d6906138fd565b6000825580601f106132e6575050565b601f01602090049060005260206000209081019061186d91905b808211156133145760008155600101613300565b5090565b60006020828403121561332a57600080fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114611ea657600080fd5b803567ffffffffffffffff8116811461337257600080fd5b919050565b60006020828403121561338957600080fd5b611ea68261335a565b60005b838110156133ad578181015183820152602001613395565b50506000910152565b600081518084526133ce816020860160208601613392565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b602081526000611ea660208301846133b6565b60006020828403121561342557600080fd5b5035919050565b73ffffffffffffffffffffffffffffffffffffffff8116811461186d57600080fd5b80356133728161342c565b60006020828403121561346b57600080fd5b8135611ea68161342c565b60006020828403121561348857600080fd5b813567ffffffffffffffff81111561349f57600080fd5b82016101008185031215611ea657600080fd5b60008083601f8401126134c457600080fd5b50813567ffffffffffffffff8111156134dc57600080fd5b6020830191508360208260051b85010111156134f757600080fd5b9250929050565b6000806000806040858703121561351457600080fd5b843567ffffffffffffffff8082111561352c57600080fd5b613538888389016134b2565b9096509450602087013591508082111561355157600080fd5b5061355e878288016134b2565b95989497509550505050565b6000806040838503121561357d57600080fd5b82356135888161342c565b946020939093013593505050565b6000806000604084860312156135ab57600080fd5b6135b48461335a565b9250602084013567ffffffffffffffff808211156135d157600080fd5b818601915086601f8301126135e557600080fd5b8135818111156135f457600080fd5b87602082850101111561360657600080fd5b6020830194508093505050509250925092565b60006020828403121561362b57600080fd5b813567ffffffffffffffff81111561364257600080fd5b820160a08185031215611ea657600080fd5b60208152600082516040602084015261367060608401826133b6565b905060208401517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08483030160408501526136ab82826133b6565b95945050505050565b6020808252825182820181905260009190848201906040850190845b8181101561370257835173ffffffffffffffffffffffffffffffffffffffff16835292840192918401916001016136d0565b50909695505050505050565b6020808252825182820181905260009190848201906040850190845b8181101561370257835167ffffffffffffffff168352928401929184019160010161372a565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051610100810167ffffffffffffffff811182821017156137a3576137a3613750565b60405290565b60405160c0810167ffffffffffffffff811182821017156137a3576137a3613750565b801515811461186d57600080fd5b8035613372816137cc565b80356fffffffffffffffffffffffffffffffff8116811461337257600080fd5b60006060828403121561381757600080fd5b6040516060810181811067ffffffffffffffff8211171561383a5761383a613750565b604052905080823561384b816137cc565b8152613859602084016137e5565b602082015261386a604084016137e5565b60408201525092915050565b600080600060e0848603121561388b57600080fd5b6138948461335a565b92506138a38560208601613805565b91506138b28560808601613805565b90509250925092565b600080602083850312156138ce57600080fd5b823567ffffffffffffffff8111156138e557600080fd5b6138f1858286016134b2565b90969095509350505050565b600181811c9082168061391157607f821691505b60208210810361394a577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b60006020828403121561396257600080fd5b5051919050565b600082601f83011261397a57600080fd5b813567ffffffffffffffff8082111561399557613995613750565b604051601f83017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f011681019082821181831017156139db576139db613750565b816040528381528660208588010111156139f457600080fd5b836020870160208301376000602085830101528094505050505092915050565b60006101008236031215613a2757600080fd5b613a2f61377f565b823567ffffffffffffffff80821115613a4757600080fd5b613a5336838701613969565b8352613a616020860161335a565b6020840152613a726040860161344e565b604084015260608501356060840152613a8d6080860161344e565b608084015260a0850135915080821115613aa657600080fd5b613ab236838701613969565b60a084015260c0850135915080821115613acb57600080fd5b613ad736838701613969565b60c084015260e0850135915080821115613af057600080fd5b50613afd36828601613969565b60e08301525092915050565b601f8211156112b5576000816000526020600020601f850160051c81016020861015613b325750805b601f850160051c820191505b81811015613b5157828155600101613b3e565b505050505050565b67ffffffffffffffff831115613b7157613b71613750565b613b8583613b7f83546138fd565b83613b09565b6000601f841160018114613bd75760008515613ba15750838201355b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600387901b1c1916600186901b178355613c6d565b6000838152602090207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0861690835b82811015613c265786850135825560209485019460019092019101613c06565b5086821015613c61577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60f88860031b161c19848701351681555b505060018560011b0183555b5050505050565b604081526000613c8760408301866133b6565b82810360208401528381528385602083013760006020858301015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f860116820101915050949350505050565b600060a08236031215613cea57600080fd5b60405160a0810167ffffffffffffffff8282108183111715613d0e57613d0e613750565b816040528435915080821115613d2357600080fd5b50613d3036828601613969565b825250613d3f6020840161335a565b60208201526040830135613d528161342c565b6040820152606083810135908201526080830135613d6f8161342c565b608082015292915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600082357ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec1833603018112613ddd57600080fd5b9190910192915050565b60006101408236031215613dfa57600080fd5b613e026137a9565b613e0b8361335a565b8152613e19602084016137da565b6020820152604083013567ffffffffffffffff80821115613e3957600080fd5b613e4536838701613969565b60408401526060850135915080821115613e5e57600080fd5b50613e6b36828601613969565b606083015250613e7e3660808501613805565b6080820152613e903660e08501613805565b60a082015292915050565b815167ffffffffffffffff811115613eb557613eb5613750565b613ec981613ec384546138fd565b84613b09565b602080601f831160018114613f1c5760008415613ee65750858301515b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600386901b1c1916600185901b178555613b51565b6000858152602081207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08616915b82811015613f6957888601518255948401946001909101908401613f4a565b5085821015613fa557878501517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600388901b60f8161c191681555b5050505050600190811b01905550565b600061010067ffffffffffffffff87168352806020840152613fd9818401876133b6565b8551151560408581019190915260208701516fffffffffffffffffffffffffffffffff90811660608701529087015116608085015291506140179050565b8251151560a083015260208301516fffffffffffffffffffffffffffffffff90811660c084015260408401511660e08301526136ab565b60006020828403121561406057600080fd5b8151611ea6816137cc565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8181038181111561063c5761063c61406b565b67ffffffffffffffff8416815260e081016140f960208301858051151582526020808201516fffffffffffffffffffffffffffffffff9081169184019190915260409182015116910152565b82511515608083015260208301516fffffffffffffffffffffffffffffffff90811660a084015260408401511660c0830152612a0f565b6060810161063c82848051151582526020808201516fffffffffffffffffffffffffffffffff9081169184019190915260409182015116910152565b60006020828403121561417e57600080fd5b8151611ea68161342c565b808202811582820484141761063c5761063c61406b565b8082018082111561063c5761063c61406b565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b600082614218577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b60008251613ddd81846020870161339256fea164736f6c6343000818000a", +} + +var LockReleaseTokenPoolABI = LockReleaseTokenPoolMetaData.ABI + +var LockReleaseTokenPoolBin = LockReleaseTokenPoolMetaData.Bin + +func DeployLockReleaseTokenPool(auth *bind.TransactOpts, backend bind.ContractBackend, token common.Address, allowlist []common.Address, rmnProxy common.Address, acceptLiquidity bool, router common.Address) (common.Address, *types.Transaction, *LockReleaseTokenPool, error) { + parsed, err := LockReleaseTokenPoolMetaData.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(LockReleaseTokenPoolBin), backend, token, allowlist, rmnProxy, acceptLiquidity, router) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &LockReleaseTokenPool{address: address, abi: *parsed, LockReleaseTokenPoolCaller: LockReleaseTokenPoolCaller{contract: contract}, LockReleaseTokenPoolTransactor: LockReleaseTokenPoolTransactor{contract: contract}, LockReleaseTokenPoolFilterer: LockReleaseTokenPoolFilterer{contract: contract}}, nil +} + +type LockReleaseTokenPool struct { + address common.Address + abi abi.ABI + LockReleaseTokenPoolCaller + LockReleaseTokenPoolTransactor + LockReleaseTokenPoolFilterer +} + +type LockReleaseTokenPoolCaller struct { + contract *bind.BoundContract +} + +type LockReleaseTokenPoolTransactor struct { + contract *bind.BoundContract +} + +type LockReleaseTokenPoolFilterer struct { + contract *bind.BoundContract +} + +type LockReleaseTokenPoolSession struct { + Contract *LockReleaseTokenPool + CallOpts bind.CallOpts + TransactOpts bind.TransactOpts +} + +type LockReleaseTokenPoolCallerSession struct { + Contract *LockReleaseTokenPoolCaller + CallOpts bind.CallOpts +} + +type LockReleaseTokenPoolTransactorSession struct { + Contract *LockReleaseTokenPoolTransactor + TransactOpts bind.TransactOpts +} + +type LockReleaseTokenPoolRaw struct { + Contract *LockReleaseTokenPool +} + +type LockReleaseTokenPoolCallerRaw struct { + Contract *LockReleaseTokenPoolCaller +} + +type LockReleaseTokenPoolTransactorRaw struct { + Contract *LockReleaseTokenPoolTransactor +} + +func NewLockReleaseTokenPool(address common.Address, backend bind.ContractBackend) (*LockReleaseTokenPool, error) { + abi, err := abi.JSON(strings.NewReader(LockReleaseTokenPoolABI)) + if err != nil { + return nil, err + } + contract, err := bindLockReleaseTokenPool(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &LockReleaseTokenPool{address: address, abi: abi, LockReleaseTokenPoolCaller: LockReleaseTokenPoolCaller{contract: contract}, LockReleaseTokenPoolTransactor: LockReleaseTokenPoolTransactor{contract: contract}, LockReleaseTokenPoolFilterer: LockReleaseTokenPoolFilterer{contract: contract}}, nil +} + +func NewLockReleaseTokenPoolCaller(address common.Address, caller bind.ContractCaller) (*LockReleaseTokenPoolCaller, error) { + contract, err := bindLockReleaseTokenPool(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &LockReleaseTokenPoolCaller{contract: contract}, nil +} + +func NewLockReleaseTokenPoolTransactor(address common.Address, transactor bind.ContractTransactor) (*LockReleaseTokenPoolTransactor, error) { + contract, err := bindLockReleaseTokenPool(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &LockReleaseTokenPoolTransactor{contract: contract}, nil +} + +func NewLockReleaseTokenPoolFilterer(address common.Address, filterer bind.ContractFilterer) (*LockReleaseTokenPoolFilterer, error) { + contract, err := bindLockReleaseTokenPool(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &LockReleaseTokenPoolFilterer{contract: contract}, nil +} + +func bindLockReleaseTokenPool(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := LockReleaseTokenPoolMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _LockReleaseTokenPool.Contract.LockReleaseTokenPoolCaller.contract.Call(opts, result, method, params...) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _LockReleaseTokenPool.Contract.LockReleaseTokenPoolTransactor.contract.Transfer(opts) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _LockReleaseTokenPool.Contract.LockReleaseTokenPoolTransactor.contract.Transact(opts, method, params...) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _LockReleaseTokenPool.Contract.contract.Call(opts, result, method, params...) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _LockReleaseTokenPool.Contract.contract.Transfer(opts) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _LockReleaseTokenPool.Contract.contract.Transact(opts, method, params...) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolCaller) CanAcceptLiquidity(opts *bind.CallOpts) (bool, error) { + var out []interface{} + err := _LockReleaseTokenPool.contract.Call(opts, &out, "canAcceptLiquidity") + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolSession) CanAcceptLiquidity() (bool, error) { + return _LockReleaseTokenPool.Contract.CanAcceptLiquidity(&_LockReleaseTokenPool.CallOpts) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolCallerSession) CanAcceptLiquidity() (bool, error) { + return _LockReleaseTokenPool.Contract.CanAcceptLiquidity(&_LockReleaseTokenPool.CallOpts) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolCaller) GetAllowList(opts *bind.CallOpts) ([]common.Address, error) { + var out []interface{} + err := _LockReleaseTokenPool.contract.Call(opts, &out, "getAllowList") + + if err != nil { + return *new([]common.Address), err + } + + out0 := *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) + + return out0, err + +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolSession) GetAllowList() ([]common.Address, error) { + return _LockReleaseTokenPool.Contract.GetAllowList(&_LockReleaseTokenPool.CallOpts) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolCallerSession) GetAllowList() ([]common.Address, error) { + return _LockReleaseTokenPool.Contract.GetAllowList(&_LockReleaseTokenPool.CallOpts) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolCaller) GetAllowListEnabled(opts *bind.CallOpts) (bool, error) { + var out []interface{} + err := _LockReleaseTokenPool.contract.Call(opts, &out, "getAllowListEnabled") + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolSession) GetAllowListEnabled() (bool, error) { + return _LockReleaseTokenPool.Contract.GetAllowListEnabled(&_LockReleaseTokenPool.CallOpts) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolCallerSession) GetAllowListEnabled() (bool, error) { + return _LockReleaseTokenPool.Contract.GetAllowListEnabled(&_LockReleaseTokenPool.CallOpts) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolCaller) GetCurrentInboundRateLimiterState(opts *bind.CallOpts, remoteChainSelector uint64) (RateLimiterTokenBucket, error) { + var out []interface{} + err := _LockReleaseTokenPool.contract.Call(opts, &out, "getCurrentInboundRateLimiterState", remoteChainSelector) + + if err != nil { + return *new(RateLimiterTokenBucket), err + } + + out0 := *abi.ConvertType(out[0], new(RateLimiterTokenBucket)).(*RateLimiterTokenBucket) + + return out0, err + +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolSession) GetCurrentInboundRateLimiterState(remoteChainSelector uint64) (RateLimiterTokenBucket, error) { + return _LockReleaseTokenPool.Contract.GetCurrentInboundRateLimiterState(&_LockReleaseTokenPool.CallOpts, remoteChainSelector) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolCallerSession) GetCurrentInboundRateLimiterState(remoteChainSelector uint64) (RateLimiterTokenBucket, error) { + return _LockReleaseTokenPool.Contract.GetCurrentInboundRateLimiterState(&_LockReleaseTokenPool.CallOpts, remoteChainSelector) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolCaller) GetCurrentOutboundRateLimiterState(opts *bind.CallOpts, remoteChainSelector uint64) (RateLimiterTokenBucket, error) { + var out []interface{} + err := _LockReleaseTokenPool.contract.Call(opts, &out, "getCurrentOutboundRateLimiterState", remoteChainSelector) + + if err != nil { + return *new(RateLimiterTokenBucket), err + } + + out0 := *abi.ConvertType(out[0], new(RateLimiterTokenBucket)).(*RateLimiterTokenBucket) + + return out0, err + +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolSession) GetCurrentOutboundRateLimiterState(remoteChainSelector uint64) (RateLimiterTokenBucket, error) { + return _LockReleaseTokenPool.Contract.GetCurrentOutboundRateLimiterState(&_LockReleaseTokenPool.CallOpts, remoteChainSelector) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolCallerSession) GetCurrentOutboundRateLimiterState(remoteChainSelector uint64) (RateLimiterTokenBucket, error) { + return _LockReleaseTokenPool.Contract.GetCurrentOutboundRateLimiterState(&_LockReleaseTokenPool.CallOpts, remoteChainSelector) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolCaller) GetRateLimitAdmin(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _LockReleaseTokenPool.contract.Call(opts, &out, "getRateLimitAdmin") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolSession) GetRateLimitAdmin() (common.Address, error) { + return _LockReleaseTokenPool.Contract.GetRateLimitAdmin(&_LockReleaseTokenPool.CallOpts) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolCallerSession) GetRateLimitAdmin() (common.Address, error) { + return _LockReleaseTokenPool.Contract.GetRateLimitAdmin(&_LockReleaseTokenPool.CallOpts) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolCaller) GetRebalancer(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _LockReleaseTokenPool.contract.Call(opts, &out, "getRebalancer") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolSession) GetRebalancer() (common.Address, error) { + return _LockReleaseTokenPool.Contract.GetRebalancer(&_LockReleaseTokenPool.CallOpts) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolCallerSession) GetRebalancer() (common.Address, error) { + return _LockReleaseTokenPool.Contract.GetRebalancer(&_LockReleaseTokenPool.CallOpts) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolCaller) GetRemotePool(opts *bind.CallOpts, remoteChainSelector uint64) ([]byte, error) { + var out []interface{} + err := _LockReleaseTokenPool.contract.Call(opts, &out, "getRemotePool", remoteChainSelector) + + if err != nil { + return *new([]byte), err + } + + out0 := *abi.ConvertType(out[0], new([]byte)).(*[]byte) + + return out0, err + +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolSession) GetRemotePool(remoteChainSelector uint64) ([]byte, error) { + return _LockReleaseTokenPool.Contract.GetRemotePool(&_LockReleaseTokenPool.CallOpts, remoteChainSelector) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolCallerSession) GetRemotePool(remoteChainSelector uint64) ([]byte, error) { + return _LockReleaseTokenPool.Contract.GetRemotePool(&_LockReleaseTokenPool.CallOpts, remoteChainSelector) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolCaller) GetRemoteToken(opts *bind.CallOpts, remoteChainSelector uint64) ([]byte, error) { + var out []interface{} + err := _LockReleaseTokenPool.contract.Call(opts, &out, "getRemoteToken", remoteChainSelector) + + if err != nil { + return *new([]byte), err + } + + out0 := *abi.ConvertType(out[0], new([]byte)).(*[]byte) + + return out0, err + +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolSession) GetRemoteToken(remoteChainSelector uint64) ([]byte, error) { + return _LockReleaseTokenPool.Contract.GetRemoteToken(&_LockReleaseTokenPool.CallOpts, remoteChainSelector) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolCallerSession) GetRemoteToken(remoteChainSelector uint64) ([]byte, error) { + return _LockReleaseTokenPool.Contract.GetRemoteToken(&_LockReleaseTokenPool.CallOpts, remoteChainSelector) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolCaller) GetRmnProxy(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _LockReleaseTokenPool.contract.Call(opts, &out, "getRmnProxy") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolSession) GetRmnProxy() (common.Address, error) { + return _LockReleaseTokenPool.Contract.GetRmnProxy(&_LockReleaseTokenPool.CallOpts) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolCallerSession) GetRmnProxy() (common.Address, error) { + return _LockReleaseTokenPool.Contract.GetRmnProxy(&_LockReleaseTokenPool.CallOpts) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolCaller) GetRouter(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _LockReleaseTokenPool.contract.Call(opts, &out, "getRouter") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolSession) GetRouter() (common.Address, error) { + return _LockReleaseTokenPool.Contract.GetRouter(&_LockReleaseTokenPool.CallOpts) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolCallerSession) GetRouter() (common.Address, error) { + return _LockReleaseTokenPool.Contract.GetRouter(&_LockReleaseTokenPool.CallOpts) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolCaller) GetSupportedChains(opts *bind.CallOpts) ([]uint64, error) { + var out []interface{} + err := _LockReleaseTokenPool.contract.Call(opts, &out, "getSupportedChains") + + if err != nil { + return *new([]uint64), err + } + + out0 := *abi.ConvertType(out[0], new([]uint64)).(*[]uint64) + + return out0, err + +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolSession) GetSupportedChains() ([]uint64, error) { + return _LockReleaseTokenPool.Contract.GetSupportedChains(&_LockReleaseTokenPool.CallOpts) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolCallerSession) GetSupportedChains() ([]uint64, error) { + return _LockReleaseTokenPool.Contract.GetSupportedChains(&_LockReleaseTokenPool.CallOpts) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolCaller) GetToken(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _LockReleaseTokenPool.contract.Call(opts, &out, "getToken") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolSession) GetToken() (common.Address, error) { + return _LockReleaseTokenPool.Contract.GetToken(&_LockReleaseTokenPool.CallOpts) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolCallerSession) GetToken() (common.Address, error) { + return _LockReleaseTokenPool.Contract.GetToken(&_LockReleaseTokenPool.CallOpts) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolCaller) IsSupportedChain(opts *bind.CallOpts, remoteChainSelector uint64) (bool, error) { + var out []interface{} + err := _LockReleaseTokenPool.contract.Call(opts, &out, "isSupportedChain", remoteChainSelector) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolSession) IsSupportedChain(remoteChainSelector uint64) (bool, error) { + return _LockReleaseTokenPool.Contract.IsSupportedChain(&_LockReleaseTokenPool.CallOpts, remoteChainSelector) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolCallerSession) IsSupportedChain(remoteChainSelector uint64) (bool, error) { + return _LockReleaseTokenPool.Contract.IsSupportedChain(&_LockReleaseTokenPool.CallOpts, remoteChainSelector) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolCaller) IsSupportedToken(opts *bind.CallOpts, token common.Address) (bool, error) { + var out []interface{} + err := _LockReleaseTokenPool.contract.Call(opts, &out, "isSupportedToken", token) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolSession) IsSupportedToken(token common.Address) (bool, error) { + return _LockReleaseTokenPool.Contract.IsSupportedToken(&_LockReleaseTokenPool.CallOpts, token) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolCallerSession) IsSupportedToken(token common.Address) (bool, error) { + return _LockReleaseTokenPool.Contract.IsSupportedToken(&_LockReleaseTokenPool.CallOpts, token) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolCaller) Owner(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _LockReleaseTokenPool.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 + +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolSession) Owner() (common.Address, error) { + return _LockReleaseTokenPool.Contract.Owner(&_LockReleaseTokenPool.CallOpts) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolCallerSession) Owner() (common.Address, error) { + return _LockReleaseTokenPool.Contract.Owner(&_LockReleaseTokenPool.CallOpts) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolCaller) SupportsInterface(opts *bind.CallOpts, interfaceId [4]byte) (bool, error) { + var out []interface{} + err := _LockReleaseTokenPool.contract.Call(opts, &out, "supportsInterface", interfaceId) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolSession) SupportsInterface(interfaceId [4]byte) (bool, error) { + return _LockReleaseTokenPool.Contract.SupportsInterface(&_LockReleaseTokenPool.CallOpts, interfaceId) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolCallerSession) SupportsInterface(interfaceId [4]byte) (bool, error) { + return _LockReleaseTokenPool.Contract.SupportsInterface(&_LockReleaseTokenPool.CallOpts, interfaceId) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolCaller) TypeAndVersion(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _LockReleaseTokenPool.contract.Call(opts, &out, "typeAndVersion") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolSession) TypeAndVersion() (string, error) { + return _LockReleaseTokenPool.Contract.TypeAndVersion(&_LockReleaseTokenPool.CallOpts) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolCallerSession) TypeAndVersion() (string, error) { + return _LockReleaseTokenPool.Contract.TypeAndVersion(&_LockReleaseTokenPool.CallOpts) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolTransactor) AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + return _LockReleaseTokenPool.contract.Transact(opts, "acceptOwnership") +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolSession) AcceptOwnership() (*types.Transaction, error) { + return _LockReleaseTokenPool.Contract.AcceptOwnership(&_LockReleaseTokenPool.TransactOpts) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolTransactorSession) AcceptOwnership() (*types.Transaction, error) { + return _LockReleaseTokenPool.Contract.AcceptOwnership(&_LockReleaseTokenPool.TransactOpts) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolTransactor) ApplyAllowListUpdates(opts *bind.TransactOpts, removes []common.Address, adds []common.Address) (*types.Transaction, error) { + return _LockReleaseTokenPool.contract.Transact(opts, "applyAllowListUpdates", removes, adds) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolSession) ApplyAllowListUpdates(removes []common.Address, adds []common.Address) (*types.Transaction, error) { + return _LockReleaseTokenPool.Contract.ApplyAllowListUpdates(&_LockReleaseTokenPool.TransactOpts, removes, adds) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolTransactorSession) ApplyAllowListUpdates(removes []common.Address, adds []common.Address) (*types.Transaction, error) { + return _LockReleaseTokenPool.Contract.ApplyAllowListUpdates(&_LockReleaseTokenPool.TransactOpts, removes, adds) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolTransactor) ApplyChainUpdates(opts *bind.TransactOpts, chains []TokenPoolChainUpdate) (*types.Transaction, error) { + return _LockReleaseTokenPool.contract.Transact(opts, "applyChainUpdates", chains) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolSession) ApplyChainUpdates(chains []TokenPoolChainUpdate) (*types.Transaction, error) { + return _LockReleaseTokenPool.Contract.ApplyChainUpdates(&_LockReleaseTokenPool.TransactOpts, chains) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolTransactorSession) ApplyChainUpdates(chains []TokenPoolChainUpdate) (*types.Transaction, error) { + return _LockReleaseTokenPool.Contract.ApplyChainUpdates(&_LockReleaseTokenPool.TransactOpts, chains) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolTransactor) LockOrBurn(opts *bind.TransactOpts, lockOrBurnIn PoolLockOrBurnInV1) (*types.Transaction, error) { + return _LockReleaseTokenPool.contract.Transact(opts, "lockOrBurn", lockOrBurnIn) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolSession) LockOrBurn(lockOrBurnIn PoolLockOrBurnInV1) (*types.Transaction, error) { + return _LockReleaseTokenPool.Contract.LockOrBurn(&_LockReleaseTokenPool.TransactOpts, lockOrBurnIn) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolTransactorSession) LockOrBurn(lockOrBurnIn PoolLockOrBurnInV1) (*types.Transaction, error) { + return _LockReleaseTokenPool.Contract.LockOrBurn(&_LockReleaseTokenPool.TransactOpts, lockOrBurnIn) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolTransactor) ProvideLiquidity(opts *bind.TransactOpts, amount *big.Int) (*types.Transaction, error) { + return _LockReleaseTokenPool.contract.Transact(opts, "provideLiquidity", amount) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolSession) ProvideLiquidity(amount *big.Int) (*types.Transaction, error) { + return _LockReleaseTokenPool.Contract.ProvideLiquidity(&_LockReleaseTokenPool.TransactOpts, amount) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolTransactorSession) ProvideLiquidity(amount *big.Int) (*types.Transaction, error) { + return _LockReleaseTokenPool.Contract.ProvideLiquidity(&_LockReleaseTokenPool.TransactOpts, amount) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolTransactor) ReleaseOrMint(opts *bind.TransactOpts, releaseOrMintIn PoolReleaseOrMintInV1) (*types.Transaction, error) { + return _LockReleaseTokenPool.contract.Transact(opts, "releaseOrMint", releaseOrMintIn) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolSession) ReleaseOrMint(releaseOrMintIn PoolReleaseOrMintInV1) (*types.Transaction, error) { + return _LockReleaseTokenPool.Contract.ReleaseOrMint(&_LockReleaseTokenPool.TransactOpts, releaseOrMintIn) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolTransactorSession) ReleaseOrMint(releaseOrMintIn PoolReleaseOrMintInV1) (*types.Transaction, error) { + return _LockReleaseTokenPool.Contract.ReleaseOrMint(&_LockReleaseTokenPool.TransactOpts, releaseOrMintIn) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolTransactor) SetChainRateLimiterConfig(opts *bind.TransactOpts, remoteChainSelector uint64, outboundConfig RateLimiterConfig, inboundConfig RateLimiterConfig) (*types.Transaction, error) { + return _LockReleaseTokenPool.contract.Transact(opts, "setChainRateLimiterConfig", remoteChainSelector, outboundConfig, inboundConfig) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolSession) SetChainRateLimiterConfig(remoteChainSelector uint64, outboundConfig RateLimiterConfig, inboundConfig RateLimiterConfig) (*types.Transaction, error) { + return _LockReleaseTokenPool.Contract.SetChainRateLimiterConfig(&_LockReleaseTokenPool.TransactOpts, remoteChainSelector, outboundConfig, inboundConfig) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolTransactorSession) SetChainRateLimiterConfig(remoteChainSelector uint64, outboundConfig RateLimiterConfig, inboundConfig RateLimiterConfig) (*types.Transaction, error) { + return _LockReleaseTokenPool.Contract.SetChainRateLimiterConfig(&_LockReleaseTokenPool.TransactOpts, remoteChainSelector, outboundConfig, inboundConfig) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolTransactor) SetRateLimitAdmin(opts *bind.TransactOpts, rateLimitAdmin common.Address) (*types.Transaction, error) { + return _LockReleaseTokenPool.contract.Transact(opts, "setRateLimitAdmin", rateLimitAdmin) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolSession) SetRateLimitAdmin(rateLimitAdmin common.Address) (*types.Transaction, error) { + return _LockReleaseTokenPool.Contract.SetRateLimitAdmin(&_LockReleaseTokenPool.TransactOpts, rateLimitAdmin) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolTransactorSession) SetRateLimitAdmin(rateLimitAdmin common.Address) (*types.Transaction, error) { + return _LockReleaseTokenPool.Contract.SetRateLimitAdmin(&_LockReleaseTokenPool.TransactOpts, rateLimitAdmin) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolTransactor) SetRebalancer(opts *bind.TransactOpts, rebalancer common.Address) (*types.Transaction, error) { + return _LockReleaseTokenPool.contract.Transact(opts, "setRebalancer", rebalancer) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolSession) SetRebalancer(rebalancer common.Address) (*types.Transaction, error) { + return _LockReleaseTokenPool.Contract.SetRebalancer(&_LockReleaseTokenPool.TransactOpts, rebalancer) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolTransactorSession) SetRebalancer(rebalancer common.Address) (*types.Transaction, error) { + return _LockReleaseTokenPool.Contract.SetRebalancer(&_LockReleaseTokenPool.TransactOpts, rebalancer) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolTransactor) SetRemotePool(opts *bind.TransactOpts, remoteChainSelector uint64, remotePoolAddress []byte) (*types.Transaction, error) { + return _LockReleaseTokenPool.contract.Transact(opts, "setRemotePool", remoteChainSelector, remotePoolAddress) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolSession) SetRemotePool(remoteChainSelector uint64, remotePoolAddress []byte) (*types.Transaction, error) { + return _LockReleaseTokenPool.Contract.SetRemotePool(&_LockReleaseTokenPool.TransactOpts, remoteChainSelector, remotePoolAddress) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolTransactorSession) SetRemotePool(remoteChainSelector uint64, remotePoolAddress []byte) (*types.Transaction, error) { + return _LockReleaseTokenPool.Contract.SetRemotePool(&_LockReleaseTokenPool.TransactOpts, remoteChainSelector, remotePoolAddress) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolTransactor) SetRouter(opts *bind.TransactOpts, newRouter common.Address) (*types.Transaction, error) { + return _LockReleaseTokenPool.contract.Transact(opts, "setRouter", newRouter) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolSession) SetRouter(newRouter common.Address) (*types.Transaction, error) { + return _LockReleaseTokenPool.Contract.SetRouter(&_LockReleaseTokenPool.TransactOpts, newRouter) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolTransactorSession) SetRouter(newRouter common.Address) (*types.Transaction, error) { + return _LockReleaseTokenPool.Contract.SetRouter(&_LockReleaseTokenPool.TransactOpts, newRouter) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolTransactor) TransferLiquidity(opts *bind.TransactOpts, from common.Address, amount *big.Int) (*types.Transaction, error) { + return _LockReleaseTokenPool.contract.Transact(opts, "transferLiquidity", from, amount) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolSession) TransferLiquidity(from common.Address, amount *big.Int) (*types.Transaction, error) { + return _LockReleaseTokenPool.Contract.TransferLiquidity(&_LockReleaseTokenPool.TransactOpts, from, amount) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolTransactorSession) TransferLiquidity(from common.Address, amount *big.Int) (*types.Transaction, error) { + return _LockReleaseTokenPool.Contract.TransferLiquidity(&_LockReleaseTokenPool.TransactOpts, from, amount) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolTransactor) TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) { + return _LockReleaseTokenPool.contract.Transact(opts, "transferOwnership", to) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolSession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _LockReleaseTokenPool.Contract.TransferOwnership(&_LockReleaseTokenPool.TransactOpts, to) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolTransactorSession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _LockReleaseTokenPool.Contract.TransferOwnership(&_LockReleaseTokenPool.TransactOpts, to) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolTransactor) WithdrawLiquidity(opts *bind.TransactOpts, amount *big.Int) (*types.Transaction, error) { + return _LockReleaseTokenPool.contract.Transact(opts, "withdrawLiquidity", amount) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolSession) WithdrawLiquidity(amount *big.Int) (*types.Transaction, error) { + return _LockReleaseTokenPool.Contract.WithdrawLiquidity(&_LockReleaseTokenPool.TransactOpts, amount) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolTransactorSession) WithdrawLiquidity(amount *big.Int) (*types.Transaction, error) { + return _LockReleaseTokenPool.Contract.WithdrawLiquidity(&_LockReleaseTokenPool.TransactOpts, amount) +} + +type LockReleaseTokenPoolAllowListAddIterator struct { + Event *LockReleaseTokenPoolAllowListAdd + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *LockReleaseTokenPoolAllowListAddIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolAllowListAdd) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolAllowListAdd) + 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() + } +} + +func (it *LockReleaseTokenPoolAllowListAddIterator) Error() error { + return it.fail +} + +func (it *LockReleaseTokenPoolAllowListAddIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type LockReleaseTokenPoolAllowListAdd struct { + Sender common.Address + Raw types.Log +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) FilterAllowListAdd(opts *bind.FilterOpts) (*LockReleaseTokenPoolAllowListAddIterator, error) { + + logs, sub, err := _LockReleaseTokenPool.contract.FilterLogs(opts, "AllowListAdd") + if err != nil { + return nil, err + } + return &LockReleaseTokenPoolAllowListAddIterator{contract: _LockReleaseTokenPool.contract, event: "AllowListAdd", logs: logs, sub: sub}, nil +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) WatchAllowListAdd(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolAllowListAdd) (event.Subscription, error) { + + logs, sub, err := _LockReleaseTokenPool.contract.WatchLogs(opts, "AllowListAdd") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(LockReleaseTokenPoolAllowListAdd) + if err := _LockReleaseTokenPool.contract.UnpackLog(event, "AllowListAdd", 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 +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) ParseAllowListAdd(log types.Log) (*LockReleaseTokenPoolAllowListAdd, error) { + event := new(LockReleaseTokenPoolAllowListAdd) + if err := _LockReleaseTokenPool.contract.UnpackLog(event, "AllowListAdd", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type LockReleaseTokenPoolAllowListRemoveIterator struct { + Event *LockReleaseTokenPoolAllowListRemove + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *LockReleaseTokenPoolAllowListRemoveIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolAllowListRemove) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolAllowListRemove) + 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() + } +} + +func (it *LockReleaseTokenPoolAllowListRemoveIterator) Error() error { + return it.fail +} + +func (it *LockReleaseTokenPoolAllowListRemoveIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type LockReleaseTokenPoolAllowListRemove struct { + Sender common.Address + Raw types.Log +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) FilterAllowListRemove(opts *bind.FilterOpts) (*LockReleaseTokenPoolAllowListRemoveIterator, error) { + + logs, sub, err := _LockReleaseTokenPool.contract.FilterLogs(opts, "AllowListRemove") + if err != nil { + return nil, err + } + return &LockReleaseTokenPoolAllowListRemoveIterator{contract: _LockReleaseTokenPool.contract, event: "AllowListRemove", logs: logs, sub: sub}, nil +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) WatchAllowListRemove(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolAllowListRemove) (event.Subscription, error) { + + logs, sub, err := _LockReleaseTokenPool.contract.WatchLogs(opts, "AllowListRemove") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(LockReleaseTokenPoolAllowListRemove) + if err := _LockReleaseTokenPool.contract.UnpackLog(event, "AllowListRemove", 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 +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) ParseAllowListRemove(log types.Log) (*LockReleaseTokenPoolAllowListRemove, error) { + event := new(LockReleaseTokenPoolAllowListRemove) + if err := _LockReleaseTokenPool.contract.UnpackLog(event, "AllowListRemove", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type LockReleaseTokenPoolBurnedIterator struct { + Event *LockReleaseTokenPoolBurned + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *LockReleaseTokenPoolBurnedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolBurned) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolBurned) + 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() + } +} + +func (it *LockReleaseTokenPoolBurnedIterator) Error() error { + return it.fail +} + +func (it *LockReleaseTokenPoolBurnedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type LockReleaseTokenPoolBurned struct { + Sender common.Address + Amount *big.Int + Raw types.Log +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) FilterBurned(opts *bind.FilterOpts, sender []common.Address) (*LockReleaseTokenPoolBurnedIterator, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _LockReleaseTokenPool.contract.FilterLogs(opts, "Burned", senderRule) + if err != nil { + return nil, err + } + return &LockReleaseTokenPoolBurnedIterator{contract: _LockReleaseTokenPool.contract, event: "Burned", logs: logs, sub: sub}, nil +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) WatchBurned(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolBurned, sender []common.Address) (event.Subscription, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _LockReleaseTokenPool.contract.WatchLogs(opts, "Burned", senderRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(LockReleaseTokenPoolBurned) + if err := _LockReleaseTokenPool.contract.UnpackLog(event, "Burned", 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 +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) ParseBurned(log types.Log) (*LockReleaseTokenPoolBurned, error) { + event := new(LockReleaseTokenPoolBurned) + if err := _LockReleaseTokenPool.contract.UnpackLog(event, "Burned", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type LockReleaseTokenPoolChainAddedIterator struct { + Event *LockReleaseTokenPoolChainAdded + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *LockReleaseTokenPoolChainAddedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolChainAdded) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolChainAdded) + 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() + } +} + +func (it *LockReleaseTokenPoolChainAddedIterator) Error() error { + return it.fail +} + +func (it *LockReleaseTokenPoolChainAddedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type LockReleaseTokenPoolChainAdded struct { + RemoteChainSelector uint64 + RemoteToken []byte + OutboundRateLimiterConfig RateLimiterConfig + InboundRateLimiterConfig RateLimiterConfig + Raw types.Log +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) FilterChainAdded(opts *bind.FilterOpts) (*LockReleaseTokenPoolChainAddedIterator, error) { + + logs, sub, err := _LockReleaseTokenPool.contract.FilterLogs(opts, "ChainAdded") + if err != nil { + return nil, err + } + return &LockReleaseTokenPoolChainAddedIterator{contract: _LockReleaseTokenPool.contract, event: "ChainAdded", logs: logs, sub: sub}, nil +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) WatchChainAdded(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolChainAdded) (event.Subscription, error) { + + logs, sub, err := _LockReleaseTokenPool.contract.WatchLogs(opts, "ChainAdded") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(LockReleaseTokenPoolChainAdded) + if err := _LockReleaseTokenPool.contract.UnpackLog(event, "ChainAdded", 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 +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) ParseChainAdded(log types.Log) (*LockReleaseTokenPoolChainAdded, error) { + event := new(LockReleaseTokenPoolChainAdded) + if err := _LockReleaseTokenPool.contract.UnpackLog(event, "ChainAdded", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type LockReleaseTokenPoolChainConfiguredIterator struct { + Event *LockReleaseTokenPoolChainConfigured + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *LockReleaseTokenPoolChainConfiguredIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolChainConfigured) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolChainConfigured) + 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() + } +} + +func (it *LockReleaseTokenPoolChainConfiguredIterator) Error() error { + return it.fail +} + +func (it *LockReleaseTokenPoolChainConfiguredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type LockReleaseTokenPoolChainConfigured struct { + RemoteChainSelector uint64 + OutboundRateLimiterConfig RateLimiterConfig + InboundRateLimiterConfig RateLimiterConfig + Raw types.Log +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) FilterChainConfigured(opts *bind.FilterOpts) (*LockReleaseTokenPoolChainConfiguredIterator, error) { + + logs, sub, err := _LockReleaseTokenPool.contract.FilterLogs(opts, "ChainConfigured") + if err != nil { + return nil, err + } + return &LockReleaseTokenPoolChainConfiguredIterator{contract: _LockReleaseTokenPool.contract, event: "ChainConfigured", logs: logs, sub: sub}, nil +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) WatchChainConfigured(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolChainConfigured) (event.Subscription, error) { + + logs, sub, err := _LockReleaseTokenPool.contract.WatchLogs(opts, "ChainConfigured") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(LockReleaseTokenPoolChainConfigured) + if err := _LockReleaseTokenPool.contract.UnpackLog(event, "ChainConfigured", 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 +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) ParseChainConfigured(log types.Log) (*LockReleaseTokenPoolChainConfigured, error) { + event := new(LockReleaseTokenPoolChainConfigured) + if err := _LockReleaseTokenPool.contract.UnpackLog(event, "ChainConfigured", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type LockReleaseTokenPoolChainRemovedIterator struct { + Event *LockReleaseTokenPoolChainRemoved + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *LockReleaseTokenPoolChainRemovedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolChainRemoved) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolChainRemoved) + 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() + } +} + +func (it *LockReleaseTokenPoolChainRemovedIterator) Error() error { + return it.fail +} + +func (it *LockReleaseTokenPoolChainRemovedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type LockReleaseTokenPoolChainRemoved struct { + RemoteChainSelector uint64 + Raw types.Log +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) FilterChainRemoved(opts *bind.FilterOpts) (*LockReleaseTokenPoolChainRemovedIterator, error) { + + logs, sub, err := _LockReleaseTokenPool.contract.FilterLogs(opts, "ChainRemoved") + if err != nil { + return nil, err + } + return &LockReleaseTokenPoolChainRemovedIterator{contract: _LockReleaseTokenPool.contract, event: "ChainRemoved", logs: logs, sub: sub}, nil +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) WatchChainRemoved(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolChainRemoved) (event.Subscription, error) { + + logs, sub, err := _LockReleaseTokenPool.contract.WatchLogs(opts, "ChainRemoved") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(LockReleaseTokenPoolChainRemoved) + if err := _LockReleaseTokenPool.contract.UnpackLog(event, "ChainRemoved", 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 +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) ParseChainRemoved(log types.Log) (*LockReleaseTokenPoolChainRemoved, error) { + event := new(LockReleaseTokenPoolChainRemoved) + if err := _LockReleaseTokenPool.contract.UnpackLog(event, "ChainRemoved", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type LockReleaseTokenPoolConfigChangedIterator struct { + Event *LockReleaseTokenPoolConfigChanged + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *LockReleaseTokenPoolConfigChangedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolConfigChanged) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolConfigChanged) + 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() + } +} + +func (it *LockReleaseTokenPoolConfigChangedIterator) Error() error { + return it.fail +} + +func (it *LockReleaseTokenPoolConfigChangedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type LockReleaseTokenPoolConfigChanged struct { + Config RateLimiterConfig + Raw types.Log +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) FilterConfigChanged(opts *bind.FilterOpts) (*LockReleaseTokenPoolConfigChangedIterator, error) { + + logs, sub, err := _LockReleaseTokenPool.contract.FilterLogs(opts, "ConfigChanged") + if err != nil { + return nil, err + } + return &LockReleaseTokenPoolConfigChangedIterator{contract: _LockReleaseTokenPool.contract, event: "ConfigChanged", logs: logs, sub: sub}, nil +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) WatchConfigChanged(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolConfigChanged) (event.Subscription, error) { + + logs, sub, err := _LockReleaseTokenPool.contract.WatchLogs(opts, "ConfigChanged") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(LockReleaseTokenPoolConfigChanged) + if err := _LockReleaseTokenPool.contract.UnpackLog(event, "ConfigChanged", 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 +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) ParseConfigChanged(log types.Log) (*LockReleaseTokenPoolConfigChanged, error) { + event := new(LockReleaseTokenPoolConfigChanged) + if err := _LockReleaseTokenPool.contract.UnpackLog(event, "ConfigChanged", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type LockReleaseTokenPoolLiquidityAddedIterator struct { + Event *LockReleaseTokenPoolLiquidityAdded + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *LockReleaseTokenPoolLiquidityAddedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolLiquidityAdded) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolLiquidityAdded) + 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() + } +} + +func (it *LockReleaseTokenPoolLiquidityAddedIterator) Error() error { + return it.fail +} + +func (it *LockReleaseTokenPoolLiquidityAddedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type LockReleaseTokenPoolLiquidityAdded struct { + Provider common.Address + Amount *big.Int + Raw types.Log +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) FilterLiquidityAdded(opts *bind.FilterOpts, provider []common.Address, amount []*big.Int) (*LockReleaseTokenPoolLiquidityAddedIterator, error) { + + var providerRule []interface{} + for _, providerItem := range provider { + providerRule = append(providerRule, providerItem) + } + var amountRule []interface{} + for _, amountItem := range amount { + amountRule = append(amountRule, amountItem) + } + + logs, sub, err := _LockReleaseTokenPool.contract.FilterLogs(opts, "LiquidityAdded", providerRule, amountRule) + if err != nil { + return nil, err + } + return &LockReleaseTokenPoolLiquidityAddedIterator{contract: _LockReleaseTokenPool.contract, event: "LiquidityAdded", logs: logs, sub: sub}, nil +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) WatchLiquidityAdded(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolLiquidityAdded, provider []common.Address, amount []*big.Int) (event.Subscription, error) { + + var providerRule []interface{} + for _, providerItem := range provider { + providerRule = append(providerRule, providerItem) + } + var amountRule []interface{} + for _, amountItem := range amount { + amountRule = append(amountRule, amountItem) + } + + logs, sub, err := _LockReleaseTokenPool.contract.WatchLogs(opts, "LiquidityAdded", providerRule, amountRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(LockReleaseTokenPoolLiquidityAdded) + if err := _LockReleaseTokenPool.contract.UnpackLog(event, "LiquidityAdded", 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 +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) ParseLiquidityAdded(log types.Log) (*LockReleaseTokenPoolLiquidityAdded, error) { + event := new(LockReleaseTokenPoolLiquidityAdded) + if err := _LockReleaseTokenPool.contract.UnpackLog(event, "LiquidityAdded", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type LockReleaseTokenPoolLiquidityRemovedIterator struct { + Event *LockReleaseTokenPoolLiquidityRemoved + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *LockReleaseTokenPoolLiquidityRemovedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolLiquidityRemoved) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolLiquidityRemoved) + 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() + } +} + +func (it *LockReleaseTokenPoolLiquidityRemovedIterator) Error() error { + return it.fail +} + +func (it *LockReleaseTokenPoolLiquidityRemovedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type LockReleaseTokenPoolLiquidityRemoved struct { + Provider common.Address + Amount *big.Int + Raw types.Log +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) FilterLiquidityRemoved(opts *bind.FilterOpts, provider []common.Address, amount []*big.Int) (*LockReleaseTokenPoolLiquidityRemovedIterator, error) { + + var providerRule []interface{} + for _, providerItem := range provider { + providerRule = append(providerRule, providerItem) + } + var amountRule []interface{} + for _, amountItem := range amount { + amountRule = append(amountRule, amountItem) + } + + logs, sub, err := _LockReleaseTokenPool.contract.FilterLogs(opts, "LiquidityRemoved", providerRule, amountRule) + if err != nil { + return nil, err + } + return &LockReleaseTokenPoolLiquidityRemovedIterator{contract: _LockReleaseTokenPool.contract, event: "LiquidityRemoved", logs: logs, sub: sub}, nil +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) WatchLiquidityRemoved(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolLiquidityRemoved, provider []common.Address, amount []*big.Int) (event.Subscription, error) { + + var providerRule []interface{} + for _, providerItem := range provider { + providerRule = append(providerRule, providerItem) + } + var amountRule []interface{} + for _, amountItem := range amount { + amountRule = append(amountRule, amountItem) + } + + logs, sub, err := _LockReleaseTokenPool.contract.WatchLogs(opts, "LiquidityRemoved", providerRule, amountRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(LockReleaseTokenPoolLiquidityRemoved) + if err := _LockReleaseTokenPool.contract.UnpackLog(event, "LiquidityRemoved", 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 +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) ParseLiquidityRemoved(log types.Log) (*LockReleaseTokenPoolLiquidityRemoved, error) { + event := new(LockReleaseTokenPoolLiquidityRemoved) + if err := _LockReleaseTokenPool.contract.UnpackLog(event, "LiquidityRemoved", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type LockReleaseTokenPoolLiquidityTransferredIterator struct { + Event *LockReleaseTokenPoolLiquidityTransferred + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *LockReleaseTokenPoolLiquidityTransferredIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolLiquidityTransferred) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolLiquidityTransferred) + 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() + } +} + +func (it *LockReleaseTokenPoolLiquidityTransferredIterator) Error() error { + return it.fail +} + +func (it *LockReleaseTokenPoolLiquidityTransferredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type LockReleaseTokenPoolLiquidityTransferred struct { + From common.Address + Amount *big.Int + Raw types.Log +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) FilterLiquidityTransferred(opts *bind.FilterOpts, from []common.Address) (*LockReleaseTokenPoolLiquidityTransferredIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + + logs, sub, err := _LockReleaseTokenPool.contract.FilterLogs(opts, "LiquidityTransferred", fromRule) + if err != nil { + return nil, err + } + return &LockReleaseTokenPoolLiquidityTransferredIterator{contract: _LockReleaseTokenPool.contract, event: "LiquidityTransferred", logs: logs, sub: sub}, nil +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) WatchLiquidityTransferred(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolLiquidityTransferred, from []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + + logs, sub, err := _LockReleaseTokenPool.contract.WatchLogs(opts, "LiquidityTransferred", fromRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(LockReleaseTokenPoolLiquidityTransferred) + if err := _LockReleaseTokenPool.contract.UnpackLog(event, "LiquidityTransferred", 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 +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) ParseLiquidityTransferred(log types.Log) (*LockReleaseTokenPoolLiquidityTransferred, error) { + event := new(LockReleaseTokenPoolLiquidityTransferred) + if err := _LockReleaseTokenPool.contract.UnpackLog(event, "LiquidityTransferred", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type LockReleaseTokenPoolLockedIterator struct { + Event *LockReleaseTokenPoolLocked + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *LockReleaseTokenPoolLockedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolLocked) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolLocked) + 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() + } +} + +func (it *LockReleaseTokenPoolLockedIterator) Error() error { + return it.fail +} + +func (it *LockReleaseTokenPoolLockedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type LockReleaseTokenPoolLocked struct { + Sender common.Address + Amount *big.Int + Raw types.Log +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) FilterLocked(opts *bind.FilterOpts, sender []common.Address) (*LockReleaseTokenPoolLockedIterator, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _LockReleaseTokenPool.contract.FilterLogs(opts, "Locked", senderRule) + if err != nil { + return nil, err + } + return &LockReleaseTokenPoolLockedIterator{contract: _LockReleaseTokenPool.contract, event: "Locked", logs: logs, sub: sub}, nil +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) WatchLocked(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolLocked, sender []common.Address) (event.Subscription, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _LockReleaseTokenPool.contract.WatchLogs(opts, "Locked", senderRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(LockReleaseTokenPoolLocked) + if err := _LockReleaseTokenPool.contract.UnpackLog(event, "Locked", 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 +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) ParseLocked(log types.Log) (*LockReleaseTokenPoolLocked, error) { + event := new(LockReleaseTokenPoolLocked) + if err := _LockReleaseTokenPool.contract.UnpackLog(event, "Locked", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type LockReleaseTokenPoolMintedIterator struct { + Event *LockReleaseTokenPoolMinted + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *LockReleaseTokenPoolMintedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolMinted) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolMinted) + 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() + } +} + +func (it *LockReleaseTokenPoolMintedIterator) Error() error { + return it.fail +} + +func (it *LockReleaseTokenPoolMintedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type LockReleaseTokenPoolMinted struct { + Sender common.Address + Recipient common.Address + Amount *big.Int + Raw types.Log +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) FilterMinted(opts *bind.FilterOpts, sender []common.Address, recipient []common.Address) (*LockReleaseTokenPoolMintedIterator, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + var recipientRule []interface{} + for _, recipientItem := range recipient { + recipientRule = append(recipientRule, recipientItem) + } + + logs, sub, err := _LockReleaseTokenPool.contract.FilterLogs(opts, "Minted", senderRule, recipientRule) + if err != nil { + return nil, err + } + return &LockReleaseTokenPoolMintedIterator{contract: _LockReleaseTokenPool.contract, event: "Minted", logs: logs, sub: sub}, nil +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) WatchMinted(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolMinted, sender []common.Address, recipient []common.Address) (event.Subscription, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + var recipientRule []interface{} + for _, recipientItem := range recipient { + recipientRule = append(recipientRule, recipientItem) + } + + logs, sub, err := _LockReleaseTokenPool.contract.WatchLogs(opts, "Minted", senderRule, recipientRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(LockReleaseTokenPoolMinted) + if err := _LockReleaseTokenPool.contract.UnpackLog(event, "Minted", 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 +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) ParseMinted(log types.Log) (*LockReleaseTokenPoolMinted, error) { + event := new(LockReleaseTokenPoolMinted) + if err := _LockReleaseTokenPool.contract.UnpackLog(event, "Minted", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type LockReleaseTokenPoolOwnershipTransferRequestedIterator struct { + Event *LockReleaseTokenPoolOwnershipTransferRequested + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *LockReleaseTokenPoolOwnershipTransferRequestedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolOwnershipTransferRequested) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolOwnershipTransferRequested) + 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() + } +} + +func (it *LockReleaseTokenPoolOwnershipTransferRequestedIterator) Error() error { + return it.fail +} + +func (it *LockReleaseTokenPoolOwnershipTransferRequestedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type LockReleaseTokenPoolOwnershipTransferRequested struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*LockReleaseTokenPoolOwnershipTransferRequestedIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _LockReleaseTokenPool.contract.FilterLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return &LockReleaseTokenPoolOwnershipTransferRequestedIterator{contract: _LockReleaseTokenPool.contract, event: "OwnershipTransferRequested", logs: logs, sub: sub}, nil +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _LockReleaseTokenPool.contract.WatchLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(LockReleaseTokenPoolOwnershipTransferRequested) + if err := _LockReleaseTokenPool.contract.UnpackLog(event, "OwnershipTransferRequested", 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 +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) ParseOwnershipTransferRequested(log types.Log) (*LockReleaseTokenPoolOwnershipTransferRequested, error) { + event := new(LockReleaseTokenPoolOwnershipTransferRequested) + if err := _LockReleaseTokenPool.contract.UnpackLog(event, "OwnershipTransferRequested", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type LockReleaseTokenPoolOwnershipTransferredIterator struct { + Event *LockReleaseTokenPoolOwnershipTransferred + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *LockReleaseTokenPoolOwnershipTransferredIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolOwnershipTransferred) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolOwnershipTransferred) + 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() + } +} + +func (it *LockReleaseTokenPoolOwnershipTransferredIterator) Error() error { + return it.fail +} + +func (it *LockReleaseTokenPoolOwnershipTransferredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type LockReleaseTokenPoolOwnershipTransferred struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*LockReleaseTokenPoolOwnershipTransferredIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _LockReleaseTokenPool.contract.FilterLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return &LockReleaseTokenPoolOwnershipTransferredIterator{contract: _LockReleaseTokenPool.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _LockReleaseTokenPool.contract.WatchLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(LockReleaseTokenPoolOwnershipTransferred) + if err := _LockReleaseTokenPool.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 +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) ParseOwnershipTransferred(log types.Log) (*LockReleaseTokenPoolOwnershipTransferred, error) { + event := new(LockReleaseTokenPoolOwnershipTransferred) + if err := _LockReleaseTokenPool.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type LockReleaseTokenPoolReleasedIterator struct { + Event *LockReleaseTokenPoolReleased + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *LockReleaseTokenPoolReleasedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolReleased) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolReleased) + 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() + } +} + +func (it *LockReleaseTokenPoolReleasedIterator) Error() error { + return it.fail +} + +func (it *LockReleaseTokenPoolReleasedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type LockReleaseTokenPoolReleased struct { + Sender common.Address + Recipient common.Address + Amount *big.Int + Raw types.Log +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) FilterReleased(opts *bind.FilterOpts, sender []common.Address, recipient []common.Address) (*LockReleaseTokenPoolReleasedIterator, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + var recipientRule []interface{} + for _, recipientItem := range recipient { + recipientRule = append(recipientRule, recipientItem) + } + + logs, sub, err := _LockReleaseTokenPool.contract.FilterLogs(opts, "Released", senderRule, recipientRule) + if err != nil { + return nil, err + } + return &LockReleaseTokenPoolReleasedIterator{contract: _LockReleaseTokenPool.contract, event: "Released", logs: logs, sub: sub}, nil +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) WatchReleased(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolReleased, sender []common.Address, recipient []common.Address) (event.Subscription, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + var recipientRule []interface{} + for _, recipientItem := range recipient { + recipientRule = append(recipientRule, recipientItem) + } + + logs, sub, err := _LockReleaseTokenPool.contract.WatchLogs(opts, "Released", senderRule, recipientRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(LockReleaseTokenPoolReleased) + if err := _LockReleaseTokenPool.contract.UnpackLog(event, "Released", 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 +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) ParseReleased(log types.Log) (*LockReleaseTokenPoolReleased, error) { + event := new(LockReleaseTokenPoolReleased) + if err := _LockReleaseTokenPool.contract.UnpackLog(event, "Released", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type LockReleaseTokenPoolRemotePoolSetIterator struct { + Event *LockReleaseTokenPoolRemotePoolSet + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *LockReleaseTokenPoolRemotePoolSetIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolRemotePoolSet) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolRemotePoolSet) + 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() + } +} + +func (it *LockReleaseTokenPoolRemotePoolSetIterator) Error() error { + return it.fail +} + +func (it *LockReleaseTokenPoolRemotePoolSetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type LockReleaseTokenPoolRemotePoolSet struct { + RemoteChainSelector uint64 + PreviousPoolAddress []byte + RemotePoolAddress []byte + Raw types.Log +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) FilterRemotePoolSet(opts *bind.FilterOpts, remoteChainSelector []uint64) (*LockReleaseTokenPoolRemotePoolSetIterator, error) { + + var remoteChainSelectorRule []interface{} + for _, remoteChainSelectorItem := range remoteChainSelector { + remoteChainSelectorRule = append(remoteChainSelectorRule, remoteChainSelectorItem) + } + + logs, sub, err := _LockReleaseTokenPool.contract.FilterLogs(opts, "RemotePoolSet", remoteChainSelectorRule) + if err != nil { + return nil, err + } + return &LockReleaseTokenPoolRemotePoolSetIterator{contract: _LockReleaseTokenPool.contract, event: "RemotePoolSet", logs: logs, sub: sub}, nil +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) WatchRemotePoolSet(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolRemotePoolSet, remoteChainSelector []uint64) (event.Subscription, error) { + + var remoteChainSelectorRule []interface{} + for _, remoteChainSelectorItem := range remoteChainSelector { + remoteChainSelectorRule = append(remoteChainSelectorRule, remoteChainSelectorItem) + } + + logs, sub, err := _LockReleaseTokenPool.contract.WatchLogs(opts, "RemotePoolSet", remoteChainSelectorRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(LockReleaseTokenPoolRemotePoolSet) + if err := _LockReleaseTokenPool.contract.UnpackLog(event, "RemotePoolSet", 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 +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) ParseRemotePoolSet(log types.Log) (*LockReleaseTokenPoolRemotePoolSet, error) { + event := new(LockReleaseTokenPoolRemotePoolSet) + if err := _LockReleaseTokenPool.contract.UnpackLog(event, "RemotePoolSet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type LockReleaseTokenPoolRouterUpdatedIterator struct { + Event *LockReleaseTokenPoolRouterUpdated + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *LockReleaseTokenPoolRouterUpdatedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolRouterUpdated) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolRouterUpdated) + 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() + } +} + +func (it *LockReleaseTokenPoolRouterUpdatedIterator) Error() error { + return it.fail +} + +func (it *LockReleaseTokenPoolRouterUpdatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type LockReleaseTokenPoolRouterUpdated struct { + OldRouter common.Address + NewRouter common.Address + Raw types.Log +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) FilterRouterUpdated(opts *bind.FilterOpts) (*LockReleaseTokenPoolRouterUpdatedIterator, error) { + + logs, sub, err := _LockReleaseTokenPool.contract.FilterLogs(opts, "RouterUpdated") + if err != nil { + return nil, err + } + return &LockReleaseTokenPoolRouterUpdatedIterator{contract: _LockReleaseTokenPool.contract, event: "RouterUpdated", logs: logs, sub: sub}, nil +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) WatchRouterUpdated(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolRouterUpdated) (event.Subscription, error) { + + logs, sub, err := _LockReleaseTokenPool.contract.WatchLogs(opts, "RouterUpdated") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(LockReleaseTokenPoolRouterUpdated) + if err := _LockReleaseTokenPool.contract.UnpackLog(event, "RouterUpdated", 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 +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) ParseRouterUpdated(log types.Log) (*LockReleaseTokenPoolRouterUpdated, error) { + event := new(LockReleaseTokenPoolRouterUpdated) + if err := _LockReleaseTokenPool.contract.UnpackLog(event, "RouterUpdated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type LockReleaseTokenPoolTokensConsumedIterator struct { + Event *LockReleaseTokenPoolTokensConsumed + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *LockReleaseTokenPoolTokensConsumedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolTokensConsumed) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolTokensConsumed) + 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() + } +} + +func (it *LockReleaseTokenPoolTokensConsumedIterator) Error() error { + return it.fail +} + +func (it *LockReleaseTokenPoolTokensConsumedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type LockReleaseTokenPoolTokensConsumed struct { + Tokens *big.Int + Raw types.Log +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) FilterTokensConsumed(opts *bind.FilterOpts) (*LockReleaseTokenPoolTokensConsumedIterator, error) { + + logs, sub, err := _LockReleaseTokenPool.contract.FilterLogs(opts, "TokensConsumed") + if err != nil { + return nil, err + } + return &LockReleaseTokenPoolTokensConsumedIterator{contract: _LockReleaseTokenPool.contract, event: "TokensConsumed", logs: logs, sub: sub}, nil +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) WatchTokensConsumed(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolTokensConsumed) (event.Subscription, error) { + + logs, sub, err := _LockReleaseTokenPool.contract.WatchLogs(opts, "TokensConsumed") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(LockReleaseTokenPoolTokensConsumed) + if err := _LockReleaseTokenPool.contract.UnpackLog(event, "TokensConsumed", 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 +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) ParseTokensConsumed(log types.Log) (*LockReleaseTokenPoolTokensConsumed, error) { + event := new(LockReleaseTokenPoolTokensConsumed) + if err := _LockReleaseTokenPool.contract.UnpackLog(event, "TokensConsumed", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +func (_LockReleaseTokenPool *LockReleaseTokenPool) ParseLog(log types.Log) (generated.AbigenLog, error) { + switch log.Topics[0] { + case _LockReleaseTokenPool.abi.Events["AllowListAdd"].ID: + return _LockReleaseTokenPool.ParseAllowListAdd(log) + case _LockReleaseTokenPool.abi.Events["AllowListRemove"].ID: + return _LockReleaseTokenPool.ParseAllowListRemove(log) + case _LockReleaseTokenPool.abi.Events["Burned"].ID: + return _LockReleaseTokenPool.ParseBurned(log) + case _LockReleaseTokenPool.abi.Events["ChainAdded"].ID: + return _LockReleaseTokenPool.ParseChainAdded(log) + case _LockReleaseTokenPool.abi.Events["ChainConfigured"].ID: + return _LockReleaseTokenPool.ParseChainConfigured(log) + case _LockReleaseTokenPool.abi.Events["ChainRemoved"].ID: + return _LockReleaseTokenPool.ParseChainRemoved(log) + case _LockReleaseTokenPool.abi.Events["ConfigChanged"].ID: + return _LockReleaseTokenPool.ParseConfigChanged(log) + case _LockReleaseTokenPool.abi.Events["LiquidityAdded"].ID: + return _LockReleaseTokenPool.ParseLiquidityAdded(log) + case _LockReleaseTokenPool.abi.Events["LiquidityRemoved"].ID: + return _LockReleaseTokenPool.ParseLiquidityRemoved(log) + case _LockReleaseTokenPool.abi.Events["LiquidityTransferred"].ID: + return _LockReleaseTokenPool.ParseLiquidityTransferred(log) + case _LockReleaseTokenPool.abi.Events["Locked"].ID: + return _LockReleaseTokenPool.ParseLocked(log) + case _LockReleaseTokenPool.abi.Events["Minted"].ID: + return _LockReleaseTokenPool.ParseMinted(log) + case _LockReleaseTokenPool.abi.Events["OwnershipTransferRequested"].ID: + return _LockReleaseTokenPool.ParseOwnershipTransferRequested(log) + case _LockReleaseTokenPool.abi.Events["OwnershipTransferred"].ID: + return _LockReleaseTokenPool.ParseOwnershipTransferred(log) + case _LockReleaseTokenPool.abi.Events["Released"].ID: + return _LockReleaseTokenPool.ParseReleased(log) + case _LockReleaseTokenPool.abi.Events["RemotePoolSet"].ID: + return _LockReleaseTokenPool.ParseRemotePoolSet(log) + case _LockReleaseTokenPool.abi.Events["RouterUpdated"].ID: + return _LockReleaseTokenPool.ParseRouterUpdated(log) + case _LockReleaseTokenPool.abi.Events["TokensConsumed"].ID: + return _LockReleaseTokenPool.ParseTokensConsumed(log) + + default: + return nil, fmt.Errorf("abigen wrapper received unknown log topic: %v", log.Topics[0]) + } +} + +func (LockReleaseTokenPoolAllowListAdd) Topic() common.Hash { + return common.HexToHash("0x2640d4d76caf8bf478aabfa982fa4e1c4eb71a37f93cd15e80dbc657911546d8") +} + +func (LockReleaseTokenPoolAllowListRemove) Topic() common.Hash { + return common.HexToHash("0x800671136ab6cfee9fbe5ed1fb7ca417811aca3cf864800d127b927adedf7566") +} + +func (LockReleaseTokenPoolBurned) Topic() common.Hash { + return common.HexToHash("0x696de425f79f4a40bc6d2122ca50507f0efbeabbff86a84871b7196ab8ea8df7") +} + +func (LockReleaseTokenPoolChainAdded) Topic() common.Hash { + return common.HexToHash("0x8d340f17e19058004c20453540862a9c62778504476f6756755cb33bcd6c38c2") +} + +func (LockReleaseTokenPoolChainConfigured) Topic() common.Hash { + return common.HexToHash("0x0350d63aa5f270e01729d00d627eeb8f3429772b1818c016c66a588a864f912b") +} + +func (LockReleaseTokenPoolChainRemoved) Topic() common.Hash { + return common.HexToHash("0x5204aec90a3c794d8e90fded8b46ae9c7c552803e7e832e0c1d358396d859916") +} + +func (LockReleaseTokenPoolConfigChanged) Topic() common.Hash { + return common.HexToHash("0x9ea3374b67bf275e6bb9c8ae68f9cae023e1c528b4b27e092f0bb209d3531c19") +} + +func (LockReleaseTokenPoolLiquidityAdded) Topic() common.Hash { + return common.HexToHash("0xc17cea59c2955cb181b03393209566960365771dbba9dc3d510180e7cb312088") +} + +func (LockReleaseTokenPoolLiquidityRemoved) Topic() common.Hash { + return common.HexToHash("0xc2c3f06e49b9f15e7b4af9055e183b0d73362e033ad82a07dec9bf9840171719") +} + +func (LockReleaseTokenPoolLiquidityTransferred) Topic() common.Hash { + return common.HexToHash("0x6fa7abcf1345d1d478e5ea0da6b5f26a90eadb0546ef15ed3833944fbfd1db62") +} + +func (LockReleaseTokenPoolLocked) Topic() common.Hash { + return common.HexToHash("0x9f1ec8c880f76798e7b793325d625e9b60e4082a553c98f42b6cda368dd60008") +} + +func (LockReleaseTokenPoolMinted) Topic() common.Hash { + return common.HexToHash("0x9d228d69b5fdb8d273a2336f8fb8612d039631024ea9bf09c424a9503aa078f0") +} + +func (LockReleaseTokenPoolOwnershipTransferRequested) Topic() common.Hash { + return common.HexToHash("0xed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae1278") +} + +func (LockReleaseTokenPoolOwnershipTransferred) Topic() common.Hash { + return common.HexToHash("0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0") +} + +func (LockReleaseTokenPoolReleased) Topic() common.Hash { + return common.HexToHash("0x2d87480f50083e2b2759522a8fdda59802650a8055e609a7772cf70c07748f52") +} + +func (LockReleaseTokenPoolRemotePoolSet) Topic() common.Hash { + return common.HexToHash("0xdb4d6220746a38cbc5335f7e108f7de80f482f4d23350253dfd0917df75a14bf") +} + +func (LockReleaseTokenPoolRouterUpdated) Topic() common.Hash { + return common.HexToHash("0x02dc5c233404867c793b749c6d644beb2277536d18a7e7974d3f238e4c6f1684") +} + +func (LockReleaseTokenPoolTokensConsumed) Topic() common.Hash { + return common.HexToHash("0x1871cdf8010e63f2eb8384381a68dfa7416dc571a5517e66e88b2d2d0c0a690a") +} + +func (_LockReleaseTokenPool *LockReleaseTokenPool) Address() common.Address { + return _LockReleaseTokenPool.address +} + +type LockReleaseTokenPoolInterface interface { + CanAcceptLiquidity(opts *bind.CallOpts) (bool, error) + + GetAllowList(opts *bind.CallOpts) ([]common.Address, error) + + GetAllowListEnabled(opts *bind.CallOpts) (bool, error) + + GetCurrentInboundRateLimiterState(opts *bind.CallOpts, remoteChainSelector uint64) (RateLimiterTokenBucket, error) + + GetCurrentOutboundRateLimiterState(opts *bind.CallOpts, remoteChainSelector uint64) (RateLimiterTokenBucket, error) + + GetRateLimitAdmin(opts *bind.CallOpts) (common.Address, error) + + GetRebalancer(opts *bind.CallOpts) (common.Address, error) + + GetRemotePool(opts *bind.CallOpts, remoteChainSelector uint64) ([]byte, error) + + GetRemoteToken(opts *bind.CallOpts, remoteChainSelector uint64) ([]byte, error) + + GetRmnProxy(opts *bind.CallOpts) (common.Address, error) + + GetRouter(opts *bind.CallOpts) (common.Address, error) + + GetSupportedChains(opts *bind.CallOpts) ([]uint64, error) + + GetToken(opts *bind.CallOpts) (common.Address, error) + + IsSupportedChain(opts *bind.CallOpts, remoteChainSelector uint64) (bool, error) + + IsSupportedToken(opts *bind.CallOpts, token common.Address) (bool, error) + + Owner(opts *bind.CallOpts) (common.Address, error) + + SupportsInterface(opts *bind.CallOpts, interfaceId [4]byte) (bool, error) + + TypeAndVersion(opts *bind.CallOpts) (string, error) + + AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) + + ApplyAllowListUpdates(opts *bind.TransactOpts, removes []common.Address, adds []common.Address) (*types.Transaction, error) + + ApplyChainUpdates(opts *bind.TransactOpts, chains []TokenPoolChainUpdate) (*types.Transaction, error) + + LockOrBurn(opts *bind.TransactOpts, lockOrBurnIn PoolLockOrBurnInV1) (*types.Transaction, error) + + ProvideLiquidity(opts *bind.TransactOpts, amount *big.Int) (*types.Transaction, error) + + ReleaseOrMint(opts *bind.TransactOpts, releaseOrMintIn PoolReleaseOrMintInV1) (*types.Transaction, error) + + SetChainRateLimiterConfig(opts *bind.TransactOpts, remoteChainSelector uint64, outboundConfig RateLimiterConfig, inboundConfig RateLimiterConfig) (*types.Transaction, error) + + SetRateLimitAdmin(opts *bind.TransactOpts, rateLimitAdmin common.Address) (*types.Transaction, error) + + SetRebalancer(opts *bind.TransactOpts, rebalancer common.Address) (*types.Transaction, error) + + SetRemotePool(opts *bind.TransactOpts, remoteChainSelector uint64, remotePoolAddress []byte) (*types.Transaction, error) + + SetRouter(opts *bind.TransactOpts, newRouter common.Address) (*types.Transaction, error) + + TransferLiquidity(opts *bind.TransactOpts, from common.Address, amount *big.Int) (*types.Transaction, error) + + TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) + + WithdrawLiquidity(opts *bind.TransactOpts, amount *big.Int) (*types.Transaction, error) + + FilterAllowListAdd(opts *bind.FilterOpts) (*LockReleaseTokenPoolAllowListAddIterator, error) + + WatchAllowListAdd(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolAllowListAdd) (event.Subscription, error) + + ParseAllowListAdd(log types.Log) (*LockReleaseTokenPoolAllowListAdd, error) + + FilterAllowListRemove(opts *bind.FilterOpts) (*LockReleaseTokenPoolAllowListRemoveIterator, error) + + WatchAllowListRemove(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolAllowListRemove) (event.Subscription, error) + + ParseAllowListRemove(log types.Log) (*LockReleaseTokenPoolAllowListRemove, error) + + FilterBurned(opts *bind.FilterOpts, sender []common.Address) (*LockReleaseTokenPoolBurnedIterator, error) + + WatchBurned(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolBurned, sender []common.Address) (event.Subscription, error) + + ParseBurned(log types.Log) (*LockReleaseTokenPoolBurned, error) + + FilterChainAdded(opts *bind.FilterOpts) (*LockReleaseTokenPoolChainAddedIterator, error) + + WatchChainAdded(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolChainAdded) (event.Subscription, error) + + ParseChainAdded(log types.Log) (*LockReleaseTokenPoolChainAdded, error) + + FilterChainConfigured(opts *bind.FilterOpts) (*LockReleaseTokenPoolChainConfiguredIterator, error) + + WatchChainConfigured(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolChainConfigured) (event.Subscription, error) + + ParseChainConfigured(log types.Log) (*LockReleaseTokenPoolChainConfigured, error) + + FilterChainRemoved(opts *bind.FilterOpts) (*LockReleaseTokenPoolChainRemovedIterator, error) + + WatchChainRemoved(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolChainRemoved) (event.Subscription, error) + + ParseChainRemoved(log types.Log) (*LockReleaseTokenPoolChainRemoved, error) + + FilterConfigChanged(opts *bind.FilterOpts) (*LockReleaseTokenPoolConfigChangedIterator, error) + + WatchConfigChanged(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolConfigChanged) (event.Subscription, error) + + ParseConfigChanged(log types.Log) (*LockReleaseTokenPoolConfigChanged, error) + + FilterLiquidityAdded(opts *bind.FilterOpts, provider []common.Address, amount []*big.Int) (*LockReleaseTokenPoolLiquidityAddedIterator, error) + + WatchLiquidityAdded(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolLiquidityAdded, provider []common.Address, amount []*big.Int) (event.Subscription, error) + + ParseLiquidityAdded(log types.Log) (*LockReleaseTokenPoolLiquidityAdded, error) + + FilterLiquidityRemoved(opts *bind.FilterOpts, provider []common.Address, amount []*big.Int) (*LockReleaseTokenPoolLiquidityRemovedIterator, error) + + WatchLiquidityRemoved(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolLiquidityRemoved, provider []common.Address, amount []*big.Int) (event.Subscription, error) + + ParseLiquidityRemoved(log types.Log) (*LockReleaseTokenPoolLiquidityRemoved, error) + + FilterLiquidityTransferred(opts *bind.FilterOpts, from []common.Address) (*LockReleaseTokenPoolLiquidityTransferredIterator, error) + + WatchLiquidityTransferred(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolLiquidityTransferred, from []common.Address) (event.Subscription, error) + + ParseLiquidityTransferred(log types.Log) (*LockReleaseTokenPoolLiquidityTransferred, error) + + FilterLocked(opts *bind.FilterOpts, sender []common.Address) (*LockReleaseTokenPoolLockedIterator, error) + + WatchLocked(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolLocked, sender []common.Address) (event.Subscription, error) + + ParseLocked(log types.Log) (*LockReleaseTokenPoolLocked, error) + + FilterMinted(opts *bind.FilterOpts, sender []common.Address, recipient []common.Address) (*LockReleaseTokenPoolMintedIterator, error) + + WatchMinted(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolMinted, sender []common.Address, recipient []common.Address) (event.Subscription, error) + + ParseMinted(log types.Log) (*LockReleaseTokenPoolMinted, error) + + FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*LockReleaseTokenPoolOwnershipTransferRequestedIterator, error) + + WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferRequested(log types.Log) (*LockReleaseTokenPoolOwnershipTransferRequested, error) + + FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*LockReleaseTokenPoolOwnershipTransferredIterator, error) + + WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferred(log types.Log) (*LockReleaseTokenPoolOwnershipTransferred, error) + + FilterReleased(opts *bind.FilterOpts, sender []common.Address, recipient []common.Address) (*LockReleaseTokenPoolReleasedIterator, error) + + WatchReleased(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolReleased, sender []common.Address, recipient []common.Address) (event.Subscription, error) + + ParseReleased(log types.Log) (*LockReleaseTokenPoolReleased, error) + + FilterRemotePoolSet(opts *bind.FilterOpts, remoteChainSelector []uint64) (*LockReleaseTokenPoolRemotePoolSetIterator, error) + + WatchRemotePoolSet(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolRemotePoolSet, remoteChainSelector []uint64) (event.Subscription, error) + + ParseRemotePoolSet(log types.Log) (*LockReleaseTokenPoolRemotePoolSet, error) + + FilterRouterUpdated(opts *bind.FilterOpts) (*LockReleaseTokenPoolRouterUpdatedIterator, error) + + WatchRouterUpdated(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolRouterUpdated) (event.Subscription, error) + + ParseRouterUpdated(log types.Log) (*LockReleaseTokenPoolRouterUpdated, error) + + FilterTokensConsumed(opts *bind.FilterOpts) (*LockReleaseTokenPoolTokensConsumedIterator, error) + + WatchTokensConsumed(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolTokensConsumed) (event.Subscription, error) + + ParseTokensConsumed(log types.Log) (*LockReleaseTokenPoolTokensConsumed, error) + + ParseLog(log types.Log) (generated.AbigenLog, error) + + Address() common.Address +} diff --git a/core/gethwrappers/ccip/generated/lock_release_token_pool_1_0_0/lock_release_token_pool.go b/core/gethwrappers/ccip/generated/lock_release_token_pool_1_0_0/lock_release_token_pool.go new file mode 100644 index 00000000000..30ea97eb99e --- /dev/null +++ b/core/gethwrappers/ccip/generated/lock_release_token_pool_1_0_0/lock_release_token_pool.go @@ -0,0 +1,2892 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package lock_release_token_pool_1_0_0 + +import ( + "errors" + "fmt" + "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" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" +) + +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +type RateLimiterConfig struct { + IsEnabled bool + Capacity *big.Int + Rate *big.Int +} + +type RateLimiterTokenBucket struct { + Tokens *big.Int + LastUpdated uint32 + IsEnabled bool + Capacity *big.Int + Rate *big.Int +} + +type TokenPoolRampUpdate struct { + Ramp common.Address + Allowed bool + RateLimiterConfig RateLimiterConfig +} + +var LockReleaseTokenPoolMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"internalType\":\"contractIERC20\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"allowlist\",\"type\":\"address[]\"},{\"internalType\":\"address\",\"name\":\"armProxy\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"capacity\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"requested\",\"type\":\"uint256\"}],\"name\":\"AggregateValueMaxCapacityExceeded\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"minWaitInSeconds\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"available\",\"type\":\"uint256\"}],\"name\":\"AggregateValueRateLimitReached\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"AllowListNotEnabled\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"BadARMSignal\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"BucketOverfilled\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InsufficientLiquidity\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"ramp\",\"type\":\"address\"}],\"name\":\"NonExistentRamp\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"PermissionsError\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"ramp\",\"type\":\"address\"}],\"name\":\"RampAlreadyExists\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"SenderNotAllowed\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"capacity\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"requested\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"}],\"name\":\"TokenMaxCapacityExceeded\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"minWaitInSeconds\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"available\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"}],\"name\":\"TokenRateLimitReached\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"WithdrawalTooHigh\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddressNotAllowed\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"AllowListAdd\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"AllowListRemove\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Burned\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"provider\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"LiquidityAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"provider\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"LiquidityRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Locked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Minted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"offRamp\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"indexed\":false,\"internalType\":\"structRateLimiter.Config\",\"name\":\"rateLimiterConfig\",\"type\":\"tuple\"}],\"name\":\"OffRampAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"offRamp\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"indexed\":false,\"internalType\":\"structRateLimiter.Config\",\"name\":\"rateLimiterConfig\",\"type\":\"tuple\"}],\"name\":\"OffRampConfigured\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"offRamp\",\"type\":\"address\"}],\"name\":\"OffRampRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"onRamp\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"indexed\":false,\"internalType\":\"structRateLimiter.Config\",\"name\":\"rateLimiterConfig\",\"type\":\"tuple\"}],\"name\":\"OnRampAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"onRamp\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"indexed\":false,\"internalType\":\"structRateLimiter.Config\",\"name\":\"rateLimiterConfig\",\"type\":\"tuple\"}],\"name\":\"OnRampConfigured\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"onRamp\",\"type\":\"address\"}],\"name\":\"OnRampRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Released\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"addLiquidity\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"removes\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"adds\",\"type\":\"address[]\"}],\"name\":\"applyAllowListUpdates\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"ramp\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"allowed\",\"type\":\"bool\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"rateLimiterConfig\",\"type\":\"tuple\"}],\"internalType\":\"structTokenPool.RampUpdate[]\",\"name\":\"onRamps\",\"type\":\"tuple[]\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"ramp\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"allowed\",\"type\":\"bool\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"rateLimiterConfig\",\"type\":\"tuple\"}],\"internalType\":\"structTokenPool.RampUpdate[]\",\"name\":\"offRamps\",\"type\":\"tuple[]\"}],\"name\":\"applyRampUpdates\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"offRamp\",\"type\":\"address\"}],\"name\":\"currentOffRampRateLimiterState\",\"outputs\":[{\"components\":[{\"internalType\":\"uint128\",\"name\":\"tokens\",\"type\":\"uint128\"},{\"internalType\":\"uint32\",\"name\":\"lastUpdated\",\"type\":\"uint32\"},{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.TokenBucket\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"onRamp\",\"type\":\"address\"}],\"name\":\"currentOnRampRateLimiterState\",\"outputs\":[{\"components\":[{\"internalType\":\"uint128\",\"name\":\"tokens\",\"type\":\"uint128\"},{\"internalType\":\"uint32\",\"name\":\"lastUpdated\",\"type\":\"uint32\"},{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.TokenBucket\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAllowList\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAllowListEnabled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getArmProxy\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"armProxy\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getLockReleaseInterfaceId\",\"outputs\":[{\"internalType\":\"bytes4\",\"name\":\"\",\"type\":\"bytes4\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getOffRamps\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getOnRamps\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"provider\",\"type\":\"address\"}],\"name\":\"getProvidedLiquidity\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getToken\",\"outputs\":[{\"internalType\":\"contractIERC20\",\"name\":\"token\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"offRamp\",\"type\":\"address\"}],\"name\":\"isOffRamp\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"onRamp\",\"type\":\"address\"}],\"name\":\"isOnRamp\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"originalSender\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"lockOrBurn\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"releaseOrMint\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"removeLiquidity\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"offRamp\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"config\",\"type\":\"tuple\"}],\"name\":\"setOffRampRateLimiterConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"onRamp\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"config\",\"type\":\"tuple\"}],\"name\":\"setOnRampRateLimiterConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", + Bin: "0x60e06040523480156200001157600080fd5b50604051620036093803806200360983398101604081905262000034916200051d565b82828233806000816200008e5760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000c157620000c18162000133565b5050506001600160a01b038316620000ec576040516342bcdf7f60e11b815260040160405180910390fd5b6001600160a01b03808416608052811660a052815115801560c0526200012757604080516000815260208101909152620001279083620001de565b5050505050506200068e565b336001600160a01b038216036200018d5760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640162000085565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b60c051620001ff576040516335f4a7b360e01b815260040160405180910390fd5b60005b8251811015620002945760008382815181106200022357620002236200061a565b602090810291909101015190506200023d6002826200034f565b1562000280576040516001600160a01b03821681527f800671136ab6cfee9fbe5ed1fb7ca417811aca3cf864800d127b927adedf75669060200160405180910390a15b506200028c8162000646565b905062000202565b5060005b81518110156200034a576000828281518110620002b957620002b96200061a565b6020026020010151905060006001600160a01b0316816001600160a01b031603620002e5575062000337565b620002f26002826200036f565b1562000335576040516001600160a01b03821681527f2640d4d76caf8bf478aabfa982fa4e1c4eb71a37f93cd15e80dbc657911546d89060200160405180910390a15b505b620003428162000646565b905062000298565b505050565b600062000366836001600160a01b03841662000386565b90505b92915050565b600062000366836001600160a01b0384166200048a565b600081815260018301602052604081205480156200047f576000620003ad60018362000662565b8554909150600090620003c39060019062000662565b90508181146200042f576000866000018281548110620003e757620003e76200061a565b90600052602060002001549050808760000184815481106200040d576200040d6200061a565b6000918252602080832090910192909255918252600188019052604090208390555b855486908062000443576200044362000678565b60019003818190600052602060002001600090559055856001016000868152602001908152602001600020600090556001935050505062000369565b600091505062000369565b6000818152600183016020526040812054620004d35750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915562000369565b50600062000369565b6001600160a01b0381168114620004f257600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b80516200051881620004dc565b919050565b6000806000606084860312156200053357600080fd5b83516200054081620004dc565b602085810151919450906001600160401b03808211156200056057600080fd5b818701915087601f8301126200057557600080fd5b8151818111156200058a576200058a620004f5565b8060051b604051601f19603f83011681018181108582111715620005b257620005b2620004f5565b60405291825284820192508381018501918a831115620005d157600080fd5b938501935b82851015620005fa57620005ea856200050b565b84529385019392850192620005d6565b80975050505050505062000611604085016200050b565b90509250925092565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016200065b576200065b62000630565b5060010190565b8181038181111562000369576200036962000630565b634e487b7160e01b600052603160045260246000fd5b60805160a05160c051612f05620007046000396000818161044001528181610aa10152611212015260008181610236015281816108ea0152610b250152600081816101da015281816104fa015281816109d101528181610cbc01528181610db30152818161165201526116ef0152612f056000f3fe608060405234801561001057600080fd5b50600436106101985760003560e01c806387381314116100e3578063a7cd63b71161008c578063d612b94511610066578063d612b9451461042b578063e0351e131461043e578063f2fde38b1461046457600080fd5b8063a7cd63b7146103fd578063b3a3fb4114610405578063c49907b51461041857600080fd5b806396875445116100bd57806396875445146103c25780639c8f9f23146103e2578063a40e69c7146103f557600080fd5b806387381314146103615780638bfca18c146103765780638da5cb5b146103a457600080fd5b806356dd1e81116101455780637787e7ab1161011f5780637787e7ab146102d757806379ba5097146103465780638627fad61461034e57600080fd5b806356dd1e811461026d5780636f32b872146102b15780637448b3c7146102c457600080fd5b806351c6590a1161017657806351c6590a1461021f5780635246492f1461023457806354c8a4f31461025a57600080fd5b806301ffc9a71461019d5780631d7a74a0146101c557806321df0da7146101d8575b600080fd5b6101b06101ab366004612670565b610477565b60405190151581526020015b60405180910390f35b6101b06101d33660046126db565b6104d3565b7f00000000000000000000000000000000000000000000000000000000000000005b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101bc565b61023261022d3660046126f6565b6104e0565b005b7f00000000000000000000000000000000000000000000000000000000000000006101fa565b61023261026836600461275b565b610576565b6102a361027b3660046126db565b73ffffffffffffffffffffffffffffffffffffffff166000908152600a602052604090205490565b6040519081526020016101bc565b6101b06102bf3660046126db565b6105f1565b6102326102d236600461289e565b6105fe565b6102ea6102e53660046126db565b6106ce565b6040516101bc919081516fffffffffffffffffffffffffffffffff908116825260208084015163ffffffff1690830152604080840151151590830152606080840151821690830152608092830151169181019190915260a00190565b6102326107ac565b61023261035c366004612995565b6108a9565b610369610a4c565b6040516101bc9190612a24565b6040517f98a471770000000000000000000000000000000000000000000000000000000081526020016101bc565b60005473ffffffffffffffffffffffffffffffffffffffff166101fa565b6103d56103d0366004612ac0565b610a5d565b6040516101bc9190612bcc565b6102326103f03660046126f6565b610c43565b610369610e0a565b610369610e16565b6102ea6104133660046126db565b610e22565b610232610426366004612c24565b610f00565b61023261043936600461289e565b610f14565b7f00000000000000000000000000000000000000000000000000000000000000006101b0565b6102326104723660046126db565b610fd3565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f98a471770000000000000000000000000000000000000000000000000000000014806104cd57506104cd82610fe7565b92915050565b60006104cd60078361107f565b61052273ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000163330846110b1565b336000908152600a602052604081208054839290610541908490612cb3565b9091555050604051819033907fc17cea59c2955cb181b03393209566960365771dbba9dc3d510180e7cb31208890600090a350565b61057e61118d565b6105eb8484808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152505060408051602080880282810182019093528782529093508792508691829185019084908082843760009201919091525061121092505050565b50505050565b60006104cd60048361107f565b61060661118d565b61060f826105f1565b610662576040517f498f12f600000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff831660048201526024015b60405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8216600090815260066020526040902061069190826113db565b7f578db78e348076074dbff64a94073a83e9a65aa6766b8c75fdc89282b0e30ed682826040516106c2929190612cc6565b60405180910390a15050565b6040805160a08101825260008082526020820181905291810182905260608101829052608081019190915273ffffffffffffffffffffffffffffffffffffffff8216600090815260066020908152604091829020825160a08101845281546fffffffffffffffffffffffffffffffff808216835270010000000000000000000000000000000080830463ffffffff16958401959095527401000000000000000000000000000000000000000090910460ff1615159482019490945260019091015480841660608301529190910490911660808201526104cd9061158a565b60015473ffffffffffffffffffffffffffffffffffffffff16331461082d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e6572000000000000000000006044820152606401610659565b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b6108b2336104d3565b6108e8576040517f5307f5ab00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663397796f76040518163ffffffff1660e01b8152600401602060405180830381865afa158015610953573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109779190612d1e565b156109ae576040517fc148371500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6109b78361163c565b6109f873ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168585611676565b60405183815273ffffffffffffffffffffffffffffffffffffffff85169033907f2d87480f50083e2b2759522a8fdda59802650a8055e609a7772cf70c07748f529060200160405180910390a35050505050565b6060610a5860046116cc565b905090565b6060610a68336105f1565b610a9e576040517f5307f5ab00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b877f00000000000000000000000000000000000000000000000000000000000000008015610ad45750610ad260028261107f565b155b15610b23576040517fd0d2597600000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff82166004820152602401610659565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663397796f76040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b8e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bb29190612d1e565b15610be9576040517fc148371500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610bf2866116d9565b60405186815233907f9f1ec8c880f76798e7b793325d625e9b60e4082a553c98f42b6cda368dd600089060200160405180910390a25050604080516020810190915260008152979650505050505050565b336000908152600a6020526040902054811115610c8c576040517f6982012000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015281907f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16906370a0823190602401602060405180830381865afa158015610d18573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d3c9190612d3b565b1015610d74576040517fbb55fd2700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b336000908152600a602052604081208054839290610d93908490612d54565b90915550610dda905073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000163383611676565b604051819033907fc2c3f06e49b9f15e7b4af9055e183b0d73362e033ad82a07dec9bf984017171990600090a350565b6060610a5860076116cc565b6060610a5860026116cc565b6040805160a08101825260008082526020820181905291810182905260608101829052608081019190915273ffffffffffffffffffffffffffffffffffffffff8216600090815260096020908152604091829020825160a08101845281546fffffffffffffffffffffffffffffffff808216835270010000000000000000000000000000000080830463ffffffff16958401959095527401000000000000000000000000000000000000000090910460ff1615159482019490945260019091015480841660608301529190910490911660808201526104cd9061158a565b610f0861118d565b6105eb84848484611713565b610f1c61118d565b610f25826104d3565b610f73576040517f498f12f600000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff83166004820152602401610659565b73ffffffffffffffffffffffffffffffffffffffff82166000908152600960205260409020610fa290826113db565b7fb3ba339cfbb8ef80d7a29ce5493051cb90e64fcfa85d7124efc1adfa4c68399f82826040516106c2929190612cc6565b610fdb61118d565b610fe481611cc3565b50565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f317fa3340000000000000000000000000000000000000000000000000000000014806104cd57507fffffffff0000000000000000000000000000000000000000000000000000000082167f01ffc9a7000000000000000000000000000000000000000000000000000000001492915050565b73ffffffffffffffffffffffffffffffffffffffff8116600090815260018301602052604081205415155b9392505050565b60405173ffffffffffffffffffffffffffffffffffffffff808516602483015283166044820152606481018290526105eb9085907f23b872dd00000000000000000000000000000000000000000000000000000000906084015b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152611db8565b60005473ffffffffffffffffffffffffffffffffffffffff16331461120e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e6572000000000000000000006044820152606401610659565b565b7f0000000000000000000000000000000000000000000000000000000000000000611267576040517f35f4a7b300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b825181101561130557600083828151811061128757611287612d67565b602002602001015190506112a5816002611ec490919063ffffffff16565b156112f45760405173ffffffffffffffffffffffffffffffffffffffff821681527f800671136ab6cfee9fbe5ed1fb7ca417811aca3cf864800d127b927adedf75669060200160405180910390a15b506112fe81612d96565b905061126a565b5060005b81518110156113d657600082828151811061132657611326612d67565b60200260200101519050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff160361136a57506113c6565b611375600282611ee6565b156113c45760405173ffffffffffffffffffffffffffffffffffffffff821681527f2640d4d76caf8bf478aabfa982fa4e1c4eb71a37f93cd15e80dbc657911546d89060200160405180910390a15b505b6113cf81612d96565b9050611309565b505050565b815460009061140490700100000000000000000000000000000000900463ffffffff1642612d54565b905080156114a6576001830154835461144c916fffffffffffffffffffffffffffffffff80821692811691859170010000000000000000000000000000000090910416611f08565b83546fffffffffffffffffffffffffffffffff919091167fffffffffffffffffffffffff0000000000000000000000000000000000000000909116177001000000000000000000000000000000004263ffffffff16021783555b602082015183546114cc916fffffffffffffffffffffffffffffffff9081169116611f32565b83548351151574010000000000000000000000000000000000000000027fffffffffffffffffffffff00ffffffff000000000000000000000000000000009091166fffffffffffffffffffffffffffffffff92831617178455602083015160408085015183167001000000000000000000000000000000000291909216176001850155517f9ea3374b67bf275e6bb9c8ae68f9cae023e1c528b4b27e092f0bb209d3531c199061157d908490612dce565b60405180910390a1505050565b6040805160a08101825260008082526020820181905291810182905260608101829052608081019190915261161882606001516fffffffffffffffffffffffffffffffff1683600001516fffffffffffffffffffffffffffffffff16846020015163ffffffff16426115fc9190612d54565b85608001516fffffffffffffffffffffffffffffffff16611f08565b6fffffffffffffffffffffffffffffffff1682525063ffffffff4216602082015290565b336000908152600960205260409020610fe490827f0000000000000000000000000000000000000000000000000000000000000000611f48565b60405173ffffffffffffffffffffffffffffffffffffffff83166024820152604481018290526113d69084907fa9059cbb000000000000000000000000000000000000000000000000000000009060640161110b565b606060006110aa836122cb565b336000908152600660205260409020610fe490827f0000000000000000000000000000000000000000000000000000000000000000611f48565b61171b61118d565b60005b83811015611a3857600085858381811061173a5761173a612d67565b905060a002018036038101906117509190612e0a565b905080602001511561192857805161176a90600490611ee6565b156118db576040805160a08101825282820180516020908101516fffffffffffffffffffffffffffffffff908116845263ffffffff4281168386019081528451511515868801908152855185015184166060880190815286518901518516608089019081528a5173ffffffffffffffffffffffffffffffffffffffff1660009081526006909752958990209751885493519251151574010000000000000000000000000000000000000000027fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff939095167001000000000000000000000000000000009081027fffffffffffffffffffffffff0000000000000000000000000000000000000000909516918716919091179390931791909116929092178655905192518216029116176001909201919091558251905191517f0b594bb0555ff7b252e0c789ccc9d8903fec294172064308727d570505cee1ac926118ce9291612cc6565b60405180910390a1611a27565b80516040517fd3eb6bc500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9091166004820152602401610659565b805161193690600490611ec4565b156119da57805173ffffffffffffffffffffffffffffffffffffffff1660009081526006602052604080822080547fffffffffffffffffffffff00000000000000000000000000000000000000000016815560010191909155815190517f7fd064821314ad863a0714a3f1229375ace6b6427ed5544b7b2ba1c47b1b5294916118ce9173ffffffffffffffffffffffffffffffffffffffff91909116815260200190565b80516040517f498f12f600000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9091166004820152602401610659565b50611a3181612d96565b905061171e565b5060005b81811015611cbc576000838383818110611a5857611a58612d67565b905060a00201803603810190611a6e9190612e0a565b9050806020015115611bf9578051611a8890600790611ee6565b156118db576040805160a08101825282820180516020908101516fffffffffffffffffffffffffffffffff908116845263ffffffff4281168386019081528451511515868801908152855185015184166060880190815286518901518516608089019081528a5173ffffffffffffffffffffffffffffffffffffffff1660009081526009909752958990209751885493519251151574010000000000000000000000000000000000000000027fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff939095167001000000000000000000000000000000009081027fffffffffffffffffffffffff0000000000000000000000000000000000000000909516918716919091179390931791909116929092178655905192518216029116176001909201919091558251905191517f395b7374909d2b54e5796f53c898ebf41d767c86c78ea86519acf2b805852d8892611bec9291612cc6565b60405180910390a1611cab565b8051611c0790600790611ec4565b156119da57805173ffffffffffffffffffffffffffffffffffffffff1660009081526009602052604080822080547fffffffffffffffffffffff00000000000000000000000000000000000000000016815560010191909155815190517fcf91daec21e3510e2f2aea4b09d08c235d5c6844980be709f282ef591dbf420c91611bec9173ffffffffffffffffffffffffffffffffffffffff91909116815260200190565b50611cb581612d96565b9050611a3c565b5050505050565b3373ffffffffffffffffffffffffffffffffffffffff821603611d42576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c660000000000000000006044820152606401610659565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b6000611e1a826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166123279092919063ffffffff16565b8051909150156113d65780806020019051810190611e389190612d1e565b6113d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610659565b60006110aa8373ffffffffffffffffffffffffffffffffffffffff8416612336565b60006110aa8373ffffffffffffffffffffffffffffffffffffffff8416612429565b6000611f2785611f188486612e5b565b611f229087612cb3565b611f32565b90505b949350505050565b6000818310611f4157816110aa565b5090919050565b825474010000000000000000000000000000000000000000900460ff161580611f6f575081155b15611f7957505050565b825460018401546fffffffffffffffffffffffffffffffff80831692911690600090611fbf90700100000000000000000000000000000000900463ffffffff1642612d54565b9050801561207f5781831115612001576040517f9725942a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600186015461203b9083908590849070010000000000000000000000000000000090046fffffffffffffffffffffffffffffffff16611f08565b86547fffffffffffffffffffffffff00000000ffffffffffffffffffffffffffffffff167001000000000000000000000000000000004263ffffffff160217875592505b848210156121365773ffffffffffffffffffffffffffffffffffffffff84166120de576040517ff94ebcd10000000000000000000000000000000000000000000000000000000081526004810183905260248101869052604401610659565b6040517f1a76572a000000000000000000000000000000000000000000000000000000008152600481018390526024810186905273ffffffffffffffffffffffffffffffffffffffff85166044820152606401610659565b848310156122495760018681015470010000000000000000000000000000000090046fffffffffffffffffffffffffffffffff1690600090829061217a9082612d54565b612184878a612d54565b61218e9190612cb3565b6121989190612e72565b905073ffffffffffffffffffffffffffffffffffffffff86166121f1576040517f15279c080000000000000000000000000000000000000000000000000000000081526004810182905260248101869052604401610659565b6040517fd0c8d23a000000000000000000000000000000000000000000000000000000008152600481018290526024810186905273ffffffffffffffffffffffffffffffffffffffff87166044820152606401610659565b6122538584612d54565b86547fffffffffffffffffffffffffffffffff00000000000000000000000000000000166fffffffffffffffffffffffffffffffff82161787556040518681529093507f1871cdf8010e63f2eb8384381a68dfa7416dc571a5517e66e88b2d2d0c0a690a9060200160405180910390a1505050505050565b60608160000180548060200260200160405190810160405280929190818152602001828054801561231b57602002820191906000526020600020905b815481526020019060010190808311612307575b50505050509050919050565b6060611f2a8484600085612478565b6000818152600183016020526040812054801561241f57600061235a600183612d54565b855490915060009061236e90600190612d54565b90508181146123d357600086600001828154811061238e5761238e612d67565b90600052602060002001549050808760000184815481106123b1576123b1612d67565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806123e4576123e4612ead565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506104cd565b60009150506104cd565b6000818152600183016020526040812054612470575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556104cd565b5060006104cd565b60608247101561250a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610659565b6000808673ffffffffffffffffffffffffffffffffffffffff1685876040516125339190612edc565b60006040518083038185875af1925050503d8060008114612570576040519150601f19603f3d011682016040523d82523d6000602084013e612575565b606091505b509150915061258687838387612591565b979650505050505050565b606083156126275782516000036126205773ffffffffffffffffffffffffffffffffffffffff85163b612620576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610659565b5081611f2a565b611f2a838381511561263c5781518083602001fd5b806040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106599190612bcc565b60006020828403121561268257600080fd5b81357fffffffff00000000000000000000000000000000000000000000000000000000811681146110aa57600080fd5b803573ffffffffffffffffffffffffffffffffffffffff811681146126d657600080fd5b919050565b6000602082840312156126ed57600080fd5b6110aa826126b2565b60006020828403121561270857600080fd5b5035919050565b60008083601f84011261272157600080fd5b50813567ffffffffffffffff81111561273957600080fd5b6020830191508360208260051b850101111561275457600080fd5b9250929050565b6000806000806040858703121561277157600080fd5b843567ffffffffffffffff8082111561278957600080fd5b6127958883890161270f565b909650945060208701359150808211156127ae57600080fd5b506127bb8782880161270f565b95989497509550505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040516060810167ffffffffffffffff81118282101715612819576128196127c7565b60405290565b8015158114610fe457600080fd5b80356fffffffffffffffffffffffffffffffff811681146126d657600080fd5b60006060828403121561285f57600080fd5b6128676127f6565b905081356128748161281f565b81526128826020830161282d565b60208201526128936040830161282d565b604082015292915050565b600080608083850312156128b157600080fd5b6128ba836126b2565b91506128c9846020850161284d565b90509250929050565b600082601f8301126128e357600080fd5b813567ffffffffffffffff808211156128fe576128fe6127c7565b604051601f83017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f01168101908282118183101715612944576129446127c7565b8160405283815286602085880101111561295d57600080fd5b836020870160208301376000602085830101528094505050505092915050565b803567ffffffffffffffff811681146126d657600080fd5b600080600080600060a086880312156129ad57600080fd5b853567ffffffffffffffff808211156129c557600080fd5b6129d189838a016128d2565b96506129df602089016126b2565b9550604088013594506129f46060890161297d565b93506080880135915080821115612a0a57600080fd5b50612a17888289016128d2565b9150509295509295909350565b6020808252825182820181905260009190848201906040850190845b81811015612a7257835173ffffffffffffffffffffffffffffffffffffffff1683529284019291840191600101612a40565b50909695505050505050565b60008083601f840112612a9057600080fd5b50813567ffffffffffffffff811115612aa857600080fd5b60208301915083602082850101111561275457600080fd5b600080600080600080600060a0888a031215612adb57600080fd5b612ae4886126b2565b9650602088013567ffffffffffffffff80821115612b0157600080fd5b612b0d8b838c01612a7e565b909850965060408a01359550869150612b2860608b0161297d565b945060808a0135915080821115612b3e57600080fd5b50612b4b8a828b01612a7e565b989b979a50959850939692959293505050565b60005b83811015612b79578181015183820152602001612b61565b50506000910152565b60008151808452612b9a816020860160208601612b5e565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b6020815260006110aa6020830184612b82565b60008083601f840112612bf157600080fd5b50813567ffffffffffffffff811115612c0957600080fd5b60208301915083602060a08302850101111561275457600080fd5b60008060008060408587031215612c3a57600080fd5b843567ffffffffffffffff80821115612c5257600080fd5b612c5e88838901612bdf565b90965094506020870135915080821115612c7757600080fd5b506127bb87828801612bdf565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b808201808211156104cd576104cd612c84565b73ffffffffffffffffffffffffffffffffffffffff83168152608081016110aa60208301848051151582526020808201516fffffffffffffffffffffffffffffffff9081169184019190915260409182015116910152565b600060208284031215612d3057600080fd5b81516110aa8161281f565b600060208284031215612d4d57600080fd5b5051919050565b818103818111156104cd576104cd612c84565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203612dc757612dc7612c84565b5060010190565b606081016104cd82848051151582526020808201516fffffffffffffffffffffffffffffffff9081169184019190915260409182015116910152565b600060a08284031215612e1c57600080fd5b612e246127f6565b612e2d836126b2565b81526020830135612e3d8161281f565b6020820152612e4f846040850161284d565b60408201529392505050565b80820281158282048414176104cd576104cd612c84565b600082612ea8577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b60008251612eee818460208701612b5e565b919091019291505056fea164736f6c6343000813000a", +} + +var LockReleaseTokenPoolABI = LockReleaseTokenPoolMetaData.ABI + +var LockReleaseTokenPoolBin = LockReleaseTokenPoolMetaData.Bin + +func DeployLockReleaseTokenPool(auth *bind.TransactOpts, backend bind.ContractBackend, token common.Address, allowlist []common.Address, armProxy common.Address) (common.Address, *types.Transaction, *LockReleaseTokenPool, error) { + parsed, err := LockReleaseTokenPoolMetaData.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(LockReleaseTokenPoolBin), backend, token, allowlist, armProxy) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &LockReleaseTokenPool{LockReleaseTokenPoolCaller: LockReleaseTokenPoolCaller{contract: contract}, LockReleaseTokenPoolTransactor: LockReleaseTokenPoolTransactor{contract: contract}, LockReleaseTokenPoolFilterer: LockReleaseTokenPoolFilterer{contract: contract}}, nil +} + +type LockReleaseTokenPool struct { + address common.Address + abi abi.ABI + LockReleaseTokenPoolCaller + LockReleaseTokenPoolTransactor + LockReleaseTokenPoolFilterer +} + +type LockReleaseTokenPoolCaller struct { + contract *bind.BoundContract +} + +type LockReleaseTokenPoolTransactor struct { + contract *bind.BoundContract +} + +type LockReleaseTokenPoolFilterer struct { + contract *bind.BoundContract +} + +type LockReleaseTokenPoolSession struct { + Contract *LockReleaseTokenPool + CallOpts bind.CallOpts + TransactOpts bind.TransactOpts +} + +type LockReleaseTokenPoolCallerSession struct { + Contract *LockReleaseTokenPoolCaller + CallOpts bind.CallOpts +} + +type LockReleaseTokenPoolTransactorSession struct { + Contract *LockReleaseTokenPoolTransactor + TransactOpts bind.TransactOpts +} + +type LockReleaseTokenPoolRaw struct { + Contract *LockReleaseTokenPool +} + +type LockReleaseTokenPoolCallerRaw struct { + Contract *LockReleaseTokenPoolCaller +} + +type LockReleaseTokenPoolTransactorRaw struct { + Contract *LockReleaseTokenPoolTransactor +} + +func NewLockReleaseTokenPool(address common.Address, backend bind.ContractBackend) (*LockReleaseTokenPool, error) { + abi, err := abi.JSON(strings.NewReader(LockReleaseTokenPoolABI)) + if err != nil { + return nil, err + } + contract, err := bindLockReleaseTokenPool(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &LockReleaseTokenPool{address: address, abi: abi, LockReleaseTokenPoolCaller: LockReleaseTokenPoolCaller{contract: contract}, LockReleaseTokenPoolTransactor: LockReleaseTokenPoolTransactor{contract: contract}, LockReleaseTokenPoolFilterer: LockReleaseTokenPoolFilterer{contract: contract}}, nil +} + +func NewLockReleaseTokenPoolCaller(address common.Address, caller bind.ContractCaller) (*LockReleaseTokenPoolCaller, error) { + contract, err := bindLockReleaseTokenPool(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &LockReleaseTokenPoolCaller{contract: contract}, nil +} + +func NewLockReleaseTokenPoolTransactor(address common.Address, transactor bind.ContractTransactor) (*LockReleaseTokenPoolTransactor, error) { + contract, err := bindLockReleaseTokenPool(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &LockReleaseTokenPoolTransactor{contract: contract}, nil +} + +func NewLockReleaseTokenPoolFilterer(address common.Address, filterer bind.ContractFilterer) (*LockReleaseTokenPoolFilterer, error) { + contract, err := bindLockReleaseTokenPool(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &LockReleaseTokenPoolFilterer{contract: contract}, nil +} + +func bindLockReleaseTokenPool(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := LockReleaseTokenPoolMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _LockReleaseTokenPool.Contract.LockReleaseTokenPoolCaller.contract.Call(opts, result, method, params...) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _LockReleaseTokenPool.Contract.LockReleaseTokenPoolTransactor.contract.Transfer(opts) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _LockReleaseTokenPool.Contract.LockReleaseTokenPoolTransactor.contract.Transact(opts, method, params...) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _LockReleaseTokenPool.Contract.contract.Call(opts, result, method, params...) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _LockReleaseTokenPool.Contract.contract.Transfer(opts) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _LockReleaseTokenPool.Contract.contract.Transact(opts, method, params...) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolCaller) CurrentOffRampRateLimiterState(opts *bind.CallOpts, offRamp common.Address) (RateLimiterTokenBucket, error) { + var out []interface{} + err := _LockReleaseTokenPool.contract.Call(opts, &out, "currentOffRampRateLimiterState", offRamp) + + if err != nil { + return *new(RateLimiterTokenBucket), err + } + + out0 := *abi.ConvertType(out[0], new(RateLimiterTokenBucket)).(*RateLimiterTokenBucket) + + return out0, err + +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolSession) CurrentOffRampRateLimiterState(offRamp common.Address) (RateLimiterTokenBucket, error) { + return _LockReleaseTokenPool.Contract.CurrentOffRampRateLimiterState(&_LockReleaseTokenPool.CallOpts, offRamp) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolCallerSession) CurrentOffRampRateLimiterState(offRamp common.Address) (RateLimiterTokenBucket, error) { + return _LockReleaseTokenPool.Contract.CurrentOffRampRateLimiterState(&_LockReleaseTokenPool.CallOpts, offRamp) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolCaller) CurrentOnRampRateLimiterState(opts *bind.CallOpts, onRamp common.Address) (RateLimiterTokenBucket, error) { + var out []interface{} + err := _LockReleaseTokenPool.contract.Call(opts, &out, "currentOnRampRateLimiterState", onRamp) + + if err != nil { + return *new(RateLimiterTokenBucket), err + } + + out0 := *abi.ConvertType(out[0], new(RateLimiterTokenBucket)).(*RateLimiterTokenBucket) + + return out0, err + +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolSession) CurrentOnRampRateLimiterState(onRamp common.Address) (RateLimiterTokenBucket, error) { + return _LockReleaseTokenPool.Contract.CurrentOnRampRateLimiterState(&_LockReleaseTokenPool.CallOpts, onRamp) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolCallerSession) CurrentOnRampRateLimiterState(onRamp common.Address) (RateLimiterTokenBucket, error) { + return _LockReleaseTokenPool.Contract.CurrentOnRampRateLimiterState(&_LockReleaseTokenPool.CallOpts, onRamp) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolCaller) GetAllowList(opts *bind.CallOpts) ([]common.Address, error) { + var out []interface{} + err := _LockReleaseTokenPool.contract.Call(opts, &out, "getAllowList") + + if err != nil { + return *new([]common.Address), err + } + + out0 := *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) + + return out0, err + +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolSession) GetAllowList() ([]common.Address, error) { + return _LockReleaseTokenPool.Contract.GetAllowList(&_LockReleaseTokenPool.CallOpts) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolCallerSession) GetAllowList() ([]common.Address, error) { + return _LockReleaseTokenPool.Contract.GetAllowList(&_LockReleaseTokenPool.CallOpts) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolCaller) GetAllowListEnabled(opts *bind.CallOpts) (bool, error) { + var out []interface{} + err := _LockReleaseTokenPool.contract.Call(opts, &out, "getAllowListEnabled") + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolSession) GetAllowListEnabled() (bool, error) { + return _LockReleaseTokenPool.Contract.GetAllowListEnabled(&_LockReleaseTokenPool.CallOpts) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolCallerSession) GetAllowListEnabled() (bool, error) { + return _LockReleaseTokenPool.Contract.GetAllowListEnabled(&_LockReleaseTokenPool.CallOpts) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolCaller) GetArmProxy(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _LockReleaseTokenPool.contract.Call(opts, &out, "getArmProxy") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolSession) GetArmProxy() (common.Address, error) { + return _LockReleaseTokenPool.Contract.GetArmProxy(&_LockReleaseTokenPool.CallOpts) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolCallerSession) GetArmProxy() (common.Address, error) { + return _LockReleaseTokenPool.Contract.GetArmProxy(&_LockReleaseTokenPool.CallOpts) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolCaller) GetLockReleaseInterfaceId(opts *bind.CallOpts) ([4]byte, error) { + var out []interface{} + err := _LockReleaseTokenPool.contract.Call(opts, &out, "getLockReleaseInterfaceId") + + if err != nil { + return *new([4]byte), err + } + + out0 := *abi.ConvertType(out[0], new([4]byte)).(*[4]byte) + + return out0, err + +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolSession) GetLockReleaseInterfaceId() ([4]byte, error) { + return _LockReleaseTokenPool.Contract.GetLockReleaseInterfaceId(&_LockReleaseTokenPool.CallOpts) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolCallerSession) GetLockReleaseInterfaceId() ([4]byte, error) { + return _LockReleaseTokenPool.Contract.GetLockReleaseInterfaceId(&_LockReleaseTokenPool.CallOpts) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolCaller) GetOffRamps(opts *bind.CallOpts) ([]common.Address, error) { + var out []interface{} + err := _LockReleaseTokenPool.contract.Call(opts, &out, "getOffRamps") + + if err != nil { + return *new([]common.Address), err + } + + out0 := *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) + + return out0, err + +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolSession) GetOffRamps() ([]common.Address, error) { + return _LockReleaseTokenPool.Contract.GetOffRamps(&_LockReleaseTokenPool.CallOpts) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolCallerSession) GetOffRamps() ([]common.Address, error) { + return _LockReleaseTokenPool.Contract.GetOffRamps(&_LockReleaseTokenPool.CallOpts) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolCaller) GetOnRamps(opts *bind.CallOpts) ([]common.Address, error) { + var out []interface{} + err := _LockReleaseTokenPool.contract.Call(opts, &out, "getOnRamps") + + if err != nil { + return *new([]common.Address), err + } + + out0 := *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) + + return out0, err + +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolSession) GetOnRamps() ([]common.Address, error) { + return _LockReleaseTokenPool.Contract.GetOnRamps(&_LockReleaseTokenPool.CallOpts) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolCallerSession) GetOnRamps() ([]common.Address, error) { + return _LockReleaseTokenPool.Contract.GetOnRamps(&_LockReleaseTokenPool.CallOpts) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolCaller) GetProvidedLiquidity(opts *bind.CallOpts, provider common.Address) (*big.Int, error) { + var out []interface{} + err := _LockReleaseTokenPool.contract.Call(opts, &out, "getProvidedLiquidity", provider) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolSession) GetProvidedLiquidity(provider common.Address) (*big.Int, error) { + return _LockReleaseTokenPool.Contract.GetProvidedLiquidity(&_LockReleaseTokenPool.CallOpts, provider) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolCallerSession) GetProvidedLiquidity(provider common.Address) (*big.Int, error) { + return _LockReleaseTokenPool.Contract.GetProvidedLiquidity(&_LockReleaseTokenPool.CallOpts, provider) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolCaller) GetToken(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _LockReleaseTokenPool.contract.Call(opts, &out, "getToken") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolSession) GetToken() (common.Address, error) { + return _LockReleaseTokenPool.Contract.GetToken(&_LockReleaseTokenPool.CallOpts) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolCallerSession) GetToken() (common.Address, error) { + return _LockReleaseTokenPool.Contract.GetToken(&_LockReleaseTokenPool.CallOpts) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolCaller) IsOffRamp(opts *bind.CallOpts, offRamp common.Address) (bool, error) { + var out []interface{} + err := _LockReleaseTokenPool.contract.Call(opts, &out, "isOffRamp", offRamp) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolSession) IsOffRamp(offRamp common.Address) (bool, error) { + return _LockReleaseTokenPool.Contract.IsOffRamp(&_LockReleaseTokenPool.CallOpts, offRamp) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolCallerSession) IsOffRamp(offRamp common.Address) (bool, error) { + return _LockReleaseTokenPool.Contract.IsOffRamp(&_LockReleaseTokenPool.CallOpts, offRamp) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolCaller) IsOnRamp(opts *bind.CallOpts, onRamp common.Address) (bool, error) { + var out []interface{} + err := _LockReleaseTokenPool.contract.Call(opts, &out, "isOnRamp", onRamp) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolSession) IsOnRamp(onRamp common.Address) (bool, error) { + return _LockReleaseTokenPool.Contract.IsOnRamp(&_LockReleaseTokenPool.CallOpts, onRamp) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolCallerSession) IsOnRamp(onRamp common.Address) (bool, error) { + return _LockReleaseTokenPool.Contract.IsOnRamp(&_LockReleaseTokenPool.CallOpts, onRamp) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolCaller) Owner(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _LockReleaseTokenPool.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 + +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolSession) Owner() (common.Address, error) { + return _LockReleaseTokenPool.Contract.Owner(&_LockReleaseTokenPool.CallOpts) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolCallerSession) Owner() (common.Address, error) { + return _LockReleaseTokenPool.Contract.Owner(&_LockReleaseTokenPool.CallOpts) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolCaller) SupportsInterface(opts *bind.CallOpts, interfaceId [4]byte) (bool, error) { + var out []interface{} + err := _LockReleaseTokenPool.contract.Call(opts, &out, "supportsInterface", interfaceId) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolSession) SupportsInterface(interfaceId [4]byte) (bool, error) { + return _LockReleaseTokenPool.Contract.SupportsInterface(&_LockReleaseTokenPool.CallOpts, interfaceId) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolCallerSession) SupportsInterface(interfaceId [4]byte) (bool, error) { + return _LockReleaseTokenPool.Contract.SupportsInterface(&_LockReleaseTokenPool.CallOpts, interfaceId) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolTransactor) AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + return _LockReleaseTokenPool.contract.Transact(opts, "acceptOwnership") +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolSession) AcceptOwnership() (*types.Transaction, error) { + return _LockReleaseTokenPool.Contract.AcceptOwnership(&_LockReleaseTokenPool.TransactOpts) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolTransactorSession) AcceptOwnership() (*types.Transaction, error) { + return _LockReleaseTokenPool.Contract.AcceptOwnership(&_LockReleaseTokenPool.TransactOpts) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolTransactor) AddLiquidity(opts *bind.TransactOpts, amount *big.Int) (*types.Transaction, error) { + return _LockReleaseTokenPool.contract.Transact(opts, "addLiquidity", amount) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolSession) AddLiquidity(amount *big.Int) (*types.Transaction, error) { + return _LockReleaseTokenPool.Contract.AddLiquidity(&_LockReleaseTokenPool.TransactOpts, amount) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolTransactorSession) AddLiquidity(amount *big.Int) (*types.Transaction, error) { + return _LockReleaseTokenPool.Contract.AddLiquidity(&_LockReleaseTokenPool.TransactOpts, amount) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolTransactor) ApplyAllowListUpdates(opts *bind.TransactOpts, removes []common.Address, adds []common.Address) (*types.Transaction, error) { + return _LockReleaseTokenPool.contract.Transact(opts, "applyAllowListUpdates", removes, adds) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolSession) ApplyAllowListUpdates(removes []common.Address, adds []common.Address) (*types.Transaction, error) { + return _LockReleaseTokenPool.Contract.ApplyAllowListUpdates(&_LockReleaseTokenPool.TransactOpts, removes, adds) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolTransactorSession) ApplyAllowListUpdates(removes []common.Address, adds []common.Address) (*types.Transaction, error) { + return _LockReleaseTokenPool.Contract.ApplyAllowListUpdates(&_LockReleaseTokenPool.TransactOpts, removes, adds) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolTransactor) ApplyRampUpdates(opts *bind.TransactOpts, onRamps []TokenPoolRampUpdate, offRamps []TokenPoolRampUpdate) (*types.Transaction, error) { + return _LockReleaseTokenPool.contract.Transact(opts, "applyRampUpdates", onRamps, offRamps) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolSession) ApplyRampUpdates(onRamps []TokenPoolRampUpdate, offRamps []TokenPoolRampUpdate) (*types.Transaction, error) { + return _LockReleaseTokenPool.Contract.ApplyRampUpdates(&_LockReleaseTokenPool.TransactOpts, onRamps, offRamps) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolTransactorSession) ApplyRampUpdates(onRamps []TokenPoolRampUpdate, offRamps []TokenPoolRampUpdate) (*types.Transaction, error) { + return _LockReleaseTokenPool.Contract.ApplyRampUpdates(&_LockReleaseTokenPool.TransactOpts, onRamps, offRamps) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolTransactor) LockOrBurn(opts *bind.TransactOpts, originalSender common.Address, arg1 []byte, amount *big.Int, arg3 uint64, arg4 []byte) (*types.Transaction, error) { + return _LockReleaseTokenPool.contract.Transact(opts, "lockOrBurn", originalSender, arg1, amount, arg3, arg4) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolSession) LockOrBurn(originalSender common.Address, arg1 []byte, amount *big.Int, arg3 uint64, arg4 []byte) (*types.Transaction, error) { + return _LockReleaseTokenPool.Contract.LockOrBurn(&_LockReleaseTokenPool.TransactOpts, originalSender, arg1, amount, arg3, arg4) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolTransactorSession) LockOrBurn(originalSender common.Address, arg1 []byte, amount *big.Int, arg3 uint64, arg4 []byte) (*types.Transaction, error) { + return _LockReleaseTokenPool.Contract.LockOrBurn(&_LockReleaseTokenPool.TransactOpts, originalSender, arg1, amount, arg3, arg4) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolTransactor) ReleaseOrMint(opts *bind.TransactOpts, arg0 []byte, receiver common.Address, amount *big.Int, arg3 uint64, arg4 []byte) (*types.Transaction, error) { + return _LockReleaseTokenPool.contract.Transact(opts, "releaseOrMint", arg0, receiver, amount, arg3, arg4) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolSession) ReleaseOrMint(arg0 []byte, receiver common.Address, amount *big.Int, arg3 uint64, arg4 []byte) (*types.Transaction, error) { + return _LockReleaseTokenPool.Contract.ReleaseOrMint(&_LockReleaseTokenPool.TransactOpts, arg0, receiver, amount, arg3, arg4) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolTransactorSession) ReleaseOrMint(arg0 []byte, receiver common.Address, amount *big.Int, arg3 uint64, arg4 []byte) (*types.Transaction, error) { + return _LockReleaseTokenPool.Contract.ReleaseOrMint(&_LockReleaseTokenPool.TransactOpts, arg0, receiver, amount, arg3, arg4) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolTransactor) RemoveLiquidity(opts *bind.TransactOpts, amount *big.Int) (*types.Transaction, error) { + return _LockReleaseTokenPool.contract.Transact(opts, "removeLiquidity", amount) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolSession) RemoveLiquidity(amount *big.Int) (*types.Transaction, error) { + return _LockReleaseTokenPool.Contract.RemoveLiquidity(&_LockReleaseTokenPool.TransactOpts, amount) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolTransactorSession) RemoveLiquidity(amount *big.Int) (*types.Transaction, error) { + return _LockReleaseTokenPool.Contract.RemoveLiquidity(&_LockReleaseTokenPool.TransactOpts, amount) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolTransactor) SetOffRampRateLimiterConfig(opts *bind.TransactOpts, offRamp common.Address, config RateLimiterConfig) (*types.Transaction, error) { + return _LockReleaseTokenPool.contract.Transact(opts, "setOffRampRateLimiterConfig", offRamp, config) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolSession) SetOffRampRateLimiterConfig(offRamp common.Address, config RateLimiterConfig) (*types.Transaction, error) { + return _LockReleaseTokenPool.Contract.SetOffRampRateLimiterConfig(&_LockReleaseTokenPool.TransactOpts, offRamp, config) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolTransactorSession) SetOffRampRateLimiterConfig(offRamp common.Address, config RateLimiterConfig) (*types.Transaction, error) { + return _LockReleaseTokenPool.Contract.SetOffRampRateLimiterConfig(&_LockReleaseTokenPool.TransactOpts, offRamp, config) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolTransactor) SetOnRampRateLimiterConfig(opts *bind.TransactOpts, onRamp common.Address, config RateLimiterConfig) (*types.Transaction, error) { + return _LockReleaseTokenPool.contract.Transact(opts, "setOnRampRateLimiterConfig", onRamp, config) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolSession) SetOnRampRateLimiterConfig(onRamp common.Address, config RateLimiterConfig) (*types.Transaction, error) { + return _LockReleaseTokenPool.Contract.SetOnRampRateLimiterConfig(&_LockReleaseTokenPool.TransactOpts, onRamp, config) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolTransactorSession) SetOnRampRateLimiterConfig(onRamp common.Address, config RateLimiterConfig) (*types.Transaction, error) { + return _LockReleaseTokenPool.Contract.SetOnRampRateLimiterConfig(&_LockReleaseTokenPool.TransactOpts, onRamp, config) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolTransactor) TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) { + return _LockReleaseTokenPool.contract.Transact(opts, "transferOwnership", to) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolSession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _LockReleaseTokenPool.Contract.TransferOwnership(&_LockReleaseTokenPool.TransactOpts, to) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolTransactorSession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _LockReleaseTokenPool.Contract.TransferOwnership(&_LockReleaseTokenPool.TransactOpts, to) +} + +type LockReleaseTokenPoolAllowListAddIterator struct { + Event *LockReleaseTokenPoolAllowListAdd + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *LockReleaseTokenPoolAllowListAddIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolAllowListAdd) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolAllowListAdd) + 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() + } +} + +func (it *LockReleaseTokenPoolAllowListAddIterator) Error() error { + return it.fail +} + +func (it *LockReleaseTokenPoolAllowListAddIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type LockReleaseTokenPoolAllowListAdd struct { + Sender common.Address + Raw types.Log +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) FilterAllowListAdd(opts *bind.FilterOpts) (*LockReleaseTokenPoolAllowListAddIterator, error) { + + logs, sub, err := _LockReleaseTokenPool.contract.FilterLogs(opts, "AllowListAdd") + if err != nil { + return nil, err + } + return &LockReleaseTokenPoolAllowListAddIterator{contract: _LockReleaseTokenPool.contract, event: "AllowListAdd", logs: logs, sub: sub}, nil +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) WatchAllowListAdd(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolAllowListAdd) (event.Subscription, error) { + + logs, sub, err := _LockReleaseTokenPool.contract.WatchLogs(opts, "AllowListAdd") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(LockReleaseTokenPoolAllowListAdd) + if err := _LockReleaseTokenPool.contract.UnpackLog(event, "AllowListAdd", 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 +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) ParseAllowListAdd(log types.Log) (*LockReleaseTokenPoolAllowListAdd, error) { + event := new(LockReleaseTokenPoolAllowListAdd) + if err := _LockReleaseTokenPool.contract.UnpackLog(event, "AllowListAdd", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type LockReleaseTokenPoolAllowListRemoveIterator struct { + Event *LockReleaseTokenPoolAllowListRemove + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *LockReleaseTokenPoolAllowListRemoveIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolAllowListRemove) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolAllowListRemove) + 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() + } +} + +func (it *LockReleaseTokenPoolAllowListRemoveIterator) Error() error { + return it.fail +} + +func (it *LockReleaseTokenPoolAllowListRemoveIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type LockReleaseTokenPoolAllowListRemove struct { + Sender common.Address + Raw types.Log +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) FilterAllowListRemove(opts *bind.FilterOpts) (*LockReleaseTokenPoolAllowListRemoveIterator, error) { + + logs, sub, err := _LockReleaseTokenPool.contract.FilterLogs(opts, "AllowListRemove") + if err != nil { + return nil, err + } + return &LockReleaseTokenPoolAllowListRemoveIterator{contract: _LockReleaseTokenPool.contract, event: "AllowListRemove", logs: logs, sub: sub}, nil +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) WatchAllowListRemove(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolAllowListRemove) (event.Subscription, error) { + + logs, sub, err := _LockReleaseTokenPool.contract.WatchLogs(opts, "AllowListRemove") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(LockReleaseTokenPoolAllowListRemove) + if err := _LockReleaseTokenPool.contract.UnpackLog(event, "AllowListRemove", 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 +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) ParseAllowListRemove(log types.Log) (*LockReleaseTokenPoolAllowListRemove, error) { + event := new(LockReleaseTokenPoolAllowListRemove) + if err := _LockReleaseTokenPool.contract.UnpackLog(event, "AllowListRemove", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type LockReleaseTokenPoolBurnedIterator struct { + Event *LockReleaseTokenPoolBurned + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *LockReleaseTokenPoolBurnedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolBurned) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolBurned) + 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() + } +} + +func (it *LockReleaseTokenPoolBurnedIterator) Error() error { + return it.fail +} + +func (it *LockReleaseTokenPoolBurnedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type LockReleaseTokenPoolBurned struct { + Sender common.Address + Amount *big.Int + Raw types.Log +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) FilterBurned(opts *bind.FilterOpts, sender []common.Address) (*LockReleaseTokenPoolBurnedIterator, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _LockReleaseTokenPool.contract.FilterLogs(opts, "Burned", senderRule) + if err != nil { + return nil, err + } + return &LockReleaseTokenPoolBurnedIterator{contract: _LockReleaseTokenPool.contract, event: "Burned", logs: logs, sub: sub}, nil +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) WatchBurned(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolBurned, sender []common.Address) (event.Subscription, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _LockReleaseTokenPool.contract.WatchLogs(opts, "Burned", senderRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(LockReleaseTokenPoolBurned) + if err := _LockReleaseTokenPool.contract.UnpackLog(event, "Burned", 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 +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) ParseBurned(log types.Log) (*LockReleaseTokenPoolBurned, error) { + event := new(LockReleaseTokenPoolBurned) + if err := _LockReleaseTokenPool.contract.UnpackLog(event, "Burned", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type LockReleaseTokenPoolLiquidityAddedIterator struct { + Event *LockReleaseTokenPoolLiquidityAdded + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *LockReleaseTokenPoolLiquidityAddedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolLiquidityAdded) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolLiquidityAdded) + 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() + } +} + +func (it *LockReleaseTokenPoolLiquidityAddedIterator) Error() error { + return it.fail +} + +func (it *LockReleaseTokenPoolLiquidityAddedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type LockReleaseTokenPoolLiquidityAdded struct { + Provider common.Address + Amount *big.Int + Raw types.Log +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) FilterLiquidityAdded(opts *bind.FilterOpts, provider []common.Address, amount []*big.Int) (*LockReleaseTokenPoolLiquidityAddedIterator, error) { + + var providerRule []interface{} + for _, providerItem := range provider { + providerRule = append(providerRule, providerItem) + } + var amountRule []interface{} + for _, amountItem := range amount { + amountRule = append(amountRule, amountItem) + } + + logs, sub, err := _LockReleaseTokenPool.contract.FilterLogs(opts, "LiquidityAdded", providerRule, amountRule) + if err != nil { + return nil, err + } + return &LockReleaseTokenPoolLiquidityAddedIterator{contract: _LockReleaseTokenPool.contract, event: "LiquidityAdded", logs: logs, sub: sub}, nil +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) WatchLiquidityAdded(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolLiquidityAdded, provider []common.Address, amount []*big.Int) (event.Subscription, error) { + + var providerRule []interface{} + for _, providerItem := range provider { + providerRule = append(providerRule, providerItem) + } + var amountRule []interface{} + for _, amountItem := range amount { + amountRule = append(amountRule, amountItem) + } + + logs, sub, err := _LockReleaseTokenPool.contract.WatchLogs(opts, "LiquidityAdded", providerRule, amountRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(LockReleaseTokenPoolLiquidityAdded) + if err := _LockReleaseTokenPool.contract.UnpackLog(event, "LiquidityAdded", 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 +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) ParseLiquidityAdded(log types.Log) (*LockReleaseTokenPoolLiquidityAdded, error) { + event := new(LockReleaseTokenPoolLiquidityAdded) + if err := _LockReleaseTokenPool.contract.UnpackLog(event, "LiquidityAdded", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type LockReleaseTokenPoolLiquidityRemovedIterator struct { + Event *LockReleaseTokenPoolLiquidityRemoved + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *LockReleaseTokenPoolLiquidityRemovedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolLiquidityRemoved) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolLiquidityRemoved) + 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() + } +} + +func (it *LockReleaseTokenPoolLiquidityRemovedIterator) Error() error { + return it.fail +} + +func (it *LockReleaseTokenPoolLiquidityRemovedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type LockReleaseTokenPoolLiquidityRemoved struct { + Provider common.Address + Amount *big.Int + Raw types.Log +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) FilterLiquidityRemoved(opts *bind.FilterOpts, provider []common.Address, amount []*big.Int) (*LockReleaseTokenPoolLiquidityRemovedIterator, error) { + + var providerRule []interface{} + for _, providerItem := range provider { + providerRule = append(providerRule, providerItem) + } + var amountRule []interface{} + for _, amountItem := range amount { + amountRule = append(amountRule, amountItem) + } + + logs, sub, err := _LockReleaseTokenPool.contract.FilterLogs(opts, "LiquidityRemoved", providerRule, amountRule) + if err != nil { + return nil, err + } + return &LockReleaseTokenPoolLiquidityRemovedIterator{contract: _LockReleaseTokenPool.contract, event: "LiquidityRemoved", logs: logs, sub: sub}, nil +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) WatchLiquidityRemoved(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolLiquidityRemoved, provider []common.Address, amount []*big.Int) (event.Subscription, error) { + + var providerRule []interface{} + for _, providerItem := range provider { + providerRule = append(providerRule, providerItem) + } + var amountRule []interface{} + for _, amountItem := range amount { + amountRule = append(amountRule, amountItem) + } + + logs, sub, err := _LockReleaseTokenPool.contract.WatchLogs(opts, "LiquidityRemoved", providerRule, amountRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(LockReleaseTokenPoolLiquidityRemoved) + if err := _LockReleaseTokenPool.contract.UnpackLog(event, "LiquidityRemoved", 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 +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) ParseLiquidityRemoved(log types.Log) (*LockReleaseTokenPoolLiquidityRemoved, error) { + event := new(LockReleaseTokenPoolLiquidityRemoved) + if err := _LockReleaseTokenPool.contract.UnpackLog(event, "LiquidityRemoved", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type LockReleaseTokenPoolLockedIterator struct { + Event *LockReleaseTokenPoolLocked + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *LockReleaseTokenPoolLockedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolLocked) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolLocked) + 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() + } +} + +func (it *LockReleaseTokenPoolLockedIterator) Error() error { + return it.fail +} + +func (it *LockReleaseTokenPoolLockedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type LockReleaseTokenPoolLocked struct { + Sender common.Address + Amount *big.Int + Raw types.Log +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) FilterLocked(opts *bind.FilterOpts, sender []common.Address) (*LockReleaseTokenPoolLockedIterator, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _LockReleaseTokenPool.contract.FilterLogs(opts, "Locked", senderRule) + if err != nil { + return nil, err + } + return &LockReleaseTokenPoolLockedIterator{contract: _LockReleaseTokenPool.contract, event: "Locked", logs: logs, sub: sub}, nil +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) WatchLocked(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolLocked, sender []common.Address) (event.Subscription, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _LockReleaseTokenPool.contract.WatchLogs(opts, "Locked", senderRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(LockReleaseTokenPoolLocked) + if err := _LockReleaseTokenPool.contract.UnpackLog(event, "Locked", 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 +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) ParseLocked(log types.Log) (*LockReleaseTokenPoolLocked, error) { + event := new(LockReleaseTokenPoolLocked) + if err := _LockReleaseTokenPool.contract.UnpackLog(event, "Locked", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type LockReleaseTokenPoolMintedIterator struct { + Event *LockReleaseTokenPoolMinted + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *LockReleaseTokenPoolMintedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolMinted) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolMinted) + 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() + } +} + +func (it *LockReleaseTokenPoolMintedIterator) Error() error { + return it.fail +} + +func (it *LockReleaseTokenPoolMintedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type LockReleaseTokenPoolMinted struct { + Sender common.Address + Recipient common.Address + Amount *big.Int + Raw types.Log +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) FilterMinted(opts *bind.FilterOpts, sender []common.Address, recipient []common.Address) (*LockReleaseTokenPoolMintedIterator, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + var recipientRule []interface{} + for _, recipientItem := range recipient { + recipientRule = append(recipientRule, recipientItem) + } + + logs, sub, err := _LockReleaseTokenPool.contract.FilterLogs(opts, "Minted", senderRule, recipientRule) + if err != nil { + return nil, err + } + return &LockReleaseTokenPoolMintedIterator{contract: _LockReleaseTokenPool.contract, event: "Minted", logs: logs, sub: sub}, nil +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) WatchMinted(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolMinted, sender []common.Address, recipient []common.Address) (event.Subscription, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + var recipientRule []interface{} + for _, recipientItem := range recipient { + recipientRule = append(recipientRule, recipientItem) + } + + logs, sub, err := _LockReleaseTokenPool.contract.WatchLogs(opts, "Minted", senderRule, recipientRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(LockReleaseTokenPoolMinted) + if err := _LockReleaseTokenPool.contract.UnpackLog(event, "Minted", 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 +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) ParseMinted(log types.Log) (*LockReleaseTokenPoolMinted, error) { + event := new(LockReleaseTokenPoolMinted) + if err := _LockReleaseTokenPool.contract.UnpackLog(event, "Minted", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type LockReleaseTokenPoolOffRampAddedIterator struct { + Event *LockReleaseTokenPoolOffRampAdded + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *LockReleaseTokenPoolOffRampAddedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolOffRampAdded) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolOffRampAdded) + 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() + } +} + +func (it *LockReleaseTokenPoolOffRampAddedIterator) Error() error { + return it.fail +} + +func (it *LockReleaseTokenPoolOffRampAddedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type LockReleaseTokenPoolOffRampAdded struct { + OffRamp common.Address + RateLimiterConfig RateLimiterConfig + Raw types.Log +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) FilterOffRampAdded(opts *bind.FilterOpts) (*LockReleaseTokenPoolOffRampAddedIterator, error) { + + logs, sub, err := _LockReleaseTokenPool.contract.FilterLogs(opts, "OffRampAdded") + if err != nil { + return nil, err + } + return &LockReleaseTokenPoolOffRampAddedIterator{contract: _LockReleaseTokenPool.contract, event: "OffRampAdded", logs: logs, sub: sub}, nil +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) WatchOffRampAdded(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolOffRampAdded) (event.Subscription, error) { + + logs, sub, err := _LockReleaseTokenPool.contract.WatchLogs(opts, "OffRampAdded") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(LockReleaseTokenPoolOffRampAdded) + if err := _LockReleaseTokenPool.contract.UnpackLog(event, "OffRampAdded", 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 +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) ParseOffRampAdded(log types.Log) (*LockReleaseTokenPoolOffRampAdded, error) { + event := new(LockReleaseTokenPoolOffRampAdded) + if err := _LockReleaseTokenPool.contract.UnpackLog(event, "OffRampAdded", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type LockReleaseTokenPoolOffRampConfiguredIterator struct { + Event *LockReleaseTokenPoolOffRampConfigured + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *LockReleaseTokenPoolOffRampConfiguredIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolOffRampConfigured) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolOffRampConfigured) + 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() + } +} + +func (it *LockReleaseTokenPoolOffRampConfiguredIterator) Error() error { + return it.fail +} + +func (it *LockReleaseTokenPoolOffRampConfiguredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type LockReleaseTokenPoolOffRampConfigured struct { + OffRamp common.Address + RateLimiterConfig RateLimiterConfig + Raw types.Log +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) FilterOffRampConfigured(opts *bind.FilterOpts) (*LockReleaseTokenPoolOffRampConfiguredIterator, error) { + + logs, sub, err := _LockReleaseTokenPool.contract.FilterLogs(opts, "OffRampConfigured") + if err != nil { + return nil, err + } + return &LockReleaseTokenPoolOffRampConfiguredIterator{contract: _LockReleaseTokenPool.contract, event: "OffRampConfigured", logs: logs, sub: sub}, nil +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) WatchOffRampConfigured(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolOffRampConfigured) (event.Subscription, error) { + + logs, sub, err := _LockReleaseTokenPool.contract.WatchLogs(opts, "OffRampConfigured") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(LockReleaseTokenPoolOffRampConfigured) + if err := _LockReleaseTokenPool.contract.UnpackLog(event, "OffRampConfigured", 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 +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) ParseOffRampConfigured(log types.Log) (*LockReleaseTokenPoolOffRampConfigured, error) { + event := new(LockReleaseTokenPoolOffRampConfigured) + if err := _LockReleaseTokenPool.contract.UnpackLog(event, "OffRampConfigured", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type LockReleaseTokenPoolOffRampRemovedIterator struct { + Event *LockReleaseTokenPoolOffRampRemoved + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *LockReleaseTokenPoolOffRampRemovedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolOffRampRemoved) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolOffRampRemoved) + 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() + } +} + +func (it *LockReleaseTokenPoolOffRampRemovedIterator) Error() error { + return it.fail +} + +func (it *LockReleaseTokenPoolOffRampRemovedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type LockReleaseTokenPoolOffRampRemoved struct { + OffRamp common.Address + Raw types.Log +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) FilterOffRampRemoved(opts *bind.FilterOpts) (*LockReleaseTokenPoolOffRampRemovedIterator, error) { + + logs, sub, err := _LockReleaseTokenPool.contract.FilterLogs(opts, "OffRampRemoved") + if err != nil { + return nil, err + } + return &LockReleaseTokenPoolOffRampRemovedIterator{contract: _LockReleaseTokenPool.contract, event: "OffRampRemoved", logs: logs, sub: sub}, nil +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) WatchOffRampRemoved(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolOffRampRemoved) (event.Subscription, error) { + + logs, sub, err := _LockReleaseTokenPool.contract.WatchLogs(opts, "OffRampRemoved") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(LockReleaseTokenPoolOffRampRemoved) + if err := _LockReleaseTokenPool.contract.UnpackLog(event, "OffRampRemoved", 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 +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) ParseOffRampRemoved(log types.Log) (*LockReleaseTokenPoolOffRampRemoved, error) { + event := new(LockReleaseTokenPoolOffRampRemoved) + if err := _LockReleaseTokenPool.contract.UnpackLog(event, "OffRampRemoved", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type LockReleaseTokenPoolOnRampAddedIterator struct { + Event *LockReleaseTokenPoolOnRampAdded + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *LockReleaseTokenPoolOnRampAddedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolOnRampAdded) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolOnRampAdded) + 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() + } +} + +func (it *LockReleaseTokenPoolOnRampAddedIterator) Error() error { + return it.fail +} + +func (it *LockReleaseTokenPoolOnRampAddedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type LockReleaseTokenPoolOnRampAdded struct { + OnRamp common.Address + RateLimiterConfig RateLimiterConfig + Raw types.Log +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) FilterOnRampAdded(opts *bind.FilterOpts) (*LockReleaseTokenPoolOnRampAddedIterator, error) { + + logs, sub, err := _LockReleaseTokenPool.contract.FilterLogs(opts, "OnRampAdded") + if err != nil { + return nil, err + } + return &LockReleaseTokenPoolOnRampAddedIterator{contract: _LockReleaseTokenPool.contract, event: "OnRampAdded", logs: logs, sub: sub}, nil +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) WatchOnRampAdded(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolOnRampAdded) (event.Subscription, error) { + + logs, sub, err := _LockReleaseTokenPool.contract.WatchLogs(opts, "OnRampAdded") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(LockReleaseTokenPoolOnRampAdded) + if err := _LockReleaseTokenPool.contract.UnpackLog(event, "OnRampAdded", 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 +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) ParseOnRampAdded(log types.Log) (*LockReleaseTokenPoolOnRampAdded, error) { + event := new(LockReleaseTokenPoolOnRampAdded) + if err := _LockReleaseTokenPool.contract.UnpackLog(event, "OnRampAdded", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type LockReleaseTokenPoolOnRampConfiguredIterator struct { + Event *LockReleaseTokenPoolOnRampConfigured + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *LockReleaseTokenPoolOnRampConfiguredIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolOnRampConfigured) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolOnRampConfigured) + 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() + } +} + +func (it *LockReleaseTokenPoolOnRampConfiguredIterator) Error() error { + return it.fail +} + +func (it *LockReleaseTokenPoolOnRampConfiguredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type LockReleaseTokenPoolOnRampConfigured struct { + OnRamp common.Address + RateLimiterConfig RateLimiterConfig + Raw types.Log +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) FilterOnRampConfigured(opts *bind.FilterOpts) (*LockReleaseTokenPoolOnRampConfiguredIterator, error) { + + logs, sub, err := _LockReleaseTokenPool.contract.FilterLogs(opts, "OnRampConfigured") + if err != nil { + return nil, err + } + return &LockReleaseTokenPoolOnRampConfiguredIterator{contract: _LockReleaseTokenPool.contract, event: "OnRampConfigured", logs: logs, sub: sub}, nil +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) WatchOnRampConfigured(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolOnRampConfigured) (event.Subscription, error) { + + logs, sub, err := _LockReleaseTokenPool.contract.WatchLogs(opts, "OnRampConfigured") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(LockReleaseTokenPoolOnRampConfigured) + if err := _LockReleaseTokenPool.contract.UnpackLog(event, "OnRampConfigured", 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 +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) ParseOnRampConfigured(log types.Log) (*LockReleaseTokenPoolOnRampConfigured, error) { + event := new(LockReleaseTokenPoolOnRampConfigured) + if err := _LockReleaseTokenPool.contract.UnpackLog(event, "OnRampConfigured", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type LockReleaseTokenPoolOnRampRemovedIterator struct { + Event *LockReleaseTokenPoolOnRampRemoved + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *LockReleaseTokenPoolOnRampRemovedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolOnRampRemoved) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolOnRampRemoved) + 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() + } +} + +func (it *LockReleaseTokenPoolOnRampRemovedIterator) Error() error { + return it.fail +} + +func (it *LockReleaseTokenPoolOnRampRemovedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type LockReleaseTokenPoolOnRampRemoved struct { + OnRamp common.Address + Raw types.Log +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) FilterOnRampRemoved(opts *bind.FilterOpts) (*LockReleaseTokenPoolOnRampRemovedIterator, error) { + + logs, sub, err := _LockReleaseTokenPool.contract.FilterLogs(opts, "OnRampRemoved") + if err != nil { + return nil, err + } + return &LockReleaseTokenPoolOnRampRemovedIterator{contract: _LockReleaseTokenPool.contract, event: "OnRampRemoved", logs: logs, sub: sub}, nil +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) WatchOnRampRemoved(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolOnRampRemoved) (event.Subscription, error) { + + logs, sub, err := _LockReleaseTokenPool.contract.WatchLogs(opts, "OnRampRemoved") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(LockReleaseTokenPoolOnRampRemoved) + if err := _LockReleaseTokenPool.contract.UnpackLog(event, "OnRampRemoved", 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 +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) ParseOnRampRemoved(log types.Log) (*LockReleaseTokenPoolOnRampRemoved, error) { + event := new(LockReleaseTokenPoolOnRampRemoved) + if err := _LockReleaseTokenPool.contract.UnpackLog(event, "OnRampRemoved", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type LockReleaseTokenPoolOwnershipTransferRequestedIterator struct { + Event *LockReleaseTokenPoolOwnershipTransferRequested + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *LockReleaseTokenPoolOwnershipTransferRequestedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolOwnershipTransferRequested) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolOwnershipTransferRequested) + 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() + } +} + +func (it *LockReleaseTokenPoolOwnershipTransferRequestedIterator) Error() error { + return it.fail +} + +func (it *LockReleaseTokenPoolOwnershipTransferRequestedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type LockReleaseTokenPoolOwnershipTransferRequested struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*LockReleaseTokenPoolOwnershipTransferRequestedIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _LockReleaseTokenPool.contract.FilterLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return &LockReleaseTokenPoolOwnershipTransferRequestedIterator{contract: _LockReleaseTokenPool.contract, event: "OwnershipTransferRequested", logs: logs, sub: sub}, nil +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _LockReleaseTokenPool.contract.WatchLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(LockReleaseTokenPoolOwnershipTransferRequested) + if err := _LockReleaseTokenPool.contract.UnpackLog(event, "OwnershipTransferRequested", 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 +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) ParseOwnershipTransferRequested(log types.Log) (*LockReleaseTokenPoolOwnershipTransferRequested, error) { + event := new(LockReleaseTokenPoolOwnershipTransferRequested) + if err := _LockReleaseTokenPool.contract.UnpackLog(event, "OwnershipTransferRequested", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type LockReleaseTokenPoolOwnershipTransferredIterator struct { + Event *LockReleaseTokenPoolOwnershipTransferred + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *LockReleaseTokenPoolOwnershipTransferredIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolOwnershipTransferred) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolOwnershipTransferred) + 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() + } +} + +func (it *LockReleaseTokenPoolOwnershipTransferredIterator) Error() error { + return it.fail +} + +func (it *LockReleaseTokenPoolOwnershipTransferredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type LockReleaseTokenPoolOwnershipTransferred struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*LockReleaseTokenPoolOwnershipTransferredIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _LockReleaseTokenPool.contract.FilterLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return &LockReleaseTokenPoolOwnershipTransferredIterator{contract: _LockReleaseTokenPool.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _LockReleaseTokenPool.contract.WatchLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(LockReleaseTokenPoolOwnershipTransferred) + if err := _LockReleaseTokenPool.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 +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) ParseOwnershipTransferred(log types.Log) (*LockReleaseTokenPoolOwnershipTransferred, error) { + event := new(LockReleaseTokenPoolOwnershipTransferred) + if err := _LockReleaseTokenPool.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type LockReleaseTokenPoolReleasedIterator struct { + Event *LockReleaseTokenPoolReleased + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *LockReleaseTokenPoolReleasedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolReleased) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolReleased) + 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() + } +} + +func (it *LockReleaseTokenPoolReleasedIterator) Error() error { + return it.fail +} + +func (it *LockReleaseTokenPoolReleasedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type LockReleaseTokenPoolReleased struct { + Sender common.Address + Recipient common.Address + Amount *big.Int + Raw types.Log +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) FilterReleased(opts *bind.FilterOpts, sender []common.Address, recipient []common.Address) (*LockReleaseTokenPoolReleasedIterator, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + var recipientRule []interface{} + for _, recipientItem := range recipient { + recipientRule = append(recipientRule, recipientItem) + } + + logs, sub, err := _LockReleaseTokenPool.contract.FilterLogs(opts, "Released", senderRule, recipientRule) + if err != nil { + return nil, err + } + return &LockReleaseTokenPoolReleasedIterator{contract: _LockReleaseTokenPool.contract, event: "Released", logs: logs, sub: sub}, nil +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) WatchReleased(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolReleased, sender []common.Address, recipient []common.Address) (event.Subscription, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + var recipientRule []interface{} + for _, recipientItem := range recipient { + recipientRule = append(recipientRule, recipientItem) + } + + logs, sub, err := _LockReleaseTokenPool.contract.WatchLogs(opts, "Released", senderRule, recipientRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(LockReleaseTokenPoolReleased) + if err := _LockReleaseTokenPool.contract.UnpackLog(event, "Released", 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 +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) ParseReleased(log types.Log) (*LockReleaseTokenPoolReleased, error) { + event := new(LockReleaseTokenPoolReleased) + if err := _LockReleaseTokenPool.contract.UnpackLog(event, "Released", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +func (_LockReleaseTokenPool *LockReleaseTokenPool) ParseLog(log types.Log) (generated.AbigenLog, error) { + switch log.Topics[0] { + case _LockReleaseTokenPool.abi.Events["AllowListAdd"].ID: + return _LockReleaseTokenPool.ParseAllowListAdd(log) + case _LockReleaseTokenPool.abi.Events["AllowListRemove"].ID: + return _LockReleaseTokenPool.ParseAllowListRemove(log) + case _LockReleaseTokenPool.abi.Events["Burned"].ID: + return _LockReleaseTokenPool.ParseBurned(log) + case _LockReleaseTokenPool.abi.Events["LiquidityAdded"].ID: + return _LockReleaseTokenPool.ParseLiquidityAdded(log) + case _LockReleaseTokenPool.abi.Events["LiquidityRemoved"].ID: + return _LockReleaseTokenPool.ParseLiquidityRemoved(log) + case _LockReleaseTokenPool.abi.Events["Locked"].ID: + return _LockReleaseTokenPool.ParseLocked(log) + case _LockReleaseTokenPool.abi.Events["Minted"].ID: + return _LockReleaseTokenPool.ParseMinted(log) + case _LockReleaseTokenPool.abi.Events["OffRampAdded"].ID: + return _LockReleaseTokenPool.ParseOffRampAdded(log) + case _LockReleaseTokenPool.abi.Events["OffRampConfigured"].ID: + return _LockReleaseTokenPool.ParseOffRampConfigured(log) + case _LockReleaseTokenPool.abi.Events["OffRampRemoved"].ID: + return _LockReleaseTokenPool.ParseOffRampRemoved(log) + case _LockReleaseTokenPool.abi.Events["OnRampAdded"].ID: + return _LockReleaseTokenPool.ParseOnRampAdded(log) + case _LockReleaseTokenPool.abi.Events["OnRampConfigured"].ID: + return _LockReleaseTokenPool.ParseOnRampConfigured(log) + case _LockReleaseTokenPool.abi.Events["OnRampRemoved"].ID: + return _LockReleaseTokenPool.ParseOnRampRemoved(log) + case _LockReleaseTokenPool.abi.Events["OwnershipTransferRequested"].ID: + return _LockReleaseTokenPool.ParseOwnershipTransferRequested(log) + case _LockReleaseTokenPool.abi.Events["OwnershipTransferred"].ID: + return _LockReleaseTokenPool.ParseOwnershipTransferred(log) + case _LockReleaseTokenPool.abi.Events["Released"].ID: + return _LockReleaseTokenPool.ParseReleased(log) + + default: + return nil, fmt.Errorf("abigen wrapper received unknown log topic: %v", log.Topics[0]) + } +} + +func (LockReleaseTokenPoolAllowListAdd) Topic() common.Hash { + return common.HexToHash("0x2640d4d76caf8bf478aabfa982fa4e1c4eb71a37f93cd15e80dbc657911546d8") +} + +func (LockReleaseTokenPoolAllowListRemove) Topic() common.Hash { + return common.HexToHash("0x800671136ab6cfee9fbe5ed1fb7ca417811aca3cf864800d127b927adedf7566") +} + +func (LockReleaseTokenPoolBurned) Topic() common.Hash { + return common.HexToHash("0x696de425f79f4a40bc6d2122ca50507f0efbeabbff86a84871b7196ab8ea8df7") +} + +func (LockReleaseTokenPoolLiquidityAdded) Topic() common.Hash { + return common.HexToHash("0xc17cea59c2955cb181b03393209566960365771dbba9dc3d510180e7cb312088") +} + +func (LockReleaseTokenPoolLiquidityRemoved) Topic() common.Hash { + return common.HexToHash("0xc2c3f06e49b9f15e7b4af9055e183b0d73362e033ad82a07dec9bf9840171719") +} + +func (LockReleaseTokenPoolLocked) Topic() common.Hash { + return common.HexToHash("0x9f1ec8c880f76798e7b793325d625e9b60e4082a553c98f42b6cda368dd60008") +} + +func (LockReleaseTokenPoolMinted) Topic() common.Hash { + return common.HexToHash("0x9d228d69b5fdb8d273a2336f8fb8612d039631024ea9bf09c424a9503aa078f0") +} + +func (LockReleaseTokenPoolOffRampAdded) Topic() common.Hash { + return common.HexToHash("0x395b7374909d2b54e5796f53c898ebf41d767c86c78ea86519acf2b805852d88") +} + +func (LockReleaseTokenPoolOffRampConfigured) Topic() common.Hash { + return common.HexToHash("0xb3ba339cfbb8ef80d7a29ce5493051cb90e64fcfa85d7124efc1adfa4c68399f") +} + +func (LockReleaseTokenPoolOffRampRemoved) Topic() common.Hash { + return common.HexToHash("0xcf91daec21e3510e2f2aea4b09d08c235d5c6844980be709f282ef591dbf420c") +} + +func (LockReleaseTokenPoolOnRampAdded) Topic() common.Hash { + return common.HexToHash("0x0b594bb0555ff7b252e0c789ccc9d8903fec294172064308727d570505cee1ac") +} + +func (LockReleaseTokenPoolOnRampConfigured) Topic() common.Hash { + return common.HexToHash("0x578db78e348076074dbff64a94073a83e9a65aa6766b8c75fdc89282b0e30ed6") +} + +func (LockReleaseTokenPoolOnRampRemoved) Topic() common.Hash { + return common.HexToHash("0x7fd064821314ad863a0714a3f1229375ace6b6427ed5544b7b2ba1c47b1b5294") +} + +func (LockReleaseTokenPoolOwnershipTransferRequested) Topic() common.Hash { + return common.HexToHash("0xed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae1278") +} + +func (LockReleaseTokenPoolOwnershipTransferred) Topic() common.Hash { + return common.HexToHash("0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0") +} + +func (LockReleaseTokenPoolReleased) Topic() common.Hash { + return common.HexToHash("0x2d87480f50083e2b2759522a8fdda59802650a8055e609a7772cf70c07748f52") +} + +func (_LockReleaseTokenPool *LockReleaseTokenPool) Address() common.Address { + return _LockReleaseTokenPool.address +} + +type LockReleaseTokenPoolInterface interface { + CurrentOffRampRateLimiterState(opts *bind.CallOpts, offRamp common.Address) (RateLimiterTokenBucket, error) + + CurrentOnRampRateLimiterState(opts *bind.CallOpts, onRamp common.Address) (RateLimiterTokenBucket, error) + + GetAllowList(opts *bind.CallOpts) ([]common.Address, error) + + GetAllowListEnabled(opts *bind.CallOpts) (bool, error) + + GetArmProxy(opts *bind.CallOpts) (common.Address, error) + + GetLockReleaseInterfaceId(opts *bind.CallOpts) ([4]byte, error) + + GetOffRamps(opts *bind.CallOpts) ([]common.Address, error) + + GetOnRamps(opts *bind.CallOpts) ([]common.Address, error) + + GetProvidedLiquidity(opts *bind.CallOpts, provider common.Address) (*big.Int, error) + + GetToken(opts *bind.CallOpts) (common.Address, error) + + IsOffRamp(opts *bind.CallOpts, offRamp common.Address) (bool, error) + + IsOnRamp(opts *bind.CallOpts, onRamp common.Address) (bool, error) + + Owner(opts *bind.CallOpts) (common.Address, error) + + SupportsInterface(opts *bind.CallOpts, interfaceId [4]byte) (bool, error) + + AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) + + AddLiquidity(opts *bind.TransactOpts, amount *big.Int) (*types.Transaction, error) + + ApplyAllowListUpdates(opts *bind.TransactOpts, removes []common.Address, adds []common.Address) (*types.Transaction, error) + + ApplyRampUpdates(opts *bind.TransactOpts, onRamps []TokenPoolRampUpdate, offRamps []TokenPoolRampUpdate) (*types.Transaction, error) + + LockOrBurn(opts *bind.TransactOpts, originalSender common.Address, arg1 []byte, amount *big.Int, arg3 uint64, arg4 []byte) (*types.Transaction, error) + + ReleaseOrMint(opts *bind.TransactOpts, arg0 []byte, receiver common.Address, amount *big.Int, arg3 uint64, arg4 []byte) (*types.Transaction, error) + + RemoveLiquidity(opts *bind.TransactOpts, amount *big.Int) (*types.Transaction, error) + + SetOffRampRateLimiterConfig(opts *bind.TransactOpts, offRamp common.Address, config RateLimiterConfig) (*types.Transaction, error) + + SetOnRampRateLimiterConfig(opts *bind.TransactOpts, onRamp common.Address, config RateLimiterConfig) (*types.Transaction, error) + + TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) + + FilterAllowListAdd(opts *bind.FilterOpts) (*LockReleaseTokenPoolAllowListAddIterator, error) + + WatchAllowListAdd(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolAllowListAdd) (event.Subscription, error) + + ParseAllowListAdd(log types.Log) (*LockReleaseTokenPoolAllowListAdd, error) + + FilterAllowListRemove(opts *bind.FilterOpts) (*LockReleaseTokenPoolAllowListRemoveIterator, error) + + WatchAllowListRemove(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolAllowListRemove) (event.Subscription, error) + + ParseAllowListRemove(log types.Log) (*LockReleaseTokenPoolAllowListRemove, error) + + FilterBurned(opts *bind.FilterOpts, sender []common.Address) (*LockReleaseTokenPoolBurnedIterator, error) + + WatchBurned(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolBurned, sender []common.Address) (event.Subscription, error) + + ParseBurned(log types.Log) (*LockReleaseTokenPoolBurned, error) + + FilterLiquidityAdded(opts *bind.FilterOpts, provider []common.Address, amount []*big.Int) (*LockReleaseTokenPoolLiquidityAddedIterator, error) + + WatchLiquidityAdded(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolLiquidityAdded, provider []common.Address, amount []*big.Int) (event.Subscription, error) + + ParseLiquidityAdded(log types.Log) (*LockReleaseTokenPoolLiquidityAdded, error) + + FilterLiquidityRemoved(opts *bind.FilterOpts, provider []common.Address, amount []*big.Int) (*LockReleaseTokenPoolLiquidityRemovedIterator, error) + + WatchLiquidityRemoved(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolLiquidityRemoved, provider []common.Address, amount []*big.Int) (event.Subscription, error) + + ParseLiquidityRemoved(log types.Log) (*LockReleaseTokenPoolLiquidityRemoved, error) + + FilterLocked(opts *bind.FilterOpts, sender []common.Address) (*LockReleaseTokenPoolLockedIterator, error) + + WatchLocked(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolLocked, sender []common.Address) (event.Subscription, error) + + ParseLocked(log types.Log) (*LockReleaseTokenPoolLocked, error) + + FilterMinted(opts *bind.FilterOpts, sender []common.Address, recipient []common.Address) (*LockReleaseTokenPoolMintedIterator, error) + + WatchMinted(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolMinted, sender []common.Address, recipient []common.Address) (event.Subscription, error) + + ParseMinted(log types.Log) (*LockReleaseTokenPoolMinted, error) + + FilterOffRampAdded(opts *bind.FilterOpts) (*LockReleaseTokenPoolOffRampAddedIterator, error) + + WatchOffRampAdded(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolOffRampAdded) (event.Subscription, error) + + ParseOffRampAdded(log types.Log) (*LockReleaseTokenPoolOffRampAdded, error) + + FilterOffRampConfigured(opts *bind.FilterOpts) (*LockReleaseTokenPoolOffRampConfiguredIterator, error) + + WatchOffRampConfigured(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolOffRampConfigured) (event.Subscription, error) + + ParseOffRampConfigured(log types.Log) (*LockReleaseTokenPoolOffRampConfigured, error) + + FilterOffRampRemoved(opts *bind.FilterOpts) (*LockReleaseTokenPoolOffRampRemovedIterator, error) + + WatchOffRampRemoved(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolOffRampRemoved) (event.Subscription, error) + + ParseOffRampRemoved(log types.Log) (*LockReleaseTokenPoolOffRampRemoved, error) + + FilterOnRampAdded(opts *bind.FilterOpts) (*LockReleaseTokenPoolOnRampAddedIterator, error) + + WatchOnRampAdded(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolOnRampAdded) (event.Subscription, error) + + ParseOnRampAdded(log types.Log) (*LockReleaseTokenPoolOnRampAdded, error) + + FilterOnRampConfigured(opts *bind.FilterOpts) (*LockReleaseTokenPoolOnRampConfiguredIterator, error) + + WatchOnRampConfigured(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolOnRampConfigured) (event.Subscription, error) + + ParseOnRampConfigured(log types.Log) (*LockReleaseTokenPoolOnRampConfigured, error) + + FilterOnRampRemoved(opts *bind.FilterOpts) (*LockReleaseTokenPoolOnRampRemovedIterator, error) + + WatchOnRampRemoved(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolOnRampRemoved) (event.Subscription, error) + + ParseOnRampRemoved(log types.Log) (*LockReleaseTokenPoolOnRampRemoved, error) + + FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*LockReleaseTokenPoolOwnershipTransferRequestedIterator, error) + + WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferRequested(log types.Log) (*LockReleaseTokenPoolOwnershipTransferRequested, error) + + FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*LockReleaseTokenPoolOwnershipTransferredIterator, error) + + WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferred(log types.Log) (*LockReleaseTokenPoolOwnershipTransferred, error) + + FilterReleased(opts *bind.FilterOpts, sender []common.Address, recipient []common.Address) (*LockReleaseTokenPoolReleasedIterator, error) + + WatchReleased(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolReleased, sender []common.Address, recipient []common.Address) (event.Subscription, error) + + ParseReleased(log types.Log) (*LockReleaseTokenPoolReleased, error) + + ParseLog(log types.Log) (generated.AbigenLog, error) + + Address() common.Address +} diff --git a/core/gethwrappers/ccip/generated/lock_release_token_pool_1_4_0/lock_release_token_pool_1_4_0.go b/core/gethwrappers/ccip/generated/lock_release_token_pool_1_4_0/lock_release_token_pool_1_4_0.go new file mode 100644 index 00000000000..8d3377f25be --- /dev/null +++ b/core/gethwrappers/ccip/generated/lock_release_token_pool_1_4_0/lock_release_token_pool_1_4_0.go @@ -0,0 +1,2712 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package lock_release_token_pool_1_4_0 + +import ( + "errors" + "fmt" + "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" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" +) + +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +type RateLimiterConfig struct { + IsEnabled bool + Capacity *big.Int + Rate *big.Int +} + +type RateLimiterTokenBucket struct { + Tokens *big.Int + LastUpdated uint32 + IsEnabled bool + Capacity *big.Int + Rate *big.Int +} + +type TokenPoolChainUpdate struct { + RemoteChainSelector uint64 + Allowed bool + OutboundRateLimiterConfig RateLimiterConfig + InboundRateLimiterConfig RateLimiterConfig +} + +var LockReleaseTokenPoolMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"internalType\":\"contractIERC20\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"allowlist\",\"type\":\"address[]\"},{\"internalType\":\"address\",\"name\":\"armProxy\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"acceptLiquidity\",\"type\":\"bool\"},{\"internalType\":\"address\",\"name\":\"router\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"capacity\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"requested\",\"type\":\"uint256\"}],\"name\":\"AggregateValueMaxCapacityExceeded\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"minWaitInSeconds\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"available\",\"type\":\"uint256\"}],\"name\":\"AggregateValueRateLimitReached\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"AllowListNotEnabled\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"BadARMSignal\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"BucketOverfilled\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"}],\"name\":\"CallerIsNotARampOnRouter\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"}],\"name\":\"ChainAlreadyExists\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"ChainNotAllowed\",\"type\":\"error\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"config\",\"type\":\"tuple\"}],\"name\":\"DisabledNonZeroRateLimit\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InsufficientLiquidity\",\"type\":\"error\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"rateLimiterConfig\",\"type\":\"tuple\"}],\"name\":\"InvalidRatelimitRate\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"LiquidityNotAccepted\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"NonExistentChain\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RateLimitMustBeDisabled\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"SenderNotAllowed\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"capacity\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"requested\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"}],\"name\":\"TokenMaxCapacityExceeded\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"minWaitInSeconds\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"available\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"}],\"name\":\"TokenRateLimitReached\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"}],\"name\":\"Unauthorized\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddressNotAllowed\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"AllowListAdd\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"AllowListRemove\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Burned\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"indexed\":false,\"internalType\":\"structRateLimiter.Config\",\"name\":\"outboundRateLimiterConfig\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"indexed\":false,\"internalType\":\"structRateLimiter.Config\",\"name\":\"inboundRateLimiterConfig\",\"type\":\"tuple\"}],\"name\":\"ChainAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"indexed\":false,\"internalType\":\"structRateLimiter.Config\",\"name\":\"outboundRateLimiterConfig\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"indexed\":false,\"internalType\":\"structRateLimiter.Config\",\"name\":\"inboundRateLimiterConfig\",\"type\":\"tuple\"}],\"name\":\"ChainConfigured\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"ChainRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"provider\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"LiquidityAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"provider\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"LiquidityRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Locked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Minted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Released\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"oldRouter\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newRouter\",\"type\":\"address\"}],\"name\":\"RouterUpdated\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"removes\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"adds\",\"type\":\"address[]\"}],\"name\":\"applyAllowListUpdates\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"bool\",\"name\":\"allowed\",\"type\":\"bool\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"outboundRateLimiterConfig\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"inboundRateLimiterConfig\",\"type\":\"tuple\"}],\"internalType\":\"structTokenPool.ChainUpdate[]\",\"name\":\"chains\",\"type\":\"tuple[]\"}],\"name\":\"applyChainUpdates\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"canAcceptLiquidity\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAllowList\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAllowListEnabled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getArmProxy\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"armProxy\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"getCurrentInboundRateLimiterState\",\"outputs\":[{\"components\":[{\"internalType\":\"uint128\",\"name\":\"tokens\",\"type\":\"uint128\"},{\"internalType\":\"uint32\",\"name\":\"lastUpdated\",\"type\":\"uint32\"},{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.TokenBucket\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"getCurrentOutboundRateLimiterState\",\"outputs\":[{\"components\":[{\"internalType\":\"uint128\",\"name\":\"tokens\",\"type\":\"uint128\"},{\"internalType\":\"uint32\",\"name\":\"lastUpdated\",\"type\":\"uint32\"},{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.TokenBucket\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getLockReleaseInterfaceId\",\"outputs\":[{\"internalType\":\"bytes4\",\"name\":\"\",\"type\":\"bytes4\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRateLimitAdmin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRebalancer\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRouter\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"router\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getSupportedChains\",\"outputs\":[{\"internalType\":\"uint64[]\",\"name\":\"\",\"type\":\"uint64[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getToken\",\"outputs\":[{\"internalType\":\"contractIERC20\",\"name\":\"token\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"isSupportedChain\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"originalSender\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"lockOrBurn\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"provideLiquidity\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"releaseOrMint\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"outboundConfig\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"inboundConfig\",\"type\":\"tuple\"}],\"name\":\"setChainRateLimiterConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"rateLimitAdmin\",\"type\":\"address\"}],\"name\":\"setRateLimitAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"rebalancer\",\"type\":\"address\"}],\"name\":\"setRebalancer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newRouter\",\"type\":\"address\"}],\"name\":\"setRouter\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"withdrawLiquidity\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", + Bin: "0x6101006040523480156200001257600080fd5b5060405162003dd738038062003dd7833981016040819052620000359162000566565b848484833380600081620000905760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000c357620000c3816200016b565b5050506001600160a01b0384161580620000e457506001600160a01b038116155b1562000103576040516342bcdf7f60e11b815260040160405180910390fd5b6001600160a01b0384811660805282811660a052600480546001600160a01b031916918316919091179055825115801560c052620001565760408051600081526020810190915262000156908462000216565b5050505090151560e05250620006fd92505050565b336001600160a01b03821603620001c55760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640162000087565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b60c05162000237576040516335f4a7b360e01b815260040160405180910390fd5b60005b8251811015620002cc5760008382815181106200025b576200025b62000689565b602090810291909101015190506200027560028262000387565b15620002b8576040516001600160a01b03821681527f800671136ab6cfee9fbe5ed1fb7ca417811aca3cf864800d127b927adedf75669060200160405180910390a15b50620002c481620006b5565b90506200023a565b5060005b815181101562000382576000828281518110620002f157620002f162000689565b6020026020010151905060006001600160a01b0316816001600160a01b0316036200031d57506200036f565b6200032a600282620003a7565b156200036d576040516001600160a01b03821681527f2640d4d76caf8bf478aabfa982fa4e1c4eb71a37f93cd15e80dbc657911546d89060200160405180910390a15b505b6200037a81620006b5565b9050620002d0565b505050565b60006200039e836001600160a01b038416620003be565b90505b92915050565b60006200039e836001600160a01b038416620004c2565b60008181526001830160205260408120548015620004b7576000620003e5600183620006d1565b8554909150600090620003fb90600190620006d1565b9050818114620004675760008660000182815481106200041f576200041f62000689565b906000526020600020015490508087600001848154811062000445576200044562000689565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806200047b576200047b620006e7565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050620003a1565b6000915050620003a1565b60008181526001830160205260408120546200050b57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155620003a1565b506000620003a1565b6001600160a01b03811681146200052a57600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b8051620005508162000514565b919050565b805180151581146200055057600080fd5b600080600080600060a086880312156200057f57600080fd5b85516200058c8162000514565b602087810151919650906001600160401b0380821115620005ac57600080fd5b818901915089601f830112620005c157600080fd5b815181811115620005d657620005d66200052d565b8060051b604051601f19603f83011681018181108582111715620005fe57620005fe6200052d565b60405291825284820192508381018501918c8311156200061d57600080fd5b938501935b828510156200064657620006368562000543565b8452938501939285019262000622565b8099505050505050506200065d6040870162000543565b92506200066d6060870162000555565b91506200067d6080870162000543565b90509295509295909350565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201620006ca57620006ca6200069f565b5060010190565b81810381811115620003a157620003a16200069f565b634e487b7160e01b600052603160045260246000fd5b60805160a05160c05160e051613653620007846000396000818161047501526118ac0152600081816104e9015281816113320152611bcb0152600081816102b60152818161106301526113b601526000818161025101528181610663015281816107350152818161114b0152818161196e01528181611f0b0152611f9601526136536000f3fe608060405234801561001057600080fd5b50600436106101c45760003560e01c80638bfca18c116100f9578063c0d7865511610097578063cf7401f311610071578063cf7401f3146104d4578063e0351e13146104e7578063eb521a4c1461050d578063f2fde38b1461052057600080fd5b8063c0d7865514610499578063c4bffe2b146104ac578063c75eea9c146104c157600080fd5b8063a7cd63b7116100d3578063a7cd63b7146103d1578063af58d59f146103e6578063b0f479a114610455578063bb98546b1461047357600080fd5b80638bfca18c146103725780638da5cb5b146103a057806396875445146103be57600080fd5b80635995f0631161016657806379ba50971161014057806379ba5097146103315780637d54534e146103395780638627fad61461034c5780638926f54f1461035f57600080fd5b80635995f063146102ed5780636cfd1553146103005780636d3d1a581461031357600080fd5b806321df0da7116101a257806321df0da71461024f578063432a6ba3146102965780635246492f146102b457806354c8a4f3146102da57600080fd5b806301ffc9a7146101c95780630a861f2a146101f1578063181f5a7714610206575b600080fd5b6101dc6101d7366004612d09565b610533565b60405190151581526020015b60405180910390f35b6102046101ff366004612d4b565b6105db565b005b6102426040518060400160405280601a81526020017f4c6f636b52656c65617365546f6b656e506f6f6c20312e342e3000000000000081525081565b6040516101e89190612dd2565b7f00000000000000000000000000000000000000000000000000000000000000005b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101e8565b60095473ffffffffffffffffffffffffffffffffffffffff16610271565b7f0000000000000000000000000000000000000000000000000000000000000000610271565b6102046102e8366004612e31565b61078c565b6102046102fb366004612e9d565b610807565b61020461030e366004612f34565b610d9f565b600a5473ffffffffffffffffffffffffffffffffffffffff16610271565b610204610dee565b610204610347366004612f34565b610eeb565b61020461035a366004613048565b610f3a565b6101dc61036d3660046130dc565b6111c7565b6040517f98a471770000000000000000000000000000000000000000000000000000000081526020016101e8565b60005473ffffffffffffffffffffffffffffffffffffffff16610271565b6102426103cc366004613139565b6111de565b6103d96114d6565b6040516101e891906131d9565b6103f96103f43660046130dc565b6114e7565b6040516101e8919081516fffffffffffffffffffffffffffffffff908116825260208084015163ffffffff1690830152604080840151151590830152606080840151821690830152608092830151169181019190915260a00190565b60045473ffffffffffffffffffffffffffffffffffffffff16610271565b7f00000000000000000000000000000000000000000000000000000000000000006101dc565b6102046104a7366004612f34565b6115b9565b6104b4611694565b6040516101e89190613233565b6103f96104cf3660046130dc565b611754565b6102046104e2366004613314565b611826565b7f00000000000000000000000000000000000000000000000000000000000000006101dc565b61020461051b366004612d4b565b6118aa565b61020461052e366004612f34565b6119c6565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f98a471770000000000000000000000000000000000000000000000000000000014806105c657507fffffffff0000000000000000000000000000000000000000000000000000000082167fe1d4056600000000000000000000000000000000000000000000000000000000145b806105d557506105d5826119da565b92915050565b60095473ffffffffffffffffffffffffffffffffffffffff163314610633576040517f8e4a23d60000000000000000000000000000000000000000000000000000000081523360048201526024015b60405180910390fd5b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015281907f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16906370a0823190602401602060405180830381865afa1580156106bf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106e39190613359565b101561071b576040517fbb55fd2700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61075c73ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000163383611a72565b604051819033907fc2c3f06e49b9f15e7b4af9055e183b0d73362e033ad82a07dec9bf984017171990600090a350565b610794611b46565b61080184848080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808802828101820190935287825290935087925086918291850190849080828437600092019190915250611bc992505050565b50505050565b61080f611b46565b60005b81811015610d9a57600083838381811061082e5761082e613372565b9050610100020180360381019061084591906133a1565b905061085a8160400151826020015115611d8f565b61086d8160600151826020015115611d8f565b806020015115610c8e57805161088f9060059067ffffffffffffffff16611ecc565b6108d45780516040517f1d5ad3c500000000000000000000000000000000000000000000000000000000815267ffffffffffffffff909116600482015260240161062a565b6040518060a001604052808260400151602001516fffffffffffffffffffffffffffffffff1681526020014263ffffffff168152602001826040015160000151151581526020018260400151602001516fffffffffffffffffffffffffffffffff1681526020018260400151604001516fffffffffffffffffffffffffffffffff1681525060076000836000015167ffffffffffffffff1667ffffffffffffffff16815260200190815260200160002060008201518160000160006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555060208201518160000160106101000a81548163ffffffff021916908363ffffffff16021790555060408201518160000160146101000a81548160ff02191690831515021790555060608201518160010160006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555060808201518160010160106101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff1602179055509050506040518060a001604052808260600151602001516fffffffffffffffffffffffffffffffff1681526020014263ffffffff168152602001826060015160000151151581526020018260600151602001516fffffffffffffffffffffffffffffffff1681526020018260600151604001516fffffffffffffffffffffffffffffffff1681525060086000836000015167ffffffffffffffff1667ffffffffffffffff16815260200190815260200160002060008201518160000160006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555060208201518160000160106101000a81548163ffffffff021916908363ffffffff16021790555060408201518160000160146101000a81548160ff02191690831515021790555060608201518160010160006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555060808201518160010160106101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff1602179055509050507f0f135cbb9afa12a8bf3bbd071c117bcca4ddeca6160ef7f33d012a81b9c0c471816000015182604001518360600151604051610c8193929190613423565b60405180910390a1610d89565b8051610ca69060059067ffffffffffffffff16611edf565b610ceb5780516040517f1e670e4b00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff909116600482015260240161062a565b805167ffffffffffffffff908116600090815260086020908152604080832080547fffffffffffffffffffffff0000000000000000000000000000000000000000009081168255600191820185905586518616855260078452828520805490911681550192909255835191519190921681527f5204aec90a3c794d8e90fded8b46ae9c7c552803e7e832e0c1d358396d859916910160405180910390a15b50610d93816134d5565b9050610812565b505050565b610da7611b46565b600980547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60015473ffffffffffffffffffffffffffffffffffffffff163314610e6f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e657200000000000000000000604482015260640161062a565b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b610ef3611b46565b600a80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b81610f44816111c7565b610f86576040517fa9902c7e00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff8216600482015260240161062a565b600480546040517f83826b2b00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff84169281019290925233602483015273ffffffffffffffffffffffffffffffffffffffff16906383826b2b90604401602060405180830381865afa158015611005573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611029919061350d565b611061576040517f728fe07b00000000000000000000000000000000000000000000000000000000815233600482015260240161062a565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663397796f76040518163ffffffff1660e01b8152600401602060405180830381865afa1580156110cc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110f0919061350d565b15611127576040517fc148371500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6111318385611eeb565b61117273ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168686611a72565b60405184815273ffffffffffffffffffffffffffffffffffffffff86169033907f2d87480f50083e2b2759522a8fdda59802650a8055e609a7772cf70c07748f529060200160405180910390a3505050505050565b60006105d5600567ffffffffffffffff8416611f2f565b6060836111ea816111c7565b61122c576040517fa9902c7e00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff8216600482015260240161062a565b600480546040517fa8d87a3b00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff84169281019290925273ffffffffffffffffffffffffffffffffffffffff169063a8d87a3b90602401602060405180830381865afa1580156112a5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112c9919061352a565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461132f576040517f728fe07b00000000000000000000000000000000000000000000000000000000815233600482015260240161062a565b887f000000000000000000000000000000000000000000000000000000000000000080156113655750611363600282611f47565b155b156113b4576040517fd0d2597600000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8216600482015260240161062a565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663397796f76040518163ffffffff1660e01b8152600401602060405180830381865afa15801561141f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611443919061350d565b1561147a576040517fc148371500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6114848688611f76565b60405187815233907f9f1ec8c880f76798e7b793325d625e9b60e4082a553c98f42b6cda368dd600089060200160405180910390a2505060408051602081019091526000815298975050505050505050565b60606114e26002611fba565b905090565b6040805160a08101825260008082526020820181905291810182905260608101829052608081019190915267ffffffffffffffff8216600090815260086020908152604091829020825160a08101845281546fffffffffffffffffffffffffffffffff808216835270010000000000000000000000000000000080830463ffffffff16958401959095527401000000000000000000000000000000000000000090910460ff1615159482019490945260019091015480841660608301529190910490911660808201526105d590611fc7565b6115c1611b46565b73ffffffffffffffffffffffffffffffffffffffff811661160e576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6004805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff000000000000000000000000000000000000000083168117909355604080519190921680825260208201939093527f02dc5c233404867c793b749c6d644beb2277536d18a7e7974d3f238e4c6f1684910160405180910390a15050565b606060006116a26005611fba565b90506000815167ffffffffffffffff8111156116c0576116c0612f51565b6040519080825280602002602001820160405280156116e9578160200160208202803683370190505b50905060005b825181101561174d5782818151811061170a5761170a613372565b602002602001015182828151811061172457611724613372565b67ffffffffffffffff90921660209283029190910190910152611746816134d5565b90506116ef565b5092915050565b6040805160a08101825260008082526020820181905291810182905260608101829052608081019190915267ffffffffffffffff8216600090815260076020908152604091829020825160a08101845281546fffffffffffffffffffffffffffffffff808216835270010000000000000000000000000000000080830463ffffffff16958401959095527401000000000000000000000000000000000000000090910460ff1615159482019490945260019091015480841660608301529190910490911660808201526105d590611fc7565b600a5473ffffffffffffffffffffffffffffffffffffffff163314801590611866575060005473ffffffffffffffffffffffffffffffffffffffff163314155b1561189f576040517f8e4a23d600000000000000000000000000000000000000000000000000000000815233600482015260240161062a565b610d9a838383612079565b7f0000000000000000000000000000000000000000000000000000000000000000611901576040517fe93f8fa400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60095473ffffffffffffffffffffffffffffffffffffffff163314611954576040517f8e4a23d600000000000000000000000000000000000000000000000000000000815233600482015260240161062a565b61199673ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016333084612160565b604051819033907fc17cea59c2955cb181b03393209566960365771dbba9dc3d510180e7cb31208890600090a350565b6119ce611b46565b6119d7816121be565b50565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f317fa3340000000000000000000000000000000000000000000000000000000014806105d557507fffffffff0000000000000000000000000000000000000000000000000000000082167f01ffc9a7000000000000000000000000000000000000000000000000000000001492915050565b60405173ffffffffffffffffffffffffffffffffffffffff8316602482015260448101829052610d9a9084907fa9059cbb00000000000000000000000000000000000000000000000000000000906064015b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff00000000000000000000000000000000000000000000000000000000909316929092179091526122b3565b60005473ffffffffffffffffffffffffffffffffffffffff163314611bc7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e657200000000000000000000604482015260640161062a565b565b7f0000000000000000000000000000000000000000000000000000000000000000611c20576040517f35f4a7b300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b8251811015611cbe576000838281518110611c4057611c40613372565b60200260200101519050611c5e8160026123bf90919063ffffffff16565b15611cad5760405173ffffffffffffffffffffffffffffffffffffffff821681527f800671136ab6cfee9fbe5ed1fb7ca417811aca3cf864800d127b927adedf75669060200160405180910390a15b50611cb7816134d5565b9050611c23565b5060005b8151811015610d9a576000828281518110611cdf57611cdf613372565b60200260200101519050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603611d235750611d7f565b611d2e6002826123e1565b15611d7d5760405173ffffffffffffffffffffffffffffffffffffffff821681527f2640d4d76caf8bf478aabfa982fa4e1c4eb71a37f93cd15e80dbc657911546d89060200160405180910390a15b505b611d88816134d5565b9050611cc2565b815115611e5a5781602001516fffffffffffffffffffffffffffffffff1682604001516fffffffffffffffffffffffffffffffff16101580611de5575060408201516fffffffffffffffffffffffffffffffff16155b15611e1e57816040517f70505e5600000000000000000000000000000000000000000000000000000000815260040161062a9190613547565b8015611e56576040517f433fc33d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5050565b60408201516fffffffffffffffffffffffffffffffff16151580611e93575060208201516fffffffffffffffffffffffffffffffff1615155b15611e5657816040517fd68af9cc00000000000000000000000000000000000000000000000000000000815260040161062a9190613547565b6000611ed883836123ff565b9392505050565b6000611ed8838361244e565b67ffffffffffffffff82166000908152600860205260409020611e5690827f0000000000000000000000000000000000000000000000000000000000000000612541565b60008181526001830160205260408120541515611ed8565b73ffffffffffffffffffffffffffffffffffffffff811660009081526001830160205260408120541515611ed8565b67ffffffffffffffff82166000908152600760205260409020611e5690827f0000000000000000000000000000000000000000000000000000000000000000612541565b60606000611ed8836128c4565b6040805160a08101825260008082526020820181905291810182905260608101829052608081019190915261205582606001516fffffffffffffffffffffffffffffffff1683600001516fffffffffffffffffffffffffffffffff16846020015163ffffffff16426120399190613583565b85608001516fffffffffffffffffffffffffffffffff16612920565b6fffffffffffffffffffffffffffffffff1682525063ffffffff4216602082015290565b612082836111c7565b6120c4576040517f1e670e4b00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff8416600482015260240161062a565b6120cf826000611d8f565b67ffffffffffffffff831660009081526007602052604090206120f2908361294a565b6120fd816000611d8f565b67ffffffffffffffff83166000908152600860205260409020612120908261294a565b7f0350d63aa5f270e01729d00d627eeb8f3429772b1818c016c66a588a864f912b83838360405161215393929190613423565b60405180910390a1505050565b60405173ffffffffffffffffffffffffffffffffffffffff808516602483015283166044820152606481018290526108019085907f23b872dd0000000000000000000000000000000000000000000000000000000090608401611ac4565b3373ffffffffffffffffffffffffffffffffffffffff82160361223d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640161062a565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b6000612315826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16612aec9092919063ffffffff16565b805190915015610d9a5780806020019051810190612333919061350d565b610d9a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f74207375636365656400000000000000000000000000000000000000000000606482015260840161062a565b6000611ed88373ffffffffffffffffffffffffffffffffffffffff841661244e565b6000611ed88373ffffffffffffffffffffffffffffffffffffffff84165b6000818152600183016020526040812054612446575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556105d5565b5060006105d5565b60008181526001830160205260408120548015612537576000612472600183613583565b855490915060009061248690600190613583565b90508181146124eb5760008660000182815481106124a6576124a6613372565b90600052602060002001549050808760000184815481106124c9576124c9613372565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806124fc576124fc613596565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506105d5565b60009150506105d5565b825474010000000000000000000000000000000000000000900460ff161580612568575081155b1561257257505050565b825460018401546fffffffffffffffffffffffffffffffff808316929116906000906125b890700100000000000000000000000000000000900463ffffffff1642613583565b9050801561267857818311156125fa576040517f9725942a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60018601546126349083908590849070010000000000000000000000000000000090046fffffffffffffffffffffffffffffffff16612920565b86547fffffffffffffffffffffffff00000000ffffffffffffffffffffffffffffffff167001000000000000000000000000000000004263ffffffff160217875592505b8482101561272f5773ffffffffffffffffffffffffffffffffffffffff84166126d7576040517ff94ebcd1000000000000000000000000000000000000000000000000000000008152600481018390526024810186905260440161062a565b6040517f1a76572a000000000000000000000000000000000000000000000000000000008152600481018390526024810186905273ffffffffffffffffffffffffffffffffffffffff8516604482015260640161062a565b848310156128425760018681015470010000000000000000000000000000000090046fffffffffffffffffffffffffffffffff169060009082906127739082613583565b61277d878a613583565b61278791906135c5565b61279191906135d8565b905073ffffffffffffffffffffffffffffffffffffffff86166127ea576040517f15279c08000000000000000000000000000000000000000000000000000000008152600481018290526024810186905260440161062a565b6040517fd0c8d23a000000000000000000000000000000000000000000000000000000008152600481018290526024810186905273ffffffffffffffffffffffffffffffffffffffff8716604482015260640161062a565b61284c8584613583565b86547fffffffffffffffffffffffffffffffff00000000000000000000000000000000166fffffffffffffffffffffffffffffffff82161787556040518681529093507f1871cdf8010e63f2eb8384381a68dfa7416dc571a5517e66e88b2d2d0c0a690a9060200160405180910390a1505050505050565b60608160000180548060200260200160405190810160405280929190818152602001828054801561291457602002820191906000526020600020905b815481526020019060010190808311612900575b50505050509050919050565b600061293f856129308486613613565b61293a90876135c5565b612afb565b90505b949350505050565b815460009061297390700100000000000000000000000000000000900463ffffffff1642613583565b90508015612a1557600183015483546129bb916fffffffffffffffffffffffffffffffff80821692811691859170010000000000000000000000000000000090910416612920565b83546fffffffffffffffffffffffffffffffff919091167fffffffffffffffffffffffff0000000000000000000000000000000000000000909116177001000000000000000000000000000000004263ffffffff16021783555b60208201518354612a3b916fffffffffffffffffffffffffffffffff9081169116612afb565b83548351151574010000000000000000000000000000000000000000027fffffffffffffffffffffff00ffffffff000000000000000000000000000000009091166fffffffffffffffffffffffffffffffff92831617178455602083015160408085015183167001000000000000000000000000000000000291909216176001850155517f9ea3374b67bf275e6bb9c8ae68f9cae023e1c528b4b27e092f0bb209d3531c1990612153908490613547565b60606129428484600085612b11565b6000818310612b0a5781611ed8565b5090919050565b606082471015612ba3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161062a565b6000808673ffffffffffffffffffffffffffffffffffffffff168587604051612bcc919061362a565b60006040518083038185875af1925050503d8060008114612c09576040519150601f19603f3d011682016040523d82523d6000602084013e612c0e565b606091505b5091509150612c1f87838387612c2a565b979650505050505050565b60608315612cc0578251600003612cb95773ffffffffffffffffffffffffffffffffffffffff85163b612cb9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161062a565b5081612942565b6129428383815115612cd55781518083602001fd5b806040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161062a9190612dd2565b600060208284031215612d1b57600080fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114611ed857600080fd5b600060208284031215612d5d57600080fd5b5035919050565b60005b83811015612d7f578181015183820152602001612d67565b50506000910152565b60008151808452612da0816020860160208601612d64565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b602081526000611ed86020830184612d88565b60008083601f840112612df757600080fd5b50813567ffffffffffffffff811115612e0f57600080fd5b6020830191508360208260051b8501011115612e2a57600080fd5b9250929050565b60008060008060408587031215612e4757600080fd5b843567ffffffffffffffff80821115612e5f57600080fd5b612e6b88838901612de5565b90965094506020870135915080821115612e8457600080fd5b50612e9187828801612de5565b95989497509550505050565b60008060208385031215612eb057600080fd5b823567ffffffffffffffff80821115612ec857600080fd5b818501915085601f830112612edc57600080fd5b813581811115612eeb57600080fd5b8660208260081b8501011115612f0057600080fd5b60209290920196919550909350505050565b73ffffffffffffffffffffffffffffffffffffffff811681146119d757600080fd5b600060208284031215612f4657600080fd5b8135611ed881612f12565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600082601f830112612f9157600080fd5b813567ffffffffffffffff80821115612fac57612fac612f51565b604051601f83017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f01168101908282118183101715612ff257612ff2612f51565b8160405283815286602085880101111561300b57600080fd5b836020870160208301376000602085830101528094505050505092915050565b803567ffffffffffffffff8116811461304357600080fd5b919050565b600080600080600060a0868803121561306057600080fd5b853567ffffffffffffffff8082111561307857600080fd5b61308489838a01612f80565b96506020880135915061309682612f12565b819550604088013594506130ac6060890161302b565b935060808801359150808211156130c257600080fd5b506130cf88828901612f80565b9150509295509295909350565b6000602082840312156130ee57600080fd5b611ed88261302b565b60008083601f84011261310957600080fd5b50813567ffffffffffffffff81111561312157600080fd5b602083019150836020828501011115612e2a57600080fd5b600080600080600080600060a0888a03121561315457600080fd5b873561315f81612f12565b9650602088013567ffffffffffffffff8082111561317c57600080fd5b6131888b838c016130f7565b909850965060408a013595508691506131a360608b0161302b565b945060808a01359150808211156131b957600080fd5b506131c68a828b016130f7565b989b979a50959850939692959293505050565b6020808252825182820181905260009190848201906040850190845b8181101561322757835173ffffffffffffffffffffffffffffffffffffffff16835292840192918401916001016131f5565b50909695505050505050565b6020808252825182820181905260009190848201906040850190845b8181101561322757835167ffffffffffffffff168352928401929184019160010161324f565b80151581146119d757600080fd5b80356fffffffffffffffffffffffffffffffff8116811461304357600080fd5b6000606082840312156132b557600080fd5b6040516060810181811067ffffffffffffffff821117156132d8576132d8612f51565b60405290508082356132e981613275565b81526132f760208401613283565b602082015261330860408401613283565b60408201525092915050565b600080600060e0848603121561332957600080fd5b6133328461302b565b925061334185602086016132a3565b915061335085608086016132a3565b90509250925092565b60006020828403121561336b57600080fd5b5051919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600061010082840312156133b457600080fd5b6040516080810181811067ffffffffffffffff821117156133d7576133d7612f51565b6040526133e38361302b565b815260208301356133f381613275565b602082015261340584604085016132a3565b60408201526134178460a085016132a3565b60608201529392505050565b67ffffffffffffffff8416815260e0810161346f60208301858051151582526020808201516fffffffffffffffffffffffffffffffff9081169184019190915260409182015116910152565b82511515608083015260208301516fffffffffffffffffffffffffffffffff90811660a084015260408401511660c0830152612942565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203613506576135066134a6565b5060010190565b60006020828403121561351f57600080fd5b8151611ed881613275565b60006020828403121561353c57600080fd5b8151611ed881612f12565b606081016105d582848051151582526020808201516fffffffffffffffffffffffffffffffff9081169184019190915260409182015116910152565b818103818111156105d5576105d56134a6565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b808201808211156105d5576105d56134a6565b60008261360e577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b80820281158282048414176105d5576105d56134a6565b6000825161363c818460208701612d64565b919091019291505056fea164736f6c6343000813000a", +} + +var LockReleaseTokenPoolABI = LockReleaseTokenPoolMetaData.ABI + +var LockReleaseTokenPoolBin = LockReleaseTokenPoolMetaData.Bin + +func DeployLockReleaseTokenPool(auth *bind.TransactOpts, backend bind.ContractBackend, token common.Address, allowlist []common.Address, armProxy common.Address, acceptLiquidity bool, router common.Address) (common.Address, *types.Transaction, *LockReleaseTokenPool, error) { + parsed, err := LockReleaseTokenPoolMetaData.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(LockReleaseTokenPoolBin), backend, token, allowlist, armProxy, acceptLiquidity, router) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &LockReleaseTokenPool{address: address, abi: *parsed, LockReleaseTokenPoolCaller: LockReleaseTokenPoolCaller{contract: contract}, LockReleaseTokenPoolTransactor: LockReleaseTokenPoolTransactor{contract: contract}, LockReleaseTokenPoolFilterer: LockReleaseTokenPoolFilterer{contract: contract}}, nil +} + +type LockReleaseTokenPool struct { + address common.Address + abi abi.ABI + LockReleaseTokenPoolCaller + LockReleaseTokenPoolTransactor + LockReleaseTokenPoolFilterer +} + +type LockReleaseTokenPoolCaller struct { + contract *bind.BoundContract +} + +type LockReleaseTokenPoolTransactor struct { + contract *bind.BoundContract +} + +type LockReleaseTokenPoolFilterer struct { + contract *bind.BoundContract +} + +type LockReleaseTokenPoolSession struct { + Contract *LockReleaseTokenPool + CallOpts bind.CallOpts + TransactOpts bind.TransactOpts +} + +type LockReleaseTokenPoolCallerSession struct { + Contract *LockReleaseTokenPoolCaller + CallOpts bind.CallOpts +} + +type LockReleaseTokenPoolTransactorSession struct { + Contract *LockReleaseTokenPoolTransactor + TransactOpts bind.TransactOpts +} + +type LockReleaseTokenPoolRaw struct { + Contract *LockReleaseTokenPool +} + +type LockReleaseTokenPoolCallerRaw struct { + Contract *LockReleaseTokenPoolCaller +} + +type LockReleaseTokenPoolTransactorRaw struct { + Contract *LockReleaseTokenPoolTransactor +} + +func NewLockReleaseTokenPool(address common.Address, backend bind.ContractBackend) (*LockReleaseTokenPool, error) { + abi, err := abi.JSON(strings.NewReader(LockReleaseTokenPoolABI)) + if err != nil { + return nil, err + } + contract, err := bindLockReleaseTokenPool(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &LockReleaseTokenPool{address: address, abi: abi, LockReleaseTokenPoolCaller: LockReleaseTokenPoolCaller{contract: contract}, LockReleaseTokenPoolTransactor: LockReleaseTokenPoolTransactor{contract: contract}, LockReleaseTokenPoolFilterer: LockReleaseTokenPoolFilterer{contract: contract}}, nil +} + +func NewLockReleaseTokenPoolCaller(address common.Address, caller bind.ContractCaller) (*LockReleaseTokenPoolCaller, error) { + contract, err := bindLockReleaseTokenPool(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &LockReleaseTokenPoolCaller{contract: contract}, nil +} + +func NewLockReleaseTokenPoolTransactor(address common.Address, transactor bind.ContractTransactor) (*LockReleaseTokenPoolTransactor, error) { + contract, err := bindLockReleaseTokenPool(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &LockReleaseTokenPoolTransactor{contract: contract}, nil +} + +func NewLockReleaseTokenPoolFilterer(address common.Address, filterer bind.ContractFilterer) (*LockReleaseTokenPoolFilterer, error) { + contract, err := bindLockReleaseTokenPool(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &LockReleaseTokenPoolFilterer{contract: contract}, nil +} + +func bindLockReleaseTokenPool(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := LockReleaseTokenPoolMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _LockReleaseTokenPool.Contract.LockReleaseTokenPoolCaller.contract.Call(opts, result, method, params...) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _LockReleaseTokenPool.Contract.LockReleaseTokenPoolTransactor.contract.Transfer(opts) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _LockReleaseTokenPool.Contract.LockReleaseTokenPoolTransactor.contract.Transact(opts, method, params...) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _LockReleaseTokenPool.Contract.contract.Call(opts, result, method, params...) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _LockReleaseTokenPool.Contract.contract.Transfer(opts) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _LockReleaseTokenPool.Contract.contract.Transact(opts, method, params...) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolCaller) CanAcceptLiquidity(opts *bind.CallOpts) (bool, error) { + var out []interface{} + err := _LockReleaseTokenPool.contract.Call(opts, &out, "canAcceptLiquidity") + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolSession) CanAcceptLiquidity() (bool, error) { + return _LockReleaseTokenPool.Contract.CanAcceptLiquidity(&_LockReleaseTokenPool.CallOpts) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolCallerSession) CanAcceptLiquidity() (bool, error) { + return _LockReleaseTokenPool.Contract.CanAcceptLiquidity(&_LockReleaseTokenPool.CallOpts) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolCaller) GetAllowList(opts *bind.CallOpts) ([]common.Address, error) { + var out []interface{} + err := _LockReleaseTokenPool.contract.Call(opts, &out, "getAllowList") + + if err != nil { + return *new([]common.Address), err + } + + out0 := *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) + + return out0, err + +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolSession) GetAllowList() ([]common.Address, error) { + return _LockReleaseTokenPool.Contract.GetAllowList(&_LockReleaseTokenPool.CallOpts) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolCallerSession) GetAllowList() ([]common.Address, error) { + return _LockReleaseTokenPool.Contract.GetAllowList(&_LockReleaseTokenPool.CallOpts) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolCaller) GetAllowListEnabled(opts *bind.CallOpts) (bool, error) { + var out []interface{} + err := _LockReleaseTokenPool.contract.Call(opts, &out, "getAllowListEnabled") + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolSession) GetAllowListEnabled() (bool, error) { + return _LockReleaseTokenPool.Contract.GetAllowListEnabled(&_LockReleaseTokenPool.CallOpts) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolCallerSession) GetAllowListEnabled() (bool, error) { + return _LockReleaseTokenPool.Contract.GetAllowListEnabled(&_LockReleaseTokenPool.CallOpts) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolCaller) GetArmProxy(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _LockReleaseTokenPool.contract.Call(opts, &out, "getArmProxy") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolSession) GetArmProxy() (common.Address, error) { + return _LockReleaseTokenPool.Contract.GetArmProxy(&_LockReleaseTokenPool.CallOpts) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolCallerSession) GetArmProxy() (common.Address, error) { + return _LockReleaseTokenPool.Contract.GetArmProxy(&_LockReleaseTokenPool.CallOpts) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolCaller) GetCurrentInboundRateLimiterState(opts *bind.CallOpts, remoteChainSelector uint64) (RateLimiterTokenBucket, error) { + var out []interface{} + err := _LockReleaseTokenPool.contract.Call(opts, &out, "getCurrentInboundRateLimiterState", remoteChainSelector) + + if err != nil { + return *new(RateLimiterTokenBucket), err + } + + out0 := *abi.ConvertType(out[0], new(RateLimiterTokenBucket)).(*RateLimiterTokenBucket) + + return out0, err + +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolSession) GetCurrentInboundRateLimiterState(remoteChainSelector uint64) (RateLimiterTokenBucket, error) { + return _LockReleaseTokenPool.Contract.GetCurrentInboundRateLimiterState(&_LockReleaseTokenPool.CallOpts, remoteChainSelector) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolCallerSession) GetCurrentInboundRateLimiterState(remoteChainSelector uint64) (RateLimiterTokenBucket, error) { + return _LockReleaseTokenPool.Contract.GetCurrentInboundRateLimiterState(&_LockReleaseTokenPool.CallOpts, remoteChainSelector) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolCaller) GetCurrentOutboundRateLimiterState(opts *bind.CallOpts, remoteChainSelector uint64) (RateLimiterTokenBucket, error) { + var out []interface{} + err := _LockReleaseTokenPool.contract.Call(opts, &out, "getCurrentOutboundRateLimiterState", remoteChainSelector) + + if err != nil { + return *new(RateLimiterTokenBucket), err + } + + out0 := *abi.ConvertType(out[0], new(RateLimiterTokenBucket)).(*RateLimiterTokenBucket) + + return out0, err + +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolSession) GetCurrentOutboundRateLimiterState(remoteChainSelector uint64) (RateLimiterTokenBucket, error) { + return _LockReleaseTokenPool.Contract.GetCurrentOutboundRateLimiterState(&_LockReleaseTokenPool.CallOpts, remoteChainSelector) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolCallerSession) GetCurrentOutboundRateLimiterState(remoteChainSelector uint64) (RateLimiterTokenBucket, error) { + return _LockReleaseTokenPool.Contract.GetCurrentOutboundRateLimiterState(&_LockReleaseTokenPool.CallOpts, remoteChainSelector) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolCaller) GetLockReleaseInterfaceId(opts *bind.CallOpts) ([4]byte, error) { + var out []interface{} + err := _LockReleaseTokenPool.contract.Call(opts, &out, "getLockReleaseInterfaceId") + + if err != nil { + return *new([4]byte), err + } + + out0 := *abi.ConvertType(out[0], new([4]byte)).(*[4]byte) + + return out0, err + +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolSession) GetLockReleaseInterfaceId() ([4]byte, error) { + return _LockReleaseTokenPool.Contract.GetLockReleaseInterfaceId(&_LockReleaseTokenPool.CallOpts) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolCallerSession) GetLockReleaseInterfaceId() ([4]byte, error) { + return _LockReleaseTokenPool.Contract.GetLockReleaseInterfaceId(&_LockReleaseTokenPool.CallOpts) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolCaller) GetRateLimitAdmin(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _LockReleaseTokenPool.contract.Call(opts, &out, "getRateLimitAdmin") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolSession) GetRateLimitAdmin() (common.Address, error) { + return _LockReleaseTokenPool.Contract.GetRateLimitAdmin(&_LockReleaseTokenPool.CallOpts) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolCallerSession) GetRateLimitAdmin() (common.Address, error) { + return _LockReleaseTokenPool.Contract.GetRateLimitAdmin(&_LockReleaseTokenPool.CallOpts) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolCaller) GetRebalancer(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _LockReleaseTokenPool.contract.Call(opts, &out, "getRebalancer") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolSession) GetRebalancer() (common.Address, error) { + return _LockReleaseTokenPool.Contract.GetRebalancer(&_LockReleaseTokenPool.CallOpts) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolCallerSession) GetRebalancer() (common.Address, error) { + return _LockReleaseTokenPool.Contract.GetRebalancer(&_LockReleaseTokenPool.CallOpts) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolCaller) GetRouter(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _LockReleaseTokenPool.contract.Call(opts, &out, "getRouter") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolSession) GetRouter() (common.Address, error) { + return _LockReleaseTokenPool.Contract.GetRouter(&_LockReleaseTokenPool.CallOpts) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolCallerSession) GetRouter() (common.Address, error) { + return _LockReleaseTokenPool.Contract.GetRouter(&_LockReleaseTokenPool.CallOpts) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolCaller) GetSupportedChains(opts *bind.CallOpts) ([]uint64, error) { + var out []interface{} + err := _LockReleaseTokenPool.contract.Call(opts, &out, "getSupportedChains") + + if err != nil { + return *new([]uint64), err + } + + out0 := *abi.ConvertType(out[0], new([]uint64)).(*[]uint64) + + return out0, err + +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolSession) GetSupportedChains() ([]uint64, error) { + return _LockReleaseTokenPool.Contract.GetSupportedChains(&_LockReleaseTokenPool.CallOpts) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolCallerSession) GetSupportedChains() ([]uint64, error) { + return _LockReleaseTokenPool.Contract.GetSupportedChains(&_LockReleaseTokenPool.CallOpts) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolCaller) GetToken(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _LockReleaseTokenPool.contract.Call(opts, &out, "getToken") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolSession) GetToken() (common.Address, error) { + return _LockReleaseTokenPool.Contract.GetToken(&_LockReleaseTokenPool.CallOpts) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolCallerSession) GetToken() (common.Address, error) { + return _LockReleaseTokenPool.Contract.GetToken(&_LockReleaseTokenPool.CallOpts) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolCaller) IsSupportedChain(opts *bind.CallOpts, remoteChainSelector uint64) (bool, error) { + var out []interface{} + err := _LockReleaseTokenPool.contract.Call(opts, &out, "isSupportedChain", remoteChainSelector) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolSession) IsSupportedChain(remoteChainSelector uint64) (bool, error) { + return _LockReleaseTokenPool.Contract.IsSupportedChain(&_LockReleaseTokenPool.CallOpts, remoteChainSelector) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolCallerSession) IsSupportedChain(remoteChainSelector uint64) (bool, error) { + return _LockReleaseTokenPool.Contract.IsSupportedChain(&_LockReleaseTokenPool.CallOpts, remoteChainSelector) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolCaller) Owner(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _LockReleaseTokenPool.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 + +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolSession) Owner() (common.Address, error) { + return _LockReleaseTokenPool.Contract.Owner(&_LockReleaseTokenPool.CallOpts) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolCallerSession) Owner() (common.Address, error) { + return _LockReleaseTokenPool.Contract.Owner(&_LockReleaseTokenPool.CallOpts) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolCaller) SupportsInterface(opts *bind.CallOpts, interfaceId [4]byte) (bool, error) { + var out []interface{} + err := _LockReleaseTokenPool.contract.Call(opts, &out, "supportsInterface", interfaceId) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolSession) SupportsInterface(interfaceId [4]byte) (bool, error) { + return _LockReleaseTokenPool.Contract.SupportsInterface(&_LockReleaseTokenPool.CallOpts, interfaceId) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolCallerSession) SupportsInterface(interfaceId [4]byte) (bool, error) { + return _LockReleaseTokenPool.Contract.SupportsInterface(&_LockReleaseTokenPool.CallOpts, interfaceId) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolCaller) TypeAndVersion(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _LockReleaseTokenPool.contract.Call(opts, &out, "typeAndVersion") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolSession) TypeAndVersion() (string, error) { + return _LockReleaseTokenPool.Contract.TypeAndVersion(&_LockReleaseTokenPool.CallOpts) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolCallerSession) TypeAndVersion() (string, error) { + return _LockReleaseTokenPool.Contract.TypeAndVersion(&_LockReleaseTokenPool.CallOpts) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolTransactor) AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + return _LockReleaseTokenPool.contract.Transact(opts, "acceptOwnership") +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolSession) AcceptOwnership() (*types.Transaction, error) { + return _LockReleaseTokenPool.Contract.AcceptOwnership(&_LockReleaseTokenPool.TransactOpts) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolTransactorSession) AcceptOwnership() (*types.Transaction, error) { + return _LockReleaseTokenPool.Contract.AcceptOwnership(&_LockReleaseTokenPool.TransactOpts) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolTransactor) ApplyAllowListUpdates(opts *bind.TransactOpts, removes []common.Address, adds []common.Address) (*types.Transaction, error) { + return _LockReleaseTokenPool.contract.Transact(opts, "applyAllowListUpdates", removes, adds) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolSession) ApplyAllowListUpdates(removes []common.Address, adds []common.Address) (*types.Transaction, error) { + return _LockReleaseTokenPool.Contract.ApplyAllowListUpdates(&_LockReleaseTokenPool.TransactOpts, removes, adds) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolTransactorSession) ApplyAllowListUpdates(removes []common.Address, adds []common.Address) (*types.Transaction, error) { + return _LockReleaseTokenPool.Contract.ApplyAllowListUpdates(&_LockReleaseTokenPool.TransactOpts, removes, adds) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolTransactor) ApplyChainUpdates(opts *bind.TransactOpts, chains []TokenPoolChainUpdate) (*types.Transaction, error) { + return _LockReleaseTokenPool.contract.Transact(opts, "applyChainUpdates", chains) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolSession) ApplyChainUpdates(chains []TokenPoolChainUpdate) (*types.Transaction, error) { + return _LockReleaseTokenPool.Contract.ApplyChainUpdates(&_LockReleaseTokenPool.TransactOpts, chains) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolTransactorSession) ApplyChainUpdates(chains []TokenPoolChainUpdate) (*types.Transaction, error) { + return _LockReleaseTokenPool.Contract.ApplyChainUpdates(&_LockReleaseTokenPool.TransactOpts, chains) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolTransactor) LockOrBurn(opts *bind.TransactOpts, originalSender common.Address, arg1 []byte, amount *big.Int, remoteChainSelector uint64, arg4 []byte) (*types.Transaction, error) { + return _LockReleaseTokenPool.contract.Transact(opts, "lockOrBurn", originalSender, arg1, amount, remoteChainSelector, arg4) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolSession) LockOrBurn(originalSender common.Address, arg1 []byte, amount *big.Int, remoteChainSelector uint64, arg4 []byte) (*types.Transaction, error) { + return _LockReleaseTokenPool.Contract.LockOrBurn(&_LockReleaseTokenPool.TransactOpts, originalSender, arg1, amount, remoteChainSelector, arg4) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolTransactorSession) LockOrBurn(originalSender common.Address, arg1 []byte, amount *big.Int, remoteChainSelector uint64, arg4 []byte) (*types.Transaction, error) { + return _LockReleaseTokenPool.Contract.LockOrBurn(&_LockReleaseTokenPool.TransactOpts, originalSender, arg1, amount, remoteChainSelector, arg4) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolTransactor) ProvideLiquidity(opts *bind.TransactOpts, amount *big.Int) (*types.Transaction, error) { + return _LockReleaseTokenPool.contract.Transact(opts, "provideLiquidity", amount) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolSession) ProvideLiquidity(amount *big.Int) (*types.Transaction, error) { + return _LockReleaseTokenPool.Contract.ProvideLiquidity(&_LockReleaseTokenPool.TransactOpts, amount) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolTransactorSession) ProvideLiquidity(amount *big.Int) (*types.Transaction, error) { + return _LockReleaseTokenPool.Contract.ProvideLiquidity(&_LockReleaseTokenPool.TransactOpts, amount) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolTransactor) ReleaseOrMint(opts *bind.TransactOpts, arg0 []byte, receiver common.Address, amount *big.Int, remoteChainSelector uint64, arg4 []byte) (*types.Transaction, error) { + return _LockReleaseTokenPool.contract.Transact(opts, "releaseOrMint", arg0, receiver, amount, remoteChainSelector, arg4) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolSession) ReleaseOrMint(arg0 []byte, receiver common.Address, amount *big.Int, remoteChainSelector uint64, arg4 []byte) (*types.Transaction, error) { + return _LockReleaseTokenPool.Contract.ReleaseOrMint(&_LockReleaseTokenPool.TransactOpts, arg0, receiver, amount, remoteChainSelector, arg4) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolTransactorSession) ReleaseOrMint(arg0 []byte, receiver common.Address, amount *big.Int, remoteChainSelector uint64, arg4 []byte) (*types.Transaction, error) { + return _LockReleaseTokenPool.Contract.ReleaseOrMint(&_LockReleaseTokenPool.TransactOpts, arg0, receiver, amount, remoteChainSelector, arg4) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolTransactor) SetChainRateLimiterConfig(opts *bind.TransactOpts, remoteChainSelector uint64, outboundConfig RateLimiterConfig, inboundConfig RateLimiterConfig) (*types.Transaction, error) { + return _LockReleaseTokenPool.contract.Transact(opts, "setChainRateLimiterConfig", remoteChainSelector, outboundConfig, inboundConfig) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolSession) SetChainRateLimiterConfig(remoteChainSelector uint64, outboundConfig RateLimiterConfig, inboundConfig RateLimiterConfig) (*types.Transaction, error) { + return _LockReleaseTokenPool.Contract.SetChainRateLimiterConfig(&_LockReleaseTokenPool.TransactOpts, remoteChainSelector, outboundConfig, inboundConfig) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolTransactorSession) SetChainRateLimiterConfig(remoteChainSelector uint64, outboundConfig RateLimiterConfig, inboundConfig RateLimiterConfig) (*types.Transaction, error) { + return _LockReleaseTokenPool.Contract.SetChainRateLimiterConfig(&_LockReleaseTokenPool.TransactOpts, remoteChainSelector, outboundConfig, inboundConfig) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolTransactor) SetRateLimitAdmin(opts *bind.TransactOpts, rateLimitAdmin common.Address) (*types.Transaction, error) { + return _LockReleaseTokenPool.contract.Transact(opts, "setRateLimitAdmin", rateLimitAdmin) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolSession) SetRateLimitAdmin(rateLimitAdmin common.Address) (*types.Transaction, error) { + return _LockReleaseTokenPool.Contract.SetRateLimitAdmin(&_LockReleaseTokenPool.TransactOpts, rateLimitAdmin) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolTransactorSession) SetRateLimitAdmin(rateLimitAdmin common.Address) (*types.Transaction, error) { + return _LockReleaseTokenPool.Contract.SetRateLimitAdmin(&_LockReleaseTokenPool.TransactOpts, rateLimitAdmin) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolTransactor) SetRebalancer(opts *bind.TransactOpts, rebalancer common.Address) (*types.Transaction, error) { + return _LockReleaseTokenPool.contract.Transact(opts, "setRebalancer", rebalancer) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolSession) SetRebalancer(rebalancer common.Address) (*types.Transaction, error) { + return _LockReleaseTokenPool.Contract.SetRebalancer(&_LockReleaseTokenPool.TransactOpts, rebalancer) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolTransactorSession) SetRebalancer(rebalancer common.Address) (*types.Transaction, error) { + return _LockReleaseTokenPool.Contract.SetRebalancer(&_LockReleaseTokenPool.TransactOpts, rebalancer) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolTransactor) SetRouter(opts *bind.TransactOpts, newRouter common.Address) (*types.Transaction, error) { + return _LockReleaseTokenPool.contract.Transact(opts, "setRouter", newRouter) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolSession) SetRouter(newRouter common.Address) (*types.Transaction, error) { + return _LockReleaseTokenPool.Contract.SetRouter(&_LockReleaseTokenPool.TransactOpts, newRouter) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolTransactorSession) SetRouter(newRouter common.Address) (*types.Transaction, error) { + return _LockReleaseTokenPool.Contract.SetRouter(&_LockReleaseTokenPool.TransactOpts, newRouter) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolTransactor) TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) { + return _LockReleaseTokenPool.contract.Transact(opts, "transferOwnership", to) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolSession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _LockReleaseTokenPool.Contract.TransferOwnership(&_LockReleaseTokenPool.TransactOpts, to) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolTransactorSession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _LockReleaseTokenPool.Contract.TransferOwnership(&_LockReleaseTokenPool.TransactOpts, to) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolTransactor) WithdrawLiquidity(opts *bind.TransactOpts, amount *big.Int) (*types.Transaction, error) { + return _LockReleaseTokenPool.contract.Transact(opts, "withdrawLiquidity", amount) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolSession) WithdrawLiquidity(amount *big.Int) (*types.Transaction, error) { + return _LockReleaseTokenPool.Contract.WithdrawLiquidity(&_LockReleaseTokenPool.TransactOpts, amount) +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolTransactorSession) WithdrawLiquidity(amount *big.Int) (*types.Transaction, error) { + return _LockReleaseTokenPool.Contract.WithdrawLiquidity(&_LockReleaseTokenPool.TransactOpts, amount) +} + +type LockReleaseTokenPoolAllowListAddIterator struct { + Event *LockReleaseTokenPoolAllowListAdd + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *LockReleaseTokenPoolAllowListAddIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolAllowListAdd) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolAllowListAdd) + 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() + } +} + +func (it *LockReleaseTokenPoolAllowListAddIterator) Error() error { + return it.fail +} + +func (it *LockReleaseTokenPoolAllowListAddIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type LockReleaseTokenPoolAllowListAdd struct { + Sender common.Address + Raw types.Log +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) FilterAllowListAdd(opts *bind.FilterOpts) (*LockReleaseTokenPoolAllowListAddIterator, error) { + + logs, sub, err := _LockReleaseTokenPool.contract.FilterLogs(opts, "AllowListAdd") + if err != nil { + return nil, err + } + return &LockReleaseTokenPoolAllowListAddIterator{contract: _LockReleaseTokenPool.contract, event: "AllowListAdd", logs: logs, sub: sub}, nil +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) WatchAllowListAdd(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolAllowListAdd) (event.Subscription, error) { + + logs, sub, err := _LockReleaseTokenPool.contract.WatchLogs(opts, "AllowListAdd") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(LockReleaseTokenPoolAllowListAdd) + if err := _LockReleaseTokenPool.contract.UnpackLog(event, "AllowListAdd", 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 +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) ParseAllowListAdd(log types.Log) (*LockReleaseTokenPoolAllowListAdd, error) { + event := new(LockReleaseTokenPoolAllowListAdd) + if err := _LockReleaseTokenPool.contract.UnpackLog(event, "AllowListAdd", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type LockReleaseTokenPoolAllowListRemoveIterator struct { + Event *LockReleaseTokenPoolAllowListRemove + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *LockReleaseTokenPoolAllowListRemoveIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolAllowListRemove) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolAllowListRemove) + 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() + } +} + +func (it *LockReleaseTokenPoolAllowListRemoveIterator) Error() error { + return it.fail +} + +func (it *LockReleaseTokenPoolAllowListRemoveIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type LockReleaseTokenPoolAllowListRemove struct { + Sender common.Address + Raw types.Log +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) FilterAllowListRemove(opts *bind.FilterOpts) (*LockReleaseTokenPoolAllowListRemoveIterator, error) { + + logs, sub, err := _LockReleaseTokenPool.contract.FilterLogs(opts, "AllowListRemove") + if err != nil { + return nil, err + } + return &LockReleaseTokenPoolAllowListRemoveIterator{contract: _LockReleaseTokenPool.contract, event: "AllowListRemove", logs: logs, sub: sub}, nil +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) WatchAllowListRemove(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolAllowListRemove) (event.Subscription, error) { + + logs, sub, err := _LockReleaseTokenPool.contract.WatchLogs(opts, "AllowListRemove") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(LockReleaseTokenPoolAllowListRemove) + if err := _LockReleaseTokenPool.contract.UnpackLog(event, "AllowListRemove", 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 +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) ParseAllowListRemove(log types.Log) (*LockReleaseTokenPoolAllowListRemove, error) { + event := new(LockReleaseTokenPoolAllowListRemove) + if err := _LockReleaseTokenPool.contract.UnpackLog(event, "AllowListRemove", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type LockReleaseTokenPoolBurnedIterator struct { + Event *LockReleaseTokenPoolBurned + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *LockReleaseTokenPoolBurnedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolBurned) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolBurned) + 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() + } +} + +func (it *LockReleaseTokenPoolBurnedIterator) Error() error { + return it.fail +} + +func (it *LockReleaseTokenPoolBurnedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type LockReleaseTokenPoolBurned struct { + Sender common.Address + Amount *big.Int + Raw types.Log +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) FilterBurned(opts *bind.FilterOpts, sender []common.Address) (*LockReleaseTokenPoolBurnedIterator, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _LockReleaseTokenPool.contract.FilterLogs(opts, "Burned", senderRule) + if err != nil { + return nil, err + } + return &LockReleaseTokenPoolBurnedIterator{contract: _LockReleaseTokenPool.contract, event: "Burned", logs: logs, sub: sub}, nil +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) WatchBurned(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolBurned, sender []common.Address) (event.Subscription, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _LockReleaseTokenPool.contract.WatchLogs(opts, "Burned", senderRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(LockReleaseTokenPoolBurned) + if err := _LockReleaseTokenPool.contract.UnpackLog(event, "Burned", 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 +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) ParseBurned(log types.Log) (*LockReleaseTokenPoolBurned, error) { + event := new(LockReleaseTokenPoolBurned) + if err := _LockReleaseTokenPool.contract.UnpackLog(event, "Burned", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type LockReleaseTokenPoolChainAddedIterator struct { + Event *LockReleaseTokenPoolChainAdded + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *LockReleaseTokenPoolChainAddedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolChainAdded) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolChainAdded) + 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() + } +} + +func (it *LockReleaseTokenPoolChainAddedIterator) Error() error { + return it.fail +} + +func (it *LockReleaseTokenPoolChainAddedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type LockReleaseTokenPoolChainAdded struct { + RemoteChainSelector uint64 + OutboundRateLimiterConfig RateLimiterConfig + InboundRateLimiterConfig RateLimiterConfig + Raw types.Log +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) FilterChainAdded(opts *bind.FilterOpts) (*LockReleaseTokenPoolChainAddedIterator, error) { + + logs, sub, err := _LockReleaseTokenPool.contract.FilterLogs(opts, "ChainAdded") + if err != nil { + return nil, err + } + return &LockReleaseTokenPoolChainAddedIterator{contract: _LockReleaseTokenPool.contract, event: "ChainAdded", logs: logs, sub: sub}, nil +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) WatchChainAdded(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolChainAdded) (event.Subscription, error) { + + logs, sub, err := _LockReleaseTokenPool.contract.WatchLogs(opts, "ChainAdded") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(LockReleaseTokenPoolChainAdded) + if err := _LockReleaseTokenPool.contract.UnpackLog(event, "ChainAdded", 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 +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) ParseChainAdded(log types.Log) (*LockReleaseTokenPoolChainAdded, error) { + event := new(LockReleaseTokenPoolChainAdded) + if err := _LockReleaseTokenPool.contract.UnpackLog(event, "ChainAdded", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type LockReleaseTokenPoolChainConfiguredIterator struct { + Event *LockReleaseTokenPoolChainConfigured + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *LockReleaseTokenPoolChainConfiguredIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolChainConfigured) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolChainConfigured) + 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() + } +} + +func (it *LockReleaseTokenPoolChainConfiguredIterator) Error() error { + return it.fail +} + +func (it *LockReleaseTokenPoolChainConfiguredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type LockReleaseTokenPoolChainConfigured struct { + RemoteChainSelector uint64 + OutboundRateLimiterConfig RateLimiterConfig + InboundRateLimiterConfig RateLimiterConfig + Raw types.Log +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) FilterChainConfigured(opts *bind.FilterOpts) (*LockReleaseTokenPoolChainConfiguredIterator, error) { + + logs, sub, err := _LockReleaseTokenPool.contract.FilterLogs(opts, "ChainConfigured") + if err != nil { + return nil, err + } + return &LockReleaseTokenPoolChainConfiguredIterator{contract: _LockReleaseTokenPool.contract, event: "ChainConfigured", logs: logs, sub: sub}, nil +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) WatchChainConfigured(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolChainConfigured) (event.Subscription, error) { + + logs, sub, err := _LockReleaseTokenPool.contract.WatchLogs(opts, "ChainConfigured") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(LockReleaseTokenPoolChainConfigured) + if err := _LockReleaseTokenPool.contract.UnpackLog(event, "ChainConfigured", 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 +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) ParseChainConfigured(log types.Log) (*LockReleaseTokenPoolChainConfigured, error) { + event := new(LockReleaseTokenPoolChainConfigured) + if err := _LockReleaseTokenPool.contract.UnpackLog(event, "ChainConfigured", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type LockReleaseTokenPoolChainRemovedIterator struct { + Event *LockReleaseTokenPoolChainRemoved + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *LockReleaseTokenPoolChainRemovedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolChainRemoved) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolChainRemoved) + 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() + } +} + +func (it *LockReleaseTokenPoolChainRemovedIterator) Error() error { + return it.fail +} + +func (it *LockReleaseTokenPoolChainRemovedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type LockReleaseTokenPoolChainRemoved struct { + RemoteChainSelector uint64 + Raw types.Log +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) FilterChainRemoved(opts *bind.FilterOpts) (*LockReleaseTokenPoolChainRemovedIterator, error) { + + logs, sub, err := _LockReleaseTokenPool.contract.FilterLogs(opts, "ChainRemoved") + if err != nil { + return nil, err + } + return &LockReleaseTokenPoolChainRemovedIterator{contract: _LockReleaseTokenPool.contract, event: "ChainRemoved", logs: logs, sub: sub}, nil +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) WatchChainRemoved(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolChainRemoved) (event.Subscription, error) { + + logs, sub, err := _LockReleaseTokenPool.contract.WatchLogs(opts, "ChainRemoved") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(LockReleaseTokenPoolChainRemoved) + if err := _LockReleaseTokenPool.contract.UnpackLog(event, "ChainRemoved", 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 +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) ParseChainRemoved(log types.Log) (*LockReleaseTokenPoolChainRemoved, error) { + event := new(LockReleaseTokenPoolChainRemoved) + if err := _LockReleaseTokenPool.contract.UnpackLog(event, "ChainRemoved", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type LockReleaseTokenPoolLiquidityAddedIterator struct { + Event *LockReleaseTokenPoolLiquidityAdded + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *LockReleaseTokenPoolLiquidityAddedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolLiquidityAdded) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolLiquidityAdded) + 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() + } +} + +func (it *LockReleaseTokenPoolLiquidityAddedIterator) Error() error { + return it.fail +} + +func (it *LockReleaseTokenPoolLiquidityAddedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type LockReleaseTokenPoolLiquidityAdded struct { + Provider common.Address + Amount *big.Int + Raw types.Log +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) FilterLiquidityAdded(opts *bind.FilterOpts, provider []common.Address, amount []*big.Int) (*LockReleaseTokenPoolLiquidityAddedIterator, error) { + + var providerRule []interface{} + for _, providerItem := range provider { + providerRule = append(providerRule, providerItem) + } + var amountRule []interface{} + for _, amountItem := range amount { + amountRule = append(amountRule, amountItem) + } + + logs, sub, err := _LockReleaseTokenPool.contract.FilterLogs(opts, "LiquidityAdded", providerRule, amountRule) + if err != nil { + return nil, err + } + return &LockReleaseTokenPoolLiquidityAddedIterator{contract: _LockReleaseTokenPool.contract, event: "LiquidityAdded", logs: logs, sub: sub}, nil +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) WatchLiquidityAdded(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolLiquidityAdded, provider []common.Address, amount []*big.Int) (event.Subscription, error) { + + var providerRule []interface{} + for _, providerItem := range provider { + providerRule = append(providerRule, providerItem) + } + var amountRule []interface{} + for _, amountItem := range amount { + amountRule = append(amountRule, amountItem) + } + + logs, sub, err := _LockReleaseTokenPool.contract.WatchLogs(opts, "LiquidityAdded", providerRule, amountRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(LockReleaseTokenPoolLiquidityAdded) + if err := _LockReleaseTokenPool.contract.UnpackLog(event, "LiquidityAdded", 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 +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) ParseLiquidityAdded(log types.Log) (*LockReleaseTokenPoolLiquidityAdded, error) { + event := new(LockReleaseTokenPoolLiquidityAdded) + if err := _LockReleaseTokenPool.contract.UnpackLog(event, "LiquidityAdded", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type LockReleaseTokenPoolLiquidityRemovedIterator struct { + Event *LockReleaseTokenPoolLiquidityRemoved + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *LockReleaseTokenPoolLiquidityRemovedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolLiquidityRemoved) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolLiquidityRemoved) + 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() + } +} + +func (it *LockReleaseTokenPoolLiquidityRemovedIterator) Error() error { + return it.fail +} + +func (it *LockReleaseTokenPoolLiquidityRemovedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type LockReleaseTokenPoolLiquidityRemoved struct { + Provider common.Address + Amount *big.Int + Raw types.Log +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) FilterLiquidityRemoved(opts *bind.FilterOpts, provider []common.Address, amount []*big.Int) (*LockReleaseTokenPoolLiquidityRemovedIterator, error) { + + var providerRule []interface{} + for _, providerItem := range provider { + providerRule = append(providerRule, providerItem) + } + var amountRule []interface{} + for _, amountItem := range amount { + amountRule = append(amountRule, amountItem) + } + + logs, sub, err := _LockReleaseTokenPool.contract.FilterLogs(opts, "LiquidityRemoved", providerRule, amountRule) + if err != nil { + return nil, err + } + return &LockReleaseTokenPoolLiquidityRemovedIterator{contract: _LockReleaseTokenPool.contract, event: "LiquidityRemoved", logs: logs, sub: sub}, nil +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) WatchLiquidityRemoved(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolLiquidityRemoved, provider []common.Address, amount []*big.Int) (event.Subscription, error) { + + var providerRule []interface{} + for _, providerItem := range provider { + providerRule = append(providerRule, providerItem) + } + var amountRule []interface{} + for _, amountItem := range amount { + amountRule = append(amountRule, amountItem) + } + + logs, sub, err := _LockReleaseTokenPool.contract.WatchLogs(opts, "LiquidityRemoved", providerRule, amountRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(LockReleaseTokenPoolLiquidityRemoved) + if err := _LockReleaseTokenPool.contract.UnpackLog(event, "LiquidityRemoved", 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 +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) ParseLiquidityRemoved(log types.Log) (*LockReleaseTokenPoolLiquidityRemoved, error) { + event := new(LockReleaseTokenPoolLiquidityRemoved) + if err := _LockReleaseTokenPool.contract.UnpackLog(event, "LiquidityRemoved", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type LockReleaseTokenPoolLockedIterator struct { + Event *LockReleaseTokenPoolLocked + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *LockReleaseTokenPoolLockedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolLocked) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolLocked) + 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() + } +} + +func (it *LockReleaseTokenPoolLockedIterator) Error() error { + return it.fail +} + +func (it *LockReleaseTokenPoolLockedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type LockReleaseTokenPoolLocked struct { + Sender common.Address + Amount *big.Int + Raw types.Log +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) FilterLocked(opts *bind.FilterOpts, sender []common.Address) (*LockReleaseTokenPoolLockedIterator, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _LockReleaseTokenPool.contract.FilterLogs(opts, "Locked", senderRule) + if err != nil { + return nil, err + } + return &LockReleaseTokenPoolLockedIterator{contract: _LockReleaseTokenPool.contract, event: "Locked", logs: logs, sub: sub}, nil +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) WatchLocked(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolLocked, sender []common.Address) (event.Subscription, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _LockReleaseTokenPool.contract.WatchLogs(opts, "Locked", senderRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(LockReleaseTokenPoolLocked) + if err := _LockReleaseTokenPool.contract.UnpackLog(event, "Locked", 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 +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) ParseLocked(log types.Log) (*LockReleaseTokenPoolLocked, error) { + event := new(LockReleaseTokenPoolLocked) + if err := _LockReleaseTokenPool.contract.UnpackLog(event, "Locked", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type LockReleaseTokenPoolMintedIterator struct { + Event *LockReleaseTokenPoolMinted + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *LockReleaseTokenPoolMintedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolMinted) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolMinted) + 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() + } +} + +func (it *LockReleaseTokenPoolMintedIterator) Error() error { + return it.fail +} + +func (it *LockReleaseTokenPoolMintedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type LockReleaseTokenPoolMinted struct { + Sender common.Address + Recipient common.Address + Amount *big.Int + Raw types.Log +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) FilterMinted(opts *bind.FilterOpts, sender []common.Address, recipient []common.Address) (*LockReleaseTokenPoolMintedIterator, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + var recipientRule []interface{} + for _, recipientItem := range recipient { + recipientRule = append(recipientRule, recipientItem) + } + + logs, sub, err := _LockReleaseTokenPool.contract.FilterLogs(opts, "Minted", senderRule, recipientRule) + if err != nil { + return nil, err + } + return &LockReleaseTokenPoolMintedIterator{contract: _LockReleaseTokenPool.contract, event: "Minted", logs: logs, sub: sub}, nil +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) WatchMinted(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolMinted, sender []common.Address, recipient []common.Address) (event.Subscription, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + var recipientRule []interface{} + for _, recipientItem := range recipient { + recipientRule = append(recipientRule, recipientItem) + } + + logs, sub, err := _LockReleaseTokenPool.contract.WatchLogs(opts, "Minted", senderRule, recipientRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(LockReleaseTokenPoolMinted) + if err := _LockReleaseTokenPool.contract.UnpackLog(event, "Minted", 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 +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) ParseMinted(log types.Log) (*LockReleaseTokenPoolMinted, error) { + event := new(LockReleaseTokenPoolMinted) + if err := _LockReleaseTokenPool.contract.UnpackLog(event, "Minted", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type LockReleaseTokenPoolOwnershipTransferRequestedIterator struct { + Event *LockReleaseTokenPoolOwnershipTransferRequested + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *LockReleaseTokenPoolOwnershipTransferRequestedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolOwnershipTransferRequested) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolOwnershipTransferRequested) + 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() + } +} + +func (it *LockReleaseTokenPoolOwnershipTransferRequestedIterator) Error() error { + return it.fail +} + +func (it *LockReleaseTokenPoolOwnershipTransferRequestedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type LockReleaseTokenPoolOwnershipTransferRequested struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*LockReleaseTokenPoolOwnershipTransferRequestedIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _LockReleaseTokenPool.contract.FilterLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return &LockReleaseTokenPoolOwnershipTransferRequestedIterator{contract: _LockReleaseTokenPool.contract, event: "OwnershipTransferRequested", logs: logs, sub: sub}, nil +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _LockReleaseTokenPool.contract.WatchLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(LockReleaseTokenPoolOwnershipTransferRequested) + if err := _LockReleaseTokenPool.contract.UnpackLog(event, "OwnershipTransferRequested", 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 +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) ParseOwnershipTransferRequested(log types.Log) (*LockReleaseTokenPoolOwnershipTransferRequested, error) { + event := new(LockReleaseTokenPoolOwnershipTransferRequested) + if err := _LockReleaseTokenPool.contract.UnpackLog(event, "OwnershipTransferRequested", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type LockReleaseTokenPoolOwnershipTransferredIterator struct { + Event *LockReleaseTokenPoolOwnershipTransferred + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *LockReleaseTokenPoolOwnershipTransferredIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolOwnershipTransferred) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolOwnershipTransferred) + 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() + } +} + +func (it *LockReleaseTokenPoolOwnershipTransferredIterator) Error() error { + return it.fail +} + +func (it *LockReleaseTokenPoolOwnershipTransferredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type LockReleaseTokenPoolOwnershipTransferred struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*LockReleaseTokenPoolOwnershipTransferredIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _LockReleaseTokenPool.contract.FilterLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return &LockReleaseTokenPoolOwnershipTransferredIterator{contract: _LockReleaseTokenPool.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _LockReleaseTokenPool.contract.WatchLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(LockReleaseTokenPoolOwnershipTransferred) + if err := _LockReleaseTokenPool.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 +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) ParseOwnershipTransferred(log types.Log) (*LockReleaseTokenPoolOwnershipTransferred, error) { + event := new(LockReleaseTokenPoolOwnershipTransferred) + if err := _LockReleaseTokenPool.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type LockReleaseTokenPoolReleasedIterator struct { + Event *LockReleaseTokenPoolReleased + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *LockReleaseTokenPoolReleasedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolReleased) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolReleased) + 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() + } +} + +func (it *LockReleaseTokenPoolReleasedIterator) Error() error { + return it.fail +} + +func (it *LockReleaseTokenPoolReleasedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type LockReleaseTokenPoolReleased struct { + Sender common.Address + Recipient common.Address + Amount *big.Int + Raw types.Log +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) FilterReleased(opts *bind.FilterOpts, sender []common.Address, recipient []common.Address) (*LockReleaseTokenPoolReleasedIterator, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + var recipientRule []interface{} + for _, recipientItem := range recipient { + recipientRule = append(recipientRule, recipientItem) + } + + logs, sub, err := _LockReleaseTokenPool.contract.FilterLogs(opts, "Released", senderRule, recipientRule) + if err != nil { + return nil, err + } + return &LockReleaseTokenPoolReleasedIterator{contract: _LockReleaseTokenPool.contract, event: "Released", logs: logs, sub: sub}, nil +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) WatchReleased(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolReleased, sender []common.Address, recipient []common.Address) (event.Subscription, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + var recipientRule []interface{} + for _, recipientItem := range recipient { + recipientRule = append(recipientRule, recipientItem) + } + + logs, sub, err := _LockReleaseTokenPool.contract.WatchLogs(opts, "Released", senderRule, recipientRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(LockReleaseTokenPoolReleased) + if err := _LockReleaseTokenPool.contract.UnpackLog(event, "Released", 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 +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) ParseReleased(log types.Log) (*LockReleaseTokenPoolReleased, error) { + event := new(LockReleaseTokenPoolReleased) + if err := _LockReleaseTokenPool.contract.UnpackLog(event, "Released", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type LockReleaseTokenPoolRouterUpdatedIterator struct { + Event *LockReleaseTokenPoolRouterUpdated + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *LockReleaseTokenPoolRouterUpdatedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolRouterUpdated) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolRouterUpdated) + 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() + } +} + +func (it *LockReleaseTokenPoolRouterUpdatedIterator) Error() error { + return it.fail +} + +func (it *LockReleaseTokenPoolRouterUpdatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type LockReleaseTokenPoolRouterUpdated struct { + OldRouter common.Address + NewRouter common.Address + Raw types.Log +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) FilterRouterUpdated(opts *bind.FilterOpts) (*LockReleaseTokenPoolRouterUpdatedIterator, error) { + + logs, sub, err := _LockReleaseTokenPool.contract.FilterLogs(opts, "RouterUpdated") + if err != nil { + return nil, err + } + return &LockReleaseTokenPoolRouterUpdatedIterator{contract: _LockReleaseTokenPool.contract, event: "RouterUpdated", logs: logs, sub: sub}, nil +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) WatchRouterUpdated(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolRouterUpdated) (event.Subscription, error) { + + logs, sub, err := _LockReleaseTokenPool.contract.WatchLogs(opts, "RouterUpdated") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(LockReleaseTokenPoolRouterUpdated) + if err := _LockReleaseTokenPool.contract.UnpackLog(event, "RouterUpdated", 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 +} + +func (_LockReleaseTokenPool *LockReleaseTokenPoolFilterer) ParseRouterUpdated(log types.Log) (*LockReleaseTokenPoolRouterUpdated, error) { + event := new(LockReleaseTokenPoolRouterUpdated) + if err := _LockReleaseTokenPool.contract.UnpackLog(event, "RouterUpdated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +func (_LockReleaseTokenPool *LockReleaseTokenPool) ParseLog(log types.Log) (generated.AbigenLog, error) { + switch log.Topics[0] { + case _LockReleaseTokenPool.abi.Events["AllowListAdd"].ID: + return _LockReleaseTokenPool.ParseAllowListAdd(log) + case _LockReleaseTokenPool.abi.Events["AllowListRemove"].ID: + return _LockReleaseTokenPool.ParseAllowListRemove(log) + case _LockReleaseTokenPool.abi.Events["Burned"].ID: + return _LockReleaseTokenPool.ParseBurned(log) + case _LockReleaseTokenPool.abi.Events["ChainAdded"].ID: + return _LockReleaseTokenPool.ParseChainAdded(log) + case _LockReleaseTokenPool.abi.Events["ChainConfigured"].ID: + return _LockReleaseTokenPool.ParseChainConfigured(log) + case _LockReleaseTokenPool.abi.Events["ChainRemoved"].ID: + return _LockReleaseTokenPool.ParseChainRemoved(log) + case _LockReleaseTokenPool.abi.Events["LiquidityAdded"].ID: + return _LockReleaseTokenPool.ParseLiquidityAdded(log) + case _LockReleaseTokenPool.abi.Events["LiquidityRemoved"].ID: + return _LockReleaseTokenPool.ParseLiquidityRemoved(log) + case _LockReleaseTokenPool.abi.Events["Locked"].ID: + return _LockReleaseTokenPool.ParseLocked(log) + case _LockReleaseTokenPool.abi.Events["Minted"].ID: + return _LockReleaseTokenPool.ParseMinted(log) + case _LockReleaseTokenPool.abi.Events["OwnershipTransferRequested"].ID: + return _LockReleaseTokenPool.ParseOwnershipTransferRequested(log) + case _LockReleaseTokenPool.abi.Events["OwnershipTransferred"].ID: + return _LockReleaseTokenPool.ParseOwnershipTransferred(log) + case _LockReleaseTokenPool.abi.Events["Released"].ID: + return _LockReleaseTokenPool.ParseReleased(log) + case _LockReleaseTokenPool.abi.Events["RouterUpdated"].ID: + return _LockReleaseTokenPool.ParseRouterUpdated(log) + + default: + return nil, fmt.Errorf("abigen wrapper received unknown log topic: %v", log.Topics[0]) + } +} + +func (LockReleaseTokenPoolAllowListAdd) Topic() common.Hash { + return common.HexToHash("0x2640d4d76caf8bf478aabfa982fa4e1c4eb71a37f93cd15e80dbc657911546d8") +} + +func (LockReleaseTokenPoolAllowListRemove) Topic() common.Hash { + return common.HexToHash("0x800671136ab6cfee9fbe5ed1fb7ca417811aca3cf864800d127b927adedf7566") +} + +func (LockReleaseTokenPoolBurned) Topic() common.Hash { + return common.HexToHash("0x696de425f79f4a40bc6d2122ca50507f0efbeabbff86a84871b7196ab8ea8df7") +} + +func (LockReleaseTokenPoolChainAdded) Topic() common.Hash { + return common.HexToHash("0x0f135cbb9afa12a8bf3bbd071c117bcca4ddeca6160ef7f33d012a81b9c0c471") +} + +func (LockReleaseTokenPoolChainConfigured) Topic() common.Hash { + return common.HexToHash("0x0350d63aa5f270e01729d00d627eeb8f3429772b1818c016c66a588a864f912b") +} + +func (LockReleaseTokenPoolChainRemoved) Topic() common.Hash { + return common.HexToHash("0x5204aec90a3c794d8e90fded8b46ae9c7c552803e7e832e0c1d358396d859916") +} + +func (LockReleaseTokenPoolLiquidityAdded) Topic() common.Hash { + return common.HexToHash("0xc17cea59c2955cb181b03393209566960365771dbba9dc3d510180e7cb312088") +} + +func (LockReleaseTokenPoolLiquidityRemoved) Topic() common.Hash { + return common.HexToHash("0xc2c3f06e49b9f15e7b4af9055e183b0d73362e033ad82a07dec9bf9840171719") +} + +func (LockReleaseTokenPoolLocked) Topic() common.Hash { + return common.HexToHash("0x9f1ec8c880f76798e7b793325d625e9b60e4082a553c98f42b6cda368dd60008") +} + +func (LockReleaseTokenPoolMinted) Topic() common.Hash { + return common.HexToHash("0x9d228d69b5fdb8d273a2336f8fb8612d039631024ea9bf09c424a9503aa078f0") +} + +func (LockReleaseTokenPoolOwnershipTransferRequested) Topic() common.Hash { + return common.HexToHash("0xed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae1278") +} + +func (LockReleaseTokenPoolOwnershipTransferred) Topic() common.Hash { + return common.HexToHash("0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0") +} + +func (LockReleaseTokenPoolReleased) Topic() common.Hash { + return common.HexToHash("0x2d87480f50083e2b2759522a8fdda59802650a8055e609a7772cf70c07748f52") +} + +func (LockReleaseTokenPoolRouterUpdated) Topic() common.Hash { + return common.HexToHash("0x02dc5c233404867c793b749c6d644beb2277536d18a7e7974d3f238e4c6f1684") +} + +func (_LockReleaseTokenPool *LockReleaseTokenPool) Address() common.Address { + return _LockReleaseTokenPool.address +} + +type LockReleaseTokenPoolInterface interface { + CanAcceptLiquidity(opts *bind.CallOpts) (bool, error) + + GetAllowList(opts *bind.CallOpts) ([]common.Address, error) + + GetAllowListEnabled(opts *bind.CallOpts) (bool, error) + + GetArmProxy(opts *bind.CallOpts) (common.Address, error) + + GetCurrentInboundRateLimiterState(opts *bind.CallOpts, remoteChainSelector uint64) (RateLimiterTokenBucket, error) + + GetCurrentOutboundRateLimiterState(opts *bind.CallOpts, remoteChainSelector uint64) (RateLimiterTokenBucket, error) + + GetLockReleaseInterfaceId(opts *bind.CallOpts) ([4]byte, error) + + GetRateLimitAdmin(opts *bind.CallOpts) (common.Address, error) + + GetRebalancer(opts *bind.CallOpts) (common.Address, error) + + GetRouter(opts *bind.CallOpts) (common.Address, error) + + GetSupportedChains(opts *bind.CallOpts) ([]uint64, error) + + GetToken(opts *bind.CallOpts) (common.Address, error) + + IsSupportedChain(opts *bind.CallOpts, remoteChainSelector uint64) (bool, error) + + Owner(opts *bind.CallOpts) (common.Address, error) + + SupportsInterface(opts *bind.CallOpts, interfaceId [4]byte) (bool, error) + + TypeAndVersion(opts *bind.CallOpts) (string, error) + + AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) + + ApplyAllowListUpdates(opts *bind.TransactOpts, removes []common.Address, adds []common.Address) (*types.Transaction, error) + + ApplyChainUpdates(opts *bind.TransactOpts, chains []TokenPoolChainUpdate) (*types.Transaction, error) + + LockOrBurn(opts *bind.TransactOpts, originalSender common.Address, arg1 []byte, amount *big.Int, remoteChainSelector uint64, arg4 []byte) (*types.Transaction, error) + + ProvideLiquidity(opts *bind.TransactOpts, amount *big.Int) (*types.Transaction, error) + + ReleaseOrMint(opts *bind.TransactOpts, arg0 []byte, receiver common.Address, amount *big.Int, remoteChainSelector uint64, arg4 []byte) (*types.Transaction, error) + + SetChainRateLimiterConfig(opts *bind.TransactOpts, remoteChainSelector uint64, outboundConfig RateLimiterConfig, inboundConfig RateLimiterConfig) (*types.Transaction, error) + + SetRateLimitAdmin(opts *bind.TransactOpts, rateLimitAdmin common.Address) (*types.Transaction, error) + + SetRebalancer(opts *bind.TransactOpts, rebalancer common.Address) (*types.Transaction, error) + + SetRouter(opts *bind.TransactOpts, newRouter common.Address) (*types.Transaction, error) + + TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) + + WithdrawLiquidity(opts *bind.TransactOpts, amount *big.Int) (*types.Transaction, error) + + FilterAllowListAdd(opts *bind.FilterOpts) (*LockReleaseTokenPoolAllowListAddIterator, error) + + WatchAllowListAdd(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolAllowListAdd) (event.Subscription, error) + + ParseAllowListAdd(log types.Log) (*LockReleaseTokenPoolAllowListAdd, error) + + FilterAllowListRemove(opts *bind.FilterOpts) (*LockReleaseTokenPoolAllowListRemoveIterator, error) + + WatchAllowListRemove(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolAllowListRemove) (event.Subscription, error) + + ParseAllowListRemove(log types.Log) (*LockReleaseTokenPoolAllowListRemove, error) + + FilterBurned(opts *bind.FilterOpts, sender []common.Address) (*LockReleaseTokenPoolBurnedIterator, error) + + WatchBurned(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolBurned, sender []common.Address) (event.Subscription, error) + + ParseBurned(log types.Log) (*LockReleaseTokenPoolBurned, error) + + FilterChainAdded(opts *bind.FilterOpts) (*LockReleaseTokenPoolChainAddedIterator, error) + + WatchChainAdded(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolChainAdded) (event.Subscription, error) + + ParseChainAdded(log types.Log) (*LockReleaseTokenPoolChainAdded, error) + + FilterChainConfigured(opts *bind.FilterOpts) (*LockReleaseTokenPoolChainConfiguredIterator, error) + + WatchChainConfigured(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolChainConfigured) (event.Subscription, error) + + ParseChainConfigured(log types.Log) (*LockReleaseTokenPoolChainConfigured, error) + + FilterChainRemoved(opts *bind.FilterOpts) (*LockReleaseTokenPoolChainRemovedIterator, error) + + WatchChainRemoved(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolChainRemoved) (event.Subscription, error) + + ParseChainRemoved(log types.Log) (*LockReleaseTokenPoolChainRemoved, error) + + FilterLiquidityAdded(opts *bind.FilterOpts, provider []common.Address, amount []*big.Int) (*LockReleaseTokenPoolLiquidityAddedIterator, error) + + WatchLiquidityAdded(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolLiquidityAdded, provider []common.Address, amount []*big.Int) (event.Subscription, error) + + ParseLiquidityAdded(log types.Log) (*LockReleaseTokenPoolLiquidityAdded, error) + + FilterLiquidityRemoved(opts *bind.FilterOpts, provider []common.Address, amount []*big.Int) (*LockReleaseTokenPoolLiquidityRemovedIterator, error) + + WatchLiquidityRemoved(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolLiquidityRemoved, provider []common.Address, amount []*big.Int) (event.Subscription, error) + + ParseLiquidityRemoved(log types.Log) (*LockReleaseTokenPoolLiquidityRemoved, error) + + FilterLocked(opts *bind.FilterOpts, sender []common.Address) (*LockReleaseTokenPoolLockedIterator, error) + + WatchLocked(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolLocked, sender []common.Address) (event.Subscription, error) + + ParseLocked(log types.Log) (*LockReleaseTokenPoolLocked, error) + + FilterMinted(opts *bind.FilterOpts, sender []common.Address, recipient []common.Address) (*LockReleaseTokenPoolMintedIterator, error) + + WatchMinted(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolMinted, sender []common.Address, recipient []common.Address) (event.Subscription, error) + + ParseMinted(log types.Log) (*LockReleaseTokenPoolMinted, error) + + FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*LockReleaseTokenPoolOwnershipTransferRequestedIterator, error) + + WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferRequested(log types.Log) (*LockReleaseTokenPoolOwnershipTransferRequested, error) + + FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*LockReleaseTokenPoolOwnershipTransferredIterator, error) + + WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferred(log types.Log) (*LockReleaseTokenPoolOwnershipTransferred, error) + + FilterReleased(opts *bind.FilterOpts, sender []common.Address, recipient []common.Address) (*LockReleaseTokenPoolReleasedIterator, error) + + WatchReleased(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolReleased, sender []common.Address, recipient []common.Address) (event.Subscription, error) + + ParseReleased(log types.Log) (*LockReleaseTokenPoolReleased, error) + + FilterRouterUpdated(opts *bind.FilterOpts) (*LockReleaseTokenPoolRouterUpdatedIterator, error) + + WatchRouterUpdated(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolRouterUpdated) (event.Subscription, error) + + ParseRouterUpdated(log types.Log) (*LockReleaseTokenPoolRouterUpdated, error) + + ParseLog(log types.Log) (generated.AbigenLog, error) + + Address() common.Address +} diff --git a/core/gethwrappers/ccip/generated/lock_release_token_pool_and_proxy/lock_release_token_pool_and_proxy.go b/core/gethwrappers/ccip/generated/lock_release_token_pool_and_proxy/lock_release_token_pool_and_proxy.go new file mode 100644 index 00000000000..94c80882d4e --- /dev/null +++ b/core/gethwrappers/ccip/generated/lock_release_token_pool_and_proxy/lock_release_token_pool_and_proxy.go @@ -0,0 +1,3434 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package lock_release_token_pool_and_proxy + +import ( + "errors" + "fmt" + "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" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" +) + +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +type PoolLockOrBurnInV1 struct { + Receiver []byte + RemoteChainSelector uint64 + OriginalSender common.Address + Amount *big.Int + LocalToken common.Address +} + +type PoolLockOrBurnOutV1 struct { + DestTokenAddress []byte + DestPoolData []byte +} + +type PoolReleaseOrMintInV1 struct { + OriginalSender []byte + RemoteChainSelector uint64 + Receiver common.Address + Amount *big.Int + LocalToken common.Address + SourcePoolAddress []byte + SourcePoolData []byte + OffchainTokenData []byte +} + +type PoolReleaseOrMintOutV1 struct { + DestinationAmount *big.Int +} + +type RateLimiterConfig struct { + IsEnabled bool + Capacity *big.Int + Rate *big.Int +} + +type RateLimiterTokenBucket struct { + Tokens *big.Int + LastUpdated uint32 + IsEnabled bool + Capacity *big.Int + Rate *big.Int +} + +type TokenPoolChainUpdate struct { + RemoteChainSelector uint64 + Allowed bool + RemotePoolAddress []byte + RemoteTokenAddress []byte + OutboundRateLimiterConfig RateLimiterConfig + InboundRateLimiterConfig RateLimiterConfig +} + +var LockReleaseTokenPoolAndProxyMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"internalType\":\"contractIERC20\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"allowlist\",\"type\":\"address[]\"},{\"internalType\":\"address\",\"name\":\"rmnProxy\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"acceptLiquidity\",\"type\":\"bool\"},{\"internalType\":\"address\",\"name\":\"router\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"capacity\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"requested\",\"type\":\"uint256\"}],\"name\":\"AggregateValueMaxCapacityExceeded\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"minWaitInSeconds\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"available\",\"type\":\"uint256\"}],\"name\":\"AggregateValueRateLimitReached\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"AllowListNotEnabled\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"BucketOverfilled\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"}],\"name\":\"CallerIsNotARampOnRouter\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"}],\"name\":\"ChainAlreadyExists\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"ChainNotAllowed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"CursedByRMN\",\"type\":\"error\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"config\",\"type\":\"tuple\"}],\"name\":\"DisabledNonZeroRateLimit\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InsufficientLiquidity\",\"type\":\"error\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"rateLimiterConfig\",\"type\":\"tuple\"}],\"name\":\"InvalidRateLimitRate\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"sourcePoolAddress\",\"type\":\"bytes\"}],\"name\":\"InvalidSourcePoolAddress\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"InvalidToken\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"LiquidityNotAccepted\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"NonExistentChain\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RateLimitMustBeDisabled\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"SenderNotAllowed\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"capacity\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"requested\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"}],\"name\":\"TokenMaxCapacityExceeded\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"minWaitInSeconds\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"available\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"}],\"name\":\"TokenRateLimitReached\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"}],\"name\":\"Unauthorized\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddressNotAllowed\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"AllowListAdd\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"AllowListRemove\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Burned\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"remoteToken\",\"type\":\"bytes\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"indexed\":false,\"internalType\":\"structRateLimiter.Config\",\"name\":\"outboundRateLimiterConfig\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"indexed\":false,\"internalType\":\"structRateLimiter.Config\",\"name\":\"inboundRateLimiterConfig\",\"type\":\"tuple\"}],\"name\":\"ChainAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"indexed\":false,\"internalType\":\"structRateLimiter.Config\",\"name\":\"outboundRateLimiterConfig\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"indexed\":false,\"internalType\":\"structRateLimiter.Config\",\"name\":\"inboundRateLimiterConfig\",\"type\":\"tuple\"}],\"name\":\"ChainConfigured\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"ChainRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"indexed\":false,\"internalType\":\"structRateLimiter.Config\",\"name\":\"config\",\"type\":\"tuple\"}],\"name\":\"ConfigChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"contractIPoolPriorTo1_5\",\"name\":\"oldPool\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"contractIPoolPriorTo1_5\",\"name\":\"newPool\",\"type\":\"address\"}],\"name\":\"LegacyPoolChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"provider\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"LiquidityAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"provider\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"LiquidityRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Locked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Minted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Released\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"previousPoolAddress\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"remotePoolAddress\",\"type\":\"bytes\"}],\"name\":\"RemotePoolSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"oldRouter\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newRouter\",\"type\":\"address\"}],\"name\":\"RouterUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"}],\"name\":\"TokensConsumed\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"removes\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"adds\",\"type\":\"address[]\"}],\"name\":\"applyAllowListUpdates\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"bool\",\"name\":\"allowed\",\"type\":\"bool\"},{\"internalType\":\"bytes\",\"name\":\"remotePoolAddress\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"remoteTokenAddress\",\"type\":\"bytes\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"outboundRateLimiterConfig\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"inboundRateLimiterConfig\",\"type\":\"tuple\"}],\"internalType\":\"structTokenPool.ChainUpdate[]\",\"name\":\"chains\",\"type\":\"tuple[]\"}],\"name\":\"applyChainUpdates\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"canAcceptLiquidity\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAllowList\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAllowListEnabled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"getCurrentInboundRateLimiterState\",\"outputs\":[{\"components\":[{\"internalType\":\"uint128\",\"name\":\"tokens\",\"type\":\"uint128\"},{\"internalType\":\"uint32\",\"name\":\"lastUpdated\",\"type\":\"uint32\"},{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.TokenBucket\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"getCurrentOutboundRateLimiterState\",\"outputs\":[{\"components\":[{\"internalType\":\"uint128\",\"name\":\"tokens\",\"type\":\"uint128\"},{\"internalType\":\"uint32\",\"name\":\"lastUpdated\",\"type\":\"uint32\"},{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.TokenBucket\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"name\":\"getOnRamp\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"onRampAddress\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getPreviousPool\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRateLimitAdmin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRebalancer\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"getRemotePool\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"getRemoteToken\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRmnProxy\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"rmnProxy\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRouter\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"router\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getSupportedChains\",\"outputs\":[{\"internalType\":\"uint64[]\",\"name\":\"\",\"type\":\"uint64[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getToken\",\"outputs\":[{\"internalType\":\"contractIERC20\",\"name\":\"token\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"offRamp\",\"type\":\"address\"}],\"name\":\"isOffRamp\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"isSupportedChain\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"isSupportedToken\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes\",\"name\":\"receiver\",\"type\":\"bytes\"},{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"originalSender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"localToken\",\"type\":\"address\"}],\"internalType\":\"structPool.LockOrBurnInV1\",\"name\":\"lockOrBurnIn\",\"type\":\"tuple\"}],\"name\":\"lockOrBurn\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes\",\"name\":\"destTokenAddress\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"destPoolData\",\"type\":\"bytes\"}],\"internalType\":\"structPool.LockOrBurnOutV1\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"provideLiquidity\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes\",\"name\":\"originalSender\",\"type\":\"bytes\"},{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"localToken\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"sourcePoolAddress\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"sourcePoolData\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"offchainTokenData\",\"type\":\"bytes\"}],\"internalType\":\"structPool.ReleaseOrMintInV1\",\"name\":\"releaseOrMintIn\",\"type\":\"tuple\"}],\"name\":\"releaseOrMint\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"destinationAmount\",\"type\":\"uint256\"}],\"internalType\":\"structPool.ReleaseOrMintOutV1\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"outboundConfig\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"inboundConfig\",\"type\":\"tuple\"}],\"name\":\"setChainRateLimiterConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractIPoolPriorTo1_5\",\"name\":\"prevPool\",\"type\":\"address\"}],\"name\":\"setPreviousPool\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"rateLimitAdmin\",\"type\":\"address\"}],\"name\":\"setRateLimitAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"rebalancer\",\"type\":\"address\"}],\"name\":\"setRebalancer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"remotePoolAddress\",\"type\":\"bytes\"}],\"name\":\"setRemotePool\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newRouter\",\"type\":\"address\"}],\"name\":\"setRouter\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transferLiquidity\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"withdrawLiquidity\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", + Bin: "0x6101006040523480156200001257600080fd5b5060405162004f4338038062004f4383398101604081905262000035916200056d565b84848483838383833380600081620000945760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000c757620000c78162000186565b5050506001600160a01b0384161580620000e857506001600160a01b038116155b80620000fb57506001600160a01b038216155b156200011a576040516342bcdf7f60e11b815260040160405180910390fd5b6001600160a01b0384811660805282811660a052600480546001600160a01b031916918316919091179055825115801560c0526200016d576040805160008152602081019091526200016d908462000231565b5050505094151560e05250620006de9650505050505050565b336001600160a01b03821603620001e05760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c6600000000000000000060448201526064016200008b565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b60c05162000252576040516335f4a7b360e01b815260040160405180910390fd5b60005b8251811015620002dd57600083828151811062000276576200027662000690565b60209081029190910101519050620002906002826200038e565b15620002d3576040516001600160a01b03821681527f800671136ab6cfee9fbe5ed1fb7ca417811aca3cf864800d127b927adedf75669060200160405180910390a15b5060010162000255565b5060005b81518110156200038957600082828151811062000302576200030262000690565b6020026020010151905060006001600160a01b0316816001600160a01b0316036200032e575062000380565b6200033b600282620003ae565b156200037e576040516001600160a01b03821681527f2640d4d76caf8bf478aabfa982fa4e1c4eb71a37f93cd15e80dbc657911546d89060200160405180910390a15b505b600101620002e1565b505050565b6000620003a5836001600160a01b038416620003c5565b90505b92915050565b6000620003a5836001600160a01b038416620004c9565b60008181526001830160205260408120548015620004be576000620003ec600183620006a6565b85549091506000906200040290600190620006a6565b90508082146200046e57600086600001828154811062000426576200042662000690565b90600052602060002001549050808760000184815481106200044c576200044c62000690565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080620004825762000482620006c8565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050620003a8565b6000915050620003a8565b60008181526001830160205260408120546200051257508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155620003a8565b506000620003a8565b6001600160a01b03811681146200053157600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b805162000557816200051b565b919050565b805180151581146200055757600080fd5b600080600080600060a086880312156200058657600080fd5b855162000593816200051b565b602087810151919650906001600160401b0380821115620005b357600080fd5b818901915089601f830112620005c857600080fd5b815181811115620005dd57620005dd62000534565b8060051b604051601f19603f8301168101818110858211171562000605576200060562000534565b60405291825284820192508381018501918c8311156200062457600080fd5b938501935b828510156200064d576200063d856200054a565b8452938501939285019262000629565b80995050505050505062000664604087016200054a565b925062000674606087016200055c565b915062000684608087016200054a565b90509295509295909350565b634e487b7160e01b600052603260045260246000fd5b81810381811115620003a857634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603160045260246000fd5b60805160a05160c05160e0516147c2620007816000396000818161057e015261195401526000818161062b01528181611f8e0152612b4a01526000818161060501528181611d2101526122410152600081816102c80152818161031d01528181610809015281816108db015281816109b501528181611a1601528181611c41015281816121610152818161234701528181612ae00152612d3501526147c26000f3fe608060405234801561001057600080fd5b506004361061025c5760003560e01c80639766b93211610145578063c0d78655116100bd578063db6327dc1161008c578063e0351e1311610071578063e0351e1314610629578063eb521a4c1461064f578063f2fde38b1461066257600080fd5b8063db6327dc146105f0578063dc0bd9711461060357600080fd5b8063c0d78655146105a2578063c4bffe2b146105b5578063c75eea9c146105ca578063cf7401f3146105dd57600080fd5b8063a8d87a3b11610114578063b0f479a1116100f9578063b0f479a11461054b578063b794658014610569578063bb98546b1461057c57600080fd5b8063a8d87a3b146104c9578063af58d59f146104dc57600080fd5b80639766b932146104635780639a4575b914610476578063a2b261d814610496578063a7cd63b7146104b457600080fd5b806366320087116101d857806379ba5097116101a757806383826b2b1161018c57806383826b2b1461041f5780638926f54f146104325780638da5cb5b1461044557600080fd5b806379ba5097146104045780637d54534e1461040c57600080fd5b806366320087146103ad5780636cfd1553146103c05780636d3d1a58146103d357806378a010b2146103f157600080fd5b806321df0da71161022f5780633907753711610214578063390775371461035a578063432a6ba31461037c57806354c8a4f31461039a57600080fd5b806321df0da7146102c6578063240028e81461030d57600080fd5b806301ffc9a7146102615780630a2fd493146102895780630a861f2a146102a9578063181f5a77146102be575b600080fd5b61027461026f3660046136df565b610675565b60405190151581526020015b60405180910390f35b61029c61029736600461373e565b6106d1565b60405161028091906137c7565b6102bc6102b73660046137da565b610781565b005b61029c610932565b7f00000000000000000000000000000000000000000000000000000000000000005b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610280565b61027461031b366004613820565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff90811691161490565b61036d61036836600461383d565b61094e565b60405190518152602001610280565b600a5473ffffffffffffffffffffffffffffffffffffffff166102e8565b6102bc6103a83660046138c5565b610a87565b6102bc6103bb366004613931565b610b02565b6102bc6103ce366004613820565b610b8e565b60085473ffffffffffffffffffffffffffffffffffffffff166102e8565b6102bc6103ff36600461395d565b610bdd565b6102bc610d4c565b6102bc61041a366004613820565b610e49565b61027461042d3660046139e0565b610e98565b61027461044036600461373e565b610f65565b60005473ffffffffffffffffffffffffffffffffffffffff166102e8565b6102bc610471366004613820565b610f7c565b610489610484366004613a17565b61100b565b6040516102809190613a52565b60095473ffffffffffffffffffffffffffffffffffffffff166102e8565b6104bc6110d4565b6040516102809190613ab2565b6102e86104d736600461373e565b503090565b6104ef6104ea36600461373e565b6110e5565b604051610280919081516fffffffffffffffffffffffffffffffff908116825260208084015163ffffffff1690830152604080840151151590830152606080840151821690830152608092830151169181019190915260a00190565b60045473ffffffffffffffffffffffffffffffffffffffff166102e8565b61029c61057736600461373e565b6111ba565b7f0000000000000000000000000000000000000000000000000000000000000000610274565b6102bc6105b0366004613820565b6111e5565b6105bd6112b9565b6040516102809190613b0c565b6104ef6105d836600461373e565b611371565b6102bc6105eb366004613cc3565b611443565b6102bc6105fe366004613d08565b6114cc565b7f00000000000000000000000000000000000000000000000000000000000000006102e8565b7f0000000000000000000000000000000000000000000000000000000000000000610274565b6102bc61065d3660046137da565b611952565b6102bc610670366004613820565b611a6e565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167fe1d405660000000000000000000000000000000000000000000000000000000014806106cb57506106cb82611a82565b92915050565b67ffffffffffffffff811660009081526007602052604090206004018054606091906106fc90613d4a565b80601f016020809104026020016040519081016040528092919081815260200182805461072890613d4a565b80156107755780601f1061074a57610100808354040283529160200191610775565b820191906000526020600020905b81548152906001019060200180831161075857829003601f168201915b50505050509050919050565b600a5473ffffffffffffffffffffffffffffffffffffffff1633146107d9576040517f8e4a23d60000000000000000000000000000000000000000000000000000000081523360048201526024015b60405180910390fd5b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015281907f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16906370a0823190602401602060405180830381865afa158015610865573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108899190613d9d565b10156108c1576040517fbb55fd2700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61090273ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000163383611b66565b604051819033907fc2c3f06e49b9f15e7b4af9055e183b0d73362e033ad82a07dec9bf984017171990600090a350565b6040518060600160405280602281526020016147946022913981565b60408051602081019091526000815261096e61096983613e52565b611c3a565b60095473ffffffffffffffffffffffffffffffffffffffff166109e5576109e061099e6060840160408501613820565b73ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016906060850135611b66565b6109f6565b6109f66109f183613e52565b611e6b565b610a066060830160408401613820565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f2d87480f50083e2b2759522a8fdda59802650a8055e609a7772cf70c07748f528460600135604051610a6891815260200190565b60405180910390a3506040805160208101909152606090910135815290565b610a8f611f09565b610afc84848080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808802828101820190935287825290935087925086918291850190849080828437600092019190915250611f8c92505050565b50505050565b610b0a611f09565b6040517f0a861f2a0000000000000000000000000000000000000000000000000000000081526004810182905273ffffffffffffffffffffffffffffffffffffffff831690630a861f2a90602401600060405180830381600087803b158015610b7257600080fd5b505af1158015610b86573d6000803e3d6000fd5b505050505050565b610b96611f09565b600a80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b610be5611f09565b610bee83610f65565b610c30576040517f1e670e4b00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff841660048201526024016107d0565b67ffffffffffffffff831660009081526007602052604081206004018054610c5790613d4a565b80601f0160208091040260200160405190810160405280929190818152602001828054610c8390613d4a565b8015610cd05780601f10610ca557610100808354040283529160200191610cd0565b820191906000526020600020905b815481529060010190602001808311610cb357829003601f168201915b5050505067ffffffffffffffff8616600090815260076020526040902091925050600401610cff838583613f8f565b508367ffffffffffffffff167fdb4d6220746a38cbc5335f7e108f7de80f482f4d23350253dfd0917df75a14bf828585604051610d3e939291906140a9565b60405180910390a250505050565b60015473ffffffffffffffffffffffffffffffffffffffff163314610dcd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e65720000000000000000000060448201526064016107d0565b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b610e51611f09565b600880547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b600073ffffffffffffffffffffffffffffffffffffffff8216301480610f5e5750600480546040517f83826b2b00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff86169281019290925273ffffffffffffffffffffffffffffffffffffffff848116602484015216906383826b2b90604401602060405180830381865afa158015610f3a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f5e919061410d565b9392505050565b60006106cb600567ffffffffffffffff8416612142565b610f84611f09565b6009805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff000000000000000000000000000000000000000083168117909355604080519190921680825260208201939093527f81accd0a7023865eaa51b3399dd0eafc488bf3ba238402911e1659cfe860f22891015b60405180910390a15050565b604080518082019091526060808252602082015261103061102b8361412a565b61215a565b60095473ffffffffffffffffffffffffffffffffffffffff161561105f5761105f61105a8361412a565b612324565b6040516060830135815233907f9f1ec8c880f76798e7b793325d625e9b60e4082a553c98f42b6cda368dd600089060200160405180910390a260405180604001604052806110b9846020016020810190610577919061373e565b81526040805160208181019092526000815291015292915050565b60606110e0600261243e565b905090565b6040805160a08101825260008082526020820181905291810182905260608101829052608081019190915267ffffffffffffffff8216600090815260076020908152604091829020825160a08101845260028201546fffffffffffffffffffffffffffffffff808216835270010000000000000000000000000000000080830463ffffffff16958401959095527401000000000000000000000000000000000000000090910460ff1615159482019490945260039091015480841660608301529190910490911660808201526106cb9061244b565b67ffffffffffffffff811660009081526007602052604090206005018054606091906106fc90613d4a565b6111ed611f09565b73ffffffffffffffffffffffffffffffffffffffff811661123a576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6004805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff000000000000000000000000000000000000000083168117909355604080519190921680825260208201939093527f02dc5c233404867c793b749c6d644beb2277536d18a7e7974d3f238e4c6f16849101610fff565b606060006112c7600561243e565b90506000815167ffffffffffffffff8111156112e5576112e5613b4e565b60405190808252806020026020018201604052801561130e578160200160208202803683370190505b50905060005b825181101561136a5782818151811061132f5761132f6141cc565b6020026020010151828281518110611349576113496141cc565b67ffffffffffffffff90921660209283029190910190910152600101611314565b5092915050565b6040805160a08101825260008082526020820181905291810182905260608101829052608081019190915267ffffffffffffffff8216600090815260076020908152604091829020825160a08101845281546fffffffffffffffffffffffffffffffff808216835270010000000000000000000000000000000080830463ffffffff16958401959095527401000000000000000000000000000000000000000090910460ff1615159482019490945260019091015480841660608301529190910490911660808201526106cb9061244b565b60085473ffffffffffffffffffffffffffffffffffffffff163314801590611483575060005473ffffffffffffffffffffffffffffffffffffffff163314155b156114bc576040517f8e4a23d60000000000000000000000000000000000000000000000000000000081523360048201526024016107d0565b6114c78383836124fd565b505050565b6114d4611f09565b60005b818110156114c75760008383838181106114f3576114f36141cc565b905060200281019061150591906141fb565b61150e90614239565b905061152381608001518260200151156125e7565b6115368160a001518260200151156125e7565b8060200151156118325780516115589060059067ffffffffffffffff16612720565b61159d5780516040517f1d5ad3c500000000000000000000000000000000000000000000000000000000815267ffffffffffffffff90911660048201526024016107d0565b60408101515115806115b25750606081015151155b156115e9576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040805161012081018252608083810180516020908101516fffffffffffffffffffffffffffffffff9081168486019081524263ffffffff90811660a0808901829052865151151560c08a01528651860151851660e08a015295518901518416610100890152918752875180860189529489018051850151841686528585019290925281515115158589015281518401518316606080870191909152915188015183168587015283870194855288880151878901908152828a015183890152895167ffffffffffffffff1660009081526007865289902088518051825482890151838e01519289167fffffffffffffffffffffffff0000000000000000000000000000000000000000928316177001000000000000000000000000000000009188168202177fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff90811674010000000000000000000000000000000000000000941515850217865584890151948d0151948a16948a168202949094176001860155995180516002860180549b8301519f830151918b169b9093169a909a179d9096168a029c909c179091169615150295909517909855908101519401519381169316909102919091176003820155915190919060048201906117ca90826142ed565b50606082015160058201906117df90826142ed565b505081516060830151608084015160a08501516040517f8d340f17e19058004c20453540862a9c62778504476f6756755cb33bcd6c38c295506118259493929190614407565b60405180910390a1611949565b805161184a9060059067ffffffffffffffff1661272c565b61188f5780516040517f1e670e4b00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff90911660048201526024016107d0565b805167ffffffffffffffff16600090815260076020526040812080547fffffffffffffffffffffff000000000000000000000000000000000000000000908116825560018201839055600282018054909116905560038101829055906118f86004830182613691565b611906600583016000613691565b5050805160405167ffffffffffffffff90911681527f5204aec90a3c794d8e90fded8b46ae9c7c552803e7e832e0c1d358396d8599169060200160405180910390a15b506001016114d7565b7f00000000000000000000000000000000000000000000000000000000000000006119a9576040517fe93f8fa400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600a5473ffffffffffffffffffffffffffffffffffffffff1633146119fc576040517f8e4a23d60000000000000000000000000000000000000000000000000000000081523360048201526024016107d0565b611a3e73ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016333084612738565b604051819033907fc17cea59c2955cb181b03393209566960365771dbba9dc3d510180e7cb31208890600090a350565b611a76611f09565b611a7f81612796565b50565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167faff2afbf000000000000000000000000000000000000000000000000000000001480611b1557507fffffffff0000000000000000000000000000000000000000000000000000000082167f0e64dd2900000000000000000000000000000000000000000000000000000000145b806106cb57507fffffffff0000000000000000000000000000000000000000000000000000000082167f01ffc9a7000000000000000000000000000000000000000000000000000000001492915050565b60405173ffffffffffffffffffffffffffffffffffffffff83166024820152604481018290526114c79084907fa9059cbb00000000000000000000000000000000000000000000000000000000906064015b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff000000000000000000000000000000000000000000000000000000009093169290921790915261288b565b60808101517f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff908116911614611ccf5760808101516040517f961c9a4f00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff90911660048201526024016107d0565b60208101516040517f2cbc26bb00000000000000000000000000000000000000000000000000000000815260809190911b77ffffffffffffffff000000000000000000000000000000001660048201527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1690632cbc26bb90602401602060405180830381865afa158015611d7d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611da1919061410d565b15611dd8576040517f53ad11d800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611de58160200151612997565b6000611df482602001516106d1565b9050805160001480611e18575080805190602001208260a001518051906020012014155b15611e55578160a001516040517f24eb47e50000000000000000000000000000000000000000000000000000000081526004016107d091906137c7565b611e6782602001518360600151612abd565b5050565b60095481516040808401516060850151602086015192517f8627fad600000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff90951694638627fad694611ed494909392916004016144a0565b600060405180830381600087803b158015611eee57600080fd5b505af1158015611f02573d6000803e3d6000fd5b5050505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314611f8a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e65720000000000000000000060448201526064016107d0565b565b7f0000000000000000000000000000000000000000000000000000000000000000611fe3576040517f35f4a7b300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b8251811015612079576000838281518110612003576120036141cc565b60200260200101519050612021816002612b0490919063ffffffff16565b156120705760405173ffffffffffffffffffffffffffffffffffffffff821681527f800671136ab6cfee9fbe5ed1fb7ca417811aca3cf864800d127b927adedf75669060200160405180910390a15b50600101611fe6565b5060005b81518110156114c757600082828151811061209a5761209a6141cc565b60200260200101519050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036120de575061213a565b6120e9600282612b26565b156121385760405173ffffffffffffffffffffffffffffffffffffffff821681527f2640d4d76caf8bf478aabfa982fa4e1c4eb71a37f93cd15e80dbc657911546d89060200160405180910390a15b505b60010161207d565b60008181526001830160205260408120541515610f5e565b60808101517f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff9081169116146121ef5760808101516040517f961c9a4f00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff90911660048201526024016107d0565b60208101516040517f2cbc26bb00000000000000000000000000000000000000000000000000000000815260809190911b77ffffffffffffffff000000000000000000000000000000001660048201527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1690632cbc26bb90602401602060405180830381865afa15801561229d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122c1919061410d565b156122f8576040517f53ad11d800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6123058160400151612b48565b6123128160200151612bc7565b611a7f81602001518260600151612d15565b60095460608201516123719173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000811692911690611b66565b60095460408083015183516060850151602086015193517f9687544500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff909516946396875445946123d994939291600401614501565b6000604051808303816000875af11580156123f8573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201604052611e679190810190614561565b60606000610f5e83612d59565b6040805160a0810182526000808252602082018190529181018290526060810182905260808101919091526124d982606001516fffffffffffffffffffffffffffffffff1683600001516fffffffffffffffffffffffffffffffff16846020015163ffffffff16426124bd91906145fe565b85608001516fffffffffffffffffffffffffffffffff16612db4565b6fffffffffffffffffffffffffffffffff1682525063ffffffff4216602082015290565b61250683610f65565b612548576040517f1e670e4b00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff841660048201526024016107d0565b6125538260006125e7565b67ffffffffffffffff831660009081526007602052604090206125769083612dde565b6125818160006125e7565b67ffffffffffffffff831660009081526007602052604090206125a79060020182612dde565b7f0350d63aa5f270e01729d00d627eeb8f3429772b1818c016c66a588a864f912b8383836040516125da93929190614611565b60405180910390a1505050565b8151156126ae5781602001516fffffffffffffffffffffffffffffffff1682604001516fffffffffffffffffffffffffffffffff1610158061263d575060408201516fffffffffffffffffffffffffffffffff16155b1561267657816040517f8020d1240000000000000000000000000000000000000000000000000000000081526004016107d09190614694565b8015611e67576040517f433fc33d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60408201516fffffffffffffffffffffffffffffffff161515806126e7575060208201516fffffffffffffffffffffffffffffffff1615155b15611e6757816040517fd68af9cc0000000000000000000000000000000000000000000000000000000081526004016107d09190614694565b6000610f5e8383612f80565b6000610f5e8383612fcf565b60405173ffffffffffffffffffffffffffffffffffffffff80851660248301528316604482015260648101829052610afc9085907f23b872dd0000000000000000000000000000000000000000000000000000000090608401611bb8565b3373ffffffffffffffffffffffffffffffffffffffff821603612815576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c6600000000000000000060448201526064016107d0565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b60006128ed826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166130c29092919063ffffffff16565b8051909150156114c7578080602001905181019061290b919061410d565b6114c7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f7420737563636565640000000000000000000000000000000000000000000060648201526084016107d0565b6129a081610f65565b6129e2576040517fa9902c7e00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff821660048201526024016107d0565b600480546040517f83826b2b00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff84169281019290925233602483015273ffffffffffffffffffffffffffffffffffffffff16906383826b2b90604401602060405180830381865afa158015612a61573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a85919061410d565b611a7f576040517f728fe07b0000000000000000000000000000000000000000000000000000000081523360048201526024016107d0565b67ffffffffffffffff82166000908152600760205260409020611e6790600201827f00000000000000000000000000000000000000000000000000000000000000006130d1565b6000610f5e8373ffffffffffffffffffffffffffffffffffffffff8416612fcf565b6000610f5e8373ffffffffffffffffffffffffffffffffffffffff8416612f80565b7f000000000000000000000000000000000000000000000000000000000000000015611a7f57612b79600282613454565b611a7f576040517fd0d2597600000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff821660048201526024016107d0565b612bd081610f65565b612c12576040517fa9902c7e00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff821660048201526024016107d0565b600480546040517fa8d87a3b00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff84169281019290925273ffffffffffffffffffffffffffffffffffffffff169063a8d87a3b90602401602060405180830381865afa158015612c8b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612caf91906146d0565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611a7f576040517f728fe07b0000000000000000000000000000000000000000000000000000000081523360048201526024016107d0565b67ffffffffffffffff82166000908152600760205260409020611e6790827f00000000000000000000000000000000000000000000000000000000000000006130d1565b60608160000180548060200260200160405190810160405280929190818152602001828054801561077557602002820191906000526020600020905b815481526020019060010190808311612d955750505050509050919050565b6000612dd385612dc484866146ed565b612dce9087614704565b613483565b90505b949350505050565b8154600090612e0790700100000000000000000000000000000000900463ffffffff16426145fe565b90508015612ea95760018301548354612e4f916fffffffffffffffffffffffffffffffff80821692811691859170010000000000000000000000000000000090910416612db4565b83546fffffffffffffffffffffffffffffffff919091167fffffffffffffffffffffffff0000000000000000000000000000000000000000909116177001000000000000000000000000000000004263ffffffff16021783555b60208201518354612ecf916fffffffffffffffffffffffffffffffff9081169116613483565b83548351151574010000000000000000000000000000000000000000027fffffffffffffffffffffff00ffffffff000000000000000000000000000000009091166fffffffffffffffffffffffffffffffff92831617178455602083015160408085015183167001000000000000000000000000000000000291909216176001850155517f9ea3374b67bf275e6bb9c8ae68f9cae023e1c528b4b27e092f0bb209d3531c19906125da908490614694565b6000818152600183016020526040812054612fc7575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556106cb565b5060006106cb565b600081815260018301602052604081205480156130b8576000612ff36001836145fe565b8554909150600090613007906001906145fe565b905080821461306c576000866000018281548110613027576130276141cc565b906000526020600020015490508087600001848154811061304a5761304a6141cc565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061307d5761307d614717565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506106cb565b60009150506106cb565b6060612dd68484600085613499565b825474010000000000000000000000000000000000000000900460ff1615806130f8575081155b1561310257505050565b825460018401546fffffffffffffffffffffffffffffffff8083169291169060009061314890700100000000000000000000000000000000900463ffffffff16426145fe565b90508015613208578183111561318a576040517f9725942a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60018601546131c49083908590849070010000000000000000000000000000000090046fffffffffffffffffffffffffffffffff16612db4565b86547fffffffffffffffffffffffff00000000ffffffffffffffffffffffffffffffff167001000000000000000000000000000000004263ffffffff160217875592505b848210156132bf5773ffffffffffffffffffffffffffffffffffffffff8416613267576040517ff94ebcd100000000000000000000000000000000000000000000000000000000815260048101839052602481018690526044016107d0565b6040517f1a76572a000000000000000000000000000000000000000000000000000000008152600481018390526024810186905273ffffffffffffffffffffffffffffffffffffffff851660448201526064016107d0565b848310156133d25760018681015470010000000000000000000000000000000090046fffffffffffffffffffffffffffffffff1690600090829061330390826145fe565b61330d878a6145fe565b6133179190614704565b6133219190614746565b905073ffffffffffffffffffffffffffffffffffffffff861661337a576040517f15279c0800000000000000000000000000000000000000000000000000000000815260048101829052602481018690526044016107d0565b6040517fd0c8d23a000000000000000000000000000000000000000000000000000000008152600481018290526024810186905273ffffffffffffffffffffffffffffffffffffffff871660448201526064016107d0565b6133dc85846145fe565b86547fffffffffffffffffffffffffffffffff00000000000000000000000000000000166fffffffffffffffffffffffffffffffff82161787556040518681529093507f1871cdf8010e63f2eb8384381a68dfa7416dc571a5517e66e88b2d2d0c0a690a9060200160405180910390a1505050505050565b73ffffffffffffffffffffffffffffffffffffffff811660009081526001830160205260408120541515610f5e565b60008183106134925781610f5e565b5090919050565b60608247101561352b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c000000000000000000000000000000000000000000000000000060648201526084016107d0565b6000808673ffffffffffffffffffffffffffffffffffffffff1685876040516135549190614781565b60006040518083038185875af1925050503d8060008114613591576040519150601f19603f3d011682016040523d82523d6000602084013e613596565b606091505b50915091506135a7878383876135b2565b979650505050505050565b606083156136485782516000036136415773ffffffffffffffffffffffffffffffffffffffff85163b613641576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016107d0565b5081612dd6565b612dd6838381511561365d5781518083602001fd5b806040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107d091906137c7565b50805461369d90613d4a565b6000825580601f106136ad575050565b601f016020900490600052602060002090810190611a7f91905b808211156136db57600081556001016136c7565b5090565b6000602082840312156136f157600080fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114610f5e57600080fd5b803567ffffffffffffffff8116811461373957600080fd5b919050565b60006020828403121561375057600080fd5b610f5e82613721565b60005b8381101561377457818101518382015260200161375c565b50506000910152565b60008151808452613795816020860160208601613759565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b602081526000610f5e602083018461377d565b6000602082840312156137ec57600080fd5b5035919050565b73ffffffffffffffffffffffffffffffffffffffff81168114611a7f57600080fd5b8035613739816137f3565b60006020828403121561383257600080fd5b8135610f5e816137f3565b60006020828403121561384f57600080fd5b813567ffffffffffffffff81111561386657600080fd5b82016101008185031215610f5e57600080fd5b60008083601f84011261388b57600080fd5b50813567ffffffffffffffff8111156138a357600080fd5b6020830191508360208260051b85010111156138be57600080fd5b9250929050565b600080600080604085870312156138db57600080fd5b843567ffffffffffffffff808211156138f357600080fd5b6138ff88838901613879565b9096509450602087013591508082111561391857600080fd5b5061392587828801613879565b95989497509550505050565b6000806040838503121561394457600080fd5b823561394f816137f3565b946020939093013593505050565b60008060006040848603121561397257600080fd5b61397b84613721565b9250602084013567ffffffffffffffff8082111561399857600080fd5b818601915086601f8301126139ac57600080fd5b8135818111156139bb57600080fd5b8760208285010111156139cd57600080fd5b6020830194508093505050509250925092565b600080604083850312156139f357600080fd5b6139fc83613721565b91506020830135613a0c816137f3565b809150509250929050565b600060208284031215613a2957600080fd5b813567ffffffffffffffff811115613a4057600080fd5b820160a08185031215610f5e57600080fd5b602081526000825160406020840152613a6e606084018261377d565b905060208401517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0848303016040850152613aa9828261377d565b95945050505050565b6020808252825182820181905260009190848201906040850190845b81811015613b0057835173ffffffffffffffffffffffffffffffffffffffff1683529284019291840191600101613ace565b50909695505050505050565b6020808252825182820181905260009190848201906040850190845b81811015613b0057835167ffffffffffffffff1683529284019291840191600101613b28565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051610100810167ffffffffffffffff81118282101715613ba157613ba1613b4e565b60405290565b60405160c0810167ffffffffffffffff81118282101715613ba157613ba1613b4e565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715613c1157613c11613b4e565b604052919050565b8015158114611a7f57600080fd5b803561373981613c19565b80356fffffffffffffffffffffffffffffffff8116811461373957600080fd5b600060608284031215613c6457600080fd5b6040516060810181811067ffffffffffffffff82111715613c8757613c87613b4e565b6040529050808235613c9881613c19565b8152613ca660208401613c32565b6020820152613cb760408401613c32565b60408201525092915050565b600080600060e08486031215613cd857600080fd5b613ce184613721565b9250613cf08560208601613c52565b9150613cff8560808601613c52565b90509250925092565b60008060208385031215613d1b57600080fd5b823567ffffffffffffffff811115613d3257600080fd5b613d3e85828601613879565b90969095509350505050565b600181811c90821680613d5e57607f821691505b602082108103613d97577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b600060208284031215613daf57600080fd5b5051919050565b600067ffffffffffffffff821115613dd057613dd0613b4e565b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b600082601f830112613e0d57600080fd5b8135613e20613e1b82613db6565b613bca565b818152846020838601011115613e3557600080fd5b816020850160208301376000918101602001919091529392505050565b60006101008236031215613e6557600080fd5b613e6d613b7d565b823567ffffffffffffffff80821115613e8557600080fd5b613e9136838701613dfc565b8352613e9f60208601613721565b6020840152613eb060408601613815565b604084015260608501356060840152613ecb60808601613815565b608084015260a0850135915080821115613ee457600080fd5b613ef036838701613dfc565b60a084015260c0850135915080821115613f0957600080fd5b613f1536838701613dfc565b60c084015260e0850135915080821115613f2e57600080fd5b50613f3b36828601613dfc565b60e08301525092915050565b601f8211156114c7576000816000526020600020601f850160051c81016020861015613f705750805b601f850160051c820191505b81811015610b8657828155600101613f7c565b67ffffffffffffffff831115613fa757613fa7613b4e565b613fbb83613fb58354613d4a565b83613f47565b6000601f84116001811461400d5760008515613fd75750838201355b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600387901b1c1916600186901b178355611f02565b6000838152602090207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0861690835b8281101561405c578685013582556020948501946001909201910161403c565b5086821015614097577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60f88860031b161c19848701351681555b505060018560011b0183555050505050565b6040815260006140bc604083018661377d565b82810360208401528381528385602083013760006020858301015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f860116820101915050949350505050565b60006020828403121561411f57600080fd5b8151610f5e81613c19565b600060a0823603121561413c57600080fd5b60405160a0810167ffffffffffffffff828210818311171561416057614160613b4e565b81604052843591508082111561417557600080fd5b5061418236828601613dfc565b82525061419160208401613721565b602082015260408301356141a4816137f3565b60408201526060838101359082015260808301356141c1816137f3565b608082015292915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600082357ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec183360301811261422f57600080fd5b9190910192915050565b6000610140823603121561424c57600080fd5b614254613ba7565b61425d83613721565b815261426b60208401613c27565b6020820152604083013567ffffffffffffffff8082111561428b57600080fd5b61429736838701613dfc565b604084015260608501359150808211156142b057600080fd5b506142bd36828601613dfc565b6060830152506142d03660808501613c52565b60808201526142e23660e08501613c52565b60a082015292915050565b815167ffffffffffffffff81111561430757614307613b4e565b61431b816143158454613d4a565b84613f47565b602080601f83116001811461436e57600084156143385750858301515b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600386901b1c1916600185901b178555610b86565b6000858152602081207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08616915b828110156143bb5788860151825594840194600190910190840161439c565b50858210156143f757878501517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600388901b60f8161c191681555b5050505050600190811b01905550565b600061010067ffffffffffffffff8716835280602084015261442b8184018761377d565b8551151560408581019190915260208701516fffffffffffffffffffffffffffffffff90811660608701529087015116608085015291506144699050565b8251151560a083015260208301516fffffffffffffffffffffffffffffffff90811660c084015260408401511660e0830152613aa9565b60a0815260006144b360a083018761377d565b73ffffffffffffffffffffffffffffffffffffffff8616602084015284604084015267ffffffffffffffff841660608401528281036080840152600081526020810191505095945050505050565b73ffffffffffffffffffffffffffffffffffffffff8516815260a06020820152600061453060a083018661377d565b60408301949094525067ffffffffffffffff9190911660608201528082036080909101526000815260200192915050565b60006020828403121561457357600080fd5b815167ffffffffffffffff81111561458a57600080fd5b8201601f8101841361459b57600080fd5b80516145a9613e1b82613db6565b8181528560208385010111156145be57600080fd5b613aa9826020830160208601613759565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b818103818111156106cb576106cb6145cf565b67ffffffffffffffff8416815260e0810161465d60208301858051151582526020808201516fffffffffffffffffffffffffffffffff9081169184019190915260409182015116910152565b82511515608083015260208301516fffffffffffffffffffffffffffffffff90811660a084015260408401511660c0830152612dd6565b606081016106cb82848051151582526020808201516fffffffffffffffffffffffffffffffff9081169184019190915260409182015116910152565b6000602082840312156146e257600080fd5b8151610f5e816137f3565b80820281158282048414176106cb576106cb6145cf565b808201808211156106cb576106cb6145cf565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b60008261477c577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b6000825161422f81846020870161375956fe4c6f636b52656c65617365546f6b656e506f6f6c416e6450726f787920312e352e30a164736f6c6343000818000a", +} + +var LockReleaseTokenPoolAndProxyABI = LockReleaseTokenPoolAndProxyMetaData.ABI + +var LockReleaseTokenPoolAndProxyBin = LockReleaseTokenPoolAndProxyMetaData.Bin + +func DeployLockReleaseTokenPoolAndProxy(auth *bind.TransactOpts, backend bind.ContractBackend, token common.Address, allowlist []common.Address, rmnProxy common.Address, acceptLiquidity bool, router common.Address) (common.Address, *types.Transaction, *LockReleaseTokenPoolAndProxy, error) { + parsed, err := LockReleaseTokenPoolAndProxyMetaData.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(LockReleaseTokenPoolAndProxyBin), backend, token, allowlist, rmnProxy, acceptLiquidity, router) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &LockReleaseTokenPoolAndProxy{address: address, abi: *parsed, LockReleaseTokenPoolAndProxyCaller: LockReleaseTokenPoolAndProxyCaller{contract: contract}, LockReleaseTokenPoolAndProxyTransactor: LockReleaseTokenPoolAndProxyTransactor{contract: contract}, LockReleaseTokenPoolAndProxyFilterer: LockReleaseTokenPoolAndProxyFilterer{contract: contract}}, nil +} + +type LockReleaseTokenPoolAndProxy struct { + address common.Address + abi abi.ABI + LockReleaseTokenPoolAndProxyCaller + LockReleaseTokenPoolAndProxyTransactor + LockReleaseTokenPoolAndProxyFilterer +} + +type LockReleaseTokenPoolAndProxyCaller struct { + contract *bind.BoundContract +} + +type LockReleaseTokenPoolAndProxyTransactor struct { + contract *bind.BoundContract +} + +type LockReleaseTokenPoolAndProxyFilterer struct { + contract *bind.BoundContract +} + +type LockReleaseTokenPoolAndProxySession struct { + Contract *LockReleaseTokenPoolAndProxy + CallOpts bind.CallOpts + TransactOpts bind.TransactOpts +} + +type LockReleaseTokenPoolAndProxyCallerSession struct { + Contract *LockReleaseTokenPoolAndProxyCaller + CallOpts bind.CallOpts +} + +type LockReleaseTokenPoolAndProxyTransactorSession struct { + Contract *LockReleaseTokenPoolAndProxyTransactor + TransactOpts bind.TransactOpts +} + +type LockReleaseTokenPoolAndProxyRaw struct { + Contract *LockReleaseTokenPoolAndProxy +} + +type LockReleaseTokenPoolAndProxyCallerRaw struct { + Contract *LockReleaseTokenPoolAndProxyCaller +} + +type LockReleaseTokenPoolAndProxyTransactorRaw struct { + Contract *LockReleaseTokenPoolAndProxyTransactor +} + +func NewLockReleaseTokenPoolAndProxy(address common.Address, backend bind.ContractBackend) (*LockReleaseTokenPoolAndProxy, error) { + abi, err := abi.JSON(strings.NewReader(LockReleaseTokenPoolAndProxyABI)) + if err != nil { + return nil, err + } + contract, err := bindLockReleaseTokenPoolAndProxy(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &LockReleaseTokenPoolAndProxy{address: address, abi: abi, LockReleaseTokenPoolAndProxyCaller: LockReleaseTokenPoolAndProxyCaller{contract: contract}, LockReleaseTokenPoolAndProxyTransactor: LockReleaseTokenPoolAndProxyTransactor{contract: contract}, LockReleaseTokenPoolAndProxyFilterer: LockReleaseTokenPoolAndProxyFilterer{contract: contract}}, nil +} + +func NewLockReleaseTokenPoolAndProxyCaller(address common.Address, caller bind.ContractCaller) (*LockReleaseTokenPoolAndProxyCaller, error) { + contract, err := bindLockReleaseTokenPoolAndProxy(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &LockReleaseTokenPoolAndProxyCaller{contract: contract}, nil +} + +func NewLockReleaseTokenPoolAndProxyTransactor(address common.Address, transactor bind.ContractTransactor) (*LockReleaseTokenPoolAndProxyTransactor, error) { + contract, err := bindLockReleaseTokenPoolAndProxy(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &LockReleaseTokenPoolAndProxyTransactor{contract: contract}, nil +} + +func NewLockReleaseTokenPoolAndProxyFilterer(address common.Address, filterer bind.ContractFilterer) (*LockReleaseTokenPoolAndProxyFilterer, error) { + contract, err := bindLockReleaseTokenPoolAndProxy(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &LockReleaseTokenPoolAndProxyFilterer{contract: contract}, nil +} + +func bindLockReleaseTokenPoolAndProxy(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := LockReleaseTokenPoolAndProxyMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _LockReleaseTokenPoolAndProxy.Contract.LockReleaseTokenPoolAndProxyCaller.contract.Call(opts, result, method, params...) +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _LockReleaseTokenPoolAndProxy.Contract.LockReleaseTokenPoolAndProxyTransactor.contract.Transfer(opts) +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _LockReleaseTokenPoolAndProxy.Contract.LockReleaseTokenPoolAndProxyTransactor.contract.Transact(opts, method, params...) +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _LockReleaseTokenPoolAndProxy.Contract.contract.Call(opts, result, method, params...) +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _LockReleaseTokenPoolAndProxy.Contract.contract.Transfer(opts) +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _LockReleaseTokenPoolAndProxy.Contract.contract.Transact(opts, method, params...) +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyCaller) CanAcceptLiquidity(opts *bind.CallOpts) (bool, error) { + var out []interface{} + err := _LockReleaseTokenPoolAndProxy.contract.Call(opts, &out, "canAcceptLiquidity") + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxySession) CanAcceptLiquidity() (bool, error) { + return _LockReleaseTokenPoolAndProxy.Contract.CanAcceptLiquidity(&_LockReleaseTokenPoolAndProxy.CallOpts) +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyCallerSession) CanAcceptLiquidity() (bool, error) { + return _LockReleaseTokenPoolAndProxy.Contract.CanAcceptLiquidity(&_LockReleaseTokenPoolAndProxy.CallOpts) +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyCaller) GetAllowList(opts *bind.CallOpts) ([]common.Address, error) { + var out []interface{} + err := _LockReleaseTokenPoolAndProxy.contract.Call(opts, &out, "getAllowList") + + if err != nil { + return *new([]common.Address), err + } + + out0 := *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) + + return out0, err + +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxySession) GetAllowList() ([]common.Address, error) { + return _LockReleaseTokenPoolAndProxy.Contract.GetAllowList(&_LockReleaseTokenPoolAndProxy.CallOpts) +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyCallerSession) GetAllowList() ([]common.Address, error) { + return _LockReleaseTokenPoolAndProxy.Contract.GetAllowList(&_LockReleaseTokenPoolAndProxy.CallOpts) +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyCaller) GetAllowListEnabled(opts *bind.CallOpts) (bool, error) { + var out []interface{} + err := _LockReleaseTokenPoolAndProxy.contract.Call(opts, &out, "getAllowListEnabled") + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxySession) GetAllowListEnabled() (bool, error) { + return _LockReleaseTokenPoolAndProxy.Contract.GetAllowListEnabled(&_LockReleaseTokenPoolAndProxy.CallOpts) +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyCallerSession) GetAllowListEnabled() (bool, error) { + return _LockReleaseTokenPoolAndProxy.Contract.GetAllowListEnabled(&_LockReleaseTokenPoolAndProxy.CallOpts) +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyCaller) GetCurrentInboundRateLimiterState(opts *bind.CallOpts, remoteChainSelector uint64) (RateLimiterTokenBucket, error) { + var out []interface{} + err := _LockReleaseTokenPoolAndProxy.contract.Call(opts, &out, "getCurrentInboundRateLimiterState", remoteChainSelector) + + if err != nil { + return *new(RateLimiterTokenBucket), err + } + + out0 := *abi.ConvertType(out[0], new(RateLimiterTokenBucket)).(*RateLimiterTokenBucket) + + return out0, err + +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxySession) GetCurrentInboundRateLimiterState(remoteChainSelector uint64) (RateLimiterTokenBucket, error) { + return _LockReleaseTokenPoolAndProxy.Contract.GetCurrentInboundRateLimiterState(&_LockReleaseTokenPoolAndProxy.CallOpts, remoteChainSelector) +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyCallerSession) GetCurrentInboundRateLimiterState(remoteChainSelector uint64) (RateLimiterTokenBucket, error) { + return _LockReleaseTokenPoolAndProxy.Contract.GetCurrentInboundRateLimiterState(&_LockReleaseTokenPoolAndProxy.CallOpts, remoteChainSelector) +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyCaller) GetCurrentOutboundRateLimiterState(opts *bind.CallOpts, remoteChainSelector uint64) (RateLimiterTokenBucket, error) { + var out []interface{} + err := _LockReleaseTokenPoolAndProxy.contract.Call(opts, &out, "getCurrentOutboundRateLimiterState", remoteChainSelector) + + if err != nil { + return *new(RateLimiterTokenBucket), err + } + + out0 := *abi.ConvertType(out[0], new(RateLimiterTokenBucket)).(*RateLimiterTokenBucket) + + return out0, err + +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxySession) GetCurrentOutboundRateLimiterState(remoteChainSelector uint64) (RateLimiterTokenBucket, error) { + return _LockReleaseTokenPoolAndProxy.Contract.GetCurrentOutboundRateLimiterState(&_LockReleaseTokenPoolAndProxy.CallOpts, remoteChainSelector) +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyCallerSession) GetCurrentOutboundRateLimiterState(remoteChainSelector uint64) (RateLimiterTokenBucket, error) { + return _LockReleaseTokenPoolAndProxy.Contract.GetCurrentOutboundRateLimiterState(&_LockReleaseTokenPoolAndProxy.CallOpts, remoteChainSelector) +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyCaller) GetOnRamp(opts *bind.CallOpts, arg0 uint64) (common.Address, error) { + var out []interface{} + err := _LockReleaseTokenPoolAndProxy.contract.Call(opts, &out, "getOnRamp", arg0) + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxySession) GetOnRamp(arg0 uint64) (common.Address, error) { + return _LockReleaseTokenPoolAndProxy.Contract.GetOnRamp(&_LockReleaseTokenPoolAndProxy.CallOpts, arg0) +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyCallerSession) GetOnRamp(arg0 uint64) (common.Address, error) { + return _LockReleaseTokenPoolAndProxy.Contract.GetOnRamp(&_LockReleaseTokenPoolAndProxy.CallOpts, arg0) +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyCaller) GetPreviousPool(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _LockReleaseTokenPoolAndProxy.contract.Call(opts, &out, "getPreviousPool") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxySession) GetPreviousPool() (common.Address, error) { + return _LockReleaseTokenPoolAndProxy.Contract.GetPreviousPool(&_LockReleaseTokenPoolAndProxy.CallOpts) +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyCallerSession) GetPreviousPool() (common.Address, error) { + return _LockReleaseTokenPoolAndProxy.Contract.GetPreviousPool(&_LockReleaseTokenPoolAndProxy.CallOpts) +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyCaller) GetRateLimitAdmin(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _LockReleaseTokenPoolAndProxy.contract.Call(opts, &out, "getRateLimitAdmin") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxySession) GetRateLimitAdmin() (common.Address, error) { + return _LockReleaseTokenPoolAndProxy.Contract.GetRateLimitAdmin(&_LockReleaseTokenPoolAndProxy.CallOpts) +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyCallerSession) GetRateLimitAdmin() (common.Address, error) { + return _LockReleaseTokenPoolAndProxy.Contract.GetRateLimitAdmin(&_LockReleaseTokenPoolAndProxy.CallOpts) +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyCaller) GetRebalancer(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _LockReleaseTokenPoolAndProxy.contract.Call(opts, &out, "getRebalancer") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxySession) GetRebalancer() (common.Address, error) { + return _LockReleaseTokenPoolAndProxy.Contract.GetRebalancer(&_LockReleaseTokenPoolAndProxy.CallOpts) +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyCallerSession) GetRebalancer() (common.Address, error) { + return _LockReleaseTokenPoolAndProxy.Contract.GetRebalancer(&_LockReleaseTokenPoolAndProxy.CallOpts) +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyCaller) GetRemotePool(opts *bind.CallOpts, remoteChainSelector uint64) ([]byte, error) { + var out []interface{} + err := _LockReleaseTokenPoolAndProxy.contract.Call(opts, &out, "getRemotePool", remoteChainSelector) + + if err != nil { + return *new([]byte), err + } + + out0 := *abi.ConvertType(out[0], new([]byte)).(*[]byte) + + return out0, err + +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxySession) GetRemotePool(remoteChainSelector uint64) ([]byte, error) { + return _LockReleaseTokenPoolAndProxy.Contract.GetRemotePool(&_LockReleaseTokenPoolAndProxy.CallOpts, remoteChainSelector) +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyCallerSession) GetRemotePool(remoteChainSelector uint64) ([]byte, error) { + return _LockReleaseTokenPoolAndProxy.Contract.GetRemotePool(&_LockReleaseTokenPoolAndProxy.CallOpts, remoteChainSelector) +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyCaller) GetRemoteToken(opts *bind.CallOpts, remoteChainSelector uint64) ([]byte, error) { + var out []interface{} + err := _LockReleaseTokenPoolAndProxy.contract.Call(opts, &out, "getRemoteToken", remoteChainSelector) + + if err != nil { + return *new([]byte), err + } + + out0 := *abi.ConvertType(out[0], new([]byte)).(*[]byte) + + return out0, err + +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxySession) GetRemoteToken(remoteChainSelector uint64) ([]byte, error) { + return _LockReleaseTokenPoolAndProxy.Contract.GetRemoteToken(&_LockReleaseTokenPoolAndProxy.CallOpts, remoteChainSelector) +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyCallerSession) GetRemoteToken(remoteChainSelector uint64) ([]byte, error) { + return _LockReleaseTokenPoolAndProxy.Contract.GetRemoteToken(&_LockReleaseTokenPoolAndProxy.CallOpts, remoteChainSelector) +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyCaller) GetRmnProxy(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _LockReleaseTokenPoolAndProxy.contract.Call(opts, &out, "getRmnProxy") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxySession) GetRmnProxy() (common.Address, error) { + return _LockReleaseTokenPoolAndProxy.Contract.GetRmnProxy(&_LockReleaseTokenPoolAndProxy.CallOpts) +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyCallerSession) GetRmnProxy() (common.Address, error) { + return _LockReleaseTokenPoolAndProxy.Contract.GetRmnProxy(&_LockReleaseTokenPoolAndProxy.CallOpts) +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyCaller) GetRouter(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _LockReleaseTokenPoolAndProxy.contract.Call(opts, &out, "getRouter") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxySession) GetRouter() (common.Address, error) { + return _LockReleaseTokenPoolAndProxy.Contract.GetRouter(&_LockReleaseTokenPoolAndProxy.CallOpts) +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyCallerSession) GetRouter() (common.Address, error) { + return _LockReleaseTokenPoolAndProxy.Contract.GetRouter(&_LockReleaseTokenPoolAndProxy.CallOpts) +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyCaller) GetSupportedChains(opts *bind.CallOpts) ([]uint64, error) { + var out []interface{} + err := _LockReleaseTokenPoolAndProxy.contract.Call(opts, &out, "getSupportedChains") + + if err != nil { + return *new([]uint64), err + } + + out0 := *abi.ConvertType(out[0], new([]uint64)).(*[]uint64) + + return out0, err + +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxySession) GetSupportedChains() ([]uint64, error) { + return _LockReleaseTokenPoolAndProxy.Contract.GetSupportedChains(&_LockReleaseTokenPoolAndProxy.CallOpts) +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyCallerSession) GetSupportedChains() ([]uint64, error) { + return _LockReleaseTokenPoolAndProxy.Contract.GetSupportedChains(&_LockReleaseTokenPoolAndProxy.CallOpts) +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyCaller) GetToken(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _LockReleaseTokenPoolAndProxy.contract.Call(opts, &out, "getToken") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxySession) GetToken() (common.Address, error) { + return _LockReleaseTokenPoolAndProxy.Contract.GetToken(&_LockReleaseTokenPoolAndProxy.CallOpts) +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyCallerSession) GetToken() (common.Address, error) { + return _LockReleaseTokenPoolAndProxy.Contract.GetToken(&_LockReleaseTokenPoolAndProxy.CallOpts) +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyCaller) IsOffRamp(opts *bind.CallOpts, sourceChainSelector uint64, offRamp common.Address) (bool, error) { + var out []interface{} + err := _LockReleaseTokenPoolAndProxy.contract.Call(opts, &out, "isOffRamp", sourceChainSelector, offRamp) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxySession) IsOffRamp(sourceChainSelector uint64, offRamp common.Address) (bool, error) { + return _LockReleaseTokenPoolAndProxy.Contract.IsOffRamp(&_LockReleaseTokenPoolAndProxy.CallOpts, sourceChainSelector, offRamp) +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyCallerSession) IsOffRamp(sourceChainSelector uint64, offRamp common.Address) (bool, error) { + return _LockReleaseTokenPoolAndProxy.Contract.IsOffRamp(&_LockReleaseTokenPoolAndProxy.CallOpts, sourceChainSelector, offRamp) +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyCaller) IsSupportedChain(opts *bind.CallOpts, remoteChainSelector uint64) (bool, error) { + var out []interface{} + err := _LockReleaseTokenPoolAndProxy.contract.Call(opts, &out, "isSupportedChain", remoteChainSelector) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxySession) IsSupportedChain(remoteChainSelector uint64) (bool, error) { + return _LockReleaseTokenPoolAndProxy.Contract.IsSupportedChain(&_LockReleaseTokenPoolAndProxy.CallOpts, remoteChainSelector) +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyCallerSession) IsSupportedChain(remoteChainSelector uint64) (bool, error) { + return _LockReleaseTokenPoolAndProxy.Contract.IsSupportedChain(&_LockReleaseTokenPoolAndProxy.CallOpts, remoteChainSelector) +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyCaller) IsSupportedToken(opts *bind.CallOpts, token common.Address) (bool, error) { + var out []interface{} + err := _LockReleaseTokenPoolAndProxy.contract.Call(opts, &out, "isSupportedToken", token) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxySession) IsSupportedToken(token common.Address) (bool, error) { + return _LockReleaseTokenPoolAndProxy.Contract.IsSupportedToken(&_LockReleaseTokenPoolAndProxy.CallOpts, token) +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyCallerSession) IsSupportedToken(token common.Address) (bool, error) { + return _LockReleaseTokenPoolAndProxy.Contract.IsSupportedToken(&_LockReleaseTokenPoolAndProxy.CallOpts, token) +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyCaller) Owner(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _LockReleaseTokenPoolAndProxy.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 + +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxySession) Owner() (common.Address, error) { + return _LockReleaseTokenPoolAndProxy.Contract.Owner(&_LockReleaseTokenPoolAndProxy.CallOpts) +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyCallerSession) Owner() (common.Address, error) { + return _LockReleaseTokenPoolAndProxy.Contract.Owner(&_LockReleaseTokenPoolAndProxy.CallOpts) +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyCaller) SupportsInterface(opts *bind.CallOpts, interfaceId [4]byte) (bool, error) { + var out []interface{} + err := _LockReleaseTokenPoolAndProxy.contract.Call(opts, &out, "supportsInterface", interfaceId) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxySession) SupportsInterface(interfaceId [4]byte) (bool, error) { + return _LockReleaseTokenPoolAndProxy.Contract.SupportsInterface(&_LockReleaseTokenPoolAndProxy.CallOpts, interfaceId) +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyCallerSession) SupportsInterface(interfaceId [4]byte) (bool, error) { + return _LockReleaseTokenPoolAndProxy.Contract.SupportsInterface(&_LockReleaseTokenPoolAndProxy.CallOpts, interfaceId) +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyCaller) TypeAndVersion(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _LockReleaseTokenPoolAndProxy.contract.Call(opts, &out, "typeAndVersion") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxySession) TypeAndVersion() (string, error) { + return _LockReleaseTokenPoolAndProxy.Contract.TypeAndVersion(&_LockReleaseTokenPoolAndProxy.CallOpts) +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyCallerSession) TypeAndVersion() (string, error) { + return _LockReleaseTokenPoolAndProxy.Contract.TypeAndVersion(&_LockReleaseTokenPoolAndProxy.CallOpts) +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyTransactor) AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + return _LockReleaseTokenPoolAndProxy.contract.Transact(opts, "acceptOwnership") +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxySession) AcceptOwnership() (*types.Transaction, error) { + return _LockReleaseTokenPoolAndProxy.Contract.AcceptOwnership(&_LockReleaseTokenPoolAndProxy.TransactOpts) +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyTransactorSession) AcceptOwnership() (*types.Transaction, error) { + return _LockReleaseTokenPoolAndProxy.Contract.AcceptOwnership(&_LockReleaseTokenPoolAndProxy.TransactOpts) +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyTransactor) ApplyAllowListUpdates(opts *bind.TransactOpts, removes []common.Address, adds []common.Address) (*types.Transaction, error) { + return _LockReleaseTokenPoolAndProxy.contract.Transact(opts, "applyAllowListUpdates", removes, adds) +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxySession) ApplyAllowListUpdates(removes []common.Address, adds []common.Address) (*types.Transaction, error) { + return _LockReleaseTokenPoolAndProxy.Contract.ApplyAllowListUpdates(&_LockReleaseTokenPoolAndProxy.TransactOpts, removes, adds) +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyTransactorSession) ApplyAllowListUpdates(removes []common.Address, adds []common.Address) (*types.Transaction, error) { + return _LockReleaseTokenPoolAndProxy.Contract.ApplyAllowListUpdates(&_LockReleaseTokenPoolAndProxy.TransactOpts, removes, adds) +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyTransactor) ApplyChainUpdates(opts *bind.TransactOpts, chains []TokenPoolChainUpdate) (*types.Transaction, error) { + return _LockReleaseTokenPoolAndProxy.contract.Transact(opts, "applyChainUpdates", chains) +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxySession) ApplyChainUpdates(chains []TokenPoolChainUpdate) (*types.Transaction, error) { + return _LockReleaseTokenPoolAndProxy.Contract.ApplyChainUpdates(&_LockReleaseTokenPoolAndProxy.TransactOpts, chains) +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyTransactorSession) ApplyChainUpdates(chains []TokenPoolChainUpdate) (*types.Transaction, error) { + return _LockReleaseTokenPoolAndProxy.Contract.ApplyChainUpdates(&_LockReleaseTokenPoolAndProxy.TransactOpts, chains) +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyTransactor) LockOrBurn(opts *bind.TransactOpts, lockOrBurnIn PoolLockOrBurnInV1) (*types.Transaction, error) { + return _LockReleaseTokenPoolAndProxy.contract.Transact(opts, "lockOrBurn", lockOrBurnIn) +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxySession) LockOrBurn(lockOrBurnIn PoolLockOrBurnInV1) (*types.Transaction, error) { + return _LockReleaseTokenPoolAndProxy.Contract.LockOrBurn(&_LockReleaseTokenPoolAndProxy.TransactOpts, lockOrBurnIn) +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyTransactorSession) LockOrBurn(lockOrBurnIn PoolLockOrBurnInV1) (*types.Transaction, error) { + return _LockReleaseTokenPoolAndProxy.Contract.LockOrBurn(&_LockReleaseTokenPoolAndProxy.TransactOpts, lockOrBurnIn) +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyTransactor) ProvideLiquidity(opts *bind.TransactOpts, amount *big.Int) (*types.Transaction, error) { + return _LockReleaseTokenPoolAndProxy.contract.Transact(opts, "provideLiquidity", amount) +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxySession) ProvideLiquidity(amount *big.Int) (*types.Transaction, error) { + return _LockReleaseTokenPoolAndProxy.Contract.ProvideLiquidity(&_LockReleaseTokenPoolAndProxy.TransactOpts, amount) +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyTransactorSession) ProvideLiquidity(amount *big.Int) (*types.Transaction, error) { + return _LockReleaseTokenPoolAndProxy.Contract.ProvideLiquidity(&_LockReleaseTokenPoolAndProxy.TransactOpts, amount) +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyTransactor) ReleaseOrMint(opts *bind.TransactOpts, releaseOrMintIn PoolReleaseOrMintInV1) (*types.Transaction, error) { + return _LockReleaseTokenPoolAndProxy.contract.Transact(opts, "releaseOrMint", releaseOrMintIn) +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxySession) ReleaseOrMint(releaseOrMintIn PoolReleaseOrMintInV1) (*types.Transaction, error) { + return _LockReleaseTokenPoolAndProxy.Contract.ReleaseOrMint(&_LockReleaseTokenPoolAndProxy.TransactOpts, releaseOrMintIn) +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyTransactorSession) ReleaseOrMint(releaseOrMintIn PoolReleaseOrMintInV1) (*types.Transaction, error) { + return _LockReleaseTokenPoolAndProxy.Contract.ReleaseOrMint(&_LockReleaseTokenPoolAndProxy.TransactOpts, releaseOrMintIn) +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyTransactor) SetChainRateLimiterConfig(opts *bind.TransactOpts, remoteChainSelector uint64, outboundConfig RateLimiterConfig, inboundConfig RateLimiterConfig) (*types.Transaction, error) { + return _LockReleaseTokenPoolAndProxy.contract.Transact(opts, "setChainRateLimiterConfig", remoteChainSelector, outboundConfig, inboundConfig) +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxySession) SetChainRateLimiterConfig(remoteChainSelector uint64, outboundConfig RateLimiterConfig, inboundConfig RateLimiterConfig) (*types.Transaction, error) { + return _LockReleaseTokenPoolAndProxy.Contract.SetChainRateLimiterConfig(&_LockReleaseTokenPoolAndProxy.TransactOpts, remoteChainSelector, outboundConfig, inboundConfig) +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyTransactorSession) SetChainRateLimiterConfig(remoteChainSelector uint64, outboundConfig RateLimiterConfig, inboundConfig RateLimiterConfig) (*types.Transaction, error) { + return _LockReleaseTokenPoolAndProxy.Contract.SetChainRateLimiterConfig(&_LockReleaseTokenPoolAndProxy.TransactOpts, remoteChainSelector, outboundConfig, inboundConfig) +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyTransactor) SetPreviousPool(opts *bind.TransactOpts, prevPool common.Address) (*types.Transaction, error) { + return _LockReleaseTokenPoolAndProxy.contract.Transact(opts, "setPreviousPool", prevPool) +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxySession) SetPreviousPool(prevPool common.Address) (*types.Transaction, error) { + return _LockReleaseTokenPoolAndProxy.Contract.SetPreviousPool(&_LockReleaseTokenPoolAndProxy.TransactOpts, prevPool) +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyTransactorSession) SetPreviousPool(prevPool common.Address) (*types.Transaction, error) { + return _LockReleaseTokenPoolAndProxy.Contract.SetPreviousPool(&_LockReleaseTokenPoolAndProxy.TransactOpts, prevPool) +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyTransactor) SetRateLimitAdmin(opts *bind.TransactOpts, rateLimitAdmin common.Address) (*types.Transaction, error) { + return _LockReleaseTokenPoolAndProxy.contract.Transact(opts, "setRateLimitAdmin", rateLimitAdmin) +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxySession) SetRateLimitAdmin(rateLimitAdmin common.Address) (*types.Transaction, error) { + return _LockReleaseTokenPoolAndProxy.Contract.SetRateLimitAdmin(&_LockReleaseTokenPoolAndProxy.TransactOpts, rateLimitAdmin) +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyTransactorSession) SetRateLimitAdmin(rateLimitAdmin common.Address) (*types.Transaction, error) { + return _LockReleaseTokenPoolAndProxy.Contract.SetRateLimitAdmin(&_LockReleaseTokenPoolAndProxy.TransactOpts, rateLimitAdmin) +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyTransactor) SetRebalancer(opts *bind.TransactOpts, rebalancer common.Address) (*types.Transaction, error) { + return _LockReleaseTokenPoolAndProxy.contract.Transact(opts, "setRebalancer", rebalancer) +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxySession) SetRebalancer(rebalancer common.Address) (*types.Transaction, error) { + return _LockReleaseTokenPoolAndProxy.Contract.SetRebalancer(&_LockReleaseTokenPoolAndProxy.TransactOpts, rebalancer) +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyTransactorSession) SetRebalancer(rebalancer common.Address) (*types.Transaction, error) { + return _LockReleaseTokenPoolAndProxy.Contract.SetRebalancer(&_LockReleaseTokenPoolAndProxy.TransactOpts, rebalancer) +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyTransactor) SetRemotePool(opts *bind.TransactOpts, remoteChainSelector uint64, remotePoolAddress []byte) (*types.Transaction, error) { + return _LockReleaseTokenPoolAndProxy.contract.Transact(opts, "setRemotePool", remoteChainSelector, remotePoolAddress) +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxySession) SetRemotePool(remoteChainSelector uint64, remotePoolAddress []byte) (*types.Transaction, error) { + return _LockReleaseTokenPoolAndProxy.Contract.SetRemotePool(&_LockReleaseTokenPoolAndProxy.TransactOpts, remoteChainSelector, remotePoolAddress) +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyTransactorSession) SetRemotePool(remoteChainSelector uint64, remotePoolAddress []byte) (*types.Transaction, error) { + return _LockReleaseTokenPoolAndProxy.Contract.SetRemotePool(&_LockReleaseTokenPoolAndProxy.TransactOpts, remoteChainSelector, remotePoolAddress) +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyTransactor) SetRouter(opts *bind.TransactOpts, newRouter common.Address) (*types.Transaction, error) { + return _LockReleaseTokenPoolAndProxy.contract.Transact(opts, "setRouter", newRouter) +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxySession) SetRouter(newRouter common.Address) (*types.Transaction, error) { + return _LockReleaseTokenPoolAndProxy.Contract.SetRouter(&_LockReleaseTokenPoolAndProxy.TransactOpts, newRouter) +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyTransactorSession) SetRouter(newRouter common.Address) (*types.Transaction, error) { + return _LockReleaseTokenPoolAndProxy.Contract.SetRouter(&_LockReleaseTokenPoolAndProxy.TransactOpts, newRouter) +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyTransactor) TransferLiquidity(opts *bind.TransactOpts, from common.Address, amount *big.Int) (*types.Transaction, error) { + return _LockReleaseTokenPoolAndProxy.contract.Transact(opts, "transferLiquidity", from, amount) +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxySession) TransferLiquidity(from common.Address, amount *big.Int) (*types.Transaction, error) { + return _LockReleaseTokenPoolAndProxy.Contract.TransferLiquidity(&_LockReleaseTokenPoolAndProxy.TransactOpts, from, amount) +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyTransactorSession) TransferLiquidity(from common.Address, amount *big.Int) (*types.Transaction, error) { + return _LockReleaseTokenPoolAndProxy.Contract.TransferLiquidity(&_LockReleaseTokenPoolAndProxy.TransactOpts, from, amount) +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyTransactor) TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) { + return _LockReleaseTokenPoolAndProxy.contract.Transact(opts, "transferOwnership", to) +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxySession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _LockReleaseTokenPoolAndProxy.Contract.TransferOwnership(&_LockReleaseTokenPoolAndProxy.TransactOpts, to) +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyTransactorSession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _LockReleaseTokenPoolAndProxy.Contract.TransferOwnership(&_LockReleaseTokenPoolAndProxy.TransactOpts, to) +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyTransactor) WithdrawLiquidity(opts *bind.TransactOpts, amount *big.Int) (*types.Transaction, error) { + return _LockReleaseTokenPoolAndProxy.contract.Transact(opts, "withdrawLiquidity", amount) +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxySession) WithdrawLiquidity(amount *big.Int) (*types.Transaction, error) { + return _LockReleaseTokenPoolAndProxy.Contract.WithdrawLiquidity(&_LockReleaseTokenPoolAndProxy.TransactOpts, amount) +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyTransactorSession) WithdrawLiquidity(amount *big.Int) (*types.Transaction, error) { + return _LockReleaseTokenPoolAndProxy.Contract.WithdrawLiquidity(&_LockReleaseTokenPoolAndProxy.TransactOpts, amount) +} + +type LockReleaseTokenPoolAndProxyAllowListAddIterator struct { + Event *LockReleaseTokenPoolAndProxyAllowListAdd + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *LockReleaseTokenPoolAndProxyAllowListAddIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolAndProxyAllowListAdd) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolAndProxyAllowListAdd) + 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() + } +} + +func (it *LockReleaseTokenPoolAndProxyAllowListAddIterator) Error() error { + return it.fail +} + +func (it *LockReleaseTokenPoolAndProxyAllowListAddIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type LockReleaseTokenPoolAndProxyAllowListAdd struct { + Sender common.Address + Raw types.Log +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyFilterer) FilterAllowListAdd(opts *bind.FilterOpts) (*LockReleaseTokenPoolAndProxyAllowListAddIterator, error) { + + logs, sub, err := _LockReleaseTokenPoolAndProxy.contract.FilterLogs(opts, "AllowListAdd") + if err != nil { + return nil, err + } + return &LockReleaseTokenPoolAndProxyAllowListAddIterator{contract: _LockReleaseTokenPoolAndProxy.contract, event: "AllowListAdd", logs: logs, sub: sub}, nil +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyFilterer) WatchAllowListAdd(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolAndProxyAllowListAdd) (event.Subscription, error) { + + logs, sub, err := _LockReleaseTokenPoolAndProxy.contract.WatchLogs(opts, "AllowListAdd") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(LockReleaseTokenPoolAndProxyAllowListAdd) + if err := _LockReleaseTokenPoolAndProxy.contract.UnpackLog(event, "AllowListAdd", 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 +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyFilterer) ParseAllowListAdd(log types.Log) (*LockReleaseTokenPoolAndProxyAllowListAdd, error) { + event := new(LockReleaseTokenPoolAndProxyAllowListAdd) + if err := _LockReleaseTokenPoolAndProxy.contract.UnpackLog(event, "AllowListAdd", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type LockReleaseTokenPoolAndProxyAllowListRemoveIterator struct { + Event *LockReleaseTokenPoolAndProxyAllowListRemove + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *LockReleaseTokenPoolAndProxyAllowListRemoveIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolAndProxyAllowListRemove) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolAndProxyAllowListRemove) + 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() + } +} + +func (it *LockReleaseTokenPoolAndProxyAllowListRemoveIterator) Error() error { + return it.fail +} + +func (it *LockReleaseTokenPoolAndProxyAllowListRemoveIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type LockReleaseTokenPoolAndProxyAllowListRemove struct { + Sender common.Address + Raw types.Log +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyFilterer) FilterAllowListRemove(opts *bind.FilterOpts) (*LockReleaseTokenPoolAndProxyAllowListRemoveIterator, error) { + + logs, sub, err := _LockReleaseTokenPoolAndProxy.contract.FilterLogs(opts, "AllowListRemove") + if err != nil { + return nil, err + } + return &LockReleaseTokenPoolAndProxyAllowListRemoveIterator{contract: _LockReleaseTokenPoolAndProxy.contract, event: "AllowListRemove", logs: logs, sub: sub}, nil +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyFilterer) WatchAllowListRemove(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolAndProxyAllowListRemove) (event.Subscription, error) { + + logs, sub, err := _LockReleaseTokenPoolAndProxy.contract.WatchLogs(opts, "AllowListRemove") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(LockReleaseTokenPoolAndProxyAllowListRemove) + if err := _LockReleaseTokenPoolAndProxy.contract.UnpackLog(event, "AllowListRemove", 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 +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyFilterer) ParseAllowListRemove(log types.Log) (*LockReleaseTokenPoolAndProxyAllowListRemove, error) { + event := new(LockReleaseTokenPoolAndProxyAllowListRemove) + if err := _LockReleaseTokenPoolAndProxy.contract.UnpackLog(event, "AllowListRemove", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type LockReleaseTokenPoolAndProxyBurnedIterator struct { + Event *LockReleaseTokenPoolAndProxyBurned + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *LockReleaseTokenPoolAndProxyBurnedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolAndProxyBurned) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolAndProxyBurned) + 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() + } +} + +func (it *LockReleaseTokenPoolAndProxyBurnedIterator) Error() error { + return it.fail +} + +func (it *LockReleaseTokenPoolAndProxyBurnedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type LockReleaseTokenPoolAndProxyBurned struct { + Sender common.Address + Amount *big.Int + Raw types.Log +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyFilterer) FilterBurned(opts *bind.FilterOpts, sender []common.Address) (*LockReleaseTokenPoolAndProxyBurnedIterator, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _LockReleaseTokenPoolAndProxy.contract.FilterLogs(opts, "Burned", senderRule) + if err != nil { + return nil, err + } + return &LockReleaseTokenPoolAndProxyBurnedIterator{contract: _LockReleaseTokenPoolAndProxy.contract, event: "Burned", logs: logs, sub: sub}, nil +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyFilterer) WatchBurned(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolAndProxyBurned, sender []common.Address) (event.Subscription, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _LockReleaseTokenPoolAndProxy.contract.WatchLogs(opts, "Burned", senderRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(LockReleaseTokenPoolAndProxyBurned) + if err := _LockReleaseTokenPoolAndProxy.contract.UnpackLog(event, "Burned", 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 +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyFilterer) ParseBurned(log types.Log) (*LockReleaseTokenPoolAndProxyBurned, error) { + event := new(LockReleaseTokenPoolAndProxyBurned) + if err := _LockReleaseTokenPoolAndProxy.contract.UnpackLog(event, "Burned", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type LockReleaseTokenPoolAndProxyChainAddedIterator struct { + Event *LockReleaseTokenPoolAndProxyChainAdded + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *LockReleaseTokenPoolAndProxyChainAddedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolAndProxyChainAdded) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolAndProxyChainAdded) + 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() + } +} + +func (it *LockReleaseTokenPoolAndProxyChainAddedIterator) Error() error { + return it.fail +} + +func (it *LockReleaseTokenPoolAndProxyChainAddedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type LockReleaseTokenPoolAndProxyChainAdded struct { + RemoteChainSelector uint64 + RemoteToken []byte + OutboundRateLimiterConfig RateLimiterConfig + InboundRateLimiterConfig RateLimiterConfig + Raw types.Log +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyFilterer) FilterChainAdded(opts *bind.FilterOpts) (*LockReleaseTokenPoolAndProxyChainAddedIterator, error) { + + logs, sub, err := _LockReleaseTokenPoolAndProxy.contract.FilterLogs(opts, "ChainAdded") + if err != nil { + return nil, err + } + return &LockReleaseTokenPoolAndProxyChainAddedIterator{contract: _LockReleaseTokenPoolAndProxy.contract, event: "ChainAdded", logs: logs, sub: sub}, nil +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyFilterer) WatchChainAdded(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolAndProxyChainAdded) (event.Subscription, error) { + + logs, sub, err := _LockReleaseTokenPoolAndProxy.contract.WatchLogs(opts, "ChainAdded") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(LockReleaseTokenPoolAndProxyChainAdded) + if err := _LockReleaseTokenPoolAndProxy.contract.UnpackLog(event, "ChainAdded", 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 +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyFilterer) ParseChainAdded(log types.Log) (*LockReleaseTokenPoolAndProxyChainAdded, error) { + event := new(LockReleaseTokenPoolAndProxyChainAdded) + if err := _LockReleaseTokenPoolAndProxy.contract.UnpackLog(event, "ChainAdded", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type LockReleaseTokenPoolAndProxyChainConfiguredIterator struct { + Event *LockReleaseTokenPoolAndProxyChainConfigured + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *LockReleaseTokenPoolAndProxyChainConfiguredIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolAndProxyChainConfigured) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolAndProxyChainConfigured) + 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() + } +} + +func (it *LockReleaseTokenPoolAndProxyChainConfiguredIterator) Error() error { + return it.fail +} + +func (it *LockReleaseTokenPoolAndProxyChainConfiguredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type LockReleaseTokenPoolAndProxyChainConfigured struct { + RemoteChainSelector uint64 + OutboundRateLimiterConfig RateLimiterConfig + InboundRateLimiterConfig RateLimiterConfig + Raw types.Log +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyFilterer) FilterChainConfigured(opts *bind.FilterOpts) (*LockReleaseTokenPoolAndProxyChainConfiguredIterator, error) { + + logs, sub, err := _LockReleaseTokenPoolAndProxy.contract.FilterLogs(opts, "ChainConfigured") + if err != nil { + return nil, err + } + return &LockReleaseTokenPoolAndProxyChainConfiguredIterator{contract: _LockReleaseTokenPoolAndProxy.contract, event: "ChainConfigured", logs: logs, sub: sub}, nil +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyFilterer) WatchChainConfigured(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolAndProxyChainConfigured) (event.Subscription, error) { + + logs, sub, err := _LockReleaseTokenPoolAndProxy.contract.WatchLogs(opts, "ChainConfigured") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(LockReleaseTokenPoolAndProxyChainConfigured) + if err := _LockReleaseTokenPoolAndProxy.contract.UnpackLog(event, "ChainConfigured", 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 +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyFilterer) ParseChainConfigured(log types.Log) (*LockReleaseTokenPoolAndProxyChainConfigured, error) { + event := new(LockReleaseTokenPoolAndProxyChainConfigured) + if err := _LockReleaseTokenPoolAndProxy.contract.UnpackLog(event, "ChainConfigured", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type LockReleaseTokenPoolAndProxyChainRemovedIterator struct { + Event *LockReleaseTokenPoolAndProxyChainRemoved + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *LockReleaseTokenPoolAndProxyChainRemovedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolAndProxyChainRemoved) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolAndProxyChainRemoved) + 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() + } +} + +func (it *LockReleaseTokenPoolAndProxyChainRemovedIterator) Error() error { + return it.fail +} + +func (it *LockReleaseTokenPoolAndProxyChainRemovedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type LockReleaseTokenPoolAndProxyChainRemoved struct { + RemoteChainSelector uint64 + Raw types.Log +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyFilterer) FilterChainRemoved(opts *bind.FilterOpts) (*LockReleaseTokenPoolAndProxyChainRemovedIterator, error) { + + logs, sub, err := _LockReleaseTokenPoolAndProxy.contract.FilterLogs(opts, "ChainRemoved") + if err != nil { + return nil, err + } + return &LockReleaseTokenPoolAndProxyChainRemovedIterator{contract: _LockReleaseTokenPoolAndProxy.contract, event: "ChainRemoved", logs: logs, sub: sub}, nil +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyFilterer) WatchChainRemoved(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolAndProxyChainRemoved) (event.Subscription, error) { + + logs, sub, err := _LockReleaseTokenPoolAndProxy.contract.WatchLogs(opts, "ChainRemoved") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(LockReleaseTokenPoolAndProxyChainRemoved) + if err := _LockReleaseTokenPoolAndProxy.contract.UnpackLog(event, "ChainRemoved", 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 +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyFilterer) ParseChainRemoved(log types.Log) (*LockReleaseTokenPoolAndProxyChainRemoved, error) { + event := new(LockReleaseTokenPoolAndProxyChainRemoved) + if err := _LockReleaseTokenPoolAndProxy.contract.UnpackLog(event, "ChainRemoved", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type LockReleaseTokenPoolAndProxyConfigChangedIterator struct { + Event *LockReleaseTokenPoolAndProxyConfigChanged + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *LockReleaseTokenPoolAndProxyConfigChangedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolAndProxyConfigChanged) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolAndProxyConfigChanged) + 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() + } +} + +func (it *LockReleaseTokenPoolAndProxyConfigChangedIterator) Error() error { + return it.fail +} + +func (it *LockReleaseTokenPoolAndProxyConfigChangedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type LockReleaseTokenPoolAndProxyConfigChanged struct { + Config RateLimiterConfig + Raw types.Log +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyFilterer) FilterConfigChanged(opts *bind.FilterOpts) (*LockReleaseTokenPoolAndProxyConfigChangedIterator, error) { + + logs, sub, err := _LockReleaseTokenPoolAndProxy.contract.FilterLogs(opts, "ConfigChanged") + if err != nil { + return nil, err + } + return &LockReleaseTokenPoolAndProxyConfigChangedIterator{contract: _LockReleaseTokenPoolAndProxy.contract, event: "ConfigChanged", logs: logs, sub: sub}, nil +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyFilterer) WatchConfigChanged(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolAndProxyConfigChanged) (event.Subscription, error) { + + logs, sub, err := _LockReleaseTokenPoolAndProxy.contract.WatchLogs(opts, "ConfigChanged") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(LockReleaseTokenPoolAndProxyConfigChanged) + if err := _LockReleaseTokenPoolAndProxy.contract.UnpackLog(event, "ConfigChanged", 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 +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyFilterer) ParseConfigChanged(log types.Log) (*LockReleaseTokenPoolAndProxyConfigChanged, error) { + event := new(LockReleaseTokenPoolAndProxyConfigChanged) + if err := _LockReleaseTokenPoolAndProxy.contract.UnpackLog(event, "ConfigChanged", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type LockReleaseTokenPoolAndProxyLegacyPoolChangedIterator struct { + Event *LockReleaseTokenPoolAndProxyLegacyPoolChanged + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *LockReleaseTokenPoolAndProxyLegacyPoolChangedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolAndProxyLegacyPoolChanged) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolAndProxyLegacyPoolChanged) + 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() + } +} + +func (it *LockReleaseTokenPoolAndProxyLegacyPoolChangedIterator) Error() error { + return it.fail +} + +func (it *LockReleaseTokenPoolAndProxyLegacyPoolChangedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type LockReleaseTokenPoolAndProxyLegacyPoolChanged struct { + OldPool common.Address + NewPool common.Address + Raw types.Log +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyFilterer) FilterLegacyPoolChanged(opts *bind.FilterOpts) (*LockReleaseTokenPoolAndProxyLegacyPoolChangedIterator, error) { + + logs, sub, err := _LockReleaseTokenPoolAndProxy.contract.FilterLogs(opts, "LegacyPoolChanged") + if err != nil { + return nil, err + } + return &LockReleaseTokenPoolAndProxyLegacyPoolChangedIterator{contract: _LockReleaseTokenPoolAndProxy.contract, event: "LegacyPoolChanged", logs: logs, sub: sub}, nil +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyFilterer) WatchLegacyPoolChanged(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolAndProxyLegacyPoolChanged) (event.Subscription, error) { + + logs, sub, err := _LockReleaseTokenPoolAndProxy.contract.WatchLogs(opts, "LegacyPoolChanged") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(LockReleaseTokenPoolAndProxyLegacyPoolChanged) + if err := _LockReleaseTokenPoolAndProxy.contract.UnpackLog(event, "LegacyPoolChanged", 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 +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyFilterer) ParseLegacyPoolChanged(log types.Log) (*LockReleaseTokenPoolAndProxyLegacyPoolChanged, error) { + event := new(LockReleaseTokenPoolAndProxyLegacyPoolChanged) + if err := _LockReleaseTokenPoolAndProxy.contract.UnpackLog(event, "LegacyPoolChanged", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type LockReleaseTokenPoolAndProxyLiquidityAddedIterator struct { + Event *LockReleaseTokenPoolAndProxyLiquidityAdded + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *LockReleaseTokenPoolAndProxyLiquidityAddedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolAndProxyLiquidityAdded) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolAndProxyLiquidityAdded) + 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() + } +} + +func (it *LockReleaseTokenPoolAndProxyLiquidityAddedIterator) Error() error { + return it.fail +} + +func (it *LockReleaseTokenPoolAndProxyLiquidityAddedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type LockReleaseTokenPoolAndProxyLiquidityAdded struct { + Provider common.Address + Amount *big.Int + Raw types.Log +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyFilterer) FilterLiquidityAdded(opts *bind.FilterOpts, provider []common.Address, amount []*big.Int) (*LockReleaseTokenPoolAndProxyLiquidityAddedIterator, error) { + + var providerRule []interface{} + for _, providerItem := range provider { + providerRule = append(providerRule, providerItem) + } + var amountRule []interface{} + for _, amountItem := range amount { + amountRule = append(amountRule, amountItem) + } + + logs, sub, err := _LockReleaseTokenPoolAndProxy.contract.FilterLogs(opts, "LiquidityAdded", providerRule, amountRule) + if err != nil { + return nil, err + } + return &LockReleaseTokenPoolAndProxyLiquidityAddedIterator{contract: _LockReleaseTokenPoolAndProxy.contract, event: "LiquidityAdded", logs: logs, sub: sub}, nil +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyFilterer) WatchLiquidityAdded(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolAndProxyLiquidityAdded, provider []common.Address, amount []*big.Int) (event.Subscription, error) { + + var providerRule []interface{} + for _, providerItem := range provider { + providerRule = append(providerRule, providerItem) + } + var amountRule []interface{} + for _, amountItem := range amount { + amountRule = append(amountRule, amountItem) + } + + logs, sub, err := _LockReleaseTokenPoolAndProxy.contract.WatchLogs(opts, "LiquidityAdded", providerRule, amountRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(LockReleaseTokenPoolAndProxyLiquidityAdded) + if err := _LockReleaseTokenPoolAndProxy.contract.UnpackLog(event, "LiquidityAdded", 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 +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyFilterer) ParseLiquidityAdded(log types.Log) (*LockReleaseTokenPoolAndProxyLiquidityAdded, error) { + event := new(LockReleaseTokenPoolAndProxyLiquidityAdded) + if err := _LockReleaseTokenPoolAndProxy.contract.UnpackLog(event, "LiquidityAdded", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type LockReleaseTokenPoolAndProxyLiquidityRemovedIterator struct { + Event *LockReleaseTokenPoolAndProxyLiquidityRemoved + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *LockReleaseTokenPoolAndProxyLiquidityRemovedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolAndProxyLiquidityRemoved) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolAndProxyLiquidityRemoved) + 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() + } +} + +func (it *LockReleaseTokenPoolAndProxyLiquidityRemovedIterator) Error() error { + return it.fail +} + +func (it *LockReleaseTokenPoolAndProxyLiquidityRemovedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type LockReleaseTokenPoolAndProxyLiquidityRemoved struct { + Provider common.Address + Amount *big.Int + Raw types.Log +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyFilterer) FilterLiquidityRemoved(opts *bind.FilterOpts, provider []common.Address, amount []*big.Int) (*LockReleaseTokenPoolAndProxyLiquidityRemovedIterator, error) { + + var providerRule []interface{} + for _, providerItem := range provider { + providerRule = append(providerRule, providerItem) + } + var amountRule []interface{} + for _, amountItem := range amount { + amountRule = append(amountRule, amountItem) + } + + logs, sub, err := _LockReleaseTokenPoolAndProxy.contract.FilterLogs(opts, "LiquidityRemoved", providerRule, amountRule) + if err != nil { + return nil, err + } + return &LockReleaseTokenPoolAndProxyLiquidityRemovedIterator{contract: _LockReleaseTokenPoolAndProxy.contract, event: "LiquidityRemoved", logs: logs, sub: sub}, nil +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyFilterer) WatchLiquidityRemoved(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolAndProxyLiquidityRemoved, provider []common.Address, amount []*big.Int) (event.Subscription, error) { + + var providerRule []interface{} + for _, providerItem := range provider { + providerRule = append(providerRule, providerItem) + } + var amountRule []interface{} + for _, amountItem := range amount { + amountRule = append(amountRule, amountItem) + } + + logs, sub, err := _LockReleaseTokenPoolAndProxy.contract.WatchLogs(opts, "LiquidityRemoved", providerRule, amountRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(LockReleaseTokenPoolAndProxyLiquidityRemoved) + if err := _LockReleaseTokenPoolAndProxy.contract.UnpackLog(event, "LiquidityRemoved", 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 +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyFilterer) ParseLiquidityRemoved(log types.Log) (*LockReleaseTokenPoolAndProxyLiquidityRemoved, error) { + event := new(LockReleaseTokenPoolAndProxyLiquidityRemoved) + if err := _LockReleaseTokenPoolAndProxy.contract.UnpackLog(event, "LiquidityRemoved", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type LockReleaseTokenPoolAndProxyLockedIterator struct { + Event *LockReleaseTokenPoolAndProxyLocked + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *LockReleaseTokenPoolAndProxyLockedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolAndProxyLocked) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolAndProxyLocked) + 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() + } +} + +func (it *LockReleaseTokenPoolAndProxyLockedIterator) Error() error { + return it.fail +} + +func (it *LockReleaseTokenPoolAndProxyLockedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type LockReleaseTokenPoolAndProxyLocked struct { + Sender common.Address + Amount *big.Int + Raw types.Log +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyFilterer) FilterLocked(opts *bind.FilterOpts, sender []common.Address) (*LockReleaseTokenPoolAndProxyLockedIterator, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _LockReleaseTokenPoolAndProxy.contract.FilterLogs(opts, "Locked", senderRule) + if err != nil { + return nil, err + } + return &LockReleaseTokenPoolAndProxyLockedIterator{contract: _LockReleaseTokenPoolAndProxy.contract, event: "Locked", logs: logs, sub: sub}, nil +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyFilterer) WatchLocked(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolAndProxyLocked, sender []common.Address) (event.Subscription, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _LockReleaseTokenPoolAndProxy.contract.WatchLogs(opts, "Locked", senderRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(LockReleaseTokenPoolAndProxyLocked) + if err := _LockReleaseTokenPoolAndProxy.contract.UnpackLog(event, "Locked", 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 +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyFilterer) ParseLocked(log types.Log) (*LockReleaseTokenPoolAndProxyLocked, error) { + event := new(LockReleaseTokenPoolAndProxyLocked) + if err := _LockReleaseTokenPoolAndProxy.contract.UnpackLog(event, "Locked", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type LockReleaseTokenPoolAndProxyMintedIterator struct { + Event *LockReleaseTokenPoolAndProxyMinted + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *LockReleaseTokenPoolAndProxyMintedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolAndProxyMinted) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolAndProxyMinted) + 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() + } +} + +func (it *LockReleaseTokenPoolAndProxyMintedIterator) Error() error { + return it.fail +} + +func (it *LockReleaseTokenPoolAndProxyMintedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type LockReleaseTokenPoolAndProxyMinted struct { + Sender common.Address + Recipient common.Address + Amount *big.Int + Raw types.Log +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyFilterer) FilterMinted(opts *bind.FilterOpts, sender []common.Address, recipient []common.Address) (*LockReleaseTokenPoolAndProxyMintedIterator, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + var recipientRule []interface{} + for _, recipientItem := range recipient { + recipientRule = append(recipientRule, recipientItem) + } + + logs, sub, err := _LockReleaseTokenPoolAndProxy.contract.FilterLogs(opts, "Minted", senderRule, recipientRule) + if err != nil { + return nil, err + } + return &LockReleaseTokenPoolAndProxyMintedIterator{contract: _LockReleaseTokenPoolAndProxy.contract, event: "Minted", logs: logs, sub: sub}, nil +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyFilterer) WatchMinted(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolAndProxyMinted, sender []common.Address, recipient []common.Address) (event.Subscription, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + var recipientRule []interface{} + for _, recipientItem := range recipient { + recipientRule = append(recipientRule, recipientItem) + } + + logs, sub, err := _LockReleaseTokenPoolAndProxy.contract.WatchLogs(opts, "Minted", senderRule, recipientRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(LockReleaseTokenPoolAndProxyMinted) + if err := _LockReleaseTokenPoolAndProxy.contract.UnpackLog(event, "Minted", 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 +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyFilterer) ParseMinted(log types.Log) (*LockReleaseTokenPoolAndProxyMinted, error) { + event := new(LockReleaseTokenPoolAndProxyMinted) + if err := _LockReleaseTokenPoolAndProxy.contract.UnpackLog(event, "Minted", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type LockReleaseTokenPoolAndProxyOwnershipTransferRequestedIterator struct { + Event *LockReleaseTokenPoolAndProxyOwnershipTransferRequested + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *LockReleaseTokenPoolAndProxyOwnershipTransferRequestedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolAndProxyOwnershipTransferRequested) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolAndProxyOwnershipTransferRequested) + 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() + } +} + +func (it *LockReleaseTokenPoolAndProxyOwnershipTransferRequestedIterator) Error() error { + return it.fail +} + +func (it *LockReleaseTokenPoolAndProxyOwnershipTransferRequestedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type LockReleaseTokenPoolAndProxyOwnershipTransferRequested struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyFilterer) FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*LockReleaseTokenPoolAndProxyOwnershipTransferRequestedIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _LockReleaseTokenPoolAndProxy.contract.FilterLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return &LockReleaseTokenPoolAndProxyOwnershipTransferRequestedIterator{contract: _LockReleaseTokenPoolAndProxy.contract, event: "OwnershipTransferRequested", logs: logs, sub: sub}, nil +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyFilterer) WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolAndProxyOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _LockReleaseTokenPoolAndProxy.contract.WatchLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(LockReleaseTokenPoolAndProxyOwnershipTransferRequested) + if err := _LockReleaseTokenPoolAndProxy.contract.UnpackLog(event, "OwnershipTransferRequested", 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 +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyFilterer) ParseOwnershipTransferRequested(log types.Log) (*LockReleaseTokenPoolAndProxyOwnershipTransferRequested, error) { + event := new(LockReleaseTokenPoolAndProxyOwnershipTransferRequested) + if err := _LockReleaseTokenPoolAndProxy.contract.UnpackLog(event, "OwnershipTransferRequested", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type LockReleaseTokenPoolAndProxyOwnershipTransferredIterator struct { + Event *LockReleaseTokenPoolAndProxyOwnershipTransferred + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *LockReleaseTokenPoolAndProxyOwnershipTransferredIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolAndProxyOwnershipTransferred) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolAndProxyOwnershipTransferred) + 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() + } +} + +func (it *LockReleaseTokenPoolAndProxyOwnershipTransferredIterator) Error() error { + return it.fail +} + +func (it *LockReleaseTokenPoolAndProxyOwnershipTransferredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type LockReleaseTokenPoolAndProxyOwnershipTransferred struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*LockReleaseTokenPoolAndProxyOwnershipTransferredIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _LockReleaseTokenPoolAndProxy.contract.FilterLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return &LockReleaseTokenPoolAndProxyOwnershipTransferredIterator{contract: _LockReleaseTokenPoolAndProxy.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolAndProxyOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _LockReleaseTokenPoolAndProxy.contract.WatchLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(LockReleaseTokenPoolAndProxyOwnershipTransferred) + if err := _LockReleaseTokenPoolAndProxy.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 +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyFilterer) ParseOwnershipTransferred(log types.Log) (*LockReleaseTokenPoolAndProxyOwnershipTransferred, error) { + event := new(LockReleaseTokenPoolAndProxyOwnershipTransferred) + if err := _LockReleaseTokenPoolAndProxy.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type LockReleaseTokenPoolAndProxyReleasedIterator struct { + Event *LockReleaseTokenPoolAndProxyReleased + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *LockReleaseTokenPoolAndProxyReleasedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolAndProxyReleased) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolAndProxyReleased) + 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() + } +} + +func (it *LockReleaseTokenPoolAndProxyReleasedIterator) Error() error { + return it.fail +} + +func (it *LockReleaseTokenPoolAndProxyReleasedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type LockReleaseTokenPoolAndProxyReleased struct { + Sender common.Address + Recipient common.Address + Amount *big.Int + Raw types.Log +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyFilterer) FilterReleased(opts *bind.FilterOpts, sender []common.Address, recipient []common.Address) (*LockReleaseTokenPoolAndProxyReleasedIterator, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + var recipientRule []interface{} + for _, recipientItem := range recipient { + recipientRule = append(recipientRule, recipientItem) + } + + logs, sub, err := _LockReleaseTokenPoolAndProxy.contract.FilterLogs(opts, "Released", senderRule, recipientRule) + if err != nil { + return nil, err + } + return &LockReleaseTokenPoolAndProxyReleasedIterator{contract: _LockReleaseTokenPoolAndProxy.contract, event: "Released", logs: logs, sub: sub}, nil +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyFilterer) WatchReleased(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolAndProxyReleased, sender []common.Address, recipient []common.Address) (event.Subscription, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + var recipientRule []interface{} + for _, recipientItem := range recipient { + recipientRule = append(recipientRule, recipientItem) + } + + logs, sub, err := _LockReleaseTokenPoolAndProxy.contract.WatchLogs(opts, "Released", senderRule, recipientRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(LockReleaseTokenPoolAndProxyReleased) + if err := _LockReleaseTokenPoolAndProxy.contract.UnpackLog(event, "Released", 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 +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyFilterer) ParseReleased(log types.Log) (*LockReleaseTokenPoolAndProxyReleased, error) { + event := new(LockReleaseTokenPoolAndProxyReleased) + if err := _LockReleaseTokenPoolAndProxy.contract.UnpackLog(event, "Released", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type LockReleaseTokenPoolAndProxyRemotePoolSetIterator struct { + Event *LockReleaseTokenPoolAndProxyRemotePoolSet + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *LockReleaseTokenPoolAndProxyRemotePoolSetIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolAndProxyRemotePoolSet) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolAndProxyRemotePoolSet) + 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() + } +} + +func (it *LockReleaseTokenPoolAndProxyRemotePoolSetIterator) Error() error { + return it.fail +} + +func (it *LockReleaseTokenPoolAndProxyRemotePoolSetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type LockReleaseTokenPoolAndProxyRemotePoolSet struct { + RemoteChainSelector uint64 + PreviousPoolAddress []byte + RemotePoolAddress []byte + Raw types.Log +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyFilterer) FilterRemotePoolSet(opts *bind.FilterOpts, remoteChainSelector []uint64) (*LockReleaseTokenPoolAndProxyRemotePoolSetIterator, error) { + + var remoteChainSelectorRule []interface{} + for _, remoteChainSelectorItem := range remoteChainSelector { + remoteChainSelectorRule = append(remoteChainSelectorRule, remoteChainSelectorItem) + } + + logs, sub, err := _LockReleaseTokenPoolAndProxy.contract.FilterLogs(opts, "RemotePoolSet", remoteChainSelectorRule) + if err != nil { + return nil, err + } + return &LockReleaseTokenPoolAndProxyRemotePoolSetIterator{contract: _LockReleaseTokenPoolAndProxy.contract, event: "RemotePoolSet", logs: logs, sub: sub}, nil +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyFilterer) WatchRemotePoolSet(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolAndProxyRemotePoolSet, remoteChainSelector []uint64) (event.Subscription, error) { + + var remoteChainSelectorRule []interface{} + for _, remoteChainSelectorItem := range remoteChainSelector { + remoteChainSelectorRule = append(remoteChainSelectorRule, remoteChainSelectorItem) + } + + logs, sub, err := _LockReleaseTokenPoolAndProxy.contract.WatchLogs(opts, "RemotePoolSet", remoteChainSelectorRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(LockReleaseTokenPoolAndProxyRemotePoolSet) + if err := _LockReleaseTokenPoolAndProxy.contract.UnpackLog(event, "RemotePoolSet", 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 +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyFilterer) ParseRemotePoolSet(log types.Log) (*LockReleaseTokenPoolAndProxyRemotePoolSet, error) { + event := new(LockReleaseTokenPoolAndProxyRemotePoolSet) + if err := _LockReleaseTokenPoolAndProxy.contract.UnpackLog(event, "RemotePoolSet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type LockReleaseTokenPoolAndProxyRouterUpdatedIterator struct { + Event *LockReleaseTokenPoolAndProxyRouterUpdated + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *LockReleaseTokenPoolAndProxyRouterUpdatedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolAndProxyRouterUpdated) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolAndProxyRouterUpdated) + 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() + } +} + +func (it *LockReleaseTokenPoolAndProxyRouterUpdatedIterator) Error() error { + return it.fail +} + +func (it *LockReleaseTokenPoolAndProxyRouterUpdatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type LockReleaseTokenPoolAndProxyRouterUpdated struct { + OldRouter common.Address + NewRouter common.Address + Raw types.Log +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyFilterer) FilterRouterUpdated(opts *bind.FilterOpts) (*LockReleaseTokenPoolAndProxyRouterUpdatedIterator, error) { + + logs, sub, err := _LockReleaseTokenPoolAndProxy.contract.FilterLogs(opts, "RouterUpdated") + if err != nil { + return nil, err + } + return &LockReleaseTokenPoolAndProxyRouterUpdatedIterator{contract: _LockReleaseTokenPoolAndProxy.contract, event: "RouterUpdated", logs: logs, sub: sub}, nil +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyFilterer) WatchRouterUpdated(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolAndProxyRouterUpdated) (event.Subscription, error) { + + logs, sub, err := _LockReleaseTokenPoolAndProxy.contract.WatchLogs(opts, "RouterUpdated") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(LockReleaseTokenPoolAndProxyRouterUpdated) + if err := _LockReleaseTokenPoolAndProxy.contract.UnpackLog(event, "RouterUpdated", 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 +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyFilterer) ParseRouterUpdated(log types.Log) (*LockReleaseTokenPoolAndProxyRouterUpdated, error) { + event := new(LockReleaseTokenPoolAndProxyRouterUpdated) + if err := _LockReleaseTokenPoolAndProxy.contract.UnpackLog(event, "RouterUpdated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type LockReleaseTokenPoolAndProxyTokensConsumedIterator struct { + Event *LockReleaseTokenPoolAndProxyTokensConsumed + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *LockReleaseTokenPoolAndProxyTokensConsumedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolAndProxyTokensConsumed) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(LockReleaseTokenPoolAndProxyTokensConsumed) + 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() + } +} + +func (it *LockReleaseTokenPoolAndProxyTokensConsumedIterator) Error() error { + return it.fail +} + +func (it *LockReleaseTokenPoolAndProxyTokensConsumedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type LockReleaseTokenPoolAndProxyTokensConsumed struct { + Tokens *big.Int + Raw types.Log +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyFilterer) FilterTokensConsumed(opts *bind.FilterOpts) (*LockReleaseTokenPoolAndProxyTokensConsumedIterator, error) { + + logs, sub, err := _LockReleaseTokenPoolAndProxy.contract.FilterLogs(opts, "TokensConsumed") + if err != nil { + return nil, err + } + return &LockReleaseTokenPoolAndProxyTokensConsumedIterator{contract: _LockReleaseTokenPoolAndProxy.contract, event: "TokensConsumed", logs: logs, sub: sub}, nil +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyFilterer) WatchTokensConsumed(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolAndProxyTokensConsumed) (event.Subscription, error) { + + logs, sub, err := _LockReleaseTokenPoolAndProxy.contract.WatchLogs(opts, "TokensConsumed") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(LockReleaseTokenPoolAndProxyTokensConsumed) + if err := _LockReleaseTokenPoolAndProxy.contract.UnpackLog(event, "TokensConsumed", 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 +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxyFilterer) ParseTokensConsumed(log types.Log) (*LockReleaseTokenPoolAndProxyTokensConsumed, error) { + event := new(LockReleaseTokenPoolAndProxyTokensConsumed) + if err := _LockReleaseTokenPoolAndProxy.contract.UnpackLog(event, "TokensConsumed", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxy) ParseLog(log types.Log) (generated.AbigenLog, error) { + switch log.Topics[0] { + case _LockReleaseTokenPoolAndProxy.abi.Events["AllowListAdd"].ID: + return _LockReleaseTokenPoolAndProxy.ParseAllowListAdd(log) + case _LockReleaseTokenPoolAndProxy.abi.Events["AllowListRemove"].ID: + return _LockReleaseTokenPoolAndProxy.ParseAllowListRemove(log) + case _LockReleaseTokenPoolAndProxy.abi.Events["Burned"].ID: + return _LockReleaseTokenPoolAndProxy.ParseBurned(log) + case _LockReleaseTokenPoolAndProxy.abi.Events["ChainAdded"].ID: + return _LockReleaseTokenPoolAndProxy.ParseChainAdded(log) + case _LockReleaseTokenPoolAndProxy.abi.Events["ChainConfigured"].ID: + return _LockReleaseTokenPoolAndProxy.ParseChainConfigured(log) + case _LockReleaseTokenPoolAndProxy.abi.Events["ChainRemoved"].ID: + return _LockReleaseTokenPoolAndProxy.ParseChainRemoved(log) + case _LockReleaseTokenPoolAndProxy.abi.Events["ConfigChanged"].ID: + return _LockReleaseTokenPoolAndProxy.ParseConfigChanged(log) + case _LockReleaseTokenPoolAndProxy.abi.Events["LegacyPoolChanged"].ID: + return _LockReleaseTokenPoolAndProxy.ParseLegacyPoolChanged(log) + case _LockReleaseTokenPoolAndProxy.abi.Events["LiquidityAdded"].ID: + return _LockReleaseTokenPoolAndProxy.ParseLiquidityAdded(log) + case _LockReleaseTokenPoolAndProxy.abi.Events["LiquidityRemoved"].ID: + return _LockReleaseTokenPoolAndProxy.ParseLiquidityRemoved(log) + case _LockReleaseTokenPoolAndProxy.abi.Events["Locked"].ID: + return _LockReleaseTokenPoolAndProxy.ParseLocked(log) + case _LockReleaseTokenPoolAndProxy.abi.Events["Minted"].ID: + return _LockReleaseTokenPoolAndProxy.ParseMinted(log) + case _LockReleaseTokenPoolAndProxy.abi.Events["OwnershipTransferRequested"].ID: + return _LockReleaseTokenPoolAndProxy.ParseOwnershipTransferRequested(log) + case _LockReleaseTokenPoolAndProxy.abi.Events["OwnershipTransferred"].ID: + return _LockReleaseTokenPoolAndProxy.ParseOwnershipTransferred(log) + case _LockReleaseTokenPoolAndProxy.abi.Events["Released"].ID: + return _LockReleaseTokenPoolAndProxy.ParseReleased(log) + case _LockReleaseTokenPoolAndProxy.abi.Events["RemotePoolSet"].ID: + return _LockReleaseTokenPoolAndProxy.ParseRemotePoolSet(log) + case _LockReleaseTokenPoolAndProxy.abi.Events["RouterUpdated"].ID: + return _LockReleaseTokenPoolAndProxy.ParseRouterUpdated(log) + case _LockReleaseTokenPoolAndProxy.abi.Events["TokensConsumed"].ID: + return _LockReleaseTokenPoolAndProxy.ParseTokensConsumed(log) + + default: + return nil, fmt.Errorf("abigen wrapper received unknown log topic: %v", log.Topics[0]) + } +} + +func (LockReleaseTokenPoolAndProxyAllowListAdd) Topic() common.Hash { + return common.HexToHash("0x2640d4d76caf8bf478aabfa982fa4e1c4eb71a37f93cd15e80dbc657911546d8") +} + +func (LockReleaseTokenPoolAndProxyAllowListRemove) Topic() common.Hash { + return common.HexToHash("0x800671136ab6cfee9fbe5ed1fb7ca417811aca3cf864800d127b927adedf7566") +} + +func (LockReleaseTokenPoolAndProxyBurned) Topic() common.Hash { + return common.HexToHash("0x696de425f79f4a40bc6d2122ca50507f0efbeabbff86a84871b7196ab8ea8df7") +} + +func (LockReleaseTokenPoolAndProxyChainAdded) Topic() common.Hash { + return common.HexToHash("0x8d340f17e19058004c20453540862a9c62778504476f6756755cb33bcd6c38c2") +} + +func (LockReleaseTokenPoolAndProxyChainConfigured) Topic() common.Hash { + return common.HexToHash("0x0350d63aa5f270e01729d00d627eeb8f3429772b1818c016c66a588a864f912b") +} + +func (LockReleaseTokenPoolAndProxyChainRemoved) Topic() common.Hash { + return common.HexToHash("0x5204aec90a3c794d8e90fded8b46ae9c7c552803e7e832e0c1d358396d859916") +} + +func (LockReleaseTokenPoolAndProxyConfigChanged) Topic() common.Hash { + return common.HexToHash("0x9ea3374b67bf275e6bb9c8ae68f9cae023e1c528b4b27e092f0bb209d3531c19") +} + +func (LockReleaseTokenPoolAndProxyLegacyPoolChanged) Topic() common.Hash { + return common.HexToHash("0x81accd0a7023865eaa51b3399dd0eafc488bf3ba238402911e1659cfe860f228") +} + +func (LockReleaseTokenPoolAndProxyLiquidityAdded) Topic() common.Hash { + return common.HexToHash("0xc17cea59c2955cb181b03393209566960365771dbba9dc3d510180e7cb312088") +} + +func (LockReleaseTokenPoolAndProxyLiquidityRemoved) Topic() common.Hash { + return common.HexToHash("0xc2c3f06e49b9f15e7b4af9055e183b0d73362e033ad82a07dec9bf9840171719") +} + +func (LockReleaseTokenPoolAndProxyLocked) Topic() common.Hash { + return common.HexToHash("0x9f1ec8c880f76798e7b793325d625e9b60e4082a553c98f42b6cda368dd60008") +} + +func (LockReleaseTokenPoolAndProxyMinted) Topic() common.Hash { + return common.HexToHash("0x9d228d69b5fdb8d273a2336f8fb8612d039631024ea9bf09c424a9503aa078f0") +} + +func (LockReleaseTokenPoolAndProxyOwnershipTransferRequested) Topic() common.Hash { + return common.HexToHash("0xed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae1278") +} + +func (LockReleaseTokenPoolAndProxyOwnershipTransferred) Topic() common.Hash { + return common.HexToHash("0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0") +} + +func (LockReleaseTokenPoolAndProxyReleased) Topic() common.Hash { + return common.HexToHash("0x2d87480f50083e2b2759522a8fdda59802650a8055e609a7772cf70c07748f52") +} + +func (LockReleaseTokenPoolAndProxyRemotePoolSet) Topic() common.Hash { + return common.HexToHash("0xdb4d6220746a38cbc5335f7e108f7de80f482f4d23350253dfd0917df75a14bf") +} + +func (LockReleaseTokenPoolAndProxyRouterUpdated) Topic() common.Hash { + return common.HexToHash("0x02dc5c233404867c793b749c6d644beb2277536d18a7e7974d3f238e4c6f1684") +} + +func (LockReleaseTokenPoolAndProxyTokensConsumed) Topic() common.Hash { + return common.HexToHash("0x1871cdf8010e63f2eb8384381a68dfa7416dc571a5517e66e88b2d2d0c0a690a") +} + +func (_LockReleaseTokenPoolAndProxy *LockReleaseTokenPoolAndProxy) Address() common.Address { + return _LockReleaseTokenPoolAndProxy.address +} + +type LockReleaseTokenPoolAndProxyInterface interface { + CanAcceptLiquidity(opts *bind.CallOpts) (bool, error) + + GetAllowList(opts *bind.CallOpts) ([]common.Address, error) + + GetAllowListEnabled(opts *bind.CallOpts) (bool, error) + + GetCurrentInboundRateLimiterState(opts *bind.CallOpts, remoteChainSelector uint64) (RateLimiterTokenBucket, error) + + GetCurrentOutboundRateLimiterState(opts *bind.CallOpts, remoteChainSelector uint64) (RateLimiterTokenBucket, error) + + GetOnRamp(opts *bind.CallOpts, arg0 uint64) (common.Address, error) + + GetPreviousPool(opts *bind.CallOpts) (common.Address, error) + + GetRateLimitAdmin(opts *bind.CallOpts) (common.Address, error) + + GetRebalancer(opts *bind.CallOpts) (common.Address, error) + + GetRemotePool(opts *bind.CallOpts, remoteChainSelector uint64) ([]byte, error) + + GetRemoteToken(opts *bind.CallOpts, remoteChainSelector uint64) ([]byte, error) + + GetRmnProxy(opts *bind.CallOpts) (common.Address, error) + + GetRouter(opts *bind.CallOpts) (common.Address, error) + + GetSupportedChains(opts *bind.CallOpts) ([]uint64, error) + + GetToken(opts *bind.CallOpts) (common.Address, error) + + IsOffRamp(opts *bind.CallOpts, sourceChainSelector uint64, offRamp common.Address) (bool, error) + + IsSupportedChain(opts *bind.CallOpts, remoteChainSelector uint64) (bool, error) + + IsSupportedToken(opts *bind.CallOpts, token common.Address) (bool, error) + + Owner(opts *bind.CallOpts) (common.Address, error) + + SupportsInterface(opts *bind.CallOpts, interfaceId [4]byte) (bool, error) + + TypeAndVersion(opts *bind.CallOpts) (string, error) + + AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) + + ApplyAllowListUpdates(opts *bind.TransactOpts, removes []common.Address, adds []common.Address) (*types.Transaction, error) + + ApplyChainUpdates(opts *bind.TransactOpts, chains []TokenPoolChainUpdate) (*types.Transaction, error) + + LockOrBurn(opts *bind.TransactOpts, lockOrBurnIn PoolLockOrBurnInV1) (*types.Transaction, error) + + ProvideLiquidity(opts *bind.TransactOpts, amount *big.Int) (*types.Transaction, error) + + ReleaseOrMint(opts *bind.TransactOpts, releaseOrMintIn PoolReleaseOrMintInV1) (*types.Transaction, error) + + SetChainRateLimiterConfig(opts *bind.TransactOpts, remoteChainSelector uint64, outboundConfig RateLimiterConfig, inboundConfig RateLimiterConfig) (*types.Transaction, error) + + SetPreviousPool(opts *bind.TransactOpts, prevPool common.Address) (*types.Transaction, error) + + SetRateLimitAdmin(opts *bind.TransactOpts, rateLimitAdmin common.Address) (*types.Transaction, error) + + SetRebalancer(opts *bind.TransactOpts, rebalancer common.Address) (*types.Transaction, error) + + SetRemotePool(opts *bind.TransactOpts, remoteChainSelector uint64, remotePoolAddress []byte) (*types.Transaction, error) + + SetRouter(opts *bind.TransactOpts, newRouter common.Address) (*types.Transaction, error) + + TransferLiquidity(opts *bind.TransactOpts, from common.Address, amount *big.Int) (*types.Transaction, error) + + TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) + + WithdrawLiquidity(opts *bind.TransactOpts, amount *big.Int) (*types.Transaction, error) + + FilterAllowListAdd(opts *bind.FilterOpts) (*LockReleaseTokenPoolAndProxyAllowListAddIterator, error) + + WatchAllowListAdd(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolAndProxyAllowListAdd) (event.Subscription, error) + + ParseAllowListAdd(log types.Log) (*LockReleaseTokenPoolAndProxyAllowListAdd, error) + + FilterAllowListRemove(opts *bind.FilterOpts) (*LockReleaseTokenPoolAndProxyAllowListRemoveIterator, error) + + WatchAllowListRemove(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolAndProxyAllowListRemove) (event.Subscription, error) + + ParseAllowListRemove(log types.Log) (*LockReleaseTokenPoolAndProxyAllowListRemove, error) + + FilterBurned(opts *bind.FilterOpts, sender []common.Address) (*LockReleaseTokenPoolAndProxyBurnedIterator, error) + + WatchBurned(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolAndProxyBurned, sender []common.Address) (event.Subscription, error) + + ParseBurned(log types.Log) (*LockReleaseTokenPoolAndProxyBurned, error) + + FilterChainAdded(opts *bind.FilterOpts) (*LockReleaseTokenPoolAndProxyChainAddedIterator, error) + + WatchChainAdded(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolAndProxyChainAdded) (event.Subscription, error) + + ParseChainAdded(log types.Log) (*LockReleaseTokenPoolAndProxyChainAdded, error) + + FilterChainConfigured(opts *bind.FilterOpts) (*LockReleaseTokenPoolAndProxyChainConfiguredIterator, error) + + WatchChainConfigured(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolAndProxyChainConfigured) (event.Subscription, error) + + ParseChainConfigured(log types.Log) (*LockReleaseTokenPoolAndProxyChainConfigured, error) + + FilterChainRemoved(opts *bind.FilterOpts) (*LockReleaseTokenPoolAndProxyChainRemovedIterator, error) + + WatchChainRemoved(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolAndProxyChainRemoved) (event.Subscription, error) + + ParseChainRemoved(log types.Log) (*LockReleaseTokenPoolAndProxyChainRemoved, error) + + FilterConfigChanged(opts *bind.FilterOpts) (*LockReleaseTokenPoolAndProxyConfigChangedIterator, error) + + WatchConfigChanged(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolAndProxyConfigChanged) (event.Subscription, error) + + ParseConfigChanged(log types.Log) (*LockReleaseTokenPoolAndProxyConfigChanged, error) + + FilterLegacyPoolChanged(opts *bind.FilterOpts) (*LockReleaseTokenPoolAndProxyLegacyPoolChangedIterator, error) + + WatchLegacyPoolChanged(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolAndProxyLegacyPoolChanged) (event.Subscription, error) + + ParseLegacyPoolChanged(log types.Log) (*LockReleaseTokenPoolAndProxyLegacyPoolChanged, error) + + FilterLiquidityAdded(opts *bind.FilterOpts, provider []common.Address, amount []*big.Int) (*LockReleaseTokenPoolAndProxyLiquidityAddedIterator, error) + + WatchLiquidityAdded(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolAndProxyLiquidityAdded, provider []common.Address, amount []*big.Int) (event.Subscription, error) + + ParseLiquidityAdded(log types.Log) (*LockReleaseTokenPoolAndProxyLiquidityAdded, error) + + FilterLiquidityRemoved(opts *bind.FilterOpts, provider []common.Address, amount []*big.Int) (*LockReleaseTokenPoolAndProxyLiquidityRemovedIterator, error) + + WatchLiquidityRemoved(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolAndProxyLiquidityRemoved, provider []common.Address, amount []*big.Int) (event.Subscription, error) + + ParseLiquidityRemoved(log types.Log) (*LockReleaseTokenPoolAndProxyLiquidityRemoved, error) + + FilterLocked(opts *bind.FilterOpts, sender []common.Address) (*LockReleaseTokenPoolAndProxyLockedIterator, error) + + WatchLocked(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolAndProxyLocked, sender []common.Address) (event.Subscription, error) + + ParseLocked(log types.Log) (*LockReleaseTokenPoolAndProxyLocked, error) + + FilterMinted(opts *bind.FilterOpts, sender []common.Address, recipient []common.Address) (*LockReleaseTokenPoolAndProxyMintedIterator, error) + + WatchMinted(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolAndProxyMinted, sender []common.Address, recipient []common.Address) (event.Subscription, error) + + ParseMinted(log types.Log) (*LockReleaseTokenPoolAndProxyMinted, error) + + FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*LockReleaseTokenPoolAndProxyOwnershipTransferRequestedIterator, error) + + WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolAndProxyOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferRequested(log types.Log) (*LockReleaseTokenPoolAndProxyOwnershipTransferRequested, error) + + FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*LockReleaseTokenPoolAndProxyOwnershipTransferredIterator, error) + + WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolAndProxyOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferred(log types.Log) (*LockReleaseTokenPoolAndProxyOwnershipTransferred, error) + + FilterReleased(opts *bind.FilterOpts, sender []common.Address, recipient []common.Address) (*LockReleaseTokenPoolAndProxyReleasedIterator, error) + + WatchReleased(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolAndProxyReleased, sender []common.Address, recipient []common.Address) (event.Subscription, error) + + ParseReleased(log types.Log) (*LockReleaseTokenPoolAndProxyReleased, error) + + FilterRemotePoolSet(opts *bind.FilterOpts, remoteChainSelector []uint64) (*LockReleaseTokenPoolAndProxyRemotePoolSetIterator, error) + + WatchRemotePoolSet(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolAndProxyRemotePoolSet, remoteChainSelector []uint64) (event.Subscription, error) + + ParseRemotePoolSet(log types.Log) (*LockReleaseTokenPoolAndProxyRemotePoolSet, error) + + FilterRouterUpdated(opts *bind.FilterOpts) (*LockReleaseTokenPoolAndProxyRouterUpdatedIterator, error) + + WatchRouterUpdated(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolAndProxyRouterUpdated) (event.Subscription, error) + + ParseRouterUpdated(log types.Log) (*LockReleaseTokenPoolAndProxyRouterUpdated, error) + + FilterTokensConsumed(opts *bind.FilterOpts) (*LockReleaseTokenPoolAndProxyTokensConsumedIterator, error) + + WatchTokensConsumed(opts *bind.WatchOpts, sink chan<- *LockReleaseTokenPoolAndProxyTokensConsumed) (event.Subscription, error) + + ParseTokensConsumed(log types.Log) (*LockReleaseTokenPoolAndProxyTokensConsumed, error) + + ParseLog(log types.Log) (generated.AbigenLog, error) + + Address() common.Address +} diff --git a/core/gethwrappers/ccip/generated/maybe_revert_message_receiver/maybe_revert_message_receiver.go b/core/gethwrappers/ccip/generated/maybe_revert_message_receiver/maybe_revert_message_receiver.go new file mode 100644 index 00000000000..3b52e8c871b --- /dev/null +++ b/core/gethwrappers/ccip/generated/maybe_revert_message_receiver/maybe_revert_message_receiver.go @@ -0,0 +1,564 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package maybe_revert_message_receiver + +import ( + "errors" + "fmt" + "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" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" +) + +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +type ClientAny2EVMMessage struct { + MessageId [32]byte + SourceChainSelector uint64 + Sender []byte + Data []byte + DestTokenAmounts []ClientEVMTokenAmount +} + +type ClientEVMTokenAmount struct { + Token common.Address + Amount *big.Int +} + +var MaybeRevertMessageReceiverMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"internalType\":\"bool\",\"name\":\"toRevert\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"err\",\"type\":\"bytes\"}],\"name\":\"CustomError\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ReceiveRevert\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"MessageReceived\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"ValueReceived\",\"type\":\"event\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"messageId\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"sender\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"internalType\":\"structClient.EVMTokenAmount[]\",\"name\":\"destTokenAmounts\",\"type\":\"tuple[]\"}],\"internalType\":\"structClient.Any2EVMMessage\",\"name\":\"\",\"type\":\"tuple\"}],\"name\":\"ccipReceive\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_toRevert\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"err\",\"type\":\"bytes\"}],\"name\":\"setErr\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bool\",\"name\":\"toRevert\",\"type\":\"bool\"}],\"name\":\"setRevert\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]", + Bin: "0x608060405234801561001057600080fd5b506040516107e73803806107e783398101604081905261002f9161005d565b600080546001600160a81b0319163360ff60a01b191617600160a01b92151592909202919091179055610086565b60006020828403121561006f57600080fd5b8151801515811461007f57600080fd5b9392505050565b610752806100956000396000f3fe60806040526004361061005e5760003560e01c806377f5b0e61161004357806377f5b0e61461015857806385572ffb1461017a5780638fb5f1711461019a57600080fd5b806301ffc9a7146100f25780635100fc211461012657600080fd5b366100ed5760005474010000000000000000000000000000000000000000900460ff16156100b8576040517f3085b8db00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040513481527fe12e3b7047ff60a2dd763cf536a43597e5ce7fe7aa7476345bd4cd079912bcef9060200160405180910390a1005b600080fd5b3480156100fe57600080fd5b5061011261010d366004610335565b6101ff565b604051901515815260200160405180910390f35b34801561013257600080fd5b506000546101129074010000000000000000000000000000000000000000900460ff1681565b34801561016457600080fd5b506101786101733660046103ad565b610298565b005b34801561018657600080fd5b5061017861019536600461047c565b6102a8565b3480156101a657600080fd5b506101786101b53660046104b7565b6000805491151574010000000000000000000000000000000000000000027fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff909216919091179055565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f85572ffb00000000000000000000000000000000000000000000000000000000148061029257507fffffffff0000000000000000000000000000000000000000000000000000000082167f01ffc9a700000000000000000000000000000000000000000000000000000000145b92915050565b60016102a4828261057d565b5050565b60005474010000000000000000000000000000000000000000900460ff16156103095760016040517f5a4ff6710000000000000000000000000000000000000000000000000000000081526004016103009190610697565b60405180910390fd5b6040517fd82ce31e3523f6eeb2d24317b2b4133001e8472729657f663b68624c45f8f3e890600090a150565b60006020828403121561034757600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461037757600080fd5b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000602082840312156103bf57600080fd5b813567ffffffffffffffff808211156103d757600080fd5b818401915084601f8301126103eb57600080fd5b8135818111156103fd576103fd61037e565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f011681019083821181831017156104435761044361037e565b8160405282815287602084870101111561045c57600080fd5b826020860160208301376000928101602001929092525095945050505050565b60006020828403121561048e57600080fd5b813567ffffffffffffffff8111156104a557600080fd5b820160a0818503121561037757600080fd5b6000602082840312156104c957600080fd5b8135801515811461037757600080fd5b600181811c908216806104ed57607f821691505b602082108103610526577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b601f821115610578576000816000526020600020601f850160051c810160208610156105555750805b601f850160051c820191505b8181101561057457828155600101610561565b5050505b505050565b815167ffffffffffffffff8111156105975761059761037e565b6105ab816105a584546104d9565b8461052c565b602080601f8311600181146105fe57600084156105c85750858301515b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600386901b1c1916600185901b178555610574565b6000858152602081207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08616915b8281101561064b5788860151825594840194600190910190840161062c565b508582101561068757878501517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600388901b60f8161c191681555b5050505050600190811b01905550565b60006020808352600084546106ab816104d9565b80602087015260406001808416600081146106cd576001811461070757610737565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00851660408a0152604084151560051b8a01019550610737565b89600052602060002060005b8581101561072e5781548b8201860152908301908801610713565b8a016040019650505b50939897505050505050505056fea164736f6c6343000818000a", +} + +var MaybeRevertMessageReceiverABI = MaybeRevertMessageReceiverMetaData.ABI + +var MaybeRevertMessageReceiverBin = MaybeRevertMessageReceiverMetaData.Bin + +func DeployMaybeRevertMessageReceiver(auth *bind.TransactOpts, backend bind.ContractBackend, toRevert bool) (common.Address, *types.Transaction, *MaybeRevertMessageReceiver, error) { + parsed, err := MaybeRevertMessageReceiverMetaData.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(MaybeRevertMessageReceiverBin), backend, toRevert) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &MaybeRevertMessageReceiver{address: address, abi: *parsed, MaybeRevertMessageReceiverCaller: MaybeRevertMessageReceiverCaller{contract: contract}, MaybeRevertMessageReceiverTransactor: MaybeRevertMessageReceiverTransactor{contract: contract}, MaybeRevertMessageReceiverFilterer: MaybeRevertMessageReceiverFilterer{contract: contract}}, nil +} + +type MaybeRevertMessageReceiver struct { + address common.Address + abi abi.ABI + MaybeRevertMessageReceiverCaller + MaybeRevertMessageReceiverTransactor + MaybeRevertMessageReceiverFilterer +} + +type MaybeRevertMessageReceiverCaller struct { + contract *bind.BoundContract +} + +type MaybeRevertMessageReceiverTransactor struct { + contract *bind.BoundContract +} + +type MaybeRevertMessageReceiverFilterer struct { + contract *bind.BoundContract +} + +type MaybeRevertMessageReceiverSession struct { + Contract *MaybeRevertMessageReceiver + CallOpts bind.CallOpts + TransactOpts bind.TransactOpts +} + +type MaybeRevertMessageReceiverCallerSession struct { + Contract *MaybeRevertMessageReceiverCaller + CallOpts bind.CallOpts +} + +type MaybeRevertMessageReceiverTransactorSession struct { + Contract *MaybeRevertMessageReceiverTransactor + TransactOpts bind.TransactOpts +} + +type MaybeRevertMessageReceiverRaw struct { + Contract *MaybeRevertMessageReceiver +} + +type MaybeRevertMessageReceiverCallerRaw struct { + Contract *MaybeRevertMessageReceiverCaller +} + +type MaybeRevertMessageReceiverTransactorRaw struct { + Contract *MaybeRevertMessageReceiverTransactor +} + +func NewMaybeRevertMessageReceiver(address common.Address, backend bind.ContractBackend) (*MaybeRevertMessageReceiver, error) { + abi, err := abi.JSON(strings.NewReader(MaybeRevertMessageReceiverABI)) + if err != nil { + return nil, err + } + contract, err := bindMaybeRevertMessageReceiver(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &MaybeRevertMessageReceiver{address: address, abi: abi, MaybeRevertMessageReceiverCaller: MaybeRevertMessageReceiverCaller{contract: contract}, MaybeRevertMessageReceiverTransactor: MaybeRevertMessageReceiverTransactor{contract: contract}, MaybeRevertMessageReceiverFilterer: MaybeRevertMessageReceiverFilterer{contract: contract}}, nil +} + +func NewMaybeRevertMessageReceiverCaller(address common.Address, caller bind.ContractCaller) (*MaybeRevertMessageReceiverCaller, error) { + contract, err := bindMaybeRevertMessageReceiver(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &MaybeRevertMessageReceiverCaller{contract: contract}, nil +} + +func NewMaybeRevertMessageReceiverTransactor(address common.Address, transactor bind.ContractTransactor) (*MaybeRevertMessageReceiverTransactor, error) { + contract, err := bindMaybeRevertMessageReceiver(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &MaybeRevertMessageReceiverTransactor{contract: contract}, nil +} + +func NewMaybeRevertMessageReceiverFilterer(address common.Address, filterer bind.ContractFilterer) (*MaybeRevertMessageReceiverFilterer, error) { + contract, err := bindMaybeRevertMessageReceiver(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &MaybeRevertMessageReceiverFilterer{contract: contract}, nil +} + +func bindMaybeRevertMessageReceiver(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := MaybeRevertMessageReceiverMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +func (_MaybeRevertMessageReceiver *MaybeRevertMessageReceiverRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _MaybeRevertMessageReceiver.Contract.MaybeRevertMessageReceiverCaller.contract.Call(opts, result, method, params...) +} + +func (_MaybeRevertMessageReceiver *MaybeRevertMessageReceiverRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _MaybeRevertMessageReceiver.Contract.MaybeRevertMessageReceiverTransactor.contract.Transfer(opts) +} + +func (_MaybeRevertMessageReceiver *MaybeRevertMessageReceiverRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _MaybeRevertMessageReceiver.Contract.MaybeRevertMessageReceiverTransactor.contract.Transact(opts, method, params...) +} + +func (_MaybeRevertMessageReceiver *MaybeRevertMessageReceiverCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _MaybeRevertMessageReceiver.Contract.contract.Call(opts, result, method, params...) +} + +func (_MaybeRevertMessageReceiver *MaybeRevertMessageReceiverTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _MaybeRevertMessageReceiver.Contract.contract.Transfer(opts) +} + +func (_MaybeRevertMessageReceiver *MaybeRevertMessageReceiverTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _MaybeRevertMessageReceiver.Contract.contract.Transact(opts, method, params...) +} + +func (_MaybeRevertMessageReceiver *MaybeRevertMessageReceiverCaller) SToRevert(opts *bind.CallOpts) (bool, error) { + var out []interface{} + err := _MaybeRevertMessageReceiver.contract.Call(opts, &out, "s_toRevert") + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_MaybeRevertMessageReceiver *MaybeRevertMessageReceiverSession) SToRevert() (bool, error) { + return _MaybeRevertMessageReceiver.Contract.SToRevert(&_MaybeRevertMessageReceiver.CallOpts) +} + +func (_MaybeRevertMessageReceiver *MaybeRevertMessageReceiverCallerSession) SToRevert() (bool, error) { + return _MaybeRevertMessageReceiver.Contract.SToRevert(&_MaybeRevertMessageReceiver.CallOpts) +} + +func (_MaybeRevertMessageReceiver *MaybeRevertMessageReceiverCaller) SupportsInterface(opts *bind.CallOpts, interfaceId [4]byte) (bool, error) { + var out []interface{} + err := _MaybeRevertMessageReceiver.contract.Call(opts, &out, "supportsInterface", interfaceId) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_MaybeRevertMessageReceiver *MaybeRevertMessageReceiverSession) SupportsInterface(interfaceId [4]byte) (bool, error) { + return _MaybeRevertMessageReceiver.Contract.SupportsInterface(&_MaybeRevertMessageReceiver.CallOpts, interfaceId) +} + +func (_MaybeRevertMessageReceiver *MaybeRevertMessageReceiverCallerSession) SupportsInterface(interfaceId [4]byte) (bool, error) { + return _MaybeRevertMessageReceiver.Contract.SupportsInterface(&_MaybeRevertMessageReceiver.CallOpts, interfaceId) +} + +func (_MaybeRevertMessageReceiver *MaybeRevertMessageReceiverTransactor) CcipReceive(opts *bind.TransactOpts, arg0 ClientAny2EVMMessage) (*types.Transaction, error) { + return _MaybeRevertMessageReceiver.contract.Transact(opts, "ccipReceive", arg0) +} + +func (_MaybeRevertMessageReceiver *MaybeRevertMessageReceiverSession) CcipReceive(arg0 ClientAny2EVMMessage) (*types.Transaction, error) { + return _MaybeRevertMessageReceiver.Contract.CcipReceive(&_MaybeRevertMessageReceiver.TransactOpts, arg0) +} + +func (_MaybeRevertMessageReceiver *MaybeRevertMessageReceiverTransactorSession) CcipReceive(arg0 ClientAny2EVMMessage) (*types.Transaction, error) { + return _MaybeRevertMessageReceiver.Contract.CcipReceive(&_MaybeRevertMessageReceiver.TransactOpts, arg0) +} + +func (_MaybeRevertMessageReceiver *MaybeRevertMessageReceiverTransactor) SetErr(opts *bind.TransactOpts, err []byte) (*types.Transaction, error) { + return _MaybeRevertMessageReceiver.contract.Transact(opts, "setErr", err) +} + +func (_MaybeRevertMessageReceiver *MaybeRevertMessageReceiverSession) SetErr(err []byte) (*types.Transaction, error) { + return _MaybeRevertMessageReceiver.Contract.SetErr(&_MaybeRevertMessageReceiver.TransactOpts, err) +} + +func (_MaybeRevertMessageReceiver *MaybeRevertMessageReceiverTransactorSession) SetErr(err []byte) (*types.Transaction, error) { + return _MaybeRevertMessageReceiver.Contract.SetErr(&_MaybeRevertMessageReceiver.TransactOpts, err) +} + +func (_MaybeRevertMessageReceiver *MaybeRevertMessageReceiverTransactor) SetRevert(opts *bind.TransactOpts, toRevert bool) (*types.Transaction, error) { + return _MaybeRevertMessageReceiver.contract.Transact(opts, "setRevert", toRevert) +} + +func (_MaybeRevertMessageReceiver *MaybeRevertMessageReceiverSession) SetRevert(toRevert bool) (*types.Transaction, error) { + return _MaybeRevertMessageReceiver.Contract.SetRevert(&_MaybeRevertMessageReceiver.TransactOpts, toRevert) +} + +func (_MaybeRevertMessageReceiver *MaybeRevertMessageReceiverTransactorSession) SetRevert(toRevert bool) (*types.Transaction, error) { + return _MaybeRevertMessageReceiver.Contract.SetRevert(&_MaybeRevertMessageReceiver.TransactOpts, toRevert) +} + +func (_MaybeRevertMessageReceiver *MaybeRevertMessageReceiverTransactor) Receive(opts *bind.TransactOpts) (*types.Transaction, error) { + return _MaybeRevertMessageReceiver.contract.RawTransact(opts, nil) +} + +func (_MaybeRevertMessageReceiver *MaybeRevertMessageReceiverSession) Receive() (*types.Transaction, error) { + return _MaybeRevertMessageReceiver.Contract.Receive(&_MaybeRevertMessageReceiver.TransactOpts) +} + +func (_MaybeRevertMessageReceiver *MaybeRevertMessageReceiverTransactorSession) Receive() (*types.Transaction, error) { + return _MaybeRevertMessageReceiver.Contract.Receive(&_MaybeRevertMessageReceiver.TransactOpts) +} + +type MaybeRevertMessageReceiverMessageReceivedIterator struct { + Event *MaybeRevertMessageReceiverMessageReceived + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *MaybeRevertMessageReceiverMessageReceivedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(MaybeRevertMessageReceiverMessageReceived) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(MaybeRevertMessageReceiverMessageReceived) + 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() + } +} + +func (it *MaybeRevertMessageReceiverMessageReceivedIterator) Error() error { + return it.fail +} + +func (it *MaybeRevertMessageReceiverMessageReceivedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type MaybeRevertMessageReceiverMessageReceived struct { + Raw types.Log +} + +func (_MaybeRevertMessageReceiver *MaybeRevertMessageReceiverFilterer) FilterMessageReceived(opts *bind.FilterOpts) (*MaybeRevertMessageReceiverMessageReceivedIterator, error) { + + logs, sub, err := _MaybeRevertMessageReceiver.contract.FilterLogs(opts, "MessageReceived") + if err != nil { + return nil, err + } + return &MaybeRevertMessageReceiverMessageReceivedIterator{contract: _MaybeRevertMessageReceiver.contract, event: "MessageReceived", logs: logs, sub: sub}, nil +} + +func (_MaybeRevertMessageReceiver *MaybeRevertMessageReceiverFilterer) WatchMessageReceived(opts *bind.WatchOpts, sink chan<- *MaybeRevertMessageReceiverMessageReceived) (event.Subscription, error) { + + logs, sub, err := _MaybeRevertMessageReceiver.contract.WatchLogs(opts, "MessageReceived") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(MaybeRevertMessageReceiverMessageReceived) + if err := _MaybeRevertMessageReceiver.contract.UnpackLog(event, "MessageReceived", 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 +} + +func (_MaybeRevertMessageReceiver *MaybeRevertMessageReceiverFilterer) ParseMessageReceived(log types.Log) (*MaybeRevertMessageReceiverMessageReceived, error) { + event := new(MaybeRevertMessageReceiverMessageReceived) + if err := _MaybeRevertMessageReceiver.contract.UnpackLog(event, "MessageReceived", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type MaybeRevertMessageReceiverValueReceivedIterator struct { + Event *MaybeRevertMessageReceiverValueReceived + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *MaybeRevertMessageReceiverValueReceivedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(MaybeRevertMessageReceiverValueReceived) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(MaybeRevertMessageReceiverValueReceived) + 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() + } +} + +func (it *MaybeRevertMessageReceiverValueReceivedIterator) Error() error { + return it.fail +} + +func (it *MaybeRevertMessageReceiverValueReceivedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type MaybeRevertMessageReceiverValueReceived struct { + Amount *big.Int + Raw types.Log +} + +func (_MaybeRevertMessageReceiver *MaybeRevertMessageReceiverFilterer) FilterValueReceived(opts *bind.FilterOpts) (*MaybeRevertMessageReceiverValueReceivedIterator, error) { + + logs, sub, err := _MaybeRevertMessageReceiver.contract.FilterLogs(opts, "ValueReceived") + if err != nil { + return nil, err + } + return &MaybeRevertMessageReceiverValueReceivedIterator{contract: _MaybeRevertMessageReceiver.contract, event: "ValueReceived", logs: logs, sub: sub}, nil +} + +func (_MaybeRevertMessageReceiver *MaybeRevertMessageReceiverFilterer) WatchValueReceived(opts *bind.WatchOpts, sink chan<- *MaybeRevertMessageReceiverValueReceived) (event.Subscription, error) { + + logs, sub, err := _MaybeRevertMessageReceiver.contract.WatchLogs(opts, "ValueReceived") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(MaybeRevertMessageReceiverValueReceived) + if err := _MaybeRevertMessageReceiver.contract.UnpackLog(event, "ValueReceived", 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 +} + +func (_MaybeRevertMessageReceiver *MaybeRevertMessageReceiverFilterer) ParseValueReceived(log types.Log) (*MaybeRevertMessageReceiverValueReceived, error) { + event := new(MaybeRevertMessageReceiverValueReceived) + if err := _MaybeRevertMessageReceiver.contract.UnpackLog(event, "ValueReceived", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +func (_MaybeRevertMessageReceiver *MaybeRevertMessageReceiver) ParseLog(log types.Log) (generated.AbigenLog, error) { + switch log.Topics[0] { + case _MaybeRevertMessageReceiver.abi.Events["MessageReceived"].ID: + return _MaybeRevertMessageReceiver.ParseMessageReceived(log) + case _MaybeRevertMessageReceiver.abi.Events["ValueReceived"].ID: + return _MaybeRevertMessageReceiver.ParseValueReceived(log) + + default: + return nil, fmt.Errorf("abigen wrapper received unknown log topic: %v", log.Topics[0]) + } +} + +func (MaybeRevertMessageReceiverMessageReceived) Topic() common.Hash { + return common.HexToHash("0xd82ce31e3523f6eeb2d24317b2b4133001e8472729657f663b68624c45f8f3e8") +} + +func (MaybeRevertMessageReceiverValueReceived) Topic() common.Hash { + return common.HexToHash("0xe12e3b7047ff60a2dd763cf536a43597e5ce7fe7aa7476345bd4cd079912bcef") +} + +func (_MaybeRevertMessageReceiver *MaybeRevertMessageReceiver) Address() common.Address { + return _MaybeRevertMessageReceiver.address +} + +type MaybeRevertMessageReceiverInterface interface { + SToRevert(opts *bind.CallOpts) (bool, error) + + SupportsInterface(opts *bind.CallOpts, interfaceId [4]byte) (bool, error) + + CcipReceive(opts *bind.TransactOpts, arg0 ClientAny2EVMMessage) (*types.Transaction, error) + + SetErr(opts *bind.TransactOpts, err []byte) (*types.Transaction, error) + + SetRevert(opts *bind.TransactOpts, toRevert bool) (*types.Transaction, error) + + Receive(opts *bind.TransactOpts) (*types.Transaction, error) + + FilterMessageReceived(opts *bind.FilterOpts) (*MaybeRevertMessageReceiverMessageReceivedIterator, error) + + WatchMessageReceived(opts *bind.WatchOpts, sink chan<- *MaybeRevertMessageReceiverMessageReceived) (event.Subscription, error) + + ParseMessageReceived(log types.Log) (*MaybeRevertMessageReceiverMessageReceived, error) + + FilterValueReceived(opts *bind.FilterOpts) (*MaybeRevertMessageReceiverValueReceivedIterator, error) + + WatchValueReceived(opts *bind.WatchOpts, sink chan<- *MaybeRevertMessageReceiverValueReceived) (event.Subscription, error) + + ParseValueReceived(log types.Log) (*MaybeRevertMessageReceiverValueReceived, error) + + ParseLog(log types.Log) (generated.AbigenLog, error) + + Address() common.Address +} diff --git a/core/gethwrappers/ccip/generated/message_hasher/message_hasher.go b/core/gethwrappers/ccip/generated/message_hasher/message_hasher.go new file mode 100644 index 00000000000..1d95e757781 --- /dev/null +++ b/core/gethwrappers/ccip/generated/message_hasher/message_hasher.go @@ -0,0 +1,428 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package message_hasher + +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" +) + +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +type ClientEVMExtraArgsV1 struct { + GasLimit *big.Int +} + +type ClientEVMExtraArgsV2 struct { + GasLimit *big.Int + AllowOutOfOrderExecution bool +} + +type InternalAny2EVMRampMessage struct { + Header InternalRampMessageHeader + Sender []byte + Data []byte + Receiver common.Address + GasLimit *big.Int + TokenAmounts []InternalRampTokenAmount +} + +type InternalRampMessageHeader struct { + MessageId [32]byte + SourceChainSelector uint64 + DestChainSelector uint64 + SequenceNumber uint64 + Nonce uint64 +} + +type InternalRampTokenAmount struct { + SourcePoolAddress []byte + DestTokenAddress []byte + ExtraData []byte + Amount *big.Int + DestExecData []byte +} + +var MessageHasherMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"gasLimit\",\"type\":\"uint256\"}],\"name\":\"decodeEVMExtraArgsV1\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"gasLimit\",\"type\":\"uint256\"}],\"internalType\":\"structClient.EVMExtraArgsV1\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"gasLimit\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"allowOutOfOrderExecution\",\"type\":\"bool\"}],\"name\":\"decodeEVMExtraArgsV2\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"gasLimit\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"allowOutOfOrderExecution\",\"type\":\"bool\"}],\"internalType\":\"structClient.EVMExtraArgsV2\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"gasLimit\",\"type\":\"uint256\"}],\"internalType\":\"structClient.EVMExtraArgsV1\",\"name\":\"extraArgs\",\"type\":\"tuple\"}],\"name\":\"encodeEVMExtraArgsV1\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"gasLimit\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"allowOutOfOrderExecution\",\"type\":\"bool\"}],\"internalType\":\"structClient.EVMExtraArgsV2\",\"name\":\"extraArgs\",\"type\":\"tuple\"}],\"name\":\"encodeEVMExtraArgsV2\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"leafDomainSeparator\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"implicitMetadataHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"fixedSizeFieldsHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"dataHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"tokenAmountsHash\",\"type\":\"bytes32\"}],\"name\":\"encodeFinalHashPreimage\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"messageId\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"sender\",\"type\":\"bytes\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"sequenceNumber\",\"type\":\"uint64\"},{\"internalType\":\"uint256\",\"name\":\"gasLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint64\",\"name\":\"nonce\",\"type\":\"uint64\"}],\"name\":\"encodeFixedSizeFieldsHashPreimage\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"any2EVMMessageHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"onRamp\",\"type\":\"bytes\"}],\"name\":\"encodeMetadataHashPreimage\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes\",\"name\":\"sourcePoolAddress\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"destTokenAddress\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"destExecData\",\"type\":\"bytes\"}],\"internalType\":\"structInternal.RampTokenAmount[]\",\"name\":\"rampTokenAmounts\",\"type\":\"tuple[]\"}],\"name\":\"encodeTokenAmountsHashPreimage\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"messageId\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"sequenceNumber\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"nonce\",\"type\":\"uint64\"}],\"internalType\":\"structInternal.RampMessageHeader\",\"name\":\"header\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"sender\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"gasLimit\",\"type\":\"uint256\"},{\"components\":[{\"internalType\":\"bytes\",\"name\":\"sourcePoolAddress\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"destTokenAddress\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"destExecData\",\"type\":\"bytes\"}],\"internalType\":\"structInternal.RampTokenAmount[]\",\"name\":\"tokenAmounts\",\"type\":\"tuple[]\"}],\"internalType\":\"structInternal.Any2EVMRampMessage\",\"name\":\"message\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"onRamp\",\"type\":\"bytes\"}],\"name\":\"hash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"pure\",\"type\":\"function\"}]", + Bin: "0x608060405234801561001057600080fd5b50610e08806100206000396000f3fe608060405234801561001057600080fd5b50600436106100a35760003560e01c8063a91d3aeb11610076578063c63641bd1161005b578063c63641bd1461019e578063c7ca9a18146101f5578063e733d2091461020857600080fd5b8063a91d3aeb14610150578063b17df7141461016357600080fd5b80632d6d4c5e146100a85780632efb5ac2146100d157806399df8d05146100f2578063a1e747df1461013d575b600080fd5b6100bb6100b63660046107ff565b61021b565b6040516100c891906108a0565b60405180910390f35b6100e46100df36600461095e565b610244565b6040519081526020016100c8565b6100bb610100366004610a68565b604080516020810196909652858101949094526060850192909252608084015260a0808401919091528151808403909101815260c0909201905290565b6100bb61014b366004610aa3565b610257565b6100bb61015e366004610b0b565b610289565b61018f610171366004610b8c565b60408051602080820183526000909152815190810190915290815290565b604051905181526020016100c8565b6101d86101ac366004610bb5565b604080518082019091526000808252602082015250604080518082019091529182521515602082015290565b6040805182518152602092830151151592810192909252016100c8565b6100bb610203366004610be1565b6102c1565b6100bb610216366004610c35565b6102d2565b60608160405160200161022e9190610c77565b6040516020818303038152906040529050919050565b600061025083836102dd565b9392505050565b6060848484846040516020016102709493929190610d5e565b6040516020818303038152906040529050949350505050565b60608686868686866040516020016102a696959493929190610d9b565b60405160208183030381529060405290509695505050505050565b60606102cc8261043a565b92915050565b60606102cc826104fc565b815160208082015160409283015192516000938493610323937f2425b0b9f9054c76ff151b0a175b18f37a4a4e82013a72e9f15c9caa095ed21f93909291889101610d5e565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815290829052805160209182012086518051888401516060808b0151908401516080808d0151950151959761038a9794969395929491939101610d9b565b604051602081830303815290604052805190602001208560400151805190602001208660a001516040516020016103c19190610c77565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181528282528051602091820120908301969096528101939093526060830191909152608082015260a081019190915260c00160405160208183030381529060405280519060200120905092915050565b604051815160248201526020820151151560448201526060907f181dcf1000000000000000000000000000000000000000000000000000000000906064015b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff000000000000000000000000000000000000000000000000000000009093169290921790915292915050565b604051815160248201526060907f97a657c90000000000000000000000000000000000000000000000000000000090604401610479565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60405160a0810167ffffffffffffffff8111828210171561058557610585610533565b60405290565b60405160c0810167ffffffffffffffff8111828210171561058557610585610533565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff811182821017156105f5576105f5610533565b604052919050565b600082601f83011261060e57600080fd5b813567ffffffffffffffff81111561062857610628610533565b61065960207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116016105ae565b81815284602083860101111561066e57600080fd5b816020850160208301376000918101602001919091529392505050565b600082601f83011261069c57600080fd5b8135602067ffffffffffffffff808311156106b9576106b9610533565b8260051b6106c88382016105ae565b93845285810183019383810190888611156106e257600080fd5b84880192505b858310156107f3578235848111156107005760008081fd5b880160a0818b037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0018113156107365760008081fd5b61073e610562565b87830135878111156107505760008081fd5b61075e8d8a838701016105fd565b825250604080840135888111156107755760008081fd5b6107838e8b838801016105fd565b8a840152506060808501358981111561079c5760008081fd5b6107aa8f8c838901016105fd565b838501525060809150818501358184015250828401359250878311156107d05760008081fd5b6107de8d8a858701016105fd565b908201528452505091840191908401906106e8565b98975050505050505050565b60006020828403121561081157600080fd5b813567ffffffffffffffff81111561082857600080fd5b6108348482850161068b565b949350505050565b6000815180845260005b8181101561086257602081850181015186830182015201610846565b5060006020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b602081526000610250602083018461083c565b803567ffffffffffffffff811681146108cb57600080fd5b919050565b600060a082840312156108e257600080fd5b6108ea610562565b9050813581526108fc602083016108b3565b602082015261090d604083016108b3565b604082015261091e606083016108b3565b606082015261092f608083016108b3565b608082015292915050565b803573ffffffffffffffffffffffffffffffffffffffff811681146108cb57600080fd5b6000806040838503121561097157600080fd5b823567ffffffffffffffff8082111561098957600080fd5b90840190610140828703121561099e57600080fd5b6109a661058b565b6109b087846108d0565b815260a0830135828111156109c457600080fd5b6109d0888286016105fd565b60208301525060c0830135828111156109e857600080fd5b6109f4888286016105fd565b604083015250610a0660e0840161093a565b6060820152610100830135608082015261012083013582811115610a2957600080fd5b610a358882860161068b565b60a08301525093506020850135915080821115610a5157600080fd5b50610a5e858286016105fd565b9150509250929050565b600080600080600060a08688031215610a8057600080fd5b505083359560208501359550604085013594606081013594506080013592509050565b60008060008060808587031215610ab957600080fd5b84359350610ac9602086016108b3565b9250610ad7604086016108b3565b9150606085013567ffffffffffffffff811115610af357600080fd5b610aff878288016105fd565b91505092959194509250565b60008060008060008060c08789031215610b2457600080fd5b86359550602087013567ffffffffffffffff811115610b4257600080fd5b610b4e89828a016105fd565b955050610b5d6040880161093a565b9350610b6b606088016108b3565b925060808701359150610b8060a088016108b3565b90509295509295509295565b600060208284031215610b9e57600080fd5b5035919050565b803580151581146108cb57600080fd5b60008060408385031215610bc857600080fd5b82359150610bd860208401610ba5565b90509250929050565b600060408284031215610bf357600080fd5b6040516040810181811067ffffffffffffffff82111715610c1657610c16610533565b60405282358152610c2960208401610ba5565b60208201529392505050565b600060208284031215610c4757600080fd5b6040516020810181811067ffffffffffffffff82111715610c6a57610c6a610533565b6040529135825250919050565b600060208083018184528085518083526040925060408601915060408160051b87010184880160005b83811015610d50577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0898403018552815160a08151818652610ce48287018261083c565b915050888201518582038a870152610cfc828261083c565b9150508782015185820389870152610d14828261083c565b915050606080830151818701525060808083015192508582038187015250610d3c818361083c565b968901969450505090860190600101610ca0565b509098975050505050505050565b848152600067ffffffffffffffff808616602084015280851660408401525060806060830152610d91608083018461083c565b9695505050505050565b86815260c060208201526000610db460c083018861083c565b73ffffffffffffffffffffffffffffffffffffffff9690961660408301525067ffffffffffffffff9384166060820152608081019290925290911660a0909101529291505056fea164736f6c6343000818000a", +} + +var MessageHasherABI = MessageHasherMetaData.ABI + +var MessageHasherBin = MessageHasherMetaData.Bin + +func DeployMessageHasher(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *MessageHasher, error) { + parsed, err := MessageHasherMetaData.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(MessageHasherBin), backend) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &MessageHasher{address: address, abi: *parsed, MessageHasherCaller: MessageHasherCaller{contract: contract}, MessageHasherTransactor: MessageHasherTransactor{contract: contract}, MessageHasherFilterer: MessageHasherFilterer{contract: contract}}, nil +} + +type MessageHasher struct { + address common.Address + abi abi.ABI + MessageHasherCaller + MessageHasherTransactor + MessageHasherFilterer +} + +type MessageHasherCaller struct { + contract *bind.BoundContract +} + +type MessageHasherTransactor struct { + contract *bind.BoundContract +} + +type MessageHasherFilterer struct { + contract *bind.BoundContract +} + +type MessageHasherSession struct { + Contract *MessageHasher + CallOpts bind.CallOpts + TransactOpts bind.TransactOpts +} + +type MessageHasherCallerSession struct { + Contract *MessageHasherCaller + CallOpts bind.CallOpts +} + +type MessageHasherTransactorSession struct { + Contract *MessageHasherTransactor + TransactOpts bind.TransactOpts +} + +type MessageHasherRaw struct { + Contract *MessageHasher +} + +type MessageHasherCallerRaw struct { + Contract *MessageHasherCaller +} + +type MessageHasherTransactorRaw struct { + Contract *MessageHasherTransactor +} + +func NewMessageHasher(address common.Address, backend bind.ContractBackend) (*MessageHasher, error) { + abi, err := abi.JSON(strings.NewReader(MessageHasherABI)) + if err != nil { + return nil, err + } + contract, err := bindMessageHasher(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &MessageHasher{address: address, abi: abi, MessageHasherCaller: MessageHasherCaller{contract: contract}, MessageHasherTransactor: MessageHasherTransactor{contract: contract}, MessageHasherFilterer: MessageHasherFilterer{contract: contract}}, nil +} + +func NewMessageHasherCaller(address common.Address, caller bind.ContractCaller) (*MessageHasherCaller, error) { + contract, err := bindMessageHasher(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &MessageHasherCaller{contract: contract}, nil +} + +func NewMessageHasherTransactor(address common.Address, transactor bind.ContractTransactor) (*MessageHasherTransactor, error) { + contract, err := bindMessageHasher(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &MessageHasherTransactor{contract: contract}, nil +} + +func NewMessageHasherFilterer(address common.Address, filterer bind.ContractFilterer) (*MessageHasherFilterer, error) { + contract, err := bindMessageHasher(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &MessageHasherFilterer{contract: contract}, nil +} + +func bindMessageHasher(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := MessageHasherMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +func (_MessageHasher *MessageHasherRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _MessageHasher.Contract.MessageHasherCaller.contract.Call(opts, result, method, params...) +} + +func (_MessageHasher *MessageHasherRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _MessageHasher.Contract.MessageHasherTransactor.contract.Transfer(opts) +} + +func (_MessageHasher *MessageHasherRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _MessageHasher.Contract.MessageHasherTransactor.contract.Transact(opts, method, params...) +} + +func (_MessageHasher *MessageHasherCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _MessageHasher.Contract.contract.Call(opts, result, method, params...) +} + +func (_MessageHasher *MessageHasherTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _MessageHasher.Contract.contract.Transfer(opts) +} + +func (_MessageHasher *MessageHasherTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _MessageHasher.Contract.contract.Transact(opts, method, params...) +} + +func (_MessageHasher *MessageHasherCaller) DecodeEVMExtraArgsV1(opts *bind.CallOpts, gasLimit *big.Int) (ClientEVMExtraArgsV1, error) { + var out []interface{} + err := _MessageHasher.contract.Call(opts, &out, "decodeEVMExtraArgsV1", gasLimit) + + if err != nil { + return *new(ClientEVMExtraArgsV1), err + } + + out0 := *abi.ConvertType(out[0], new(ClientEVMExtraArgsV1)).(*ClientEVMExtraArgsV1) + + return out0, err + +} + +func (_MessageHasher *MessageHasherSession) DecodeEVMExtraArgsV1(gasLimit *big.Int) (ClientEVMExtraArgsV1, error) { + return _MessageHasher.Contract.DecodeEVMExtraArgsV1(&_MessageHasher.CallOpts, gasLimit) +} + +func (_MessageHasher *MessageHasherCallerSession) DecodeEVMExtraArgsV1(gasLimit *big.Int) (ClientEVMExtraArgsV1, error) { + return _MessageHasher.Contract.DecodeEVMExtraArgsV1(&_MessageHasher.CallOpts, gasLimit) +} + +func (_MessageHasher *MessageHasherCaller) DecodeEVMExtraArgsV2(opts *bind.CallOpts, gasLimit *big.Int, allowOutOfOrderExecution bool) (ClientEVMExtraArgsV2, error) { + var out []interface{} + err := _MessageHasher.contract.Call(opts, &out, "decodeEVMExtraArgsV2", gasLimit, allowOutOfOrderExecution) + + if err != nil { + return *new(ClientEVMExtraArgsV2), err + } + + out0 := *abi.ConvertType(out[0], new(ClientEVMExtraArgsV2)).(*ClientEVMExtraArgsV2) + + return out0, err + +} + +func (_MessageHasher *MessageHasherSession) DecodeEVMExtraArgsV2(gasLimit *big.Int, allowOutOfOrderExecution bool) (ClientEVMExtraArgsV2, error) { + return _MessageHasher.Contract.DecodeEVMExtraArgsV2(&_MessageHasher.CallOpts, gasLimit, allowOutOfOrderExecution) +} + +func (_MessageHasher *MessageHasherCallerSession) DecodeEVMExtraArgsV2(gasLimit *big.Int, allowOutOfOrderExecution bool) (ClientEVMExtraArgsV2, error) { + return _MessageHasher.Contract.DecodeEVMExtraArgsV2(&_MessageHasher.CallOpts, gasLimit, allowOutOfOrderExecution) +} + +func (_MessageHasher *MessageHasherCaller) EncodeEVMExtraArgsV1(opts *bind.CallOpts, extraArgs ClientEVMExtraArgsV1) ([]byte, error) { + var out []interface{} + err := _MessageHasher.contract.Call(opts, &out, "encodeEVMExtraArgsV1", extraArgs) + + if err != nil { + return *new([]byte), err + } + + out0 := *abi.ConvertType(out[0], new([]byte)).(*[]byte) + + return out0, err + +} + +func (_MessageHasher *MessageHasherSession) EncodeEVMExtraArgsV1(extraArgs ClientEVMExtraArgsV1) ([]byte, error) { + return _MessageHasher.Contract.EncodeEVMExtraArgsV1(&_MessageHasher.CallOpts, extraArgs) +} + +func (_MessageHasher *MessageHasherCallerSession) EncodeEVMExtraArgsV1(extraArgs ClientEVMExtraArgsV1) ([]byte, error) { + return _MessageHasher.Contract.EncodeEVMExtraArgsV1(&_MessageHasher.CallOpts, extraArgs) +} + +func (_MessageHasher *MessageHasherCaller) EncodeEVMExtraArgsV2(opts *bind.CallOpts, extraArgs ClientEVMExtraArgsV2) ([]byte, error) { + var out []interface{} + err := _MessageHasher.contract.Call(opts, &out, "encodeEVMExtraArgsV2", extraArgs) + + if err != nil { + return *new([]byte), err + } + + out0 := *abi.ConvertType(out[0], new([]byte)).(*[]byte) + + return out0, err + +} + +func (_MessageHasher *MessageHasherSession) EncodeEVMExtraArgsV2(extraArgs ClientEVMExtraArgsV2) ([]byte, error) { + return _MessageHasher.Contract.EncodeEVMExtraArgsV2(&_MessageHasher.CallOpts, extraArgs) +} + +func (_MessageHasher *MessageHasherCallerSession) EncodeEVMExtraArgsV2(extraArgs ClientEVMExtraArgsV2) ([]byte, error) { + return _MessageHasher.Contract.EncodeEVMExtraArgsV2(&_MessageHasher.CallOpts, extraArgs) +} + +func (_MessageHasher *MessageHasherCaller) EncodeFinalHashPreimage(opts *bind.CallOpts, leafDomainSeparator [32]byte, implicitMetadataHash [32]byte, fixedSizeFieldsHash [32]byte, dataHash [32]byte, tokenAmountsHash [32]byte) ([]byte, error) { + var out []interface{} + err := _MessageHasher.contract.Call(opts, &out, "encodeFinalHashPreimage", leafDomainSeparator, implicitMetadataHash, fixedSizeFieldsHash, dataHash, tokenAmountsHash) + + if err != nil { + return *new([]byte), err + } + + out0 := *abi.ConvertType(out[0], new([]byte)).(*[]byte) + + return out0, err + +} + +func (_MessageHasher *MessageHasherSession) EncodeFinalHashPreimage(leafDomainSeparator [32]byte, implicitMetadataHash [32]byte, fixedSizeFieldsHash [32]byte, dataHash [32]byte, tokenAmountsHash [32]byte) ([]byte, error) { + return _MessageHasher.Contract.EncodeFinalHashPreimage(&_MessageHasher.CallOpts, leafDomainSeparator, implicitMetadataHash, fixedSizeFieldsHash, dataHash, tokenAmountsHash) +} + +func (_MessageHasher *MessageHasherCallerSession) EncodeFinalHashPreimage(leafDomainSeparator [32]byte, implicitMetadataHash [32]byte, fixedSizeFieldsHash [32]byte, dataHash [32]byte, tokenAmountsHash [32]byte) ([]byte, error) { + return _MessageHasher.Contract.EncodeFinalHashPreimage(&_MessageHasher.CallOpts, leafDomainSeparator, implicitMetadataHash, fixedSizeFieldsHash, dataHash, tokenAmountsHash) +} + +func (_MessageHasher *MessageHasherCaller) EncodeFixedSizeFieldsHashPreimage(opts *bind.CallOpts, messageId [32]byte, sender []byte, receiver common.Address, sequenceNumber uint64, gasLimit *big.Int, nonce uint64) ([]byte, error) { + var out []interface{} + err := _MessageHasher.contract.Call(opts, &out, "encodeFixedSizeFieldsHashPreimage", messageId, sender, receiver, sequenceNumber, gasLimit, nonce) + + if err != nil { + return *new([]byte), err + } + + out0 := *abi.ConvertType(out[0], new([]byte)).(*[]byte) + + return out0, err + +} + +func (_MessageHasher *MessageHasherSession) EncodeFixedSizeFieldsHashPreimage(messageId [32]byte, sender []byte, receiver common.Address, sequenceNumber uint64, gasLimit *big.Int, nonce uint64) ([]byte, error) { + return _MessageHasher.Contract.EncodeFixedSizeFieldsHashPreimage(&_MessageHasher.CallOpts, messageId, sender, receiver, sequenceNumber, gasLimit, nonce) +} + +func (_MessageHasher *MessageHasherCallerSession) EncodeFixedSizeFieldsHashPreimage(messageId [32]byte, sender []byte, receiver common.Address, sequenceNumber uint64, gasLimit *big.Int, nonce uint64) ([]byte, error) { + return _MessageHasher.Contract.EncodeFixedSizeFieldsHashPreimage(&_MessageHasher.CallOpts, messageId, sender, receiver, sequenceNumber, gasLimit, nonce) +} + +func (_MessageHasher *MessageHasherCaller) EncodeMetadataHashPreimage(opts *bind.CallOpts, any2EVMMessageHash [32]byte, sourceChainSelector uint64, destChainSelector uint64, onRamp []byte) ([]byte, error) { + var out []interface{} + err := _MessageHasher.contract.Call(opts, &out, "encodeMetadataHashPreimage", any2EVMMessageHash, sourceChainSelector, destChainSelector, onRamp) + + if err != nil { + return *new([]byte), err + } + + out0 := *abi.ConvertType(out[0], new([]byte)).(*[]byte) + + return out0, err + +} + +func (_MessageHasher *MessageHasherSession) EncodeMetadataHashPreimage(any2EVMMessageHash [32]byte, sourceChainSelector uint64, destChainSelector uint64, onRamp []byte) ([]byte, error) { + return _MessageHasher.Contract.EncodeMetadataHashPreimage(&_MessageHasher.CallOpts, any2EVMMessageHash, sourceChainSelector, destChainSelector, onRamp) +} + +func (_MessageHasher *MessageHasherCallerSession) EncodeMetadataHashPreimage(any2EVMMessageHash [32]byte, sourceChainSelector uint64, destChainSelector uint64, onRamp []byte) ([]byte, error) { + return _MessageHasher.Contract.EncodeMetadataHashPreimage(&_MessageHasher.CallOpts, any2EVMMessageHash, sourceChainSelector, destChainSelector, onRamp) +} + +func (_MessageHasher *MessageHasherCaller) EncodeTokenAmountsHashPreimage(opts *bind.CallOpts, rampTokenAmounts []InternalRampTokenAmount) ([]byte, error) { + var out []interface{} + err := _MessageHasher.contract.Call(opts, &out, "encodeTokenAmountsHashPreimage", rampTokenAmounts) + + if err != nil { + return *new([]byte), err + } + + out0 := *abi.ConvertType(out[0], new([]byte)).(*[]byte) + + return out0, err + +} + +func (_MessageHasher *MessageHasherSession) EncodeTokenAmountsHashPreimage(rampTokenAmounts []InternalRampTokenAmount) ([]byte, error) { + return _MessageHasher.Contract.EncodeTokenAmountsHashPreimage(&_MessageHasher.CallOpts, rampTokenAmounts) +} + +func (_MessageHasher *MessageHasherCallerSession) EncodeTokenAmountsHashPreimage(rampTokenAmounts []InternalRampTokenAmount) ([]byte, error) { + return _MessageHasher.Contract.EncodeTokenAmountsHashPreimage(&_MessageHasher.CallOpts, rampTokenAmounts) +} + +func (_MessageHasher *MessageHasherCaller) Hash(opts *bind.CallOpts, message InternalAny2EVMRampMessage, onRamp []byte) ([32]byte, error) { + var out []interface{} + err := _MessageHasher.contract.Call(opts, &out, "hash", message, onRamp) + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +func (_MessageHasher *MessageHasherSession) Hash(message InternalAny2EVMRampMessage, onRamp []byte) ([32]byte, error) { + return _MessageHasher.Contract.Hash(&_MessageHasher.CallOpts, message, onRamp) +} + +func (_MessageHasher *MessageHasherCallerSession) Hash(message InternalAny2EVMRampMessage, onRamp []byte) ([32]byte, error) { + return _MessageHasher.Contract.Hash(&_MessageHasher.CallOpts, message, onRamp) +} + +func (_MessageHasher *MessageHasher) Address() common.Address { + return _MessageHasher.address +} + +type MessageHasherInterface interface { + DecodeEVMExtraArgsV1(opts *bind.CallOpts, gasLimit *big.Int) (ClientEVMExtraArgsV1, error) + + DecodeEVMExtraArgsV2(opts *bind.CallOpts, gasLimit *big.Int, allowOutOfOrderExecution bool) (ClientEVMExtraArgsV2, error) + + EncodeEVMExtraArgsV1(opts *bind.CallOpts, extraArgs ClientEVMExtraArgsV1) ([]byte, error) + + EncodeEVMExtraArgsV2(opts *bind.CallOpts, extraArgs ClientEVMExtraArgsV2) ([]byte, error) + + EncodeFinalHashPreimage(opts *bind.CallOpts, leafDomainSeparator [32]byte, implicitMetadataHash [32]byte, fixedSizeFieldsHash [32]byte, dataHash [32]byte, tokenAmountsHash [32]byte) ([]byte, error) + + EncodeFixedSizeFieldsHashPreimage(opts *bind.CallOpts, messageId [32]byte, sender []byte, receiver common.Address, sequenceNumber uint64, gasLimit *big.Int, nonce uint64) ([]byte, error) + + EncodeMetadataHashPreimage(opts *bind.CallOpts, any2EVMMessageHash [32]byte, sourceChainSelector uint64, destChainSelector uint64, onRamp []byte) ([]byte, error) + + EncodeTokenAmountsHashPreimage(opts *bind.CallOpts, rampTokenAmounts []InternalRampTokenAmount) ([]byte, error) + + Hash(opts *bind.CallOpts, message InternalAny2EVMRampMessage, onRamp []byte) ([32]byte, error) + + Address() common.Address +} diff --git a/core/gethwrappers/ccip/generated/mock_rmn_contract/mock_rmn_contract.go b/core/gethwrappers/ccip/generated/mock_rmn_contract/mock_rmn_contract.go new file mode 100644 index 00000000000..21aa223e75d --- /dev/null +++ b/core/gethwrappers/ccip/generated/mock_rmn_contract/mock_rmn_contract.go @@ -0,0 +1,746 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package mock_rmn_contract + +import ( + "errors" + "fmt" + "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" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" +) + +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +type IRMNTaggedRoot struct { + CommitStore common.Address + Root [32]byte +} + +type RMNConfig struct { + Voters []RMNVoter + BlessWeightThreshold uint16 + CurseWeightThreshold uint16 +} + +type RMNUnvoteToCurseRecord struct { + CurseVoteAddr common.Address + CursesHash [32]byte + ForceUnvote bool +} + +type RMNVoter struct { + BlessVoteAddr common.Address + CurseVoteAddr common.Address + CurseUnvoteAddr common.Address + BlessWeight uint8 + CurseWeight uint8 +} + +var MockRMNContractMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"err\",\"type\":\"bytes\"}],\"name\":\"CustomError\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getConfigDetails\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"version\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"blockNumber\",\"type\":\"uint32\"},{\"components\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"blessVoteAddr\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"curseVoteAddr\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"curseUnvoteAddr\",\"type\":\"address\"},{\"internalType\":\"uint8\",\"name\":\"blessWeight\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"curseWeight\",\"type\":\"uint8\"}],\"internalType\":\"structRMN.Voter[]\",\"name\":\"voters\",\"type\":\"tuple[]\"},{\"internalType\":\"uint16\",\"name\":\"blessWeightThreshold\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"curseWeightThreshold\",\"type\":\"uint16\"}],\"internalType\":\"structRMN.Config\",\"name\":\"config\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"commitStore\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"root\",\"type\":\"bytes32\"}],\"internalType\":\"structIRMN.TaggedRoot\",\"name\":\"\",\"type\":\"tuple\"}],\"name\":\"isBlessed\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes16\",\"name\":\"subject\",\"type\":\"bytes16\"}],\"name\":\"isCursed\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isCursed\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"curseVoteAddr\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"cursesHash\",\"type\":\"bytes32\"},{\"internalType\":\"bool\",\"name\":\"forceUnvote\",\"type\":\"bool\"}],\"internalType\":\"structRMN.UnvoteToCurseRecord[]\",\"name\":\"\",\"type\":\"tuple[]\"},{\"internalType\":\"bytes16\",\"name\":\"subject\",\"type\":\"bytes16\"}],\"name\":\"ownerUnvoteToCurse\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"curseVoteAddr\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"cursesHash\",\"type\":\"bytes32\"},{\"internalType\":\"bool\",\"name\":\"forceUnvote\",\"type\":\"bool\"}],\"internalType\":\"structRMN.UnvoteToCurseRecord[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"name\":\"ownerUnvoteToCurse\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"err\",\"type\":\"bytes\"}],\"name\":\"setRevert\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"voteToCurse\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"},{\"internalType\":\"bytes16\",\"name\":\"subject\",\"type\":\"bytes16\"}],\"name\":\"voteToCurse\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", + Bin: "0x608060405234801561001057600080fd5b5033806000816100675760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615610097576100978161009f565b505050610148565b336001600160a01b038216036100f75760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640161005e565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b610ed7806101576000396000f3fe608060405234801561001057600080fd5b50600436106100d45760003560e01c8063618af128116100815780637a7c27491161005b5780637a7c2749146102b55780638da5cb5b146102c8578063f2fde38b146102f057600080fd5b8063618af1281461020a578063794860871461024357806379ba5097146102ad57600080fd5b8063397796f7116100b2578063397796f7146101ba5780633f42ab73146101c25780634d616771146101d957600080fd5b8063119a3527146100d9578063257174dc1461012b5780632cbc26bb14610192575b600080fd5b6101296100e73660046107fe565b50600180547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1674010000000000000000000000000000000000000000179055565b005b6101296101393660046109db565b7fffffffffffffffffffffffffffffffff0000000000000000000000000000000016600090815260066020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905550565b6101a56101a0366004610a29565b610303565b60405190151581526020015b60405180910390f35b6101a56103b7565b6101ca610424565b6040516101b193929190610a4b565b6101a56101e7366004610b1e565b5060015474010000000000000000000000000000000000000000900460ff161590565b610129610218366004610b36565b50600180547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff169055565b610129610251366004610b73565b7fffffffffffffffffffffffffffffffff0000000000000000000000000000000016600090815260066020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905550565b610129610565565b6101296102c3366004610b96565b610662565b60005460405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101b1565b6101296102fe366004610c49565b610672565b60006002805461031290610c64565b1590506103575760026040517f5a4ff67100000000000000000000000000000000000000000000000000000000815260040161034e9190610cb1565b60405180910390fd5b60015474010000000000000000000000000000000000000000900460ff16806103b157507fffffffffffffffffffffffffffffffff00000000000000000000000000000000821660009081526006602052604090205460ff165b92915050565b6000600280546103c690610c64565b1590506104025760026040517f5a4ff67100000000000000000000000000000000000000000000000000000000815260040161034e9190610cb1565b5060015474010000000000000000000000000000000000000000900460ff1690565b6040805160608082018352815260006020820181905291810182905281906005546040805160038054608060208202840181019094526060830181815263ffffffff8087169664010000000090041694929392849284929184919060009085015b828210156105315760008481526020908190206040805160a08101825260038602909201805473ffffffffffffffffffffffffffffffffffffffff90811684526001808301548216858701526002909201549081169284019290925260ff74010000000000000000000000000000000000000000830481166060850152750100000000000000000000000000000000000000000090920490911660808301529083529092019101610485565b505050908252506001919091015461ffff808216602084015262010000909104166040909101529296919550919350915050565b60015473ffffffffffffffffffffffffffffffffffffffff1633146105e6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e657200000000000000000000604482015260640161034e565b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b600261066e8282610db0565b5050565b61067a610686565b61068381610709565b50565b60005473ffffffffffffffffffffffffffffffffffffffff163314610707576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e657200000000000000000000604482015260640161034e565b565b3373ffffffffffffffffffffffffffffffffffffffff821603610788576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640161034e565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b60006020828403121561081057600080fd5b5035919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040516060810167ffffffffffffffff8111828210171561086957610869610817565b60405290565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff811182821017156108b6576108b6610817565b604052919050565b803573ffffffffffffffffffffffffffffffffffffffff811681146108e257600080fd5b919050565b600082601f8301126108f857600080fd5b8135602067ffffffffffffffff82111561091457610914610817565b610922818360051b0161086f565b8281526060928302850182019282820191908785111561094157600080fd5b8387015b8581101561099e5781818a03121561095d5760008081fd5b610965610846565b61096e826108be565b81528582013586820152604080830135801515811461098d5760008081fd5b908201528452928401928101610945565b5090979650505050505050565b80357fffffffffffffffffffffffffffffffff00000000000000000000000000000000811681146108e257600080fd5b600080604083850312156109ee57600080fd5b823567ffffffffffffffff811115610a0557600080fd5b610a11858286016108e7565b925050610a20602084016109ab565b90509250929050565b600060208284031215610a3b57600080fd5b610a44826109ab565b9392505050565b63ffffffff84811682528316602080830191909152606060408084018290528451848301839052805160c0860181905260009491820190859060e08801905b80831015610af1578351805173ffffffffffffffffffffffffffffffffffffffff9081168452868201518116878501528782015116878401528781015160ff908116898501526080918201511690830152928401926001929092019160a090910190610a8a565b509288015161ffff908116608089015260409098015190971660a090960195909552979650505050505050565b600060408284031215610b3057600080fd5b50919050565b600060208284031215610b4857600080fd5b813567ffffffffffffffff811115610b5f57600080fd5b610b6b848285016108e7565b949350505050565b60008060408385031215610b8657600080fd5b82359150610a20602084016109ab565b60006020808385031215610ba957600080fd5b823567ffffffffffffffff80821115610bc157600080fd5b818501915085601f830112610bd557600080fd5b813581811115610be757610be7610817565b610c17847fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8401160161086f565b91508082528684828501011115610c2d57600080fd5b8084840185840137600090820190930192909252509392505050565b600060208284031215610c5b57600080fd5b610a44826108be565b600181811c90821680610c7857607f821691505b602082108103610b30577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000602080835260008454610cc581610c64565b8060208701526040600180841660008114610ce75760018114610d2157610d51565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00851660408a0152604084151560051b8a01019550610d51565b89600052602060002060005b85811015610d485781548b8201860152908301908801610d2d565b8a016040019650505b509398975050505050505050565b601f821115610dab576000816000526020600020601f850160051c81016020861015610d885750805b601f850160051c820191505b81811015610da757828155600101610d94565b5050505b505050565b815167ffffffffffffffff811115610dca57610dca610817565b610dde81610dd88454610c64565b84610d5f565b602080601f831160018114610e315760008415610dfb5750858301515b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600386901b1c1916600185901b178555610da7565b6000858152602081207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08616915b82811015610e7e57888601518255948401946001909101908401610e5f565b5085821015610eba57878501517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600388901b60f8161c191681555b5050505050600190811b0190555056fea164736f6c6343000818000a", +} + +var MockRMNContractABI = MockRMNContractMetaData.ABI + +var MockRMNContractBin = MockRMNContractMetaData.Bin + +func DeployMockRMNContract(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *MockRMNContract, error) { + parsed, err := MockRMNContractMetaData.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(MockRMNContractBin), backend) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &MockRMNContract{address: address, abi: *parsed, MockRMNContractCaller: MockRMNContractCaller{contract: contract}, MockRMNContractTransactor: MockRMNContractTransactor{contract: contract}, MockRMNContractFilterer: MockRMNContractFilterer{contract: contract}}, nil +} + +type MockRMNContract struct { + address common.Address + abi abi.ABI + MockRMNContractCaller + MockRMNContractTransactor + MockRMNContractFilterer +} + +type MockRMNContractCaller struct { + contract *bind.BoundContract +} + +type MockRMNContractTransactor struct { + contract *bind.BoundContract +} + +type MockRMNContractFilterer struct { + contract *bind.BoundContract +} + +type MockRMNContractSession struct { + Contract *MockRMNContract + CallOpts bind.CallOpts + TransactOpts bind.TransactOpts +} + +type MockRMNContractCallerSession struct { + Contract *MockRMNContractCaller + CallOpts bind.CallOpts +} + +type MockRMNContractTransactorSession struct { + Contract *MockRMNContractTransactor + TransactOpts bind.TransactOpts +} + +type MockRMNContractRaw struct { + Contract *MockRMNContract +} + +type MockRMNContractCallerRaw struct { + Contract *MockRMNContractCaller +} + +type MockRMNContractTransactorRaw struct { + Contract *MockRMNContractTransactor +} + +func NewMockRMNContract(address common.Address, backend bind.ContractBackend) (*MockRMNContract, error) { + abi, err := abi.JSON(strings.NewReader(MockRMNContractABI)) + if err != nil { + return nil, err + } + contract, err := bindMockRMNContract(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &MockRMNContract{address: address, abi: abi, MockRMNContractCaller: MockRMNContractCaller{contract: contract}, MockRMNContractTransactor: MockRMNContractTransactor{contract: contract}, MockRMNContractFilterer: MockRMNContractFilterer{contract: contract}}, nil +} + +func NewMockRMNContractCaller(address common.Address, caller bind.ContractCaller) (*MockRMNContractCaller, error) { + contract, err := bindMockRMNContract(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &MockRMNContractCaller{contract: contract}, nil +} + +func NewMockRMNContractTransactor(address common.Address, transactor bind.ContractTransactor) (*MockRMNContractTransactor, error) { + contract, err := bindMockRMNContract(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &MockRMNContractTransactor{contract: contract}, nil +} + +func NewMockRMNContractFilterer(address common.Address, filterer bind.ContractFilterer) (*MockRMNContractFilterer, error) { + contract, err := bindMockRMNContract(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &MockRMNContractFilterer{contract: contract}, nil +} + +func bindMockRMNContract(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := MockRMNContractMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +func (_MockRMNContract *MockRMNContractRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _MockRMNContract.Contract.MockRMNContractCaller.contract.Call(opts, result, method, params...) +} + +func (_MockRMNContract *MockRMNContractRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _MockRMNContract.Contract.MockRMNContractTransactor.contract.Transfer(opts) +} + +func (_MockRMNContract *MockRMNContractRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _MockRMNContract.Contract.MockRMNContractTransactor.contract.Transact(opts, method, params...) +} + +func (_MockRMNContract *MockRMNContractCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _MockRMNContract.Contract.contract.Call(opts, result, method, params...) +} + +func (_MockRMNContract *MockRMNContractTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _MockRMNContract.Contract.contract.Transfer(opts) +} + +func (_MockRMNContract *MockRMNContractTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _MockRMNContract.Contract.contract.Transact(opts, method, params...) +} + +func (_MockRMNContract *MockRMNContractCaller) GetConfigDetails(opts *bind.CallOpts) (GetConfigDetails, + + error) { + var out []interface{} + err := _MockRMNContract.contract.Call(opts, &out, "getConfigDetails") + + outstruct := new(GetConfigDetails) + if err != nil { + return *outstruct, err + } + + outstruct.Version = *abi.ConvertType(out[0], new(uint32)).(*uint32) + outstruct.BlockNumber = *abi.ConvertType(out[1], new(uint32)).(*uint32) + outstruct.Config = *abi.ConvertType(out[2], new(RMNConfig)).(*RMNConfig) + + return *outstruct, err + +} + +func (_MockRMNContract *MockRMNContractSession) GetConfigDetails() (GetConfigDetails, + + error) { + return _MockRMNContract.Contract.GetConfigDetails(&_MockRMNContract.CallOpts) +} + +func (_MockRMNContract *MockRMNContractCallerSession) GetConfigDetails() (GetConfigDetails, + + error) { + return _MockRMNContract.Contract.GetConfigDetails(&_MockRMNContract.CallOpts) +} + +func (_MockRMNContract *MockRMNContractCaller) IsBlessed(opts *bind.CallOpts, arg0 IRMNTaggedRoot) (bool, error) { + var out []interface{} + err := _MockRMNContract.contract.Call(opts, &out, "isBlessed", arg0) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_MockRMNContract *MockRMNContractSession) IsBlessed(arg0 IRMNTaggedRoot) (bool, error) { + return _MockRMNContract.Contract.IsBlessed(&_MockRMNContract.CallOpts, arg0) +} + +func (_MockRMNContract *MockRMNContractCallerSession) IsBlessed(arg0 IRMNTaggedRoot) (bool, error) { + return _MockRMNContract.Contract.IsBlessed(&_MockRMNContract.CallOpts, arg0) +} + +func (_MockRMNContract *MockRMNContractCaller) IsCursed(opts *bind.CallOpts, subject [16]byte) (bool, error) { + var out []interface{} + err := _MockRMNContract.contract.Call(opts, &out, "isCursed", subject) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_MockRMNContract *MockRMNContractSession) IsCursed(subject [16]byte) (bool, error) { + return _MockRMNContract.Contract.IsCursed(&_MockRMNContract.CallOpts, subject) +} + +func (_MockRMNContract *MockRMNContractCallerSession) IsCursed(subject [16]byte) (bool, error) { + return _MockRMNContract.Contract.IsCursed(&_MockRMNContract.CallOpts, subject) +} + +func (_MockRMNContract *MockRMNContractCaller) IsCursed0(opts *bind.CallOpts) (bool, error) { + var out []interface{} + err := _MockRMNContract.contract.Call(opts, &out, "isCursed0") + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_MockRMNContract *MockRMNContractSession) IsCursed0() (bool, error) { + return _MockRMNContract.Contract.IsCursed0(&_MockRMNContract.CallOpts) +} + +func (_MockRMNContract *MockRMNContractCallerSession) IsCursed0() (bool, error) { + return _MockRMNContract.Contract.IsCursed0(&_MockRMNContract.CallOpts) +} + +func (_MockRMNContract *MockRMNContractCaller) Owner(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _MockRMNContract.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 + +} + +func (_MockRMNContract *MockRMNContractSession) Owner() (common.Address, error) { + return _MockRMNContract.Contract.Owner(&_MockRMNContract.CallOpts) +} + +func (_MockRMNContract *MockRMNContractCallerSession) Owner() (common.Address, error) { + return _MockRMNContract.Contract.Owner(&_MockRMNContract.CallOpts) +} + +func (_MockRMNContract *MockRMNContractTransactor) AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + return _MockRMNContract.contract.Transact(opts, "acceptOwnership") +} + +func (_MockRMNContract *MockRMNContractSession) AcceptOwnership() (*types.Transaction, error) { + return _MockRMNContract.Contract.AcceptOwnership(&_MockRMNContract.TransactOpts) +} + +func (_MockRMNContract *MockRMNContractTransactorSession) AcceptOwnership() (*types.Transaction, error) { + return _MockRMNContract.Contract.AcceptOwnership(&_MockRMNContract.TransactOpts) +} + +func (_MockRMNContract *MockRMNContractTransactor) OwnerUnvoteToCurse(opts *bind.TransactOpts, arg0 []RMNUnvoteToCurseRecord, subject [16]byte) (*types.Transaction, error) { + return _MockRMNContract.contract.Transact(opts, "ownerUnvoteToCurse", arg0, subject) +} + +func (_MockRMNContract *MockRMNContractSession) OwnerUnvoteToCurse(arg0 []RMNUnvoteToCurseRecord, subject [16]byte) (*types.Transaction, error) { + return _MockRMNContract.Contract.OwnerUnvoteToCurse(&_MockRMNContract.TransactOpts, arg0, subject) +} + +func (_MockRMNContract *MockRMNContractTransactorSession) OwnerUnvoteToCurse(arg0 []RMNUnvoteToCurseRecord, subject [16]byte) (*types.Transaction, error) { + return _MockRMNContract.Contract.OwnerUnvoteToCurse(&_MockRMNContract.TransactOpts, arg0, subject) +} + +func (_MockRMNContract *MockRMNContractTransactor) OwnerUnvoteToCurse0(opts *bind.TransactOpts, arg0 []RMNUnvoteToCurseRecord) (*types.Transaction, error) { + return _MockRMNContract.contract.Transact(opts, "ownerUnvoteToCurse0", arg0) +} + +func (_MockRMNContract *MockRMNContractSession) OwnerUnvoteToCurse0(arg0 []RMNUnvoteToCurseRecord) (*types.Transaction, error) { + return _MockRMNContract.Contract.OwnerUnvoteToCurse0(&_MockRMNContract.TransactOpts, arg0) +} + +func (_MockRMNContract *MockRMNContractTransactorSession) OwnerUnvoteToCurse0(arg0 []RMNUnvoteToCurseRecord) (*types.Transaction, error) { + return _MockRMNContract.Contract.OwnerUnvoteToCurse0(&_MockRMNContract.TransactOpts, arg0) +} + +func (_MockRMNContract *MockRMNContractTransactor) SetRevert(opts *bind.TransactOpts, err []byte) (*types.Transaction, error) { + return _MockRMNContract.contract.Transact(opts, "setRevert", err) +} + +func (_MockRMNContract *MockRMNContractSession) SetRevert(err []byte) (*types.Transaction, error) { + return _MockRMNContract.Contract.SetRevert(&_MockRMNContract.TransactOpts, err) +} + +func (_MockRMNContract *MockRMNContractTransactorSession) SetRevert(err []byte) (*types.Transaction, error) { + return _MockRMNContract.Contract.SetRevert(&_MockRMNContract.TransactOpts, err) +} + +func (_MockRMNContract *MockRMNContractTransactor) TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) { + return _MockRMNContract.contract.Transact(opts, "transferOwnership", to) +} + +func (_MockRMNContract *MockRMNContractSession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _MockRMNContract.Contract.TransferOwnership(&_MockRMNContract.TransactOpts, to) +} + +func (_MockRMNContract *MockRMNContractTransactorSession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _MockRMNContract.Contract.TransferOwnership(&_MockRMNContract.TransactOpts, to) +} + +func (_MockRMNContract *MockRMNContractTransactor) VoteToCurse(opts *bind.TransactOpts, arg0 [32]byte) (*types.Transaction, error) { + return _MockRMNContract.contract.Transact(opts, "voteToCurse", arg0) +} + +func (_MockRMNContract *MockRMNContractSession) VoteToCurse(arg0 [32]byte) (*types.Transaction, error) { + return _MockRMNContract.Contract.VoteToCurse(&_MockRMNContract.TransactOpts, arg0) +} + +func (_MockRMNContract *MockRMNContractTransactorSession) VoteToCurse(arg0 [32]byte) (*types.Transaction, error) { + return _MockRMNContract.Contract.VoteToCurse(&_MockRMNContract.TransactOpts, arg0) +} + +func (_MockRMNContract *MockRMNContractTransactor) VoteToCurse0(opts *bind.TransactOpts, arg0 [32]byte, subject [16]byte) (*types.Transaction, error) { + return _MockRMNContract.contract.Transact(opts, "voteToCurse0", arg0, subject) +} + +func (_MockRMNContract *MockRMNContractSession) VoteToCurse0(arg0 [32]byte, subject [16]byte) (*types.Transaction, error) { + return _MockRMNContract.Contract.VoteToCurse0(&_MockRMNContract.TransactOpts, arg0, subject) +} + +func (_MockRMNContract *MockRMNContractTransactorSession) VoteToCurse0(arg0 [32]byte, subject [16]byte) (*types.Transaction, error) { + return _MockRMNContract.Contract.VoteToCurse0(&_MockRMNContract.TransactOpts, arg0, subject) +} + +type MockRMNContractOwnershipTransferRequestedIterator struct { + Event *MockRMNContractOwnershipTransferRequested + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *MockRMNContractOwnershipTransferRequestedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(MockRMNContractOwnershipTransferRequested) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(MockRMNContractOwnershipTransferRequested) + 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() + } +} + +func (it *MockRMNContractOwnershipTransferRequestedIterator) Error() error { + return it.fail +} + +func (it *MockRMNContractOwnershipTransferRequestedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type MockRMNContractOwnershipTransferRequested struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_MockRMNContract *MockRMNContractFilterer) FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*MockRMNContractOwnershipTransferRequestedIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _MockRMNContract.contract.FilterLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return &MockRMNContractOwnershipTransferRequestedIterator{contract: _MockRMNContract.contract, event: "OwnershipTransferRequested", logs: logs, sub: sub}, nil +} + +func (_MockRMNContract *MockRMNContractFilterer) WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *MockRMNContractOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _MockRMNContract.contract.WatchLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(MockRMNContractOwnershipTransferRequested) + if err := _MockRMNContract.contract.UnpackLog(event, "OwnershipTransferRequested", 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 +} + +func (_MockRMNContract *MockRMNContractFilterer) ParseOwnershipTransferRequested(log types.Log) (*MockRMNContractOwnershipTransferRequested, error) { + event := new(MockRMNContractOwnershipTransferRequested) + if err := _MockRMNContract.contract.UnpackLog(event, "OwnershipTransferRequested", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type MockRMNContractOwnershipTransferredIterator struct { + Event *MockRMNContractOwnershipTransferred + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *MockRMNContractOwnershipTransferredIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(MockRMNContractOwnershipTransferred) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(MockRMNContractOwnershipTransferred) + 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() + } +} + +func (it *MockRMNContractOwnershipTransferredIterator) Error() error { + return it.fail +} + +func (it *MockRMNContractOwnershipTransferredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type MockRMNContractOwnershipTransferred struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_MockRMNContract *MockRMNContractFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*MockRMNContractOwnershipTransferredIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _MockRMNContract.contract.FilterLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return &MockRMNContractOwnershipTransferredIterator{contract: _MockRMNContract.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil +} + +func (_MockRMNContract *MockRMNContractFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *MockRMNContractOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _MockRMNContract.contract.WatchLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(MockRMNContractOwnershipTransferred) + if err := _MockRMNContract.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 +} + +func (_MockRMNContract *MockRMNContractFilterer) ParseOwnershipTransferred(log types.Log) (*MockRMNContractOwnershipTransferred, error) { + event := new(MockRMNContractOwnershipTransferred) + if err := _MockRMNContract.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type GetConfigDetails struct { + Version uint32 + BlockNumber uint32 + Config RMNConfig +} + +func (_MockRMNContract *MockRMNContract) ParseLog(log types.Log) (generated.AbigenLog, error) { + switch log.Topics[0] { + case _MockRMNContract.abi.Events["OwnershipTransferRequested"].ID: + return _MockRMNContract.ParseOwnershipTransferRequested(log) + case _MockRMNContract.abi.Events["OwnershipTransferred"].ID: + return _MockRMNContract.ParseOwnershipTransferred(log) + + default: + return nil, fmt.Errorf("abigen wrapper received unknown log topic: %v", log.Topics[0]) + } +} + +func (MockRMNContractOwnershipTransferRequested) Topic() common.Hash { + return common.HexToHash("0xed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae1278") +} + +func (MockRMNContractOwnershipTransferred) Topic() common.Hash { + return common.HexToHash("0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0") +} + +func (_MockRMNContract *MockRMNContract) Address() common.Address { + return _MockRMNContract.address +} + +type MockRMNContractInterface interface { + GetConfigDetails(opts *bind.CallOpts) (GetConfigDetails, + + error) + + IsBlessed(opts *bind.CallOpts, arg0 IRMNTaggedRoot) (bool, error) + + IsCursed(opts *bind.CallOpts, subject [16]byte) (bool, error) + + IsCursed0(opts *bind.CallOpts) (bool, error) + + Owner(opts *bind.CallOpts) (common.Address, error) + + AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) + + OwnerUnvoteToCurse(opts *bind.TransactOpts, arg0 []RMNUnvoteToCurseRecord, subject [16]byte) (*types.Transaction, error) + + OwnerUnvoteToCurse0(opts *bind.TransactOpts, arg0 []RMNUnvoteToCurseRecord) (*types.Transaction, error) + + SetRevert(opts *bind.TransactOpts, err []byte) (*types.Transaction, error) + + TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) + + VoteToCurse(opts *bind.TransactOpts, arg0 [32]byte) (*types.Transaction, error) + + VoteToCurse0(opts *bind.TransactOpts, arg0 [32]byte, subject [16]byte) (*types.Transaction, error) + + FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*MockRMNContractOwnershipTransferRequestedIterator, error) + + WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *MockRMNContractOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferRequested(log types.Log) (*MockRMNContractOwnershipTransferRequested, error) + + FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*MockRMNContractOwnershipTransferredIterator, error) + + WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *MockRMNContractOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferred(log types.Log) (*MockRMNContractOwnershipTransferred, error) + + ParseLog(log types.Log) (generated.AbigenLog, error) + + Address() common.Address +} diff --git a/core/gethwrappers/ccip/generated/mock_usdc_token_messenger/mock_usdc_token_messenger.go b/core/gethwrappers/ccip/generated/mock_usdc_token_messenger/mock_usdc_token_messenger.go new file mode 100644 index 00000000000..4d095a97da2 --- /dev/null +++ b/core/gethwrappers/ccip/generated/mock_usdc_token_messenger/mock_usdc_token_messenger.go @@ -0,0 +1,488 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package mock_usdc_token_messenger + +import ( + "errors" + "fmt" + "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" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" +) + +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +var MockE2EUSDCTokenMessengerMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"version\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"transmitter\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"nonce\",\"type\":\"uint64\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"burnToken\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"depositor\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"mintRecipient\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"destinationDomain\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"destinationTokenMessenger\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"destinationCaller\",\"type\":\"bytes32\"}],\"name\":\"DepositForBurn\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"DESTINATION_TOKEN_MESSENGER\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"destinationDomain\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"mintRecipient\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"burnToken\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"destinationCaller\",\"type\":\"bytes32\"}],\"name\":\"depositForBurnWithCaller\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"localMessageTransmitter\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"localMessageTransmitterWithRelay\",\"outputs\":[{\"internalType\":\"contractIMessageTransmitterWithRelay\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"messageBodyVersion\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_nonce\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", + Bin: "0x60e060405234801561001057600080fd5b5060405161082d38038061082d83398101604081905261002f91610063565b63ffffffff909116608052600080546001600160401b03191660011790556001600160a01b031660a081905260c0526100b2565b6000806040838503121561007657600080fd5b825163ffffffff8116811461008a57600080fd5b60208401519092506001600160a01b03811681146100a757600080fd5b809150509250929050565b60805160a05160c0516107396100f4600039600081816101290152818161049b015261055b01526000607901526000818160fa01526102b801526107396000f3fe608060405234801561001057600080fd5b50600436106100725760003560e01c8063a250c66a11610050578063a250c66a14610124578063f856ddb61461014b578063fb8406a91461015e57600080fd5b80632c121921146100775780637eccf63e146100c35780639cdbb181146100f0575b600080fd5b7f00000000000000000000000000000000000000000000000000000000000000005b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b6000546100d79067ffffffffffffffff1681565b60405167ffffffffffffffff90911681526020016100ba565b60405163ffffffff7f00000000000000000000000000000000000000000000000000000000000000001681526020016100ba565b6100997f000000000000000000000000000000000000000000000000000000000000000081565b6100d761015936600461059e565b610193565b6101857f17c71eed51b181d8ae1908b4743526c6dbf099c201f158a1acd5f6718e82e8f681565b6040519081526020016100ba565b6040517f23b872dd0000000000000000000000000000000000000000000000000000000081523360048201523060248201526044810186905260009073ffffffffffffffffffffffffffffffffffffffff8416906323b872dd906064016020604051808303816000875af115801561020f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102339190610612565b506040517f42966c680000000000000000000000000000000000000000000000000000000081526004810187905273ffffffffffffffffffffffffffffffffffffffff8416906342966c6890602401600060405180830381600087803b15801561029c57600080fd5b505af11580156102b0573d6000803e3d6000fd5b5050604080517f000000000000000000000000000000000000000000000000000000000000000060e01b7fffffffff0000000000000000000000000000000000000000000000000000000016602082015273ffffffffffffffffffffffffffffffffffffffff8716602482015260448101889052606481018a9052336084808301919091528251808303909101815260a490910190915291506103779050867f17c71eed51b181d8ae1908b4743526c6dbf099c201f158a1acd5f6718e82e8f68584610457565b600080547fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000001667ffffffffffffffff929092169182179055604080518981526020810188905263ffffffff8916918101919091527f17c71eed51b181d8ae1908b4743526c6dbf099c201f158a1acd5f6718e82e8f6606082015260808101859052339173ffffffffffffffffffffffffffffffffffffffff8716917f2fa9ca894982930190727e75500a97d8dc500233a5065e0f3126c48fbe0343c09060a00160405180910390a4505060005467ffffffffffffffff1695945050505050565b60008261051e576040517f0ba469bc00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001690630ba469bc906104d49088908890879060040161069f565b6020604051808303816000875af11580156104f3573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061051791906106cd565b9050610596565b6040517ff7259a7500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000169063f7259a75906104d49088908890889088906004016106f7565b949350505050565b600080600080600060a086880312156105b657600080fd5b85359450602086013563ffffffff811681146105d157600080fd5b935060408601359250606086013573ffffffffffffffffffffffffffffffffffffffff8116811461060157600080fd5b949793965091946080013592915050565b60006020828403121561062457600080fd5b8151801515811461063457600080fd5b9392505050565b6000815180845260005b8181101561066157602081850181015186830182015201610645565b5060006020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b63ffffffff841681528260208201526060604082015260006106c4606083018461063b565b95945050505050565b6000602082840312156106df57600080fd5b815167ffffffffffffffff8116811461063457600080fd5b63ffffffff85168152836020820152826040820152608060608201526000610722608083018461063b565b969550505050505056fea164736f6c6343000818000a", +} + +var MockE2EUSDCTokenMessengerABI = MockE2EUSDCTokenMessengerMetaData.ABI + +var MockE2EUSDCTokenMessengerBin = MockE2EUSDCTokenMessengerMetaData.Bin + +func DeployMockE2EUSDCTokenMessenger(auth *bind.TransactOpts, backend bind.ContractBackend, version uint32, transmitter common.Address) (common.Address, *types.Transaction, *MockE2EUSDCTokenMessenger, error) { + parsed, err := MockE2EUSDCTokenMessengerMetaData.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(MockE2EUSDCTokenMessengerBin), backend, version, transmitter) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &MockE2EUSDCTokenMessenger{address: address, abi: *parsed, MockE2EUSDCTokenMessengerCaller: MockE2EUSDCTokenMessengerCaller{contract: contract}, MockE2EUSDCTokenMessengerTransactor: MockE2EUSDCTokenMessengerTransactor{contract: contract}, MockE2EUSDCTokenMessengerFilterer: MockE2EUSDCTokenMessengerFilterer{contract: contract}}, nil +} + +type MockE2EUSDCTokenMessenger struct { + address common.Address + abi abi.ABI + MockE2EUSDCTokenMessengerCaller + MockE2EUSDCTokenMessengerTransactor + MockE2EUSDCTokenMessengerFilterer +} + +type MockE2EUSDCTokenMessengerCaller struct { + contract *bind.BoundContract +} + +type MockE2EUSDCTokenMessengerTransactor struct { + contract *bind.BoundContract +} + +type MockE2EUSDCTokenMessengerFilterer struct { + contract *bind.BoundContract +} + +type MockE2EUSDCTokenMessengerSession struct { + Contract *MockE2EUSDCTokenMessenger + CallOpts bind.CallOpts + TransactOpts bind.TransactOpts +} + +type MockE2EUSDCTokenMessengerCallerSession struct { + Contract *MockE2EUSDCTokenMessengerCaller + CallOpts bind.CallOpts +} + +type MockE2EUSDCTokenMessengerTransactorSession struct { + Contract *MockE2EUSDCTokenMessengerTransactor + TransactOpts bind.TransactOpts +} + +type MockE2EUSDCTokenMessengerRaw struct { + Contract *MockE2EUSDCTokenMessenger +} + +type MockE2EUSDCTokenMessengerCallerRaw struct { + Contract *MockE2EUSDCTokenMessengerCaller +} + +type MockE2EUSDCTokenMessengerTransactorRaw struct { + Contract *MockE2EUSDCTokenMessengerTransactor +} + +func NewMockE2EUSDCTokenMessenger(address common.Address, backend bind.ContractBackend) (*MockE2EUSDCTokenMessenger, error) { + abi, err := abi.JSON(strings.NewReader(MockE2EUSDCTokenMessengerABI)) + if err != nil { + return nil, err + } + contract, err := bindMockE2EUSDCTokenMessenger(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &MockE2EUSDCTokenMessenger{address: address, abi: abi, MockE2EUSDCTokenMessengerCaller: MockE2EUSDCTokenMessengerCaller{contract: contract}, MockE2EUSDCTokenMessengerTransactor: MockE2EUSDCTokenMessengerTransactor{contract: contract}, MockE2EUSDCTokenMessengerFilterer: MockE2EUSDCTokenMessengerFilterer{contract: contract}}, nil +} + +func NewMockE2EUSDCTokenMessengerCaller(address common.Address, caller bind.ContractCaller) (*MockE2EUSDCTokenMessengerCaller, error) { + contract, err := bindMockE2EUSDCTokenMessenger(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &MockE2EUSDCTokenMessengerCaller{contract: contract}, nil +} + +func NewMockE2EUSDCTokenMessengerTransactor(address common.Address, transactor bind.ContractTransactor) (*MockE2EUSDCTokenMessengerTransactor, error) { + contract, err := bindMockE2EUSDCTokenMessenger(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &MockE2EUSDCTokenMessengerTransactor{contract: contract}, nil +} + +func NewMockE2EUSDCTokenMessengerFilterer(address common.Address, filterer bind.ContractFilterer) (*MockE2EUSDCTokenMessengerFilterer, error) { + contract, err := bindMockE2EUSDCTokenMessenger(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &MockE2EUSDCTokenMessengerFilterer{contract: contract}, nil +} + +func bindMockE2EUSDCTokenMessenger(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := MockE2EUSDCTokenMessengerMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +func (_MockE2EUSDCTokenMessenger *MockE2EUSDCTokenMessengerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _MockE2EUSDCTokenMessenger.Contract.MockE2EUSDCTokenMessengerCaller.contract.Call(opts, result, method, params...) +} + +func (_MockE2EUSDCTokenMessenger *MockE2EUSDCTokenMessengerRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _MockE2EUSDCTokenMessenger.Contract.MockE2EUSDCTokenMessengerTransactor.contract.Transfer(opts) +} + +func (_MockE2EUSDCTokenMessenger *MockE2EUSDCTokenMessengerRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _MockE2EUSDCTokenMessenger.Contract.MockE2EUSDCTokenMessengerTransactor.contract.Transact(opts, method, params...) +} + +func (_MockE2EUSDCTokenMessenger *MockE2EUSDCTokenMessengerCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _MockE2EUSDCTokenMessenger.Contract.contract.Call(opts, result, method, params...) +} + +func (_MockE2EUSDCTokenMessenger *MockE2EUSDCTokenMessengerTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _MockE2EUSDCTokenMessenger.Contract.contract.Transfer(opts) +} + +func (_MockE2EUSDCTokenMessenger *MockE2EUSDCTokenMessengerTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _MockE2EUSDCTokenMessenger.Contract.contract.Transact(opts, method, params...) +} + +func (_MockE2EUSDCTokenMessenger *MockE2EUSDCTokenMessengerCaller) DESTINATIONTOKENMESSENGER(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _MockE2EUSDCTokenMessenger.contract.Call(opts, &out, "DESTINATION_TOKEN_MESSENGER") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +func (_MockE2EUSDCTokenMessenger *MockE2EUSDCTokenMessengerSession) DESTINATIONTOKENMESSENGER() ([32]byte, error) { + return _MockE2EUSDCTokenMessenger.Contract.DESTINATIONTOKENMESSENGER(&_MockE2EUSDCTokenMessenger.CallOpts) +} + +func (_MockE2EUSDCTokenMessenger *MockE2EUSDCTokenMessengerCallerSession) DESTINATIONTOKENMESSENGER() ([32]byte, error) { + return _MockE2EUSDCTokenMessenger.Contract.DESTINATIONTOKENMESSENGER(&_MockE2EUSDCTokenMessenger.CallOpts) +} + +func (_MockE2EUSDCTokenMessenger *MockE2EUSDCTokenMessengerCaller) LocalMessageTransmitter(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _MockE2EUSDCTokenMessenger.contract.Call(opts, &out, "localMessageTransmitter") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_MockE2EUSDCTokenMessenger *MockE2EUSDCTokenMessengerSession) LocalMessageTransmitter() (common.Address, error) { + return _MockE2EUSDCTokenMessenger.Contract.LocalMessageTransmitter(&_MockE2EUSDCTokenMessenger.CallOpts) +} + +func (_MockE2EUSDCTokenMessenger *MockE2EUSDCTokenMessengerCallerSession) LocalMessageTransmitter() (common.Address, error) { + return _MockE2EUSDCTokenMessenger.Contract.LocalMessageTransmitter(&_MockE2EUSDCTokenMessenger.CallOpts) +} + +func (_MockE2EUSDCTokenMessenger *MockE2EUSDCTokenMessengerCaller) LocalMessageTransmitterWithRelay(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _MockE2EUSDCTokenMessenger.contract.Call(opts, &out, "localMessageTransmitterWithRelay") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_MockE2EUSDCTokenMessenger *MockE2EUSDCTokenMessengerSession) LocalMessageTransmitterWithRelay() (common.Address, error) { + return _MockE2EUSDCTokenMessenger.Contract.LocalMessageTransmitterWithRelay(&_MockE2EUSDCTokenMessenger.CallOpts) +} + +func (_MockE2EUSDCTokenMessenger *MockE2EUSDCTokenMessengerCallerSession) LocalMessageTransmitterWithRelay() (common.Address, error) { + return _MockE2EUSDCTokenMessenger.Contract.LocalMessageTransmitterWithRelay(&_MockE2EUSDCTokenMessenger.CallOpts) +} + +func (_MockE2EUSDCTokenMessenger *MockE2EUSDCTokenMessengerCaller) MessageBodyVersion(opts *bind.CallOpts) (uint32, error) { + var out []interface{} + err := _MockE2EUSDCTokenMessenger.contract.Call(opts, &out, "messageBodyVersion") + + if err != nil { + return *new(uint32), err + } + + out0 := *abi.ConvertType(out[0], new(uint32)).(*uint32) + + return out0, err + +} + +func (_MockE2EUSDCTokenMessenger *MockE2EUSDCTokenMessengerSession) MessageBodyVersion() (uint32, error) { + return _MockE2EUSDCTokenMessenger.Contract.MessageBodyVersion(&_MockE2EUSDCTokenMessenger.CallOpts) +} + +func (_MockE2EUSDCTokenMessenger *MockE2EUSDCTokenMessengerCallerSession) MessageBodyVersion() (uint32, error) { + return _MockE2EUSDCTokenMessenger.Contract.MessageBodyVersion(&_MockE2EUSDCTokenMessenger.CallOpts) +} + +func (_MockE2EUSDCTokenMessenger *MockE2EUSDCTokenMessengerCaller) SNonce(opts *bind.CallOpts) (uint64, error) { + var out []interface{} + err := _MockE2EUSDCTokenMessenger.contract.Call(opts, &out, "s_nonce") + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +func (_MockE2EUSDCTokenMessenger *MockE2EUSDCTokenMessengerSession) SNonce() (uint64, error) { + return _MockE2EUSDCTokenMessenger.Contract.SNonce(&_MockE2EUSDCTokenMessenger.CallOpts) +} + +func (_MockE2EUSDCTokenMessenger *MockE2EUSDCTokenMessengerCallerSession) SNonce() (uint64, error) { + return _MockE2EUSDCTokenMessenger.Contract.SNonce(&_MockE2EUSDCTokenMessenger.CallOpts) +} + +func (_MockE2EUSDCTokenMessenger *MockE2EUSDCTokenMessengerTransactor) DepositForBurnWithCaller(opts *bind.TransactOpts, amount *big.Int, destinationDomain uint32, mintRecipient [32]byte, burnToken common.Address, destinationCaller [32]byte) (*types.Transaction, error) { + return _MockE2EUSDCTokenMessenger.contract.Transact(opts, "depositForBurnWithCaller", amount, destinationDomain, mintRecipient, burnToken, destinationCaller) +} + +func (_MockE2EUSDCTokenMessenger *MockE2EUSDCTokenMessengerSession) DepositForBurnWithCaller(amount *big.Int, destinationDomain uint32, mintRecipient [32]byte, burnToken common.Address, destinationCaller [32]byte) (*types.Transaction, error) { + return _MockE2EUSDCTokenMessenger.Contract.DepositForBurnWithCaller(&_MockE2EUSDCTokenMessenger.TransactOpts, amount, destinationDomain, mintRecipient, burnToken, destinationCaller) +} + +func (_MockE2EUSDCTokenMessenger *MockE2EUSDCTokenMessengerTransactorSession) DepositForBurnWithCaller(amount *big.Int, destinationDomain uint32, mintRecipient [32]byte, burnToken common.Address, destinationCaller [32]byte) (*types.Transaction, error) { + return _MockE2EUSDCTokenMessenger.Contract.DepositForBurnWithCaller(&_MockE2EUSDCTokenMessenger.TransactOpts, amount, destinationDomain, mintRecipient, burnToken, destinationCaller) +} + +type MockE2EUSDCTokenMessengerDepositForBurnIterator struct { + Event *MockE2EUSDCTokenMessengerDepositForBurn + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *MockE2EUSDCTokenMessengerDepositForBurnIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(MockE2EUSDCTokenMessengerDepositForBurn) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(MockE2EUSDCTokenMessengerDepositForBurn) + 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() + } +} + +func (it *MockE2EUSDCTokenMessengerDepositForBurnIterator) Error() error { + return it.fail +} + +func (it *MockE2EUSDCTokenMessengerDepositForBurnIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type MockE2EUSDCTokenMessengerDepositForBurn struct { + Nonce uint64 + BurnToken common.Address + Amount *big.Int + Depositor common.Address + MintRecipient [32]byte + DestinationDomain uint32 + DestinationTokenMessenger [32]byte + DestinationCaller [32]byte + Raw types.Log +} + +func (_MockE2EUSDCTokenMessenger *MockE2EUSDCTokenMessengerFilterer) FilterDepositForBurn(opts *bind.FilterOpts, nonce []uint64, burnToken []common.Address, depositor []common.Address) (*MockE2EUSDCTokenMessengerDepositForBurnIterator, error) { + + var nonceRule []interface{} + for _, nonceItem := range nonce { + nonceRule = append(nonceRule, nonceItem) + } + var burnTokenRule []interface{} + for _, burnTokenItem := range burnToken { + burnTokenRule = append(burnTokenRule, burnTokenItem) + } + + var depositorRule []interface{} + for _, depositorItem := range depositor { + depositorRule = append(depositorRule, depositorItem) + } + + logs, sub, err := _MockE2EUSDCTokenMessenger.contract.FilterLogs(opts, "DepositForBurn", nonceRule, burnTokenRule, depositorRule) + if err != nil { + return nil, err + } + return &MockE2EUSDCTokenMessengerDepositForBurnIterator{contract: _MockE2EUSDCTokenMessenger.contract, event: "DepositForBurn", logs: logs, sub: sub}, nil +} + +func (_MockE2EUSDCTokenMessenger *MockE2EUSDCTokenMessengerFilterer) WatchDepositForBurn(opts *bind.WatchOpts, sink chan<- *MockE2EUSDCTokenMessengerDepositForBurn, nonce []uint64, burnToken []common.Address, depositor []common.Address) (event.Subscription, error) { + + var nonceRule []interface{} + for _, nonceItem := range nonce { + nonceRule = append(nonceRule, nonceItem) + } + var burnTokenRule []interface{} + for _, burnTokenItem := range burnToken { + burnTokenRule = append(burnTokenRule, burnTokenItem) + } + + var depositorRule []interface{} + for _, depositorItem := range depositor { + depositorRule = append(depositorRule, depositorItem) + } + + logs, sub, err := _MockE2EUSDCTokenMessenger.contract.WatchLogs(opts, "DepositForBurn", nonceRule, burnTokenRule, depositorRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(MockE2EUSDCTokenMessengerDepositForBurn) + if err := _MockE2EUSDCTokenMessenger.contract.UnpackLog(event, "DepositForBurn", 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 +} + +func (_MockE2EUSDCTokenMessenger *MockE2EUSDCTokenMessengerFilterer) ParseDepositForBurn(log types.Log) (*MockE2EUSDCTokenMessengerDepositForBurn, error) { + event := new(MockE2EUSDCTokenMessengerDepositForBurn) + if err := _MockE2EUSDCTokenMessenger.contract.UnpackLog(event, "DepositForBurn", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +func (_MockE2EUSDCTokenMessenger *MockE2EUSDCTokenMessenger) ParseLog(log types.Log) (generated.AbigenLog, error) { + switch log.Topics[0] { + case _MockE2EUSDCTokenMessenger.abi.Events["DepositForBurn"].ID: + return _MockE2EUSDCTokenMessenger.ParseDepositForBurn(log) + + default: + return nil, fmt.Errorf("abigen wrapper received unknown log topic: %v", log.Topics[0]) + } +} + +func (MockE2EUSDCTokenMessengerDepositForBurn) Topic() common.Hash { + return common.HexToHash("0x2fa9ca894982930190727e75500a97d8dc500233a5065e0f3126c48fbe0343c0") +} + +func (_MockE2EUSDCTokenMessenger *MockE2EUSDCTokenMessenger) Address() common.Address { + return _MockE2EUSDCTokenMessenger.address +} + +type MockE2EUSDCTokenMessengerInterface interface { + DESTINATIONTOKENMESSENGER(opts *bind.CallOpts) ([32]byte, error) + + LocalMessageTransmitter(opts *bind.CallOpts) (common.Address, error) + + LocalMessageTransmitterWithRelay(opts *bind.CallOpts) (common.Address, error) + + MessageBodyVersion(opts *bind.CallOpts) (uint32, error) + + SNonce(opts *bind.CallOpts) (uint64, error) + + DepositForBurnWithCaller(opts *bind.TransactOpts, amount *big.Int, destinationDomain uint32, mintRecipient [32]byte, burnToken common.Address, destinationCaller [32]byte) (*types.Transaction, error) + + FilterDepositForBurn(opts *bind.FilterOpts, nonce []uint64, burnToken []common.Address, depositor []common.Address) (*MockE2EUSDCTokenMessengerDepositForBurnIterator, error) + + WatchDepositForBurn(opts *bind.WatchOpts, sink chan<- *MockE2EUSDCTokenMessengerDepositForBurn, nonce []uint64, burnToken []common.Address, depositor []common.Address) (event.Subscription, error) + + ParseDepositForBurn(log types.Log) (*MockE2EUSDCTokenMessengerDepositForBurn, error) + + ParseLog(log types.Log) (generated.AbigenLog, error) + + Address() common.Address +} diff --git a/core/gethwrappers/ccip/generated/mock_usdc_token_transmitter/mock_usdc_token_transmitter.go b/core/gethwrappers/ccip/generated/mock_usdc_token_transmitter/mock_usdc_token_transmitter.go new file mode 100644 index 00000000000..c3f12bab371 --- /dev/null +++ b/core/gethwrappers/ccip/generated/mock_usdc_token_transmitter/mock_usdc_token_transmitter.go @@ -0,0 +1,471 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package mock_usdc_token_transmitter + +import ( + "errors" + "fmt" + "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" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" +) + +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +var MockE2EUSDCTransmitterMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_version\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"_localDomain\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"message\",\"type\":\"bytes\"}],\"name\":\"MessageSent\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"localDomain\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"nextAvailableNonce\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"message\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"receiveMessage\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"success\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_shouldSucceed\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"destinationDomain\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"recipient\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"messageBody\",\"type\":\"bytes\"}],\"name\":\"sendMessage\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"destinationDomain\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"recipient\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"destinationCaller\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"messageBody\",\"type\":\"bytes\"}],\"name\":\"sendMessageWithCaller\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bool\",\"name\":\"shouldSucceed\",\"type\":\"bool\"}],\"name\":\"setShouldSucceed\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"version\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", + Bin: "0x60e060405234801561001057600080fd5b5060405161097338038061097383398101604081905261002f91610076565b63ffffffff928316608052911660a0526000805460ff191660011790556001600160a01b031660c0526100ca565b805163ffffffff8116811461007157600080fd5b919050565b60008060006060848603121561008b57600080fd5b6100948461005d565b92506100a26020850161005d565b60408501519092506001600160a01b03811681146100bf57600080fd5b809150509250925092565b60805160a05160c05161086d610106600039600061024e015260008181610140015261045801526000818160c00152610437015261086d6000f3fe608060405234801561001057600080fd5b50600436106100885760003560e01c80638371744e1161005b5780638371744e146101255780638d3638f41461013e5780639e31ddb614610164578063f7259a75146101a557600080fd5b80630ba469bc1461008d57806354fd4d50146100be57806357ecfd28146100f55780637a64293514610118575b600080fd5b6100a061009b36600461054a565b6101b8565b60405167ffffffffffffffff90911681526020015b60405180910390f35b7f00000000000000000000000000000000000000000000000000000000000000005b60405163ffffffff90911681526020016100b5565b6101086101033660046105a4565b6101e1565b60405190151581526020016100b5565b6000546101089060ff1681565b6000546100a090610100900467ffffffffffffffff1681565b7f00000000000000000000000000000000000000000000000000000000000000006100e0565b6101a3610172366004610604565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016911515919091179055565b005b6100a06101b336600461062d565b6102ba565b600080806101c461036a565b9050336101d688888584868b8b6103cc565b509695505050505050565b6000806101f260b860a48789610695565b6101fb916106bf565b6040517f40c10f1900000000000000000000000000000000000000000000000000000000815260609190911c6004820181905260016024830152915073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016906340c10f1990604401600060405180830381600087803b15801561029257600080fd5b505af11580156102a6573d6000803e3d6000fd5b505060005460ff1698975050505050505050565b60008361034e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f44657374696e6174696f6e2063616c6c6572206d757374206265206e6f6e7a6560448201527f726f00000000000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b600061035861036a565b9050336101d688888884868a8a6103cc565b60008054610100900467ffffffffffffffff16610388816001610707565b6000805467ffffffffffffffff92909216610100027fffffffffffffffffffffffffffffffffffffffffffffff0000000000000000ff909216919091179055919050565b85610433576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f526563697069656e74206d757374206265206e6f6e7a65726f000000000000006044820152606401610345565b60007f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000008986888b8b898960405160200161049699989796959493929190610756565b60405160208183030381529060405290507f8c5261668696ce22758910d05bab8f186d6eb247ceac2af2e82c7dc17669b036816040516104d691906107f3565b60405180910390a15050505050505050565b803563ffffffff811681146104fc57600080fd5b919050565b60008083601f84011261051357600080fd5b50813567ffffffffffffffff81111561052b57600080fd5b60208301915083602082850101111561054357600080fd5b9250929050565b6000806000806060858703121561056057600080fd5b610569856104e8565b935060208501359250604085013567ffffffffffffffff81111561058c57600080fd5b61059887828801610501565b95989497509550505050565b600080600080604085870312156105ba57600080fd5b843567ffffffffffffffff808211156105d257600080fd5b6105de88838901610501565b909650945060208701359150808211156105f757600080fd5b5061059887828801610501565b60006020828403121561061657600080fd5b8135801515811461062657600080fd5b9392505050565b60008060008060006080868803121561064557600080fd5b61064e866104e8565b94506020860135935060408601359250606086013567ffffffffffffffff81111561067857600080fd5b61068488828901610501565b969995985093965092949392505050565b600080858511156106a557600080fd5b838611156106b257600080fd5b5050820193919092039150565b7fffffffffffffffffffffffffffffffffffffffff00000000000000000000000081358181169160148510156106ff5780818660140360031b1b83161692505b505092915050565b67ffffffffffffffff81811683821601908082111561074f577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b5092915050565b60007fffffffff00000000000000000000000000000000000000000000000000000000808c60e01b168352808b60e01b166004840152808a60e01b166008840152507fffffffffffffffff0000000000000000000000000000000000000000000000008860c01b16600c83015286601483015285603483015284605483015282846074840137506000910160740190815298975050505050505050565b60006020808352835180602085015260005b8181101561082157858101830151858201604001528201610805565b5060006040828601015260407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f830116850101925050509291505056fea164736f6c6343000818000a", +} + +var MockE2EUSDCTransmitterABI = MockE2EUSDCTransmitterMetaData.ABI + +var MockE2EUSDCTransmitterBin = MockE2EUSDCTransmitterMetaData.Bin + +func DeployMockE2EUSDCTransmitter(auth *bind.TransactOpts, backend bind.ContractBackend, _version uint32, _localDomain uint32, token common.Address) (common.Address, *types.Transaction, *MockE2EUSDCTransmitter, error) { + parsed, err := MockE2EUSDCTransmitterMetaData.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(MockE2EUSDCTransmitterBin), backend, _version, _localDomain, token) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &MockE2EUSDCTransmitter{address: address, abi: *parsed, MockE2EUSDCTransmitterCaller: MockE2EUSDCTransmitterCaller{contract: contract}, MockE2EUSDCTransmitterTransactor: MockE2EUSDCTransmitterTransactor{contract: contract}, MockE2EUSDCTransmitterFilterer: MockE2EUSDCTransmitterFilterer{contract: contract}}, nil +} + +type MockE2EUSDCTransmitter struct { + address common.Address + abi abi.ABI + MockE2EUSDCTransmitterCaller + MockE2EUSDCTransmitterTransactor + MockE2EUSDCTransmitterFilterer +} + +type MockE2EUSDCTransmitterCaller struct { + contract *bind.BoundContract +} + +type MockE2EUSDCTransmitterTransactor struct { + contract *bind.BoundContract +} + +type MockE2EUSDCTransmitterFilterer struct { + contract *bind.BoundContract +} + +type MockE2EUSDCTransmitterSession struct { + Contract *MockE2EUSDCTransmitter + CallOpts bind.CallOpts + TransactOpts bind.TransactOpts +} + +type MockE2EUSDCTransmitterCallerSession struct { + Contract *MockE2EUSDCTransmitterCaller + CallOpts bind.CallOpts +} + +type MockE2EUSDCTransmitterTransactorSession struct { + Contract *MockE2EUSDCTransmitterTransactor + TransactOpts bind.TransactOpts +} + +type MockE2EUSDCTransmitterRaw struct { + Contract *MockE2EUSDCTransmitter +} + +type MockE2EUSDCTransmitterCallerRaw struct { + Contract *MockE2EUSDCTransmitterCaller +} + +type MockE2EUSDCTransmitterTransactorRaw struct { + Contract *MockE2EUSDCTransmitterTransactor +} + +func NewMockE2EUSDCTransmitter(address common.Address, backend bind.ContractBackend) (*MockE2EUSDCTransmitter, error) { + abi, err := abi.JSON(strings.NewReader(MockE2EUSDCTransmitterABI)) + if err != nil { + return nil, err + } + contract, err := bindMockE2EUSDCTransmitter(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &MockE2EUSDCTransmitter{address: address, abi: abi, MockE2EUSDCTransmitterCaller: MockE2EUSDCTransmitterCaller{contract: contract}, MockE2EUSDCTransmitterTransactor: MockE2EUSDCTransmitterTransactor{contract: contract}, MockE2EUSDCTransmitterFilterer: MockE2EUSDCTransmitterFilterer{contract: contract}}, nil +} + +func NewMockE2EUSDCTransmitterCaller(address common.Address, caller bind.ContractCaller) (*MockE2EUSDCTransmitterCaller, error) { + contract, err := bindMockE2EUSDCTransmitter(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &MockE2EUSDCTransmitterCaller{contract: contract}, nil +} + +func NewMockE2EUSDCTransmitterTransactor(address common.Address, transactor bind.ContractTransactor) (*MockE2EUSDCTransmitterTransactor, error) { + contract, err := bindMockE2EUSDCTransmitter(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &MockE2EUSDCTransmitterTransactor{contract: contract}, nil +} + +func NewMockE2EUSDCTransmitterFilterer(address common.Address, filterer bind.ContractFilterer) (*MockE2EUSDCTransmitterFilterer, error) { + contract, err := bindMockE2EUSDCTransmitter(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &MockE2EUSDCTransmitterFilterer{contract: contract}, nil +} + +func bindMockE2EUSDCTransmitter(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := MockE2EUSDCTransmitterMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +func (_MockE2EUSDCTransmitter *MockE2EUSDCTransmitterRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _MockE2EUSDCTransmitter.Contract.MockE2EUSDCTransmitterCaller.contract.Call(opts, result, method, params...) +} + +func (_MockE2EUSDCTransmitter *MockE2EUSDCTransmitterRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _MockE2EUSDCTransmitter.Contract.MockE2EUSDCTransmitterTransactor.contract.Transfer(opts) +} + +func (_MockE2EUSDCTransmitter *MockE2EUSDCTransmitterRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _MockE2EUSDCTransmitter.Contract.MockE2EUSDCTransmitterTransactor.contract.Transact(opts, method, params...) +} + +func (_MockE2EUSDCTransmitter *MockE2EUSDCTransmitterCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _MockE2EUSDCTransmitter.Contract.contract.Call(opts, result, method, params...) +} + +func (_MockE2EUSDCTransmitter *MockE2EUSDCTransmitterTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _MockE2EUSDCTransmitter.Contract.contract.Transfer(opts) +} + +func (_MockE2EUSDCTransmitter *MockE2EUSDCTransmitterTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _MockE2EUSDCTransmitter.Contract.contract.Transact(opts, method, params...) +} + +func (_MockE2EUSDCTransmitter *MockE2EUSDCTransmitterCaller) LocalDomain(opts *bind.CallOpts) (uint32, error) { + var out []interface{} + err := _MockE2EUSDCTransmitter.contract.Call(opts, &out, "localDomain") + + if err != nil { + return *new(uint32), err + } + + out0 := *abi.ConvertType(out[0], new(uint32)).(*uint32) + + return out0, err + +} + +func (_MockE2EUSDCTransmitter *MockE2EUSDCTransmitterSession) LocalDomain() (uint32, error) { + return _MockE2EUSDCTransmitter.Contract.LocalDomain(&_MockE2EUSDCTransmitter.CallOpts) +} + +func (_MockE2EUSDCTransmitter *MockE2EUSDCTransmitterCallerSession) LocalDomain() (uint32, error) { + return _MockE2EUSDCTransmitter.Contract.LocalDomain(&_MockE2EUSDCTransmitter.CallOpts) +} + +func (_MockE2EUSDCTransmitter *MockE2EUSDCTransmitterCaller) NextAvailableNonce(opts *bind.CallOpts) (uint64, error) { + var out []interface{} + err := _MockE2EUSDCTransmitter.contract.Call(opts, &out, "nextAvailableNonce") + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +func (_MockE2EUSDCTransmitter *MockE2EUSDCTransmitterSession) NextAvailableNonce() (uint64, error) { + return _MockE2EUSDCTransmitter.Contract.NextAvailableNonce(&_MockE2EUSDCTransmitter.CallOpts) +} + +func (_MockE2EUSDCTransmitter *MockE2EUSDCTransmitterCallerSession) NextAvailableNonce() (uint64, error) { + return _MockE2EUSDCTransmitter.Contract.NextAvailableNonce(&_MockE2EUSDCTransmitter.CallOpts) +} + +func (_MockE2EUSDCTransmitter *MockE2EUSDCTransmitterCaller) SShouldSucceed(opts *bind.CallOpts) (bool, error) { + var out []interface{} + err := _MockE2EUSDCTransmitter.contract.Call(opts, &out, "s_shouldSucceed") + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_MockE2EUSDCTransmitter *MockE2EUSDCTransmitterSession) SShouldSucceed() (bool, error) { + return _MockE2EUSDCTransmitter.Contract.SShouldSucceed(&_MockE2EUSDCTransmitter.CallOpts) +} + +func (_MockE2EUSDCTransmitter *MockE2EUSDCTransmitterCallerSession) SShouldSucceed() (bool, error) { + return _MockE2EUSDCTransmitter.Contract.SShouldSucceed(&_MockE2EUSDCTransmitter.CallOpts) +} + +func (_MockE2EUSDCTransmitter *MockE2EUSDCTransmitterCaller) Version(opts *bind.CallOpts) (uint32, error) { + var out []interface{} + err := _MockE2EUSDCTransmitter.contract.Call(opts, &out, "version") + + if err != nil { + return *new(uint32), err + } + + out0 := *abi.ConvertType(out[0], new(uint32)).(*uint32) + + return out0, err + +} + +func (_MockE2EUSDCTransmitter *MockE2EUSDCTransmitterSession) Version() (uint32, error) { + return _MockE2EUSDCTransmitter.Contract.Version(&_MockE2EUSDCTransmitter.CallOpts) +} + +func (_MockE2EUSDCTransmitter *MockE2EUSDCTransmitterCallerSession) Version() (uint32, error) { + return _MockE2EUSDCTransmitter.Contract.Version(&_MockE2EUSDCTransmitter.CallOpts) +} + +func (_MockE2EUSDCTransmitter *MockE2EUSDCTransmitterTransactor) ReceiveMessage(opts *bind.TransactOpts, message []byte, arg1 []byte) (*types.Transaction, error) { + return _MockE2EUSDCTransmitter.contract.Transact(opts, "receiveMessage", message, arg1) +} + +func (_MockE2EUSDCTransmitter *MockE2EUSDCTransmitterSession) ReceiveMessage(message []byte, arg1 []byte) (*types.Transaction, error) { + return _MockE2EUSDCTransmitter.Contract.ReceiveMessage(&_MockE2EUSDCTransmitter.TransactOpts, message, arg1) +} + +func (_MockE2EUSDCTransmitter *MockE2EUSDCTransmitterTransactorSession) ReceiveMessage(message []byte, arg1 []byte) (*types.Transaction, error) { + return _MockE2EUSDCTransmitter.Contract.ReceiveMessage(&_MockE2EUSDCTransmitter.TransactOpts, message, arg1) +} + +func (_MockE2EUSDCTransmitter *MockE2EUSDCTransmitterTransactor) SendMessage(opts *bind.TransactOpts, destinationDomain uint32, recipient [32]byte, messageBody []byte) (*types.Transaction, error) { + return _MockE2EUSDCTransmitter.contract.Transact(opts, "sendMessage", destinationDomain, recipient, messageBody) +} + +func (_MockE2EUSDCTransmitter *MockE2EUSDCTransmitterSession) SendMessage(destinationDomain uint32, recipient [32]byte, messageBody []byte) (*types.Transaction, error) { + return _MockE2EUSDCTransmitter.Contract.SendMessage(&_MockE2EUSDCTransmitter.TransactOpts, destinationDomain, recipient, messageBody) +} + +func (_MockE2EUSDCTransmitter *MockE2EUSDCTransmitterTransactorSession) SendMessage(destinationDomain uint32, recipient [32]byte, messageBody []byte) (*types.Transaction, error) { + return _MockE2EUSDCTransmitter.Contract.SendMessage(&_MockE2EUSDCTransmitter.TransactOpts, destinationDomain, recipient, messageBody) +} + +func (_MockE2EUSDCTransmitter *MockE2EUSDCTransmitterTransactor) SendMessageWithCaller(opts *bind.TransactOpts, destinationDomain uint32, recipient [32]byte, destinationCaller [32]byte, messageBody []byte) (*types.Transaction, error) { + return _MockE2EUSDCTransmitter.contract.Transact(opts, "sendMessageWithCaller", destinationDomain, recipient, destinationCaller, messageBody) +} + +func (_MockE2EUSDCTransmitter *MockE2EUSDCTransmitterSession) SendMessageWithCaller(destinationDomain uint32, recipient [32]byte, destinationCaller [32]byte, messageBody []byte) (*types.Transaction, error) { + return _MockE2EUSDCTransmitter.Contract.SendMessageWithCaller(&_MockE2EUSDCTransmitter.TransactOpts, destinationDomain, recipient, destinationCaller, messageBody) +} + +func (_MockE2EUSDCTransmitter *MockE2EUSDCTransmitterTransactorSession) SendMessageWithCaller(destinationDomain uint32, recipient [32]byte, destinationCaller [32]byte, messageBody []byte) (*types.Transaction, error) { + return _MockE2EUSDCTransmitter.Contract.SendMessageWithCaller(&_MockE2EUSDCTransmitter.TransactOpts, destinationDomain, recipient, destinationCaller, messageBody) +} + +func (_MockE2EUSDCTransmitter *MockE2EUSDCTransmitterTransactor) SetShouldSucceed(opts *bind.TransactOpts, shouldSucceed bool) (*types.Transaction, error) { + return _MockE2EUSDCTransmitter.contract.Transact(opts, "setShouldSucceed", shouldSucceed) +} + +func (_MockE2EUSDCTransmitter *MockE2EUSDCTransmitterSession) SetShouldSucceed(shouldSucceed bool) (*types.Transaction, error) { + return _MockE2EUSDCTransmitter.Contract.SetShouldSucceed(&_MockE2EUSDCTransmitter.TransactOpts, shouldSucceed) +} + +func (_MockE2EUSDCTransmitter *MockE2EUSDCTransmitterTransactorSession) SetShouldSucceed(shouldSucceed bool) (*types.Transaction, error) { + return _MockE2EUSDCTransmitter.Contract.SetShouldSucceed(&_MockE2EUSDCTransmitter.TransactOpts, shouldSucceed) +} + +type MockE2EUSDCTransmitterMessageSentIterator struct { + Event *MockE2EUSDCTransmitterMessageSent + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *MockE2EUSDCTransmitterMessageSentIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(MockE2EUSDCTransmitterMessageSent) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(MockE2EUSDCTransmitterMessageSent) + 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() + } +} + +func (it *MockE2EUSDCTransmitterMessageSentIterator) Error() error { + return it.fail +} + +func (it *MockE2EUSDCTransmitterMessageSentIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type MockE2EUSDCTransmitterMessageSent struct { + Message []byte + Raw types.Log +} + +func (_MockE2EUSDCTransmitter *MockE2EUSDCTransmitterFilterer) FilterMessageSent(opts *bind.FilterOpts) (*MockE2EUSDCTransmitterMessageSentIterator, error) { + + logs, sub, err := _MockE2EUSDCTransmitter.contract.FilterLogs(opts, "MessageSent") + if err != nil { + return nil, err + } + return &MockE2EUSDCTransmitterMessageSentIterator{contract: _MockE2EUSDCTransmitter.contract, event: "MessageSent", logs: logs, sub: sub}, nil +} + +func (_MockE2EUSDCTransmitter *MockE2EUSDCTransmitterFilterer) WatchMessageSent(opts *bind.WatchOpts, sink chan<- *MockE2EUSDCTransmitterMessageSent) (event.Subscription, error) { + + logs, sub, err := _MockE2EUSDCTransmitter.contract.WatchLogs(opts, "MessageSent") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(MockE2EUSDCTransmitterMessageSent) + if err := _MockE2EUSDCTransmitter.contract.UnpackLog(event, "MessageSent", 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 +} + +func (_MockE2EUSDCTransmitter *MockE2EUSDCTransmitterFilterer) ParseMessageSent(log types.Log) (*MockE2EUSDCTransmitterMessageSent, error) { + event := new(MockE2EUSDCTransmitterMessageSent) + if err := _MockE2EUSDCTransmitter.contract.UnpackLog(event, "MessageSent", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +func (_MockE2EUSDCTransmitter *MockE2EUSDCTransmitter) ParseLog(log types.Log) (generated.AbigenLog, error) { + switch log.Topics[0] { + case _MockE2EUSDCTransmitter.abi.Events["MessageSent"].ID: + return _MockE2EUSDCTransmitter.ParseMessageSent(log) + + default: + return nil, fmt.Errorf("abigen wrapper received unknown log topic: %v", log.Topics[0]) + } +} + +func (MockE2EUSDCTransmitterMessageSent) Topic() common.Hash { + return common.HexToHash("0x8c5261668696ce22758910d05bab8f186d6eb247ceac2af2e82c7dc17669b036") +} + +func (_MockE2EUSDCTransmitter *MockE2EUSDCTransmitter) Address() common.Address { + return _MockE2EUSDCTransmitter.address +} + +type MockE2EUSDCTransmitterInterface interface { + LocalDomain(opts *bind.CallOpts) (uint32, error) + + NextAvailableNonce(opts *bind.CallOpts) (uint64, error) + + SShouldSucceed(opts *bind.CallOpts) (bool, error) + + Version(opts *bind.CallOpts) (uint32, error) + + ReceiveMessage(opts *bind.TransactOpts, message []byte, arg1 []byte) (*types.Transaction, error) + + SendMessage(opts *bind.TransactOpts, destinationDomain uint32, recipient [32]byte, messageBody []byte) (*types.Transaction, error) + + SendMessageWithCaller(opts *bind.TransactOpts, destinationDomain uint32, recipient [32]byte, destinationCaller [32]byte, messageBody []byte) (*types.Transaction, error) + + SetShouldSucceed(opts *bind.TransactOpts, shouldSucceed bool) (*types.Transaction, error) + + FilterMessageSent(opts *bind.FilterOpts) (*MockE2EUSDCTransmitterMessageSentIterator, error) + + WatchMessageSent(opts *bind.WatchOpts, sink chan<- *MockE2EUSDCTransmitterMessageSent) (event.Subscription, error) + + ParseMessageSent(log types.Log) (*MockE2EUSDCTransmitterMessageSent, error) + + ParseLog(log types.Log) (generated.AbigenLog, error) + + Address() common.Address +} diff --git a/core/gethwrappers/ccip/generated/mock_v3_aggregator_contract/mock_v3_aggregator_contract.go b/core/gethwrappers/ccip/generated/mock_v3_aggregator_contract/mock_v3_aggregator_contract.go new file mode 100644 index 00000000000..c3521d35151 --- /dev/null +++ b/core/gethwrappers/ccip/generated/mock_v3_aggregator_contract/mock_v3_aggregator_contract.go @@ -0,0 +1,797 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package mock_v3_aggregator_contract + +import ( + "errors" + "fmt" + "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" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" +) + +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +var MockV3AggregatorMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"_decimals\",\"type\":\"uint8\"},{\"internalType\":\"int256\",\"name\":\"_initialAnswer\",\"type\":\"int256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"int256\",\"name\":\"current\",\"type\":\"int256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"roundId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"updatedAt\",\"type\":\"uint256\"}],\"name\":\"AnswerUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"roundId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"startedBy\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"startedAt\",\"type\":\"uint256\"}],\"name\":\"NewRound\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"description\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"getAnswer\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint80\",\"name\":\"_roundId\",\"type\":\"uint80\"}],\"name\":\"getRoundData\",\"outputs\":[{\"internalType\":\"uint80\",\"name\":\"roundId\",\"type\":\"uint80\"},{\"internalType\":\"int256\",\"name\":\"answer\",\"type\":\"int256\"},{\"internalType\":\"uint256\",\"name\":\"startedAt\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"updatedAt\",\"type\":\"uint256\"},{\"internalType\":\"uint80\",\"name\":\"answeredInRound\",\"type\":\"uint80\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"getTimestamp\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestAnswer\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestRound\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestRoundData\",\"outputs\":[{\"internalType\":\"uint80\",\"name\":\"roundId\",\"type\":\"uint80\"},{\"internalType\":\"int256\",\"name\":\"answer\",\"type\":\"int256\"},{\"internalType\":\"uint256\",\"name\":\"startedAt\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"updatedAt\",\"type\":\"uint256\"},{\"internalType\":\"uint80\",\"name\":\"answeredInRound\",\"type\":\"uint80\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestTimestamp\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"int256\",\"name\":\"_answer\",\"type\":\"int256\"}],\"name\":\"updateAnswer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint80\",\"name\":\"_roundId\",\"type\":\"uint80\"},{\"internalType\":\"int256\",\"name\":\"_answer\",\"type\":\"int256\"},{\"internalType\":\"uint256\",\"name\":\"_timestamp\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_startedAt\",\"type\":\"uint256\"}],\"name\":\"updateRoundData\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"version\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", + Bin: "0x608060405234801561001057600080fd5b5060405161059638038061059683398101604081905261002f916100a4565b6000805460ff191660ff84161790556100478161004e565b50506100ff565b60018190554260025560038054906000610067836100d8565b9091555050600380546000908152600460209081526040808320949094558254825260058152838220429081905592548252600690529190912055565b600080604083850312156100b757600080fd5b825160ff811681146100c857600080fd5b6020939093015192949293505050565b6000600182016100f857634e487b7160e01b600052601160045260246000fd5b5060010190565b6104888061010e6000396000f3fe608060405234801561001057600080fd5b50600436106100d45760003560e01c80638205bf6a11610081578063b5ab58dc1161005b578063b5ab58dc1461025b578063b633620c1461027b578063feaf968c1461029b57600080fd5b80638205bf6a146101c15780639a6fc8f5146101ca578063a87a20ce1461024857600080fd5b806354fd4d50116100b257806354fd4d5014610171578063668a0f02146101795780637284e4161461018257600080fd5b8063313ce567146100d95780634aa2011f146100fd57806350d25bcd1461015a575b600080fd5b6000546100e69060ff1681565b60405160ff90911681526020015b60405180910390f35b61015861010b36600461033b565b69ffffffffffffffffffff90931660038181556001849055600283905560009182526004602090815260408084209590955581548352600581528483209390935554815260069091522055565b005b61016360015481565b6040519081526020016100f4565b610163600081565b61016360035481565b604080518082018252601f81527f76302e382f74657374732f4d6f636b563341676772656761746f722e736f6c00602082015290516100f49190610374565b61016360025481565b6102116101d83660046103e1565b69ffffffffffffffffffff8116600090815260046020908152604080832054600683528184205460059093529220549293919290918490565b6040805169ffffffffffffffffffff968716815260208101959095528401929092526060830152909116608082015260a0016100f4565b610158610256366004610403565b6102c6565b610163610269366004610403565b60046020526000908152604090205481565b610163610289366004610403565b60056020526000908152604090205481565b6003546000818152600460209081526040808320546006835281842054600590935292205483610211565b600181905542600255600380549060006102df8361041c565b9091555050600380546000908152600460209081526040808320949094558254825260058152838220429081905592548252600690529190912055565b803569ffffffffffffffffffff8116811461033657600080fd5b919050565b6000806000806080858703121561035157600080fd5b61035a8561031c565b966020860135965060408601359560600135945092505050565b60006020808352835180602085015260005b818110156103a257858101830151858201604001528201610386565b5060006040828601015260407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8301168501019250505092915050565b6000602082840312156103f357600080fd5b6103fc8261031c565b9392505050565b60006020828403121561041557600080fd5b5035919050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203610474577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b506001019056fea164736f6c6343000818000a", +} + +var MockV3AggregatorABI = MockV3AggregatorMetaData.ABI + +var MockV3AggregatorBin = MockV3AggregatorMetaData.Bin + +func DeployMockV3Aggregator(auth *bind.TransactOpts, backend bind.ContractBackend, _decimals uint8, _initialAnswer *big.Int) (common.Address, *types.Transaction, *MockV3Aggregator, error) { + parsed, err := MockV3AggregatorMetaData.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(MockV3AggregatorBin), backend, _decimals, _initialAnswer) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &MockV3Aggregator{address: address, abi: *parsed, MockV3AggregatorCaller: MockV3AggregatorCaller{contract: contract}, MockV3AggregatorTransactor: MockV3AggregatorTransactor{contract: contract}, MockV3AggregatorFilterer: MockV3AggregatorFilterer{contract: contract}}, nil +} + +type MockV3Aggregator struct { + address common.Address + abi abi.ABI + MockV3AggregatorCaller + MockV3AggregatorTransactor + MockV3AggregatorFilterer +} + +type MockV3AggregatorCaller struct { + contract *bind.BoundContract +} + +type MockV3AggregatorTransactor struct { + contract *bind.BoundContract +} + +type MockV3AggregatorFilterer struct { + contract *bind.BoundContract +} + +type MockV3AggregatorSession struct { + Contract *MockV3Aggregator + CallOpts bind.CallOpts + TransactOpts bind.TransactOpts +} + +type MockV3AggregatorCallerSession struct { + Contract *MockV3AggregatorCaller + CallOpts bind.CallOpts +} + +type MockV3AggregatorTransactorSession struct { + Contract *MockV3AggregatorTransactor + TransactOpts bind.TransactOpts +} + +type MockV3AggregatorRaw struct { + Contract *MockV3Aggregator +} + +type MockV3AggregatorCallerRaw struct { + Contract *MockV3AggregatorCaller +} + +type MockV3AggregatorTransactorRaw struct { + Contract *MockV3AggregatorTransactor +} + +func NewMockV3Aggregator(address common.Address, backend bind.ContractBackend) (*MockV3Aggregator, error) { + abi, err := abi.JSON(strings.NewReader(MockV3AggregatorABI)) + if err != nil { + return nil, err + } + contract, err := bindMockV3Aggregator(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &MockV3Aggregator{address: address, abi: abi, MockV3AggregatorCaller: MockV3AggregatorCaller{contract: contract}, MockV3AggregatorTransactor: MockV3AggregatorTransactor{contract: contract}, MockV3AggregatorFilterer: MockV3AggregatorFilterer{contract: contract}}, nil +} + +func NewMockV3AggregatorCaller(address common.Address, caller bind.ContractCaller) (*MockV3AggregatorCaller, error) { + contract, err := bindMockV3Aggregator(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &MockV3AggregatorCaller{contract: contract}, nil +} + +func NewMockV3AggregatorTransactor(address common.Address, transactor bind.ContractTransactor) (*MockV3AggregatorTransactor, error) { + contract, err := bindMockV3Aggregator(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &MockV3AggregatorTransactor{contract: contract}, nil +} + +func NewMockV3AggregatorFilterer(address common.Address, filterer bind.ContractFilterer) (*MockV3AggregatorFilterer, error) { + contract, err := bindMockV3Aggregator(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &MockV3AggregatorFilterer{contract: contract}, nil +} + +func bindMockV3Aggregator(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := MockV3AggregatorMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +func (_MockV3Aggregator *MockV3AggregatorRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _MockV3Aggregator.Contract.MockV3AggregatorCaller.contract.Call(opts, result, method, params...) +} + +func (_MockV3Aggregator *MockV3AggregatorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _MockV3Aggregator.Contract.MockV3AggregatorTransactor.contract.Transfer(opts) +} + +func (_MockV3Aggregator *MockV3AggregatorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _MockV3Aggregator.Contract.MockV3AggregatorTransactor.contract.Transact(opts, method, params...) +} + +func (_MockV3Aggregator *MockV3AggregatorCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _MockV3Aggregator.Contract.contract.Call(opts, result, method, params...) +} + +func (_MockV3Aggregator *MockV3AggregatorTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _MockV3Aggregator.Contract.contract.Transfer(opts) +} + +func (_MockV3Aggregator *MockV3AggregatorTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _MockV3Aggregator.Contract.contract.Transact(opts, method, params...) +} + +func (_MockV3Aggregator *MockV3AggregatorCaller) Decimals(opts *bind.CallOpts) (uint8, error) { + var out []interface{} + err := _MockV3Aggregator.contract.Call(opts, &out, "decimals") + + if err != nil { + return *new(uint8), err + } + + out0 := *abi.ConvertType(out[0], new(uint8)).(*uint8) + + return out0, err + +} + +func (_MockV3Aggregator *MockV3AggregatorSession) Decimals() (uint8, error) { + return _MockV3Aggregator.Contract.Decimals(&_MockV3Aggregator.CallOpts) +} + +func (_MockV3Aggregator *MockV3AggregatorCallerSession) Decimals() (uint8, error) { + return _MockV3Aggregator.Contract.Decimals(&_MockV3Aggregator.CallOpts) +} + +func (_MockV3Aggregator *MockV3AggregatorCaller) Description(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _MockV3Aggregator.contract.Call(opts, &out, "description") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +func (_MockV3Aggregator *MockV3AggregatorSession) Description() (string, error) { + return _MockV3Aggregator.Contract.Description(&_MockV3Aggregator.CallOpts) +} + +func (_MockV3Aggregator *MockV3AggregatorCallerSession) Description() (string, error) { + return _MockV3Aggregator.Contract.Description(&_MockV3Aggregator.CallOpts) +} + +func (_MockV3Aggregator *MockV3AggregatorCaller) GetAnswer(opts *bind.CallOpts, arg0 *big.Int) (*big.Int, error) { + var out []interface{} + err := _MockV3Aggregator.contract.Call(opts, &out, "getAnswer", arg0) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_MockV3Aggregator *MockV3AggregatorSession) GetAnswer(arg0 *big.Int) (*big.Int, error) { + return _MockV3Aggregator.Contract.GetAnswer(&_MockV3Aggregator.CallOpts, arg0) +} + +func (_MockV3Aggregator *MockV3AggregatorCallerSession) GetAnswer(arg0 *big.Int) (*big.Int, error) { + return _MockV3Aggregator.Contract.GetAnswer(&_MockV3Aggregator.CallOpts, arg0) +} + +func (_MockV3Aggregator *MockV3AggregatorCaller) GetRoundData(opts *bind.CallOpts, _roundId *big.Int) (GetRoundData, + + error) { + var out []interface{} + err := _MockV3Aggregator.contract.Call(opts, &out, "getRoundData", _roundId) + + outstruct := new(GetRoundData) + if err != nil { + return *outstruct, err + } + + outstruct.RoundId = *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + outstruct.Answer = *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) + outstruct.StartedAt = *abi.ConvertType(out[2], new(*big.Int)).(**big.Int) + outstruct.UpdatedAt = *abi.ConvertType(out[3], new(*big.Int)).(**big.Int) + outstruct.AnsweredInRound = *abi.ConvertType(out[4], new(*big.Int)).(**big.Int) + + return *outstruct, err + +} + +func (_MockV3Aggregator *MockV3AggregatorSession) GetRoundData(_roundId *big.Int) (GetRoundData, + + error) { + return _MockV3Aggregator.Contract.GetRoundData(&_MockV3Aggregator.CallOpts, _roundId) +} + +func (_MockV3Aggregator *MockV3AggregatorCallerSession) GetRoundData(_roundId *big.Int) (GetRoundData, + + error) { + return _MockV3Aggregator.Contract.GetRoundData(&_MockV3Aggregator.CallOpts, _roundId) +} + +func (_MockV3Aggregator *MockV3AggregatorCaller) GetTimestamp(opts *bind.CallOpts, arg0 *big.Int) (*big.Int, error) { + var out []interface{} + err := _MockV3Aggregator.contract.Call(opts, &out, "getTimestamp", arg0) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_MockV3Aggregator *MockV3AggregatorSession) GetTimestamp(arg0 *big.Int) (*big.Int, error) { + return _MockV3Aggregator.Contract.GetTimestamp(&_MockV3Aggregator.CallOpts, arg0) +} + +func (_MockV3Aggregator *MockV3AggregatorCallerSession) GetTimestamp(arg0 *big.Int) (*big.Int, error) { + return _MockV3Aggregator.Contract.GetTimestamp(&_MockV3Aggregator.CallOpts, arg0) +} + +func (_MockV3Aggregator *MockV3AggregatorCaller) LatestAnswer(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _MockV3Aggregator.contract.Call(opts, &out, "latestAnswer") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_MockV3Aggregator *MockV3AggregatorSession) LatestAnswer() (*big.Int, error) { + return _MockV3Aggregator.Contract.LatestAnswer(&_MockV3Aggregator.CallOpts) +} + +func (_MockV3Aggregator *MockV3AggregatorCallerSession) LatestAnswer() (*big.Int, error) { + return _MockV3Aggregator.Contract.LatestAnswer(&_MockV3Aggregator.CallOpts) +} + +func (_MockV3Aggregator *MockV3AggregatorCaller) LatestRound(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _MockV3Aggregator.contract.Call(opts, &out, "latestRound") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_MockV3Aggregator *MockV3AggregatorSession) LatestRound() (*big.Int, error) { + return _MockV3Aggregator.Contract.LatestRound(&_MockV3Aggregator.CallOpts) +} + +func (_MockV3Aggregator *MockV3AggregatorCallerSession) LatestRound() (*big.Int, error) { + return _MockV3Aggregator.Contract.LatestRound(&_MockV3Aggregator.CallOpts) +} + +func (_MockV3Aggregator *MockV3AggregatorCaller) LatestRoundData(opts *bind.CallOpts) (LatestRoundData, + + error) { + var out []interface{} + err := _MockV3Aggregator.contract.Call(opts, &out, "latestRoundData") + + outstruct := new(LatestRoundData) + if err != nil { + return *outstruct, err + } + + outstruct.RoundId = *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + outstruct.Answer = *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) + outstruct.StartedAt = *abi.ConvertType(out[2], new(*big.Int)).(**big.Int) + outstruct.UpdatedAt = *abi.ConvertType(out[3], new(*big.Int)).(**big.Int) + outstruct.AnsweredInRound = *abi.ConvertType(out[4], new(*big.Int)).(**big.Int) + + return *outstruct, err + +} + +func (_MockV3Aggregator *MockV3AggregatorSession) LatestRoundData() (LatestRoundData, + + error) { + return _MockV3Aggregator.Contract.LatestRoundData(&_MockV3Aggregator.CallOpts) +} + +func (_MockV3Aggregator *MockV3AggregatorCallerSession) LatestRoundData() (LatestRoundData, + + error) { + return _MockV3Aggregator.Contract.LatestRoundData(&_MockV3Aggregator.CallOpts) +} + +func (_MockV3Aggregator *MockV3AggregatorCaller) LatestTimestamp(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _MockV3Aggregator.contract.Call(opts, &out, "latestTimestamp") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_MockV3Aggregator *MockV3AggregatorSession) LatestTimestamp() (*big.Int, error) { + return _MockV3Aggregator.Contract.LatestTimestamp(&_MockV3Aggregator.CallOpts) +} + +func (_MockV3Aggregator *MockV3AggregatorCallerSession) LatestTimestamp() (*big.Int, error) { + return _MockV3Aggregator.Contract.LatestTimestamp(&_MockV3Aggregator.CallOpts) +} + +func (_MockV3Aggregator *MockV3AggregatorCaller) Version(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _MockV3Aggregator.contract.Call(opts, &out, "version") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_MockV3Aggregator *MockV3AggregatorSession) Version() (*big.Int, error) { + return _MockV3Aggregator.Contract.Version(&_MockV3Aggregator.CallOpts) +} + +func (_MockV3Aggregator *MockV3AggregatorCallerSession) Version() (*big.Int, error) { + return _MockV3Aggregator.Contract.Version(&_MockV3Aggregator.CallOpts) +} + +func (_MockV3Aggregator *MockV3AggregatorTransactor) UpdateAnswer(opts *bind.TransactOpts, _answer *big.Int) (*types.Transaction, error) { + return _MockV3Aggregator.contract.Transact(opts, "updateAnswer", _answer) +} + +func (_MockV3Aggregator *MockV3AggregatorSession) UpdateAnswer(_answer *big.Int) (*types.Transaction, error) { + return _MockV3Aggregator.Contract.UpdateAnswer(&_MockV3Aggregator.TransactOpts, _answer) +} + +func (_MockV3Aggregator *MockV3AggregatorTransactorSession) UpdateAnswer(_answer *big.Int) (*types.Transaction, error) { + return _MockV3Aggregator.Contract.UpdateAnswer(&_MockV3Aggregator.TransactOpts, _answer) +} + +func (_MockV3Aggregator *MockV3AggregatorTransactor) UpdateRoundData(opts *bind.TransactOpts, _roundId *big.Int, _answer *big.Int, _timestamp *big.Int, _startedAt *big.Int) (*types.Transaction, error) { + return _MockV3Aggregator.contract.Transact(opts, "updateRoundData", _roundId, _answer, _timestamp, _startedAt) +} + +func (_MockV3Aggregator *MockV3AggregatorSession) UpdateRoundData(_roundId *big.Int, _answer *big.Int, _timestamp *big.Int, _startedAt *big.Int) (*types.Transaction, error) { + return _MockV3Aggregator.Contract.UpdateRoundData(&_MockV3Aggregator.TransactOpts, _roundId, _answer, _timestamp, _startedAt) +} + +func (_MockV3Aggregator *MockV3AggregatorTransactorSession) UpdateRoundData(_roundId *big.Int, _answer *big.Int, _timestamp *big.Int, _startedAt *big.Int) (*types.Transaction, error) { + return _MockV3Aggregator.Contract.UpdateRoundData(&_MockV3Aggregator.TransactOpts, _roundId, _answer, _timestamp, _startedAt) +} + +type MockV3AggregatorAnswerUpdatedIterator struct { + Event *MockV3AggregatorAnswerUpdated + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *MockV3AggregatorAnswerUpdatedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(MockV3AggregatorAnswerUpdated) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(MockV3AggregatorAnswerUpdated) + 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() + } +} + +func (it *MockV3AggregatorAnswerUpdatedIterator) Error() error { + return it.fail +} + +func (it *MockV3AggregatorAnswerUpdatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type MockV3AggregatorAnswerUpdated struct { + Current *big.Int + RoundId *big.Int + UpdatedAt *big.Int + Raw types.Log +} + +func (_MockV3Aggregator *MockV3AggregatorFilterer) FilterAnswerUpdated(opts *bind.FilterOpts, current []*big.Int, roundId []*big.Int) (*MockV3AggregatorAnswerUpdatedIterator, error) { + + var currentRule []interface{} + for _, currentItem := range current { + currentRule = append(currentRule, currentItem) + } + var roundIdRule []interface{} + for _, roundIdItem := range roundId { + roundIdRule = append(roundIdRule, roundIdItem) + } + + logs, sub, err := _MockV3Aggregator.contract.FilterLogs(opts, "AnswerUpdated", currentRule, roundIdRule) + if err != nil { + return nil, err + } + return &MockV3AggregatorAnswerUpdatedIterator{contract: _MockV3Aggregator.contract, event: "AnswerUpdated", logs: logs, sub: sub}, nil +} + +func (_MockV3Aggregator *MockV3AggregatorFilterer) WatchAnswerUpdated(opts *bind.WatchOpts, sink chan<- *MockV3AggregatorAnswerUpdated, current []*big.Int, roundId []*big.Int) (event.Subscription, error) { + + var currentRule []interface{} + for _, currentItem := range current { + currentRule = append(currentRule, currentItem) + } + var roundIdRule []interface{} + for _, roundIdItem := range roundId { + roundIdRule = append(roundIdRule, roundIdItem) + } + + logs, sub, err := _MockV3Aggregator.contract.WatchLogs(opts, "AnswerUpdated", currentRule, roundIdRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(MockV3AggregatorAnswerUpdated) + if err := _MockV3Aggregator.contract.UnpackLog(event, "AnswerUpdated", 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 +} + +func (_MockV3Aggregator *MockV3AggregatorFilterer) ParseAnswerUpdated(log types.Log) (*MockV3AggregatorAnswerUpdated, error) { + event := new(MockV3AggregatorAnswerUpdated) + if err := _MockV3Aggregator.contract.UnpackLog(event, "AnswerUpdated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type MockV3AggregatorNewRoundIterator struct { + Event *MockV3AggregatorNewRound + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *MockV3AggregatorNewRoundIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(MockV3AggregatorNewRound) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(MockV3AggregatorNewRound) + 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() + } +} + +func (it *MockV3AggregatorNewRoundIterator) Error() error { + return it.fail +} + +func (it *MockV3AggregatorNewRoundIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type MockV3AggregatorNewRound struct { + RoundId *big.Int + StartedBy common.Address + StartedAt *big.Int + Raw types.Log +} + +func (_MockV3Aggregator *MockV3AggregatorFilterer) FilterNewRound(opts *bind.FilterOpts, roundId []*big.Int, startedBy []common.Address) (*MockV3AggregatorNewRoundIterator, error) { + + var roundIdRule []interface{} + for _, roundIdItem := range roundId { + roundIdRule = append(roundIdRule, roundIdItem) + } + var startedByRule []interface{} + for _, startedByItem := range startedBy { + startedByRule = append(startedByRule, startedByItem) + } + + logs, sub, err := _MockV3Aggregator.contract.FilterLogs(opts, "NewRound", roundIdRule, startedByRule) + if err != nil { + return nil, err + } + return &MockV3AggregatorNewRoundIterator{contract: _MockV3Aggregator.contract, event: "NewRound", logs: logs, sub: sub}, nil +} + +func (_MockV3Aggregator *MockV3AggregatorFilterer) WatchNewRound(opts *bind.WatchOpts, sink chan<- *MockV3AggregatorNewRound, roundId []*big.Int, startedBy []common.Address) (event.Subscription, error) { + + var roundIdRule []interface{} + for _, roundIdItem := range roundId { + roundIdRule = append(roundIdRule, roundIdItem) + } + var startedByRule []interface{} + for _, startedByItem := range startedBy { + startedByRule = append(startedByRule, startedByItem) + } + + logs, sub, err := _MockV3Aggregator.contract.WatchLogs(opts, "NewRound", roundIdRule, startedByRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(MockV3AggregatorNewRound) + if err := _MockV3Aggregator.contract.UnpackLog(event, "NewRound", 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 +} + +func (_MockV3Aggregator *MockV3AggregatorFilterer) ParseNewRound(log types.Log) (*MockV3AggregatorNewRound, error) { + event := new(MockV3AggregatorNewRound) + if err := _MockV3Aggregator.contract.UnpackLog(event, "NewRound", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type GetRoundData struct { + RoundId *big.Int + Answer *big.Int + StartedAt *big.Int + UpdatedAt *big.Int + AnsweredInRound *big.Int +} +type LatestRoundData struct { + RoundId *big.Int + Answer *big.Int + StartedAt *big.Int + UpdatedAt *big.Int + AnsweredInRound *big.Int +} + +func (_MockV3Aggregator *MockV3Aggregator) ParseLog(log types.Log) (generated.AbigenLog, error) { + switch log.Topics[0] { + case _MockV3Aggregator.abi.Events["AnswerUpdated"].ID: + return _MockV3Aggregator.ParseAnswerUpdated(log) + case _MockV3Aggregator.abi.Events["NewRound"].ID: + return _MockV3Aggregator.ParseNewRound(log) + + default: + return nil, fmt.Errorf("abigen wrapper received unknown log topic: %v", log.Topics[0]) + } +} + +func (MockV3AggregatorAnswerUpdated) Topic() common.Hash { + return common.HexToHash("0x0559884fd3a460db3073b7fc896cc77986f16e378210ded43186175bf646fc5f") +} + +func (MockV3AggregatorNewRound) Topic() common.Hash { + return common.HexToHash("0x0109fc6f55cf40689f02fbaad7af7fe7bbac8a3d2186600afc7d3e10cac60271") +} + +func (_MockV3Aggregator *MockV3Aggregator) Address() common.Address { + return _MockV3Aggregator.address +} + +type MockV3AggregatorInterface interface { + Decimals(opts *bind.CallOpts) (uint8, error) + + Description(opts *bind.CallOpts) (string, error) + + GetAnswer(opts *bind.CallOpts, arg0 *big.Int) (*big.Int, error) + + GetRoundData(opts *bind.CallOpts, _roundId *big.Int) (GetRoundData, + + error) + + GetTimestamp(opts *bind.CallOpts, arg0 *big.Int) (*big.Int, error) + + LatestAnswer(opts *bind.CallOpts) (*big.Int, error) + + LatestRound(opts *bind.CallOpts) (*big.Int, error) + + LatestRoundData(opts *bind.CallOpts) (LatestRoundData, + + error) + + LatestTimestamp(opts *bind.CallOpts) (*big.Int, error) + + Version(opts *bind.CallOpts) (*big.Int, error) + + UpdateAnswer(opts *bind.TransactOpts, _answer *big.Int) (*types.Transaction, error) + + UpdateRoundData(opts *bind.TransactOpts, _roundId *big.Int, _answer *big.Int, _timestamp *big.Int, _startedAt *big.Int) (*types.Transaction, error) + + FilterAnswerUpdated(opts *bind.FilterOpts, current []*big.Int, roundId []*big.Int) (*MockV3AggregatorAnswerUpdatedIterator, error) + + WatchAnswerUpdated(opts *bind.WatchOpts, sink chan<- *MockV3AggregatorAnswerUpdated, current []*big.Int, roundId []*big.Int) (event.Subscription, error) + + ParseAnswerUpdated(log types.Log) (*MockV3AggregatorAnswerUpdated, error) + + FilterNewRound(opts *bind.FilterOpts, roundId []*big.Int, startedBy []common.Address) (*MockV3AggregatorNewRoundIterator, error) + + WatchNewRound(opts *bind.WatchOpts, sink chan<- *MockV3AggregatorNewRound, roundId []*big.Int, startedBy []common.Address) (event.Subscription, error) + + ParseNewRound(log types.Log) (*MockV3AggregatorNewRound, error) + + ParseLog(log types.Log) (generated.AbigenLog, error) + + Address() common.Address +} diff --git a/core/gethwrappers/ccip/generated/multi_aggregate_rate_limiter/multi_aggregate_rate_limiter.go b/core/gethwrappers/ccip/generated/multi_aggregate_rate_limiter/multi_aggregate_rate_limiter.go new file mode 100644 index 00000000000..e1942e68dab --- /dev/null +++ b/core/gethwrappers/ccip/generated/multi_aggregate_rate_limiter/multi_aggregate_rate_limiter.go @@ -0,0 +1,1860 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package multi_aggregate_rate_limiter + +import ( + "errors" + "fmt" + "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" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" +) + +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +type AuthorizedCallersAuthorizedCallerArgs struct { + AddedCallers []common.Address + RemovedCallers []common.Address +} + +type ClientAny2EVMMessage struct { + MessageId [32]byte + SourceChainSelector uint64 + Sender []byte + Data []byte + DestTokenAmounts []ClientEVMTokenAmount +} + +type ClientEVM2AnyMessage struct { + Receiver []byte + Data []byte + TokenAmounts []ClientEVMTokenAmount + FeeToken common.Address + ExtraArgs []byte +} + +type ClientEVMTokenAmount struct { + Token common.Address + Amount *big.Int +} + +type MultiAggregateRateLimiterLocalRateLimitToken struct { + RemoteChainSelector uint64 + LocalToken common.Address +} + +type MultiAggregateRateLimiterRateLimitTokenArgs struct { + LocalTokenArgs MultiAggregateRateLimiterLocalRateLimitToken + RemoteToken []byte +} + +type MultiAggregateRateLimiterRateLimiterConfigArgs struct { + RemoteChainSelector uint64 + IsOutboundLane bool + RateLimiterConfig RateLimiterConfig +} + +type RateLimiterConfig struct { + IsEnabled bool + Capacity *big.Int + Rate *big.Int +} + +type RateLimiterTokenBucket struct { + Tokens *big.Int + LastUpdated uint32 + IsEnabled bool + Capacity *big.Int + Rate *big.Int +} + +var MultiAggregateRateLimiterMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"feeQuoter\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"authorizedCallers\",\"type\":\"address[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"capacity\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"requested\",\"type\":\"uint256\"}],\"name\":\"AggregateValueMaxCapacityExceeded\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"minWaitInSeconds\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"available\",\"type\":\"uint256\"}],\"name\":\"AggregateValueRateLimitReached\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"BucketOverfilled\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"errorReason\",\"type\":\"bytes\"}],\"name\":\"MessageValidationError\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"PriceNotFoundForToken\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"capacity\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"requested\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"}],\"name\":\"TokenMaxCapacityExceeded\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"minWaitInSeconds\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"available\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"}],\"name\":\"TokenRateLimitReached\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"}],\"name\":\"UnauthorizedCaller\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddressNotAllowed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroChainSelectorNotAllowed\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"}],\"name\":\"AuthorizedCallerAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"}],\"name\":\"AuthorizedCallerRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"indexed\":false,\"internalType\":\"structRateLimiter.Config\",\"name\":\"config\",\"type\":\"tuple\"}],\"name\":\"ConfigChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newFeeQuoter\",\"type\":\"address\"}],\"name\":\"FeeQuoterSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"isOutboundLane\",\"type\":\"bool\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"indexed\":false,\"internalType\":\"structRateLimiter.Config\",\"name\":\"config\",\"type\":\"tuple\"}],\"name\":\"RateLimiterConfigUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"remoteToken\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"localToken\",\"type\":\"address\"}],\"name\":\"TokenAggregateRateLimitAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"localToken\",\"type\":\"address\"}],\"name\":\"TokenAggregateRateLimitRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"}],\"name\":\"TokensConsumed\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address[]\",\"name\":\"addedCallers\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"removedCallers\",\"type\":\"address[]\"}],\"internalType\":\"structAuthorizedCallers.AuthorizedCallerArgs\",\"name\":\"authorizedCallerArgs\",\"type\":\"tuple\"}],\"name\":\"applyAuthorizedCallerUpdates\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"bool\",\"name\":\"isOutboundLane\",\"type\":\"bool\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"rateLimiterConfig\",\"type\":\"tuple\"}],\"internalType\":\"structMultiAggregateRateLimiter.RateLimiterConfigArgs[]\",\"name\":\"rateLimiterUpdates\",\"type\":\"tuple[]\"}],\"name\":\"applyRateLimiterConfigUpdates\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"bool\",\"name\":\"isOutboundLane\",\"type\":\"bool\"}],\"name\":\"currentRateLimiterState\",\"outputs\":[{\"components\":[{\"internalType\":\"uint128\",\"name\":\"tokens\",\"type\":\"uint128\"},{\"internalType\":\"uint32\",\"name\":\"lastUpdated\",\"type\":\"uint32\"},{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.TokenBucket\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAllAuthorizedCallers\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"getAllRateLimitTokens\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"localTokens\",\"type\":\"address[]\"},{\"internalType\":\"bytes[]\",\"name\":\"remoteTokens\",\"type\":\"bytes[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getFeeQuoter\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"feeQuoter\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"messageId\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"sender\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"internalType\":\"structClient.EVMTokenAmount[]\",\"name\":\"destTokenAmounts\",\"type\":\"tuple[]\"}],\"internalType\":\"structClient.Any2EVMMessage\",\"name\":\"message\",\"type\":\"tuple\"}],\"name\":\"onInboundMessage\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"},{\"components\":[{\"internalType\":\"bytes\",\"name\":\"receiver\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"internalType\":\"structClient.EVMTokenAmount[]\",\"name\":\"tokenAmounts\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"feeToken\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"extraArgs\",\"type\":\"bytes\"}],\"internalType\":\"structClient.EVM2AnyMessage\",\"name\":\"message\",\"type\":\"tuple\"}],\"name\":\"onOutboundMessage\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newFeeQuoter\",\"type\":\"address\"}],\"name\":\"setFeeQuoter\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"localToken\",\"type\":\"address\"}],\"internalType\":\"structMultiAggregateRateLimiter.LocalRateLimitToken[]\",\"name\":\"removes\",\"type\":\"tuple[]\"},{\"components\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"localToken\",\"type\":\"address\"}],\"internalType\":\"structMultiAggregateRateLimiter.LocalRateLimitToken\",\"name\":\"localTokenArgs\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"remoteToken\",\"type\":\"bytes\"}],\"internalType\":\"structMultiAggregateRateLimiter.RateLimitTokenArgs[]\",\"name\":\"adds\",\"type\":\"tuple[]\"}],\"name\":\"updateRateLimitTokens\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", + Bin: "0x60806040523480156200001157600080fd5b506040516200327338038062003273833981016040819052620000349162000538565b8033806000816200008c5760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000bf57620000bf8162000102565b5050604080518082018252838152815160008152602080820190935291810191909152620000ee9150620001ad565b50620000fa82620002fc565b50506200066f565b336001600160a01b038216036200015c5760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640162000083565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b602081015160005b81518110156200023d576000828281518110620001d657620001d662000621565b60209081029190910101519050620001f060028262000378565b1562000233576040516001600160a01b03821681527fc3803387881faad271c47728894e3e36fac830ffc8602ca6fc07733cbda775809060200160405180910390a15b50600101620001b5565b50815160005b8151811015620002f657600082828151811062000264576200026462000621565b6020026020010151905060006001600160a01b0316816001600160a01b031603620002a2576040516342bcdf7f60e11b815260040160405180910390fd5b620002af60028262000398565b506040516001600160a01b03821681527feb1b9b92e50b7f88f9ff25d56765095ac6e91540eee214906f4036a908ffbdef9060200160405180910390a15060010162000243565b50505050565b6001600160a01b03811662000324576040516342bcdf7f60e11b815260040160405180910390fd5b600580546001600160a01b0319166001600160a01b0383169081179091556040519081527f7c737a8eddf62436489aa3600ed26e75e0a58b0f8c0d266bbcee64358c39fdac9060200160405180910390a150565b60006200038f836001600160a01b038416620003af565b90505b92915050565b60006200038f836001600160a01b038416620004b3565b60008181526001830160205260408120548015620004a8576000620003d660018362000637565b8554909150600090620003ec9060019062000637565b90508181146200045857600086600001828154811062000410576200041062000621565b906000526020600020015490508087600001848154811062000436576200043662000621565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806200046c576200046c62000659565b60019003818190600052602060002001600090559055856001016000868152602001908152602001600020600090556001935050505062000392565b600091505062000392565b6000818152600183016020526040812054620004fc5750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915562000392565b50600062000392565b80516001600160a01b03811681146200051d57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b600080604083850312156200054c57600080fd5b620005578362000505565b602084810151919350906001600160401b03808211156200057757600080fd5b818601915086601f8301126200058c57600080fd5b815181811115620005a157620005a162000522565b8060051b604051601f19603f83011681018181108582111715620005c957620005c962000522565b604052918252848201925083810185019189831115620005e857600080fd5b938501935b828510156200061157620006018562000505565b84529385019392850192620005ed565b8096505050505050509250929050565b634e487b7160e01b600052603260045260246000fd5b818103818111156200039257634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603160045260246000fd5b612bf4806200067f6000396000f3fe608060405234801561001057600080fd5b50600436106100ea5760003560e01c80638da5cb5b1161008c578063e145291611610066578063e145291614610247578063e835232b14610265578063f2fde38b14610278578063fe843cd01461028b57600080fd5b80638da5cb5b146101e257806391a2749a14610221578063e0a0e5061461023457600080fd5b80631af18b7b116100c85780631af18b7b146101915780632451a627146101a4578063537e304e146101b957806379ba5097146101da57600080fd5b806308d450a1146100ef5780630a35bcc414610104578063181f5a771461017c575b600080fd5b6101026100fd366004612003565b61029e565b005b6101176101123660046120e3565b6102bd565b604051610173919081516fffffffffffffffffffffffffffffffff908116825260208084015163ffffffff1690830152604080840151151590830152606080840151821690830152608092830151169181019190915260a00190565b60405180910390f35b610184610382565b604051610173919061217a565b61010261019f3660046122b4565b61039e565b6101ac6105ca565b60405161017391906123d1565b6101cc6101c73660046123e4565b6105db565b6040516101739291906123ff565b610102610748565b60005473ffffffffffffffffffffffffffffffffffffffff165b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610173565b61010261022f3660046124f5565b61084a565b610102610242366004612586565b61085b565b60055473ffffffffffffffffffffffffffffffffffffffff166101fc565b6101026102733660046125db565b6108d0565b6101026102863660046125db565b6108e1565b610102610299366004612616565b6108f2565b6102a6610c31565b6102ba816020015182608001516000610c76565b50565b6040805160a0810182526000808252602082018190529181018290526060810182905260808101919091526103796102f58484610d4d565b6040805160a08101825282546fffffffffffffffffffffffffffffffff808216835270010000000000000000000000000000000080830463ffffffff1660208501527401000000000000000000000000000000000000000090920460ff16151593830193909352600190930154808316606083015292909204166080820152610d7d565b90505b92915050565b604051806060016040528060238152602001612bc56023913981565b6103a6610e2f565b60005b82518110156104845760008382815181106103c6576103c661274a565b602002602001015160200151905060008483815181106103e8576103e861274a565b6020908102919091018101515167ffffffffffffffff811660009081526004909252604090912090915061041c9083610eb0565b1561047a576040805167ffffffffffffffff8316815273ffffffffffffffffffffffffffffffffffffffff841660208201527f530cabd30786b7235e124a6c0db77e0b685ef22813b1fe87554247f404eb8ed6910160405180910390a15b50506001016103a9565b5060005b81518110156105c55760008282815181106104a5576104a561274a565b602002602001015160000151905060008383815181106104c7576104c761274a565b6020026020010151602001519050600082602001519050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16148061051857508151155b1561054f576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b825167ffffffffffffffff81166000908152600460205260409020610575908385610ed2565b156105b6577fad72a792d2a307f400c278be7deaeec6964276783304580cdc4e905436b8d5c58184846040516105ad93929190612779565b60405180910390a15b50505050806001019050610488565b505050565b60606105d66002610eff565b905090565b67ffffffffffffffff81166000908152600460205260408120606091829161060290610f0c565b90508067ffffffffffffffff81111561061d5761061d611d74565b604051908082528060200260200182016040528015610646578160200160208202803683370190505b5092508067ffffffffffffffff81111561066257610662611d74565b60405190808252806020026020018201604052801561069557816020015b60608152602001906001900390816106805790505b50915060005b818110156107415767ffffffffffffffff8516600090815260046020526040812081906106c89084610f17565b91509150818684815181106106df576106df61274a565b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508085848151811061072c5761072c61274a565b6020908102919091010152505060010161069b565b5050915091565b60015473ffffffffffffffffffffffffffffffffffffffff1633146107ce576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e65720000000000000000000060448201526064015b60405180910390fd5b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b610852610e2f565b6102ba81610f36565b610863610c31565b6108cc8261087460408401846127c2565b808060200260200160405190810160405280939291908181526020016000905b828210156108c0576108b16040830286013681900381019061282a565b81526020019060010190610894565b50505050506001610c76565b5050565b6108d8610e2f565b6102ba816110c2565b6108e9610e2f565b6102ba81611188565b6108fa610e2f565b60005b81518110156108cc57600082828151811061091a5761091a61274a565b6020908102919091010151604081015181519192509067ffffffffffffffff8116600003610974576040517fc656089500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b602083015160006109858383610d4d565b8054909150700100000000000000000000000000000000900463ffffffff16600003610bd3576040805160a081018252602080870180516fffffffffffffffffffffffffffffffff908116845263ffffffff421692840192909252875115158385015251811660608301529186015190911660808201528215610aec5767ffffffffffffffff8416600090815260066020908152604091829020835160028201805493860151948601516fffffffffffffffffffffffffffffffff9283167fffffffffffffffffffffffff00000000000000000000000000000000000000009095169490941770010000000000000000000000000000000063ffffffff9096168602177fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1674010000000000000000000000000000000000000000941515949094029390931790925560608401516080850151908316921690920217600390910155610bcd565b67ffffffffffffffff84166000908152600660209081526040918290208351815492850151938501516fffffffffffffffffffffffffffffffff9182167fffffffffffffffffffffffff00000000000000000000000000000000000000009094169390931770010000000000000000000000000000000063ffffffff9095168502177fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff167401000000000000000000000000000000000000000093151593909302929092178155606084015160808501519083169216909202176001909101555b50610bdd565b610bdd818561127d565b8267ffffffffffffffff167ff14a5415ce6988a9e870a85fff0b9d7b7dd79bbc228cb63cad610daf6f7b6b978386604051610c19929190612846565b60405180910390a250505050508060010190506108fd565b610c3c60023361142c565b610c74576040517fd86ad9cf0000000000000000000000000000000000000000000000000000000081523360048201526024016107c5565b565b6000610c828483610d4d565b805490915074010000000000000000000000000000000000000000900460ff1615610d47576000805b8451811015610d3257610cf6858281518110610cc957610cc961274a565b6020908102919091018101515167ffffffffffffffff89166000908152600490925260409091209061145b565b15610d2a57610d1d858281518110610d1057610d1061274a565b602002602001015161147d565b610d2790836128b9565b91505b600101610cab565b508015610d4557610d45828260006115b9565b505b50505050565b67ffffffffffffffff821660009081526006602052604081208215610d7657600201905061037c565b905061037c565b6040805160a081018252600080825260208201819052918101829052606081018290526080810191909152610e0b82606001516fffffffffffffffffffffffffffffffff1683600001516fffffffffffffffffffffffffffffffff16846020015163ffffffff1642610def91906128cc565b85608001516fffffffffffffffffffffffffffffffff1661193c565b6fffffffffffffffffffffffffffffffff1682525063ffffffff4216602082015290565b60005473ffffffffffffffffffffffffffffffffffffffff163314610c74576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e65720000000000000000000060448201526064016107c5565b60006103798373ffffffffffffffffffffffffffffffffffffffff8416611964565b6000610ef58473ffffffffffffffffffffffffffffffffffffffff851684611988565b90505b9392505050565b60606000610ef8836119ad565b600061037c82611a09565b600060608180610f278686611a14565b909450925050505b9250929050565b602081015160005b8151811015610fd1576000828281518110610f5b57610f5b61274a565b60200260200101519050610f79816002611ad190919063ffffffff16565b15610fc85760405173ffffffffffffffffffffffffffffffffffffffff821681527fc3803387881faad271c47728894e3e36fac830ffc8602ca6fc07733cbda775809060200160405180910390a15b50600101610f3e565b50815160005b8151811015610d47576000828281518110610ff457610ff461274a565b60200260200101519050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603611064576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61106f600282611af3565b5060405173ffffffffffffffffffffffffffffffffffffffff821681527feb1b9b92e50b7f88f9ff25d56765095ac6e91540eee214906f4036a908ffbdef9060200160405180910390a150600101610fd7565b73ffffffffffffffffffffffffffffffffffffffff811661110f576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600580547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83169081179091556040519081527f7c737a8eddf62436489aa3600ed26e75e0a58b0f8c0d266bbcee64358c39fdac9060200160405180910390a150565b3373ffffffffffffffffffffffffffffffffffffffff821603611207576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c6600000000000000000060448201526064016107c5565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b81546000906112a690700100000000000000000000000000000000900463ffffffff16426128cc565b9050801561134857600183015483546112ee916fffffffffffffffffffffffffffffffff8082169281169185917001000000000000000000000000000000009091041661193c565b83546fffffffffffffffffffffffffffffffff919091167fffffffffffffffffffffffff0000000000000000000000000000000000000000909116177001000000000000000000000000000000004263ffffffff16021783555b6020820151835461136e916fffffffffffffffffffffffffffffffff9081169116611b15565b83548351151574010000000000000000000000000000000000000000027fffffffffffffffffffffff00ffffffff000000000000000000000000000000009091166fffffffffffffffffffffffffffffffff92831617178455602083015160408085015183167001000000000000000000000000000000000291909216176001850155517f9ea3374b67bf275e6bb9c8ae68f9cae023e1c528b4b27e092f0bb209d3531c199061141f9084906128df565b60405180910390a1505050565b73ffffffffffffffffffffffffffffffffffffffff811660009081526001830160205260408120541515610379565b60006103798373ffffffffffffffffffffffffffffffffffffffff8416611b2b565b60055481516040517fd02641a000000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff91821660048201526000928392169063d02641a0906024016040805180830381865afa1580156114f1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611515919061291b565b5190507bffffffffffffffffffffffffffffffffffffffffffffffffffffffff811660000361158b5782516040517f9a655f7b00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff90911660048201526024016107c5565b6020830151610ef8907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff831690611b37565b825474010000000000000000000000000000000000000000900460ff1615806115e0575081155b156115ea57505050565b825460018401546fffffffffffffffffffffffffffffffff8083169291169060009061163090700100000000000000000000000000000000900463ffffffff16426128cc565b905080156116f05781831115611672576040517f9725942a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60018601546116ac9083908590849070010000000000000000000000000000000090046fffffffffffffffffffffffffffffffff1661193c565b86547fffffffffffffffffffffffff00000000ffffffffffffffffffffffffffffffff167001000000000000000000000000000000004263ffffffff160217875592505b848210156117a75773ffffffffffffffffffffffffffffffffffffffff841661174f576040517ff94ebcd100000000000000000000000000000000000000000000000000000000815260048101839052602481018690526044016107c5565b6040517f1a76572a000000000000000000000000000000000000000000000000000000008152600481018390526024810186905273ffffffffffffffffffffffffffffffffffffffff851660448201526064016107c5565b848310156118ba5760018681015470010000000000000000000000000000000090046fffffffffffffffffffffffffffffffff169060009082906117eb90826128cc565b6117f5878a6128cc565b6117ff91906128b9565b6118099190612986565b905073ffffffffffffffffffffffffffffffffffffffff8616611862576040517f15279c0800000000000000000000000000000000000000000000000000000000815260048101829052602481018690526044016107c5565b6040517fd0c8d23a000000000000000000000000000000000000000000000000000000008152600481018290526024810186905273ffffffffffffffffffffffffffffffffffffffff871660448201526064016107c5565b6118c485846128cc565b86547fffffffffffffffffffffffffffffffff00000000000000000000000000000000166fffffffffffffffffffffffffffffffff82161787556040518681529093507f1871cdf8010e63f2eb8384381a68dfa7416dc571a5517e66e88b2d2d0c0a690a9060200160405180910390a1505050505050565b600061195b8561194c84866129c1565b61195690876128b9565b611b15565b95945050505050565b6000818152600283016020526040812061197e9082611d26565b6103798383611b74565b600082815260028401602052604081206119a28382612a7b565b50610ef58484611b80565b6060816000018054806020026020016040519081016040528092919081815260200182805480156119fd57602002820191906000526020600020905b8154815260200190600101908083116119e9575b50505050509050919050565b600061037c82611b8c565b6000606081611a238585611b96565b60008181526002870160205260409020805491925082918190611a45906129d8565b80601f0160208091040260200160405190810160405280929190818152602001828054611a71906129d8565b8015611abe5780601f10611a9357610100808354040283529160200191611abe565b820191906000526020600020905b815481529060010190602001808311611aa157829003601f168201915b5050505050905092509250509250929050565b60006103798373ffffffffffffffffffffffffffffffffffffffff8416611ba2565b60006103798373ffffffffffffffffffffffffffffffffffffffff8416611c95565b6000818310611b245781610379565b5090919050565b60006103798383611ce4565b6000670de0b6b3a7640000611b6a837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff86166129c1565b6103799190612986565b60006103798383611ba2565b60006103798383611c95565b600061037c825490565b60006103798383611cfc565b60008181526001830160205260408120548015611c8b576000611bc66001836128cc565b8554909150600090611bda906001906128cc565b9050818114611c3f576000866000018281548110611bfa57611bfa61274a565b9060005260206000200154905080876000018481548110611c1d57611c1d61274a565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080611c5057611c50612b95565b60019003818190600052602060002001600090559055856001016000868152602001908152602001600020600090556001935050505061037c565b600091505061037c565b6000818152600183016020526040812054611cdc5750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915561037c565b50600061037c565b60008181526001830160205260408120541515610379565b6000826000018281548110611d1357611d1361274a565b9060005260206000200154905092915050565b508054611d32906129d8565b6000825580601f10611d42575050565b601f0160209004906000526020600020908101906102ba91905b80821115611d705760008155600101611d5c565b5090565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040805190810167ffffffffffffffff81118282101715611dc657611dc6611d74565b60405290565b60405160a0810167ffffffffffffffff81118282101715611dc657611dc6611d74565b6040516060810167ffffffffffffffff81118282101715611dc657611dc6611d74565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715611e5957611e59611d74565b604052919050565b803567ffffffffffffffff81168114611e7957600080fd5b919050565b600082601f830112611e8f57600080fd5b813567ffffffffffffffff811115611ea957611ea9611d74565b611eda60207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f84011601611e12565b818152846020838601011115611eef57600080fd5b816020850160208301376000918101602001919091529392505050565b600067ffffffffffffffff821115611f2657611f26611d74565b5060051b60200190565b803573ffffffffffffffffffffffffffffffffffffffff81168114611e7957600080fd5b600060408284031215611f6657600080fd5b611f6e611da3565b9050611f7982611f30565b81526020820135602082015292915050565b600082601f830112611f9c57600080fd5b81356020611fb1611fac83611f0c565b611e12565b8083825260208201915060208460061b870101935086841115611fd357600080fd5b602086015b84811015611ff857611fea8882611f54565b835291830191604001611fd8565b509695505050505050565b60006020828403121561201557600080fd5b813567ffffffffffffffff8082111561202d57600080fd5b9083019060a0828603121561204157600080fd5b612049611dcc565b8235815261205960208401611e61565b602082015260408301358281111561207057600080fd5b61207c87828601611e7e565b60408301525060608301358281111561209457600080fd5b6120a087828601611e7e565b6060830152506080830135828111156120b857600080fd5b6120c487828601611f8b565b60808301525095945050505050565b80358015158114611e7957600080fd5b600080604083850312156120f657600080fd5b6120ff83611e61565b915061210d602084016120d3565b90509250929050565b6000815180845260005b8181101561213c57602081850181015186830182015201612120565b5060006020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b6020815260006103796020830184612116565b60006040828403121561219f57600080fd5b6121a7611da3565b90506121b282611e61565b81526121c060208301611f30565b602082015292915050565b600082601f8301126121dc57600080fd5b813560206121ec611fac83611f0c565b82815260059290921b8401810191818101908684111561220b57600080fd5b8286015b84811015611ff857803567ffffffffffffffff808211156122305760008081fd5b81890191506060807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0848d030112156122695760008081fd5b612271611da3565b61227d8c89860161218d565b81529083013590828211156122925760008081fd5b6122a08c8984870101611e7e565b81890152865250505091830191830161220f565b60008060408084860312156122c857600080fd5b833567ffffffffffffffff808211156122e057600080fd5b818601915086601f8301126122f457600080fd5b81356020612304611fac83611f0c565b8083825260208201915060208460061b87010193508a84111561232657600080fd5b6020860195505b8386101561234e5761233f8b8761218d565b8252948601949082019061232d565b9750505050602086013592508083111561236757600080fd5b5050612375858286016121cb565b9150509250929050565b60008151808452602080850194506020840160005b838110156123c657815173ffffffffffffffffffffffffffffffffffffffff1687529582019590820190600101612394565b509495945050505050565b602081526000610379602083018461237f565b6000602082840312156123f657600080fd5b61037982611e61565b604081526000612412604083018561237f565b6020838203818501528185518084528284019150828160051b85010183880160005b83811015612480577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe087840301855261246e838351612116565b94860194925090850190600101612434565b50909998505050505050505050565b600082601f8301126124a057600080fd5b813560206124b0611fac83611f0c565b8083825260208201915060208460051b8701019350868411156124d257600080fd5b602086015b84811015611ff8576124e881611f30565b83529183019183016124d7565b60006020828403121561250757600080fd5b813567ffffffffffffffff8082111561251f57600080fd5b908301906040828603121561253357600080fd5b61253b611da3565b82358281111561254a57600080fd5b6125568782860161248f565b82525060208301358281111561256b57600080fd5b6125778782860161248f565b60208301525095945050505050565b6000806040838503121561259957600080fd5b6125a283611e61565b9150602083013567ffffffffffffffff8111156125be57600080fd5b830160a081860312156125d057600080fd5b809150509250929050565b6000602082840312156125ed57600080fd5b61037982611f30565b80356fffffffffffffffffffffffffffffffff81168114611e7957600080fd5b6000602080838503121561262957600080fd5b823567ffffffffffffffff81111561264057600080fd5b8301601f8101851361265157600080fd5b803561265f611fac82611f0c565b81815260a0918202830184019184820191908884111561267e57600080fd5b938501935b8385101561273e578489038181121561269c5760008081fd5b6126a4611def565b6126ad87611e61565b81526126ba8888016120d3565b8882015260406060807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0850112156126f25760008081fd5b6126fa611def565b9350612707828a016120d3565b8452612714818a016125f6565b8a85015250612725608089016125f6565b8382015281019190915283529384019391850191612683565b50979650505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b67ffffffffffffffff8416815260606020820152600061279c6060830185612116565b905073ffffffffffffffffffffffffffffffffffffffff83166040830152949350505050565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe18436030181126127f757600080fd5b83018035915067ffffffffffffffff82111561281257600080fd5b6020019150600681901b3603821315610f2f57600080fd5b60006040828403121561283c57600080fd5b6103798383611f54565b821515815260808101610ef860208301848051151582526020808201516fffffffffffffffffffffffffffffffff9081169184019190915260409182015116910152565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8082018082111561037c5761037c61288a565b8181038181111561037c5761037c61288a565b6060810161037c82848051151582526020808201516fffffffffffffffffffffffffffffffff9081169184019190915260409182015116910152565b60006040828403121561292d57600080fd5b612935611da3565b82517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8116811461296157600080fd5b8152602083015163ffffffff8116811461297a57600080fd5b60208201529392505050565b6000826129bc577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b808202811582820484141761037c5761037c61288a565b600181811c908216806129ec57607f821691505b602082108103612a25577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b601f8211156105c5576000816000526020600020601f850160051c81016020861015612a545750805b601f850160051c820191505b81811015612a7357828155600101612a60565b505050505050565b815167ffffffffffffffff811115612a9557612a95611d74565b612aa981612aa384546129d8565b84612a2b565b602080601f831160018114612afc5760008415612ac65750858301515b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600386901b1c1916600185901b178555612a73565b6000858152602081207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08616915b82811015612b4957888601518255948401946001909101908401612b2a565b5085821015612b8557878501517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600388901b60f8161c191681555b5050505050600190811b01905550565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fdfe4d756c7469416767726567617465526174654c696d6974657220312e362e302d646576a164736f6c6343000818000a", +} + +var MultiAggregateRateLimiterABI = MultiAggregateRateLimiterMetaData.ABI + +var MultiAggregateRateLimiterBin = MultiAggregateRateLimiterMetaData.Bin + +func DeployMultiAggregateRateLimiter(auth *bind.TransactOpts, backend bind.ContractBackend, feeQuoter common.Address, authorizedCallers []common.Address) (common.Address, *types.Transaction, *MultiAggregateRateLimiter, error) { + parsed, err := MultiAggregateRateLimiterMetaData.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(MultiAggregateRateLimiterBin), backend, feeQuoter, authorizedCallers) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &MultiAggregateRateLimiter{address: address, abi: *parsed, MultiAggregateRateLimiterCaller: MultiAggregateRateLimiterCaller{contract: contract}, MultiAggregateRateLimiterTransactor: MultiAggregateRateLimiterTransactor{contract: contract}, MultiAggregateRateLimiterFilterer: MultiAggregateRateLimiterFilterer{contract: contract}}, nil +} + +type MultiAggregateRateLimiter struct { + address common.Address + abi abi.ABI + MultiAggregateRateLimiterCaller + MultiAggregateRateLimiterTransactor + MultiAggregateRateLimiterFilterer +} + +type MultiAggregateRateLimiterCaller struct { + contract *bind.BoundContract +} + +type MultiAggregateRateLimiterTransactor struct { + contract *bind.BoundContract +} + +type MultiAggregateRateLimiterFilterer struct { + contract *bind.BoundContract +} + +type MultiAggregateRateLimiterSession struct { + Contract *MultiAggregateRateLimiter + CallOpts bind.CallOpts + TransactOpts bind.TransactOpts +} + +type MultiAggregateRateLimiterCallerSession struct { + Contract *MultiAggregateRateLimiterCaller + CallOpts bind.CallOpts +} + +type MultiAggregateRateLimiterTransactorSession struct { + Contract *MultiAggregateRateLimiterTransactor + TransactOpts bind.TransactOpts +} + +type MultiAggregateRateLimiterRaw struct { + Contract *MultiAggregateRateLimiter +} + +type MultiAggregateRateLimiterCallerRaw struct { + Contract *MultiAggregateRateLimiterCaller +} + +type MultiAggregateRateLimiterTransactorRaw struct { + Contract *MultiAggregateRateLimiterTransactor +} + +func NewMultiAggregateRateLimiter(address common.Address, backend bind.ContractBackend) (*MultiAggregateRateLimiter, error) { + abi, err := abi.JSON(strings.NewReader(MultiAggregateRateLimiterABI)) + if err != nil { + return nil, err + } + contract, err := bindMultiAggregateRateLimiter(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &MultiAggregateRateLimiter{address: address, abi: abi, MultiAggregateRateLimiterCaller: MultiAggregateRateLimiterCaller{contract: contract}, MultiAggregateRateLimiterTransactor: MultiAggregateRateLimiterTransactor{contract: contract}, MultiAggregateRateLimiterFilterer: MultiAggregateRateLimiterFilterer{contract: contract}}, nil +} + +func NewMultiAggregateRateLimiterCaller(address common.Address, caller bind.ContractCaller) (*MultiAggregateRateLimiterCaller, error) { + contract, err := bindMultiAggregateRateLimiter(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &MultiAggregateRateLimiterCaller{contract: contract}, nil +} + +func NewMultiAggregateRateLimiterTransactor(address common.Address, transactor bind.ContractTransactor) (*MultiAggregateRateLimiterTransactor, error) { + contract, err := bindMultiAggregateRateLimiter(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &MultiAggregateRateLimiterTransactor{contract: contract}, nil +} + +func NewMultiAggregateRateLimiterFilterer(address common.Address, filterer bind.ContractFilterer) (*MultiAggregateRateLimiterFilterer, error) { + contract, err := bindMultiAggregateRateLimiter(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &MultiAggregateRateLimiterFilterer{contract: contract}, nil +} + +func bindMultiAggregateRateLimiter(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := MultiAggregateRateLimiterMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +func (_MultiAggregateRateLimiter *MultiAggregateRateLimiterRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _MultiAggregateRateLimiter.Contract.MultiAggregateRateLimiterCaller.contract.Call(opts, result, method, params...) +} + +func (_MultiAggregateRateLimiter *MultiAggregateRateLimiterRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _MultiAggregateRateLimiter.Contract.MultiAggregateRateLimiterTransactor.contract.Transfer(opts) +} + +func (_MultiAggregateRateLimiter *MultiAggregateRateLimiterRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _MultiAggregateRateLimiter.Contract.MultiAggregateRateLimiterTransactor.contract.Transact(opts, method, params...) +} + +func (_MultiAggregateRateLimiter *MultiAggregateRateLimiterCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _MultiAggregateRateLimiter.Contract.contract.Call(opts, result, method, params...) +} + +func (_MultiAggregateRateLimiter *MultiAggregateRateLimiterTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _MultiAggregateRateLimiter.Contract.contract.Transfer(opts) +} + +func (_MultiAggregateRateLimiter *MultiAggregateRateLimiterTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _MultiAggregateRateLimiter.Contract.contract.Transact(opts, method, params...) +} + +func (_MultiAggregateRateLimiter *MultiAggregateRateLimiterCaller) CurrentRateLimiterState(opts *bind.CallOpts, remoteChainSelector uint64, isOutboundLane bool) (RateLimiterTokenBucket, error) { + var out []interface{} + err := _MultiAggregateRateLimiter.contract.Call(opts, &out, "currentRateLimiterState", remoteChainSelector, isOutboundLane) + + if err != nil { + return *new(RateLimiterTokenBucket), err + } + + out0 := *abi.ConvertType(out[0], new(RateLimiterTokenBucket)).(*RateLimiterTokenBucket) + + return out0, err + +} + +func (_MultiAggregateRateLimiter *MultiAggregateRateLimiterSession) CurrentRateLimiterState(remoteChainSelector uint64, isOutboundLane bool) (RateLimiterTokenBucket, error) { + return _MultiAggregateRateLimiter.Contract.CurrentRateLimiterState(&_MultiAggregateRateLimiter.CallOpts, remoteChainSelector, isOutboundLane) +} + +func (_MultiAggregateRateLimiter *MultiAggregateRateLimiterCallerSession) CurrentRateLimiterState(remoteChainSelector uint64, isOutboundLane bool) (RateLimiterTokenBucket, error) { + return _MultiAggregateRateLimiter.Contract.CurrentRateLimiterState(&_MultiAggregateRateLimiter.CallOpts, remoteChainSelector, isOutboundLane) +} + +func (_MultiAggregateRateLimiter *MultiAggregateRateLimiterCaller) GetAllAuthorizedCallers(opts *bind.CallOpts) ([]common.Address, error) { + var out []interface{} + err := _MultiAggregateRateLimiter.contract.Call(opts, &out, "getAllAuthorizedCallers") + + if err != nil { + return *new([]common.Address), err + } + + out0 := *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) + + return out0, err + +} + +func (_MultiAggregateRateLimiter *MultiAggregateRateLimiterSession) GetAllAuthorizedCallers() ([]common.Address, error) { + return _MultiAggregateRateLimiter.Contract.GetAllAuthorizedCallers(&_MultiAggregateRateLimiter.CallOpts) +} + +func (_MultiAggregateRateLimiter *MultiAggregateRateLimiterCallerSession) GetAllAuthorizedCallers() ([]common.Address, error) { + return _MultiAggregateRateLimiter.Contract.GetAllAuthorizedCallers(&_MultiAggregateRateLimiter.CallOpts) +} + +func (_MultiAggregateRateLimiter *MultiAggregateRateLimiterCaller) GetAllRateLimitTokens(opts *bind.CallOpts, remoteChainSelector uint64) (GetAllRateLimitTokens, + + error) { + var out []interface{} + err := _MultiAggregateRateLimiter.contract.Call(opts, &out, "getAllRateLimitTokens", remoteChainSelector) + + outstruct := new(GetAllRateLimitTokens) + if err != nil { + return *outstruct, err + } + + outstruct.LocalTokens = *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) + outstruct.RemoteTokens = *abi.ConvertType(out[1], new([][]byte)).(*[][]byte) + + return *outstruct, err + +} + +func (_MultiAggregateRateLimiter *MultiAggregateRateLimiterSession) GetAllRateLimitTokens(remoteChainSelector uint64) (GetAllRateLimitTokens, + + error) { + return _MultiAggregateRateLimiter.Contract.GetAllRateLimitTokens(&_MultiAggregateRateLimiter.CallOpts, remoteChainSelector) +} + +func (_MultiAggregateRateLimiter *MultiAggregateRateLimiterCallerSession) GetAllRateLimitTokens(remoteChainSelector uint64) (GetAllRateLimitTokens, + + error) { + return _MultiAggregateRateLimiter.Contract.GetAllRateLimitTokens(&_MultiAggregateRateLimiter.CallOpts, remoteChainSelector) +} + +func (_MultiAggregateRateLimiter *MultiAggregateRateLimiterCaller) GetFeeQuoter(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _MultiAggregateRateLimiter.contract.Call(opts, &out, "getFeeQuoter") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_MultiAggregateRateLimiter *MultiAggregateRateLimiterSession) GetFeeQuoter() (common.Address, error) { + return _MultiAggregateRateLimiter.Contract.GetFeeQuoter(&_MultiAggregateRateLimiter.CallOpts) +} + +func (_MultiAggregateRateLimiter *MultiAggregateRateLimiterCallerSession) GetFeeQuoter() (common.Address, error) { + return _MultiAggregateRateLimiter.Contract.GetFeeQuoter(&_MultiAggregateRateLimiter.CallOpts) +} + +func (_MultiAggregateRateLimiter *MultiAggregateRateLimiterCaller) Owner(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _MultiAggregateRateLimiter.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 + +} + +func (_MultiAggregateRateLimiter *MultiAggregateRateLimiterSession) Owner() (common.Address, error) { + return _MultiAggregateRateLimiter.Contract.Owner(&_MultiAggregateRateLimiter.CallOpts) +} + +func (_MultiAggregateRateLimiter *MultiAggregateRateLimiterCallerSession) Owner() (common.Address, error) { + return _MultiAggregateRateLimiter.Contract.Owner(&_MultiAggregateRateLimiter.CallOpts) +} + +func (_MultiAggregateRateLimiter *MultiAggregateRateLimiterCaller) TypeAndVersion(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _MultiAggregateRateLimiter.contract.Call(opts, &out, "typeAndVersion") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +func (_MultiAggregateRateLimiter *MultiAggregateRateLimiterSession) TypeAndVersion() (string, error) { + return _MultiAggregateRateLimiter.Contract.TypeAndVersion(&_MultiAggregateRateLimiter.CallOpts) +} + +func (_MultiAggregateRateLimiter *MultiAggregateRateLimiterCallerSession) TypeAndVersion() (string, error) { + return _MultiAggregateRateLimiter.Contract.TypeAndVersion(&_MultiAggregateRateLimiter.CallOpts) +} + +func (_MultiAggregateRateLimiter *MultiAggregateRateLimiterTransactor) AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + return _MultiAggregateRateLimiter.contract.Transact(opts, "acceptOwnership") +} + +func (_MultiAggregateRateLimiter *MultiAggregateRateLimiterSession) AcceptOwnership() (*types.Transaction, error) { + return _MultiAggregateRateLimiter.Contract.AcceptOwnership(&_MultiAggregateRateLimiter.TransactOpts) +} + +func (_MultiAggregateRateLimiter *MultiAggregateRateLimiterTransactorSession) AcceptOwnership() (*types.Transaction, error) { + return _MultiAggregateRateLimiter.Contract.AcceptOwnership(&_MultiAggregateRateLimiter.TransactOpts) +} + +func (_MultiAggregateRateLimiter *MultiAggregateRateLimiterTransactor) ApplyAuthorizedCallerUpdates(opts *bind.TransactOpts, authorizedCallerArgs AuthorizedCallersAuthorizedCallerArgs) (*types.Transaction, error) { + return _MultiAggregateRateLimiter.contract.Transact(opts, "applyAuthorizedCallerUpdates", authorizedCallerArgs) +} + +func (_MultiAggregateRateLimiter *MultiAggregateRateLimiterSession) ApplyAuthorizedCallerUpdates(authorizedCallerArgs AuthorizedCallersAuthorizedCallerArgs) (*types.Transaction, error) { + return _MultiAggregateRateLimiter.Contract.ApplyAuthorizedCallerUpdates(&_MultiAggregateRateLimiter.TransactOpts, authorizedCallerArgs) +} + +func (_MultiAggregateRateLimiter *MultiAggregateRateLimiterTransactorSession) ApplyAuthorizedCallerUpdates(authorizedCallerArgs AuthorizedCallersAuthorizedCallerArgs) (*types.Transaction, error) { + return _MultiAggregateRateLimiter.Contract.ApplyAuthorizedCallerUpdates(&_MultiAggregateRateLimiter.TransactOpts, authorizedCallerArgs) +} + +func (_MultiAggregateRateLimiter *MultiAggregateRateLimiterTransactor) ApplyRateLimiterConfigUpdates(opts *bind.TransactOpts, rateLimiterUpdates []MultiAggregateRateLimiterRateLimiterConfigArgs) (*types.Transaction, error) { + return _MultiAggregateRateLimiter.contract.Transact(opts, "applyRateLimiterConfigUpdates", rateLimiterUpdates) +} + +func (_MultiAggregateRateLimiter *MultiAggregateRateLimiterSession) ApplyRateLimiterConfigUpdates(rateLimiterUpdates []MultiAggregateRateLimiterRateLimiterConfigArgs) (*types.Transaction, error) { + return _MultiAggregateRateLimiter.Contract.ApplyRateLimiterConfigUpdates(&_MultiAggregateRateLimiter.TransactOpts, rateLimiterUpdates) +} + +func (_MultiAggregateRateLimiter *MultiAggregateRateLimiterTransactorSession) ApplyRateLimiterConfigUpdates(rateLimiterUpdates []MultiAggregateRateLimiterRateLimiterConfigArgs) (*types.Transaction, error) { + return _MultiAggregateRateLimiter.Contract.ApplyRateLimiterConfigUpdates(&_MultiAggregateRateLimiter.TransactOpts, rateLimiterUpdates) +} + +func (_MultiAggregateRateLimiter *MultiAggregateRateLimiterTransactor) OnInboundMessage(opts *bind.TransactOpts, message ClientAny2EVMMessage) (*types.Transaction, error) { + return _MultiAggregateRateLimiter.contract.Transact(opts, "onInboundMessage", message) +} + +func (_MultiAggregateRateLimiter *MultiAggregateRateLimiterSession) OnInboundMessage(message ClientAny2EVMMessage) (*types.Transaction, error) { + return _MultiAggregateRateLimiter.Contract.OnInboundMessage(&_MultiAggregateRateLimiter.TransactOpts, message) +} + +func (_MultiAggregateRateLimiter *MultiAggregateRateLimiterTransactorSession) OnInboundMessage(message ClientAny2EVMMessage) (*types.Transaction, error) { + return _MultiAggregateRateLimiter.Contract.OnInboundMessage(&_MultiAggregateRateLimiter.TransactOpts, message) +} + +func (_MultiAggregateRateLimiter *MultiAggregateRateLimiterTransactor) OnOutboundMessage(opts *bind.TransactOpts, destChainSelector uint64, message ClientEVM2AnyMessage) (*types.Transaction, error) { + return _MultiAggregateRateLimiter.contract.Transact(opts, "onOutboundMessage", destChainSelector, message) +} + +func (_MultiAggregateRateLimiter *MultiAggregateRateLimiterSession) OnOutboundMessage(destChainSelector uint64, message ClientEVM2AnyMessage) (*types.Transaction, error) { + return _MultiAggregateRateLimiter.Contract.OnOutboundMessage(&_MultiAggregateRateLimiter.TransactOpts, destChainSelector, message) +} + +func (_MultiAggregateRateLimiter *MultiAggregateRateLimiterTransactorSession) OnOutboundMessage(destChainSelector uint64, message ClientEVM2AnyMessage) (*types.Transaction, error) { + return _MultiAggregateRateLimiter.Contract.OnOutboundMessage(&_MultiAggregateRateLimiter.TransactOpts, destChainSelector, message) +} + +func (_MultiAggregateRateLimiter *MultiAggregateRateLimiterTransactor) SetFeeQuoter(opts *bind.TransactOpts, newFeeQuoter common.Address) (*types.Transaction, error) { + return _MultiAggregateRateLimiter.contract.Transact(opts, "setFeeQuoter", newFeeQuoter) +} + +func (_MultiAggregateRateLimiter *MultiAggregateRateLimiterSession) SetFeeQuoter(newFeeQuoter common.Address) (*types.Transaction, error) { + return _MultiAggregateRateLimiter.Contract.SetFeeQuoter(&_MultiAggregateRateLimiter.TransactOpts, newFeeQuoter) +} + +func (_MultiAggregateRateLimiter *MultiAggregateRateLimiterTransactorSession) SetFeeQuoter(newFeeQuoter common.Address) (*types.Transaction, error) { + return _MultiAggregateRateLimiter.Contract.SetFeeQuoter(&_MultiAggregateRateLimiter.TransactOpts, newFeeQuoter) +} + +func (_MultiAggregateRateLimiter *MultiAggregateRateLimiterTransactor) TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) { + return _MultiAggregateRateLimiter.contract.Transact(opts, "transferOwnership", to) +} + +func (_MultiAggregateRateLimiter *MultiAggregateRateLimiterSession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _MultiAggregateRateLimiter.Contract.TransferOwnership(&_MultiAggregateRateLimiter.TransactOpts, to) +} + +func (_MultiAggregateRateLimiter *MultiAggregateRateLimiterTransactorSession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _MultiAggregateRateLimiter.Contract.TransferOwnership(&_MultiAggregateRateLimiter.TransactOpts, to) +} + +func (_MultiAggregateRateLimiter *MultiAggregateRateLimiterTransactor) UpdateRateLimitTokens(opts *bind.TransactOpts, removes []MultiAggregateRateLimiterLocalRateLimitToken, adds []MultiAggregateRateLimiterRateLimitTokenArgs) (*types.Transaction, error) { + return _MultiAggregateRateLimiter.contract.Transact(opts, "updateRateLimitTokens", removes, adds) +} + +func (_MultiAggregateRateLimiter *MultiAggregateRateLimiterSession) UpdateRateLimitTokens(removes []MultiAggregateRateLimiterLocalRateLimitToken, adds []MultiAggregateRateLimiterRateLimitTokenArgs) (*types.Transaction, error) { + return _MultiAggregateRateLimiter.Contract.UpdateRateLimitTokens(&_MultiAggregateRateLimiter.TransactOpts, removes, adds) +} + +func (_MultiAggregateRateLimiter *MultiAggregateRateLimiterTransactorSession) UpdateRateLimitTokens(removes []MultiAggregateRateLimiterLocalRateLimitToken, adds []MultiAggregateRateLimiterRateLimitTokenArgs) (*types.Transaction, error) { + return _MultiAggregateRateLimiter.Contract.UpdateRateLimitTokens(&_MultiAggregateRateLimiter.TransactOpts, removes, adds) +} + +type MultiAggregateRateLimiterAuthorizedCallerAddedIterator struct { + Event *MultiAggregateRateLimiterAuthorizedCallerAdded + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *MultiAggregateRateLimiterAuthorizedCallerAddedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(MultiAggregateRateLimiterAuthorizedCallerAdded) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(MultiAggregateRateLimiterAuthorizedCallerAdded) + 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() + } +} + +func (it *MultiAggregateRateLimiterAuthorizedCallerAddedIterator) Error() error { + return it.fail +} + +func (it *MultiAggregateRateLimiterAuthorizedCallerAddedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type MultiAggregateRateLimiterAuthorizedCallerAdded struct { + Caller common.Address + Raw types.Log +} + +func (_MultiAggregateRateLimiter *MultiAggregateRateLimiterFilterer) FilterAuthorizedCallerAdded(opts *bind.FilterOpts) (*MultiAggregateRateLimiterAuthorizedCallerAddedIterator, error) { + + logs, sub, err := _MultiAggregateRateLimiter.contract.FilterLogs(opts, "AuthorizedCallerAdded") + if err != nil { + return nil, err + } + return &MultiAggregateRateLimiterAuthorizedCallerAddedIterator{contract: _MultiAggregateRateLimiter.contract, event: "AuthorizedCallerAdded", logs: logs, sub: sub}, nil +} + +func (_MultiAggregateRateLimiter *MultiAggregateRateLimiterFilterer) WatchAuthorizedCallerAdded(opts *bind.WatchOpts, sink chan<- *MultiAggregateRateLimiterAuthorizedCallerAdded) (event.Subscription, error) { + + logs, sub, err := _MultiAggregateRateLimiter.contract.WatchLogs(opts, "AuthorizedCallerAdded") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(MultiAggregateRateLimiterAuthorizedCallerAdded) + if err := _MultiAggregateRateLimiter.contract.UnpackLog(event, "AuthorizedCallerAdded", 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 +} + +func (_MultiAggregateRateLimiter *MultiAggregateRateLimiterFilterer) ParseAuthorizedCallerAdded(log types.Log) (*MultiAggregateRateLimiterAuthorizedCallerAdded, error) { + event := new(MultiAggregateRateLimiterAuthorizedCallerAdded) + if err := _MultiAggregateRateLimiter.contract.UnpackLog(event, "AuthorizedCallerAdded", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type MultiAggregateRateLimiterAuthorizedCallerRemovedIterator struct { + Event *MultiAggregateRateLimiterAuthorizedCallerRemoved + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *MultiAggregateRateLimiterAuthorizedCallerRemovedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(MultiAggregateRateLimiterAuthorizedCallerRemoved) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(MultiAggregateRateLimiterAuthorizedCallerRemoved) + 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() + } +} + +func (it *MultiAggregateRateLimiterAuthorizedCallerRemovedIterator) Error() error { + return it.fail +} + +func (it *MultiAggregateRateLimiterAuthorizedCallerRemovedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type MultiAggregateRateLimiterAuthorizedCallerRemoved struct { + Caller common.Address + Raw types.Log +} + +func (_MultiAggregateRateLimiter *MultiAggregateRateLimiterFilterer) FilterAuthorizedCallerRemoved(opts *bind.FilterOpts) (*MultiAggregateRateLimiterAuthorizedCallerRemovedIterator, error) { + + logs, sub, err := _MultiAggregateRateLimiter.contract.FilterLogs(opts, "AuthorizedCallerRemoved") + if err != nil { + return nil, err + } + return &MultiAggregateRateLimiterAuthorizedCallerRemovedIterator{contract: _MultiAggregateRateLimiter.contract, event: "AuthorizedCallerRemoved", logs: logs, sub: sub}, nil +} + +func (_MultiAggregateRateLimiter *MultiAggregateRateLimiterFilterer) WatchAuthorizedCallerRemoved(opts *bind.WatchOpts, sink chan<- *MultiAggregateRateLimiterAuthorizedCallerRemoved) (event.Subscription, error) { + + logs, sub, err := _MultiAggregateRateLimiter.contract.WatchLogs(opts, "AuthorizedCallerRemoved") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(MultiAggregateRateLimiterAuthorizedCallerRemoved) + if err := _MultiAggregateRateLimiter.contract.UnpackLog(event, "AuthorizedCallerRemoved", 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 +} + +func (_MultiAggregateRateLimiter *MultiAggregateRateLimiterFilterer) ParseAuthorizedCallerRemoved(log types.Log) (*MultiAggregateRateLimiterAuthorizedCallerRemoved, error) { + event := new(MultiAggregateRateLimiterAuthorizedCallerRemoved) + if err := _MultiAggregateRateLimiter.contract.UnpackLog(event, "AuthorizedCallerRemoved", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type MultiAggregateRateLimiterConfigChangedIterator struct { + Event *MultiAggregateRateLimiterConfigChanged + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *MultiAggregateRateLimiterConfigChangedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(MultiAggregateRateLimiterConfigChanged) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(MultiAggregateRateLimiterConfigChanged) + 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() + } +} + +func (it *MultiAggregateRateLimiterConfigChangedIterator) Error() error { + return it.fail +} + +func (it *MultiAggregateRateLimiterConfigChangedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type MultiAggregateRateLimiterConfigChanged struct { + Config RateLimiterConfig + Raw types.Log +} + +func (_MultiAggregateRateLimiter *MultiAggregateRateLimiterFilterer) FilterConfigChanged(opts *bind.FilterOpts) (*MultiAggregateRateLimiterConfigChangedIterator, error) { + + logs, sub, err := _MultiAggregateRateLimiter.contract.FilterLogs(opts, "ConfigChanged") + if err != nil { + return nil, err + } + return &MultiAggregateRateLimiterConfigChangedIterator{contract: _MultiAggregateRateLimiter.contract, event: "ConfigChanged", logs: logs, sub: sub}, nil +} + +func (_MultiAggregateRateLimiter *MultiAggregateRateLimiterFilterer) WatchConfigChanged(opts *bind.WatchOpts, sink chan<- *MultiAggregateRateLimiterConfigChanged) (event.Subscription, error) { + + logs, sub, err := _MultiAggregateRateLimiter.contract.WatchLogs(opts, "ConfigChanged") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(MultiAggregateRateLimiterConfigChanged) + if err := _MultiAggregateRateLimiter.contract.UnpackLog(event, "ConfigChanged", 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 +} + +func (_MultiAggregateRateLimiter *MultiAggregateRateLimiterFilterer) ParseConfigChanged(log types.Log) (*MultiAggregateRateLimiterConfigChanged, error) { + event := new(MultiAggregateRateLimiterConfigChanged) + if err := _MultiAggregateRateLimiter.contract.UnpackLog(event, "ConfigChanged", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type MultiAggregateRateLimiterFeeQuoterSetIterator struct { + Event *MultiAggregateRateLimiterFeeQuoterSet + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *MultiAggregateRateLimiterFeeQuoterSetIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(MultiAggregateRateLimiterFeeQuoterSet) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(MultiAggregateRateLimiterFeeQuoterSet) + 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() + } +} + +func (it *MultiAggregateRateLimiterFeeQuoterSetIterator) Error() error { + return it.fail +} + +func (it *MultiAggregateRateLimiterFeeQuoterSetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type MultiAggregateRateLimiterFeeQuoterSet struct { + NewFeeQuoter common.Address + Raw types.Log +} + +func (_MultiAggregateRateLimiter *MultiAggregateRateLimiterFilterer) FilterFeeQuoterSet(opts *bind.FilterOpts) (*MultiAggregateRateLimiterFeeQuoterSetIterator, error) { + + logs, sub, err := _MultiAggregateRateLimiter.contract.FilterLogs(opts, "FeeQuoterSet") + if err != nil { + return nil, err + } + return &MultiAggregateRateLimiterFeeQuoterSetIterator{contract: _MultiAggregateRateLimiter.contract, event: "FeeQuoterSet", logs: logs, sub: sub}, nil +} + +func (_MultiAggregateRateLimiter *MultiAggregateRateLimiterFilterer) WatchFeeQuoterSet(opts *bind.WatchOpts, sink chan<- *MultiAggregateRateLimiterFeeQuoterSet) (event.Subscription, error) { + + logs, sub, err := _MultiAggregateRateLimiter.contract.WatchLogs(opts, "FeeQuoterSet") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(MultiAggregateRateLimiterFeeQuoterSet) + if err := _MultiAggregateRateLimiter.contract.UnpackLog(event, "FeeQuoterSet", 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 +} + +func (_MultiAggregateRateLimiter *MultiAggregateRateLimiterFilterer) ParseFeeQuoterSet(log types.Log) (*MultiAggregateRateLimiterFeeQuoterSet, error) { + event := new(MultiAggregateRateLimiterFeeQuoterSet) + if err := _MultiAggregateRateLimiter.contract.UnpackLog(event, "FeeQuoterSet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type MultiAggregateRateLimiterOwnershipTransferRequestedIterator struct { + Event *MultiAggregateRateLimiterOwnershipTransferRequested + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *MultiAggregateRateLimiterOwnershipTransferRequestedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(MultiAggregateRateLimiterOwnershipTransferRequested) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(MultiAggregateRateLimiterOwnershipTransferRequested) + 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() + } +} + +func (it *MultiAggregateRateLimiterOwnershipTransferRequestedIterator) Error() error { + return it.fail +} + +func (it *MultiAggregateRateLimiterOwnershipTransferRequestedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type MultiAggregateRateLimiterOwnershipTransferRequested struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_MultiAggregateRateLimiter *MultiAggregateRateLimiterFilterer) FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*MultiAggregateRateLimiterOwnershipTransferRequestedIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _MultiAggregateRateLimiter.contract.FilterLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return &MultiAggregateRateLimiterOwnershipTransferRequestedIterator{contract: _MultiAggregateRateLimiter.contract, event: "OwnershipTransferRequested", logs: logs, sub: sub}, nil +} + +func (_MultiAggregateRateLimiter *MultiAggregateRateLimiterFilterer) WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *MultiAggregateRateLimiterOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _MultiAggregateRateLimiter.contract.WatchLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(MultiAggregateRateLimiterOwnershipTransferRequested) + if err := _MultiAggregateRateLimiter.contract.UnpackLog(event, "OwnershipTransferRequested", 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 +} + +func (_MultiAggregateRateLimiter *MultiAggregateRateLimiterFilterer) ParseOwnershipTransferRequested(log types.Log) (*MultiAggregateRateLimiterOwnershipTransferRequested, error) { + event := new(MultiAggregateRateLimiterOwnershipTransferRequested) + if err := _MultiAggregateRateLimiter.contract.UnpackLog(event, "OwnershipTransferRequested", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type MultiAggregateRateLimiterOwnershipTransferredIterator struct { + Event *MultiAggregateRateLimiterOwnershipTransferred + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *MultiAggregateRateLimiterOwnershipTransferredIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(MultiAggregateRateLimiterOwnershipTransferred) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(MultiAggregateRateLimiterOwnershipTransferred) + 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() + } +} + +func (it *MultiAggregateRateLimiterOwnershipTransferredIterator) Error() error { + return it.fail +} + +func (it *MultiAggregateRateLimiterOwnershipTransferredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type MultiAggregateRateLimiterOwnershipTransferred struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_MultiAggregateRateLimiter *MultiAggregateRateLimiterFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*MultiAggregateRateLimiterOwnershipTransferredIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _MultiAggregateRateLimiter.contract.FilterLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return &MultiAggregateRateLimiterOwnershipTransferredIterator{contract: _MultiAggregateRateLimiter.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil +} + +func (_MultiAggregateRateLimiter *MultiAggregateRateLimiterFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *MultiAggregateRateLimiterOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _MultiAggregateRateLimiter.contract.WatchLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(MultiAggregateRateLimiterOwnershipTransferred) + if err := _MultiAggregateRateLimiter.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 +} + +func (_MultiAggregateRateLimiter *MultiAggregateRateLimiterFilterer) ParseOwnershipTransferred(log types.Log) (*MultiAggregateRateLimiterOwnershipTransferred, error) { + event := new(MultiAggregateRateLimiterOwnershipTransferred) + if err := _MultiAggregateRateLimiter.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type MultiAggregateRateLimiterRateLimiterConfigUpdatedIterator struct { + Event *MultiAggregateRateLimiterRateLimiterConfigUpdated + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *MultiAggregateRateLimiterRateLimiterConfigUpdatedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(MultiAggregateRateLimiterRateLimiterConfigUpdated) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(MultiAggregateRateLimiterRateLimiterConfigUpdated) + 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() + } +} + +func (it *MultiAggregateRateLimiterRateLimiterConfigUpdatedIterator) Error() error { + return it.fail +} + +func (it *MultiAggregateRateLimiterRateLimiterConfigUpdatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type MultiAggregateRateLimiterRateLimiterConfigUpdated struct { + RemoteChainSelector uint64 + IsOutboundLane bool + Config RateLimiterConfig + Raw types.Log +} + +func (_MultiAggregateRateLimiter *MultiAggregateRateLimiterFilterer) FilterRateLimiterConfigUpdated(opts *bind.FilterOpts, remoteChainSelector []uint64) (*MultiAggregateRateLimiterRateLimiterConfigUpdatedIterator, error) { + + var remoteChainSelectorRule []interface{} + for _, remoteChainSelectorItem := range remoteChainSelector { + remoteChainSelectorRule = append(remoteChainSelectorRule, remoteChainSelectorItem) + } + + logs, sub, err := _MultiAggregateRateLimiter.contract.FilterLogs(opts, "RateLimiterConfigUpdated", remoteChainSelectorRule) + if err != nil { + return nil, err + } + return &MultiAggregateRateLimiterRateLimiterConfigUpdatedIterator{contract: _MultiAggregateRateLimiter.contract, event: "RateLimiterConfigUpdated", logs: logs, sub: sub}, nil +} + +func (_MultiAggregateRateLimiter *MultiAggregateRateLimiterFilterer) WatchRateLimiterConfigUpdated(opts *bind.WatchOpts, sink chan<- *MultiAggregateRateLimiterRateLimiterConfigUpdated, remoteChainSelector []uint64) (event.Subscription, error) { + + var remoteChainSelectorRule []interface{} + for _, remoteChainSelectorItem := range remoteChainSelector { + remoteChainSelectorRule = append(remoteChainSelectorRule, remoteChainSelectorItem) + } + + logs, sub, err := _MultiAggregateRateLimiter.contract.WatchLogs(opts, "RateLimiterConfigUpdated", remoteChainSelectorRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(MultiAggregateRateLimiterRateLimiterConfigUpdated) + if err := _MultiAggregateRateLimiter.contract.UnpackLog(event, "RateLimiterConfigUpdated", 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 +} + +func (_MultiAggregateRateLimiter *MultiAggregateRateLimiterFilterer) ParseRateLimiterConfigUpdated(log types.Log) (*MultiAggregateRateLimiterRateLimiterConfigUpdated, error) { + event := new(MultiAggregateRateLimiterRateLimiterConfigUpdated) + if err := _MultiAggregateRateLimiter.contract.UnpackLog(event, "RateLimiterConfigUpdated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type MultiAggregateRateLimiterTokenAggregateRateLimitAddedIterator struct { + Event *MultiAggregateRateLimiterTokenAggregateRateLimitAdded + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *MultiAggregateRateLimiterTokenAggregateRateLimitAddedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(MultiAggregateRateLimiterTokenAggregateRateLimitAdded) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(MultiAggregateRateLimiterTokenAggregateRateLimitAdded) + 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() + } +} + +func (it *MultiAggregateRateLimiterTokenAggregateRateLimitAddedIterator) Error() error { + return it.fail +} + +func (it *MultiAggregateRateLimiterTokenAggregateRateLimitAddedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type MultiAggregateRateLimiterTokenAggregateRateLimitAdded struct { + RemoteChainSelector uint64 + RemoteToken []byte + LocalToken common.Address + Raw types.Log +} + +func (_MultiAggregateRateLimiter *MultiAggregateRateLimiterFilterer) FilterTokenAggregateRateLimitAdded(opts *bind.FilterOpts) (*MultiAggregateRateLimiterTokenAggregateRateLimitAddedIterator, error) { + + logs, sub, err := _MultiAggregateRateLimiter.contract.FilterLogs(opts, "TokenAggregateRateLimitAdded") + if err != nil { + return nil, err + } + return &MultiAggregateRateLimiterTokenAggregateRateLimitAddedIterator{contract: _MultiAggregateRateLimiter.contract, event: "TokenAggregateRateLimitAdded", logs: logs, sub: sub}, nil +} + +func (_MultiAggregateRateLimiter *MultiAggregateRateLimiterFilterer) WatchTokenAggregateRateLimitAdded(opts *bind.WatchOpts, sink chan<- *MultiAggregateRateLimiterTokenAggregateRateLimitAdded) (event.Subscription, error) { + + logs, sub, err := _MultiAggregateRateLimiter.contract.WatchLogs(opts, "TokenAggregateRateLimitAdded") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(MultiAggregateRateLimiterTokenAggregateRateLimitAdded) + if err := _MultiAggregateRateLimiter.contract.UnpackLog(event, "TokenAggregateRateLimitAdded", 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 +} + +func (_MultiAggregateRateLimiter *MultiAggregateRateLimiterFilterer) ParseTokenAggregateRateLimitAdded(log types.Log) (*MultiAggregateRateLimiterTokenAggregateRateLimitAdded, error) { + event := new(MultiAggregateRateLimiterTokenAggregateRateLimitAdded) + if err := _MultiAggregateRateLimiter.contract.UnpackLog(event, "TokenAggregateRateLimitAdded", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type MultiAggregateRateLimiterTokenAggregateRateLimitRemovedIterator struct { + Event *MultiAggregateRateLimiterTokenAggregateRateLimitRemoved + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *MultiAggregateRateLimiterTokenAggregateRateLimitRemovedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(MultiAggregateRateLimiterTokenAggregateRateLimitRemoved) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(MultiAggregateRateLimiterTokenAggregateRateLimitRemoved) + 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() + } +} + +func (it *MultiAggregateRateLimiterTokenAggregateRateLimitRemovedIterator) Error() error { + return it.fail +} + +func (it *MultiAggregateRateLimiterTokenAggregateRateLimitRemovedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type MultiAggregateRateLimiterTokenAggregateRateLimitRemoved struct { + RemoteChainSelector uint64 + LocalToken common.Address + Raw types.Log +} + +func (_MultiAggregateRateLimiter *MultiAggregateRateLimiterFilterer) FilterTokenAggregateRateLimitRemoved(opts *bind.FilterOpts) (*MultiAggregateRateLimiterTokenAggregateRateLimitRemovedIterator, error) { + + logs, sub, err := _MultiAggregateRateLimiter.contract.FilterLogs(opts, "TokenAggregateRateLimitRemoved") + if err != nil { + return nil, err + } + return &MultiAggregateRateLimiterTokenAggregateRateLimitRemovedIterator{contract: _MultiAggregateRateLimiter.contract, event: "TokenAggregateRateLimitRemoved", logs: logs, sub: sub}, nil +} + +func (_MultiAggregateRateLimiter *MultiAggregateRateLimiterFilterer) WatchTokenAggregateRateLimitRemoved(opts *bind.WatchOpts, sink chan<- *MultiAggregateRateLimiterTokenAggregateRateLimitRemoved) (event.Subscription, error) { + + logs, sub, err := _MultiAggregateRateLimiter.contract.WatchLogs(opts, "TokenAggregateRateLimitRemoved") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(MultiAggregateRateLimiterTokenAggregateRateLimitRemoved) + if err := _MultiAggregateRateLimiter.contract.UnpackLog(event, "TokenAggregateRateLimitRemoved", 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 +} + +func (_MultiAggregateRateLimiter *MultiAggregateRateLimiterFilterer) ParseTokenAggregateRateLimitRemoved(log types.Log) (*MultiAggregateRateLimiterTokenAggregateRateLimitRemoved, error) { + event := new(MultiAggregateRateLimiterTokenAggregateRateLimitRemoved) + if err := _MultiAggregateRateLimiter.contract.UnpackLog(event, "TokenAggregateRateLimitRemoved", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type MultiAggregateRateLimiterTokensConsumedIterator struct { + Event *MultiAggregateRateLimiterTokensConsumed + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *MultiAggregateRateLimiterTokensConsumedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(MultiAggregateRateLimiterTokensConsumed) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(MultiAggregateRateLimiterTokensConsumed) + 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() + } +} + +func (it *MultiAggregateRateLimiterTokensConsumedIterator) Error() error { + return it.fail +} + +func (it *MultiAggregateRateLimiterTokensConsumedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type MultiAggregateRateLimiterTokensConsumed struct { + Tokens *big.Int + Raw types.Log +} + +func (_MultiAggregateRateLimiter *MultiAggregateRateLimiterFilterer) FilterTokensConsumed(opts *bind.FilterOpts) (*MultiAggregateRateLimiterTokensConsumedIterator, error) { + + logs, sub, err := _MultiAggregateRateLimiter.contract.FilterLogs(opts, "TokensConsumed") + if err != nil { + return nil, err + } + return &MultiAggregateRateLimiterTokensConsumedIterator{contract: _MultiAggregateRateLimiter.contract, event: "TokensConsumed", logs: logs, sub: sub}, nil +} + +func (_MultiAggregateRateLimiter *MultiAggregateRateLimiterFilterer) WatchTokensConsumed(opts *bind.WatchOpts, sink chan<- *MultiAggregateRateLimiterTokensConsumed) (event.Subscription, error) { + + logs, sub, err := _MultiAggregateRateLimiter.contract.WatchLogs(opts, "TokensConsumed") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(MultiAggregateRateLimiterTokensConsumed) + if err := _MultiAggregateRateLimiter.contract.UnpackLog(event, "TokensConsumed", 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 +} + +func (_MultiAggregateRateLimiter *MultiAggregateRateLimiterFilterer) ParseTokensConsumed(log types.Log) (*MultiAggregateRateLimiterTokensConsumed, error) { + event := new(MultiAggregateRateLimiterTokensConsumed) + if err := _MultiAggregateRateLimiter.contract.UnpackLog(event, "TokensConsumed", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type GetAllRateLimitTokens struct { + LocalTokens []common.Address + RemoteTokens [][]byte +} + +func (_MultiAggregateRateLimiter *MultiAggregateRateLimiter) ParseLog(log types.Log) (generated.AbigenLog, error) { + switch log.Topics[0] { + case _MultiAggregateRateLimiter.abi.Events["AuthorizedCallerAdded"].ID: + return _MultiAggregateRateLimiter.ParseAuthorizedCallerAdded(log) + case _MultiAggregateRateLimiter.abi.Events["AuthorizedCallerRemoved"].ID: + return _MultiAggregateRateLimiter.ParseAuthorizedCallerRemoved(log) + case _MultiAggregateRateLimiter.abi.Events["ConfigChanged"].ID: + return _MultiAggregateRateLimiter.ParseConfigChanged(log) + case _MultiAggregateRateLimiter.abi.Events["FeeQuoterSet"].ID: + return _MultiAggregateRateLimiter.ParseFeeQuoterSet(log) + case _MultiAggregateRateLimiter.abi.Events["OwnershipTransferRequested"].ID: + return _MultiAggregateRateLimiter.ParseOwnershipTransferRequested(log) + case _MultiAggregateRateLimiter.abi.Events["OwnershipTransferred"].ID: + return _MultiAggregateRateLimiter.ParseOwnershipTransferred(log) + case _MultiAggregateRateLimiter.abi.Events["RateLimiterConfigUpdated"].ID: + return _MultiAggregateRateLimiter.ParseRateLimiterConfigUpdated(log) + case _MultiAggregateRateLimiter.abi.Events["TokenAggregateRateLimitAdded"].ID: + return _MultiAggregateRateLimiter.ParseTokenAggregateRateLimitAdded(log) + case _MultiAggregateRateLimiter.abi.Events["TokenAggregateRateLimitRemoved"].ID: + return _MultiAggregateRateLimiter.ParseTokenAggregateRateLimitRemoved(log) + case _MultiAggregateRateLimiter.abi.Events["TokensConsumed"].ID: + return _MultiAggregateRateLimiter.ParseTokensConsumed(log) + + default: + return nil, fmt.Errorf("abigen wrapper received unknown log topic: %v", log.Topics[0]) + } +} + +func (MultiAggregateRateLimiterAuthorizedCallerAdded) Topic() common.Hash { + return common.HexToHash("0xeb1b9b92e50b7f88f9ff25d56765095ac6e91540eee214906f4036a908ffbdef") +} + +func (MultiAggregateRateLimiterAuthorizedCallerRemoved) Topic() common.Hash { + return common.HexToHash("0xc3803387881faad271c47728894e3e36fac830ffc8602ca6fc07733cbda77580") +} + +func (MultiAggregateRateLimiterConfigChanged) Topic() common.Hash { + return common.HexToHash("0x9ea3374b67bf275e6bb9c8ae68f9cae023e1c528b4b27e092f0bb209d3531c19") +} + +func (MultiAggregateRateLimiterFeeQuoterSet) Topic() common.Hash { + return common.HexToHash("0x7c737a8eddf62436489aa3600ed26e75e0a58b0f8c0d266bbcee64358c39fdac") +} + +func (MultiAggregateRateLimiterOwnershipTransferRequested) Topic() common.Hash { + return common.HexToHash("0xed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae1278") +} + +func (MultiAggregateRateLimiterOwnershipTransferred) Topic() common.Hash { + return common.HexToHash("0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0") +} + +func (MultiAggregateRateLimiterRateLimiterConfigUpdated) Topic() common.Hash { + return common.HexToHash("0xf14a5415ce6988a9e870a85fff0b9d7b7dd79bbc228cb63cad610daf6f7b6b97") +} + +func (MultiAggregateRateLimiterTokenAggregateRateLimitAdded) Topic() common.Hash { + return common.HexToHash("0xad72a792d2a307f400c278be7deaeec6964276783304580cdc4e905436b8d5c5") +} + +func (MultiAggregateRateLimiterTokenAggregateRateLimitRemoved) Topic() common.Hash { + return common.HexToHash("0x530cabd30786b7235e124a6c0db77e0b685ef22813b1fe87554247f404eb8ed6") +} + +func (MultiAggregateRateLimiterTokensConsumed) Topic() common.Hash { + return common.HexToHash("0x1871cdf8010e63f2eb8384381a68dfa7416dc571a5517e66e88b2d2d0c0a690a") +} + +func (_MultiAggregateRateLimiter *MultiAggregateRateLimiter) Address() common.Address { + return _MultiAggregateRateLimiter.address +} + +type MultiAggregateRateLimiterInterface interface { + CurrentRateLimiterState(opts *bind.CallOpts, remoteChainSelector uint64, isOutboundLane bool) (RateLimiterTokenBucket, error) + + GetAllAuthorizedCallers(opts *bind.CallOpts) ([]common.Address, error) + + GetAllRateLimitTokens(opts *bind.CallOpts, remoteChainSelector uint64) (GetAllRateLimitTokens, + + error) + + GetFeeQuoter(opts *bind.CallOpts) (common.Address, error) + + Owner(opts *bind.CallOpts) (common.Address, error) + + TypeAndVersion(opts *bind.CallOpts) (string, error) + + AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) + + ApplyAuthorizedCallerUpdates(opts *bind.TransactOpts, authorizedCallerArgs AuthorizedCallersAuthorizedCallerArgs) (*types.Transaction, error) + + ApplyRateLimiterConfigUpdates(opts *bind.TransactOpts, rateLimiterUpdates []MultiAggregateRateLimiterRateLimiterConfigArgs) (*types.Transaction, error) + + OnInboundMessage(opts *bind.TransactOpts, message ClientAny2EVMMessage) (*types.Transaction, error) + + OnOutboundMessage(opts *bind.TransactOpts, destChainSelector uint64, message ClientEVM2AnyMessage) (*types.Transaction, error) + + SetFeeQuoter(opts *bind.TransactOpts, newFeeQuoter common.Address) (*types.Transaction, error) + + TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) + + UpdateRateLimitTokens(opts *bind.TransactOpts, removes []MultiAggregateRateLimiterLocalRateLimitToken, adds []MultiAggregateRateLimiterRateLimitTokenArgs) (*types.Transaction, error) + + FilterAuthorizedCallerAdded(opts *bind.FilterOpts) (*MultiAggregateRateLimiterAuthorizedCallerAddedIterator, error) + + WatchAuthorizedCallerAdded(opts *bind.WatchOpts, sink chan<- *MultiAggregateRateLimiterAuthorizedCallerAdded) (event.Subscription, error) + + ParseAuthorizedCallerAdded(log types.Log) (*MultiAggregateRateLimiterAuthorizedCallerAdded, error) + + FilterAuthorizedCallerRemoved(opts *bind.FilterOpts) (*MultiAggregateRateLimiterAuthorizedCallerRemovedIterator, error) + + WatchAuthorizedCallerRemoved(opts *bind.WatchOpts, sink chan<- *MultiAggregateRateLimiterAuthorizedCallerRemoved) (event.Subscription, error) + + ParseAuthorizedCallerRemoved(log types.Log) (*MultiAggregateRateLimiterAuthorizedCallerRemoved, error) + + FilterConfigChanged(opts *bind.FilterOpts) (*MultiAggregateRateLimiterConfigChangedIterator, error) + + WatchConfigChanged(opts *bind.WatchOpts, sink chan<- *MultiAggregateRateLimiterConfigChanged) (event.Subscription, error) + + ParseConfigChanged(log types.Log) (*MultiAggregateRateLimiterConfigChanged, error) + + FilterFeeQuoterSet(opts *bind.FilterOpts) (*MultiAggregateRateLimiterFeeQuoterSetIterator, error) + + WatchFeeQuoterSet(opts *bind.WatchOpts, sink chan<- *MultiAggregateRateLimiterFeeQuoterSet) (event.Subscription, error) + + ParseFeeQuoterSet(log types.Log) (*MultiAggregateRateLimiterFeeQuoterSet, error) + + FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*MultiAggregateRateLimiterOwnershipTransferRequestedIterator, error) + + WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *MultiAggregateRateLimiterOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferRequested(log types.Log) (*MultiAggregateRateLimiterOwnershipTransferRequested, error) + + FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*MultiAggregateRateLimiterOwnershipTransferredIterator, error) + + WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *MultiAggregateRateLimiterOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferred(log types.Log) (*MultiAggregateRateLimiterOwnershipTransferred, error) + + FilterRateLimiterConfigUpdated(opts *bind.FilterOpts, remoteChainSelector []uint64) (*MultiAggregateRateLimiterRateLimiterConfigUpdatedIterator, error) + + WatchRateLimiterConfigUpdated(opts *bind.WatchOpts, sink chan<- *MultiAggregateRateLimiterRateLimiterConfigUpdated, remoteChainSelector []uint64) (event.Subscription, error) + + ParseRateLimiterConfigUpdated(log types.Log) (*MultiAggregateRateLimiterRateLimiterConfigUpdated, error) + + FilterTokenAggregateRateLimitAdded(opts *bind.FilterOpts) (*MultiAggregateRateLimiterTokenAggregateRateLimitAddedIterator, error) + + WatchTokenAggregateRateLimitAdded(opts *bind.WatchOpts, sink chan<- *MultiAggregateRateLimiterTokenAggregateRateLimitAdded) (event.Subscription, error) + + ParseTokenAggregateRateLimitAdded(log types.Log) (*MultiAggregateRateLimiterTokenAggregateRateLimitAdded, error) + + FilterTokenAggregateRateLimitRemoved(opts *bind.FilterOpts) (*MultiAggregateRateLimiterTokenAggregateRateLimitRemovedIterator, error) + + WatchTokenAggregateRateLimitRemoved(opts *bind.WatchOpts, sink chan<- *MultiAggregateRateLimiterTokenAggregateRateLimitRemoved) (event.Subscription, error) + + ParseTokenAggregateRateLimitRemoved(log types.Log) (*MultiAggregateRateLimiterTokenAggregateRateLimitRemoved, error) + + FilterTokensConsumed(opts *bind.FilterOpts) (*MultiAggregateRateLimiterTokensConsumedIterator, error) + + WatchTokensConsumed(opts *bind.WatchOpts, sink chan<- *MultiAggregateRateLimiterTokensConsumed) (event.Subscription, error) + + ParseTokensConsumed(log types.Log) (*MultiAggregateRateLimiterTokensConsumed, error) + + ParseLog(log types.Log) (generated.AbigenLog, error) + + Address() common.Address +} diff --git a/core/gethwrappers/ccip/generated/multi_ocr3_helper/multi_ocr3_helper.go b/core/gethwrappers/ccip/generated/multi_ocr3_helper/multi_ocr3_helper.go new file mode 100644 index 00000000000..285aaaa338a --- /dev/null +++ b/core/gethwrappers/ccip/generated/multi_ocr3_helper/multi_ocr3_helper.go @@ -0,0 +1,1096 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package multi_ocr3_helper + +import ( + "errors" + "fmt" + "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" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" +) + +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +type MultiOCR3BaseConfigInfo struct { + ConfigDigest [32]byte + F uint8 + N uint8 + IsSignatureVerificationEnabled bool +} + +type MultiOCR3BaseOCRConfig struct { + ConfigInfo MultiOCR3BaseConfigInfo + Signers []common.Address + Transmitters []common.Address +} + +type MultiOCR3BaseOCRConfigArgs struct { + ConfigDigest [32]byte + OcrPluginType uint8 + F uint8 + IsSignatureVerificationEnabled bool + Signers []common.Address + Transmitters []common.Address +} + +type MultiOCR3BaseOracle struct { + Index uint8 + Role uint8 +} + +var MultiOCR3HelperMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"expected\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"actual\",\"type\":\"bytes32\"}],\"name\":\"ConfigDigestMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expected\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"actual\",\"type\":\"uint256\"}],\"name\":\"ForkedChain\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"enumMultiOCR3Base.InvalidConfigErrorType\",\"name\":\"errorType\",\"type\":\"uint8\"}],\"name\":\"InvalidConfig\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NonUniqueSignatures\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OracleCannotBeZeroAddress\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"SignaturesOutOfRegistration\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"ocrPluginType\",\"type\":\"uint8\"}],\"name\":\"StaticConfigCannotBeChanged\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UnauthorizedSigner\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UnauthorizedTransmitter\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expected\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"actual\",\"type\":\"uint256\"}],\"name\":\"WrongMessageLength\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"WrongNumberOfSignatures\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"ocrPluginType\",\"type\":\"uint8\"}],\"name\":\"AfterConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"ocrPluginType\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"signers\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"transmitters\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"F\",\"type\":\"uint8\"}],\"name\":\"ConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint8\",\"name\":\"ocrPluginType\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"sequenceNumber\",\"type\":\"uint64\"}],\"name\":\"Transmitted\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"ocrPluginType\",\"type\":\"uint8\"},{\"internalType\":\"address\",\"name\":\"oracleAddress\",\"type\":\"address\"}],\"name\":\"getOracle\",\"outputs\":[{\"components\":[{\"internalType\":\"uint8\",\"name\":\"index\",\"type\":\"uint8\"},{\"internalType\":\"enumMultiOCR3Base.Role\",\"name\":\"role\",\"type\":\"uint8\"}],\"internalType\":\"structMultiOCR3Base.Oracle\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"ocrPluginType\",\"type\":\"uint8\"}],\"name\":\"latestConfigDetails\",\"outputs\":[{\"components\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"internalType\":\"uint8\",\"name\":\"F\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"n\",\"type\":\"uint8\"},{\"internalType\":\"bool\",\"name\":\"isSignatureVerificationEnabled\",\"type\":\"bool\"}],\"internalType\":\"structMultiOCR3Base.ConfigInfo\",\"name\":\"configInfo\",\"type\":\"tuple\"},{\"internalType\":\"address[]\",\"name\":\"signers\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"transmitters\",\"type\":\"address[]\"}],\"internalType\":\"structMultiOCR3Base.OCRConfig\",\"name\":\"ocrConfig\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"internalType\":\"uint8\",\"name\":\"ocrPluginType\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"F\",\"type\":\"uint8\"},{\"internalType\":\"bool\",\"name\":\"isSignatureVerificationEnabled\",\"type\":\"bool\"},{\"internalType\":\"address[]\",\"name\":\"signers\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"transmitters\",\"type\":\"address[]\"}],\"internalType\":\"structMultiOCR3Base.OCRConfigArgs[]\",\"name\":\"ocrConfigArgs\",\"type\":\"tuple[]\"}],\"name\":\"setOCR3Configs\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"ocrPluginType\",\"type\":\"uint8\"}],\"name\":\"setTransmitOcrPluginType\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32[3]\",\"name\":\"reportContext\",\"type\":\"bytes32[3]\"},{\"internalType\":\"bytes\",\"name\":\"report\",\"type\":\"bytes\"},{\"internalType\":\"bytes32[]\",\"name\":\"rs\",\"type\":\"bytes32[]\"},{\"internalType\":\"bytes32[]\",\"name\":\"ss\",\"type\":\"bytes32[]\"},{\"internalType\":\"bytes32\",\"name\":\"rawVs\",\"type\":\"bytes32\"}],\"name\":\"transmitWithSignatures\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32[3]\",\"name\":\"reportContext\",\"type\":\"bytes32[3]\"},{\"internalType\":\"bytes\",\"name\":\"report\",\"type\":\"bytes\"}],\"name\":\"transmitWithoutSignatures\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"pure\",\"type\":\"function\"}]", + Bin: "0x60a06040523480156200001157600080fd5b503380600081620000695760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b03848116919091179091558116156200009c576200009c81620000a9565b5050466080525062000154565b336001600160a01b03821603620001035760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640162000060565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b608051611d386200017760003960008181610ef00152610f3c0152611d386000f3fe608060405234801561001057600080fd5b50600436106100be5760003560e01c80637ac0aa1a11610076578063c673e5841161005b578063c673e584146101c5578063f2fde38b146101e5578063f716f99f146101f857600080fd5b80637ac0aa1a1461015b5780638da5cb5b1461019d57600080fd5b806334a9c92e116100a757806334a9c92e1461012057806344e65e551461014057806379ba50971461015357600080fd5b8063181f5a77146100c357806326bf9d261461010b575b600080fd5b604080518082018252601981527f4d756c74694f4352334261736548656c70657220312e302e30000000000000006020820152905161010291906114dd565b60405180910390f35b61011e6101193660046115a4565b61020b565b005b61013361012e366004611632565b61023a565b6040516101029190611694565b61011e61014e366004611707565b6102ca565b61011e61034d565b61011e6101693660046117ba565b600480547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660ff92909216919091179055565b60005460405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610102565b6101d86101d33660046117ba565b61044f565b604051610102919061182e565b61011e6101f33660046118c1565b6105c7565b61011e610206366004611a2d565b6105db565b604080516000808252602082019092526004549091506102349060ff168585858580600061061d565b50505050565b6040805180820182526000808252602080830182905260ff86811683526003825284832073ffffffffffffffffffffffffffffffffffffffff871684528252918490208451808601909552805480841686529394939092918401916101009091041660028111156102ad576102ad611665565b60028111156102be576102be611665565b90525090505b92915050565b60045460408051602080880282810182019093528782526103439360ff16928c928c928c928c918c91829185019084908082843760009201919091525050604080516020808d0282810182019093528c82529093508c92508b9182918501908490808284376000920191909152508a925061061d915050565b5050505050505050565b60015473ffffffffffffffffffffffffffffffffffffffff1633146103d3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e65720000000000000000000060448201526064015b60405180910390fd5b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b6104926040805160e081019091526000606082018181526080830182905260a0830182905260c08301919091528190815260200160608152602001606081525090565b60ff808316600090815260026020818152604092839020835160e081018552815460608201908152600183015480881660808401526101008104881660a0840152620100009004909616151560c08201529485529182018054845181840281018401909552808552929385830193909283018282801561054857602002820191906000526020600020905b815473ffffffffffffffffffffffffffffffffffffffff16815260019091019060200180831161051d575b50505050508152602001600382018054806020026020016040519081016040528092919081815260200182805480156105b757602002820191906000526020600020905b815473ffffffffffffffffffffffffffffffffffffffff16815260019091019060200180831161058c575b5050505050815250509050919050565b6105cf6109a1565b6105d881610a24565b50565b6105e36109a1565b60005b81518110156106195761061182828151811061060457610604611b96565b6020026020010151610b19565b6001016105e6565b5050565b60ff8781166000908152600260209081526040808320815160808101835281548152600190910154808616938201939093526101008304851691810191909152620100009091049092161515606083015287359061067c8760a4611bf4565b90508260600151156106c4578451610695906020611c07565b86516106a2906020611c07565b6106ad9060a0611bf4565b6106b79190611bf4565b6106c19082611bf4565b90505b368114610706576040517f8e1192e1000000000000000000000000000000000000000000000000000000008152600481018290523660248201526044016103ca565b508151811461074e5781516040517f93df584c0000000000000000000000000000000000000000000000000000000081526004810191909152602481018290526044016103ca565b610756610eed565b60ff808a16600090815260036020908152604080832033845282528083208151808301909252805480861683529394919390928401916101009091041660028111156107a4576107a4611665565b60028111156107b5576107b5611665565b90525090506002816020015160028111156107d2576107d2611665565b1480156108335750600260008b60ff1660ff168152602001908152602001600020600301816000015160ff168154811061080e5761080e611b96565b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff1633145b610869576040517fda0f08e800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5081606001511561094b576020820151610884906001611c1e565b60ff168551146108c0576040517f71253a2500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b83518551146108fb576040517fa75d88af00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000878760405161090d929190611c37565b604051908190038120610924918b90602001611c47565b6040516020818303038152906040528051906020012090506109498a82888888610f6e565b505b6040805182815260208a81013567ffffffffffffffff169082015260ff8b16917f198d6990ef96613a9026203077e422916918b03ff47f0be6bee7b02d8e139ef0910160405180910390a2505050505050505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314610a22576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e65720000000000000000000060448201526064016103ca565b565b3373ffffffffffffffffffffffffffffffffffffffff821603610aa3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c6600000000000000000060448201526064016103ca565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b806040015160ff16600003610b5d5760006040517f367f56a20000000000000000000000000000000000000000000000000000000081526004016103ca9190611c5b565b60208082015160ff80821660009081526002909352604083206001810154929390928392169003610bca57606084015160018201805491151562010000027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ffff909216919091179055610c1f565b6060840151600182015460ff6201000090910416151590151514610c1f576040517f87f6037c00000000000000000000000000000000000000000000000000000000815260ff841660048201526024016103ca565b60a084015180516101001015610c645760016040517f367f56a20000000000000000000000000000000000000000000000000000000081526004016103ca9190611c5b565b610cd78484600301805480602002602001604051908101604052809291908181526020018280548015610ccd57602002820191906000526020600020905b815473ffffffffffffffffffffffffffffffffffffffff168152600190910190602001808311610ca2575b505050505061117e565b846060015115610e3d57610d528484600201805480602002602001604051908101604052809291908181526020018280548015610ccd5760200282019190600052602060002090815473ffffffffffffffffffffffffffffffffffffffff168152600190910190602001808311610ca257505050505061117e565b608085015180516101001015610d975760026040517f367f56a20000000000000000000000000000000000000000000000000000000081526004016103ca9190611c5b565b6040860151610da7906003611c75565b60ff16815111610de65760036040517f367f56a20000000000000000000000000000000000000000000000000000000081526004016103ca9190611c5b565b80516001840180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff1661010060ff841602179055610e2e906002860190602084019061143e565b50610e3b85826001611216565b505b610e4984826002611216565b8051610e5e906003850190602084019061143e565b506040858101516001840180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660ff8316179055865180855560a088015192517fab8b1b57514019638d7b5ce9c638fe71366fe8e2be1c40a7a80f1733d0e9f54793610ed59389939260028a01929190611c98565b60405180910390a1610ee684611405565b5050505050565b467f000000000000000000000000000000000000000000000000000000000000000014610a22576040517f0f01ce850000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000060048201524660248201526044016103ca565b8251600090815b81811015610343576000600188868460208110610f9457610f94611b96565b610fa191901a601b611c1e565b898581518110610fb357610fb3611b96565b6020026020010151898681518110610fcd57610fcd611b96565b60200260200101516040516000815260200160405260405161100b949392919093845260ff9290921660208401526040830152606082015260800190565b6020604051602081039080840390855afa15801561102d573d6000803e3d6000fd5b5050604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081015160ff808e1660009081526003602090815285822073ffffffffffffffffffffffffffffffffffffffff8516835281528582208587019096528554808416865293975090955092939284019161010090041660028111156110b9576110b9611665565b60028111156110ca576110ca611665565b90525090506001816020015160028111156110e7576110e7611665565b1461111e576040517fca31867a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8051600160ff9091161b851615611161576040517ff67bc7c400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b806000015160ff166001901b851794505050806001019050610f75565b60005b81518110156112115760ff8316600090815260036020526040812083519091908490849081106111b3576111b3611b96565b60209081029190910181015173ffffffffffffffffffffffffffffffffffffffff16825281019190915260400160002080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000169055600101611181565b505050565b60005b825181101561023457600083828151811061123657611236611b96565b602002602001015190506000600281111561125357611253611665565b60ff808716600090815260036020908152604080832073ffffffffffffffffffffffffffffffffffffffff87168452909152902054610100900416600281111561129f5761129f611665565b146112d95760046040517f367f56a20000000000000000000000000000000000000000000000000000000081526004016103ca9190611c5b565b73ffffffffffffffffffffffffffffffffffffffff8116611326576040517fd6c62c9b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60405180604001604052808360ff16815260200184600281111561134c5761134c611665565b905260ff808716600090815260036020908152604080832073ffffffffffffffffffffffffffffffffffffffff8716845282529091208351815493167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00841681178255918401519092909183917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000016176101008360028111156113f1576113f1611665565b021790555090505050806001019050611219565b60405160ff821681527f897ac1b2c12867721b284f3eb147bd4ab046d4eef1cf31c1d8988bfcfb962b539060200160405180910390a150565b8280548282559060005260206000209081019282156114b8579160200282015b828111156114b857825182547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff90911617825560209092019160019091019061145e565b506114c49291506114c8565b5090565b5b808211156114c457600081556001016114c9565b60006020808352835180602085015260005b8181101561150b578581018301518582016040015282016114ef565b5060006040828601015260407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8301168501019250505092915050565b80606081018310156102c457600080fd5b60008083601f84011261156d57600080fd5b50813567ffffffffffffffff81111561158557600080fd5b60208301915083602082850101111561159d57600080fd5b9250929050565b6000806000608084860312156115b957600080fd5b6115c3858561154a565b9250606084013567ffffffffffffffff8111156115df57600080fd5b6115eb8682870161155b565b9497909650939450505050565b803560ff8116811461160957600080fd5b919050565b803573ffffffffffffffffffffffffffffffffffffffff8116811461160957600080fd5b6000806040838503121561164557600080fd5b61164e836115f8565b915061165c6020840161160e565b90509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b815160ff16815260208201516040820190600381106116b5576116b5611665565b8060208401525092915050565b60008083601f8401126116d457600080fd5b50813567ffffffffffffffff8111156116ec57600080fd5b6020830191508360208260051b850101111561159d57600080fd5b60008060008060008060008060e0898b03121561172357600080fd5b61172d8a8a61154a565b9750606089013567ffffffffffffffff8082111561174a57600080fd5b6117568c838d0161155b565b909950975060808b013591508082111561176f57600080fd5b61177b8c838d016116c2565b909750955060a08b013591508082111561179457600080fd5b506117a18b828c016116c2565b999c989b50969995989497949560c00135949350505050565b6000602082840312156117cc57600080fd5b6117d5826115f8565b9392505050565b60008151808452602080850194506020840160005b8381101561182357815173ffffffffffffffffffffffffffffffffffffffff16875295820195908201906001016117f1565b509495945050505050565b60208152600082518051602084015260ff602082015116604084015260ff604082015116606084015260608101511515608084015250602083015160c060a084015261187d60e08401826117dc565b905060408401517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08483030160c08501526118b882826117dc565b95945050505050565b6000602082840312156118d357600080fd5b6117d58261160e565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60405160c0810167ffffffffffffffff8111828210171561192e5761192e6118dc565b60405290565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff8111828210171561197b5761197b6118dc565b604052919050565b600067ffffffffffffffff82111561199d5761199d6118dc565b5060051b60200190565b8035801515811461160957600080fd5b600082601f8301126119c857600080fd5b813560206119dd6119d883611983565b611934565b8083825260208201915060208460051b8701019350868411156119ff57600080fd5b602086015b84811015611a2257611a158161160e565b8352918301918301611a04565b509695505050505050565b60006020808385031215611a4057600080fd5b823567ffffffffffffffff80821115611a5857600080fd5b818501915085601f830112611a6c57600080fd5b8135611a7a6119d882611983565b81815260059190911b83018401908481019088831115611a9957600080fd5b8585015b83811015611b8957803585811115611ab457600080fd5b860160c0818c037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0011215611ae95760008081fd5b611af161190b565b8882013581526040611b048184016115f8565b8a8301526060611b158185016115f8565b8284015260809150611b288285016119a7565b9083015260a08381013589811115611b405760008081fd5b611b4e8f8d838801016119b7565b838501525060c0840135915088821115611b685760008081fd5b611b768e8c848701016119b7565b9083015250845250918601918601611a9d565b5098975050505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b808201808211156102c4576102c4611bc5565b80820281158282048414176102c4576102c4611bc5565b60ff81811683821601908111156102c4576102c4611bc5565b8183823760009101908152919050565b828152606082602083013760800192915050565b6020810160058310611c6f57611c6f611665565b91905290565b60ff8181168382160290811690818114611c9157611c91611bc5565b5092915050565b600060a0820160ff88168352602087602085015260a0604085015281875480845260c086019150886000526020600020935060005b81811015611cff57845473ffffffffffffffffffffffffffffffffffffffff1683526001948501949284019201611ccd565b50508481036060860152611d1381886117dc565b935050505060ff83166080830152969550505050505056fea164736f6c6343000818000a", +} + +var MultiOCR3HelperABI = MultiOCR3HelperMetaData.ABI + +var MultiOCR3HelperBin = MultiOCR3HelperMetaData.Bin + +func DeployMultiOCR3Helper(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *MultiOCR3Helper, error) { + parsed, err := MultiOCR3HelperMetaData.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(MultiOCR3HelperBin), backend) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &MultiOCR3Helper{address: address, abi: *parsed, MultiOCR3HelperCaller: MultiOCR3HelperCaller{contract: contract}, MultiOCR3HelperTransactor: MultiOCR3HelperTransactor{contract: contract}, MultiOCR3HelperFilterer: MultiOCR3HelperFilterer{contract: contract}}, nil +} + +type MultiOCR3Helper struct { + address common.Address + abi abi.ABI + MultiOCR3HelperCaller + MultiOCR3HelperTransactor + MultiOCR3HelperFilterer +} + +type MultiOCR3HelperCaller struct { + contract *bind.BoundContract +} + +type MultiOCR3HelperTransactor struct { + contract *bind.BoundContract +} + +type MultiOCR3HelperFilterer struct { + contract *bind.BoundContract +} + +type MultiOCR3HelperSession struct { + Contract *MultiOCR3Helper + CallOpts bind.CallOpts + TransactOpts bind.TransactOpts +} + +type MultiOCR3HelperCallerSession struct { + Contract *MultiOCR3HelperCaller + CallOpts bind.CallOpts +} + +type MultiOCR3HelperTransactorSession struct { + Contract *MultiOCR3HelperTransactor + TransactOpts bind.TransactOpts +} + +type MultiOCR3HelperRaw struct { + Contract *MultiOCR3Helper +} + +type MultiOCR3HelperCallerRaw struct { + Contract *MultiOCR3HelperCaller +} + +type MultiOCR3HelperTransactorRaw struct { + Contract *MultiOCR3HelperTransactor +} + +func NewMultiOCR3Helper(address common.Address, backend bind.ContractBackend) (*MultiOCR3Helper, error) { + abi, err := abi.JSON(strings.NewReader(MultiOCR3HelperABI)) + if err != nil { + return nil, err + } + contract, err := bindMultiOCR3Helper(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &MultiOCR3Helper{address: address, abi: abi, MultiOCR3HelperCaller: MultiOCR3HelperCaller{contract: contract}, MultiOCR3HelperTransactor: MultiOCR3HelperTransactor{contract: contract}, MultiOCR3HelperFilterer: MultiOCR3HelperFilterer{contract: contract}}, nil +} + +func NewMultiOCR3HelperCaller(address common.Address, caller bind.ContractCaller) (*MultiOCR3HelperCaller, error) { + contract, err := bindMultiOCR3Helper(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &MultiOCR3HelperCaller{contract: contract}, nil +} + +func NewMultiOCR3HelperTransactor(address common.Address, transactor bind.ContractTransactor) (*MultiOCR3HelperTransactor, error) { + contract, err := bindMultiOCR3Helper(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &MultiOCR3HelperTransactor{contract: contract}, nil +} + +func NewMultiOCR3HelperFilterer(address common.Address, filterer bind.ContractFilterer) (*MultiOCR3HelperFilterer, error) { + contract, err := bindMultiOCR3Helper(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &MultiOCR3HelperFilterer{contract: contract}, nil +} + +func bindMultiOCR3Helper(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := MultiOCR3HelperMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +func (_MultiOCR3Helper *MultiOCR3HelperRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _MultiOCR3Helper.Contract.MultiOCR3HelperCaller.contract.Call(opts, result, method, params...) +} + +func (_MultiOCR3Helper *MultiOCR3HelperRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _MultiOCR3Helper.Contract.MultiOCR3HelperTransactor.contract.Transfer(opts) +} + +func (_MultiOCR3Helper *MultiOCR3HelperRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _MultiOCR3Helper.Contract.MultiOCR3HelperTransactor.contract.Transact(opts, method, params...) +} + +func (_MultiOCR3Helper *MultiOCR3HelperCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _MultiOCR3Helper.Contract.contract.Call(opts, result, method, params...) +} + +func (_MultiOCR3Helper *MultiOCR3HelperTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _MultiOCR3Helper.Contract.contract.Transfer(opts) +} + +func (_MultiOCR3Helper *MultiOCR3HelperTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _MultiOCR3Helper.Contract.contract.Transact(opts, method, params...) +} + +func (_MultiOCR3Helper *MultiOCR3HelperCaller) GetOracle(opts *bind.CallOpts, ocrPluginType uint8, oracleAddress common.Address) (MultiOCR3BaseOracle, error) { + var out []interface{} + err := _MultiOCR3Helper.contract.Call(opts, &out, "getOracle", ocrPluginType, oracleAddress) + + if err != nil { + return *new(MultiOCR3BaseOracle), err + } + + out0 := *abi.ConvertType(out[0], new(MultiOCR3BaseOracle)).(*MultiOCR3BaseOracle) + + return out0, err + +} + +func (_MultiOCR3Helper *MultiOCR3HelperSession) GetOracle(ocrPluginType uint8, oracleAddress common.Address) (MultiOCR3BaseOracle, error) { + return _MultiOCR3Helper.Contract.GetOracle(&_MultiOCR3Helper.CallOpts, ocrPluginType, oracleAddress) +} + +func (_MultiOCR3Helper *MultiOCR3HelperCallerSession) GetOracle(ocrPluginType uint8, oracleAddress common.Address) (MultiOCR3BaseOracle, error) { + return _MultiOCR3Helper.Contract.GetOracle(&_MultiOCR3Helper.CallOpts, ocrPluginType, oracleAddress) +} + +func (_MultiOCR3Helper *MultiOCR3HelperCaller) LatestConfigDetails(opts *bind.CallOpts, ocrPluginType uint8) (MultiOCR3BaseOCRConfig, error) { + var out []interface{} + err := _MultiOCR3Helper.contract.Call(opts, &out, "latestConfigDetails", ocrPluginType) + + if err != nil { + return *new(MultiOCR3BaseOCRConfig), err + } + + out0 := *abi.ConvertType(out[0], new(MultiOCR3BaseOCRConfig)).(*MultiOCR3BaseOCRConfig) + + return out0, err + +} + +func (_MultiOCR3Helper *MultiOCR3HelperSession) LatestConfigDetails(ocrPluginType uint8) (MultiOCR3BaseOCRConfig, error) { + return _MultiOCR3Helper.Contract.LatestConfigDetails(&_MultiOCR3Helper.CallOpts, ocrPluginType) +} + +func (_MultiOCR3Helper *MultiOCR3HelperCallerSession) LatestConfigDetails(ocrPluginType uint8) (MultiOCR3BaseOCRConfig, error) { + return _MultiOCR3Helper.Contract.LatestConfigDetails(&_MultiOCR3Helper.CallOpts, ocrPluginType) +} + +func (_MultiOCR3Helper *MultiOCR3HelperCaller) Owner(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _MultiOCR3Helper.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 + +} + +func (_MultiOCR3Helper *MultiOCR3HelperSession) Owner() (common.Address, error) { + return _MultiOCR3Helper.Contract.Owner(&_MultiOCR3Helper.CallOpts) +} + +func (_MultiOCR3Helper *MultiOCR3HelperCallerSession) Owner() (common.Address, error) { + return _MultiOCR3Helper.Contract.Owner(&_MultiOCR3Helper.CallOpts) +} + +func (_MultiOCR3Helper *MultiOCR3HelperCaller) TypeAndVersion(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _MultiOCR3Helper.contract.Call(opts, &out, "typeAndVersion") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +func (_MultiOCR3Helper *MultiOCR3HelperSession) TypeAndVersion() (string, error) { + return _MultiOCR3Helper.Contract.TypeAndVersion(&_MultiOCR3Helper.CallOpts) +} + +func (_MultiOCR3Helper *MultiOCR3HelperCallerSession) TypeAndVersion() (string, error) { + return _MultiOCR3Helper.Contract.TypeAndVersion(&_MultiOCR3Helper.CallOpts) +} + +func (_MultiOCR3Helper *MultiOCR3HelperTransactor) AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + return _MultiOCR3Helper.contract.Transact(opts, "acceptOwnership") +} + +func (_MultiOCR3Helper *MultiOCR3HelperSession) AcceptOwnership() (*types.Transaction, error) { + return _MultiOCR3Helper.Contract.AcceptOwnership(&_MultiOCR3Helper.TransactOpts) +} + +func (_MultiOCR3Helper *MultiOCR3HelperTransactorSession) AcceptOwnership() (*types.Transaction, error) { + return _MultiOCR3Helper.Contract.AcceptOwnership(&_MultiOCR3Helper.TransactOpts) +} + +func (_MultiOCR3Helper *MultiOCR3HelperTransactor) SetOCR3Configs(opts *bind.TransactOpts, ocrConfigArgs []MultiOCR3BaseOCRConfigArgs) (*types.Transaction, error) { + return _MultiOCR3Helper.contract.Transact(opts, "setOCR3Configs", ocrConfigArgs) +} + +func (_MultiOCR3Helper *MultiOCR3HelperSession) SetOCR3Configs(ocrConfigArgs []MultiOCR3BaseOCRConfigArgs) (*types.Transaction, error) { + return _MultiOCR3Helper.Contract.SetOCR3Configs(&_MultiOCR3Helper.TransactOpts, ocrConfigArgs) +} + +func (_MultiOCR3Helper *MultiOCR3HelperTransactorSession) SetOCR3Configs(ocrConfigArgs []MultiOCR3BaseOCRConfigArgs) (*types.Transaction, error) { + return _MultiOCR3Helper.Contract.SetOCR3Configs(&_MultiOCR3Helper.TransactOpts, ocrConfigArgs) +} + +func (_MultiOCR3Helper *MultiOCR3HelperTransactor) SetTransmitOcrPluginType(opts *bind.TransactOpts, ocrPluginType uint8) (*types.Transaction, error) { + return _MultiOCR3Helper.contract.Transact(opts, "setTransmitOcrPluginType", ocrPluginType) +} + +func (_MultiOCR3Helper *MultiOCR3HelperSession) SetTransmitOcrPluginType(ocrPluginType uint8) (*types.Transaction, error) { + return _MultiOCR3Helper.Contract.SetTransmitOcrPluginType(&_MultiOCR3Helper.TransactOpts, ocrPluginType) +} + +func (_MultiOCR3Helper *MultiOCR3HelperTransactorSession) SetTransmitOcrPluginType(ocrPluginType uint8) (*types.Transaction, error) { + return _MultiOCR3Helper.Contract.SetTransmitOcrPluginType(&_MultiOCR3Helper.TransactOpts, ocrPluginType) +} + +func (_MultiOCR3Helper *MultiOCR3HelperTransactor) TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) { + return _MultiOCR3Helper.contract.Transact(opts, "transferOwnership", to) +} + +func (_MultiOCR3Helper *MultiOCR3HelperSession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _MultiOCR3Helper.Contract.TransferOwnership(&_MultiOCR3Helper.TransactOpts, to) +} + +func (_MultiOCR3Helper *MultiOCR3HelperTransactorSession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _MultiOCR3Helper.Contract.TransferOwnership(&_MultiOCR3Helper.TransactOpts, to) +} + +func (_MultiOCR3Helper *MultiOCR3HelperTransactor) TransmitWithSignatures(opts *bind.TransactOpts, reportContext [3][32]byte, report []byte, rs [][32]byte, ss [][32]byte, rawVs [32]byte) (*types.Transaction, error) { + return _MultiOCR3Helper.contract.Transact(opts, "transmitWithSignatures", reportContext, report, rs, ss, rawVs) +} + +func (_MultiOCR3Helper *MultiOCR3HelperSession) TransmitWithSignatures(reportContext [3][32]byte, report []byte, rs [][32]byte, ss [][32]byte, rawVs [32]byte) (*types.Transaction, error) { + return _MultiOCR3Helper.Contract.TransmitWithSignatures(&_MultiOCR3Helper.TransactOpts, reportContext, report, rs, ss, rawVs) +} + +func (_MultiOCR3Helper *MultiOCR3HelperTransactorSession) TransmitWithSignatures(reportContext [3][32]byte, report []byte, rs [][32]byte, ss [][32]byte, rawVs [32]byte) (*types.Transaction, error) { + return _MultiOCR3Helper.Contract.TransmitWithSignatures(&_MultiOCR3Helper.TransactOpts, reportContext, report, rs, ss, rawVs) +} + +func (_MultiOCR3Helper *MultiOCR3HelperTransactor) TransmitWithoutSignatures(opts *bind.TransactOpts, reportContext [3][32]byte, report []byte) (*types.Transaction, error) { + return _MultiOCR3Helper.contract.Transact(opts, "transmitWithoutSignatures", reportContext, report) +} + +func (_MultiOCR3Helper *MultiOCR3HelperSession) TransmitWithoutSignatures(reportContext [3][32]byte, report []byte) (*types.Transaction, error) { + return _MultiOCR3Helper.Contract.TransmitWithoutSignatures(&_MultiOCR3Helper.TransactOpts, reportContext, report) +} + +func (_MultiOCR3Helper *MultiOCR3HelperTransactorSession) TransmitWithoutSignatures(reportContext [3][32]byte, report []byte) (*types.Transaction, error) { + return _MultiOCR3Helper.Contract.TransmitWithoutSignatures(&_MultiOCR3Helper.TransactOpts, reportContext, report) +} + +type MultiOCR3HelperAfterConfigSetIterator struct { + Event *MultiOCR3HelperAfterConfigSet + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *MultiOCR3HelperAfterConfigSetIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(MultiOCR3HelperAfterConfigSet) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(MultiOCR3HelperAfterConfigSet) + 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() + } +} + +func (it *MultiOCR3HelperAfterConfigSetIterator) Error() error { + return it.fail +} + +func (it *MultiOCR3HelperAfterConfigSetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type MultiOCR3HelperAfterConfigSet struct { + OcrPluginType uint8 + Raw types.Log +} + +func (_MultiOCR3Helper *MultiOCR3HelperFilterer) FilterAfterConfigSet(opts *bind.FilterOpts) (*MultiOCR3HelperAfterConfigSetIterator, error) { + + logs, sub, err := _MultiOCR3Helper.contract.FilterLogs(opts, "AfterConfigSet") + if err != nil { + return nil, err + } + return &MultiOCR3HelperAfterConfigSetIterator{contract: _MultiOCR3Helper.contract, event: "AfterConfigSet", logs: logs, sub: sub}, nil +} + +func (_MultiOCR3Helper *MultiOCR3HelperFilterer) WatchAfterConfigSet(opts *bind.WatchOpts, sink chan<- *MultiOCR3HelperAfterConfigSet) (event.Subscription, error) { + + logs, sub, err := _MultiOCR3Helper.contract.WatchLogs(opts, "AfterConfigSet") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(MultiOCR3HelperAfterConfigSet) + if err := _MultiOCR3Helper.contract.UnpackLog(event, "AfterConfigSet", 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 +} + +func (_MultiOCR3Helper *MultiOCR3HelperFilterer) ParseAfterConfigSet(log types.Log) (*MultiOCR3HelperAfterConfigSet, error) { + event := new(MultiOCR3HelperAfterConfigSet) + if err := _MultiOCR3Helper.contract.UnpackLog(event, "AfterConfigSet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type MultiOCR3HelperConfigSetIterator struct { + Event *MultiOCR3HelperConfigSet + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *MultiOCR3HelperConfigSetIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(MultiOCR3HelperConfigSet) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(MultiOCR3HelperConfigSet) + 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() + } +} + +func (it *MultiOCR3HelperConfigSetIterator) Error() error { + return it.fail +} + +func (it *MultiOCR3HelperConfigSetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type MultiOCR3HelperConfigSet struct { + OcrPluginType uint8 + ConfigDigest [32]byte + Signers []common.Address + Transmitters []common.Address + F uint8 + Raw types.Log +} + +func (_MultiOCR3Helper *MultiOCR3HelperFilterer) FilterConfigSet(opts *bind.FilterOpts) (*MultiOCR3HelperConfigSetIterator, error) { + + logs, sub, err := _MultiOCR3Helper.contract.FilterLogs(opts, "ConfigSet") + if err != nil { + return nil, err + } + return &MultiOCR3HelperConfigSetIterator{contract: _MultiOCR3Helper.contract, event: "ConfigSet", logs: logs, sub: sub}, nil +} + +func (_MultiOCR3Helper *MultiOCR3HelperFilterer) WatchConfigSet(opts *bind.WatchOpts, sink chan<- *MultiOCR3HelperConfigSet) (event.Subscription, error) { + + logs, sub, err := _MultiOCR3Helper.contract.WatchLogs(opts, "ConfigSet") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(MultiOCR3HelperConfigSet) + if err := _MultiOCR3Helper.contract.UnpackLog(event, "ConfigSet", 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 +} + +func (_MultiOCR3Helper *MultiOCR3HelperFilterer) ParseConfigSet(log types.Log) (*MultiOCR3HelperConfigSet, error) { + event := new(MultiOCR3HelperConfigSet) + if err := _MultiOCR3Helper.contract.UnpackLog(event, "ConfigSet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type MultiOCR3HelperOwnershipTransferRequestedIterator struct { + Event *MultiOCR3HelperOwnershipTransferRequested + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *MultiOCR3HelperOwnershipTransferRequestedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(MultiOCR3HelperOwnershipTransferRequested) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(MultiOCR3HelperOwnershipTransferRequested) + 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() + } +} + +func (it *MultiOCR3HelperOwnershipTransferRequestedIterator) Error() error { + return it.fail +} + +func (it *MultiOCR3HelperOwnershipTransferRequestedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type MultiOCR3HelperOwnershipTransferRequested struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_MultiOCR3Helper *MultiOCR3HelperFilterer) FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*MultiOCR3HelperOwnershipTransferRequestedIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _MultiOCR3Helper.contract.FilterLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return &MultiOCR3HelperOwnershipTransferRequestedIterator{contract: _MultiOCR3Helper.contract, event: "OwnershipTransferRequested", logs: logs, sub: sub}, nil +} + +func (_MultiOCR3Helper *MultiOCR3HelperFilterer) WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *MultiOCR3HelperOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _MultiOCR3Helper.contract.WatchLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(MultiOCR3HelperOwnershipTransferRequested) + if err := _MultiOCR3Helper.contract.UnpackLog(event, "OwnershipTransferRequested", 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 +} + +func (_MultiOCR3Helper *MultiOCR3HelperFilterer) ParseOwnershipTransferRequested(log types.Log) (*MultiOCR3HelperOwnershipTransferRequested, error) { + event := new(MultiOCR3HelperOwnershipTransferRequested) + if err := _MultiOCR3Helper.contract.UnpackLog(event, "OwnershipTransferRequested", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type MultiOCR3HelperOwnershipTransferredIterator struct { + Event *MultiOCR3HelperOwnershipTransferred + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *MultiOCR3HelperOwnershipTransferredIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(MultiOCR3HelperOwnershipTransferred) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(MultiOCR3HelperOwnershipTransferred) + 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() + } +} + +func (it *MultiOCR3HelperOwnershipTransferredIterator) Error() error { + return it.fail +} + +func (it *MultiOCR3HelperOwnershipTransferredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type MultiOCR3HelperOwnershipTransferred struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_MultiOCR3Helper *MultiOCR3HelperFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*MultiOCR3HelperOwnershipTransferredIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _MultiOCR3Helper.contract.FilterLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return &MultiOCR3HelperOwnershipTransferredIterator{contract: _MultiOCR3Helper.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil +} + +func (_MultiOCR3Helper *MultiOCR3HelperFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *MultiOCR3HelperOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _MultiOCR3Helper.contract.WatchLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(MultiOCR3HelperOwnershipTransferred) + if err := _MultiOCR3Helper.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 +} + +func (_MultiOCR3Helper *MultiOCR3HelperFilterer) ParseOwnershipTransferred(log types.Log) (*MultiOCR3HelperOwnershipTransferred, error) { + event := new(MultiOCR3HelperOwnershipTransferred) + if err := _MultiOCR3Helper.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type MultiOCR3HelperTransmittedIterator struct { + Event *MultiOCR3HelperTransmitted + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *MultiOCR3HelperTransmittedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(MultiOCR3HelperTransmitted) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(MultiOCR3HelperTransmitted) + 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() + } +} + +func (it *MultiOCR3HelperTransmittedIterator) Error() error { + return it.fail +} + +func (it *MultiOCR3HelperTransmittedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type MultiOCR3HelperTransmitted struct { + OcrPluginType uint8 + ConfigDigest [32]byte + SequenceNumber uint64 + Raw types.Log +} + +func (_MultiOCR3Helper *MultiOCR3HelperFilterer) FilterTransmitted(opts *bind.FilterOpts, ocrPluginType []uint8) (*MultiOCR3HelperTransmittedIterator, error) { + + var ocrPluginTypeRule []interface{} + for _, ocrPluginTypeItem := range ocrPluginType { + ocrPluginTypeRule = append(ocrPluginTypeRule, ocrPluginTypeItem) + } + + logs, sub, err := _MultiOCR3Helper.contract.FilterLogs(opts, "Transmitted", ocrPluginTypeRule) + if err != nil { + return nil, err + } + return &MultiOCR3HelperTransmittedIterator{contract: _MultiOCR3Helper.contract, event: "Transmitted", logs: logs, sub: sub}, nil +} + +func (_MultiOCR3Helper *MultiOCR3HelperFilterer) WatchTransmitted(opts *bind.WatchOpts, sink chan<- *MultiOCR3HelperTransmitted, ocrPluginType []uint8) (event.Subscription, error) { + + var ocrPluginTypeRule []interface{} + for _, ocrPluginTypeItem := range ocrPluginType { + ocrPluginTypeRule = append(ocrPluginTypeRule, ocrPluginTypeItem) + } + + logs, sub, err := _MultiOCR3Helper.contract.WatchLogs(opts, "Transmitted", ocrPluginTypeRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(MultiOCR3HelperTransmitted) + if err := _MultiOCR3Helper.contract.UnpackLog(event, "Transmitted", 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 +} + +func (_MultiOCR3Helper *MultiOCR3HelperFilterer) ParseTransmitted(log types.Log) (*MultiOCR3HelperTransmitted, error) { + event := new(MultiOCR3HelperTransmitted) + if err := _MultiOCR3Helper.contract.UnpackLog(event, "Transmitted", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +func (_MultiOCR3Helper *MultiOCR3Helper) ParseLog(log types.Log) (generated.AbigenLog, error) { + switch log.Topics[0] { + case _MultiOCR3Helper.abi.Events["AfterConfigSet"].ID: + return _MultiOCR3Helper.ParseAfterConfigSet(log) + case _MultiOCR3Helper.abi.Events["ConfigSet"].ID: + return _MultiOCR3Helper.ParseConfigSet(log) + case _MultiOCR3Helper.abi.Events["OwnershipTransferRequested"].ID: + return _MultiOCR3Helper.ParseOwnershipTransferRequested(log) + case _MultiOCR3Helper.abi.Events["OwnershipTransferred"].ID: + return _MultiOCR3Helper.ParseOwnershipTransferred(log) + case _MultiOCR3Helper.abi.Events["Transmitted"].ID: + return _MultiOCR3Helper.ParseTransmitted(log) + + default: + return nil, fmt.Errorf("abigen wrapper received unknown log topic: %v", log.Topics[0]) + } +} + +func (MultiOCR3HelperAfterConfigSet) Topic() common.Hash { + return common.HexToHash("0x897ac1b2c12867721b284f3eb147bd4ab046d4eef1cf31c1d8988bfcfb962b53") +} + +func (MultiOCR3HelperConfigSet) Topic() common.Hash { + return common.HexToHash("0xab8b1b57514019638d7b5ce9c638fe71366fe8e2be1c40a7a80f1733d0e9f547") +} + +func (MultiOCR3HelperOwnershipTransferRequested) Topic() common.Hash { + return common.HexToHash("0xed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae1278") +} + +func (MultiOCR3HelperOwnershipTransferred) Topic() common.Hash { + return common.HexToHash("0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0") +} + +func (MultiOCR3HelperTransmitted) Topic() common.Hash { + return common.HexToHash("0x198d6990ef96613a9026203077e422916918b03ff47f0be6bee7b02d8e139ef0") +} + +func (_MultiOCR3Helper *MultiOCR3Helper) Address() common.Address { + return _MultiOCR3Helper.address +} + +type MultiOCR3HelperInterface interface { + GetOracle(opts *bind.CallOpts, ocrPluginType uint8, oracleAddress common.Address) (MultiOCR3BaseOracle, error) + + LatestConfigDetails(opts *bind.CallOpts, ocrPluginType uint8) (MultiOCR3BaseOCRConfig, error) + + Owner(opts *bind.CallOpts) (common.Address, error) + + TypeAndVersion(opts *bind.CallOpts) (string, error) + + AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) + + SetOCR3Configs(opts *bind.TransactOpts, ocrConfigArgs []MultiOCR3BaseOCRConfigArgs) (*types.Transaction, error) + + SetTransmitOcrPluginType(opts *bind.TransactOpts, ocrPluginType uint8) (*types.Transaction, error) + + TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) + + TransmitWithSignatures(opts *bind.TransactOpts, reportContext [3][32]byte, report []byte, rs [][32]byte, ss [][32]byte, rawVs [32]byte) (*types.Transaction, error) + + TransmitWithoutSignatures(opts *bind.TransactOpts, reportContext [3][32]byte, report []byte) (*types.Transaction, error) + + FilterAfterConfigSet(opts *bind.FilterOpts) (*MultiOCR3HelperAfterConfigSetIterator, error) + + WatchAfterConfigSet(opts *bind.WatchOpts, sink chan<- *MultiOCR3HelperAfterConfigSet) (event.Subscription, error) + + ParseAfterConfigSet(log types.Log) (*MultiOCR3HelperAfterConfigSet, error) + + FilterConfigSet(opts *bind.FilterOpts) (*MultiOCR3HelperConfigSetIterator, error) + + WatchConfigSet(opts *bind.WatchOpts, sink chan<- *MultiOCR3HelperConfigSet) (event.Subscription, error) + + ParseConfigSet(log types.Log) (*MultiOCR3HelperConfigSet, error) + + FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*MultiOCR3HelperOwnershipTransferRequestedIterator, error) + + WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *MultiOCR3HelperOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferRequested(log types.Log) (*MultiOCR3HelperOwnershipTransferRequested, error) + + FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*MultiOCR3HelperOwnershipTransferredIterator, error) + + WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *MultiOCR3HelperOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferred(log types.Log) (*MultiOCR3HelperOwnershipTransferred, error) + + FilterTransmitted(opts *bind.FilterOpts, ocrPluginType []uint8) (*MultiOCR3HelperTransmittedIterator, error) + + WatchTransmitted(opts *bind.WatchOpts, sink chan<- *MultiOCR3HelperTransmitted, ocrPluginType []uint8) (event.Subscription, error) + + ParseTransmitted(log types.Log) (*MultiOCR3HelperTransmitted, error) + + ParseLog(log types.Log) (generated.AbigenLog, error) + + Address() common.Address +} diff --git a/core/gethwrappers/ccip/generated/nonce_manager/nonce_manager.go b/core/gethwrappers/ccip/generated/nonce_manager/nonce_manager.go new file mode 100644 index 00000000000..b93daf75c39 --- /dev/null +++ b/core/gethwrappers/ccip/generated/nonce_manager/nonce_manager.go @@ -0,0 +1,1258 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package nonce_manager + +import ( + "errors" + "fmt" + "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" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" +) + +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +type AuthorizedCallersAuthorizedCallerArgs struct { + AddedCallers []common.Address + RemovedCallers []common.Address +} + +type NonceManagerPreviousRamps struct { + PrevOnRamp common.Address + PrevOffRamp common.Address +} + +type NonceManagerPreviousRampsArgs struct { + RemoteChainSelector uint64 + PrevRamps NonceManagerPreviousRamps +} + +var NonceManagerMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"authorizedCallers\",\"type\":\"address[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"PreviousRampAlreadySet\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"}],\"name\":\"UnauthorizedCaller\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddressNotAllowed\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"}],\"name\":\"AuthorizedCallerAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"}],\"name\":\"AuthorizedCallerRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"prevOnRamp\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"prevOffRamp\",\"type\":\"address\"}],\"indexed\":false,\"internalType\":\"structNonceManager.PreviousRamps\",\"name\":\"prevRamp\",\"type\":\"tuple\"}],\"name\":\"PreviousRampsUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"nonce\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"sender\",\"type\":\"bytes\"}],\"name\":\"SkippedIncorrectNonce\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address[]\",\"name\":\"addedCallers\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"removedCallers\",\"type\":\"address[]\"}],\"internalType\":\"structAuthorizedCallers.AuthorizedCallerArgs\",\"name\":\"authorizedCallerArgs\",\"type\":\"tuple\"}],\"name\":\"applyAuthorizedCallerUpdates\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"prevOnRamp\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"prevOffRamp\",\"type\":\"address\"}],\"internalType\":\"structNonceManager.PreviousRamps\",\"name\":\"prevRamps\",\"type\":\"tuple\"}],\"internalType\":\"structNonceManager.PreviousRampsArgs[]\",\"name\":\"previousRampsArgs\",\"type\":\"tuple[]\"}],\"name\":\"applyPreviousRampsUpdates\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAllAuthorizedCallers\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"sender\",\"type\":\"bytes\"}],\"name\":\"getInboundNonce\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"getIncrementedOutboundNonce\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"getOutboundNonce\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"}],\"name\":\"getPreviousRamps\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"prevOnRamp\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"prevOffRamp\",\"type\":\"address\"}],\"internalType\":\"structNonceManager.PreviousRamps\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"expectedNonce\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"sender\",\"type\":\"bytes\"}],\"name\":\"incrementInboundNonce\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", + Bin: "0x60806040523480156200001157600080fd5b5060405162001b9638038062001b968339810160408190526200003491620004b0565b8033806000816200008c5760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000bf57620000bf81620000f6565b5050604080518082018252838152815160008152602080820190935291810191909152620000ee9150620001a1565b5050620005d0565b336001600160a01b03821603620001505760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640162000083565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b602081015160005b815181101562000231576000828281518110620001ca57620001ca62000582565b60209081029190910101519050620001e4600282620002f0565b1562000227576040516001600160a01b03821681527fc3803387881faad271c47728894e3e36fac830ffc8602ca6fc07733cbda775809060200160405180910390a15b50600101620001a9565b50815160005b8151811015620002ea57600082828151811062000258576200025862000582565b6020026020010151905060006001600160a01b0316816001600160a01b03160362000296576040516342bcdf7f60e11b815260040160405180910390fd5b620002a360028262000310565b506040516001600160a01b03821681527feb1b9b92e50b7f88f9ff25d56765095ac6e91540eee214906f4036a908ffbdef9060200160405180910390a15060010162000237565b50505050565b600062000307836001600160a01b03841662000327565b90505b92915050565b600062000307836001600160a01b0384166200042b565b60008181526001830160205260408120548015620004205760006200034e60018362000598565b8554909150600090620003649060019062000598565b9050818114620003d057600086600001828154811062000388576200038862000582565b9060005260206000200154905080876000018481548110620003ae57620003ae62000582565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080620003e457620003e4620005ba565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506200030a565b60009150506200030a565b600081815260018301602052604081205462000474575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556200030a565b5060006200030a565b634e487b7160e01b600052604160045260246000fd5b80516001600160a01b0381168114620004ab57600080fd5b919050565b60006020808385031215620004c457600080fd5b82516001600160401b0380821115620004dc57600080fd5b818501915085601f830112620004f157600080fd5b8151818111156200050657620005066200047d565b8060051b604051601f19603f830116810181811085821117156200052e576200052e6200047d565b6040529182528482019250838101850191888311156200054d57600080fd5b938501935b828510156200057657620005668562000493565b8452938501939285019262000552565b98975050505050505050565b634e487b7160e01b600052603260045260246000fd5b818103818111156200030a57634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603160045260246000fd5b6115b680620005e06000396000f3fe608060405234801561001057600080fd5b50600436106100d45760003560e01c806391a2749a11610081578063e0e03cae1161005b578063e0e03cae1461027c578063ea458c0c1461029f578063f2fde38b146102b257600080fd5b806391a2749a1461022a578063bf18402a1461023d578063c92236251461026957600080fd5b806379ba5097116100b257806379ba5097146101e557806384d8acf7146101ef5780638da5cb5b1461020257600080fd5b8063181f5a77146100d95780632451a6271461012b578063294b563014610140575b600080fd5b6101156040518060400160405280601681526020017f4e6f6e63654d616e6167657220312e362e302d6465760000000000000000000081525081565b6040516101229190610f82565b60405180910390f35b6101336102c5565b6040516101229190610fef565b6101b161014e36600461105f565b60408051808201909152600080825260208201525067ffffffffffffffff166000908152600460209081526040918290208251808401909352805473ffffffffffffffffffffffffffffffffffffffff9081168452600190910154169082015290565b60408051825173ffffffffffffffffffffffffffffffffffffffff9081168252602093840151169281019290925201610122565b6101ed6102d6565b005b6101ed6101fd36600461107c565b6103d8565b60005460405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610122565b6101ed610238366004611207565b6105b4565b61025061024b3660046112ae565b6105c8565b60405167ffffffffffffffff9091168152602001610122565b610250610277366004611330565b6105dd565b61028f61028a366004611385565b6105f4565b6040519015158152602001610122565b6102506102ad3660046112ae565b6106fd565b6101ed6102c03660046113ea565b610791565b60606102d160026107a2565b905090565b60015473ffffffffffffffffffffffffffffffffffffffff16331461035c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e65720000000000000000000060448201526064015b60405180910390fd5b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b6103e06107af565b60005b818110156105af57368383838181106103fe576103fe611407565b6060029190910191506000905060048161041b602085018561105f565b67ffffffffffffffff1681526020810191909152604001600020805490915073ffffffffffffffffffffffffffffffffffffffff161515806104765750600181015473ffffffffffffffffffffffffffffffffffffffff1615155b156104ad576040517fc6117ae200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6104bd60408301602084016113ea565b81547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff9190911617815561050d60608301604084016113ea565b6001820180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055610561602083018361105f565b67ffffffffffffffff167fa2e43edcbc4fd175ae4bebbe3fd6139871ed1f1783cd4a1ace59b90d302c33198360200160405161059d9190611436565b60405180910390a250506001016103e3565b505050565b6105bc6107af565b6105c581610832565b50565b60006105d483836109c4565b90505b92915050565b60006105ea848484610ae1565b90505b9392505050565b60006105fe610c32565b600061060b868585610ae1565b6106169060016114ad565b90508467ffffffffffffffff168167ffffffffffffffff161461067a577f606ff8179e5e3c059b82df931acc496b7b6053e8879042f8267f930e0595f69f8686868660405161066894939291906114ce565b60405180910390a160009150506106f5565b67ffffffffffffffff86166000908152600660205260409081902090518291906106a7908790879061153a565b908152604051908190036020019020805467ffffffffffffffff929092167fffffffffffffffffffffffffffffffffffffffffffffffff000000000000000090921691909117905550600190505b949350505050565b6000610707610c32565b600061071384846109c4565b61071e9060016114ad565b67ffffffffffffffff808616600090815260056020908152604080832073ffffffffffffffffffffffffffffffffffffffff89168452909152902080549183167fffffffffffffffffffffffffffffffffffffffffffffffff000000000000000090921691909117905591505092915050565b6107996107af565b6105c581610c75565b606060006105ed83610d6a565b60005473ffffffffffffffffffffffffffffffffffffffff163314610830576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e6572000000000000000000006044820152606401610353565b565b602081015160005b81518110156108cd57600082828151811061085757610857611407565b60200260200101519050610875816002610dc690919063ffffffff16565b156108c45760405173ffffffffffffffffffffffffffffffffffffffff821681527fc3803387881faad271c47728894e3e36fac830ffc8602ca6fc07733cbda775809060200160405180910390a15b5060010161083a565b50815160005b81518110156109be5760008282815181106108f0576108f0611407565b60200260200101519050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610960576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61096b600282610de8565b5060405173ffffffffffffffffffffffffffffffffffffffff821681527feb1b9b92e50b7f88f9ff25d56765095ac6e91540eee214906f4036a908ffbdef9060200160405180910390a1506001016108d3565b50505050565b67ffffffffffffffff808316600090815260056020908152604080832073ffffffffffffffffffffffffffffffffffffffff861684529091528120549091168082036105d45767ffffffffffffffff841660009081526004602052604090205473ffffffffffffffffffffffffffffffffffffffff168015610ad9576040517f856c824700000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff858116600483015282169063856c824790602401602060405180830381865afa158015610aac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ad0919061154a565b925050506105d7565b509392505050565b67ffffffffffffffff83166000908152600660205260408082209051829190610b0d908690869061153a565b9081526040519081900360200190205467ffffffffffffffff16905060008190036105ea5767ffffffffffffffff851660009081526004602052604090206001015473ffffffffffffffffffffffffffffffffffffffff168015610c295773ffffffffffffffffffffffffffffffffffffffff811663856c8247610b93868801886113ea565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b16815273ffffffffffffffffffffffffffffffffffffffff9091166004820152602401602060405180830381865afa158015610bfc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c20919061154a565b925050506105ed565b50949350505050565b610c3d600233610e0a565b610830576040517fd86ad9cf000000000000000000000000000000000000000000000000000000008152336004820152602401610353565b3373ffffffffffffffffffffffffffffffffffffffff821603610cf4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c660000000000000000006044820152606401610353565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b606081600001805480602002602001604051908101604052809291908181526020018280548015610dba57602002820191906000526020600020905b815481526020019060010190808311610da6575b50505050509050919050565b60006105d48373ffffffffffffffffffffffffffffffffffffffff8416610e39565b60006105d48373ffffffffffffffffffffffffffffffffffffffff8416610f33565b73ffffffffffffffffffffffffffffffffffffffff8116600090815260018301602052604081205415156105d4565b60008181526001830160205260408120548015610f22576000610e5d600183611567565b8554909150600090610e7190600190611567565b9050818114610ed6576000866000018281548110610e9157610e91611407565b9060005260206000200154905080876000018481548110610eb457610eb4611407565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080610ee757610ee761157a565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506105d7565b60009150506105d7565b5092915050565b6000818152600183016020526040812054610f7a575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556105d7565b5060006105d7565b60006020808352835180602085015260005b81811015610fb057858101830151858201604001528201610f94565b5060006040828601015260407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8301168501019250505092915050565b6020808252825182820181905260009190848201906040850190845b8181101561103d57835173ffffffffffffffffffffffffffffffffffffffff168352928401929184019160010161100b565b50909695505050505050565b67ffffffffffffffff811681146105c557600080fd5b60006020828403121561107157600080fd5b81356105d481611049565b6000806020838503121561108f57600080fd5b823567ffffffffffffffff808211156110a757600080fd5b818501915085601f8301126110bb57600080fd5b8135818111156110ca57600080fd5b8660206060830285010111156110df57600080fd5b60209290920196919550909350505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b73ffffffffffffffffffffffffffffffffffffffff811681146105c557600080fd5b600082601f83011261115357600080fd5b8135602067ffffffffffffffff80831115611170576111706110f1565b8260051b6040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0603f830116810181811084821117156111b3576111b36110f1565b60405293845260208187018101949081019250878511156111d357600080fd5b6020870191505b848210156111fc5781356111ed81611120565b835291830191908301906111da565b979650505050505050565b60006020828403121561121957600080fd5b813567ffffffffffffffff8082111561123157600080fd5b908301906040828603121561124557600080fd5b604051604081018181108382111715611260576112606110f1565b60405282358281111561127257600080fd5b61127e87828601611142565b82525060208301358281111561129357600080fd5b61129f87828601611142565b60208301525095945050505050565b600080604083850312156112c157600080fd5b82356112cc81611049565b915060208301356112dc81611120565b809150509250929050565b60008083601f8401126112f957600080fd5b50813567ffffffffffffffff81111561131157600080fd5b60208301915083602082850101111561132957600080fd5b9250929050565b60008060006040848603121561134557600080fd5b833561135081611049565b9250602084013567ffffffffffffffff81111561136c57600080fd5b611378868287016112e7565b9497909650939450505050565b6000806000806060858703121561139b57600080fd5b84356113a681611049565b935060208501356113b681611049565b9250604085013567ffffffffffffffff8111156113d257600080fd5b6113de878288016112e7565b95989497509550505050565b6000602082840312156113fc57600080fd5b81356105d481611120565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60408101823561144581611120565b73ffffffffffffffffffffffffffffffffffffffff908116835260208401359061146e82611120565b8082166020850152505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b67ffffffffffffffff818116838216019080821115610f2c57610f2c61147e565b600067ffffffffffffffff8087168352808616602084015250606060408301528260608301528284608084013760006080848401015260807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f850116830101905095945050505050565b8183823760009101908152919050565b60006020828403121561155c57600080fd5b81516105d481611049565b818103818111156105d7576105d761147e565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fdfea164736f6c6343000818000a", +} + +var NonceManagerABI = NonceManagerMetaData.ABI + +var NonceManagerBin = NonceManagerMetaData.Bin + +func DeployNonceManager(auth *bind.TransactOpts, backend bind.ContractBackend, authorizedCallers []common.Address) (common.Address, *types.Transaction, *NonceManager, error) { + parsed, err := NonceManagerMetaData.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(NonceManagerBin), backend, authorizedCallers) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &NonceManager{address: address, abi: *parsed, NonceManagerCaller: NonceManagerCaller{contract: contract}, NonceManagerTransactor: NonceManagerTransactor{contract: contract}, NonceManagerFilterer: NonceManagerFilterer{contract: contract}}, nil +} + +type NonceManager struct { + address common.Address + abi abi.ABI + NonceManagerCaller + NonceManagerTransactor + NonceManagerFilterer +} + +type NonceManagerCaller struct { + contract *bind.BoundContract +} + +type NonceManagerTransactor struct { + contract *bind.BoundContract +} + +type NonceManagerFilterer struct { + contract *bind.BoundContract +} + +type NonceManagerSession struct { + Contract *NonceManager + CallOpts bind.CallOpts + TransactOpts bind.TransactOpts +} + +type NonceManagerCallerSession struct { + Contract *NonceManagerCaller + CallOpts bind.CallOpts +} + +type NonceManagerTransactorSession struct { + Contract *NonceManagerTransactor + TransactOpts bind.TransactOpts +} + +type NonceManagerRaw struct { + Contract *NonceManager +} + +type NonceManagerCallerRaw struct { + Contract *NonceManagerCaller +} + +type NonceManagerTransactorRaw struct { + Contract *NonceManagerTransactor +} + +func NewNonceManager(address common.Address, backend bind.ContractBackend) (*NonceManager, error) { + abi, err := abi.JSON(strings.NewReader(NonceManagerABI)) + if err != nil { + return nil, err + } + contract, err := bindNonceManager(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &NonceManager{address: address, abi: abi, NonceManagerCaller: NonceManagerCaller{contract: contract}, NonceManagerTransactor: NonceManagerTransactor{contract: contract}, NonceManagerFilterer: NonceManagerFilterer{contract: contract}}, nil +} + +func NewNonceManagerCaller(address common.Address, caller bind.ContractCaller) (*NonceManagerCaller, error) { + contract, err := bindNonceManager(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &NonceManagerCaller{contract: contract}, nil +} + +func NewNonceManagerTransactor(address common.Address, transactor bind.ContractTransactor) (*NonceManagerTransactor, error) { + contract, err := bindNonceManager(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &NonceManagerTransactor{contract: contract}, nil +} + +func NewNonceManagerFilterer(address common.Address, filterer bind.ContractFilterer) (*NonceManagerFilterer, error) { + contract, err := bindNonceManager(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &NonceManagerFilterer{contract: contract}, nil +} + +func bindNonceManager(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := NonceManagerMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +func (_NonceManager *NonceManagerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _NonceManager.Contract.NonceManagerCaller.contract.Call(opts, result, method, params...) +} + +func (_NonceManager *NonceManagerRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _NonceManager.Contract.NonceManagerTransactor.contract.Transfer(opts) +} + +func (_NonceManager *NonceManagerRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _NonceManager.Contract.NonceManagerTransactor.contract.Transact(opts, method, params...) +} + +func (_NonceManager *NonceManagerCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _NonceManager.Contract.contract.Call(opts, result, method, params...) +} + +func (_NonceManager *NonceManagerTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _NonceManager.Contract.contract.Transfer(opts) +} + +func (_NonceManager *NonceManagerTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _NonceManager.Contract.contract.Transact(opts, method, params...) +} + +func (_NonceManager *NonceManagerCaller) GetAllAuthorizedCallers(opts *bind.CallOpts) ([]common.Address, error) { + var out []interface{} + err := _NonceManager.contract.Call(opts, &out, "getAllAuthorizedCallers") + + if err != nil { + return *new([]common.Address), err + } + + out0 := *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) + + return out0, err + +} + +func (_NonceManager *NonceManagerSession) GetAllAuthorizedCallers() ([]common.Address, error) { + return _NonceManager.Contract.GetAllAuthorizedCallers(&_NonceManager.CallOpts) +} + +func (_NonceManager *NonceManagerCallerSession) GetAllAuthorizedCallers() ([]common.Address, error) { + return _NonceManager.Contract.GetAllAuthorizedCallers(&_NonceManager.CallOpts) +} + +func (_NonceManager *NonceManagerCaller) GetInboundNonce(opts *bind.CallOpts, sourceChainSelector uint64, sender []byte) (uint64, error) { + var out []interface{} + err := _NonceManager.contract.Call(opts, &out, "getInboundNonce", sourceChainSelector, sender) + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +func (_NonceManager *NonceManagerSession) GetInboundNonce(sourceChainSelector uint64, sender []byte) (uint64, error) { + return _NonceManager.Contract.GetInboundNonce(&_NonceManager.CallOpts, sourceChainSelector, sender) +} + +func (_NonceManager *NonceManagerCallerSession) GetInboundNonce(sourceChainSelector uint64, sender []byte) (uint64, error) { + return _NonceManager.Contract.GetInboundNonce(&_NonceManager.CallOpts, sourceChainSelector, sender) +} + +func (_NonceManager *NonceManagerCaller) GetOutboundNonce(opts *bind.CallOpts, destChainSelector uint64, sender common.Address) (uint64, error) { + var out []interface{} + err := _NonceManager.contract.Call(opts, &out, "getOutboundNonce", destChainSelector, sender) + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +func (_NonceManager *NonceManagerSession) GetOutboundNonce(destChainSelector uint64, sender common.Address) (uint64, error) { + return _NonceManager.Contract.GetOutboundNonce(&_NonceManager.CallOpts, destChainSelector, sender) +} + +func (_NonceManager *NonceManagerCallerSession) GetOutboundNonce(destChainSelector uint64, sender common.Address) (uint64, error) { + return _NonceManager.Contract.GetOutboundNonce(&_NonceManager.CallOpts, destChainSelector, sender) +} + +func (_NonceManager *NonceManagerCaller) GetPreviousRamps(opts *bind.CallOpts, chainSelector uint64) (NonceManagerPreviousRamps, error) { + var out []interface{} + err := _NonceManager.contract.Call(opts, &out, "getPreviousRamps", chainSelector) + + if err != nil { + return *new(NonceManagerPreviousRamps), err + } + + out0 := *abi.ConvertType(out[0], new(NonceManagerPreviousRamps)).(*NonceManagerPreviousRamps) + + return out0, err + +} + +func (_NonceManager *NonceManagerSession) GetPreviousRamps(chainSelector uint64) (NonceManagerPreviousRamps, error) { + return _NonceManager.Contract.GetPreviousRamps(&_NonceManager.CallOpts, chainSelector) +} + +func (_NonceManager *NonceManagerCallerSession) GetPreviousRamps(chainSelector uint64) (NonceManagerPreviousRamps, error) { + return _NonceManager.Contract.GetPreviousRamps(&_NonceManager.CallOpts, chainSelector) +} + +func (_NonceManager *NonceManagerCaller) Owner(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _NonceManager.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 + +} + +func (_NonceManager *NonceManagerSession) Owner() (common.Address, error) { + return _NonceManager.Contract.Owner(&_NonceManager.CallOpts) +} + +func (_NonceManager *NonceManagerCallerSession) Owner() (common.Address, error) { + return _NonceManager.Contract.Owner(&_NonceManager.CallOpts) +} + +func (_NonceManager *NonceManagerCaller) TypeAndVersion(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _NonceManager.contract.Call(opts, &out, "typeAndVersion") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +func (_NonceManager *NonceManagerSession) TypeAndVersion() (string, error) { + return _NonceManager.Contract.TypeAndVersion(&_NonceManager.CallOpts) +} + +func (_NonceManager *NonceManagerCallerSession) TypeAndVersion() (string, error) { + return _NonceManager.Contract.TypeAndVersion(&_NonceManager.CallOpts) +} + +func (_NonceManager *NonceManagerTransactor) AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + return _NonceManager.contract.Transact(opts, "acceptOwnership") +} + +func (_NonceManager *NonceManagerSession) AcceptOwnership() (*types.Transaction, error) { + return _NonceManager.Contract.AcceptOwnership(&_NonceManager.TransactOpts) +} + +func (_NonceManager *NonceManagerTransactorSession) AcceptOwnership() (*types.Transaction, error) { + return _NonceManager.Contract.AcceptOwnership(&_NonceManager.TransactOpts) +} + +func (_NonceManager *NonceManagerTransactor) ApplyAuthorizedCallerUpdates(opts *bind.TransactOpts, authorizedCallerArgs AuthorizedCallersAuthorizedCallerArgs) (*types.Transaction, error) { + return _NonceManager.contract.Transact(opts, "applyAuthorizedCallerUpdates", authorizedCallerArgs) +} + +func (_NonceManager *NonceManagerSession) ApplyAuthorizedCallerUpdates(authorizedCallerArgs AuthorizedCallersAuthorizedCallerArgs) (*types.Transaction, error) { + return _NonceManager.Contract.ApplyAuthorizedCallerUpdates(&_NonceManager.TransactOpts, authorizedCallerArgs) +} + +func (_NonceManager *NonceManagerTransactorSession) ApplyAuthorizedCallerUpdates(authorizedCallerArgs AuthorizedCallersAuthorizedCallerArgs) (*types.Transaction, error) { + return _NonceManager.Contract.ApplyAuthorizedCallerUpdates(&_NonceManager.TransactOpts, authorizedCallerArgs) +} + +func (_NonceManager *NonceManagerTransactor) ApplyPreviousRampsUpdates(opts *bind.TransactOpts, previousRampsArgs []NonceManagerPreviousRampsArgs) (*types.Transaction, error) { + return _NonceManager.contract.Transact(opts, "applyPreviousRampsUpdates", previousRampsArgs) +} + +func (_NonceManager *NonceManagerSession) ApplyPreviousRampsUpdates(previousRampsArgs []NonceManagerPreviousRampsArgs) (*types.Transaction, error) { + return _NonceManager.Contract.ApplyPreviousRampsUpdates(&_NonceManager.TransactOpts, previousRampsArgs) +} + +func (_NonceManager *NonceManagerTransactorSession) ApplyPreviousRampsUpdates(previousRampsArgs []NonceManagerPreviousRampsArgs) (*types.Transaction, error) { + return _NonceManager.Contract.ApplyPreviousRampsUpdates(&_NonceManager.TransactOpts, previousRampsArgs) +} + +func (_NonceManager *NonceManagerTransactor) GetIncrementedOutboundNonce(opts *bind.TransactOpts, destChainSelector uint64, sender common.Address) (*types.Transaction, error) { + return _NonceManager.contract.Transact(opts, "getIncrementedOutboundNonce", destChainSelector, sender) +} + +func (_NonceManager *NonceManagerSession) GetIncrementedOutboundNonce(destChainSelector uint64, sender common.Address) (*types.Transaction, error) { + return _NonceManager.Contract.GetIncrementedOutboundNonce(&_NonceManager.TransactOpts, destChainSelector, sender) +} + +func (_NonceManager *NonceManagerTransactorSession) GetIncrementedOutboundNonce(destChainSelector uint64, sender common.Address) (*types.Transaction, error) { + return _NonceManager.Contract.GetIncrementedOutboundNonce(&_NonceManager.TransactOpts, destChainSelector, sender) +} + +func (_NonceManager *NonceManagerTransactor) IncrementInboundNonce(opts *bind.TransactOpts, sourceChainSelector uint64, expectedNonce uint64, sender []byte) (*types.Transaction, error) { + return _NonceManager.contract.Transact(opts, "incrementInboundNonce", sourceChainSelector, expectedNonce, sender) +} + +func (_NonceManager *NonceManagerSession) IncrementInboundNonce(sourceChainSelector uint64, expectedNonce uint64, sender []byte) (*types.Transaction, error) { + return _NonceManager.Contract.IncrementInboundNonce(&_NonceManager.TransactOpts, sourceChainSelector, expectedNonce, sender) +} + +func (_NonceManager *NonceManagerTransactorSession) IncrementInboundNonce(sourceChainSelector uint64, expectedNonce uint64, sender []byte) (*types.Transaction, error) { + return _NonceManager.Contract.IncrementInboundNonce(&_NonceManager.TransactOpts, sourceChainSelector, expectedNonce, sender) +} + +func (_NonceManager *NonceManagerTransactor) TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) { + return _NonceManager.contract.Transact(opts, "transferOwnership", to) +} + +func (_NonceManager *NonceManagerSession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _NonceManager.Contract.TransferOwnership(&_NonceManager.TransactOpts, to) +} + +func (_NonceManager *NonceManagerTransactorSession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _NonceManager.Contract.TransferOwnership(&_NonceManager.TransactOpts, to) +} + +type NonceManagerAuthorizedCallerAddedIterator struct { + Event *NonceManagerAuthorizedCallerAdded + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *NonceManagerAuthorizedCallerAddedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(NonceManagerAuthorizedCallerAdded) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(NonceManagerAuthorizedCallerAdded) + 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() + } +} + +func (it *NonceManagerAuthorizedCallerAddedIterator) Error() error { + return it.fail +} + +func (it *NonceManagerAuthorizedCallerAddedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type NonceManagerAuthorizedCallerAdded struct { + Caller common.Address + Raw types.Log +} + +func (_NonceManager *NonceManagerFilterer) FilterAuthorizedCallerAdded(opts *bind.FilterOpts) (*NonceManagerAuthorizedCallerAddedIterator, error) { + + logs, sub, err := _NonceManager.contract.FilterLogs(opts, "AuthorizedCallerAdded") + if err != nil { + return nil, err + } + return &NonceManagerAuthorizedCallerAddedIterator{contract: _NonceManager.contract, event: "AuthorizedCallerAdded", logs: logs, sub: sub}, nil +} + +func (_NonceManager *NonceManagerFilterer) WatchAuthorizedCallerAdded(opts *bind.WatchOpts, sink chan<- *NonceManagerAuthorizedCallerAdded) (event.Subscription, error) { + + logs, sub, err := _NonceManager.contract.WatchLogs(opts, "AuthorizedCallerAdded") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(NonceManagerAuthorizedCallerAdded) + if err := _NonceManager.contract.UnpackLog(event, "AuthorizedCallerAdded", 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 +} + +func (_NonceManager *NonceManagerFilterer) ParseAuthorizedCallerAdded(log types.Log) (*NonceManagerAuthorizedCallerAdded, error) { + event := new(NonceManagerAuthorizedCallerAdded) + if err := _NonceManager.contract.UnpackLog(event, "AuthorizedCallerAdded", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type NonceManagerAuthorizedCallerRemovedIterator struct { + Event *NonceManagerAuthorizedCallerRemoved + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *NonceManagerAuthorizedCallerRemovedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(NonceManagerAuthorizedCallerRemoved) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(NonceManagerAuthorizedCallerRemoved) + 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() + } +} + +func (it *NonceManagerAuthorizedCallerRemovedIterator) Error() error { + return it.fail +} + +func (it *NonceManagerAuthorizedCallerRemovedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type NonceManagerAuthorizedCallerRemoved struct { + Caller common.Address + Raw types.Log +} + +func (_NonceManager *NonceManagerFilterer) FilterAuthorizedCallerRemoved(opts *bind.FilterOpts) (*NonceManagerAuthorizedCallerRemovedIterator, error) { + + logs, sub, err := _NonceManager.contract.FilterLogs(opts, "AuthorizedCallerRemoved") + if err != nil { + return nil, err + } + return &NonceManagerAuthorizedCallerRemovedIterator{contract: _NonceManager.contract, event: "AuthorizedCallerRemoved", logs: logs, sub: sub}, nil +} + +func (_NonceManager *NonceManagerFilterer) WatchAuthorizedCallerRemoved(opts *bind.WatchOpts, sink chan<- *NonceManagerAuthorizedCallerRemoved) (event.Subscription, error) { + + logs, sub, err := _NonceManager.contract.WatchLogs(opts, "AuthorizedCallerRemoved") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(NonceManagerAuthorizedCallerRemoved) + if err := _NonceManager.contract.UnpackLog(event, "AuthorizedCallerRemoved", 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 +} + +func (_NonceManager *NonceManagerFilterer) ParseAuthorizedCallerRemoved(log types.Log) (*NonceManagerAuthorizedCallerRemoved, error) { + event := new(NonceManagerAuthorizedCallerRemoved) + if err := _NonceManager.contract.UnpackLog(event, "AuthorizedCallerRemoved", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type NonceManagerOwnershipTransferRequestedIterator struct { + Event *NonceManagerOwnershipTransferRequested + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *NonceManagerOwnershipTransferRequestedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(NonceManagerOwnershipTransferRequested) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(NonceManagerOwnershipTransferRequested) + 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() + } +} + +func (it *NonceManagerOwnershipTransferRequestedIterator) Error() error { + return it.fail +} + +func (it *NonceManagerOwnershipTransferRequestedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type NonceManagerOwnershipTransferRequested struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_NonceManager *NonceManagerFilterer) FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*NonceManagerOwnershipTransferRequestedIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _NonceManager.contract.FilterLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return &NonceManagerOwnershipTransferRequestedIterator{contract: _NonceManager.contract, event: "OwnershipTransferRequested", logs: logs, sub: sub}, nil +} + +func (_NonceManager *NonceManagerFilterer) WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *NonceManagerOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _NonceManager.contract.WatchLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(NonceManagerOwnershipTransferRequested) + if err := _NonceManager.contract.UnpackLog(event, "OwnershipTransferRequested", 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 +} + +func (_NonceManager *NonceManagerFilterer) ParseOwnershipTransferRequested(log types.Log) (*NonceManagerOwnershipTransferRequested, error) { + event := new(NonceManagerOwnershipTransferRequested) + if err := _NonceManager.contract.UnpackLog(event, "OwnershipTransferRequested", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type NonceManagerOwnershipTransferredIterator struct { + Event *NonceManagerOwnershipTransferred + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *NonceManagerOwnershipTransferredIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(NonceManagerOwnershipTransferred) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(NonceManagerOwnershipTransferred) + 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() + } +} + +func (it *NonceManagerOwnershipTransferredIterator) Error() error { + return it.fail +} + +func (it *NonceManagerOwnershipTransferredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type NonceManagerOwnershipTransferred struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_NonceManager *NonceManagerFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*NonceManagerOwnershipTransferredIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _NonceManager.contract.FilterLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return &NonceManagerOwnershipTransferredIterator{contract: _NonceManager.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil +} + +func (_NonceManager *NonceManagerFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *NonceManagerOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _NonceManager.contract.WatchLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(NonceManagerOwnershipTransferred) + if err := _NonceManager.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 +} + +func (_NonceManager *NonceManagerFilterer) ParseOwnershipTransferred(log types.Log) (*NonceManagerOwnershipTransferred, error) { + event := new(NonceManagerOwnershipTransferred) + if err := _NonceManager.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type NonceManagerPreviousRampsUpdatedIterator struct { + Event *NonceManagerPreviousRampsUpdated + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *NonceManagerPreviousRampsUpdatedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(NonceManagerPreviousRampsUpdated) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(NonceManagerPreviousRampsUpdated) + 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() + } +} + +func (it *NonceManagerPreviousRampsUpdatedIterator) Error() error { + return it.fail +} + +func (it *NonceManagerPreviousRampsUpdatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type NonceManagerPreviousRampsUpdated struct { + RemoteChainSelector uint64 + PrevRamp NonceManagerPreviousRamps + Raw types.Log +} + +func (_NonceManager *NonceManagerFilterer) FilterPreviousRampsUpdated(opts *bind.FilterOpts, remoteChainSelector []uint64) (*NonceManagerPreviousRampsUpdatedIterator, error) { + + var remoteChainSelectorRule []interface{} + for _, remoteChainSelectorItem := range remoteChainSelector { + remoteChainSelectorRule = append(remoteChainSelectorRule, remoteChainSelectorItem) + } + + logs, sub, err := _NonceManager.contract.FilterLogs(opts, "PreviousRampsUpdated", remoteChainSelectorRule) + if err != nil { + return nil, err + } + return &NonceManagerPreviousRampsUpdatedIterator{contract: _NonceManager.contract, event: "PreviousRampsUpdated", logs: logs, sub: sub}, nil +} + +func (_NonceManager *NonceManagerFilterer) WatchPreviousRampsUpdated(opts *bind.WatchOpts, sink chan<- *NonceManagerPreviousRampsUpdated, remoteChainSelector []uint64) (event.Subscription, error) { + + var remoteChainSelectorRule []interface{} + for _, remoteChainSelectorItem := range remoteChainSelector { + remoteChainSelectorRule = append(remoteChainSelectorRule, remoteChainSelectorItem) + } + + logs, sub, err := _NonceManager.contract.WatchLogs(opts, "PreviousRampsUpdated", remoteChainSelectorRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(NonceManagerPreviousRampsUpdated) + if err := _NonceManager.contract.UnpackLog(event, "PreviousRampsUpdated", 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 +} + +func (_NonceManager *NonceManagerFilterer) ParsePreviousRampsUpdated(log types.Log) (*NonceManagerPreviousRampsUpdated, error) { + event := new(NonceManagerPreviousRampsUpdated) + if err := _NonceManager.contract.UnpackLog(event, "PreviousRampsUpdated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type NonceManagerSkippedIncorrectNonceIterator struct { + Event *NonceManagerSkippedIncorrectNonce + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *NonceManagerSkippedIncorrectNonceIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(NonceManagerSkippedIncorrectNonce) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(NonceManagerSkippedIncorrectNonce) + 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() + } +} + +func (it *NonceManagerSkippedIncorrectNonceIterator) Error() error { + return it.fail +} + +func (it *NonceManagerSkippedIncorrectNonceIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type NonceManagerSkippedIncorrectNonce struct { + SourceChainSelector uint64 + Nonce uint64 + Sender []byte + Raw types.Log +} + +func (_NonceManager *NonceManagerFilterer) FilterSkippedIncorrectNonce(opts *bind.FilterOpts) (*NonceManagerSkippedIncorrectNonceIterator, error) { + + logs, sub, err := _NonceManager.contract.FilterLogs(opts, "SkippedIncorrectNonce") + if err != nil { + return nil, err + } + return &NonceManagerSkippedIncorrectNonceIterator{contract: _NonceManager.contract, event: "SkippedIncorrectNonce", logs: logs, sub: sub}, nil +} + +func (_NonceManager *NonceManagerFilterer) WatchSkippedIncorrectNonce(opts *bind.WatchOpts, sink chan<- *NonceManagerSkippedIncorrectNonce) (event.Subscription, error) { + + logs, sub, err := _NonceManager.contract.WatchLogs(opts, "SkippedIncorrectNonce") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(NonceManagerSkippedIncorrectNonce) + if err := _NonceManager.contract.UnpackLog(event, "SkippedIncorrectNonce", 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 +} + +func (_NonceManager *NonceManagerFilterer) ParseSkippedIncorrectNonce(log types.Log) (*NonceManagerSkippedIncorrectNonce, error) { + event := new(NonceManagerSkippedIncorrectNonce) + if err := _NonceManager.contract.UnpackLog(event, "SkippedIncorrectNonce", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +func (_NonceManager *NonceManager) ParseLog(log types.Log) (generated.AbigenLog, error) { + switch log.Topics[0] { + case _NonceManager.abi.Events["AuthorizedCallerAdded"].ID: + return _NonceManager.ParseAuthorizedCallerAdded(log) + case _NonceManager.abi.Events["AuthorizedCallerRemoved"].ID: + return _NonceManager.ParseAuthorizedCallerRemoved(log) + case _NonceManager.abi.Events["OwnershipTransferRequested"].ID: + return _NonceManager.ParseOwnershipTransferRequested(log) + case _NonceManager.abi.Events["OwnershipTransferred"].ID: + return _NonceManager.ParseOwnershipTransferred(log) + case _NonceManager.abi.Events["PreviousRampsUpdated"].ID: + return _NonceManager.ParsePreviousRampsUpdated(log) + case _NonceManager.abi.Events["SkippedIncorrectNonce"].ID: + return _NonceManager.ParseSkippedIncorrectNonce(log) + + default: + return nil, fmt.Errorf("abigen wrapper received unknown log topic: %v", log.Topics[0]) + } +} + +func (NonceManagerAuthorizedCallerAdded) Topic() common.Hash { + return common.HexToHash("0xeb1b9b92e50b7f88f9ff25d56765095ac6e91540eee214906f4036a908ffbdef") +} + +func (NonceManagerAuthorizedCallerRemoved) Topic() common.Hash { + return common.HexToHash("0xc3803387881faad271c47728894e3e36fac830ffc8602ca6fc07733cbda77580") +} + +func (NonceManagerOwnershipTransferRequested) Topic() common.Hash { + return common.HexToHash("0xed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae1278") +} + +func (NonceManagerOwnershipTransferred) Topic() common.Hash { + return common.HexToHash("0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0") +} + +func (NonceManagerPreviousRampsUpdated) Topic() common.Hash { + return common.HexToHash("0xa2e43edcbc4fd175ae4bebbe3fd6139871ed1f1783cd4a1ace59b90d302c3319") +} + +func (NonceManagerSkippedIncorrectNonce) Topic() common.Hash { + return common.HexToHash("0x606ff8179e5e3c059b82df931acc496b7b6053e8879042f8267f930e0595f69f") +} + +func (_NonceManager *NonceManager) Address() common.Address { + return _NonceManager.address +} + +type NonceManagerInterface interface { + GetAllAuthorizedCallers(opts *bind.CallOpts) ([]common.Address, error) + + GetInboundNonce(opts *bind.CallOpts, sourceChainSelector uint64, sender []byte) (uint64, error) + + GetOutboundNonce(opts *bind.CallOpts, destChainSelector uint64, sender common.Address) (uint64, error) + + GetPreviousRamps(opts *bind.CallOpts, chainSelector uint64) (NonceManagerPreviousRamps, error) + + Owner(opts *bind.CallOpts) (common.Address, error) + + TypeAndVersion(opts *bind.CallOpts) (string, error) + + AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) + + ApplyAuthorizedCallerUpdates(opts *bind.TransactOpts, authorizedCallerArgs AuthorizedCallersAuthorizedCallerArgs) (*types.Transaction, error) + + ApplyPreviousRampsUpdates(opts *bind.TransactOpts, previousRampsArgs []NonceManagerPreviousRampsArgs) (*types.Transaction, error) + + GetIncrementedOutboundNonce(opts *bind.TransactOpts, destChainSelector uint64, sender common.Address) (*types.Transaction, error) + + IncrementInboundNonce(opts *bind.TransactOpts, sourceChainSelector uint64, expectedNonce uint64, sender []byte) (*types.Transaction, error) + + TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) + + FilterAuthorizedCallerAdded(opts *bind.FilterOpts) (*NonceManagerAuthorizedCallerAddedIterator, error) + + WatchAuthorizedCallerAdded(opts *bind.WatchOpts, sink chan<- *NonceManagerAuthorizedCallerAdded) (event.Subscription, error) + + ParseAuthorizedCallerAdded(log types.Log) (*NonceManagerAuthorizedCallerAdded, error) + + FilterAuthorizedCallerRemoved(opts *bind.FilterOpts) (*NonceManagerAuthorizedCallerRemovedIterator, error) + + WatchAuthorizedCallerRemoved(opts *bind.WatchOpts, sink chan<- *NonceManagerAuthorizedCallerRemoved) (event.Subscription, error) + + ParseAuthorizedCallerRemoved(log types.Log) (*NonceManagerAuthorizedCallerRemoved, error) + + FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*NonceManagerOwnershipTransferRequestedIterator, error) + + WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *NonceManagerOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferRequested(log types.Log) (*NonceManagerOwnershipTransferRequested, error) + + FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*NonceManagerOwnershipTransferredIterator, error) + + WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *NonceManagerOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferred(log types.Log) (*NonceManagerOwnershipTransferred, error) + + FilterPreviousRampsUpdated(opts *bind.FilterOpts, remoteChainSelector []uint64) (*NonceManagerPreviousRampsUpdatedIterator, error) + + WatchPreviousRampsUpdated(opts *bind.WatchOpts, sink chan<- *NonceManagerPreviousRampsUpdated, remoteChainSelector []uint64) (event.Subscription, error) + + ParsePreviousRampsUpdated(log types.Log) (*NonceManagerPreviousRampsUpdated, error) + + FilterSkippedIncorrectNonce(opts *bind.FilterOpts) (*NonceManagerSkippedIncorrectNonceIterator, error) + + WatchSkippedIncorrectNonce(opts *bind.WatchOpts, sink chan<- *NonceManagerSkippedIncorrectNonce) (event.Subscription, error) + + ParseSkippedIncorrectNonce(log types.Log) (*NonceManagerSkippedIncorrectNonce, error) + + ParseLog(log types.Log) (generated.AbigenLog, error) + + Address() common.Address +} diff --git a/core/gethwrappers/ccip/generated/ocr3_config_encoder/ocr3_config_encoder.go b/core/gethwrappers/ccip/generated/ocr3_config_encoder/ocr3_config_encoder.go new file mode 100644 index 00000000000..737a768dbea --- /dev/null +++ b/core/gethwrappers/ccip/generated/ocr3_config_encoder/ocr3_config_encoder.go @@ -0,0 +1,195 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package ocr3_config_encoder + +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" +) + +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +type CCIPConfigTypesOCR3Config struct { + PluginType uint8 + ChainSelector uint64 + F uint8 + OffchainConfigVersion uint64 + OfframpAddress []byte + P2pIds [][32]byte + Signers [][]byte + Transmitters [][]byte + OffchainConfig []byte +} + +var IOCR3ConfigEncoderMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"components\":[{\"internalType\":\"enumInternal.OCRPluginType\",\"name\":\"pluginType\",\"type\":\"uint8\"},{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint8\",\"name\":\"F\",\"type\":\"uint8\"},{\"internalType\":\"uint64\",\"name\":\"offchainConfigVersion\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"offrampAddress\",\"type\":\"bytes\"},{\"internalType\":\"bytes32[]\",\"name\":\"p2pIds\",\"type\":\"bytes32[]\"},{\"internalType\":\"bytes[]\",\"name\":\"signers\",\"type\":\"bytes[]\"},{\"internalType\":\"bytes[]\",\"name\":\"transmitters\",\"type\":\"bytes[]\"},{\"internalType\":\"bytes\",\"name\":\"offchainConfig\",\"type\":\"bytes\"}],\"internalType\":\"structCCIPConfigTypes.OCR3Config[]\",\"name\":\"config\",\"type\":\"tuple[]\"}],\"name\":\"exposeOCR3Config\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", +} + +var IOCR3ConfigEncoderABI = IOCR3ConfigEncoderMetaData.ABI + +type IOCR3ConfigEncoder struct { + address common.Address + abi abi.ABI + IOCR3ConfigEncoderCaller + IOCR3ConfigEncoderTransactor + IOCR3ConfigEncoderFilterer +} + +type IOCR3ConfigEncoderCaller struct { + contract *bind.BoundContract +} + +type IOCR3ConfigEncoderTransactor struct { + contract *bind.BoundContract +} + +type IOCR3ConfigEncoderFilterer struct { + contract *bind.BoundContract +} + +type IOCR3ConfigEncoderSession struct { + Contract *IOCR3ConfigEncoder + CallOpts bind.CallOpts + TransactOpts bind.TransactOpts +} + +type IOCR3ConfigEncoderCallerSession struct { + Contract *IOCR3ConfigEncoderCaller + CallOpts bind.CallOpts +} + +type IOCR3ConfigEncoderTransactorSession struct { + Contract *IOCR3ConfigEncoderTransactor + TransactOpts bind.TransactOpts +} + +type IOCR3ConfigEncoderRaw struct { + Contract *IOCR3ConfigEncoder +} + +type IOCR3ConfigEncoderCallerRaw struct { + Contract *IOCR3ConfigEncoderCaller +} + +type IOCR3ConfigEncoderTransactorRaw struct { + Contract *IOCR3ConfigEncoderTransactor +} + +func NewIOCR3ConfigEncoder(address common.Address, backend bind.ContractBackend) (*IOCR3ConfigEncoder, error) { + abi, err := abi.JSON(strings.NewReader(IOCR3ConfigEncoderABI)) + if err != nil { + return nil, err + } + contract, err := bindIOCR3ConfigEncoder(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &IOCR3ConfigEncoder{address: address, abi: abi, IOCR3ConfigEncoderCaller: IOCR3ConfigEncoderCaller{contract: contract}, IOCR3ConfigEncoderTransactor: IOCR3ConfigEncoderTransactor{contract: contract}, IOCR3ConfigEncoderFilterer: IOCR3ConfigEncoderFilterer{contract: contract}}, nil +} + +func NewIOCR3ConfigEncoderCaller(address common.Address, caller bind.ContractCaller) (*IOCR3ConfigEncoderCaller, error) { + contract, err := bindIOCR3ConfigEncoder(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &IOCR3ConfigEncoderCaller{contract: contract}, nil +} + +func NewIOCR3ConfigEncoderTransactor(address common.Address, transactor bind.ContractTransactor) (*IOCR3ConfigEncoderTransactor, error) { + contract, err := bindIOCR3ConfigEncoder(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &IOCR3ConfigEncoderTransactor{contract: contract}, nil +} + +func NewIOCR3ConfigEncoderFilterer(address common.Address, filterer bind.ContractFilterer) (*IOCR3ConfigEncoderFilterer, error) { + contract, err := bindIOCR3ConfigEncoder(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &IOCR3ConfigEncoderFilterer{contract: contract}, nil +} + +func bindIOCR3ConfigEncoder(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := IOCR3ConfigEncoderMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +func (_IOCR3ConfigEncoder *IOCR3ConfigEncoderRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _IOCR3ConfigEncoder.Contract.IOCR3ConfigEncoderCaller.contract.Call(opts, result, method, params...) +} + +func (_IOCR3ConfigEncoder *IOCR3ConfigEncoderRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _IOCR3ConfigEncoder.Contract.IOCR3ConfigEncoderTransactor.contract.Transfer(opts) +} + +func (_IOCR3ConfigEncoder *IOCR3ConfigEncoderRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _IOCR3ConfigEncoder.Contract.IOCR3ConfigEncoderTransactor.contract.Transact(opts, method, params...) +} + +func (_IOCR3ConfigEncoder *IOCR3ConfigEncoderCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _IOCR3ConfigEncoder.Contract.contract.Call(opts, result, method, params...) +} + +func (_IOCR3ConfigEncoder *IOCR3ConfigEncoderTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _IOCR3ConfigEncoder.Contract.contract.Transfer(opts) +} + +func (_IOCR3ConfigEncoder *IOCR3ConfigEncoderTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _IOCR3ConfigEncoder.Contract.contract.Transact(opts, method, params...) +} + +func (_IOCR3ConfigEncoder *IOCR3ConfigEncoderCaller) ExposeOCR3Config(opts *bind.CallOpts, config []CCIPConfigTypesOCR3Config) ([]byte, error) { + var out []interface{} + err := _IOCR3ConfigEncoder.contract.Call(opts, &out, "exposeOCR3Config", config) + + if err != nil { + return *new([]byte), err + } + + out0 := *abi.ConvertType(out[0], new([]byte)).(*[]byte) + + return out0, err + +} + +func (_IOCR3ConfigEncoder *IOCR3ConfigEncoderSession) ExposeOCR3Config(config []CCIPConfigTypesOCR3Config) ([]byte, error) { + return _IOCR3ConfigEncoder.Contract.ExposeOCR3Config(&_IOCR3ConfigEncoder.CallOpts, config) +} + +func (_IOCR3ConfigEncoder *IOCR3ConfigEncoderCallerSession) ExposeOCR3Config(config []CCIPConfigTypesOCR3Config) ([]byte, error) { + return _IOCR3ConfigEncoder.Contract.ExposeOCR3Config(&_IOCR3ConfigEncoder.CallOpts, config) +} + +func (_IOCR3ConfigEncoder *IOCR3ConfigEncoder) Address() common.Address { + return _IOCR3ConfigEncoder.address +} + +type IOCR3ConfigEncoderInterface interface { + ExposeOCR3Config(opts *bind.CallOpts, config []CCIPConfigTypesOCR3Config) ([]byte, error) + + Address() common.Address +} diff --git a/core/gethwrappers/ccip/generated/offramp/offramp.go b/core/gethwrappers/ccip/generated/offramp/offramp.go new file mode 100644 index 00000000000..51edddf9541 --- /dev/null +++ b/core/gethwrappers/ccip/generated/offramp/offramp.go @@ -0,0 +1,2590 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package offramp + +import ( + "errors" + "fmt" + "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" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" +) + +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +type ClientAny2EVMMessage struct { + MessageId [32]byte + SourceChainSelector uint64 + Sender []byte + Data []byte + DestTokenAmounts []ClientEVMTokenAmount +} + +type ClientEVMTokenAmount struct { + Token common.Address + Amount *big.Int +} + +type IRMNV2Signature struct { + R [32]byte + S [32]byte +} + +type InternalAny2EVMRampMessage struct { + Header InternalRampMessageHeader + Sender []byte + Data []byte + Receiver common.Address + GasLimit *big.Int + TokenAmounts []InternalRampTokenAmount +} + +type InternalExecutionReportSingleChain struct { + SourceChainSelector uint64 + Messages []InternalAny2EVMRampMessage + OffchainTokenData [][][]byte + Proofs [][32]byte + ProofFlagBits *big.Int +} + +type InternalGasPriceUpdate struct { + DestChainSelector uint64 + UsdPerUnitGas *big.Int +} + +type InternalMerkleRoot struct { + SourceChainSelector uint64 + MinSeqNr uint64 + MaxSeqNr uint64 + MerkleRoot [32]byte + OnRampAddress []byte +} + +type InternalPriceUpdates struct { + TokenPriceUpdates []InternalTokenPriceUpdate + GasPriceUpdates []InternalGasPriceUpdate +} + +type InternalRampMessageHeader struct { + MessageId [32]byte + SourceChainSelector uint64 + DestChainSelector uint64 + SequenceNumber uint64 + Nonce uint64 +} + +type InternalRampTokenAmount struct { + SourcePoolAddress []byte + DestTokenAddress []byte + ExtraData []byte + Amount *big.Int + DestExecData []byte +} + +type InternalTokenPriceUpdate struct { + SourceToken common.Address + UsdPerToken *big.Int +} + +type MultiOCR3BaseConfigInfo struct { + ConfigDigest [32]byte + F uint8 + N uint8 + IsSignatureVerificationEnabled bool +} + +type MultiOCR3BaseOCRConfig struct { + ConfigInfo MultiOCR3BaseConfigInfo + Signers []common.Address + Transmitters []common.Address +} + +type MultiOCR3BaseOCRConfigArgs struct { + ConfigDigest [32]byte + OcrPluginType uint8 + F uint8 + IsSignatureVerificationEnabled bool + Signers []common.Address + Transmitters []common.Address +} + +type OffRampCommitReport struct { + PriceUpdates InternalPriceUpdates + MerkleRoots []InternalMerkleRoot + RmnSignatures []IRMNV2Signature +} + +type OffRampDynamicConfig struct { + FeeQuoter common.Address + PermissionLessExecutionThresholdSeconds uint32 + MaxTokenTransferGas uint32 + MaxPoolReleaseOrMintGas uint32 + MessageValidator common.Address +} + +type OffRampSourceChainConfig struct { + Router common.Address + IsEnabled bool + MinSeqNr uint64 + OnRamp []byte +} + +type OffRampSourceChainConfigArgs struct { + Router common.Address + SourceChainSelector uint64 + IsEnabled bool + OnRamp []byte +} + +type OffRampStaticConfig struct { + ChainSelector uint64 + Rmn common.Address + TokenAdminRegistry common.Address + NonceManager common.Address +} + +var OffRampMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"},{\"internalType\":\"contractIRMNV2\",\"name\":\"rmn\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAdminRegistry\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"nonceManager\",\"type\":\"address\"}],\"internalType\":\"structOffRamp.StaticConfig\",\"name\":\"staticConfig\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"feeQuoter\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"permissionLessExecutionThresholdSeconds\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"maxTokenTransferGas\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"maxPoolReleaseOrMintGas\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"messageValidator\",\"type\":\"address\"}],\"internalType\":\"structOffRamp.DynamicConfig\",\"name\":\"dynamicConfig\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"contractIRouter\",\"name\":\"router\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"bytes\",\"name\":\"onRamp\",\"type\":\"bytes\"}],\"internalType\":\"structOffRamp.SourceChainConfigArgs[]\",\"name\":\"sourceChainConfigs\",\"type\":\"tuple[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"CanOnlySelfCall\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"expected\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"actual\",\"type\":\"bytes32\"}],\"name\":\"ConfigDigestMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"}],\"name\":\"CursedByRMN\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"EmptyReport\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"messageId\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"err\",\"type\":\"bytes\"}],\"name\":\"ExecutionError\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expected\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"actual\",\"type\":\"uint256\"}],\"name\":\"ForkedChain\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"enumMultiOCR3Base.InvalidConfigErrorType\",\"name\":\"errorType\",\"type\":\"uint8\"}],\"name\":\"InvalidConfig\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expected\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"got\",\"type\":\"uint256\"}],\"name\":\"InvalidDataLength\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"encodedAddress\",\"type\":\"bytes\"}],\"name\":\"InvalidEVMAddress\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"min\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"max\",\"type\":\"uint64\"}],\"name\":\"InvalidInterval\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"newLimit\",\"type\":\"uint256\"}],\"name\":\"InvalidManualExecutionGasLimit\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"messageDestChainSelector\",\"type\":\"uint64\"}],\"name\":\"InvalidMessageDestChainSelector\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"sequenceNumber\",\"type\":\"uint64\"},{\"internalType\":\"enumInternal.MessageExecutionState\",\"name\":\"newState\",\"type\":\"uint8\"}],\"name\":\"InvalidNewState\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidProof\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidRoot\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"}],\"name\":\"InvalidStaticConfig\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"LeavesCannotBeEmpty\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ManualExecutionGasLimitMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"}],\"name\":\"ManualExecutionNotYetEnabled\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"errorReason\",\"type\":\"bytes\"}],\"name\":\"MessageValidationError\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NonUniqueSignatures\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"notPool\",\"type\":\"address\"}],\"name\":\"NotACompatiblePool\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OracleCannotBeZeroAddress\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"err\",\"type\":\"bytes\"}],\"name\":\"ReceiverError\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountReleased\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"balancePre\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"balancePost\",\"type\":\"uint256\"}],\"name\":\"ReleaseOrMintBalanceMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"bytes32\",\"name\":\"merkleRoot\",\"type\":\"bytes32\"}],\"name\":\"RootAlreadyCommitted\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"}],\"name\":\"RootNotCommitted\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"SignaturesOutOfRegistration\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"}],\"name\":\"SourceChainNotEnabled\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"StaleCommitReport\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"ocrPluginType\",\"type\":\"uint8\"}],\"name\":\"StaticConfigCannotBeChanged\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"sequenceNumber\",\"type\":\"uint64\"}],\"name\":\"TokenDataMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"err\",\"type\":\"bytes\"}],\"name\":\"TokenHandlingError\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UnauthorizedSigner\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UnauthorizedTransmitter\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UnexpectedTokenData\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expected\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"actual\",\"type\":\"uint256\"}],\"name\":\"WrongMessageLength\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"WrongNumberOfSignatures\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddressNotAllowed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroChainSelectorNotAllowed\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"sequenceNumber\",\"type\":\"uint64\"}],\"name\":\"AlreadyAttempted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"components\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"sourceToken\",\"type\":\"address\"},{\"internalType\":\"uint224\",\"name\":\"usdPerToken\",\"type\":\"uint224\"}],\"internalType\":\"structInternal.TokenPriceUpdate[]\",\"name\":\"tokenPriceUpdates\",\"type\":\"tuple[]\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint224\",\"name\":\"usdPerUnitGas\",\"type\":\"uint224\"}],\"internalType\":\"structInternal.GasPriceUpdate[]\",\"name\":\"gasPriceUpdates\",\"type\":\"tuple[]\"}],\"internalType\":\"structInternal.PriceUpdates\",\"name\":\"priceUpdates\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"minSeqNr\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"maxSeqNr\",\"type\":\"uint64\"},{\"internalType\":\"bytes32\",\"name\":\"merkleRoot\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"onRampAddress\",\"type\":\"bytes\"}],\"internalType\":\"structInternal.MerkleRoot[]\",\"name\":\"merkleRoots\",\"type\":\"tuple[]\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"internalType\":\"structIRMNV2.Signature[]\",\"name\":\"rmnSignatures\",\"type\":\"tuple[]\"}],\"indexed\":false,\"internalType\":\"structOffRamp.CommitReport\",\"name\":\"report\",\"type\":\"tuple\"}],\"name\":\"CommitReportAccepted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"ocrPluginType\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"signers\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"transmitters\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"F\",\"type\":\"uint8\"}],\"name\":\"ConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"feeQuoter\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"permissionLessExecutionThresholdSeconds\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"maxTokenTransferGas\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"maxPoolReleaseOrMintGas\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"messageValidator\",\"type\":\"address\"}],\"indexed\":false,\"internalType\":\"structOffRamp.DynamicConfig\",\"name\":\"dynamicConfig\",\"type\":\"tuple\"}],\"name\":\"DynamicConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"sequenceNumber\",\"type\":\"uint64\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"messageId\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"messageHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"enumInternal.MessageExecutionState\",\"name\":\"state\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"returnData\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"gasUsed\",\"type\":\"uint256\"}],\"name\":\"ExecutionStateChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"root\",\"type\":\"bytes32\"}],\"name\":\"RootRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"sequenceNumber\",\"type\":\"uint64\"}],\"name\":\"SkippedAlreadyExecutedMessage\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"}],\"name\":\"SkippedReportExecution\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"components\":[{\"internalType\":\"contractIRouter\",\"name\":\"router\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint64\",\"name\":\"minSeqNr\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"onRamp\",\"type\":\"bytes\"}],\"indexed\":false,\"internalType\":\"structOffRamp.SourceChainConfig\",\"name\":\"sourceConfig\",\"type\":\"tuple\"}],\"name\":\"SourceChainConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"}],\"name\":\"SourceChainSelectorAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"},{\"internalType\":\"contractIRMNV2\",\"name\":\"rmn\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAdminRegistry\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"nonceManager\",\"type\":\"address\"}],\"indexed\":false,\"internalType\":\"structOffRamp.StaticConfig\",\"name\":\"staticConfig\",\"type\":\"tuple\"}],\"name\":\"StaticConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint8\",\"name\":\"ocrPluginType\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"sequenceNumber\",\"type\":\"uint64\"}],\"name\":\"Transmitted\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"contractIRouter\",\"name\":\"router\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"bytes\",\"name\":\"onRamp\",\"type\":\"bytes\"}],\"internalType\":\"structOffRamp.SourceChainConfigArgs[]\",\"name\":\"sourceChainConfigUpdates\",\"type\":\"tuple[]\"}],\"name\":\"applySourceChainConfigUpdates\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"messageId\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"sender\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"internalType\":\"structClient.EVMTokenAmount[]\",\"name\":\"destTokenAmounts\",\"type\":\"tuple[]\"}],\"internalType\":\"structClient.Any2EVMMessage\",\"name\":\"\",\"type\":\"tuple\"}],\"name\":\"ccipReceive\",\"outputs\":[],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32[3]\",\"name\":\"reportContext\",\"type\":\"bytes32[3]\"},{\"internalType\":\"bytes\",\"name\":\"report\",\"type\":\"bytes\"},{\"internalType\":\"bytes32[]\",\"name\":\"rs\",\"type\":\"bytes32[]\"},{\"internalType\":\"bytes32[]\",\"name\":\"ss\",\"type\":\"bytes32[]\"},{\"internalType\":\"bytes32\",\"name\":\"rawVs\",\"type\":\"bytes32\"}],\"name\":\"commit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32[3]\",\"name\":\"reportContext\",\"type\":\"bytes32[3]\"},{\"internalType\":\"bytes\",\"name\":\"report\",\"type\":\"bytes\"}],\"name\":\"execute\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"messageId\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"sequenceNumber\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"nonce\",\"type\":\"uint64\"}],\"internalType\":\"structInternal.RampMessageHeader\",\"name\":\"header\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"sender\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"gasLimit\",\"type\":\"uint256\"},{\"components\":[{\"internalType\":\"bytes\",\"name\":\"sourcePoolAddress\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"destTokenAddress\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"destExecData\",\"type\":\"bytes\"}],\"internalType\":\"structInternal.RampTokenAmount[]\",\"name\":\"tokenAmounts\",\"type\":\"tuple[]\"}],\"internalType\":\"structInternal.Any2EVMRampMessage\",\"name\":\"message\",\"type\":\"tuple\"},{\"internalType\":\"bytes[]\",\"name\":\"offchainTokenData\",\"type\":\"bytes[]\"}],\"name\":\"executeSingleMessage\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getDynamicConfig\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"feeQuoter\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"permissionLessExecutionThresholdSeconds\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"maxTokenTransferGas\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"maxPoolReleaseOrMintGas\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"messageValidator\",\"type\":\"address\"}],\"internalType\":\"structOffRamp.DynamicConfig\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"sequenceNumber\",\"type\":\"uint64\"}],\"name\":\"getExecutionState\",\"outputs\":[{\"internalType\":\"enumInternal.MessageExecutionState\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getLatestPriceSequenceNumber\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"bytes32\",\"name\":\"root\",\"type\":\"bytes32\"}],\"name\":\"getMerkleRoot\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"}],\"name\":\"getSourceChainConfig\",\"outputs\":[{\"components\":[{\"internalType\":\"contractIRouter\",\"name\":\"router\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint64\",\"name\":\"minSeqNr\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"onRamp\",\"type\":\"bytes\"}],\"internalType\":\"structOffRamp.SourceChainConfig\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getStaticConfig\",\"outputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"},{\"internalType\":\"contractIRMNV2\",\"name\":\"rmn\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAdminRegistry\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"nonceManager\",\"type\":\"address\"}],\"internalType\":\"structOffRamp.StaticConfig\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"ocrPluginType\",\"type\":\"uint8\"}],\"name\":\"latestConfigDetails\",\"outputs\":[{\"components\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"internalType\":\"uint8\",\"name\":\"F\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"n\",\"type\":\"uint8\"},{\"internalType\":\"bool\",\"name\":\"isSignatureVerificationEnabled\",\"type\":\"bool\"}],\"internalType\":\"structMultiOCR3Base.ConfigInfo\",\"name\":\"configInfo\",\"type\":\"tuple\"},{\"internalType\":\"address[]\",\"name\":\"signers\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"transmitters\",\"type\":\"address[]\"}],\"internalType\":\"structMultiOCR3Base.OCRConfig\",\"name\":\"ocrConfig\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"components\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"messageId\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"sequenceNumber\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"nonce\",\"type\":\"uint64\"}],\"internalType\":\"structInternal.RampMessageHeader\",\"name\":\"header\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"sender\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"gasLimit\",\"type\":\"uint256\"},{\"components\":[{\"internalType\":\"bytes\",\"name\":\"sourcePoolAddress\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"destTokenAddress\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"destExecData\",\"type\":\"bytes\"}],\"internalType\":\"structInternal.RampTokenAmount[]\",\"name\":\"tokenAmounts\",\"type\":\"tuple[]\"}],\"internalType\":\"structInternal.Any2EVMRampMessage[]\",\"name\":\"messages\",\"type\":\"tuple[]\"},{\"internalType\":\"bytes[][]\",\"name\":\"offchainTokenData\",\"type\":\"bytes[][]\"},{\"internalType\":\"bytes32[]\",\"name\":\"proofs\",\"type\":\"bytes32[]\"},{\"internalType\":\"uint256\",\"name\":\"proofFlagBits\",\"type\":\"uint256\"}],\"internalType\":\"structInternal.ExecutionReportSingleChain[]\",\"name\":\"reports\",\"type\":\"tuple[]\"},{\"internalType\":\"uint256[][]\",\"name\":\"gasLimitOverrides\",\"type\":\"uint256[][]\"}],\"name\":\"manuallyExecute\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"feeQuoter\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"permissionLessExecutionThresholdSeconds\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"maxTokenTransferGas\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"maxPoolReleaseOrMintGas\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"messageValidator\",\"type\":\"address\"}],\"internalType\":\"structOffRamp.DynamicConfig\",\"name\":\"dynamicConfig\",\"type\":\"tuple\"}],\"name\":\"setDynamicConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"internalType\":\"uint8\",\"name\":\"ocrPluginType\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"F\",\"type\":\"uint8\"},{\"internalType\":\"bool\",\"name\":\"isSignatureVerificationEnabled\",\"type\":\"bool\"},{\"internalType\":\"address[]\",\"name\":\"signers\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"transmitters\",\"type\":\"address[]\"}],\"internalType\":\"structMultiOCR3Base.OCRConfigArgs[]\",\"name\":\"ocrConfigArgs\",\"type\":\"tuple[]\"}],\"name\":\"setOCR3Configs\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", + Bin: "0x6101206040523480156200001257600080fd5b5060405162006c2638038062006c268339810160408190526200003591620008c7565b33806000816200008c5760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000bf57620000bf81620001fa565b5050466080525060208301516001600160a01b03161580620000ec575060408301516001600160a01b0316155b8062000103575060608301516001600160a01b0316155b1562000122576040516342bcdf7f60e11b815260040160405180910390fd5b82516001600160401b03166000036200014e5760405163c656089560e01b815260040160405180910390fd5b82516001600160401b0390811660a052602080850180516001600160a01b0390811660c05260408088018051831660e0526060808a01805185166101005283518b519098168852945184169587019590955251821690850152905116908201527f683eb52ee924eb817377cfa8f41f238f4bb7a877da5267869dfffbad85f564d89060800160405180910390a1620001e682620002a5565b620001f181620003c1565b50505062000c67565b336001600160a01b03821603620002545760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640162000083565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b80516001600160a01b0316620002ce576040516342bcdf7f60e11b815260040160405180910390fd5b80516004805460208085018051604080880180516060808b0180516001600160a01b039b8c166001600160c01b0319909a168a17600160a01b63ffffffff98891602176001600160c01b0316600160c01b948816949094026001600160e01b031693909317600160e01b93871693909302929092179098556080808b018051600580546001600160a01b031916918d169190911790558451988952955185169688019690965290518316918601919091525116938301939093529151909216908201527fa55bd56595c45f517e5967a3067f3dca684445a3080e7c04a4e0d5a40cda627d9060a00160405180910390a150565b60005b815181101562000666576000828281518110620003e557620003e562000a1d565b60200260200101519050600081602001519050806001600160401b0316600003620004235760405163c656089560e01b815260040160405180910390fd5b81516001600160a01b03166200044c576040516342bcdf7f60e11b815260040160405180910390fd5b6001600160401b0381166000908152600660205260408120600181018054919291620004789062000a33565b80601f0160208091040260200160405190810160405280929190818152602001828054620004a69062000a33565b8015620004f75780601f10620004cb57610100808354040283529160200191620004f7565b820191906000526020600020905b815481529060010190602001808311620004d957829003601f168201915b5050505050905060008460600151905081516000036200059e57805160000362000534576040516342bcdf7f60e11b815260040160405180910390fd5b6001830162000544828262000ac4565b508254600160a81b600160e81b031916600160a81b1783556040516001600160401b03851681527ff4c1390c70e5c0f491ae1ccbc06f9117cbbadf2767b247b3bc203280f24c0fb99060200160405180910390a1620005d9565b8080519060200120828051906020012014620005d95760405163c39a620560e01b81526001600160401b038516600482015260240162000083565b604080860151845487516001600160a01b03166001600160a01b0319921515600160a01b02929092166001600160a81b031990911617178455516001600160401b038516907f49f51971edd25182e97182d6ea372a0488ce2ab639f6a3a7ab4df0d2636fe56b906200064d90869062000b90565b60405180910390a25050505050806001019050620003c4565b5050565b634e487b7160e01b600052604160045260246000fd5b604051608081016001600160401b0381118282101715620006a557620006a56200066a565b60405290565b604051601f8201601f191681016001600160401b0381118282101715620006d657620006d66200066a565b604052919050565b80516001600160401b0381168114620006f657600080fd5b919050565b6001600160a01b03811681146200071157600080fd5b50565b805163ffffffff81168114620006f657600080fd5b6000601f83601f8401126200073d57600080fd5b825160206001600160401b03808311156200075c576200075c6200066a565b8260051b6200076d838201620006ab565b93845286810183019383810190898611156200078857600080fd5b84890192505b85831015620008ba57825184811115620007a85760008081fd5b89016080601f19828d038101821315620007c25760008081fd5b620007cc62000680565b88840151620007db81620006fb565b81526040620007ec858201620006de565b8a8301526060808601518015158114620008065760008081fd5b838301529385015193898511156200081e5760008081fd5b84860195508f603f8701126200083657600094508485fd5b8a8601519450898511156200084f576200084f6200066a565b620008608b858f88011601620006ab565b93508484528f82868801011115620008785760008081fd5b60005b8581101562000898578681018301518582018d01528b016200087b565b5060009484018b0194909452509182015283525091840191908401906200078e565b9998505050505050505050565b6000806000838503610140811215620008df57600080fd5b6080811215620008ee57600080fd5b620008f862000680565b6200090386620006de565b815260208601516200091581620006fb565b602082015260408601516200092a81620006fb565b604082015260608601516200093f81620006fb565b6060820152935060a0607f19820112156200095957600080fd5b5060405160a081016001600160401b0380821183831017156200098057620009806200066a565b81604052608087015191506200099682620006fb565b818352620009a760a0880162000714565b6020840152620009ba60c0880162000714565b6040840152620009cd60e0880162000714565b60608401526101008701519150620009e582620006fb565b608083018290526101208701519294508083111562000a0357600080fd5b505062000a138682870162000729565b9150509250925092565b634e487b7160e01b600052603260045260246000fd5b600181811c9082168062000a4857607f821691505b60208210810362000a6957634e487b7160e01b600052602260045260246000fd5b50919050565b601f82111562000abf576000816000526020600020601f850160051c8101602086101562000a9a5750805b601f850160051c820191505b8181101562000abb5782815560010162000aa6565b5050505b505050565b81516001600160401b0381111562000ae05762000ae06200066a565b62000af88162000af1845462000a33565b8462000a6f565b602080601f83116001811462000b30576000841562000b175750858301515b600019600386901b1c1916600185901b17855562000abb565b600085815260208120601f198616915b8281101562000b615788860151825594840194600190910190840162000b40565b508582101562000b805787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b602080825282546001600160a01b0381168383015260a081901c60ff161515604084015260a81c6001600160401b0316606083015260808083015260018084018054600093929190849062000be58162000a33565b8060a089015260c0600183166000811462000c09576001811462000c265762000c58565b60ff19841660c08b015260c083151560051b8b0101945062000c58565b85600052602060002060005b8481101562000c4f5781548c820185015290880190890162000c32565b8b0160c0019550505b50929998505050505050505050565b60805160a05160c05160e05161010051615f4962000cdd600039600081816102400152612a1a0152600081816102110152612f0e0152600081816101e20152818161077f01528181610986015261240c0152600081816101b201526126990152600081816117dd01526118290152615f496000f3fe608060405234801561001057600080fd5b50600436106101515760003560e01c806379ba5097116100cd578063c673e58411610081578063e9d68a8e11610066578063e9d68a8e1461052a578063f2fde38b1461054a578063f716f99f1461055d57600080fd5b8063c673e584146104c5578063ccd37ba3146104e557600080fd5b80638da5cb5b116100b25780638da5cb5b14610484578063991a50181461049f578063a80036b4146104b257600080fd5b806379ba50971461046e57806385572ffb1461047657600080fd5b80632d04ab76116101245780633f4b04aa116101095780633f4b04aa146103365780635e36480c146103525780637437ff9f1461037257600080fd5b80632d04ab7614610310578063311cd5131461032357600080fd5b806304666f9c1461015657806305d938b51461016b57806306285c691461017e578063181f5a77146102c7575b600080fd5b610169610164366004614086565b610570565b005b610169610179366004614710565b610584565b61027060408051608081018252600080825260208201819052918101829052606081019190915260405180608001604052807f000000000000000000000000000000000000000000000000000000000000000067ffffffffffffffff1681526020017f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031681526020017f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031681526020017f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316815250905090565b6040516102be9190815167ffffffffffffffff1681526020808301516001600160a01b0390811691830191909152604080840151821690830152606092830151169181019190915260800190565b60405180910390f35b6103036040518060400160405280601181526020017f4f666652616d7020312e362e302d64657600000000000000000000000000000081525081565b6040516102be919061488b565b61016961031e366004614936565b610729565b6101696103313660046149e9565b610cc1565b60095460405167ffffffffffffffff90911681526020016102be565b610365610360366004614a3d565b610d2a565b6040516102be9190614a9a565b6104116040805160a081018252600080825260208201819052918101829052606081018290526080810191909152506040805160a0810182526004546001600160a01b03808216835263ffffffff600160a01b83048116602085015278010000000000000000000000000000000000000000000000008304811694840194909452600160e01b9091049092166060820152600554909116608082015290565b6040516102be9190600060a0820190506001600160a01b03808451168352602084015163ffffffff808216602086015280604087015116604086015280606087015116606086015250508060808501511660808401525092915050565b610169610d80565b610169610151366004614aa8565b6000546040516001600160a01b0390911681526020016102be565b6101696104ad366004614af7565b610e3e565b6101696104c0366004614b6b565b610e4f565b6104d86104d3366004614bd8565b6111c2565b6040516102be9190614c38565b61051c6104f3366004614cad565b67ffffffffffffffff919091166000908152600860209081526040808320938352929052205490565b6040519081526020016102be565b61053d610538366004614cd7565b611320565b6040516102be9190614cf2565b610169610558366004614d40565b61142d565b61016961056b366004614dc5565b61143e565b610578611480565b610581816114dc565b50565b61058c6117da565b8151815181146105c8576040517f83e3f56400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b818110156107195760008482815181106105e7576105e7614f03565b6020026020010151905060008160200151519050600085848151811061060f5761060f614f03565b6020026020010151905080518214610653576040517f83e3f56400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b8281101561070a57600082828151811061067257610672614f03565b6020026020010151905080600014610701578460200151828151811061069a5761069a614f03565b6020026020010151608001518110156107015784516040517fc8e9605100000000000000000000000000000000000000000000000000000000815267ffffffffffffffff909116600482015260248101839052604481018290526064015b60405180910390fd5b50600101610656565b505050508060010190506105cb565b50610724838361185b565b505050565b600061073787890189615135565b602081015151909150156107e357602081015160408083015190517f30dfc3080000000000000000000000000000000000000000000000000000000081526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016926330dfc308926107b292600401615399565b60006040518083038186803b1580156107ca57600080fd5b505afa1580156107de573d6000803e3d6000fd5b505050505b805151511515806107f957508051602001515115155b156108f95760095460208a01359067ffffffffffffffff808316911610156108b8576009805467ffffffffffffffff191667ffffffffffffffff83161790556004805483516040517f3937306f0000000000000000000000000000000000000000000000000000000081526001600160a01b0390921692633937306f9261088192910161547b565b600060405180830381600087803b15801561089b57600080fd5b505af11580156108af573d6000803e3d6000fd5b505050506108f7565b8160200151516000036108f7576040517f2261116700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b505b60005b816020015151811015610c0a5760008260200151828151811061092157610921614f03565b602090810291909101015180516040517f2cbc26bb00000000000000000000000000000000000000000000000000000000815277ffffffffffffffff00000000000000000000000000000000608083901b166004820152919250906001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690632cbc26bb90602401602060405180830381865afa1580156109cd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109f1919061548e565b15610a34576040517ffdbd6a7200000000000000000000000000000000000000000000000000000000815267ffffffffffffffff821660048201526024016106f8565b6000610a3f8261190b565b6020840151815491925067ffffffffffffffff908116600160a81b90920416141580610a865750826040015167ffffffffffffffff16836020015167ffffffffffffffff16115b15610ae7578251602084015160408086015190517fd5e0f0d600000000000000000000000000000000000000000000000000000000815267ffffffffffffffff938416600482015291831660248301529190911660448201526064016106f8565b606083015180610b23576040517f504570e300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b835167ffffffffffffffff16600090815260086020908152604080832084845290915290205415610b965783516040517f32cf0cbf00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff9091166004820152602481018290526044016106f8565b6040840151610ba69060016154c1565b82547fffffff0000000000000000ffffffffffffffffffffffffffffffffffffffffff16600160a81b67ffffffffffffffff9283160217909255925116600090815260086020908152604080832094835293905291909120429055506001016108fc565b507fd7868a16facbdde7b5c020620136316b3c266fffcb4e1e41cb6a662fe14ba3e181604051610c3a91906154e9565b60405180910390a1610cb660008a8a8a8a8a8080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808e0282810182019093528d82529093508d92508c9182918501908490808284376000920191909152508b9250611972915050565b505050505050505050565b610d01610cd082840184615541565b6040805160008082526020820190925290610cfb565b6060815260200190600190039081610ce65790505b5061185b565b604080516000808252602082019092529050610d24600185858585866000611972565b50505050565b6000610d3860016004615576565b6002610d4560808561559f565b67ffffffffffffffff16610d5991906155c6565b610d638585611ce9565b901c166003811115610d7757610d77614a70565b90505b92915050565b6001546001600160a01b03163314610dda5760405162461bcd60e51b815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e65720000000000000000000060448201526064016106f8565b600080543373ffffffffffffffffffffffffffffffffffffffff19808316821784556001805490911690556040516001600160a01b0390921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b610e46611480565b61058181611d30565b333014610e88576040517f371a732800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040805160008082526020820190925281610ec5565b6040805180820190915260008082526020820152815260200190600190039081610e9e5790505b5060a08501515190915015610ef957610ef68460a00151856020015186606001518760000151602001518787611e96565b90505b6040805160a0810182528551518152855160209081015167ffffffffffffffff1681830152808701518351600094840192610f3592910161488b565b60408051601f19818403018152918152908252878101516020830152018390526005549091506001600160a01b03168015611042576040517f08d450a10000000000000000000000000000000000000000000000000000000081526001600160a01b038216906308d450a190610faf90859060040161567f565b600060405180830381600087803b158015610fc957600080fd5b505af1925050508015610fda575060015b611042573d808015611008576040519150601f19603f3d011682016040523d82523d6000602084013e61100d565b606091505b50806040517f09c253250000000000000000000000000000000000000000000000000000000081526004016106f8919061488b565b60408601515115801561105757506080860151155b8061106e575060608601516001600160a01b03163b155b806110ae575060608601516110ac906001600160a01b03167f85572ffb00000000000000000000000000000000000000000000000000000000611fb5565b155b156110bb57505050505050565b855160209081015167ffffffffffffffff1660009081526006909152604080822054608089015160608a015192517f3cf9798300000000000000000000000000000000000000000000000000000000815284936001600160a01b0390931692633cf97983926111339289926113889291600401615692565b6000604051808303816000875af1158015611152573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261117a91908101906156ce565b5091509150816111b857806040517f0a8d6e8c0000000000000000000000000000000000000000000000000000000081526004016106f8919061488b565b5050505050505050565b6112056040805160e081019091526000606082018181526080830182905260a0830182905260c08301919091528190815260200160608152602001606081525090565b60ff808316600090815260026020818152604092839020835160e081018552815460608201908152600183015480881660808401526101008104881660a0840152620100009004909616151560c0820152948552918201805484518184028101840190955280855292938583019390928301828280156112ae57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311611290575b505050505081526020016003820180548060200260200160405190810160405280929190818152602001828054801561131057602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116112f2575b5050505050815250509050919050565b604080516080808201835260008083526020808401829052838501829052606080850181905267ffffffffffffffff878116845260068352928690208651948501875280546001600160a01b0381168652600160a01b810460ff16151593860193909352600160a81b9092049092169483019490945260018401805493949293918401916113ad90615764565b80601f01602080910402602001604051908101604052809291908181526020018280546113d990615764565b80156113105780601f106113fb57610100808354040283529160200191611310565b820191906000526020600020905b81548152906001019060200180831161140957505050919092525091949350505050565b611435611480565b61058181611fd1565b611446611480565b60005b815181101561147c5761147482828151811061146757611467614f03565b6020026020010151612087565b600101611449565b5050565b6000546001600160a01b031633146114da5760405162461bcd60e51b815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e65720000000000000000000060448201526064016106f8565b565b60005b815181101561147c5760008282815181106114fc576114fc614f03565b602002602001015190506000816020015190508067ffffffffffffffff16600003611553576040517fc656089500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b81516001600160a01b031661157b576040516342bcdf7f60e11b815260040160405180910390fd5b67ffffffffffffffff811660009081526006602052604081206001810180549192916115a690615764565b80601f01602080910402602001604051908101604052809291908181526020018280546115d290615764565b801561161f5780601f106115f45761010080835404028352916020019161161f565b820191906000526020600020905b81548152906001019060200180831161160257829003601f168201915b5050505050905060008460600151905081516000036116d757805160000361165a576040516342bcdf7f60e11b815260040160405180910390fd5b6001830161166882826157ee565b5082547fffffff0000000000000000ffffffffffffffffffffffffffffffffffffffffff16600160a81b17835560405167ffffffffffffffff851681527ff4c1390c70e5c0f491ae1ccbc06f9117cbbadf2767b247b3bc203280f24c0fb99060200160405180910390a161172a565b808051906020012082805190602001201461172a576040517fc39a620500000000000000000000000000000000000000000000000000000000815267ffffffffffffffff851660048201526024016106f8565b604080860151845487516001600160a01b031673ffffffffffffffffffffffffffffffffffffffff19921515600160a01b02929092167fffffffffffffffffffffff000000000000000000000000000000000000000000909116171784555167ffffffffffffffff8516907f49f51971edd25182e97182d6ea372a0488ce2ab639f6a3a7ab4df0d2636fe56b906117c29086906158ae565b60405180910390a250505050508060010190506114df565b467f0000000000000000000000000000000000000000000000000000000000000000146114da576040517f0f01ce850000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000060048201524660248201526044016106f8565b8151600003611895576040517ebf199700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b805160408051600080825260208201909252911591905b8451811015611904576118fc8582815181106118ca576118ca614f03565b6020026020010151846118f6578583815181106118e9576118e9614f03565b60200260200101516123b8565b836123b8565b6001016118ac565b5050505050565b67ffffffffffffffff811660009081526006602052604081208054600160a01b900460ff16610d7a576040517fed053c5900000000000000000000000000000000000000000000000000000000815267ffffffffffffffff841660048201526024016106f8565b60ff878116600090815260026020908152604080832081516080810183528154815260019091015480861693820193909352610100830485169181019190915262010000909104909216151560608301528735906119d18760a461597c565b9050826060015115611a195784516119ea9060206155c6565b86516119f79060206155c6565b611a029060a061597c565b611a0c919061597c565b611a16908261597c565b90505b368114611a5b576040517f8e1192e1000000000000000000000000000000000000000000000000000000008152600481018290523660248201526044016106f8565b5081518114611aa35781516040517f93df584c0000000000000000000000000000000000000000000000000000000081526004810191909152602481018290526044016106f8565b611aab6117da565b60ff808a1660009081526003602090815260408083203384528252808320815180830190925280548086168352939491939092840191610100909104166002811115611af957611af9614a70565b6002811115611b0a57611b0a614a70565b9052509050600281602001516002811115611b2757611b27614a70565b148015611b7b5750600260008b60ff1660ff168152602001908152602001600020600301816000015160ff1681548110611b6357611b63614f03565b6000918252602090912001546001600160a01b031633145b611bb1576040517fda0f08e800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50816060015115611c93576020820151611bcc90600161598f565b60ff16855114611c08576040517f71253a2500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8351855114611c43576040517fa75d88af00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008787604051611c559291906159a8565b604051908190038120611c6c918b906020016159b8565b604051602081830303815290604052805190602001209050611c918a82888888612cc8565b505b6040805182815260208a81013567ffffffffffffffff169082015260ff8b16917f198d6990ef96613a9026203077e422916918b03ff47f0be6bee7b02d8e139ef0910160405180910390a2505050505050505050565b67ffffffffffffffff8216600090815260076020526040812081611d0e6080856159cc565b67ffffffffffffffff1681526020810191909152604001600020549392505050565b80516001600160a01b0316611d58576040516342bcdf7f60e11b815260040160405180910390fd5b80516004805460208085018051604080880180516060808b0180516001600160a01b039b8c167fffffffffffffffff000000000000000000000000000000000000000000000000909a168a17600160a01b63ffffffff988916021777ffffffffffffffffffffffffffffffffffffffffffffffff167801000000000000000000000000000000000000000000000000948816949094026001600160e01b031693909317600160e01b93871693909302929092179098556080808b0180516005805473ffffffffffffffffffffffffffffffffffffffff1916918d169190911790558451988952955185169688019690965290518316918601919091525116938301939093529151909216908201527fa55bd56595c45f517e5967a3067f3dca684445a3080e7c04a4e0d5a40cda627d9060a00160405180910390a150565b6060865167ffffffffffffffff811115611eb257611eb2613e9d565b604051908082528060200260200182016040528015611ef757816020015b6040805180820190915260008082526020820152815260200190600190039081611ed05790505b50905060005b8751811015611fa957611f84888281518110611f1b57611f1b614f03565b6020026020010151888888888887818110611f3857611f38614f03565b9050602002810190611f4a91906159f3565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250612ead92505050565b828281518110611f9657611f96614f03565b6020908102919091010152600101611efd565b505b9695505050505050565b6000611fc083613252565b8015610d775750610d7783836132b6565b336001600160a01b038216036120295760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c6600000000000000000060448201526064016106f8565b6001805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b806040015160ff166000036120b2576000604051631b3fab5160e11b81526004016106f89190615a3a565b60208082015160ff8082166000908152600290935260408320600181015492939092839216900361211f57606084015160018201805491151562010000027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ffff909216919091179055612174565b6060840151600182015460ff6201000090910416151590151514612174576040517f87f6037c00000000000000000000000000000000000000000000000000000000815260ff841660048201526024016106f8565b60a0840151805161010010156121a0576001604051631b3fab5160e11b81526004016106f89190615a3a565b61220684846003018054806020026020016040519081016040528092919081815260200182805480156121fc57602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116121de575b5050505050613371565b84606001511561232d5761227484846002018054806020026020016040519081016040528092919081815260200182805480156121fc576020028201919060005260206000209081546001600160a01b031681526001909101906020018083116121de575050505050613371565b6080850151805161010010156122a0576002604051631b3fab5160e11b81526004016106f89190615a3a565b60408601516122b0906003615a54565b60ff168151116122d6576003604051631b3fab5160e11b81526004016106f89190615a3a565b80516001840180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff1661010060ff84160217905561231e9060028601906020840190613e16565b5061232b858260016133da565b505b612339848260026133da565b805161234e9060038501906020840190613e16565b5060408581015160018401805460ff191660ff8316179055865180855560a088015192517fab8b1b57514019638d7b5ce9c638fe71366fe8e2be1c40a7a80f1733d0e9f547936123a79389939260028a01929190615a70565b60405180910390a16119048461354e565b815181516040517f2cbc26bb000000000000000000000000000000000000000000000000000000008152608083901b77ffffffffffffffff00000000000000000000000000000000166004820152901515907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690632cbc26bb90602401602060405180830381865afa15801561245b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061247f919061548e565b1561250b5780156124c8576040517ffdbd6a7200000000000000000000000000000000000000000000000000000000815267ffffffffffffffff831660048201526024016106f8565b60405167ffffffffffffffff831681527faab522ed53d887e56ed53dd37398a01aeef6a58e0fa77c2173beb9512d8949339060200160405180910390a150505050565b60006125168361190b565b600101805461252490615764565b80601f016020809104026020016040519081016040528092919081815260200182805461255090615764565b801561259d5780601f106125725761010080835404028352916020019161259d565b820191906000526020600020905b81548152906001019060200180831161258057829003601f168201915b505050602088015151929350505060008190036125e5576040517ebf199700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8560400151518114612623576040517f57e0e08300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008167ffffffffffffffff81111561263e5761263e613e9d565b604051908082528060200260200182016040528015612667578160200160208202803683370190505b50905060005b828110156127505760008860200151828151811061268d5761268d614f03565b602002602001015190507f000000000000000000000000000000000000000000000000000000000000000067ffffffffffffffff1681600001516040015167ffffffffffffffff161461272057805160409081015190517f38432a2200000000000000000000000000000000000000000000000000000000815267ffffffffffffffff90911660048201526024016106f8565b61272a818661356a565b83838151811061273c5761273c614f03565b60209081029190910101525060010161266d565b50600061276786838a606001518b6080015161368c565b9050806000036127af576040517f7dd17a7e00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff871660048201526024016106f8565b60005b83811015610cb65760005a905060008a6020015183815181106127d7576127d7614f03565b6020026020010151905060006127f58a836000015160600151610d2a565b9050600081600381111561280b5761280b614a70565b14806128285750600381600381111561282657612826614a70565b145b612880578151606001516040805167ffffffffffffffff808e16825290921660208301527f3b575419319662b2a6f5e2467d84521517a3382b908eb3d557bb3fdb0c50e23c91015b60405180910390a1505050612cc0565b881561295057600454600090600160a01b900463ffffffff166128a38742615576565b11905080806128c3575060038260038111156128c1576128c1614a70565b145b612905576040517fa9cfc86200000000000000000000000000000000000000000000000000000000815267ffffffffffffffff8c1660048201526024016106f8565b8b858151811061291757612917614f03565b602002602001015160001461294a578b858151811061293857612938614f03565b60200260200101518360800181815250505b506129b1565b600081600381111561296457612964614a70565b146129b1578151606001516040805167ffffffffffffffff808e16825290921660208301527f3ef2a99c550a751d4b0b261268f05a803dfb049ab43616a1ffb388f61fe651209101612870565b81516080015167ffffffffffffffff1615612aa05760008160038111156129da576129da614a70565b03612aa05781516080015160208301516040517fe0e03cae0000000000000000000000000000000000000000000000000000000081526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169263e0e03cae92612a51928f929190600401615b1c565b6020604051808303816000875af1158015612a70573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a94919061548e565b612aa057505050612cc0565b60008c604001518581518110612ab857612ab8614f03565b6020026020010151905080518360a001515114612b1c578251606001516040517f1cfe6d8b00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff808e16600483015290911660248201526044016106f8565b612b308b84600001516060015160016136ca565b600080612b3d8584613772565b91509150612b548d866000015160600151846136ca565b8b15612bc4576003826003811115612b6e57612b6e614a70565b03612bc4576000846003811115612b8757612b87614a70565b14612bc4578451516040517f2b11b8d90000000000000000000000000000000000000000000000000000000081526106f891908390600401615b49565b6002826003811115612bd857612bd8614a70565b14612c32576003826003811115612bf157612bf1614a70565b14612c32578451606001516040517f926c5a3e0000000000000000000000000000000000000000000000000000000081526106f8918f918590600401615b62565b84600001516000015185600001516060015167ffffffffffffffff168e67ffffffffffffffff167f05665fe9ad095383d018353f4cbcba77e84db27dd215081bbf7cdf9ae6fbe48b8c8b81518110612c8c57612c8c614f03565b602002602001015186865a612ca1908e615576565b604051612cb19493929190615b88565b60405180910390a45050505050505b6001016127b2565b8251600090815b818110156111b8576000600188868460208110612cee57612cee614f03565b612cfb91901a601b61598f565b898581518110612d0d57612d0d614f03565b6020026020010151898681518110612d2757612d27614f03565b602002602001015160405160008152602001604052604051612d65949392919093845260ff9290921660208401526040830152606082015260800190565b6020604051602081039080840390855afa158015612d87573d6000803e3d6000fd5b505060408051601f1981015160ff808e166000908152600360209081528582206001600160a01b03851683528152858220858701909652855480841686529397509095509293928401916101009004166002811115612de857612de8614a70565b6002811115612df957612df9614a70565b9052509050600181602001516002811115612e1657612e16614a70565b14612e4d576040517fca31867a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8051600160ff9091161b851615612e90576040517ff67bc7c400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b806000015160ff166001901b851794505050806001019050612ccf565b60408051808201909152600080825260208201526000612ed0876020015161383c565b6040517fbbe4f6db0000000000000000000000000000000000000000000000000000000081526001600160a01b0380831660048301529192506000917f0000000000000000000000000000000000000000000000000000000000000000169063bbe4f6db90602401602060405180830381865afa158015612f55573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f799190615bbf565b90506001600160a01b0381161580612fc15750612fbf6001600160a01b0382167faff2afbf00000000000000000000000000000000000000000000000000000000611fb5565b155b15613003576040517fae9b4ce90000000000000000000000000000000000000000000000000000000081526001600160a01b03821660048201526024016106f8565b60045460009081906130259089908690600160e01b900463ffffffff166138e2565b9150915060008060006130f26040518061010001604052808e81526020018c67ffffffffffffffff1681526020018d6001600160a01b031681526020018f606001518152602001896001600160a01b031681526020018f6000015181526020018f6040015181526020018b8152506040516024016130a39190615bdc565b60408051601f198184030181529190526020810180516001600160e01b03167f390775370000000000000000000000000000000000000000000000000000000017905287866113886084613a10565b9250925092508261313157816040517fe1cd55090000000000000000000000000000000000000000000000000000000081526004016106f8919061488b565b81516020146131795781516040517f78ef80240000000000000000000000000000000000000000000000000000000081526020600482015260248101919091526044016106f8565b60008280602001905181019061318f9190615ca9565b9050866001600160a01b03168c6001600160a01b0316146132245760006131c08d8a6131bb868a615576565b6138e2565b509050868110806131da5750816131d78883615576565b14155b15613222576040517fa966e21f0000000000000000000000000000000000000000000000000000000081526004810183905260248101889052604481018290526064016106f8565b505b604080518082019091526001600160a01b039098168852602088015250949550505050505095945050505050565b600061327e827f01ffc9a7000000000000000000000000000000000000000000000000000000006132b6565b8015610d7a57506132af827fffffffff000000000000000000000000000000000000000000000000000000006132b6565b1592915050565b6040517fffffffff0000000000000000000000000000000000000000000000000000000082166024820152600090819060440160408051601f19818403018152919052602080820180516001600160e01b03167f01ffc9a700000000000000000000000000000000000000000000000000000000178152825192935060009283928392909183918a617530fa92503d9150600051905082801561335a575060208210155b80156133665750600081115b979650505050505050565b60005b81518110156107245760ff8316600090815260036020526040812083519091908490849081106133a6576133a6614f03565b6020908102919091018101516001600160a01b03168252810191909152604001600020805461ffff19169055600101613374565b60005b8251811015610d245760008382815181106133fa576133fa614f03565b602002602001015190506000600281111561341757613417614a70565b60ff80871660009081526003602090815260408083206001600160a01b0387168452909152902054610100900416600281111561345657613456614a70565b14613477576004604051631b3fab5160e11b81526004016106f89190615a3a565b6001600160a01b0381166134b7576040517fd6c62c9b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60405180604001604052808360ff1681526020018460028111156134dd576134dd614a70565b905260ff80871660009081526003602090815260408083206001600160a01b0387168452825290912083518154931660ff198416811782559184015190929091839161ffff19161761010083600281111561353a5761353a614a70565b0217905550905050508060010190506133dd565b60ff8116610581576009805467ffffffffffffffff1916905550565b8151602080820151604092830151925160009384936135b0937f2425b0b9f9054c76ff151b0a175b18f37a4a4e82013a72e9f15c9caa095ed21f93909291889101615cc2565b60408051601f1981840301815290829052805160209182012086518051888401516060808b0151908401516080808d015195015195976135f99794969395929491939101615cf5565b604051602081830303815290604052805190602001208560400151805190602001208660a001516040516020016136309190615dfa565b60408051601f198184030181528282528051602091820120908301969096528101939093526060830191909152608082015260a081019190915260c0015b60405160208183030381529060405280519060200120905092915050565b60008061369a858585613b36565b67ffffffffffffffff8716600090815260086020908152604080832093835292905220549150505b949350505050565b600060026136d960808561559f565b67ffffffffffffffff166136ed91906155c6565b905060006136fb8585611ce9565b90508161370a60016004615576565b901b19168183600381111561372157613721614a70565b67ffffffffffffffff871660009081526007602052604081209190921b929092179182916137506080886159cc565b67ffffffffffffffff1681526020810191909152604001600020555050505050565b6040517fa80036b4000000000000000000000000000000000000000000000000000000008152600090606090309063a80036b4906137b69087908790600401615e5a565b600060405180830381600087803b1580156137d057600080fd5b505af19250505080156137e1575060015b613820573d80801561380f576040519150601f19603f3d011682016040523d82523d6000602084013e613814565b606091505b50600392509050613835565b50506040805160208101909152600081526002905b9250929050565b6000815160201461387b57816040517f8d666f600000000000000000000000000000000000000000000000000000000081526004016106f8919061488b565b6000828060200190518101906138919190615ca9565b90506001600160a01b038111806138a9575061040081105b15610d7a57826040517f8d666f600000000000000000000000000000000000000000000000000000000081526004016106f8919061488b565b600080600080600061395c8860405160240161390d91906001600160a01b0391909116815260200190565b60408051601f198184030181529190526020810180516001600160e01b03167f70a082310000000000000000000000000000000000000000000000000000000017905288886113886084613a10565b9250925092508261399b57816040517fe1cd55090000000000000000000000000000000000000000000000000000000081526004016106f8919061488b565b60208251146139e35781516040517f78ef80240000000000000000000000000000000000000000000000000000000081526020600482015260248101919091526044016106f8565b818060200190518101906139f79190615ca9565b613a018288615576565b94509450505050935093915050565b6000606060008361ffff1667ffffffffffffffff811115613a3357613a33613e9d565b6040519080825280601f01601f191660200182016040528015613a5d576020820181803683370190505b509150863b613a90577f0c3b563c0000000000000000000000000000000000000000000000000000000060005260046000fd5b5a85811015613ac3577fafa32a2c0000000000000000000000000000000000000000000000000000000060005260046000fd5b8590036040810481038710613afc577f37c3be290000000000000000000000000000000000000000000000000000000060005260046000fd5b505a6000808a5160208c0160008c8cf193505a900390503d84811115613b1f5750835b808352806000602085013e50955095509592505050565b8251825160009190818303613b77576040517f11a6b26400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6101018211801590613b8b57506101018111155b613ba8576040516309bde33960e01b815260040160405180910390fd5b60001982820101610100811115613bd2576040516309bde33960e01b815260040160405180910390fd5b80600003613bff5786600081518110613bed57613bed614f03565b60200260200101519350505050613dce565b60008167ffffffffffffffff811115613c1a57613c1a613e9d565b604051908082528060200260200182016040528015613c43578160200160208202803683370190505b50905060008080805b85811015613d6d5760006001821b8b811603613ca75788851015613c90578c5160018601958e918110613c8157613c81614f03565b60200260200101519050613cc9565b8551600185019487918110613c8157613c81614f03565b8b5160018401938d918110613cbe57613cbe614f03565b602002602001015190505b600089861015613cf9578d5160018701968f918110613cea57613cea614f03565b60200260200101519050613d1b565b8651600186019588918110613d1057613d10614f03565b602002602001015190505b82851115613d3c576040516309bde33960e01b815260040160405180910390fd5b613d468282613dd5565b878481518110613d5857613d58614f03565b60209081029190910101525050600101613c4c565b506001850382148015613d7f57508683145b8015613d8a57508581145b613da7576040516309bde33960e01b815260040160405180910390fd5b836001860381518110613dbc57613dbc614f03565b60200260200101519750505050505050505b9392505050565b6000818310613ded57613de88284613df3565b610d77565b610d7783835b60408051600160208201529081018390526060810182905260009060800161366e565b828054828255906000526020600020908101928215613e78579160200282015b82811115613e78578251825473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03909116178255602090920191600190910190613e36565b50613e84929150613e88565b5090565b5b80821115613e845760008155600101613e89565b634e487b7160e01b600052604160045260246000fd5b6040516080810167ffffffffffffffff81118282101715613ed657613ed6613e9d565b60405290565b60405160a0810167ffffffffffffffff81118282101715613ed657613ed6613e9d565b60405160c0810167ffffffffffffffff81118282101715613ed657613ed6613e9d565b6040805190810167ffffffffffffffff81118282101715613ed657613ed6613e9d565b6040516060810167ffffffffffffffff81118282101715613ed657613ed6613e9d565b604051601f8201601f1916810167ffffffffffffffff81118282101715613f9157613f91613e9d565b604052919050565b600067ffffffffffffffff821115613fb357613fb3613e9d565b5060051b60200190565b6001600160a01b038116811461058157600080fd5b803567ffffffffffffffff81168114613fea57600080fd5b919050565b801515811461058157600080fd5b8035613fea81613fef565b600067ffffffffffffffff82111561402257614022613e9d565b50601f01601f191660200190565b600082601f83011261404157600080fd5b813561405461404f82614008565b613f68565b81815284602083860101111561406957600080fd5b816020850160208301376000918101602001919091529392505050565b6000602080838503121561409957600080fd5b823567ffffffffffffffff808211156140b157600080fd5b818501915085601f8301126140c557600080fd5b81356140d361404f82613f99565b81815260059190911b830184019084810190888311156140f257600080fd5b8585015b838110156141985780358581111561410e5760008081fd5b86016080818c03601f19018113156141265760008081fd5b61412e613eb3565b8983013561413b81613fbd565b8152604061414a848201613fd2565b8b83015260608085013561415d81613fef565b8383015292840135928984111561417657600091508182fd5b6141848f8d86880101614030565b9083015250855250509186019186016140f6565b5098975050505050505050565b600060a082840312156141b757600080fd5b6141bf613edc565b9050813581526141d160208301613fd2565b60208201526141e260408301613fd2565b60408201526141f360608301613fd2565b606082015261420460808301613fd2565b608082015292915050565b8035613fea81613fbd565b600082601f83011261422b57600080fd5b8135602061423b61404f83613f99565b82815260059290921b8401810191818101908684111561425a57600080fd5b8286015b84811015611fa957803567ffffffffffffffff8082111561427f5760008081fd5b9088019060a0828b03601f19018113156142995760008081fd5b6142a1613edc565b87840135838111156142b35760008081fd5b6142c18d8a83880101614030565b825250604080850135848111156142d85760008081fd5b6142e68e8b83890101614030565b8a84015250606080860135858111156142ff5760008081fd5b61430d8f8c838a0101614030565b838501525060809150818601358184015250828501359250838311156143335760008081fd5b6143418d8a85880101614030565b90820152865250505091830191830161425e565b6000610140828403121561436857600080fd5b614370613eff565b905061437c83836141a5565b815260a082013567ffffffffffffffff8082111561439957600080fd5b6143a585838601614030565b602084015260c08401359150808211156143be57600080fd5b6143ca85838601614030565b60408401526143db60e0850161420f565b6060840152610100840135608084015261012084013591508082111561440057600080fd5b5061440d8482850161421a565b60a08301525092915050565b600082601f83011261442a57600080fd5b8135602061443a61404f83613f99565b82815260059290921b8401810191818101908684111561445957600080fd5b8286015b84811015611fa957803567ffffffffffffffff81111561447d5760008081fd5b61448b8986838b0101614355565b84525091830191830161445d565b600082601f8301126144aa57600080fd5b813560206144ba61404f83613f99565b82815260059290921b840181019181810190868411156144d957600080fd5b8286015b84811015611fa957803567ffffffffffffffff808211156144fd57600080fd5b818901915089603f83011261451157600080fd5b8582013561452161404f82613f99565b81815260059190911b830160400190878101908c83111561454157600080fd5b604085015b8381101561457a5780358581111561455d57600080fd5b61456c8f6040838a0101614030565b845250918901918901614546565b508752505050928401925083016144dd565b600082601f83011261459d57600080fd5b813560206145ad61404f83613f99565b8083825260208201915060208460051b8701019350868411156145cf57600080fd5b602086015b84811015611fa957803583529183019183016145d4565b600082601f8301126145fc57600080fd5b8135602061460c61404f83613f99565b82815260059290921b8401810191818101908684111561462b57600080fd5b8286015b84811015611fa957803567ffffffffffffffff808211156146505760008081fd5b9088019060a0828b03601f190181131561466a5760008081fd5b614672613edc565b61467d888501613fd2565b8152604080850135848111156146935760008081fd5b6146a18e8b83890101614419565b8a84015250606080860135858111156146ba5760008081fd5b6146c88f8c838a0101614499565b83850152506080915081860135858111156146e35760008081fd5b6146f18f8c838a010161458c565b918401919091525091909301359083015250835291830191830161462f565b600080604080848603121561472457600080fd5b833567ffffffffffffffff8082111561473c57600080fd5b614748878388016145eb565b945060209150818601358181111561475f57600080fd5b8601601f8101881361477057600080fd5b803561477e61404f82613f99565b81815260059190911b8201840190848101908a83111561479d57600080fd5b8584015b83811015614829578035868111156147b95760008081fd5b8501603f81018d136147cb5760008081fd5b878101356147db61404f82613f99565b81815260059190911b82018a0190898101908f8311156147fb5760008081fd5b928b01925b828410156148195783358252928a0192908a0190614800565b86525050509186019186016147a1565b50809750505050505050509250929050565b60005b8381101561485657818101518382015260200161483e565b50506000910152565b6000815180845261487781602086016020860161483b565b601f01601f19169290920160200192915050565b602081526000610d77602083018461485f565b8060608101831015610d7a57600080fd5b60008083601f8401126148c157600080fd5b50813567ffffffffffffffff8111156148d957600080fd5b60208301915083602082850101111561383557600080fd5b60008083601f84011261490357600080fd5b50813567ffffffffffffffff81111561491b57600080fd5b6020830191508360208260051b850101111561383557600080fd5b60008060008060008060008060e0898b03121561495257600080fd5b61495c8a8a61489e565b9750606089013567ffffffffffffffff8082111561497957600080fd5b6149858c838d016148af565b909950975060808b013591508082111561499e57600080fd5b6149aa8c838d016148f1565b909750955060a08b01359150808211156149c357600080fd5b506149d08b828c016148f1565b999c989b50969995989497949560c00135949350505050565b6000806000608084860312156149fe57600080fd5b614a08858561489e565b9250606084013567ffffffffffffffff811115614a2457600080fd5b614a30868287016148af565b9497909650939450505050565b60008060408385031215614a5057600080fd5b614a5983613fd2565b9150614a6760208401613fd2565b90509250929050565b634e487b7160e01b600052602160045260246000fd5b60048110614a9657614a96614a70565b9052565b60208101610d7a8284614a86565b600060208284031215614aba57600080fd5b813567ffffffffffffffff811115614ad157600080fd5b820160a08185031215613dce57600080fd5b803563ffffffff81168114613fea57600080fd5b600060a08284031215614b0957600080fd5b614b11613edc565b8235614b1c81613fbd565b8152614b2a60208401614ae3565b6020820152614b3b60408401614ae3565b6040820152614b4c60608401614ae3565b60608201526080830135614b5f81613fbd565b60808201529392505050565b600080600060408486031215614b8057600080fd5b833567ffffffffffffffff80821115614b9857600080fd5b614ba487838801614355565b94506020860135915080821115614bba57600080fd5b50614a30868287016148f1565b803560ff81168114613fea57600080fd5b600060208284031215614bea57600080fd5b610d7782614bc7565b60008151808452602080850194506020840160005b83811015614c2d5781516001600160a01b031687529582019590820190600101614c08565b509495945050505050565b60208152600082518051602084015260ff602082015116604084015260ff604082015116606084015260608101511515608084015250602083015160c060a0840152614c8760e0840182614bf3565b90506040840151601f198483030160c0850152614ca48282614bf3565b95945050505050565b60008060408385031215614cc057600080fd5b614cc983613fd2565b946020939093013593505050565b600060208284031215614ce957600080fd5b610d7782613fd2565b602081526001600160a01b03825116602082015260208201511515604082015267ffffffffffffffff6040830151166060820152600060608301516080808401526136c260a084018261485f565b600060208284031215614d5257600080fd5b8135613dce81613fbd565b600082601f830112614d6e57600080fd5b81356020614d7e61404f83613f99565b8083825260208201915060208460051b870101935086841115614da057600080fd5b602086015b84811015611fa9578035614db881613fbd565b8352918301918301614da5565b60006020808385031215614dd857600080fd5b823567ffffffffffffffff80821115614df057600080fd5b818501915085601f830112614e0457600080fd5b8135614e1261404f82613f99565b81815260059190911b83018401908481019088831115614e3157600080fd5b8585015b8381101561419857803585811115614e4c57600080fd5b860160c0818c03601f19011215614e635760008081fd5b614e6b613eff565b8882013581526040614e7e818401614bc7565b8a8301526060614e8f818501614bc7565b8284015260809150614ea2828501613ffd565b9083015260a08381013589811115614eba5760008081fd5b614ec88f8d83880101614d5d565b838501525060c0840135915088821115614ee25760008081fd5b614ef08e8c84870101614d5d565b9083015250845250918601918601614e35565b634e487b7160e01b600052603260045260246000fd5b80356001600160e01b0381168114613fea57600080fd5b600082601f830112614f4157600080fd5b81356020614f5161404f83613f99565b82815260069290921b84018101918181019086841115614f7057600080fd5b8286015b84811015611fa95760408189031215614f8d5760008081fd5b614f95613f22565b614f9e82613fd2565b8152614fab858301614f19565b81860152835291830191604001614f74565b600082601f830112614fce57600080fd5b81356020614fde61404f83613f99565b82815260059290921b84018101918181019086841115614ffd57600080fd5b8286015b84811015611fa957803567ffffffffffffffff808211156150225760008081fd5b9088019060a0828b03601f190181131561503c5760008081fd5b615044613edc565b61504f888501613fd2565b8152604061505e818601613fd2565b89830152606061506f818701613fd2565b8284015260809150818601358184015250828501359250838311156150945760008081fd5b6150a28d8a85880101614030565b908201528652505050918301918301615001565b600082601f8301126150c757600080fd5b813560206150d761404f83613f99565b82815260069290921b840181019181810190868411156150f657600080fd5b8286015b84811015611fa957604081890312156151135760008081fd5b61511b613f22565b8135815284820135858201528352918301916040016150fa565b6000602080838503121561514857600080fd5b823567ffffffffffffffff8082111561516057600080fd5b908401906060828703121561517457600080fd5b61517c613f45565b82358281111561518b57600080fd5b8301604081890381131561519e57600080fd5b6151a6613f22565b8235858111156151b557600080fd5b8301601f81018b136151c657600080fd5b80356151d461404f82613f99565b81815260069190911b8201890190898101908d8311156151f357600080fd5b928a01925b828410156152435785848f0312156152105760008081fd5b615218613f22565b843561522381613fbd565b8152615230858d01614f19565b818d0152825292850192908a01906151f8565b84525050508287013591508482111561525b57600080fd5b6152678a838501614f30565b8188015283525050828401358281111561528057600080fd5b61528c88828601614fbd565b858301525060408301359350818411156152a557600080fd5b6152b1878585016150b6565b60408201529695505050505050565b600082825180855260208086019550808260051b84010181860160005b8481101561535057858303601f190189528151805167ffffffffffffffff908116855285820151811686860152604080830151909116908501526060808201519085015260809081015160a09185018290529061533c8186018361485f565b9a86019a94505050908301906001016152dd565b5090979650505050505050565b60008151808452602080850194506020840160005b83811015614c2d578151805188528301518388015260409096019590820190600101615372565b6040815260006153ac60408301856152c0565b8281036020840152614ca4818561535d565b805160408084528151848201819052600092602091908201906060870190855b8181101561541557835180516001600160a01b031684528501516001600160e01b03168584015292840192918501916001016153de565b50508583015187820388850152805180835290840192506000918401905b8083101561546f578351805167ffffffffffffffff1683528501516001600160e01b031685830152928401926001929092019190850190615433565b50979650505050505050565b602081526000610d7760208301846153be565b6000602082840312156154a057600080fd5b8151613dce81613fef565b634e487b7160e01b600052601160045260246000fd5b67ffffffffffffffff8181168382160190808211156154e2576154e26154ab565b5092915050565b60208152600082516060602084015261550560808401826153be565b90506020840151601f198085840301604086015261552383836152c0565b9250604086015191508085840301606086015250614ca4828261535d565b60006020828403121561555357600080fd5b813567ffffffffffffffff81111561556a57600080fd5b6136c2848285016145eb565b81810381811115610d7a57610d7a6154ab565b634e487b7160e01b600052601260045260246000fd5b600067ffffffffffffffff808416806155ba576155ba615589565b92169190910692915050565b8082028115828204841417610d7a57610d7a6154ab565b805182526000602067ffffffffffffffff81840151168185015260408084015160a0604087015261561160a087018261485f565b90506060850151868203606088015261562a828261485f565b608087810151898303918a01919091528051808352908601935060009250908501905b8083101561546f57835180516001600160a01b031683528601518683015292850192600192909201919084019061564d565b602081526000610d7760208301846155dd565b6080815260006156a560808301876155dd565b61ffff9590951660208301525060408101929092526001600160a01b0316606090910152919050565b6000806000606084860312156156e357600080fd5b83516156ee81613fef565b602085015190935067ffffffffffffffff81111561570b57600080fd5b8401601f8101861361571c57600080fd5b805161572a61404f82614008565b81815287602083850101111561573f57600080fd5b61575082602083016020860161483b565b809450505050604084015190509250925092565b600181811c9082168061577857607f821691505b60208210810361579857634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115610724576000816000526020600020601f850160051c810160208610156157c75750805b601f850160051c820191505b818110156157e6578281556001016157d3565b505050505050565b815167ffffffffffffffff81111561580857615808613e9d565b61581c816158168454615764565b8461579e565b602080601f83116001811461585157600084156158395750858301515b600019600386901b1c1916600185901b1785556157e6565b600085815260208120601f198616915b8281101561588057888601518255948401946001909101908401615861565b508582101561589e5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6000602080835283546001600160a01b038116602085015260ff8160a01c161515604085015267ffffffffffffffff8160a81c1660608501525060018085016080808601526000815461590081615764565b8060a089015260c06001831660008114615921576001811461593d5761596d565b60ff19841660c08b015260c083151560051b8b0101945061596d565b85600052602060002060005b848110156159645781548c8201850152908801908901615949565b8b0160c0019550505b50929998505050505050505050565b80820180821115610d7a57610d7a6154ab565b60ff8181168382160190811115610d7a57610d7a6154ab565b8183823760009101908152919050565b828152606082602083013760800192915050565b600067ffffffffffffffff808416806159e7576159e7615589565b92169190910492915050565b6000808335601e19843603018112615a0a57600080fd5b83018035915067ffffffffffffffff821115615a2557600080fd5b60200191503681900382131561383557600080fd5b6020810160058310615a4e57615a4e614a70565b91905290565b60ff81811683821602908116908181146154e2576154e26154ab565b600060a0820160ff881683526020878185015260a0604085015281875480845260c0860191508860005282600020935060005b81811015615ac85784546001600160a01b031683526001948501949284019201615aa3565b50508481036060860152865180825290820192508187019060005b81811015615b085782516001600160a01b031685529383019391830191600101615ae3565b50505060ff85166080850152509050611fab565b600067ffffffffffffffff808616835280851660208401525060606040830152614ca4606083018461485f565b8281526040602082015260006136c2604083018461485f565b67ffffffffffffffff848116825283166020820152606081016136c26040830184614a86565b848152615b986020820185614a86565b608060408201526000615bae608083018561485f565b905082606083015295945050505050565b600060208284031215615bd157600080fd5b8151613dce81613fbd565b6020815260008251610100806020850152615bfb61012085018361485f565b91506020850151615c18604086018267ffffffffffffffff169052565b5060408501516001600160a01b038116606086015250606085015160808501526080850151615c5260a08601826001600160a01b03169052565b5060a0850151601f19808685030160c0870152615c6f848361485f565b935060c08701519150808685030160e0870152615c8c848361485f565b935060e0870151915080868503018387015250611fab838261485f565b600060208284031215615cbb57600080fd5b5051919050565b848152600067ffffffffffffffff808616602084015280851660408401525060806060830152611fab608083018461485f565b86815260c060208201526000615d0e60c083018861485f565b6001600160a01b039690961660408301525067ffffffffffffffff9384166060820152608081019290925290911660a09091015292915050565b600082825180855260208086019550808260051b84010181860160005b8481101561535057601f19868403018952815160a08151818652615d8b8287018261485f565b9150508582015185820387870152615da3828261485f565b91505060408083015186830382880152615dbd838261485f565b92505050606080830151818701525060808083015192508582038187015250615de6818361485f565b9a86019a9450505090830190600101615d65565b602081526000610d776020830184615d48565b60008282518085526020808601955060208260051b8401016020860160005b8481101561535057601f19868403018952615e4883835161485f565b98840198925090830190600101615e2c565b604081526000835180516040840152602081015167ffffffffffffffff80821660608601528060408401511660808601528060608401511660a08601528060808401511660c086015250505060208401516101408060e0850152615ec261018085018361485f565b91506040860151603f198086850301610100870152615ee1848361485f565b935060608801519150615f006101208701836001600160a01b03169052565b60808801518387015260a0880151925080868503016101608701525050615f278282615d48565b9150508281036020840152614ca48185615e0d56fea164736f6c6343000818000a", +} + +var OffRampABI = OffRampMetaData.ABI + +var OffRampBin = OffRampMetaData.Bin + +func DeployOffRamp(auth *bind.TransactOpts, backend bind.ContractBackend, staticConfig OffRampStaticConfig, dynamicConfig OffRampDynamicConfig, sourceChainConfigs []OffRampSourceChainConfigArgs) (common.Address, *types.Transaction, *OffRamp, error) { + parsed, err := OffRampMetaData.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(OffRampBin), backend, staticConfig, dynamicConfig, sourceChainConfigs) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &OffRamp{address: address, abi: *parsed, OffRampCaller: OffRampCaller{contract: contract}, OffRampTransactor: OffRampTransactor{contract: contract}, OffRampFilterer: OffRampFilterer{contract: contract}}, nil +} + +type OffRamp struct { + address common.Address + abi abi.ABI + OffRampCaller + OffRampTransactor + OffRampFilterer +} + +type OffRampCaller struct { + contract *bind.BoundContract +} + +type OffRampTransactor struct { + contract *bind.BoundContract +} + +type OffRampFilterer struct { + contract *bind.BoundContract +} + +type OffRampSession struct { + Contract *OffRamp + CallOpts bind.CallOpts + TransactOpts bind.TransactOpts +} + +type OffRampCallerSession struct { + Contract *OffRampCaller + CallOpts bind.CallOpts +} + +type OffRampTransactorSession struct { + Contract *OffRampTransactor + TransactOpts bind.TransactOpts +} + +type OffRampRaw struct { + Contract *OffRamp +} + +type OffRampCallerRaw struct { + Contract *OffRampCaller +} + +type OffRampTransactorRaw struct { + Contract *OffRampTransactor +} + +func NewOffRamp(address common.Address, backend bind.ContractBackend) (*OffRamp, error) { + abi, err := abi.JSON(strings.NewReader(OffRampABI)) + if err != nil { + return nil, err + } + contract, err := bindOffRamp(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &OffRamp{address: address, abi: abi, OffRampCaller: OffRampCaller{contract: contract}, OffRampTransactor: OffRampTransactor{contract: contract}, OffRampFilterer: OffRampFilterer{contract: contract}}, nil +} + +func NewOffRampCaller(address common.Address, caller bind.ContractCaller) (*OffRampCaller, error) { + contract, err := bindOffRamp(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &OffRampCaller{contract: contract}, nil +} + +func NewOffRampTransactor(address common.Address, transactor bind.ContractTransactor) (*OffRampTransactor, error) { + contract, err := bindOffRamp(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &OffRampTransactor{contract: contract}, nil +} + +func NewOffRampFilterer(address common.Address, filterer bind.ContractFilterer) (*OffRampFilterer, error) { + contract, err := bindOffRamp(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &OffRampFilterer{contract: contract}, nil +} + +func bindOffRamp(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := OffRampMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +func (_OffRamp *OffRampRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _OffRamp.Contract.OffRampCaller.contract.Call(opts, result, method, params...) +} + +func (_OffRamp *OffRampRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _OffRamp.Contract.OffRampTransactor.contract.Transfer(opts) +} + +func (_OffRamp *OffRampRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _OffRamp.Contract.OffRampTransactor.contract.Transact(opts, method, params...) +} + +func (_OffRamp *OffRampCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _OffRamp.Contract.contract.Call(opts, result, method, params...) +} + +func (_OffRamp *OffRampTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _OffRamp.Contract.contract.Transfer(opts) +} + +func (_OffRamp *OffRampTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _OffRamp.Contract.contract.Transact(opts, method, params...) +} + +func (_OffRamp *OffRampCaller) CcipReceive(opts *bind.CallOpts, arg0 ClientAny2EVMMessage) error { + var out []interface{} + err := _OffRamp.contract.Call(opts, &out, "ccipReceive", arg0) + + if err != nil { + return err + } + + return err + +} + +func (_OffRamp *OffRampSession) CcipReceive(arg0 ClientAny2EVMMessage) error { + return _OffRamp.Contract.CcipReceive(&_OffRamp.CallOpts, arg0) +} + +func (_OffRamp *OffRampCallerSession) CcipReceive(arg0 ClientAny2EVMMessage) error { + return _OffRamp.Contract.CcipReceive(&_OffRamp.CallOpts, arg0) +} + +func (_OffRamp *OffRampCaller) GetDynamicConfig(opts *bind.CallOpts) (OffRampDynamicConfig, error) { + var out []interface{} + err := _OffRamp.contract.Call(opts, &out, "getDynamicConfig") + + if err != nil { + return *new(OffRampDynamicConfig), err + } + + out0 := *abi.ConvertType(out[0], new(OffRampDynamicConfig)).(*OffRampDynamicConfig) + + return out0, err + +} + +func (_OffRamp *OffRampSession) GetDynamicConfig() (OffRampDynamicConfig, error) { + return _OffRamp.Contract.GetDynamicConfig(&_OffRamp.CallOpts) +} + +func (_OffRamp *OffRampCallerSession) GetDynamicConfig() (OffRampDynamicConfig, error) { + return _OffRamp.Contract.GetDynamicConfig(&_OffRamp.CallOpts) +} + +func (_OffRamp *OffRampCaller) GetExecutionState(opts *bind.CallOpts, sourceChainSelector uint64, sequenceNumber uint64) (uint8, error) { + var out []interface{} + err := _OffRamp.contract.Call(opts, &out, "getExecutionState", sourceChainSelector, sequenceNumber) + + if err != nil { + return *new(uint8), err + } + + out0 := *abi.ConvertType(out[0], new(uint8)).(*uint8) + + return out0, err + +} + +func (_OffRamp *OffRampSession) GetExecutionState(sourceChainSelector uint64, sequenceNumber uint64) (uint8, error) { + return _OffRamp.Contract.GetExecutionState(&_OffRamp.CallOpts, sourceChainSelector, sequenceNumber) +} + +func (_OffRamp *OffRampCallerSession) GetExecutionState(sourceChainSelector uint64, sequenceNumber uint64) (uint8, error) { + return _OffRamp.Contract.GetExecutionState(&_OffRamp.CallOpts, sourceChainSelector, sequenceNumber) +} + +func (_OffRamp *OffRampCaller) GetLatestPriceSequenceNumber(opts *bind.CallOpts) (uint64, error) { + var out []interface{} + err := _OffRamp.contract.Call(opts, &out, "getLatestPriceSequenceNumber") + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +func (_OffRamp *OffRampSession) GetLatestPriceSequenceNumber() (uint64, error) { + return _OffRamp.Contract.GetLatestPriceSequenceNumber(&_OffRamp.CallOpts) +} + +func (_OffRamp *OffRampCallerSession) GetLatestPriceSequenceNumber() (uint64, error) { + return _OffRamp.Contract.GetLatestPriceSequenceNumber(&_OffRamp.CallOpts) +} + +func (_OffRamp *OffRampCaller) GetMerkleRoot(opts *bind.CallOpts, sourceChainSelector uint64, root [32]byte) (*big.Int, error) { + var out []interface{} + err := _OffRamp.contract.Call(opts, &out, "getMerkleRoot", sourceChainSelector, root) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_OffRamp *OffRampSession) GetMerkleRoot(sourceChainSelector uint64, root [32]byte) (*big.Int, error) { + return _OffRamp.Contract.GetMerkleRoot(&_OffRamp.CallOpts, sourceChainSelector, root) +} + +func (_OffRamp *OffRampCallerSession) GetMerkleRoot(sourceChainSelector uint64, root [32]byte) (*big.Int, error) { + return _OffRamp.Contract.GetMerkleRoot(&_OffRamp.CallOpts, sourceChainSelector, root) +} + +func (_OffRamp *OffRampCaller) GetSourceChainConfig(opts *bind.CallOpts, sourceChainSelector uint64) (OffRampSourceChainConfig, error) { + var out []interface{} + err := _OffRamp.contract.Call(opts, &out, "getSourceChainConfig", sourceChainSelector) + + if err != nil { + return *new(OffRampSourceChainConfig), err + } + + out0 := *abi.ConvertType(out[0], new(OffRampSourceChainConfig)).(*OffRampSourceChainConfig) + + return out0, err + +} + +func (_OffRamp *OffRampSession) GetSourceChainConfig(sourceChainSelector uint64) (OffRampSourceChainConfig, error) { + return _OffRamp.Contract.GetSourceChainConfig(&_OffRamp.CallOpts, sourceChainSelector) +} + +func (_OffRamp *OffRampCallerSession) GetSourceChainConfig(sourceChainSelector uint64) (OffRampSourceChainConfig, error) { + return _OffRamp.Contract.GetSourceChainConfig(&_OffRamp.CallOpts, sourceChainSelector) +} + +func (_OffRamp *OffRampCaller) GetStaticConfig(opts *bind.CallOpts) (OffRampStaticConfig, error) { + var out []interface{} + err := _OffRamp.contract.Call(opts, &out, "getStaticConfig") + + if err != nil { + return *new(OffRampStaticConfig), err + } + + out0 := *abi.ConvertType(out[0], new(OffRampStaticConfig)).(*OffRampStaticConfig) + + return out0, err + +} + +func (_OffRamp *OffRampSession) GetStaticConfig() (OffRampStaticConfig, error) { + return _OffRamp.Contract.GetStaticConfig(&_OffRamp.CallOpts) +} + +func (_OffRamp *OffRampCallerSession) GetStaticConfig() (OffRampStaticConfig, error) { + return _OffRamp.Contract.GetStaticConfig(&_OffRamp.CallOpts) +} + +func (_OffRamp *OffRampCaller) LatestConfigDetails(opts *bind.CallOpts, ocrPluginType uint8) (MultiOCR3BaseOCRConfig, error) { + var out []interface{} + err := _OffRamp.contract.Call(opts, &out, "latestConfigDetails", ocrPluginType) + + if err != nil { + return *new(MultiOCR3BaseOCRConfig), err + } + + out0 := *abi.ConvertType(out[0], new(MultiOCR3BaseOCRConfig)).(*MultiOCR3BaseOCRConfig) + + return out0, err + +} + +func (_OffRamp *OffRampSession) LatestConfigDetails(ocrPluginType uint8) (MultiOCR3BaseOCRConfig, error) { + return _OffRamp.Contract.LatestConfigDetails(&_OffRamp.CallOpts, ocrPluginType) +} + +func (_OffRamp *OffRampCallerSession) LatestConfigDetails(ocrPluginType uint8) (MultiOCR3BaseOCRConfig, error) { + return _OffRamp.Contract.LatestConfigDetails(&_OffRamp.CallOpts, ocrPluginType) +} + +func (_OffRamp *OffRampCaller) Owner(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _OffRamp.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 + +} + +func (_OffRamp *OffRampSession) Owner() (common.Address, error) { + return _OffRamp.Contract.Owner(&_OffRamp.CallOpts) +} + +func (_OffRamp *OffRampCallerSession) Owner() (common.Address, error) { + return _OffRamp.Contract.Owner(&_OffRamp.CallOpts) +} + +func (_OffRamp *OffRampCaller) TypeAndVersion(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _OffRamp.contract.Call(opts, &out, "typeAndVersion") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +func (_OffRamp *OffRampSession) TypeAndVersion() (string, error) { + return _OffRamp.Contract.TypeAndVersion(&_OffRamp.CallOpts) +} + +func (_OffRamp *OffRampCallerSession) TypeAndVersion() (string, error) { + return _OffRamp.Contract.TypeAndVersion(&_OffRamp.CallOpts) +} + +func (_OffRamp *OffRampTransactor) AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + return _OffRamp.contract.Transact(opts, "acceptOwnership") +} + +func (_OffRamp *OffRampSession) AcceptOwnership() (*types.Transaction, error) { + return _OffRamp.Contract.AcceptOwnership(&_OffRamp.TransactOpts) +} + +func (_OffRamp *OffRampTransactorSession) AcceptOwnership() (*types.Transaction, error) { + return _OffRamp.Contract.AcceptOwnership(&_OffRamp.TransactOpts) +} + +func (_OffRamp *OffRampTransactor) ApplySourceChainConfigUpdates(opts *bind.TransactOpts, sourceChainConfigUpdates []OffRampSourceChainConfigArgs) (*types.Transaction, error) { + return _OffRamp.contract.Transact(opts, "applySourceChainConfigUpdates", sourceChainConfigUpdates) +} + +func (_OffRamp *OffRampSession) ApplySourceChainConfigUpdates(sourceChainConfigUpdates []OffRampSourceChainConfigArgs) (*types.Transaction, error) { + return _OffRamp.Contract.ApplySourceChainConfigUpdates(&_OffRamp.TransactOpts, sourceChainConfigUpdates) +} + +func (_OffRamp *OffRampTransactorSession) ApplySourceChainConfigUpdates(sourceChainConfigUpdates []OffRampSourceChainConfigArgs) (*types.Transaction, error) { + return _OffRamp.Contract.ApplySourceChainConfigUpdates(&_OffRamp.TransactOpts, sourceChainConfigUpdates) +} + +func (_OffRamp *OffRampTransactor) Commit(opts *bind.TransactOpts, reportContext [3][32]byte, report []byte, rs [][32]byte, ss [][32]byte, rawVs [32]byte) (*types.Transaction, error) { + return _OffRamp.contract.Transact(opts, "commit", reportContext, report, rs, ss, rawVs) +} + +func (_OffRamp *OffRampSession) Commit(reportContext [3][32]byte, report []byte, rs [][32]byte, ss [][32]byte, rawVs [32]byte) (*types.Transaction, error) { + return _OffRamp.Contract.Commit(&_OffRamp.TransactOpts, reportContext, report, rs, ss, rawVs) +} + +func (_OffRamp *OffRampTransactorSession) Commit(reportContext [3][32]byte, report []byte, rs [][32]byte, ss [][32]byte, rawVs [32]byte) (*types.Transaction, error) { + return _OffRamp.Contract.Commit(&_OffRamp.TransactOpts, reportContext, report, rs, ss, rawVs) +} + +func (_OffRamp *OffRampTransactor) Execute(opts *bind.TransactOpts, reportContext [3][32]byte, report []byte) (*types.Transaction, error) { + return _OffRamp.contract.Transact(opts, "execute", reportContext, report) +} + +func (_OffRamp *OffRampSession) Execute(reportContext [3][32]byte, report []byte) (*types.Transaction, error) { + return _OffRamp.Contract.Execute(&_OffRamp.TransactOpts, reportContext, report) +} + +func (_OffRamp *OffRampTransactorSession) Execute(reportContext [3][32]byte, report []byte) (*types.Transaction, error) { + return _OffRamp.Contract.Execute(&_OffRamp.TransactOpts, reportContext, report) +} + +func (_OffRamp *OffRampTransactor) ExecuteSingleMessage(opts *bind.TransactOpts, message InternalAny2EVMRampMessage, offchainTokenData [][]byte) (*types.Transaction, error) { + return _OffRamp.contract.Transact(opts, "executeSingleMessage", message, offchainTokenData) +} + +func (_OffRamp *OffRampSession) ExecuteSingleMessage(message InternalAny2EVMRampMessage, offchainTokenData [][]byte) (*types.Transaction, error) { + return _OffRamp.Contract.ExecuteSingleMessage(&_OffRamp.TransactOpts, message, offchainTokenData) +} + +func (_OffRamp *OffRampTransactorSession) ExecuteSingleMessage(message InternalAny2EVMRampMessage, offchainTokenData [][]byte) (*types.Transaction, error) { + return _OffRamp.Contract.ExecuteSingleMessage(&_OffRamp.TransactOpts, message, offchainTokenData) +} + +func (_OffRamp *OffRampTransactor) ManuallyExecute(opts *bind.TransactOpts, reports []InternalExecutionReportSingleChain, gasLimitOverrides [][]*big.Int) (*types.Transaction, error) { + return _OffRamp.contract.Transact(opts, "manuallyExecute", reports, gasLimitOverrides) +} + +func (_OffRamp *OffRampSession) ManuallyExecute(reports []InternalExecutionReportSingleChain, gasLimitOverrides [][]*big.Int) (*types.Transaction, error) { + return _OffRamp.Contract.ManuallyExecute(&_OffRamp.TransactOpts, reports, gasLimitOverrides) +} + +func (_OffRamp *OffRampTransactorSession) ManuallyExecute(reports []InternalExecutionReportSingleChain, gasLimitOverrides [][]*big.Int) (*types.Transaction, error) { + return _OffRamp.Contract.ManuallyExecute(&_OffRamp.TransactOpts, reports, gasLimitOverrides) +} + +func (_OffRamp *OffRampTransactor) SetDynamicConfig(opts *bind.TransactOpts, dynamicConfig OffRampDynamicConfig) (*types.Transaction, error) { + return _OffRamp.contract.Transact(opts, "setDynamicConfig", dynamicConfig) +} + +func (_OffRamp *OffRampSession) SetDynamicConfig(dynamicConfig OffRampDynamicConfig) (*types.Transaction, error) { + return _OffRamp.Contract.SetDynamicConfig(&_OffRamp.TransactOpts, dynamicConfig) +} + +func (_OffRamp *OffRampTransactorSession) SetDynamicConfig(dynamicConfig OffRampDynamicConfig) (*types.Transaction, error) { + return _OffRamp.Contract.SetDynamicConfig(&_OffRamp.TransactOpts, dynamicConfig) +} + +func (_OffRamp *OffRampTransactor) SetOCR3Configs(opts *bind.TransactOpts, ocrConfigArgs []MultiOCR3BaseOCRConfigArgs) (*types.Transaction, error) { + return _OffRamp.contract.Transact(opts, "setOCR3Configs", ocrConfigArgs) +} + +func (_OffRamp *OffRampSession) SetOCR3Configs(ocrConfigArgs []MultiOCR3BaseOCRConfigArgs) (*types.Transaction, error) { + return _OffRamp.Contract.SetOCR3Configs(&_OffRamp.TransactOpts, ocrConfigArgs) +} + +func (_OffRamp *OffRampTransactorSession) SetOCR3Configs(ocrConfigArgs []MultiOCR3BaseOCRConfigArgs) (*types.Transaction, error) { + return _OffRamp.Contract.SetOCR3Configs(&_OffRamp.TransactOpts, ocrConfigArgs) +} + +func (_OffRamp *OffRampTransactor) TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) { + return _OffRamp.contract.Transact(opts, "transferOwnership", to) +} + +func (_OffRamp *OffRampSession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _OffRamp.Contract.TransferOwnership(&_OffRamp.TransactOpts, to) +} + +func (_OffRamp *OffRampTransactorSession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _OffRamp.Contract.TransferOwnership(&_OffRamp.TransactOpts, to) +} + +type OffRampAlreadyAttemptedIterator struct { + Event *OffRampAlreadyAttempted + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *OffRampAlreadyAttemptedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(OffRampAlreadyAttempted) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(OffRampAlreadyAttempted) + 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() + } +} + +func (it *OffRampAlreadyAttemptedIterator) Error() error { + return it.fail +} + +func (it *OffRampAlreadyAttemptedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type OffRampAlreadyAttempted struct { + SourceChainSelector uint64 + SequenceNumber uint64 + Raw types.Log +} + +func (_OffRamp *OffRampFilterer) FilterAlreadyAttempted(opts *bind.FilterOpts) (*OffRampAlreadyAttemptedIterator, error) { + + logs, sub, err := _OffRamp.contract.FilterLogs(opts, "AlreadyAttempted") + if err != nil { + return nil, err + } + return &OffRampAlreadyAttemptedIterator{contract: _OffRamp.contract, event: "AlreadyAttempted", logs: logs, sub: sub}, nil +} + +func (_OffRamp *OffRampFilterer) WatchAlreadyAttempted(opts *bind.WatchOpts, sink chan<- *OffRampAlreadyAttempted) (event.Subscription, error) { + + logs, sub, err := _OffRamp.contract.WatchLogs(opts, "AlreadyAttempted") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(OffRampAlreadyAttempted) + if err := _OffRamp.contract.UnpackLog(event, "AlreadyAttempted", 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 +} + +func (_OffRamp *OffRampFilterer) ParseAlreadyAttempted(log types.Log) (*OffRampAlreadyAttempted, error) { + event := new(OffRampAlreadyAttempted) + if err := _OffRamp.contract.UnpackLog(event, "AlreadyAttempted", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type OffRampCommitReportAcceptedIterator struct { + Event *OffRampCommitReportAccepted + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *OffRampCommitReportAcceptedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(OffRampCommitReportAccepted) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(OffRampCommitReportAccepted) + 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() + } +} + +func (it *OffRampCommitReportAcceptedIterator) Error() error { + return it.fail +} + +func (it *OffRampCommitReportAcceptedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type OffRampCommitReportAccepted struct { + Report OffRampCommitReport + Raw types.Log +} + +func (_OffRamp *OffRampFilterer) FilterCommitReportAccepted(opts *bind.FilterOpts) (*OffRampCommitReportAcceptedIterator, error) { + + logs, sub, err := _OffRamp.contract.FilterLogs(opts, "CommitReportAccepted") + if err != nil { + return nil, err + } + return &OffRampCommitReportAcceptedIterator{contract: _OffRamp.contract, event: "CommitReportAccepted", logs: logs, sub: sub}, nil +} + +func (_OffRamp *OffRampFilterer) WatchCommitReportAccepted(opts *bind.WatchOpts, sink chan<- *OffRampCommitReportAccepted) (event.Subscription, error) { + + logs, sub, err := _OffRamp.contract.WatchLogs(opts, "CommitReportAccepted") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(OffRampCommitReportAccepted) + if err := _OffRamp.contract.UnpackLog(event, "CommitReportAccepted", 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 +} + +func (_OffRamp *OffRampFilterer) ParseCommitReportAccepted(log types.Log) (*OffRampCommitReportAccepted, error) { + event := new(OffRampCommitReportAccepted) + if err := _OffRamp.contract.UnpackLog(event, "CommitReportAccepted", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type OffRampConfigSetIterator struct { + Event *OffRampConfigSet + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *OffRampConfigSetIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(OffRampConfigSet) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(OffRampConfigSet) + 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() + } +} + +func (it *OffRampConfigSetIterator) Error() error { + return it.fail +} + +func (it *OffRampConfigSetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type OffRampConfigSet struct { + OcrPluginType uint8 + ConfigDigest [32]byte + Signers []common.Address + Transmitters []common.Address + F uint8 + Raw types.Log +} + +func (_OffRamp *OffRampFilterer) FilterConfigSet(opts *bind.FilterOpts) (*OffRampConfigSetIterator, error) { + + logs, sub, err := _OffRamp.contract.FilterLogs(opts, "ConfigSet") + if err != nil { + return nil, err + } + return &OffRampConfigSetIterator{contract: _OffRamp.contract, event: "ConfigSet", logs: logs, sub: sub}, nil +} + +func (_OffRamp *OffRampFilterer) WatchConfigSet(opts *bind.WatchOpts, sink chan<- *OffRampConfigSet) (event.Subscription, error) { + + logs, sub, err := _OffRamp.contract.WatchLogs(opts, "ConfigSet") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(OffRampConfigSet) + if err := _OffRamp.contract.UnpackLog(event, "ConfigSet", 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 +} + +func (_OffRamp *OffRampFilterer) ParseConfigSet(log types.Log) (*OffRampConfigSet, error) { + event := new(OffRampConfigSet) + if err := _OffRamp.contract.UnpackLog(event, "ConfigSet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type OffRampDynamicConfigSetIterator struct { + Event *OffRampDynamicConfigSet + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *OffRampDynamicConfigSetIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(OffRampDynamicConfigSet) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(OffRampDynamicConfigSet) + 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() + } +} + +func (it *OffRampDynamicConfigSetIterator) Error() error { + return it.fail +} + +func (it *OffRampDynamicConfigSetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type OffRampDynamicConfigSet struct { + DynamicConfig OffRampDynamicConfig + Raw types.Log +} + +func (_OffRamp *OffRampFilterer) FilterDynamicConfigSet(opts *bind.FilterOpts) (*OffRampDynamicConfigSetIterator, error) { + + logs, sub, err := _OffRamp.contract.FilterLogs(opts, "DynamicConfigSet") + if err != nil { + return nil, err + } + return &OffRampDynamicConfigSetIterator{contract: _OffRamp.contract, event: "DynamicConfigSet", logs: logs, sub: sub}, nil +} + +func (_OffRamp *OffRampFilterer) WatchDynamicConfigSet(opts *bind.WatchOpts, sink chan<- *OffRampDynamicConfigSet) (event.Subscription, error) { + + logs, sub, err := _OffRamp.contract.WatchLogs(opts, "DynamicConfigSet") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(OffRampDynamicConfigSet) + if err := _OffRamp.contract.UnpackLog(event, "DynamicConfigSet", 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 +} + +func (_OffRamp *OffRampFilterer) ParseDynamicConfigSet(log types.Log) (*OffRampDynamicConfigSet, error) { + event := new(OffRampDynamicConfigSet) + if err := _OffRamp.contract.UnpackLog(event, "DynamicConfigSet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type OffRampExecutionStateChangedIterator struct { + Event *OffRampExecutionStateChanged + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *OffRampExecutionStateChangedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(OffRampExecutionStateChanged) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(OffRampExecutionStateChanged) + 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() + } +} + +func (it *OffRampExecutionStateChangedIterator) Error() error { + return it.fail +} + +func (it *OffRampExecutionStateChangedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type OffRampExecutionStateChanged struct { + SourceChainSelector uint64 + SequenceNumber uint64 + MessageId [32]byte + MessageHash [32]byte + State uint8 + ReturnData []byte + GasUsed *big.Int + Raw types.Log +} + +func (_OffRamp *OffRampFilterer) FilterExecutionStateChanged(opts *bind.FilterOpts, sourceChainSelector []uint64, sequenceNumber []uint64, messageId [][32]byte) (*OffRampExecutionStateChangedIterator, error) { + + var sourceChainSelectorRule []interface{} + for _, sourceChainSelectorItem := range sourceChainSelector { + sourceChainSelectorRule = append(sourceChainSelectorRule, sourceChainSelectorItem) + } + var sequenceNumberRule []interface{} + for _, sequenceNumberItem := range sequenceNumber { + sequenceNumberRule = append(sequenceNumberRule, sequenceNumberItem) + } + var messageIdRule []interface{} + for _, messageIdItem := range messageId { + messageIdRule = append(messageIdRule, messageIdItem) + } + + logs, sub, err := _OffRamp.contract.FilterLogs(opts, "ExecutionStateChanged", sourceChainSelectorRule, sequenceNumberRule, messageIdRule) + if err != nil { + return nil, err + } + return &OffRampExecutionStateChangedIterator{contract: _OffRamp.contract, event: "ExecutionStateChanged", logs: logs, sub: sub}, nil +} + +func (_OffRamp *OffRampFilterer) WatchExecutionStateChanged(opts *bind.WatchOpts, sink chan<- *OffRampExecutionStateChanged, sourceChainSelector []uint64, sequenceNumber []uint64, messageId [][32]byte) (event.Subscription, error) { + + var sourceChainSelectorRule []interface{} + for _, sourceChainSelectorItem := range sourceChainSelector { + sourceChainSelectorRule = append(sourceChainSelectorRule, sourceChainSelectorItem) + } + var sequenceNumberRule []interface{} + for _, sequenceNumberItem := range sequenceNumber { + sequenceNumberRule = append(sequenceNumberRule, sequenceNumberItem) + } + var messageIdRule []interface{} + for _, messageIdItem := range messageId { + messageIdRule = append(messageIdRule, messageIdItem) + } + + logs, sub, err := _OffRamp.contract.WatchLogs(opts, "ExecutionStateChanged", sourceChainSelectorRule, sequenceNumberRule, messageIdRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(OffRampExecutionStateChanged) + if err := _OffRamp.contract.UnpackLog(event, "ExecutionStateChanged", 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 +} + +func (_OffRamp *OffRampFilterer) ParseExecutionStateChanged(log types.Log) (*OffRampExecutionStateChanged, error) { + event := new(OffRampExecutionStateChanged) + if err := _OffRamp.contract.UnpackLog(event, "ExecutionStateChanged", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type OffRampOwnershipTransferRequestedIterator struct { + Event *OffRampOwnershipTransferRequested + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *OffRampOwnershipTransferRequestedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(OffRampOwnershipTransferRequested) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(OffRampOwnershipTransferRequested) + 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() + } +} + +func (it *OffRampOwnershipTransferRequestedIterator) Error() error { + return it.fail +} + +func (it *OffRampOwnershipTransferRequestedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type OffRampOwnershipTransferRequested struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_OffRamp *OffRampFilterer) FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*OffRampOwnershipTransferRequestedIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _OffRamp.contract.FilterLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return &OffRampOwnershipTransferRequestedIterator{contract: _OffRamp.contract, event: "OwnershipTransferRequested", logs: logs, sub: sub}, nil +} + +func (_OffRamp *OffRampFilterer) WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *OffRampOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _OffRamp.contract.WatchLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(OffRampOwnershipTransferRequested) + if err := _OffRamp.contract.UnpackLog(event, "OwnershipTransferRequested", 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 +} + +func (_OffRamp *OffRampFilterer) ParseOwnershipTransferRequested(log types.Log) (*OffRampOwnershipTransferRequested, error) { + event := new(OffRampOwnershipTransferRequested) + if err := _OffRamp.contract.UnpackLog(event, "OwnershipTransferRequested", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type OffRampOwnershipTransferredIterator struct { + Event *OffRampOwnershipTransferred + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *OffRampOwnershipTransferredIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(OffRampOwnershipTransferred) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(OffRampOwnershipTransferred) + 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() + } +} + +func (it *OffRampOwnershipTransferredIterator) Error() error { + return it.fail +} + +func (it *OffRampOwnershipTransferredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type OffRampOwnershipTransferred struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_OffRamp *OffRampFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*OffRampOwnershipTransferredIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _OffRamp.contract.FilterLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return &OffRampOwnershipTransferredIterator{contract: _OffRamp.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil +} + +func (_OffRamp *OffRampFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *OffRampOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _OffRamp.contract.WatchLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(OffRampOwnershipTransferred) + if err := _OffRamp.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 +} + +func (_OffRamp *OffRampFilterer) ParseOwnershipTransferred(log types.Log) (*OffRampOwnershipTransferred, error) { + event := new(OffRampOwnershipTransferred) + if err := _OffRamp.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type OffRampRootRemovedIterator struct { + Event *OffRampRootRemoved + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *OffRampRootRemovedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(OffRampRootRemoved) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(OffRampRootRemoved) + 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() + } +} + +func (it *OffRampRootRemovedIterator) Error() error { + return it.fail +} + +func (it *OffRampRootRemovedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type OffRampRootRemoved struct { + Root [32]byte + Raw types.Log +} + +func (_OffRamp *OffRampFilterer) FilterRootRemoved(opts *bind.FilterOpts) (*OffRampRootRemovedIterator, error) { + + logs, sub, err := _OffRamp.contract.FilterLogs(opts, "RootRemoved") + if err != nil { + return nil, err + } + return &OffRampRootRemovedIterator{contract: _OffRamp.contract, event: "RootRemoved", logs: logs, sub: sub}, nil +} + +func (_OffRamp *OffRampFilterer) WatchRootRemoved(opts *bind.WatchOpts, sink chan<- *OffRampRootRemoved) (event.Subscription, error) { + + logs, sub, err := _OffRamp.contract.WatchLogs(opts, "RootRemoved") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(OffRampRootRemoved) + if err := _OffRamp.contract.UnpackLog(event, "RootRemoved", 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 +} + +func (_OffRamp *OffRampFilterer) ParseRootRemoved(log types.Log) (*OffRampRootRemoved, error) { + event := new(OffRampRootRemoved) + if err := _OffRamp.contract.UnpackLog(event, "RootRemoved", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type OffRampSkippedAlreadyExecutedMessageIterator struct { + Event *OffRampSkippedAlreadyExecutedMessage + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *OffRampSkippedAlreadyExecutedMessageIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(OffRampSkippedAlreadyExecutedMessage) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(OffRampSkippedAlreadyExecutedMessage) + 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() + } +} + +func (it *OffRampSkippedAlreadyExecutedMessageIterator) Error() error { + return it.fail +} + +func (it *OffRampSkippedAlreadyExecutedMessageIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type OffRampSkippedAlreadyExecutedMessage struct { + SourceChainSelector uint64 + SequenceNumber uint64 + Raw types.Log +} + +func (_OffRamp *OffRampFilterer) FilterSkippedAlreadyExecutedMessage(opts *bind.FilterOpts) (*OffRampSkippedAlreadyExecutedMessageIterator, error) { + + logs, sub, err := _OffRamp.contract.FilterLogs(opts, "SkippedAlreadyExecutedMessage") + if err != nil { + return nil, err + } + return &OffRampSkippedAlreadyExecutedMessageIterator{contract: _OffRamp.contract, event: "SkippedAlreadyExecutedMessage", logs: logs, sub: sub}, nil +} + +func (_OffRamp *OffRampFilterer) WatchSkippedAlreadyExecutedMessage(opts *bind.WatchOpts, sink chan<- *OffRampSkippedAlreadyExecutedMessage) (event.Subscription, error) { + + logs, sub, err := _OffRamp.contract.WatchLogs(opts, "SkippedAlreadyExecutedMessage") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(OffRampSkippedAlreadyExecutedMessage) + if err := _OffRamp.contract.UnpackLog(event, "SkippedAlreadyExecutedMessage", 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 +} + +func (_OffRamp *OffRampFilterer) ParseSkippedAlreadyExecutedMessage(log types.Log) (*OffRampSkippedAlreadyExecutedMessage, error) { + event := new(OffRampSkippedAlreadyExecutedMessage) + if err := _OffRamp.contract.UnpackLog(event, "SkippedAlreadyExecutedMessage", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type OffRampSkippedReportExecutionIterator struct { + Event *OffRampSkippedReportExecution + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *OffRampSkippedReportExecutionIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(OffRampSkippedReportExecution) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(OffRampSkippedReportExecution) + 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() + } +} + +func (it *OffRampSkippedReportExecutionIterator) Error() error { + return it.fail +} + +func (it *OffRampSkippedReportExecutionIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type OffRampSkippedReportExecution struct { + SourceChainSelector uint64 + Raw types.Log +} + +func (_OffRamp *OffRampFilterer) FilterSkippedReportExecution(opts *bind.FilterOpts) (*OffRampSkippedReportExecutionIterator, error) { + + logs, sub, err := _OffRamp.contract.FilterLogs(opts, "SkippedReportExecution") + if err != nil { + return nil, err + } + return &OffRampSkippedReportExecutionIterator{contract: _OffRamp.contract, event: "SkippedReportExecution", logs: logs, sub: sub}, nil +} + +func (_OffRamp *OffRampFilterer) WatchSkippedReportExecution(opts *bind.WatchOpts, sink chan<- *OffRampSkippedReportExecution) (event.Subscription, error) { + + logs, sub, err := _OffRamp.contract.WatchLogs(opts, "SkippedReportExecution") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(OffRampSkippedReportExecution) + if err := _OffRamp.contract.UnpackLog(event, "SkippedReportExecution", 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 +} + +func (_OffRamp *OffRampFilterer) ParseSkippedReportExecution(log types.Log) (*OffRampSkippedReportExecution, error) { + event := new(OffRampSkippedReportExecution) + if err := _OffRamp.contract.UnpackLog(event, "SkippedReportExecution", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type OffRampSourceChainConfigSetIterator struct { + Event *OffRampSourceChainConfigSet + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *OffRampSourceChainConfigSetIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(OffRampSourceChainConfigSet) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(OffRampSourceChainConfigSet) + 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() + } +} + +func (it *OffRampSourceChainConfigSetIterator) Error() error { + return it.fail +} + +func (it *OffRampSourceChainConfigSetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type OffRampSourceChainConfigSet struct { + SourceChainSelector uint64 + SourceConfig OffRampSourceChainConfig + Raw types.Log +} + +func (_OffRamp *OffRampFilterer) FilterSourceChainConfigSet(opts *bind.FilterOpts, sourceChainSelector []uint64) (*OffRampSourceChainConfigSetIterator, error) { + + var sourceChainSelectorRule []interface{} + for _, sourceChainSelectorItem := range sourceChainSelector { + sourceChainSelectorRule = append(sourceChainSelectorRule, sourceChainSelectorItem) + } + + logs, sub, err := _OffRamp.contract.FilterLogs(opts, "SourceChainConfigSet", sourceChainSelectorRule) + if err != nil { + return nil, err + } + return &OffRampSourceChainConfigSetIterator{contract: _OffRamp.contract, event: "SourceChainConfigSet", logs: logs, sub: sub}, nil +} + +func (_OffRamp *OffRampFilterer) WatchSourceChainConfigSet(opts *bind.WatchOpts, sink chan<- *OffRampSourceChainConfigSet, sourceChainSelector []uint64) (event.Subscription, error) { + + var sourceChainSelectorRule []interface{} + for _, sourceChainSelectorItem := range sourceChainSelector { + sourceChainSelectorRule = append(sourceChainSelectorRule, sourceChainSelectorItem) + } + + logs, sub, err := _OffRamp.contract.WatchLogs(opts, "SourceChainConfigSet", sourceChainSelectorRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(OffRampSourceChainConfigSet) + if err := _OffRamp.contract.UnpackLog(event, "SourceChainConfigSet", 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 +} + +func (_OffRamp *OffRampFilterer) ParseSourceChainConfigSet(log types.Log) (*OffRampSourceChainConfigSet, error) { + event := new(OffRampSourceChainConfigSet) + if err := _OffRamp.contract.UnpackLog(event, "SourceChainConfigSet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type OffRampSourceChainSelectorAddedIterator struct { + Event *OffRampSourceChainSelectorAdded + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *OffRampSourceChainSelectorAddedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(OffRampSourceChainSelectorAdded) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(OffRampSourceChainSelectorAdded) + 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() + } +} + +func (it *OffRampSourceChainSelectorAddedIterator) Error() error { + return it.fail +} + +func (it *OffRampSourceChainSelectorAddedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type OffRampSourceChainSelectorAdded struct { + SourceChainSelector uint64 + Raw types.Log +} + +func (_OffRamp *OffRampFilterer) FilterSourceChainSelectorAdded(opts *bind.FilterOpts) (*OffRampSourceChainSelectorAddedIterator, error) { + + logs, sub, err := _OffRamp.contract.FilterLogs(opts, "SourceChainSelectorAdded") + if err != nil { + return nil, err + } + return &OffRampSourceChainSelectorAddedIterator{contract: _OffRamp.contract, event: "SourceChainSelectorAdded", logs: logs, sub: sub}, nil +} + +func (_OffRamp *OffRampFilterer) WatchSourceChainSelectorAdded(opts *bind.WatchOpts, sink chan<- *OffRampSourceChainSelectorAdded) (event.Subscription, error) { + + logs, sub, err := _OffRamp.contract.WatchLogs(opts, "SourceChainSelectorAdded") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(OffRampSourceChainSelectorAdded) + if err := _OffRamp.contract.UnpackLog(event, "SourceChainSelectorAdded", 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 +} + +func (_OffRamp *OffRampFilterer) ParseSourceChainSelectorAdded(log types.Log) (*OffRampSourceChainSelectorAdded, error) { + event := new(OffRampSourceChainSelectorAdded) + if err := _OffRamp.contract.UnpackLog(event, "SourceChainSelectorAdded", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type OffRampStaticConfigSetIterator struct { + Event *OffRampStaticConfigSet + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *OffRampStaticConfigSetIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(OffRampStaticConfigSet) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(OffRampStaticConfigSet) + 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() + } +} + +func (it *OffRampStaticConfigSetIterator) Error() error { + return it.fail +} + +func (it *OffRampStaticConfigSetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type OffRampStaticConfigSet struct { + StaticConfig OffRampStaticConfig + Raw types.Log +} + +func (_OffRamp *OffRampFilterer) FilterStaticConfigSet(opts *bind.FilterOpts) (*OffRampStaticConfigSetIterator, error) { + + logs, sub, err := _OffRamp.contract.FilterLogs(opts, "StaticConfigSet") + if err != nil { + return nil, err + } + return &OffRampStaticConfigSetIterator{contract: _OffRamp.contract, event: "StaticConfigSet", logs: logs, sub: sub}, nil +} + +func (_OffRamp *OffRampFilterer) WatchStaticConfigSet(opts *bind.WatchOpts, sink chan<- *OffRampStaticConfigSet) (event.Subscription, error) { + + logs, sub, err := _OffRamp.contract.WatchLogs(opts, "StaticConfigSet") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(OffRampStaticConfigSet) + if err := _OffRamp.contract.UnpackLog(event, "StaticConfigSet", 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 +} + +func (_OffRamp *OffRampFilterer) ParseStaticConfigSet(log types.Log) (*OffRampStaticConfigSet, error) { + event := new(OffRampStaticConfigSet) + if err := _OffRamp.contract.UnpackLog(event, "StaticConfigSet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type OffRampTransmittedIterator struct { + Event *OffRampTransmitted + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *OffRampTransmittedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(OffRampTransmitted) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(OffRampTransmitted) + 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() + } +} + +func (it *OffRampTransmittedIterator) Error() error { + return it.fail +} + +func (it *OffRampTransmittedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type OffRampTransmitted struct { + OcrPluginType uint8 + ConfigDigest [32]byte + SequenceNumber uint64 + Raw types.Log +} + +func (_OffRamp *OffRampFilterer) FilterTransmitted(opts *bind.FilterOpts, ocrPluginType []uint8) (*OffRampTransmittedIterator, error) { + + var ocrPluginTypeRule []interface{} + for _, ocrPluginTypeItem := range ocrPluginType { + ocrPluginTypeRule = append(ocrPluginTypeRule, ocrPluginTypeItem) + } + + logs, sub, err := _OffRamp.contract.FilterLogs(opts, "Transmitted", ocrPluginTypeRule) + if err != nil { + return nil, err + } + return &OffRampTransmittedIterator{contract: _OffRamp.contract, event: "Transmitted", logs: logs, sub: sub}, nil +} + +func (_OffRamp *OffRampFilterer) WatchTransmitted(opts *bind.WatchOpts, sink chan<- *OffRampTransmitted, ocrPluginType []uint8) (event.Subscription, error) { + + var ocrPluginTypeRule []interface{} + for _, ocrPluginTypeItem := range ocrPluginType { + ocrPluginTypeRule = append(ocrPluginTypeRule, ocrPluginTypeItem) + } + + logs, sub, err := _OffRamp.contract.WatchLogs(opts, "Transmitted", ocrPluginTypeRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(OffRampTransmitted) + if err := _OffRamp.contract.UnpackLog(event, "Transmitted", 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 +} + +func (_OffRamp *OffRampFilterer) ParseTransmitted(log types.Log) (*OffRampTransmitted, error) { + event := new(OffRampTransmitted) + if err := _OffRamp.contract.UnpackLog(event, "Transmitted", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +func (_OffRamp *OffRamp) ParseLog(log types.Log) (generated.AbigenLog, error) { + switch log.Topics[0] { + case _OffRamp.abi.Events["AlreadyAttempted"].ID: + return _OffRamp.ParseAlreadyAttempted(log) + case _OffRamp.abi.Events["CommitReportAccepted"].ID: + return _OffRamp.ParseCommitReportAccepted(log) + case _OffRamp.abi.Events["ConfigSet"].ID: + return _OffRamp.ParseConfigSet(log) + case _OffRamp.abi.Events["DynamicConfigSet"].ID: + return _OffRamp.ParseDynamicConfigSet(log) + case _OffRamp.abi.Events["ExecutionStateChanged"].ID: + return _OffRamp.ParseExecutionStateChanged(log) + case _OffRamp.abi.Events["OwnershipTransferRequested"].ID: + return _OffRamp.ParseOwnershipTransferRequested(log) + case _OffRamp.abi.Events["OwnershipTransferred"].ID: + return _OffRamp.ParseOwnershipTransferred(log) + case _OffRamp.abi.Events["RootRemoved"].ID: + return _OffRamp.ParseRootRemoved(log) + case _OffRamp.abi.Events["SkippedAlreadyExecutedMessage"].ID: + return _OffRamp.ParseSkippedAlreadyExecutedMessage(log) + case _OffRamp.abi.Events["SkippedReportExecution"].ID: + return _OffRamp.ParseSkippedReportExecution(log) + case _OffRamp.abi.Events["SourceChainConfigSet"].ID: + return _OffRamp.ParseSourceChainConfigSet(log) + case _OffRamp.abi.Events["SourceChainSelectorAdded"].ID: + return _OffRamp.ParseSourceChainSelectorAdded(log) + case _OffRamp.abi.Events["StaticConfigSet"].ID: + return _OffRamp.ParseStaticConfigSet(log) + case _OffRamp.abi.Events["Transmitted"].ID: + return _OffRamp.ParseTransmitted(log) + + default: + return nil, fmt.Errorf("abigen wrapper received unknown log topic: %v", log.Topics[0]) + } +} + +func (OffRampAlreadyAttempted) Topic() common.Hash { + return common.HexToHash("0x3ef2a99c550a751d4b0b261268f05a803dfb049ab43616a1ffb388f61fe65120") +} + +func (OffRampCommitReportAccepted) Topic() common.Hash { + return common.HexToHash("0xd7868a16facbdde7b5c020620136316b3c266fffcb4e1e41cb6a662fe14ba3e1") +} + +func (OffRampConfigSet) Topic() common.Hash { + return common.HexToHash("0xab8b1b57514019638d7b5ce9c638fe71366fe8e2be1c40a7a80f1733d0e9f547") +} + +func (OffRampDynamicConfigSet) Topic() common.Hash { + return common.HexToHash("0xa55bd56595c45f517e5967a3067f3dca684445a3080e7c04a4e0d5a40cda627d") +} + +func (OffRampExecutionStateChanged) Topic() common.Hash { + return common.HexToHash("0x05665fe9ad095383d018353f4cbcba77e84db27dd215081bbf7cdf9ae6fbe48b") +} + +func (OffRampOwnershipTransferRequested) Topic() common.Hash { + return common.HexToHash("0xed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae1278") +} + +func (OffRampOwnershipTransferred) Topic() common.Hash { + return common.HexToHash("0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0") +} + +func (OffRampRootRemoved) Topic() common.Hash { + return common.HexToHash("0x202f1139a3e334b6056064c0e9b19fd07e44a88d8f6e5ded571b24cf8c371f12") +} + +func (OffRampSkippedAlreadyExecutedMessage) Topic() common.Hash { + return common.HexToHash("0x3b575419319662b2a6f5e2467d84521517a3382b908eb3d557bb3fdb0c50e23c") +} + +func (OffRampSkippedReportExecution) Topic() common.Hash { + return common.HexToHash("0xaab522ed53d887e56ed53dd37398a01aeef6a58e0fa77c2173beb9512d894933") +} + +func (OffRampSourceChainConfigSet) Topic() common.Hash { + return common.HexToHash("0x49f51971edd25182e97182d6ea372a0488ce2ab639f6a3a7ab4df0d2636fe56b") +} + +func (OffRampSourceChainSelectorAdded) Topic() common.Hash { + return common.HexToHash("0xf4c1390c70e5c0f491ae1ccbc06f9117cbbadf2767b247b3bc203280f24c0fb9") +} + +func (OffRampStaticConfigSet) Topic() common.Hash { + return common.HexToHash("0x683eb52ee924eb817377cfa8f41f238f4bb7a877da5267869dfffbad85f564d8") +} + +func (OffRampTransmitted) Topic() common.Hash { + return common.HexToHash("0x198d6990ef96613a9026203077e422916918b03ff47f0be6bee7b02d8e139ef0") +} + +func (_OffRamp *OffRamp) Address() common.Address { + return _OffRamp.address +} + +type OffRampInterface interface { + CcipReceive(opts *bind.CallOpts, arg0 ClientAny2EVMMessage) error + + GetDynamicConfig(opts *bind.CallOpts) (OffRampDynamicConfig, error) + + GetExecutionState(opts *bind.CallOpts, sourceChainSelector uint64, sequenceNumber uint64) (uint8, error) + + GetLatestPriceSequenceNumber(opts *bind.CallOpts) (uint64, error) + + GetMerkleRoot(opts *bind.CallOpts, sourceChainSelector uint64, root [32]byte) (*big.Int, error) + + GetSourceChainConfig(opts *bind.CallOpts, sourceChainSelector uint64) (OffRampSourceChainConfig, error) + + GetStaticConfig(opts *bind.CallOpts) (OffRampStaticConfig, error) + + LatestConfigDetails(opts *bind.CallOpts, ocrPluginType uint8) (MultiOCR3BaseOCRConfig, error) + + Owner(opts *bind.CallOpts) (common.Address, error) + + TypeAndVersion(opts *bind.CallOpts) (string, error) + + AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) + + ApplySourceChainConfigUpdates(opts *bind.TransactOpts, sourceChainConfigUpdates []OffRampSourceChainConfigArgs) (*types.Transaction, error) + + Commit(opts *bind.TransactOpts, reportContext [3][32]byte, report []byte, rs [][32]byte, ss [][32]byte, rawVs [32]byte) (*types.Transaction, error) + + Execute(opts *bind.TransactOpts, reportContext [3][32]byte, report []byte) (*types.Transaction, error) + + ExecuteSingleMessage(opts *bind.TransactOpts, message InternalAny2EVMRampMessage, offchainTokenData [][]byte) (*types.Transaction, error) + + ManuallyExecute(opts *bind.TransactOpts, reports []InternalExecutionReportSingleChain, gasLimitOverrides [][]*big.Int) (*types.Transaction, error) + + SetDynamicConfig(opts *bind.TransactOpts, dynamicConfig OffRampDynamicConfig) (*types.Transaction, error) + + SetOCR3Configs(opts *bind.TransactOpts, ocrConfigArgs []MultiOCR3BaseOCRConfigArgs) (*types.Transaction, error) + + TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) + + FilterAlreadyAttempted(opts *bind.FilterOpts) (*OffRampAlreadyAttemptedIterator, error) + + WatchAlreadyAttempted(opts *bind.WatchOpts, sink chan<- *OffRampAlreadyAttempted) (event.Subscription, error) + + ParseAlreadyAttempted(log types.Log) (*OffRampAlreadyAttempted, error) + + FilterCommitReportAccepted(opts *bind.FilterOpts) (*OffRampCommitReportAcceptedIterator, error) + + WatchCommitReportAccepted(opts *bind.WatchOpts, sink chan<- *OffRampCommitReportAccepted) (event.Subscription, error) + + ParseCommitReportAccepted(log types.Log) (*OffRampCommitReportAccepted, error) + + FilterConfigSet(opts *bind.FilterOpts) (*OffRampConfigSetIterator, error) + + WatchConfigSet(opts *bind.WatchOpts, sink chan<- *OffRampConfigSet) (event.Subscription, error) + + ParseConfigSet(log types.Log) (*OffRampConfigSet, error) + + FilterDynamicConfigSet(opts *bind.FilterOpts) (*OffRampDynamicConfigSetIterator, error) + + WatchDynamicConfigSet(opts *bind.WatchOpts, sink chan<- *OffRampDynamicConfigSet) (event.Subscription, error) + + ParseDynamicConfigSet(log types.Log) (*OffRampDynamicConfigSet, error) + + FilterExecutionStateChanged(opts *bind.FilterOpts, sourceChainSelector []uint64, sequenceNumber []uint64, messageId [][32]byte) (*OffRampExecutionStateChangedIterator, error) + + WatchExecutionStateChanged(opts *bind.WatchOpts, sink chan<- *OffRampExecutionStateChanged, sourceChainSelector []uint64, sequenceNumber []uint64, messageId [][32]byte) (event.Subscription, error) + + ParseExecutionStateChanged(log types.Log) (*OffRampExecutionStateChanged, error) + + FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*OffRampOwnershipTransferRequestedIterator, error) + + WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *OffRampOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferRequested(log types.Log) (*OffRampOwnershipTransferRequested, error) + + FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*OffRampOwnershipTransferredIterator, error) + + WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *OffRampOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferred(log types.Log) (*OffRampOwnershipTransferred, error) + + FilterRootRemoved(opts *bind.FilterOpts) (*OffRampRootRemovedIterator, error) + + WatchRootRemoved(opts *bind.WatchOpts, sink chan<- *OffRampRootRemoved) (event.Subscription, error) + + ParseRootRemoved(log types.Log) (*OffRampRootRemoved, error) + + FilterSkippedAlreadyExecutedMessage(opts *bind.FilterOpts) (*OffRampSkippedAlreadyExecutedMessageIterator, error) + + WatchSkippedAlreadyExecutedMessage(opts *bind.WatchOpts, sink chan<- *OffRampSkippedAlreadyExecutedMessage) (event.Subscription, error) + + ParseSkippedAlreadyExecutedMessage(log types.Log) (*OffRampSkippedAlreadyExecutedMessage, error) + + FilterSkippedReportExecution(opts *bind.FilterOpts) (*OffRampSkippedReportExecutionIterator, error) + + WatchSkippedReportExecution(opts *bind.WatchOpts, sink chan<- *OffRampSkippedReportExecution) (event.Subscription, error) + + ParseSkippedReportExecution(log types.Log) (*OffRampSkippedReportExecution, error) + + FilterSourceChainConfigSet(opts *bind.FilterOpts, sourceChainSelector []uint64) (*OffRampSourceChainConfigSetIterator, error) + + WatchSourceChainConfigSet(opts *bind.WatchOpts, sink chan<- *OffRampSourceChainConfigSet, sourceChainSelector []uint64) (event.Subscription, error) + + ParseSourceChainConfigSet(log types.Log) (*OffRampSourceChainConfigSet, error) + + FilterSourceChainSelectorAdded(opts *bind.FilterOpts) (*OffRampSourceChainSelectorAddedIterator, error) + + WatchSourceChainSelectorAdded(opts *bind.WatchOpts, sink chan<- *OffRampSourceChainSelectorAdded) (event.Subscription, error) + + ParseSourceChainSelectorAdded(log types.Log) (*OffRampSourceChainSelectorAdded, error) + + FilterStaticConfigSet(opts *bind.FilterOpts) (*OffRampStaticConfigSetIterator, error) + + WatchStaticConfigSet(opts *bind.WatchOpts, sink chan<- *OffRampStaticConfigSet) (event.Subscription, error) + + ParseStaticConfigSet(log types.Log) (*OffRampStaticConfigSet, error) + + FilterTransmitted(opts *bind.FilterOpts, ocrPluginType []uint8) (*OffRampTransmittedIterator, error) + + WatchTransmitted(opts *bind.WatchOpts, sink chan<- *OffRampTransmitted, ocrPluginType []uint8) (event.Subscription, error) + + ParseTransmitted(log types.Log) (*OffRampTransmitted, error) + + ParseLog(log types.Log) (generated.AbigenLog, error) + + Address() common.Address +} diff --git a/core/gethwrappers/ccip/generated/onramp/onramp.go b/core/gethwrappers/ccip/generated/onramp/onramp.go new file mode 100644 index 00000000000..776f9456503 --- /dev/null +++ b/core/gethwrappers/ccip/generated/onramp/onramp.go @@ -0,0 +1,2051 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package onramp + +import ( + "errors" + "fmt" + "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" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" +) + +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +type ClientEVM2AnyMessage struct { + Receiver []byte + Data []byte + TokenAmounts []ClientEVMTokenAmount + FeeToken common.Address + ExtraArgs []byte +} + +type ClientEVMTokenAmount struct { + Token common.Address + Amount *big.Int +} + +type InternalEVM2AnyRampMessage struct { + Header InternalRampMessageHeader + Sender common.Address + Data []byte + Receiver []byte + ExtraArgs []byte + FeeToken common.Address + FeeTokenAmount *big.Int + TokenAmounts []InternalRampTokenAmount +} + +type InternalRampMessageHeader struct { + MessageId [32]byte + SourceChainSelector uint64 + DestChainSelector uint64 + SequenceNumber uint64 + Nonce uint64 +} + +type InternalRampTokenAmount struct { + SourcePoolAddress []byte + DestTokenAddress []byte + ExtraData []byte + Amount *big.Int + DestExecData []byte +} + +type OnRampAllowListConfigArgs struct { + DestChainSelector uint64 + AllowListEnabled bool + AddedAllowlistedSenders []common.Address + RemovedAllowlistedSenders []common.Address +} + +type OnRampDestChainConfigArgs struct { + DestChainSelector uint64 + Router common.Address +} + +type OnRampDynamicConfig struct { + FeeQuoter common.Address + MessageValidator common.Address + FeeAggregator common.Address + AllowListAdmin common.Address +} + +type OnRampStaticConfig struct { + ChainSelector uint64 + Rmn common.Address + NonceManager common.Address + TokenAdminRegistry common.Address +} + +var OnRampMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"},{\"internalType\":\"contractIRMNV2\",\"name\":\"rmn\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"nonceManager\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAdminRegistry\",\"type\":\"address\"}],\"internalType\":\"structOnRamp.StaticConfig\",\"name\":\"staticConfig\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"feeQuoter\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"messageValidator\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"feeAggregator\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"allowListAdmin\",\"type\":\"address\"}],\"internalType\":\"structOnRamp.DynamicConfig\",\"name\":\"dynamicConfig\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"contractIRouter\",\"name\":\"router\",\"type\":\"address\"}],\"internalType\":\"structOnRamp.DestChainConfigArgs[]\",\"name\":\"destChainConfigArgs\",\"type\":\"tuple[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"CannotSendZeroTokens\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"}],\"name\":\"CursedByRMN\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"GetSupportedTokensFunctionalityRemovedCheckAdminRegistry\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"}],\"name\":\"InvalidAllowListRequest\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidConfig\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"}],\"name\":\"InvalidDestChainConfig\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"MustBeCalledByRouter\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCallableByOwnerOrAllowlistAdmin\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RouterMustSetOriginalSender\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"SenderNotAllowed\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"UnsupportedToken\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"allowListAdmin\",\"type\":\"address\"}],\"name\":\"AllowListAdminSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"senders\",\"type\":\"address[]\"}],\"name\":\"AllowListSendersAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"senders\",\"type\":\"address[]\"}],\"name\":\"AllowListSendersRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"},{\"components\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"messageId\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"sequenceNumber\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"nonce\",\"type\":\"uint64\"}],\"internalType\":\"structInternal.RampMessageHeader\",\"name\":\"header\",\"type\":\"tuple\"},{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"receiver\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"extraArgs\",\"type\":\"bytes\"},{\"internalType\":\"address\",\"name\":\"feeToken\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"feeTokenAmount\",\"type\":\"uint256\"},{\"components\":[{\"internalType\":\"bytes\",\"name\":\"sourcePoolAddress\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"destTokenAddress\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"destExecData\",\"type\":\"bytes\"}],\"internalType\":\"structInternal.RampTokenAmount[]\",\"name\":\"tokenAmounts\",\"type\":\"tuple[]\"}],\"indexed\":false,\"internalType\":\"structInternal.EVM2AnyRampMessage\",\"name\":\"message\",\"type\":\"tuple\"}],\"name\":\"CCIPMessageSent\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"},{\"internalType\":\"contractIRMNV2\",\"name\":\"rmn\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"nonceManager\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAdminRegistry\",\"type\":\"address\"}],\"indexed\":false,\"internalType\":\"structOnRamp.StaticConfig\",\"name\":\"staticConfig\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"feeQuoter\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"messageValidator\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"feeAggregator\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"allowListAdmin\",\"type\":\"address\"}],\"indexed\":false,\"internalType\":\"structOnRamp.DynamicConfig\",\"name\":\"dynamicConfig\",\"type\":\"tuple\"}],\"name\":\"ConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"sequenceNumber\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"contractIRouter\",\"name\":\"router\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"allowListEnabled\",\"type\":\"bool\"}],\"name\":\"DestChainConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"feeToken\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"feeValueJuels\",\"type\":\"uint256\"}],\"name\":\"FeePaid\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"feeAggregator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"feeToken\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"FeeTokenWithdrawn\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"bool\",\"name\":\"allowListEnabled\",\"type\":\"bool\"},{\"internalType\":\"address[]\",\"name\":\"addedAllowlistedSenders\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"removedAllowlistedSenders\",\"type\":\"address[]\"}],\"internalType\":\"structOnRamp.AllowListConfigArgs[]\",\"name\":\"allowListConfigArgsItems\",\"type\":\"tuple[]\"}],\"name\":\"applyAllowListUpdates\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"contractIRouter\",\"name\":\"router\",\"type\":\"address\"}],\"internalType\":\"structOnRamp.DestChainConfigArgs[]\",\"name\":\"destChainConfigArgs\",\"type\":\"tuple[]\"}],\"name\":\"applyDestChainConfigUpdates\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"},{\"components\":[{\"internalType\":\"bytes\",\"name\":\"receiver\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"internalType\":\"structClient.EVMTokenAmount[]\",\"name\":\"tokenAmounts\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"feeToken\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"extraArgs\",\"type\":\"bytes\"}],\"internalType\":\"structClient.EVM2AnyMessage\",\"name\":\"message\",\"type\":\"tuple\"},{\"internalType\":\"uint256\",\"name\":\"feeTokenAmount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"originalSender\",\"type\":\"address\"}],\"name\":\"forwardFromRouter\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"}],\"name\":\"getAllowedSendersList\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"}],\"name\":\"getDestChainConfig\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"sequenceNumber\",\"type\":\"uint64\"},{\"internalType\":\"bool\",\"name\":\"allowListEnabled\",\"type\":\"bool\"},{\"internalType\":\"address\",\"name\":\"router\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getDynamicConfig\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"feeQuoter\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"messageValidator\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"feeAggregator\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"allowListAdmin\",\"type\":\"address\"}],\"internalType\":\"structOnRamp.DynamicConfig\",\"name\":\"dynamicConfig\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"}],\"name\":\"getExpectedNextSequenceNumber\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"},{\"components\":[{\"internalType\":\"bytes\",\"name\":\"receiver\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"internalType\":\"structClient.EVMTokenAmount[]\",\"name\":\"tokenAmounts\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"feeToken\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"extraArgs\",\"type\":\"bytes\"}],\"internalType\":\"structClient.EVM2AnyMessage\",\"name\":\"message\",\"type\":\"tuple\"}],\"name\":\"getFee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"feeTokenAmount\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"},{\"internalType\":\"contractIERC20\",\"name\":\"sourceToken\",\"type\":\"address\"}],\"name\":\"getPoolBySourceToken\",\"outputs\":[{\"internalType\":\"contractIPoolV1\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"}],\"name\":\"getRouter\",\"outputs\":[{\"internalType\":\"contractIRouter\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getStaticConfig\",\"outputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"},{\"internalType\":\"contractIRMNV2\",\"name\":\"rmn\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"nonceManager\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAdminRegistry\",\"type\":\"address\"}],\"internalType\":\"structOnRamp.StaticConfig\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"name\":\"getSupportedTokens\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"feeQuoter\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"messageValidator\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"feeAggregator\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"allowListAdmin\",\"type\":\"address\"}],\"internalType\":\"structOnRamp.DynamicConfig\",\"name\":\"dynamicConfig\",\"type\":\"tuple\"}],\"name\":\"setDynamicConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"withdrawFeeTokens\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", + Bin: "0x6101006040523480156200001257600080fd5b506040516200402938038062004029833981016040819052620000359162000665565b33806000816200008c5760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000bf57620000bf8162000186565b505083516001600160401b031615905080620000e6575060208301516001600160a01b0316155b80620000fd575060408301516001600160a01b0316155b8062000114575060608301516001600160a01b0316155b1562000133576040516306b7c75960e31b815260040160405180910390fd5b82516001600160401b031660805260208301516001600160a01b0390811660a0526040840151811660c05260608401511660e052620001728262000231565b6200017d8162000390565b5050506200079f565b336001600160a01b03821603620001e05760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640162000083565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b80516001600160a01b0316158062000254575060408101516001600160a01b0316155b1562000273576040516306b7c75960e31b815260040160405180910390fd5b8051600280546001600160a01b03199081166001600160a01b0393841617909155602080840180516003805485169186169190911790556040808601805160048054871691881691909117905560608088018051600580549098169089161790965582516080808201855280516001600160401b031680835260a080518b16848a0190815260c080518d16868a0190815260e080518f169789019788528a5195865292518e169b85019b909b5299518c169783019790975292518a169381019390935289518916908301529351871693810193909352518516928201929092529151909216918101919091527f23a1adf8ad7fad6091a4803227af2cee848c01a7c812404cade7c25636925e32906101000160405180910390a150565b60005b8151811015620004cf576000828281518110620003b457620003b462000789565b602002602001015190506000838381518110620003d557620003d562000789565b6020026020010151600001519050806001600160401b03166000036200041a5760405163c35aa79d60e01b81526001600160401b038216600482015260240162000083565b6001600160401b03818116600081815260066020908152604091829020868201518154600160481b600160e81b0319811669010000000000000000006001600160a01b03909316928302908117808555865192891691909816178152928301526801000000000000000090940460ff161515918101919091527fd5ad72bc37dc7a80a8b9b9df20500046fd7341adb1be2258a540466fdd7dcef59060600160405180910390a250505080600101905062000393565b5050565b634e487b7160e01b600052604160045260246000fd5b604051608081016001600160401b03811182821017156200050e576200050e620004d3565b60405290565b604080519081016001600160401b03811182821017156200050e576200050e620004d3565b604051601f8201601f191681016001600160401b0381118282101715620005645762000564620004d3565b604052919050565b80516001600160401b03811681146200058457600080fd5b919050565b6001600160a01b03811681146200059f57600080fd5b50565b600082601f830112620005b457600080fd5b815160206001600160401b03821115620005d257620005d2620004d3565b620005e2818360051b0162000539565b82815260069290921b840181019181810190868411156200060257600080fd5b8286015b848110156200065a5760408189031215620006215760008081fd5b6200062b62000514565b62000636826200056c565b815284820151620006478162000589565b8186015283529183019160400162000606565b509695505050505050565b60008060008385036101208112156200067d57600080fd5b60808112156200068c57600080fd5b62000696620004e9565b620006a1866200056c565b81526020860151620006b38162000589565b60208201526040860151620006c88162000589565b60408201526060860151620006dd8162000589565b606082015293506080607f1982011215620006f757600080fd5b5062000702620004e9565b6080850151620007128162000589565b815260a0850151620007248162000589565b602082015260c0850151620007398162000589565b604082015260e08501516200074e8162000589565b60608201526101008501519092506001600160401b038111156200077157600080fd5b6200077f86828701620005a2565b9150509250925092565b634e487b7160e01b600052603260045260246000fd5b60805160a05160c05160e051613811620008186000396000818161022c01528181610c790152611ba10152600081816101f0015281816112480152611b7a0152600081816101b4015281816105de0152611b500152600081816101840152818161116e0152818161164b0152611b2301526138116000f3fe608060405234801561001057600080fd5b50600436106101365760003560e01c806379ba5097116100b2578063a6f3ab6c11610081578063df0aa9e911610066578063df0aa9e91461052d578063f2fde38b14610540578063fbca3b741461055357600080fd5b8063a6f3ab6c146104cd578063d77d5ed0146104e057600080fd5b806379ba50971461045b5780638da5cb5b146104635780639041be3d14610481578063972b4612146104ad57600080fd5b806334adf4941161010957806348a98aa4116100ee57806348a98aa4146103045780636def4ce71461033c5780637437ff9f146103db57600080fd5b806334adf494146102e95780633a019940146102fc57600080fd5b80630242cf601461013b57806306285c6914610150578063181f5a771461027f57806320487ded146102c8575b600080fd5b61014e610149366004612696565b610566565b005b61026960408051608081018252600080825260208201819052918101829052606081019190915260405180608001604052807f000000000000000000000000000000000000000000000000000000000000000067ffffffffffffffff1681526020017f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1681526020017f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1681526020017f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16815250905090565b6040516102769190612759565b60405180910390f35b6102bb6040518060400160405280601081526020017f4f6e52616d7020312e362e302d6465760000000000000000000000000000000081525081565b604051610276919061281e565b6102db6102d6366004612849565b61057a565b604051908152602001610276565b61014e6102f7366004612899565b610733565b61014e610a06565b61031761031236600461290e565b610c31565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610276565b61039f61034a366004612947565b67ffffffffffffffff9081166000908152600660205260409020549081169168010000000000000000820460ff16916901000000000000000000900473ffffffffffffffffffffffffffffffffffffffff1690565b6040805167ffffffffffffffff9094168452911515602084015273ffffffffffffffffffffffffffffffffffffffff1690820152606001610276565b61044e604080516080810182526000808252602082018190529181018290526060810191909152506040805160808101825260025473ffffffffffffffffffffffffffffffffffffffff908116825260035481166020830152600454811692820192909252600554909116606082015290565b6040516102769190612964565b61014e610ce6565b60005473ffffffffffffffffffffffffffffffffffffffff16610317565b61049461048f366004612947565b610de3565b60405167ffffffffffffffff9091168152602001610276565b6104c06104bb366004612947565b610e0c565b60405161027691906129ad565b61014e6104db366004612a17565b610e34565b6103176104ee366004612947565b67ffffffffffffffff166000908152600660205260409020546901000000000000000000900473ffffffffffffffffffffffffffffffffffffffff1690565b6102db61053b366004612a7e565b610e45565b61014e61054e366004612aea565b6116fe565b6104c0610561366004612947565b61170f565b61056e611743565b610577816117c6565b50565b6040517f2cbc26bb00000000000000000000000000000000000000000000000000000000815277ffffffffffffffff00000000000000000000000000000000608084901b16600482015260009073ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001690632cbc26bb90602401602060405180830381865afa158015610625573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106499190612b15565b15610691576040517ffdbd6a7200000000000000000000000000000000000000000000000000000000815267ffffffffffffffff841660048201526024015b60405180910390fd5b6002546040517fd8694ccd00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9091169063d8694ccd906106e99086908690600401612c46565b602060405180830381865afa158015610706573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061072a9190612d8f565b90505b92915050565b60005473ffffffffffffffffffffffffffffffffffffffff1633146107a35760055473ffffffffffffffffffffffffffffffffffffffff1633146107a3576040517f905d7d9b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b81811015610a015760008383838181106107c2576107c2612da8565b90506020028101906107d49190612dd7565b6107dd90612e88565b805167ffffffffffffffff1660009081526006602090815260409091209082015181547fffffffffffffffffffffffffffffffffffffffffffffff00ffffffffffffffff16680100000000000000009115801592909202178255919250906109545760005b8260400151518110156108fd5760008360400151828151811061086757610867612da8565b60200260200101519050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036108e65783516040517f463258ff00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff9091166004820152602401610688565b6108f3600184018261193d565b5050600101610842565b506040820151511561095457816000015167ffffffffffffffff167f330939f6eafe8bb516716892fe962ff19770570838686e6579dbc1cc51fc3281836040015160405161094b91906129ad565b60405180910390a25b60005b8260600151518110156109a0576109978360600151828151811061097d5761097d612da8565b60200260200101518360010161195f90919063ffffffff16565b50600101610957565b50606082015151156109f757816000015167ffffffffffffffff167fc237ec1921f855ccd5e9a5af9733f2d58943a5a8501ec5988e305d7a4d42158683606001516040516109ee91906129ad565b60405180910390a25b50506001016107a6565b505050565b600254604080517fcdc73d51000000000000000000000000000000000000000000000000000000008152905160009273ffffffffffffffffffffffffffffffffffffffff169163cdc73d5191600480830192869291908290030181865afa158015610a75573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201604052610abb9190810190612f1b565b60045490915073ffffffffffffffffffffffffffffffffffffffff1660005b8251811015610a01576000838281518110610af757610af7612da8565b60209081029190910101516040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015290915060009073ffffffffffffffffffffffffffffffffffffffff8316906370a0823190602401602060405180830381865afa158015610b72573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b969190612d8f565b90508015610c2757610bbf73ffffffffffffffffffffffffffffffffffffffff83168583611981565b8173ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f508d7d183612c18fc339b42618912b9fa3239f631dd7ec0671f950200a0fa66e83604051610c1e91815260200190565b60405180910390a35b5050600101610ada565b6040517fbbe4f6db00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff82811660048301526000917f00000000000000000000000000000000000000000000000000000000000000009091169063bbe4f6db90602401602060405180830381865afa158015610cc2573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061072a9190612faa565b60015473ffffffffffffffffffffffffffffffffffffffff163314610d67576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e6572000000000000000000006044820152606401610688565b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b67ffffffffffffffff808216600090815260066020526040812054909161072d91166001612ff6565b67ffffffffffffffff8116600090815260066020526040902060609061072d90600101611a0e565b610e3c611743565b61057781611a22565b67ffffffffffffffff8416600090815260066020526040812073ffffffffffffffffffffffffffffffffffffffff8316610eab576040517fa4ec747900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b805468010000000000000000900460ff1615610f1c57610ece6001820184611c04565b610f1c576040517fd0d2597600000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff84166004820152602401610688565b80546901000000000000000000900473ffffffffffffffffffffffffffffffffffffffff163314610f79576040517f1c0a352900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60035473ffffffffffffffffffffffffffffffffffffffff16801561101f576040517fe0a0e50600000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff82169063e0a0e50690610fec908a908a90600401612c46565b600060405180830381600087803b15801561100657600080fd5b505af115801561101a573d6000803e3d6000fd5b505050505b506002546000908190819073ffffffffffffffffffffffffffffffffffffffff1663c4276bfc8a61105660808c0160608d01612aea565b8a61106460808e018e613017565b6040518663ffffffff1660e01b815260040161108495949392919061307c565b600060405180830381865afa1580156110a1573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682016040526110e79190810190613144565b919450925090506110fe6080890160608a01612aea565b73ffffffffffffffffffffffffffffffffffffffff167f075a2720282fdf622141dae0b048ef90a21a7e57c134c76912d19d006b3b3f6f8460405161114591815260200190565b60405180910390a2604080516101a081019091526000610100820181815267ffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000081166101208501528c811661014085015287549293928392916101608401918a9187916111ba911661319e565b91906101000a81548167ffffffffffffffff021916908367ffffffffffffffff160217905567ffffffffffffffff168152602001866112ba576040517fea458c0c00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff8f16600482015273ffffffffffffffffffffffffffffffffffffffff8c811660248301527f0000000000000000000000000000000000000000000000000000000000000000169063ea458c0c906044016020604051808303816000875af1158015611291573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112b591906131c5565b6112bd565b60005b67ffffffffffffffff1681525081526020018873ffffffffffffffffffffffffffffffffffffffff1681526020018a80602001906112fb9190613017565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050509082525060200161133f8b80613017565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505050908252506020810184905260400161139060808c0160608d01612aea565b73ffffffffffffffffffffffffffffffffffffffff1681526020018981526020018a80604001906113c191906131e2565b905067ffffffffffffffff8111156113db576113db612570565b60405190808252806020026020018201604052801561143e57816020015b61142b6040518060a0016040528060608152602001606081526020016060815260200160008152602001606081525090565b8152602001906001900390816113f95790505b509052905060005b61145360408b018b6131e2565b9050811015611502576114d961146c60408c018c6131e2565b8381811061147c5761147c612da8565b905060400201803603810190611492919061324a565b8c61149d8d80613017565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508e9250611c33915050565b8260e0015182815181106114ef576114ef612da8565b6020908102919091010152600101611446565b5060025460e082015160009173ffffffffffffffffffffffffffffffffffffffff169063085318f8908d9061153a60408f018f6131e2565b6040518563ffffffff1660e01b81526004016115599493929190613361565b600060405180830381865afa158015611576573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682016040526115bc9190810190613397565b905060005b8260e0015151811015611615578181815181106115e0576115e0612da8565b60200260200101518360e0015182815181106115fe576115fe612da8565b6020908102919091010151608001526001016115c1565b50604080517f130ac867e79e2789f923760a88743d292acdf7002139a588206e2260f73f7321602082015267ffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000811692820192909252908c1660608201523060808201526116a590839060a00160405160208183030381529060405280519060200120611f59565b82515260405167ffffffffffffffff8c16907ff6e86ef8896c7a0d629406168f396e883280680c99e649b9e2d36466fbc9f9e5906116e4908590613448565b60405180910390a25051519450505050505b949350505050565b611706611743565b61057781612059565b60606040517f9e7177c800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005473ffffffffffffffffffffffffffffffffffffffff1633146117c4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e6572000000000000000000006044820152606401610688565b565b60005b81518110156119395760008282815181106117e6576117e6612da8565b60200260200101519050600083838151811061180457611804612da8565b60200260200101516000015190508067ffffffffffffffff16600003611862576040517fc35aa79d00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff82166004820152602401610688565b67ffffffffffffffff8181166000818152600660209081526040918290208682015181547fffffff0000000000000000000000000000000000000000ffffffffffffffffff8116690100000000000000000073ffffffffffffffffffffffffffffffffffffffff909316928302908117808555865192891691909816178152928301526801000000000000000090940460ff161515918101919091527fd5ad72bc37dc7a80a8b9b9df20500046fd7341adb1be2258a540466fdd7dcef59060600160405180910390a25050508060010190506117c9565b5050565b600061072a8373ffffffffffffffffffffffffffffffffffffffff841661214e565b600061072a8373ffffffffffffffffffffffffffffffffffffffff841661219d565b6040805173ffffffffffffffffffffffffffffffffffffffff8416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb00000000000000000000000000000000000000000000000000000000179052610a01908490612297565b60606000611a1b836123a3565b9392505050565b805173ffffffffffffffffffffffffffffffffffffffff161580611a5e5750604081015173ffffffffffffffffffffffffffffffffffffffff16155b15611a95576040517f35be3ac800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8051600280547fffffffffffffffffffffffff000000000000000000000000000000000000000090811673ffffffffffffffffffffffffffffffffffffffff93841617909155602080840151600380548416918516919091179055604080850151600480548516918616919091179055606080860151600580549095169086161790935580516080810182527f000000000000000000000000000000000000000000000000000000000000000067ffffffffffffffff1681527f00000000000000000000000000000000000000000000000000000000000000008516928101929092527f00000000000000000000000000000000000000000000000000000000000000008416828201527f00000000000000000000000000000000000000000000000000000000000000009093169181019190915290517f23a1adf8ad7fad6091a4803227af2cee848c01a7c812404cade7c25636925e3291611bf9918490613596565b60405180910390a150565b73ffffffffffffffffffffffffffffffffffffffff81166000908152600183016020526040812054151561072a565b611c656040518060a0016040528060608152602001606081526020016060815260200160008152602001606081525090565b8460200151600003611ca3576040517f5cf0444900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000611cb3858760000151610c31565b905073ffffffffffffffffffffffffffffffffffffffff81161580611d8357506040517f01ffc9a70000000000000000000000000000000000000000000000000000000081527faff2afbf00000000000000000000000000000000000000000000000000000000600482015273ffffffffffffffffffffffffffffffffffffffff8216906301ffc9a790602401602060405180830381865afa158015611d5d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d819190612b15565b155b15611dd55785516040517fbf16aab600000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9091166004820152602401610688565b60008173ffffffffffffffffffffffffffffffffffffffff16639a4575b96040518060a001604052808881526020018967ffffffffffffffff1681526020018773ffffffffffffffffffffffffffffffffffffffff1681526020018a6020015181526020018a6000015173ffffffffffffffffffffffffffffffffffffffff168152506040518263ffffffff1660e01b8152600401611e749190613635565b6000604051808303816000875af1158015611e93573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201604052611ed991908101906136ab565b6040805160a0810190915273ffffffffffffffffffffffffffffffffffffffff841660c08201529091508060e0810160405160208183030381529060405281526020018260000151815260200182602001518152602001886020015181526020016040518060200160405280600081525081525092505050949350505050565b60008060001b82846020015185606001518660000151606001518760000151608001518860a001518960c00151604051602001611f9b9695949392919061373c565b604051602081830303815290604052805190602001208560400151805190602001208660e00151604051602001611fd2919061379d565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815282825280516020918201206080808c0151805190840120928501989098529183019590955260608201939093529384015260a083015260c082015260e00160405160208183030381529060405280519060200120905092915050565b3373ffffffffffffffffffffffffffffffffffffffff8216036120d8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c660000000000000000006044820152606401610688565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b60008181526001830160205260408120546121955750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915561072d565b50600061072d565b600081815260018301602052604081205480156122865760006121c16001836137b0565b85549091506000906121d5906001906137b0565b905080821461223a5760008660000182815481106121f5576121f5612da8565b906000526020600020015490508087600001848154811061221857612218612da8565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061224b5761224b6137c3565b60019003818190600052602060002001600090559055856001016000868152602001908152602001600020600090556001935050505061072d565b600091505061072d565b5092915050565b60006122f9826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166123ff9092919063ffffffff16565b805190915015610a0157808060200190518101906123179190612b15565b610a01576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610688565b6060816000018054806020026020016040519081016040528092919081815260200182805480156123f357602002820191906000526020600020905b8154815260200190600101908083116123df575b50505050509050919050565b60606116f68484600085856000808673ffffffffffffffffffffffffffffffffffffffff16858760405161243391906137f2565b60006040518083038185875af1925050503d8060008114612470576040519150601f19603f3d011682016040523d82523d6000602084013e612475565b606091505b509150915061248687838387612491565b979650505050505050565b606083156125275782516000036125205773ffffffffffffffffffffffffffffffffffffffff85163b612520576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610688565b50816116f6565b6116f6838381511561253c5781518083602001fd5b806040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610688919061281e565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040805190810167ffffffffffffffff811182821017156125c2576125c2612570565b60405290565b6040516080810167ffffffffffffffff811182821017156125c2576125c2612570565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff8111828210171561263257612632612570565b604052919050565b600067ffffffffffffffff82111561265457612654612570565b5060051b60200190565b67ffffffffffffffff8116811461057757600080fd5b73ffffffffffffffffffffffffffffffffffffffff8116811461057757600080fd5b600060208083850312156126a957600080fd5b823567ffffffffffffffff8111156126c057600080fd5b8301601f810185136126d157600080fd5b80356126e46126df8261263a565b6125eb565b81815260069190911b8201830190838101908783111561270357600080fd5b928401925b8284101561248657604084890312156127215760008081fd5b61272961259f565b84356127348161265e565b81528486013561274381612674565b8187015282526040939093019290840190612708565b6080810161072d828467ffffffffffffffff8151168252602081015173ffffffffffffffffffffffffffffffffffffffff808216602085015280604084015116604085015280606084015116606085015250505050565b60005b838110156127cb5781810151838201526020016127b3565b50506000910152565b600081518084526127ec8160208601602086016127b0565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b60208152600061072a60208301846127d4565b600060a0828403121561284357600080fd5b50919050565b6000806040838503121561285c57600080fd5b82356128678161265e565b9150602083013567ffffffffffffffff81111561288357600080fd5b61288f85828601612831565b9150509250929050565b600080602083850312156128ac57600080fd5b823567ffffffffffffffff808211156128c457600080fd5b818501915085601f8301126128d857600080fd5b8135818111156128e757600080fd5b8660208260051b85010111156128fc57600080fd5b60209290920196919550909350505050565b6000806040838503121561292157600080fd5b823561292c8161265e565b9150602083013561293c81612674565b809150509250929050565b60006020828403121561295957600080fd5b8135611a1b8161265e565b6080810161072d8284805173ffffffffffffffffffffffffffffffffffffffff908116835260208083015182169084015260408083015182169084015260609182015116910152565b6020808252825182820181905260009190848201906040850190845b818110156129fb57835173ffffffffffffffffffffffffffffffffffffffff16835292840192918401916001016129c9565b50909695505050505050565b8035612a1281612674565b919050565b600060808284031215612a2957600080fd5b612a316125c8565b8235612a3c81612674565b81526020830135612a4c81612674565b60208201526040830135612a5f81612674565b60408201526060830135612a7281612674565b60608201529392505050565b60008060008060808587031215612a9457600080fd5b8435612a9f8161265e565b9350602085013567ffffffffffffffff811115612abb57600080fd5b612ac787828801612831565b935050604085013591506060850135612adf81612674565b939692955090935050565b600060208284031215612afc57600080fd5b8135611a1b81612674565b801515811461057757600080fd5b600060208284031215612b2757600080fd5b8151611a1b81612b07565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112612b6757600080fd5b830160208101925035905067ffffffffffffffff811115612b8757600080fd5b803603821315612b9657600080fd5b9250929050565b8183528181602085013750600060208284010152600060207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b8183526000602080850194508260005b85811015612c3b578135612c0981612674565b73ffffffffffffffffffffffffffffffffffffffff168752818301358388015260409687019690910190600101612bf6565b509495945050505050565b600067ffffffffffffffff808516835260406020840152612c678485612b32565b60a06040860152612c7c60e086018284612b9d565b915050612c8c6020860186612b32565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc080878503016060880152612cc2848385612b9d565b9350604088013592507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1883603018312612cfb57600080fd5b60209288019283019235915084821115612d1457600080fd5b8160061b3603831315612d2657600080fd5b80878503016080880152612d3b848385612be6565b9450612d4960608901612a07565b73ffffffffffffffffffffffffffffffffffffffff811660a08901529350612d746080890189612b32565b94509250808786030160c08801525050612486838383612b9d565b600060208284031215612da157600080fd5b5051919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81833603018112612e0b57600080fd5b9190910192915050565b600082601f830112612e2657600080fd5b81356020612e366126df8361263a565b8083825260208201915060208460051b870101935086841115612e5857600080fd5b602086015b84811015612e7d578035612e7081612674565b8352918301918301612e5d565b509695505050505050565b600060808236031215612e9a57600080fd5b612ea26125c8565b8235612ead8161265e565b81526020830135612ebd81612b07565b6020820152604083013567ffffffffffffffff80821115612edd57600080fd5b612ee936838701612e15565b60408401526060850135915080821115612f0257600080fd5b50612f0f36828601612e15565b60608301525092915050565b60006020808385031215612f2e57600080fd5b825167ffffffffffffffff811115612f4557600080fd5b8301601f81018513612f5657600080fd5b8051612f646126df8261263a565b81815260059190911b82018301908381019087831115612f8357600080fd5b928401925b82841015612486578351612f9b81612674565b82529284019290840190612f88565b600060208284031215612fbc57600080fd5b8151611a1b81612674565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b67ffffffffffffffff81811683821601908082111561229057612290612fc7565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe184360301811261304c57600080fd5b83018035915067ffffffffffffffff82111561306757600080fd5b602001915036819003821315612b9657600080fd5b67ffffffffffffffff8616815273ffffffffffffffffffffffffffffffffffffffff85166020820152836040820152608060608201526000612486608083018486612b9d565b600082601f8301126130d357600080fd5b815167ffffffffffffffff8111156130ed576130ed612570565b61311e60207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116016125eb565b81815284602083860101111561313357600080fd5b6116f68260208301602087016127b0565b60008060006060848603121561315957600080fd5b83519250602084015161316b81612b07565b604085015190925067ffffffffffffffff81111561318857600080fd5b613194868287016130c2565b9150509250925092565b600067ffffffffffffffff8083168181036131bb576131bb612fc7565b6001019392505050565b6000602082840312156131d757600080fd5b8151611a1b8161265e565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe184360301811261321757600080fd5b83018035915067ffffffffffffffff82111561323257600080fd5b6020019150600681901b3603821315612b9657600080fd5b60006040828403121561325c57600080fd5b61326461259f565b823561326f81612674565b81526020928301359281019290925250919050565b600082825180855260208086019550808260051b84010181860160005b84811015613354577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0868403018952815160a081518186526132e5828701826127d4565b91505085820151858203878701526132fd82826127d4565b9150506040808301518683038288015261331783826127d4565b9250505060608083015181870152506080808301519250858203818701525061334081836127d4565b9a86019a94505050908301906001016132a1565b5090979650505050505050565b67ffffffffffffffff851681526060602082015260006133846060830186613284565b8281036040840152612486818587612be6565b600060208083850312156133aa57600080fd5b825167ffffffffffffffff808211156133c257600080fd5b818501915085601f8301126133d657600080fd5b81516133e46126df8261263a565b81815260059190911b8301840190848101908883111561340357600080fd5b8585015b8381101561343b5780518581111561341f5760008081fd5b61342d8b89838a01016130c2565b845250918601918601613407565b5098975050505050505050565b6020815261349960208201835180518252602081015167ffffffffffffffff808216602085015280604084015116604085015280606084015116606085015280608084015116608085015250505050565b600060208301516134c260c084018273ffffffffffffffffffffffffffffffffffffffff169052565b5060408301516101808060e08501526134df6101a08501836127d4565b915060608501517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0808685030161010087015261351c84836127d4565b935060808701519150808685030161012087015261353a84836127d4565b935060a0870151915061356661014087018373ffffffffffffffffffffffffffffffffffffffff169052565b60c087015161016087015260e087015191508086850301838701525061358c8382613284565b9695505050505050565b61010081016135ee828567ffffffffffffffff8151168252602081015173ffffffffffffffffffffffffffffffffffffffff808216602085015280604084015116604085015280606084015116606085015250505050565b825173ffffffffffffffffffffffffffffffffffffffff90811660808401526020840151811660a08401526040840151811660c084015260608401511660e0830152611a1b565b602081526000825160a0602084015261365160c08401826127d4565b905067ffffffffffffffff6020850151166040840152604084015173ffffffffffffffffffffffffffffffffffffffff8082166060860152606086015160808601528060808701511660a086015250508091505092915050565b6000602082840312156136bd57600080fd5b815167ffffffffffffffff808211156136d557600080fd5b90830190604082860312156136e957600080fd5b6136f161259f565b82518281111561370057600080fd5b61370c878286016130c2565b82525060208301518281111561372157600080fd5b61372d878286016130c2565b60208301525095945050505050565b600073ffffffffffffffffffffffffffffffffffffffff808916835260c0602084015261376c60c08401896127d4565b67ffffffffffffffff97881660408501529590961660608301525091909316608082015260a0019190915292915050565b60208152600061072a6020830184613284565b8181038181111561072d5761072d612fc7565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b60008251612e0b8184602087016127b056fea164736f6c6343000818000a", +} + +var OnRampABI = OnRampMetaData.ABI + +var OnRampBin = OnRampMetaData.Bin + +func DeployOnRamp(auth *bind.TransactOpts, backend bind.ContractBackend, staticConfig OnRampStaticConfig, dynamicConfig OnRampDynamicConfig, destChainConfigArgs []OnRampDestChainConfigArgs) (common.Address, *types.Transaction, *OnRamp, error) { + parsed, err := OnRampMetaData.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(OnRampBin), backend, staticConfig, dynamicConfig, destChainConfigArgs) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &OnRamp{address: address, abi: *parsed, OnRampCaller: OnRampCaller{contract: contract}, OnRampTransactor: OnRampTransactor{contract: contract}, OnRampFilterer: OnRampFilterer{contract: contract}}, nil +} + +type OnRamp struct { + address common.Address + abi abi.ABI + OnRampCaller + OnRampTransactor + OnRampFilterer +} + +type OnRampCaller struct { + contract *bind.BoundContract +} + +type OnRampTransactor struct { + contract *bind.BoundContract +} + +type OnRampFilterer struct { + contract *bind.BoundContract +} + +type OnRampSession struct { + Contract *OnRamp + CallOpts bind.CallOpts + TransactOpts bind.TransactOpts +} + +type OnRampCallerSession struct { + Contract *OnRampCaller + CallOpts bind.CallOpts +} + +type OnRampTransactorSession struct { + Contract *OnRampTransactor + TransactOpts bind.TransactOpts +} + +type OnRampRaw struct { + Contract *OnRamp +} + +type OnRampCallerRaw struct { + Contract *OnRampCaller +} + +type OnRampTransactorRaw struct { + Contract *OnRampTransactor +} + +func NewOnRamp(address common.Address, backend bind.ContractBackend) (*OnRamp, error) { + abi, err := abi.JSON(strings.NewReader(OnRampABI)) + if err != nil { + return nil, err + } + contract, err := bindOnRamp(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &OnRamp{address: address, abi: abi, OnRampCaller: OnRampCaller{contract: contract}, OnRampTransactor: OnRampTransactor{contract: contract}, OnRampFilterer: OnRampFilterer{contract: contract}}, nil +} + +func NewOnRampCaller(address common.Address, caller bind.ContractCaller) (*OnRampCaller, error) { + contract, err := bindOnRamp(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &OnRampCaller{contract: contract}, nil +} + +func NewOnRampTransactor(address common.Address, transactor bind.ContractTransactor) (*OnRampTransactor, error) { + contract, err := bindOnRamp(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &OnRampTransactor{contract: contract}, nil +} + +func NewOnRampFilterer(address common.Address, filterer bind.ContractFilterer) (*OnRampFilterer, error) { + contract, err := bindOnRamp(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &OnRampFilterer{contract: contract}, nil +} + +func bindOnRamp(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := OnRampMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +func (_OnRamp *OnRampRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _OnRamp.Contract.OnRampCaller.contract.Call(opts, result, method, params...) +} + +func (_OnRamp *OnRampRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _OnRamp.Contract.OnRampTransactor.contract.Transfer(opts) +} + +func (_OnRamp *OnRampRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _OnRamp.Contract.OnRampTransactor.contract.Transact(opts, method, params...) +} + +func (_OnRamp *OnRampCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _OnRamp.Contract.contract.Call(opts, result, method, params...) +} + +func (_OnRamp *OnRampTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _OnRamp.Contract.contract.Transfer(opts) +} + +func (_OnRamp *OnRampTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _OnRamp.Contract.contract.Transact(opts, method, params...) +} + +func (_OnRamp *OnRampCaller) GetAllowedSendersList(opts *bind.CallOpts, destChainSelector uint64) ([]common.Address, error) { + var out []interface{} + err := _OnRamp.contract.Call(opts, &out, "getAllowedSendersList", destChainSelector) + + if err != nil { + return *new([]common.Address), err + } + + out0 := *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) + + return out0, err + +} + +func (_OnRamp *OnRampSession) GetAllowedSendersList(destChainSelector uint64) ([]common.Address, error) { + return _OnRamp.Contract.GetAllowedSendersList(&_OnRamp.CallOpts, destChainSelector) +} + +func (_OnRamp *OnRampCallerSession) GetAllowedSendersList(destChainSelector uint64) ([]common.Address, error) { + return _OnRamp.Contract.GetAllowedSendersList(&_OnRamp.CallOpts, destChainSelector) +} + +func (_OnRamp *OnRampCaller) GetDestChainConfig(opts *bind.CallOpts, destChainSelector uint64) (GetDestChainConfig, + + error) { + var out []interface{} + err := _OnRamp.contract.Call(opts, &out, "getDestChainConfig", destChainSelector) + + outstruct := new(GetDestChainConfig) + if err != nil { + return *outstruct, err + } + + outstruct.SequenceNumber = *abi.ConvertType(out[0], new(uint64)).(*uint64) + outstruct.AllowListEnabled = *abi.ConvertType(out[1], new(bool)).(*bool) + outstruct.Router = *abi.ConvertType(out[2], new(common.Address)).(*common.Address) + + return *outstruct, err + +} + +func (_OnRamp *OnRampSession) GetDestChainConfig(destChainSelector uint64) (GetDestChainConfig, + + error) { + return _OnRamp.Contract.GetDestChainConfig(&_OnRamp.CallOpts, destChainSelector) +} + +func (_OnRamp *OnRampCallerSession) GetDestChainConfig(destChainSelector uint64) (GetDestChainConfig, + + error) { + return _OnRamp.Contract.GetDestChainConfig(&_OnRamp.CallOpts, destChainSelector) +} + +func (_OnRamp *OnRampCaller) GetDynamicConfig(opts *bind.CallOpts) (OnRampDynamicConfig, error) { + var out []interface{} + err := _OnRamp.contract.Call(opts, &out, "getDynamicConfig") + + if err != nil { + return *new(OnRampDynamicConfig), err + } + + out0 := *abi.ConvertType(out[0], new(OnRampDynamicConfig)).(*OnRampDynamicConfig) + + return out0, err + +} + +func (_OnRamp *OnRampSession) GetDynamicConfig() (OnRampDynamicConfig, error) { + return _OnRamp.Contract.GetDynamicConfig(&_OnRamp.CallOpts) +} + +func (_OnRamp *OnRampCallerSession) GetDynamicConfig() (OnRampDynamicConfig, error) { + return _OnRamp.Contract.GetDynamicConfig(&_OnRamp.CallOpts) +} + +func (_OnRamp *OnRampCaller) GetExpectedNextSequenceNumber(opts *bind.CallOpts, destChainSelector uint64) (uint64, error) { + var out []interface{} + err := _OnRamp.contract.Call(opts, &out, "getExpectedNextSequenceNumber", destChainSelector) + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +func (_OnRamp *OnRampSession) GetExpectedNextSequenceNumber(destChainSelector uint64) (uint64, error) { + return _OnRamp.Contract.GetExpectedNextSequenceNumber(&_OnRamp.CallOpts, destChainSelector) +} + +func (_OnRamp *OnRampCallerSession) GetExpectedNextSequenceNumber(destChainSelector uint64) (uint64, error) { + return _OnRamp.Contract.GetExpectedNextSequenceNumber(&_OnRamp.CallOpts, destChainSelector) +} + +func (_OnRamp *OnRampCaller) GetFee(opts *bind.CallOpts, destChainSelector uint64, message ClientEVM2AnyMessage) (*big.Int, error) { + var out []interface{} + err := _OnRamp.contract.Call(opts, &out, "getFee", destChainSelector, message) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_OnRamp *OnRampSession) GetFee(destChainSelector uint64, message ClientEVM2AnyMessage) (*big.Int, error) { + return _OnRamp.Contract.GetFee(&_OnRamp.CallOpts, destChainSelector, message) +} + +func (_OnRamp *OnRampCallerSession) GetFee(destChainSelector uint64, message ClientEVM2AnyMessage) (*big.Int, error) { + return _OnRamp.Contract.GetFee(&_OnRamp.CallOpts, destChainSelector, message) +} + +func (_OnRamp *OnRampCaller) GetPoolBySourceToken(opts *bind.CallOpts, arg0 uint64, sourceToken common.Address) (common.Address, error) { + var out []interface{} + err := _OnRamp.contract.Call(opts, &out, "getPoolBySourceToken", arg0, sourceToken) + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_OnRamp *OnRampSession) GetPoolBySourceToken(arg0 uint64, sourceToken common.Address) (common.Address, error) { + return _OnRamp.Contract.GetPoolBySourceToken(&_OnRamp.CallOpts, arg0, sourceToken) +} + +func (_OnRamp *OnRampCallerSession) GetPoolBySourceToken(arg0 uint64, sourceToken common.Address) (common.Address, error) { + return _OnRamp.Contract.GetPoolBySourceToken(&_OnRamp.CallOpts, arg0, sourceToken) +} + +func (_OnRamp *OnRampCaller) GetRouter(opts *bind.CallOpts, destChainSelector uint64) (common.Address, error) { + var out []interface{} + err := _OnRamp.contract.Call(opts, &out, "getRouter", destChainSelector) + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_OnRamp *OnRampSession) GetRouter(destChainSelector uint64) (common.Address, error) { + return _OnRamp.Contract.GetRouter(&_OnRamp.CallOpts, destChainSelector) +} + +func (_OnRamp *OnRampCallerSession) GetRouter(destChainSelector uint64) (common.Address, error) { + return _OnRamp.Contract.GetRouter(&_OnRamp.CallOpts, destChainSelector) +} + +func (_OnRamp *OnRampCaller) GetStaticConfig(opts *bind.CallOpts) (OnRampStaticConfig, error) { + var out []interface{} + err := _OnRamp.contract.Call(opts, &out, "getStaticConfig") + + if err != nil { + return *new(OnRampStaticConfig), err + } + + out0 := *abi.ConvertType(out[0], new(OnRampStaticConfig)).(*OnRampStaticConfig) + + return out0, err + +} + +func (_OnRamp *OnRampSession) GetStaticConfig() (OnRampStaticConfig, error) { + return _OnRamp.Contract.GetStaticConfig(&_OnRamp.CallOpts) +} + +func (_OnRamp *OnRampCallerSession) GetStaticConfig() (OnRampStaticConfig, error) { + return _OnRamp.Contract.GetStaticConfig(&_OnRamp.CallOpts) +} + +func (_OnRamp *OnRampCaller) GetSupportedTokens(opts *bind.CallOpts, arg0 uint64) ([]common.Address, error) { + var out []interface{} + err := _OnRamp.contract.Call(opts, &out, "getSupportedTokens", arg0) + + if err != nil { + return *new([]common.Address), err + } + + out0 := *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) + + return out0, err + +} + +func (_OnRamp *OnRampSession) GetSupportedTokens(arg0 uint64) ([]common.Address, error) { + return _OnRamp.Contract.GetSupportedTokens(&_OnRamp.CallOpts, arg0) +} + +func (_OnRamp *OnRampCallerSession) GetSupportedTokens(arg0 uint64) ([]common.Address, error) { + return _OnRamp.Contract.GetSupportedTokens(&_OnRamp.CallOpts, arg0) +} + +func (_OnRamp *OnRampCaller) Owner(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _OnRamp.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 + +} + +func (_OnRamp *OnRampSession) Owner() (common.Address, error) { + return _OnRamp.Contract.Owner(&_OnRamp.CallOpts) +} + +func (_OnRamp *OnRampCallerSession) Owner() (common.Address, error) { + return _OnRamp.Contract.Owner(&_OnRamp.CallOpts) +} + +func (_OnRamp *OnRampCaller) TypeAndVersion(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _OnRamp.contract.Call(opts, &out, "typeAndVersion") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +func (_OnRamp *OnRampSession) TypeAndVersion() (string, error) { + return _OnRamp.Contract.TypeAndVersion(&_OnRamp.CallOpts) +} + +func (_OnRamp *OnRampCallerSession) TypeAndVersion() (string, error) { + return _OnRamp.Contract.TypeAndVersion(&_OnRamp.CallOpts) +} + +func (_OnRamp *OnRampTransactor) AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + return _OnRamp.contract.Transact(opts, "acceptOwnership") +} + +func (_OnRamp *OnRampSession) AcceptOwnership() (*types.Transaction, error) { + return _OnRamp.Contract.AcceptOwnership(&_OnRamp.TransactOpts) +} + +func (_OnRamp *OnRampTransactorSession) AcceptOwnership() (*types.Transaction, error) { + return _OnRamp.Contract.AcceptOwnership(&_OnRamp.TransactOpts) +} + +func (_OnRamp *OnRampTransactor) ApplyAllowListUpdates(opts *bind.TransactOpts, allowListConfigArgsItems []OnRampAllowListConfigArgs) (*types.Transaction, error) { + return _OnRamp.contract.Transact(opts, "applyAllowListUpdates", allowListConfigArgsItems) +} + +func (_OnRamp *OnRampSession) ApplyAllowListUpdates(allowListConfigArgsItems []OnRampAllowListConfigArgs) (*types.Transaction, error) { + return _OnRamp.Contract.ApplyAllowListUpdates(&_OnRamp.TransactOpts, allowListConfigArgsItems) +} + +func (_OnRamp *OnRampTransactorSession) ApplyAllowListUpdates(allowListConfigArgsItems []OnRampAllowListConfigArgs) (*types.Transaction, error) { + return _OnRamp.Contract.ApplyAllowListUpdates(&_OnRamp.TransactOpts, allowListConfigArgsItems) +} + +func (_OnRamp *OnRampTransactor) ApplyDestChainConfigUpdates(opts *bind.TransactOpts, destChainConfigArgs []OnRampDestChainConfigArgs) (*types.Transaction, error) { + return _OnRamp.contract.Transact(opts, "applyDestChainConfigUpdates", destChainConfigArgs) +} + +func (_OnRamp *OnRampSession) ApplyDestChainConfigUpdates(destChainConfigArgs []OnRampDestChainConfigArgs) (*types.Transaction, error) { + return _OnRamp.Contract.ApplyDestChainConfigUpdates(&_OnRamp.TransactOpts, destChainConfigArgs) +} + +func (_OnRamp *OnRampTransactorSession) ApplyDestChainConfigUpdates(destChainConfigArgs []OnRampDestChainConfigArgs) (*types.Transaction, error) { + return _OnRamp.Contract.ApplyDestChainConfigUpdates(&_OnRamp.TransactOpts, destChainConfigArgs) +} + +func (_OnRamp *OnRampTransactor) ForwardFromRouter(opts *bind.TransactOpts, destChainSelector uint64, message ClientEVM2AnyMessage, feeTokenAmount *big.Int, originalSender common.Address) (*types.Transaction, error) { + return _OnRamp.contract.Transact(opts, "forwardFromRouter", destChainSelector, message, feeTokenAmount, originalSender) +} + +func (_OnRamp *OnRampSession) ForwardFromRouter(destChainSelector uint64, message ClientEVM2AnyMessage, feeTokenAmount *big.Int, originalSender common.Address) (*types.Transaction, error) { + return _OnRamp.Contract.ForwardFromRouter(&_OnRamp.TransactOpts, destChainSelector, message, feeTokenAmount, originalSender) +} + +func (_OnRamp *OnRampTransactorSession) ForwardFromRouter(destChainSelector uint64, message ClientEVM2AnyMessage, feeTokenAmount *big.Int, originalSender common.Address) (*types.Transaction, error) { + return _OnRamp.Contract.ForwardFromRouter(&_OnRamp.TransactOpts, destChainSelector, message, feeTokenAmount, originalSender) +} + +func (_OnRamp *OnRampTransactor) SetDynamicConfig(opts *bind.TransactOpts, dynamicConfig OnRampDynamicConfig) (*types.Transaction, error) { + return _OnRamp.contract.Transact(opts, "setDynamicConfig", dynamicConfig) +} + +func (_OnRamp *OnRampSession) SetDynamicConfig(dynamicConfig OnRampDynamicConfig) (*types.Transaction, error) { + return _OnRamp.Contract.SetDynamicConfig(&_OnRamp.TransactOpts, dynamicConfig) +} + +func (_OnRamp *OnRampTransactorSession) SetDynamicConfig(dynamicConfig OnRampDynamicConfig) (*types.Transaction, error) { + return _OnRamp.Contract.SetDynamicConfig(&_OnRamp.TransactOpts, dynamicConfig) +} + +func (_OnRamp *OnRampTransactor) TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) { + return _OnRamp.contract.Transact(opts, "transferOwnership", to) +} + +func (_OnRamp *OnRampSession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _OnRamp.Contract.TransferOwnership(&_OnRamp.TransactOpts, to) +} + +func (_OnRamp *OnRampTransactorSession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _OnRamp.Contract.TransferOwnership(&_OnRamp.TransactOpts, to) +} + +func (_OnRamp *OnRampTransactor) WithdrawFeeTokens(opts *bind.TransactOpts) (*types.Transaction, error) { + return _OnRamp.contract.Transact(opts, "withdrawFeeTokens") +} + +func (_OnRamp *OnRampSession) WithdrawFeeTokens() (*types.Transaction, error) { + return _OnRamp.Contract.WithdrawFeeTokens(&_OnRamp.TransactOpts) +} + +func (_OnRamp *OnRampTransactorSession) WithdrawFeeTokens() (*types.Transaction, error) { + return _OnRamp.Contract.WithdrawFeeTokens(&_OnRamp.TransactOpts) +} + +type OnRampAllowListAdminSetIterator struct { + Event *OnRampAllowListAdminSet + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *OnRampAllowListAdminSetIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(OnRampAllowListAdminSet) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(OnRampAllowListAdminSet) + 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() + } +} + +func (it *OnRampAllowListAdminSetIterator) Error() error { + return it.fail +} + +func (it *OnRampAllowListAdminSetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type OnRampAllowListAdminSet struct { + AllowListAdmin common.Address + Raw types.Log +} + +func (_OnRamp *OnRampFilterer) FilterAllowListAdminSet(opts *bind.FilterOpts, allowListAdmin []common.Address) (*OnRampAllowListAdminSetIterator, error) { + + var allowListAdminRule []interface{} + for _, allowListAdminItem := range allowListAdmin { + allowListAdminRule = append(allowListAdminRule, allowListAdminItem) + } + + logs, sub, err := _OnRamp.contract.FilterLogs(opts, "AllowListAdminSet", allowListAdminRule) + if err != nil { + return nil, err + } + return &OnRampAllowListAdminSetIterator{contract: _OnRamp.contract, event: "AllowListAdminSet", logs: logs, sub: sub}, nil +} + +func (_OnRamp *OnRampFilterer) WatchAllowListAdminSet(opts *bind.WatchOpts, sink chan<- *OnRampAllowListAdminSet, allowListAdmin []common.Address) (event.Subscription, error) { + + var allowListAdminRule []interface{} + for _, allowListAdminItem := range allowListAdmin { + allowListAdminRule = append(allowListAdminRule, allowListAdminItem) + } + + logs, sub, err := _OnRamp.contract.WatchLogs(opts, "AllowListAdminSet", allowListAdminRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(OnRampAllowListAdminSet) + if err := _OnRamp.contract.UnpackLog(event, "AllowListAdminSet", 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 +} + +func (_OnRamp *OnRampFilterer) ParseAllowListAdminSet(log types.Log) (*OnRampAllowListAdminSet, error) { + event := new(OnRampAllowListAdminSet) + if err := _OnRamp.contract.UnpackLog(event, "AllowListAdminSet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type OnRampAllowListSendersAddedIterator struct { + Event *OnRampAllowListSendersAdded + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *OnRampAllowListSendersAddedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(OnRampAllowListSendersAdded) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(OnRampAllowListSendersAdded) + 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() + } +} + +func (it *OnRampAllowListSendersAddedIterator) Error() error { + return it.fail +} + +func (it *OnRampAllowListSendersAddedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type OnRampAllowListSendersAdded struct { + DestChainSelector uint64 + Senders []common.Address + Raw types.Log +} + +func (_OnRamp *OnRampFilterer) FilterAllowListSendersAdded(opts *bind.FilterOpts, destChainSelector []uint64) (*OnRampAllowListSendersAddedIterator, error) { + + var destChainSelectorRule []interface{} + for _, destChainSelectorItem := range destChainSelector { + destChainSelectorRule = append(destChainSelectorRule, destChainSelectorItem) + } + + logs, sub, err := _OnRamp.contract.FilterLogs(opts, "AllowListSendersAdded", destChainSelectorRule) + if err != nil { + return nil, err + } + return &OnRampAllowListSendersAddedIterator{contract: _OnRamp.contract, event: "AllowListSendersAdded", logs: logs, sub: sub}, nil +} + +func (_OnRamp *OnRampFilterer) WatchAllowListSendersAdded(opts *bind.WatchOpts, sink chan<- *OnRampAllowListSendersAdded, destChainSelector []uint64) (event.Subscription, error) { + + var destChainSelectorRule []interface{} + for _, destChainSelectorItem := range destChainSelector { + destChainSelectorRule = append(destChainSelectorRule, destChainSelectorItem) + } + + logs, sub, err := _OnRamp.contract.WatchLogs(opts, "AllowListSendersAdded", destChainSelectorRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(OnRampAllowListSendersAdded) + if err := _OnRamp.contract.UnpackLog(event, "AllowListSendersAdded", 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 +} + +func (_OnRamp *OnRampFilterer) ParseAllowListSendersAdded(log types.Log) (*OnRampAllowListSendersAdded, error) { + event := new(OnRampAllowListSendersAdded) + if err := _OnRamp.contract.UnpackLog(event, "AllowListSendersAdded", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type OnRampAllowListSendersRemovedIterator struct { + Event *OnRampAllowListSendersRemoved + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *OnRampAllowListSendersRemovedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(OnRampAllowListSendersRemoved) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(OnRampAllowListSendersRemoved) + 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() + } +} + +func (it *OnRampAllowListSendersRemovedIterator) Error() error { + return it.fail +} + +func (it *OnRampAllowListSendersRemovedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type OnRampAllowListSendersRemoved struct { + DestChainSelector uint64 + Senders []common.Address + Raw types.Log +} + +func (_OnRamp *OnRampFilterer) FilterAllowListSendersRemoved(opts *bind.FilterOpts, destChainSelector []uint64) (*OnRampAllowListSendersRemovedIterator, error) { + + var destChainSelectorRule []interface{} + for _, destChainSelectorItem := range destChainSelector { + destChainSelectorRule = append(destChainSelectorRule, destChainSelectorItem) + } + + logs, sub, err := _OnRamp.contract.FilterLogs(opts, "AllowListSendersRemoved", destChainSelectorRule) + if err != nil { + return nil, err + } + return &OnRampAllowListSendersRemovedIterator{contract: _OnRamp.contract, event: "AllowListSendersRemoved", logs: logs, sub: sub}, nil +} + +func (_OnRamp *OnRampFilterer) WatchAllowListSendersRemoved(opts *bind.WatchOpts, sink chan<- *OnRampAllowListSendersRemoved, destChainSelector []uint64) (event.Subscription, error) { + + var destChainSelectorRule []interface{} + for _, destChainSelectorItem := range destChainSelector { + destChainSelectorRule = append(destChainSelectorRule, destChainSelectorItem) + } + + logs, sub, err := _OnRamp.contract.WatchLogs(opts, "AllowListSendersRemoved", destChainSelectorRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(OnRampAllowListSendersRemoved) + if err := _OnRamp.contract.UnpackLog(event, "AllowListSendersRemoved", 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 +} + +func (_OnRamp *OnRampFilterer) ParseAllowListSendersRemoved(log types.Log) (*OnRampAllowListSendersRemoved, error) { + event := new(OnRampAllowListSendersRemoved) + if err := _OnRamp.contract.UnpackLog(event, "AllowListSendersRemoved", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type OnRampCCIPMessageSentIterator struct { + Event *OnRampCCIPMessageSent + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *OnRampCCIPMessageSentIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(OnRampCCIPMessageSent) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(OnRampCCIPMessageSent) + 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() + } +} + +func (it *OnRampCCIPMessageSentIterator) Error() error { + return it.fail +} + +func (it *OnRampCCIPMessageSentIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type OnRampCCIPMessageSent struct { + DestChainSelector uint64 + Message InternalEVM2AnyRampMessage + Raw types.Log +} + +func (_OnRamp *OnRampFilterer) FilterCCIPMessageSent(opts *bind.FilterOpts, destChainSelector []uint64) (*OnRampCCIPMessageSentIterator, error) { + + var destChainSelectorRule []interface{} + for _, destChainSelectorItem := range destChainSelector { + destChainSelectorRule = append(destChainSelectorRule, destChainSelectorItem) + } + + logs, sub, err := _OnRamp.contract.FilterLogs(opts, "CCIPMessageSent", destChainSelectorRule) + if err != nil { + return nil, err + } + return &OnRampCCIPMessageSentIterator{contract: _OnRamp.contract, event: "CCIPMessageSent", logs: logs, sub: sub}, nil +} + +func (_OnRamp *OnRampFilterer) WatchCCIPMessageSent(opts *bind.WatchOpts, sink chan<- *OnRampCCIPMessageSent, destChainSelector []uint64) (event.Subscription, error) { + + var destChainSelectorRule []interface{} + for _, destChainSelectorItem := range destChainSelector { + destChainSelectorRule = append(destChainSelectorRule, destChainSelectorItem) + } + + logs, sub, err := _OnRamp.contract.WatchLogs(opts, "CCIPMessageSent", destChainSelectorRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(OnRampCCIPMessageSent) + if err := _OnRamp.contract.UnpackLog(event, "CCIPMessageSent", 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 +} + +func (_OnRamp *OnRampFilterer) ParseCCIPMessageSent(log types.Log) (*OnRampCCIPMessageSent, error) { + event := new(OnRampCCIPMessageSent) + if err := _OnRamp.contract.UnpackLog(event, "CCIPMessageSent", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type OnRampConfigSetIterator struct { + Event *OnRampConfigSet + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *OnRampConfigSetIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(OnRampConfigSet) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(OnRampConfigSet) + 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() + } +} + +func (it *OnRampConfigSetIterator) Error() error { + return it.fail +} + +func (it *OnRampConfigSetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type OnRampConfigSet struct { + StaticConfig OnRampStaticConfig + DynamicConfig OnRampDynamicConfig + Raw types.Log +} + +func (_OnRamp *OnRampFilterer) FilterConfigSet(opts *bind.FilterOpts) (*OnRampConfigSetIterator, error) { + + logs, sub, err := _OnRamp.contract.FilterLogs(opts, "ConfigSet") + if err != nil { + return nil, err + } + return &OnRampConfigSetIterator{contract: _OnRamp.contract, event: "ConfigSet", logs: logs, sub: sub}, nil +} + +func (_OnRamp *OnRampFilterer) WatchConfigSet(opts *bind.WatchOpts, sink chan<- *OnRampConfigSet) (event.Subscription, error) { + + logs, sub, err := _OnRamp.contract.WatchLogs(opts, "ConfigSet") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(OnRampConfigSet) + if err := _OnRamp.contract.UnpackLog(event, "ConfigSet", 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 +} + +func (_OnRamp *OnRampFilterer) ParseConfigSet(log types.Log) (*OnRampConfigSet, error) { + event := new(OnRampConfigSet) + if err := _OnRamp.contract.UnpackLog(event, "ConfigSet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type OnRampDestChainConfigSetIterator struct { + Event *OnRampDestChainConfigSet + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *OnRampDestChainConfigSetIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(OnRampDestChainConfigSet) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(OnRampDestChainConfigSet) + 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() + } +} + +func (it *OnRampDestChainConfigSetIterator) Error() error { + return it.fail +} + +func (it *OnRampDestChainConfigSetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type OnRampDestChainConfigSet struct { + DestChainSelector uint64 + SequenceNumber uint64 + Router common.Address + AllowListEnabled bool + Raw types.Log +} + +func (_OnRamp *OnRampFilterer) FilterDestChainConfigSet(opts *bind.FilterOpts, destChainSelector []uint64) (*OnRampDestChainConfigSetIterator, error) { + + var destChainSelectorRule []interface{} + for _, destChainSelectorItem := range destChainSelector { + destChainSelectorRule = append(destChainSelectorRule, destChainSelectorItem) + } + + logs, sub, err := _OnRamp.contract.FilterLogs(opts, "DestChainConfigSet", destChainSelectorRule) + if err != nil { + return nil, err + } + return &OnRampDestChainConfigSetIterator{contract: _OnRamp.contract, event: "DestChainConfigSet", logs: logs, sub: sub}, nil +} + +func (_OnRamp *OnRampFilterer) WatchDestChainConfigSet(opts *bind.WatchOpts, sink chan<- *OnRampDestChainConfigSet, destChainSelector []uint64) (event.Subscription, error) { + + var destChainSelectorRule []interface{} + for _, destChainSelectorItem := range destChainSelector { + destChainSelectorRule = append(destChainSelectorRule, destChainSelectorItem) + } + + logs, sub, err := _OnRamp.contract.WatchLogs(opts, "DestChainConfigSet", destChainSelectorRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(OnRampDestChainConfigSet) + if err := _OnRamp.contract.UnpackLog(event, "DestChainConfigSet", 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 +} + +func (_OnRamp *OnRampFilterer) ParseDestChainConfigSet(log types.Log) (*OnRampDestChainConfigSet, error) { + event := new(OnRampDestChainConfigSet) + if err := _OnRamp.contract.UnpackLog(event, "DestChainConfigSet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type OnRampFeePaidIterator struct { + Event *OnRampFeePaid + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *OnRampFeePaidIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(OnRampFeePaid) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(OnRampFeePaid) + 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() + } +} + +func (it *OnRampFeePaidIterator) Error() error { + return it.fail +} + +func (it *OnRampFeePaidIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type OnRampFeePaid struct { + FeeToken common.Address + FeeValueJuels *big.Int + Raw types.Log +} + +func (_OnRamp *OnRampFilterer) FilterFeePaid(opts *bind.FilterOpts, feeToken []common.Address) (*OnRampFeePaidIterator, error) { + + var feeTokenRule []interface{} + for _, feeTokenItem := range feeToken { + feeTokenRule = append(feeTokenRule, feeTokenItem) + } + + logs, sub, err := _OnRamp.contract.FilterLogs(opts, "FeePaid", feeTokenRule) + if err != nil { + return nil, err + } + return &OnRampFeePaidIterator{contract: _OnRamp.contract, event: "FeePaid", logs: logs, sub: sub}, nil +} + +func (_OnRamp *OnRampFilterer) WatchFeePaid(opts *bind.WatchOpts, sink chan<- *OnRampFeePaid, feeToken []common.Address) (event.Subscription, error) { + + var feeTokenRule []interface{} + for _, feeTokenItem := range feeToken { + feeTokenRule = append(feeTokenRule, feeTokenItem) + } + + logs, sub, err := _OnRamp.contract.WatchLogs(opts, "FeePaid", feeTokenRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(OnRampFeePaid) + if err := _OnRamp.contract.UnpackLog(event, "FeePaid", 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 +} + +func (_OnRamp *OnRampFilterer) ParseFeePaid(log types.Log) (*OnRampFeePaid, error) { + event := new(OnRampFeePaid) + if err := _OnRamp.contract.UnpackLog(event, "FeePaid", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type OnRampFeeTokenWithdrawnIterator struct { + Event *OnRampFeeTokenWithdrawn + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *OnRampFeeTokenWithdrawnIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(OnRampFeeTokenWithdrawn) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(OnRampFeeTokenWithdrawn) + 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() + } +} + +func (it *OnRampFeeTokenWithdrawnIterator) Error() error { + return it.fail +} + +func (it *OnRampFeeTokenWithdrawnIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type OnRampFeeTokenWithdrawn struct { + FeeAggregator common.Address + FeeToken common.Address + Amount *big.Int + Raw types.Log +} + +func (_OnRamp *OnRampFilterer) FilterFeeTokenWithdrawn(opts *bind.FilterOpts, feeAggregator []common.Address, feeToken []common.Address) (*OnRampFeeTokenWithdrawnIterator, error) { + + var feeAggregatorRule []interface{} + for _, feeAggregatorItem := range feeAggregator { + feeAggregatorRule = append(feeAggregatorRule, feeAggregatorItem) + } + var feeTokenRule []interface{} + for _, feeTokenItem := range feeToken { + feeTokenRule = append(feeTokenRule, feeTokenItem) + } + + logs, sub, err := _OnRamp.contract.FilterLogs(opts, "FeeTokenWithdrawn", feeAggregatorRule, feeTokenRule) + if err != nil { + return nil, err + } + return &OnRampFeeTokenWithdrawnIterator{contract: _OnRamp.contract, event: "FeeTokenWithdrawn", logs: logs, sub: sub}, nil +} + +func (_OnRamp *OnRampFilterer) WatchFeeTokenWithdrawn(opts *bind.WatchOpts, sink chan<- *OnRampFeeTokenWithdrawn, feeAggregator []common.Address, feeToken []common.Address) (event.Subscription, error) { + + var feeAggregatorRule []interface{} + for _, feeAggregatorItem := range feeAggregator { + feeAggregatorRule = append(feeAggregatorRule, feeAggregatorItem) + } + var feeTokenRule []interface{} + for _, feeTokenItem := range feeToken { + feeTokenRule = append(feeTokenRule, feeTokenItem) + } + + logs, sub, err := _OnRamp.contract.WatchLogs(opts, "FeeTokenWithdrawn", feeAggregatorRule, feeTokenRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(OnRampFeeTokenWithdrawn) + if err := _OnRamp.contract.UnpackLog(event, "FeeTokenWithdrawn", 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 +} + +func (_OnRamp *OnRampFilterer) ParseFeeTokenWithdrawn(log types.Log) (*OnRampFeeTokenWithdrawn, error) { + event := new(OnRampFeeTokenWithdrawn) + if err := _OnRamp.contract.UnpackLog(event, "FeeTokenWithdrawn", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type OnRampOwnershipTransferRequestedIterator struct { + Event *OnRampOwnershipTransferRequested + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *OnRampOwnershipTransferRequestedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(OnRampOwnershipTransferRequested) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(OnRampOwnershipTransferRequested) + 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() + } +} + +func (it *OnRampOwnershipTransferRequestedIterator) Error() error { + return it.fail +} + +func (it *OnRampOwnershipTransferRequestedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type OnRampOwnershipTransferRequested struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_OnRamp *OnRampFilterer) FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*OnRampOwnershipTransferRequestedIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _OnRamp.contract.FilterLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return &OnRampOwnershipTransferRequestedIterator{contract: _OnRamp.contract, event: "OwnershipTransferRequested", logs: logs, sub: sub}, nil +} + +func (_OnRamp *OnRampFilterer) WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *OnRampOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _OnRamp.contract.WatchLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(OnRampOwnershipTransferRequested) + if err := _OnRamp.contract.UnpackLog(event, "OwnershipTransferRequested", 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 +} + +func (_OnRamp *OnRampFilterer) ParseOwnershipTransferRequested(log types.Log) (*OnRampOwnershipTransferRequested, error) { + event := new(OnRampOwnershipTransferRequested) + if err := _OnRamp.contract.UnpackLog(event, "OwnershipTransferRequested", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type OnRampOwnershipTransferredIterator struct { + Event *OnRampOwnershipTransferred + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *OnRampOwnershipTransferredIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(OnRampOwnershipTransferred) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(OnRampOwnershipTransferred) + 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() + } +} + +func (it *OnRampOwnershipTransferredIterator) Error() error { + return it.fail +} + +func (it *OnRampOwnershipTransferredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type OnRampOwnershipTransferred struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_OnRamp *OnRampFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*OnRampOwnershipTransferredIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _OnRamp.contract.FilterLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return &OnRampOwnershipTransferredIterator{contract: _OnRamp.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil +} + +func (_OnRamp *OnRampFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *OnRampOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _OnRamp.contract.WatchLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(OnRampOwnershipTransferred) + if err := _OnRamp.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 +} + +func (_OnRamp *OnRampFilterer) ParseOwnershipTransferred(log types.Log) (*OnRampOwnershipTransferred, error) { + event := new(OnRampOwnershipTransferred) + if err := _OnRamp.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type GetDestChainConfig struct { + SequenceNumber uint64 + AllowListEnabled bool + Router common.Address +} + +func (_OnRamp *OnRamp) ParseLog(log types.Log) (generated.AbigenLog, error) { + switch log.Topics[0] { + case _OnRamp.abi.Events["AllowListAdminSet"].ID: + return _OnRamp.ParseAllowListAdminSet(log) + case _OnRamp.abi.Events["AllowListSendersAdded"].ID: + return _OnRamp.ParseAllowListSendersAdded(log) + case _OnRamp.abi.Events["AllowListSendersRemoved"].ID: + return _OnRamp.ParseAllowListSendersRemoved(log) + case _OnRamp.abi.Events["CCIPMessageSent"].ID: + return _OnRamp.ParseCCIPMessageSent(log) + case _OnRamp.abi.Events["ConfigSet"].ID: + return _OnRamp.ParseConfigSet(log) + case _OnRamp.abi.Events["DestChainConfigSet"].ID: + return _OnRamp.ParseDestChainConfigSet(log) + case _OnRamp.abi.Events["FeePaid"].ID: + return _OnRamp.ParseFeePaid(log) + case _OnRamp.abi.Events["FeeTokenWithdrawn"].ID: + return _OnRamp.ParseFeeTokenWithdrawn(log) + case _OnRamp.abi.Events["OwnershipTransferRequested"].ID: + return _OnRamp.ParseOwnershipTransferRequested(log) + case _OnRamp.abi.Events["OwnershipTransferred"].ID: + return _OnRamp.ParseOwnershipTransferred(log) + + default: + return nil, fmt.Errorf("abigen wrapper received unknown log topic: %v", log.Topics[0]) + } +} + +func (OnRampAllowListAdminSet) Topic() common.Hash { + return common.HexToHash("0xb8c9b44ae5b5e3afb195f67391d9ff50cb904f9c0fa5fd520e497a97c1aa5a1e") +} + +func (OnRampAllowListSendersAdded) Topic() common.Hash { + return common.HexToHash("0x330939f6eafe8bb516716892fe962ff19770570838686e6579dbc1cc51fc3281") +} + +func (OnRampAllowListSendersRemoved) Topic() common.Hash { + return common.HexToHash("0xc237ec1921f855ccd5e9a5af9733f2d58943a5a8501ec5988e305d7a4d421586") +} + +func (OnRampCCIPMessageSent) Topic() common.Hash { + return common.HexToHash("0xf6e86ef8896c7a0d629406168f396e883280680c99e649b9e2d36466fbc9f9e5") +} + +func (OnRampConfigSet) Topic() common.Hash { + return common.HexToHash("0x23a1adf8ad7fad6091a4803227af2cee848c01a7c812404cade7c25636925e32") +} + +func (OnRampDestChainConfigSet) Topic() common.Hash { + return common.HexToHash("0xd5ad72bc37dc7a80a8b9b9df20500046fd7341adb1be2258a540466fdd7dcef5") +} + +func (OnRampFeePaid) Topic() common.Hash { + return common.HexToHash("0x075a2720282fdf622141dae0b048ef90a21a7e57c134c76912d19d006b3b3f6f") +} + +func (OnRampFeeTokenWithdrawn) Topic() common.Hash { + return common.HexToHash("0x508d7d183612c18fc339b42618912b9fa3239f631dd7ec0671f950200a0fa66e") +} + +func (OnRampOwnershipTransferRequested) Topic() common.Hash { + return common.HexToHash("0xed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae1278") +} + +func (OnRampOwnershipTransferred) Topic() common.Hash { + return common.HexToHash("0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0") +} + +func (_OnRamp *OnRamp) Address() common.Address { + return _OnRamp.address +} + +type OnRampInterface interface { + GetAllowedSendersList(opts *bind.CallOpts, destChainSelector uint64) ([]common.Address, error) + + GetDestChainConfig(opts *bind.CallOpts, destChainSelector uint64) (GetDestChainConfig, + + error) + + GetDynamicConfig(opts *bind.CallOpts) (OnRampDynamicConfig, error) + + GetExpectedNextSequenceNumber(opts *bind.CallOpts, destChainSelector uint64) (uint64, error) + + GetFee(opts *bind.CallOpts, destChainSelector uint64, message ClientEVM2AnyMessage) (*big.Int, error) + + GetPoolBySourceToken(opts *bind.CallOpts, arg0 uint64, sourceToken common.Address) (common.Address, error) + + GetRouter(opts *bind.CallOpts, destChainSelector uint64) (common.Address, error) + + GetStaticConfig(opts *bind.CallOpts) (OnRampStaticConfig, error) + + GetSupportedTokens(opts *bind.CallOpts, arg0 uint64) ([]common.Address, error) + + Owner(opts *bind.CallOpts) (common.Address, error) + + TypeAndVersion(opts *bind.CallOpts) (string, error) + + AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) + + ApplyAllowListUpdates(opts *bind.TransactOpts, allowListConfigArgsItems []OnRampAllowListConfigArgs) (*types.Transaction, error) + + ApplyDestChainConfigUpdates(opts *bind.TransactOpts, destChainConfigArgs []OnRampDestChainConfigArgs) (*types.Transaction, error) + + ForwardFromRouter(opts *bind.TransactOpts, destChainSelector uint64, message ClientEVM2AnyMessage, feeTokenAmount *big.Int, originalSender common.Address) (*types.Transaction, error) + + SetDynamicConfig(opts *bind.TransactOpts, dynamicConfig OnRampDynamicConfig) (*types.Transaction, error) + + TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) + + WithdrawFeeTokens(opts *bind.TransactOpts) (*types.Transaction, error) + + FilterAllowListAdminSet(opts *bind.FilterOpts, allowListAdmin []common.Address) (*OnRampAllowListAdminSetIterator, error) + + WatchAllowListAdminSet(opts *bind.WatchOpts, sink chan<- *OnRampAllowListAdminSet, allowListAdmin []common.Address) (event.Subscription, error) + + ParseAllowListAdminSet(log types.Log) (*OnRampAllowListAdminSet, error) + + FilterAllowListSendersAdded(opts *bind.FilterOpts, destChainSelector []uint64) (*OnRampAllowListSendersAddedIterator, error) + + WatchAllowListSendersAdded(opts *bind.WatchOpts, sink chan<- *OnRampAllowListSendersAdded, destChainSelector []uint64) (event.Subscription, error) + + ParseAllowListSendersAdded(log types.Log) (*OnRampAllowListSendersAdded, error) + + FilterAllowListSendersRemoved(opts *bind.FilterOpts, destChainSelector []uint64) (*OnRampAllowListSendersRemovedIterator, error) + + WatchAllowListSendersRemoved(opts *bind.WatchOpts, sink chan<- *OnRampAllowListSendersRemoved, destChainSelector []uint64) (event.Subscription, error) + + ParseAllowListSendersRemoved(log types.Log) (*OnRampAllowListSendersRemoved, error) + + FilterCCIPMessageSent(opts *bind.FilterOpts, destChainSelector []uint64) (*OnRampCCIPMessageSentIterator, error) + + WatchCCIPMessageSent(opts *bind.WatchOpts, sink chan<- *OnRampCCIPMessageSent, destChainSelector []uint64) (event.Subscription, error) + + ParseCCIPMessageSent(log types.Log) (*OnRampCCIPMessageSent, error) + + FilterConfigSet(opts *bind.FilterOpts) (*OnRampConfigSetIterator, error) + + WatchConfigSet(opts *bind.WatchOpts, sink chan<- *OnRampConfigSet) (event.Subscription, error) + + ParseConfigSet(log types.Log) (*OnRampConfigSet, error) + + FilterDestChainConfigSet(opts *bind.FilterOpts, destChainSelector []uint64) (*OnRampDestChainConfigSetIterator, error) + + WatchDestChainConfigSet(opts *bind.WatchOpts, sink chan<- *OnRampDestChainConfigSet, destChainSelector []uint64) (event.Subscription, error) + + ParseDestChainConfigSet(log types.Log) (*OnRampDestChainConfigSet, error) + + FilterFeePaid(opts *bind.FilterOpts, feeToken []common.Address) (*OnRampFeePaidIterator, error) + + WatchFeePaid(opts *bind.WatchOpts, sink chan<- *OnRampFeePaid, feeToken []common.Address) (event.Subscription, error) + + ParseFeePaid(log types.Log) (*OnRampFeePaid, error) + + FilterFeeTokenWithdrawn(opts *bind.FilterOpts, feeAggregator []common.Address, feeToken []common.Address) (*OnRampFeeTokenWithdrawnIterator, error) + + WatchFeeTokenWithdrawn(opts *bind.WatchOpts, sink chan<- *OnRampFeeTokenWithdrawn, feeAggregator []common.Address, feeToken []common.Address) (event.Subscription, error) + + ParseFeeTokenWithdrawn(log types.Log) (*OnRampFeeTokenWithdrawn, error) + + FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*OnRampOwnershipTransferRequestedIterator, error) + + WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *OnRampOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferRequested(log types.Log) (*OnRampOwnershipTransferRequested, error) + + FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*OnRampOwnershipTransferredIterator, error) + + WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *OnRampOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferred(log types.Log) (*OnRampOwnershipTransferred, error) + + ParseLog(log types.Log) (generated.AbigenLog, error) + + Address() common.Address +} diff --git a/core/gethwrappers/ccip/generated/ping_pong_demo/ping_pong_demo.go b/core/gethwrappers/ccip/generated/ping_pong_demo/ping_pong_demo.go new file mode 100644 index 00000000000..08ae9cc0cca --- /dev/null +++ b/core/gethwrappers/ccip/generated/ping_pong_demo/ping_pong_demo.go @@ -0,0 +1,1228 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package ping_pong_demo + +import ( + "errors" + "fmt" + "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" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" +) + +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +type ClientAny2EVMMessage struct { + MessageId [32]byte + SourceChainSelector uint64 + Sender []byte + Data []byte + DestTokenAmounts []ClientEVMTokenAmount +} + +type ClientEVMTokenAmount struct { + Token common.Address + Amount *big.Int +} + +var PingPongDemoMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"router\",\"type\":\"address\"},{\"internalType\":\"contractIERC20\",\"name\":\"feeToken\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"router\",\"type\":\"address\"}],\"name\":\"InvalidRouter\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"isOutOfOrder\",\"type\":\"bool\"}],\"name\":\"OutOfOrderExecutionChange\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"pingPongCount\",\"type\":\"uint256\"}],\"name\":\"Ping\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"pingPongCount\",\"type\":\"uint256\"}],\"name\":\"Pong\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"messageId\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"sender\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"internalType\":\"structClient.EVMTokenAmount[]\",\"name\":\"destTokenAmounts\",\"type\":\"tuple[]\"}],\"internalType\":\"structClient.Any2EVMMessage\",\"name\":\"message\",\"type\":\"tuple\"}],\"name\":\"ccipReceive\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getCounterpartAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getCounterpartChainSelector\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getFeeToken\",\"outputs\":[{\"internalType\":\"contractIERC20\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getOutOfOrderExecution\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRouter\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isPaused\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"counterpartChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"counterpartAddress\",\"type\":\"address\"}],\"name\":\"setCounterpart\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"setCounterpartAddress\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"}],\"name\":\"setCounterpartChainSelector\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bool\",\"name\":\"outOfOrderExecution\",\"type\":\"bool\"}],\"name\":\"setOutOfOrderExecution\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bool\",\"name\":\"pause\",\"type\":\"bool\"}],\"name\":\"setPaused\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"startPingPong\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"pure\",\"type\":\"function\"}]", + Bin: "0x60a06040523480156200001157600080fd5b506040516200159d3803806200159d833981016040819052620000349162000263565b33806000846001600160a01b03811662000069576040516335fdcccd60e21b8152600060048201526024015b60405180910390fd5b6001600160a01b039081166080528216620000c75760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f0000000000000000604482015260640162000060565b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000fa57620000fa816200019f565b50506002805460ff60a01b1916905550600380546001600160a01b0319166001600160a01b0383811691821790925560405163095ea7b360e01b8152918416600483015260001960248301529063095ea7b3906044016020604051808303816000875af115801562000170573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001969190620002a2565b505050620002cd565b336001600160a01b03821603620001f95760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640162000060565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b6001600160a01b03811681146200026057600080fd5b50565b600080604083850312156200027757600080fd5b825162000284816200024a565b602084015190925062000297816200024a565b809150509250929050565b600060208284031215620002b557600080fd5b81518015158114620002c657600080fd5b9392505050565b6080516112a6620002f760003960008181610295015281816106860152610ab901526112a66000f3fe608060405234801561001057600080fd5b50600436106101365760003560e01c80638da5cb5b116100b2578063b187bd2611610081578063bee518a411610066578063bee518a4146102ef578063ca709a251461032d578063f2fde38b1461034b57600080fd5b8063b187bd26146102b9578063b5a11011146102dc57600080fd5b80638da5cb5b1461023f5780639d2aede51461025d578063ae90de5514610270578063b0f479a11461029357600080fd5b80632874d8bf11610109578063665ed537116100ee578063665ed5371461021157806379ba50971461022457806385572ffb1461022c57600080fd5b80632874d8bf146101ca5780632b6e5d63146101d257600080fd5b806301ffc9a71461013b57806316c38b3c14610163578063181f5a77146101785780631892b906146101b7575b600080fd5b61014e610149366004610cba565b61035e565b60405190151581526020015b60405180910390f35b610176610171366004610d03565b6103f7565b005b604080518082018252601281527f50696e67506f6e6744656d6f20312e352e3000000000000000000000000000006020820152905161015a9190610d89565b6101766101c5366004610db9565b610449565b6101766104a4565b60025473ffffffffffffffffffffffffffffffffffffffff165b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161015a565b61017661021f366004610d03565b6104e0565b61017661056c565b61017661023a366004610dd4565b61066e565b60005473ffffffffffffffffffffffffffffffffffffffff166101ec565b61017661026b366004610e33565b6106f3565b60035474010000000000000000000000000000000000000000900460ff1661014e565b7f00000000000000000000000000000000000000000000000000000000000000006101ec565b60025474010000000000000000000000000000000000000000900460ff1661014e565b6101766102ea366004610e4e565b610742565b60015474010000000000000000000000000000000000000000900467ffffffffffffffff1660405167ffffffffffffffff909116815260200161015a565b60035473ffffffffffffffffffffffffffffffffffffffff166101ec565b610176610359366004610e33565b6107e4565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f85572ffb0000000000000000000000000000000000000000000000000000000014806103f157507fffffffff0000000000000000000000000000000000000000000000000000000082167f01ffc9a700000000000000000000000000000000000000000000000000000000145b92915050565b6103ff6107f5565b6002805491151574010000000000000000000000000000000000000000027fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff909216919091179055565b6104516107f5565b6001805467ffffffffffffffff90921674010000000000000000000000000000000000000000027fffffffff0000000000000000ffffffffffffffffffffffffffffffffffffffff909216919091179055565b6104ac6107f5565b600280547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1690556104de6001610876565b565b6104e86107f5565b6003805482151574010000000000000000000000000000000000000000027fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff9091161790556040517f05a3fef9935c9013a24c6193df2240d34fcf6b0ebf8786b85efe8401d696cdd99061056190831515815260200190565b60405180910390a150565b60015473ffffffffffffffffffffffffffffffffffffffff1633146105f2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e65720000000000000000000060448201526064015b60405180910390fd5b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b3373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016146106df576040517fd7f733340000000000000000000000000000000000000000000000000000000081523360048201526024016105e9565b6106f06106eb82611084565b610b6f565b50565b6106fb6107f5565b600280547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b61074a6107f5565b6001805467ffffffffffffffff90931674010000000000000000000000000000000000000000027fffffffff0000000000000000ffffffffffffffffffffffffffffffffffffffff909316929092179091556002805473ffffffffffffffffffffffffffffffffffffffff9092167fffffffffffffffffffffffff0000000000000000000000000000000000000000909216919091179055565b6107ec6107f5565b6106f081610bc5565b60005473ffffffffffffffffffffffffffffffffffffffff1633146104de576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e65720000000000000000000060448201526064016105e9565b806001166001036108b9576040518181527f48257dc961b6f792c2b78a080dacfed693b660960a702de21cee364e20270e2f9060200160405180910390a16108ed565b6040518181527f58b69f57828e6962d216502094c54f6562f3bf082ba758966c3454f9e37b15259060200160405180910390a15b6040805160a0810190915260025473ffffffffffffffffffffffffffffffffffffffff1660c08201526000908060e0810160405160208183030381529060405281526020018360405160200161094591815260200190565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152919052815260200160006040519080825280602002602001820160405280156109bf57816020015b60408051808201909152600080825260208201528152602001906001900390816109985790505b50815260035473ffffffffffffffffffffffffffffffffffffffff811660208084019190915260408051808201825262030d408082527401000000000000000000000000000000000000000090940460ff16151590830190815281516024810194909452511515604480850191909152815180850390910181526064909301815290820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f181dcf1000000000000000000000000000000000000000000000000000000000179052909101526001546040517f96f4e9f90000000000000000000000000000000000000000000000000000000081529192507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16916396f4e9f991610b27917401000000000000000000000000000000000000000090910467ffffffffffffffff16908590600401611131565b6020604051808303816000875af1158015610b46573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b6a9190611246565b505050565b60008160600151806020019051810190610b899190611246565b60025490915074010000000000000000000000000000000000000000900460ff16610bc157610bc1610bbc82600161125f565b610876565b5050565b3373ffffffffffffffffffffffffffffffffffffffff821603610c44576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c6600000000000000000060448201526064016105e9565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b600060208284031215610ccc57600080fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114610cfc57600080fd5b9392505050565b600060208284031215610d1557600080fd5b81358015158114610cfc57600080fd5b6000815180845260005b81811015610d4b57602081850181015186830182015201610d2f565b5060006020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b602081526000610cfc6020830184610d25565b803567ffffffffffffffff81168114610db457600080fd5b919050565b600060208284031215610dcb57600080fd5b610cfc82610d9c565b600060208284031215610de657600080fd5b813567ffffffffffffffff811115610dfd57600080fd5b820160a08185031215610cfc57600080fd5b803573ffffffffffffffffffffffffffffffffffffffff81168114610db457600080fd5b600060208284031215610e4557600080fd5b610cfc82610e0f565b60008060408385031215610e6157600080fd5b610e6a83610d9c565b9150610e7860208401610e0f565b90509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040805190810167ffffffffffffffff81118282101715610ed357610ed3610e81565b60405290565b60405160a0810167ffffffffffffffff81118282101715610ed357610ed3610e81565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715610f4357610f43610e81565b604052919050565b600082601f830112610f5c57600080fd5b813567ffffffffffffffff811115610f7657610f76610e81565b610fa760207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f84011601610efc565b818152846020838601011115610fbc57600080fd5b816020850160208301376000918101602001919091529392505050565b600082601f830112610fea57600080fd5b8135602067ffffffffffffffff82111561100657611006610e81565b611014818360051b01610efc565b82815260069290921b8401810191818101908684111561103357600080fd5b8286015b8481101561107957604081890312156110505760008081fd5b611058610eb0565b61106182610e0f565b81528185013585820152835291830191604001611037565b509695505050505050565b600060a0823603121561109657600080fd5b61109e610ed9565b823581526110ae60208401610d9c565b6020820152604083013567ffffffffffffffff808211156110ce57600080fd5b6110da36838701610f4b565b604084015260608501359150808211156110f357600080fd5b6110ff36838701610f4b565b6060840152608085013591508082111561111857600080fd5b5061112536828601610fd9565b60808301525092915050565b6000604067ffffffffffffffff851683526020604081850152845160a0604086015261116060e0860182610d25565b9050818601517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc08087840301606088015261119b8383610d25565b6040890151888203830160808a01528051808352908601945060009350908501905b808410156111fc578451805173ffffffffffffffffffffffffffffffffffffffff168352860151868301529385019360019390930192908601906111bd565b50606089015173ffffffffffffffffffffffffffffffffffffffff1660a08901526080890151888203830160c08a015295506112388187610d25565b9a9950505050505050505050565b60006020828403121561125857600080fd5b5051919050565b808201808211156103f1577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fdfea164736f6c6343000818000a", +} + +var PingPongDemoABI = PingPongDemoMetaData.ABI + +var PingPongDemoBin = PingPongDemoMetaData.Bin + +func DeployPingPongDemo(auth *bind.TransactOpts, backend bind.ContractBackend, router common.Address, feeToken common.Address) (common.Address, *types.Transaction, *PingPongDemo, error) { + parsed, err := PingPongDemoMetaData.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(PingPongDemoBin), backend, router, feeToken) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &PingPongDemo{address: address, abi: *parsed, PingPongDemoCaller: PingPongDemoCaller{contract: contract}, PingPongDemoTransactor: PingPongDemoTransactor{contract: contract}, PingPongDemoFilterer: PingPongDemoFilterer{contract: contract}}, nil +} + +type PingPongDemo struct { + address common.Address + abi abi.ABI + PingPongDemoCaller + PingPongDemoTransactor + PingPongDemoFilterer +} + +type PingPongDemoCaller struct { + contract *bind.BoundContract +} + +type PingPongDemoTransactor struct { + contract *bind.BoundContract +} + +type PingPongDemoFilterer struct { + contract *bind.BoundContract +} + +type PingPongDemoSession struct { + Contract *PingPongDemo + CallOpts bind.CallOpts + TransactOpts bind.TransactOpts +} + +type PingPongDemoCallerSession struct { + Contract *PingPongDemoCaller + CallOpts bind.CallOpts +} + +type PingPongDemoTransactorSession struct { + Contract *PingPongDemoTransactor + TransactOpts bind.TransactOpts +} + +type PingPongDemoRaw struct { + Contract *PingPongDemo +} + +type PingPongDemoCallerRaw struct { + Contract *PingPongDemoCaller +} + +type PingPongDemoTransactorRaw struct { + Contract *PingPongDemoTransactor +} + +func NewPingPongDemo(address common.Address, backend bind.ContractBackend) (*PingPongDemo, error) { + abi, err := abi.JSON(strings.NewReader(PingPongDemoABI)) + if err != nil { + return nil, err + } + contract, err := bindPingPongDemo(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &PingPongDemo{address: address, abi: abi, PingPongDemoCaller: PingPongDemoCaller{contract: contract}, PingPongDemoTransactor: PingPongDemoTransactor{contract: contract}, PingPongDemoFilterer: PingPongDemoFilterer{contract: contract}}, nil +} + +func NewPingPongDemoCaller(address common.Address, caller bind.ContractCaller) (*PingPongDemoCaller, error) { + contract, err := bindPingPongDemo(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &PingPongDemoCaller{contract: contract}, nil +} + +func NewPingPongDemoTransactor(address common.Address, transactor bind.ContractTransactor) (*PingPongDemoTransactor, error) { + contract, err := bindPingPongDemo(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &PingPongDemoTransactor{contract: contract}, nil +} + +func NewPingPongDemoFilterer(address common.Address, filterer bind.ContractFilterer) (*PingPongDemoFilterer, error) { + contract, err := bindPingPongDemo(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &PingPongDemoFilterer{contract: contract}, nil +} + +func bindPingPongDemo(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := PingPongDemoMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +func (_PingPongDemo *PingPongDemoRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _PingPongDemo.Contract.PingPongDemoCaller.contract.Call(opts, result, method, params...) +} + +func (_PingPongDemo *PingPongDemoRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _PingPongDemo.Contract.PingPongDemoTransactor.contract.Transfer(opts) +} + +func (_PingPongDemo *PingPongDemoRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _PingPongDemo.Contract.PingPongDemoTransactor.contract.Transact(opts, method, params...) +} + +func (_PingPongDemo *PingPongDemoCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _PingPongDemo.Contract.contract.Call(opts, result, method, params...) +} + +func (_PingPongDemo *PingPongDemoTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _PingPongDemo.Contract.contract.Transfer(opts) +} + +func (_PingPongDemo *PingPongDemoTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _PingPongDemo.Contract.contract.Transact(opts, method, params...) +} + +func (_PingPongDemo *PingPongDemoCaller) GetCounterpartAddress(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _PingPongDemo.contract.Call(opts, &out, "getCounterpartAddress") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_PingPongDemo *PingPongDemoSession) GetCounterpartAddress() (common.Address, error) { + return _PingPongDemo.Contract.GetCounterpartAddress(&_PingPongDemo.CallOpts) +} + +func (_PingPongDemo *PingPongDemoCallerSession) GetCounterpartAddress() (common.Address, error) { + return _PingPongDemo.Contract.GetCounterpartAddress(&_PingPongDemo.CallOpts) +} + +func (_PingPongDemo *PingPongDemoCaller) GetCounterpartChainSelector(opts *bind.CallOpts) (uint64, error) { + var out []interface{} + err := _PingPongDemo.contract.Call(opts, &out, "getCounterpartChainSelector") + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +func (_PingPongDemo *PingPongDemoSession) GetCounterpartChainSelector() (uint64, error) { + return _PingPongDemo.Contract.GetCounterpartChainSelector(&_PingPongDemo.CallOpts) +} + +func (_PingPongDemo *PingPongDemoCallerSession) GetCounterpartChainSelector() (uint64, error) { + return _PingPongDemo.Contract.GetCounterpartChainSelector(&_PingPongDemo.CallOpts) +} + +func (_PingPongDemo *PingPongDemoCaller) GetFeeToken(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _PingPongDemo.contract.Call(opts, &out, "getFeeToken") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_PingPongDemo *PingPongDemoSession) GetFeeToken() (common.Address, error) { + return _PingPongDemo.Contract.GetFeeToken(&_PingPongDemo.CallOpts) +} + +func (_PingPongDemo *PingPongDemoCallerSession) GetFeeToken() (common.Address, error) { + return _PingPongDemo.Contract.GetFeeToken(&_PingPongDemo.CallOpts) +} + +func (_PingPongDemo *PingPongDemoCaller) GetOutOfOrderExecution(opts *bind.CallOpts) (bool, error) { + var out []interface{} + err := _PingPongDemo.contract.Call(opts, &out, "getOutOfOrderExecution") + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_PingPongDemo *PingPongDemoSession) GetOutOfOrderExecution() (bool, error) { + return _PingPongDemo.Contract.GetOutOfOrderExecution(&_PingPongDemo.CallOpts) +} + +func (_PingPongDemo *PingPongDemoCallerSession) GetOutOfOrderExecution() (bool, error) { + return _PingPongDemo.Contract.GetOutOfOrderExecution(&_PingPongDemo.CallOpts) +} + +func (_PingPongDemo *PingPongDemoCaller) GetRouter(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _PingPongDemo.contract.Call(opts, &out, "getRouter") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_PingPongDemo *PingPongDemoSession) GetRouter() (common.Address, error) { + return _PingPongDemo.Contract.GetRouter(&_PingPongDemo.CallOpts) +} + +func (_PingPongDemo *PingPongDemoCallerSession) GetRouter() (common.Address, error) { + return _PingPongDemo.Contract.GetRouter(&_PingPongDemo.CallOpts) +} + +func (_PingPongDemo *PingPongDemoCaller) IsPaused(opts *bind.CallOpts) (bool, error) { + var out []interface{} + err := _PingPongDemo.contract.Call(opts, &out, "isPaused") + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_PingPongDemo *PingPongDemoSession) IsPaused() (bool, error) { + return _PingPongDemo.Contract.IsPaused(&_PingPongDemo.CallOpts) +} + +func (_PingPongDemo *PingPongDemoCallerSession) IsPaused() (bool, error) { + return _PingPongDemo.Contract.IsPaused(&_PingPongDemo.CallOpts) +} + +func (_PingPongDemo *PingPongDemoCaller) Owner(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _PingPongDemo.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 + +} + +func (_PingPongDemo *PingPongDemoSession) Owner() (common.Address, error) { + return _PingPongDemo.Contract.Owner(&_PingPongDemo.CallOpts) +} + +func (_PingPongDemo *PingPongDemoCallerSession) Owner() (common.Address, error) { + return _PingPongDemo.Contract.Owner(&_PingPongDemo.CallOpts) +} + +func (_PingPongDemo *PingPongDemoCaller) SupportsInterface(opts *bind.CallOpts, interfaceId [4]byte) (bool, error) { + var out []interface{} + err := _PingPongDemo.contract.Call(opts, &out, "supportsInterface", interfaceId) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_PingPongDemo *PingPongDemoSession) SupportsInterface(interfaceId [4]byte) (bool, error) { + return _PingPongDemo.Contract.SupportsInterface(&_PingPongDemo.CallOpts, interfaceId) +} + +func (_PingPongDemo *PingPongDemoCallerSession) SupportsInterface(interfaceId [4]byte) (bool, error) { + return _PingPongDemo.Contract.SupportsInterface(&_PingPongDemo.CallOpts, interfaceId) +} + +func (_PingPongDemo *PingPongDemoCaller) TypeAndVersion(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _PingPongDemo.contract.Call(opts, &out, "typeAndVersion") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +func (_PingPongDemo *PingPongDemoSession) TypeAndVersion() (string, error) { + return _PingPongDemo.Contract.TypeAndVersion(&_PingPongDemo.CallOpts) +} + +func (_PingPongDemo *PingPongDemoCallerSession) TypeAndVersion() (string, error) { + return _PingPongDemo.Contract.TypeAndVersion(&_PingPongDemo.CallOpts) +} + +func (_PingPongDemo *PingPongDemoTransactor) AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + return _PingPongDemo.contract.Transact(opts, "acceptOwnership") +} + +func (_PingPongDemo *PingPongDemoSession) AcceptOwnership() (*types.Transaction, error) { + return _PingPongDemo.Contract.AcceptOwnership(&_PingPongDemo.TransactOpts) +} + +func (_PingPongDemo *PingPongDemoTransactorSession) AcceptOwnership() (*types.Transaction, error) { + return _PingPongDemo.Contract.AcceptOwnership(&_PingPongDemo.TransactOpts) +} + +func (_PingPongDemo *PingPongDemoTransactor) CcipReceive(opts *bind.TransactOpts, message ClientAny2EVMMessage) (*types.Transaction, error) { + return _PingPongDemo.contract.Transact(opts, "ccipReceive", message) +} + +func (_PingPongDemo *PingPongDemoSession) CcipReceive(message ClientAny2EVMMessage) (*types.Transaction, error) { + return _PingPongDemo.Contract.CcipReceive(&_PingPongDemo.TransactOpts, message) +} + +func (_PingPongDemo *PingPongDemoTransactorSession) CcipReceive(message ClientAny2EVMMessage) (*types.Transaction, error) { + return _PingPongDemo.Contract.CcipReceive(&_PingPongDemo.TransactOpts, message) +} + +func (_PingPongDemo *PingPongDemoTransactor) SetCounterpart(opts *bind.TransactOpts, counterpartChainSelector uint64, counterpartAddress common.Address) (*types.Transaction, error) { + return _PingPongDemo.contract.Transact(opts, "setCounterpart", counterpartChainSelector, counterpartAddress) +} + +func (_PingPongDemo *PingPongDemoSession) SetCounterpart(counterpartChainSelector uint64, counterpartAddress common.Address) (*types.Transaction, error) { + return _PingPongDemo.Contract.SetCounterpart(&_PingPongDemo.TransactOpts, counterpartChainSelector, counterpartAddress) +} + +func (_PingPongDemo *PingPongDemoTransactorSession) SetCounterpart(counterpartChainSelector uint64, counterpartAddress common.Address) (*types.Transaction, error) { + return _PingPongDemo.Contract.SetCounterpart(&_PingPongDemo.TransactOpts, counterpartChainSelector, counterpartAddress) +} + +func (_PingPongDemo *PingPongDemoTransactor) SetCounterpartAddress(opts *bind.TransactOpts, addr common.Address) (*types.Transaction, error) { + return _PingPongDemo.contract.Transact(opts, "setCounterpartAddress", addr) +} + +func (_PingPongDemo *PingPongDemoSession) SetCounterpartAddress(addr common.Address) (*types.Transaction, error) { + return _PingPongDemo.Contract.SetCounterpartAddress(&_PingPongDemo.TransactOpts, addr) +} + +func (_PingPongDemo *PingPongDemoTransactorSession) SetCounterpartAddress(addr common.Address) (*types.Transaction, error) { + return _PingPongDemo.Contract.SetCounterpartAddress(&_PingPongDemo.TransactOpts, addr) +} + +func (_PingPongDemo *PingPongDemoTransactor) SetCounterpartChainSelector(opts *bind.TransactOpts, chainSelector uint64) (*types.Transaction, error) { + return _PingPongDemo.contract.Transact(opts, "setCounterpartChainSelector", chainSelector) +} + +func (_PingPongDemo *PingPongDemoSession) SetCounterpartChainSelector(chainSelector uint64) (*types.Transaction, error) { + return _PingPongDemo.Contract.SetCounterpartChainSelector(&_PingPongDemo.TransactOpts, chainSelector) +} + +func (_PingPongDemo *PingPongDemoTransactorSession) SetCounterpartChainSelector(chainSelector uint64) (*types.Transaction, error) { + return _PingPongDemo.Contract.SetCounterpartChainSelector(&_PingPongDemo.TransactOpts, chainSelector) +} + +func (_PingPongDemo *PingPongDemoTransactor) SetOutOfOrderExecution(opts *bind.TransactOpts, outOfOrderExecution bool) (*types.Transaction, error) { + return _PingPongDemo.contract.Transact(opts, "setOutOfOrderExecution", outOfOrderExecution) +} + +func (_PingPongDemo *PingPongDemoSession) SetOutOfOrderExecution(outOfOrderExecution bool) (*types.Transaction, error) { + return _PingPongDemo.Contract.SetOutOfOrderExecution(&_PingPongDemo.TransactOpts, outOfOrderExecution) +} + +func (_PingPongDemo *PingPongDemoTransactorSession) SetOutOfOrderExecution(outOfOrderExecution bool) (*types.Transaction, error) { + return _PingPongDemo.Contract.SetOutOfOrderExecution(&_PingPongDemo.TransactOpts, outOfOrderExecution) +} + +func (_PingPongDemo *PingPongDemoTransactor) SetPaused(opts *bind.TransactOpts, pause bool) (*types.Transaction, error) { + return _PingPongDemo.contract.Transact(opts, "setPaused", pause) +} + +func (_PingPongDemo *PingPongDemoSession) SetPaused(pause bool) (*types.Transaction, error) { + return _PingPongDemo.Contract.SetPaused(&_PingPongDemo.TransactOpts, pause) +} + +func (_PingPongDemo *PingPongDemoTransactorSession) SetPaused(pause bool) (*types.Transaction, error) { + return _PingPongDemo.Contract.SetPaused(&_PingPongDemo.TransactOpts, pause) +} + +func (_PingPongDemo *PingPongDemoTransactor) StartPingPong(opts *bind.TransactOpts) (*types.Transaction, error) { + return _PingPongDemo.contract.Transact(opts, "startPingPong") +} + +func (_PingPongDemo *PingPongDemoSession) StartPingPong() (*types.Transaction, error) { + return _PingPongDemo.Contract.StartPingPong(&_PingPongDemo.TransactOpts) +} + +func (_PingPongDemo *PingPongDemoTransactorSession) StartPingPong() (*types.Transaction, error) { + return _PingPongDemo.Contract.StartPingPong(&_PingPongDemo.TransactOpts) +} + +func (_PingPongDemo *PingPongDemoTransactor) TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) { + return _PingPongDemo.contract.Transact(opts, "transferOwnership", to) +} + +func (_PingPongDemo *PingPongDemoSession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _PingPongDemo.Contract.TransferOwnership(&_PingPongDemo.TransactOpts, to) +} + +func (_PingPongDemo *PingPongDemoTransactorSession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _PingPongDemo.Contract.TransferOwnership(&_PingPongDemo.TransactOpts, to) +} + +type PingPongDemoOutOfOrderExecutionChangeIterator struct { + Event *PingPongDemoOutOfOrderExecutionChange + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *PingPongDemoOutOfOrderExecutionChangeIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(PingPongDemoOutOfOrderExecutionChange) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(PingPongDemoOutOfOrderExecutionChange) + 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() + } +} + +func (it *PingPongDemoOutOfOrderExecutionChangeIterator) Error() error { + return it.fail +} + +func (it *PingPongDemoOutOfOrderExecutionChangeIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type PingPongDemoOutOfOrderExecutionChange struct { + IsOutOfOrder bool + Raw types.Log +} + +func (_PingPongDemo *PingPongDemoFilterer) FilterOutOfOrderExecutionChange(opts *bind.FilterOpts) (*PingPongDemoOutOfOrderExecutionChangeIterator, error) { + + logs, sub, err := _PingPongDemo.contract.FilterLogs(opts, "OutOfOrderExecutionChange") + if err != nil { + return nil, err + } + return &PingPongDemoOutOfOrderExecutionChangeIterator{contract: _PingPongDemo.contract, event: "OutOfOrderExecutionChange", logs: logs, sub: sub}, nil +} + +func (_PingPongDemo *PingPongDemoFilterer) WatchOutOfOrderExecutionChange(opts *bind.WatchOpts, sink chan<- *PingPongDemoOutOfOrderExecutionChange) (event.Subscription, error) { + + logs, sub, err := _PingPongDemo.contract.WatchLogs(opts, "OutOfOrderExecutionChange") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(PingPongDemoOutOfOrderExecutionChange) + if err := _PingPongDemo.contract.UnpackLog(event, "OutOfOrderExecutionChange", 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 +} + +func (_PingPongDemo *PingPongDemoFilterer) ParseOutOfOrderExecutionChange(log types.Log) (*PingPongDemoOutOfOrderExecutionChange, error) { + event := new(PingPongDemoOutOfOrderExecutionChange) + if err := _PingPongDemo.contract.UnpackLog(event, "OutOfOrderExecutionChange", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type PingPongDemoOwnershipTransferRequestedIterator struct { + Event *PingPongDemoOwnershipTransferRequested + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *PingPongDemoOwnershipTransferRequestedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(PingPongDemoOwnershipTransferRequested) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(PingPongDemoOwnershipTransferRequested) + 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() + } +} + +func (it *PingPongDemoOwnershipTransferRequestedIterator) Error() error { + return it.fail +} + +func (it *PingPongDemoOwnershipTransferRequestedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type PingPongDemoOwnershipTransferRequested struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_PingPongDemo *PingPongDemoFilterer) FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*PingPongDemoOwnershipTransferRequestedIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _PingPongDemo.contract.FilterLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return &PingPongDemoOwnershipTransferRequestedIterator{contract: _PingPongDemo.contract, event: "OwnershipTransferRequested", logs: logs, sub: sub}, nil +} + +func (_PingPongDemo *PingPongDemoFilterer) WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *PingPongDemoOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _PingPongDemo.contract.WatchLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(PingPongDemoOwnershipTransferRequested) + if err := _PingPongDemo.contract.UnpackLog(event, "OwnershipTransferRequested", 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 +} + +func (_PingPongDemo *PingPongDemoFilterer) ParseOwnershipTransferRequested(log types.Log) (*PingPongDemoOwnershipTransferRequested, error) { + event := new(PingPongDemoOwnershipTransferRequested) + if err := _PingPongDemo.contract.UnpackLog(event, "OwnershipTransferRequested", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type PingPongDemoOwnershipTransferredIterator struct { + Event *PingPongDemoOwnershipTransferred + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *PingPongDemoOwnershipTransferredIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(PingPongDemoOwnershipTransferred) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(PingPongDemoOwnershipTransferred) + 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() + } +} + +func (it *PingPongDemoOwnershipTransferredIterator) Error() error { + return it.fail +} + +func (it *PingPongDemoOwnershipTransferredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type PingPongDemoOwnershipTransferred struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_PingPongDemo *PingPongDemoFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*PingPongDemoOwnershipTransferredIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _PingPongDemo.contract.FilterLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return &PingPongDemoOwnershipTransferredIterator{contract: _PingPongDemo.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil +} + +func (_PingPongDemo *PingPongDemoFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *PingPongDemoOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _PingPongDemo.contract.WatchLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(PingPongDemoOwnershipTransferred) + if err := _PingPongDemo.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 +} + +func (_PingPongDemo *PingPongDemoFilterer) ParseOwnershipTransferred(log types.Log) (*PingPongDemoOwnershipTransferred, error) { + event := new(PingPongDemoOwnershipTransferred) + if err := _PingPongDemo.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type PingPongDemoPingIterator struct { + Event *PingPongDemoPing + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *PingPongDemoPingIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(PingPongDemoPing) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(PingPongDemoPing) + 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() + } +} + +func (it *PingPongDemoPingIterator) Error() error { + return it.fail +} + +func (it *PingPongDemoPingIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type PingPongDemoPing struct { + PingPongCount *big.Int + Raw types.Log +} + +func (_PingPongDemo *PingPongDemoFilterer) FilterPing(opts *bind.FilterOpts) (*PingPongDemoPingIterator, error) { + + logs, sub, err := _PingPongDemo.contract.FilterLogs(opts, "Ping") + if err != nil { + return nil, err + } + return &PingPongDemoPingIterator{contract: _PingPongDemo.contract, event: "Ping", logs: logs, sub: sub}, nil +} + +func (_PingPongDemo *PingPongDemoFilterer) WatchPing(opts *bind.WatchOpts, sink chan<- *PingPongDemoPing) (event.Subscription, error) { + + logs, sub, err := _PingPongDemo.contract.WatchLogs(opts, "Ping") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(PingPongDemoPing) + if err := _PingPongDemo.contract.UnpackLog(event, "Ping", 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 +} + +func (_PingPongDemo *PingPongDemoFilterer) ParsePing(log types.Log) (*PingPongDemoPing, error) { + event := new(PingPongDemoPing) + if err := _PingPongDemo.contract.UnpackLog(event, "Ping", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type PingPongDemoPongIterator struct { + Event *PingPongDemoPong + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *PingPongDemoPongIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(PingPongDemoPong) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(PingPongDemoPong) + 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() + } +} + +func (it *PingPongDemoPongIterator) Error() error { + return it.fail +} + +func (it *PingPongDemoPongIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type PingPongDemoPong struct { + PingPongCount *big.Int + Raw types.Log +} + +func (_PingPongDemo *PingPongDemoFilterer) FilterPong(opts *bind.FilterOpts) (*PingPongDemoPongIterator, error) { + + logs, sub, err := _PingPongDemo.contract.FilterLogs(opts, "Pong") + if err != nil { + return nil, err + } + return &PingPongDemoPongIterator{contract: _PingPongDemo.contract, event: "Pong", logs: logs, sub: sub}, nil +} + +func (_PingPongDemo *PingPongDemoFilterer) WatchPong(opts *bind.WatchOpts, sink chan<- *PingPongDemoPong) (event.Subscription, error) { + + logs, sub, err := _PingPongDemo.contract.WatchLogs(opts, "Pong") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(PingPongDemoPong) + if err := _PingPongDemo.contract.UnpackLog(event, "Pong", 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 +} + +func (_PingPongDemo *PingPongDemoFilterer) ParsePong(log types.Log) (*PingPongDemoPong, error) { + event := new(PingPongDemoPong) + if err := _PingPongDemo.contract.UnpackLog(event, "Pong", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +func (_PingPongDemo *PingPongDemo) ParseLog(log types.Log) (generated.AbigenLog, error) { + switch log.Topics[0] { + case _PingPongDemo.abi.Events["OutOfOrderExecutionChange"].ID: + return _PingPongDemo.ParseOutOfOrderExecutionChange(log) + case _PingPongDemo.abi.Events["OwnershipTransferRequested"].ID: + return _PingPongDemo.ParseOwnershipTransferRequested(log) + case _PingPongDemo.abi.Events["OwnershipTransferred"].ID: + return _PingPongDemo.ParseOwnershipTransferred(log) + case _PingPongDemo.abi.Events["Ping"].ID: + return _PingPongDemo.ParsePing(log) + case _PingPongDemo.abi.Events["Pong"].ID: + return _PingPongDemo.ParsePong(log) + + default: + return nil, fmt.Errorf("abigen wrapper received unknown log topic: %v", log.Topics[0]) + } +} + +func (PingPongDemoOutOfOrderExecutionChange) Topic() common.Hash { + return common.HexToHash("0x05a3fef9935c9013a24c6193df2240d34fcf6b0ebf8786b85efe8401d696cdd9") +} + +func (PingPongDemoOwnershipTransferRequested) Topic() common.Hash { + return common.HexToHash("0xed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae1278") +} + +func (PingPongDemoOwnershipTransferred) Topic() common.Hash { + return common.HexToHash("0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0") +} + +func (PingPongDemoPing) Topic() common.Hash { + return common.HexToHash("0x48257dc961b6f792c2b78a080dacfed693b660960a702de21cee364e20270e2f") +} + +func (PingPongDemoPong) Topic() common.Hash { + return common.HexToHash("0x58b69f57828e6962d216502094c54f6562f3bf082ba758966c3454f9e37b1525") +} + +func (_PingPongDemo *PingPongDemo) Address() common.Address { + return _PingPongDemo.address +} + +type PingPongDemoInterface interface { + GetCounterpartAddress(opts *bind.CallOpts) (common.Address, error) + + GetCounterpartChainSelector(opts *bind.CallOpts) (uint64, error) + + GetFeeToken(opts *bind.CallOpts) (common.Address, error) + + GetOutOfOrderExecution(opts *bind.CallOpts) (bool, error) + + GetRouter(opts *bind.CallOpts) (common.Address, error) + + IsPaused(opts *bind.CallOpts) (bool, error) + + Owner(opts *bind.CallOpts) (common.Address, error) + + SupportsInterface(opts *bind.CallOpts, interfaceId [4]byte) (bool, error) + + TypeAndVersion(opts *bind.CallOpts) (string, error) + + AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) + + CcipReceive(opts *bind.TransactOpts, message ClientAny2EVMMessage) (*types.Transaction, error) + + SetCounterpart(opts *bind.TransactOpts, counterpartChainSelector uint64, counterpartAddress common.Address) (*types.Transaction, error) + + SetCounterpartAddress(opts *bind.TransactOpts, addr common.Address) (*types.Transaction, error) + + SetCounterpartChainSelector(opts *bind.TransactOpts, chainSelector uint64) (*types.Transaction, error) + + SetOutOfOrderExecution(opts *bind.TransactOpts, outOfOrderExecution bool) (*types.Transaction, error) + + SetPaused(opts *bind.TransactOpts, pause bool) (*types.Transaction, error) + + StartPingPong(opts *bind.TransactOpts) (*types.Transaction, error) + + TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) + + FilterOutOfOrderExecutionChange(opts *bind.FilterOpts) (*PingPongDemoOutOfOrderExecutionChangeIterator, error) + + WatchOutOfOrderExecutionChange(opts *bind.WatchOpts, sink chan<- *PingPongDemoOutOfOrderExecutionChange) (event.Subscription, error) + + ParseOutOfOrderExecutionChange(log types.Log) (*PingPongDemoOutOfOrderExecutionChange, error) + + FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*PingPongDemoOwnershipTransferRequestedIterator, error) + + WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *PingPongDemoOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferRequested(log types.Log) (*PingPongDemoOwnershipTransferRequested, error) + + FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*PingPongDemoOwnershipTransferredIterator, error) + + WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *PingPongDemoOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferred(log types.Log) (*PingPongDemoOwnershipTransferred, error) + + FilterPing(opts *bind.FilterOpts) (*PingPongDemoPingIterator, error) + + WatchPing(opts *bind.WatchOpts, sink chan<- *PingPongDemoPing) (event.Subscription, error) + + ParsePing(log types.Log) (*PingPongDemoPing, error) + + FilterPong(opts *bind.FilterOpts) (*PingPongDemoPongIterator, error) + + WatchPong(opts *bind.WatchOpts, sink chan<- *PingPongDemoPong) (event.Subscription, error) + + ParsePong(log types.Log) (*PingPongDemoPong, error) + + ParseLog(log types.Log) (generated.AbigenLog, error) + + Address() common.Address +} diff --git a/core/gethwrappers/ccip/generated/price_registry_1_0_0/price_registry.go b/core/gethwrappers/ccip/generated/price_registry_1_0_0/price_registry.go new file mode 100644 index 00000000000..212d01aee44 --- /dev/null +++ b/core/gethwrappers/ccip/generated/price_registry_1_0_0/price_registry.go @@ -0,0 +1,1665 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package price_registry_1_0_0 + +import ( + "errors" + "fmt" + "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" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" +) + +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +type InternalPriceUpdates struct { + TokenPriceUpdates []InternalTokenPriceUpdate + DestChainSelector uint64 + UsdPerUnitGas *big.Int +} + +type InternalTimestampedUint192Value struct { + Value *big.Int + Timestamp uint64 +} + +type InternalTokenPriceUpdate struct { + SourceToken common.Address + UsdPerToken *big.Int +} + +var PriceRegistryMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"priceUpdaters\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"feeTokens\",\"type\":\"address[]\"},{\"internalType\":\"uint32\",\"name\":\"stalenessThreshold\",\"type\":\"uint32\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"chain\",\"type\":\"uint64\"}],\"name\":\"ChainNotSupported\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidStalenessThreshold\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCallableByUpdaterOrOwner\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint256\",\"name\":\"threshold\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"timePassed\",\"type\":\"uint256\"}],\"name\":\"StaleGasPrice\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"threshold\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"timePassed\",\"type\":\"uint256\"}],\"name\":\"StaleTokenPrice\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"TokenNotSupported\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"feeToken\",\"type\":\"address\"}],\"name\":\"FeeTokenAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"feeToken\",\"type\":\"address\"}],\"name\":\"FeeTokenRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"priceUpdater\",\"type\":\"address\"}],\"name\":\"PriceUpdaterRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"priceUpdater\",\"type\":\"address\"}],\"name\":\"PriceUpdaterSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"name\":\"UsdPerTokenUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"destChain\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"name\":\"UsdPerUnitGasUpdated\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"feeTokensToAdd\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"feeTokensToRemove\",\"type\":\"address[]\"}],\"name\":\"applyFeeTokensUpdates\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"priceUpdatersToAdd\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"priceUpdatersToRemove\",\"type\":\"address[]\"}],\"name\":\"applyPriceUpdatersUpdates\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"fromToken\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"fromTokenAmount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"toToken\",\"type\":\"address\"}],\"name\":\"convertTokenAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"}],\"name\":\"getDestinationChainGasPrice\",\"outputs\":[{\"components\":[{\"internalType\":\"uint192\",\"name\":\"value\",\"type\":\"uint192\"},{\"internalType\":\"uint64\",\"name\":\"timestamp\",\"type\":\"uint64\"}],\"internalType\":\"structInternal.TimestampedUint192Value\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getFeeTokens\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getPriceUpdaters\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getStalenessThreshold\",\"outputs\":[{\"internalType\":\"uint128\",\"name\":\"\",\"type\":\"uint128\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"}],\"name\":\"getTokenAndGasPrices\",\"outputs\":[{\"internalType\":\"uint192\",\"name\":\"tokenPrice\",\"type\":\"uint192\"},{\"internalType\":\"uint192\",\"name\":\"gasPriceValue\",\"type\":\"uint192\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"getTokenPrice\",\"outputs\":[{\"components\":[{\"internalType\":\"uint192\",\"name\":\"value\",\"type\":\"uint192\"},{\"internalType\":\"uint64\",\"name\":\"timestamp\",\"type\":\"uint64\"}],\"internalType\":\"structInternal.TimestampedUint192Value\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"tokens\",\"type\":\"address[]\"}],\"name\":\"getTokenPrices\",\"outputs\":[{\"components\":[{\"internalType\":\"uint192\",\"name\":\"value\",\"type\":\"uint192\"},{\"internalType\":\"uint64\",\"name\":\"timestamp\",\"type\":\"uint64\"}],\"internalType\":\"structInternal.TimestampedUint192Value[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"getValidatedTokenPrice\",\"outputs\":[{\"internalType\":\"uint192\",\"name\":\"\",\"type\":\"uint192\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"sourceToken\",\"type\":\"address\"},{\"internalType\":\"uint192\",\"name\":\"usdPerToken\",\"type\":\"uint192\"}],\"internalType\":\"structInternal.TokenPriceUpdate[]\",\"name\":\"tokenPriceUpdates\",\"type\":\"tuple[]\"},{\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint192\",\"name\":\"usdPerUnitGas\",\"type\":\"uint192\"}],\"internalType\":\"structInternal.PriceUpdates\",\"name\":\"priceUpdates\",\"type\":\"tuple\"}],\"name\":\"updatePrices\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", + Bin: "0x60a06040523480156200001157600080fd5b506040516200217d3803806200217d8339810160408190526200003491620006fe565b33806000816200008b5760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000be57620000be8162000133565b5050604080516000815260208101909152620000dd91508490620001de565b604080516000815260208101909152620000f99083906200033a565b8063ffffffff166000036200012157604051631151410960e11b815260040160405180910390fd5b63ffffffff1660805250620007fa9050565b336001600160a01b038216036200018d5760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640162000082565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b60005b825181101562000289576200021d83828151811062000204576200020462000786565b602002602001015160046200049160201b90919060201c565b15620002765782818151811062000238576200023862000786565b60200260200101516001600160a01b03167f34a02290b7920078c19f58e94b78c77eb9cc10195b20676e19bd3b82085893b860405160405180910390a25b6200028181620007b2565b9050620001e1565b5060005b81518110156200033557620002c9828281518110620002b057620002b062000786565b60200260200101516004620004b160201b90919060201c565b156200032257818181518110620002e457620002e462000786565b60200260200101516001600160a01b03167fff7dbb85c77ca68ca1f894d6498570e3d5095cd19466f07ee8d222b337e4068c60405160405180910390a25b6200032d81620007b2565b90506200028d565b505050565b60005b8251811015620003e5576200037983828151811062000360576200036062000786565b602002602001015160066200049160201b90919060201c565b15620003d25782818151811062000394576200039462000786565b60200260200101516001600160a01b03167fdf1b1bd32a69711488d71554706bb130b1fc63a5fa1a2cd85e8440f84065ba2360405160405180910390a25b620003dd81620007b2565b90506200033d565b5060005b81518110156200033557620004258282815181106200040c576200040c62000786565b60200260200101516006620004b160201b90919060201c565b156200047e5781818151811062000440576200044062000786565b60200260200101516001600160a01b03167f1795838dc8ab2ffc5f431a1729a6afa0b587f982f7b2be0b9d7187a1ef547f9160405160405180910390a25b6200048981620007b2565b9050620003e9565b6000620004a8836001600160a01b038416620004c8565b90505b92915050565b6000620004a8836001600160a01b0384166200051a565b60008181526001830160205260408120546200051157508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155620004ab565b506000620004ab565b600081815260018301602052604081205480156200061357600062000541600183620007ce565b85549091506000906200055790600190620007ce565b9050818114620005c35760008660000182815481106200057b576200057b62000786565b9060005260206000200154905080876000018481548110620005a157620005a162000786565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080620005d757620005d7620007e4565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050620004ab565b6000915050620004ab565b634e487b7160e01b600052604160045260246000fd5b80516001600160a01b03811681146200064c57600080fd5b919050565b600082601f8301126200066357600080fd5b815160206001600160401b03808311156200068257620006826200061e565b8260051b604051601f19603f83011681018181108482111715620006aa57620006aa6200061e565b604052938452858101830193838101925087851115620006c957600080fd5b83870191505b84821015620006f357620006e38262000634565b83529183019190830190620006cf565b979650505050505050565b6000806000606084860312156200071457600080fd5b83516001600160401b03808211156200072c57600080fd5b6200073a8783880162000651565b945060208601519150808211156200075157600080fd5b50620007608682870162000651565b925050604084015163ffffffff811681146200077b57600080fd5b809150509250925092565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201620007c757620007c76200079c565b5060010190565b81810381811115620004ab57620004ab6200079c565b634e487b7160e01b600052603160045260246000fd5b60805161194b620008326000396000818161028501528181610a5201528181610abb01528181610c180152610c8d015261194b6000f3fe608060405234801561001057600080fd5b50600436106100f45760003560e01c8063866548c911610097578063cdc73d5111610066578063cdc73d51146102c4578063d02641a0146102cc578063f2fde38b1461036a578063ffdb4b371461037d57600080fd5b8063866548c9146102405780638da5cb5b14610253578063a6c94a731461027b578063bfcd4566146102af57600080fd5b8063514e8cff116100d3578063514e8cff1461017b57806352877af01461021057806379ba5097146102255780637afac3221461022d57600080fd5b806241e5be146100f957806345ac924d1461011f5780634ab35b0b1461013f575b600080fd5b61010c61010736600461133e565b6103c1565b6040519081526020015b60405180910390f35b61013261012d36600461137a565b610425565b60405161011691906113ef565b61015261014d36600461146a565b6104f9565b60405177ffffffffffffffffffffffffffffffffffffffffffffffff9091168152602001610116565b61020361018936600461149d565b6040805180820182526000808252602091820181905267ffffffffffffffff93841681526002825282902082518084019093525477ffffffffffffffffffffffffffffffffffffffffffffffff81168352780100000000000000000000000000000000000000000000000090049092169181019190915290565b60405161011691906114b8565b61022361021e3660046115e2565b610504565b005b61022361051a565b61022361023b3660046115e2565b61061c565b61022361024e366004611646565b61062e565b60005460405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610116565b60405163ffffffff7f0000000000000000000000000000000000000000000000000000000000000000168152602001610116565b6102b7610951565b6040516101169190611681565b6102b7610962565b6102036102da36600461146a565b60408051808201909152600080825260208201525073ffffffffffffffffffffffffffffffffffffffff1660009081526003602090815260409182902082518084019093525477ffffffffffffffffffffffffffffffffffffffffffffffff811683527801000000000000000000000000000000000000000000000000900467ffffffffffffffff169082015290565b61022361037836600461146a565b61096e565b61039061038b3660046116db565b610982565b6040805177ffffffffffffffffffffffffffffffffffffffffffffffff938416815292909116602083015201610116565b60006103cc82610b09565b77ffffffffffffffffffffffffffffffffffffffffffffffff166103ef85610b09565b6104139077ffffffffffffffffffffffffffffffffffffffffffffffff168561173d565b61041d9190611754565b949350505050565b60608160008167ffffffffffffffff811115610443576104436114f3565b60405190808252806020026020018201604052801561048857816020015b60408051808201909152600080825260208201528152602001906001900390816104615790505b50905060005b828110156104ee576104c08686838181106104ab576104ab61178f565b90506020020160208101906102da919061146a565b8282815181106104d2576104d261178f565b6020026020010181905250806104e7906117be565b905061048e565b509150505b92915050565b60006104f382610b09565b61050c610cc9565b6105168282610d4c565b5050565b60015473ffffffffffffffffffffffffffffffffffffffff1633146105a0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e65720000000000000000000060448201526064015b60405180910390fd5b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b610624610cc9565b6105168282610ea8565b60005473ffffffffffffffffffffffffffffffffffffffff16331480159061065e575061065c600433610fff565b155b15610695576040517f46f0815400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006106a182806117f6565b9050905060005b818110156107eb5760006106bc84806117f6565b838181106106cc576106cc61178f565b9050604002018036038101906106e29190611886565b6040805180820182526020808401805177ffffffffffffffffffffffffffffffffffffffffffffffff908116845267ffffffffffffffff42818116858701908152885173ffffffffffffffffffffffffffffffffffffffff908116600090815260039097529588902096519051909216780100000000000000000000000000000000000000000000000002919092161790935584519051935194955016927f52f50aa6d1a95a4595361ecf953d095f125d442e4673716dede699e049de148a926107d292909177ffffffffffffffffffffffffffffffffffffffffffffffff929092168252602082015260400190565b60405180910390a2506107e4816117be565b90506106a8565b506107fc604083016020840161149d565b67ffffffffffffffff161561051657604051806040016040528083604001602081019061082991906118e1565b77ffffffffffffffffffffffffffffffffffffffffffffffff1681526020014267ffffffffffffffff168152506002600084602001602081019061086d919061149d565b67ffffffffffffffff9081168252602080830193909352604091820160002084519484015190911678010000000000000000000000000000000000000000000000000277ffffffffffffffffffffffffffffffffffffffffffffffff909416939093179092556108e191840190840161149d565b67ffffffffffffffff167fdd84a3fa9ef9409f550d54d6affec7e9c480c878c6ab27b78912a03e1b371c6e61091c60608501604086016118e1565b6040805177ffffffffffffffffffffffffffffffffffffffffffffffff90921682524260208301520160405180910390a25050565b606061095d6004611031565b905090565b606061095d6006611031565b610976610cc9565b61097f8161103e565b50565b67ffffffffffffffff808216600090815260026020908152604080832081518083019092525477ffffffffffffffffffffffffffffffffffffffffffffffff8116825278010000000000000000000000000000000000000000000000009004909316908301819052909182918203610a32576040517f2e59db3a00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff85166004820152602401610597565b6000816020015167ffffffffffffffff1642610a4e91906118fc565b90507f000000000000000000000000000000000000000000000000000000000000000063ffffffff16811115610aef576040517ff08bcb3e00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff8616600482015263ffffffff7f000000000000000000000000000000000000000000000000000000000000000016602482015260448101829052606401610597565b610af886610b09565b9151919350909150505b9250929050565b73ffffffffffffffffffffffffffffffffffffffff8116600090815260036020908152604080832081518083019092525477ffffffffffffffffffffffffffffffffffffffffffffffff811682527801000000000000000000000000000000000000000000000000900467ffffffffffffffff16918101829052901580610ba95750805177ffffffffffffffffffffffffffffffffffffffffffffffff16155b15610bf8576040517f06439c6b00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff84166004820152602401610597565b6000816020015167ffffffffffffffff1642610c1491906118fc565b90507f000000000000000000000000000000000000000000000000000000000000000063ffffffff16811115610cc1576040517fc65fdfca00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8516600482015263ffffffff7f000000000000000000000000000000000000000000000000000000000000000016602482015260448101829052606401610597565b505192915050565b60005473ffffffffffffffffffffffffffffffffffffffff163314610d4a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e6572000000000000000000006044820152606401610597565b565b60005b8251811015610df757610d85838281518110610d6d57610d6d61178f565b6020026020010151600461113390919063ffffffff16565b15610de757828181518110610d9c57610d9c61178f565b602002602001015173ffffffffffffffffffffffffffffffffffffffff167f34a02290b7920078c19f58e94b78c77eb9cc10195b20676e19bd3b82085893b860405160405180910390a25b610df0816117be565b9050610d4f565b5060005b8151811015610ea357610e31828281518110610e1957610e1961178f565b6020026020010151600461115590919063ffffffff16565b15610e9357818181518110610e4857610e4861178f565b602002602001015173ffffffffffffffffffffffffffffffffffffffff167fff7dbb85c77ca68ca1f894d6498570e3d5095cd19466f07ee8d222b337e4068c60405160405180910390a25b610e9c816117be565b9050610dfb565b505050565b60005b8251811015610f5357610ee1838281518110610ec957610ec961178f565b6020026020010151600661113390919063ffffffff16565b15610f4357828181518110610ef857610ef861178f565b602002602001015173ffffffffffffffffffffffffffffffffffffffff167fdf1b1bd32a69711488d71554706bb130b1fc63a5fa1a2cd85e8440f84065ba2360405160405180910390a25b610f4c816117be565b9050610eab565b5060005b8151811015610ea357610f8d828281518110610f7557610f7561178f565b6020026020010151600661115590919063ffffffff16565b15610fef57818181518110610fa457610fa461178f565b602002602001015173ffffffffffffffffffffffffffffffffffffffff167f1795838dc8ab2ffc5f431a1729a6afa0b587f982f7b2be0b9d7187a1ef547f9160405160405180910390a25b610ff8816117be565b9050610f57565b73ffffffffffffffffffffffffffffffffffffffff8116600090815260018301602052604081205415155b9392505050565b6060600061102a83611177565b3373ffffffffffffffffffffffffffffffffffffffff8216036110bd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c660000000000000000006044820152606401610597565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b600061102a8373ffffffffffffffffffffffffffffffffffffffff84166111d3565b600061102a8373ffffffffffffffffffffffffffffffffffffffff8416611222565b6060816000018054806020026020016040519081016040528092919081815260200182805480156111c757602002820191906000526020600020905b8154815260200190600101908083116111b3575b50505050509050919050565b600081815260018301602052604081205461121a575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556104f3565b5060006104f3565b6000818152600183016020526040812054801561130b5760006112466001836118fc565b855490915060009061125a906001906118fc565b90508181146112bf57600086600001828154811061127a5761127a61178f565b906000526020600020015490508087600001848154811061129d5761129d61178f565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806112d0576112d061190f565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506104f3565b60009150506104f3565b803573ffffffffffffffffffffffffffffffffffffffff8116811461133957600080fd5b919050565b60008060006060848603121561135357600080fd5b61135c84611315565b92506020840135915061137160408501611315565b90509250925092565b6000806020838503121561138d57600080fd5b823567ffffffffffffffff808211156113a557600080fd5b818501915085601f8301126113b957600080fd5b8135818111156113c857600080fd5b8660208260051b85010111156113dd57600080fd5b60209290920196919550909350505050565b602080825282518282018190526000919060409081850190868401855b8281101561145d5761144d848351805177ffffffffffffffffffffffffffffffffffffffffffffffff16825260209081015167ffffffffffffffff16910152565b928401929085019060010161140c565b5091979650505050505050565b60006020828403121561147c57600080fd5b61102a82611315565b803567ffffffffffffffff8116811461133957600080fd5b6000602082840312156114af57600080fd5b61102a82611485565b815177ffffffffffffffffffffffffffffffffffffffffffffffff16815260208083015167ffffffffffffffff1690820152604081016104f3565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600082601f83011261153357600080fd5b8135602067ffffffffffffffff80831115611550576115506114f3565b8260051b6040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0603f83011681018181108482111715611593576115936114f3565b6040529384528581018301938381019250878511156115b157600080fd5b83870191505b848210156115d7576115c882611315565b835291830191908301906115b7565b979650505050505050565b600080604083850312156115f557600080fd5b823567ffffffffffffffff8082111561160d57600080fd5b61161986838701611522565b9350602085013591508082111561162f57600080fd5b5061163c85828601611522565b9150509250929050565b60006020828403121561165857600080fd5b813567ffffffffffffffff81111561166f57600080fd5b82016060818503121561102a57600080fd5b6020808252825182820181905260009190848201906040850190845b818110156116cf57835173ffffffffffffffffffffffffffffffffffffffff168352928401929184019160010161169d565b50909695505050505050565b600080604083850312156116ee57600080fd5b6116f783611315565b915061170560208401611485565b90509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b80820281158282048414176104f3576104f361170e565b60008261178a577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036117ef576117ef61170e565b5060010190565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe184360301811261182b57600080fd5b83018035915067ffffffffffffffff82111561184657600080fd5b6020019150600681901b3603821315610b0257600080fd5b803577ffffffffffffffffffffffffffffffffffffffffffffffff8116811461133957600080fd5b60006040828403121561189857600080fd5b6040516040810181811067ffffffffffffffff821117156118bb576118bb6114f3565b6040526118c783611315565b81526118d56020840161185e565b60208201529392505050565b6000602082840312156118f357600080fd5b61102a8261185e565b818103818111156104f3576104f361170e565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fdfea164736f6c6343000813000a", +} + +var PriceRegistryABI = PriceRegistryMetaData.ABI + +var PriceRegistryBin = PriceRegistryMetaData.Bin + +func DeployPriceRegistry(auth *bind.TransactOpts, backend bind.ContractBackend, priceUpdaters []common.Address, feeTokens []common.Address, stalenessThreshold uint32) (common.Address, *types.Transaction, *PriceRegistry, error) { + parsed, err := PriceRegistryMetaData.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(PriceRegistryBin), backend, priceUpdaters, feeTokens, stalenessThreshold) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &PriceRegistry{PriceRegistryCaller: PriceRegistryCaller{contract: contract}, PriceRegistryTransactor: PriceRegistryTransactor{contract: contract}, PriceRegistryFilterer: PriceRegistryFilterer{contract: contract}}, nil +} + +type PriceRegistry struct { + address common.Address + abi abi.ABI + PriceRegistryCaller + PriceRegistryTransactor + PriceRegistryFilterer +} + +type PriceRegistryCaller struct { + contract *bind.BoundContract +} + +type PriceRegistryTransactor struct { + contract *bind.BoundContract +} + +type PriceRegistryFilterer struct { + contract *bind.BoundContract +} + +type PriceRegistrySession struct { + Contract *PriceRegistry + CallOpts bind.CallOpts + TransactOpts bind.TransactOpts +} + +type PriceRegistryCallerSession struct { + Contract *PriceRegistryCaller + CallOpts bind.CallOpts +} + +type PriceRegistryTransactorSession struct { + Contract *PriceRegistryTransactor + TransactOpts bind.TransactOpts +} + +type PriceRegistryRaw struct { + Contract *PriceRegistry +} + +type PriceRegistryCallerRaw struct { + Contract *PriceRegistryCaller +} + +type PriceRegistryTransactorRaw struct { + Contract *PriceRegistryTransactor +} + +func NewPriceRegistry(address common.Address, backend bind.ContractBackend) (*PriceRegistry, error) { + abi, err := abi.JSON(strings.NewReader(PriceRegistryABI)) + if err != nil { + return nil, err + } + contract, err := bindPriceRegistry(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &PriceRegistry{address: address, abi: abi, PriceRegistryCaller: PriceRegistryCaller{contract: contract}, PriceRegistryTransactor: PriceRegistryTransactor{contract: contract}, PriceRegistryFilterer: PriceRegistryFilterer{contract: contract}}, nil +} + +func NewPriceRegistryCaller(address common.Address, caller bind.ContractCaller) (*PriceRegistryCaller, error) { + contract, err := bindPriceRegistry(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &PriceRegistryCaller{contract: contract}, nil +} + +func NewPriceRegistryTransactor(address common.Address, transactor bind.ContractTransactor) (*PriceRegistryTransactor, error) { + contract, err := bindPriceRegistry(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &PriceRegistryTransactor{contract: contract}, nil +} + +func NewPriceRegistryFilterer(address common.Address, filterer bind.ContractFilterer) (*PriceRegistryFilterer, error) { + contract, err := bindPriceRegistry(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &PriceRegistryFilterer{contract: contract}, nil +} + +func bindPriceRegistry(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := PriceRegistryMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +func (_PriceRegistry *PriceRegistryRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _PriceRegistry.Contract.PriceRegistryCaller.contract.Call(opts, result, method, params...) +} + +func (_PriceRegistry *PriceRegistryRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _PriceRegistry.Contract.PriceRegistryTransactor.contract.Transfer(opts) +} + +func (_PriceRegistry *PriceRegistryRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _PriceRegistry.Contract.PriceRegistryTransactor.contract.Transact(opts, method, params...) +} + +func (_PriceRegistry *PriceRegistryCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _PriceRegistry.Contract.contract.Call(opts, result, method, params...) +} + +func (_PriceRegistry *PriceRegistryTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _PriceRegistry.Contract.contract.Transfer(opts) +} + +func (_PriceRegistry *PriceRegistryTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _PriceRegistry.Contract.contract.Transact(opts, method, params...) +} + +func (_PriceRegistry *PriceRegistryCaller) ConvertTokenAmount(opts *bind.CallOpts, fromToken common.Address, fromTokenAmount *big.Int, toToken common.Address) (*big.Int, error) { + var out []interface{} + err := _PriceRegistry.contract.Call(opts, &out, "convertTokenAmount", fromToken, fromTokenAmount, toToken) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_PriceRegistry *PriceRegistrySession) ConvertTokenAmount(fromToken common.Address, fromTokenAmount *big.Int, toToken common.Address) (*big.Int, error) { + return _PriceRegistry.Contract.ConvertTokenAmount(&_PriceRegistry.CallOpts, fromToken, fromTokenAmount, toToken) +} + +func (_PriceRegistry *PriceRegistryCallerSession) ConvertTokenAmount(fromToken common.Address, fromTokenAmount *big.Int, toToken common.Address) (*big.Int, error) { + return _PriceRegistry.Contract.ConvertTokenAmount(&_PriceRegistry.CallOpts, fromToken, fromTokenAmount, toToken) +} + +func (_PriceRegistry *PriceRegistryCaller) GetDestinationChainGasPrice(opts *bind.CallOpts, destChainSelector uint64) (InternalTimestampedUint192Value, error) { + var out []interface{} + err := _PriceRegistry.contract.Call(opts, &out, "getDestinationChainGasPrice", destChainSelector) + + if err != nil { + return *new(InternalTimestampedUint192Value), err + } + + out0 := *abi.ConvertType(out[0], new(InternalTimestampedUint192Value)).(*InternalTimestampedUint192Value) + + return out0, err + +} + +func (_PriceRegistry *PriceRegistrySession) GetDestinationChainGasPrice(destChainSelector uint64) (InternalTimestampedUint192Value, error) { + return _PriceRegistry.Contract.GetDestinationChainGasPrice(&_PriceRegistry.CallOpts, destChainSelector) +} + +func (_PriceRegistry *PriceRegistryCallerSession) GetDestinationChainGasPrice(destChainSelector uint64) (InternalTimestampedUint192Value, error) { + return _PriceRegistry.Contract.GetDestinationChainGasPrice(&_PriceRegistry.CallOpts, destChainSelector) +} + +func (_PriceRegistry *PriceRegistryCaller) GetFeeTokens(opts *bind.CallOpts) ([]common.Address, error) { + var out []interface{} + err := _PriceRegistry.contract.Call(opts, &out, "getFeeTokens") + + if err != nil { + return *new([]common.Address), err + } + + out0 := *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) + + return out0, err + +} + +func (_PriceRegistry *PriceRegistrySession) GetFeeTokens() ([]common.Address, error) { + return _PriceRegistry.Contract.GetFeeTokens(&_PriceRegistry.CallOpts) +} + +func (_PriceRegistry *PriceRegistryCallerSession) GetFeeTokens() ([]common.Address, error) { + return _PriceRegistry.Contract.GetFeeTokens(&_PriceRegistry.CallOpts) +} + +func (_PriceRegistry *PriceRegistryCaller) GetPriceUpdaters(opts *bind.CallOpts) ([]common.Address, error) { + var out []interface{} + err := _PriceRegistry.contract.Call(opts, &out, "getPriceUpdaters") + + if err != nil { + return *new([]common.Address), err + } + + out0 := *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) + + return out0, err + +} + +func (_PriceRegistry *PriceRegistrySession) GetPriceUpdaters() ([]common.Address, error) { + return _PriceRegistry.Contract.GetPriceUpdaters(&_PriceRegistry.CallOpts) +} + +func (_PriceRegistry *PriceRegistryCallerSession) GetPriceUpdaters() ([]common.Address, error) { + return _PriceRegistry.Contract.GetPriceUpdaters(&_PriceRegistry.CallOpts) +} + +func (_PriceRegistry *PriceRegistryCaller) GetStalenessThreshold(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _PriceRegistry.contract.Call(opts, &out, "getStalenessThreshold") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_PriceRegistry *PriceRegistrySession) GetStalenessThreshold() (*big.Int, error) { + return _PriceRegistry.Contract.GetStalenessThreshold(&_PriceRegistry.CallOpts) +} + +func (_PriceRegistry *PriceRegistryCallerSession) GetStalenessThreshold() (*big.Int, error) { + return _PriceRegistry.Contract.GetStalenessThreshold(&_PriceRegistry.CallOpts) +} + +func (_PriceRegistry *PriceRegistryCaller) GetTokenAndGasPrices(opts *bind.CallOpts, token common.Address, destChainSelector uint64) (GetTokenAndGasPrices, + + error) { + var out []interface{} + err := _PriceRegistry.contract.Call(opts, &out, "getTokenAndGasPrices", token, destChainSelector) + + outstruct := new(GetTokenAndGasPrices) + if err != nil { + return *outstruct, err + } + + outstruct.TokenPrice = *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + outstruct.GasPriceValue = *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) + + return *outstruct, err + +} + +func (_PriceRegistry *PriceRegistrySession) GetTokenAndGasPrices(token common.Address, destChainSelector uint64) (GetTokenAndGasPrices, + + error) { + return _PriceRegistry.Contract.GetTokenAndGasPrices(&_PriceRegistry.CallOpts, token, destChainSelector) +} + +func (_PriceRegistry *PriceRegistryCallerSession) GetTokenAndGasPrices(token common.Address, destChainSelector uint64) (GetTokenAndGasPrices, + + error) { + return _PriceRegistry.Contract.GetTokenAndGasPrices(&_PriceRegistry.CallOpts, token, destChainSelector) +} + +func (_PriceRegistry *PriceRegistryCaller) GetTokenPrice(opts *bind.CallOpts, token common.Address) (InternalTimestampedUint192Value, error) { + var out []interface{} + err := _PriceRegistry.contract.Call(opts, &out, "getTokenPrice", token) + + if err != nil { + return *new(InternalTimestampedUint192Value), err + } + + out0 := *abi.ConvertType(out[0], new(InternalTimestampedUint192Value)).(*InternalTimestampedUint192Value) + + return out0, err + +} + +func (_PriceRegistry *PriceRegistrySession) GetTokenPrice(token common.Address) (InternalTimestampedUint192Value, error) { + return _PriceRegistry.Contract.GetTokenPrice(&_PriceRegistry.CallOpts, token) +} + +func (_PriceRegistry *PriceRegistryCallerSession) GetTokenPrice(token common.Address) (InternalTimestampedUint192Value, error) { + return _PriceRegistry.Contract.GetTokenPrice(&_PriceRegistry.CallOpts, token) +} + +func (_PriceRegistry *PriceRegistryCaller) GetTokenPrices(opts *bind.CallOpts, tokens []common.Address) ([]InternalTimestampedUint192Value, error) { + var out []interface{} + err := _PriceRegistry.contract.Call(opts, &out, "getTokenPrices", tokens) + + if err != nil { + return *new([]InternalTimestampedUint192Value), err + } + + out0 := *abi.ConvertType(out[0], new([]InternalTimestampedUint192Value)).(*[]InternalTimestampedUint192Value) + + return out0, err + +} + +func (_PriceRegistry *PriceRegistrySession) GetTokenPrices(tokens []common.Address) ([]InternalTimestampedUint192Value, error) { + return _PriceRegistry.Contract.GetTokenPrices(&_PriceRegistry.CallOpts, tokens) +} + +func (_PriceRegistry *PriceRegistryCallerSession) GetTokenPrices(tokens []common.Address) ([]InternalTimestampedUint192Value, error) { + return _PriceRegistry.Contract.GetTokenPrices(&_PriceRegistry.CallOpts, tokens) +} + +func (_PriceRegistry *PriceRegistryCaller) GetValidatedTokenPrice(opts *bind.CallOpts, token common.Address) (*big.Int, error) { + var out []interface{} + err := _PriceRegistry.contract.Call(opts, &out, "getValidatedTokenPrice", token) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_PriceRegistry *PriceRegistrySession) GetValidatedTokenPrice(token common.Address) (*big.Int, error) { + return _PriceRegistry.Contract.GetValidatedTokenPrice(&_PriceRegistry.CallOpts, token) +} + +func (_PriceRegistry *PriceRegistryCallerSession) GetValidatedTokenPrice(token common.Address) (*big.Int, error) { + return _PriceRegistry.Contract.GetValidatedTokenPrice(&_PriceRegistry.CallOpts, token) +} + +func (_PriceRegistry *PriceRegistryCaller) Owner(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _PriceRegistry.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 + +} + +func (_PriceRegistry *PriceRegistrySession) Owner() (common.Address, error) { + return _PriceRegistry.Contract.Owner(&_PriceRegistry.CallOpts) +} + +func (_PriceRegistry *PriceRegistryCallerSession) Owner() (common.Address, error) { + return _PriceRegistry.Contract.Owner(&_PriceRegistry.CallOpts) +} + +func (_PriceRegistry *PriceRegistryTransactor) AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + return _PriceRegistry.contract.Transact(opts, "acceptOwnership") +} + +func (_PriceRegistry *PriceRegistrySession) AcceptOwnership() (*types.Transaction, error) { + return _PriceRegistry.Contract.AcceptOwnership(&_PriceRegistry.TransactOpts) +} + +func (_PriceRegistry *PriceRegistryTransactorSession) AcceptOwnership() (*types.Transaction, error) { + return _PriceRegistry.Contract.AcceptOwnership(&_PriceRegistry.TransactOpts) +} + +func (_PriceRegistry *PriceRegistryTransactor) ApplyFeeTokensUpdates(opts *bind.TransactOpts, feeTokensToAdd []common.Address, feeTokensToRemove []common.Address) (*types.Transaction, error) { + return _PriceRegistry.contract.Transact(opts, "applyFeeTokensUpdates", feeTokensToAdd, feeTokensToRemove) +} + +func (_PriceRegistry *PriceRegistrySession) ApplyFeeTokensUpdates(feeTokensToAdd []common.Address, feeTokensToRemove []common.Address) (*types.Transaction, error) { + return _PriceRegistry.Contract.ApplyFeeTokensUpdates(&_PriceRegistry.TransactOpts, feeTokensToAdd, feeTokensToRemove) +} + +func (_PriceRegistry *PriceRegistryTransactorSession) ApplyFeeTokensUpdates(feeTokensToAdd []common.Address, feeTokensToRemove []common.Address) (*types.Transaction, error) { + return _PriceRegistry.Contract.ApplyFeeTokensUpdates(&_PriceRegistry.TransactOpts, feeTokensToAdd, feeTokensToRemove) +} + +func (_PriceRegistry *PriceRegistryTransactor) ApplyPriceUpdatersUpdates(opts *bind.TransactOpts, priceUpdatersToAdd []common.Address, priceUpdatersToRemove []common.Address) (*types.Transaction, error) { + return _PriceRegistry.contract.Transact(opts, "applyPriceUpdatersUpdates", priceUpdatersToAdd, priceUpdatersToRemove) +} + +func (_PriceRegistry *PriceRegistrySession) ApplyPriceUpdatersUpdates(priceUpdatersToAdd []common.Address, priceUpdatersToRemove []common.Address) (*types.Transaction, error) { + return _PriceRegistry.Contract.ApplyPriceUpdatersUpdates(&_PriceRegistry.TransactOpts, priceUpdatersToAdd, priceUpdatersToRemove) +} + +func (_PriceRegistry *PriceRegistryTransactorSession) ApplyPriceUpdatersUpdates(priceUpdatersToAdd []common.Address, priceUpdatersToRemove []common.Address) (*types.Transaction, error) { + return _PriceRegistry.Contract.ApplyPriceUpdatersUpdates(&_PriceRegistry.TransactOpts, priceUpdatersToAdd, priceUpdatersToRemove) +} + +func (_PriceRegistry *PriceRegistryTransactor) TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) { + return _PriceRegistry.contract.Transact(opts, "transferOwnership", to) +} + +func (_PriceRegistry *PriceRegistrySession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _PriceRegistry.Contract.TransferOwnership(&_PriceRegistry.TransactOpts, to) +} + +func (_PriceRegistry *PriceRegistryTransactorSession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _PriceRegistry.Contract.TransferOwnership(&_PriceRegistry.TransactOpts, to) +} + +func (_PriceRegistry *PriceRegistryTransactor) UpdatePrices(opts *bind.TransactOpts, priceUpdates InternalPriceUpdates) (*types.Transaction, error) { + return _PriceRegistry.contract.Transact(opts, "updatePrices", priceUpdates) +} + +func (_PriceRegistry *PriceRegistrySession) UpdatePrices(priceUpdates InternalPriceUpdates) (*types.Transaction, error) { + return _PriceRegistry.Contract.UpdatePrices(&_PriceRegistry.TransactOpts, priceUpdates) +} + +func (_PriceRegistry *PriceRegistryTransactorSession) UpdatePrices(priceUpdates InternalPriceUpdates) (*types.Transaction, error) { + return _PriceRegistry.Contract.UpdatePrices(&_PriceRegistry.TransactOpts, priceUpdates) +} + +type PriceRegistryFeeTokenAddedIterator struct { + Event *PriceRegistryFeeTokenAdded + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *PriceRegistryFeeTokenAddedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(PriceRegistryFeeTokenAdded) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(PriceRegistryFeeTokenAdded) + 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() + } +} + +func (it *PriceRegistryFeeTokenAddedIterator) Error() error { + return it.fail +} + +func (it *PriceRegistryFeeTokenAddedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type PriceRegistryFeeTokenAdded struct { + FeeToken common.Address + Raw types.Log +} + +func (_PriceRegistry *PriceRegistryFilterer) FilterFeeTokenAdded(opts *bind.FilterOpts, feeToken []common.Address) (*PriceRegistryFeeTokenAddedIterator, error) { + + var feeTokenRule []interface{} + for _, feeTokenItem := range feeToken { + feeTokenRule = append(feeTokenRule, feeTokenItem) + } + + logs, sub, err := _PriceRegistry.contract.FilterLogs(opts, "FeeTokenAdded", feeTokenRule) + if err != nil { + return nil, err + } + return &PriceRegistryFeeTokenAddedIterator{contract: _PriceRegistry.contract, event: "FeeTokenAdded", logs: logs, sub: sub}, nil +} + +func (_PriceRegistry *PriceRegistryFilterer) WatchFeeTokenAdded(opts *bind.WatchOpts, sink chan<- *PriceRegistryFeeTokenAdded, feeToken []common.Address) (event.Subscription, error) { + + var feeTokenRule []interface{} + for _, feeTokenItem := range feeToken { + feeTokenRule = append(feeTokenRule, feeTokenItem) + } + + logs, sub, err := _PriceRegistry.contract.WatchLogs(opts, "FeeTokenAdded", feeTokenRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(PriceRegistryFeeTokenAdded) + if err := _PriceRegistry.contract.UnpackLog(event, "FeeTokenAdded", 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 +} + +func (_PriceRegistry *PriceRegistryFilterer) ParseFeeTokenAdded(log types.Log) (*PriceRegistryFeeTokenAdded, error) { + event := new(PriceRegistryFeeTokenAdded) + if err := _PriceRegistry.contract.UnpackLog(event, "FeeTokenAdded", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type PriceRegistryFeeTokenRemovedIterator struct { + Event *PriceRegistryFeeTokenRemoved + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *PriceRegistryFeeTokenRemovedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(PriceRegistryFeeTokenRemoved) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(PriceRegistryFeeTokenRemoved) + 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() + } +} + +func (it *PriceRegistryFeeTokenRemovedIterator) Error() error { + return it.fail +} + +func (it *PriceRegistryFeeTokenRemovedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type PriceRegistryFeeTokenRemoved struct { + FeeToken common.Address + Raw types.Log +} + +func (_PriceRegistry *PriceRegistryFilterer) FilterFeeTokenRemoved(opts *bind.FilterOpts, feeToken []common.Address) (*PriceRegistryFeeTokenRemovedIterator, error) { + + var feeTokenRule []interface{} + for _, feeTokenItem := range feeToken { + feeTokenRule = append(feeTokenRule, feeTokenItem) + } + + logs, sub, err := _PriceRegistry.contract.FilterLogs(opts, "FeeTokenRemoved", feeTokenRule) + if err != nil { + return nil, err + } + return &PriceRegistryFeeTokenRemovedIterator{contract: _PriceRegistry.contract, event: "FeeTokenRemoved", logs: logs, sub: sub}, nil +} + +func (_PriceRegistry *PriceRegistryFilterer) WatchFeeTokenRemoved(opts *bind.WatchOpts, sink chan<- *PriceRegistryFeeTokenRemoved, feeToken []common.Address) (event.Subscription, error) { + + var feeTokenRule []interface{} + for _, feeTokenItem := range feeToken { + feeTokenRule = append(feeTokenRule, feeTokenItem) + } + + logs, sub, err := _PriceRegistry.contract.WatchLogs(opts, "FeeTokenRemoved", feeTokenRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(PriceRegistryFeeTokenRemoved) + if err := _PriceRegistry.contract.UnpackLog(event, "FeeTokenRemoved", 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 +} + +func (_PriceRegistry *PriceRegistryFilterer) ParseFeeTokenRemoved(log types.Log) (*PriceRegistryFeeTokenRemoved, error) { + event := new(PriceRegistryFeeTokenRemoved) + if err := _PriceRegistry.contract.UnpackLog(event, "FeeTokenRemoved", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type PriceRegistryOwnershipTransferRequestedIterator struct { + Event *PriceRegistryOwnershipTransferRequested + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *PriceRegistryOwnershipTransferRequestedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(PriceRegistryOwnershipTransferRequested) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(PriceRegistryOwnershipTransferRequested) + 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() + } +} + +func (it *PriceRegistryOwnershipTransferRequestedIterator) Error() error { + return it.fail +} + +func (it *PriceRegistryOwnershipTransferRequestedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type PriceRegistryOwnershipTransferRequested struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_PriceRegistry *PriceRegistryFilterer) FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*PriceRegistryOwnershipTransferRequestedIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _PriceRegistry.contract.FilterLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return &PriceRegistryOwnershipTransferRequestedIterator{contract: _PriceRegistry.contract, event: "OwnershipTransferRequested", logs: logs, sub: sub}, nil +} + +func (_PriceRegistry *PriceRegistryFilterer) WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *PriceRegistryOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _PriceRegistry.contract.WatchLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(PriceRegistryOwnershipTransferRequested) + if err := _PriceRegistry.contract.UnpackLog(event, "OwnershipTransferRequested", 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 +} + +func (_PriceRegistry *PriceRegistryFilterer) ParseOwnershipTransferRequested(log types.Log) (*PriceRegistryOwnershipTransferRequested, error) { + event := new(PriceRegistryOwnershipTransferRequested) + if err := _PriceRegistry.contract.UnpackLog(event, "OwnershipTransferRequested", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type PriceRegistryOwnershipTransferredIterator struct { + Event *PriceRegistryOwnershipTransferred + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *PriceRegistryOwnershipTransferredIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(PriceRegistryOwnershipTransferred) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(PriceRegistryOwnershipTransferred) + 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() + } +} + +func (it *PriceRegistryOwnershipTransferredIterator) Error() error { + return it.fail +} + +func (it *PriceRegistryOwnershipTransferredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type PriceRegistryOwnershipTransferred struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_PriceRegistry *PriceRegistryFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*PriceRegistryOwnershipTransferredIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _PriceRegistry.contract.FilterLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return &PriceRegistryOwnershipTransferredIterator{contract: _PriceRegistry.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil +} + +func (_PriceRegistry *PriceRegistryFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *PriceRegistryOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _PriceRegistry.contract.WatchLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(PriceRegistryOwnershipTransferred) + if err := _PriceRegistry.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 +} + +func (_PriceRegistry *PriceRegistryFilterer) ParseOwnershipTransferred(log types.Log) (*PriceRegistryOwnershipTransferred, error) { + event := new(PriceRegistryOwnershipTransferred) + if err := _PriceRegistry.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type PriceRegistryPriceUpdaterRemovedIterator struct { + Event *PriceRegistryPriceUpdaterRemoved + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *PriceRegistryPriceUpdaterRemovedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(PriceRegistryPriceUpdaterRemoved) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(PriceRegistryPriceUpdaterRemoved) + 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() + } +} + +func (it *PriceRegistryPriceUpdaterRemovedIterator) Error() error { + return it.fail +} + +func (it *PriceRegistryPriceUpdaterRemovedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type PriceRegistryPriceUpdaterRemoved struct { + PriceUpdater common.Address + Raw types.Log +} + +func (_PriceRegistry *PriceRegistryFilterer) FilterPriceUpdaterRemoved(opts *bind.FilterOpts, priceUpdater []common.Address) (*PriceRegistryPriceUpdaterRemovedIterator, error) { + + var priceUpdaterRule []interface{} + for _, priceUpdaterItem := range priceUpdater { + priceUpdaterRule = append(priceUpdaterRule, priceUpdaterItem) + } + + logs, sub, err := _PriceRegistry.contract.FilterLogs(opts, "PriceUpdaterRemoved", priceUpdaterRule) + if err != nil { + return nil, err + } + return &PriceRegistryPriceUpdaterRemovedIterator{contract: _PriceRegistry.contract, event: "PriceUpdaterRemoved", logs: logs, sub: sub}, nil +} + +func (_PriceRegistry *PriceRegistryFilterer) WatchPriceUpdaterRemoved(opts *bind.WatchOpts, sink chan<- *PriceRegistryPriceUpdaterRemoved, priceUpdater []common.Address) (event.Subscription, error) { + + var priceUpdaterRule []interface{} + for _, priceUpdaterItem := range priceUpdater { + priceUpdaterRule = append(priceUpdaterRule, priceUpdaterItem) + } + + logs, sub, err := _PriceRegistry.contract.WatchLogs(opts, "PriceUpdaterRemoved", priceUpdaterRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(PriceRegistryPriceUpdaterRemoved) + if err := _PriceRegistry.contract.UnpackLog(event, "PriceUpdaterRemoved", 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 +} + +func (_PriceRegistry *PriceRegistryFilterer) ParsePriceUpdaterRemoved(log types.Log) (*PriceRegistryPriceUpdaterRemoved, error) { + event := new(PriceRegistryPriceUpdaterRemoved) + if err := _PriceRegistry.contract.UnpackLog(event, "PriceUpdaterRemoved", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type PriceRegistryPriceUpdaterSetIterator struct { + Event *PriceRegistryPriceUpdaterSet + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *PriceRegistryPriceUpdaterSetIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(PriceRegistryPriceUpdaterSet) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(PriceRegistryPriceUpdaterSet) + 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() + } +} + +func (it *PriceRegistryPriceUpdaterSetIterator) Error() error { + return it.fail +} + +func (it *PriceRegistryPriceUpdaterSetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type PriceRegistryPriceUpdaterSet struct { + PriceUpdater common.Address + Raw types.Log +} + +func (_PriceRegistry *PriceRegistryFilterer) FilterPriceUpdaterSet(opts *bind.FilterOpts, priceUpdater []common.Address) (*PriceRegistryPriceUpdaterSetIterator, error) { + + var priceUpdaterRule []interface{} + for _, priceUpdaterItem := range priceUpdater { + priceUpdaterRule = append(priceUpdaterRule, priceUpdaterItem) + } + + logs, sub, err := _PriceRegistry.contract.FilterLogs(opts, "PriceUpdaterSet", priceUpdaterRule) + if err != nil { + return nil, err + } + return &PriceRegistryPriceUpdaterSetIterator{contract: _PriceRegistry.contract, event: "PriceUpdaterSet", logs: logs, sub: sub}, nil +} + +func (_PriceRegistry *PriceRegistryFilterer) WatchPriceUpdaterSet(opts *bind.WatchOpts, sink chan<- *PriceRegistryPriceUpdaterSet, priceUpdater []common.Address) (event.Subscription, error) { + + var priceUpdaterRule []interface{} + for _, priceUpdaterItem := range priceUpdater { + priceUpdaterRule = append(priceUpdaterRule, priceUpdaterItem) + } + + logs, sub, err := _PriceRegistry.contract.WatchLogs(opts, "PriceUpdaterSet", priceUpdaterRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(PriceRegistryPriceUpdaterSet) + if err := _PriceRegistry.contract.UnpackLog(event, "PriceUpdaterSet", 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 +} + +func (_PriceRegistry *PriceRegistryFilterer) ParsePriceUpdaterSet(log types.Log) (*PriceRegistryPriceUpdaterSet, error) { + event := new(PriceRegistryPriceUpdaterSet) + if err := _PriceRegistry.contract.UnpackLog(event, "PriceUpdaterSet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type PriceRegistryUsdPerTokenUpdatedIterator struct { + Event *PriceRegistryUsdPerTokenUpdated + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *PriceRegistryUsdPerTokenUpdatedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(PriceRegistryUsdPerTokenUpdated) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(PriceRegistryUsdPerTokenUpdated) + 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() + } +} + +func (it *PriceRegistryUsdPerTokenUpdatedIterator) Error() error { + return it.fail +} + +func (it *PriceRegistryUsdPerTokenUpdatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type PriceRegistryUsdPerTokenUpdated struct { + Token common.Address + Value *big.Int + Timestamp *big.Int + Raw types.Log +} + +func (_PriceRegistry *PriceRegistryFilterer) FilterUsdPerTokenUpdated(opts *bind.FilterOpts, token []common.Address) (*PriceRegistryUsdPerTokenUpdatedIterator, error) { + + var tokenRule []interface{} + for _, tokenItem := range token { + tokenRule = append(tokenRule, tokenItem) + } + + logs, sub, err := _PriceRegistry.contract.FilterLogs(opts, "UsdPerTokenUpdated", tokenRule) + if err != nil { + return nil, err + } + return &PriceRegistryUsdPerTokenUpdatedIterator{contract: _PriceRegistry.contract, event: "UsdPerTokenUpdated", logs: logs, sub: sub}, nil +} + +func (_PriceRegistry *PriceRegistryFilterer) WatchUsdPerTokenUpdated(opts *bind.WatchOpts, sink chan<- *PriceRegistryUsdPerTokenUpdated, token []common.Address) (event.Subscription, error) { + + var tokenRule []interface{} + for _, tokenItem := range token { + tokenRule = append(tokenRule, tokenItem) + } + + logs, sub, err := _PriceRegistry.contract.WatchLogs(opts, "UsdPerTokenUpdated", tokenRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(PriceRegistryUsdPerTokenUpdated) + if err := _PriceRegistry.contract.UnpackLog(event, "UsdPerTokenUpdated", 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 +} + +func (_PriceRegistry *PriceRegistryFilterer) ParseUsdPerTokenUpdated(log types.Log) (*PriceRegistryUsdPerTokenUpdated, error) { + event := new(PriceRegistryUsdPerTokenUpdated) + if err := _PriceRegistry.contract.UnpackLog(event, "UsdPerTokenUpdated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type PriceRegistryUsdPerUnitGasUpdatedIterator struct { + Event *PriceRegistryUsdPerUnitGasUpdated + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *PriceRegistryUsdPerUnitGasUpdatedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(PriceRegistryUsdPerUnitGasUpdated) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(PriceRegistryUsdPerUnitGasUpdated) + 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() + } +} + +func (it *PriceRegistryUsdPerUnitGasUpdatedIterator) Error() error { + return it.fail +} + +func (it *PriceRegistryUsdPerUnitGasUpdatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type PriceRegistryUsdPerUnitGasUpdated struct { + DestChain uint64 + Value *big.Int + Timestamp *big.Int + Raw types.Log +} + +func (_PriceRegistry *PriceRegistryFilterer) FilterUsdPerUnitGasUpdated(opts *bind.FilterOpts, destChain []uint64) (*PriceRegistryUsdPerUnitGasUpdatedIterator, error) { + + var destChainRule []interface{} + for _, destChainItem := range destChain { + destChainRule = append(destChainRule, destChainItem) + } + + logs, sub, err := _PriceRegistry.contract.FilterLogs(opts, "UsdPerUnitGasUpdated", destChainRule) + if err != nil { + return nil, err + } + return &PriceRegistryUsdPerUnitGasUpdatedIterator{contract: _PriceRegistry.contract, event: "UsdPerUnitGasUpdated", logs: logs, sub: sub}, nil +} + +func (_PriceRegistry *PriceRegistryFilterer) WatchUsdPerUnitGasUpdated(opts *bind.WatchOpts, sink chan<- *PriceRegistryUsdPerUnitGasUpdated, destChain []uint64) (event.Subscription, error) { + + var destChainRule []interface{} + for _, destChainItem := range destChain { + destChainRule = append(destChainRule, destChainItem) + } + + logs, sub, err := _PriceRegistry.contract.WatchLogs(opts, "UsdPerUnitGasUpdated", destChainRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(PriceRegistryUsdPerUnitGasUpdated) + if err := _PriceRegistry.contract.UnpackLog(event, "UsdPerUnitGasUpdated", 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 +} + +func (_PriceRegistry *PriceRegistryFilterer) ParseUsdPerUnitGasUpdated(log types.Log) (*PriceRegistryUsdPerUnitGasUpdated, error) { + event := new(PriceRegistryUsdPerUnitGasUpdated) + if err := _PriceRegistry.contract.UnpackLog(event, "UsdPerUnitGasUpdated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type GetTokenAndGasPrices struct { + TokenPrice *big.Int + GasPriceValue *big.Int +} + +func (_PriceRegistry *PriceRegistry) ParseLog(log types.Log) (generated.AbigenLog, error) { + switch log.Topics[0] { + case _PriceRegistry.abi.Events["FeeTokenAdded"].ID: + return _PriceRegistry.ParseFeeTokenAdded(log) + case _PriceRegistry.abi.Events["FeeTokenRemoved"].ID: + return _PriceRegistry.ParseFeeTokenRemoved(log) + case _PriceRegistry.abi.Events["OwnershipTransferRequested"].ID: + return _PriceRegistry.ParseOwnershipTransferRequested(log) + case _PriceRegistry.abi.Events["OwnershipTransferred"].ID: + return _PriceRegistry.ParseOwnershipTransferred(log) + case _PriceRegistry.abi.Events["PriceUpdaterRemoved"].ID: + return _PriceRegistry.ParsePriceUpdaterRemoved(log) + case _PriceRegistry.abi.Events["PriceUpdaterSet"].ID: + return _PriceRegistry.ParsePriceUpdaterSet(log) + case _PriceRegistry.abi.Events["UsdPerTokenUpdated"].ID: + return _PriceRegistry.ParseUsdPerTokenUpdated(log) + case _PriceRegistry.abi.Events["UsdPerUnitGasUpdated"].ID: + return _PriceRegistry.ParseUsdPerUnitGasUpdated(log) + + default: + return nil, fmt.Errorf("abigen wrapper received unknown log topic: %v", log.Topics[0]) + } +} + +func (PriceRegistryFeeTokenAdded) Topic() common.Hash { + return common.HexToHash("0xdf1b1bd32a69711488d71554706bb130b1fc63a5fa1a2cd85e8440f84065ba23") +} + +func (PriceRegistryFeeTokenRemoved) Topic() common.Hash { + return common.HexToHash("0x1795838dc8ab2ffc5f431a1729a6afa0b587f982f7b2be0b9d7187a1ef547f91") +} + +func (PriceRegistryOwnershipTransferRequested) Topic() common.Hash { + return common.HexToHash("0xed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae1278") +} + +func (PriceRegistryOwnershipTransferred) Topic() common.Hash { + return common.HexToHash("0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0") +} + +func (PriceRegistryPriceUpdaterRemoved) Topic() common.Hash { + return common.HexToHash("0xff7dbb85c77ca68ca1f894d6498570e3d5095cd19466f07ee8d222b337e4068c") +} + +func (PriceRegistryPriceUpdaterSet) Topic() common.Hash { + return common.HexToHash("0x34a02290b7920078c19f58e94b78c77eb9cc10195b20676e19bd3b82085893b8") +} + +func (PriceRegistryUsdPerTokenUpdated) Topic() common.Hash { + return common.HexToHash("0x52f50aa6d1a95a4595361ecf953d095f125d442e4673716dede699e049de148a") +} + +func (PriceRegistryUsdPerUnitGasUpdated) Topic() common.Hash { + return common.HexToHash("0xdd84a3fa9ef9409f550d54d6affec7e9c480c878c6ab27b78912a03e1b371c6e") +} + +func (_PriceRegistry *PriceRegistry) Address() common.Address { + return _PriceRegistry.address +} + +type PriceRegistryInterface interface { + ConvertTokenAmount(opts *bind.CallOpts, fromToken common.Address, fromTokenAmount *big.Int, toToken common.Address) (*big.Int, error) + + GetDestinationChainGasPrice(opts *bind.CallOpts, destChainSelector uint64) (InternalTimestampedUint192Value, error) + + GetFeeTokens(opts *bind.CallOpts) ([]common.Address, error) + + GetPriceUpdaters(opts *bind.CallOpts) ([]common.Address, error) + + GetStalenessThreshold(opts *bind.CallOpts) (*big.Int, error) + + GetTokenAndGasPrices(opts *bind.CallOpts, token common.Address, destChainSelector uint64) (GetTokenAndGasPrices, + + error) + + GetTokenPrice(opts *bind.CallOpts, token common.Address) (InternalTimestampedUint192Value, error) + + GetTokenPrices(opts *bind.CallOpts, tokens []common.Address) ([]InternalTimestampedUint192Value, error) + + GetValidatedTokenPrice(opts *bind.CallOpts, token common.Address) (*big.Int, error) + + Owner(opts *bind.CallOpts) (common.Address, error) + + AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) + + ApplyFeeTokensUpdates(opts *bind.TransactOpts, feeTokensToAdd []common.Address, feeTokensToRemove []common.Address) (*types.Transaction, error) + + ApplyPriceUpdatersUpdates(opts *bind.TransactOpts, priceUpdatersToAdd []common.Address, priceUpdatersToRemove []common.Address) (*types.Transaction, error) + + TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) + + UpdatePrices(opts *bind.TransactOpts, priceUpdates InternalPriceUpdates) (*types.Transaction, error) + + FilterFeeTokenAdded(opts *bind.FilterOpts, feeToken []common.Address) (*PriceRegistryFeeTokenAddedIterator, error) + + WatchFeeTokenAdded(opts *bind.WatchOpts, sink chan<- *PriceRegistryFeeTokenAdded, feeToken []common.Address) (event.Subscription, error) + + ParseFeeTokenAdded(log types.Log) (*PriceRegistryFeeTokenAdded, error) + + FilterFeeTokenRemoved(opts *bind.FilterOpts, feeToken []common.Address) (*PriceRegistryFeeTokenRemovedIterator, error) + + WatchFeeTokenRemoved(opts *bind.WatchOpts, sink chan<- *PriceRegistryFeeTokenRemoved, feeToken []common.Address) (event.Subscription, error) + + ParseFeeTokenRemoved(log types.Log) (*PriceRegistryFeeTokenRemoved, error) + + FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*PriceRegistryOwnershipTransferRequestedIterator, error) + + WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *PriceRegistryOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferRequested(log types.Log) (*PriceRegistryOwnershipTransferRequested, error) + + FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*PriceRegistryOwnershipTransferredIterator, error) + + WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *PriceRegistryOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferred(log types.Log) (*PriceRegistryOwnershipTransferred, error) + + FilterPriceUpdaterRemoved(opts *bind.FilterOpts, priceUpdater []common.Address) (*PriceRegistryPriceUpdaterRemovedIterator, error) + + WatchPriceUpdaterRemoved(opts *bind.WatchOpts, sink chan<- *PriceRegistryPriceUpdaterRemoved, priceUpdater []common.Address) (event.Subscription, error) + + ParsePriceUpdaterRemoved(log types.Log) (*PriceRegistryPriceUpdaterRemoved, error) + + FilterPriceUpdaterSet(opts *bind.FilterOpts, priceUpdater []common.Address) (*PriceRegistryPriceUpdaterSetIterator, error) + + WatchPriceUpdaterSet(opts *bind.WatchOpts, sink chan<- *PriceRegistryPriceUpdaterSet, priceUpdater []common.Address) (event.Subscription, error) + + ParsePriceUpdaterSet(log types.Log) (*PriceRegistryPriceUpdaterSet, error) + + FilterUsdPerTokenUpdated(opts *bind.FilterOpts, token []common.Address) (*PriceRegistryUsdPerTokenUpdatedIterator, error) + + WatchUsdPerTokenUpdated(opts *bind.WatchOpts, sink chan<- *PriceRegistryUsdPerTokenUpdated, token []common.Address) (event.Subscription, error) + + ParseUsdPerTokenUpdated(log types.Log) (*PriceRegistryUsdPerTokenUpdated, error) + + FilterUsdPerUnitGasUpdated(opts *bind.FilterOpts, destChain []uint64) (*PriceRegistryUsdPerUnitGasUpdatedIterator, error) + + WatchUsdPerUnitGasUpdated(opts *bind.WatchOpts, sink chan<- *PriceRegistryUsdPerUnitGasUpdated, destChain []uint64) (event.Subscription, error) + + ParseUsdPerUnitGasUpdated(log types.Log) (*PriceRegistryUsdPerUnitGasUpdated, error) + + ParseLog(log types.Log) (generated.AbigenLog, error) + + Address() common.Address +} diff --git a/core/gethwrappers/ccip/generated/price_registry_1_2_0/price_registry.go b/core/gethwrappers/ccip/generated/price_registry_1_2_0/price_registry.go new file mode 100644 index 00000000000..64e16bd1dcf --- /dev/null +++ b/core/gethwrappers/ccip/generated/price_registry_1_2_0/price_registry.go @@ -0,0 +1,1693 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package price_registry_1_2_0 + +import ( + "errors" + "fmt" + "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" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" +) + +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +type InternalGasPriceUpdate struct { + DestChainSelector uint64 + UsdPerUnitGas *big.Int +} + +type InternalPriceUpdates struct { + TokenPriceUpdates []InternalTokenPriceUpdate + GasPriceUpdates []InternalGasPriceUpdate +} + +type InternalTimestampedPackedUint224 struct { + Value *big.Int + Timestamp uint32 +} + +type InternalTokenPriceUpdate struct { + SourceToken common.Address + UsdPerToken *big.Int +} + +var PriceRegistryMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"priceUpdaters\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"feeTokens\",\"type\":\"address[]\"},{\"internalType\":\"uint32\",\"name\":\"stalenessThreshold\",\"type\":\"uint32\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"chain\",\"type\":\"uint64\"}],\"name\":\"ChainNotSupported\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidStalenessThreshold\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCallableByUpdaterOrOwner\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint256\",\"name\":\"threshold\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"timePassed\",\"type\":\"uint256\"}],\"name\":\"StaleGasPrice\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"threshold\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"timePassed\",\"type\":\"uint256\"}],\"name\":\"StaleTokenPrice\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"TokenNotSupported\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"feeToken\",\"type\":\"address\"}],\"name\":\"FeeTokenAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"feeToken\",\"type\":\"address\"}],\"name\":\"FeeTokenRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"priceUpdater\",\"type\":\"address\"}],\"name\":\"PriceUpdaterRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"priceUpdater\",\"type\":\"address\"}],\"name\":\"PriceUpdaterSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"name\":\"UsdPerTokenUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"destChain\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"name\":\"UsdPerUnitGasUpdated\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"feeTokensToAdd\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"feeTokensToRemove\",\"type\":\"address[]\"}],\"name\":\"applyFeeTokensUpdates\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"priceUpdatersToAdd\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"priceUpdatersToRemove\",\"type\":\"address[]\"}],\"name\":\"applyPriceUpdatersUpdates\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"fromToken\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"fromTokenAmount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"toToken\",\"type\":\"address\"}],\"name\":\"convertTokenAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"}],\"name\":\"getDestinationChainGasPrice\",\"outputs\":[{\"components\":[{\"internalType\":\"uint224\",\"name\":\"value\",\"type\":\"uint224\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"}],\"internalType\":\"structInternal.TimestampedPackedUint224\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getFeeTokens\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getPriceUpdaters\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getStalenessThreshold\",\"outputs\":[{\"internalType\":\"uint128\",\"name\":\"\",\"type\":\"uint128\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"}],\"name\":\"getTokenAndGasPrices\",\"outputs\":[{\"internalType\":\"uint224\",\"name\":\"tokenPrice\",\"type\":\"uint224\"},{\"internalType\":\"uint224\",\"name\":\"gasPriceValue\",\"type\":\"uint224\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"getTokenPrice\",\"outputs\":[{\"components\":[{\"internalType\":\"uint224\",\"name\":\"value\",\"type\":\"uint224\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"}],\"internalType\":\"structInternal.TimestampedPackedUint224\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"tokens\",\"type\":\"address[]\"}],\"name\":\"getTokenPrices\",\"outputs\":[{\"components\":[{\"internalType\":\"uint224\",\"name\":\"value\",\"type\":\"uint224\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"}],\"internalType\":\"structInternal.TimestampedPackedUint224[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"getValidatedTokenPrice\",\"outputs\":[{\"internalType\":\"uint224\",\"name\":\"\",\"type\":\"uint224\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"sourceToken\",\"type\":\"address\"},{\"internalType\":\"uint224\",\"name\":\"usdPerToken\",\"type\":\"uint224\"}],\"internalType\":\"structInternal.TokenPriceUpdate[]\",\"name\":\"tokenPriceUpdates\",\"type\":\"tuple[]\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint224\",\"name\":\"usdPerUnitGas\",\"type\":\"uint224\"}],\"internalType\":\"structInternal.GasPriceUpdate[]\",\"name\":\"gasPriceUpdates\",\"type\":\"tuple[]\"}],\"internalType\":\"structInternal.PriceUpdates\",\"name\":\"priceUpdates\",\"type\":\"tuple\"}],\"name\":\"updatePrices\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", + Bin: "0x60a06040523480156200001157600080fd5b506040516200227f3803806200227f8339810160408190526200003491620006fe565b33806000816200008b5760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000be57620000be8162000133565b5050604080516000815260208101909152620000dd91508490620001de565b604080516000815260208101909152620000f99083906200033a565b8063ffffffff166000036200012157604051631151410960e11b815260040160405180910390fd5b63ffffffff1660805250620007fa9050565b336001600160a01b038216036200018d5760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640162000082565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b60005b825181101562000289576200021d83828151811062000204576200020462000786565b602002602001015160046200049160201b90919060201c565b15620002765782818151811062000238576200023862000786565b60200260200101516001600160a01b03167f34a02290b7920078c19f58e94b78c77eb9cc10195b20676e19bd3b82085893b860405160405180910390a25b6200028181620007b2565b9050620001e1565b5060005b81518110156200033557620002c9828281518110620002b057620002b062000786565b60200260200101516004620004b160201b90919060201c565b156200032257818181518110620002e457620002e462000786565b60200260200101516001600160a01b03167fff7dbb85c77ca68ca1f894d6498570e3d5095cd19466f07ee8d222b337e4068c60405160405180910390a25b6200032d81620007b2565b90506200028d565b505050565b60005b8251811015620003e5576200037983828151811062000360576200036062000786565b602002602001015160066200049160201b90919060201c565b15620003d25782818151811062000394576200039462000786565b60200260200101516001600160a01b03167fdf1b1bd32a69711488d71554706bb130b1fc63a5fa1a2cd85e8440f84065ba2360405160405180910390a25b620003dd81620007b2565b90506200033d565b5060005b81518110156200033557620004258282815181106200040c576200040c62000786565b60200260200101516006620004b160201b90919060201c565b156200047e5781818151811062000440576200044062000786565b60200260200101516001600160a01b03167f1795838dc8ab2ffc5f431a1729a6afa0b587f982f7b2be0b9d7187a1ef547f9160405160405180910390a25b6200048981620007b2565b9050620003e9565b6000620004a8836001600160a01b038416620004c8565b90505b92915050565b6000620004a8836001600160a01b0384166200051a565b60008181526001830160205260408120546200051157508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155620004ab565b506000620004ab565b600081815260018301602052604081205480156200061357600062000541600183620007ce565b85549091506000906200055790600190620007ce565b9050818114620005c35760008660000182815481106200057b576200057b62000786565b9060005260206000200154905080876000018481548110620005a157620005a162000786565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080620005d757620005d7620007e4565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050620004ab565b6000915050620004ab565b634e487b7160e01b600052604160045260246000fd5b80516001600160a01b03811681146200064c57600080fd5b919050565b600082601f8301126200066357600080fd5b815160206001600160401b03808311156200068257620006826200061e565b8260051b604051601f19603f83011681018181108482111715620006aa57620006aa6200061e565b604052938452858101830193838101925087851115620006c957600080fd5b83870191505b84821015620006f357620006e38262000634565b83529183019190830190620006cf565b979650505050505050565b6000806000606084860312156200071457600080fd5b83516001600160401b03808211156200072c57600080fd5b6200073a8783880162000651565b945060208601519150808211156200075157600080fd5b50620007608682870162000651565b925050604084015163ffffffff811681146200077b57600080fd5b809150509250925092565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201620007c757620007c76200079c565b5060010190565b81810381811115620004ab57620004ab6200079c565b634e487b7160e01b600052603160045260246000fd5b608051611a4d62000832600039600081816102eb01528181610acd01528181610b3601528181610c970152610d0c0152611a4d6000f3fe608060405234801561001057600080fd5b50600436106100ff5760003560e01c80637afac32211610097578063cdc73d5111610066578063cdc73d511461032a578063d02641a014610332578063f2fde38b146103d4578063ffdb4b37146103e757600080fd5b80637afac322146102a65780638da5cb5b146102b9578063a6c94a73146102e1578063bfcd45661461031557600080fd5b80634ab35b0b116100d35780634ab35b0b146101a8578063514e8cff146101e857806352877af01461028b57806379ba50971461029e57600080fd5b806241e5be14610104578063181f5a771461012a5780633937306f1461017357806345ac924d14610188575b600080fd5b6101176101123660046113bd565b61042f565b6040519081526020015b60405180910390f35b6101666040518060400160405280601381526020017f5072696365526567697374727920312e322e300000000000000000000000000081525081565b60405161012191906113f9565b610186610181366004611465565b61049b565b005b61019b6101963660046114a0565b6107bf565b6040516101219190611515565b6101bb6101b6366004611590565b610893565b6040517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff9091168152602001610121565b61027e6101f63660046115c3565b60408051808201909152600080825260208201525067ffffffffffffffff166000908152600260209081526040918290208251808401909352547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff811683527c0100000000000000000000000000000000000000000000000000000000900463ffffffff169082015290565b60405161012191906115de565b610186610299366004611731565b61089e565b6101866108b4565b6101866102b4366004611731565b6109b6565b60005460405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610121565b60405163ffffffff7f0000000000000000000000000000000000000000000000000000000000000000168152602001610121565b61031d6109c8565b6040516101219190611795565b61031d6109d9565b61027e610340366004611590565b60408051808201909152600080825260208201525073ffffffffffffffffffffffffffffffffffffffff166000908152600360209081526040918290208251808401909352547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff811683527c0100000000000000000000000000000000000000000000000000000000900463ffffffff169082015290565b6101866103e2366004611590565b6109e5565b6103fa6103f53660046117ef565b6109f9565b604080517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff938416815292909116602083015201610121565b600061043a82610b84565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1661046185610b84565b610489907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1685611851565b6104939190611868565b949350505050565b60005473ffffffffffffffffffffffffffffffffffffffff1633148015906104cb57506104c9600433610d48565b155b15610502576040517f46f0815400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600061050e82806118a3565b9050905060005b8181101561066057600061052984806118a3565b838181106105395761053961190b565b90506040020180360381019061054f9190611966565b604080518082018252602080840180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff908116845263ffffffff42818116858701908152885173ffffffffffffffffffffffffffffffffffffffff9081166000908152600390975295889020965190519092167c010000000000000000000000000000000000000000000000000000000002919092161790935584519051935194955016927f52f50aa6d1a95a4595361ecf953d095f125d442e4673716dede699e049de148a926106479290917bffffffffffffffffffffffffffffffffffffffffffffffffffffffff929092168252602082015260400190565b60405180910390a250610659816119a3565b9050610515565b50600061067060208401846118a3565b9050905060005b818110156107b957600061068e60208601866118a3565b8381811061069e5761069e61190b565b9050604002018036038101906106b491906119db565b604080518082018252602080840180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff908116845263ffffffff42818116858701908152885167ffffffffffffffff9081166000908152600290975295889020965190519092167c010000000000000000000000000000000000000000000000000000000002919092161790935584519051935194955016927fdd84a3fa9ef9409f550d54d6affec7e9c480c878c6ab27b78912a03e1b371c6e926107a09290917bffffffffffffffffffffffffffffffffffffffffffffffffffffffff929092168252602082015260400190565b60405180910390a2506107b2816119a3565b9050610677565b50505050565b60608160008167ffffffffffffffff8111156107dd576107dd611619565b60405190808252806020026020018201604052801561082257816020015b60408051808201909152600080825260208201528152602001906001900390816107fb5790505b50905060005b828110156108885761085a8686838181106108455761084561190b565b90506020020160208101906103409190611590565b82828151811061086c5761086c61190b565b602002602001018190525080610881906119a3565b9050610828565b509150505b92915050565b600061088d82610b84565b6108a6610d7a565b6108b08282610dfd565b5050565b60015473ffffffffffffffffffffffffffffffffffffffff16331461093a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e65720000000000000000000060448201526064015b60405180910390fd5b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b6109be610d7a565b6108b08282610f59565b60606109d460046110b0565b905090565b60606109d460066110b0565b6109ed610d7a565b6109f6816110bd565b50565b67ffffffffffffffff811660009081526002602090815260408083208151808301909252547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff811682527c0100000000000000000000000000000000000000000000000000000000900463ffffffff1691810182905282918203610ab1576040517f2e59db3a00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff85166004820152602401610931565b6000816020015163ffffffff1642610ac991906119fe565b90507f000000000000000000000000000000000000000000000000000000000000000063ffffffff16811115610b6a576040517ff08bcb3e00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff8616600482015263ffffffff7f000000000000000000000000000000000000000000000000000000000000000016602482015260448101829052606401610931565b610b7386610b84565b9151919350909150505b9250929050565b73ffffffffffffffffffffffffffffffffffffffff811660009081526003602090815260408083208151808301909252547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff811682527c0100000000000000000000000000000000000000000000000000000000900463ffffffff16918101829052901580610c2c575080517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff16155b15610c7b576040517f06439c6b00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff84166004820152602401610931565b6000816020015163ffffffff1642610c9391906119fe565b90507f000000000000000000000000000000000000000000000000000000000000000063ffffffff16811115610d40576040517fc65fdfca00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8516600482015263ffffffff7f000000000000000000000000000000000000000000000000000000000000000016602482015260448101829052606401610931565b505192915050565b73ffffffffffffffffffffffffffffffffffffffff8116600090815260018301602052604081205415155b9392505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314610dfb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e6572000000000000000000006044820152606401610931565b565b60005b8251811015610ea857610e36838281518110610e1e57610e1e61190b565b602002602001015160046111b290919063ffffffff16565b15610e9857828181518110610e4d57610e4d61190b565b602002602001015173ffffffffffffffffffffffffffffffffffffffff167f34a02290b7920078c19f58e94b78c77eb9cc10195b20676e19bd3b82085893b860405160405180910390a25b610ea1816119a3565b9050610e00565b5060005b8151811015610f5457610ee2828281518110610eca57610eca61190b565b602002602001015160046111d490919063ffffffff16565b15610f4457818181518110610ef957610ef961190b565b602002602001015173ffffffffffffffffffffffffffffffffffffffff167fff7dbb85c77ca68ca1f894d6498570e3d5095cd19466f07ee8d222b337e4068c60405160405180910390a25b610f4d816119a3565b9050610eac565b505050565b60005b825181101561100457610f92838281518110610f7a57610f7a61190b565b602002602001015160066111b290919063ffffffff16565b15610ff457828181518110610fa957610fa961190b565b602002602001015173ffffffffffffffffffffffffffffffffffffffff167fdf1b1bd32a69711488d71554706bb130b1fc63a5fa1a2cd85e8440f84065ba2360405160405180910390a25b610ffd816119a3565b9050610f5c565b5060005b8151811015610f545761103e8282815181106110265761102661190b565b602002602001015160066111d490919063ffffffff16565b156110a0578181815181106110555761105561190b565b602002602001015173ffffffffffffffffffffffffffffffffffffffff167f1795838dc8ab2ffc5f431a1729a6afa0b587f982f7b2be0b9d7187a1ef547f9160405160405180910390a25b6110a9816119a3565b9050611008565b60606000610d73836111f6565b3373ffffffffffffffffffffffffffffffffffffffff82160361113c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c660000000000000000006044820152606401610931565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b6000610d738373ffffffffffffffffffffffffffffffffffffffff8416611252565b6000610d738373ffffffffffffffffffffffffffffffffffffffff84166112a1565b60608160000180548060200260200160405190810160405280929190818152602001828054801561124657602002820191906000526020600020905b815481526020019060010190808311611232575b50505050509050919050565b60008181526001830160205260408120546112995750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915561088d565b50600061088d565b6000818152600183016020526040812054801561138a5760006112c56001836119fe565b85549091506000906112d9906001906119fe565b905081811461133e5760008660000182815481106112f9576112f961190b565b906000526020600020015490508087600001848154811061131c5761131c61190b565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061134f5761134f611a11565b60019003818190600052602060002001600090559055856001016000868152602001908152602001600020600090556001935050505061088d565b600091505061088d565b803573ffffffffffffffffffffffffffffffffffffffff811681146113b857600080fd5b919050565b6000806000606084860312156113d257600080fd5b6113db84611394565b9250602084013591506113f060408501611394565b90509250925092565b600060208083528351808285015260005b818110156114265785810183015185820160400152820161140a565b5060006040828601015260407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8301168501019250505092915050565b60006020828403121561147757600080fd5b813567ffffffffffffffff81111561148e57600080fd5b820160408185031215610d7357600080fd5b600080602083850312156114b357600080fd5b823567ffffffffffffffff808211156114cb57600080fd5b818501915085601f8301126114df57600080fd5b8135818111156114ee57600080fd5b8660208260051b850101111561150357600080fd5b60209290920196919550909350505050565b602080825282518282018190526000919060409081850190868401855b828110156115835761157384835180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff16825260209081015163ffffffff16910152565b9284019290850190600101611532565b5091979650505050505050565b6000602082840312156115a257600080fd5b610d7382611394565b803567ffffffffffffffff811681146113b857600080fd5b6000602082840312156115d557600080fd5b610d73826115ab565b81517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff16815260208083015163ffffffff16908201526040810161088d565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040805190810167ffffffffffffffff8111828210171561166b5761166b611619565b60405290565b600082601f83011261168257600080fd5b8135602067ffffffffffffffff8083111561169f5761169f611619565b8260051b6040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0603f830116810181811084821117156116e2576116e2611619565b60405293845285810183019383810192508785111561170057600080fd5b83870191505b848210156117265761171782611394565b83529183019190830190611706565b979650505050505050565b6000806040838503121561174457600080fd5b823567ffffffffffffffff8082111561175c57600080fd5b61176886838701611671565b9350602085013591508082111561177e57600080fd5b5061178b85828601611671565b9150509250929050565b6020808252825182820181905260009190848201906040850190845b818110156117e357835173ffffffffffffffffffffffffffffffffffffffff16835292840192918401916001016117b1565b50909695505050505050565b6000806040838503121561180257600080fd5b61180b83611394565b9150611819602084016115ab565b90509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b808202811582820484141761088d5761088d611822565b60008261189e577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe18436030181126118d857600080fd5b83018035915067ffffffffffffffff8211156118f357600080fd5b6020019150600681901b3603821315610b7d57600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b80357bffffffffffffffffffffffffffffffffffffffffffffffffffffffff811681146113b857600080fd5b60006040828403121561197857600080fd5b611980611648565b61198983611394565b81526119976020840161193a565b60208201529392505050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036119d4576119d4611822565b5060010190565b6000604082840312156119ed57600080fd5b6119f5611648565b611989836115ab565b8181038181111561088d5761088d611822565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fdfea164736f6c6343000813000a", +} + +var PriceRegistryABI = PriceRegistryMetaData.ABI + +var PriceRegistryBin = PriceRegistryMetaData.Bin + +func DeployPriceRegistry(auth *bind.TransactOpts, backend bind.ContractBackend, priceUpdaters []common.Address, feeTokens []common.Address, stalenessThreshold uint32) (common.Address, *types.Transaction, *PriceRegistry, error) { + parsed, err := PriceRegistryMetaData.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(PriceRegistryBin), backend, priceUpdaters, feeTokens, stalenessThreshold) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &PriceRegistry{address: address, abi: *parsed, PriceRegistryCaller: PriceRegistryCaller{contract: contract}, PriceRegistryTransactor: PriceRegistryTransactor{contract: contract}, PriceRegistryFilterer: PriceRegistryFilterer{contract: contract}}, nil +} + +type PriceRegistry struct { + address common.Address + abi abi.ABI + PriceRegistryCaller + PriceRegistryTransactor + PriceRegistryFilterer +} + +type PriceRegistryCaller struct { + contract *bind.BoundContract +} + +type PriceRegistryTransactor struct { + contract *bind.BoundContract +} + +type PriceRegistryFilterer struct { + contract *bind.BoundContract +} + +type PriceRegistrySession struct { + Contract *PriceRegistry + CallOpts bind.CallOpts + TransactOpts bind.TransactOpts +} + +type PriceRegistryCallerSession struct { + Contract *PriceRegistryCaller + CallOpts bind.CallOpts +} + +type PriceRegistryTransactorSession struct { + Contract *PriceRegistryTransactor + TransactOpts bind.TransactOpts +} + +type PriceRegistryRaw struct { + Contract *PriceRegistry +} + +type PriceRegistryCallerRaw struct { + Contract *PriceRegistryCaller +} + +type PriceRegistryTransactorRaw struct { + Contract *PriceRegistryTransactor +} + +func NewPriceRegistry(address common.Address, backend bind.ContractBackend) (*PriceRegistry, error) { + abi, err := abi.JSON(strings.NewReader(PriceRegistryABI)) + if err != nil { + return nil, err + } + contract, err := bindPriceRegistry(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &PriceRegistry{address: address, abi: abi, PriceRegistryCaller: PriceRegistryCaller{contract: contract}, PriceRegistryTransactor: PriceRegistryTransactor{contract: contract}, PriceRegistryFilterer: PriceRegistryFilterer{contract: contract}}, nil +} + +func NewPriceRegistryCaller(address common.Address, caller bind.ContractCaller) (*PriceRegistryCaller, error) { + contract, err := bindPriceRegistry(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &PriceRegistryCaller{contract: contract}, nil +} + +func NewPriceRegistryTransactor(address common.Address, transactor bind.ContractTransactor) (*PriceRegistryTransactor, error) { + contract, err := bindPriceRegistry(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &PriceRegistryTransactor{contract: contract}, nil +} + +func NewPriceRegistryFilterer(address common.Address, filterer bind.ContractFilterer) (*PriceRegistryFilterer, error) { + contract, err := bindPriceRegistry(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &PriceRegistryFilterer{contract: contract}, nil +} + +func bindPriceRegistry(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := PriceRegistryMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +func (_PriceRegistry *PriceRegistryRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _PriceRegistry.Contract.PriceRegistryCaller.contract.Call(opts, result, method, params...) +} + +func (_PriceRegistry *PriceRegistryRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _PriceRegistry.Contract.PriceRegistryTransactor.contract.Transfer(opts) +} + +func (_PriceRegistry *PriceRegistryRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _PriceRegistry.Contract.PriceRegistryTransactor.contract.Transact(opts, method, params...) +} + +func (_PriceRegistry *PriceRegistryCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _PriceRegistry.Contract.contract.Call(opts, result, method, params...) +} + +func (_PriceRegistry *PriceRegistryTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _PriceRegistry.Contract.contract.Transfer(opts) +} + +func (_PriceRegistry *PriceRegistryTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _PriceRegistry.Contract.contract.Transact(opts, method, params...) +} + +func (_PriceRegistry *PriceRegistryCaller) ConvertTokenAmount(opts *bind.CallOpts, fromToken common.Address, fromTokenAmount *big.Int, toToken common.Address) (*big.Int, error) { + var out []interface{} + err := _PriceRegistry.contract.Call(opts, &out, "convertTokenAmount", fromToken, fromTokenAmount, toToken) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_PriceRegistry *PriceRegistrySession) ConvertTokenAmount(fromToken common.Address, fromTokenAmount *big.Int, toToken common.Address) (*big.Int, error) { + return _PriceRegistry.Contract.ConvertTokenAmount(&_PriceRegistry.CallOpts, fromToken, fromTokenAmount, toToken) +} + +func (_PriceRegistry *PriceRegistryCallerSession) ConvertTokenAmount(fromToken common.Address, fromTokenAmount *big.Int, toToken common.Address) (*big.Int, error) { + return _PriceRegistry.Contract.ConvertTokenAmount(&_PriceRegistry.CallOpts, fromToken, fromTokenAmount, toToken) +} + +func (_PriceRegistry *PriceRegistryCaller) GetDestinationChainGasPrice(opts *bind.CallOpts, destChainSelector uint64) (InternalTimestampedPackedUint224, error) { + var out []interface{} + err := _PriceRegistry.contract.Call(opts, &out, "getDestinationChainGasPrice", destChainSelector) + + if err != nil { + return *new(InternalTimestampedPackedUint224), err + } + + out0 := *abi.ConvertType(out[0], new(InternalTimestampedPackedUint224)).(*InternalTimestampedPackedUint224) + + return out0, err + +} + +func (_PriceRegistry *PriceRegistrySession) GetDestinationChainGasPrice(destChainSelector uint64) (InternalTimestampedPackedUint224, error) { + return _PriceRegistry.Contract.GetDestinationChainGasPrice(&_PriceRegistry.CallOpts, destChainSelector) +} + +func (_PriceRegistry *PriceRegistryCallerSession) GetDestinationChainGasPrice(destChainSelector uint64) (InternalTimestampedPackedUint224, error) { + return _PriceRegistry.Contract.GetDestinationChainGasPrice(&_PriceRegistry.CallOpts, destChainSelector) +} + +func (_PriceRegistry *PriceRegistryCaller) GetFeeTokens(opts *bind.CallOpts) ([]common.Address, error) { + var out []interface{} + err := _PriceRegistry.contract.Call(opts, &out, "getFeeTokens") + + if err != nil { + return *new([]common.Address), err + } + + out0 := *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) + + return out0, err + +} + +func (_PriceRegistry *PriceRegistrySession) GetFeeTokens() ([]common.Address, error) { + return _PriceRegistry.Contract.GetFeeTokens(&_PriceRegistry.CallOpts) +} + +func (_PriceRegistry *PriceRegistryCallerSession) GetFeeTokens() ([]common.Address, error) { + return _PriceRegistry.Contract.GetFeeTokens(&_PriceRegistry.CallOpts) +} + +func (_PriceRegistry *PriceRegistryCaller) GetPriceUpdaters(opts *bind.CallOpts) ([]common.Address, error) { + var out []interface{} + err := _PriceRegistry.contract.Call(opts, &out, "getPriceUpdaters") + + if err != nil { + return *new([]common.Address), err + } + + out0 := *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) + + return out0, err + +} + +func (_PriceRegistry *PriceRegistrySession) GetPriceUpdaters() ([]common.Address, error) { + return _PriceRegistry.Contract.GetPriceUpdaters(&_PriceRegistry.CallOpts) +} + +func (_PriceRegistry *PriceRegistryCallerSession) GetPriceUpdaters() ([]common.Address, error) { + return _PriceRegistry.Contract.GetPriceUpdaters(&_PriceRegistry.CallOpts) +} + +func (_PriceRegistry *PriceRegistryCaller) GetStalenessThreshold(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _PriceRegistry.contract.Call(opts, &out, "getStalenessThreshold") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_PriceRegistry *PriceRegistrySession) GetStalenessThreshold() (*big.Int, error) { + return _PriceRegistry.Contract.GetStalenessThreshold(&_PriceRegistry.CallOpts) +} + +func (_PriceRegistry *PriceRegistryCallerSession) GetStalenessThreshold() (*big.Int, error) { + return _PriceRegistry.Contract.GetStalenessThreshold(&_PriceRegistry.CallOpts) +} + +func (_PriceRegistry *PriceRegistryCaller) GetTokenAndGasPrices(opts *bind.CallOpts, token common.Address, destChainSelector uint64) (GetTokenAndGasPrices, + + error) { + var out []interface{} + err := _PriceRegistry.contract.Call(opts, &out, "getTokenAndGasPrices", token, destChainSelector) + + outstruct := new(GetTokenAndGasPrices) + if err != nil { + return *outstruct, err + } + + outstruct.TokenPrice = *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + outstruct.GasPriceValue = *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) + + return *outstruct, err + +} + +func (_PriceRegistry *PriceRegistrySession) GetTokenAndGasPrices(token common.Address, destChainSelector uint64) (GetTokenAndGasPrices, + + error) { + return _PriceRegistry.Contract.GetTokenAndGasPrices(&_PriceRegistry.CallOpts, token, destChainSelector) +} + +func (_PriceRegistry *PriceRegistryCallerSession) GetTokenAndGasPrices(token common.Address, destChainSelector uint64) (GetTokenAndGasPrices, + + error) { + return _PriceRegistry.Contract.GetTokenAndGasPrices(&_PriceRegistry.CallOpts, token, destChainSelector) +} + +func (_PriceRegistry *PriceRegistryCaller) GetTokenPrice(opts *bind.CallOpts, token common.Address) (InternalTimestampedPackedUint224, error) { + var out []interface{} + err := _PriceRegistry.contract.Call(opts, &out, "getTokenPrice", token) + + if err != nil { + return *new(InternalTimestampedPackedUint224), err + } + + out0 := *abi.ConvertType(out[0], new(InternalTimestampedPackedUint224)).(*InternalTimestampedPackedUint224) + + return out0, err + +} + +func (_PriceRegistry *PriceRegistrySession) GetTokenPrice(token common.Address) (InternalTimestampedPackedUint224, error) { + return _PriceRegistry.Contract.GetTokenPrice(&_PriceRegistry.CallOpts, token) +} + +func (_PriceRegistry *PriceRegistryCallerSession) GetTokenPrice(token common.Address) (InternalTimestampedPackedUint224, error) { + return _PriceRegistry.Contract.GetTokenPrice(&_PriceRegistry.CallOpts, token) +} + +func (_PriceRegistry *PriceRegistryCaller) GetTokenPrices(opts *bind.CallOpts, tokens []common.Address) ([]InternalTimestampedPackedUint224, error) { + var out []interface{} + err := _PriceRegistry.contract.Call(opts, &out, "getTokenPrices", tokens) + + if err != nil { + return *new([]InternalTimestampedPackedUint224), err + } + + out0 := *abi.ConvertType(out[0], new([]InternalTimestampedPackedUint224)).(*[]InternalTimestampedPackedUint224) + + return out0, err + +} + +func (_PriceRegistry *PriceRegistrySession) GetTokenPrices(tokens []common.Address) ([]InternalTimestampedPackedUint224, error) { + return _PriceRegistry.Contract.GetTokenPrices(&_PriceRegistry.CallOpts, tokens) +} + +func (_PriceRegistry *PriceRegistryCallerSession) GetTokenPrices(tokens []common.Address) ([]InternalTimestampedPackedUint224, error) { + return _PriceRegistry.Contract.GetTokenPrices(&_PriceRegistry.CallOpts, tokens) +} + +func (_PriceRegistry *PriceRegistryCaller) GetValidatedTokenPrice(opts *bind.CallOpts, token common.Address) (*big.Int, error) { + var out []interface{} + err := _PriceRegistry.contract.Call(opts, &out, "getValidatedTokenPrice", token) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_PriceRegistry *PriceRegistrySession) GetValidatedTokenPrice(token common.Address) (*big.Int, error) { + return _PriceRegistry.Contract.GetValidatedTokenPrice(&_PriceRegistry.CallOpts, token) +} + +func (_PriceRegistry *PriceRegistryCallerSession) GetValidatedTokenPrice(token common.Address) (*big.Int, error) { + return _PriceRegistry.Contract.GetValidatedTokenPrice(&_PriceRegistry.CallOpts, token) +} + +func (_PriceRegistry *PriceRegistryCaller) Owner(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _PriceRegistry.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 + +} + +func (_PriceRegistry *PriceRegistrySession) Owner() (common.Address, error) { + return _PriceRegistry.Contract.Owner(&_PriceRegistry.CallOpts) +} + +func (_PriceRegistry *PriceRegistryCallerSession) Owner() (common.Address, error) { + return _PriceRegistry.Contract.Owner(&_PriceRegistry.CallOpts) +} + +func (_PriceRegistry *PriceRegistryCaller) TypeAndVersion(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _PriceRegistry.contract.Call(opts, &out, "typeAndVersion") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +func (_PriceRegistry *PriceRegistrySession) TypeAndVersion() (string, error) { + return _PriceRegistry.Contract.TypeAndVersion(&_PriceRegistry.CallOpts) +} + +func (_PriceRegistry *PriceRegistryCallerSession) TypeAndVersion() (string, error) { + return _PriceRegistry.Contract.TypeAndVersion(&_PriceRegistry.CallOpts) +} + +func (_PriceRegistry *PriceRegistryTransactor) AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + return _PriceRegistry.contract.Transact(opts, "acceptOwnership") +} + +func (_PriceRegistry *PriceRegistrySession) AcceptOwnership() (*types.Transaction, error) { + return _PriceRegistry.Contract.AcceptOwnership(&_PriceRegistry.TransactOpts) +} + +func (_PriceRegistry *PriceRegistryTransactorSession) AcceptOwnership() (*types.Transaction, error) { + return _PriceRegistry.Contract.AcceptOwnership(&_PriceRegistry.TransactOpts) +} + +func (_PriceRegistry *PriceRegistryTransactor) ApplyFeeTokensUpdates(opts *bind.TransactOpts, feeTokensToAdd []common.Address, feeTokensToRemove []common.Address) (*types.Transaction, error) { + return _PriceRegistry.contract.Transact(opts, "applyFeeTokensUpdates", feeTokensToAdd, feeTokensToRemove) +} + +func (_PriceRegistry *PriceRegistrySession) ApplyFeeTokensUpdates(feeTokensToAdd []common.Address, feeTokensToRemove []common.Address) (*types.Transaction, error) { + return _PriceRegistry.Contract.ApplyFeeTokensUpdates(&_PriceRegistry.TransactOpts, feeTokensToAdd, feeTokensToRemove) +} + +func (_PriceRegistry *PriceRegistryTransactorSession) ApplyFeeTokensUpdates(feeTokensToAdd []common.Address, feeTokensToRemove []common.Address) (*types.Transaction, error) { + return _PriceRegistry.Contract.ApplyFeeTokensUpdates(&_PriceRegistry.TransactOpts, feeTokensToAdd, feeTokensToRemove) +} + +func (_PriceRegistry *PriceRegistryTransactor) ApplyPriceUpdatersUpdates(opts *bind.TransactOpts, priceUpdatersToAdd []common.Address, priceUpdatersToRemove []common.Address) (*types.Transaction, error) { + return _PriceRegistry.contract.Transact(opts, "applyPriceUpdatersUpdates", priceUpdatersToAdd, priceUpdatersToRemove) +} + +func (_PriceRegistry *PriceRegistrySession) ApplyPriceUpdatersUpdates(priceUpdatersToAdd []common.Address, priceUpdatersToRemove []common.Address) (*types.Transaction, error) { + return _PriceRegistry.Contract.ApplyPriceUpdatersUpdates(&_PriceRegistry.TransactOpts, priceUpdatersToAdd, priceUpdatersToRemove) +} + +func (_PriceRegistry *PriceRegistryTransactorSession) ApplyPriceUpdatersUpdates(priceUpdatersToAdd []common.Address, priceUpdatersToRemove []common.Address) (*types.Transaction, error) { + return _PriceRegistry.Contract.ApplyPriceUpdatersUpdates(&_PriceRegistry.TransactOpts, priceUpdatersToAdd, priceUpdatersToRemove) +} + +func (_PriceRegistry *PriceRegistryTransactor) TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) { + return _PriceRegistry.contract.Transact(opts, "transferOwnership", to) +} + +func (_PriceRegistry *PriceRegistrySession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _PriceRegistry.Contract.TransferOwnership(&_PriceRegistry.TransactOpts, to) +} + +func (_PriceRegistry *PriceRegistryTransactorSession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _PriceRegistry.Contract.TransferOwnership(&_PriceRegistry.TransactOpts, to) +} + +func (_PriceRegistry *PriceRegistryTransactor) UpdatePrices(opts *bind.TransactOpts, priceUpdates InternalPriceUpdates) (*types.Transaction, error) { + return _PriceRegistry.contract.Transact(opts, "updatePrices", priceUpdates) +} + +func (_PriceRegistry *PriceRegistrySession) UpdatePrices(priceUpdates InternalPriceUpdates) (*types.Transaction, error) { + return _PriceRegistry.Contract.UpdatePrices(&_PriceRegistry.TransactOpts, priceUpdates) +} + +func (_PriceRegistry *PriceRegistryTransactorSession) UpdatePrices(priceUpdates InternalPriceUpdates) (*types.Transaction, error) { + return _PriceRegistry.Contract.UpdatePrices(&_PriceRegistry.TransactOpts, priceUpdates) +} + +type PriceRegistryFeeTokenAddedIterator struct { + Event *PriceRegistryFeeTokenAdded + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *PriceRegistryFeeTokenAddedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(PriceRegistryFeeTokenAdded) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(PriceRegistryFeeTokenAdded) + 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() + } +} + +func (it *PriceRegistryFeeTokenAddedIterator) Error() error { + return it.fail +} + +func (it *PriceRegistryFeeTokenAddedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type PriceRegistryFeeTokenAdded struct { + FeeToken common.Address + Raw types.Log +} + +func (_PriceRegistry *PriceRegistryFilterer) FilterFeeTokenAdded(opts *bind.FilterOpts, feeToken []common.Address) (*PriceRegistryFeeTokenAddedIterator, error) { + + var feeTokenRule []interface{} + for _, feeTokenItem := range feeToken { + feeTokenRule = append(feeTokenRule, feeTokenItem) + } + + logs, sub, err := _PriceRegistry.contract.FilterLogs(opts, "FeeTokenAdded", feeTokenRule) + if err != nil { + return nil, err + } + return &PriceRegistryFeeTokenAddedIterator{contract: _PriceRegistry.contract, event: "FeeTokenAdded", logs: logs, sub: sub}, nil +} + +func (_PriceRegistry *PriceRegistryFilterer) WatchFeeTokenAdded(opts *bind.WatchOpts, sink chan<- *PriceRegistryFeeTokenAdded, feeToken []common.Address) (event.Subscription, error) { + + var feeTokenRule []interface{} + for _, feeTokenItem := range feeToken { + feeTokenRule = append(feeTokenRule, feeTokenItem) + } + + logs, sub, err := _PriceRegistry.contract.WatchLogs(opts, "FeeTokenAdded", feeTokenRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(PriceRegistryFeeTokenAdded) + if err := _PriceRegistry.contract.UnpackLog(event, "FeeTokenAdded", 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 +} + +func (_PriceRegistry *PriceRegistryFilterer) ParseFeeTokenAdded(log types.Log) (*PriceRegistryFeeTokenAdded, error) { + event := new(PriceRegistryFeeTokenAdded) + if err := _PriceRegistry.contract.UnpackLog(event, "FeeTokenAdded", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type PriceRegistryFeeTokenRemovedIterator struct { + Event *PriceRegistryFeeTokenRemoved + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *PriceRegistryFeeTokenRemovedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(PriceRegistryFeeTokenRemoved) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(PriceRegistryFeeTokenRemoved) + 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() + } +} + +func (it *PriceRegistryFeeTokenRemovedIterator) Error() error { + return it.fail +} + +func (it *PriceRegistryFeeTokenRemovedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type PriceRegistryFeeTokenRemoved struct { + FeeToken common.Address + Raw types.Log +} + +func (_PriceRegistry *PriceRegistryFilterer) FilterFeeTokenRemoved(opts *bind.FilterOpts, feeToken []common.Address) (*PriceRegistryFeeTokenRemovedIterator, error) { + + var feeTokenRule []interface{} + for _, feeTokenItem := range feeToken { + feeTokenRule = append(feeTokenRule, feeTokenItem) + } + + logs, sub, err := _PriceRegistry.contract.FilterLogs(opts, "FeeTokenRemoved", feeTokenRule) + if err != nil { + return nil, err + } + return &PriceRegistryFeeTokenRemovedIterator{contract: _PriceRegistry.contract, event: "FeeTokenRemoved", logs: logs, sub: sub}, nil +} + +func (_PriceRegistry *PriceRegistryFilterer) WatchFeeTokenRemoved(opts *bind.WatchOpts, sink chan<- *PriceRegistryFeeTokenRemoved, feeToken []common.Address) (event.Subscription, error) { + + var feeTokenRule []interface{} + for _, feeTokenItem := range feeToken { + feeTokenRule = append(feeTokenRule, feeTokenItem) + } + + logs, sub, err := _PriceRegistry.contract.WatchLogs(opts, "FeeTokenRemoved", feeTokenRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(PriceRegistryFeeTokenRemoved) + if err := _PriceRegistry.contract.UnpackLog(event, "FeeTokenRemoved", 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 +} + +func (_PriceRegistry *PriceRegistryFilterer) ParseFeeTokenRemoved(log types.Log) (*PriceRegistryFeeTokenRemoved, error) { + event := new(PriceRegistryFeeTokenRemoved) + if err := _PriceRegistry.contract.UnpackLog(event, "FeeTokenRemoved", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type PriceRegistryOwnershipTransferRequestedIterator struct { + Event *PriceRegistryOwnershipTransferRequested + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *PriceRegistryOwnershipTransferRequestedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(PriceRegistryOwnershipTransferRequested) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(PriceRegistryOwnershipTransferRequested) + 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() + } +} + +func (it *PriceRegistryOwnershipTransferRequestedIterator) Error() error { + return it.fail +} + +func (it *PriceRegistryOwnershipTransferRequestedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type PriceRegistryOwnershipTransferRequested struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_PriceRegistry *PriceRegistryFilterer) FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*PriceRegistryOwnershipTransferRequestedIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _PriceRegistry.contract.FilterLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return &PriceRegistryOwnershipTransferRequestedIterator{contract: _PriceRegistry.contract, event: "OwnershipTransferRequested", logs: logs, sub: sub}, nil +} + +func (_PriceRegistry *PriceRegistryFilterer) WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *PriceRegistryOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _PriceRegistry.contract.WatchLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(PriceRegistryOwnershipTransferRequested) + if err := _PriceRegistry.contract.UnpackLog(event, "OwnershipTransferRequested", 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 +} + +func (_PriceRegistry *PriceRegistryFilterer) ParseOwnershipTransferRequested(log types.Log) (*PriceRegistryOwnershipTransferRequested, error) { + event := new(PriceRegistryOwnershipTransferRequested) + if err := _PriceRegistry.contract.UnpackLog(event, "OwnershipTransferRequested", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type PriceRegistryOwnershipTransferredIterator struct { + Event *PriceRegistryOwnershipTransferred + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *PriceRegistryOwnershipTransferredIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(PriceRegistryOwnershipTransferred) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(PriceRegistryOwnershipTransferred) + 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() + } +} + +func (it *PriceRegistryOwnershipTransferredIterator) Error() error { + return it.fail +} + +func (it *PriceRegistryOwnershipTransferredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type PriceRegistryOwnershipTransferred struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_PriceRegistry *PriceRegistryFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*PriceRegistryOwnershipTransferredIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _PriceRegistry.contract.FilterLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return &PriceRegistryOwnershipTransferredIterator{contract: _PriceRegistry.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil +} + +func (_PriceRegistry *PriceRegistryFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *PriceRegistryOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _PriceRegistry.contract.WatchLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(PriceRegistryOwnershipTransferred) + if err := _PriceRegistry.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 +} + +func (_PriceRegistry *PriceRegistryFilterer) ParseOwnershipTransferred(log types.Log) (*PriceRegistryOwnershipTransferred, error) { + event := new(PriceRegistryOwnershipTransferred) + if err := _PriceRegistry.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type PriceRegistryPriceUpdaterRemovedIterator struct { + Event *PriceRegistryPriceUpdaterRemoved + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *PriceRegistryPriceUpdaterRemovedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(PriceRegistryPriceUpdaterRemoved) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(PriceRegistryPriceUpdaterRemoved) + 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() + } +} + +func (it *PriceRegistryPriceUpdaterRemovedIterator) Error() error { + return it.fail +} + +func (it *PriceRegistryPriceUpdaterRemovedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type PriceRegistryPriceUpdaterRemoved struct { + PriceUpdater common.Address + Raw types.Log +} + +func (_PriceRegistry *PriceRegistryFilterer) FilterPriceUpdaterRemoved(opts *bind.FilterOpts, priceUpdater []common.Address) (*PriceRegistryPriceUpdaterRemovedIterator, error) { + + var priceUpdaterRule []interface{} + for _, priceUpdaterItem := range priceUpdater { + priceUpdaterRule = append(priceUpdaterRule, priceUpdaterItem) + } + + logs, sub, err := _PriceRegistry.contract.FilterLogs(opts, "PriceUpdaterRemoved", priceUpdaterRule) + if err != nil { + return nil, err + } + return &PriceRegistryPriceUpdaterRemovedIterator{contract: _PriceRegistry.contract, event: "PriceUpdaterRemoved", logs: logs, sub: sub}, nil +} + +func (_PriceRegistry *PriceRegistryFilterer) WatchPriceUpdaterRemoved(opts *bind.WatchOpts, sink chan<- *PriceRegistryPriceUpdaterRemoved, priceUpdater []common.Address) (event.Subscription, error) { + + var priceUpdaterRule []interface{} + for _, priceUpdaterItem := range priceUpdater { + priceUpdaterRule = append(priceUpdaterRule, priceUpdaterItem) + } + + logs, sub, err := _PriceRegistry.contract.WatchLogs(opts, "PriceUpdaterRemoved", priceUpdaterRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(PriceRegistryPriceUpdaterRemoved) + if err := _PriceRegistry.contract.UnpackLog(event, "PriceUpdaterRemoved", 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 +} + +func (_PriceRegistry *PriceRegistryFilterer) ParsePriceUpdaterRemoved(log types.Log) (*PriceRegistryPriceUpdaterRemoved, error) { + event := new(PriceRegistryPriceUpdaterRemoved) + if err := _PriceRegistry.contract.UnpackLog(event, "PriceUpdaterRemoved", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type PriceRegistryPriceUpdaterSetIterator struct { + Event *PriceRegistryPriceUpdaterSet + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *PriceRegistryPriceUpdaterSetIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(PriceRegistryPriceUpdaterSet) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(PriceRegistryPriceUpdaterSet) + 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() + } +} + +func (it *PriceRegistryPriceUpdaterSetIterator) Error() error { + return it.fail +} + +func (it *PriceRegistryPriceUpdaterSetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type PriceRegistryPriceUpdaterSet struct { + PriceUpdater common.Address + Raw types.Log +} + +func (_PriceRegistry *PriceRegistryFilterer) FilterPriceUpdaterSet(opts *bind.FilterOpts, priceUpdater []common.Address) (*PriceRegistryPriceUpdaterSetIterator, error) { + + var priceUpdaterRule []interface{} + for _, priceUpdaterItem := range priceUpdater { + priceUpdaterRule = append(priceUpdaterRule, priceUpdaterItem) + } + + logs, sub, err := _PriceRegistry.contract.FilterLogs(opts, "PriceUpdaterSet", priceUpdaterRule) + if err != nil { + return nil, err + } + return &PriceRegistryPriceUpdaterSetIterator{contract: _PriceRegistry.contract, event: "PriceUpdaterSet", logs: logs, sub: sub}, nil +} + +func (_PriceRegistry *PriceRegistryFilterer) WatchPriceUpdaterSet(opts *bind.WatchOpts, sink chan<- *PriceRegistryPriceUpdaterSet, priceUpdater []common.Address) (event.Subscription, error) { + + var priceUpdaterRule []interface{} + for _, priceUpdaterItem := range priceUpdater { + priceUpdaterRule = append(priceUpdaterRule, priceUpdaterItem) + } + + logs, sub, err := _PriceRegistry.contract.WatchLogs(opts, "PriceUpdaterSet", priceUpdaterRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(PriceRegistryPriceUpdaterSet) + if err := _PriceRegistry.contract.UnpackLog(event, "PriceUpdaterSet", 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 +} + +func (_PriceRegistry *PriceRegistryFilterer) ParsePriceUpdaterSet(log types.Log) (*PriceRegistryPriceUpdaterSet, error) { + event := new(PriceRegistryPriceUpdaterSet) + if err := _PriceRegistry.contract.UnpackLog(event, "PriceUpdaterSet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type PriceRegistryUsdPerTokenUpdatedIterator struct { + Event *PriceRegistryUsdPerTokenUpdated + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *PriceRegistryUsdPerTokenUpdatedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(PriceRegistryUsdPerTokenUpdated) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(PriceRegistryUsdPerTokenUpdated) + 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() + } +} + +func (it *PriceRegistryUsdPerTokenUpdatedIterator) Error() error { + return it.fail +} + +func (it *PriceRegistryUsdPerTokenUpdatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type PriceRegistryUsdPerTokenUpdated struct { + Token common.Address + Value *big.Int + Timestamp *big.Int + Raw types.Log +} + +func (_PriceRegistry *PriceRegistryFilterer) FilterUsdPerTokenUpdated(opts *bind.FilterOpts, token []common.Address) (*PriceRegistryUsdPerTokenUpdatedIterator, error) { + + var tokenRule []interface{} + for _, tokenItem := range token { + tokenRule = append(tokenRule, tokenItem) + } + + logs, sub, err := _PriceRegistry.contract.FilterLogs(opts, "UsdPerTokenUpdated", tokenRule) + if err != nil { + return nil, err + } + return &PriceRegistryUsdPerTokenUpdatedIterator{contract: _PriceRegistry.contract, event: "UsdPerTokenUpdated", logs: logs, sub: sub}, nil +} + +func (_PriceRegistry *PriceRegistryFilterer) WatchUsdPerTokenUpdated(opts *bind.WatchOpts, sink chan<- *PriceRegistryUsdPerTokenUpdated, token []common.Address) (event.Subscription, error) { + + var tokenRule []interface{} + for _, tokenItem := range token { + tokenRule = append(tokenRule, tokenItem) + } + + logs, sub, err := _PriceRegistry.contract.WatchLogs(opts, "UsdPerTokenUpdated", tokenRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(PriceRegistryUsdPerTokenUpdated) + if err := _PriceRegistry.contract.UnpackLog(event, "UsdPerTokenUpdated", 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 +} + +func (_PriceRegistry *PriceRegistryFilterer) ParseUsdPerTokenUpdated(log types.Log) (*PriceRegistryUsdPerTokenUpdated, error) { + event := new(PriceRegistryUsdPerTokenUpdated) + if err := _PriceRegistry.contract.UnpackLog(event, "UsdPerTokenUpdated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type PriceRegistryUsdPerUnitGasUpdatedIterator struct { + Event *PriceRegistryUsdPerUnitGasUpdated + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *PriceRegistryUsdPerUnitGasUpdatedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(PriceRegistryUsdPerUnitGasUpdated) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(PriceRegistryUsdPerUnitGasUpdated) + 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() + } +} + +func (it *PriceRegistryUsdPerUnitGasUpdatedIterator) Error() error { + return it.fail +} + +func (it *PriceRegistryUsdPerUnitGasUpdatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type PriceRegistryUsdPerUnitGasUpdated struct { + DestChain uint64 + Value *big.Int + Timestamp *big.Int + Raw types.Log +} + +func (_PriceRegistry *PriceRegistryFilterer) FilterUsdPerUnitGasUpdated(opts *bind.FilterOpts, destChain []uint64) (*PriceRegistryUsdPerUnitGasUpdatedIterator, error) { + + var destChainRule []interface{} + for _, destChainItem := range destChain { + destChainRule = append(destChainRule, destChainItem) + } + + logs, sub, err := _PriceRegistry.contract.FilterLogs(opts, "UsdPerUnitGasUpdated", destChainRule) + if err != nil { + return nil, err + } + return &PriceRegistryUsdPerUnitGasUpdatedIterator{contract: _PriceRegistry.contract, event: "UsdPerUnitGasUpdated", logs: logs, sub: sub}, nil +} + +func (_PriceRegistry *PriceRegistryFilterer) WatchUsdPerUnitGasUpdated(opts *bind.WatchOpts, sink chan<- *PriceRegistryUsdPerUnitGasUpdated, destChain []uint64) (event.Subscription, error) { + + var destChainRule []interface{} + for _, destChainItem := range destChain { + destChainRule = append(destChainRule, destChainItem) + } + + logs, sub, err := _PriceRegistry.contract.WatchLogs(opts, "UsdPerUnitGasUpdated", destChainRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(PriceRegistryUsdPerUnitGasUpdated) + if err := _PriceRegistry.contract.UnpackLog(event, "UsdPerUnitGasUpdated", 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 +} + +func (_PriceRegistry *PriceRegistryFilterer) ParseUsdPerUnitGasUpdated(log types.Log) (*PriceRegistryUsdPerUnitGasUpdated, error) { + event := new(PriceRegistryUsdPerUnitGasUpdated) + if err := _PriceRegistry.contract.UnpackLog(event, "UsdPerUnitGasUpdated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type GetTokenAndGasPrices struct { + TokenPrice *big.Int + GasPriceValue *big.Int +} + +func (_PriceRegistry *PriceRegistry) ParseLog(log types.Log) (generated.AbigenLog, error) { + switch log.Topics[0] { + case _PriceRegistry.abi.Events["FeeTokenAdded"].ID: + return _PriceRegistry.ParseFeeTokenAdded(log) + case _PriceRegistry.abi.Events["FeeTokenRemoved"].ID: + return _PriceRegistry.ParseFeeTokenRemoved(log) + case _PriceRegistry.abi.Events["OwnershipTransferRequested"].ID: + return _PriceRegistry.ParseOwnershipTransferRequested(log) + case _PriceRegistry.abi.Events["OwnershipTransferred"].ID: + return _PriceRegistry.ParseOwnershipTransferred(log) + case _PriceRegistry.abi.Events["PriceUpdaterRemoved"].ID: + return _PriceRegistry.ParsePriceUpdaterRemoved(log) + case _PriceRegistry.abi.Events["PriceUpdaterSet"].ID: + return _PriceRegistry.ParsePriceUpdaterSet(log) + case _PriceRegistry.abi.Events["UsdPerTokenUpdated"].ID: + return _PriceRegistry.ParseUsdPerTokenUpdated(log) + case _PriceRegistry.abi.Events["UsdPerUnitGasUpdated"].ID: + return _PriceRegistry.ParseUsdPerUnitGasUpdated(log) + + default: + return nil, fmt.Errorf("abigen wrapper received unknown log topic: %v", log.Topics[0]) + } +} + +func (PriceRegistryFeeTokenAdded) Topic() common.Hash { + return common.HexToHash("0xdf1b1bd32a69711488d71554706bb130b1fc63a5fa1a2cd85e8440f84065ba23") +} + +func (PriceRegistryFeeTokenRemoved) Topic() common.Hash { + return common.HexToHash("0x1795838dc8ab2ffc5f431a1729a6afa0b587f982f7b2be0b9d7187a1ef547f91") +} + +func (PriceRegistryOwnershipTransferRequested) Topic() common.Hash { + return common.HexToHash("0xed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae1278") +} + +func (PriceRegistryOwnershipTransferred) Topic() common.Hash { + return common.HexToHash("0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0") +} + +func (PriceRegistryPriceUpdaterRemoved) Topic() common.Hash { + return common.HexToHash("0xff7dbb85c77ca68ca1f894d6498570e3d5095cd19466f07ee8d222b337e4068c") +} + +func (PriceRegistryPriceUpdaterSet) Topic() common.Hash { + return common.HexToHash("0x34a02290b7920078c19f58e94b78c77eb9cc10195b20676e19bd3b82085893b8") +} + +func (PriceRegistryUsdPerTokenUpdated) Topic() common.Hash { + return common.HexToHash("0x52f50aa6d1a95a4595361ecf953d095f125d442e4673716dede699e049de148a") +} + +func (PriceRegistryUsdPerUnitGasUpdated) Topic() common.Hash { + return common.HexToHash("0xdd84a3fa9ef9409f550d54d6affec7e9c480c878c6ab27b78912a03e1b371c6e") +} + +func (_PriceRegistry *PriceRegistry) Address() common.Address { + return _PriceRegistry.address +} + +type PriceRegistryInterface interface { + ConvertTokenAmount(opts *bind.CallOpts, fromToken common.Address, fromTokenAmount *big.Int, toToken common.Address) (*big.Int, error) + + GetDestinationChainGasPrice(opts *bind.CallOpts, destChainSelector uint64) (InternalTimestampedPackedUint224, error) + + GetFeeTokens(opts *bind.CallOpts) ([]common.Address, error) + + GetPriceUpdaters(opts *bind.CallOpts) ([]common.Address, error) + + GetStalenessThreshold(opts *bind.CallOpts) (*big.Int, error) + + GetTokenAndGasPrices(opts *bind.CallOpts, token common.Address, destChainSelector uint64) (GetTokenAndGasPrices, + + error) + + GetTokenPrice(opts *bind.CallOpts, token common.Address) (InternalTimestampedPackedUint224, error) + + GetTokenPrices(opts *bind.CallOpts, tokens []common.Address) ([]InternalTimestampedPackedUint224, error) + + GetValidatedTokenPrice(opts *bind.CallOpts, token common.Address) (*big.Int, error) + + Owner(opts *bind.CallOpts) (common.Address, error) + + TypeAndVersion(opts *bind.CallOpts) (string, error) + + AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) + + ApplyFeeTokensUpdates(opts *bind.TransactOpts, feeTokensToAdd []common.Address, feeTokensToRemove []common.Address) (*types.Transaction, error) + + ApplyPriceUpdatersUpdates(opts *bind.TransactOpts, priceUpdatersToAdd []common.Address, priceUpdatersToRemove []common.Address) (*types.Transaction, error) + + TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) + + UpdatePrices(opts *bind.TransactOpts, priceUpdates InternalPriceUpdates) (*types.Transaction, error) + + FilterFeeTokenAdded(opts *bind.FilterOpts, feeToken []common.Address) (*PriceRegistryFeeTokenAddedIterator, error) + + WatchFeeTokenAdded(opts *bind.WatchOpts, sink chan<- *PriceRegistryFeeTokenAdded, feeToken []common.Address) (event.Subscription, error) + + ParseFeeTokenAdded(log types.Log) (*PriceRegistryFeeTokenAdded, error) + + FilterFeeTokenRemoved(opts *bind.FilterOpts, feeToken []common.Address) (*PriceRegistryFeeTokenRemovedIterator, error) + + WatchFeeTokenRemoved(opts *bind.WatchOpts, sink chan<- *PriceRegistryFeeTokenRemoved, feeToken []common.Address) (event.Subscription, error) + + ParseFeeTokenRemoved(log types.Log) (*PriceRegistryFeeTokenRemoved, error) + + FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*PriceRegistryOwnershipTransferRequestedIterator, error) + + WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *PriceRegistryOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferRequested(log types.Log) (*PriceRegistryOwnershipTransferRequested, error) + + FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*PriceRegistryOwnershipTransferredIterator, error) + + WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *PriceRegistryOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferred(log types.Log) (*PriceRegistryOwnershipTransferred, error) + + FilterPriceUpdaterRemoved(opts *bind.FilterOpts, priceUpdater []common.Address) (*PriceRegistryPriceUpdaterRemovedIterator, error) + + WatchPriceUpdaterRemoved(opts *bind.WatchOpts, sink chan<- *PriceRegistryPriceUpdaterRemoved, priceUpdater []common.Address) (event.Subscription, error) + + ParsePriceUpdaterRemoved(log types.Log) (*PriceRegistryPriceUpdaterRemoved, error) + + FilterPriceUpdaterSet(opts *bind.FilterOpts, priceUpdater []common.Address) (*PriceRegistryPriceUpdaterSetIterator, error) + + WatchPriceUpdaterSet(opts *bind.WatchOpts, sink chan<- *PriceRegistryPriceUpdaterSet, priceUpdater []common.Address) (event.Subscription, error) + + ParsePriceUpdaterSet(log types.Log) (*PriceRegistryPriceUpdaterSet, error) + + FilterUsdPerTokenUpdated(opts *bind.FilterOpts, token []common.Address) (*PriceRegistryUsdPerTokenUpdatedIterator, error) + + WatchUsdPerTokenUpdated(opts *bind.WatchOpts, sink chan<- *PriceRegistryUsdPerTokenUpdated, token []common.Address) (event.Subscription, error) + + ParseUsdPerTokenUpdated(log types.Log) (*PriceRegistryUsdPerTokenUpdated, error) + + FilterUsdPerUnitGasUpdated(opts *bind.FilterOpts, destChain []uint64) (*PriceRegistryUsdPerUnitGasUpdatedIterator, error) + + WatchUsdPerUnitGasUpdated(opts *bind.WatchOpts, sink chan<- *PriceRegistryUsdPerUnitGasUpdated, destChain []uint64) (event.Subscription, error) + + ParseUsdPerUnitGasUpdated(log types.Log) (*PriceRegistryUsdPerUnitGasUpdated, error) + + ParseLog(log types.Log) (generated.AbigenLog, error) + + Address() common.Address +} \ No newline at end of file diff --git a/core/gethwrappers/ccip/generated/registry_module_owner_custom/registry_module_owner_custom.go b/core/gethwrappers/ccip/generated/registry_module_owner_custom/registry_module_owner_custom.go new file mode 100644 index 00000000000..121135075db --- /dev/null +++ b/core/gethwrappers/ccip/generated/registry_module_owner_custom/registry_module_owner_custom.go @@ -0,0 +1,390 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package registry_module_owner_custom + +import ( + "errors" + "fmt" + "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" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" +) + +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +var RegistryModuleOwnerCustomMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"tokenAdminRegistry\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"AddressZero\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"admin\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"CanOnlySelfRegister\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"administrator\",\"type\":\"address\"}],\"name\":\"AdministratorRegistered\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"registerAdminViaGetCCIPAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"registerAdminViaOwner\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", + Bin: "0x60a060405234801561001057600080fd5b5060405161047e38038061047e83398101604081905261002f91610067565b6001600160a01b03811661005657604051639fabe1c160e01b815260040160405180910390fd5b6001600160a01b0316608052610097565b60006020828403121561007957600080fd5b81516001600160a01b038116811461009057600080fd5b9392505050565b6080516103cc6100b2600039600061024a01526103cc6000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c8063181f5a771461004657806396ea2f7a14610098578063ff12c354146100ad575b600080fd5b6100826040518060400160405280601f81526020017f52656769737472794d6f64756c654f776e6572437573746f6d20312e352e300081525081565b60405161008f91906102ef565b60405180910390f35b6100ab6100a636600461037e565b6100c0565b005b6100ab6100bb36600461037e565b61013b565b610138818273ffffffffffffffffffffffffffffffffffffffff16638da5cb5b6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561010f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061013391906103a2565b61018a565b50565b610138818273ffffffffffffffffffffffffffffffffffffffff16638fd6a6ac6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561010f573d6000803e3d6000fd5b73ffffffffffffffffffffffffffffffffffffffff811633146101fd576040517fc454d18200000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff80831660048301528316602482015260440160405180910390fd5b6040517fe677ae3700000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff838116600483015282811660248301527f0000000000000000000000000000000000000000000000000000000000000000169063e677ae3790604401600060405180830381600087803b15801561028e57600080fd5b505af11580156102a2573d6000803e3d6000fd5b505060405173ffffffffffffffffffffffffffffffffffffffff8085169350851691507f09590fb70af4b833346363965e043a9339e8c7d378b8a2b903c75c277faec4f990600090a35050565b60006020808352835180602085015260005b8181101561031d57858101830151858201604001528201610301565b5060006040828601015260407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8301168501019250505092915050565b73ffffffffffffffffffffffffffffffffffffffff8116811461013857600080fd5b60006020828403121561039057600080fd5b813561039b8161035c565b9392505050565b6000602082840312156103b457600080fd5b815161039b8161035c56fea164736f6c6343000818000a", +} + +var RegistryModuleOwnerCustomABI = RegistryModuleOwnerCustomMetaData.ABI + +var RegistryModuleOwnerCustomBin = RegistryModuleOwnerCustomMetaData.Bin + +func DeployRegistryModuleOwnerCustom(auth *bind.TransactOpts, backend bind.ContractBackend, tokenAdminRegistry common.Address) (common.Address, *types.Transaction, *RegistryModuleOwnerCustom, error) { + parsed, err := RegistryModuleOwnerCustomMetaData.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(RegistryModuleOwnerCustomBin), backend, tokenAdminRegistry) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &RegistryModuleOwnerCustom{address: address, abi: *parsed, RegistryModuleOwnerCustomCaller: RegistryModuleOwnerCustomCaller{contract: contract}, RegistryModuleOwnerCustomTransactor: RegistryModuleOwnerCustomTransactor{contract: contract}, RegistryModuleOwnerCustomFilterer: RegistryModuleOwnerCustomFilterer{contract: contract}}, nil +} + +type RegistryModuleOwnerCustom struct { + address common.Address + abi abi.ABI + RegistryModuleOwnerCustomCaller + RegistryModuleOwnerCustomTransactor + RegistryModuleOwnerCustomFilterer +} + +type RegistryModuleOwnerCustomCaller struct { + contract *bind.BoundContract +} + +type RegistryModuleOwnerCustomTransactor struct { + contract *bind.BoundContract +} + +type RegistryModuleOwnerCustomFilterer struct { + contract *bind.BoundContract +} + +type RegistryModuleOwnerCustomSession struct { + Contract *RegistryModuleOwnerCustom + CallOpts bind.CallOpts + TransactOpts bind.TransactOpts +} + +type RegistryModuleOwnerCustomCallerSession struct { + Contract *RegistryModuleOwnerCustomCaller + CallOpts bind.CallOpts +} + +type RegistryModuleOwnerCustomTransactorSession struct { + Contract *RegistryModuleOwnerCustomTransactor + TransactOpts bind.TransactOpts +} + +type RegistryModuleOwnerCustomRaw struct { + Contract *RegistryModuleOwnerCustom +} + +type RegistryModuleOwnerCustomCallerRaw struct { + Contract *RegistryModuleOwnerCustomCaller +} + +type RegistryModuleOwnerCustomTransactorRaw struct { + Contract *RegistryModuleOwnerCustomTransactor +} + +func NewRegistryModuleOwnerCustom(address common.Address, backend bind.ContractBackend) (*RegistryModuleOwnerCustom, error) { + abi, err := abi.JSON(strings.NewReader(RegistryModuleOwnerCustomABI)) + if err != nil { + return nil, err + } + contract, err := bindRegistryModuleOwnerCustom(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &RegistryModuleOwnerCustom{address: address, abi: abi, RegistryModuleOwnerCustomCaller: RegistryModuleOwnerCustomCaller{contract: contract}, RegistryModuleOwnerCustomTransactor: RegistryModuleOwnerCustomTransactor{contract: contract}, RegistryModuleOwnerCustomFilterer: RegistryModuleOwnerCustomFilterer{contract: contract}}, nil +} + +func NewRegistryModuleOwnerCustomCaller(address common.Address, caller bind.ContractCaller) (*RegistryModuleOwnerCustomCaller, error) { + contract, err := bindRegistryModuleOwnerCustom(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &RegistryModuleOwnerCustomCaller{contract: contract}, nil +} + +func NewRegistryModuleOwnerCustomTransactor(address common.Address, transactor bind.ContractTransactor) (*RegistryModuleOwnerCustomTransactor, error) { + contract, err := bindRegistryModuleOwnerCustom(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &RegistryModuleOwnerCustomTransactor{contract: contract}, nil +} + +func NewRegistryModuleOwnerCustomFilterer(address common.Address, filterer bind.ContractFilterer) (*RegistryModuleOwnerCustomFilterer, error) { + contract, err := bindRegistryModuleOwnerCustom(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &RegistryModuleOwnerCustomFilterer{contract: contract}, nil +} + +func bindRegistryModuleOwnerCustom(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := RegistryModuleOwnerCustomMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +func (_RegistryModuleOwnerCustom *RegistryModuleOwnerCustomRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _RegistryModuleOwnerCustom.Contract.RegistryModuleOwnerCustomCaller.contract.Call(opts, result, method, params...) +} + +func (_RegistryModuleOwnerCustom *RegistryModuleOwnerCustomRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _RegistryModuleOwnerCustom.Contract.RegistryModuleOwnerCustomTransactor.contract.Transfer(opts) +} + +func (_RegistryModuleOwnerCustom *RegistryModuleOwnerCustomRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _RegistryModuleOwnerCustom.Contract.RegistryModuleOwnerCustomTransactor.contract.Transact(opts, method, params...) +} + +func (_RegistryModuleOwnerCustom *RegistryModuleOwnerCustomCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _RegistryModuleOwnerCustom.Contract.contract.Call(opts, result, method, params...) +} + +func (_RegistryModuleOwnerCustom *RegistryModuleOwnerCustomTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _RegistryModuleOwnerCustom.Contract.contract.Transfer(opts) +} + +func (_RegistryModuleOwnerCustom *RegistryModuleOwnerCustomTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _RegistryModuleOwnerCustom.Contract.contract.Transact(opts, method, params...) +} + +func (_RegistryModuleOwnerCustom *RegistryModuleOwnerCustomCaller) TypeAndVersion(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _RegistryModuleOwnerCustom.contract.Call(opts, &out, "typeAndVersion") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +func (_RegistryModuleOwnerCustom *RegistryModuleOwnerCustomSession) TypeAndVersion() (string, error) { + return _RegistryModuleOwnerCustom.Contract.TypeAndVersion(&_RegistryModuleOwnerCustom.CallOpts) +} + +func (_RegistryModuleOwnerCustom *RegistryModuleOwnerCustomCallerSession) TypeAndVersion() (string, error) { + return _RegistryModuleOwnerCustom.Contract.TypeAndVersion(&_RegistryModuleOwnerCustom.CallOpts) +} + +func (_RegistryModuleOwnerCustom *RegistryModuleOwnerCustomTransactor) RegisterAdminViaGetCCIPAdmin(opts *bind.TransactOpts, token common.Address) (*types.Transaction, error) { + return _RegistryModuleOwnerCustom.contract.Transact(opts, "registerAdminViaGetCCIPAdmin", token) +} + +func (_RegistryModuleOwnerCustom *RegistryModuleOwnerCustomSession) RegisterAdminViaGetCCIPAdmin(token common.Address) (*types.Transaction, error) { + return _RegistryModuleOwnerCustom.Contract.RegisterAdminViaGetCCIPAdmin(&_RegistryModuleOwnerCustom.TransactOpts, token) +} + +func (_RegistryModuleOwnerCustom *RegistryModuleOwnerCustomTransactorSession) RegisterAdminViaGetCCIPAdmin(token common.Address) (*types.Transaction, error) { + return _RegistryModuleOwnerCustom.Contract.RegisterAdminViaGetCCIPAdmin(&_RegistryModuleOwnerCustom.TransactOpts, token) +} + +func (_RegistryModuleOwnerCustom *RegistryModuleOwnerCustomTransactor) RegisterAdminViaOwner(opts *bind.TransactOpts, token common.Address) (*types.Transaction, error) { + return _RegistryModuleOwnerCustom.contract.Transact(opts, "registerAdminViaOwner", token) +} + +func (_RegistryModuleOwnerCustom *RegistryModuleOwnerCustomSession) RegisterAdminViaOwner(token common.Address) (*types.Transaction, error) { + return _RegistryModuleOwnerCustom.Contract.RegisterAdminViaOwner(&_RegistryModuleOwnerCustom.TransactOpts, token) +} + +func (_RegistryModuleOwnerCustom *RegistryModuleOwnerCustomTransactorSession) RegisterAdminViaOwner(token common.Address) (*types.Transaction, error) { + return _RegistryModuleOwnerCustom.Contract.RegisterAdminViaOwner(&_RegistryModuleOwnerCustom.TransactOpts, token) +} + +type RegistryModuleOwnerCustomAdministratorRegisteredIterator struct { + Event *RegistryModuleOwnerCustomAdministratorRegistered + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *RegistryModuleOwnerCustomAdministratorRegisteredIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(RegistryModuleOwnerCustomAdministratorRegistered) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(RegistryModuleOwnerCustomAdministratorRegistered) + 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() + } +} + +func (it *RegistryModuleOwnerCustomAdministratorRegisteredIterator) Error() error { + return it.fail +} + +func (it *RegistryModuleOwnerCustomAdministratorRegisteredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type RegistryModuleOwnerCustomAdministratorRegistered struct { + Token common.Address + Administrator common.Address + Raw types.Log +} + +func (_RegistryModuleOwnerCustom *RegistryModuleOwnerCustomFilterer) FilterAdministratorRegistered(opts *bind.FilterOpts, token []common.Address, administrator []common.Address) (*RegistryModuleOwnerCustomAdministratorRegisteredIterator, error) { + + var tokenRule []interface{} + for _, tokenItem := range token { + tokenRule = append(tokenRule, tokenItem) + } + var administratorRule []interface{} + for _, administratorItem := range administrator { + administratorRule = append(administratorRule, administratorItem) + } + + logs, sub, err := _RegistryModuleOwnerCustom.contract.FilterLogs(opts, "AdministratorRegistered", tokenRule, administratorRule) + if err != nil { + return nil, err + } + return &RegistryModuleOwnerCustomAdministratorRegisteredIterator{contract: _RegistryModuleOwnerCustom.contract, event: "AdministratorRegistered", logs: logs, sub: sub}, nil +} + +func (_RegistryModuleOwnerCustom *RegistryModuleOwnerCustomFilterer) WatchAdministratorRegistered(opts *bind.WatchOpts, sink chan<- *RegistryModuleOwnerCustomAdministratorRegistered, token []common.Address, administrator []common.Address) (event.Subscription, error) { + + var tokenRule []interface{} + for _, tokenItem := range token { + tokenRule = append(tokenRule, tokenItem) + } + var administratorRule []interface{} + for _, administratorItem := range administrator { + administratorRule = append(administratorRule, administratorItem) + } + + logs, sub, err := _RegistryModuleOwnerCustom.contract.WatchLogs(opts, "AdministratorRegistered", tokenRule, administratorRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(RegistryModuleOwnerCustomAdministratorRegistered) + if err := _RegistryModuleOwnerCustom.contract.UnpackLog(event, "AdministratorRegistered", 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 +} + +func (_RegistryModuleOwnerCustom *RegistryModuleOwnerCustomFilterer) ParseAdministratorRegistered(log types.Log) (*RegistryModuleOwnerCustomAdministratorRegistered, error) { + event := new(RegistryModuleOwnerCustomAdministratorRegistered) + if err := _RegistryModuleOwnerCustom.contract.UnpackLog(event, "AdministratorRegistered", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +func (_RegistryModuleOwnerCustom *RegistryModuleOwnerCustom) ParseLog(log types.Log) (generated.AbigenLog, error) { + switch log.Topics[0] { + case _RegistryModuleOwnerCustom.abi.Events["AdministratorRegistered"].ID: + return _RegistryModuleOwnerCustom.ParseAdministratorRegistered(log) + + default: + return nil, fmt.Errorf("abigen wrapper received unknown log topic: %v", log.Topics[0]) + } +} + +func (RegistryModuleOwnerCustomAdministratorRegistered) Topic() common.Hash { + return common.HexToHash("0x09590fb70af4b833346363965e043a9339e8c7d378b8a2b903c75c277faec4f9") +} + +func (_RegistryModuleOwnerCustom *RegistryModuleOwnerCustom) Address() common.Address { + return _RegistryModuleOwnerCustom.address +} + +type RegistryModuleOwnerCustomInterface interface { + TypeAndVersion(opts *bind.CallOpts) (string, error) + + RegisterAdminViaGetCCIPAdmin(opts *bind.TransactOpts, token common.Address) (*types.Transaction, error) + + RegisterAdminViaOwner(opts *bind.TransactOpts, token common.Address) (*types.Transaction, error) + + FilterAdministratorRegistered(opts *bind.FilterOpts, token []common.Address, administrator []common.Address) (*RegistryModuleOwnerCustomAdministratorRegisteredIterator, error) + + WatchAdministratorRegistered(opts *bind.WatchOpts, sink chan<- *RegistryModuleOwnerCustomAdministratorRegistered, token []common.Address, administrator []common.Address) (event.Subscription, error) + + ParseAdministratorRegistered(log types.Log) (*RegistryModuleOwnerCustomAdministratorRegistered, error) + + ParseLog(log types.Log) (generated.AbigenLog, error) + + Address() common.Address +} diff --git a/core/gethwrappers/ccip/generated/report_codec/report_codec.go b/core/gethwrappers/ccip/generated/report_codec/report_codec.go new file mode 100644 index 00000000000..29333984cc3 --- /dev/null +++ b/core/gethwrappers/ccip/generated/report_codec/report_codec.go @@ -0,0 +1,563 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package report_codec + +import ( + "errors" + "fmt" + "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" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" +) + +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +type IRMNV2Signature struct { + R [32]byte + S [32]byte +} + +type InternalAny2EVMRampMessage struct { + Header InternalRampMessageHeader + Sender []byte + Data []byte + Receiver common.Address + GasLimit *big.Int + TokenAmounts []InternalRampTokenAmount +} + +type InternalExecutionReportSingleChain struct { + SourceChainSelector uint64 + Messages []InternalAny2EVMRampMessage + OffchainTokenData [][][]byte + Proofs [][32]byte + ProofFlagBits *big.Int +} + +type InternalGasPriceUpdate struct { + DestChainSelector uint64 + UsdPerUnitGas *big.Int +} + +type InternalMerkleRoot struct { + SourceChainSelector uint64 + MinSeqNr uint64 + MaxSeqNr uint64 + MerkleRoot [32]byte + OnRampAddress []byte +} + +type InternalPriceUpdates struct { + TokenPriceUpdates []InternalTokenPriceUpdate + GasPriceUpdates []InternalGasPriceUpdate +} + +type InternalRampMessageHeader struct { + MessageId [32]byte + SourceChainSelector uint64 + DestChainSelector uint64 + SequenceNumber uint64 + Nonce uint64 +} + +type InternalRampTokenAmount struct { + SourcePoolAddress []byte + DestTokenAddress []byte + ExtraData []byte + Amount *big.Int + DestExecData []byte +} + +type InternalTokenPriceUpdate struct { + SourceToken common.Address + UsdPerToken *big.Int +} + +type OffRampCommitReport struct { + PriceUpdates InternalPriceUpdates + MerkleRoots []InternalMerkleRoot + RmnSignatures []IRMNV2Signature +} + +var ReportCodecMetaData = &bind.MetaData{ + ABI: "[{\"anonymous\":false,\"inputs\":[{\"components\":[{\"components\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"sourceToken\",\"type\":\"address\"},{\"internalType\":\"uint224\",\"name\":\"usdPerToken\",\"type\":\"uint224\"}],\"internalType\":\"structInternal.TokenPriceUpdate[]\",\"name\":\"tokenPriceUpdates\",\"type\":\"tuple[]\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint224\",\"name\":\"usdPerUnitGas\",\"type\":\"uint224\"}],\"internalType\":\"structInternal.GasPriceUpdate[]\",\"name\":\"gasPriceUpdates\",\"type\":\"tuple[]\"}],\"internalType\":\"structInternal.PriceUpdates\",\"name\":\"priceUpdates\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"minSeqNr\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"maxSeqNr\",\"type\":\"uint64\"},{\"internalType\":\"bytes32\",\"name\":\"merkleRoot\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"onRampAddress\",\"type\":\"bytes\"}],\"internalType\":\"structInternal.MerkleRoot[]\",\"name\":\"merkleRoots\",\"type\":\"tuple[]\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"internalType\":\"structIRMNV2.Signature[]\",\"name\":\"rmnSignatures\",\"type\":\"tuple[]\"}],\"indexed\":false,\"internalType\":\"structOffRamp.CommitReport\",\"name\":\"report\",\"type\":\"tuple\"}],\"name\":\"CommitReportDecoded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"components\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"messageId\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"sequenceNumber\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"nonce\",\"type\":\"uint64\"}],\"internalType\":\"structInternal.RampMessageHeader\",\"name\":\"header\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"sender\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"gasLimit\",\"type\":\"uint256\"},{\"components\":[{\"internalType\":\"bytes\",\"name\":\"sourcePoolAddress\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"destTokenAddress\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"destExecData\",\"type\":\"bytes\"}],\"internalType\":\"structInternal.RampTokenAmount[]\",\"name\":\"tokenAmounts\",\"type\":\"tuple[]\"}],\"internalType\":\"structInternal.Any2EVMRampMessage[]\",\"name\":\"messages\",\"type\":\"tuple[]\"},{\"internalType\":\"bytes[][]\",\"name\":\"offchainTokenData\",\"type\":\"bytes[][]\"},{\"internalType\":\"bytes32[]\",\"name\":\"proofs\",\"type\":\"bytes32[]\"},{\"internalType\":\"uint256\",\"name\":\"proofFlagBits\",\"type\":\"uint256\"}],\"indexed\":false,\"internalType\":\"structInternal.ExecutionReportSingleChain[]\",\"name\":\"report\",\"type\":\"tuple[]\"}],\"name\":\"ExecuteReportDecoded\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"report\",\"type\":\"bytes\"}],\"name\":\"decodeCommitReport\",\"outputs\":[{\"components\":[{\"components\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"sourceToken\",\"type\":\"address\"},{\"internalType\":\"uint224\",\"name\":\"usdPerToken\",\"type\":\"uint224\"}],\"internalType\":\"structInternal.TokenPriceUpdate[]\",\"name\":\"tokenPriceUpdates\",\"type\":\"tuple[]\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint224\",\"name\":\"usdPerUnitGas\",\"type\":\"uint224\"}],\"internalType\":\"structInternal.GasPriceUpdate[]\",\"name\":\"gasPriceUpdates\",\"type\":\"tuple[]\"}],\"internalType\":\"structInternal.PriceUpdates\",\"name\":\"priceUpdates\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"minSeqNr\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"maxSeqNr\",\"type\":\"uint64\"},{\"internalType\":\"bytes32\",\"name\":\"merkleRoot\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"onRampAddress\",\"type\":\"bytes\"}],\"internalType\":\"structInternal.MerkleRoot[]\",\"name\":\"merkleRoots\",\"type\":\"tuple[]\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"internalType\":\"structIRMNV2.Signature[]\",\"name\":\"rmnSignatures\",\"type\":\"tuple[]\"}],\"internalType\":\"structOffRamp.CommitReport\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"report\",\"type\":\"bytes\"}],\"name\":\"decodeExecuteReport\",\"outputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"components\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"messageId\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"sequenceNumber\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"nonce\",\"type\":\"uint64\"}],\"internalType\":\"structInternal.RampMessageHeader\",\"name\":\"header\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"sender\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"gasLimit\",\"type\":\"uint256\"},{\"components\":[{\"internalType\":\"bytes\",\"name\":\"sourcePoolAddress\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"destTokenAddress\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"destExecData\",\"type\":\"bytes\"}],\"internalType\":\"structInternal.RampTokenAmount[]\",\"name\":\"tokenAmounts\",\"type\":\"tuple[]\"}],\"internalType\":\"structInternal.Any2EVMRampMessage[]\",\"name\":\"messages\",\"type\":\"tuple[]\"},{\"internalType\":\"bytes[][]\",\"name\":\"offchainTokenData\",\"type\":\"bytes[][]\"},{\"internalType\":\"bytes32[]\",\"name\":\"proofs\",\"type\":\"bytes32[]\"},{\"internalType\":\"uint256\",\"name\":\"proofFlagBits\",\"type\":\"uint256\"}],\"internalType\":\"structInternal.ExecutionReportSingleChain[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"pure\",\"type\":\"function\"}]", + Bin: "0x608060405234801561001057600080fd5b506113e6806100206000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c80636fb349561461003b578063f816ec6014610064575b600080fd5b61004e610049366004610231565b610084565b60405161005b91906104f2565b60405180910390f35b610077610072366004610231565b6100a0565b60405161005b9190610835565b60608180602001905181019061009a9190610e8d565b92915050565b6040805160a08101825260608082018181526080830182905282526020808301829052928201528251909161009a9184018101908401611250565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60405160a0810167ffffffffffffffff8111828210171561012d5761012d6100db565b60405290565b60405160c0810167ffffffffffffffff8111828210171561012d5761012d6100db565b6040805190810167ffffffffffffffff8111828210171561012d5761012d6100db565b6040516060810167ffffffffffffffff8111828210171561012d5761012d6100db565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff811182821017156101e3576101e36100db565b604052919050565b600067ffffffffffffffff821115610205576102056100db565b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b60006020828403121561024357600080fd5b813567ffffffffffffffff81111561025a57600080fd5b8201601f8101841361026b57600080fd5b803561027e610279826101eb565b61019c565b81815285602083850101111561029357600080fd5b81602084016020830137600091810160200191909152949350505050565b60005b838110156102cc5781810151838201526020016102b4565b50506000910152565b600081518084526102ed8160208601602086016102b1565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b600082825180855260208086019550808260051b84010181860160005b848110156103ef577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0868403018952815160a08151818652610380828701826102d5565b915050858201518582038787015261039882826102d5565b915050604080830151868303828801526103b283826102d5565b925050506060808301518187015250608080830151925085820381870152506103db81836102d5565b9a86019a945050509083019060010161033c565b5090979650505050505050565b6000828251808552602080860195506005818360051b8501018287016000805b868110156104a7577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe088850381018c5283518051808752908801908887019080891b88018a01865b8281101561049057858a830301845261047e8286516102d5565b948c0194938c01939150600101610464565b509e8a019e9750505093870193505060010161041c565b50919998505050505050505050565b60008151808452602080850194506020840160005b838110156104e7578151875295820195908201906001016104cb565b509495945050505050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b828110156106da577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0888603018452815160a0860167ffffffffffffffff8083511688528883015160a08a8a015282815180855260c08b01915060c08160051b8c010194508b8301925060005b81811015610683577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff408c87030183528351805180518852868f820151168f890152866040820151166040890152866060820151166060890152866080820151166080890152508d81015161014060a08901526106066101408901826102d5565b9050604082015188820360c08a015261061f82826102d5565b915050606082015161064960e08a018273ffffffffffffffffffffffffffffffffffffffff169052565b50608082015161010089015260a0820151915087810361012089015261066f818361031f565b97505050928c0192918c0191600101610586565b50505050506040820151878203604089015261069f82826103fc565b915050606082015187820360608901526106b982826104b6565b60809384015198909301979097525094509285019290850190600101610519565b5092979650505050505050565b60008151808452602080850194506020840160005b838110156104e7578151805167ffffffffffffffff1688528301517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1683880152604090960195908201906001016106fc565b600082825180855260208086019550808260051b84010181860160005b848110156103ef578583037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe00189528151805167ffffffffffffffff908116855285820151811686860152604080830151909116908501526060808201519085015260809081015160a0918501829052906107e5818601836102d5565b9a86019a9450505090830190600101610768565b60008151808452602080850194506020840160005b838110156104e757815180518852830151838801526040909601959082019060010161080e565b602080825282516060838301528051604060808501819052815160c086018190526000949392840191859160e08801905b808410156108c3578451805173ffffffffffffffffffffffffffffffffffffffff1683528701517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1687830152938601936001939093019290820190610866565b50938501518785037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff800160a0890152936108fd81866106e7565b9450505050508185015191507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08085830301604086015261093e828461074b565b925060408601519150808584030160608601525061095c82826107f9565b95945050505050565b600067ffffffffffffffff82111561097f5761097f6100db565b5060051b60200190565b805167ffffffffffffffff811681146109a157600080fd5b919050565b600060a082840312156109b857600080fd5b6109c061010a565b9050815181526109d260208301610989565b60208201526109e360408301610989565b60408201526109f460608301610989565b6060820152610a0560808301610989565b608082015292915050565b600082601f830112610a2157600080fd5b8151610a2f610279826101eb565b818152846020838601011115610a4457600080fd5b610a558260208301602087016102b1565b949350505050565b805173ffffffffffffffffffffffffffffffffffffffff811681146109a157600080fd5b600082601f830112610a9257600080fd5b81516020610aa261027983610965565b82815260059290921b84018101918181019086841115610ac157600080fd5b8286015b84811015610bdb57805167ffffffffffffffff80821115610ae65760008081fd5b818901915060a0807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0848d03011215610b1f5760008081fd5b610b2761010a565b8784015183811115610b395760008081fd5b610b478d8a83880101610a10565b82525060408085015184811115610b5e5760008081fd5b610b6c8e8b83890101610a10565b8a8401525060608086015185811115610b855760008081fd5b610b938f8c838a0101610a10565b83850152506080915081860151818401525082850151925083831115610bb95760008081fd5b610bc78d8a85880101610a10565b908201528652505050918301918301610ac5565b509695505050505050565b600082601f830112610bf757600080fd5b81516020610c0761027983610965565b82815260059290921b84018101918181019086841115610c2657600080fd5b8286015b84811015610bdb57805167ffffffffffffffff80821115610c4b5760008081fd5b8189019150610140807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0848d03011215610c855760008081fd5b610c8d610133565b610c998c8986016109a6565b815260c084015183811115610cae5760008081fd5b610cbc8d8a83880101610a10565b898301525060e084015183811115610cd45760008081fd5b610ce28d8a83880101610a10565b604083015250610cf56101008501610a5d565b60608201526101208401516080820152908301519082821115610d185760008081fd5b610d268c8984870101610a81565b60a08201528652505050918301918301610c2a565b600082601f830112610d4c57600080fd5b81516020610d5c61027983610965565b82815260059290921b84018101918181019086841115610d7b57600080fd5b8286015b84811015610bdb57805167ffffffffffffffff80821115610d9f57600080fd5b818901915089603f830112610db357600080fd5b85820151610dc361027982610965565b81815260059190911b830160400190878101908c831115610de357600080fd5b604085015b83811015610e1c57805185811115610dff57600080fd5b610e0e8f6040838a0101610a10565b845250918901918901610de8565b50875250505092840192508301610d7f565b600082601f830112610e3f57600080fd5b81516020610e4f61027983610965565b8083825260208201915060208460051b870101935086841115610e7157600080fd5b602086015b84811015610bdb5780518352918301918301610e76565b60006020808385031215610ea057600080fd5b825167ffffffffffffffff80821115610eb857600080fd5b818501915085601f830112610ecc57600080fd5b8151610eda61027982610965565b81815260059190911b83018401908481019088831115610ef957600080fd5b8585015b83811015610ff357805185811115610f1457600080fd5b860160a0818c037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0011215610f495760008081fd5b610f5161010a565b610f5c898301610989565b815260408083015188811115610f725760008081fd5b610f808e8c83870101610be6565b8b8401525060608084015189811115610f995760008081fd5b610fa78f8d83880101610d3b565b8385015250608091508184015189811115610fc25760008081fd5b610fd08f8d83880101610e2e565b918401919091525060a09290920151918101919091528352918601918601610efd565b5098975050505050505050565b80517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff811681146109a157600080fd5b600082601f83011261103d57600080fd5b8151602061104d61027983610965565b82815260069290921b8401810191818101908684111561106c57600080fd5b8286015b84811015610bdb57604081890312156110895760008081fd5b611091610156565b61109a82610989565b81526110a7858301611000565b81860152835291830191604001611070565b600082601f8301126110ca57600080fd5b815160206110da61027983610965565b82815260059290921b840181019181810190868411156110f957600080fd5b8286015b84811015610bdb57805167ffffffffffffffff8082111561111e5760008081fd5b818901915060a0807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0848d030112156111575760008081fd5b61115f61010a565b61116a888501610989565b81526040611179818601610989565b89830152606061118a818701610989565b8284015260809150818601518184015250828501519250838311156111af5760008081fd5b6111bd8d8a85880101610a10565b9082015286525050509183019183016110fd565b600082601f8301126111e257600080fd5b815160206111f261027983610965565b82815260069290921b8401810191818101908684111561121157600080fd5b8286015b84811015610bdb576040818903121561122e5760008081fd5b611236610156565b815181528482015185820152835291830191604001611215565b6000602080838503121561126357600080fd5b825167ffffffffffffffff8082111561127b57600080fd5b908401906060828703121561128f57600080fd5b611297610179565b8251828111156112a657600080fd5b830160408189038113156112b957600080fd5b6112c1610156565b8251858111156112d057600080fd5b8301601f81018b136112e157600080fd5b80516112ef61027982610965565b81815260069190911b8201890190898101908d83111561130e57600080fd5b928a01925b8284101561135c5785848f03121561132b5760008081fd5b611333610156565b61133c85610a5d565b81526113498c8601611000565b818d0152825292850192908a0190611313565b84525050508287015191508482111561137457600080fd5b6113808a83850161102c565b8188015283525050828401518281111561139957600080fd5b6113a5888286016110b9565b858301525060408301519350818411156113be57600080fd5b6113ca878585016111d1565b6040820152969550505050505056fea164736f6c6343000818000a", +} + +var ReportCodecABI = ReportCodecMetaData.ABI + +var ReportCodecBin = ReportCodecMetaData.Bin + +func DeployReportCodec(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *ReportCodec, error) { + parsed, err := ReportCodecMetaData.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(ReportCodecBin), backend) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &ReportCodec{address: address, abi: *parsed, ReportCodecCaller: ReportCodecCaller{contract: contract}, ReportCodecTransactor: ReportCodecTransactor{contract: contract}, ReportCodecFilterer: ReportCodecFilterer{contract: contract}}, nil +} + +type ReportCodec struct { + address common.Address + abi abi.ABI + ReportCodecCaller + ReportCodecTransactor + ReportCodecFilterer +} + +type ReportCodecCaller struct { + contract *bind.BoundContract +} + +type ReportCodecTransactor struct { + contract *bind.BoundContract +} + +type ReportCodecFilterer struct { + contract *bind.BoundContract +} + +type ReportCodecSession struct { + Contract *ReportCodec + CallOpts bind.CallOpts + TransactOpts bind.TransactOpts +} + +type ReportCodecCallerSession struct { + Contract *ReportCodecCaller + CallOpts bind.CallOpts +} + +type ReportCodecTransactorSession struct { + Contract *ReportCodecTransactor + TransactOpts bind.TransactOpts +} + +type ReportCodecRaw struct { + Contract *ReportCodec +} + +type ReportCodecCallerRaw struct { + Contract *ReportCodecCaller +} + +type ReportCodecTransactorRaw struct { + Contract *ReportCodecTransactor +} + +func NewReportCodec(address common.Address, backend bind.ContractBackend) (*ReportCodec, error) { + abi, err := abi.JSON(strings.NewReader(ReportCodecABI)) + if err != nil { + return nil, err + } + contract, err := bindReportCodec(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &ReportCodec{address: address, abi: abi, ReportCodecCaller: ReportCodecCaller{contract: contract}, ReportCodecTransactor: ReportCodecTransactor{contract: contract}, ReportCodecFilterer: ReportCodecFilterer{contract: contract}}, nil +} + +func NewReportCodecCaller(address common.Address, caller bind.ContractCaller) (*ReportCodecCaller, error) { + contract, err := bindReportCodec(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &ReportCodecCaller{contract: contract}, nil +} + +func NewReportCodecTransactor(address common.Address, transactor bind.ContractTransactor) (*ReportCodecTransactor, error) { + contract, err := bindReportCodec(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &ReportCodecTransactor{contract: contract}, nil +} + +func NewReportCodecFilterer(address common.Address, filterer bind.ContractFilterer) (*ReportCodecFilterer, error) { + contract, err := bindReportCodec(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &ReportCodecFilterer{contract: contract}, nil +} + +func bindReportCodec(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := ReportCodecMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +func (_ReportCodec *ReportCodecRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _ReportCodec.Contract.ReportCodecCaller.contract.Call(opts, result, method, params...) +} + +func (_ReportCodec *ReportCodecRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _ReportCodec.Contract.ReportCodecTransactor.contract.Transfer(opts) +} + +func (_ReportCodec *ReportCodecRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _ReportCodec.Contract.ReportCodecTransactor.contract.Transact(opts, method, params...) +} + +func (_ReportCodec *ReportCodecCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _ReportCodec.Contract.contract.Call(opts, result, method, params...) +} + +func (_ReportCodec *ReportCodecTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _ReportCodec.Contract.contract.Transfer(opts) +} + +func (_ReportCodec *ReportCodecTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _ReportCodec.Contract.contract.Transact(opts, method, params...) +} + +func (_ReportCodec *ReportCodecCaller) DecodeCommitReport(opts *bind.CallOpts, report []byte) (OffRampCommitReport, error) { + var out []interface{} + err := _ReportCodec.contract.Call(opts, &out, "decodeCommitReport", report) + + if err != nil { + return *new(OffRampCommitReport), err + } + + out0 := *abi.ConvertType(out[0], new(OffRampCommitReport)).(*OffRampCommitReport) + + return out0, err + +} + +func (_ReportCodec *ReportCodecSession) DecodeCommitReport(report []byte) (OffRampCommitReport, error) { + return _ReportCodec.Contract.DecodeCommitReport(&_ReportCodec.CallOpts, report) +} + +func (_ReportCodec *ReportCodecCallerSession) DecodeCommitReport(report []byte) (OffRampCommitReport, error) { + return _ReportCodec.Contract.DecodeCommitReport(&_ReportCodec.CallOpts, report) +} + +func (_ReportCodec *ReportCodecCaller) DecodeExecuteReport(opts *bind.CallOpts, report []byte) ([]InternalExecutionReportSingleChain, error) { + var out []interface{} + err := _ReportCodec.contract.Call(opts, &out, "decodeExecuteReport", report) + + if err != nil { + return *new([]InternalExecutionReportSingleChain), err + } + + out0 := *abi.ConvertType(out[0], new([]InternalExecutionReportSingleChain)).(*[]InternalExecutionReportSingleChain) + + return out0, err + +} + +func (_ReportCodec *ReportCodecSession) DecodeExecuteReport(report []byte) ([]InternalExecutionReportSingleChain, error) { + return _ReportCodec.Contract.DecodeExecuteReport(&_ReportCodec.CallOpts, report) +} + +func (_ReportCodec *ReportCodecCallerSession) DecodeExecuteReport(report []byte) ([]InternalExecutionReportSingleChain, error) { + return _ReportCodec.Contract.DecodeExecuteReport(&_ReportCodec.CallOpts, report) +} + +type ReportCodecCommitReportDecodedIterator struct { + Event *ReportCodecCommitReportDecoded + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *ReportCodecCommitReportDecodedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(ReportCodecCommitReportDecoded) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(ReportCodecCommitReportDecoded) + 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() + } +} + +func (it *ReportCodecCommitReportDecodedIterator) Error() error { + return it.fail +} + +func (it *ReportCodecCommitReportDecodedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type ReportCodecCommitReportDecoded struct { + Report OffRampCommitReport + Raw types.Log +} + +func (_ReportCodec *ReportCodecFilterer) FilterCommitReportDecoded(opts *bind.FilterOpts) (*ReportCodecCommitReportDecodedIterator, error) { + + logs, sub, err := _ReportCodec.contract.FilterLogs(opts, "CommitReportDecoded") + if err != nil { + return nil, err + } + return &ReportCodecCommitReportDecodedIterator{contract: _ReportCodec.contract, event: "CommitReportDecoded", logs: logs, sub: sub}, nil +} + +func (_ReportCodec *ReportCodecFilterer) WatchCommitReportDecoded(opts *bind.WatchOpts, sink chan<- *ReportCodecCommitReportDecoded) (event.Subscription, error) { + + logs, sub, err := _ReportCodec.contract.WatchLogs(opts, "CommitReportDecoded") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(ReportCodecCommitReportDecoded) + if err := _ReportCodec.contract.UnpackLog(event, "CommitReportDecoded", 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 +} + +func (_ReportCodec *ReportCodecFilterer) ParseCommitReportDecoded(log types.Log) (*ReportCodecCommitReportDecoded, error) { + event := new(ReportCodecCommitReportDecoded) + if err := _ReportCodec.contract.UnpackLog(event, "CommitReportDecoded", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type ReportCodecExecuteReportDecodedIterator struct { + Event *ReportCodecExecuteReportDecoded + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *ReportCodecExecuteReportDecodedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(ReportCodecExecuteReportDecoded) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(ReportCodecExecuteReportDecoded) + 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() + } +} + +func (it *ReportCodecExecuteReportDecodedIterator) Error() error { + return it.fail +} + +func (it *ReportCodecExecuteReportDecodedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type ReportCodecExecuteReportDecoded struct { + Report []InternalExecutionReportSingleChain + Raw types.Log +} + +func (_ReportCodec *ReportCodecFilterer) FilterExecuteReportDecoded(opts *bind.FilterOpts) (*ReportCodecExecuteReportDecodedIterator, error) { + + logs, sub, err := _ReportCodec.contract.FilterLogs(opts, "ExecuteReportDecoded") + if err != nil { + return nil, err + } + return &ReportCodecExecuteReportDecodedIterator{contract: _ReportCodec.contract, event: "ExecuteReportDecoded", logs: logs, sub: sub}, nil +} + +func (_ReportCodec *ReportCodecFilterer) WatchExecuteReportDecoded(opts *bind.WatchOpts, sink chan<- *ReportCodecExecuteReportDecoded) (event.Subscription, error) { + + logs, sub, err := _ReportCodec.contract.WatchLogs(opts, "ExecuteReportDecoded") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(ReportCodecExecuteReportDecoded) + if err := _ReportCodec.contract.UnpackLog(event, "ExecuteReportDecoded", 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 +} + +func (_ReportCodec *ReportCodecFilterer) ParseExecuteReportDecoded(log types.Log) (*ReportCodecExecuteReportDecoded, error) { + event := new(ReportCodecExecuteReportDecoded) + if err := _ReportCodec.contract.UnpackLog(event, "ExecuteReportDecoded", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +func (_ReportCodec *ReportCodec) ParseLog(log types.Log) (generated.AbigenLog, error) { + switch log.Topics[0] { + case _ReportCodec.abi.Events["CommitReportDecoded"].ID: + return _ReportCodec.ParseCommitReportDecoded(log) + case _ReportCodec.abi.Events["ExecuteReportDecoded"].ID: + return _ReportCodec.ParseExecuteReportDecoded(log) + + default: + return nil, fmt.Errorf("abigen wrapper received unknown log topic: %v", log.Topics[0]) + } +} + +func (ReportCodecCommitReportDecoded) Topic() common.Hash { + return common.HexToHash("0x83099d210b303f78572f4da1af1d1777cbf80cae42cdb9381f310dbdf21e8f89") +} + +func (ReportCodecExecuteReportDecoded) Topic() common.Hash { + return common.HexToHash("0x70d042e9d8463eeac7e835e7172c08846ad327fc4eb6fc89f3bb5226e17ad618") +} + +func (_ReportCodec *ReportCodec) Address() common.Address { + return _ReportCodec.address +} + +type ReportCodecInterface interface { + DecodeCommitReport(opts *bind.CallOpts, report []byte) (OffRampCommitReport, error) + + DecodeExecuteReport(opts *bind.CallOpts, report []byte) ([]InternalExecutionReportSingleChain, error) + + FilterCommitReportDecoded(opts *bind.FilterOpts) (*ReportCodecCommitReportDecodedIterator, error) + + WatchCommitReportDecoded(opts *bind.WatchOpts, sink chan<- *ReportCodecCommitReportDecoded) (event.Subscription, error) + + ParseCommitReportDecoded(log types.Log) (*ReportCodecCommitReportDecoded, error) + + FilterExecuteReportDecoded(opts *bind.FilterOpts) (*ReportCodecExecuteReportDecodedIterator, error) + + WatchExecuteReportDecoded(opts *bind.WatchOpts, sink chan<- *ReportCodecExecuteReportDecoded) (event.Subscription, error) + + ParseExecuteReportDecoded(log types.Log) (*ReportCodecExecuteReportDecoded, error) + + ParseLog(log types.Log) (generated.AbigenLog, error) + + Address() common.Address +} diff --git a/core/gethwrappers/ccip/generated/rmn_contract/rmn_contract.go b/core/gethwrappers/ccip/generated/rmn_contract/rmn_contract.go new file mode 100644 index 00000000000..e314f0243a9 --- /dev/null +++ b/core/gethwrappers/ccip/generated/rmn_contract/rmn_contract.go @@ -0,0 +1,2849 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package rmn_contract + +import ( + "errors" + "fmt" + "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" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" +) + +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +type IRMNTaggedRoot struct { + CommitStore common.Address + Root [32]byte +} + +type RMNConfig struct { + Voters []RMNVoter + BlessWeightThreshold uint16 + CurseWeightThreshold uint16 +} + +type RMNOwnerUnvoteToCurseRequest struct { + CurseVoteAddr common.Address + Unit RMNUnvoteToCurseRequest + ForceUnvote bool +} + +type RMNRecordedCurseRelatedOp struct { + Tag uint8 + BlockTimestamp uint64 + Cursed bool + CurseVoteAddr common.Address + Subject [16]byte + CurseId [16]byte +} + +type RMNUnvoteToCurseRequest struct { + Subject [16]byte + CursesHash [28]byte +} + +type RMNVoter struct { + BlessVoteAddr common.Address + CurseVoteAddr common.Address + BlessWeight uint8 + CurseWeight uint8 +} + +var RMNContractMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"components\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"blessVoteAddr\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"curseVoteAddr\",\"type\":\"address\"},{\"internalType\":\"uint8\",\"name\":\"blessWeight\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"curseWeight\",\"type\":\"uint8\"}],\"internalType\":\"structRMN.Voter[]\",\"name\":\"voters\",\"type\":\"tuple[]\"},{\"internalType\":\"uint16\",\"name\":\"blessWeightThreshold\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"curseWeightThreshold\",\"type\":\"uint16\"}],\"internalType\":\"structRMN.Config\",\"name\":\"config\",\"type\":\"tuple\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"InvalidConfig\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"voter\",\"type\":\"address\"},{\"internalType\":\"bytes16\",\"name\":\"curseId\",\"type\":\"bytes16\"}],\"name\":\"ReusedCurseId\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"SubjectsMustBeStrictlyIncreasing\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"voter\",\"type\":\"address\"}],\"name\":\"UnauthorizedVoter\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UnvoteToCurseNoop\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"VoteToBlessForbiddenDuringActiveGlobalCurse\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"VoteToBlessNoop\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"VoteToCurseNoop\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint32\",\"name\":\"configVersion\",\"type\":\"uint32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"voter\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"commitStore\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"root\",\"type\":\"bytes32\"}],\"indexed\":false,\"internalType\":\"structIRMN.TaggedRoot\",\"name\":\"taggedRoot\",\"type\":\"tuple\"}],\"name\":\"AlreadyBlessed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint32\",\"name\":\"configVersion\",\"type\":\"uint32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"voter\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"commitStore\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"root\",\"type\":\"bytes32\"}],\"indexed\":false,\"internalType\":\"structIRMN.TaggedRoot\",\"name\":\"taggedRoot\",\"type\":\"tuple\"}],\"name\":\"AlreadyVotedToBless\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint32\",\"name\":\"configVersion\",\"type\":\"uint32\"},{\"components\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"blessVoteAddr\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"curseVoteAddr\",\"type\":\"address\"},{\"internalType\":\"uint8\",\"name\":\"blessWeight\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"curseWeight\",\"type\":\"uint8\"}],\"internalType\":\"structRMN.Voter[]\",\"name\":\"voters\",\"type\":\"tuple[]\"},{\"internalType\":\"uint16\",\"name\":\"blessWeightThreshold\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"curseWeightThreshold\",\"type\":\"uint16\"}],\"indexed\":false,\"internalType\":\"structRMN.Config\",\"name\":\"config\",\"type\":\"tuple\"}],\"name\":\"ConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes16\",\"name\":\"subject\",\"type\":\"bytes16\"}],\"name\":\"CurseLifted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint32\",\"name\":\"configVersion\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"bytes16\",\"name\":\"subject\",\"type\":\"bytes16\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"blockTimestamp\",\"type\":\"uint64\"}],\"name\":\"Cursed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"commitStore\",\"type\":\"address\"}],\"name\":\"PermaBlessedCommitStoreAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"commitStore\",\"type\":\"address\"}],\"name\":\"PermaBlessedCommitStoreRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"voter\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes16\",\"name\":\"subject\",\"type\":\"bytes16\"},{\"indexed\":false,\"internalType\":\"bytes28\",\"name\":\"onchainCursesHash\",\"type\":\"bytes28\"},{\"indexed\":false,\"internalType\":\"bytes28\",\"name\":\"cursesHash\",\"type\":\"bytes28\"}],\"name\":\"SkippedUnvoteToCurse\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint32\",\"name\":\"configVersion\",\"type\":\"uint32\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"commitStore\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"root\",\"type\":\"bytes32\"}],\"indexed\":false,\"internalType\":\"structIRMN.TaggedRoot\",\"name\":\"taggedRoot\",\"type\":\"tuple\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"wasBlessed\",\"type\":\"bool\"}],\"name\":\"TaggedRootBlessVotesReset\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint32\",\"name\":\"configVersion\",\"type\":\"uint32\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"commitStore\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"root\",\"type\":\"bytes32\"}],\"indexed\":false,\"internalType\":\"structIRMN.TaggedRoot\",\"name\":\"taggedRoot\",\"type\":\"tuple\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"accumulatedWeight\",\"type\":\"uint16\"}],\"name\":\"TaggedRootBlessed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint32\",\"name\":\"configVersion\",\"type\":\"uint32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"voter\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes16\",\"name\":\"subject\",\"type\":\"bytes16\"},{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"weight\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"bytes28\",\"name\":\"cursesHash\",\"type\":\"bytes28\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"remainingAccumulatedWeight\",\"type\":\"uint16\"}],\"name\":\"UnvotedToCurse\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint32\",\"name\":\"configVersion\",\"type\":\"uint32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"voter\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"commitStore\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"root\",\"type\":\"bytes32\"}],\"indexed\":false,\"internalType\":\"structIRMN.TaggedRoot\",\"name\":\"taggedRoot\",\"type\":\"tuple\"},{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"weight\",\"type\":\"uint8\"}],\"name\":\"VotedToBless\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint32\",\"name\":\"configVersion\",\"type\":\"uint32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"voter\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes16\",\"name\":\"subject\",\"type\":\"bytes16\"},{\"indexed\":false,\"internalType\":\"bytes16\",\"name\":\"curseId\",\"type\":\"bytes16\"},{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"weight\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"blockTimestamp\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes28\",\"name\":\"cursesHash\",\"type\":\"bytes28\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"accumulatedWeight\",\"type\":\"uint16\"}],\"name\":\"VotedToCurse\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"commitStore\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"root\",\"type\":\"bytes32\"}],\"internalType\":\"structIRMN.TaggedRoot\",\"name\":\"taggedRoot\",\"type\":\"tuple\"}],\"name\":\"getBlessProgress\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"blessVoteAddrs\",\"type\":\"address[]\"},{\"internalType\":\"uint16\",\"name\":\"accumulatedWeight\",\"type\":\"uint16\"},{\"internalType\":\"bool\",\"name\":\"blessed\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getConfigDetails\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"version\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"blockNumber\",\"type\":\"uint32\"},{\"components\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"blessVoteAddr\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"curseVoteAddr\",\"type\":\"address\"},{\"internalType\":\"uint8\",\"name\":\"blessWeight\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"curseWeight\",\"type\":\"uint8\"}],\"internalType\":\"structRMN.Voter[]\",\"name\":\"voters\",\"type\":\"tuple[]\"},{\"internalType\":\"uint16\",\"name\":\"blessWeightThreshold\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"curseWeightThreshold\",\"type\":\"uint16\"}],\"internalType\":\"structRMN.Config\",\"name\":\"config\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes16\",\"name\":\"subject\",\"type\":\"bytes16\"}],\"name\":\"getCurseProgress\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"curseVoteAddrs\",\"type\":\"address[]\"},{\"internalType\":\"bytes28[]\",\"name\":\"cursesHashes\",\"type\":\"bytes28[]\"},{\"internalType\":\"uint16\",\"name\":\"accumulatedWeight\",\"type\":\"uint16\"},{\"internalType\":\"bool\",\"name\":\"cursed\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getCursedSubjectsCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getPermaBlessedCommitStores\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"offset\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"limit\",\"type\":\"uint256\"}],\"name\":\"getRecordedCurseRelatedOps\",\"outputs\":[{\"components\":[{\"internalType\":\"enumRMN.RecordedCurseRelatedOpTag\",\"name\":\"tag\",\"type\":\"uint8\"},{\"internalType\":\"uint64\",\"name\":\"blockTimestamp\",\"type\":\"uint64\"},{\"internalType\":\"bool\",\"name\":\"cursed\",\"type\":\"bool\"},{\"internalType\":\"address\",\"name\":\"curseVoteAddr\",\"type\":\"address\"},{\"internalType\":\"bytes16\",\"name\":\"subject\",\"type\":\"bytes16\"},{\"internalType\":\"bytes16\",\"name\":\"curseId\",\"type\":\"bytes16\"}],\"internalType\":\"structRMN.RecordedCurseRelatedOp[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRecordedCurseRelatedOpsCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"commitStore\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"root\",\"type\":\"bytes32\"}],\"internalType\":\"structIRMN.TaggedRoot\",\"name\":\"taggedRoot\",\"type\":\"tuple\"}],\"name\":\"isBlessed\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes16\",\"name\":\"subject\",\"type\":\"bytes16\"}],\"name\":\"isCursed\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isCursed\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes16\",\"name\":\"curseId\",\"type\":\"bytes16\"},{\"internalType\":\"bytes16[]\",\"name\":\"subjects\",\"type\":\"bytes16[]\"}],\"name\":\"ownerCurse\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"removes\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"adds\",\"type\":\"address[]\"}],\"name\":\"ownerRemoveThenAddPermaBlessedCommitStores\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"commitStore\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"root\",\"type\":\"bytes32\"}],\"internalType\":\"structIRMN.TaggedRoot[]\",\"name\":\"taggedRoots\",\"type\":\"tuple[]\"}],\"name\":\"ownerResetBlessVotes\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"curseVoteAddr\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"bytes16\",\"name\":\"subject\",\"type\":\"bytes16\"},{\"internalType\":\"bytes28\",\"name\":\"cursesHash\",\"type\":\"bytes28\"}],\"internalType\":\"structRMN.UnvoteToCurseRequest\",\"name\":\"unit\",\"type\":\"tuple\"},{\"internalType\":\"bool\",\"name\":\"forceUnvote\",\"type\":\"bool\"}],\"internalType\":\"structRMN.OwnerUnvoteToCurseRequest[]\",\"name\":\"ownerUnvoteToCurseRequests\",\"type\":\"tuple[]\"}],\"name\":\"ownerUnvoteToCurse\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"blessVoteAddr\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"curseVoteAddr\",\"type\":\"address\"},{\"internalType\":\"uint8\",\"name\":\"blessWeight\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"curseWeight\",\"type\":\"uint8\"}],\"internalType\":\"structRMN.Voter[]\",\"name\":\"voters\",\"type\":\"tuple[]\"},{\"internalType\":\"uint16\",\"name\":\"blessWeightThreshold\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"curseWeightThreshold\",\"type\":\"uint16\"}],\"internalType\":\"structRMN.Config\",\"name\":\"config\",\"type\":\"tuple\"}],\"name\":\"setConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes16\",\"name\":\"subject\",\"type\":\"bytes16\"},{\"internalType\":\"bytes28\",\"name\":\"cursesHash\",\"type\":\"bytes28\"}],\"internalType\":\"structRMN.UnvoteToCurseRequest[]\",\"name\":\"unvoteToCurseRequests\",\"type\":\"tuple[]\"}],\"name\":\"unvoteToCurse\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"commitStore\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"root\",\"type\":\"bytes32\"}],\"internalType\":\"structIRMN.TaggedRoot[]\",\"name\":\"taggedRoots\",\"type\":\"tuple[]\"}],\"name\":\"voteToBless\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes16\",\"name\":\"curseId\",\"type\":\"bytes16\"},{\"internalType\":\"bytes16[]\",\"name\":\"subjects\",\"type\":\"bytes16[]\"}],\"name\":\"voteToCurse\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", + Bin: "0x60806040523480156200001157600080fd5b506040516200596238038062005962833981016040819052620000349162000aff565b33806000816200008b5760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000be57620000be8162000138565b505060408051608081018252600080825260208201819052918101919091526001600160c81b03606082015290506001620000fb81601062000c7d565b82606001516001600160c81b0316901c6001600160c81b0316101562000125576200012562000c99565b506200013181620001e3565b5062000e14565b336001600160a01b03821603620001925760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640162000082565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b620001ee816200071d565b6200020c576040516306b7c75960e31b815260040160405180910390fd5b602081015160038054604084015161ffff908116620100000263ffffffff199092169316929092179190911790555b60025415620003465760028054600091906200025a9060019062000c7d565b815481106200026d576200026d62000caf565b6000918252602080832060408051608081018252600294850290920180546001600160a01b0390811680855260019092015480821685870190815260ff600160a01b8304811687870152600160a81b909204909116606086015291875260058552828720805465ffffffffffff19169055905116855260099092529220805461ffff191690558054919250908062000309576200030962000cc5565b60008281526020902060026000199092019182020180546001600160a01b031916815560010180546001600160b01b03191690559055506200023b565b60005b81515181101562000403578151805160029190839081106200036f576200036f62000caf565b602090810291909101810151825460018181018555600094855293839020825160029092020180546001600160a01b039283166001600160a01b0319909116178155928201519284018054604084015160609094015160ff908116600160a81b0260ff60a81b1991909516600160a01b026001600160a81b0319909216959093169490941793909317161790550162000349565b50600480546000906200041c9063ffffffff1662000cdb565b82546101009290920a63ffffffff8181021990931691831602179091556004541660005b82515160ff821610156200054157600083600001518260ff16815181106200046c576200046c62000caf565b602090810291909101810151604080516060808201835263ffffffff80891683528385015160ff90811684880190815289821685870190815287516001600160a01b03908116600090815260058b5288812097518854945193518616650100000000000260ff60281b199487166401000000000264ffffffffff1990961691909716179390931791909116939093179094558587015190911683526009909552919020805491909201519092166101000261ffff1990921691909117600117905550620005398162000d01565b905062000440565b506001600160a01b0360005260096020527f3bddde647ecb7992f4c710d4e1d59d07614508581f7c22c879a79d28544538a7805461ffff191660011790556004805463ffffffff4381166401000000000263ffffffff60201b1990921691909117909155604051908216907f8c49fda8177c5c8c768eb39634bc6773695c7181711537b822451c12b2efd2a990620005db90859062000d23565b60405180910390a26040805160c08101825260048082526001600160401b03421660208301526000928201839052606082018390526080820183905260a08201839052600c80546001808201835591909452825160029094027fdf6966c971051c3d54ec59162606531493a51404a002842f56009d7e5cf4a8c7018054939490939092849260ff19909216919084908111156200067c576200067c62000dce565b021790555060208201518154604084015160608501516001600160a01b03166a010000000000000000000002600160501b600160f01b031991151569010000000000000000000260ff60481b196001600160401b039095166101000294909416610100600160501b031990931692909217929092179190911617815560808083015160a090930151811c600160801b0292901c919091176001909101555050565b80515160009015806200073257508151516010105b80620007445750602082015161ffff16155b80620007565750604082015161ffff16155b156200076457506000919050565b600080600084600001515160026200077d919062000de4565b6001600160401b0381111562000797576200079762000a24565b604051908082528060200260200182016040528015620007c1578160200160208202803683370190505b50905060005b8551518110156200095457600086600001518281518110620007ed57620007ed62000caf565b6020026020010151905060006001600160a01b031681600001516001600160a01b0316148062000828575060208101516001600160a01b0316155b806200083f575060208101516001600160a01b0316155b8062000858575060208101516001600160a01b03908116145b806200087a5750604081015160ff161580156200087a5750606081015160ff16155b156200088d575060009695505050505050565b8051836200089d84600262000de4565b620008aa90600062000dfe565b81518110620008bd57620008bd62000caf565b6001600160a01b0390921660209283029190910182015281015183620008e584600262000de4565b620008f290600162000dfe565b8151811062000905576200090562000caf565b6001600160a01b03909216602092830291909101909101526040810151620009319060ff168662000dfe565b9450806060015160ff168462000948919062000dfe565b935050600101620007c7565b5060005b8151811015620009f957600082828151811062000979576200097962000caf565b60200260200101519050600082600162000994919062000dfe565b90505b8351811015620009ee57838181518110620009b657620009b662000caf565b60200260200101516001600160a01b0316826001600160a01b031603620009e557506000979650505050505050565b60010162000997565b505060010162000958565b50846020015161ffff16831015801562000a1b5750846040015161ffff168210155b95945050505050565b634e487b7160e01b600052604160045260246000fd5b604051606081016001600160401b038111828210171562000a5f5762000a5f62000a24565b60405290565b604051608081016001600160401b038111828210171562000a5f5762000a5f62000a24565b604051601f8201601f191681016001600160401b038111828210171562000ab55762000ab562000a24565b604052919050565b80516001600160a01b038116811462000ad557600080fd5b919050565b805160ff8116811462000ad557600080fd5b805161ffff8116811462000ad557600080fd5b6000602080838503121562000b1357600080fd5b82516001600160401b038082111562000b2b57600080fd5b8185019150606080838803121562000b4257600080fd5b62000b4c62000a3a565b83518381111562000b5c57600080fd5b8401601f8101891362000b6e57600080fd5b80518481111562000b835762000b8362000a24565b62000b93878260051b0162000a8a565b818152878101955060079190911b82018701908a82111562000bb457600080fd5b918701915b8183101562000c33576080838c03121562000bd45760008081fd5b62000bde62000a65565b62000be98462000abd565b815262000bf889850162000abd565b89820152604062000c0b81860162000ada565b9082015262000c1c84870162000ada565b818701528652948701946080929092019162000bb9565b83525062000c45905084860162000aec565b8582015262000c576040850162000aec565b6040820152979650505050505050565b634e487b7160e01b600052601160045260246000fd5b8181038181111562000c935762000c9362000c67565b92915050565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052603160045260246000fd5b600063ffffffff80831681810362000cf75762000cf762000c67565b6001019392505050565b600060ff821660ff810362000d1a5762000d1a62000c67565b60010192915050565b60006020808352608080840185516060808588015282825180855260a0890191508684019450600093505b8084101562000da157845180516001600160a01b03908116845288820151168884015260408082015160ff9081169185019190915290840151168383015293860193600193909301929085019062000d4e565b509488015161ffff8116604089015294604089015161ffff811660608a0152955098975050505050505050565b634e487b7160e01b600052602160045260246000fd5b808202811582820484141762000c935762000c9362000c67565b8082018082111562000c935762000c9362000c67565b614b3e8062000e246000396000f3fe608060405234801561001057600080fd5b50600436106101825760003560e01c8063631ec73e116100d8578063979986111161008c578063d927f26711610066578063d927f26714610354578063f2fde38b14610374578063f33f28951461038757600080fd5b8063979986111461030b578063ba86a1f01461031e578063bd147ef41461033157600080fd5b806379ba5097116100bd57806379ba5097146102d35780638da5cb5b146102db578063970b8fc21461030357600080fd5b8063631ec73e146102ad5780636ba0526d146102c057600080fd5b8063397796f71161013a5780634102e4f4116101145780634102e4f4146102745780634d61677114610287578063586abe3c1461029a57600080fd5b8063397796f7146102425780633d0cf6101461024a5780633f42ab731461025d57600080fd5b8063181f5a771161016b578063181f5a77146101ba5780632cbc26bb14610203578063328d716c1461022657600080fd5b80630b009be21461018757806315c65588146101a5575b600080fd5b61018f6103a9565b60405161019c9190613e3f565b60405180910390f35b6101b86101b3366004613fdd565b6103ba565b005b6101f66040518060400160405280600981526020017f524d4e20312e352e30000000000000000000000000000000000000000000000081525081565b60405161019c9190614083565b6102166102113660046140f0565b6104e6565b604051901515815260200161019c565b600b5467ffffffffffffffff165b60405190815260200161019c565b6102166105b1565b6101b86102583660046141a0565b61068b565b6102656107ff565b60405161019c939291906142b3565b6101b86102823660046142ff565b610929565b610216610295366004614439565b61093d565b6101b86102a8366004614451565b6109cd565b6101b86102bb3660046144fc565b610a87565b6101b86102ce366004614451565b610ca0565b6101b8610d13565b60005460405173ffffffffffffffffffffffffffffffffffffffff909116815260200161019c565b600c54610234565b6101b86103193660046145d0565b610e10565b6101b861032c3660046145d0565b611368565b61034461033f3660046140f0565b61150d565b60405161019c9493929190614645565b6103676103623660046146b6565b611946565b60405161019c9190614707565b6101b8610382366004614800565b611b68565b61039a610395366004614439565b611b79565b60405161019c9392919061481b565b60606103b56007611de1565b905090565b336000818152600960205260409020805460ff16610421576040517f85412e7f00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff831660048201526024015b60405180910390fd5b60045463ffffffff166000805b85518110156104a757600086828151811061044b5761044b614849565b602002602001015190506000610465858360000151611df5565b905060008061047b6001888b8760008d89611fd6565b91509150801561048d5761048d614878565b85806104965750815b95505050505080600101905061042e565b50806104df576040517ffb106b6a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5050505050565b600b5460009067ffffffffffffffff16810361050457506000919050565b7f0100000000000000000000000000000100000000000000000000000000000000600052600a6020527fcf943f0e419056430919a3fdfd72276bc0b123ebdd670f4152b82bffbfb8bb385468010000000000000000900460ff16806105a657507fffffffffffffffffffffffffffffffff0000000000000000000000000000000082166000908152600a602052604090205468010000000000000000900460ff165b92915050565b919050565b600b5460009067ffffffffffffffff1681036105cd5750600090565b7f0100000000000000000000000000000100000000000000000000000000000000600052600a6020527fcf943f0e419056430919a3fdfd72276bc0b123ebdd670f4152b82bffbfb8bb385468010000000000000000900460ff16806103b55750507f0100000000000000000000000000000000000000000000000000000000000000600052600a6020527f1d4cd6d2639449a552dbfb463b59316946d78c518b3170daa4a4c217bef019ba5468010000000000000000900460ff1690565b6106936126a4565b60005b8251811015610746576106cc8382815181106106b4576106b4614849565b6020026020010151600761272790919063ffffffff16565b1561073e577fdca892154bbc36d0c05ccd01b3d0411875cb1b841fcdeebb384e5d0d6eb06b4483828151811061070457610704614849565b6020026020010151604051610735919073ffffffffffffffffffffffffffffffffffffffff91909116815260200190565b60405180910390a15b600101610696565b5060005b81518110156107fa5761078082828151811061076857610768614849565b6020026020010151600761274990919063ffffffff16565b156107f2577f66b4b4752c65ae8cd2f3a0a48c7dc8b2118c60d5ea15514992eb2ddf56c9cb158282815181106107b8576107b8614849565b60200260200101516040516107e9919073ffffffffffffffffffffffffffffffffffffffff91909116815260200190565b60405180910390a15b60010161074a565b505050565b6040805160608082018352808252600060208084018290528385018290526004548551600280549384028201608090810190985294810183815263ffffffff808416986401000000009094041696959194919385939192859285015b828210156108f95760008481526020908190206040805160808101825260028602909201805473ffffffffffffffffffffffffffffffffffffffff90811684526001918201549081168486015260ff740100000000000000000000000000000000000000008204811693850193909352750100000000000000000000000000000000000000000090049091166060830152908352909201910161085b565b505050908252506001919091015461ffff8082166020840152620100009091041660409091015292939192919050565b6109316126a4565b61093a8161276b565b50565b600060068161099b610954368690038601866148a7565b80516020918201516040805173ffffffffffffffffffffffffffffffffffffffff909316838501528281019190915280518083038201815260609092019052805191012090565b815260208101919091526040016000205460ff16806105a657506105a66109c56020840184614800565b600790612eef565b337fffffffffffffffffffffffff000000000000000000000000000000000000000181016109fd576109fd614878565b73ffffffffffffffffffffffffffffffffffffffff81166000908152600960205260409020805460ff16610a75576040517f85412e7f00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff83166004820152602401610418565b610a8182858584612f1e565b50505050565b610a8f6126a4565b600454600090819063ffffffff16815b8451811015610b66576000858281518110610abc57610abc614849565b602002602001015190506000610ada84836020015160000151611df5565b9050600080610b3d600087866000015187602001518860400151600960008b6000015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002089611fd6565b915091508680610b4a5750815b96508780610b555750805b975050505050806001019050610a9f565b508215610c615760408051600280546080602082028401810190945260608301818152610c61948492849160009085015b82821015610c355760008481526020908190206040805160808101825260028602909201805473ffffffffffffffffffffffffffffffffffffffff90811684526001918201549081168486015260ff7401000000000000000000000000000000000000000082048116938501939093527501000000000000000000000000000000000000000000900490911660608301529083529092019101610b97565b505050908252506001919091015461ffff8082166020840152620100009091041660409091015261276b565b8180610c6a5750825b610a81576040517ffb106b6a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610ca86126a4565b73ffffffffffffffffffffffffffffffffffffffff60005260096020527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f3bddde647ecb7992f4c710d4e1d59d07614508581f7c22c879a79d28544538a7610a8182858584612f1e565b60015473ffffffffffffffffffffffffffffffffffffffff163314610d94576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e6572000000000000000000006044820152606401610418565b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b610e397f01000000000000000000000000000001000000000000000000000000000000006104e6565b15610e70576040517fcde2d97c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600454336000908152600560209081526040918290208251606081018452905463ffffffff81811680845260ff64010000000084048116958501959095526501000000000090920490931693820193909352921691908214610f00576040517f85412e7f000000000000000000000000000000000000000000000000000000008152336004820152602401610418565b600160005b8481101561132f576000868683818110610f2157610f21614849565b905060400201803603810190610f3791906148a7565b90506000610f868280516020918201516040805173ffffffffffffffffffffffffffffffffffffffff909316838501528281019190915280518083038201815260609092019052805191012090565b6000818152600660209081526040918290208251608081018452905460ff81161580158352610100820463ffffffff169383019390935265010000000000810461ffff169382019390935267010000000000000090920478ffffffffffffffffffffffffffffffffffffffffffffffffff16606083015291925090611062573373ffffffffffffffffffffffffffffffffffffffff168763ffffffff167f274d6d5b916b0a53974b7ab86c844b97a2e03a60f658cd9a4b1c028b604d7bf18560405161105291906148e0565b60405180910390a3505050611327565b8663ffffffff16816020015163ffffffff16146110a8575060408051608081018252600080825263ffffffff89166020830152918101829052606081019190915261110c565b6110ba816060015187604001516136d6565b1561110c573373ffffffffffffffffffffffffffffffffffffffff168763ffffffff167f6dfbb745226fa630aeb1b9557d17d508ddb789a04f0cb873ec16e58beb8beead8560405161105291906148e0565b6000945061112281606001518760400151613718565b78ffffffffffffffffffffffffffffffffffffffffffffffffff166060820152602086015160408201805160ff9092169161115e90839061493c565b61ffff1690525060208681015160408051865173ffffffffffffffffffffffffffffffffffffffff168152868401519381019390935260ff9091168282015251339163ffffffff8a16917f2a08a2bd2798f0aae9a843f0f4ad4de488c1b3d5f04049940cfed736ad69fb979181900360600190a3600354604082015161ffff91821691161061125757600181526040808201518151855173ffffffffffffffffffffffffffffffffffffffff1681526020808701519082015261ffff90911681830152905163ffffffff8916917f8257378aa73bf8e4ada848713526584a3dcee0fd3db3beed7397f7a7f5067cc9919081900360600190a25b60009182526006602090815260409283902082518154928401519484015160609094015178ffffffffffffffffffffffffffffffffffffffffffffffffff166701000000000000000266ffffffffffffff61ffff90951665010000000000029490941664ffffffffff63ffffffff909616610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffff00000000ff921515929092167fffffffffffffffffffffffffffffffffffffffffffffffffffffff000000000090941693909317179390931617179055505b600101610f05565b5080156104df576040517f604c767700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6113706126a4565b60045463ffffffff1660005b82811015610a8157600084848381811061139857611398614849565b9050604002018036038101906113ae91906148a7565b905060006113fd8280516020918201516040805173ffffffffffffffffffffffffffffffffffffffff909316838501528281019190915280518083038201815260609092019052805191012090565b60008181526006602081815260408084208151608081018352815460ff811615158252610100810463ffffffff90811683870190815265010000000000830461ffff169584019590955267010000000000000090910478ffffffffffffffffffffffffffffffffffffffffffffffffff16606083015287875294909352939093558051925193945092878216911614806114945750805b156114fe5760408051855173ffffffffffffffffffffffffffffffffffffffff1681526020808701519082015282151581830152905163ffffffff8816917f7d15a6eebaa019ea7d5b7d38937c51ebd3befbfdf51bb630a694fd28635bbcba919081900360600190a25b5050505080600101905061137c565b600454604080516002805460806020820284018101909452606083810182815290958695600095869563ffffffff9093169486949193928492918491879085015b828210156115ec5760008481526020908190206040805160808101825260028602909201805473ffffffffffffffffffffffffffffffffffffffff90811684526001918201549081168486015260ff740100000000000000000000000000000000000000008204811693850193909352750100000000000000000000000000000000000000000090049091166060830152908352909201910161154e565b505050908252506001919091015461ffff80821660208085019190915262010000909204166040928301527fffffffffffffffffffffffffffffffff000000000000000000000000000000008a166000908152600a909152908120805460ff6801000000000000000082041696509293509163ffffffff80861691161080156116725750845b6000965090508560015b60028111611939578451515b6000808760000151518310156116e35787518051849081106116ac576116ac614849565b6020026020010151602001519150876000015183815181106116d0576116d0614849565b602002602001015160600151905061170a565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff905060005b73ffffffffffffffffffffffffffffffffffffffff82166000908152600188016020908152604080832081518083019092525463ffffffff811682526401000000009004821b63ffffffff19169181019190915290878061177a57508a63ffffffff16826000015163ffffffff16145b8061179a575073ffffffffffffffffffffffffffffffffffffffff848116145b80156117b05750602082015163ffffffff191615155b9050801561186d57856001036117d0576117c987614957565b965061186d565b85600203610182576117e560ff84168e61493c565b9c506117f08761498f565b9650838f888151811061180557611805614849565b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505081602001518e888151811061185657611856614849565b63ffffffff19909216602092830291909101909101525b84156118835761187c8561498f565b945061188c565b50505050611895565b50505050611688565b81600103611928578267ffffffffffffffff8111156118b6576118b6613e52565b6040519080825280602002602001820160405280156118df578160200160208202803683370190505b509a508267ffffffffffffffff8111156118fb576118fb613e52565b604051908082528060200260200182016040528015611924578160200160208202803683370190505b5099505b5061193281614957565b905061167c565b5050505050509193509193565b600c5460609060009061195984866149c4565b11611965575081611988565b600c5484101561198457600c5461197d9085906149d7565b9050611988565b5060005b60008167ffffffffffffffff8111156119a3576119a3613e52565b604051908082528060200260200182016040528015611a2157816020015b6040805160c08101825260008082526020808301829052928201819052606082018190526080820181905260a082015282527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9092019101816119c15790505b50905060005b82811015611b5f57600c611a3b82886149c4565b81548110611a4b57611a4b614849565b600091825260209091206040805160c081019091526002909202018054829060ff166004811115611a7e57611a7e6146d8565b6004811115611a8f57611a8f6146d8565b81528154610100810467ffffffffffffffff1660208301526901000000000000000000810460ff16151560408301526a0100000000000000000000900473ffffffffffffffffffffffffffffffffffffffff166060820152600190910154608081811b7fffffffffffffffffffffffffffffffff0000000000000000000000000000000090811682850152700100000000000000000000000000000000909204901b1660a0909101528251839083908110611b4c57611b4c614849565b6020908102919091010152600101611a27565b50949350505050565b611b706126a4565b61093a8161373b565b606060008080611b91610954368790038701876148a7565b6000818152600660209081526040918290208251608081018452905460ff81161515808352610100820463ffffffff90811694840185905265010000000000830461ffff169584019590955267010000000000000090910478ffffffffffffffffffffffffffffffffffffffffffffffffff166060830152600454909650939450929091169003611dd85760408101516060820151909450611c3281613830565b60ff1667ffffffffffffffff811115611c4d57611c4d613e52565b604051908082528060200260200182016040528015611c76578160200160208202803683370190505b506002805460408051602080840282018101909252828152939950600093929190849084015b82821015611d3a5760008481526020908190206040805160808101825260028602909201805473ffffffffffffffffffffffffffffffffffffffff90811684526001918201549081168486015260ff7401000000000000000000000000000000000000000082048116938501939093527501000000000000000000000000000000000000000000900490911660608301529083529092019101611c9c565b5050505090506000805b82518160ff161015611dd357611d5a84826136d6565b15611dc357828160ff1681518110611d7457611d74614849565b602002602001015160000151898381518110611d9257611d92614849565b73ffffffffffffffffffffffffffffffffffffffff90921660209283029190910190910152611dc082614957565b91505b611dcc816149ea565b9050611d44565b505050505b50509193909250565b60606000611dee8361389f565b9392505050565b7fffffffffffffffffffffffffffffffff0000000000000000000000000000000081166000908152600a60205260408120805463ffffffff858116911614611dee57805463ffffffff19811663ffffffff861690811783556003547fffffffffffffffffffffffffffffffffffffffffffffffffffff000000000000909216176201000090910461ffff1664010000000002177fffffffffffffffffffffffffffffffffffffffffffffffff0000ffffffffffff1680825568010000000000000000900460ff1615611dee57600260005b8154811015611fcd576000826000018281548110611ee657611ee6614849565b6000918252602080832060016002909302018281015473ffffffffffffffffffffffffffffffffffffffff1684529187019052604090912080549192509063ffffffff808a169116108015611f4d57508054640100000000900460201b63ffffffff191615155b15611fc357805463ffffffff191663ffffffff891617815560018201548554750100000000000000000000000000000000000000000090910460ff16908690600690611fa89084906601000000000000900461ffff1661493c565b92506101000a81548161ffff021916908361ffff1602179055505b5050600101611ec6565b50509392505050565b6000806001896001811115611fed57611fed6146d8565b148061200a57506000896001811115612008576120086146d8565b145b61201657612016614878565b8480612037575073ffffffffffffffffffffffffffffffffffffffff878116145b80612056575073ffffffffffffffffffffffffffffffffffffffff8716155b1561207c57600089600181111561206f5761206f6146d8565b1461207c5761207c614878565b73ffffffffffffffffffffffffffffffffffffffff8716600090815260018401602090815260409182902082518084019093525463ffffffff811683526401000000009004811b63ffffffff191690820152845460ff16801561210d575073ffffffffffffffffffffffffffffffffffffffff888116148061210d57508863ffffffff16816000015163ffffffff16145b80156121235750602081015163ffffffff191615155b801561214b5750866020015163ffffffff1916816020015163ffffffff1916148061214b5750855b156122765773ffffffffffffffffffffffffffffffffffffffff881660009081526001858101602052604082209190915585548554919450610100900460ff169085906006906121aa9084906601000000000000900461ffff16614a09565b825461010092830a61ffff818102199092169282160291909117909255895188546020808d01518a54604080517fffffffffffffffffffffffffffffffff0000000000000000000000000000000090961686529590930460ff169184019190915263ffffffff1916828401526601000000000000900490921660608301525173ffffffffffffffffffffffffffffffffffffffff8b16925063ffffffff8c16917fa96a155bd67c927a6c056befbd979b78465e2b2f1276bf7d4e90a31d4f430aa8919081900360800190a35b6000808b600181111561228b5761228b6146d8565b1480156122b3575083806122b3575073ffffffffffffffffffffffffffffffffffffffff8916155b90508080156122cf5750845468010000000000000000900460ff165b80156122e157506122df856138fb565b155b156123b45784547fffffffffffffffffffffffffffffffffffffffffffffff00ffffffffffffffff168555600b80546001945060009061232a9067ffffffffffffffff16614a24565b91906101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055507f65d0e78c3625f0956f58610cf0fb157eaf627683258875ef29af2f71d25ac8fd88600001516040516123ab91907fffffffffffffffffffffffffffffffff0000000000000000000000000000000091909116815260200190565b60405180910390a15b83806123bd5750825b15612605576000808c60018111156123d7576123d76146d8565b036123f25787156123ea5750600361240f565b50600261240f565b60018c6001811115612406576124066146d8565b03610182575060015b600c6040518060c0016040528083600481111561242e5761242e6146d8565b81526020014267ffffffffffffffff168152885468010000000000000000900460ff16151560208083019190915273ffffffffffffffffffffffffffffffffffffffff8e1660408301528c517fffffffffffffffffffffffffffffffff00000000000000000000000000000000166060830152600060809092018290528354600180820186559483529120825160029092020180549293909283917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0090911690836004811115612500576125006146d8565b0217905550602082015181546040840151606085015173ffffffffffffffffffffffffffffffffffffffff166a0100000000000000000000027fffff0000000000000000000000000000000000000000ffffffffffffffffffff9115156901000000000000000000027fffffffffffffffffffffffffffffffffffffffffffff00ffffffffffffffffff67ffffffffffffffff90951661010002949094167fffffffffffffffffffffffffffffffffffffffffffff000000000000000000ff90931692909217929092179190911617815560808083015160a090930151811c7001000000000000000000000000000000000292901c9190911760019091015550612696565b8751602080840151818b0151604080517fffffffffffffffffffffffffffffffff00000000000000000000000000000000909516855263ffffffff1992831693850193909352169082015273ffffffffffffffffffffffffffffffffffffffff8a16907fbabb0d7099e6ca14a29fad2a2cfb4fda2bd30f97cb3c27e546174bfb4277c1cc9060600160405180910390a25b505097509795505050505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314612725576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e6572000000000000000000006044820152606401610418565b565b6000611dee8373ffffffffffffffffffffffffffffffffffffffff841661395c565b6000611dee8373ffffffffffffffffffffffffffffffffffffffff8416613a56565b61277481613aa5565b6127aa576040517f35be3ac800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b602081015160038054604084015161ffff908116620100000263ffffffff199092169316929092179190911790555b6002541561298e5760028054600091906127f5906001906149d7565b8154811061280557612805614849565b60009182526020808320604080516080810182526002948502909201805473ffffffffffffffffffffffffffffffffffffffff90811680855260019092015480821685870190815260ff740100000000000000000000000000000000000000008304811687870152750100000000000000000000000000000000000000000090920490911660608601529187526005855282872080547fffffffffffffffffffffffffffffffffffffffffffffffffffff00000000000016905590511685526009909252922080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00001690558054919250908061290457612904614a66565b60008281526020902060027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9092019182020180547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560010180547fffffffffffffffffffff000000000000000000000000000000000000000000001690559055506127d9565b60005b815151811015612ac1578151805160029190839081106129b3576129b3614849565b6020908102919091018101518254600181810185556000948552938390208251600290920201805473ffffffffffffffffffffffffffffffffffffffff9283167fffffffffffffffffffffffff0000000000000000000000000000000000000000909116178155928201519284018054604084015160609094015160ff9081167501000000000000000000000000000000000000000000027fffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffff9190951674010000000000000000000000000000000000000000027fffffffffffffffffffffff0000000000000000000000000000000000000000009092169590931694909417939093171617905501612991565b5060048054600090612ad89063ffffffff16614a95565b82546101009290920a63ffffffff8181021990931691831602179091556004541660005b82515160ff82161015612c5557600083600001518260ff1681518110612b2457612b24614849565b602090810291909101810151604080516060808201835263ffffffff80891683528385015160ff908116848801908152898216858701908152875173ffffffffffffffffffffffffffffffffffffffff908116600090815260058b528881209751885494519351861665010000000000027fffffffffffffffffffffffffffffffffffffffffffffffffffff00ffffffffff948716640100000000027fffffffffffffffffffffffffffffffffffffffffffffffffffffff00000000009096169190971617939093179190911693909317909455858701519091168352600990955291902080549190920151909216610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000090921691909117600117905550612c4e816149ea565b9050612afc565b5073ffffffffffffffffffffffffffffffffffffffff60005260096020527f3bddde647ecb7992f4c710d4e1d59d07614508581f7c22c879a79d28544538a780547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00001660011790556004805463ffffffff438116640100000000027fffffffffffffffffffffffffffffffffffffffffffffffff00000000ffffffff90921691909117909155604051908216907f8c49fda8177c5c8c768eb39634bc6773695c7181711537b822451c12b2efd2a990612d2f908590614ab8565b60405180910390a26040805160c081018252600480825267ffffffffffffffff421660208301526000928201839052606082018390526080820183905260a08201839052600c80546001808201835591909452825160029094027fdf6966c971051c3d54ec59162606531493a51404a002842f56009d7e5cf4a8c701805493949093909284927fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0090921691908490811115612dec57612dec6146d8565b0217905550602082015181546040840151606085015173ffffffffffffffffffffffffffffffffffffffff166a0100000000000000000000027fffff0000000000000000000000000000000000000000ffffffffffffffffffff9115156901000000000000000000027fffffffffffffffffffffffffffffffffffffffffffff00ffffffffffffffffff67ffffffffffffffff90951661010002949094167fffffffffffffffffffffffffffffffffffffffffffff000000000000000000ff90931692909217929092179190911617815560808083015160a090930151811c7001000000000000000000000000000000000292901c919091176001909101555050565b73ffffffffffffffffffffffffffffffffffffffff811660009081526001830160205260408120541515611dee565b8151600003612f59576040517f55e9b08b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7fffffffffffffffffffffffffffffffff000000000000000000000000000000008316600090815260018201602052604090205460ff1615613007576040517f078f340000000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff851660048201527fffffffffffffffffffffffffffffffff0000000000000000000000000000000084166024820152604401610418565b7fffffffffffffffffffffffffffffffff000000000000000000000000000000008316600090815260018281016020526040822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016909117905560045463ffffffff16905b83518110156136ce57600181101580156130ed575083818151811061309657613096614849565b60200260200101516fffffffffffffffffffffffffffffffff1916846001836130bf91906149d7565b815181106130cf576130cf614849565b60200260200101516fffffffffffffffffffffffffffffffff191610155b15613124576040517f2432d8ea00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600084828151811061313857613138614849565b60200260200101519050600061314e8483611df5565b73ffffffffffffffffffffffffffffffffffffffff8981166000818152600184016020908152604080832081518083019092525463ffffffff811682526401000000009004821b63ffffffff19169181019190915293945091148015906131be5750815163ffffffff8088169116105b806131d25750602082015163ffffffff1916155b15613225575085548254600091610100900460ff169084906006906132069084906601000000000000900461ffff1661493c565b92506101000a81548161ffff021916908361ffff16021790555061322c565b5060208101515b60408051808201825263ffffffff88168152815163ffffffff1984166020828101919091527fffffffffffffffffffffffffffffffff000000000000000000000000000000008d16828501528351808303850181526060909201909352805190830120909182019063ffffffff1916905273ffffffffffffffffffffffffffffffffffffffff8b166000818152600186016020908152604090912083518285015190921c6401000000000263ffffffff92831617905589549294509091908816907f8137bc8a8d712aaa27bfc6506d5566ac405618bd53f9831b8ca6b6fe5442ee7a9087908d9060ff610100909104166133234290565b6020898101518b54604080517fffffffffffffffffffffffffffffffff000000000000000000000000000000009889168152979096169287019290925260ff9093169385019390935267ffffffffffffffff16606084015263ffffffff191660808301526601000000000000900461ffff1660a082015260c00160405180910390a363ffffffff1981161580156133c85750825468010000000000000000900460ff16155b80156133d857506133d8836138fb565b156134c35782547fffffffffffffffffffffffffffffffffffffffffffffff00ffffffffffffffff1668010000000000000000178355600b80546000906134289067ffffffffffffffff16614acb565b91906101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055508563ffffffff167fcfdbfd8ce9a56b5f7c202c0e102184d24f47ca87121dc165063fc4c290957bde8561347e4290565b604080517fffffffffffffffffffffffffffffffff00000000000000000000000000000000909316835267ffffffffffffffff90911660208301520160405180910390a25b6040805160c081018252600080825267ffffffffffffffff42166020830152855460ff680100000000000000009091041615159282019290925273ffffffffffffffffffffffffffffffffffffffff8c1660608201527fffffffffffffffffffffffffffffffff0000000000000000000000000000000086811660808301528b1660a0820152600c80546001808201835591909352815160029093027fdf6966c971051c3d54ec59162606531493a51404a002842f56009d7e5cf4a8c701805492939092909183917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016908360048111156135c0576135c06146d8565b0217905550602082015181546040840151606085015173ffffffffffffffffffffffffffffffffffffffff166a0100000000000000000000027fffff0000000000000000000000000000000000000000ffffffffffffffffffff9115156901000000000000000000027fffffffffffffffffffffffffffffffffffffffffffff00ffffffffffffffffff67ffffffffffffffff90951661010002949094167fffffffffffffffffffffffffffffffffffffffffffff000000000000000000ff90931692909217929092179190911617815560808083015160a090930151811c7001000000000000000000000000000000000292901c9190911760019182015594909401935061306f92505050565b505050505050565b600060108260ff16106136eb576136eb614878565b50600160ff82161b821678ffffffffffffffffffffffffffffffffffffffffffffffffff16151592915050565b600060108260ff161061372d5761372d614878565b50600160ff919091161b1790565b3373ffffffffffffffffffffffffffffffffffffffff8216036137ba576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c660000000000000000006044820152606401610418565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b60006201000078ffffffffffffffffffffffffffffffffffffffffffffffffff83161061385f5761385f614878565b78ffffffffffffffffffffffffffffffffffffffffffffffffff8216156105ac5761388b600183614ae8565b90911690613898816149ea565b905061385f565b6060816000018054806020026020016040519081016040528092919081815260200182805480156138ef57602002820191906000526020600020905b8154815260200190600101908083116138db575b50505050509050919050565b73ffffffffffffffffffffffffffffffffffffffff600090815260018201602090815260408220546401000000009004901b63ffffffff19161515806105a65750505461ffff64010000000082048116660100000000000090920416101590565b60008181526001830160205260408120548015613a455760006139806001836149d7565b8554909150600090613994906001906149d7565b90508082146139f95760008660000182815481106139b4576139b4614849565b90600052602060002001549050808760000184815481106139d7576139d7614849565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080613a0a57613a0a614a66565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506105a6565b60009150506105a6565b5092915050565b6000818152600183016020526040812054613a9d575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556105a6565b5060006105a6565b8051516000901580613ab957508151516010105b80613aca5750602082015161ffff16155b80613adb5750604082015161ffff16155b15613ae857506000919050565b60008060008460000151516002613aff9190614b1a565b67ffffffffffffffff811115613b1757613b17613e52565b604051908082528060200260200182016040528015613b40578160200160208202803683370190505b50905060005b855151811015613d1157600086600001518281518110613b6857613b68614849565b60200260200101519050600073ffffffffffffffffffffffffffffffffffffffff16816000015173ffffffffffffffffffffffffffffffffffffffff161480613bc95750602081015173ffffffffffffffffffffffffffffffffffffffff16155b80613bec5750602081015173ffffffffffffffffffffffffffffffffffffffff16155b80613c115750602081015173ffffffffffffffffffffffffffffffffffffffff908116145b80613c315750604081015160ff16158015613c315750606081015160ff16155b15613c43575060009695505050505050565b805183613c51846002614b1a565b613c5c9060006149c4565b81518110613c6c57613c6c614849565b73ffffffffffffffffffffffffffffffffffffffff90921660209283029190910182015281015183613c9f846002614b1a565b613caa9060016149c4565b81518110613cba57613cba614849565b73ffffffffffffffffffffffffffffffffffffffff909216602092830291909101909101526040810151613cf19060ff16866149c4565b9450806060015160ff1684613d0691906149c4565b935050600101613b46565b5060005b8151811015613dc3576000828281518110613d3257613d32614849565b602002602001015190506000826001613d4b91906149c4565b90505b8351811015613db957838181518110613d6957613d69614849565b602002602001015173ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603613db157506000979650505050505050565b600101613d4e565b5050600101613d15565b50846020015161ffff168310158015613de45750846040015161ffff168210155b95945050505050565b60008151808452602080850194506020840160005b83811015613e3457815173ffffffffffffffffffffffffffffffffffffffff1687529582019590820190600101613e02565b509495945050505050565b602081526000611dee6020830184613ded565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040805190810167ffffffffffffffff81118282101715613ea457613ea4613e52565b60405290565b6040516060810167ffffffffffffffff81118282101715613ea457613ea4613e52565b6040516080810167ffffffffffffffff81118282101715613ea457613ea4613e52565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715613f3757613f37613e52565b604052919050565b600067ffffffffffffffff821115613f5957613f59613e52565b5060051b60200190565b80357fffffffffffffffffffffffffffffffff00000000000000000000000000000000811681146105ac57600080fd5b600060408284031215613fa557600080fd5b613fad613e81565b9050613fb882613f63565b8152602082013563ffffffff1981168114613fd257600080fd5b602082015292915050565b60006020808385031215613ff057600080fd5b823567ffffffffffffffff81111561400757600080fd5b8301601f8101851361401857600080fd5b803561402b61402682613f3f565b613ef0565b8082825260208201915060208360061b85010192508783111561404d57600080fd5b6020840193505b82841015614078576140668885613f93565b82528482019150604084019350614054565b979650505050505050565b60006020808352835180602085015260005b818110156140b157858101830151858201604001528201614095565b5060006040828601015260407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8301168501019250505092915050565b60006020828403121561410257600080fd5b611dee82613f63565b803573ffffffffffffffffffffffffffffffffffffffff811681146105ac57600080fd5b600082601f83011261414057600080fd5b8135602061415061402683613f3f565b8083825260208201915060208460051b87010193508684111561417257600080fd5b602086015b84811015614195576141888161410b565b8352918301918301614177565b509695505050505050565b600080604083850312156141b357600080fd5b823567ffffffffffffffff808211156141cb57600080fd5b6141d78683870161412f565b935060208501359150808211156141ed57600080fd5b506141fa8582860161412f565b9150509250929050565b8051606080845281518482018190526000926080916020918201918388019190865b82811015614280578451805173ffffffffffffffffffffffffffffffffffffffff908116865283820151168386015260408082015160ff908116918701919091529088015116878501529381019392850192600101614226565b508781015161ffff81168a83015295505050604086015193506142a9604088018561ffff169052565b9695505050505050565b600063ffffffff808616835280851660208401525060606040830152613de46060830184614204565b803560ff811681146105ac57600080fd5b803561ffff811681146105ac57600080fd5b6000602080838503121561431257600080fd5b823567ffffffffffffffff8082111561432a57600080fd5b8185019150606080838803121561434057600080fd5b614348613eaa565b83358381111561435757600080fd5b84019250601f8301881361436a57600080fd5b823561437861402682613f3f565b81815260079190911b8401860190868101908a83111561439757600080fd5b948701945b82861015614409576080868c0312156143b55760008081fd5b6143bd613ecd565b6143c68761410b565b81526143d389880161410b565b8982015260406143e48189016142dc565b908201526143f38787016142dc565b818701528252608095909501949087019061439c565b83525061441990508486016142ed565b85820152614429604085016142ed565b6040820152979650505050505050565b60006040828403121561444b57600080fd5b50919050565b6000806040838503121561446457600080fd5b61446d83613f63565b915060208084013567ffffffffffffffff81111561448a57600080fd5b8401601f8101861361449b57600080fd5b80356144a961402682613f3f565b81815260059190911b820183019083810190888311156144c857600080fd5b928401925b828410156144ed576144de84613f63565b825292840192908401906144cd565b80955050505050509250929050565b6000602080838503121561450f57600080fd5b823567ffffffffffffffff81111561452657600080fd5b8301601f8101851361453757600080fd5b803561454561402682613f3f565b81815260079190911b8201830190838101908783111561456457600080fd5b928401925b8284101561407857608084890312156145825760008081fd5b61458a613eaa565b6145938561410b565b81526145a189878701613f93565b86820152606085013580151581146145b95760008081fd5b604082015282526080939093019290840190614569565b600080602083850312156145e357600080fd5b823567ffffffffffffffff808211156145fb57600080fd5b818501915085601f83011261460f57600080fd5b81358181111561461e57600080fd5b8660208260061b850101111561463357600080fd5b60209290920196919550909350505050565b6080815260006146586080830187613ded565b82810360208481019190915286518083528782019282019060005b8181101561469657845163ffffffff191683529383019391830191600101614673565b505061ffff96909616604085015250505090151560609091015292915050565b600080604083850312156146c957600080fd5b50508035926020909101359150565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b60208082528251828201819052600091906040908185019086840185805b838110156147f2578251805160058110614766577f4e487b710000000000000000000000000000000000000000000000000000000084526021600452602484fd5b86528088015167ffffffffffffffff16888701528681015115158787015260608082015173ffffffffffffffffffffffffffffffffffffffff16908701526080808201517fffffffffffffffffffffffffffffffff000000000000000000000000000000009081169188019190915260a091820151169086015260c09094019391860191600101614725565b509298975050505050505050565b60006020828403121561481257600080fd5b611dee8261410b565b60608152600061482e6060830186613ded565b61ffff94909416602083015250901515604090910152919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b6000604082840312156148b957600080fd5b6148c1613e81565b6148ca8361410b565b8152602083013560208201528091505092915050565b815173ffffffffffffffffffffffffffffffffffffffff16815260208083015190820152604081016105a6565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b61ffff818116838216019080821115613a4f57613a4f61490d565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036149885761498861490d565b5060010190565b60008161499e5761499e61490d565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190565b808201808211156105a6576105a661490d565b818103818111156105a6576105a661490d565b600060ff821660ff8103614a0057614a0061490d565b60010192915050565b61ffff828116828216039080821115613a4f57613a4f61490d565b600067ffffffffffffffff821680614a3e57614a3e61490d565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0192915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b600063ffffffff808316818103614aae57614aae61490d565b6001019392505050565b602081526000611dee6020830184614204565b600067ffffffffffffffff808316818103614aae57614aae61490d565b78ffffffffffffffffffffffffffffffffffffffffffffffffff828116828216039080821115613a4f57613a4f61490d565b80820281158282048414176105a6576105a661490d56fea164736f6c6343000818000a", +} + +var RMNContractABI = RMNContractMetaData.ABI + +var RMNContractBin = RMNContractMetaData.Bin + +func DeployRMNContract(auth *bind.TransactOpts, backend bind.ContractBackend, config RMNConfig) (common.Address, *types.Transaction, *RMNContract, error) { + parsed, err := RMNContractMetaData.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(RMNContractBin), backend, config) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &RMNContract{address: address, abi: *parsed, RMNContractCaller: RMNContractCaller{contract: contract}, RMNContractTransactor: RMNContractTransactor{contract: contract}, RMNContractFilterer: RMNContractFilterer{contract: contract}}, nil +} + +type RMNContract struct { + address common.Address + abi abi.ABI + RMNContractCaller + RMNContractTransactor + RMNContractFilterer +} + +type RMNContractCaller struct { + contract *bind.BoundContract +} + +type RMNContractTransactor struct { + contract *bind.BoundContract +} + +type RMNContractFilterer struct { + contract *bind.BoundContract +} + +type RMNContractSession struct { + Contract *RMNContract + CallOpts bind.CallOpts + TransactOpts bind.TransactOpts +} + +type RMNContractCallerSession struct { + Contract *RMNContractCaller + CallOpts bind.CallOpts +} + +type RMNContractTransactorSession struct { + Contract *RMNContractTransactor + TransactOpts bind.TransactOpts +} + +type RMNContractRaw struct { + Contract *RMNContract +} + +type RMNContractCallerRaw struct { + Contract *RMNContractCaller +} + +type RMNContractTransactorRaw struct { + Contract *RMNContractTransactor +} + +func NewRMNContract(address common.Address, backend bind.ContractBackend) (*RMNContract, error) { + abi, err := abi.JSON(strings.NewReader(RMNContractABI)) + if err != nil { + return nil, err + } + contract, err := bindRMNContract(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &RMNContract{address: address, abi: abi, RMNContractCaller: RMNContractCaller{contract: contract}, RMNContractTransactor: RMNContractTransactor{contract: contract}, RMNContractFilterer: RMNContractFilterer{contract: contract}}, nil +} + +func NewRMNContractCaller(address common.Address, caller bind.ContractCaller) (*RMNContractCaller, error) { + contract, err := bindRMNContract(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &RMNContractCaller{contract: contract}, nil +} + +func NewRMNContractTransactor(address common.Address, transactor bind.ContractTransactor) (*RMNContractTransactor, error) { + contract, err := bindRMNContract(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &RMNContractTransactor{contract: contract}, nil +} + +func NewRMNContractFilterer(address common.Address, filterer bind.ContractFilterer) (*RMNContractFilterer, error) { + contract, err := bindRMNContract(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &RMNContractFilterer{contract: contract}, nil +} + +func bindRMNContract(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := RMNContractMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +func (_RMNContract *RMNContractRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _RMNContract.Contract.RMNContractCaller.contract.Call(opts, result, method, params...) +} + +func (_RMNContract *RMNContractRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _RMNContract.Contract.RMNContractTransactor.contract.Transfer(opts) +} + +func (_RMNContract *RMNContractRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _RMNContract.Contract.RMNContractTransactor.contract.Transact(opts, method, params...) +} + +func (_RMNContract *RMNContractCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _RMNContract.Contract.contract.Call(opts, result, method, params...) +} + +func (_RMNContract *RMNContractTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _RMNContract.Contract.contract.Transfer(opts) +} + +func (_RMNContract *RMNContractTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _RMNContract.Contract.contract.Transact(opts, method, params...) +} + +func (_RMNContract *RMNContractCaller) GetBlessProgress(opts *bind.CallOpts, taggedRoot IRMNTaggedRoot) (GetBlessProgress, + + error) { + var out []interface{} + err := _RMNContract.contract.Call(opts, &out, "getBlessProgress", taggedRoot) + + outstruct := new(GetBlessProgress) + if err != nil { + return *outstruct, err + } + + outstruct.BlessVoteAddrs = *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) + outstruct.AccumulatedWeight = *abi.ConvertType(out[1], new(uint16)).(*uint16) + outstruct.Blessed = *abi.ConvertType(out[2], new(bool)).(*bool) + + return *outstruct, err + +} + +func (_RMNContract *RMNContractSession) GetBlessProgress(taggedRoot IRMNTaggedRoot) (GetBlessProgress, + + error) { + return _RMNContract.Contract.GetBlessProgress(&_RMNContract.CallOpts, taggedRoot) +} + +func (_RMNContract *RMNContractCallerSession) GetBlessProgress(taggedRoot IRMNTaggedRoot) (GetBlessProgress, + + error) { + return _RMNContract.Contract.GetBlessProgress(&_RMNContract.CallOpts, taggedRoot) +} + +func (_RMNContract *RMNContractCaller) GetConfigDetails(opts *bind.CallOpts) (GetConfigDetails, + + error) { + var out []interface{} + err := _RMNContract.contract.Call(opts, &out, "getConfigDetails") + + outstruct := new(GetConfigDetails) + if err != nil { + return *outstruct, err + } + + outstruct.Version = *abi.ConvertType(out[0], new(uint32)).(*uint32) + outstruct.BlockNumber = *abi.ConvertType(out[1], new(uint32)).(*uint32) + outstruct.Config = *abi.ConvertType(out[2], new(RMNConfig)).(*RMNConfig) + + return *outstruct, err + +} + +func (_RMNContract *RMNContractSession) GetConfigDetails() (GetConfigDetails, + + error) { + return _RMNContract.Contract.GetConfigDetails(&_RMNContract.CallOpts) +} + +func (_RMNContract *RMNContractCallerSession) GetConfigDetails() (GetConfigDetails, + + error) { + return _RMNContract.Contract.GetConfigDetails(&_RMNContract.CallOpts) +} + +func (_RMNContract *RMNContractCaller) GetCurseProgress(opts *bind.CallOpts, subject [16]byte) (GetCurseProgress, + + error) { + var out []interface{} + err := _RMNContract.contract.Call(opts, &out, "getCurseProgress", subject) + + outstruct := new(GetCurseProgress) + if err != nil { + return *outstruct, err + } + + outstruct.CurseVoteAddrs = *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) + outstruct.CursesHashes = *abi.ConvertType(out[1], new([][28]byte)).(*[][28]byte) + outstruct.AccumulatedWeight = *abi.ConvertType(out[2], new(uint16)).(*uint16) + outstruct.Cursed = *abi.ConvertType(out[3], new(bool)).(*bool) + + return *outstruct, err + +} + +func (_RMNContract *RMNContractSession) GetCurseProgress(subject [16]byte) (GetCurseProgress, + + error) { + return _RMNContract.Contract.GetCurseProgress(&_RMNContract.CallOpts, subject) +} + +func (_RMNContract *RMNContractCallerSession) GetCurseProgress(subject [16]byte) (GetCurseProgress, + + error) { + return _RMNContract.Contract.GetCurseProgress(&_RMNContract.CallOpts, subject) +} + +func (_RMNContract *RMNContractCaller) GetCursedSubjectsCount(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _RMNContract.contract.Call(opts, &out, "getCursedSubjectsCount") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_RMNContract *RMNContractSession) GetCursedSubjectsCount() (*big.Int, error) { + return _RMNContract.Contract.GetCursedSubjectsCount(&_RMNContract.CallOpts) +} + +func (_RMNContract *RMNContractCallerSession) GetCursedSubjectsCount() (*big.Int, error) { + return _RMNContract.Contract.GetCursedSubjectsCount(&_RMNContract.CallOpts) +} + +func (_RMNContract *RMNContractCaller) GetPermaBlessedCommitStores(opts *bind.CallOpts) ([]common.Address, error) { + var out []interface{} + err := _RMNContract.contract.Call(opts, &out, "getPermaBlessedCommitStores") + + if err != nil { + return *new([]common.Address), err + } + + out0 := *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) + + return out0, err + +} + +func (_RMNContract *RMNContractSession) GetPermaBlessedCommitStores() ([]common.Address, error) { + return _RMNContract.Contract.GetPermaBlessedCommitStores(&_RMNContract.CallOpts) +} + +func (_RMNContract *RMNContractCallerSession) GetPermaBlessedCommitStores() ([]common.Address, error) { + return _RMNContract.Contract.GetPermaBlessedCommitStores(&_RMNContract.CallOpts) +} + +func (_RMNContract *RMNContractCaller) GetRecordedCurseRelatedOps(opts *bind.CallOpts, offset *big.Int, limit *big.Int) ([]RMNRecordedCurseRelatedOp, error) { + var out []interface{} + err := _RMNContract.contract.Call(opts, &out, "getRecordedCurseRelatedOps", offset, limit) + + if err != nil { + return *new([]RMNRecordedCurseRelatedOp), err + } + + out0 := *abi.ConvertType(out[0], new([]RMNRecordedCurseRelatedOp)).(*[]RMNRecordedCurseRelatedOp) + + return out0, err + +} + +func (_RMNContract *RMNContractSession) GetRecordedCurseRelatedOps(offset *big.Int, limit *big.Int) ([]RMNRecordedCurseRelatedOp, error) { + return _RMNContract.Contract.GetRecordedCurseRelatedOps(&_RMNContract.CallOpts, offset, limit) +} + +func (_RMNContract *RMNContractCallerSession) GetRecordedCurseRelatedOps(offset *big.Int, limit *big.Int) ([]RMNRecordedCurseRelatedOp, error) { + return _RMNContract.Contract.GetRecordedCurseRelatedOps(&_RMNContract.CallOpts, offset, limit) +} + +func (_RMNContract *RMNContractCaller) GetRecordedCurseRelatedOpsCount(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _RMNContract.contract.Call(opts, &out, "getRecordedCurseRelatedOpsCount") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_RMNContract *RMNContractSession) GetRecordedCurseRelatedOpsCount() (*big.Int, error) { + return _RMNContract.Contract.GetRecordedCurseRelatedOpsCount(&_RMNContract.CallOpts) +} + +func (_RMNContract *RMNContractCallerSession) GetRecordedCurseRelatedOpsCount() (*big.Int, error) { + return _RMNContract.Contract.GetRecordedCurseRelatedOpsCount(&_RMNContract.CallOpts) +} + +func (_RMNContract *RMNContractCaller) IsBlessed(opts *bind.CallOpts, taggedRoot IRMNTaggedRoot) (bool, error) { + var out []interface{} + err := _RMNContract.contract.Call(opts, &out, "isBlessed", taggedRoot) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_RMNContract *RMNContractSession) IsBlessed(taggedRoot IRMNTaggedRoot) (bool, error) { + return _RMNContract.Contract.IsBlessed(&_RMNContract.CallOpts, taggedRoot) +} + +func (_RMNContract *RMNContractCallerSession) IsBlessed(taggedRoot IRMNTaggedRoot) (bool, error) { + return _RMNContract.Contract.IsBlessed(&_RMNContract.CallOpts, taggedRoot) +} + +func (_RMNContract *RMNContractCaller) IsCursed(opts *bind.CallOpts, subject [16]byte) (bool, error) { + var out []interface{} + err := _RMNContract.contract.Call(opts, &out, "isCursed", subject) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_RMNContract *RMNContractSession) IsCursed(subject [16]byte) (bool, error) { + return _RMNContract.Contract.IsCursed(&_RMNContract.CallOpts, subject) +} + +func (_RMNContract *RMNContractCallerSession) IsCursed(subject [16]byte) (bool, error) { + return _RMNContract.Contract.IsCursed(&_RMNContract.CallOpts, subject) +} + +func (_RMNContract *RMNContractCaller) IsCursed0(opts *bind.CallOpts) (bool, error) { + var out []interface{} + err := _RMNContract.contract.Call(opts, &out, "isCursed0") + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_RMNContract *RMNContractSession) IsCursed0() (bool, error) { + return _RMNContract.Contract.IsCursed0(&_RMNContract.CallOpts) +} + +func (_RMNContract *RMNContractCallerSession) IsCursed0() (bool, error) { + return _RMNContract.Contract.IsCursed0(&_RMNContract.CallOpts) +} + +func (_RMNContract *RMNContractCaller) Owner(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _RMNContract.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 + +} + +func (_RMNContract *RMNContractSession) Owner() (common.Address, error) { + return _RMNContract.Contract.Owner(&_RMNContract.CallOpts) +} + +func (_RMNContract *RMNContractCallerSession) Owner() (common.Address, error) { + return _RMNContract.Contract.Owner(&_RMNContract.CallOpts) +} + +func (_RMNContract *RMNContractCaller) TypeAndVersion(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _RMNContract.contract.Call(opts, &out, "typeAndVersion") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +func (_RMNContract *RMNContractSession) TypeAndVersion() (string, error) { + return _RMNContract.Contract.TypeAndVersion(&_RMNContract.CallOpts) +} + +func (_RMNContract *RMNContractCallerSession) TypeAndVersion() (string, error) { + return _RMNContract.Contract.TypeAndVersion(&_RMNContract.CallOpts) +} + +func (_RMNContract *RMNContractTransactor) AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + return _RMNContract.contract.Transact(opts, "acceptOwnership") +} + +func (_RMNContract *RMNContractSession) AcceptOwnership() (*types.Transaction, error) { + return _RMNContract.Contract.AcceptOwnership(&_RMNContract.TransactOpts) +} + +func (_RMNContract *RMNContractTransactorSession) AcceptOwnership() (*types.Transaction, error) { + return _RMNContract.Contract.AcceptOwnership(&_RMNContract.TransactOpts) +} + +func (_RMNContract *RMNContractTransactor) OwnerCurse(opts *bind.TransactOpts, curseId [16]byte, subjects [][16]byte) (*types.Transaction, error) { + return _RMNContract.contract.Transact(opts, "ownerCurse", curseId, subjects) +} + +func (_RMNContract *RMNContractSession) OwnerCurse(curseId [16]byte, subjects [][16]byte) (*types.Transaction, error) { + return _RMNContract.Contract.OwnerCurse(&_RMNContract.TransactOpts, curseId, subjects) +} + +func (_RMNContract *RMNContractTransactorSession) OwnerCurse(curseId [16]byte, subjects [][16]byte) (*types.Transaction, error) { + return _RMNContract.Contract.OwnerCurse(&_RMNContract.TransactOpts, curseId, subjects) +} + +func (_RMNContract *RMNContractTransactor) OwnerRemoveThenAddPermaBlessedCommitStores(opts *bind.TransactOpts, removes []common.Address, adds []common.Address) (*types.Transaction, error) { + return _RMNContract.contract.Transact(opts, "ownerRemoveThenAddPermaBlessedCommitStores", removes, adds) +} + +func (_RMNContract *RMNContractSession) OwnerRemoveThenAddPermaBlessedCommitStores(removes []common.Address, adds []common.Address) (*types.Transaction, error) { + return _RMNContract.Contract.OwnerRemoveThenAddPermaBlessedCommitStores(&_RMNContract.TransactOpts, removes, adds) +} + +func (_RMNContract *RMNContractTransactorSession) OwnerRemoveThenAddPermaBlessedCommitStores(removes []common.Address, adds []common.Address) (*types.Transaction, error) { + return _RMNContract.Contract.OwnerRemoveThenAddPermaBlessedCommitStores(&_RMNContract.TransactOpts, removes, adds) +} + +func (_RMNContract *RMNContractTransactor) OwnerResetBlessVotes(opts *bind.TransactOpts, taggedRoots []IRMNTaggedRoot) (*types.Transaction, error) { + return _RMNContract.contract.Transact(opts, "ownerResetBlessVotes", taggedRoots) +} + +func (_RMNContract *RMNContractSession) OwnerResetBlessVotes(taggedRoots []IRMNTaggedRoot) (*types.Transaction, error) { + return _RMNContract.Contract.OwnerResetBlessVotes(&_RMNContract.TransactOpts, taggedRoots) +} + +func (_RMNContract *RMNContractTransactorSession) OwnerResetBlessVotes(taggedRoots []IRMNTaggedRoot) (*types.Transaction, error) { + return _RMNContract.Contract.OwnerResetBlessVotes(&_RMNContract.TransactOpts, taggedRoots) +} + +func (_RMNContract *RMNContractTransactor) OwnerUnvoteToCurse(opts *bind.TransactOpts, ownerUnvoteToCurseRequests []RMNOwnerUnvoteToCurseRequest) (*types.Transaction, error) { + return _RMNContract.contract.Transact(opts, "ownerUnvoteToCurse", ownerUnvoteToCurseRequests) +} + +func (_RMNContract *RMNContractSession) OwnerUnvoteToCurse(ownerUnvoteToCurseRequests []RMNOwnerUnvoteToCurseRequest) (*types.Transaction, error) { + return _RMNContract.Contract.OwnerUnvoteToCurse(&_RMNContract.TransactOpts, ownerUnvoteToCurseRequests) +} + +func (_RMNContract *RMNContractTransactorSession) OwnerUnvoteToCurse(ownerUnvoteToCurseRequests []RMNOwnerUnvoteToCurseRequest) (*types.Transaction, error) { + return _RMNContract.Contract.OwnerUnvoteToCurse(&_RMNContract.TransactOpts, ownerUnvoteToCurseRequests) +} + +func (_RMNContract *RMNContractTransactor) SetConfig(opts *bind.TransactOpts, config RMNConfig) (*types.Transaction, error) { + return _RMNContract.contract.Transact(opts, "setConfig", config) +} + +func (_RMNContract *RMNContractSession) SetConfig(config RMNConfig) (*types.Transaction, error) { + return _RMNContract.Contract.SetConfig(&_RMNContract.TransactOpts, config) +} + +func (_RMNContract *RMNContractTransactorSession) SetConfig(config RMNConfig) (*types.Transaction, error) { + return _RMNContract.Contract.SetConfig(&_RMNContract.TransactOpts, config) +} + +func (_RMNContract *RMNContractTransactor) TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) { + return _RMNContract.contract.Transact(opts, "transferOwnership", to) +} + +func (_RMNContract *RMNContractSession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _RMNContract.Contract.TransferOwnership(&_RMNContract.TransactOpts, to) +} + +func (_RMNContract *RMNContractTransactorSession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _RMNContract.Contract.TransferOwnership(&_RMNContract.TransactOpts, to) +} + +func (_RMNContract *RMNContractTransactor) UnvoteToCurse(opts *bind.TransactOpts, unvoteToCurseRequests []RMNUnvoteToCurseRequest) (*types.Transaction, error) { + return _RMNContract.contract.Transact(opts, "unvoteToCurse", unvoteToCurseRequests) +} + +func (_RMNContract *RMNContractSession) UnvoteToCurse(unvoteToCurseRequests []RMNUnvoteToCurseRequest) (*types.Transaction, error) { + return _RMNContract.Contract.UnvoteToCurse(&_RMNContract.TransactOpts, unvoteToCurseRequests) +} + +func (_RMNContract *RMNContractTransactorSession) UnvoteToCurse(unvoteToCurseRequests []RMNUnvoteToCurseRequest) (*types.Transaction, error) { + return _RMNContract.Contract.UnvoteToCurse(&_RMNContract.TransactOpts, unvoteToCurseRequests) +} + +func (_RMNContract *RMNContractTransactor) VoteToBless(opts *bind.TransactOpts, taggedRoots []IRMNTaggedRoot) (*types.Transaction, error) { + return _RMNContract.contract.Transact(opts, "voteToBless", taggedRoots) +} + +func (_RMNContract *RMNContractSession) VoteToBless(taggedRoots []IRMNTaggedRoot) (*types.Transaction, error) { + return _RMNContract.Contract.VoteToBless(&_RMNContract.TransactOpts, taggedRoots) +} + +func (_RMNContract *RMNContractTransactorSession) VoteToBless(taggedRoots []IRMNTaggedRoot) (*types.Transaction, error) { + return _RMNContract.Contract.VoteToBless(&_RMNContract.TransactOpts, taggedRoots) +} + +func (_RMNContract *RMNContractTransactor) VoteToCurse(opts *bind.TransactOpts, curseId [16]byte, subjects [][16]byte) (*types.Transaction, error) { + return _RMNContract.contract.Transact(opts, "voteToCurse", curseId, subjects) +} + +func (_RMNContract *RMNContractSession) VoteToCurse(curseId [16]byte, subjects [][16]byte) (*types.Transaction, error) { + return _RMNContract.Contract.VoteToCurse(&_RMNContract.TransactOpts, curseId, subjects) +} + +func (_RMNContract *RMNContractTransactorSession) VoteToCurse(curseId [16]byte, subjects [][16]byte) (*types.Transaction, error) { + return _RMNContract.Contract.VoteToCurse(&_RMNContract.TransactOpts, curseId, subjects) +} + +type RMNContractAlreadyBlessedIterator struct { + Event *RMNContractAlreadyBlessed + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *RMNContractAlreadyBlessedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(RMNContractAlreadyBlessed) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(RMNContractAlreadyBlessed) + 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() + } +} + +func (it *RMNContractAlreadyBlessedIterator) Error() error { + return it.fail +} + +func (it *RMNContractAlreadyBlessedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type RMNContractAlreadyBlessed struct { + ConfigVersion uint32 + Voter common.Address + TaggedRoot IRMNTaggedRoot + Raw types.Log +} + +func (_RMNContract *RMNContractFilterer) FilterAlreadyBlessed(opts *bind.FilterOpts, configVersion []uint32, voter []common.Address) (*RMNContractAlreadyBlessedIterator, error) { + + var configVersionRule []interface{} + for _, configVersionItem := range configVersion { + configVersionRule = append(configVersionRule, configVersionItem) + } + var voterRule []interface{} + for _, voterItem := range voter { + voterRule = append(voterRule, voterItem) + } + + logs, sub, err := _RMNContract.contract.FilterLogs(opts, "AlreadyBlessed", configVersionRule, voterRule) + if err != nil { + return nil, err + } + return &RMNContractAlreadyBlessedIterator{contract: _RMNContract.contract, event: "AlreadyBlessed", logs: logs, sub: sub}, nil +} + +func (_RMNContract *RMNContractFilterer) WatchAlreadyBlessed(opts *bind.WatchOpts, sink chan<- *RMNContractAlreadyBlessed, configVersion []uint32, voter []common.Address) (event.Subscription, error) { + + var configVersionRule []interface{} + for _, configVersionItem := range configVersion { + configVersionRule = append(configVersionRule, configVersionItem) + } + var voterRule []interface{} + for _, voterItem := range voter { + voterRule = append(voterRule, voterItem) + } + + logs, sub, err := _RMNContract.contract.WatchLogs(opts, "AlreadyBlessed", configVersionRule, voterRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(RMNContractAlreadyBlessed) + if err := _RMNContract.contract.UnpackLog(event, "AlreadyBlessed", 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 +} + +func (_RMNContract *RMNContractFilterer) ParseAlreadyBlessed(log types.Log) (*RMNContractAlreadyBlessed, error) { + event := new(RMNContractAlreadyBlessed) + if err := _RMNContract.contract.UnpackLog(event, "AlreadyBlessed", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type RMNContractAlreadyVotedToBlessIterator struct { + Event *RMNContractAlreadyVotedToBless + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *RMNContractAlreadyVotedToBlessIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(RMNContractAlreadyVotedToBless) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(RMNContractAlreadyVotedToBless) + 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() + } +} + +func (it *RMNContractAlreadyVotedToBlessIterator) Error() error { + return it.fail +} + +func (it *RMNContractAlreadyVotedToBlessIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type RMNContractAlreadyVotedToBless struct { + ConfigVersion uint32 + Voter common.Address + TaggedRoot IRMNTaggedRoot + Raw types.Log +} + +func (_RMNContract *RMNContractFilterer) FilterAlreadyVotedToBless(opts *bind.FilterOpts, configVersion []uint32, voter []common.Address) (*RMNContractAlreadyVotedToBlessIterator, error) { + + var configVersionRule []interface{} + for _, configVersionItem := range configVersion { + configVersionRule = append(configVersionRule, configVersionItem) + } + var voterRule []interface{} + for _, voterItem := range voter { + voterRule = append(voterRule, voterItem) + } + + logs, sub, err := _RMNContract.contract.FilterLogs(opts, "AlreadyVotedToBless", configVersionRule, voterRule) + if err != nil { + return nil, err + } + return &RMNContractAlreadyVotedToBlessIterator{contract: _RMNContract.contract, event: "AlreadyVotedToBless", logs: logs, sub: sub}, nil +} + +func (_RMNContract *RMNContractFilterer) WatchAlreadyVotedToBless(opts *bind.WatchOpts, sink chan<- *RMNContractAlreadyVotedToBless, configVersion []uint32, voter []common.Address) (event.Subscription, error) { + + var configVersionRule []interface{} + for _, configVersionItem := range configVersion { + configVersionRule = append(configVersionRule, configVersionItem) + } + var voterRule []interface{} + for _, voterItem := range voter { + voterRule = append(voterRule, voterItem) + } + + logs, sub, err := _RMNContract.contract.WatchLogs(opts, "AlreadyVotedToBless", configVersionRule, voterRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(RMNContractAlreadyVotedToBless) + if err := _RMNContract.contract.UnpackLog(event, "AlreadyVotedToBless", 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 +} + +func (_RMNContract *RMNContractFilterer) ParseAlreadyVotedToBless(log types.Log) (*RMNContractAlreadyVotedToBless, error) { + event := new(RMNContractAlreadyVotedToBless) + if err := _RMNContract.contract.UnpackLog(event, "AlreadyVotedToBless", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type RMNContractConfigSetIterator struct { + Event *RMNContractConfigSet + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *RMNContractConfigSetIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(RMNContractConfigSet) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(RMNContractConfigSet) + 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() + } +} + +func (it *RMNContractConfigSetIterator) Error() error { + return it.fail +} + +func (it *RMNContractConfigSetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type RMNContractConfigSet struct { + ConfigVersion uint32 + Config RMNConfig + Raw types.Log +} + +func (_RMNContract *RMNContractFilterer) FilterConfigSet(opts *bind.FilterOpts, configVersion []uint32) (*RMNContractConfigSetIterator, error) { + + var configVersionRule []interface{} + for _, configVersionItem := range configVersion { + configVersionRule = append(configVersionRule, configVersionItem) + } + + logs, sub, err := _RMNContract.contract.FilterLogs(opts, "ConfigSet", configVersionRule) + if err != nil { + return nil, err + } + return &RMNContractConfigSetIterator{contract: _RMNContract.contract, event: "ConfigSet", logs: logs, sub: sub}, nil +} + +func (_RMNContract *RMNContractFilterer) WatchConfigSet(opts *bind.WatchOpts, sink chan<- *RMNContractConfigSet, configVersion []uint32) (event.Subscription, error) { + + var configVersionRule []interface{} + for _, configVersionItem := range configVersion { + configVersionRule = append(configVersionRule, configVersionItem) + } + + logs, sub, err := _RMNContract.contract.WatchLogs(opts, "ConfigSet", configVersionRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(RMNContractConfigSet) + if err := _RMNContract.contract.UnpackLog(event, "ConfigSet", 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 +} + +func (_RMNContract *RMNContractFilterer) ParseConfigSet(log types.Log) (*RMNContractConfigSet, error) { + event := new(RMNContractConfigSet) + if err := _RMNContract.contract.UnpackLog(event, "ConfigSet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type RMNContractCurseLiftedIterator struct { + Event *RMNContractCurseLifted + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *RMNContractCurseLiftedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(RMNContractCurseLifted) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(RMNContractCurseLifted) + 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() + } +} + +func (it *RMNContractCurseLiftedIterator) Error() error { + return it.fail +} + +func (it *RMNContractCurseLiftedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type RMNContractCurseLifted struct { + Subject [16]byte + Raw types.Log +} + +func (_RMNContract *RMNContractFilterer) FilterCurseLifted(opts *bind.FilterOpts) (*RMNContractCurseLiftedIterator, error) { + + logs, sub, err := _RMNContract.contract.FilterLogs(opts, "CurseLifted") + if err != nil { + return nil, err + } + return &RMNContractCurseLiftedIterator{contract: _RMNContract.contract, event: "CurseLifted", logs: logs, sub: sub}, nil +} + +func (_RMNContract *RMNContractFilterer) WatchCurseLifted(opts *bind.WatchOpts, sink chan<- *RMNContractCurseLifted) (event.Subscription, error) { + + logs, sub, err := _RMNContract.contract.WatchLogs(opts, "CurseLifted") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(RMNContractCurseLifted) + if err := _RMNContract.contract.UnpackLog(event, "CurseLifted", 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 +} + +func (_RMNContract *RMNContractFilterer) ParseCurseLifted(log types.Log) (*RMNContractCurseLifted, error) { + event := new(RMNContractCurseLifted) + if err := _RMNContract.contract.UnpackLog(event, "CurseLifted", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type RMNContractCursedIterator struct { + Event *RMNContractCursed + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *RMNContractCursedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(RMNContractCursed) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(RMNContractCursed) + 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() + } +} + +func (it *RMNContractCursedIterator) Error() error { + return it.fail +} + +func (it *RMNContractCursedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type RMNContractCursed struct { + ConfigVersion uint32 + Subject [16]byte + BlockTimestamp uint64 + Raw types.Log +} + +func (_RMNContract *RMNContractFilterer) FilterCursed(opts *bind.FilterOpts, configVersion []uint32) (*RMNContractCursedIterator, error) { + + var configVersionRule []interface{} + for _, configVersionItem := range configVersion { + configVersionRule = append(configVersionRule, configVersionItem) + } + + logs, sub, err := _RMNContract.contract.FilterLogs(opts, "Cursed", configVersionRule) + if err != nil { + return nil, err + } + return &RMNContractCursedIterator{contract: _RMNContract.contract, event: "Cursed", logs: logs, sub: sub}, nil +} + +func (_RMNContract *RMNContractFilterer) WatchCursed(opts *bind.WatchOpts, sink chan<- *RMNContractCursed, configVersion []uint32) (event.Subscription, error) { + + var configVersionRule []interface{} + for _, configVersionItem := range configVersion { + configVersionRule = append(configVersionRule, configVersionItem) + } + + logs, sub, err := _RMNContract.contract.WatchLogs(opts, "Cursed", configVersionRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(RMNContractCursed) + if err := _RMNContract.contract.UnpackLog(event, "Cursed", 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 +} + +func (_RMNContract *RMNContractFilterer) ParseCursed(log types.Log) (*RMNContractCursed, error) { + event := new(RMNContractCursed) + if err := _RMNContract.contract.UnpackLog(event, "Cursed", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type RMNContractOwnershipTransferRequestedIterator struct { + Event *RMNContractOwnershipTransferRequested + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *RMNContractOwnershipTransferRequestedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(RMNContractOwnershipTransferRequested) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(RMNContractOwnershipTransferRequested) + 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() + } +} + +func (it *RMNContractOwnershipTransferRequestedIterator) Error() error { + return it.fail +} + +func (it *RMNContractOwnershipTransferRequestedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type RMNContractOwnershipTransferRequested struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_RMNContract *RMNContractFilterer) FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*RMNContractOwnershipTransferRequestedIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _RMNContract.contract.FilterLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return &RMNContractOwnershipTransferRequestedIterator{contract: _RMNContract.contract, event: "OwnershipTransferRequested", logs: logs, sub: sub}, nil +} + +func (_RMNContract *RMNContractFilterer) WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *RMNContractOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _RMNContract.contract.WatchLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(RMNContractOwnershipTransferRequested) + if err := _RMNContract.contract.UnpackLog(event, "OwnershipTransferRequested", 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 +} + +func (_RMNContract *RMNContractFilterer) ParseOwnershipTransferRequested(log types.Log) (*RMNContractOwnershipTransferRequested, error) { + event := new(RMNContractOwnershipTransferRequested) + if err := _RMNContract.contract.UnpackLog(event, "OwnershipTransferRequested", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type RMNContractOwnershipTransferredIterator struct { + Event *RMNContractOwnershipTransferred + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *RMNContractOwnershipTransferredIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(RMNContractOwnershipTransferred) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(RMNContractOwnershipTransferred) + 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() + } +} + +func (it *RMNContractOwnershipTransferredIterator) Error() error { + return it.fail +} + +func (it *RMNContractOwnershipTransferredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type RMNContractOwnershipTransferred struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_RMNContract *RMNContractFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*RMNContractOwnershipTransferredIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _RMNContract.contract.FilterLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return &RMNContractOwnershipTransferredIterator{contract: _RMNContract.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil +} + +func (_RMNContract *RMNContractFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *RMNContractOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _RMNContract.contract.WatchLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(RMNContractOwnershipTransferred) + if err := _RMNContract.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 +} + +func (_RMNContract *RMNContractFilterer) ParseOwnershipTransferred(log types.Log) (*RMNContractOwnershipTransferred, error) { + event := new(RMNContractOwnershipTransferred) + if err := _RMNContract.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type RMNContractPermaBlessedCommitStoreAddedIterator struct { + Event *RMNContractPermaBlessedCommitStoreAdded + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *RMNContractPermaBlessedCommitStoreAddedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(RMNContractPermaBlessedCommitStoreAdded) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(RMNContractPermaBlessedCommitStoreAdded) + 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() + } +} + +func (it *RMNContractPermaBlessedCommitStoreAddedIterator) Error() error { + return it.fail +} + +func (it *RMNContractPermaBlessedCommitStoreAddedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type RMNContractPermaBlessedCommitStoreAdded struct { + CommitStore common.Address + Raw types.Log +} + +func (_RMNContract *RMNContractFilterer) FilterPermaBlessedCommitStoreAdded(opts *bind.FilterOpts) (*RMNContractPermaBlessedCommitStoreAddedIterator, error) { + + logs, sub, err := _RMNContract.contract.FilterLogs(opts, "PermaBlessedCommitStoreAdded") + if err != nil { + return nil, err + } + return &RMNContractPermaBlessedCommitStoreAddedIterator{contract: _RMNContract.contract, event: "PermaBlessedCommitStoreAdded", logs: logs, sub: sub}, nil +} + +func (_RMNContract *RMNContractFilterer) WatchPermaBlessedCommitStoreAdded(opts *bind.WatchOpts, sink chan<- *RMNContractPermaBlessedCommitStoreAdded) (event.Subscription, error) { + + logs, sub, err := _RMNContract.contract.WatchLogs(opts, "PermaBlessedCommitStoreAdded") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(RMNContractPermaBlessedCommitStoreAdded) + if err := _RMNContract.contract.UnpackLog(event, "PermaBlessedCommitStoreAdded", 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 +} + +func (_RMNContract *RMNContractFilterer) ParsePermaBlessedCommitStoreAdded(log types.Log) (*RMNContractPermaBlessedCommitStoreAdded, error) { + event := new(RMNContractPermaBlessedCommitStoreAdded) + if err := _RMNContract.contract.UnpackLog(event, "PermaBlessedCommitStoreAdded", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type RMNContractPermaBlessedCommitStoreRemovedIterator struct { + Event *RMNContractPermaBlessedCommitStoreRemoved + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *RMNContractPermaBlessedCommitStoreRemovedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(RMNContractPermaBlessedCommitStoreRemoved) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(RMNContractPermaBlessedCommitStoreRemoved) + 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() + } +} + +func (it *RMNContractPermaBlessedCommitStoreRemovedIterator) Error() error { + return it.fail +} + +func (it *RMNContractPermaBlessedCommitStoreRemovedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type RMNContractPermaBlessedCommitStoreRemoved struct { + CommitStore common.Address + Raw types.Log +} + +func (_RMNContract *RMNContractFilterer) FilterPermaBlessedCommitStoreRemoved(opts *bind.FilterOpts) (*RMNContractPermaBlessedCommitStoreRemovedIterator, error) { + + logs, sub, err := _RMNContract.contract.FilterLogs(opts, "PermaBlessedCommitStoreRemoved") + if err != nil { + return nil, err + } + return &RMNContractPermaBlessedCommitStoreRemovedIterator{contract: _RMNContract.contract, event: "PermaBlessedCommitStoreRemoved", logs: logs, sub: sub}, nil +} + +func (_RMNContract *RMNContractFilterer) WatchPermaBlessedCommitStoreRemoved(opts *bind.WatchOpts, sink chan<- *RMNContractPermaBlessedCommitStoreRemoved) (event.Subscription, error) { + + logs, sub, err := _RMNContract.contract.WatchLogs(opts, "PermaBlessedCommitStoreRemoved") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(RMNContractPermaBlessedCommitStoreRemoved) + if err := _RMNContract.contract.UnpackLog(event, "PermaBlessedCommitStoreRemoved", 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 +} + +func (_RMNContract *RMNContractFilterer) ParsePermaBlessedCommitStoreRemoved(log types.Log) (*RMNContractPermaBlessedCommitStoreRemoved, error) { + event := new(RMNContractPermaBlessedCommitStoreRemoved) + if err := _RMNContract.contract.UnpackLog(event, "PermaBlessedCommitStoreRemoved", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type RMNContractSkippedUnvoteToCurseIterator struct { + Event *RMNContractSkippedUnvoteToCurse + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *RMNContractSkippedUnvoteToCurseIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(RMNContractSkippedUnvoteToCurse) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(RMNContractSkippedUnvoteToCurse) + 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() + } +} + +func (it *RMNContractSkippedUnvoteToCurseIterator) Error() error { + return it.fail +} + +func (it *RMNContractSkippedUnvoteToCurseIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type RMNContractSkippedUnvoteToCurse struct { + Voter common.Address + Subject [16]byte + OnchainCursesHash [28]byte + CursesHash [28]byte + Raw types.Log +} + +func (_RMNContract *RMNContractFilterer) FilterSkippedUnvoteToCurse(opts *bind.FilterOpts, voter []common.Address) (*RMNContractSkippedUnvoteToCurseIterator, error) { + + var voterRule []interface{} + for _, voterItem := range voter { + voterRule = append(voterRule, voterItem) + } + + logs, sub, err := _RMNContract.contract.FilterLogs(opts, "SkippedUnvoteToCurse", voterRule) + if err != nil { + return nil, err + } + return &RMNContractSkippedUnvoteToCurseIterator{contract: _RMNContract.contract, event: "SkippedUnvoteToCurse", logs: logs, sub: sub}, nil +} + +func (_RMNContract *RMNContractFilterer) WatchSkippedUnvoteToCurse(opts *bind.WatchOpts, sink chan<- *RMNContractSkippedUnvoteToCurse, voter []common.Address) (event.Subscription, error) { + + var voterRule []interface{} + for _, voterItem := range voter { + voterRule = append(voterRule, voterItem) + } + + logs, sub, err := _RMNContract.contract.WatchLogs(opts, "SkippedUnvoteToCurse", voterRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(RMNContractSkippedUnvoteToCurse) + if err := _RMNContract.contract.UnpackLog(event, "SkippedUnvoteToCurse", 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 +} + +func (_RMNContract *RMNContractFilterer) ParseSkippedUnvoteToCurse(log types.Log) (*RMNContractSkippedUnvoteToCurse, error) { + event := new(RMNContractSkippedUnvoteToCurse) + if err := _RMNContract.contract.UnpackLog(event, "SkippedUnvoteToCurse", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type RMNContractTaggedRootBlessVotesResetIterator struct { + Event *RMNContractTaggedRootBlessVotesReset + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *RMNContractTaggedRootBlessVotesResetIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(RMNContractTaggedRootBlessVotesReset) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(RMNContractTaggedRootBlessVotesReset) + 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() + } +} + +func (it *RMNContractTaggedRootBlessVotesResetIterator) Error() error { + return it.fail +} + +func (it *RMNContractTaggedRootBlessVotesResetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type RMNContractTaggedRootBlessVotesReset struct { + ConfigVersion uint32 + TaggedRoot IRMNTaggedRoot + WasBlessed bool + Raw types.Log +} + +func (_RMNContract *RMNContractFilterer) FilterTaggedRootBlessVotesReset(opts *bind.FilterOpts, configVersion []uint32) (*RMNContractTaggedRootBlessVotesResetIterator, error) { + + var configVersionRule []interface{} + for _, configVersionItem := range configVersion { + configVersionRule = append(configVersionRule, configVersionItem) + } + + logs, sub, err := _RMNContract.contract.FilterLogs(opts, "TaggedRootBlessVotesReset", configVersionRule) + if err != nil { + return nil, err + } + return &RMNContractTaggedRootBlessVotesResetIterator{contract: _RMNContract.contract, event: "TaggedRootBlessVotesReset", logs: logs, sub: sub}, nil +} + +func (_RMNContract *RMNContractFilterer) WatchTaggedRootBlessVotesReset(opts *bind.WatchOpts, sink chan<- *RMNContractTaggedRootBlessVotesReset, configVersion []uint32) (event.Subscription, error) { + + var configVersionRule []interface{} + for _, configVersionItem := range configVersion { + configVersionRule = append(configVersionRule, configVersionItem) + } + + logs, sub, err := _RMNContract.contract.WatchLogs(opts, "TaggedRootBlessVotesReset", configVersionRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(RMNContractTaggedRootBlessVotesReset) + if err := _RMNContract.contract.UnpackLog(event, "TaggedRootBlessVotesReset", 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 +} + +func (_RMNContract *RMNContractFilterer) ParseTaggedRootBlessVotesReset(log types.Log) (*RMNContractTaggedRootBlessVotesReset, error) { + event := new(RMNContractTaggedRootBlessVotesReset) + if err := _RMNContract.contract.UnpackLog(event, "TaggedRootBlessVotesReset", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type RMNContractTaggedRootBlessedIterator struct { + Event *RMNContractTaggedRootBlessed + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *RMNContractTaggedRootBlessedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(RMNContractTaggedRootBlessed) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(RMNContractTaggedRootBlessed) + 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() + } +} + +func (it *RMNContractTaggedRootBlessedIterator) Error() error { + return it.fail +} + +func (it *RMNContractTaggedRootBlessedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type RMNContractTaggedRootBlessed struct { + ConfigVersion uint32 + TaggedRoot IRMNTaggedRoot + AccumulatedWeight uint16 + Raw types.Log +} + +func (_RMNContract *RMNContractFilterer) FilterTaggedRootBlessed(opts *bind.FilterOpts, configVersion []uint32) (*RMNContractTaggedRootBlessedIterator, error) { + + var configVersionRule []interface{} + for _, configVersionItem := range configVersion { + configVersionRule = append(configVersionRule, configVersionItem) + } + + logs, sub, err := _RMNContract.contract.FilterLogs(opts, "TaggedRootBlessed", configVersionRule) + if err != nil { + return nil, err + } + return &RMNContractTaggedRootBlessedIterator{contract: _RMNContract.contract, event: "TaggedRootBlessed", logs: logs, sub: sub}, nil +} + +func (_RMNContract *RMNContractFilterer) WatchTaggedRootBlessed(opts *bind.WatchOpts, sink chan<- *RMNContractTaggedRootBlessed, configVersion []uint32) (event.Subscription, error) { + + var configVersionRule []interface{} + for _, configVersionItem := range configVersion { + configVersionRule = append(configVersionRule, configVersionItem) + } + + logs, sub, err := _RMNContract.contract.WatchLogs(opts, "TaggedRootBlessed", configVersionRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(RMNContractTaggedRootBlessed) + if err := _RMNContract.contract.UnpackLog(event, "TaggedRootBlessed", 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 +} + +func (_RMNContract *RMNContractFilterer) ParseTaggedRootBlessed(log types.Log) (*RMNContractTaggedRootBlessed, error) { + event := new(RMNContractTaggedRootBlessed) + if err := _RMNContract.contract.UnpackLog(event, "TaggedRootBlessed", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type RMNContractUnvotedToCurseIterator struct { + Event *RMNContractUnvotedToCurse + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *RMNContractUnvotedToCurseIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(RMNContractUnvotedToCurse) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(RMNContractUnvotedToCurse) + 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() + } +} + +func (it *RMNContractUnvotedToCurseIterator) Error() error { + return it.fail +} + +func (it *RMNContractUnvotedToCurseIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type RMNContractUnvotedToCurse struct { + ConfigVersion uint32 + Voter common.Address + Subject [16]byte + Weight uint8 + CursesHash [28]byte + RemainingAccumulatedWeight uint16 + Raw types.Log +} + +func (_RMNContract *RMNContractFilterer) FilterUnvotedToCurse(opts *bind.FilterOpts, configVersion []uint32, voter []common.Address) (*RMNContractUnvotedToCurseIterator, error) { + + var configVersionRule []interface{} + for _, configVersionItem := range configVersion { + configVersionRule = append(configVersionRule, configVersionItem) + } + var voterRule []interface{} + for _, voterItem := range voter { + voterRule = append(voterRule, voterItem) + } + + logs, sub, err := _RMNContract.contract.FilterLogs(opts, "UnvotedToCurse", configVersionRule, voterRule) + if err != nil { + return nil, err + } + return &RMNContractUnvotedToCurseIterator{contract: _RMNContract.contract, event: "UnvotedToCurse", logs: logs, sub: sub}, nil +} + +func (_RMNContract *RMNContractFilterer) WatchUnvotedToCurse(opts *bind.WatchOpts, sink chan<- *RMNContractUnvotedToCurse, configVersion []uint32, voter []common.Address) (event.Subscription, error) { + + var configVersionRule []interface{} + for _, configVersionItem := range configVersion { + configVersionRule = append(configVersionRule, configVersionItem) + } + var voterRule []interface{} + for _, voterItem := range voter { + voterRule = append(voterRule, voterItem) + } + + logs, sub, err := _RMNContract.contract.WatchLogs(opts, "UnvotedToCurse", configVersionRule, voterRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(RMNContractUnvotedToCurse) + if err := _RMNContract.contract.UnpackLog(event, "UnvotedToCurse", 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 +} + +func (_RMNContract *RMNContractFilterer) ParseUnvotedToCurse(log types.Log) (*RMNContractUnvotedToCurse, error) { + event := new(RMNContractUnvotedToCurse) + if err := _RMNContract.contract.UnpackLog(event, "UnvotedToCurse", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type RMNContractVotedToBlessIterator struct { + Event *RMNContractVotedToBless + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *RMNContractVotedToBlessIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(RMNContractVotedToBless) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(RMNContractVotedToBless) + 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() + } +} + +func (it *RMNContractVotedToBlessIterator) Error() error { + return it.fail +} + +func (it *RMNContractVotedToBlessIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type RMNContractVotedToBless struct { + ConfigVersion uint32 + Voter common.Address + TaggedRoot IRMNTaggedRoot + Weight uint8 + Raw types.Log +} + +func (_RMNContract *RMNContractFilterer) FilterVotedToBless(opts *bind.FilterOpts, configVersion []uint32, voter []common.Address) (*RMNContractVotedToBlessIterator, error) { + + var configVersionRule []interface{} + for _, configVersionItem := range configVersion { + configVersionRule = append(configVersionRule, configVersionItem) + } + var voterRule []interface{} + for _, voterItem := range voter { + voterRule = append(voterRule, voterItem) + } + + logs, sub, err := _RMNContract.contract.FilterLogs(opts, "VotedToBless", configVersionRule, voterRule) + if err != nil { + return nil, err + } + return &RMNContractVotedToBlessIterator{contract: _RMNContract.contract, event: "VotedToBless", logs: logs, sub: sub}, nil +} + +func (_RMNContract *RMNContractFilterer) WatchVotedToBless(opts *bind.WatchOpts, sink chan<- *RMNContractVotedToBless, configVersion []uint32, voter []common.Address) (event.Subscription, error) { + + var configVersionRule []interface{} + for _, configVersionItem := range configVersion { + configVersionRule = append(configVersionRule, configVersionItem) + } + var voterRule []interface{} + for _, voterItem := range voter { + voterRule = append(voterRule, voterItem) + } + + logs, sub, err := _RMNContract.contract.WatchLogs(opts, "VotedToBless", configVersionRule, voterRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(RMNContractVotedToBless) + if err := _RMNContract.contract.UnpackLog(event, "VotedToBless", 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 +} + +func (_RMNContract *RMNContractFilterer) ParseVotedToBless(log types.Log) (*RMNContractVotedToBless, error) { + event := new(RMNContractVotedToBless) + if err := _RMNContract.contract.UnpackLog(event, "VotedToBless", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type RMNContractVotedToCurseIterator struct { + Event *RMNContractVotedToCurse + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *RMNContractVotedToCurseIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(RMNContractVotedToCurse) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(RMNContractVotedToCurse) + 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() + } +} + +func (it *RMNContractVotedToCurseIterator) Error() error { + return it.fail +} + +func (it *RMNContractVotedToCurseIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type RMNContractVotedToCurse struct { + ConfigVersion uint32 + Voter common.Address + Subject [16]byte + CurseId [16]byte + Weight uint8 + BlockTimestamp uint64 + CursesHash [28]byte + AccumulatedWeight uint16 + Raw types.Log +} + +func (_RMNContract *RMNContractFilterer) FilterVotedToCurse(opts *bind.FilterOpts, configVersion []uint32, voter []common.Address) (*RMNContractVotedToCurseIterator, error) { + + var configVersionRule []interface{} + for _, configVersionItem := range configVersion { + configVersionRule = append(configVersionRule, configVersionItem) + } + var voterRule []interface{} + for _, voterItem := range voter { + voterRule = append(voterRule, voterItem) + } + + logs, sub, err := _RMNContract.contract.FilterLogs(opts, "VotedToCurse", configVersionRule, voterRule) + if err != nil { + return nil, err + } + return &RMNContractVotedToCurseIterator{contract: _RMNContract.contract, event: "VotedToCurse", logs: logs, sub: sub}, nil +} + +func (_RMNContract *RMNContractFilterer) WatchVotedToCurse(opts *bind.WatchOpts, sink chan<- *RMNContractVotedToCurse, configVersion []uint32, voter []common.Address) (event.Subscription, error) { + + var configVersionRule []interface{} + for _, configVersionItem := range configVersion { + configVersionRule = append(configVersionRule, configVersionItem) + } + var voterRule []interface{} + for _, voterItem := range voter { + voterRule = append(voterRule, voterItem) + } + + logs, sub, err := _RMNContract.contract.WatchLogs(opts, "VotedToCurse", configVersionRule, voterRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(RMNContractVotedToCurse) + if err := _RMNContract.contract.UnpackLog(event, "VotedToCurse", 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 +} + +func (_RMNContract *RMNContractFilterer) ParseVotedToCurse(log types.Log) (*RMNContractVotedToCurse, error) { + event := new(RMNContractVotedToCurse) + if err := _RMNContract.contract.UnpackLog(event, "VotedToCurse", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type GetBlessProgress struct { + BlessVoteAddrs []common.Address + AccumulatedWeight uint16 + Blessed bool +} +type GetConfigDetails struct { + Version uint32 + BlockNumber uint32 + Config RMNConfig +} +type GetCurseProgress struct { + CurseVoteAddrs []common.Address + CursesHashes [][28]byte + AccumulatedWeight uint16 + Cursed bool +} + +func (_RMNContract *RMNContract) ParseLog(log types.Log) (generated.AbigenLog, error) { + switch log.Topics[0] { + case _RMNContract.abi.Events["AlreadyBlessed"].ID: + return _RMNContract.ParseAlreadyBlessed(log) + case _RMNContract.abi.Events["AlreadyVotedToBless"].ID: + return _RMNContract.ParseAlreadyVotedToBless(log) + case _RMNContract.abi.Events["ConfigSet"].ID: + return _RMNContract.ParseConfigSet(log) + case _RMNContract.abi.Events["CurseLifted"].ID: + return _RMNContract.ParseCurseLifted(log) + case _RMNContract.abi.Events["Cursed"].ID: + return _RMNContract.ParseCursed(log) + case _RMNContract.abi.Events["OwnershipTransferRequested"].ID: + return _RMNContract.ParseOwnershipTransferRequested(log) + case _RMNContract.abi.Events["OwnershipTransferred"].ID: + return _RMNContract.ParseOwnershipTransferred(log) + case _RMNContract.abi.Events["PermaBlessedCommitStoreAdded"].ID: + return _RMNContract.ParsePermaBlessedCommitStoreAdded(log) + case _RMNContract.abi.Events["PermaBlessedCommitStoreRemoved"].ID: + return _RMNContract.ParsePermaBlessedCommitStoreRemoved(log) + case _RMNContract.abi.Events["SkippedUnvoteToCurse"].ID: + return _RMNContract.ParseSkippedUnvoteToCurse(log) + case _RMNContract.abi.Events["TaggedRootBlessVotesReset"].ID: + return _RMNContract.ParseTaggedRootBlessVotesReset(log) + case _RMNContract.abi.Events["TaggedRootBlessed"].ID: + return _RMNContract.ParseTaggedRootBlessed(log) + case _RMNContract.abi.Events["UnvotedToCurse"].ID: + return _RMNContract.ParseUnvotedToCurse(log) + case _RMNContract.abi.Events["VotedToBless"].ID: + return _RMNContract.ParseVotedToBless(log) + case _RMNContract.abi.Events["VotedToCurse"].ID: + return _RMNContract.ParseVotedToCurse(log) + + default: + return nil, fmt.Errorf("abigen wrapper received unknown log topic: %v", log.Topics[0]) + } +} + +func (RMNContractAlreadyBlessed) Topic() common.Hash { + return common.HexToHash("0x274d6d5b916b0a53974b7ab86c844b97a2e03a60f658cd9a4b1c028b604d7bf1") +} + +func (RMNContractAlreadyVotedToBless) Topic() common.Hash { + return common.HexToHash("0x6dfbb745226fa630aeb1b9557d17d508ddb789a04f0cb873ec16e58beb8beead") +} + +func (RMNContractConfigSet) Topic() common.Hash { + return common.HexToHash("0x8c49fda8177c5c8c768eb39634bc6773695c7181711537b822451c12b2efd2a9") +} + +func (RMNContractCurseLifted) Topic() common.Hash { + return common.HexToHash("0x65d0e78c3625f0956f58610cf0fb157eaf627683258875ef29af2f71d25ac8fd") +} + +func (RMNContractCursed) Topic() common.Hash { + return common.HexToHash("0xcfdbfd8ce9a56b5f7c202c0e102184d24f47ca87121dc165063fc4c290957bde") +} + +func (RMNContractOwnershipTransferRequested) Topic() common.Hash { + return common.HexToHash("0xed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae1278") +} + +func (RMNContractOwnershipTransferred) Topic() common.Hash { + return common.HexToHash("0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0") +} + +func (RMNContractPermaBlessedCommitStoreAdded) Topic() common.Hash { + return common.HexToHash("0x66b4b4752c65ae8cd2f3a0a48c7dc8b2118c60d5ea15514992eb2ddf56c9cb15") +} + +func (RMNContractPermaBlessedCommitStoreRemoved) Topic() common.Hash { + return common.HexToHash("0xdca892154bbc36d0c05ccd01b3d0411875cb1b841fcdeebb384e5d0d6eb06b44") +} + +func (RMNContractSkippedUnvoteToCurse) Topic() common.Hash { + return common.HexToHash("0xbabb0d7099e6ca14a29fad2a2cfb4fda2bd30f97cb3c27e546174bfb4277c1cc") +} + +func (RMNContractTaggedRootBlessVotesReset) Topic() common.Hash { + return common.HexToHash("0x7d15a6eebaa019ea7d5b7d38937c51ebd3befbfdf51bb630a694fd28635bbcba") +} + +func (RMNContractTaggedRootBlessed) Topic() common.Hash { + return common.HexToHash("0x8257378aa73bf8e4ada848713526584a3dcee0fd3db3beed7397f7a7f5067cc9") +} + +func (RMNContractUnvotedToCurse) Topic() common.Hash { + return common.HexToHash("0xa96a155bd67c927a6c056befbd979b78465e2b2f1276bf7d4e90a31d4f430aa8") +} + +func (RMNContractVotedToBless) Topic() common.Hash { + return common.HexToHash("0x2a08a2bd2798f0aae9a843f0f4ad4de488c1b3d5f04049940cfed736ad69fb97") +} + +func (RMNContractVotedToCurse) Topic() common.Hash { + return common.HexToHash("0x8137bc8a8d712aaa27bfc6506d5566ac405618bd53f9831b8ca6b6fe5442ee7a") +} + +func (_RMNContract *RMNContract) Address() common.Address { + return _RMNContract.address +} + +type RMNContractInterface interface { + GetBlessProgress(opts *bind.CallOpts, taggedRoot IRMNTaggedRoot) (GetBlessProgress, + + error) + + GetConfigDetails(opts *bind.CallOpts) (GetConfigDetails, + + error) + + GetCurseProgress(opts *bind.CallOpts, subject [16]byte) (GetCurseProgress, + + error) + + GetCursedSubjectsCount(opts *bind.CallOpts) (*big.Int, error) + + GetPermaBlessedCommitStores(opts *bind.CallOpts) ([]common.Address, error) + + GetRecordedCurseRelatedOps(opts *bind.CallOpts, offset *big.Int, limit *big.Int) ([]RMNRecordedCurseRelatedOp, error) + + GetRecordedCurseRelatedOpsCount(opts *bind.CallOpts) (*big.Int, error) + + IsBlessed(opts *bind.CallOpts, taggedRoot IRMNTaggedRoot) (bool, error) + + IsCursed(opts *bind.CallOpts, subject [16]byte) (bool, error) + + IsCursed0(opts *bind.CallOpts) (bool, error) + + Owner(opts *bind.CallOpts) (common.Address, error) + + TypeAndVersion(opts *bind.CallOpts) (string, error) + + AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) + + OwnerCurse(opts *bind.TransactOpts, curseId [16]byte, subjects [][16]byte) (*types.Transaction, error) + + OwnerRemoveThenAddPermaBlessedCommitStores(opts *bind.TransactOpts, removes []common.Address, adds []common.Address) (*types.Transaction, error) + + OwnerResetBlessVotes(opts *bind.TransactOpts, taggedRoots []IRMNTaggedRoot) (*types.Transaction, error) + + OwnerUnvoteToCurse(opts *bind.TransactOpts, ownerUnvoteToCurseRequests []RMNOwnerUnvoteToCurseRequest) (*types.Transaction, error) + + SetConfig(opts *bind.TransactOpts, config RMNConfig) (*types.Transaction, error) + + TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) + + UnvoteToCurse(opts *bind.TransactOpts, unvoteToCurseRequests []RMNUnvoteToCurseRequest) (*types.Transaction, error) + + VoteToBless(opts *bind.TransactOpts, taggedRoots []IRMNTaggedRoot) (*types.Transaction, error) + + VoteToCurse(opts *bind.TransactOpts, curseId [16]byte, subjects [][16]byte) (*types.Transaction, error) + + FilterAlreadyBlessed(opts *bind.FilterOpts, configVersion []uint32, voter []common.Address) (*RMNContractAlreadyBlessedIterator, error) + + WatchAlreadyBlessed(opts *bind.WatchOpts, sink chan<- *RMNContractAlreadyBlessed, configVersion []uint32, voter []common.Address) (event.Subscription, error) + + ParseAlreadyBlessed(log types.Log) (*RMNContractAlreadyBlessed, error) + + FilterAlreadyVotedToBless(opts *bind.FilterOpts, configVersion []uint32, voter []common.Address) (*RMNContractAlreadyVotedToBlessIterator, error) + + WatchAlreadyVotedToBless(opts *bind.WatchOpts, sink chan<- *RMNContractAlreadyVotedToBless, configVersion []uint32, voter []common.Address) (event.Subscription, error) + + ParseAlreadyVotedToBless(log types.Log) (*RMNContractAlreadyVotedToBless, error) + + FilterConfigSet(opts *bind.FilterOpts, configVersion []uint32) (*RMNContractConfigSetIterator, error) + + WatchConfigSet(opts *bind.WatchOpts, sink chan<- *RMNContractConfigSet, configVersion []uint32) (event.Subscription, error) + + ParseConfigSet(log types.Log) (*RMNContractConfigSet, error) + + FilterCurseLifted(opts *bind.FilterOpts) (*RMNContractCurseLiftedIterator, error) + + WatchCurseLifted(opts *bind.WatchOpts, sink chan<- *RMNContractCurseLifted) (event.Subscription, error) + + ParseCurseLifted(log types.Log) (*RMNContractCurseLifted, error) + + FilterCursed(opts *bind.FilterOpts, configVersion []uint32) (*RMNContractCursedIterator, error) + + WatchCursed(opts *bind.WatchOpts, sink chan<- *RMNContractCursed, configVersion []uint32) (event.Subscription, error) + + ParseCursed(log types.Log) (*RMNContractCursed, error) + + FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*RMNContractOwnershipTransferRequestedIterator, error) + + WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *RMNContractOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferRequested(log types.Log) (*RMNContractOwnershipTransferRequested, error) + + FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*RMNContractOwnershipTransferredIterator, error) + + WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *RMNContractOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferred(log types.Log) (*RMNContractOwnershipTransferred, error) + + FilterPermaBlessedCommitStoreAdded(opts *bind.FilterOpts) (*RMNContractPermaBlessedCommitStoreAddedIterator, error) + + WatchPermaBlessedCommitStoreAdded(opts *bind.WatchOpts, sink chan<- *RMNContractPermaBlessedCommitStoreAdded) (event.Subscription, error) + + ParsePermaBlessedCommitStoreAdded(log types.Log) (*RMNContractPermaBlessedCommitStoreAdded, error) + + FilterPermaBlessedCommitStoreRemoved(opts *bind.FilterOpts) (*RMNContractPermaBlessedCommitStoreRemovedIterator, error) + + WatchPermaBlessedCommitStoreRemoved(opts *bind.WatchOpts, sink chan<- *RMNContractPermaBlessedCommitStoreRemoved) (event.Subscription, error) + + ParsePermaBlessedCommitStoreRemoved(log types.Log) (*RMNContractPermaBlessedCommitStoreRemoved, error) + + FilterSkippedUnvoteToCurse(opts *bind.FilterOpts, voter []common.Address) (*RMNContractSkippedUnvoteToCurseIterator, error) + + WatchSkippedUnvoteToCurse(opts *bind.WatchOpts, sink chan<- *RMNContractSkippedUnvoteToCurse, voter []common.Address) (event.Subscription, error) + + ParseSkippedUnvoteToCurse(log types.Log) (*RMNContractSkippedUnvoteToCurse, error) + + FilterTaggedRootBlessVotesReset(opts *bind.FilterOpts, configVersion []uint32) (*RMNContractTaggedRootBlessVotesResetIterator, error) + + WatchTaggedRootBlessVotesReset(opts *bind.WatchOpts, sink chan<- *RMNContractTaggedRootBlessVotesReset, configVersion []uint32) (event.Subscription, error) + + ParseTaggedRootBlessVotesReset(log types.Log) (*RMNContractTaggedRootBlessVotesReset, error) + + FilterTaggedRootBlessed(opts *bind.FilterOpts, configVersion []uint32) (*RMNContractTaggedRootBlessedIterator, error) + + WatchTaggedRootBlessed(opts *bind.WatchOpts, sink chan<- *RMNContractTaggedRootBlessed, configVersion []uint32) (event.Subscription, error) + + ParseTaggedRootBlessed(log types.Log) (*RMNContractTaggedRootBlessed, error) + + FilterUnvotedToCurse(opts *bind.FilterOpts, configVersion []uint32, voter []common.Address) (*RMNContractUnvotedToCurseIterator, error) + + WatchUnvotedToCurse(opts *bind.WatchOpts, sink chan<- *RMNContractUnvotedToCurse, configVersion []uint32, voter []common.Address) (event.Subscription, error) + + ParseUnvotedToCurse(log types.Log) (*RMNContractUnvotedToCurse, error) + + FilterVotedToBless(opts *bind.FilterOpts, configVersion []uint32, voter []common.Address) (*RMNContractVotedToBlessIterator, error) + + WatchVotedToBless(opts *bind.WatchOpts, sink chan<- *RMNContractVotedToBless, configVersion []uint32, voter []common.Address) (event.Subscription, error) + + ParseVotedToBless(log types.Log) (*RMNContractVotedToBless, error) + + FilterVotedToCurse(opts *bind.FilterOpts, configVersion []uint32, voter []common.Address) (*RMNContractVotedToCurseIterator, error) + + WatchVotedToCurse(opts *bind.WatchOpts, sink chan<- *RMNContractVotedToCurse, configVersion []uint32, voter []common.Address) (event.Subscription, error) + + ParseVotedToCurse(log types.Log) (*RMNContractVotedToCurse, error) + + ParseLog(log types.Log) (generated.AbigenLog, error) + + Address() common.Address +} diff --git a/core/gethwrappers/ccip/generated/rmn_proxy_contract/rmn_proxy_contract.go b/core/gethwrappers/ccip/generated/rmn_proxy_contract/rmn_proxy_contract.go new file mode 100644 index 00000000000..18fd9898d81 --- /dev/null +++ b/core/gethwrappers/ccip/generated/rmn_proxy_contract/rmn_proxy_contract.go @@ -0,0 +1,743 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package rmn_proxy_contract + +import ( + "errors" + "fmt" + "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" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" +) + +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +var RMNProxyContractMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"arm\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"ZeroAddressNotAllowed\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"arm\",\"type\":\"address\"}],\"name\":\"ARMSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"stateMutability\":\"nonpayable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getARM\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"arm\",\"type\":\"address\"}],\"name\":\"setARM\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", + Bin: "0x608060405234801561001057600080fd5b5060405161084138038061084183398101604081905261002f91610255565b33806000816100855760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b03848116919091179091558116156100b5576100b5816100cd565b5050506100c78161017660201b60201c565b50610285565b336001600160a01b038216036101255760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640161007c565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b61017e6101f9565b6001600160a01b0381166101a5576040516342bcdf7f60e11b815260040160405180910390fd5b600280546001600160a01b0319166001600160a01b0383169081179091556040519081527fef31f568d741a833c6a9dc85a6e1c65e06fa772740d5dc94d1da21827a4e0cab9060200160405180910390a150565b6000546001600160a01b031633146102535760405162461bcd60e51b815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e657200000000000000000000604482015260640161007c565b565b60006020828403121561026757600080fd5b81516001600160a01b038116811461027e57600080fd5b9392505050565b6105ad806102946000396000f3fe608060405234801561001057600080fd5b50600436106100725760003560e01c806379ba50971161005057806379ba5097146101615780638da5cb5b14610169578063f2fde38b1461018757610072565b8063181f5a77146100bb5780632e90aa211461010d578063458fec3b1461014c575b60025473ffffffffffffffffffffffffffffffffffffffff16803b61009657600080fd5b366000803760008036600080855af13d6000803e80156100b5573d6000f35b503d6000fd5b6100f76040518060400160405280600e81526020017f41524d50726f787920312e302e3000000000000000000000000000000000000081525081565b60405161010491906104f6565b60405180910390f35b60025473ffffffffffffffffffffffffffffffffffffffff165b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610104565b61015f61015a366004610563565b61019a565b005b61015f610268565b60005473ffffffffffffffffffffffffffffffffffffffff16610127565b61015f610195366004610563565b61036a565b6101a261037e565b73ffffffffffffffffffffffffffffffffffffffff81166101ef576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600280547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83169081179091556040519081527fef31f568d741a833c6a9dc85a6e1c65e06fa772740d5dc94d1da21827a4e0cab9060200160405180910390a150565b60015473ffffffffffffffffffffffffffffffffffffffff1633146102ee576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e65720000000000000000000060448201526064015b60405180910390fd5b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b61037261037e565b61037b81610401565b50565b60005473ffffffffffffffffffffffffffffffffffffffff1633146103ff576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e65720000000000000000000060448201526064016102e5565b565b3373ffffffffffffffffffffffffffffffffffffffff821603610480576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c6600000000000000000060448201526064016102e5565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b60006020808352835180602085015260005b8181101561052457858101830151858201604001528201610508565b5060006040828601015260407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8301168501019250505092915050565b60006020828403121561057557600080fd5b813573ffffffffffffffffffffffffffffffffffffffff8116811461059957600080fd5b939250505056fea164736f6c6343000818000a", +} + +var RMNProxyContractABI = RMNProxyContractMetaData.ABI + +var RMNProxyContractBin = RMNProxyContractMetaData.Bin + +func DeployRMNProxyContract(auth *bind.TransactOpts, backend bind.ContractBackend, arm common.Address) (common.Address, *types.Transaction, *RMNProxyContract, error) { + parsed, err := RMNProxyContractMetaData.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(RMNProxyContractBin), backend, arm) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &RMNProxyContract{address: address, abi: *parsed, RMNProxyContractCaller: RMNProxyContractCaller{contract: contract}, RMNProxyContractTransactor: RMNProxyContractTransactor{contract: contract}, RMNProxyContractFilterer: RMNProxyContractFilterer{contract: contract}}, nil +} + +type RMNProxyContract struct { + address common.Address + abi abi.ABI + RMNProxyContractCaller + RMNProxyContractTransactor + RMNProxyContractFilterer +} + +type RMNProxyContractCaller struct { + contract *bind.BoundContract +} + +type RMNProxyContractTransactor struct { + contract *bind.BoundContract +} + +type RMNProxyContractFilterer struct { + contract *bind.BoundContract +} + +type RMNProxyContractSession struct { + Contract *RMNProxyContract + CallOpts bind.CallOpts + TransactOpts bind.TransactOpts +} + +type RMNProxyContractCallerSession struct { + Contract *RMNProxyContractCaller + CallOpts bind.CallOpts +} + +type RMNProxyContractTransactorSession struct { + Contract *RMNProxyContractTransactor + TransactOpts bind.TransactOpts +} + +type RMNProxyContractRaw struct { + Contract *RMNProxyContract +} + +type RMNProxyContractCallerRaw struct { + Contract *RMNProxyContractCaller +} + +type RMNProxyContractTransactorRaw struct { + Contract *RMNProxyContractTransactor +} + +func NewRMNProxyContract(address common.Address, backend bind.ContractBackend) (*RMNProxyContract, error) { + abi, err := abi.JSON(strings.NewReader(RMNProxyContractABI)) + if err != nil { + return nil, err + } + contract, err := bindRMNProxyContract(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &RMNProxyContract{address: address, abi: abi, RMNProxyContractCaller: RMNProxyContractCaller{contract: contract}, RMNProxyContractTransactor: RMNProxyContractTransactor{contract: contract}, RMNProxyContractFilterer: RMNProxyContractFilterer{contract: contract}}, nil +} + +func NewRMNProxyContractCaller(address common.Address, caller bind.ContractCaller) (*RMNProxyContractCaller, error) { + contract, err := bindRMNProxyContract(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &RMNProxyContractCaller{contract: contract}, nil +} + +func NewRMNProxyContractTransactor(address common.Address, transactor bind.ContractTransactor) (*RMNProxyContractTransactor, error) { + contract, err := bindRMNProxyContract(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &RMNProxyContractTransactor{contract: contract}, nil +} + +func NewRMNProxyContractFilterer(address common.Address, filterer bind.ContractFilterer) (*RMNProxyContractFilterer, error) { + contract, err := bindRMNProxyContract(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &RMNProxyContractFilterer{contract: contract}, nil +} + +func bindRMNProxyContract(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := RMNProxyContractMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +func (_RMNProxyContract *RMNProxyContractRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _RMNProxyContract.Contract.RMNProxyContractCaller.contract.Call(opts, result, method, params...) +} + +func (_RMNProxyContract *RMNProxyContractRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _RMNProxyContract.Contract.RMNProxyContractTransactor.contract.Transfer(opts) +} + +func (_RMNProxyContract *RMNProxyContractRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _RMNProxyContract.Contract.RMNProxyContractTransactor.contract.Transact(opts, method, params...) +} + +func (_RMNProxyContract *RMNProxyContractCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _RMNProxyContract.Contract.contract.Call(opts, result, method, params...) +} + +func (_RMNProxyContract *RMNProxyContractTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _RMNProxyContract.Contract.contract.Transfer(opts) +} + +func (_RMNProxyContract *RMNProxyContractTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _RMNProxyContract.Contract.contract.Transact(opts, method, params...) +} + +func (_RMNProxyContract *RMNProxyContractCaller) GetARM(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _RMNProxyContract.contract.Call(opts, &out, "getARM") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_RMNProxyContract *RMNProxyContractSession) GetARM() (common.Address, error) { + return _RMNProxyContract.Contract.GetARM(&_RMNProxyContract.CallOpts) +} + +func (_RMNProxyContract *RMNProxyContractCallerSession) GetARM() (common.Address, error) { + return _RMNProxyContract.Contract.GetARM(&_RMNProxyContract.CallOpts) +} + +func (_RMNProxyContract *RMNProxyContractCaller) Owner(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _RMNProxyContract.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 + +} + +func (_RMNProxyContract *RMNProxyContractSession) Owner() (common.Address, error) { + return _RMNProxyContract.Contract.Owner(&_RMNProxyContract.CallOpts) +} + +func (_RMNProxyContract *RMNProxyContractCallerSession) Owner() (common.Address, error) { + return _RMNProxyContract.Contract.Owner(&_RMNProxyContract.CallOpts) +} + +func (_RMNProxyContract *RMNProxyContractCaller) TypeAndVersion(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _RMNProxyContract.contract.Call(opts, &out, "typeAndVersion") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +func (_RMNProxyContract *RMNProxyContractSession) TypeAndVersion() (string, error) { + return _RMNProxyContract.Contract.TypeAndVersion(&_RMNProxyContract.CallOpts) +} + +func (_RMNProxyContract *RMNProxyContractCallerSession) TypeAndVersion() (string, error) { + return _RMNProxyContract.Contract.TypeAndVersion(&_RMNProxyContract.CallOpts) +} + +func (_RMNProxyContract *RMNProxyContractTransactor) AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + return _RMNProxyContract.contract.Transact(opts, "acceptOwnership") +} + +func (_RMNProxyContract *RMNProxyContractSession) AcceptOwnership() (*types.Transaction, error) { + return _RMNProxyContract.Contract.AcceptOwnership(&_RMNProxyContract.TransactOpts) +} + +func (_RMNProxyContract *RMNProxyContractTransactorSession) AcceptOwnership() (*types.Transaction, error) { + return _RMNProxyContract.Contract.AcceptOwnership(&_RMNProxyContract.TransactOpts) +} + +func (_RMNProxyContract *RMNProxyContractTransactor) SetARM(opts *bind.TransactOpts, arm common.Address) (*types.Transaction, error) { + return _RMNProxyContract.contract.Transact(opts, "setARM", arm) +} + +func (_RMNProxyContract *RMNProxyContractSession) SetARM(arm common.Address) (*types.Transaction, error) { + return _RMNProxyContract.Contract.SetARM(&_RMNProxyContract.TransactOpts, arm) +} + +func (_RMNProxyContract *RMNProxyContractTransactorSession) SetARM(arm common.Address) (*types.Transaction, error) { + return _RMNProxyContract.Contract.SetARM(&_RMNProxyContract.TransactOpts, arm) +} + +func (_RMNProxyContract *RMNProxyContractTransactor) TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) { + return _RMNProxyContract.contract.Transact(opts, "transferOwnership", to) +} + +func (_RMNProxyContract *RMNProxyContractSession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _RMNProxyContract.Contract.TransferOwnership(&_RMNProxyContract.TransactOpts, to) +} + +func (_RMNProxyContract *RMNProxyContractTransactorSession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _RMNProxyContract.Contract.TransferOwnership(&_RMNProxyContract.TransactOpts, to) +} + +func (_RMNProxyContract *RMNProxyContractTransactor) Fallback(opts *bind.TransactOpts, calldata []byte) (*types.Transaction, error) { + return _RMNProxyContract.contract.RawTransact(opts, calldata) +} + +func (_RMNProxyContract *RMNProxyContractSession) Fallback(calldata []byte) (*types.Transaction, error) { + return _RMNProxyContract.Contract.Fallback(&_RMNProxyContract.TransactOpts, calldata) +} + +func (_RMNProxyContract *RMNProxyContractTransactorSession) Fallback(calldata []byte) (*types.Transaction, error) { + return _RMNProxyContract.Contract.Fallback(&_RMNProxyContract.TransactOpts, calldata) +} + +type RMNProxyContractARMSetIterator struct { + Event *RMNProxyContractARMSet + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *RMNProxyContractARMSetIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(RMNProxyContractARMSet) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(RMNProxyContractARMSet) + 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() + } +} + +func (it *RMNProxyContractARMSetIterator) Error() error { + return it.fail +} + +func (it *RMNProxyContractARMSetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type RMNProxyContractARMSet struct { + Arm common.Address + Raw types.Log +} + +func (_RMNProxyContract *RMNProxyContractFilterer) FilterARMSet(opts *bind.FilterOpts) (*RMNProxyContractARMSetIterator, error) { + + logs, sub, err := _RMNProxyContract.contract.FilterLogs(opts, "ARMSet") + if err != nil { + return nil, err + } + return &RMNProxyContractARMSetIterator{contract: _RMNProxyContract.contract, event: "ARMSet", logs: logs, sub: sub}, nil +} + +func (_RMNProxyContract *RMNProxyContractFilterer) WatchARMSet(opts *bind.WatchOpts, sink chan<- *RMNProxyContractARMSet) (event.Subscription, error) { + + logs, sub, err := _RMNProxyContract.contract.WatchLogs(opts, "ARMSet") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(RMNProxyContractARMSet) + if err := _RMNProxyContract.contract.UnpackLog(event, "ARMSet", 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 +} + +func (_RMNProxyContract *RMNProxyContractFilterer) ParseARMSet(log types.Log) (*RMNProxyContractARMSet, error) { + event := new(RMNProxyContractARMSet) + if err := _RMNProxyContract.contract.UnpackLog(event, "ARMSet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type RMNProxyContractOwnershipTransferRequestedIterator struct { + Event *RMNProxyContractOwnershipTransferRequested + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *RMNProxyContractOwnershipTransferRequestedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(RMNProxyContractOwnershipTransferRequested) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(RMNProxyContractOwnershipTransferRequested) + 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() + } +} + +func (it *RMNProxyContractOwnershipTransferRequestedIterator) Error() error { + return it.fail +} + +func (it *RMNProxyContractOwnershipTransferRequestedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type RMNProxyContractOwnershipTransferRequested struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_RMNProxyContract *RMNProxyContractFilterer) FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*RMNProxyContractOwnershipTransferRequestedIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _RMNProxyContract.contract.FilterLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return &RMNProxyContractOwnershipTransferRequestedIterator{contract: _RMNProxyContract.contract, event: "OwnershipTransferRequested", logs: logs, sub: sub}, nil +} + +func (_RMNProxyContract *RMNProxyContractFilterer) WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *RMNProxyContractOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _RMNProxyContract.contract.WatchLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(RMNProxyContractOwnershipTransferRequested) + if err := _RMNProxyContract.contract.UnpackLog(event, "OwnershipTransferRequested", 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 +} + +func (_RMNProxyContract *RMNProxyContractFilterer) ParseOwnershipTransferRequested(log types.Log) (*RMNProxyContractOwnershipTransferRequested, error) { + event := new(RMNProxyContractOwnershipTransferRequested) + if err := _RMNProxyContract.contract.UnpackLog(event, "OwnershipTransferRequested", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type RMNProxyContractOwnershipTransferredIterator struct { + Event *RMNProxyContractOwnershipTransferred + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *RMNProxyContractOwnershipTransferredIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(RMNProxyContractOwnershipTransferred) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(RMNProxyContractOwnershipTransferred) + 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() + } +} + +func (it *RMNProxyContractOwnershipTransferredIterator) Error() error { + return it.fail +} + +func (it *RMNProxyContractOwnershipTransferredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type RMNProxyContractOwnershipTransferred struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_RMNProxyContract *RMNProxyContractFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*RMNProxyContractOwnershipTransferredIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _RMNProxyContract.contract.FilterLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return &RMNProxyContractOwnershipTransferredIterator{contract: _RMNProxyContract.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil +} + +func (_RMNProxyContract *RMNProxyContractFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *RMNProxyContractOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _RMNProxyContract.contract.WatchLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(RMNProxyContractOwnershipTransferred) + if err := _RMNProxyContract.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 +} + +func (_RMNProxyContract *RMNProxyContractFilterer) ParseOwnershipTransferred(log types.Log) (*RMNProxyContractOwnershipTransferred, error) { + event := new(RMNProxyContractOwnershipTransferred) + if err := _RMNProxyContract.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +func (_RMNProxyContract *RMNProxyContract) ParseLog(log types.Log) (generated.AbigenLog, error) { + switch log.Topics[0] { + case _RMNProxyContract.abi.Events["ARMSet"].ID: + return _RMNProxyContract.ParseARMSet(log) + case _RMNProxyContract.abi.Events["OwnershipTransferRequested"].ID: + return _RMNProxyContract.ParseOwnershipTransferRequested(log) + case _RMNProxyContract.abi.Events["OwnershipTransferred"].ID: + return _RMNProxyContract.ParseOwnershipTransferred(log) + + default: + return nil, fmt.Errorf("abigen wrapper received unknown log topic: %v", log.Topics[0]) + } +} + +func (RMNProxyContractARMSet) Topic() common.Hash { + return common.HexToHash("0xef31f568d741a833c6a9dc85a6e1c65e06fa772740d5dc94d1da21827a4e0cab") +} + +func (RMNProxyContractOwnershipTransferRequested) Topic() common.Hash { + return common.HexToHash("0xed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae1278") +} + +func (RMNProxyContractOwnershipTransferred) Topic() common.Hash { + return common.HexToHash("0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0") +} + +func (_RMNProxyContract *RMNProxyContract) Address() common.Address { + return _RMNProxyContract.address +} + +type RMNProxyContractInterface interface { + GetARM(opts *bind.CallOpts) (common.Address, error) + + Owner(opts *bind.CallOpts) (common.Address, error) + + TypeAndVersion(opts *bind.CallOpts) (string, error) + + AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) + + SetARM(opts *bind.TransactOpts, arm common.Address) (*types.Transaction, error) + + TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) + + Fallback(opts *bind.TransactOpts, calldata []byte) (*types.Transaction, error) + + FilterARMSet(opts *bind.FilterOpts) (*RMNProxyContractARMSetIterator, error) + + WatchARMSet(opts *bind.WatchOpts, sink chan<- *RMNProxyContractARMSet) (event.Subscription, error) + + ParseARMSet(log types.Log) (*RMNProxyContractARMSet, error) + + FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*RMNProxyContractOwnershipTransferRequestedIterator, error) + + WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *RMNProxyContractOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferRequested(log types.Log) (*RMNProxyContractOwnershipTransferRequested, error) + + FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*RMNProxyContractOwnershipTransferredIterator, error) + + WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *RMNProxyContractOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferred(log types.Log) (*RMNProxyContractOwnershipTransferred, error) + + ParseLog(log types.Log) (generated.AbigenLog, error) + + Address() common.Address +} diff --git a/core/gethwrappers/ccip/generated/rmn_remote/rmn_remote.go b/core/gethwrappers/ccip/generated/rmn_remote/rmn_remote.go new file mode 100644 index 00000000000..a380d77e101 --- /dev/null +++ b/core/gethwrappers/ccip/generated/rmn_remote/rmn_remote.go @@ -0,0 +1,842 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package rmn_remote + +import ( + "errors" + "fmt" + "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" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" +) + +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +type IRMNV2Signature struct { + R [32]byte + S [32]byte +} + +type InternalMerkleRoot struct { + SourceChainSelector uint64 + MinSeqNr uint64 + MaxSeqNr uint64 + MerkleRoot [32]byte + OnRampAddress []byte +} + +type RMNRemoteConfig struct { + RmnHomeContractConfigDigest [32]byte + Signers []RMNRemoteSigner + MinSigners uint64 +} + +type RMNRemoteSigner struct { + OnchainPublicKey common.Address + NodeIndex uint64 +} + +type RMNRemoteVersionedConfig struct { + Version uint32 + Config RMNRemoteConfig +} + +var RMNRemoteMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"ConfigNotSet\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DuplicateOnchainPublicKey\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidSignature\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidSignerOrder\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"MinSignersTooHigh\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OutOfOrderSignatures\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ThresholdNotMet\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UnexpectedSigner\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"uint32\",\"name\":\"version\",\"type\":\"uint32\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"rmnHomeContractConfigDigest\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"onchainPublicKey\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"nodeIndex\",\"type\":\"uint64\"}],\"internalType\":\"structRMNRemote.Signer[]\",\"name\":\"signers\",\"type\":\"tuple[]\"},{\"internalType\":\"uint64\",\"name\":\"minSigners\",\"type\":\"uint64\"}],\"internalType\":\"structRMNRemote.Config\",\"name\":\"config\",\"type\":\"tuple\"}],\"indexed\":false,\"internalType\":\"structRMNRemote.VersionedConfig\",\"name\":\"versionedConfig\",\"type\":\"tuple\"}],\"name\":\"ConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getVersionedConfig\",\"outputs\":[{\"components\":[{\"internalType\":\"uint32\",\"name\":\"version\",\"type\":\"uint32\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"rmnHomeContractConfigDigest\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"onchainPublicKey\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"nodeIndex\",\"type\":\"uint64\"}],\"internalType\":\"structRMNRemote.Signer[]\",\"name\":\"signers\",\"type\":\"tuple[]\"},{\"internalType\":\"uint64\",\"name\":\"minSigners\",\"type\":\"uint64\"}],\"internalType\":\"structRMNRemote.Config\",\"name\":\"config\",\"type\":\"tuple\"}],\"internalType\":\"structRMNRemote.VersionedConfig\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes16\",\"name\":\"subject\",\"type\":\"bytes16\"}],\"name\":\"isCursed\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isCursed\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"rmnHomeContractConfigDigest\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"onchainPublicKey\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"nodeIndex\",\"type\":\"uint64\"}],\"internalType\":\"structRMNRemote.Signer[]\",\"name\":\"signers\",\"type\":\"tuple[]\"},{\"internalType\":\"uint64\",\"name\":\"minSigners\",\"type\":\"uint64\"}],\"internalType\":\"structRMNRemote.Config\",\"name\":\"newConfig\",\"type\":\"tuple\"}],\"name\":\"setConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"test\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"minSeqNr\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"maxSeqNr\",\"type\":\"uint64\"},{\"internalType\":\"bytes32\",\"name\":\"merkleRoot\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"onRampAddress\",\"type\":\"bytes\"}],\"internalType\":\"structInternal.MerkleRoot[]\",\"name\":\"destLaneUpdates\",\"type\":\"tuple[]\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"internalType\":\"structIRMNV2.Signature[]\",\"name\":\"signatures\",\"type\":\"tuple[]\"}],\"name\":\"verify\",\"outputs\":[],\"stateMutability\":\"view\",\"type\":\"function\"}]", + Bin: "0x60a06040523480156200001157600080fd5b506040516200182d3803806200182d83398101604081905262000034916200017e565b33806000816200008b5760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000be57620000be81620000d3565b5050506001600160401b0316608052620001b0565b336001600160a01b038216036200012d5760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640162000082565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b6000602082840312156200019157600080fd5b81516001600160401b0381168114620001a957600080fd5b9392505050565b608051611664620001c9600039600050506116646000f3fe608060405234801561001057600080fd5b50600436106100be5760003560e01c8063397796f7116100765780638da5cb5b1161005b5780638da5cb5b14610184578063f2fde38b146101ac578063f8a8fd6d1461012857600080fd5b8063397796f71461017557806379ba50971461017c57600080fd5b80631add205f116100a75780631add205f1461012a5780632cbc26bb1461013f57806330dfc3081461016357600080fd5b8063181f5a77146100c3578063198f0f7714610115575b600080fd5b6100ff6040518060400160405280601381526020017f524d4e52656d6f746520312e362e302d6465760000000000000000000000000081525081565b60405161010c9190610c4b565b60405180910390f35b610128610123366004610c65565b6101bf565b005b6101326105f0565b60405161010c9190610ca0565b61015361014d366004610d58565b50600090565b604051901515815260200161010c565b610128610171366004610f60565b5050565b6000610153565b61012861090b565b60005460405173ffffffffffffffffffffffffffffffffffffffff909116815260200161010c565b6101286101ba36600461113d565b610a0d565b6101c7610a23565b60015b6101d7602083018361115a565b90508110156102a7576101ed602083018361115a565b828181106101fd576101fd6111c9565b905060400201602001602081019061021591906111f8565b67ffffffffffffffff1661022c602084018461115a565b610237600185611244565b818110610246576102466111c9565b905060400201602001602081019061025e91906111f8565b67ffffffffffffffff161061029f576040517f4485151700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001016101ca565b506102b5602082018261115a565b90506102c760608301604084016111f8565b67ffffffffffffffff161115610309576040517ffba0d9e600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60025b60018101541561040557600180820180546006926000929161032e9190611244565b8154811061033e5761033e6111c9565b600091825260208083209091015473ffffffffffffffffffffffffffffffffffffffff168352820192909252604001902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055600181018054806103a8576103a861125d565b60008281526020902081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90810180547fffffffff0000000000000000000000000000000000000000000000000000000016905501905561030c565b5060005b610416602083018361115a565b905081101561054b5760066000610430602085018561115a565b84818110610440576104406111c9565b610456926020604090920201908101915061113d565b73ffffffffffffffffffffffffffffffffffffffff16815260208101919091526040016000205460ff16156104b7576040517f28cae27d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600660006104ca602086018661115a565b858181106104da576104da6111c9565b6104f0926020604090920201908101915061113d565b73ffffffffffffffffffffffffffffffffffffffff168152602081019190915260400160002080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016911515919091179055600101610409565b508060026105598282611345565b5050600580546000919082906105749063ffffffff16611480565b91906101000a81548163ffffffff021916908363ffffffff160217905590507f6cc65868ae41a007e6c3ed18ce591c123dd4e5864b421888c68ce92dae98cea460405180604001604052808363ffffffff168152602001846105d5906114a3565b90526040516105e49190610ca0565b60405180910390a15050565b6105f8610b99565b60408051808201825260055463ffffffff1681528151606081018352600280548252600380548551602082810282018101909752818152949580870195858201939092909160009084015b828210156106b1576000848152602090819020604080518082019091529084015473ffffffffffffffffffffffffffffffffffffffff8116825274010000000000000000000000000000000000000000900467ffffffffffffffff1681830152825260019092019101610643565b505050908252506002919091015467ffffffffffffffff166020909101529052919050565b84518110156108bd5760008582815181106106f3576106f36111c9565b602002602001015190506000600186601b8460000151856020015160405160008152602001604052604051610744949392919093845260ff9290921660208401526040830152606082015260800190565b6020604051602081039080840390855afa158015610766573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff81166107de576040517f8baa579f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1610610843576040517fbbe15e7f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff811660009081526006602052604090205460ff166108a2576040517faaaa914100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b9250826108ae8561161f565b945050508060010190506106d6565b5060045467ffffffffffffffff16821015610904576040517f59fa4a9300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5050505050565b60015473ffffffffffffffffffffffffffffffffffffffff163314610991576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e65720000000000000000000060448201526064015b60405180910390fd5b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b610a15610a23565b610a1e81610aa4565b50565b565b60005473ffffffffffffffffffffffffffffffffffffffff163314610a21576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e6572000000000000000000006044820152606401610988565b3373ffffffffffffffffffffffffffffffffffffffff821603610b23576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c660000000000000000006044820152606401610988565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b6040518060400160405280600063ffffffff168152602001610be260405180606001604052806000801916815260200160608152602001600067ffffffffffffffff1681525090565b905290565b6000815180845260005b81811015610c0d57602081850181015186830182015201610bf1565b5060006020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b602081526000610c5e6020830184610be7565b9392505050565b600060208284031215610c7757600080fd5b813567ffffffffffffffff811115610c8e57600080fd5b820160608185031215610c5e57600080fd5b6000602080835263ffffffff8451168184015280840151604080604086015260c0850182516060870152838301516060608088015281815180845260e0890191508683019350600092505b80831015610d34578351805173ffffffffffffffffffffffffffffffffffffffff16835287015167ffffffffffffffff1687830152928601926001929092019190840190610ceb565b50604085015167ffffffffffffffff811660a08a0152955098975050505050505050565b600060208284031215610d6a57600080fd5b81357fffffffffffffffffffffffffffffffff0000000000000000000000000000000081168114610c5e57600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040805190810167ffffffffffffffff81118282101715610dec57610dec610d9a565b60405290565b60405160a0810167ffffffffffffffff81118282101715610dec57610dec610d9a565b6040516060810167ffffffffffffffff81118282101715610dec57610dec610d9a565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715610e7f57610e7f610d9a565b604052919050565b600067ffffffffffffffff821115610ea157610ea1610d9a565b5060051b60200190565b67ffffffffffffffff81168114610a1e57600080fd5b8035610ecc81610eab565b919050565b600082601f830112610ee257600080fd5b81356020610ef7610ef283610e87565b610e38565b82815260069290921b84018101918181019086841115610f1657600080fd5b8286015b84811015610f555760408189031215610f335760008081fd5b610f3b610dc9565b813581528482013585820152835291830191604001610f1a565b509695505050505050565b60008060408385031215610f7357600080fd5b823567ffffffffffffffff80821115610f8b57600080fd5b818501915085601f830112610f9f57600080fd5b81356020610faf610ef283610e87565b82815260059290921b84018101918181019089841115610fce57600080fd5b8286015b848110156110ed57803586811115610fe957600080fd5b87017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe060a0828e038201121561101e57600080fd5b611026610df2565b8683013561103381610eab565b8152604083013561104381610eab565b81880152606083013561105581610eab565b60408201526080830135606082015260a08301358981111561107657600080fd5b8084019350508d603f84011261108b57600080fd5b868301358981111561109f5761109f610d9a565b6110af8884601f84011601610e38565b92508083528e60408286010111156110c657600080fd5b80604085018985013760009083018801526080810191909152845250918301918301610fd2565b509650508601359250508082111561110457600080fd5b5061111185828601610ed1565b9150509250929050565b73ffffffffffffffffffffffffffffffffffffffff81168114610a1e57600080fd5b60006020828403121561114f57600080fd5b8135610c5e8161111b565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe184360301811261118f57600080fd5b83018035915067ffffffffffffffff8211156111aa57600080fd5b6020019150600681901b36038213156111c257600080fd5b9250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60006020828403121561120a57600080fd5b8135610c5e81610eab565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8181038181111561125757611257611215565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b6000813561125781610eab565b81356112a48161111b565b73ffffffffffffffffffffffffffffffffffffffff811690508154817fffffffffffffffffffffffff0000000000000000000000000000000000000000821617835560208401356112f481610eab565b7bffffffffffffffff00000000000000000000000000000000000000008160a01b16837fffffffff000000000000000000000000000000000000000000000000000000008416171784555050505050565b81358155600180820160208401357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe185360301811261138357600080fd5b8401803567ffffffffffffffff81111561139c57600080fd5b6020820191508060061b36038213156113b457600080fd5b680100000000000000008111156113cd576113cd610d9a565b825481845580821015611402576000848152602081208381019083015b808210156113fe57828255908701906113ea565b5050505b50600092835260208320925b81811015611432576114208385611299565b9284019260409290920191840161140e565b50505050506101716114466040840161128c565b6002830167ffffffffffffffff82167fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000008254161781555050565b600063ffffffff80831681810361149957611499611215565b6001019392505050565b6000606082360312156114b557600080fd5b6114bd610e15565b8235815260208084013567ffffffffffffffff8111156114dc57600080fd5b840136601f8201126114ed57600080fd5b80356114fb610ef282610e87565b81815260069190911b8201830190838101903683111561151a57600080fd5b928401925b8284101561157057604084360312156115385760008081fd5b611540610dc9565b843561154b8161111b565b81528486013561155a81610eab565b818701528252604093909301929084019061151f565b8085870152505050505061158660408401610ec1565b604082015292915050565b8181101561160c578c89037ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffee00184528751805187168a528a81015187168b8b01528b81015187168c8b015287810151888b0152850151858a018490526115f9848b0182610be7565b9950509689019692890192600101611591565b50969d9c50505050505050505050505050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361165057611650611215565b506001019056fea164736f6c6343000818000a", +} + +var RMNRemoteABI = RMNRemoteMetaData.ABI + +var RMNRemoteBin = RMNRemoteMetaData.Bin + +func DeployRMNRemote(auth *bind.TransactOpts, backend bind.ContractBackend, chainSelector uint64) (common.Address, *types.Transaction, *RMNRemote, error) { + parsed, err := RMNRemoteMetaData.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(RMNRemoteBin), backend, chainSelector) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &RMNRemote{address: address, abi: *parsed, RMNRemoteCaller: RMNRemoteCaller{contract: contract}, RMNRemoteTransactor: RMNRemoteTransactor{contract: contract}, RMNRemoteFilterer: RMNRemoteFilterer{contract: contract}}, nil +} + +type RMNRemote struct { + address common.Address + abi abi.ABI + RMNRemoteCaller + RMNRemoteTransactor + RMNRemoteFilterer +} + +type RMNRemoteCaller struct { + contract *bind.BoundContract +} + +type RMNRemoteTransactor struct { + contract *bind.BoundContract +} + +type RMNRemoteFilterer struct { + contract *bind.BoundContract +} + +type RMNRemoteSession struct { + Contract *RMNRemote + CallOpts bind.CallOpts + TransactOpts bind.TransactOpts +} + +type RMNRemoteCallerSession struct { + Contract *RMNRemoteCaller + CallOpts bind.CallOpts +} + +type RMNRemoteTransactorSession struct { + Contract *RMNRemoteTransactor + TransactOpts bind.TransactOpts +} + +type RMNRemoteRaw struct { + Contract *RMNRemote +} + +type RMNRemoteCallerRaw struct { + Contract *RMNRemoteCaller +} + +type RMNRemoteTransactorRaw struct { + Contract *RMNRemoteTransactor +} + +func NewRMNRemote(address common.Address, backend bind.ContractBackend) (*RMNRemote, error) { + abi, err := abi.JSON(strings.NewReader(RMNRemoteABI)) + if err != nil { + return nil, err + } + contract, err := bindRMNRemote(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &RMNRemote{address: address, abi: abi, RMNRemoteCaller: RMNRemoteCaller{contract: contract}, RMNRemoteTransactor: RMNRemoteTransactor{contract: contract}, RMNRemoteFilterer: RMNRemoteFilterer{contract: contract}}, nil +} + +func NewRMNRemoteCaller(address common.Address, caller bind.ContractCaller) (*RMNRemoteCaller, error) { + contract, err := bindRMNRemote(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &RMNRemoteCaller{contract: contract}, nil +} + +func NewRMNRemoteTransactor(address common.Address, transactor bind.ContractTransactor) (*RMNRemoteTransactor, error) { + contract, err := bindRMNRemote(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &RMNRemoteTransactor{contract: contract}, nil +} + +func NewRMNRemoteFilterer(address common.Address, filterer bind.ContractFilterer) (*RMNRemoteFilterer, error) { + contract, err := bindRMNRemote(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &RMNRemoteFilterer{contract: contract}, nil +} + +func bindRMNRemote(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := RMNRemoteMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +func (_RMNRemote *RMNRemoteRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _RMNRemote.Contract.RMNRemoteCaller.contract.Call(opts, result, method, params...) +} + +func (_RMNRemote *RMNRemoteRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _RMNRemote.Contract.RMNRemoteTransactor.contract.Transfer(opts) +} + +func (_RMNRemote *RMNRemoteRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _RMNRemote.Contract.RMNRemoteTransactor.contract.Transact(opts, method, params...) +} + +func (_RMNRemote *RMNRemoteCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _RMNRemote.Contract.contract.Call(opts, result, method, params...) +} + +func (_RMNRemote *RMNRemoteTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _RMNRemote.Contract.contract.Transfer(opts) +} + +func (_RMNRemote *RMNRemoteTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _RMNRemote.Contract.contract.Transact(opts, method, params...) +} + +func (_RMNRemote *RMNRemoteCaller) GetVersionedConfig(opts *bind.CallOpts) (RMNRemoteVersionedConfig, error) { + var out []interface{} + err := _RMNRemote.contract.Call(opts, &out, "getVersionedConfig") + + if err != nil { + return *new(RMNRemoteVersionedConfig), err + } + + out0 := *abi.ConvertType(out[0], new(RMNRemoteVersionedConfig)).(*RMNRemoteVersionedConfig) + + return out0, err + +} + +func (_RMNRemote *RMNRemoteSession) GetVersionedConfig() (RMNRemoteVersionedConfig, error) { + return _RMNRemote.Contract.GetVersionedConfig(&_RMNRemote.CallOpts) +} + +func (_RMNRemote *RMNRemoteCallerSession) GetVersionedConfig() (RMNRemoteVersionedConfig, error) { + return _RMNRemote.Contract.GetVersionedConfig(&_RMNRemote.CallOpts) +} + +func (_RMNRemote *RMNRemoteCaller) IsCursed(opts *bind.CallOpts, subject [16]byte) (bool, error) { + var out []interface{} + err := _RMNRemote.contract.Call(opts, &out, "isCursed", subject) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_RMNRemote *RMNRemoteSession) IsCursed(subject [16]byte) (bool, error) { + return _RMNRemote.Contract.IsCursed(&_RMNRemote.CallOpts, subject) +} + +func (_RMNRemote *RMNRemoteCallerSession) IsCursed(subject [16]byte) (bool, error) { + return _RMNRemote.Contract.IsCursed(&_RMNRemote.CallOpts, subject) +} + +func (_RMNRemote *RMNRemoteCaller) IsCursed0(opts *bind.CallOpts) (bool, error) { + var out []interface{} + err := _RMNRemote.contract.Call(opts, &out, "isCursed0") + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_RMNRemote *RMNRemoteSession) IsCursed0() (bool, error) { + return _RMNRemote.Contract.IsCursed0(&_RMNRemote.CallOpts) +} + +func (_RMNRemote *RMNRemoteCallerSession) IsCursed0() (bool, error) { + return _RMNRemote.Contract.IsCursed0(&_RMNRemote.CallOpts) +} + +func (_RMNRemote *RMNRemoteCaller) Owner(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _RMNRemote.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 + +} + +func (_RMNRemote *RMNRemoteSession) Owner() (common.Address, error) { + return _RMNRemote.Contract.Owner(&_RMNRemote.CallOpts) +} + +func (_RMNRemote *RMNRemoteCallerSession) Owner() (common.Address, error) { + return _RMNRemote.Contract.Owner(&_RMNRemote.CallOpts) +} + +func (_RMNRemote *RMNRemoteCaller) TypeAndVersion(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _RMNRemote.contract.Call(opts, &out, "typeAndVersion") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +func (_RMNRemote *RMNRemoteSession) TypeAndVersion() (string, error) { + return _RMNRemote.Contract.TypeAndVersion(&_RMNRemote.CallOpts) +} + +func (_RMNRemote *RMNRemoteCallerSession) TypeAndVersion() (string, error) { + return _RMNRemote.Contract.TypeAndVersion(&_RMNRemote.CallOpts) +} + +func (_RMNRemote *RMNRemoteCaller) Verify(opts *bind.CallOpts, destLaneUpdates []InternalMerkleRoot, signatures []IRMNV2Signature) error { + var out []interface{} + err := _RMNRemote.contract.Call(opts, &out, "verify", destLaneUpdates, signatures) + + if err != nil { + return err + } + + return err + +} + +func (_RMNRemote *RMNRemoteSession) Verify(destLaneUpdates []InternalMerkleRoot, signatures []IRMNV2Signature) error { + return _RMNRemote.Contract.Verify(&_RMNRemote.CallOpts, destLaneUpdates, signatures) +} + +func (_RMNRemote *RMNRemoteCallerSession) Verify(destLaneUpdates []InternalMerkleRoot, signatures []IRMNV2Signature) error { + return _RMNRemote.Contract.Verify(&_RMNRemote.CallOpts, destLaneUpdates, signatures) +} + +func (_RMNRemote *RMNRemoteTransactor) AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + return _RMNRemote.contract.Transact(opts, "acceptOwnership") +} + +func (_RMNRemote *RMNRemoteSession) AcceptOwnership() (*types.Transaction, error) { + return _RMNRemote.Contract.AcceptOwnership(&_RMNRemote.TransactOpts) +} + +func (_RMNRemote *RMNRemoteTransactorSession) AcceptOwnership() (*types.Transaction, error) { + return _RMNRemote.Contract.AcceptOwnership(&_RMNRemote.TransactOpts) +} + +func (_RMNRemote *RMNRemoteTransactor) SetConfig(opts *bind.TransactOpts, newConfig RMNRemoteConfig) (*types.Transaction, error) { + return _RMNRemote.contract.Transact(opts, "setConfig", newConfig) +} + +func (_RMNRemote *RMNRemoteSession) SetConfig(newConfig RMNRemoteConfig) (*types.Transaction, error) { + return _RMNRemote.Contract.SetConfig(&_RMNRemote.TransactOpts, newConfig) +} + +func (_RMNRemote *RMNRemoteTransactorSession) SetConfig(newConfig RMNRemoteConfig) (*types.Transaction, error) { + return _RMNRemote.Contract.SetConfig(&_RMNRemote.TransactOpts, newConfig) +} + +func (_RMNRemote *RMNRemoteTransactor) Test(opts *bind.TransactOpts) (*types.Transaction, error) { + return _RMNRemote.contract.Transact(opts, "test") +} + +func (_RMNRemote *RMNRemoteSession) Test() (*types.Transaction, error) { + return _RMNRemote.Contract.Test(&_RMNRemote.TransactOpts) +} + +func (_RMNRemote *RMNRemoteTransactorSession) Test() (*types.Transaction, error) { + return _RMNRemote.Contract.Test(&_RMNRemote.TransactOpts) +} + +func (_RMNRemote *RMNRemoteTransactor) TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) { + return _RMNRemote.contract.Transact(opts, "transferOwnership", to) +} + +func (_RMNRemote *RMNRemoteSession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _RMNRemote.Contract.TransferOwnership(&_RMNRemote.TransactOpts, to) +} + +func (_RMNRemote *RMNRemoteTransactorSession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _RMNRemote.Contract.TransferOwnership(&_RMNRemote.TransactOpts, to) +} + +type RMNRemoteConfigSetIterator struct { + Event *RMNRemoteConfigSet + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *RMNRemoteConfigSetIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(RMNRemoteConfigSet) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(RMNRemoteConfigSet) + 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() + } +} + +func (it *RMNRemoteConfigSetIterator) Error() error { + return it.fail +} + +func (it *RMNRemoteConfigSetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type RMNRemoteConfigSet struct { + VersionedConfig RMNRemoteVersionedConfig + Raw types.Log +} + +func (_RMNRemote *RMNRemoteFilterer) FilterConfigSet(opts *bind.FilterOpts) (*RMNRemoteConfigSetIterator, error) { + + logs, sub, err := _RMNRemote.contract.FilterLogs(opts, "ConfigSet") + if err != nil { + return nil, err + } + return &RMNRemoteConfigSetIterator{contract: _RMNRemote.contract, event: "ConfigSet", logs: logs, sub: sub}, nil +} + +func (_RMNRemote *RMNRemoteFilterer) WatchConfigSet(opts *bind.WatchOpts, sink chan<- *RMNRemoteConfigSet) (event.Subscription, error) { + + logs, sub, err := _RMNRemote.contract.WatchLogs(opts, "ConfigSet") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(RMNRemoteConfigSet) + if err := _RMNRemote.contract.UnpackLog(event, "ConfigSet", 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 +} + +func (_RMNRemote *RMNRemoteFilterer) ParseConfigSet(log types.Log) (*RMNRemoteConfigSet, error) { + event := new(RMNRemoteConfigSet) + if err := _RMNRemote.contract.UnpackLog(event, "ConfigSet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type RMNRemoteOwnershipTransferRequestedIterator struct { + Event *RMNRemoteOwnershipTransferRequested + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *RMNRemoteOwnershipTransferRequestedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(RMNRemoteOwnershipTransferRequested) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(RMNRemoteOwnershipTransferRequested) + 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() + } +} + +func (it *RMNRemoteOwnershipTransferRequestedIterator) Error() error { + return it.fail +} + +func (it *RMNRemoteOwnershipTransferRequestedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type RMNRemoteOwnershipTransferRequested struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_RMNRemote *RMNRemoteFilterer) FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*RMNRemoteOwnershipTransferRequestedIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _RMNRemote.contract.FilterLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return &RMNRemoteOwnershipTransferRequestedIterator{contract: _RMNRemote.contract, event: "OwnershipTransferRequested", logs: logs, sub: sub}, nil +} + +func (_RMNRemote *RMNRemoteFilterer) WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *RMNRemoteOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _RMNRemote.contract.WatchLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(RMNRemoteOwnershipTransferRequested) + if err := _RMNRemote.contract.UnpackLog(event, "OwnershipTransferRequested", 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 +} + +func (_RMNRemote *RMNRemoteFilterer) ParseOwnershipTransferRequested(log types.Log) (*RMNRemoteOwnershipTransferRequested, error) { + event := new(RMNRemoteOwnershipTransferRequested) + if err := _RMNRemote.contract.UnpackLog(event, "OwnershipTransferRequested", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type RMNRemoteOwnershipTransferredIterator struct { + Event *RMNRemoteOwnershipTransferred + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *RMNRemoteOwnershipTransferredIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(RMNRemoteOwnershipTransferred) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(RMNRemoteOwnershipTransferred) + 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() + } +} + +func (it *RMNRemoteOwnershipTransferredIterator) Error() error { + return it.fail +} + +func (it *RMNRemoteOwnershipTransferredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type RMNRemoteOwnershipTransferred struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_RMNRemote *RMNRemoteFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*RMNRemoteOwnershipTransferredIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _RMNRemote.contract.FilterLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return &RMNRemoteOwnershipTransferredIterator{contract: _RMNRemote.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil +} + +func (_RMNRemote *RMNRemoteFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *RMNRemoteOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _RMNRemote.contract.WatchLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(RMNRemoteOwnershipTransferred) + if err := _RMNRemote.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 +} + +func (_RMNRemote *RMNRemoteFilterer) ParseOwnershipTransferred(log types.Log) (*RMNRemoteOwnershipTransferred, error) { + event := new(RMNRemoteOwnershipTransferred) + if err := _RMNRemote.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +func (_RMNRemote *RMNRemote) ParseLog(log types.Log) (generated.AbigenLog, error) { + switch log.Topics[0] { + case _RMNRemote.abi.Events["ConfigSet"].ID: + return _RMNRemote.ParseConfigSet(log) + case _RMNRemote.abi.Events["OwnershipTransferRequested"].ID: + return _RMNRemote.ParseOwnershipTransferRequested(log) + case _RMNRemote.abi.Events["OwnershipTransferred"].ID: + return _RMNRemote.ParseOwnershipTransferred(log) + + default: + return nil, fmt.Errorf("abigen wrapper received unknown log topic: %v", log.Topics[0]) + } +} + +func (RMNRemoteConfigSet) Topic() common.Hash { + return common.HexToHash("0x6cc65868ae41a007e6c3ed18ce591c123dd4e5864b421888c68ce92dae98cea4") +} + +func (RMNRemoteOwnershipTransferRequested) Topic() common.Hash { + return common.HexToHash("0xed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae1278") +} + +func (RMNRemoteOwnershipTransferred) Topic() common.Hash { + return common.HexToHash("0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0") +} + +func (_RMNRemote *RMNRemote) Address() common.Address { + return _RMNRemote.address +} + +type RMNRemoteInterface interface { + GetVersionedConfig(opts *bind.CallOpts) (RMNRemoteVersionedConfig, error) + + IsCursed(opts *bind.CallOpts, subject [16]byte) (bool, error) + + IsCursed0(opts *bind.CallOpts) (bool, error) + + Owner(opts *bind.CallOpts) (common.Address, error) + + TypeAndVersion(opts *bind.CallOpts) (string, error) + + Verify(opts *bind.CallOpts, destLaneUpdates []InternalMerkleRoot, signatures []IRMNV2Signature) error + + AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) + + SetConfig(opts *bind.TransactOpts, newConfig RMNRemoteConfig) (*types.Transaction, error) + + Test(opts *bind.TransactOpts) (*types.Transaction, error) + + TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) + + FilterConfigSet(opts *bind.FilterOpts) (*RMNRemoteConfigSetIterator, error) + + WatchConfigSet(opts *bind.WatchOpts, sink chan<- *RMNRemoteConfigSet) (event.Subscription, error) + + ParseConfigSet(log types.Log) (*RMNRemoteConfigSet, error) + + FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*RMNRemoteOwnershipTransferRequestedIterator, error) + + WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *RMNRemoteOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferRequested(log types.Log) (*RMNRemoteOwnershipTransferRequested, error) + + FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*RMNRemoteOwnershipTransferredIterator, error) + + WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *RMNRemoteOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferred(log types.Log) (*RMNRemoteOwnershipTransferred, error) + + ParseLog(log types.Log) (generated.AbigenLog, error) + + Address() common.Address +} diff --git a/core/gethwrappers/ccip/generated/router/router.go b/core/gethwrappers/ccip/generated/router/router.go new file mode 100644 index 00000000000..9a0d4a40559 --- /dev/null +++ b/core/gethwrappers/ccip/generated/router/router.go @@ -0,0 +1,1431 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package router + +import ( + "errors" + "fmt" + "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" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" +) + +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +type ClientAny2EVMMessage struct { + MessageId [32]byte + SourceChainSelector uint64 + Sender []byte + Data []byte + DestTokenAmounts []ClientEVMTokenAmount +} + +type ClientEVM2AnyMessage struct { + Receiver []byte + Data []byte + TokenAmounts []ClientEVMTokenAmount + FeeToken common.Address + ExtraArgs []byte +} + +type ClientEVMTokenAmount struct { + Token common.Address + Amount *big.Int +} + +type RouterOffRamp struct { + SourceChainSelector uint64 + OffRamp common.Address +} + +type RouterOnRamp struct { + DestChainSelector uint64 + OnRamp common.Address +} + +var RouterMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"wrappedNative\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"armProxy\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"BadARMSignal\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FailedToSendValue\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InsufficientFeeTokenAmount\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidMsgValue\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"InvalidRecipientAddress\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"offRamp\",\"type\":\"address\"}],\"name\":\"OffRampMismatch\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyOffRamp\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"}],\"name\":\"UnsupportedDestinationChain\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"messageId\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"offRamp\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"calldataHash\",\"type\":\"bytes32\"}],\"name\":\"MessageExecuted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"offRamp\",\"type\":\"address\"}],\"name\":\"OffRampAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"offRamp\",\"type\":\"address\"}],\"name\":\"OffRampRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"onRamp\",\"type\":\"address\"}],\"name\":\"OnRampSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"MAX_RET_BYTES\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"onRamp\",\"type\":\"address\"}],\"internalType\":\"structRouter.OnRamp[]\",\"name\":\"onRampUpdates\",\"type\":\"tuple[]\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"offRamp\",\"type\":\"address\"}],\"internalType\":\"structRouter.OffRamp[]\",\"name\":\"offRampRemoves\",\"type\":\"tuple[]\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"offRamp\",\"type\":\"address\"}],\"internalType\":\"structRouter.OffRamp[]\",\"name\":\"offRampAdds\",\"type\":\"tuple[]\"}],\"name\":\"applyRampUpdates\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"destinationChainSelector\",\"type\":\"uint64\"},{\"components\":[{\"internalType\":\"bytes\",\"name\":\"receiver\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"internalType\":\"structClient.EVMTokenAmount[]\",\"name\":\"tokenAmounts\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"feeToken\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"extraArgs\",\"type\":\"bytes\"}],\"internalType\":\"structClient.EVM2AnyMessage\",\"name\":\"message\",\"type\":\"tuple\"}],\"name\":\"ccipSend\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getArmProxy\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"destinationChainSelector\",\"type\":\"uint64\"},{\"components\":[{\"internalType\":\"bytes\",\"name\":\"receiver\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"internalType\":\"structClient.EVMTokenAmount[]\",\"name\":\"tokenAmounts\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"feeToken\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"extraArgs\",\"type\":\"bytes\"}],\"internalType\":\"structClient.EVM2AnyMessage\",\"name\":\"message\",\"type\":\"tuple\"}],\"name\":\"getFee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"fee\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getOffRamps\",\"outputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"offRamp\",\"type\":\"address\"}],\"internalType\":\"structRouter.OffRamp[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"}],\"name\":\"getOnRamp\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"}],\"name\":\"getSupportedTokens\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getWrappedNative\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"}],\"name\":\"isChainSupported\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"offRamp\",\"type\":\"address\"}],\"name\":\"isOffRamp\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"recoverTokens\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"messageId\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"sender\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"internalType\":\"structClient.EVMTokenAmount[]\",\"name\":\"destTokenAmounts\",\"type\":\"tuple[]\"}],\"internalType\":\"structClient.Any2EVMMessage\",\"name\":\"message\",\"type\":\"tuple\"},{\"internalType\":\"uint16\",\"name\":\"gasForCallExactCheck\",\"type\":\"uint16\"},{\"internalType\":\"uint256\",\"name\":\"gasLimit\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"}],\"name\":\"routeMessage\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"success\",\"type\":\"bool\"},{\"internalType\":\"bytes\",\"name\":\"retData\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"gasUsed\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"wrappedNative\",\"type\":\"address\"}],\"name\":\"setWrappedNative\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", + Bin: "0x60a06040523480156200001157600080fd5b5060405162002d2838038062002d288339810160408190526200003491620001af565b33806000816200008b5760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000be57620000be81620000e7565b5050600280546001600160a01b0319166001600160a01b039485161790555016608052620001e7565b336001600160a01b03821603620001415760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640162000082565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b80516001600160a01b0381168114620001aa57600080fd5b919050565b60008060408385031215620001c357600080fd5b620001ce8362000192565b9150620001de6020840162000192565b90509250929050565b608051612b1762000211600039600081816101f9015281816105e10152610af20152612b176000f3fe6080604052600436106101295760003560e01c80638da5cb5b116100a5578063a8d87a3b11610074578063e861e90711610059578063e861e90714610409578063f2fde38b14610434578063fbca3b741461045457600080fd5b8063a8d87a3b1461039c578063da5fcac8146103e957600080fd5b80638da5cb5b146102ed57806396f4e9f914610318578063a40e69c71461032b578063a48a90581461034d57600080fd5b806352cb60ca116100fc578063787350e3116100e1578063787350e31461028057806379ba5097146102a857806383826b2b146102bd57600080fd5b806352cb60ca1461023e5780635f3e849f1461026057600080fd5b8063181f5a771461012e57806320487ded1461018d5780633cf97983146101bb5780635246492f146101ea575b600080fd5b34801561013a57600080fd5b506101776040518060400160405280600c81526020017f526f7574657220312e322e30000000000000000000000000000000000000000081525081565b6040516101849190611f3c565b60405180910390f35b34801561019957600080fd5b506101ad6101a83660046121ad565b610481565b604051908152602001610184565b3480156101c757600080fd5b506101db6101d63660046122aa565b6105d9565b60405161018493929190612322565b3480156101f657600080fd5b507f00000000000000000000000000000000000000000000000000000000000000005b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610184565b34801561024a57600080fd5b5061025e61025936600461234d565b610836565b005b34801561026c57600080fd5b5061025e61027b36600461236a565b610885565b34801561028c57600080fd5b50610295608481565b60405161ffff9091168152602001610184565b3480156102b457600080fd5b5061025e6109d3565b3480156102c957600080fd5b506102dd6102d83660046123ab565b610ad0565b6040519015158152602001610184565b3480156102f957600080fd5b5060005473ffffffffffffffffffffffffffffffffffffffff16610219565b6101ad6103263660046121ad565b610aee565b34801561033757600080fd5b50610340611087565b60405161018491906123e2565b34801561035957600080fd5b506102dd610368366004612451565b67ffffffffffffffff1660009081526003602052604090205473ffffffffffffffffffffffffffffffffffffffff16151590565b3480156103a857600080fd5b506102196103b7366004612451565b67ffffffffffffffff1660009081526003602052604090205473ffffffffffffffffffffffffffffffffffffffff1690565b3480156103f557600080fd5b5061025e6104043660046124b8565b61118b565b34801561041557600080fd5b5060025473ffffffffffffffffffffffffffffffffffffffff16610219565b34801561044057600080fd5b5061025e61044f36600461234d565b611490565b34801561046057600080fd5b5061047461046f366004612451565b6114a4565b6040516101849190612552565b606081015160009073ffffffffffffffffffffffffffffffffffffffff166104c25760025473ffffffffffffffffffffffffffffffffffffffff1660608301525b67ffffffffffffffff831660009081526003602052604090205473ffffffffffffffffffffffffffffffffffffffff168061053a576040517fae236d9c00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff851660048201526024015b60405180910390fd5b6040517f20487ded00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8216906320487ded9061058e9087908790600401612689565b602060405180830381865afa1580156105ab573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105cf91906126ac565b9150505b92915050565b6000606060007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663397796f76040518163ffffffff1660e01b8152600401602060405180830381865afa15801561064a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061066e91906126c5565b156106a5576040517fc148371500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6106be6106b86040890160208a01612451565b33610ad0565b6106f4576040517fd2316ede00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006385572ffb60e01b8860405160240161070f91906127f4565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152905061079c8186888a60846115c4565b919550935091507f9b877de93ea9895756e337442c657f95a34fc68e7eb988bdfa693d5be83016b688356107d660408b0160208c01612451565b83516020850120604051610823939291339193845267ffffffffffffffff92909216602084015273ffffffffffffffffffffffffffffffffffffffff166040830152606082015260800190565b60405180910390a1509450945094915050565b61083e6116ea565b600280547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b61088d6116ea565b73ffffffffffffffffffffffffffffffffffffffff82166108f2576040517f26a78f8f00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff83166004820152602401610531565b73ffffffffffffffffffffffffffffffffffffffff83166109ad5760008273ffffffffffffffffffffffffffffffffffffffff168260405160006040518083038185875af1925050503d8060008114610967576040519150601f19603f3d011682016040523d82523d6000602084013e61096c565b606091505b50509050806109a7576040517fe417b80b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50505050565b6109ce73ffffffffffffffffffffffffffffffffffffffff8416838361176d565b505050565b60015473ffffffffffffffffffffffffffffffffffffffff163314610a54576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e6572000000000000000000006044820152606401610531565b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b6000610ae7610adf8484611841565b600490611885565b9392505050565b60007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663397796f76040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b5b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b7f91906126c5565b15610bb6576040517fc148371500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b67ffffffffffffffff831660009081526003602052604090205473ffffffffffffffffffffffffffffffffffffffff1680610c29576040517fae236d9c00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff85166004820152602401610531565b606083015160009073ffffffffffffffffffffffffffffffffffffffff16610dbb5760025473ffffffffffffffffffffffffffffffffffffffff90811660608601526040517f20487ded000000000000000000000000000000000000000000000000000000008152908316906320487ded90610cab9088908890600401612689565b602060405180830381865afa158015610cc8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cec91906126ac565b905080341015610d28576040517f07da6ee600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b349050836060015173ffffffffffffffffffffffffffffffffffffffff1663d0e30db0826040518263ffffffff1660e01b81526004016000604051808303818588803b158015610d7757600080fd5b505af1158015610d8b573d6000803e3d6000fd5b505050506060850151610db6915073ffffffffffffffffffffffffffffffffffffffff16838361176d565b610eb2565b3415610df3576040517f1841b4e100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f20487ded00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8316906320487ded90610e479088908890600401612689565b602060405180830381865afa158015610e64573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e8891906126ac565b6060850151909150610eb29073ffffffffffffffffffffffffffffffffffffffff1633848461189d565b60005b846040015151811015610fe257600085604001518281518110610eda57610eda612900565b6020908102919091010151516040517f48a98aa400000000000000000000000000000000000000000000000000000000815267ffffffffffffffff8916600482015273ffffffffffffffffffffffffffffffffffffffff8083166024830152919250610fd9913391908716906348a98aa490604401602060405180830381865afa158015610f6c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f90919061292f565b88604001518581518110610fa657610fa6612900565b6020026020010151602001518473ffffffffffffffffffffffffffffffffffffffff1661189d909392919063ffffffff16565b50600101610eb5565b506040517fdf0aa9e900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff83169063df0aa9e99061103b90889088908690339060040161294c565b6020604051808303816000875af115801561105a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061107e91906126ac565b95945050505050565b6060600061109560046118fb565b90506000815167ffffffffffffffff8111156110b3576110b3611f6c565b6040519080825280602002602001820160405280156110f857816020015b60408051808201909152600080825260208201528152602001906001900390816110d15790505b50905060005b825181101561118457600083828151811061111b5761111b612900565b60200260200101519050604051806040016040528060a083901c67ffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1681525083838151811061117057611170612900565b6020908102919091010152506001016110fe565b5092915050565b6111936116ea565b60005b8581101561126f5760008787838181106111b2576111b2612900565b9050604002018036038101906111c8919061299c565b60208181018051835167ffffffffffffffff90811660009081526003855260409081902080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff948516179055855193519051921682529394509216917f1f7d0ec248b80e5c0dde0ee531c4fc8fdb6ce9a2b3d90f560c74acd6a7202f23910160405180910390a250600101611196565b5060005b838110156113a757600085858381811061128f5761128f612900565b6112a59260206040909202019081019150612451565b905060008686848181106112bb576112bb612900565b90506040020160200160208101906112d3919061234d565b90506112ea6112e28383611841565b600490611908565b611348576040517f4964779000000000000000000000000000000000000000000000000000000000815267ffffffffffffffff8316600482015273ffffffffffffffffffffffffffffffffffffffff82166024820152604401610531565b60405173ffffffffffffffffffffffffffffffffffffffff8216815267ffffffffffffffff8316907fa823809efda3ba66c873364eec120fa0923d9fabda73bc97dd5663341e2d9bcb9060200160405180910390a25050600101611273565b5060005b818110156114875760008383838181106113c7576113c7612900565b6113dd9260206040909202019081019150612451565b905060008484848181106113f3576113f3612900565b905060400201602001602081019061140b919061234d565b905061142261141a8383611841565b600490611914565b1561147d5760405173ffffffffffffffffffffffffffffffffffffffff8216815267ffffffffffffffff8316907fa4bdf64ebdf3316320601a081916a75aa144bcef6c4beeb0e9fb1982cacc6b949060200160405180910390a25b50506001016113ab565b50505050505050565b6114986116ea565b6114a181611920565b50565b60606114de8267ffffffffffffffff1660009081526003602052604090205473ffffffffffffffffffffffffffffffffffffffff16151590565b6114f8576040805160008082526020820190925290611184565b67ffffffffffffffff8216600081815260036020526040908190205490517ffbca3b74000000000000000000000000000000000000000000000000000000008152600481019290925273ffffffffffffffffffffffffffffffffffffffff169063fbca3b7490602401600060405180830381865afa15801561157e573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682016040526105d391908101906129db565b6000606060008361ffff1667ffffffffffffffff8111156115e7576115e7611f6c565b6040519080825280601f01601f191660200182016040528015611611576020820181803683370190505b509150863b611644577f0c3b563c0000000000000000000000000000000000000000000000000000000060005260046000fd5b5a85811015611677577fafa32a2c0000000000000000000000000000000000000000000000000000000060005260046000fd5b85900360408104810387106116b0577f37c3be290000000000000000000000000000000000000000000000000000000060005260046000fd5b505a6000808a5160208c0160008c8cf193505a900390503d848111156116d35750835b808352806000602085013e50955095509592505050565b60005473ffffffffffffffffffffffffffffffffffffffff16331461176b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e6572000000000000000000006044820152606401610531565b565b60405173ffffffffffffffffffffffffffffffffffffffff83166024820152604481018290526109ce9084907fa9059cbb00000000000000000000000000000000000000000000000000000000906064015b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152611a15565b6000610ae773ffffffffffffffffffffffffffffffffffffffff83167bffffffffffffffff000000000000000000000000000000000000000060a086901b16612a99565b60008181526001830160205260408120541515610ae7565b60405173ffffffffffffffffffffffffffffffffffffffff808516602483015283166044820152606481018290526109a79085907f23b872dd00000000000000000000000000000000000000000000000000000000906084016117bf565b60606000610ae783611b21565b6000610ae78383611b7d565b6000610ae78383611c70565b3373ffffffffffffffffffffffffffffffffffffffff82160361199f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c660000000000000000006044820152606401610531565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b6000611a77826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16611cbf9092919063ffffffff16565b8051909150156109ce5780806020019051810190611a9591906126c5565b6109ce576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610531565b606081600001805480602002602001604051908101604052809291908181526020018280548015611b7157602002820191906000526020600020905b815481526020019060010190808311611b5d575b50505050509050919050565b60008181526001830160205260408120548015611c66576000611ba1600183612aac565b8554909150600090611bb590600190612aac565b9050808214611c1a576000866000018281548110611bd557611bd5612900565b9060005260206000200154905080876000018481548110611bf857611bf8612900565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080611c2b57611c2b612abf565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506105d3565b60009150506105d3565b6000818152600183016020526040812054611cb7575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556105d3565b5060006105d3565b6060611cce8484600085611cd6565b949350505050565b606082471015611d68576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610531565b6000808673ffffffffffffffffffffffffffffffffffffffff168587604051611d919190612aee565b60006040518083038185875af1925050503d8060008114611dce576040519150601f19603f3d011682016040523d82523d6000602084013e611dd3565b606091505b5091509150611de487838387611def565b979650505050505050565b60608315611e85578251600003611e7e5773ffffffffffffffffffffffffffffffffffffffff85163b611e7e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610531565b5081611cce565b611cce8383815115611e9a5781518083602001fd5b806040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105319190611f3c565b60005b83811015611ee9578181015183820152602001611ed1565b50506000910152565b60008151808452611f0a816020860160208601611ece565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b602081526000610ae76020830184611ef2565b803567ffffffffffffffff81168114611f6757600080fd5b919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040805190810167ffffffffffffffff81118282101715611fbe57611fbe611f6c565b60405290565b60405160a0810167ffffffffffffffff81118282101715611fbe57611fbe611f6c565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff8111828210171561202e5761202e611f6c565b604052919050565b600082601f83011261204757600080fd5b813567ffffffffffffffff81111561206157612061611f6c565b61209260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f84011601611fe7565b8181528460208386010111156120a757600080fd5b816020850160208301376000918101602001919091529392505050565b600067ffffffffffffffff8211156120de576120de611f6c565b5060051b60200190565b73ffffffffffffffffffffffffffffffffffffffff811681146114a157600080fd5b8035611f67816120e8565b600082601f83011261212657600080fd5b8135602061213b612136836120c4565b611fe7565b82815260069290921b8401810191818101908684111561215a57600080fd5b8286015b848110156121a257604081890312156121775760008081fd5b61217f611f9b565b813561218a816120e8565b8152818501358582015283529183019160400161215e565b509695505050505050565b600080604083850312156121c057600080fd5b6121c983611f4f565b9150602083013567ffffffffffffffff808211156121e657600080fd5b9084019060a082870312156121fa57600080fd5b612202611fc4565b82358281111561221157600080fd5b61221d88828601612036565b82525060208301358281111561223257600080fd5b61223e88828601612036565b60208301525060408301358281111561225657600080fd5b61226288828601612115565b6040830152506122746060840161210a565b606082015260808301358281111561228b57600080fd5b61229788828601612036565b6080830152508093505050509250929050565b600080600080608085870312156122c057600080fd5b843567ffffffffffffffff8111156122d757600080fd5b850160a081880312156122e957600080fd5b9350602085013561ffff8116811461230057600080fd5b9250604085013591506060850135612317816120e8565b939692955090935050565b831515815260606020820152600061233d6060830185611ef2565b9050826040830152949350505050565b60006020828403121561235f57600080fd5b8135610ae7816120e8565b60008060006060848603121561237f57600080fd5b833561238a816120e8565b9250602084013561239a816120e8565b929592945050506040919091013590565b600080604083850312156123be57600080fd5b6123c783611f4f565b915060208301356123d7816120e8565b809150509250929050565b602080825282518282018190526000919060409081850190868401855b82811015612444578151805167ffffffffffffffff16855286015173ffffffffffffffffffffffffffffffffffffffff168685015292840192908501906001016123ff565b5091979650505050505050565b60006020828403121561246357600080fd5b610ae782611f4f565b60008083601f84011261247e57600080fd5b50813567ffffffffffffffff81111561249657600080fd5b6020830191508360208260061b85010111156124b157600080fd5b9250929050565b600080600080600080606087890312156124d157600080fd5b863567ffffffffffffffff808211156124e957600080fd5b6124f58a838b0161246c565b9098509650602089013591508082111561250e57600080fd5b61251a8a838b0161246c565b9096509450604089013591508082111561253357600080fd5b5061254089828a0161246c565b979a9699509497509295939492505050565b6020808252825182820181905260009190848201906040850190845b818110156125a057835173ffffffffffffffffffffffffffffffffffffffff168352928401929184019160010161256e565b50909695505050505050565b6000815160a084526125c160a0850182611ef2565b9050602080840151858303828701526125da8382611ef2565b60408681015188830389830152805180845290850195509092506000918401905b8083101561263a578551805173ffffffffffffffffffffffffffffffffffffffff168352850151858301529484019460019290920191908301906125fb565b5060608701519450612664606089018673ffffffffffffffffffffffffffffffffffffffff169052565b60808701519450878103608089015261267d8186611ef2565b98975050505050505050565b67ffffffffffffffff83168152604060208201526000611cce60408301846125ac565b6000602082840312156126be57600080fd5b5051919050565b6000602082840312156126d757600080fd5b81518015158114610ae757600080fd5b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe184360301811261271c57600080fd5b830160208101925035905067ffffffffffffffff81111561273c57600080fd5b8036038213156124b157600080fd5b8183528181602085013750600060208284010152600060207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b8183526000602080850194508260005b858110156127e95781356127b7816120e8565b73ffffffffffffffffffffffffffffffffffffffff1687528183013583880152604096870196909101906001016127a4565b509495945050505050565b6020815281356020820152600061280d60208401611f4f565b67ffffffffffffffff808216604085015261282b60408601866126e7565b925060a0606086015261284260c08601848361274b565b92505061285260608601866126e7565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08087860301608088015261288885838561274b565b9450608088013592507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe18836030183126128c157600080fd5b602092880192830192359150838211156128da57600080fd5b8160061b36038313156128ec57600080fd5b8685030160a0870152611de4848284612794565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60006020828403121561294157600080fd5b8151610ae7816120e8565b67ffffffffffffffff8516815260806020820152600061296f60808301866125ac565b905083604083015273ffffffffffffffffffffffffffffffffffffffff8316606083015295945050505050565b6000604082840312156129ae57600080fd5b6129b6611f9b565b6129bf83611f4f565b815260208301356129cf816120e8565b60208201529392505050565b600060208083850312156129ee57600080fd5b825167ffffffffffffffff811115612a0557600080fd5b8301601f81018513612a1657600080fd5b8051612a24612136826120c4565b81815260059190911b82018301908381019087831115612a4357600080fd5b928401925b82841015611de4578351612a5b816120e8565b82529284019290840190612a48565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b808201808211156105d3576105d3612a6a565b818103818111156105d3576105d3612a6a565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b60008251612b00818460208701611ece565b919091019291505056fea164736f6c6343000818000a", +} + +var RouterABI = RouterMetaData.ABI + +var RouterBin = RouterMetaData.Bin + +func DeployRouter(auth *bind.TransactOpts, backend bind.ContractBackend, wrappedNative common.Address, armProxy common.Address) (common.Address, *types.Transaction, *Router, error) { + parsed, err := RouterMetaData.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(RouterBin), backend, wrappedNative, armProxy) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &Router{address: address, abi: *parsed, RouterCaller: RouterCaller{contract: contract}, RouterTransactor: RouterTransactor{contract: contract}, RouterFilterer: RouterFilterer{contract: contract}}, nil +} + +type Router struct { + address common.Address + abi abi.ABI + RouterCaller + RouterTransactor + RouterFilterer +} + +type RouterCaller struct { + contract *bind.BoundContract +} + +type RouterTransactor struct { + contract *bind.BoundContract +} + +type RouterFilterer struct { + contract *bind.BoundContract +} + +type RouterSession struct { + Contract *Router + CallOpts bind.CallOpts + TransactOpts bind.TransactOpts +} + +type RouterCallerSession struct { + Contract *RouterCaller + CallOpts bind.CallOpts +} + +type RouterTransactorSession struct { + Contract *RouterTransactor + TransactOpts bind.TransactOpts +} + +type RouterRaw struct { + Contract *Router +} + +type RouterCallerRaw struct { + Contract *RouterCaller +} + +type RouterTransactorRaw struct { + Contract *RouterTransactor +} + +func NewRouter(address common.Address, backend bind.ContractBackend) (*Router, error) { + abi, err := abi.JSON(strings.NewReader(RouterABI)) + if err != nil { + return nil, err + } + contract, err := bindRouter(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &Router{address: address, abi: abi, RouterCaller: RouterCaller{contract: contract}, RouterTransactor: RouterTransactor{contract: contract}, RouterFilterer: RouterFilterer{contract: contract}}, nil +} + +func NewRouterCaller(address common.Address, caller bind.ContractCaller) (*RouterCaller, error) { + contract, err := bindRouter(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &RouterCaller{contract: contract}, nil +} + +func NewRouterTransactor(address common.Address, transactor bind.ContractTransactor) (*RouterTransactor, error) { + contract, err := bindRouter(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &RouterTransactor{contract: contract}, nil +} + +func NewRouterFilterer(address common.Address, filterer bind.ContractFilterer) (*RouterFilterer, error) { + contract, err := bindRouter(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &RouterFilterer{contract: contract}, nil +} + +func bindRouter(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := RouterMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +func (_Router *RouterRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _Router.Contract.RouterCaller.contract.Call(opts, result, method, params...) +} + +func (_Router *RouterRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Router.Contract.RouterTransactor.contract.Transfer(opts) +} + +func (_Router *RouterRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _Router.Contract.RouterTransactor.contract.Transact(opts, method, params...) +} + +func (_Router *RouterCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _Router.Contract.contract.Call(opts, result, method, params...) +} + +func (_Router *RouterTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Router.Contract.contract.Transfer(opts) +} + +func (_Router *RouterTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _Router.Contract.contract.Transact(opts, method, params...) +} + +func (_Router *RouterCaller) MAXRETBYTES(opts *bind.CallOpts) (uint16, error) { + var out []interface{} + err := _Router.contract.Call(opts, &out, "MAX_RET_BYTES") + + if err != nil { + return *new(uint16), err + } + + out0 := *abi.ConvertType(out[0], new(uint16)).(*uint16) + + return out0, err + +} + +func (_Router *RouterSession) MAXRETBYTES() (uint16, error) { + return _Router.Contract.MAXRETBYTES(&_Router.CallOpts) +} + +func (_Router *RouterCallerSession) MAXRETBYTES() (uint16, error) { + return _Router.Contract.MAXRETBYTES(&_Router.CallOpts) +} + +func (_Router *RouterCaller) GetArmProxy(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _Router.contract.Call(opts, &out, "getArmProxy") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_Router *RouterSession) GetArmProxy() (common.Address, error) { + return _Router.Contract.GetArmProxy(&_Router.CallOpts) +} + +func (_Router *RouterCallerSession) GetArmProxy() (common.Address, error) { + return _Router.Contract.GetArmProxy(&_Router.CallOpts) +} + +func (_Router *RouterCaller) GetFee(opts *bind.CallOpts, destinationChainSelector uint64, message ClientEVM2AnyMessage) (*big.Int, error) { + var out []interface{} + err := _Router.contract.Call(opts, &out, "getFee", destinationChainSelector, message) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_Router *RouterSession) GetFee(destinationChainSelector uint64, message ClientEVM2AnyMessage) (*big.Int, error) { + return _Router.Contract.GetFee(&_Router.CallOpts, destinationChainSelector, message) +} + +func (_Router *RouterCallerSession) GetFee(destinationChainSelector uint64, message ClientEVM2AnyMessage) (*big.Int, error) { + return _Router.Contract.GetFee(&_Router.CallOpts, destinationChainSelector, message) +} + +func (_Router *RouterCaller) GetOffRamps(opts *bind.CallOpts) ([]RouterOffRamp, error) { + var out []interface{} + err := _Router.contract.Call(opts, &out, "getOffRamps") + + if err != nil { + return *new([]RouterOffRamp), err + } + + out0 := *abi.ConvertType(out[0], new([]RouterOffRamp)).(*[]RouterOffRamp) + + return out0, err + +} + +func (_Router *RouterSession) GetOffRamps() ([]RouterOffRamp, error) { + return _Router.Contract.GetOffRamps(&_Router.CallOpts) +} + +func (_Router *RouterCallerSession) GetOffRamps() ([]RouterOffRamp, error) { + return _Router.Contract.GetOffRamps(&_Router.CallOpts) +} + +func (_Router *RouterCaller) GetOnRamp(opts *bind.CallOpts, destChainSelector uint64) (common.Address, error) { + var out []interface{} + err := _Router.contract.Call(opts, &out, "getOnRamp", destChainSelector) + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_Router *RouterSession) GetOnRamp(destChainSelector uint64) (common.Address, error) { + return _Router.Contract.GetOnRamp(&_Router.CallOpts, destChainSelector) +} + +func (_Router *RouterCallerSession) GetOnRamp(destChainSelector uint64) (common.Address, error) { + return _Router.Contract.GetOnRamp(&_Router.CallOpts, destChainSelector) +} + +func (_Router *RouterCaller) GetSupportedTokens(opts *bind.CallOpts, chainSelector uint64) ([]common.Address, error) { + var out []interface{} + err := _Router.contract.Call(opts, &out, "getSupportedTokens", chainSelector) + + if err != nil { + return *new([]common.Address), err + } + + out0 := *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) + + return out0, err + +} + +func (_Router *RouterSession) GetSupportedTokens(chainSelector uint64) ([]common.Address, error) { + return _Router.Contract.GetSupportedTokens(&_Router.CallOpts, chainSelector) +} + +func (_Router *RouterCallerSession) GetSupportedTokens(chainSelector uint64) ([]common.Address, error) { + return _Router.Contract.GetSupportedTokens(&_Router.CallOpts, chainSelector) +} + +func (_Router *RouterCaller) GetWrappedNative(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _Router.contract.Call(opts, &out, "getWrappedNative") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_Router *RouterSession) GetWrappedNative() (common.Address, error) { + return _Router.Contract.GetWrappedNative(&_Router.CallOpts) +} + +func (_Router *RouterCallerSession) GetWrappedNative() (common.Address, error) { + return _Router.Contract.GetWrappedNative(&_Router.CallOpts) +} + +func (_Router *RouterCaller) IsChainSupported(opts *bind.CallOpts, chainSelector uint64) (bool, error) { + var out []interface{} + err := _Router.contract.Call(opts, &out, "isChainSupported", chainSelector) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_Router *RouterSession) IsChainSupported(chainSelector uint64) (bool, error) { + return _Router.Contract.IsChainSupported(&_Router.CallOpts, chainSelector) +} + +func (_Router *RouterCallerSession) IsChainSupported(chainSelector uint64) (bool, error) { + return _Router.Contract.IsChainSupported(&_Router.CallOpts, chainSelector) +} + +func (_Router *RouterCaller) IsOffRamp(opts *bind.CallOpts, sourceChainSelector uint64, offRamp common.Address) (bool, error) { + var out []interface{} + err := _Router.contract.Call(opts, &out, "isOffRamp", sourceChainSelector, offRamp) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_Router *RouterSession) IsOffRamp(sourceChainSelector uint64, offRamp common.Address) (bool, error) { + return _Router.Contract.IsOffRamp(&_Router.CallOpts, sourceChainSelector, offRamp) +} + +func (_Router *RouterCallerSession) IsOffRamp(sourceChainSelector uint64, offRamp common.Address) (bool, error) { + return _Router.Contract.IsOffRamp(&_Router.CallOpts, sourceChainSelector, offRamp) +} + +func (_Router *RouterCaller) Owner(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _Router.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 + +} + +func (_Router *RouterSession) Owner() (common.Address, error) { + return _Router.Contract.Owner(&_Router.CallOpts) +} + +func (_Router *RouterCallerSession) Owner() (common.Address, error) { + return _Router.Contract.Owner(&_Router.CallOpts) +} + +func (_Router *RouterCaller) TypeAndVersion(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _Router.contract.Call(opts, &out, "typeAndVersion") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +func (_Router *RouterSession) TypeAndVersion() (string, error) { + return _Router.Contract.TypeAndVersion(&_Router.CallOpts) +} + +func (_Router *RouterCallerSession) TypeAndVersion() (string, error) { + return _Router.Contract.TypeAndVersion(&_Router.CallOpts) +} + +func (_Router *RouterTransactor) AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Router.contract.Transact(opts, "acceptOwnership") +} + +func (_Router *RouterSession) AcceptOwnership() (*types.Transaction, error) { + return _Router.Contract.AcceptOwnership(&_Router.TransactOpts) +} + +func (_Router *RouterTransactorSession) AcceptOwnership() (*types.Transaction, error) { + return _Router.Contract.AcceptOwnership(&_Router.TransactOpts) +} + +func (_Router *RouterTransactor) ApplyRampUpdates(opts *bind.TransactOpts, onRampUpdates []RouterOnRamp, offRampRemoves []RouterOffRamp, offRampAdds []RouterOffRamp) (*types.Transaction, error) { + return _Router.contract.Transact(opts, "applyRampUpdates", onRampUpdates, offRampRemoves, offRampAdds) +} + +func (_Router *RouterSession) ApplyRampUpdates(onRampUpdates []RouterOnRamp, offRampRemoves []RouterOffRamp, offRampAdds []RouterOffRamp) (*types.Transaction, error) { + return _Router.Contract.ApplyRampUpdates(&_Router.TransactOpts, onRampUpdates, offRampRemoves, offRampAdds) +} + +func (_Router *RouterTransactorSession) ApplyRampUpdates(onRampUpdates []RouterOnRamp, offRampRemoves []RouterOffRamp, offRampAdds []RouterOffRamp) (*types.Transaction, error) { + return _Router.Contract.ApplyRampUpdates(&_Router.TransactOpts, onRampUpdates, offRampRemoves, offRampAdds) +} + +func (_Router *RouterTransactor) CcipSend(opts *bind.TransactOpts, destinationChainSelector uint64, message ClientEVM2AnyMessage) (*types.Transaction, error) { + return _Router.contract.Transact(opts, "ccipSend", destinationChainSelector, message) +} + +func (_Router *RouterSession) CcipSend(destinationChainSelector uint64, message ClientEVM2AnyMessage) (*types.Transaction, error) { + return _Router.Contract.CcipSend(&_Router.TransactOpts, destinationChainSelector, message) +} + +func (_Router *RouterTransactorSession) CcipSend(destinationChainSelector uint64, message ClientEVM2AnyMessage) (*types.Transaction, error) { + return _Router.Contract.CcipSend(&_Router.TransactOpts, destinationChainSelector, message) +} + +func (_Router *RouterTransactor) RecoverTokens(opts *bind.TransactOpts, tokenAddress common.Address, to common.Address, amount *big.Int) (*types.Transaction, error) { + return _Router.contract.Transact(opts, "recoverTokens", tokenAddress, to, amount) +} + +func (_Router *RouterSession) RecoverTokens(tokenAddress common.Address, to common.Address, amount *big.Int) (*types.Transaction, error) { + return _Router.Contract.RecoverTokens(&_Router.TransactOpts, tokenAddress, to, amount) +} + +func (_Router *RouterTransactorSession) RecoverTokens(tokenAddress common.Address, to common.Address, amount *big.Int) (*types.Transaction, error) { + return _Router.Contract.RecoverTokens(&_Router.TransactOpts, tokenAddress, to, amount) +} + +func (_Router *RouterTransactor) RouteMessage(opts *bind.TransactOpts, message ClientAny2EVMMessage, gasForCallExactCheck uint16, gasLimit *big.Int, receiver common.Address) (*types.Transaction, error) { + return _Router.contract.Transact(opts, "routeMessage", message, gasForCallExactCheck, gasLimit, receiver) +} + +func (_Router *RouterSession) RouteMessage(message ClientAny2EVMMessage, gasForCallExactCheck uint16, gasLimit *big.Int, receiver common.Address) (*types.Transaction, error) { + return _Router.Contract.RouteMessage(&_Router.TransactOpts, message, gasForCallExactCheck, gasLimit, receiver) +} + +func (_Router *RouterTransactorSession) RouteMessage(message ClientAny2EVMMessage, gasForCallExactCheck uint16, gasLimit *big.Int, receiver common.Address) (*types.Transaction, error) { + return _Router.Contract.RouteMessage(&_Router.TransactOpts, message, gasForCallExactCheck, gasLimit, receiver) +} + +func (_Router *RouterTransactor) SetWrappedNative(opts *bind.TransactOpts, wrappedNative common.Address) (*types.Transaction, error) { + return _Router.contract.Transact(opts, "setWrappedNative", wrappedNative) +} + +func (_Router *RouterSession) SetWrappedNative(wrappedNative common.Address) (*types.Transaction, error) { + return _Router.Contract.SetWrappedNative(&_Router.TransactOpts, wrappedNative) +} + +func (_Router *RouterTransactorSession) SetWrappedNative(wrappedNative common.Address) (*types.Transaction, error) { + return _Router.Contract.SetWrappedNative(&_Router.TransactOpts, wrappedNative) +} + +func (_Router *RouterTransactor) TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) { + return _Router.contract.Transact(opts, "transferOwnership", to) +} + +func (_Router *RouterSession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _Router.Contract.TransferOwnership(&_Router.TransactOpts, to) +} + +func (_Router *RouterTransactorSession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _Router.Contract.TransferOwnership(&_Router.TransactOpts, to) +} + +type RouterMessageExecutedIterator struct { + Event *RouterMessageExecuted + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *RouterMessageExecutedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(RouterMessageExecuted) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(RouterMessageExecuted) + 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() + } +} + +func (it *RouterMessageExecutedIterator) Error() error { + return it.fail +} + +func (it *RouterMessageExecutedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type RouterMessageExecuted struct { + MessageId [32]byte + SourceChainSelector uint64 + OffRamp common.Address + CalldataHash [32]byte + Raw types.Log +} + +func (_Router *RouterFilterer) FilterMessageExecuted(opts *bind.FilterOpts) (*RouterMessageExecutedIterator, error) { + + logs, sub, err := _Router.contract.FilterLogs(opts, "MessageExecuted") + if err != nil { + return nil, err + } + return &RouterMessageExecutedIterator{contract: _Router.contract, event: "MessageExecuted", logs: logs, sub: sub}, nil +} + +func (_Router *RouterFilterer) WatchMessageExecuted(opts *bind.WatchOpts, sink chan<- *RouterMessageExecuted) (event.Subscription, error) { + + logs, sub, err := _Router.contract.WatchLogs(opts, "MessageExecuted") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(RouterMessageExecuted) + if err := _Router.contract.UnpackLog(event, "MessageExecuted", 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 +} + +func (_Router *RouterFilterer) ParseMessageExecuted(log types.Log) (*RouterMessageExecuted, error) { + event := new(RouterMessageExecuted) + if err := _Router.contract.UnpackLog(event, "MessageExecuted", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type RouterOffRampAddedIterator struct { + Event *RouterOffRampAdded + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *RouterOffRampAddedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(RouterOffRampAdded) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(RouterOffRampAdded) + 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() + } +} + +func (it *RouterOffRampAddedIterator) Error() error { + return it.fail +} + +func (it *RouterOffRampAddedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type RouterOffRampAdded struct { + SourceChainSelector uint64 + OffRamp common.Address + Raw types.Log +} + +func (_Router *RouterFilterer) FilterOffRampAdded(opts *bind.FilterOpts, sourceChainSelector []uint64) (*RouterOffRampAddedIterator, error) { + + var sourceChainSelectorRule []interface{} + for _, sourceChainSelectorItem := range sourceChainSelector { + sourceChainSelectorRule = append(sourceChainSelectorRule, sourceChainSelectorItem) + } + + logs, sub, err := _Router.contract.FilterLogs(opts, "OffRampAdded", sourceChainSelectorRule) + if err != nil { + return nil, err + } + return &RouterOffRampAddedIterator{contract: _Router.contract, event: "OffRampAdded", logs: logs, sub: sub}, nil +} + +func (_Router *RouterFilterer) WatchOffRampAdded(opts *bind.WatchOpts, sink chan<- *RouterOffRampAdded, sourceChainSelector []uint64) (event.Subscription, error) { + + var sourceChainSelectorRule []interface{} + for _, sourceChainSelectorItem := range sourceChainSelector { + sourceChainSelectorRule = append(sourceChainSelectorRule, sourceChainSelectorItem) + } + + logs, sub, err := _Router.contract.WatchLogs(opts, "OffRampAdded", sourceChainSelectorRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(RouterOffRampAdded) + if err := _Router.contract.UnpackLog(event, "OffRampAdded", 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 +} + +func (_Router *RouterFilterer) ParseOffRampAdded(log types.Log) (*RouterOffRampAdded, error) { + event := new(RouterOffRampAdded) + if err := _Router.contract.UnpackLog(event, "OffRampAdded", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type RouterOffRampRemovedIterator struct { + Event *RouterOffRampRemoved + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *RouterOffRampRemovedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(RouterOffRampRemoved) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(RouterOffRampRemoved) + 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() + } +} + +func (it *RouterOffRampRemovedIterator) Error() error { + return it.fail +} + +func (it *RouterOffRampRemovedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type RouterOffRampRemoved struct { + SourceChainSelector uint64 + OffRamp common.Address + Raw types.Log +} + +func (_Router *RouterFilterer) FilterOffRampRemoved(opts *bind.FilterOpts, sourceChainSelector []uint64) (*RouterOffRampRemovedIterator, error) { + + var sourceChainSelectorRule []interface{} + for _, sourceChainSelectorItem := range sourceChainSelector { + sourceChainSelectorRule = append(sourceChainSelectorRule, sourceChainSelectorItem) + } + + logs, sub, err := _Router.contract.FilterLogs(opts, "OffRampRemoved", sourceChainSelectorRule) + if err != nil { + return nil, err + } + return &RouterOffRampRemovedIterator{contract: _Router.contract, event: "OffRampRemoved", logs: logs, sub: sub}, nil +} + +func (_Router *RouterFilterer) WatchOffRampRemoved(opts *bind.WatchOpts, sink chan<- *RouterOffRampRemoved, sourceChainSelector []uint64) (event.Subscription, error) { + + var sourceChainSelectorRule []interface{} + for _, sourceChainSelectorItem := range sourceChainSelector { + sourceChainSelectorRule = append(sourceChainSelectorRule, sourceChainSelectorItem) + } + + logs, sub, err := _Router.contract.WatchLogs(opts, "OffRampRemoved", sourceChainSelectorRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(RouterOffRampRemoved) + if err := _Router.contract.UnpackLog(event, "OffRampRemoved", 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 +} + +func (_Router *RouterFilterer) ParseOffRampRemoved(log types.Log) (*RouterOffRampRemoved, error) { + event := new(RouterOffRampRemoved) + if err := _Router.contract.UnpackLog(event, "OffRampRemoved", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type RouterOnRampSetIterator struct { + Event *RouterOnRampSet + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *RouterOnRampSetIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(RouterOnRampSet) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(RouterOnRampSet) + 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() + } +} + +func (it *RouterOnRampSetIterator) Error() error { + return it.fail +} + +func (it *RouterOnRampSetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type RouterOnRampSet struct { + DestChainSelector uint64 + OnRamp common.Address + Raw types.Log +} + +func (_Router *RouterFilterer) FilterOnRampSet(opts *bind.FilterOpts, destChainSelector []uint64) (*RouterOnRampSetIterator, error) { + + var destChainSelectorRule []interface{} + for _, destChainSelectorItem := range destChainSelector { + destChainSelectorRule = append(destChainSelectorRule, destChainSelectorItem) + } + + logs, sub, err := _Router.contract.FilterLogs(opts, "OnRampSet", destChainSelectorRule) + if err != nil { + return nil, err + } + return &RouterOnRampSetIterator{contract: _Router.contract, event: "OnRampSet", logs: logs, sub: sub}, nil +} + +func (_Router *RouterFilterer) WatchOnRampSet(opts *bind.WatchOpts, sink chan<- *RouterOnRampSet, destChainSelector []uint64) (event.Subscription, error) { + + var destChainSelectorRule []interface{} + for _, destChainSelectorItem := range destChainSelector { + destChainSelectorRule = append(destChainSelectorRule, destChainSelectorItem) + } + + logs, sub, err := _Router.contract.WatchLogs(opts, "OnRampSet", destChainSelectorRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(RouterOnRampSet) + if err := _Router.contract.UnpackLog(event, "OnRampSet", 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 +} + +func (_Router *RouterFilterer) ParseOnRampSet(log types.Log) (*RouterOnRampSet, error) { + event := new(RouterOnRampSet) + if err := _Router.contract.UnpackLog(event, "OnRampSet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type RouterOwnershipTransferRequestedIterator struct { + Event *RouterOwnershipTransferRequested + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *RouterOwnershipTransferRequestedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(RouterOwnershipTransferRequested) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(RouterOwnershipTransferRequested) + 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() + } +} + +func (it *RouterOwnershipTransferRequestedIterator) Error() error { + return it.fail +} + +func (it *RouterOwnershipTransferRequestedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type RouterOwnershipTransferRequested struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_Router *RouterFilterer) FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*RouterOwnershipTransferRequestedIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _Router.contract.FilterLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return &RouterOwnershipTransferRequestedIterator{contract: _Router.contract, event: "OwnershipTransferRequested", logs: logs, sub: sub}, nil +} + +func (_Router *RouterFilterer) WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *RouterOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _Router.contract.WatchLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(RouterOwnershipTransferRequested) + if err := _Router.contract.UnpackLog(event, "OwnershipTransferRequested", 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 +} + +func (_Router *RouterFilterer) ParseOwnershipTransferRequested(log types.Log) (*RouterOwnershipTransferRequested, error) { + event := new(RouterOwnershipTransferRequested) + if err := _Router.contract.UnpackLog(event, "OwnershipTransferRequested", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type RouterOwnershipTransferredIterator struct { + Event *RouterOwnershipTransferred + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *RouterOwnershipTransferredIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(RouterOwnershipTransferred) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(RouterOwnershipTransferred) + 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() + } +} + +func (it *RouterOwnershipTransferredIterator) Error() error { + return it.fail +} + +func (it *RouterOwnershipTransferredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type RouterOwnershipTransferred struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_Router *RouterFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*RouterOwnershipTransferredIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _Router.contract.FilterLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return &RouterOwnershipTransferredIterator{contract: _Router.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil +} + +func (_Router *RouterFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *RouterOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _Router.contract.WatchLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(RouterOwnershipTransferred) + if err := _Router.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 +} + +func (_Router *RouterFilterer) ParseOwnershipTransferred(log types.Log) (*RouterOwnershipTransferred, error) { + event := new(RouterOwnershipTransferred) + if err := _Router.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +func (_Router *Router) ParseLog(log types.Log) (generated.AbigenLog, error) { + switch log.Topics[0] { + case _Router.abi.Events["MessageExecuted"].ID: + return _Router.ParseMessageExecuted(log) + case _Router.abi.Events["OffRampAdded"].ID: + return _Router.ParseOffRampAdded(log) + case _Router.abi.Events["OffRampRemoved"].ID: + return _Router.ParseOffRampRemoved(log) + case _Router.abi.Events["OnRampSet"].ID: + return _Router.ParseOnRampSet(log) + case _Router.abi.Events["OwnershipTransferRequested"].ID: + return _Router.ParseOwnershipTransferRequested(log) + case _Router.abi.Events["OwnershipTransferred"].ID: + return _Router.ParseOwnershipTransferred(log) + + default: + return nil, fmt.Errorf("abigen wrapper received unknown log topic: %v", log.Topics[0]) + } +} + +func (RouterMessageExecuted) Topic() common.Hash { + return common.HexToHash("0x9b877de93ea9895756e337442c657f95a34fc68e7eb988bdfa693d5be83016b6") +} + +func (RouterOffRampAdded) Topic() common.Hash { + return common.HexToHash("0xa4bdf64ebdf3316320601a081916a75aa144bcef6c4beeb0e9fb1982cacc6b94") +} + +func (RouterOffRampRemoved) Topic() common.Hash { + return common.HexToHash("0xa823809efda3ba66c873364eec120fa0923d9fabda73bc97dd5663341e2d9bcb") +} + +func (RouterOnRampSet) Topic() common.Hash { + return common.HexToHash("0x1f7d0ec248b80e5c0dde0ee531c4fc8fdb6ce9a2b3d90f560c74acd6a7202f23") +} + +func (RouterOwnershipTransferRequested) Topic() common.Hash { + return common.HexToHash("0xed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae1278") +} + +func (RouterOwnershipTransferred) Topic() common.Hash { + return common.HexToHash("0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0") +} + +func (_Router *Router) Address() common.Address { + return _Router.address +} + +type RouterInterface interface { + MAXRETBYTES(opts *bind.CallOpts) (uint16, error) + + GetArmProxy(opts *bind.CallOpts) (common.Address, error) + + GetFee(opts *bind.CallOpts, destinationChainSelector uint64, message ClientEVM2AnyMessage) (*big.Int, error) + + GetOffRamps(opts *bind.CallOpts) ([]RouterOffRamp, error) + + GetOnRamp(opts *bind.CallOpts, destChainSelector uint64) (common.Address, error) + + GetSupportedTokens(opts *bind.CallOpts, chainSelector uint64) ([]common.Address, error) + + GetWrappedNative(opts *bind.CallOpts) (common.Address, error) + + IsChainSupported(opts *bind.CallOpts, chainSelector uint64) (bool, error) + + IsOffRamp(opts *bind.CallOpts, sourceChainSelector uint64, offRamp common.Address) (bool, error) + + Owner(opts *bind.CallOpts) (common.Address, error) + + TypeAndVersion(opts *bind.CallOpts) (string, error) + + AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) + + ApplyRampUpdates(opts *bind.TransactOpts, onRampUpdates []RouterOnRamp, offRampRemoves []RouterOffRamp, offRampAdds []RouterOffRamp) (*types.Transaction, error) + + CcipSend(opts *bind.TransactOpts, destinationChainSelector uint64, message ClientEVM2AnyMessage) (*types.Transaction, error) + + RecoverTokens(opts *bind.TransactOpts, tokenAddress common.Address, to common.Address, amount *big.Int) (*types.Transaction, error) + + RouteMessage(opts *bind.TransactOpts, message ClientAny2EVMMessage, gasForCallExactCheck uint16, gasLimit *big.Int, receiver common.Address) (*types.Transaction, error) + + SetWrappedNative(opts *bind.TransactOpts, wrappedNative common.Address) (*types.Transaction, error) + + TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) + + FilterMessageExecuted(opts *bind.FilterOpts) (*RouterMessageExecutedIterator, error) + + WatchMessageExecuted(opts *bind.WatchOpts, sink chan<- *RouterMessageExecuted) (event.Subscription, error) + + ParseMessageExecuted(log types.Log) (*RouterMessageExecuted, error) + + FilterOffRampAdded(opts *bind.FilterOpts, sourceChainSelector []uint64) (*RouterOffRampAddedIterator, error) + + WatchOffRampAdded(opts *bind.WatchOpts, sink chan<- *RouterOffRampAdded, sourceChainSelector []uint64) (event.Subscription, error) + + ParseOffRampAdded(log types.Log) (*RouterOffRampAdded, error) + + FilterOffRampRemoved(opts *bind.FilterOpts, sourceChainSelector []uint64) (*RouterOffRampRemovedIterator, error) + + WatchOffRampRemoved(opts *bind.WatchOpts, sink chan<- *RouterOffRampRemoved, sourceChainSelector []uint64) (event.Subscription, error) + + ParseOffRampRemoved(log types.Log) (*RouterOffRampRemoved, error) + + FilterOnRampSet(opts *bind.FilterOpts, destChainSelector []uint64) (*RouterOnRampSetIterator, error) + + WatchOnRampSet(opts *bind.WatchOpts, sink chan<- *RouterOnRampSet, destChainSelector []uint64) (event.Subscription, error) + + ParseOnRampSet(log types.Log) (*RouterOnRampSet, error) + + FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*RouterOwnershipTransferRequestedIterator, error) + + WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *RouterOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferRequested(log types.Log) (*RouterOwnershipTransferRequested, error) + + FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*RouterOwnershipTransferredIterator, error) + + WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *RouterOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferred(log types.Log) (*RouterOwnershipTransferred, error) + + ParseLog(log types.Log) (generated.AbigenLog, error) + + Address() common.Address +} diff --git a/core/gethwrappers/ccip/generated/self_funded_ping_pong/self_funded_ping_pong.go b/core/gethwrappers/ccip/generated/self_funded_ping_pong/self_funded_ping_pong.go new file mode 100644 index 00000000000..274f72bae38 --- /dev/null +++ b/core/gethwrappers/ccip/generated/self_funded_ping_pong/self_funded_ping_pong.go @@ -0,0 +1,1537 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package self_funded_ping_pong + +import ( + "errors" + "fmt" + "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" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" +) + +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +type ClientAny2EVMMessage struct { + MessageId [32]byte + SourceChainSelector uint64 + Sender []byte + Data []byte + DestTokenAmounts []ClientEVMTokenAmount +} + +type ClientEVMTokenAmount struct { + Token common.Address + Amount *big.Int +} + +var SelfFundedPingPongMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"router\",\"type\":\"address\"},{\"internalType\":\"contractIERC20\",\"name\":\"feeToken\",\"type\":\"address\"},{\"internalType\":\"uint8\",\"name\":\"roundTripsBeforeFunding\",\"type\":\"uint8\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"router\",\"type\":\"address\"}],\"name\":\"InvalidRouter\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"countIncrBeforeFunding\",\"type\":\"uint8\"}],\"name\":\"CountIncrBeforeFundingSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"Funded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"isOutOfOrder\",\"type\":\"bool\"}],\"name\":\"OutOfOrderExecutionChange\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"pingPongCount\",\"type\":\"uint256\"}],\"name\":\"Ping\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"pingPongCount\",\"type\":\"uint256\"}],\"name\":\"Pong\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"messageId\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"sender\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"internalType\":\"structClient.EVMTokenAmount[]\",\"name\":\"destTokenAmounts\",\"type\":\"tuple[]\"}],\"internalType\":\"structClient.Any2EVMMessage\",\"name\":\"message\",\"type\":\"tuple\"}],\"name\":\"ccipReceive\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"pingPongCount\",\"type\":\"uint256\"}],\"name\":\"fundPingPong\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getCountIncrBeforeFunding\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getCounterpartAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getCounterpartChainSelector\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getFeeToken\",\"outputs\":[{\"internalType\":\"contractIERC20\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getOutOfOrderExecution\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRouter\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isPaused\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"countIncrBeforeFunding\",\"type\":\"uint8\"}],\"name\":\"setCountIncrBeforeFunding\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"counterpartChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"counterpartAddress\",\"type\":\"address\"}],\"name\":\"setCounterpart\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"setCounterpartAddress\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"}],\"name\":\"setCounterpartChainSelector\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bool\",\"name\":\"outOfOrderExecution\",\"type\":\"bool\"}],\"name\":\"setOutOfOrderExecution\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bool\",\"name\":\"pause\",\"type\":\"bool\"}],\"name\":\"setPaused\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"startPingPong\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", + Bin: "0x60a06040523480156200001157600080fd5b506040516200190938038062001909833981016040819052620000349162000291565b828233806000846001600160a01b0381166200006b576040516335fdcccd60e21b8152600060048201526024015b60405180910390fd5b6001600160a01b039081166080528216620000c95760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f0000000000000000604482015260640162000062565b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000fc57620000fc81620001cd565b50506002805460ff60a01b1916905550600380546001600160a01b0319166001600160a01b0383811691821790925560405163095ea7b360e01b8152918416600483015260001960248301529063095ea7b3906044016020604051808303816000875af115801562000172573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001989190620002ea565b505050806002620001aa919062000315565b600360156101000a81548160ff021916908360ff16021790555050505062000347565b336001600160a01b03821603620002275760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640162000062565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b6001600160a01b03811681146200028e57600080fd5b50565b600080600060608486031215620002a757600080fd5b8351620002b48162000278565b6020850151909350620002c78162000278565b604085015190925060ff81168114620002df57600080fd5b809150509250925092565b600060208284031215620002fd57600080fd5b815180151581146200030e57600080fd5b9392505050565b60ff81811683821602908116908181146200034057634e487b7160e01b600052601160045260246000fd5b5092915050565b60805161159162000378600039600081816102f301528181610728015281816108180152610d0901526115916000f3fe608060405234801561001057600080fd5b50600436106101775760003560e01c80638f491cba116100d8578063b5a110111161008c578063e6c725f511610066578063e6c725f5146103a9578063ef686d8e146103da578063f2fde38b146103ed57600080fd5b8063b5a110111461033a578063bee518a41461034d578063ca709a251461038b57600080fd5b8063ae90de55116100bd578063ae90de55146102ce578063b0f479a1146102f1578063b187bd261461031757600080fd5b80638f491cba146102a85780639d2aede5146102bb57600080fd5b80632b6e5d631161012f57806379ba50971161011457806379ba50971461026f57806385572ffb146102775780638da5cb5b1461028a57600080fd5b80632b6e5d631461021d578063665ed5371461025c57600080fd5b8063181f5a7711610160578063181f5a77146101b95780631892b906146102025780632874d8bf1461021557600080fd5b806301ffc9a71461017c57806316c38b3c146101a4575b600080fd5b61018f61018a366004610f0b565b610400565b60405190151581526020015b60405180910390f35b6101b76101b2366004610f54565b610499565b005b6101f56040518060400160405280601881526020017f53656c6646756e64656450696e67506f6e6720312e352e30000000000000000081525081565b60405161019b9190610fda565b6101b761021036600461100a565b6104eb565b6101b7610546565b60025473ffffffffffffffffffffffffffffffffffffffff165b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161019b565b6101b761026a366004610f54565b610582565b6101b761060e565b6101b7610285366004611025565b610710565b60005473ffffffffffffffffffffffffffffffffffffffff16610237565b6101b76102b6366004611060565b610795565b6101b76102c936600461109b565b610977565b60035474010000000000000000000000000000000000000000900460ff1661018f565b7f0000000000000000000000000000000000000000000000000000000000000000610237565b60025474010000000000000000000000000000000000000000900460ff1661018f565b6101b76103483660046110b8565b6109c6565b60015474010000000000000000000000000000000000000000900467ffffffffffffffff1660405167ffffffffffffffff909116815260200161019b565b60035473ffffffffffffffffffffffffffffffffffffffff16610237565b6003547501000000000000000000000000000000000000000000900460ff1660405160ff909116815260200161019b565b6101b76103e83660046110ef565b610a68565b6101b76103fb36600461109b565b610aeb565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f85572ffb00000000000000000000000000000000000000000000000000000000148061049357507fffffffff0000000000000000000000000000000000000000000000000000000082167f01ffc9a700000000000000000000000000000000000000000000000000000000145b92915050565b6104a1610afc565b6002805491151574010000000000000000000000000000000000000000027fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff909216919091179055565b6104f3610afc565b6001805467ffffffffffffffff90921674010000000000000000000000000000000000000000027fffffffff0000000000000000ffffffffffffffffffffffffffffffffffffffff909216919091179055565b61054e610afc565b600280547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1690556105806001610b7d565b565b61058a610afc565b6003805482151574010000000000000000000000000000000000000000027fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff9091161790556040517f05a3fef9935c9013a24c6193df2240d34fcf6b0ebf8786b85efe8401d696cdd99061060390831515815260200190565b60405180910390a150565b60015473ffffffffffffffffffffffffffffffffffffffff163314610694576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e65720000000000000000000060448201526064015b60405180910390fd5b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b3373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614610781576040517fd7f7333400000000000000000000000000000000000000000000000000000000815233600482015260240161068b565b61079261078d82611317565b610dc0565b50565b6003547501000000000000000000000000000000000000000000900460ff1615806107dd57506003547501000000000000000000000000000000000000000000900460ff1681105b156107e55750565b600354600190610811907501000000000000000000000000000000000000000000900460ff16836113c4565b11610792577f00000000000000000000000000000000000000000000000000000000000000006001546040517fa8d87a3b0000000000000000000000000000000000000000000000000000000081527401000000000000000000000000000000000000000090910467ffffffffffffffff16600482015273ffffffffffffffffffffffffffffffffffffffff919091169063a8d87a3b90602401602060405180830381865afa1580156108c8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108ec91906113ff565b73ffffffffffffffffffffffffffffffffffffffff1663eff7cc486040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561093357600080fd5b505af1158015610947573d6000803e3d6000fd5b50506040517f302777af5d26fab9dd5120c5f1307c65193ebc51daf33244ada4365fab10602c925060009150a150565b61097f610afc565b600280547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b6109ce610afc565b6001805467ffffffffffffffff90931674010000000000000000000000000000000000000000027fffffffff0000000000000000ffffffffffffffffffffffffffffffffffffffff909316929092179091556002805473ffffffffffffffffffffffffffffffffffffffff9092167fffffffffffffffffffffffff0000000000000000000000000000000000000000909216919091179055565b610a70610afc565b600380547fffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffff16750100000000000000000000000000000000000000000060ff8416908102919091179091556040519081527f4768dbf8645b24c54f2887651545d24f748c0d0d1d4c689eb810fb19f0befcf390602001610603565b610af3610afc565b61079281610e16565b60005473ffffffffffffffffffffffffffffffffffffffff163314610580576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e657200000000000000000000604482015260640161068b565b80600116600103610bc0576040518181527f48257dc961b6f792c2b78a080dacfed693b660960a702de21cee364e20270e2f9060200160405180910390a1610bf4565b6040518181527f58b69f57828e6962d216502094c54f6562f3bf082ba758966c3454f9e37b15259060200160405180910390a15b610bfd81610795565b6040805160a0810190915260025473ffffffffffffffffffffffffffffffffffffffff1660c08201526000908060e08101604051602081830303815290604052815260200183604051602001610c5591815260200190565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815291905281526020016000604051908082528060200260200182016040528015610ccf57816020015b6040805180820190915260008082526020820152815260200190600190039081610ca85790505b50815260035473ffffffffffffffffffffffffffffffffffffffff16602080830191909152604080519182018152600082529091015290507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166396f4e9f9600160149054906101000a900467ffffffffffffffff16836040518363ffffffff1660e01b8152600401610d7892919061141c565b6020604051808303816000875af1158015610d97573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dbb9190611531565b505050565b60008160600151806020019051810190610dda9190611531565b60025490915074010000000000000000000000000000000000000000900460ff16610e1257610e12610e0d82600161154a565b610b7d565b5050565b3373ffffffffffffffffffffffffffffffffffffffff821603610e95576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640161068b565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b600060208284031215610f1d57600080fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114610f4d57600080fd5b9392505050565b600060208284031215610f6657600080fd5b81358015158114610f4d57600080fd5b6000815180845260005b81811015610f9c57602081850181015186830182015201610f80565b5060006020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b602081526000610f4d6020830184610f76565b803567ffffffffffffffff8116811461100557600080fd5b919050565b60006020828403121561101c57600080fd5b610f4d82610fed565b60006020828403121561103757600080fd5b813567ffffffffffffffff81111561104e57600080fd5b820160a08185031215610f4d57600080fd5b60006020828403121561107257600080fd5b5035919050565b73ffffffffffffffffffffffffffffffffffffffff8116811461079257600080fd5b6000602082840312156110ad57600080fd5b8135610f4d81611079565b600080604083850312156110cb57600080fd5b6110d483610fed565b915060208301356110e481611079565b809150509250929050565b60006020828403121561110157600080fd5b813560ff81168114610f4d57600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040805190810167ffffffffffffffff8111828210171561116457611164611112565b60405290565b60405160a0810167ffffffffffffffff8111828210171561116457611164611112565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff811182821017156111d4576111d4611112565b604052919050565b600082601f8301126111ed57600080fd5b813567ffffffffffffffff81111561120757611207611112565b61123860207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8401160161118d565b81815284602083860101111561124d57600080fd5b816020850160208301376000918101602001919091529392505050565b600082601f83011261127b57600080fd5b8135602067ffffffffffffffff82111561129757611297611112565b6112a5818360051b0161118d565b82815260069290921b840181019181810190868411156112c457600080fd5b8286015b8481101561130c57604081890312156112e15760008081fd5b6112e9611141565b81356112f481611079565b815281850135858201528352918301916040016112c8565b509695505050505050565b600060a0823603121561132957600080fd5b61133161116a565b8235815261134160208401610fed565b6020820152604083013567ffffffffffffffff8082111561136157600080fd5b61136d368387016111dc565b6040840152606085013591508082111561138657600080fd5b611392368387016111dc565b606084015260808501359150808211156113ab57600080fd5b506113b83682860161126a565b60808301525092915050565b6000826113fa577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500690565b60006020828403121561141157600080fd5b8151610f4d81611079565b6000604067ffffffffffffffff851683526020604081850152845160a0604086015261144b60e0860182610f76565b9050818601517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0808784030160608801526114868383610f76565b6040890151888203830160808a01528051808352908601945060009350908501905b808410156114e7578451805173ffffffffffffffffffffffffffffffffffffffff168352860151868301529385019360019390930192908601906114a8565b50606089015173ffffffffffffffffffffffffffffffffffffffff1660a08901526080890151888203830160c08a015295506115238187610f76565b9a9950505050505050505050565b60006020828403121561154357600080fd5b5051919050565b80820180821115610493577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fdfea164736f6c6343000818000a", +} + +var SelfFundedPingPongABI = SelfFundedPingPongMetaData.ABI + +var SelfFundedPingPongBin = SelfFundedPingPongMetaData.Bin + +func DeploySelfFundedPingPong(auth *bind.TransactOpts, backend bind.ContractBackend, router common.Address, feeToken common.Address, roundTripsBeforeFunding uint8) (common.Address, *types.Transaction, *SelfFundedPingPong, error) { + parsed, err := SelfFundedPingPongMetaData.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(SelfFundedPingPongBin), backend, router, feeToken, roundTripsBeforeFunding) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &SelfFundedPingPong{address: address, abi: *parsed, SelfFundedPingPongCaller: SelfFundedPingPongCaller{contract: contract}, SelfFundedPingPongTransactor: SelfFundedPingPongTransactor{contract: contract}, SelfFundedPingPongFilterer: SelfFundedPingPongFilterer{contract: contract}}, nil +} + +type SelfFundedPingPong struct { + address common.Address + abi abi.ABI + SelfFundedPingPongCaller + SelfFundedPingPongTransactor + SelfFundedPingPongFilterer +} + +type SelfFundedPingPongCaller struct { + contract *bind.BoundContract +} + +type SelfFundedPingPongTransactor struct { + contract *bind.BoundContract +} + +type SelfFundedPingPongFilterer struct { + contract *bind.BoundContract +} + +type SelfFundedPingPongSession struct { + Contract *SelfFundedPingPong + CallOpts bind.CallOpts + TransactOpts bind.TransactOpts +} + +type SelfFundedPingPongCallerSession struct { + Contract *SelfFundedPingPongCaller + CallOpts bind.CallOpts +} + +type SelfFundedPingPongTransactorSession struct { + Contract *SelfFundedPingPongTransactor + TransactOpts bind.TransactOpts +} + +type SelfFundedPingPongRaw struct { + Contract *SelfFundedPingPong +} + +type SelfFundedPingPongCallerRaw struct { + Contract *SelfFundedPingPongCaller +} + +type SelfFundedPingPongTransactorRaw struct { + Contract *SelfFundedPingPongTransactor +} + +func NewSelfFundedPingPong(address common.Address, backend bind.ContractBackend) (*SelfFundedPingPong, error) { + abi, err := abi.JSON(strings.NewReader(SelfFundedPingPongABI)) + if err != nil { + return nil, err + } + contract, err := bindSelfFundedPingPong(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &SelfFundedPingPong{address: address, abi: abi, SelfFundedPingPongCaller: SelfFundedPingPongCaller{contract: contract}, SelfFundedPingPongTransactor: SelfFundedPingPongTransactor{contract: contract}, SelfFundedPingPongFilterer: SelfFundedPingPongFilterer{contract: contract}}, nil +} + +func NewSelfFundedPingPongCaller(address common.Address, caller bind.ContractCaller) (*SelfFundedPingPongCaller, error) { + contract, err := bindSelfFundedPingPong(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &SelfFundedPingPongCaller{contract: contract}, nil +} + +func NewSelfFundedPingPongTransactor(address common.Address, transactor bind.ContractTransactor) (*SelfFundedPingPongTransactor, error) { + contract, err := bindSelfFundedPingPong(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &SelfFundedPingPongTransactor{contract: contract}, nil +} + +func NewSelfFundedPingPongFilterer(address common.Address, filterer bind.ContractFilterer) (*SelfFundedPingPongFilterer, error) { + contract, err := bindSelfFundedPingPong(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &SelfFundedPingPongFilterer{contract: contract}, nil +} + +func bindSelfFundedPingPong(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := SelfFundedPingPongMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +func (_SelfFundedPingPong *SelfFundedPingPongRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _SelfFundedPingPong.Contract.SelfFundedPingPongCaller.contract.Call(opts, result, method, params...) +} + +func (_SelfFundedPingPong *SelfFundedPingPongRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _SelfFundedPingPong.Contract.SelfFundedPingPongTransactor.contract.Transfer(opts) +} + +func (_SelfFundedPingPong *SelfFundedPingPongRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _SelfFundedPingPong.Contract.SelfFundedPingPongTransactor.contract.Transact(opts, method, params...) +} + +func (_SelfFundedPingPong *SelfFundedPingPongCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _SelfFundedPingPong.Contract.contract.Call(opts, result, method, params...) +} + +func (_SelfFundedPingPong *SelfFundedPingPongTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _SelfFundedPingPong.Contract.contract.Transfer(opts) +} + +func (_SelfFundedPingPong *SelfFundedPingPongTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _SelfFundedPingPong.Contract.contract.Transact(opts, method, params...) +} + +func (_SelfFundedPingPong *SelfFundedPingPongCaller) GetCountIncrBeforeFunding(opts *bind.CallOpts) (uint8, error) { + var out []interface{} + err := _SelfFundedPingPong.contract.Call(opts, &out, "getCountIncrBeforeFunding") + + if err != nil { + return *new(uint8), err + } + + out0 := *abi.ConvertType(out[0], new(uint8)).(*uint8) + + return out0, err + +} + +func (_SelfFundedPingPong *SelfFundedPingPongSession) GetCountIncrBeforeFunding() (uint8, error) { + return _SelfFundedPingPong.Contract.GetCountIncrBeforeFunding(&_SelfFundedPingPong.CallOpts) +} + +func (_SelfFundedPingPong *SelfFundedPingPongCallerSession) GetCountIncrBeforeFunding() (uint8, error) { + return _SelfFundedPingPong.Contract.GetCountIncrBeforeFunding(&_SelfFundedPingPong.CallOpts) +} + +func (_SelfFundedPingPong *SelfFundedPingPongCaller) GetCounterpartAddress(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _SelfFundedPingPong.contract.Call(opts, &out, "getCounterpartAddress") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_SelfFundedPingPong *SelfFundedPingPongSession) GetCounterpartAddress() (common.Address, error) { + return _SelfFundedPingPong.Contract.GetCounterpartAddress(&_SelfFundedPingPong.CallOpts) +} + +func (_SelfFundedPingPong *SelfFundedPingPongCallerSession) GetCounterpartAddress() (common.Address, error) { + return _SelfFundedPingPong.Contract.GetCounterpartAddress(&_SelfFundedPingPong.CallOpts) +} + +func (_SelfFundedPingPong *SelfFundedPingPongCaller) GetCounterpartChainSelector(opts *bind.CallOpts) (uint64, error) { + var out []interface{} + err := _SelfFundedPingPong.contract.Call(opts, &out, "getCounterpartChainSelector") + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +func (_SelfFundedPingPong *SelfFundedPingPongSession) GetCounterpartChainSelector() (uint64, error) { + return _SelfFundedPingPong.Contract.GetCounterpartChainSelector(&_SelfFundedPingPong.CallOpts) +} + +func (_SelfFundedPingPong *SelfFundedPingPongCallerSession) GetCounterpartChainSelector() (uint64, error) { + return _SelfFundedPingPong.Contract.GetCounterpartChainSelector(&_SelfFundedPingPong.CallOpts) +} + +func (_SelfFundedPingPong *SelfFundedPingPongCaller) GetFeeToken(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _SelfFundedPingPong.contract.Call(opts, &out, "getFeeToken") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_SelfFundedPingPong *SelfFundedPingPongSession) GetFeeToken() (common.Address, error) { + return _SelfFundedPingPong.Contract.GetFeeToken(&_SelfFundedPingPong.CallOpts) +} + +func (_SelfFundedPingPong *SelfFundedPingPongCallerSession) GetFeeToken() (common.Address, error) { + return _SelfFundedPingPong.Contract.GetFeeToken(&_SelfFundedPingPong.CallOpts) +} + +func (_SelfFundedPingPong *SelfFundedPingPongCaller) GetOutOfOrderExecution(opts *bind.CallOpts) (bool, error) { + var out []interface{} + err := _SelfFundedPingPong.contract.Call(opts, &out, "getOutOfOrderExecution") + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_SelfFundedPingPong *SelfFundedPingPongSession) GetOutOfOrderExecution() (bool, error) { + return _SelfFundedPingPong.Contract.GetOutOfOrderExecution(&_SelfFundedPingPong.CallOpts) +} + +func (_SelfFundedPingPong *SelfFundedPingPongCallerSession) GetOutOfOrderExecution() (bool, error) { + return _SelfFundedPingPong.Contract.GetOutOfOrderExecution(&_SelfFundedPingPong.CallOpts) +} + +func (_SelfFundedPingPong *SelfFundedPingPongCaller) GetRouter(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _SelfFundedPingPong.contract.Call(opts, &out, "getRouter") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_SelfFundedPingPong *SelfFundedPingPongSession) GetRouter() (common.Address, error) { + return _SelfFundedPingPong.Contract.GetRouter(&_SelfFundedPingPong.CallOpts) +} + +func (_SelfFundedPingPong *SelfFundedPingPongCallerSession) GetRouter() (common.Address, error) { + return _SelfFundedPingPong.Contract.GetRouter(&_SelfFundedPingPong.CallOpts) +} + +func (_SelfFundedPingPong *SelfFundedPingPongCaller) IsPaused(opts *bind.CallOpts) (bool, error) { + var out []interface{} + err := _SelfFundedPingPong.contract.Call(opts, &out, "isPaused") + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_SelfFundedPingPong *SelfFundedPingPongSession) IsPaused() (bool, error) { + return _SelfFundedPingPong.Contract.IsPaused(&_SelfFundedPingPong.CallOpts) +} + +func (_SelfFundedPingPong *SelfFundedPingPongCallerSession) IsPaused() (bool, error) { + return _SelfFundedPingPong.Contract.IsPaused(&_SelfFundedPingPong.CallOpts) +} + +func (_SelfFundedPingPong *SelfFundedPingPongCaller) Owner(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _SelfFundedPingPong.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 + +} + +func (_SelfFundedPingPong *SelfFundedPingPongSession) Owner() (common.Address, error) { + return _SelfFundedPingPong.Contract.Owner(&_SelfFundedPingPong.CallOpts) +} + +func (_SelfFundedPingPong *SelfFundedPingPongCallerSession) Owner() (common.Address, error) { + return _SelfFundedPingPong.Contract.Owner(&_SelfFundedPingPong.CallOpts) +} + +func (_SelfFundedPingPong *SelfFundedPingPongCaller) SupportsInterface(opts *bind.CallOpts, interfaceId [4]byte) (bool, error) { + var out []interface{} + err := _SelfFundedPingPong.contract.Call(opts, &out, "supportsInterface", interfaceId) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_SelfFundedPingPong *SelfFundedPingPongSession) SupportsInterface(interfaceId [4]byte) (bool, error) { + return _SelfFundedPingPong.Contract.SupportsInterface(&_SelfFundedPingPong.CallOpts, interfaceId) +} + +func (_SelfFundedPingPong *SelfFundedPingPongCallerSession) SupportsInterface(interfaceId [4]byte) (bool, error) { + return _SelfFundedPingPong.Contract.SupportsInterface(&_SelfFundedPingPong.CallOpts, interfaceId) +} + +func (_SelfFundedPingPong *SelfFundedPingPongCaller) TypeAndVersion(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _SelfFundedPingPong.contract.Call(opts, &out, "typeAndVersion") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +func (_SelfFundedPingPong *SelfFundedPingPongSession) TypeAndVersion() (string, error) { + return _SelfFundedPingPong.Contract.TypeAndVersion(&_SelfFundedPingPong.CallOpts) +} + +func (_SelfFundedPingPong *SelfFundedPingPongCallerSession) TypeAndVersion() (string, error) { + return _SelfFundedPingPong.Contract.TypeAndVersion(&_SelfFundedPingPong.CallOpts) +} + +func (_SelfFundedPingPong *SelfFundedPingPongTransactor) AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + return _SelfFundedPingPong.contract.Transact(opts, "acceptOwnership") +} + +func (_SelfFundedPingPong *SelfFundedPingPongSession) AcceptOwnership() (*types.Transaction, error) { + return _SelfFundedPingPong.Contract.AcceptOwnership(&_SelfFundedPingPong.TransactOpts) +} + +func (_SelfFundedPingPong *SelfFundedPingPongTransactorSession) AcceptOwnership() (*types.Transaction, error) { + return _SelfFundedPingPong.Contract.AcceptOwnership(&_SelfFundedPingPong.TransactOpts) +} + +func (_SelfFundedPingPong *SelfFundedPingPongTransactor) CcipReceive(opts *bind.TransactOpts, message ClientAny2EVMMessage) (*types.Transaction, error) { + return _SelfFundedPingPong.contract.Transact(opts, "ccipReceive", message) +} + +func (_SelfFundedPingPong *SelfFundedPingPongSession) CcipReceive(message ClientAny2EVMMessage) (*types.Transaction, error) { + return _SelfFundedPingPong.Contract.CcipReceive(&_SelfFundedPingPong.TransactOpts, message) +} + +func (_SelfFundedPingPong *SelfFundedPingPongTransactorSession) CcipReceive(message ClientAny2EVMMessage) (*types.Transaction, error) { + return _SelfFundedPingPong.Contract.CcipReceive(&_SelfFundedPingPong.TransactOpts, message) +} + +func (_SelfFundedPingPong *SelfFundedPingPongTransactor) FundPingPong(opts *bind.TransactOpts, pingPongCount *big.Int) (*types.Transaction, error) { + return _SelfFundedPingPong.contract.Transact(opts, "fundPingPong", pingPongCount) +} + +func (_SelfFundedPingPong *SelfFundedPingPongSession) FundPingPong(pingPongCount *big.Int) (*types.Transaction, error) { + return _SelfFundedPingPong.Contract.FundPingPong(&_SelfFundedPingPong.TransactOpts, pingPongCount) +} + +func (_SelfFundedPingPong *SelfFundedPingPongTransactorSession) FundPingPong(pingPongCount *big.Int) (*types.Transaction, error) { + return _SelfFundedPingPong.Contract.FundPingPong(&_SelfFundedPingPong.TransactOpts, pingPongCount) +} + +func (_SelfFundedPingPong *SelfFundedPingPongTransactor) SetCountIncrBeforeFunding(opts *bind.TransactOpts, countIncrBeforeFunding uint8) (*types.Transaction, error) { + return _SelfFundedPingPong.contract.Transact(opts, "setCountIncrBeforeFunding", countIncrBeforeFunding) +} + +func (_SelfFundedPingPong *SelfFundedPingPongSession) SetCountIncrBeforeFunding(countIncrBeforeFunding uint8) (*types.Transaction, error) { + return _SelfFundedPingPong.Contract.SetCountIncrBeforeFunding(&_SelfFundedPingPong.TransactOpts, countIncrBeforeFunding) +} + +func (_SelfFundedPingPong *SelfFundedPingPongTransactorSession) SetCountIncrBeforeFunding(countIncrBeforeFunding uint8) (*types.Transaction, error) { + return _SelfFundedPingPong.Contract.SetCountIncrBeforeFunding(&_SelfFundedPingPong.TransactOpts, countIncrBeforeFunding) +} + +func (_SelfFundedPingPong *SelfFundedPingPongTransactor) SetCounterpart(opts *bind.TransactOpts, counterpartChainSelector uint64, counterpartAddress common.Address) (*types.Transaction, error) { + return _SelfFundedPingPong.contract.Transact(opts, "setCounterpart", counterpartChainSelector, counterpartAddress) +} + +func (_SelfFundedPingPong *SelfFundedPingPongSession) SetCounterpart(counterpartChainSelector uint64, counterpartAddress common.Address) (*types.Transaction, error) { + return _SelfFundedPingPong.Contract.SetCounterpart(&_SelfFundedPingPong.TransactOpts, counterpartChainSelector, counterpartAddress) +} + +func (_SelfFundedPingPong *SelfFundedPingPongTransactorSession) SetCounterpart(counterpartChainSelector uint64, counterpartAddress common.Address) (*types.Transaction, error) { + return _SelfFundedPingPong.Contract.SetCounterpart(&_SelfFundedPingPong.TransactOpts, counterpartChainSelector, counterpartAddress) +} + +func (_SelfFundedPingPong *SelfFundedPingPongTransactor) SetCounterpartAddress(opts *bind.TransactOpts, addr common.Address) (*types.Transaction, error) { + return _SelfFundedPingPong.contract.Transact(opts, "setCounterpartAddress", addr) +} + +func (_SelfFundedPingPong *SelfFundedPingPongSession) SetCounterpartAddress(addr common.Address) (*types.Transaction, error) { + return _SelfFundedPingPong.Contract.SetCounterpartAddress(&_SelfFundedPingPong.TransactOpts, addr) +} + +func (_SelfFundedPingPong *SelfFundedPingPongTransactorSession) SetCounterpartAddress(addr common.Address) (*types.Transaction, error) { + return _SelfFundedPingPong.Contract.SetCounterpartAddress(&_SelfFundedPingPong.TransactOpts, addr) +} + +func (_SelfFundedPingPong *SelfFundedPingPongTransactor) SetCounterpartChainSelector(opts *bind.TransactOpts, chainSelector uint64) (*types.Transaction, error) { + return _SelfFundedPingPong.contract.Transact(opts, "setCounterpartChainSelector", chainSelector) +} + +func (_SelfFundedPingPong *SelfFundedPingPongSession) SetCounterpartChainSelector(chainSelector uint64) (*types.Transaction, error) { + return _SelfFundedPingPong.Contract.SetCounterpartChainSelector(&_SelfFundedPingPong.TransactOpts, chainSelector) +} + +func (_SelfFundedPingPong *SelfFundedPingPongTransactorSession) SetCounterpartChainSelector(chainSelector uint64) (*types.Transaction, error) { + return _SelfFundedPingPong.Contract.SetCounterpartChainSelector(&_SelfFundedPingPong.TransactOpts, chainSelector) +} + +func (_SelfFundedPingPong *SelfFundedPingPongTransactor) SetOutOfOrderExecution(opts *bind.TransactOpts, outOfOrderExecution bool) (*types.Transaction, error) { + return _SelfFundedPingPong.contract.Transact(opts, "setOutOfOrderExecution", outOfOrderExecution) +} + +func (_SelfFundedPingPong *SelfFundedPingPongSession) SetOutOfOrderExecution(outOfOrderExecution bool) (*types.Transaction, error) { + return _SelfFundedPingPong.Contract.SetOutOfOrderExecution(&_SelfFundedPingPong.TransactOpts, outOfOrderExecution) +} + +func (_SelfFundedPingPong *SelfFundedPingPongTransactorSession) SetOutOfOrderExecution(outOfOrderExecution bool) (*types.Transaction, error) { + return _SelfFundedPingPong.Contract.SetOutOfOrderExecution(&_SelfFundedPingPong.TransactOpts, outOfOrderExecution) +} + +func (_SelfFundedPingPong *SelfFundedPingPongTransactor) SetPaused(opts *bind.TransactOpts, pause bool) (*types.Transaction, error) { + return _SelfFundedPingPong.contract.Transact(opts, "setPaused", pause) +} + +func (_SelfFundedPingPong *SelfFundedPingPongSession) SetPaused(pause bool) (*types.Transaction, error) { + return _SelfFundedPingPong.Contract.SetPaused(&_SelfFundedPingPong.TransactOpts, pause) +} + +func (_SelfFundedPingPong *SelfFundedPingPongTransactorSession) SetPaused(pause bool) (*types.Transaction, error) { + return _SelfFundedPingPong.Contract.SetPaused(&_SelfFundedPingPong.TransactOpts, pause) +} + +func (_SelfFundedPingPong *SelfFundedPingPongTransactor) StartPingPong(opts *bind.TransactOpts) (*types.Transaction, error) { + return _SelfFundedPingPong.contract.Transact(opts, "startPingPong") +} + +func (_SelfFundedPingPong *SelfFundedPingPongSession) StartPingPong() (*types.Transaction, error) { + return _SelfFundedPingPong.Contract.StartPingPong(&_SelfFundedPingPong.TransactOpts) +} + +func (_SelfFundedPingPong *SelfFundedPingPongTransactorSession) StartPingPong() (*types.Transaction, error) { + return _SelfFundedPingPong.Contract.StartPingPong(&_SelfFundedPingPong.TransactOpts) +} + +func (_SelfFundedPingPong *SelfFundedPingPongTransactor) TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) { + return _SelfFundedPingPong.contract.Transact(opts, "transferOwnership", to) +} + +func (_SelfFundedPingPong *SelfFundedPingPongSession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _SelfFundedPingPong.Contract.TransferOwnership(&_SelfFundedPingPong.TransactOpts, to) +} + +func (_SelfFundedPingPong *SelfFundedPingPongTransactorSession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _SelfFundedPingPong.Contract.TransferOwnership(&_SelfFundedPingPong.TransactOpts, to) +} + +type SelfFundedPingPongCountIncrBeforeFundingSetIterator struct { + Event *SelfFundedPingPongCountIncrBeforeFundingSet + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *SelfFundedPingPongCountIncrBeforeFundingSetIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(SelfFundedPingPongCountIncrBeforeFundingSet) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(SelfFundedPingPongCountIncrBeforeFundingSet) + 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() + } +} + +func (it *SelfFundedPingPongCountIncrBeforeFundingSetIterator) Error() error { + return it.fail +} + +func (it *SelfFundedPingPongCountIncrBeforeFundingSetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type SelfFundedPingPongCountIncrBeforeFundingSet struct { + CountIncrBeforeFunding uint8 + Raw types.Log +} + +func (_SelfFundedPingPong *SelfFundedPingPongFilterer) FilterCountIncrBeforeFundingSet(opts *bind.FilterOpts) (*SelfFundedPingPongCountIncrBeforeFundingSetIterator, error) { + + logs, sub, err := _SelfFundedPingPong.contract.FilterLogs(opts, "CountIncrBeforeFundingSet") + if err != nil { + return nil, err + } + return &SelfFundedPingPongCountIncrBeforeFundingSetIterator{contract: _SelfFundedPingPong.contract, event: "CountIncrBeforeFundingSet", logs: logs, sub: sub}, nil +} + +func (_SelfFundedPingPong *SelfFundedPingPongFilterer) WatchCountIncrBeforeFundingSet(opts *bind.WatchOpts, sink chan<- *SelfFundedPingPongCountIncrBeforeFundingSet) (event.Subscription, error) { + + logs, sub, err := _SelfFundedPingPong.contract.WatchLogs(opts, "CountIncrBeforeFundingSet") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(SelfFundedPingPongCountIncrBeforeFundingSet) + if err := _SelfFundedPingPong.contract.UnpackLog(event, "CountIncrBeforeFundingSet", 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 +} + +func (_SelfFundedPingPong *SelfFundedPingPongFilterer) ParseCountIncrBeforeFundingSet(log types.Log) (*SelfFundedPingPongCountIncrBeforeFundingSet, error) { + event := new(SelfFundedPingPongCountIncrBeforeFundingSet) + if err := _SelfFundedPingPong.contract.UnpackLog(event, "CountIncrBeforeFundingSet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type SelfFundedPingPongFundedIterator struct { + Event *SelfFundedPingPongFunded + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *SelfFundedPingPongFundedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(SelfFundedPingPongFunded) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(SelfFundedPingPongFunded) + 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() + } +} + +func (it *SelfFundedPingPongFundedIterator) Error() error { + return it.fail +} + +func (it *SelfFundedPingPongFundedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type SelfFundedPingPongFunded struct { + Raw types.Log +} + +func (_SelfFundedPingPong *SelfFundedPingPongFilterer) FilterFunded(opts *bind.FilterOpts) (*SelfFundedPingPongFundedIterator, error) { + + logs, sub, err := _SelfFundedPingPong.contract.FilterLogs(opts, "Funded") + if err != nil { + return nil, err + } + return &SelfFundedPingPongFundedIterator{contract: _SelfFundedPingPong.contract, event: "Funded", logs: logs, sub: sub}, nil +} + +func (_SelfFundedPingPong *SelfFundedPingPongFilterer) WatchFunded(opts *bind.WatchOpts, sink chan<- *SelfFundedPingPongFunded) (event.Subscription, error) { + + logs, sub, err := _SelfFundedPingPong.contract.WatchLogs(opts, "Funded") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(SelfFundedPingPongFunded) + if err := _SelfFundedPingPong.contract.UnpackLog(event, "Funded", 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 +} + +func (_SelfFundedPingPong *SelfFundedPingPongFilterer) ParseFunded(log types.Log) (*SelfFundedPingPongFunded, error) { + event := new(SelfFundedPingPongFunded) + if err := _SelfFundedPingPong.contract.UnpackLog(event, "Funded", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type SelfFundedPingPongOutOfOrderExecutionChangeIterator struct { + Event *SelfFundedPingPongOutOfOrderExecutionChange + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *SelfFundedPingPongOutOfOrderExecutionChangeIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(SelfFundedPingPongOutOfOrderExecutionChange) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(SelfFundedPingPongOutOfOrderExecutionChange) + 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() + } +} + +func (it *SelfFundedPingPongOutOfOrderExecutionChangeIterator) Error() error { + return it.fail +} + +func (it *SelfFundedPingPongOutOfOrderExecutionChangeIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type SelfFundedPingPongOutOfOrderExecutionChange struct { + IsOutOfOrder bool + Raw types.Log +} + +func (_SelfFundedPingPong *SelfFundedPingPongFilterer) FilterOutOfOrderExecutionChange(opts *bind.FilterOpts) (*SelfFundedPingPongOutOfOrderExecutionChangeIterator, error) { + + logs, sub, err := _SelfFundedPingPong.contract.FilterLogs(opts, "OutOfOrderExecutionChange") + if err != nil { + return nil, err + } + return &SelfFundedPingPongOutOfOrderExecutionChangeIterator{contract: _SelfFundedPingPong.contract, event: "OutOfOrderExecutionChange", logs: logs, sub: sub}, nil +} + +func (_SelfFundedPingPong *SelfFundedPingPongFilterer) WatchOutOfOrderExecutionChange(opts *bind.WatchOpts, sink chan<- *SelfFundedPingPongOutOfOrderExecutionChange) (event.Subscription, error) { + + logs, sub, err := _SelfFundedPingPong.contract.WatchLogs(opts, "OutOfOrderExecutionChange") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(SelfFundedPingPongOutOfOrderExecutionChange) + if err := _SelfFundedPingPong.contract.UnpackLog(event, "OutOfOrderExecutionChange", 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 +} + +func (_SelfFundedPingPong *SelfFundedPingPongFilterer) ParseOutOfOrderExecutionChange(log types.Log) (*SelfFundedPingPongOutOfOrderExecutionChange, error) { + event := new(SelfFundedPingPongOutOfOrderExecutionChange) + if err := _SelfFundedPingPong.contract.UnpackLog(event, "OutOfOrderExecutionChange", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type SelfFundedPingPongOwnershipTransferRequestedIterator struct { + Event *SelfFundedPingPongOwnershipTransferRequested + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *SelfFundedPingPongOwnershipTransferRequestedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(SelfFundedPingPongOwnershipTransferRequested) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(SelfFundedPingPongOwnershipTransferRequested) + 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() + } +} + +func (it *SelfFundedPingPongOwnershipTransferRequestedIterator) Error() error { + return it.fail +} + +func (it *SelfFundedPingPongOwnershipTransferRequestedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type SelfFundedPingPongOwnershipTransferRequested struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_SelfFundedPingPong *SelfFundedPingPongFilterer) FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*SelfFundedPingPongOwnershipTransferRequestedIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _SelfFundedPingPong.contract.FilterLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return &SelfFundedPingPongOwnershipTransferRequestedIterator{contract: _SelfFundedPingPong.contract, event: "OwnershipTransferRequested", logs: logs, sub: sub}, nil +} + +func (_SelfFundedPingPong *SelfFundedPingPongFilterer) WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *SelfFundedPingPongOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _SelfFundedPingPong.contract.WatchLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(SelfFundedPingPongOwnershipTransferRequested) + if err := _SelfFundedPingPong.contract.UnpackLog(event, "OwnershipTransferRequested", 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 +} + +func (_SelfFundedPingPong *SelfFundedPingPongFilterer) ParseOwnershipTransferRequested(log types.Log) (*SelfFundedPingPongOwnershipTransferRequested, error) { + event := new(SelfFundedPingPongOwnershipTransferRequested) + if err := _SelfFundedPingPong.contract.UnpackLog(event, "OwnershipTransferRequested", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type SelfFundedPingPongOwnershipTransferredIterator struct { + Event *SelfFundedPingPongOwnershipTransferred + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *SelfFundedPingPongOwnershipTransferredIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(SelfFundedPingPongOwnershipTransferred) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(SelfFundedPingPongOwnershipTransferred) + 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() + } +} + +func (it *SelfFundedPingPongOwnershipTransferredIterator) Error() error { + return it.fail +} + +func (it *SelfFundedPingPongOwnershipTransferredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type SelfFundedPingPongOwnershipTransferred struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_SelfFundedPingPong *SelfFundedPingPongFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*SelfFundedPingPongOwnershipTransferredIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _SelfFundedPingPong.contract.FilterLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return &SelfFundedPingPongOwnershipTransferredIterator{contract: _SelfFundedPingPong.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil +} + +func (_SelfFundedPingPong *SelfFundedPingPongFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *SelfFundedPingPongOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _SelfFundedPingPong.contract.WatchLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(SelfFundedPingPongOwnershipTransferred) + if err := _SelfFundedPingPong.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 +} + +func (_SelfFundedPingPong *SelfFundedPingPongFilterer) ParseOwnershipTransferred(log types.Log) (*SelfFundedPingPongOwnershipTransferred, error) { + event := new(SelfFundedPingPongOwnershipTransferred) + if err := _SelfFundedPingPong.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type SelfFundedPingPongPingIterator struct { + Event *SelfFundedPingPongPing + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *SelfFundedPingPongPingIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(SelfFundedPingPongPing) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(SelfFundedPingPongPing) + 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() + } +} + +func (it *SelfFundedPingPongPingIterator) Error() error { + return it.fail +} + +func (it *SelfFundedPingPongPingIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type SelfFundedPingPongPing struct { + PingPongCount *big.Int + Raw types.Log +} + +func (_SelfFundedPingPong *SelfFundedPingPongFilterer) FilterPing(opts *bind.FilterOpts) (*SelfFundedPingPongPingIterator, error) { + + logs, sub, err := _SelfFundedPingPong.contract.FilterLogs(opts, "Ping") + if err != nil { + return nil, err + } + return &SelfFundedPingPongPingIterator{contract: _SelfFundedPingPong.contract, event: "Ping", logs: logs, sub: sub}, nil +} + +func (_SelfFundedPingPong *SelfFundedPingPongFilterer) WatchPing(opts *bind.WatchOpts, sink chan<- *SelfFundedPingPongPing) (event.Subscription, error) { + + logs, sub, err := _SelfFundedPingPong.contract.WatchLogs(opts, "Ping") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(SelfFundedPingPongPing) + if err := _SelfFundedPingPong.contract.UnpackLog(event, "Ping", 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 +} + +func (_SelfFundedPingPong *SelfFundedPingPongFilterer) ParsePing(log types.Log) (*SelfFundedPingPongPing, error) { + event := new(SelfFundedPingPongPing) + if err := _SelfFundedPingPong.contract.UnpackLog(event, "Ping", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type SelfFundedPingPongPongIterator struct { + Event *SelfFundedPingPongPong + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *SelfFundedPingPongPongIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(SelfFundedPingPongPong) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(SelfFundedPingPongPong) + 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() + } +} + +func (it *SelfFundedPingPongPongIterator) Error() error { + return it.fail +} + +func (it *SelfFundedPingPongPongIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type SelfFundedPingPongPong struct { + PingPongCount *big.Int + Raw types.Log +} + +func (_SelfFundedPingPong *SelfFundedPingPongFilterer) FilterPong(opts *bind.FilterOpts) (*SelfFundedPingPongPongIterator, error) { + + logs, sub, err := _SelfFundedPingPong.contract.FilterLogs(opts, "Pong") + if err != nil { + return nil, err + } + return &SelfFundedPingPongPongIterator{contract: _SelfFundedPingPong.contract, event: "Pong", logs: logs, sub: sub}, nil +} + +func (_SelfFundedPingPong *SelfFundedPingPongFilterer) WatchPong(opts *bind.WatchOpts, sink chan<- *SelfFundedPingPongPong) (event.Subscription, error) { + + logs, sub, err := _SelfFundedPingPong.contract.WatchLogs(opts, "Pong") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(SelfFundedPingPongPong) + if err := _SelfFundedPingPong.contract.UnpackLog(event, "Pong", 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 +} + +func (_SelfFundedPingPong *SelfFundedPingPongFilterer) ParsePong(log types.Log) (*SelfFundedPingPongPong, error) { + event := new(SelfFundedPingPongPong) + if err := _SelfFundedPingPong.contract.UnpackLog(event, "Pong", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +func (_SelfFundedPingPong *SelfFundedPingPong) ParseLog(log types.Log) (generated.AbigenLog, error) { + switch log.Topics[0] { + case _SelfFundedPingPong.abi.Events["CountIncrBeforeFundingSet"].ID: + return _SelfFundedPingPong.ParseCountIncrBeforeFundingSet(log) + case _SelfFundedPingPong.abi.Events["Funded"].ID: + return _SelfFundedPingPong.ParseFunded(log) + case _SelfFundedPingPong.abi.Events["OutOfOrderExecutionChange"].ID: + return _SelfFundedPingPong.ParseOutOfOrderExecutionChange(log) + case _SelfFundedPingPong.abi.Events["OwnershipTransferRequested"].ID: + return _SelfFundedPingPong.ParseOwnershipTransferRequested(log) + case _SelfFundedPingPong.abi.Events["OwnershipTransferred"].ID: + return _SelfFundedPingPong.ParseOwnershipTransferred(log) + case _SelfFundedPingPong.abi.Events["Ping"].ID: + return _SelfFundedPingPong.ParsePing(log) + case _SelfFundedPingPong.abi.Events["Pong"].ID: + return _SelfFundedPingPong.ParsePong(log) + + default: + return nil, fmt.Errorf("abigen wrapper received unknown log topic: %v", log.Topics[0]) + } +} + +func (SelfFundedPingPongCountIncrBeforeFundingSet) Topic() common.Hash { + return common.HexToHash("0x4768dbf8645b24c54f2887651545d24f748c0d0d1d4c689eb810fb19f0befcf3") +} + +func (SelfFundedPingPongFunded) Topic() common.Hash { + return common.HexToHash("0x302777af5d26fab9dd5120c5f1307c65193ebc51daf33244ada4365fab10602c") +} + +func (SelfFundedPingPongOutOfOrderExecutionChange) Topic() common.Hash { + return common.HexToHash("0x05a3fef9935c9013a24c6193df2240d34fcf6b0ebf8786b85efe8401d696cdd9") +} + +func (SelfFundedPingPongOwnershipTransferRequested) Topic() common.Hash { + return common.HexToHash("0xed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae1278") +} + +func (SelfFundedPingPongOwnershipTransferred) Topic() common.Hash { + return common.HexToHash("0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0") +} + +func (SelfFundedPingPongPing) Topic() common.Hash { + return common.HexToHash("0x48257dc961b6f792c2b78a080dacfed693b660960a702de21cee364e20270e2f") +} + +func (SelfFundedPingPongPong) Topic() common.Hash { + return common.HexToHash("0x58b69f57828e6962d216502094c54f6562f3bf082ba758966c3454f9e37b1525") +} + +func (_SelfFundedPingPong *SelfFundedPingPong) Address() common.Address { + return _SelfFundedPingPong.address +} + +type SelfFundedPingPongInterface interface { + GetCountIncrBeforeFunding(opts *bind.CallOpts) (uint8, error) + + GetCounterpartAddress(opts *bind.CallOpts) (common.Address, error) + + GetCounterpartChainSelector(opts *bind.CallOpts) (uint64, error) + + GetFeeToken(opts *bind.CallOpts) (common.Address, error) + + GetOutOfOrderExecution(opts *bind.CallOpts) (bool, error) + + GetRouter(opts *bind.CallOpts) (common.Address, error) + + IsPaused(opts *bind.CallOpts) (bool, error) + + Owner(opts *bind.CallOpts) (common.Address, error) + + SupportsInterface(opts *bind.CallOpts, interfaceId [4]byte) (bool, error) + + TypeAndVersion(opts *bind.CallOpts) (string, error) + + AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) + + CcipReceive(opts *bind.TransactOpts, message ClientAny2EVMMessage) (*types.Transaction, error) + + FundPingPong(opts *bind.TransactOpts, pingPongCount *big.Int) (*types.Transaction, error) + + SetCountIncrBeforeFunding(opts *bind.TransactOpts, countIncrBeforeFunding uint8) (*types.Transaction, error) + + SetCounterpart(opts *bind.TransactOpts, counterpartChainSelector uint64, counterpartAddress common.Address) (*types.Transaction, error) + + SetCounterpartAddress(opts *bind.TransactOpts, addr common.Address) (*types.Transaction, error) + + SetCounterpartChainSelector(opts *bind.TransactOpts, chainSelector uint64) (*types.Transaction, error) + + SetOutOfOrderExecution(opts *bind.TransactOpts, outOfOrderExecution bool) (*types.Transaction, error) + + SetPaused(opts *bind.TransactOpts, pause bool) (*types.Transaction, error) + + StartPingPong(opts *bind.TransactOpts) (*types.Transaction, error) + + TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) + + FilterCountIncrBeforeFundingSet(opts *bind.FilterOpts) (*SelfFundedPingPongCountIncrBeforeFundingSetIterator, error) + + WatchCountIncrBeforeFundingSet(opts *bind.WatchOpts, sink chan<- *SelfFundedPingPongCountIncrBeforeFundingSet) (event.Subscription, error) + + ParseCountIncrBeforeFundingSet(log types.Log) (*SelfFundedPingPongCountIncrBeforeFundingSet, error) + + FilterFunded(opts *bind.FilterOpts) (*SelfFundedPingPongFundedIterator, error) + + WatchFunded(opts *bind.WatchOpts, sink chan<- *SelfFundedPingPongFunded) (event.Subscription, error) + + ParseFunded(log types.Log) (*SelfFundedPingPongFunded, error) + + FilterOutOfOrderExecutionChange(opts *bind.FilterOpts) (*SelfFundedPingPongOutOfOrderExecutionChangeIterator, error) + + WatchOutOfOrderExecutionChange(opts *bind.WatchOpts, sink chan<- *SelfFundedPingPongOutOfOrderExecutionChange) (event.Subscription, error) + + ParseOutOfOrderExecutionChange(log types.Log) (*SelfFundedPingPongOutOfOrderExecutionChange, error) + + FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*SelfFundedPingPongOwnershipTransferRequestedIterator, error) + + WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *SelfFundedPingPongOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferRequested(log types.Log) (*SelfFundedPingPongOwnershipTransferRequested, error) + + FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*SelfFundedPingPongOwnershipTransferredIterator, error) + + WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *SelfFundedPingPongOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferred(log types.Log) (*SelfFundedPingPongOwnershipTransferred, error) + + FilterPing(opts *bind.FilterOpts) (*SelfFundedPingPongPingIterator, error) + + WatchPing(opts *bind.WatchOpts, sink chan<- *SelfFundedPingPongPing) (event.Subscription, error) + + ParsePing(log types.Log) (*SelfFundedPingPongPing, error) + + FilterPong(opts *bind.FilterOpts) (*SelfFundedPingPongPongIterator, error) + + WatchPong(opts *bind.WatchOpts, sink chan<- *SelfFundedPingPongPong) (event.Subscription, error) + + ParsePong(log types.Log) (*SelfFundedPingPongPong, error) + + ParseLog(log types.Log) (generated.AbigenLog, error) + + Address() common.Address +} diff --git a/core/gethwrappers/ccip/generated/token_admin_registry/token_admin_registry.go b/core/gethwrappers/ccip/generated/token_admin_registry/token_admin_registry.go new file mode 100644 index 00000000000..7e81051aa34 --- /dev/null +++ b/core/gethwrappers/ccip/generated/token_admin_registry/token_admin_registry.go @@ -0,0 +1,1526 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package token_admin_registry + +import ( + "errors" + "fmt" + "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" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" +) + +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +type TokenAdminRegistryTokenConfig struct { + Administrator common.Address + PendingAdministrator common.Address + TokenPool common.Address +} + +var TokenAdminRegistryMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"AlreadyRegistered\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"InvalidTokenPoolToken\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"OnlyAdministrator\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"OnlyPendingAdministrator\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"OnlyRegistryModuleOrOwner\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddress\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"currentAdmin\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdministratorTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdministratorTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousPool\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newPool\",\"type\":\"address\"}],\"name\":\"PoolSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"module\",\"type\":\"address\"}],\"name\":\"RegistryModuleAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"module\",\"type\":\"address\"}],\"name\":\"RegistryModuleRemoved\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"localToken\",\"type\":\"address\"}],\"name\":\"acceptAdminRole\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"module\",\"type\":\"address\"}],\"name\":\"addRegistryModule\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"startIndex\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"maxCount\",\"type\":\"uint64\"}],\"name\":\"getAllConfiguredTokens\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"tokens\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"getPool\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"tokens\",\"type\":\"address[]\"}],\"name\":\"getPools\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"getTokenConfig\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"administrator\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"pendingAdministrator\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenPool\",\"type\":\"address\"}],\"internalType\":\"structTokenAdminRegistry.TokenConfig\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"localToken\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"administrator\",\"type\":\"address\"}],\"name\":\"isAdministrator\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"module\",\"type\":\"address\"}],\"name\":\"isRegistryModule\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"localToken\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"administrator\",\"type\":\"address\"}],\"name\":\"proposeAdministrator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"module\",\"type\":\"address\"}],\"name\":\"removeRegistryModule\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"localToken\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"name\":\"setPool\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"localToken\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"transferAdminRole\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", + Bin: "0x608060405234801561001057600080fd5b5033806000816100675760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615610097576100978161009f565b505050610148565b336001600160a01b038216036100f75760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640161005e565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b611449806101576000396000f3fe608060405234801561001057600080fd5b50600436106101005760003560e01c80637d3f255211610097578063cb67e3b111610066578063cb67e3b1146102bc578063ddadfa8e14610374578063e677ae3714610387578063f2fde38b1461039a57600080fd5b80637d3f2552146101e05780638da5cb5b14610203578063bbe4f6db14610242578063c1af6e031461027f57600080fd5b80634e847fc7116100d35780634e847fc7146101925780635e63547a146101a557806372d64a81146101c557806379ba5097146101d857600080fd5b806310cbcf1814610105578063156194da1461011a578063181f5a771461012d5780633dc457721461017f575b600080fd5b61011861011336600461116c565b6103ad565b005b61011861012836600461116c565b61040a565b6101696040518060400160405280601881526020017f546f6b656e41646d696e526567697374727920312e352e30000000000000000081525081565b6040516101769190611187565b60405180910390f35b61011861018d36600461116c565b61050f565b6101186101a03660046111f4565b610573565b6101b86101b3366004611227565b6107d3565b604051610176919061129c565b6101b86101d336600461130e565b6108cc565b6101186109e2565b6101f36101ee36600461116c565b610adf565b6040519015158152602001610176565b60005473ffffffffffffffffffffffffffffffffffffffff165b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610176565b61021d61025036600461116c565b73ffffffffffffffffffffffffffffffffffffffff908116600090815260026020819052604090912001541690565b6101f361028d3660046111f4565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260026020526040902054821691161490565b6103356102ca36600461116c565b60408051606080820183526000808352602080840182905292840181905273ffffffffffffffffffffffffffffffffffffffff948516815260028084529084902084519283018552805486168352600181015486169383019390935291909101549092169082015290565b60408051825173ffffffffffffffffffffffffffffffffffffffff90811682526020808501518216908301529282015190921690820152606001610176565b6101186103823660046111f4565b610aec565b6101186103953660046111f4565b610bf6565b6101186103a836600461116c565b610dbe565b6103b5610dcf565b6103c0600582610e52565b156104075760405173ffffffffffffffffffffffffffffffffffffffff8216907f93eaa26dcb9275e56bacb1d33fdbf402262da6f0f4baf2a6e2cd154b73f387f890600090a25b50565b73ffffffffffffffffffffffffffffffffffffffff808216600090815260026020526040902060018101549091163314610493576040517f3edffe7500000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff831660248201526044015b60405180910390fd5b8054337fffffffffffffffffffffffff00000000000000000000000000000000000000009182168117835560018301805490921690915560405173ffffffffffffffffffffffffffffffffffffffff8416907f399b55200f7f639a63d76efe3dcfa9156ce367058d6b673041b84a628885f5a790600090a35050565b610517610dcf565b610522600582610e7b565b156104075760405173ffffffffffffffffffffffffffffffffffffffff821681527f3cabf004338366bfeaeb610ad827cb58d16b588017c509501f2c97c83caae7b29060200160405180910390a150565b73ffffffffffffffffffffffffffffffffffffffff80831660009081526002602052604090205483911633146105f3576040517fed5d85b500000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff8216602482015260440161048a565b73ffffffffffffffffffffffffffffffffffffffff8216158015906106a557506040517f240028e800000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff848116600483015283169063240028e890602401602060405180830381865afa15801561067f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106a39190611338565b155b156106f4576040517f962b60e600000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8416600482015260240161048a565b73ffffffffffffffffffffffffffffffffffffffff808416600090815260026020819052604090912090810180548584167fffffffffffffffffffffffff0000000000000000000000000000000000000000821681179092559192919091169081146107cc578373ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167f754449ec3aff3bd528bfce43ae9319c4a381b67fcd1d20097b3b24dacaecc35d60405160405180910390a45b5050505050565b606060008267ffffffffffffffff8111156107f0576107f061135a565b604051908082528060200260200182016040528015610819578160200160208202803683370190505b50905060005b838110156108c2576002600086868481811061083d5761083d611389565b9050602002016020810190610852919061116c565b73ffffffffffffffffffffffffffffffffffffffff9081168252602082019290925260400160002060020154835191169083908390811061089557610895611389565b73ffffffffffffffffffffffffffffffffffffffff9092166020928302919091019091015260010161081f565b5090505b92915050565b606060006108da6003610e9d565b9050808467ffffffffffffffff16106108f357506108c6565b67ffffffffffffffff80841690829061090e908716836113e7565b111561092b5761092867ffffffffffffffff8616836113fa565b90505b8067ffffffffffffffff8111156109445761094461135a565b60405190808252806020026020018201604052801561096d578160200160208202803683370190505b50925060005b818110156109d95761099a6109928267ffffffffffffffff89166113e7565b600390610ea7565b8482815181106109ac576109ac611389565b73ffffffffffffffffffffffffffffffffffffffff90921660209283029190910190910152600101610973565b50505092915050565b60015473ffffffffffffffffffffffffffffffffffffffff163314610a63576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e657200000000000000000000604482015260640161048a565b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b60006108c6600583610eb3565b73ffffffffffffffffffffffffffffffffffffffff8083166000908152600260205260409020548391163314610b6c576040517fed5d85b500000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff8216602482015260440161048a565b73ffffffffffffffffffffffffffffffffffffffff8381166000818152600260205260408082206001810180547fffffffffffffffffffffffff00000000000000000000000000000000000000001695881695861790559051909392339290917fc54c3051ff16e63bb9203214432372aca006c589e3653619b577a3265675b7169190a450505050565b610bff33610adf565b158015610c24575060005473ffffffffffffffffffffffffffffffffffffffff163314155b15610c5d576040517f51ca1ec300000000000000000000000000000000000000000000000000000000815233600482015260240161048a565b73ffffffffffffffffffffffffffffffffffffffff8116610caa576040517fd92e233d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8083166000908152600260205260409020805490911615610d24576040517f45ed80e900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8416600482015260240161048a565b6001810180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8416179055610d71600384610e7b565b5060405173ffffffffffffffffffffffffffffffffffffffff808416916000918616907fc54c3051ff16e63bb9203214432372aca006c589e3653619b577a3265675b716908390a4505050565b610dc6610dcf565b61040781610ee2565b60005473ffffffffffffffffffffffffffffffffffffffff163314610e50576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e657200000000000000000000604482015260640161048a565b565b6000610e748373ffffffffffffffffffffffffffffffffffffffff8416610fd7565b9392505050565b6000610e748373ffffffffffffffffffffffffffffffffffffffff84166110ca565b60006108c6825490565b6000610e748383611119565b73ffffffffffffffffffffffffffffffffffffffff811660009081526001830160205260408120541515610e74565b3373ffffffffffffffffffffffffffffffffffffffff821603610f61576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640161048a565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b600081815260018301602052604081205480156110c0576000610ffb6001836113fa565b855490915060009061100f906001906113fa565b905080821461107457600086600001828154811061102f5761102f611389565b906000526020600020015490508087600001848154811061105257611052611389565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806110855761108561140d565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506108c6565b60009150506108c6565b6000818152600183016020526040812054611111575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556108c6565b5060006108c6565b600082600001828154811061113057611130611389565b9060005260206000200154905092915050565b803573ffffffffffffffffffffffffffffffffffffffff8116811461116757600080fd5b919050565b60006020828403121561117e57600080fd5b610e7482611143565b60006020808352835180602085015260005b818110156111b557858101830151858201604001528201611199565b5060006040828601015260407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8301168501019250505092915050565b6000806040838503121561120757600080fd5b61121083611143565b915061121e60208401611143565b90509250929050565b6000806020838503121561123a57600080fd5b823567ffffffffffffffff8082111561125257600080fd5b818501915085601f83011261126657600080fd5b81358181111561127557600080fd5b8660208260051b850101111561128a57600080fd5b60209290920196919550909350505050565b6020808252825182820181905260009190848201906040850190845b818110156112ea57835173ffffffffffffffffffffffffffffffffffffffff16835292840192918401916001016112b8565b50909695505050505050565b803567ffffffffffffffff8116811461116757600080fd5b6000806040838503121561132157600080fd5b61132a836112f6565b915061121e602084016112f6565b60006020828403121561134a57600080fd5b81518015158114610e7457600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b808201808211156108c6576108c66113b8565b818103818111156108c6576108c66113b8565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fdfea164736f6c6343000818000a", +} + +var TokenAdminRegistryABI = TokenAdminRegistryMetaData.ABI + +var TokenAdminRegistryBin = TokenAdminRegistryMetaData.Bin + +func DeployTokenAdminRegistry(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *TokenAdminRegistry, error) { + parsed, err := TokenAdminRegistryMetaData.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(TokenAdminRegistryBin), backend) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &TokenAdminRegistry{address: address, abi: *parsed, TokenAdminRegistryCaller: TokenAdminRegistryCaller{contract: contract}, TokenAdminRegistryTransactor: TokenAdminRegistryTransactor{contract: contract}, TokenAdminRegistryFilterer: TokenAdminRegistryFilterer{contract: contract}}, nil +} + +type TokenAdminRegistry struct { + address common.Address + abi abi.ABI + TokenAdminRegistryCaller + TokenAdminRegistryTransactor + TokenAdminRegistryFilterer +} + +type TokenAdminRegistryCaller struct { + contract *bind.BoundContract +} + +type TokenAdminRegistryTransactor struct { + contract *bind.BoundContract +} + +type TokenAdminRegistryFilterer struct { + contract *bind.BoundContract +} + +type TokenAdminRegistrySession struct { + Contract *TokenAdminRegistry + CallOpts bind.CallOpts + TransactOpts bind.TransactOpts +} + +type TokenAdminRegistryCallerSession struct { + Contract *TokenAdminRegistryCaller + CallOpts bind.CallOpts +} + +type TokenAdminRegistryTransactorSession struct { + Contract *TokenAdminRegistryTransactor + TransactOpts bind.TransactOpts +} + +type TokenAdminRegistryRaw struct { + Contract *TokenAdminRegistry +} + +type TokenAdminRegistryCallerRaw struct { + Contract *TokenAdminRegistryCaller +} + +type TokenAdminRegistryTransactorRaw struct { + Contract *TokenAdminRegistryTransactor +} + +func NewTokenAdminRegistry(address common.Address, backend bind.ContractBackend) (*TokenAdminRegistry, error) { + abi, err := abi.JSON(strings.NewReader(TokenAdminRegistryABI)) + if err != nil { + return nil, err + } + contract, err := bindTokenAdminRegistry(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &TokenAdminRegistry{address: address, abi: abi, TokenAdminRegistryCaller: TokenAdminRegistryCaller{contract: contract}, TokenAdminRegistryTransactor: TokenAdminRegistryTransactor{contract: contract}, TokenAdminRegistryFilterer: TokenAdminRegistryFilterer{contract: contract}}, nil +} + +func NewTokenAdminRegistryCaller(address common.Address, caller bind.ContractCaller) (*TokenAdminRegistryCaller, error) { + contract, err := bindTokenAdminRegistry(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &TokenAdminRegistryCaller{contract: contract}, nil +} + +func NewTokenAdminRegistryTransactor(address common.Address, transactor bind.ContractTransactor) (*TokenAdminRegistryTransactor, error) { + contract, err := bindTokenAdminRegistry(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &TokenAdminRegistryTransactor{contract: contract}, nil +} + +func NewTokenAdminRegistryFilterer(address common.Address, filterer bind.ContractFilterer) (*TokenAdminRegistryFilterer, error) { + contract, err := bindTokenAdminRegistry(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &TokenAdminRegistryFilterer{contract: contract}, nil +} + +func bindTokenAdminRegistry(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := TokenAdminRegistryMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +func (_TokenAdminRegistry *TokenAdminRegistryRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _TokenAdminRegistry.Contract.TokenAdminRegistryCaller.contract.Call(opts, result, method, params...) +} + +func (_TokenAdminRegistry *TokenAdminRegistryRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _TokenAdminRegistry.Contract.TokenAdminRegistryTransactor.contract.Transfer(opts) +} + +func (_TokenAdminRegistry *TokenAdminRegistryRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _TokenAdminRegistry.Contract.TokenAdminRegistryTransactor.contract.Transact(opts, method, params...) +} + +func (_TokenAdminRegistry *TokenAdminRegistryCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _TokenAdminRegistry.Contract.contract.Call(opts, result, method, params...) +} + +func (_TokenAdminRegistry *TokenAdminRegistryTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _TokenAdminRegistry.Contract.contract.Transfer(opts) +} + +func (_TokenAdminRegistry *TokenAdminRegistryTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _TokenAdminRegistry.Contract.contract.Transact(opts, method, params...) +} + +func (_TokenAdminRegistry *TokenAdminRegistryCaller) GetAllConfiguredTokens(opts *bind.CallOpts, startIndex uint64, maxCount uint64) ([]common.Address, error) { + var out []interface{} + err := _TokenAdminRegistry.contract.Call(opts, &out, "getAllConfiguredTokens", startIndex, maxCount) + + if err != nil { + return *new([]common.Address), err + } + + out0 := *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) + + return out0, err + +} + +func (_TokenAdminRegistry *TokenAdminRegistrySession) GetAllConfiguredTokens(startIndex uint64, maxCount uint64) ([]common.Address, error) { + return _TokenAdminRegistry.Contract.GetAllConfiguredTokens(&_TokenAdminRegistry.CallOpts, startIndex, maxCount) +} + +func (_TokenAdminRegistry *TokenAdminRegistryCallerSession) GetAllConfiguredTokens(startIndex uint64, maxCount uint64) ([]common.Address, error) { + return _TokenAdminRegistry.Contract.GetAllConfiguredTokens(&_TokenAdminRegistry.CallOpts, startIndex, maxCount) +} + +func (_TokenAdminRegistry *TokenAdminRegistryCaller) GetPool(opts *bind.CallOpts, token common.Address) (common.Address, error) { + var out []interface{} + err := _TokenAdminRegistry.contract.Call(opts, &out, "getPool", token) + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_TokenAdminRegistry *TokenAdminRegistrySession) GetPool(token common.Address) (common.Address, error) { + return _TokenAdminRegistry.Contract.GetPool(&_TokenAdminRegistry.CallOpts, token) +} + +func (_TokenAdminRegistry *TokenAdminRegistryCallerSession) GetPool(token common.Address) (common.Address, error) { + return _TokenAdminRegistry.Contract.GetPool(&_TokenAdminRegistry.CallOpts, token) +} + +func (_TokenAdminRegistry *TokenAdminRegistryCaller) GetPools(opts *bind.CallOpts, tokens []common.Address) ([]common.Address, error) { + var out []interface{} + err := _TokenAdminRegistry.contract.Call(opts, &out, "getPools", tokens) + + if err != nil { + return *new([]common.Address), err + } + + out0 := *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) + + return out0, err + +} + +func (_TokenAdminRegistry *TokenAdminRegistrySession) GetPools(tokens []common.Address) ([]common.Address, error) { + return _TokenAdminRegistry.Contract.GetPools(&_TokenAdminRegistry.CallOpts, tokens) +} + +func (_TokenAdminRegistry *TokenAdminRegistryCallerSession) GetPools(tokens []common.Address) ([]common.Address, error) { + return _TokenAdminRegistry.Contract.GetPools(&_TokenAdminRegistry.CallOpts, tokens) +} + +func (_TokenAdminRegistry *TokenAdminRegistryCaller) GetTokenConfig(opts *bind.CallOpts, token common.Address) (TokenAdminRegistryTokenConfig, error) { + var out []interface{} + err := _TokenAdminRegistry.contract.Call(opts, &out, "getTokenConfig", token) + + if err != nil { + return *new(TokenAdminRegistryTokenConfig), err + } + + out0 := *abi.ConvertType(out[0], new(TokenAdminRegistryTokenConfig)).(*TokenAdminRegistryTokenConfig) + + return out0, err + +} + +func (_TokenAdminRegistry *TokenAdminRegistrySession) GetTokenConfig(token common.Address) (TokenAdminRegistryTokenConfig, error) { + return _TokenAdminRegistry.Contract.GetTokenConfig(&_TokenAdminRegistry.CallOpts, token) +} + +func (_TokenAdminRegistry *TokenAdminRegistryCallerSession) GetTokenConfig(token common.Address) (TokenAdminRegistryTokenConfig, error) { + return _TokenAdminRegistry.Contract.GetTokenConfig(&_TokenAdminRegistry.CallOpts, token) +} + +func (_TokenAdminRegistry *TokenAdminRegistryCaller) IsAdministrator(opts *bind.CallOpts, localToken common.Address, administrator common.Address) (bool, error) { + var out []interface{} + err := _TokenAdminRegistry.contract.Call(opts, &out, "isAdministrator", localToken, administrator) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_TokenAdminRegistry *TokenAdminRegistrySession) IsAdministrator(localToken common.Address, administrator common.Address) (bool, error) { + return _TokenAdminRegistry.Contract.IsAdministrator(&_TokenAdminRegistry.CallOpts, localToken, administrator) +} + +func (_TokenAdminRegistry *TokenAdminRegistryCallerSession) IsAdministrator(localToken common.Address, administrator common.Address) (bool, error) { + return _TokenAdminRegistry.Contract.IsAdministrator(&_TokenAdminRegistry.CallOpts, localToken, administrator) +} + +func (_TokenAdminRegistry *TokenAdminRegistryCaller) IsRegistryModule(opts *bind.CallOpts, module common.Address) (bool, error) { + var out []interface{} + err := _TokenAdminRegistry.contract.Call(opts, &out, "isRegistryModule", module) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_TokenAdminRegistry *TokenAdminRegistrySession) IsRegistryModule(module common.Address) (bool, error) { + return _TokenAdminRegistry.Contract.IsRegistryModule(&_TokenAdminRegistry.CallOpts, module) +} + +func (_TokenAdminRegistry *TokenAdminRegistryCallerSession) IsRegistryModule(module common.Address) (bool, error) { + return _TokenAdminRegistry.Contract.IsRegistryModule(&_TokenAdminRegistry.CallOpts, module) +} + +func (_TokenAdminRegistry *TokenAdminRegistryCaller) Owner(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _TokenAdminRegistry.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 + +} + +func (_TokenAdminRegistry *TokenAdminRegistrySession) Owner() (common.Address, error) { + return _TokenAdminRegistry.Contract.Owner(&_TokenAdminRegistry.CallOpts) +} + +func (_TokenAdminRegistry *TokenAdminRegistryCallerSession) Owner() (common.Address, error) { + return _TokenAdminRegistry.Contract.Owner(&_TokenAdminRegistry.CallOpts) +} + +func (_TokenAdminRegistry *TokenAdminRegistryCaller) TypeAndVersion(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _TokenAdminRegistry.contract.Call(opts, &out, "typeAndVersion") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +func (_TokenAdminRegistry *TokenAdminRegistrySession) TypeAndVersion() (string, error) { + return _TokenAdminRegistry.Contract.TypeAndVersion(&_TokenAdminRegistry.CallOpts) +} + +func (_TokenAdminRegistry *TokenAdminRegistryCallerSession) TypeAndVersion() (string, error) { + return _TokenAdminRegistry.Contract.TypeAndVersion(&_TokenAdminRegistry.CallOpts) +} + +func (_TokenAdminRegistry *TokenAdminRegistryTransactor) AcceptAdminRole(opts *bind.TransactOpts, localToken common.Address) (*types.Transaction, error) { + return _TokenAdminRegistry.contract.Transact(opts, "acceptAdminRole", localToken) +} + +func (_TokenAdminRegistry *TokenAdminRegistrySession) AcceptAdminRole(localToken common.Address) (*types.Transaction, error) { + return _TokenAdminRegistry.Contract.AcceptAdminRole(&_TokenAdminRegistry.TransactOpts, localToken) +} + +func (_TokenAdminRegistry *TokenAdminRegistryTransactorSession) AcceptAdminRole(localToken common.Address) (*types.Transaction, error) { + return _TokenAdminRegistry.Contract.AcceptAdminRole(&_TokenAdminRegistry.TransactOpts, localToken) +} + +func (_TokenAdminRegistry *TokenAdminRegistryTransactor) AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + return _TokenAdminRegistry.contract.Transact(opts, "acceptOwnership") +} + +func (_TokenAdminRegistry *TokenAdminRegistrySession) AcceptOwnership() (*types.Transaction, error) { + return _TokenAdminRegistry.Contract.AcceptOwnership(&_TokenAdminRegistry.TransactOpts) +} + +func (_TokenAdminRegistry *TokenAdminRegistryTransactorSession) AcceptOwnership() (*types.Transaction, error) { + return _TokenAdminRegistry.Contract.AcceptOwnership(&_TokenAdminRegistry.TransactOpts) +} + +func (_TokenAdminRegistry *TokenAdminRegistryTransactor) AddRegistryModule(opts *bind.TransactOpts, module common.Address) (*types.Transaction, error) { + return _TokenAdminRegistry.contract.Transact(opts, "addRegistryModule", module) +} + +func (_TokenAdminRegistry *TokenAdminRegistrySession) AddRegistryModule(module common.Address) (*types.Transaction, error) { + return _TokenAdminRegistry.Contract.AddRegistryModule(&_TokenAdminRegistry.TransactOpts, module) +} + +func (_TokenAdminRegistry *TokenAdminRegistryTransactorSession) AddRegistryModule(module common.Address) (*types.Transaction, error) { + return _TokenAdminRegistry.Contract.AddRegistryModule(&_TokenAdminRegistry.TransactOpts, module) +} + +func (_TokenAdminRegistry *TokenAdminRegistryTransactor) ProposeAdministrator(opts *bind.TransactOpts, localToken common.Address, administrator common.Address) (*types.Transaction, error) { + return _TokenAdminRegistry.contract.Transact(opts, "proposeAdministrator", localToken, administrator) +} + +func (_TokenAdminRegistry *TokenAdminRegistrySession) ProposeAdministrator(localToken common.Address, administrator common.Address) (*types.Transaction, error) { + return _TokenAdminRegistry.Contract.ProposeAdministrator(&_TokenAdminRegistry.TransactOpts, localToken, administrator) +} + +func (_TokenAdminRegistry *TokenAdminRegistryTransactorSession) ProposeAdministrator(localToken common.Address, administrator common.Address) (*types.Transaction, error) { + return _TokenAdminRegistry.Contract.ProposeAdministrator(&_TokenAdminRegistry.TransactOpts, localToken, administrator) +} + +func (_TokenAdminRegistry *TokenAdminRegistryTransactor) RemoveRegistryModule(opts *bind.TransactOpts, module common.Address) (*types.Transaction, error) { + return _TokenAdminRegistry.contract.Transact(opts, "removeRegistryModule", module) +} + +func (_TokenAdminRegistry *TokenAdminRegistrySession) RemoveRegistryModule(module common.Address) (*types.Transaction, error) { + return _TokenAdminRegistry.Contract.RemoveRegistryModule(&_TokenAdminRegistry.TransactOpts, module) +} + +func (_TokenAdminRegistry *TokenAdminRegistryTransactorSession) RemoveRegistryModule(module common.Address) (*types.Transaction, error) { + return _TokenAdminRegistry.Contract.RemoveRegistryModule(&_TokenAdminRegistry.TransactOpts, module) +} + +func (_TokenAdminRegistry *TokenAdminRegistryTransactor) SetPool(opts *bind.TransactOpts, localToken common.Address, pool common.Address) (*types.Transaction, error) { + return _TokenAdminRegistry.contract.Transact(opts, "setPool", localToken, pool) +} + +func (_TokenAdminRegistry *TokenAdminRegistrySession) SetPool(localToken common.Address, pool common.Address) (*types.Transaction, error) { + return _TokenAdminRegistry.Contract.SetPool(&_TokenAdminRegistry.TransactOpts, localToken, pool) +} + +func (_TokenAdminRegistry *TokenAdminRegistryTransactorSession) SetPool(localToken common.Address, pool common.Address) (*types.Transaction, error) { + return _TokenAdminRegistry.Contract.SetPool(&_TokenAdminRegistry.TransactOpts, localToken, pool) +} + +func (_TokenAdminRegistry *TokenAdminRegistryTransactor) TransferAdminRole(opts *bind.TransactOpts, localToken common.Address, newAdmin common.Address) (*types.Transaction, error) { + return _TokenAdminRegistry.contract.Transact(opts, "transferAdminRole", localToken, newAdmin) +} + +func (_TokenAdminRegistry *TokenAdminRegistrySession) TransferAdminRole(localToken common.Address, newAdmin common.Address) (*types.Transaction, error) { + return _TokenAdminRegistry.Contract.TransferAdminRole(&_TokenAdminRegistry.TransactOpts, localToken, newAdmin) +} + +func (_TokenAdminRegistry *TokenAdminRegistryTransactorSession) TransferAdminRole(localToken common.Address, newAdmin common.Address) (*types.Transaction, error) { + return _TokenAdminRegistry.Contract.TransferAdminRole(&_TokenAdminRegistry.TransactOpts, localToken, newAdmin) +} + +func (_TokenAdminRegistry *TokenAdminRegistryTransactor) TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) { + return _TokenAdminRegistry.contract.Transact(opts, "transferOwnership", to) +} + +func (_TokenAdminRegistry *TokenAdminRegistrySession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _TokenAdminRegistry.Contract.TransferOwnership(&_TokenAdminRegistry.TransactOpts, to) +} + +func (_TokenAdminRegistry *TokenAdminRegistryTransactorSession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _TokenAdminRegistry.Contract.TransferOwnership(&_TokenAdminRegistry.TransactOpts, to) +} + +type TokenAdminRegistryAdministratorTransferRequestedIterator struct { + Event *TokenAdminRegistryAdministratorTransferRequested + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *TokenAdminRegistryAdministratorTransferRequestedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(TokenAdminRegistryAdministratorTransferRequested) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(TokenAdminRegistryAdministratorTransferRequested) + 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() + } +} + +func (it *TokenAdminRegistryAdministratorTransferRequestedIterator) Error() error { + return it.fail +} + +func (it *TokenAdminRegistryAdministratorTransferRequestedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type TokenAdminRegistryAdministratorTransferRequested struct { + Token common.Address + CurrentAdmin common.Address + NewAdmin common.Address + Raw types.Log +} + +func (_TokenAdminRegistry *TokenAdminRegistryFilterer) FilterAdministratorTransferRequested(opts *bind.FilterOpts, token []common.Address, currentAdmin []common.Address, newAdmin []common.Address) (*TokenAdminRegistryAdministratorTransferRequestedIterator, error) { + + var tokenRule []interface{} + for _, tokenItem := range token { + tokenRule = append(tokenRule, tokenItem) + } + var currentAdminRule []interface{} + for _, currentAdminItem := range currentAdmin { + currentAdminRule = append(currentAdminRule, currentAdminItem) + } + var newAdminRule []interface{} + for _, newAdminItem := range newAdmin { + newAdminRule = append(newAdminRule, newAdminItem) + } + + logs, sub, err := _TokenAdminRegistry.contract.FilterLogs(opts, "AdministratorTransferRequested", tokenRule, currentAdminRule, newAdminRule) + if err != nil { + return nil, err + } + return &TokenAdminRegistryAdministratorTransferRequestedIterator{contract: _TokenAdminRegistry.contract, event: "AdministratorTransferRequested", logs: logs, sub: sub}, nil +} + +func (_TokenAdminRegistry *TokenAdminRegistryFilterer) WatchAdministratorTransferRequested(opts *bind.WatchOpts, sink chan<- *TokenAdminRegistryAdministratorTransferRequested, token []common.Address, currentAdmin []common.Address, newAdmin []common.Address) (event.Subscription, error) { + + var tokenRule []interface{} + for _, tokenItem := range token { + tokenRule = append(tokenRule, tokenItem) + } + var currentAdminRule []interface{} + for _, currentAdminItem := range currentAdmin { + currentAdminRule = append(currentAdminRule, currentAdminItem) + } + var newAdminRule []interface{} + for _, newAdminItem := range newAdmin { + newAdminRule = append(newAdminRule, newAdminItem) + } + + logs, sub, err := _TokenAdminRegistry.contract.WatchLogs(opts, "AdministratorTransferRequested", tokenRule, currentAdminRule, newAdminRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(TokenAdminRegistryAdministratorTransferRequested) + if err := _TokenAdminRegistry.contract.UnpackLog(event, "AdministratorTransferRequested", 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 +} + +func (_TokenAdminRegistry *TokenAdminRegistryFilterer) ParseAdministratorTransferRequested(log types.Log) (*TokenAdminRegistryAdministratorTransferRequested, error) { + event := new(TokenAdminRegistryAdministratorTransferRequested) + if err := _TokenAdminRegistry.contract.UnpackLog(event, "AdministratorTransferRequested", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type TokenAdminRegistryAdministratorTransferredIterator struct { + Event *TokenAdminRegistryAdministratorTransferred + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *TokenAdminRegistryAdministratorTransferredIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(TokenAdminRegistryAdministratorTransferred) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(TokenAdminRegistryAdministratorTransferred) + 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() + } +} + +func (it *TokenAdminRegistryAdministratorTransferredIterator) Error() error { + return it.fail +} + +func (it *TokenAdminRegistryAdministratorTransferredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type TokenAdminRegistryAdministratorTransferred struct { + Token common.Address + NewAdmin common.Address + Raw types.Log +} + +func (_TokenAdminRegistry *TokenAdminRegistryFilterer) FilterAdministratorTransferred(opts *bind.FilterOpts, token []common.Address, newAdmin []common.Address) (*TokenAdminRegistryAdministratorTransferredIterator, error) { + + var tokenRule []interface{} + for _, tokenItem := range token { + tokenRule = append(tokenRule, tokenItem) + } + var newAdminRule []interface{} + for _, newAdminItem := range newAdmin { + newAdminRule = append(newAdminRule, newAdminItem) + } + + logs, sub, err := _TokenAdminRegistry.contract.FilterLogs(opts, "AdministratorTransferred", tokenRule, newAdminRule) + if err != nil { + return nil, err + } + return &TokenAdminRegistryAdministratorTransferredIterator{contract: _TokenAdminRegistry.contract, event: "AdministratorTransferred", logs: logs, sub: sub}, nil +} + +func (_TokenAdminRegistry *TokenAdminRegistryFilterer) WatchAdministratorTransferred(opts *bind.WatchOpts, sink chan<- *TokenAdminRegistryAdministratorTransferred, token []common.Address, newAdmin []common.Address) (event.Subscription, error) { + + var tokenRule []interface{} + for _, tokenItem := range token { + tokenRule = append(tokenRule, tokenItem) + } + var newAdminRule []interface{} + for _, newAdminItem := range newAdmin { + newAdminRule = append(newAdminRule, newAdminItem) + } + + logs, sub, err := _TokenAdminRegistry.contract.WatchLogs(opts, "AdministratorTransferred", tokenRule, newAdminRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(TokenAdminRegistryAdministratorTransferred) + if err := _TokenAdminRegistry.contract.UnpackLog(event, "AdministratorTransferred", 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 +} + +func (_TokenAdminRegistry *TokenAdminRegistryFilterer) ParseAdministratorTransferred(log types.Log) (*TokenAdminRegistryAdministratorTransferred, error) { + event := new(TokenAdminRegistryAdministratorTransferred) + if err := _TokenAdminRegistry.contract.UnpackLog(event, "AdministratorTransferred", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type TokenAdminRegistryOwnershipTransferRequestedIterator struct { + Event *TokenAdminRegistryOwnershipTransferRequested + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *TokenAdminRegistryOwnershipTransferRequestedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(TokenAdminRegistryOwnershipTransferRequested) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(TokenAdminRegistryOwnershipTransferRequested) + 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() + } +} + +func (it *TokenAdminRegistryOwnershipTransferRequestedIterator) Error() error { + return it.fail +} + +func (it *TokenAdminRegistryOwnershipTransferRequestedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type TokenAdminRegistryOwnershipTransferRequested struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_TokenAdminRegistry *TokenAdminRegistryFilterer) FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*TokenAdminRegistryOwnershipTransferRequestedIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _TokenAdminRegistry.contract.FilterLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return &TokenAdminRegistryOwnershipTransferRequestedIterator{contract: _TokenAdminRegistry.contract, event: "OwnershipTransferRequested", logs: logs, sub: sub}, nil +} + +func (_TokenAdminRegistry *TokenAdminRegistryFilterer) WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *TokenAdminRegistryOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _TokenAdminRegistry.contract.WatchLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(TokenAdminRegistryOwnershipTransferRequested) + if err := _TokenAdminRegistry.contract.UnpackLog(event, "OwnershipTransferRequested", 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 +} + +func (_TokenAdminRegistry *TokenAdminRegistryFilterer) ParseOwnershipTransferRequested(log types.Log) (*TokenAdminRegistryOwnershipTransferRequested, error) { + event := new(TokenAdminRegistryOwnershipTransferRequested) + if err := _TokenAdminRegistry.contract.UnpackLog(event, "OwnershipTransferRequested", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type TokenAdminRegistryOwnershipTransferredIterator struct { + Event *TokenAdminRegistryOwnershipTransferred + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *TokenAdminRegistryOwnershipTransferredIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(TokenAdminRegistryOwnershipTransferred) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(TokenAdminRegistryOwnershipTransferred) + 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() + } +} + +func (it *TokenAdminRegistryOwnershipTransferredIterator) Error() error { + return it.fail +} + +func (it *TokenAdminRegistryOwnershipTransferredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type TokenAdminRegistryOwnershipTransferred struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_TokenAdminRegistry *TokenAdminRegistryFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*TokenAdminRegistryOwnershipTransferredIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _TokenAdminRegistry.contract.FilterLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return &TokenAdminRegistryOwnershipTransferredIterator{contract: _TokenAdminRegistry.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil +} + +func (_TokenAdminRegistry *TokenAdminRegistryFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *TokenAdminRegistryOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _TokenAdminRegistry.contract.WatchLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(TokenAdminRegistryOwnershipTransferred) + if err := _TokenAdminRegistry.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 +} + +func (_TokenAdminRegistry *TokenAdminRegistryFilterer) ParseOwnershipTransferred(log types.Log) (*TokenAdminRegistryOwnershipTransferred, error) { + event := new(TokenAdminRegistryOwnershipTransferred) + if err := _TokenAdminRegistry.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type TokenAdminRegistryPoolSetIterator struct { + Event *TokenAdminRegistryPoolSet + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *TokenAdminRegistryPoolSetIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(TokenAdminRegistryPoolSet) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(TokenAdminRegistryPoolSet) + 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() + } +} + +func (it *TokenAdminRegistryPoolSetIterator) Error() error { + return it.fail +} + +func (it *TokenAdminRegistryPoolSetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type TokenAdminRegistryPoolSet struct { + Token common.Address + PreviousPool common.Address + NewPool common.Address + Raw types.Log +} + +func (_TokenAdminRegistry *TokenAdminRegistryFilterer) FilterPoolSet(opts *bind.FilterOpts, token []common.Address, previousPool []common.Address, newPool []common.Address) (*TokenAdminRegistryPoolSetIterator, error) { + + var tokenRule []interface{} + for _, tokenItem := range token { + tokenRule = append(tokenRule, tokenItem) + } + var previousPoolRule []interface{} + for _, previousPoolItem := range previousPool { + previousPoolRule = append(previousPoolRule, previousPoolItem) + } + var newPoolRule []interface{} + for _, newPoolItem := range newPool { + newPoolRule = append(newPoolRule, newPoolItem) + } + + logs, sub, err := _TokenAdminRegistry.contract.FilterLogs(opts, "PoolSet", tokenRule, previousPoolRule, newPoolRule) + if err != nil { + return nil, err + } + return &TokenAdminRegistryPoolSetIterator{contract: _TokenAdminRegistry.contract, event: "PoolSet", logs: logs, sub: sub}, nil +} + +func (_TokenAdminRegistry *TokenAdminRegistryFilterer) WatchPoolSet(opts *bind.WatchOpts, sink chan<- *TokenAdminRegistryPoolSet, token []common.Address, previousPool []common.Address, newPool []common.Address) (event.Subscription, error) { + + var tokenRule []interface{} + for _, tokenItem := range token { + tokenRule = append(tokenRule, tokenItem) + } + var previousPoolRule []interface{} + for _, previousPoolItem := range previousPool { + previousPoolRule = append(previousPoolRule, previousPoolItem) + } + var newPoolRule []interface{} + for _, newPoolItem := range newPool { + newPoolRule = append(newPoolRule, newPoolItem) + } + + logs, sub, err := _TokenAdminRegistry.contract.WatchLogs(opts, "PoolSet", tokenRule, previousPoolRule, newPoolRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(TokenAdminRegistryPoolSet) + if err := _TokenAdminRegistry.contract.UnpackLog(event, "PoolSet", 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 +} + +func (_TokenAdminRegistry *TokenAdminRegistryFilterer) ParsePoolSet(log types.Log) (*TokenAdminRegistryPoolSet, error) { + event := new(TokenAdminRegistryPoolSet) + if err := _TokenAdminRegistry.contract.UnpackLog(event, "PoolSet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type TokenAdminRegistryRegistryModuleAddedIterator struct { + Event *TokenAdminRegistryRegistryModuleAdded + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *TokenAdminRegistryRegistryModuleAddedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(TokenAdminRegistryRegistryModuleAdded) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(TokenAdminRegistryRegistryModuleAdded) + 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() + } +} + +func (it *TokenAdminRegistryRegistryModuleAddedIterator) Error() error { + return it.fail +} + +func (it *TokenAdminRegistryRegistryModuleAddedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type TokenAdminRegistryRegistryModuleAdded struct { + Module common.Address + Raw types.Log +} + +func (_TokenAdminRegistry *TokenAdminRegistryFilterer) FilterRegistryModuleAdded(opts *bind.FilterOpts) (*TokenAdminRegistryRegistryModuleAddedIterator, error) { + + logs, sub, err := _TokenAdminRegistry.contract.FilterLogs(opts, "RegistryModuleAdded") + if err != nil { + return nil, err + } + return &TokenAdminRegistryRegistryModuleAddedIterator{contract: _TokenAdminRegistry.contract, event: "RegistryModuleAdded", logs: logs, sub: sub}, nil +} + +func (_TokenAdminRegistry *TokenAdminRegistryFilterer) WatchRegistryModuleAdded(opts *bind.WatchOpts, sink chan<- *TokenAdminRegistryRegistryModuleAdded) (event.Subscription, error) { + + logs, sub, err := _TokenAdminRegistry.contract.WatchLogs(opts, "RegistryModuleAdded") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(TokenAdminRegistryRegistryModuleAdded) + if err := _TokenAdminRegistry.contract.UnpackLog(event, "RegistryModuleAdded", 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 +} + +func (_TokenAdminRegistry *TokenAdminRegistryFilterer) ParseRegistryModuleAdded(log types.Log) (*TokenAdminRegistryRegistryModuleAdded, error) { + event := new(TokenAdminRegistryRegistryModuleAdded) + if err := _TokenAdminRegistry.contract.UnpackLog(event, "RegistryModuleAdded", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type TokenAdminRegistryRegistryModuleRemovedIterator struct { + Event *TokenAdminRegistryRegistryModuleRemoved + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *TokenAdminRegistryRegistryModuleRemovedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(TokenAdminRegistryRegistryModuleRemoved) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(TokenAdminRegistryRegistryModuleRemoved) + 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() + } +} + +func (it *TokenAdminRegistryRegistryModuleRemovedIterator) Error() error { + return it.fail +} + +func (it *TokenAdminRegistryRegistryModuleRemovedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type TokenAdminRegistryRegistryModuleRemoved struct { + Module common.Address + Raw types.Log +} + +func (_TokenAdminRegistry *TokenAdminRegistryFilterer) FilterRegistryModuleRemoved(opts *bind.FilterOpts, module []common.Address) (*TokenAdminRegistryRegistryModuleRemovedIterator, error) { + + var moduleRule []interface{} + for _, moduleItem := range module { + moduleRule = append(moduleRule, moduleItem) + } + + logs, sub, err := _TokenAdminRegistry.contract.FilterLogs(opts, "RegistryModuleRemoved", moduleRule) + if err != nil { + return nil, err + } + return &TokenAdminRegistryRegistryModuleRemovedIterator{contract: _TokenAdminRegistry.contract, event: "RegistryModuleRemoved", logs: logs, sub: sub}, nil +} + +func (_TokenAdminRegistry *TokenAdminRegistryFilterer) WatchRegistryModuleRemoved(opts *bind.WatchOpts, sink chan<- *TokenAdminRegistryRegistryModuleRemoved, module []common.Address) (event.Subscription, error) { + + var moduleRule []interface{} + for _, moduleItem := range module { + moduleRule = append(moduleRule, moduleItem) + } + + logs, sub, err := _TokenAdminRegistry.contract.WatchLogs(opts, "RegistryModuleRemoved", moduleRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(TokenAdminRegistryRegistryModuleRemoved) + if err := _TokenAdminRegistry.contract.UnpackLog(event, "RegistryModuleRemoved", 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 +} + +func (_TokenAdminRegistry *TokenAdminRegistryFilterer) ParseRegistryModuleRemoved(log types.Log) (*TokenAdminRegistryRegistryModuleRemoved, error) { + event := new(TokenAdminRegistryRegistryModuleRemoved) + if err := _TokenAdminRegistry.contract.UnpackLog(event, "RegistryModuleRemoved", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +func (_TokenAdminRegistry *TokenAdminRegistry) ParseLog(log types.Log) (generated.AbigenLog, error) { + switch log.Topics[0] { + case _TokenAdminRegistry.abi.Events["AdministratorTransferRequested"].ID: + return _TokenAdminRegistry.ParseAdministratorTransferRequested(log) + case _TokenAdminRegistry.abi.Events["AdministratorTransferred"].ID: + return _TokenAdminRegistry.ParseAdministratorTransferred(log) + case _TokenAdminRegistry.abi.Events["OwnershipTransferRequested"].ID: + return _TokenAdminRegistry.ParseOwnershipTransferRequested(log) + case _TokenAdminRegistry.abi.Events["OwnershipTransferred"].ID: + return _TokenAdminRegistry.ParseOwnershipTransferred(log) + case _TokenAdminRegistry.abi.Events["PoolSet"].ID: + return _TokenAdminRegistry.ParsePoolSet(log) + case _TokenAdminRegistry.abi.Events["RegistryModuleAdded"].ID: + return _TokenAdminRegistry.ParseRegistryModuleAdded(log) + case _TokenAdminRegistry.abi.Events["RegistryModuleRemoved"].ID: + return _TokenAdminRegistry.ParseRegistryModuleRemoved(log) + + default: + return nil, fmt.Errorf("abigen wrapper received unknown log topic: %v", log.Topics[0]) + } +} + +func (TokenAdminRegistryAdministratorTransferRequested) Topic() common.Hash { + return common.HexToHash("0xc54c3051ff16e63bb9203214432372aca006c589e3653619b577a3265675b716") +} + +func (TokenAdminRegistryAdministratorTransferred) Topic() common.Hash { + return common.HexToHash("0x399b55200f7f639a63d76efe3dcfa9156ce367058d6b673041b84a628885f5a7") +} + +func (TokenAdminRegistryOwnershipTransferRequested) Topic() common.Hash { + return common.HexToHash("0xed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae1278") +} + +func (TokenAdminRegistryOwnershipTransferred) Topic() common.Hash { + return common.HexToHash("0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0") +} + +func (TokenAdminRegistryPoolSet) Topic() common.Hash { + return common.HexToHash("0x754449ec3aff3bd528bfce43ae9319c4a381b67fcd1d20097b3b24dacaecc35d") +} + +func (TokenAdminRegistryRegistryModuleAdded) Topic() common.Hash { + return common.HexToHash("0x3cabf004338366bfeaeb610ad827cb58d16b588017c509501f2c97c83caae7b2") +} + +func (TokenAdminRegistryRegistryModuleRemoved) Topic() common.Hash { + return common.HexToHash("0x93eaa26dcb9275e56bacb1d33fdbf402262da6f0f4baf2a6e2cd154b73f387f8") +} + +func (_TokenAdminRegistry *TokenAdminRegistry) Address() common.Address { + return _TokenAdminRegistry.address +} + +type TokenAdminRegistryInterface interface { + GetAllConfiguredTokens(opts *bind.CallOpts, startIndex uint64, maxCount uint64) ([]common.Address, error) + + GetPool(opts *bind.CallOpts, token common.Address) (common.Address, error) + + GetPools(opts *bind.CallOpts, tokens []common.Address) ([]common.Address, error) + + GetTokenConfig(opts *bind.CallOpts, token common.Address) (TokenAdminRegistryTokenConfig, error) + + IsAdministrator(opts *bind.CallOpts, localToken common.Address, administrator common.Address) (bool, error) + + IsRegistryModule(opts *bind.CallOpts, module common.Address) (bool, error) + + Owner(opts *bind.CallOpts) (common.Address, error) + + TypeAndVersion(opts *bind.CallOpts) (string, error) + + AcceptAdminRole(opts *bind.TransactOpts, localToken common.Address) (*types.Transaction, error) + + AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) + + AddRegistryModule(opts *bind.TransactOpts, module common.Address) (*types.Transaction, error) + + ProposeAdministrator(opts *bind.TransactOpts, localToken common.Address, administrator common.Address) (*types.Transaction, error) + + RemoveRegistryModule(opts *bind.TransactOpts, module common.Address) (*types.Transaction, error) + + SetPool(opts *bind.TransactOpts, localToken common.Address, pool common.Address) (*types.Transaction, error) + + TransferAdminRole(opts *bind.TransactOpts, localToken common.Address, newAdmin common.Address) (*types.Transaction, error) + + TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) + + FilterAdministratorTransferRequested(opts *bind.FilterOpts, token []common.Address, currentAdmin []common.Address, newAdmin []common.Address) (*TokenAdminRegistryAdministratorTransferRequestedIterator, error) + + WatchAdministratorTransferRequested(opts *bind.WatchOpts, sink chan<- *TokenAdminRegistryAdministratorTransferRequested, token []common.Address, currentAdmin []common.Address, newAdmin []common.Address) (event.Subscription, error) + + ParseAdministratorTransferRequested(log types.Log) (*TokenAdminRegistryAdministratorTransferRequested, error) + + FilterAdministratorTransferred(opts *bind.FilterOpts, token []common.Address, newAdmin []common.Address) (*TokenAdminRegistryAdministratorTransferredIterator, error) + + WatchAdministratorTransferred(opts *bind.WatchOpts, sink chan<- *TokenAdminRegistryAdministratorTransferred, token []common.Address, newAdmin []common.Address) (event.Subscription, error) + + ParseAdministratorTransferred(log types.Log) (*TokenAdminRegistryAdministratorTransferred, error) + + FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*TokenAdminRegistryOwnershipTransferRequestedIterator, error) + + WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *TokenAdminRegistryOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferRequested(log types.Log) (*TokenAdminRegistryOwnershipTransferRequested, error) + + FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*TokenAdminRegistryOwnershipTransferredIterator, error) + + WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *TokenAdminRegistryOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferred(log types.Log) (*TokenAdminRegistryOwnershipTransferred, error) + + FilterPoolSet(opts *bind.FilterOpts, token []common.Address, previousPool []common.Address, newPool []common.Address) (*TokenAdminRegistryPoolSetIterator, error) + + WatchPoolSet(opts *bind.WatchOpts, sink chan<- *TokenAdminRegistryPoolSet, token []common.Address, previousPool []common.Address, newPool []common.Address) (event.Subscription, error) + + ParsePoolSet(log types.Log) (*TokenAdminRegistryPoolSet, error) + + FilterRegistryModuleAdded(opts *bind.FilterOpts) (*TokenAdminRegistryRegistryModuleAddedIterator, error) + + WatchRegistryModuleAdded(opts *bind.WatchOpts, sink chan<- *TokenAdminRegistryRegistryModuleAdded) (event.Subscription, error) + + ParseRegistryModuleAdded(log types.Log) (*TokenAdminRegistryRegistryModuleAdded, error) + + FilterRegistryModuleRemoved(opts *bind.FilterOpts, module []common.Address) (*TokenAdminRegistryRegistryModuleRemovedIterator, error) + + WatchRegistryModuleRemoved(opts *bind.WatchOpts, sink chan<- *TokenAdminRegistryRegistryModuleRemoved, module []common.Address) (event.Subscription, error) + + ParseRegistryModuleRemoved(log types.Log) (*TokenAdminRegistryRegistryModuleRemoved, error) + + ParseLog(log types.Log) (generated.AbigenLog, error) + + Address() common.Address +} diff --git a/core/gethwrappers/ccip/generated/token_pool/token_pool.go b/core/gethwrappers/ccip/generated/token_pool/token_pool.go new file mode 100644 index 00000000000..0bca23641c3 --- /dev/null +++ b/core/gethwrappers/ccip/generated/token_pool/token_pool.go @@ -0,0 +1,2646 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package token_pool + +import ( + "errors" + "fmt" + "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" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" +) + +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +type PoolLockOrBurnInV1 struct { + Receiver []byte + RemoteChainSelector uint64 + OriginalSender common.Address + Amount *big.Int + LocalToken common.Address +} + +type PoolLockOrBurnOutV1 struct { + DestTokenAddress []byte + DestPoolData []byte +} + +type PoolReleaseOrMintInV1 struct { + OriginalSender []byte + RemoteChainSelector uint64 + Receiver common.Address + Amount *big.Int + LocalToken common.Address + SourcePoolAddress []byte + SourcePoolData []byte + OffchainTokenData []byte +} + +type PoolReleaseOrMintOutV1 struct { + DestinationAmount *big.Int +} + +type RateLimiterConfig struct { + IsEnabled bool + Capacity *big.Int + Rate *big.Int +} + +type RateLimiterTokenBucket struct { + Tokens *big.Int + LastUpdated uint32 + IsEnabled bool + Capacity *big.Int + Rate *big.Int +} + +type TokenPoolChainUpdate struct { + RemoteChainSelector uint64 + Allowed bool + RemotePoolAddress []byte + RemoteTokenAddress []byte + OutboundRateLimiterConfig RateLimiterConfig + InboundRateLimiterConfig RateLimiterConfig +} + +var TokenPoolMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[],\"name\":\"AllowListNotEnabled\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"}],\"name\":\"CallerIsNotARampOnRouter\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"}],\"name\":\"ChainAlreadyExists\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"ChainNotAllowed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"CursedByRMN\",\"type\":\"error\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"config\",\"type\":\"tuple\"}],\"name\":\"DisabledNonZeroRateLimit\",\"type\":\"error\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"rateLimiterConfig\",\"type\":\"tuple\"}],\"name\":\"InvalidRateLimitRate\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"sourcePoolAddress\",\"type\":\"bytes\"}],\"name\":\"InvalidSourcePoolAddress\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"InvalidToken\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"NonExistentChain\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RateLimitMustBeDisabled\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"SenderNotAllowed\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"}],\"name\":\"Unauthorized\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddressNotAllowed\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"AllowListAdd\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"AllowListRemove\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Burned\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"remoteToken\",\"type\":\"bytes\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"indexed\":false,\"internalType\":\"structRateLimiter.Config\",\"name\":\"outboundRateLimiterConfig\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"indexed\":false,\"internalType\":\"structRateLimiter.Config\",\"name\":\"inboundRateLimiterConfig\",\"type\":\"tuple\"}],\"name\":\"ChainAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"indexed\":false,\"internalType\":\"structRateLimiter.Config\",\"name\":\"outboundRateLimiterConfig\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"indexed\":false,\"internalType\":\"structRateLimiter.Config\",\"name\":\"inboundRateLimiterConfig\",\"type\":\"tuple\"}],\"name\":\"ChainConfigured\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"ChainRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"indexed\":false,\"internalType\":\"structRateLimiter.Config\",\"name\":\"config\",\"type\":\"tuple\"}],\"name\":\"ConfigChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Locked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Minted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Released\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"previousPoolAddress\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"remotePoolAddress\",\"type\":\"bytes\"}],\"name\":\"RemotePoolSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"oldRouter\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newRouter\",\"type\":\"address\"}],\"name\":\"RouterUpdated\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"removes\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"adds\",\"type\":\"address[]\"}],\"name\":\"applyAllowListUpdates\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"bool\",\"name\":\"allowed\",\"type\":\"bool\"},{\"internalType\":\"bytes\",\"name\":\"remotePoolAddress\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"remoteTokenAddress\",\"type\":\"bytes\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"outboundRateLimiterConfig\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"inboundRateLimiterConfig\",\"type\":\"tuple\"}],\"internalType\":\"structTokenPool.ChainUpdate[]\",\"name\":\"chains\",\"type\":\"tuple[]\"}],\"name\":\"applyChainUpdates\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAllowList\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAllowListEnabled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"getCurrentInboundRateLimiterState\",\"outputs\":[{\"components\":[{\"internalType\":\"uint128\",\"name\":\"tokens\",\"type\":\"uint128\"},{\"internalType\":\"uint32\",\"name\":\"lastUpdated\",\"type\":\"uint32\"},{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.TokenBucket\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"getCurrentOutboundRateLimiterState\",\"outputs\":[{\"components\":[{\"internalType\":\"uint128\",\"name\":\"tokens\",\"type\":\"uint128\"},{\"internalType\":\"uint32\",\"name\":\"lastUpdated\",\"type\":\"uint32\"},{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.TokenBucket\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRateLimitAdmin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"getRemotePool\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"getRemoteToken\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRmnProxy\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"rmnProxy\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRouter\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"router\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getSupportedChains\",\"outputs\":[{\"internalType\":\"uint64[]\",\"name\":\"\",\"type\":\"uint64[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getToken\",\"outputs\":[{\"internalType\":\"contractIERC20\",\"name\":\"token\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"isSupportedChain\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"isSupportedToken\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes\",\"name\":\"receiver\",\"type\":\"bytes\"},{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"originalSender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"localToken\",\"type\":\"address\"}],\"internalType\":\"structPool.LockOrBurnInV1\",\"name\":\"lockOrBurnIn\",\"type\":\"tuple\"}],\"name\":\"lockOrBurn\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes\",\"name\":\"destTokenAddress\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"destPoolData\",\"type\":\"bytes\"}],\"internalType\":\"structPool.LockOrBurnOutV1\",\"name\":\"lockOrBurnOut\",\"type\":\"tuple\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes\",\"name\":\"originalSender\",\"type\":\"bytes\"},{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"localToken\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"sourcePoolAddress\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"sourcePoolData\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"offchainTokenData\",\"type\":\"bytes\"}],\"internalType\":\"structPool.ReleaseOrMintInV1\",\"name\":\"releaseOrMintIn\",\"type\":\"tuple\"}],\"name\":\"releaseOrMint\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"destinationAmount\",\"type\":\"uint256\"}],\"internalType\":\"structPool.ReleaseOrMintOutV1\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"outboundConfig\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"inboundConfig\",\"type\":\"tuple\"}],\"name\":\"setChainRateLimiterConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"rateLimitAdmin\",\"type\":\"address\"}],\"name\":\"setRateLimitAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"remotePoolAddress\",\"type\":\"bytes\"}],\"name\":\"setRemotePool\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newRouter\",\"type\":\"address\"}],\"name\":\"setRouter\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", +} + +var TokenPoolABI = TokenPoolMetaData.ABI + +type TokenPool struct { + address common.Address + abi abi.ABI + TokenPoolCaller + TokenPoolTransactor + TokenPoolFilterer +} + +type TokenPoolCaller struct { + contract *bind.BoundContract +} + +type TokenPoolTransactor struct { + contract *bind.BoundContract +} + +type TokenPoolFilterer struct { + contract *bind.BoundContract +} + +type TokenPoolSession struct { + Contract *TokenPool + CallOpts bind.CallOpts + TransactOpts bind.TransactOpts +} + +type TokenPoolCallerSession struct { + Contract *TokenPoolCaller + CallOpts bind.CallOpts +} + +type TokenPoolTransactorSession struct { + Contract *TokenPoolTransactor + TransactOpts bind.TransactOpts +} + +type TokenPoolRaw struct { + Contract *TokenPool +} + +type TokenPoolCallerRaw struct { + Contract *TokenPoolCaller +} + +type TokenPoolTransactorRaw struct { + Contract *TokenPoolTransactor +} + +func NewTokenPool(address common.Address, backend bind.ContractBackend) (*TokenPool, error) { + abi, err := abi.JSON(strings.NewReader(TokenPoolABI)) + if err != nil { + return nil, err + } + contract, err := bindTokenPool(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &TokenPool{address: address, abi: abi, TokenPoolCaller: TokenPoolCaller{contract: contract}, TokenPoolTransactor: TokenPoolTransactor{contract: contract}, TokenPoolFilterer: TokenPoolFilterer{contract: contract}}, nil +} + +func NewTokenPoolCaller(address common.Address, caller bind.ContractCaller) (*TokenPoolCaller, error) { + contract, err := bindTokenPool(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &TokenPoolCaller{contract: contract}, nil +} + +func NewTokenPoolTransactor(address common.Address, transactor bind.ContractTransactor) (*TokenPoolTransactor, error) { + contract, err := bindTokenPool(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &TokenPoolTransactor{contract: contract}, nil +} + +func NewTokenPoolFilterer(address common.Address, filterer bind.ContractFilterer) (*TokenPoolFilterer, error) { + contract, err := bindTokenPool(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &TokenPoolFilterer{contract: contract}, nil +} + +func bindTokenPool(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := TokenPoolMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +func (_TokenPool *TokenPoolRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _TokenPool.Contract.TokenPoolCaller.contract.Call(opts, result, method, params...) +} + +func (_TokenPool *TokenPoolRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _TokenPool.Contract.TokenPoolTransactor.contract.Transfer(opts) +} + +func (_TokenPool *TokenPoolRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _TokenPool.Contract.TokenPoolTransactor.contract.Transact(opts, method, params...) +} + +func (_TokenPool *TokenPoolCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _TokenPool.Contract.contract.Call(opts, result, method, params...) +} + +func (_TokenPool *TokenPoolTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _TokenPool.Contract.contract.Transfer(opts) +} + +func (_TokenPool *TokenPoolTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _TokenPool.Contract.contract.Transact(opts, method, params...) +} + +func (_TokenPool *TokenPoolCaller) GetAllowList(opts *bind.CallOpts) ([]common.Address, error) { + var out []interface{} + err := _TokenPool.contract.Call(opts, &out, "getAllowList") + + if err != nil { + return *new([]common.Address), err + } + + out0 := *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) + + return out0, err + +} + +func (_TokenPool *TokenPoolSession) GetAllowList() ([]common.Address, error) { + return _TokenPool.Contract.GetAllowList(&_TokenPool.CallOpts) +} + +func (_TokenPool *TokenPoolCallerSession) GetAllowList() ([]common.Address, error) { + return _TokenPool.Contract.GetAllowList(&_TokenPool.CallOpts) +} + +func (_TokenPool *TokenPoolCaller) GetAllowListEnabled(opts *bind.CallOpts) (bool, error) { + var out []interface{} + err := _TokenPool.contract.Call(opts, &out, "getAllowListEnabled") + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_TokenPool *TokenPoolSession) GetAllowListEnabled() (bool, error) { + return _TokenPool.Contract.GetAllowListEnabled(&_TokenPool.CallOpts) +} + +func (_TokenPool *TokenPoolCallerSession) GetAllowListEnabled() (bool, error) { + return _TokenPool.Contract.GetAllowListEnabled(&_TokenPool.CallOpts) +} + +func (_TokenPool *TokenPoolCaller) GetCurrentInboundRateLimiterState(opts *bind.CallOpts, remoteChainSelector uint64) (RateLimiterTokenBucket, error) { + var out []interface{} + err := _TokenPool.contract.Call(opts, &out, "getCurrentInboundRateLimiterState", remoteChainSelector) + + if err != nil { + return *new(RateLimiterTokenBucket), err + } + + out0 := *abi.ConvertType(out[0], new(RateLimiterTokenBucket)).(*RateLimiterTokenBucket) + + return out0, err + +} + +func (_TokenPool *TokenPoolSession) GetCurrentInboundRateLimiterState(remoteChainSelector uint64) (RateLimiterTokenBucket, error) { + return _TokenPool.Contract.GetCurrentInboundRateLimiterState(&_TokenPool.CallOpts, remoteChainSelector) +} + +func (_TokenPool *TokenPoolCallerSession) GetCurrentInboundRateLimiterState(remoteChainSelector uint64) (RateLimiterTokenBucket, error) { + return _TokenPool.Contract.GetCurrentInboundRateLimiterState(&_TokenPool.CallOpts, remoteChainSelector) +} + +func (_TokenPool *TokenPoolCaller) GetCurrentOutboundRateLimiterState(opts *bind.CallOpts, remoteChainSelector uint64) (RateLimiterTokenBucket, error) { + var out []interface{} + err := _TokenPool.contract.Call(opts, &out, "getCurrentOutboundRateLimiterState", remoteChainSelector) + + if err != nil { + return *new(RateLimiterTokenBucket), err + } + + out0 := *abi.ConvertType(out[0], new(RateLimiterTokenBucket)).(*RateLimiterTokenBucket) + + return out0, err + +} + +func (_TokenPool *TokenPoolSession) GetCurrentOutboundRateLimiterState(remoteChainSelector uint64) (RateLimiterTokenBucket, error) { + return _TokenPool.Contract.GetCurrentOutboundRateLimiterState(&_TokenPool.CallOpts, remoteChainSelector) +} + +func (_TokenPool *TokenPoolCallerSession) GetCurrentOutboundRateLimiterState(remoteChainSelector uint64) (RateLimiterTokenBucket, error) { + return _TokenPool.Contract.GetCurrentOutboundRateLimiterState(&_TokenPool.CallOpts, remoteChainSelector) +} + +func (_TokenPool *TokenPoolCaller) GetRateLimitAdmin(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _TokenPool.contract.Call(opts, &out, "getRateLimitAdmin") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_TokenPool *TokenPoolSession) GetRateLimitAdmin() (common.Address, error) { + return _TokenPool.Contract.GetRateLimitAdmin(&_TokenPool.CallOpts) +} + +func (_TokenPool *TokenPoolCallerSession) GetRateLimitAdmin() (common.Address, error) { + return _TokenPool.Contract.GetRateLimitAdmin(&_TokenPool.CallOpts) +} + +func (_TokenPool *TokenPoolCaller) GetRemotePool(opts *bind.CallOpts, remoteChainSelector uint64) ([]byte, error) { + var out []interface{} + err := _TokenPool.contract.Call(opts, &out, "getRemotePool", remoteChainSelector) + + if err != nil { + return *new([]byte), err + } + + out0 := *abi.ConvertType(out[0], new([]byte)).(*[]byte) + + return out0, err + +} + +func (_TokenPool *TokenPoolSession) GetRemotePool(remoteChainSelector uint64) ([]byte, error) { + return _TokenPool.Contract.GetRemotePool(&_TokenPool.CallOpts, remoteChainSelector) +} + +func (_TokenPool *TokenPoolCallerSession) GetRemotePool(remoteChainSelector uint64) ([]byte, error) { + return _TokenPool.Contract.GetRemotePool(&_TokenPool.CallOpts, remoteChainSelector) +} + +func (_TokenPool *TokenPoolCaller) GetRemoteToken(opts *bind.CallOpts, remoteChainSelector uint64) ([]byte, error) { + var out []interface{} + err := _TokenPool.contract.Call(opts, &out, "getRemoteToken", remoteChainSelector) + + if err != nil { + return *new([]byte), err + } + + out0 := *abi.ConvertType(out[0], new([]byte)).(*[]byte) + + return out0, err + +} + +func (_TokenPool *TokenPoolSession) GetRemoteToken(remoteChainSelector uint64) ([]byte, error) { + return _TokenPool.Contract.GetRemoteToken(&_TokenPool.CallOpts, remoteChainSelector) +} + +func (_TokenPool *TokenPoolCallerSession) GetRemoteToken(remoteChainSelector uint64) ([]byte, error) { + return _TokenPool.Contract.GetRemoteToken(&_TokenPool.CallOpts, remoteChainSelector) +} + +func (_TokenPool *TokenPoolCaller) GetRmnProxy(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _TokenPool.contract.Call(opts, &out, "getRmnProxy") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_TokenPool *TokenPoolSession) GetRmnProxy() (common.Address, error) { + return _TokenPool.Contract.GetRmnProxy(&_TokenPool.CallOpts) +} + +func (_TokenPool *TokenPoolCallerSession) GetRmnProxy() (common.Address, error) { + return _TokenPool.Contract.GetRmnProxy(&_TokenPool.CallOpts) +} + +func (_TokenPool *TokenPoolCaller) GetRouter(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _TokenPool.contract.Call(opts, &out, "getRouter") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_TokenPool *TokenPoolSession) GetRouter() (common.Address, error) { + return _TokenPool.Contract.GetRouter(&_TokenPool.CallOpts) +} + +func (_TokenPool *TokenPoolCallerSession) GetRouter() (common.Address, error) { + return _TokenPool.Contract.GetRouter(&_TokenPool.CallOpts) +} + +func (_TokenPool *TokenPoolCaller) GetSupportedChains(opts *bind.CallOpts) ([]uint64, error) { + var out []interface{} + err := _TokenPool.contract.Call(opts, &out, "getSupportedChains") + + if err != nil { + return *new([]uint64), err + } + + out0 := *abi.ConvertType(out[0], new([]uint64)).(*[]uint64) + + return out0, err + +} + +func (_TokenPool *TokenPoolSession) GetSupportedChains() ([]uint64, error) { + return _TokenPool.Contract.GetSupportedChains(&_TokenPool.CallOpts) +} + +func (_TokenPool *TokenPoolCallerSession) GetSupportedChains() ([]uint64, error) { + return _TokenPool.Contract.GetSupportedChains(&_TokenPool.CallOpts) +} + +func (_TokenPool *TokenPoolCaller) GetToken(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _TokenPool.contract.Call(opts, &out, "getToken") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_TokenPool *TokenPoolSession) GetToken() (common.Address, error) { + return _TokenPool.Contract.GetToken(&_TokenPool.CallOpts) +} + +func (_TokenPool *TokenPoolCallerSession) GetToken() (common.Address, error) { + return _TokenPool.Contract.GetToken(&_TokenPool.CallOpts) +} + +func (_TokenPool *TokenPoolCaller) IsSupportedChain(opts *bind.CallOpts, remoteChainSelector uint64) (bool, error) { + var out []interface{} + err := _TokenPool.contract.Call(opts, &out, "isSupportedChain", remoteChainSelector) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_TokenPool *TokenPoolSession) IsSupportedChain(remoteChainSelector uint64) (bool, error) { + return _TokenPool.Contract.IsSupportedChain(&_TokenPool.CallOpts, remoteChainSelector) +} + +func (_TokenPool *TokenPoolCallerSession) IsSupportedChain(remoteChainSelector uint64) (bool, error) { + return _TokenPool.Contract.IsSupportedChain(&_TokenPool.CallOpts, remoteChainSelector) +} + +func (_TokenPool *TokenPoolCaller) IsSupportedToken(opts *bind.CallOpts, token common.Address) (bool, error) { + var out []interface{} + err := _TokenPool.contract.Call(opts, &out, "isSupportedToken", token) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_TokenPool *TokenPoolSession) IsSupportedToken(token common.Address) (bool, error) { + return _TokenPool.Contract.IsSupportedToken(&_TokenPool.CallOpts, token) +} + +func (_TokenPool *TokenPoolCallerSession) IsSupportedToken(token common.Address) (bool, error) { + return _TokenPool.Contract.IsSupportedToken(&_TokenPool.CallOpts, token) +} + +func (_TokenPool *TokenPoolCaller) Owner(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _TokenPool.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 + +} + +func (_TokenPool *TokenPoolSession) Owner() (common.Address, error) { + return _TokenPool.Contract.Owner(&_TokenPool.CallOpts) +} + +func (_TokenPool *TokenPoolCallerSession) Owner() (common.Address, error) { + return _TokenPool.Contract.Owner(&_TokenPool.CallOpts) +} + +func (_TokenPool *TokenPoolCaller) SupportsInterface(opts *bind.CallOpts, interfaceId [4]byte) (bool, error) { + var out []interface{} + err := _TokenPool.contract.Call(opts, &out, "supportsInterface", interfaceId) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_TokenPool *TokenPoolSession) SupportsInterface(interfaceId [4]byte) (bool, error) { + return _TokenPool.Contract.SupportsInterface(&_TokenPool.CallOpts, interfaceId) +} + +func (_TokenPool *TokenPoolCallerSession) SupportsInterface(interfaceId [4]byte) (bool, error) { + return _TokenPool.Contract.SupportsInterface(&_TokenPool.CallOpts, interfaceId) +} + +func (_TokenPool *TokenPoolTransactor) AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + return _TokenPool.contract.Transact(opts, "acceptOwnership") +} + +func (_TokenPool *TokenPoolSession) AcceptOwnership() (*types.Transaction, error) { + return _TokenPool.Contract.AcceptOwnership(&_TokenPool.TransactOpts) +} + +func (_TokenPool *TokenPoolTransactorSession) AcceptOwnership() (*types.Transaction, error) { + return _TokenPool.Contract.AcceptOwnership(&_TokenPool.TransactOpts) +} + +func (_TokenPool *TokenPoolTransactor) ApplyAllowListUpdates(opts *bind.TransactOpts, removes []common.Address, adds []common.Address) (*types.Transaction, error) { + return _TokenPool.contract.Transact(opts, "applyAllowListUpdates", removes, adds) +} + +func (_TokenPool *TokenPoolSession) ApplyAllowListUpdates(removes []common.Address, adds []common.Address) (*types.Transaction, error) { + return _TokenPool.Contract.ApplyAllowListUpdates(&_TokenPool.TransactOpts, removes, adds) +} + +func (_TokenPool *TokenPoolTransactorSession) ApplyAllowListUpdates(removes []common.Address, adds []common.Address) (*types.Transaction, error) { + return _TokenPool.Contract.ApplyAllowListUpdates(&_TokenPool.TransactOpts, removes, adds) +} + +func (_TokenPool *TokenPoolTransactor) ApplyChainUpdates(opts *bind.TransactOpts, chains []TokenPoolChainUpdate) (*types.Transaction, error) { + return _TokenPool.contract.Transact(opts, "applyChainUpdates", chains) +} + +func (_TokenPool *TokenPoolSession) ApplyChainUpdates(chains []TokenPoolChainUpdate) (*types.Transaction, error) { + return _TokenPool.Contract.ApplyChainUpdates(&_TokenPool.TransactOpts, chains) +} + +func (_TokenPool *TokenPoolTransactorSession) ApplyChainUpdates(chains []TokenPoolChainUpdate) (*types.Transaction, error) { + return _TokenPool.Contract.ApplyChainUpdates(&_TokenPool.TransactOpts, chains) +} + +func (_TokenPool *TokenPoolTransactor) LockOrBurn(opts *bind.TransactOpts, lockOrBurnIn PoolLockOrBurnInV1) (*types.Transaction, error) { + return _TokenPool.contract.Transact(opts, "lockOrBurn", lockOrBurnIn) +} + +func (_TokenPool *TokenPoolSession) LockOrBurn(lockOrBurnIn PoolLockOrBurnInV1) (*types.Transaction, error) { + return _TokenPool.Contract.LockOrBurn(&_TokenPool.TransactOpts, lockOrBurnIn) +} + +func (_TokenPool *TokenPoolTransactorSession) LockOrBurn(lockOrBurnIn PoolLockOrBurnInV1) (*types.Transaction, error) { + return _TokenPool.Contract.LockOrBurn(&_TokenPool.TransactOpts, lockOrBurnIn) +} + +func (_TokenPool *TokenPoolTransactor) ReleaseOrMint(opts *bind.TransactOpts, releaseOrMintIn PoolReleaseOrMintInV1) (*types.Transaction, error) { + return _TokenPool.contract.Transact(opts, "releaseOrMint", releaseOrMintIn) +} + +func (_TokenPool *TokenPoolSession) ReleaseOrMint(releaseOrMintIn PoolReleaseOrMintInV1) (*types.Transaction, error) { + return _TokenPool.Contract.ReleaseOrMint(&_TokenPool.TransactOpts, releaseOrMintIn) +} + +func (_TokenPool *TokenPoolTransactorSession) ReleaseOrMint(releaseOrMintIn PoolReleaseOrMintInV1) (*types.Transaction, error) { + return _TokenPool.Contract.ReleaseOrMint(&_TokenPool.TransactOpts, releaseOrMintIn) +} + +func (_TokenPool *TokenPoolTransactor) SetChainRateLimiterConfig(opts *bind.TransactOpts, remoteChainSelector uint64, outboundConfig RateLimiterConfig, inboundConfig RateLimiterConfig) (*types.Transaction, error) { + return _TokenPool.contract.Transact(opts, "setChainRateLimiterConfig", remoteChainSelector, outboundConfig, inboundConfig) +} + +func (_TokenPool *TokenPoolSession) SetChainRateLimiterConfig(remoteChainSelector uint64, outboundConfig RateLimiterConfig, inboundConfig RateLimiterConfig) (*types.Transaction, error) { + return _TokenPool.Contract.SetChainRateLimiterConfig(&_TokenPool.TransactOpts, remoteChainSelector, outboundConfig, inboundConfig) +} + +func (_TokenPool *TokenPoolTransactorSession) SetChainRateLimiterConfig(remoteChainSelector uint64, outboundConfig RateLimiterConfig, inboundConfig RateLimiterConfig) (*types.Transaction, error) { + return _TokenPool.Contract.SetChainRateLimiterConfig(&_TokenPool.TransactOpts, remoteChainSelector, outboundConfig, inboundConfig) +} + +func (_TokenPool *TokenPoolTransactor) SetRateLimitAdmin(opts *bind.TransactOpts, rateLimitAdmin common.Address) (*types.Transaction, error) { + return _TokenPool.contract.Transact(opts, "setRateLimitAdmin", rateLimitAdmin) +} + +func (_TokenPool *TokenPoolSession) SetRateLimitAdmin(rateLimitAdmin common.Address) (*types.Transaction, error) { + return _TokenPool.Contract.SetRateLimitAdmin(&_TokenPool.TransactOpts, rateLimitAdmin) +} + +func (_TokenPool *TokenPoolTransactorSession) SetRateLimitAdmin(rateLimitAdmin common.Address) (*types.Transaction, error) { + return _TokenPool.Contract.SetRateLimitAdmin(&_TokenPool.TransactOpts, rateLimitAdmin) +} + +func (_TokenPool *TokenPoolTransactor) SetRemotePool(opts *bind.TransactOpts, remoteChainSelector uint64, remotePoolAddress []byte) (*types.Transaction, error) { + return _TokenPool.contract.Transact(opts, "setRemotePool", remoteChainSelector, remotePoolAddress) +} + +func (_TokenPool *TokenPoolSession) SetRemotePool(remoteChainSelector uint64, remotePoolAddress []byte) (*types.Transaction, error) { + return _TokenPool.Contract.SetRemotePool(&_TokenPool.TransactOpts, remoteChainSelector, remotePoolAddress) +} + +func (_TokenPool *TokenPoolTransactorSession) SetRemotePool(remoteChainSelector uint64, remotePoolAddress []byte) (*types.Transaction, error) { + return _TokenPool.Contract.SetRemotePool(&_TokenPool.TransactOpts, remoteChainSelector, remotePoolAddress) +} + +func (_TokenPool *TokenPoolTransactor) SetRouter(opts *bind.TransactOpts, newRouter common.Address) (*types.Transaction, error) { + return _TokenPool.contract.Transact(opts, "setRouter", newRouter) +} + +func (_TokenPool *TokenPoolSession) SetRouter(newRouter common.Address) (*types.Transaction, error) { + return _TokenPool.Contract.SetRouter(&_TokenPool.TransactOpts, newRouter) +} + +func (_TokenPool *TokenPoolTransactorSession) SetRouter(newRouter common.Address) (*types.Transaction, error) { + return _TokenPool.Contract.SetRouter(&_TokenPool.TransactOpts, newRouter) +} + +func (_TokenPool *TokenPoolTransactor) TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) { + return _TokenPool.contract.Transact(opts, "transferOwnership", to) +} + +func (_TokenPool *TokenPoolSession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _TokenPool.Contract.TransferOwnership(&_TokenPool.TransactOpts, to) +} + +func (_TokenPool *TokenPoolTransactorSession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _TokenPool.Contract.TransferOwnership(&_TokenPool.TransactOpts, to) +} + +type TokenPoolAllowListAddIterator struct { + Event *TokenPoolAllowListAdd + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *TokenPoolAllowListAddIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(TokenPoolAllowListAdd) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(TokenPoolAllowListAdd) + 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() + } +} + +func (it *TokenPoolAllowListAddIterator) Error() error { + return it.fail +} + +func (it *TokenPoolAllowListAddIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type TokenPoolAllowListAdd struct { + Sender common.Address + Raw types.Log +} + +func (_TokenPool *TokenPoolFilterer) FilterAllowListAdd(opts *bind.FilterOpts) (*TokenPoolAllowListAddIterator, error) { + + logs, sub, err := _TokenPool.contract.FilterLogs(opts, "AllowListAdd") + if err != nil { + return nil, err + } + return &TokenPoolAllowListAddIterator{contract: _TokenPool.contract, event: "AllowListAdd", logs: logs, sub: sub}, nil +} + +func (_TokenPool *TokenPoolFilterer) WatchAllowListAdd(opts *bind.WatchOpts, sink chan<- *TokenPoolAllowListAdd) (event.Subscription, error) { + + logs, sub, err := _TokenPool.contract.WatchLogs(opts, "AllowListAdd") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(TokenPoolAllowListAdd) + if err := _TokenPool.contract.UnpackLog(event, "AllowListAdd", 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 +} + +func (_TokenPool *TokenPoolFilterer) ParseAllowListAdd(log types.Log) (*TokenPoolAllowListAdd, error) { + event := new(TokenPoolAllowListAdd) + if err := _TokenPool.contract.UnpackLog(event, "AllowListAdd", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type TokenPoolAllowListRemoveIterator struct { + Event *TokenPoolAllowListRemove + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *TokenPoolAllowListRemoveIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(TokenPoolAllowListRemove) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(TokenPoolAllowListRemove) + 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() + } +} + +func (it *TokenPoolAllowListRemoveIterator) Error() error { + return it.fail +} + +func (it *TokenPoolAllowListRemoveIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type TokenPoolAllowListRemove struct { + Sender common.Address + Raw types.Log +} + +func (_TokenPool *TokenPoolFilterer) FilterAllowListRemove(opts *bind.FilterOpts) (*TokenPoolAllowListRemoveIterator, error) { + + logs, sub, err := _TokenPool.contract.FilterLogs(opts, "AllowListRemove") + if err != nil { + return nil, err + } + return &TokenPoolAllowListRemoveIterator{contract: _TokenPool.contract, event: "AllowListRemove", logs: logs, sub: sub}, nil +} + +func (_TokenPool *TokenPoolFilterer) WatchAllowListRemove(opts *bind.WatchOpts, sink chan<- *TokenPoolAllowListRemove) (event.Subscription, error) { + + logs, sub, err := _TokenPool.contract.WatchLogs(opts, "AllowListRemove") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(TokenPoolAllowListRemove) + if err := _TokenPool.contract.UnpackLog(event, "AllowListRemove", 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 +} + +func (_TokenPool *TokenPoolFilterer) ParseAllowListRemove(log types.Log) (*TokenPoolAllowListRemove, error) { + event := new(TokenPoolAllowListRemove) + if err := _TokenPool.contract.UnpackLog(event, "AllowListRemove", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type TokenPoolBurnedIterator struct { + Event *TokenPoolBurned + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *TokenPoolBurnedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(TokenPoolBurned) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(TokenPoolBurned) + 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() + } +} + +func (it *TokenPoolBurnedIterator) Error() error { + return it.fail +} + +func (it *TokenPoolBurnedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type TokenPoolBurned struct { + Sender common.Address + Amount *big.Int + Raw types.Log +} + +func (_TokenPool *TokenPoolFilterer) FilterBurned(opts *bind.FilterOpts, sender []common.Address) (*TokenPoolBurnedIterator, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _TokenPool.contract.FilterLogs(opts, "Burned", senderRule) + if err != nil { + return nil, err + } + return &TokenPoolBurnedIterator{contract: _TokenPool.contract, event: "Burned", logs: logs, sub: sub}, nil +} + +func (_TokenPool *TokenPoolFilterer) WatchBurned(opts *bind.WatchOpts, sink chan<- *TokenPoolBurned, sender []common.Address) (event.Subscription, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _TokenPool.contract.WatchLogs(opts, "Burned", senderRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(TokenPoolBurned) + if err := _TokenPool.contract.UnpackLog(event, "Burned", 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 +} + +func (_TokenPool *TokenPoolFilterer) ParseBurned(log types.Log) (*TokenPoolBurned, error) { + event := new(TokenPoolBurned) + if err := _TokenPool.contract.UnpackLog(event, "Burned", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type TokenPoolChainAddedIterator struct { + Event *TokenPoolChainAdded + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *TokenPoolChainAddedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(TokenPoolChainAdded) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(TokenPoolChainAdded) + 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() + } +} + +func (it *TokenPoolChainAddedIterator) Error() error { + return it.fail +} + +func (it *TokenPoolChainAddedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type TokenPoolChainAdded struct { + RemoteChainSelector uint64 + RemoteToken []byte + OutboundRateLimiterConfig RateLimiterConfig + InboundRateLimiterConfig RateLimiterConfig + Raw types.Log +} + +func (_TokenPool *TokenPoolFilterer) FilterChainAdded(opts *bind.FilterOpts) (*TokenPoolChainAddedIterator, error) { + + logs, sub, err := _TokenPool.contract.FilterLogs(opts, "ChainAdded") + if err != nil { + return nil, err + } + return &TokenPoolChainAddedIterator{contract: _TokenPool.contract, event: "ChainAdded", logs: logs, sub: sub}, nil +} + +func (_TokenPool *TokenPoolFilterer) WatchChainAdded(opts *bind.WatchOpts, sink chan<- *TokenPoolChainAdded) (event.Subscription, error) { + + logs, sub, err := _TokenPool.contract.WatchLogs(opts, "ChainAdded") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(TokenPoolChainAdded) + if err := _TokenPool.contract.UnpackLog(event, "ChainAdded", 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 +} + +func (_TokenPool *TokenPoolFilterer) ParseChainAdded(log types.Log) (*TokenPoolChainAdded, error) { + event := new(TokenPoolChainAdded) + if err := _TokenPool.contract.UnpackLog(event, "ChainAdded", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type TokenPoolChainConfiguredIterator struct { + Event *TokenPoolChainConfigured + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *TokenPoolChainConfiguredIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(TokenPoolChainConfigured) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(TokenPoolChainConfigured) + 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() + } +} + +func (it *TokenPoolChainConfiguredIterator) Error() error { + return it.fail +} + +func (it *TokenPoolChainConfiguredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type TokenPoolChainConfigured struct { + RemoteChainSelector uint64 + OutboundRateLimiterConfig RateLimiterConfig + InboundRateLimiterConfig RateLimiterConfig + Raw types.Log +} + +func (_TokenPool *TokenPoolFilterer) FilterChainConfigured(opts *bind.FilterOpts) (*TokenPoolChainConfiguredIterator, error) { + + logs, sub, err := _TokenPool.contract.FilterLogs(opts, "ChainConfigured") + if err != nil { + return nil, err + } + return &TokenPoolChainConfiguredIterator{contract: _TokenPool.contract, event: "ChainConfigured", logs: logs, sub: sub}, nil +} + +func (_TokenPool *TokenPoolFilterer) WatchChainConfigured(opts *bind.WatchOpts, sink chan<- *TokenPoolChainConfigured) (event.Subscription, error) { + + logs, sub, err := _TokenPool.contract.WatchLogs(opts, "ChainConfigured") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(TokenPoolChainConfigured) + if err := _TokenPool.contract.UnpackLog(event, "ChainConfigured", 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 +} + +func (_TokenPool *TokenPoolFilterer) ParseChainConfigured(log types.Log) (*TokenPoolChainConfigured, error) { + event := new(TokenPoolChainConfigured) + if err := _TokenPool.contract.UnpackLog(event, "ChainConfigured", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type TokenPoolChainRemovedIterator struct { + Event *TokenPoolChainRemoved + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *TokenPoolChainRemovedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(TokenPoolChainRemoved) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(TokenPoolChainRemoved) + 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() + } +} + +func (it *TokenPoolChainRemovedIterator) Error() error { + return it.fail +} + +func (it *TokenPoolChainRemovedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type TokenPoolChainRemoved struct { + RemoteChainSelector uint64 + Raw types.Log +} + +func (_TokenPool *TokenPoolFilterer) FilterChainRemoved(opts *bind.FilterOpts) (*TokenPoolChainRemovedIterator, error) { + + logs, sub, err := _TokenPool.contract.FilterLogs(opts, "ChainRemoved") + if err != nil { + return nil, err + } + return &TokenPoolChainRemovedIterator{contract: _TokenPool.contract, event: "ChainRemoved", logs: logs, sub: sub}, nil +} + +func (_TokenPool *TokenPoolFilterer) WatchChainRemoved(opts *bind.WatchOpts, sink chan<- *TokenPoolChainRemoved) (event.Subscription, error) { + + logs, sub, err := _TokenPool.contract.WatchLogs(opts, "ChainRemoved") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(TokenPoolChainRemoved) + if err := _TokenPool.contract.UnpackLog(event, "ChainRemoved", 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 +} + +func (_TokenPool *TokenPoolFilterer) ParseChainRemoved(log types.Log) (*TokenPoolChainRemoved, error) { + event := new(TokenPoolChainRemoved) + if err := _TokenPool.contract.UnpackLog(event, "ChainRemoved", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type TokenPoolConfigChangedIterator struct { + Event *TokenPoolConfigChanged + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *TokenPoolConfigChangedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(TokenPoolConfigChanged) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(TokenPoolConfigChanged) + 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() + } +} + +func (it *TokenPoolConfigChangedIterator) Error() error { + return it.fail +} + +func (it *TokenPoolConfigChangedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type TokenPoolConfigChanged struct { + Config RateLimiterConfig + Raw types.Log +} + +func (_TokenPool *TokenPoolFilterer) FilterConfigChanged(opts *bind.FilterOpts) (*TokenPoolConfigChangedIterator, error) { + + logs, sub, err := _TokenPool.contract.FilterLogs(opts, "ConfigChanged") + if err != nil { + return nil, err + } + return &TokenPoolConfigChangedIterator{contract: _TokenPool.contract, event: "ConfigChanged", logs: logs, sub: sub}, nil +} + +func (_TokenPool *TokenPoolFilterer) WatchConfigChanged(opts *bind.WatchOpts, sink chan<- *TokenPoolConfigChanged) (event.Subscription, error) { + + logs, sub, err := _TokenPool.contract.WatchLogs(opts, "ConfigChanged") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(TokenPoolConfigChanged) + if err := _TokenPool.contract.UnpackLog(event, "ConfigChanged", 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 +} + +func (_TokenPool *TokenPoolFilterer) ParseConfigChanged(log types.Log) (*TokenPoolConfigChanged, error) { + event := new(TokenPoolConfigChanged) + if err := _TokenPool.contract.UnpackLog(event, "ConfigChanged", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type TokenPoolLockedIterator struct { + Event *TokenPoolLocked + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *TokenPoolLockedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(TokenPoolLocked) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(TokenPoolLocked) + 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() + } +} + +func (it *TokenPoolLockedIterator) Error() error { + return it.fail +} + +func (it *TokenPoolLockedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type TokenPoolLocked struct { + Sender common.Address + Amount *big.Int + Raw types.Log +} + +func (_TokenPool *TokenPoolFilterer) FilterLocked(opts *bind.FilterOpts, sender []common.Address) (*TokenPoolLockedIterator, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _TokenPool.contract.FilterLogs(opts, "Locked", senderRule) + if err != nil { + return nil, err + } + return &TokenPoolLockedIterator{contract: _TokenPool.contract, event: "Locked", logs: logs, sub: sub}, nil +} + +func (_TokenPool *TokenPoolFilterer) WatchLocked(opts *bind.WatchOpts, sink chan<- *TokenPoolLocked, sender []common.Address) (event.Subscription, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _TokenPool.contract.WatchLogs(opts, "Locked", senderRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(TokenPoolLocked) + if err := _TokenPool.contract.UnpackLog(event, "Locked", 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 +} + +func (_TokenPool *TokenPoolFilterer) ParseLocked(log types.Log) (*TokenPoolLocked, error) { + event := new(TokenPoolLocked) + if err := _TokenPool.contract.UnpackLog(event, "Locked", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type TokenPoolMintedIterator struct { + Event *TokenPoolMinted + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *TokenPoolMintedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(TokenPoolMinted) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(TokenPoolMinted) + 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() + } +} + +func (it *TokenPoolMintedIterator) Error() error { + return it.fail +} + +func (it *TokenPoolMintedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type TokenPoolMinted struct { + Sender common.Address + Recipient common.Address + Amount *big.Int + Raw types.Log +} + +func (_TokenPool *TokenPoolFilterer) FilterMinted(opts *bind.FilterOpts, sender []common.Address, recipient []common.Address) (*TokenPoolMintedIterator, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + var recipientRule []interface{} + for _, recipientItem := range recipient { + recipientRule = append(recipientRule, recipientItem) + } + + logs, sub, err := _TokenPool.contract.FilterLogs(opts, "Minted", senderRule, recipientRule) + if err != nil { + return nil, err + } + return &TokenPoolMintedIterator{contract: _TokenPool.contract, event: "Minted", logs: logs, sub: sub}, nil +} + +func (_TokenPool *TokenPoolFilterer) WatchMinted(opts *bind.WatchOpts, sink chan<- *TokenPoolMinted, sender []common.Address, recipient []common.Address) (event.Subscription, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + var recipientRule []interface{} + for _, recipientItem := range recipient { + recipientRule = append(recipientRule, recipientItem) + } + + logs, sub, err := _TokenPool.contract.WatchLogs(opts, "Minted", senderRule, recipientRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(TokenPoolMinted) + if err := _TokenPool.contract.UnpackLog(event, "Minted", 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 +} + +func (_TokenPool *TokenPoolFilterer) ParseMinted(log types.Log) (*TokenPoolMinted, error) { + event := new(TokenPoolMinted) + if err := _TokenPool.contract.UnpackLog(event, "Minted", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type TokenPoolOwnershipTransferRequestedIterator struct { + Event *TokenPoolOwnershipTransferRequested + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *TokenPoolOwnershipTransferRequestedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(TokenPoolOwnershipTransferRequested) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(TokenPoolOwnershipTransferRequested) + 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() + } +} + +func (it *TokenPoolOwnershipTransferRequestedIterator) Error() error { + return it.fail +} + +func (it *TokenPoolOwnershipTransferRequestedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type TokenPoolOwnershipTransferRequested struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_TokenPool *TokenPoolFilterer) FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*TokenPoolOwnershipTransferRequestedIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _TokenPool.contract.FilterLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return &TokenPoolOwnershipTransferRequestedIterator{contract: _TokenPool.contract, event: "OwnershipTransferRequested", logs: logs, sub: sub}, nil +} + +func (_TokenPool *TokenPoolFilterer) WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *TokenPoolOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _TokenPool.contract.WatchLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(TokenPoolOwnershipTransferRequested) + if err := _TokenPool.contract.UnpackLog(event, "OwnershipTransferRequested", 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 +} + +func (_TokenPool *TokenPoolFilterer) ParseOwnershipTransferRequested(log types.Log) (*TokenPoolOwnershipTransferRequested, error) { + event := new(TokenPoolOwnershipTransferRequested) + if err := _TokenPool.contract.UnpackLog(event, "OwnershipTransferRequested", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type TokenPoolOwnershipTransferredIterator struct { + Event *TokenPoolOwnershipTransferred + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *TokenPoolOwnershipTransferredIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(TokenPoolOwnershipTransferred) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(TokenPoolOwnershipTransferred) + 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() + } +} + +func (it *TokenPoolOwnershipTransferredIterator) Error() error { + return it.fail +} + +func (it *TokenPoolOwnershipTransferredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type TokenPoolOwnershipTransferred struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_TokenPool *TokenPoolFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*TokenPoolOwnershipTransferredIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _TokenPool.contract.FilterLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return &TokenPoolOwnershipTransferredIterator{contract: _TokenPool.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil +} + +func (_TokenPool *TokenPoolFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *TokenPoolOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _TokenPool.contract.WatchLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(TokenPoolOwnershipTransferred) + if err := _TokenPool.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 +} + +func (_TokenPool *TokenPoolFilterer) ParseOwnershipTransferred(log types.Log) (*TokenPoolOwnershipTransferred, error) { + event := new(TokenPoolOwnershipTransferred) + if err := _TokenPool.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type TokenPoolReleasedIterator struct { + Event *TokenPoolReleased + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *TokenPoolReleasedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(TokenPoolReleased) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(TokenPoolReleased) + 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() + } +} + +func (it *TokenPoolReleasedIterator) Error() error { + return it.fail +} + +func (it *TokenPoolReleasedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type TokenPoolReleased struct { + Sender common.Address + Recipient common.Address + Amount *big.Int + Raw types.Log +} + +func (_TokenPool *TokenPoolFilterer) FilterReleased(opts *bind.FilterOpts, sender []common.Address, recipient []common.Address) (*TokenPoolReleasedIterator, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + var recipientRule []interface{} + for _, recipientItem := range recipient { + recipientRule = append(recipientRule, recipientItem) + } + + logs, sub, err := _TokenPool.contract.FilterLogs(opts, "Released", senderRule, recipientRule) + if err != nil { + return nil, err + } + return &TokenPoolReleasedIterator{contract: _TokenPool.contract, event: "Released", logs: logs, sub: sub}, nil +} + +func (_TokenPool *TokenPoolFilterer) WatchReleased(opts *bind.WatchOpts, sink chan<- *TokenPoolReleased, sender []common.Address, recipient []common.Address) (event.Subscription, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + var recipientRule []interface{} + for _, recipientItem := range recipient { + recipientRule = append(recipientRule, recipientItem) + } + + logs, sub, err := _TokenPool.contract.WatchLogs(opts, "Released", senderRule, recipientRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(TokenPoolReleased) + if err := _TokenPool.contract.UnpackLog(event, "Released", 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 +} + +func (_TokenPool *TokenPoolFilterer) ParseReleased(log types.Log) (*TokenPoolReleased, error) { + event := new(TokenPoolReleased) + if err := _TokenPool.contract.UnpackLog(event, "Released", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type TokenPoolRemotePoolSetIterator struct { + Event *TokenPoolRemotePoolSet + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *TokenPoolRemotePoolSetIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(TokenPoolRemotePoolSet) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(TokenPoolRemotePoolSet) + 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() + } +} + +func (it *TokenPoolRemotePoolSetIterator) Error() error { + return it.fail +} + +func (it *TokenPoolRemotePoolSetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type TokenPoolRemotePoolSet struct { + RemoteChainSelector uint64 + PreviousPoolAddress []byte + RemotePoolAddress []byte + Raw types.Log +} + +func (_TokenPool *TokenPoolFilterer) FilterRemotePoolSet(opts *bind.FilterOpts, remoteChainSelector []uint64) (*TokenPoolRemotePoolSetIterator, error) { + + var remoteChainSelectorRule []interface{} + for _, remoteChainSelectorItem := range remoteChainSelector { + remoteChainSelectorRule = append(remoteChainSelectorRule, remoteChainSelectorItem) + } + + logs, sub, err := _TokenPool.contract.FilterLogs(opts, "RemotePoolSet", remoteChainSelectorRule) + if err != nil { + return nil, err + } + return &TokenPoolRemotePoolSetIterator{contract: _TokenPool.contract, event: "RemotePoolSet", logs: logs, sub: sub}, nil +} + +func (_TokenPool *TokenPoolFilterer) WatchRemotePoolSet(opts *bind.WatchOpts, sink chan<- *TokenPoolRemotePoolSet, remoteChainSelector []uint64) (event.Subscription, error) { + + var remoteChainSelectorRule []interface{} + for _, remoteChainSelectorItem := range remoteChainSelector { + remoteChainSelectorRule = append(remoteChainSelectorRule, remoteChainSelectorItem) + } + + logs, sub, err := _TokenPool.contract.WatchLogs(opts, "RemotePoolSet", remoteChainSelectorRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(TokenPoolRemotePoolSet) + if err := _TokenPool.contract.UnpackLog(event, "RemotePoolSet", 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 +} + +func (_TokenPool *TokenPoolFilterer) ParseRemotePoolSet(log types.Log) (*TokenPoolRemotePoolSet, error) { + event := new(TokenPoolRemotePoolSet) + if err := _TokenPool.contract.UnpackLog(event, "RemotePoolSet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type TokenPoolRouterUpdatedIterator struct { + Event *TokenPoolRouterUpdated + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *TokenPoolRouterUpdatedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(TokenPoolRouterUpdated) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(TokenPoolRouterUpdated) + 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() + } +} + +func (it *TokenPoolRouterUpdatedIterator) Error() error { + return it.fail +} + +func (it *TokenPoolRouterUpdatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type TokenPoolRouterUpdated struct { + OldRouter common.Address + NewRouter common.Address + Raw types.Log +} + +func (_TokenPool *TokenPoolFilterer) FilterRouterUpdated(opts *bind.FilterOpts) (*TokenPoolRouterUpdatedIterator, error) { + + logs, sub, err := _TokenPool.contract.FilterLogs(opts, "RouterUpdated") + if err != nil { + return nil, err + } + return &TokenPoolRouterUpdatedIterator{contract: _TokenPool.contract, event: "RouterUpdated", logs: logs, sub: sub}, nil +} + +func (_TokenPool *TokenPoolFilterer) WatchRouterUpdated(opts *bind.WatchOpts, sink chan<- *TokenPoolRouterUpdated) (event.Subscription, error) { + + logs, sub, err := _TokenPool.contract.WatchLogs(opts, "RouterUpdated") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(TokenPoolRouterUpdated) + if err := _TokenPool.contract.UnpackLog(event, "RouterUpdated", 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 +} + +func (_TokenPool *TokenPoolFilterer) ParseRouterUpdated(log types.Log) (*TokenPoolRouterUpdated, error) { + event := new(TokenPoolRouterUpdated) + if err := _TokenPool.contract.UnpackLog(event, "RouterUpdated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +func (_TokenPool *TokenPool) ParseLog(log types.Log) (generated.AbigenLog, error) { + switch log.Topics[0] { + case _TokenPool.abi.Events["AllowListAdd"].ID: + return _TokenPool.ParseAllowListAdd(log) + case _TokenPool.abi.Events["AllowListRemove"].ID: + return _TokenPool.ParseAllowListRemove(log) + case _TokenPool.abi.Events["Burned"].ID: + return _TokenPool.ParseBurned(log) + case _TokenPool.abi.Events["ChainAdded"].ID: + return _TokenPool.ParseChainAdded(log) + case _TokenPool.abi.Events["ChainConfigured"].ID: + return _TokenPool.ParseChainConfigured(log) + case _TokenPool.abi.Events["ChainRemoved"].ID: + return _TokenPool.ParseChainRemoved(log) + case _TokenPool.abi.Events["ConfigChanged"].ID: + return _TokenPool.ParseConfigChanged(log) + case _TokenPool.abi.Events["Locked"].ID: + return _TokenPool.ParseLocked(log) + case _TokenPool.abi.Events["Minted"].ID: + return _TokenPool.ParseMinted(log) + case _TokenPool.abi.Events["OwnershipTransferRequested"].ID: + return _TokenPool.ParseOwnershipTransferRequested(log) + case _TokenPool.abi.Events["OwnershipTransferred"].ID: + return _TokenPool.ParseOwnershipTransferred(log) + case _TokenPool.abi.Events["Released"].ID: + return _TokenPool.ParseReleased(log) + case _TokenPool.abi.Events["RemotePoolSet"].ID: + return _TokenPool.ParseRemotePoolSet(log) + case _TokenPool.abi.Events["RouterUpdated"].ID: + return _TokenPool.ParseRouterUpdated(log) + + default: + return nil, fmt.Errorf("abigen wrapper received unknown log topic: %v", log.Topics[0]) + } +} + +func (TokenPoolAllowListAdd) Topic() common.Hash { + return common.HexToHash("0x2640d4d76caf8bf478aabfa982fa4e1c4eb71a37f93cd15e80dbc657911546d8") +} + +func (TokenPoolAllowListRemove) Topic() common.Hash { + return common.HexToHash("0x800671136ab6cfee9fbe5ed1fb7ca417811aca3cf864800d127b927adedf7566") +} + +func (TokenPoolBurned) Topic() common.Hash { + return common.HexToHash("0x696de425f79f4a40bc6d2122ca50507f0efbeabbff86a84871b7196ab8ea8df7") +} + +func (TokenPoolChainAdded) Topic() common.Hash { + return common.HexToHash("0x8d340f17e19058004c20453540862a9c62778504476f6756755cb33bcd6c38c2") +} + +func (TokenPoolChainConfigured) Topic() common.Hash { + return common.HexToHash("0x0350d63aa5f270e01729d00d627eeb8f3429772b1818c016c66a588a864f912b") +} + +func (TokenPoolChainRemoved) Topic() common.Hash { + return common.HexToHash("0x5204aec90a3c794d8e90fded8b46ae9c7c552803e7e832e0c1d358396d859916") +} + +func (TokenPoolConfigChanged) Topic() common.Hash { + return common.HexToHash("0x9ea3374b67bf275e6bb9c8ae68f9cae023e1c528b4b27e092f0bb209d3531c19") +} + +func (TokenPoolLocked) Topic() common.Hash { + return common.HexToHash("0x9f1ec8c880f76798e7b793325d625e9b60e4082a553c98f42b6cda368dd60008") +} + +func (TokenPoolMinted) Topic() common.Hash { + return common.HexToHash("0x9d228d69b5fdb8d273a2336f8fb8612d039631024ea9bf09c424a9503aa078f0") +} + +func (TokenPoolOwnershipTransferRequested) Topic() common.Hash { + return common.HexToHash("0xed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae1278") +} + +func (TokenPoolOwnershipTransferred) Topic() common.Hash { + return common.HexToHash("0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0") +} + +func (TokenPoolReleased) Topic() common.Hash { + return common.HexToHash("0x2d87480f50083e2b2759522a8fdda59802650a8055e609a7772cf70c07748f52") +} + +func (TokenPoolRemotePoolSet) Topic() common.Hash { + return common.HexToHash("0xdb4d6220746a38cbc5335f7e108f7de80f482f4d23350253dfd0917df75a14bf") +} + +func (TokenPoolRouterUpdated) Topic() common.Hash { + return common.HexToHash("0x02dc5c233404867c793b749c6d644beb2277536d18a7e7974d3f238e4c6f1684") +} + +func (_TokenPool *TokenPool) Address() common.Address { + return _TokenPool.address +} + +type TokenPoolInterface interface { + GetAllowList(opts *bind.CallOpts) ([]common.Address, error) + + GetAllowListEnabled(opts *bind.CallOpts) (bool, error) + + GetCurrentInboundRateLimiterState(opts *bind.CallOpts, remoteChainSelector uint64) (RateLimiterTokenBucket, error) + + GetCurrentOutboundRateLimiterState(opts *bind.CallOpts, remoteChainSelector uint64) (RateLimiterTokenBucket, error) + + GetRateLimitAdmin(opts *bind.CallOpts) (common.Address, error) + + GetRemotePool(opts *bind.CallOpts, remoteChainSelector uint64) ([]byte, error) + + GetRemoteToken(opts *bind.CallOpts, remoteChainSelector uint64) ([]byte, error) + + GetRmnProxy(opts *bind.CallOpts) (common.Address, error) + + GetRouter(opts *bind.CallOpts) (common.Address, error) + + GetSupportedChains(opts *bind.CallOpts) ([]uint64, error) + + GetToken(opts *bind.CallOpts) (common.Address, error) + + IsSupportedChain(opts *bind.CallOpts, remoteChainSelector uint64) (bool, error) + + IsSupportedToken(opts *bind.CallOpts, token common.Address) (bool, error) + + Owner(opts *bind.CallOpts) (common.Address, error) + + SupportsInterface(opts *bind.CallOpts, interfaceId [4]byte) (bool, error) + + AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) + + ApplyAllowListUpdates(opts *bind.TransactOpts, removes []common.Address, adds []common.Address) (*types.Transaction, error) + + ApplyChainUpdates(opts *bind.TransactOpts, chains []TokenPoolChainUpdate) (*types.Transaction, error) + + LockOrBurn(opts *bind.TransactOpts, lockOrBurnIn PoolLockOrBurnInV1) (*types.Transaction, error) + + ReleaseOrMint(opts *bind.TransactOpts, releaseOrMintIn PoolReleaseOrMintInV1) (*types.Transaction, error) + + SetChainRateLimiterConfig(opts *bind.TransactOpts, remoteChainSelector uint64, outboundConfig RateLimiterConfig, inboundConfig RateLimiterConfig) (*types.Transaction, error) + + SetRateLimitAdmin(opts *bind.TransactOpts, rateLimitAdmin common.Address) (*types.Transaction, error) + + SetRemotePool(opts *bind.TransactOpts, remoteChainSelector uint64, remotePoolAddress []byte) (*types.Transaction, error) + + SetRouter(opts *bind.TransactOpts, newRouter common.Address) (*types.Transaction, error) + + TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) + + FilterAllowListAdd(opts *bind.FilterOpts) (*TokenPoolAllowListAddIterator, error) + + WatchAllowListAdd(opts *bind.WatchOpts, sink chan<- *TokenPoolAllowListAdd) (event.Subscription, error) + + ParseAllowListAdd(log types.Log) (*TokenPoolAllowListAdd, error) + + FilterAllowListRemove(opts *bind.FilterOpts) (*TokenPoolAllowListRemoveIterator, error) + + WatchAllowListRemove(opts *bind.WatchOpts, sink chan<- *TokenPoolAllowListRemove) (event.Subscription, error) + + ParseAllowListRemove(log types.Log) (*TokenPoolAllowListRemove, error) + + FilterBurned(opts *bind.FilterOpts, sender []common.Address) (*TokenPoolBurnedIterator, error) + + WatchBurned(opts *bind.WatchOpts, sink chan<- *TokenPoolBurned, sender []common.Address) (event.Subscription, error) + + ParseBurned(log types.Log) (*TokenPoolBurned, error) + + FilterChainAdded(opts *bind.FilterOpts) (*TokenPoolChainAddedIterator, error) + + WatchChainAdded(opts *bind.WatchOpts, sink chan<- *TokenPoolChainAdded) (event.Subscription, error) + + ParseChainAdded(log types.Log) (*TokenPoolChainAdded, error) + + FilterChainConfigured(opts *bind.FilterOpts) (*TokenPoolChainConfiguredIterator, error) + + WatchChainConfigured(opts *bind.WatchOpts, sink chan<- *TokenPoolChainConfigured) (event.Subscription, error) + + ParseChainConfigured(log types.Log) (*TokenPoolChainConfigured, error) + + FilterChainRemoved(opts *bind.FilterOpts) (*TokenPoolChainRemovedIterator, error) + + WatchChainRemoved(opts *bind.WatchOpts, sink chan<- *TokenPoolChainRemoved) (event.Subscription, error) + + ParseChainRemoved(log types.Log) (*TokenPoolChainRemoved, error) + + FilterConfigChanged(opts *bind.FilterOpts) (*TokenPoolConfigChangedIterator, error) + + WatchConfigChanged(opts *bind.WatchOpts, sink chan<- *TokenPoolConfigChanged) (event.Subscription, error) + + ParseConfigChanged(log types.Log) (*TokenPoolConfigChanged, error) + + FilterLocked(opts *bind.FilterOpts, sender []common.Address) (*TokenPoolLockedIterator, error) + + WatchLocked(opts *bind.WatchOpts, sink chan<- *TokenPoolLocked, sender []common.Address) (event.Subscription, error) + + ParseLocked(log types.Log) (*TokenPoolLocked, error) + + FilterMinted(opts *bind.FilterOpts, sender []common.Address, recipient []common.Address) (*TokenPoolMintedIterator, error) + + WatchMinted(opts *bind.WatchOpts, sink chan<- *TokenPoolMinted, sender []common.Address, recipient []common.Address) (event.Subscription, error) + + ParseMinted(log types.Log) (*TokenPoolMinted, error) + + FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*TokenPoolOwnershipTransferRequestedIterator, error) + + WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *TokenPoolOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferRequested(log types.Log) (*TokenPoolOwnershipTransferRequested, error) + + FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*TokenPoolOwnershipTransferredIterator, error) + + WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *TokenPoolOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferred(log types.Log) (*TokenPoolOwnershipTransferred, error) + + FilterReleased(opts *bind.FilterOpts, sender []common.Address, recipient []common.Address) (*TokenPoolReleasedIterator, error) + + WatchReleased(opts *bind.WatchOpts, sink chan<- *TokenPoolReleased, sender []common.Address, recipient []common.Address) (event.Subscription, error) + + ParseReleased(log types.Log) (*TokenPoolReleased, error) + + FilterRemotePoolSet(opts *bind.FilterOpts, remoteChainSelector []uint64) (*TokenPoolRemotePoolSetIterator, error) + + WatchRemotePoolSet(opts *bind.WatchOpts, sink chan<- *TokenPoolRemotePoolSet, remoteChainSelector []uint64) (event.Subscription, error) + + ParseRemotePoolSet(log types.Log) (*TokenPoolRemotePoolSet, error) + + FilterRouterUpdated(opts *bind.FilterOpts) (*TokenPoolRouterUpdatedIterator, error) + + WatchRouterUpdated(opts *bind.WatchOpts, sink chan<- *TokenPoolRouterUpdated) (event.Subscription, error) + + ParseRouterUpdated(log types.Log) (*TokenPoolRouterUpdated, error) + + ParseLog(log types.Log) (generated.AbigenLog, error) + + Address() common.Address +} diff --git a/core/gethwrappers/ccip/generated/token_pool_1_4_0/token_pool_1_4_0.go b/core/gethwrappers/ccip/generated/token_pool_1_4_0/token_pool_1_4_0.go new file mode 100644 index 00000000000..477a32d0fd2 --- /dev/null +++ b/core/gethwrappers/ccip/generated/token_pool_1_4_0/token_pool_1_4_0.go @@ -0,0 +1,2221 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package token_pool_1_4_0 + +import ( + "errors" + "fmt" + "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" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" +) + +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +type RateLimiterConfig struct { + IsEnabled bool + Capacity *big.Int + Rate *big.Int +} + +type RateLimiterTokenBucket struct { + Tokens *big.Int + LastUpdated uint32 + IsEnabled bool + Capacity *big.Int + Rate *big.Int +} + +type TokenPoolChainUpdate struct { + RemoteChainSelector uint64 + Allowed bool + OutboundRateLimiterConfig RateLimiterConfig + InboundRateLimiterConfig RateLimiterConfig +} + +var TokenPoolMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[],\"name\":\"AllowListNotEnabled\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"BadARMSignal\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"}],\"name\":\"CallerIsNotARampOnRouter\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"}],\"name\":\"ChainAlreadyExists\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"ChainNotAllowed\",\"type\":\"error\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"config\",\"type\":\"tuple\"}],\"name\":\"DisabledNonZeroRateLimit\",\"type\":\"error\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"rateLimiterConfig\",\"type\":\"tuple\"}],\"name\":\"InvalidRatelimitRate\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"NonExistentChain\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RateLimitMustBeDisabled\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"SenderNotAllowed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddressNotAllowed\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"AllowListAdd\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"AllowListRemove\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Burned\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"indexed\":false,\"internalType\":\"structRateLimiter.Config\",\"name\":\"outboundRateLimiterConfig\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"indexed\":false,\"internalType\":\"structRateLimiter.Config\",\"name\":\"inboundRateLimiterConfig\",\"type\":\"tuple\"}],\"name\":\"ChainAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"indexed\":false,\"internalType\":\"structRateLimiter.Config\",\"name\":\"outboundRateLimiterConfig\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"indexed\":false,\"internalType\":\"structRateLimiter.Config\",\"name\":\"inboundRateLimiterConfig\",\"type\":\"tuple\"}],\"name\":\"ChainConfigured\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"ChainRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Locked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Minted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Released\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"oldRouter\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newRouter\",\"type\":\"address\"}],\"name\":\"RouterUpdated\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"removes\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"adds\",\"type\":\"address[]\"}],\"name\":\"applyAllowListUpdates\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"bool\",\"name\":\"allowed\",\"type\":\"bool\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"outboundRateLimiterConfig\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"inboundRateLimiterConfig\",\"type\":\"tuple\"}],\"internalType\":\"structTokenPool.ChainUpdate[]\",\"name\":\"chains\",\"type\":\"tuple[]\"}],\"name\":\"applyChainUpdates\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAllowList\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAllowListEnabled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getArmProxy\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"armProxy\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"getCurrentInboundRateLimiterState\",\"outputs\":[{\"components\":[{\"internalType\":\"uint128\",\"name\":\"tokens\",\"type\":\"uint128\"},{\"internalType\":\"uint32\",\"name\":\"lastUpdated\",\"type\":\"uint32\"},{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.TokenBucket\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"getCurrentOutboundRateLimiterState\",\"outputs\":[{\"components\":[{\"internalType\":\"uint128\",\"name\":\"tokens\",\"type\":\"uint128\"},{\"internalType\":\"uint32\",\"name\":\"lastUpdated\",\"type\":\"uint32\"},{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.TokenBucket\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRouter\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"router\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getSupportedChains\",\"outputs\":[{\"internalType\":\"uint64[]\",\"name\":\"\",\"type\":\"uint64[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getToken\",\"outputs\":[{\"internalType\":\"contractIERC20\",\"name\":\"token\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"isSupportedChain\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"originalSender\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"receiver\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"extraArgs\",\"type\":\"bytes\"}],\"name\":\"lockOrBurn\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"originalSender\",\"type\":\"bytes\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"name\":\"releaseOrMint\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"outboundConfig\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"inboundConfig\",\"type\":\"tuple\"}],\"name\":\"setChainRateLimiterConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newRouter\",\"type\":\"address\"}],\"name\":\"setRouter\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", +} + +var TokenPoolABI = TokenPoolMetaData.ABI + +type TokenPool struct { + address common.Address + abi abi.ABI + TokenPoolCaller + TokenPoolTransactor + TokenPoolFilterer +} + +type TokenPoolCaller struct { + contract *bind.BoundContract +} + +type TokenPoolTransactor struct { + contract *bind.BoundContract +} + +type TokenPoolFilterer struct { + contract *bind.BoundContract +} + +type TokenPoolSession struct { + Contract *TokenPool + CallOpts bind.CallOpts + TransactOpts bind.TransactOpts +} + +type TokenPoolCallerSession struct { + Contract *TokenPoolCaller + CallOpts bind.CallOpts +} + +type TokenPoolTransactorSession struct { + Contract *TokenPoolTransactor + TransactOpts bind.TransactOpts +} + +type TokenPoolRaw struct { + Contract *TokenPool +} + +type TokenPoolCallerRaw struct { + Contract *TokenPoolCaller +} + +type TokenPoolTransactorRaw struct { + Contract *TokenPoolTransactor +} + +func NewTokenPool(address common.Address, backend bind.ContractBackend) (*TokenPool, error) { + abi, err := abi.JSON(strings.NewReader(TokenPoolABI)) + if err != nil { + return nil, err + } + contract, err := bindTokenPool(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &TokenPool{address: address, abi: abi, TokenPoolCaller: TokenPoolCaller{contract: contract}, TokenPoolTransactor: TokenPoolTransactor{contract: contract}, TokenPoolFilterer: TokenPoolFilterer{contract: contract}}, nil +} + +func NewTokenPoolCaller(address common.Address, caller bind.ContractCaller) (*TokenPoolCaller, error) { + contract, err := bindTokenPool(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &TokenPoolCaller{contract: contract}, nil +} + +func NewTokenPoolTransactor(address common.Address, transactor bind.ContractTransactor) (*TokenPoolTransactor, error) { + contract, err := bindTokenPool(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &TokenPoolTransactor{contract: contract}, nil +} + +func NewTokenPoolFilterer(address common.Address, filterer bind.ContractFilterer) (*TokenPoolFilterer, error) { + contract, err := bindTokenPool(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &TokenPoolFilterer{contract: contract}, nil +} + +func bindTokenPool(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := TokenPoolMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +func (_TokenPool *TokenPoolRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _TokenPool.Contract.TokenPoolCaller.contract.Call(opts, result, method, params...) +} + +func (_TokenPool *TokenPoolRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _TokenPool.Contract.TokenPoolTransactor.contract.Transfer(opts) +} + +func (_TokenPool *TokenPoolRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _TokenPool.Contract.TokenPoolTransactor.contract.Transact(opts, method, params...) +} + +func (_TokenPool *TokenPoolCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _TokenPool.Contract.contract.Call(opts, result, method, params...) +} + +func (_TokenPool *TokenPoolTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _TokenPool.Contract.contract.Transfer(opts) +} + +func (_TokenPool *TokenPoolTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _TokenPool.Contract.contract.Transact(opts, method, params...) +} + +func (_TokenPool *TokenPoolCaller) GetAllowList(opts *bind.CallOpts) ([]common.Address, error) { + var out []interface{} + err := _TokenPool.contract.Call(opts, &out, "getAllowList") + + if err != nil { + return *new([]common.Address), err + } + + out0 := *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) + + return out0, err + +} + +func (_TokenPool *TokenPoolSession) GetAllowList() ([]common.Address, error) { + return _TokenPool.Contract.GetAllowList(&_TokenPool.CallOpts) +} + +func (_TokenPool *TokenPoolCallerSession) GetAllowList() ([]common.Address, error) { + return _TokenPool.Contract.GetAllowList(&_TokenPool.CallOpts) +} + +func (_TokenPool *TokenPoolCaller) GetAllowListEnabled(opts *bind.CallOpts) (bool, error) { + var out []interface{} + err := _TokenPool.contract.Call(opts, &out, "getAllowListEnabled") + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_TokenPool *TokenPoolSession) GetAllowListEnabled() (bool, error) { + return _TokenPool.Contract.GetAllowListEnabled(&_TokenPool.CallOpts) +} + +func (_TokenPool *TokenPoolCallerSession) GetAllowListEnabled() (bool, error) { + return _TokenPool.Contract.GetAllowListEnabled(&_TokenPool.CallOpts) +} + +func (_TokenPool *TokenPoolCaller) GetArmProxy(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _TokenPool.contract.Call(opts, &out, "getArmProxy") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_TokenPool *TokenPoolSession) GetArmProxy() (common.Address, error) { + return _TokenPool.Contract.GetArmProxy(&_TokenPool.CallOpts) +} + +func (_TokenPool *TokenPoolCallerSession) GetArmProxy() (common.Address, error) { + return _TokenPool.Contract.GetArmProxy(&_TokenPool.CallOpts) +} + +func (_TokenPool *TokenPoolCaller) GetCurrentInboundRateLimiterState(opts *bind.CallOpts, remoteChainSelector uint64) (RateLimiterTokenBucket, error) { + var out []interface{} + err := _TokenPool.contract.Call(opts, &out, "getCurrentInboundRateLimiterState", remoteChainSelector) + + if err != nil { + return *new(RateLimiterTokenBucket), err + } + + out0 := *abi.ConvertType(out[0], new(RateLimiterTokenBucket)).(*RateLimiterTokenBucket) + + return out0, err + +} + +func (_TokenPool *TokenPoolSession) GetCurrentInboundRateLimiterState(remoteChainSelector uint64) (RateLimiterTokenBucket, error) { + return _TokenPool.Contract.GetCurrentInboundRateLimiterState(&_TokenPool.CallOpts, remoteChainSelector) +} + +func (_TokenPool *TokenPoolCallerSession) GetCurrentInboundRateLimiterState(remoteChainSelector uint64) (RateLimiterTokenBucket, error) { + return _TokenPool.Contract.GetCurrentInboundRateLimiterState(&_TokenPool.CallOpts, remoteChainSelector) +} + +func (_TokenPool *TokenPoolCaller) GetCurrentOutboundRateLimiterState(opts *bind.CallOpts, remoteChainSelector uint64) (RateLimiterTokenBucket, error) { + var out []interface{} + err := _TokenPool.contract.Call(opts, &out, "getCurrentOutboundRateLimiterState", remoteChainSelector) + + if err != nil { + return *new(RateLimiterTokenBucket), err + } + + out0 := *abi.ConvertType(out[0], new(RateLimiterTokenBucket)).(*RateLimiterTokenBucket) + + return out0, err + +} + +func (_TokenPool *TokenPoolSession) GetCurrentOutboundRateLimiterState(remoteChainSelector uint64) (RateLimiterTokenBucket, error) { + return _TokenPool.Contract.GetCurrentOutboundRateLimiterState(&_TokenPool.CallOpts, remoteChainSelector) +} + +func (_TokenPool *TokenPoolCallerSession) GetCurrentOutboundRateLimiterState(remoteChainSelector uint64) (RateLimiterTokenBucket, error) { + return _TokenPool.Contract.GetCurrentOutboundRateLimiterState(&_TokenPool.CallOpts, remoteChainSelector) +} + +func (_TokenPool *TokenPoolCaller) GetRouter(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _TokenPool.contract.Call(opts, &out, "getRouter") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_TokenPool *TokenPoolSession) GetRouter() (common.Address, error) { + return _TokenPool.Contract.GetRouter(&_TokenPool.CallOpts) +} + +func (_TokenPool *TokenPoolCallerSession) GetRouter() (common.Address, error) { + return _TokenPool.Contract.GetRouter(&_TokenPool.CallOpts) +} + +func (_TokenPool *TokenPoolCaller) GetSupportedChains(opts *bind.CallOpts) ([]uint64, error) { + var out []interface{} + err := _TokenPool.contract.Call(opts, &out, "getSupportedChains") + + if err != nil { + return *new([]uint64), err + } + + out0 := *abi.ConvertType(out[0], new([]uint64)).(*[]uint64) + + return out0, err + +} + +func (_TokenPool *TokenPoolSession) GetSupportedChains() ([]uint64, error) { + return _TokenPool.Contract.GetSupportedChains(&_TokenPool.CallOpts) +} + +func (_TokenPool *TokenPoolCallerSession) GetSupportedChains() ([]uint64, error) { + return _TokenPool.Contract.GetSupportedChains(&_TokenPool.CallOpts) +} + +func (_TokenPool *TokenPoolCaller) GetToken(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _TokenPool.contract.Call(opts, &out, "getToken") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_TokenPool *TokenPoolSession) GetToken() (common.Address, error) { + return _TokenPool.Contract.GetToken(&_TokenPool.CallOpts) +} + +func (_TokenPool *TokenPoolCallerSession) GetToken() (common.Address, error) { + return _TokenPool.Contract.GetToken(&_TokenPool.CallOpts) +} + +func (_TokenPool *TokenPoolCaller) IsSupportedChain(opts *bind.CallOpts, remoteChainSelector uint64) (bool, error) { + var out []interface{} + err := _TokenPool.contract.Call(opts, &out, "isSupportedChain", remoteChainSelector) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_TokenPool *TokenPoolSession) IsSupportedChain(remoteChainSelector uint64) (bool, error) { + return _TokenPool.Contract.IsSupportedChain(&_TokenPool.CallOpts, remoteChainSelector) +} + +func (_TokenPool *TokenPoolCallerSession) IsSupportedChain(remoteChainSelector uint64) (bool, error) { + return _TokenPool.Contract.IsSupportedChain(&_TokenPool.CallOpts, remoteChainSelector) +} + +func (_TokenPool *TokenPoolCaller) Owner(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _TokenPool.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 + +} + +func (_TokenPool *TokenPoolSession) Owner() (common.Address, error) { + return _TokenPool.Contract.Owner(&_TokenPool.CallOpts) +} + +func (_TokenPool *TokenPoolCallerSession) Owner() (common.Address, error) { + return _TokenPool.Contract.Owner(&_TokenPool.CallOpts) +} + +func (_TokenPool *TokenPoolCaller) SupportsInterface(opts *bind.CallOpts, interfaceId [4]byte) (bool, error) { + var out []interface{} + err := _TokenPool.contract.Call(opts, &out, "supportsInterface", interfaceId) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_TokenPool *TokenPoolSession) SupportsInterface(interfaceId [4]byte) (bool, error) { + return _TokenPool.Contract.SupportsInterface(&_TokenPool.CallOpts, interfaceId) +} + +func (_TokenPool *TokenPoolCallerSession) SupportsInterface(interfaceId [4]byte) (bool, error) { + return _TokenPool.Contract.SupportsInterface(&_TokenPool.CallOpts, interfaceId) +} + +func (_TokenPool *TokenPoolTransactor) AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + return _TokenPool.contract.Transact(opts, "acceptOwnership") +} + +func (_TokenPool *TokenPoolSession) AcceptOwnership() (*types.Transaction, error) { + return _TokenPool.Contract.AcceptOwnership(&_TokenPool.TransactOpts) +} + +func (_TokenPool *TokenPoolTransactorSession) AcceptOwnership() (*types.Transaction, error) { + return _TokenPool.Contract.AcceptOwnership(&_TokenPool.TransactOpts) +} + +func (_TokenPool *TokenPoolTransactor) ApplyAllowListUpdates(opts *bind.TransactOpts, removes []common.Address, adds []common.Address) (*types.Transaction, error) { + return _TokenPool.contract.Transact(opts, "applyAllowListUpdates", removes, adds) +} + +func (_TokenPool *TokenPoolSession) ApplyAllowListUpdates(removes []common.Address, adds []common.Address) (*types.Transaction, error) { + return _TokenPool.Contract.ApplyAllowListUpdates(&_TokenPool.TransactOpts, removes, adds) +} + +func (_TokenPool *TokenPoolTransactorSession) ApplyAllowListUpdates(removes []common.Address, adds []common.Address) (*types.Transaction, error) { + return _TokenPool.Contract.ApplyAllowListUpdates(&_TokenPool.TransactOpts, removes, adds) +} + +func (_TokenPool *TokenPoolTransactor) ApplyChainUpdates(opts *bind.TransactOpts, chains []TokenPoolChainUpdate) (*types.Transaction, error) { + return _TokenPool.contract.Transact(opts, "applyChainUpdates", chains) +} + +func (_TokenPool *TokenPoolSession) ApplyChainUpdates(chains []TokenPoolChainUpdate) (*types.Transaction, error) { + return _TokenPool.Contract.ApplyChainUpdates(&_TokenPool.TransactOpts, chains) +} + +func (_TokenPool *TokenPoolTransactorSession) ApplyChainUpdates(chains []TokenPoolChainUpdate) (*types.Transaction, error) { + return _TokenPool.Contract.ApplyChainUpdates(&_TokenPool.TransactOpts, chains) +} + +func (_TokenPool *TokenPoolTransactor) LockOrBurn(opts *bind.TransactOpts, originalSender common.Address, receiver []byte, amount *big.Int, remoteChainSelector uint64, extraArgs []byte) (*types.Transaction, error) { + return _TokenPool.contract.Transact(opts, "lockOrBurn", originalSender, receiver, amount, remoteChainSelector, extraArgs) +} + +func (_TokenPool *TokenPoolSession) LockOrBurn(originalSender common.Address, receiver []byte, amount *big.Int, remoteChainSelector uint64, extraArgs []byte) (*types.Transaction, error) { + return _TokenPool.Contract.LockOrBurn(&_TokenPool.TransactOpts, originalSender, receiver, amount, remoteChainSelector, extraArgs) +} + +func (_TokenPool *TokenPoolTransactorSession) LockOrBurn(originalSender common.Address, receiver []byte, amount *big.Int, remoteChainSelector uint64, extraArgs []byte) (*types.Transaction, error) { + return _TokenPool.Contract.LockOrBurn(&_TokenPool.TransactOpts, originalSender, receiver, amount, remoteChainSelector, extraArgs) +} + +func (_TokenPool *TokenPoolTransactor) ReleaseOrMint(opts *bind.TransactOpts, originalSender []byte, receiver common.Address, amount *big.Int, remoteChainSelector uint64, extraData []byte) (*types.Transaction, error) { + return _TokenPool.contract.Transact(opts, "releaseOrMint", originalSender, receiver, amount, remoteChainSelector, extraData) +} + +func (_TokenPool *TokenPoolSession) ReleaseOrMint(originalSender []byte, receiver common.Address, amount *big.Int, remoteChainSelector uint64, extraData []byte) (*types.Transaction, error) { + return _TokenPool.Contract.ReleaseOrMint(&_TokenPool.TransactOpts, originalSender, receiver, amount, remoteChainSelector, extraData) +} + +func (_TokenPool *TokenPoolTransactorSession) ReleaseOrMint(originalSender []byte, receiver common.Address, amount *big.Int, remoteChainSelector uint64, extraData []byte) (*types.Transaction, error) { + return _TokenPool.Contract.ReleaseOrMint(&_TokenPool.TransactOpts, originalSender, receiver, amount, remoteChainSelector, extraData) +} + +func (_TokenPool *TokenPoolTransactor) SetChainRateLimiterConfig(opts *bind.TransactOpts, remoteChainSelector uint64, outboundConfig RateLimiterConfig, inboundConfig RateLimiterConfig) (*types.Transaction, error) { + return _TokenPool.contract.Transact(opts, "setChainRateLimiterConfig", remoteChainSelector, outboundConfig, inboundConfig) +} + +func (_TokenPool *TokenPoolSession) SetChainRateLimiterConfig(remoteChainSelector uint64, outboundConfig RateLimiterConfig, inboundConfig RateLimiterConfig) (*types.Transaction, error) { + return _TokenPool.Contract.SetChainRateLimiterConfig(&_TokenPool.TransactOpts, remoteChainSelector, outboundConfig, inboundConfig) +} + +func (_TokenPool *TokenPoolTransactorSession) SetChainRateLimiterConfig(remoteChainSelector uint64, outboundConfig RateLimiterConfig, inboundConfig RateLimiterConfig) (*types.Transaction, error) { + return _TokenPool.Contract.SetChainRateLimiterConfig(&_TokenPool.TransactOpts, remoteChainSelector, outboundConfig, inboundConfig) +} + +func (_TokenPool *TokenPoolTransactor) SetRouter(opts *bind.TransactOpts, newRouter common.Address) (*types.Transaction, error) { + return _TokenPool.contract.Transact(opts, "setRouter", newRouter) +} + +func (_TokenPool *TokenPoolSession) SetRouter(newRouter common.Address) (*types.Transaction, error) { + return _TokenPool.Contract.SetRouter(&_TokenPool.TransactOpts, newRouter) +} + +func (_TokenPool *TokenPoolTransactorSession) SetRouter(newRouter common.Address) (*types.Transaction, error) { + return _TokenPool.Contract.SetRouter(&_TokenPool.TransactOpts, newRouter) +} + +func (_TokenPool *TokenPoolTransactor) TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) { + return _TokenPool.contract.Transact(opts, "transferOwnership", to) +} + +func (_TokenPool *TokenPoolSession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _TokenPool.Contract.TransferOwnership(&_TokenPool.TransactOpts, to) +} + +func (_TokenPool *TokenPoolTransactorSession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _TokenPool.Contract.TransferOwnership(&_TokenPool.TransactOpts, to) +} + +type TokenPoolAllowListAddIterator struct { + Event *TokenPoolAllowListAdd + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *TokenPoolAllowListAddIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(TokenPoolAllowListAdd) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(TokenPoolAllowListAdd) + 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() + } +} + +func (it *TokenPoolAllowListAddIterator) Error() error { + return it.fail +} + +func (it *TokenPoolAllowListAddIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type TokenPoolAllowListAdd struct { + Sender common.Address + Raw types.Log +} + +func (_TokenPool *TokenPoolFilterer) FilterAllowListAdd(opts *bind.FilterOpts) (*TokenPoolAllowListAddIterator, error) { + + logs, sub, err := _TokenPool.contract.FilterLogs(opts, "AllowListAdd") + if err != nil { + return nil, err + } + return &TokenPoolAllowListAddIterator{contract: _TokenPool.contract, event: "AllowListAdd", logs: logs, sub: sub}, nil +} + +func (_TokenPool *TokenPoolFilterer) WatchAllowListAdd(opts *bind.WatchOpts, sink chan<- *TokenPoolAllowListAdd) (event.Subscription, error) { + + logs, sub, err := _TokenPool.contract.WatchLogs(opts, "AllowListAdd") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(TokenPoolAllowListAdd) + if err := _TokenPool.contract.UnpackLog(event, "AllowListAdd", 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 +} + +func (_TokenPool *TokenPoolFilterer) ParseAllowListAdd(log types.Log) (*TokenPoolAllowListAdd, error) { + event := new(TokenPoolAllowListAdd) + if err := _TokenPool.contract.UnpackLog(event, "AllowListAdd", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type TokenPoolAllowListRemoveIterator struct { + Event *TokenPoolAllowListRemove + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *TokenPoolAllowListRemoveIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(TokenPoolAllowListRemove) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(TokenPoolAllowListRemove) + 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() + } +} + +func (it *TokenPoolAllowListRemoveIterator) Error() error { + return it.fail +} + +func (it *TokenPoolAllowListRemoveIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type TokenPoolAllowListRemove struct { + Sender common.Address + Raw types.Log +} + +func (_TokenPool *TokenPoolFilterer) FilterAllowListRemove(opts *bind.FilterOpts) (*TokenPoolAllowListRemoveIterator, error) { + + logs, sub, err := _TokenPool.contract.FilterLogs(opts, "AllowListRemove") + if err != nil { + return nil, err + } + return &TokenPoolAllowListRemoveIterator{contract: _TokenPool.contract, event: "AllowListRemove", logs: logs, sub: sub}, nil +} + +func (_TokenPool *TokenPoolFilterer) WatchAllowListRemove(opts *bind.WatchOpts, sink chan<- *TokenPoolAllowListRemove) (event.Subscription, error) { + + logs, sub, err := _TokenPool.contract.WatchLogs(opts, "AllowListRemove") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(TokenPoolAllowListRemove) + if err := _TokenPool.contract.UnpackLog(event, "AllowListRemove", 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 +} + +func (_TokenPool *TokenPoolFilterer) ParseAllowListRemove(log types.Log) (*TokenPoolAllowListRemove, error) { + event := new(TokenPoolAllowListRemove) + if err := _TokenPool.contract.UnpackLog(event, "AllowListRemove", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type TokenPoolBurnedIterator struct { + Event *TokenPoolBurned + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *TokenPoolBurnedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(TokenPoolBurned) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(TokenPoolBurned) + 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() + } +} + +func (it *TokenPoolBurnedIterator) Error() error { + return it.fail +} + +func (it *TokenPoolBurnedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type TokenPoolBurned struct { + Sender common.Address + Amount *big.Int + Raw types.Log +} + +func (_TokenPool *TokenPoolFilterer) FilterBurned(opts *bind.FilterOpts, sender []common.Address) (*TokenPoolBurnedIterator, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _TokenPool.contract.FilterLogs(opts, "Burned", senderRule) + if err != nil { + return nil, err + } + return &TokenPoolBurnedIterator{contract: _TokenPool.contract, event: "Burned", logs: logs, sub: sub}, nil +} + +func (_TokenPool *TokenPoolFilterer) WatchBurned(opts *bind.WatchOpts, sink chan<- *TokenPoolBurned, sender []common.Address) (event.Subscription, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _TokenPool.contract.WatchLogs(opts, "Burned", senderRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(TokenPoolBurned) + if err := _TokenPool.contract.UnpackLog(event, "Burned", 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 +} + +func (_TokenPool *TokenPoolFilterer) ParseBurned(log types.Log) (*TokenPoolBurned, error) { + event := new(TokenPoolBurned) + if err := _TokenPool.contract.UnpackLog(event, "Burned", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type TokenPoolChainAddedIterator struct { + Event *TokenPoolChainAdded + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *TokenPoolChainAddedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(TokenPoolChainAdded) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(TokenPoolChainAdded) + 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() + } +} + +func (it *TokenPoolChainAddedIterator) Error() error { + return it.fail +} + +func (it *TokenPoolChainAddedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type TokenPoolChainAdded struct { + RemoteChainSelector uint64 + OutboundRateLimiterConfig RateLimiterConfig + InboundRateLimiterConfig RateLimiterConfig + Raw types.Log +} + +func (_TokenPool *TokenPoolFilterer) FilterChainAdded(opts *bind.FilterOpts) (*TokenPoolChainAddedIterator, error) { + + logs, sub, err := _TokenPool.contract.FilterLogs(opts, "ChainAdded") + if err != nil { + return nil, err + } + return &TokenPoolChainAddedIterator{contract: _TokenPool.contract, event: "ChainAdded", logs: logs, sub: sub}, nil +} + +func (_TokenPool *TokenPoolFilterer) WatchChainAdded(opts *bind.WatchOpts, sink chan<- *TokenPoolChainAdded) (event.Subscription, error) { + + logs, sub, err := _TokenPool.contract.WatchLogs(opts, "ChainAdded") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(TokenPoolChainAdded) + if err := _TokenPool.contract.UnpackLog(event, "ChainAdded", 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 +} + +func (_TokenPool *TokenPoolFilterer) ParseChainAdded(log types.Log) (*TokenPoolChainAdded, error) { + event := new(TokenPoolChainAdded) + if err := _TokenPool.contract.UnpackLog(event, "ChainAdded", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type TokenPoolChainConfiguredIterator struct { + Event *TokenPoolChainConfigured + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *TokenPoolChainConfiguredIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(TokenPoolChainConfigured) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(TokenPoolChainConfigured) + 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() + } +} + +func (it *TokenPoolChainConfiguredIterator) Error() error { + return it.fail +} + +func (it *TokenPoolChainConfiguredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type TokenPoolChainConfigured struct { + RemoteChainSelector uint64 + OutboundRateLimiterConfig RateLimiterConfig + InboundRateLimiterConfig RateLimiterConfig + Raw types.Log +} + +func (_TokenPool *TokenPoolFilterer) FilterChainConfigured(opts *bind.FilterOpts) (*TokenPoolChainConfiguredIterator, error) { + + logs, sub, err := _TokenPool.contract.FilterLogs(opts, "ChainConfigured") + if err != nil { + return nil, err + } + return &TokenPoolChainConfiguredIterator{contract: _TokenPool.contract, event: "ChainConfigured", logs: logs, sub: sub}, nil +} + +func (_TokenPool *TokenPoolFilterer) WatchChainConfigured(opts *bind.WatchOpts, sink chan<- *TokenPoolChainConfigured) (event.Subscription, error) { + + logs, sub, err := _TokenPool.contract.WatchLogs(opts, "ChainConfigured") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(TokenPoolChainConfigured) + if err := _TokenPool.contract.UnpackLog(event, "ChainConfigured", 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 +} + +func (_TokenPool *TokenPoolFilterer) ParseChainConfigured(log types.Log) (*TokenPoolChainConfigured, error) { + event := new(TokenPoolChainConfigured) + if err := _TokenPool.contract.UnpackLog(event, "ChainConfigured", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type TokenPoolChainRemovedIterator struct { + Event *TokenPoolChainRemoved + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *TokenPoolChainRemovedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(TokenPoolChainRemoved) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(TokenPoolChainRemoved) + 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() + } +} + +func (it *TokenPoolChainRemovedIterator) Error() error { + return it.fail +} + +func (it *TokenPoolChainRemovedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type TokenPoolChainRemoved struct { + RemoteChainSelector uint64 + Raw types.Log +} + +func (_TokenPool *TokenPoolFilterer) FilterChainRemoved(opts *bind.FilterOpts) (*TokenPoolChainRemovedIterator, error) { + + logs, sub, err := _TokenPool.contract.FilterLogs(opts, "ChainRemoved") + if err != nil { + return nil, err + } + return &TokenPoolChainRemovedIterator{contract: _TokenPool.contract, event: "ChainRemoved", logs: logs, sub: sub}, nil +} + +func (_TokenPool *TokenPoolFilterer) WatchChainRemoved(opts *bind.WatchOpts, sink chan<- *TokenPoolChainRemoved) (event.Subscription, error) { + + logs, sub, err := _TokenPool.contract.WatchLogs(opts, "ChainRemoved") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(TokenPoolChainRemoved) + if err := _TokenPool.contract.UnpackLog(event, "ChainRemoved", 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 +} + +func (_TokenPool *TokenPoolFilterer) ParseChainRemoved(log types.Log) (*TokenPoolChainRemoved, error) { + event := new(TokenPoolChainRemoved) + if err := _TokenPool.contract.UnpackLog(event, "ChainRemoved", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type TokenPoolLockedIterator struct { + Event *TokenPoolLocked + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *TokenPoolLockedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(TokenPoolLocked) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(TokenPoolLocked) + 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() + } +} + +func (it *TokenPoolLockedIterator) Error() error { + return it.fail +} + +func (it *TokenPoolLockedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type TokenPoolLocked struct { + Sender common.Address + Amount *big.Int + Raw types.Log +} + +func (_TokenPool *TokenPoolFilterer) FilterLocked(opts *bind.FilterOpts, sender []common.Address) (*TokenPoolLockedIterator, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _TokenPool.contract.FilterLogs(opts, "Locked", senderRule) + if err != nil { + return nil, err + } + return &TokenPoolLockedIterator{contract: _TokenPool.contract, event: "Locked", logs: logs, sub: sub}, nil +} + +func (_TokenPool *TokenPoolFilterer) WatchLocked(opts *bind.WatchOpts, sink chan<- *TokenPoolLocked, sender []common.Address) (event.Subscription, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _TokenPool.contract.WatchLogs(opts, "Locked", senderRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(TokenPoolLocked) + if err := _TokenPool.contract.UnpackLog(event, "Locked", 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 +} + +func (_TokenPool *TokenPoolFilterer) ParseLocked(log types.Log) (*TokenPoolLocked, error) { + event := new(TokenPoolLocked) + if err := _TokenPool.contract.UnpackLog(event, "Locked", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type TokenPoolMintedIterator struct { + Event *TokenPoolMinted + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *TokenPoolMintedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(TokenPoolMinted) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(TokenPoolMinted) + 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() + } +} + +func (it *TokenPoolMintedIterator) Error() error { + return it.fail +} + +func (it *TokenPoolMintedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type TokenPoolMinted struct { + Sender common.Address + Recipient common.Address + Amount *big.Int + Raw types.Log +} + +func (_TokenPool *TokenPoolFilterer) FilterMinted(opts *bind.FilterOpts, sender []common.Address, recipient []common.Address) (*TokenPoolMintedIterator, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + var recipientRule []interface{} + for _, recipientItem := range recipient { + recipientRule = append(recipientRule, recipientItem) + } + + logs, sub, err := _TokenPool.contract.FilterLogs(opts, "Minted", senderRule, recipientRule) + if err != nil { + return nil, err + } + return &TokenPoolMintedIterator{contract: _TokenPool.contract, event: "Minted", logs: logs, sub: sub}, nil +} + +func (_TokenPool *TokenPoolFilterer) WatchMinted(opts *bind.WatchOpts, sink chan<- *TokenPoolMinted, sender []common.Address, recipient []common.Address) (event.Subscription, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + var recipientRule []interface{} + for _, recipientItem := range recipient { + recipientRule = append(recipientRule, recipientItem) + } + + logs, sub, err := _TokenPool.contract.WatchLogs(opts, "Minted", senderRule, recipientRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(TokenPoolMinted) + if err := _TokenPool.contract.UnpackLog(event, "Minted", 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 +} + +func (_TokenPool *TokenPoolFilterer) ParseMinted(log types.Log) (*TokenPoolMinted, error) { + event := new(TokenPoolMinted) + if err := _TokenPool.contract.UnpackLog(event, "Minted", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type TokenPoolOwnershipTransferRequestedIterator struct { + Event *TokenPoolOwnershipTransferRequested + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *TokenPoolOwnershipTransferRequestedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(TokenPoolOwnershipTransferRequested) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(TokenPoolOwnershipTransferRequested) + 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() + } +} + +func (it *TokenPoolOwnershipTransferRequestedIterator) Error() error { + return it.fail +} + +func (it *TokenPoolOwnershipTransferRequestedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type TokenPoolOwnershipTransferRequested struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_TokenPool *TokenPoolFilterer) FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*TokenPoolOwnershipTransferRequestedIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _TokenPool.contract.FilterLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return &TokenPoolOwnershipTransferRequestedIterator{contract: _TokenPool.contract, event: "OwnershipTransferRequested", logs: logs, sub: sub}, nil +} + +func (_TokenPool *TokenPoolFilterer) WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *TokenPoolOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _TokenPool.contract.WatchLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(TokenPoolOwnershipTransferRequested) + if err := _TokenPool.contract.UnpackLog(event, "OwnershipTransferRequested", 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 +} + +func (_TokenPool *TokenPoolFilterer) ParseOwnershipTransferRequested(log types.Log) (*TokenPoolOwnershipTransferRequested, error) { + event := new(TokenPoolOwnershipTransferRequested) + if err := _TokenPool.contract.UnpackLog(event, "OwnershipTransferRequested", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type TokenPoolOwnershipTransferredIterator struct { + Event *TokenPoolOwnershipTransferred + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *TokenPoolOwnershipTransferredIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(TokenPoolOwnershipTransferred) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(TokenPoolOwnershipTransferred) + 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() + } +} + +func (it *TokenPoolOwnershipTransferredIterator) Error() error { + return it.fail +} + +func (it *TokenPoolOwnershipTransferredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type TokenPoolOwnershipTransferred struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_TokenPool *TokenPoolFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*TokenPoolOwnershipTransferredIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _TokenPool.contract.FilterLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return &TokenPoolOwnershipTransferredIterator{contract: _TokenPool.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil +} + +func (_TokenPool *TokenPoolFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *TokenPoolOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _TokenPool.contract.WatchLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(TokenPoolOwnershipTransferred) + if err := _TokenPool.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 +} + +func (_TokenPool *TokenPoolFilterer) ParseOwnershipTransferred(log types.Log) (*TokenPoolOwnershipTransferred, error) { + event := new(TokenPoolOwnershipTransferred) + if err := _TokenPool.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type TokenPoolReleasedIterator struct { + Event *TokenPoolReleased + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *TokenPoolReleasedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(TokenPoolReleased) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(TokenPoolReleased) + 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() + } +} + +func (it *TokenPoolReleasedIterator) Error() error { + return it.fail +} + +func (it *TokenPoolReleasedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type TokenPoolReleased struct { + Sender common.Address + Recipient common.Address + Amount *big.Int + Raw types.Log +} + +func (_TokenPool *TokenPoolFilterer) FilterReleased(opts *bind.FilterOpts, sender []common.Address, recipient []common.Address) (*TokenPoolReleasedIterator, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + var recipientRule []interface{} + for _, recipientItem := range recipient { + recipientRule = append(recipientRule, recipientItem) + } + + logs, sub, err := _TokenPool.contract.FilterLogs(opts, "Released", senderRule, recipientRule) + if err != nil { + return nil, err + } + return &TokenPoolReleasedIterator{contract: _TokenPool.contract, event: "Released", logs: logs, sub: sub}, nil +} + +func (_TokenPool *TokenPoolFilterer) WatchReleased(opts *bind.WatchOpts, sink chan<- *TokenPoolReleased, sender []common.Address, recipient []common.Address) (event.Subscription, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + var recipientRule []interface{} + for _, recipientItem := range recipient { + recipientRule = append(recipientRule, recipientItem) + } + + logs, sub, err := _TokenPool.contract.WatchLogs(opts, "Released", senderRule, recipientRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(TokenPoolReleased) + if err := _TokenPool.contract.UnpackLog(event, "Released", 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 +} + +func (_TokenPool *TokenPoolFilterer) ParseReleased(log types.Log) (*TokenPoolReleased, error) { + event := new(TokenPoolReleased) + if err := _TokenPool.contract.UnpackLog(event, "Released", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type TokenPoolRouterUpdatedIterator struct { + Event *TokenPoolRouterUpdated + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *TokenPoolRouterUpdatedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(TokenPoolRouterUpdated) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(TokenPoolRouterUpdated) + 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() + } +} + +func (it *TokenPoolRouterUpdatedIterator) Error() error { + return it.fail +} + +func (it *TokenPoolRouterUpdatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type TokenPoolRouterUpdated struct { + OldRouter common.Address + NewRouter common.Address + Raw types.Log +} + +func (_TokenPool *TokenPoolFilterer) FilterRouterUpdated(opts *bind.FilterOpts) (*TokenPoolRouterUpdatedIterator, error) { + + logs, sub, err := _TokenPool.contract.FilterLogs(opts, "RouterUpdated") + if err != nil { + return nil, err + } + return &TokenPoolRouterUpdatedIterator{contract: _TokenPool.contract, event: "RouterUpdated", logs: logs, sub: sub}, nil +} + +func (_TokenPool *TokenPoolFilterer) WatchRouterUpdated(opts *bind.WatchOpts, sink chan<- *TokenPoolRouterUpdated) (event.Subscription, error) { + + logs, sub, err := _TokenPool.contract.WatchLogs(opts, "RouterUpdated") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(TokenPoolRouterUpdated) + if err := _TokenPool.contract.UnpackLog(event, "RouterUpdated", 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 +} + +func (_TokenPool *TokenPoolFilterer) ParseRouterUpdated(log types.Log) (*TokenPoolRouterUpdated, error) { + event := new(TokenPoolRouterUpdated) + if err := _TokenPool.contract.UnpackLog(event, "RouterUpdated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +func (_TokenPool *TokenPool) ParseLog(log types.Log) (generated.AbigenLog, error) { + switch log.Topics[0] { + case _TokenPool.abi.Events["AllowListAdd"].ID: + return _TokenPool.ParseAllowListAdd(log) + case _TokenPool.abi.Events["AllowListRemove"].ID: + return _TokenPool.ParseAllowListRemove(log) + case _TokenPool.abi.Events["Burned"].ID: + return _TokenPool.ParseBurned(log) + case _TokenPool.abi.Events["ChainAdded"].ID: + return _TokenPool.ParseChainAdded(log) + case _TokenPool.abi.Events["ChainConfigured"].ID: + return _TokenPool.ParseChainConfigured(log) + case _TokenPool.abi.Events["ChainRemoved"].ID: + return _TokenPool.ParseChainRemoved(log) + case _TokenPool.abi.Events["Locked"].ID: + return _TokenPool.ParseLocked(log) + case _TokenPool.abi.Events["Minted"].ID: + return _TokenPool.ParseMinted(log) + case _TokenPool.abi.Events["OwnershipTransferRequested"].ID: + return _TokenPool.ParseOwnershipTransferRequested(log) + case _TokenPool.abi.Events["OwnershipTransferred"].ID: + return _TokenPool.ParseOwnershipTransferred(log) + case _TokenPool.abi.Events["Released"].ID: + return _TokenPool.ParseReleased(log) + case _TokenPool.abi.Events["RouterUpdated"].ID: + return _TokenPool.ParseRouterUpdated(log) + + default: + return nil, fmt.Errorf("abigen wrapper received unknown log topic: %v", log.Topics[0]) + } +} + +func (TokenPoolAllowListAdd) Topic() common.Hash { + return common.HexToHash("0x2640d4d76caf8bf478aabfa982fa4e1c4eb71a37f93cd15e80dbc657911546d8") +} + +func (TokenPoolAllowListRemove) Topic() common.Hash { + return common.HexToHash("0x800671136ab6cfee9fbe5ed1fb7ca417811aca3cf864800d127b927adedf7566") +} + +func (TokenPoolBurned) Topic() common.Hash { + return common.HexToHash("0x696de425f79f4a40bc6d2122ca50507f0efbeabbff86a84871b7196ab8ea8df7") +} + +func (TokenPoolChainAdded) Topic() common.Hash { + return common.HexToHash("0x0f135cbb9afa12a8bf3bbd071c117bcca4ddeca6160ef7f33d012a81b9c0c471") +} + +func (TokenPoolChainConfigured) Topic() common.Hash { + return common.HexToHash("0x0350d63aa5f270e01729d00d627eeb8f3429772b1818c016c66a588a864f912b") +} + +func (TokenPoolChainRemoved) Topic() common.Hash { + return common.HexToHash("0x5204aec90a3c794d8e90fded8b46ae9c7c552803e7e832e0c1d358396d859916") +} + +func (TokenPoolLocked) Topic() common.Hash { + return common.HexToHash("0x9f1ec8c880f76798e7b793325d625e9b60e4082a553c98f42b6cda368dd60008") +} + +func (TokenPoolMinted) Topic() common.Hash { + return common.HexToHash("0x9d228d69b5fdb8d273a2336f8fb8612d039631024ea9bf09c424a9503aa078f0") +} + +func (TokenPoolOwnershipTransferRequested) Topic() common.Hash { + return common.HexToHash("0xed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae1278") +} + +func (TokenPoolOwnershipTransferred) Topic() common.Hash { + return common.HexToHash("0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0") +} + +func (TokenPoolReleased) Topic() common.Hash { + return common.HexToHash("0x2d87480f50083e2b2759522a8fdda59802650a8055e609a7772cf70c07748f52") +} + +func (TokenPoolRouterUpdated) Topic() common.Hash { + return common.HexToHash("0x02dc5c233404867c793b749c6d644beb2277536d18a7e7974d3f238e4c6f1684") +} + +func (_TokenPool *TokenPool) Address() common.Address { + return _TokenPool.address +} + +type TokenPoolInterface interface { + GetAllowList(opts *bind.CallOpts) ([]common.Address, error) + + GetAllowListEnabled(opts *bind.CallOpts) (bool, error) + + GetArmProxy(opts *bind.CallOpts) (common.Address, error) + + GetCurrentInboundRateLimiterState(opts *bind.CallOpts, remoteChainSelector uint64) (RateLimiterTokenBucket, error) + + GetCurrentOutboundRateLimiterState(opts *bind.CallOpts, remoteChainSelector uint64) (RateLimiterTokenBucket, error) + + GetRouter(opts *bind.CallOpts) (common.Address, error) + + GetSupportedChains(opts *bind.CallOpts) ([]uint64, error) + + GetToken(opts *bind.CallOpts) (common.Address, error) + + IsSupportedChain(opts *bind.CallOpts, remoteChainSelector uint64) (bool, error) + + Owner(opts *bind.CallOpts) (common.Address, error) + + SupportsInterface(opts *bind.CallOpts, interfaceId [4]byte) (bool, error) + + AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) + + ApplyAllowListUpdates(opts *bind.TransactOpts, removes []common.Address, adds []common.Address) (*types.Transaction, error) + + ApplyChainUpdates(opts *bind.TransactOpts, chains []TokenPoolChainUpdate) (*types.Transaction, error) + + LockOrBurn(opts *bind.TransactOpts, originalSender common.Address, receiver []byte, amount *big.Int, remoteChainSelector uint64, extraArgs []byte) (*types.Transaction, error) + + ReleaseOrMint(opts *bind.TransactOpts, originalSender []byte, receiver common.Address, amount *big.Int, remoteChainSelector uint64, extraData []byte) (*types.Transaction, error) + + SetChainRateLimiterConfig(opts *bind.TransactOpts, remoteChainSelector uint64, outboundConfig RateLimiterConfig, inboundConfig RateLimiterConfig) (*types.Transaction, error) + + SetRouter(opts *bind.TransactOpts, newRouter common.Address) (*types.Transaction, error) + + TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) + + FilterAllowListAdd(opts *bind.FilterOpts) (*TokenPoolAllowListAddIterator, error) + + WatchAllowListAdd(opts *bind.WatchOpts, sink chan<- *TokenPoolAllowListAdd) (event.Subscription, error) + + ParseAllowListAdd(log types.Log) (*TokenPoolAllowListAdd, error) + + FilterAllowListRemove(opts *bind.FilterOpts) (*TokenPoolAllowListRemoveIterator, error) + + WatchAllowListRemove(opts *bind.WatchOpts, sink chan<- *TokenPoolAllowListRemove) (event.Subscription, error) + + ParseAllowListRemove(log types.Log) (*TokenPoolAllowListRemove, error) + + FilterBurned(opts *bind.FilterOpts, sender []common.Address) (*TokenPoolBurnedIterator, error) + + WatchBurned(opts *bind.WatchOpts, sink chan<- *TokenPoolBurned, sender []common.Address) (event.Subscription, error) + + ParseBurned(log types.Log) (*TokenPoolBurned, error) + + FilterChainAdded(opts *bind.FilterOpts) (*TokenPoolChainAddedIterator, error) + + WatchChainAdded(opts *bind.WatchOpts, sink chan<- *TokenPoolChainAdded) (event.Subscription, error) + + ParseChainAdded(log types.Log) (*TokenPoolChainAdded, error) + + FilterChainConfigured(opts *bind.FilterOpts) (*TokenPoolChainConfiguredIterator, error) + + WatchChainConfigured(opts *bind.WatchOpts, sink chan<- *TokenPoolChainConfigured) (event.Subscription, error) + + ParseChainConfigured(log types.Log) (*TokenPoolChainConfigured, error) + + FilterChainRemoved(opts *bind.FilterOpts) (*TokenPoolChainRemovedIterator, error) + + WatchChainRemoved(opts *bind.WatchOpts, sink chan<- *TokenPoolChainRemoved) (event.Subscription, error) + + ParseChainRemoved(log types.Log) (*TokenPoolChainRemoved, error) + + FilterLocked(opts *bind.FilterOpts, sender []common.Address) (*TokenPoolLockedIterator, error) + + WatchLocked(opts *bind.WatchOpts, sink chan<- *TokenPoolLocked, sender []common.Address) (event.Subscription, error) + + ParseLocked(log types.Log) (*TokenPoolLocked, error) + + FilterMinted(opts *bind.FilterOpts, sender []common.Address, recipient []common.Address) (*TokenPoolMintedIterator, error) + + WatchMinted(opts *bind.WatchOpts, sink chan<- *TokenPoolMinted, sender []common.Address, recipient []common.Address) (event.Subscription, error) + + ParseMinted(log types.Log) (*TokenPoolMinted, error) + + FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*TokenPoolOwnershipTransferRequestedIterator, error) + + WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *TokenPoolOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferRequested(log types.Log) (*TokenPoolOwnershipTransferRequested, error) + + FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*TokenPoolOwnershipTransferredIterator, error) + + WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *TokenPoolOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferred(log types.Log) (*TokenPoolOwnershipTransferred, error) + + FilterReleased(opts *bind.FilterOpts, sender []common.Address, recipient []common.Address) (*TokenPoolReleasedIterator, error) + + WatchReleased(opts *bind.WatchOpts, sink chan<- *TokenPoolReleased, sender []common.Address, recipient []common.Address) (event.Subscription, error) + + ParseReleased(log types.Log) (*TokenPoolReleased, error) + + FilterRouterUpdated(opts *bind.FilterOpts) (*TokenPoolRouterUpdatedIterator, error) + + WatchRouterUpdated(opts *bind.WatchOpts, sink chan<- *TokenPoolRouterUpdated) (event.Subscription, error) + + ParseRouterUpdated(log types.Log) (*TokenPoolRouterUpdated, error) + + ParseLog(log types.Log) (generated.AbigenLog, error) + + Address() common.Address +} diff --git a/core/gethwrappers/ccip/generated/usdc_reader_tester/usdc_reader_tester.go b/core/gethwrappers/ccip/generated/usdc_reader_tester/usdc_reader_tester.go new file mode 100644 index 00000000000..f9bd3b56efa --- /dev/null +++ b/core/gethwrappers/ccip/generated/usdc_reader_tester/usdc_reader_tester.go @@ -0,0 +1,333 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package usdc_reader_tester + +import ( + "errors" + "fmt" + "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" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" +) + +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +var USDCReaderTesterMetaData = &bind.MetaData{ + ABI: "[{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"MessageSent\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"version\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"sourceDomain\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"destinationDomain\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"recipient\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"destinationCaller\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"sender\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"nonce\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"messageBody\",\"type\":\"bytes\"}],\"name\":\"emitMessageSent\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", + Bin: "0x608060405234801561001057600080fd5b5061032c806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c806362826f1814610030575b600080fd5b61004361003e366004610129565b610045565b005b600061008d8a8a8a87898c8c8a8a8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506100d292505050565b90507f8c5261668696ce22758910d05bab8f186d6eb247ceac2af2e82c7dc17669b036816040516100be9190610228565b60405180910390a150505050505050505050565b606088888888888888886040516020016100f3989796959493929190610279565b604051602081830303815290604052905098975050505050505050565b803563ffffffff8116811461012457600080fd5b919050565b60008060008060008060008060006101008a8c03121561014857600080fd5b6101518a610110565b985061015f60208b01610110565b975061016d60408b01610110565b965060608a0135955060808a0135945060a08a0135935060c08a013567ffffffffffffffff80821682146101a057600080fd5b90935060e08b013590808211156101b657600080fd5b818c0191508c601f8301126101ca57600080fd5b8135818111156101d957600080fd5b8d60208285010111156101eb57600080fd5b6020830194508093505050509295985092959850929598565b60005b8381101561021f578181015183820152602001610207565b50506000910152565b6020815260008251806020840152610247816040850160208701610204565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b60007fffffffff00000000000000000000000000000000000000000000000000000000808b60e01b168352808a60e01b166004840152808960e01b166008840152507fffffffffffffffff0000000000000000000000000000000000000000000000008760c01b16600c830152856014830152846034830152836054830152825161030b816074850160208701610204565b91909101607401999850505050505050505056fea164736f6c6343000818000a", +} + +var USDCReaderTesterABI = USDCReaderTesterMetaData.ABI + +var USDCReaderTesterBin = USDCReaderTesterMetaData.Bin + +func DeployUSDCReaderTester(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *USDCReaderTester, error) { + parsed, err := USDCReaderTesterMetaData.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(USDCReaderTesterBin), backend) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &USDCReaderTester{address: address, abi: *parsed, USDCReaderTesterCaller: USDCReaderTesterCaller{contract: contract}, USDCReaderTesterTransactor: USDCReaderTesterTransactor{contract: contract}, USDCReaderTesterFilterer: USDCReaderTesterFilterer{contract: contract}}, nil +} + +type USDCReaderTester struct { + address common.Address + abi abi.ABI + USDCReaderTesterCaller + USDCReaderTesterTransactor + USDCReaderTesterFilterer +} + +type USDCReaderTesterCaller struct { + contract *bind.BoundContract +} + +type USDCReaderTesterTransactor struct { + contract *bind.BoundContract +} + +type USDCReaderTesterFilterer struct { + contract *bind.BoundContract +} + +type USDCReaderTesterSession struct { + Contract *USDCReaderTester + CallOpts bind.CallOpts + TransactOpts bind.TransactOpts +} + +type USDCReaderTesterCallerSession struct { + Contract *USDCReaderTesterCaller + CallOpts bind.CallOpts +} + +type USDCReaderTesterTransactorSession struct { + Contract *USDCReaderTesterTransactor + TransactOpts bind.TransactOpts +} + +type USDCReaderTesterRaw struct { + Contract *USDCReaderTester +} + +type USDCReaderTesterCallerRaw struct { + Contract *USDCReaderTesterCaller +} + +type USDCReaderTesterTransactorRaw struct { + Contract *USDCReaderTesterTransactor +} + +func NewUSDCReaderTester(address common.Address, backend bind.ContractBackend) (*USDCReaderTester, error) { + abi, err := abi.JSON(strings.NewReader(USDCReaderTesterABI)) + if err != nil { + return nil, err + } + contract, err := bindUSDCReaderTester(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &USDCReaderTester{address: address, abi: abi, USDCReaderTesterCaller: USDCReaderTesterCaller{contract: contract}, USDCReaderTesterTransactor: USDCReaderTesterTransactor{contract: contract}, USDCReaderTesterFilterer: USDCReaderTesterFilterer{contract: contract}}, nil +} + +func NewUSDCReaderTesterCaller(address common.Address, caller bind.ContractCaller) (*USDCReaderTesterCaller, error) { + contract, err := bindUSDCReaderTester(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &USDCReaderTesterCaller{contract: contract}, nil +} + +func NewUSDCReaderTesterTransactor(address common.Address, transactor bind.ContractTransactor) (*USDCReaderTesterTransactor, error) { + contract, err := bindUSDCReaderTester(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &USDCReaderTesterTransactor{contract: contract}, nil +} + +func NewUSDCReaderTesterFilterer(address common.Address, filterer bind.ContractFilterer) (*USDCReaderTesterFilterer, error) { + contract, err := bindUSDCReaderTester(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &USDCReaderTesterFilterer{contract: contract}, nil +} + +func bindUSDCReaderTester(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := USDCReaderTesterMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +func (_USDCReaderTester *USDCReaderTesterRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _USDCReaderTester.Contract.USDCReaderTesterCaller.contract.Call(opts, result, method, params...) +} + +func (_USDCReaderTester *USDCReaderTesterRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _USDCReaderTester.Contract.USDCReaderTesterTransactor.contract.Transfer(opts) +} + +func (_USDCReaderTester *USDCReaderTesterRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _USDCReaderTester.Contract.USDCReaderTesterTransactor.contract.Transact(opts, method, params...) +} + +func (_USDCReaderTester *USDCReaderTesterCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _USDCReaderTester.Contract.contract.Call(opts, result, method, params...) +} + +func (_USDCReaderTester *USDCReaderTesterTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _USDCReaderTester.Contract.contract.Transfer(opts) +} + +func (_USDCReaderTester *USDCReaderTesterTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _USDCReaderTester.Contract.contract.Transact(opts, method, params...) +} + +func (_USDCReaderTester *USDCReaderTesterTransactor) EmitMessageSent(opts *bind.TransactOpts, version uint32, sourceDomain uint32, destinationDomain uint32, recipient [32]byte, destinationCaller [32]byte, sender [32]byte, nonce uint64, messageBody []byte) (*types.Transaction, error) { + return _USDCReaderTester.contract.Transact(opts, "emitMessageSent", version, sourceDomain, destinationDomain, recipient, destinationCaller, sender, nonce, messageBody) +} + +func (_USDCReaderTester *USDCReaderTesterSession) EmitMessageSent(version uint32, sourceDomain uint32, destinationDomain uint32, recipient [32]byte, destinationCaller [32]byte, sender [32]byte, nonce uint64, messageBody []byte) (*types.Transaction, error) { + return _USDCReaderTester.Contract.EmitMessageSent(&_USDCReaderTester.TransactOpts, version, sourceDomain, destinationDomain, recipient, destinationCaller, sender, nonce, messageBody) +} + +func (_USDCReaderTester *USDCReaderTesterTransactorSession) EmitMessageSent(version uint32, sourceDomain uint32, destinationDomain uint32, recipient [32]byte, destinationCaller [32]byte, sender [32]byte, nonce uint64, messageBody []byte) (*types.Transaction, error) { + return _USDCReaderTester.Contract.EmitMessageSent(&_USDCReaderTester.TransactOpts, version, sourceDomain, destinationDomain, recipient, destinationCaller, sender, nonce, messageBody) +} + +type USDCReaderTesterMessageSentIterator struct { + Event *USDCReaderTesterMessageSent + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *USDCReaderTesterMessageSentIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(USDCReaderTesterMessageSent) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(USDCReaderTesterMessageSent) + 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() + } +} + +func (it *USDCReaderTesterMessageSentIterator) Error() error { + return it.fail +} + +func (it *USDCReaderTesterMessageSentIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type USDCReaderTesterMessageSent struct { + Arg0 []byte + Raw types.Log +} + +func (_USDCReaderTester *USDCReaderTesterFilterer) FilterMessageSent(opts *bind.FilterOpts) (*USDCReaderTesterMessageSentIterator, error) { + + logs, sub, err := _USDCReaderTester.contract.FilterLogs(opts, "MessageSent") + if err != nil { + return nil, err + } + return &USDCReaderTesterMessageSentIterator{contract: _USDCReaderTester.contract, event: "MessageSent", logs: logs, sub: sub}, nil +} + +func (_USDCReaderTester *USDCReaderTesterFilterer) WatchMessageSent(opts *bind.WatchOpts, sink chan<- *USDCReaderTesterMessageSent) (event.Subscription, error) { + + logs, sub, err := _USDCReaderTester.contract.WatchLogs(opts, "MessageSent") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(USDCReaderTesterMessageSent) + if err := _USDCReaderTester.contract.UnpackLog(event, "MessageSent", 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 +} + +func (_USDCReaderTester *USDCReaderTesterFilterer) ParseMessageSent(log types.Log) (*USDCReaderTesterMessageSent, error) { + event := new(USDCReaderTesterMessageSent) + if err := _USDCReaderTester.contract.UnpackLog(event, "MessageSent", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +func (_USDCReaderTester *USDCReaderTester) ParseLog(log types.Log) (generated.AbigenLog, error) { + switch log.Topics[0] { + case _USDCReaderTester.abi.Events["MessageSent"].ID: + return _USDCReaderTester.ParseMessageSent(log) + + default: + return nil, fmt.Errorf("abigen wrapper received unknown log topic: %v", log.Topics[0]) + } +} + +func (USDCReaderTesterMessageSent) Topic() common.Hash { + return common.HexToHash("0x8c5261668696ce22758910d05bab8f186d6eb247ceac2af2e82c7dc17669b036") +} + +func (_USDCReaderTester *USDCReaderTester) Address() common.Address { + return _USDCReaderTester.address +} + +type USDCReaderTesterInterface interface { + EmitMessageSent(opts *bind.TransactOpts, version uint32, sourceDomain uint32, destinationDomain uint32, recipient [32]byte, destinationCaller [32]byte, sender [32]byte, nonce uint64, messageBody []byte) (*types.Transaction, error) + + FilterMessageSent(opts *bind.FilterOpts) (*USDCReaderTesterMessageSentIterator, error) + + WatchMessageSent(opts *bind.WatchOpts, sink chan<- *USDCReaderTesterMessageSent) (event.Subscription, error) + + ParseMessageSent(log types.Log) (*USDCReaderTesterMessageSent, error) + + ParseLog(log types.Log) (generated.AbigenLog, error) + + Address() common.Address +} diff --git a/core/gethwrappers/ccip/generated/usdc_token_pool/usdc_token_pool.go b/core/gethwrappers/ccip/generated/usdc_token_pool/usdc_token_pool.go new file mode 100644 index 00000000000..3e754d5cb78 --- /dev/null +++ b/core/gethwrappers/ccip/generated/usdc_token_pool/usdc_token_pool.go @@ -0,0 +1,3223 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package usdc_token_pool + +import ( + "errors" + "fmt" + "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" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" +) + +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +type PoolLockOrBurnInV1 struct { + Receiver []byte + RemoteChainSelector uint64 + OriginalSender common.Address + Amount *big.Int + LocalToken common.Address +} + +type PoolLockOrBurnOutV1 struct { + DestTokenAddress []byte + DestPoolData []byte +} + +type PoolReleaseOrMintInV1 struct { + OriginalSender []byte + RemoteChainSelector uint64 + Receiver common.Address + Amount *big.Int + LocalToken common.Address + SourcePoolAddress []byte + SourcePoolData []byte + OffchainTokenData []byte +} + +type PoolReleaseOrMintOutV1 struct { + DestinationAmount *big.Int +} + +type RateLimiterConfig struct { + IsEnabled bool + Capacity *big.Int + Rate *big.Int +} + +type RateLimiterTokenBucket struct { + Tokens *big.Int + LastUpdated uint32 + IsEnabled bool + Capacity *big.Int + Rate *big.Int +} + +type TokenPoolChainUpdate struct { + RemoteChainSelector uint64 + Allowed bool + RemotePoolAddress []byte + RemoteTokenAddress []byte + OutboundRateLimiterConfig RateLimiterConfig + InboundRateLimiterConfig RateLimiterConfig +} + +type USDCTokenPoolDomain struct { + AllowedCaller [32]byte + DomainIdentifier uint32 + Enabled bool +} + +type USDCTokenPoolDomainUpdate struct { + AllowedCaller [32]byte + DomainIdentifier uint32 + DestChainSelector uint64 + Enabled bool +} + +var USDCTokenPoolMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"internalType\":\"contractITokenMessenger\",\"name\":\"tokenMessenger\",\"type\":\"address\"},{\"internalType\":\"contractIERC20\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"allowlist\",\"type\":\"address[]\"},{\"internalType\":\"address\",\"name\":\"rmnProxy\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"router\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"capacity\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"requested\",\"type\":\"uint256\"}],\"name\":\"AggregateValueMaxCapacityExceeded\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"minWaitInSeconds\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"available\",\"type\":\"uint256\"}],\"name\":\"AggregateValueRateLimitReached\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"AllowListNotEnabled\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"BucketOverfilled\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"}],\"name\":\"CallerIsNotARampOnRouter\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"}],\"name\":\"ChainAlreadyExists\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"ChainNotAllowed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"CursedByRMN\",\"type\":\"error\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"config\",\"type\":\"tuple\"}],\"name\":\"DisabledNonZeroRateLimit\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidConfig\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"expected\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"got\",\"type\":\"uint32\"}],\"name\":\"InvalidDestinationDomain\",\"type\":\"error\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"allowedCaller\",\"type\":\"bytes32\"},{\"internalType\":\"uint32\",\"name\":\"domainIdentifier\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"bool\",\"name\":\"enabled\",\"type\":\"bool\"}],\"internalType\":\"structUSDCTokenPool.DomainUpdate\",\"name\":\"domain\",\"type\":\"tuple\"}],\"name\":\"InvalidDomain\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"version\",\"type\":\"uint32\"}],\"name\":\"InvalidMessageVersion\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"expected\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"got\",\"type\":\"uint64\"}],\"name\":\"InvalidNonce\",\"type\":\"error\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"rateLimiterConfig\",\"type\":\"tuple\"}],\"name\":\"InvalidRateLimitRate\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"receiver\",\"type\":\"bytes\"}],\"name\":\"InvalidReceiver\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"expected\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"got\",\"type\":\"uint32\"}],\"name\":\"InvalidSourceDomain\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"sourcePoolAddress\",\"type\":\"bytes\"}],\"name\":\"InvalidSourcePoolAddress\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"InvalidToken\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"version\",\"type\":\"uint32\"}],\"name\":\"InvalidTokenMessengerVersion\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"NonExistentChain\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RateLimitMustBeDisabled\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"SenderNotAllowed\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"capacity\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"requested\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"}],\"name\":\"TokenMaxCapacityExceeded\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"minWaitInSeconds\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"available\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"}],\"name\":\"TokenRateLimitReached\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"}],\"name\":\"Unauthorized\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"domain\",\"type\":\"uint64\"}],\"name\":\"UnknownDomain\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UnlockingUSDCFailed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddressNotAllowed\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"AllowListAdd\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"AllowListRemove\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Burned\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"remoteToken\",\"type\":\"bytes\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"indexed\":false,\"internalType\":\"structRateLimiter.Config\",\"name\":\"outboundRateLimiterConfig\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"indexed\":false,\"internalType\":\"structRateLimiter.Config\",\"name\":\"inboundRateLimiterConfig\",\"type\":\"tuple\"}],\"name\":\"ChainAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"indexed\":false,\"internalType\":\"structRateLimiter.Config\",\"name\":\"outboundRateLimiterConfig\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"indexed\":false,\"internalType\":\"structRateLimiter.Config\",\"name\":\"inboundRateLimiterConfig\",\"type\":\"tuple\"}],\"name\":\"ChainConfigured\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"ChainRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"indexed\":false,\"internalType\":\"structRateLimiter.Config\",\"name\":\"config\",\"type\":\"tuple\"}],\"name\":\"ConfigChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"tokenMessenger\",\"type\":\"address\"}],\"name\":\"ConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"allowedCaller\",\"type\":\"bytes32\"},{\"internalType\":\"uint32\",\"name\":\"domainIdentifier\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"bool\",\"name\":\"enabled\",\"type\":\"bool\"}],\"indexed\":false,\"internalType\":\"structUSDCTokenPool.DomainUpdate[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"name\":\"DomainsSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Locked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Minted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Released\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"previousPoolAddress\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"remotePoolAddress\",\"type\":\"bytes\"}],\"name\":\"RemotePoolSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"oldRouter\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newRouter\",\"type\":\"address\"}],\"name\":\"RouterUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokens\",\"type\":\"uint256\"}],\"name\":\"TokensConsumed\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"SUPPORTED_USDC_VERSION\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"removes\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"adds\",\"type\":\"address[]\"}],\"name\":\"applyAllowListUpdates\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"bool\",\"name\":\"allowed\",\"type\":\"bool\"},{\"internalType\":\"bytes\",\"name\":\"remotePoolAddress\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"remoteTokenAddress\",\"type\":\"bytes\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"outboundRateLimiterConfig\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"inboundRateLimiterConfig\",\"type\":\"tuple\"}],\"internalType\":\"structTokenPool.ChainUpdate[]\",\"name\":\"chains\",\"type\":\"tuple[]\"}],\"name\":\"applyChainUpdates\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAllowList\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAllowListEnabled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"getCurrentInboundRateLimiterState\",\"outputs\":[{\"components\":[{\"internalType\":\"uint128\",\"name\":\"tokens\",\"type\":\"uint128\"},{\"internalType\":\"uint32\",\"name\":\"lastUpdated\",\"type\":\"uint32\"},{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.TokenBucket\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"getCurrentOutboundRateLimiterState\",\"outputs\":[{\"components\":[{\"internalType\":\"uint128\",\"name\":\"tokens\",\"type\":\"uint128\"},{\"internalType\":\"uint32\",\"name\":\"lastUpdated\",\"type\":\"uint32\"},{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.TokenBucket\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"}],\"name\":\"getDomain\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"allowedCaller\",\"type\":\"bytes32\"},{\"internalType\":\"uint32\",\"name\":\"domainIdentifier\",\"type\":\"uint32\"},{\"internalType\":\"bool\",\"name\":\"enabled\",\"type\":\"bool\"}],\"internalType\":\"structUSDCTokenPool.Domain\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRateLimitAdmin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"getRemotePool\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"getRemoteToken\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRmnProxy\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"rmnProxy\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRouter\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"router\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getSupportedChains\",\"outputs\":[{\"internalType\":\"uint64[]\",\"name\":\"\",\"type\":\"uint64[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getToken\",\"outputs\":[{\"internalType\":\"contractIERC20\",\"name\":\"token\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"i_localDomainIdentifier\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"i_messageTransmitter\",\"outputs\":[{\"internalType\":\"contractIMessageTransmitter\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"i_tokenMessenger\",\"outputs\":[{\"internalType\":\"contractITokenMessenger\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"isSupportedChain\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"isSupportedToken\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes\",\"name\":\"receiver\",\"type\":\"bytes\"},{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"originalSender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"localToken\",\"type\":\"address\"}],\"internalType\":\"structPool.LockOrBurnInV1\",\"name\":\"lockOrBurnIn\",\"type\":\"tuple\"}],\"name\":\"lockOrBurn\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes\",\"name\":\"destTokenAddress\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"destPoolData\",\"type\":\"bytes\"}],\"internalType\":\"structPool.LockOrBurnOutV1\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes\",\"name\":\"originalSender\",\"type\":\"bytes\"},{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"localToken\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"sourcePoolAddress\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"sourcePoolData\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"offchainTokenData\",\"type\":\"bytes\"}],\"internalType\":\"structPool.ReleaseOrMintInV1\",\"name\":\"releaseOrMintIn\",\"type\":\"tuple\"}],\"name\":\"releaseOrMint\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"destinationAmount\",\"type\":\"uint256\"}],\"internalType\":\"structPool.ReleaseOrMintOutV1\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"outboundConfig\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"inboundConfig\",\"type\":\"tuple\"}],\"name\":\"setChainRateLimiterConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"allowedCaller\",\"type\":\"bytes32\"},{\"internalType\":\"uint32\",\"name\":\"domainIdentifier\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"bool\",\"name\":\"enabled\",\"type\":\"bool\"}],\"internalType\":\"structUSDCTokenPool.DomainUpdate[]\",\"name\":\"domains\",\"type\":\"tuple[]\"}],\"name\":\"setDomains\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"rateLimitAdmin\",\"type\":\"address\"}],\"name\":\"setRateLimitAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"remotePoolAddress\",\"type\":\"bytes\"}],\"name\":\"setRemotePool\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newRouter\",\"type\":\"address\"}],\"name\":\"setRouter\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", + Bin: "0x6101406040523480156200001257600080fd5b50604051620052c6380380620052c6833981016040819052620000359162000b4c565b838383833380600081620000905760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000c357620000c3816200041b565b5050506001600160a01b0384161580620000e457506001600160a01b038116155b80620000f757506001600160a01b038216155b1562000116576040516342bcdf7f60e11b815260040160405180910390fd5b6001600160a01b0384811660805282811660a052600480546001600160a01b031916918316919091179055825115801560c0526200016957604080516000815260208101909152620001699084620004c6565b5050506001600160a01b038616905062000196576040516306b7c75960e31b815260040160405180910390fd5b6000856001600160a01b0316632c1219216040518163ffffffff1660e01b8152600401602060405180830381865afa158015620001d7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001fd919062000c72565b90506000816001600160a01b03166354fd4d506040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000240573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000266919062000c99565b905063ffffffff81161562000297576040516334697c6b60e11b815263ffffffff8216600482015260240162000087565b6000876001600160a01b0316639cdbb1816040518163ffffffff1660e01b8152600401602060405180830381865afa158015620002d8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620002fe919062000c99565b905063ffffffff8116156200032f576040516316ba39c560e31b815263ffffffff8216600482015260240162000087565b6001600160a01b0380891660e05283166101008190526040805163234d8e3d60e21b81529051638d3638f4916004808201926020929091908290030181865afa15801562000381573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620003a7919062000c99565b63ffffffff166101205260e051608051620003d1916001600160a01b039091169060001962000623565b6040516001600160a01b03891681527f2e902d38f15b233cbb63711add0fca4545334d3a169d60c0a616494d7eea95449060200160405180910390a1505050505050505062000de6565b336001600160a01b03821603620004755760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640162000087565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b60c051620004e7576040516335f4a7b360e01b815260040160405180910390fd5b60005b8251811015620005725760008382815181106200050b576200050b62000cc1565b602090810291909101015190506200052560028262000709565b1562000568576040516001600160a01b03821681527f800671136ab6cfee9fbe5ed1fb7ca417811aca3cf864800d127b927adedf75669060200160405180910390a15b50600101620004ea565b5060005b81518110156200061e57600082828151811062000597576200059762000cc1565b6020026020010151905060006001600160a01b0316816001600160a01b031603620005c3575062000615565b620005d060028262000729565b1562000613576040516001600160a01b03821681527f2640d4d76caf8bf478aabfa982fa4e1c4eb71a37f93cd15e80dbc657911546d89060200160405180910390a15b505b60010162000576565b505050565b604051636eb1769f60e11b81523060048201526001600160a01b038381166024830152600091839186169063dd62ed3e90604401602060405180830381865afa15801562000675573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200069b919062000cd7565b620006a7919062000d07565b604080516001600160a01b038616602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b0390811663095ea7b360e01b1790915291925062000703918691906200074016565b50505050565b600062000720836001600160a01b03841662000811565b90505b92915050565b600062000720836001600160a01b03841662000915565b6040805180820190915260208082527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564908201526000906200078f906001600160a01b03851690849062000967565b8051909150156200061e5780806020019051810190620007b0919062000d1d565b6200061e5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840162000087565b600081815260018301602052604081205480156200090a5760006200083860018362000d41565b85549091506000906200084e9060019062000d41565b9050808214620008ba57600086600001828154811062000872576200087262000cc1565b906000526020600020015490508087600001848154811062000898576200089862000cc1565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080620008ce57620008ce62000d57565b60019003818190600052602060002001600090559055856001016000868152602001908152602001600020600090556001935050505062000723565b600091505062000723565b60008181526001830160205260408120546200095e5750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915562000723565b50600062000723565b606062000978848460008562000980565b949350505050565b606082471015620009e35760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840162000087565b600080866001600160a01b0316858760405162000a01919062000d93565b60006040518083038185875af1925050503d806000811462000a40576040519150601f19603f3d011682016040523d82523d6000602084013e62000a45565b606091505b50909250905062000a598783838762000a64565b979650505050505050565b6060831562000ad857825160000362000ad0576001600160a01b0385163b62000ad05760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640162000087565b508162000978565b62000978838381511562000aef5781518083602001fd5b8060405162461bcd60e51b815260040162000087919062000db1565b6001600160a01b038116811462000b2157600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b805162000b478162000b0b565b919050565b600080600080600060a0868803121562000b6557600080fd5b855162000b728162000b0b565b8095505060208087015162000b878162000b0b565b60408801519095506001600160401b038082111562000ba557600080fd5b818901915089601f83011262000bba57600080fd5b81518181111562000bcf5762000bcf62000b24565b8060051b604051601f19603f8301168101818110858211171562000bf75762000bf762000b24565b60405291825284820192508381018501918c83111562000c1657600080fd5b938501935b8285101562000c3f5762000c2f8562000b3a565b8452938501939285019262000c1b565b80985050505050505062000c566060870162000b3a565b915062000c666080870162000b3a565b90509295509295909350565b60006020828403121562000c8557600080fd5b815162000c928162000b0b565b9392505050565b60006020828403121562000cac57600080fd5b815163ffffffff8116811462000c9257600080fd5b634e487b7160e01b600052603260045260246000fd5b60006020828403121562000cea57600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b8082018082111562000723576200072362000cf1565b60006020828403121562000d3057600080fd5b8151801515811462000c9257600080fd5b8181038181111562000723576200072362000cf1565b634e487b7160e01b600052603160045260246000fd5b60005b8381101562000d8a57818101518382015260200162000d70565b50506000910152565b6000825162000da781846020870162000d6d565b9190910192915050565b602081526000825180602084015262000dd281604085016020870162000d6d565b601f01601f19169190910160400192915050565b60805160a05160c05160e051610100516101205161442762000e9f60003960008181610382015281816111d101528181611e4a0152611ea80152600081816106760152610a7801526000818161035b01526110e701526000818161063a01528181611f45015261288001526000818161057601528181611c4801526121fb01526000818161028f015281816102e4015281816110b101528181611b680152818161211b015281816128160152612a6b01526144276000f3fe608060405234801561001057600080fd5b50600436106101ef5760003560e01c80639a4575b91161010f578063c75eea9c116100a2578063dfadfa3511610071578063dfadfa351461059a578063e0351e1314610638578063f2fde38b1461065e578063fbf84dd71461067157600080fd5b8063c75eea9c1461053b578063cf7401f31461054e578063db6327dc14610561578063dc0bd9711461057457600080fd5b8063b0f479a1116100de578063b0f479a1146104e2578063b794658014610500578063c0d7865514610513578063c4bffe2b1461052657600080fd5b80639a4575b9146104365780639fdf13ff14610456578063a7cd63b71461045e578063af58d59f1461047357600080fd5b80636155cda01161018757806379ba50971161015657806379ba5097146103ea5780637d54534e146103f25780638926f54f146104055780638da5cb5b1461041857600080fd5b80636155cda0146103565780636b716b0d1461037d5780636d3d1a58146103b957806378a010b2146103d757600080fd5b806321df0da7116101c357806321df0da71461028d578063240028e8146102d4578063390775371461032157806354c8a4f31461034357600080fd5b806241d3c1146101f457806301ffc9a7146102095780630a2fd49314610231578063181f5a7714610251575b600080fd5b61020761020236600461320e565b610698565b005b61021c610217366004613283565b610835565b60405190151581526020015b60405180910390f35b61024461023f3660046132eb565b61091a565b604051610228919061336c565b6102446040518060400160405280601381526020017f55534443546f6b656e506f6f6c20312e352e300000000000000000000000000081525081565b7f00000000000000000000000000000000000000000000000000000000000000005b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610228565b61021c6102e23660046133ac565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff90811691161490565b61033461032f3660046133c9565b6109ca565b60405190518152602001610228565b610207610351366004613451565b610bb7565b6102af7f000000000000000000000000000000000000000000000000000000000000000081565b6103a47f000000000000000000000000000000000000000000000000000000000000000081565b60405163ffffffff9091168152602001610228565b60085473ffffffffffffffffffffffffffffffffffffffff166102af565b6102076103e53660046134bd565b610c32565b610207610da1565b6102076104003660046133ac565b610e9e565b61021c6104133660046132eb565b610eed565b60005473ffffffffffffffffffffffffffffffffffffffff166102af565b610449610444366004613542565b610f04565b604051610228919061357d565b6103a4600081565b61046661124c565b60405161022891906135dd565b6104866104813660046132eb565b61125d565b604051610228919081516fffffffffffffffffffffffffffffffff908116825260208084015163ffffffff1690830152604080840151151590830152606080840151821690830152608092830151169181019190915260a00190565b60045473ffffffffffffffffffffffffffffffffffffffff166102af565b61024461050e3660046132eb565b611332565b6102076105213660046133ac565b61135d565b61052e611431565b6040516102289190613637565b6104866105493660046132eb565b6114e9565b61020761055c3660046137c2565b6115bb565b61020761056f366004613809565b611644565b7f00000000000000000000000000000000000000000000000000000000000000006102af565b61060e6105a83660046132eb565b60408051606080820183526000808352602080840182905292840181905267ffffffffffffffff949094168452600982529282902082519384018352805484526001015463ffffffff811691840191909152640100000000900460ff1615159082015290565b604080518251815260208084015163ffffffff169082015291810151151590820152606001610228565b7f000000000000000000000000000000000000000000000000000000000000000061021c565b61020761066c3660046133ac565b611aca565b6102af7f000000000000000000000000000000000000000000000000000000000000000081565b6106a0611ade565b60005b818110156107f75760008383838181106106bf576106bf61384b565b9050608002018036038101906106d5919061388e565b805190915015806106f25750604081015167ffffffffffffffff16155b1561076157604080517fa087bd2900000000000000000000000000000000000000000000000000000000815282516004820152602083015163ffffffff1660248201529082015167ffffffffffffffff1660448201526060820151151560648201526084015b60405180910390fd5b60408051606080820183528351825260208085015163ffffffff9081168285019081529286015115158486019081529585015167ffffffffffffffff166000908152600990925293902091518255516001918201805494511515640100000000027fffffffffffffffffffffffffffffffffffffffffffffffffffffff00000000009095169190931617929092179055016106a3565b507f1889010d2535a0ab1643678d1da87fbbe8b87b2f585b47ddb72ec622aef9ee568282604051610829929190613908565b60405180910390a15050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167faff2afbf0000000000000000000000000000000000000000000000000000000014806108c857507fffffffff0000000000000000000000000000000000000000000000000000000082167f0e64dd2900000000000000000000000000000000000000000000000000000000145b8061091457507fffffffff0000000000000000000000000000000000000000000000000000000082167f01ffc9a700000000000000000000000000000000000000000000000000000000145b92915050565b67ffffffffffffffff811660009081526007602052604090206004018054606091906109459061398f565b80601f01602080910402602001604051908101604052809291908181526020018280546109719061398f565b80156109be5780601f10610993576101008083540402835291602001916109be565b820191906000526020600020905b8154815290600101906020018083116109a157829003601f168201915b50505050509050919050565b6040805160208101909152600081526109ea6109e583613a8d565b611b61565b60006109f960c0840184613b82565b810190610a069190613be7565b90506000610a1760e0850185613b82565b810190610a249190613c26565b9050610a34816000015183611d92565b805160208201516040517f57ecfd2800000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016926357ecfd2892610aab92600401613cb7565b6020604051808303816000875af1158015610aca573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aee9190613cdc565b610b24576040517fbf969f2200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610b3460608501604086016133ac565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f9d228d69b5fdb8d273a2336f8fb8612d039631024ea9bf09c424a9503aa078f08660600135604051610b9691815260200190565b60405180910390a35050604080516020810190915260609092013582525090565b610bbf611ade565b610c2c84848080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808802828101820190935287825290935087925086918291850190849080828437600092019190915250611f4392505050565b50505050565b610c3a611ade565b610c4383610eed565b610c85576040517f1e670e4b00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff84166004820152602401610758565b67ffffffffffffffff831660009081526007602052604081206004018054610cac9061398f565b80601f0160208091040260200160405190810160405280929190818152602001828054610cd89061398f565b8015610d255780601f10610cfa57610100808354040283529160200191610d25565b820191906000526020600020905b815481529060010190602001808311610d0857829003601f168201915b5050505067ffffffffffffffff8616600090815260076020526040902091925050600401610d54838583613d41565b508367ffffffffffffffff167fdb4d6220746a38cbc5335f7e108f7de80f482f4d23350253dfd0917df75a14bf828585604051610d9393929190613ea5565b60405180910390a250505050565b60015473ffffffffffffffffffffffffffffffffffffffff163314610e22576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e6572000000000000000000006044820152606401610758565b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b610ea6611ade565b600880547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b6000610914600567ffffffffffffffff84166120f9565b6040805180820190915260608082526020820152610f29610f2483613ed5565b612114565b6000600981610f3e60408601602087016132eb565b67ffffffffffffffff168152602080820192909252604090810160002081516060810183528154815260019091015463ffffffff81169382019390935264010000000090920460ff161515908201819052909150610fe557610fa660408401602085016132eb565b6040517fd201c48a00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff9091166004820152602401610758565b610fef8380613b82565b9050602014611036576110028380613b82565b6040517fa3c8cf09000000000000000000000000000000000000000000000000000000008152600401610758929190613f79565b60006110428480613b82565b81019061104f9190613f8d565b602083015183516040517ff856ddb60000000000000000000000000000000000000000000000000000000081526060880135600482015263ffffffff90921660248301526044820183905273ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000008116606484015260848301919091529192506000917f0000000000000000000000000000000000000000000000000000000000000000169063f856ddb69060a4016020604051808303816000875af1158015611130573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111549190613fa6565b6040516060870135815290915033907f696de425f79f4a40bc6d2122ca50507f0efbeabbff86a84871b7196ab8ea8df79060200160405180910390a260405180604001604052806111b187602001602081019061050e91906132eb565b815260408051808201825267ffffffffffffffff851680825263ffffffff7f00000000000000000000000000000000000000000000000000000000000000008116602093840190815284518085019390935251169281019290925290910190606001604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152919052905295945050505050565b606061125860026122de565b905090565b6040805160a08101825260008082526020820181905291810182905260608101829052608081019190915267ffffffffffffffff8216600090815260076020908152604091829020825160a08101845260028201546fffffffffffffffffffffffffffffffff808216835270010000000000000000000000000000000080830463ffffffff16958401959095527401000000000000000000000000000000000000000090910460ff161515948201949094526003909101548084166060830152919091049091166080820152610914906122eb565b67ffffffffffffffff811660009081526007602052604090206005018054606091906109459061398f565b611365611ade565b73ffffffffffffffffffffffffffffffffffffffff81166113b2576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6004805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff000000000000000000000000000000000000000083168117909355604080519190921680825260208201939093527f02dc5c233404867c793b749c6d644beb2277536d18a7e7974d3f238e4c6f16849101610829565b6060600061143f60056122de565b90506000815167ffffffffffffffff81111561145d5761145d613679565b604051908082528060200260200182016040528015611486578160200160208202803683370190505b50905060005b82518110156114e2578281815181106114a7576114a761384b565b60200260200101518282815181106114c1576114c161384b565b67ffffffffffffffff9092166020928302919091019091015260010161148c565b5092915050565b6040805160a08101825260008082526020820181905291810182905260608101829052608081019190915267ffffffffffffffff8216600090815260076020908152604091829020825160a08101845281546fffffffffffffffffffffffffffffffff808216835270010000000000000000000000000000000080830463ffffffff16958401959095527401000000000000000000000000000000000000000090910460ff161515948201949094526001909101548084166060830152919091049091166080820152610914906122eb565b60085473ffffffffffffffffffffffffffffffffffffffff1633148015906115fb575060005473ffffffffffffffffffffffffffffffffffffffff163314155b15611634576040517f8e4a23d6000000000000000000000000000000000000000000000000000000008152336004820152602401610758565b61163f83838361239d565b505050565b61164c611ade565b60005b8181101561163f57600083838381811061166b5761166b61384b565b905060200281019061167d9190613fc3565b61168690614001565b905061169b8160800151826020015115612487565b6116ae8160a00151826020015115612487565b8060200151156119aa5780516116d09060059067ffffffffffffffff166125c0565b6117155780516040517f1d5ad3c500000000000000000000000000000000000000000000000000000000815267ffffffffffffffff9091166004820152602401610758565b604081015151158061172a5750606081015151155b15611761576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040805161012081018252608083810180516020908101516fffffffffffffffffffffffffffffffff9081168486019081524263ffffffff90811660a0808901829052865151151560c08a01528651860151851660e08a015295518901518416610100890152918752875180860189529489018051850151841686528585019290925281515115158589015281518401518316606080870191909152915188015183168587015283870194855288880151878901908152828a015183890152895167ffffffffffffffff1660009081526007865289902088518051825482890151838e01519289167fffffffffffffffffffffffff0000000000000000000000000000000000000000928316177001000000000000000000000000000000009188168202177fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff90811674010000000000000000000000000000000000000000941515850217865584890151948d0151948a16948a168202949094176001860155995180516002860180549b8301519f830151918b169b9093169a909a179d9096168a029c909c1790911696151502959095179098559081015194015193811693169091029190911760038201559151909190600482019061194290826140b5565b506060820151600582019061195790826140b5565b505081516060830151608084015160a08501516040517f8d340f17e19058004c20453540862a9c62778504476f6756755cb33bcd6c38c2955061199d94939291906141cf565b60405180910390a1611ac1565b80516119c29060059067ffffffffffffffff166125cc565b611a075780516040517f1e670e4b00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff9091166004820152602401610758565b805167ffffffffffffffff16600090815260076020526040812080547fffffffffffffffffffffff00000000000000000000000000000000000000000090811682556001820183905560028201805490911690556003810182905590611a7060048301826131c0565b611a7e6005830160006131c0565b5050805160405167ffffffffffffffff90911681527f5204aec90a3c794d8e90fded8b46ae9c7c552803e7e832e0c1d358396d8599169060200160405180910390a15b5060010161164f565b611ad2611ade565b611adb816125d8565b50565b60005473ffffffffffffffffffffffffffffffffffffffff163314611b5f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e6572000000000000000000006044820152606401610758565b565b60808101517f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff908116911614611bf65760808101516040517f961c9a4f00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9091166004820152602401610758565b60208101516040517f2cbc26bb00000000000000000000000000000000000000000000000000000000815260809190911b77ffffffffffffffff000000000000000000000000000000001660048201527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1690632cbc26bb90602401602060405180830381865afa158015611ca4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611cc89190613cdc565b15611cff576040517f53ad11d800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611d0c81602001516126cd565b6000611d1b826020015161091a565b9050805160001480611d3f575080805190602001208260a001518051906020012014155b15611d7c578160a001516040517f24eb47e5000000000000000000000000000000000000000000000000000000008152600401610758919061336c565b611d8e826020015183606001516127f3565b5050565b600482015163ffffffff811615611ddd576040517f68d2f8d600000000000000000000000000000000000000000000000000000000815263ffffffff82166004820152602401610758565b6008830151600c8401516014850151602085015163ffffffff808516911614611e485760208501516040517fe366a11700000000000000000000000000000000000000000000000000000000815263ffffffff91821660048201529084166024820152604401610758565b7f000000000000000000000000000000000000000000000000000000000000000063ffffffff168263ffffffff1614611edd576040517f77e4802600000000000000000000000000000000000000000000000000000000815263ffffffff7f00000000000000000000000000000000000000000000000000000000000000008116600483015283166024820152604401610758565b845167ffffffffffffffff828116911614611f3b5784516040517ff917ffea00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff91821660048201529082166024820152604401610758565b505050505050565b7f0000000000000000000000000000000000000000000000000000000000000000611f9a576040517f35f4a7b300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b8251811015612030576000838281518110611fba57611fba61384b565b60200260200101519050611fd881600261283a90919063ffffffff16565b156120275760405173ffffffffffffffffffffffffffffffffffffffff821681527f800671136ab6cfee9fbe5ed1fb7ca417811aca3cf864800d127b927adedf75669060200160405180910390a15b50600101611f9d565b5060005b815181101561163f5760008282815181106120515761205161384b565b60200260200101519050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff160361209557506120f1565b6120a060028261285c565b156120ef5760405173ffffffffffffffffffffffffffffffffffffffff821681527f2640d4d76caf8bf478aabfa982fa4e1c4eb71a37f93cd15e80dbc657911546d89060200160405180910390a15b505b600101612034565b600081815260018301602052604081205415155b9392505050565b60808101517f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff9081169116146121a95760808101516040517f961c9a4f00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9091166004820152602401610758565b60208101516040517f2cbc26bb00000000000000000000000000000000000000000000000000000000815260809190911b77ffffffffffffffff000000000000000000000000000000001660048201527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1690632cbc26bb90602401602060405180830381865afa158015612257573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061227b9190613cdc565b156122b2576040517f53ad11d800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6122bf816040015161287e565b6122cc81602001516128fd565b611adb81602001518260600151612a4b565b6060600061210d83612a8f565b6040805160a08101825260008082526020820181905291810182905260608101829052608081019190915261237982606001516fffffffffffffffffffffffffffffffff1683600001516fffffffffffffffffffffffffffffffff16846020015163ffffffff164261235d9190614297565b85608001516fffffffffffffffffffffffffffffffff16612aea565b6fffffffffffffffffffffffffffffffff1682525063ffffffff4216602082015290565b6123a683610eed565b6123e8576040517f1e670e4b00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff84166004820152602401610758565b6123f3826000612487565b67ffffffffffffffff831660009081526007602052604090206124169083612b14565b612421816000612487565b67ffffffffffffffff831660009081526007602052604090206124479060020182612b14565b7f0350d63aa5f270e01729d00d627eeb8f3429772b1818c016c66a588a864f912b83838360405161247a939291906142aa565b60405180910390a1505050565b81511561254e5781602001516fffffffffffffffffffffffffffffffff1682604001516fffffffffffffffffffffffffffffffff161015806124dd575060408201516fffffffffffffffffffffffffffffffff16155b1561251657816040517f8020d124000000000000000000000000000000000000000000000000000000008152600401610758919061432d565b8015611d8e576040517f433fc33d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60408201516fffffffffffffffffffffffffffffffff16151580612587575060208201516fffffffffffffffffffffffffffffffff1615155b15611d8e57816040517fd68af9cc000000000000000000000000000000000000000000000000000000008152600401610758919061432d565b600061210d8383612cb6565b600061210d8383612d05565b3373ffffffffffffffffffffffffffffffffffffffff821603612657576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c660000000000000000006044820152606401610758565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b6126d681610eed565b612718576040517fa9902c7e00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff82166004820152602401610758565b600480546040517f83826b2b00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff84169281019290925233602483015273ffffffffffffffffffffffffffffffffffffffff16906383826b2b90604401602060405180830381865afa158015612797573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127bb9190613cdc565b611adb576040517f728fe07b000000000000000000000000000000000000000000000000000000008152336004820152602401610758565b67ffffffffffffffff82166000908152600760205260409020611d8e90600201827f0000000000000000000000000000000000000000000000000000000000000000612df8565b600061210d8373ffffffffffffffffffffffffffffffffffffffff8416612d05565b600061210d8373ffffffffffffffffffffffffffffffffffffffff8416612cb6565b7f000000000000000000000000000000000000000000000000000000000000000015611adb576128af60028261317b565b611adb576040517fd0d2597600000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff82166004820152602401610758565b61290681610eed565b612948576040517fa9902c7e00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff82166004820152602401610758565b600480546040517fa8d87a3b00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff84169281019290925273ffffffffffffffffffffffffffffffffffffffff169063a8d87a3b90602401602060405180830381865afa1580156129c1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129e59190614369565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611adb576040517f728fe07b000000000000000000000000000000000000000000000000000000008152336004820152602401610758565b67ffffffffffffffff82166000908152600760205260409020611d8e90827f0000000000000000000000000000000000000000000000000000000000000000612df8565b6060816000018054806020026020016040519081016040528092919081815260200182805480156109be57602002820191906000526020600020905b815481526020019060010190808311612acb5750505050509050919050565b6000612b0985612afa8486614386565b612b04908761439d565b6131aa565b90505b949350505050565b8154600090612b3d90700100000000000000000000000000000000900463ffffffff1642614297565b90508015612bdf5760018301548354612b85916fffffffffffffffffffffffffffffffff80821692811691859170010000000000000000000000000000000090910416612aea565b83546fffffffffffffffffffffffffffffffff919091167fffffffffffffffffffffffff0000000000000000000000000000000000000000909116177001000000000000000000000000000000004263ffffffff16021783555b60208201518354612c05916fffffffffffffffffffffffffffffffff90811691166131aa565b83548351151574010000000000000000000000000000000000000000027fffffffffffffffffffffff00ffffffff000000000000000000000000000000009091166fffffffffffffffffffffffffffffffff92831617178455602083015160408085015183167001000000000000000000000000000000000291909216176001850155517f9ea3374b67bf275e6bb9c8ae68f9cae023e1c528b4b27e092f0bb209d3531c199061247a90849061432d565b6000818152600183016020526040812054612cfd57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610914565b506000610914565b60008181526001830160205260408120548015612dee576000612d29600183614297565b8554909150600090612d3d90600190614297565b9050808214612da2576000866000018281548110612d5d57612d5d61384b565b9060005260206000200154905080876000018481548110612d8057612d8061384b565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080612db357612db36143b0565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610914565b6000915050610914565b825474010000000000000000000000000000000000000000900460ff161580612e1f575081155b15612e2957505050565b825460018401546fffffffffffffffffffffffffffffffff80831692911690600090612e6f90700100000000000000000000000000000000900463ffffffff1642614297565b90508015612f2f5781831115612eb1576040517f9725942a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001860154612eeb9083908590849070010000000000000000000000000000000090046fffffffffffffffffffffffffffffffff16612aea565b86547fffffffffffffffffffffffff00000000ffffffffffffffffffffffffffffffff167001000000000000000000000000000000004263ffffffff160217875592505b84821015612fe65773ffffffffffffffffffffffffffffffffffffffff8416612f8e576040517ff94ebcd10000000000000000000000000000000000000000000000000000000081526004810183905260248101869052604401610758565b6040517f1a76572a000000000000000000000000000000000000000000000000000000008152600481018390526024810186905273ffffffffffffffffffffffffffffffffffffffff85166044820152606401610758565b848310156130f95760018681015470010000000000000000000000000000000090046fffffffffffffffffffffffffffffffff1690600090829061302a9082614297565b613034878a614297565b61303e919061439d565b61304891906143df565b905073ffffffffffffffffffffffffffffffffffffffff86166130a1576040517f15279c080000000000000000000000000000000000000000000000000000000081526004810182905260248101869052604401610758565b6040517fd0c8d23a000000000000000000000000000000000000000000000000000000008152600481018290526024810186905273ffffffffffffffffffffffffffffffffffffffff87166044820152606401610758565b6131038584614297565b86547fffffffffffffffffffffffffffffffff00000000000000000000000000000000166fffffffffffffffffffffffffffffffff82161787556040518681529093507f1871cdf8010e63f2eb8384381a68dfa7416dc571a5517e66e88b2d2d0c0a690a9060200160405180910390a1505050505050565b73ffffffffffffffffffffffffffffffffffffffff81166000908152600183016020526040812054151561210d565b60008183106131b9578161210d565b5090919050565b5080546131cc9061398f565b6000825580601f106131dc575050565b601f016020900490600052602060002090810190611adb91905b8082111561320a57600081556001016131f6565b5090565b6000806020838503121561322157600080fd5b823567ffffffffffffffff8082111561323957600080fd5b818501915085601f83011261324d57600080fd5b81358181111561325c57600080fd5b8660208260071b850101111561327157600080fd5b60209290920196919550909350505050565b60006020828403121561329557600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461210d57600080fd5b67ffffffffffffffff81168114611adb57600080fd5b80356132e6816132c5565b919050565b6000602082840312156132fd57600080fd5b813561210d816132c5565b6000815180845260005b8181101561332e57602081850181015186830182015201613312565b5060006020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b60208152600061210d6020830184613308565b73ffffffffffffffffffffffffffffffffffffffff81168114611adb57600080fd5b80356132e68161337f565b6000602082840312156133be57600080fd5b813561210d8161337f565b6000602082840312156133db57600080fd5b813567ffffffffffffffff8111156133f257600080fd5b8201610100818503121561210d57600080fd5b60008083601f84011261341757600080fd5b50813567ffffffffffffffff81111561342f57600080fd5b6020830191508360208260051b850101111561344a57600080fd5b9250929050565b6000806000806040858703121561346757600080fd5b843567ffffffffffffffff8082111561347f57600080fd5b61348b88838901613405565b909650945060208701359150808211156134a457600080fd5b506134b187828801613405565b95989497509550505050565b6000806000604084860312156134d257600080fd5b83356134dd816132c5565b9250602084013567ffffffffffffffff808211156134fa57600080fd5b818601915086601f83011261350e57600080fd5b81358181111561351d57600080fd5b87602082850101111561352f57600080fd5b6020830194508093505050509250925092565b60006020828403121561355457600080fd5b813567ffffffffffffffff81111561356b57600080fd5b820160a0818503121561210d57600080fd5b6020815260008251604060208401526135996060840182613308565b905060208401517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08483030160408501526135d48282613308565b95945050505050565b6020808252825182820181905260009190848201906040850190845b8181101561362b57835173ffffffffffffffffffffffffffffffffffffffff16835292840192918401916001016135f9565b50909695505050505050565b6020808252825182820181905260009190848201906040850190845b8181101561362b57835167ffffffffffffffff1683529284019291840191600101613653565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051610100810167ffffffffffffffff811182821017156136cc576136cc613679565b60405290565b6040805190810167ffffffffffffffff811182821017156136cc576136cc613679565b60405160c0810167ffffffffffffffff811182821017156136cc576136cc613679565b8015158114611adb57600080fd5b80356132e681613718565b80356fffffffffffffffffffffffffffffffff811681146132e657600080fd5b60006060828403121561376357600080fd5b6040516060810181811067ffffffffffffffff8211171561378657613786613679565b604052905080823561379781613718565b81526137a560208401613731565b60208201526137b660408401613731565b60408201525092915050565b600080600060e084860312156137d757600080fd5b83356137e2816132c5565b92506137f18560208601613751565b91506138008560808601613751565b90509250925092565b6000806020838503121561381c57600080fd5b823567ffffffffffffffff81111561383357600080fd5b61383f85828601613405565b90969095509350505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b803563ffffffff811681146132e657600080fd5b6000608082840312156138a057600080fd5b6040516080810181811067ffffffffffffffff821117156138c3576138c3613679565b604052823581526138d66020840161387a565b602082015260408301356138e9816132c5565b604082015260608301356138fc81613718565b60608201529392505050565b6020808252818101839052600090604080840186845b87811015613982578135835263ffffffff61393a86840161387a565b16858401528382013561394c816132c5565b67ffffffffffffffff168385015260608281013561396981613718565b151590840152608092830192919091019060010161391e565b5090979650505050505050565b600181811c908216806139a357607f821691505b6020821081036139dc577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b600082601f8301126139f357600080fd5b813567ffffffffffffffff80821115613a0e57613a0e613679565b604051601f83017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f01168101908282118183101715613a5457613a54613679565b81604052838152866020858801011115613a6d57600080fd5b836020870160208301376000602085830101528094505050505092915050565b60006101008236031215613aa057600080fd5b613aa86136a8565b823567ffffffffffffffff80821115613ac057600080fd5b613acc368387016139e2565b8352613ada602086016132db565b6020840152613aeb604086016133a1565b604084015260608501356060840152613b06608086016133a1565b608084015260a0850135915080821115613b1f57600080fd5b613b2b368387016139e2565b60a084015260c0850135915080821115613b4457600080fd5b613b50368387016139e2565b60c084015260e0850135915080821115613b6957600080fd5b50613b76368286016139e2565b60e08301525092915050565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112613bb757600080fd5b83018035915067ffffffffffffffff821115613bd257600080fd5b60200191503681900382131561344a57600080fd5b600060408284031215613bf957600080fd5b613c016136d2565b8235613c0c816132c5565b8152613c1a6020840161387a565b60208201529392505050565b600060208284031215613c3857600080fd5b813567ffffffffffffffff80821115613c5057600080fd5b9083019060408286031215613c6457600080fd5b613c6c6136d2565b823582811115613c7b57600080fd5b613c87878286016139e2565b825250602083013582811115613c9c57600080fd5b613ca8878286016139e2565b60208301525095945050505050565b604081526000613cca6040830185613308565b82810360208401526135d48185613308565b600060208284031215613cee57600080fd5b815161210d81613718565b601f82111561163f576000816000526020600020601f850160051c81016020861015613d225750805b601f850160051c820191505b81811015611f3b57828155600101613d2e565b67ffffffffffffffff831115613d5957613d59613679565b613d6d83613d67835461398f565b83613cf9565b6000601f841160018114613dbf5760008515613d895750838201355b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600387901b1c1916600186901b178355613e55565b6000838152602090207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0861690835b82811015613e0e5786850135825560209485019460019092019101613dee565b5086821015613e49577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60f88860031b161c19848701351681555b505060018560011b0183555b5050505050565b8183528181602085013750600060208284010152600060207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b604081526000613eb86040830186613308565b8281036020840152613ecb818587613e5c565b9695505050505050565b600060a08236031215613ee757600080fd5b60405160a0810167ffffffffffffffff8282108183111715613f0b57613f0b613679565b816040528435915080821115613f2057600080fd5b50613f2d368286016139e2565b8252506020830135613f3e816132c5565b60208201526040830135613f518161337f565b6040820152606083810135908201526080830135613f6e8161337f565b608082015292915050565b602081526000612b0c602083018486613e5c565b600060208284031215613f9f57600080fd5b5035919050565b600060208284031215613fb857600080fd5b815161210d816132c5565b600082357ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec1833603018112613ff757600080fd5b9190910192915050565b6000610140823603121561401457600080fd5b61401c6136f5565b614025836132db565b815261403360208401613726565b6020820152604083013567ffffffffffffffff8082111561405357600080fd5b61405f368387016139e2565b6040840152606085013591508082111561407857600080fd5b50614085368286016139e2565b6060830152506140983660808501613751565b60808201526140aa3660e08501613751565b60a082015292915050565b815167ffffffffffffffff8111156140cf576140cf613679565b6140e3816140dd845461398f565b84613cf9565b602080601f83116001811461413657600084156141005750858301515b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600386901b1c1916600185901b178555611f3b565b6000858152602081207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08616915b8281101561418357888601518255948401946001909101908401614164565b50858210156141bf57878501517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600388901b60f8161c191681555b5050505050600190811b01905550565b600061010067ffffffffffffffff871683528060208401526141f381840187613308565b8551151560408581019190915260208701516fffffffffffffffffffffffffffffffff90811660608701529087015116608085015291506142319050565b8251151560a083015260208301516fffffffffffffffffffffffffffffffff90811660c084015260408401511660e08301526135d4565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8181038181111561091457610914614268565b67ffffffffffffffff8416815260e081016142f660208301858051151582526020808201516fffffffffffffffffffffffffffffffff9081169184019190915260409182015116910152565b82511515608083015260208301516fffffffffffffffffffffffffffffffff90811660a084015260408401511660c0830152612b0c565b6060810161091482848051151582526020808201516fffffffffffffffffffffffffffffffff9081169184019190915260409182015116910152565b60006020828403121561437b57600080fd5b815161210d8161337f565b808202811582820484141761091457610914614268565b8082018082111561091457610914614268565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b600082614415577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b50049056fea164736f6c6343000818000a", +} + +var USDCTokenPoolABI = USDCTokenPoolMetaData.ABI + +var USDCTokenPoolBin = USDCTokenPoolMetaData.Bin + +func DeployUSDCTokenPool(auth *bind.TransactOpts, backend bind.ContractBackend, tokenMessenger common.Address, token common.Address, allowlist []common.Address, rmnProxy common.Address, router common.Address) (common.Address, *types.Transaction, *USDCTokenPool, error) { + parsed, err := USDCTokenPoolMetaData.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(USDCTokenPoolBin), backend, tokenMessenger, token, allowlist, rmnProxy, router) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &USDCTokenPool{address: address, abi: *parsed, USDCTokenPoolCaller: USDCTokenPoolCaller{contract: contract}, USDCTokenPoolTransactor: USDCTokenPoolTransactor{contract: contract}, USDCTokenPoolFilterer: USDCTokenPoolFilterer{contract: contract}}, nil +} + +type USDCTokenPool struct { + address common.Address + abi abi.ABI + USDCTokenPoolCaller + USDCTokenPoolTransactor + USDCTokenPoolFilterer +} + +type USDCTokenPoolCaller struct { + contract *bind.BoundContract +} + +type USDCTokenPoolTransactor struct { + contract *bind.BoundContract +} + +type USDCTokenPoolFilterer struct { + contract *bind.BoundContract +} + +type USDCTokenPoolSession struct { + Contract *USDCTokenPool + CallOpts bind.CallOpts + TransactOpts bind.TransactOpts +} + +type USDCTokenPoolCallerSession struct { + Contract *USDCTokenPoolCaller + CallOpts bind.CallOpts +} + +type USDCTokenPoolTransactorSession struct { + Contract *USDCTokenPoolTransactor + TransactOpts bind.TransactOpts +} + +type USDCTokenPoolRaw struct { + Contract *USDCTokenPool +} + +type USDCTokenPoolCallerRaw struct { + Contract *USDCTokenPoolCaller +} + +type USDCTokenPoolTransactorRaw struct { + Contract *USDCTokenPoolTransactor +} + +func NewUSDCTokenPool(address common.Address, backend bind.ContractBackend) (*USDCTokenPool, error) { + abi, err := abi.JSON(strings.NewReader(USDCTokenPoolABI)) + if err != nil { + return nil, err + } + contract, err := bindUSDCTokenPool(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &USDCTokenPool{address: address, abi: abi, USDCTokenPoolCaller: USDCTokenPoolCaller{contract: contract}, USDCTokenPoolTransactor: USDCTokenPoolTransactor{contract: contract}, USDCTokenPoolFilterer: USDCTokenPoolFilterer{contract: contract}}, nil +} + +func NewUSDCTokenPoolCaller(address common.Address, caller bind.ContractCaller) (*USDCTokenPoolCaller, error) { + contract, err := bindUSDCTokenPool(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &USDCTokenPoolCaller{contract: contract}, nil +} + +func NewUSDCTokenPoolTransactor(address common.Address, transactor bind.ContractTransactor) (*USDCTokenPoolTransactor, error) { + contract, err := bindUSDCTokenPool(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &USDCTokenPoolTransactor{contract: contract}, nil +} + +func NewUSDCTokenPoolFilterer(address common.Address, filterer bind.ContractFilterer) (*USDCTokenPoolFilterer, error) { + contract, err := bindUSDCTokenPool(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &USDCTokenPoolFilterer{contract: contract}, nil +} + +func bindUSDCTokenPool(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := USDCTokenPoolMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +func (_USDCTokenPool *USDCTokenPoolRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _USDCTokenPool.Contract.USDCTokenPoolCaller.contract.Call(opts, result, method, params...) +} + +func (_USDCTokenPool *USDCTokenPoolRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _USDCTokenPool.Contract.USDCTokenPoolTransactor.contract.Transfer(opts) +} + +func (_USDCTokenPool *USDCTokenPoolRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _USDCTokenPool.Contract.USDCTokenPoolTransactor.contract.Transact(opts, method, params...) +} + +func (_USDCTokenPool *USDCTokenPoolCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _USDCTokenPool.Contract.contract.Call(opts, result, method, params...) +} + +func (_USDCTokenPool *USDCTokenPoolTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _USDCTokenPool.Contract.contract.Transfer(opts) +} + +func (_USDCTokenPool *USDCTokenPoolTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _USDCTokenPool.Contract.contract.Transact(opts, method, params...) +} + +func (_USDCTokenPool *USDCTokenPoolCaller) SUPPORTEDUSDCVERSION(opts *bind.CallOpts) (uint32, error) { + var out []interface{} + err := _USDCTokenPool.contract.Call(opts, &out, "SUPPORTED_USDC_VERSION") + + if err != nil { + return *new(uint32), err + } + + out0 := *abi.ConvertType(out[0], new(uint32)).(*uint32) + + return out0, err + +} + +func (_USDCTokenPool *USDCTokenPoolSession) SUPPORTEDUSDCVERSION() (uint32, error) { + return _USDCTokenPool.Contract.SUPPORTEDUSDCVERSION(&_USDCTokenPool.CallOpts) +} + +func (_USDCTokenPool *USDCTokenPoolCallerSession) SUPPORTEDUSDCVERSION() (uint32, error) { + return _USDCTokenPool.Contract.SUPPORTEDUSDCVERSION(&_USDCTokenPool.CallOpts) +} + +func (_USDCTokenPool *USDCTokenPoolCaller) GetAllowList(opts *bind.CallOpts) ([]common.Address, error) { + var out []interface{} + err := _USDCTokenPool.contract.Call(opts, &out, "getAllowList") + + if err != nil { + return *new([]common.Address), err + } + + out0 := *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) + + return out0, err + +} + +func (_USDCTokenPool *USDCTokenPoolSession) GetAllowList() ([]common.Address, error) { + return _USDCTokenPool.Contract.GetAllowList(&_USDCTokenPool.CallOpts) +} + +func (_USDCTokenPool *USDCTokenPoolCallerSession) GetAllowList() ([]common.Address, error) { + return _USDCTokenPool.Contract.GetAllowList(&_USDCTokenPool.CallOpts) +} + +func (_USDCTokenPool *USDCTokenPoolCaller) GetAllowListEnabled(opts *bind.CallOpts) (bool, error) { + var out []interface{} + err := _USDCTokenPool.contract.Call(opts, &out, "getAllowListEnabled") + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_USDCTokenPool *USDCTokenPoolSession) GetAllowListEnabled() (bool, error) { + return _USDCTokenPool.Contract.GetAllowListEnabled(&_USDCTokenPool.CallOpts) +} + +func (_USDCTokenPool *USDCTokenPoolCallerSession) GetAllowListEnabled() (bool, error) { + return _USDCTokenPool.Contract.GetAllowListEnabled(&_USDCTokenPool.CallOpts) +} + +func (_USDCTokenPool *USDCTokenPoolCaller) GetCurrentInboundRateLimiterState(opts *bind.CallOpts, remoteChainSelector uint64) (RateLimiterTokenBucket, error) { + var out []interface{} + err := _USDCTokenPool.contract.Call(opts, &out, "getCurrentInboundRateLimiterState", remoteChainSelector) + + if err != nil { + return *new(RateLimiterTokenBucket), err + } + + out0 := *abi.ConvertType(out[0], new(RateLimiterTokenBucket)).(*RateLimiterTokenBucket) + + return out0, err + +} + +func (_USDCTokenPool *USDCTokenPoolSession) GetCurrentInboundRateLimiterState(remoteChainSelector uint64) (RateLimiterTokenBucket, error) { + return _USDCTokenPool.Contract.GetCurrentInboundRateLimiterState(&_USDCTokenPool.CallOpts, remoteChainSelector) +} + +func (_USDCTokenPool *USDCTokenPoolCallerSession) GetCurrentInboundRateLimiterState(remoteChainSelector uint64) (RateLimiterTokenBucket, error) { + return _USDCTokenPool.Contract.GetCurrentInboundRateLimiterState(&_USDCTokenPool.CallOpts, remoteChainSelector) +} + +func (_USDCTokenPool *USDCTokenPoolCaller) GetCurrentOutboundRateLimiterState(opts *bind.CallOpts, remoteChainSelector uint64) (RateLimiterTokenBucket, error) { + var out []interface{} + err := _USDCTokenPool.contract.Call(opts, &out, "getCurrentOutboundRateLimiterState", remoteChainSelector) + + if err != nil { + return *new(RateLimiterTokenBucket), err + } + + out0 := *abi.ConvertType(out[0], new(RateLimiterTokenBucket)).(*RateLimiterTokenBucket) + + return out0, err + +} + +func (_USDCTokenPool *USDCTokenPoolSession) GetCurrentOutboundRateLimiterState(remoteChainSelector uint64) (RateLimiterTokenBucket, error) { + return _USDCTokenPool.Contract.GetCurrentOutboundRateLimiterState(&_USDCTokenPool.CallOpts, remoteChainSelector) +} + +func (_USDCTokenPool *USDCTokenPoolCallerSession) GetCurrentOutboundRateLimiterState(remoteChainSelector uint64) (RateLimiterTokenBucket, error) { + return _USDCTokenPool.Contract.GetCurrentOutboundRateLimiterState(&_USDCTokenPool.CallOpts, remoteChainSelector) +} + +func (_USDCTokenPool *USDCTokenPoolCaller) GetDomain(opts *bind.CallOpts, chainSelector uint64) (USDCTokenPoolDomain, error) { + var out []interface{} + err := _USDCTokenPool.contract.Call(opts, &out, "getDomain", chainSelector) + + if err != nil { + return *new(USDCTokenPoolDomain), err + } + + out0 := *abi.ConvertType(out[0], new(USDCTokenPoolDomain)).(*USDCTokenPoolDomain) + + return out0, err + +} + +func (_USDCTokenPool *USDCTokenPoolSession) GetDomain(chainSelector uint64) (USDCTokenPoolDomain, error) { + return _USDCTokenPool.Contract.GetDomain(&_USDCTokenPool.CallOpts, chainSelector) +} + +func (_USDCTokenPool *USDCTokenPoolCallerSession) GetDomain(chainSelector uint64) (USDCTokenPoolDomain, error) { + return _USDCTokenPool.Contract.GetDomain(&_USDCTokenPool.CallOpts, chainSelector) +} + +func (_USDCTokenPool *USDCTokenPoolCaller) GetRateLimitAdmin(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _USDCTokenPool.contract.Call(opts, &out, "getRateLimitAdmin") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_USDCTokenPool *USDCTokenPoolSession) GetRateLimitAdmin() (common.Address, error) { + return _USDCTokenPool.Contract.GetRateLimitAdmin(&_USDCTokenPool.CallOpts) +} + +func (_USDCTokenPool *USDCTokenPoolCallerSession) GetRateLimitAdmin() (common.Address, error) { + return _USDCTokenPool.Contract.GetRateLimitAdmin(&_USDCTokenPool.CallOpts) +} + +func (_USDCTokenPool *USDCTokenPoolCaller) GetRemotePool(opts *bind.CallOpts, remoteChainSelector uint64) ([]byte, error) { + var out []interface{} + err := _USDCTokenPool.contract.Call(opts, &out, "getRemotePool", remoteChainSelector) + + if err != nil { + return *new([]byte), err + } + + out0 := *abi.ConvertType(out[0], new([]byte)).(*[]byte) + + return out0, err + +} + +func (_USDCTokenPool *USDCTokenPoolSession) GetRemotePool(remoteChainSelector uint64) ([]byte, error) { + return _USDCTokenPool.Contract.GetRemotePool(&_USDCTokenPool.CallOpts, remoteChainSelector) +} + +func (_USDCTokenPool *USDCTokenPoolCallerSession) GetRemotePool(remoteChainSelector uint64) ([]byte, error) { + return _USDCTokenPool.Contract.GetRemotePool(&_USDCTokenPool.CallOpts, remoteChainSelector) +} + +func (_USDCTokenPool *USDCTokenPoolCaller) GetRemoteToken(opts *bind.CallOpts, remoteChainSelector uint64) ([]byte, error) { + var out []interface{} + err := _USDCTokenPool.contract.Call(opts, &out, "getRemoteToken", remoteChainSelector) + + if err != nil { + return *new([]byte), err + } + + out0 := *abi.ConvertType(out[0], new([]byte)).(*[]byte) + + return out0, err + +} + +func (_USDCTokenPool *USDCTokenPoolSession) GetRemoteToken(remoteChainSelector uint64) ([]byte, error) { + return _USDCTokenPool.Contract.GetRemoteToken(&_USDCTokenPool.CallOpts, remoteChainSelector) +} + +func (_USDCTokenPool *USDCTokenPoolCallerSession) GetRemoteToken(remoteChainSelector uint64) ([]byte, error) { + return _USDCTokenPool.Contract.GetRemoteToken(&_USDCTokenPool.CallOpts, remoteChainSelector) +} + +func (_USDCTokenPool *USDCTokenPoolCaller) GetRmnProxy(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _USDCTokenPool.contract.Call(opts, &out, "getRmnProxy") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_USDCTokenPool *USDCTokenPoolSession) GetRmnProxy() (common.Address, error) { + return _USDCTokenPool.Contract.GetRmnProxy(&_USDCTokenPool.CallOpts) +} + +func (_USDCTokenPool *USDCTokenPoolCallerSession) GetRmnProxy() (common.Address, error) { + return _USDCTokenPool.Contract.GetRmnProxy(&_USDCTokenPool.CallOpts) +} + +func (_USDCTokenPool *USDCTokenPoolCaller) GetRouter(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _USDCTokenPool.contract.Call(opts, &out, "getRouter") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_USDCTokenPool *USDCTokenPoolSession) GetRouter() (common.Address, error) { + return _USDCTokenPool.Contract.GetRouter(&_USDCTokenPool.CallOpts) +} + +func (_USDCTokenPool *USDCTokenPoolCallerSession) GetRouter() (common.Address, error) { + return _USDCTokenPool.Contract.GetRouter(&_USDCTokenPool.CallOpts) +} + +func (_USDCTokenPool *USDCTokenPoolCaller) GetSupportedChains(opts *bind.CallOpts) ([]uint64, error) { + var out []interface{} + err := _USDCTokenPool.contract.Call(opts, &out, "getSupportedChains") + + if err != nil { + return *new([]uint64), err + } + + out0 := *abi.ConvertType(out[0], new([]uint64)).(*[]uint64) + + return out0, err + +} + +func (_USDCTokenPool *USDCTokenPoolSession) GetSupportedChains() ([]uint64, error) { + return _USDCTokenPool.Contract.GetSupportedChains(&_USDCTokenPool.CallOpts) +} + +func (_USDCTokenPool *USDCTokenPoolCallerSession) GetSupportedChains() ([]uint64, error) { + return _USDCTokenPool.Contract.GetSupportedChains(&_USDCTokenPool.CallOpts) +} + +func (_USDCTokenPool *USDCTokenPoolCaller) GetToken(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _USDCTokenPool.contract.Call(opts, &out, "getToken") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_USDCTokenPool *USDCTokenPoolSession) GetToken() (common.Address, error) { + return _USDCTokenPool.Contract.GetToken(&_USDCTokenPool.CallOpts) +} + +func (_USDCTokenPool *USDCTokenPoolCallerSession) GetToken() (common.Address, error) { + return _USDCTokenPool.Contract.GetToken(&_USDCTokenPool.CallOpts) +} + +func (_USDCTokenPool *USDCTokenPoolCaller) ILocalDomainIdentifier(opts *bind.CallOpts) (uint32, error) { + var out []interface{} + err := _USDCTokenPool.contract.Call(opts, &out, "i_localDomainIdentifier") + + if err != nil { + return *new(uint32), err + } + + out0 := *abi.ConvertType(out[0], new(uint32)).(*uint32) + + return out0, err + +} + +func (_USDCTokenPool *USDCTokenPoolSession) ILocalDomainIdentifier() (uint32, error) { + return _USDCTokenPool.Contract.ILocalDomainIdentifier(&_USDCTokenPool.CallOpts) +} + +func (_USDCTokenPool *USDCTokenPoolCallerSession) ILocalDomainIdentifier() (uint32, error) { + return _USDCTokenPool.Contract.ILocalDomainIdentifier(&_USDCTokenPool.CallOpts) +} + +func (_USDCTokenPool *USDCTokenPoolCaller) IMessageTransmitter(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _USDCTokenPool.contract.Call(opts, &out, "i_messageTransmitter") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_USDCTokenPool *USDCTokenPoolSession) IMessageTransmitter() (common.Address, error) { + return _USDCTokenPool.Contract.IMessageTransmitter(&_USDCTokenPool.CallOpts) +} + +func (_USDCTokenPool *USDCTokenPoolCallerSession) IMessageTransmitter() (common.Address, error) { + return _USDCTokenPool.Contract.IMessageTransmitter(&_USDCTokenPool.CallOpts) +} + +func (_USDCTokenPool *USDCTokenPoolCaller) ITokenMessenger(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _USDCTokenPool.contract.Call(opts, &out, "i_tokenMessenger") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_USDCTokenPool *USDCTokenPoolSession) ITokenMessenger() (common.Address, error) { + return _USDCTokenPool.Contract.ITokenMessenger(&_USDCTokenPool.CallOpts) +} + +func (_USDCTokenPool *USDCTokenPoolCallerSession) ITokenMessenger() (common.Address, error) { + return _USDCTokenPool.Contract.ITokenMessenger(&_USDCTokenPool.CallOpts) +} + +func (_USDCTokenPool *USDCTokenPoolCaller) IsSupportedChain(opts *bind.CallOpts, remoteChainSelector uint64) (bool, error) { + var out []interface{} + err := _USDCTokenPool.contract.Call(opts, &out, "isSupportedChain", remoteChainSelector) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_USDCTokenPool *USDCTokenPoolSession) IsSupportedChain(remoteChainSelector uint64) (bool, error) { + return _USDCTokenPool.Contract.IsSupportedChain(&_USDCTokenPool.CallOpts, remoteChainSelector) +} + +func (_USDCTokenPool *USDCTokenPoolCallerSession) IsSupportedChain(remoteChainSelector uint64) (bool, error) { + return _USDCTokenPool.Contract.IsSupportedChain(&_USDCTokenPool.CallOpts, remoteChainSelector) +} + +func (_USDCTokenPool *USDCTokenPoolCaller) IsSupportedToken(opts *bind.CallOpts, token common.Address) (bool, error) { + var out []interface{} + err := _USDCTokenPool.contract.Call(opts, &out, "isSupportedToken", token) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_USDCTokenPool *USDCTokenPoolSession) IsSupportedToken(token common.Address) (bool, error) { + return _USDCTokenPool.Contract.IsSupportedToken(&_USDCTokenPool.CallOpts, token) +} + +func (_USDCTokenPool *USDCTokenPoolCallerSession) IsSupportedToken(token common.Address) (bool, error) { + return _USDCTokenPool.Contract.IsSupportedToken(&_USDCTokenPool.CallOpts, token) +} + +func (_USDCTokenPool *USDCTokenPoolCaller) Owner(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _USDCTokenPool.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 + +} + +func (_USDCTokenPool *USDCTokenPoolSession) Owner() (common.Address, error) { + return _USDCTokenPool.Contract.Owner(&_USDCTokenPool.CallOpts) +} + +func (_USDCTokenPool *USDCTokenPoolCallerSession) Owner() (common.Address, error) { + return _USDCTokenPool.Contract.Owner(&_USDCTokenPool.CallOpts) +} + +func (_USDCTokenPool *USDCTokenPoolCaller) SupportsInterface(opts *bind.CallOpts, interfaceId [4]byte) (bool, error) { + var out []interface{} + err := _USDCTokenPool.contract.Call(opts, &out, "supportsInterface", interfaceId) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_USDCTokenPool *USDCTokenPoolSession) SupportsInterface(interfaceId [4]byte) (bool, error) { + return _USDCTokenPool.Contract.SupportsInterface(&_USDCTokenPool.CallOpts, interfaceId) +} + +func (_USDCTokenPool *USDCTokenPoolCallerSession) SupportsInterface(interfaceId [4]byte) (bool, error) { + return _USDCTokenPool.Contract.SupportsInterface(&_USDCTokenPool.CallOpts, interfaceId) +} + +func (_USDCTokenPool *USDCTokenPoolCaller) TypeAndVersion(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _USDCTokenPool.contract.Call(opts, &out, "typeAndVersion") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +func (_USDCTokenPool *USDCTokenPoolSession) TypeAndVersion() (string, error) { + return _USDCTokenPool.Contract.TypeAndVersion(&_USDCTokenPool.CallOpts) +} + +func (_USDCTokenPool *USDCTokenPoolCallerSession) TypeAndVersion() (string, error) { + return _USDCTokenPool.Contract.TypeAndVersion(&_USDCTokenPool.CallOpts) +} + +func (_USDCTokenPool *USDCTokenPoolTransactor) AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + return _USDCTokenPool.contract.Transact(opts, "acceptOwnership") +} + +func (_USDCTokenPool *USDCTokenPoolSession) AcceptOwnership() (*types.Transaction, error) { + return _USDCTokenPool.Contract.AcceptOwnership(&_USDCTokenPool.TransactOpts) +} + +func (_USDCTokenPool *USDCTokenPoolTransactorSession) AcceptOwnership() (*types.Transaction, error) { + return _USDCTokenPool.Contract.AcceptOwnership(&_USDCTokenPool.TransactOpts) +} + +func (_USDCTokenPool *USDCTokenPoolTransactor) ApplyAllowListUpdates(opts *bind.TransactOpts, removes []common.Address, adds []common.Address) (*types.Transaction, error) { + return _USDCTokenPool.contract.Transact(opts, "applyAllowListUpdates", removes, adds) +} + +func (_USDCTokenPool *USDCTokenPoolSession) ApplyAllowListUpdates(removes []common.Address, adds []common.Address) (*types.Transaction, error) { + return _USDCTokenPool.Contract.ApplyAllowListUpdates(&_USDCTokenPool.TransactOpts, removes, adds) +} + +func (_USDCTokenPool *USDCTokenPoolTransactorSession) ApplyAllowListUpdates(removes []common.Address, adds []common.Address) (*types.Transaction, error) { + return _USDCTokenPool.Contract.ApplyAllowListUpdates(&_USDCTokenPool.TransactOpts, removes, adds) +} + +func (_USDCTokenPool *USDCTokenPoolTransactor) ApplyChainUpdates(opts *bind.TransactOpts, chains []TokenPoolChainUpdate) (*types.Transaction, error) { + return _USDCTokenPool.contract.Transact(opts, "applyChainUpdates", chains) +} + +func (_USDCTokenPool *USDCTokenPoolSession) ApplyChainUpdates(chains []TokenPoolChainUpdate) (*types.Transaction, error) { + return _USDCTokenPool.Contract.ApplyChainUpdates(&_USDCTokenPool.TransactOpts, chains) +} + +func (_USDCTokenPool *USDCTokenPoolTransactorSession) ApplyChainUpdates(chains []TokenPoolChainUpdate) (*types.Transaction, error) { + return _USDCTokenPool.Contract.ApplyChainUpdates(&_USDCTokenPool.TransactOpts, chains) +} + +func (_USDCTokenPool *USDCTokenPoolTransactor) LockOrBurn(opts *bind.TransactOpts, lockOrBurnIn PoolLockOrBurnInV1) (*types.Transaction, error) { + return _USDCTokenPool.contract.Transact(opts, "lockOrBurn", lockOrBurnIn) +} + +func (_USDCTokenPool *USDCTokenPoolSession) LockOrBurn(lockOrBurnIn PoolLockOrBurnInV1) (*types.Transaction, error) { + return _USDCTokenPool.Contract.LockOrBurn(&_USDCTokenPool.TransactOpts, lockOrBurnIn) +} + +func (_USDCTokenPool *USDCTokenPoolTransactorSession) LockOrBurn(lockOrBurnIn PoolLockOrBurnInV1) (*types.Transaction, error) { + return _USDCTokenPool.Contract.LockOrBurn(&_USDCTokenPool.TransactOpts, lockOrBurnIn) +} + +func (_USDCTokenPool *USDCTokenPoolTransactor) ReleaseOrMint(opts *bind.TransactOpts, releaseOrMintIn PoolReleaseOrMintInV1) (*types.Transaction, error) { + return _USDCTokenPool.contract.Transact(opts, "releaseOrMint", releaseOrMintIn) +} + +func (_USDCTokenPool *USDCTokenPoolSession) ReleaseOrMint(releaseOrMintIn PoolReleaseOrMintInV1) (*types.Transaction, error) { + return _USDCTokenPool.Contract.ReleaseOrMint(&_USDCTokenPool.TransactOpts, releaseOrMintIn) +} + +func (_USDCTokenPool *USDCTokenPoolTransactorSession) ReleaseOrMint(releaseOrMintIn PoolReleaseOrMintInV1) (*types.Transaction, error) { + return _USDCTokenPool.Contract.ReleaseOrMint(&_USDCTokenPool.TransactOpts, releaseOrMintIn) +} + +func (_USDCTokenPool *USDCTokenPoolTransactor) SetChainRateLimiterConfig(opts *bind.TransactOpts, remoteChainSelector uint64, outboundConfig RateLimiterConfig, inboundConfig RateLimiterConfig) (*types.Transaction, error) { + return _USDCTokenPool.contract.Transact(opts, "setChainRateLimiterConfig", remoteChainSelector, outboundConfig, inboundConfig) +} + +func (_USDCTokenPool *USDCTokenPoolSession) SetChainRateLimiterConfig(remoteChainSelector uint64, outboundConfig RateLimiterConfig, inboundConfig RateLimiterConfig) (*types.Transaction, error) { + return _USDCTokenPool.Contract.SetChainRateLimiterConfig(&_USDCTokenPool.TransactOpts, remoteChainSelector, outboundConfig, inboundConfig) +} + +func (_USDCTokenPool *USDCTokenPoolTransactorSession) SetChainRateLimiterConfig(remoteChainSelector uint64, outboundConfig RateLimiterConfig, inboundConfig RateLimiterConfig) (*types.Transaction, error) { + return _USDCTokenPool.Contract.SetChainRateLimiterConfig(&_USDCTokenPool.TransactOpts, remoteChainSelector, outboundConfig, inboundConfig) +} + +func (_USDCTokenPool *USDCTokenPoolTransactor) SetDomains(opts *bind.TransactOpts, domains []USDCTokenPoolDomainUpdate) (*types.Transaction, error) { + return _USDCTokenPool.contract.Transact(opts, "setDomains", domains) +} + +func (_USDCTokenPool *USDCTokenPoolSession) SetDomains(domains []USDCTokenPoolDomainUpdate) (*types.Transaction, error) { + return _USDCTokenPool.Contract.SetDomains(&_USDCTokenPool.TransactOpts, domains) +} + +func (_USDCTokenPool *USDCTokenPoolTransactorSession) SetDomains(domains []USDCTokenPoolDomainUpdate) (*types.Transaction, error) { + return _USDCTokenPool.Contract.SetDomains(&_USDCTokenPool.TransactOpts, domains) +} + +func (_USDCTokenPool *USDCTokenPoolTransactor) SetRateLimitAdmin(opts *bind.TransactOpts, rateLimitAdmin common.Address) (*types.Transaction, error) { + return _USDCTokenPool.contract.Transact(opts, "setRateLimitAdmin", rateLimitAdmin) +} + +func (_USDCTokenPool *USDCTokenPoolSession) SetRateLimitAdmin(rateLimitAdmin common.Address) (*types.Transaction, error) { + return _USDCTokenPool.Contract.SetRateLimitAdmin(&_USDCTokenPool.TransactOpts, rateLimitAdmin) +} + +func (_USDCTokenPool *USDCTokenPoolTransactorSession) SetRateLimitAdmin(rateLimitAdmin common.Address) (*types.Transaction, error) { + return _USDCTokenPool.Contract.SetRateLimitAdmin(&_USDCTokenPool.TransactOpts, rateLimitAdmin) +} + +func (_USDCTokenPool *USDCTokenPoolTransactor) SetRemotePool(opts *bind.TransactOpts, remoteChainSelector uint64, remotePoolAddress []byte) (*types.Transaction, error) { + return _USDCTokenPool.contract.Transact(opts, "setRemotePool", remoteChainSelector, remotePoolAddress) +} + +func (_USDCTokenPool *USDCTokenPoolSession) SetRemotePool(remoteChainSelector uint64, remotePoolAddress []byte) (*types.Transaction, error) { + return _USDCTokenPool.Contract.SetRemotePool(&_USDCTokenPool.TransactOpts, remoteChainSelector, remotePoolAddress) +} + +func (_USDCTokenPool *USDCTokenPoolTransactorSession) SetRemotePool(remoteChainSelector uint64, remotePoolAddress []byte) (*types.Transaction, error) { + return _USDCTokenPool.Contract.SetRemotePool(&_USDCTokenPool.TransactOpts, remoteChainSelector, remotePoolAddress) +} + +func (_USDCTokenPool *USDCTokenPoolTransactor) SetRouter(opts *bind.TransactOpts, newRouter common.Address) (*types.Transaction, error) { + return _USDCTokenPool.contract.Transact(opts, "setRouter", newRouter) +} + +func (_USDCTokenPool *USDCTokenPoolSession) SetRouter(newRouter common.Address) (*types.Transaction, error) { + return _USDCTokenPool.Contract.SetRouter(&_USDCTokenPool.TransactOpts, newRouter) +} + +func (_USDCTokenPool *USDCTokenPoolTransactorSession) SetRouter(newRouter common.Address) (*types.Transaction, error) { + return _USDCTokenPool.Contract.SetRouter(&_USDCTokenPool.TransactOpts, newRouter) +} + +func (_USDCTokenPool *USDCTokenPoolTransactor) TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) { + return _USDCTokenPool.contract.Transact(opts, "transferOwnership", to) +} + +func (_USDCTokenPool *USDCTokenPoolSession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _USDCTokenPool.Contract.TransferOwnership(&_USDCTokenPool.TransactOpts, to) +} + +func (_USDCTokenPool *USDCTokenPoolTransactorSession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _USDCTokenPool.Contract.TransferOwnership(&_USDCTokenPool.TransactOpts, to) +} + +type USDCTokenPoolAllowListAddIterator struct { + Event *USDCTokenPoolAllowListAdd + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *USDCTokenPoolAllowListAddIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(USDCTokenPoolAllowListAdd) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(USDCTokenPoolAllowListAdd) + 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() + } +} + +func (it *USDCTokenPoolAllowListAddIterator) Error() error { + return it.fail +} + +func (it *USDCTokenPoolAllowListAddIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type USDCTokenPoolAllowListAdd struct { + Sender common.Address + Raw types.Log +} + +func (_USDCTokenPool *USDCTokenPoolFilterer) FilterAllowListAdd(opts *bind.FilterOpts) (*USDCTokenPoolAllowListAddIterator, error) { + + logs, sub, err := _USDCTokenPool.contract.FilterLogs(opts, "AllowListAdd") + if err != nil { + return nil, err + } + return &USDCTokenPoolAllowListAddIterator{contract: _USDCTokenPool.contract, event: "AllowListAdd", logs: logs, sub: sub}, nil +} + +func (_USDCTokenPool *USDCTokenPoolFilterer) WatchAllowListAdd(opts *bind.WatchOpts, sink chan<- *USDCTokenPoolAllowListAdd) (event.Subscription, error) { + + logs, sub, err := _USDCTokenPool.contract.WatchLogs(opts, "AllowListAdd") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(USDCTokenPoolAllowListAdd) + if err := _USDCTokenPool.contract.UnpackLog(event, "AllowListAdd", 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 +} + +func (_USDCTokenPool *USDCTokenPoolFilterer) ParseAllowListAdd(log types.Log) (*USDCTokenPoolAllowListAdd, error) { + event := new(USDCTokenPoolAllowListAdd) + if err := _USDCTokenPool.contract.UnpackLog(event, "AllowListAdd", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type USDCTokenPoolAllowListRemoveIterator struct { + Event *USDCTokenPoolAllowListRemove + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *USDCTokenPoolAllowListRemoveIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(USDCTokenPoolAllowListRemove) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(USDCTokenPoolAllowListRemove) + 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() + } +} + +func (it *USDCTokenPoolAllowListRemoveIterator) Error() error { + return it.fail +} + +func (it *USDCTokenPoolAllowListRemoveIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type USDCTokenPoolAllowListRemove struct { + Sender common.Address + Raw types.Log +} + +func (_USDCTokenPool *USDCTokenPoolFilterer) FilterAllowListRemove(opts *bind.FilterOpts) (*USDCTokenPoolAllowListRemoveIterator, error) { + + logs, sub, err := _USDCTokenPool.contract.FilterLogs(opts, "AllowListRemove") + if err != nil { + return nil, err + } + return &USDCTokenPoolAllowListRemoveIterator{contract: _USDCTokenPool.contract, event: "AllowListRemove", logs: logs, sub: sub}, nil +} + +func (_USDCTokenPool *USDCTokenPoolFilterer) WatchAllowListRemove(opts *bind.WatchOpts, sink chan<- *USDCTokenPoolAllowListRemove) (event.Subscription, error) { + + logs, sub, err := _USDCTokenPool.contract.WatchLogs(opts, "AllowListRemove") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(USDCTokenPoolAllowListRemove) + if err := _USDCTokenPool.contract.UnpackLog(event, "AllowListRemove", 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 +} + +func (_USDCTokenPool *USDCTokenPoolFilterer) ParseAllowListRemove(log types.Log) (*USDCTokenPoolAllowListRemove, error) { + event := new(USDCTokenPoolAllowListRemove) + if err := _USDCTokenPool.contract.UnpackLog(event, "AllowListRemove", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type USDCTokenPoolBurnedIterator struct { + Event *USDCTokenPoolBurned + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *USDCTokenPoolBurnedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(USDCTokenPoolBurned) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(USDCTokenPoolBurned) + 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() + } +} + +func (it *USDCTokenPoolBurnedIterator) Error() error { + return it.fail +} + +func (it *USDCTokenPoolBurnedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type USDCTokenPoolBurned struct { + Sender common.Address + Amount *big.Int + Raw types.Log +} + +func (_USDCTokenPool *USDCTokenPoolFilterer) FilterBurned(opts *bind.FilterOpts, sender []common.Address) (*USDCTokenPoolBurnedIterator, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _USDCTokenPool.contract.FilterLogs(opts, "Burned", senderRule) + if err != nil { + return nil, err + } + return &USDCTokenPoolBurnedIterator{contract: _USDCTokenPool.contract, event: "Burned", logs: logs, sub: sub}, nil +} + +func (_USDCTokenPool *USDCTokenPoolFilterer) WatchBurned(opts *bind.WatchOpts, sink chan<- *USDCTokenPoolBurned, sender []common.Address) (event.Subscription, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _USDCTokenPool.contract.WatchLogs(opts, "Burned", senderRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(USDCTokenPoolBurned) + if err := _USDCTokenPool.contract.UnpackLog(event, "Burned", 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 +} + +func (_USDCTokenPool *USDCTokenPoolFilterer) ParseBurned(log types.Log) (*USDCTokenPoolBurned, error) { + event := new(USDCTokenPoolBurned) + if err := _USDCTokenPool.contract.UnpackLog(event, "Burned", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type USDCTokenPoolChainAddedIterator struct { + Event *USDCTokenPoolChainAdded + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *USDCTokenPoolChainAddedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(USDCTokenPoolChainAdded) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(USDCTokenPoolChainAdded) + 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() + } +} + +func (it *USDCTokenPoolChainAddedIterator) Error() error { + return it.fail +} + +func (it *USDCTokenPoolChainAddedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type USDCTokenPoolChainAdded struct { + RemoteChainSelector uint64 + RemoteToken []byte + OutboundRateLimiterConfig RateLimiterConfig + InboundRateLimiterConfig RateLimiterConfig + Raw types.Log +} + +func (_USDCTokenPool *USDCTokenPoolFilterer) FilterChainAdded(opts *bind.FilterOpts) (*USDCTokenPoolChainAddedIterator, error) { + + logs, sub, err := _USDCTokenPool.contract.FilterLogs(opts, "ChainAdded") + if err != nil { + return nil, err + } + return &USDCTokenPoolChainAddedIterator{contract: _USDCTokenPool.contract, event: "ChainAdded", logs: logs, sub: sub}, nil +} + +func (_USDCTokenPool *USDCTokenPoolFilterer) WatchChainAdded(opts *bind.WatchOpts, sink chan<- *USDCTokenPoolChainAdded) (event.Subscription, error) { + + logs, sub, err := _USDCTokenPool.contract.WatchLogs(opts, "ChainAdded") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(USDCTokenPoolChainAdded) + if err := _USDCTokenPool.contract.UnpackLog(event, "ChainAdded", 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 +} + +func (_USDCTokenPool *USDCTokenPoolFilterer) ParseChainAdded(log types.Log) (*USDCTokenPoolChainAdded, error) { + event := new(USDCTokenPoolChainAdded) + if err := _USDCTokenPool.contract.UnpackLog(event, "ChainAdded", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type USDCTokenPoolChainConfiguredIterator struct { + Event *USDCTokenPoolChainConfigured + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *USDCTokenPoolChainConfiguredIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(USDCTokenPoolChainConfigured) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(USDCTokenPoolChainConfigured) + 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() + } +} + +func (it *USDCTokenPoolChainConfiguredIterator) Error() error { + return it.fail +} + +func (it *USDCTokenPoolChainConfiguredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type USDCTokenPoolChainConfigured struct { + RemoteChainSelector uint64 + OutboundRateLimiterConfig RateLimiterConfig + InboundRateLimiterConfig RateLimiterConfig + Raw types.Log +} + +func (_USDCTokenPool *USDCTokenPoolFilterer) FilterChainConfigured(opts *bind.FilterOpts) (*USDCTokenPoolChainConfiguredIterator, error) { + + logs, sub, err := _USDCTokenPool.contract.FilterLogs(opts, "ChainConfigured") + if err != nil { + return nil, err + } + return &USDCTokenPoolChainConfiguredIterator{contract: _USDCTokenPool.contract, event: "ChainConfigured", logs: logs, sub: sub}, nil +} + +func (_USDCTokenPool *USDCTokenPoolFilterer) WatchChainConfigured(opts *bind.WatchOpts, sink chan<- *USDCTokenPoolChainConfigured) (event.Subscription, error) { + + logs, sub, err := _USDCTokenPool.contract.WatchLogs(opts, "ChainConfigured") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(USDCTokenPoolChainConfigured) + if err := _USDCTokenPool.contract.UnpackLog(event, "ChainConfigured", 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 +} + +func (_USDCTokenPool *USDCTokenPoolFilterer) ParseChainConfigured(log types.Log) (*USDCTokenPoolChainConfigured, error) { + event := new(USDCTokenPoolChainConfigured) + if err := _USDCTokenPool.contract.UnpackLog(event, "ChainConfigured", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type USDCTokenPoolChainRemovedIterator struct { + Event *USDCTokenPoolChainRemoved + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *USDCTokenPoolChainRemovedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(USDCTokenPoolChainRemoved) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(USDCTokenPoolChainRemoved) + 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() + } +} + +func (it *USDCTokenPoolChainRemovedIterator) Error() error { + return it.fail +} + +func (it *USDCTokenPoolChainRemovedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type USDCTokenPoolChainRemoved struct { + RemoteChainSelector uint64 + Raw types.Log +} + +func (_USDCTokenPool *USDCTokenPoolFilterer) FilterChainRemoved(opts *bind.FilterOpts) (*USDCTokenPoolChainRemovedIterator, error) { + + logs, sub, err := _USDCTokenPool.contract.FilterLogs(opts, "ChainRemoved") + if err != nil { + return nil, err + } + return &USDCTokenPoolChainRemovedIterator{contract: _USDCTokenPool.contract, event: "ChainRemoved", logs: logs, sub: sub}, nil +} + +func (_USDCTokenPool *USDCTokenPoolFilterer) WatchChainRemoved(opts *bind.WatchOpts, sink chan<- *USDCTokenPoolChainRemoved) (event.Subscription, error) { + + logs, sub, err := _USDCTokenPool.contract.WatchLogs(opts, "ChainRemoved") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(USDCTokenPoolChainRemoved) + if err := _USDCTokenPool.contract.UnpackLog(event, "ChainRemoved", 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 +} + +func (_USDCTokenPool *USDCTokenPoolFilterer) ParseChainRemoved(log types.Log) (*USDCTokenPoolChainRemoved, error) { + event := new(USDCTokenPoolChainRemoved) + if err := _USDCTokenPool.contract.UnpackLog(event, "ChainRemoved", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type USDCTokenPoolConfigChangedIterator struct { + Event *USDCTokenPoolConfigChanged + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *USDCTokenPoolConfigChangedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(USDCTokenPoolConfigChanged) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(USDCTokenPoolConfigChanged) + 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() + } +} + +func (it *USDCTokenPoolConfigChangedIterator) Error() error { + return it.fail +} + +func (it *USDCTokenPoolConfigChangedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type USDCTokenPoolConfigChanged struct { + Config RateLimiterConfig + Raw types.Log +} + +func (_USDCTokenPool *USDCTokenPoolFilterer) FilterConfigChanged(opts *bind.FilterOpts) (*USDCTokenPoolConfigChangedIterator, error) { + + logs, sub, err := _USDCTokenPool.contract.FilterLogs(opts, "ConfigChanged") + if err != nil { + return nil, err + } + return &USDCTokenPoolConfigChangedIterator{contract: _USDCTokenPool.contract, event: "ConfigChanged", logs: logs, sub: sub}, nil +} + +func (_USDCTokenPool *USDCTokenPoolFilterer) WatchConfigChanged(opts *bind.WatchOpts, sink chan<- *USDCTokenPoolConfigChanged) (event.Subscription, error) { + + logs, sub, err := _USDCTokenPool.contract.WatchLogs(opts, "ConfigChanged") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(USDCTokenPoolConfigChanged) + if err := _USDCTokenPool.contract.UnpackLog(event, "ConfigChanged", 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 +} + +func (_USDCTokenPool *USDCTokenPoolFilterer) ParseConfigChanged(log types.Log) (*USDCTokenPoolConfigChanged, error) { + event := new(USDCTokenPoolConfigChanged) + if err := _USDCTokenPool.contract.UnpackLog(event, "ConfigChanged", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type USDCTokenPoolConfigSetIterator struct { + Event *USDCTokenPoolConfigSet + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *USDCTokenPoolConfigSetIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(USDCTokenPoolConfigSet) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(USDCTokenPoolConfigSet) + 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() + } +} + +func (it *USDCTokenPoolConfigSetIterator) Error() error { + return it.fail +} + +func (it *USDCTokenPoolConfigSetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type USDCTokenPoolConfigSet struct { + TokenMessenger common.Address + Raw types.Log +} + +func (_USDCTokenPool *USDCTokenPoolFilterer) FilterConfigSet(opts *bind.FilterOpts) (*USDCTokenPoolConfigSetIterator, error) { + + logs, sub, err := _USDCTokenPool.contract.FilterLogs(opts, "ConfigSet") + if err != nil { + return nil, err + } + return &USDCTokenPoolConfigSetIterator{contract: _USDCTokenPool.contract, event: "ConfigSet", logs: logs, sub: sub}, nil +} + +func (_USDCTokenPool *USDCTokenPoolFilterer) WatchConfigSet(opts *bind.WatchOpts, sink chan<- *USDCTokenPoolConfigSet) (event.Subscription, error) { + + logs, sub, err := _USDCTokenPool.contract.WatchLogs(opts, "ConfigSet") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(USDCTokenPoolConfigSet) + if err := _USDCTokenPool.contract.UnpackLog(event, "ConfigSet", 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 +} + +func (_USDCTokenPool *USDCTokenPoolFilterer) ParseConfigSet(log types.Log) (*USDCTokenPoolConfigSet, error) { + event := new(USDCTokenPoolConfigSet) + if err := _USDCTokenPool.contract.UnpackLog(event, "ConfigSet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type USDCTokenPoolDomainsSetIterator struct { + Event *USDCTokenPoolDomainsSet + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *USDCTokenPoolDomainsSetIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(USDCTokenPoolDomainsSet) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(USDCTokenPoolDomainsSet) + 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() + } +} + +func (it *USDCTokenPoolDomainsSetIterator) Error() error { + return it.fail +} + +func (it *USDCTokenPoolDomainsSetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type USDCTokenPoolDomainsSet struct { + Arg0 []USDCTokenPoolDomainUpdate + Raw types.Log +} + +func (_USDCTokenPool *USDCTokenPoolFilterer) FilterDomainsSet(opts *bind.FilterOpts) (*USDCTokenPoolDomainsSetIterator, error) { + + logs, sub, err := _USDCTokenPool.contract.FilterLogs(opts, "DomainsSet") + if err != nil { + return nil, err + } + return &USDCTokenPoolDomainsSetIterator{contract: _USDCTokenPool.contract, event: "DomainsSet", logs: logs, sub: sub}, nil +} + +func (_USDCTokenPool *USDCTokenPoolFilterer) WatchDomainsSet(opts *bind.WatchOpts, sink chan<- *USDCTokenPoolDomainsSet) (event.Subscription, error) { + + logs, sub, err := _USDCTokenPool.contract.WatchLogs(opts, "DomainsSet") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(USDCTokenPoolDomainsSet) + if err := _USDCTokenPool.contract.UnpackLog(event, "DomainsSet", 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 +} + +func (_USDCTokenPool *USDCTokenPoolFilterer) ParseDomainsSet(log types.Log) (*USDCTokenPoolDomainsSet, error) { + event := new(USDCTokenPoolDomainsSet) + if err := _USDCTokenPool.contract.UnpackLog(event, "DomainsSet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type USDCTokenPoolLockedIterator struct { + Event *USDCTokenPoolLocked + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *USDCTokenPoolLockedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(USDCTokenPoolLocked) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(USDCTokenPoolLocked) + 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() + } +} + +func (it *USDCTokenPoolLockedIterator) Error() error { + return it.fail +} + +func (it *USDCTokenPoolLockedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type USDCTokenPoolLocked struct { + Sender common.Address + Amount *big.Int + Raw types.Log +} + +func (_USDCTokenPool *USDCTokenPoolFilterer) FilterLocked(opts *bind.FilterOpts, sender []common.Address) (*USDCTokenPoolLockedIterator, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _USDCTokenPool.contract.FilterLogs(opts, "Locked", senderRule) + if err != nil { + return nil, err + } + return &USDCTokenPoolLockedIterator{contract: _USDCTokenPool.contract, event: "Locked", logs: logs, sub: sub}, nil +} + +func (_USDCTokenPool *USDCTokenPoolFilterer) WatchLocked(opts *bind.WatchOpts, sink chan<- *USDCTokenPoolLocked, sender []common.Address) (event.Subscription, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _USDCTokenPool.contract.WatchLogs(opts, "Locked", senderRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(USDCTokenPoolLocked) + if err := _USDCTokenPool.contract.UnpackLog(event, "Locked", 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 +} + +func (_USDCTokenPool *USDCTokenPoolFilterer) ParseLocked(log types.Log) (*USDCTokenPoolLocked, error) { + event := new(USDCTokenPoolLocked) + if err := _USDCTokenPool.contract.UnpackLog(event, "Locked", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type USDCTokenPoolMintedIterator struct { + Event *USDCTokenPoolMinted + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *USDCTokenPoolMintedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(USDCTokenPoolMinted) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(USDCTokenPoolMinted) + 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() + } +} + +func (it *USDCTokenPoolMintedIterator) Error() error { + return it.fail +} + +func (it *USDCTokenPoolMintedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type USDCTokenPoolMinted struct { + Sender common.Address + Recipient common.Address + Amount *big.Int + Raw types.Log +} + +func (_USDCTokenPool *USDCTokenPoolFilterer) FilterMinted(opts *bind.FilterOpts, sender []common.Address, recipient []common.Address) (*USDCTokenPoolMintedIterator, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + var recipientRule []interface{} + for _, recipientItem := range recipient { + recipientRule = append(recipientRule, recipientItem) + } + + logs, sub, err := _USDCTokenPool.contract.FilterLogs(opts, "Minted", senderRule, recipientRule) + if err != nil { + return nil, err + } + return &USDCTokenPoolMintedIterator{contract: _USDCTokenPool.contract, event: "Minted", logs: logs, sub: sub}, nil +} + +func (_USDCTokenPool *USDCTokenPoolFilterer) WatchMinted(opts *bind.WatchOpts, sink chan<- *USDCTokenPoolMinted, sender []common.Address, recipient []common.Address) (event.Subscription, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + var recipientRule []interface{} + for _, recipientItem := range recipient { + recipientRule = append(recipientRule, recipientItem) + } + + logs, sub, err := _USDCTokenPool.contract.WatchLogs(opts, "Minted", senderRule, recipientRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(USDCTokenPoolMinted) + if err := _USDCTokenPool.contract.UnpackLog(event, "Minted", 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 +} + +func (_USDCTokenPool *USDCTokenPoolFilterer) ParseMinted(log types.Log) (*USDCTokenPoolMinted, error) { + event := new(USDCTokenPoolMinted) + if err := _USDCTokenPool.contract.UnpackLog(event, "Minted", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type USDCTokenPoolOwnershipTransferRequestedIterator struct { + Event *USDCTokenPoolOwnershipTransferRequested + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *USDCTokenPoolOwnershipTransferRequestedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(USDCTokenPoolOwnershipTransferRequested) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(USDCTokenPoolOwnershipTransferRequested) + 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() + } +} + +func (it *USDCTokenPoolOwnershipTransferRequestedIterator) Error() error { + return it.fail +} + +func (it *USDCTokenPoolOwnershipTransferRequestedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type USDCTokenPoolOwnershipTransferRequested struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_USDCTokenPool *USDCTokenPoolFilterer) FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*USDCTokenPoolOwnershipTransferRequestedIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _USDCTokenPool.contract.FilterLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return &USDCTokenPoolOwnershipTransferRequestedIterator{contract: _USDCTokenPool.contract, event: "OwnershipTransferRequested", logs: logs, sub: sub}, nil +} + +func (_USDCTokenPool *USDCTokenPoolFilterer) WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *USDCTokenPoolOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _USDCTokenPool.contract.WatchLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(USDCTokenPoolOwnershipTransferRequested) + if err := _USDCTokenPool.contract.UnpackLog(event, "OwnershipTransferRequested", 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 +} + +func (_USDCTokenPool *USDCTokenPoolFilterer) ParseOwnershipTransferRequested(log types.Log) (*USDCTokenPoolOwnershipTransferRequested, error) { + event := new(USDCTokenPoolOwnershipTransferRequested) + if err := _USDCTokenPool.contract.UnpackLog(event, "OwnershipTransferRequested", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type USDCTokenPoolOwnershipTransferredIterator struct { + Event *USDCTokenPoolOwnershipTransferred + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *USDCTokenPoolOwnershipTransferredIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(USDCTokenPoolOwnershipTransferred) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(USDCTokenPoolOwnershipTransferred) + 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() + } +} + +func (it *USDCTokenPoolOwnershipTransferredIterator) Error() error { + return it.fail +} + +func (it *USDCTokenPoolOwnershipTransferredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type USDCTokenPoolOwnershipTransferred struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_USDCTokenPool *USDCTokenPoolFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*USDCTokenPoolOwnershipTransferredIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _USDCTokenPool.contract.FilterLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return &USDCTokenPoolOwnershipTransferredIterator{contract: _USDCTokenPool.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil +} + +func (_USDCTokenPool *USDCTokenPoolFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *USDCTokenPoolOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _USDCTokenPool.contract.WatchLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(USDCTokenPoolOwnershipTransferred) + if err := _USDCTokenPool.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 +} + +func (_USDCTokenPool *USDCTokenPoolFilterer) ParseOwnershipTransferred(log types.Log) (*USDCTokenPoolOwnershipTransferred, error) { + event := new(USDCTokenPoolOwnershipTransferred) + if err := _USDCTokenPool.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type USDCTokenPoolReleasedIterator struct { + Event *USDCTokenPoolReleased + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *USDCTokenPoolReleasedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(USDCTokenPoolReleased) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(USDCTokenPoolReleased) + 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() + } +} + +func (it *USDCTokenPoolReleasedIterator) Error() error { + return it.fail +} + +func (it *USDCTokenPoolReleasedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type USDCTokenPoolReleased struct { + Sender common.Address + Recipient common.Address + Amount *big.Int + Raw types.Log +} + +func (_USDCTokenPool *USDCTokenPoolFilterer) FilterReleased(opts *bind.FilterOpts, sender []common.Address, recipient []common.Address) (*USDCTokenPoolReleasedIterator, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + var recipientRule []interface{} + for _, recipientItem := range recipient { + recipientRule = append(recipientRule, recipientItem) + } + + logs, sub, err := _USDCTokenPool.contract.FilterLogs(opts, "Released", senderRule, recipientRule) + if err != nil { + return nil, err + } + return &USDCTokenPoolReleasedIterator{contract: _USDCTokenPool.contract, event: "Released", logs: logs, sub: sub}, nil +} + +func (_USDCTokenPool *USDCTokenPoolFilterer) WatchReleased(opts *bind.WatchOpts, sink chan<- *USDCTokenPoolReleased, sender []common.Address, recipient []common.Address) (event.Subscription, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + var recipientRule []interface{} + for _, recipientItem := range recipient { + recipientRule = append(recipientRule, recipientItem) + } + + logs, sub, err := _USDCTokenPool.contract.WatchLogs(opts, "Released", senderRule, recipientRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(USDCTokenPoolReleased) + if err := _USDCTokenPool.contract.UnpackLog(event, "Released", 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 +} + +func (_USDCTokenPool *USDCTokenPoolFilterer) ParseReleased(log types.Log) (*USDCTokenPoolReleased, error) { + event := new(USDCTokenPoolReleased) + if err := _USDCTokenPool.contract.UnpackLog(event, "Released", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type USDCTokenPoolRemotePoolSetIterator struct { + Event *USDCTokenPoolRemotePoolSet + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *USDCTokenPoolRemotePoolSetIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(USDCTokenPoolRemotePoolSet) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(USDCTokenPoolRemotePoolSet) + 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() + } +} + +func (it *USDCTokenPoolRemotePoolSetIterator) Error() error { + return it.fail +} + +func (it *USDCTokenPoolRemotePoolSetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type USDCTokenPoolRemotePoolSet struct { + RemoteChainSelector uint64 + PreviousPoolAddress []byte + RemotePoolAddress []byte + Raw types.Log +} + +func (_USDCTokenPool *USDCTokenPoolFilterer) FilterRemotePoolSet(opts *bind.FilterOpts, remoteChainSelector []uint64) (*USDCTokenPoolRemotePoolSetIterator, error) { + + var remoteChainSelectorRule []interface{} + for _, remoteChainSelectorItem := range remoteChainSelector { + remoteChainSelectorRule = append(remoteChainSelectorRule, remoteChainSelectorItem) + } + + logs, sub, err := _USDCTokenPool.contract.FilterLogs(opts, "RemotePoolSet", remoteChainSelectorRule) + if err != nil { + return nil, err + } + return &USDCTokenPoolRemotePoolSetIterator{contract: _USDCTokenPool.contract, event: "RemotePoolSet", logs: logs, sub: sub}, nil +} + +func (_USDCTokenPool *USDCTokenPoolFilterer) WatchRemotePoolSet(opts *bind.WatchOpts, sink chan<- *USDCTokenPoolRemotePoolSet, remoteChainSelector []uint64) (event.Subscription, error) { + + var remoteChainSelectorRule []interface{} + for _, remoteChainSelectorItem := range remoteChainSelector { + remoteChainSelectorRule = append(remoteChainSelectorRule, remoteChainSelectorItem) + } + + logs, sub, err := _USDCTokenPool.contract.WatchLogs(opts, "RemotePoolSet", remoteChainSelectorRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(USDCTokenPoolRemotePoolSet) + if err := _USDCTokenPool.contract.UnpackLog(event, "RemotePoolSet", 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 +} + +func (_USDCTokenPool *USDCTokenPoolFilterer) ParseRemotePoolSet(log types.Log) (*USDCTokenPoolRemotePoolSet, error) { + event := new(USDCTokenPoolRemotePoolSet) + if err := _USDCTokenPool.contract.UnpackLog(event, "RemotePoolSet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type USDCTokenPoolRouterUpdatedIterator struct { + Event *USDCTokenPoolRouterUpdated + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *USDCTokenPoolRouterUpdatedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(USDCTokenPoolRouterUpdated) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(USDCTokenPoolRouterUpdated) + 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() + } +} + +func (it *USDCTokenPoolRouterUpdatedIterator) Error() error { + return it.fail +} + +func (it *USDCTokenPoolRouterUpdatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type USDCTokenPoolRouterUpdated struct { + OldRouter common.Address + NewRouter common.Address + Raw types.Log +} + +func (_USDCTokenPool *USDCTokenPoolFilterer) FilterRouterUpdated(opts *bind.FilterOpts) (*USDCTokenPoolRouterUpdatedIterator, error) { + + logs, sub, err := _USDCTokenPool.contract.FilterLogs(opts, "RouterUpdated") + if err != nil { + return nil, err + } + return &USDCTokenPoolRouterUpdatedIterator{contract: _USDCTokenPool.contract, event: "RouterUpdated", logs: logs, sub: sub}, nil +} + +func (_USDCTokenPool *USDCTokenPoolFilterer) WatchRouterUpdated(opts *bind.WatchOpts, sink chan<- *USDCTokenPoolRouterUpdated) (event.Subscription, error) { + + logs, sub, err := _USDCTokenPool.contract.WatchLogs(opts, "RouterUpdated") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(USDCTokenPoolRouterUpdated) + if err := _USDCTokenPool.contract.UnpackLog(event, "RouterUpdated", 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 +} + +func (_USDCTokenPool *USDCTokenPoolFilterer) ParseRouterUpdated(log types.Log) (*USDCTokenPoolRouterUpdated, error) { + event := new(USDCTokenPoolRouterUpdated) + if err := _USDCTokenPool.contract.UnpackLog(event, "RouterUpdated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type USDCTokenPoolTokensConsumedIterator struct { + Event *USDCTokenPoolTokensConsumed + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *USDCTokenPoolTokensConsumedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(USDCTokenPoolTokensConsumed) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(USDCTokenPoolTokensConsumed) + 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() + } +} + +func (it *USDCTokenPoolTokensConsumedIterator) Error() error { + return it.fail +} + +func (it *USDCTokenPoolTokensConsumedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type USDCTokenPoolTokensConsumed struct { + Tokens *big.Int + Raw types.Log +} + +func (_USDCTokenPool *USDCTokenPoolFilterer) FilterTokensConsumed(opts *bind.FilterOpts) (*USDCTokenPoolTokensConsumedIterator, error) { + + logs, sub, err := _USDCTokenPool.contract.FilterLogs(opts, "TokensConsumed") + if err != nil { + return nil, err + } + return &USDCTokenPoolTokensConsumedIterator{contract: _USDCTokenPool.contract, event: "TokensConsumed", logs: logs, sub: sub}, nil +} + +func (_USDCTokenPool *USDCTokenPoolFilterer) WatchTokensConsumed(opts *bind.WatchOpts, sink chan<- *USDCTokenPoolTokensConsumed) (event.Subscription, error) { + + logs, sub, err := _USDCTokenPool.contract.WatchLogs(opts, "TokensConsumed") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(USDCTokenPoolTokensConsumed) + if err := _USDCTokenPool.contract.UnpackLog(event, "TokensConsumed", 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 +} + +func (_USDCTokenPool *USDCTokenPoolFilterer) ParseTokensConsumed(log types.Log) (*USDCTokenPoolTokensConsumed, error) { + event := new(USDCTokenPoolTokensConsumed) + if err := _USDCTokenPool.contract.UnpackLog(event, "TokensConsumed", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +func (_USDCTokenPool *USDCTokenPool) ParseLog(log types.Log) (generated.AbigenLog, error) { + switch log.Topics[0] { + case _USDCTokenPool.abi.Events["AllowListAdd"].ID: + return _USDCTokenPool.ParseAllowListAdd(log) + case _USDCTokenPool.abi.Events["AllowListRemove"].ID: + return _USDCTokenPool.ParseAllowListRemove(log) + case _USDCTokenPool.abi.Events["Burned"].ID: + return _USDCTokenPool.ParseBurned(log) + case _USDCTokenPool.abi.Events["ChainAdded"].ID: + return _USDCTokenPool.ParseChainAdded(log) + case _USDCTokenPool.abi.Events["ChainConfigured"].ID: + return _USDCTokenPool.ParseChainConfigured(log) + case _USDCTokenPool.abi.Events["ChainRemoved"].ID: + return _USDCTokenPool.ParseChainRemoved(log) + case _USDCTokenPool.abi.Events["ConfigChanged"].ID: + return _USDCTokenPool.ParseConfigChanged(log) + case _USDCTokenPool.abi.Events["ConfigSet"].ID: + return _USDCTokenPool.ParseConfigSet(log) + case _USDCTokenPool.abi.Events["DomainsSet"].ID: + return _USDCTokenPool.ParseDomainsSet(log) + case _USDCTokenPool.abi.Events["Locked"].ID: + return _USDCTokenPool.ParseLocked(log) + case _USDCTokenPool.abi.Events["Minted"].ID: + return _USDCTokenPool.ParseMinted(log) + case _USDCTokenPool.abi.Events["OwnershipTransferRequested"].ID: + return _USDCTokenPool.ParseOwnershipTransferRequested(log) + case _USDCTokenPool.abi.Events["OwnershipTransferred"].ID: + return _USDCTokenPool.ParseOwnershipTransferred(log) + case _USDCTokenPool.abi.Events["Released"].ID: + return _USDCTokenPool.ParseReleased(log) + case _USDCTokenPool.abi.Events["RemotePoolSet"].ID: + return _USDCTokenPool.ParseRemotePoolSet(log) + case _USDCTokenPool.abi.Events["RouterUpdated"].ID: + return _USDCTokenPool.ParseRouterUpdated(log) + case _USDCTokenPool.abi.Events["TokensConsumed"].ID: + return _USDCTokenPool.ParseTokensConsumed(log) + + default: + return nil, fmt.Errorf("abigen wrapper received unknown log topic: %v", log.Topics[0]) + } +} + +func (USDCTokenPoolAllowListAdd) Topic() common.Hash { + return common.HexToHash("0x2640d4d76caf8bf478aabfa982fa4e1c4eb71a37f93cd15e80dbc657911546d8") +} + +func (USDCTokenPoolAllowListRemove) Topic() common.Hash { + return common.HexToHash("0x800671136ab6cfee9fbe5ed1fb7ca417811aca3cf864800d127b927adedf7566") +} + +func (USDCTokenPoolBurned) Topic() common.Hash { + return common.HexToHash("0x696de425f79f4a40bc6d2122ca50507f0efbeabbff86a84871b7196ab8ea8df7") +} + +func (USDCTokenPoolChainAdded) Topic() common.Hash { + return common.HexToHash("0x8d340f17e19058004c20453540862a9c62778504476f6756755cb33bcd6c38c2") +} + +func (USDCTokenPoolChainConfigured) Topic() common.Hash { + return common.HexToHash("0x0350d63aa5f270e01729d00d627eeb8f3429772b1818c016c66a588a864f912b") +} + +func (USDCTokenPoolChainRemoved) Topic() common.Hash { + return common.HexToHash("0x5204aec90a3c794d8e90fded8b46ae9c7c552803e7e832e0c1d358396d859916") +} + +func (USDCTokenPoolConfigChanged) Topic() common.Hash { + return common.HexToHash("0x9ea3374b67bf275e6bb9c8ae68f9cae023e1c528b4b27e092f0bb209d3531c19") +} + +func (USDCTokenPoolConfigSet) Topic() common.Hash { + return common.HexToHash("0x2e902d38f15b233cbb63711add0fca4545334d3a169d60c0a616494d7eea9544") +} + +func (USDCTokenPoolDomainsSet) Topic() common.Hash { + return common.HexToHash("0x1889010d2535a0ab1643678d1da87fbbe8b87b2f585b47ddb72ec622aef9ee56") +} + +func (USDCTokenPoolLocked) Topic() common.Hash { + return common.HexToHash("0x9f1ec8c880f76798e7b793325d625e9b60e4082a553c98f42b6cda368dd60008") +} + +func (USDCTokenPoolMinted) Topic() common.Hash { + return common.HexToHash("0x9d228d69b5fdb8d273a2336f8fb8612d039631024ea9bf09c424a9503aa078f0") +} + +func (USDCTokenPoolOwnershipTransferRequested) Topic() common.Hash { + return common.HexToHash("0xed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae1278") +} + +func (USDCTokenPoolOwnershipTransferred) Topic() common.Hash { + return common.HexToHash("0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0") +} + +func (USDCTokenPoolReleased) Topic() common.Hash { + return common.HexToHash("0x2d87480f50083e2b2759522a8fdda59802650a8055e609a7772cf70c07748f52") +} + +func (USDCTokenPoolRemotePoolSet) Topic() common.Hash { + return common.HexToHash("0xdb4d6220746a38cbc5335f7e108f7de80f482f4d23350253dfd0917df75a14bf") +} + +func (USDCTokenPoolRouterUpdated) Topic() common.Hash { + return common.HexToHash("0x02dc5c233404867c793b749c6d644beb2277536d18a7e7974d3f238e4c6f1684") +} + +func (USDCTokenPoolTokensConsumed) Topic() common.Hash { + return common.HexToHash("0x1871cdf8010e63f2eb8384381a68dfa7416dc571a5517e66e88b2d2d0c0a690a") +} + +func (_USDCTokenPool *USDCTokenPool) Address() common.Address { + return _USDCTokenPool.address +} + +type USDCTokenPoolInterface interface { + SUPPORTEDUSDCVERSION(opts *bind.CallOpts) (uint32, error) + + GetAllowList(opts *bind.CallOpts) ([]common.Address, error) + + GetAllowListEnabled(opts *bind.CallOpts) (bool, error) + + GetCurrentInboundRateLimiterState(opts *bind.CallOpts, remoteChainSelector uint64) (RateLimiterTokenBucket, error) + + GetCurrentOutboundRateLimiterState(opts *bind.CallOpts, remoteChainSelector uint64) (RateLimiterTokenBucket, error) + + GetDomain(opts *bind.CallOpts, chainSelector uint64) (USDCTokenPoolDomain, error) + + GetRateLimitAdmin(opts *bind.CallOpts) (common.Address, error) + + GetRemotePool(opts *bind.CallOpts, remoteChainSelector uint64) ([]byte, error) + + GetRemoteToken(opts *bind.CallOpts, remoteChainSelector uint64) ([]byte, error) + + GetRmnProxy(opts *bind.CallOpts) (common.Address, error) + + GetRouter(opts *bind.CallOpts) (common.Address, error) + + GetSupportedChains(opts *bind.CallOpts) ([]uint64, error) + + GetToken(opts *bind.CallOpts) (common.Address, error) + + ILocalDomainIdentifier(opts *bind.CallOpts) (uint32, error) + + IMessageTransmitter(opts *bind.CallOpts) (common.Address, error) + + ITokenMessenger(opts *bind.CallOpts) (common.Address, error) + + IsSupportedChain(opts *bind.CallOpts, remoteChainSelector uint64) (bool, error) + + IsSupportedToken(opts *bind.CallOpts, token common.Address) (bool, error) + + Owner(opts *bind.CallOpts) (common.Address, error) + + SupportsInterface(opts *bind.CallOpts, interfaceId [4]byte) (bool, error) + + TypeAndVersion(opts *bind.CallOpts) (string, error) + + AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) + + ApplyAllowListUpdates(opts *bind.TransactOpts, removes []common.Address, adds []common.Address) (*types.Transaction, error) + + ApplyChainUpdates(opts *bind.TransactOpts, chains []TokenPoolChainUpdate) (*types.Transaction, error) + + LockOrBurn(opts *bind.TransactOpts, lockOrBurnIn PoolLockOrBurnInV1) (*types.Transaction, error) + + ReleaseOrMint(opts *bind.TransactOpts, releaseOrMintIn PoolReleaseOrMintInV1) (*types.Transaction, error) + + SetChainRateLimiterConfig(opts *bind.TransactOpts, remoteChainSelector uint64, outboundConfig RateLimiterConfig, inboundConfig RateLimiterConfig) (*types.Transaction, error) + + SetDomains(opts *bind.TransactOpts, domains []USDCTokenPoolDomainUpdate) (*types.Transaction, error) + + SetRateLimitAdmin(opts *bind.TransactOpts, rateLimitAdmin common.Address) (*types.Transaction, error) + + SetRemotePool(opts *bind.TransactOpts, remoteChainSelector uint64, remotePoolAddress []byte) (*types.Transaction, error) + + SetRouter(opts *bind.TransactOpts, newRouter common.Address) (*types.Transaction, error) + + TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) + + FilterAllowListAdd(opts *bind.FilterOpts) (*USDCTokenPoolAllowListAddIterator, error) + + WatchAllowListAdd(opts *bind.WatchOpts, sink chan<- *USDCTokenPoolAllowListAdd) (event.Subscription, error) + + ParseAllowListAdd(log types.Log) (*USDCTokenPoolAllowListAdd, error) + + FilterAllowListRemove(opts *bind.FilterOpts) (*USDCTokenPoolAllowListRemoveIterator, error) + + WatchAllowListRemove(opts *bind.WatchOpts, sink chan<- *USDCTokenPoolAllowListRemove) (event.Subscription, error) + + ParseAllowListRemove(log types.Log) (*USDCTokenPoolAllowListRemove, error) + + FilterBurned(opts *bind.FilterOpts, sender []common.Address) (*USDCTokenPoolBurnedIterator, error) + + WatchBurned(opts *bind.WatchOpts, sink chan<- *USDCTokenPoolBurned, sender []common.Address) (event.Subscription, error) + + ParseBurned(log types.Log) (*USDCTokenPoolBurned, error) + + FilterChainAdded(opts *bind.FilterOpts) (*USDCTokenPoolChainAddedIterator, error) + + WatchChainAdded(opts *bind.WatchOpts, sink chan<- *USDCTokenPoolChainAdded) (event.Subscription, error) + + ParseChainAdded(log types.Log) (*USDCTokenPoolChainAdded, error) + + FilterChainConfigured(opts *bind.FilterOpts) (*USDCTokenPoolChainConfiguredIterator, error) + + WatchChainConfigured(opts *bind.WatchOpts, sink chan<- *USDCTokenPoolChainConfigured) (event.Subscription, error) + + ParseChainConfigured(log types.Log) (*USDCTokenPoolChainConfigured, error) + + FilterChainRemoved(opts *bind.FilterOpts) (*USDCTokenPoolChainRemovedIterator, error) + + WatchChainRemoved(opts *bind.WatchOpts, sink chan<- *USDCTokenPoolChainRemoved) (event.Subscription, error) + + ParseChainRemoved(log types.Log) (*USDCTokenPoolChainRemoved, error) + + FilterConfigChanged(opts *bind.FilterOpts) (*USDCTokenPoolConfigChangedIterator, error) + + WatchConfigChanged(opts *bind.WatchOpts, sink chan<- *USDCTokenPoolConfigChanged) (event.Subscription, error) + + ParseConfigChanged(log types.Log) (*USDCTokenPoolConfigChanged, error) + + FilterConfigSet(opts *bind.FilterOpts) (*USDCTokenPoolConfigSetIterator, error) + + WatchConfigSet(opts *bind.WatchOpts, sink chan<- *USDCTokenPoolConfigSet) (event.Subscription, error) + + ParseConfigSet(log types.Log) (*USDCTokenPoolConfigSet, error) + + FilterDomainsSet(opts *bind.FilterOpts) (*USDCTokenPoolDomainsSetIterator, error) + + WatchDomainsSet(opts *bind.WatchOpts, sink chan<- *USDCTokenPoolDomainsSet) (event.Subscription, error) + + ParseDomainsSet(log types.Log) (*USDCTokenPoolDomainsSet, error) + + FilterLocked(opts *bind.FilterOpts, sender []common.Address) (*USDCTokenPoolLockedIterator, error) + + WatchLocked(opts *bind.WatchOpts, sink chan<- *USDCTokenPoolLocked, sender []common.Address) (event.Subscription, error) + + ParseLocked(log types.Log) (*USDCTokenPoolLocked, error) + + FilterMinted(opts *bind.FilterOpts, sender []common.Address, recipient []common.Address) (*USDCTokenPoolMintedIterator, error) + + WatchMinted(opts *bind.WatchOpts, sink chan<- *USDCTokenPoolMinted, sender []common.Address, recipient []common.Address) (event.Subscription, error) + + ParseMinted(log types.Log) (*USDCTokenPoolMinted, error) + + FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*USDCTokenPoolOwnershipTransferRequestedIterator, error) + + WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *USDCTokenPoolOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferRequested(log types.Log) (*USDCTokenPoolOwnershipTransferRequested, error) + + FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*USDCTokenPoolOwnershipTransferredIterator, error) + + WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *USDCTokenPoolOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferred(log types.Log) (*USDCTokenPoolOwnershipTransferred, error) + + FilterReleased(opts *bind.FilterOpts, sender []common.Address, recipient []common.Address) (*USDCTokenPoolReleasedIterator, error) + + WatchReleased(opts *bind.WatchOpts, sink chan<- *USDCTokenPoolReleased, sender []common.Address, recipient []common.Address) (event.Subscription, error) + + ParseReleased(log types.Log) (*USDCTokenPoolReleased, error) + + FilterRemotePoolSet(opts *bind.FilterOpts, remoteChainSelector []uint64) (*USDCTokenPoolRemotePoolSetIterator, error) + + WatchRemotePoolSet(opts *bind.WatchOpts, sink chan<- *USDCTokenPoolRemotePoolSet, remoteChainSelector []uint64) (event.Subscription, error) + + ParseRemotePoolSet(log types.Log) (*USDCTokenPoolRemotePoolSet, error) + + FilterRouterUpdated(opts *bind.FilterOpts) (*USDCTokenPoolRouterUpdatedIterator, error) + + WatchRouterUpdated(opts *bind.WatchOpts, sink chan<- *USDCTokenPoolRouterUpdated) (event.Subscription, error) + + ParseRouterUpdated(log types.Log) (*USDCTokenPoolRouterUpdated, error) + + FilterTokensConsumed(opts *bind.FilterOpts) (*USDCTokenPoolTokensConsumedIterator, error) + + WatchTokensConsumed(opts *bind.WatchOpts, sink chan<- *USDCTokenPoolTokensConsumed) (event.Subscription, error) + + ParseTokensConsumed(log types.Log) (*USDCTokenPoolTokensConsumed, error) + + ParseLog(log types.Log) (generated.AbigenLog, error) + + Address() common.Address +} diff --git a/core/gethwrappers/ccip/generated/usdc_token_pool_1_4_0/usdc_token_pool_1_4_0.go b/core/gethwrappers/ccip/generated/usdc_token_pool_1_4_0/usdc_token_pool_1_4_0.go new file mode 100644 index 00000000000..67250b86e60 --- /dev/null +++ b/core/gethwrappers/ccip/generated/usdc_token_pool_1_4_0/usdc_token_pool_1_4_0.go @@ -0,0 +1,2693 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package usdc_token_pool_1_4_0 + +import ( + "errors" + "fmt" + "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" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" +) + +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +type RateLimiterConfig struct { + IsEnabled bool + Capacity *big.Int + Rate *big.Int +} + +type RateLimiterTokenBucket struct { + Tokens *big.Int + LastUpdated uint32 + IsEnabled bool + Capacity *big.Int + Rate *big.Int +} + +type TokenPoolChainUpdate struct { + RemoteChainSelector uint64 + Allowed bool + OutboundRateLimiterConfig RateLimiterConfig + InboundRateLimiterConfig RateLimiterConfig +} + +type USDCTokenPoolDomain struct { + AllowedCaller [32]byte + DomainIdentifier uint32 + Enabled bool +} + +type USDCTokenPoolDomainUpdate struct { + AllowedCaller [32]byte + DomainIdentifier uint32 + DestChainSelector uint64 + Enabled bool +} + +var USDCTokenPoolMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"internalType\":\"contractITokenMessenger\",\"name\":\"tokenMessenger\",\"type\":\"address\"},{\"internalType\":\"contractIERC20\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"allowlist\",\"type\":\"address[]\"},{\"internalType\":\"address\",\"name\":\"armProxy\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"router\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"capacity\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"requested\",\"type\":\"uint256\"}],\"name\":\"AggregateValueMaxCapacityExceeded\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"minWaitInSeconds\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"available\",\"type\":\"uint256\"}],\"name\":\"AggregateValueRateLimitReached\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"AllowListNotEnabled\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"BadARMSignal\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"BucketOverfilled\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"}],\"name\":\"CallerIsNotARampOnRouter\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"}],\"name\":\"ChainAlreadyExists\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"ChainNotAllowed\",\"type\":\"error\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"config\",\"type\":\"tuple\"}],\"name\":\"DisabledNonZeroRateLimit\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidConfig\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"expected\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"got\",\"type\":\"uint32\"}],\"name\":\"InvalidDestinationDomain\",\"type\":\"error\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"allowedCaller\",\"type\":\"bytes32\"},{\"internalType\":\"uint32\",\"name\":\"domainIdentifier\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"bool\",\"name\":\"enabled\",\"type\":\"bool\"}],\"internalType\":\"structUSDCTokenPool.DomainUpdate\",\"name\":\"domain\",\"type\":\"tuple\"}],\"name\":\"InvalidDomain\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"version\",\"type\":\"uint32\"}],\"name\":\"InvalidMessageVersion\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"expected\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"got\",\"type\":\"uint64\"}],\"name\":\"InvalidNonce\",\"type\":\"error\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"rateLimiterConfig\",\"type\":\"tuple\"}],\"name\":\"InvalidRatelimitRate\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"expected\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"got\",\"type\":\"uint32\"}],\"name\":\"InvalidSourceDomain\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"version\",\"type\":\"uint32\"}],\"name\":\"InvalidTokenMessengerVersion\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"NonExistentChain\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RateLimitMustBeDisabled\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"SenderNotAllowed\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"capacity\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"requested\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"}],\"name\":\"TokenMaxCapacityExceeded\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"minWaitInSeconds\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"available\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"}],\"name\":\"TokenRateLimitReached\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"domain\",\"type\":\"uint64\"}],\"name\":\"UnknownDomain\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UnlockingUSDCFailed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddressNotAllowed\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"AllowListAdd\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"AllowListRemove\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Burned\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"indexed\":false,\"internalType\":\"structRateLimiter.Config\",\"name\":\"outboundRateLimiterConfig\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"indexed\":false,\"internalType\":\"structRateLimiter.Config\",\"name\":\"inboundRateLimiterConfig\",\"type\":\"tuple\"}],\"name\":\"ChainAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"indexed\":false,\"internalType\":\"structRateLimiter.Config\",\"name\":\"outboundRateLimiterConfig\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"indexed\":false,\"internalType\":\"structRateLimiter.Config\",\"name\":\"inboundRateLimiterConfig\",\"type\":\"tuple\"}],\"name\":\"ChainConfigured\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"ChainRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"tokenMessenger\",\"type\":\"address\"}],\"name\":\"ConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"allowedCaller\",\"type\":\"bytes32\"},{\"internalType\":\"uint32\",\"name\":\"domainIdentifier\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"bool\",\"name\":\"enabled\",\"type\":\"bool\"}],\"indexed\":false,\"internalType\":\"structUSDCTokenPool.DomainUpdate[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"name\":\"DomainsSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Locked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Minted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Released\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"oldRouter\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newRouter\",\"type\":\"address\"}],\"name\":\"RouterUpdated\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"SUPPORTED_USDC_VERSION\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"removes\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"adds\",\"type\":\"address[]\"}],\"name\":\"applyAllowListUpdates\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"bool\",\"name\":\"allowed\",\"type\":\"bool\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"outboundRateLimiterConfig\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"inboundRateLimiterConfig\",\"type\":\"tuple\"}],\"internalType\":\"structTokenPool.ChainUpdate[]\",\"name\":\"chains\",\"type\":\"tuple[]\"}],\"name\":\"applyChainUpdates\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAllowList\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAllowListEnabled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getArmProxy\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"armProxy\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"getCurrentInboundRateLimiterState\",\"outputs\":[{\"components\":[{\"internalType\":\"uint128\",\"name\":\"tokens\",\"type\":\"uint128\"},{\"internalType\":\"uint32\",\"name\":\"lastUpdated\",\"type\":\"uint32\"},{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.TokenBucket\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"getCurrentOutboundRateLimiterState\",\"outputs\":[{\"components\":[{\"internalType\":\"uint128\",\"name\":\"tokens\",\"type\":\"uint128\"},{\"internalType\":\"uint32\",\"name\":\"lastUpdated\",\"type\":\"uint32\"},{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.TokenBucket\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"}],\"name\":\"getDomain\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"allowedCaller\",\"type\":\"bytes32\"},{\"internalType\":\"uint32\",\"name\":\"domainIdentifier\",\"type\":\"uint32\"},{\"internalType\":\"bool\",\"name\":\"enabled\",\"type\":\"bool\"}],\"internalType\":\"structUSDCTokenPool.Domain\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRouter\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"router\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getSupportedChains\",\"outputs\":[{\"internalType\":\"uint64[]\",\"name\":\"\",\"type\":\"uint64[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getToken\",\"outputs\":[{\"internalType\":\"contractIERC20\",\"name\":\"token\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getUSDCInterfaceId\",\"outputs\":[{\"internalType\":\"bytes4\",\"name\":\"\",\"type\":\"bytes4\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"i_localDomainIdentifier\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"i_messageTransmitter\",\"outputs\":[{\"internalType\":\"contractIMessageTransmitter\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"i_tokenMessenger\",\"outputs\":[{\"internalType\":\"contractITokenMessenger\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"}],\"name\":\"isSupportedChain\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"originalSender\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"destinationReceiver\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"lockOrBurn\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"name\":\"releaseOrMint\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"outboundConfig\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"capacity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"rate\",\"type\":\"uint128\"}],\"internalType\":\"structRateLimiter.Config\",\"name\":\"inboundConfig\",\"type\":\"tuple\"}],\"name\":\"setChainRateLimiterConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"allowedCaller\",\"type\":\"bytes32\"},{\"internalType\":\"uint32\",\"name\":\"domainIdentifier\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"bool\",\"name\":\"enabled\",\"type\":\"bool\"}],\"internalType\":\"structUSDCTokenPool.DomainUpdate[]\",\"name\":\"domains\",\"type\":\"tuple[]\"}],\"name\":\"setDomains\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newRouter\",\"type\":\"address\"}],\"name\":\"setRouter\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", + Bin: "0x6101406040523480156200001257600080fd5b506040516200458a3803806200458a833981016040819052620000359162000b4d565b838383833380600081620000905760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000c357620000c38162000408565b5050506001600160a01b0384161580620000e457506001600160a01b038116155b1562000103576040516342bcdf7f60e11b815260040160405180910390fd5b6001600160a01b0384811660805282811660a052600480546001600160a01b031916918316919091179055825115801560c0526200015657604080516000815260208101909152620001569084620004b3565b5050506001600160a01b038616905062000183576040516306b7c75960e31b815260040160405180910390fd5b6000856001600160a01b0316632c1219216040518163ffffffff1660e01b8152600401602060405180830381865afa158015620001c4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001ea919062000c73565b90506000816001600160a01b03166354fd4d506040518163ffffffff1660e01b8152600401602060405180830381865afa1580156200022d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000253919062000c9a565b905063ffffffff81161562000284576040516334697c6b60e11b815263ffffffff8216600482015260240162000087565b6000876001600160a01b0316639cdbb1816040518163ffffffff1660e01b8152600401602060405180830381865afa158015620002c5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620002eb919062000c9a565b905063ffffffff8116156200031c576040516316ba39c560e31b815263ffffffff8216600482015260240162000087565b6001600160a01b0380891660e05283166101008190526040805163234d8e3d60e21b81529051638d3638f4916004808201926020929091908290030181865afa1580156200036e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000394919062000c9a565b63ffffffff166101205260e051608051620003be916001600160a01b039091169060001962000624565b6040516001600160a01b03891681527f2e902d38f15b233cbb63711add0fca4545334d3a169d60c0a616494d7eea95449060200160405180910390a1505050505050505062000e03565b336001600160a01b03821603620004625760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640162000087565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b60c051620004d4576040516335f4a7b360e01b815260040160405180910390fd5b60005b825181101562000569576000838281518110620004f857620004f862000cc2565b60209081029190910101519050620005126002826200070a565b1562000555576040516001600160a01b03821681527f800671136ab6cfee9fbe5ed1fb7ca417811aca3cf864800d127b927adedf75669060200160405180910390a15b50620005618162000cee565b9050620004d7565b5060005b81518110156200061f5760008282815181106200058e576200058e62000cc2565b6020026020010151905060006001600160a01b0316816001600160a01b031603620005ba57506200060c565b620005c76002826200072a565b156200060a576040516001600160a01b03821681527f2640d4d76caf8bf478aabfa982fa4e1c4eb71a37f93cd15e80dbc657911546d89060200160405180910390a15b505b620006178162000cee565b90506200056d565b505050565b604051636eb1769f60e11b81523060048201526001600160a01b038381166024830152600091839186169063dd62ed3e90604401602060405180830381865afa15801562000676573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200069c919062000d0a565b620006a8919062000d24565b604080516001600160a01b038616602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b0390811663095ea7b360e01b1790915291925062000704918691906200074116565b50505050565b600062000721836001600160a01b03841662000812565b90505b92915050565b600062000721836001600160a01b03841662000916565b6040805180820190915260208082527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65649082015260009062000790906001600160a01b03851690849062000968565b8051909150156200061f5780806020019051810190620007b1919062000d3a565b6200061f5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840162000087565b600081815260018301602052604081205480156200090b5760006200083960018362000d5e565b85549091506000906200084f9060019062000d5e565b9050818114620008bb57600086600001828154811062000873576200087362000cc2565b906000526020600020015490508087600001848154811062000899576200089962000cc2565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080620008cf57620008cf62000d74565b60019003818190600052602060002001600090559055856001016000868152602001908152602001600020600090556001935050505062000724565b600091505062000724565b60008181526001830160205260408120546200095f5750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915562000724565b50600062000724565b606062000979848460008562000981565b949350505050565b606082471015620009e45760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840162000087565b600080866001600160a01b0316858760405162000a02919062000db0565b60006040518083038185875af1925050503d806000811462000a41576040519150601f19603f3d011682016040523d82523d6000602084013e62000a46565b606091505b50909250905062000a5a8783838762000a65565b979650505050505050565b6060831562000ad957825160000362000ad1576001600160a01b0385163b62000ad15760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640162000087565b508162000979565b62000979838381511562000af05781518083602001fd5b8060405162461bcd60e51b815260040162000087919062000dce565b6001600160a01b038116811462000b2257600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b805162000b488162000b0c565b919050565b600080600080600060a0868803121562000b6657600080fd5b855162000b738162000b0c565b8095505060208087015162000b888162000b0c565b60408801519095506001600160401b038082111562000ba657600080fd5b818901915089601f83011262000bbb57600080fd5b81518181111562000bd05762000bd062000b25565b8060051b604051601f19603f8301168101818110858211171562000bf85762000bf862000b25565b60405291825284820192508381018501918c83111562000c1757600080fd5b938501935b8285101562000c405762000c308562000b3b565b8452938501939285019262000c1c565b80985050505050505062000c576060870162000b3b565b915062000c676080870162000b3b565b90509295509295909350565b60006020828403121562000c8657600080fd5b815162000c938162000b0c565b9392505050565b60006020828403121562000cad57600080fd5b815163ffffffff8116811462000c9357600080fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006001820162000d035762000d0362000cd8565b5060010190565b60006020828403121562000d1d57600080fd5b5051919050565b8082018082111562000724576200072462000cd8565b60006020828403121562000d4d57600080fd5b8151801515811462000c9357600080fd5b8181038181111562000724576200072462000cd8565b634e487b7160e01b600052603160045260246000fd5b60005b8381101562000da757818101518382015260200162000d8d565b50506000910152565b6000825162000dc481846020870162000d8a565b9190910192915050565b602081526000825180602084015262000def81604085016020870162000d8a565b601f01601f19169190910160400192915050565b60805160a05160c05160e05161010051610120516136f162000e99600039600081816103020152818161159f01528181611ea10152611eff01526000818161059a015261109d0152600081816102db01526114da01526000818161055e0152818161130d0152611a850152600061028c015260008181610245015281816114a401528181611dc5015261200101526136f16000f3fe608060405234801561001057600080fd5b50600436106101b85760003560e01c80638da5cb5b116100f9578063c4bffe2b11610097578063dfadfa3511610071578063dfadfa35146104be578063e0351e131461055c578063f2fde38b14610582578063fbf84dd71461059557600080fd5b8063c4bffe2b14610483578063c75eea9c14610498578063cf7401f3146104ab57600080fd5b8063a7cd63b7116100d3578063a7cd63b7146103ce578063af58d59f146103e3578063b0f479a114610452578063c0d786551461047057600080fd5b80638da5cb5b1461039557806396875445146103b35780639fdf13ff146103c657600080fd5b80635995f063116101665780636d108139116101405780636d1081391461033957806379ba5097146103675780638627fad61461036f5780638926f54f1461038257600080fd5b80635995f063146102c35780636155cda0146102d65780636b716b0d146102fd57600080fd5b806321df0da71161019757806321df0da7146102435780635246492f1461028a57806354c8a4f3146102b057600080fd5b806241d3c1146101bd57806301ffc9a7146101d2578063181f5a77146101fa575b600080fd5b6101d06101cb366004612a03565b6105bc565b005b6101e56101e0366004612a78565b610763565b60405190151581526020015b60405180910390f35b6102366040518060400160405280601381526020017f55534443546f6b656e506f6f6c20312e342e300000000000000000000000000081525081565b6040516101f19190612b28565b7f00000000000000000000000000000000000000000000000000000000000000005b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101f1565b7f0000000000000000000000000000000000000000000000000000000000000000610265565b6101d06102be366004612b87565b6107bf565b6101d06102d1366004612bf3565b61083a565b6102657f000000000000000000000000000000000000000000000000000000000000000081565b6103247f000000000000000000000000000000000000000000000000000000000000000081565b60405163ffffffff90911681526020016101f1565b6040517fd6aca1be0000000000000000000000000000000000000000000000000000000081526020016101f1565b6101d0610dd2565b6101d061037d366004612df4565b610ecf565b6101e5610390366004612e8b565b6111a2565b60005473ffffffffffffffffffffffffffffffffffffffff16610265565b6102366103c1366004612eea565b6111b9565b610324600081565b6103d66115f8565b6040516101f19190612f8b565b6103f66103f1366004612e8b565b611609565b6040516101f1919081516fffffffffffffffffffffffffffffffff908116825260208084015163ffffffff1690830152604080840151151590830152606080840151821690830152608092830151169181019190915260a00190565b60045473ffffffffffffffffffffffffffffffffffffffff16610265565b6101d061047e366004612fe5565b6116db565b61048b6117af565b6040516101f19190613002565b6103f66104a6366004612e8b565b61186f565b6101d06104b93660046130e8565b611941565b6105326104cc366004612e8b565b60408051606080820183526000808352602080840182905292840181905267ffffffffffffffff949094168452600982529282902082519384018352805484526001015463ffffffff811691840191909152640100000000900460ff1615159082015290565b604080518251815260208084015163ffffffff1690820152918101511515908201526060016101f1565b7f00000000000000000000000000000000000000000000000000000000000000006101e5565b6101d0610590366004612fe5565b611954565b6102657f000000000000000000000000000000000000000000000000000000000000000081565b6105c4611968565b60005b818110156107255760008383838181106105e3576105e361312f565b9050608002018036038101906105f99190613170565b805190915015806106165750604081015167ffffffffffffffff16155b1561068557604080517fa087bd2900000000000000000000000000000000000000000000000000000000815282516004820152602083015163ffffffff1660248201529082015167ffffffffffffffff1660448201526060820151151560648201526084015b60405180910390fd5b60408051606080820183528351825260208085015163ffffffff9081168285019081529286015115158486019081529585015167ffffffffffffffff166000908152600990925293902091518255516001909101805493511515640100000000027fffffffffffffffffffffffffffffffffffffffffffffffffffffff0000000000909416919092161791909117905561071e816131fd565b90506105c7565b507f1889010d2535a0ab1643678d1da87fbbe8b87b2f585b47ddb72ec622aef9ee568282604051610757929190613235565b60405180910390a15050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167fd6aca1be0000000000000000000000000000000000000000000000000000000014806107b957506107b9826119eb565b92915050565b6107c7611968565b61083484848080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808802828101820190935287825290935087925086918291850190849080828437600092019190915250611a8392505050565b50505050565b610842611968565b60005b81811015610dcd5760008383838181106108615761086161312f565b9050610100020180360381019061087891906132be565b905061088d8160400151826020015115611c49565b6108a08160600151826020015115611c49565b806020015115610cc15780516108c29060059067ffffffffffffffff16611d86565b6109075780516040517f1d5ad3c500000000000000000000000000000000000000000000000000000000815267ffffffffffffffff909116600482015260240161067c565b6040518060a001604052808260400151602001516fffffffffffffffffffffffffffffffff1681526020014263ffffffff168152602001826040015160000151151581526020018260400151602001516fffffffffffffffffffffffffffffffff1681526020018260400151604001516fffffffffffffffffffffffffffffffff1681525060076000836000015167ffffffffffffffff1667ffffffffffffffff16815260200190815260200160002060008201518160000160006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555060208201518160000160106101000a81548163ffffffff021916908363ffffffff16021790555060408201518160000160146101000a81548160ff02191690831515021790555060608201518160010160006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555060808201518160010160106101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff1602179055509050506040518060a001604052808260600151602001516fffffffffffffffffffffffffffffffff1681526020014263ffffffff168152602001826060015160000151151581526020018260600151602001516fffffffffffffffffffffffffffffffff1681526020018260600151604001516fffffffffffffffffffffffffffffffff1681525060086000836000015167ffffffffffffffff1667ffffffffffffffff16815260200190815260200160002060008201518160000160006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555060208201518160000160106101000a81548163ffffffff021916908363ffffffff16021790555060408201518160000160146101000a81548160ff02191690831515021790555060608201518160010160006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555060808201518160010160106101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff1602179055509050507f0f135cbb9afa12a8bf3bbd071c117bcca4ddeca6160ef7f33d012a81b9c0c471816000015182604001518360600151604051610cb493929190613318565b60405180910390a1610dbc565b8051610cd99060059067ffffffffffffffff16611d99565b610d1e5780516040517f1e670e4b00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff909116600482015260240161067c565b805167ffffffffffffffff908116600090815260086020908152604080832080547fffffffffffffffffffffff0000000000000000000000000000000000000000009081168255600191820185905586518616855260078452828520805490911681550192909255835191519190921681527f5204aec90a3c794d8e90fded8b46ae9c7c552803e7e832e0c1d358396d859916910160405180910390a15b50610dc6816131fd565b9050610845565b505050565b60015473ffffffffffffffffffffffffffffffffffffffff163314610e53576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e657200000000000000000000604482015260640161067c565b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b81610ed9816111a2565b610f1b576040517fa9902c7e00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff8216600482015260240161067c565b600480546040517f83826b2b00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff84169281019290925233602483015273ffffffffffffffffffffffffffffffffffffffff16906383826b2b90604401602060405180830381865afa158015610f9a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fbe919061339b565b610ff6576040517f728fe07b00000000000000000000000000000000000000000000000000000000815233600482015260240161067c565b6110008385611da5565b6000808380602001905181019061101791906133fd565b915091506000828060200190518101906110319190613461565b905060008280602001905181019061104991906134a2565b9050611059816000015183611de9565b805160208201516040517f57ecfd2800000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016926357ecfd28926110d092600401613533565b6020604051808303816000875af11580156110ef573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611113919061339b565b611149576040517fbf969f2200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60405188815273ffffffffffffffffffffffffffffffffffffffff8a169033907f9d228d69b5fdb8d273a2336f8fb8612d039631024ea9bf09c424a9503aa078f09060200160405180910390a350505050505050505050565b60006107b9600567ffffffffffffffff8416611f9a565b6060836111c5816111a2565b611207576040517fa9902c7e00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff8216600482015260240161067c565b600480546040517fa8d87a3b00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff84169281019290925273ffffffffffffffffffffffffffffffffffffffff169063a8d87a3b90602401602060405180830381865afa158015611280573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112a49190613561565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461130a576040517f728fe07b00000000000000000000000000000000000000000000000000000000815233600482015260240161067c565b887f00000000000000000000000000000000000000000000000000000000000000008015611340575061133e600282611fb2565b155b1561138f576040517fd0d2597600000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8216600482015260240161067c565b67ffffffffffffffff861660009081526009602090815260409182902082516060810184528154815260019091015463ffffffff81169282019290925264010000000090910460ff16151591810182905290611423576040517fd201c48a00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff8816600482015260240161067c565b61142d8789611fe1565b600061143c6020828c8e61357e565b611445916135a8565b602083015183516040517ff856ddb6000000000000000000000000000000000000000000000000000000008152600481018d905263ffffffff90921660248301526044820183905273ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000008116606484015260848301919091529192506000917f0000000000000000000000000000000000000000000000000000000000000000169063f856ddb69060a4016020604051808303816000875af1158015611523573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061154791906135e4565b6040518b815290915033907f696de425f79f4a40bc6d2122ca50507f0efbeabbff86a84871b7196ab8ea8df79060200160405180910390a260408051808201825267ffffffffffffffff9290921680835263ffffffff7f00000000000000000000000000000000000000000000000000000000000000008116602094850190815283519485019290925290511682820152805180830382018152606090920190529c9b505050505050505050505050565b60606116046002612025565b905090565b6040805160a08101825260008082526020820181905291810182905260608101829052608081019190915267ffffffffffffffff8216600090815260086020908152604091829020825160a08101845281546fffffffffffffffffffffffffffffffff808216835270010000000000000000000000000000000080830463ffffffff16958401959095527401000000000000000000000000000000000000000090910460ff1615159482019490945260019091015480841660608301529190910490911660808201526107b990612032565b6116e3611968565b73ffffffffffffffffffffffffffffffffffffffff8116611730576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6004805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff000000000000000000000000000000000000000083168117909355604080519190921680825260208201939093527f02dc5c233404867c793b749c6d644beb2277536d18a7e7974d3f238e4c6f16849101610757565b606060006117bd6005612025565b90506000815167ffffffffffffffff8111156117db576117db612c56565b604051908082528060200260200182016040528015611804578160200160208202803683370190505b50905060005b8251811015611868578281815181106118255761182561312f565b602002602001015182828151811061183f5761183f61312f565b67ffffffffffffffff90921660209283029190910190910152611861816131fd565b905061180a565b5092915050565b6040805160a08101825260008082526020820181905291810182905260608101829052608081019190915267ffffffffffffffff8216600090815260076020908152604091829020825160a08101845281546fffffffffffffffffffffffffffffffff808216835270010000000000000000000000000000000080830463ffffffff16958401959095527401000000000000000000000000000000000000000090910460ff1615159482019490945260019091015480841660608301529190910490911660808201526107b990612032565b611949611968565b610dcd8383836120e4565b61195c611968565b611965816121cb565b50565b60005473ffffffffffffffffffffffffffffffffffffffff1633146119e9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e657200000000000000000000604482015260640161067c565b565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f317fa3340000000000000000000000000000000000000000000000000000000014806107b957507fffffffff0000000000000000000000000000000000000000000000000000000082167f01ffc9a7000000000000000000000000000000000000000000000000000000001492915050565b7f0000000000000000000000000000000000000000000000000000000000000000611ada576040517f35f4a7b300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b8251811015611b78576000838281518110611afa57611afa61312f565b60200260200101519050611b188160026122c090919063ffffffff16565b15611b675760405173ffffffffffffffffffffffffffffffffffffffff821681527f800671136ab6cfee9fbe5ed1fb7ca417811aca3cf864800d127b927adedf75669060200160405180910390a15b50611b71816131fd565b9050611add565b5060005b8151811015610dcd576000828281518110611b9957611b9961312f565b60200260200101519050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603611bdd5750611c39565b611be86002826122e2565b15611c375760405173ffffffffffffffffffffffffffffffffffffffff821681527f2640d4d76caf8bf478aabfa982fa4e1c4eb71a37f93cd15e80dbc657911546d89060200160405180910390a15b505b611c42816131fd565b9050611b7c565b815115611d145781602001516fffffffffffffffffffffffffffffffff1682604001516fffffffffffffffffffffffffffffffff16101580611c9f575060408201516fffffffffffffffffffffffffffffffff16155b15611cd857816040517f70505e5600000000000000000000000000000000000000000000000000000000815260040161067c9190613601565b8015611d10576040517f433fc33d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5050565b60408201516fffffffffffffffffffffffffffffffff16151580611d4d575060208201516fffffffffffffffffffffffffffffffff1615155b15611d1057816040517fd68af9cc00000000000000000000000000000000000000000000000000000000815260040161067c9190613601565b6000611d928383612300565b9392505050565b6000611d92838361234f565b67ffffffffffffffff82166000908152600860205260409020611d1090827f0000000000000000000000000000000000000000000000000000000000000000612442565b600482015163ffffffff811615611e34576040517f68d2f8d600000000000000000000000000000000000000000000000000000000815263ffffffff8216600482015260240161067c565b6008830151600c8401516014850151602085015163ffffffff808516911614611e9f5760208501516040517fe366a11700000000000000000000000000000000000000000000000000000000815263ffffffff9182166004820152908416602482015260440161067c565b7f000000000000000000000000000000000000000000000000000000000000000063ffffffff168263ffffffff1614611f34576040517f77e4802600000000000000000000000000000000000000000000000000000000815263ffffffff7f0000000000000000000000000000000000000000000000000000000000000000811660048301528316602482015260440161067c565b845167ffffffffffffffff828116911614611f925784516040517ff917ffea00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff9182166004820152908216602482015260440161067c565b505050505050565b60008181526001830160205260408120541515611d92565b73ffffffffffffffffffffffffffffffffffffffff811660009081526001830160205260408120541515611d92565b67ffffffffffffffff82166000908152600760205260409020611d1090827f0000000000000000000000000000000000000000000000000000000000000000612442565b60606000611d92836127c5565b6040805160a0810182526000808252602082018190529181018290526060810182905260808101919091526120c082606001516fffffffffffffffffffffffffffffffff1683600001516fffffffffffffffffffffffffffffffff16846020015163ffffffff16426120a4919061363d565b85608001516fffffffffffffffffffffffffffffffff16612821565b6fffffffffffffffffffffffffffffffff1682525063ffffffff4216602082015290565b6120ed836111a2565b61212f576040517f1e670e4b00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff8416600482015260240161067c565b61213a826000611c49565b67ffffffffffffffff8316600090815260076020526040902061215d908361284b565b612168816000611c49565b67ffffffffffffffff8316600090815260086020526040902061218b908261284b565b7f0350d63aa5f270e01729d00d627eeb8f3429772b1818c016c66a588a864f912b8383836040516121be93929190613318565b60405180910390a1505050565b3373ffffffffffffffffffffffffffffffffffffffff82160361224a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640161067c565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b6000611d928373ffffffffffffffffffffffffffffffffffffffff841661234f565b6000611d928373ffffffffffffffffffffffffffffffffffffffff84165b6000818152600183016020526040812054612347575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556107b9565b5060006107b9565b6000818152600183016020526040812054801561243857600061237360018361363d565b85549091506000906123879060019061363d565b90508181146123ec5760008660000182815481106123a7576123a761312f565b90600052602060002001549050808760000184815481106123ca576123ca61312f565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806123fd576123fd613650565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506107b9565b60009150506107b9565b825474010000000000000000000000000000000000000000900460ff161580612469575081155b1561247357505050565b825460018401546fffffffffffffffffffffffffffffffff808316929116906000906124b990700100000000000000000000000000000000900463ffffffff164261363d565b9050801561257957818311156124fb576040517f9725942a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60018601546125359083908590849070010000000000000000000000000000000090046fffffffffffffffffffffffffffffffff16612821565b86547fffffffffffffffffffffffff00000000ffffffffffffffffffffffffffffffff167001000000000000000000000000000000004263ffffffff160217875592505b848210156126305773ffffffffffffffffffffffffffffffffffffffff84166125d8576040517ff94ebcd1000000000000000000000000000000000000000000000000000000008152600481018390526024810186905260440161067c565b6040517f1a76572a000000000000000000000000000000000000000000000000000000008152600481018390526024810186905273ffffffffffffffffffffffffffffffffffffffff8516604482015260640161067c565b848310156127435760018681015470010000000000000000000000000000000090046fffffffffffffffffffffffffffffffff16906000908290612674908261363d565b61267e878a61363d565b612688919061367f565b6126929190613692565b905073ffffffffffffffffffffffffffffffffffffffff86166126eb576040517f15279c08000000000000000000000000000000000000000000000000000000008152600481018290526024810186905260440161067c565b6040517fd0c8d23a000000000000000000000000000000000000000000000000000000008152600481018290526024810186905273ffffffffffffffffffffffffffffffffffffffff8716604482015260640161067c565b61274d858461363d565b86547fffffffffffffffffffffffffffffffff00000000000000000000000000000000166fffffffffffffffffffffffffffffffff82161787556040518681529093507f1871cdf8010e63f2eb8384381a68dfa7416dc571a5517e66e88b2d2d0c0a690a9060200160405180910390a1505050505050565b60608160000180548060200260200160405190810160405280929190818152602001828054801561281557602002820191906000526020600020905b815481526020019060010190808311612801575b50505050509050919050565b60006128408561283184866136cd565b61283b908761367f565b6129ed565b90505b949350505050565b815460009061287490700100000000000000000000000000000000900463ffffffff164261363d565b9050801561291657600183015483546128bc916fffffffffffffffffffffffffffffffff80821692811691859170010000000000000000000000000000000090910416612821565b83546fffffffffffffffffffffffffffffffff919091167fffffffffffffffffffffffff0000000000000000000000000000000000000000909116177001000000000000000000000000000000004263ffffffff16021783555b6020820151835461293c916fffffffffffffffffffffffffffffffff90811691166129ed565b83548351151574010000000000000000000000000000000000000000027fffffffffffffffffffffff00ffffffff000000000000000000000000000000009091166fffffffffffffffffffffffffffffffff92831617178455602083015160408085015183167001000000000000000000000000000000000291909216176001850155517f9ea3374b67bf275e6bb9c8ae68f9cae023e1c528b4b27e092f0bb209d3531c19906121be908490613601565b60008183106129fc5781611d92565b5090919050565b60008060208385031215612a1657600080fd5b823567ffffffffffffffff80821115612a2e57600080fd5b818501915085601f830112612a4257600080fd5b813581811115612a5157600080fd5b8660208260071b8501011115612a6657600080fd5b60209290920196919550909350505050565b600060208284031215612a8a57600080fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114611d9257600080fd5b60005b83811015612ad5578181015183820152602001612abd565b50506000910152565b60008151808452612af6816020860160208601612aba565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b602081526000611d926020830184612ade565b60008083601f840112612b4d57600080fd5b50813567ffffffffffffffff811115612b6557600080fd5b6020830191508360208260051b8501011115612b8057600080fd5b9250929050565b60008060008060408587031215612b9d57600080fd5b843567ffffffffffffffff80821115612bb557600080fd5b612bc188838901612b3b565b90965094506020870135915080821115612bda57600080fd5b50612be787828801612b3b565b95989497509550505050565b60008060208385031215612c0657600080fd5b823567ffffffffffffffff80821115612c1e57600080fd5b818501915085601f830112612c3257600080fd5b813581811115612c4157600080fd5b8660208260081b8501011115612a6657600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040516080810167ffffffffffffffff81118282101715612ca857612ca8612c56565b60405290565b6040805190810167ffffffffffffffff81118282101715612ca857612ca8612c56565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715612d1857612d18612c56565b604052919050565b600067ffffffffffffffff821115612d3a57612d3a612c56565b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b600082601f830112612d7757600080fd5b8135612d8a612d8582612d20565b612cd1565b818152846020838601011115612d9f57600080fd5b816020850160208301376000918101602001919091529392505050565b73ffffffffffffffffffffffffffffffffffffffff8116811461196557600080fd5b67ffffffffffffffff8116811461196557600080fd5b600080600080600060a08688031215612e0c57600080fd5b853567ffffffffffffffff80821115612e2457600080fd5b612e3089838a01612d66565b965060208801359150612e4282612dbc565b90945060408701359350606087013590612e5b82612dde565b90925060808701359080821115612e7157600080fd5b50612e7e88828901612d66565b9150509295509295909350565b600060208284031215612e9d57600080fd5b8135611d9281612dde565b60008083601f840112612eba57600080fd5b50813567ffffffffffffffff811115612ed257600080fd5b602083019150836020828501011115612b8057600080fd5b600080600080600080600060a0888a031215612f0557600080fd5b8735612f1081612dbc565b9650602088013567ffffffffffffffff80821115612f2d57600080fd5b612f398b838c01612ea8565b909850965060408a0135955060608a01359150612f5582612dde565b90935060808901359080821115612f6b57600080fd5b50612f788a828b01612ea8565b989b979a50959850939692959293505050565b6020808252825182820181905260009190848201906040850190845b81811015612fd957835173ffffffffffffffffffffffffffffffffffffffff1683529284019291840191600101612fa7565b50909695505050505050565b600060208284031215612ff757600080fd5b8135611d9281612dbc565b6020808252825182820181905260009190848201906040850190845b81811015612fd957835167ffffffffffffffff168352928401929184019160010161301e565b801515811461196557600080fd5b80356fffffffffffffffffffffffffffffffff8116811461307257600080fd5b919050565b60006060828403121561308957600080fd5b6040516060810181811067ffffffffffffffff821117156130ac576130ac612c56565b60405290508082356130bd81613044565b81526130cb60208401613052565b60208201526130dc60408401613052565b60408201525092915050565b600080600060e084860312156130fd57600080fd5b833561310881612dde565b92506131178560208601613077565b91506131268560808601613077565b90509250925092565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b63ffffffff8116811461196557600080fd5b60006080828403121561318257600080fd5b61318a612c85565b82358152602083013561319c8161315e565b602082015260408301356131af81612dde565b604082015260608301356131c281613044565b60608201529392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361322e5761322e6131ce565b5060010190565b6020808252818101839052600090604080840186845b878110156132b15781358352848201356132648161315e565b63ffffffff16838601528184013561327b81612dde565b67ffffffffffffffff168385015260608281013561329881613044565b151590840152608092830192919091019060010161324b565b5090979650505050505050565b600061010082840312156132d157600080fd5b6132d9612c85565b82356132e481612dde565b815260208301356132f481613044565b60208201526133068460408501613077565b60408201526131c28460a08501613077565b67ffffffffffffffff8416815260e0810161336460208301858051151582526020808201516fffffffffffffffffffffffffffffffff9081169184019190915260409182015116910152565b82511515608083015260208301516fffffffffffffffffffffffffffffffff90811660a084015260408401511660c0830152612843565b6000602082840312156133ad57600080fd5b8151611d9281613044565b600082601f8301126133c957600080fd5b81516133d7612d8582612d20565b8181528460208386010111156133ec57600080fd5b612843826020830160208701612aba565b6000806040838503121561341057600080fd5b825167ffffffffffffffff8082111561342857600080fd5b613434868387016133b8565b9350602085015191508082111561344a57600080fd5b50613457858286016133b8565b9150509250929050565b60006040828403121561347357600080fd5b61347b612cae565b825161348681612dde565b815260208301516134968161315e565b60208201529392505050565b6000602082840312156134b457600080fd5b815167ffffffffffffffff808211156134cc57600080fd5b90830190604082860312156134e057600080fd5b6134e8612cae565b8251828111156134f757600080fd5b613503878286016133b8565b82525060208301518281111561351857600080fd5b613524878286016133b8565b60208301525095945050505050565b6040815260006135466040830185612ade565b82810360208401526135588185612ade565b95945050505050565b60006020828403121561357357600080fd5b8151611d9281612dbc565b6000808585111561358e57600080fd5b8386111561359b57600080fd5b5050820193919092039150565b803560208310156107b9577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff602084900360031b1b1692915050565b6000602082840312156135f657600080fd5b8151611d9281612dde565b606081016107b982848051151582526020808201516fffffffffffffffffffffffffffffffff9081169184019190915260409182015116910152565b818103818111156107b9576107b96131ce565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b808201808211156107b9576107b96131ce565b6000826136c8577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b80820281158282048414176107b9576107b96131ce56fea164736f6c6343000813000a", +} + +var USDCTokenPoolABI = USDCTokenPoolMetaData.ABI + +var USDCTokenPoolBin = USDCTokenPoolMetaData.Bin + +func DeployUSDCTokenPool(auth *bind.TransactOpts, backend bind.ContractBackend, tokenMessenger common.Address, token common.Address, allowlist []common.Address, armProxy common.Address, router common.Address) (common.Address, *types.Transaction, *USDCTokenPool, error) { + parsed, err := USDCTokenPoolMetaData.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(USDCTokenPoolBin), backend, tokenMessenger, token, allowlist, armProxy, router) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &USDCTokenPool{address: address, abi: *parsed, USDCTokenPoolCaller: USDCTokenPoolCaller{contract: contract}, USDCTokenPoolTransactor: USDCTokenPoolTransactor{contract: contract}, USDCTokenPoolFilterer: USDCTokenPoolFilterer{contract: contract}}, nil +} + +type USDCTokenPool struct { + address common.Address + abi abi.ABI + USDCTokenPoolCaller + USDCTokenPoolTransactor + USDCTokenPoolFilterer +} + +type USDCTokenPoolCaller struct { + contract *bind.BoundContract +} + +type USDCTokenPoolTransactor struct { + contract *bind.BoundContract +} + +type USDCTokenPoolFilterer struct { + contract *bind.BoundContract +} + +type USDCTokenPoolSession struct { + Contract *USDCTokenPool + CallOpts bind.CallOpts + TransactOpts bind.TransactOpts +} + +type USDCTokenPoolCallerSession struct { + Contract *USDCTokenPoolCaller + CallOpts bind.CallOpts +} + +type USDCTokenPoolTransactorSession struct { + Contract *USDCTokenPoolTransactor + TransactOpts bind.TransactOpts +} + +type USDCTokenPoolRaw struct { + Contract *USDCTokenPool +} + +type USDCTokenPoolCallerRaw struct { + Contract *USDCTokenPoolCaller +} + +type USDCTokenPoolTransactorRaw struct { + Contract *USDCTokenPoolTransactor +} + +func NewUSDCTokenPool(address common.Address, backend bind.ContractBackend) (*USDCTokenPool, error) { + abi, err := abi.JSON(strings.NewReader(USDCTokenPoolABI)) + if err != nil { + return nil, err + } + contract, err := bindUSDCTokenPool(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &USDCTokenPool{address: address, abi: abi, USDCTokenPoolCaller: USDCTokenPoolCaller{contract: contract}, USDCTokenPoolTransactor: USDCTokenPoolTransactor{contract: contract}, USDCTokenPoolFilterer: USDCTokenPoolFilterer{contract: contract}}, nil +} + +func NewUSDCTokenPoolCaller(address common.Address, caller bind.ContractCaller) (*USDCTokenPoolCaller, error) { + contract, err := bindUSDCTokenPool(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &USDCTokenPoolCaller{contract: contract}, nil +} + +func NewUSDCTokenPoolTransactor(address common.Address, transactor bind.ContractTransactor) (*USDCTokenPoolTransactor, error) { + contract, err := bindUSDCTokenPool(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &USDCTokenPoolTransactor{contract: contract}, nil +} + +func NewUSDCTokenPoolFilterer(address common.Address, filterer bind.ContractFilterer) (*USDCTokenPoolFilterer, error) { + contract, err := bindUSDCTokenPool(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &USDCTokenPoolFilterer{contract: contract}, nil +} + +func bindUSDCTokenPool(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := USDCTokenPoolMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +func (_USDCTokenPool *USDCTokenPoolRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _USDCTokenPool.Contract.USDCTokenPoolCaller.contract.Call(opts, result, method, params...) +} + +func (_USDCTokenPool *USDCTokenPoolRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _USDCTokenPool.Contract.USDCTokenPoolTransactor.contract.Transfer(opts) +} + +func (_USDCTokenPool *USDCTokenPoolRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _USDCTokenPool.Contract.USDCTokenPoolTransactor.contract.Transact(opts, method, params...) +} + +func (_USDCTokenPool *USDCTokenPoolCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _USDCTokenPool.Contract.contract.Call(opts, result, method, params...) +} + +func (_USDCTokenPool *USDCTokenPoolTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _USDCTokenPool.Contract.contract.Transfer(opts) +} + +func (_USDCTokenPool *USDCTokenPoolTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _USDCTokenPool.Contract.contract.Transact(opts, method, params...) +} + +func (_USDCTokenPool *USDCTokenPoolCaller) SUPPORTEDUSDCVERSION(opts *bind.CallOpts) (uint32, error) { + var out []interface{} + err := _USDCTokenPool.contract.Call(opts, &out, "SUPPORTED_USDC_VERSION") + + if err != nil { + return *new(uint32), err + } + + out0 := *abi.ConvertType(out[0], new(uint32)).(*uint32) + + return out0, err + +} + +func (_USDCTokenPool *USDCTokenPoolSession) SUPPORTEDUSDCVERSION() (uint32, error) { + return _USDCTokenPool.Contract.SUPPORTEDUSDCVERSION(&_USDCTokenPool.CallOpts) +} + +func (_USDCTokenPool *USDCTokenPoolCallerSession) SUPPORTEDUSDCVERSION() (uint32, error) { + return _USDCTokenPool.Contract.SUPPORTEDUSDCVERSION(&_USDCTokenPool.CallOpts) +} + +func (_USDCTokenPool *USDCTokenPoolCaller) GetAllowList(opts *bind.CallOpts) ([]common.Address, error) { + var out []interface{} + err := _USDCTokenPool.contract.Call(opts, &out, "getAllowList") + + if err != nil { + return *new([]common.Address), err + } + + out0 := *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) + + return out0, err + +} + +func (_USDCTokenPool *USDCTokenPoolSession) GetAllowList() ([]common.Address, error) { + return _USDCTokenPool.Contract.GetAllowList(&_USDCTokenPool.CallOpts) +} + +func (_USDCTokenPool *USDCTokenPoolCallerSession) GetAllowList() ([]common.Address, error) { + return _USDCTokenPool.Contract.GetAllowList(&_USDCTokenPool.CallOpts) +} + +func (_USDCTokenPool *USDCTokenPoolCaller) GetAllowListEnabled(opts *bind.CallOpts) (bool, error) { + var out []interface{} + err := _USDCTokenPool.contract.Call(opts, &out, "getAllowListEnabled") + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_USDCTokenPool *USDCTokenPoolSession) GetAllowListEnabled() (bool, error) { + return _USDCTokenPool.Contract.GetAllowListEnabled(&_USDCTokenPool.CallOpts) +} + +func (_USDCTokenPool *USDCTokenPoolCallerSession) GetAllowListEnabled() (bool, error) { + return _USDCTokenPool.Contract.GetAllowListEnabled(&_USDCTokenPool.CallOpts) +} + +func (_USDCTokenPool *USDCTokenPoolCaller) GetArmProxy(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _USDCTokenPool.contract.Call(opts, &out, "getArmProxy") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_USDCTokenPool *USDCTokenPoolSession) GetArmProxy() (common.Address, error) { + return _USDCTokenPool.Contract.GetArmProxy(&_USDCTokenPool.CallOpts) +} + +func (_USDCTokenPool *USDCTokenPoolCallerSession) GetArmProxy() (common.Address, error) { + return _USDCTokenPool.Contract.GetArmProxy(&_USDCTokenPool.CallOpts) +} + +func (_USDCTokenPool *USDCTokenPoolCaller) GetCurrentInboundRateLimiterState(opts *bind.CallOpts, remoteChainSelector uint64) (RateLimiterTokenBucket, error) { + var out []interface{} + err := _USDCTokenPool.contract.Call(opts, &out, "getCurrentInboundRateLimiterState", remoteChainSelector) + + if err != nil { + return *new(RateLimiterTokenBucket), err + } + + out0 := *abi.ConvertType(out[0], new(RateLimiterTokenBucket)).(*RateLimiterTokenBucket) + + return out0, err + +} + +func (_USDCTokenPool *USDCTokenPoolSession) GetCurrentInboundRateLimiterState(remoteChainSelector uint64) (RateLimiterTokenBucket, error) { + return _USDCTokenPool.Contract.GetCurrentInboundRateLimiterState(&_USDCTokenPool.CallOpts, remoteChainSelector) +} + +func (_USDCTokenPool *USDCTokenPoolCallerSession) GetCurrentInboundRateLimiterState(remoteChainSelector uint64) (RateLimiterTokenBucket, error) { + return _USDCTokenPool.Contract.GetCurrentInboundRateLimiterState(&_USDCTokenPool.CallOpts, remoteChainSelector) +} + +func (_USDCTokenPool *USDCTokenPoolCaller) GetCurrentOutboundRateLimiterState(opts *bind.CallOpts, remoteChainSelector uint64) (RateLimiterTokenBucket, error) { + var out []interface{} + err := _USDCTokenPool.contract.Call(opts, &out, "getCurrentOutboundRateLimiterState", remoteChainSelector) + + if err != nil { + return *new(RateLimiterTokenBucket), err + } + + out0 := *abi.ConvertType(out[0], new(RateLimiterTokenBucket)).(*RateLimiterTokenBucket) + + return out0, err + +} + +func (_USDCTokenPool *USDCTokenPoolSession) GetCurrentOutboundRateLimiterState(remoteChainSelector uint64) (RateLimiterTokenBucket, error) { + return _USDCTokenPool.Contract.GetCurrentOutboundRateLimiterState(&_USDCTokenPool.CallOpts, remoteChainSelector) +} + +func (_USDCTokenPool *USDCTokenPoolCallerSession) GetCurrentOutboundRateLimiterState(remoteChainSelector uint64) (RateLimiterTokenBucket, error) { + return _USDCTokenPool.Contract.GetCurrentOutboundRateLimiterState(&_USDCTokenPool.CallOpts, remoteChainSelector) +} + +func (_USDCTokenPool *USDCTokenPoolCaller) GetDomain(opts *bind.CallOpts, chainSelector uint64) (USDCTokenPoolDomain, error) { + var out []interface{} + err := _USDCTokenPool.contract.Call(opts, &out, "getDomain", chainSelector) + + if err != nil { + return *new(USDCTokenPoolDomain), err + } + + out0 := *abi.ConvertType(out[0], new(USDCTokenPoolDomain)).(*USDCTokenPoolDomain) + + return out0, err + +} + +func (_USDCTokenPool *USDCTokenPoolSession) GetDomain(chainSelector uint64) (USDCTokenPoolDomain, error) { + return _USDCTokenPool.Contract.GetDomain(&_USDCTokenPool.CallOpts, chainSelector) +} + +func (_USDCTokenPool *USDCTokenPoolCallerSession) GetDomain(chainSelector uint64) (USDCTokenPoolDomain, error) { + return _USDCTokenPool.Contract.GetDomain(&_USDCTokenPool.CallOpts, chainSelector) +} + +func (_USDCTokenPool *USDCTokenPoolCaller) GetRouter(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _USDCTokenPool.contract.Call(opts, &out, "getRouter") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_USDCTokenPool *USDCTokenPoolSession) GetRouter() (common.Address, error) { + return _USDCTokenPool.Contract.GetRouter(&_USDCTokenPool.CallOpts) +} + +func (_USDCTokenPool *USDCTokenPoolCallerSession) GetRouter() (common.Address, error) { + return _USDCTokenPool.Contract.GetRouter(&_USDCTokenPool.CallOpts) +} + +func (_USDCTokenPool *USDCTokenPoolCaller) GetSupportedChains(opts *bind.CallOpts) ([]uint64, error) { + var out []interface{} + err := _USDCTokenPool.contract.Call(opts, &out, "getSupportedChains") + + if err != nil { + return *new([]uint64), err + } + + out0 := *abi.ConvertType(out[0], new([]uint64)).(*[]uint64) + + return out0, err + +} + +func (_USDCTokenPool *USDCTokenPoolSession) GetSupportedChains() ([]uint64, error) { + return _USDCTokenPool.Contract.GetSupportedChains(&_USDCTokenPool.CallOpts) +} + +func (_USDCTokenPool *USDCTokenPoolCallerSession) GetSupportedChains() ([]uint64, error) { + return _USDCTokenPool.Contract.GetSupportedChains(&_USDCTokenPool.CallOpts) +} + +func (_USDCTokenPool *USDCTokenPoolCaller) GetToken(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _USDCTokenPool.contract.Call(opts, &out, "getToken") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_USDCTokenPool *USDCTokenPoolSession) GetToken() (common.Address, error) { + return _USDCTokenPool.Contract.GetToken(&_USDCTokenPool.CallOpts) +} + +func (_USDCTokenPool *USDCTokenPoolCallerSession) GetToken() (common.Address, error) { + return _USDCTokenPool.Contract.GetToken(&_USDCTokenPool.CallOpts) +} + +func (_USDCTokenPool *USDCTokenPoolCaller) GetUSDCInterfaceId(opts *bind.CallOpts) ([4]byte, error) { + var out []interface{} + err := _USDCTokenPool.contract.Call(opts, &out, "getUSDCInterfaceId") + + if err != nil { + return *new([4]byte), err + } + + out0 := *abi.ConvertType(out[0], new([4]byte)).(*[4]byte) + + return out0, err + +} + +func (_USDCTokenPool *USDCTokenPoolSession) GetUSDCInterfaceId() ([4]byte, error) { + return _USDCTokenPool.Contract.GetUSDCInterfaceId(&_USDCTokenPool.CallOpts) +} + +func (_USDCTokenPool *USDCTokenPoolCallerSession) GetUSDCInterfaceId() ([4]byte, error) { + return _USDCTokenPool.Contract.GetUSDCInterfaceId(&_USDCTokenPool.CallOpts) +} + +func (_USDCTokenPool *USDCTokenPoolCaller) ILocalDomainIdentifier(opts *bind.CallOpts) (uint32, error) { + var out []interface{} + err := _USDCTokenPool.contract.Call(opts, &out, "i_localDomainIdentifier") + + if err != nil { + return *new(uint32), err + } + + out0 := *abi.ConvertType(out[0], new(uint32)).(*uint32) + + return out0, err + +} + +func (_USDCTokenPool *USDCTokenPoolSession) ILocalDomainIdentifier() (uint32, error) { + return _USDCTokenPool.Contract.ILocalDomainIdentifier(&_USDCTokenPool.CallOpts) +} + +func (_USDCTokenPool *USDCTokenPoolCallerSession) ILocalDomainIdentifier() (uint32, error) { + return _USDCTokenPool.Contract.ILocalDomainIdentifier(&_USDCTokenPool.CallOpts) +} + +func (_USDCTokenPool *USDCTokenPoolCaller) IMessageTransmitter(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _USDCTokenPool.contract.Call(opts, &out, "i_messageTransmitter") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_USDCTokenPool *USDCTokenPoolSession) IMessageTransmitter() (common.Address, error) { + return _USDCTokenPool.Contract.IMessageTransmitter(&_USDCTokenPool.CallOpts) +} + +func (_USDCTokenPool *USDCTokenPoolCallerSession) IMessageTransmitter() (common.Address, error) { + return _USDCTokenPool.Contract.IMessageTransmitter(&_USDCTokenPool.CallOpts) +} + +func (_USDCTokenPool *USDCTokenPoolCaller) ITokenMessenger(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _USDCTokenPool.contract.Call(opts, &out, "i_tokenMessenger") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_USDCTokenPool *USDCTokenPoolSession) ITokenMessenger() (common.Address, error) { + return _USDCTokenPool.Contract.ITokenMessenger(&_USDCTokenPool.CallOpts) +} + +func (_USDCTokenPool *USDCTokenPoolCallerSession) ITokenMessenger() (common.Address, error) { + return _USDCTokenPool.Contract.ITokenMessenger(&_USDCTokenPool.CallOpts) +} + +func (_USDCTokenPool *USDCTokenPoolCaller) IsSupportedChain(opts *bind.CallOpts, remoteChainSelector uint64) (bool, error) { + var out []interface{} + err := _USDCTokenPool.contract.Call(opts, &out, "isSupportedChain", remoteChainSelector) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_USDCTokenPool *USDCTokenPoolSession) IsSupportedChain(remoteChainSelector uint64) (bool, error) { + return _USDCTokenPool.Contract.IsSupportedChain(&_USDCTokenPool.CallOpts, remoteChainSelector) +} + +func (_USDCTokenPool *USDCTokenPoolCallerSession) IsSupportedChain(remoteChainSelector uint64) (bool, error) { + return _USDCTokenPool.Contract.IsSupportedChain(&_USDCTokenPool.CallOpts, remoteChainSelector) +} + +func (_USDCTokenPool *USDCTokenPoolCaller) Owner(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _USDCTokenPool.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 + +} + +func (_USDCTokenPool *USDCTokenPoolSession) Owner() (common.Address, error) { + return _USDCTokenPool.Contract.Owner(&_USDCTokenPool.CallOpts) +} + +func (_USDCTokenPool *USDCTokenPoolCallerSession) Owner() (common.Address, error) { + return _USDCTokenPool.Contract.Owner(&_USDCTokenPool.CallOpts) +} + +func (_USDCTokenPool *USDCTokenPoolCaller) SupportsInterface(opts *bind.CallOpts, interfaceId [4]byte) (bool, error) { + var out []interface{} + err := _USDCTokenPool.contract.Call(opts, &out, "supportsInterface", interfaceId) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_USDCTokenPool *USDCTokenPoolSession) SupportsInterface(interfaceId [4]byte) (bool, error) { + return _USDCTokenPool.Contract.SupportsInterface(&_USDCTokenPool.CallOpts, interfaceId) +} + +func (_USDCTokenPool *USDCTokenPoolCallerSession) SupportsInterface(interfaceId [4]byte) (bool, error) { + return _USDCTokenPool.Contract.SupportsInterface(&_USDCTokenPool.CallOpts, interfaceId) +} + +func (_USDCTokenPool *USDCTokenPoolCaller) TypeAndVersion(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _USDCTokenPool.contract.Call(opts, &out, "typeAndVersion") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +func (_USDCTokenPool *USDCTokenPoolSession) TypeAndVersion() (string, error) { + return _USDCTokenPool.Contract.TypeAndVersion(&_USDCTokenPool.CallOpts) +} + +func (_USDCTokenPool *USDCTokenPoolCallerSession) TypeAndVersion() (string, error) { + return _USDCTokenPool.Contract.TypeAndVersion(&_USDCTokenPool.CallOpts) +} + +func (_USDCTokenPool *USDCTokenPoolTransactor) AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + return _USDCTokenPool.contract.Transact(opts, "acceptOwnership") +} + +func (_USDCTokenPool *USDCTokenPoolSession) AcceptOwnership() (*types.Transaction, error) { + return _USDCTokenPool.Contract.AcceptOwnership(&_USDCTokenPool.TransactOpts) +} + +func (_USDCTokenPool *USDCTokenPoolTransactorSession) AcceptOwnership() (*types.Transaction, error) { + return _USDCTokenPool.Contract.AcceptOwnership(&_USDCTokenPool.TransactOpts) +} + +func (_USDCTokenPool *USDCTokenPoolTransactor) ApplyAllowListUpdates(opts *bind.TransactOpts, removes []common.Address, adds []common.Address) (*types.Transaction, error) { + return _USDCTokenPool.contract.Transact(opts, "applyAllowListUpdates", removes, adds) +} + +func (_USDCTokenPool *USDCTokenPoolSession) ApplyAllowListUpdates(removes []common.Address, adds []common.Address) (*types.Transaction, error) { + return _USDCTokenPool.Contract.ApplyAllowListUpdates(&_USDCTokenPool.TransactOpts, removes, adds) +} + +func (_USDCTokenPool *USDCTokenPoolTransactorSession) ApplyAllowListUpdates(removes []common.Address, adds []common.Address) (*types.Transaction, error) { + return _USDCTokenPool.Contract.ApplyAllowListUpdates(&_USDCTokenPool.TransactOpts, removes, adds) +} + +func (_USDCTokenPool *USDCTokenPoolTransactor) ApplyChainUpdates(opts *bind.TransactOpts, chains []TokenPoolChainUpdate) (*types.Transaction, error) { + return _USDCTokenPool.contract.Transact(opts, "applyChainUpdates", chains) +} + +func (_USDCTokenPool *USDCTokenPoolSession) ApplyChainUpdates(chains []TokenPoolChainUpdate) (*types.Transaction, error) { + return _USDCTokenPool.Contract.ApplyChainUpdates(&_USDCTokenPool.TransactOpts, chains) +} + +func (_USDCTokenPool *USDCTokenPoolTransactorSession) ApplyChainUpdates(chains []TokenPoolChainUpdate) (*types.Transaction, error) { + return _USDCTokenPool.Contract.ApplyChainUpdates(&_USDCTokenPool.TransactOpts, chains) +} + +func (_USDCTokenPool *USDCTokenPoolTransactor) LockOrBurn(opts *bind.TransactOpts, originalSender common.Address, destinationReceiver []byte, amount *big.Int, remoteChainSelector uint64, arg4 []byte) (*types.Transaction, error) { + return _USDCTokenPool.contract.Transact(opts, "lockOrBurn", originalSender, destinationReceiver, amount, remoteChainSelector, arg4) +} + +func (_USDCTokenPool *USDCTokenPoolSession) LockOrBurn(originalSender common.Address, destinationReceiver []byte, amount *big.Int, remoteChainSelector uint64, arg4 []byte) (*types.Transaction, error) { + return _USDCTokenPool.Contract.LockOrBurn(&_USDCTokenPool.TransactOpts, originalSender, destinationReceiver, amount, remoteChainSelector, arg4) +} + +func (_USDCTokenPool *USDCTokenPoolTransactorSession) LockOrBurn(originalSender common.Address, destinationReceiver []byte, amount *big.Int, remoteChainSelector uint64, arg4 []byte) (*types.Transaction, error) { + return _USDCTokenPool.Contract.LockOrBurn(&_USDCTokenPool.TransactOpts, originalSender, destinationReceiver, amount, remoteChainSelector, arg4) +} + +func (_USDCTokenPool *USDCTokenPoolTransactor) ReleaseOrMint(opts *bind.TransactOpts, arg0 []byte, receiver common.Address, amount *big.Int, remoteChainSelector uint64, extraData []byte) (*types.Transaction, error) { + return _USDCTokenPool.contract.Transact(opts, "releaseOrMint", arg0, receiver, amount, remoteChainSelector, extraData) +} + +func (_USDCTokenPool *USDCTokenPoolSession) ReleaseOrMint(arg0 []byte, receiver common.Address, amount *big.Int, remoteChainSelector uint64, extraData []byte) (*types.Transaction, error) { + return _USDCTokenPool.Contract.ReleaseOrMint(&_USDCTokenPool.TransactOpts, arg0, receiver, amount, remoteChainSelector, extraData) +} + +func (_USDCTokenPool *USDCTokenPoolTransactorSession) ReleaseOrMint(arg0 []byte, receiver common.Address, amount *big.Int, remoteChainSelector uint64, extraData []byte) (*types.Transaction, error) { + return _USDCTokenPool.Contract.ReleaseOrMint(&_USDCTokenPool.TransactOpts, arg0, receiver, amount, remoteChainSelector, extraData) +} + +func (_USDCTokenPool *USDCTokenPoolTransactor) SetChainRateLimiterConfig(opts *bind.TransactOpts, remoteChainSelector uint64, outboundConfig RateLimiterConfig, inboundConfig RateLimiterConfig) (*types.Transaction, error) { + return _USDCTokenPool.contract.Transact(opts, "setChainRateLimiterConfig", remoteChainSelector, outboundConfig, inboundConfig) +} + +func (_USDCTokenPool *USDCTokenPoolSession) SetChainRateLimiterConfig(remoteChainSelector uint64, outboundConfig RateLimiterConfig, inboundConfig RateLimiterConfig) (*types.Transaction, error) { + return _USDCTokenPool.Contract.SetChainRateLimiterConfig(&_USDCTokenPool.TransactOpts, remoteChainSelector, outboundConfig, inboundConfig) +} + +func (_USDCTokenPool *USDCTokenPoolTransactorSession) SetChainRateLimiterConfig(remoteChainSelector uint64, outboundConfig RateLimiterConfig, inboundConfig RateLimiterConfig) (*types.Transaction, error) { + return _USDCTokenPool.Contract.SetChainRateLimiterConfig(&_USDCTokenPool.TransactOpts, remoteChainSelector, outboundConfig, inboundConfig) +} + +func (_USDCTokenPool *USDCTokenPoolTransactor) SetDomains(opts *bind.TransactOpts, domains []USDCTokenPoolDomainUpdate) (*types.Transaction, error) { + return _USDCTokenPool.contract.Transact(opts, "setDomains", domains) +} + +func (_USDCTokenPool *USDCTokenPoolSession) SetDomains(domains []USDCTokenPoolDomainUpdate) (*types.Transaction, error) { + return _USDCTokenPool.Contract.SetDomains(&_USDCTokenPool.TransactOpts, domains) +} + +func (_USDCTokenPool *USDCTokenPoolTransactorSession) SetDomains(domains []USDCTokenPoolDomainUpdate) (*types.Transaction, error) { + return _USDCTokenPool.Contract.SetDomains(&_USDCTokenPool.TransactOpts, domains) +} + +func (_USDCTokenPool *USDCTokenPoolTransactor) SetRouter(opts *bind.TransactOpts, newRouter common.Address) (*types.Transaction, error) { + return _USDCTokenPool.contract.Transact(opts, "setRouter", newRouter) +} + +func (_USDCTokenPool *USDCTokenPoolSession) SetRouter(newRouter common.Address) (*types.Transaction, error) { + return _USDCTokenPool.Contract.SetRouter(&_USDCTokenPool.TransactOpts, newRouter) +} + +func (_USDCTokenPool *USDCTokenPoolTransactorSession) SetRouter(newRouter common.Address) (*types.Transaction, error) { + return _USDCTokenPool.Contract.SetRouter(&_USDCTokenPool.TransactOpts, newRouter) +} + +func (_USDCTokenPool *USDCTokenPoolTransactor) TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) { + return _USDCTokenPool.contract.Transact(opts, "transferOwnership", to) +} + +func (_USDCTokenPool *USDCTokenPoolSession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _USDCTokenPool.Contract.TransferOwnership(&_USDCTokenPool.TransactOpts, to) +} + +func (_USDCTokenPool *USDCTokenPoolTransactorSession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _USDCTokenPool.Contract.TransferOwnership(&_USDCTokenPool.TransactOpts, to) +} + +type USDCTokenPoolAllowListAddIterator struct { + Event *USDCTokenPoolAllowListAdd + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *USDCTokenPoolAllowListAddIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(USDCTokenPoolAllowListAdd) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(USDCTokenPoolAllowListAdd) + 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() + } +} + +func (it *USDCTokenPoolAllowListAddIterator) Error() error { + return it.fail +} + +func (it *USDCTokenPoolAllowListAddIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type USDCTokenPoolAllowListAdd struct { + Sender common.Address + Raw types.Log +} + +func (_USDCTokenPool *USDCTokenPoolFilterer) FilterAllowListAdd(opts *bind.FilterOpts) (*USDCTokenPoolAllowListAddIterator, error) { + + logs, sub, err := _USDCTokenPool.contract.FilterLogs(opts, "AllowListAdd") + if err != nil { + return nil, err + } + return &USDCTokenPoolAllowListAddIterator{contract: _USDCTokenPool.contract, event: "AllowListAdd", logs: logs, sub: sub}, nil +} + +func (_USDCTokenPool *USDCTokenPoolFilterer) WatchAllowListAdd(opts *bind.WatchOpts, sink chan<- *USDCTokenPoolAllowListAdd) (event.Subscription, error) { + + logs, sub, err := _USDCTokenPool.contract.WatchLogs(opts, "AllowListAdd") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(USDCTokenPoolAllowListAdd) + if err := _USDCTokenPool.contract.UnpackLog(event, "AllowListAdd", 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 +} + +func (_USDCTokenPool *USDCTokenPoolFilterer) ParseAllowListAdd(log types.Log) (*USDCTokenPoolAllowListAdd, error) { + event := new(USDCTokenPoolAllowListAdd) + if err := _USDCTokenPool.contract.UnpackLog(event, "AllowListAdd", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type USDCTokenPoolAllowListRemoveIterator struct { + Event *USDCTokenPoolAllowListRemove + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *USDCTokenPoolAllowListRemoveIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(USDCTokenPoolAllowListRemove) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(USDCTokenPoolAllowListRemove) + 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() + } +} + +func (it *USDCTokenPoolAllowListRemoveIterator) Error() error { + return it.fail +} + +func (it *USDCTokenPoolAllowListRemoveIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type USDCTokenPoolAllowListRemove struct { + Sender common.Address + Raw types.Log +} + +func (_USDCTokenPool *USDCTokenPoolFilterer) FilterAllowListRemove(opts *bind.FilterOpts) (*USDCTokenPoolAllowListRemoveIterator, error) { + + logs, sub, err := _USDCTokenPool.contract.FilterLogs(opts, "AllowListRemove") + if err != nil { + return nil, err + } + return &USDCTokenPoolAllowListRemoveIterator{contract: _USDCTokenPool.contract, event: "AllowListRemove", logs: logs, sub: sub}, nil +} + +func (_USDCTokenPool *USDCTokenPoolFilterer) WatchAllowListRemove(opts *bind.WatchOpts, sink chan<- *USDCTokenPoolAllowListRemove) (event.Subscription, error) { + + logs, sub, err := _USDCTokenPool.contract.WatchLogs(opts, "AllowListRemove") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(USDCTokenPoolAllowListRemove) + if err := _USDCTokenPool.contract.UnpackLog(event, "AllowListRemove", 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 +} + +func (_USDCTokenPool *USDCTokenPoolFilterer) ParseAllowListRemove(log types.Log) (*USDCTokenPoolAllowListRemove, error) { + event := new(USDCTokenPoolAllowListRemove) + if err := _USDCTokenPool.contract.UnpackLog(event, "AllowListRemove", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type USDCTokenPoolBurnedIterator struct { + Event *USDCTokenPoolBurned + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *USDCTokenPoolBurnedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(USDCTokenPoolBurned) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(USDCTokenPoolBurned) + 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() + } +} + +func (it *USDCTokenPoolBurnedIterator) Error() error { + return it.fail +} + +func (it *USDCTokenPoolBurnedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type USDCTokenPoolBurned struct { + Sender common.Address + Amount *big.Int + Raw types.Log +} + +func (_USDCTokenPool *USDCTokenPoolFilterer) FilterBurned(opts *bind.FilterOpts, sender []common.Address) (*USDCTokenPoolBurnedIterator, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _USDCTokenPool.contract.FilterLogs(opts, "Burned", senderRule) + if err != nil { + return nil, err + } + return &USDCTokenPoolBurnedIterator{contract: _USDCTokenPool.contract, event: "Burned", logs: logs, sub: sub}, nil +} + +func (_USDCTokenPool *USDCTokenPoolFilterer) WatchBurned(opts *bind.WatchOpts, sink chan<- *USDCTokenPoolBurned, sender []common.Address) (event.Subscription, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _USDCTokenPool.contract.WatchLogs(opts, "Burned", senderRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(USDCTokenPoolBurned) + if err := _USDCTokenPool.contract.UnpackLog(event, "Burned", 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 +} + +func (_USDCTokenPool *USDCTokenPoolFilterer) ParseBurned(log types.Log) (*USDCTokenPoolBurned, error) { + event := new(USDCTokenPoolBurned) + if err := _USDCTokenPool.contract.UnpackLog(event, "Burned", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type USDCTokenPoolChainAddedIterator struct { + Event *USDCTokenPoolChainAdded + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *USDCTokenPoolChainAddedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(USDCTokenPoolChainAdded) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(USDCTokenPoolChainAdded) + 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() + } +} + +func (it *USDCTokenPoolChainAddedIterator) Error() error { + return it.fail +} + +func (it *USDCTokenPoolChainAddedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type USDCTokenPoolChainAdded struct { + RemoteChainSelector uint64 + OutboundRateLimiterConfig RateLimiterConfig + InboundRateLimiterConfig RateLimiterConfig + Raw types.Log +} + +func (_USDCTokenPool *USDCTokenPoolFilterer) FilterChainAdded(opts *bind.FilterOpts) (*USDCTokenPoolChainAddedIterator, error) { + + logs, sub, err := _USDCTokenPool.contract.FilterLogs(opts, "ChainAdded") + if err != nil { + return nil, err + } + return &USDCTokenPoolChainAddedIterator{contract: _USDCTokenPool.contract, event: "ChainAdded", logs: logs, sub: sub}, nil +} + +func (_USDCTokenPool *USDCTokenPoolFilterer) WatchChainAdded(opts *bind.WatchOpts, sink chan<- *USDCTokenPoolChainAdded) (event.Subscription, error) { + + logs, sub, err := _USDCTokenPool.contract.WatchLogs(opts, "ChainAdded") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(USDCTokenPoolChainAdded) + if err := _USDCTokenPool.contract.UnpackLog(event, "ChainAdded", 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 +} + +func (_USDCTokenPool *USDCTokenPoolFilterer) ParseChainAdded(log types.Log) (*USDCTokenPoolChainAdded, error) { + event := new(USDCTokenPoolChainAdded) + if err := _USDCTokenPool.contract.UnpackLog(event, "ChainAdded", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type USDCTokenPoolChainConfiguredIterator struct { + Event *USDCTokenPoolChainConfigured + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *USDCTokenPoolChainConfiguredIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(USDCTokenPoolChainConfigured) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(USDCTokenPoolChainConfigured) + 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() + } +} + +func (it *USDCTokenPoolChainConfiguredIterator) Error() error { + return it.fail +} + +func (it *USDCTokenPoolChainConfiguredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type USDCTokenPoolChainConfigured struct { + RemoteChainSelector uint64 + OutboundRateLimiterConfig RateLimiterConfig + InboundRateLimiterConfig RateLimiterConfig + Raw types.Log +} + +func (_USDCTokenPool *USDCTokenPoolFilterer) FilterChainConfigured(opts *bind.FilterOpts) (*USDCTokenPoolChainConfiguredIterator, error) { + + logs, sub, err := _USDCTokenPool.contract.FilterLogs(opts, "ChainConfigured") + if err != nil { + return nil, err + } + return &USDCTokenPoolChainConfiguredIterator{contract: _USDCTokenPool.contract, event: "ChainConfigured", logs: logs, sub: sub}, nil +} + +func (_USDCTokenPool *USDCTokenPoolFilterer) WatchChainConfigured(opts *bind.WatchOpts, sink chan<- *USDCTokenPoolChainConfigured) (event.Subscription, error) { + + logs, sub, err := _USDCTokenPool.contract.WatchLogs(opts, "ChainConfigured") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(USDCTokenPoolChainConfigured) + if err := _USDCTokenPool.contract.UnpackLog(event, "ChainConfigured", 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 +} + +func (_USDCTokenPool *USDCTokenPoolFilterer) ParseChainConfigured(log types.Log) (*USDCTokenPoolChainConfigured, error) { + event := new(USDCTokenPoolChainConfigured) + if err := _USDCTokenPool.contract.UnpackLog(event, "ChainConfigured", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type USDCTokenPoolChainRemovedIterator struct { + Event *USDCTokenPoolChainRemoved + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *USDCTokenPoolChainRemovedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(USDCTokenPoolChainRemoved) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(USDCTokenPoolChainRemoved) + 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() + } +} + +func (it *USDCTokenPoolChainRemovedIterator) Error() error { + return it.fail +} + +func (it *USDCTokenPoolChainRemovedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type USDCTokenPoolChainRemoved struct { + RemoteChainSelector uint64 + Raw types.Log +} + +func (_USDCTokenPool *USDCTokenPoolFilterer) FilterChainRemoved(opts *bind.FilterOpts) (*USDCTokenPoolChainRemovedIterator, error) { + + logs, sub, err := _USDCTokenPool.contract.FilterLogs(opts, "ChainRemoved") + if err != nil { + return nil, err + } + return &USDCTokenPoolChainRemovedIterator{contract: _USDCTokenPool.contract, event: "ChainRemoved", logs: logs, sub: sub}, nil +} + +func (_USDCTokenPool *USDCTokenPoolFilterer) WatchChainRemoved(opts *bind.WatchOpts, sink chan<- *USDCTokenPoolChainRemoved) (event.Subscription, error) { + + logs, sub, err := _USDCTokenPool.contract.WatchLogs(opts, "ChainRemoved") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(USDCTokenPoolChainRemoved) + if err := _USDCTokenPool.contract.UnpackLog(event, "ChainRemoved", 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 +} + +func (_USDCTokenPool *USDCTokenPoolFilterer) ParseChainRemoved(log types.Log) (*USDCTokenPoolChainRemoved, error) { + event := new(USDCTokenPoolChainRemoved) + if err := _USDCTokenPool.contract.UnpackLog(event, "ChainRemoved", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type USDCTokenPoolConfigSetIterator struct { + Event *USDCTokenPoolConfigSet + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *USDCTokenPoolConfigSetIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(USDCTokenPoolConfigSet) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(USDCTokenPoolConfigSet) + 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() + } +} + +func (it *USDCTokenPoolConfigSetIterator) Error() error { + return it.fail +} + +func (it *USDCTokenPoolConfigSetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type USDCTokenPoolConfigSet struct { + TokenMessenger common.Address + Raw types.Log +} + +func (_USDCTokenPool *USDCTokenPoolFilterer) FilterConfigSet(opts *bind.FilterOpts) (*USDCTokenPoolConfigSetIterator, error) { + + logs, sub, err := _USDCTokenPool.contract.FilterLogs(opts, "ConfigSet") + if err != nil { + return nil, err + } + return &USDCTokenPoolConfigSetIterator{contract: _USDCTokenPool.contract, event: "ConfigSet", logs: logs, sub: sub}, nil +} + +func (_USDCTokenPool *USDCTokenPoolFilterer) WatchConfigSet(opts *bind.WatchOpts, sink chan<- *USDCTokenPoolConfigSet) (event.Subscription, error) { + + logs, sub, err := _USDCTokenPool.contract.WatchLogs(opts, "ConfigSet") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(USDCTokenPoolConfigSet) + if err := _USDCTokenPool.contract.UnpackLog(event, "ConfigSet", 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 +} + +func (_USDCTokenPool *USDCTokenPoolFilterer) ParseConfigSet(log types.Log) (*USDCTokenPoolConfigSet, error) { + event := new(USDCTokenPoolConfigSet) + if err := _USDCTokenPool.contract.UnpackLog(event, "ConfigSet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type USDCTokenPoolDomainsSetIterator struct { + Event *USDCTokenPoolDomainsSet + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *USDCTokenPoolDomainsSetIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(USDCTokenPoolDomainsSet) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(USDCTokenPoolDomainsSet) + 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() + } +} + +func (it *USDCTokenPoolDomainsSetIterator) Error() error { + return it.fail +} + +func (it *USDCTokenPoolDomainsSetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type USDCTokenPoolDomainsSet struct { + Arg0 []USDCTokenPoolDomainUpdate + Raw types.Log +} + +func (_USDCTokenPool *USDCTokenPoolFilterer) FilterDomainsSet(opts *bind.FilterOpts) (*USDCTokenPoolDomainsSetIterator, error) { + + logs, sub, err := _USDCTokenPool.contract.FilterLogs(opts, "DomainsSet") + if err != nil { + return nil, err + } + return &USDCTokenPoolDomainsSetIterator{contract: _USDCTokenPool.contract, event: "DomainsSet", logs: logs, sub: sub}, nil +} + +func (_USDCTokenPool *USDCTokenPoolFilterer) WatchDomainsSet(opts *bind.WatchOpts, sink chan<- *USDCTokenPoolDomainsSet) (event.Subscription, error) { + + logs, sub, err := _USDCTokenPool.contract.WatchLogs(opts, "DomainsSet") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(USDCTokenPoolDomainsSet) + if err := _USDCTokenPool.contract.UnpackLog(event, "DomainsSet", 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 +} + +func (_USDCTokenPool *USDCTokenPoolFilterer) ParseDomainsSet(log types.Log) (*USDCTokenPoolDomainsSet, error) { + event := new(USDCTokenPoolDomainsSet) + if err := _USDCTokenPool.contract.UnpackLog(event, "DomainsSet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type USDCTokenPoolLockedIterator struct { + Event *USDCTokenPoolLocked + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *USDCTokenPoolLockedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(USDCTokenPoolLocked) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(USDCTokenPoolLocked) + 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() + } +} + +func (it *USDCTokenPoolLockedIterator) Error() error { + return it.fail +} + +func (it *USDCTokenPoolLockedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type USDCTokenPoolLocked struct { + Sender common.Address + Amount *big.Int + Raw types.Log +} + +func (_USDCTokenPool *USDCTokenPoolFilterer) FilterLocked(opts *bind.FilterOpts, sender []common.Address) (*USDCTokenPoolLockedIterator, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _USDCTokenPool.contract.FilterLogs(opts, "Locked", senderRule) + if err != nil { + return nil, err + } + return &USDCTokenPoolLockedIterator{contract: _USDCTokenPool.contract, event: "Locked", logs: logs, sub: sub}, nil +} + +func (_USDCTokenPool *USDCTokenPoolFilterer) WatchLocked(opts *bind.WatchOpts, sink chan<- *USDCTokenPoolLocked, sender []common.Address) (event.Subscription, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _USDCTokenPool.contract.WatchLogs(opts, "Locked", senderRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(USDCTokenPoolLocked) + if err := _USDCTokenPool.contract.UnpackLog(event, "Locked", 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 +} + +func (_USDCTokenPool *USDCTokenPoolFilterer) ParseLocked(log types.Log) (*USDCTokenPoolLocked, error) { + event := new(USDCTokenPoolLocked) + if err := _USDCTokenPool.contract.UnpackLog(event, "Locked", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type USDCTokenPoolMintedIterator struct { + Event *USDCTokenPoolMinted + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *USDCTokenPoolMintedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(USDCTokenPoolMinted) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(USDCTokenPoolMinted) + 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() + } +} + +func (it *USDCTokenPoolMintedIterator) Error() error { + return it.fail +} + +func (it *USDCTokenPoolMintedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type USDCTokenPoolMinted struct { + Sender common.Address + Recipient common.Address + Amount *big.Int + Raw types.Log +} + +func (_USDCTokenPool *USDCTokenPoolFilterer) FilterMinted(opts *bind.FilterOpts, sender []common.Address, recipient []common.Address) (*USDCTokenPoolMintedIterator, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + var recipientRule []interface{} + for _, recipientItem := range recipient { + recipientRule = append(recipientRule, recipientItem) + } + + logs, sub, err := _USDCTokenPool.contract.FilterLogs(opts, "Minted", senderRule, recipientRule) + if err != nil { + return nil, err + } + return &USDCTokenPoolMintedIterator{contract: _USDCTokenPool.contract, event: "Minted", logs: logs, sub: sub}, nil +} + +func (_USDCTokenPool *USDCTokenPoolFilterer) WatchMinted(opts *bind.WatchOpts, sink chan<- *USDCTokenPoolMinted, sender []common.Address, recipient []common.Address) (event.Subscription, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + var recipientRule []interface{} + for _, recipientItem := range recipient { + recipientRule = append(recipientRule, recipientItem) + } + + logs, sub, err := _USDCTokenPool.contract.WatchLogs(opts, "Minted", senderRule, recipientRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(USDCTokenPoolMinted) + if err := _USDCTokenPool.contract.UnpackLog(event, "Minted", 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 +} + +func (_USDCTokenPool *USDCTokenPoolFilterer) ParseMinted(log types.Log) (*USDCTokenPoolMinted, error) { + event := new(USDCTokenPoolMinted) + if err := _USDCTokenPool.contract.UnpackLog(event, "Minted", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type USDCTokenPoolOwnershipTransferRequestedIterator struct { + Event *USDCTokenPoolOwnershipTransferRequested + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *USDCTokenPoolOwnershipTransferRequestedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(USDCTokenPoolOwnershipTransferRequested) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(USDCTokenPoolOwnershipTransferRequested) + 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() + } +} + +func (it *USDCTokenPoolOwnershipTransferRequestedIterator) Error() error { + return it.fail +} + +func (it *USDCTokenPoolOwnershipTransferRequestedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type USDCTokenPoolOwnershipTransferRequested struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_USDCTokenPool *USDCTokenPoolFilterer) FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*USDCTokenPoolOwnershipTransferRequestedIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _USDCTokenPool.contract.FilterLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return &USDCTokenPoolOwnershipTransferRequestedIterator{contract: _USDCTokenPool.contract, event: "OwnershipTransferRequested", logs: logs, sub: sub}, nil +} + +func (_USDCTokenPool *USDCTokenPoolFilterer) WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *USDCTokenPoolOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _USDCTokenPool.contract.WatchLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(USDCTokenPoolOwnershipTransferRequested) + if err := _USDCTokenPool.contract.UnpackLog(event, "OwnershipTransferRequested", 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 +} + +func (_USDCTokenPool *USDCTokenPoolFilterer) ParseOwnershipTransferRequested(log types.Log) (*USDCTokenPoolOwnershipTransferRequested, error) { + event := new(USDCTokenPoolOwnershipTransferRequested) + if err := _USDCTokenPool.contract.UnpackLog(event, "OwnershipTransferRequested", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type USDCTokenPoolOwnershipTransferredIterator struct { + Event *USDCTokenPoolOwnershipTransferred + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *USDCTokenPoolOwnershipTransferredIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(USDCTokenPoolOwnershipTransferred) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(USDCTokenPoolOwnershipTransferred) + 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() + } +} + +func (it *USDCTokenPoolOwnershipTransferredIterator) Error() error { + return it.fail +} + +func (it *USDCTokenPoolOwnershipTransferredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type USDCTokenPoolOwnershipTransferred struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_USDCTokenPool *USDCTokenPoolFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*USDCTokenPoolOwnershipTransferredIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _USDCTokenPool.contract.FilterLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return &USDCTokenPoolOwnershipTransferredIterator{contract: _USDCTokenPool.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil +} + +func (_USDCTokenPool *USDCTokenPoolFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *USDCTokenPoolOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _USDCTokenPool.contract.WatchLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(USDCTokenPoolOwnershipTransferred) + if err := _USDCTokenPool.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 +} + +func (_USDCTokenPool *USDCTokenPoolFilterer) ParseOwnershipTransferred(log types.Log) (*USDCTokenPoolOwnershipTransferred, error) { + event := new(USDCTokenPoolOwnershipTransferred) + if err := _USDCTokenPool.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type USDCTokenPoolReleasedIterator struct { + Event *USDCTokenPoolReleased + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *USDCTokenPoolReleasedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(USDCTokenPoolReleased) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(USDCTokenPoolReleased) + 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() + } +} + +func (it *USDCTokenPoolReleasedIterator) Error() error { + return it.fail +} + +func (it *USDCTokenPoolReleasedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type USDCTokenPoolReleased struct { + Sender common.Address + Recipient common.Address + Amount *big.Int + Raw types.Log +} + +func (_USDCTokenPool *USDCTokenPoolFilterer) FilterReleased(opts *bind.FilterOpts, sender []common.Address, recipient []common.Address) (*USDCTokenPoolReleasedIterator, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + var recipientRule []interface{} + for _, recipientItem := range recipient { + recipientRule = append(recipientRule, recipientItem) + } + + logs, sub, err := _USDCTokenPool.contract.FilterLogs(opts, "Released", senderRule, recipientRule) + if err != nil { + return nil, err + } + return &USDCTokenPoolReleasedIterator{contract: _USDCTokenPool.contract, event: "Released", logs: logs, sub: sub}, nil +} + +func (_USDCTokenPool *USDCTokenPoolFilterer) WatchReleased(opts *bind.WatchOpts, sink chan<- *USDCTokenPoolReleased, sender []common.Address, recipient []common.Address) (event.Subscription, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + var recipientRule []interface{} + for _, recipientItem := range recipient { + recipientRule = append(recipientRule, recipientItem) + } + + logs, sub, err := _USDCTokenPool.contract.WatchLogs(opts, "Released", senderRule, recipientRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(USDCTokenPoolReleased) + if err := _USDCTokenPool.contract.UnpackLog(event, "Released", 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 +} + +func (_USDCTokenPool *USDCTokenPoolFilterer) ParseReleased(log types.Log) (*USDCTokenPoolReleased, error) { + event := new(USDCTokenPoolReleased) + if err := _USDCTokenPool.contract.UnpackLog(event, "Released", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type USDCTokenPoolRouterUpdatedIterator struct { + Event *USDCTokenPoolRouterUpdated + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *USDCTokenPoolRouterUpdatedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(USDCTokenPoolRouterUpdated) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(USDCTokenPoolRouterUpdated) + 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() + } +} + +func (it *USDCTokenPoolRouterUpdatedIterator) Error() error { + return it.fail +} + +func (it *USDCTokenPoolRouterUpdatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type USDCTokenPoolRouterUpdated struct { + OldRouter common.Address + NewRouter common.Address + Raw types.Log +} + +func (_USDCTokenPool *USDCTokenPoolFilterer) FilterRouterUpdated(opts *bind.FilterOpts) (*USDCTokenPoolRouterUpdatedIterator, error) { + + logs, sub, err := _USDCTokenPool.contract.FilterLogs(opts, "RouterUpdated") + if err != nil { + return nil, err + } + return &USDCTokenPoolRouterUpdatedIterator{contract: _USDCTokenPool.contract, event: "RouterUpdated", logs: logs, sub: sub}, nil +} + +func (_USDCTokenPool *USDCTokenPoolFilterer) WatchRouterUpdated(opts *bind.WatchOpts, sink chan<- *USDCTokenPoolRouterUpdated) (event.Subscription, error) { + + logs, sub, err := _USDCTokenPool.contract.WatchLogs(opts, "RouterUpdated") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(USDCTokenPoolRouterUpdated) + if err := _USDCTokenPool.contract.UnpackLog(event, "RouterUpdated", 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 +} + +func (_USDCTokenPool *USDCTokenPoolFilterer) ParseRouterUpdated(log types.Log) (*USDCTokenPoolRouterUpdated, error) { + event := new(USDCTokenPoolRouterUpdated) + if err := _USDCTokenPool.contract.UnpackLog(event, "RouterUpdated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +func (_USDCTokenPool *USDCTokenPool) ParseLog(log types.Log) (generated.AbigenLog, error) { + switch log.Topics[0] { + case _USDCTokenPool.abi.Events["AllowListAdd"].ID: + return _USDCTokenPool.ParseAllowListAdd(log) + case _USDCTokenPool.abi.Events["AllowListRemove"].ID: + return _USDCTokenPool.ParseAllowListRemove(log) + case _USDCTokenPool.abi.Events["Burned"].ID: + return _USDCTokenPool.ParseBurned(log) + case _USDCTokenPool.abi.Events["ChainAdded"].ID: + return _USDCTokenPool.ParseChainAdded(log) + case _USDCTokenPool.abi.Events["ChainConfigured"].ID: + return _USDCTokenPool.ParseChainConfigured(log) + case _USDCTokenPool.abi.Events["ChainRemoved"].ID: + return _USDCTokenPool.ParseChainRemoved(log) + case _USDCTokenPool.abi.Events["ConfigSet"].ID: + return _USDCTokenPool.ParseConfigSet(log) + case _USDCTokenPool.abi.Events["DomainsSet"].ID: + return _USDCTokenPool.ParseDomainsSet(log) + case _USDCTokenPool.abi.Events["Locked"].ID: + return _USDCTokenPool.ParseLocked(log) + case _USDCTokenPool.abi.Events["Minted"].ID: + return _USDCTokenPool.ParseMinted(log) + case _USDCTokenPool.abi.Events["OwnershipTransferRequested"].ID: + return _USDCTokenPool.ParseOwnershipTransferRequested(log) + case _USDCTokenPool.abi.Events["OwnershipTransferred"].ID: + return _USDCTokenPool.ParseOwnershipTransferred(log) + case _USDCTokenPool.abi.Events["Released"].ID: + return _USDCTokenPool.ParseReleased(log) + case _USDCTokenPool.abi.Events["RouterUpdated"].ID: + return _USDCTokenPool.ParseRouterUpdated(log) + + default: + return nil, fmt.Errorf("abigen wrapper received unknown log topic: %v", log.Topics[0]) + } +} + +func (USDCTokenPoolAllowListAdd) Topic() common.Hash { + return common.HexToHash("0x2640d4d76caf8bf478aabfa982fa4e1c4eb71a37f93cd15e80dbc657911546d8") +} + +func (USDCTokenPoolAllowListRemove) Topic() common.Hash { + return common.HexToHash("0x800671136ab6cfee9fbe5ed1fb7ca417811aca3cf864800d127b927adedf7566") +} + +func (USDCTokenPoolBurned) Topic() common.Hash { + return common.HexToHash("0x696de425f79f4a40bc6d2122ca50507f0efbeabbff86a84871b7196ab8ea8df7") +} + +func (USDCTokenPoolChainAdded) Topic() common.Hash { + return common.HexToHash("0x0f135cbb9afa12a8bf3bbd071c117bcca4ddeca6160ef7f33d012a81b9c0c471") +} + +func (USDCTokenPoolChainConfigured) Topic() common.Hash { + return common.HexToHash("0x0350d63aa5f270e01729d00d627eeb8f3429772b1818c016c66a588a864f912b") +} + +func (USDCTokenPoolChainRemoved) Topic() common.Hash { + return common.HexToHash("0x5204aec90a3c794d8e90fded8b46ae9c7c552803e7e832e0c1d358396d859916") +} + +func (USDCTokenPoolConfigSet) Topic() common.Hash { + return common.HexToHash("0x2e902d38f15b233cbb63711add0fca4545334d3a169d60c0a616494d7eea9544") +} + +func (USDCTokenPoolDomainsSet) Topic() common.Hash { + return common.HexToHash("0x1889010d2535a0ab1643678d1da87fbbe8b87b2f585b47ddb72ec622aef9ee56") +} + +func (USDCTokenPoolLocked) Topic() common.Hash { + return common.HexToHash("0x9f1ec8c880f76798e7b793325d625e9b60e4082a553c98f42b6cda368dd60008") +} + +func (USDCTokenPoolMinted) Topic() common.Hash { + return common.HexToHash("0x9d228d69b5fdb8d273a2336f8fb8612d039631024ea9bf09c424a9503aa078f0") +} + +func (USDCTokenPoolOwnershipTransferRequested) Topic() common.Hash { + return common.HexToHash("0xed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae1278") +} + +func (USDCTokenPoolOwnershipTransferred) Topic() common.Hash { + return common.HexToHash("0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0") +} + +func (USDCTokenPoolReleased) Topic() common.Hash { + return common.HexToHash("0x2d87480f50083e2b2759522a8fdda59802650a8055e609a7772cf70c07748f52") +} + +func (USDCTokenPoolRouterUpdated) Topic() common.Hash { + return common.HexToHash("0x02dc5c233404867c793b749c6d644beb2277536d18a7e7974d3f238e4c6f1684") +} + +func (_USDCTokenPool *USDCTokenPool) Address() common.Address { + return _USDCTokenPool.address +} + +type USDCTokenPoolInterface interface { + SUPPORTEDUSDCVERSION(opts *bind.CallOpts) (uint32, error) + + GetAllowList(opts *bind.CallOpts) ([]common.Address, error) + + GetAllowListEnabled(opts *bind.CallOpts) (bool, error) + + GetArmProxy(opts *bind.CallOpts) (common.Address, error) + + GetCurrentInboundRateLimiterState(opts *bind.CallOpts, remoteChainSelector uint64) (RateLimiterTokenBucket, error) + + GetCurrentOutboundRateLimiterState(opts *bind.CallOpts, remoteChainSelector uint64) (RateLimiterTokenBucket, error) + + GetDomain(opts *bind.CallOpts, chainSelector uint64) (USDCTokenPoolDomain, error) + + GetRouter(opts *bind.CallOpts) (common.Address, error) + + GetSupportedChains(opts *bind.CallOpts) ([]uint64, error) + + GetToken(opts *bind.CallOpts) (common.Address, error) + + GetUSDCInterfaceId(opts *bind.CallOpts) ([4]byte, error) + + ILocalDomainIdentifier(opts *bind.CallOpts) (uint32, error) + + IMessageTransmitter(opts *bind.CallOpts) (common.Address, error) + + ITokenMessenger(opts *bind.CallOpts) (common.Address, error) + + IsSupportedChain(opts *bind.CallOpts, remoteChainSelector uint64) (bool, error) + + Owner(opts *bind.CallOpts) (common.Address, error) + + SupportsInterface(opts *bind.CallOpts, interfaceId [4]byte) (bool, error) + + TypeAndVersion(opts *bind.CallOpts) (string, error) + + AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) + + ApplyAllowListUpdates(opts *bind.TransactOpts, removes []common.Address, adds []common.Address) (*types.Transaction, error) + + ApplyChainUpdates(opts *bind.TransactOpts, chains []TokenPoolChainUpdate) (*types.Transaction, error) + + LockOrBurn(opts *bind.TransactOpts, originalSender common.Address, destinationReceiver []byte, amount *big.Int, remoteChainSelector uint64, arg4 []byte) (*types.Transaction, error) + + ReleaseOrMint(opts *bind.TransactOpts, arg0 []byte, receiver common.Address, amount *big.Int, remoteChainSelector uint64, extraData []byte) (*types.Transaction, error) + + SetChainRateLimiterConfig(opts *bind.TransactOpts, remoteChainSelector uint64, outboundConfig RateLimiterConfig, inboundConfig RateLimiterConfig) (*types.Transaction, error) + + SetDomains(opts *bind.TransactOpts, domains []USDCTokenPoolDomainUpdate) (*types.Transaction, error) + + SetRouter(opts *bind.TransactOpts, newRouter common.Address) (*types.Transaction, error) + + TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) + + FilterAllowListAdd(opts *bind.FilterOpts) (*USDCTokenPoolAllowListAddIterator, error) + + WatchAllowListAdd(opts *bind.WatchOpts, sink chan<- *USDCTokenPoolAllowListAdd) (event.Subscription, error) + + ParseAllowListAdd(log types.Log) (*USDCTokenPoolAllowListAdd, error) + + FilterAllowListRemove(opts *bind.FilterOpts) (*USDCTokenPoolAllowListRemoveIterator, error) + + WatchAllowListRemove(opts *bind.WatchOpts, sink chan<- *USDCTokenPoolAllowListRemove) (event.Subscription, error) + + ParseAllowListRemove(log types.Log) (*USDCTokenPoolAllowListRemove, error) + + FilterBurned(opts *bind.FilterOpts, sender []common.Address) (*USDCTokenPoolBurnedIterator, error) + + WatchBurned(opts *bind.WatchOpts, sink chan<- *USDCTokenPoolBurned, sender []common.Address) (event.Subscription, error) + + ParseBurned(log types.Log) (*USDCTokenPoolBurned, error) + + FilterChainAdded(opts *bind.FilterOpts) (*USDCTokenPoolChainAddedIterator, error) + + WatchChainAdded(opts *bind.WatchOpts, sink chan<- *USDCTokenPoolChainAdded) (event.Subscription, error) + + ParseChainAdded(log types.Log) (*USDCTokenPoolChainAdded, error) + + FilterChainConfigured(opts *bind.FilterOpts) (*USDCTokenPoolChainConfiguredIterator, error) + + WatchChainConfigured(opts *bind.WatchOpts, sink chan<- *USDCTokenPoolChainConfigured) (event.Subscription, error) + + ParseChainConfigured(log types.Log) (*USDCTokenPoolChainConfigured, error) + + FilterChainRemoved(opts *bind.FilterOpts) (*USDCTokenPoolChainRemovedIterator, error) + + WatchChainRemoved(opts *bind.WatchOpts, sink chan<- *USDCTokenPoolChainRemoved) (event.Subscription, error) + + ParseChainRemoved(log types.Log) (*USDCTokenPoolChainRemoved, error) + + FilterConfigSet(opts *bind.FilterOpts) (*USDCTokenPoolConfigSetIterator, error) + + WatchConfigSet(opts *bind.WatchOpts, sink chan<- *USDCTokenPoolConfigSet) (event.Subscription, error) + + ParseConfigSet(log types.Log) (*USDCTokenPoolConfigSet, error) + + FilterDomainsSet(opts *bind.FilterOpts) (*USDCTokenPoolDomainsSetIterator, error) + + WatchDomainsSet(opts *bind.WatchOpts, sink chan<- *USDCTokenPoolDomainsSet) (event.Subscription, error) + + ParseDomainsSet(log types.Log) (*USDCTokenPoolDomainsSet, error) + + FilterLocked(opts *bind.FilterOpts, sender []common.Address) (*USDCTokenPoolLockedIterator, error) + + WatchLocked(opts *bind.WatchOpts, sink chan<- *USDCTokenPoolLocked, sender []common.Address) (event.Subscription, error) + + ParseLocked(log types.Log) (*USDCTokenPoolLocked, error) + + FilterMinted(opts *bind.FilterOpts, sender []common.Address, recipient []common.Address) (*USDCTokenPoolMintedIterator, error) + + WatchMinted(opts *bind.WatchOpts, sink chan<- *USDCTokenPoolMinted, sender []common.Address, recipient []common.Address) (event.Subscription, error) + + ParseMinted(log types.Log) (*USDCTokenPoolMinted, error) + + FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*USDCTokenPoolOwnershipTransferRequestedIterator, error) + + WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *USDCTokenPoolOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferRequested(log types.Log) (*USDCTokenPoolOwnershipTransferRequested, error) + + FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*USDCTokenPoolOwnershipTransferredIterator, error) + + WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *USDCTokenPoolOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferred(log types.Log) (*USDCTokenPoolOwnershipTransferred, error) + + FilterReleased(opts *bind.FilterOpts, sender []common.Address, recipient []common.Address) (*USDCTokenPoolReleasedIterator, error) + + WatchReleased(opts *bind.WatchOpts, sink chan<- *USDCTokenPoolReleased, sender []common.Address, recipient []common.Address) (event.Subscription, error) + + ParseReleased(log types.Log) (*USDCTokenPoolReleased, error) + + FilterRouterUpdated(opts *bind.FilterOpts) (*USDCTokenPoolRouterUpdatedIterator, error) + + WatchRouterUpdated(opts *bind.WatchOpts, sink chan<- *USDCTokenPoolRouterUpdated) (event.Subscription, error) + + ParseRouterUpdated(log types.Log) (*USDCTokenPoolRouterUpdated, error) + + ParseLog(log types.Log) (generated.AbigenLog, error) + + Address() common.Address +} diff --git a/core/gethwrappers/ccip/generated/weth9/weth9.go b/core/gethwrappers/ccip/generated/weth9/weth9.go new file mode 100644 index 00000000000..50d0aa23f73 --- /dev/null +++ b/core/gethwrappers/ccip/generated/weth9/weth9.go @@ -0,0 +1,996 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package weth9 + +import ( + "errors" + "fmt" + "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" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" +) + +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +var WETH9MetaData = &bind.MetaData{ + ABI: "[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"src\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"guy\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"wad\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"dst\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"wad\",\"type\":\"uint256\"}],\"name\":\"Deposit\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"src\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"dst\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"wad\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"src\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"wad\",\"type\":\"uint256\"}],\"name\":\"Withdrawal\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"guy\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"wad\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"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\":\"deposit\",\"outputs\":[],\"stateMutability\":\"payable\",\"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\":\"dst\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"wad\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"src\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"dst\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"wad\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"wad\",\"type\":\"uint256\"}],\"name\":\"withdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]", + Bin: "0x60c0604052600d60809081526c2bb930b83832b21022ba3432b960991b60a05260009061002c9082610116565b506040805180820190915260048152630ae8aa8960e31b60208201526001906100559082610116565b506002805460ff1916601217905534801561006f57600080fd5b506101d5565b634e487b7160e01b600052604160045260246000fd5b600181811c9082168061009f57607f821691505b6020821081036100bf57634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115610111576000816000526020600020601f850160051c810160208610156100ee5750805b601f850160051c820191505b8181101561010d578281556001016100fa565b5050505b505050565b81516001600160401b0381111561012f5761012f610075565b6101438161013d845461008b565b846100c5565b602080601f83116001811461017857600084156101605750858301515b600019600386901b1c1916600185901b17855561010d565b600085815260208120601f198616915b828110156101a757888601518255948401946001909101908401610188565b50858210156101c55787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6108ad806101e46000396000f3fe6080604052600436106100c05760003560e01c8063313ce56711610074578063a9059cbb1161004e578063a9059cbb146101fa578063d0e30db01461021a578063dd62ed3e1461022257600080fd5b8063313ce5671461018c57806370a08231146101b857806395d89b41146101e557600080fd5b806318160ddd116100a557806318160ddd1461012f57806323b872dd1461014c5780632e1a7d4d1461016c57600080fd5b806306fdde03146100d4578063095ea7b3146100ff57600080fd5b366100cf576100cd61025a565b005b600080fd5b3480156100e057600080fd5b506100e96102b5565b6040516100f69190610695565b60405180910390f35b34801561010b57600080fd5b5061011f61011a36600461072b565b610343565b60405190151581526020016100f6565b34801561013b57600080fd5b50475b6040519081526020016100f6565b34801561015857600080fd5b5061011f610167366004610755565b6103bd565b34801561017857600080fd5b506100cd610187366004610791565b6105c4565b34801561019857600080fd5b506002546101a69060ff1681565b60405160ff90911681526020016100f6565b3480156101c457600080fd5b5061013e6101d33660046107aa565b60036020526000908152604090205481565b3480156101f157600080fd5b506100e961066a565b34801561020657600080fd5b5061011f61021536600461072b565b610677565b6100cd61068b565b34801561022e57600080fd5b5061013e61023d3660046107c5565b600460209081526000928352604080842090915290825290205481565b3360009081526003602052604081208054349290610279908490610827565b909155505060405134815233907fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9060200160405180910390a2565b600080546102c29061083a565b80601f01602080910402602001604051908101604052809291908181526020018280546102ee9061083a565b801561033b5780601f106103105761010080835404028352916020019161033b565b820191906000526020600020905b81548152906001019060200180831161031e57829003601f168201915b505050505081565b33600081815260046020908152604080832073ffffffffffffffffffffffffffffffffffffffff8716808552925280832085905551919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906103ab9086815260200190565b60405180910390a35060015b92915050565b73ffffffffffffffffffffffffffffffffffffffff83166000908152600360205260408120548211156103ef57600080fd5b73ffffffffffffffffffffffffffffffffffffffff84163314801590610455575073ffffffffffffffffffffffffffffffffffffffff841660009081526004602090815260408083203384529091529020546fffffffffffffffffffffffffffffffff14155b156104dd5773ffffffffffffffffffffffffffffffffffffffff8416600090815260046020908152604080832033845290915290205482111561049757600080fd5b73ffffffffffffffffffffffffffffffffffffffff84166000908152600460209081526040808320338452909152812080548492906104d790849061088d565b90915550505b73ffffffffffffffffffffffffffffffffffffffff84166000908152600360205260408120805484929061051290849061088d565b909155505073ffffffffffffffffffffffffffffffffffffffff83166000908152600360205260408120805484929061054c908490610827565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516105b291815260200190565b60405180910390a35060019392505050565b336000908152600360205260409020548111156105e057600080fd5b33600090815260036020526040812080548392906105ff90849061088d565b9091555050604051339082156108fc029083906000818181858888f19350505050158015610631573d6000803e3d6000fd5b5060405181815233907f7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b659060200160405180910390a250565b600180546102c29061083a565b60006106843384846103bd565b9392505050565b61069361025a565b565b60006020808352835180602085015260005b818110156106c3578581018301518582016040015282016106a7565b5060006040828601015260407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8301168501019250505092915050565b803573ffffffffffffffffffffffffffffffffffffffff8116811461072657600080fd5b919050565b6000806040838503121561073e57600080fd5b61074783610702565b946020939093013593505050565b60008060006060848603121561076a57600080fd5b61077384610702565b925061078160208501610702565b9150604084013590509250925092565b6000602082840312156107a357600080fd5b5035919050565b6000602082840312156107bc57600080fd5b61068482610702565b600080604083850312156107d857600080fd5b6107e183610702565b91506107ef60208401610702565b90509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b808201808211156103b7576103b76107f8565b600181811c9082168061084e57607f821691505b602082108103610887577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b818103818111156103b7576103b76107f856fea164736f6c6343000818000a", +} + +var WETH9ABI = WETH9MetaData.ABI + +var WETH9Bin = WETH9MetaData.Bin + +func DeployWETH9(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *WETH9, error) { + parsed, err := WETH9MetaData.GetAbi() + if err != nil { + return common.Address{}, nil, nil, err + } + if parsed == nil { + return common.Address{}, nil, nil, errors.New("GetABI returned nil") + } + + address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(WETH9Bin), backend) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &WETH9{address: address, abi: *parsed, WETH9Caller: WETH9Caller{contract: contract}, WETH9Transactor: WETH9Transactor{contract: contract}, WETH9Filterer: WETH9Filterer{contract: contract}}, nil +} + +type WETH9 struct { + address common.Address + abi abi.ABI + WETH9Caller + WETH9Transactor + WETH9Filterer +} + +type WETH9Caller struct { + contract *bind.BoundContract +} + +type WETH9Transactor struct { + contract *bind.BoundContract +} + +type WETH9Filterer struct { + contract *bind.BoundContract +} + +type WETH9Session struct { + Contract *WETH9 + CallOpts bind.CallOpts + TransactOpts bind.TransactOpts +} + +type WETH9CallerSession struct { + Contract *WETH9Caller + CallOpts bind.CallOpts +} + +type WETH9TransactorSession struct { + Contract *WETH9Transactor + TransactOpts bind.TransactOpts +} + +type WETH9Raw struct { + Contract *WETH9 +} + +type WETH9CallerRaw struct { + Contract *WETH9Caller +} + +type WETH9TransactorRaw struct { + Contract *WETH9Transactor +} + +func NewWETH9(address common.Address, backend bind.ContractBackend) (*WETH9, error) { + abi, err := abi.JSON(strings.NewReader(WETH9ABI)) + if err != nil { + return nil, err + } + contract, err := bindWETH9(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &WETH9{address: address, abi: abi, WETH9Caller: WETH9Caller{contract: contract}, WETH9Transactor: WETH9Transactor{contract: contract}, WETH9Filterer: WETH9Filterer{contract: contract}}, nil +} + +func NewWETH9Caller(address common.Address, caller bind.ContractCaller) (*WETH9Caller, error) { + contract, err := bindWETH9(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &WETH9Caller{contract: contract}, nil +} + +func NewWETH9Transactor(address common.Address, transactor bind.ContractTransactor) (*WETH9Transactor, error) { + contract, err := bindWETH9(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &WETH9Transactor{contract: contract}, nil +} + +func NewWETH9Filterer(address common.Address, filterer bind.ContractFilterer) (*WETH9Filterer, error) { + contract, err := bindWETH9(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &WETH9Filterer{contract: contract}, nil +} + +func bindWETH9(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := WETH9MetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +func (_WETH9 *WETH9Raw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _WETH9.Contract.WETH9Caller.contract.Call(opts, result, method, params...) +} + +func (_WETH9 *WETH9Raw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _WETH9.Contract.WETH9Transactor.contract.Transfer(opts) +} + +func (_WETH9 *WETH9Raw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _WETH9.Contract.WETH9Transactor.contract.Transact(opts, method, params...) +} + +func (_WETH9 *WETH9CallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _WETH9.Contract.contract.Call(opts, result, method, params...) +} + +func (_WETH9 *WETH9TransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _WETH9.Contract.contract.Transfer(opts) +} + +func (_WETH9 *WETH9TransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _WETH9.Contract.contract.Transact(opts, method, params...) +} + +func (_WETH9 *WETH9Caller) Allowance(opts *bind.CallOpts, arg0 common.Address, arg1 common.Address) (*big.Int, error) { + var out []interface{} + err := _WETH9.contract.Call(opts, &out, "allowance", arg0, arg1) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_WETH9 *WETH9Session) Allowance(arg0 common.Address, arg1 common.Address) (*big.Int, error) { + return _WETH9.Contract.Allowance(&_WETH9.CallOpts, arg0, arg1) +} + +func (_WETH9 *WETH9CallerSession) Allowance(arg0 common.Address, arg1 common.Address) (*big.Int, error) { + return _WETH9.Contract.Allowance(&_WETH9.CallOpts, arg0, arg1) +} + +func (_WETH9 *WETH9Caller) BalanceOf(opts *bind.CallOpts, arg0 common.Address) (*big.Int, error) { + var out []interface{} + err := _WETH9.contract.Call(opts, &out, "balanceOf", arg0) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_WETH9 *WETH9Session) BalanceOf(arg0 common.Address) (*big.Int, error) { + return _WETH9.Contract.BalanceOf(&_WETH9.CallOpts, arg0) +} + +func (_WETH9 *WETH9CallerSession) BalanceOf(arg0 common.Address) (*big.Int, error) { + return _WETH9.Contract.BalanceOf(&_WETH9.CallOpts, arg0) +} + +func (_WETH9 *WETH9Caller) Decimals(opts *bind.CallOpts) (uint8, error) { + var out []interface{} + err := _WETH9.contract.Call(opts, &out, "decimals") + + if err != nil { + return *new(uint8), err + } + + out0 := *abi.ConvertType(out[0], new(uint8)).(*uint8) + + return out0, err + +} + +func (_WETH9 *WETH9Session) Decimals() (uint8, error) { + return _WETH9.Contract.Decimals(&_WETH9.CallOpts) +} + +func (_WETH9 *WETH9CallerSession) Decimals() (uint8, error) { + return _WETH9.Contract.Decimals(&_WETH9.CallOpts) +} + +func (_WETH9 *WETH9Caller) Name(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _WETH9.contract.Call(opts, &out, "name") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +func (_WETH9 *WETH9Session) Name() (string, error) { + return _WETH9.Contract.Name(&_WETH9.CallOpts) +} + +func (_WETH9 *WETH9CallerSession) Name() (string, error) { + return _WETH9.Contract.Name(&_WETH9.CallOpts) +} + +func (_WETH9 *WETH9Caller) Symbol(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _WETH9.contract.Call(opts, &out, "symbol") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +func (_WETH9 *WETH9Session) Symbol() (string, error) { + return _WETH9.Contract.Symbol(&_WETH9.CallOpts) +} + +func (_WETH9 *WETH9CallerSession) Symbol() (string, error) { + return _WETH9.Contract.Symbol(&_WETH9.CallOpts) +} + +func (_WETH9 *WETH9Caller) TotalSupply(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _WETH9.contract.Call(opts, &out, "totalSupply") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_WETH9 *WETH9Session) TotalSupply() (*big.Int, error) { + return _WETH9.Contract.TotalSupply(&_WETH9.CallOpts) +} + +func (_WETH9 *WETH9CallerSession) TotalSupply() (*big.Int, error) { + return _WETH9.Contract.TotalSupply(&_WETH9.CallOpts) +} + +func (_WETH9 *WETH9Transactor) Approve(opts *bind.TransactOpts, guy common.Address, wad *big.Int) (*types.Transaction, error) { + return _WETH9.contract.Transact(opts, "approve", guy, wad) +} + +func (_WETH9 *WETH9Session) Approve(guy common.Address, wad *big.Int) (*types.Transaction, error) { + return _WETH9.Contract.Approve(&_WETH9.TransactOpts, guy, wad) +} + +func (_WETH9 *WETH9TransactorSession) Approve(guy common.Address, wad *big.Int) (*types.Transaction, error) { + return _WETH9.Contract.Approve(&_WETH9.TransactOpts, guy, wad) +} + +func (_WETH9 *WETH9Transactor) Deposit(opts *bind.TransactOpts) (*types.Transaction, error) { + return _WETH9.contract.Transact(opts, "deposit") +} + +func (_WETH9 *WETH9Session) Deposit() (*types.Transaction, error) { + return _WETH9.Contract.Deposit(&_WETH9.TransactOpts) +} + +func (_WETH9 *WETH9TransactorSession) Deposit() (*types.Transaction, error) { + return _WETH9.Contract.Deposit(&_WETH9.TransactOpts) +} + +func (_WETH9 *WETH9Transactor) Transfer(opts *bind.TransactOpts, dst common.Address, wad *big.Int) (*types.Transaction, error) { + return _WETH9.contract.Transact(opts, "transfer", dst, wad) +} + +func (_WETH9 *WETH9Session) Transfer(dst common.Address, wad *big.Int) (*types.Transaction, error) { + return _WETH9.Contract.Transfer(&_WETH9.TransactOpts, dst, wad) +} + +func (_WETH9 *WETH9TransactorSession) Transfer(dst common.Address, wad *big.Int) (*types.Transaction, error) { + return _WETH9.Contract.Transfer(&_WETH9.TransactOpts, dst, wad) +} + +func (_WETH9 *WETH9Transactor) TransferFrom(opts *bind.TransactOpts, src common.Address, dst common.Address, wad *big.Int) (*types.Transaction, error) { + return _WETH9.contract.Transact(opts, "transferFrom", src, dst, wad) +} + +func (_WETH9 *WETH9Session) TransferFrom(src common.Address, dst common.Address, wad *big.Int) (*types.Transaction, error) { + return _WETH9.Contract.TransferFrom(&_WETH9.TransactOpts, src, dst, wad) +} + +func (_WETH9 *WETH9TransactorSession) TransferFrom(src common.Address, dst common.Address, wad *big.Int) (*types.Transaction, error) { + return _WETH9.Contract.TransferFrom(&_WETH9.TransactOpts, src, dst, wad) +} + +func (_WETH9 *WETH9Transactor) Withdraw(opts *bind.TransactOpts, wad *big.Int) (*types.Transaction, error) { + return _WETH9.contract.Transact(opts, "withdraw", wad) +} + +func (_WETH9 *WETH9Session) Withdraw(wad *big.Int) (*types.Transaction, error) { + return _WETH9.Contract.Withdraw(&_WETH9.TransactOpts, wad) +} + +func (_WETH9 *WETH9TransactorSession) Withdraw(wad *big.Int) (*types.Transaction, error) { + return _WETH9.Contract.Withdraw(&_WETH9.TransactOpts, wad) +} + +func (_WETH9 *WETH9Transactor) Receive(opts *bind.TransactOpts) (*types.Transaction, error) { + return _WETH9.contract.RawTransact(opts, nil) +} + +func (_WETH9 *WETH9Session) Receive() (*types.Transaction, error) { + return _WETH9.Contract.Receive(&_WETH9.TransactOpts) +} + +func (_WETH9 *WETH9TransactorSession) Receive() (*types.Transaction, error) { + return _WETH9.Contract.Receive(&_WETH9.TransactOpts) +} + +type WETH9ApprovalIterator struct { + Event *WETH9Approval + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *WETH9ApprovalIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(WETH9Approval) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + + select { + case log := <-it.logs: + it.Event = new(WETH9Approval) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +func (it *WETH9ApprovalIterator) Error() error { + return it.fail +} + +func (it *WETH9ApprovalIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type WETH9Approval struct { + Src common.Address + Guy common.Address + Wad *big.Int + Raw types.Log +} + +func (_WETH9 *WETH9Filterer) FilterApproval(opts *bind.FilterOpts, src []common.Address, guy []common.Address) (*WETH9ApprovalIterator, error) { + + var srcRule []interface{} + for _, srcItem := range src { + srcRule = append(srcRule, srcItem) + } + var guyRule []interface{} + for _, guyItem := range guy { + guyRule = append(guyRule, guyItem) + } + + logs, sub, err := _WETH9.contract.FilterLogs(opts, "Approval", srcRule, guyRule) + if err != nil { + return nil, err + } + return &WETH9ApprovalIterator{contract: _WETH9.contract, event: "Approval", logs: logs, sub: sub}, nil +} + +func (_WETH9 *WETH9Filterer) WatchApproval(opts *bind.WatchOpts, sink chan<- *WETH9Approval, src []common.Address, guy []common.Address) (event.Subscription, error) { + + var srcRule []interface{} + for _, srcItem := range src { + srcRule = append(srcRule, srcItem) + } + var guyRule []interface{} + for _, guyItem := range guy { + guyRule = append(guyRule, guyItem) + } + + logs, sub, err := _WETH9.contract.WatchLogs(opts, "Approval", srcRule, guyRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(WETH9Approval) + if err := _WETH9.contract.UnpackLog(event, "Approval", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +func (_WETH9 *WETH9Filterer) ParseApproval(log types.Log) (*WETH9Approval, error) { + event := new(WETH9Approval) + if err := _WETH9.contract.UnpackLog(event, "Approval", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type WETH9DepositIterator struct { + Event *WETH9Deposit + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *WETH9DepositIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(WETH9Deposit) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + + select { + case log := <-it.logs: + it.Event = new(WETH9Deposit) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +func (it *WETH9DepositIterator) Error() error { + return it.fail +} + +func (it *WETH9DepositIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type WETH9Deposit struct { + Dst common.Address + Wad *big.Int + Raw types.Log +} + +func (_WETH9 *WETH9Filterer) FilterDeposit(opts *bind.FilterOpts, dst []common.Address) (*WETH9DepositIterator, error) { + + var dstRule []interface{} + for _, dstItem := range dst { + dstRule = append(dstRule, dstItem) + } + + logs, sub, err := _WETH9.contract.FilterLogs(opts, "Deposit", dstRule) + if err != nil { + return nil, err + } + return &WETH9DepositIterator{contract: _WETH9.contract, event: "Deposit", logs: logs, sub: sub}, nil +} + +func (_WETH9 *WETH9Filterer) WatchDeposit(opts *bind.WatchOpts, sink chan<- *WETH9Deposit, dst []common.Address) (event.Subscription, error) { + + var dstRule []interface{} + for _, dstItem := range dst { + dstRule = append(dstRule, dstItem) + } + + logs, sub, err := _WETH9.contract.WatchLogs(opts, "Deposit", dstRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(WETH9Deposit) + if err := _WETH9.contract.UnpackLog(event, "Deposit", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +func (_WETH9 *WETH9Filterer) ParseDeposit(log types.Log) (*WETH9Deposit, error) { + event := new(WETH9Deposit) + if err := _WETH9.contract.UnpackLog(event, "Deposit", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type WETH9TransferIterator struct { + Event *WETH9Transfer + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *WETH9TransferIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(WETH9Transfer) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + + select { + case log := <-it.logs: + it.Event = new(WETH9Transfer) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +func (it *WETH9TransferIterator) Error() error { + return it.fail +} + +func (it *WETH9TransferIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type WETH9Transfer struct { + Src common.Address + Dst common.Address + Wad *big.Int + Raw types.Log +} + +func (_WETH9 *WETH9Filterer) FilterTransfer(opts *bind.FilterOpts, src []common.Address, dst []common.Address) (*WETH9TransferIterator, error) { + + var srcRule []interface{} + for _, srcItem := range src { + srcRule = append(srcRule, srcItem) + } + var dstRule []interface{} + for _, dstItem := range dst { + dstRule = append(dstRule, dstItem) + } + + logs, sub, err := _WETH9.contract.FilterLogs(opts, "Transfer", srcRule, dstRule) + if err != nil { + return nil, err + } + return &WETH9TransferIterator{contract: _WETH9.contract, event: "Transfer", logs: logs, sub: sub}, nil +} + +func (_WETH9 *WETH9Filterer) WatchTransfer(opts *bind.WatchOpts, sink chan<- *WETH9Transfer, src []common.Address, dst []common.Address) (event.Subscription, error) { + + var srcRule []interface{} + for _, srcItem := range src { + srcRule = append(srcRule, srcItem) + } + var dstRule []interface{} + for _, dstItem := range dst { + dstRule = append(dstRule, dstItem) + } + + logs, sub, err := _WETH9.contract.WatchLogs(opts, "Transfer", srcRule, dstRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(WETH9Transfer) + if err := _WETH9.contract.UnpackLog(event, "Transfer", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +func (_WETH9 *WETH9Filterer) ParseTransfer(log types.Log) (*WETH9Transfer, error) { + event := new(WETH9Transfer) + if err := _WETH9.contract.UnpackLog(event, "Transfer", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type WETH9WithdrawalIterator struct { + Event *WETH9Withdrawal + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *WETH9WithdrawalIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(WETH9Withdrawal) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + + select { + case log := <-it.logs: + it.Event = new(WETH9Withdrawal) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +func (it *WETH9WithdrawalIterator) Error() error { + return it.fail +} + +func (it *WETH9WithdrawalIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type WETH9Withdrawal struct { + Src common.Address + Wad *big.Int + Raw types.Log +} + +func (_WETH9 *WETH9Filterer) FilterWithdrawal(opts *bind.FilterOpts, src []common.Address) (*WETH9WithdrawalIterator, error) { + + var srcRule []interface{} + for _, srcItem := range src { + srcRule = append(srcRule, srcItem) + } + + logs, sub, err := _WETH9.contract.FilterLogs(opts, "Withdrawal", srcRule) + if err != nil { + return nil, err + } + return &WETH9WithdrawalIterator{contract: _WETH9.contract, event: "Withdrawal", logs: logs, sub: sub}, nil +} + +func (_WETH9 *WETH9Filterer) WatchWithdrawal(opts *bind.WatchOpts, sink chan<- *WETH9Withdrawal, src []common.Address) (event.Subscription, error) { + + var srcRule []interface{} + for _, srcItem := range src { + srcRule = append(srcRule, srcItem) + } + + logs, sub, err := _WETH9.contract.WatchLogs(opts, "Withdrawal", srcRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(WETH9Withdrawal) + if err := _WETH9.contract.UnpackLog(event, "Withdrawal", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +func (_WETH9 *WETH9Filterer) ParseWithdrawal(log types.Log) (*WETH9Withdrawal, error) { + event := new(WETH9Withdrawal) + if err := _WETH9.contract.UnpackLog(event, "Withdrawal", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +func (_WETH9 *WETH9) ParseLog(log types.Log) (generated.AbigenLog, error) { + switch log.Topics[0] { + case _WETH9.abi.Events["Approval"].ID: + return _WETH9.ParseApproval(log) + case _WETH9.abi.Events["Deposit"].ID: + return _WETH9.ParseDeposit(log) + case _WETH9.abi.Events["Transfer"].ID: + return _WETH9.ParseTransfer(log) + case _WETH9.abi.Events["Withdrawal"].ID: + return _WETH9.ParseWithdrawal(log) + + default: + return nil, fmt.Errorf("abigen wrapper received unknown log topic: %v", log.Topics[0]) + } +} + +func (WETH9Approval) Topic() common.Hash { + return common.HexToHash("0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925") +} + +func (WETH9Deposit) Topic() common.Hash { + return common.HexToHash("0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c") +} + +func (WETH9Transfer) Topic() common.Hash { + return common.HexToHash("0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef") +} + +func (WETH9Withdrawal) Topic() common.Hash { + return common.HexToHash("0x7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65") +} + +func (_WETH9 *WETH9) Address() common.Address { + return _WETH9.address +} + +type WETH9Interface interface { + Allowance(opts *bind.CallOpts, arg0 common.Address, arg1 common.Address) (*big.Int, error) + + BalanceOf(opts *bind.CallOpts, arg0 common.Address) (*big.Int, error) + + Decimals(opts *bind.CallOpts) (uint8, error) + + Name(opts *bind.CallOpts) (string, error) + + Symbol(opts *bind.CallOpts) (string, error) + + TotalSupply(opts *bind.CallOpts) (*big.Int, error) + + Approve(opts *bind.TransactOpts, guy common.Address, wad *big.Int) (*types.Transaction, error) + + Deposit(opts *bind.TransactOpts) (*types.Transaction, error) + + Transfer(opts *bind.TransactOpts, dst common.Address, wad *big.Int) (*types.Transaction, error) + + TransferFrom(opts *bind.TransactOpts, src common.Address, dst common.Address, wad *big.Int) (*types.Transaction, error) + + Withdraw(opts *bind.TransactOpts, wad *big.Int) (*types.Transaction, error) + + Receive(opts *bind.TransactOpts) (*types.Transaction, error) + + FilterApproval(opts *bind.FilterOpts, src []common.Address, guy []common.Address) (*WETH9ApprovalIterator, error) + + WatchApproval(opts *bind.WatchOpts, sink chan<- *WETH9Approval, src []common.Address, guy []common.Address) (event.Subscription, error) + + ParseApproval(log types.Log) (*WETH9Approval, error) + + FilterDeposit(opts *bind.FilterOpts, dst []common.Address) (*WETH9DepositIterator, error) + + WatchDeposit(opts *bind.WatchOpts, sink chan<- *WETH9Deposit, dst []common.Address) (event.Subscription, error) + + ParseDeposit(log types.Log) (*WETH9Deposit, error) + + FilterTransfer(opts *bind.FilterOpts, src []common.Address, dst []common.Address) (*WETH9TransferIterator, error) + + WatchTransfer(opts *bind.WatchOpts, sink chan<- *WETH9Transfer, src []common.Address, dst []common.Address) (event.Subscription, error) + + ParseTransfer(log types.Log) (*WETH9Transfer, error) + + FilterWithdrawal(opts *bind.FilterOpts, src []common.Address) (*WETH9WithdrawalIterator, error) + + WatchWithdrawal(opts *bind.WatchOpts, sink chan<- *WETH9Withdrawal, src []common.Address) (event.Subscription, error) + + ParseWithdrawal(log types.Log) (*WETH9Withdrawal, error) + + ParseLog(log types.Log) (generated.AbigenLog, error) + + Address() common.Address +} diff --git a/core/gethwrappers/ccip/generation/generated-wrapper-dependency-versions-do-not-edit.txt b/core/gethwrappers/ccip/generation/generated-wrapper-dependency-versions-do-not-edit.txt new file mode 100644 index 00000000000..ccd0f590f44 --- /dev/null +++ b/core/gethwrappers/ccip/generation/generated-wrapper-dependency-versions-do-not-edit.txt @@ -0,0 +1,41 @@ +GETH_VERSION: 1.13.8 +burn_from_mint_token_pool: ../../../contracts/solc/v0.8.24/BurnFromMintTokenPool/BurnFromMintTokenPool.abi ../../../contracts/solc/v0.8.24/BurnFromMintTokenPool/BurnFromMintTokenPool.bin 1e60c28ad796a220a38043b369dec8d9bffe23e1c7d9895760e30672872afd06 +burn_mint_token_pool: ../../../contracts/solc/v0.8.24/BurnMintTokenPool/BurnMintTokenPool.abi ../../../contracts/solc/v0.8.24/BurnMintTokenPool/BurnMintTokenPool.bin 3e8e3358f0bb520af069a7d37ea625940a88461a54418b1d5925eabced8c74df +burn_mint_token_pool_and_proxy: ../../../contracts/solc/v0.8.24/BurnMintTokenPoolAndProxy/BurnMintTokenPoolAndProxy.abi ../../../contracts/solc/v0.8.24/BurnMintTokenPoolAndProxy/BurnMintTokenPoolAndProxy.bin 717c079d5d13300cf3c3ee871c6e5bf9af904411f204fb081a9f3b263cca1391 +burn_with_from_mint_token_pool: ../../../contracts/solc/v0.8.24/BurnWithFromMintTokenPool/BurnWithFromMintTokenPool.abi ../../../contracts/solc/v0.8.24/BurnWithFromMintTokenPool/BurnWithFromMintTokenPool.bin 6333d0314d0bd29e75ea5e05fe62a4516ade0c6db91c30b6f93645035db52ed8 +burn_with_from_mint_token_pool_and_proxy: ../../../contracts/solc/v0.8.24/BurnWithFromMintTokenPoolAndProxy/BurnWithFromMintTokenPoolAndProxy.abi ../../../contracts/solc/v0.8.24/BurnWithFromMintTokenPoolAndProxy/BurnWithFromMintTokenPoolAndProxy.bin 08ed1235dda921ce8841b26aa18d0c0f36db4884779dd7670857159801b6d597 +ccip_config: ../../../contracts/solc/v0.8.24/CCIPConfig/CCIPConfig.abi ../../../contracts/solc/v0.8.24/CCIPConfig/CCIPConfig.bin 75955a3dcfd66b308be07eda54d6036cc79e87d3cdcf3c5c3115813c55912af8 +ccip_reader_tester: ../../../contracts/solc/v0.8.24/CCIPReaderTester/CCIPReaderTester.abi ../../../contracts/solc/v0.8.24/CCIPReaderTester/CCIPReaderTester.bin 9e8704166df11383257fdc6277adbe94c903d0c9148638fcbd263657ccca9152 +commit_store: ../../../contracts/solc/v0.8.24/CommitStore/CommitStore.abi ../../../contracts/solc/v0.8.24/CommitStore/CommitStore.bin 274d87db70b643e00ab0a7e7845bb4b791f3b613bfc87708d33fc5a8369e2a41 +commit_store_helper: ../../../contracts/solc/v0.8.24/CommitStoreHelper/CommitStoreHelper.abi ../../../contracts/solc/v0.8.24/CommitStoreHelper/CommitStoreHelper.bin f7128dcc2ee6dbcbc976288abcc16970ffb19b59412c5202ef6b259d2007f801 +ether_sender_receiver: ../../../contracts/solc/v0.8.24/EtherSenderReceiver/EtherSenderReceiver.abi ../../../contracts/solc/v0.8.24/EtherSenderReceiver/EtherSenderReceiver.bin 09510a3f773f108a3c231e8d202835c845ded862d071ec54c4f89c12d868b8de +evm_2_evm_offramp: ../../../contracts/solc/v0.8.24/EVM2EVMOffRamp/EVM2EVMOffRamp.abi ../../../contracts/solc/v0.8.24/EVM2EVMOffRamp/EVM2EVMOffRamp.bin b0d77babbe635cd6ba04c2af049badc9e9d28a4b6ed6bb75f830ad902a618beb +evm_2_evm_onramp: ../../../contracts/solc/v0.8.24/EVM2EVMOnRamp/EVM2EVMOnRamp.abi ../../../contracts/solc/v0.8.24/EVM2EVMOnRamp/EVM2EVMOnRamp.bin 5c02c2b167946b3467636ff2bb58594cb4652fc63d8bdfee2488ed562e2a3e50 +fee_quoter: ../../../contracts/solc/v0.8.24/FeeQuoter/FeeQuoter.abi ../../../contracts/solc/v0.8.24/FeeQuoter/FeeQuoter.bin 7fcb78bfc6f050c9d3bd3396a29fa58c6eceec3be6f9f6e807212e816f881a4c +lock_release_token_pool: ../../../contracts/solc/v0.8.24/LockReleaseTokenPool/LockReleaseTokenPool.abi ../../../contracts/solc/v0.8.24/LockReleaseTokenPool/LockReleaseTokenPool.bin e6a8ec9e8faccb1da7d90e0f702ed72975964f97dc3222b54cfcca0a0ba3fea2 +lock_release_token_pool_and_proxy: ../../../contracts/solc/v0.8.24/LockReleaseTokenPoolAndProxy/LockReleaseTokenPoolAndProxy.abi ../../../contracts/solc/v0.8.24/LockReleaseTokenPoolAndProxy/LockReleaseTokenPoolAndProxy.bin e632b08be0fbd1d013e8b3a9d75293d0d532b83071c531ff2be1deec1fa48ec1 +maybe_revert_message_receiver: ../../../contracts/solc/v0.8.24/MaybeRevertMessageReceiver/MaybeRevertMessageReceiver.abi ../../../contracts/solc/v0.8.24/MaybeRevertMessageReceiver/MaybeRevertMessageReceiver.bin d73956c26232ebcc4a5444429fa99cbefed960e323be9b5a24925885c2e477d5 +message_hasher: ../../../contracts/solc/v0.8.24/MessageHasher/MessageHasher.abi ../../../contracts/solc/v0.8.24/MessageHasher/MessageHasher.bin 5712fbc30cf826c0cf38c68f54f744741b553d98c60e66696b7a845778cb2b3d +mock_usdc_token_messenger: ../../../contracts/solc/v0.8.24/MockE2EUSDCTokenMessenger/MockE2EUSDCTokenMessenger.abi ../../../contracts/solc/v0.8.24/MockE2EUSDCTokenMessenger/MockE2EUSDCTokenMessenger.bin d976651d36b33ac2196b32b9d2f4fa6690c6a18d41b621365659fce1c1d1e737 +mock_usdc_token_transmitter: ../../../contracts/solc/v0.8.24/MockE2EUSDCTransmitter/MockE2EUSDCTransmitter.abi ../../../contracts/solc/v0.8.24/MockE2EUSDCTransmitter/MockE2EUSDCTransmitter.bin be0dbc3e475741ea0b7a54ec2b935a321b428baa9f4ce18180a87fb38bb87de2 +mock_v3_aggregator_contract: ../../../contracts/solc/v0.8.24/MockV3Aggregator/MockV3Aggregator.abi ../../../contracts/solc/v0.8.24/MockV3Aggregator/MockV3Aggregator.bin 518e19efa2ff52b0fefd8e597b05765317ee7638189bfe34ca43de2f6599faf4 +multi_aggregate_rate_limiter: ../../../contracts/solc/v0.8.24/MultiAggregateRateLimiter/MultiAggregateRateLimiter.abi ../../../contracts/solc/v0.8.24/MultiAggregateRateLimiter/MultiAggregateRateLimiter.bin 0b541232e49727e947dc164eadf35963c66e67576f21baa0ecaa06a8833148ed +multi_ocr3_helper: ../../../contracts/solc/v0.8.24/MultiOCR3Helper/MultiOCR3Helper.abi ../../../contracts/solc/v0.8.24/MultiOCR3Helper/MultiOCR3Helper.bin 6b56e0114a4d50797d30a34aecc2641ef340451d0c3fcb9d729bba4df2435122 +nonce_manager: ../../../contracts/solc/v0.8.24/NonceManager/NonceManager.abi ../../../contracts/solc/v0.8.24/NonceManager/NonceManager.bin 6f64e1083b356c06ee66b9138e398b9c97a4cd3e8c9ec38cf3010cebc79af536 +ocr3_config_encoder: ../../../contracts/solc/v0.8.24/IOCR3ConfigEncoder/IOCR3ConfigEncoder.abi ../../../contracts/solc/v0.8.24/IOCR3ConfigEncoder/IOCR3ConfigEncoder.bin 9254b35a86f00fde7b7193a033ca58f6521a66e87b9cf9da6ce5660082e79f5d +offramp: ../../../contracts/solc/v0.8.24/OffRamp/OffRamp.abi ../../../contracts/solc/v0.8.24/OffRamp/OffRamp.bin e6827d4a39ed916c3ffa5a7d08b6bfa03cf101bee7207e5c96723b6a9fc761b0 +onramp: ../../../contracts/solc/v0.8.24/OnRamp/OnRamp.abi ../../../contracts/solc/v0.8.24/OnRamp/OnRamp.bin c37096aaa0369ad988e94c300ba62917e17fcc71a3c1aa3e9b8420f21c0591d2 +ping_pong_demo: ../../../contracts/solc/v0.8.24/PingPongDemo/PingPongDemo.abi ../../../contracts/solc/v0.8.24/PingPongDemo/PingPongDemo.bin c1c2f8a65c7ffd971899cae7fe62f2da57d09e936151e2b92163c4bebe699d6b +price_registry: ../../../contracts/solc/v0.8.24/PriceRegistry/PriceRegistry.abi ../../../contracts/solc/v0.8.24/PriceRegistry/PriceRegistry.bin e7781d600c1bb7aa4620106af7f6e146a109b97f4cb6a7d06c9e15773340ecb2 +registry_module_owner_custom: ../../../contracts/solc/v0.8.24/RegistryModuleOwnerCustom/RegistryModuleOwnerCustom.abi ../../../contracts/solc/v0.8.24/RegistryModuleOwnerCustom/RegistryModuleOwnerCustom.bin 75be86323c227917a9bbc3f799d7ed02f92db546653a36db30ed0ebe64461353 +report_codec: ../../../contracts/solc/v0.8.24/ReportCodec/ReportCodec.abi ../../../contracts/solc/v0.8.24/ReportCodec/ReportCodec.bin 4b9252c443c87ceb7f5ac3b9d100e572fead010f7c39543315052677a3a2c597 +rmn_contract: ../../../contracts/solc/v0.8.24/RMN/RMN.abi ../../../contracts/solc/v0.8.24/RMN/RMN.bin 8b45b0fb08631c6b582fd3c0b4052a79cc2b4e091e6286af1ab131bef63661f9 +rmn_proxy_contract: ../../../contracts/solc/v0.8.24/ARMProxy/ARMProxy.abi ../../../contracts/solc/v0.8.24/ARMProxy/ARMProxy.bin b048d8e752e3c41113ebb305c1efa06737ad36b4907b93e627fb0a3113023454 +rmn_remote: ../../../contracts/solc/v0.8.24/RMNRemote/RMNRemote.abi ../../../contracts/solc/v0.8.24/RMNRemote/RMNRemote.bin be6840d9646195c37f6fa3f95e1cb67218d04d2cebf72e698377b0a7b9cd76f4 +router: ../../../contracts/solc/v0.8.24/Router/Router.abi ../../../contracts/solc/v0.8.24/Router/Router.bin 2e4f0a7826c8abb49d882bb49fc5ff20a186dbd3137624b9097ffed903ae4888 +self_funded_ping_pong: ../../../contracts/solc/v0.8.24/SelfFundedPingPong/SelfFundedPingPong.abi ../../../contracts/solc/v0.8.24/SelfFundedPingPong/SelfFundedPingPong.bin 8ea5d75dbc3f8afd90d22c4a665a94e02892259cd16520c1c6b4cf0dc80c9148 +token_admin_registry: ../../../contracts/solc/v0.8.24/TokenAdminRegistry/TokenAdminRegistry.abi ../../../contracts/solc/v0.8.24/TokenAdminRegistry/TokenAdminRegistry.bin 942be7d1681ac102e0615bee13f76838ebb0b261697cf1270d2bf82c12e57aeb +token_pool: ../../../contracts/solc/v0.8.24/TokenPool/TokenPool.abi ../../../contracts/solc/v0.8.24/TokenPool/TokenPool.bin 7c01fd89f5153baa4d7409d14beabb3f861abfbf8880d3c6d06802cc398570f9 +usdc_reader_tester: ../../../contracts/solc/v0.8.24/USDCReaderTester/USDCReaderTester.abi ../../../contracts/solc/v0.8.24/USDCReaderTester/USDCReaderTester.bin 672a07c9218fd6ad7c04dde583088b0f5ffc8d55a46f4be1714008dd3409438b +usdc_token_pool: ../../../contracts/solc/v0.8.24/USDCTokenPool/USDCTokenPool.abi ../../../contracts/solc/v0.8.24/USDCTokenPool/USDCTokenPool.bin 8e7eae4c7277ce4a0092cca815c046cc49094028c23d2d113de9335fa4358030 +weth9: ../../../contracts/solc/v0.8.24/WETH9/WETH9.abi ../../../contracts/solc/v0.8.24/WETH9/WETH9.bin 2970d79a0ca6dd6279cde130de45e56c8790ed695eae477fb5ba4c1bb75b720d diff --git a/core/gethwrappers/ccip/go_generate.go b/core/gethwrappers/ccip/go_generate.go new file mode 100644 index 00000000000..f2a6be21f61 --- /dev/null +++ b/core/gethwrappers/ccip/go_generate.go @@ -0,0 +1,82 @@ +// Package gethwrappers_ccip provides tools for wrapping solidity contracts with +// golang packages, using abigen. +package ccip + +//go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.24/CommitStore/CommitStore.abi ../../../contracts/solc/v0.8.24/CommitStore/CommitStore.bin CommitStore commit_store +//go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.24/CommitStoreHelper/CommitStoreHelper.abi ../../../contracts/solc/v0.8.24/CommitStoreHelper/CommitStoreHelper.bin CommitStoreHelper commit_store_helper +//go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.24/RMN/RMN.abi ../../../contracts/solc/v0.8.24/RMN/RMN.bin RMNContract rmn_contract +//go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.24/ARMProxy/ARMProxy.abi ../../../contracts/solc/v0.8.24/ARMProxy/ARMProxy.bin RMNProxyContract rmn_proxy_contract +//go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.24/TokenAdminRegistry/TokenAdminRegistry.abi ../../../contracts/solc/v0.8.24/TokenAdminRegistry/TokenAdminRegistry.bin TokenAdminRegistry token_admin_registry +//go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.24/RegistryModuleOwnerCustom/RegistryModuleOwnerCustom.abi ../../../contracts/solc/v0.8.24/RegistryModuleOwnerCustom/RegistryModuleOwnerCustom.bin RegistryModuleOwnerCustom registry_module_owner_custom +//go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.24/EVM2EVMOnRamp/EVM2EVMOnRamp.abi ../../../contracts/solc/v0.8.24/EVM2EVMOnRamp/EVM2EVMOnRamp.bin EVM2EVMOnRamp evm_2_evm_onramp +//go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.24/OnRamp/OnRamp.abi ../../../contracts/solc/v0.8.24/OnRamp/OnRamp.bin OnRamp onramp +//go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.24/EVM2EVMOffRamp/EVM2EVMOffRamp.abi ../../../contracts/solc/v0.8.24/EVM2EVMOffRamp/EVM2EVMOffRamp.bin EVM2EVMOffRamp evm_2_evm_offramp +//go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.24/OffRamp/OffRamp.abi ../../../contracts/solc/v0.8.24/OffRamp/OffRamp.bin OffRamp offramp +//go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.24/RMNRemote/RMNRemote.abi ../../../contracts/solc/v0.8.24/RMNRemote/RMNRemote.bin RMNRemote rmn_remote +//go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.24/MultiAggregateRateLimiter/MultiAggregateRateLimiter.abi ../../../contracts/solc/v0.8.24/MultiAggregateRateLimiter/MultiAggregateRateLimiter.bin MultiAggregateRateLimiter multi_aggregate_rate_limiter +//go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.24/Router/Router.abi ../../../contracts/solc/v0.8.24/Router/Router.bin Router router +//go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.24/FeeQuoter/FeeQuoter.abi ../../../contracts/solc/v0.8.24/FeeQuoter/FeeQuoter.bin FeeQuoter fee_quoter +//go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.24/CCIPConfig/CCIPConfig.abi ../../../contracts/solc/v0.8.24/CCIPConfig/CCIPConfig.bin CCIPConfig ccip_config +//go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.24/NonceManager/NonceManager.abi ../../../contracts/solc/v0.8.24/NonceManager/NonceManager.bin NonceManager nonce_manager + +// Pools +//go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.24/BurnMintTokenPool/BurnMintTokenPool.abi ../../../contracts/solc/v0.8.24/BurnMintTokenPool/BurnMintTokenPool.bin BurnMintTokenPool burn_mint_token_pool +//go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.24/BurnFromMintTokenPool/BurnFromMintTokenPool.abi ../../../contracts/solc/v0.8.24/BurnFromMintTokenPool/BurnFromMintTokenPool.bin BurnFromMintTokenPool burn_from_mint_token_pool +//go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.24/BurnWithFromMintTokenPool/BurnWithFromMintTokenPool.abi ../../../contracts/solc/v0.8.24/BurnWithFromMintTokenPool/BurnWithFromMintTokenPool.bin BurnWithFromMintTokenPool burn_with_from_mint_token_pool +//go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.24/BurnMintTokenPoolAndProxy/BurnMintTokenPoolAndProxy.abi ../../../contracts/solc/v0.8.24/BurnMintTokenPoolAndProxy/BurnMintTokenPoolAndProxy.bin BurnMintTokenPoolAndProxy burn_mint_token_pool_and_proxy +//go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.24/BurnWithFromMintTokenPoolAndProxy/BurnWithFromMintTokenPoolAndProxy.abi ../../../contracts/solc/v0.8.24/BurnWithFromMintTokenPoolAndProxy/BurnWithFromMintTokenPoolAndProxy.bin BurnWithFromMintTokenPoolAndProxy burn_with_from_mint_token_pool_and_proxy +//go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.24/LockReleaseTokenPool/LockReleaseTokenPool.abi ../../../contracts/solc/v0.8.24/LockReleaseTokenPool/LockReleaseTokenPool.bin LockReleaseTokenPool lock_release_token_pool +//go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.24/LockReleaseTokenPoolAndProxy/LockReleaseTokenPoolAndProxy.abi ../../../contracts/solc/v0.8.24/LockReleaseTokenPoolAndProxy/LockReleaseTokenPoolAndProxy.bin LockReleaseTokenPoolAndProxy lock_release_token_pool_and_proxy +//go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.24/TokenPool/TokenPool.abi ../../../contracts/solc/v0.8.24/TokenPool/TokenPool.bin TokenPool token_pool +//go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.24/USDCTokenPool/USDCTokenPool.abi ../../../contracts/solc/v0.8.24/USDCTokenPool/USDCTokenPool.bin USDCTokenPool usdc_token_pool + +// Helpers +//go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.24/MockV3Aggregator/MockV3Aggregator.abi ../../../contracts/solc/v0.8.24/MockV3Aggregator/MockV3Aggregator.bin MockV3Aggregator mock_v3_aggregator_contract +//go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.24/MaybeRevertMessageReceiver/MaybeRevertMessageReceiver.abi ../../../contracts/solc/v0.8.24/MaybeRevertMessageReceiver/MaybeRevertMessageReceiver.bin MaybeRevertMessageReceiver maybe_revert_message_receiver +//go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.24/PingPongDemo/PingPongDemo.abi ../../../contracts/solc/v0.8.24/PingPongDemo/PingPongDemo.bin PingPongDemo ping_pong_demo +//go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.24/SelfFundedPingPong/SelfFundedPingPong.abi ../../../contracts/solc/v0.8.24/SelfFundedPingPong/SelfFundedPingPong.bin SelfFundedPingPong self_funded_ping_pong +//go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.24/MessageHasher/MessageHasher.abi ../../../contracts/solc/v0.8.24/MessageHasher/MessageHasher.bin MessageHasher message_hasher +//go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.24/MultiOCR3Helper/MultiOCR3Helper.abi ../../../contracts/solc/v0.8.24/MultiOCR3Helper/MultiOCR3Helper.bin MultiOCR3Helper multi_ocr3_helper +//go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.24/CCIPReaderTester/CCIPReaderTester.abi ../../../contracts/solc/v0.8.24/CCIPReaderTester/CCIPReaderTester.bin CCIPReaderTester ccip_reader_tester +//go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.24/USDCReaderTester/USDCReaderTester.abi ../../../contracts/solc/v0.8.24/USDCReaderTester/USDCReaderTester.bin USDCReaderTester usdc_reader_tester +//go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.24/ReportCodec/ReportCodec.abi ../../../contracts/solc/v0.8.24/ReportCodec/ReportCodec.bin ReportCodec report_codec +//go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.24/EtherSenderReceiver/EtherSenderReceiver.abi ../../../contracts/solc/v0.8.24/EtherSenderReceiver/EtherSenderReceiver.bin EtherSenderReceiver ether_sender_receiver +//go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.24/WETH9/WETH9.abi ../../../contracts/solc/v0.8.24/WETH9/WETH9.bin WETH9 weth9 +//go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.24/IOCR3ConfigEncoder/IOCR3ConfigEncoder.abi ../../../contracts/solc/v0.8.24/IOCR3ConfigEncoder/IOCR3ConfigEncoder.bin IOCR3ConfigEncoder ocr3_config_encoder +//go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.24/MockE2EUSDCTokenMessenger/MockE2EUSDCTokenMessenger.abi ../../../contracts/solc/v0.8.24/MockE2EUSDCTokenMessenger/MockE2EUSDCTokenMessenger.bin MockE2EUSDCTokenMessenger mock_usdc_token_messenger +//go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.24/MockE2EUSDCTransmitter/MockE2EUSDCTransmitter.abi ../../../contracts/solc/v0.8.24/MockE2EUSDCTransmitter/MockE2EUSDCTransmitter.bin MockE2EUSDCTransmitter mock_usdc_token_transmitter + +// To run these commands, you must either install docker, or the correct version +// of abigen. The latter can be installed with these commands, at least on linux: +// +// git clone https://github.com/ethereum/go-ethereum +// cd go-ethereum/cmd/abigen +// git checkout v +// go install +// +// Here, is the version of go-ethereum specified in chainlink's +// go.mod. This will install abigen in "$GOPATH/bin", which you should add to +// your $PATH. +// +// To reduce explicit dependencies, and in case the system does not have the +// correct version of abigen installed , the above commands spin up docker +// containers. In my hands, total running time including compilation is about +// 13s. If you're modifying solidity code and testing against go code a lot, it +// might be worthwhile to generate the the wrappers using a static container +// with abigen and solc, which will complete much faster. E.g. +// +// abigen -sol ../../contracts/src/v0.6/VRFAll.sol -pkg vrf -out solidity_interfaces.go +// +// where VRFAll.sol simply contains `import "contract_path";` instructions for +// all the contracts you wish to target. This runs in about 0.25 seconds in my +// hands. +// +// If you're on linux, you can copy the correct version of solc out of the +// appropriate docker container. At least, the following works on ubuntu: +// +// $ docker run --name solc ethereum/solc:0.6.2 +// $ sudo docker cp solc:/usr/bin/solc /usr/bin +// $ docker rm solc +// +// If you need to point abigen at your solc executable, you can specify the path +// with the abigen --solc option. diff --git a/core/gethwrappers/ccip/mocks/commit_store_interface.go b/core/gethwrappers/ccip/mocks/commit_store_interface.go new file mode 100644 index 00000000000..124c2acaa41 --- /dev/null +++ b/core/gethwrappers/ccip/mocks/commit_store_interface.go @@ -0,0 +1,3418 @@ +// Code generated by mockery v2.43.2. DO NOT EDIT. + +package mock_contracts + +import ( + big "math/big" + + bind "github.com/ethereum/go-ethereum/accounts/abi/bind" + common "github.com/ethereum/go-ethereum/common" + commit_store "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/commit_store" + + event "github.com/ethereum/go-ethereum/event" + + generated "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" + + mock "github.com/stretchr/testify/mock" + + types "github.com/ethereum/go-ethereum/core/types" +) + +// CommitStoreInterface is an autogenerated mock type for the CommitStoreInterface type +type CommitStoreInterface struct { + mock.Mock +} + +type CommitStoreInterface_Expecter struct { + mock *mock.Mock +} + +func (_m *CommitStoreInterface) EXPECT() *CommitStoreInterface_Expecter { + return &CommitStoreInterface_Expecter{mock: &_m.Mock} +} + +// AcceptOwnership provides a mock function with given fields: opts +func (_m *CommitStoreInterface) AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for AcceptOwnership") + } + + var r0 *types.Transaction + var r1 error + if rf, ok := ret.Get(0).(func(*bind.TransactOpts) (*types.Transaction, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.TransactOpts) *types.Transaction); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Transaction) + } + } + + if rf, ok := ret.Get(1).(func(*bind.TransactOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// CommitStoreInterface_AcceptOwnership_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AcceptOwnership' +type CommitStoreInterface_AcceptOwnership_Call struct { + *mock.Call +} + +// AcceptOwnership is a helper method to define mock.On call +// - opts *bind.TransactOpts +func (_e *CommitStoreInterface_Expecter) AcceptOwnership(opts interface{}) *CommitStoreInterface_AcceptOwnership_Call { + return &CommitStoreInterface_AcceptOwnership_Call{Call: _e.mock.On("AcceptOwnership", opts)} +} + +func (_c *CommitStoreInterface_AcceptOwnership_Call) Run(run func(opts *bind.TransactOpts)) *CommitStoreInterface_AcceptOwnership_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts)) + }) + return _c +} + +func (_c *CommitStoreInterface_AcceptOwnership_Call) Return(_a0 *types.Transaction, _a1 error) *CommitStoreInterface_AcceptOwnership_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *CommitStoreInterface_AcceptOwnership_Call) RunAndReturn(run func(*bind.TransactOpts) (*types.Transaction, error)) *CommitStoreInterface_AcceptOwnership_Call { + _c.Call.Return(run) + return _c +} + +// Address provides a mock function with given fields: +func (_m *CommitStoreInterface) Address() common.Address { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Address") + } + + var r0 common.Address + if rf, ok := ret.Get(0).(func() common.Address); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Address) + } + } + + return r0 +} + +// CommitStoreInterface_Address_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Address' +type CommitStoreInterface_Address_Call struct { + *mock.Call +} + +// Address is a helper method to define mock.On call +func (_e *CommitStoreInterface_Expecter) Address() *CommitStoreInterface_Address_Call { + return &CommitStoreInterface_Address_Call{Call: _e.mock.On("Address")} +} + +func (_c *CommitStoreInterface_Address_Call) Run(run func()) *CommitStoreInterface_Address_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *CommitStoreInterface_Address_Call) Return(_a0 common.Address) *CommitStoreInterface_Address_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *CommitStoreInterface_Address_Call) RunAndReturn(run func() common.Address) *CommitStoreInterface_Address_Call { + _c.Call.Return(run) + return _c +} + +// FilterConfigSet provides a mock function with given fields: opts +func (_m *CommitStoreInterface) FilterConfigSet(opts *bind.FilterOpts) (*commit_store.CommitStoreConfigSetIterator, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for FilterConfigSet") + } + + var r0 *commit_store.CommitStoreConfigSetIterator + var r1 error + if rf, ok := ret.Get(0).(func(*bind.FilterOpts) (*commit_store.CommitStoreConfigSetIterator, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.FilterOpts) *commit_store.CommitStoreConfigSetIterator); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*commit_store.CommitStoreConfigSetIterator) + } + } + + if rf, ok := ret.Get(1).(func(*bind.FilterOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// CommitStoreInterface_FilterConfigSet_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterConfigSet' +type CommitStoreInterface_FilterConfigSet_Call struct { + *mock.Call +} + +// FilterConfigSet is a helper method to define mock.On call +// - opts *bind.FilterOpts +func (_e *CommitStoreInterface_Expecter) FilterConfigSet(opts interface{}) *CommitStoreInterface_FilterConfigSet_Call { + return &CommitStoreInterface_FilterConfigSet_Call{Call: _e.mock.On("FilterConfigSet", opts)} +} + +func (_c *CommitStoreInterface_FilterConfigSet_Call) Run(run func(opts *bind.FilterOpts)) *CommitStoreInterface_FilterConfigSet_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts)) + }) + return _c +} + +func (_c *CommitStoreInterface_FilterConfigSet_Call) Return(_a0 *commit_store.CommitStoreConfigSetIterator, _a1 error) *CommitStoreInterface_FilterConfigSet_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *CommitStoreInterface_FilterConfigSet_Call) RunAndReturn(run func(*bind.FilterOpts) (*commit_store.CommitStoreConfigSetIterator, error)) *CommitStoreInterface_FilterConfigSet_Call { + _c.Call.Return(run) + return _c +} + +// FilterConfigSet0 provides a mock function with given fields: opts +func (_m *CommitStoreInterface) FilterConfigSet0(opts *bind.FilterOpts) (*commit_store.CommitStoreConfigSet0Iterator, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for FilterConfigSet0") + } + + var r0 *commit_store.CommitStoreConfigSet0Iterator + var r1 error + if rf, ok := ret.Get(0).(func(*bind.FilterOpts) (*commit_store.CommitStoreConfigSet0Iterator, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.FilterOpts) *commit_store.CommitStoreConfigSet0Iterator); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*commit_store.CommitStoreConfigSet0Iterator) + } + } + + if rf, ok := ret.Get(1).(func(*bind.FilterOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// CommitStoreInterface_FilterConfigSet0_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterConfigSet0' +type CommitStoreInterface_FilterConfigSet0_Call struct { + *mock.Call +} + +// FilterConfigSet0 is a helper method to define mock.On call +// - opts *bind.FilterOpts +func (_e *CommitStoreInterface_Expecter) FilterConfigSet0(opts interface{}) *CommitStoreInterface_FilterConfigSet0_Call { + return &CommitStoreInterface_FilterConfigSet0_Call{Call: _e.mock.On("FilterConfigSet0", opts)} +} + +func (_c *CommitStoreInterface_FilterConfigSet0_Call) Run(run func(opts *bind.FilterOpts)) *CommitStoreInterface_FilterConfigSet0_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts)) + }) + return _c +} + +func (_c *CommitStoreInterface_FilterConfigSet0_Call) Return(_a0 *commit_store.CommitStoreConfigSet0Iterator, _a1 error) *CommitStoreInterface_FilterConfigSet0_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *CommitStoreInterface_FilterConfigSet0_Call) RunAndReturn(run func(*bind.FilterOpts) (*commit_store.CommitStoreConfigSet0Iterator, error)) *CommitStoreInterface_FilterConfigSet0_Call { + _c.Call.Return(run) + return _c +} + +// FilterLatestPriceEpochAndRoundSet provides a mock function with given fields: opts +func (_m *CommitStoreInterface) FilterLatestPriceEpochAndRoundSet(opts *bind.FilterOpts) (*commit_store.CommitStoreLatestPriceEpochAndRoundSetIterator, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for FilterLatestPriceEpochAndRoundSet") + } + + var r0 *commit_store.CommitStoreLatestPriceEpochAndRoundSetIterator + var r1 error + if rf, ok := ret.Get(0).(func(*bind.FilterOpts) (*commit_store.CommitStoreLatestPriceEpochAndRoundSetIterator, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.FilterOpts) *commit_store.CommitStoreLatestPriceEpochAndRoundSetIterator); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*commit_store.CommitStoreLatestPriceEpochAndRoundSetIterator) + } + } + + if rf, ok := ret.Get(1).(func(*bind.FilterOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// CommitStoreInterface_FilterLatestPriceEpochAndRoundSet_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterLatestPriceEpochAndRoundSet' +type CommitStoreInterface_FilterLatestPriceEpochAndRoundSet_Call struct { + *mock.Call +} + +// FilterLatestPriceEpochAndRoundSet is a helper method to define mock.On call +// - opts *bind.FilterOpts +func (_e *CommitStoreInterface_Expecter) FilterLatestPriceEpochAndRoundSet(opts interface{}) *CommitStoreInterface_FilterLatestPriceEpochAndRoundSet_Call { + return &CommitStoreInterface_FilterLatestPriceEpochAndRoundSet_Call{Call: _e.mock.On("FilterLatestPriceEpochAndRoundSet", opts)} +} + +func (_c *CommitStoreInterface_FilterLatestPriceEpochAndRoundSet_Call) Run(run func(opts *bind.FilterOpts)) *CommitStoreInterface_FilterLatestPriceEpochAndRoundSet_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts)) + }) + return _c +} + +func (_c *CommitStoreInterface_FilterLatestPriceEpochAndRoundSet_Call) Return(_a0 *commit_store.CommitStoreLatestPriceEpochAndRoundSetIterator, _a1 error) *CommitStoreInterface_FilterLatestPriceEpochAndRoundSet_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *CommitStoreInterface_FilterLatestPriceEpochAndRoundSet_Call) RunAndReturn(run func(*bind.FilterOpts) (*commit_store.CommitStoreLatestPriceEpochAndRoundSetIterator, error)) *CommitStoreInterface_FilterLatestPriceEpochAndRoundSet_Call { + _c.Call.Return(run) + return _c +} + +// FilterOwnershipTransferRequested provides a mock function with given fields: opts, from, to +func (_m *CommitStoreInterface) FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*commit_store.CommitStoreOwnershipTransferRequestedIterator, error) { + ret := _m.Called(opts, from, to) + + if len(ret) == 0 { + panic("no return value specified for FilterOwnershipTransferRequested") + } + + var r0 *commit_store.CommitStoreOwnershipTransferRequestedIterator + var r1 error + if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []common.Address, []common.Address) (*commit_store.CommitStoreOwnershipTransferRequestedIterator, error)); ok { + return rf(opts, from, to) + } + if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []common.Address, []common.Address) *commit_store.CommitStoreOwnershipTransferRequestedIterator); ok { + r0 = rf(opts, from, to) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*commit_store.CommitStoreOwnershipTransferRequestedIterator) + } + } + + if rf, ok := ret.Get(1).(func(*bind.FilterOpts, []common.Address, []common.Address) error); ok { + r1 = rf(opts, from, to) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// CommitStoreInterface_FilterOwnershipTransferRequested_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterOwnershipTransferRequested' +type CommitStoreInterface_FilterOwnershipTransferRequested_Call struct { + *mock.Call +} + +// FilterOwnershipTransferRequested is a helper method to define mock.On call +// - opts *bind.FilterOpts +// - from []common.Address +// - to []common.Address +func (_e *CommitStoreInterface_Expecter) FilterOwnershipTransferRequested(opts interface{}, from interface{}, to interface{}) *CommitStoreInterface_FilterOwnershipTransferRequested_Call { + return &CommitStoreInterface_FilterOwnershipTransferRequested_Call{Call: _e.mock.On("FilterOwnershipTransferRequested", opts, from, to)} +} + +func (_c *CommitStoreInterface_FilterOwnershipTransferRequested_Call) Run(run func(opts *bind.FilterOpts, from []common.Address, to []common.Address)) *CommitStoreInterface_FilterOwnershipTransferRequested_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts), args[1].([]common.Address), args[2].([]common.Address)) + }) + return _c +} + +func (_c *CommitStoreInterface_FilterOwnershipTransferRequested_Call) Return(_a0 *commit_store.CommitStoreOwnershipTransferRequestedIterator, _a1 error) *CommitStoreInterface_FilterOwnershipTransferRequested_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *CommitStoreInterface_FilterOwnershipTransferRequested_Call) RunAndReturn(run func(*bind.FilterOpts, []common.Address, []common.Address) (*commit_store.CommitStoreOwnershipTransferRequestedIterator, error)) *CommitStoreInterface_FilterOwnershipTransferRequested_Call { + _c.Call.Return(run) + return _c +} + +// FilterOwnershipTransferred provides a mock function with given fields: opts, from, to +func (_m *CommitStoreInterface) FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*commit_store.CommitStoreOwnershipTransferredIterator, error) { + ret := _m.Called(opts, from, to) + + if len(ret) == 0 { + panic("no return value specified for FilterOwnershipTransferred") + } + + var r0 *commit_store.CommitStoreOwnershipTransferredIterator + var r1 error + if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []common.Address, []common.Address) (*commit_store.CommitStoreOwnershipTransferredIterator, error)); ok { + return rf(opts, from, to) + } + if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []common.Address, []common.Address) *commit_store.CommitStoreOwnershipTransferredIterator); ok { + r0 = rf(opts, from, to) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*commit_store.CommitStoreOwnershipTransferredIterator) + } + } + + if rf, ok := ret.Get(1).(func(*bind.FilterOpts, []common.Address, []common.Address) error); ok { + r1 = rf(opts, from, to) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// CommitStoreInterface_FilterOwnershipTransferred_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterOwnershipTransferred' +type CommitStoreInterface_FilterOwnershipTransferred_Call struct { + *mock.Call +} + +// FilterOwnershipTransferred is a helper method to define mock.On call +// - opts *bind.FilterOpts +// - from []common.Address +// - to []common.Address +func (_e *CommitStoreInterface_Expecter) FilterOwnershipTransferred(opts interface{}, from interface{}, to interface{}) *CommitStoreInterface_FilterOwnershipTransferred_Call { + return &CommitStoreInterface_FilterOwnershipTransferred_Call{Call: _e.mock.On("FilterOwnershipTransferred", opts, from, to)} +} + +func (_c *CommitStoreInterface_FilterOwnershipTransferred_Call) Run(run func(opts *bind.FilterOpts, from []common.Address, to []common.Address)) *CommitStoreInterface_FilterOwnershipTransferred_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts), args[1].([]common.Address), args[2].([]common.Address)) + }) + return _c +} + +func (_c *CommitStoreInterface_FilterOwnershipTransferred_Call) Return(_a0 *commit_store.CommitStoreOwnershipTransferredIterator, _a1 error) *CommitStoreInterface_FilterOwnershipTransferred_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *CommitStoreInterface_FilterOwnershipTransferred_Call) RunAndReturn(run func(*bind.FilterOpts, []common.Address, []common.Address) (*commit_store.CommitStoreOwnershipTransferredIterator, error)) *CommitStoreInterface_FilterOwnershipTransferred_Call { + _c.Call.Return(run) + return _c +} + +// FilterPaused provides a mock function with given fields: opts +func (_m *CommitStoreInterface) FilterPaused(opts *bind.FilterOpts) (*commit_store.CommitStorePausedIterator, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for FilterPaused") + } + + var r0 *commit_store.CommitStorePausedIterator + var r1 error + if rf, ok := ret.Get(0).(func(*bind.FilterOpts) (*commit_store.CommitStorePausedIterator, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.FilterOpts) *commit_store.CommitStorePausedIterator); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*commit_store.CommitStorePausedIterator) + } + } + + if rf, ok := ret.Get(1).(func(*bind.FilterOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// CommitStoreInterface_FilterPaused_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterPaused' +type CommitStoreInterface_FilterPaused_Call struct { + *mock.Call +} + +// FilterPaused is a helper method to define mock.On call +// - opts *bind.FilterOpts +func (_e *CommitStoreInterface_Expecter) FilterPaused(opts interface{}) *CommitStoreInterface_FilterPaused_Call { + return &CommitStoreInterface_FilterPaused_Call{Call: _e.mock.On("FilterPaused", opts)} +} + +func (_c *CommitStoreInterface_FilterPaused_Call) Run(run func(opts *bind.FilterOpts)) *CommitStoreInterface_FilterPaused_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts)) + }) + return _c +} + +func (_c *CommitStoreInterface_FilterPaused_Call) Return(_a0 *commit_store.CommitStorePausedIterator, _a1 error) *CommitStoreInterface_FilterPaused_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *CommitStoreInterface_FilterPaused_Call) RunAndReturn(run func(*bind.FilterOpts) (*commit_store.CommitStorePausedIterator, error)) *CommitStoreInterface_FilterPaused_Call { + _c.Call.Return(run) + return _c +} + +// FilterReportAccepted provides a mock function with given fields: opts +func (_m *CommitStoreInterface) FilterReportAccepted(opts *bind.FilterOpts) (*commit_store.CommitStoreReportAcceptedIterator, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for FilterReportAccepted") + } + + var r0 *commit_store.CommitStoreReportAcceptedIterator + var r1 error + if rf, ok := ret.Get(0).(func(*bind.FilterOpts) (*commit_store.CommitStoreReportAcceptedIterator, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.FilterOpts) *commit_store.CommitStoreReportAcceptedIterator); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*commit_store.CommitStoreReportAcceptedIterator) + } + } + + if rf, ok := ret.Get(1).(func(*bind.FilterOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// CommitStoreInterface_FilterReportAccepted_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterReportAccepted' +type CommitStoreInterface_FilterReportAccepted_Call struct { + *mock.Call +} + +// FilterReportAccepted is a helper method to define mock.On call +// - opts *bind.FilterOpts +func (_e *CommitStoreInterface_Expecter) FilterReportAccepted(opts interface{}) *CommitStoreInterface_FilterReportAccepted_Call { + return &CommitStoreInterface_FilterReportAccepted_Call{Call: _e.mock.On("FilterReportAccepted", opts)} +} + +func (_c *CommitStoreInterface_FilterReportAccepted_Call) Run(run func(opts *bind.FilterOpts)) *CommitStoreInterface_FilterReportAccepted_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts)) + }) + return _c +} + +func (_c *CommitStoreInterface_FilterReportAccepted_Call) Return(_a0 *commit_store.CommitStoreReportAcceptedIterator, _a1 error) *CommitStoreInterface_FilterReportAccepted_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *CommitStoreInterface_FilterReportAccepted_Call) RunAndReturn(run func(*bind.FilterOpts) (*commit_store.CommitStoreReportAcceptedIterator, error)) *CommitStoreInterface_FilterReportAccepted_Call { + _c.Call.Return(run) + return _c +} + +// FilterRootRemoved provides a mock function with given fields: opts +func (_m *CommitStoreInterface) FilterRootRemoved(opts *bind.FilterOpts) (*commit_store.CommitStoreRootRemovedIterator, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for FilterRootRemoved") + } + + var r0 *commit_store.CommitStoreRootRemovedIterator + var r1 error + if rf, ok := ret.Get(0).(func(*bind.FilterOpts) (*commit_store.CommitStoreRootRemovedIterator, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.FilterOpts) *commit_store.CommitStoreRootRemovedIterator); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*commit_store.CommitStoreRootRemovedIterator) + } + } + + if rf, ok := ret.Get(1).(func(*bind.FilterOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// CommitStoreInterface_FilterRootRemoved_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterRootRemoved' +type CommitStoreInterface_FilterRootRemoved_Call struct { + *mock.Call +} + +// FilterRootRemoved is a helper method to define mock.On call +// - opts *bind.FilterOpts +func (_e *CommitStoreInterface_Expecter) FilterRootRemoved(opts interface{}) *CommitStoreInterface_FilterRootRemoved_Call { + return &CommitStoreInterface_FilterRootRemoved_Call{Call: _e.mock.On("FilterRootRemoved", opts)} +} + +func (_c *CommitStoreInterface_FilterRootRemoved_Call) Run(run func(opts *bind.FilterOpts)) *CommitStoreInterface_FilterRootRemoved_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts)) + }) + return _c +} + +func (_c *CommitStoreInterface_FilterRootRemoved_Call) Return(_a0 *commit_store.CommitStoreRootRemovedIterator, _a1 error) *CommitStoreInterface_FilterRootRemoved_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *CommitStoreInterface_FilterRootRemoved_Call) RunAndReturn(run func(*bind.FilterOpts) (*commit_store.CommitStoreRootRemovedIterator, error)) *CommitStoreInterface_FilterRootRemoved_Call { + _c.Call.Return(run) + return _c +} + +// FilterSequenceNumberSet provides a mock function with given fields: opts +func (_m *CommitStoreInterface) FilterSequenceNumberSet(opts *bind.FilterOpts) (*commit_store.CommitStoreSequenceNumberSetIterator, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for FilterSequenceNumberSet") + } + + var r0 *commit_store.CommitStoreSequenceNumberSetIterator + var r1 error + if rf, ok := ret.Get(0).(func(*bind.FilterOpts) (*commit_store.CommitStoreSequenceNumberSetIterator, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.FilterOpts) *commit_store.CommitStoreSequenceNumberSetIterator); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*commit_store.CommitStoreSequenceNumberSetIterator) + } + } + + if rf, ok := ret.Get(1).(func(*bind.FilterOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// CommitStoreInterface_FilterSequenceNumberSet_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterSequenceNumberSet' +type CommitStoreInterface_FilterSequenceNumberSet_Call struct { + *mock.Call +} + +// FilterSequenceNumberSet is a helper method to define mock.On call +// - opts *bind.FilterOpts +func (_e *CommitStoreInterface_Expecter) FilterSequenceNumberSet(opts interface{}) *CommitStoreInterface_FilterSequenceNumberSet_Call { + return &CommitStoreInterface_FilterSequenceNumberSet_Call{Call: _e.mock.On("FilterSequenceNumberSet", opts)} +} + +func (_c *CommitStoreInterface_FilterSequenceNumberSet_Call) Run(run func(opts *bind.FilterOpts)) *CommitStoreInterface_FilterSequenceNumberSet_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts)) + }) + return _c +} + +func (_c *CommitStoreInterface_FilterSequenceNumberSet_Call) Return(_a0 *commit_store.CommitStoreSequenceNumberSetIterator, _a1 error) *CommitStoreInterface_FilterSequenceNumberSet_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *CommitStoreInterface_FilterSequenceNumberSet_Call) RunAndReturn(run func(*bind.FilterOpts) (*commit_store.CommitStoreSequenceNumberSetIterator, error)) *CommitStoreInterface_FilterSequenceNumberSet_Call { + _c.Call.Return(run) + return _c +} + +// FilterTransmitted provides a mock function with given fields: opts +func (_m *CommitStoreInterface) FilterTransmitted(opts *bind.FilterOpts) (*commit_store.CommitStoreTransmittedIterator, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for FilterTransmitted") + } + + var r0 *commit_store.CommitStoreTransmittedIterator + var r1 error + if rf, ok := ret.Get(0).(func(*bind.FilterOpts) (*commit_store.CommitStoreTransmittedIterator, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.FilterOpts) *commit_store.CommitStoreTransmittedIterator); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*commit_store.CommitStoreTransmittedIterator) + } + } + + if rf, ok := ret.Get(1).(func(*bind.FilterOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// CommitStoreInterface_FilterTransmitted_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterTransmitted' +type CommitStoreInterface_FilterTransmitted_Call struct { + *mock.Call +} + +// FilterTransmitted is a helper method to define mock.On call +// - opts *bind.FilterOpts +func (_e *CommitStoreInterface_Expecter) FilterTransmitted(opts interface{}) *CommitStoreInterface_FilterTransmitted_Call { + return &CommitStoreInterface_FilterTransmitted_Call{Call: _e.mock.On("FilterTransmitted", opts)} +} + +func (_c *CommitStoreInterface_FilterTransmitted_Call) Run(run func(opts *bind.FilterOpts)) *CommitStoreInterface_FilterTransmitted_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts)) + }) + return _c +} + +func (_c *CommitStoreInterface_FilterTransmitted_Call) Return(_a0 *commit_store.CommitStoreTransmittedIterator, _a1 error) *CommitStoreInterface_FilterTransmitted_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *CommitStoreInterface_FilterTransmitted_Call) RunAndReturn(run func(*bind.FilterOpts) (*commit_store.CommitStoreTransmittedIterator, error)) *CommitStoreInterface_FilterTransmitted_Call { + _c.Call.Return(run) + return _c +} + +// FilterUnpaused provides a mock function with given fields: opts +func (_m *CommitStoreInterface) FilterUnpaused(opts *bind.FilterOpts) (*commit_store.CommitStoreUnpausedIterator, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for FilterUnpaused") + } + + var r0 *commit_store.CommitStoreUnpausedIterator + var r1 error + if rf, ok := ret.Get(0).(func(*bind.FilterOpts) (*commit_store.CommitStoreUnpausedIterator, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.FilterOpts) *commit_store.CommitStoreUnpausedIterator); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*commit_store.CommitStoreUnpausedIterator) + } + } + + if rf, ok := ret.Get(1).(func(*bind.FilterOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// CommitStoreInterface_FilterUnpaused_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterUnpaused' +type CommitStoreInterface_FilterUnpaused_Call struct { + *mock.Call +} + +// FilterUnpaused is a helper method to define mock.On call +// - opts *bind.FilterOpts +func (_e *CommitStoreInterface_Expecter) FilterUnpaused(opts interface{}) *CommitStoreInterface_FilterUnpaused_Call { + return &CommitStoreInterface_FilterUnpaused_Call{Call: _e.mock.On("FilterUnpaused", opts)} +} + +func (_c *CommitStoreInterface_FilterUnpaused_Call) Run(run func(opts *bind.FilterOpts)) *CommitStoreInterface_FilterUnpaused_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts)) + }) + return _c +} + +func (_c *CommitStoreInterface_FilterUnpaused_Call) Return(_a0 *commit_store.CommitStoreUnpausedIterator, _a1 error) *CommitStoreInterface_FilterUnpaused_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *CommitStoreInterface_FilterUnpaused_Call) RunAndReturn(run func(*bind.FilterOpts) (*commit_store.CommitStoreUnpausedIterator, error)) *CommitStoreInterface_FilterUnpaused_Call { + _c.Call.Return(run) + return _c +} + +// GetDynamicConfig provides a mock function with given fields: opts +func (_m *CommitStoreInterface) GetDynamicConfig(opts *bind.CallOpts) (commit_store.CommitStoreDynamicConfig, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for GetDynamicConfig") + } + + var r0 commit_store.CommitStoreDynamicConfig + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts) (commit_store.CommitStoreDynamicConfig, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts) commit_store.CommitStoreDynamicConfig); ok { + r0 = rf(opts) + } else { + r0 = ret.Get(0).(commit_store.CommitStoreDynamicConfig) + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// CommitStoreInterface_GetDynamicConfig_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetDynamicConfig' +type CommitStoreInterface_GetDynamicConfig_Call struct { + *mock.Call +} + +// GetDynamicConfig is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *CommitStoreInterface_Expecter) GetDynamicConfig(opts interface{}) *CommitStoreInterface_GetDynamicConfig_Call { + return &CommitStoreInterface_GetDynamicConfig_Call{Call: _e.mock.On("GetDynamicConfig", opts)} +} + +func (_c *CommitStoreInterface_GetDynamicConfig_Call) Run(run func(opts *bind.CallOpts)) *CommitStoreInterface_GetDynamicConfig_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *CommitStoreInterface_GetDynamicConfig_Call) Return(_a0 commit_store.CommitStoreDynamicConfig, _a1 error) *CommitStoreInterface_GetDynamicConfig_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *CommitStoreInterface_GetDynamicConfig_Call) RunAndReturn(run func(*bind.CallOpts) (commit_store.CommitStoreDynamicConfig, error)) *CommitStoreInterface_GetDynamicConfig_Call { + _c.Call.Return(run) + return _c +} + +// GetExpectedNextSequenceNumber provides a mock function with given fields: opts +func (_m *CommitStoreInterface) GetExpectedNextSequenceNumber(opts *bind.CallOpts) (uint64, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for GetExpectedNextSequenceNumber") + } + + var r0 uint64 + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts) (uint64, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts) uint64); ok { + r0 = rf(opts) + } else { + r0 = ret.Get(0).(uint64) + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// CommitStoreInterface_GetExpectedNextSequenceNumber_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetExpectedNextSequenceNumber' +type CommitStoreInterface_GetExpectedNextSequenceNumber_Call struct { + *mock.Call +} + +// GetExpectedNextSequenceNumber is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *CommitStoreInterface_Expecter) GetExpectedNextSequenceNumber(opts interface{}) *CommitStoreInterface_GetExpectedNextSequenceNumber_Call { + return &CommitStoreInterface_GetExpectedNextSequenceNumber_Call{Call: _e.mock.On("GetExpectedNextSequenceNumber", opts)} +} + +func (_c *CommitStoreInterface_GetExpectedNextSequenceNumber_Call) Run(run func(opts *bind.CallOpts)) *CommitStoreInterface_GetExpectedNextSequenceNumber_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *CommitStoreInterface_GetExpectedNextSequenceNumber_Call) Return(_a0 uint64, _a1 error) *CommitStoreInterface_GetExpectedNextSequenceNumber_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *CommitStoreInterface_GetExpectedNextSequenceNumber_Call) RunAndReturn(run func(*bind.CallOpts) (uint64, error)) *CommitStoreInterface_GetExpectedNextSequenceNumber_Call { + _c.Call.Return(run) + return _c +} + +// GetLatestPriceEpochAndRound provides a mock function with given fields: opts +func (_m *CommitStoreInterface) GetLatestPriceEpochAndRound(opts *bind.CallOpts) (uint64, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for GetLatestPriceEpochAndRound") + } + + var r0 uint64 + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts) (uint64, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts) uint64); ok { + r0 = rf(opts) + } else { + r0 = ret.Get(0).(uint64) + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// CommitStoreInterface_GetLatestPriceEpochAndRound_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetLatestPriceEpochAndRound' +type CommitStoreInterface_GetLatestPriceEpochAndRound_Call struct { + *mock.Call +} + +// GetLatestPriceEpochAndRound is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *CommitStoreInterface_Expecter) GetLatestPriceEpochAndRound(opts interface{}) *CommitStoreInterface_GetLatestPriceEpochAndRound_Call { + return &CommitStoreInterface_GetLatestPriceEpochAndRound_Call{Call: _e.mock.On("GetLatestPriceEpochAndRound", opts)} +} + +func (_c *CommitStoreInterface_GetLatestPriceEpochAndRound_Call) Run(run func(opts *bind.CallOpts)) *CommitStoreInterface_GetLatestPriceEpochAndRound_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *CommitStoreInterface_GetLatestPriceEpochAndRound_Call) Return(_a0 uint64, _a1 error) *CommitStoreInterface_GetLatestPriceEpochAndRound_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *CommitStoreInterface_GetLatestPriceEpochAndRound_Call) RunAndReturn(run func(*bind.CallOpts) (uint64, error)) *CommitStoreInterface_GetLatestPriceEpochAndRound_Call { + _c.Call.Return(run) + return _c +} + +// GetMerkleRoot provides a mock function with given fields: opts, root +func (_m *CommitStoreInterface) GetMerkleRoot(opts *bind.CallOpts, root [32]byte) (*big.Int, error) { + ret := _m.Called(opts, root) + + if len(ret) == 0 { + panic("no return value specified for GetMerkleRoot") + } + + var r0 *big.Int + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts, [32]byte) (*big.Int, error)); ok { + return rf(opts, root) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts, [32]byte) *big.Int); ok { + r0 = rf(opts, root) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*big.Int) + } + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts, [32]byte) error); ok { + r1 = rf(opts, root) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// CommitStoreInterface_GetMerkleRoot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetMerkleRoot' +type CommitStoreInterface_GetMerkleRoot_Call struct { + *mock.Call +} + +// GetMerkleRoot is a helper method to define mock.On call +// - opts *bind.CallOpts +// - root [32]byte +func (_e *CommitStoreInterface_Expecter) GetMerkleRoot(opts interface{}, root interface{}) *CommitStoreInterface_GetMerkleRoot_Call { + return &CommitStoreInterface_GetMerkleRoot_Call{Call: _e.mock.On("GetMerkleRoot", opts, root)} +} + +func (_c *CommitStoreInterface_GetMerkleRoot_Call) Run(run func(opts *bind.CallOpts, root [32]byte)) *CommitStoreInterface_GetMerkleRoot_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts), args[1].([32]byte)) + }) + return _c +} + +func (_c *CommitStoreInterface_GetMerkleRoot_Call) Return(_a0 *big.Int, _a1 error) *CommitStoreInterface_GetMerkleRoot_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *CommitStoreInterface_GetMerkleRoot_Call) RunAndReturn(run func(*bind.CallOpts, [32]byte) (*big.Int, error)) *CommitStoreInterface_GetMerkleRoot_Call { + _c.Call.Return(run) + return _c +} + +// GetStaticConfig provides a mock function with given fields: opts +func (_m *CommitStoreInterface) GetStaticConfig(opts *bind.CallOpts) (commit_store.CommitStoreStaticConfig, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for GetStaticConfig") + } + + var r0 commit_store.CommitStoreStaticConfig + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts) (commit_store.CommitStoreStaticConfig, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts) commit_store.CommitStoreStaticConfig); ok { + r0 = rf(opts) + } else { + r0 = ret.Get(0).(commit_store.CommitStoreStaticConfig) + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// CommitStoreInterface_GetStaticConfig_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetStaticConfig' +type CommitStoreInterface_GetStaticConfig_Call struct { + *mock.Call +} + +// GetStaticConfig is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *CommitStoreInterface_Expecter) GetStaticConfig(opts interface{}) *CommitStoreInterface_GetStaticConfig_Call { + return &CommitStoreInterface_GetStaticConfig_Call{Call: _e.mock.On("GetStaticConfig", opts)} +} + +func (_c *CommitStoreInterface_GetStaticConfig_Call) Run(run func(opts *bind.CallOpts)) *CommitStoreInterface_GetStaticConfig_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *CommitStoreInterface_GetStaticConfig_Call) Return(_a0 commit_store.CommitStoreStaticConfig, _a1 error) *CommitStoreInterface_GetStaticConfig_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *CommitStoreInterface_GetStaticConfig_Call) RunAndReturn(run func(*bind.CallOpts) (commit_store.CommitStoreStaticConfig, error)) *CommitStoreInterface_GetStaticConfig_Call { + _c.Call.Return(run) + return _c +} + +// GetTransmitters provides a mock function with given fields: opts +func (_m *CommitStoreInterface) GetTransmitters(opts *bind.CallOpts) ([]common.Address, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for GetTransmitters") + } + + var r0 []common.Address + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts) ([]common.Address, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts) []common.Address); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]common.Address) + } + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// CommitStoreInterface_GetTransmitters_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetTransmitters' +type CommitStoreInterface_GetTransmitters_Call struct { + *mock.Call +} + +// GetTransmitters is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *CommitStoreInterface_Expecter) GetTransmitters(opts interface{}) *CommitStoreInterface_GetTransmitters_Call { + return &CommitStoreInterface_GetTransmitters_Call{Call: _e.mock.On("GetTransmitters", opts)} +} + +func (_c *CommitStoreInterface_GetTransmitters_Call) Run(run func(opts *bind.CallOpts)) *CommitStoreInterface_GetTransmitters_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *CommitStoreInterface_GetTransmitters_Call) Return(_a0 []common.Address, _a1 error) *CommitStoreInterface_GetTransmitters_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *CommitStoreInterface_GetTransmitters_Call) RunAndReturn(run func(*bind.CallOpts) ([]common.Address, error)) *CommitStoreInterface_GetTransmitters_Call { + _c.Call.Return(run) + return _c +} + +// IsBlessed provides a mock function with given fields: opts, root +func (_m *CommitStoreInterface) IsBlessed(opts *bind.CallOpts, root [32]byte) (bool, error) { + ret := _m.Called(opts, root) + + if len(ret) == 0 { + panic("no return value specified for IsBlessed") + } + + var r0 bool + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts, [32]byte) (bool, error)); ok { + return rf(opts, root) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts, [32]byte) bool); ok { + r0 = rf(opts, root) + } else { + r0 = ret.Get(0).(bool) + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts, [32]byte) error); ok { + r1 = rf(opts, root) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// CommitStoreInterface_IsBlessed_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsBlessed' +type CommitStoreInterface_IsBlessed_Call struct { + *mock.Call +} + +// IsBlessed is a helper method to define mock.On call +// - opts *bind.CallOpts +// - root [32]byte +func (_e *CommitStoreInterface_Expecter) IsBlessed(opts interface{}, root interface{}) *CommitStoreInterface_IsBlessed_Call { + return &CommitStoreInterface_IsBlessed_Call{Call: _e.mock.On("IsBlessed", opts, root)} +} + +func (_c *CommitStoreInterface_IsBlessed_Call) Run(run func(opts *bind.CallOpts, root [32]byte)) *CommitStoreInterface_IsBlessed_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts), args[1].([32]byte)) + }) + return _c +} + +func (_c *CommitStoreInterface_IsBlessed_Call) Return(_a0 bool, _a1 error) *CommitStoreInterface_IsBlessed_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *CommitStoreInterface_IsBlessed_Call) RunAndReturn(run func(*bind.CallOpts, [32]byte) (bool, error)) *CommitStoreInterface_IsBlessed_Call { + _c.Call.Return(run) + return _c +} + +// IsUnpausedAndNotCursed provides a mock function with given fields: opts +func (_m *CommitStoreInterface) IsUnpausedAndNotCursed(opts *bind.CallOpts) (bool, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for IsUnpausedAndNotCursed") + } + + var r0 bool + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts) (bool, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts) bool); ok { + r0 = rf(opts) + } else { + r0 = ret.Get(0).(bool) + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// CommitStoreInterface_IsUnpausedAndNotCursed_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsUnpausedAndNotCursed' +type CommitStoreInterface_IsUnpausedAndNotCursed_Call struct { + *mock.Call +} + +// IsUnpausedAndNotCursed is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *CommitStoreInterface_Expecter) IsUnpausedAndNotCursed(opts interface{}) *CommitStoreInterface_IsUnpausedAndNotCursed_Call { + return &CommitStoreInterface_IsUnpausedAndNotCursed_Call{Call: _e.mock.On("IsUnpausedAndNotCursed", opts)} +} + +func (_c *CommitStoreInterface_IsUnpausedAndNotCursed_Call) Run(run func(opts *bind.CallOpts)) *CommitStoreInterface_IsUnpausedAndNotCursed_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *CommitStoreInterface_IsUnpausedAndNotCursed_Call) Return(_a0 bool, _a1 error) *CommitStoreInterface_IsUnpausedAndNotCursed_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *CommitStoreInterface_IsUnpausedAndNotCursed_Call) RunAndReturn(run func(*bind.CallOpts) (bool, error)) *CommitStoreInterface_IsUnpausedAndNotCursed_Call { + _c.Call.Return(run) + return _c +} + +// LatestConfigDetails provides a mock function with given fields: opts +func (_m *CommitStoreInterface) LatestConfigDetails(opts *bind.CallOpts) (commit_store.LatestConfigDetails, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for LatestConfigDetails") + } + + var r0 commit_store.LatestConfigDetails + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts) (commit_store.LatestConfigDetails, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts) commit_store.LatestConfigDetails); ok { + r0 = rf(opts) + } else { + r0 = ret.Get(0).(commit_store.LatestConfigDetails) + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// CommitStoreInterface_LatestConfigDetails_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LatestConfigDetails' +type CommitStoreInterface_LatestConfigDetails_Call struct { + *mock.Call +} + +// LatestConfigDetails is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *CommitStoreInterface_Expecter) LatestConfigDetails(opts interface{}) *CommitStoreInterface_LatestConfigDetails_Call { + return &CommitStoreInterface_LatestConfigDetails_Call{Call: _e.mock.On("LatestConfigDetails", opts)} +} + +func (_c *CommitStoreInterface_LatestConfigDetails_Call) Run(run func(opts *bind.CallOpts)) *CommitStoreInterface_LatestConfigDetails_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *CommitStoreInterface_LatestConfigDetails_Call) Return(_a0 commit_store.LatestConfigDetails, _a1 error) *CommitStoreInterface_LatestConfigDetails_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *CommitStoreInterface_LatestConfigDetails_Call) RunAndReturn(run func(*bind.CallOpts) (commit_store.LatestConfigDetails, error)) *CommitStoreInterface_LatestConfigDetails_Call { + _c.Call.Return(run) + return _c +} + +// LatestConfigDigestAndEpoch provides a mock function with given fields: opts +func (_m *CommitStoreInterface) LatestConfigDigestAndEpoch(opts *bind.CallOpts) (commit_store.LatestConfigDigestAndEpoch, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for LatestConfigDigestAndEpoch") + } + + var r0 commit_store.LatestConfigDigestAndEpoch + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts) (commit_store.LatestConfigDigestAndEpoch, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts) commit_store.LatestConfigDigestAndEpoch); ok { + r0 = rf(opts) + } else { + r0 = ret.Get(0).(commit_store.LatestConfigDigestAndEpoch) + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// CommitStoreInterface_LatestConfigDigestAndEpoch_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LatestConfigDigestAndEpoch' +type CommitStoreInterface_LatestConfigDigestAndEpoch_Call struct { + *mock.Call +} + +// LatestConfigDigestAndEpoch is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *CommitStoreInterface_Expecter) LatestConfigDigestAndEpoch(opts interface{}) *CommitStoreInterface_LatestConfigDigestAndEpoch_Call { + return &CommitStoreInterface_LatestConfigDigestAndEpoch_Call{Call: _e.mock.On("LatestConfigDigestAndEpoch", opts)} +} + +func (_c *CommitStoreInterface_LatestConfigDigestAndEpoch_Call) Run(run func(opts *bind.CallOpts)) *CommitStoreInterface_LatestConfigDigestAndEpoch_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *CommitStoreInterface_LatestConfigDigestAndEpoch_Call) Return(_a0 commit_store.LatestConfigDigestAndEpoch, _a1 error) *CommitStoreInterface_LatestConfigDigestAndEpoch_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *CommitStoreInterface_LatestConfigDigestAndEpoch_Call) RunAndReturn(run func(*bind.CallOpts) (commit_store.LatestConfigDigestAndEpoch, error)) *CommitStoreInterface_LatestConfigDigestAndEpoch_Call { + _c.Call.Return(run) + return _c +} + +// Owner provides a mock function with given fields: opts +func (_m *CommitStoreInterface) Owner(opts *bind.CallOpts) (common.Address, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for Owner") + } + + var r0 common.Address + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts) (common.Address, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts) common.Address); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Address) + } + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// CommitStoreInterface_Owner_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Owner' +type CommitStoreInterface_Owner_Call struct { + *mock.Call +} + +// Owner is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *CommitStoreInterface_Expecter) Owner(opts interface{}) *CommitStoreInterface_Owner_Call { + return &CommitStoreInterface_Owner_Call{Call: _e.mock.On("Owner", opts)} +} + +func (_c *CommitStoreInterface_Owner_Call) Run(run func(opts *bind.CallOpts)) *CommitStoreInterface_Owner_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *CommitStoreInterface_Owner_Call) Return(_a0 common.Address, _a1 error) *CommitStoreInterface_Owner_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *CommitStoreInterface_Owner_Call) RunAndReturn(run func(*bind.CallOpts) (common.Address, error)) *CommitStoreInterface_Owner_Call { + _c.Call.Return(run) + return _c +} + +// ParseConfigSet provides a mock function with given fields: log +func (_m *CommitStoreInterface) ParseConfigSet(log types.Log) (*commit_store.CommitStoreConfigSet, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParseConfigSet") + } + + var r0 *commit_store.CommitStoreConfigSet + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (*commit_store.CommitStoreConfigSet, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) *commit_store.CommitStoreConfigSet); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*commit_store.CommitStoreConfigSet) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// CommitStoreInterface_ParseConfigSet_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseConfigSet' +type CommitStoreInterface_ParseConfigSet_Call struct { + *mock.Call +} + +// ParseConfigSet is a helper method to define mock.On call +// - log types.Log +func (_e *CommitStoreInterface_Expecter) ParseConfigSet(log interface{}) *CommitStoreInterface_ParseConfigSet_Call { + return &CommitStoreInterface_ParseConfigSet_Call{Call: _e.mock.On("ParseConfigSet", log)} +} + +func (_c *CommitStoreInterface_ParseConfigSet_Call) Run(run func(log types.Log)) *CommitStoreInterface_ParseConfigSet_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *CommitStoreInterface_ParseConfigSet_Call) Return(_a0 *commit_store.CommitStoreConfigSet, _a1 error) *CommitStoreInterface_ParseConfigSet_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *CommitStoreInterface_ParseConfigSet_Call) RunAndReturn(run func(types.Log) (*commit_store.CommitStoreConfigSet, error)) *CommitStoreInterface_ParseConfigSet_Call { + _c.Call.Return(run) + return _c +} + +// ParseConfigSet0 provides a mock function with given fields: log +func (_m *CommitStoreInterface) ParseConfigSet0(log types.Log) (*commit_store.CommitStoreConfigSet0, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParseConfigSet0") + } + + var r0 *commit_store.CommitStoreConfigSet0 + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (*commit_store.CommitStoreConfigSet0, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) *commit_store.CommitStoreConfigSet0); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*commit_store.CommitStoreConfigSet0) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// CommitStoreInterface_ParseConfigSet0_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseConfigSet0' +type CommitStoreInterface_ParseConfigSet0_Call struct { + *mock.Call +} + +// ParseConfigSet0 is a helper method to define mock.On call +// - log types.Log +func (_e *CommitStoreInterface_Expecter) ParseConfigSet0(log interface{}) *CommitStoreInterface_ParseConfigSet0_Call { + return &CommitStoreInterface_ParseConfigSet0_Call{Call: _e.mock.On("ParseConfigSet0", log)} +} + +func (_c *CommitStoreInterface_ParseConfigSet0_Call) Run(run func(log types.Log)) *CommitStoreInterface_ParseConfigSet0_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *CommitStoreInterface_ParseConfigSet0_Call) Return(_a0 *commit_store.CommitStoreConfigSet0, _a1 error) *CommitStoreInterface_ParseConfigSet0_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *CommitStoreInterface_ParseConfigSet0_Call) RunAndReturn(run func(types.Log) (*commit_store.CommitStoreConfigSet0, error)) *CommitStoreInterface_ParseConfigSet0_Call { + _c.Call.Return(run) + return _c +} + +// ParseLatestPriceEpochAndRoundSet provides a mock function with given fields: log +func (_m *CommitStoreInterface) ParseLatestPriceEpochAndRoundSet(log types.Log) (*commit_store.CommitStoreLatestPriceEpochAndRoundSet, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParseLatestPriceEpochAndRoundSet") + } + + var r0 *commit_store.CommitStoreLatestPriceEpochAndRoundSet + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (*commit_store.CommitStoreLatestPriceEpochAndRoundSet, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) *commit_store.CommitStoreLatestPriceEpochAndRoundSet); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*commit_store.CommitStoreLatestPriceEpochAndRoundSet) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// CommitStoreInterface_ParseLatestPriceEpochAndRoundSet_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseLatestPriceEpochAndRoundSet' +type CommitStoreInterface_ParseLatestPriceEpochAndRoundSet_Call struct { + *mock.Call +} + +// ParseLatestPriceEpochAndRoundSet is a helper method to define mock.On call +// - log types.Log +func (_e *CommitStoreInterface_Expecter) ParseLatestPriceEpochAndRoundSet(log interface{}) *CommitStoreInterface_ParseLatestPriceEpochAndRoundSet_Call { + return &CommitStoreInterface_ParseLatestPriceEpochAndRoundSet_Call{Call: _e.mock.On("ParseLatestPriceEpochAndRoundSet", log)} +} + +func (_c *CommitStoreInterface_ParseLatestPriceEpochAndRoundSet_Call) Run(run func(log types.Log)) *CommitStoreInterface_ParseLatestPriceEpochAndRoundSet_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *CommitStoreInterface_ParseLatestPriceEpochAndRoundSet_Call) Return(_a0 *commit_store.CommitStoreLatestPriceEpochAndRoundSet, _a1 error) *CommitStoreInterface_ParseLatestPriceEpochAndRoundSet_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *CommitStoreInterface_ParseLatestPriceEpochAndRoundSet_Call) RunAndReturn(run func(types.Log) (*commit_store.CommitStoreLatestPriceEpochAndRoundSet, error)) *CommitStoreInterface_ParseLatestPriceEpochAndRoundSet_Call { + _c.Call.Return(run) + return _c +} + +// ParseLog provides a mock function with given fields: log +func (_m *CommitStoreInterface) ParseLog(log types.Log) (generated.AbigenLog, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParseLog") + } + + var r0 generated.AbigenLog + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (generated.AbigenLog, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) generated.AbigenLog); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(generated.AbigenLog) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// CommitStoreInterface_ParseLog_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseLog' +type CommitStoreInterface_ParseLog_Call struct { + *mock.Call +} + +// ParseLog is a helper method to define mock.On call +// - log types.Log +func (_e *CommitStoreInterface_Expecter) ParseLog(log interface{}) *CommitStoreInterface_ParseLog_Call { + return &CommitStoreInterface_ParseLog_Call{Call: _e.mock.On("ParseLog", log)} +} + +func (_c *CommitStoreInterface_ParseLog_Call) Run(run func(log types.Log)) *CommitStoreInterface_ParseLog_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *CommitStoreInterface_ParseLog_Call) Return(_a0 generated.AbigenLog, _a1 error) *CommitStoreInterface_ParseLog_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *CommitStoreInterface_ParseLog_Call) RunAndReturn(run func(types.Log) (generated.AbigenLog, error)) *CommitStoreInterface_ParseLog_Call { + _c.Call.Return(run) + return _c +} + +// ParseOwnershipTransferRequested provides a mock function with given fields: log +func (_m *CommitStoreInterface) ParseOwnershipTransferRequested(log types.Log) (*commit_store.CommitStoreOwnershipTransferRequested, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParseOwnershipTransferRequested") + } + + var r0 *commit_store.CommitStoreOwnershipTransferRequested + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (*commit_store.CommitStoreOwnershipTransferRequested, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) *commit_store.CommitStoreOwnershipTransferRequested); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*commit_store.CommitStoreOwnershipTransferRequested) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// CommitStoreInterface_ParseOwnershipTransferRequested_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseOwnershipTransferRequested' +type CommitStoreInterface_ParseOwnershipTransferRequested_Call struct { + *mock.Call +} + +// ParseOwnershipTransferRequested is a helper method to define mock.On call +// - log types.Log +func (_e *CommitStoreInterface_Expecter) ParseOwnershipTransferRequested(log interface{}) *CommitStoreInterface_ParseOwnershipTransferRequested_Call { + return &CommitStoreInterface_ParseOwnershipTransferRequested_Call{Call: _e.mock.On("ParseOwnershipTransferRequested", log)} +} + +func (_c *CommitStoreInterface_ParseOwnershipTransferRequested_Call) Run(run func(log types.Log)) *CommitStoreInterface_ParseOwnershipTransferRequested_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *CommitStoreInterface_ParseOwnershipTransferRequested_Call) Return(_a0 *commit_store.CommitStoreOwnershipTransferRequested, _a1 error) *CommitStoreInterface_ParseOwnershipTransferRequested_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *CommitStoreInterface_ParseOwnershipTransferRequested_Call) RunAndReturn(run func(types.Log) (*commit_store.CommitStoreOwnershipTransferRequested, error)) *CommitStoreInterface_ParseOwnershipTransferRequested_Call { + _c.Call.Return(run) + return _c +} + +// ParseOwnershipTransferred provides a mock function with given fields: log +func (_m *CommitStoreInterface) ParseOwnershipTransferred(log types.Log) (*commit_store.CommitStoreOwnershipTransferred, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParseOwnershipTransferred") + } + + var r0 *commit_store.CommitStoreOwnershipTransferred + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (*commit_store.CommitStoreOwnershipTransferred, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) *commit_store.CommitStoreOwnershipTransferred); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*commit_store.CommitStoreOwnershipTransferred) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// CommitStoreInterface_ParseOwnershipTransferred_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseOwnershipTransferred' +type CommitStoreInterface_ParseOwnershipTransferred_Call struct { + *mock.Call +} + +// ParseOwnershipTransferred is a helper method to define mock.On call +// - log types.Log +func (_e *CommitStoreInterface_Expecter) ParseOwnershipTransferred(log interface{}) *CommitStoreInterface_ParseOwnershipTransferred_Call { + return &CommitStoreInterface_ParseOwnershipTransferred_Call{Call: _e.mock.On("ParseOwnershipTransferred", log)} +} + +func (_c *CommitStoreInterface_ParseOwnershipTransferred_Call) Run(run func(log types.Log)) *CommitStoreInterface_ParseOwnershipTransferred_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *CommitStoreInterface_ParseOwnershipTransferred_Call) Return(_a0 *commit_store.CommitStoreOwnershipTransferred, _a1 error) *CommitStoreInterface_ParseOwnershipTransferred_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *CommitStoreInterface_ParseOwnershipTransferred_Call) RunAndReturn(run func(types.Log) (*commit_store.CommitStoreOwnershipTransferred, error)) *CommitStoreInterface_ParseOwnershipTransferred_Call { + _c.Call.Return(run) + return _c +} + +// ParsePaused provides a mock function with given fields: log +func (_m *CommitStoreInterface) ParsePaused(log types.Log) (*commit_store.CommitStorePaused, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParsePaused") + } + + var r0 *commit_store.CommitStorePaused + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (*commit_store.CommitStorePaused, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) *commit_store.CommitStorePaused); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*commit_store.CommitStorePaused) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// CommitStoreInterface_ParsePaused_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParsePaused' +type CommitStoreInterface_ParsePaused_Call struct { + *mock.Call +} + +// ParsePaused is a helper method to define mock.On call +// - log types.Log +func (_e *CommitStoreInterface_Expecter) ParsePaused(log interface{}) *CommitStoreInterface_ParsePaused_Call { + return &CommitStoreInterface_ParsePaused_Call{Call: _e.mock.On("ParsePaused", log)} +} + +func (_c *CommitStoreInterface_ParsePaused_Call) Run(run func(log types.Log)) *CommitStoreInterface_ParsePaused_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *CommitStoreInterface_ParsePaused_Call) Return(_a0 *commit_store.CommitStorePaused, _a1 error) *CommitStoreInterface_ParsePaused_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *CommitStoreInterface_ParsePaused_Call) RunAndReturn(run func(types.Log) (*commit_store.CommitStorePaused, error)) *CommitStoreInterface_ParsePaused_Call { + _c.Call.Return(run) + return _c +} + +// ParseReportAccepted provides a mock function with given fields: log +func (_m *CommitStoreInterface) ParseReportAccepted(log types.Log) (*commit_store.CommitStoreReportAccepted, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParseReportAccepted") + } + + var r0 *commit_store.CommitStoreReportAccepted + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (*commit_store.CommitStoreReportAccepted, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) *commit_store.CommitStoreReportAccepted); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*commit_store.CommitStoreReportAccepted) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// CommitStoreInterface_ParseReportAccepted_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseReportAccepted' +type CommitStoreInterface_ParseReportAccepted_Call struct { + *mock.Call +} + +// ParseReportAccepted is a helper method to define mock.On call +// - log types.Log +func (_e *CommitStoreInterface_Expecter) ParseReportAccepted(log interface{}) *CommitStoreInterface_ParseReportAccepted_Call { + return &CommitStoreInterface_ParseReportAccepted_Call{Call: _e.mock.On("ParseReportAccepted", log)} +} + +func (_c *CommitStoreInterface_ParseReportAccepted_Call) Run(run func(log types.Log)) *CommitStoreInterface_ParseReportAccepted_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *CommitStoreInterface_ParseReportAccepted_Call) Return(_a0 *commit_store.CommitStoreReportAccepted, _a1 error) *CommitStoreInterface_ParseReportAccepted_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *CommitStoreInterface_ParseReportAccepted_Call) RunAndReturn(run func(types.Log) (*commit_store.CommitStoreReportAccepted, error)) *CommitStoreInterface_ParseReportAccepted_Call { + _c.Call.Return(run) + return _c +} + +// ParseRootRemoved provides a mock function with given fields: log +func (_m *CommitStoreInterface) ParseRootRemoved(log types.Log) (*commit_store.CommitStoreRootRemoved, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParseRootRemoved") + } + + var r0 *commit_store.CommitStoreRootRemoved + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (*commit_store.CommitStoreRootRemoved, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) *commit_store.CommitStoreRootRemoved); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*commit_store.CommitStoreRootRemoved) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// CommitStoreInterface_ParseRootRemoved_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseRootRemoved' +type CommitStoreInterface_ParseRootRemoved_Call struct { + *mock.Call +} + +// ParseRootRemoved is a helper method to define mock.On call +// - log types.Log +func (_e *CommitStoreInterface_Expecter) ParseRootRemoved(log interface{}) *CommitStoreInterface_ParseRootRemoved_Call { + return &CommitStoreInterface_ParseRootRemoved_Call{Call: _e.mock.On("ParseRootRemoved", log)} +} + +func (_c *CommitStoreInterface_ParseRootRemoved_Call) Run(run func(log types.Log)) *CommitStoreInterface_ParseRootRemoved_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *CommitStoreInterface_ParseRootRemoved_Call) Return(_a0 *commit_store.CommitStoreRootRemoved, _a1 error) *CommitStoreInterface_ParseRootRemoved_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *CommitStoreInterface_ParseRootRemoved_Call) RunAndReturn(run func(types.Log) (*commit_store.CommitStoreRootRemoved, error)) *CommitStoreInterface_ParseRootRemoved_Call { + _c.Call.Return(run) + return _c +} + +// ParseSequenceNumberSet provides a mock function with given fields: log +func (_m *CommitStoreInterface) ParseSequenceNumberSet(log types.Log) (*commit_store.CommitStoreSequenceNumberSet, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParseSequenceNumberSet") + } + + var r0 *commit_store.CommitStoreSequenceNumberSet + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (*commit_store.CommitStoreSequenceNumberSet, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) *commit_store.CommitStoreSequenceNumberSet); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*commit_store.CommitStoreSequenceNumberSet) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// CommitStoreInterface_ParseSequenceNumberSet_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseSequenceNumberSet' +type CommitStoreInterface_ParseSequenceNumberSet_Call struct { + *mock.Call +} + +// ParseSequenceNumberSet is a helper method to define mock.On call +// - log types.Log +func (_e *CommitStoreInterface_Expecter) ParseSequenceNumberSet(log interface{}) *CommitStoreInterface_ParseSequenceNumberSet_Call { + return &CommitStoreInterface_ParseSequenceNumberSet_Call{Call: _e.mock.On("ParseSequenceNumberSet", log)} +} + +func (_c *CommitStoreInterface_ParseSequenceNumberSet_Call) Run(run func(log types.Log)) *CommitStoreInterface_ParseSequenceNumberSet_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *CommitStoreInterface_ParseSequenceNumberSet_Call) Return(_a0 *commit_store.CommitStoreSequenceNumberSet, _a1 error) *CommitStoreInterface_ParseSequenceNumberSet_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *CommitStoreInterface_ParseSequenceNumberSet_Call) RunAndReturn(run func(types.Log) (*commit_store.CommitStoreSequenceNumberSet, error)) *CommitStoreInterface_ParseSequenceNumberSet_Call { + _c.Call.Return(run) + return _c +} + +// ParseTransmitted provides a mock function with given fields: log +func (_m *CommitStoreInterface) ParseTransmitted(log types.Log) (*commit_store.CommitStoreTransmitted, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParseTransmitted") + } + + var r0 *commit_store.CommitStoreTransmitted + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (*commit_store.CommitStoreTransmitted, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) *commit_store.CommitStoreTransmitted); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*commit_store.CommitStoreTransmitted) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// CommitStoreInterface_ParseTransmitted_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseTransmitted' +type CommitStoreInterface_ParseTransmitted_Call struct { + *mock.Call +} + +// ParseTransmitted is a helper method to define mock.On call +// - log types.Log +func (_e *CommitStoreInterface_Expecter) ParseTransmitted(log interface{}) *CommitStoreInterface_ParseTransmitted_Call { + return &CommitStoreInterface_ParseTransmitted_Call{Call: _e.mock.On("ParseTransmitted", log)} +} + +func (_c *CommitStoreInterface_ParseTransmitted_Call) Run(run func(log types.Log)) *CommitStoreInterface_ParseTransmitted_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *CommitStoreInterface_ParseTransmitted_Call) Return(_a0 *commit_store.CommitStoreTransmitted, _a1 error) *CommitStoreInterface_ParseTransmitted_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *CommitStoreInterface_ParseTransmitted_Call) RunAndReturn(run func(types.Log) (*commit_store.CommitStoreTransmitted, error)) *CommitStoreInterface_ParseTransmitted_Call { + _c.Call.Return(run) + return _c +} + +// ParseUnpaused provides a mock function with given fields: log +func (_m *CommitStoreInterface) ParseUnpaused(log types.Log) (*commit_store.CommitStoreUnpaused, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParseUnpaused") + } + + var r0 *commit_store.CommitStoreUnpaused + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (*commit_store.CommitStoreUnpaused, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) *commit_store.CommitStoreUnpaused); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*commit_store.CommitStoreUnpaused) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// CommitStoreInterface_ParseUnpaused_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseUnpaused' +type CommitStoreInterface_ParseUnpaused_Call struct { + *mock.Call +} + +// ParseUnpaused is a helper method to define mock.On call +// - log types.Log +func (_e *CommitStoreInterface_Expecter) ParseUnpaused(log interface{}) *CommitStoreInterface_ParseUnpaused_Call { + return &CommitStoreInterface_ParseUnpaused_Call{Call: _e.mock.On("ParseUnpaused", log)} +} + +func (_c *CommitStoreInterface_ParseUnpaused_Call) Run(run func(log types.Log)) *CommitStoreInterface_ParseUnpaused_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *CommitStoreInterface_ParseUnpaused_Call) Return(_a0 *commit_store.CommitStoreUnpaused, _a1 error) *CommitStoreInterface_ParseUnpaused_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *CommitStoreInterface_ParseUnpaused_Call) RunAndReturn(run func(types.Log) (*commit_store.CommitStoreUnpaused, error)) *CommitStoreInterface_ParseUnpaused_Call { + _c.Call.Return(run) + return _c +} + +// Pause provides a mock function with given fields: opts +func (_m *CommitStoreInterface) Pause(opts *bind.TransactOpts) (*types.Transaction, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for Pause") + } + + var r0 *types.Transaction + var r1 error + if rf, ok := ret.Get(0).(func(*bind.TransactOpts) (*types.Transaction, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.TransactOpts) *types.Transaction); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Transaction) + } + } + + if rf, ok := ret.Get(1).(func(*bind.TransactOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// CommitStoreInterface_Pause_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Pause' +type CommitStoreInterface_Pause_Call struct { + *mock.Call +} + +// Pause is a helper method to define mock.On call +// - opts *bind.TransactOpts +func (_e *CommitStoreInterface_Expecter) Pause(opts interface{}) *CommitStoreInterface_Pause_Call { + return &CommitStoreInterface_Pause_Call{Call: _e.mock.On("Pause", opts)} +} + +func (_c *CommitStoreInterface_Pause_Call) Run(run func(opts *bind.TransactOpts)) *CommitStoreInterface_Pause_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts)) + }) + return _c +} + +func (_c *CommitStoreInterface_Pause_Call) Return(_a0 *types.Transaction, _a1 error) *CommitStoreInterface_Pause_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *CommitStoreInterface_Pause_Call) RunAndReturn(run func(*bind.TransactOpts) (*types.Transaction, error)) *CommitStoreInterface_Pause_Call { + _c.Call.Return(run) + return _c +} + +// Paused provides a mock function with given fields: opts +func (_m *CommitStoreInterface) Paused(opts *bind.CallOpts) (bool, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for Paused") + } + + var r0 bool + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts) (bool, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts) bool); ok { + r0 = rf(opts) + } else { + r0 = ret.Get(0).(bool) + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// CommitStoreInterface_Paused_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Paused' +type CommitStoreInterface_Paused_Call struct { + *mock.Call +} + +// Paused is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *CommitStoreInterface_Expecter) Paused(opts interface{}) *CommitStoreInterface_Paused_Call { + return &CommitStoreInterface_Paused_Call{Call: _e.mock.On("Paused", opts)} +} + +func (_c *CommitStoreInterface_Paused_Call) Run(run func(opts *bind.CallOpts)) *CommitStoreInterface_Paused_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *CommitStoreInterface_Paused_Call) Return(_a0 bool, _a1 error) *CommitStoreInterface_Paused_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *CommitStoreInterface_Paused_Call) RunAndReturn(run func(*bind.CallOpts) (bool, error)) *CommitStoreInterface_Paused_Call { + _c.Call.Return(run) + return _c +} + +// ResetUnblessedRoots provides a mock function with given fields: opts, rootToReset +func (_m *CommitStoreInterface) ResetUnblessedRoots(opts *bind.TransactOpts, rootToReset [][32]byte) (*types.Transaction, error) { + ret := _m.Called(opts, rootToReset) + + if len(ret) == 0 { + panic("no return value specified for ResetUnblessedRoots") + } + + var r0 *types.Transaction + var r1 error + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, [][32]byte) (*types.Transaction, error)); ok { + return rf(opts, rootToReset) + } + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, [][32]byte) *types.Transaction); ok { + r0 = rf(opts, rootToReset) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Transaction) + } + } + + if rf, ok := ret.Get(1).(func(*bind.TransactOpts, [][32]byte) error); ok { + r1 = rf(opts, rootToReset) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// CommitStoreInterface_ResetUnblessedRoots_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ResetUnblessedRoots' +type CommitStoreInterface_ResetUnblessedRoots_Call struct { + *mock.Call +} + +// ResetUnblessedRoots is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - rootToReset [][32]byte +func (_e *CommitStoreInterface_Expecter) ResetUnblessedRoots(opts interface{}, rootToReset interface{}) *CommitStoreInterface_ResetUnblessedRoots_Call { + return &CommitStoreInterface_ResetUnblessedRoots_Call{Call: _e.mock.On("ResetUnblessedRoots", opts, rootToReset)} +} + +func (_c *CommitStoreInterface_ResetUnblessedRoots_Call) Run(run func(opts *bind.TransactOpts, rootToReset [][32]byte)) *CommitStoreInterface_ResetUnblessedRoots_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].([][32]byte)) + }) + return _c +} + +func (_c *CommitStoreInterface_ResetUnblessedRoots_Call) Return(_a0 *types.Transaction, _a1 error) *CommitStoreInterface_ResetUnblessedRoots_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *CommitStoreInterface_ResetUnblessedRoots_Call) RunAndReturn(run func(*bind.TransactOpts, [][32]byte) (*types.Transaction, error)) *CommitStoreInterface_ResetUnblessedRoots_Call { + _c.Call.Return(run) + return _c +} + +// SetLatestPriceEpochAndRound provides a mock function with given fields: opts, latestPriceEpochAndRound +func (_m *CommitStoreInterface) SetLatestPriceEpochAndRound(opts *bind.TransactOpts, latestPriceEpochAndRound *big.Int) (*types.Transaction, error) { + ret := _m.Called(opts, latestPriceEpochAndRound) + + if len(ret) == 0 { + panic("no return value specified for SetLatestPriceEpochAndRound") + } + + var r0 *types.Transaction + var r1 error + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, *big.Int) (*types.Transaction, error)); ok { + return rf(opts, latestPriceEpochAndRound) + } + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, *big.Int) *types.Transaction); ok { + r0 = rf(opts, latestPriceEpochAndRound) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Transaction) + } + } + + if rf, ok := ret.Get(1).(func(*bind.TransactOpts, *big.Int) error); ok { + r1 = rf(opts, latestPriceEpochAndRound) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// CommitStoreInterface_SetLatestPriceEpochAndRound_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetLatestPriceEpochAndRound' +type CommitStoreInterface_SetLatestPriceEpochAndRound_Call struct { + *mock.Call +} + +// SetLatestPriceEpochAndRound is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - latestPriceEpochAndRound *big.Int +func (_e *CommitStoreInterface_Expecter) SetLatestPriceEpochAndRound(opts interface{}, latestPriceEpochAndRound interface{}) *CommitStoreInterface_SetLatestPriceEpochAndRound_Call { + return &CommitStoreInterface_SetLatestPriceEpochAndRound_Call{Call: _e.mock.On("SetLatestPriceEpochAndRound", opts, latestPriceEpochAndRound)} +} + +func (_c *CommitStoreInterface_SetLatestPriceEpochAndRound_Call) Run(run func(opts *bind.TransactOpts, latestPriceEpochAndRound *big.Int)) *CommitStoreInterface_SetLatestPriceEpochAndRound_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].(*big.Int)) + }) + return _c +} + +func (_c *CommitStoreInterface_SetLatestPriceEpochAndRound_Call) Return(_a0 *types.Transaction, _a1 error) *CommitStoreInterface_SetLatestPriceEpochAndRound_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *CommitStoreInterface_SetLatestPriceEpochAndRound_Call) RunAndReturn(run func(*bind.TransactOpts, *big.Int) (*types.Transaction, error)) *CommitStoreInterface_SetLatestPriceEpochAndRound_Call { + _c.Call.Return(run) + return _c +} + +// SetMinSeqNr provides a mock function with given fields: opts, minSeqNr +func (_m *CommitStoreInterface) SetMinSeqNr(opts *bind.TransactOpts, minSeqNr uint64) (*types.Transaction, error) { + ret := _m.Called(opts, minSeqNr) + + if len(ret) == 0 { + panic("no return value specified for SetMinSeqNr") + } + + var r0 *types.Transaction + var r1 error + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, uint64) (*types.Transaction, error)); ok { + return rf(opts, minSeqNr) + } + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, uint64) *types.Transaction); ok { + r0 = rf(opts, minSeqNr) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Transaction) + } + } + + if rf, ok := ret.Get(1).(func(*bind.TransactOpts, uint64) error); ok { + r1 = rf(opts, minSeqNr) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// CommitStoreInterface_SetMinSeqNr_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetMinSeqNr' +type CommitStoreInterface_SetMinSeqNr_Call struct { + *mock.Call +} + +// SetMinSeqNr is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - minSeqNr uint64 +func (_e *CommitStoreInterface_Expecter) SetMinSeqNr(opts interface{}, minSeqNr interface{}) *CommitStoreInterface_SetMinSeqNr_Call { + return &CommitStoreInterface_SetMinSeqNr_Call{Call: _e.mock.On("SetMinSeqNr", opts, minSeqNr)} +} + +func (_c *CommitStoreInterface_SetMinSeqNr_Call) Run(run func(opts *bind.TransactOpts, minSeqNr uint64)) *CommitStoreInterface_SetMinSeqNr_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].(uint64)) + }) + return _c +} + +func (_c *CommitStoreInterface_SetMinSeqNr_Call) Return(_a0 *types.Transaction, _a1 error) *CommitStoreInterface_SetMinSeqNr_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *CommitStoreInterface_SetMinSeqNr_Call) RunAndReturn(run func(*bind.TransactOpts, uint64) (*types.Transaction, error)) *CommitStoreInterface_SetMinSeqNr_Call { + _c.Call.Return(run) + return _c +} + +// SetOCR2Config provides a mock function with given fields: opts, signers, transmitters, f, onchainConfig, offchainConfigVersion, offchainConfig +func (_m *CommitStoreInterface) SetOCR2Config(opts *bind.TransactOpts, signers []common.Address, transmitters []common.Address, f uint8, onchainConfig []byte, offchainConfigVersion uint64, offchainConfig []byte) (*types.Transaction, error) { + ret := _m.Called(opts, signers, transmitters, f, onchainConfig, offchainConfigVersion, offchainConfig) + + if len(ret) == 0 { + panic("no return value specified for SetOCR2Config") + } + + var r0 *types.Transaction + var r1 error + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, []common.Address, []common.Address, uint8, []byte, uint64, []byte) (*types.Transaction, error)); ok { + return rf(opts, signers, transmitters, f, onchainConfig, offchainConfigVersion, offchainConfig) + } + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, []common.Address, []common.Address, uint8, []byte, uint64, []byte) *types.Transaction); ok { + r0 = rf(opts, signers, transmitters, f, onchainConfig, offchainConfigVersion, offchainConfig) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Transaction) + } + } + + if rf, ok := ret.Get(1).(func(*bind.TransactOpts, []common.Address, []common.Address, uint8, []byte, uint64, []byte) error); ok { + r1 = rf(opts, signers, transmitters, f, onchainConfig, offchainConfigVersion, offchainConfig) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// CommitStoreInterface_SetOCR2Config_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetOCR2Config' +type CommitStoreInterface_SetOCR2Config_Call struct { + *mock.Call +} + +// SetOCR2Config is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - signers []common.Address +// - transmitters []common.Address +// - f uint8 +// - onchainConfig []byte +// - offchainConfigVersion uint64 +// - offchainConfig []byte +func (_e *CommitStoreInterface_Expecter) SetOCR2Config(opts interface{}, signers interface{}, transmitters interface{}, f interface{}, onchainConfig interface{}, offchainConfigVersion interface{}, offchainConfig interface{}) *CommitStoreInterface_SetOCR2Config_Call { + return &CommitStoreInterface_SetOCR2Config_Call{Call: _e.mock.On("SetOCR2Config", opts, signers, transmitters, f, onchainConfig, offchainConfigVersion, offchainConfig)} +} + +func (_c *CommitStoreInterface_SetOCR2Config_Call) Run(run func(opts *bind.TransactOpts, signers []common.Address, transmitters []common.Address, f uint8, onchainConfig []byte, offchainConfigVersion uint64, offchainConfig []byte)) *CommitStoreInterface_SetOCR2Config_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].([]common.Address), args[2].([]common.Address), args[3].(uint8), args[4].([]byte), args[5].(uint64), args[6].([]byte)) + }) + return _c +} + +func (_c *CommitStoreInterface_SetOCR2Config_Call) Return(_a0 *types.Transaction, _a1 error) *CommitStoreInterface_SetOCR2Config_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *CommitStoreInterface_SetOCR2Config_Call) RunAndReturn(run func(*bind.TransactOpts, []common.Address, []common.Address, uint8, []byte, uint64, []byte) (*types.Transaction, error)) *CommitStoreInterface_SetOCR2Config_Call { + _c.Call.Return(run) + return _c +} + +// TransferOwnership provides a mock function with given fields: opts, to +func (_m *CommitStoreInterface) TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) { + ret := _m.Called(opts, to) + + if len(ret) == 0 { + panic("no return value specified for TransferOwnership") + } + + var r0 *types.Transaction + var r1 error + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, common.Address) (*types.Transaction, error)); ok { + return rf(opts, to) + } + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, common.Address) *types.Transaction); ok { + r0 = rf(opts, to) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Transaction) + } + } + + if rf, ok := ret.Get(1).(func(*bind.TransactOpts, common.Address) error); ok { + r1 = rf(opts, to) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// CommitStoreInterface_TransferOwnership_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TransferOwnership' +type CommitStoreInterface_TransferOwnership_Call struct { + *mock.Call +} + +// TransferOwnership is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - to common.Address +func (_e *CommitStoreInterface_Expecter) TransferOwnership(opts interface{}, to interface{}) *CommitStoreInterface_TransferOwnership_Call { + return &CommitStoreInterface_TransferOwnership_Call{Call: _e.mock.On("TransferOwnership", opts, to)} +} + +func (_c *CommitStoreInterface_TransferOwnership_Call) Run(run func(opts *bind.TransactOpts, to common.Address)) *CommitStoreInterface_TransferOwnership_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].(common.Address)) + }) + return _c +} + +func (_c *CommitStoreInterface_TransferOwnership_Call) Return(_a0 *types.Transaction, _a1 error) *CommitStoreInterface_TransferOwnership_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *CommitStoreInterface_TransferOwnership_Call) RunAndReturn(run func(*bind.TransactOpts, common.Address) (*types.Transaction, error)) *CommitStoreInterface_TransferOwnership_Call { + _c.Call.Return(run) + return _c +} + +// Transmit provides a mock function with given fields: opts, reportContext, report, rs, ss, rawVs +func (_m *CommitStoreInterface) Transmit(opts *bind.TransactOpts, reportContext [3][32]byte, report []byte, rs [][32]byte, ss [][32]byte, rawVs [32]byte) (*types.Transaction, error) { + ret := _m.Called(opts, reportContext, report, rs, ss, rawVs) + + if len(ret) == 0 { + panic("no return value specified for Transmit") + } + + var r0 *types.Transaction + var r1 error + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, [3][32]byte, []byte, [][32]byte, [][32]byte, [32]byte) (*types.Transaction, error)); ok { + return rf(opts, reportContext, report, rs, ss, rawVs) + } + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, [3][32]byte, []byte, [][32]byte, [][32]byte, [32]byte) *types.Transaction); ok { + r0 = rf(opts, reportContext, report, rs, ss, rawVs) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Transaction) + } + } + + if rf, ok := ret.Get(1).(func(*bind.TransactOpts, [3][32]byte, []byte, [][32]byte, [][32]byte, [32]byte) error); ok { + r1 = rf(opts, reportContext, report, rs, ss, rawVs) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// CommitStoreInterface_Transmit_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Transmit' +type CommitStoreInterface_Transmit_Call struct { + *mock.Call +} + +// Transmit is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - reportContext [3][32]byte +// - report []byte +// - rs [][32]byte +// - ss [][32]byte +// - rawVs [32]byte +func (_e *CommitStoreInterface_Expecter) Transmit(opts interface{}, reportContext interface{}, report interface{}, rs interface{}, ss interface{}, rawVs interface{}) *CommitStoreInterface_Transmit_Call { + return &CommitStoreInterface_Transmit_Call{Call: _e.mock.On("Transmit", opts, reportContext, report, rs, ss, rawVs)} +} + +func (_c *CommitStoreInterface_Transmit_Call) Run(run func(opts *bind.TransactOpts, reportContext [3][32]byte, report []byte, rs [][32]byte, ss [][32]byte, rawVs [32]byte)) *CommitStoreInterface_Transmit_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].([3][32]byte), args[2].([]byte), args[3].([][32]byte), args[4].([][32]byte), args[5].([32]byte)) + }) + return _c +} + +func (_c *CommitStoreInterface_Transmit_Call) Return(_a0 *types.Transaction, _a1 error) *CommitStoreInterface_Transmit_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *CommitStoreInterface_Transmit_Call) RunAndReturn(run func(*bind.TransactOpts, [3][32]byte, []byte, [][32]byte, [][32]byte, [32]byte) (*types.Transaction, error)) *CommitStoreInterface_Transmit_Call { + _c.Call.Return(run) + return _c +} + +// TypeAndVersion provides a mock function with given fields: opts +func (_m *CommitStoreInterface) TypeAndVersion(opts *bind.CallOpts) (string, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for TypeAndVersion") + } + + var r0 string + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts) (string, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts) string); ok { + r0 = rf(opts) + } else { + r0 = ret.Get(0).(string) + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// CommitStoreInterface_TypeAndVersion_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TypeAndVersion' +type CommitStoreInterface_TypeAndVersion_Call struct { + *mock.Call +} + +// TypeAndVersion is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *CommitStoreInterface_Expecter) TypeAndVersion(opts interface{}) *CommitStoreInterface_TypeAndVersion_Call { + return &CommitStoreInterface_TypeAndVersion_Call{Call: _e.mock.On("TypeAndVersion", opts)} +} + +func (_c *CommitStoreInterface_TypeAndVersion_Call) Run(run func(opts *bind.CallOpts)) *CommitStoreInterface_TypeAndVersion_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *CommitStoreInterface_TypeAndVersion_Call) Return(_a0 string, _a1 error) *CommitStoreInterface_TypeAndVersion_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *CommitStoreInterface_TypeAndVersion_Call) RunAndReturn(run func(*bind.CallOpts) (string, error)) *CommitStoreInterface_TypeAndVersion_Call { + _c.Call.Return(run) + return _c +} + +// Unpause provides a mock function with given fields: opts +func (_m *CommitStoreInterface) Unpause(opts *bind.TransactOpts) (*types.Transaction, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for Unpause") + } + + var r0 *types.Transaction + var r1 error + if rf, ok := ret.Get(0).(func(*bind.TransactOpts) (*types.Transaction, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.TransactOpts) *types.Transaction); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Transaction) + } + } + + if rf, ok := ret.Get(1).(func(*bind.TransactOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// CommitStoreInterface_Unpause_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Unpause' +type CommitStoreInterface_Unpause_Call struct { + *mock.Call +} + +// Unpause is a helper method to define mock.On call +// - opts *bind.TransactOpts +func (_e *CommitStoreInterface_Expecter) Unpause(opts interface{}) *CommitStoreInterface_Unpause_Call { + return &CommitStoreInterface_Unpause_Call{Call: _e.mock.On("Unpause", opts)} +} + +func (_c *CommitStoreInterface_Unpause_Call) Run(run func(opts *bind.TransactOpts)) *CommitStoreInterface_Unpause_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts)) + }) + return _c +} + +func (_c *CommitStoreInterface_Unpause_Call) Return(_a0 *types.Transaction, _a1 error) *CommitStoreInterface_Unpause_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *CommitStoreInterface_Unpause_Call) RunAndReturn(run func(*bind.TransactOpts) (*types.Transaction, error)) *CommitStoreInterface_Unpause_Call { + _c.Call.Return(run) + return _c +} + +// Verify provides a mock function with given fields: opts, hashedLeaves, proofs, proofFlagBits +func (_m *CommitStoreInterface) Verify(opts *bind.CallOpts, hashedLeaves [][32]byte, proofs [][32]byte, proofFlagBits *big.Int) (*big.Int, error) { + ret := _m.Called(opts, hashedLeaves, proofs, proofFlagBits) + + if len(ret) == 0 { + panic("no return value specified for Verify") + } + + var r0 *big.Int + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts, [][32]byte, [][32]byte, *big.Int) (*big.Int, error)); ok { + return rf(opts, hashedLeaves, proofs, proofFlagBits) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts, [][32]byte, [][32]byte, *big.Int) *big.Int); ok { + r0 = rf(opts, hashedLeaves, proofs, proofFlagBits) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*big.Int) + } + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts, [][32]byte, [][32]byte, *big.Int) error); ok { + r1 = rf(opts, hashedLeaves, proofs, proofFlagBits) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// CommitStoreInterface_Verify_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Verify' +type CommitStoreInterface_Verify_Call struct { + *mock.Call +} + +// Verify is a helper method to define mock.On call +// - opts *bind.CallOpts +// - hashedLeaves [][32]byte +// - proofs [][32]byte +// - proofFlagBits *big.Int +func (_e *CommitStoreInterface_Expecter) Verify(opts interface{}, hashedLeaves interface{}, proofs interface{}, proofFlagBits interface{}) *CommitStoreInterface_Verify_Call { + return &CommitStoreInterface_Verify_Call{Call: _e.mock.On("Verify", opts, hashedLeaves, proofs, proofFlagBits)} +} + +func (_c *CommitStoreInterface_Verify_Call) Run(run func(opts *bind.CallOpts, hashedLeaves [][32]byte, proofs [][32]byte, proofFlagBits *big.Int)) *CommitStoreInterface_Verify_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts), args[1].([][32]byte), args[2].([][32]byte), args[3].(*big.Int)) + }) + return _c +} + +func (_c *CommitStoreInterface_Verify_Call) Return(_a0 *big.Int, _a1 error) *CommitStoreInterface_Verify_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *CommitStoreInterface_Verify_Call) RunAndReturn(run func(*bind.CallOpts, [][32]byte, [][32]byte, *big.Int) (*big.Int, error)) *CommitStoreInterface_Verify_Call { + _c.Call.Return(run) + return _c +} + +// WatchConfigSet provides a mock function with given fields: opts, sink +func (_m *CommitStoreInterface) WatchConfigSet(opts *bind.WatchOpts, sink chan<- *commit_store.CommitStoreConfigSet) (event.Subscription, error) { + ret := _m.Called(opts, sink) + + if len(ret) == 0 { + panic("no return value specified for WatchConfigSet") + } + + var r0 event.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *commit_store.CommitStoreConfigSet) (event.Subscription, error)); ok { + return rf(opts, sink) + } + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *commit_store.CommitStoreConfigSet) event.Subscription); ok { + r0 = rf(opts, sink) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(event.Subscription) + } + } + + if rf, ok := ret.Get(1).(func(*bind.WatchOpts, chan<- *commit_store.CommitStoreConfigSet) error); ok { + r1 = rf(opts, sink) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// CommitStoreInterface_WatchConfigSet_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchConfigSet' +type CommitStoreInterface_WatchConfigSet_Call struct { + *mock.Call +} + +// WatchConfigSet is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *commit_store.CommitStoreConfigSet +func (_e *CommitStoreInterface_Expecter) WatchConfigSet(opts interface{}, sink interface{}) *CommitStoreInterface_WatchConfigSet_Call { + return &CommitStoreInterface_WatchConfigSet_Call{Call: _e.mock.On("WatchConfigSet", opts, sink)} +} + +func (_c *CommitStoreInterface_WatchConfigSet_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *commit_store.CommitStoreConfigSet)) *CommitStoreInterface_WatchConfigSet_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *commit_store.CommitStoreConfigSet)) + }) + return _c +} + +func (_c *CommitStoreInterface_WatchConfigSet_Call) Return(_a0 event.Subscription, _a1 error) *CommitStoreInterface_WatchConfigSet_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *CommitStoreInterface_WatchConfigSet_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *commit_store.CommitStoreConfigSet) (event.Subscription, error)) *CommitStoreInterface_WatchConfigSet_Call { + _c.Call.Return(run) + return _c +} + +// WatchConfigSet0 provides a mock function with given fields: opts, sink +func (_m *CommitStoreInterface) WatchConfigSet0(opts *bind.WatchOpts, sink chan<- *commit_store.CommitStoreConfigSet0) (event.Subscription, error) { + ret := _m.Called(opts, sink) + + if len(ret) == 0 { + panic("no return value specified for WatchConfigSet0") + } + + var r0 event.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *commit_store.CommitStoreConfigSet0) (event.Subscription, error)); ok { + return rf(opts, sink) + } + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *commit_store.CommitStoreConfigSet0) event.Subscription); ok { + r0 = rf(opts, sink) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(event.Subscription) + } + } + + if rf, ok := ret.Get(1).(func(*bind.WatchOpts, chan<- *commit_store.CommitStoreConfigSet0) error); ok { + r1 = rf(opts, sink) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// CommitStoreInterface_WatchConfigSet0_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchConfigSet0' +type CommitStoreInterface_WatchConfigSet0_Call struct { + *mock.Call +} + +// WatchConfigSet0 is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *commit_store.CommitStoreConfigSet0 +func (_e *CommitStoreInterface_Expecter) WatchConfigSet0(opts interface{}, sink interface{}) *CommitStoreInterface_WatchConfigSet0_Call { + return &CommitStoreInterface_WatchConfigSet0_Call{Call: _e.mock.On("WatchConfigSet0", opts, sink)} +} + +func (_c *CommitStoreInterface_WatchConfigSet0_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *commit_store.CommitStoreConfigSet0)) *CommitStoreInterface_WatchConfigSet0_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *commit_store.CommitStoreConfigSet0)) + }) + return _c +} + +func (_c *CommitStoreInterface_WatchConfigSet0_Call) Return(_a0 event.Subscription, _a1 error) *CommitStoreInterface_WatchConfigSet0_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *CommitStoreInterface_WatchConfigSet0_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *commit_store.CommitStoreConfigSet0) (event.Subscription, error)) *CommitStoreInterface_WatchConfigSet0_Call { + _c.Call.Return(run) + return _c +} + +// WatchLatestPriceEpochAndRoundSet provides a mock function with given fields: opts, sink +func (_m *CommitStoreInterface) WatchLatestPriceEpochAndRoundSet(opts *bind.WatchOpts, sink chan<- *commit_store.CommitStoreLatestPriceEpochAndRoundSet) (event.Subscription, error) { + ret := _m.Called(opts, sink) + + if len(ret) == 0 { + panic("no return value specified for WatchLatestPriceEpochAndRoundSet") + } + + var r0 event.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *commit_store.CommitStoreLatestPriceEpochAndRoundSet) (event.Subscription, error)); ok { + return rf(opts, sink) + } + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *commit_store.CommitStoreLatestPriceEpochAndRoundSet) event.Subscription); ok { + r0 = rf(opts, sink) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(event.Subscription) + } + } + + if rf, ok := ret.Get(1).(func(*bind.WatchOpts, chan<- *commit_store.CommitStoreLatestPriceEpochAndRoundSet) error); ok { + r1 = rf(opts, sink) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// CommitStoreInterface_WatchLatestPriceEpochAndRoundSet_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchLatestPriceEpochAndRoundSet' +type CommitStoreInterface_WatchLatestPriceEpochAndRoundSet_Call struct { + *mock.Call +} + +// WatchLatestPriceEpochAndRoundSet is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *commit_store.CommitStoreLatestPriceEpochAndRoundSet +func (_e *CommitStoreInterface_Expecter) WatchLatestPriceEpochAndRoundSet(opts interface{}, sink interface{}) *CommitStoreInterface_WatchLatestPriceEpochAndRoundSet_Call { + return &CommitStoreInterface_WatchLatestPriceEpochAndRoundSet_Call{Call: _e.mock.On("WatchLatestPriceEpochAndRoundSet", opts, sink)} +} + +func (_c *CommitStoreInterface_WatchLatestPriceEpochAndRoundSet_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *commit_store.CommitStoreLatestPriceEpochAndRoundSet)) *CommitStoreInterface_WatchLatestPriceEpochAndRoundSet_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *commit_store.CommitStoreLatestPriceEpochAndRoundSet)) + }) + return _c +} + +func (_c *CommitStoreInterface_WatchLatestPriceEpochAndRoundSet_Call) Return(_a0 event.Subscription, _a1 error) *CommitStoreInterface_WatchLatestPriceEpochAndRoundSet_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *CommitStoreInterface_WatchLatestPriceEpochAndRoundSet_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *commit_store.CommitStoreLatestPriceEpochAndRoundSet) (event.Subscription, error)) *CommitStoreInterface_WatchLatestPriceEpochAndRoundSet_Call { + _c.Call.Return(run) + return _c +} + +// WatchOwnershipTransferRequested provides a mock function with given fields: opts, sink, from, to +func (_m *CommitStoreInterface) WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *commit_store.CommitStoreOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) { + ret := _m.Called(opts, sink, from, to) + + if len(ret) == 0 { + panic("no return value specified for WatchOwnershipTransferRequested") + } + + var r0 event.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *commit_store.CommitStoreOwnershipTransferRequested, []common.Address, []common.Address) (event.Subscription, error)); ok { + return rf(opts, sink, from, to) + } + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *commit_store.CommitStoreOwnershipTransferRequested, []common.Address, []common.Address) event.Subscription); ok { + r0 = rf(opts, sink, from, to) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(event.Subscription) + } + } + + if rf, ok := ret.Get(1).(func(*bind.WatchOpts, chan<- *commit_store.CommitStoreOwnershipTransferRequested, []common.Address, []common.Address) error); ok { + r1 = rf(opts, sink, from, to) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// CommitStoreInterface_WatchOwnershipTransferRequested_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchOwnershipTransferRequested' +type CommitStoreInterface_WatchOwnershipTransferRequested_Call struct { + *mock.Call +} + +// WatchOwnershipTransferRequested is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *commit_store.CommitStoreOwnershipTransferRequested +// - from []common.Address +// - to []common.Address +func (_e *CommitStoreInterface_Expecter) WatchOwnershipTransferRequested(opts interface{}, sink interface{}, from interface{}, to interface{}) *CommitStoreInterface_WatchOwnershipTransferRequested_Call { + return &CommitStoreInterface_WatchOwnershipTransferRequested_Call{Call: _e.mock.On("WatchOwnershipTransferRequested", opts, sink, from, to)} +} + +func (_c *CommitStoreInterface_WatchOwnershipTransferRequested_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *commit_store.CommitStoreOwnershipTransferRequested, from []common.Address, to []common.Address)) *CommitStoreInterface_WatchOwnershipTransferRequested_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *commit_store.CommitStoreOwnershipTransferRequested), args[2].([]common.Address), args[3].([]common.Address)) + }) + return _c +} + +func (_c *CommitStoreInterface_WatchOwnershipTransferRequested_Call) Return(_a0 event.Subscription, _a1 error) *CommitStoreInterface_WatchOwnershipTransferRequested_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *CommitStoreInterface_WatchOwnershipTransferRequested_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *commit_store.CommitStoreOwnershipTransferRequested, []common.Address, []common.Address) (event.Subscription, error)) *CommitStoreInterface_WatchOwnershipTransferRequested_Call { + _c.Call.Return(run) + return _c +} + +// WatchOwnershipTransferred provides a mock function with given fields: opts, sink, from, to +func (_m *CommitStoreInterface) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *commit_store.CommitStoreOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) { + ret := _m.Called(opts, sink, from, to) + + if len(ret) == 0 { + panic("no return value specified for WatchOwnershipTransferred") + } + + var r0 event.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *commit_store.CommitStoreOwnershipTransferred, []common.Address, []common.Address) (event.Subscription, error)); ok { + return rf(opts, sink, from, to) + } + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *commit_store.CommitStoreOwnershipTransferred, []common.Address, []common.Address) event.Subscription); ok { + r0 = rf(opts, sink, from, to) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(event.Subscription) + } + } + + if rf, ok := ret.Get(1).(func(*bind.WatchOpts, chan<- *commit_store.CommitStoreOwnershipTransferred, []common.Address, []common.Address) error); ok { + r1 = rf(opts, sink, from, to) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// CommitStoreInterface_WatchOwnershipTransferred_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchOwnershipTransferred' +type CommitStoreInterface_WatchOwnershipTransferred_Call struct { + *mock.Call +} + +// WatchOwnershipTransferred is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *commit_store.CommitStoreOwnershipTransferred +// - from []common.Address +// - to []common.Address +func (_e *CommitStoreInterface_Expecter) WatchOwnershipTransferred(opts interface{}, sink interface{}, from interface{}, to interface{}) *CommitStoreInterface_WatchOwnershipTransferred_Call { + return &CommitStoreInterface_WatchOwnershipTransferred_Call{Call: _e.mock.On("WatchOwnershipTransferred", opts, sink, from, to)} +} + +func (_c *CommitStoreInterface_WatchOwnershipTransferred_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *commit_store.CommitStoreOwnershipTransferred, from []common.Address, to []common.Address)) *CommitStoreInterface_WatchOwnershipTransferred_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *commit_store.CommitStoreOwnershipTransferred), args[2].([]common.Address), args[3].([]common.Address)) + }) + return _c +} + +func (_c *CommitStoreInterface_WatchOwnershipTransferred_Call) Return(_a0 event.Subscription, _a1 error) *CommitStoreInterface_WatchOwnershipTransferred_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *CommitStoreInterface_WatchOwnershipTransferred_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *commit_store.CommitStoreOwnershipTransferred, []common.Address, []common.Address) (event.Subscription, error)) *CommitStoreInterface_WatchOwnershipTransferred_Call { + _c.Call.Return(run) + return _c +} + +// WatchPaused provides a mock function with given fields: opts, sink +func (_m *CommitStoreInterface) WatchPaused(opts *bind.WatchOpts, sink chan<- *commit_store.CommitStorePaused) (event.Subscription, error) { + ret := _m.Called(opts, sink) + + if len(ret) == 0 { + panic("no return value specified for WatchPaused") + } + + var r0 event.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *commit_store.CommitStorePaused) (event.Subscription, error)); ok { + return rf(opts, sink) + } + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *commit_store.CommitStorePaused) event.Subscription); ok { + r0 = rf(opts, sink) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(event.Subscription) + } + } + + if rf, ok := ret.Get(1).(func(*bind.WatchOpts, chan<- *commit_store.CommitStorePaused) error); ok { + r1 = rf(opts, sink) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// CommitStoreInterface_WatchPaused_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchPaused' +type CommitStoreInterface_WatchPaused_Call struct { + *mock.Call +} + +// WatchPaused is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *commit_store.CommitStorePaused +func (_e *CommitStoreInterface_Expecter) WatchPaused(opts interface{}, sink interface{}) *CommitStoreInterface_WatchPaused_Call { + return &CommitStoreInterface_WatchPaused_Call{Call: _e.mock.On("WatchPaused", opts, sink)} +} + +func (_c *CommitStoreInterface_WatchPaused_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *commit_store.CommitStorePaused)) *CommitStoreInterface_WatchPaused_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *commit_store.CommitStorePaused)) + }) + return _c +} + +func (_c *CommitStoreInterface_WatchPaused_Call) Return(_a0 event.Subscription, _a1 error) *CommitStoreInterface_WatchPaused_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *CommitStoreInterface_WatchPaused_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *commit_store.CommitStorePaused) (event.Subscription, error)) *CommitStoreInterface_WatchPaused_Call { + _c.Call.Return(run) + return _c +} + +// WatchReportAccepted provides a mock function with given fields: opts, sink +func (_m *CommitStoreInterface) WatchReportAccepted(opts *bind.WatchOpts, sink chan<- *commit_store.CommitStoreReportAccepted) (event.Subscription, error) { + ret := _m.Called(opts, sink) + + if len(ret) == 0 { + panic("no return value specified for WatchReportAccepted") + } + + var r0 event.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *commit_store.CommitStoreReportAccepted) (event.Subscription, error)); ok { + return rf(opts, sink) + } + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *commit_store.CommitStoreReportAccepted) event.Subscription); ok { + r0 = rf(opts, sink) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(event.Subscription) + } + } + + if rf, ok := ret.Get(1).(func(*bind.WatchOpts, chan<- *commit_store.CommitStoreReportAccepted) error); ok { + r1 = rf(opts, sink) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// CommitStoreInterface_WatchReportAccepted_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchReportAccepted' +type CommitStoreInterface_WatchReportAccepted_Call struct { + *mock.Call +} + +// WatchReportAccepted is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *commit_store.CommitStoreReportAccepted +func (_e *CommitStoreInterface_Expecter) WatchReportAccepted(opts interface{}, sink interface{}) *CommitStoreInterface_WatchReportAccepted_Call { + return &CommitStoreInterface_WatchReportAccepted_Call{Call: _e.mock.On("WatchReportAccepted", opts, sink)} +} + +func (_c *CommitStoreInterface_WatchReportAccepted_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *commit_store.CommitStoreReportAccepted)) *CommitStoreInterface_WatchReportAccepted_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *commit_store.CommitStoreReportAccepted)) + }) + return _c +} + +func (_c *CommitStoreInterface_WatchReportAccepted_Call) Return(_a0 event.Subscription, _a1 error) *CommitStoreInterface_WatchReportAccepted_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *CommitStoreInterface_WatchReportAccepted_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *commit_store.CommitStoreReportAccepted) (event.Subscription, error)) *CommitStoreInterface_WatchReportAccepted_Call { + _c.Call.Return(run) + return _c +} + +// WatchRootRemoved provides a mock function with given fields: opts, sink +func (_m *CommitStoreInterface) WatchRootRemoved(opts *bind.WatchOpts, sink chan<- *commit_store.CommitStoreRootRemoved) (event.Subscription, error) { + ret := _m.Called(opts, sink) + + if len(ret) == 0 { + panic("no return value specified for WatchRootRemoved") + } + + var r0 event.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *commit_store.CommitStoreRootRemoved) (event.Subscription, error)); ok { + return rf(opts, sink) + } + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *commit_store.CommitStoreRootRemoved) event.Subscription); ok { + r0 = rf(opts, sink) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(event.Subscription) + } + } + + if rf, ok := ret.Get(1).(func(*bind.WatchOpts, chan<- *commit_store.CommitStoreRootRemoved) error); ok { + r1 = rf(opts, sink) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// CommitStoreInterface_WatchRootRemoved_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchRootRemoved' +type CommitStoreInterface_WatchRootRemoved_Call struct { + *mock.Call +} + +// WatchRootRemoved is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *commit_store.CommitStoreRootRemoved +func (_e *CommitStoreInterface_Expecter) WatchRootRemoved(opts interface{}, sink interface{}) *CommitStoreInterface_WatchRootRemoved_Call { + return &CommitStoreInterface_WatchRootRemoved_Call{Call: _e.mock.On("WatchRootRemoved", opts, sink)} +} + +func (_c *CommitStoreInterface_WatchRootRemoved_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *commit_store.CommitStoreRootRemoved)) *CommitStoreInterface_WatchRootRemoved_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *commit_store.CommitStoreRootRemoved)) + }) + return _c +} + +func (_c *CommitStoreInterface_WatchRootRemoved_Call) Return(_a0 event.Subscription, _a1 error) *CommitStoreInterface_WatchRootRemoved_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *CommitStoreInterface_WatchRootRemoved_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *commit_store.CommitStoreRootRemoved) (event.Subscription, error)) *CommitStoreInterface_WatchRootRemoved_Call { + _c.Call.Return(run) + return _c +} + +// WatchSequenceNumberSet provides a mock function with given fields: opts, sink +func (_m *CommitStoreInterface) WatchSequenceNumberSet(opts *bind.WatchOpts, sink chan<- *commit_store.CommitStoreSequenceNumberSet) (event.Subscription, error) { + ret := _m.Called(opts, sink) + + if len(ret) == 0 { + panic("no return value specified for WatchSequenceNumberSet") + } + + var r0 event.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *commit_store.CommitStoreSequenceNumberSet) (event.Subscription, error)); ok { + return rf(opts, sink) + } + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *commit_store.CommitStoreSequenceNumberSet) event.Subscription); ok { + r0 = rf(opts, sink) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(event.Subscription) + } + } + + if rf, ok := ret.Get(1).(func(*bind.WatchOpts, chan<- *commit_store.CommitStoreSequenceNumberSet) error); ok { + r1 = rf(opts, sink) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// CommitStoreInterface_WatchSequenceNumberSet_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchSequenceNumberSet' +type CommitStoreInterface_WatchSequenceNumberSet_Call struct { + *mock.Call +} + +// WatchSequenceNumberSet is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *commit_store.CommitStoreSequenceNumberSet +func (_e *CommitStoreInterface_Expecter) WatchSequenceNumberSet(opts interface{}, sink interface{}) *CommitStoreInterface_WatchSequenceNumberSet_Call { + return &CommitStoreInterface_WatchSequenceNumberSet_Call{Call: _e.mock.On("WatchSequenceNumberSet", opts, sink)} +} + +func (_c *CommitStoreInterface_WatchSequenceNumberSet_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *commit_store.CommitStoreSequenceNumberSet)) *CommitStoreInterface_WatchSequenceNumberSet_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *commit_store.CommitStoreSequenceNumberSet)) + }) + return _c +} + +func (_c *CommitStoreInterface_WatchSequenceNumberSet_Call) Return(_a0 event.Subscription, _a1 error) *CommitStoreInterface_WatchSequenceNumberSet_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *CommitStoreInterface_WatchSequenceNumberSet_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *commit_store.CommitStoreSequenceNumberSet) (event.Subscription, error)) *CommitStoreInterface_WatchSequenceNumberSet_Call { + _c.Call.Return(run) + return _c +} + +// WatchTransmitted provides a mock function with given fields: opts, sink +func (_m *CommitStoreInterface) WatchTransmitted(opts *bind.WatchOpts, sink chan<- *commit_store.CommitStoreTransmitted) (event.Subscription, error) { + ret := _m.Called(opts, sink) + + if len(ret) == 0 { + panic("no return value specified for WatchTransmitted") + } + + var r0 event.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *commit_store.CommitStoreTransmitted) (event.Subscription, error)); ok { + return rf(opts, sink) + } + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *commit_store.CommitStoreTransmitted) event.Subscription); ok { + r0 = rf(opts, sink) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(event.Subscription) + } + } + + if rf, ok := ret.Get(1).(func(*bind.WatchOpts, chan<- *commit_store.CommitStoreTransmitted) error); ok { + r1 = rf(opts, sink) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// CommitStoreInterface_WatchTransmitted_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchTransmitted' +type CommitStoreInterface_WatchTransmitted_Call struct { + *mock.Call +} + +// WatchTransmitted is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *commit_store.CommitStoreTransmitted +func (_e *CommitStoreInterface_Expecter) WatchTransmitted(opts interface{}, sink interface{}) *CommitStoreInterface_WatchTransmitted_Call { + return &CommitStoreInterface_WatchTransmitted_Call{Call: _e.mock.On("WatchTransmitted", opts, sink)} +} + +func (_c *CommitStoreInterface_WatchTransmitted_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *commit_store.CommitStoreTransmitted)) *CommitStoreInterface_WatchTransmitted_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *commit_store.CommitStoreTransmitted)) + }) + return _c +} + +func (_c *CommitStoreInterface_WatchTransmitted_Call) Return(_a0 event.Subscription, _a1 error) *CommitStoreInterface_WatchTransmitted_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *CommitStoreInterface_WatchTransmitted_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *commit_store.CommitStoreTransmitted) (event.Subscription, error)) *CommitStoreInterface_WatchTransmitted_Call { + _c.Call.Return(run) + return _c +} + +// WatchUnpaused provides a mock function with given fields: opts, sink +func (_m *CommitStoreInterface) WatchUnpaused(opts *bind.WatchOpts, sink chan<- *commit_store.CommitStoreUnpaused) (event.Subscription, error) { + ret := _m.Called(opts, sink) + + if len(ret) == 0 { + panic("no return value specified for WatchUnpaused") + } + + var r0 event.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *commit_store.CommitStoreUnpaused) (event.Subscription, error)); ok { + return rf(opts, sink) + } + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *commit_store.CommitStoreUnpaused) event.Subscription); ok { + r0 = rf(opts, sink) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(event.Subscription) + } + } + + if rf, ok := ret.Get(1).(func(*bind.WatchOpts, chan<- *commit_store.CommitStoreUnpaused) error); ok { + r1 = rf(opts, sink) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// CommitStoreInterface_WatchUnpaused_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchUnpaused' +type CommitStoreInterface_WatchUnpaused_Call struct { + *mock.Call +} + +// WatchUnpaused is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *commit_store.CommitStoreUnpaused +func (_e *CommitStoreInterface_Expecter) WatchUnpaused(opts interface{}, sink interface{}) *CommitStoreInterface_WatchUnpaused_Call { + return &CommitStoreInterface_WatchUnpaused_Call{Call: _e.mock.On("WatchUnpaused", opts, sink)} +} + +func (_c *CommitStoreInterface_WatchUnpaused_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *commit_store.CommitStoreUnpaused)) *CommitStoreInterface_WatchUnpaused_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *commit_store.CommitStoreUnpaused)) + }) + return _c +} + +func (_c *CommitStoreInterface_WatchUnpaused_Call) Return(_a0 event.Subscription, _a1 error) *CommitStoreInterface_WatchUnpaused_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *CommitStoreInterface_WatchUnpaused_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *commit_store.CommitStoreUnpaused) (event.Subscription, error)) *CommitStoreInterface_WatchUnpaused_Call { + _c.Call.Return(run) + return _c +} + +// NewCommitStoreInterface creates a new instance of CommitStoreInterface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewCommitStoreInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *CommitStoreInterface { + mock := &CommitStoreInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/core/gethwrappers/ccip/mocks/evm2_evm_off_ramp_interface.go b/core/gethwrappers/ccip/mocks/evm2_evm_off_ramp_interface.go new file mode 100644 index 00000000000..29afadefd99 --- /dev/null +++ b/core/gethwrappers/ccip/mocks/evm2_evm_off_ramp_interface.go @@ -0,0 +1,4067 @@ +// Code generated by mockery v2.43.2. DO NOT EDIT. + +package mock_contracts + +import ( + bind "github.com/ethereum/go-ethereum/accounts/abi/bind" + common "github.com/ethereum/go-ethereum/common" + + event "github.com/ethereum/go-ethereum/event" + + evm_2_evm_offramp "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/evm_2_evm_offramp" + + generated "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" + + mock "github.com/stretchr/testify/mock" + + types "github.com/ethereum/go-ethereum/core/types" +) + +// EVM2EVMOffRampInterface is an autogenerated mock type for the EVM2EVMOffRampInterface type +type EVM2EVMOffRampInterface struct { + mock.Mock +} + +type EVM2EVMOffRampInterface_Expecter struct { + mock *mock.Mock +} + +func (_m *EVM2EVMOffRampInterface) EXPECT() *EVM2EVMOffRampInterface_Expecter { + return &EVM2EVMOffRampInterface_Expecter{mock: &_m.Mock} +} + +// AcceptOwnership provides a mock function with given fields: opts +func (_m *EVM2EVMOffRampInterface) AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for AcceptOwnership") + } + + var r0 *types.Transaction + var r1 error + if rf, ok := ret.Get(0).(func(*bind.TransactOpts) (*types.Transaction, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.TransactOpts) *types.Transaction); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Transaction) + } + } + + if rf, ok := ret.Get(1).(func(*bind.TransactOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_AcceptOwnership_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AcceptOwnership' +type EVM2EVMOffRampInterface_AcceptOwnership_Call struct { + *mock.Call +} + +// AcceptOwnership is a helper method to define mock.On call +// - opts *bind.TransactOpts +func (_e *EVM2EVMOffRampInterface_Expecter) AcceptOwnership(opts interface{}) *EVM2EVMOffRampInterface_AcceptOwnership_Call { + return &EVM2EVMOffRampInterface_AcceptOwnership_Call{Call: _e.mock.On("AcceptOwnership", opts)} +} + +func (_c *EVM2EVMOffRampInterface_AcceptOwnership_Call) Run(run func(opts *bind.TransactOpts)) *EVM2EVMOffRampInterface_AcceptOwnership_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_AcceptOwnership_Call) Return(_a0 *types.Transaction, _a1 error) *EVM2EVMOffRampInterface_AcceptOwnership_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_AcceptOwnership_Call) RunAndReturn(run func(*bind.TransactOpts) (*types.Transaction, error)) *EVM2EVMOffRampInterface_AcceptOwnership_Call { + _c.Call.Return(run) + return _c +} + +// Address provides a mock function with given fields: +func (_m *EVM2EVMOffRampInterface) Address() common.Address { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Address") + } + + var r0 common.Address + if rf, ok := ret.Get(0).(func() common.Address); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Address) + } + } + + return r0 +} + +// EVM2EVMOffRampInterface_Address_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Address' +type EVM2EVMOffRampInterface_Address_Call struct { + *mock.Call +} + +// Address is a helper method to define mock.On call +func (_e *EVM2EVMOffRampInterface_Expecter) Address() *EVM2EVMOffRampInterface_Address_Call { + return &EVM2EVMOffRampInterface_Address_Call{Call: _e.mock.On("Address")} +} + +func (_c *EVM2EVMOffRampInterface_Address_Call) Run(run func()) *EVM2EVMOffRampInterface_Address_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_Address_Call) Return(_a0 common.Address) *EVM2EVMOffRampInterface_Address_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *EVM2EVMOffRampInterface_Address_Call) RunAndReturn(run func() common.Address) *EVM2EVMOffRampInterface_Address_Call { + _c.Call.Return(run) + return _c +} + +// CcipReceive provides a mock function with given fields: opts, arg0 +func (_m *EVM2EVMOffRampInterface) CcipReceive(opts *bind.CallOpts, arg0 evm_2_evm_offramp.ClientAny2EVMMessage) error { + ret := _m.Called(opts, arg0) + + if len(ret) == 0 { + panic("no return value specified for CcipReceive") + } + + var r0 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts, evm_2_evm_offramp.ClientAny2EVMMessage) error); ok { + r0 = rf(opts, arg0) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// EVM2EVMOffRampInterface_CcipReceive_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CcipReceive' +type EVM2EVMOffRampInterface_CcipReceive_Call struct { + *mock.Call +} + +// CcipReceive is a helper method to define mock.On call +// - opts *bind.CallOpts +// - arg0 evm_2_evm_offramp.ClientAny2EVMMessage +func (_e *EVM2EVMOffRampInterface_Expecter) CcipReceive(opts interface{}, arg0 interface{}) *EVM2EVMOffRampInterface_CcipReceive_Call { + return &EVM2EVMOffRampInterface_CcipReceive_Call{Call: _e.mock.On("CcipReceive", opts, arg0)} +} + +func (_c *EVM2EVMOffRampInterface_CcipReceive_Call) Run(run func(opts *bind.CallOpts, arg0 evm_2_evm_offramp.ClientAny2EVMMessage)) *EVM2EVMOffRampInterface_CcipReceive_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts), args[1].(evm_2_evm_offramp.ClientAny2EVMMessage)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_CcipReceive_Call) Return(_a0 error) *EVM2EVMOffRampInterface_CcipReceive_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *EVM2EVMOffRampInterface_CcipReceive_Call) RunAndReturn(run func(*bind.CallOpts, evm_2_evm_offramp.ClientAny2EVMMessage) error) *EVM2EVMOffRampInterface_CcipReceive_Call { + _c.Call.Return(run) + return _c +} + +// CurrentRateLimiterState provides a mock function with given fields: opts +func (_m *EVM2EVMOffRampInterface) CurrentRateLimiterState(opts *bind.CallOpts) (evm_2_evm_offramp.RateLimiterTokenBucket, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for CurrentRateLimiterState") + } + + var r0 evm_2_evm_offramp.RateLimiterTokenBucket + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts) (evm_2_evm_offramp.RateLimiterTokenBucket, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts) evm_2_evm_offramp.RateLimiterTokenBucket); ok { + r0 = rf(opts) + } else { + r0 = ret.Get(0).(evm_2_evm_offramp.RateLimiterTokenBucket) + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_CurrentRateLimiterState_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CurrentRateLimiterState' +type EVM2EVMOffRampInterface_CurrentRateLimiterState_Call struct { + *mock.Call +} + +// CurrentRateLimiterState is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *EVM2EVMOffRampInterface_Expecter) CurrentRateLimiterState(opts interface{}) *EVM2EVMOffRampInterface_CurrentRateLimiterState_Call { + return &EVM2EVMOffRampInterface_CurrentRateLimiterState_Call{Call: _e.mock.On("CurrentRateLimiterState", opts)} +} + +func (_c *EVM2EVMOffRampInterface_CurrentRateLimiterState_Call) Run(run func(opts *bind.CallOpts)) *EVM2EVMOffRampInterface_CurrentRateLimiterState_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_CurrentRateLimiterState_Call) Return(_a0 evm_2_evm_offramp.RateLimiterTokenBucket, _a1 error) *EVM2EVMOffRampInterface_CurrentRateLimiterState_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_CurrentRateLimiterState_Call) RunAndReturn(run func(*bind.CallOpts) (evm_2_evm_offramp.RateLimiterTokenBucket, error)) *EVM2EVMOffRampInterface_CurrentRateLimiterState_Call { + _c.Call.Return(run) + return _c +} + +// ExecuteSingleMessage provides a mock function with given fields: opts, message, offchainTokenData, tokenGasOverrides +func (_m *EVM2EVMOffRampInterface) ExecuteSingleMessage(opts *bind.TransactOpts, message evm_2_evm_offramp.InternalEVM2EVMMessage, offchainTokenData [][]byte, tokenGasOverrides []uint32) (*types.Transaction, error) { + ret := _m.Called(opts, message, offchainTokenData, tokenGasOverrides) + + if len(ret) == 0 { + panic("no return value specified for ExecuteSingleMessage") + } + + var r0 *types.Transaction + var r1 error + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, evm_2_evm_offramp.InternalEVM2EVMMessage, [][]byte, []uint32) (*types.Transaction, error)); ok { + return rf(opts, message, offchainTokenData, tokenGasOverrides) + } + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, evm_2_evm_offramp.InternalEVM2EVMMessage, [][]byte, []uint32) *types.Transaction); ok { + r0 = rf(opts, message, offchainTokenData, tokenGasOverrides) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Transaction) + } + } + + if rf, ok := ret.Get(1).(func(*bind.TransactOpts, evm_2_evm_offramp.InternalEVM2EVMMessage, [][]byte, []uint32) error); ok { + r1 = rf(opts, message, offchainTokenData, tokenGasOverrides) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_ExecuteSingleMessage_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ExecuteSingleMessage' +type EVM2EVMOffRampInterface_ExecuteSingleMessage_Call struct { + *mock.Call +} + +// ExecuteSingleMessage is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - message evm_2_evm_offramp.InternalEVM2EVMMessage +// - offchainTokenData [][]byte +// - tokenGasOverrides []uint32 +func (_e *EVM2EVMOffRampInterface_Expecter) ExecuteSingleMessage(opts interface{}, message interface{}, offchainTokenData interface{}, tokenGasOverrides interface{}) *EVM2EVMOffRampInterface_ExecuteSingleMessage_Call { + return &EVM2EVMOffRampInterface_ExecuteSingleMessage_Call{Call: _e.mock.On("ExecuteSingleMessage", opts, message, offchainTokenData, tokenGasOverrides)} +} + +func (_c *EVM2EVMOffRampInterface_ExecuteSingleMessage_Call) Run(run func(opts *bind.TransactOpts, message evm_2_evm_offramp.InternalEVM2EVMMessage, offchainTokenData [][]byte, tokenGasOverrides []uint32)) *EVM2EVMOffRampInterface_ExecuteSingleMessage_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].(evm_2_evm_offramp.InternalEVM2EVMMessage), args[2].([][]byte), args[3].([]uint32)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_ExecuteSingleMessage_Call) Return(_a0 *types.Transaction, _a1 error) *EVM2EVMOffRampInterface_ExecuteSingleMessage_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_ExecuteSingleMessage_Call) RunAndReturn(run func(*bind.TransactOpts, evm_2_evm_offramp.InternalEVM2EVMMessage, [][]byte, []uint32) (*types.Transaction, error)) *EVM2EVMOffRampInterface_ExecuteSingleMessage_Call { + _c.Call.Return(run) + return _c +} + +// FilterAdminSet provides a mock function with given fields: opts +func (_m *EVM2EVMOffRampInterface) FilterAdminSet(opts *bind.FilterOpts) (*evm_2_evm_offramp.EVM2EVMOffRampAdminSetIterator, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for FilterAdminSet") + } + + var r0 *evm_2_evm_offramp.EVM2EVMOffRampAdminSetIterator + var r1 error + if rf, ok := ret.Get(0).(func(*bind.FilterOpts) (*evm_2_evm_offramp.EVM2EVMOffRampAdminSetIterator, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.FilterOpts) *evm_2_evm_offramp.EVM2EVMOffRampAdminSetIterator); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*evm_2_evm_offramp.EVM2EVMOffRampAdminSetIterator) + } + } + + if rf, ok := ret.Get(1).(func(*bind.FilterOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_FilterAdminSet_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterAdminSet' +type EVM2EVMOffRampInterface_FilterAdminSet_Call struct { + *mock.Call +} + +// FilterAdminSet is a helper method to define mock.On call +// - opts *bind.FilterOpts +func (_e *EVM2EVMOffRampInterface_Expecter) FilterAdminSet(opts interface{}) *EVM2EVMOffRampInterface_FilterAdminSet_Call { + return &EVM2EVMOffRampInterface_FilterAdminSet_Call{Call: _e.mock.On("FilterAdminSet", opts)} +} + +func (_c *EVM2EVMOffRampInterface_FilterAdminSet_Call) Run(run func(opts *bind.FilterOpts)) *EVM2EVMOffRampInterface_FilterAdminSet_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_FilterAdminSet_Call) Return(_a0 *evm_2_evm_offramp.EVM2EVMOffRampAdminSetIterator, _a1 error) *EVM2EVMOffRampInterface_FilterAdminSet_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_FilterAdminSet_Call) RunAndReturn(run func(*bind.FilterOpts) (*evm_2_evm_offramp.EVM2EVMOffRampAdminSetIterator, error)) *EVM2EVMOffRampInterface_FilterAdminSet_Call { + _c.Call.Return(run) + return _c +} + +// FilterAlreadyAttempted provides a mock function with given fields: opts +func (_m *EVM2EVMOffRampInterface) FilterAlreadyAttempted(opts *bind.FilterOpts) (*evm_2_evm_offramp.EVM2EVMOffRampAlreadyAttemptedIterator, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for FilterAlreadyAttempted") + } + + var r0 *evm_2_evm_offramp.EVM2EVMOffRampAlreadyAttemptedIterator + var r1 error + if rf, ok := ret.Get(0).(func(*bind.FilterOpts) (*evm_2_evm_offramp.EVM2EVMOffRampAlreadyAttemptedIterator, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.FilterOpts) *evm_2_evm_offramp.EVM2EVMOffRampAlreadyAttemptedIterator); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*evm_2_evm_offramp.EVM2EVMOffRampAlreadyAttemptedIterator) + } + } + + if rf, ok := ret.Get(1).(func(*bind.FilterOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_FilterAlreadyAttempted_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterAlreadyAttempted' +type EVM2EVMOffRampInterface_FilterAlreadyAttempted_Call struct { + *mock.Call +} + +// FilterAlreadyAttempted is a helper method to define mock.On call +// - opts *bind.FilterOpts +func (_e *EVM2EVMOffRampInterface_Expecter) FilterAlreadyAttempted(opts interface{}) *EVM2EVMOffRampInterface_FilterAlreadyAttempted_Call { + return &EVM2EVMOffRampInterface_FilterAlreadyAttempted_Call{Call: _e.mock.On("FilterAlreadyAttempted", opts)} +} + +func (_c *EVM2EVMOffRampInterface_FilterAlreadyAttempted_Call) Run(run func(opts *bind.FilterOpts)) *EVM2EVMOffRampInterface_FilterAlreadyAttempted_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_FilterAlreadyAttempted_Call) Return(_a0 *evm_2_evm_offramp.EVM2EVMOffRampAlreadyAttemptedIterator, _a1 error) *EVM2EVMOffRampInterface_FilterAlreadyAttempted_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_FilterAlreadyAttempted_Call) RunAndReturn(run func(*bind.FilterOpts) (*evm_2_evm_offramp.EVM2EVMOffRampAlreadyAttemptedIterator, error)) *EVM2EVMOffRampInterface_FilterAlreadyAttempted_Call { + _c.Call.Return(run) + return _c +} + +// FilterConfigChanged provides a mock function with given fields: opts +func (_m *EVM2EVMOffRampInterface) FilterConfigChanged(opts *bind.FilterOpts) (*evm_2_evm_offramp.EVM2EVMOffRampConfigChangedIterator, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for FilterConfigChanged") + } + + var r0 *evm_2_evm_offramp.EVM2EVMOffRampConfigChangedIterator + var r1 error + if rf, ok := ret.Get(0).(func(*bind.FilterOpts) (*evm_2_evm_offramp.EVM2EVMOffRampConfigChangedIterator, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.FilterOpts) *evm_2_evm_offramp.EVM2EVMOffRampConfigChangedIterator); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*evm_2_evm_offramp.EVM2EVMOffRampConfigChangedIterator) + } + } + + if rf, ok := ret.Get(1).(func(*bind.FilterOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_FilterConfigChanged_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterConfigChanged' +type EVM2EVMOffRampInterface_FilterConfigChanged_Call struct { + *mock.Call +} + +// FilterConfigChanged is a helper method to define mock.On call +// - opts *bind.FilterOpts +func (_e *EVM2EVMOffRampInterface_Expecter) FilterConfigChanged(opts interface{}) *EVM2EVMOffRampInterface_FilterConfigChanged_Call { + return &EVM2EVMOffRampInterface_FilterConfigChanged_Call{Call: _e.mock.On("FilterConfigChanged", opts)} +} + +func (_c *EVM2EVMOffRampInterface_FilterConfigChanged_Call) Run(run func(opts *bind.FilterOpts)) *EVM2EVMOffRampInterface_FilterConfigChanged_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_FilterConfigChanged_Call) Return(_a0 *evm_2_evm_offramp.EVM2EVMOffRampConfigChangedIterator, _a1 error) *EVM2EVMOffRampInterface_FilterConfigChanged_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_FilterConfigChanged_Call) RunAndReturn(run func(*bind.FilterOpts) (*evm_2_evm_offramp.EVM2EVMOffRampConfigChangedIterator, error)) *EVM2EVMOffRampInterface_FilterConfigChanged_Call { + _c.Call.Return(run) + return _c +} + +// FilterConfigSet provides a mock function with given fields: opts +func (_m *EVM2EVMOffRampInterface) FilterConfigSet(opts *bind.FilterOpts) (*evm_2_evm_offramp.EVM2EVMOffRampConfigSetIterator, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for FilterConfigSet") + } + + var r0 *evm_2_evm_offramp.EVM2EVMOffRampConfigSetIterator + var r1 error + if rf, ok := ret.Get(0).(func(*bind.FilterOpts) (*evm_2_evm_offramp.EVM2EVMOffRampConfigSetIterator, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.FilterOpts) *evm_2_evm_offramp.EVM2EVMOffRampConfigSetIterator); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*evm_2_evm_offramp.EVM2EVMOffRampConfigSetIterator) + } + } + + if rf, ok := ret.Get(1).(func(*bind.FilterOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_FilterConfigSet_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterConfigSet' +type EVM2EVMOffRampInterface_FilterConfigSet_Call struct { + *mock.Call +} + +// FilterConfigSet is a helper method to define mock.On call +// - opts *bind.FilterOpts +func (_e *EVM2EVMOffRampInterface_Expecter) FilterConfigSet(opts interface{}) *EVM2EVMOffRampInterface_FilterConfigSet_Call { + return &EVM2EVMOffRampInterface_FilterConfigSet_Call{Call: _e.mock.On("FilterConfigSet", opts)} +} + +func (_c *EVM2EVMOffRampInterface_FilterConfigSet_Call) Run(run func(opts *bind.FilterOpts)) *EVM2EVMOffRampInterface_FilterConfigSet_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_FilterConfigSet_Call) Return(_a0 *evm_2_evm_offramp.EVM2EVMOffRampConfigSetIterator, _a1 error) *EVM2EVMOffRampInterface_FilterConfigSet_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_FilterConfigSet_Call) RunAndReturn(run func(*bind.FilterOpts) (*evm_2_evm_offramp.EVM2EVMOffRampConfigSetIterator, error)) *EVM2EVMOffRampInterface_FilterConfigSet_Call { + _c.Call.Return(run) + return _c +} + +// FilterConfigSet0 provides a mock function with given fields: opts +func (_m *EVM2EVMOffRampInterface) FilterConfigSet0(opts *bind.FilterOpts) (*evm_2_evm_offramp.EVM2EVMOffRampConfigSet0Iterator, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for FilterConfigSet0") + } + + var r0 *evm_2_evm_offramp.EVM2EVMOffRampConfigSet0Iterator + var r1 error + if rf, ok := ret.Get(0).(func(*bind.FilterOpts) (*evm_2_evm_offramp.EVM2EVMOffRampConfigSet0Iterator, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.FilterOpts) *evm_2_evm_offramp.EVM2EVMOffRampConfigSet0Iterator); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*evm_2_evm_offramp.EVM2EVMOffRampConfigSet0Iterator) + } + } + + if rf, ok := ret.Get(1).(func(*bind.FilterOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_FilterConfigSet0_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterConfigSet0' +type EVM2EVMOffRampInterface_FilterConfigSet0_Call struct { + *mock.Call +} + +// FilterConfigSet0 is a helper method to define mock.On call +// - opts *bind.FilterOpts +func (_e *EVM2EVMOffRampInterface_Expecter) FilterConfigSet0(opts interface{}) *EVM2EVMOffRampInterface_FilterConfigSet0_Call { + return &EVM2EVMOffRampInterface_FilterConfigSet0_Call{Call: _e.mock.On("FilterConfigSet0", opts)} +} + +func (_c *EVM2EVMOffRampInterface_FilterConfigSet0_Call) Run(run func(opts *bind.FilterOpts)) *EVM2EVMOffRampInterface_FilterConfigSet0_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_FilterConfigSet0_Call) Return(_a0 *evm_2_evm_offramp.EVM2EVMOffRampConfigSet0Iterator, _a1 error) *EVM2EVMOffRampInterface_FilterConfigSet0_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_FilterConfigSet0_Call) RunAndReturn(run func(*bind.FilterOpts) (*evm_2_evm_offramp.EVM2EVMOffRampConfigSet0Iterator, error)) *EVM2EVMOffRampInterface_FilterConfigSet0_Call { + _c.Call.Return(run) + return _c +} + +// FilterExecutionStateChanged provides a mock function with given fields: opts, sequenceNumber, messageId +func (_m *EVM2EVMOffRampInterface) FilterExecutionStateChanged(opts *bind.FilterOpts, sequenceNumber []uint64, messageId [][32]byte) (*evm_2_evm_offramp.EVM2EVMOffRampExecutionStateChangedIterator, error) { + ret := _m.Called(opts, sequenceNumber, messageId) + + if len(ret) == 0 { + panic("no return value specified for FilterExecutionStateChanged") + } + + var r0 *evm_2_evm_offramp.EVM2EVMOffRampExecutionStateChangedIterator + var r1 error + if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []uint64, [][32]byte) (*evm_2_evm_offramp.EVM2EVMOffRampExecutionStateChangedIterator, error)); ok { + return rf(opts, sequenceNumber, messageId) + } + if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []uint64, [][32]byte) *evm_2_evm_offramp.EVM2EVMOffRampExecutionStateChangedIterator); ok { + r0 = rf(opts, sequenceNumber, messageId) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*evm_2_evm_offramp.EVM2EVMOffRampExecutionStateChangedIterator) + } + } + + if rf, ok := ret.Get(1).(func(*bind.FilterOpts, []uint64, [][32]byte) error); ok { + r1 = rf(opts, sequenceNumber, messageId) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_FilterExecutionStateChanged_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterExecutionStateChanged' +type EVM2EVMOffRampInterface_FilterExecutionStateChanged_Call struct { + *mock.Call +} + +// FilterExecutionStateChanged is a helper method to define mock.On call +// - opts *bind.FilterOpts +// - sequenceNumber []uint64 +// - messageId [][32]byte +func (_e *EVM2EVMOffRampInterface_Expecter) FilterExecutionStateChanged(opts interface{}, sequenceNumber interface{}, messageId interface{}) *EVM2EVMOffRampInterface_FilterExecutionStateChanged_Call { + return &EVM2EVMOffRampInterface_FilterExecutionStateChanged_Call{Call: _e.mock.On("FilterExecutionStateChanged", opts, sequenceNumber, messageId)} +} + +func (_c *EVM2EVMOffRampInterface_FilterExecutionStateChanged_Call) Run(run func(opts *bind.FilterOpts, sequenceNumber []uint64, messageId [][32]byte)) *EVM2EVMOffRampInterface_FilterExecutionStateChanged_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts), args[1].([]uint64), args[2].([][32]byte)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_FilterExecutionStateChanged_Call) Return(_a0 *evm_2_evm_offramp.EVM2EVMOffRampExecutionStateChangedIterator, _a1 error) *EVM2EVMOffRampInterface_FilterExecutionStateChanged_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_FilterExecutionStateChanged_Call) RunAndReturn(run func(*bind.FilterOpts, []uint64, [][32]byte) (*evm_2_evm_offramp.EVM2EVMOffRampExecutionStateChangedIterator, error)) *EVM2EVMOffRampInterface_FilterExecutionStateChanged_Call { + _c.Call.Return(run) + return _c +} + +// FilterOwnershipTransferRequested provides a mock function with given fields: opts, from, to +func (_m *EVM2EVMOffRampInterface) FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*evm_2_evm_offramp.EVM2EVMOffRampOwnershipTransferRequestedIterator, error) { + ret := _m.Called(opts, from, to) + + if len(ret) == 0 { + panic("no return value specified for FilterOwnershipTransferRequested") + } + + var r0 *evm_2_evm_offramp.EVM2EVMOffRampOwnershipTransferRequestedIterator + var r1 error + if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []common.Address, []common.Address) (*evm_2_evm_offramp.EVM2EVMOffRampOwnershipTransferRequestedIterator, error)); ok { + return rf(opts, from, to) + } + if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []common.Address, []common.Address) *evm_2_evm_offramp.EVM2EVMOffRampOwnershipTransferRequestedIterator); ok { + r0 = rf(opts, from, to) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*evm_2_evm_offramp.EVM2EVMOffRampOwnershipTransferRequestedIterator) + } + } + + if rf, ok := ret.Get(1).(func(*bind.FilterOpts, []common.Address, []common.Address) error); ok { + r1 = rf(opts, from, to) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_FilterOwnershipTransferRequested_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterOwnershipTransferRequested' +type EVM2EVMOffRampInterface_FilterOwnershipTransferRequested_Call struct { + *mock.Call +} + +// FilterOwnershipTransferRequested is a helper method to define mock.On call +// - opts *bind.FilterOpts +// - from []common.Address +// - to []common.Address +func (_e *EVM2EVMOffRampInterface_Expecter) FilterOwnershipTransferRequested(opts interface{}, from interface{}, to interface{}) *EVM2EVMOffRampInterface_FilterOwnershipTransferRequested_Call { + return &EVM2EVMOffRampInterface_FilterOwnershipTransferRequested_Call{Call: _e.mock.On("FilterOwnershipTransferRequested", opts, from, to)} +} + +func (_c *EVM2EVMOffRampInterface_FilterOwnershipTransferRequested_Call) Run(run func(opts *bind.FilterOpts, from []common.Address, to []common.Address)) *EVM2EVMOffRampInterface_FilterOwnershipTransferRequested_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts), args[1].([]common.Address), args[2].([]common.Address)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_FilterOwnershipTransferRequested_Call) Return(_a0 *evm_2_evm_offramp.EVM2EVMOffRampOwnershipTransferRequestedIterator, _a1 error) *EVM2EVMOffRampInterface_FilterOwnershipTransferRequested_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_FilterOwnershipTransferRequested_Call) RunAndReturn(run func(*bind.FilterOpts, []common.Address, []common.Address) (*evm_2_evm_offramp.EVM2EVMOffRampOwnershipTransferRequestedIterator, error)) *EVM2EVMOffRampInterface_FilterOwnershipTransferRequested_Call { + _c.Call.Return(run) + return _c +} + +// FilterOwnershipTransferred provides a mock function with given fields: opts, from, to +func (_m *EVM2EVMOffRampInterface) FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*evm_2_evm_offramp.EVM2EVMOffRampOwnershipTransferredIterator, error) { + ret := _m.Called(opts, from, to) + + if len(ret) == 0 { + panic("no return value specified for FilterOwnershipTransferred") + } + + var r0 *evm_2_evm_offramp.EVM2EVMOffRampOwnershipTransferredIterator + var r1 error + if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []common.Address, []common.Address) (*evm_2_evm_offramp.EVM2EVMOffRampOwnershipTransferredIterator, error)); ok { + return rf(opts, from, to) + } + if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []common.Address, []common.Address) *evm_2_evm_offramp.EVM2EVMOffRampOwnershipTransferredIterator); ok { + r0 = rf(opts, from, to) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*evm_2_evm_offramp.EVM2EVMOffRampOwnershipTransferredIterator) + } + } + + if rf, ok := ret.Get(1).(func(*bind.FilterOpts, []common.Address, []common.Address) error); ok { + r1 = rf(opts, from, to) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_FilterOwnershipTransferred_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterOwnershipTransferred' +type EVM2EVMOffRampInterface_FilterOwnershipTransferred_Call struct { + *mock.Call +} + +// FilterOwnershipTransferred is a helper method to define mock.On call +// - opts *bind.FilterOpts +// - from []common.Address +// - to []common.Address +func (_e *EVM2EVMOffRampInterface_Expecter) FilterOwnershipTransferred(opts interface{}, from interface{}, to interface{}) *EVM2EVMOffRampInterface_FilterOwnershipTransferred_Call { + return &EVM2EVMOffRampInterface_FilterOwnershipTransferred_Call{Call: _e.mock.On("FilterOwnershipTransferred", opts, from, to)} +} + +func (_c *EVM2EVMOffRampInterface_FilterOwnershipTransferred_Call) Run(run func(opts *bind.FilterOpts, from []common.Address, to []common.Address)) *EVM2EVMOffRampInterface_FilterOwnershipTransferred_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts), args[1].([]common.Address), args[2].([]common.Address)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_FilterOwnershipTransferred_Call) Return(_a0 *evm_2_evm_offramp.EVM2EVMOffRampOwnershipTransferredIterator, _a1 error) *EVM2EVMOffRampInterface_FilterOwnershipTransferred_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_FilterOwnershipTransferred_Call) RunAndReturn(run func(*bind.FilterOpts, []common.Address, []common.Address) (*evm_2_evm_offramp.EVM2EVMOffRampOwnershipTransferredIterator, error)) *EVM2EVMOffRampInterface_FilterOwnershipTransferred_Call { + _c.Call.Return(run) + return _c +} + +// FilterSkippedAlreadyExecutedMessage provides a mock function with given fields: opts, sequenceNumber +func (_m *EVM2EVMOffRampInterface) FilterSkippedAlreadyExecutedMessage(opts *bind.FilterOpts, sequenceNumber []uint64) (*evm_2_evm_offramp.EVM2EVMOffRampSkippedAlreadyExecutedMessageIterator, error) { + ret := _m.Called(opts, sequenceNumber) + + if len(ret) == 0 { + panic("no return value specified for FilterSkippedAlreadyExecutedMessage") + } + + var r0 *evm_2_evm_offramp.EVM2EVMOffRampSkippedAlreadyExecutedMessageIterator + var r1 error + if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []uint64) (*evm_2_evm_offramp.EVM2EVMOffRampSkippedAlreadyExecutedMessageIterator, error)); ok { + return rf(opts, sequenceNumber) + } + if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []uint64) *evm_2_evm_offramp.EVM2EVMOffRampSkippedAlreadyExecutedMessageIterator); ok { + r0 = rf(opts, sequenceNumber) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*evm_2_evm_offramp.EVM2EVMOffRampSkippedAlreadyExecutedMessageIterator) + } + } + + if rf, ok := ret.Get(1).(func(*bind.FilterOpts, []uint64) error); ok { + r1 = rf(opts, sequenceNumber) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_FilterSkippedAlreadyExecutedMessage_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterSkippedAlreadyExecutedMessage' +type EVM2EVMOffRampInterface_FilterSkippedAlreadyExecutedMessage_Call struct { + *mock.Call +} + +// FilterSkippedAlreadyExecutedMessage is a helper method to define mock.On call +// - opts *bind.FilterOpts +// - sequenceNumber []uint64 +func (_e *EVM2EVMOffRampInterface_Expecter) FilterSkippedAlreadyExecutedMessage(opts interface{}, sequenceNumber interface{}) *EVM2EVMOffRampInterface_FilterSkippedAlreadyExecutedMessage_Call { + return &EVM2EVMOffRampInterface_FilterSkippedAlreadyExecutedMessage_Call{Call: _e.mock.On("FilterSkippedAlreadyExecutedMessage", opts, sequenceNumber)} +} + +func (_c *EVM2EVMOffRampInterface_FilterSkippedAlreadyExecutedMessage_Call) Run(run func(opts *bind.FilterOpts, sequenceNumber []uint64)) *EVM2EVMOffRampInterface_FilterSkippedAlreadyExecutedMessage_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts), args[1].([]uint64)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_FilterSkippedAlreadyExecutedMessage_Call) Return(_a0 *evm_2_evm_offramp.EVM2EVMOffRampSkippedAlreadyExecutedMessageIterator, _a1 error) *EVM2EVMOffRampInterface_FilterSkippedAlreadyExecutedMessage_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_FilterSkippedAlreadyExecutedMessage_Call) RunAndReturn(run func(*bind.FilterOpts, []uint64) (*evm_2_evm_offramp.EVM2EVMOffRampSkippedAlreadyExecutedMessageIterator, error)) *EVM2EVMOffRampInterface_FilterSkippedAlreadyExecutedMessage_Call { + _c.Call.Return(run) + return _c +} + +// FilterSkippedIncorrectNonce provides a mock function with given fields: opts, nonce, sender +func (_m *EVM2EVMOffRampInterface) FilterSkippedIncorrectNonce(opts *bind.FilterOpts, nonce []uint64, sender []common.Address) (*evm_2_evm_offramp.EVM2EVMOffRampSkippedIncorrectNonceIterator, error) { + ret := _m.Called(opts, nonce, sender) + + if len(ret) == 0 { + panic("no return value specified for FilterSkippedIncorrectNonce") + } + + var r0 *evm_2_evm_offramp.EVM2EVMOffRampSkippedIncorrectNonceIterator + var r1 error + if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []uint64, []common.Address) (*evm_2_evm_offramp.EVM2EVMOffRampSkippedIncorrectNonceIterator, error)); ok { + return rf(opts, nonce, sender) + } + if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []uint64, []common.Address) *evm_2_evm_offramp.EVM2EVMOffRampSkippedIncorrectNonceIterator); ok { + r0 = rf(opts, nonce, sender) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*evm_2_evm_offramp.EVM2EVMOffRampSkippedIncorrectNonceIterator) + } + } + + if rf, ok := ret.Get(1).(func(*bind.FilterOpts, []uint64, []common.Address) error); ok { + r1 = rf(opts, nonce, sender) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_FilterSkippedIncorrectNonce_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterSkippedIncorrectNonce' +type EVM2EVMOffRampInterface_FilterSkippedIncorrectNonce_Call struct { + *mock.Call +} + +// FilterSkippedIncorrectNonce is a helper method to define mock.On call +// - opts *bind.FilterOpts +// - nonce []uint64 +// - sender []common.Address +func (_e *EVM2EVMOffRampInterface_Expecter) FilterSkippedIncorrectNonce(opts interface{}, nonce interface{}, sender interface{}) *EVM2EVMOffRampInterface_FilterSkippedIncorrectNonce_Call { + return &EVM2EVMOffRampInterface_FilterSkippedIncorrectNonce_Call{Call: _e.mock.On("FilterSkippedIncorrectNonce", opts, nonce, sender)} +} + +func (_c *EVM2EVMOffRampInterface_FilterSkippedIncorrectNonce_Call) Run(run func(opts *bind.FilterOpts, nonce []uint64, sender []common.Address)) *EVM2EVMOffRampInterface_FilterSkippedIncorrectNonce_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts), args[1].([]uint64), args[2].([]common.Address)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_FilterSkippedIncorrectNonce_Call) Return(_a0 *evm_2_evm_offramp.EVM2EVMOffRampSkippedIncorrectNonceIterator, _a1 error) *EVM2EVMOffRampInterface_FilterSkippedIncorrectNonce_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_FilterSkippedIncorrectNonce_Call) RunAndReturn(run func(*bind.FilterOpts, []uint64, []common.Address) (*evm_2_evm_offramp.EVM2EVMOffRampSkippedIncorrectNonceIterator, error)) *EVM2EVMOffRampInterface_FilterSkippedIncorrectNonce_Call { + _c.Call.Return(run) + return _c +} + +// FilterSkippedSenderWithPreviousRampMessageInflight provides a mock function with given fields: opts, nonce, sender +func (_m *EVM2EVMOffRampInterface) FilterSkippedSenderWithPreviousRampMessageInflight(opts *bind.FilterOpts, nonce []uint64, sender []common.Address) (*evm_2_evm_offramp.EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflightIterator, error) { + ret := _m.Called(opts, nonce, sender) + + if len(ret) == 0 { + panic("no return value specified for FilterSkippedSenderWithPreviousRampMessageInflight") + } + + var r0 *evm_2_evm_offramp.EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflightIterator + var r1 error + if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []uint64, []common.Address) (*evm_2_evm_offramp.EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflightIterator, error)); ok { + return rf(opts, nonce, sender) + } + if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []uint64, []common.Address) *evm_2_evm_offramp.EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflightIterator); ok { + r0 = rf(opts, nonce, sender) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*evm_2_evm_offramp.EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflightIterator) + } + } + + if rf, ok := ret.Get(1).(func(*bind.FilterOpts, []uint64, []common.Address) error); ok { + r1 = rf(opts, nonce, sender) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_FilterSkippedSenderWithPreviousRampMessageInflight_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterSkippedSenderWithPreviousRampMessageInflight' +type EVM2EVMOffRampInterface_FilterSkippedSenderWithPreviousRampMessageInflight_Call struct { + *mock.Call +} + +// FilterSkippedSenderWithPreviousRampMessageInflight is a helper method to define mock.On call +// - opts *bind.FilterOpts +// - nonce []uint64 +// - sender []common.Address +func (_e *EVM2EVMOffRampInterface_Expecter) FilterSkippedSenderWithPreviousRampMessageInflight(opts interface{}, nonce interface{}, sender interface{}) *EVM2EVMOffRampInterface_FilterSkippedSenderWithPreviousRampMessageInflight_Call { + return &EVM2EVMOffRampInterface_FilterSkippedSenderWithPreviousRampMessageInflight_Call{Call: _e.mock.On("FilterSkippedSenderWithPreviousRampMessageInflight", opts, nonce, sender)} +} + +func (_c *EVM2EVMOffRampInterface_FilterSkippedSenderWithPreviousRampMessageInflight_Call) Run(run func(opts *bind.FilterOpts, nonce []uint64, sender []common.Address)) *EVM2EVMOffRampInterface_FilterSkippedSenderWithPreviousRampMessageInflight_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts), args[1].([]uint64), args[2].([]common.Address)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_FilterSkippedSenderWithPreviousRampMessageInflight_Call) Return(_a0 *evm_2_evm_offramp.EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflightIterator, _a1 error) *EVM2EVMOffRampInterface_FilterSkippedSenderWithPreviousRampMessageInflight_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_FilterSkippedSenderWithPreviousRampMessageInflight_Call) RunAndReturn(run func(*bind.FilterOpts, []uint64, []common.Address) (*evm_2_evm_offramp.EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflightIterator, error)) *EVM2EVMOffRampInterface_FilterSkippedSenderWithPreviousRampMessageInflight_Call { + _c.Call.Return(run) + return _c +} + +// FilterTokenAggregateRateLimitAdded provides a mock function with given fields: opts +func (_m *EVM2EVMOffRampInterface) FilterTokenAggregateRateLimitAdded(opts *bind.FilterOpts) (*evm_2_evm_offramp.EVM2EVMOffRampTokenAggregateRateLimitAddedIterator, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for FilterTokenAggregateRateLimitAdded") + } + + var r0 *evm_2_evm_offramp.EVM2EVMOffRampTokenAggregateRateLimitAddedIterator + var r1 error + if rf, ok := ret.Get(0).(func(*bind.FilterOpts) (*evm_2_evm_offramp.EVM2EVMOffRampTokenAggregateRateLimitAddedIterator, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.FilterOpts) *evm_2_evm_offramp.EVM2EVMOffRampTokenAggregateRateLimitAddedIterator); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*evm_2_evm_offramp.EVM2EVMOffRampTokenAggregateRateLimitAddedIterator) + } + } + + if rf, ok := ret.Get(1).(func(*bind.FilterOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_FilterTokenAggregateRateLimitAdded_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterTokenAggregateRateLimitAdded' +type EVM2EVMOffRampInterface_FilterTokenAggregateRateLimitAdded_Call struct { + *mock.Call +} + +// FilterTokenAggregateRateLimitAdded is a helper method to define mock.On call +// - opts *bind.FilterOpts +func (_e *EVM2EVMOffRampInterface_Expecter) FilterTokenAggregateRateLimitAdded(opts interface{}) *EVM2EVMOffRampInterface_FilterTokenAggregateRateLimitAdded_Call { + return &EVM2EVMOffRampInterface_FilterTokenAggregateRateLimitAdded_Call{Call: _e.mock.On("FilterTokenAggregateRateLimitAdded", opts)} +} + +func (_c *EVM2EVMOffRampInterface_FilterTokenAggregateRateLimitAdded_Call) Run(run func(opts *bind.FilterOpts)) *EVM2EVMOffRampInterface_FilterTokenAggregateRateLimitAdded_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_FilterTokenAggregateRateLimitAdded_Call) Return(_a0 *evm_2_evm_offramp.EVM2EVMOffRampTokenAggregateRateLimitAddedIterator, _a1 error) *EVM2EVMOffRampInterface_FilterTokenAggregateRateLimitAdded_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_FilterTokenAggregateRateLimitAdded_Call) RunAndReturn(run func(*bind.FilterOpts) (*evm_2_evm_offramp.EVM2EVMOffRampTokenAggregateRateLimitAddedIterator, error)) *EVM2EVMOffRampInterface_FilterTokenAggregateRateLimitAdded_Call { + _c.Call.Return(run) + return _c +} + +// FilterTokenAggregateRateLimitRemoved provides a mock function with given fields: opts +func (_m *EVM2EVMOffRampInterface) FilterTokenAggregateRateLimitRemoved(opts *bind.FilterOpts) (*evm_2_evm_offramp.EVM2EVMOffRampTokenAggregateRateLimitRemovedIterator, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for FilterTokenAggregateRateLimitRemoved") + } + + var r0 *evm_2_evm_offramp.EVM2EVMOffRampTokenAggregateRateLimitRemovedIterator + var r1 error + if rf, ok := ret.Get(0).(func(*bind.FilterOpts) (*evm_2_evm_offramp.EVM2EVMOffRampTokenAggregateRateLimitRemovedIterator, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.FilterOpts) *evm_2_evm_offramp.EVM2EVMOffRampTokenAggregateRateLimitRemovedIterator); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*evm_2_evm_offramp.EVM2EVMOffRampTokenAggregateRateLimitRemovedIterator) + } + } + + if rf, ok := ret.Get(1).(func(*bind.FilterOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_FilterTokenAggregateRateLimitRemoved_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterTokenAggregateRateLimitRemoved' +type EVM2EVMOffRampInterface_FilterTokenAggregateRateLimitRemoved_Call struct { + *mock.Call +} + +// FilterTokenAggregateRateLimitRemoved is a helper method to define mock.On call +// - opts *bind.FilterOpts +func (_e *EVM2EVMOffRampInterface_Expecter) FilterTokenAggregateRateLimitRemoved(opts interface{}) *EVM2EVMOffRampInterface_FilterTokenAggregateRateLimitRemoved_Call { + return &EVM2EVMOffRampInterface_FilterTokenAggregateRateLimitRemoved_Call{Call: _e.mock.On("FilterTokenAggregateRateLimitRemoved", opts)} +} + +func (_c *EVM2EVMOffRampInterface_FilterTokenAggregateRateLimitRemoved_Call) Run(run func(opts *bind.FilterOpts)) *EVM2EVMOffRampInterface_FilterTokenAggregateRateLimitRemoved_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_FilterTokenAggregateRateLimitRemoved_Call) Return(_a0 *evm_2_evm_offramp.EVM2EVMOffRampTokenAggregateRateLimitRemovedIterator, _a1 error) *EVM2EVMOffRampInterface_FilterTokenAggregateRateLimitRemoved_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_FilterTokenAggregateRateLimitRemoved_Call) RunAndReturn(run func(*bind.FilterOpts) (*evm_2_evm_offramp.EVM2EVMOffRampTokenAggregateRateLimitRemovedIterator, error)) *EVM2EVMOffRampInterface_FilterTokenAggregateRateLimitRemoved_Call { + _c.Call.Return(run) + return _c +} + +// FilterTokensConsumed provides a mock function with given fields: opts +func (_m *EVM2EVMOffRampInterface) FilterTokensConsumed(opts *bind.FilterOpts) (*evm_2_evm_offramp.EVM2EVMOffRampTokensConsumedIterator, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for FilterTokensConsumed") + } + + var r0 *evm_2_evm_offramp.EVM2EVMOffRampTokensConsumedIterator + var r1 error + if rf, ok := ret.Get(0).(func(*bind.FilterOpts) (*evm_2_evm_offramp.EVM2EVMOffRampTokensConsumedIterator, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.FilterOpts) *evm_2_evm_offramp.EVM2EVMOffRampTokensConsumedIterator); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*evm_2_evm_offramp.EVM2EVMOffRampTokensConsumedIterator) + } + } + + if rf, ok := ret.Get(1).(func(*bind.FilterOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_FilterTokensConsumed_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterTokensConsumed' +type EVM2EVMOffRampInterface_FilterTokensConsumed_Call struct { + *mock.Call +} + +// FilterTokensConsumed is a helper method to define mock.On call +// - opts *bind.FilterOpts +func (_e *EVM2EVMOffRampInterface_Expecter) FilterTokensConsumed(opts interface{}) *EVM2EVMOffRampInterface_FilterTokensConsumed_Call { + return &EVM2EVMOffRampInterface_FilterTokensConsumed_Call{Call: _e.mock.On("FilterTokensConsumed", opts)} +} + +func (_c *EVM2EVMOffRampInterface_FilterTokensConsumed_Call) Run(run func(opts *bind.FilterOpts)) *EVM2EVMOffRampInterface_FilterTokensConsumed_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_FilterTokensConsumed_Call) Return(_a0 *evm_2_evm_offramp.EVM2EVMOffRampTokensConsumedIterator, _a1 error) *EVM2EVMOffRampInterface_FilterTokensConsumed_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_FilterTokensConsumed_Call) RunAndReturn(run func(*bind.FilterOpts) (*evm_2_evm_offramp.EVM2EVMOffRampTokensConsumedIterator, error)) *EVM2EVMOffRampInterface_FilterTokensConsumed_Call { + _c.Call.Return(run) + return _c +} + +// FilterTransmitted provides a mock function with given fields: opts +func (_m *EVM2EVMOffRampInterface) FilterTransmitted(opts *bind.FilterOpts) (*evm_2_evm_offramp.EVM2EVMOffRampTransmittedIterator, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for FilterTransmitted") + } + + var r0 *evm_2_evm_offramp.EVM2EVMOffRampTransmittedIterator + var r1 error + if rf, ok := ret.Get(0).(func(*bind.FilterOpts) (*evm_2_evm_offramp.EVM2EVMOffRampTransmittedIterator, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.FilterOpts) *evm_2_evm_offramp.EVM2EVMOffRampTransmittedIterator); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*evm_2_evm_offramp.EVM2EVMOffRampTransmittedIterator) + } + } + + if rf, ok := ret.Get(1).(func(*bind.FilterOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_FilterTransmitted_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterTransmitted' +type EVM2EVMOffRampInterface_FilterTransmitted_Call struct { + *mock.Call +} + +// FilterTransmitted is a helper method to define mock.On call +// - opts *bind.FilterOpts +func (_e *EVM2EVMOffRampInterface_Expecter) FilterTransmitted(opts interface{}) *EVM2EVMOffRampInterface_FilterTransmitted_Call { + return &EVM2EVMOffRampInterface_FilterTransmitted_Call{Call: _e.mock.On("FilterTransmitted", opts)} +} + +func (_c *EVM2EVMOffRampInterface_FilterTransmitted_Call) Run(run func(opts *bind.FilterOpts)) *EVM2EVMOffRampInterface_FilterTransmitted_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_FilterTransmitted_Call) Return(_a0 *evm_2_evm_offramp.EVM2EVMOffRampTransmittedIterator, _a1 error) *EVM2EVMOffRampInterface_FilterTransmitted_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_FilterTransmitted_Call) RunAndReturn(run func(*bind.FilterOpts) (*evm_2_evm_offramp.EVM2EVMOffRampTransmittedIterator, error)) *EVM2EVMOffRampInterface_FilterTransmitted_Call { + _c.Call.Return(run) + return _c +} + +// GetAllRateLimitTokens provides a mock function with given fields: opts +func (_m *EVM2EVMOffRampInterface) GetAllRateLimitTokens(opts *bind.CallOpts) (evm_2_evm_offramp.GetAllRateLimitTokens, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for GetAllRateLimitTokens") + } + + var r0 evm_2_evm_offramp.GetAllRateLimitTokens + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts) (evm_2_evm_offramp.GetAllRateLimitTokens, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts) evm_2_evm_offramp.GetAllRateLimitTokens); ok { + r0 = rf(opts) + } else { + r0 = ret.Get(0).(evm_2_evm_offramp.GetAllRateLimitTokens) + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_GetAllRateLimitTokens_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAllRateLimitTokens' +type EVM2EVMOffRampInterface_GetAllRateLimitTokens_Call struct { + *mock.Call +} + +// GetAllRateLimitTokens is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *EVM2EVMOffRampInterface_Expecter) GetAllRateLimitTokens(opts interface{}) *EVM2EVMOffRampInterface_GetAllRateLimitTokens_Call { + return &EVM2EVMOffRampInterface_GetAllRateLimitTokens_Call{Call: _e.mock.On("GetAllRateLimitTokens", opts)} +} + +func (_c *EVM2EVMOffRampInterface_GetAllRateLimitTokens_Call) Run(run func(opts *bind.CallOpts)) *EVM2EVMOffRampInterface_GetAllRateLimitTokens_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_GetAllRateLimitTokens_Call) Return(_a0 evm_2_evm_offramp.GetAllRateLimitTokens, _a1 error) *EVM2EVMOffRampInterface_GetAllRateLimitTokens_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_GetAllRateLimitTokens_Call) RunAndReturn(run func(*bind.CallOpts) (evm_2_evm_offramp.GetAllRateLimitTokens, error)) *EVM2EVMOffRampInterface_GetAllRateLimitTokens_Call { + _c.Call.Return(run) + return _c +} + +// GetDynamicConfig provides a mock function with given fields: opts +func (_m *EVM2EVMOffRampInterface) GetDynamicConfig(opts *bind.CallOpts) (evm_2_evm_offramp.EVM2EVMOffRampDynamicConfig, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for GetDynamicConfig") + } + + var r0 evm_2_evm_offramp.EVM2EVMOffRampDynamicConfig + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts) (evm_2_evm_offramp.EVM2EVMOffRampDynamicConfig, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts) evm_2_evm_offramp.EVM2EVMOffRampDynamicConfig); ok { + r0 = rf(opts) + } else { + r0 = ret.Get(0).(evm_2_evm_offramp.EVM2EVMOffRampDynamicConfig) + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_GetDynamicConfig_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetDynamicConfig' +type EVM2EVMOffRampInterface_GetDynamicConfig_Call struct { + *mock.Call +} + +// GetDynamicConfig is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *EVM2EVMOffRampInterface_Expecter) GetDynamicConfig(opts interface{}) *EVM2EVMOffRampInterface_GetDynamicConfig_Call { + return &EVM2EVMOffRampInterface_GetDynamicConfig_Call{Call: _e.mock.On("GetDynamicConfig", opts)} +} + +func (_c *EVM2EVMOffRampInterface_GetDynamicConfig_Call) Run(run func(opts *bind.CallOpts)) *EVM2EVMOffRampInterface_GetDynamicConfig_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_GetDynamicConfig_Call) Return(_a0 evm_2_evm_offramp.EVM2EVMOffRampDynamicConfig, _a1 error) *EVM2EVMOffRampInterface_GetDynamicConfig_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_GetDynamicConfig_Call) RunAndReturn(run func(*bind.CallOpts) (evm_2_evm_offramp.EVM2EVMOffRampDynamicConfig, error)) *EVM2EVMOffRampInterface_GetDynamicConfig_Call { + _c.Call.Return(run) + return _c +} + +// GetExecutionState provides a mock function with given fields: opts, sequenceNumber +func (_m *EVM2EVMOffRampInterface) GetExecutionState(opts *bind.CallOpts, sequenceNumber uint64) (uint8, error) { + ret := _m.Called(opts, sequenceNumber) + + if len(ret) == 0 { + panic("no return value specified for GetExecutionState") + } + + var r0 uint8 + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts, uint64) (uint8, error)); ok { + return rf(opts, sequenceNumber) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts, uint64) uint8); ok { + r0 = rf(opts, sequenceNumber) + } else { + r0 = ret.Get(0).(uint8) + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts, uint64) error); ok { + r1 = rf(opts, sequenceNumber) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_GetExecutionState_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetExecutionState' +type EVM2EVMOffRampInterface_GetExecutionState_Call struct { + *mock.Call +} + +// GetExecutionState is a helper method to define mock.On call +// - opts *bind.CallOpts +// - sequenceNumber uint64 +func (_e *EVM2EVMOffRampInterface_Expecter) GetExecutionState(opts interface{}, sequenceNumber interface{}) *EVM2EVMOffRampInterface_GetExecutionState_Call { + return &EVM2EVMOffRampInterface_GetExecutionState_Call{Call: _e.mock.On("GetExecutionState", opts, sequenceNumber)} +} + +func (_c *EVM2EVMOffRampInterface_GetExecutionState_Call) Run(run func(opts *bind.CallOpts, sequenceNumber uint64)) *EVM2EVMOffRampInterface_GetExecutionState_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts), args[1].(uint64)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_GetExecutionState_Call) Return(_a0 uint8, _a1 error) *EVM2EVMOffRampInterface_GetExecutionState_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_GetExecutionState_Call) RunAndReturn(run func(*bind.CallOpts, uint64) (uint8, error)) *EVM2EVMOffRampInterface_GetExecutionState_Call { + _c.Call.Return(run) + return _c +} + +// GetSenderNonce provides a mock function with given fields: opts, sender +func (_m *EVM2EVMOffRampInterface) GetSenderNonce(opts *bind.CallOpts, sender common.Address) (uint64, error) { + ret := _m.Called(opts, sender) + + if len(ret) == 0 { + panic("no return value specified for GetSenderNonce") + } + + var r0 uint64 + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts, common.Address) (uint64, error)); ok { + return rf(opts, sender) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts, common.Address) uint64); ok { + r0 = rf(opts, sender) + } else { + r0 = ret.Get(0).(uint64) + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts, common.Address) error); ok { + r1 = rf(opts, sender) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_GetSenderNonce_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSenderNonce' +type EVM2EVMOffRampInterface_GetSenderNonce_Call struct { + *mock.Call +} + +// GetSenderNonce is a helper method to define mock.On call +// - opts *bind.CallOpts +// - sender common.Address +func (_e *EVM2EVMOffRampInterface_Expecter) GetSenderNonce(opts interface{}, sender interface{}) *EVM2EVMOffRampInterface_GetSenderNonce_Call { + return &EVM2EVMOffRampInterface_GetSenderNonce_Call{Call: _e.mock.On("GetSenderNonce", opts, sender)} +} + +func (_c *EVM2EVMOffRampInterface_GetSenderNonce_Call) Run(run func(opts *bind.CallOpts, sender common.Address)) *EVM2EVMOffRampInterface_GetSenderNonce_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts), args[1].(common.Address)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_GetSenderNonce_Call) Return(_a0 uint64, _a1 error) *EVM2EVMOffRampInterface_GetSenderNonce_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_GetSenderNonce_Call) RunAndReturn(run func(*bind.CallOpts, common.Address) (uint64, error)) *EVM2EVMOffRampInterface_GetSenderNonce_Call { + _c.Call.Return(run) + return _c +} + +// GetStaticConfig provides a mock function with given fields: opts +func (_m *EVM2EVMOffRampInterface) GetStaticConfig(opts *bind.CallOpts) (evm_2_evm_offramp.EVM2EVMOffRampStaticConfig, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for GetStaticConfig") + } + + var r0 evm_2_evm_offramp.EVM2EVMOffRampStaticConfig + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts) (evm_2_evm_offramp.EVM2EVMOffRampStaticConfig, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts) evm_2_evm_offramp.EVM2EVMOffRampStaticConfig); ok { + r0 = rf(opts) + } else { + r0 = ret.Get(0).(evm_2_evm_offramp.EVM2EVMOffRampStaticConfig) + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_GetStaticConfig_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetStaticConfig' +type EVM2EVMOffRampInterface_GetStaticConfig_Call struct { + *mock.Call +} + +// GetStaticConfig is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *EVM2EVMOffRampInterface_Expecter) GetStaticConfig(opts interface{}) *EVM2EVMOffRampInterface_GetStaticConfig_Call { + return &EVM2EVMOffRampInterface_GetStaticConfig_Call{Call: _e.mock.On("GetStaticConfig", opts)} +} + +func (_c *EVM2EVMOffRampInterface_GetStaticConfig_Call) Run(run func(opts *bind.CallOpts)) *EVM2EVMOffRampInterface_GetStaticConfig_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_GetStaticConfig_Call) Return(_a0 evm_2_evm_offramp.EVM2EVMOffRampStaticConfig, _a1 error) *EVM2EVMOffRampInterface_GetStaticConfig_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_GetStaticConfig_Call) RunAndReturn(run func(*bind.CallOpts) (evm_2_evm_offramp.EVM2EVMOffRampStaticConfig, error)) *EVM2EVMOffRampInterface_GetStaticConfig_Call { + _c.Call.Return(run) + return _c +} + +// GetTokenLimitAdmin provides a mock function with given fields: opts +func (_m *EVM2EVMOffRampInterface) GetTokenLimitAdmin(opts *bind.CallOpts) (common.Address, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for GetTokenLimitAdmin") + } + + var r0 common.Address + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts) (common.Address, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts) common.Address); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Address) + } + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_GetTokenLimitAdmin_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetTokenLimitAdmin' +type EVM2EVMOffRampInterface_GetTokenLimitAdmin_Call struct { + *mock.Call +} + +// GetTokenLimitAdmin is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *EVM2EVMOffRampInterface_Expecter) GetTokenLimitAdmin(opts interface{}) *EVM2EVMOffRampInterface_GetTokenLimitAdmin_Call { + return &EVM2EVMOffRampInterface_GetTokenLimitAdmin_Call{Call: _e.mock.On("GetTokenLimitAdmin", opts)} +} + +func (_c *EVM2EVMOffRampInterface_GetTokenLimitAdmin_Call) Run(run func(opts *bind.CallOpts)) *EVM2EVMOffRampInterface_GetTokenLimitAdmin_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_GetTokenLimitAdmin_Call) Return(_a0 common.Address, _a1 error) *EVM2EVMOffRampInterface_GetTokenLimitAdmin_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_GetTokenLimitAdmin_Call) RunAndReturn(run func(*bind.CallOpts) (common.Address, error)) *EVM2EVMOffRampInterface_GetTokenLimitAdmin_Call { + _c.Call.Return(run) + return _c +} + +// GetTransmitters provides a mock function with given fields: opts +func (_m *EVM2EVMOffRampInterface) GetTransmitters(opts *bind.CallOpts) ([]common.Address, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for GetTransmitters") + } + + var r0 []common.Address + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts) ([]common.Address, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts) []common.Address); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]common.Address) + } + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_GetTransmitters_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetTransmitters' +type EVM2EVMOffRampInterface_GetTransmitters_Call struct { + *mock.Call +} + +// GetTransmitters is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *EVM2EVMOffRampInterface_Expecter) GetTransmitters(opts interface{}) *EVM2EVMOffRampInterface_GetTransmitters_Call { + return &EVM2EVMOffRampInterface_GetTransmitters_Call{Call: _e.mock.On("GetTransmitters", opts)} +} + +func (_c *EVM2EVMOffRampInterface_GetTransmitters_Call) Run(run func(opts *bind.CallOpts)) *EVM2EVMOffRampInterface_GetTransmitters_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_GetTransmitters_Call) Return(_a0 []common.Address, _a1 error) *EVM2EVMOffRampInterface_GetTransmitters_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_GetTransmitters_Call) RunAndReturn(run func(*bind.CallOpts) ([]common.Address, error)) *EVM2EVMOffRampInterface_GetTransmitters_Call { + _c.Call.Return(run) + return _c +} + +// LatestConfigDetails provides a mock function with given fields: opts +func (_m *EVM2EVMOffRampInterface) LatestConfigDetails(opts *bind.CallOpts) (evm_2_evm_offramp.LatestConfigDetails, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for LatestConfigDetails") + } + + var r0 evm_2_evm_offramp.LatestConfigDetails + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts) (evm_2_evm_offramp.LatestConfigDetails, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts) evm_2_evm_offramp.LatestConfigDetails); ok { + r0 = rf(opts) + } else { + r0 = ret.Get(0).(evm_2_evm_offramp.LatestConfigDetails) + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_LatestConfigDetails_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LatestConfigDetails' +type EVM2EVMOffRampInterface_LatestConfigDetails_Call struct { + *mock.Call +} + +// LatestConfigDetails is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *EVM2EVMOffRampInterface_Expecter) LatestConfigDetails(opts interface{}) *EVM2EVMOffRampInterface_LatestConfigDetails_Call { + return &EVM2EVMOffRampInterface_LatestConfigDetails_Call{Call: _e.mock.On("LatestConfigDetails", opts)} +} + +func (_c *EVM2EVMOffRampInterface_LatestConfigDetails_Call) Run(run func(opts *bind.CallOpts)) *EVM2EVMOffRampInterface_LatestConfigDetails_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_LatestConfigDetails_Call) Return(_a0 evm_2_evm_offramp.LatestConfigDetails, _a1 error) *EVM2EVMOffRampInterface_LatestConfigDetails_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_LatestConfigDetails_Call) RunAndReturn(run func(*bind.CallOpts) (evm_2_evm_offramp.LatestConfigDetails, error)) *EVM2EVMOffRampInterface_LatestConfigDetails_Call { + _c.Call.Return(run) + return _c +} + +// LatestConfigDigestAndEpoch provides a mock function with given fields: opts +func (_m *EVM2EVMOffRampInterface) LatestConfigDigestAndEpoch(opts *bind.CallOpts) (evm_2_evm_offramp.LatestConfigDigestAndEpoch, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for LatestConfigDigestAndEpoch") + } + + var r0 evm_2_evm_offramp.LatestConfigDigestAndEpoch + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts) (evm_2_evm_offramp.LatestConfigDigestAndEpoch, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts) evm_2_evm_offramp.LatestConfigDigestAndEpoch); ok { + r0 = rf(opts) + } else { + r0 = ret.Get(0).(evm_2_evm_offramp.LatestConfigDigestAndEpoch) + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_LatestConfigDigestAndEpoch_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LatestConfigDigestAndEpoch' +type EVM2EVMOffRampInterface_LatestConfigDigestAndEpoch_Call struct { + *mock.Call +} + +// LatestConfigDigestAndEpoch is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *EVM2EVMOffRampInterface_Expecter) LatestConfigDigestAndEpoch(opts interface{}) *EVM2EVMOffRampInterface_LatestConfigDigestAndEpoch_Call { + return &EVM2EVMOffRampInterface_LatestConfigDigestAndEpoch_Call{Call: _e.mock.On("LatestConfigDigestAndEpoch", opts)} +} + +func (_c *EVM2EVMOffRampInterface_LatestConfigDigestAndEpoch_Call) Run(run func(opts *bind.CallOpts)) *EVM2EVMOffRampInterface_LatestConfigDigestAndEpoch_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_LatestConfigDigestAndEpoch_Call) Return(_a0 evm_2_evm_offramp.LatestConfigDigestAndEpoch, _a1 error) *EVM2EVMOffRampInterface_LatestConfigDigestAndEpoch_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_LatestConfigDigestAndEpoch_Call) RunAndReturn(run func(*bind.CallOpts) (evm_2_evm_offramp.LatestConfigDigestAndEpoch, error)) *EVM2EVMOffRampInterface_LatestConfigDigestAndEpoch_Call { + _c.Call.Return(run) + return _c +} + +// ManuallyExecute provides a mock function with given fields: opts, report, gasLimitOverrides +func (_m *EVM2EVMOffRampInterface) ManuallyExecute(opts *bind.TransactOpts, report evm_2_evm_offramp.InternalExecutionReport, gasLimitOverrides []evm_2_evm_offramp.EVM2EVMOffRampGasLimitOverride) (*types.Transaction, error) { + ret := _m.Called(opts, report, gasLimitOverrides) + + if len(ret) == 0 { + panic("no return value specified for ManuallyExecute") + } + + var r0 *types.Transaction + var r1 error + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, evm_2_evm_offramp.InternalExecutionReport, []evm_2_evm_offramp.EVM2EVMOffRampGasLimitOverride) (*types.Transaction, error)); ok { + return rf(opts, report, gasLimitOverrides) + } + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, evm_2_evm_offramp.InternalExecutionReport, []evm_2_evm_offramp.EVM2EVMOffRampGasLimitOverride) *types.Transaction); ok { + r0 = rf(opts, report, gasLimitOverrides) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Transaction) + } + } + + if rf, ok := ret.Get(1).(func(*bind.TransactOpts, evm_2_evm_offramp.InternalExecutionReport, []evm_2_evm_offramp.EVM2EVMOffRampGasLimitOverride) error); ok { + r1 = rf(opts, report, gasLimitOverrides) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_ManuallyExecute_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ManuallyExecute' +type EVM2EVMOffRampInterface_ManuallyExecute_Call struct { + *mock.Call +} + +// ManuallyExecute is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - report evm_2_evm_offramp.InternalExecutionReport +// - gasLimitOverrides []evm_2_evm_offramp.EVM2EVMOffRampGasLimitOverride +func (_e *EVM2EVMOffRampInterface_Expecter) ManuallyExecute(opts interface{}, report interface{}, gasLimitOverrides interface{}) *EVM2EVMOffRampInterface_ManuallyExecute_Call { + return &EVM2EVMOffRampInterface_ManuallyExecute_Call{Call: _e.mock.On("ManuallyExecute", opts, report, gasLimitOverrides)} +} + +func (_c *EVM2EVMOffRampInterface_ManuallyExecute_Call) Run(run func(opts *bind.TransactOpts, report evm_2_evm_offramp.InternalExecutionReport, gasLimitOverrides []evm_2_evm_offramp.EVM2EVMOffRampGasLimitOverride)) *EVM2EVMOffRampInterface_ManuallyExecute_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].(evm_2_evm_offramp.InternalExecutionReport), args[2].([]evm_2_evm_offramp.EVM2EVMOffRampGasLimitOverride)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_ManuallyExecute_Call) Return(_a0 *types.Transaction, _a1 error) *EVM2EVMOffRampInterface_ManuallyExecute_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_ManuallyExecute_Call) RunAndReturn(run func(*bind.TransactOpts, evm_2_evm_offramp.InternalExecutionReport, []evm_2_evm_offramp.EVM2EVMOffRampGasLimitOverride) (*types.Transaction, error)) *EVM2EVMOffRampInterface_ManuallyExecute_Call { + _c.Call.Return(run) + return _c +} + +// Owner provides a mock function with given fields: opts +func (_m *EVM2EVMOffRampInterface) Owner(opts *bind.CallOpts) (common.Address, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for Owner") + } + + var r0 common.Address + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts) (common.Address, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts) common.Address); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Address) + } + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_Owner_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Owner' +type EVM2EVMOffRampInterface_Owner_Call struct { + *mock.Call +} + +// Owner is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *EVM2EVMOffRampInterface_Expecter) Owner(opts interface{}) *EVM2EVMOffRampInterface_Owner_Call { + return &EVM2EVMOffRampInterface_Owner_Call{Call: _e.mock.On("Owner", opts)} +} + +func (_c *EVM2EVMOffRampInterface_Owner_Call) Run(run func(opts *bind.CallOpts)) *EVM2EVMOffRampInterface_Owner_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_Owner_Call) Return(_a0 common.Address, _a1 error) *EVM2EVMOffRampInterface_Owner_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_Owner_Call) RunAndReturn(run func(*bind.CallOpts) (common.Address, error)) *EVM2EVMOffRampInterface_Owner_Call { + _c.Call.Return(run) + return _c +} + +// ParseAdminSet provides a mock function with given fields: log +func (_m *EVM2EVMOffRampInterface) ParseAdminSet(log types.Log) (*evm_2_evm_offramp.EVM2EVMOffRampAdminSet, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParseAdminSet") + } + + var r0 *evm_2_evm_offramp.EVM2EVMOffRampAdminSet + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (*evm_2_evm_offramp.EVM2EVMOffRampAdminSet, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) *evm_2_evm_offramp.EVM2EVMOffRampAdminSet); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*evm_2_evm_offramp.EVM2EVMOffRampAdminSet) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_ParseAdminSet_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseAdminSet' +type EVM2EVMOffRampInterface_ParseAdminSet_Call struct { + *mock.Call +} + +// ParseAdminSet is a helper method to define mock.On call +// - log types.Log +func (_e *EVM2EVMOffRampInterface_Expecter) ParseAdminSet(log interface{}) *EVM2EVMOffRampInterface_ParseAdminSet_Call { + return &EVM2EVMOffRampInterface_ParseAdminSet_Call{Call: _e.mock.On("ParseAdminSet", log)} +} + +func (_c *EVM2EVMOffRampInterface_ParseAdminSet_Call) Run(run func(log types.Log)) *EVM2EVMOffRampInterface_ParseAdminSet_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_ParseAdminSet_Call) Return(_a0 *evm_2_evm_offramp.EVM2EVMOffRampAdminSet, _a1 error) *EVM2EVMOffRampInterface_ParseAdminSet_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_ParseAdminSet_Call) RunAndReturn(run func(types.Log) (*evm_2_evm_offramp.EVM2EVMOffRampAdminSet, error)) *EVM2EVMOffRampInterface_ParseAdminSet_Call { + _c.Call.Return(run) + return _c +} + +// ParseAlreadyAttempted provides a mock function with given fields: log +func (_m *EVM2EVMOffRampInterface) ParseAlreadyAttempted(log types.Log) (*evm_2_evm_offramp.EVM2EVMOffRampAlreadyAttempted, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParseAlreadyAttempted") + } + + var r0 *evm_2_evm_offramp.EVM2EVMOffRampAlreadyAttempted + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (*evm_2_evm_offramp.EVM2EVMOffRampAlreadyAttempted, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) *evm_2_evm_offramp.EVM2EVMOffRampAlreadyAttempted); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*evm_2_evm_offramp.EVM2EVMOffRampAlreadyAttempted) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_ParseAlreadyAttempted_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseAlreadyAttempted' +type EVM2EVMOffRampInterface_ParseAlreadyAttempted_Call struct { + *mock.Call +} + +// ParseAlreadyAttempted is a helper method to define mock.On call +// - log types.Log +func (_e *EVM2EVMOffRampInterface_Expecter) ParseAlreadyAttempted(log interface{}) *EVM2EVMOffRampInterface_ParseAlreadyAttempted_Call { + return &EVM2EVMOffRampInterface_ParseAlreadyAttempted_Call{Call: _e.mock.On("ParseAlreadyAttempted", log)} +} + +func (_c *EVM2EVMOffRampInterface_ParseAlreadyAttempted_Call) Run(run func(log types.Log)) *EVM2EVMOffRampInterface_ParseAlreadyAttempted_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_ParseAlreadyAttempted_Call) Return(_a0 *evm_2_evm_offramp.EVM2EVMOffRampAlreadyAttempted, _a1 error) *EVM2EVMOffRampInterface_ParseAlreadyAttempted_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_ParseAlreadyAttempted_Call) RunAndReturn(run func(types.Log) (*evm_2_evm_offramp.EVM2EVMOffRampAlreadyAttempted, error)) *EVM2EVMOffRampInterface_ParseAlreadyAttempted_Call { + _c.Call.Return(run) + return _c +} + +// ParseConfigChanged provides a mock function with given fields: log +func (_m *EVM2EVMOffRampInterface) ParseConfigChanged(log types.Log) (*evm_2_evm_offramp.EVM2EVMOffRampConfigChanged, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParseConfigChanged") + } + + var r0 *evm_2_evm_offramp.EVM2EVMOffRampConfigChanged + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (*evm_2_evm_offramp.EVM2EVMOffRampConfigChanged, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) *evm_2_evm_offramp.EVM2EVMOffRampConfigChanged); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*evm_2_evm_offramp.EVM2EVMOffRampConfigChanged) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_ParseConfigChanged_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseConfigChanged' +type EVM2EVMOffRampInterface_ParseConfigChanged_Call struct { + *mock.Call +} + +// ParseConfigChanged is a helper method to define mock.On call +// - log types.Log +func (_e *EVM2EVMOffRampInterface_Expecter) ParseConfigChanged(log interface{}) *EVM2EVMOffRampInterface_ParseConfigChanged_Call { + return &EVM2EVMOffRampInterface_ParseConfigChanged_Call{Call: _e.mock.On("ParseConfigChanged", log)} +} + +func (_c *EVM2EVMOffRampInterface_ParseConfigChanged_Call) Run(run func(log types.Log)) *EVM2EVMOffRampInterface_ParseConfigChanged_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_ParseConfigChanged_Call) Return(_a0 *evm_2_evm_offramp.EVM2EVMOffRampConfigChanged, _a1 error) *EVM2EVMOffRampInterface_ParseConfigChanged_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_ParseConfigChanged_Call) RunAndReturn(run func(types.Log) (*evm_2_evm_offramp.EVM2EVMOffRampConfigChanged, error)) *EVM2EVMOffRampInterface_ParseConfigChanged_Call { + _c.Call.Return(run) + return _c +} + +// ParseConfigSet provides a mock function with given fields: log +func (_m *EVM2EVMOffRampInterface) ParseConfigSet(log types.Log) (*evm_2_evm_offramp.EVM2EVMOffRampConfigSet, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParseConfigSet") + } + + var r0 *evm_2_evm_offramp.EVM2EVMOffRampConfigSet + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (*evm_2_evm_offramp.EVM2EVMOffRampConfigSet, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) *evm_2_evm_offramp.EVM2EVMOffRampConfigSet); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*evm_2_evm_offramp.EVM2EVMOffRampConfigSet) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_ParseConfigSet_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseConfigSet' +type EVM2EVMOffRampInterface_ParseConfigSet_Call struct { + *mock.Call +} + +// ParseConfigSet is a helper method to define mock.On call +// - log types.Log +func (_e *EVM2EVMOffRampInterface_Expecter) ParseConfigSet(log interface{}) *EVM2EVMOffRampInterface_ParseConfigSet_Call { + return &EVM2EVMOffRampInterface_ParseConfigSet_Call{Call: _e.mock.On("ParseConfigSet", log)} +} + +func (_c *EVM2EVMOffRampInterface_ParseConfigSet_Call) Run(run func(log types.Log)) *EVM2EVMOffRampInterface_ParseConfigSet_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_ParseConfigSet_Call) Return(_a0 *evm_2_evm_offramp.EVM2EVMOffRampConfigSet, _a1 error) *EVM2EVMOffRampInterface_ParseConfigSet_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_ParseConfigSet_Call) RunAndReturn(run func(types.Log) (*evm_2_evm_offramp.EVM2EVMOffRampConfigSet, error)) *EVM2EVMOffRampInterface_ParseConfigSet_Call { + _c.Call.Return(run) + return _c +} + +// ParseConfigSet0 provides a mock function with given fields: log +func (_m *EVM2EVMOffRampInterface) ParseConfigSet0(log types.Log) (*evm_2_evm_offramp.EVM2EVMOffRampConfigSet0, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParseConfigSet0") + } + + var r0 *evm_2_evm_offramp.EVM2EVMOffRampConfigSet0 + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (*evm_2_evm_offramp.EVM2EVMOffRampConfigSet0, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) *evm_2_evm_offramp.EVM2EVMOffRampConfigSet0); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*evm_2_evm_offramp.EVM2EVMOffRampConfigSet0) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_ParseConfigSet0_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseConfigSet0' +type EVM2EVMOffRampInterface_ParseConfigSet0_Call struct { + *mock.Call +} + +// ParseConfigSet0 is a helper method to define mock.On call +// - log types.Log +func (_e *EVM2EVMOffRampInterface_Expecter) ParseConfigSet0(log interface{}) *EVM2EVMOffRampInterface_ParseConfigSet0_Call { + return &EVM2EVMOffRampInterface_ParseConfigSet0_Call{Call: _e.mock.On("ParseConfigSet0", log)} +} + +func (_c *EVM2EVMOffRampInterface_ParseConfigSet0_Call) Run(run func(log types.Log)) *EVM2EVMOffRampInterface_ParseConfigSet0_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_ParseConfigSet0_Call) Return(_a0 *evm_2_evm_offramp.EVM2EVMOffRampConfigSet0, _a1 error) *EVM2EVMOffRampInterface_ParseConfigSet0_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_ParseConfigSet0_Call) RunAndReturn(run func(types.Log) (*evm_2_evm_offramp.EVM2EVMOffRampConfigSet0, error)) *EVM2EVMOffRampInterface_ParseConfigSet0_Call { + _c.Call.Return(run) + return _c +} + +// ParseExecutionStateChanged provides a mock function with given fields: log +func (_m *EVM2EVMOffRampInterface) ParseExecutionStateChanged(log types.Log) (*evm_2_evm_offramp.EVM2EVMOffRampExecutionStateChanged, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParseExecutionStateChanged") + } + + var r0 *evm_2_evm_offramp.EVM2EVMOffRampExecutionStateChanged + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (*evm_2_evm_offramp.EVM2EVMOffRampExecutionStateChanged, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) *evm_2_evm_offramp.EVM2EVMOffRampExecutionStateChanged); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*evm_2_evm_offramp.EVM2EVMOffRampExecutionStateChanged) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_ParseExecutionStateChanged_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseExecutionStateChanged' +type EVM2EVMOffRampInterface_ParseExecutionStateChanged_Call struct { + *mock.Call +} + +// ParseExecutionStateChanged is a helper method to define mock.On call +// - log types.Log +func (_e *EVM2EVMOffRampInterface_Expecter) ParseExecutionStateChanged(log interface{}) *EVM2EVMOffRampInterface_ParseExecutionStateChanged_Call { + return &EVM2EVMOffRampInterface_ParseExecutionStateChanged_Call{Call: _e.mock.On("ParseExecutionStateChanged", log)} +} + +func (_c *EVM2EVMOffRampInterface_ParseExecutionStateChanged_Call) Run(run func(log types.Log)) *EVM2EVMOffRampInterface_ParseExecutionStateChanged_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_ParseExecutionStateChanged_Call) Return(_a0 *evm_2_evm_offramp.EVM2EVMOffRampExecutionStateChanged, _a1 error) *EVM2EVMOffRampInterface_ParseExecutionStateChanged_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_ParseExecutionStateChanged_Call) RunAndReturn(run func(types.Log) (*evm_2_evm_offramp.EVM2EVMOffRampExecutionStateChanged, error)) *EVM2EVMOffRampInterface_ParseExecutionStateChanged_Call { + _c.Call.Return(run) + return _c +} + +// ParseLog provides a mock function with given fields: log +func (_m *EVM2EVMOffRampInterface) ParseLog(log types.Log) (generated.AbigenLog, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParseLog") + } + + var r0 generated.AbigenLog + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (generated.AbigenLog, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) generated.AbigenLog); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(generated.AbigenLog) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_ParseLog_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseLog' +type EVM2EVMOffRampInterface_ParseLog_Call struct { + *mock.Call +} + +// ParseLog is a helper method to define mock.On call +// - log types.Log +func (_e *EVM2EVMOffRampInterface_Expecter) ParseLog(log interface{}) *EVM2EVMOffRampInterface_ParseLog_Call { + return &EVM2EVMOffRampInterface_ParseLog_Call{Call: _e.mock.On("ParseLog", log)} +} + +func (_c *EVM2EVMOffRampInterface_ParseLog_Call) Run(run func(log types.Log)) *EVM2EVMOffRampInterface_ParseLog_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_ParseLog_Call) Return(_a0 generated.AbigenLog, _a1 error) *EVM2EVMOffRampInterface_ParseLog_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_ParseLog_Call) RunAndReturn(run func(types.Log) (generated.AbigenLog, error)) *EVM2EVMOffRampInterface_ParseLog_Call { + _c.Call.Return(run) + return _c +} + +// ParseOwnershipTransferRequested provides a mock function with given fields: log +func (_m *EVM2EVMOffRampInterface) ParseOwnershipTransferRequested(log types.Log) (*evm_2_evm_offramp.EVM2EVMOffRampOwnershipTransferRequested, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParseOwnershipTransferRequested") + } + + var r0 *evm_2_evm_offramp.EVM2EVMOffRampOwnershipTransferRequested + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (*evm_2_evm_offramp.EVM2EVMOffRampOwnershipTransferRequested, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) *evm_2_evm_offramp.EVM2EVMOffRampOwnershipTransferRequested); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*evm_2_evm_offramp.EVM2EVMOffRampOwnershipTransferRequested) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_ParseOwnershipTransferRequested_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseOwnershipTransferRequested' +type EVM2EVMOffRampInterface_ParseOwnershipTransferRequested_Call struct { + *mock.Call +} + +// ParseOwnershipTransferRequested is a helper method to define mock.On call +// - log types.Log +func (_e *EVM2EVMOffRampInterface_Expecter) ParseOwnershipTransferRequested(log interface{}) *EVM2EVMOffRampInterface_ParseOwnershipTransferRequested_Call { + return &EVM2EVMOffRampInterface_ParseOwnershipTransferRequested_Call{Call: _e.mock.On("ParseOwnershipTransferRequested", log)} +} + +func (_c *EVM2EVMOffRampInterface_ParseOwnershipTransferRequested_Call) Run(run func(log types.Log)) *EVM2EVMOffRampInterface_ParseOwnershipTransferRequested_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_ParseOwnershipTransferRequested_Call) Return(_a0 *evm_2_evm_offramp.EVM2EVMOffRampOwnershipTransferRequested, _a1 error) *EVM2EVMOffRampInterface_ParseOwnershipTransferRequested_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_ParseOwnershipTransferRequested_Call) RunAndReturn(run func(types.Log) (*evm_2_evm_offramp.EVM2EVMOffRampOwnershipTransferRequested, error)) *EVM2EVMOffRampInterface_ParseOwnershipTransferRequested_Call { + _c.Call.Return(run) + return _c +} + +// ParseOwnershipTransferred provides a mock function with given fields: log +func (_m *EVM2EVMOffRampInterface) ParseOwnershipTransferred(log types.Log) (*evm_2_evm_offramp.EVM2EVMOffRampOwnershipTransferred, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParseOwnershipTransferred") + } + + var r0 *evm_2_evm_offramp.EVM2EVMOffRampOwnershipTransferred + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (*evm_2_evm_offramp.EVM2EVMOffRampOwnershipTransferred, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) *evm_2_evm_offramp.EVM2EVMOffRampOwnershipTransferred); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*evm_2_evm_offramp.EVM2EVMOffRampOwnershipTransferred) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_ParseOwnershipTransferred_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseOwnershipTransferred' +type EVM2EVMOffRampInterface_ParseOwnershipTransferred_Call struct { + *mock.Call +} + +// ParseOwnershipTransferred is a helper method to define mock.On call +// - log types.Log +func (_e *EVM2EVMOffRampInterface_Expecter) ParseOwnershipTransferred(log interface{}) *EVM2EVMOffRampInterface_ParseOwnershipTransferred_Call { + return &EVM2EVMOffRampInterface_ParseOwnershipTransferred_Call{Call: _e.mock.On("ParseOwnershipTransferred", log)} +} + +func (_c *EVM2EVMOffRampInterface_ParseOwnershipTransferred_Call) Run(run func(log types.Log)) *EVM2EVMOffRampInterface_ParseOwnershipTransferred_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_ParseOwnershipTransferred_Call) Return(_a0 *evm_2_evm_offramp.EVM2EVMOffRampOwnershipTransferred, _a1 error) *EVM2EVMOffRampInterface_ParseOwnershipTransferred_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_ParseOwnershipTransferred_Call) RunAndReturn(run func(types.Log) (*evm_2_evm_offramp.EVM2EVMOffRampOwnershipTransferred, error)) *EVM2EVMOffRampInterface_ParseOwnershipTransferred_Call { + _c.Call.Return(run) + return _c +} + +// ParseSkippedAlreadyExecutedMessage provides a mock function with given fields: log +func (_m *EVM2EVMOffRampInterface) ParseSkippedAlreadyExecutedMessage(log types.Log) (*evm_2_evm_offramp.EVM2EVMOffRampSkippedAlreadyExecutedMessage, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParseSkippedAlreadyExecutedMessage") + } + + var r0 *evm_2_evm_offramp.EVM2EVMOffRampSkippedAlreadyExecutedMessage + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (*evm_2_evm_offramp.EVM2EVMOffRampSkippedAlreadyExecutedMessage, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) *evm_2_evm_offramp.EVM2EVMOffRampSkippedAlreadyExecutedMessage); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*evm_2_evm_offramp.EVM2EVMOffRampSkippedAlreadyExecutedMessage) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_ParseSkippedAlreadyExecutedMessage_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseSkippedAlreadyExecutedMessage' +type EVM2EVMOffRampInterface_ParseSkippedAlreadyExecutedMessage_Call struct { + *mock.Call +} + +// ParseSkippedAlreadyExecutedMessage is a helper method to define mock.On call +// - log types.Log +func (_e *EVM2EVMOffRampInterface_Expecter) ParseSkippedAlreadyExecutedMessage(log interface{}) *EVM2EVMOffRampInterface_ParseSkippedAlreadyExecutedMessage_Call { + return &EVM2EVMOffRampInterface_ParseSkippedAlreadyExecutedMessage_Call{Call: _e.mock.On("ParseSkippedAlreadyExecutedMessage", log)} +} + +func (_c *EVM2EVMOffRampInterface_ParseSkippedAlreadyExecutedMessage_Call) Run(run func(log types.Log)) *EVM2EVMOffRampInterface_ParseSkippedAlreadyExecutedMessage_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_ParseSkippedAlreadyExecutedMessage_Call) Return(_a0 *evm_2_evm_offramp.EVM2EVMOffRampSkippedAlreadyExecutedMessage, _a1 error) *EVM2EVMOffRampInterface_ParseSkippedAlreadyExecutedMessage_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_ParseSkippedAlreadyExecutedMessage_Call) RunAndReturn(run func(types.Log) (*evm_2_evm_offramp.EVM2EVMOffRampSkippedAlreadyExecutedMessage, error)) *EVM2EVMOffRampInterface_ParseSkippedAlreadyExecutedMessage_Call { + _c.Call.Return(run) + return _c +} + +// ParseSkippedIncorrectNonce provides a mock function with given fields: log +func (_m *EVM2EVMOffRampInterface) ParseSkippedIncorrectNonce(log types.Log) (*evm_2_evm_offramp.EVM2EVMOffRampSkippedIncorrectNonce, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParseSkippedIncorrectNonce") + } + + var r0 *evm_2_evm_offramp.EVM2EVMOffRampSkippedIncorrectNonce + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (*evm_2_evm_offramp.EVM2EVMOffRampSkippedIncorrectNonce, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) *evm_2_evm_offramp.EVM2EVMOffRampSkippedIncorrectNonce); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*evm_2_evm_offramp.EVM2EVMOffRampSkippedIncorrectNonce) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_ParseSkippedIncorrectNonce_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseSkippedIncorrectNonce' +type EVM2EVMOffRampInterface_ParseSkippedIncorrectNonce_Call struct { + *mock.Call +} + +// ParseSkippedIncorrectNonce is a helper method to define mock.On call +// - log types.Log +func (_e *EVM2EVMOffRampInterface_Expecter) ParseSkippedIncorrectNonce(log interface{}) *EVM2EVMOffRampInterface_ParseSkippedIncorrectNonce_Call { + return &EVM2EVMOffRampInterface_ParseSkippedIncorrectNonce_Call{Call: _e.mock.On("ParseSkippedIncorrectNonce", log)} +} + +func (_c *EVM2EVMOffRampInterface_ParseSkippedIncorrectNonce_Call) Run(run func(log types.Log)) *EVM2EVMOffRampInterface_ParseSkippedIncorrectNonce_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_ParseSkippedIncorrectNonce_Call) Return(_a0 *evm_2_evm_offramp.EVM2EVMOffRampSkippedIncorrectNonce, _a1 error) *EVM2EVMOffRampInterface_ParseSkippedIncorrectNonce_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_ParseSkippedIncorrectNonce_Call) RunAndReturn(run func(types.Log) (*evm_2_evm_offramp.EVM2EVMOffRampSkippedIncorrectNonce, error)) *EVM2EVMOffRampInterface_ParseSkippedIncorrectNonce_Call { + _c.Call.Return(run) + return _c +} + +// ParseSkippedSenderWithPreviousRampMessageInflight provides a mock function with given fields: log +func (_m *EVM2EVMOffRampInterface) ParseSkippedSenderWithPreviousRampMessageInflight(log types.Log) (*evm_2_evm_offramp.EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflight, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParseSkippedSenderWithPreviousRampMessageInflight") + } + + var r0 *evm_2_evm_offramp.EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflight + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (*evm_2_evm_offramp.EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflight, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) *evm_2_evm_offramp.EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflight); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*evm_2_evm_offramp.EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflight) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_ParseSkippedSenderWithPreviousRampMessageInflight_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseSkippedSenderWithPreviousRampMessageInflight' +type EVM2EVMOffRampInterface_ParseSkippedSenderWithPreviousRampMessageInflight_Call struct { + *mock.Call +} + +// ParseSkippedSenderWithPreviousRampMessageInflight is a helper method to define mock.On call +// - log types.Log +func (_e *EVM2EVMOffRampInterface_Expecter) ParseSkippedSenderWithPreviousRampMessageInflight(log interface{}) *EVM2EVMOffRampInterface_ParseSkippedSenderWithPreviousRampMessageInflight_Call { + return &EVM2EVMOffRampInterface_ParseSkippedSenderWithPreviousRampMessageInflight_Call{Call: _e.mock.On("ParseSkippedSenderWithPreviousRampMessageInflight", log)} +} + +func (_c *EVM2EVMOffRampInterface_ParseSkippedSenderWithPreviousRampMessageInflight_Call) Run(run func(log types.Log)) *EVM2EVMOffRampInterface_ParseSkippedSenderWithPreviousRampMessageInflight_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_ParseSkippedSenderWithPreviousRampMessageInflight_Call) Return(_a0 *evm_2_evm_offramp.EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflight, _a1 error) *EVM2EVMOffRampInterface_ParseSkippedSenderWithPreviousRampMessageInflight_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_ParseSkippedSenderWithPreviousRampMessageInflight_Call) RunAndReturn(run func(types.Log) (*evm_2_evm_offramp.EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflight, error)) *EVM2EVMOffRampInterface_ParseSkippedSenderWithPreviousRampMessageInflight_Call { + _c.Call.Return(run) + return _c +} + +// ParseTokenAggregateRateLimitAdded provides a mock function with given fields: log +func (_m *EVM2EVMOffRampInterface) ParseTokenAggregateRateLimitAdded(log types.Log) (*evm_2_evm_offramp.EVM2EVMOffRampTokenAggregateRateLimitAdded, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParseTokenAggregateRateLimitAdded") + } + + var r0 *evm_2_evm_offramp.EVM2EVMOffRampTokenAggregateRateLimitAdded + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (*evm_2_evm_offramp.EVM2EVMOffRampTokenAggregateRateLimitAdded, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) *evm_2_evm_offramp.EVM2EVMOffRampTokenAggregateRateLimitAdded); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*evm_2_evm_offramp.EVM2EVMOffRampTokenAggregateRateLimitAdded) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_ParseTokenAggregateRateLimitAdded_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseTokenAggregateRateLimitAdded' +type EVM2EVMOffRampInterface_ParseTokenAggregateRateLimitAdded_Call struct { + *mock.Call +} + +// ParseTokenAggregateRateLimitAdded is a helper method to define mock.On call +// - log types.Log +func (_e *EVM2EVMOffRampInterface_Expecter) ParseTokenAggregateRateLimitAdded(log interface{}) *EVM2EVMOffRampInterface_ParseTokenAggregateRateLimitAdded_Call { + return &EVM2EVMOffRampInterface_ParseTokenAggregateRateLimitAdded_Call{Call: _e.mock.On("ParseTokenAggregateRateLimitAdded", log)} +} + +func (_c *EVM2EVMOffRampInterface_ParseTokenAggregateRateLimitAdded_Call) Run(run func(log types.Log)) *EVM2EVMOffRampInterface_ParseTokenAggregateRateLimitAdded_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_ParseTokenAggregateRateLimitAdded_Call) Return(_a0 *evm_2_evm_offramp.EVM2EVMOffRampTokenAggregateRateLimitAdded, _a1 error) *EVM2EVMOffRampInterface_ParseTokenAggregateRateLimitAdded_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_ParseTokenAggregateRateLimitAdded_Call) RunAndReturn(run func(types.Log) (*evm_2_evm_offramp.EVM2EVMOffRampTokenAggregateRateLimitAdded, error)) *EVM2EVMOffRampInterface_ParseTokenAggregateRateLimitAdded_Call { + _c.Call.Return(run) + return _c +} + +// ParseTokenAggregateRateLimitRemoved provides a mock function with given fields: log +func (_m *EVM2EVMOffRampInterface) ParseTokenAggregateRateLimitRemoved(log types.Log) (*evm_2_evm_offramp.EVM2EVMOffRampTokenAggregateRateLimitRemoved, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParseTokenAggregateRateLimitRemoved") + } + + var r0 *evm_2_evm_offramp.EVM2EVMOffRampTokenAggregateRateLimitRemoved + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (*evm_2_evm_offramp.EVM2EVMOffRampTokenAggregateRateLimitRemoved, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) *evm_2_evm_offramp.EVM2EVMOffRampTokenAggregateRateLimitRemoved); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*evm_2_evm_offramp.EVM2EVMOffRampTokenAggregateRateLimitRemoved) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_ParseTokenAggregateRateLimitRemoved_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseTokenAggregateRateLimitRemoved' +type EVM2EVMOffRampInterface_ParseTokenAggregateRateLimitRemoved_Call struct { + *mock.Call +} + +// ParseTokenAggregateRateLimitRemoved is a helper method to define mock.On call +// - log types.Log +func (_e *EVM2EVMOffRampInterface_Expecter) ParseTokenAggregateRateLimitRemoved(log interface{}) *EVM2EVMOffRampInterface_ParseTokenAggregateRateLimitRemoved_Call { + return &EVM2EVMOffRampInterface_ParseTokenAggregateRateLimitRemoved_Call{Call: _e.mock.On("ParseTokenAggregateRateLimitRemoved", log)} +} + +func (_c *EVM2EVMOffRampInterface_ParseTokenAggregateRateLimitRemoved_Call) Run(run func(log types.Log)) *EVM2EVMOffRampInterface_ParseTokenAggregateRateLimitRemoved_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_ParseTokenAggregateRateLimitRemoved_Call) Return(_a0 *evm_2_evm_offramp.EVM2EVMOffRampTokenAggregateRateLimitRemoved, _a1 error) *EVM2EVMOffRampInterface_ParseTokenAggregateRateLimitRemoved_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_ParseTokenAggregateRateLimitRemoved_Call) RunAndReturn(run func(types.Log) (*evm_2_evm_offramp.EVM2EVMOffRampTokenAggregateRateLimitRemoved, error)) *EVM2EVMOffRampInterface_ParseTokenAggregateRateLimitRemoved_Call { + _c.Call.Return(run) + return _c +} + +// ParseTokensConsumed provides a mock function with given fields: log +func (_m *EVM2EVMOffRampInterface) ParseTokensConsumed(log types.Log) (*evm_2_evm_offramp.EVM2EVMOffRampTokensConsumed, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParseTokensConsumed") + } + + var r0 *evm_2_evm_offramp.EVM2EVMOffRampTokensConsumed + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (*evm_2_evm_offramp.EVM2EVMOffRampTokensConsumed, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) *evm_2_evm_offramp.EVM2EVMOffRampTokensConsumed); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*evm_2_evm_offramp.EVM2EVMOffRampTokensConsumed) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_ParseTokensConsumed_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseTokensConsumed' +type EVM2EVMOffRampInterface_ParseTokensConsumed_Call struct { + *mock.Call +} + +// ParseTokensConsumed is a helper method to define mock.On call +// - log types.Log +func (_e *EVM2EVMOffRampInterface_Expecter) ParseTokensConsumed(log interface{}) *EVM2EVMOffRampInterface_ParseTokensConsumed_Call { + return &EVM2EVMOffRampInterface_ParseTokensConsumed_Call{Call: _e.mock.On("ParseTokensConsumed", log)} +} + +func (_c *EVM2EVMOffRampInterface_ParseTokensConsumed_Call) Run(run func(log types.Log)) *EVM2EVMOffRampInterface_ParseTokensConsumed_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_ParseTokensConsumed_Call) Return(_a0 *evm_2_evm_offramp.EVM2EVMOffRampTokensConsumed, _a1 error) *EVM2EVMOffRampInterface_ParseTokensConsumed_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_ParseTokensConsumed_Call) RunAndReturn(run func(types.Log) (*evm_2_evm_offramp.EVM2EVMOffRampTokensConsumed, error)) *EVM2EVMOffRampInterface_ParseTokensConsumed_Call { + _c.Call.Return(run) + return _c +} + +// ParseTransmitted provides a mock function with given fields: log +func (_m *EVM2EVMOffRampInterface) ParseTransmitted(log types.Log) (*evm_2_evm_offramp.EVM2EVMOffRampTransmitted, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParseTransmitted") + } + + var r0 *evm_2_evm_offramp.EVM2EVMOffRampTransmitted + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (*evm_2_evm_offramp.EVM2EVMOffRampTransmitted, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) *evm_2_evm_offramp.EVM2EVMOffRampTransmitted); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*evm_2_evm_offramp.EVM2EVMOffRampTransmitted) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_ParseTransmitted_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseTransmitted' +type EVM2EVMOffRampInterface_ParseTransmitted_Call struct { + *mock.Call +} + +// ParseTransmitted is a helper method to define mock.On call +// - log types.Log +func (_e *EVM2EVMOffRampInterface_Expecter) ParseTransmitted(log interface{}) *EVM2EVMOffRampInterface_ParseTransmitted_Call { + return &EVM2EVMOffRampInterface_ParseTransmitted_Call{Call: _e.mock.On("ParseTransmitted", log)} +} + +func (_c *EVM2EVMOffRampInterface_ParseTransmitted_Call) Run(run func(log types.Log)) *EVM2EVMOffRampInterface_ParseTransmitted_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_ParseTransmitted_Call) Return(_a0 *evm_2_evm_offramp.EVM2EVMOffRampTransmitted, _a1 error) *EVM2EVMOffRampInterface_ParseTransmitted_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_ParseTransmitted_Call) RunAndReturn(run func(types.Log) (*evm_2_evm_offramp.EVM2EVMOffRampTransmitted, error)) *EVM2EVMOffRampInterface_ParseTransmitted_Call { + _c.Call.Return(run) + return _c +} + +// SetAdmin provides a mock function with given fields: opts, newAdmin +func (_m *EVM2EVMOffRampInterface) SetAdmin(opts *bind.TransactOpts, newAdmin common.Address) (*types.Transaction, error) { + ret := _m.Called(opts, newAdmin) + + if len(ret) == 0 { + panic("no return value specified for SetAdmin") + } + + var r0 *types.Transaction + var r1 error + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, common.Address) (*types.Transaction, error)); ok { + return rf(opts, newAdmin) + } + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, common.Address) *types.Transaction); ok { + r0 = rf(opts, newAdmin) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Transaction) + } + } + + if rf, ok := ret.Get(1).(func(*bind.TransactOpts, common.Address) error); ok { + r1 = rf(opts, newAdmin) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_SetAdmin_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetAdmin' +type EVM2EVMOffRampInterface_SetAdmin_Call struct { + *mock.Call +} + +// SetAdmin is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - newAdmin common.Address +func (_e *EVM2EVMOffRampInterface_Expecter) SetAdmin(opts interface{}, newAdmin interface{}) *EVM2EVMOffRampInterface_SetAdmin_Call { + return &EVM2EVMOffRampInterface_SetAdmin_Call{Call: _e.mock.On("SetAdmin", opts, newAdmin)} +} + +func (_c *EVM2EVMOffRampInterface_SetAdmin_Call) Run(run func(opts *bind.TransactOpts, newAdmin common.Address)) *EVM2EVMOffRampInterface_SetAdmin_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].(common.Address)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_SetAdmin_Call) Return(_a0 *types.Transaction, _a1 error) *EVM2EVMOffRampInterface_SetAdmin_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_SetAdmin_Call) RunAndReturn(run func(*bind.TransactOpts, common.Address) (*types.Transaction, error)) *EVM2EVMOffRampInterface_SetAdmin_Call { + _c.Call.Return(run) + return _c +} + +// SetOCR2Config provides a mock function with given fields: opts, signers, transmitters, f, onchainConfig, offchainConfigVersion, offchainConfig +func (_m *EVM2EVMOffRampInterface) SetOCR2Config(opts *bind.TransactOpts, signers []common.Address, transmitters []common.Address, f uint8, onchainConfig []byte, offchainConfigVersion uint64, offchainConfig []byte) (*types.Transaction, error) { + ret := _m.Called(opts, signers, transmitters, f, onchainConfig, offchainConfigVersion, offchainConfig) + + if len(ret) == 0 { + panic("no return value specified for SetOCR2Config") + } + + var r0 *types.Transaction + var r1 error + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, []common.Address, []common.Address, uint8, []byte, uint64, []byte) (*types.Transaction, error)); ok { + return rf(opts, signers, transmitters, f, onchainConfig, offchainConfigVersion, offchainConfig) + } + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, []common.Address, []common.Address, uint8, []byte, uint64, []byte) *types.Transaction); ok { + r0 = rf(opts, signers, transmitters, f, onchainConfig, offchainConfigVersion, offchainConfig) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Transaction) + } + } + + if rf, ok := ret.Get(1).(func(*bind.TransactOpts, []common.Address, []common.Address, uint8, []byte, uint64, []byte) error); ok { + r1 = rf(opts, signers, transmitters, f, onchainConfig, offchainConfigVersion, offchainConfig) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_SetOCR2Config_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetOCR2Config' +type EVM2EVMOffRampInterface_SetOCR2Config_Call struct { + *mock.Call +} + +// SetOCR2Config is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - signers []common.Address +// - transmitters []common.Address +// - f uint8 +// - onchainConfig []byte +// - offchainConfigVersion uint64 +// - offchainConfig []byte +func (_e *EVM2EVMOffRampInterface_Expecter) SetOCR2Config(opts interface{}, signers interface{}, transmitters interface{}, f interface{}, onchainConfig interface{}, offchainConfigVersion interface{}, offchainConfig interface{}) *EVM2EVMOffRampInterface_SetOCR2Config_Call { + return &EVM2EVMOffRampInterface_SetOCR2Config_Call{Call: _e.mock.On("SetOCR2Config", opts, signers, transmitters, f, onchainConfig, offchainConfigVersion, offchainConfig)} +} + +func (_c *EVM2EVMOffRampInterface_SetOCR2Config_Call) Run(run func(opts *bind.TransactOpts, signers []common.Address, transmitters []common.Address, f uint8, onchainConfig []byte, offchainConfigVersion uint64, offchainConfig []byte)) *EVM2EVMOffRampInterface_SetOCR2Config_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].([]common.Address), args[2].([]common.Address), args[3].(uint8), args[4].([]byte), args[5].(uint64), args[6].([]byte)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_SetOCR2Config_Call) Return(_a0 *types.Transaction, _a1 error) *EVM2EVMOffRampInterface_SetOCR2Config_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_SetOCR2Config_Call) RunAndReturn(run func(*bind.TransactOpts, []common.Address, []common.Address, uint8, []byte, uint64, []byte) (*types.Transaction, error)) *EVM2EVMOffRampInterface_SetOCR2Config_Call { + _c.Call.Return(run) + return _c +} + +// SetRateLimiterConfig provides a mock function with given fields: opts, config +func (_m *EVM2EVMOffRampInterface) SetRateLimiterConfig(opts *bind.TransactOpts, config evm_2_evm_offramp.RateLimiterConfig) (*types.Transaction, error) { + ret := _m.Called(opts, config) + + if len(ret) == 0 { + panic("no return value specified for SetRateLimiterConfig") + } + + var r0 *types.Transaction + var r1 error + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, evm_2_evm_offramp.RateLimiterConfig) (*types.Transaction, error)); ok { + return rf(opts, config) + } + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, evm_2_evm_offramp.RateLimiterConfig) *types.Transaction); ok { + r0 = rf(opts, config) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Transaction) + } + } + + if rf, ok := ret.Get(1).(func(*bind.TransactOpts, evm_2_evm_offramp.RateLimiterConfig) error); ok { + r1 = rf(opts, config) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_SetRateLimiterConfig_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetRateLimiterConfig' +type EVM2EVMOffRampInterface_SetRateLimiterConfig_Call struct { + *mock.Call +} + +// SetRateLimiterConfig is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - config evm_2_evm_offramp.RateLimiterConfig +func (_e *EVM2EVMOffRampInterface_Expecter) SetRateLimiterConfig(opts interface{}, config interface{}) *EVM2EVMOffRampInterface_SetRateLimiterConfig_Call { + return &EVM2EVMOffRampInterface_SetRateLimiterConfig_Call{Call: _e.mock.On("SetRateLimiterConfig", opts, config)} +} + +func (_c *EVM2EVMOffRampInterface_SetRateLimiterConfig_Call) Run(run func(opts *bind.TransactOpts, config evm_2_evm_offramp.RateLimiterConfig)) *EVM2EVMOffRampInterface_SetRateLimiterConfig_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].(evm_2_evm_offramp.RateLimiterConfig)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_SetRateLimiterConfig_Call) Return(_a0 *types.Transaction, _a1 error) *EVM2EVMOffRampInterface_SetRateLimiterConfig_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_SetRateLimiterConfig_Call) RunAndReturn(run func(*bind.TransactOpts, evm_2_evm_offramp.RateLimiterConfig) (*types.Transaction, error)) *EVM2EVMOffRampInterface_SetRateLimiterConfig_Call { + _c.Call.Return(run) + return _c +} + +// TransferOwnership provides a mock function with given fields: opts, to +func (_m *EVM2EVMOffRampInterface) TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) { + ret := _m.Called(opts, to) + + if len(ret) == 0 { + panic("no return value specified for TransferOwnership") + } + + var r0 *types.Transaction + var r1 error + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, common.Address) (*types.Transaction, error)); ok { + return rf(opts, to) + } + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, common.Address) *types.Transaction); ok { + r0 = rf(opts, to) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Transaction) + } + } + + if rf, ok := ret.Get(1).(func(*bind.TransactOpts, common.Address) error); ok { + r1 = rf(opts, to) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_TransferOwnership_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TransferOwnership' +type EVM2EVMOffRampInterface_TransferOwnership_Call struct { + *mock.Call +} + +// TransferOwnership is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - to common.Address +func (_e *EVM2EVMOffRampInterface_Expecter) TransferOwnership(opts interface{}, to interface{}) *EVM2EVMOffRampInterface_TransferOwnership_Call { + return &EVM2EVMOffRampInterface_TransferOwnership_Call{Call: _e.mock.On("TransferOwnership", opts, to)} +} + +func (_c *EVM2EVMOffRampInterface_TransferOwnership_Call) Run(run func(opts *bind.TransactOpts, to common.Address)) *EVM2EVMOffRampInterface_TransferOwnership_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].(common.Address)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_TransferOwnership_Call) Return(_a0 *types.Transaction, _a1 error) *EVM2EVMOffRampInterface_TransferOwnership_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_TransferOwnership_Call) RunAndReturn(run func(*bind.TransactOpts, common.Address) (*types.Transaction, error)) *EVM2EVMOffRampInterface_TransferOwnership_Call { + _c.Call.Return(run) + return _c +} + +// Transmit provides a mock function with given fields: opts, reportContext, report, rs, ss, arg4 +func (_m *EVM2EVMOffRampInterface) Transmit(opts *bind.TransactOpts, reportContext [3][32]byte, report []byte, rs [][32]byte, ss [][32]byte, arg4 [32]byte) (*types.Transaction, error) { + ret := _m.Called(opts, reportContext, report, rs, ss, arg4) + + if len(ret) == 0 { + panic("no return value specified for Transmit") + } + + var r0 *types.Transaction + var r1 error + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, [3][32]byte, []byte, [][32]byte, [][32]byte, [32]byte) (*types.Transaction, error)); ok { + return rf(opts, reportContext, report, rs, ss, arg4) + } + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, [3][32]byte, []byte, [][32]byte, [][32]byte, [32]byte) *types.Transaction); ok { + r0 = rf(opts, reportContext, report, rs, ss, arg4) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Transaction) + } + } + + if rf, ok := ret.Get(1).(func(*bind.TransactOpts, [3][32]byte, []byte, [][32]byte, [][32]byte, [32]byte) error); ok { + r1 = rf(opts, reportContext, report, rs, ss, arg4) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_Transmit_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Transmit' +type EVM2EVMOffRampInterface_Transmit_Call struct { + *mock.Call +} + +// Transmit is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - reportContext [3][32]byte +// - report []byte +// - rs [][32]byte +// - ss [][32]byte +// - arg4 [32]byte +func (_e *EVM2EVMOffRampInterface_Expecter) Transmit(opts interface{}, reportContext interface{}, report interface{}, rs interface{}, ss interface{}, arg4 interface{}) *EVM2EVMOffRampInterface_Transmit_Call { + return &EVM2EVMOffRampInterface_Transmit_Call{Call: _e.mock.On("Transmit", opts, reportContext, report, rs, ss, arg4)} +} + +func (_c *EVM2EVMOffRampInterface_Transmit_Call) Run(run func(opts *bind.TransactOpts, reportContext [3][32]byte, report []byte, rs [][32]byte, ss [][32]byte, arg4 [32]byte)) *EVM2EVMOffRampInterface_Transmit_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].([3][32]byte), args[2].([]byte), args[3].([][32]byte), args[4].([][32]byte), args[5].([32]byte)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_Transmit_Call) Return(_a0 *types.Transaction, _a1 error) *EVM2EVMOffRampInterface_Transmit_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_Transmit_Call) RunAndReturn(run func(*bind.TransactOpts, [3][32]byte, []byte, [][32]byte, [][32]byte, [32]byte) (*types.Transaction, error)) *EVM2EVMOffRampInterface_Transmit_Call { + _c.Call.Return(run) + return _c +} + +// TypeAndVersion provides a mock function with given fields: opts +func (_m *EVM2EVMOffRampInterface) TypeAndVersion(opts *bind.CallOpts) (string, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for TypeAndVersion") + } + + var r0 string + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts) (string, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts) string); ok { + r0 = rf(opts) + } else { + r0 = ret.Get(0).(string) + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_TypeAndVersion_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TypeAndVersion' +type EVM2EVMOffRampInterface_TypeAndVersion_Call struct { + *mock.Call +} + +// TypeAndVersion is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *EVM2EVMOffRampInterface_Expecter) TypeAndVersion(opts interface{}) *EVM2EVMOffRampInterface_TypeAndVersion_Call { + return &EVM2EVMOffRampInterface_TypeAndVersion_Call{Call: _e.mock.On("TypeAndVersion", opts)} +} + +func (_c *EVM2EVMOffRampInterface_TypeAndVersion_Call) Run(run func(opts *bind.CallOpts)) *EVM2EVMOffRampInterface_TypeAndVersion_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_TypeAndVersion_Call) Return(_a0 string, _a1 error) *EVM2EVMOffRampInterface_TypeAndVersion_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_TypeAndVersion_Call) RunAndReturn(run func(*bind.CallOpts) (string, error)) *EVM2EVMOffRampInterface_TypeAndVersion_Call { + _c.Call.Return(run) + return _c +} + +// UpdateRateLimitTokens provides a mock function with given fields: opts, removes, adds +func (_m *EVM2EVMOffRampInterface) UpdateRateLimitTokens(opts *bind.TransactOpts, removes []evm_2_evm_offramp.EVM2EVMOffRampRateLimitToken, adds []evm_2_evm_offramp.EVM2EVMOffRampRateLimitToken) (*types.Transaction, error) { + ret := _m.Called(opts, removes, adds) + + if len(ret) == 0 { + panic("no return value specified for UpdateRateLimitTokens") + } + + var r0 *types.Transaction + var r1 error + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, []evm_2_evm_offramp.EVM2EVMOffRampRateLimitToken, []evm_2_evm_offramp.EVM2EVMOffRampRateLimitToken) (*types.Transaction, error)); ok { + return rf(opts, removes, adds) + } + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, []evm_2_evm_offramp.EVM2EVMOffRampRateLimitToken, []evm_2_evm_offramp.EVM2EVMOffRampRateLimitToken) *types.Transaction); ok { + r0 = rf(opts, removes, adds) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Transaction) + } + } + + if rf, ok := ret.Get(1).(func(*bind.TransactOpts, []evm_2_evm_offramp.EVM2EVMOffRampRateLimitToken, []evm_2_evm_offramp.EVM2EVMOffRampRateLimitToken) error); ok { + r1 = rf(opts, removes, adds) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_UpdateRateLimitTokens_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateRateLimitTokens' +type EVM2EVMOffRampInterface_UpdateRateLimitTokens_Call struct { + *mock.Call +} + +// UpdateRateLimitTokens is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - removes []evm_2_evm_offramp.EVM2EVMOffRampRateLimitToken +// - adds []evm_2_evm_offramp.EVM2EVMOffRampRateLimitToken +func (_e *EVM2EVMOffRampInterface_Expecter) UpdateRateLimitTokens(opts interface{}, removes interface{}, adds interface{}) *EVM2EVMOffRampInterface_UpdateRateLimitTokens_Call { + return &EVM2EVMOffRampInterface_UpdateRateLimitTokens_Call{Call: _e.mock.On("UpdateRateLimitTokens", opts, removes, adds)} +} + +func (_c *EVM2EVMOffRampInterface_UpdateRateLimitTokens_Call) Run(run func(opts *bind.TransactOpts, removes []evm_2_evm_offramp.EVM2EVMOffRampRateLimitToken, adds []evm_2_evm_offramp.EVM2EVMOffRampRateLimitToken)) *EVM2EVMOffRampInterface_UpdateRateLimitTokens_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].([]evm_2_evm_offramp.EVM2EVMOffRampRateLimitToken), args[2].([]evm_2_evm_offramp.EVM2EVMOffRampRateLimitToken)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_UpdateRateLimitTokens_Call) Return(_a0 *types.Transaction, _a1 error) *EVM2EVMOffRampInterface_UpdateRateLimitTokens_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_UpdateRateLimitTokens_Call) RunAndReturn(run func(*bind.TransactOpts, []evm_2_evm_offramp.EVM2EVMOffRampRateLimitToken, []evm_2_evm_offramp.EVM2EVMOffRampRateLimitToken) (*types.Transaction, error)) *EVM2EVMOffRampInterface_UpdateRateLimitTokens_Call { + _c.Call.Return(run) + return _c +} + +// WatchAdminSet provides a mock function with given fields: opts, sink +func (_m *EVM2EVMOffRampInterface) WatchAdminSet(opts *bind.WatchOpts, sink chan<- *evm_2_evm_offramp.EVM2EVMOffRampAdminSet) (event.Subscription, error) { + ret := _m.Called(opts, sink) + + if len(ret) == 0 { + panic("no return value specified for WatchAdminSet") + } + + var r0 event.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp.EVM2EVMOffRampAdminSet) (event.Subscription, error)); ok { + return rf(opts, sink) + } + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp.EVM2EVMOffRampAdminSet) event.Subscription); ok { + r0 = rf(opts, sink) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(event.Subscription) + } + } + + if rf, ok := ret.Get(1).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp.EVM2EVMOffRampAdminSet) error); ok { + r1 = rf(opts, sink) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_WatchAdminSet_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchAdminSet' +type EVM2EVMOffRampInterface_WatchAdminSet_Call struct { + *mock.Call +} + +// WatchAdminSet is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *evm_2_evm_offramp.EVM2EVMOffRampAdminSet +func (_e *EVM2EVMOffRampInterface_Expecter) WatchAdminSet(opts interface{}, sink interface{}) *EVM2EVMOffRampInterface_WatchAdminSet_Call { + return &EVM2EVMOffRampInterface_WatchAdminSet_Call{Call: _e.mock.On("WatchAdminSet", opts, sink)} +} + +func (_c *EVM2EVMOffRampInterface_WatchAdminSet_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *evm_2_evm_offramp.EVM2EVMOffRampAdminSet)) *EVM2EVMOffRampInterface_WatchAdminSet_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *evm_2_evm_offramp.EVM2EVMOffRampAdminSet)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_WatchAdminSet_Call) Return(_a0 event.Subscription, _a1 error) *EVM2EVMOffRampInterface_WatchAdminSet_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_WatchAdminSet_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *evm_2_evm_offramp.EVM2EVMOffRampAdminSet) (event.Subscription, error)) *EVM2EVMOffRampInterface_WatchAdminSet_Call { + _c.Call.Return(run) + return _c +} + +// WatchAlreadyAttempted provides a mock function with given fields: opts, sink +func (_m *EVM2EVMOffRampInterface) WatchAlreadyAttempted(opts *bind.WatchOpts, sink chan<- *evm_2_evm_offramp.EVM2EVMOffRampAlreadyAttempted) (event.Subscription, error) { + ret := _m.Called(opts, sink) + + if len(ret) == 0 { + panic("no return value specified for WatchAlreadyAttempted") + } + + var r0 event.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp.EVM2EVMOffRampAlreadyAttempted) (event.Subscription, error)); ok { + return rf(opts, sink) + } + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp.EVM2EVMOffRampAlreadyAttempted) event.Subscription); ok { + r0 = rf(opts, sink) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(event.Subscription) + } + } + + if rf, ok := ret.Get(1).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp.EVM2EVMOffRampAlreadyAttempted) error); ok { + r1 = rf(opts, sink) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_WatchAlreadyAttempted_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchAlreadyAttempted' +type EVM2EVMOffRampInterface_WatchAlreadyAttempted_Call struct { + *mock.Call +} + +// WatchAlreadyAttempted is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *evm_2_evm_offramp.EVM2EVMOffRampAlreadyAttempted +func (_e *EVM2EVMOffRampInterface_Expecter) WatchAlreadyAttempted(opts interface{}, sink interface{}) *EVM2EVMOffRampInterface_WatchAlreadyAttempted_Call { + return &EVM2EVMOffRampInterface_WatchAlreadyAttempted_Call{Call: _e.mock.On("WatchAlreadyAttempted", opts, sink)} +} + +func (_c *EVM2EVMOffRampInterface_WatchAlreadyAttempted_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *evm_2_evm_offramp.EVM2EVMOffRampAlreadyAttempted)) *EVM2EVMOffRampInterface_WatchAlreadyAttempted_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *evm_2_evm_offramp.EVM2EVMOffRampAlreadyAttempted)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_WatchAlreadyAttempted_Call) Return(_a0 event.Subscription, _a1 error) *EVM2EVMOffRampInterface_WatchAlreadyAttempted_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_WatchAlreadyAttempted_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *evm_2_evm_offramp.EVM2EVMOffRampAlreadyAttempted) (event.Subscription, error)) *EVM2EVMOffRampInterface_WatchAlreadyAttempted_Call { + _c.Call.Return(run) + return _c +} + +// WatchConfigChanged provides a mock function with given fields: opts, sink +func (_m *EVM2EVMOffRampInterface) WatchConfigChanged(opts *bind.WatchOpts, sink chan<- *evm_2_evm_offramp.EVM2EVMOffRampConfigChanged) (event.Subscription, error) { + ret := _m.Called(opts, sink) + + if len(ret) == 0 { + panic("no return value specified for WatchConfigChanged") + } + + var r0 event.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp.EVM2EVMOffRampConfigChanged) (event.Subscription, error)); ok { + return rf(opts, sink) + } + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp.EVM2EVMOffRampConfigChanged) event.Subscription); ok { + r0 = rf(opts, sink) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(event.Subscription) + } + } + + if rf, ok := ret.Get(1).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp.EVM2EVMOffRampConfigChanged) error); ok { + r1 = rf(opts, sink) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_WatchConfigChanged_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchConfigChanged' +type EVM2EVMOffRampInterface_WatchConfigChanged_Call struct { + *mock.Call +} + +// WatchConfigChanged is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *evm_2_evm_offramp.EVM2EVMOffRampConfigChanged +func (_e *EVM2EVMOffRampInterface_Expecter) WatchConfigChanged(opts interface{}, sink interface{}) *EVM2EVMOffRampInterface_WatchConfigChanged_Call { + return &EVM2EVMOffRampInterface_WatchConfigChanged_Call{Call: _e.mock.On("WatchConfigChanged", opts, sink)} +} + +func (_c *EVM2EVMOffRampInterface_WatchConfigChanged_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *evm_2_evm_offramp.EVM2EVMOffRampConfigChanged)) *EVM2EVMOffRampInterface_WatchConfigChanged_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *evm_2_evm_offramp.EVM2EVMOffRampConfigChanged)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_WatchConfigChanged_Call) Return(_a0 event.Subscription, _a1 error) *EVM2EVMOffRampInterface_WatchConfigChanged_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_WatchConfigChanged_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *evm_2_evm_offramp.EVM2EVMOffRampConfigChanged) (event.Subscription, error)) *EVM2EVMOffRampInterface_WatchConfigChanged_Call { + _c.Call.Return(run) + return _c +} + +// WatchConfigSet provides a mock function with given fields: opts, sink +func (_m *EVM2EVMOffRampInterface) WatchConfigSet(opts *bind.WatchOpts, sink chan<- *evm_2_evm_offramp.EVM2EVMOffRampConfigSet) (event.Subscription, error) { + ret := _m.Called(opts, sink) + + if len(ret) == 0 { + panic("no return value specified for WatchConfigSet") + } + + var r0 event.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp.EVM2EVMOffRampConfigSet) (event.Subscription, error)); ok { + return rf(opts, sink) + } + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp.EVM2EVMOffRampConfigSet) event.Subscription); ok { + r0 = rf(opts, sink) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(event.Subscription) + } + } + + if rf, ok := ret.Get(1).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp.EVM2EVMOffRampConfigSet) error); ok { + r1 = rf(opts, sink) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_WatchConfigSet_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchConfigSet' +type EVM2EVMOffRampInterface_WatchConfigSet_Call struct { + *mock.Call +} + +// WatchConfigSet is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *evm_2_evm_offramp.EVM2EVMOffRampConfigSet +func (_e *EVM2EVMOffRampInterface_Expecter) WatchConfigSet(opts interface{}, sink interface{}) *EVM2EVMOffRampInterface_WatchConfigSet_Call { + return &EVM2EVMOffRampInterface_WatchConfigSet_Call{Call: _e.mock.On("WatchConfigSet", opts, sink)} +} + +func (_c *EVM2EVMOffRampInterface_WatchConfigSet_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *evm_2_evm_offramp.EVM2EVMOffRampConfigSet)) *EVM2EVMOffRampInterface_WatchConfigSet_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *evm_2_evm_offramp.EVM2EVMOffRampConfigSet)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_WatchConfigSet_Call) Return(_a0 event.Subscription, _a1 error) *EVM2EVMOffRampInterface_WatchConfigSet_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_WatchConfigSet_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *evm_2_evm_offramp.EVM2EVMOffRampConfigSet) (event.Subscription, error)) *EVM2EVMOffRampInterface_WatchConfigSet_Call { + _c.Call.Return(run) + return _c +} + +// WatchConfigSet0 provides a mock function with given fields: opts, sink +func (_m *EVM2EVMOffRampInterface) WatchConfigSet0(opts *bind.WatchOpts, sink chan<- *evm_2_evm_offramp.EVM2EVMOffRampConfigSet0) (event.Subscription, error) { + ret := _m.Called(opts, sink) + + if len(ret) == 0 { + panic("no return value specified for WatchConfigSet0") + } + + var r0 event.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp.EVM2EVMOffRampConfigSet0) (event.Subscription, error)); ok { + return rf(opts, sink) + } + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp.EVM2EVMOffRampConfigSet0) event.Subscription); ok { + r0 = rf(opts, sink) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(event.Subscription) + } + } + + if rf, ok := ret.Get(1).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp.EVM2EVMOffRampConfigSet0) error); ok { + r1 = rf(opts, sink) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_WatchConfigSet0_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchConfigSet0' +type EVM2EVMOffRampInterface_WatchConfigSet0_Call struct { + *mock.Call +} + +// WatchConfigSet0 is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *evm_2_evm_offramp.EVM2EVMOffRampConfigSet0 +func (_e *EVM2EVMOffRampInterface_Expecter) WatchConfigSet0(opts interface{}, sink interface{}) *EVM2EVMOffRampInterface_WatchConfigSet0_Call { + return &EVM2EVMOffRampInterface_WatchConfigSet0_Call{Call: _e.mock.On("WatchConfigSet0", opts, sink)} +} + +func (_c *EVM2EVMOffRampInterface_WatchConfigSet0_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *evm_2_evm_offramp.EVM2EVMOffRampConfigSet0)) *EVM2EVMOffRampInterface_WatchConfigSet0_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *evm_2_evm_offramp.EVM2EVMOffRampConfigSet0)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_WatchConfigSet0_Call) Return(_a0 event.Subscription, _a1 error) *EVM2EVMOffRampInterface_WatchConfigSet0_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_WatchConfigSet0_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *evm_2_evm_offramp.EVM2EVMOffRampConfigSet0) (event.Subscription, error)) *EVM2EVMOffRampInterface_WatchConfigSet0_Call { + _c.Call.Return(run) + return _c +} + +// WatchExecutionStateChanged provides a mock function with given fields: opts, sink, sequenceNumber, messageId +func (_m *EVM2EVMOffRampInterface) WatchExecutionStateChanged(opts *bind.WatchOpts, sink chan<- *evm_2_evm_offramp.EVM2EVMOffRampExecutionStateChanged, sequenceNumber []uint64, messageId [][32]byte) (event.Subscription, error) { + ret := _m.Called(opts, sink, sequenceNumber, messageId) + + if len(ret) == 0 { + panic("no return value specified for WatchExecutionStateChanged") + } + + var r0 event.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp.EVM2EVMOffRampExecutionStateChanged, []uint64, [][32]byte) (event.Subscription, error)); ok { + return rf(opts, sink, sequenceNumber, messageId) + } + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp.EVM2EVMOffRampExecutionStateChanged, []uint64, [][32]byte) event.Subscription); ok { + r0 = rf(opts, sink, sequenceNumber, messageId) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(event.Subscription) + } + } + + if rf, ok := ret.Get(1).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp.EVM2EVMOffRampExecutionStateChanged, []uint64, [][32]byte) error); ok { + r1 = rf(opts, sink, sequenceNumber, messageId) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_WatchExecutionStateChanged_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchExecutionStateChanged' +type EVM2EVMOffRampInterface_WatchExecutionStateChanged_Call struct { + *mock.Call +} + +// WatchExecutionStateChanged is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *evm_2_evm_offramp.EVM2EVMOffRampExecutionStateChanged +// - sequenceNumber []uint64 +// - messageId [][32]byte +func (_e *EVM2EVMOffRampInterface_Expecter) WatchExecutionStateChanged(opts interface{}, sink interface{}, sequenceNumber interface{}, messageId interface{}) *EVM2EVMOffRampInterface_WatchExecutionStateChanged_Call { + return &EVM2EVMOffRampInterface_WatchExecutionStateChanged_Call{Call: _e.mock.On("WatchExecutionStateChanged", opts, sink, sequenceNumber, messageId)} +} + +func (_c *EVM2EVMOffRampInterface_WatchExecutionStateChanged_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *evm_2_evm_offramp.EVM2EVMOffRampExecutionStateChanged, sequenceNumber []uint64, messageId [][32]byte)) *EVM2EVMOffRampInterface_WatchExecutionStateChanged_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *evm_2_evm_offramp.EVM2EVMOffRampExecutionStateChanged), args[2].([]uint64), args[3].([][32]byte)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_WatchExecutionStateChanged_Call) Return(_a0 event.Subscription, _a1 error) *EVM2EVMOffRampInterface_WatchExecutionStateChanged_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_WatchExecutionStateChanged_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *evm_2_evm_offramp.EVM2EVMOffRampExecutionStateChanged, []uint64, [][32]byte) (event.Subscription, error)) *EVM2EVMOffRampInterface_WatchExecutionStateChanged_Call { + _c.Call.Return(run) + return _c +} + +// WatchOwnershipTransferRequested provides a mock function with given fields: opts, sink, from, to +func (_m *EVM2EVMOffRampInterface) WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *evm_2_evm_offramp.EVM2EVMOffRampOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) { + ret := _m.Called(opts, sink, from, to) + + if len(ret) == 0 { + panic("no return value specified for WatchOwnershipTransferRequested") + } + + var r0 event.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp.EVM2EVMOffRampOwnershipTransferRequested, []common.Address, []common.Address) (event.Subscription, error)); ok { + return rf(opts, sink, from, to) + } + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp.EVM2EVMOffRampOwnershipTransferRequested, []common.Address, []common.Address) event.Subscription); ok { + r0 = rf(opts, sink, from, to) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(event.Subscription) + } + } + + if rf, ok := ret.Get(1).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp.EVM2EVMOffRampOwnershipTransferRequested, []common.Address, []common.Address) error); ok { + r1 = rf(opts, sink, from, to) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_WatchOwnershipTransferRequested_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchOwnershipTransferRequested' +type EVM2EVMOffRampInterface_WatchOwnershipTransferRequested_Call struct { + *mock.Call +} + +// WatchOwnershipTransferRequested is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *evm_2_evm_offramp.EVM2EVMOffRampOwnershipTransferRequested +// - from []common.Address +// - to []common.Address +func (_e *EVM2EVMOffRampInterface_Expecter) WatchOwnershipTransferRequested(opts interface{}, sink interface{}, from interface{}, to interface{}) *EVM2EVMOffRampInterface_WatchOwnershipTransferRequested_Call { + return &EVM2EVMOffRampInterface_WatchOwnershipTransferRequested_Call{Call: _e.mock.On("WatchOwnershipTransferRequested", opts, sink, from, to)} +} + +func (_c *EVM2EVMOffRampInterface_WatchOwnershipTransferRequested_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *evm_2_evm_offramp.EVM2EVMOffRampOwnershipTransferRequested, from []common.Address, to []common.Address)) *EVM2EVMOffRampInterface_WatchOwnershipTransferRequested_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *evm_2_evm_offramp.EVM2EVMOffRampOwnershipTransferRequested), args[2].([]common.Address), args[3].([]common.Address)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_WatchOwnershipTransferRequested_Call) Return(_a0 event.Subscription, _a1 error) *EVM2EVMOffRampInterface_WatchOwnershipTransferRequested_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_WatchOwnershipTransferRequested_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *evm_2_evm_offramp.EVM2EVMOffRampOwnershipTransferRequested, []common.Address, []common.Address) (event.Subscription, error)) *EVM2EVMOffRampInterface_WatchOwnershipTransferRequested_Call { + _c.Call.Return(run) + return _c +} + +// WatchOwnershipTransferred provides a mock function with given fields: opts, sink, from, to +func (_m *EVM2EVMOffRampInterface) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *evm_2_evm_offramp.EVM2EVMOffRampOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) { + ret := _m.Called(opts, sink, from, to) + + if len(ret) == 0 { + panic("no return value specified for WatchOwnershipTransferred") + } + + var r0 event.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp.EVM2EVMOffRampOwnershipTransferred, []common.Address, []common.Address) (event.Subscription, error)); ok { + return rf(opts, sink, from, to) + } + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp.EVM2EVMOffRampOwnershipTransferred, []common.Address, []common.Address) event.Subscription); ok { + r0 = rf(opts, sink, from, to) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(event.Subscription) + } + } + + if rf, ok := ret.Get(1).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp.EVM2EVMOffRampOwnershipTransferred, []common.Address, []common.Address) error); ok { + r1 = rf(opts, sink, from, to) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_WatchOwnershipTransferred_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchOwnershipTransferred' +type EVM2EVMOffRampInterface_WatchOwnershipTransferred_Call struct { + *mock.Call +} + +// WatchOwnershipTransferred is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *evm_2_evm_offramp.EVM2EVMOffRampOwnershipTransferred +// - from []common.Address +// - to []common.Address +func (_e *EVM2EVMOffRampInterface_Expecter) WatchOwnershipTransferred(opts interface{}, sink interface{}, from interface{}, to interface{}) *EVM2EVMOffRampInterface_WatchOwnershipTransferred_Call { + return &EVM2EVMOffRampInterface_WatchOwnershipTransferred_Call{Call: _e.mock.On("WatchOwnershipTransferred", opts, sink, from, to)} +} + +func (_c *EVM2EVMOffRampInterface_WatchOwnershipTransferred_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *evm_2_evm_offramp.EVM2EVMOffRampOwnershipTransferred, from []common.Address, to []common.Address)) *EVM2EVMOffRampInterface_WatchOwnershipTransferred_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *evm_2_evm_offramp.EVM2EVMOffRampOwnershipTransferred), args[2].([]common.Address), args[3].([]common.Address)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_WatchOwnershipTransferred_Call) Return(_a0 event.Subscription, _a1 error) *EVM2EVMOffRampInterface_WatchOwnershipTransferred_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_WatchOwnershipTransferred_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *evm_2_evm_offramp.EVM2EVMOffRampOwnershipTransferred, []common.Address, []common.Address) (event.Subscription, error)) *EVM2EVMOffRampInterface_WatchOwnershipTransferred_Call { + _c.Call.Return(run) + return _c +} + +// WatchSkippedAlreadyExecutedMessage provides a mock function with given fields: opts, sink, sequenceNumber +func (_m *EVM2EVMOffRampInterface) WatchSkippedAlreadyExecutedMessage(opts *bind.WatchOpts, sink chan<- *evm_2_evm_offramp.EVM2EVMOffRampSkippedAlreadyExecutedMessage, sequenceNumber []uint64) (event.Subscription, error) { + ret := _m.Called(opts, sink, sequenceNumber) + + if len(ret) == 0 { + panic("no return value specified for WatchSkippedAlreadyExecutedMessage") + } + + var r0 event.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp.EVM2EVMOffRampSkippedAlreadyExecutedMessage, []uint64) (event.Subscription, error)); ok { + return rf(opts, sink, sequenceNumber) + } + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp.EVM2EVMOffRampSkippedAlreadyExecutedMessage, []uint64) event.Subscription); ok { + r0 = rf(opts, sink, sequenceNumber) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(event.Subscription) + } + } + + if rf, ok := ret.Get(1).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp.EVM2EVMOffRampSkippedAlreadyExecutedMessage, []uint64) error); ok { + r1 = rf(opts, sink, sequenceNumber) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_WatchSkippedAlreadyExecutedMessage_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchSkippedAlreadyExecutedMessage' +type EVM2EVMOffRampInterface_WatchSkippedAlreadyExecutedMessage_Call struct { + *mock.Call +} + +// WatchSkippedAlreadyExecutedMessage is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *evm_2_evm_offramp.EVM2EVMOffRampSkippedAlreadyExecutedMessage +// - sequenceNumber []uint64 +func (_e *EVM2EVMOffRampInterface_Expecter) WatchSkippedAlreadyExecutedMessage(opts interface{}, sink interface{}, sequenceNumber interface{}) *EVM2EVMOffRampInterface_WatchSkippedAlreadyExecutedMessage_Call { + return &EVM2EVMOffRampInterface_WatchSkippedAlreadyExecutedMessage_Call{Call: _e.mock.On("WatchSkippedAlreadyExecutedMessage", opts, sink, sequenceNumber)} +} + +func (_c *EVM2EVMOffRampInterface_WatchSkippedAlreadyExecutedMessage_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *evm_2_evm_offramp.EVM2EVMOffRampSkippedAlreadyExecutedMessage, sequenceNumber []uint64)) *EVM2EVMOffRampInterface_WatchSkippedAlreadyExecutedMessage_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *evm_2_evm_offramp.EVM2EVMOffRampSkippedAlreadyExecutedMessage), args[2].([]uint64)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_WatchSkippedAlreadyExecutedMessage_Call) Return(_a0 event.Subscription, _a1 error) *EVM2EVMOffRampInterface_WatchSkippedAlreadyExecutedMessage_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_WatchSkippedAlreadyExecutedMessage_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *evm_2_evm_offramp.EVM2EVMOffRampSkippedAlreadyExecutedMessage, []uint64) (event.Subscription, error)) *EVM2EVMOffRampInterface_WatchSkippedAlreadyExecutedMessage_Call { + _c.Call.Return(run) + return _c +} + +// WatchSkippedIncorrectNonce provides a mock function with given fields: opts, sink, nonce, sender +func (_m *EVM2EVMOffRampInterface) WatchSkippedIncorrectNonce(opts *bind.WatchOpts, sink chan<- *evm_2_evm_offramp.EVM2EVMOffRampSkippedIncorrectNonce, nonce []uint64, sender []common.Address) (event.Subscription, error) { + ret := _m.Called(opts, sink, nonce, sender) + + if len(ret) == 0 { + panic("no return value specified for WatchSkippedIncorrectNonce") + } + + var r0 event.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp.EVM2EVMOffRampSkippedIncorrectNonce, []uint64, []common.Address) (event.Subscription, error)); ok { + return rf(opts, sink, nonce, sender) + } + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp.EVM2EVMOffRampSkippedIncorrectNonce, []uint64, []common.Address) event.Subscription); ok { + r0 = rf(opts, sink, nonce, sender) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(event.Subscription) + } + } + + if rf, ok := ret.Get(1).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp.EVM2EVMOffRampSkippedIncorrectNonce, []uint64, []common.Address) error); ok { + r1 = rf(opts, sink, nonce, sender) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_WatchSkippedIncorrectNonce_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchSkippedIncorrectNonce' +type EVM2EVMOffRampInterface_WatchSkippedIncorrectNonce_Call struct { + *mock.Call +} + +// WatchSkippedIncorrectNonce is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *evm_2_evm_offramp.EVM2EVMOffRampSkippedIncorrectNonce +// - nonce []uint64 +// - sender []common.Address +func (_e *EVM2EVMOffRampInterface_Expecter) WatchSkippedIncorrectNonce(opts interface{}, sink interface{}, nonce interface{}, sender interface{}) *EVM2EVMOffRampInterface_WatchSkippedIncorrectNonce_Call { + return &EVM2EVMOffRampInterface_WatchSkippedIncorrectNonce_Call{Call: _e.mock.On("WatchSkippedIncorrectNonce", opts, sink, nonce, sender)} +} + +func (_c *EVM2EVMOffRampInterface_WatchSkippedIncorrectNonce_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *evm_2_evm_offramp.EVM2EVMOffRampSkippedIncorrectNonce, nonce []uint64, sender []common.Address)) *EVM2EVMOffRampInterface_WatchSkippedIncorrectNonce_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *evm_2_evm_offramp.EVM2EVMOffRampSkippedIncorrectNonce), args[2].([]uint64), args[3].([]common.Address)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_WatchSkippedIncorrectNonce_Call) Return(_a0 event.Subscription, _a1 error) *EVM2EVMOffRampInterface_WatchSkippedIncorrectNonce_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_WatchSkippedIncorrectNonce_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *evm_2_evm_offramp.EVM2EVMOffRampSkippedIncorrectNonce, []uint64, []common.Address) (event.Subscription, error)) *EVM2EVMOffRampInterface_WatchSkippedIncorrectNonce_Call { + _c.Call.Return(run) + return _c +} + +// WatchSkippedSenderWithPreviousRampMessageInflight provides a mock function with given fields: opts, sink, nonce, sender +func (_m *EVM2EVMOffRampInterface) WatchSkippedSenderWithPreviousRampMessageInflight(opts *bind.WatchOpts, sink chan<- *evm_2_evm_offramp.EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflight, nonce []uint64, sender []common.Address) (event.Subscription, error) { + ret := _m.Called(opts, sink, nonce, sender) + + if len(ret) == 0 { + panic("no return value specified for WatchSkippedSenderWithPreviousRampMessageInflight") + } + + var r0 event.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp.EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflight, []uint64, []common.Address) (event.Subscription, error)); ok { + return rf(opts, sink, nonce, sender) + } + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp.EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflight, []uint64, []common.Address) event.Subscription); ok { + r0 = rf(opts, sink, nonce, sender) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(event.Subscription) + } + } + + if rf, ok := ret.Get(1).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp.EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflight, []uint64, []common.Address) error); ok { + r1 = rf(opts, sink, nonce, sender) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_WatchSkippedSenderWithPreviousRampMessageInflight_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchSkippedSenderWithPreviousRampMessageInflight' +type EVM2EVMOffRampInterface_WatchSkippedSenderWithPreviousRampMessageInflight_Call struct { + *mock.Call +} + +// WatchSkippedSenderWithPreviousRampMessageInflight is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *evm_2_evm_offramp.EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflight +// - nonce []uint64 +// - sender []common.Address +func (_e *EVM2EVMOffRampInterface_Expecter) WatchSkippedSenderWithPreviousRampMessageInflight(opts interface{}, sink interface{}, nonce interface{}, sender interface{}) *EVM2EVMOffRampInterface_WatchSkippedSenderWithPreviousRampMessageInflight_Call { + return &EVM2EVMOffRampInterface_WatchSkippedSenderWithPreviousRampMessageInflight_Call{Call: _e.mock.On("WatchSkippedSenderWithPreviousRampMessageInflight", opts, sink, nonce, sender)} +} + +func (_c *EVM2EVMOffRampInterface_WatchSkippedSenderWithPreviousRampMessageInflight_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *evm_2_evm_offramp.EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflight, nonce []uint64, sender []common.Address)) *EVM2EVMOffRampInterface_WatchSkippedSenderWithPreviousRampMessageInflight_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *evm_2_evm_offramp.EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflight), args[2].([]uint64), args[3].([]common.Address)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_WatchSkippedSenderWithPreviousRampMessageInflight_Call) Return(_a0 event.Subscription, _a1 error) *EVM2EVMOffRampInterface_WatchSkippedSenderWithPreviousRampMessageInflight_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_WatchSkippedSenderWithPreviousRampMessageInflight_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *evm_2_evm_offramp.EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflight, []uint64, []common.Address) (event.Subscription, error)) *EVM2EVMOffRampInterface_WatchSkippedSenderWithPreviousRampMessageInflight_Call { + _c.Call.Return(run) + return _c +} + +// WatchTokenAggregateRateLimitAdded provides a mock function with given fields: opts, sink +func (_m *EVM2EVMOffRampInterface) WatchTokenAggregateRateLimitAdded(opts *bind.WatchOpts, sink chan<- *evm_2_evm_offramp.EVM2EVMOffRampTokenAggregateRateLimitAdded) (event.Subscription, error) { + ret := _m.Called(opts, sink) + + if len(ret) == 0 { + panic("no return value specified for WatchTokenAggregateRateLimitAdded") + } + + var r0 event.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp.EVM2EVMOffRampTokenAggregateRateLimitAdded) (event.Subscription, error)); ok { + return rf(opts, sink) + } + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp.EVM2EVMOffRampTokenAggregateRateLimitAdded) event.Subscription); ok { + r0 = rf(opts, sink) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(event.Subscription) + } + } + + if rf, ok := ret.Get(1).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp.EVM2EVMOffRampTokenAggregateRateLimitAdded) error); ok { + r1 = rf(opts, sink) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_WatchTokenAggregateRateLimitAdded_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchTokenAggregateRateLimitAdded' +type EVM2EVMOffRampInterface_WatchTokenAggregateRateLimitAdded_Call struct { + *mock.Call +} + +// WatchTokenAggregateRateLimitAdded is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *evm_2_evm_offramp.EVM2EVMOffRampTokenAggregateRateLimitAdded +func (_e *EVM2EVMOffRampInterface_Expecter) WatchTokenAggregateRateLimitAdded(opts interface{}, sink interface{}) *EVM2EVMOffRampInterface_WatchTokenAggregateRateLimitAdded_Call { + return &EVM2EVMOffRampInterface_WatchTokenAggregateRateLimitAdded_Call{Call: _e.mock.On("WatchTokenAggregateRateLimitAdded", opts, sink)} +} + +func (_c *EVM2EVMOffRampInterface_WatchTokenAggregateRateLimitAdded_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *evm_2_evm_offramp.EVM2EVMOffRampTokenAggregateRateLimitAdded)) *EVM2EVMOffRampInterface_WatchTokenAggregateRateLimitAdded_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *evm_2_evm_offramp.EVM2EVMOffRampTokenAggregateRateLimitAdded)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_WatchTokenAggregateRateLimitAdded_Call) Return(_a0 event.Subscription, _a1 error) *EVM2EVMOffRampInterface_WatchTokenAggregateRateLimitAdded_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_WatchTokenAggregateRateLimitAdded_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *evm_2_evm_offramp.EVM2EVMOffRampTokenAggregateRateLimitAdded) (event.Subscription, error)) *EVM2EVMOffRampInterface_WatchTokenAggregateRateLimitAdded_Call { + _c.Call.Return(run) + return _c +} + +// WatchTokenAggregateRateLimitRemoved provides a mock function with given fields: opts, sink +func (_m *EVM2EVMOffRampInterface) WatchTokenAggregateRateLimitRemoved(opts *bind.WatchOpts, sink chan<- *evm_2_evm_offramp.EVM2EVMOffRampTokenAggregateRateLimitRemoved) (event.Subscription, error) { + ret := _m.Called(opts, sink) + + if len(ret) == 0 { + panic("no return value specified for WatchTokenAggregateRateLimitRemoved") + } + + var r0 event.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp.EVM2EVMOffRampTokenAggregateRateLimitRemoved) (event.Subscription, error)); ok { + return rf(opts, sink) + } + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp.EVM2EVMOffRampTokenAggregateRateLimitRemoved) event.Subscription); ok { + r0 = rf(opts, sink) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(event.Subscription) + } + } + + if rf, ok := ret.Get(1).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp.EVM2EVMOffRampTokenAggregateRateLimitRemoved) error); ok { + r1 = rf(opts, sink) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_WatchTokenAggregateRateLimitRemoved_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchTokenAggregateRateLimitRemoved' +type EVM2EVMOffRampInterface_WatchTokenAggregateRateLimitRemoved_Call struct { + *mock.Call +} + +// WatchTokenAggregateRateLimitRemoved is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *evm_2_evm_offramp.EVM2EVMOffRampTokenAggregateRateLimitRemoved +func (_e *EVM2EVMOffRampInterface_Expecter) WatchTokenAggregateRateLimitRemoved(opts interface{}, sink interface{}) *EVM2EVMOffRampInterface_WatchTokenAggregateRateLimitRemoved_Call { + return &EVM2EVMOffRampInterface_WatchTokenAggregateRateLimitRemoved_Call{Call: _e.mock.On("WatchTokenAggregateRateLimitRemoved", opts, sink)} +} + +func (_c *EVM2EVMOffRampInterface_WatchTokenAggregateRateLimitRemoved_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *evm_2_evm_offramp.EVM2EVMOffRampTokenAggregateRateLimitRemoved)) *EVM2EVMOffRampInterface_WatchTokenAggregateRateLimitRemoved_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *evm_2_evm_offramp.EVM2EVMOffRampTokenAggregateRateLimitRemoved)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_WatchTokenAggregateRateLimitRemoved_Call) Return(_a0 event.Subscription, _a1 error) *EVM2EVMOffRampInterface_WatchTokenAggregateRateLimitRemoved_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_WatchTokenAggregateRateLimitRemoved_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *evm_2_evm_offramp.EVM2EVMOffRampTokenAggregateRateLimitRemoved) (event.Subscription, error)) *EVM2EVMOffRampInterface_WatchTokenAggregateRateLimitRemoved_Call { + _c.Call.Return(run) + return _c +} + +// WatchTokensConsumed provides a mock function with given fields: opts, sink +func (_m *EVM2EVMOffRampInterface) WatchTokensConsumed(opts *bind.WatchOpts, sink chan<- *evm_2_evm_offramp.EVM2EVMOffRampTokensConsumed) (event.Subscription, error) { + ret := _m.Called(opts, sink) + + if len(ret) == 0 { + panic("no return value specified for WatchTokensConsumed") + } + + var r0 event.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp.EVM2EVMOffRampTokensConsumed) (event.Subscription, error)); ok { + return rf(opts, sink) + } + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp.EVM2EVMOffRampTokensConsumed) event.Subscription); ok { + r0 = rf(opts, sink) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(event.Subscription) + } + } + + if rf, ok := ret.Get(1).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp.EVM2EVMOffRampTokensConsumed) error); ok { + r1 = rf(opts, sink) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_WatchTokensConsumed_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchTokensConsumed' +type EVM2EVMOffRampInterface_WatchTokensConsumed_Call struct { + *mock.Call +} + +// WatchTokensConsumed is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *evm_2_evm_offramp.EVM2EVMOffRampTokensConsumed +func (_e *EVM2EVMOffRampInterface_Expecter) WatchTokensConsumed(opts interface{}, sink interface{}) *EVM2EVMOffRampInterface_WatchTokensConsumed_Call { + return &EVM2EVMOffRampInterface_WatchTokensConsumed_Call{Call: _e.mock.On("WatchTokensConsumed", opts, sink)} +} + +func (_c *EVM2EVMOffRampInterface_WatchTokensConsumed_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *evm_2_evm_offramp.EVM2EVMOffRampTokensConsumed)) *EVM2EVMOffRampInterface_WatchTokensConsumed_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *evm_2_evm_offramp.EVM2EVMOffRampTokensConsumed)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_WatchTokensConsumed_Call) Return(_a0 event.Subscription, _a1 error) *EVM2EVMOffRampInterface_WatchTokensConsumed_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_WatchTokensConsumed_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *evm_2_evm_offramp.EVM2EVMOffRampTokensConsumed) (event.Subscription, error)) *EVM2EVMOffRampInterface_WatchTokensConsumed_Call { + _c.Call.Return(run) + return _c +} + +// WatchTransmitted provides a mock function with given fields: opts, sink +func (_m *EVM2EVMOffRampInterface) WatchTransmitted(opts *bind.WatchOpts, sink chan<- *evm_2_evm_offramp.EVM2EVMOffRampTransmitted) (event.Subscription, error) { + ret := _m.Called(opts, sink) + + if len(ret) == 0 { + panic("no return value specified for WatchTransmitted") + } + + var r0 event.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp.EVM2EVMOffRampTransmitted) (event.Subscription, error)); ok { + return rf(opts, sink) + } + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp.EVM2EVMOffRampTransmitted) event.Subscription); ok { + r0 = rf(opts, sink) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(event.Subscription) + } + } + + if rf, ok := ret.Get(1).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp.EVM2EVMOffRampTransmitted) error); ok { + r1 = rf(opts, sink) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_WatchTransmitted_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchTransmitted' +type EVM2EVMOffRampInterface_WatchTransmitted_Call struct { + *mock.Call +} + +// WatchTransmitted is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *evm_2_evm_offramp.EVM2EVMOffRampTransmitted +func (_e *EVM2EVMOffRampInterface_Expecter) WatchTransmitted(opts interface{}, sink interface{}) *EVM2EVMOffRampInterface_WatchTransmitted_Call { + return &EVM2EVMOffRampInterface_WatchTransmitted_Call{Call: _e.mock.On("WatchTransmitted", opts, sink)} +} + +func (_c *EVM2EVMOffRampInterface_WatchTransmitted_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *evm_2_evm_offramp.EVM2EVMOffRampTransmitted)) *EVM2EVMOffRampInterface_WatchTransmitted_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *evm_2_evm_offramp.EVM2EVMOffRampTransmitted)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_WatchTransmitted_Call) Return(_a0 event.Subscription, _a1 error) *EVM2EVMOffRampInterface_WatchTransmitted_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_WatchTransmitted_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *evm_2_evm_offramp.EVM2EVMOffRampTransmitted) (event.Subscription, error)) *EVM2EVMOffRampInterface_WatchTransmitted_Call { + _c.Call.Return(run) + return _c +} + +// NewEVM2EVMOffRampInterface creates a new instance of EVM2EVMOffRampInterface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewEVM2EVMOffRampInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *EVM2EVMOffRampInterface { + mock := &EVM2EVMOffRampInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/core/gethwrappers/ccip/mocks/evm2_evm_on_ramp_interface.go b/core/gethwrappers/ccip/mocks/evm2_evm_on_ramp_interface.go new file mode 100644 index 00000000000..57580777493 --- /dev/null +++ b/core/gethwrappers/ccip/mocks/evm2_evm_on_ramp_interface.go @@ -0,0 +1,3832 @@ +// Code generated by mockery v2.43.2. DO NOT EDIT. + +package mock_contracts + +import ( + big "math/big" + + bind "github.com/ethereum/go-ethereum/accounts/abi/bind" + common "github.com/ethereum/go-ethereum/common" + + event "github.com/ethereum/go-ethereum/event" + + evm_2_evm_onramp "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/evm_2_evm_onramp" + + generated "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" + + mock "github.com/stretchr/testify/mock" + + types "github.com/ethereum/go-ethereum/core/types" +) + +// EVM2EVMOnRampInterface is an autogenerated mock type for the EVM2EVMOnRampInterface type +type EVM2EVMOnRampInterface struct { + mock.Mock +} + +type EVM2EVMOnRampInterface_Expecter struct { + mock *mock.Mock +} + +func (_m *EVM2EVMOnRampInterface) EXPECT() *EVM2EVMOnRampInterface_Expecter { + return &EVM2EVMOnRampInterface_Expecter{mock: &_m.Mock} +} + +// AcceptOwnership provides a mock function with given fields: opts +func (_m *EVM2EVMOnRampInterface) AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for AcceptOwnership") + } + + var r0 *types.Transaction + var r1 error + if rf, ok := ret.Get(0).(func(*bind.TransactOpts) (*types.Transaction, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.TransactOpts) *types.Transaction); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Transaction) + } + } + + if rf, ok := ret.Get(1).(func(*bind.TransactOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOnRampInterface_AcceptOwnership_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AcceptOwnership' +type EVM2EVMOnRampInterface_AcceptOwnership_Call struct { + *mock.Call +} + +// AcceptOwnership is a helper method to define mock.On call +// - opts *bind.TransactOpts +func (_e *EVM2EVMOnRampInterface_Expecter) AcceptOwnership(opts interface{}) *EVM2EVMOnRampInterface_AcceptOwnership_Call { + return &EVM2EVMOnRampInterface_AcceptOwnership_Call{Call: _e.mock.On("AcceptOwnership", opts)} +} + +func (_c *EVM2EVMOnRampInterface_AcceptOwnership_Call) Run(run func(opts *bind.TransactOpts)) *EVM2EVMOnRampInterface_AcceptOwnership_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts)) + }) + return _c +} + +func (_c *EVM2EVMOnRampInterface_AcceptOwnership_Call) Return(_a0 *types.Transaction, _a1 error) *EVM2EVMOnRampInterface_AcceptOwnership_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOnRampInterface_AcceptOwnership_Call) RunAndReturn(run func(*bind.TransactOpts) (*types.Transaction, error)) *EVM2EVMOnRampInterface_AcceptOwnership_Call { + _c.Call.Return(run) + return _c +} + +// Address provides a mock function with given fields: +func (_m *EVM2EVMOnRampInterface) Address() common.Address { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Address") + } + + var r0 common.Address + if rf, ok := ret.Get(0).(func() common.Address); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Address) + } + } + + return r0 +} + +// EVM2EVMOnRampInterface_Address_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Address' +type EVM2EVMOnRampInterface_Address_Call struct { + *mock.Call +} + +// Address is a helper method to define mock.On call +func (_e *EVM2EVMOnRampInterface_Expecter) Address() *EVM2EVMOnRampInterface_Address_Call { + return &EVM2EVMOnRampInterface_Address_Call{Call: _e.mock.On("Address")} +} + +func (_c *EVM2EVMOnRampInterface_Address_Call) Run(run func()) *EVM2EVMOnRampInterface_Address_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *EVM2EVMOnRampInterface_Address_Call) Return(_a0 common.Address) *EVM2EVMOnRampInterface_Address_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *EVM2EVMOnRampInterface_Address_Call) RunAndReturn(run func() common.Address) *EVM2EVMOnRampInterface_Address_Call { + _c.Call.Return(run) + return _c +} + +// CurrentRateLimiterState provides a mock function with given fields: opts +func (_m *EVM2EVMOnRampInterface) CurrentRateLimiterState(opts *bind.CallOpts) (evm_2_evm_onramp.RateLimiterTokenBucket, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for CurrentRateLimiterState") + } + + var r0 evm_2_evm_onramp.RateLimiterTokenBucket + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts) (evm_2_evm_onramp.RateLimiterTokenBucket, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts) evm_2_evm_onramp.RateLimiterTokenBucket); ok { + r0 = rf(opts) + } else { + r0 = ret.Get(0).(evm_2_evm_onramp.RateLimiterTokenBucket) + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOnRampInterface_CurrentRateLimiterState_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CurrentRateLimiterState' +type EVM2EVMOnRampInterface_CurrentRateLimiterState_Call struct { + *mock.Call +} + +// CurrentRateLimiterState is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *EVM2EVMOnRampInterface_Expecter) CurrentRateLimiterState(opts interface{}) *EVM2EVMOnRampInterface_CurrentRateLimiterState_Call { + return &EVM2EVMOnRampInterface_CurrentRateLimiterState_Call{Call: _e.mock.On("CurrentRateLimiterState", opts)} +} + +func (_c *EVM2EVMOnRampInterface_CurrentRateLimiterState_Call) Run(run func(opts *bind.CallOpts)) *EVM2EVMOnRampInterface_CurrentRateLimiterState_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *EVM2EVMOnRampInterface_CurrentRateLimiterState_Call) Return(_a0 evm_2_evm_onramp.RateLimiterTokenBucket, _a1 error) *EVM2EVMOnRampInterface_CurrentRateLimiterState_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOnRampInterface_CurrentRateLimiterState_Call) RunAndReturn(run func(*bind.CallOpts) (evm_2_evm_onramp.RateLimiterTokenBucket, error)) *EVM2EVMOnRampInterface_CurrentRateLimiterState_Call { + _c.Call.Return(run) + return _c +} + +// FilterAdminSet provides a mock function with given fields: opts +func (_m *EVM2EVMOnRampInterface) FilterAdminSet(opts *bind.FilterOpts) (*evm_2_evm_onramp.EVM2EVMOnRampAdminSetIterator, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for FilterAdminSet") + } + + var r0 *evm_2_evm_onramp.EVM2EVMOnRampAdminSetIterator + var r1 error + if rf, ok := ret.Get(0).(func(*bind.FilterOpts) (*evm_2_evm_onramp.EVM2EVMOnRampAdminSetIterator, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.FilterOpts) *evm_2_evm_onramp.EVM2EVMOnRampAdminSetIterator); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*evm_2_evm_onramp.EVM2EVMOnRampAdminSetIterator) + } + } + + if rf, ok := ret.Get(1).(func(*bind.FilterOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOnRampInterface_FilterAdminSet_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterAdminSet' +type EVM2EVMOnRampInterface_FilterAdminSet_Call struct { + *mock.Call +} + +// FilterAdminSet is a helper method to define mock.On call +// - opts *bind.FilterOpts +func (_e *EVM2EVMOnRampInterface_Expecter) FilterAdminSet(opts interface{}) *EVM2EVMOnRampInterface_FilterAdminSet_Call { + return &EVM2EVMOnRampInterface_FilterAdminSet_Call{Call: _e.mock.On("FilterAdminSet", opts)} +} + +func (_c *EVM2EVMOnRampInterface_FilterAdminSet_Call) Run(run func(opts *bind.FilterOpts)) *EVM2EVMOnRampInterface_FilterAdminSet_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts)) + }) + return _c +} + +func (_c *EVM2EVMOnRampInterface_FilterAdminSet_Call) Return(_a0 *evm_2_evm_onramp.EVM2EVMOnRampAdminSetIterator, _a1 error) *EVM2EVMOnRampInterface_FilterAdminSet_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOnRampInterface_FilterAdminSet_Call) RunAndReturn(run func(*bind.FilterOpts) (*evm_2_evm_onramp.EVM2EVMOnRampAdminSetIterator, error)) *EVM2EVMOnRampInterface_FilterAdminSet_Call { + _c.Call.Return(run) + return _c +} + +// FilterCCIPSendRequested provides a mock function with given fields: opts +func (_m *EVM2EVMOnRampInterface) FilterCCIPSendRequested(opts *bind.FilterOpts) (*evm_2_evm_onramp.EVM2EVMOnRampCCIPSendRequestedIterator, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for FilterCCIPSendRequested") + } + + var r0 *evm_2_evm_onramp.EVM2EVMOnRampCCIPSendRequestedIterator + var r1 error + if rf, ok := ret.Get(0).(func(*bind.FilterOpts) (*evm_2_evm_onramp.EVM2EVMOnRampCCIPSendRequestedIterator, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.FilterOpts) *evm_2_evm_onramp.EVM2EVMOnRampCCIPSendRequestedIterator); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*evm_2_evm_onramp.EVM2EVMOnRampCCIPSendRequestedIterator) + } + } + + if rf, ok := ret.Get(1).(func(*bind.FilterOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOnRampInterface_FilterCCIPSendRequested_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterCCIPSendRequested' +type EVM2EVMOnRampInterface_FilterCCIPSendRequested_Call struct { + *mock.Call +} + +// FilterCCIPSendRequested is a helper method to define mock.On call +// - opts *bind.FilterOpts +func (_e *EVM2EVMOnRampInterface_Expecter) FilterCCIPSendRequested(opts interface{}) *EVM2EVMOnRampInterface_FilterCCIPSendRequested_Call { + return &EVM2EVMOnRampInterface_FilterCCIPSendRequested_Call{Call: _e.mock.On("FilterCCIPSendRequested", opts)} +} + +func (_c *EVM2EVMOnRampInterface_FilterCCIPSendRequested_Call) Run(run func(opts *bind.FilterOpts)) *EVM2EVMOnRampInterface_FilterCCIPSendRequested_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts)) + }) + return _c +} + +func (_c *EVM2EVMOnRampInterface_FilterCCIPSendRequested_Call) Return(_a0 *evm_2_evm_onramp.EVM2EVMOnRampCCIPSendRequestedIterator, _a1 error) *EVM2EVMOnRampInterface_FilterCCIPSendRequested_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOnRampInterface_FilterCCIPSendRequested_Call) RunAndReturn(run func(*bind.FilterOpts) (*evm_2_evm_onramp.EVM2EVMOnRampCCIPSendRequestedIterator, error)) *EVM2EVMOnRampInterface_FilterCCIPSendRequested_Call { + _c.Call.Return(run) + return _c +} + +// FilterConfigChanged provides a mock function with given fields: opts +func (_m *EVM2EVMOnRampInterface) FilterConfigChanged(opts *bind.FilterOpts) (*evm_2_evm_onramp.EVM2EVMOnRampConfigChangedIterator, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for FilterConfigChanged") + } + + var r0 *evm_2_evm_onramp.EVM2EVMOnRampConfigChangedIterator + var r1 error + if rf, ok := ret.Get(0).(func(*bind.FilterOpts) (*evm_2_evm_onramp.EVM2EVMOnRampConfigChangedIterator, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.FilterOpts) *evm_2_evm_onramp.EVM2EVMOnRampConfigChangedIterator); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*evm_2_evm_onramp.EVM2EVMOnRampConfigChangedIterator) + } + } + + if rf, ok := ret.Get(1).(func(*bind.FilterOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOnRampInterface_FilterConfigChanged_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterConfigChanged' +type EVM2EVMOnRampInterface_FilterConfigChanged_Call struct { + *mock.Call +} + +// FilterConfigChanged is a helper method to define mock.On call +// - opts *bind.FilterOpts +func (_e *EVM2EVMOnRampInterface_Expecter) FilterConfigChanged(opts interface{}) *EVM2EVMOnRampInterface_FilterConfigChanged_Call { + return &EVM2EVMOnRampInterface_FilterConfigChanged_Call{Call: _e.mock.On("FilterConfigChanged", opts)} +} + +func (_c *EVM2EVMOnRampInterface_FilterConfigChanged_Call) Run(run func(opts *bind.FilterOpts)) *EVM2EVMOnRampInterface_FilterConfigChanged_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts)) + }) + return _c +} + +func (_c *EVM2EVMOnRampInterface_FilterConfigChanged_Call) Return(_a0 *evm_2_evm_onramp.EVM2EVMOnRampConfigChangedIterator, _a1 error) *EVM2EVMOnRampInterface_FilterConfigChanged_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOnRampInterface_FilterConfigChanged_Call) RunAndReturn(run func(*bind.FilterOpts) (*evm_2_evm_onramp.EVM2EVMOnRampConfigChangedIterator, error)) *EVM2EVMOnRampInterface_FilterConfigChanged_Call { + _c.Call.Return(run) + return _c +} + +// FilterConfigSet provides a mock function with given fields: opts +func (_m *EVM2EVMOnRampInterface) FilterConfigSet(opts *bind.FilterOpts) (*evm_2_evm_onramp.EVM2EVMOnRampConfigSetIterator, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for FilterConfigSet") + } + + var r0 *evm_2_evm_onramp.EVM2EVMOnRampConfigSetIterator + var r1 error + if rf, ok := ret.Get(0).(func(*bind.FilterOpts) (*evm_2_evm_onramp.EVM2EVMOnRampConfigSetIterator, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.FilterOpts) *evm_2_evm_onramp.EVM2EVMOnRampConfigSetIterator); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*evm_2_evm_onramp.EVM2EVMOnRampConfigSetIterator) + } + } + + if rf, ok := ret.Get(1).(func(*bind.FilterOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOnRampInterface_FilterConfigSet_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterConfigSet' +type EVM2EVMOnRampInterface_FilterConfigSet_Call struct { + *mock.Call +} + +// FilterConfigSet is a helper method to define mock.On call +// - opts *bind.FilterOpts +func (_e *EVM2EVMOnRampInterface_Expecter) FilterConfigSet(opts interface{}) *EVM2EVMOnRampInterface_FilterConfigSet_Call { + return &EVM2EVMOnRampInterface_FilterConfigSet_Call{Call: _e.mock.On("FilterConfigSet", opts)} +} + +func (_c *EVM2EVMOnRampInterface_FilterConfigSet_Call) Run(run func(opts *bind.FilterOpts)) *EVM2EVMOnRampInterface_FilterConfigSet_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts)) + }) + return _c +} + +func (_c *EVM2EVMOnRampInterface_FilterConfigSet_Call) Return(_a0 *evm_2_evm_onramp.EVM2EVMOnRampConfigSetIterator, _a1 error) *EVM2EVMOnRampInterface_FilterConfigSet_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOnRampInterface_FilterConfigSet_Call) RunAndReturn(run func(*bind.FilterOpts) (*evm_2_evm_onramp.EVM2EVMOnRampConfigSetIterator, error)) *EVM2EVMOnRampInterface_FilterConfigSet_Call { + _c.Call.Return(run) + return _c +} + +// FilterFeeConfigSet provides a mock function with given fields: opts +func (_m *EVM2EVMOnRampInterface) FilterFeeConfigSet(opts *bind.FilterOpts) (*evm_2_evm_onramp.EVM2EVMOnRampFeeConfigSetIterator, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for FilterFeeConfigSet") + } + + var r0 *evm_2_evm_onramp.EVM2EVMOnRampFeeConfigSetIterator + var r1 error + if rf, ok := ret.Get(0).(func(*bind.FilterOpts) (*evm_2_evm_onramp.EVM2EVMOnRampFeeConfigSetIterator, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.FilterOpts) *evm_2_evm_onramp.EVM2EVMOnRampFeeConfigSetIterator); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*evm_2_evm_onramp.EVM2EVMOnRampFeeConfigSetIterator) + } + } + + if rf, ok := ret.Get(1).(func(*bind.FilterOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOnRampInterface_FilterFeeConfigSet_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterFeeConfigSet' +type EVM2EVMOnRampInterface_FilterFeeConfigSet_Call struct { + *mock.Call +} + +// FilterFeeConfigSet is a helper method to define mock.On call +// - opts *bind.FilterOpts +func (_e *EVM2EVMOnRampInterface_Expecter) FilterFeeConfigSet(opts interface{}) *EVM2EVMOnRampInterface_FilterFeeConfigSet_Call { + return &EVM2EVMOnRampInterface_FilterFeeConfigSet_Call{Call: _e.mock.On("FilterFeeConfigSet", opts)} +} + +func (_c *EVM2EVMOnRampInterface_FilterFeeConfigSet_Call) Run(run func(opts *bind.FilterOpts)) *EVM2EVMOnRampInterface_FilterFeeConfigSet_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts)) + }) + return _c +} + +func (_c *EVM2EVMOnRampInterface_FilterFeeConfigSet_Call) Return(_a0 *evm_2_evm_onramp.EVM2EVMOnRampFeeConfigSetIterator, _a1 error) *EVM2EVMOnRampInterface_FilterFeeConfigSet_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOnRampInterface_FilterFeeConfigSet_Call) RunAndReturn(run func(*bind.FilterOpts) (*evm_2_evm_onramp.EVM2EVMOnRampFeeConfigSetIterator, error)) *EVM2EVMOnRampInterface_FilterFeeConfigSet_Call { + _c.Call.Return(run) + return _c +} + +// FilterNopPaid provides a mock function with given fields: opts, nop +func (_m *EVM2EVMOnRampInterface) FilterNopPaid(opts *bind.FilterOpts, nop []common.Address) (*evm_2_evm_onramp.EVM2EVMOnRampNopPaidIterator, error) { + ret := _m.Called(opts, nop) + + if len(ret) == 0 { + panic("no return value specified for FilterNopPaid") + } + + var r0 *evm_2_evm_onramp.EVM2EVMOnRampNopPaidIterator + var r1 error + if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []common.Address) (*evm_2_evm_onramp.EVM2EVMOnRampNopPaidIterator, error)); ok { + return rf(opts, nop) + } + if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []common.Address) *evm_2_evm_onramp.EVM2EVMOnRampNopPaidIterator); ok { + r0 = rf(opts, nop) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*evm_2_evm_onramp.EVM2EVMOnRampNopPaidIterator) + } + } + + if rf, ok := ret.Get(1).(func(*bind.FilterOpts, []common.Address) error); ok { + r1 = rf(opts, nop) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOnRampInterface_FilterNopPaid_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterNopPaid' +type EVM2EVMOnRampInterface_FilterNopPaid_Call struct { + *mock.Call +} + +// FilterNopPaid is a helper method to define mock.On call +// - opts *bind.FilterOpts +// - nop []common.Address +func (_e *EVM2EVMOnRampInterface_Expecter) FilterNopPaid(opts interface{}, nop interface{}) *EVM2EVMOnRampInterface_FilterNopPaid_Call { + return &EVM2EVMOnRampInterface_FilterNopPaid_Call{Call: _e.mock.On("FilterNopPaid", opts, nop)} +} + +func (_c *EVM2EVMOnRampInterface_FilterNopPaid_Call) Run(run func(opts *bind.FilterOpts, nop []common.Address)) *EVM2EVMOnRampInterface_FilterNopPaid_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts), args[1].([]common.Address)) + }) + return _c +} + +func (_c *EVM2EVMOnRampInterface_FilterNopPaid_Call) Return(_a0 *evm_2_evm_onramp.EVM2EVMOnRampNopPaidIterator, _a1 error) *EVM2EVMOnRampInterface_FilterNopPaid_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOnRampInterface_FilterNopPaid_Call) RunAndReturn(run func(*bind.FilterOpts, []common.Address) (*evm_2_evm_onramp.EVM2EVMOnRampNopPaidIterator, error)) *EVM2EVMOnRampInterface_FilterNopPaid_Call { + _c.Call.Return(run) + return _c +} + +// FilterNopsSet provides a mock function with given fields: opts +func (_m *EVM2EVMOnRampInterface) FilterNopsSet(opts *bind.FilterOpts) (*evm_2_evm_onramp.EVM2EVMOnRampNopsSetIterator, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for FilterNopsSet") + } + + var r0 *evm_2_evm_onramp.EVM2EVMOnRampNopsSetIterator + var r1 error + if rf, ok := ret.Get(0).(func(*bind.FilterOpts) (*evm_2_evm_onramp.EVM2EVMOnRampNopsSetIterator, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.FilterOpts) *evm_2_evm_onramp.EVM2EVMOnRampNopsSetIterator); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*evm_2_evm_onramp.EVM2EVMOnRampNopsSetIterator) + } + } + + if rf, ok := ret.Get(1).(func(*bind.FilterOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOnRampInterface_FilterNopsSet_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterNopsSet' +type EVM2EVMOnRampInterface_FilterNopsSet_Call struct { + *mock.Call +} + +// FilterNopsSet is a helper method to define mock.On call +// - opts *bind.FilterOpts +func (_e *EVM2EVMOnRampInterface_Expecter) FilterNopsSet(opts interface{}) *EVM2EVMOnRampInterface_FilterNopsSet_Call { + return &EVM2EVMOnRampInterface_FilterNopsSet_Call{Call: _e.mock.On("FilterNopsSet", opts)} +} + +func (_c *EVM2EVMOnRampInterface_FilterNopsSet_Call) Run(run func(opts *bind.FilterOpts)) *EVM2EVMOnRampInterface_FilterNopsSet_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts)) + }) + return _c +} + +func (_c *EVM2EVMOnRampInterface_FilterNopsSet_Call) Return(_a0 *evm_2_evm_onramp.EVM2EVMOnRampNopsSetIterator, _a1 error) *EVM2EVMOnRampInterface_FilterNopsSet_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOnRampInterface_FilterNopsSet_Call) RunAndReturn(run func(*bind.FilterOpts) (*evm_2_evm_onramp.EVM2EVMOnRampNopsSetIterator, error)) *EVM2EVMOnRampInterface_FilterNopsSet_Call { + _c.Call.Return(run) + return _c +} + +// FilterOwnershipTransferRequested provides a mock function with given fields: opts, from, to +func (_m *EVM2EVMOnRampInterface) FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*evm_2_evm_onramp.EVM2EVMOnRampOwnershipTransferRequestedIterator, error) { + ret := _m.Called(opts, from, to) + + if len(ret) == 0 { + panic("no return value specified for FilterOwnershipTransferRequested") + } + + var r0 *evm_2_evm_onramp.EVM2EVMOnRampOwnershipTransferRequestedIterator + var r1 error + if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []common.Address, []common.Address) (*evm_2_evm_onramp.EVM2EVMOnRampOwnershipTransferRequestedIterator, error)); ok { + return rf(opts, from, to) + } + if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []common.Address, []common.Address) *evm_2_evm_onramp.EVM2EVMOnRampOwnershipTransferRequestedIterator); ok { + r0 = rf(opts, from, to) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*evm_2_evm_onramp.EVM2EVMOnRampOwnershipTransferRequestedIterator) + } + } + + if rf, ok := ret.Get(1).(func(*bind.FilterOpts, []common.Address, []common.Address) error); ok { + r1 = rf(opts, from, to) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOnRampInterface_FilterOwnershipTransferRequested_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterOwnershipTransferRequested' +type EVM2EVMOnRampInterface_FilterOwnershipTransferRequested_Call struct { + *mock.Call +} + +// FilterOwnershipTransferRequested is a helper method to define mock.On call +// - opts *bind.FilterOpts +// - from []common.Address +// - to []common.Address +func (_e *EVM2EVMOnRampInterface_Expecter) FilterOwnershipTransferRequested(opts interface{}, from interface{}, to interface{}) *EVM2EVMOnRampInterface_FilterOwnershipTransferRequested_Call { + return &EVM2EVMOnRampInterface_FilterOwnershipTransferRequested_Call{Call: _e.mock.On("FilterOwnershipTransferRequested", opts, from, to)} +} + +func (_c *EVM2EVMOnRampInterface_FilterOwnershipTransferRequested_Call) Run(run func(opts *bind.FilterOpts, from []common.Address, to []common.Address)) *EVM2EVMOnRampInterface_FilterOwnershipTransferRequested_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts), args[1].([]common.Address), args[2].([]common.Address)) + }) + return _c +} + +func (_c *EVM2EVMOnRampInterface_FilterOwnershipTransferRequested_Call) Return(_a0 *evm_2_evm_onramp.EVM2EVMOnRampOwnershipTransferRequestedIterator, _a1 error) *EVM2EVMOnRampInterface_FilterOwnershipTransferRequested_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOnRampInterface_FilterOwnershipTransferRequested_Call) RunAndReturn(run func(*bind.FilterOpts, []common.Address, []common.Address) (*evm_2_evm_onramp.EVM2EVMOnRampOwnershipTransferRequestedIterator, error)) *EVM2EVMOnRampInterface_FilterOwnershipTransferRequested_Call { + _c.Call.Return(run) + return _c +} + +// FilterOwnershipTransferred provides a mock function with given fields: opts, from, to +func (_m *EVM2EVMOnRampInterface) FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*evm_2_evm_onramp.EVM2EVMOnRampOwnershipTransferredIterator, error) { + ret := _m.Called(opts, from, to) + + if len(ret) == 0 { + panic("no return value specified for FilterOwnershipTransferred") + } + + var r0 *evm_2_evm_onramp.EVM2EVMOnRampOwnershipTransferredIterator + var r1 error + if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []common.Address, []common.Address) (*evm_2_evm_onramp.EVM2EVMOnRampOwnershipTransferredIterator, error)); ok { + return rf(opts, from, to) + } + if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []common.Address, []common.Address) *evm_2_evm_onramp.EVM2EVMOnRampOwnershipTransferredIterator); ok { + r0 = rf(opts, from, to) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*evm_2_evm_onramp.EVM2EVMOnRampOwnershipTransferredIterator) + } + } + + if rf, ok := ret.Get(1).(func(*bind.FilterOpts, []common.Address, []common.Address) error); ok { + r1 = rf(opts, from, to) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOnRampInterface_FilterOwnershipTransferred_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterOwnershipTransferred' +type EVM2EVMOnRampInterface_FilterOwnershipTransferred_Call struct { + *mock.Call +} + +// FilterOwnershipTransferred is a helper method to define mock.On call +// - opts *bind.FilterOpts +// - from []common.Address +// - to []common.Address +func (_e *EVM2EVMOnRampInterface_Expecter) FilterOwnershipTransferred(opts interface{}, from interface{}, to interface{}) *EVM2EVMOnRampInterface_FilterOwnershipTransferred_Call { + return &EVM2EVMOnRampInterface_FilterOwnershipTransferred_Call{Call: _e.mock.On("FilterOwnershipTransferred", opts, from, to)} +} + +func (_c *EVM2EVMOnRampInterface_FilterOwnershipTransferred_Call) Run(run func(opts *bind.FilterOpts, from []common.Address, to []common.Address)) *EVM2EVMOnRampInterface_FilterOwnershipTransferred_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts), args[1].([]common.Address), args[2].([]common.Address)) + }) + return _c +} + +func (_c *EVM2EVMOnRampInterface_FilterOwnershipTransferred_Call) Return(_a0 *evm_2_evm_onramp.EVM2EVMOnRampOwnershipTransferredIterator, _a1 error) *EVM2EVMOnRampInterface_FilterOwnershipTransferred_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOnRampInterface_FilterOwnershipTransferred_Call) RunAndReturn(run func(*bind.FilterOpts, []common.Address, []common.Address) (*evm_2_evm_onramp.EVM2EVMOnRampOwnershipTransferredIterator, error)) *EVM2EVMOnRampInterface_FilterOwnershipTransferred_Call { + _c.Call.Return(run) + return _c +} + +// FilterTokenTransferFeeConfigDeleted provides a mock function with given fields: opts +func (_m *EVM2EVMOnRampInterface) FilterTokenTransferFeeConfigDeleted(opts *bind.FilterOpts) (*evm_2_evm_onramp.EVM2EVMOnRampTokenTransferFeeConfigDeletedIterator, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for FilterTokenTransferFeeConfigDeleted") + } + + var r0 *evm_2_evm_onramp.EVM2EVMOnRampTokenTransferFeeConfigDeletedIterator + var r1 error + if rf, ok := ret.Get(0).(func(*bind.FilterOpts) (*evm_2_evm_onramp.EVM2EVMOnRampTokenTransferFeeConfigDeletedIterator, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.FilterOpts) *evm_2_evm_onramp.EVM2EVMOnRampTokenTransferFeeConfigDeletedIterator); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*evm_2_evm_onramp.EVM2EVMOnRampTokenTransferFeeConfigDeletedIterator) + } + } + + if rf, ok := ret.Get(1).(func(*bind.FilterOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOnRampInterface_FilterTokenTransferFeeConfigDeleted_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterTokenTransferFeeConfigDeleted' +type EVM2EVMOnRampInterface_FilterTokenTransferFeeConfigDeleted_Call struct { + *mock.Call +} + +// FilterTokenTransferFeeConfigDeleted is a helper method to define mock.On call +// - opts *bind.FilterOpts +func (_e *EVM2EVMOnRampInterface_Expecter) FilterTokenTransferFeeConfigDeleted(opts interface{}) *EVM2EVMOnRampInterface_FilterTokenTransferFeeConfigDeleted_Call { + return &EVM2EVMOnRampInterface_FilterTokenTransferFeeConfigDeleted_Call{Call: _e.mock.On("FilterTokenTransferFeeConfigDeleted", opts)} +} + +func (_c *EVM2EVMOnRampInterface_FilterTokenTransferFeeConfigDeleted_Call) Run(run func(opts *bind.FilterOpts)) *EVM2EVMOnRampInterface_FilterTokenTransferFeeConfigDeleted_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts)) + }) + return _c +} + +func (_c *EVM2EVMOnRampInterface_FilterTokenTransferFeeConfigDeleted_Call) Return(_a0 *evm_2_evm_onramp.EVM2EVMOnRampTokenTransferFeeConfigDeletedIterator, _a1 error) *EVM2EVMOnRampInterface_FilterTokenTransferFeeConfigDeleted_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOnRampInterface_FilterTokenTransferFeeConfigDeleted_Call) RunAndReturn(run func(*bind.FilterOpts) (*evm_2_evm_onramp.EVM2EVMOnRampTokenTransferFeeConfigDeletedIterator, error)) *EVM2EVMOnRampInterface_FilterTokenTransferFeeConfigDeleted_Call { + _c.Call.Return(run) + return _c +} + +// FilterTokenTransferFeeConfigSet provides a mock function with given fields: opts +func (_m *EVM2EVMOnRampInterface) FilterTokenTransferFeeConfigSet(opts *bind.FilterOpts) (*evm_2_evm_onramp.EVM2EVMOnRampTokenTransferFeeConfigSetIterator, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for FilterTokenTransferFeeConfigSet") + } + + var r0 *evm_2_evm_onramp.EVM2EVMOnRampTokenTransferFeeConfigSetIterator + var r1 error + if rf, ok := ret.Get(0).(func(*bind.FilterOpts) (*evm_2_evm_onramp.EVM2EVMOnRampTokenTransferFeeConfigSetIterator, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.FilterOpts) *evm_2_evm_onramp.EVM2EVMOnRampTokenTransferFeeConfigSetIterator); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*evm_2_evm_onramp.EVM2EVMOnRampTokenTransferFeeConfigSetIterator) + } + } + + if rf, ok := ret.Get(1).(func(*bind.FilterOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOnRampInterface_FilterTokenTransferFeeConfigSet_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterTokenTransferFeeConfigSet' +type EVM2EVMOnRampInterface_FilterTokenTransferFeeConfigSet_Call struct { + *mock.Call +} + +// FilterTokenTransferFeeConfigSet is a helper method to define mock.On call +// - opts *bind.FilterOpts +func (_e *EVM2EVMOnRampInterface_Expecter) FilterTokenTransferFeeConfigSet(opts interface{}) *EVM2EVMOnRampInterface_FilterTokenTransferFeeConfigSet_Call { + return &EVM2EVMOnRampInterface_FilterTokenTransferFeeConfigSet_Call{Call: _e.mock.On("FilterTokenTransferFeeConfigSet", opts)} +} + +func (_c *EVM2EVMOnRampInterface_FilterTokenTransferFeeConfigSet_Call) Run(run func(opts *bind.FilterOpts)) *EVM2EVMOnRampInterface_FilterTokenTransferFeeConfigSet_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts)) + }) + return _c +} + +func (_c *EVM2EVMOnRampInterface_FilterTokenTransferFeeConfigSet_Call) Return(_a0 *evm_2_evm_onramp.EVM2EVMOnRampTokenTransferFeeConfigSetIterator, _a1 error) *EVM2EVMOnRampInterface_FilterTokenTransferFeeConfigSet_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOnRampInterface_FilterTokenTransferFeeConfigSet_Call) RunAndReturn(run func(*bind.FilterOpts) (*evm_2_evm_onramp.EVM2EVMOnRampTokenTransferFeeConfigSetIterator, error)) *EVM2EVMOnRampInterface_FilterTokenTransferFeeConfigSet_Call { + _c.Call.Return(run) + return _c +} + +// FilterTokensConsumed provides a mock function with given fields: opts +func (_m *EVM2EVMOnRampInterface) FilterTokensConsumed(opts *bind.FilterOpts) (*evm_2_evm_onramp.EVM2EVMOnRampTokensConsumedIterator, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for FilterTokensConsumed") + } + + var r0 *evm_2_evm_onramp.EVM2EVMOnRampTokensConsumedIterator + var r1 error + if rf, ok := ret.Get(0).(func(*bind.FilterOpts) (*evm_2_evm_onramp.EVM2EVMOnRampTokensConsumedIterator, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.FilterOpts) *evm_2_evm_onramp.EVM2EVMOnRampTokensConsumedIterator); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*evm_2_evm_onramp.EVM2EVMOnRampTokensConsumedIterator) + } + } + + if rf, ok := ret.Get(1).(func(*bind.FilterOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOnRampInterface_FilterTokensConsumed_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterTokensConsumed' +type EVM2EVMOnRampInterface_FilterTokensConsumed_Call struct { + *mock.Call +} + +// FilterTokensConsumed is a helper method to define mock.On call +// - opts *bind.FilterOpts +func (_e *EVM2EVMOnRampInterface_Expecter) FilterTokensConsumed(opts interface{}) *EVM2EVMOnRampInterface_FilterTokensConsumed_Call { + return &EVM2EVMOnRampInterface_FilterTokensConsumed_Call{Call: _e.mock.On("FilterTokensConsumed", opts)} +} + +func (_c *EVM2EVMOnRampInterface_FilterTokensConsumed_Call) Run(run func(opts *bind.FilterOpts)) *EVM2EVMOnRampInterface_FilterTokensConsumed_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts)) + }) + return _c +} + +func (_c *EVM2EVMOnRampInterface_FilterTokensConsumed_Call) Return(_a0 *evm_2_evm_onramp.EVM2EVMOnRampTokensConsumedIterator, _a1 error) *EVM2EVMOnRampInterface_FilterTokensConsumed_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOnRampInterface_FilterTokensConsumed_Call) RunAndReturn(run func(*bind.FilterOpts) (*evm_2_evm_onramp.EVM2EVMOnRampTokensConsumedIterator, error)) *EVM2EVMOnRampInterface_FilterTokensConsumed_Call { + _c.Call.Return(run) + return _c +} + +// ForwardFromRouter provides a mock function with given fields: opts, destChainSelector, message, feeTokenAmount, originalSender +func (_m *EVM2EVMOnRampInterface) ForwardFromRouter(opts *bind.TransactOpts, destChainSelector uint64, message evm_2_evm_onramp.ClientEVM2AnyMessage, feeTokenAmount *big.Int, originalSender common.Address) (*types.Transaction, error) { + ret := _m.Called(opts, destChainSelector, message, feeTokenAmount, originalSender) + + if len(ret) == 0 { + panic("no return value specified for ForwardFromRouter") + } + + var r0 *types.Transaction + var r1 error + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, uint64, evm_2_evm_onramp.ClientEVM2AnyMessage, *big.Int, common.Address) (*types.Transaction, error)); ok { + return rf(opts, destChainSelector, message, feeTokenAmount, originalSender) + } + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, uint64, evm_2_evm_onramp.ClientEVM2AnyMessage, *big.Int, common.Address) *types.Transaction); ok { + r0 = rf(opts, destChainSelector, message, feeTokenAmount, originalSender) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Transaction) + } + } + + if rf, ok := ret.Get(1).(func(*bind.TransactOpts, uint64, evm_2_evm_onramp.ClientEVM2AnyMessage, *big.Int, common.Address) error); ok { + r1 = rf(opts, destChainSelector, message, feeTokenAmount, originalSender) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOnRampInterface_ForwardFromRouter_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ForwardFromRouter' +type EVM2EVMOnRampInterface_ForwardFromRouter_Call struct { + *mock.Call +} + +// ForwardFromRouter is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - destChainSelector uint64 +// - message evm_2_evm_onramp.ClientEVM2AnyMessage +// - feeTokenAmount *big.Int +// - originalSender common.Address +func (_e *EVM2EVMOnRampInterface_Expecter) ForwardFromRouter(opts interface{}, destChainSelector interface{}, message interface{}, feeTokenAmount interface{}, originalSender interface{}) *EVM2EVMOnRampInterface_ForwardFromRouter_Call { + return &EVM2EVMOnRampInterface_ForwardFromRouter_Call{Call: _e.mock.On("ForwardFromRouter", opts, destChainSelector, message, feeTokenAmount, originalSender)} +} + +func (_c *EVM2EVMOnRampInterface_ForwardFromRouter_Call) Run(run func(opts *bind.TransactOpts, destChainSelector uint64, message evm_2_evm_onramp.ClientEVM2AnyMessage, feeTokenAmount *big.Int, originalSender common.Address)) *EVM2EVMOnRampInterface_ForwardFromRouter_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].(uint64), args[2].(evm_2_evm_onramp.ClientEVM2AnyMessage), args[3].(*big.Int), args[4].(common.Address)) + }) + return _c +} + +func (_c *EVM2EVMOnRampInterface_ForwardFromRouter_Call) Return(_a0 *types.Transaction, _a1 error) *EVM2EVMOnRampInterface_ForwardFromRouter_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOnRampInterface_ForwardFromRouter_Call) RunAndReturn(run func(*bind.TransactOpts, uint64, evm_2_evm_onramp.ClientEVM2AnyMessage, *big.Int, common.Address) (*types.Transaction, error)) *EVM2EVMOnRampInterface_ForwardFromRouter_Call { + _c.Call.Return(run) + return _c +} + +// GetDynamicConfig provides a mock function with given fields: opts +func (_m *EVM2EVMOnRampInterface) GetDynamicConfig(opts *bind.CallOpts) (evm_2_evm_onramp.EVM2EVMOnRampDynamicConfig, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for GetDynamicConfig") + } + + var r0 evm_2_evm_onramp.EVM2EVMOnRampDynamicConfig + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts) (evm_2_evm_onramp.EVM2EVMOnRampDynamicConfig, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts) evm_2_evm_onramp.EVM2EVMOnRampDynamicConfig); ok { + r0 = rf(opts) + } else { + r0 = ret.Get(0).(evm_2_evm_onramp.EVM2EVMOnRampDynamicConfig) + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOnRampInterface_GetDynamicConfig_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetDynamicConfig' +type EVM2EVMOnRampInterface_GetDynamicConfig_Call struct { + *mock.Call +} + +// GetDynamicConfig is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *EVM2EVMOnRampInterface_Expecter) GetDynamicConfig(opts interface{}) *EVM2EVMOnRampInterface_GetDynamicConfig_Call { + return &EVM2EVMOnRampInterface_GetDynamicConfig_Call{Call: _e.mock.On("GetDynamicConfig", opts)} +} + +func (_c *EVM2EVMOnRampInterface_GetDynamicConfig_Call) Run(run func(opts *bind.CallOpts)) *EVM2EVMOnRampInterface_GetDynamicConfig_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *EVM2EVMOnRampInterface_GetDynamicConfig_Call) Return(_a0 evm_2_evm_onramp.EVM2EVMOnRampDynamicConfig, _a1 error) *EVM2EVMOnRampInterface_GetDynamicConfig_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOnRampInterface_GetDynamicConfig_Call) RunAndReturn(run func(*bind.CallOpts) (evm_2_evm_onramp.EVM2EVMOnRampDynamicConfig, error)) *EVM2EVMOnRampInterface_GetDynamicConfig_Call { + _c.Call.Return(run) + return _c +} + +// GetExpectedNextSequenceNumber provides a mock function with given fields: opts +func (_m *EVM2EVMOnRampInterface) GetExpectedNextSequenceNumber(opts *bind.CallOpts) (uint64, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for GetExpectedNextSequenceNumber") + } + + var r0 uint64 + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts) (uint64, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts) uint64); ok { + r0 = rf(opts) + } else { + r0 = ret.Get(0).(uint64) + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOnRampInterface_GetExpectedNextSequenceNumber_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetExpectedNextSequenceNumber' +type EVM2EVMOnRampInterface_GetExpectedNextSequenceNumber_Call struct { + *mock.Call +} + +// GetExpectedNextSequenceNumber is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *EVM2EVMOnRampInterface_Expecter) GetExpectedNextSequenceNumber(opts interface{}) *EVM2EVMOnRampInterface_GetExpectedNextSequenceNumber_Call { + return &EVM2EVMOnRampInterface_GetExpectedNextSequenceNumber_Call{Call: _e.mock.On("GetExpectedNextSequenceNumber", opts)} +} + +func (_c *EVM2EVMOnRampInterface_GetExpectedNextSequenceNumber_Call) Run(run func(opts *bind.CallOpts)) *EVM2EVMOnRampInterface_GetExpectedNextSequenceNumber_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *EVM2EVMOnRampInterface_GetExpectedNextSequenceNumber_Call) Return(_a0 uint64, _a1 error) *EVM2EVMOnRampInterface_GetExpectedNextSequenceNumber_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOnRampInterface_GetExpectedNextSequenceNumber_Call) RunAndReturn(run func(*bind.CallOpts) (uint64, error)) *EVM2EVMOnRampInterface_GetExpectedNextSequenceNumber_Call { + _c.Call.Return(run) + return _c +} + +// GetFee provides a mock function with given fields: opts, destChainSelector, message +func (_m *EVM2EVMOnRampInterface) GetFee(opts *bind.CallOpts, destChainSelector uint64, message evm_2_evm_onramp.ClientEVM2AnyMessage) (*big.Int, error) { + ret := _m.Called(opts, destChainSelector, message) + + if len(ret) == 0 { + panic("no return value specified for GetFee") + } + + var r0 *big.Int + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts, uint64, evm_2_evm_onramp.ClientEVM2AnyMessage) (*big.Int, error)); ok { + return rf(opts, destChainSelector, message) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts, uint64, evm_2_evm_onramp.ClientEVM2AnyMessage) *big.Int); ok { + r0 = rf(opts, destChainSelector, message) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*big.Int) + } + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts, uint64, evm_2_evm_onramp.ClientEVM2AnyMessage) error); ok { + r1 = rf(opts, destChainSelector, message) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOnRampInterface_GetFee_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetFee' +type EVM2EVMOnRampInterface_GetFee_Call struct { + *mock.Call +} + +// GetFee is a helper method to define mock.On call +// - opts *bind.CallOpts +// - destChainSelector uint64 +// - message evm_2_evm_onramp.ClientEVM2AnyMessage +func (_e *EVM2EVMOnRampInterface_Expecter) GetFee(opts interface{}, destChainSelector interface{}, message interface{}) *EVM2EVMOnRampInterface_GetFee_Call { + return &EVM2EVMOnRampInterface_GetFee_Call{Call: _e.mock.On("GetFee", opts, destChainSelector, message)} +} + +func (_c *EVM2EVMOnRampInterface_GetFee_Call) Run(run func(opts *bind.CallOpts, destChainSelector uint64, message evm_2_evm_onramp.ClientEVM2AnyMessage)) *EVM2EVMOnRampInterface_GetFee_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts), args[1].(uint64), args[2].(evm_2_evm_onramp.ClientEVM2AnyMessage)) + }) + return _c +} + +func (_c *EVM2EVMOnRampInterface_GetFee_Call) Return(_a0 *big.Int, _a1 error) *EVM2EVMOnRampInterface_GetFee_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOnRampInterface_GetFee_Call) RunAndReturn(run func(*bind.CallOpts, uint64, evm_2_evm_onramp.ClientEVM2AnyMessage) (*big.Int, error)) *EVM2EVMOnRampInterface_GetFee_Call { + _c.Call.Return(run) + return _c +} + +// GetFeeTokenConfig provides a mock function with given fields: opts, token +func (_m *EVM2EVMOnRampInterface) GetFeeTokenConfig(opts *bind.CallOpts, token common.Address) (evm_2_evm_onramp.EVM2EVMOnRampFeeTokenConfig, error) { + ret := _m.Called(opts, token) + + if len(ret) == 0 { + panic("no return value specified for GetFeeTokenConfig") + } + + var r0 evm_2_evm_onramp.EVM2EVMOnRampFeeTokenConfig + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts, common.Address) (evm_2_evm_onramp.EVM2EVMOnRampFeeTokenConfig, error)); ok { + return rf(opts, token) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts, common.Address) evm_2_evm_onramp.EVM2EVMOnRampFeeTokenConfig); ok { + r0 = rf(opts, token) + } else { + r0 = ret.Get(0).(evm_2_evm_onramp.EVM2EVMOnRampFeeTokenConfig) + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts, common.Address) error); ok { + r1 = rf(opts, token) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOnRampInterface_GetFeeTokenConfig_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetFeeTokenConfig' +type EVM2EVMOnRampInterface_GetFeeTokenConfig_Call struct { + *mock.Call +} + +// GetFeeTokenConfig is a helper method to define mock.On call +// - opts *bind.CallOpts +// - token common.Address +func (_e *EVM2EVMOnRampInterface_Expecter) GetFeeTokenConfig(opts interface{}, token interface{}) *EVM2EVMOnRampInterface_GetFeeTokenConfig_Call { + return &EVM2EVMOnRampInterface_GetFeeTokenConfig_Call{Call: _e.mock.On("GetFeeTokenConfig", opts, token)} +} + +func (_c *EVM2EVMOnRampInterface_GetFeeTokenConfig_Call) Run(run func(opts *bind.CallOpts, token common.Address)) *EVM2EVMOnRampInterface_GetFeeTokenConfig_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts), args[1].(common.Address)) + }) + return _c +} + +func (_c *EVM2EVMOnRampInterface_GetFeeTokenConfig_Call) Return(_a0 evm_2_evm_onramp.EVM2EVMOnRampFeeTokenConfig, _a1 error) *EVM2EVMOnRampInterface_GetFeeTokenConfig_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOnRampInterface_GetFeeTokenConfig_Call) RunAndReturn(run func(*bind.CallOpts, common.Address) (evm_2_evm_onramp.EVM2EVMOnRampFeeTokenConfig, error)) *EVM2EVMOnRampInterface_GetFeeTokenConfig_Call { + _c.Call.Return(run) + return _c +} + +// GetNopFeesJuels provides a mock function with given fields: opts +func (_m *EVM2EVMOnRampInterface) GetNopFeesJuels(opts *bind.CallOpts) (*big.Int, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for GetNopFeesJuels") + } + + var r0 *big.Int + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts) (*big.Int, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts) *big.Int); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*big.Int) + } + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOnRampInterface_GetNopFeesJuels_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetNopFeesJuels' +type EVM2EVMOnRampInterface_GetNopFeesJuels_Call struct { + *mock.Call +} + +// GetNopFeesJuels is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *EVM2EVMOnRampInterface_Expecter) GetNopFeesJuels(opts interface{}) *EVM2EVMOnRampInterface_GetNopFeesJuels_Call { + return &EVM2EVMOnRampInterface_GetNopFeesJuels_Call{Call: _e.mock.On("GetNopFeesJuels", opts)} +} + +func (_c *EVM2EVMOnRampInterface_GetNopFeesJuels_Call) Run(run func(opts *bind.CallOpts)) *EVM2EVMOnRampInterface_GetNopFeesJuels_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *EVM2EVMOnRampInterface_GetNopFeesJuels_Call) Return(_a0 *big.Int, _a1 error) *EVM2EVMOnRampInterface_GetNopFeesJuels_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOnRampInterface_GetNopFeesJuels_Call) RunAndReturn(run func(*bind.CallOpts) (*big.Int, error)) *EVM2EVMOnRampInterface_GetNopFeesJuels_Call { + _c.Call.Return(run) + return _c +} + +// GetNops provides a mock function with given fields: opts +func (_m *EVM2EVMOnRampInterface) GetNops(opts *bind.CallOpts) (evm_2_evm_onramp.GetNops, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for GetNops") + } + + var r0 evm_2_evm_onramp.GetNops + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts) (evm_2_evm_onramp.GetNops, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts) evm_2_evm_onramp.GetNops); ok { + r0 = rf(opts) + } else { + r0 = ret.Get(0).(evm_2_evm_onramp.GetNops) + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOnRampInterface_GetNops_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetNops' +type EVM2EVMOnRampInterface_GetNops_Call struct { + *mock.Call +} + +// GetNops is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *EVM2EVMOnRampInterface_Expecter) GetNops(opts interface{}) *EVM2EVMOnRampInterface_GetNops_Call { + return &EVM2EVMOnRampInterface_GetNops_Call{Call: _e.mock.On("GetNops", opts)} +} + +func (_c *EVM2EVMOnRampInterface_GetNops_Call) Run(run func(opts *bind.CallOpts)) *EVM2EVMOnRampInterface_GetNops_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *EVM2EVMOnRampInterface_GetNops_Call) Return(_a0 evm_2_evm_onramp.GetNops, _a1 error) *EVM2EVMOnRampInterface_GetNops_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOnRampInterface_GetNops_Call) RunAndReturn(run func(*bind.CallOpts) (evm_2_evm_onramp.GetNops, error)) *EVM2EVMOnRampInterface_GetNops_Call { + _c.Call.Return(run) + return _c +} + +// GetPoolBySourceToken provides a mock function with given fields: opts, arg0, sourceToken +func (_m *EVM2EVMOnRampInterface) GetPoolBySourceToken(opts *bind.CallOpts, arg0 uint64, sourceToken common.Address) (common.Address, error) { + ret := _m.Called(opts, arg0, sourceToken) + + if len(ret) == 0 { + panic("no return value specified for GetPoolBySourceToken") + } + + var r0 common.Address + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts, uint64, common.Address) (common.Address, error)); ok { + return rf(opts, arg0, sourceToken) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts, uint64, common.Address) common.Address); ok { + r0 = rf(opts, arg0, sourceToken) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Address) + } + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts, uint64, common.Address) error); ok { + r1 = rf(opts, arg0, sourceToken) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOnRampInterface_GetPoolBySourceToken_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPoolBySourceToken' +type EVM2EVMOnRampInterface_GetPoolBySourceToken_Call struct { + *mock.Call +} + +// GetPoolBySourceToken is a helper method to define mock.On call +// - opts *bind.CallOpts +// - arg0 uint64 +// - sourceToken common.Address +func (_e *EVM2EVMOnRampInterface_Expecter) GetPoolBySourceToken(opts interface{}, arg0 interface{}, sourceToken interface{}) *EVM2EVMOnRampInterface_GetPoolBySourceToken_Call { + return &EVM2EVMOnRampInterface_GetPoolBySourceToken_Call{Call: _e.mock.On("GetPoolBySourceToken", opts, arg0, sourceToken)} +} + +func (_c *EVM2EVMOnRampInterface_GetPoolBySourceToken_Call) Run(run func(opts *bind.CallOpts, arg0 uint64, sourceToken common.Address)) *EVM2EVMOnRampInterface_GetPoolBySourceToken_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts), args[1].(uint64), args[2].(common.Address)) + }) + return _c +} + +func (_c *EVM2EVMOnRampInterface_GetPoolBySourceToken_Call) Return(_a0 common.Address, _a1 error) *EVM2EVMOnRampInterface_GetPoolBySourceToken_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOnRampInterface_GetPoolBySourceToken_Call) RunAndReturn(run func(*bind.CallOpts, uint64, common.Address) (common.Address, error)) *EVM2EVMOnRampInterface_GetPoolBySourceToken_Call { + _c.Call.Return(run) + return _c +} + +// GetSenderNonce provides a mock function with given fields: opts, sender +func (_m *EVM2EVMOnRampInterface) GetSenderNonce(opts *bind.CallOpts, sender common.Address) (uint64, error) { + ret := _m.Called(opts, sender) + + if len(ret) == 0 { + panic("no return value specified for GetSenderNonce") + } + + var r0 uint64 + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts, common.Address) (uint64, error)); ok { + return rf(opts, sender) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts, common.Address) uint64); ok { + r0 = rf(opts, sender) + } else { + r0 = ret.Get(0).(uint64) + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts, common.Address) error); ok { + r1 = rf(opts, sender) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOnRampInterface_GetSenderNonce_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSenderNonce' +type EVM2EVMOnRampInterface_GetSenderNonce_Call struct { + *mock.Call +} + +// GetSenderNonce is a helper method to define mock.On call +// - opts *bind.CallOpts +// - sender common.Address +func (_e *EVM2EVMOnRampInterface_Expecter) GetSenderNonce(opts interface{}, sender interface{}) *EVM2EVMOnRampInterface_GetSenderNonce_Call { + return &EVM2EVMOnRampInterface_GetSenderNonce_Call{Call: _e.mock.On("GetSenderNonce", opts, sender)} +} + +func (_c *EVM2EVMOnRampInterface_GetSenderNonce_Call) Run(run func(opts *bind.CallOpts, sender common.Address)) *EVM2EVMOnRampInterface_GetSenderNonce_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts), args[1].(common.Address)) + }) + return _c +} + +func (_c *EVM2EVMOnRampInterface_GetSenderNonce_Call) Return(_a0 uint64, _a1 error) *EVM2EVMOnRampInterface_GetSenderNonce_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOnRampInterface_GetSenderNonce_Call) RunAndReturn(run func(*bind.CallOpts, common.Address) (uint64, error)) *EVM2EVMOnRampInterface_GetSenderNonce_Call { + _c.Call.Return(run) + return _c +} + +// GetStaticConfig provides a mock function with given fields: opts +func (_m *EVM2EVMOnRampInterface) GetStaticConfig(opts *bind.CallOpts) (evm_2_evm_onramp.EVM2EVMOnRampStaticConfig, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for GetStaticConfig") + } + + var r0 evm_2_evm_onramp.EVM2EVMOnRampStaticConfig + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts) (evm_2_evm_onramp.EVM2EVMOnRampStaticConfig, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts) evm_2_evm_onramp.EVM2EVMOnRampStaticConfig); ok { + r0 = rf(opts) + } else { + r0 = ret.Get(0).(evm_2_evm_onramp.EVM2EVMOnRampStaticConfig) + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOnRampInterface_GetStaticConfig_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetStaticConfig' +type EVM2EVMOnRampInterface_GetStaticConfig_Call struct { + *mock.Call +} + +// GetStaticConfig is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *EVM2EVMOnRampInterface_Expecter) GetStaticConfig(opts interface{}) *EVM2EVMOnRampInterface_GetStaticConfig_Call { + return &EVM2EVMOnRampInterface_GetStaticConfig_Call{Call: _e.mock.On("GetStaticConfig", opts)} +} + +func (_c *EVM2EVMOnRampInterface_GetStaticConfig_Call) Run(run func(opts *bind.CallOpts)) *EVM2EVMOnRampInterface_GetStaticConfig_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *EVM2EVMOnRampInterface_GetStaticConfig_Call) Return(_a0 evm_2_evm_onramp.EVM2EVMOnRampStaticConfig, _a1 error) *EVM2EVMOnRampInterface_GetStaticConfig_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOnRampInterface_GetStaticConfig_Call) RunAndReturn(run func(*bind.CallOpts) (evm_2_evm_onramp.EVM2EVMOnRampStaticConfig, error)) *EVM2EVMOnRampInterface_GetStaticConfig_Call { + _c.Call.Return(run) + return _c +} + +// GetSupportedTokens provides a mock function with given fields: opts, arg0 +func (_m *EVM2EVMOnRampInterface) GetSupportedTokens(opts *bind.CallOpts, arg0 uint64) ([]common.Address, error) { + ret := _m.Called(opts, arg0) + + if len(ret) == 0 { + panic("no return value specified for GetSupportedTokens") + } + + var r0 []common.Address + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts, uint64) ([]common.Address, error)); ok { + return rf(opts, arg0) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts, uint64) []common.Address); ok { + r0 = rf(opts, arg0) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]common.Address) + } + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts, uint64) error); ok { + r1 = rf(opts, arg0) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOnRampInterface_GetSupportedTokens_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSupportedTokens' +type EVM2EVMOnRampInterface_GetSupportedTokens_Call struct { + *mock.Call +} + +// GetSupportedTokens is a helper method to define mock.On call +// - opts *bind.CallOpts +// - arg0 uint64 +func (_e *EVM2EVMOnRampInterface_Expecter) GetSupportedTokens(opts interface{}, arg0 interface{}) *EVM2EVMOnRampInterface_GetSupportedTokens_Call { + return &EVM2EVMOnRampInterface_GetSupportedTokens_Call{Call: _e.mock.On("GetSupportedTokens", opts, arg0)} +} + +func (_c *EVM2EVMOnRampInterface_GetSupportedTokens_Call) Run(run func(opts *bind.CallOpts, arg0 uint64)) *EVM2EVMOnRampInterface_GetSupportedTokens_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts), args[1].(uint64)) + }) + return _c +} + +func (_c *EVM2EVMOnRampInterface_GetSupportedTokens_Call) Return(_a0 []common.Address, _a1 error) *EVM2EVMOnRampInterface_GetSupportedTokens_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOnRampInterface_GetSupportedTokens_Call) RunAndReturn(run func(*bind.CallOpts, uint64) ([]common.Address, error)) *EVM2EVMOnRampInterface_GetSupportedTokens_Call { + _c.Call.Return(run) + return _c +} + +// GetTokenLimitAdmin provides a mock function with given fields: opts +func (_m *EVM2EVMOnRampInterface) GetTokenLimitAdmin(opts *bind.CallOpts) (common.Address, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for GetTokenLimitAdmin") + } + + var r0 common.Address + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts) (common.Address, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts) common.Address); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Address) + } + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOnRampInterface_GetTokenLimitAdmin_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetTokenLimitAdmin' +type EVM2EVMOnRampInterface_GetTokenLimitAdmin_Call struct { + *mock.Call +} + +// GetTokenLimitAdmin is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *EVM2EVMOnRampInterface_Expecter) GetTokenLimitAdmin(opts interface{}) *EVM2EVMOnRampInterface_GetTokenLimitAdmin_Call { + return &EVM2EVMOnRampInterface_GetTokenLimitAdmin_Call{Call: _e.mock.On("GetTokenLimitAdmin", opts)} +} + +func (_c *EVM2EVMOnRampInterface_GetTokenLimitAdmin_Call) Run(run func(opts *bind.CallOpts)) *EVM2EVMOnRampInterface_GetTokenLimitAdmin_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *EVM2EVMOnRampInterface_GetTokenLimitAdmin_Call) Return(_a0 common.Address, _a1 error) *EVM2EVMOnRampInterface_GetTokenLimitAdmin_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOnRampInterface_GetTokenLimitAdmin_Call) RunAndReturn(run func(*bind.CallOpts) (common.Address, error)) *EVM2EVMOnRampInterface_GetTokenLimitAdmin_Call { + _c.Call.Return(run) + return _c +} + +// GetTokenTransferFeeConfig provides a mock function with given fields: opts, token +func (_m *EVM2EVMOnRampInterface) GetTokenTransferFeeConfig(opts *bind.CallOpts, token common.Address) (evm_2_evm_onramp.EVM2EVMOnRampTokenTransferFeeConfig, error) { + ret := _m.Called(opts, token) + + if len(ret) == 0 { + panic("no return value specified for GetTokenTransferFeeConfig") + } + + var r0 evm_2_evm_onramp.EVM2EVMOnRampTokenTransferFeeConfig + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts, common.Address) (evm_2_evm_onramp.EVM2EVMOnRampTokenTransferFeeConfig, error)); ok { + return rf(opts, token) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts, common.Address) evm_2_evm_onramp.EVM2EVMOnRampTokenTransferFeeConfig); ok { + r0 = rf(opts, token) + } else { + r0 = ret.Get(0).(evm_2_evm_onramp.EVM2EVMOnRampTokenTransferFeeConfig) + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts, common.Address) error); ok { + r1 = rf(opts, token) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOnRampInterface_GetTokenTransferFeeConfig_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetTokenTransferFeeConfig' +type EVM2EVMOnRampInterface_GetTokenTransferFeeConfig_Call struct { + *mock.Call +} + +// GetTokenTransferFeeConfig is a helper method to define mock.On call +// - opts *bind.CallOpts +// - token common.Address +func (_e *EVM2EVMOnRampInterface_Expecter) GetTokenTransferFeeConfig(opts interface{}, token interface{}) *EVM2EVMOnRampInterface_GetTokenTransferFeeConfig_Call { + return &EVM2EVMOnRampInterface_GetTokenTransferFeeConfig_Call{Call: _e.mock.On("GetTokenTransferFeeConfig", opts, token)} +} + +func (_c *EVM2EVMOnRampInterface_GetTokenTransferFeeConfig_Call) Run(run func(opts *bind.CallOpts, token common.Address)) *EVM2EVMOnRampInterface_GetTokenTransferFeeConfig_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts), args[1].(common.Address)) + }) + return _c +} + +func (_c *EVM2EVMOnRampInterface_GetTokenTransferFeeConfig_Call) Return(_a0 evm_2_evm_onramp.EVM2EVMOnRampTokenTransferFeeConfig, _a1 error) *EVM2EVMOnRampInterface_GetTokenTransferFeeConfig_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOnRampInterface_GetTokenTransferFeeConfig_Call) RunAndReturn(run func(*bind.CallOpts, common.Address) (evm_2_evm_onramp.EVM2EVMOnRampTokenTransferFeeConfig, error)) *EVM2EVMOnRampInterface_GetTokenTransferFeeConfig_Call { + _c.Call.Return(run) + return _c +} + +// LinkAvailableForPayment provides a mock function with given fields: opts +func (_m *EVM2EVMOnRampInterface) LinkAvailableForPayment(opts *bind.CallOpts) (*big.Int, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for LinkAvailableForPayment") + } + + var r0 *big.Int + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts) (*big.Int, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts) *big.Int); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*big.Int) + } + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOnRampInterface_LinkAvailableForPayment_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LinkAvailableForPayment' +type EVM2EVMOnRampInterface_LinkAvailableForPayment_Call struct { + *mock.Call +} + +// LinkAvailableForPayment is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *EVM2EVMOnRampInterface_Expecter) LinkAvailableForPayment(opts interface{}) *EVM2EVMOnRampInterface_LinkAvailableForPayment_Call { + return &EVM2EVMOnRampInterface_LinkAvailableForPayment_Call{Call: _e.mock.On("LinkAvailableForPayment", opts)} +} + +func (_c *EVM2EVMOnRampInterface_LinkAvailableForPayment_Call) Run(run func(opts *bind.CallOpts)) *EVM2EVMOnRampInterface_LinkAvailableForPayment_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *EVM2EVMOnRampInterface_LinkAvailableForPayment_Call) Return(_a0 *big.Int, _a1 error) *EVM2EVMOnRampInterface_LinkAvailableForPayment_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOnRampInterface_LinkAvailableForPayment_Call) RunAndReturn(run func(*bind.CallOpts) (*big.Int, error)) *EVM2EVMOnRampInterface_LinkAvailableForPayment_Call { + _c.Call.Return(run) + return _c +} + +// Owner provides a mock function with given fields: opts +func (_m *EVM2EVMOnRampInterface) Owner(opts *bind.CallOpts) (common.Address, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for Owner") + } + + var r0 common.Address + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts) (common.Address, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts) common.Address); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Address) + } + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOnRampInterface_Owner_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Owner' +type EVM2EVMOnRampInterface_Owner_Call struct { + *mock.Call +} + +// Owner is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *EVM2EVMOnRampInterface_Expecter) Owner(opts interface{}) *EVM2EVMOnRampInterface_Owner_Call { + return &EVM2EVMOnRampInterface_Owner_Call{Call: _e.mock.On("Owner", opts)} +} + +func (_c *EVM2EVMOnRampInterface_Owner_Call) Run(run func(opts *bind.CallOpts)) *EVM2EVMOnRampInterface_Owner_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *EVM2EVMOnRampInterface_Owner_Call) Return(_a0 common.Address, _a1 error) *EVM2EVMOnRampInterface_Owner_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOnRampInterface_Owner_Call) RunAndReturn(run func(*bind.CallOpts) (common.Address, error)) *EVM2EVMOnRampInterface_Owner_Call { + _c.Call.Return(run) + return _c +} + +// ParseAdminSet provides a mock function with given fields: log +func (_m *EVM2EVMOnRampInterface) ParseAdminSet(log types.Log) (*evm_2_evm_onramp.EVM2EVMOnRampAdminSet, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParseAdminSet") + } + + var r0 *evm_2_evm_onramp.EVM2EVMOnRampAdminSet + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (*evm_2_evm_onramp.EVM2EVMOnRampAdminSet, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) *evm_2_evm_onramp.EVM2EVMOnRampAdminSet); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*evm_2_evm_onramp.EVM2EVMOnRampAdminSet) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOnRampInterface_ParseAdminSet_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseAdminSet' +type EVM2EVMOnRampInterface_ParseAdminSet_Call struct { + *mock.Call +} + +// ParseAdminSet is a helper method to define mock.On call +// - log types.Log +func (_e *EVM2EVMOnRampInterface_Expecter) ParseAdminSet(log interface{}) *EVM2EVMOnRampInterface_ParseAdminSet_Call { + return &EVM2EVMOnRampInterface_ParseAdminSet_Call{Call: _e.mock.On("ParseAdminSet", log)} +} + +func (_c *EVM2EVMOnRampInterface_ParseAdminSet_Call) Run(run func(log types.Log)) *EVM2EVMOnRampInterface_ParseAdminSet_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *EVM2EVMOnRampInterface_ParseAdminSet_Call) Return(_a0 *evm_2_evm_onramp.EVM2EVMOnRampAdminSet, _a1 error) *EVM2EVMOnRampInterface_ParseAdminSet_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOnRampInterface_ParseAdminSet_Call) RunAndReturn(run func(types.Log) (*evm_2_evm_onramp.EVM2EVMOnRampAdminSet, error)) *EVM2EVMOnRampInterface_ParseAdminSet_Call { + _c.Call.Return(run) + return _c +} + +// ParseCCIPSendRequested provides a mock function with given fields: log +func (_m *EVM2EVMOnRampInterface) ParseCCIPSendRequested(log types.Log) (*evm_2_evm_onramp.EVM2EVMOnRampCCIPSendRequested, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParseCCIPSendRequested") + } + + var r0 *evm_2_evm_onramp.EVM2EVMOnRampCCIPSendRequested + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (*evm_2_evm_onramp.EVM2EVMOnRampCCIPSendRequested, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) *evm_2_evm_onramp.EVM2EVMOnRampCCIPSendRequested); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*evm_2_evm_onramp.EVM2EVMOnRampCCIPSendRequested) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOnRampInterface_ParseCCIPSendRequested_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseCCIPSendRequested' +type EVM2EVMOnRampInterface_ParseCCIPSendRequested_Call struct { + *mock.Call +} + +// ParseCCIPSendRequested is a helper method to define mock.On call +// - log types.Log +func (_e *EVM2EVMOnRampInterface_Expecter) ParseCCIPSendRequested(log interface{}) *EVM2EVMOnRampInterface_ParseCCIPSendRequested_Call { + return &EVM2EVMOnRampInterface_ParseCCIPSendRequested_Call{Call: _e.mock.On("ParseCCIPSendRequested", log)} +} + +func (_c *EVM2EVMOnRampInterface_ParseCCIPSendRequested_Call) Run(run func(log types.Log)) *EVM2EVMOnRampInterface_ParseCCIPSendRequested_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *EVM2EVMOnRampInterface_ParseCCIPSendRequested_Call) Return(_a0 *evm_2_evm_onramp.EVM2EVMOnRampCCIPSendRequested, _a1 error) *EVM2EVMOnRampInterface_ParseCCIPSendRequested_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOnRampInterface_ParseCCIPSendRequested_Call) RunAndReturn(run func(types.Log) (*evm_2_evm_onramp.EVM2EVMOnRampCCIPSendRequested, error)) *EVM2EVMOnRampInterface_ParseCCIPSendRequested_Call { + _c.Call.Return(run) + return _c +} + +// ParseConfigChanged provides a mock function with given fields: log +func (_m *EVM2EVMOnRampInterface) ParseConfigChanged(log types.Log) (*evm_2_evm_onramp.EVM2EVMOnRampConfigChanged, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParseConfigChanged") + } + + var r0 *evm_2_evm_onramp.EVM2EVMOnRampConfigChanged + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (*evm_2_evm_onramp.EVM2EVMOnRampConfigChanged, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) *evm_2_evm_onramp.EVM2EVMOnRampConfigChanged); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*evm_2_evm_onramp.EVM2EVMOnRampConfigChanged) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOnRampInterface_ParseConfigChanged_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseConfigChanged' +type EVM2EVMOnRampInterface_ParseConfigChanged_Call struct { + *mock.Call +} + +// ParseConfigChanged is a helper method to define mock.On call +// - log types.Log +func (_e *EVM2EVMOnRampInterface_Expecter) ParseConfigChanged(log interface{}) *EVM2EVMOnRampInterface_ParseConfigChanged_Call { + return &EVM2EVMOnRampInterface_ParseConfigChanged_Call{Call: _e.mock.On("ParseConfigChanged", log)} +} + +func (_c *EVM2EVMOnRampInterface_ParseConfigChanged_Call) Run(run func(log types.Log)) *EVM2EVMOnRampInterface_ParseConfigChanged_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *EVM2EVMOnRampInterface_ParseConfigChanged_Call) Return(_a0 *evm_2_evm_onramp.EVM2EVMOnRampConfigChanged, _a1 error) *EVM2EVMOnRampInterface_ParseConfigChanged_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOnRampInterface_ParseConfigChanged_Call) RunAndReturn(run func(types.Log) (*evm_2_evm_onramp.EVM2EVMOnRampConfigChanged, error)) *EVM2EVMOnRampInterface_ParseConfigChanged_Call { + _c.Call.Return(run) + return _c +} + +// ParseConfigSet provides a mock function with given fields: log +func (_m *EVM2EVMOnRampInterface) ParseConfigSet(log types.Log) (*evm_2_evm_onramp.EVM2EVMOnRampConfigSet, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParseConfigSet") + } + + var r0 *evm_2_evm_onramp.EVM2EVMOnRampConfigSet + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (*evm_2_evm_onramp.EVM2EVMOnRampConfigSet, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) *evm_2_evm_onramp.EVM2EVMOnRampConfigSet); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*evm_2_evm_onramp.EVM2EVMOnRampConfigSet) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOnRampInterface_ParseConfigSet_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseConfigSet' +type EVM2EVMOnRampInterface_ParseConfigSet_Call struct { + *mock.Call +} + +// ParseConfigSet is a helper method to define mock.On call +// - log types.Log +func (_e *EVM2EVMOnRampInterface_Expecter) ParseConfigSet(log interface{}) *EVM2EVMOnRampInterface_ParseConfigSet_Call { + return &EVM2EVMOnRampInterface_ParseConfigSet_Call{Call: _e.mock.On("ParseConfigSet", log)} +} + +func (_c *EVM2EVMOnRampInterface_ParseConfigSet_Call) Run(run func(log types.Log)) *EVM2EVMOnRampInterface_ParseConfigSet_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *EVM2EVMOnRampInterface_ParseConfigSet_Call) Return(_a0 *evm_2_evm_onramp.EVM2EVMOnRampConfigSet, _a1 error) *EVM2EVMOnRampInterface_ParseConfigSet_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOnRampInterface_ParseConfigSet_Call) RunAndReturn(run func(types.Log) (*evm_2_evm_onramp.EVM2EVMOnRampConfigSet, error)) *EVM2EVMOnRampInterface_ParseConfigSet_Call { + _c.Call.Return(run) + return _c +} + +// ParseFeeConfigSet provides a mock function with given fields: log +func (_m *EVM2EVMOnRampInterface) ParseFeeConfigSet(log types.Log) (*evm_2_evm_onramp.EVM2EVMOnRampFeeConfigSet, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParseFeeConfigSet") + } + + var r0 *evm_2_evm_onramp.EVM2EVMOnRampFeeConfigSet + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (*evm_2_evm_onramp.EVM2EVMOnRampFeeConfigSet, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) *evm_2_evm_onramp.EVM2EVMOnRampFeeConfigSet); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*evm_2_evm_onramp.EVM2EVMOnRampFeeConfigSet) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOnRampInterface_ParseFeeConfigSet_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseFeeConfigSet' +type EVM2EVMOnRampInterface_ParseFeeConfigSet_Call struct { + *mock.Call +} + +// ParseFeeConfigSet is a helper method to define mock.On call +// - log types.Log +func (_e *EVM2EVMOnRampInterface_Expecter) ParseFeeConfigSet(log interface{}) *EVM2EVMOnRampInterface_ParseFeeConfigSet_Call { + return &EVM2EVMOnRampInterface_ParseFeeConfigSet_Call{Call: _e.mock.On("ParseFeeConfigSet", log)} +} + +func (_c *EVM2EVMOnRampInterface_ParseFeeConfigSet_Call) Run(run func(log types.Log)) *EVM2EVMOnRampInterface_ParseFeeConfigSet_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *EVM2EVMOnRampInterface_ParseFeeConfigSet_Call) Return(_a0 *evm_2_evm_onramp.EVM2EVMOnRampFeeConfigSet, _a1 error) *EVM2EVMOnRampInterface_ParseFeeConfigSet_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOnRampInterface_ParseFeeConfigSet_Call) RunAndReturn(run func(types.Log) (*evm_2_evm_onramp.EVM2EVMOnRampFeeConfigSet, error)) *EVM2EVMOnRampInterface_ParseFeeConfigSet_Call { + _c.Call.Return(run) + return _c +} + +// ParseLog provides a mock function with given fields: log +func (_m *EVM2EVMOnRampInterface) ParseLog(log types.Log) (generated.AbigenLog, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParseLog") + } + + var r0 generated.AbigenLog + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (generated.AbigenLog, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) generated.AbigenLog); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(generated.AbigenLog) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOnRampInterface_ParseLog_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseLog' +type EVM2EVMOnRampInterface_ParseLog_Call struct { + *mock.Call +} + +// ParseLog is a helper method to define mock.On call +// - log types.Log +func (_e *EVM2EVMOnRampInterface_Expecter) ParseLog(log interface{}) *EVM2EVMOnRampInterface_ParseLog_Call { + return &EVM2EVMOnRampInterface_ParseLog_Call{Call: _e.mock.On("ParseLog", log)} +} + +func (_c *EVM2EVMOnRampInterface_ParseLog_Call) Run(run func(log types.Log)) *EVM2EVMOnRampInterface_ParseLog_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *EVM2EVMOnRampInterface_ParseLog_Call) Return(_a0 generated.AbigenLog, _a1 error) *EVM2EVMOnRampInterface_ParseLog_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOnRampInterface_ParseLog_Call) RunAndReturn(run func(types.Log) (generated.AbigenLog, error)) *EVM2EVMOnRampInterface_ParseLog_Call { + _c.Call.Return(run) + return _c +} + +// ParseNopPaid provides a mock function with given fields: log +func (_m *EVM2EVMOnRampInterface) ParseNopPaid(log types.Log) (*evm_2_evm_onramp.EVM2EVMOnRampNopPaid, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParseNopPaid") + } + + var r0 *evm_2_evm_onramp.EVM2EVMOnRampNopPaid + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (*evm_2_evm_onramp.EVM2EVMOnRampNopPaid, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) *evm_2_evm_onramp.EVM2EVMOnRampNopPaid); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*evm_2_evm_onramp.EVM2EVMOnRampNopPaid) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOnRampInterface_ParseNopPaid_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseNopPaid' +type EVM2EVMOnRampInterface_ParseNopPaid_Call struct { + *mock.Call +} + +// ParseNopPaid is a helper method to define mock.On call +// - log types.Log +func (_e *EVM2EVMOnRampInterface_Expecter) ParseNopPaid(log interface{}) *EVM2EVMOnRampInterface_ParseNopPaid_Call { + return &EVM2EVMOnRampInterface_ParseNopPaid_Call{Call: _e.mock.On("ParseNopPaid", log)} +} + +func (_c *EVM2EVMOnRampInterface_ParseNopPaid_Call) Run(run func(log types.Log)) *EVM2EVMOnRampInterface_ParseNopPaid_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *EVM2EVMOnRampInterface_ParseNopPaid_Call) Return(_a0 *evm_2_evm_onramp.EVM2EVMOnRampNopPaid, _a1 error) *EVM2EVMOnRampInterface_ParseNopPaid_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOnRampInterface_ParseNopPaid_Call) RunAndReturn(run func(types.Log) (*evm_2_evm_onramp.EVM2EVMOnRampNopPaid, error)) *EVM2EVMOnRampInterface_ParseNopPaid_Call { + _c.Call.Return(run) + return _c +} + +// ParseNopsSet provides a mock function with given fields: log +func (_m *EVM2EVMOnRampInterface) ParseNopsSet(log types.Log) (*evm_2_evm_onramp.EVM2EVMOnRampNopsSet, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParseNopsSet") + } + + var r0 *evm_2_evm_onramp.EVM2EVMOnRampNopsSet + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (*evm_2_evm_onramp.EVM2EVMOnRampNopsSet, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) *evm_2_evm_onramp.EVM2EVMOnRampNopsSet); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*evm_2_evm_onramp.EVM2EVMOnRampNopsSet) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOnRampInterface_ParseNopsSet_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseNopsSet' +type EVM2EVMOnRampInterface_ParseNopsSet_Call struct { + *mock.Call +} + +// ParseNopsSet is a helper method to define mock.On call +// - log types.Log +func (_e *EVM2EVMOnRampInterface_Expecter) ParseNopsSet(log interface{}) *EVM2EVMOnRampInterface_ParseNopsSet_Call { + return &EVM2EVMOnRampInterface_ParseNopsSet_Call{Call: _e.mock.On("ParseNopsSet", log)} +} + +func (_c *EVM2EVMOnRampInterface_ParseNopsSet_Call) Run(run func(log types.Log)) *EVM2EVMOnRampInterface_ParseNopsSet_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *EVM2EVMOnRampInterface_ParseNopsSet_Call) Return(_a0 *evm_2_evm_onramp.EVM2EVMOnRampNopsSet, _a1 error) *EVM2EVMOnRampInterface_ParseNopsSet_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOnRampInterface_ParseNopsSet_Call) RunAndReturn(run func(types.Log) (*evm_2_evm_onramp.EVM2EVMOnRampNopsSet, error)) *EVM2EVMOnRampInterface_ParseNopsSet_Call { + _c.Call.Return(run) + return _c +} + +// ParseOwnershipTransferRequested provides a mock function with given fields: log +func (_m *EVM2EVMOnRampInterface) ParseOwnershipTransferRequested(log types.Log) (*evm_2_evm_onramp.EVM2EVMOnRampOwnershipTransferRequested, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParseOwnershipTransferRequested") + } + + var r0 *evm_2_evm_onramp.EVM2EVMOnRampOwnershipTransferRequested + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (*evm_2_evm_onramp.EVM2EVMOnRampOwnershipTransferRequested, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) *evm_2_evm_onramp.EVM2EVMOnRampOwnershipTransferRequested); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*evm_2_evm_onramp.EVM2EVMOnRampOwnershipTransferRequested) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOnRampInterface_ParseOwnershipTransferRequested_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseOwnershipTransferRequested' +type EVM2EVMOnRampInterface_ParseOwnershipTransferRequested_Call struct { + *mock.Call +} + +// ParseOwnershipTransferRequested is a helper method to define mock.On call +// - log types.Log +func (_e *EVM2EVMOnRampInterface_Expecter) ParseOwnershipTransferRequested(log interface{}) *EVM2EVMOnRampInterface_ParseOwnershipTransferRequested_Call { + return &EVM2EVMOnRampInterface_ParseOwnershipTransferRequested_Call{Call: _e.mock.On("ParseOwnershipTransferRequested", log)} +} + +func (_c *EVM2EVMOnRampInterface_ParseOwnershipTransferRequested_Call) Run(run func(log types.Log)) *EVM2EVMOnRampInterface_ParseOwnershipTransferRequested_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *EVM2EVMOnRampInterface_ParseOwnershipTransferRequested_Call) Return(_a0 *evm_2_evm_onramp.EVM2EVMOnRampOwnershipTransferRequested, _a1 error) *EVM2EVMOnRampInterface_ParseOwnershipTransferRequested_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOnRampInterface_ParseOwnershipTransferRequested_Call) RunAndReturn(run func(types.Log) (*evm_2_evm_onramp.EVM2EVMOnRampOwnershipTransferRequested, error)) *EVM2EVMOnRampInterface_ParseOwnershipTransferRequested_Call { + _c.Call.Return(run) + return _c +} + +// ParseOwnershipTransferred provides a mock function with given fields: log +func (_m *EVM2EVMOnRampInterface) ParseOwnershipTransferred(log types.Log) (*evm_2_evm_onramp.EVM2EVMOnRampOwnershipTransferred, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParseOwnershipTransferred") + } + + var r0 *evm_2_evm_onramp.EVM2EVMOnRampOwnershipTransferred + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (*evm_2_evm_onramp.EVM2EVMOnRampOwnershipTransferred, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) *evm_2_evm_onramp.EVM2EVMOnRampOwnershipTransferred); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*evm_2_evm_onramp.EVM2EVMOnRampOwnershipTransferred) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOnRampInterface_ParseOwnershipTransferred_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseOwnershipTransferred' +type EVM2EVMOnRampInterface_ParseOwnershipTransferred_Call struct { + *mock.Call +} + +// ParseOwnershipTransferred is a helper method to define mock.On call +// - log types.Log +func (_e *EVM2EVMOnRampInterface_Expecter) ParseOwnershipTransferred(log interface{}) *EVM2EVMOnRampInterface_ParseOwnershipTransferred_Call { + return &EVM2EVMOnRampInterface_ParseOwnershipTransferred_Call{Call: _e.mock.On("ParseOwnershipTransferred", log)} +} + +func (_c *EVM2EVMOnRampInterface_ParseOwnershipTransferred_Call) Run(run func(log types.Log)) *EVM2EVMOnRampInterface_ParseOwnershipTransferred_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *EVM2EVMOnRampInterface_ParseOwnershipTransferred_Call) Return(_a0 *evm_2_evm_onramp.EVM2EVMOnRampOwnershipTransferred, _a1 error) *EVM2EVMOnRampInterface_ParseOwnershipTransferred_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOnRampInterface_ParseOwnershipTransferred_Call) RunAndReturn(run func(types.Log) (*evm_2_evm_onramp.EVM2EVMOnRampOwnershipTransferred, error)) *EVM2EVMOnRampInterface_ParseOwnershipTransferred_Call { + _c.Call.Return(run) + return _c +} + +// ParseTokenTransferFeeConfigDeleted provides a mock function with given fields: log +func (_m *EVM2EVMOnRampInterface) ParseTokenTransferFeeConfigDeleted(log types.Log) (*evm_2_evm_onramp.EVM2EVMOnRampTokenTransferFeeConfigDeleted, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParseTokenTransferFeeConfigDeleted") + } + + var r0 *evm_2_evm_onramp.EVM2EVMOnRampTokenTransferFeeConfigDeleted + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (*evm_2_evm_onramp.EVM2EVMOnRampTokenTransferFeeConfigDeleted, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) *evm_2_evm_onramp.EVM2EVMOnRampTokenTransferFeeConfigDeleted); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*evm_2_evm_onramp.EVM2EVMOnRampTokenTransferFeeConfigDeleted) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOnRampInterface_ParseTokenTransferFeeConfigDeleted_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseTokenTransferFeeConfigDeleted' +type EVM2EVMOnRampInterface_ParseTokenTransferFeeConfigDeleted_Call struct { + *mock.Call +} + +// ParseTokenTransferFeeConfigDeleted is a helper method to define mock.On call +// - log types.Log +func (_e *EVM2EVMOnRampInterface_Expecter) ParseTokenTransferFeeConfigDeleted(log interface{}) *EVM2EVMOnRampInterface_ParseTokenTransferFeeConfigDeleted_Call { + return &EVM2EVMOnRampInterface_ParseTokenTransferFeeConfigDeleted_Call{Call: _e.mock.On("ParseTokenTransferFeeConfigDeleted", log)} +} + +func (_c *EVM2EVMOnRampInterface_ParseTokenTransferFeeConfigDeleted_Call) Run(run func(log types.Log)) *EVM2EVMOnRampInterface_ParseTokenTransferFeeConfigDeleted_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *EVM2EVMOnRampInterface_ParseTokenTransferFeeConfigDeleted_Call) Return(_a0 *evm_2_evm_onramp.EVM2EVMOnRampTokenTransferFeeConfigDeleted, _a1 error) *EVM2EVMOnRampInterface_ParseTokenTransferFeeConfigDeleted_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOnRampInterface_ParseTokenTransferFeeConfigDeleted_Call) RunAndReturn(run func(types.Log) (*evm_2_evm_onramp.EVM2EVMOnRampTokenTransferFeeConfigDeleted, error)) *EVM2EVMOnRampInterface_ParseTokenTransferFeeConfigDeleted_Call { + _c.Call.Return(run) + return _c +} + +// ParseTokenTransferFeeConfigSet provides a mock function with given fields: log +func (_m *EVM2EVMOnRampInterface) ParseTokenTransferFeeConfigSet(log types.Log) (*evm_2_evm_onramp.EVM2EVMOnRampTokenTransferFeeConfigSet, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParseTokenTransferFeeConfigSet") + } + + var r0 *evm_2_evm_onramp.EVM2EVMOnRampTokenTransferFeeConfigSet + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (*evm_2_evm_onramp.EVM2EVMOnRampTokenTransferFeeConfigSet, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) *evm_2_evm_onramp.EVM2EVMOnRampTokenTransferFeeConfigSet); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*evm_2_evm_onramp.EVM2EVMOnRampTokenTransferFeeConfigSet) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOnRampInterface_ParseTokenTransferFeeConfigSet_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseTokenTransferFeeConfigSet' +type EVM2EVMOnRampInterface_ParseTokenTransferFeeConfigSet_Call struct { + *mock.Call +} + +// ParseTokenTransferFeeConfigSet is a helper method to define mock.On call +// - log types.Log +func (_e *EVM2EVMOnRampInterface_Expecter) ParseTokenTransferFeeConfigSet(log interface{}) *EVM2EVMOnRampInterface_ParseTokenTransferFeeConfigSet_Call { + return &EVM2EVMOnRampInterface_ParseTokenTransferFeeConfigSet_Call{Call: _e.mock.On("ParseTokenTransferFeeConfigSet", log)} +} + +func (_c *EVM2EVMOnRampInterface_ParseTokenTransferFeeConfigSet_Call) Run(run func(log types.Log)) *EVM2EVMOnRampInterface_ParseTokenTransferFeeConfigSet_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *EVM2EVMOnRampInterface_ParseTokenTransferFeeConfigSet_Call) Return(_a0 *evm_2_evm_onramp.EVM2EVMOnRampTokenTransferFeeConfigSet, _a1 error) *EVM2EVMOnRampInterface_ParseTokenTransferFeeConfigSet_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOnRampInterface_ParseTokenTransferFeeConfigSet_Call) RunAndReturn(run func(types.Log) (*evm_2_evm_onramp.EVM2EVMOnRampTokenTransferFeeConfigSet, error)) *EVM2EVMOnRampInterface_ParseTokenTransferFeeConfigSet_Call { + _c.Call.Return(run) + return _c +} + +// ParseTokensConsumed provides a mock function with given fields: log +func (_m *EVM2EVMOnRampInterface) ParseTokensConsumed(log types.Log) (*evm_2_evm_onramp.EVM2EVMOnRampTokensConsumed, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParseTokensConsumed") + } + + var r0 *evm_2_evm_onramp.EVM2EVMOnRampTokensConsumed + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (*evm_2_evm_onramp.EVM2EVMOnRampTokensConsumed, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) *evm_2_evm_onramp.EVM2EVMOnRampTokensConsumed); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*evm_2_evm_onramp.EVM2EVMOnRampTokensConsumed) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOnRampInterface_ParseTokensConsumed_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseTokensConsumed' +type EVM2EVMOnRampInterface_ParseTokensConsumed_Call struct { + *mock.Call +} + +// ParseTokensConsumed is a helper method to define mock.On call +// - log types.Log +func (_e *EVM2EVMOnRampInterface_Expecter) ParseTokensConsumed(log interface{}) *EVM2EVMOnRampInterface_ParseTokensConsumed_Call { + return &EVM2EVMOnRampInterface_ParseTokensConsumed_Call{Call: _e.mock.On("ParseTokensConsumed", log)} +} + +func (_c *EVM2EVMOnRampInterface_ParseTokensConsumed_Call) Run(run func(log types.Log)) *EVM2EVMOnRampInterface_ParseTokensConsumed_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *EVM2EVMOnRampInterface_ParseTokensConsumed_Call) Return(_a0 *evm_2_evm_onramp.EVM2EVMOnRampTokensConsumed, _a1 error) *EVM2EVMOnRampInterface_ParseTokensConsumed_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOnRampInterface_ParseTokensConsumed_Call) RunAndReturn(run func(types.Log) (*evm_2_evm_onramp.EVM2EVMOnRampTokensConsumed, error)) *EVM2EVMOnRampInterface_ParseTokensConsumed_Call { + _c.Call.Return(run) + return _c +} + +// PayNops provides a mock function with given fields: opts +func (_m *EVM2EVMOnRampInterface) PayNops(opts *bind.TransactOpts) (*types.Transaction, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for PayNops") + } + + var r0 *types.Transaction + var r1 error + if rf, ok := ret.Get(0).(func(*bind.TransactOpts) (*types.Transaction, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.TransactOpts) *types.Transaction); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Transaction) + } + } + + if rf, ok := ret.Get(1).(func(*bind.TransactOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOnRampInterface_PayNops_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PayNops' +type EVM2EVMOnRampInterface_PayNops_Call struct { + *mock.Call +} + +// PayNops is a helper method to define mock.On call +// - opts *bind.TransactOpts +func (_e *EVM2EVMOnRampInterface_Expecter) PayNops(opts interface{}) *EVM2EVMOnRampInterface_PayNops_Call { + return &EVM2EVMOnRampInterface_PayNops_Call{Call: _e.mock.On("PayNops", opts)} +} + +func (_c *EVM2EVMOnRampInterface_PayNops_Call) Run(run func(opts *bind.TransactOpts)) *EVM2EVMOnRampInterface_PayNops_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts)) + }) + return _c +} + +func (_c *EVM2EVMOnRampInterface_PayNops_Call) Return(_a0 *types.Transaction, _a1 error) *EVM2EVMOnRampInterface_PayNops_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOnRampInterface_PayNops_Call) RunAndReturn(run func(*bind.TransactOpts) (*types.Transaction, error)) *EVM2EVMOnRampInterface_PayNops_Call { + _c.Call.Return(run) + return _c +} + +// SetAdmin provides a mock function with given fields: opts, newAdmin +func (_m *EVM2EVMOnRampInterface) SetAdmin(opts *bind.TransactOpts, newAdmin common.Address) (*types.Transaction, error) { + ret := _m.Called(opts, newAdmin) + + if len(ret) == 0 { + panic("no return value specified for SetAdmin") + } + + var r0 *types.Transaction + var r1 error + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, common.Address) (*types.Transaction, error)); ok { + return rf(opts, newAdmin) + } + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, common.Address) *types.Transaction); ok { + r0 = rf(opts, newAdmin) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Transaction) + } + } + + if rf, ok := ret.Get(1).(func(*bind.TransactOpts, common.Address) error); ok { + r1 = rf(opts, newAdmin) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOnRampInterface_SetAdmin_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetAdmin' +type EVM2EVMOnRampInterface_SetAdmin_Call struct { + *mock.Call +} + +// SetAdmin is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - newAdmin common.Address +func (_e *EVM2EVMOnRampInterface_Expecter) SetAdmin(opts interface{}, newAdmin interface{}) *EVM2EVMOnRampInterface_SetAdmin_Call { + return &EVM2EVMOnRampInterface_SetAdmin_Call{Call: _e.mock.On("SetAdmin", opts, newAdmin)} +} + +func (_c *EVM2EVMOnRampInterface_SetAdmin_Call) Run(run func(opts *bind.TransactOpts, newAdmin common.Address)) *EVM2EVMOnRampInterface_SetAdmin_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].(common.Address)) + }) + return _c +} + +func (_c *EVM2EVMOnRampInterface_SetAdmin_Call) Return(_a0 *types.Transaction, _a1 error) *EVM2EVMOnRampInterface_SetAdmin_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOnRampInterface_SetAdmin_Call) RunAndReturn(run func(*bind.TransactOpts, common.Address) (*types.Transaction, error)) *EVM2EVMOnRampInterface_SetAdmin_Call { + _c.Call.Return(run) + return _c +} + +// SetDynamicConfig provides a mock function with given fields: opts, dynamicConfig +func (_m *EVM2EVMOnRampInterface) SetDynamicConfig(opts *bind.TransactOpts, dynamicConfig evm_2_evm_onramp.EVM2EVMOnRampDynamicConfig) (*types.Transaction, error) { + ret := _m.Called(opts, dynamicConfig) + + if len(ret) == 0 { + panic("no return value specified for SetDynamicConfig") + } + + var r0 *types.Transaction + var r1 error + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, evm_2_evm_onramp.EVM2EVMOnRampDynamicConfig) (*types.Transaction, error)); ok { + return rf(opts, dynamicConfig) + } + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, evm_2_evm_onramp.EVM2EVMOnRampDynamicConfig) *types.Transaction); ok { + r0 = rf(opts, dynamicConfig) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Transaction) + } + } + + if rf, ok := ret.Get(1).(func(*bind.TransactOpts, evm_2_evm_onramp.EVM2EVMOnRampDynamicConfig) error); ok { + r1 = rf(opts, dynamicConfig) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOnRampInterface_SetDynamicConfig_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetDynamicConfig' +type EVM2EVMOnRampInterface_SetDynamicConfig_Call struct { + *mock.Call +} + +// SetDynamicConfig is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - dynamicConfig evm_2_evm_onramp.EVM2EVMOnRampDynamicConfig +func (_e *EVM2EVMOnRampInterface_Expecter) SetDynamicConfig(opts interface{}, dynamicConfig interface{}) *EVM2EVMOnRampInterface_SetDynamicConfig_Call { + return &EVM2EVMOnRampInterface_SetDynamicConfig_Call{Call: _e.mock.On("SetDynamicConfig", opts, dynamicConfig)} +} + +func (_c *EVM2EVMOnRampInterface_SetDynamicConfig_Call) Run(run func(opts *bind.TransactOpts, dynamicConfig evm_2_evm_onramp.EVM2EVMOnRampDynamicConfig)) *EVM2EVMOnRampInterface_SetDynamicConfig_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].(evm_2_evm_onramp.EVM2EVMOnRampDynamicConfig)) + }) + return _c +} + +func (_c *EVM2EVMOnRampInterface_SetDynamicConfig_Call) Return(_a0 *types.Transaction, _a1 error) *EVM2EVMOnRampInterface_SetDynamicConfig_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOnRampInterface_SetDynamicConfig_Call) RunAndReturn(run func(*bind.TransactOpts, evm_2_evm_onramp.EVM2EVMOnRampDynamicConfig) (*types.Transaction, error)) *EVM2EVMOnRampInterface_SetDynamicConfig_Call { + _c.Call.Return(run) + return _c +} + +// SetFeeTokenConfig provides a mock function with given fields: opts, feeTokenConfigArgs +func (_m *EVM2EVMOnRampInterface) SetFeeTokenConfig(opts *bind.TransactOpts, feeTokenConfigArgs []evm_2_evm_onramp.EVM2EVMOnRampFeeTokenConfigArgs) (*types.Transaction, error) { + ret := _m.Called(opts, feeTokenConfigArgs) + + if len(ret) == 0 { + panic("no return value specified for SetFeeTokenConfig") + } + + var r0 *types.Transaction + var r1 error + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, []evm_2_evm_onramp.EVM2EVMOnRampFeeTokenConfigArgs) (*types.Transaction, error)); ok { + return rf(opts, feeTokenConfigArgs) + } + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, []evm_2_evm_onramp.EVM2EVMOnRampFeeTokenConfigArgs) *types.Transaction); ok { + r0 = rf(opts, feeTokenConfigArgs) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Transaction) + } + } + + if rf, ok := ret.Get(1).(func(*bind.TransactOpts, []evm_2_evm_onramp.EVM2EVMOnRampFeeTokenConfigArgs) error); ok { + r1 = rf(opts, feeTokenConfigArgs) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOnRampInterface_SetFeeTokenConfig_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetFeeTokenConfig' +type EVM2EVMOnRampInterface_SetFeeTokenConfig_Call struct { + *mock.Call +} + +// SetFeeTokenConfig is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - feeTokenConfigArgs []evm_2_evm_onramp.EVM2EVMOnRampFeeTokenConfigArgs +func (_e *EVM2EVMOnRampInterface_Expecter) SetFeeTokenConfig(opts interface{}, feeTokenConfigArgs interface{}) *EVM2EVMOnRampInterface_SetFeeTokenConfig_Call { + return &EVM2EVMOnRampInterface_SetFeeTokenConfig_Call{Call: _e.mock.On("SetFeeTokenConfig", opts, feeTokenConfigArgs)} +} + +func (_c *EVM2EVMOnRampInterface_SetFeeTokenConfig_Call) Run(run func(opts *bind.TransactOpts, feeTokenConfigArgs []evm_2_evm_onramp.EVM2EVMOnRampFeeTokenConfigArgs)) *EVM2EVMOnRampInterface_SetFeeTokenConfig_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].([]evm_2_evm_onramp.EVM2EVMOnRampFeeTokenConfigArgs)) + }) + return _c +} + +func (_c *EVM2EVMOnRampInterface_SetFeeTokenConfig_Call) Return(_a0 *types.Transaction, _a1 error) *EVM2EVMOnRampInterface_SetFeeTokenConfig_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOnRampInterface_SetFeeTokenConfig_Call) RunAndReturn(run func(*bind.TransactOpts, []evm_2_evm_onramp.EVM2EVMOnRampFeeTokenConfigArgs) (*types.Transaction, error)) *EVM2EVMOnRampInterface_SetFeeTokenConfig_Call { + _c.Call.Return(run) + return _c +} + +// SetNops provides a mock function with given fields: opts, nopsAndWeights +func (_m *EVM2EVMOnRampInterface) SetNops(opts *bind.TransactOpts, nopsAndWeights []evm_2_evm_onramp.EVM2EVMOnRampNopAndWeight) (*types.Transaction, error) { + ret := _m.Called(opts, nopsAndWeights) + + if len(ret) == 0 { + panic("no return value specified for SetNops") + } + + var r0 *types.Transaction + var r1 error + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, []evm_2_evm_onramp.EVM2EVMOnRampNopAndWeight) (*types.Transaction, error)); ok { + return rf(opts, nopsAndWeights) + } + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, []evm_2_evm_onramp.EVM2EVMOnRampNopAndWeight) *types.Transaction); ok { + r0 = rf(opts, nopsAndWeights) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Transaction) + } + } + + if rf, ok := ret.Get(1).(func(*bind.TransactOpts, []evm_2_evm_onramp.EVM2EVMOnRampNopAndWeight) error); ok { + r1 = rf(opts, nopsAndWeights) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOnRampInterface_SetNops_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetNops' +type EVM2EVMOnRampInterface_SetNops_Call struct { + *mock.Call +} + +// SetNops is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - nopsAndWeights []evm_2_evm_onramp.EVM2EVMOnRampNopAndWeight +func (_e *EVM2EVMOnRampInterface_Expecter) SetNops(opts interface{}, nopsAndWeights interface{}) *EVM2EVMOnRampInterface_SetNops_Call { + return &EVM2EVMOnRampInterface_SetNops_Call{Call: _e.mock.On("SetNops", opts, nopsAndWeights)} +} + +func (_c *EVM2EVMOnRampInterface_SetNops_Call) Run(run func(opts *bind.TransactOpts, nopsAndWeights []evm_2_evm_onramp.EVM2EVMOnRampNopAndWeight)) *EVM2EVMOnRampInterface_SetNops_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].([]evm_2_evm_onramp.EVM2EVMOnRampNopAndWeight)) + }) + return _c +} + +func (_c *EVM2EVMOnRampInterface_SetNops_Call) Return(_a0 *types.Transaction, _a1 error) *EVM2EVMOnRampInterface_SetNops_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOnRampInterface_SetNops_Call) RunAndReturn(run func(*bind.TransactOpts, []evm_2_evm_onramp.EVM2EVMOnRampNopAndWeight) (*types.Transaction, error)) *EVM2EVMOnRampInterface_SetNops_Call { + _c.Call.Return(run) + return _c +} + +// SetRateLimiterConfig provides a mock function with given fields: opts, config +func (_m *EVM2EVMOnRampInterface) SetRateLimiterConfig(opts *bind.TransactOpts, config evm_2_evm_onramp.RateLimiterConfig) (*types.Transaction, error) { + ret := _m.Called(opts, config) + + if len(ret) == 0 { + panic("no return value specified for SetRateLimiterConfig") + } + + var r0 *types.Transaction + var r1 error + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, evm_2_evm_onramp.RateLimiterConfig) (*types.Transaction, error)); ok { + return rf(opts, config) + } + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, evm_2_evm_onramp.RateLimiterConfig) *types.Transaction); ok { + r0 = rf(opts, config) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Transaction) + } + } + + if rf, ok := ret.Get(1).(func(*bind.TransactOpts, evm_2_evm_onramp.RateLimiterConfig) error); ok { + r1 = rf(opts, config) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOnRampInterface_SetRateLimiterConfig_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetRateLimiterConfig' +type EVM2EVMOnRampInterface_SetRateLimiterConfig_Call struct { + *mock.Call +} + +// SetRateLimiterConfig is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - config evm_2_evm_onramp.RateLimiterConfig +func (_e *EVM2EVMOnRampInterface_Expecter) SetRateLimiterConfig(opts interface{}, config interface{}) *EVM2EVMOnRampInterface_SetRateLimiterConfig_Call { + return &EVM2EVMOnRampInterface_SetRateLimiterConfig_Call{Call: _e.mock.On("SetRateLimiterConfig", opts, config)} +} + +func (_c *EVM2EVMOnRampInterface_SetRateLimiterConfig_Call) Run(run func(opts *bind.TransactOpts, config evm_2_evm_onramp.RateLimiterConfig)) *EVM2EVMOnRampInterface_SetRateLimiterConfig_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].(evm_2_evm_onramp.RateLimiterConfig)) + }) + return _c +} + +func (_c *EVM2EVMOnRampInterface_SetRateLimiterConfig_Call) Return(_a0 *types.Transaction, _a1 error) *EVM2EVMOnRampInterface_SetRateLimiterConfig_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOnRampInterface_SetRateLimiterConfig_Call) RunAndReturn(run func(*bind.TransactOpts, evm_2_evm_onramp.RateLimiterConfig) (*types.Transaction, error)) *EVM2EVMOnRampInterface_SetRateLimiterConfig_Call { + _c.Call.Return(run) + return _c +} + +// SetTokenTransferFeeConfig provides a mock function with given fields: opts, tokenTransferFeeConfigArgs, tokensToUseDefaultFeeConfigs +func (_m *EVM2EVMOnRampInterface) SetTokenTransferFeeConfig(opts *bind.TransactOpts, tokenTransferFeeConfigArgs []evm_2_evm_onramp.EVM2EVMOnRampTokenTransferFeeConfigArgs, tokensToUseDefaultFeeConfigs []common.Address) (*types.Transaction, error) { + ret := _m.Called(opts, tokenTransferFeeConfigArgs, tokensToUseDefaultFeeConfigs) + + if len(ret) == 0 { + panic("no return value specified for SetTokenTransferFeeConfig") + } + + var r0 *types.Transaction + var r1 error + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, []evm_2_evm_onramp.EVM2EVMOnRampTokenTransferFeeConfigArgs, []common.Address) (*types.Transaction, error)); ok { + return rf(opts, tokenTransferFeeConfigArgs, tokensToUseDefaultFeeConfigs) + } + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, []evm_2_evm_onramp.EVM2EVMOnRampTokenTransferFeeConfigArgs, []common.Address) *types.Transaction); ok { + r0 = rf(opts, tokenTransferFeeConfigArgs, tokensToUseDefaultFeeConfigs) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Transaction) + } + } + + if rf, ok := ret.Get(1).(func(*bind.TransactOpts, []evm_2_evm_onramp.EVM2EVMOnRampTokenTransferFeeConfigArgs, []common.Address) error); ok { + r1 = rf(opts, tokenTransferFeeConfigArgs, tokensToUseDefaultFeeConfigs) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOnRampInterface_SetTokenTransferFeeConfig_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetTokenTransferFeeConfig' +type EVM2EVMOnRampInterface_SetTokenTransferFeeConfig_Call struct { + *mock.Call +} + +// SetTokenTransferFeeConfig is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - tokenTransferFeeConfigArgs []evm_2_evm_onramp.EVM2EVMOnRampTokenTransferFeeConfigArgs +// - tokensToUseDefaultFeeConfigs []common.Address +func (_e *EVM2EVMOnRampInterface_Expecter) SetTokenTransferFeeConfig(opts interface{}, tokenTransferFeeConfigArgs interface{}, tokensToUseDefaultFeeConfigs interface{}) *EVM2EVMOnRampInterface_SetTokenTransferFeeConfig_Call { + return &EVM2EVMOnRampInterface_SetTokenTransferFeeConfig_Call{Call: _e.mock.On("SetTokenTransferFeeConfig", opts, tokenTransferFeeConfigArgs, tokensToUseDefaultFeeConfigs)} +} + +func (_c *EVM2EVMOnRampInterface_SetTokenTransferFeeConfig_Call) Run(run func(opts *bind.TransactOpts, tokenTransferFeeConfigArgs []evm_2_evm_onramp.EVM2EVMOnRampTokenTransferFeeConfigArgs, tokensToUseDefaultFeeConfigs []common.Address)) *EVM2EVMOnRampInterface_SetTokenTransferFeeConfig_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].([]evm_2_evm_onramp.EVM2EVMOnRampTokenTransferFeeConfigArgs), args[2].([]common.Address)) + }) + return _c +} + +func (_c *EVM2EVMOnRampInterface_SetTokenTransferFeeConfig_Call) Return(_a0 *types.Transaction, _a1 error) *EVM2EVMOnRampInterface_SetTokenTransferFeeConfig_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOnRampInterface_SetTokenTransferFeeConfig_Call) RunAndReturn(run func(*bind.TransactOpts, []evm_2_evm_onramp.EVM2EVMOnRampTokenTransferFeeConfigArgs, []common.Address) (*types.Transaction, error)) *EVM2EVMOnRampInterface_SetTokenTransferFeeConfig_Call { + _c.Call.Return(run) + return _c +} + +// TransferOwnership provides a mock function with given fields: opts, to +func (_m *EVM2EVMOnRampInterface) TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) { + ret := _m.Called(opts, to) + + if len(ret) == 0 { + panic("no return value specified for TransferOwnership") + } + + var r0 *types.Transaction + var r1 error + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, common.Address) (*types.Transaction, error)); ok { + return rf(opts, to) + } + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, common.Address) *types.Transaction); ok { + r0 = rf(opts, to) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Transaction) + } + } + + if rf, ok := ret.Get(1).(func(*bind.TransactOpts, common.Address) error); ok { + r1 = rf(opts, to) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOnRampInterface_TransferOwnership_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TransferOwnership' +type EVM2EVMOnRampInterface_TransferOwnership_Call struct { + *mock.Call +} + +// TransferOwnership is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - to common.Address +func (_e *EVM2EVMOnRampInterface_Expecter) TransferOwnership(opts interface{}, to interface{}) *EVM2EVMOnRampInterface_TransferOwnership_Call { + return &EVM2EVMOnRampInterface_TransferOwnership_Call{Call: _e.mock.On("TransferOwnership", opts, to)} +} + +func (_c *EVM2EVMOnRampInterface_TransferOwnership_Call) Run(run func(opts *bind.TransactOpts, to common.Address)) *EVM2EVMOnRampInterface_TransferOwnership_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].(common.Address)) + }) + return _c +} + +func (_c *EVM2EVMOnRampInterface_TransferOwnership_Call) Return(_a0 *types.Transaction, _a1 error) *EVM2EVMOnRampInterface_TransferOwnership_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOnRampInterface_TransferOwnership_Call) RunAndReturn(run func(*bind.TransactOpts, common.Address) (*types.Transaction, error)) *EVM2EVMOnRampInterface_TransferOwnership_Call { + _c.Call.Return(run) + return _c +} + +// TypeAndVersion provides a mock function with given fields: opts +func (_m *EVM2EVMOnRampInterface) TypeAndVersion(opts *bind.CallOpts) (string, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for TypeAndVersion") + } + + var r0 string + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts) (string, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts) string); ok { + r0 = rf(opts) + } else { + r0 = ret.Get(0).(string) + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOnRampInterface_TypeAndVersion_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TypeAndVersion' +type EVM2EVMOnRampInterface_TypeAndVersion_Call struct { + *mock.Call +} + +// TypeAndVersion is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *EVM2EVMOnRampInterface_Expecter) TypeAndVersion(opts interface{}) *EVM2EVMOnRampInterface_TypeAndVersion_Call { + return &EVM2EVMOnRampInterface_TypeAndVersion_Call{Call: _e.mock.On("TypeAndVersion", opts)} +} + +func (_c *EVM2EVMOnRampInterface_TypeAndVersion_Call) Run(run func(opts *bind.CallOpts)) *EVM2EVMOnRampInterface_TypeAndVersion_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *EVM2EVMOnRampInterface_TypeAndVersion_Call) Return(_a0 string, _a1 error) *EVM2EVMOnRampInterface_TypeAndVersion_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOnRampInterface_TypeAndVersion_Call) RunAndReturn(run func(*bind.CallOpts) (string, error)) *EVM2EVMOnRampInterface_TypeAndVersion_Call { + _c.Call.Return(run) + return _c +} + +// WatchAdminSet provides a mock function with given fields: opts, sink +func (_m *EVM2EVMOnRampInterface) WatchAdminSet(opts *bind.WatchOpts, sink chan<- *evm_2_evm_onramp.EVM2EVMOnRampAdminSet) (event.Subscription, error) { + ret := _m.Called(opts, sink) + + if len(ret) == 0 { + panic("no return value specified for WatchAdminSet") + } + + var r0 event.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *evm_2_evm_onramp.EVM2EVMOnRampAdminSet) (event.Subscription, error)); ok { + return rf(opts, sink) + } + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *evm_2_evm_onramp.EVM2EVMOnRampAdminSet) event.Subscription); ok { + r0 = rf(opts, sink) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(event.Subscription) + } + } + + if rf, ok := ret.Get(1).(func(*bind.WatchOpts, chan<- *evm_2_evm_onramp.EVM2EVMOnRampAdminSet) error); ok { + r1 = rf(opts, sink) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOnRampInterface_WatchAdminSet_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchAdminSet' +type EVM2EVMOnRampInterface_WatchAdminSet_Call struct { + *mock.Call +} + +// WatchAdminSet is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *evm_2_evm_onramp.EVM2EVMOnRampAdminSet +func (_e *EVM2EVMOnRampInterface_Expecter) WatchAdminSet(opts interface{}, sink interface{}) *EVM2EVMOnRampInterface_WatchAdminSet_Call { + return &EVM2EVMOnRampInterface_WatchAdminSet_Call{Call: _e.mock.On("WatchAdminSet", opts, sink)} +} + +func (_c *EVM2EVMOnRampInterface_WatchAdminSet_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *evm_2_evm_onramp.EVM2EVMOnRampAdminSet)) *EVM2EVMOnRampInterface_WatchAdminSet_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *evm_2_evm_onramp.EVM2EVMOnRampAdminSet)) + }) + return _c +} + +func (_c *EVM2EVMOnRampInterface_WatchAdminSet_Call) Return(_a0 event.Subscription, _a1 error) *EVM2EVMOnRampInterface_WatchAdminSet_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOnRampInterface_WatchAdminSet_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *evm_2_evm_onramp.EVM2EVMOnRampAdminSet) (event.Subscription, error)) *EVM2EVMOnRampInterface_WatchAdminSet_Call { + _c.Call.Return(run) + return _c +} + +// WatchCCIPSendRequested provides a mock function with given fields: opts, sink +func (_m *EVM2EVMOnRampInterface) WatchCCIPSendRequested(opts *bind.WatchOpts, sink chan<- *evm_2_evm_onramp.EVM2EVMOnRampCCIPSendRequested) (event.Subscription, error) { + ret := _m.Called(opts, sink) + + if len(ret) == 0 { + panic("no return value specified for WatchCCIPSendRequested") + } + + var r0 event.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *evm_2_evm_onramp.EVM2EVMOnRampCCIPSendRequested) (event.Subscription, error)); ok { + return rf(opts, sink) + } + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *evm_2_evm_onramp.EVM2EVMOnRampCCIPSendRequested) event.Subscription); ok { + r0 = rf(opts, sink) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(event.Subscription) + } + } + + if rf, ok := ret.Get(1).(func(*bind.WatchOpts, chan<- *evm_2_evm_onramp.EVM2EVMOnRampCCIPSendRequested) error); ok { + r1 = rf(opts, sink) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOnRampInterface_WatchCCIPSendRequested_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchCCIPSendRequested' +type EVM2EVMOnRampInterface_WatchCCIPSendRequested_Call struct { + *mock.Call +} + +// WatchCCIPSendRequested is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *evm_2_evm_onramp.EVM2EVMOnRampCCIPSendRequested +func (_e *EVM2EVMOnRampInterface_Expecter) WatchCCIPSendRequested(opts interface{}, sink interface{}) *EVM2EVMOnRampInterface_WatchCCIPSendRequested_Call { + return &EVM2EVMOnRampInterface_WatchCCIPSendRequested_Call{Call: _e.mock.On("WatchCCIPSendRequested", opts, sink)} +} + +func (_c *EVM2EVMOnRampInterface_WatchCCIPSendRequested_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *evm_2_evm_onramp.EVM2EVMOnRampCCIPSendRequested)) *EVM2EVMOnRampInterface_WatchCCIPSendRequested_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *evm_2_evm_onramp.EVM2EVMOnRampCCIPSendRequested)) + }) + return _c +} + +func (_c *EVM2EVMOnRampInterface_WatchCCIPSendRequested_Call) Return(_a0 event.Subscription, _a1 error) *EVM2EVMOnRampInterface_WatchCCIPSendRequested_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOnRampInterface_WatchCCIPSendRequested_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *evm_2_evm_onramp.EVM2EVMOnRampCCIPSendRequested) (event.Subscription, error)) *EVM2EVMOnRampInterface_WatchCCIPSendRequested_Call { + _c.Call.Return(run) + return _c +} + +// WatchConfigChanged provides a mock function with given fields: opts, sink +func (_m *EVM2EVMOnRampInterface) WatchConfigChanged(opts *bind.WatchOpts, sink chan<- *evm_2_evm_onramp.EVM2EVMOnRampConfigChanged) (event.Subscription, error) { + ret := _m.Called(opts, sink) + + if len(ret) == 0 { + panic("no return value specified for WatchConfigChanged") + } + + var r0 event.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *evm_2_evm_onramp.EVM2EVMOnRampConfigChanged) (event.Subscription, error)); ok { + return rf(opts, sink) + } + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *evm_2_evm_onramp.EVM2EVMOnRampConfigChanged) event.Subscription); ok { + r0 = rf(opts, sink) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(event.Subscription) + } + } + + if rf, ok := ret.Get(1).(func(*bind.WatchOpts, chan<- *evm_2_evm_onramp.EVM2EVMOnRampConfigChanged) error); ok { + r1 = rf(opts, sink) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOnRampInterface_WatchConfigChanged_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchConfigChanged' +type EVM2EVMOnRampInterface_WatchConfigChanged_Call struct { + *mock.Call +} + +// WatchConfigChanged is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *evm_2_evm_onramp.EVM2EVMOnRampConfigChanged +func (_e *EVM2EVMOnRampInterface_Expecter) WatchConfigChanged(opts interface{}, sink interface{}) *EVM2EVMOnRampInterface_WatchConfigChanged_Call { + return &EVM2EVMOnRampInterface_WatchConfigChanged_Call{Call: _e.mock.On("WatchConfigChanged", opts, sink)} +} + +func (_c *EVM2EVMOnRampInterface_WatchConfigChanged_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *evm_2_evm_onramp.EVM2EVMOnRampConfigChanged)) *EVM2EVMOnRampInterface_WatchConfigChanged_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *evm_2_evm_onramp.EVM2EVMOnRampConfigChanged)) + }) + return _c +} + +func (_c *EVM2EVMOnRampInterface_WatchConfigChanged_Call) Return(_a0 event.Subscription, _a1 error) *EVM2EVMOnRampInterface_WatchConfigChanged_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOnRampInterface_WatchConfigChanged_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *evm_2_evm_onramp.EVM2EVMOnRampConfigChanged) (event.Subscription, error)) *EVM2EVMOnRampInterface_WatchConfigChanged_Call { + _c.Call.Return(run) + return _c +} + +// WatchConfigSet provides a mock function with given fields: opts, sink +func (_m *EVM2EVMOnRampInterface) WatchConfigSet(opts *bind.WatchOpts, sink chan<- *evm_2_evm_onramp.EVM2EVMOnRampConfigSet) (event.Subscription, error) { + ret := _m.Called(opts, sink) + + if len(ret) == 0 { + panic("no return value specified for WatchConfigSet") + } + + var r0 event.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *evm_2_evm_onramp.EVM2EVMOnRampConfigSet) (event.Subscription, error)); ok { + return rf(opts, sink) + } + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *evm_2_evm_onramp.EVM2EVMOnRampConfigSet) event.Subscription); ok { + r0 = rf(opts, sink) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(event.Subscription) + } + } + + if rf, ok := ret.Get(1).(func(*bind.WatchOpts, chan<- *evm_2_evm_onramp.EVM2EVMOnRampConfigSet) error); ok { + r1 = rf(opts, sink) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOnRampInterface_WatchConfigSet_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchConfigSet' +type EVM2EVMOnRampInterface_WatchConfigSet_Call struct { + *mock.Call +} + +// WatchConfigSet is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *evm_2_evm_onramp.EVM2EVMOnRampConfigSet +func (_e *EVM2EVMOnRampInterface_Expecter) WatchConfigSet(opts interface{}, sink interface{}) *EVM2EVMOnRampInterface_WatchConfigSet_Call { + return &EVM2EVMOnRampInterface_WatchConfigSet_Call{Call: _e.mock.On("WatchConfigSet", opts, sink)} +} + +func (_c *EVM2EVMOnRampInterface_WatchConfigSet_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *evm_2_evm_onramp.EVM2EVMOnRampConfigSet)) *EVM2EVMOnRampInterface_WatchConfigSet_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *evm_2_evm_onramp.EVM2EVMOnRampConfigSet)) + }) + return _c +} + +func (_c *EVM2EVMOnRampInterface_WatchConfigSet_Call) Return(_a0 event.Subscription, _a1 error) *EVM2EVMOnRampInterface_WatchConfigSet_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOnRampInterface_WatchConfigSet_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *evm_2_evm_onramp.EVM2EVMOnRampConfigSet) (event.Subscription, error)) *EVM2EVMOnRampInterface_WatchConfigSet_Call { + _c.Call.Return(run) + return _c +} + +// WatchFeeConfigSet provides a mock function with given fields: opts, sink +func (_m *EVM2EVMOnRampInterface) WatchFeeConfigSet(opts *bind.WatchOpts, sink chan<- *evm_2_evm_onramp.EVM2EVMOnRampFeeConfigSet) (event.Subscription, error) { + ret := _m.Called(opts, sink) + + if len(ret) == 0 { + panic("no return value specified for WatchFeeConfigSet") + } + + var r0 event.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *evm_2_evm_onramp.EVM2EVMOnRampFeeConfigSet) (event.Subscription, error)); ok { + return rf(opts, sink) + } + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *evm_2_evm_onramp.EVM2EVMOnRampFeeConfigSet) event.Subscription); ok { + r0 = rf(opts, sink) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(event.Subscription) + } + } + + if rf, ok := ret.Get(1).(func(*bind.WatchOpts, chan<- *evm_2_evm_onramp.EVM2EVMOnRampFeeConfigSet) error); ok { + r1 = rf(opts, sink) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOnRampInterface_WatchFeeConfigSet_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchFeeConfigSet' +type EVM2EVMOnRampInterface_WatchFeeConfigSet_Call struct { + *mock.Call +} + +// WatchFeeConfigSet is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *evm_2_evm_onramp.EVM2EVMOnRampFeeConfigSet +func (_e *EVM2EVMOnRampInterface_Expecter) WatchFeeConfigSet(opts interface{}, sink interface{}) *EVM2EVMOnRampInterface_WatchFeeConfigSet_Call { + return &EVM2EVMOnRampInterface_WatchFeeConfigSet_Call{Call: _e.mock.On("WatchFeeConfigSet", opts, sink)} +} + +func (_c *EVM2EVMOnRampInterface_WatchFeeConfigSet_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *evm_2_evm_onramp.EVM2EVMOnRampFeeConfigSet)) *EVM2EVMOnRampInterface_WatchFeeConfigSet_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *evm_2_evm_onramp.EVM2EVMOnRampFeeConfigSet)) + }) + return _c +} + +func (_c *EVM2EVMOnRampInterface_WatchFeeConfigSet_Call) Return(_a0 event.Subscription, _a1 error) *EVM2EVMOnRampInterface_WatchFeeConfigSet_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOnRampInterface_WatchFeeConfigSet_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *evm_2_evm_onramp.EVM2EVMOnRampFeeConfigSet) (event.Subscription, error)) *EVM2EVMOnRampInterface_WatchFeeConfigSet_Call { + _c.Call.Return(run) + return _c +} + +// WatchNopPaid provides a mock function with given fields: opts, sink, nop +func (_m *EVM2EVMOnRampInterface) WatchNopPaid(opts *bind.WatchOpts, sink chan<- *evm_2_evm_onramp.EVM2EVMOnRampNopPaid, nop []common.Address) (event.Subscription, error) { + ret := _m.Called(opts, sink, nop) + + if len(ret) == 0 { + panic("no return value specified for WatchNopPaid") + } + + var r0 event.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *evm_2_evm_onramp.EVM2EVMOnRampNopPaid, []common.Address) (event.Subscription, error)); ok { + return rf(opts, sink, nop) + } + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *evm_2_evm_onramp.EVM2EVMOnRampNopPaid, []common.Address) event.Subscription); ok { + r0 = rf(opts, sink, nop) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(event.Subscription) + } + } + + if rf, ok := ret.Get(1).(func(*bind.WatchOpts, chan<- *evm_2_evm_onramp.EVM2EVMOnRampNopPaid, []common.Address) error); ok { + r1 = rf(opts, sink, nop) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOnRampInterface_WatchNopPaid_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchNopPaid' +type EVM2EVMOnRampInterface_WatchNopPaid_Call struct { + *mock.Call +} + +// WatchNopPaid is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *evm_2_evm_onramp.EVM2EVMOnRampNopPaid +// - nop []common.Address +func (_e *EVM2EVMOnRampInterface_Expecter) WatchNopPaid(opts interface{}, sink interface{}, nop interface{}) *EVM2EVMOnRampInterface_WatchNopPaid_Call { + return &EVM2EVMOnRampInterface_WatchNopPaid_Call{Call: _e.mock.On("WatchNopPaid", opts, sink, nop)} +} + +func (_c *EVM2EVMOnRampInterface_WatchNopPaid_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *evm_2_evm_onramp.EVM2EVMOnRampNopPaid, nop []common.Address)) *EVM2EVMOnRampInterface_WatchNopPaid_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *evm_2_evm_onramp.EVM2EVMOnRampNopPaid), args[2].([]common.Address)) + }) + return _c +} + +func (_c *EVM2EVMOnRampInterface_WatchNopPaid_Call) Return(_a0 event.Subscription, _a1 error) *EVM2EVMOnRampInterface_WatchNopPaid_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOnRampInterface_WatchNopPaid_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *evm_2_evm_onramp.EVM2EVMOnRampNopPaid, []common.Address) (event.Subscription, error)) *EVM2EVMOnRampInterface_WatchNopPaid_Call { + _c.Call.Return(run) + return _c +} + +// WatchNopsSet provides a mock function with given fields: opts, sink +func (_m *EVM2EVMOnRampInterface) WatchNopsSet(opts *bind.WatchOpts, sink chan<- *evm_2_evm_onramp.EVM2EVMOnRampNopsSet) (event.Subscription, error) { + ret := _m.Called(opts, sink) + + if len(ret) == 0 { + panic("no return value specified for WatchNopsSet") + } + + var r0 event.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *evm_2_evm_onramp.EVM2EVMOnRampNopsSet) (event.Subscription, error)); ok { + return rf(opts, sink) + } + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *evm_2_evm_onramp.EVM2EVMOnRampNopsSet) event.Subscription); ok { + r0 = rf(opts, sink) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(event.Subscription) + } + } + + if rf, ok := ret.Get(1).(func(*bind.WatchOpts, chan<- *evm_2_evm_onramp.EVM2EVMOnRampNopsSet) error); ok { + r1 = rf(opts, sink) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOnRampInterface_WatchNopsSet_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchNopsSet' +type EVM2EVMOnRampInterface_WatchNopsSet_Call struct { + *mock.Call +} + +// WatchNopsSet is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *evm_2_evm_onramp.EVM2EVMOnRampNopsSet +func (_e *EVM2EVMOnRampInterface_Expecter) WatchNopsSet(opts interface{}, sink interface{}) *EVM2EVMOnRampInterface_WatchNopsSet_Call { + return &EVM2EVMOnRampInterface_WatchNopsSet_Call{Call: _e.mock.On("WatchNopsSet", opts, sink)} +} + +func (_c *EVM2EVMOnRampInterface_WatchNopsSet_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *evm_2_evm_onramp.EVM2EVMOnRampNopsSet)) *EVM2EVMOnRampInterface_WatchNopsSet_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *evm_2_evm_onramp.EVM2EVMOnRampNopsSet)) + }) + return _c +} + +func (_c *EVM2EVMOnRampInterface_WatchNopsSet_Call) Return(_a0 event.Subscription, _a1 error) *EVM2EVMOnRampInterface_WatchNopsSet_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOnRampInterface_WatchNopsSet_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *evm_2_evm_onramp.EVM2EVMOnRampNopsSet) (event.Subscription, error)) *EVM2EVMOnRampInterface_WatchNopsSet_Call { + _c.Call.Return(run) + return _c +} + +// WatchOwnershipTransferRequested provides a mock function with given fields: opts, sink, from, to +func (_m *EVM2EVMOnRampInterface) WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *evm_2_evm_onramp.EVM2EVMOnRampOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) { + ret := _m.Called(opts, sink, from, to) + + if len(ret) == 0 { + panic("no return value specified for WatchOwnershipTransferRequested") + } + + var r0 event.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *evm_2_evm_onramp.EVM2EVMOnRampOwnershipTransferRequested, []common.Address, []common.Address) (event.Subscription, error)); ok { + return rf(opts, sink, from, to) + } + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *evm_2_evm_onramp.EVM2EVMOnRampOwnershipTransferRequested, []common.Address, []common.Address) event.Subscription); ok { + r0 = rf(opts, sink, from, to) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(event.Subscription) + } + } + + if rf, ok := ret.Get(1).(func(*bind.WatchOpts, chan<- *evm_2_evm_onramp.EVM2EVMOnRampOwnershipTransferRequested, []common.Address, []common.Address) error); ok { + r1 = rf(opts, sink, from, to) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOnRampInterface_WatchOwnershipTransferRequested_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchOwnershipTransferRequested' +type EVM2EVMOnRampInterface_WatchOwnershipTransferRequested_Call struct { + *mock.Call +} + +// WatchOwnershipTransferRequested is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *evm_2_evm_onramp.EVM2EVMOnRampOwnershipTransferRequested +// - from []common.Address +// - to []common.Address +func (_e *EVM2EVMOnRampInterface_Expecter) WatchOwnershipTransferRequested(opts interface{}, sink interface{}, from interface{}, to interface{}) *EVM2EVMOnRampInterface_WatchOwnershipTransferRequested_Call { + return &EVM2EVMOnRampInterface_WatchOwnershipTransferRequested_Call{Call: _e.mock.On("WatchOwnershipTransferRequested", opts, sink, from, to)} +} + +func (_c *EVM2EVMOnRampInterface_WatchOwnershipTransferRequested_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *evm_2_evm_onramp.EVM2EVMOnRampOwnershipTransferRequested, from []common.Address, to []common.Address)) *EVM2EVMOnRampInterface_WatchOwnershipTransferRequested_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *evm_2_evm_onramp.EVM2EVMOnRampOwnershipTransferRequested), args[2].([]common.Address), args[3].([]common.Address)) + }) + return _c +} + +func (_c *EVM2EVMOnRampInterface_WatchOwnershipTransferRequested_Call) Return(_a0 event.Subscription, _a1 error) *EVM2EVMOnRampInterface_WatchOwnershipTransferRequested_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOnRampInterface_WatchOwnershipTransferRequested_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *evm_2_evm_onramp.EVM2EVMOnRampOwnershipTransferRequested, []common.Address, []common.Address) (event.Subscription, error)) *EVM2EVMOnRampInterface_WatchOwnershipTransferRequested_Call { + _c.Call.Return(run) + return _c +} + +// WatchOwnershipTransferred provides a mock function with given fields: opts, sink, from, to +func (_m *EVM2EVMOnRampInterface) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *evm_2_evm_onramp.EVM2EVMOnRampOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) { + ret := _m.Called(opts, sink, from, to) + + if len(ret) == 0 { + panic("no return value specified for WatchOwnershipTransferred") + } + + var r0 event.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *evm_2_evm_onramp.EVM2EVMOnRampOwnershipTransferred, []common.Address, []common.Address) (event.Subscription, error)); ok { + return rf(opts, sink, from, to) + } + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *evm_2_evm_onramp.EVM2EVMOnRampOwnershipTransferred, []common.Address, []common.Address) event.Subscription); ok { + r0 = rf(opts, sink, from, to) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(event.Subscription) + } + } + + if rf, ok := ret.Get(1).(func(*bind.WatchOpts, chan<- *evm_2_evm_onramp.EVM2EVMOnRampOwnershipTransferred, []common.Address, []common.Address) error); ok { + r1 = rf(opts, sink, from, to) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOnRampInterface_WatchOwnershipTransferred_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchOwnershipTransferred' +type EVM2EVMOnRampInterface_WatchOwnershipTransferred_Call struct { + *mock.Call +} + +// WatchOwnershipTransferred is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *evm_2_evm_onramp.EVM2EVMOnRampOwnershipTransferred +// - from []common.Address +// - to []common.Address +func (_e *EVM2EVMOnRampInterface_Expecter) WatchOwnershipTransferred(opts interface{}, sink interface{}, from interface{}, to interface{}) *EVM2EVMOnRampInterface_WatchOwnershipTransferred_Call { + return &EVM2EVMOnRampInterface_WatchOwnershipTransferred_Call{Call: _e.mock.On("WatchOwnershipTransferred", opts, sink, from, to)} +} + +func (_c *EVM2EVMOnRampInterface_WatchOwnershipTransferred_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *evm_2_evm_onramp.EVM2EVMOnRampOwnershipTransferred, from []common.Address, to []common.Address)) *EVM2EVMOnRampInterface_WatchOwnershipTransferred_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *evm_2_evm_onramp.EVM2EVMOnRampOwnershipTransferred), args[2].([]common.Address), args[3].([]common.Address)) + }) + return _c +} + +func (_c *EVM2EVMOnRampInterface_WatchOwnershipTransferred_Call) Return(_a0 event.Subscription, _a1 error) *EVM2EVMOnRampInterface_WatchOwnershipTransferred_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOnRampInterface_WatchOwnershipTransferred_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *evm_2_evm_onramp.EVM2EVMOnRampOwnershipTransferred, []common.Address, []common.Address) (event.Subscription, error)) *EVM2EVMOnRampInterface_WatchOwnershipTransferred_Call { + _c.Call.Return(run) + return _c +} + +// WatchTokenTransferFeeConfigDeleted provides a mock function with given fields: opts, sink +func (_m *EVM2EVMOnRampInterface) WatchTokenTransferFeeConfigDeleted(opts *bind.WatchOpts, sink chan<- *evm_2_evm_onramp.EVM2EVMOnRampTokenTransferFeeConfigDeleted) (event.Subscription, error) { + ret := _m.Called(opts, sink) + + if len(ret) == 0 { + panic("no return value specified for WatchTokenTransferFeeConfigDeleted") + } + + var r0 event.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *evm_2_evm_onramp.EVM2EVMOnRampTokenTransferFeeConfigDeleted) (event.Subscription, error)); ok { + return rf(opts, sink) + } + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *evm_2_evm_onramp.EVM2EVMOnRampTokenTransferFeeConfigDeleted) event.Subscription); ok { + r0 = rf(opts, sink) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(event.Subscription) + } + } + + if rf, ok := ret.Get(1).(func(*bind.WatchOpts, chan<- *evm_2_evm_onramp.EVM2EVMOnRampTokenTransferFeeConfigDeleted) error); ok { + r1 = rf(opts, sink) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOnRampInterface_WatchTokenTransferFeeConfigDeleted_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchTokenTransferFeeConfigDeleted' +type EVM2EVMOnRampInterface_WatchTokenTransferFeeConfigDeleted_Call struct { + *mock.Call +} + +// WatchTokenTransferFeeConfigDeleted is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *evm_2_evm_onramp.EVM2EVMOnRampTokenTransferFeeConfigDeleted +func (_e *EVM2EVMOnRampInterface_Expecter) WatchTokenTransferFeeConfigDeleted(opts interface{}, sink interface{}) *EVM2EVMOnRampInterface_WatchTokenTransferFeeConfigDeleted_Call { + return &EVM2EVMOnRampInterface_WatchTokenTransferFeeConfigDeleted_Call{Call: _e.mock.On("WatchTokenTransferFeeConfigDeleted", opts, sink)} +} + +func (_c *EVM2EVMOnRampInterface_WatchTokenTransferFeeConfigDeleted_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *evm_2_evm_onramp.EVM2EVMOnRampTokenTransferFeeConfigDeleted)) *EVM2EVMOnRampInterface_WatchTokenTransferFeeConfigDeleted_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *evm_2_evm_onramp.EVM2EVMOnRampTokenTransferFeeConfigDeleted)) + }) + return _c +} + +func (_c *EVM2EVMOnRampInterface_WatchTokenTransferFeeConfigDeleted_Call) Return(_a0 event.Subscription, _a1 error) *EVM2EVMOnRampInterface_WatchTokenTransferFeeConfigDeleted_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOnRampInterface_WatchTokenTransferFeeConfigDeleted_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *evm_2_evm_onramp.EVM2EVMOnRampTokenTransferFeeConfigDeleted) (event.Subscription, error)) *EVM2EVMOnRampInterface_WatchTokenTransferFeeConfigDeleted_Call { + _c.Call.Return(run) + return _c +} + +// WatchTokenTransferFeeConfigSet provides a mock function with given fields: opts, sink +func (_m *EVM2EVMOnRampInterface) WatchTokenTransferFeeConfigSet(opts *bind.WatchOpts, sink chan<- *evm_2_evm_onramp.EVM2EVMOnRampTokenTransferFeeConfigSet) (event.Subscription, error) { + ret := _m.Called(opts, sink) + + if len(ret) == 0 { + panic("no return value specified for WatchTokenTransferFeeConfigSet") + } + + var r0 event.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *evm_2_evm_onramp.EVM2EVMOnRampTokenTransferFeeConfigSet) (event.Subscription, error)); ok { + return rf(opts, sink) + } + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *evm_2_evm_onramp.EVM2EVMOnRampTokenTransferFeeConfigSet) event.Subscription); ok { + r0 = rf(opts, sink) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(event.Subscription) + } + } + + if rf, ok := ret.Get(1).(func(*bind.WatchOpts, chan<- *evm_2_evm_onramp.EVM2EVMOnRampTokenTransferFeeConfigSet) error); ok { + r1 = rf(opts, sink) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOnRampInterface_WatchTokenTransferFeeConfigSet_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchTokenTransferFeeConfigSet' +type EVM2EVMOnRampInterface_WatchTokenTransferFeeConfigSet_Call struct { + *mock.Call +} + +// WatchTokenTransferFeeConfigSet is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *evm_2_evm_onramp.EVM2EVMOnRampTokenTransferFeeConfigSet +func (_e *EVM2EVMOnRampInterface_Expecter) WatchTokenTransferFeeConfigSet(opts interface{}, sink interface{}) *EVM2EVMOnRampInterface_WatchTokenTransferFeeConfigSet_Call { + return &EVM2EVMOnRampInterface_WatchTokenTransferFeeConfigSet_Call{Call: _e.mock.On("WatchTokenTransferFeeConfigSet", opts, sink)} +} + +func (_c *EVM2EVMOnRampInterface_WatchTokenTransferFeeConfigSet_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *evm_2_evm_onramp.EVM2EVMOnRampTokenTransferFeeConfigSet)) *EVM2EVMOnRampInterface_WatchTokenTransferFeeConfigSet_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *evm_2_evm_onramp.EVM2EVMOnRampTokenTransferFeeConfigSet)) + }) + return _c +} + +func (_c *EVM2EVMOnRampInterface_WatchTokenTransferFeeConfigSet_Call) Return(_a0 event.Subscription, _a1 error) *EVM2EVMOnRampInterface_WatchTokenTransferFeeConfigSet_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOnRampInterface_WatchTokenTransferFeeConfigSet_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *evm_2_evm_onramp.EVM2EVMOnRampTokenTransferFeeConfigSet) (event.Subscription, error)) *EVM2EVMOnRampInterface_WatchTokenTransferFeeConfigSet_Call { + _c.Call.Return(run) + return _c +} + +// WatchTokensConsumed provides a mock function with given fields: opts, sink +func (_m *EVM2EVMOnRampInterface) WatchTokensConsumed(opts *bind.WatchOpts, sink chan<- *evm_2_evm_onramp.EVM2EVMOnRampTokensConsumed) (event.Subscription, error) { + ret := _m.Called(opts, sink) + + if len(ret) == 0 { + panic("no return value specified for WatchTokensConsumed") + } + + var r0 event.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *evm_2_evm_onramp.EVM2EVMOnRampTokensConsumed) (event.Subscription, error)); ok { + return rf(opts, sink) + } + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *evm_2_evm_onramp.EVM2EVMOnRampTokensConsumed) event.Subscription); ok { + r0 = rf(opts, sink) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(event.Subscription) + } + } + + if rf, ok := ret.Get(1).(func(*bind.WatchOpts, chan<- *evm_2_evm_onramp.EVM2EVMOnRampTokensConsumed) error); ok { + r1 = rf(opts, sink) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOnRampInterface_WatchTokensConsumed_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchTokensConsumed' +type EVM2EVMOnRampInterface_WatchTokensConsumed_Call struct { + *mock.Call +} + +// WatchTokensConsumed is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *evm_2_evm_onramp.EVM2EVMOnRampTokensConsumed +func (_e *EVM2EVMOnRampInterface_Expecter) WatchTokensConsumed(opts interface{}, sink interface{}) *EVM2EVMOnRampInterface_WatchTokensConsumed_Call { + return &EVM2EVMOnRampInterface_WatchTokensConsumed_Call{Call: _e.mock.On("WatchTokensConsumed", opts, sink)} +} + +func (_c *EVM2EVMOnRampInterface_WatchTokensConsumed_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *evm_2_evm_onramp.EVM2EVMOnRampTokensConsumed)) *EVM2EVMOnRampInterface_WatchTokensConsumed_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *evm_2_evm_onramp.EVM2EVMOnRampTokensConsumed)) + }) + return _c +} + +func (_c *EVM2EVMOnRampInterface_WatchTokensConsumed_Call) Return(_a0 event.Subscription, _a1 error) *EVM2EVMOnRampInterface_WatchTokensConsumed_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOnRampInterface_WatchTokensConsumed_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *evm_2_evm_onramp.EVM2EVMOnRampTokensConsumed) (event.Subscription, error)) *EVM2EVMOnRampInterface_WatchTokensConsumed_Call { + _c.Call.Return(run) + return _c +} + +// WithdrawNonLinkFees provides a mock function with given fields: opts, feeToken, to +func (_m *EVM2EVMOnRampInterface) WithdrawNonLinkFees(opts *bind.TransactOpts, feeToken common.Address, to common.Address) (*types.Transaction, error) { + ret := _m.Called(opts, feeToken, to) + + if len(ret) == 0 { + panic("no return value specified for WithdrawNonLinkFees") + } + + var r0 *types.Transaction + var r1 error + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, common.Address, common.Address) (*types.Transaction, error)); ok { + return rf(opts, feeToken, to) + } + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, common.Address, common.Address) *types.Transaction); ok { + r0 = rf(opts, feeToken, to) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Transaction) + } + } + + if rf, ok := ret.Get(1).(func(*bind.TransactOpts, common.Address, common.Address) error); ok { + r1 = rf(opts, feeToken, to) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOnRampInterface_WithdrawNonLinkFees_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WithdrawNonLinkFees' +type EVM2EVMOnRampInterface_WithdrawNonLinkFees_Call struct { + *mock.Call +} + +// WithdrawNonLinkFees is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - feeToken common.Address +// - to common.Address +func (_e *EVM2EVMOnRampInterface_Expecter) WithdrawNonLinkFees(opts interface{}, feeToken interface{}, to interface{}) *EVM2EVMOnRampInterface_WithdrawNonLinkFees_Call { + return &EVM2EVMOnRampInterface_WithdrawNonLinkFees_Call{Call: _e.mock.On("WithdrawNonLinkFees", opts, feeToken, to)} +} + +func (_c *EVM2EVMOnRampInterface_WithdrawNonLinkFees_Call) Run(run func(opts *bind.TransactOpts, feeToken common.Address, to common.Address)) *EVM2EVMOnRampInterface_WithdrawNonLinkFees_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].(common.Address), args[2].(common.Address)) + }) + return _c +} + +func (_c *EVM2EVMOnRampInterface_WithdrawNonLinkFees_Call) Return(_a0 *types.Transaction, _a1 error) *EVM2EVMOnRampInterface_WithdrawNonLinkFees_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOnRampInterface_WithdrawNonLinkFees_Call) RunAndReturn(run func(*bind.TransactOpts, common.Address, common.Address) (*types.Transaction, error)) *EVM2EVMOnRampInterface_WithdrawNonLinkFees_Call { + _c.Call.Return(run) + return _c +} + +// NewEVM2EVMOnRampInterface creates a new instance of EVM2EVMOnRampInterface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewEVM2EVMOnRampInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *EVM2EVMOnRampInterface { + mock := &EVM2EVMOnRampInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/core/gethwrappers/ccip/mocks/fee_quoter_interface.go b/core/gethwrappers/ccip/mocks/fee_quoter_interface.go new file mode 100644 index 00000000000..27f53c0bd95 --- /dev/null +++ b/core/gethwrappers/ccip/mocks/fee_quoter_interface.go @@ -0,0 +1,4509 @@ +// Code generated by mockery v2.43.2. DO NOT EDIT. + +package mock_contracts + +import ( + big "math/big" + + bind "github.com/ethereum/go-ethereum/accounts/abi/bind" + common "github.com/ethereum/go-ethereum/common" + + event "github.com/ethereum/go-ethereum/event" + + fee_quoter "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/fee_quoter" + + generated "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" + + mock "github.com/stretchr/testify/mock" + + types "github.com/ethereum/go-ethereum/core/types" +) + +// FeeQuoterInterface is an autogenerated mock type for the FeeQuoterInterface type +type FeeQuoterInterface struct { + mock.Mock +} + +type FeeQuoterInterface_Expecter struct { + mock *mock.Mock +} + +func (_m *FeeQuoterInterface) EXPECT() *FeeQuoterInterface_Expecter { + return &FeeQuoterInterface_Expecter{mock: &_m.Mock} +} + +// AcceptOwnership provides a mock function with given fields: opts +func (_m *FeeQuoterInterface) AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for AcceptOwnership") + } + + var r0 *types.Transaction + var r1 error + if rf, ok := ret.Get(0).(func(*bind.TransactOpts) (*types.Transaction, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.TransactOpts) *types.Transaction); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Transaction) + } + } + + if rf, ok := ret.Get(1).(func(*bind.TransactOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// FeeQuoterInterface_AcceptOwnership_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AcceptOwnership' +type FeeQuoterInterface_AcceptOwnership_Call struct { + *mock.Call +} + +// AcceptOwnership is a helper method to define mock.On call +// - opts *bind.TransactOpts +func (_e *FeeQuoterInterface_Expecter) AcceptOwnership(opts interface{}) *FeeQuoterInterface_AcceptOwnership_Call { + return &FeeQuoterInterface_AcceptOwnership_Call{Call: _e.mock.On("AcceptOwnership", opts)} +} + +func (_c *FeeQuoterInterface_AcceptOwnership_Call) Run(run func(opts *bind.TransactOpts)) *FeeQuoterInterface_AcceptOwnership_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts)) + }) + return _c +} + +func (_c *FeeQuoterInterface_AcceptOwnership_Call) Return(_a0 *types.Transaction, _a1 error) *FeeQuoterInterface_AcceptOwnership_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FeeQuoterInterface_AcceptOwnership_Call) RunAndReturn(run func(*bind.TransactOpts) (*types.Transaction, error)) *FeeQuoterInterface_AcceptOwnership_Call { + _c.Call.Return(run) + return _c +} + +// Address provides a mock function with given fields: +func (_m *FeeQuoterInterface) Address() common.Address { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Address") + } + + var r0 common.Address + if rf, ok := ret.Get(0).(func() common.Address); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Address) + } + } + + return r0 +} + +// FeeQuoterInterface_Address_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Address' +type FeeQuoterInterface_Address_Call struct { + *mock.Call +} + +// Address is a helper method to define mock.On call +func (_e *FeeQuoterInterface_Expecter) Address() *FeeQuoterInterface_Address_Call { + return &FeeQuoterInterface_Address_Call{Call: _e.mock.On("Address")} +} + +func (_c *FeeQuoterInterface_Address_Call) Run(run func()) *FeeQuoterInterface_Address_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *FeeQuoterInterface_Address_Call) Return(_a0 common.Address) *FeeQuoterInterface_Address_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *FeeQuoterInterface_Address_Call) RunAndReturn(run func() common.Address) *FeeQuoterInterface_Address_Call { + _c.Call.Return(run) + return _c +} + +// ApplyAuthorizedCallerUpdates provides a mock function with given fields: opts, authorizedCallerArgs +func (_m *FeeQuoterInterface) ApplyAuthorizedCallerUpdates(opts *bind.TransactOpts, authorizedCallerArgs fee_quoter.AuthorizedCallersAuthorizedCallerArgs) (*types.Transaction, error) { + ret := _m.Called(opts, authorizedCallerArgs) + + if len(ret) == 0 { + panic("no return value specified for ApplyAuthorizedCallerUpdates") + } + + var r0 *types.Transaction + var r1 error + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, fee_quoter.AuthorizedCallersAuthorizedCallerArgs) (*types.Transaction, error)); ok { + return rf(opts, authorizedCallerArgs) + } + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, fee_quoter.AuthorizedCallersAuthorizedCallerArgs) *types.Transaction); ok { + r0 = rf(opts, authorizedCallerArgs) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Transaction) + } + } + + if rf, ok := ret.Get(1).(func(*bind.TransactOpts, fee_quoter.AuthorizedCallersAuthorizedCallerArgs) error); ok { + r1 = rf(opts, authorizedCallerArgs) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// FeeQuoterInterface_ApplyAuthorizedCallerUpdates_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ApplyAuthorizedCallerUpdates' +type FeeQuoterInterface_ApplyAuthorizedCallerUpdates_Call struct { + *mock.Call +} + +// ApplyAuthorizedCallerUpdates is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - authorizedCallerArgs fee_quoter.AuthorizedCallersAuthorizedCallerArgs +func (_e *FeeQuoterInterface_Expecter) ApplyAuthorizedCallerUpdates(opts interface{}, authorizedCallerArgs interface{}) *FeeQuoterInterface_ApplyAuthorizedCallerUpdates_Call { + return &FeeQuoterInterface_ApplyAuthorizedCallerUpdates_Call{Call: _e.mock.On("ApplyAuthorizedCallerUpdates", opts, authorizedCallerArgs)} +} + +func (_c *FeeQuoterInterface_ApplyAuthorizedCallerUpdates_Call) Run(run func(opts *bind.TransactOpts, authorizedCallerArgs fee_quoter.AuthorizedCallersAuthorizedCallerArgs)) *FeeQuoterInterface_ApplyAuthorizedCallerUpdates_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].(fee_quoter.AuthorizedCallersAuthorizedCallerArgs)) + }) + return _c +} + +func (_c *FeeQuoterInterface_ApplyAuthorizedCallerUpdates_Call) Return(_a0 *types.Transaction, _a1 error) *FeeQuoterInterface_ApplyAuthorizedCallerUpdates_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FeeQuoterInterface_ApplyAuthorizedCallerUpdates_Call) RunAndReturn(run func(*bind.TransactOpts, fee_quoter.AuthorizedCallersAuthorizedCallerArgs) (*types.Transaction, error)) *FeeQuoterInterface_ApplyAuthorizedCallerUpdates_Call { + _c.Call.Return(run) + return _c +} + +// ApplyDestChainConfigUpdates provides a mock function with given fields: opts, destChainConfigArgs +func (_m *FeeQuoterInterface) ApplyDestChainConfigUpdates(opts *bind.TransactOpts, destChainConfigArgs []fee_quoter.FeeQuoterDestChainConfigArgs) (*types.Transaction, error) { + ret := _m.Called(opts, destChainConfigArgs) + + if len(ret) == 0 { + panic("no return value specified for ApplyDestChainConfigUpdates") + } + + var r0 *types.Transaction + var r1 error + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, []fee_quoter.FeeQuoterDestChainConfigArgs) (*types.Transaction, error)); ok { + return rf(opts, destChainConfigArgs) + } + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, []fee_quoter.FeeQuoterDestChainConfigArgs) *types.Transaction); ok { + r0 = rf(opts, destChainConfigArgs) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Transaction) + } + } + + if rf, ok := ret.Get(1).(func(*bind.TransactOpts, []fee_quoter.FeeQuoterDestChainConfigArgs) error); ok { + r1 = rf(opts, destChainConfigArgs) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// FeeQuoterInterface_ApplyDestChainConfigUpdates_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ApplyDestChainConfigUpdates' +type FeeQuoterInterface_ApplyDestChainConfigUpdates_Call struct { + *mock.Call +} + +// ApplyDestChainConfigUpdates is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - destChainConfigArgs []fee_quoter.FeeQuoterDestChainConfigArgs +func (_e *FeeQuoterInterface_Expecter) ApplyDestChainConfigUpdates(opts interface{}, destChainConfigArgs interface{}) *FeeQuoterInterface_ApplyDestChainConfigUpdates_Call { + return &FeeQuoterInterface_ApplyDestChainConfigUpdates_Call{Call: _e.mock.On("ApplyDestChainConfigUpdates", opts, destChainConfigArgs)} +} + +func (_c *FeeQuoterInterface_ApplyDestChainConfigUpdates_Call) Run(run func(opts *bind.TransactOpts, destChainConfigArgs []fee_quoter.FeeQuoterDestChainConfigArgs)) *FeeQuoterInterface_ApplyDestChainConfigUpdates_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].([]fee_quoter.FeeQuoterDestChainConfigArgs)) + }) + return _c +} + +func (_c *FeeQuoterInterface_ApplyDestChainConfigUpdates_Call) Return(_a0 *types.Transaction, _a1 error) *FeeQuoterInterface_ApplyDestChainConfigUpdates_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FeeQuoterInterface_ApplyDestChainConfigUpdates_Call) RunAndReturn(run func(*bind.TransactOpts, []fee_quoter.FeeQuoterDestChainConfigArgs) (*types.Transaction, error)) *FeeQuoterInterface_ApplyDestChainConfigUpdates_Call { + _c.Call.Return(run) + return _c +} + +// ApplyFeeTokensUpdates provides a mock function with given fields: opts, feeTokensToAdd, feeTokensToRemove +func (_m *FeeQuoterInterface) ApplyFeeTokensUpdates(opts *bind.TransactOpts, feeTokensToAdd []common.Address, feeTokensToRemove []common.Address) (*types.Transaction, error) { + ret := _m.Called(opts, feeTokensToAdd, feeTokensToRemove) + + if len(ret) == 0 { + panic("no return value specified for ApplyFeeTokensUpdates") + } + + var r0 *types.Transaction + var r1 error + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, []common.Address, []common.Address) (*types.Transaction, error)); ok { + return rf(opts, feeTokensToAdd, feeTokensToRemove) + } + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, []common.Address, []common.Address) *types.Transaction); ok { + r0 = rf(opts, feeTokensToAdd, feeTokensToRemove) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Transaction) + } + } + + if rf, ok := ret.Get(1).(func(*bind.TransactOpts, []common.Address, []common.Address) error); ok { + r1 = rf(opts, feeTokensToAdd, feeTokensToRemove) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// FeeQuoterInterface_ApplyFeeTokensUpdates_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ApplyFeeTokensUpdates' +type FeeQuoterInterface_ApplyFeeTokensUpdates_Call struct { + *mock.Call +} + +// ApplyFeeTokensUpdates is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - feeTokensToAdd []common.Address +// - feeTokensToRemove []common.Address +func (_e *FeeQuoterInterface_Expecter) ApplyFeeTokensUpdates(opts interface{}, feeTokensToAdd interface{}, feeTokensToRemove interface{}) *FeeQuoterInterface_ApplyFeeTokensUpdates_Call { + return &FeeQuoterInterface_ApplyFeeTokensUpdates_Call{Call: _e.mock.On("ApplyFeeTokensUpdates", opts, feeTokensToAdd, feeTokensToRemove)} +} + +func (_c *FeeQuoterInterface_ApplyFeeTokensUpdates_Call) Run(run func(opts *bind.TransactOpts, feeTokensToAdd []common.Address, feeTokensToRemove []common.Address)) *FeeQuoterInterface_ApplyFeeTokensUpdates_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].([]common.Address), args[2].([]common.Address)) + }) + return _c +} + +func (_c *FeeQuoterInterface_ApplyFeeTokensUpdates_Call) Return(_a0 *types.Transaction, _a1 error) *FeeQuoterInterface_ApplyFeeTokensUpdates_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FeeQuoterInterface_ApplyFeeTokensUpdates_Call) RunAndReturn(run func(*bind.TransactOpts, []common.Address, []common.Address) (*types.Transaction, error)) *FeeQuoterInterface_ApplyFeeTokensUpdates_Call { + _c.Call.Return(run) + return _c +} + +// ApplyPremiumMultiplierWeiPerEthUpdates provides a mock function with given fields: opts, premiumMultiplierWeiPerEthArgs +func (_m *FeeQuoterInterface) ApplyPremiumMultiplierWeiPerEthUpdates(opts *bind.TransactOpts, premiumMultiplierWeiPerEthArgs []fee_quoter.FeeQuoterPremiumMultiplierWeiPerEthArgs) (*types.Transaction, error) { + ret := _m.Called(opts, premiumMultiplierWeiPerEthArgs) + + if len(ret) == 0 { + panic("no return value specified for ApplyPremiumMultiplierWeiPerEthUpdates") + } + + var r0 *types.Transaction + var r1 error + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, []fee_quoter.FeeQuoterPremiumMultiplierWeiPerEthArgs) (*types.Transaction, error)); ok { + return rf(opts, premiumMultiplierWeiPerEthArgs) + } + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, []fee_quoter.FeeQuoterPremiumMultiplierWeiPerEthArgs) *types.Transaction); ok { + r0 = rf(opts, premiumMultiplierWeiPerEthArgs) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Transaction) + } + } + + if rf, ok := ret.Get(1).(func(*bind.TransactOpts, []fee_quoter.FeeQuoterPremiumMultiplierWeiPerEthArgs) error); ok { + r1 = rf(opts, premiumMultiplierWeiPerEthArgs) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// FeeQuoterInterface_ApplyPremiumMultiplierWeiPerEthUpdates_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ApplyPremiumMultiplierWeiPerEthUpdates' +type FeeQuoterInterface_ApplyPremiumMultiplierWeiPerEthUpdates_Call struct { + *mock.Call +} + +// ApplyPremiumMultiplierWeiPerEthUpdates is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - premiumMultiplierWeiPerEthArgs []fee_quoter.FeeQuoterPremiumMultiplierWeiPerEthArgs +func (_e *FeeQuoterInterface_Expecter) ApplyPremiumMultiplierWeiPerEthUpdates(opts interface{}, premiumMultiplierWeiPerEthArgs interface{}) *FeeQuoterInterface_ApplyPremiumMultiplierWeiPerEthUpdates_Call { + return &FeeQuoterInterface_ApplyPremiumMultiplierWeiPerEthUpdates_Call{Call: _e.mock.On("ApplyPremiumMultiplierWeiPerEthUpdates", opts, premiumMultiplierWeiPerEthArgs)} +} + +func (_c *FeeQuoterInterface_ApplyPremiumMultiplierWeiPerEthUpdates_Call) Run(run func(opts *bind.TransactOpts, premiumMultiplierWeiPerEthArgs []fee_quoter.FeeQuoterPremiumMultiplierWeiPerEthArgs)) *FeeQuoterInterface_ApplyPremiumMultiplierWeiPerEthUpdates_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].([]fee_quoter.FeeQuoterPremiumMultiplierWeiPerEthArgs)) + }) + return _c +} + +func (_c *FeeQuoterInterface_ApplyPremiumMultiplierWeiPerEthUpdates_Call) Return(_a0 *types.Transaction, _a1 error) *FeeQuoterInterface_ApplyPremiumMultiplierWeiPerEthUpdates_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FeeQuoterInterface_ApplyPremiumMultiplierWeiPerEthUpdates_Call) RunAndReturn(run func(*bind.TransactOpts, []fee_quoter.FeeQuoterPremiumMultiplierWeiPerEthArgs) (*types.Transaction, error)) *FeeQuoterInterface_ApplyPremiumMultiplierWeiPerEthUpdates_Call { + _c.Call.Return(run) + return _c +} + +// ApplyTokenTransferFeeConfigUpdates provides a mock function with given fields: opts, tokenTransferFeeConfigArgs, tokensToUseDefaultFeeConfigs +func (_m *FeeQuoterInterface) ApplyTokenTransferFeeConfigUpdates(opts *bind.TransactOpts, tokenTransferFeeConfigArgs []fee_quoter.FeeQuoterTokenTransferFeeConfigArgs, tokensToUseDefaultFeeConfigs []fee_quoter.FeeQuoterTokenTransferFeeConfigRemoveArgs) (*types.Transaction, error) { + ret := _m.Called(opts, tokenTransferFeeConfigArgs, tokensToUseDefaultFeeConfigs) + + if len(ret) == 0 { + panic("no return value specified for ApplyTokenTransferFeeConfigUpdates") + } + + var r0 *types.Transaction + var r1 error + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, []fee_quoter.FeeQuoterTokenTransferFeeConfigArgs, []fee_quoter.FeeQuoterTokenTransferFeeConfigRemoveArgs) (*types.Transaction, error)); ok { + return rf(opts, tokenTransferFeeConfigArgs, tokensToUseDefaultFeeConfigs) + } + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, []fee_quoter.FeeQuoterTokenTransferFeeConfigArgs, []fee_quoter.FeeQuoterTokenTransferFeeConfigRemoveArgs) *types.Transaction); ok { + r0 = rf(opts, tokenTransferFeeConfigArgs, tokensToUseDefaultFeeConfigs) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Transaction) + } + } + + if rf, ok := ret.Get(1).(func(*bind.TransactOpts, []fee_quoter.FeeQuoterTokenTransferFeeConfigArgs, []fee_quoter.FeeQuoterTokenTransferFeeConfigRemoveArgs) error); ok { + r1 = rf(opts, tokenTransferFeeConfigArgs, tokensToUseDefaultFeeConfigs) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// FeeQuoterInterface_ApplyTokenTransferFeeConfigUpdates_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ApplyTokenTransferFeeConfigUpdates' +type FeeQuoterInterface_ApplyTokenTransferFeeConfigUpdates_Call struct { + *mock.Call +} + +// ApplyTokenTransferFeeConfigUpdates is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - tokenTransferFeeConfigArgs []fee_quoter.FeeQuoterTokenTransferFeeConfigArgs +// - tokensToUseDefaultFeeConfigs []fee_quoter.FeeQuoterTokenTransferFeeConfigRemoveArgs +func (_e *FeeQuoterInterface_Expecter) ApplyTokenTransferFeeConfigUpdates(opts interface{}, tokenTransferFeeConfigArgs interface{}, tokensToUseDefaultFeeConfigs interface{}) *FeeQuoterInterface_ApplyTokenTransferFeeConfigUpdates_Call { + return &FeeQuoterInterface_ApplyTokenTransferFeeConfigUpdates_Call{Call: _e.mock.On("ApplyTokenTransferFeeConfigUpdates", opts, tokenTransferFeeConfigArgs, tokensToUseDefaultFeeConfigs)} +} + +func (_c *FeeQuoterInterface_ApplyTokenTransferFeeConfigUpdates_Call) Run(run func(opts *bind.TransactOpts, tokenTransferFeeConfigArgs []fee_quoter.FeeQuoterTokenTransferFeeConfigArgs, tokensToUseDefaultFeeConfigs []fee_quoter.FeeQuoterTokenTransferFeeConfigRemoveArgs)) *FeeQuoterInterface_ApplyTokenTransferFeeConfigUpdates_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].([]fee_quoter.FeeQuoterTokenTransferFeeConfigArgs), args[2].([]fee_quoter.FeeQuoterTokenTransferFeeConfigRemoveArgs)) + }) + return _c +} + +func (_c *FeeQuoterInterface_ApplyTokenTransferFeeConfigUpdates_Call) Return(_a0 *types.Transaction, _a1 error) *FeeQuoterInterface_ApplyTokenTransferFeeConfigUpdates_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FeeQuoterInterface_ApplyTokenTransferFeeConfigUpdates_Call) RunAndReturn(run func(*bind.TransactOpts, []fee_quoter.FeeQuoterTokenTransferFeeConfigArgs, []fee_quoter.FeeQuoterTokenTransferFeeConfigRemoveArgs) (*types.Transaction, error)) *FeeQuoterInterface_ApplyTokenTransferFeeConfigUpdates_Call { + _c.Call.Return(run) + return _c +} + +// ConvertTokenAmount provides a mock function with given fields: opts, fromToken, fromTokenAmount, toToken +func (_m *FeeQuoterInterface) ConvertTokenAmount(opts *bind.CallOpts, fromToken common.Address, fromTokenAmount *big.Int, toToken common.Address) (*big.Int, error) { + ret := _m.Called(opts, fromToken, fromTokenAmount, toToken) + + if len(ret) == 0 { + panic("no return value specified for ConvertTokenAmount") + } + + var r0 *big.Int + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts, common.Address, *big.Int, common.Address) (*big.Int, error)); ok { + return rf(opts, fromToken, fromTokenAmount, toToken) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts, common.Address, *big.Int, common.Address) *big.Int); ok { + r0 = rf(opts, fromToken, fromTokenAmount, toToken) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*big.Int) + } + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts, common.Address, *big.Int, common.Address) error); ok { + r1 = rf(opts, fromToken, fromTokenAmount, toToken) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// FeeQuoterInterface_ConvertTokenAmount_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ConvertTokenAmount' +type FeeQuoterInterface_ConvertTokenAmount_Call struct { + *mock.Call +} + +// ConvertTokenAmount is a helper method to define mock.On call +// - opts *bind.CallOpts +// - fromToken common.Address +// - fromTokenAmount *big.Int +// - toToken common.Address +func (_e *FeeQuoterInterface_Expecter) ConvertTokenAmount(opts interface{}, fromToken interface{}, fromTokenAmount interface{}, toToken interface{}) *FeeQuoterInterface_ConvertTokenAmount_Call { + return &FeeQuoterInterface_ConvertTokenAmount_Call{Call: _e.mock.On("ConvertTokenAmount", opts, fromToken, fromTokenAmount, toToken)} +} + +func (_c *FeeQuoterInterface_ConvertTokenAmount_Call) Run(run func(opts *bind.CallOpts, fromToken common.Address, fromTokenAmount *big.Int, toToken common.Address)) *FeeQuoterInterface_ConvertTokenAmount_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts), args[1].(common.Address), args[2].(*big.Int), args[3].(common.Address)) + }) + return _c +} + +func (_c *FeeQuoterInterface_ConvertTokenAmount_Call) Return(_a0 *big.Int, _a1 error) *FeeQuoterInterface_ConvertTokenAmount_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FeeQuoterInterface_ConvertTokenAmount_Call) RunAndReturn(run func(*bind.CallOpts, common.Address, *big.Int, common.Address) (*big.Int, error)) *FeeQuoterInterface_ConvertTokenAmount_Call { + _c.Call.Return(run) + return _c +} + +// FilterAuthorizedCallerAdded provides a mock function with given fields: opts +func (_m *FeeQuoterInterface) FilterAuthorizedCallerAdded(opts *bind.FilterOpts) (*fee_quoter.FeeQuoterAuthorizedCallerAddedIterator, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for FilterAuthorizedCallerAdded") + } + + var r0 *fee_quoter.FeeQuoterAuthorizedCallerAddedIterator + var r1 error + if rf, ok := ret.Get(0).(func(*bind.FilterOpts) (*fee_quoter.FeeQuoterAuthorizedCallerAddedIterator, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.FilterOpts) *fee_quoter.FeeQuoterAuthorizedCallerAddedIterator); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*fee_quoter.FeeQuoterAuthorizedCallerAddedIterator) + } + } + + if rf, ok := ret.Get(1).(func(*bind.FilterOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// FeeQuoterInterface_FilterAuthorizedCallerAdded_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterAuthorizedCallerAdded' +type FeeQuoterInterface_FilterAuthorizedCallerAdded_Call struct { + *mock.Call +} + +// FilterAuthorizedCallerAdded is a helper method to define mock.On call +// - opts *bind.FilterOpts +func (_e *FeeQuoterInterface_Expecter) FilterAuthorizedCallerAdded(opts interface{}) *FeeQuoterInterface_FilterAuthorizedCallerAdded_Call { + return &FeeQuoterInterface_FilterAuthorizedCallerAdded_Call{Call: _e.mock.On("FilterAuthorizedCallerAdded", opts)} +} + +func (_c *FeeQuoterInterface_FilterAuthorizedCallerAdded_Call) Run(run func(opts *bind.FilterOpts)) *FeeQuoterInterface_FilterAuthorizedCallerAdded_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts)) + }) + return _c +} + +func (_c *FeeQuoterInterface_FilterAuthorizedCallerAdded_Call) Return(_a0 *fee_quoter.FeeQuoterAuthorizedCallerAddedIterator, _a1 error) *FeeQuoterInterface_FilterAuthorizedCallerAdded_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FeeQuoterInterface_FilterAuthorizedCallerAdded_Call) RunAndReturn(run func(*bind.FilterOpts) (*fee_quoter.FeeQuoterAuthorizedCallerAddedIterator, error)) *FeeQuoterInterface_FilterAuthorizedCallerAdded_Call { + _c.Call.Return(run) + return _c +} + +// FilterAuthorizedCallerRemoved provides a mock function with given fields: opts +func (_m *FeeQuoterInterface) FilterAuthorizedCallerRemoved(opts *bind.FilterOpts) (*fee_quoter.FeeQuoterAuthorizedCallerRemovedIterator, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for FilterAuthorizedCallerRemoved") + } + + var r0 *fee_quoter.FeeQuoterAuthorizedCallerRemovedIterator + var r1 error + if rf, ok := ret.Get(0).(func(*bind.FilterOpts) (*fee_quoter.FeeQuoterAuthorizedCallerRemovedIterator, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.FilterOpts) *fee_quoter.FeeQuoterAuthorizedCallerRemovedIterator); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*fee_quoter.FeeQuoterAuthorizedCallerRemovedIterator) + } + } + + if rf, ok := ret.Get(1).(func(*bind.FilterOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// FeeQuoterInterface_FilterAuthorizedCallerRemoved_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterAuthorizedCallerRemoved' +type FeeQuoterInterface_FilterAuthorizedCallerRemoved_Call struct { + *mock.Call +} + +// FilterAuthorizedCallerRemoved is a helper method to define mock.On call +// - opts *bind.FilterOpts +func (_e *FeeQuoterInterface_Expecter) FilterAuthorizedCallerRemoved(opts interface{}) *FeeQuoterInterface_FilterAuthorizedCallerRemoved_Call { + return &FeeQuoterInterface_FilterAuthorizedCallerRemoved_Call{Call: _e.mock.On("FilterAuthorizedCallerRemoved", opts)} +} + +func (_c *FeeQuoterInterface_FilterAuthorizedCallerRemoved_Call) Run(run func(opts *bind.FilterOpts)) *FeeQuoterInterface_FilterAuthorizedCallerRemoved_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts)) + }) + return _c +} + +func (_c *FeeQuoterInterface_FilterAuthorizedCallerRemoved_Call) Return(_a0 *fee_quoter.FeeQuoterAuthorizedCallerRemovedIterator, _a1 error) *FeeQuoterInterface_FilterAuthorizedCallerRemoved_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FeeQuoterInterface_FilterAuthorizedCallerRemoved_Call) RunAndReturn(run func(*bind.FilterOpts) (*fee_quoter.FeeQuoterAuthorizedCallerRemovedIterator, error)) *FeeQuoterInterface_FilterAuthorizedCallerRemoved_Call { + _c.Call.Return(run) + return _c +} + +// FilterDestChainAdded provides a mock function with given fields: opts, destChainSelector +func (_m *FeeQuoterInterface) FilterDestChainAdded(opts *bind.FilterOpts, destChainSelector []uint64) (*fee_quoter.FeeQuoterDestChainAddedIterator, error) { + ret := _m.Called(opts, destChainSelector) + + if len(ret) == 0 { + panic("no return value specified for FilterDestChainAdded") + } + + var r0 *fee_quoter.FeeQuoterDestChainAddedIterator + var r1 error + if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []uint64) (*fee_quoter.FeeQuoterDestChainAddedIterator, error)); ok { + return rf(opts, destChainSelector) + } + if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []uint64) *fee_quoter.FeeQuoterDestChainAddedIterator); ok { + r0 = rf(opts, destChainSelector) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*fee_quoter.FeeQuoterDestChainAddedIterator) + } + } + + if rf, ok := ret.Get(1).(func(*bind.FilterOpts, []uint64) error); ok { + r1 = rf(opts, destChainSelector) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// FeeQuoterInterface_FilterDestChainAdded_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterDestChainAdded' +type FeeQuoterInterface_FilterDestChainAdded_Call struct { + *mock.Call +} + +// FilterDestChainAdded is a helper method to define mock.On call +// - opts *bind.FilterOpts +// - destChainSelector []uint64 +func (_e *FeeQuoterInterface_Expecter) FilterDestChainAdded(opts interface{}, destChainSelector interface{}) *FeeQuoterInterface_FilterDestChainAdded_Call { + return &FeeQuoterInterface_FilterDestChainAdded_Call{Call: _e.mock.On("FilterDestChainAdded", opts, destChainSelector)} +} + +func (_c *FeeQuoterInterface_FilterDestChainAdded_Call) Run(run func(opts *bind.FilterOpts, destChainSelector []uint64)) *FeeQuoterInterface_FilterDestChainAdded_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts), args[1].([]uint64)) + }) + return _c +} + +func (_c *FeeQuoterInterface_FilterDestChainAdded_Call) Return(_a0 *fee_quoter.FeeQuoterDestChainAddedIterator, _a1 error) *FeeQuoterInterface_FilterDestChainAdded_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FeeQuoterInterface_FilterDestChainAdded_Call) RunAndReturn(run func(*bind.FilterOpts, []uint64) (*fee_quoter.FeeQuoterDestChainAddedIterator, error)) *FeeQuoterInterface_FilterDestChainAdded_Call { + _c.Call.Return(run) + return _c +} + +// FilterDestChainConfigUpdated provides a mock function with given fields: opts, destChainSelector +func (_m *FeeQuoterInterface) FilterDestChainConfigUpdated(opts *bind.FilterOpts, destChainSelector []uint64) (*fee_quoter.FeeQuoterDestChainConfigUpdatedIterator, error) { + ret := _m.Called(opts, destChainSelector) + + if len(ret) == 0 { + panic("no return value specified for FilterDestChainConfigUpdated") + } + + var r0 *fee_quoter.FeeQuoterDestChainConfigUpdatedIterator + var r1 error + if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []uint64) (*fee_quoter.FeeQuoterDestChainConfigUpdatedIterator, error)); ok { + return rf(opts, destChainSelector) + } + if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []uint64) *fee_quoter.FeeQuoterDestChainConfigUpdatedIterator); ok { + r0 = rf(opts, destChainSelector) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*fee_quoter.FeeQuoterDestChainConfigUpdatedIterator) + } + } + + if rf, ok := ret.Get(1).(func(*bind.FilterOpts, []uint64) error); ok { + r1 = rf(opts, destChainSelector) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// FeeQuoterInterface_FilterDestChainConfigUpdated_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterDestChainConfigUpdated' +type FeeQuoterInterface_FilterDestChainConfigUpdated_Call struct { + *mock.Call +} + +// FilterDestChainConfigUpdated is a helper method to define mock.On call +// - opts *bind.FilterOpts +// - destChainSelector []uint64 +func (_e *FeeQuoterInterface_Expecter) FilterDestChainConfigUpdated(opts interface{}, destChainSelector interface{}) *FeeQuoterInterface_FilterDestChainConfigUpdated_Call { + return &FeeQuoterInterface_FilterDestChainConfigUpdated_Call{Call: _e.mock.On("FilterDestChainConfigUpdated", opts, destChainSelector)} +} + +func (_c *FeeQuoterInterface_FilterDestChainConfigUpdated_Call) Run(run func(opts *bind.FilterOpts, destChainSelector []uint64)) *FeeQuoterInterface_FilterDestChainConfigUpdated_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts), args[1].([]uint64)) + }) + return _c +} + +func (_c *FeeQuoterInterface_FilterDestChainConfigUpdated_Call) Return(_a0 *fee_quoter.FeeQuoterDestChainConfigUpdatedIterator, _a1 error) *FeeQuoterInterface_FilterDestChainConfigUpdated_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FeeQuoterInterface_FilterDestChainConfigUpdated_Call) RunAndReturn(run func(*bind.FilterOpts, []uint64) (*fee_quoter.FeeQuoterDestChainConfigUpdatedIterator, error)) *FeeQuoterInterface_FilterDestChainConfigUpdated_Call { + _c.Call.Return(run) + return _c +} + +// FilterFeeTokenAdded provides a mock function with given fields: opts, feeToken +func (_m *FeeQuoterInterface) FilterFeeTokenAdded(opts *bind.FilterOpts, feeToken []common.Address) (*fee_quoter.FeeQuoterFeeTokenAddedIterator, error) { + ret := _m.Called(opts, feeToken) + + if len(ret) == 0 { + panic("no return value specified for FilterFeeTokenAdded") + } + + var r0 *fee_quoter.FeeQuoterFeeTokenAddedIterator + var r1 error + if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []common.Address) (*fee_quoter.FeeQuoterFeeTokenAddedIterator, error)); ok { + return rf(opts, feeToken) + } + if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []common.Address) *fee_quoter.FeeQuoterFeeTokenAddedIterator); ok { + r0 = rf(opts, feeToken) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*fee_quoter.FeeQuoterFeeTokenAddedIterator) + } + } + + if rf, ok := ret.Get(1).(func(*bind.FilterOpts, []common.Address) error); ok { + r1 = rf(opts, feeToken) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// FeeQuoterInterface_FilterFeeTokenAdded_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterFeeTokenAdded' +type FeeQuoterInterface_FilterFeeTokenAdded_Call struct { + *mock.Call +} + +// FilterFeeTokenAdded is a helper method to define mock.On call +// - opts *bind.FilterOpts +// - feeToken []common.Address +func (_e *FeeQuoterInterface_Expecter) FilterFeeTokenAdded(opts interface{}, feeToken interface{}) *FeeQuoterInterface_FilterFeeTokenAdded_Call { + return &FeeQuoterInterface_FilterFeeTokenAdded_Call{Call: _e.mock.On("FilterFeeTokenAdded", opts, feeToken)} +} + +func (_c *FeeQuoterInterface_FilterFeeTokenAdded_Call) Run(run func(opts *bind.FilterOpts, feeToken []common.Address)) *FeeQuoterInterface_FilterFeeTokenAdded_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts), args[1].([]common.Address)) + }) + return _c +} + +func (_c *FeeQuoterInterface_FilterFeeTokenAdded_Call) Return(_a0 *fee_quoter.FeeQuoterFeeTokenAddedIterator, _a1 error) *FeeQuoterInterface_FilterFeeTokenAdded_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FeeQuoterInterface_FilterFeeTokenAdded_Call) RunAndReturn(run func(*bind.FilterOpts, []common.Address) (*fee_quoter.FeeQuoterFeeTokenAddedIterator, error)) *FeeQuoterInterface_FilterFeeTokenAdded_Call { + _c.Call.Return(run) + return _c +} + +// FilterFeeTokenRemoved provides a mock function with given fields: opts, feeToken +func (_m *FeeQuoterInterface) FilterFeeTokenRemoved(opts *bind.FilterOpts, feeToken []common.Address) (*fee_quoter.FeeQuoterFeeTokenRemovedIterator, error) { + ret := _m.Called(opts, feeToken) + + if len(ret) == 0 { + panic("no return value specified for FilterFeeTokenRemoved") + } + + var r0 *fee_quoter.FeeQuoterFeeTokenRemovedIterator + var r1 error + if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []common.Address) (*fee_quoter.FeeQuoterFeeTokenRemovedIterator, error)); ok { + return rf(opts, feeToken) + } + if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []common.Address) *fee_quoter.FeeQuoterFeeTokenRemovedIterator); ok { + r0 = rf(opts, feeToken) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*fee_quoter.FeeQuoterFeeTokenRemovedIterator) + } + } + + if rf, ok := ret.Get(1).(func(*bind.FilterOpts, []common.Address) error); ok { + r1 = rf(opts, feeToken) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// FeeQuoterInterface_FilterFeeTokenRemoved_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterFeeTokenRemoved' +type FeeQuoterInterface_FilterFeeTokenRemoved_Call struct { + *mock.Call +} + +// FilterFeeTokenRemoved is a helper method to define mock.On call +// - opts *bind.FilterOpts +// - feeToken []common.Address +func (_e *FeeQuoterInterface_Expecter) FilterFeeTokenRemoved(opts interface{}, feeToken interface{}) *FeeQuoterInterface_FilterFeeTokenRemoved_Call { + return &FeeQuoterInterface_FilterFeeTokenRemoved_Call{Call: _e.mock.On("FilterFeeTokenRemoved", opts, feeToken)} +} + +func (_c *FeeQuoterInterface_FilterFeeTokenRemoved_Call) Run(run func(opts *bind.FilterOpts, feeToken []common.Address)) *FeeQuoterInterface_FilterFeeTokenRemoved_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts), args[1].([]common.Address)) + }) + return _c +} + +func (_c *FeeQuoterInterface_FilterFeeTokenRemoved_Call) Return(_a0 *fee_quoter.FeeQuoterFeeTokenRemovedIterator, _a1 error) *FeeQuoterInterface_FilterFeeTokenRemoved_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FeeQuoterInterface_FilterFeeTokenRemoved_Call) RunAndReturn(run func(*bind.FilterOpts, []common.Address) (*fee_quoter.FeeQuoterFeeTokenRemovedIterator, error)) *FeeQuoterInterface_FilterFeeTokenRemoved_Call { + _c.Call.Return(run) + return _c +} + +// FilterOwnershipTransferRequested provides a mock function with given fields: opts, from, to +func (_m *FeeQuoterInterface) FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*fee_quoter.FeeQuoterOwnershipTransferRequestedIterator, error) { + ret := _m.Called(opts, from, to) + + if len(ret) == 0 { + panic("no return value specified for FilterOwnershipTransferRequested") + } + + var r0 *fee_quoter.FeeQuoterOwnershipTransferRequestedIterator + var r1 error + if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []common.Address, []common.Address) (*fee_quoter.FeeQuoterOwnershipTransferRequestedIterator, error)); ok { + return rf(opts, from, to) + } + if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []common.Address, []common.Address) *fee_quoter.FeeQuoterOwnershipTransferRequestedIterator); ok { + r0 = rf(opts, from, to) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*fee_quoter.FeeQuoterOwnershipTransferRequestedIterator) + } + } + + if rf, ok := ret.Get(1).(func(*bind.FilterOpts, []common.Address, []common.Address) error); ok { + r1 = rf(opts, from, to) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// FeeQuoterInterface_FilterOwnershipTransferRequested_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterOwnershipTransferRequested' +type FeeQuoterInterface_FilterOwnershipTransferRequested_Call struct { + *mock.Call +} + +// FilterOwnershipTransferRequested is a helper method to define mock.On call +// - opts *bind.FilterOpts +// - from []common.Address +// - to []common.Address +func (_e *FeeQuoterInterface_Expecter) FilterOwnershipTransferRequested(opts interface{}, from interface{}, to interface{}) *FeeQuoterInterface_FilterOwnershipTransferRequested_Call { + return &FeeQuoterInterface_FilterOwnershipTransferRequested_Call{Call: _e.mock.On("FilterOwnershipTransferRequested", opts, from, to)} +} + +func (_c *FeeQuoterInterface_FilterOwnershipTransferRequested_Call) Run(run func(opts *bind.FilterOpts, from []common.Address, to []common.Address)) *FeeQuoterInterface_FilterOwnershipTransferRequested_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts), args[1].([]common.Address), args[2].([]common.Address)) + }) + return _c +} + +func (_c *FeeQuoterInterface_FilterOwnershipTransferRequested_Call) Return(_a0 *fee_quoter.FeeQuoterOwnershipTransferRequestedIterator, _a1 error) *FeeQuoterInterface_FilterOwnershipTransferRequested_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FeeQuoterInterface_FilterOwnershipTransferRequested_Call) RunAndReturn(run func(*bind.FilterOpts, []common.Address, []common.Address) (*fee_quoter.FeeQuoterOwnershipTransferRequestedIterator, error)) *FeeQuoterInterface_FilterOwnershipTransferRequested_Call { + _c.Call.Return(run) + return _c +} + +// FilterOwnershipTransferred provides a mock function with given fields: opts, from, to +func (_m *FeeQuoterInterface) FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*fee_quoter.FeeQuoterOwnershipTransferredIterator, error) { + ret := _m.Called(opts, from, to) + + if len(ret) == 0 { + panic("no return value specified for FilterOwnershipTransferred") + } + + var r0 *fee_quoter.FeeQuoterOwnershipTransferredIterator + var r1 error + if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []common.Address, []common.Address) (*fee_quoter.FeeQuoterOwnershipTransferredIterator, error)); ok { + return rf(opts, from, to) + } + if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []common.Address, []common.Address) *fee_quoter.FeeQuoterOwnershipTransferredIterator); ok { + r0 = rf(opts, from, to) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*fee_quoter.FeeQuoterOwnershipTransferredIterator) + } + } + + if rf, ok := ret.Get(1).(func(*bind.FilterOpts, []common.Address, []common.Address) error); ok { + r1 = rf(opts, from, to) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// FeeQuoterInterface_FilterOwnershipTransferred_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterOwnershipTransferred' +type FeeQuoterInterface_FilterOwnershipTransferred_Call struct { + *mock.Call +} + +// FilterOwnershipTransferred is a helper method to define mock.On call +// - opts *bind.FilterOpts +// - from []common.Address +// - to []common.Address +func (_e *FeeQuoterInterface_Expecter) FilterOwnershipTransferred(opts interface{}, from interface{}, to interface{}) *FeeQuoterInterface_FilterOwnershipTransferred_Call { + return &FeeQuoterInterface_FilterOwnershipTransferred_Call{Call: _e.mock.On("FilterOwnershipTransferred", opts, from, to)} +} + +func (_c *FeeQuoterInterface_FilterOwnershipTransferred_Call) Run(run func(opts *bind.FilterOpts, from []common.Address, to []common.Address)) *FeeQuoterInterface_FilterOwnershipTransferred_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts), args[1].([]common.Address), args[2].([]common.Address)) + }) + return _c +} + +func (_c *FeeQuoterInterface_FilterOwnershipTransferred_Call) Return(_a0 *fee_quoter.FeeQuoterOwnershipTransferredIterator, _a1 error) *FeeQuoterInterface_FilterOwnershipTransferred_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FeeQuoterInterface_FilterOwnershipTransferred_Call) RunAndReturn(run func(*bind.FilterOpts, []common.Address, []common.Address) (*fee_quoter.FeeQuoterOwnershipTransferredIterator, error)) *FeeQuoterInterface_FilterOwnershipTransferred_Call { + _c.Call.Return(run) + return _c +} + +// FilterPremiumMultiplierWeiPerEthUpdated provides a mock function with given fields: opts, token +func (_m *FeeQuoterInterface) FilterPremiumMultiplierWeiPerEthUpdated(opts *bind.FilterOpts, token []common.Address) (*fee_quoter.FeeQuoterPremiumMultiplierWeiPerEthUpdatedIterator, error) { + ret := _m.Called(opts, token) + + if len(ret) == 0 { + panic("no return value specified for FilterPremiumMultiplierWeiPerEthUpdated") + } + + var r0 *fee_quoter.FeeQuoterPremiumMultiplierWeiPerEthUpdatedIterator + var r1 error + if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []common.Address) (*fee_quoter.FeeQuoterPremiumMultiplierWeiPerEthUpdatedIterator, error)); ok { + return rf(opts, token) + } + if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []common.Address) *fee_quoter.FeeQuoterPremiumMultiplierWeiPerEthUpdatedIterator); ok { + r0 = rf(opts, token) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*fee_quoter.FeeQuoterPremiumMultiplierWeiPerEthUpdatedIterator) + } + } + + if rf, ok := ret.Get(1).(func(*bind.FilterOpts, []common.Address) error); ok { + r1 = rf(opts, token) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// FeeQuoterInterface_FilterPremiumMultiplierWeiPerEthUpdated_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterPremiumMultiplierWeiPerEthUpdated' +type FeeQuoterInterface_FilterPremiumMultiplierWeiPerEthUpdated_Call struct { + *mock.Call +} + +// FilterPremiumMultiplierWeiPerEthUpdated is a helper method to define mock.On call +// - opts *bind.FilterOpts +// - token []common.Address +func (_e *FeeQuoterInterface_Expecter) FilterPremiumMultiplierWeiPerEthUpdated(opts interface{}, token interface{}) *FeeQuoterInterface_FilterPremiumMultiplierWeiPerEthUpdated_Call { + return &FeeQuoterInterface_FilterPremiumMultiplierWeiPerEthUpdated_Call{Call: _e.mock.On("FilterPremiumMultiplierWeiPerEthUpdated", opts, token)} +} + +func (_c *FeeQuoterInterface_FilterPremiumMultiplierWeiPerEthUpdated_Call) Run(run func(opts *bind.FilterOpts, token []common.Address)) *FeeQuoterInterface_FilterPremiumMultiplierWeiPerEthUpdated_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts), args[1].([]common.Address)) + }) + return _c +} + +func (_c *FeeQuoterInterface_FilterPremiumMultiplierWeiPerEthUpdated_Call) Return(_a0 *fee_quoter.FeeQuoterPremiumMultiplierWeiPerEthUpdatedIterator, _a1 error) *FeeQuoterInterface_FilterPremiumMultiplierWeiPerEthUpdated_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FeeQuoterInterface_FilterPremiumMultiplierWeiPerEthUpdated_Call) RunAndReturn(run func(*bind.FilterOpts, []common.Address) (*fee_quoter.FeeQuoterPremiumMultiplierWeiPerEthUpdatedIterator, error)) *FeeQuoterInterface_FilterPremiumMultiplierWeiPerEthUpdated_Call { + _c.Call.Return(run) + return _c +} + +// FilterPriceFeedPerTokenUpdated provides a mock function with given fields: opts, token +func (_m *FeeQuoterInterface) FilterPriceFeedPerTokenUpdated(opts *bind.FilterOpts, token []common.Address) (*fee_quoter.FeeQuoterPriceFeedPerTokenUpdatedIterator, error) { + ret := _m.Called(opts, token) + + if len(ret) == 0 { + panic("no return value specified for FilterPriceFeedPerTokenUpdated") + } + + var r0 *fee_quoter.FeeQuoterPriceFeedPerTokenUpdatedIterator + var r1 error + if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []common.Address) (*fee_quoter.FeeQuoterPriceFeedPerTokenUpdatedIterator, error)); ok { + return rf(opts, token) + } + if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []common.Address) *fee_quoter.FeeQuoterPriceFeedPerTokenUpdatedIterator); ok { + r0 = rf(opts, token) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*fee_quoter.FeeQuoterPriceFeedPerTokenUpdatedIterator) + } + } + + if rf, ok := ret.Get(1).(func(*bind.FilterOpts, []common.Address) error); ok { + r1 = rf(opts, token) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// FeeQuoterInterface_FilterPriceFeedPerTokenUpdated_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterPriceFeedPerTokenUpdated' +type FeeQuoterInterface_FilterPriceFeedPerTokenUpdated_Call struct { + *mock.Call +} + +// FilterPriceFeedPerTokenUpdated is a helper method to define mock.On call +// - opts *bind.FilterOpts +// - token []common.Address +func (_e *FeeQuoterInterface_Expecter) FilterPriceFeedPerTokenUpdated(opts interface{}, token interface{}) *FeeQuoterInterface_FilterPriceFeedPerTokenUpdated_Call { + return &FeeQuoterInterface_FilterPriceFeedPerTokenUpdated_Call{Call: _e.mock.On("FilterPriceFeedPerTokenUpdated", opts, token)} +} + +func (_c *FeeQuoterInterface_FilterPriceFeedPerTokenUpdated_Call) Run(run func(opts *bind.FilterOpts, token []common.Address)) *FeeQuoterInterface_FilterPriceFeedPerTokenUpdated_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts), args[1].([]common.Address)) + }) + return _c +} + +func (_c *FeeQuoterInterface_FilterPriceFeedPerTokenUpdated_Call) Return(_a0 *fee_quoter.FeeQuoterPriceFeedPerTokenUpdatedIterator, _a1 error) *FeeQuoterInterface_FilterPriceFeedPerTokenUpdated_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FeeQuoterInterface_FilterPriceFeedPerTokenUpdated_Call) RunAndReturn(run func(*bind.FilterOpts, []common.Address) (*fee_quoter.FeeQuoterPriceFeedPerTokenUpdatedIterator, error)) *FeeQuoterInterface_FilterPriceFeedPerTokenUpdated_Call { + _c.Call.Return(run) + return _c +} + +// FilterReportPermissionSet provides a mock function with given fields: opts, reportId +func (_m *FeeQuoterInterface) FilterReportPermissionSet(opts *bind.FilterOpts, reportId [][32]byte) (*fee_quoter.FeeQuoterReportPermissionSetIterator, error) { + ret := _m.Called(opts, reportId) + + if len(ret) == 0 { + panic("no return value specified for FilterReportPermissionSet") + } + + var r0 *fee_quoter.FeeQuoterReportPermissionSetIterator + var r1 error + if rf, ok := ret.Get(0).(func(*bind.FilterOpts, [][32]byte) (*fee_quoter.FeeQuoterReportPermissionSetIterator, error)); ok { + return rf(opts, reportId) + } + if rf, ok := ret.Get(0).(func(*bind.FilterOpts, [][32]byte) *fee_quoter.FeeQuoterReportPermissionSetIterator); ok { + r0 = rf(opts, reportId) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*fee_quoter.FeeQuoterReportPermissionSetIterator) + } + } + + if rf, ok := ret.Get(1).(func(*bind.FilterOpts, [][32]byte) error); ok { + r1 = rf(opts, reportId) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// FeeQuoterInterface_FilterReportPermissionSet_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterReportPermissionSet' +type FeeQuoterInterface_FilterReportPermissionSet_Call struct { + *mock.Call +} + +// FilterReportPermissionSet is a helper method to define mock.On call +// - opts *bind.FilterOpts +// - reportId [][32]byte +func (_e *FeeQuoterInterface_Expecter) FilterReportPermissionSet(opts interface{}, reportId interface{}) *FeeQuoterInterface_FilterReportPermissionSet_Call { + return &FeeQuoterInterface_FilterReportPermissionSet_Call{Call: _e.mock.On("FilterReportPermissionSet", opts, reportId)} +} + +func (_c *FeeQuoterInterface_FilterReportPermissionSet_Call) Run(run func(opts *bind.FilterOpts, reportId [][32]byte)) *FeeQuoterInterface_FilterReportPermissionSet_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts), args[1].([][32]byte)) + }) + return _c +} + +func (_c *FeeQuoterInterface_FilterReportPermissionSet_Call) Return(_a0 *fee_quoter.FeeQuoterReportPermissionSetIterator, _a1 error) *FeeQuoterInterface_FilterReportPermissionSet_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FeeQuoterInterface_FilterReportPermissionSet_Call) RunAndReturn(run func(*bind.FilterOpts, [][32]byte) (*fee_quoter.FeeQuoterReportPermissionSetIterator, error)) *FeeQuoterInterface_FilterReportPermissionSet_Call { + _c.Call.Return(run) + return _c +} + +// FilterTokenTransferFeeConfigDeleted provides a mock function with given fields: opts, destChainSelector, token +func (_m *FeeQuoterInterface) FilterTokenTransferFeeConfigDeleted(opts *bind.FilterOpts, destChainSelector []uint64, token []common.Address) (*fee_quoter.FeeQuoterTokenTransferFeeConfigDeletedIterator, error) { + ret := _m.Called(opts, destChainSelector, token) + + if len(ret) == 0 { + panic("no return value specified for FilterTokenTransferFeeConfigDeleted") + } + + var r0 *fee_quoter.FeeQuoterTokenTransferFeeConfigDeletedIterator + var r1 error + if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []uint64, []common.Address) (*fee_quoter.FeeQuoterTokenTransferFeeConfigDeletedIterator, error)); ok { + return rf(opts, destChainSelector, token) + } + if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []uint64, []common.Address) *fee_quoter.FeeQuoterTokenTransferFeeConfigDeletedIterator); ok { + r0 = rf(opts, destChainSelector, token) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*fee_quoter.FeeQuoterTokenTransferFeeConfigDeletedIterator) + } + } + + if rf, ok := ret.Get(1).(func(*bind.FilterOpts, []uint64, []common.Address) error); ok { + r1 = rf(opts, destChainSelector, token) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// FeeQuoterInterface_FilterTokenTransferFeeConfigDeleted_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterTokenTransferFeeConfigDeleted' +type FeeQuoterInterface_FilterTokenTransferFeeConfigDeleted_Call struct { + *mock.Call +} + +// FilterTokenTransferFeeConfigDeleted is a helper method to define mock.On call +// - opts *bind.FilterOpts +// - destChainSelector []uint64 +// - token []common.Address +func (_e *FeeQuoterInterface_Expecter) FilterTokenTransferFeeConfigDeleted(opts interface{}, destChainSelector interface{}, token interface{}) *FeeQuoterInterface_FilterTokenTransferFeeConfigDeleted_Call { + return &FeeQuoterInterface_FilterTokenTransferFeeConfigDeleted_Call{Call: _e.mock.On("FilterTokenTransferFeeConfigDeleted", opts, destChainSelector, token)} +} + +func (_c *FeeQuoterInterface_FilterTokenTransferFeeConfigDeleted_Call) Run(run func(opts *bind.FilterOpts, destChainSelector []uint64, token []common.Address)) *FeeQuoterInterface_FilterTokenTransferFeeConfigDeleted_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts), args[1].([]uint64), args[2].([]common.Address)) + }) + return _c +} + +func (_c *FeeQuoterInterface_FilterTokenTransferFeeConfigDeleted_Call) Return(_a0 *fee_quoter.FeeQuoterTokenTransferFeeConfigDeletedIterator, _a1 error) *FeeQuoterInterface_FilterTokenTransferFeeConfigDeleted_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FeeQuoterInterface_FilterTokenTransferFeeConfigDeleted_Call) RunAndReturn(run func(*bind.FilterOpts, []uint64, []common.Address) (*fee_quoter.FeeQuoterTokenTransferFeeConfigDeletedIterator, error)) *FeeQuoterInterface_FilterTokenTransferFeeConfigDeleted_Call { + _c.Call.Return(run) + return _c +} + +// FilterTokenTransferFeeConfigUpdated provides a mock function with given fields: opts, destChainSelector, token +func (_m *FeeQuoterInterface) FilterTokenTransferFeeConfigUpdated(opts *bind.FilterOpts, destChainSelector []uint64, token []common.Address) (*fee_quoter.FeeQuoterTokenTransferFeeConfigUpdatedIterator, error) { + ret := _m.Called(opts, destChainSelector, token) + + if len(ret) == 0 { + panic("no return value specified for FilterTokenTransferFeeConfigUpdated") + } + + var r0 *fee_quoter.FeeQuoterTokenTransferFeeConfigUpdatedIterator + var r1 error + if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []uint64, []common.Address) (*fee_quoter.FeeQuoterTokenTransferFeeConfigUpdatedIterator, error)); ok { + return rf(opts, destChainSelector, token) + } + if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []uint64, []common.Address) *fee_quoter.FeeQuoterTokenTransferFeeConfigUpdatedIterator); ok { + r0 = rf(opts, destChainSelector, token) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*fee_quoter.FeeQuoterTokenTransferFeeConfigUpdatedIterator) + } + } + + if rf, ok := ret.Get(1).(func(*bind.FilterOpts, []uint64, []common.Address) error); ok { + r1 = rf(opts, destChainSelector, token) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// FeeQuoterInterface_FilterTokenTransferFeeConfigUpdated_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterTokenTransferFeeConfigUpdated' +type FeeQuoterInterface_FilterTokenTransferFeeConfigUpdated_Call struct { + *mock.Call +} + +// FilterTokenTransferFeeConfigUpdated is a helper method to define mock.On call +// - opts *bind.FilterOpts +// - destChainSelector []uint64 +// - token []common.Address +func (_e *FeeQuoterInterface_Expecter) FilterTokenTransferFeeConfigUpdated(opts interface{}, destChainSelector interface{}, token interface{}) *FeeQuoterInterface_FilterTokenTransferFeeConfigUpdated_Call { + return &FeeQuoterInterface_FilterTokenTransferFeeConfigUpdated_Call{Call: _e.mock.On("FilterTokenTransferFeeConfigUpdated", opts, destChainSelector, token)} +} + +func (_c *FeeQuoterInterface_FilterTokenTransferFeeConfigUpdated_Call) Run(run func(opts *bind.FilterOpts, destChainSelector []uint64, token []common.Address)) *FeeQuoterInterface_FilterTokenTransferFeeConfigUpdated_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts), args[1].([]uint64), args[2].([]common.Address)) + }) + return _c +} + +func (_c *FeeQuoterInterface_FilterTokenTransferFeeConfigUpdated_Call) Return(_a0 *fee_quoter.FeeQuoterTokenTransferFeeConfigUpdatedIterator, _a1 error) *FeeQuoterInterface_FilterTokenTransferFeeConfigUpdated_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FeeQuoterInterface_FilterTokenTransferFeeConfigUpdated_Call) RunAndReturn(run func(*bind.FilterOpts, []uint64, []common.Address) (*fee_quoter.FeeQuoterTokenTransferFeeConfigUpdatedIterator, error)) *FeeQuoterInterface_FilterTokenTransferFeeConfigUpdated_Call { + _c.Call.Return(run) + return _c +} + +// FilterUsdPerTokenUpdated provides a mock function with given fields: opts, token +func (_m *FeeQuoterInterface) FilterUsdPerTokenUpdated(opts *bind.FilterOpts, token []common.Address) (*fee_quoter.FeeQuoterUsdPerTokenUpdatedIterator, error) { + ret := _m.Called(opts, token) + + if len(ret) == 0 { + panic("no return value specified for FilterUsdPerTokenUpdated") + } + + var r0 *fee_quoter.FeeQuoterUsdPerTokenUpdatedIterator + var r1 error + if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []common.Address) (*fee_quoter.FeeQuoterUsdPerTokenUpdatedIterator, error)); ok { + return rf(opts, token) + } + if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []common.Address) *fee_quoter.FeeQuoterUsdPerTokenUpdatedIterator); ok { + r0 = rf(opts, token) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*fee_quoter.FeeQuoterUsdPerTokenUpdatedIterator) + } + } + + if rf, ok := ret.Get(1).(func(*bind.FilterOpts, []common.Address) error); ok { + r1 = rf(opts, token) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// FeeQuoterInterface_FilterUsdPerTokenUpdated_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterUsdPerTokenUpdated' +type FeeQuoterInterface_FilterUsdPerTokenUpdated_Call struct { + *mock.Call +} + +// FilterUsdPerTokenUpdated is a helper method to define mock.On call +// - opts *bind.FilterOpts +// - token []common.Address +func (_e *FeeQuoterInterface_Expecter) FilterUsdPerTokenUpdated(opts interface{}, token interface{}) *FeeQuoterInterface_FilterUsdPerTokenUpdated_Call { + return &FeeQuoterInterface_FilterUsdPerTokenUpdated_Call{Call: _e.mock.On("FilterUsdPerTokenUpdated", opts, token)} +} + +func (_c *FeeQuoterInterface_FilterUsdPerTokenUpdated_Call) Run(run func(opts *bind.FilterOpts, token []common.Address)) *FeeQuoterInterface_FilterUsdPerTokenUpdated_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts), args[1].([]common.Address)) + }) + return _c +} + +func (_c *FeeQuoterInterface_FilterUsdPerTokenUpdated_Call) Return(_a0 *fee_quoter.FeeQuoterUsdPerTokenUpdatedIterator, _a1 error) *FeeQuoterInterface_FilterUsdPerTokenUpdated_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FeeQuoterInterface_FilterUsdPerTokenUpdated_Call) RunAndReturn(run func(*bind.FilterOpts, []common.Address) (*fee_quoter.FeeQuoterUsdPerTokenUpdatedIterator, error)) *FeeQuoterInterface_FilterUsdPerTokenUpdated_Call { + _c.Call.Return(run) + return _c +} + +// FilterUsdPerUnitGasUpdated provides a mock function with given fields: opts, destChain +func (_m *FeeQuoterInterface) FilterUsdPerUnitGasUpdated(opts *bind.FilterOpts, destChain []uint64) (*fee_quoter.FeeQuoterUsdPerUnitGasUpdatedIterator, error) { + ret := _m.Called(opts, destChain) + + if len(ret) == 0 { + panic("no return value specified for FilterUsdPerUnitGasUpdated") + } + + var r0 *fee_quoter.FeeQuoterUsdPerUnitGasUpdatedIterator + var r1 error + if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []uint64) (*fee_quoter.FeeQuoterUsdPerUnitGasUpdatedIterator, error)); ok { + return rf(opts, destChain) + } + if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []uint64) *fee_quoter.FeeQuoterUsdPerUnitGasUpdatedIterator); ok { + r0 = rf(opts, destChain) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*fee_quoter.FeeQuoterUsdPerUnitGasUpdatedIterator) + } + } + + if rf, ok := ret.Get(1).(func(*bind.FilterOpts, []uint64) error); ok { + r1 = rf(opts, destChain) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// FeeQuoterInterface_FilterUsdPerUnitGasUpdated_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterUsdPerUnitGasUpdated' +type FeeQuoterInterface_FilterUsdPerUnitGasUpdated_Call struct { + *mock.Call +} + +// FilterUsdPerUnitGasUpdated is a helper method to define mock.On call +// - opts *bind.FilterOpts +// - destChain []uint64 +func (_e *FeeQuoterInterface_Expecter) FilterUsdPerUnitGasUpdated(opts interface{}, destChain interface{}) *FeeQuoterInterface_FilterUsdPerUnitGasUpdated_Call { + return &FeeQuoterInterface_FilterUsdPerUnitGasUpdated_Call{Call: _e.mock.On("FilterUsdPerUnitGasUpdated", opts, destChain)} +} + +func (_c *FeeQuoterInterface_FilterUsdPerUnitGasUpdated_Call) Run(run func(opts *bind.FilterOpts, destChain []uint64)) *FeeQuoterInterface_FilterUsdPerUnitGasUpdated_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts), args[1].([]uint64)) + }) + return _c +} + +func (_c *FeeQuoterInterface_FilterUsdPerUnitGasUpdated_Call) Return(_a0 *fee_quoter.FeeQuoterUsdPerUnitGasUpdatedIterator, _a1 error) *FeeQuoterInterface_FilterUsdPerUnitGasUpdated_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FeeQuoterInterface_FilterUsdPerUnitGasUpdated_Call) RunAndReturn(run func(*bind.FilterOpts, []uint64) (*fee_quoter.FeeQuoterUsdPerUnitGasUpdatedIterator, error)) *FeeQuoterInterface_FilterUsdPerUnitGasUpdated_Call { + _c.Call.Return(run) + return _c +} + +// GetAllAuthorizedCallers provides a mock function with given fields: opts +func (_m *FeeQuoterInterface) GetAllAuthorizedCallers(opts *bind.CallOpts) ([]common.Address, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for GetAllAuthorizedCallers") + } + + var r0 []common.Address + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts) ([]common.Address, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts) []common.Address); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]common.Address) + } + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// FeeQuoterInterface_GetAllAuthorizedCallers_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAllAuthorizedCallers' +type FeeQuoterInterface_GetAllAuthorizedCallers_Call struct { + *mock.Call +} + +// GetAllAuthorizedCallers is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *FeeQuoterInterface_Expecter) GetAllAuthorizedCallers(opts interface{}) *FeeQuoterInterface_GetAllAuthorizedCallers_Call { + return &FeeQuoterInterface_GetAllAuthorizedCallers_Call{Call: _e.mock.On("GetAllAuthorizedCallers", opts)} +} + +func (_c *FeeQuoterInterface_GetAllAuthorizedCallers_Call) Run(run func(opts *bind.CallOpts)) *FeeQuoterInterface_GetAllAuthorizedCallers_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *FeeQuoterInterface_GetAllAuthorizedCallers_Call) Return(_a0 []common.Address, _a1 error) *FeeQuoterInterface_GetAllAuthorizedCallers_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FeeQuoterInterface_GetAllAuthorizedCallers_Call) RunAndReturn(run func(*bind.CallOpts) ([]common.Address, error)) *FeeQuoterInterface_GetAllAuthorizedCallers_Call { + _c.Call.Return(run) + return _c +} + +// GetDestChainConfig provides a mock function with given fields: opts, destChainSelector +func (_m *FeeQuoterInterface) GetDestChainConfig(opts *bind.CallOpts, destChainSelector uint64) (fee_quoter.FeeQuoterDestChainConfig, error) { + ret := _m.Called(opts, destChainSelector) + + if len(ret) == 0 { + panic("no return value specified for GetDestChainConfig") + } + + var r0 fee_quoter.FeeQuoterDestChainConfig + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts, uint64) (fee_quoter.FeeQuoterDestChainConfig, error)); ok { + return rf(opts, destChainSelector) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts, uint64) fee_quoter.FeeQuoterDestChainConfig); ok { + r0 = rf(opts, destChainSelector) + } else { + r0 = ret.Get(0).(fee_quoter.FeeQuoterDestChainConfig) + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts, uint64) error); ok { + r1 = rf(opts, destChainSelector) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// FeeQuoterInterface_GetDestChainConfig_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetDestChainConfig' +type FeeQuoterInterface_GetDestChainConfig_Call struct { + *mock.Call +} + +// GetDestChainConfig is a helper method to define mock.On call +// - opts *bind.CallOpts +// - destChainSelector uint64 +func (_e *FeeQuoterInterface_Expecter) GetDestChainConfig(opts interface{}, destChainSelector interface{}) *FeeQuoterInterface_GetDestChainConfig_Call { + return &FeeQuoterInterface_GetDestChainConfig_Call{Call: _e.mock.On("GetDestChainConfig", opts, destChainSelector)} +} + +func (_c *FeeQuoterInterface_GetDestChainConfig_Call) Run(run func(opts *bind.CallOpts, destChainSelector uint64)) *FeeQuoterInterface_GetDestChainConfig_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts), args[1].(uint64)) + }) + return _c +} + +func (_c *FeeQuoterInterface_GetDestChainConfig_Call) Return(_a0 fee_quoter.FeeQuoterDestChainConfig, _a1 error) *FeeQuoterInterface_GetDestChainConfig_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FeeQuoterInterface_GetDestChainConfig_Call) RunAndReturn(run func(*bind.CallOpts, uint64) (fee_quoter.FeeQuoterDestChainConfig, error)) *FeeQuoterInterface_GetDestChainConfig_Call { + _c.Call.Return(run) + return _c +} + +// GetDestinationChainGasPrice provides a mock function with given fields: opts, destChainSelector +func (_m *FeeQuoterInterface) GetDestinationChainGasPrice(opts *bind.CallOpts, destChainSelector uint64) (fee_quoter.InternalTimestampedPackedUint224, error) { + ret := _m.Called(opts, destChainSelector) + + if len(ret) == 0 { + panic("no return value specified for GetDestinationChainGasPrice") + } + + var r0 fee_quoter.InternalTimestampedPackedUint224 + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts, uint64) (fee_quoter.InternalTimestampedPackedUint224, error)); ok { + return rf(opts, destChainSelector) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts, uint64) fee_quoter.InternalTimestampedPackedUint224); ok { + r0 = rf(opts, destChainSelector) + } else { + r0 = ret.Get(0).(fee_quoter.InternalTimestampedPackedUint224) + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts, uint64) error); ok { + r1 = rf(opts, destChainSelector) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// FeeQuoterInterface_GetDestinationChainGasPrice_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetDestinationChainGasPrice' +type FeeQuoterInterface_GetDestinationChainGasPrice_Call struct { + *mock.Call +} + +// GetDestinationChainGasPrice is a helper method to define mock.On call +// - opts *bind.CallOpts +// - destChainSelector uint64 +func (_e *FeeQuoterInterface_Expecter) GetDestinationChainGasPrice(opts interface{}, destChainSelector interface{}) *FeeQuoterInterface_GetDestinationChainGasPrice_Call { + return &FeeQuoterInterface_GetDestinationChainGasPrice_Call{Call: _e.mock.On("GetDestinationChainGasPrice", opts, destChainSelector)} +} + +func (_c *FeeQuoterInterface_GetDestinationChainGasPrice_Call) Run(run func(opts *bind.CallOpts, destChainSelector uint64)) *FeeQuoterInterface_GetDestinationChainGasPrice_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts), args[1].(uint64)) + }) + return _c +} + +func (_c *FeeQuoterInterface_GetDestinationChainGasPrice_Call) Return(_a0 fee_quoter.InternalTimestampedPackedUint224, _a1 error) *FeeQuoterInterface_GetDestinationChainGasPrice_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FeeQuoterInterface_GetDestinationChainGasPrice_Call) RunAndReturn(run func(*bind.CallOpts, uint64) (fee_quoter.InternalTimestampedPackedUint224, error)) *FeeQuoterInterface_GetDestinationChainGasPrice_Call { + _c.Call.Return(run) + return _c +} + +// GetFeeTokens provides a mock function with given fields: opts +func (_m *FeeQuoterInterface) GetFeeTokens(opts *bind.CallOpts) ([]common.Address, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for GetFeeTokens") + } + + var r0 []common.Address + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts) ([]common.Address, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts) []common.Address); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]common.Address) + } + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// FeeQuoterInterface_GetFeeTokens_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetFeeTokens' +type FeeQuoterInterface_GetFeeTokens_Call struct { + *mock.Call +} + +// GetFeeTokens is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *FeeQuoterInterface_Expecter) GetFeeTokens(opts interface{}) *FeeQuoterInterface_GetFeeTokens_Call { + return &FeeQuoterInterface_GetFeeTokens_Call{Call: _e.mock.On("GetFeeTokens", opts)} +} + +func (_c *FeeQuoterInterface_GetFeeTokens_Call) Run(run func(opts *bind.CallOpts)) *FeeQuoterInterface_GetFeeTokens_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *FeeQuoterInterface_GetFeeTokens_Call) Return(_a0 []common.Address, _a1 error) *FeeQuoterInterface_GetFeeTokens_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FeeQuoterInterface_GetFeeTokens_Call) RunAndReturn(run func(*bind.CallOpts) ([]common.Address, error)) *FeeQuoterInterface_GetFeeTokens_Call { + _c.Call.Return(run) + return _c +} + +// GetPremiumMultiplierWeiPerEth provides a mock function with given fields: opts, token +func (_m *FeeQuoterInterface) GetPremiumMultiplierWeiPerEth(opts *bind.CallOpts, token common.Address) (uint64, error) { + ret := _m.Called(opts, token) + + if len(ret) == 0 { + panic("no return value specified for GetPremiumMultiplierWeiPerEth") + } + + var r0 uint64 + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts, common.Address) (uint64, error)); ok { + return rf(opts, token) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts, common.Address) uint64); ok { + r0 = rf(opts, token) + } else { + r0 = ret.Get(0).(uint64) + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts, common.Address) error); ok { + r1 = rf(opts, token) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// FeeQuoterInterface_GetPremiumMultiplierWeiPerEth_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPremiumMultiplierWeiPerEth' +type FeeQuoterInterface_GetPremiumMultiplierWeiPerEth_Call struct { + *mock.Call +} + +// GetPremiumMultiplierWeiPerEth is a helper method to define mock.On call +// - opts *bind.CallOpts +// - token common.Address +func (_e *FeeQuoterInterface_Expecter) GetPremiumMultiplierWeiPerEth(opts interface{}, token interface{}) *FeeQuoterInterface_GetPremiumMultiplierWeiPerEth_Call { + return &FeeQuoterInterface_GetPremiumMultiplierWeiPerEth_Call{Call: _e.mock.On("GetPremiumMultiplierWeiPerEth", opts, token)} +} + +func (_c *FeeQuoterInterface_GetPremiumMultiplierWeiPerEth_Call) Run(run func(opts *bind.CallOpts, token common.Address)) *FeeQuoterInterface_GetPremiumMultiplierWeiPerEth_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts), args[1].(common.Address)) + }) + return _c +} + +func (_c *FeeQuoterInterface_GetPremiumMultiplierWeiPerEth_Call) Return(_a0 uint64, _a1 error) *FeeQuoterInterface_GetPremiumMultiplierWeiPerEth_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FeeQuoterInterface_GetPremiumMultiplierWeiPerEth_Call) RunAndReturn(run func(*bind.CallOpts, common.Address) (uint64, error)) *FeeQuoterInterface_GetPremiumMultiplierWeiPerEth_Call { + _c.Call.Return(run) + return _c +} + +// GetStaticConfig provides a mock function with given fields: opts +func (_m *FeeQuoterInterface) GetStaticConfig(opts *bind.CallOpts) (fee_quoter.FeeQuoterStaticConfig, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for GetStaticConfig") + } + + var r0 fee_quoter.FeeQuoterStaticConfig + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts) (fee_quoter.FeeQuoterStaticConfig, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts) fee_quoter.FeeQuoterStaticConfig); ok { + r0 = rf(opts) + } else { + r0 = ret.Get(0).(fee_quoter.FeeQuoterStaticConfig) + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// FeeQuoterInterface_GetStaticConfig_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetStaticConfig' +type FeeQuoterInterface_GetStaticConfig_Call struct { + *mock.Call +} + +// GetStaticConfig is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *FeeQuoterInterface_Expecter) GetStaticConfig(opts interface{}) *FeeQuoterInterface_GetStaticConfig_Call { + return &FeeQuoterInterface_GetStaticConfig_Call{Call: _e.mock.On("GetStaticConfig", opts)} +} + +func (_c *FeeQuoterInterface_GetStaticConfig_Call) Run(run func(opts *bind.CallOpts)) *FeeQuoterInterface_GetStaticConfig_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *FeeQuoterInterface_GetStaticConfig_Call) Return(_a0 fee_quoter.FeeQuoterStaticConfig, _a1 error) *FeeQuoterInterface_GetStaticConfig_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FeeQuoterInterface_GetStaticConfig_Call) RunAndReturn(run func(*bind.CallOpts) (fee_quoter.FeeQuoterStaticConfig, error)) *FeeQuoterInterface_GetStaticConfig_Call { + _c.Call.Return(run) + return _c +} + +// GetTokenAndGasPrices provides a mock function with given fields: opts, token, destChainSelector +func (_m *FeeQuoterInterface) GetTokenAndGasPrices(opts *bind.CallOpts, token common.Address, destChainSelector uint64) (fee_quoter.GetTokenAndGasPrices, error) { + ret := _m.Called(opts, token, destChainSelector) + + if len(ret) == 0 { + panic("no return value specified for GetTokenAndGasPrices") + } + + var r0 fee_quoter.GetTokenAndGasPrices + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts, common.Address, uint64) (fee_quoter.GetTokenAndGasPrices, error)); ok { + return rf(opts, token, destChainSelector) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts, common.Address, uint64) fee_quoter.GetTokenAndGasPrices); ok { + r0 = rf(opts, token, destChainSelector) + } else { + r0 = ret.Get(0).(fee_quoter.GetTokenAndGasPrices) + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts, common.Address, uint64) error); ok { + r1 = rf(opts, token, destChainSelector) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// FeeQuoterInterface_GetTokenAndGasPrices_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetTokenAndGasPrices' +type FeeQuoterInterface_GetTokenAndGasPrices_Call struct { + *mock.Call +} + +// GetTokenAndGasPrices is a helper method to define mock.On call +// - opts *bind.CallOpts +// - token common.Address +// - destChainSelector uint64 +func (_e *FeeQuoterInterface_Expecter) GetTokenAndGasPrices(opts interface{}, token interface{}, destChainSelector interface{}) *FeeQuoterInterface_GetTokenAndGasPrices_Call { + return &FeeQuoterInterface_GetTokenAndGasPrices_Call{Call: _e.mock.On("GetTokenAndGasPrices", opts, token, destChainSelector)} +} + +func (_c *FeeQuoterInterface_GetTokenAndGasPrices_Call) Run(run func(opts *bind.CallOpts, token common.Address, destChainSelector uint64)) *FeeQuoterInterface_GetTokenAndGasPrices_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts), args[1].(common.Address), args[2].(uint64)) + }) + return _c +} + +func (_c *FeeQuoterInterface_GetTokenAndGasPrices_Call) Return(_a0 fee_quoter.GetTokenAndGasPrices, _a1 error) *FeeQuoterInterface_GetTokenAndGasPrices_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FeeQuoterInterface_GetTokenAndGasPrices_Call) RunAndReturn(run func(*bind.CallOpts, common.Address, uint64) (fee_quoter.GetTokenAndGasPrices, error)) *FeeQuoterInterface_GetTokenAndGasPrices_Call { + _c.Call.Return(run) + return _c +} + +// GetTokenPrice provides a mock function with given fields: opts, token +func (_m *FeeQuoterInterface) GetTokenPrice(opts *bind.CallOpts, token common.Address) (fee_quoter.InternalTimestampedPackedUint224, error) { + ret := _m.Called(opts, token) + + if len(ret) == 0 { + panic("no return value specified for GetTokenPrice") + } + + var r0 fee_quoter.InternalTimestampedPackedUint224 + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts, common.Address) (fee_quoter.InternalTimestampedPackedUint224, error)); ok { + return rf(opts, token) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts, common.Address) fee_quoter.InternalTimestampedPackedUint224); ok { + r0 = rf(opts, token) + } else { + r0 = ret.Get(0).(fee_quoter.InternalTimestampedPackedUint224) + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts, common.Address) error); ok { + r1 = rf(opts, token) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// FeeQuoterInterface_GetTokenPrice_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetTokenPrice' +type FeeQuoterInterface_GetTokenPrice_Call struct { + *mock.Call +} + +// GetTokenPrice is a helper method to define mock.On call +// - opts *bind.CallOpts +// - token common.Address +func (_e *FeeQuoterInterface_Expecter) GetTokenPrice(opts interface{}, token interface{}) *FeeQuoterInterface_GetTokenPrice_Call { + return &FeeQuoterInterface_GetTokenPrice_Call{Call: _e.mock.On("GetTokenPrice", opts, token)} +} + +func (_c *FeeQuoterInterface_GetTokenPrice_Call) Run(run func(opts *bind.CallOpts, token common.Address)) *FeeQuoterInterface_GetTokenPrice_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts), args[1].(common.Address)) + }) + return _c +} + +func (_c *FeeQuoterInterface_GetTokenPrice_Call) Return(_a0 fee_quoter.InternalTimestampedPackedUint224, _a1 error) *FeeQuoterInterface_GetTokenPrice_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FeeQuoterInterface_GetTokenPrice_Call) RunAndReturn(run func(*bind.CallOpts, common.Address) (fee_quoter.InternalTimestampedPackedUint224, error)) *FeeQuoterInterface_GetTokenPrice_Call { + _c.Call.Return(run) + return _c +} + +// GetTokenPriceFeedConfig provides a mock function with given fields: opts, token +func (_m *FeeQuoterInterface) GetTokenPriceFeedConfig(opts *bind.CallOpts, token common.Address) (fee_quoter.IFeeQuoterTokenPriceFeedConfig, error) { + ret := _m.Called(opts, token) + + if len(ret) == 0 { + panic("no return value specified for GetTokenPriceFeedConfig") + } + + var r0 fee_quoter.IFeeQuoterTokenPriceFeedConfig + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts, common.Address) (fee_quoter.IFeeQuoterTokenPriceFeedConfig, error)); ok { + return rf(opts, token) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts, common.Address) fee_quoter.IFeeQuoterTokenPriceFeedConfig); ok { + r0 = rf(opts, token) + } else { + r0 = ret.Get(0).(fee_quoter.IFeeQuoterTokenPriceFeedConfig) + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts, common.Address) error); ok { + r1 = rf(opts, token) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// FeeQuoterInterface_GetTokenPriceFeedConfig_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetTokenPriceFeedConfig' +type FeeQuoterInterface_GetTokenPriceFeedConfig_Call struct { + *mock.Call +} + +// GetTokenPriceFeedConfig is a helper method to define mock.On call +// - opts *bind.CallOpts +// - token common.Address +func (_e *FeeQuoterInterface_Expecter) GetTokenPriceFeedConfig(opts interface{}, token interface{}) *FeeQuoterInterface_GetTokenPriceFeedConfig_Call { + return &FeeQuoterInterface_GetTokenPriceFeedConfig_Call{Call: _e.mock.On("GetTokenPriceFeedConfig", opts, token)} +} + +func (_c *FeeQuoterInterface_GetTokenPriceFeedConfig_Call) Run(run func(opts *bind.CallOpts, token common.Address)) *FeeQuoterInterface_GetTokenPriceFeedConfig_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts), args[1].(common.Address)) + }) + return _c +} + +func (_c *FeeQuoterInterface_GetTokenPriceFeedConfig_Call) Return(_a0 fee_quoter.IFeeQuoterTokenPriceFeedConfig, _a1 error) *FeeQuoterInterface_GetTokenPriceFeedConfig_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FeeQuoterInterface_GetTokenPriceFeedConfig_Call) RunAndReturn(run func(*bind.CallOpts, common.Address) (fee_quoter.IFeeQuoterTokenPriceFeedConfig, error)) *FeeQuoterInterface_GetTokenPriceFeedConfig_Call { + _c.Call.Return(run) + return _c +} + +// GetTokenPrices provides a mock function with given fields: opts, tokens +func (_m *FeeQuoterInterface) GetTokenPrices(opts *bind.CallOpts, tokens []common.Address) ([]fee_quoter.InternalTimestampedPackedUint224, error) { + ret := _m.Called(opts, tokens) + + if len(ret) == 0 { + panic("no return value specified for GetTokenPrices") + } + + var r0 []fee_quoter.InternalTimestampedPackedUint224 + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts, []common.Address) ([]fee_quoter.InternalTimestampedPackedUint224, error)); ok { + return rf(opts, tokens) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts, []common.Address) []fee_quoter.InternalTimestampedPackedUint224); ok { + r0 = rf(opts, tokens) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]fee_quoter.InternalTimestampedPackedUint224) + } + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts, []common.Address) error); ok { + r1 = rf(opts, tokens) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// FeeQuoterInterface_GetTokenPrices_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetTokenPrices' +type FeeQuoterInterface_GetTokenPrices_Call struct { + *mock.Call +} + +// GetTokenPrices is a helper method to define mock.On call +// - opts *bind.CallOpts +// - tokens []common.Address +func (_e *FeeQuoterInterface_Expecter) GetTokenPrices(opts interface{}, tokens interface{}) *FeeQuoterInterface_GetTokenPrices_Call { + return &FeeQuoterInterface_GetTokenPrices_Call{Call: _e.mock.On("GetTokenPrices", opts, tokens)} +} + +func (_c *FeeQuoterInterface_GetTokenPrices_Call) Run(run func(opts *bind.CallOpts, tokens []common.Address)) *FeeQuoterInterface_GetTokenPrices_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts), args[1].([]common.Address)) + }) + return _c +} + +func (_c *FeeQuoterInterface_GetTokenPrices_Call) Return(_a0 []fee_quoter.InternalTimestampedPackedUint224, _a1 error) *FeeQuoterInterface_GetTokenPrices_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FeeQuoterInterface_GetTokenPrices_Call) RunAndReturn(run func(*bind.CallOpts, []common.Address) ([]fee_quoter.InternalTimestampedPackedUint224, error)) *FeeQuoterInterface_GetTokenPrices_Call { + _c.Call.Return(run) + return _c +} + +// GetTokenTransferFeeConfig provides a mock function with given fields: opts, destChainSelector, token +func (_m *FeeQuoterInterface) GetTokenTransferFeeConfig(opts *bind.CallOpts, destChainSelector uint64, token common.Address) (fee_quoter.FeeQuoterTokenTransferFeeConfig, error) { + ret := _m.Called(opts, destChainSelector, token) + + if len(ret) == 0 { + panic("no return value specified for GetTokenTransferFeeConfig") + } + + var r0 fee_quoter.FeeQuoterTokenTransferFeeConfig + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts, uint64, common.Address) (fee_quoter.FeeQuoterTokenTransferFeeConfig, error)); ok { + return rf(opts, destChainSelector, token) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts, uint64, common.Address) fee_quoter.FeeQuoterTokenTransferFeeConfig); ok { + r0 = rf(opts, destChainSelector, token) + } else { + r0 = ret.Get(0).(fee_quoter.FeeQuoterTokenTransferFeeConfig) + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts, uint64, common.Address) error); ok { + r1 = rf(opts, destChainSelector, token) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// FeeQuoterInterface_GetTokenTransferFeeConfig_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetTokenTransferFeeConfig' +type FeeQuoterInterface_GetTokenTransferFeeConfig_Call struct { + *mock.Call +} + +// GetTokenTransferFeeConfig is a helper method to define mock.On call +// - opts *bind.CallOpts +// - destChainSelector uint64 +// - token common.Address +func (_e *FeeQuoterInterface_Expecter) GetTokenTransferFeeConfig(opts interface{}, destChainSelector interface{}, token interface{}) *FeeQuoterInterface_GetTokenTransferFeeConfig_Call { + return &FeeQuoterInterface_GetTokenTransferFeeConfig_Call{Call: _e.mock.On("GetTokenTransferFeeConfig", opts, destChainSelector, token)} +} + +func (_c *FeeQuoterInterface_GetTokenTransferFeeConfig_Call) Run(run func(opts *bind.CallOpts, destChainSelector uint64, token common.Address)) *FeeQuoterInterface_GetTokenTransferFeeConfig_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts), args[1].(uint64), args[2].(common.Address)) + }) + return _c +} + +func (_c *FeeQuoterInterface_GetTokenTransferFeeConfig_Call) Return(_a0 fee_quoter.FeeQuoterTokenTransferFeeConfig, _a1 error) *FeeQuoterInterface_GetTokenTransferFeeConfig_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FeeQuoterInterface_GetTokenTransferFeeConfig_Call) RunAndReturn(run func(*bind.CallOpts, uint64, common.Address) (fee_quoter.FeeQuoterTokenTransferFeeConfig, error)) *FeeQuoterInterface_GetTokenTransferFeeConfig_Call { + _c.Call.Return(run) + return _c +} + +// GetValidatedFee provides a mock function with given fields: opts, destChainSelector, message +func (_m *FeeQuoterInterface) GetValidatedFee(opts *bind.CallOpts, destChainSelector uint64, message fee_quoter.ClientEVM2AnyMessage) (*big.Int, error) { + ret := _m.Called(opts, destChainSelector, message) + + if len(ret) == 0 { + panic("no return value specified for GetValidatedFee") + } + + var r0 *big.Int + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts, uint64, fee_quoter.ClientEVM2AnyMessage) (*big.Int, error)); ok { + return rf(opts, destChainSelector, message) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts, uint64, fee_quoter.ClientEVM2AnyMessage) *big.Int); ok { + r0 = rf(opts, destChainSelector, message) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*big.Int) + } + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts, uint64, fee_quoter.ClientEVM2AnyMessage) error); ok { + r1 = rf(opts, destChainSelector, message) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// FeeQuoterInterface_GetValidatedFee_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetValidatedFee' +type FeeQuoterInterface_GetValidatedFee_Call struct { + *mock.Call +} + +// GetValidatedFee is a helper method to define mock.On call +// - opts *bind.CallOpts +// - destChainSelector uint64 +// - message fee_quoter.ClientEVM2AnyMessage +func (_e *FeeQuoterInterface_Expecter) GetValidatedFee(opts interface{}, destChainSelector interface{}, message interface{}) *FeeQuoterInterface_GetValidatedFee_Call { + return &FeeQuoterInterface_GetValidatedFee_Call{Call: _e.mock.On("GetValidatedFee", opts, destChainSelector, message)} +} + +func (_c *FeeQuoterInterface_GetValidatedFee_Call) Run(run func(opts *bind.CallOpts, destChainSelector uint64, message fee_quoter.ClientEVM2AnyMessage)) *FeeQuoterInterface_GetValidatedFee_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts), args[1].(uint64), args[2].(fee_quoter.ClientEVM2AnyMessage)) + }) + return _c +} + +func (_c *FeeQuoterInterface_GetValidatedFee_Call) Return(_a0 *big.Int, _a1 error) *FeeQuoterInterface_GetValidatedFee_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FeeQuoterInterface_GetValidatedFee_Call) RunAndReturn(run func(*bind.CallOpts, uint64, fee_quoter.ClientEVM2AnyMessage) (*big.Int, error)) *FeeQuoterInterface_GetValidatedFee_Call { + _c.Call.Return(run) + return _c +} + +// GetValidatedTokenPrice provides a mock function with given fields: opts, token +func (_m *FeeQuoterInterface) GetValidatedTokenPrice(opts *bind.CallOpts, token common.Address) (*big.Int, error) { + ret := _m.Called(opts, token) + + if len(ret) == 0 { + panic("no return value specified for GetValidatedTokenPrice") + } + + var r0 *big.Int + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts, common.Address) (*big.Int, error)); ok { + return rf(opts, token) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts, common.Address) *big.Int); ok { + r0 = rf(opts, token) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*big.Int) + } + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts, common.Address) error); ok { + r1 = rf(opts, token) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// FeeQuoterInterface_GetValidatedTokenPrice_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetValidatedTokenPrice' +type FeeQuoterInterface_GetValidatedTokenPrice_Call struct { + *mock.Call +} + +// GetValidatedTokenPrice is a helper method to define mock.On call +// - opts *bind.CallOpts +// - token common.Address +func (_e *FeeQuoterInterface_Expecter) GetValidatedTokenPrice(opts interface{}, token interface{}) *FeeQuoterInterface_GetValidatedTokenPrice_Call { + return &FeeQuoterInterface_GetValidatedTokenPrice_Call{Call: _e.mock.On("GetValidatedTokenPrice", opts, token)} +} + +func (_c *FeeQuoterInterface_GetValidatedTokenPrice_Call) Run(run func(opts *bind.CallOpts, token common.Address)) *FeeQuoterInterface_GetValidatedTokenPrice_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts), args[1].(common.Address)) + }) + return _c +} + +func (_c *FeeQuoterInterface_GetValidatedTokenPrice_Call) Return(_a0 *big.Int, _a1 error) *FeeQuoterInterface_GetValidatedTokenPrice_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FeeQuoterInterface_GetValidatedTokenPrice_Call) RunAndReturn(run func(*bind.CallOpts, common.Address) (*big.Int, error)) *FeeQuoterInterface_GetValidatedTokenPrice_Call { + _c.Call.Return(run) + return _c +} + +// OnReport provides a mock function with given fields: opts, metadata, report +func (_m *FeeQuoterInterface) OnReport(opts *bind.TransactOpts, metadata []byte, report []byte) (*types.Transaction, error) { + ret := _m.Called(opts, metadata, report) + + if len(ret) == 0 { + panic("no return value specified for OnReport") + } + + var r0 *types.Transaction + var r1 error + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, []byte, []byte) (*types.Transaction, error)); ok { + return rf(opts, metadata, report) + } + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, []byte, []byte) *types.Transaction); ok { + r0 = rf(opts, metadata, report) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Transaction) + } + } + + if rf, ok := ret.Get(1).(func(*bind.TransactOpts, []byte, []byte) error); ok { + r1 = rf(opts, metadata, report) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// FeeQuoterInterface_OnReport_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OnReport' +type FeeQuoterInterface_OnReport_Call struct { + *mock.Call +} + +// OnReport is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - metadata []byte +// - report []byte +func (_e *FeeQuoterInterface_Expecter) OnReport(opts interface{}, metadata interface{}, report interface{}) *FeeQuoterInterface_OnReport_Call { + return &FeeQuoterInterface_OnReport_Call{Call: _e.mock.On("OnReport", opts, metadata, report)} +} + +func (_c *FeeQuoterInterface_OnReport_Call) Run(run func(opts *bind.TransactOpts, metadata []byte, report []byte)) *FeeQuoterInterface_OnReport_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].([]byte), args[2].([]byte)) + }) + return _c +} + +func (_c *FeeQuoterInterface_OnReport_Call) Return(_a0 *types.Transaction, _a1 error) *FeeQuoterInterface_OnReport_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FeeQuoterInterface_OnReport_Call) RunAndReturn(run func(*bind.TransactOpts, []byte, []byte) (*types.Transaction, error)) *FeeQuoterInterface_OnReport_Call { + _c.Call.Return(run) + return _c +} + +// Owner provides a mock function with given fields: opts +func (_m *FeeQuoterInterface) Owner(opts *bind.CallOpts) (common.Address, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for Owner") + } + + var r0 common.Address + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts) (common.Address, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts) common.Address); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Address) + } + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// FeeQuoterInterface_Owner_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Owner' +type FeeQuoterInterface_Owner_Call struct { + *mock.Call +} + +// Owner is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *FeeQuoterInterface_Expecter) Owner(opts interface{}) *FeeQuoterInterface_Owner_Call { + return &FeeQuoterInterface_Owner_Call{Call: _e.mock.On("Owner", opts)} +} + +func (_c *FeeQuoterInterface_Owner_Call) Run(run func(opts *bind.CallOpts)) *FeeQuoterInterface_Owner_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *FeeQuoterInterface_Owner_Call) Return(_a0 common.Address, _a1 error) *FeeQuoterInterface_Owner_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FeeQuoterInterface_Owner_Call) RunAndReturn(run func(*bind.CallOpts) (common.Address, error)) *FeeQuoterInterface_Owner_Call { + _c.Call.Return(run) + return _c +} + +// ParseAuthorizedCallerAdded provides a mock function with given fields: log +func (_m *FeeQuoterInterface) ParseAuthorizedCallerAdded(log types.Log) (*fee_quoter.FeeQuoterAuthorizedCallerAdded, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParseAuthorizedCallerAdded") + } + + var r0 *fee_quoter.FeeQuoterAuthorizedCallerAdded + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (*fee_quoter.FeeQuoterAuthorizedCallerAdded, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) *fee_quoter.FeeQuoterAuthorizedCallerAdded); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*fee_quoter.FeeQuoterAuthorizedCallerAdded) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// FeeQuoterInterface_ParseAuthorizedCallerAdded_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseAuthorizedCallerAdded' +type FeeQuoterInterface_ParseAuthorizedCallerAdded_Call struct { + *mock.Call +} + +// ParseAuthorizedCallerAdded is a helper method to define mock.On call +// - log types.Log +func (_e *FeeQuoterInterface_Expecter) ParseAuthorizedCallerAdded(log interface{}) *FeeQuoterInterface_ParseAuthorizedCallerAdded_Call { + return &FeeQuoterInterface_ParseAuthorizedCallerAdded_Call{Call: _e.mock.On("ParseAuthorizedCallerAdded", log)} +} + +func (_c *FeeQuoterInterface_ParseAuthorizedCallerAdded_Call) Run(run func(log types.Log)) *FeeQuoterInterface_ParseAuthorizedCallerAdded_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *FeeQuoterInterface_ParseAuthorizedCallerAdded_Call) Return(_a0 *fee_quoter.FeeQuoterAuthorizedCallerAdded, _a1 error) *FeeQuoterInterface_ParseAuthorizedCallerAdded_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FeeQuoterInterface_ParseAuthorizedCallerAdded_Call) RunAndReturn(run func(types.Log) (*fee_quoter.FeeQuoterAuthorizedCallerAdded, error)) *FeeQuoterInterface_ParseAuthorizedCallerAdded_Call { + _c.Call.Return(run) + return _c +} + +// ParseAuthorizedCallerRemoved provides a mock function with given fields: log +func (_m *FeeQuoterInterface) ParseAuthorizedCallerRemoved(log types.Log) (*fee_quoter.FeeQuoterAuthorizedCallerRemoved, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParseAuthorizedCallerRemoved") + } + + var r0 *fee_quoter.FeeQuoterAuthorizedCallerRemoved + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (*fee_quoter.FeeQuoterAuthorizedCallerRemoved, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) *fee_quoter.FeeQuoterAuthorizedCallerRemoved); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*fee_quoter.FeeQuoterAuthorizedCallerRemoved) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// FeeQuoterInterface_ParseAuthorizedCallerRemoved_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseAuthorizedCallerRemoved' +type FeeQuoterInterface_ParseAuthorizedCallerRemoved_Call struct { + *mock.Call +} + +// ParseAuthorizedCallerRemoved is a helper method to define mock.On call +// - log types.Log +func (_e *FeeQuoterInterface_Expecter) ParseAuthorizedCallerRemoved(log interface{}) *FeeQuoterInterface_ParseAuthorizedCallerRemoved_Call { + return &FeeQuoterInterface_ParseAuthorizedCallerRemoved_Call{Call: _e.mock.On("ParseAuthorizedCallerRemoved", log)} +} + +func (_c *FeeQuoterInterface_ParseAuthorizedCallerRemoved_Call) Run(run func(log types.Log)) *FeeQuoterInterface_ParseAuthorizedCallerRemoved_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *FeeQuoterInterface_ParseAuthorizedCallerRemoved_Call) Return(_a0 *fee_quoter.FeeQuoterAuthorizedCallerRemoved, _a1 error) *FeeQuoterInterface_ParseAuthorizedCallerRemoved_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FeeQuoterInterface_ParseAuthorizedCallerRemoved_Call) RunAndReturn(run func(types.Log) (*fee_quoter.FeeQuoterAuthorizedCallerRemoved, error)) *FeeQuoterInterface_ParseAuthorizedCallerRemoved_Call { + _c.Call.Return(run) + return _c +} + +// ParseDestChainAdded provides a mock function with given fields: log +func (_m *FeeQuoterInterface) ParseDestChainAdded(log types.Log) (*fee_quoter.FeeQuoterDestChainAdded, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParseDestChainAdded") + } + + var r0 *fee_quoter.FeeQuoterDestChainAdded + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (*fee_quoter.FeeQuoterDestChainAdded, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) *fee_quoter.FeeQuoterDestChainAdded); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*fee_quoter.FeeQuoterDestChainAdded) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// FeeQuoterInterface_ParseDestChainAdded_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseDestChainAdded' +type FeeQuoterInterface_ParseDestChainAdded_Call struct { + *mock.Call +} + +// ParseDestChainAdded is a helper method to define mock.On call +// - log types.Log +func (_e *FeeQuoterInterface_Expecter) ParseDestChainAdded(log interface{}) *FeeQuoterInterface_ParseDestChainAdded_Call { + return &FeeQuoterInterface_ParseDestChainAdded_Call{Call: _e.mock.On("ParseDestChainAdded", log)} +} + +func (_c *FeeQuoterInterface_ParseDestChainAdded_Call) Run(run func(log types.Log)) *FeeQuoterInterface_ParseDestChainAdded_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *FeeQuoterInterface_ParseDestChainAdded_Call) Return(_a0 *fee_quoter.FeeQuoterDestChainAdded, _a1 error) *FeeQuoterInterface_ParseDestChainAdded_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FeeQuoterInterface_ParseDestChainAdded_Call) RunAndReturn(run func(types.Log) (*fee_quoter.FeeQuoterDestChainAdded, error)) *FeeQuoterInterface_ParseDestChainAdded_Call { + _c.Call.Return(run) + return _c +} + +// ParseDestChainConfigUpdated provides a mock function with given fields: log +func (_m *FeeQuoterInterface) ParseDestChainConfigUpdated(log types.Log) (*fee_quoter.FeeQuoterDestChainConfigUpdated, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParseDestChainConfigUpdated") + } + + var r0 *fee_quoter.FeeQuoterDestChainConfigUpdated + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (*fee_quoter.FeeQuoterDestChainConfigUpdated, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) *fee_quoter.FeeQuoterDestChainConfigUpdated); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*fee_quoter.FeeQuoterDestChainConfigUpdated) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// FeeQuoterInterface_ParseDestChainConfigUpdated_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseDestChainConfigUpdated' +type FeeQuoterInterface_ParseDestChainConfigUpdated_Call struct { + *mock.Call +} + +// ParseDestChainConfigUpdated is a helper method to define mock.On call +// - log types.Log +func (_e *FeeQuoterInterface_Expecter) ParseDestChainConfigUpdated(log interface{}) *FeeQuoterInterface_ParseDestChainConfigUpdated_Call { + return &FeeQuoterInterface_ParseDestChainConfigUpdated_Call{Call: _e.mock.On("ParseDestChainConfigUpdated", log)} +} + +func (_c *FeeQuoterInterface_ParseDestChainConfigUpdated_Call) Run(run func(log types.Log)) *FeeQuoterInterface_ParseDestChainConfigUpdated_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *FeeQuoterInterface_ParseDestChainConfigUpdated_Call) Return(_a0 *fee_quoter.FeeQuoterDestChainConfigUpdated, _a1 error) *FeeQuoterInterface_ParseDestChainConfigUpdated_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FeeQuoterInterface_ParseDestChainConfigUpdated_Call) RunAndReturn(run func(types.Log) (*fee_quoter.FeeQuoterDestChainConfigUpdated, error)) *FeeQuoterInterface_ParseDestChainConfigUpdated_Call { + _c.Call.Return(run) + return _c +} + +// ParseFeeTokenAdded provides a mock function with given fields: log +func (_m *FeeQuoterInterface) ParseFeeTokenAdded(log types.Log) (*fee_quoter.FeeQuoterFeeTokenAdded, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParseFeeTokenAdded") + } + + var r0 *fee_quoter.FeeQuoterFeeTokenAdded + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (*fee_quoter.FeeQuoterFeeTokenAdded, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) *fee_quoter.FeeQuoterFeeTokenAdded); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*fee_quoter.FeeQuoterFeeTokenAdded) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// FeeQuoterInterface_ParseFeeTokenAdded_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseFeeTokenAdded' +type FeeQuoterInterface_ParseFeeTokenAdded_Call struct { + *mock.Call +} + +// ParseFeeTokenAdded is a helper method to define mock.On call +// - log types.Log +func (_e *FeeQuoterInterface_Expecter) ParseFeeTokenAdded(log interface{}) *FeeQuoterInterface_ParseFeeTokenAdded_Call { + return &FeeQuoterInterface_ParseFeeTokenAdded_Call{Call: _e.mock.On("ParseFeeTokenAdded", log)} +} + +func (_c *FeeQuoterInterface_ParseFeeTokenAdded_Call) Run(run func(log types.Log)) *FeeQuoterInterface_ParseFeeTokenAdded_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *FeeQuoterInterface_ParseFeeTokenAdded_Call) Return(_a0 *fee_quoter.FeeQuoterFeeTokenAdded, _a1 error) *FeeQuoterInterface_ParseFeeTokenAdded_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FeeQuoterInterface_ParseFeeTokenAdded_Call) RunAndReturn(run func(types.Log) (*fee_quoter.FeeQuoterFeeTokenAdded, error)) *FeeQuoterInterface_ParseFeeTokenAdded_Call { + _c.Call.Return(run) + return _c +} + +// ParseFeeTokenRemoved provides a mock function with given fields: log +func (_m *FeeQuoterInterface) ParseFeeTokenRemoved(log types.Log) (*fee_quoter.FeeQuoterFeeTokenRemoved, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParseFeeTokenRemoved") + } + + var r0 *fee_quoter.FeeQuoterFeeTokenRemoved + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (*fee_quoter.FeeQuoterFeeTokenRemoved, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) *fee_quoter.FeeQuoterFeeTokenRemoved); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*fee_quoter.FeeQuoterFeeTokenRemoved) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// FeeQuoterInterface_ParseFeeTokenRemoved_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseFeeTokenRemoved' +type FeeQuoterInterface_ParseFeeTokenRemoved_Call struct { + *mock.Call +} + +// ParseFeeTokenRemoved is a helper method to define mock.On call +// - log types.Log +func (_e *FeeQuoterInterface_Expecter) ParseFeeTokenRemoved(log interface{}) *FeeQuoterInterface_ParseFeeTokenRemoved_Call { + return &FeeQuoterInterface_ParseFeeTokenRemoved_Call{Call: _e.mock.On("ParseFeeTokenRemoved", log)} +} + +func (_c *FeeQuoterInterface_ParseFeeTokenRemoved_Call) Run(run func(log types.Log)) *FeeQuoterInterface_ParseFeeTokenRemoved_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *FeeQuoterInterface_ParseFeeTokenRemoved_Call) Return(_a0 *fee_quoter.FeeQuoterFeeTokenRemoved, _a1 error) *FeeQuoterInterface_ParseFeeTokenRemoved_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FeeQuoterInterface_ParseFeeTokenRemoved_Call) RunAndReturn(run func(types.Log) (*fee_quoter.FeeQuoterFeeTokenRemoved, error)) *FeeQuoterInterface_ParseFeeTokenRemoved_Call { + _c.Call.Return(run) + return _c +} + +// ParseLog provides a mock function with given fields: log +func (_m *FeeQuoterInterface) ParseLog(log types.Log) (generated.AbigenLog, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParseLog") + } + + var r0 generated.AbigenLog + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (generated.AbigenLog, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) generated.AbigenLog); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(generated.AbigenLog) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// FeeQuoterInterface_ParseLog_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseLog' +type FeeQuoterInterface_ParseLog_Call struct { + *mock.Call +} + +// ParseLog is a helper method to define mock.On call +// - log types.Log +func (_e *FeeQuoterInterface_Expecter) ParseLog(log interface{}) *FeeQuoterInterface_ParseLog_Call { + return &FeeQuoterInterface_ParseLog_Call{Call: _e.mock.On("ParseLog", log)} +} + +func (_c *FeeQuoterInterface_ParseLog_Call) Run(run func(log types.Log)) *FeeQuoterInterface_ParseLog_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *FeeQuoterInterface_ParseLog_Call) Return(_a0 generated.AbigenLog, _a1 error) *FeeQuoterInterface_ParseLog_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FeeQuoterInterface_ParseLog_Call) RunAndReturn(run func(types.Log) (generated.AbigenLog, error)) *FeeQuoterInterface_ParseLog_Call { + _c.Call.Return(run) + return _c +} + +// ParseOwnershipTransferRequested provides a mock function with given fields: log +func (_m *FeeQuoterInterface) ParseOwnershipTransferRequested(log types.Log) (*fee_quoter.FeeQuoterOwnershipTransferRequested, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParseOwnershipTransferRequested") + } + + var r0 *fee_quoter.FeeQuoterOwnershipTransferRequested + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (*fee_quoter.FeeQuoterOwnershipTransferRequested, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) *fee_quoter.FeeQuoterOwnershipTransferRequested); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*fee_quoter.FeeQuoterOwnershipTransferRequested) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// FeeQuoterInterface_ParseOwnershipTransferRequested_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseOwnershipTransferRequested' +type FeeQuoterInterface_ParseOwnershipTransferRequested_Call struct { + *mock.Call +} + +// ParseOwnershipTransferRequested is a helper method to define mock.On call +// - log types.Log +func (_e *FeeQuoterInterface_Expecter) ParseOwnershipTransferRequested(log interface{}) *FeeQuoterInterface_ParseOwnershipTransferRequested_Call { + return &FeeQuoterInterface_ParseOwnershipTransferRequested_Call{Call: _e.mock.On("ParseOwnershipTransferRequested", log)} +} + +func (_c *FeeQuoterInterface_ParseOwnershipTransferRequested_Call) Run(run func(log types.Log)) *FeeQuoterInterface_ParseOwnershipTransferRequested_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *FeeQuoterInterface_ParseOwnershipTransferRequested_Call) Return(_a0 *fee_quoter.FeeQuoterOwnershipTransferRequested, _a1 error) *FeeQuoterInterface_ParseOwnershipTransferRequested_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FeeQuoterInterface_ParseOwnershipTransferRequested_Call) RunAndReturn(run func(types.Log) (*fee_quoter.FeeQuoterOwnershipTransferRequested, error)) *FeeQuoterInterface_ParseOwnershipTransferRequested_Call { + _c.Call.Return(run) + return _c +} + +// ParseOwnershipTransferred provides a mock function with given fields: log +func (_m *FeeQuoterInterface) ParseOwnershipTransferred(log types.Log) (*fee_quoter.FeeQuoterOwnershipTransferred, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParseOwnershipTransferred") + } + + var r0 *fee_quoter.FeeQuoterOwnershipTransferred + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (*fee_quoter.FeeQuoterOwnershipTransferred, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) *fee_quoter.FeeQuoterOwnershipTransferred); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*fee_quoter.FeeQuoterOwnershipTransferred) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// FeeQuoterInterface_ParseOwnershipTransferred_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseOwnershipTransferred' +type FeeQuoterInterface_ParseOwnershipTransferred_Call struct { + *mock.Call +} + +// ParseOwnershipTransferred is a helper method to define mock.On call +// - log types.Log +func (_e *FeeQuoterInterface_Expecter) ParseOwnershipTransferred(log interface{}) *FeeQuoterInterface_ParseOwnershipTransferred_Call { + return &FeeQuoterInterface_ParseOwnershipTransferred_Call{Call: _e.mock.On("ParseOwnershipTransferred", log)} +} + +func (_c *FeeQuoterInterface_ParseOwnershipTransferred_Call) Run(run func(log types.Log)) *FeeQuoterInterface_ParseOwnershipTransferred_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *FeeQuoterInterface_ParseOwnershipTransferred_Call) Return(_a0 *fee_quoter.FeeQuoterOwnershipTransferred, _a1 error) *FeeQuoterInterface_ParseOwnershipTransferred_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FeeQuoterInterface_ParseOwnershipTransferred_Call) RunAndReturn(run func(types.Log) (*fee_quoter.FeeQuoterOwnershipTransferred, error)) *FeeQuoterInterface_ParseOwnershipTransferred_Call { + _c.Call.Return(run) + return _c +} + +// ParsePremiumMultiplierWeiPerEthUpdated provides a mock function with given fields: log +func (_m *FeeQuoterInterface) ParsePremiumMultiplierWeiPerEthUpdated(log types.Log) (*fee_quoter.FeeQuoterPremiumMultiplierWeiPerEthUpdated, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParsePremiumMultiplierWeiPerEthUpdated") + } + + var r0 *fee_quoter.FeeQuoterPremiumMultiplierWeiPerEthUpdated + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (*fee_quoter.FeeQuoterPremiumMultiplierWeiPerEthUpdated, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) *fee_quoter.FeeQuoterPremiumMultiplierWeiPerEthUpdated); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*fee_quoter.FeeQuoterPremiumMultiplierWeiPerEthUpdated) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// FeeQuoterInterface_ParsePremiumMultiplierWeiPerEthUpdated_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParsePremiumMultiplierWeiPerEthUpdated' +type FeeQuoterInterface_ParsePremiumMultiplierWeiPerEthUpdated_Call struct { + *mock.Call +} + +// ParsePremiumMultiplierWeiPerEthUpdated is a helper method to define mock.On call +// - log types.Log +func (_e *FeeQuoterInterface_Expecter) ParsePremiumMultiplierWeiPerEthUpdated(log interface{}) *FeeQuoterInterface_ParsePremiumMultiplierWeiPerEthUpdated_Call { + return &FeeQuoterInterface_ParsePremiumMultiplierWeiPerEthUpdated_Call{Call: _e.mock.On("ParsePremiumMultiplierWeiPerEthUpdated", log)} +} + +func (_c *FeeQuoterInterface_ParsePremiumMultiplierWeiPerEthUpdated_Call) Run(run func(log types.Log)) *FeeQuoterInterface_ParsePremiumMultiplierWeiPerEthUpdated_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *FeeQuoterInterface_ParsePremiumMultiplierWeiPerEthUpdated_Call) Return(_a0 *fee_quoter.FeeQuoterPremiumMultiplierWeiPerEthUpdated, _a1 error) *FeeQuoterInterface_ParsePremiumMultiplierWeiPerEthUpdated_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FeeQuoterInterface_ParsePremiumMultiplierWeiPerEthUpdated_Call) RunAndReturn(run func(types.Log) (*fee_quoter.FeeQuoterPremiumMultiplierWeiPerEthUpdated, error)) *FeeQuoterInterface_ParsePremiumMultiplierWeiPerEthUpdated_Call { + _c.Call.Return(run) + return _c +} + +// ParsePriceFeedPerTokenUpdated provides a mock function with given fields: log +func (_m *FeeQuoterInterface) ParsePriceFeedPerTokenUpdated(log types.Log) (*fee_quoter.FeeQuoterPriceFeedPerTokenUpdated, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParsePriceFeedPerTokenUpdated") + } + + var r0 *fee_quoter.FeeQuoterPriceFeedPerTokenUpdated + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (*fee_quoter.FeeQuoterPriceFeedPerTokenUpdated, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) *fee_quoter.FeeQuoterPriceFeedPerTokenUpdated); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*fee_quoter.FeeQuoterPriceFeedPerTokenUpdated) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// FeeQuoterInterface_ParsePriceFeedPerTokenUpdated_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParsePriceFeedPerTokenUpdated' +type FeeQuoterInterface_ParsePriceFeedPerTokenUpdated_Call struct { + *mock.Call +} + +// ParsePriceFeedPerTokenUpdated is a helper method to define mock.On call +// - log types.Log +func (_e *FeeQuoterInterface_Expecter) ParsePriceFeedPerTokenUpdated(log interface{}) *FeeQuoterInterface_ParsePriceFeedPerTokenUpdated_Call { + return &FeeQuoterInterface_ParsePriceFeedPerTokenUpdated_Call{Call: _e.mock.On("ParsePriceFeedPerTokenUpdated", log)} +} + +func (_c *FeeQuoterInterface_ParsePriceFeedPerTokenUpdated_Call) Run(run func(log types.Log)) *FeeQuoterInterface_ParsePriceFeedPerTokenUpdated_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *FeeQuoterInterface_ParsePriceFeedPerTokenUpdated_Call) Return(_a0 *fee_quoter.FeeQuoterPriceFeedPerTokenUpdated, _a1 error) *FeeQuoterInterface_ParsePriceFeedPerTokenUpdated_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FeeQuoterInterface_ParsePriceFeedPerTokenUpdated_Call) RunAndReturn(run func(types.Log) (*fee_quoter.FeeQuoterPriceFeedPerTokenUpdated, error)) *FeeQuoterInterface_ParsePriceFeedPerTokenUpdated_Call { + _c.Call.Return(run) + return _c +} + +// ParseReportPermissionSet provides a mock function with given fields: log +func (_m *FeeQuoterInterface) ParseReportPermissionSet(log types.Log) (*fee_quoter.FeeQuoterReportPermissionSet, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParseReportPermissionSet") + } + + var r0 *fee_quoter.FeeQuoterReportPermissionSet + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (*fee_quoter.FeeQuoterReportPermissionSet, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) *fee_quoter.FeeQuoterReportPermissionSet); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*fee_quoter.FeeQuoterReportPermissionSet) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// FeeQuoterInterface_ParseReportPermissionSet_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseReportPermissionSet' +type FeeQuoterInterface_ParseReportPermissionSet_Call struct { + *mock.Call +} + +// ParseReportPermissionSet is a helper method to define mock.On call +// - log types.Log +func (_e *FeeQuoterInterface_Expecter) ParseReportPermissionSet(log interface{}) *FeeQuoterInterface_ParseReportPermissionSet_Call { + return &FeeQuoterInterface_ParseReportPermissionSet_Call{Call: _e.mock.On("ParseReportPermissionSet", log)} +} + +func (_c *FeeQuoterInterface_ParseReportPermissionSet_Call) Run(run func(log types.Log)) *FeeQuoterInterface_ParseReportPermissionSet_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *FeeQuoterInterface_ParseReportPermissionSet_Call) Return(_a0 *fee_quoter.FeeQuoterReportPermissionSet, _a1 error) *FeeQuoterInterface_ParseReportPermissionSet_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FeeQuoterInterface_ParseReportPermissionSet_Call) RunAndReturn(run func(types.Log) (*fee_quoter.FeeQuoterReportPermissionSet, error)) *FeeQuoterInterface_ParseReportPermissionSet_Call { + _c.Call.Return(run) + return _c +} + +// ParseTokenTransferFeeConfigDeleted provides a mock function with given fields: log +func (_m *FeeQuoterInterface) ParseTokenTransferFeeConfigDeleted(log types.Log) (*fee_quoter.FeeQuoterTokenTransferFeeConfigDeleted, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParseTokenTransferFeeConfigDeleted") + } + + var r0 *fee_quoter.FeeQuoterTokenTransferFeeConfigDeleted + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (*fee_quoter.FeeQuoterTokenTransferFeeConfigDeleted, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) *fee_quoter.FeeQuoterTokenTransferFeeConfigDeleted); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*fee_quoter.FeeQuoterTokenTransferFeeConfigDeleted) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// FeeQuoterInterface_ParseTokenTransferFeeConfigDeleted_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseTokenTransferFeeConfigDeleted' +type FeeQuoterInterface_ParseTokenTransferFeeConfigDeleted_Call struct { + *mock.Call +} + +// ParseTokenTransferFeeConfigDeleted is a helper method to define mock.On call +// - log types.Log +func (_e *FeeQuoterInterface_Expecter) ParseTokenTransferFeeConfigDeleted(log interface{}) *FeeQuoterInterface_ParseTokenTransferFeeConfigDeleted_Call { + return &FeeQuoterInterface_ParseTokenTransferFeeConfigDeleted_Call{Call: _e.mock.On("ParseTokenTransferFeeConfigDeleted", log)} +} + +func (_c *FeeQuoterInterface_ParseTokenTransferFeeConfigDeleted_Call) Run(run func(log types.Log)) *FeeQuoterInterface_ParseTokenTransferFeeConfigDeleted_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *FeeQuoterInterface_ParseTokenTransferFeeConfigDeleted_Call) Return(_a0 *fee_quoter.FeeQuoterTokenTransferFeeConfigDeleted, _a1 error) *FeeQuoterInterface_ParseTokenTransferFeeConfigDeleted_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FeeQuoterInterface_ParseTokenTransferFeeConfigDeleted_Call) RunAndReturn(run func(types.Log) (*fee_quoter.FeeQuoterTokenTransferFeeConfigDeleted, error)) *FeeQuoterInterface_ParseTokenTransferFeeConfigDeleted_Call { + _c.Call.Return(run) + return _c +} + +// ParseTokenTransferFeeConfigUpdated provides a mock function with given fields: log +func (_m *FeeQuoterInterface) ParseTokenTransferFeeConfigUpdated(log types.Log) (*fee_quoter.FeeQuoterTokenTransferFeeConfigUpdated, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParseTokenTransferFeeConfigUpdated") + } + + var r0 *fee_quoter.FeeQuoterTokenTransferFeeConfigUpdated + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (*fee_quoter.FeeQuoterTokenTransferFeeConfigUpdated, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) *fee_quoter.FeeQuoterTokenTransferFeeConfigUpdated); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*fee_quoter.FeeQuoterTokenTransferFeeConfigUpdated) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// FeeQuoterInterface_ParseTokenTransferFeeConfigUpdated_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseTokenTransferFeeConfigUpdated' +type FeeQuoterInterface_ParseTokenTransferFeeConfigUpdated_Call struct { + *mock.Call +} + +// ParseTokenTransferFeeConfigUpdated is a helper method to define mock.On call +// - log types.Log +func (_e *FeeQuoterInterface_Expecter) ParseTokenTransferFeeConfigUpdated(log interface{}) *FeeQuoterInterface_ParseTokenTransferFeeConfigUpdated_Call { + return &FeeQuoterInterface_ParseTokenTransferFeeConfigUpdated_Call{Call: _e.mock.On("ParseTokenTransferFeeConfigUpdated", log)} +} + +func (_c *FeeQuoterInterface_ParseTokenTransferFeeConfigUpdated_Call) Run(run func(log types.Log)) *FeeQuoterInterface_ParseTokenTransferFeeConfigUpdated_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *FeeQuoterInterface_ParseTokenTransferFeeConfigUpdated_Call) Return(_a0 *fee_quoter.FeeQuoterTokenTransferFeeConfigUpdated, _a1 error) *FeeQuoterInterface_ParseTokenTransferFeeConfigUpdated_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FeeQuoterInterface_ParseTokenTransferFeeConfigUpdated_Call) RunAndReturn(run func(types.Log) (*fee_quoter.FeeQuoterTokenTransferFeeConfigUpdated, error)) *FeeQuoterInterface_ParseTokenTransferFeeConfigUpdated_Call { + _c.Call.Return(run) + return _c +} + +// ParseUsdPerTokenUpdated provides a mock function with given fields: log +func (_m *FeeQuoterInterface) ParseUsdPerTokenUpdated(log types.Log) (*fee_quoter.FeeQuoterUsdPerTokenUpdated, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParseUsdPerTokenUpdated") + } + + var r0 *fee_quoter.FeeQuoterUsdPerTokenUpdated + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (*fee_quoter.FeeQuoterUsdPerTokenUpdated, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) *fee_quoter.FeeQuoterUsdPerTokenUpdated); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*fee_quoter.FeeQuoterUsdPerTokenUpdated) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// FeeQuoterInterface_ParseUsdPerTokenUpdated_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseUsdPerTokenUpdated' +type FeeQuoterInterface_ParseUsdPerTokenUpdated_Call struct { + *mock.Call +} + +// ParseUsdPerTokenUpdated is a helper method to define mock.On call +// - log types.Log +func (_e *FeeQuoterInterface_Expecter) ParseUsdPerTokenUpdated(log interface{}) *FeeQuoterInterface_ParseUsdPerTokenUpdated_Call { + return &FeeQuoterInterface_ParseUsdPerTokenUpdated_Call{Call: _e.mock.On("ParseUsdPerTokenUpdated", log)} +} + +func (_c *FeeQuoterInterface_ParseUsdPerTokenUpdated_Call) Run(run func(log types.Log)) *FeeQuoterInterface_ParseUsdPerTokenUpdated_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *FeeQuoterInterface_ParseUsdPerTokenUpdated_Call) Return(_a0 *fee_quoter.FeeQuoterUsdPerTokenUpdated, _a1 error) *FeeQuoterInterface_ParseUsdPerTokenUpdated_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FeeQuoterInterface_ParseUsdPerTokenUpdated_Call) RunAndReturn(run func(types.Log) (*fee_quoter.FeeQuoterUsdPerTokenUpdated, error)) *FeeQuoterInterface_ParseUsdPerTokenUpdated_Call { + _c.Call.Return(run) + return _c +} + +// ParseUsdPerUnitGasUpdated provides a mock function with given fields: log +func (_m *FeeQuoterInterface) ParseUsdPerUnitGasUpdated(log types.Log) (*fee_quoter.FeeQuoterUsdPerUnitGasUpdated, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParseUsdPerUnitGasUpdated") + } + + var r0 *fee_quoter.FeeQuoterUsdPerUnitGasUpdated + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (*fee_quoter.FeeQuoterUsdPerUnitGasUpdated, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) *fee_quoter.FeeQuoterUsdPerUnitGasUpdated); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*fee_quoter.FeeQuoterUsdPerUnitGasUpdated) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// FeeQuoterInterface_ParseUsdPerUnitGasUpdated_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseUsdPerUnitGasUpdated' +type FeeQuoterInterface_ParseUsdPerUnitGasUpdated_Call struct { + *mock.Call +} + +// ParseUsdPerUnitGasUpdated is a helper method to define mock.On call +// - log types.Log +func (_e *FeeQuoterInterface_Expecter) ParseUsdPerUnitGasUpdated(log interface{}) *FeeQuoterInterface_ParseUsdPerUnitGasUpdated_Call { + return &FeeQuoterInterface_ParseUsdPerUnitGasUpdated_Call{Call: _e.mock.On("ParseUsdPerUnitGasUpdated", log)} +} + +func (_c *FeeQuoterInterface_ParseUsdPerUnitGasUpdated_Call) Run(run func(log types.Log)) *FeeQuoterInterface_ParseUsdPerUnitGasUpdated_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *FeeQuoterInterface_ParseUsdPerUnitGasUpdated_Call) Return(_a0 *fee_quoter.FeeQuoterUsdPerUnitGasUpdated, _a1 error) *FeeQuoterInterface_ParseUsdPerUnitGasUpdated_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FeeQuoterInterface_ParseUsdPerUnitGasUpdated_Call) RunAndReturn(run func(types.Log) (*fee_quoter.FeeQuoterUsdPerUnitGasUpdated, error)) *FeeQuoterInterface_ParseUsdPerUnitGasUpdated_Call { + _c.Call.Return(run) + return _c +} + +// ProcessMessageArgs provides a mock function with given fields: opts, destChainSelector, feeToken, feeTokenAmount, extraArgs +func (_m *FeeQuoterInterface) ProcessMessageArgs(opts *bind.CallOpts, destChainSelector uint64, feeToken common.Address, feeTokenAmount *big.Int, extraArgs []byte) (fee_quoter.ProcessMessageArgs, error) { + ret := _m.Called(opts, destChainSelector, feeToken, feeTokenAmount, extraArgs) + + if len(ret) == 0 { + panic("no return value specified for ProcessMessageArgs") + } + + var r0 fee_quoter.ProcessMessageArgs + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts, uint64, common.Address, *big.Int, []byte) (fee_quoter.ProcessMessageArgs, error)); ok { + return rf(opts, destChainSelector, feeToken, feeTokenAmount, extraArgs) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts, uint64, common.Address, *big.Int, []byte) fee_quoter.ProcessMessageArgs); ok { + r0 = rf(opts, destChainSelector, feeToken, feeTokenAmount, extraArgs) + } else { + r0 = ret.Get(0).(fee_quoter.ProcessMessageArgs) + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts, uint64, common.Address, *big.Int, []byte) error); ok { + r1 = rf(opts, destChainSelector, feeToken, feeTokenAmount, extraArgs) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// FeeQuoterInterface_ProcessMessageArgs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ProcessMessageArgs' +type FeeQuoterInterface_ProcessMessageArgs_Call struct { + *mock.Call +} + +// ProcessMessageArgs is a helper method to define mock.On call +// - opts *bind.CallOpts +// - destChainSelector uint64 +// - feeToken common.Address +// - feeTokenAmount *big.Int +// - extraArgs []byte +func (_e *FeeQuoterInterface_Expecter) ProcessMessageArgs(opts interface{}, destChainSelector interface{}, feeToken interface{}, feeTokenAmount interface{}, extraArgs interface{}) *FeeQuoterInterface_ProcessMessageArgs_Call { + return &FeeQuoterInterface_ProcessMessageArgs_Call{Call: _e.mock.On("ProcessMessageArgs", opts, destChainSelector, feeToken, feeTokenAmount, extraArgs)} +} + +func (_c *FeeQuoterInterface_ProcessMessageArgs_Call) Run(run func(opts *bind.CallOpts, destChainSelector uint64, feeToken common.Address, feeTokenAmount *big.Int, extraArgs []byte)) *FeeQuoterInterface_ProcessMessageArgs_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts), args[1].(uint64), args[2].(common.Address), args[3].(*big.Int), args[4].([]byte)) + }) + return _c +} + +func (_c *FeeQuoterInterface_ProcessMessageArgs_Call) Return(_a0 fee_quoter.ProcessMessageArgs, _a1 error) *FeeQuoterInterface_ProcessMessageArgs_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FeeQuoterInterface_ProcessMessageArgs_Call) RunAndReturn(run func(*bind.CallOpts, uint64, common.Address, *big.Int, []byte) (fee_quoter.ProcessMessageArgs, error)) *FeeQuoterInterface_ProcessMessageArgs_Call { + _c.Call.Return(run) + return _c +} + +// ProcessPoolReturnData provides a mock function with given fields: opts, destChainSelector, rampTokenAmounts, sourceTokenAmounts +func (_m *FeeQuoterInterface) ProcessPoolReturnData(opts *bind.CallOpts, destChainSelector uint64, rampTokenAmounts []fee_quoter.InternalRampTokenAmount, sourceTokenAmounts []fee_quoter.ClientEVMTokenAmount) ([][]byte, error) { + ret := _m.Called(opts, destChainSelector, rampTokenAmounts, sourceTokenAmounts) + + if len(ret) == 0 { + panic("no return value specified for ProcessPoolReturnData") + } + + var r0 [][]byte + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts, uint64, []fee_quoter.InternalRampTokenAmount, []fee_quoter.ClientEVMTokenAmount) ([][]byte, error)); ok { + return rf(opts, destChainSelector, rampTokenAmounts, sourceTokenAmounts) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts, uint64, []fee_quoter.InternalRampTokenAmount, []fee_quoter.ClientEVMTokenAmount) [][]byte); ok { + r0 = rf(opts, destChainSelector, rampTokenAmounts, sourceTokenAmounts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([][]byte) + } + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts, uint64, []fee_quoter.InternalRampTokenAmount, []fee_quoter.ClientEVMTokenAmount) error); ok { + r1 = rf(opts, destChainSelector, rampTokenAmounts, sourceTokenAmounts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// FeeQuoterInterface_ProcessPoolReturnData_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ProcessPoolReturnData' +type FeeQuoterInterface_ProcessPoolReturnData_Call struct { + *mock.Call +} + +// ProcessPoolReturnData is a helper method to define mock.On call +// - opts *bind.CallOpts +// - destChainSelector uint64 +// - rampTokenAmounts []fee_quoter.InternalRampTokenAmount +// - sourceTokenAmounts []fee_quoter.ClientEVMTokenAmount +func (_e *FeeQuoterInterface_Expecter) ProcessPoolReturnData(opts interface{}, destChainSelector interface{}, rampTokenAmounts interface{}, sourceTokenAmounts interface{}) *FeeQuoterInterface_ProcessPoolReturnData_Call { + return &FeeQuoterInterface_ProcessPoolReturnData_Call{Call: _e.mock.On("ProcessPoolReturnData", opts, destChainSelector, rampTokenAmounts, sourceTokenAmounts)} +} + +func (_c *FeeQuoterInterface_ProcessPoolReturnData_Call) Run(run func(opts *bind.CallOpts, destChainSelector uint64, rampTokenAmounts []fee_quoter.InternalRampTokenAmount, sourceTokenAmounts []fee_quoter.ClientEVMTokenAmount)) *FeeQuoterInterface_ProcessPoolReturnData_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts), args[1].(uint64), args[2].([]fee_quoter.InternalRampTokenAmount), args[3].([]fee_quoter.ClientEVMTokenAmount)) + }) + return _c +} + +func (_c *FeeQuoterInterface_ProcessPoolReturnData_Call) Return(_a0 [][]byte, _a1 error) *FeeQuoterInterface_ProcessPoolReturnData_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FeeQuoterInterface_ProcessPoolReturnData_Call) RunAndReturn(run func(*bind.CallOpts, uint64, []fee_quoter.InternalRampTokenAmount, []fee_quoter.ClientEVMTokenAmount) ([][]byte, error)) *FeeQuoterInterface_ProcessPoolReturnData_Call { + _c.Call.Return(run) + return _c +} + +// SetReportPermissions provides a mock function with given fields: opts, permissions +func (_m *FeeQuoterInterface) SetReportPermissions(opts *bind.TransactOpts, permissions []fee_quoter.KeystoneFeedsPermissionHandlerPermission) (*types.Transaction, error) { + ret := _m.Called(opts, permissions) + + if len(ret) == 0 { + panic("no return value specified for SetReportPermissions") + } + + var r0 *types.Transaction + var r1 error + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, []fee_quoter.KeystoneFeedsPermissionHandlerPermission) (*types.Transaction, error)); ok { + return rf(opts, permissions) + } + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, []fee_quoter.KeystoneFeedsPermissionHandlerPermission) *types.Transaction); ok { + r0 = rf(opts, permissions) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Transaction) + } + } + + if rf, ok := ret.Get(1).(func(*bind.TransactOpts, []fee_quoter.KeystoneFeedsPermissionHandlerPermission) error); ok { + r1 = rf(opts, permissions) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// FeeQuoterInterface_SetReportPermissions_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetReportPermissions' +type FeeQuoterInterface_SetReportPermissions_Call struct { + *mock.Call +} + +// SetReportPermissions is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - permissions []fee_quoter.KeystoneFeedsPermissionHandlerPermission +func (_e *FeeQuoterInterface_Expecter) SetReportPermissions(opts interface{}, permissions interface{}) *FeeQuoterInterface_SetReportPermissions_Call { + return &FeeQuoterInterface_SetReportPermissions_Call{Call: _e.mock.On("SetReportPermissions", opts, permissions)} +} + +func (_c *FeeQuoterInterface_SetReportPermissions_Call) Run(run func(opts *bind.TransactOpts, permissions []fee_quoter.KeystoneFeedsPermissionHandlerPermission)) *FeeQuoterInterface_SetReportPermissions_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].([]fee_quoter.KeystoneFeedsPermissionHandlerPermission)) + }) + return _c +} + +func (_c *FeeQuoterInterface_SetReportPermissions_Call) Return(_a0 *types.Transaction, _a1 error) *FeeQuoterInterface_SetReportPermissions_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FeeQuoterInterface_SetReportPermissions_Call) RunAndReturn(run func(*bind.TransactOpts, []fee_quoter.KeystoneFeedsPermissionHandlerPermission) (*types.Transaction, error)) *FeeQuoterInterface_SetReportPermissions_Call { + _c.Call.Return(run) + return _c +} + +// TransferOwnership provides a mock function with given fields: opts, to +func (_m *FeeQuoterInterface) TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) { + ret := _m.Called(opts, to) + + if len(ret) == 0 { + panic("no return value specified for TransferOwnership") + } + + var r0 *types.Transaction + var r1 error + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, common.Address) (*types.Transaction, error)); ok { + return rf(opts, to) + } + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, common.Address) *types.Transaction); ok { + r0 = rf(opts, to) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Transaction) + } + } + + if rf, ok := ret.Get(1).(func(*bind.TransactOpts, common.Address) error); ok { + r1 = rf(opts, to) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// FeeQuoterInterface_TransferOwnership_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TransferOwnership' +type FeeQuoterInterface_TransferOwnership_Call struct { + *mock.Call +} + +// TransferOwnership is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - to common.Address +func (_e *FeeQuoterInterface_Expecter) TransferOwnership(opts interface{}, to interface{}) *FeeQuoterInterface_TransferOwnership_Call { + return &FeeQuoterInterface_TransferOwnership_Call{Call: _e.mock.On("TransferOwnership", opts, to)} +} + +func (_c *FeeQuoterInterface_TransferOwnership_Call) Run(run func(opts *bind.TransactOpts, to common.Address)) *FeeQuoterInterface_TransferOwnership_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].(common.Address)) + }) + return _c +} + +func (_c *FeeQuoterInterface_TransferOwnership_Call) Return(_a0 *types.Transaction, _a1 error) *FeeQuoterInterface_TransferOwnership_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FeeQuoterInterface_TransferOwnership_Call) RunAndReturn(run func(*bind.TransactOpts, common.Address) (*types.Transaction, error)) *FeeQuoterInterface_TransferOwnership_Call { + _c.Call.Return(run) + return _c +} + +// TypeAndVersion provides a mock function with given fields: opts +func (_m *FeeQuoterInterface) TypeAndVersion(opts *bind.CallOpts) (string, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for TypeAndVersion") + } + + var r0 string + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts) (string, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts) string); ok { + r0 = rf(opts) + } else { + r0 = ret.Get(0).(string) + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// FeeQuoterInterface_TypeAndVersion_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TypeAndVersion' +type FeeQuoterInterface_TypeAndVersion_Call struct { + *mock.Call +} + +// TypeAndVersion is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *FeeQuoterInterface_Expecter) TypeAndVersion(opts interface{}) *FeeQuoterInterface_TypeAndVersion_Call { + return &FeeQuoterInterface_TypeAndVersion_Call{Call: _e.mock.On("TypeAndVersion", opts)} +} + +func (_c *FeeQuoterInterface_TypeAndVersion_Call) Run(run func(opts *bind.CallOpts)) *FeeQuoterInterface_TypeAndVersion_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *FeeQuoterInterface_TypeAndVersion_Call) Return(_a0 string, _a1 error) *FeeQuoterInterface_TypeAndVersion_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FeeQuoterInterface_TypeAndVersion_Call) RunAndReturn(run func(*bind.CallOpts) (string, error)) *FeeQuoterInterface_TypeAndVersion_Call { + _c.Call.Return(run) + return _c +} + +// UpdatePrices provides a mock function with given fields: opts, priceUpdates +func (_m *FeeQuoterInterface) UpdatePrices(opts *bind.TransactOpts, priceUpdates fee_quoter.InternalPriceUpdates) (*types.Transaction, error) { + ret := _m.Called(opts, priceUpdates) + + if len(ret) == 0 { + panic("no return value specified for UpdatePrices") + } + + var r0 *types.Transaction + var r1 error + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, fee_quoter.InternalPriceUpdates) (*types.Transaction, error)); ok { + return rf(opts, priceUpdates) + } + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, fee_quoter.InternalPriceUpdates) *types.Transaction); ok { + r0 = rf(opts, priceUpdates) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Transaction) + } + } + + if rf, ok := ret.Get(1).(func(*bind.TransactOpts, fee_quoter.InternalPriceUpdates) error); ok { + r1 = rf(opts, priceUpdates) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// FeeQuoterInterface_UpdatePrices_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdatePrices' +type FeeQuoterInterface_UpdatePrices_Call struct { + *mock.Call +} + +// UpdatePrices is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - priceUpdates fee_quoter.InternalPriceUpdates +func (_e *FeeQuoterInterface_Expecter) UpdatePrices(opts interface{}, priceUpdates interface{}) *FeeQuoterInterface_UpdatePrices_Call { + return &FeeQuoterInterface_UpdatePrices_Call{Call: _e.mock.On("UpdatePrices", opts, priceUpdates)} +} + +func (_c *FeeQuoterInterface_UpdatePrices_Call) Run(run func(opts *bind.TransactOpts, priceUpdates fee_quoter.InternalPriceUpdates)) *FeeQuoterInterface_UpdatePrices_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].(fee_quoter.InternalPriceUpdates)) + }) + return _c +} + +func (_c *FeeQuoterInterface_UpdatePrices_Call) Return(_a0 *types.Transaction, _a1 error) *FeeQuoterInterface_UpdatePrices_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FeeQuoterInterface_UpdatePrices_Call) RunAndReturn(run func(*bind.TransactOpts, fee_quoter.InternalPriceUpdates) (*types.Transaction, error)) *FeeQuoterInterface_UpdatePrices_Call { + _c.Call.Return(run) + return _c +} + +// UpdateTokenPriceFeeds provides a mock function with given fields: opts, tokenPriceFeedUpdates +func (_m *FeeQuoterInterface) UpdateTokenPriceFeeds(opts *bind.TransactOpts, tokenPriceFeedUpdates []fee_quoter.FeeQuoterTokenPriceFeedUpdate) (*types.Transaction, error) { + ret := _m.Called(opts, tokenPriceFeedUpdates) + + if len(ret) == 0 { + panic("no return value specified for UpdateTokenPriceFeeds") + } + + var r0 *types.Transaction + var r1 error + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, []fee_quoter.FeeQuoterTokenPriceFeedUpdate) (*types.Transaction, error)); ok { + return rf(opts, tokenPriceFeedUpdates) + } + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, []fee_quoter.FeeQuoterTokenPriceFeedUpdate) *types.Transaction); ok { + r0 = rf(opts, tokenPriceFeedUpdates) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Transaction) + } + } + + if rf, ok := ret.Get(1).(func(*bind.TransactOpts, []fee_quoter.FeeQuoterTokenPriceFeedUpdate) error); ok { + r1 = rf(opts, tokenPriceFeedUpdates) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// FeeQuoterInterface_UpdateTokenPriceFeeds_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateTokenPriceFeeds' +type FeeQuoterInterface_UpdateTokenPriceFeeds_Call struct { + *mock.Call +} + +// UpdateTokenPriceFeeds is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - tokenPriceFeedUpdates []fee_quoter.FeeQuoterTokenPriceFeedUpdate +func (_e *FeeQuoterInterface_Expecter) UpdateTokenPriceFeeds(opts interface{}, tokenPriceFeedUpdates interface{}) *FeeQuoterInterface_UpdateTokenPriceFeeds_Call { + return &FeeQuoterInterface_UpdateTokenPriceFeeds_Call{Call: _e.mock.On("UpdateTokenPriceFeeds", opts, tokenPriceFeedUpdates)} +} + +func (_c *FeeQuoterInterface_UpdateTokenPriceFeeds_Call) Run(run func(opts *bind.TransactOpts, tokenPriceFeedUpdates []fee_quoter.FeeQuoterTokenPriceFeedUpdate)) *FeeQuoterInterface_UpdateTokenPriceFeeds_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].([]fee_quoter.FeeQuoterTokenPriceFeedUpdate)) + }) + return _c +} + +func (_c *FeeQuoterInterface_UpdateTokenPriceFeeds_Call) Return(_a0 *types.Transaction, _a1 error) *FeeQuoterInterface_UpdateTokenPriceFeeds_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FeeQuoterInterface_UpdateTokenPriceFeeds_Call) RunAndReturn(run func(*bind.TransactOpts, []fee_quoter.FeeQuoterTokenPriceFeedUpdate) (*types.Transaction, error)) *FeeQuoterInterface_UpdateTokenPriceFeeds_Call { + _c.Call.Return(run) + return _c +} + +// WatchAuthorizedCallerAdded provides a mock function with given fields: opts, sink +func (_m *FeeQuoterInterface) WatchAuthorizedCallerAdded(opts *bind.WatchOpts, sink chan<- *fee_quoter.FeeQuoterAuthorizedCallerAdded) (event.Subscription, error) { + ret := _m.Called(opts, sink) + + if len(ret) == 0 { + panic("no return value specified for WatchAuthorizedCallerAdded") + } + + var r0 event.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *fee_quoter.FeeQuoterAuthorizedCallerAdded) (event.Subscription, error)); ok { + return rf(opts, sink) + } + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *fee_quoter.FeeQuoterAuthorizedCallerAdded) event.Subscription); ok { + r0 = rf(opts, sink) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(event.Subscription) + } + } + + if rf, ok := ret.Get(1).(func(*bind.WatchOpts, chan<- *fee_quoter.FeeQuoterAuthorizedCallerAdded) error); ok { + r1 = rf(opts, sink) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// FeeQuoterInterface_WatchAuthorizedCallerAdded_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchAuthorizedCallerAdded' +type FeeQuoterInterface_WatchAuthorizedCallerAdded_Call struct { + *mock.Call +} + +// WatchAuthorizedCallerAdded is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *fee_quoter.FeeQuoterAuthorizedCallerAdded +func (_e *FeeQuoterInterface_Expecter) WatchAuthorizedCallerAdded(opts interface{}, sink interface{}) *FeeQuoterInterface_WatchAuthorizedCallerAdded_Call { + return &FeeQuoterInterface_WatchAuthorizedCallerAdded_Call{Call: _e.mock.On("WatchAuthorizedCallerAdded", opts, sink)} +} + +func (_c *FeeQuoterInterface_WatchAuthorizedCallerAdded_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *fee_quoter.FeeQuoterAuthorizedCallerAdded)) *FeeQuoterInterface_WatchAuthorizedCallerAdded_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *fee_quoter.FeeQuoterAuthorizedCallerAdded)) + }) + return _c +} + +func (_c *FeeQuoterInterface_WatchAuthorizedCallerAdded_Call) Return(_a0 event.Subscription, _a1 error) *FeeQuoterInterface_WatchAuthorizedCallerAdded_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FeeQuoterInterface_WatchAuthorizedCallerAdded_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *fee_quoter.FeeQuoterAuthorizedCallerAdded) (event.Subscription, error)) *FeeQuoterInterface_WatchAuthorizedCallerAdded_Call { + _c.Call.Return(run) + return _c +} + +// WatchAuthorizedCallerRemoved provides a mock function with given fields: opts, sink +func (_m *FeeQuoterInterface) WatchAuthorizedCallerRemoved(opts *bind.WatchOpts, sink chan<- *fee_quoter.FeeQuoterAuthorizedCallerRemoved) (event.Subscription, error) { + ret := _m.Called(opts, sink) + + if len(ret) == 0 { + panic("no return value specified for WatchAuthorizedCallerRemoved") + } + + var r0 event.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *fee_quoter.FeeQuoterAuthorizedCallerRemoved) (event.Subscription, error)); ok { + return rf(opts, sink) + } + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *fee_quoter.FeeQuoterAuthorizedCallerRemoved) event.Subscription); ok { + r0 = rf(opts, sink) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(event.Subscription) + } + } + + if rf, ok := ret.Get(1).(func(*bind.WatchOpts, chan<- *fee_quoter.FeeQuoterAuthorizedCallerRemoved) error); ok { + r1 = rf(opts, sink) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// FeeQuoterInterface_WatchAuthorizedCallerRemoved_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchAuthorizedCallerRemoved' +type FeeQuoterInterface_WatchAuthorizedCallerRemoved_Call struct { + *mock.Call +} + +// WatchAuthorizedCallerRemoved is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *fee_quoter.FeeQuoterAuthorizedCallerRemoved +func (_e *FeeQuoterInterface_Expecter) WatchAuthorizedCallerRemoved(opts interface{}, sink interface{}) *FeeQuoterInterface_WatchAuthorizedCallerRemoved_Call { + return &FeeQuoterInterface_WatchAuthorizedCallerRemoved_Call{Call: _e.mock.On("WatchAuthorizedCallerRemoved", opts, sink)} +} + +func (_c *FeeQuoterInterface_WatchAuthorizedCallerRemoved_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *fee_quoter.FeeQuoterAuthorizedCallerRemoved)) *FeeQuoterInterface_WatchAuthorizedCallerRemoved_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *fee_quoter.FeeQuoterAuthorizedCallerRemoved)) + }) + return _c +} + +func (_c *FeeQuoterInterface_WatchAuthorizedCallerRemoved_Call) Return(_a0 event.Subscription, _a1 error) *FeeQuoterInterface_WatchAuthorizedCallerRemoved_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FeeQuoterInterface_WatchAuthorizedCallerRemoved_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *fee_quoter.FeeQuoterAuthorizedCallerRemoved) (event.Subscription, error)) *FeeQuoterInterface_WatchAuthorizedCallerRemoved_Call { + _c.Call.Return(run) + return _c +} + +// WatchDestChainAdded provides a mock function with given fields: opts, sink, destChainSelector +func (_m *FeeQuoterInterface) WatchDestChainAdded(opts *bind.WatchOpts, sink chan<- *fee_quoter.FeeQuoterDestChainAdded, destChainSelector []uint64) (event.Subscription, error) { + ret := _m.Called(opts, sink, destChainSelector) + + if len(ret) == 0 { + panic("no return value specified for WatchDestChainAdded") + } + + var r0 event.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *fee_quoter.FeeQuoterDestChainAdded, []uint64) (event.Subscription, error)); ok { + return rf(opts, sink, destChainSelector) + } + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *fee_quoter.FeeQuoterDestChainAdded, []uint64) event.Subscription); ok { + r0 = rf(opts, sink, destChainSelector) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(event.Subscription) + } + } + + if rf, ok := ret.Get(1).(func(*bind.WatchOpts, chan<- *fee_quoter.FeeQuoterDestChainAdded, []uint64) error); ok { + r1 = rf(opts, sink, destChainSelector) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// FeeQuoterInterface_WatchDestChainAdded_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchDestChainAdded' +type FeeQuoterInterface_WatchDestChainAdded_Call struct { + *mock.Call +} + +// WatchDestChainAdded is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *fee_quoter.FeeQuoterDestChainAdded +// - destChainSelector []uint64 +func (_e *FeeQuoterInterface_Expecter) WatchDestChainAdded(opts interface{}, sink interface{}, destChainSelector interface{}) *FeeQuoterInterface_WatchDestChainAdded_Call { + return &FeeQuoterInterface_WatchDestChainAdded_Call{Call: _e.mock.On("WatchDestChainAdded", opts, sink, destChainSelector)} +} + +func (_c *FeeQuoterInterface_WatchDestChainAdded_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *fee_quoter.FeeQuoterDestChainAdded, destChainSelector []uint64)) *FeeQuoterInterface_WatchDestChainAdded_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *fee_quoter.FeeQuoterDestChainAdded), args[2].([]uint64)) + }) + return _c +} + +func (_c *FeeQuoterInterface_WatchDestChainAdded_Call) Return(_a0 event.Subscription, _a1 error) *FeeQuoterInterface_WatchDestChainAdded_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FeeQuoterInterface_WatchDestChainAdded_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *fee_quoter.FeeQuoterDestChainAdded, []uint64) (event.Subscription, error)) *FeeQuoterInterface_WatchDestChainAdded_Call { + _c.Call.Return(run) + return _c +} + +// WatchDestChainConfigUpdated provides a mock function with given fields: opts, sink, destChainSelector +func (_m *FeeQuoterInterface) WatchDestChainConfigUpdated(opts *bind.WatchOpts, sink chan<- *fee_quoter.FeeQuoterDestChainConfigUpdated, destChainSelector []uint64) (event.Subscription, error) { + ret := _m.Called(opts, sink, destChainSelector) + + if len(ret) == 0 { + panic("no return value specified for WatchDestChainConfigUpdated") + } + + var r0 event.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *fee_quoter.FeeQuoterDestChainConfigUpdated, []uint64) (event.Subscription, error)); ok { + return rf(opts, sink, destChainSelector) + } + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *fee_quoter.FeeQuoterDestChainConfigUpdated, []uint64) event.Subscription); ok { + r0 = rf(opts, sink, destChainSelector) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(event.Subscription) + } + } + + if rf, ok := ret.Get(1).(func(*bind.WatchOpts, chan<- *fee_quoter.FeeQuoterDestChainConfigUpdated, []uint64) error); ok { + r1 = rf(opts, sink, destChainSelector) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// FeeQuoterInterface_WatchDestChainConfigUpdated_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchDestChainConfigUpdated' +type FeeQuoterInterface_WatchDestChainConfigUpdated_Call struct { + *mock.Call +} + +// WatchDestChainConfigUpdated is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *fee_quoter.FeeQuoterDestChainConfigUpdated +// - destChainSelector []uint64 +func (_e *FeeQuoterInterface_Expecter) WatchDestChainConfigUpdated(opts interface{}, sink interface{}, destChainSelector interface{}) *FeeQuoterInterface_WatchDestChainConfigUpdated_Call { + return &FeeQuoterInterface_WatchDestChainConfigUpdated_Call{Call: _e.mock.On("WatchDestChainConfigUpdated", opts, sink, destChainSelector)} +} + +func (_c *FeeQuoterInterface_WatchDestChainConfigUpdated_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *fee_quoter.FeeQuoterDestChainConfigUpdated, destChainSelector []uint64)) *FeeQuoterInterface_WatchDestChainConfigUpdated_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *fee_quoter.FeeQuoterDestChainConfigUpdated), args[2].([]uint64)) + }) + return _c +} + +func (_c *FeeQuoterInterface_WatchDestChainConfigUpdated_Call) Return(_a0 event.Subscription, _a1 error) *FeeQuoterInterface_WatchDestChainConfigUpdated_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FeeQuoterInterface_WatchDestChainConfigUpdated_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *fee_quoter.FeeQuoterDestChainConfigUpdated, []uint64) (event.Subscription, error)) *FeeQuoterInterface_WatchDestChainConfigUpdated_Call { + _c.Call.Return(run) + return _c +} + +// WatchFeeTokenAdded provides a mock function with given fields: opts, sink, feeToken +func (_m *FeeQuoterInterface) WatchFeeTokenAdded(opts *bind.WatchOpts, sink chan<- *fee_quoter.FeeQuoterFeeTokenAdded, feeToken []common.Address) (event.Subscription, error) { + ret := _m.Called(opts, sink, feeToken) + + if len(ret) == 0 { + panic("no return value specified for WatchFeeTokenAdded") + } + + var r0 event.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *fee_quoter.FeeQuoterFeeTokenAdded, []common.Address) (event.Subscription, error)); ok { + return rf(opts, sink, feeToken) + } + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *fee_quoter.FeeQuoterFeeTokenAdded, []common.Address) event.Subscription); ok { + r0 = rf(opts, sink, feeToken) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(event.Subscription) + } + } + + if rf, ok := ret.Get(1).(func(*bind.WatchOpts, chan<- *fee_quoter.FeeQuoterFeeTokenAdded, []common.Address) error); ok { + r1 = rf(opts, sink, feeToken) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// FeeQuoterInterface_WatchFeeTokenAdded_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchFeeTokenAdded' +type FeeQuoterInterface_WatchFeeTokenAdded_Call struct { + *mock.Call +} + +// WatchFeeTokenAdded is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *fee_quoter.FeeQuoterFeeTokenAdded +// - feeToken []common.Address +func (_e *FeeQuoterInterface_Expecter) WatchFeeTokenAdded(opts interface{}, sink interface{}, feeToken interface{}) *FeeQuoterInterface_WatchFeeTokenAdded_Call { + return &FeeQuoterInterface_WatchFeeTokenAdded_Call{Call: _e.mock.On("WatchFeeTokenAdded", opts, sink, feeToken)} +} + +func (_c *FeeQuoterInterface_WatchFeeTokenAdded_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *fee_quoter.FeeQuoterFeeTokenAdded, feeToken []common.Address)) *FeeQuoterInterface_WatchFeeTokenAdded_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *fee_quoter.FeeQuoterFeeTokenAdded), args[2].([]common.Address)) + }) + return _c +} + +func (_c *FeeQuoterInterface_WatchFeeTokenAdded_Call) Return(_a0 event.Subscription, _a1 error) *FeeQuoterInterface_WatchFeeTokenAdded_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FeeQuoterInterface_WatchFeeTokenAdded_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *fee_quoter.FeeQuoterFeeTokenAdded, []common.Address) (event.Subscription, error)) *FeeQuoterInterface_WatchFeeTokenAdded_Call { + _c.Call.Return(run) + return _c +} + +// WatchFeeTokenRemoved provides a mock function with given fields: opts, sink, feeToken +func (_m *FeeQuoterInterface) WatchFeeTokenRemoved(opts *bind.WatchOpts, sink chan<- *fee_quoter.FeeQuoterFeeTokenRemoved, feeToken []common.Address) (event.Subscription, error) { + ret := _m.Called(opts, sink, feeToken) + + if len(ret) == 0 { + panic("no return value specified for WatchFeeTokenRemoved") + } + + var r0 event.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *fee_quoter.FeeQuoterFeeTokenRemoved, []common.Address) (event.Subscription, error)); ok { + return rf(opts, sink, feeToken) + } + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *fee_quoter.FeeQuoterFeeTokenRemoved, []common.Address) event.Subscription); ok { + r0 = rf(opts, sink, feeToken) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(event.Subscription) + } + } + + if rf, ok := ret.Get(1).(func(*bind.WatchOpts, chan<- *fee_quoter.FeeQuoterFeeTokenRemoved, []common.Address) error); ok { + r1 = rf(opts, sink, feeToken) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// FeeQuoterInterface_WatchFeeTokenRemoved_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchFeeTokenRemoved' +type FeeQuoterInterface_WatchFeeTokenRemoved_Call struct { + *mock.Call +} + +// WatchFeeTokenRemoved is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *fee_quoter.FeeQuoterFeeTokenRemoved +// - feeToken []common.Address +func (_e *FeeQuoterInterface_Expecter) WatchFeeTokenRemoved(opts interface{}, sink interface{}, feeToken interface{}) *FeeQuoterInterface_WatchFeeTokenRemoved_Call { + return &FeeQuoterInterface_WatchFeeTokenRemoved_Call{Call: _e.mock.On("WatchFeeTokenRemoved", opts, sink, feeToken)} +} + +func (_c *FeeQuoterInterface_WatchFeeTokenRemoved_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *fee_quoter.FeeQuoterFeeTokenRemoved, feeToken []common.Address)) *FeeQuoterInterface_WatchFeeTokenRemoved_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *fee_quoter.FeeQuoterFeeTokenRemoved), args[2].([]common.Address)) + }) + return _c +} + +func (_c *FeeQuoterInterface_WatchFeeTokenRemoved_Call) Return(_a0 event.Subscription, _a1 error) *FeeQuoterInterface_WatchFeeTokenRemoved_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FeeQuoterInterface_WatchFeeTokenRemoved_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *fee_quoter.FeeQuoterFeeTokenRemoved, []common.Address) (event.Subscription, error)) *FeeQuoterInterface_WatchFeeTokenRemoved_Call { + _c.Call.Return(run) + return _c +} + +// WatchOwnershipTransferRequested provides a mock function with given fields: opts, sink, from, to +func (_m *FeeQuoterInterface) WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *fee_quoter.FeeQuoterOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) { + ret := _m.Called(opts, sink, from, to) + + if len(ret) == 0 { + panic("no return value specified for WatchOwnershipTransferRequested") + } + + var r0 event.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *fee_quoter.FeeQuoterOwnershipTransferRequested, []common.Address, []common.Address) (event.Subscription, error)); ok { + return rf(opts, sink, from, to) + } + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *fee_quoter.FeeQuoterOwnershipTransferRequested, []common.Address, []common.Address) event.Subscription); ok { + r0 = rf(opts, sink, from, to) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(event.Subscription) + } + } + + if rf, ok := ret.Get(1).(func(*bind.WatchOpts, chan<- *fee_quoter.FeeQuoterOwnershipTransferRequested, []common.Address, []common.Address) error); ok { + r1 = rf(opts, sink, from, to) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// FeeQuoterInterface_WatchOwnershipTransferRequested_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchOwnershipTransferRequested' +type FeeQuoterInterface_WatchOwnershipTransferRequested_Call struct { + *mock.Call +} + +// WatchOwnershipTransferRequested is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *fee_quoter.FeeQuoterOwnershipTransferRequested +// - from []common.Address +// - to []common.Address +func (_e *FeeQuoterInterface_Expecter) WatchOwnershipTransferRequested(opts interface{}, sink interface{}, from interface{}, to interface{}) *FeeQuoterInterface_WatchOwnershipTransferRequested_Call { + return &FeeQuoterInterface_WatchOwnershipTransferRequested_Call{Call: _e.mock.On("WatchOwnershipTransferRequested", opts, sink, from, to)} +} + +func (_c *FeeQuoterInterface_WatchOwnershipTransferRequested_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *fee_quoter.FeeQuoterOwnershipTransferRequested, from []common.Address, to []common.Address)) *FeeQuoterInterface_WatchOwnershipTransferRequested_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *fee_quoter.FeeQuoterOwnershipTransferRequested), args[2].([]common.Address), args[3].([]common.Address)) + }) + return _c +} + +func (_c *FeeQuoterInterface_WatchOwnershipTransferRequested_Call) Return(_a0 event.Subscription, _a1 error) *FeeQuoterInterface_WatchOwnershipTransferRequested_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FeeQuoterInterface_WatchOwnershipTransferRequested_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *fee_quoter.FeeQuoterOwnershipTransferRequested, []common.Address, []common.Address) (event.Subscription, error)) *FeeQuoterInterface_WatchOwnershipTransferRequested_Call { + _c.Call.Return(run) + return _c +} + +// WatchOwnershipTransferred provides a mock function with given fields: opts, sink, from, to +func (_m *FeeQuoterInterface) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *fee_quoter.FeeQuoterOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) { + ret := _m.Called(opts, sink, from, to) + + if len(ret) == 0 { + panic("no return value specified for WatchOwnershipTransferred") + } + + var r0 event.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *fee_quoter.FeeQuoterOwnershipTransferred, []common.Address, []common.Address) (event.Subscription, error)); ok { + return rf(opts, sink, from, to) + } + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *fee_quoter.FeeQuoterOwnershipTransferred, []common.Address, []common.Address) event.Subscription); ok { + r0 = rf(opts, sink, from, to) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(event.Subscription) + } + } + + if rf, ok := ret.Get(1).(func(*bind.WatchOpts, chan<- *fee_quoter.FeeQuoterOwnershipTransferred, []common.Address, []common.Address) error); ok { + r1 = rf(opts, sink, from, to) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// FeeQuoterInterface_WatchOwnershipTransferred_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchOwnershipTransferred' +type FeeQuoterInterface_WatchOwnershipTransferred_Call struct { + *mock.Call +} + +// WatchOwnershipTransferred is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *fee_quoter.FeeQuoterOwnershipTransferred +// - from []common.Address +// - to []common.Address +func (_e *FeeQuoterInterface_Expecter) WatchOwnershipTransferred(opts interface{}, sink interface{}, from interface{}, to interface{}) *FeeQuoterInterface_WatchOwnershipTransferred_Call { + return &FeeQuoterInterface_WatchOwnershipTransferred_Call{Call: _e.mock.On("WatchOwnershipTransferred", opts, sink, from, to)} +} + +func (_c *FeeQuoterInterface_WatchOwnershipTransferred_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *fee_quoter.FeeQuoterOwnershipTransferred, from []common.Address, to []common.Address)) *FeeQuoterInterface_WatchOwnershipTransferred_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *fee_quoter.FeeQuoterOwnershipTransferred), args[2].([]common.Address), args[3].([]common.Address)) + }) + return _c +} + +func (_c *FeeQuoterInterface_WatchOwnershipTransferred_Call) Return(_a0 event.Subscription, _a1 error) *FeeQuoterInterface_WatchOwnershipTransferred_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FeeQuoterInterface_WatchOwnershipTransferred_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *fee_quoter.FeeQuoterOwnershipTransferred, []common.Address, []common.Address) (event.Subscription, error)) *FeeQuoterInterface_WatchOwnershipTransferred_Call { + _c.Call.Return(run) + return _c +} + +// WatchPremiumMultiplierWeiPerEthUpdated provides a mock function with given fields: opts, sink, token +func (_m *FeeQuoterInterface) WatchPremiumMultiplierWeiPerEthUpdated(opts *bind.WatchOpts, sink chan<- *fee_quoter.FeeQuoterPremiumMultiplierWeiPerEthUpdated, token []common.Address) (event.Subscription, error) { + ret := _m.Called(opts, sink, token) + + if len(ret) == 0 { + panic("no return value specified for WatchPremiumMultiplierWeiPerEthUpdated") + } + + var r0 event.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *fee_quoter.FeeQuoterPremiumMultiplierWeiPerEthUpdated, []common.Address) (event.Subscription, error)); ok { + return rf(opts, sink, token) + } + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *fee_quoter.FeeQuoterPremiumMultiplierWeiPerEthUpdated, []common.Address) event.Subscription); ok { + r0 = rf(opts, sink, token) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(event.Subscription) + } + } + + if rf, ok := ret.Get(1).(func(*bind.WatchOpts, chan<- *fee_quoter.FeeQuoterPremiumMultiplierWeiPerEthUpdated, []common.Address) error); ok { + r1 = rf(opts, sink, token) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// FeeQuoterInterface_WatchPremiumMultiplierWeiPerEthUpdated_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchPremiumMultiplierWeiPerEthUpdated' +type FeeQuoterInterface_WatchPremiumMultiplierWeiPerEthUpdated_Call struct { + *mock.Call +} + +// WatchPremiumMultiplierWeiPerEthUpdated is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *fee_quoter.FeeQuoterPremiumMultiplierWeiPerEthUpdated +// - token []common.Address +func (_e *FeeQuoterInterface_Expecter) WatchPremiumMultiplierWeiPerEthUpdated(opts interface{}, sink interface{}, token interface{}) *FeeQuoterInterface_WatchPremiumMultiplierWeiPerEthUpdated_Call { + return &FeeQuoterInterface_WatchPremiumMultiplierWeiPerEthUpdated_Call{Call: _e.mock.On("WatchPremiumMultiplierWeiPerEthUpdated", opts, sink, token)} +} + +func (_c *FeeQuoterInterface_WatchPremiumMultiplierWeiPerEthUpdated_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *fee_quoter.FeeQuoterPremiumMultiplierWeiPerEthUpdated, token []common.Address)) *FeeQuoterInterface_WatchPremiumMultiplierWeiPerEthUpdated_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *fee_quoter.FeeQuoterPremiumMultiplierWeiPerEthUpdated), args[2].([]common.Address)) + }) + return _c +} + +func (_c *FeeQuoterInterface_WatchPremiumMultiplierWeiPerEthUpdated_Call) Return(_a0 event.Subscription, _a1 error) *FeeQuoterInterface_WatchPremiumMultiplierWeiPerEthUpdated_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FeeQuoterInterface_WatchPremiumMultiplierWeiPerEthUpdated_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *fee_quoter.FeeQuoterPremiumMultiplierWeiPerEthUpdated, []common.Address) (event.Subscription, error)) *FeeQuoterInterface_WatchPremiumMultiplierWeiPerEthUpdated_Call { + _c.Call.Return(run) + return _c +} + +// WatchPriceFeedPerTokenUpdated provides a mock function with given fields: opts, sink, token +func (_m *FeeQuoterInterface) WatchPriceFeedPerTokenUpdated(opts *bind.WatchOpts, sink chan<- *fee_quoter.FeeQuoterPriceFeedPerTokenUpdated, token []common.Address) (event.Subscription, error) { + ret := _m.Called(opts, sink, token) + + if len(ret) == 0 { + panic("no return value specified for WatchPriceFeedPerTokenUpdated") + } + + var r0 event.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *fee_quoter.FeeQuoterPriceFeedPerTokenUpdated, []common.Address) (event.Subscription, error)); ok { + return rf(opts, sink, token) + } + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *fee_quoter.FeeQuoterPriceFeedPerTokenUpdated, []common.Address) event.Subscription); ok { + r0 = rf(opts, sink, token) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(event.Subscription) + } + } + + if rf, ok := ret.Get(1).(func(*bind.WatchOpts, chan<- *fee_quoter.FeeQuoterPriceFeedPerTokenUpdated, []common.Address) error); ok { + r1 = rf(opts, sink, token) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// FeeQuoterInterface_WatchPriceFeedPerTokenUpdated_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchPriceFeedPerTokenUpdated' +type FeeQuoterInterface_WatchPriceFeedPerTokenUpdated_Call struct { + *mock.Call +} + +// WatchPriceFeedPerTokenUpdated is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *fee_quoter.FeeQuoterPriceFeedPerTokenUpdated +// - token []common.Address +func (_e *FeeQuoterInterface_Expecter) WatchPriceFeedPerTokenUpdated(opts interface{}, sink interface{}, token interface{}) *FeeQuoterInterface_WatchPriceFeedPerTokenUpdated_Call { + return &FeeQuoterInterface_WatchPriceFeedPerTokenUpdated_Call{Call: _e.mock.On("WatchPriceFeedPerTokenUpdated", opts, sink, token)} +} + +func (_c *FeeQuoterInterface_WatchPriceFeedPerTokenUpdated_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *fee_quoter.FeeQuoterPriceFeedPerTokenUpdated, token []common.Address)) *FeeQuoterInterface_WatchPriceFeedPerTokenUpdated_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *fee_quoter.FeeQuoterPriceFeedPerTokenUpdated), args[2].([]common.Address)) + }) + return _c +} + +func (_c *FeeQuoterInterface_WatchPriceFeedPerTokenUpdated_Call) Return(_a0 event.Subscription, _a1 error) *FeeQuoterInterface_WatchPriceFeedPerTokenUpdated_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FeeQuoterInterface_WatchPriceFeedPerTokenUpdated_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *fee_quoter.FeeQuoterPriceFeedPerTokenUpdated, []common.Address) (event.Subscription, error)) *FeeQuoterInterface_WatchPriceFeedPerTokenUpdated_Call { + _c.Call.Return(run) + return _c +} + +// WatchReportPermissionSet provides a mock function with given fields: opts, sink, reportId +func (_m *FeeQuoterInterface) WatchReportPermissionSet(opts *bind.WatchOpts, sink chan<- *fee_quoter.FeeQuoterReportPermissionSet, reportId [][32]byte) (event.Subscription, error) { + ret := _m.Called(opts, sink, reportId) + + if len(ret) == 0 { + panic("no return value specified for WatchReportPermissionSet") + } + + var r0 event.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *fee_quoter.FeeQuoterReportPermissionSet, [][32]byte) (event.Subscription, error)); ok { + return rf(opts, sink, reportId) + } + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *fee_quoter.FeeQuoterReportPermissionSet, [][32]byte) event.Subscription); ok { + r0 = rf(opts, sink, reportId) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(event.Subscription) + } + } + + if rf, ok := ret.Get(1).(func(*bind.WatchOpts, chan<- *fee_quoter.FeeQuoterReportPermissionSet, [][32]byte) error); ok { + r1 = rf(opts, sink, reportId) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// FeeQuoterInterface_WatchReportPermissionSet_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchReportPermissionSet' +type FeeQuoterInterface_WatchReportPermissionSet_Call struct { + *mock.Call +} + +// WatchReportPermissionSet is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *fee_quoter.FeeQuoterReportPermissionSet +// - reportId [][32]byte +func (_e *FeeQuoterInterface_Expecter) WatchReportPermissionSet(opts interface{}, sink interface{}, reportId interface{}) *FeeQuoterInterface_WatchReportPermissionSet_Call { + return &FeeQuoterInterface_WatchReportPermissionSet_Call{Call: _e.mock.On("WatchReportPermissionSet", opts, sink, reportId)} +} + +func (_c *FeeQuoterInterface_WatchReportPermissionSet_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *fee_quoter.FeeQuoterReportPermissionSet, reportId [][32]byte)) *FeeQuoterInterface_WatchReportPermissionSet_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *fee_quoter.FeeQuoterReportPermissionSet), args[2].([][32]byte)) + }) + return _c +} + +func (_c *FeeQuoterInterface_WatchReportPermissionSet_Call) Return(_a0 event.Subscription, _a1 error) *FeeQuoterInterface_WatchReportPermissionSet_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FeeQuoterInterface_WatchReportPermissionSet_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *fee_quoter.FeeQuoterReportPermissionSet, [][32]byte) (event.Subscription, error)) *FeeQuoterInterface_WatchReportPermissionSet_Call { + _c.Call.Return(run) + return _c +} + +// WatchTokenTransferFeeConfigDeleted provides a mock function with given fields: opts, sink, destChainSelector, token +func (_m *FeeQuoterInterface) WatchTokenTransferFeeConfigDeleted(opts *bind.WatchOpts, sink chan<- *fee_quoter.FeeQuoterTokenTransferFeeConfigDeleted, destChainSelector []uint64, token []common.Address) (event.Subscription, error) { + ret := _m.Called(opts, sink, destChainSelector, token) + + if len(ret) == 0 { + panic("no return value specified for WatchTokenTransferFeeConfigDeleted") + } + + var r0 event.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *fee_quoter.FeeQuoterTokenTransferFeeConfigDeleted, []uint64, []common.Address) (event.Subscription, error)); ok { + return rf(opts, sink, destChainSelector, token) + } + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *fee_quoter.FeeQuoterTokenTransferFeeConfigDeleted, []uint64, []common.Address) event.Subscription); ok { + r0 = rf(opts, sink, destChainSelector, token) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(event.Subscription) + } + } + + if rf, ok := ret.Get(1).(func(*bind.WatchOpts, chan<- *fee_quoter.FeeQuoterTokenTransferFeeConfigDeleted, []uint64, []common.Address) error); ok { + r1 = rf(opts, sink, destChainSelector, token) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// FeeQuoterInterface_WatchTokenTransferFeeConfigDeleted_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchTokenTransferFeeConfigDeleted' +type FeeQuoterInterface_WatchTokenTransferFeeConfigDeleted_Call struct { + *mock.Call +} + +// WatchTokenTransferFeeConfigDeleted is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *fee_quoter.FeeQuoterTokenTransferFeeConfigDeleted +// - destChainSelector []uint64 +// - token []common.Address +func (_e *FeeQuoterInterface_Expecter) WatchTokenTransferFeeConfigDeleted(opts interface{}, sink interface{}, destChainSelector interface{}, token interface{}) *FeeQuoterInterface_WatchTokenTransferFeeConfigDeleted_Call { + return &FeeQuoterInterface_WatchTokenTransferFeeConfigDeleted_Call{Call: _e.mock.On("WatchTokenTransferFeeConfigDeleted", opts, sink, destChainSelector, token)} +} + +func (_c *FeeQuoterInterface_WatchTokenTransferFeeConfigDeleted_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *fee_quoter.FeeQuoterTokenTransferFeeConfigDeleted, destChainSelector []uint64, token []common.Address)) *FeeQuoterInterface_WatchTokenTransferFeeConfigDeleted_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *fee_quoter.FeeQuoterTokenTransferFeeConfigDeleted), args[2].([]uint64), args[3].([]common.Address)) + }) + return _c +} + +func (_c *FeeQuoterInterface_WatchTokenTransferFeeConfigDeleted_Call) Return(_a0 event.Subscription, _a1 error) *FeeQuoterInterface_WatchTokenTransferFeeConfigDeleted_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FeeQuoterInterface_WatchTokenTransferFeeConfigDeleted_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *fee_quoter.FeeQuoterTokenTransferFeeConfigDeleted, []uint64, []common.Address) (event.Subscription, error)) *FeeQuoterInterface_WatchTokenTransferFeeConfigDeleted_Call { + _c.Call.Return(run) + return _c +} + +// WatchTokenTransferFeeConfigUpdated provides a mock function with given fields: opts, sink, destChainSelector, token +func (_m *FeeQuoterInterface) WatchTokenTransferFeeConfigUpdated(opts *bind.WatchOpts, sink chan<- *fee_quoter.FeeQuoterTokenTransferFeeConfigUpdated, destChainSelector []uint64, token []common.Address) (event.Subscription, error) { + ret := _m.Called(opts, sink, destChainSelector, token) + + if len(ret) == 0 { + panic("no return value specified for WatchTokenTransferFeeConfigUpdated") + } + + var r0 event.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *fee_quoter.FeeQuoterTokenTransferFeeConfigUpdated, []uint64, []common.Address) (event.Subscription, error)); ok { + return rf(opts, sink, destChainSelector, token) + } + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *fee_quoter.FeeQuoterTokenTransferFeeConfigUpdated, []uint64, []common.Address) event.Subscription); ok { + r0 = rf(opts, sink, destChainSelector, token) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(event.Subscription) + } + } + + if rf, ok := ret.Get(1).(func(*bind.WatchOpts, chan<- *fee_quoter.FeeQuoterTokenTransferFeeConfigUpdated, []uint64, []common.Address) error); ok { + r1 = rf(opts, sink, destChainSelector, token) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// FeeQuoterInterface_WatchTokenTransferFeeConfigUpdated_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchTokenTransferFeeConfigUpdated' +type FeeQuoterInterface_WatchTokenTransferFeeConfigUpdated_Call struct { + *mock.Call +} + +// WatchTokenTransferFeeConfigUpdated is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *fee_quoter.FeeQuoterTokenTransferFeeConfigUpdated +// - destChainSelector []uint64 +// - token []common.Address +func (_e *FeeQuoterInterface_Expecter) WatchTokenTransferFeeConfigUpdated(opts interface{}, sink interface{}, destChainSelector interface{}, token interface{}) *FeeQuoterInterface_WatchTokenTransferFeeConfigUpdated_Call { + return &FeeQuoterInterface_WatchTokenTransferFeeConfigUpdated_Call{Call: _e.mock.On("WatchTokenTransferFeeConfigUpdated", opts, sink, destChainSelector, token)} +} + +func (_c *FeeQuoterInterface_WatchTokenTransferFeeConfigUpdated_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *fee_quoter.FeeQuoterTokenTransferFeeConfigUpdated, destChainSelector []uint64, token []common.Address)) *FeeQuoterInterface_WatchTokenTransferFeeConfigUpdated_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *fee_quoter.FeeQuoterTokenTransferFeeConfigUpdated), args[2].([]uint64), args[3].([]common.Address)) + }) + return _c +} + +func (_c *FeeQuoterInterface_WatchTokenTransferFeeConfigUpdated_Call) Return(_a0 event.Subscription, _a1 error) *FeeQuoterInterface_WatchTokenTransferFeeConfigUpdated_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FeeQuoterInterface_WatchTokenTransferFeeConfigUpdated_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *fee_quoter.FeeQuoterTokenTransferFeeConfigUpdated, []uint64, []common.Address) (event.Subscription, error)) *FeeQuoterInterface_WatchTokenTransferFeeConfigUpdated_Call { + _c.Call.Return(run) + return _c +} + +// WatchUsdPerTokenUpdated provides a mock function with given fields: opts, sink, token +func (_m *FeeQuoterInterface) WatchUsdPerTokenUpdated(opts *bind.WatchOpts, sink chan<- *fee_quoter.FeeQuoterUsdPerTokenUpdated, token []common.Address) (event.Subscription, error) { + ret := _m.Called(opts, sink, token) + + if len(ret) == 0 { + panic("no return value specified for WatchUsdPerTokenUpdated") + } + + var r0 event.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *fee_quoter.FeeQuoterUsdPerTokenUpdated, []common.Address) (event.Subscription, error)); ok { + return rf(opts, sink, token) + } + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *fee_quoter.FeeQuoterUsdPerTokenUpdated, []common.Address) event.Subscription); ok { + r0 = rf(opts, sink, token) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(event.Subscription) + } + } + + if rf, ok := ret.Get(1).(func(*bind.WatchOpts, chan<- *fee_quoter.FeeQuoterUsdPerTokenUpdated, []common.Address) error); ok { + r1 = rf(opts, sink, token) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// FeeQuoterInterface_WatchUsdPerTokenUpdated_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchUsdPerTokenUpdated' +type FeeQuoterInterface_WatchUsdPerTokenUpdated_Call struct { + *mock.Call +} + +// WatchUsdPerTokenUpdated is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *fee_quoter.FeeQuoterUsdPerTokenUpdated +// - token []common.Address +func (_e *FeeQuoterInterface_Expecter) WatchUsdPerTokenUpdated(opts interface{}, sink interface{}, token interface{}) *FeeQuoterInterface_WatchUsdPerTokenUpdated_Call { + return &FeeQuoterInterface_WatchUsdPerTokenUpdated_Call{Call: _e.mock.On("WatchUsdPerTokenUpdated", opts, sink, token)} +} + +func (_c *FeeQuoterInterface_WatchUsdPerTokenUpdated_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *fee_quoter.FeeQuoterUsdPerTokenUpdated, token []common.Address)) *FeeQuoterInterface_WatchUsdPerTokenUpdated_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *fee_quoter.FeeQuoterUsdPerTokenUpdated), args[2].([]common.Address)) + }) + return _c +} + +func (_c *FeeQuoterInterface_WatchUsdPerTokenUpdated_Call) Return(_a0 event.Subscription, _a1 error) *FeeQuoterInterface_WatchUsdPerTokenUpdated_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FeeQuoterInterface_WatchUsdPerTokenUpdated_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *fee_quoter.FeeQuoterUsdPerTokenUpdated, []common.Address) (event.Subscription, error)) *FeeQuoterInterface_WatchUsdPerTokenUpdated_Call { + _c.Call.Return(run) + return _c +} + +// WatchUsdPerUnitGasUpdated provides a mock function with given fields: opts, sink, destChain +func (_m *FeeQuoterInterface) WatchUsdPerUnitGasUpdated(opts *bind.WatchOpts, sink chan<- *fee_quoter.FeeQuoterUsdPerUnitGasUpdated, destChain []uint64) (event.Subscription, error) { + ret := _m.Called(opts, sink, destChain) + + if len(ret) == 0 { + panic("no return value specified for WatchUsdPerUnitGasUpdated") + } + + var r0 event.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *fee_quoter.FeeQuoterUsdPerUnitGasUpdated, []uint64) (event.Subscription, error)); ok { + return rf(opts, sink, destChain) + } + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *fee_quoter.FeeQuoterUsdPerUnitGasUpdated, []uint64) event.Subscription); ok { + r0 = rf(opts, sink, destChain) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(event.Subscription) + } + } + + if rf, ok := ret.Get(1).(func(*bind.WatchOpts, chan<- *fee_quoter.FeeQuoterUsdPerUnitGasUpdated, []uint64) error); ok { + r1 = rf(opts, sink, destChain) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// FeeQuoterInterface_WatchUsdPerUnitGasUpdated_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchUsdPerUnitGasUpdated' +type FeeQuoterInterface_WatchUsdPerUnitGasUpdated_Call struct { + *mock.Call +} + +// WatchUsdPerUnitGasUpdated is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *fee_quoter.FeeQuoterUsdPerUnitGasUpdated +// - destChain []uint64 +func (_e *FeeQuoterInterface_Expecter) WatchUsdPerUnitGasUpdated(opts interface{}, sink interface{}, destChain interface{}) *FeeQuoterInterface_WatchUsdPerUnitGasUpdated_Call { + return &FeeQuoterInterface_WatchUsdPerUnitGasUpdated_Call{Call: _e.mock.On("WatchUsdPerUnitGasUpdated", opts, sink, destChain)} +} + +func (_c *FeeQuoterInterface_WatchUsdPerUnitGasUpdated_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *fee_quoter.FeeQuoterUsdPerUnitGasUpdated, destChain []uint64)) *FeeQuoterInterface_WatchUsdPerUnitGasUpdated_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *fee_quoter.FeeQuoterUsdPerUnitGasUpdated), args[2].([]uint64)) + }) + return _c +} + +func (_c *FeeQuoterInterface_WatchUsdPerUnitGasUpdated_Call) Return(_a0 event.Subscription, _a1 error) *FeeQuoterInterface_WatchUsdPerUnitGasUpdated_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FeeQuoterInterface_WatchUsdPerUnitGasUpdated_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *fee_quoter.FeeQuoterUsdPerUnitGasUpdated, []uint64) (event.Subscription, error)) *FeeQuoterInterface_WatchUsdPerUnitGasUpdated_Call { + _c.Call.Return(run) + return _c +} + +// NewFeeQuoterInterface creates a new instance of FeeQuoterInterface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewFeeQuoterInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *FeeQuoterInterface { + mock := &FeeQuoterInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/core/gethwrappers/ccip/mocks/link_token_interface.go b/core/gethwrappers/ccip/mocks/link_token_interface.go new file mode 100644 index 00000000000..efb4507f58e --- /dev/null +++ b/core/gethwrappers/ccip/mocks/link_token_interface.go @@ -0,0 +1,1217 @@ +// Code generated by mockery v2.43.2. DO NOT EDIT. + +package mock_contracts + +import ( + big "math/big" + + bind "github.com/ethereum/go-ethereum/accounts/abi/bind" + common "github.com/ethereum/go-ethereum/common" + + event "github.com/ethereum/go-ethereum/event" + + generated "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" + + link_token_interface "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/link_token_interface" + + mock "github.com/stretchr/testify/mock" + + types "github.com/ethereum/go-ethereum/core/types" +) + +// LinkTokenInterface is an autogenerated mock type for the LinkTokenInterface type +type LinkTokenInterface struct { + mock.Mock +} + +type LinkTokenInterface_Expecter struct { + mock *mock.Mock +} + +func (_m *LinkTokenInterface) EXPECT() *LinkTokenInterface_Expecter { + return &LinkTokenInterface_Expecter{mock: &_m.Mock} +} + +// Address provides a mock function with given fields: +func (_m *LinkTokenInterface) Address() common.Address { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Address") + } + + var r0 common.Address + if rf, ok := ret.Get(0).(func() common.Address); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Address) + } + } + + return r0 +} + +// LinkTokenInterface_Address_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Address' +type LinkTokenInterface_Address_Call struct { + *mock.Call +} + +// Address is a helper method to define mock.On call +func (_e *LinkTokenInterface_Expecter) Address() *LinkTokenInterface_Address_Call { + return &LinkTokenInterface_Address_Call{Call: _e.mock.On("Address")} +} + +func (_c *LinkTokenInterface_Address_Call) Run(run func()) *LinkTokenInterface_Address_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *LinkTokenInterface_Address_Call) Return(_a0 common.Address) *LinkTokenInterface_Address_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *LinkTokenInterface_Address_Call) RunAndReturn(run func() common.Address) *LinkTokenInterface_Address_Call { + _c.Call.Return(run) + return _c +} + +// Allowance provides a mock function with given fields: opts, _owner, _spender +func (_m *LinkTokenInterface) Allowance(opts *bind.CallOpts, _owner common.Address, _spender common.Address) (*big.Int, error) { + ret := _m.Called(opts, _owner, _spender) + + if len(ret) == 0 { + panic("no return value specified for Allowance") + } + + var r0 *big.Int + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts, common.Address, common.Address) (*big.Int, error)); ok { + return rf(opts, _owner, _spender) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts, common.Address, common.Address) *big.Int); ok { + r0 = rf(opts, _owner, _spender) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*big.Int) + } + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts, common.Address, common.Address) error); ok { + r1 = rf(opts, _owner, _spender) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// LinkTokenInterface_Allowance_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Allowance' +type LinkTokenInterface_Allowance_Call struct { + *mock.Call +} + +// Allowance is a helper method to define mock.On call +// - opts *bind.CallOpts +// - _owner common.Address +// - _spender common.Address +func (_e *LinkTokenInterface_Expecter) Allowance(opts interface{}, _owner interface{}, _spender interface{}) *LinkTokenInterface_Allowance_Call { + return &LinkTokenInterface_Allowance_Call{Call: _e.mock.On("Allowance", opts, _owner, _spender)} +} + +func (_c *LinkTokenInterface_Allowance_Call) Run(run func(opts *bind.CallOpts, _owner common.Address, _spender common.Address)) *LinkTokenInterface_Allowance_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts), args[1].(common.Address), args[2].(common.Address)) + }) + return _c +} + +func (_c *LinkTokenInterface_Allowance_Call) Return(_a0 *big.Int, _a1 error) *LinkTokenInterface_Allowance_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *LinkTokenInterface_Allowance_Call) RunAndReturn(run func(*bind.CallOpts, common.Address, common.Address) (*big.Int, error)) *LinkTokenInterface_Allowance_Call { + _c.Call.Return(run) + return _c +} + +// Approve provides a mock function with given fields: opts, _spender, _value +func (_m *LinkTokenInterface) Approve(opts *bind.TransactOpts, _spender common.Address, _value *big.Int) (*types.Transaction, error) { + ret := _m.Called(opts, _spender, _value) + + if len(ret) == 0 { + panic("no return value specified for Approve") + } + + var r0 *types.Transaction + var r1 error + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, common.Address, *big.Int) (*types.Transaction, error)); ok { + return rf(opts, _spender, _value) + } + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, common.Address, *big.Int) *types.Transaction); ok { + r0 = rf(opts, _spender, _value) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Transaction) + } + } + + if rf, ok := ret.Get(1).(func(*bind.TransactOpts, common.Address, *big.Int) error); ok { + r1 = rf(opts, _spender, _value) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// LinkTokenInterface_Approve_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Approve' +type LinkTokenInterface_Approve_Call struct { + *mock.Call +} + +// Approve is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - _spender common.Address +// - _value *big.Int +func (_e *LinkTokenInterface_Expecter) Approve(opts interface{}, _spender interface{}, _value interface{}) *LinkTokenInterface_Approve_Call { + return &LinkTokenInterface_Approve_Call{Call: _e.mock.On("Approve", opts, _spender, _value)} +} + +func (_c *LinkTokenInterface_Approve_Call) Run(run func(opts *bind.TransactOpts, _spender common.Address, _value *big.Int)) *LinkTokenInterface_Approve_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].(common.Address), args[2].(*big.Int)) + }) + return _c +} + +func (_c *LinkTokenInterface_Approve_Call) Return(_a0 *types.Transaction, _a1 error) *LinkTokenInterface_Approve_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *LinkTokenInterface_Approve_Call) RunAndReturn(run func(*bind.TransactOpts, common.Address, *big.Int) (*types.Transaction, error)) *LinkTokenInterface_Approve_Call { + _c.Call.Return(run) + return _c +} + +// BalanceOf provides a mock function with given fields: opts, _owner +func (_m *LinkTokenInterface) BalanceOf(opts *bind.CallOpts, _owner common.Address) (*big.Int, error) { + ret := _m.Called(opts, _owner) + + if len(ret) == 0 { + panic("no return value specified for BalanceOf") + } + + var r0 *big.Int + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts, common.Address) (*big.Int, error)); ok { + return rf(opts, _owner) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts, common.Address) *big.Int); ok { + r0 = rf(opts, _owner) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*big.Int) + } + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts, common.Address) error); ok { + r1 = rf(opts, _owner) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// LinkTokenInterface_BalanceOf_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BalanceOf' +type LinkTokenInterface_BalanceOf_Call struct { + *mock.Call +} + +// BalanceOf is a helper method to define mock.On call +// - opts *bind.CallOpts +// - _owner common.Address +func (_e *LinkTokenInterface_Expecter) BalanceOf(opts interface{}, _owner interface{}) *LinkTokenInterface_BalanceOf_Call { + return &LinkTokenInterface_BalanceOf_Call{Call: _e.mock.On("BalanceOf", opts, _owner)} +} + +func (_c *LinkTokenInterface_BalanceOf_Call) Run(run func(opts *bind.CallOpts, _owner common.Address)) *LinkTokenInterface_BalanceOf_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts), args[1].(common.Address)) + }) + return _c +} + +func (_c *LinkTokenInterface_BalanceOf_Call) Return(_a0 *big.Int, _a1 error) *LinkTokenInterface_BalanceOf_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *LinkTokenInterface_BalanceOf_Call) RunAndReturn(run func(*bind.CallOpts, common.Address) (*big.Int, error)) *LinkTokenInterface_BalanceOf_Call { + _c.Call.Return(run) + return _c +} + +// Decimals provides a mock function with given fields: opts +func (_m *LinkTokenInterface) Decimals(opts *bind.CallOpts) (uint8, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for Decimals") + } + + var r0 uint8 + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts) (uint8, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts) uint8); ok { + r0 = rf(opts) + } else { + r0 = ret.Get(0).(uint8) + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// LinkTokenInterface_Decimals_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Decimals' +type LinkTokenInterface_Decimals_Call struct { + *mock.Call +} + +// Decimals is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *LinkTokenInterface_Expecter) Decimals(opts interface{}) *LinkTokenInterface_Decimals_Call { + return &LinkTokenInterface_Decimals_Call{Call: _e.mock.On("Decimals", opts)} +} + +func (_c *LinkTokenInterface_Decimals_Call) Run(run func(opts *bind.CallOpts)) *LinkTokenInterface_Decimals_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *LinkTokenInterface_Decimals_Call) Return(_a0 uint8, _a1 error) *LinkTokenInterface_Decimals_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *LinkTokenInterface_Decimals_Call) RunAndReturn(run func(*bind.CallOpts) (uint8, error)) *LinkTokenInterface_Decimals_Call { + _c.Call.Return(run) + return _c +} + +// DecreaseApproval provides a mock function with given fields: opts, _spender, _subtractedValue +func (_m *LinkTokenInterface) DecreaseApproval(opts *bind.TransactOpts, _spender common.Address, _subtractedValue *big.Int) (*types.Transaction, error) { + ret := _m.Called(opts, _spender, _subtractedValue) + + if len(ret) == 0 { + panic("no return value specified for DecreaseApproval") + } + + var r0 *types.Transaction + var r1 error + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, common.Address, *big.Int) (*types.Transaction, error)); ok { + return rf(opts, _spender, _subtractedValue) + } + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, common.Address, *big.Int) *types.Transaction); ok { + r0 = rf(opts, _spender, _subtractedValue) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Transaction) + } + } + + if rf, ok := ret.Get(1).(func(*bind.TransactOpts, common.Address, *big.Int) error); ok { + r1 = rf(opts, _spender, _subtractedValue) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// LinkTokenInterface_DecreaseApproval_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DecreaseApproval' +type LinkTokenInterface_DecreaseApproval_Call struct { + *mock.Call +} + +// DecreaseApproval is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - _spender common.Address +// - _subtractedValue *big.Int +func (_e *LinkTokenInterface_Expecter) DecreaseApproval(opts interface{}, _spender interface{}, _subtractedValue interface{}) *LinkTokenInterface_DecreaseApproval_Call { + return &LinkTokenInterface_DecreaseApproval_Call{Call: _e.mock.On("DecreaseApproval", opts, _spender, _subtractedValue)} +} + +func (_c *LinkTokenInterface_DecreaseApproval_Call) Run(run func(opts *bind.TransactOpts, _spender common.Address, _subtractedValue *big.Int)) *LinkTokenInterface_DecreaseApproval_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].(common.Address), args[2].(*big.Int)) + }) + return _c +} + +func (_c *LinkTokenInterface_DecreaseApproval_Call) Return(_a0 *types.Transaction, _a1 error) *LinkTokenInterface_DecreaseApproval_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *LinkTokenInterface_DecreaseApproval_Call) RunAndReturn(run func(*bind.TransactOpts, common.Address, *big.Int) (*types.Transaction, error)) *LinkTokenInterface_DecreaseApproval_Call { + _c.Call.Return(run) + return _c +} + +// FilterApproval provides a mock function with given fields: opts, owner, spender +func (_m *LinkTokenInterface) FilterApproval(opts *bind.FilterOpts, owner []common.Address, spender []common.Address) (*link_token_interface.LinkTokenApprovalIterator, error) { + ret := _m.Called(opts, owner, spender) + + if len(ret) == 0 { + panic("no return value specified for FilterApproval") + } + + var r0 *link_token_interface.LinkTokenApprovalIterator + var r1 error + if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []common.Address, []common.Address) (*link_token_interface.LinkTokenApprovalIterator, error)); ok { + return rf(opts, owner, spender) + } + if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []common.Address, []common.Address) *link_token_interface.LinkTokenApprovalIterator); ok { + r0 = rf(opts, owner, spender) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*link_token_interface.LinkTokenApprovalIterator) + } + } + + if rf, ok := ret.Get(1).(func(*bind.FilterOpts, []common.Address, []common.Address) error); ok { + r1 = rf(opts, owner, spender) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// LinkTokenInterface_FilterApproval_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterApproval' +type LinkTokenInterface_FilterApproval_Call struct { + *mock.Call +} + +// FilterApproval is a helper method to define mock.On call +// - opts *bind.FilterOpts +// - owner []common.Address +// - spender []common.Address +func (_e *LinkTokenInterface_Expecter) FilterApproval(opts interface{}, owner interface{}, spender interface{}) *LinkTokenInterface_FilterApproval_Call { + return &LinkTokenInterface_FilterApproval_Call{Call: _e.mock.On("FilterApproval", opts, owner, spender)} +} + +func (_c *LinkTokenInterface_FilterApproval_Call) Run(run func(opts *bind.FilterOpts, owner []common.Address, spender []common.Address)) *LinkTokenInterface_FilterApproval_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts), args[1].([]common.Address), args[2].([]common.Address)) + }) + return _c +} + +func (_c *LinkTokenInterface_FilterApproval_Call) Return(_a0 *link_token_interface.LinkTokenApprovalIterator, _a1 error) *LinkTokenInterface_FilterApproval_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *LinkTokenInterface_FilterApproval_Call) RunAndReturn(run func(*bind.FilterOpts, []common.Address, []common.Address) (*link_token_interface.LinkTokenApprovalIterator, error)) *LinkTokenInterface_FilterApproval_Call { + _c.Call.Return(run) + return _c +} + +// FilterTransfer provides a mock function with given fields: opts, from, to +func (_m *LinkTokenInterface) FilterTransfer(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*link_token_interface.LinkTokenTransferIterator, error) { + ret := _m.Called(opts, from, to) + + if len(ret) == 0 { + panic("no return value specified for FilterTransfer") + } + + var r0 *link_token_interface.LinkTokenTransferIterator + var r1 error + if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []common.Address, []common.Address) (*link_token_interface.LinkTokenTransferIterator, error)); ok { + return rf(opts, from, to) + } + if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []common.Address, []common.Address) *link_token_interface.LinkTokenTransferIterator); ok { + r0 = rf(opts, from, to) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*link_token_interface.LinkTokenTransferIterator) + } + } + + if rf, ok := ret.Get(1).(func(*bind.FilterOpts, []common.Address, []common.Address) error); ok { + r1 = rf(opts, from, to) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// LinkTokenInterface_FilterTransfer_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterTransfer' +type LinkTokenInterface_FilterTransfer_Call struct { + *mock.Call +} + +// FilterTransfer is a helper method to define mock.On call +// - opts *bind.FilterOpts +// - from []common.Address +// - to []common.Address +func (_e *LinkTokenInterface_Expecter) FilterTransfer(opts interface{}, from interface{}, to interface{}) *LinkTokenInterface_FilterTransfer_Call { + return &LinkTokenInterface_FilterTransfer_Call{Call: _e.mock.On("FilterTransfer", opts, from, to)} +} + +func (_c *LinkTokenInterface_FilterTransfer_Call) Run(run func(opts *bind.FilterOpts, from []common.Address, to []common.Address)) *LinkTokenInterface_FilterTransfer_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts), args[1].([]common.Address), args[2].([]common.Address)) + }) + return _c +} + +func (_c *LinkTokenInterface_FilterTransfer_Call) Return(_a0 *link_token_interface.LinkTokenTransferIterator, _a1 error) *LinkTokenInterface_FilterTransfer_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *LinkTokenInterface_FilterTransfer_Call) RunAndReturn(run func(*bind.FilterOpts, []common.Address, []common.Address) (*link_token_interface.LinkTokenTransferIterator, error)) *LinkTokenInterface_FilterTransfer_Call { + _c.Call.Return(run) + return _c +} + +// IncreaseApproval provides a mock function with given fields: opts, _spender, _addedValue +func (_m *LinkTokenInterface) IncreaseApproval(opts *bind.TransactOpts, _spender common.Address, _addedValue *big.Int) (*types.Transaction, error) { + ret := _m.Called(opts, _spender, _addedValue) + + if len(ret) == 0 { + panic("no return value specified for IncreaseApproval") + } + + var r0 *types.Transaction + var r1 error + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, common.Address, *big.Int) (*types.Transaction, error)); ok { + return rf(opts, _spender, _addedValue) + } + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, common.Address, *big.Int) *types.Transaction); ok { + r0 = rf(opts, _spender, _addedValue) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Transaction) + } + } + + if rf, ok := ret.Get(1).(func(*bind.TransactOpts, common.Address, *big.Int) error); ok { + r1 = rf(opts, _spender, _addedValue) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// LinkTokenInterface_IncreaseApproval_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IncreaseApproval' +type LinkTokenInterface_IncreaseApproval_Call struct { + *mock.Call +} + +// IncreaseApproval is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - _spender common.Address +// - _addedValue *big.Int +func (_e *LinkTokenInterface_Expecter) IncreaseApproval(opts interface{}, _spender interface{}, _addedValue interface{}) *LinkTokenInterface_IncreaseApproval_Call { + return &LinkTokenInterface_IncreaseApproval_Call{Call: _e.mock.On("IncreaseApproval", opts, _spender, _addedValue)} +} + +func (_c *LinkTokenInterface_IncreaseApproval_Call) Run(run func(opts *bind.TransactOpts, _spender common.Address, _addedValue *big.Int)) *LinkTokenInterface_IncreaseApproval_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].(common.Address), args[2].(*big.Int)) + }) + return _c +} + +func (_c *LinkTokenInterface_IncreaseApproval_Call) Return(_a0 *types.Transaction, _a1 error) *LinkTokenInterface_IncreaseApproval_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *LinkTokenInterface_IncreaseApproval_Call) RunAndReturn(run func(*bind.TransactOpts, common.Address, *big.Int) (*types.Transaction, error)) *LinkTokenInterface_IncreaseApproval_Call { + _c.Call.Return(run) + return _c +} + +// Name provides a mock function with given fields: opts +func (_m *LinkTokenInterface) Name(opts *bind.CallOpts) (string, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for Name") + } + + var r0 string + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts) (string, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts) string); ok { + r0 = rf(opts) + } else { + r0 = ret.Get(0).(string) + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// LinkTokenInterface_Name_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Name' +type LinkTokenInterface_Name_Call struct { + *mock.Call +} + +// Name is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *LinkTokenInterface_Expecter) Name(opts interface{}) *LinkTokenInterface_Name_Call { + return &LinkTokenInterface_Name_Call{Call: _e.mock.On("Name", opts)} +} + +func (_c *LinkTokenInterface_Name_Call) Run(run func(opts *bind.CallOpts)) *LinkTokenInterface_Name_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *LinkTokenInterface_Name_Call) Return(_a0 string, _a1 error) *LinkTokenInterface_Name_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *LinkTokenInterface_Name_Call) RunAndReturn(run func(*bind.CallOpts) (string, error)) *LinkTokenInterface_Name_Call { + _c.Call.Return(run) + return _c +} + +// ParseApproval provides a mock function with given fields: log +func (_m *LinkTokenInterface) ParseApproval(log types.Log) (*link_token_interface.LinkTokenApproval, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParseApproval") + } + + var r0 *link_token_interface.LinkTokenApproval + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (*link_token_interface.LinkTokenApproval, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) *link_token_interface.LinkTokenApproval); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*link_token_interface.LinkTokenApproval) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// LinkTokenInterface_ParseApproval_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseApproval' +type LinkTokenInterface_ParseApproval_Call struct { + *mock.Call +} + +// ParseApproval is a helper method to define mock.On call +// - log types.Log +func (_e *LinkTokenInterface_Expecter) ParseApproval(log interface{}) *LinkTokenInterface_ParseApproval_Call { + return &LinkTokenInterface_ParseApproval_Call{Call: _e.mock.On("ParseApproval", log)} +} + +func (_c *LinkTokenInterface_ParseApproval_Call) Run(run func(log types.Log)) *LinkTokenInterface_ParseApproval_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *LinkTokenInterface_ParseApproval_Call) Return(_a0 *link_token_interface.LinkTokenApproval, _a1 error) *LinkTokenInterface_ParseApproval_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *LinkTokenInterface_ParseApproval_Call) RunAndReturn(run func(types.Log) (*link_token_interface.LinkTokenApproval, error)) *LinkTokenInterface_ParseApproval_Call { + _c.Call.Return(run) + return _c +} + +// ParseLog provides a mock function with given fields: log +func (_m *LinkTokenInterface) ParseLog(log types.Log) (generated.AbigenLog, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParseLog") + } + + var r0 generated.AbigenLog + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (generated.AbigenLog, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) generated.AbigenLog); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(generated.AbigenLog) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// LinkTokenInterface_ParseLog_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseLog' +type LinkTokenInterface_ParseLog_Call struct { + *mock.Call +} + +// ParseLog is a helper method to define mock.On call +// - log types.Log +func (_e *LinkTokenInterface_Expecter) ParseLog(log interface{}) *LinkTokenInterface_ParseLog_Call { + return &LinkTokenInterface_ParseLog_Call{Call: _e.mock.On("ParseLog", log)} +} + +func (_c *LinkTokenInterface_ParseLog_Call) Run(run func(log types.Log)) *LinkTokenInterface_ParseLog_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *LinkTokenInterface_ParseLog_Call) Return(_a0 generated.AbigenLog, _a1 error) *LinkTokenInterface_ParseLog_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *LinkTokenInterface_ParseLog_Call) RunAndReturn(run func(types.Log) (generated.AbigenLog, error)) *LinkTokenInterface_ParseLog_Call { + _c.Call.Return(run) + return _c +} + +// ParseTransfer provides a mock function with given fields: log +func (_m *LinkTokenInterface) ParseTransfer(log types.Log) (*link_token_interface.LinkTokenTransfer, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParseTransfer") + } + + var r0 *link_token_interface.LinkTokenTransfer + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (*link_token_interface.LinkTokenTransfer, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) *link_token_interface.LinkTokenTransfer); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*link_token_interface.LinkTokenTransfer) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// LinkTokenInterface_ParseTransfer_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseTransfer' +type LinkTokenInterface_ParseTransfer_Call struct { + *mock.Call +} + +// ParseTransfer is a helper method to define mock.On call +// - log types.Log +func (_e *LinkTokenInterface_Expecter) ParseTransfer(log interface{}) *LinkTokenInterface_ParseTransfer_Call { + return &LinkTokenInterface_ParseTransfer_Call{Call: _e.mock.On("ParseTransfer", log)} +} + +func (_c *LinkTokenInterface_ParseTransfer_Call) Run(run func(log types.Log)) *LinkTokenInterface_ParseTransfer_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *LinkTokenInterface_ParseTransfer_Call) Return(_a0 *link_token_interface.LinkTokenTransfer, _a1 error) *LinkTokenInterface_ParseTransfer_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *LinkTokenInterface_ParseTransfer_Call) RunAndReturn(run func(types.Log) (*link_token_interface.LinkTokenTransfer, error)) *LinkTokenInterface_ParseTransfer_Call { + _c.Call.Return(run) + return _c +} + +// Symbol provides a mock function with given fields: opts +func (_m *LinkTokenInterface) Symbol(opts *bind.CallOpts) (string, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for Symbol") + } + + var r0 string + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts) (string, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts) string); ok { + r0 = rf(opts) + } else { + r0 = ret.Get(0).(string) + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// LinkTokenInterface_Symbol_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Symbol' +type LinkTokenInterface_Symbol_Call struct { + *mock.Call +} + +// Symbol is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *LinkTokenInterface_Expecter) Symbol(opts interface{}) *LinkTokenInterface_Symbol_Call { + return &LinkTokenInterface_Symbol_Call{Call: _e.mock.On("Symbol", opts)} +} + +func (_c *LinkTokenInterface_Symbol_Call) Run(run func(opts *bind.CallOpts)) *LinkTokenInterface_Symbol_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *LinkTokenInterface_Symbol_Call) Return(_a0 string, _a1 error) *LinkTokenInterface_Symbol_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *LinkTokenInterface_Symbol_Call) RunAndReturn(run func(*bind.CallOpts) (string, error)) *LinkTokenInterface_Symbol_Call { + _c.Call.Return(run) + return _c +} + +// TotalSupply provides a mock function with given fields: opts +func (_m *LinkTokenInterface) TotalSupply(opts *bind.CallOpts) (*big.Int, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for TotalSupply") + } + + var r0 *big.Int + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts) (*big.Int, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts) *big.Int); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*big.Int) + } + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// LinkTokenInterface_TotalSupply_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TotalSupply' +type LinkTokenInterface_TotalSupply_Call struct { + *mock.Call +} + +// TotalSupply is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *LinkTokenInterface_Expecter) TotalSupply(opts interface{}) *LinkTokenInterface_TotalSupply_Call { + return &LinkTokenInterface_TotalSupply_Call{Call: _e.mock.On("TotalSupply", opts)} +} + +func (_c *LinkTokenInterface_TotalSupply_Call) Run(run func(opts *bind.CallOpts)) *LinkTokenInterface_TotalSupply_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *LinkTokenInterface_TotalSupply_Call) Return(_a0 *big.Int, _a1 error) *LinkTokenInterface_TotalSupply_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *LinkTokenInterface_TotalSupply_Call) RunAndReturn(run func(*bind.CallOpts) (*big.Int, error)) *LinkTokenInterface_TotalSupply_Call { + _c.Call.Return(run) + return _c +} + +// Transfer provides a mock function with given fields: opts, _to, _value +func (_m *LinkTokenInterface) Transfer(opts *bind.TransactOpts, _to common.Address, _value *big.Int) (*types.Transaction, error) { + ret := _m.Called(opts, _to, _value) + + if len(ret) == 0 { + panic("no return value specified for Transfer") + } + + var r0 *types.Transaction + var r1 error + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, common.Address, *big.Int) (*types.Transaction, error)); ok { + return rf(opts, _to, _value) + } + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, common.Address, *big.Int) *types.Transaction); ok { + r0 = rf(opts, _to, _value) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Transaction) + } + } + + if rf, ok := ret.Get(1).(func(*bind.TransactOpts, common.Address, *big.Int) error); ok { + r1 = rf(opts, _to, _value) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// LinkTokenInterface_Transfer_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Transfer' +type LinkTokenInterface_Transfer_Call struct { + *mock.Call +} + +// Transfer is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - _to common.Address +// - _value *big.Int +func (_e *LinkTokenInterface_Expecter) Transfer(opts interface{}, _to interface{}, _value interface{}) *LinkTokenInterface_Transfer_Call { + return &LinkTokenInterface_Transfer_Call{Call: _e.mock.On("Transfer", opts, _to, _value)} +} + +func (_c *LinkTokenInterface_Transfer_Call) Run(run func(opts *bind.TransactOpts, _to common.Address, _value *big.Int)) *LinkTokenInterface_Transfer_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].(common.Address), args[2].(*big.Int)) + }) + return _c +} + +func (_c *LinkTokenInterface_Transfer_Call) Return(_a0 *types.Transaction, _a1 error) *LinkTokenInterface_Transfer_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *LinkTokenInterface_Transfer_Call) RunAndReturn(run func(*bind.TransactOpts, common.Address, *big.Int) (*types.Transaction, error)) *LinkTokenInterface_Transfer_Call { + _c.Call.Return(run) + return _c +} + +// TransferAndCall provides a mock function with given fields: opts, _to, _value, _data +func (_m *LinkTokenInterface) TransferAndCall(opts *bind.TransactOpts, _to common.Address, _value *big.Int, _data []byte) (*types.Transaction, error) { + ret := _m.Called(opts, _to, _value, _data) + + if len(ret) == 0 { + panic("no return value specified for TransferAndCall") + } + + var r0 *types.Transaction + var r1 error + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, common.Address, *big.Int, []byte) (*types.Transaction, error)); ok { + return rf(opts, _to, _value, _data) + } + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, common.Address, *big.Int, []byte) *types.Transaction); ok { + r0 = rf(opts, _to, _value, _data) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Transaction) + } + } + + if rf, ok := ret.Get(1).(func(*bind.TransactOpts, common.Address, *big.Int, []byte) error); ok { + r1 = rf(opts, _to, _value, _data) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// LinkTokenInterface_TransferAndCall_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TransferAndCall' +type LinkTokenInterface_TransferAndCall_Call struct { + *mock.Call +} + +// TransferAndCall is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - _to common.Address +// - _value *big.Int +// - _data []byte +func (_e *LinkTokenInterface_Expecter) TransferAndCall(opts interface{}, _to interface{}, _value interface{}, _data interface{}) *LinkTokenInterface_TransferAndCall_Call { + return &LinkTokenInterface_TransferAndCall_Call{Call: _e.mock.On("TransferAndCall", opts, _to, _value, _data)} +} + +func (_c *LinkTokenInterface_TransferAndCall_Call) Run(run func(opts *bind.TransactOpts, _to common.Address, _value *big.Int, _data []byte)) *LinkTokenInterface_TransferAndCall_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].(common.Address), args[2].(*big.Int), args[3].([]byte)) + }) + return _c +} + +func (_c *LinkTokenInterface_TransferAndCall_Call) Return(_a0 *types.Transaction, _a1 error) *LinkTokenInterface_TransferAndCall_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *LinkTokenInterface_TransferAndCall_Call) RunAndReturn(run func(*bind.TransactOpts, common.Address, *big.Int, []byte) (*types.Transaction, error)) *LinkTokenInterface_TransferAndCall_Call { + _c.Call.Return(run) + return _c +} + +// TransferFrom provides a mock function with given fields: opts, _from, _to, _value +func (_m *LinkTokenInterface) TransferFrom(opts *bind.TransactOpts, _from common.Address, _to common.Address, _value *big.Int) (*types.Transaction, error) { + ret := _m.Called(opts, _from, _to, _value) + + if len(ret) == 0 { + panic("no return value specified for TransferFrom") + } + + var r0 *types.Transaction + var r1 error + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, common.Address, common.Address, *big.Int) (*types.Transaction, error)); ok { + return rf(opts, _from, _to, _value) + } + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, common.Address, common.Address, *big.Int) *types.Transaction); ok { + r0 = rf(opts, _from, _to, _value) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Transaction) + } + } + + if rf, ok := ret.Get(1).(func(*bind.TransactOpts, common.Address, common.Address, *big.Int) error); ok { + r1 = rf(opts, _from, _to, _value) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// LinkTokenInterface_TransferFrom_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TransferFrom' +type LinkTokenInterface_TransferFrom_Call struct { + *mock.Call +} + +// TransferFrom is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - _from common.Address +// - _to common.Address +// - _value *big.Int +func (_e *LinkTokenInterface_Expecter) TransferFrom(opts interface{}, _from interface{}, _to interface{}, _value interface{}) *LinkTokenInterface_TransferFrom_Call { + return &LinkTokenInterface_TransferFrom_Call{Call: _e.mock.On("TransferFrom", opts, _from, _to, _value)} +} + +func (_c *LinkTokenInterface_TransferFrom_Call) Run(run func(opts *bind.TransactOpts, _from common.Address, _to common.Address, _value *big.Int)) *LinkTokenInterface_TransferFrom_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].(common.Address), args[2].(common.Address), args[3].(*big.Int)) + }) + return _c +} + +func (_c *LinkTokenInterface_TransferFrom_Call) Return(_a0 *types.Transaction, _a1 error) *LinkTokenInterface_TransferFrom_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *LinkTokenInterface_TransferFrom_Call) RunAndReturn(run func(*bind.TransactOpts, common.Address, common.Address, *big.Int) (*types.Transaction, error)) *LinkTokenInterface_TransferFrom_Call { + _c.Call.Return(run) + return _c +} + +// WatchApproval provides a mock function with given fields: opts, sink, owner, spender +func (_m *LinkTokenInterface) WatchApproval(opts *bind.WatchOpts, sink chan<- *link_token_interface.LinkTokenApproval, owner []common.Address, spender []common.Address) (event.Subscription, error) { + ret := _m.Called(opts, sink, owner, spender) + + if len(ret) == 0 { + panic("no return value specified for WatchApproval") + } + + var r0 event.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *link_token_interface.LinkTokenApproval, []common.Address, []common.Address) (event.Subscription, error)); ok { + return rf(opts, sink, owner, spender) + } + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *link_token_interface.LinkTokenApproval, []common.Address, []common.Address) event.Subscription); ok { + r0 = rf(opts, sink, owner, spender) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(event.Subscription) + } + } + + if rf, ok := ret.Get(1).(func(*bind.WatchOpts, chan<- *link_token_interface.LinkTokenApproval, []common.Address, []common.Address) error); ok { + r1 = rf(opts, sink, owner, spender) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// LinkTokenInterface_WatchApproval_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchApproval' +type LinkTokenInterface_WatchApproval_Call struct { + *mock.Call +} + +// WatchApproval is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *link_token_interface.LinkTokenApproval +// - owner []common.Address +// - spender []common.Address +func (_e *LinkTokenInterface_Expecter) WatchApproval(opts interface{}, sink interface{}, owner interface{}, spender interface{}) *LinkTokenInterface_WatchApproval_Call { + return &LinkTokenInterface_WatchApproval_Call{Call: _e.mock.On("WatchApproval", opts, sink, owner, spender)} +} + +func (_c *LinkTokenInterface_WatchApproval_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *link_token_interface.LinkTokenApproval, owner []common.Address, spender []common.Address)) *LinkTokenInterface_WatchApproval_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *link_token_interface.LinkTokenApproval), args[2].([]common.Address), args[3].([]common.Address)) + }) + return _c +} + +func (_c *LinkTokenInterface_WatchApproval_Call) Return(_a0 event.Subscription, _a1 error) *LinkTokenInterface_WatchApproval_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *LinkTokenInterface_WatchApproval_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *link_token_interface.LinkTokenApproval, []common.Address, []common.Address) (event.Subscription, error)) *LinkTokenInterface_WatchApproval_Call { + _c.Call.Return(run) + return _c +} + +// WatchTransfer provides a mock function with given fields: opts, sink, from, to +func (_m *LinkTokenInterface) WatchTransfer(opts *bind.WatchOpts, sink chan<- *link_token_interface.LinkTokenTransfer, from []common.Address, to []common.Address) (event.Subscription, error) { + ret := _m.Called(opts, sink, from, to) + + if len(ret) == 0 { + panic("no return value specified for WatchTransfer") + } + + var r0 event.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *link_token_interface.LinkTokenTransfer, []common.Address, []common.Address) (event.Subscription, error)); ok { + return rf(opts, sink, from, to) + } + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *link_token_interface.LinkTokenTransfer, []common.Address, []common.Address) event.Subscription); ok { + r0 = rf(opts, sink, from, to) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(event.Subscription) + } + } + + if rf, ok := ret.Get(1).(func(*bind.WatchOpts, chan<- *link_token_interface.LinkTokenTransfer, []common.Address, []common.Address) error); ok { + r1 = rf(opts, sink, from, to) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// LinkTokenInterface_WatchTransfer_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchTransfer' +type LinkTokenInterface_WatchTransfer_Call struct { + *mock.Call +} + +// WatchTransfer is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *link_token_interface.LinkTokenTransfer +// - from []common.Address +// - to []common.Address +func (_e *LinkTokenInterface_Expecter) WatchTransfer(opts interface{}, sink interface{}, from interface{}, to interface{}) *LinkTokenInterface_WatchTransfer_Call { + return &LinkTokenInterface_WatchTransfer_Call{Call: _e.mock.On("WatchTransfer", opts, sink, from, to)} +} + +func (_c *LinkTokenInterface_WatchTransfer_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *link_token_interface.LinkTokenTransfer, from []common.Address, to []common.Address)) *LinkTokenInterface_WatchTransfer_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *link_token_interface.LinkTokenTransfer), args[2].([]common.Address), args[3].([]common.Address)) + }) + return _c +} + +func (_c *LinkTokenInterface_WatchTransfer_Call) Return(_a0 event.Subscription, _a1 error) *LinkTokenInterface_WatchTransfer_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *LinkTokenInterface_WatchTransfer_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *link_token_interface.LinkTokenTransfer, []common.Address, []common.Address) (event.Subscription, error)) *LinkTokenInterface_WatchTransfer_Call { + _c.Call.Return(run) + return _c +} + +// NewLinkTokenInterface creates a new instance of LinkTokenInterface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewLinkTokenInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *LinkTokenInterface { + mock := &LinkTokenInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/core/gethwrappers/ccip/mocks/v1_0_0/evm2_evm_off_ramp_interface.go b/core/gethwrappers/ccip/mocks/v1_0_0/evm2_evm_off_ramp_interface.go new file mode 100644 index 00000000000..cefb2c26841 --- /dev/null +++ b/core/gethwrappers/ccip/mocks/v1_0_0/evm2_evm_off_ramp_interface.go @@ -0,0 +1,3603 @@ +// Code generated by mockery v2.43.2. DO NOT EDIT. + +package mock_contracts + +import ( + big "math/big" + + bind "github.com/ethereum/go-ethereum/accounts/abi/bind" + common "github.com/ethereum/go-ethereum/common" + + event "github.com/ethereum/go-ethereum/event" + + evm_2_evm_offramp_1_0_0 "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/evm_2_evm_offramp_1_0_0" + + generated "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" + + mock "github.com/stretchr/testify/mock" + + types "github.com/ethereum/go-ethereum/core/types" +) + +// EVM2EVMOffRampInterface is an autogenerated mock type for the EVM2EVMOffRampInterface type +type EVM2EVMOffRampInterface struct { + mock.Mock +} + +type EVM2EVMOffRampInterface_Expecter struct { + mock *mock.Mock +} + +func (_m *EVM2EVMOffRampInterface) EXPECT() *EVM2EVMOffRampInterface_Expecter { + return &EVM2EVMOffRampInterface_Expecter{mock: &_m.Mock} +} + +// AcceptOwnership provides a mock function with given fields: opts +func (_m *EVM2EVMOffRampInterface) AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for AcceptOwnership") + } + + var r0 *types.Transaction + var r1 error + if rf, ok := ret.Get(0).(func(*bind.TransactOpts) (*types.Transaction, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.TransactOpts) *types.Transaction); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Transaction) + } + } + + if rf, ok := ret.Get(1).(func(*bind.TransactOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_AcceptOwnership_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AcceptOwnership' +type EVM2EVMOffRampInterface_AcceptOwnership_Call struct { + *mock.Call +} + +// AcceptOwnership is a helper method to define mock.On call +// - opts *bind.TransactOpts +func (_e *EVM2EVMOffRampInterface_Expecter) AcceptOwnership(opts interface{}) *EVM2EVMOffRampInterface_AcceptOwnership_Call { + return &EVM2EVMOffRampInterface_AcceptOwnership_Call{Call: _e.mock.On("AcceptOwnership", opts)} +} + +func (_c *EVM2EVMOffRampInterface_AcceptOwnership_Call) Run(run func(opts *bind.TransactOpts)) *EVM2EVMOffRampInterface_AcceptOwnership_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_AcceptOwnership_Call) Return(_a0 *types.Transaction, _a1 error) *EVM2EVMOffRampInterface_AcceptOwnership_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_AcceptOwnership_Call) RunAndReturn(run func(*bind.TransactOpts) (*types.Transaction, error)) *EVM2EVMOffRampInterface_AcceptOwnership_Call { + _c.Call.Return(run) + return _c +} + +// Address provides a mock function with given fields: +func (_m *EVM2EVMOffRampInterface) Address() common.Address { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Address") + } + + var r0 common.Address + if rf, ok := ret.Get(0).(func() common.Address); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Address) + } + } + + return r0 +} + +// EVM2EVMOffRampInterface_Address_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Address' +type EVM2EVMOffRampInterface_Address_Call struct { + *mock.Call +} + +// Address is a helper method to define mock.On call +func (_e *EVM2EVMOffRampInterface_Expecter) Address() *EVM2EVMOffRampInterface_Address_Call { + return &EVM2EVMOffRampInterface_Address_Call{Call: _e.mock.On("Address")} +} + +func (_c *EVM2EVMOffRampInterface_Address_Call) Run(run func()) *EVM2EVMOffRampInterface_Address_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_Address_Call) Return(_a0 common.Address) *EVM2EVMOffRampInterface_Address_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *EVM2EVMOffRampInterface_Address_Call) RunAndReturn(run func() common.Address) *EVM2EVMOffRampInterface_Address_Call { + _c.Call.Return(run) + return _c +} + +// ApplyPoolUpdates provides a mock function with given fields: opts, removes, adds +func (_m *EVM2EVMOffRampInterface) ApplyPoolUpdates(opts *bind.TransactOpts, removes []evm_2_evm_offramp_1_0_0.InternalPoolUpdate, adds []evm_2_evm_offramp_1_0_0.InternalPoolUpdate) (*types.Transaction, error) { + ret := _m.Called(opts, removes, adds) + + if len(ret) == 0 { + panic("no return value specified for ApplyPoolUpdates") + } + + var r0 *types.Transaction + var r1 error + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, []evm_2_evm_offramp_1_0_0.InternalPoolUpdate, []evm_2_evm_offramp_1_0_0.InternalPoolUpdate) (*types.Transaction, error)); ok { + return rf(opts, removes, adds) + } + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, []evm_2_evm_offramp_1_0_0.InternalPoolUpdate, []evm_2_evm_offramp_1_0_0.InternalPoolUpdate) *types.Transaction); ok { + r0 = rf(opts, removes, adds) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Transaction) + } + } + + if rf, ok := ret.Get(1).(func(*bind.TransactOpts, []evm_2_evm_offramp_1_0_0.InternalPoolUpdate, []evm_2_evm_offramp_1_0_0.InternalPoolUpdate) error); ok { + r1 = rf(opts, removes, adds) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_ApplyPoolUpdates_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ApplyPoolUpdates' +type EVM2EVMOffRampInterface_ApplyPoolUpdates_Call struct { + *mock.Call +} + +// ApplyPoolUpdates is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - removes []evm_2_evm_offramp_1_0_0.InternalPoolUpdate +// - adds []evm_2_evm_offramp_1_0_0.InternalPoolUpdate +func (_e *EVM2EVMOffRampInterface_Expecter) ApplyPoolUpdates(opts interface{}, removes interface{}, adds interface{}) *EVM2EVMOffRampInterface_ApplyPoolUpdates_Call { + return &EVM2EVMOffRampInterface_ApplyPoolUpdates_Call{Call: _e.mock.On("ApplyPoolUpdates", opts, removes, adds)} +} + +func (_c *EVM2EVMOffRampInterface_ApplyPoolUpdates_Call) Run(run func(opts *bind.TransactOpts, removes []evm_2_evm_offramp_1_0_0.InternalPoolUpdate, adds []evm_2_evm_offramp_1_0_0.InternalPoolUpdate)) *EVM2EVMOffRampInterface_ApplyPoolUpdates_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].([]evm_2_evm_offramp_1_0_0.InternalPoolUpdate), args[2].([]evm_2_evm_offramp_1_0_0.InternalPoolUpdate)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_ApplyPoolUpdates_Call) Return(_a0 *types.Transaction, _a1 error) *EVM2EVMOffRampInterface_ApplyPoolUpdates_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_ApplyPoolUpdates_Call) RunAndReturn(run func(*bind.TransactOpts, []evm_2_evm_offramp_1_0_0.InternalPoolUpdate, []evm_2_evm_offramp_1_0_0.InternalPoolUpdate) (*types.Transaction, error)) *EVM2EVMOffRampInterface_ApplyPoolUpdates_Call { + _c.Call.Return(run) + return _c +} + +// CcipReceive provides a mock function with given fields: opts, arg0 +func (_m *EVM2EVMOffRampInterface) CcipReceive(opts *bind.CallOpts, arg0 evm_2_evm_offramp_1_0_0.ClientAny2EVMMessage) error { + ret := _m.Called(opts, arg0) + + if len(ret) == 0 { + panic("no return value specified for CcipReceive") + } + + var r0 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts, evm_2_evm_offramp_1_0_0.ClientAny2EVMMessage) error); ok { + r0 = rf(opts, arg0) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// EVM2EVMOffRampInterface_CcipReceive_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CcipReceive' +type EVM2EVMOffRampInterface_CcipReceive_Call struct { + *mock.Call +} + +// CcipReceive is a helper method to define mock.On call +// - opts *bind.CallOpts +// - arg0 evm_2_evm_offramp_1_0_0.ClientAny2EVMMessage +func (_e *EVM2EVMOffRampInterface_Expecter) CcipReceive(opts interface{}, arg0 interface{}) *EVM2EVMOffRampInterface_CcipReceive_Call { + return &EVM2EVMOffRampInterface_CcipReceive_Call{Call: _e.mock.On("CcipReceive", opts, arg0)} +} + +func (_c *EVM2EVMOffRampInterface_CcipReceive_Call) Run(run func(opts *bind.CallOpts, arg0 evm_2_evm_offramp_1_0_0.ClientAny2EVMMessage)) *EVM2EVMOffRampInterface_CcipReceive_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts), args[1].(evm_2_evm_offramp_1_0_0.ClientAny2EVMMessage)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_CcipReceive_Call) Return(_a0 error) *EVM2EVMOffRampInterface_CcipReceive_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *EVM2EVMOffRampInterface_CcipReceive_Call) RunAndReturn(run func(*bind.CallOpts, evm_2_evm_offramp_1_0_0.ClientAny2EVMMessage) error) *EVM2EVMOffRampInterface_CcipReceive_Call { + _c.Call.Return(run) + return _c +} + +// CurrentRateLimiterState provides a mock function with given fields: opts +func (_m *EVM2EVMOffRampInterface) CurrentRateLimiterState(opts *bind.CallOpts) (evm_2_evm_offramp_1_0_0.RateLimiterTokenBucket, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for CurrentRateLimiterState") + } + + var r0 evm_2_evm_offramp_1_0_0.RateLimiterTokenBucket + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts) (evm_2_evm_offramp_1_0_0.RateLimiterTokenBucket, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts) evm_2_evm_offramp_1_0_0.RateLimiterTokenBucket); ok { + r0 = rf(opts) + } else { + r0 = ret.Get(0).(evm_2_evm_offramp_1_0_0.RateLimiterTokenBucket) + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_CurrentRateLimiterState_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CurrentRateLimiterState' +type EVM2EVMOffRampInterface_CurrentRateLimiterState_Call struct { + *mock.Call +} + +// CurrentRateLimiterState is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *EVM2EVMOffRampInterface_Expecter) CurrentRateLimiterState(opts interface{}) *EVM2EVMOffRampInterface_CurrentRateLimiterState_Call { + return &EVM2EVMOffRampInterface_CurrentRateLimiterState_Call{Call: _e.mock.On("CurrentRateLimiterState", opts)} +} + +func (_c *EVM2EVMOffRampInterface_CurrentRateLimiterState_Call) Run(run func(opts *bind.CallOpts)) *EVM2EVMOffRampInterface_CurrentRateLimiterState_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_CurrentRateLimiterState_Call) Return(_a0 evm_2_evm_offramp_1_0_0.RateLimiterTokenBucket, _a1 error) *EVM2EVMOffRampInterface_CurrentRateLimiterState_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_CurrentRateLimiterState_Call) RunAndReturn(run func(*bind.CallOpts) (evm_2_evm_offramp_1_0_0.RateLimiterTokenBucket, error)) *EVM2EVMOffRampInterface_CurrentRateLimiterState_Call { + _c.Call.Return(run) + return _c +} + +// ExecuteSingleMessage provides a mock function with given fields: opts, message, offchainTokenData +func (_m *EVM2EVMOffRampInterface) ExecuteSingleMessage(opts *bind.TransactOpts, message evm_2_evm_offramp_1_0_0.InternalEVM2EVMMessage, offchainTokenData [][]byte) (*types.Transaction, error) { + ret := _m.Called(opts, message, offchainTokenData) + + if len(ret) == 0 { + panic("no return value specified for ExecuteSingleMessage") + } + + var r0 *types.Transaction + var r1 error + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, evm_2_evm_offramp_1_0_0.InternalEVM2EVMMessage, [][]byte) (*types.Transaction, error)); ok { + return rf(opts, message, offchainTokenData) + } + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, evm_2_evm_offramp_1_0_0.InternalEVM2EVMMessage, [][]byte) *types.Transaction); ok { + r0 = rf(opts, message, offchainTokenData) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Transaction) + } + } + + if rf, ok := ret.Get(1).(func(*bind.TransactOpts, evm_2_evm_offramp_1_0_0.InternalEVM2EVMMessage, [][]byte) error); ok { + r1 = rf(opts, message, offchainTokenData) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_ExecuteSingleMessage_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ExecuteSingleMessage' +type EVM2EVMOffRampInterface_ExecuteSingleMessage_Call struct { + *mock.Call +} + +// ExecuteSingleMessage is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - message evm_2_evm_offramp_1_0_0.InternalEVM2EVMMessage +// - offchainTokenData [][]byte +func (_e *EVM2EVMOffRampInterface_Expecter) ExecuteSingleMessage(opts interface{}, message interface{}, offchainTokenData interface{}) *EVM2EVMOffRampInterface_ExecuteSingleMessage_Call { + return &EVM2EVMOffRampInterface_ExecuteSingleMessage_Call{Call: _e.mock.On("ExecuteSingleMessage", opts, message, offchainTokenData)} +} + +func (_c *EVM2EVMOffRampInterface_ExecuteSingleMessage_Call) Run(run func(opts *bind.TransactOpts, message evm_2_evm_offramp_1_0_0.InternalEVM2EVMMessage, offchainTokenData [][]byte)) *EVM2EVMOffRampInterface_ExecuteSingleMessage_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].(evm_2_evm_offramp_1_0_0.InternalEVM2EVMMessage), args[2].([][]byte)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_ExecuteSingleMessage_Call) Return(_a0 *types.Transaction, _a1 error) *EVM2EVMOffRampInterface_ExecuteSingleMessage_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_ExecuteSingleMessage_Call) RunAndReturn(run func(*bind.TransactOpts, evm_2_evm_offramp_1_0_0.InternalEVM2EVMMessage, [][]byte) (*types.Transaction, error)) *EVM2EVMOffRampInterface_ExecuteSingleMessage_Call { + _c.Call.Return(run) + return _c +} + +// FilterAdminSet provides a mock function with given fields: opts +func (_m *EVM2EVMOffRampInterface) FilterAdminSet(opts *bind.FilterOpts) (*evm_2_evm_offramp_1_0_0.EVM2EVMOffRampAdminSetIterator, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for FilterAdminSet") + } + + var r0 *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampAdminSetIterator + var r1 error + if rf, ok := ret.Get(0).(func(*bind.FilterOpts) (*evm_2_evm_offramp_1_0_0.EVM2EVMOffRampAdminSetIterator, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.FilterOpts) *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampAdminSetIterator); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*evm_2_evm_offramp_1_0_0.EVM2EVMOffRampAdminSetIterator) + } + } + + if rf, ok := ret.Get(1).(func(*bind.FilterOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_FilterAdminSet_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterAdminSet' +type EVM2EVMOffRampInterface_FilterAdminSet_Call struct { + *mock.Call +} + +// FilterAdminSet is a helper method to define mock.On call +// - opts *bind.FilterOpts +func (_e *EVM2EVMOffRampInterface_Expecter) FilterAdminSet(opts interface{}) *EVM2EVMOffRampInterface_FilterAdminSet_Call { + return &EVM2EVMOffRampInterface_FilterAdminSet_Call{Call: _e.mock.On("FilterAdminSet", opts)} +} + +func (_c *EVM2EVMOffRampInterface_FilterAdminSet_Call) Run(run func(opts *bind.FilterOpts)) *EVM2EVMOffRampInterface_FilterAdminSet_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_FilterAdminSet_Call) Return(_a0 *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampAdminSetIterator, _a1 error) *EVM2EVMOffRampInterface_FilterAdminSet_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_FilterAdminSet_Call) RunAndReturn(run func(*bind.FilterOpts) (*evm_2_evm_offramp_1_0_0.EVM2EVMOffRampAdminSetIterator, error)) *EVM2EVMOffRampInterface_FilterAdminSet_Call { + _c.Call.Return(run) + return _c +} + +// FilterConfigSet provides a mock function with given fields: opts +func (_m *EVM2EVMOffRampInterface) FilterConfigSet(opts *bind.FilterOpts) (*evm_2_evm_offramp_1_0_0.EVM2EVMOffRampConfigSetIterator, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for FilterConfigSet") + } + + var r0 *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampConfigSetIterator + var r1 error + if rf, ok := ret.Get(0).(func(*bind.FilterOpts) (*evm_2_evm_offramp_1_0_0.EVM2EVMOffRampConfigSetIterator, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.FilterOpts) *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampConfigSetIterator); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*evm_2_evm_offramp_1_0_0.EVM2EVMOffRampConfigSetIterator) + } + } + + if rf, ok := ret.Get(1).(func(*bind.FilterOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_FilterConfigSet_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterConfigSet' +type EVM2EVMOffRampInterface_FilterConfigSet_Call struct { + *mock.Call +} + +// FilterConfigSet is a helper method to define mock.On call +// - opts *bind.FilterOpts +func (_e *EVM2EVMOffRampInterface_Expecter) FilterConfigSet(opts interface{}) *EVM2EVMOffRampInterface_FilterConfigSet_Call { + return &EVM2EVMOffRampInterface_FilterConfigSet_Call{Call: _e.mock.On("FilterConfigSet", opts)} +} + +func (_c *EVM2EVMOffRampInterface_FilterConfigSet_Call) Run(run func(opts *bind.FilterOpts)) *EVM2EVMOffRampInterface_FilterConfigSet_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_FilterConfigSet_Call) Return(_a0 *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampConfigSetIterator, _a1 error) *EVM2EVMOffRampInterface_FilterConfigSet_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_FilterConfigSet_Call) RunAndReturn(run func(*bind.FilterOpts) (*evm_2_evm_offramp_1_0_0.EVM2EVMOffRampConfigSetIterator, error)) *EVM2EVMOffRampInterface_FilterConfigSet_Call { + _c.Call.Return(run) + return _c +} + +// FilterConfigSet0 provides a mock function with given fields: opts +func (_m *EVM2EVMOffRampInterface) FilterConfigSet0(opts *bind.FilterOpts) (*evm_2_evm_offramp_1_0_0.EVM2EVMOffRampConfigSet0Iterator, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for FilterConfigSet0") + } + + var r0 *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampConfigSet0Iterator + var r1 error + if rf, ok := ret.Get(0).(func(*bind.FilterOpts) (*evm_2_evm_offramp_1_0_0.EVM2EVMOffRampConfigSet0Iterator, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.FilterOpts) *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampConfigSet0Iterator); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*evm_2_evm_offramp_1_0_0.EVM2EVMOffRampConfigSet0Iterator) + } + } + + if rf, ok := ret.Get(1).(func(*bind.FilterOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_FilterConfigSet0_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterConfigSet0' +type EVM2EVMOffRampInterface_FilterConfigSet0_Call struct { + *mock.Call +} + +// FilterConfigSet0 is a helper method to define mock.On call +// - opts *bind.FilterOpts +func (_e *EVM2EVMOffRampInterface_Expecter) FilterConfigSet0(opts interface{}) *EVM2EVMOffRampInterface_FilterConfigSet0_Call { + return &EVM2EVMOffRampInterface_FilterConfigSet0_Call{Call: _e.mock.On("FilterConfigSet0", opts)} +} + +func (_c *EVM2EVMOffRampInterface_FilterConfigSet0_Call) Run(run func(opts *bind.FilterOpts)) *EVM2EVMOffRampInterface_FilterConfigSet0_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_FilterConfigSet0_Call) Return(_a0 *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampConfigSet0Iterator, _a1 error) *EVM2EVMOffRampInterface_FilterConfigSet0_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_FilterConfigSet0_Call) RunAndReturn(run func(*bind.FilterOpts) (*evm_2_evm_offramp_1_0_0.EVM2EVMOffRampConfigSet0Iterator, error)) *EVM2EVMOffRampInterface_FilterConfigSet0_Call { + _c.Call.Return(run) + return _c +} + +// FilterExecutionStateChanged provides a mock function with given fields: opts, sequenceNumber, messageId +func (_m *EVM2EVMOffRampInterface) FilterExecutionStateChanged(opts *bind.FilterOpts, sequenceNumber []uint64, messageId [][32]byte) (*evm_2_evm_offramp_1_0_0.EVM2EVMOffRampExecutionStateChangedIterator, error) { + ret := _m.Called(opts, sequenceNumber, messageId) + + if len(ret) == 0 { + panic("no return value specified for FilterExecutionStateChanged") + } + + var r0 *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampExecutionStateChangedIterator + var r1 error + if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []uint64, [][32]byte) (*evm_2_evm_offramp_1_0_0.EVM2EVMOffRampExecutionStateChangedIterator, error)); ok { + return rf(opts, sequenceNumber, messageId) + } + if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []uint64, [][32]byte) *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampExecutionStateChangedIterator); ok { + r0 = rf(opts, sequenceNumber, messageId) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*evm_2_evm_offramp_1_0_0.EVM2EVMOffRampExecutionStateChangedIterator) + } + } + + if rf, ok := ret.Get(1).(func(*bind.FilterOpts, []uint64, [][32]byte) error); ok { + r1 = rf(opts, sequenceNumber, messageId) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_FilterExecutionStateChanged_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterExecutionStateChanged' +type EVM2EVMOffRampInterface_FilterExecutionStateChanged_Call struct { + *mock.Call +} + +// FilterExecutionStateChanged is a helper method to define mock.On call +// - opts *bind.FilterOpts +// - sequenceNumber []uint64 +// - messageId [][32]byte +func (_e *EVM2EVMOffRampInterface_Expecter) FilterExecutionStateChanged(opts interface{}, sequenceNumber interface{}, messageId interface{}) *EVM2EVMOffRampInterface_FilterExecutionStateChanged_Call { + return &EVM2EVMOffRampInterface_FilterExecutionStateChanged_Call{Call: _e.mock.On("FilterExecutionStateChanged", opts, sequenceNumber, messageId)} +} + +func (_c *EVM2EVMOffRampInterface_FilterExecutionStateChanged_Call) Run(run func(opts *bind.FilterOpts, sequenceNumber []uint64, messageId [][32]byte)) *EVM2EVMOffRampInterface_FilterExecutionStateChanged_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts), args[1].([]uint64), args[2].([][32]byte)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_FilterExecutionStateChanged_Call) Return(_a0 *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampExecutionStateChangedIterator, _a1 error) *EVM2EVMOffRampInterface_FilterExecutionStateChanged_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_FilterExecutionStateChanged_Call) RunAndReturn(run func(*bind.FilterOpts, []uint64, [][32]byte) (*evm_2_evm_offramp_1_0_0.EVM2EVMOffRampExecutionStateChangedIterator, error)) *EVM2EVMOffRampInterface_FilterExecutionStateChanged_Call { + _c.Call.Return(run) + return _c +} + +// FilterOwnershipTransferRequested provides a mock function with given fields: opts, from, to +func (_m *EVM2EVMOffRampInterface) FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*evm_2_evm_offramp_1_0_0.EVM2EVMOffRampOwnershipTransferRequestedIterator, error) { + ret := _m.Called(opts, from, to) + + if len(ret) == 0 { + panic("no return value specified for FilterOwnershipTransferRequested") + } + + var r0 *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampOwnershipTransferRequestedIterator + var r1 error + if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []common.Address, []common.Address) (*evm_2_evm_offramp_1_0_0.EVM2EVMOffRampOwnershipTransferRequestedIterator, error)); ok { + return rf(opts, from, to) + } + if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []common.Address, []common.Address) *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampOwnershipTransferRequestedIterator); ok { + r0 = rf(opts, from, to) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*evm_2_evm_offramp_1_0_0.EVM2EVMOffRampOwnershipTransferRequestedIterator) + } + } + + if rf, ok := ret.Get(1).(func(*bind.FilterOpts, []common.Address, []common.Address) error); ok { + r1 = rf(opts, from, to) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_FilterOwnershipTransferRequested_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterOwnershipTransferRequested' +type EVM2EVMOffRampInterface_FilterOwnershipTransferRequested_Call struct { + *mock.Call +} + +// FilterOwnershipTransferRequested is a helper method to define mock.On call +// - opts *bind.FilterOpts +// - from []common.Address +// - to []common.Address +func (_e *EVM2EVMOffRampInterface_Expecter) FilterOwnershipTransferRequested(opts interface{}, from interface{}, to interface{}) *EVM2EVMOffRampInterface_FilterOwnershipTransferRequested_Call { + return &EVM2EVMOffRampInterface_FilterOwnershipTransferRequested_Call{Call: _e.mock.On("FilterOwnershipTransferRequested", opts, from, to)} +} + +func (_c *EVM2EVMOffRampInterface_FilterOwnershipTransferRequested_Call) Run(run func(opts *bind.FilterOpts, from []common.Address, to []common.Address)) *EVM2EVMOffRampInterface_FilterOwnershipTransferRequested_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts), args[1].([]common.Address), args[2].([]common.Address)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_FilterOwnershipTransferRequested_Call) Return(_a0 *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampOwnershipTransferRequestedIterator, _a1 error) *EVM2EVMOffRampInterface_FilterOwnershipTransferRequested_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_FilterOwnershipTransferRequested_Call) RunAndReturn(run func(*bind.FilterOpts, []common.Address, []common.Address) (*evm_2_evm_offramp_1_0_0.EVM2EVMOffRampOwnershipTransferRequestedIterator, error)) *EVM2EVMOffRampInterface_FilterOwnershipTransferRequested_Call { + _c.Call.Return(run) + return _c +} + +// FilterOwnershipTransferred provides a mock function with given fields: opts, from, to +func (_m *EVM2EVMOffRampInterface) FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*evm_2_evm_offramp_1_0_0.EVM2EVMOffRampOwnershipTransferredIterator, error) { + ret := _m.Called(opts, from, to) + + if len(ret) == 0 { + panic("no return value specified for FilterOwnershipTransferred") + } + + var r0 *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampOwnershipTransferredIterator + var r1 error + if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []common.Address, []common.Address) (*evm_2_evm_offramp_1_0_0.EVM2EVMOffRampOwnershipTransferredIterator, error)); ok { + return rf(opts, from, to) + } + if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []common.Address, []common.Address) *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampOwnershipTransferredIterator); ok { + r0 = rf(opts, from, to) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*evm_2_evm_offramp_1_0_0.EVM2EVMOffRampOwnershipTransferredIterator) + } + } + + if rf, ok := ret.Get(1).(func(*bind.FilterOpts, []common.Address, []common.Address) error); ok { + r1 = rf(opts, from, to) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_FilterOwnershipTransferred_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterOwnershipTransferred' +type EVM2EVMOffRampInterface_FilterOwnershipTransferred_Call struct { + *mock.Call +} + +// FilterOwnershipTransferred is a helper method to define mock.On call +// - opts *bind.FilterOpts +// - from []common.Address +// - to []common.Address +func (_e *EVM2EVMOffRampInterface_Expecter) FilterOwnershipTransferred(opts interface{}, from interface{}, to interface{}) *EVM2EVMOffRampInterface_FilterOwnershipTransferred_Call { + return &EVM2EVMOffRampInterface_FilterOwnershipTransferred_Call{Call: _e.mock.On("FilterOwnershipTransferred", opts, from, to)} +} + +func (_c *EVM2EVMOffRampInterface_FilterOwnershipTransferred_Call) Run(run func(opts *bind.FilterOpts, from []common.Address, to []common.Address)) *EVM2EVMOffRampInterface_FilterOwnershipTransferred_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts), args[1].([]common.Address), args[2].([]common.Address)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_FilterOwnershipTransferred_Call) Return(_a0 *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampOwnershipTransferredIterator, _a1 error) *EVM2EVMOffRampInterface_FilterOwnershipTransferred_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_FilterOwnershipTransferred_Call) RunAndReturn(run func(*bind.FilterOpts, []common.Address, []common.Address) (*evm_2_evm_offramp_1_0_0.EVM2EVMOffRampOwnershipTransferredIterator, error)) *EVM2EVMOffRampInterface_FilterOwnershipTransferred_Call { + _c.Call.Return(run) + return _c +} + +// FilterPoolAdded provides a mock function with given fields: opts +func (_m *EVM2EVMOffRampInterface) FilterPoolAdded(opts *bind.FilterOpts) (*evm_2_evm_offramp_1_0_0.EVM2EVMOffRampPoolAddedIterator, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for FilterPoolAdded") + } + + var r0 *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampPoolAddedIterator + var r1 error + if rf, ok := ret.Get(0).(func(*bind.FilterOpts) (*evm_2_evm_offramp_1_0_0.EVM2EVMOffRampPoolAddedIterator, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.FilterOpts) *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampPoolAddedIterator); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*evm_2_evm_offramp_1_0_0.EVM2EVMOffRampPoolAddedIterator) + } + } + + if rf, ok := ret.Get(1).(func(*bind.FilterOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_FilterPoolAdded_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterPoolAdded' +type EVM2EVMOffRampInterface_FilterPoolAdded_Call struct { + *mock.Call +} + +// FilterPoolAdded is a helper method to define mock.On call +// - opts *bind.FilterOpts +func (_e *EVM2EVMOffRampInterface_Expecter) FilterPoolAdded(opts interface{}) *EVM2EVMOffRampInterface_FilterPoolAdded_Call { + return &EVM2EVMOffRampInterface_FilterPoolAdded_Call{Call: _e.mock.On("FilterPoolAdded", opts)} +} + +func (_c *EVM2EVMOffRampInterface_FilterPoolAdded_Call) Run(run func(opts *bind.FilterOpts)) *EVM2EVMOffRampInterface_FilterPoolAdded_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_FilterPoolAdded_Call) Return(_a0 *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampPoolAddedIterator, _a1 error) *EVM2EVMOffRampInterface_FilterPoolAdded_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_FilterPoolAdded_Call) RunAndReturn(run func(*bind.FilterOpts) (*evm_2_evm_offramp_1_0_0.EVM2EVMOffRampPoolAddedIterator, error)) *EVM2EVMOffRampInterface_FilterPoolAdded_Call { + _c.Call.Return(run) + return _c +} + +// FilterPoolRemoved provides a mock function with given fields: opts +func (_m *EVM2EVMOffRampInterface) FilterPoolRemoved(opts *bind.FilterOpts) (*evm_2_evm_offramp_1_0_0.EVM2EVMOffRampPoolRemovedIterator, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for FilterPoolRemoved") + } + + var r0 *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampPoolRemovedIterator + var r1 error + if rf, ok := ret.Get(0).(func(*bind.FilterOpts) (*evm_2_evm_offramp_1_0_0.EVM2EVMOffRampPoolRemovedIterator, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.FilterOpts) *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampPoolRemovedIterator); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*evm_2_evm_offramp_1_0_0.EVM2EVMOffRampPoolRemovedIterator) + } + } + + if rf, ok := ret.Get(1).(func(*bind.FilterOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_FilterPoolRemoved_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterPoolRemoved' +type EVM2EVMOffRampInterface_FilterPoolRemoved_Call struct { + *mock.Call +} + +// FilterPoolRemoved is a helper method to define mock.On call +// - opts *bind.FilterOpts +func (_e *EVM2EVMOffRampInterface_Expecter) FilterPoolRemoved(opts interface{}) *EVM2EVMOffRampInterface_FilterPoolRemoved_Call { + return &EVM2EVMOffRampInterface_FilterPoolRemoved_Call{Call: _e.mock.On("FilterPoolRemoved", opts)} +} + +func (_c *EVM2EVMOffRampInterface_FilterPoolRemoved_Call) Run(run func(opts *bind.FilterOpts)) *EVM2EVMOffRampInterface_FilterPoolRemoved_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_FilterPoolRemoved_Call) Return(_a0 *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampPoolRemovedIterator, _a1 error) *EVM2EVMOffRampInterface_FilterPoolRemoved_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_FilterPoolRemoved_Call) RunAndReturn(run func(*bind.FilterOpts) (*evm_2_evm_offramp_1_0_0.EVM2EVMOffRampPoolRemovedIterator, error)) *EVM2EVMOffRampInterface_FilterPoolRemoved_Call { + _c.Call.Return(run) + return _c +} + +// FilterSkippedIncorrectNonce provides a mock function with given fields: opts, nonce, sender +func (_m *EVM2EVMOffRampInterface) FilterSkippedIncorrectNonce(opts *bind.FilterOpts, nonce []uint64, sender []common.Address) (*evm_2_evm_offramp_1_0_0.EVM2EVMOffRampSkippedIncorrectNonceIterator, error) { + ret := _m.Called(opts, nonce, sender) + + if len(ret) == 0 { + panic("no return value specified for FilterSkippedIncorrectNonce") + } + + var r0 *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampSkippedIncorrectNonceIterator + var r1 error + if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []uint64, []common.Address) (*evm_2_evm_offramp_1_0_0.EVM2EVMOffRampSkippedIncorrectNonceIterator, error)); ok { + return rf(opts, nonce, sender) + } + if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []uint64, []common.Address) *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampSkippedIncorrectNonceIterator); ok { + r0 = rf(opts, nonce, sender) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*evm_2_evm_offramp_1_0_0.EVM2EVMOffRampSkippedIncorrectNonceIterator) + } + } + + if rf, ok := ret.Get(1).(func(*bind.FilterOpts, []uint64, []common.Address) error); ok { + r1 = rf(opts, nonce, sender) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_FilterSkippedIncorrectNonce_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterSkippedIncorrectNonce' +type EVM2EVMOffRampInterface_FilterSkippedIncorrectNonce_Call struct { + *mock.Call +} + +// FilterSkippedIncorrectNonce is a helper method to define mock.On call +// - opts *bind.FilterOpts +// - nonce []uint64 +// - sender []common.Address +func (_e *EVM2EVMOffRampInterface_Expecter) FilterSkippedIncorrectNonce(opts interface{}, nonce interface{}, sender interface{}) *EVM2EVMOffRampInterface_FilterSkippedIncorrectNonce_Call { + return &EVM2EVMOffRampInterface_FilterSkippedIncorrectNonce_Call{Call: _e.mock.On("FilterSkippedIncorrectNonce", opts, nonce, sender)} +} + +func (_c *EVM2EVMOffRampInterface_FilterSkippedIncorrectNonce_Call) Run(run func(opts *bind.FilterOpts, nonce []uint64, sender []common.Address)) *EVM2EVMOffRampInterface_FilterSkippedIncorrectNonce_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts), args[1].([]uint64), args[2].([]common.Address)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_FilterSkippedIncorrectNonce_Call) Return(_a0 *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampSkippedIncorrectNonceIterator, _a1 error) *EVM2EVMOffRampInterface_FilterSkippedIncorrectNonce_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_FilterSkippedIncorrectNonce_Call) RunAndReturn(run func(*bind.FilterOpts, []uint64, []common.Address) (*evm_2_evm_offramp_1_0_0.EVM2EVMOffRampSkippedIncorrectNonceIterator, error)) *EVM2EVMOffRampInterface_FilterSkippedIncorrectNonce_Call { + _c.Call.Return(run) + return _c +} + +// FilterSkippedSenderWithPreviousRampMessageInflight provides a mock function with given fields: opts, nonce, sender +func (_m *EVM2EVMOffRampInterface) FilterSkippedSenderWithPreviousRampMessageInflight(opts *bind.FilterOpts, nonce []uint64, sender []common.Address) (*evm_2_evm_offramp_1_0_0.EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflightIterator, error) { + ret := _m.Called(opts, nonce, sender) + + if len(ret) == 0 { + panic("no return value specified for FilterSkippedSenderWithPreviousRampMessageInflight") + } + + var r0 *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflightIterator + var r1 error + if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []uint64, []common.Address) (*evm_2_evm_offramp_1_0_0.EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflightIterator, error)); ok { + return rf(opts, nonce, sender) + } + if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []uint64, []common.Address) *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflightIterator); ok { + r0 = rf(opts, nonce, sender) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*evm_2_evm_offramp_1_0_0.EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflightIterator) + } + } + + if rf, ok := ret.Get(1).(func(*bind.FilterOpts, []uint64, []common.Address) error); ok { + r1 = rf(opts, nonce, sender) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_FilterSkippedSenderWithPreviousRampMessageInflight_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterSkippedSenderWithPreviousRampMessageInflight' +type EVM2EVMOffRampInterface_FilterSkippedSenderWithPreviousRampMessageInflight_Call struct { + *mock.Call +} + +// FilterSkippedSenderWithPreviousRampMessageInflight is a helper method to define mock.On call +// - opts *bind.FilterOpts +// - nonce []uint64 +// - sender []common.Address +func (_e *EVM2EVMOffRampInterface_Expecter) FilterSkippedSenderWithPreviousRampMessageInflight(opts interface{}, nonce interface{}, sender interface{}) *EVM2EVMOffRampInterface_FilterSkippedSenderWithPreviousRampMessageInflight_Call { + return &EVM2EVMOffRampInterface_FilterSkippedSenderWithPreviousRampMessageInflight_Call{Call: _e.mock.On("FilterSkippedSenderWithPreviousRampMessageInflight", opts, nonce, sender)} +} + +func (_c *EVM2EVMOffRampInterface_FilterSkippedSenderWithPreviousRampMessageInflight_Call) Run(run func(opts *bind.FilterOpts, nonce []uint64, sender []common.Address)) *EVM2EVMOffRampInterface_FilterSkippedSenderWithPreviousRampMessageInflight_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts), args[1].([]uint64), args[2].([]common.Address)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_FilterSkippedSenderWithPreviousRampMessageInflight_Call) Return(_a0 *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflightIterator, _a1 error) *EVM2EVMOffRampInterface_FilterSkippedSenderWithPreviousRampMessageInflight_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_FilterSkippedSenderWithPreviousRampMessageInflight_Call) RunAndReturn(run func(*bind.FilterOpts, []uint64, []common.Address) (*evm_2_evm_offramp_1_0_0.EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflightIterator, error)) *EVM2EVMOffRampInterface_FilterSkippedSenderWithPreviousRampMessageInflight_Call { + _c.Call.Return(run) + return _c +} + +// FilterTransmitted provides a mock function with given fields: opts +func (_m *EVM2EVMOffRampInterface) FilterTransmitted(opts *bind.FilterOpts) (*evm_2_evm_offramp_1_0_0.EVM2EVMOffRampTransmittedIterator, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for FilterTransmitted") + } + + var r0 *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampTransmittedIterator + var r1 error + if rf, ok := ret.Get(0).(func(*bind.FilterOpts) (*evm_2_evm_offramp_1_0_0.EVM2EVMOffRampTransmittedIterator, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.FilterOpts) *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampTransmittedIterator); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*evm_2_evm_offramp_1_0_0.EVM2EVMOffRampTransmittedIterator) + } + } + + if rf, ok := ret.Get(1).(func(*bind.FilterOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_FilterTransmitted_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterTransmitted' +type EVM2EVMOffRampInterface_FilterTransmitted_Call struct { + *mock.Call +} + +// FilterTransmitted is a helper method to define mock.On call +// - opts *bind.FilterOpts +func (_e *EVM2EVMOffRampInterface_Expecter) FilterTransmitted(opts interface{}) *EVM2EVMOffRampInterface_FilterTransmitted_Call { + return &EVM2EVMOffRampInterface_FilterTransmitted_Call{Call: _e.mock.On("FilterTransmitted", opts)} +} + +func (_c *EVM2EVMOffRampInterface_FilterTransmitted_Call) Run(run func(opts *bind.FilterOpts)) *EVM2EVMOffRampInterface_FilterTransmitted_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_FilterTransmitted_Call) Return(_a0 *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampTransmittedIterator, _a1 error) *EVM2EVMOffRampInterface_FilterTransmitted_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_FilterTransmitted_Call) RunAndReturn(run func(*bind.FilterOpts) (*evm_2_evm_offramp_1_0_0.EVM2EVMOffRampTransmittedIterator, error)) *EVM2EVMOffRampInterface_FilterTransmitted_Call { + _c.Call.Return(run) + return _c +} + +// GetDestinationToken provides a mock function with given fields: opts, sourceToken +func (_m *EVM2EVMOffRampInterface) GetDestinationToken(opts *bind.CallOpts, sourceToken common.Address) (common.Address, error) { + ret := _m.Called(opts, sourceToken) + + if len(ret) == 0 { + panic("no return value specified for GetDestinationToken") + } + + var r0 common.Address + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts, common.Address) (common.Address, error)); ok { + return rf(opts, sourceToken) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts, common.Address) common.Address); ok { + r0 = rf(opts, sourceToken) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Address) + } + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts, common.Address) error); ok { + r1 = rf(opts, sourceToken) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_GetDestinationToken_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetDestinationToken' +type EVM2EVMOffRampInterface_GetDestinationToken_Call struct { + *mock.Call +} + +// GetDestinationToken is a helper method to define mock.On call +// - opts *bind.CallOpts +// - sourceToken common.Address +func (_e *EVM2EVMOffRampInterface_Expecter) GetDestinationToken(opts interface{}, sourceToken interface{}) *EVM2EVMOffRampInterface_GetDestinationToken_Call { + return &EVM2EVMOffRampInterface_GetDestinationToken_Call{Call: _e.mock.On("GetDestinationToken", opts, sourceToken)} +} + +func (_c *EVM2EVMOffRampInterface_GetDestinationToken_Call) Run(run func(opts *bind.CallOpts, sourceToken common.Address)) *EVM2EVMOffRampInterface_GetDestinationToken_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts), args[1].(common.Address)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_GetDestinationToken_Call) Return(_a0 common.Address, _a1 error) *EVM2EVMOffRampInterface_GetDestinationToken_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_GetDestinationToken_Call) RunAndReturn(run func(*bind.CallOpts, common.Address) (common.Address, error)) *EVM2EVMOffRampInterface_GetDestinationToken_Call { + _c.Call.Return(run) + return _c +} + +// GetDestinationTokens provides a mock function with given fields: opts +func (_m *EVM2EVMOffRampInterface) GetDestinationTokens(opts *bind.CallOpts) ([]common.Address, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for GetDestinationTokens") + } + + var r0 []common.Address + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts) ([]common.Address, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts) []common.Address); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]common.Address) + } + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_GetDestinationTokens_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetDestinationTokens' +type EVM2EVMOffRampInterface_GetDestinationTokens_Call struct { + *mock.Call +} + +// GetDestinationTokens is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *EVM2EVMOffRampInterface_Expecter) GetDestinationTokens(opts interface{}) *EVM2EVMOffRampInterface_GetDestinationTokens_Call { + return &EVM2EVMOffRampInterface_GetDestinationTokens_Call{Call: _e.mock.On("GetDestinationTokens", opts)} +} + +func (_c *EVM2EVMOffRampInterface_GetDestinationTokens_Call) Run(run func(opts *bind.CallOpts)) *EVM2EVMOffRampInterface_GetDestinationTokens_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_GetDestinationTokens_Call) Return(_a0 []common.Address, _a1 error) *EVM2EVMOffRampInterface_GetDestinationTokens_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_GetDestinationTokens_Call) RunAndReturn(run func(*bind.CallOpts) ([]common.Address, error)) *EVM2EVMOffRampInterface_GetDestinationTokens_Call { + _c.Call.Return(run) + return _c +} + +// GetDynamicConfig provides a mock function with given fields: opts +func (_m *EVM2EVMOffRampInterface) GetDynamicConfig(opts *bind.CallOpts) (evm_2_evm_offramp_1_0_0.EVM2EVMOffRampDynamicConfig, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for GetDynamicConfig") + } + + var r0 evm_2_evm_offramp_1_0_0.EVM2EVMOffRampDynamicConfig + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts) (evm_2_evm_offramp_1_0_0.EVM2EVMOffRampDynamicConfig, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts) evm_2_evm_offramp_1_0_0.EVM2EVMOffRampDynamicConfig); ok { + r0 = rf(opts) + } else { + r0 = ret.Get(0).(evm_2_evm_offramp_1_0_0.EVM2EVMOffRampDynamicConfig) + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_GetDynamicConfig_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetDynamicConfig' +type EVM2EVMOffRampInterface_GetDynamicConfig_Call struct { + *mock.Call +} + +// GetDynamicConfig is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *EVM2EVMOffRampInterface_Expecter) GetDynamicConfig(opts interface{}) *EVM2EVMOffRampInterface_GetDynamicConfig_Call { + return &EVM2EVMOffRampInterface_GetDynamicConfig_Call{Call: _e.mock.On("GetDynamicConfig", opts)} +} + +func (_c *EVM2EVMOffRampInterface_GetDynamicConfig_Call) Run(run func(opts *bind.CallOpts)) *EVM2EVMOffRampInterface_GetDynamicConfig_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_GetDynamicConfig_Call) Return(_a0 evm_2_evm_offramp_1_0_0.EVM2EVMOffRampDynamicConfig, _a1 error) *EVM2EVMOffRampInterface_GetDynamicConfig_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_GetDynamicConfig_Call) RunAndReturn(run func(*bind.CallOpts) (evm_2_evm_offramp_1_0_0.EVM2EVMOffRampDynamicConfig, error)) *EVM2EVMOffRampInterface_GetDynamicConfig_Call { + _c.Call.Return(run) + return _c +} + +// GetExecutionState provides a mock function with given fields: opts, sequenceNumber +func (_m *EVM2EVMOffRampInterface) GetExecutionState(opts *bind.CallOpts, sequenceNumber uint64) (uint8, error) { + ret := _m.Called(opts, sequenceNumber) + + if len(ret) == 0 { + panic("no return value specified for GetExecutionState") + } + + var r0 uint8 + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts, uint64) (uint8, error)); ok { + return rf(opts, sequenceNumber) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts, uint64) uint8); ok { + r0 = rf(opts, sequenceNumber) + } else { + r0 = ret.Get(0).(uint8) + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts, uint64) error); ok { + r1 = rf(opts, sequenceNumber) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_GetExecutionState_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetExecutionState' +type EVM2EVMOffRampInterface_GetExecutionState_Call struct { + *mock.Call +} + +// GetExecutionState is a helper method to define mock.On call +// - opts *bind.CallOpts +// - sequenceNumber uint64 +func (_e *EVM2EVMOffRampInterface_Expecter) GetExecutionState(opts interface{}, sequenceNumber interface{}) *EVM2EVMOffRampInterface_GetExecutionState_Call { + return &EVM2EVMOffRampInterface_GetExecutionState_Call{Call: _e.mock.On("GetExecutionState", opts, sequenceNumber)} +} + +func (_c *EVM2EVMOffRampInterface_GetExecutionState_Call) Run(run func(opts *bind.CallOpts, sequenceNumber uint64)) *EVM2EVMOffRampInterface_GetExecutionState_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts), args[1].(uint64)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_GetExecutionState_Call) Return(_a0 uint8, _a1 error) *EVM2EVMOffRampInterface_GetExecutionState_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_GetExecutionState_Call) RunAndReturn(run func(*bind.CallOpts, uint64) (uint8, error)) *EVM2EVMOffRampInterface_GetExecutionState_Call { + _c.Call.Return(run) + return _c +} + +// GetPoolByDestToken provides a mock function with given fields: opts, destToken +func (_m *EVM2EVMOffRampInterface) GetPoolByDestToken(opts *bind.CallOpts, destToken common.Address) (common.Address, error) { + ret := _m.Called(opts, destToken) + + if len(ret) == 0 { + panic("no return value specified for GetPoolByDestToken") + } + + var r0 common.Address + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts, common.Address) (common.Address, error)); ok { + return rf(opts, destToken) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts, common.Address) common.Address); ok { + r0 = rf(opts, destToken) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Address) + } + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts, common.Address) error); ok { + r1 = rf(opts, destToken) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_GetPoolByDestToken_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPoolByDestToken' +type EVM2EVMOffRampInterface_GetPoolByDestToken_Call struct { + *mock.Call +} + +// GetPoolByDestToken is a helper method to define mock.On call +// - opts *bind.CallOpts +// - destToken common.Address +func (_e *EVM2EVMOffRampInterface_Expecter) GetPoolByDestToken(opts interface{}, destToken interface{}) *EVM2EVMOffRampInterface_GetPoolByDestToken_Call { + return &EVM2EVMOffRampInterface_GetPoolByDestToken_Call{Call: _e.mock.On("GetPoolByDestToken", opts, destToken)} +} + +func (_c *EVM2EVMOffRampInterface_GetPoolByDestToken_Call) Run(run func(opts *bind.CallOpts, destToken common.Address)) *EVM2EVMOffRampInterface_GetPoolByDestToken_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts), args[1].(common.Address)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_GetPoolByDestToken_Call) Return(_a0 common.Address, _a1 error) *EVM2EVMOffRampInterface_GetPoolByDestToken_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_GetPoolByDestToken_Call) RunAndReturn(run func(*bind.CallOpts, common.Address) (common.Address, error)) *EVM2EVMOffRampInterface_GetPoolByDestToken_Call { + _c.Call.Return(run) + return _c +} + +// GetPoolBySourceToken provides a mock function with given fields: opts, sourceToken +func (_m *EVM2EVMOffRampInterface) GetPoolBySourceToken(opts *bind.CallOpts, sourceToken common.Address) (common.Address, error) { + ret := _m.Called(opts, sourceToken) + + if len(ret) == 0 { + panic("no return value specified for GetPoolBySourceToken") + } + + var r0 common.Address + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts, common.Address) (common.Address, error)); ok { + return rf(opts, sourceToken) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts, common.Address) common.Address); ok { + r0 = rf(opts, sourceToken) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Address) + } + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts, common.Address) error); ok { + r1 = rf(opts, sourceToken) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_GetPoolBySourceToken_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPoolBySourceToken' +type EVM2EVMOffRampInterface_GetPoolBySourceToken_Call struct { + *mock.Call +} + +// GetPoolBySourceToken is a helper method to define mock.On call +// - opts *bind.CallOpts +// - sourceToken common.Address +func (_e *EVM2EVMOffRampInterface_Expecter) GetPoolBySourceToken(opts interface{}, sourceToken interface{}) *EVM2EVMOffRampInterface_GetPoolBySourceToken_Call { + return &EVM2EVMOffRampInterface_GetPoolBySourceToken_Call{Call: _e.mock.On("GetPoolBySourceToken", opts, sourceToken)} +} + +func (_c *EVM2EVMOffRampInterface_GetPoolBySourceToken_Call) Run(run func(opts *bind.CallOpts, sourceToken common.Address)) *EVM2EVMOffRampInterface_GetPoolBySourceToken_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts), args[1].(common.Address)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_GetPoolBySourceToken_Call) Return(_a0 common.Address, _a1 error) *EVM2EVMOffRampInterface_GetPoolBySourceToken_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_GetPoolBySourceToken_Call) RunAndReturn(run func(*bind.CallOpts, common.Address) (common.Address, error)) *EVM2EVMOffRampInterface_GetPoolBySourceToken_Call { + _c.Call.Return(run) + return _c +} + +// GetSenderNonce provides a mock function with given fields: opts, sender +func (_m *EVM2EVMOffRampInterface) GetSenderNonce(opts *bind.CallOpts, sender common.Address) (uint64, error) { + ret := _m.Called(opts, sender) + + if len(ret) == 0 { + panic("no return value specified for GetSenderNonce") + } + + var r0 uint64 + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts, common.Address) (uint64, error)); ok { + return rf(opts, sender) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts, common.Address) uint64); ok { + r0 = rf(opts, sender) + } else { + r0 = ret.Get(0).(uint64) + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts, common.Address) error); ok { + r1 = rf(opts, sender) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_GetSenderNonce_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSenderNonce' +type EVM2EVMOffRampInterface_GetSenderNonce_Call struct { + *mock.Call +} + +// GetSenderNonce is a helper method to define mock.On call +// - opts *bind.CallOpts +// - sender common.Address +func (_e *EVM2EVMOffRampInterface_Expecter) GetSenderNonce(opts interface{}, sender interface{}) *EVM2EVMOffRampInterface_GetSenderNonce_Call { + return &EVM2EVMOffRampInterface_GetSenderNonce_Call{Call: _e.mock.On("GetSenderNonce", opts, sender)} +} + +func (_c *EVM2EVMOffRampInterface_GetSenderNonce_Call) Run(run func(opts *bind.CallOpts, sender common.Address)) *EVM2EVMOffRampInterface_GetSenderNonce_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts), args[1].(common.Address)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_GetSenderNonce_Call) Return(_a0 uint64, _a1 error) *EVM2EVMOffRampInterface_GetSenderNonce_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_GetSenderNonce_Call) RunAndReturn(run func(*bind.CallOpts, common.Address) (uint64, error)) *EVM2EVMOffRampInterface_GetSenderNonce_Call { + _c.Call.Return(run) + return _c +} + +// GetStaticConfig provides a mock function with given fields: opts +func (_m *EVM2EVMOffRampInterface) GetStaticConfig(opts *bind.CallOpts) (evm_2_evm_offramp_1_0_0.EVM2EVMOffRampStaticConfig, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for GetStaticConfig") + } + + var r0 evm_2_evm_offramp_1_0_0.EVM2EVMOffRampStaticConfig + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts) (evm_2_evm_offramp_1_0_0.EVM2EVMOffRampStaticConfig, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts) evm_2_evm_offramp_1_0_0.EVM2EVMOffRampStaticConfig); ok { + r0 = rf(opts) + } else { + r0 = ret.Get(0).(evm_2_evm_offramp_1_0_0.EVM2EVMOffRampStaticConfig) + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_GetStaticConfig_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetStaticConfig' +type EVM2EVMOffRampInterface_GetStaticConfig_Call struct { + *mock.Call +} + +// GetStaticConfig is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *EVM2EVMOffRampInterface_Expecter) GetStaticConfig(opts interface{}) *EVM2EVMOffRampInterface_GetStaticConfig_Call { + return &EVM2EVMOffRampInterface_GetStaticConfig_Call{Call: _e.mock.On("GetStaticConfig", opts)} +} + +func (_c *EVM2EVMOffRampInterface_GetStaticConfig_Call) Run(run func(opts *bind.CallOpts)) *EVM2EVMOffRampInterface_GetStaticConfig_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_GetStaticConfig_Call) Return(_a0 evm_2_evm_offramp_1_0_0.EVM2EVMOffRampStaticConfig, _a1 error) *EVM2EVMOffRampInterface_GetStaticConfig_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_GetStaticConfig_Call) RunAndReturn(run func(*bind.CallOpts) (evm_2_evm_offramp_1_0_0.EVM2EVMOffRampStaticConfig, error)) *EVM2EVMOffRampInterface_GetStaticConfig_Call { + _c.Call.Return(run) + return _c +} + +// GetSupportedTokens provides a mock function with given fields: opts +func (_m *EVM2EVMOffRampInterface) GetSupportedTokens(opts *bind.CallOpts) ([]common.Address, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for GetSupportedTokens") + } + + var r0 []common.Address + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts) ([]common.Address, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts) []common.Address); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]common.Address) + } + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_GetSupportedTokens_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSupportedTokens' +type EVM2EVMOffRampInterface_GetSupportedTokens_Call struct { + *mock.Call +} + +// GetSupportedTokens is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *EVM2EVMOffRampInterface_Expecter) GetSupportedTokens(opts interface{}) *EVM2EVMOffRampInterface_GetSupportedTokens_Call { + return &EVM2EVMOffRampInterface_GetSupportedTokens_Call{Call: _e.mock.On("GetSupportedTokens", opts)} +} + +func (_c *EVM2EVMOffRampInterface_GetSupportedTokens_Call) Run(run func(opts *bind.CallOpts)) *EVM2EVMOffRampInterface_GetSupportedTokens_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_GetSupportedTokens_Call) Return(_a0 []common.Address, _a1 error) *EVM2EVMOffRampInterface_GetSupportedTokens_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_GetSupportedTokens_Call) RunAndReturn(run func(*bind.CallOpts) ([]common.Address, error)) *EVM2EVMOffRampInterface_GetSupportedTokens_Call { + _c.Call.Return(run) + return _c +} + +// GetTokenLimitAdmin provides a mock function with given fields: opts +func (_m *EVM2EVMOffRampInterface) GetTokenLimitAdmin(opts *bind.CallOpts) (common.Address, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for GetTokenLimitAdmin") + } + + var r0 common.Address + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts) (common.Address, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts) common.Address); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Address) + } + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_GetTokenLimitAdmin_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetTokenLimitAdmin' +type EVM2EVMOffRampInterface_GetTokenLimitAdmin_Call struct { + *mock.Call +} + +// GetTokenLimitAdmin is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *EVM2EVMOffRampInterface_Expecter) GetTokenLimitAdmin(opts interface{}) *EVM2EVMOffRampInterface_GetTokenLimitAdmin_Call { + return &EVM2EVMOffRampInterface_GetTokenLimitAdmin_Call{Call: _e.mock.On("GetTokenLimitAdmin", opts)} +} + +func (_c *EVM2EVMOffRampInterface_GetTokenLimitAdmin_Call) Run(run func(opts *bind.CallOpts)) *EVM2EVMOffRampInterface_GetTokenLimitAdmin_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_GetTokenLimitAdmin_Call) Return(_a0 common.Address, _a1 error) *EVM2EVMOffRampInterface_GetTokenLimitAdmin_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_GetTokenLimitAdmin_Call) RunAndReturn(run func(*bind.CallOpts) (common.Address, error)) *EVM2EVMOffRampInterface_GetTokenLimitAdmin_Call { + _c.Call.Return(run) + return _c +} + +// GetTransmitters provides a mock function with given fields: opts +func (_m *EVM2EVMOffRampInterface) GetTransmitters(opts *bind.CallOpts) ([]common.Address, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for GetTransmitters") + } + + var r0 []common.Address + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts) ([]common.Address, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts) []common.Address); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]common.Address) + } + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_GetTransmitters_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetTransmitters' +type EVM2EVMOffRampInterface_GetTransmitters_Call struct { + *mock.Call +} + +// GetTransmitters is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *EVM2EVMOffRampInterface_Expecter) GetTransmitters(opts interface{}) *EVM2EVMOffRampInterface_GetTransmitters_Call { + return &EVM2EVMOffRampInterface_GetTransmitters_Call{Call: _e.mock.On("GetTransmitters", opts)} +} + +func (_c *EVM2EVMOffRampInterface_GetTransmitters_Call) Run(run func(opts *bind.CallOpts)) *EVM2EVMOffRampInterface_GetTransmitters_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_GetTransmitters_Call) Return(_a0 []common.Address, _a1 error) *EVM2EVMOffRampInterface_GetTransmitters_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_GetTransmitters_Call) RunAndReturn(run func(*bind.CallOpts) ([]common.Address, error)) *EVM2EVMOffRampInterface_GetTransmitters_Call { + _c.Call.Return(run) + return _c +} + +// LatestConfigDetails provides a mock function with given fields: opts +func (_m *EVM2EVMOffRampInterface) LatestConfigDetails(opts *bind.CallOpts) (evm_2_evm_offramp_1_0_0.LatestConfigDetails, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for LatestConfigDetails") + } + + var r0 evm_2_evm_offramp_1_0_0.LatestConfigDetails + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts) (evm_2_evm_offramp_1_0_0.LatestConfigDetails, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts) evm_2_evm_offramp_1_0_0.LatestConfigDetails); ok { + r0 = rf(opts) + } else { + r0 = ret.Get(0).(evm_2_evm_offramp_1_0_0.LatestConfigDetails) + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_LatestConfigDetails_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LatestConfigDetails' +type EVM2EVMOffRampInterface_LatestConfigDetails_Call struct { + *mock.Call +} + +// LatestConfigDetails is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *EVM2EVMOffRampInterface_Expecter) LatestConfigDetails(opts interface{}) *EVM2EVMOffRampInterface_LatestConfigDetails_Call { + return &EVM2EVMOffRampInterface_LatestConfigDetails_Call{Call: _e.mock.On("LatestConfigDetails", opts)} +} + +func (_c *EVM2EVMOffRampInterface_LatestConfigDetails_Call) Run(run func(opts *bind.CallOpts)) *EVM2EVMOffRampInterface_LatestConfigDetails_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_LatestConfigDetails_Call) Return(_a0 evm_2_evm_offramp_1_0_0.LatestConfigDetails, _a1 error) *EVM2EVMOffRampInterface_LatestConfigDetails_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_LatestConfigDetails_Call) RunAndReturn(run func(*bind.CallOpts) (evm_2_evm_offramp_1_0_0.LatestConfigDetails, error)) *EVM2EVMOffRampInterface_LatestConfigDetails_Call { + _c.Call.Return(run) + return _c +} + +// LatestConfigDigestAndEpoch provides a mock function with given fields: opts +func (_m *EVM2EVMOffRampInterface) LatestConfigDigestAndEpoch(opts *bind.CallOpts) (evm_2_evm_offramp_1_0_0.LatestConfigDigestAndEpoch, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for LatestConfigDigestAndEpoch") + } + + var r0 evm_2_evm_offramp_1_0_0.LatestConfigDigestAndEpoch + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts) (evm_2_evm_offramp_1_0_0.LatestConfigDigestAndEpoch, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts) evm_2_evm_offramp_1_0_0.LatestConfigDigestAndEpoch); ok { + r0 = rf(opts) + } else { + r0 = ret.Get(0).(evm_2_evm_offramp_1_0_0.LatestConfigDigestAndEpoch) + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_LatestConfigDigestAndEpoch_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LatestConfigDigestAndEpoch' +type EVM2EVMOffRampInterface_LatestConfigDigestAndEpoch_Call struct { + *mock.Call +} + +// LatestConfigDigestAndEpoch is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *EVM2EVMOffRampInterface_Expecter) LatestConfigDigestAndEpoch(opts interface{}) *EVM2EVMOffRampInterface_LatestConfigDigestAndEpoch_Call { + return &EVM2EVMOffRampInterface_LatestConfigDigestAndEpoch_Call{Call: _e.mock.On("LatestConfigDigestAndEpoch", opts)} +} + +func (_c *EVM2EVMOffRampInterface_LatestConfigDigestAndEpoch_Call) Run(run func(opts *bind.CallOpts)) *EVM2EVMOffRampInterface_LatestConfigDigestAndEpoch_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_LatestConfigDigestAndEpoch_Call) Return(_a0 evm_2_evm_offramp_1_0_0.LatestConfigDigestAndEpoch, _a1 error) *EVM2EVMOffRampInterface_LatestConfigDigestAndEpoch_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_LatestConfigDigestAndEpoch_Call) RunAndReturn(run func(*bind.CallOpts) (evm_2_evm_offramp_1_0_0.LatestConfigDigestAndEpoch, error)) *EVM2EVMOffRampInterface_LatestConfigDigestAndEpoch_Call { + _c.Call.Return(run) + return _c +} + +// ManuallyExecute provides a mock function with given fields: opts, report, gasLimitOverrides +func (_m *EVM2EVMOffRampInterface) ManuallyExecute(opts *bind.TransactOpts, report evm_2_evm_offramp_1_0_0.InternalExecutionReport, gasLimitOverrides []*big.Int) (*types.Transaction, error) { + ret := _m.Called(opts, report, gasLimitOverrides) + + if len(ret) == 0 { + panic("no return value specified for ManuallyExecute") + } + + var r0 *types.Transaction + var r1 error + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, evm_2_evm_offramp_1_0_0.InternalExecutionReport, []*big.Int) (*types.Transaction, error)); ok { + return rf(opts, report, gasLimitOverrides) + } + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, evm_2_evm_offramp_1_0_0.InternalExecutionReport, []*big.Int) *types.Transaction); ok { + r0 = rf(opts, report, gasLimitOverrides) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Transaction) + } + } + + if rf, ok := ret.Get(1).(func(*bind.TransactOpts, evm_2_evm_offramp_1_0_0.InternalExecutionReport, []*big.Int) error); ok { + r1 = rf(opts, report, gasLimitOverrides) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_ManuallyExecute_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ManuallyExecute' +type EVM2EVMOffRampInterface_ManuallyExecute_Call struct { + *mock.Call +} + +// ManuallyExecute is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - report evm_2_evm_offramp_1_0_0.InternalExecutionReport +// - gasLimitOverrides []*big.Int +func (_e *EVM2EVMOffRampInterface_Expecter) ManuallyExecute(opts interface{}, report interface{}, gasLimitOverrides interface{}) *EVM2EVMOffRampInterface_ManuallyExecute_Call { + return &EVM2EVMOffRampInterface_ManuallyExecute_Call{Call: _e.mock.On("ManuallyExecute", opts, report, gasLimitOverrides)} +} + +func (_c *EVM2EVMOffRampInterface_ManuallyExecute_Call) Run(run func(opts *bind.TransactOpts, report evm_2_evm_offramp_1_0_0.InternalExecutionReport, gasLimitOverrides []*big.Int)) *EVM2EVMOffRampInterface_ManuallyExecute_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].(evm_2_evm_offramp_1_0_0.InternalExecutionReport), args[2].([]*big.Int)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_ManuallyExecute_Call) Return(_a0 *types.Transaction, _a1 error) *EVM2EVMOffRampInterface_ManuallyExecute_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_ManuallyExecute_Call) RunAndReturn(run func(*bind.TransactOpts, evm_2_evm_offramp_1_0_0.InternalExecutionReport, []*big.Int) (*types.Transaction, error)) *EVM2EVMOffRampInterface_ManuallyExecute_Call { + _c.Call.Return(run) + return _c +} + +// Owner provides a mock function with given fields: opts +func (_m *EVM2EVMOffRampInterface) Owner(opts *bind.CallOpts) (common.Address, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for Owner") + } + + var r0 common.Address + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts) (common.Address, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts) common.Address); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Address) + } + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_Owner_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Owner' +type EVM2EVMOffRampInterface_Owner_Call struct { + *mock.Call +} + +// Owner is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *EVM2EVMOffRampInterface_Expecter) Owner(opts interface{}) *EVM2EVMOffRampInterface_Owner_Call { + return &EVM2EVMOffRampInterface_Owner_Call{Call: _e.mock.On("Owner", opts)} +} + +func (_c *EVM2EVMOffRampInterface_Owner_Call) Run(run func(opts *bind.CallOpts)) *EVM2EVMOffRampInterface_Owner_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_Owner_Call) Return(_a0 common.Address, _a1 error) *EVM2EVMOffRampInterface_Owner_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_Owner_Call) RunAndReturn(run func(*bind.CallOpts) (common.Address, error)) *EVM2EVMOffRampInterface_Owner_Call { + _c.Call.Return(run) + return _c +} + +// ParseAdminSet provides a mock function with given fields: log +func (_m *EVM2EVMOffRampInterface) ParseAdminSet(log types.Log) (*evm_2_evm_offramp_1_0_0.EVM2EVMOffRampAdminSet, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParseAdminSet") + } + + var r0 *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampAdminSet + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (*evm_2_evm_offramp_1_0_0.EVM2EVMOffRampAdminSet, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampAdminSet); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*evm_2_evm_offramp_1_0_0.EVM2EVMOffRampAdminSet) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_ParseAdminSet_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseAdminSet' +type EVM2EVMOffRampInterface_ParseAdminSet_Call struct { + *mock.Call +} + +// ParseAdminSet is a helper method to define mock.On call +// - log types.Log +func (_e *EVM2EVMOffRampInterface_Expecter) ParseAdminSet(log interface{}) *EVM2EVMOffRampInterface_ParseAdminSet_Call { + return &EVM2EVMOffRampInterface_ParseAdminSet_Call{Call: _e.mock.On("ParseAdminSet", log)} +} + +func (_c *EVM2EVMOffRampInterface_ParseAdminSet_Call) Run(run func(log types.Log)) *EVM2EVMOffRampInterface_ParseAdminSet_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_ParseAdminSet_Call) Return(_a0 *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampAdminSet, _a1 error) *EVM2EVMOffRampInterface_ParseAdminSet_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_ParseAdminSet_Call) RunAndReturn(run func(types.Log) (*evm_2_evm_offramp_1_0_0.EVM2EVMOffRampAdminSet, error)) *EVM2EVMOffRampInterface_ParseAdminSet_Call { + _c.Call.Return(run) + return _c +} + +// ParseConfigSet provides a mock function with given fields: log +func (_m *EVM2EVMOffRampInterface) ParseConfigSet(log types.Log) (*evm_2_evm_offramp_1_0_0.EVM2EVMOffRampConfigSet, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParseConfigSet") + } + + var r0 *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampConfigSet + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (*evm_2_evm_offramp_1_0_0.EVM2EVMOffRampConfigSet, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampConfigSet); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*evm_2_evm_offramp_1_0_0.EVM2EVMOffRampConfigSet) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_ParseConfigSet_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseConfigSet' +type EVM2EVMOffRampInterface_ParseConfigSet_Call struct { + *mock.Call +} + +// ParseConfigSet is a helper method to define mock.On call +// - log types.Log +func (_e *EVM2EVMOffRampInterface_Expecter) ParseConfigSet(log interface{}) *EVM2EVMOffRampInterface_ParseConfigSet_Call { + return &EVM2EVMOffRampInterface_ParseConfigSet_Call{Call: _e.mock.On("ParseConfigSet", log)} +} + +func (_c *EVM2EVMOffRampInterface_ParseConfigSet_Call) Run(run func(log types.Log)) *EVM2EVMOffRampInterface_ParseConfigSet_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_ParseConfigSet_Call) Return(_a0 *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampConfigSet, _a1 error) *EVM2EVMOffRampInterface_ParseConfigSet_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_ParseConfigSet_Call) RunAndReturn(run func(types.Log) (*evm_2_evm_offramp_1_0_0.EVM2EVMOffRampConfigSet, error)) *EVM2EVMOffRampInterface_ParseConfigSet_Call { + _c.Call.Return(run) + return _c +} + +// ParseConfigSet0 provides a mock function with given fields: log +func (_m *EVM2EVMOffRampInterface) ParseConfigSet0(log types.Log) (*evm_2_evm_offramp_1_0_0.EVM2EVMOffRampConfigSet0, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParseConfigSet0") + } + + var r0 *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampConfigSet0 + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (*evm_2_evm_offramp_1_0_0.EVM2EVMOffRampConfigSet0, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampConfigSet0); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*evm_2_evm_offramp_1_0_0.EVM2EVMOffRampConfigSet0) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_ParseConfigSet0_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseConfigSet0' +type EVM2EVMOffRampInterface_ParseConfigSet0_Call struct { + *mock.Call +} + +// ParseConfigSet0 is a helper method to define mock.On call +// - log types.Log +func (_e *EVM2EVMOffRampInterface_Expecter) ParseConfigSet0(log interface{}) *EVM2EVMOffRampInterface_ParseConfigSet0_Call { + return &EVM2EVMOffRampInterface_ParseConfigSet0_Call{Call: _e.mock.On("ParseConfigSet0", log)} +} + +func (_c *EVM2EVMOffRampInterface_ParseConfigSet0_Call) Run(run func(log types.Log)) *EVM2EVMOffRampInterface_ParseConfigSet0_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_ParseConfigSet0_Call) Return(_a0 *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampConfigSet0, _a1 error) *EVM2EVMOffRampInterface_ParseConfigSet0_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_ParseConfigSet0_Call) RunAndReturn(run func(types.Log) (*evm_2_evm_offramp_1_0_0.EVM2EVMOffRampConfigSet0, error)) *EVM2EVMOffRampInterface_ParseConfigSet0_Call { + _c.Call.Return(run) + return _c +} + +// ParseExecutionStateChanged provides a mock function with given fields: log +func (_m *EVM2EVMOffRampInterface) ParseExecutionStateChanged(log types.Log) (*evm_2_evm_offramp_1_0_0.EVM2EVMOffRampExecutionStateChanged, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParseExecutionStateChanged") + } + + var r0 *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampExecutionStateChanged + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (*evm_2_evm_offramp_1_0_0.EVM2EVMOffRampExecutionStateChanged, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampExecutionStateChanged); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*evm_2_evm_offramp_1_0_0.EVM2EVMOffRampExecutionStateChanged) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_ParseExecutionStateChanged_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseExecutionStateChanged' +type EVM2EVMOffRampInterface_ParseExecutionStateChanged_Call struct { + *mock.Call +} + +// ParseExecutionStateChanged is a helper method to define mock.On call +// - log types.Log +func (_e *EVM2EVMOffRampInterface_Expecter) ParseExecutionStateChanged(log interface{}) *EVM2EVMOffRampInterface_ParseExecutionStateChanged_Call { + return &EVM2EVMOffRampInterface_ParseExecutionStateChanged_Call{Call: _e.mock.On("ParseExecutionStateChanged", log)} +} + +func (_c *EVM2EVMOffRampInterface_ParseExecutionStateChanged_Call) Run(run func(log types.Log)) *EVM2EVMOffRampInterface_ParseExecutionStateChanged_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_ParseExecutionStateChanged_Call) Return(_a0 *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampExecutionStateChanged, _a1 error) *EVM2EVMOffRampInterface_ParseExecutionStateChanged_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_ParseExecutionStateChanged_Call) RunAndReturn(run func(types.Log) (*evm_2_evm_offramp_1_0_0.EVM2EVMOffRampExecutionStateChanged, error)) *EVM2EVMOffRampInterface_ParseExecutionStateChanged_Call { + _c.Call.Return(run) + return _c +} + +// ParseLog provides a mock function with given fields: log +func (_m *EVM2EVMOffRampInterface) ParseLog(log types.Log) (generated.AbigenLog, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParseLog") + } + + var r0 generated.AbigenLog + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (generated.AbigenLog, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) generated.AbigenLog); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(generated.AbigenLog) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_ParseLog_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseLog' +type EVM2EVMOffRampInterface_ParseLog_Call struct { + *mock.Call +} + +// ParseLog is a helper method to define mock.On call +// - log types.Log +func (_e *EVM2EVMOffRampInterface_Expecter) ParseLog(log interface{}) *EVM2EVMOffRampInterface_ParseLog_Call { + return &EVM2EVMOffRampInterface_ParseLog_Call{Call: _e.mock.On("ParseLog", log)} +} + +func (_c *EVM2EVMOffRampInterface_ParseLog_Call) Run(run func(log types.Log)) *EVM2EVMOffRampInterface_ParseLog_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_ParseLog_Call) Return(_a0 generated.AbigenLog, _a1 error) *EVM2EVMOffRampInterface_ParseLog_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_ParseLog_Call) RunAndReturn(run func(types.Log) (generated.AbigenLog, error)) *EVM2EVMOffRampInterface_ParseLog_Call { + _c.Call.Return(run) + return _c +} + +// ParseOwnershipTransferRequested provides a mock function with given fields: log +func (_m *EVM2EVMOffRampInterface) ParseOwnershipTransferRequested(log types.Log) (*evm_2_evm_offramp_1_0_0.EVM2EVMOffRampOwnershipTransferRequested, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParseOwnershipTransferRequested") + } + + var r0 *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampOwnershipTransferRequested + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (*evm_2_evm_offramp_1_0_0.EVM2EVMOffRampOwnershipTransferRequested, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampOwnershipTransferRequested); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*evm_2_evm_offramp_1_0_0.EVM2EVMOffRampOwnershipTransferRequested) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_ParseOwnershipTransferRequested_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseOwnershipTransferRequested' +type EVM2EVMOffRampInterface_ParseOwnershipTransferRequested_Call struct { + *mock.Call +} + +// ParseOwnershipTransferRequested is a helper method to define mock.On call +// - log types.Log +func (_e *EVM2EVMOffRampInterface_Expecter) ParseOwnershipTransferRequested(log interface{}) *EVM2EVMOffRampInterface_ParseOwnershipTransferRequested_Call { + return &EVM2EVMOffRampInterface_ParseOwnershipTransferRequested_Call{Call: _e.mock.On("ParseOwnershipTransferRequested", log)} +} + +func (_c *EVM2EVMOffRampInterface_ParseOwnershipTransferRequested_Call) Run(run func(log types.Log)) *EVM2EVMOffRampInterface_ParseOwnershipTransferRequested_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_ParseOwnershipTransferRequested_Call) Return(_a0 *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampOwnershipTransferRequested, _a1 error) *EVM2EVMOffRampInterface_ParseOwnershipTransferRequested_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_ParseOwnershipTransferRequested_Call) RunAndReturn(run func(types.Log) (*evm_2_evm_offramp_1_0_0.EVM2EVMOffRampOwnershipTransferRequested, error)) *EVM2EVMOffRampInterface_ParseOwnershipTransferRequested_Call { + _c.Call.Return(run) + return _c +} + +// ParseOwnershipTransferred provides a mock function with given fields: log +func (_m *EVM2EVMOffRampInterface) ParseOwnershipTransferred(log types.Log) (*evm_2_evm_offramp_1_0_0.EVM2EVMOffRampOwnershipTransferred, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParseOwnershipTransferred") + } + + var r0 *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampOwnershipTransferred + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (*evm_2_evm_offramp_1_0_0.EVM2EVMOffRampOwnershipTransferred, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampOwnershipTransferred); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*evm_2_evm_offramp_1_0_0.EVM2EVMOffRampOwnershipTransferred) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_ParseOwnershipTransferred_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseOwnershipTransferred' +type EVM2EVMOffRampInterface_ParseOwnershipTransferred_Call struct { + *mock.Call +} + +// ParseOwnershipTransferred is a helper method to define mock.On call +// - log types.Log +func (_e *EVM2EVMOffRampInterface_Expecter) ParseOwnershipTransferred(log interface{}) *EVM2EVMOffRampInterface_ParseOwnershipTransferred_Call { + return &EVM2EVMOffRampInterface_ParseOwnershipTransferred_Call{Call: _e.mock.On("ParseOwnershipTransferred", log)} +} + +func (_c *EVM2EVMOffRampInterface_ParseOwnershipTransferred_Call) Run(run func(log types.Log)) *EVM2EVMOffRampInterface_ParseOwnershipTransferred_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_ParseOwnershipTransferred_Call) Return(_a0 *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampOwnershipTransferred, _a1 error) *EVM2EVMOffRampInterface_ParseOwnershipTransferred_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_ParseOwnershipTransferred_Call) RunAndReturn(run func(types.Log) (*evm_2_evm_offramp_1_0_0.EVM2EVMOffRampOwnershipTransferred, error)) *EVM2EVMOffRampInterface_ParseOwnershipTransferred_Call { + _c.Call.Return(run) + return _c +} + +// ParsePoolAdded provides a mock function with given fields: log +func (_m *EVM2EVMOffRampInterface) ParsePoolAdded(log types.Log) (*evm_2_evm_offramp_1_0_0.EVM2EVMOffRampPoolAdded, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParsePoolAdded") + } + + var r0 *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampPoolAdded + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (*evm_2_evm_offramp_1_0_0.EVM2EVMOffRampPoolAdded, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampPoolAdded); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*evm_2_evm_offramp_1_0_0.EVM2EVMOffRampPoolAdded) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_ParsePoolAdded_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParsePoolAdded' +type EVM2EVMOffRampInterface_ParsePoolAdded_Call struct { + *mock.Call +} + +// ParsePoolAdded is a helper method to define mock.On call +// - log types.Log +func (_e *EVM2EVMOffRampInterface_Expecter) ParsePoolAdded(log interface{}) *EVM2EVMOffRampInterface_ParsePoolAdded_Call { + return &EVM2EVMOffRampInterface_ParsePoolAdded_Call{Call: _e.mock.On("ParsePoolAdded", log)} +} + +func (_c *EVM2EVMOffRampInterface_ParsePoolAdded_Call) Run(run func(log types.Log)) *EVM2EVMOffRampInterface_ParsePoolAdded_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_ParsePoolAdded_Call) Return(_a0 *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampPoolAdded, _a1 error) *EVM2EVMOffRampInterface_ParsePoolAdded_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_ParsePoolAdded_Call) RunAndReturn(run func(types.Log) (*evm_2_evm_offramp_1_0_0.EVM2EVMOffRampPoolAdded, error)) *EVM2EVMOffRampInterface_ParsePoolAdded_Call { + _c.Call.Return(run) + return _c +} + +// ParsePoolRemoved provides a mock function with given fields: log +func (_m *EVM2EVMOffRampInterface) ParsePoolRemoved(log types.Log) (*evm_2_evm_offramp_1_0_0.EVM2EVMOffRampPoolRemoved, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParsePoolRemoved") + } + + var r0 *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampPoolRemoved + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (*evm_2_evm_offramp_1_0_0.EVM2EVMOffRampPoolRemoved, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampPoolRemoved); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*evm_2_evm_offramp_1_0_0.EVM2EVMOffRampPoolRemoved) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_ParsePoolRemoved_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParsePoolRemoved' +type EVM2EVMOffRampInterface_ParsePoolRemoved_Call struct { + *mock.Call +} + +// ParsePoolRemoved is a helper method to define mock.On call +// - log types.Log +func (_e *EVM2EVMOffRampInterface_Expecter) ParsePoolRemoved(log interface{}) *EVM2EVMOffRampInterface_ParsePoolRemoved_Call { + return &EVM2EVMOffRampInterface_ParsePoolRemoved_Call{Call: _e.mock.On("ParsePoolRemoved", log)} +} + +func (_c *EVM2EVMOffRampInterface_ParsePoolRemoved_Call) Run(run func(log types.Log)) *EVM2EVMOffRampInterface_ParsePoolRemoved_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_ParsePoolRemoved_Call) Return(_a0 *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampPoolRemoved, _a1 error) *EVM2EVMOffRampInterface_ParsePoolRemoved_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_ParsePoolRemoved_Call) RunAndReturn(run func(types.Log) (*evm_2_evm_offramp_1_0_0.EVM2EVMOffRampPoolRemoved, error)) *EVM2EVMOffRampInterface_ParsePoolRemoved_Call { + _c.Call.Return(run) + return _c +} + +// ParseSkippedIncorrectNonce provides a mock function with given fields: log +func (_m *EVM2EVMOffRampInterface) ParseSkippedIncorrectNonce(log types.Log) (*evm_2_evm_offramp_1_0_0.EVM2EVMOffRampSkippedIncorrectNonce, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParseSkippedIncorrectNonce") + } + + var r0 *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampSkippedIncorrectNonce + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (*evm_2_evm_offramp_1_0_0.EVM2EVMOffRampSkippedIncorrectNonce, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampSkippedIncorrectNonce); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*evm_2_evm_offramp_1_0_0.EVM2EVMOffRampSkippedIncorrectNonce) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_ParseSkippedIncorrectNonce_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseSkippedIncorrectNonce' +type EVM2EVMOffRampInterface_ParseSkippedIncorrectNonce_Call struct { + *mock.Call +} + +// ParseSkippedIncorrectNonce is a helper method to define mock.On call +// - log types.Log +func (_e *EVM2EVMOffRampInterface_Expecter) ParseSkippedIncorrectNonce(log interface{}) *EVM2EVMOffRampInterface_ParseSkippedIncorrectNonce_Call { + return &EVM2EVMOffRampInterface_ParseSkippedIncorrectNonce_Call{Call: _e.mock.On("ParseSkippedIncorrectNonce", log)} +} + +func (_c *EVM2EVMOffRampInterface_ParseSkippedIncorrectNonce_Call) Run(run func(log types.Log)) *EVM2EVMOffRampInterface_ParseSkippedIncorrectNonce_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_ParseSkippedIncorrectNonce_Call) Return(_a0 *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampSkippedIncorrectNonce, _a1 error) *EVM2EVMOffRampInterface_ParseSkippedIncorrectNonce_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_ParseSkippedIncorrectNonce_Call) RunAndReturn(run func(types.Log) (*evm_2_evm_offramp_1_0_0.EVM2EVMOffRampSkippedIncorrectNonce, error)) *EVM2EVMOffRampInterface_ParseSkippedIncorrectNonce_Call { + _c.Call.Return(run) + return _c +} + +// ParseSkippedSenderWithPreviousRampMessageInflight provides a mock function with given fields: log +func (_m *EVM2EVMOffRampInterface) ParseSkippedSenderWithPreviousRampMessageInflight(log types.Log) (*evm_2_evm_offramp_1_0_0.EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflight, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParseSkippedSenderWithPreviousRampMessageInflight") + } + + var r0 *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflight + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (*evm_2_evm_offramp_1_0_0.EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflight, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflight); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*evm_2_evm_offramp_1_0_0.EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflight) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_ParseSkippedSenderWithPreviousRampMessageInflight_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseSkippedSenderWithPreviousRampMessageInflight' +type EVM2EVMOffRampInterface_ParseSkippedSenderWithPreviousRampMessageInflight_Call struct { + *mock.Call +} + +// ParseSkippedSenderWithPreviousRampMessageInflight is a helper method to define mock.On call +// - log types.Log +func (_e *EVM2EVMOffRampInterface_Expecter) ParseSkippedSenderWithPreviousRampMessageInflight(log interface{}) *EVM2EVMOffRampInterface_ParseSkippedSenderWithPreviousRampMessageInflight_Call { + return &EVM2EVMOffRampInterface_ParseSkippedSenderWithPreviousRampMessageInflight_Call{Call: _e.mock.On("ParseSkippedSenderWithPreviousRampMessageInflight", log)} +} + +func (_c *EVM2EVMOffRampInterface_ParseSkippedSenderWithPreviousRampMessageInflight_Call) Run(run func(log types.Log)) *EVM2EVMOffRampInterface_ParseSkippedSenderWithPreviousRampMessageInflight_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_ParseSkippedSenderWithPreviousRampMessageInflight_Call) Return(_a0 *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflight, _a1 error) *EVM2EVMOffRampInterface_ParseSkippedSenderWithPreviousRampMessageInflight_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_ParseSkippedSenderWithPreviousRampMessageInflight_Call) RunAndReturn(run func(types.Log) (*evm_2_evm_offramp_1_0_0.EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflight, error)) *EVM2EVMOffRampInterface_ParseSkippedSenderWithPreviousRampMessageInflight_Call { + _c.Call.Return(run) + return _c +} + +// ParseTransmitted provides a mock function with given fields: log +func (_m *EVM2EVMOffRampInterface) ParseTransmitted(log types.Log) (*evm_2_evm_offramp_1_0_0.EVM2EVMOffRampTransmitted, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParseTransmitted") + } + + var r0 *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampTransmitted + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (*evm_2_evm_offramp_1_0_0.EVM2EVMOffRampTransmitted, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampTransmitted); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*evm_2_evm_offramp_1_0_0.EVM2EVMOffRampTransmitted) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_ParseTransmitted_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseTransmitted' +type EVM2EVMOffRampInterface_ParseTransmitted_Call struct { + *mock.Call +} + +// ParseTransmitted is a helper method to define mock.On call +// - log types.Log +func (_e *EVM2EVMOffRampInterface_Expecter) ParseTransmitted(log interface{}) *EVM2EVMOffRampInterface_ParseTransmitted_Call { + return &EVM2EVMOffRampInterface_ParseTransmitted_Call{Call: _e.mock.On("ParseTransmitted", log)} +} + +func (_c *EVM2EVMOffRampInterface_ParseTransmitted_Call) Run(run func(log types.Log)) *EVM2EVMOffRampInterface_ParseTransmitted_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_ParseTransmitted_Call) Return(_a0 *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampTransmitted, _a1 error) *EVM2EVMOffRampInterface_ParseTransmitted_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_ParseTransmitted_Call) RunAndReturn(run func(types.Log) (*evm_2_evm_offramp_1_0_0.EVM2EVMOffRampTransmitted, error)) *EVM2EVMOffRampInterface_ParseTransmitted_Call { + _c.Call.Return(run) + return _c +} + +// SetAdmin provides a mock function with given fields: opts, newAdmin +func (_m *EVM2EVMOffRampInterface) SetAdmin(opts *bind.TransactOpts, newAdmin common.Address) (*types.Transaction, error) { + ret := _m.Called(opts, newAdmin) + + if len(ret) == 0 { + panic("no return value specified for SetAdmin") + } + + var r0 *types.Transaction + var r1 error + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, common.Address) (*types.Transaction, error)); ok { + return rf(opts, newAdmin) + } + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, common.Address) *types.Transaction); ok { + r0 = rf(opts, newAdmin) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Transaction) + } + } + + if rf, ok := ret.Get(1).(func(*bind.TransactOpts, common.Address) error); ok { + r1 = rf(opts, newAdmin) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_SetAdmin_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetAdmin' +type EVM2EVMOffRampInterface_SetAdmin_Call struct { + *mock.Call +} + +// SetAdmin is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - newAdmin common.Address +func (_e *EVM2EVMOffRampInterface_Expecter) SetAdmin(opts interface{}, newAdmin interface{}) *EVM2EVMOffRampInterface_SetAdmin_Call { + return &EVM2EVMOffRampInterface_SetAdmin_Call{Call: _e.mock.On("SetAdmin", opts, newAdmin)} +} + +func (_c *EVM2EVMOffRampInterface_SetAdmin_Call) Run(run func(opts *bind.TransactOpts, newAdmin common.Address)) *EVM2EVMOffRampInterface_SetAdmin_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].(common.Address)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_SetAdmin_Call) Return(_a0 *types.Transaction, _a1 error) *EVM2EVMOffRampInterface_SetAdmin_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_SetAdmin_Call) RunAndReturn(run func(*bind.TransactOpts, common.Address) (*types.Transaction, error)) *EVM2EVMOffRampInterface_SetAdmin_Call { + _c.Call.Return(run) + return _c +} + +// SetOCR2Config provides a mock function with given fields: opts, signers, transmitters, f, onchainConfig, offchainConfigVersion, offchainConfig +func (_m *EVM2EVMOffRampInterface) SetOCR2Config(opts *bind.TransactOpts, signers []common.Address, transmitters []common.Address, f uint8, onchainConfig []byte, offchainConfigVersion uint64, offchainConfig []byte) (*types.Transaction, error) { + ret := _m.Called(opts, signers, transmitters, f, onchainConfig, offchainConfigVersion, offchainConfig) + + if len(ret) == 0 { + panic("no return value specified for SetOCR2Config") + } + + var r0 *types.Transaction + var r1 error + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, []common.Address, []common.Address, uint8, []byte, uint64, []byte) (*types.Transaction, error)); ok { + return rf(opts, signers, transmitters, f, onchainConfig, offchainConfigVersion, offchainConfig) + } + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, []common.Address, []common.Address, uint8, []byte, uint64, []byte) *types.Transaction); ok { + r0 = rf(opts, signers, transmitters, f, onchainConfig, offchainConfigVersion, offchainConfig) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Transaction) + } + } + + if rf, ok := ret.Get(1).(func(*bind.TransactOpts, []common.Address, []common.Address, uint8, []byte, uint64, []byte) error); ok { + r1 = rf(opts, signers, transmitters, f, onchainConfig, offchainConfigVersion, offchainConfig) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_SetOCR2Config_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetOCR2Config' +type EVM2EVMOffRampInterface_SetOCR2Config_Call struct { + *mock.Call +} + +// SetOCR2Config is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - signers []common.Address +// - transmitters []common.Address +// - f uint8 +// - onchainConfig []byte +// - offchainConfigVersion uint64 +// - offchainConfig []byte +func (_e *EVM2EVMOffRampInterface_Expecter) SetOCR2Config(opts interface{}, signers interface{}, transmitters interface{}, f interface{}, onchainConfig interface{}, offchainConfigVersion interface{}, offchainConfig interface{}) *EVM2EVMOffRampInterface_SetOCR2Config_Call { + return &EVM2EVMOffRampInterface_SetOCR2Config_Call{Call: _e.mock.On("SetOCR2Config", opts, signers, transmitters, f, onchainConfig, offchainConfigVersion, offchainConfig)} +} + +func (_c *EVM2EVMOffRampInterface_SetOCR2Config_Call) Run(run func(opts *bind.TransactOpts, signers []common.Address, transmitters []common.Address, f uint8, onchainConfig []byte, offchainConfigVersion uint64, offchainConfig []byte)) *EVM2EVMOffRampInterface_SetOCR2Config_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].([]common.Address), args[2].([]common.Address), args[3].(uint8), args[4].([]byte), args[5].(uint64), args[6].([]byte)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_SetOCR2Config_Call) Return(_a0 *types.Transaction, _a1 error) *EVM2EVMOffRampInterface_SetOCR2Config_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_SetOCR2Config_Call) RunAndReturn(run func(*bind.TransactOpts, []common.Address, []common.Address, uint8, []byte, uint64, []byte) (*types.Transaction, error)) *EVM2EVMOffRampInterface_SetOCR2Config_Call { + _c.Call.Return(run) + return _c +} + +// SetRateLimiterConfig provides a mock function with given fields: opts, config +func (_m *EVM2EVMOffRampInterface) SetRateLimiterConfig(opts *bind.TransactOpts, config evm_2_evm_offramp_1_0_0.RateLimiterConfig) (*types.Transaction, error) { + ret := _m.Called(opts, config) + + if len(ret) == 0 { + panic("no return value specified for SetRateLimiterConfig") + } + + var r0 *types.Transaction + var r1 error + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, evm_2_evm_offramp_1_0_0.RateLimiterConfig) (*types.Transaction, error)); ok { + return rf(opts, config) + } + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, evm_2_evm_offramp_1_0_0.RateLimiterConfig) *types.Transaction); ok { + r0 = rf(opts, config) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Transaction) + } + } + + if rf, ok := ret.Get(1).(func(*bind.TransactOpts, evm_2_evm_offramp_1_0_0.RateLimiterConfig) error); ok { + r1 = rf(opts, config) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_SetRateLimiterConfig_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetRateLimiterConfig' +type EVM2EVMOffRampInterface_SetRateLimiterConfig_Call struct { + *mock.Call +} + +// SetRateLimiterConfig is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - config evm_2_evm_offramp_1_0_0.RateLimiterConfig +func (_e *EVM2EVMOffRampInterface_Expecter) SetRateLimiterConfig(opts interface{}, config interface{}) *EVM2EVMOffRampInterface_SetRateLimiterConfig_Call { + return &EVM2EVMOffRampInterface_SetRateLimiterConfig_Call{Call: _e.mock.On("SetRateLimiterConfig", opts, config)} +} + +func (_c *EVM2EVMOffRampInterface_SetRateLimiterConfig_Call) Run(run func(opts *bind.TransactOpts, config evm_2_evm_offramp_1_0_0.RateLimiterConfig)) *EVM2EVMOffRampInterface_SetRateLimiterConfig_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].(evm_2_evm_offramp_1_0_0.RateLimiterConfig)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_SetRateLimiterConfig_Call) Return(_a0 *types.Transaction, _a1 error) *EVM2EVMOffRampInterface_SetRateLimiterConfig_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_SetRateLimiterConfig_Call) RunAndReturn(run func(*bind.TransactOpts, evm_2_evm_offramp_1_0_0.RateLimiterConfig) (*types.Transaction, error)) *EVM2EVMOffRampInterface_SetRateLimiterConfig_Call { + _c.Call.Return(run) + return _c +} + +// TransferOwnership provides a mock function with given fields: opts, to +func (_m *EVM2EVMOffRampInterface) TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) { + ret := _m.Called(opts, to) + + if len(ret) == 0 { + panic("no return value specified for TransferOwnership") + } + + var r0 *types.Transaction + var r1 error + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, common.Address) (*types.Transaction, error)); ok { + return rf(opts, to) + } + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, common.Address) *types.Transaction); ok { + r0 = rf(opts, to) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Transaction) + } + } + + if rf, ok := ret.Get(1).(func(*bind.TransactOpts, common.Address) error); ok { + r1 = rf(opts, to) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_TransferOwnership_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TransferOwnership' +type EVM2EVMOffRampInterface_TransferOwnership_Call struct { + *mock.Call +} + +// TransferOwnership is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - to common.Address +func (_e *EVM2EVMOffRampInterface_Expecter) TransferOwnership(opts interface{}, to interface{}) *EVM2EVMOffRampInterface_TransferOwnership_Call { + return &EVM2EVMOffRampInterface_TransferOwnership_Call{Call: _e.mock.On("TransferOwnership", opts, to)} +} + +func (_c *EVM2EVMOffRampInterface_TransferOwnership_Call) Run(run func(opts *bind.TransactOpts, to common.Address)) *EVM2EVMOffRampInterface_TransferOwnership_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].(common.Address)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_TransferOwnership_Call) Return(_a0 *types.Transaction, _a1 error) *EVM2EVMOffRampInterface_TransferOwnership_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_TransferOwnership_Call) RunAndReturn(run func(*bind.TransactOpts, common.Address) (*types.Transaction, error)) *EVM2EVMOffRampInterface_TransferOwnership_Call { + _c.Call.Return(run) + return _c +} + +// Transmit provides a mock function with given fields: opts, reportContext, report, rs, ss, arg4 +func (_m *EVM2EVMOffRampInterface) Transmit(opts *bind.TransactOpts, reportContext [3][32]byte, report []byte, rs [][32]byte, ss [][32]byte, arg4 [32]byte) (*types.Transaction, error) { + ret := _m.Called(opts, reportContext, report, rs, ss, arg4) + + if len(ret) == 0 { + panic("no return value specified for Transmit") + } + + var r0 *types.Transaction + var r1 error + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, [3][32]byte, []byte, [][32]byte, [][32]byte, [32]byte) (*types.Transaction, error)); ok { + return rf(opts, reportContext, report, rs, ss, arg4) + } + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, [3][32]byte, []byte, [][32]byte, [][32]byte, [32]byte) *types.Transaction); ok { + r0 = rf(opts, reportContext, report, rs, ss, arg4) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Transaction) + } + } + + if rf, ok := ret.Get(1).(func(*bind.TransactOpts, [3][32]byte, []byte, [][32]byte, [][32]byte, [32]byte) error); ok { + r1 = rf(opts, reportContext, report, rs, ss, arg4) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_Transmit_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Transmit' +type EVM2EVMOffRampInterface_Transmit_Call struct { + *mock.Call +} + +// Transmit is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - reportContext [3][32]byte +// - report []byte +// - rs [][32]byte +// - ss [][32]byte +// - arg4 [32]byte +func (_e *EVM2EVMOffRampInterface_Expecter) Transmit(opts interface{}, reportContext interface{}, report interface{}, rs interface{}, ss interface{}, arg4 interface{}) *EVM2EVMOffRampInterface_Transmit_Call { + return &EVM2EVMOffRampInterface_Transmit_Call{Call: _e.mock.On("Transmit", opts, reportContext, report, rs, ss, arg4)} +} + +func (_c *EVM2EVMOffRampInterface_Transmit_Call) Run(run func(opts *bind.TransactOpts, reportContext [3][32]byte, report []byte, rs [][32]byte, ss [][32]byte, arg4 [32]byte)) *EVM2EVMOffRampInterface_Transmit_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].([3][32]byte), args[2].([]byte), args[3].([][32]byte), args[4].([][32]byte), args[5].([32]byte)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_Transmit_Call) Return(_a0 *types.Transaction, _a1 error) *EVM2EVMOffRampInterface_Transmit_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_Transmit_Call) RunAndReturn(run func(*bind.TransactOpts, [3][32]byte, []byte, [][32]byte, [][32]byte, [32]byte) (*types.Transaction, error)) *EVM2EVMOffRampInterface_Transmit_Call { + _c.Call.Return(run) + return _c +} + +// TypeAndVersion provides a mock function with given fields: opts +func (_m *EVM2EVMOffRampInterface) TypeAndVersion(opts *bind.CallOpts) (string, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for TypeAndVersion") + } + + var r0 string + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts) (string, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts) string); ok { + r0 = rf(opts) + } else { + r0 = ret.Get(0).(string) + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_TypeAndVersion_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TypeAndVersion' +type EVM2EVMOffRampInterface_TypeAndVersion_Call struct { + *mock.Call +} + +// TypeAndVersion is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *EVM2EVMOffRampInterface_Expecter) TypeAndVersion(opts interface{}) *EVM2EVMOffRampInterface_TypeAndVersion_Call { + return &EVM2EVMOffRampInterface_TypeAndVersion_Call{Call: _e.mock.On("TypeAndVersion", opts)} +} + +func (_c *EVM2EVMOffRampInterface_TypeAndVersion_Call) Run(run func(opts *bind.CallOpts)) *EVM2EVMOffRampInterface_TypeAndVersion_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_TypeAndVersion_Call) Return(_a0 string, _a1 error) *EVM2EVMOffRampInterface_TypeAndVersion_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_TypeAndVersion_Call) RunAndReturn(run func(*bind.CallOpts) (string, error)) *EVM2EVMOffRampInterface_TypeAndVersion_Call { + _c.Call.Return(run) + return _c +} + +// WatchAdminSet provides a mock function with given fields: opts, sink +func (_m *EVM2EVMOffRampInterface) WatchAdminSet(opts *bind.WatchOpts, sink chan<- *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampAdminSet) (event.Subscription, error) { + ret := _m.Called(opts, sink) + + if len(ret) == 0 { + panic("no return value specified for WatchAdminSet") + } + + var r0 event.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampAdminSet) (event.Subscription, error)); ok { + return rf(opts, sink) + } + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampAdminSet) event.Subscription); ok { + r0 = rf(opts, sink) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(event.Subscription) + } + } + + if rf, ok := ret.Get(1).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampAdminSet) error); ok { + r1 = rf(opts, sink) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_WatchAdminSet_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchAdminSet' +type EVM2EVMOffRampInterface_WatchAdminSet_Call struct { + *mock.Call +} + +// WatchAdminSet is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampAdminSet +func (_e *EVM2EVMOffRampInterface_Expecter) WatchAdminSet(opts interface{}, sink interface{}) *EVM2EVMOffRampInterface_WatchAdminSet_Call { + return &EVM2EVMOffRampInterface_WatchAdminSet_Call{Call: _e.mock.On("WatchAdminSet", opts, sink)} +} + +func (_c *EVM2EVMOffRampInterface_WatchAdminSet_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampAdminSet)) *EVM2EVMOffRampInterface_WatchAdminSet_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampAdminSet)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_WatchAdminSet_Call) Return(_a0 event.Subscription, _a1 error) *EVM2EVMOffRampInterface_WatchAdminSet_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_WatchAdminSet_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampAdminSet) (event.Subscription, error)) *EVM2EVMOffRampInterface_WatchAdminSet_Call { + _c.Call.Return(run) + return _c +} + +// WatchConfigSet provides a mock function with given fields: opts, sink +func (_m *EVM2EVMOffRampInterface) WatchConfigSet(opts *bind.WatchOpts, sink chan<- *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampConfigSet) (event.Subscription, error) { + ret := _m.Called(opts, sink) + + if len(ret) == 0 { + panic("no return value specified for WatchConfigSet") + } + + var r0 event.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampConfigSet) (event.Subscription, error)); ok { + return rf(opts, sink) + } + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampConfigSet) event.Subscription); ok { + r0 = rf(opts, sink) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(event.Subscription) + } + } + + if rf, ok := ret.Get(1).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampConfigSet) error); ok { + r1 = rf(opts, sink) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_WatchConfigSet_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchConfigSet' +type EVM2EVMOffRampInterface_WatchConfigSet_Call struct { + *mock.Call +} + +// WatchConfigSet is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampConfigSet +func (_e *EVM2EVMOffRampInterface_Expecter) WatchConfigSet(opts interface{}, sink interface{}) *EVM2EVMOffRampInterface_WatchConfigSet_Call { + return &EVM2EVMOffRampInterface_WatchConfigSet_Call{Call: _e.mock.On("WatchConfigSet", opts, sink)} +} + +func (_c *EVM2EVMOffRampInterface_WatchConfigSet_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampConfigSet)) *EVM2EVMOffRampInterface_WatchConfigSet_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampConfigSet)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_WatchConfigSet_Call) Return(_a0 event.Subscription, _a1 error) *EVM2EVMOffRampInterface_WatchConfigSet_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_WatchConfigSet_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampConfigSet) (event.Subscription, error)) *EVM2EVMOffRampInterface_WatchConfigSet_Call { + _c.Call.Return(run) + return _c +} + +// WatchConfigSet0 provides a mock function with given fields: opts, sink +func (_m *EVM2EVMOffRampInterface) WatchConfigSet0(opts *bind.WatchOpts, sink chan<- *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampConfigSet0) (event.Subscription, error) { + ret := _m.Called(opts, sink) + + if len(ret) == 0 { + panic("no return value specified for WatchConfigSet0") + } + + var r0 event.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampConfigSet0) (event.Subscription, error)); ok { + return rf(opts, sink) + } + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampConfigSet0) event.Subscription); ok { + r0 = rf(opts, sink) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(event.Subscription) + } + } + + if rf, ok := ret.Get(1).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampConfigSet0) error); ok { + r1 = rf(opts, sink) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_WatchConfigSet0_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchConfigSet0' +type EVM2EVMOffRampInterface_WatchConfigSet0_Call struct { + *mock.Call +} + +// WatchConfigSet0 is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampConfigSet0 +func (_e *EVM2EVMOffRampInterface_Expecter) WatchConfigSet0(opts interface{}, sink interface{}) *EVM2EVMOffRampInterface_WatchConfigSet0_Call { + return &EVM2EVMOffRampInterface_WatchConfigSet0_Call{Call: _e.mock.On("WatchConfigSet0", opts, sink)} +} + +func (_c *EVM2EVMOffRampInterface_WatchConfigSet0_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampConfigSet0)) *EVM2EVMOffRampInterface_WatchConfigSet0_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampConfigSet0)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_WatchConfigSet0_Call) Return(_a0 event.Subscription, _a1 error) *EVM2EVMOffRampInterface_WatchConfigSet0_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_WatchConfigSet0_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampConfigSet0) (event.Subscription, error)) *EVM2EVMOffRampInterface_WatchConfigSet0_Call { + _c.Call.Return(run) + return _c +} + +// WatchExecutionStateChanged provides a mock function with given fields: opts, sink, sequenceNumber, messageId +func (_m *EVM2EVMOffRampInterface) WatchExecutionStateChanged(opts *bind.WatchOpts, sink chan<- *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampExecutionStateChanged, sequenceNumber []uint64, messageId [][32]byte) (event.Subscription, error) { + ret := _m.Called(opts, sink, sequenceNumber, messageId) + + if len(ret) == 0 { + panic("no return value specified for WatchExecutionStateChanged") + } + + var r0 event.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampExecutionStateChanged, []uint64, [][32]byte) (event.Subscription, error)); ok { + return rf(opts, sink, sequenceNumber, messageId) + } + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampExecutionStateChanged, []uint64, [][32]byte) event.Subscription); ok { + r0 = rf(opts, sink, sequenceNumber, messageId) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(event.Subscription) + } + } + + if rf, ok := ret.Get(1).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampExecutionStateChanged, []uint64, [][32]byte) error); ok { + r1 = rf(opts, sink, sequenceNumber, messageId) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_WatchExecutionStateChanged_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchExecutionStateChanged' +type EVM2EVMOffRampInterface_WatchExecutionStateChanged_Call struct { + *mock.Call +} + +// WatchExecutionStateChanged is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampExecutionStateChanged +// - sequenceNumber []uint64 +// - messageId [][32]byte +func (_e *EVM2EVMOffRampInterface_Expecter) WatchExecutionStateChanged(opts interface{}, sink interface{}, sequenceNumber interface{}, messageId interface{}) *EVM2EVMOffRampInterface_WatchExecutionStateChanged_Call { + return &EVM2EVMOffRampInterface_WatchExecutionStateChanged_Call{Call: _e.mock.On("WatchExecutionStateChanged", opts, sink, sequenceNumber, messageId)} +} + +func (_c *EVM2EVMOffRampInterface_WatchExecutionStateChanged_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampExecutionStateChanged, sequenceNumber []uint64, messageId [][32]byte)) *EVM2EVMOffRampInterface_WatchExecutionStateChanged_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampExecutionStateChanged), args[2].([]uint64), args[3].([][32]byte)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_WatchExecutionStateChanged_Call) Return(_a0 event.Subscription, _a1 error) *EVM2EVMOffRampInterface_WatchExecutionStateChanged_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_WatchExecutionStateChanged_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampExecutionStateChanged, []uint64, [][32]byte) (event.Subscription, error)) *EVM2EVMOffRampInterface_WatchExecutionStateChanged_Call { + _c.Call.Return(run) + return _c +} + +// WatchOwnershipTransferRequested provides a mock function with given fields: opts, sink, from, to +func (_m *EVM2EVMOffRampInterface) WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) { + ret := _m.Called(opts, sink, from, to) + + if len(ret) == 0 { + panic("no return value specified for WatchOwnershipTransferRequested") + } + + var r0 event.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampOwnershipTransferRequested, []common.Address, []common.Address) (event.Subscription, error)); ok { + return rf(opts, sink, from, to) + } + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampOwnershipTransferRequested, []common.Address, []common.Address) event.Subscription); ok { + r0 = rf(opts, sink, from, to) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(event.Subscription) + } + } + + if rf, ok := ret.Get(1).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampOwnershipTransferRequested, []common.Address, []common.Address) error); ok { + r1 = rf(opts, sink, from, to) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_WatchOwnershipTransferRequested_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchOwnershipTransferRequested' +type EVM2EVMOffRampInterface_WatchOwnershipTransferRequested_Call struct { + *mock.Call +} + +// WatchOwnershipTransferRequested is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampOwnershipTransferRequested +// - from []common.Address +// - to []common.Address +func (_e *EVM2EVMOffRampInterface_Expecter) WatchOwnershipTransferRequested(opts interface{}, sink interface{}, from interface{}, to interface{}) *EVM2EVMOffRampInterface_WatchOwnershipTransferRequested_Call { + return &EVM2EVMOffRampInterface_WatchOwnershipTransferRequested_Call{Call: _e.mock.On("WatchOwnershipTransferRequested", opts, sink, from, to)} +} + +func (_c *EVM2EVMOffRampInterface_WatchOwnershipTransferRequested_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampOwnershipTransferRequested, from []common.Address, to []common.Address)) *EVM2EVMOffRampInterface_WatchOwnershipTransferRequested_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampOwnershipTransferRequested), args[2].([]common.Address), args[3].([]common.Address)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_WatchOwnershipTransferRequested_Call) Return(_a0 event.Subscription, _a1 error) *EVM2EVMOffRampInterface_WatchOwnershipTransferRequested_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_WatchOwnershipTransferRequested_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampOwnershipTransferRequested, []common.Address, []common.Address) (event.Subscription, error)) *EVM2EVMOffRampInterface_WatchOwnershipTransferRequested_Call { + _c.Call.Return(run) + return _c +} + +// WatchOwnershipTransferred provides a mock function with given fields: opts, sink, from, to +func (_m *EVM2EVMOffRampInterface) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) { + ret := _m.Called(opts, sink, from, to) + + if len(ret) == 0 { + panic("no return value specified for WatchOwnershipTransferred") + } + + var r0 event.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampOwnershipTransferred, []common.Address, []common.Address) (event.Subscription, error)); ok { + return rf(opts, sink, from, to) + } + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampOwnershipTransferred, []common.Address, []common.Address) event.Subscription); ok { + r0 = rf(opts, sink, from, to) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(event.Subscription) + } + } + + if rf, ok := ret.Get(1).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampOwnershipTransferred, []common.Address, []common.Address) error); ok { + r1 = rf(opts, sink, from, to) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_WatchOwnershipTransferred_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchOwnershipTransferred' +type EVM2EVMOffRampInterface_WatchOwnershipTransferred_Call struct { + *mock.Call +} + +// WatchOwnershipTransferred is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampOwnershipTransferred +// - from []common.Address +// - to []common.Address +func (_e *EVM2EVMOffRampInterface_Expecter) WatchOwnershipTransferred(opts interface{}, sink interface{}, from interface{}, to interface{}) *EVM2EVMOffRampInterface_WatchOwnershipTransferred_Call { + return &EVM2EVMOffRampInterface_WatchOwnershipTransferred_Call{Call: _e.mock.On("WatchOwnershipTransferred", opts, sink, from, to)} +} + +func (_c *EVM2EVMOffRampInterface_WatchOwnershipTransferred_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampOwnershipTransferred, from []common.Address, to []common.Address)) *EVM2EVMOffRampInterface_WatchOwnershipTransferred_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampOwnershipTransferred), args[2].([]common.Address), args[3].([]common.Address)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_WatchOwnershipTransferred_Call) Return(_a0 event.Subscription, _a1 error) *EVM2EVMOffRampInterface_WatchOwnershipTransferred_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_WatchOwnershipTransferred_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampOwnershipTransferred, []common.Address, []common.Address) (event.Subscription, error)) *EVM2EVMOffRampInterface_WatchOwnershipTransferred_Call { + _c.Call.Return(run) + return _c +} + +// WatchPoolAdded provides a mock function with given fields: opts, sink +func (_m *EVM2EVMOffRampInterface) WatchPoolAdded(opts *bind.WatchOpts, sink chan<- *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampPoolAdded) (event.Subscription, error) { + ret := _m.Called(opts, sink) + + if len(ret) == 0 { + panic("no return value specified for WatchPoolAdded") + } + + var r0 event.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampPoolAdded) (event.Subscription, error)); ok { + return rf(opts, sink) + } + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampPoolAdded) event.Subscription); ok { + r0 = rf(opts, sink) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(event.Subscription) + } + } + + if rf, ok := ret.Get(1).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampPoolAdded) error); ok { + r1 = rf(opts, sink) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_WatchPoolAdded_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchPoolAdded' +type EVM2EVMOffRampInterface_WatchPoolAdded_Call struct { + *mock.Call +} + +// WatchPoolAdded is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampPoolAdded +func (_e *EVM2EVMOffRampInterface_Expecter) WatchPoolAdded(opts interface{}, sink interface{}) *EVM2EVMOffRampInterface_WatchPoolAdded_Call { + return &EVM2EVMOffRampInterface_WatchPoolAdded_Call{Call: _e.mock.On("WatchPoolAdded", opts, sink)} +} + +func (_c *EVM2EVMOffRampInterface_WatchPoolAdded_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampPoolAdded)) *EVM2EVMOffRampInterface_WatchPoolAdded_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampPoolAdded)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_WatchPoolAdded_Call) Return(_a0 event.Subscription, _a1 error) *EVM2EVMOffRampInterface_WatchPoolAdded_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_WatchPoolAdded_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampPoolAdded) (event.Subscription, error)) *EVM2EVMOffRampInterface_WatchPoolAdded_Call { + _c.Call.Return(run) + return _c +} + +// WatchPoolRemoved provides a mock function with given fields: opts, sink +func (_m *EVM2EVMOffRampInterface) WatchPoolRemoved(opts *bind.WatchOpts, sink chan<- *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampPoolRemoved) (event.Subscription, error) { + ret := _m.Called(opts, sink) + + if len(ret) == 0 { + panic("no return value specified for WatchPoolRemoved") + } + + var r0 event.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampPoolRemoved) (event.Subscription, error)); ok { + return rf(opts, sink) + } + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampPoolRemoved) event.Subscription); ok { + r0 = rf(opts, sink) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(event.Subscription) + } + } + + if rf, ok := ret.Get(1).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampPoolRemoved) error); ok { + r1 = rf(opts, sink) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_WatchPoolRemoved_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchPoolRemoved' +type EVM2EVMOffRampInterface_WatchPoolRemoved_Call struct { + *mock.Call +} + +// WatchPoolRemoved is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampPoolRemoved +func (_e *EVM2EVMOffRampInterface_Expecter) WatchPoolRemoved(opts interface{}, sink interface{}) *EVM2EVMOffRampInterface_WatchPoolRemoved_Call { + return &EVM2EVMOffRampInterface_WatchPoolRemoved_Call{Call: _e.mock.On("WatchPoolRemoved", opts, sink)} +} + +func (_c *EVM2EVMOffRampInterface_WatchPoolRemoved_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampPoolRemoved)) *EVM2EVMOffRampInterface_WatchPoolRemoved_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampPoolRemoved)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_WatchPoolRemoved_Call) Return(_a0 event.Subscription, _a1 error) *EVM2EVMOffRampInterface_WatchPoolRemoved_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_WatchPoolRemoved_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampPoolRemoved) (event.Subscription, error)) *EVM2EVMOffRampInterface_WatchPoolRemoved_Call { + _c.Call.Return(run) + return _c +} + +// WatchSkippedIncorrectNonce provides a mock function with given fields: opts, sink, nonce, sender +func (_m *EVM2EVMOffRampInterface) WatchSkippedIncorrectNonce(opts *bind.WatchOpts, sink chan<- *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampSkippedIncorrectNonce, nonce []uint64, sender []common.Address) (event.Subscription, error) { + ret := _m.Called(opts, sink, nonce, sender) + + if len(ret) == 0 { + panic("no return value specified for WatchSkippedIncorrectNonce") + } + + var r0 event.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampSkippedIncorrectNonce, []uint64, []common.Address) (event.Subscription, error)); ok { + return rf(opts, sink, nonce, sender) + } + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampSkippedIncorrectNonce, []uint64, []common.Address) event.Subscription); ok { + r0 = rf(opts, sink, nonce, sender) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(event.Subscription) + } + } + + if rf, ok := ret.Get(1).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampSkippedIncorrectNonce, []uint64, []common.Address) error); ok { + r1 = rf(opts, sink, nonce, sender) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_WatchSkippedIncorrectNonce_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchSkippedIncorrectNonce' +type EVM2EVMOffRampInterface_WatchSkippedIncorrectNonce_Call struct { + *mock.Call +} + +// WatchSkippedIncorrectNonce is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampSkippedIncorrectNonce +// - nonce []uint64 +// - sender []common.Address +func (_e *EVM2EVMOffRampInterface_Expecter) WatchSkippedIncorrectNonce(opts interface{}, sink interface{}, nonce interface{}, sender interface{}) *EVM2EVMOffRampInterface_WatchSkippedIncorrectNonce_Call { + return &EVM2EVMOffRampInterface_WatchSkippedIncorrectNonce_Call{Call: _e.mock.On("WatchSkippedIncorrectNonce", opts, sink, nonce, sender)} +} + +func (_c *EVM2EVMOffRampInterface_WatchSkippedIncorrectNonce_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampSkippedIncorrectNonce, nonce []uint64, sender []common.Address)) *EVM2EVMOffRampInterface_WatchSkippedIncorrectNonce_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampSkippedIncorrectNonce), args[2].([]uint64), args[3].([]common.Address)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_WatchSkippedIncorrectNonce_Call) Return(_a0 event.Subscription, _a1 error) *EVM2EVMOffRampInterface_WatchSkippedIncorrectNonce_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_WatchSkippedIncorrectNonce_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampSkippedIncorrectNonce, []uint64, []common.Address) (event.Subscription, error)) *EVM2EVMOffRampInterface_WatchSkippedIncorrectNonce_Call { + _c.Call.Return(run) + return _c +} + +// WatchSkippedSenderWithPreviousRampMessageInflight provides a mock function with given fields: opts, sink, nonce, sender +func (_m *EVM2EVMOffRampInterface) WatchSkippedSenderWithPreviousRampMessageInflight(opts *bind.WatchOpts, sink chan<- *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflight, nonce []uint64, sender []common.Address) (event.Subscription, error) { + ret := _m.Called(opts, sink, nonce, sender) + + if len(ret) == 0 { + panic("no return value specified for WatchSkippedSenderWithPreviousRampMessageInflight") + } + + var r0 event.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflight, []uint64, []common.Address) (event.Subscription, error)); ok { + return rf(opts, sink, nonce, sender) + } + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflight, []uint64, []common.Address) event.Subscription); ok { + r0 = rf(opts, sink, nonce, sender) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(event.Subscription) + } + } + + if rf, ok := ret.Get(1).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflight, []uint64, []common.Address) error); ok { + r1 = rf(opts, sink, nonce, sender) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_WatchSkippedSenderWithPreviousRampMessageInflight_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchSkippedSenderWithPreviousRampMessageInflight' +type EVM2EVMOffRampInterface_WatchSkippedSenderWithPreviousRampMessageInflight_Call struct { + *mock.Call +} + +// WatchSkippedSenderWithPreviousRampMessageInflight is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflight +// - nonce []uint64 +// - sender []common.Address +func (_e *EVM2EVMOffRampInterface_Expecter) WatchSkippedSenderWithPreviousRampMessageInflight(opts interface{}, sink interface{}, nonce interface{}, sender interface{}) *EVM2EVMOffRampInterface_WatchSkippedSenderWithPreviousRampMessageInflight_Call { + return &EVM2EVMOffRampInterface_WatchSkippedSenderWithPreviousRampMessageInflight_Call{Call: _e.mock.On("WatchSkippedSenderWithPreviousRampMessageInflight", opts, sink, nonce, sender)} +} + +func (_c *EVM2EVMOffRampInterface_WatchSkippedSenderWithPreviousRampMessageInflight_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflight, nonce []uint64, sender []common.Address)) *EVM2EVMOffRampInterface_WatchSkippedSenderWithPreviousRampMessageInflight_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflight), args[2].([]uint64), args[3].([]common.Address)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_WatchSkippedSenderWithPreviousRampMessageInflight_Call) Return(_a0 event.Subscription, _a1 error) *EVM2EVMOffRampInterface_WatchSkippedSenderWithPreviousRampMessageInflight_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_WatchSkippedSenderWithPreviousRampMessageInflight_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflight, []uint64, []common.Address) (event.Subscription, error)) *EVM2EVMOffRampInterface_WatchSkippedSenderWithPreviousRampMessageInflight_Call { + _c.Call.Return(run) + return _c +} + +// WatchTransmitted provides a mock function with given fields: opts, sink +func (_m *EVM2EVMOffRampInterface) WatchTransmitted(opts *bind.WatchOpts, sink chan<- *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampTransmitted) (event.Subscription, error) { + ret := _m.Called(opts, sink) + + if len(ret) == 0 { + panic("no return value specified for WatchTransmitted") + } + + var r0 event.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampTransmitted) (event.Subscription, error)); ok { + return rf(opts, sink) + } + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampTransmitted) event.Subscription); ok { + r0 = rf(opts, sink) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(event.Subscription) + } + } + + if rf, ok := ret.Get(1).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampTransmitted) error); ok { + r1 = rf(opts, sink) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_WatchTransmitted_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchTransmitted' +type EVM2EVMOffRampInterface_WatchTransmitted_Call struct { + *mock.Call +} + +// WatchTransmitted is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampTransmitted +func (_e *EVM2EVMOffRampInterface_Expecter) WatchTransmitted(opts interface{}, sink interface{}) *EVM2EVMOffRampInterface_WatchTransmitted_Call { + return &EVM2EVMOffRampInterface_WatchTransmitted_Call{Call: _e.mock.On("WatchTransmitted", opts, sink)} +} + +func (_c *EVM2EVMOffRampInterface_WatchTransmitted_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampTransmitted)) *EVM2EVMOffRampInterface_WatchTransmitted_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampTransmitted)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_WatchTransmitted_Call) Return(_a0 event.Subscription, _a1 error) *EVM2EVMOffRampInterface_WatchTransmitted_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_WatchTransmitted_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *evm_2_evm_offramp_1_0_0.EVM2EVMOffRampTransmitted) (event.Subscription, error)) *EVM2EVMOffRampInterface_WatchTransmitted_Call { + _c.Call.Return(run) + return _c +} + +// NewEVM2EVMOffRampInterface creates a new instance of EVM2EVMOffRampInterface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewEVM2EVMOffRampInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *EVM2EVMOffRampInterface { + mock := &EVM2EVMOffRampInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/core/gethwrappers/ccip/mocks/v1_2_0/evm2_evm_off_ramp_interface.go b/core/gethwrappers/ccip/mocks/v1_2_0/evm2_evm_off_ramp_interface.go new file mode 100644 index 00000000000..840c6e6c5ed --- /dev/null +++ b/core/gethwrappers/ccip/mocks/v1_2_0/evm2_evm_off_ramp_interface.go @@ -0,0 +1,3603 @@ +// Code generated by mockery v2.43.2. DO NOT EDIT. + +package mock_contracts + +import ( + big "math/big" + + bind "github.com/ethereum/go-ethereum/accounts/abi/bind" + common "github.com/ethereum/go-ethereum/common" + + event "github.com/ethereum/go-ethereum/event" + + evm_2_evm_offramp_1_2_0 "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/evm_2_evm_offramp_1_2_0" + + generated "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" + + mock "github.com/stretchr/testify/mock" + + types "github.com/ethereum/go-ethereum/core/types" +) + +// EVM2EVMOffRampInterface is an autogenerated mock type for the EVM2EVMOffRampInterface type +type EVM2EVMOffRampInterface struct { + mock.Mock +} + +type EVM2EVMOffRampInterface_Expecter struct { + mock *mock.Mock +} + +func (_m *EVM2EVMOffRampInterface) EXPECT() *EVM2EVMOffRampInterface_Expecter { + return &EVM2EVMOffRampInterface_Expecter{mock: &_m.Mock} +} + +// AcceptOwnership provides a mock function with given fields: opts +func (_m *EVM2EVMOffRampInterface) AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for AcceptOwnership") + } + + var r0 *types.Transaction + var r1 error + if rf, ok := ret.Get(0).(func(*bind.TransactOpts) (*types.Transaction, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.TransactOpts) *types.Transaction); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Transaction) + } + } + + if rf, ok := ret.Get(1).(func(*bind.TransactOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_AcceptOwnership_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AcceptOwnership' +type EVM2EVMOffRampInterface_AcceptOwnership_Call struct { + *mock.Call +} + +// AcceptOwnership is a helper method to define mock.On call +// - opts *bind.TransactOpts +func (_e *EVM2EVMOffRampInterface_Expecter) AcceptOwnership(opts interface{}) *EVM2EVMOffRampInterface_AcceptOwnership_Call { + return &EVM2EVMOffRampInterface_AcceptOwnership_Call{Call: _e.mock.On("AcceptOwnership", opts)} +} + +func (_c *EVM2EVMOffRampInterface_AcceptOwnership_Call) Run(run func(opts *bind.TransactOpts)) *EVM2EVMOffRampInterface_AcceptOwnership_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_AcceptOwnership_Call) Return(_a0 *types.Transaction, _a1 error) *EVM2EVMOffRampInterface_AcceptOwnership_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_AcceptOwnership_Call) RunAndReturn(run func(*bind.TransactOpts) (*types.Transaction, error)) *EVM2EVMOffRampInterface_AcceptOwnership_Call { + _c.Call.Return(run) + return _c +} + +// Address provides a mock function with given fields: +func (_m *EVM2EVMOffRampInterface) Address() common.Address { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Address") + } + + var r0 common.Address + if rf, ok := ret.Get(0).(func() common.Address); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Address) + } + } + + return r0 +} + +// EVM2EVMOffRampInterface_Address_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Address' +type EVM2EVMOffRampInterface_Address_Call struct { + *mock.Call +} + +// Address is a helper method to define mock.On call +func (_e *EVM2EVMOffRampInterface_Expecter) Address() *EVM2EVMOffRampInterface_Address_Call { + return &EVM2EVMOffRampInterface_Address_Call{Call: _e.mock.On("Address")} +} + +func (_c *EVM2EVMOffRampInterface_Address_Call) Run(run func()) *EVM2EVMOffRampInterface_Address_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_Address_Call) Return(_a0 common.Address) *EVM2EVMOffRampInterface_Address_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *EVM2EVMOffRampInterface_Address_Call) RunAndReturn(run func() common.Address) *EVM2EVMOffRampInterface_Address_Call { + _c.Call.Return(run) + return _c +} + +// ApplyPoolUpdates provides a mock function with given fields: opts, removes, adds +func (_m *EVM2EVMOffRampInterface) ApplyPoolUpdates(opts *bind.TransactOpts, removes []evm_2_evm_offramp_1_2_0.InternalPoolUpdate, adds []evm_2_evm_offramp_1_2_0.InternalPoolUpdate) (*types.Transaction, error) { + ret := _m.Called(opts, removes, adds) + + if len(ret) == 0 { + panic("no return value specified for ApplyPoolUpdates") + } + + var r0 *types.Transaction + var r1 error + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, []evm_2_evm_offramp_1_2_0.InternalPoolUpdate, []evm_2_evm_offramp_1_2_0.InternalPoolUpdate) (*types.Transaction, error)); ok { + return rf(opts, removes, adds) + } + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, []evm_2_evm_offramp_1_2_0.InternalPoolUpdate, []evm_2_evm_offramp_1_2_0.InternalPoolUpdate) *types.Transaction); ok { + r0 = rf(opts, removes, adds) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Transaction) + } + } + + if rf, ok := ret.Get(1).(func(*bind.TransactOpts, []evm_2_evm_offramp_1_2_0.InternalPoolUpdate, []evm_2_evm_offramp_1_2_0.InternalPoolUpdate) error); ok { + r1 = rf(opts, removes, adds) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_ApplyPoolUpdates_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ApplyPoolUpdates' +type EVM2EVMOffRampInterface_ApplyPoolUpdates_Call struct { + *mock.Call +} + +// ApplyPoolUpdates is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - removes []evm_2_evm_offramp_1_2_0.InternalPoolUpdate +// - adds []evm_2_evm_offramp_1_2_0.InternalPoolUpdate +func (_e *EVM2EVMOffRampInterface_Expecter) ApplyPoolUpdates(opts interface{}, removes interface{}, adds interface{}) *EVM2EVMOffRampInterface_ApplyPoolUpdates_Call { + return &EVM2EVMOffRampInterface_ApplyPoolUpdates_Call{Call: _e.mock.On("ApplyPoolUpdates", opts, removes, adds)} +} + +func (_c *EVM2EVMOffRampInterface_ApplyPoolUpdates_Call) Run(run func(opts *bind.TransactOpts, removes []evm_2_evm_offramp_1_2_0.InternalPoolUpdate, adds []evm_2_evm_offramp_1_2_0.InternalPoolUpdate)) *EVM2EVMOffRampInterface_ApplyPoolUpdates_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].([]evm_2_evm_offramp_1_2_0.InternalPoolUpdate), args[2].([]evm_2_evm_offramp_1_2_0.InternalPoolUpdate)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_ApplyPoolUpdates_Call) Return(_a0 *types.Transaction, _a1 error) *EVM2EVMOffRampInterface_ApplyPoolUpdates_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_ApplyPoolUpdates_Call) RunAndReturn(run func(*bind.TransactOpts, []evm_2_evm_offramp_1_2_0.InternalPoolUpdate, []evm_2_evm_offramp_1_2_0.InternalPoolUpdate) (*types.Transaction, error)) *EVM2EVMOffRampInterface_ApplyPoolUpdates_Call { + _c.Call.Return(run) + return _c +} + +// CcipReceive provides a mock function with given fields: opts, arg0 +func (_m *EVM2EVMOffRampInterface) CcipReceive(opts *bind.CallOpts, arg0 evm_2_evm_offramp_1_2_0.ClientAny2EVMMessage) error { + ret := _m.Called(opts, arg0) + + if len(ret) == 0 { + panic("no return value specified for CcipReceive") + } + + var r0 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts, evm_2_evm_offramp_1_2_0.ClientAny2EVMMessage) error); ok { + r0 = rf(opts, arg0) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// EVM2EVMOffRampInterface_CcipReceive_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CcipReceive' +type EVM2EVMOffRampInterface_CcipReceive_Call struct { + *mock.Call +} + +// CcipReceive is a helper method to define mock.On call +// - opts *bind.CallOpts +// - arg0 evm_2_evm_offramp_1_2_0.ClientAny2EVMMessage +func (_e *EVM2EVMOffRampInterface_Expecter) CcipReceive(opts interface{}, arg0 interface{}) *EVM2EVMOffRampInterface_CcipReceive_Call { + return &EVM2EVMOffRampInterface_CcipReceive_Call{Call: _e.mock.On("CcipReceive", opts, arg0)} +} + +func (_c *EVM2EVMOffRampInterface_CcipReceive_Call) Run(run func(opts *bind.CallOpts, arg0 evm_2_evm_offramp_1_2_0.ClientAny2EVMMessage)) *EVM2EVMOffRampInterface_CcipReceive_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts), args[1].(evm_2_evm_offramp_1_2_0.ClientAny2EVMMessage)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_CcipReceive_Call) Return(_a0 error) *EVM2EVMOffRampInterface_CcipReceive_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *EVM2EVMOffRampInterface_CcipReceive_Call) RunAndReturn(run func(*bind.CallOpts, evm_2_evm_offramp_1_2_0.ClientAny2EVMMessage) error) *EVM2EVMOffRampInterface_CcipReceive_Call { + _c.Call.Return(run) + return _c +} + +// CurrentRateLimiterState provides a mock function with given fields: opts +func (_m *EVM2EVMOffRampInterface) CurrentRateLimiterState(opts *bind.CallOpts) (evm_2_evm_offramp_1_2_0.RateLimiterTokenBucket, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for CurrentRateLimiterState") + } + + var r0 evm_2_evm_offramp_1_2_0.RateLimiterTokenBucket + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts) (evm_2_evm_offramp_1_2_0.RateLimiterTokenBucket, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts) evm_2_evm_offramp_1_2_0.RateLimiterTokenBucket); ok { + r0 = rf(opts) + } else { + r0 = ret.Get(0).(evm_2_evm_offramp_1_2_0.RateLimiterTokenBucket) + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_CurrentRateLimiterState_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CurrentRateLimiterState' +type EVM2EVMOffRampInterface_CurrentRateLimiterState_Call struct { + *mock.Call +} + +// CurrentRateLimiterState is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *EVM2EVMOffRampInterface_Expecter) CurrentRateLimiterState(opts interface{}) *EVM2EVMOffRampInterface_CurrentRateLimiterState_Call { + return &EVM2EVMOffRampInterface_CurrentRateLimiterState_Call{Call: _e.mock.On("CurrentRateLimiterState", opts)} +} + +func (_c *EVM2EVMOffRampInterface_CurrentRateLimiterState_Call) Run(run func(opts *bind.CallOpts)) *EVM2EVMOffRampInterface_CurrentRateLimiterState_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_CurrentRateLimiterState_Call) Return(_a0 evm_2_evm_offramp_1_2_0.RateLimiterTokenBucket, _a1 error) *EVM2EVMOffRampInterface_CurrentRateLimiterState_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_CurrentRateLimiterState_Call) RunAndReturn(run func(*bind.CallOpts) (evm_2_evm_offramp_1_2_0.RateLimiterTokenBucket, error)) *EVM2EVMOffRampInterface_CurrentRateLimiterState_Call { + _c.Call.Return(run) + return _c +} + +// ExecuteSingleMessage provides a mock function with given fields: opts, message, offchainTokenData +func (_m *EVM2EVMOffRampInterface) ExecuteSingleMessage(opts *bind.TransactOpts, message evm_2_evm_offramp_1_2_0.InternalEVM2EVMMessage, offchainTokenData [][]byte) (*types.Transaction, error) { + ret := _m.Called(opts, message, offchainTokenData) + + if len(ret) == 0 { + panic("no return value specified for ExecuteSingleMessage") + } + + var r0 *types.Transaction + var r1 error + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, evm_2_evm_offramp_1_2_0.InternalEVM2EVMMessage, [][]byte) (*types.Transaction, error)); ok { + return rf(opts, message, offchainTokenData) + } + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, evm_2_evm_offramp_1_2_0.InternalEVM2EVMMessage, [][]byte) *types.Transaction); ok { + r0 = rf(opts, message, offchainTokenData) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Transaction) + } + } + + if rf, ok := ret.Get(1).(func(*bind.TransactOpts, evm_2_evm_offramp_1_2_0.InternalEVM2EVMMessage, [][]byte) error); ok { + r1 = rf(opts, message, offchainTokenData) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_ExecuteSingleMessage_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ExecuteSingleMessage' +type EVM2EVMOffRampInterface_ExecuteSingleMessage_Call struct { + *mock.Call +} + +// ExecuteSingleMessage is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - message evm_2_evm_offramp_1_2_0.InternalEVM2EVMMessage +// - offchainTokenData [][]byte +func (_e *EVM2EVMOffRampInterface_Expecter) ExecuteSingleMessage(opts interface{}, message interface{}, offchainTokenData interface{}) *EVM2EVMOffRampInterface_ExecuteSingleMessage_Call { + return &EVM2EVMOffRampInterface_ExecuteSingleMessage_Call{Call: _e.mock.On("ExecuteSingleMessage", opts, message, offchainTokenData)} +} + +func (_c *EVM2EVMOffRampInterface_ExecuteSingleMessage_Call) Run(run func(opts *bind.TransactOpts, message evm_2_evm_offramp_1_2_0.InternalEVM2EVMMessage, offchainTokenData [][]byte)) *EVM2EVMOffRampInterface_ExecuteSingleMessage_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].(evm_2_evm_offramp_1_2_0.InternalEVM2EVMMessage), args[2].([][]byte)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_ExecuteSingleMessage_Call) Return(_a0 *types.Transaction, _a1 error) *EVM2EVMOffRampInterface_ExecuteSingleMessage_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_ExecuteSingleMessage_Call) RunAndReturn(run func(*bind.TransactOpts, evm_2_evm_offramp_1_2_0.InternalEVM2EVMMessage, [][]byte) (*types.Transaction, error)) *EVM2EVMOffRampInterface_ExecuteSingleMessage_Call { + _c.Call.Return(run) + return _c +} + +// FilterAdminSet provides a mock function with given fields: opts +func (_m *EVM2EVMOffRampInterface) FilterAdminSet(opts *bind.FilterOpts) (*evm_2_evm_offramp_1_2_0.EVM2EVMOffRampAdminSetIterator, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for FilterAdminSet") + } + + var r0 *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampAdminSetIterator + var r1 error + if rf, ok := ret.Get(0).(func(*bind.FilterOpts) (*evm_2_evm_offramp_1_2_0.EVM2EVMOffRampAdminSetIterator, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.FilterOpts) *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampAdminSetIterator); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*evm_2_evm_offramp_1_2_0.EVM2EVMOffRampAdminSetIterator) + } + } + + if rf, ok := ret.Get(1).(func(*bind.FilterOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_FilterAdminSet_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterAdminSet' +type EVM2EVMOffRampInterface_FilterAdminSet_Call struct { + *mock.Call +} + +// FilterAdminSet is a helper method to define mock.On call +// - opts *bind.FilterOpts +func (_e *EVM2EVMOffRampInterface_Expecter) FilterAdminSet(opts interface{}) *EVM2EVMOffRampInterface_FilterAdminSet_Call { + return &EVM2EVMOffRampInterface_FilterAdminSet_Call{Call: _e.mock.On("FilterAdminSet", opts)} +} + +func (_c *EVM2EVMOffRampInterface_FilterAdminSet_Call) Run(run func(opts *bind.FilterOpts)) *EVM2EVMOffRampInterface_FilterAdminSet_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_FilterAdminSet_Call) Return(_a0 *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampAdminSetIterator, _a1 error) *EVM2EVMOffRampInterface_FilterAdminSet_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_FilterAdminSet_Call) RunAndReturn(run func(*bind.FilterOpts) (*evm_2_evm_offramp_1_2_0.EVM2EVMOffRampAdminSetIterator, error)) *EVM2EVMOffRampInterface_FilterAdminSet_Call { + _c.Call.Return(run) + return _c +} + +// FilterConfigSet provides a mock function with given fields: opts +func (_m *EVM2EVMOffRampInterface) FilterConfigSet(opts *bind.FilterOpts) (*evm_2_evm_offramp_1_2_0.EVM2EVMOffRampConfigSetIterator, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for FilterConfigSet") + } + + var r0 *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampConfigSetIterator + var r1 error + if rf, ok := ret.Get(0).(func(*bind.FilterOpts) (*evm_2_evm_offramp_1_2_0.EVM2EVMOffRampConfigSetIterator, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.FilterOpts) *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampConfigSetIterator); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*evm_2_evm_offramp_1_2_0.EVM2EVMOffRampConfigSetIterator) + } + } + + if rf, ok := ret.Get(1).(func(*bind.FilterOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_FilterConfigSet_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterConfigSet' +type EVM2EVMOffRampInterface_FilterConfigSet_Call struct { + *mock.Call +} + +// FilterConfigSet is a helper method to define mock.On call +// - opts *bind.FilterOpts +func (_e *EVM2EVMOffRampInterface_Expecter) FilterConfigSet(opts interface{}) *EVM2EVMOffRampInterface_FilterConfigSet_Call { + return &EVM2EVMOffRampInterface_FilterConfigSet_Call{Call: _e.mock.On("FilterConfigSet", opts)} +} + +func (_c *EVM2EVMOffRampInterface_FilterConfigSet_Call) Run(run func(opts *bind.FilterOpts)) *EVM2EVMOffRampInterface_FilterConfigSet_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_FilterConfigSet_Call) Return(_a0 *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampConfigSetIterator, _a1 error) *EVM2EVMOffRampInterface_FilterConfigSet_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_FilterConfigSet_Call) RunAndReturn(run func(*bind.FilterOpts) (*evm_2_evm_offramp_1_2_0.EVM2EVMOffRampConfigSetIterator, error)) *EVM2EVMOffRampInterface_FilterConfigSet_Call { + _c.Call.Return(run) + return _c +} + +// FilterConfigSet0 provides a mock function with given fields: opts +func (_m *EVM2EVMOffRampInterface) FilterConfigSet0(opts *bind.FilterOpts) (*evm_2_evm_offramp_1_2_0.EVM2EVMOffRampConfigSet0Iterator, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for FilterConfigSet0") + } + + var r0 *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampConfigSet0Iterator + var r1 error + if rf, ok := ret.Get(0).(func(*bind.FilterOpts) (*evm_2_evm_offramp_1_2_0.EVM2EVMOffRampConfigSet0Iterator, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.FilterOpts) *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampConfigSet0Iterator); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*evm_2_evm_offramp_1_2_0.EVM2EVMOffRampConfigSet0Iterator) + } + } + + if rf, ok := ret.Get(1).(func(*bind.FilterOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_FilterConfigSet0_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterConfigSet0' +type EVM2EVMOffRampInterface_FilterConfigSet0_Call struct { + *mock.Call +} + +// FilterConfigSet0 is a helper method to define mock.On call +// - opts *bind.FilterOpts +func (_e *EVM2EVMOffRampInterface_Expecter) FilterConfigSet0(opts interface{}) *EVM2EVMOffRampInterface_FilterConfigSet0_Call { + return &EVM2EVMOffRampInterface_FilterConfigSet0_Call{Call: _e.mock.On("FilterConfigSet0", opts)} +} + +func (_c *EVM2EVMOffRampInterface_FilterConfigSet0_Call) Run(run func(opts *bind.FilterOpts)) *EVM2EVMOffRampInterface_FilterConfigSet0_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_FilterConfigSet0_Call) Return(_a0 *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampConfigSet0Iterator, _a1 error) *EVM2EVMOffRampInterface_FilterConfigSet0_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_FilterConfigSet0_Call) RunAndReturn(run func(*bind.FilterOpts) (*evm_2_evm_offramp_1_2_0.EVM2EVMOffRampConfigSet0Iterator, error)) *EVM2EVMOffRampInterface_FilterConfigSet0_Call { + _c.Call.Return(run) + return _c +} + +// FilterExecutionStateChanged provides a mock function with given fields: opts, sequenceNumber, messageId +func (_m *EVM2EVMOffRampInterface) FilterExecutionStateChanged(opts *bind.FilterOpts, sequenceNumber []uint64, messageId [][32]byte) (*evm_2_evm_offramp_1_2_0.EVM2EVMOffRampExecutionStateChangedIterator, error) { + ret := _m.Called(opts, sequenceNumber, messageId) + + if len(ret) == 0 { + panic("no return value specified for FilterExecutionStateChanged") + } + + var r0 *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampExecutionStateChangedIterator + var r1 error + if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []uint64, [][32]byte) (*evm_2_evm_offramp_1_2_0.EVM2EVMOffRampExecutionStateChangedIterator, error)); ok { + return rf(opts, sequenceNumber, messageId) + } + if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []uint64, [][32]byte) *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampExecutionStateChangedIterator); ok { + r0 = rf(opts, sequenceNumber, messageId) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*evm_2_evm_offramp_1_2_0.EVM2EVMOffRampExecutionStateChangedIterator) + } + } + + if rf, ok := ret.Get(1).(func(*bind.FilterOpts, []uint64, [][32]byte) error); ok { + r1 = rf(opts, sequenceNumber, messageId) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_FilterExecutionStateChanged_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterExecutionStateChanged' +type EVM2EVMOffRampInterface_FilterExecutionStateChanged_Call struct { + *mock.Call +} + +// FilterExecutionStateChanged is a helper method to define mock.On call +// - opts *bind.FilterOpts +// - sequenceNumber []uint64 +// - messageId [][32]byte +func (_e *EVM2EVMOffRampInterface_Expecter) FilterExecutionStateChanged(opts interface{}, sequenceNumber interface{}, messageId interface{}) *EVM2EVMOffRampInterface_FilterExecutionStateChanged_Call { + return &EVM2EVMOffRampInterface_FilterExecutionStateChanged_Call{Call: _e.mock.On("FilterExecutionStateChanged", opts, sequenceNumber, messageId)} +} + +func (_c *EVM2EVMOffRampInterface_FilterExecutionStateChanged_Call) Run(run func(opts *bind.FilterOpts, sequenceNumber []uint64, messageId [][32]byte)) *EVM2EVMOffRampInterface_FilterExecutionStateChanged_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts), args[1].([]uint64), args[2].([][32]byte)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_FilterExecutionStateChanged_Call) Return(_a0 *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampExecutionStateChangedIterator, _a1 error) *EVM2EVMOffRampInterface_FilterExecutionStateChanged_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_FilterExecutionStateChanged_Call) RunAndReturn(run func(*bind.FilterOpts, []uint64, [][32]byte) (*evm_2_evm_offramp_1_2_0.EVM2EVMOffRampExecutionStateChangedIterator, error)) *EVM2EVMOffRampInterface_FilterExecutionStateChanged_Call { + _c.Call.Return(run) + return _c +} + +// FilterOwnershipTransferRequested provides a mock function with given fields: opts, from, to +func (_m *EVM2EVMOffRampInterface) FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*evm_2_evm_offramp_1_2_0.EVM2EVMOffRampOwnershipTransferRequestedIterator, error) { + ret := _m.Called(opts, from, to) + + if len(ret) == 0 { + panic("no return value specified for FilterOwnershipTransferRequested") + } + + var r0 *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampOwnershipTransferRequestedIterator + var r1 error + if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []common.Address, []common.Address) (*evm_2_evm_offramp_1_2_0.EVM2EVMOffRampOwnershipTransferRequestedIterator, error)); ok { + return rf(opts, from, to) + } + if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []common.Address, []common.Address) *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampOwnershipTransferRequestedIterator); ok { + r0 = rf(opts, from, to) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*evm_2_evm_offramp_1_2_0.EVM2EVMOffRampOwnershipTransferRequestedIterator) + } + } + + if rf, ok := ret.Get(1).(func(*bind.FilterOpts, []common.Address, []common.Address) error); ok { + r1 = rf(opts, from, to) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_FilterOwnershipTransferRequested_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterOwnershipTransferRequested' +type EVM2EVMOffRampInterface_FilterOwnershipTransferRequested_Call struct { + *mock.Call +} + +// FilterOwnershipTransferRequested is a helper method to define mock.On call +// - opts *bind.FilterOpts +// - from []common.Address +// - to []common.Address +func (_e *EVM2EVMOffRampInterface_Expecter) FilterOwnershipTransferRequested(opts interface{}, from interface{}, to interface{}) *EVM2EVMOffRampInterface_FilterOwnershipTransferRequested_Call { + return &EVM2EVMOffRampInterface_FilterOwnershipTransferRequested_Call{Call: _e.mock.On("FilterOwnershipTransferRequested", opts, from, to)} +} + +func (_c *EVM2EVMOffRampInterface_FilterOwnershipTransferRequested_Call) Run(run func(opts *bind.FilterOpts, from []common.Address, to []common.Address)) *EVM2EVMOffRampInterface_FilterOwnershipTransferRequested_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts), args[1].([]common.Address), args[2].([]common.Address)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_FilterOwnershipTransferRequested_Call) Return(_a0 *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampOwnershipTransferRequestedIterator, _a1 error) *EVM2EVMOffRampInterface_FilterOwnershipTransferRequested_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_FilterOwnershipTransferRequested_Call) RunAndReturn(run func(*bind.FilterOpts, []common.Address, []common.Address) (*evm_2_evm_offramp_1_2_0.EVM2EVMOffRampOwnershipTransferRequestedIterator, error)) *EVM2EVMOffRampInterface_FilterOwnershipTransferRequested_Call { + _c.Call.Return(run) + return _c +} + +// FilterOwnershipTransferred provides a mock function with given fields: opts, from, to +func (_m *EVM2EVMOffRampInterface) FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*evm_2_evm_offramp_1_2_0.EVM2EVMOffRampOwnershipTransferredIterator, error) { + ret := _m.Called(opts, from, to) + + if len(ret) == 0 { + panic("no return value specified for FilterOwnershipTransferred") + } + + var r0 *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampOwnershipTransferredIterator + var r1 error + if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []common.Address, []common.Address) (*evm_2_evm_offramp_1_2_0.EVM2EVMOffRampOwnershipTransferredIterator, error)); ok { + return rf(opts, from, to) + } + if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []common.Address, []common.Address) *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampOwnershipTransferredIterator); ok { + r0 = rf(opts, from, to) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*evm_2_evm_offramp_1_2_0.EVM2EVMOffRampOwnershipTransferredIterator) + } + } + + if rf, ok := ret.Get(1).(func(*bind.FilterOpts, []common.Address, []common.Address) error); ok { + r1 = rf(opts, from, to) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_FilterOwnershipTransferred_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterOwnershipTransferred' +type EVM2EVMOffRampInterface_FilterOwnershipTransferred_Call struct { + *mock.Call +} + +// FilterOwnershipTransferred is a helper method to define mock.On call +// - opts *bind.FilterOpts +// - from []common.Address +// - to []common.Address +func (_e *EVM2EVMOffRampInterface_Expecter) FilterOwnershipTransferred(opts interface{}, from interface{}, to interface{}) *EVM2EVMOffRampInterface_FilterOwnershipTransferred_Call { + return &EVM2EVMOffRampInterface_FilterOwnershipTransferred_Call{Call: _e.mock.On("FilterOwnershipTransferred", opts, from, to)} +} + +func (_c *EVM2EVMOffRampInterface_FilterOwnershipTransferred_Call) Run(run func(opts *bind.FilterOpts, from []common.Address, to []common.Address)) *EVM2EVMOffRampInterface_FilterOwnershipTransferred_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts), args[1].([]common.Address), args[2].([]common.Address)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_FilterOwnershipTransferred_Call) Return(_a0 *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampOwnershipTransferredIterator, _a1 error) *EVM2EVMOffRampInterface_FilterOwnershipTransferred_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_FilterOwnershipTransferred_Call) RunAndReturn(run func(*bind.FilterOpts, []common.Address, []common.Address) (*evm_2_evm_offramp_1_2_0.EVM2EVMOffRampOwnershipTransferredIterator, error)) *EVM2EVMOffRampInterface_FilterOwnershipTransferred_Call { + _c.Call.Return(run) + return _c +} + +// FilterPoolAdded provides a mock function with given fields: opts +func (_m *EVM2EVMOffRampInterface) FilterPoolAdded(opts *bind.FilterOpts) (*evm_2_evm_offramp_1_2_0.EVM2EVMOffRampPoolAddedIterator, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for FilterPoolAdded") + } + + var r0 *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampPoolAddedIterator + var r1 error + if rf, ok := ret.Get(0).(func(*bind.FilterOpts) (*evm_2_evm_offramp_1_2_0.EVM2EVMOffRampPoolAddedIterator, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.FilterOpts) *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampPoolAddedIterator); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*evm_2_evm_offramp_1_2_0.EVM2EVMOffRampPoolAddedIterator) + } + } + + if rf, ok := ret.Get(1).(func(*bind.FilterOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_FilterPoolAdded_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterPoolAdded' +type EVM2EVMOffRampInterface_FilterPoolAdded_Call struct { + *mock.Call +} + +// FilterPoolAdded is a helper method to define mock.On call +// - opts *bind.FilterOpts +func (_e *EVM2EVMOffRampInterface_Expecter) FilterPoolAdded(opts interface{}) *EVM2EVMOffRampInterface_FilterPoolAdded_Call { + return &EVM2EVMOffRampInterface_FilterPoolAdded_Call{Call: _e.mock.On("FilterPoolAdded", opts)} +} + +func (_c *EVM2EVMOffRampInterface_FilterPoolAdded_Call) Run(run func(opts *bind.FilterOpts)) *EVM2EVMOffRampInterface_FilterPoolAdded_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_FilterPoolAdded_Call) Return(_a0 *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampPoolAddedIterator, _a1 error) *EVM2EVMOffRampInterface_FilterPoolAdded_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_FilterPoolAdded_Call) RunAndReturn(run func(*bind.FilterOpts) (*evm_2_evm_offramp_1_2_0.EVM2EVMOffRampPoolAddedIterator, error)) *EVM2EVMOffRampInterface_FilterPoolAdded_Call { + _c.Call.Return(run) + return _c +} + +// FilterPoolRemoved provides a mock function with given fields: opts +func (_m *EVM2EVMOffRampInterface) FilterPoolRemoved(opts *bind.FilterOpts) (*evm_2_evm_offramp_1_2_0.EVM2EVMOffRampPoolRemovedIterator, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for FilterPoolRemoved") + } + + var r0 *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampPoolRemovedIterator + var r1 error + if rf, ok := ret.Get(0).(func(*bind.FilterOpts) (*evm_2_evm_offramp_1_2_0.EVM2EVMOffRampPoolRemovedIterator, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.FilterOpts) *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampPoolRemovedIterator); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*evm_2_evm_offramp_1_2_0.EVM2EVMOffRampPoolRemovedIterator) + } + } + + if rf, ok := ret.Get(1).(func(*bind.FilterOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_FilterPoolRemoved_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterPoolRemoved' +type EVM2EVMOffRampInterface_FilterPoolRemoved_Call struct { + *mock.Call +} + +// FilterPoolRemoved is a helper method to define mock.On call +// - opts *bind.FilterOpts +func (_e *EVM2EVMOffRampInterface_Expecter) FilterPoolRemoved(opts interface{}) *EVM2EVMOffRampInterface_FilterPoolRemoved_Call { + return &EVM2EVMOffRampInterface_FilterPoolRemoved_Call{Call: _e.mock.On("FilterPoolRemoved", opts)} +} + +func (_c *EVM2EVMOffRampInterface_FilterPoolRemoved_Call) Run(run func(opts *bind.FilterOpts)) *EVM2EVMOffRampInterface_FilterPoolRemoved_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_FilterPoolRemoved_Call) Return(_a0 *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampPoolRemovedIterator, _a1 error) *EVM2EVMOffRampInterface_FilterPoolRemoved_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_FilterPoolRemoved_Call) RunAndReturn(run func(*bind.FilterOpts) (*evm_2_evm_offramp_1_2_0.EVM2EVMOffRampPoolRemovedIterator, error)) *EVM2EVMOffRampInterface_FilterPoolRemoved_Call { + _c.Call.Return(run) + return _c +} + +// FilterSkippedIncorrectNonce provides a mock function with given fields: opts, nonce, sender +func (_m *EVM2EVMOffRampInterface) FilterSkippedIncorrectNonce(opts *bind.FilterOpts, nonce []uint64, sender []common.Address) (*evm_2_evm_offramp_1_2_0.EVM2EVMOffRampSkippedIncorrectNonceIterator, error) { + ret := _m.Called(opts, nonce, sender) + + if len(ret) == 0 { + panic("no return value specified for FilterSkippedIncorrectNonce") + } + + var r0 *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampSkippedIncorrectNonceIterator + var r1 error + if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []uint64, []common.Address) (*evm_2_evm_offramp_1_2_0.EVM2EVMOffRampSkippedIncorrectNonceIterator, error)); ok { + return rf(opts, nonce, sender) + } + if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []uint64, []common.Address) *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampSkippedIncorrectNonceIterator); ok { + r0 = rf(opts, nonce, sender) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*evm_2_evm_offramp_1_2_0.EVM2EVMOffRampSkippedIncorrectNonceIterator) + } + } + + if rf, ok := ret.Get(1).(func(*bind.FilterOpts, []uint64, []common.Address) error); ok { + r1 = rf(opts, nonce, sender) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_FilterSkippedIncorrectNonce_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterSkippedIncorrectNonce' +type EVM2EVMOffRampInterface_FilterSkippedIncorrectNonce_Call struct { + *mock.Call +} + +// FilterSkippedIncorrectNonce is a helper method to define mock.On call +// - opts *bind.FilterOpts +// - nonce []uint64 +// - sender []common.Address +func (_e *EVM2EVMOffRampInterface_Expecter) FilterSkippedIncorrectNonce(opts interface{}, nonce interface{}, sender interface{}) *EVM2EVMOffRampInterface_FilterSkippedIncorrectNonce_Call { + return &EVM2EVMOffRampInterface_FilterSkippedIncorrectNonce_Call{Call: _e.mock.On("FilterSkippedIncorrectNonce", opts, nonce, sender)} +} + +func (_c *EVM2EVMOffRampInterface_FilterSkippedIncorrectNonce_Call) Run(run func(opts *bind.FilterOpts, nonce []uint64, sender []common.Address)) *EVM2EVMOffRampInterface_FilterSkippedIncorrectNonce_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts), args[1].([]uint64), args[2].([]common.Address)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_FilterSkippedIncorrectNonce_Call) Return(_a0 *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampSkippedIncorrectNonceIterator, _a1 error) *EVM2EVMOffRampInterface_FilterSkippedIncorrectNonce_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_FilterSkippedIncorrectNonce_Call) RunAndReturn(run func(*bind.FilterOpts, []uint64, []common.Address) (*evm_2_evm_offramp_1_2_0.EVM2EVMOffRampSkippedIncorrectNonceIterator, error)) *EVM2EVMOffRampInterface_FilterSkippedIncorrectNonce_Call { + _c.Call.Return(run) + return _c +} + +// FilterSkippedSenderWithPreviousRampMessageInflight provides a mock function with given fields: opts, nonce, sender +func (_m *EVM2EVMOffRampInterface) FilterSkippedSenderWithPreviousRampMessageInflight(opts *bind.FilterOpts, nonce []uint64, sender []common.Address) (*evm_2_evm_offramp_1_2_0.EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflightIterator, error) { + ret := _m.Called(opts, nonce, sender) + + if len(ret) == 0 { + panic("no return value specified for FilterSkippedSenderWithPreviousRampMessageInflight") + } + + var r0 *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflightIterator + var r1 error + if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []uint64, []common.Address) (*evm_2_evm_offramp_1_2_0.EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflightIterator, error)); ok { + return rf(opts, nonce, sender) + } + if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []uint64, []common.Address) *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflightIterator); ok { + r0 = rf(opts, nonce, sender) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*evm_2_evm_offramp_1_2_0.EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflightIterator) + } + } + + if rf, ok := ret.Get(1).(func(*bind.FilterOpts, []uint64, []common.Address) error); ok { + r1 = rf(opts, nonce, sender) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_FilterSkippedSenderWithPreviousRampMessageInflight_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterSkippedSenderWithPreviousRampMessageInflight' +type EVM2EVMOffRampInterface_FilterSkippedSenderWithPreviousRampMessageInflight_Call struct { + *mock.Call +} + +// FilterSkippedSenderWithPreviousRampMessageInflight is a helper method to define mock.On call +// - opts *bind.FilterOpts +// - nonce []uint64 +// - sender []common.Address +func (_e *EVM2EVMOffRampInterface_Expecter) FilterSkippedSenderWithPreviousRampMessageInflight(opts interface{}, nonce interface{}, sender interface{}) *EVM2EVMOffRampInterface_FilterSkippedSenderWithPreviousRampMessageInflight_Call { + return &EVM2EVMOffRampInterface_FilterSkippedSenderWithPreviousRampMessageInflight_Call{Call: _e.mock.On("FilterSkippedSenderWithPreviousRampMessageInflight", opts, nonce, sender)} +} + +func (_c *EVM2EVMOffRampInterface_FilterSkippedSenderWithPreviousRampMessageInflight_Call) Run(run func(opts *bind.FilterOpts, nonce []uint64, sender []common.Address)) *EVM2EVMOffRampInterface_FilterSkippedSenderWithPreviousRampMessageInflight_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts), args[1].([]uint64), args[2].([]common.Address)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_FilterSkippedSenderWithPreviousRampMessageInflight_Call) Return(_a0 *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflightIterator, _a1 error) *EVM2EVMOffRampInterface_FilterSkippedSenderWithPreviousRampMessageInflight_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_FilterSkippedSenderWithPreviousRampMessageInflight_Call) RunAndReturn(run func(*bind.FilterOpts, []uint64, []common.Address) (*evm_2_evm_offramp_1_2_0.EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflightIterator, error)) *EVM2EVMOffRampInterface_FilterSkippedSenderWithPreviousRampMessageInflight_Call { + _c.Call.Return(run) + return _c +} + +// FilterTransmitted provides a mock function with given fields: opts +func (_m *EVM2EVMOffRampInterface) FilterTransmitted(opts *bind.FilterOpts) (*evm_2_evm_offramp_1_2_0.EVM2EVMOffRampTransmittedIterator, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for FilterTransmitted") + } + + var r0 *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampTransmittedIterator + var r1 error + if rf, ok := ret.Get(0).(func(*bind.FilterOpts) (*evm_2_evm_offramp_1_2_0.EVM2EVMOffRampTransmittedIterator, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.FilterOpts) *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampTransmittedIterator); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*evm_2_evm_offramp_1_2_0.EVM2EVMOffRampTransmittedIterator) + } + } + + if rf, ok := ret.Get(1).(func(*bind.FilterOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_FilterTransmitted_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterTransmitted' +type EVM2EVMOffRampInterface_FilterTransmitted_Call struct { + *mock.Call +} + +// FilterTransmitted is a helper method to define mock.On call +// - opts *bind.FilterOpts +func (_e *EVM2EVMOffRampInterface_Expecter) FilterTransmitted(opts interface{}) *EVM2EVMOffRampInterface_FilterTransmitted_Call { + return &EVM2EVMOffRampInterface_FilterTransmitted_Call{Call: _e.mock.On("FilterTransmitted", opts)} +} + +func (_c *EVM2EVMOffRampInterface_FilterTransmitted_Call) Run(run func(opts *bind.FilterOpts)) *EVM2EVMOffRampInterface_FilterTransmitted_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_FilterTransmitted_Call) Return(_a0 *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampTransmittedIterator, _a1 error) *EVM2EVMOffRampInterface_FilterTransmitted_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_FilterTransmitted_Call) RunAndReturn(run func(*bind.FilterOpts) (*evm_2_evm_offramp_1_2_0.EVM2EVMOffRampTransmittedIterator, error)) *EVM2EVMOffRampInterface_FilterTransmitted_Call { + _c.Call.Return(run) + return _c +} + +// GetDestinationToken provides a mock function with given fields: opts, sourceToken +func (_m *EVM2EVMOffRampInterface) GetDestinationToken(opts *bind.CallOpts, sourceToken common.Address) (common.Address, error) { + ret := _m.Called(opts, sourceToken) + + if len(ret) == 0 { + panic("no return value specified for GetDestinationToken") + } + + var r0 common.Address + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts, common.Address) (common.Address, error)); ok { + return rf(opts, sourceToken) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts, common.Address) common.Address); ok { + r0 = rf(opts, sourceToken) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Address) + } + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts, common.Address) error); ok { + r1 = rf(opts, sourceToken) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_GetDestinationToken_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetDestinationToken' +type EVM2EVMOffRampInterface_GetDestinationToken_Call struct { + *mock.Call +} + +// GetDestinationToken is a helper method to define mock.On call +// - opts *bind.CallOpts +// - sourceToken common.Address +func (_e *EVM2EVMOffRampInterface_Expecter) GetDestinationToken(opts interface{}, sourceToken interface{}) *EVM2EVMOffRampInterface_GetDestinationToken_Call { + return &EVM2EVMOffRampInterface_GetDestinationToken_Call{Call: _e.mock.On("GetDestinationToken", opts, sourceToken)} +} + +func (_c *EVM2EVMOffRampInterface_GetDestinationToken_Call) Run(run func(opts *bind.CallOpts, sourceToken common.Address)) *EVM2EVMOffRampInterface_GetDestinationToken_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts), args[1].(common.Address)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_GetDestinationToken_Call) Return(_a0 common.Address, _a1 error) *EVM2EVMOffRampInterface_GetDestinationToken_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_GetDestinationToken_Call) RunAndReturn(run func(*bind.CallOpts, common.Address) (common.Address, error)) *EVM2EVMOffRampInterface_GetDestinationToken_Call { + _c.Call.Return(run) + return _c +} + +// GetDestinationTokens provides a mock function with given fields: opts +func (_m *EVM2EVMOffRampInterface) GetDestinationTokens(opts *bind.CallOpts) ([]common.Address, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for GetDestinationTokens") + } + + var r0 []common.Address + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts) ([]common.Address, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts) []common.Address); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]common.Address) + } + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_GetDestinationTokens_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetDestinationTokens' +type EVM2EVMOffRampInterface_GetDestinationTokens_Call struct { + *mock.Call +} + +// GetDestinationTokens is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *EVM2EVMOffRampInterface_Expecter) GetDestinationTokens(opts interface{}) *EVM2EVMOffRampInterface_GetDestinationTokens_Call { + return &EVM2EVMOffRampInterface_GetDestinationTokens_Call{Call: _e.mock.On("GetDestinationTokens", opts)} +} + +func (_c *EVM2EVMOffRampInterface_GetDestinationTokens_Call) Run(run func(opts *bind.CallOpts)) *EVM2EVMOffRampInterface_GetDestinationTokens_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_GetDestinationTokens_Call) Return(_a0 []common.Address, _a1 error) *EVM2EVMOffRampInterface_GetDestinationTokens_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_GetDestinationTokens_Call) RunAndReturn(run func(*bind.CallOpts) ([]common.Address, error)) *EVM2EVMOffRampInterface_GetDestinationTokens_Call { + _c.Call.Return(run) + return _c +} + +// GetDynamicConfig provides a mock function with given fields: opts +func (_m *EVM2EVMOffRampInterface) GetDynamicConfig(opts *bind.CallOpts) (evm_2_evm_offramp_1_2_0.EVM2EVMOffRampDynamicConfig, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for GetDynamicConfig") + } + + var r0 evm_2_evm_offramp_1_2_0.EVM2EVMOffRampDynamicConfig + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts) (evm_2_evm_offramp_1_2_0.EVM2EVMOffRampDynamicConfig, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts) evm_2_evm_offramp_1_2_0.EVM2EVMOffRampDynamicConfig); ok { + r0 = rf(opts) + } else { + r0 = ret.Get(0).(evm_2_evm_offramp_1_2_0.EVM2EVMOffRampDynamicConfig) + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_GetDynamicConfig_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetDynamicConfig' +type EVM2EVMOffRampInterface_GetDynamicConfig_Call struct { + *mock.Call +} + +// GetDynamicConfig is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *EVM2EVMOffRampInterface_Expecter) GetDynamicConfig(opts interface{}) *EVM2EVMOffRampInterface_GetDynamicConfig_Call { + return &EVM2EVMOffRampInterface_GetDynamicConfig_Call{Call: _e.mock.On("GetDynamicConfig", opts)} +} + +func (_c *EVM2EVMOffRampInterface_GetDynamicConfig_Call) Run(run func(opts *bind.CallOpts)) *EVM2EVMOffRampInterface_GetDynamicConfig_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_GetDynamicConfig_Call) Return(_a0 evm_2_evm_offramp_1_2_0.EVM2EVMOffRampDynamicConfig, _a1 error) *EVM2EVMOffRampInterface_GetDynamicConfig_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_GetDynamicConfig_Call) RunAndReturn(run func(*bind.CallOpts) (evm_2_evm_offramp_1_2_0.EVM2EVMOffRampDynamicConfig, error)) *EVM2EVMOffRampInterface_GetDynamicConfig_Call { + _c.Call.Return(run) + return _c +} + +// GetExecutionState provides a mock function with given fields: opts, sequenceNumber +func (_m *EVM2EVMOffRampInterface) GetExecutionState(opts *bind.CallOpts, sequenceNumber uint64) (uint8, error) { + ret := _m.Called(opts, sequenceNumber) + + if len(ret) == 0 { + panic("no return value specified for GetExecutionState") + } + + var r0 uint8 + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts, uint64) (uint8, error)); ok { + return rf(opts, sequenceNumber) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts, uint64) uint8); ok { + r0 = rf(opts, sequenceNumber) + } else { + r0 = ret.Get(0).(uint8) + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts, uint64) error); ok { + r1 = rf(opts, sequenceNumber) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_GetExecutionState_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetExecutionState' +type EVM2EVMOffRampInterface_GetExecutionState_Call struct { + *mock.Call +} + +// GetExecutionState is a helper method to define mock.On call +// - opts *bind.CallOpts +// - sequenceNumber uint64 +func (_e *EVM2EVMOffRampInterface_Expecter) GetExecutionState(opts interface{}, sequenceNumber interface{}) *EVM2EVMOffRampInterface_GetExecutionState_Call { + return &EVM2EVMOffRampInterface_GetExecutionState_Call{Call: _e.mock.On("GetExecutionState", opts, sequenceNumber)} +} + +func (_c *EVM2EVMOffRampInterface_GetExecutionState_Call) Run(run func(opts *bind.CallOpts, sequenceNumber uint64)) *EVM2EVMOffRampInterface_GetExecutionState_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts), args[1].(uint64)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_GetExecutionState_Call) Return(_a0 uint8, _a1 error) *EVM2EVMOffRampInterface_GetExecutionState_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_GetExecutionState_Call) RunAndReturn(run func(*bind.CallOpts, uint64) (uint8, error)) *EVM2EVMOffRampInterface_GetExecutionState_Call { + _c.Call.Return(run) + return _c +} + +// GetPoolByDestToken provides a mock function with given fields: opts, destToken +func (_m *EVM2EVMOffRampInterface) GetPoolByDestToken(opts *bind.CallOpts, destToken common.Address) (common.Address, error) { + ret := _m.Called(opts, destToken) + + if len(ret) == 0 { + panic("no return value specified for GetPoolByDestToken") + } + + var r0 common.Address + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts, common.Address) (common.Address, error)); ok { + return rf(opts, destToken) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts, common.Address) common.Address); ok { + r0 = rf(opts, destToken) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Address) + } + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts, common.Address) error); ok { + r1 = rf(opts, destToken) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_GetPoolByDestToken_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPoolByDestToken' +type EVM2EVMOffRampInterface_GetPoolByDestToken_Call struct { + *mock.Call +} + +// GetPoolByDestToken is a helper method to define mock.On call +// - opts *bind.CallOpts +// - destToken common.Address +func (_e *EVM2EVMOffRampInterface_Expecter) GetPoolByDestToken(opts interface{}, destToken interface{}) *EVM2EVMOffRampInterface_GetPoolByDestToken_Call { + return &EVM2EVMOffRampInterface_GetPoolByDestToken_Call{Call: _e.mock.On("GetPoolByDestToken", opts, destToken)} +} + +func (_c *EVM2EVMOffRampInterface_GetPoolByDestToken_Call) Run(run func(opts *bind.CallOpts, destToken common.Address)) *EVM2EVMOffRampInterface_GetPoolByDestToken_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts), args[1].(common.Address)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_GetPoolByDestToken_Call) Return(_a0 common.Address, _a1 error) *EVM2EVMOffRampInterface_GetPoolByDestToken_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_GetPoolByDestToken_Call) RunAndReturn(run func(*bind.CallOpts, common.Address) (common.Address, error)) *EVM2EVMOffRampInterface_GetPoolByDestToken_Call { + _c.Call.Return(run) + return _c +} + +// GetPoolBySourceToken provides a mock function with given fields: opts, sourceToken +func (_m *EVM2EVMOffRampInterface) GetPoolBySourceToken(opts *bind.CallOpts, sourceToken common.Address) (common.Address, error) { + ret := _m.Called(opts, sourceToken) + + if len(ret) == 0 { + panic("no return value specified for GetPoolBySourceToken") + } + + var r0 common.Address + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts, common.Address) (common.Address, error)); ok { + return rf(opts, sourceToken) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts, common.Address) common.Address); ok { + r0 = rf(opts, sourceToken) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Address) + } + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts, common.Address) error); ok { + r1 = rf(opts, sourceToken) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_GetPoolBySourceToken_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPoolBySourceToken' +type EVM2EVMOffRampInterface_GetPoolBySourceToken_Call struct { + *mock.Call +} + +// GetPoolBySourceToken is a helper method to define mock.On call +// - opts *bind.CallOpts +// - sourceToken common.Address +func (_e *EVM2EVMOffRampInterface_Expecter) GetPoolBySourceToken(opts interface{}, sourceToken interface{}) *EVM2EVMOffRampInterface_GetPoolBySourceToken_Call { + return &EVM2EVMOffRampInterface_GetPoolBySourceToken_Call{Call: _e.mock.On("GetPoolBySourceToken", opts, sourceToken)} +} + +func (_c *EVM2EVMOffRampInterface_GetPoolBySourceToken_Call) Run(run func(opts *bind.CallOpts, sourceToken common.Address)) *EVM2EVMOffRampInterface_GetPoolBySourceToken_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts), args[1].(common.Address)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_GetPoolBySourceToken_Call) Return(_a0 common.Address, _a1 error) *EVM2EVMOffRampInterface_GetPoolBySourceToken_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_GetPoolBySourceToken_Call) RunAndReturn(run func(*bind.CallOpts, common.Address) (common.Address, error)) *EVM2EVMOffRampInterface_GetPoolBySourceToken_Call { + _c.Call.Return(run) + return _c +} + +// GetSenderNonce provides a mock function with given fields: opts, sender +func (_m *EVM2EVMOffRampInterface) GetSenderNonce(opts *bind.CallOpts, sender common.Address) (uint64, error) { + ret := _m.Called(opts, sender) + + if len(ret) == 0 { + panic("no return value specified for GetSenderNonce") + } + + var r0 uint64 + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts, common.Address) (uint64, error)); ok { + return rf(opts, sender) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts, common.Address) uint64); ok { + r0 = rf(opts, sender) + } else { + r0 = ret.Get(0).(uint64) + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts, common.Address) error); ok { + r1 = rf(opts, sender) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_GetSenderNonce_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSenderNonce' +type EVM2EVMOffRampInterface_GetSenderNonce_Call struct { + *mock.Call +} + +// GetSenderNonce is a helper method to define mock.On call +// - opts *bind.CallOpts +// - sender common.Address +func (_e *EVM2EVMOffRampInterface_Expecter) GetSenderNonce(opts interface{}, sender interface{}) *EVM2EVMOffRampInterface_GetSenderNonce_Call { + return &EVM2EVMOffRampInterface_GetSenderNonce_Call{Call: _e.mock.On("GetSenderNonce", opts, sender)} +} + +func (_c *EVM2EVMOffRampInterface_GetSenderNonce_Call) Run(run func(opts *bind.CallOpts, sender common.Address)) *EVM2EVMOffRampInterface_GetSenderNonce_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts), args[1].(common.Address)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_GetSenderNonce_Call) Return(_a0 uint64, _a1 error) *EVM2EVMOffRampInterface_GetSenderNonce_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_GetSenderNonce_Call) RunAndReturn(run func(*bind.CallOpts, common.Address) (uint64, error)) *EVM2EVMOffRampInterface_GetSenderNonce_Call { + _c.Call.Return(run) + return _c +} + +// GetStaticConfig provides a mock function with given fields: opts +func (_m *EVM2EVMOffRampInterface) GetStaticConfig(opts *bind.CallOpts) (evm_2_evm_offramp_1_2_0.EVM2EVMOffRampStaticConfig, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for GetStaticConfig") + } + + var r0 evm_2_evm_offramp_1_2_0.EVM2EVMOffRampStaticConfig + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts) (evm_2_evm_offramp_1_2_0.EVM2EVMOffRampStaticConfig, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts) evm_2_evm_offramp_1_2_0.EVM2EVMOffRampStaticConfig); ok { + r0 = rf(opts) + } else { + r0 = ret.Get(0).(evm_2_evm_offramp_1_2_0.EVM2EVMOffRampStaticConfig) + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_GetStaticConfig_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetStaticConfig' +type EVM2EVMOffRampInterface_GetStaticConfig_Call struct { + *mock.Call +} + +// GetStaticConfig is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *EVM2EVMOffRampInterface_Expecter) GetStaticConfig(opts interface{}) *EVM2EVMOffRampInterface_GetStaticConfig_Call { + return &EVM2EVMOffRampInterface_GetStaticConfig_Call{Call: _e.mock.On("GetStaticConfig", opts)} +} + +func (_c *EVM2EVMOffRampInterface_GetStaticConfig_Call) Run(run func(opts *bind.CallOpts)) *EVM2EVMOffRampInterface_GetStaticConfig_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_GetStaticConfig_Call) Return(_a0 evm_2_evm_offramp_1_2_0.EVM2EVMOffRampStaticConfig, _a1 error) *EVM2EVMOffRampInterface_GetStaticConfig_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_GetStaticConfig_Call) RunAndReturn(run func(*bind.CallOpts) (evm_2_evm_offramp_1_2_0.EVM2EVMOffRampStaticConfig, error)) *EVM2EVMOffRampInterface_GetStaticConfig_Call { + _c.Call.Return(run) + return _c +} + +// GetSupportedTokens provides a mock function with given fields: opts +func (_m *EVM2EVMOffRampInterface) GetSupportedTokens(opts *bind.CallOpts) ([]common.Address, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for GetSupportedTokens") + } + + var r0 []common.Address + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts) ([]common.Address, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts) []common.Address); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]common.Address) + } + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_GetSupportedTokens_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSupportedTokens' +type EVM2EVMOffRampInterface_GetSupportedTokens_Call struct { + *mock.Call +} + +// GetSupportedTokens is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *EVM2EVMOffRampInterface_Expecter) GetSupportedTokens(opts interface{}) *EVM2EVMOffRampInterface_GetSupportedTokens_Call { + return &EVM2EVMOffRampInterface_GetSupportedTokens_Call{Call: _e.mock.On("GetSupportedTokens", opts)} +} + +func (_c *EVM2EVMOffRampInterface_GetSupportedTokens_Call) Run(run func(opts *bind.CallOpts)) *EVM2EVMOffRampInterface_GetSupportedTokens_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_GetSupportedTokens_Call) Return(_a0 []common.Address, _a1 error) *EVM2EVMOffRampInterface_GetSupportedTokens_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_GetSupportedTokens_Call) RunAndReturn(run func(*bind.CallOpts) ([]common.Address, error)) *EVM2EVMOffRampInterface_GetSupportedTokens_Call { + _c.Call.Return(run) + return _c +} + +// GetTokenLimitAdmin provides a mock function with given fields: opts +func (_m *EVM2EVMOffRampInterface) GetTokenLimitAdmin(opts *bind.CallOpts) (common.Address, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for GetTokenLimitAdmin") + } + + var r0 common.Address + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts) (common.Address, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts) common.Address); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Address) + } + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_GetTokenLimitAdmin_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetTokenLimitAdmin' +type EVM2EVMOffRampInterface_GetTokenLimitAdmin_Call struct { + *mock.Call +} + +// GetTokenLimitAdmin is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *EVM2EVMOffRampInterface_Expecter) GetTokenLimitAdmin(opts interface{}) *EVM2EVMOffRampInterface_GetTokenLimitAdmin_Call { + return &EVM2EVMOffRampInterface_GetTokenLimitAdmin_Call{Call: _e.mock.On("GetTokenLimitAdmin", opts)} +} + +func (_c *EVM2EVMOffRampInterface_GetTokenLimitAdmin_Call) Run(run func(opts *bind.CallOpts)) *EVM2EVMOffRampInterface_GetTokenLimitAdmin_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_GetTokenLimitAdmin_Call) Return(_a0 common.Address, _a1 error) *EVM2EVMOffRampInterface_GetTokenLimitAdmin_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_GetTokenLimitAdmin_Call) RunAndReturn(run func(*bind.CallOpts) (common.Address, error)) *EVM2EVMOffRampInterface_GetTokenLimitAdmin_Call { + _c.Call.Return(run) + return _c +} + +// GetTransmitters provides a mock function with given fields: opts +func (_m *EVM2EVMOffRampInterface) GetTransmitters(opts *bind.CallOpts) ([]common.Address, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for GetTransmitters") + } + + var r0 []common.Address + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts) ([]common.Address, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts) []common.Address); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]common.Address) + } + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_GetTransmitters_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetTransmitters' +type EVM2EVMOffRampInterface_GetTransmitters_Call struct { + *mock.Call +} + +// GetTransmitters is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *EVM2EVMOffRampInterface_Expecter) GetTransmitters(opts interface{}) *EVM2EVMOffRampInterface_GetTransmitters_Call { + return &EVM2EVMOffRampInterface_GetTransmitters_Call{Call: _e.mock.On("GetTransmitters", opts)} +} + +func (_c *EVM2EVMOffRampInterface_GetTransmitters_Call) Run(run func(opts *bind.CallOpts)) *EVM2EVMOffRampInterface_GetTransmitters_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_GetTransmitters_Call) Return(_a0 []common.Address, _a1 error) *EVM2EVMOffRampInterface_GetTransmitters_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_GetTransmitters_Call) RunAndReturn(run func(*bind.CallOpts) ([]common.Address, error)) *EVM2EVMOffRampInterface_GetTransmitters_Call { + _c.Call.Return(run) + return _c +} + +// LatestConfigDetails provides a mock function with given fields: opts +func (_m *EVM2EVMOffRampInterface) LatestConfigDetails(opts *bind.CallOpts) (evm_2_evm_offramp_1_2_0.LatestConfigDetails, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for LatestConfigDetails") + } + + var r0 evm_2_evm_offramp_1_2_0.LatestConfigDetails + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts) (evm_2_evm_offramp_1_2_0.LatestConfigDetails, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts) evm_2_evm_offramp_1_2_0.LatestConfigDetails); ok { + r0 = rf(opts) + } else { + r0 = ret.Get(0).(evm_2_evm_offramp_1_2_0.LatestConfigDetails) + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_LatestConfigDetails_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LatestConfigDetails' +type EVM2EVMOffRampInterface_LatestConfigDetails_Call struct { + *mock.Call +} + +// LatestConfigDetails is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *EVM2EVMOffRampInterface_Expecter) LatestConfigDetails(opts interface{}) *EVM2EVMOffRampInterface_LatestConfigDetails_Call { + return &EVM2EVMOffRampInterface_LatestConfigDetails_Call{Call: _e.mock.On("LatestConfigDetails", opts)} +} + +func (_c *EVM2EVMOffRampInterface_LatestConfigDetails_Call) Run(run func(opts *bind.CallOpts)) *EVM2EVMOffRampInterface_LatestConfigDetails_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_LatestConfigDetails_Call) Return(_a0 evm_2_evm_offramp_1_2_0.LatestConfigDetails, _a1 error) *EVM2EVMOffRampInterface_LatestConfigDetails_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_LatestConfigDetails_Call) RunAndReturn(run func(*bind.CallOpts) (evm_2_evm_offramp_1_2_0.LatestConfigDetails, error)) *EVM2EVMOffRampInterface_LatestConfigDetails_Call { + _c.Call.Return(run) + return _c +} + +// LatestConfigDigestAndEpoch provides a mock function with given fields: opts +func (_m *EVM2EVMOffRampInterface) LatestConfigDigestAndEpoch(opts *bind.CallOpts) (evm_2_evm_offramp_1_2_0.LatestConfigDigestAndEpoch, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for LatestConfigDigestAndEpoch") + } + + var r0 evm_2_evm_offramp_1_2_0.LatestConfigDigestAndEpoch + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts) (evm_2_evm_offramp_1_2_0.LatestConfigDigestAndEpoch, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts) evm_2_evm_offramp_1_2_0.LatestConfigDigestAndEpoch); ok { + r0 = rf(opts) + } else { + r0 = ret.Get(0).(evm_2_evm_offramp_1_2_0.LatestConfigDigestAndEpoch) + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_LatestConfigDigestAndEpoch_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LatestConfigDigestAndEpoch' +type EVM2EVMOffRampInterface_LatestConfigDigestAndEpoch_Call struct { + *mock.Call +} + +// LatestConfigDigestAndEpoch is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *EVM2EVMOffRampInterface_Expecter) LatestConfigDigestAndEpoch(opts interface{}) *EVM2EVMOffRampInterface_LatestConfigDigestAndEpoch_Call { + return &EVM2EVMOffRampInterface_LatestConfigDigestAndEpoch_Call{Call: _e.mock.On("LatestConfigDigestAndEpoch", opts)} +} + +func (_c *EVM2EVMOffRampInterface_LatestConfigDigestAndEpoch_Call) Run(run func(opts *bind.CallOpts)) *EVM2EVMOffRampInterface_LatestConfigDigestAndEpoch_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_LatestConfigDigestAndEpoch_Call) Return(_a0 evm_2_evm_offramp_1_2_0.LatestConfigDigestAndEpoch, _a1 error) *EVM2EVMOffRampInterface_LatestConfigDigestAndEpoch_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_LatestConfigDigestAndEpoch_Call) RunAndReturn(run func(*bind.CallOpts) (evm_2_evm_offramp_1_2_0.LatestConfigDigestAndEpoch, error)) *EVM2EVMOffRampInterface_LatestConfigDigestAndEpoch_Call { + _c.Call.Return(run) + return _c +} + +// ManuallyExecute provides a mock function with given fields: opts, report, gasLimitOverrides +func (_m *EVM2EVMOffRampInterface) ManuallyExecute(opts *bind.TransactOpts, report evm_2_evm_offramp_1_2_0.InternalExecutionReport, gasLimitOverrides []*big.Int) (*types.Transaction, error) { + ret := _m.Called(opts, report, gasLimitOverrides) + + if len(ret) == 0 { + panic("no return value specified for ManuallyExecute") + } + + var r0 *types.Transaction + var r1 error + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, evm_2_evm_offramp_1_2_0.InternalExecutionReport, []*big.Int) (*types.Transaction, error)); ok { + return rf(opts, report, gasLimitOverrides) + } + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, evm_2_evm_offramp_1_2_0.InternalExecutionReport, []*big.Int) *types.Transaction); ok { + r0 = rf(opts, report, gasLimitOverrides) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Transaction) + } + } + + if rf, ok := ret.Get(1).(func(*bind.TransactOpts, evm_2_evm_offramp_1_2_0.InternalExecutionReport, []*big.Int) error); ok { + r1 = rf(opts, report, gasLimitOverrides) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_ManuallyExecute_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ManuallyExecute' +type EVM2EVMOffRampInterface_ManuallyExecute_Call struct { + *mock.Call +} + +// ManuallyExecute is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - report evm_2_evm_offramp_1_2_0.InternalExecutionReport +// - gasLimitOverrides []*big.Int +func (_e *EVM2EVMOffRampInterface_Expecter) ManuallyExecute(opts interface{}, report interface{}, gasLimitOverrides interface{}) *EVM2EVMOffRampInterface_ManuallyExecute_Call { + return &EVM2EVMOffRampInterface_ManuallyExecute_Call{Call: _e.mock.On("ManuallyExecute", opts, report, gasLimitOverrides)} +} + +func (_c *EVM2EVMOffRampInterface_ManuallyExecute_Call) Run(run func(opts *bind.TransactOpts, report evm_2_evm_offramp_1_2_0.InternalExecutionReport, gasLimitOverrides []*big.Int)) *EVM2EVMOffRampInterface_ManuallyExecute_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].(evm_2_evm_offramp_1_2_0.InternalExecutionReport), args[2].([]*big.Int)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_ManuallyExecute_Call) Return(_a0 *types.Transaction, _a1 error) *EVM2EVMOffRampInterface_ManuallyExecute_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_ManuallyExecute_Call) RunAndReturn(run func(*bind.TransactOpts, evm_2_evm_offramp_1_2_0.InternalExecutionReport, []*big.Int) (*types.Transaction, error)) *EVM2EVMOffRampInterface_ManuallyExecute_Call { + _c.Call.Return(run) + return _c +} + +// Owner provides a mock function with given fields: opts +func (_m *EVM2EVMOffRampInterface) Owner(opts *bind.CallOpts) (common.Address, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for Owner") + } + + var r0 common.Address + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts) (common.Address, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts) common.Address); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Address) + } + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_Owner_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Owner' +type EVM2EVMOffRampInterface_Owner_Call struct { + *mock.Call +} + +// Owner is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *EVM2EVMOffRampInterface_Expecter) Owner(opts interface{}) *EVM2EVMOffRampInterface_Owner_Call { + return &EVM2EVMOffRampInterface_Owner_Call{Call: _e.mock.On("Owner", opts)} +} + +func (_c *EVM2EVMOffRampInterface_Owner_Call) Run(run func(opts *bind.CallOpts)) *EVM2EVMOffRampInterface_Owner_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_Owner_Call) Return(_a0 common.Address, _a1 error) *EVM2EVMOffRampInterface_Owner_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_Owner_Call) RunAndReturn(run func(*bind.CallOpts) (common.Address, error)) *EVM2EVMOffRampInterface_Owner_Call { + _c.Call.Return(run) + return _c +} + +// ParseAdminSet provides a mock function with given fields: log +func (_m *EVM2EVMOffRampInterface) ParseAdminSet(log types.Log) (*evm_2_evm_offramp_1_2_0.EVM2EVMOffRampAdminSet, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParseAdminSet") + } + + var r0 *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampAdminSet + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (*evm_2_evm_offramp_1_2_0.EVM2EVMOffRampAdminSet, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampAdminSet); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*evm_2_evm_offramp_1_2_0.EVM2EVMOffRampAdminSet) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_ParseAdminSet_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseAdminSet' +type EVM2EVMOffRampInterface_ParseAdminSet_Call struct { + *mock.Call +} + +// ParseAdminSet is a helper method to define mock.On call +// - log types.Log +func (_e *EVM2EVMOffRampInterface_Expecter) ParseAdminSet(log interface{}) *EVM2EVMOffRampInterface_ParseAdminSet_Call { + return &EVM2EVMOffRampInterface_ParseAdminSet_Call{Call: _e.mock.On("ParseAdminSet", log)} +} + +func (_c *EVM2EVMOffRampInterface_ParseAdminSet_Call) Run(run func(log types.Log)) *EVM2EVMOffRampInterface_ParseAdminSet_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_ParseAdminSet_Call) Return(_a0 *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampAdminSet, _a1 error) *EVM2EVMOffRampInterface_ParseAdminSet_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_ParseAdminSet_Call) RunAndReturn(run func(types.Log) (*evm_2_evm_offramp_1_2_0.EVM2EVMOffRampAdminSet, error)) *EVM2EVMOffRampInterface_ParseAdminSet_Call { + _c.Call.Return(run) + return _c +} + +// ParseConfigSet provides a mock function with given fields: log +func (_m *EVM2EVMOffRampInterface) ParseConfigSet(log types.Log) (*evm_2_evm_offramp_1_2_0.EVM2EVMOffRampConfigSet, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParseConfigSet") + } + + var r0 *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampConfigSet + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (*evm_2_evm_offramp_1_2_0.EVM2EVMOffRampConfigSet, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampConfigSet); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*evm_2_evm_offramp_1_2_0.EVM2EVMOffRampConfigSet) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_ParseConfigSet_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseConfigSet' +type EVM2EVMOffRampInterface_ParseConfigSet_Call struct { + *mock.Call +} + +// ParseConfigSet is a helper method to define mock.On call +// - log types.Log +func (_e *EVM2EVMOffRampInterface_Expecter) ParseConfigSet(log interface{}) *EVM2EVMOffRampInterface_ParseConfigSet_Call { + return &EVM2EVMOffRampInterface_ParseConfigSet_Call{Call: _e.mock.On("ParseConfigSet", log)} +} + +func (_c *EVM2EVMOffRampInterface_ParseConfigSet_Call) Run(run func(log types.Log)) *EVM2EVMOffRampInterface_ParseConfigSet_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_ParseConfigSet_Call) Return(_a0 *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampConfigSet, _a1 error) *EVM2EVMOffRampInterface_ParseConfigSet_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_ParseConfigSet_Call) RunAndReturn(run func(types.Log) (*evm_2_evm_offramp_1_2_0.EVM2EVMOffRampConfigSet, error)) *EVM2EVMOffRampInterface_ParseConfigSet_Call { + _c.Call.Return(run) + return _c +} + +// ParseConfigSet0 provides a mock function with given fields: log +func (_m *EVM2EVMOffRampInterface) ParseConfigSet0(log types.Log) (*evm_2_evm_offramp_1_2_0.EVM2EVMOffRampConfigSet0, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParseConfigSet0") + } + + var r0 *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampConfigSet0 + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (*evm_2_evm_offramp_1_2_0.EVM2EVMOffRampConfigSet0, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampConfigSet0); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*evm_2_evm_offramp_1_2_0.EVM2EVMOffRampConfigSet0) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_ParseConfigSet0_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseConfigSet0' +type EVM2EVMOffRampInterface_ParseConfigSet0_Call struct { + *mock.Call +} + +// ParseConfigSet0 is a helper method to define mock.On call +// - log types.Log +func (_e *EVM2EVMOffRampInterface_Expecter) ParseConfigSet0(log interface{}) *EVM2EVMOffRampInterface_ParseConfigSet0_Call { + return &EVM2EVMOffRampInterface_ParseConfigSet0_Call{Call: _e.mock.On("ParseConfigSet0", log)} +} + +func (_c *EVM2EVMOffRampInterface_ParseConfigSet0_Call) Run(run func(log types.Log)) *EVM2EVMOffRampInterface_ParseConfigSet0_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_ParseConfigSet0_Call) Return(_a0 *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampConfigSet0, _a1 error) *EVM2EVMOffRampInterface_ParseConfigSet0_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_ParseConfigSet0_Call) RunAndReturn(run func(types.Log) (*evm_2_evm_offramp_1_2_0.EVM2EVMOffRampConfigSet0, error)) *EVM2EVMOffRampInterface_ParseConfigSet0_Call { + _c.Call.Return(run) + return _c +} + +// ParseExecutionStateChanged provides a mock function with given fields: log +func (_m *EVM2EVMOffRampInterface) ParseExecutionStateChanged(log types.Log) (*evm_2_evm_offramp_1_2_0.EVM2EVMOffRampExecutionStateChanged, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParseExecutionStateChanged") + } + + var r0 *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampExecutionStateChanged + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (*evm_2_evm_offramp_1_2_0.EVM2EVMOffRampExecutionStateChanged, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampExecutionStateChanged); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*evm_2_evm_offramp_1_2_0.EVM2EVMOffRampExecutionStateChanged) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_ParseExecutionStateChanged_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseExecutionStateChanged' +type EVM2EVMOffRampInterface_ParseExecutionStateChanged_Call struct { + *mock.Call +} + +// ParseExecutionStateChanged is a helper method to define mock.On call +// - log types.Log +func (_e *EVM2EVMOffRampInterface_Expecter) ParseExecutionStateChanged(log interface{}) *EVM2EVMOffRampInterface_ParseExecutionStateChanged_Call { + return &EVM2EVMOffRampInterface_ParseExecutionStateChanged_Call{Call: _e.mock.On("ParseExecutionStateChanged", log)} +} + +func (_c *EVM2EVMOffRampInterface_ParseExecutionStateChanged_Call) Run(run func(log types.Log)) *EVM2EVMOffRampInterface_ParseExecutionStateChanged_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_ParseExecutionStateChanged_Call) Return(_a0 *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampExecutionStateChanged, _a1 error) *EVM2EVMOffRampInterface_ParseExecutionStateChanged_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_ParseExecutionStateChanged_Call) RunAndReturn(run func(types.Log) (*evm_2_evm_offramp_1_2_0.EVM2EVMOffRampExecutionStateChanged, error)) *EVM2EVMOffRampInterface_ParseExecutionStateChanged_Call { + _c.Call.Return(run) + return _c +} + +// ParseLog provides a mock function with given fields: log +func (_m *EVM2EVMOffRampInterface) ParseLog(log types.Log) (generated.AbigenLog, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParseLog") + } + + var r0 generated.AbigenLog + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (generated.AbigenLog, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) generated.AbigenLog); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(generated.AbigenLog) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_ParseLog_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseLog' +type EVM2EVMOffRampInterface_ParseLog_Call struct { + *mock.Call +} + +// ParseLog is a helper method to define mock.On call +// - log types.Log +func (_e *EVM2EVMOffRampInterface_Expecter) ParseLog(log interface{}) *EVM2EVMOffRampInterface_ParseLog_Call { + return &EVM2EVMOffRampInterface_ParseLog_Call{Call: _e.mock.On("ParseLog", log)} +} + +func (_c *EVM2EVMOffRampInterface_ParseLog_Call) Run(run func(log types.Log)) *EVM2EVMOffRampInterface_ParseLog_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_ParseLog_Call) Return(_a0 generated.AbigenLog, _a1 error) *EVM2EVMOffRampInterface_ParseLog_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_ParseLog_Call) RunAndReturn(run func(types.Log) (generated.AbigenLog, error)) *EVM2EVMOffRampInterface_ParseLog_Call { + _c.Call.Return(run) + return _c +} + +// ParseOwnershipTransferRequested provides a mock function with given fields: log +func (_m *EVM2EVMOffRampInterface) ParseOwnershipTransferRequested(log types.Log) (*evm_2_evm_offramp_1_2_0.EVM2EVMOffRampOwnershipTransferRequested, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParseOwnershipTransferRequested") + } + + var r0 *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampOwnershipTransferRequested + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (*evm_2_evm_offramp_1_2_0.EVM2EVMOffRampOwnershipTransferRequested, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampOwnershipTransferRequested); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*evm_2_evm_offramp_1_2_0.EVM2EVMOffRampOwnershipTransferRequested) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_ParseOwnershipTransferRequested_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseOwnershipTransferRequested' +type EVM2EVMOffRampInterface_ParseOwnershipTransferRequested_Call struct { + *mock.Call +} + +// ParseOwnershipTransferRequested is a helper method to define mock.On call +// - log types.Log +func (_e *EVM2EVMOffRampInterface_Expecter) ParseOwnershipTransferRequested(log interface{}) *EVM2EVMOffRampInterface_ParseOwnershipTransferRequested_Call { + return &EVM2EVMOffRampInterface_ParseOwnershipTransferRequested_Call{Call: _e.mock.On("ParseOwnershipTransferRequested", log)} +} + +func (_c *EVM2EVMOffRampInterface_ParseOwnershipTransferRequested_Call) Run(run func(log types.Log)) *EVM2EVMOffRampInterface_ParseOwnershipTransferRequested_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_ParseOwnershipTransferRequested_Call) Return(_a0 *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampOwnershipTransferRequested, _a1 error) *EVM2EVMOffRampInterface_ParseOwnershipTransferRequested_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_ParseOwnershipTransferRequested_Call) RunAndReturn(run func(types.Log) (*evm_2_evm_offramp_1_2_0.EVM2EVMOffRampOwnershipTransferRequested, error)) *EVM2EVMOffRampInterface_ParseOwnershipTransferRequested_Call { + _c.Call.Return(run) + return _c +} + +// ParseOwnershipTransferred provides a mock function with given fields: log +func (_m *EVM2EVMOffRampInterface) ParseOwnershipTransferred(log types.Log) (*evm_2_evm_offramp_1_2_0.EVM2EVMOffRampOwnershipTransferred, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParseOwnershipTransferred") + } + + var r0 *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampOwnershipTransferred + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (*evm_2_evm_offramp_1_2_0.EVM2EVMOffRampOwnershipTransferred, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampOwnershipTransferred); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*evm_2_evm_offramp_1_2_0.EVM2EVMOffRampOwnershipTransferred) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_ParseOwnershipTransferred_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseOwnershipTransferred' +type EVM2EVMOffRampInterface_ParseOwnershipTransferred_Call struct { + *mock.Call +} + +// ParseOwnershipTransferred is a helper method to define mock.On call +// - log types.Log +func (_e *EVM2EVMOffRampInterface_Expecter) ParseOwnershipTransferred(log interface{}) *EVM2EVMOffRampInterface_ParseOwnershipTransferred_Call { + return &EVM2EVMOffRampInterface_ParseOwnershipTransferred_Call{Call: _e.mock.On("ParseOwnershipTransferred", log)} +} + +func (_c *EVM2EVMOffRampInterface_ParseOwnershipTransferred_Call) Run(run func(log types.Log)) *EVM2EVMOffRampInterface_ParseOwnershipTransferred_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_ParseOwnershipTransferred_Call) Return(_a0 *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampOwnershipTransferred, _a1 error) *EVM2EVMOffRampInterface_ParseOwnershipTransferred_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_ParseOwnershipTransferred_Call) RunAndReturn(run func(types.Log) (*evm_2_evm_offramp_1_2_0.EVM2EVMOffRampOwnershipTransferred, error)) *EVM2EVMOffRampInterface_ParseOwnershipTransferred_Call { + _c.Call.Return(run) + return _c +} + +// ParsePoolAdded provides a mock function with given fields: log +func (_m *EVM2EVMOffRampInterface) ParsePoolAdded(log types.Log) (*evm_2_evm_offramp_1_2_0.EVM2EVMOffRampPoolAdded, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParsePoolAdded") + } + + var r0 *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampPoolAdded + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (*evm_2_evm_offramp_1_2_0.EVM2EVMOffRampPoolAdded, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampPoolAdded); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*evm_2_evm_offramp_1_2_0.EVM2EVMOffRampPoolAdded) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_ParsePoolAdded_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParsePoolAdded' +type EVM2EVMOffRampInterface_ParsePoolAdded_Call struct { + *mock.Call +} + +// ParsePoolAdded is a helper method to define mock.On call +// - log types.Log +func (_e *EVM2EVMOffRampInterface_Expecter) ParsePoolAdded(log interface{}) *EVM2EVMOffRampInterface_ParsePoolAdded_Call { + return &EVM2EVMOffRampInterface_ParsePoolAdded_Call{Call: _e.mock.On("ParsePoolAdded", log)} +} + +func (_c *EVM2EVMOffRampInterface_ParsePoolAdded_Call) Run(run func(log types.Log)) *EVM2EVMOffRampInterface_ParsePoolAdded_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_ParsePoolAdded_Call) Return(_a0 *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampPoolAdded, _a1 error) *EVM2EVMOffRampInterface_ParsePoolAdded_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_ParsePoolAdded_Call) RunAndReturn(run func(types.Log) (*evm_2_evm_offramp_1_2_0.EVM2EVMOffRampPoolAdded, error)) *EVM2EVMOffRampInterface_ParsePoolAdded_Call { + _c.Call.Return(run) + return _c +} + +// ParsePoolRemoved provides a mock function with given fields: log +func (_m *EVM2EVMOffRampInterface) ParsePoolRemoved(log types.Log) (*evm_2_evm_offramp_1_2_0.EVM2EVMOffRampPoolRemoved, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParsePoolRemoved") + } + + var r0 *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampPoolRemoved + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (*evm_2_evm_offramp_1_2_0.EVM2EVMOffRampPoolRemoved, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampPoolRemoved); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*evm_2_evm_offramp_1_2_0.EVM2EVMOffRampPoolRemoved) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_ParsePoolRemoved_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParsePoolRemoved' +type EVM2EVMOffRampInterface_ParsePoolRemoved_Call struct { + *mock.Call +} + +// ParsePoolRemoved is a helper method to define mock.On call +// - log types.Log +func (_e *EVM2EVMOffRampInterface_Expecter) ParsePoolRemoved(log interface{}) *EVM2EVMOffRampInterface_ParsePoolRemoved_Call { + return &EVM2EVMOffRampInterface_ParsePoolRemoved_Call{Call: _e.mock.On("ParsePoolRemoved", log)} +} + +func (_c *EVM2EVMOffRampInterface_ParsePoolRemoved_Call) Run(run func(log types.Log)) *EVM2EVMOffRampInterface_ParsePoolRemoved_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_ParsePoolRemoved_Call) Return(_a0 *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampPoolRemoved, _a1 error) *EVM2EVMOffRampInterface_ParsePoolRemoved_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_ParsePoolRemoved_Call) RunAndReturn(run func(types.Log) (*evm_2_evm_offramp_1_2_0.EVM2EVMOffRampPoolRemoved, error)) *EVM2EVMOffRampInterface_ParsePoolRemoved_Call { + _c.Call.Return(run) + return _c +} + +// ParseSkippedIncorrectNonce provides a mock function with given fields: log +func (_m *EVM2EVMOffRampInterface) ParseSkippedIncorrectNonce(log types.Log) (*evm_2_evm_offramp_1_2_0.EVM2EVMOffRampSkippedIncorrectNonce, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParseSkippedIncorrectNonce") + } + + var r0 *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampSkippedIncorrectNonce + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (*evm_2_evm_offramp_1_2_0.EVM2EVMOffRampSkippedIncorrectNonce, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampSkippedIncorrectNonce); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*evm_2_evm_offramp_1_2_0.EVM2EVMOffRampSkippedIncorrectNonce) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_ParseSkippedIncorrectNonce_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseSkippedIncorrectNonce' +type EVM2EVMOffRampInterface_ParseSkippedIncorrectNonce_Call struct { + *mock.Call +} + +// ParseSkippedIncorrectNonce is a helper method to define mock.On call +// - log types.Log +func (_e *EVM2EVMOffRampInterface_Expecter) ParseSkippedIncorrectNonce(log interface{}) *EVM2EVMOffRampInterface_ParseSkippedIncorrectNonce_Call { + return &EVM2EVMOffRampInterface_ParseSkippedIncorrectNonce_Call{Call: _e.mock.On("ParseSkippedIncorrectNonce", log)} +} + +func (_c *EVM2EVMOffRampInterface_ParseSkippedIncorrectNonce_Call) Run(run func(log types.Log)) *EVM2EVMOffRampInterface_ParseSkippedIncorrectNonce_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_ParseSkippedIncorrectNonce_Call) Return(_a0 *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampSkippedIncorrectNonce, _a1 error) *EVM2EVMOffRampInterface_ParseSkippedIncorrectNonce_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_ParseSkippedIncorrectNonce_Call) RunAndReturn(run func(types.Log) (*evm_2_evm_offramp_1_2_0.EVM2EVMOffRampSkippedIncorrectNonce, error)) *EVM2EVMOffRampInterface_ParseSkippedIncorrectNonce_Call { + _c.Call.Return(run) + return _c +} + +// ParseSkippedSenderWithPreviousRampMessageInflight provides a mock function with given fields: log +func (_m *EVM2EVMOffRampInterface) ParseSkippedSenderWithPreviousRampMessageInflight(log types.Log) (*evm_2_evm_offramp_1_2_0.EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflight, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParseSkippedSenderWithPreviousRampMessageInflight") + } + + var r0 *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflight + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (*evm_2_evm_offramp_1_2_0.EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflight, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflight); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*evm_2_evm_offramp_1_2_0.EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflight) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_ParseSkippedSenderWithPreviousRampMessageInflight_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseSkippedSenderWithPreviousRampMessageInflight' +type EVM2EVMOffRampInterface_ParseSkippedSenderWithPreviousRampMessageInflight_Call struct { + *mock.Call +} + +// ParseSkippedSenderWithPreviousRampMessageInflight is a helper method to define mock.On call +// - log types.Log +func (_e *EVM2EVMOffRampInterface_Expecter) ParseSkippedSenderWithPreviousRampMessageInflight(log interface{}) *EVM2EVMOffRampInterface_ParseSkippedSenderWithPreviousRampMessageInflight_Call { + return &EVM2EVMOffRampInterface_ParseSkippedSenderWithPreviousRampMessageInflight_Call{Call: _e.mock.On("ParseSkippedSenderWithPreviousRampMessageInflight", log)} +} + +func (_c *EVM2EVMOffRampInterface_ParseSkippedSenderWithPreviousRampMessageInflight_Call) Run(run func(log types.Log)) *EVM2EVMOffRampInterface_ParseSkippedSenderWithPreviousRampMessageInflight_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_ParseSkippedSenderWithPreviousRampMessageInflight_Call) Return(_a0 *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflight, _a1 error) *EVM2EVMOffRampInterface_ParseSkippedSenderWithPreviousRampMessageInflight_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_ParseSkippedSenderWithPreviousRampMessageInflight_Call) RunAndReturn(run func(types.Log) (*evm_2_evm_offramp_1_2_0.EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflight, error)) *EVM2EVMOffRampInterface_ParseSkippedSenderWithPreviousRampMessageInflight_Call { + _c.Call.Return(run) + return _c +} + +// ParseTransmitted provides a mock function with given fields: log +func (_m *EVM2EVMOffRampInterface) ParseTransmitted(log types.Log) (*evm_2_evm_offramp_1_2_0.EVM2EVMOffRampTransmitted, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParseTransmitted") + } + + var r0 *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampTransmitted + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (*evm_2_evm_offramp_1_2_0.EVM2EVMOffRampTransmitted, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampTransmitted); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*evm_2_evm_offramp_1_2_0.EVM2EVMOffRampTransmitted) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_ParseTransmitted_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseTransmitted' +type EVM2EVMOffRampInterface_ParseTransmitted_Call struct { + *mock.Call +} + +// ParseTransmitted is a helper method to define mock.On call +// - log types.Log +func (_e *EVM2EVMOffRampInterface_Expecter) ParseTransmitted(log interface{}) *EVM2EVMOffRampInterface_ParseTransmitted_Call { + return &EVM2EVMOffRampInterface_ParseTransmitted_Call{Call: _e.mock.On("ParseTransmitted", log)} +} + +func (_c *EVM2EVMOffRampInterface_ParseTransmitted_Call) Run(run func(log types.Log)) *EVM2EVMOffRampInterface_ParseTransmitted_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_ParseTransmitted_Call) Return(_a0 *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampTransmitted, _a1 error) *EVM2EVMOffRampInterface_ParseTransmitted_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_ParseTransmitted_Call) RunAndReturn(run func(types.Log) (*evm_2_evm_offramp_1_2_0.EVM2EVMOffRampTransmitted, error)) *EVM2EVMOffRampInterface_ParseTransmitted_Call { + _c.Call.Return(run) + return _c +} + +// SetAdmin provides a mock function with given fields: opts, newAdmin +func (_m *EVM2EVMOffRampInterface) SetAdmin(opts *bind.TransactOpts, newAdmin common.Address) (*types.Transaction, error) { + ret := _m.Called(opts, newAdmin) + + if len(ret) == 0 { + panic("no return value specified for SetAdmin") + } + + var r0 *types.Transaction + var r1 error + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, common.Address) (*types.Transaction, error)); ok { + return rf(opts, newAdmin) + } + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, common.Address) *types.Transaction); ok { + r0 = rf(opts, newAdmin) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Transaction) + } + } + + if rf, ok := ret.Get(1).(func(*bind.TransactOpts, common.Address) error); ok { + r1 = rf(opts, newAdmin) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_SetAdmin_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetAdmin' +type EVM2EVMOffRampInterface_SetAdmin_Call struct { + *mock.Call +} + +// SetAdmin is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - newAdmin common.Address +func (_e *EVM2EVMOffRampInterface_Expecter) SetAdmin(opts interface{}, newAdmin interface{}) *EVM2EVMOffRampInterface_SetAdmin_Call { + return &EVM2EVMOffRampInterface_SetAdmin_Call{Call: _e.mock.On("SetAdmin", opts, newAdmin)} +} + +func (_c *EVM2EVMOffRampInterface_SetAdmin_Call) Run(run func(opts *bind.TransactOpts, newAdmin common.Address)) *EVM2EVMOffRampInterface_SetAdmin_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].(common.Address)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_SetAdmin_Call) Return(_a0 *types.Transaction, _a1 error) *EVM2EVMOffRampInterface_SetAdmin_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_SetAdmin_Call) RunAndReturn(run func(*bind.TransactOpts, common.Address) (*types.Transaction, error)) *EVM2EVMOffRampInterface_SetAdmin_Call { + _c.Call.Return(run) + return _c +} + +// SetOCR2Config provides a mock function with given fields: opts, signers, transmitters, f, onchainConfig, offchainConfigVersion, offchainConfig +func (_m *EVM2EVMOffRampInterface) SetOCR2Config(opts *bind.TransactOpts, signers []common.Address, transmitters []common.Address, f uint8, onchainConfig []byte, offchainConfigVersion uint64, offchainConfig []byte) (*types.Transaction, error) { + ret := _m.Called(opts, signers, transmitters, f, onchainConfig, offchainConfigVersion, offchainConfig) + + if len(ret) == 0 { + panic("no return value specified for SetOCR2Config") + } + + var r0 *types.Transaction + var r1 error + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, []common.Address, []common.Address, uint8, []byte, uint64, []byte) (*types.Transaction, error)); ok { + return rf(opts, signers, transmitters, f, onchainConfig, offchainConfigVersion, offchainConfig) + } + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, []common.Address, []common.Address, uint8, []byte, uint64, []byte) *types.Transaction); ok { + r0 = rf(opts, signers, transmitters, f, onchainConfig, offchainConfigVersion, offchainConfig) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Transaction) + } + } + + if rf, ok := ret.Get(1).(func(*bind.TransactOpts, []common.Address, []common.Address, uint8, []byte, uint64, []byte) error); ok { + r1 = rf(opts, signers, transmitters, f, onchainConfig, offchainConfigVersion, offchainConfig) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_SetOCR2Config_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetOCR2Config' +type EVM2EVMOffRampInterface_SetOCR2Config_Call struct { + *mock.Call +} + +// SetOCR2Config is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - signers []common.Address +// - transmitters []common.Address +// - f uint8 +// - onchainConfig []byte +// - offchainConfigVersion uint64 +// - offchainConfig []byte +func (_e *EVM2EVMOffRampInterface_Expecter) SetOCR2Config(opts interface{}, signers interface{}, transmitters interface{}, f interface{}, onchainConfig interface{}, offchainConfigVersion interface{}, offchainConfig interface{}) *EVM2EVMOffRampInterface_SetOCR2Config_Call { + return &EVM2EVMOffRampInterface_SetOCR2Config_Call{Call: _e.mock.On("SetOCR2Config", opts, signers, transmitters, f, onchainConfig, offchainConfigVersion, offchainConfig)} +} + +func (_c *EVM2EVMOffRampInterface_SetOCR2Config_Call) Run(run func(opts *bind.TransactOpts, signers []common.Address, transmitters []common.Address, f uint8, onchainConfig []byte, offchainConfigVersion uint64, offchainConfig []byte)) *EVM2EVMOffRampInterface_SetOCR2Config_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].([]common.Address), args[2].([]common.Address), args[3].(uint8), args[4].([]byte), args[5].(uint64), args[6].([]byte)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_SetOCR2Config_Call) Return(_a0 *types.Transaction, _a1 error) *EVM2EVMOffRampInterface_SetOCR2Config_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_SetOCR2Config_Call) RunAndReturn(run func(*bind.TransactOpts, []common.Address, []common.Address, uint8, []byte, uint64, []byte) (*types.Transaction, error)) *EVM2EVMOffRampInterface_SetOCR2Config_Call { + _c.Call.Return(run) + return _c +} + +// SetRateLimiterConfig provides a mock function with given fields: opts, config +func (_m *EVM2EVMOffRampInterface) SetRateLimiterConfig(opts *bind.TransactOpts, config evm_2_evm_offramp_1_2_0.RateLimiterConfig) (*types.Transaction, error) { + ret := _m.Called(opts, config) + + if len(ret) == 0 { + panic("no return value specified for SetRateLimiterConfig") + } + + var r0 *types.Transaction + var r1 error + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, evm_2_evm_offramp_1_2_0.RateLimiterConfig) (*types.Transaction, error)); ok { + return rf(opts, config) + } + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, evm_2_evm_offramp_1_2_0.RateLimiterConfig) *types.Transaction); ok { + r0 = rf(opts, config) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Transaction) + } + } + + if rf, ok := ret.Get(1).(func(*bind.TransactOpts, evm_2_evm_offramp_1_2_0.RateLimiterConfig) error); ok { + r1 = rf(opts, config) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_SetRateLimiterConfig_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetRateLimiterConfig' +type EVM2EVMOffRampInterface_SetRateLimiterConfig_Call struct { + *mock.Call +} + +// SetRateLimiterConfig is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - config evm_2_evm_offramp_1_2_0.RateLimiterConfig +func (_e *EVM2EVMOffRampInterface_Expecter) SetRateLimiterConfig(opts interface{}, config interface{}) *EVM2EVMOffRampInterface_SetRateLimiterConfig_Call { + return &EVM2EVMOffRampInterface_SetRateLimiterConfig_Call{Call: _e.mock.On("SetRateLimiterConfig", opts, config)} +} + +func (_c *EVM2EVMOffRampInterface_SetRateLimiterConfig_Call) Run(run func(opts *bind.TransactOpts, config evm_2_evm_offramp_1_2_0.RateLimiterConfig)) *EVM2EVMOffRampInterface_SetRateLimiterConfig_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].(evm_2_evm_offramp_1_2_0.RateLimiterConfig)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_SetRateLimiterConfig_Call) Return(_a0 *types.Transaction, _a1 error) *EVM2EVMOffRampInterface_SetRateLimiterConfig_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_SetRateLimiterConfig_Call) RunAndReturn(run func(*bind.TransactOpts, evm_2_evm_offramp_1_2_0.RateLimiterConfig) (*types.Transaction, error)) *EVM2EVMOffRampInterface_SetRateLimiterConfig_Call { + _c.Call.Return(run) + return _c +} + +// TransferOwnership provides a mock function with given fields: opts, to +func (_m *EVM2EVMOffRampInterface) TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) { + ret := _m.Called(opts, to) + + if len(ret) == 0 { + panic("no return value specified for TransferOwnership") + } + + var r0 *types.Transaction + var r1 error + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, common.Address) (*types.Transaction, error)); ok { + return rf(opts, to) + } + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, common.Address) *types.Transaction); ok { + r0 = rf(opts, to) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Transaction) + } + } + + if rf, ok := ret.Get(1).(func(*bind.TransactOpts, common.Address) error); ok { + r1 = rf(opts, to) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_TransferOwnership_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TransferOwnership' +type EVM2EVMOffRampInterface_TransferOwnership_Call struct { + *mock.Call +} + +// TransferOwnership is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - to common.Address +func (_e *EVM2EVMOffRampInterface_Expecter) TransferOwnership(opts interface{}, to interface{}) *EVM2EVMOffRampInterface_TransferOwnership_Call { + return &EVM2EVMOffRampInterface_TransferOwnership_Call{Call: _e.mock.On("TransferOwnership", opts, to)} +} + +func (_c *EVM2EVMOffRampInterface_TransferOwnership_Call) Run(run func(opts *bind.TransactOpts, to common.Address)) *EVM2EVMOffRampInterface_TransferOwnership_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].(common.Address)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_TransferOwnership_Call) Return(_a0 *types.Transaction, _a1 error) *EVM2EVMOffRampInterface_TransferOwnership_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_TransferOwnership_Call) RunAndReturn(run func(*bind.TransactOpts, common.Address) (*types.Transaction, error)) *EVM2EVMOffRampInterface_TransferOwnership_Call { + _c.Call.Return(run) + return _c +} + +// Transmit provides a mock function with given fields: opts, reportContext, report, rs, ss, arg4 +func (_m *EVM2EVMOffRampInterface) Transmit(opts *bind.TransactOpts, reportContext [3][32]byte, report []byte, rs [][32]byte, ss [][32]byte, arg4 [32]byte) (*types.Transaction, error) { + ret := _m.Called(opts, reportContext, report, rs, ss, arg4) + + if len(ret) == 0 { + panic("no return value specified for Transmit") + } + + var r0 *types.Transaction + var r1 error + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, [3][32]byte, []byte, [][32]byte, [][32]byte, [32]byte) (*types.Transaction, error)); ok { + return rf(opts, reportContext, report, rs, ss, arg4) + } + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, [3][32]byte, []byte, [][32]byte, [][32]byte, [32]byte) *types.Transaction); ok { + r0 = rf(opts, reportContext, report, rs, ss, arg4) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Transaction) + } + } + + if rf, ok := ret.Get(1).(func(*bind.TransactOpts, [3][32]byte, []byte, [][32]byte, [][32]byte, [32]byte) error); ok { + r1 = rf(opts, reportContext, report, rs, ss, arg4) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_Transmit_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Transmit' +type EVM2EVMOffRampInterface_Transmit_Call struct { + *mock.Call +} + +// Transmit is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - reportContext [3][32]byte +// - report []byte +// - rs [][32]byte +// - ss [][32]byte +// - arg4 [32]byte +func (_e *EVM2EVMOffRampInterface_Expecter) Transmit(opts interface{}, reportContext interface{}, report interface{}, rs interface{}, ss interface{}, arg4 interface{}) *EVM2EVMOffRampInterface_Transmit_Call { + return &EVM2EVMOffRampInterface_Transmit_Call{Call: _e.mock.On("Transmit", opts, reportContext, report, rs, ss, arg4)} +} + +func (_c *EVM2EVMOffRampInterface_Transmit_Call) Run(run func(opts *bind.TransactOpts, reportContext [3][32]byte, report []byte, rs [][32]byte, ss [][32]byte, arg4 [32]byte)) *EVM2EVMOffRampInterface_Transmit_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].([3][32]byte), args[2].([]byte), args[3].([][32]byte), args[4].([][32]byte), args[5].([32]byte)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_Transmit_Call) Return(_a0 *types.Transaction, _a1 error) *EVM2EVMOffRampInterface_Transmit_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_Transmit_Call) RunAndReturn(run func(*bind.TransactOpts, [3][32]byte, []byte, [][32]byte, [][32]byte, [32]byte) (*types.Transaction, error)) *EVM2EVMOffRampInterface_Transmit_Call { + _c.Call.Return(run) + return _c +} + +// TypeAndVersion provides a mock function with given fields: opts +func (_m *EVM2EVMOffRampInterface) TypeAndVersion(opts *bind.CallOpts) (string, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for TypeAndVersion") + } + + var r0 string + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts) (string, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts) string); ok { + r0 = rf(opts) + } else { + r0 = ret.Get(0).(string) + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_TypeAndVersion_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TypeAndVersion' +type EVM2EVMOffRampInterface_TypeAndVersion_Call struct { + *mock.Call +} + +// TypeAndVersion is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *EVM2EVMOffRampInterface_Expecter) TypeAndVersion(opts interface{}) *EVM2EVMOffRampInterface_TypeAndVersion_Call { + return &EVM2EVMOffRampInterface_TypeAndVersion_Call{Call: _e.mock.On("TypeAndVersion", opts)} +} + +func (_c *EVM2EVMOffRampInterface_TypeAndVersion_Call) Run(run func(opts *bind.CallOpts)) *EVM2EVMOffRampInterface_TypeAndVersion_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_TypeAndVersion_Call) Return(_a0 string, _a1 error) *EVM2EVMOffRampInterface_TypeAndVersion_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_TypeAndVersion_Call) RunAndReturn(run func(*bind.CallOpts) (string, error)) *EVM2EVMOffRampInterface_TypeAndVersion_Call { + _c.Call.Return(run) + return _c +} + +// WatchAdminSet provides a mock function with given fields: opts, sink +func (_m *EVM2EVMOffRampInterface) WatchAdminSet(opts *bind.WatchOpts, sink chan<- *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampAdminSet) (event.Subscription, error) { + ret := _m.Called(opts, sink) + + if len(ret) == 0 { + panic("no return value specified for WatchAdminSet") + } + + var r0 event.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampAdminSet) (event.Subscription, error)); ok { + return rf(opts, sink) + } + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampAdminSet) event.Subscription); ok { + r0 = rf(opts, sink) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(event.Subscription) + } + } + + if rf, ok := ret.Get(1).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampAdminSet) error); ok { + r1 = rf(opts, sink) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_WatchAdminSet_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchAdminSet' +type EVM2EVMOffRampInterface_WatchAdminSet_Call struct { + *mock.Call +} + +// WatchAdminSet is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampAdminSet +func (_e *EVM2EVMOffRampInterface_Expecter) WatchAdminSet(opts interface{}, sink interface{}) *EVM2EVMOffRampInterface_WatchAdminSet_Call { + return &EVM2EVMOffRampInterface_WatchAdminSet_Call{Call: _e.mock.On("WatchAdminSet", opts, sink)} +} + +func (_c *EVM2EVMOffRampInterface_WatchAdminSet_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampAdminSet)) *EVM2EVMOffRampInterface_WatchAdminSet_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampAdminSet)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_WatchAdminSet_Call) Return(_a0 event.Subscription, _a1 error) *EVM2EVMOffRampInterface_WatchAdminSet_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_WatchAdminSet_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampAdminSet) (event.Subscription, error)) *EVM2EVMOffRampInterface_WatchAdminSet_Call { + _c.Call.Return(run) + return _c +} + +// WatchConfigSet provides a mock function with given fields: opts, sink +func (_m *EVM2EVMOffRampInterface) WatchConfigSet(opts *bind.WatchOpts, sink chan<- *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampConfigSet) (event.Subscription, error) { + ret := _m.Called(opts, sink) + + if len(ret) == 0 { + panic("no return value specified for WatchConfigSet") + } + + var r0 event.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampConfigSet) (event.Subscription, error)); ok { + return rf(opts, sink) + } + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampConfigSet) event.Subscription); ok { + r0 = rf(opts, sink) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(event.Subscription) + } + } + + if rf, ok := ret.Get(1).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampConfigSet) error); ok { + r1 = rf(opts, sink) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_WatchConfigSet_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchConfigSet' +type EVM2EVMOffRampInterface_WatchConfigSet_Call struct { + *mock.Call +} + +// WatchConfigSet is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampConfigSet +func (_e *EVM2EVMOffRampInterface_Expecter) WatchConfigSet(opts interface{}, sink interface{}) *EVM2EVMOffRampInterface_WatchConfigSet_Call { + return &EVM2EVMOffRampInterface_WatchConfigSet_Call{Call: _e.mock.On("WatchConfigSet", opts, sink)} +} + +func (_c *EVM2EVMOffRampInterface_WatchConfigSet_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampConfigSet)) *EVM2EVMOffRampInterface_WatchConfigSet_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampConfigSet)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_WatchConfigSet_Call) Return(_a0 event.Subscription, _a1 error) *EVM2EVMOffRampInterface_WatchConfigSet_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_WatchConfigSet_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampConfigSet) (event.Subscription, error)) *EVM2EVMOffRampInterface_WatchConfigSet_Call { + _c.Call.Return(run) + return _c +} + +// WatchConfigSet0 provides a mock function with given fields: opts, sink +func (_m *EVM2EVMOffRampInterface) WatchConfigSet0(opts *bind.WatchOpts, sink chan<- *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampConfigSet0) (event.Subscription, error) { + ret := _m.Called(opts, sink) + + if len(ret) == 0 { + panic("no return value specified for WatchConfigSet0") + } + + var r0 event.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampConfigSet0) (event.Subscription, error)); ok { + return rf(opts, sink) + } + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampConfigSet0) event.Subscription); ok { + r0 = rf(opts, sink) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(event.Subscription) + } + } + + if rf, ok := ret.Get(1).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampConfigSet0) error); ok { + r1 = rf(opts, sink) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_WatchConfigSet0_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchConfigSet0' +type EVM2EVMOffRampInterface_WatchConfigSet0_Call struct { + *mock.Call +} + +// WatchConfigSet0 is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampConfigSet0 +func (_e *EVM2EVMOffRampInterface_Expecter) WatchConfigSet0(opts interface{}, sink interface{}) *EVM2EVMOffRampInterface_WatchConfigSet0_Call { + return &EVM2EVMOffRampInterface_WatchConfigSet0_Call{Call: _e.mock.On("WatchConfigSet0", opts, sink)} +} + +func (_c *EVM2EVMOffRampInterface_WatchConfigSet0_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampConfigSet0)) *EVM2EVMOffRampInterface_WatchConfigSet0_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampConfigSet0)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_WatchConfigSet0_Call) Return(_a0 event.Subscription, _a1 error) *EVM2EVMOffRampInterface_WatchConfigSet0_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_WatchConfigSet0_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampConfigSet0) (event.Subscription, error)) *EVM2EVMOffRampInterface_WatchConfigSet0_Call { + _c.Call.Return(run) + return _c +} + +// WatchExecutionStateChanged provides a mock function with given fields: opts, sink, sequenceNumber, messageId +func (_m *EVM2EVMOffRampInterface) WatchExecutionStateChanged(opts *bind.WatchOpts, sink chan<- *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampExecutionStateChanged, sequenceNumber []uint64, messageId [][32]byte) (event.Subscription, error) { + ret := _m.Called(opts, sink, sequenceNumber, messageId) + + if len(ret) == 0 { + panic("no return value specified for WatchExecutionStateChanged") + } + + var r0 event.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampExecutionStateChanged, []uint64, [][32]byte) (event.Subscription, error)); ok { + return rf(opts, sink, sequenceNumber, messageId) + } + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampExecutionStateChanged, []uint64, [][32]byte) event.Subscription); ok { + r0 = rf(opts, sink, sequenceNumber, messageId) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(event.Subscription) + } + } + + if rf, ok := ret.Get(1).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampExecutionStateChanged, []uint64, [][32]byte) error); ok { + r1 = rf(opts, sink, sequenceNumber, messageId) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_WatchExecutionStateChanged_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchExecutionStateChanged' +type EVM2EVMOffRampInterface_WatchExecutionStateChanged_Call struct { + *mock.Call +} + +// WatchExecutionStateChanged is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampExecutionStateChanged +// - sequenceNumber []uint64 +// - messageId [][32]byte +func (_e *EVM2EVMOffRampInterface_Expecter) WatchExecutionStateChanged(opts interface{}, sink interface{}, sequenceNumber interface{}, messageId interface{}) *EVM2EVMOffRampInterface_WatchExecutionStateChanged_Call { + return &EVM2EVMOffRampInterface_WatchExecutionStateChanged_Call{Call: _e.mock.On("WatchExecutionStateChanged", opts, sink, sequenceNumber, messageId)} +} + +func (_c *EVM2EVMOffRampInterface_WatchExecutionStateChanged_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampExecutionStateChanged, sequenceNumber []uint64, messageId [][32]byte)) *EVM2EVMOffRampInterface_WatchExecutionStateChanged_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampExecutionStateChanged), args[2].([]uint64), args[3].([][32]byte)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_WatchExecutionStateChanged_Call) Return(_a0 event.Subscription, _a1 error) *EVM2EVMOffRampInterface_WatchExecutionStateChanged_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_WatchExecutionStateChanged_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampExecutionStateChanged, []uint64, [][32]byte) (event.Subscription, error)) *EVM2EVMOffRampInterface_WatchExecutionStateChanged_Call { + _c.Call.Return(run) + return _c +} + +// WatchOwnershipTransferRequested provides a mock function with given fields: opts, sink, from, to +func (_m *EVM2EVMOffRampInterface) WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) { + ret := _m.Called(opts, sink, from, to) + + if len(ret) == 0 { + panic("no return value specified for WatchOwnershipTransferRequested") + } + + var r0 event.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampOwnershipTransferRequested, []common.Address, []common.Address) (event.Subscription, error)); ok { + return rf(opts, sink, from, to) + } + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampOwnershipTransferRequested, []common.Address, []common.Address) event.Subscription); ok { + r0 = rf(opts, sink, from, to) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(event.Subscription) + } + } + + if rf, ok := ret.Get(1).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampOwnershipTransferRequested, []common.Address, []common.Address) error); ok { + r1 = rf(opts, sink, from, to) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_WatchOwnershipTransferRequested_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchOwnershipTransferRequested' +type EVM2EVMOffRampInterface_WatchOwnershipTransferRequested_Call struct { + *mock.Call +} + +// WatchOwnershipTransferRequested is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampOwnershipTransferRequested +// - from []common.Address +// - to []common.Address +func (_e *EVM2EVMOffRampInterface_Expecter) WatchOwnershipTransferRequested(opts interface{}, sink interface{}, from interface{}, to interface{}) *EVM2EVMOffRampInterface_WatchOwnershipTransferRequested_Call { + return &EVM2EVMOffRampInterface_WatchOwnershipTransferRequested_Call{Call: _e.mock.On("WatchOwnershipTransferRequested", opts, sink, from, to)} +} + +func (_c *EVM2EVMOffRampInterface_WatchOwnershipTransferRequested_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampOwnershipTransferRequested, from []common.Address, to []common.Address)) *EVM2EVMOffRampInterface_WatchOwnershipTransferRequested_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampOwnershipTransferRequested), args[2].([]common.Address), args[3].([]common.Address)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_WatchOwnershipTransferRequested_Call) Return(_a0 event.Subscription, _a1 error) *EVM2EVMOffRampInterface_WatchOwnershipTransferRequested_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_WatchOwnershipTransferRequested_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampOwnershipTransferRequested, []common.Address, []common.Address) (event.Subscription, error)) *EVM2EVMOffRampInterface_WatchOwnershipTransferRequested_Call { + _c.Call.Return(run) + return _c +} + +// WatchOwnershipTransferred provides a mock function with given fields: opts, sink, from, to +func (_m *EVM2EVMOffRampInterface) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) { + ret := _m.Called(opts, sink, from, to) + + if len(ret) == 0 { + panic("no return value specified for WatchOwnershipTransferred") + } + + var r0 event.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampOwnershipTransferred, []common.Address, []common.Address) (event.Subscription, error)); ok { + return rf(opts, sink, from, to) + } + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampOwnershipTransferred, []common.Address, []common.Address) event.Subscription); ok { + r0 = rf(opts, sink, from, to) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(event.Subscription) + } + } + + if rf, ok := ret.Get(1).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampOwnershipTransferred, []common.Address, []common.Address) error); ok { + r1 = rf(opts, sink, from, to) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_WatchOwnershipTransferred_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchOwnershipTransferred' +type EVM2EVMOffRampInterface_WatchOwnershipTransferred_Call struct { + *mock.Call +} + +// WatchOwnershipTransferred is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampOwnershipTransferred +// - from []common.Address +// - to []common.Address +func (_e *EVM2EVMOffRampInterface_Expecter) WatchOwnershipTransferred(opts interface{}, sink interface{}, from interface{}, to interface{}) *EVM2EVMOffRampInterface_WatchOwnershipTransferred_Call { + return &EVM2EVMOffRampInterface_WatchOwnershipTransferred_Call{Call: _e.mock.On("WatchOwnershipTransferred", opts, sink, from, to)} +} + +func (_c *EVM2EVMOffRampInterface_WatchOwnershipTransferred_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampOwnershipTransferred, from []common.Address, to []common.Address)) *EVM2EVMOffRampInterface_WatchOwnershipTransferred_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampOwnershipTransferred), args[2].([]common.Address), args[3].([]common.Address)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_WatchOwnershipTransferred_Call) Return(_a0 event.Subscription, _a1 error) *EVM2EVMOffRampInterface_WatchOwnershipTransferred_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_WatchOwnershipTransferred_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampOwnershipTransferred, []common.Address, []common.Address) (event.Subscription, error)) *EVM2EVMOffRampInterface_WatchOwnershipTransferred_Call { + _c.Call.Return(run) + return _c +} + +// WatchPoolAdded provides a mock function with given fields: opts, sink +func (_m *EVM2EVMOffRampInterface) WatchPoolAdded(opts *bind.WatchOpts, sink chan<- *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampPoolAdded) (event.Subscription, error) { + ret := _m.Called(opts, sink) + + if len(ret) == 0 { + panic("no return value specified for WatchPoolAdded") + } + + var r0 event.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampPoolAdded) (event.Subscription, error)); ok { + return rf(opts, sink) + } + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampPoolAdded) event.Subscription); ok { + r0 = rf(opts, sink) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(event.Subscription) + } + } + + if rf, ok := ret.Get(1).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampPoolAdded) error); ok { + r1 = rf(opts, sink) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_WatchPoolAdded_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchPoolAdded' +type EVM2EVMOffRampInterface_WatchPoolAdded_Call struct { + *mock.Call +} + +// WatchPoolAdded is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampPoolAdded +func (_e *EVM2EVMOffRampInterface_Expecter) WatchPoolAdded(opts interface{}, sink interface{}) *EVM2EVMOffRampInterface_WatchPoolAdded_Call { + return &EVM2EVMOffRampInterface_WatchPoolAdded_Call{Call: _e.mock.On("WatchPoolAdded", opts, sink)} +} + +func (_c *EVM2EVMOffRampInterface_WatchPoolAdded_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampPoolAdded)) *EVM2EVMOffRampInterface_WatchPoolAdded_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampPoolAdded)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_WatchPoolAdded_Call) Return(_a0 event.Subscription, _a1 error) *EVM2EVMOffRampInterface_WatchPoolAdded_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_WatchPoolAdded_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampPoolAdded) (event.Subscription, error)) *EVM2EVMOffRampInterface_WatchPoolAdded_Call { + _c.Call.Return(run) + return _c +} + +// WatchPoolRemoved provides a mock function with given fields: opts, sink +func (_m *EVM2EVMOffRampInterface) WatchPoolRemoved(opts *bind.WatchOpts, sink chan<- *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampPoolRemoved) (event.Subscription, error) { + ret := _m.Called(opts, sink) + + if len(ret) == 0 { + panic("no return value specified for WatchPoolRemoved") + } + + var r0 event.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampPoolRemoved) (event.Subscription, error)); ok { + return rf(opts, sink) + } + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampPoolRemoved) event.Subscription); ok { + r0 = rf(opts, sink) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(event.Subscription) + } + } + + if rf, ok := ret.Get(1).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampPoolRemoved) error); ok { + r1 = rf(opts, sink) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_WatchPoolRemoved_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchPoolRemoved' +type EVM2EVMOffRampInterface_WatchPoolRemoved_Call struct { + *mock.Call +} + +// WatchPoolRemoved is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampPoolRemoved +func (_e *EVM2EVMOffRampInterface_Expecter) WatchPoolRemoved(opts interface{}, sink interface{}) *EVM2EVMOffRampInterface_WatchPoolRemoved_Call { + return &EVM2EVMOffRampInterface_WatchPoolRemoved_Call{Call: _e.mock.On("WatchPoolRemoved", opts, sink)} +} + +func (_c *EVM2EVMOffRampInterface_WatchPoolRemoved_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampPoolRemoved)) *EVM2EVMOffRampInterface_WatchPoolRemoved_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampPoolRemoved)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_WatchPoolRemoved_Call) Return(_a0 event.Subscription, _a1 error) *EVM2EVMOffRampInterface_WatchPoolRemoved_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_WatchPoolRemoved_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampPoolRemoved) (event.Subscription, error)) *EVM2EVMOffRampInterface_WatchPoolRemoved_Call { + _c.Call.Return(run) + return _c +} + +// WatchSkippedIncorrectNonce provides a mock function with given fields: opts, sink, nonce, sender +func (_m *EVM2EVMOffRampInterface) WatchSkippedIncorrectNonce(opts *bind.WatchOpts, sink chan<- *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampSkippedIncorrectNonce, nonce []uint64, sender []common.Address) (event.Subscription, error) { + ret := _m.Called(opts, sink, nonce, sender) + + if len(ret) == 0 { + panic("no return value specified for WatchSkippedIncorrectNonce") + } + + var r0 event.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampSkippedIncorrectNonce, []uint64, []common.Address) (event.Subscription, error)); ok { + return rf(opts, sink, nonce, sender) + } + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampSkippedIncorrectNonce, []uint64, []common.Address) event.Subscription); ok { + r0 = rf(opts, sink, nonce, sender) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(event.Subscription) + } + } + + if rf, ok := ret.Get(1).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampSkippedIncorrectNonce, []uint64, []common.Address) error); ok { + r1 = rf(opts, sink, nonce, sender) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_WatchSkippedIncorrectNonce_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchSkippedIncorrectNonce' +type EVM2EVMOffRampInterface_WatchSkippedIncorrectNonce_Call struct { + *mock.Call +} + +// WatchSkippedIncorrectNonce is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampSkippedIncorrectNonce +// - nonce []uint64 +// - sender []common.Address +func (_e *EVM2EVMOffRampInterface_Expecter) WatchSkippedIncorrectNonce(opts interface{}, sink interface{}, nonce interface{}, sender interface{}) *EVM2EVMOffRampInterface_WatchSkippedIncorrectNonce_Call { + return &EVM2EVMOffRampInterface_WatchSkippedIncorrectNonce_Call{Call: _e.mock.On("WatchSkippedIncorrectNonce", opts, sink, nonce, sender)} +} + +func (_c *EVM2EVMOffRampInterface_WatchSkippedIncorrectNonce_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampSkippedIncorrectNonce, nonce []uint64, sender []common.Address)) *EVM2EVMOffRampInterface_WatchSkippedIncorrectNonce_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampSkippedIncorrectNonce), args[2].([]uint64), args[3].([]common.Address)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_WatchSkippedIncorrectNonce_Call) Return(_a0 event.Subscription, _a1 error) *EVM2EVMOffRampInterface_WatchSkippedIncorrectNonce_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_WatchSkippedIncorrectNonce_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampSkippedIncorrectNonce, []uint64, []common.Address) (event.Subscription, error)) *EVM2EVMOffRampInterface_WatchSkippedIncorrectNonce_Call { + _c.Call.Return(run) + return _c +} + +// WatchSkippedSenderWithPreviousRampMessageInflight provides a mock function with given fields: opts, sink, nonce, sender +func (_m *EVM2EVMOffRampInterface) WatchSkippedSenderWithPreviousRampMessageInflight(opts *bind.WatchOpts, sink chan<- *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflight, nonce []uint64, sender []common.Address) (event.Subscription, error) { + ret := _m.Called(opts, sink, nonce, sender) + + if len(ret) == 0 { + panic("no return value specified for WatchSkippedSenderWithPreviousRampMessageInflight") + } + + var r0 event.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflight, []uint64, []common.Address) (event.Subscription, error)); ok { + return rf(opts, sink, nonce, sender) + } + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflight, []uint64, []common.Address) event.Subscription); ok { + r0 = rf(opts, sink, nonce, sender) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(event.Subscription) + } + } + + if rf, ok := ret.Get(1).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflight, []uint64, []common.Address) error); ok { + r1 = rf(opts, sink, nonce, sender) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_WatchSkippedSenderWithPreviousRampMessageInflight_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchSkippedSenderWithPreviousRampMessageInflight' +type EVM2EVMOffRampInterface_WatchSkippedSenderWithPreviousRampMessageInflight_Call struct { + *mock.Call +} + +// WatchSkippedSenderWithPreviousRampMessageInflight is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflight +// - nonce []uint64 +// - sender []common.Address +func (_e *EVM2EVMOffRampInterface_Expecter) WatchSkippedSenderWithPreviousRampMessageInflight(opts interface{}, sink interface{}, nonce interface{}, sender interface{}) *EVM2EVMOffRampInterface_WatchSkippedSenderWithPreviousRampMessageInflight_Call { + return &EVM2EVMOffRampInterface_WatchSkippedSenderWithPreviousRampMessageInflight_Call{Call: _e.mock.On("WatchSkippedSenderWithPreviousRampMessageInflight", opts, sink, nonce, sender)} +} + +func (_c *EVM2EVMOffRampInterface_WatchSkippedSenderWithPreviousRampMessageInflight_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflight, nonce []uint64, sender []common.Address)) *EVM2EVMOffRampInterface_WatchSkippedSenderWithPreviousRampMessageInflight_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflight), args[2].([]uint64), args[3].([]common.Address)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_WatchSkippedSenderWithPreviousRampMessageInflight_Call) Return(_a0 event.Subscription, _a1 error) *EVM2EVMOffRampInterface_WatchSkippedSenderWithPreviousRampMessageInflight_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_WatchSkippedSenderWithPreviousRampMessageInflight_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampSkippedSenderWithPreviousRampMessageInflight, []uint64, []common.Address) (event.Subscription, error)) *EVM2EVMOffRampInterface_WatchSkippedSenderWithPreviousRampMessageInflight_Call { + _c.Call.Return(run) + return _c +} + +// WatchTransmitted provides a mock function with given fields: opts, sink +func (_m *EVM2EVMOffRampInterface) WatchTransmitted(opts *bind.WatchOpts, sink chan<- *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampTransmitted) (event.Subscription, error) { + ret := _m.Called(opts, sink) + + if len(ret) == 0 { + panic("no return value specified for WatchTransmitted") + } + + var r0 event.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampTransmitted) (event.Subscription, error)); ok { + return rf(opts, sink) + } + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampTransmitted) event.Subscription); ok { + r0 = rf(opts, sink) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(event.Subscription) + } + } + + if rf, ok := ret.Get(1).(func(*bind.WatchOpts, chan<- *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampTransmitted) error); ok { + r1 = rf(opts, sink) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EVM2EVMOffRampInterface_WatchTransmitted_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchTransmitted' +type EVM2EVMOffRampInterface_WatchTransmitted_Call struct { + *mock.Call +} + +// WatchTransmitted is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampTransmitted +func (_e *EVM2EVMOffRampInterface_Expecter) WatchTransmitted(opts interface{}, sink interface{}) *EVM2EVMOffRampInterface_WatchTransmitted_Call { + return &EVM2EVMOffRampInterface_WatchTransmitted_Call{Call: _e.mock.On("WatchTransmitted", opts, sink)} +} + +func (_c *EVM2EVMOffRampInterface_WatchTransmitted_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampTransmitted)) *EVM2EVMOffRampInterface_WatchTransmitted_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampTransmitted)) + }) + return _c +} + +func (_c *EVM2EVMOffRampInterface_WatchTransmitted_Call) Return(_a0 event.Subscription, _a1 error) *EVM2EVMOffRampInterface_WatchTransmitted_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EVM2EVMOffRampInterface_WatchTransmitted_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *evm_2_evm_offramp_1_2_0.EVM2EVMOffRampTransmitted) (event.Subscription, error)) *EVM2EVMOffRampInterface_WatchTransmitted_Call { + _c.Call.Return(run) + return _c +} + +// NewEVM2EVMOffRampInterface creates a new instance of EVM2EVMOffRampInterface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewEVM2EVMOffRampInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *EVM2EVMOffRampInterface { + mock := &EVM2EVMOffRampInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/core/gethwrappers/functions/generated/functions_allow_list/functions_allow_list.go b/core/gethwrappers/functions/generated/functions_allow_list/functions_allow_list.go index 2f98ae1623d..aa8cf0bd864 100644 --- a/core/gethwrappers/functions/generated/functions_allow_list/functions_allow_list.go +++ b/core/gethwrappers/functions/generated/functions_allow_list/functions_allow_list.go @@ -36,15 +36,15 @@ type TermsOfServiceAllowListConfig struct { } var TermsOfServiceAllowListMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[{\"components\":[{\"internalType\":\"bool\",\"name\":\"enabled\",\"type\":\"bool\"},{\"internalType\":\"address\",\"name\":\"signerPublicKey\",\"type\":\"address\"}],\"internalType\":\"structTermsOfServiceAllowListConfig\",\"name\":\"config\",\"type\":\"tuple\"},{\"internalType\":\"address[]\",\"name\":\"initialAllowedSenders\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"initialBlockedSenders\",\"type\":\"address[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"InvalidCalldata\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidSignature\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidUsage\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RecipientIsBlocked\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"}],\"name\":\"AddedAccess\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"}],\"name\":\"BlockedAccess\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"bool\",\"name\":\"enabled\",\"type\":\"bool\"},{\"internalType\":\"address\",\"name\":\"signerPublicKey\",\"type\":\"address\"}],\"indexed\":false,\"internalType\":\"structTermsOfServiceAllowListConfig\",\"name\":\"config\",\"type\":\"tuple\"}],\"name\":\"ConfigUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"}],\"name\":\"UnblockedAccess\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"acceptor\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"}],\"name\":\"acceptTermsOfService\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"blockSender\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAllAllowedSenders\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAllowedSendersCount\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"allowedSenderIdxStart\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"allowedSenderIdxEnd\",\"type\":\"uint64\"}],\"name\":\"getAllowedSendersInRange\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"allowedSenders\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getBlockedSendersCount\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockedSenderIdxStart\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"blockedSenderIdxEnd\",\"type\":\"uint64\"}],\"name\":\"getBlockedSendersInRange\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"blockedSenders\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getConfig\",\"outputs\":[{\"components\":[{\"internalType\":\"bool\",\"name\":\"enabled\",\"type\":\"bool\"},{\"internalType\":\"address\",\"name\":\"signerPublicKey\",\"type\":\"address\"}],\"internalType\":\"structTermsOfServiceAllowListConfig\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"acceptor\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"}],\"name\":\"getMessage\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"hasAccess\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"isBlockedSender\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"unblockSender\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bool\",\"name\":\"enabled\",\"type\":\"bool\"},{\"internalType\":\"address\",\"name\":\"signerPublicKey\",\"type\":\"address\"}],\"internalType\":\"structTermsOfServiceAllowListConfig\",\"name\":\"config\",\"type\":\"tuple\"}],\"name\":\"updateConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", - Bin: "0x60806040523480156200001157600080fd5b5060405162001a1e38038062001a1e8339810160408190526200003491620004d9565b33806000816200008b5760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000be57620000be81620001d4565b505050620000d2836200027f60201b60201c565b60005b8251811015620001255762000111838281518110620000f857620000f8620005a8565b602002602001015160026200030660201b90919060201c565b506200011d81620005be565b9050620000d5565b5060005b8151811015620001ca57620001658282815181106200014c576200014c620005a8565b602002602001015160026200032660201b90919060201c565b156200018457604051638129bbcd60e01b815260040160405180910390fd5b620001b68282815181106200019d576200019d620005a8565b602002602001015160046200030660201b90919060201c565b50620001c281620005be565b905062000129565b50505050620005e6565b336001600160a01b038216036200022e5760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640162000082565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b6200028962000349565b805160068054602080850180516001600160a81b0319909316941515610100600160a81b03198116959095176101006001600160a01b039485160217909355604080519485529251909116908301527f0d22b8a99f411b3dd338c961284f608489ca0dab9cdad17366a343c361bcf80a910160405180910390a150565b60006200031d836001600160a01b038416620003a7565b90505b92915050565b6001600160a01b038116600090815260018301602052604081205415156200031d565b6000546001600160a01b03163314620003a55760405162461bcd60e51b815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e657200000000000000000000604482015260640162000082565b565b6000818152600183016020526040812054620003f05750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915562000320565b50600062000320565b634e487b7160e01b600052604160045260246000fd5b80516001600160a01b03811681146200042757600080fd5b919050565b600082601f8301126200043e57600080fd5b815160206001600160401b03808311156200045d576200045d620003f9565b8260051b604051601f19603f83011681018181108482111715620004855762000485620003f9565b604052938452858101830193838101925087851115620004a457600080fd5b83870191505b84821015620004ce57620004be826200040f565b83529183019190830190620004aa565b979650505050505050565b60008060008385036080811215620004f057600080fd5b6040811215620004ff57600080fd5b50604080519081016001600160401b038082118383101715620005265762000526620003f9565b816040528651915081151582146200053d57600080fd5b8183526200054e602088016200040f565b60208401526040870151929550808311156200056957600080fd5b62000577888489016200042c565b945060608701519250808311156200058e57600080fd5b50506200059e868287016200042c565b9150509250925092565b634e487b7160e01b600052603260045260246000fd5b600060018201620005df57634e487b7160e01b600052601160045260246000fd5b5060010190565b61142880620005f66000396000f3fe608060405234801561001057600080fd5b506004361061011b5760003560e01c8063817ef62e116100b2578063a39b06e311610081578063c3f909d411610066578063c3f909d4146102c3578063cc7ebf4914610322578063f2fde38b1461032a57600080fd5b8063a39b06e314610237578063a5e1d61d146102b057600080fd5b8063817ef62e146101e157806382184c7b146101e957806389f9a2c4146101fc5780638da5cb5b1461020f57600080fd5b80633908c4d4116100ee5780633908c4d41461018e57806347663acb146101a35780636b14daf8146101b657806379ba5097146101d957600080fd5b806301a05958146101205780630a8c9c2414610146578063181f5a771461016657806320229a861461017b575b600080fd5b61012861033d565b60405167ffffffffffffffff90911681526020015b60405180910390f35b610159610154366004610fc4565b61034e565b60405161013d9190610ff7565b61016e6104aa565b60405161013d9190611051565b610159610189366004610fc4565b6104c6565b6101a161019c3660046110e1565b61062c565b005b6101a16101b1366004611142565b6108d7565b6101c96101c436600461115d565b610938565b604051901515815260200161013d565b6101a1610962565b610159610a64565b6101a16101f7366004611142565b610a70565b6101a161020a36600461120f565b610ad6565b60005460405173ffffffffffffffffffffffffffffffffffffffff909116815260200161013d565b6102a2610245366004611298565b6040517fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606084811b8216602084015283901b16603482015260009060480160405160208183030381529060405280519060200120905092915050565b60405190815260200161013d565b6101c96102be366004611142565b610b91565b60408051808201825260008082526020918201528151808301835260065460ff8116151580835273ffffffffffffffffffffffffffffffffffffffff61010090920482169284019283528451908152915116918101919091520161013d565b610128610bb1565b6101a1610338366004611142565b610bbd565b60006103496004610bd1565b905090565b60608167ffffffffffffffff168367ffffffffffffffff16118061038557506103776002610bd1565b8267ffffffffffffffff1610155b156103bc576040517f8129bbcd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6103c683836112f1565b6103d1906001611312565b67ffffffffffffffff1667ffffffffffffffff8111156103f3576103f36111e0565b60405190808252806020026020018201604052801561041c578160200160208202803683370190505b50905060005b61042c84846112f1565b67ffffffffffffffff1681116104a25761045b6104538267ffffffffffffffff8716611333565b600290610bdb565b82828151811061046d5761046d611346565b73ffffffffffffffffffffffffffffffffffffffff9092166020928302919091019091015261049b81611375565b9050610422565b505b92915050565b6040518060600160405280602c81526020016113f0602c913981565b60608167ffffffffffffffff168367ffffffffffffffff1611806104fd57506104ef6004610bd1565b8267ffffffffffffffff1610155b8061050f575061050d6004610bd1565b155b15610546576040517f8129bbcd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61055083836112f1565b61055b906001611312565b67ffffffffffffffff1667ffffffffffffffff81111561057d5761057d6111e0565b6040519080825280602002602001820160405280156105a6578160200160208202803683370190505b50905060005b6105b684846112f1565b67ffffffffffffffff1681116104a2576105e56105dd8267ffffffffffffffff8716611333565b600490610bdb565b8282815181106105f7576105f7611346565b73ffffffffffffffffffffffffffffffffffffffff9092166020928302919091019091015261062581611375565b90506105ac565b610637600485610be7565b1561066e576040517f62b7a34d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60408051606087811b7fffffffffffffffffffffffffffffffffffffffff0000000000000000000000009081166020808501919091529188901b16603483015282516028818403018152604890920190925280519101206000906040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c810191909152605c01604080518083037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe001815282825280516020918201206006546000855291840180845281905260ff8616928401929092526060830187905260808301869052909250610100900473ffffffffffffffffffffffffffffffffffffffff169060019060a0016020604051602081039080840390855afa1580156107a2573d6000803e3d6000fd5b5050506020604051035173ffffffffffffffffffffffffffffffffffffffff16146107f9576040517f8baa579f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b3373ffffffffffffffffffffffffffffffffffffffff861614158061083e57503373ffffffffffffffffffffffffffffffffffffffff87161480159061083e5750333b155b15610875576040517f381cfcbd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610880600286610c16565b156108cf5760405173ffffffffffffffffffffffffffffffffffffffff861681527f87286ad1f399c8e82bf0c4ef4fcdc570ea2e1e92176e5c848b6413545b885db49060200160405180910390a15b505050505050565b6108df610c38565b6108ea600482610cbb565b5060405173ffffffffffffffffffffffffffffffffffffffff821681527f28bbd0761309a99e8fb5e5d02ada0b7b2db2e5357531ff5dbfc205c3f5b6592b906020015b60405180910390a150565b60065460009060ff1661094d5750600161095b565b610958600285610be7565b90505b9392505050565b60015473ffffffffffffffffffffffffffffffffffffffff1633146109e8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e65720000000000000000000060448201526064015b60405180910390fd5b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b60606103496002610cdd565b610a78610c38565b610a83600282610cbb565b50610a8f600482610c16565b5060405173ffffffffffffffffffffffffffffffffffffffff821681527f337cd0f3f594112b6d830afb510072d3b08556b446514f73b8109162fd1151e19060200161092d565b610ade610c38565b805160068054602080850180517fffffffffffffffffffffff0000000000000000000000000000000000000000009093169415157fffffffffffffffffffffff0000000000000000000000000000000000000000ff81169590951761010073ffffffffffffffffffffffffffffffffffffffff9485160217909355604080519485529251909116908301527f0d22b8a99f411b3dd338c961284f608489ca0dab9cdad17366a343c361bcf80a910161092d565b60065460009060ff16610ba657506000919050565b6104a4600483610be7565b60006103496002610bd1565b610bc5610c38565b610bce81610cea565b50565b60006104a4825490565b600061095b8383610ddf565b73ffffffffffffffffffffffffffffffffffffffff81166000908152600183016020526040812054151561095b565b600061095b8373ffffffffffffffffffffffffffffffffffffffff8416610e09565b60005473ffffffffffffffffffffffffffffffffffffffff163314610cb9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e65720000000000000000000060448201526064016109df565b565b600061095b8373ffffffffffffffffffffffffffffffffffffffff8416610e58565b6060600061095b83610f4b565b3373ffffffffffffffffffffffffffffffffffffffff821603610d69576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c6600000000000000000060448201526064016109df565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b6000826000018281548110610df657610df6611346565b9060005260206000200154905092915050565b6000818152600183016020526040812054610e50575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556104a4565b5060006104a4565b60008181526001830160205260408120548015610f41576000610e7c6001836113ad565b8554909150600090610e90906001906113ad565b9050818114610ef5576000866000018281548110610eb057610eb0611346565b9060005260206000200154905080876000018481548110610ed357610ed3611346565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080610f0657610f066113c0565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506104a4565b60009150506104a4565b606081600001805480602002602001604051908101604052809291908181526020018280548015610f9b57602002820191906000526020600020905b815481526020019060010190808311610f87575b50505050509050919050565b803567ffffffffffffffff81168114610fbf57600080fd5b919050565b60008060408385031215610fd757600080fd5b610fe083610fa7565b9150610fee60208401610fa7565b90509250929050565b6020808252825182820181905260009190848201906040850190845b8181101561104557835173ffffffffffffffffffffffffffffffffffffffff1683529284019291840191600101611013565b50909695505050505050565b600060208083528351808285015260005b8181101561107e57858101830151858201604001528201611062565b5060006040828601015260407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8301168501019250505092915050565b803573ffffffffffffffffffffffffffffffffffffffff81168114610fbf57600080fd5b600080600080600060a086880312156110f957600080fd5b611102866110bd565b9450611110602087016110bd565b93506040860135925060608601359150608086013560ff8116811461113457600080fd5b809150509295509295909350565b60006020828403121561115457600080fd5b61095b826110bd565b60008060006040848603121561117257600080fd5b61117b846110bd565b9250602084013567ffffffffffffffff8082111561119857600080fd5b818601915086601f8301126111ac57600080fd5b8135818111156111bb57600080fd5b8760208285010111156111cd57600080fd5b6020830194508093505050509250925092565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60006040828403121561122157600080fd5b6040516040810181811067ffffffffffffffff8211171561126b577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040528235801515811461127e57600080fd5b815261128c602084016110bd565b60208201529392505050565b600080604083850312156112ab57600080fd5b6112b4836110bd565b9150610fee602084016110bd565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b67ffffffffffffffff8281168282160390808211156104a2576104a26112c2565b67ffffffffffffffff8181168382160190808211156104a2576104a26112c2565b808201808211156104a4576104a46112c2565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036113a6576113a66112c2565b5060010190565b818103818111156104a4576104a46112c2565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fdfe46756e6374696f6e73205465726d73206f66205365727669636520416c6c6f77204c6973742076312e312e30a164736f6c6343000813000a", + ABI: "[{\"inputs\":[{\"components\":[{\"internalType\":\"bool\",\"name\":\"enabled\",\"type\":\"bool\"},{\"internalType\":\"address\",\"name\":\"signerPublicKey\",\"type\":\"address\"}],\"internalType\":\"structTermsOfServiceAllowListConfig\",\"name\":\"config\",\"type\":\"tuple\"},{\"internalType\":\"address[]\",\"name\":\"initialAllowedSenders\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"initialBlockedSenders\",\"type\":\"address[]\"},{\"internalType\":\"address\",\"name\":\"previousToSContract\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"InvalidCalldata\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidSignature\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidUsage\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NoPreviousToSContract\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RecipientIsBlocked\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"}],\"name\":\"AddedAccess\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"}],\"name\":\"BlockedAccess\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"bool\",\"name\":\"enabled\",\"type\":\"bool\"},{\"internalType\":\"address\",\"name\":\"signerPublicKey\",\"type\":\"address\"}],\"indexed\":false,\"internalType\":\"structTermsOfServiceAllowListConfig\",\"name\":\"config\",\"type\":\"tuple\"}],\"name\":\"ConfigUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"}],\"name\":\"UnblockedAccess\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"acceptor\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"}],\"name\":\"acceptTermsOfService\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"blockSender\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAllAllowedSenders\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAllowedSendersCount\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"allowedSenderIdxStart\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"allowedSenderIdxEnd\",\"type\":\"uint64\"}],\"name\":\"getAllowedSendersInRange\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"allowedSenders\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getBlockedSendersCount\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockedSenderIdxStart\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"blockedSenderIdxEnd\",\"type\":\"uint64\"}],\"name\":\"getBlockedSendersInRange\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"blockedSenders\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getConfig\",\"outputs\":[{\"components\":[{\"internalType\":\"bool\",\"name\":\"enabled\",\"type\":\"bool\"},{\"internalType\":\"address\",\"name\":\"signerPublicKey\",\"type\":\"address\"}],\"internalType\":\"structTermsOfServiceAllowListConfig\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"acceptor\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"}],\"name\":\"getMessage\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"hasAccess\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"isBlockedSender\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"previousSendersToAdd\",\"type\":\"address[]\"}],\"name\":\"migratePreviouslyAllowedSenders\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"unblockSender\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bool\",\"name\":\"enabled\",\"type\":\"bool\"},{\"internalType\":\"address\",\"name\":\"signerPublicKey\",\"type\":\"address\"}],\"internalType\":\"structTermsOfServiceAllowListConfig\",\"name\":\"config\",\"type\":\"tuple\"}],\"name\":\"updateConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", + Bin: "0x60806040523480156200001157600080fd5b5060405162001d5338038062001d53833981016040819052620000349162000525565b33806000816200008b5760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000be57620000be81620001f5565b505050620000d284620002a060201b60201c565b60005b8351811015620001255762000111848281518110620000f857620000f8620005eb565b602002602001015160036200032760201b90919060201c565b506200011d8162000601565b9050620000d5565b5060005b8251811015620001ca57620001658382815181106200014c576200014c620005eb565b602002602001015160036200034760201b90919060201c565b156200018457604051638129bbcd60e01b815260040160405180910390fd5b620001b68382815181106200019d576200019d620005eb565b602002602001015160056200032760201b90919060201c565b50620001c28162000601565b905062000129565b50600280546001600160a01b0319166001600160a01b03929092169190911790555062000629915050565b336001600160a01b038216036200024f5760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640162000082565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b620002aa6200036a565b805160078054602080850180516001600160a81b0319909316941515610100600160a81b03198116959095176101006001600160a01b039485160217909355604080519485529251909116908301527f0d22b8a99f411b3dd338c961284f608489ca0dab9cdad17366a343c361bcf80a910160405180910390a150565b60006200033e836001600160a01b038416620003c8565b90505b92915050565b6001600160a01b038116600090815260018301602052604081205415156200033e565b6000546001600160a01b03163314620003c65760405162461bcd60e51b815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e657200000000000000000000604482015260640162000082565b565b6000818152600183016020526040812054620004115750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915562000341565b50600062000341565b634e487b7160e01b600052604160045260246000fd5b604080519081016001600160401b03811182821017156200045557620004556200041a565b60405290565b80516001600160a01b03811681146200047357600080fd5b919050565b600082601f8301126200048a57600080fd5b815160206001600160401b0380831115620004a957620004a96200041a565b8260051b604051601f19603f83011681018181108482111715620004d157620004d16200041a565b604052938452858101830193838101925087851115620004f057600080fd5b83870191505b848210156200051a576200050a826200045b565b83529183019190830190620004f6565b979650505050505050565b60008060008084860360a08112156200053d57600080fd5b60408112156200054c57600080fd5b506200055762000430565b855180151581146200056857600080fd5b815262000578602087016200045b565b602082015260408601519094506001600160401b03808211156200059b57600080fd5b620005a98883890162000478565b94506060870151915080821115620005c057600080fd5b50620005cf8782880162000478565b925050620005e0608086016200045b565b905092959194509250565b634e487b7160e01b600052603260045260246000fd5b6000600182016200062257634e487b7160e01b600052601160045260246000fd5b5060010190565b61171a80620006396000396000f3fe608060405234801561001057600080fd5b50600436106101365760003560e01c8063817ef62e116100b2578063a39b06e311610081578063c3f909d411610066578063c3f909d4146102f1578063cc7ebf4914610350578063f2fde38b1461035857600080fd5b8063a39b06e314610265578063a5e1d61d146102de57600080fd5b8063817ef62e1461020f57806382184c7b1461021757806389f9a2c41461022a5780638da5cb5b1461023d57600080fd5b80633908c4d4116101095780634e10a5b3116100ee5780634e10a5b3146101d15780636b14daf8146101e457806379ba50971461020757600080fd5b80633908c4d4146101a957806347663acb146101be57600080fd5b806301a059581461013b5780630a8c9c2414610161578063181f5a771461018157806320229a8614610196575b600080fd5b61014361036b565b60405167ffffffffffffffff90911681526020015b60405180910390f35b61017461016f3660046111bb565b61037c565b60405161015891906111ee565b6101896104d8565b6040516101589190611248565b6101746101a43660046111bb565b6104f4565b6101bc6101b73660046112d8565b61065a565b005b6101bc6101cc366004611339565b610905565b6101bc6101df3660046113d2565b610966565b6101f76101f236600461147f565b610b2f565b6040519015158152602001610158565b6101bc610b59565b610174610c5b565b6101bc610225366004611339565b610c67565b6101bc610238366004611510565b610ccd565b60005460405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610158565b6102d061027336600461156d565b6040517fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606084811b8216602084015283901b16603482015260009060480160405160208183030381529060405280519060200120905092915050565b604051908152602001610158565b6101f76102ec366004611339565b610d88565b60408051808201825260008082526020918201528151808301835260075460ff8116151580835273ffffffffffffffffffffffffffffffffffffffff610100909204821692840192835284519081529151169181019190915201610158565b610143610da8565b6101bc610366366004611339565b610db4565b60006103776005610dc8565b905090565b60608167ffffffffffffffff168367ffffffffffffffff1611806103b357506103a56003610dc8565b8267ffffffffffffffff1610155b156103ea576040517f8129bbcd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6103f483836115c6565b6103ff9060016115e7565b67ffffffffffffffff1667ffffffffffffffff81111561042157610421611354565b60405190808252806020026020018201604052801561044a578160200160208202803683370190505b50905060005b61045a84846115c6565b67ffffffffffffffff1681116104d0576104896104818267ffffffffffffffff8716611608565b600390610dd2565b82828151811061049b5761049b61161b565b73ffffffffffffffffffffffffffffffffffffffff909216602092830291909101909101526104c98161164a565b9050610450565b505b92915050565b6040518060600160405280602c81526020016116e2602c913981565b60608167ffffffffffffffff168367ffffffffffffffff16118061052b575061051d6005610dc8565b8267ffffffffffffffff1610155b8061053d575061053b6005610dc8565b155b15610574576040517f8129bbcd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61057e83836115c6565b6105899060016115e7565b67ffffffffffffffff1667ffffffffffffffff8111156105ab576105ab611354565b6040519080825280602002602001820160405280156105d4578160200160208202803683370190505b50905060005b6105e484846115c6565b67ffffffffffffffff1681116104d05761061361060b8267ffffffffffffffff8716611608565b600590610dd2565b8282815181106106255761062561161b565b73ffffffffffffffffffffffffffffffffffffffff909216602092830291909101909101526106538161164a565b90506105da565b610665600585610dde565b1561069c576040517f62b7a34d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60408051606087811b7fffffffffffffffffffffffffffffffffffffffff0000000000000000000000009081166020808501919091529188901b16603483015282516028818403018152604890920190925280519101206000906040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c810191909152605c01604080518083037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe001815282825280516020918201206007546000855291840180845281905260ff8616928401929092526060830187905260808301869052909250610100900473ffffffffffffffffffffffffffffffffffffffff169060019060a0016020604051602081039080840390855afa1580156107d0573d6000803e3d6000fd5b5050506020604051035173ffffffffffffffffffffffffffffffffffffffff1614610827576040517f8baa579f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b3373ffffffffffffffffffffffffffffffffffffffff861614158061086c57503373ffffffffffffffffffffffffffffffffffffffff87161480159061086c5750333b155b156108a3576040517f381cfcbd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6108ae600386610e0d565b156108fd5760405173ffffffffffffffffffffffffffffffffffffffff861681527f87286ad1f399c8e82bf0c4ef4fcdc570ea2e1e92176e5c848b6413545b885db49060200160405180910390a15b505050505050565b61090d610e2f565b610918600582610eb2565b5060405173ffffffffffffffffffffffffffffffffffffffff821681527f28bbd0761309a99e8fb5e5d02ada0b7b2db2e5357531ff5dbfc205c3f5b6592b906020015b60405180910390a150565b61096e610e2f565b60025473ffffffffffffffffffffffffffffffffffffffff166109bd576040517fb25f406700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60025473ffffffffffffffffffffffffffffffffffffffff1660005b8251811015610b2a578173ffffffffffffffffffffffffffffffffffffffff16636b14daf8848381518110610a1057610a1061161b565b6020908102919091010151604080517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b16815273ffffffffffffffffffffffffffffffffffffffff9092166004830152602482015260006044820152606401602060405180830381865afa158015610a91573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ab59190611682565b15610b1a57610ae7838281518110610acf57610acf61161b565b60200260200101516005610dde90919063ffffffff16565b610b1a57610b18838281518110610b0057610b0061161b565b60200260200101516003610e0d90919063ffffffff16565b505b610b238161164a565b90506109d9565b505050565b60075460009060ff16610b4457506001610b52565b610b4f600385610dde565b90505b9392505050565b60015473ffffffffffffffffffffffffffffffffffffffff163314610bdf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e65720000000000000000000060448201526064015b60405180910390fd5b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b60606103776003610ed4565b610c6f610e2f565b610c7a600382610eb2565b50610c86600582610e0d565b5060405173ffffffffffffffffffffffffffffffffffffffff821681527f337cd0f3f594112b6d830afb510072d3b08556b446514f73b8109162fd1151e19060200161095b565b610cd5610e2f565b805160078054602080850180517fffffffffffffffffffffff0000000000000000000000000000000000000000009093169415157fffffffffffffffffffffff0000000000000000000000000000000000000000ff81169590951761010073ffffffffffffffffffffffffffffffffffffffff9485160217909355604080519485529251909116908301527f0d22b8a99f411b3dd338c961284f608489ca0dab9cdad17366a343c361bcf80a910161095b565b60075460009060ff16610d9d57506000919050565b6104d2600583610dde565b60006103776003610dc8565b610dbc610e2f565b610dc581610ee1565b50565b60006104d2825490565b6000610b528383610fd6565b73ffffffffffffffffffffffffffffffffffffffff811660009081526001830160205260408120541515610b52565b6000610b528373ffffffffffffffffffffffffffffffffffffffff8416611000565b60005473ffffffffffffffffffffffffffffffffffffffff163314610eb0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e6572000000000000000000006044820152606401610bd6565b565b6000610b528373ffffffffffffffffffffffffffffffffffffffff841661104f565b60606000610b5283611142565b3373ffffffffffffffffffffffffffffffffffffffff821603610f60576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c660000000000000000006044820152606401610bd6565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b6000826000018281548110610fed57610fed61161b565b9060005260206000200154905092915050565b6000818152600183016020526040812054611047575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556104d2565b5060006104d2565b6000818152600183016020526040812054801561113857600061107360018361169f565b85549091506000906110879060019061169f565b90508181146110ec5760008660000182815481106110a7576110a761161b565b90600052602060002001549050808760000184815481106110ca576110ca61161b565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806110fd576110fd6116b2565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506104d2565b60009150506104d2565b60608160000180548060200260200160405190810160405280929190818152602001828054801561119257602002820191906000526020600020905b81548152602001906001019080831161117e575b50505050509050919050565b803567ffffffffffffffff811681146111b657600080fd5b919050565b600080604083850312156111ce57600080fd5b6111d78361119e565b91506111e56020840161119e565b90509250929050565b6020808252825182820181905260009190848201906040850190845b8181101561123c57835173ffffffffffffffffffffffffffffffffffffffff168352928401929184019160010161120a565b50909695505050505050565b600060208083528351808285015260005b8181101561127557858101830151858201604001528201611259565b5060006040828601015260407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8301168501019250505092915050565b803573ffffffffffffffffffffffffffffffffffffffff811681146111b657600080fd5b600080600080600060a086880312156112f057600080fd5b6112f9866112b4565b9450611307602087016112b4565b93506040860135925060608601359150608086013560ff8116811461132b57600080fd5b809150509295509295909350565b60006020828403121561134b57600080fd5b610b52826112b4565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff811182821017156113ca576113ca611354565b604052919050565b600060208083850312156113e557600080fd5b823567ffffffffffffffff808211156113fd57600080fd5b818501915085601f83011261141157600080fd5b81358181111561142357611423611354565b8060051b9150611434848301611383565b818152918301840191848101908884111561144e57600080fd5b938501935b8385101561147357611464856112b4565b82529385019390850190611453565b98975050505050505050565b60008060006040848603121561149457600080fd5b61149d846112b4565b9250602084013567ffffffffffffffff808211156114ba57600080fd5b818601915086601f8301126114ce57600080fd5b8135818111156114dd57600080fd5b8760208285010111156114ef57600080fd5b6020830194508093505050509250925092565b8015158114610dc557600080fd5b60006040828403121561152257600080fd5b6040516040810181811067ffffffffffffffff8211171561154557611545611354565b604052823561155381611502565b8152611561602084016112b4565b60208201529392505050565b6000806040838503121561158057600080fd5b611589836112b4565b91506111e5602084016112b4565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b67ffffffffffffffff8281168282160390808211156104d0576104d0611597565b67ffffffffffffffff8181168382160190808211156104d0576104d0611597565b808201808211156104d2576104d2611597565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361167b5761167b611597565b5060010190565b60006020828403121561169457600080fd5b8151610b5281611502565b818103818111156104d2576104d2611597565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fdfe46756e6374696f6e73205465726d73206f66205365727669636520416c6c6f77204c6973742076312e312e31a164736f6c6343000813000a", } var TermsOfServiceAllowListABI = TermsOfServiceAllowListMetaData.ABI var TermsOfServiceAllowListBin = TermsOfServiceAllowListMetaData.Bin -func DeployTermsOfServiceAllowList(auth *bind.TransactOpts, backend bind.ContractBackend, config TermsOfServiceAllowListConfig, initialAllowedSenders []common.Address, initialBlockedSenders []common.Address) (common.Address, *types.Transaction, *TermsOfServiceAllowList, error) { +func DeployTermsOfServiceAllowList(auth *bind.TransactOpts, backend bind.ContractBackend, config TermsOfServiceAllowListConfig, initialAllowedSenders []common.Address, initialBlockedSenders []common.Address, previousToSContract common.Address) (common.Address, *types.Transaction, *TermsOfServiceAllowList, error) { parsed, err := TermsOfServiceAllowListMetaData.GetAbi() if err != nil { return common.Address{}, nil, nil, err @@ -53,7 +53,7 @@ func DeployTermsOfServiceAllowList(auth *bind.TransactOpts, backend bind.Contrac return common.Address{}, nil, nil, errors.New("GetABI returned nil") } - address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(TermsOfServiceAllowListBin), backend, config, initialAllowedSenders, initialBlockedSenders) + address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(TermsOfServiceAllowListBin), backend, config, initialAllowedSenders, initialBlockedSenders, previousToSContract) if err != nil { return common.Address{}, nil, nil, err } @@ -454,6 +454,18 @@ func (_TermsOfServiceAllowList *TermsOfServiceAllowListTransactorSession) BlockS return _TermsOfServiceAllowList.Contract.BlockSender(&_TermsOfServiceAllowList.TransactOpts, sender) } +func (_TermsOfServiceAllowList *TermsOfServiceAllowListTransactor) MigratePreviouslyAllowedSenders(opts *bind.TransactOpts, previousSendersToAdd []common.Address) (*types.Transaction, error) { + return _TermsOfServiceAllowList.contract.Transact(opts, "migratePreviouslyAllowedSenders", previousSendersToAdd) +} + +func (_TermsOfServiceAllowList *TermsOfServiceAllowListSession) MigratePreviouslyAllowedSenders(previousSendersToAdd []common.Address) (*types.Transaction, error) { + return _TermsOfServiceAllowList.Contract.MigratePreviouslyAllowedSenders(&_TermsOfServiceAllowList.TransactOpts, previousSendersToAdd) +} + +func (_TermsOfServiceAllowList *TermsOfServiceAllowListTransactorSession) MigratePreviouslyAllowedSenders(previousSendersToAdd []common.Address) (*types.Transaction, error) { + return _TermsOfServiceAllowList.Contract.MigratePreviouslyAllowedSenders(&_TermsOfServiceAllowList.TransactOpts, previousSendersToAdd) +} + func (_TermsOfServiceAllowList *TermsOfServiceAllowListTransactor) TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) { return _TermsOfServiceAllowList.contract.Transact(opts, "transferOwnership", to) } @@ -1307,6 +1319,8 @@ type TermsOfServiceAllowListInterface interface { BlockSender(opts *bind.TransactOpts, sender common.Address) (*types.Transaction, error) + MigratePreviouslyAllowedSenders(opts *bind.TransactOpts, previousSendersToAdd []common.Address) (*types.Transaction, error) + TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) UnblockSender(opts *bind.TransactOpts, sender common.Address) (*types.Transaction, error) diff --git a/core/gethwrappers/functions/generated/functions_coordinator/functions_coordinator.go b/core/gethwrappers/functions/generated/functions_coordinator/functions_coordinator.go index 286cb1befd6..d05570282bf 100644 --- a/core/gethwrappers/functions/generated/functions_coordinator/functions_coordinator.go +++ b/core/gethwrappers/functions/generated/functions_coordinator/functions_coordinator.go @@ -43,6 +43,7 @@ type FunctionsBillingConfig struct { RequestTimeoutSeconds uint32 DonFeeCentsUsd uint16 OperationFeeCentsUsd uint16 + TransmitTxSizeBytes uint16 } type FunctionsResponseCommitment struct { @@ -74,8 +75,8 @@ type FunctionsResponseRequestMeta struct { } var FunctionsCoordinatorMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"router\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"uint32\",\"name\":\"fulfillmentGasPriceOverEstimationBP\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"feedStalenessSeconds\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"gasOverheadBeforeCallback\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"gasOverheadAfterCallback\",\"type\":\"uint32\"},{\"internalType\":\"uint40\",\"name\":\"minimumEstimateGasPriceWei\",\"type\":\"uint40\"},{\"internalType\":\"uint16\",\"name\":\"maxSupportedRequestDataVersion\",\"type\":\"uint16\"},{\"internalType\":\"uint64\",\"name\":\"fallbackUsdPerUnitLink\",\"type\":\"uint64\"},{\"internalType\":\"uint8\",\"name\":\"fallbackUsdPerUnitLinkDecimals\",\"type\":\"uint8\"},{\"internalType\":\"uint224\",\"name\":\"fallbackNativePerUnitLink\",\"type\":\"uint224\"},{\"internalType\":\"uint32\",\"name\":\"requestTimeoutSeconds\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"donFeeCentsUsd\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"operationFeeCentsUsd\",\"type\":\"uint16\"}],\"internalType\":\"structFunctionsBillingConfig\",\"name\":\"config\",\"type\":\"tuple\"},{\"internalType\":\"address\",\"name\":\"linkToNativeFeed\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"linkToUsdFeed\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"EmptyPublicKey\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InconsistentReportData\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InsufficientBalance\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidCalldata\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"message\",\"type\":\"string\"}],\"name\":\"InvalidConfig\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"int256\",\"name\":\"linkWei\",\"type\":\"int256\"}],\"name\":\"InvalidLinkWeiPrice\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidSubscription\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"int256\",\"name\":\"usdLink\",\"type\":\"int256\"}],\"name\":\"InvalidUsdLinkPrice\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"MustBeSubOwner\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NoTransmittersSet\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCallableByRouter\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCallableByRouterOwner\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"PaymentTooLarge\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"message\",\"type\":\"string\"}],\"name\":\"ReportInvalid\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RouterMustBeSet\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UnauthorizedPublicKeyChange\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UnauthorizedSender\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UnsupportedRequestDataVersion\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"requestId\",\"type\":\"bytes32\"}],\"name\":\"CommitmentDeleted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"previousConfigBlockNumber\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"configCount\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"signers\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"transmitters\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"f\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"onchainConfig\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"offchainConfigVersion\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"offchainConfig\",\"type\":\"bytes\"}],\"name\":\"ConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"uint32\",\"name\":\"fulfillmentGasPriceOverEstimationBP\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"feedStalenessSeconds\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"gasOverheadBeforeCallback\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"gasOverheadAfterCallback\",\"type\":\"uint32\"},{\"internalType\":\"uint40\",\"name\":\"minimumEstimateGasPriceWei\",\"type\":\"uint40\"},{\"internalType\":\"uint16\",\"name\":\"maxSupportedRequestDataVersion\",\"type\":\"uint16\"},{\"internalType\":\"uint64\",\"name\":\"fallbackUsdPerUnitLink\",\"type\":\"uint64\"},{\"internalType\":\"uint8\",\"name\":\"fallbackUsdPerUnitLinkDecimals\",\"type\":\"uint8\"},{\"internalType\":\"uint224\",\"name\":\"fallbackNativePerUnitLink\",\"type\":\"uint224\"},{\"internalType\":\"uint32\",\"name\":\"requestTimeoutSeconds\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"donFeeCentsUsd\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"operationFeeCentsUsd\",\"type\":\"uint16\"}],\"indexed\":false,\"internalType\":\"structFunctionsBillingConfig\",\"name\":\"config\",\"type\":\"tuple\"}],\"name\":\"ConfigUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"requestId\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"requestingContract\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"requestInitiator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"subscriptionId\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"subscriptionOwner\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"dataVersion\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"flags\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"callbackGasLimit\",\"type\":\"uint64\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"requestId\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"coordinator\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"estimatedTotalCostJuels\",\"type\":\"uint96\"},{\"internalType\":\"address\",\"name\":\"client\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"subscriptionId\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint72\",\"name\":\"adminFee\",\"type\":\"uint72\"},{\"internalType\":\"uint72\",\"name\":\"donFee\",\"type\":\"uint72\"},{\"internalType\":\"uint40\",\"name\":\"gasOverheadBeforeCallback\",\"type\":\"uint40\"},{\"internalType\":\"uint40\",\"name\":\"gasOverheadAfterCallback\",\"type\":\"uint40\"},{\"internalType\":\"uint32\",\"name\":\"timeoutTimestamp\",\"type\":\"uint32\"}],\"indexed\":false,\"internalType\":\"structFunctionsResponse.Commitment\",\"name\":\"commitment\",\"type\":\"tuple\"}],\"name\":\"OracleRequest\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"requestId\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"transmitter\",\"type\":\"address\"}],\"name\":\"OracleResponse\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"requestId\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"juelsPerGas\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"l1FeeShareWei\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"callbackCostJuels\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint72\",\"name\":\"donFeeJuels\",\"type\":\"uint72\"},{\"indexed\":false,\"internalType\":\"uint72\",\"name\":\"adminFeeJuels\",\"type\":\"uint72\"},{\"indexed\":false,\"internalType\":\"uint72\",\"name\":\"operationFeeJuels\",\"type\":\"uint72\"}],\"name\":\"RequestBilled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"epoch\",\"type\":\"uint32\"}],\"name\":\"Transmitted\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"requestId\",\"type\":\"bytes32\"}],\"name\":\"deleteCommitment\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"subscriptionId\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"uint32\",\"name\":\"callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint256\",\"name\":\"gasPriceWei\",\"type\":\"uint256\"}],\"name\":\"estimateCost\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"\",\"type\":\"uint96\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAdminFeeJuels\",\"outputs\":[{\"internalType\":\"uint72\",\"name\":\"\",\"type\":\"uint72\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getConfig\",\"outputs\":[{\"components\":[{\"internalType\":\"uint32\",\"name\":\"fulfillmentGasPriceOverEstimationBP\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"feedStalenessSeconds\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"gasOverheadBeforeCallback\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"gasOverheadAfterCallback\",\"type\":\"uint32\"},{\"internalType\":\"uint40\",\"name\":\"minimumEstimateGasPriceWei\",\"type\":\"uint40\"},{\"internalType\":\"uint16\",\"name\":\"maxSupportedRequestDataVersion\",\"type\":\"uint16\"},{\"internalType\":\"uint64\",\"name\":\"fallbackUsdPerUnitLink\",\"type\":\"uint64\"},{\"internalType\":\"uint8\",\"name\":\"fallbackUsdPerUnitLinkDecimals\",\"type\":\"uint8\"},{\"internalType\":\"uint224\",\"name\":\"fallbackNativePerUnitLink\",\"type\":\"uint224\"},{\"internalType\":\"uint32\",\"name\":\"requestTimeoutSeconds\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"donFeeCentsUsd\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"operationFeeCentsUsd\",\"type\":\"uint16\"}],\"internalType\":\"structFunctionsBillingConfig\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"getDONFeeJuels\",\"outputs\":[{\"internalType\":\"uint72\",\"name\":\"\",\"type\":\"uint72\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getDONPublicKey\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getOperationFeeJuels\",\"outputs\":[{\"internalType\":\"uint72\",\"name\":\"\",\"type\":\"uint72\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getThresholdPublicKey\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getUsdPerUnitLink\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getWeiPerUnitLink\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestConfigDetails\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"configCount\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"blockNumber\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestConfigDigestAndEpoch\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"scanLogs\",\"type\":\"bool\"},{\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"internalType\":\"uint32\",\"name\":\"epoch\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"}],\"name\":\"oracleWithdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"oracleWithdrawAll\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"_signers\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"_transmitters\",\"type\":\"address[]\"},{\"internalType\":\"uint8\",\"name\":\"_f\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"_onchainConfig\",\"type\":\"bytes\"},{\"internalType\":\"uint64\",\"name\":\"_offchainConfigVersion\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"_offchainConfig\",\"type\":\"bytes\"}],\"name\":\"setConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"donPublicKey\",\"type\":\"bytes\"}],\"name\":\"setDONPublicKey\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"thresholdPublicKey\",\"type\":\"bytes\"}],\"name\":\"setThresholdPublicKey\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"bytes32\",\"name\":\"flags\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"requestingContract\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"availableBalance\",\"type\":\"uint96\"},{\"internalType\":\"uint72\",\"name\":\"adminFee\",\"type\":\"uint72\"},{\"internalType\":\"uint64\",\"name\":\"subscriptionId\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"initiatedRequests\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"dataVersion\",\"type\":\"uint16\"},{\"internalType\":\"uint64\",\"name\":\"completedRequests\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"subscriptionOwner\",\"type\":\"address\"}],\"internalType\":\"structFunctionsResponse.RequestMeta\",\"name\":\"request\",\"type\":\"tuple\"}],\"name\":\"startRequest\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"requestId\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"coordinator\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"estimatedTotalCostJuels\",\"type\":\"uint96\"},{\"internalType\":\"address\",\"name\":\"client\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"subscriptionId\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint72\",\"name\":\"adminFee\",\"type\":\"uint72\"},{\"internalType\":\"uint72\",\"name\":\"donFee\",\"type\":\"uint72\"},{\"internalType\":\"uint40\",\"name\":\"gasOverheadBeforeCallback\",\"type\":\"uint40\"},{\"internalType\":\"uint40\",\"name\":\"gasOverheadAfterCallback\",\"type\":\"uint40\"},{\"internalType\":\"uint32\",\"name\":\"timeoutTimestamp\",\"type\":\"uint32\"}],\"internalType\":\"structFunctionsResponse.Commitment\",\"name\":\"commitment\",\"type\":\"tuple\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32[3]\",\"name\":\"reportContext\",\"type\":\"bytes32[3]\"},{\"internalType\":\"bytes\",\"name\":\"report\",\"type\":\"bytes\"},{\"internalType\":\"bytes32[]\",\"name\":\"rs\",\"type\":\"bytes32[]\"},{\"internalType\":\"bytes32[]\",\"name\":\"ss\",\"type\":\"bytes32[]\"},{\"internalType\":\"bytes32\",\"name\":\"rawVs\",\"type\":\"bytes32\"}],\"name\":\"transmit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"transmitters\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint32\",\"name\":\"fulfillmentGasPriceOverEstimationBP\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"feedStalenessSeconds\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"gasOverheadBeforeCallback\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"gasOverheadAfterCallback\",\"type\":\"uint32\"},{\"internalType\":\"uint40\",\"name\":\"minimumEstimateGasPriceWei\",\"type\":\"uint40\"},{\"internalType\":\"uint16\",\"name\":\"maxSupportedRequestDataVersion\",\"type\":\"uint16\"},{\"internalType\":\"uint64\",\"name\":\"fallbackUsdPerUnitLink\",\"type\":\"uint64\"},{\"internalType\":\"uint8\",\"name\":\"fallbackUsdPerUnitLinkDecimals\",\"type\":\"uint8\"},{\"internalType\":\"uint224\",\"name\":\"fallbackNativePerUnitLink\",\"type\":\"uint224\"},{\"internalType\":\"uint32\",\"name\":\"requestTimeoutSeconds\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"donFeeCentsUsd\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"operationFeeCentsUsd\",\"type\":\"uint16\"}],\"internalType\":\"structFunctionsBillingConfig\",\"name\":\"config\",\"type\":\"tuple\"}],\"name\":\"updateConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", - Bin: "0x60a06040523480156200001157600080fd5b506040516200603a3803806200603a8339810160408190526200003491620004db565b83838383833380600081620000905760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000c357620000c3816200014e565b5050506001600160a01b038116620000ee57604051632530e88560e11b815260040160405180910390fd5b6001600160a01b03908116608052600c80546001600160601b03166c0100000000000000000000000085841602179055600d80546001600160a01b0319169183169190911790556200014083620001f9565b505050505050505062000742565b336001600160a01b03821603620001a85760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640162000087565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b620002036200039e565b80516008805460208401516040808601516060870151608088015160a089015160c08a015160e08b015160ff16600160f81b026001600160f81b036001600160401b03909216600160b81b02919091166001600160b81b0361ffff938416600160a81b0261ffff60a81b1964ffffffffff909616600160801b029590951666ffffffffffffff60801b1963ffffffff9788166c010000000000000000000000000263ffffffff60601b19998916680100000000000000000299909916600160401b600160801b03199b8916640100000000026001600160401b0319909d169e89169e909e179b909b17999099169b909b1795909517979097169590951717969096161792909217909255610100840151610120850151909316600160e01b026001600160e01b0390931692909217600955610140830151600a80546101608601518416620100000263ffffffff19919091169290931691909117919091179055517f2e2c8535dcc25459d519f2300c114d2d2128bf6399722d04eca078461a3bf33a906200039390839062000639565b60405180910390a150565b620003a8620003aa565b565b6000546001600160a01b03163314620003a85760405162461bcd60e51b815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e657200000000000000000000604482015260640162000087565b80516001600160a01b03811681146200041e57600080fd5b919050565b60405161018081016001600160401b03811182821017156200045557634e487b7160e01b600052604160045260246000fd5b60405290565b805163ffffffff811681146200041e57600080fd5b805164ffffffffff811681146200041e57600080fd5b805161ffff811681146200041e57600080fd5b80516001600160401b03811681146200041e57600080fd5b805160ff811681146200041e57600080fd5b80516001600160e01b03811681146200041e57600080fd5b6000806000808486036101e0811215620004f457600080fd5b620004ff8662000406565b945061018080601f19830112156200051657600080fd5b6200052062000423565b915062000530602088016200045b565b825262000540604088016200045b565b602083015262000553606088016200045b565b604083015262000566608088016200045b565b60608301526200057960a0880162000470565b60808301526200058c60c0880162000486565b60a08301526200059f60e0880162000499565b60c0830152610100620005b4818901620004b1565b60e0840152610120620005c9818a01620004c3565b828501526101409150620005df828a016200045b565b90840152610160620005f389820162000486565b8285015262000604838a0162000486565b90840152509093506200061d90506101a0860162000406565b91506200062e6101c0860162000406565b905092959194509250565b815163ffffffff1681526101808101602083015162000660602084018263ffffffff169052565b50604083015162000679604084018263ffffffff169052565b50606083015162000692606084018263ffffffff169052565b506080830151620006ac608084018264ffffffffff169052565b5060a0830151620006c360a084018261ffff169052565b5060c0830151620006df60c08401826001600160401b03169052565b5060e0830151620006f560e084018260ff169052565b50610100838101516001600160e01b0316908301526101208084015163ffffffff16908301526101408084015161ffff908116918401919091526101609384015116929091019190915290565b6080516158b2620007886000396000818161079c01528181610c7d01528181610f110152818161102701528181611b2d015281816129eb015261398401526158b26000f3fe608060405234801561001057600080fd5b50600436106101a35760003560e01c80638da5cb5b116100ee578063d227d24511610097578063e4ddcea611610071578063e4ddcea6146105d5578063f2f22ef1146105eb578063f2fde38b146105f3578063f6ea41f61461060657600080fd5b8063d227d2451461058a578063d328a91e146105ba578063e3d0e712146105c257600080fd5b8063b1dc65a4116100c8578063b1dc65a414610396578063ba9c924d146103a9578063c3f909d4146103bc57600080fd5b80638da5cb5b1461032e578063a631571e14610356578063afcb95d71461037657600080fd5b80637d4807871161015057806381f1b9381161012a57806381f1b938146102a657806381ff7048146102ae57806385b214cf1461031b57600080fd5b80637d480787146102765780637f15e1661461027e578063814118341461029157600080fd5b806366316d8d1161018157806366316d8d1461023c5780637212762f1461024f57806379ba50971461026e57600080fd5b8063083a5466146101a8578063181f5a77146101bd578063626f458c1461020f575b600080fd5b6101bb6101b636600461402b565b61060e565b005b6101f96040518060400160405280601c81526020017f46756e6374696f6e7320436f6f7264696e61746f722076312e332e300000000081525081565b60405161020691906140db565b60405180910390f35b61022261021d366004614248565b610663565b60405168ffffffffffffffffff9091168152602001610206565b6101bb61024a3660046142cf565b6106a0565b610257610859565b6040805192835260ff909116602083015201610206565b6101bb610a6c565b6101bb610b69565b6101bb61028c36600461402b565b610d69565b610299610db9565b6040516102069190614359565b6101f9610e28565b6102f860015460025463ffffffff74010000000000000000000000000000000000000000830481169378010000000000000000000000000000000000000000000000009093041691565b6040805163ffffffff948516815293909216602084015290820152606001610206565b6101bb61032936600461436c565b610ef9565b60005460405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610206565b610369610364366004614385565b610fb6565b60405161020691906144da565b604080516001815260006020820181905291810191909152606001610206565b6101bb6103a436600461452e565b611247565b6101bb6103b7366004614699565b61185e565b61057d6040805161018081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e0810182905261010081018290526101208101829052610140810182905261016081019190915250604080516101808101825260085463ffffffff80821683526401000000008204811660208401526801000000000000000082048116938301939093526c01000000000000000000000000810483166060830152700100000000000000000000000000000000810464ffffffffff1660808301527501000000000000000000000000000000000000000000810461ffff90811660a084015277010000000000000000000000000000000000000000000000820467ffffffffffffffff1660c08401527f010000000000000000000000000000000000000000000000000000000000000090910460ff1660e08301526009547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff81166101008401527c01000000000000000000000000000000000000000000000000000000009004909216610120820152600a5480831661014083015262010000900490911661016082015290565b6040516102069190614785565b61059d6105983660046148a2565b611b29565b6040516bffffffffffffffffffffffff9091168152602001610206565b6101f9611c97565b6101bb6105d03660046149aa565b611cee565b6105dd61286a565b604051908152602001610206565b6102226129ae565b6101bb610601366004614a77565b6129d3565b6102226129e7565b610616612a78565b6000819003610651576040517f4f42be3d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600f61065e828483614b27565b505050565b600a5460009061069a9060649061067d9061ffff16612afb565b6106879190614ca0565b6bffffffffffffffffffffffff16612b48565b92915050565b6106a8612be7565b806bffffffffffffffffffffffff166000036106e25750336000908152600b60205260409020546bffffffffffffffffffffffff1661073c565b336000908152600b60205260409020546bffffffffffffffffffffffff8083169116101561073c576040517ff4d678b800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b336000908152600b6020526040812080548392906107699084906bffffffffffffffffffffffff16614ccb565b92506101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055506107be7f000000000000000000000000000000000000000000000000000000000000000090565b6040517f66316d8d00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff84811660048301526bffffffffffffffffffffffff8416602483015291909116906366316d8d90604401600060405180830381600087803b15801561083d57600080fd5b505af1158015610851573d6000803e3d6000fd5b505050505050565b600080600080600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663feaf968c6040518163ffffffff1660e01b815260040160a060405180830381865afa1580156108cc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108f09190614d11565b5093505092505080426109039190614d61565b600854640100000000900463ffffffff161080156109305750600854640100000000900463ffffffff1615155b1561098d57505060085477010000000000000000000000000000000000000000000000810467ffffffffffffffff16937f010000000000000000000000000000000000000000000000000000000000000090910460ff1692509050565b600082136109cf576040517f56b22ab8000000000000000000000000000000000000000000000000000000008152600481018390526024015b60405180910390fd5b600d54604080517f313ce5670000000000000000000000000000000000000000000000000000000081529051849273ffffffffffffffffffffffffffffffffffffffff169163313ce5679160048083019260209291908290030181865afa158015610a3e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a629190614d74565b9350935050509091565b60015473ffffffffffffffffffffffffffffffffffffffff163314610aed576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e65720000000000000000000060448201526064016109c6565b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b610b71612dae565b610b79612be7565b6000610b83610db9565b905060005b8151811015610d65576000600b6000848481518110610ba957610ba9614d91565b60209081029190910181015173ffffffffffffffffffffffffffffffffffffffff168252810191909152604001600020546bffffffffffffffffffffffff1690508015610d54576000600b6000858581518110610c0857610c08614d91565b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff160217905550610c9f7f000000000000000000000000000000000000000000000000000000000000000090565b73ffffffffffffffffffffffffffffffffffffffff166366316d8d848481518110610ccc57610ccc614d91565b6020026020010151836040518363ffffffff1660e01b8152600401610d2192919073ffffffffffffffffffffffffffffffffffffffff9290921682526bffffffffffffffffffffffff16602082015260400190565b600060405180830381600087803b158015610d3b57600080fd5b505af1158015610d4f573d6000803e3d6000fd5b505050505b50610d5e81614dc0565b9050610b88565b5050565b610d71612a78565b6000819003610dac576040517f4f42be3d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600e61065e828483614b27565b60606006805480602002602001604051908101604052809291908181526020018280548015610e1e57602002820191906000526020600020905b815473ffffffffffffffffffffffffffffffffffffffff168152600190910190602001808311610df3575b5050505050905090565b6060600f8054610e3790614a94565b9050600003610e72576040517f4f42be3d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600f8054610e7f90614a94565b80601f0160208091040260200160405190810160405280929190818152602001828054610eab90614a94565b8015610e1e5780601f10610ecd57610100808354040283529160200191610e1e565b820191906000526020600020905b815481529060010190602001808311610edb57509395945050505050565b3373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614610f68576040517fc41a5b0900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008181526007602052604080822091909155517f8a4b97add3359bd6bcf5e82874363670eb5ad0f7615abddbd0ed0a3a98f0f41690610fab9083815260200190565b60405180910390a150565b6040805161016081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e08101829052610100810182905261012081018290526101408101919091523373ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000161461107e576040517fc41a5b0900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600061109161108c84614e1a565b612db6565b90925090506110a66060840160408501614a77565b825173ffffffffffffffffffffffffffffffffffffffff91909116907fbf50768ccf13bd0110ca6d53a9c4f1f3271abdd4c24a56878863ed25b20598ff326110f460c0880160a08901614f07565b61110661016089016101408a01614a77565b6111108980614f24565b6111226101208c016101008d01614f89565b60208c01356111386101008e0160e08f01614fa4565b6040518061016001604052808e6000015181526020018e6020015173ffffffffffffffffffffffffffffffffffffffff1681526020018e604001516bffffffffffffffffffffffff1681526020018e6060015173ffffffffffffffffffffffffffffffffffffffff1681526020018e6080015167ffffffffffffffff1681526020018e60a0015163ffffffff1681526020018d68ffffffffffffffffff1681526020018e60e0015168ffffffffffffffffff1681526020018e610100015164ffffffffff1681526020018e610120015164ffffffffff1681526020018e610140015163ffffffff1681525060405161123899989796959493929190614fc1565b60405180910390a3505b919050565b6000806112548989613168565b915091508115611265575050611854565b604080518b3580825262ffffff6020808f0135600881901c9290921690840152909290917fb04e63db38c49950639fa09d29872f21f5d49d614f3a969d8adf3d4b52e41a62910160405180910390a16112c28b8b8b8b8b8b6132f1565b6003546000906002906112e09060ff80821691610100900416615077565b6112ea9190615090565b6112f5906001615077565b60ff169050888114611363576040517f660bd4ba00000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f77726f6e67206e756d626572206f66207369676e61747572657300000000000060448201526064016109c6565b8887146113f2576040517f660bd4ba00000000000000000000000000000000000000000000000000000000815260206004820152602860248201527f7265706f727420727320616e64207373206d757374206265206f66206571756160448201527f6c206c656e67746800000000000000000000000000000000000000000000000060648201526084016109c6565b3360009081526004602090815260408083208151808301909252805460ff80821684529293919291840191610100909104166002811115611435576114356150b2565b6002811115611446576114466150b2565b9052509050600281602001516002811115611463576114636150b2565b141580156114ac57506006816000015160ff168154811061148657611486614d91565b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff163314155b15611513576040517f660bd4ba00000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f756e617574686f72697a6564207472616e736d6974746572000000000000000060448201526064016109c6565b5050505061151f613fca565b60008a8a6040516115319291906150e1565b604051908190038120611548918e906020016150f1565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181528282528051602091820120838301909252600080845290830152915060005b898110156118445760006001848984602081106115b1576115b1614d91565b6115be91901a601b615077565b8e8e868181106115d0576115d0614d91565b905060200201358d8d878181106115e9576115e9614d91565b9050602002013560405160008152602001604052604051611626949392919093845260ff9290921660208401526040830152606082015260800190565b6020604051602081039080840390855afa158015611648573d6000803e3d6000fd5b5050604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081015173ffffffffffffffffffffffffffffffffffffffff811660009081526004602090815290849020838501909452835460ff808216855292965092945084019161010090041660028111156116c8576116c86150b2565b60028111156116d9576116d96150b2565b90525092506001836020015160028111156116f6576116f66150b2565b1461175d576040517f660bd4ba00000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f61646472657373206e6f7420617574686f72697a656420746f207369676e000060448201526064016109c6565b8251600090869060ff16601f811061177757611777614d91565b602002015173ffffffffffffffffffffffffffffffffffffffff16146117f9576040517f660bd4ba00000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f6e6f6e2d756e69717565207369676e617475726500000000000000000000000060448201526064016109c6565b8085846000015160ff16601f811061181357611813614d91565b73ffffffffffffffffffffffffffffffffffffffff90921660209290920201525061183d81614dc0565b9050611592565b505050611850826133a8565b5050505b5050505050505050565b611866612dae565b80516008805460208401516040808601516060870151608088015160a089015160c08a015160e08b015160ff167f0100000000000000000000000000000000000000000000000000000000000000027effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff67ffffffffffffffff90921677010000000000000000000000000000000000000000000000029190911676ffffffffffffffffffffffffffffffffffffffffffffff61ffff9384167501000000000000000000000000000000000000000000027fffffffffffffffffff0000ffffffffffffffffffffffffffffffffffffffffff64ffffffffff90961670010000000000000000000000000000000002959095167fffffffffffffffffff00000000000000ffffffffffffffffffffffffffffffff63ffffffff9788166c01000000000000000000000000027fffffffffffffffffffffffffffffffff00000000ffffffffffffffffffffffff9989166801000000000000000002999099167fffffffffffffffffffffffffffffffff0000000000000000ffffffffffffffff9b8916640100000000027fffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000909d169e89169e909e179b909b17999099169b909b17959095179790971695909517179690961617929092179092556101008401516101208501519093167c0100000000000000000000000000000000000000000000000000000000027bffffffffffffffffffffffffffffffffffffffffffffffffffffffff90931692909217600955610140830151600a8054610160860151841662010000027fffffffffffffffffffffffffffffffffffffffffffffffffffffffff00000000919091169290931691909117919091179055517f2e2c8535dcc25459d519f2300c114d2d2128bf6399722d04eca078461a3bf33a90610fab908390614785565b60007f00000000000000000000000000000000000000000000000000000000000000006040517f10fc49c100000000000000000000000000000000000000000000000000000000815267ffffffffffffffff8816600482015263ffffffff8516602482015273ffffffffffffffffffffffffffffffffffffffff91909116906310fc49c19060440160006040518083038186803b158015611bc957600080fd5b505afa158015611bdd573d6000803e3d6000fd5b5050505066038d7ea4c68000821115611c22576040517f8129bbcd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000611c2c6129e7565b90506000611c6f87878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061066392505050565b90506000611c7b6129ae565b9050611c8a86868486856134f7565b9998505050505050505050565b6060600e8054611ca690614a94565b9050600003611ce1576040517f4f42be3d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600e8054610e7f90614a94565b855185518560ff16601f831115611d61576040517f89a6198900000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f746f6f206d616e79207369676e6572730000000000000000000000000000000060448201526064016109c6565b80600003611dcb576040517f89a6198900000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f66206d75737420626520706f736974697665000000000000000000000000000060448201526064016109c6565b818314611e59576040517f89a61989000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f6f7261636c6520616464726573736573206f7574206f6620726567697374726160448201527f74696f6e0000000000000000000000000000000000000000000000000000000060648201526084016109c6565b611e64816003615105565b8311611ecc576040517f89a6198900000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f6661756c74792d6f7261636c65206620746f6f2068696768000000000000000060448201526064016109c6565b611ed4612a78565b6040805160c0810182528a8152602081018a905260ff89169181018290526060810188905267ffffffffffffffff8716608082015260a0810186905290611f1b9088613673565b600554156120d057600554600090611f3590600190614d61565b9050600060058281548110611f4c57611f4c614d91565b60009182526020822001546006805473ffffffffffffffffffffffffffffffffffffffff90921693509084908110611f8657611f86614d91565b600091825260208083209091015473ffffffffffffffffffffffffffffffffffffffff85811684526004909252604080842080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000908116909155929091168084529220805490911690556005805491925090806120065761200661511c565b60008281526020902081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90810180547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055019055600680548061206f5761206f61511c565b60008281526020902081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90810180547fffffffffffffffffffffffff000000000000000000000000000000000000000016905501905550611f1b915050565b60005b815151811015612687578151805160009190839081106120f5576120f5614d91565b602002602001015173ffffffffffffffffffffffffffffffffffffffff160361217a576040517f89a6198900000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f7369676e6572206d757374206e6f7420626520656d707479000000000000000060448201526064016109c6565b600073ffffffffffffffffffffffffffffffffffffffff16826020015182815181106121a8576121a8614d91565b602002602001015173ffffffffffffffffffffffffffffffffffffffff160361222d576040517f89a6198900000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f7472616e736d6974746572206d757374206e6f7420626520656d70747900000060448201526064016109c6565b6000600460008460000151848151811061224957612249614d91565b60209081029190910181015173ffffffffffffffffffffffffffffffffffffffff16825281019190915260400160002054610100900460ff166002811115612293576122936150b2565b146122fa576040517f89a6198900000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f7265706561746564207369676e6572206164647265737300000000000000000060448201526064016109c6565b6040805180820190915260ff8216815260016020820152825180516004916000918590811061232b5761232b614d91565b60209081029190910181015173ffffffffffffffffffffffffffffffffffffffff168252818101929092526040016000208251815460ff9091167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0082168117835592840151919283917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000016176101008360028111156123cc576123cc6150b2565b0217905550600091506123dc9050565b60046000846020015184815181106123f6576123f6614d91565b60209081029190910181015173ffffffffffffffffffffffffffffffffffffffff16825281019190915260400160002054610100900460ff166002811115612440576124406150b2565b146124a7576040517f89a6198900000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f7265706561746564207472616e736d697474657220616464726573730000000060448201526064016109c6565b6040805180820190915260ff8216815260208101600281525060046000846020015184815181106124da576124da614d91565b60209081029190910181015173ffffffffffffffffffffffffffffffffffffffff168252818101929092526040016000208251815460ff9091167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0082168117835592840151919283917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000161761010083600281111561257b5761257b6150b2565b02179055505082518051600592508390811061259957612599614d91565b602090810291909101810151825460018101845560009384529282902090920180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff909316929092179091558201518051600691908390811061261557612615614d91565b60209081029190910181015182546001810184556000938452919092200180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff9092169190911790558061267f81614dc0565b9150506120d3565b506040810151600380547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660ff909216919091179055600180547fffffffff00000000ffffffffffffffffffffffffffffffffffffffffffffffff8116780100000000000000000000000000000000000000000000000063ffffffff438116820292909217808555920481169291829160149161273f9184917401000000000000000000000000000000000000000090041661514b565b92506101000a81548163ffffffff021916908363ffffffff16021790555061279e4630600160149054906101000a900463ffffffff1663ffffffff16856000015186602001518760400151886060015189608001518a60a0015161368c565b600281905582518051600380547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff1661010060ff9093169290920291909117905560015460208501516040808701516060880151608089015160a08a015193517f1591690b8638f5fb2dbec82ac741805ac5da8b45dc5263f4875b0496fdce4e0598612855988b9891977401000000000000000000000000000000000000000090920463ffffffff16969095919491939192615168565b60405180910390a15050505050505050505050565b6000806000600c8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663feaf968c6040518163ffffffff1660e01b815260040160a060405180830381865afa1580156128da573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128fe9190614d11565b5093505092505080426129119190614d61565b600854640100000000900463ffffffff1610801561293e5750600854640100000000900463ffffffff1615155b1561296b5750506009547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff16919050565b600082136129a8576040517f43d4cf66000000000000000000000000000000000000000000000000000000008152600481018390526024016109c6565b50919050565b600a546000906129ce9060649061067d9062010000900461ffff16612afb565b905090565b6129db612a78565b6129e481613737565b50565b60007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16632a905ccc6040518163ffffffff1660e01b8152600401602060405180830381865afa158015612a54573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129ce9190615209565b60005473ffffffffffffffffffffffffffffffffffffffff163314612af9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e65720000000000000000000060448201526064016109c6565b565b6000806000612b08610859565b9092509050612b4082612b1c836012615077565b612b2790600a615346565b612b319087615105565b612b3b9190615355565b61382c565b949350505050565b600068ffffffffffffffffff821115612be3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203760448201527f322062697473000000000000000000000000000000000000000000000000000060648201526084016109c6565b5090565b600c546bffffffffffffffffffffffff16600003612c0157565b6000612c0b610db9565b80519091506000819003612c4b576040517f30274b3a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600c54600090612c6a9083906bffffffffffffffffffffffff16614ca0565b9050806bffffffffffffffffffffffff16600003612c8757505050565b60005b82811015612d505781600b6000868481518110612ca957612ca9614d91565b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282829054906101000a90046bffffffffffffffffffffffff16612d119190615369565b92506101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff16021790555080612d4990614dc0565b9050612c8a565b50612d5b828261538e565b600c8054600090612d7b9084906bffffffffffffffffffffffff16614ccb565b92506101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff160217905550505050565b612af9612a78565b6040805161016081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e081018290526101008101829052610120810182905261014081019190915260085461010083015160009161ffff7501000000000000000000000000000000000000000000909104811691161115612e74576040517fdada758700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000612e838460000151610663565b9050612e8d6129ae565b91506000612ea68560e001513a848860800151876134f7565b9050806bffffffffffffffffffffffff1685606001516bffffffffffffffffffffffff161015612f02576040517ff4d678b800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600954600090612f38907c0100000000000000000000000000000000000000000000000000000000900463ffffffff16426153b6565b905060003087604001518860a001518960c001516001612f5891906153c9565b8a5180516020918201206101008d015160e08e015160405161300c98979695948c918c9132910173ffffffffffffffffffffffffffffffffffffffff9a8b168152988a1660208a015267ffffffffffffffff97881660408a0152959096166060880152608087019390935261ffff9190911660a086015263ffffffff90811660c08601526bffffffffffffffffffffffff9190911660e0850152919091166101008301529091166101208201526101400190565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815282825280516020918201206101608401835280845230848301526bffffffffffffffffffffffff8716848401528a83015173ffffffffffffffffffffffffffffffffffffffff16606085015260a0808c015167ffffffffffffffff1660808087019190915260e0808e015163ffffffff90811693880193909352908d015168ffffffffffffffffff90811660c08801528a169086015260085468010000000000000000810482166101008701526c010000000000000000000000009004811661012086015286166101408501529151929850909250613118918891016144da565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529181528151602092830120600093845260079092529091205550929491935090915050565b600061319c6040518060a0016040528060608152602001606081526020016060815260200160608152602001606081525090565b6000808080806131ae888a018a6154c5565b84519499509297509095509350915060ff168015806131ce575084518114155b806131da575083518114155b806131e6575082518114155b806131f2575081518114155b15613259576040517f660bd4ba00000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f4669656c6473206d75737420626520657175616c206c656e677468000000000060448201526064016109c6565b60005b818110156132bf5761329587828151811061327957613279614d91565b6020026020010151600090815260076020526040902054151590565b6132bf576132a4600183614d61565b81036132af57600198505b6132b881614dc0565b905061325c565b50506040805160a0810182529586526020860194909452928401919091526060830152608082015290505b9250929050565b60006132fe826020615105565b613309856020615105565b613315886101446153b6565b61331f91906153b6565b61332991906153b6565b6133349060006153b6565b905036811461339f576040517f660bd4ba00000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f63616c6c64617461206c656e677468206d69736d61746368000000000000000060448201526064016109c6565b50505050505050565b80515160ff1660005b8181101561065e57600061345a846000015183815181106133d4576133d4614d91565b6020026020010151856020015184815181106133f2576133f2614d91565b60200260200101518660400151858151811061341057613410614d91565b60200260200101518760600151868151811061342e5761342e614d91565b60200260200101518860800151878151811061344c5761344c614d91565b6020026020010151886138ca565b90506000816006811115613470576134706150b2565b148061348d5750600181600681111561348b5761348b6150b2565b145b156134e65783518051839081106134a6576134a6614d91565b60209081029190910181015160405133815290917fc708e0440951fd63499c0f7a73819b469ee5dd3ecc356c0ab4eb7f18389009d9910160405180910390a25b506134f081614dc0565b90506133b1565b600854600090700100000000000000000000000000000000900464ffffffffff1685101561354057600854700100000000000000000000000000000000900464ffffffffff1694505b6008546000906127109061355a9063ffffffff1688615105565b6135649190615355565b61356e90876153b6565b60085490915060009088906135a79063ffffffff6c0100000000000000000000000082048116916801000000000000000090041661514b565b6135b1919061514b565b63ffffffff16905060006135fb6000368080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250613d8e92505050565b9050600061361c8261360d8587615105565b61361791906153b6565b613ed0565b905060008668ffffffffffffffffff168868ffffffffffffffffff168a68ffffffffffffffffff1661364e9190615369565b6136589190615369565b90506136648183615369565b9b9a5050505050505050505050565b600061367d610db9565b511115610d6557610d65612be7565b6000808a8a8a8a8a8a8a8a8a6040516020016136b099989796959493929190615597565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815291905280516020909101207dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167e01000000000000000000000000000000000000000000000000000000000000179150509998505050505050505050565b3373ffffffffffffffffffffffffffffffffffffffff8216036137b6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c6600000000000000000060448201526064016109c6565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b60006bffffffffffffffffffffffff821115612be3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203960448201527f362062697473000000000000000000000000000000000000000000000000000060648201526084016109c6565b600080848060200190518101906138e19190615663565b905060003a8261012001518361010001516138fc919061572b565b64ffffffffff1661390d9190615105565b905060008460ff166139556000368080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250613d8e92505050565b61395f9190615355565b9050600061397061361783856153b6565b9050600061397d3a613ed0565b90506000807f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663330605298e8e868b60c0015168ffffffffffffffffff168c60e0015168ffffffffffffffffff168a6139ec9190615369565b6139f69190615369565b336040518061016001604052808f6000015181526020018f6020015173ffffffffffffffffffffffffffffffffffffffff1681526020018f604001516bffffffffffffffffffffffff1681526020018f6060015173ffffffffffffffffffffffffffffffffffffffff1681526020018f6080015167ffffffffffffffff1681526020018f60a0015163ffffffff168152602001600068ffffffffffffffffff1681526020018f60e0015168ffffffffffffffffff1681526020018f610100015164ffffffffff1681526020018f610120015164ffffffffff1681526020018f610140015163ffffffff168152506040518763ffffffff1660e01b8152600401613b0496959493929190615749565b60408051808303816000875af1158015613b22573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613b4691906157c5565b90925090506000826006811115613b5f57613b5f6150b2565b1480613b7c57506001826006811115613b7a57613b7a6150b2565b145b15613d7d5760008e815260076020526040812055613b9a8185615369565b336000908152600b602052604081208054909190613bc79084906bffffffffffffffffffffffff16615369565b92506101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055508660e0015168ffffffffffffffffff16600c60008282829054906101000a90046bffffffffffffffffffffffff16613c2d9190615369565b92506101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055508660c0015168ffffffffffffffffff16600b6000613c77613eef565b73ffffffffffffffffffffffffffffffffffffffff168152602081019190915260400160009081208054909190613cbd9084906bffffffffffffffffffffffff16615369565b92506101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055508d7f08a4a0761e3c98d288cb4af9342660f49550d83139fb3b762b70d34bed6273688487848b60e0015160008d60c00151604051613d74969594939291906bffffffffffffffffffffffff9687168152602081019590955292909416604084015268ffffffffffffffffff9081166060840152928316608083015290911660a082015260c00190565b60405180910390a25b509c9b505050505050505050505050565b600046613d9a81613f60565b15613e1657606c73ffffffffffffffffffffffffffffffffffffffff1663c6f7de0e6040518163ffffffff1660e01b8152600401602060405180830381865afa158015613deb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613e0f91906157f8565b9392505050565b613e1f81613f83565b15613ec75773420000000000000000000000000000000000000f73ffffffffffffffffffffffffffffffffffffffff166349948e0e8460405180608001604052806048815260200161585e60489139604051602001613e7f929190615811565b6040516020818303038152906040526040518263ffffffff1660e01b8152600401613eaa91906140db565b602060405180830381865afa158015613deb573d6000803e3d6000fd5b50600092915050565b600061069a613edd61286a565b612b3184670de0b6b3a7640000615105565b60003073ffffffffffffffffffffffffffffffffffffffff16638da5cb5b6040518163ffffffff1660e01b8152600401602060405180830381865afa158015613f3c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129ce9190615840565b600061a4b1821480613f74575062066eed82145b8061069a57505062066eee1490565b6000600a821480613f9557506101a482145b80613fa2575062aa37dc82145b80613fae575061210582145b80613fbb575062014a3382145b8061069a57505062014a341490565b604051806103e00160405280601f906020820280368337509192915050565b60008083601f840112613ffb57600080fd5b50813567ffffffffffffffff81111561401357600080fd5b6020830191508360208285010111156132ea57600080fd5b6000806020838503121561403e57600080fd5b823567ffffffffffffffff81111561405557600080fd5b61406185828601613fe9565b90969095509350505050565b60005b83811015614088578181015183820152602001614070565b50506000910152565b600081518084526140a981602086016020860161406d565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b602081526000613e0f6020830184614091565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051610180810167ffffffffffffffff81118282101715614141576141416140ee565b60405290565b604051610160810167ffffffffffffffff81118282101715614141576141416140ee565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff811182821017156141b2576141b26140ee565b604052919050565b600082601f8301126141cb57600080fd5b813567ffffffffffffffff8111156141e5576141e56140ee565b61421660207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8401160161416b565b81815284602083860101111561422b57600080fd5b816020850160208301376000918101602001919091529392505050565b60006020828403121561425a57600080fd5b813567ffffffffffffffff81111561427157600080fd5b612b40848285016141ba565b73ffffffffffffffffffffffffffffffffffffffff811681146129e457600080fd5b80356112428161427d565b6bffffffffffffffffffffffff811681146129e457600080fd5b8035611242816142aa565b600080604083850312156142e257600080fd5b82356142ed8161427d565b915060208301356142fd816142aa565b809150509250929050565b600081518084526020808501945080840160005b8381101561434e57815173ffffffffffffffffffffffffffffffffffffffff168752958201959082019060010161431c565b509495945050505050565b602081526000613e0f6020830184614308565b60006020828403121561437e57600080fd5b5035919050565b60006020828403121561439757600080fd5b813567ffffffffffffffff8111156143ae57600080fd5b82016101608185031215613e0f57600080fd5b8051825260208101516143ec602084018273ffffffffffffffffffffffffffffffffffffffff169052565b50604081015161440c60408401826bffffffffffffffffffffffff169052565b506060810151614434606084018273ffffffffffffffffffffffffffffffffffffffff169052565b506080810151614450608084018267ffffffffffffffff169052565b5060a081015161446860a084018263ffffffff169052565b5060c081015161448560c084018268ffffffffffffffffff169052565b5060e08101516144a260e084018268ffffffffffffffffff169052565b506101008181015164ffffffffff9081169184019190915261012080830151909116908301526101409081015163ffffffff16910152565b610160810161069a82846143c1565b60008083601f8401126144fb57600080fd5b50813567ffffffffffffffff81111561451357600080fd5b6020830191508360208260051b85010111156132ea57600080fd5b60008060008060008060008060e0898b03121561454a57600080fd5b606089018a81111561455b57600080fd5b8998503567ffffffffffffffff8082111561457557600080fd5b6145818c838d01613fe9565b909950975060808b013591508082111561459a57600080fd5b6145a68c838d016144e9565b909750955060a08b01359150808211156145bf57600080fd5b506145cc8b828c016144e9565b999c989b50969995989497949560c00135949350505050565b63ffffffff811681146129e457600080fd5b8035611242816145e5565b64ffffffffff811681146129e457600080fd5b803561124281614602565b803561ffff8116811461124257600080fd5b67ffffffffffffffff811681146129e457600080fd5b803561124281614632565b60ff811681146129e457600080fd5b803561124281614653565b80357bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8116811461124257600080fd5b600061018082840312156146ac57600080fd5b6146b461411d565b6146bd836145f7565b81526146cb602084016145f7565b60208201526146dc604084016145f7565b60408201526146ed606084016145f7565b60608201526146fe60808401614615565b608082015261470f60a08401614620565b60a082015261472060c08401614648565b60c082015261473160e08401614662565b60e082015261010061474481850161466d565b908201526101206147568482016145f7565b90820152610140614768848201614620565b9082015261016061477a848201614620565b908201529392505050565b815163ffffffff168152610180810160208301516147ab602084018263ffffffff169052565b5060408301516147c3604084018263ffffffff169052565b5060608301516147db606084018263ffffffff169052565b5060808301516147f4608084018264ffffffffff169052565b5060a083015161480a60a084018261ffff169052565b5060c083015161482660c084018267ffffffffffffffff169052565b5060e083015161483b60e084018260ff169052565b50610100838101517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff16908301526101208084015163ffffffff16908301526101408084015161ffff908116918401919091526101608085015191821681850152905b505092915050565b6000806000806000608086880312156148ba57600080fd5b85356148c581614632565b9450602086013567ffffffffffffffff8111156148e157600080fd5b6148ed88828901613fe9565b9095509350506040860135614901816145e5565b949793965091946060013592915050565b600067ffffffffffffffff82111561492c5761492c6140ee565b5060051b60200190565b600082601f83011261494757600080fd5b8135602061495c61495783614912565b61416b565b82815260059290921b8401810191818101908684111561497b57600080fd5b8286015b8481101561499f5780356149928161427d565b835291830191830161497f565b509695505050505050565b60008060008060008060c087890312156149c357600080fd5b863567ffffffffffffffff808211156149db57600080fd5b6149e78a838b01614936565b975060208901359150808211156149fd57600080fd5b614a098a838b01614936565b9650614a1760408a01614662565b95506060890135915080821115614a2d57600080fd5b614a398a838b016141ba565b9450614a4760808a01614648565b935060a0890135915080821115614a5d57600080fd5b50614a6a89828a016141ba565b9150509295509295509295565b600060208284031215614a8957600080fd5b8135613e0f8161427d565b600181811c90821680614aa857607f821691505b6020821081036129a8577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b601f82111561065e57600081815260208120601f850160051c81016020861015614b085750805b601f850160051c820191505b8181101561085157828155600101614b14565b67ffffffffffffffff831115614b3f57614b3f6140ee565b614b5383614b4d8354614a94565b83614ae1565b6000601f841160018114614ba55760008515614b6f5750838201355b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600387901b1c1916600186901b178355614c3b565b6000838152602090207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0861690835b82811015614bf45786850135825560209485019460019092019101614bd4565b5086821015614c2f577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60f88860031b161c19848701351681555b505060018560011b0183555b5050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006bffffffffffffffffffffffff80841680614cbf57614cbf614c42565b92169190910492915050565b6bffffffffffffffffffffffff828116828216039080821115614cf057614cf0614c71565b5092915050565b805169ffffffffffffffffffff8116811461124257600080fd5b600080600080600060a08688031215614d2957600080fd5b614d3286614cf7565b9450602086015193506040860151925060608601519150614d5560808701614cf7565b90509295509295909350565b8181038181111561069a5761069a614c71565b600060208284031215614d8657600080fd5b8151613e0f81614653565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203614df157614df1614c71565b5060010190565b68ffffffffffffffffff811681146129e457600080fd5b803561124281614df8565b60006101608236031215614e2d57600080fd5b614e35614147565b823567ffffffffffffffff811115614e4c57600080fd5b614e58368286016141ba565b82525060208301356020820152614e716040840161429f565b6040820152614e82606084016142c4565b6060820152614e9360808401614e0f565b6080820152614ea460a08401614648565b60a0820152614eb560c08401614648565b60c0820152614ec660e084016145f7565b60e0820152610100614ed9818501614620565b90820152610120614eeb848201614648565b90820152610140614efd84820161429f565b9082015292915050565b600060208284031215614f1957600080fd5b8135613e0f81614632565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112614f5957600080fd5b83018035915067ffffffffffffffff821115614f7457600080fd5b6020019150368190038213156132ea57600080fd5b600060208284031215614f9b57600080fd5b613e0f82614620565b600060208284031215614fb657600080fd5b8135613e0f816145e5565b73ffffffffffffffffffffffffffffffffffffffff8a8116825267ffffffffffffffff8a166020830152881660408201526102406060820181905281018690526000610260878982850137600083890182015261ffff8716608084015260a0830186905263ffffffff851660c0840152601f88017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016830101905061506960e08301846143c1565b9a9950505050505050505050565b60ff818116838216019081111561069a5761069a614c71565b600060ff8316806150a3576150a3614c42565b8060ff84160491505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b8183823760009101908152919050565b828152606082602083013760800192915050565b808202811582820484141761069a5761069a614c71565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b63ffffffff818116838216019080821115614cf057614cf0614c71565b600061012063ffffffff808d1684528b6020850152808b166040850152508060608401526151988184018a614308565b905082810360808401526151ac8189614308565b905060ff871660a084015282810360c08401526151c98187614091565b905067ffffffffffffffff851660e08401528281036101008401526151ee8185614091565b9c9b505050505050505050505050565b805161124281614df8565b60006020828403121561521b57600080fd5b8151613e0f81614df8565b600181815b8085111561527f57817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0482111561526557615265614c71565b8085161561527257918102915b93841c939080029061522b565b509250929050565b6000826152965750600161069a565b816152a35750600061069a565b81600181146152b957600281146152c3576152df565b600191505061069a565b60ff8411156152d4576152d4614c71565b50506001821b61069a565b5060208310610133831016604e8410600b8410161715615302575081810a61069a565b61530c8383615226565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0482111561533e5761533e614c71565b029392505050565b6000613e0f60ff841683615287565b60008261536457615364614c42565b500490565b6bffffffffffffffffffffffff818116838216019080821115614cf057614cf0614c71565b6bffffffffffffffffffffffff81811683821602808216919082811461489a5761489a614c71565b8082018082111561069a5761069a614c71565b67ffffffffffffffff818116838216019080821115614cf057614cf0614c71565b600082601f8301126153fb57600080fd5b8135602061540b61495783614912565b82815260059290921b8401810191818101908684111561542a57600080fd5b8286015b8481101561499f578035835291830191830161542e565b600082601f83011261545657600080fd5b8135602061546661495783614912565b82815260059290921b8401810191818101908684111561548557600080fd5b8286015b8481101561499f57803567ffffffffffffffff8111156154a95760008081fd5b6154b78986838b01016141ba565b845250918301918301615489565b600080600080600060a086880312156154dd57600080fd5b853567ffffffffffffffff808211156154f557600080fd5b61550189838a016153ea565b9650602088013591508082111561551757600080fd5b61552389838a01615445565b9550604088013591508082111561553957600080fd5b61554589838a01615445565b9450606088013591508082111561555b57600080fd5b61556789838a01615445565b9350608088013591508082111561557d57600080fd5b5061558a88828901615445565b9150509295509295909350565b60006101208b835273ffffffffffffffffffffffffffffffffffffffff8b16602084015267ffffffffffffffff808b1660408501528160608501526155de8285018b614308565b915083820360808501526155f2828a614308565b915060ff881660a085015283820360c085015261560f8288614091565b90861660e085015283810361010085015290506151ee8185614091565b80516112428161427d565b8051611242816142aa565b805161124281614632565b8051611242816145e5565b805161124281614602565b6000610160828403121561567657600080fd5b61567e614147565b8251815261568e6020840161562c565b602082015261569f60408401615637565b60408201526156b06060840161562c565b60608201526156c160808401615642565b60808201526156d260a0840161564d565b60a08201526156e360c084016151fe565b60c08201526156f460e084016151fe565b60e0820152610100615707818501615658565b90820152610120615719848201615658565b9082015261014061477a84820161564d565b64ffffffffff818116838216019080821115614cf057614cf0614c71565b600061020080835261575d8184018a614091565b905082810360208401526157718189614091565b6bffffffffffffffffffffffff88811660408601528716606085015273ffffffffffffffffffffffffffffffffffffffff8616608085015291506157ba905060a08301846143c1565b979650505050505050565b600080604083850312156157d857600080fd5b8251600781106157e757600080fd5b60208401519092506142fd816142aa565b60006020828403121561580a57600080fd5b5051919050565b6000835161582381846020880161406d565b83519083019061583781836020880161406d565b01949350505050565b60006020828403121561585257600080fd5b8151613e0f8161427d56fe307866666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666a164736f6c6343000813000a", + ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"router\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"uint32\",\"name\":\"fulfillmentGasPriceOverEstimationBP\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"feedStalenessSeconds\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"gasOverheadBeforeCallback\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"gasOverheadAfterCallback\",\"type\":\"uint32\"},{\"internalType\":\"uint40\",\"name\":\"minimumEstimateGasPriceWei\",\"type\":\"uint40\"},{\"internalType\":\"uint16\",\"name\":\"maxSupportedRequestDataVersion\",\"type\":\"uint16\"},{\"internalType\":\"uint64\",\"name\":\"fallbackUsdPerUnitLink\",\"type\":\"uint64\"},{\"internalType\":\"uint8\",\"name\":\"fallbackUsdPerUnitLinkDecimals\",\"type\":\"uint8\"},{\"internalType\":\"uint224\",\"name\":\"fallbackNativePerUnitLink\",\"type\":\"uint224\"},{\"internalType\":\"uint32\",\"name\":\"requestTimeoutSeconds\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"donFeeCentsUsd\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"operationFeeCentsUsd\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"transmitTxSizeBytes\",\"type\":\"uint16\"}],\"internalType\":\"structFunctionsBillingConfig\",\"name\":\"config\",\"type\":\"tuple\"},{\"internalType\":\"address\",\"name\":\"linkToNativeFeed\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"linkToUsdFeed\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"EmptyPublicKey\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InconsistentReportData\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InsufficientBalance\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidCalldata\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"message\",\"type\":\"string\"}],\"name\":\"InvalidConfig\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"int256\",\"name\":\"linkWei\",\"type\":\"int256\"}],\"name\":\"InvalidLinkWeiPrice\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidSubscription\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"int256\",\"name\":\"usdLink\",\"type\":\"int256\"}],\"name\":\"InvalidUsdLinkPrice\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"MustBeSubOwner\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NoTransmittersSet\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCallableByRouter\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCallableByRouterOwner\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"PaymentTooLarge\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"message\",\"type\":\"string\"}],\"name\":\"ReportInvalid\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RouterMustBeSet\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UnauthorizedPublicKeyChange\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UnauthorizedSender\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UnsupportedRequestDataVersion\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"requestId\",\"type\":\"bytes32\"}],\"name\":\"CommitmentDeleted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"previousConfigBlockNumber\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"configCount\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"signers\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"transmitters\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"f\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"onchainConfig\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"offchainConfigVersion\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"offchainConfig\",\"type\":\"bytes\"}],\"name\":\"ConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"uint32\",\"name\":\"fulfillmentGasPriceOverEstimationBP\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"feedStalenessSeconds\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"gasOverheadBeforeCallback\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"gasOverheadAfterCallback\",\"type\":\"uint32\"},{\"internalType\":\"uint40\",\"name\":\"minimumEstimateGasPriceWei\",\"type\":\"uint40\"},{\"internalType\":\"uint16\",\"name\":\"maxSupportedRequestDataVersion\",\"type\":\"uint16\"},{\"internalType\":\"uint64\",\"name\":\"fallbackUsdPerUnitLink\",\"type\":\"uint64\"},{\"internalType\":\"uint8\",\"name\":\"fallbackUsdPerUnitLinkDecimals\",\"type\":\"uint8\"},{\"internalType\":\"uint224\",\"name\":\"fallbackNativePerUnitLink\",\"type\":\"uint224\"},{\"internalType\":\"uint32\",\"name\":\"requestTimeoutSeconds\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"donFeeCentsUsd\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"operationFeeCentsUsd\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"transmitTxSizeBytes\",\"type\":\"uint16\"}],\"indexed\":false,\"internalType\":\"structFunctionsBillingConfig\",\"name\":\"config\",\"type\":\"tuple\"}],\"name\":\"ConfigUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"requestId\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"requestingContract\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"requestInitiator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"subscriptionId\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"subscriptionOwner\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"dataVersion\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"flags\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"callbackGasLimit\",\"type\":\"uint64\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"requestId\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"coordinator\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"estimatedTotalCostJuels\",\"type\":\"uint96\"},{\"internalType\":\"address\",\"name\":\"client\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"subscriptionId\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint72\",\"name\":\"adminFee\",\"type\":\"uint72\"},{\"internalType\":\"uint72\",\"name\":\"donFee\",\"type\":\"uint72\"},{\"internalType\":\"uint40\",\"name\":\"gasOverheadBeforeCallback\",\"type\":\"uint40\"},{\"internalType\":\"uint40\",\"name\":\"gasOverheadAfterCallback\",\"type\":\"uint40\"},{\"internalType\":\"uint32\",\"name\":\"timeoutTimestamp\",\"type\":\"uint32\"}],\"indexed\":false,\"internalType\":\"structFunctionsResponse.Commitment\",\"name\":\"commitment\",\"type\":\"tuple\"}],\"name\":\"OracleRequest\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"requestId\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"transmitter\",\"type\":\"address\"}],\"name\":\"OracleResponse\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"requestId\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"juelsPerGas\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"l1FeeShareWei\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"callbackCostJuels\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint72\",\"name\":\"donFeeJuels\",\"type\":\"uint72\"},{\"indexed\":false,\"internalType\":\"uint72\",\"name\":\"adminFeeJuels\",\"type\":\"uint72\"},{\"indexed\":false,\"internalType\":\"uint72\",\"name\":\"operationFeeJuels\",\"type\":\"uint72\"}],\"name\":\"RequestBilled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"epoch\",\"type\":\"uint32\"}],\"name\":\"Transmitted\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"requestId\",\"type\":\"bytes32\"}],\"name\":\"deleteCommitment\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"subscriptionId\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"uint32\",\"name\":\"callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint256\",\"name\":\"gasPriceWei\",\"type\":\"uint256\"}],\"name\":\"estimateCost\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"\",\"type\":\"uint96\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAdminFeeJuels\",\"outputs\":[{\"internalType\":\"uint72\",\"name\":\"\",\"type\":\"uint72\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getConfig\",\"outputs\":[{\"components\":[{\"internalType\":\"uint32\",\"name\":\"fulfillmentGasPriceOverEstimationBP\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"feedStalenessSeconds\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"gasOverheadBeforeCallback\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"gasOverheadAfterCallback\",\"type\":\"uint32\"},{\"internalType\":\"uint40\",\"name\":\"minimumEstimateGasPriceWei\",\"type\":\"uint40\"},{\"internalType\":\"uint16\",\"name\":\"maxSupportedRequestDataVersion\",\"type\":\"uint16\"},{\"internalType\":\"uint64\",\"name\":\"fallbackUsdPerUnitLink\",\"type\":\"uint64\"},{\"internalType\":\"uint8\",\"name\":\"fallbackUsdPerUnitLinkDecimals\",\"type\":\"uint8\"},{\"internalType\":\"uint224\",\"name\":\"fallbackNativePerUnitLink\",\"type\":\"uint224\"},{\"internalType\":\"uint32\",\"name\":\"requestTimeoutSeconds\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"donFeeCentsUsd\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"operationFeeCentsUsd\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"transmitTxSizeBytes\",\"type\":\"uint16\"}],\"internalType\":\"structFunctionsBillingConfig\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"getDONFeeJuels\",\"outputs\":[{\"internalType\":\"uint72\",\"name\":\"\",\"type\":\"uint72\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getDONPublicKey\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getOperationFeeJuels\",\"outputs\":[{\"internalType\":\"uint72\",\"name\":\"\",\"type\":\"uint72\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getThresholdPublicKey\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getUsdPerUnitLink\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getWeiPerUnitLink\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestConfigDetails\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"configCount\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"blockNumber\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestConfigDigestAndEpoch\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"scanLogs\",\"type\":\"bool\"},{\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"internalType\":\"uint32\",\"name\":\"epoch\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"}],\"name\":\"oracleWithdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"oracleWithdrawAll\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"_signers\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"_transmitters\",\"type\":\"address[]\"},{\"internalType\":\"uint8\",\"name\":\"_f\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"_onchainConfig\",\"type\":\"bytes\"},{\"internalType\":\"uint64\",\"name\":\"_offchainConfigVersion\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"_offchainConfig\",\"type\":\"bytes\"}],\"name\":\"setConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"donPublicKey\",\"type\":\"bytes\"}],\"name\":\"setDONPublicKey\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"thresholdPublicKey\",\"type\":\"bytes\"}],\"name\":\"setThresholdPublicKey\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"bytes32\",\"name\":\"flags\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"requestingContract\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"availableBalance\",\"type\":\"uint96\"},{\"internalType\":\"uint72\",\"name\":\"adminFee\",\"type\":\"uint72\"},{\"internalType\":\"uint64\",\"name\":\"subscriptionId\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"initiatedRequests\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"dataVersion\",\"type\":\"uint16\"},{\"internalType\":\"uint64\",\"name\":\"completedRequests\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"subscriptionOwner\",\"type\":\"address\"}],\"internalType\":\"structFunctionsResponse.RequestMeta\",\"name\":\"request\",\"type\":\"tuple\"}],\"name\":\"startRequest\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"requestId\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"coordinator\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"estimatedTotalCostJuels\",\"type\":\"uint96\"},{\"internalType\":\"address\",\"name\":\"client\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"subscriptionId\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint72\",\"name\":\"adminFee\",\"type\":\"uint72\"},{\"internalType\":\"uint72\",\"name\":\"donFee\",\"type\":\"uint72\"},{\"internalType\":\"uint40\",\"name\":\"gasOverheadBeforeCallback\",\"type\":\"uint40\"},{\"internalType\":\"uint40\",\"name\":\"gasOverheadAfterCallback\",\"type\":\"uint40\"},{\"internalType\":\"uint32\",\"name\":\"timeoutTimestamp\",\"type\":\"uint32\"}],\"internalType\":\"structFunctionsResponse.Commitment\",\"name\":\"commitment\",\"type\":\"tuple\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32[3]\",\"name\":\"reportContext\",\"type\":\"bytes32[3]\"},{\"internalType\":\"bytes\",\"name\":\"report\",\"type\":\"bytes\"},{\"internalType\":\"bytes32[]\",\"name\":\"rs\",\"type\":\"bytes32[]\"},{\"internalType\":\"bytes32[]\",\"name\":\"ss\",\"type\":\"bytes32[]\"},{\"internalType\":\"bytes32\",\"name\":\"rawVs\",\"type\":\"bytes32\"}],\"name\":\"transmit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"transmitters\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint32\",\"name\":\"fulfillmentGasPriceOverEstimationBP\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"feedStalenessSeconds\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"gasOverheadBeforeCallback\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"gasOverheadAfterCallback\",\"type\":\"uint32\"},{\"internalType\":\"uint40\",\"name\":\"minimumEstimateGasPriceWei\",\"type\":\"uint40\"},{\"internalType\":\"uint16\",\"name\":\"maxSupportedRequestDataVersion\",\"type\":\"uint16\"},{\"internalType\":\"uint64\",\"name\":\"fallbackUsdPerUnitLink\",\"type\":\"uint64\"},{\"internalType\":\"uint8\",\"name\":\"fallbackUsdPerUnitLinkDecimals\",\"type\":\"uint8\"},{\"internalType\":\"uint224\",\"name\":\"fallbackNativePerUnitLink\",\"type\":\"uint224\"},{\"internalType\":\"uint32\",\"name\":\"requestTimeoutSeconds\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"donFeeCentsUsd\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"operationFeeCentsUsd\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"transmitTxSizeBytes\",\"type\":\"uint16\"}],\"internalType\":\"structFunctionsBillingConfig\",\"name\":\"config\",\"type\":\"tuple\"}],\"name\":\"updateConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", + Bin: "0x60a06040523480156200001157600080fd5b5060405162006047380380620060478339810160408190526200003491620004f2565b83838383833380600081620000905760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000c357620000c3816200014e565b5050506001600160a01b038116620000ee57604051632530e88560e11b815260040160405180910390fd5b6001600160a01b03908116608052600c80546001600160601b03166c0100000000000000000000000085841602179055600d80546001600160a01b0319169183169190911790556200014083620001f9565b505050505050505062000779565b336001600160a01b03821603620001a85760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640162000087565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b62000203620003b5565b80516008805460208401516040808601516060870151608088015160a089015160c08a015160e08b015163ffffffff9a8b166001600160401b031990991698909817640100000000978b16880217600160401b600160801b03191668010000000000000000958b169590950263ffffffff60601b1916949094176c01000000000000000000000000938a16939093029290921766ffffffffffffff60801b1916600160801b64ffffffffff9092169190910261ffff60a81b191617600160a81b61ffff92831602176001600160b81b0316600160b81b6001600160401b03909316929092026001600160f81b031691909117600160f81b60ff90951694909402939093179093556101008501516101208601516001600160e01b03909116600160e01b919095160293909317600955610140840151600a805461016087015161018088015193851663ffffffff199092169190911762010000918516919091021761ffff60201b19169190921690930292909217909155517f9832846a11905a128363408ace5f9803f449fcb017d3cf7e22a50c6e332931b290620003aa90839062000663565b60405180910390a150565b620003bf620003c1565b565b6000546001600160a01b03163314620003bf5760405162461bcd60e51b815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e657200000000000000000000604482015260640162000087565b80516001600160a01b03811681146200043557600080fd5b919050565b6040516101a081016001600160401b03811182821017156200046c57634e487b7160e01b600052604160045260246000fd5b60405290565b805163ffffffff811681146200043557600080fd5b805164ffffffffff811681146200043557600080fd5b805161ffff811681146200043557600080fd5b80516001600160401b03811681146200043557600080fd5b805160ff811681146200043557600080fd5b80516001600160e01b03811681146200043557600080fd5b6000806000808486036102008112156200050b57600080fd5b62000516866200041d565b94506101a080601f19830112156200052d57600080fd5b620005376200043a565b9150620005476020880162000472565b8252620005576040880162000472565b60208301526200056a6060880162000472565b60408301526200057d6080880162000472565b60608301526200059060a0880162000487565b6080830152620005a360c088016200049d565b60a0830152620005b660e08801620004b0565b60c0830152610100620005cb818901620004c8565b60e0840152610120620005e0818a01620004da565b828501526101409150620005f6828a0162000472565b908401526101606200060a8982016200049d565b82850152610180915062000620828a016200049d565b90840152620006318883016200049d565b90830152509250620006476101c086016200041d565b9150620006586101e086016200041d565b905092959194509250565b815163ffffffff1681526101a0810160208301516200068a602084018263ffffffff169052565b506040830151620006a3604084018263ffffffff169052565b506060830151620006bc606084018263ffffffff169052565b506080830151620006d6608084018264ffffffffff169052565b5060a0830151620006ed60a084018261ffff169052565b5060c08301516200070960c08401826001600160401b03169052565b5060e08301516200071f60e084018260ff169052565b50610100838101516001600160e01b0316908301526101208084015163ffffffff16908301526101408084015161ffff90811691840191909152610160808501518216908401526101809384015116929091019190915290565b608051615888620007bf600039600081816107af01528181610c9001528181610f240152818161103a01528181611b7101528181612a2f015261397801526158886000f3fe608060405234801561001057600080fd5b50600436106101a35760003560e01c80638da5cb5b116100ee578063d227d24511610097578063e4ddcea611610071578063e4ddcea6146105e8578063f2f22ef1146105fe578063f2fde38b14610606578063f6ea41f61461061957600080fd5b8063d227d2451461059d578063d328a91e146105cd578063e3d0e712146105d557600080fd5b8063b1dc65a4116100c8578063b1dc65a414610396578063c074ef21146103a9578063c3f909d4146103bc57600080fd5b80638da5cb5b1461032e578063a631571e14610356578063afcb95d71461037657600080fd5b80637d4807871161015057806381f1b9381161012a57806381f1b938146102a657806381ff7048146102ae57806385b214cf1461031b57600080fd5b80637d480787146102765780637f15e1661461027e578063814118341461029157600080fd5b806366316d8d1161018157806366316d8d1461023c5780637212762f1461024f57806379ba50971461026e57600080fd5b8063083a5466146101a8578063181f5a77146101bd578063626f458c1461020f575b600080fd5b6101bb6101b6366004614029565b610621565b005b6101f96040518060400160405280601c81526020017f46756e6374696f6e7320436f6f7264696e61746f722076312e332e310000000081525081565b60405161020691906140cf565b60405180910390f35b61022261021d36600461423c565b610676565b60405168ffffffffffffffffff9091168152602001610206565b6101bb61024a3660046142c3565b6106b3565b61025761086c565b6040805192835260ff909116602083015201610206565b6101bb610a7f565b6101bb610b7c565b6101bb61028c366004614029565b610d7c565b610299610dcc565b604051610206919061434d565b6101f9610e3b565b6102f860015460025463ffffffff74010000000000000000000000000000000000000000830481169378010000000000000000000000000000000000000000000000009093041691565b6040805163ffffffff948516815293909216602084015290820152606001610206565b6101bb610329366004614360565b610f0c565b60005460405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610206565b610369610364366004614379565b610fc9565b60405161020691906144ce565b604080516001815260006020820181905291810191909152606001610206565b6101bb6103a4366004614522565b61125a565b6101bb6103b736600461468d565b611871565b610590604080516101a081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e08101829052610100810182905261012081018290526101408101829052610160810182905261018081019190915250604080516101a08101825260085463ffffffff8082168352640100000000808304821660208501526801000000000000000083048216948401949094526c01000000000000000000000000820481166060840152700100000000000000000000000000000000820464ffffffffff1660808401527501000000000000000000000000000000000000000000820461ffff90811660a085015277010000000000000000000000000000000000000000000000830467ffffffffffffffff1660c08501527f010000000000000000000000000000000000000000000000000000000000000090920460ff1660e08401526009547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff81166101008501527c0100000000000000000000000000000000000000000000000000000000900416610120830152600a5480821661014084015262010000810482166101608401529290920490911661018082015290565b604051610206919061478b565b6105b06105ab3660046148b5565b611b6d565b6040516bffffffffffffffffffffffff9091168152602001610206565b6101f9611cdb565b6101bb6105e33660046149bd565b611d32565b6105f06128ae565b604051908152602001610206565b6102226129f2565b6101bb610614366004614a8a565b612a17565b610222612a2b565b610629612abc565b6000819003610664576040517f4f42be3d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600f610671828483614b3a565b505050565b600a546000906106ad906064906106909061ffff16612b3f565b61069a9190614cb3565b6bffffffffffffffffffffffff16612b8c565b92915050565b6106bb612c2b565b806bffffffffffffffffffffffff166000036106f55750336000908152600b60205260409020546bffffffffffffffffffffffff1661074f565b336000908152600b60205260409020546bffffffffffffffffffffffff8083169116101561074f576040517ff4d678b800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b336000908152600b60205260408120805483929061077c9084906bffffffffffffffffffffffff16614cde565b92506101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055506107d17f000000000000000000000000000000000000000000000000000000000000000090565b6040517f66316d8d00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff84811660048301526bffffffffffffffffffffffff8416602483015291909116906366316d8d90604401600060405180830381600087803b15801561085057600080fd5b505af1158015610864573d6000803e3d6000fd5b505050505050565b600080600080600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663feaf968c6040518163ffffffff1660e01b815260040160a060405180830381865afa1580156108df573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109039190614d24565b5093505092505080426109169190614d74565b600854640100000000900463ffffffff161080156109435750600854640100000000900463ffffffff1615155b156109a057505060085477010000000000000000000000000000000000000000000000810467ffffffffffffffff16937f010000000000000000000000000000000000000000000000000000000000000090910460ff1692509050565b600082136109e2576040517f56b22ab8000000000000000000000000000000000000000000000000000000008152600481018390526024015b60405180910390fd5b600d54604080517f313ce5670000000000000000000000000000000000000000000000000000000081529051849273ffffffffffffffffffffffffffffffffffffffff169163313ce5679160048083019260209291908290030181865afa158015610a51573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a759190614d87565b9350935050509091565b60015473ffffffffffffffffffffffffffffffffffffffff163314610b00576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e65720000000000000000000060448201526064016109d9565b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b610b84612df2565b610b8c612c2b565b6000610b96610dcc565b905060005b8151811015610d78576000600b6000848481518110610bbc57610bbc614da4565b60209081029190910181015173ffffffffffffffffffffffffffffffffffffffff168252810191909152604001600020546bffffffffffffffffffffffff1690508015610d67576000600b6000858581518110610c1b57610c1b614da4565b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff160217905550610cb27f000000000000000000000000000000000000000000000000000000000000000090565b73ffffffffffffffffffffffffffffffffffffffff166366316d8d848481518110610cdf57610cdf614da4565b6020026020010151836040518363ffffffff1660e01b8152600401610d3492919073ffffffffffffffffffffffffffffffffffffffff9290921682526bffffffffffffffffffffffff16602082015260400190565b600060405180830381600087803b158015610d4e57600080fd5b505af1158015610d62573d6000803e3d6000fd5b505050505b50610d7181614dd3565b9050610b9b565b5050565b610d84612abc565b6000819003610dbf576040517f4f42be3d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600e610671828483614b3a565b60606006805480602002602001604051908101604052809291908181526020018280548015610e3157602002820191906000526020600020905b815473ffffffffffffffffffffffffffffffffffffffff168152600190910190602001808311610e06575b5050505050905090565b6060600f8054610e4a90614aa7565b9050600003610e85576040517f4f42be3d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600f8054610e9290614aa7565b80601f0160208091040260200160405190810160405280929190818152602001828054610ebe90614aa7565b8015610e315780601f10610ee057610100808354040283529160200191610e31565b820191906000526020600020905b815481529060010190602001808311610eee57509395945050505050565b3373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614610f7b576040517fc41a5b0900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008181526007602052604080822091909155517f8a4b97add3359bd6bcf5e82874363670eb5ad0f7615abddbd0ed0a3a98f0f41690610fbe9083815260200190565b60405180910390a150565b6040805161016081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e08101829052610100810182905261012081018290526101408101919091523373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614611091576040517fc41a5b0900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006110a461109f84614e2d565b612dfa565b90925090506110b96060840160408501614a8a565b825173ffffffffffffffffffffffffffffffffffffffff91909116907fbf50768ccf13bd0110ca6d53a9c4f1f3271abdd4c24a56878863ed25b20598ff3261110760c0880160a08901614f1a565b61111961016089016101408a01614a8a565b6111238980614f37565b6111356101208c016101008d01614f9c565b60208c013561114b6101008e0160e08f01614fb7565b6040518061016001604052808e6000015181526020018e6020015173ffffffffffffffffffffffffffffffffffffffff1681526020018e604001516bffffffffffffffffffffffff1681526020018e6060015173ffffffffffffffffffffffffffffffffffffffff1681526020018e6080015167ffffffffffffffff1681526020018e60a0015163ffffffff1681526020018d68ffffffffffffffffff1681526020018e60e0015168ffffffffffffffffff1681526020018e610100015164ffffffffff1681526020018e610120015164ffffffffff1681526020018e610140015163ffffffff1681525060405161124b99989796959493929190614fd4565b60405180910390a3505b919050565b60008061126789896131ac565b915091508115611278575050611867565b604080518b3580825262ffffff6020808f0135600881901c9290921690840152909290917fb04e63db38c49950639fa09d29872f21f5d49d614f3a969d8adf3d4b52e41a62910160405180910390a16112d58b8b8b8b8b8b613335565b6003546000906002906112f39060ff8082169161010090041661508a565b6112fd91906150a3565b61130890600161508a565b60ff169050888114611376576040517f660bd4ba00000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f77726f6e67206e756d626572206f66207369676e61747572657300000000000060448201526064016109d9565b888714611405576040517f660bd4ba00000000000000000000000000000000000000000000000000000000815260206004820152602860248201527f7265706f727420727320616e64207373206d757374206265206f66206571756160448201527f6c206c656e67746800000000000000000000000000000000000000000000000060648201526084016109d9565b3360009081526004602090815260408083208151808301909252805460ff80821684529293919291840191610100909104166002811115611448576114486150c5565b6002811115611459576114596150c5565b9052509050600281602001516002811115611476576114766150c5565b141580156114bf57506006816000015160ff168154811061149957611499614da4565b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff163314155b15611526576040517f660bd4ba00000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f756e617574686f72697a6564207472616e736d6974746572000000000000000060448201526064016109d9565b50505050611532613fc8565b60008a8a6040516115449291906150f4565b60405190819003812061155b918e90602001615104565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181528282528051602091820120838301909252600080845290830152915060005b898110156118575760006001848984602081106115c4576115c4614da4565b6115d191901a601b61508a565b8e8e868181106115e3576115e3614da4565b905060200201358d8d878181106115fc576115fc614da4565b9050602002013560405160008152602001604052604051611639949392919093845260ff9290921660208401526040830152606082015260800190565b6020604051602081039080840390855afa15801561165b573d6000803e3d6000fd5b5050604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081015173ffffffffffffffffffffffffffffffffffffffff811660009081526004602090815290849020838501909452835460ff808216855292965092945084019161010090041660028111156116db576116db6150c5565b60028111156116ec576116ec6150c5565b9052509250600183602001516002811115611709576117096150c5565b14611770576040517f660bd4ba00000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f61646472657373206e6f7420617574686f72697a656420746f207369676e000060448201526064016109d9565b8251600090869060ff16601f811061178a5761178a614da4565b602002015173ffffffffffffffffffffffffffffffffffffffff161461180c576040517f660bd4ba00000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f6e6f6e2d756e69717565207369676e617475726500000000000000000000000060448201526064016109d9565b8085846000015160ff16601f811061182657611826614da4565b73ffffffffffffffffffffffffffffffffffffffff90921660209290920201525061185081614dd3565b90506115a5565b505050611863826133ec565b5050505b5050505050505050565b611879612df2565b80516008805460208401516040808601516060870151608088015160a089015160c08a015160e08b015163ffffffff9a8b167fffffffffffffffffffffffffffffffffffffffffffffffff000000000000000090991698909817640100000000978b168802177fffffffffffffffffffffffffffffffff0000000000000000ffffffffffffffff1668010000000000000000958b16959095027fffffffffffffffffffffffffffffffff00000000ffffffffffffffffffffffff16949094176c01000000000000000000000000938a1693909302929092177fffffffffffffffffff00000000000000ffffffffffffffffffffffffffffffff1670010000000000000000000000000000000064ffffffffff909216919091027fffffffffffffffffff0000ffffffffffffffffffffffffffffffffffffffffff1617750100000000000000000000000000000000000000000061ffff928316021776ffffffffffffffffffffffffffffffffffffffffffffff167701000000000000000000000000000000000000000000000067ffffffffffffffff909316929092027effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff16919091177f010000000000000000000000000000000000000000000000000000000000000060ff90951694909402939093179093556101008501516101208601517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff9091167c0100000000000000000000000000000000000000000000000000000000919095160293909317600955610140840151600a80546101608701516101808801519385167fffffffffffffffffffffffffffffffffffffffffffffffffffffffff00000000909216919091176201000091851691909102177fffffffffffffffffffffffffffffffffffffffffffffffffffff0000ffffffff169190921690930292909217909155517f9832846a11905a128363408ace5f9803f449fcb017d3cf7e22a50c6e332931b290610fbe90839061478b565b60007f00000000000000000000000000000000000000000000000000000000000000006040517f10fc49c100000000000000000000000000000000000000000000000000000000815267ffffffffffffffff8816600482015263ffffffff8516602482015273ffffffffffffffffffffffffffffffffffffffff91909116906310fc49c19060440160006040518083038186803b158015611c0d57600080fd5b505afa158015611c21573d6000803e3d6000fd5b5050505066038d7ea4c68000821115611c66576040517f8129bbcd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000611c70612a2b565b90506000611cb387878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061067692505050565b90506000611cbf6129f2565b9050611cce868684868561353b565b9998505050505050505050565b6060600e8054611cea90614aa7565b9050600003611d25576040517f4f42be3d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600e8054610e9290614aa7565b855185518560ff16601f831115611da5576040517f89a6198900000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f746f6f206d616e79207369676e6572730000000000000000000000000000000060448201526064016109d9565b80600003611e0f576040517f89a6198900000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f66206d75737420626520706f736974697665000000000000000000000000000060448201526064016109d9565b818314611e9d576040517f89a61989000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f6f7261636c6520616464726573736573206f7574206f6620726567697374726160448201527f74696f6e0000000000000000000000000000000000000000000000000000000060648201526084016109d9565b611ea8816003615118565b8311611f10576040517f89a6198900000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f6661756c74792d6f7261636c65206620746f6f2068696768000000000000000060448201526064016109d9565b611f18612abc565b6040805160c0810182528a8152602081018a905260ff89169181018290526060810188905267ffffffffffffffff8716608082015260a0810186905290611f5f9088613699565b6005541561211457600554600090611f7990600190614d74565b9050600060058281548110611f9057611f90614da4565b60009182526020822001546006805473ffffffffffffffffffffffffffffffffffffffff90921693509084908110611fca57611fca614da4565b600091825260208083209091015473ffffffffffffffffffffffffffffffffffffffff85811684526004909252604080842080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00009081169091559290911680845292208054909116905560058054919250908061204a5761204a61512f565b60008281526020902081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90810180547fffffffffffffffffffffffff000000000000000000000000000000000000000016905501905560068054806120b3576120b361512f565b60008281526020902081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90810180547fffffffffffffffffffffffff000000000000000000000000000000000000000016905501905550611f5f915050565b60005b8151518110156126cb5781518051600091908390811061213957612139614da4565b602002602001015173ffffffffffffffffffffffffffffffffffffffff16036121be576040517f89a6198900000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f7369676e6572206d757374206e6f7420626520656d707479000000000000000060448201526064016109d9565b600073ffffffffffffffffffffffffffffffffffffffff16826020015182815181106121ec576121ec614da4565b602002602001015173ffffffffffffffffffffffffffffffffffffffff1603612271576040517f89a6198900000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f7472616e736d6974746572206d757374206e6f7420626520656d70747900000060448201526064016109d9565b6000600460008460000151848151811061228d5761228d614da4565b60209081029190910181015173ffffffffffffffffffffffffffffffffffffffff16825281019190915260400160002054610100900460ff1660028111156122d7576122d76150c5565b1461233e576040517f89a6198900000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f7265706561746564207369676e6572206164647265737300000000000000000060448201526064016109d9565b6040805180820190915260ff8216815260016020820152825180516004916000918590811061236f5761236f614da4565b60209081029190910181015173ffffffffffffffffffffffffffffffffffffffff168252818101929092526040016000208251815460ff9091167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0082168117835592840151919283917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00001617610100836002811115612410576124106150c5565b0217905550600091506124209050565b600460008460200151848151811061243a5761243a614da4565b60209081029190910181015173ffffffffffffffffffffffffffffffffffffffff16825281019190915260400160002054610100900460ff166002811115612484576124846150c5565b146124eb576040517f89a6198900000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f7265706561746564207472616e736d697474657220616464726573730000000060448201526064016109d9565b6040805180820190915260ff82168152602081016002815250600460008460200151848151811061251e5761251e614da4565b60209081029190910181015173ffffffffffffffffffffffffffffffffffffffff168252818101929092526040016000208251815460ff9091167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0082168117835592840151919283917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000016176101008360028111156125bf576125bf6150c5565b0217905550508251805160059250839081106125dd576125dd614da4565b602090810291909101810151825460018101845560009384529282902090920180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff909316929092179091558201518051600691908390811061265957612659614da4565b60209081029190910181015182546001810184556000938452919092200180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff909216919091179055806126c381614dd3565b915050612117565b506040810151600380547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660ff909216919091179055600180547fffffffff00000000ffffffffffffffffffffffffffffffffffffffffffffffff8116780100000000000000000000000000000000000000000000000063ffffffff43811682029290921780855592048116929182916014916127839184917401000000000000000000000000000000000000000090041661515e565b92506101000a81548163ffffffff021916908363ffffffff1602179055506127e24630600160149054906101000a900463ffffffff1663ffffffff16856000015186602001518760400151886060015189608001518a60a001516136b2565b600281905582518051600380547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff1661010060ff9093169290920291909117905560015460208501516040808701516060880151608089015160a08a015193517f1591690b8638f5fb2dbec82ac741805ac5da8b45dc5263f4875b0496fdce4e0598612899988b9891977401000000000000000000000000000000000000000090920463ffffffff1696909591949193919261517b565b60405180910390a15050505050505050505050565b6000806000600c8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663feaf968c6040518163ffffffff1660e01b815260040160a060405180830381865afa15801561291e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129429190614d24565b5093505092505080426129559190614d74565b600854640100000000900463ffffffff161080156129825750600854640100000000900463ffffffff1615155b156129af5750506009547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff16919050565b600082136129ec576040517f43d4cf66000000000000000000000000000000000000000000000000000000008152600481018390526024016109d9565b50919050565b600a54600090612a12906064906106909062010000900461ffff16612b3f565b905090565b612a1f612abc565b612a288161375d565b50565b60007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16632a905ccc6040518163ffffffff1660e01b8152600401602060405180830381865afa158015612a98573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a12919061520c565b60005473ffffffffffffffffffffffffffffffffffffffff163314612b3d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e65720000000000000000000060448201526064016109d9565b565b6000806000612b4c61086c565b9092509050612b8482612b6083601261508a565b612b6b90600a615349565b612b759087615118565b612b7f9190615358565b613852565b949350505050565b600068ffffffffffffffffff821115612c27576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203760448201527f322062697473000000000000000000000000000000000000000000000000000060648201526084016109d9565b5090565b600c546bffffffffffffffffffffffff16600003612c4557565b6000612c4f610dcc565b80519091506000819003612c8f576040517f30274b3a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600c54600090612cae9083906bffffffffffffffffffffffff16614cb3565b9050806bffffffffffffffffffffffff16600003612ccb57505050565b60005b82811015612d945781600b6000868481518110612ced57612ced614da4565b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282829054906101000a90046bffffffffffffffffffffffff16612d55919061536c565b92506101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff16021790555080612d8d90614dd3565b9050612cce565b50612d9f8282615391565b600c8054600090612dbf9084906bffffffffffffffffffffffff16614cde565b92506101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff160217905550505050565b612b3d612abc565b6040805161016081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e081018290526101008101829052610120810182905261014081019190915260085461010083015160009161ffff7501000000000000000000000000000000000000000000909104811691161115612eb8576040517fdada758700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000612ec78460000151610676565b9050612ed16129f2565b91506000612eea8560e001513a8488608001518761353b565b9050806bffffffffffffffffffffffff1685606001516bffffffffffffffffffffffff161015612f46576040517ff4d678b800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600954600090612f7c907c0100000000000000000000000000000000000000000000000000000000900463ffffffff16426153b9565b905060003087604001518860a001518960c001516001612f9c91906153cc565b8a5180516020918201206101008d015160e08e015160405161305098979695948c918c9132910173ffffffffffffffffffffffffffffffffffffffff9a8b168152988a1660208a015267ffffffffffffffff97881660408a0152959096166060880152608087019390935261ffff9190911660a086015263ffffffff90811660c08601526bffffffffffffffffffffffff9190911660e0850152919091166101008301529091166101208201526101400190565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815282825280516020918201206101608401835280845230848301526bffffffffffffffffffffffff8716848401528a83015173ffffffffffffffffffffffffffffffffffffffff16606085015260a0808c015167ffffffffffffffff1660808087019190915260e0808e015163ffffffff90811693880193909352908d015168ffffffffffffffffff90811660c08801528a169086015260085468010000000000000000810482166101008701526c01000000000000000000000000900481166101208601528616610140850152915192985090925061315c918891016144ce565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529181528151602092830120600093845260079092529091205550929491935090915050565b60006131e06040518060a0016040528060608152602001606081526020016060815260200160608152602001606081525090565b6000808080806131f2888a018a6154c8565b84519499509297509095509350915060ff16801580613212575084518114155b8061321e575083518114155b8061322a575082518114155b80613236575081518114155b1561329d576040517f660bd4ba00000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f4669656c6473206d75737420626520657175616c206c656e677468000000000060448201526064016109d9565b60005b81811015613303576132d98782815181106132bd576132bd614da4565b6020026020010151600090815260076020526040902054151590565b613303576132e8600183614d74565b81036132f357600198505b6132fc81614dd3565b90506132a0565b50506040805160a0810182529586526020860194909452928401919091526060830152608082015290505b9250929050565b6000613342826020615118565b61334d856020615118565b613359886101446153b9565b61336391906153b9565b61336d91906153b9565b6133789060006153b9565b90503681146133e3576040517f660bd4ba00000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f63616c6c64617461206c656e677468206d69736d61746368000000000000000060448201526064016109d9565b50505050505050565b80515160ff1660005b8181101561067157600061349e8460000151838151811061341857613418614da4565b60200260200101518560200151848151811061343657613436614da4565b60200260200101518660400151858151811061345457613454614da4565b60200260200101518760600151868151811061347257613472614da4565b60200260200101518860800151878151811061349057613490614da4565b6020026020010151886138f0565b905060008160068111156134b4576134b46150c5565b14806134d1575060018160068111156134cf576134cf6150c5565b145b1561352a5783518051839081106134ea576134ea614da4565b60209081029190910181015160405133815290917fc708e0440951fd63499c0f7a73819b469ee5dd3ecc356c0ab4eb7f18389009d9910160405180910390a25b5061353481614dd3565b90506133f5565b600854600090700100000000000000000000000000000000900464ffffffffff1685101561358457600854700100000000000000000000000000000000900464ffffffffff1694505b60085460009087906135ba9063ffffffff6c0100000000000000000000000082048116916801000000000000000090041661515e565b6135c4919061515e565b600a5463ffffffff9190911691506000906135ea90640100000000900461ffff16613d82565b90506000816135f9848a615118565b61360391906153b9565b600854909150600090612710906136209063ffffffff1684615118565b61362a9190615358565b61363490836153b9565b9050600061364182613ece565b905060008768ffffffffffffffffff168968ffffffffffffffffff168b68ffffffffffffffffff16613673919061536c565b61367d919061536c565b9050613689818361536c565b9c9b505050505050505050505050565b60006136a3610dcc565b511115610d7857610d78612c2b565b6000808a8a8a8a8a8a8a8a8a6040516020016136d69998979695949392919061559a565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815291905280516020909101207dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167e01000000000000000000000000000000000000000000000000000000000000179150509998505050505050505050565b3373ffffffffffffffffffffffffffffffffffffffff8216036137dc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c6600000000000000000060448201526064016109d9565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b60006bffffffffffffffffffffffff821115612c27576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203960448201527f362062697473000000000000000000000000000000000000000000000000000060648201526084016109d9565b600080848060200190518101906139079190615666565b905060003a826101200151836101000151613922919061572e565b64ffffffffff166139339190615118565b9050600060ff851661394436613d82565b61394e9190615358565b9050600061396461395f83856153b9565b613ece565b905060006139713a613ece565b90506000807f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663330605298e8e868b60c0015168ffffffffffffffffff168c60e0015168ffffffffffffffffff168a6139e0919061536c565b6139ea919061536c565b336040518061016001604052808f6000015181526020018f6020015173ffffffffffffffffffffffffffffffffffffffff1681526020018f604001516bffffffffffffffffffffffff1681526020018f6060015173ffffffffffffffffffffffffffffffffffffffff1681526020018f6080015167ffffffffffffffff1681526020018f60a0015163ffffffff168152602001600068ffffffffffffffffff1681526020018f60e0015168ffffffffffffffffff1681526020018f610100015164ffffffffff1681526020018f610120015164ffffffffff1681526020018f610140015163ffffffff168152506040518763ffffffff1660e01b8152600401613af89695949392919061574c565b60408051808303816000875af1158015613b16573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613b3a91906157c8565b90925090506000826006811115613b5357613b536150c5565b1480613b7057506001826006811115613b6e57613b6e6150c5565b145b15613d715760008e815260076020526040812055613b8e818561536c565b336000908152600b602052604081208054909190613bbb9084906bffffffffffffffffffffffff1661536c565b92506101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055508660e0015168ffffffffffffffffff16600c60008282829054906101000a90046bffffffffffffffffffffffff16613c21919061536c565b92506101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055508660c0015168ffffffffffffffffff16600b6000613c6b613eed565b73ffffffffffffffffffffffffffffffffffffffff168152602081019190915260400160009081208054909190613cb19084906bffffffffffffffffffffffff1661536c565b92506101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055508d7f08a4a0761e3c98d288cb4af9342660f49550d83139fb3b762b70d34bed6273688487848b60e0015160008d60c00151604051613d68969594939291906bffffffffffffffffffffffff9687168152602081019590955292909416604084015268ffffffffffffffffff9081166060840152928316608083015290911660a082015260c00190565b60405180910390a25b509c9b505050505050505050505050565b600046613d8e81613f5e565b15613e23576000606c73ffffffffffffffffffffffffffffffffffffffff166341b247a86040518163ffffffff1660e01b815260040160c060405180830381865afa158015613de1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613e0591906157fb565b50505050915050608c84613e1991906153b9565b612b849082615118565b613e2c81613f81565b15613ec5576040517ff1c7a58b0000000000000000000000000000000000000000000000000000000081526004810184905273420000000000000000000000000000000000000f9063f1c7a58b90602401602060405180830381865afa158015613e9a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613ebe9190615845565b9392505050565b50600092915050565b60006106ad613edb6128ae565b612b7584670de0b6b3a7640000615118565b60003073ffffffffffffffffffffffffffffffffffffffff16638da5cb5b6040518163ffffffff1660e01b8152600401602060405180830381865afa158015613f3a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a12919061585e565b600061a4b1821480613f72575062066eed82145b806106ad57505062066eee1490565b6000600a821480613f9357506101a482145b80613fa0575062aa37dc82145b80613fac575061210582145b80613fb9575062014a3382145b806106ad57505062014a341490565b604051806103e00160405280601f906020820280368337509192915050565b60008083601f840112613ff957600080fd5b50813567ffffffffffffffff81111561401157600080fd5b60208301915083602082850101111561332e57600080fd5b6000806020838503121561403c57600080fd5b823567ffffffffffffffff81111561405357600080fd5b61405f85828601613fe7565b90969095509350505050565b6000815180845260005b8181101561409157602081850181015186830182015201614075565b5060006020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b602081526000613ebe602083018461406b565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040516101a0810167ffffffffffffffff81118282101715614135576141356140e2565b60405290565b604051610160810167ffffffffffffffff81118282101715614135576141356140e2565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff811182821017156141a6576141a66140e2565b604052919050565b600082601f8301126141bf57600080fd5b813567ffffffffffffffff8111156141d9576141d96140e2565b61420a60207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8401160161415f565b81815284602083860101111561421f57600080fd5b816020850160208301376000918101602001919091529392505050565b60006020828403121561424e57600080fd5b813567ffffffffffffffff81111561426557600080fd5b612b84848285016141ae565b73ffffffffffffffffffffffffffffffffffffffff81168114612a2857600080fd5b803561125581614271565b6bffffffffffffffffffffffff81168114612a2857600080fd5b80356112558161429e565b600080604083850312156142d657600080fd5b82356142e181614271565b915060208301356142f18161429e565b809150509250929050565b600081518084526020808501945080840160005b8381101561434257815173ffffffffffffffffffffffffffffffffffffffff1687529582019590820190600101614310565b509495945050505050565b602081526000613ebe60208301846142fc565b60006020828403121561437257600080fd5b5035919050565b60006020828403121561438b57600080fd5b813567ffffffffffffffff8111156143a257600080fd5b82016101608185031215613ebe57600080fd5b8051825260208101516143e0602084018273ffffffffffffffffffffffffffffffffffffffff169052565b50604081015161440060408401826bffffffffffffffffffffffff169052565b506060810151614428606084018273ffffffffffffffffffffffffffffffffffffffff169052565b506080810151614444608084018267ffffffffffffffff169052565b5060a081015161445c60a084018263ffffffff169052565b5060c081015161447960c084018268ffffffffffffffffff169052565b5060e081015161449660e084018268ffffffffffffffffff169052565b506101008181015164ffffffffff9081169184019190915261012080830151909116908301526101409081015163ffffffff16910152565b61016081016106ad82846143b5565b60008083601f8401126144ef57600080fd5b50813567ffffffffffffffff81111561450757600080fd5b6020830191508360208260051b850101111561332e57600080fd5b60008060008060008060008060e0898b03121561453e57600080fd5b606089018a81111561454f57600080fd5b8998503567ffffffffffffffff8082111561456957600080fd5b6145758c838d01613fe7565b909950975060808b013591508082111561458e57600080fd5b61459a8c838d016144dd565b909750955060a08b01359150808211156145b357600080fd5b506145c08b828c016144dd565b999c989b50969995989497949560c00135949350505050565b63ffffffff81168114612a2857600080fd5b8035611255816145d9565b64ffffffffff81168114612a2857600080fd5b8035611255816145f6565b803561ffff8116811461125557600080fd5b67ffffffffffffffff81168114612a2857600080fd5b803561125581614626565b60ff81168114612a2857600080fd5b803561125581614647565b80357bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8116811461125557600080fd5b60006101a082840312156146a057600080fd5b6146a8614111565b6146b1836145eb565b81526146bf602084016145eb565b60208201526146d0604084016145eb565b60408201526146e1606084016145eb565b60608201526146f260808401614609565b608082015261470360a08401614614565b60a082015261471460c0840161463c565b60c082015261472560e08401614656565b60e0820152610100614738818501614661565b9082015261012061474a8482016145eb565b9082015261014061475c848201614614565b9082015261016061476e848201614614565b90820152610180614780848201614614565b908201529392505050565b815163ffffffff1681526101a0810160208301516147b1602084018263ffffffff169052565b5060408301516147c9604084018263ffffffff169052565b5060608301516147e1606084018263ffffffff169052565b5060808301516147fa608084018264ffffffffff169052565b5060a083015161481060a084018261ffff169052565b5060c083015161482c60c084018267ffffffffffffffff169052565b5060e083015161484160e084018260ff169052565b50610100838101517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff16908301526101208084015163ffffffff16908301526101408084015161ffff90811691840191909152610160808501518216908401526101808085015191821681850152905b505092915050565b6000806000806000608086880312156148cd57600080fd5b85356148d881614626565b9450602086013567ffffffffffffffff8111156148f457600080fd5b61490088828901613fe7565b9095509350506040860135614914816145d9565b949793965091946060013592915050565b600067ffffffffffffffff82111561493f5761493f6140e2565b5060051b60200190565b600082601f83011261495a57600080fd5b8135602061496f61496a83614925565b61415f565b82815260059290921b8401810191818101908684111561498e57600080fd5b8286015b848110156149b25780356149a581614271565b8352918301918301614992565b509695505050505050565b60008060008060008060c087890312156149d657600080fd5b863567ffffffffffffffff808211156149ee57600080fd5b6149fa8a838b01614949565b97506020890135915080821115614a1057600080fd5b614a1c8a838b01614949565b9650614a2a60408a01614656565b95506060890135915080821115614a4057600080fd5b614a4c8a838b016141ae565b9450614a5a60808a0161463c565b935060a0890135915080821115614a7057600080fd5b50614a7d89828a016141ae565b9150509295509295509295565b600060208284031215614a9c57600080fd5b8135613ebe81614271565b600181811c90821680614abb57607f821691505b6020821081036129ec577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b601f82111561067157600081815260208120601f850160051c81016020861015614b1b5750805b601f850160051c820191505b8181101561086457828155600101614b27565b67ffffffffffffffff831115614b5257614b526140e2565b614b6683614b608354614aa7565b83614af4565b6000601f841160018114614bb85760008515614b825750838201355b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600387901b1c1916600186901b178355614c4e565b6000838152602090207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0861690835b82811015614c075786850135825560209485019460019092019101614be7565b5086821015614c42577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60f88860031b161c19848701351681555b505060018560011b0183555b5050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006bffffffffffffffffffffffff80841680614cd257614cd2614c55565b92169190910492915050565b6bffffffffffffffffffffffff828116828216039080821115614d0357614d03614c84565b5092915050565b805169ffffffffffffffffffff8116811461125557600080fd5b600080600080600060a08688031215614d3c57600080fd5b614d4586614d0a565b9450602086015193506040860151925060608601519150614d6860808701614d0a565b90509295509295909350565b818103818111156106ad576106ad614c84565b600060208284031215614d9957600080fd5b8151613ebe81614647565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203614e0457614e04614c84565b5060010190565b68ffffffffffffffffff81168114612a2857600080fd5b803561125581614e0b565b60006101608236031215614e4057600080fd5b614e4861413b565b823567ffffffffffffffff811115614e5f57600080fd5b614e6b368286016141ae565b82525060208301356020820152614e8460408401614293565b6040820152614e95606084016142b8565b6060820152614ea660808401614e22565b6080820152614eb760a0840161463c565b60a0820152614ec860c0840161463c565b60c0820152614ed960e084016145eb565b60e0820152610100614eec818501614614565b90820152610120614efe84820161463c565b90820152610140614f10848201614293565b9082015292915050565b600060208284031215614f2c57600080fd5b8135613ebe81614626565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112614f6c57600080fd5b83018035915067ffffffffffffffff821115614f8757600080fd5b60200191503681900382131561332e57600080fd5b600060208284031215614fae57600080fd5b613ebe82614614565b600060208284031215614fc957600080fd5b8135613ebe816145d9565b73ffffffffffffffffffffffffffffffffffffffff8a8116825267ffffffffffffffff8a166020830152881660408201526102406060820181905281018690526000610260878982850137600083890182015261ffff8716608084015260a0830186905263ffffffff851660c0840152601f88017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016830101905061507c60e08301846143b5565b9a9950505050505050505050565b60ff81811683821601908111156106ad576106ad614c84565b600060ff8316806150b6576150b6614c55565b8060ff84160491505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b8183823760009101908152919050565b828152606082602083013760800192915050565b80820281158282048414176106ad576106ad614c84565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b63ffffffff818116838216019080821115614d0357614d03614c84565b600061012063ffffffff808d1684528b6020850152808b166040850152508060608401526151ab8184018a6142fc565b905082810360808401526151bf81896142fc565b905060ff871660a084015282810360c08401526151dc818761406b565b905067ffffffffffffffff851660e0840152828103610100840152613689818561406b565b805161125581614e0b565b60006020828403121561521e57600080fd5b8151613ebe81614e0b565b600181815b8085111561528257817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0482111561526857615268614c84565b8085161561527557918102915b93841c939080029061522e565b509250929050565b600082615299575060016106ad565b816152a6575060006106ad565b81600181146152bc57600281146152c6576152e2565b60019150506106ad565b60ff8411156152d7576152d7614c84565b50506001821b6106ad565b5060208310610133831016604e8410600b8410161715615305575081810a6106ad565b61530f8383615229565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0482111561534157615341614c84565b029392505050565b6000613ebe60ff84168361528a565b60008261536757615367614c55565b500490565b6bffffffffffffffffffffffff818116838216019080821115614d0357614d03614c84565b6bffffffffffffffffffffffff8181168382160280821691908281146148ad576148ad614c84565b808201808211156106ad576106ad614c84565b67ffffffffffffffff818116838216019080821115614d0357614d03614c84565b600082601f8301126153fe57600080fd5b8135602061540e61496a83614925565b82815260059290921b8401810191818101908684111561542d57600080fd5b8286015b848110156149b25780358352918301918301615431565b600082601f83011261545957600080fd5b8135602061546961496a83614925565b82815260059290921b8401810191818101908684111561548857600080fd5b8286015b848110156149b257803567ffffffffffffffff8111156154ac5760008081fd5b6154ba8986838b01016141ae565b84525091830191830161548c565b600080600080600060a086880312156154e057600080fd5b853567ffffffffffffffff808211156154f857600080fd5b61550489838a016153ed565b9650602088013591508082111561551a57600080fd5b61552689838a01615448565b9550604088013591508082111561553c57600080fd5b61554889838a01615448565b9450606088013591508082111561555e57600080fd5b61556a89838a01615448565b9350608088013591508082111561558057600080fd5b5061558d88828901615448565b9150509295509295909350565b60006101208b835273ffffffffffffffffffffffffffffffffffffffff8b16602084015267ffffffffffffffff808b1660408501528160608501526155e18285018b6142fc565b915083820360808501526155f5828a6142fc565b915060ff881660a085015283820360c0850152615612828861406b565b90861660e08501528381036101008501529050613689818561406b565b805161125581614271565b80516112558161429e565b805161125581614626565b8051611255816145d9565b8051611255816145f6565b6000610160828403121561567957600080fd5b61568161413b565b825181526156916020840161562f565b60208201526156a26040840161563a565b60408201526156b36060840161562f565b60608201526156c460808401615645565b60808201526156d560a08401615650565b60a08201526156e660c08401615201565b60c08201526156f760e08401615201565b60e082015261010061570a81850161565b565b9082015261012061571c84820161565b565b90820152610140614780848201615650565b64ffffffffff818116838216019080821115614d0357614d03614c84565b60006102008083526157608184018a61406b565b90508281036020840152615774818961406b565b6bffffffffffffffffffffffff88811660408601528716606085015273ffffffffffffffffffffffffffffffffffffffff8616608085015291506157bd905060a08301846143b5565b979650505050505050565b600080604083850312156157db57600080fd5b8251600781106157ea57600080fd5b60208401519092506142f18161429e565b60008060008060008060c0878903121561581457600080fd5b865195506020870151945060408701519350606087015192506080870151915060a087015190509295509295509295565b60006020828403121561585757600080fd5b5051919050565b60006020828403121561587057600080fd5b8151613ebe8161427156fea164736f6c6343000813000a", } var FunctionsCoordinatorABI = FunctionsCoordinatorMetaData.ABI @@ -1873,7 +1874,7 @@ func (FunctionsCoordinatorConfigSet) Topic() common.Hash { } func (FunctionsCoordinatorConfigUpdated) Topic() common.Hash { - return common.HexToHash("0x2e2c8535dcc25459d519f2300c114d2d2128bf6399722d04eca078461a3bf33a") + return common.HexToHash("0x9832846a11905a128363408ace5f9803f449fcb017d3cf7e22a50c6e332931b2") } func (FunctionsCoordinatorOracleRequest) Topic() common.Hash { diff --git a/core/gethwrappers/functions/generation/generated-wrapper-dependency-versions-do-not-edit.txt b/core/gethwrappers/functions/generation/generated-wrapper-dependency-versions-do-not-edit.txt index 70ac49d79d3..5153e4055f3 100644 --- a/core/gethwrappers/functions/generation/generated-wrapper-dependency-versions-do-not-edit.txt +++ b/core/gethwrappers/functions/generation/generated-wrapper-dependency-versions-do-not-edit.txt @@ -1,10 +1,10 @@ GETH_VERSION: 1.13.8 functions: ../../../contracts/solc/v0.8.19/functions/v1_X/FunctionsRequest.abi ../../../contracts/solc/v0.8.19/functions/v1_X/FunctionsRequest.bin 3c972870b0afeb6d73a29ebb182f24956a2cebb127b21c4f867d1ecf19a762db -functions_allow_list: ../../../contracts/solc/v0.8.19/functions/v1_X/TermsOfServiceAllowList.abi ../../../contracts/solc/v0.8.19/functions/v1_X/TermsOfServiceAllowList.bin 268de8b3c061b53a1a2a1ccc0149eff68545959e29cd41b5f2e9f5dab19075cf +functions_allow_list: ../../../contracts/solc/v0.8.19/functions/v1_X/TermsOfServiceAllowList.abi ../../../contracts/solc/v0.8.19/functions/v1_X/TermsOfServiceAllowList.bin 6581a3e82c8a6b5532addb8278ff520d18f38c2be4ac07ed0ad9ccc2e6825e48 functions_billing_registry_events_mock: ../../../contracts/solc/v0.8.6/functions/v0_0_0/FunctionsBillingRegistryEventsMock.abi ../../../contracts/solc/v0.8.6/functions/v0_0_0/FunctionsBillingRegistryEventsMock.bin 50deeb883bd9c3729702be335c0388f9d8553bab4be5e26ecacac496a89e2b77 functions_client: ../../../contracts/solc/v0.8.19/functions/v1_X/FunctionsClient.abi ../../../contracts/solc/v0.8.19/functions/v1_X/FunctionsClient.bin 2368f537a04489c720a46733f8596c4fc88a31062ecfa966d05f25dd98608aca functions_client_example: ../../../contracts/solc/v0.8.19/functions/v1_X/FunctionsClientExample.abi ../../../contracts/solc/v0.8.19/functions/v1_X/FunctionsClientExample.bin abf32e69f268f40e8530eb8d8e96bf310b798a4c0049a58022d9d2fb527b601b -functions_coordinator: ../../../contracts/solc/v0.8.19/functions/v1_X/FunctionsCoordinator.abi ../../../contracts/solc/v0.8.19/functions/v1_X/FunctionsCoordinator.bin 97a625c7ce8c8c167faad5e532a5894a52af5dee722b2da7e7528f5eaa32a0fe +functions_coordinator: ../../../contracts/solc/v0.8.19/functions/v1_X/FunctionsCoordinator.abi ../../../contracts/solc/v0.8.19/functions/v1_X/FunctionsCoordinator.bin 02133ef8399900d3b6fd1cd908d3d16f7e4b57b6ebea05ee79962e8d57f71144 functions_load_test_client: ../../../contracts/solc/v0.8.19/functions/v1_X/FunctionsLoadTestClient.abi ../../../contracts/solc/v0.8.19/functions/v1_X/FunctionsLoadTestClient.bin c8dbbd5ebb34435800d6674700068837c3a252db60046a14b0e61e829db517de functions_oracle_events_mock: ../../../contracts/solc/v0.8.6/functions/v0_0_0/FunctionsOracleEventsMock.abi ../../../contracts/solc/v0.8.6/functions/v0_0_0/FunctionsOracleEventsMock.bin 3ca70f966f8fe751987f0ccb50bebb6aa5be77e4a9f835d1ae99e0e9bfb7d52c functions_router: ../../../contracts/solc/v0.8.19/functions/v1_X/FunctionsRouter.abi ../../../contracts/solc/v0.8.19/functions/v1_X/FunctionsRouter.bin 1f6d18f9e0846ad74b37a0a6acef5942ab73ace1e84307f201899f69e732e776 diff --git a/core/gethwrappers/generated/arbitrum_module/arbitrum_module.go b/core/gethwrappers/generated/arbitrum_module/arbitrum_module.go index 537fbe21544..ca9b77d563f 100644 --- a/core/gethwrappers/generated/arbitrum_module/arbitrum_module.go +++ b/core/gethwrappers/generated/arbitrum_module/arbitrum_module.go @@ -29,8 +29,8 @@ var ( ) var ArbitrumModuleMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"n\",\"type\":\"uint256\"}],\"name\":\"blockHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"blockNumber\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getCurrentL1Fee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getGasOverhead\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"chainModuleFixedOverhead\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"chainModulePerByteOverhead\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"dataSize\",\"type\":\"uint256\"}],\"name\":\"getMaxL1Fee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", - Bin: "0x608060405234801561001057600080fd5b5061041b806100206000396000f3fe608060405234801561001057600080fd5b50600436106100675760003560e01c806357e871e71161005057806357e871e71461009a57806385df51fd146100a2578063de9ee35e146100b557600080fd5b8063125441401461006c57806318b8f61314610092575b600080fd5b61007f61007a366004610333565b6100cb565b6040519081526020015b60405180910390f35b61007f610158565b61007f6101cf565b61007f6100b0366004610333565b61021d565b6040805161138881526000602082015201610089565b600080606c73ffffffffffffffffffffffffffffffffffffffff166341b247a86040518163ffffffff1660e01b815260040160c060405180830381865afa15801561011a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061013e919061034c565b50505050915050828161015191906103c5565b9392505050565b6000606c73ffffffffffffffffffffffffffffffffffffffff1663c6f7de0e6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156101a6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101ca91906103e2565b905090565b6000606473ffffffffffffffffffffffffffffffffffffffff1663a3b1b31d6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156101a6573d6000803e3d6000fd5b600080606473ffffffffffffffffffffffffffffffffffffffff1663a3b1b31d6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561026c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061029091906103e2565b905080831015806102ab57506101006102a984836103fb565b115b156102b95750600092915050565b6040517f2b407a8200000000000000000000000000000000000000000000000000000000815260048101849052606490632b407a8290602401602060405180830381865afa15801561030f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061015191906103e2565b60006020828403121561034557600080fd5b5035919050565b60008060008060008060c0878903121561036557600080fd5b865195506020870151945060408701519350606087015192506080870151915060a087015190509295509295509295565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b80820281158282048414176103dc576103dc610396565b92915050565b6000602082840312156103f457600080fd5b5051919050565b818103818111156103dc576103dc61039656fea164736f6c6343000813000a", + ABI: "[{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"n\",\"type\":\"uint256\"}],\"name\":\"blockHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"blockNumber\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"getCurrentL1Fee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getGasOverhead\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"chainModuleFixedOverhead\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"chainModulePerByteOverhead\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"dataSize\",\"type\":\"uint256\"}],\"name\":\"getMaxL1Fee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", + Bin: "0x608060405234801561001057600080fd5b5061044a806100206000396000f3fe608060405234801561001057600080fd5b50600436106100675760003560e01c80637810d12a116100505780637810d12a1461009a57806385df51fd146100ad578063de9ee35e146100c057600080fd5b8063125441401461006c57806357e871e714610092575b600080fd5b61007f61007a366004610368565b6100d6565b6040519081526020015b60405180910390f35b61007f610163565b61007f6100a8366004610368565b6101da565b61007f6100bb366004610368565b610252565b6040805161138881526000602082015201610089565b600080606c73ffffffffffffffffffffffffffffffffffffffff166341b247a86040518163ffffffff1660e01b815260040160c060405180830381865afa158015610125573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101499190610381565b50505050915050828161015c91906103fa565b9392505050565b6000606473ffffffffffffffffffffffffffffffffffffffff1663a3b1b31d6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156101b1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101d59190610411565b905090565b6000606c73ffffffffffffffffffffffffffffffffffffffff1663c6f7de0e6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610228573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061024c9190610411565b92915050565b600080606473ffffffffffffffffffffffffffffffffffffffff1663a3b1b31d6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156102a1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102c59190610411565b905080831015806102e057506101006102de848361042a565b115b156102ee5750600092915050565b6040517f2b407a8200000000000000000000000000000000000000000000000000000000815260048101849052606490632b407a8290602401602060405180830381865afa158015610344573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061015c9190610411565b60006020828403121561037a57600080fd5b5035919050565b60008060008060008060c0878903121561039a57600080fd5b865195506020870151945060408701519350606087015192506080870151915060a087015190509295509295509295565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b808202811582820484141761024c5761024c6103cb565b60006020828403121561042357600080fd5b5051919050565b8181038181111561024c5761024c6103cb56fea164736f6c6343000813000a", } var ArbitrumModuleABI = ArbitrumModuleMetaData.ABI @@ -213,9 +213,9 @@ func (_ArbitrumModule *ArbitrumModuleCallerSession) BlockNumber() (*big.Int, err return _ArbitrumModule.Contract.BlockNumber(&_ArbitrumModule.CallOpts) } -func (_ArbitrumModule *ArbitrumModuleCaller) GetCurrentL1Fee(opts *bind.CallOpts) (*big.Int, error) { +func (_ArbitrumModule *ArbitrumModuleCaller) GetCurrentL1Fee(opts *bind.CallOpts, arg0 *big.Int) (*big.Int, error) { var out []interface{} - err := _ArbitrumModule.contract.Call(opts, &out, "getCurrentL1Fee") + err := _ArbitrumModule.contract.Call(opts, &out, "getCurrentL1Fee", arg0) if err != nil { return *new(*big.Int), err @@ -227,12 +227,12 @@ func (_ArbitrumModule *ArbitrumModuleCaller) GetCurrentL1Fee(opts *bind.CallOpts } -func (_ArbitrumModule *ArbitrumModuleSession) GetCurrentL1Fee() (*big.Int, error) { - return _ArbitrumModule.Contract.GetCurrentL1Fee(&_ArbitrumModule.CallOpts) +func (_ArbitrumModule *ArbitrumModuleSession) GetCurrentL1Fee(arg0 *big.Int) (*big.Int, error) { + return _ArbitrumModule.Contract.GetCurrentL1Fee(&_ArbitrumModule.CallOpts, arg0) } -func (_ArbitrumModule *ArbitrumModuleCallerSession) GetCurrentL1Fee() (*big.Int, error) { - return _ArbitrumModule.Contract.GetCurrentL1Fee(&_ArbitrumModule.CallOpts) +func (_ArbitrumModule *ArbitrumModuleCallerSession) GetCurrentL1Fee(arg0 *big.Int) (*big.Int, error) { + return _ArbitrumModule.Contract.GetCurrentL1Fee(&_ArbitrumModule.CallOpts, arg0) } func (_ArbitrumModule *ArbitrumModuleCaller) GetGasOverhead(opts *bind.CallOpts) (GetGasOverhead, @@ -301,7 +301,7 @@ type ArbitrumModuleInterface interface { BlockNumber(opts *bind.CallOpts) (*big.Int, error) - GetCurrentL1Fee(opts *bind.CallOpts) (*big.Int, error) + GetCurrentL1Fee(opts *bind.CallOpts, arg0 *big.Int) (*big.Int, error) GetGasOverhead(opts *bind.CallOpts) (GetGasOverhead, diff --git a/core/gethwrappers/generated/automation_registry_logic_b_wrapper_2_3/automation_registry_logic_b_wrapper_2_3.go b/core/gethwrappers/generated/automation_registry_logic_b_wrapper_2_3/automation_registry_logic_b_wrapper_2_3.go index acbf11155db..c2a808d5545 100644 --- a/core/gethwrappers/generated/automation_registry_logic_b_wrapper_2_3/automation_registry_logic_b_wrapper_2_3.go +++ b/core/gethwrappers/generated/automation_registry_logic_b_wrapper_2_3/automation_registry_logic_b_wrapper_2_3.go @@ -57,7 +57,7 @@ type AutomationRegistryBase23PaymentReceipt struct { var AutomationRegistryLogicBMetaData = &bind.MetaData{ ABI: "[{\"inputs\":[{\"internalType\":\"contractAutomationRegistryLogicC2_3\",\"name\":\"logicC\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"ArrayHasNoEntries\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"CannotCancel\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"CheckDataExceedsLimit\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ConfigDigestMismatch\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DuplicateEntry\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DuplicateSigners\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"GasLimitCanOnlyIncrease\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"GasLimitOutsideRange\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"IncorrectNumberOfFaultyOracles\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"IncorrectNumberOfSignatures\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"IncorrectNumberOfSigners\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"IndexOutOfRange\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"available\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"requested\",\"type\":\"uint256\"}],\"name\":\"InsufficientBalance\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InsufficientLinkLiquidity\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidDataLength\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidFeed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidPayee\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidRecipient\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidReport\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidSigner\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidToken\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidTransmitter\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidTrigger\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidTriggerType\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"MigrationNotPermitted\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"MustSettleOffchain\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"MustSettleOnchain\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotAContract\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyActiveSigners\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyActiveTransmitters\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCallableByAdmin\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCallableByLINKToken\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCallableByOwnerOrAdmin\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCallableByOwnerOrRegistrar\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCallableByPayee\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCallableByProposedAdmin\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCallableByProposedPayee\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCallableByUpkeepPrivilegeManager\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyFinanceAdmin\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyPausedUpkeep\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlySimulatedBackend\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyUnpausedUpkeep\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ParameterLengthError\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ReentrantCall\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RegistryPaused\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RepeatedSigner\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RepeatedTransmitter\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"reason\",\"type\":\"bytes\"}],\"name\":\"TargetCheckReverted\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TooManyOracles\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TranscoderNotSet\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TransferFailed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UpkeepAlreadyExists\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UpkeepCancelled\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UpkeepNotCanceled\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UpkeepNotNeeded\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ValueNotChanged\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddressNotAllowed\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"admin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"privilegeConfig\",\"type\":\"bytes\"}],\"name\":\"AdminPrivilegeConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"components\":[{\"internalType\":\"uint32\",\"name\":\"gasFeePPB\",\"type\":\"uint32\"},{\"internalType\":\"uint24\",\"name\":\"flatFeeMilliCents\",\"type\":\"uint24\"}],\"indexed\":false,\"internalType\":\"structAutomationRegistryBase2_3.BillingOverrides\",\"name\":\"overrides\",\"type\":\"tuple\"}],\"name\":\"BillingConfigOverridden\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"BillingConfigOverrideRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contractIERC20Metadata\",\"name\":\"token\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"uint32\",\"name\":\"gasFeePPB\",\"type\":\"uint32\"},{\"internalType\":\"uint24\",\"name\":\"flatFeeMilliCents\",\"type\":\"uint24\"},{\"internalType\":\"contractAggregatorV3Interface\",\"name\":\"priceFeed\",\"type\":\"address\"},{\"internalType\":\"uint8\",\"name\":\"decimals\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"fallbackPrice\",\"type\":\"uint256\"},{\"internalType\":\"uint96\",\"name\":\"minSpend\",\"type\":\"uint96\"}],\"indexed\":false,\"internalType\":\"structAutomationRegistryBase2_3.BillingConfig\",\"name\":\"config\",\"type\":\"tuple\"}],\"name\":\"BillingConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"trigger\",\"type\":\"bytes\"}],\"name\":\"CancelledUpkeepReport\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newModule\",\"type\":\"address\"}],\"name\":\"ChainSpecificModuleUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"dedupKey\",\"type\":\"bytes32\"}],\"name\":\"DedupKeyAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"assetAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"FeesWithdrawn\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"}],\"name\":\"FundsAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"FundsWithdrawn\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"trigger\",\"type\":\"bytes\"}],\"name\":\"InsufficientFundsUpkeepReport\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"payees\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"uint256[]\",\"name\":\"payments\",\"type\":\"uint256[]\"}],\"name\":\"NOPsSettledOffchain\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"Paused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"transmitters\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"payees\",\"type\":\"address[]\"}],\"name\":\"PayeesUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"transmitter\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"PayeeshipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"transmitter\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"PayeeshipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"transmitter\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"payee\",\"type\":\"address\"}],\"name\":\"PaymentWithdrawn\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"trigger\",\"type\":\"bytes\"}],\"name\":\"ReorgedUpkeepReport\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"trigger\",\"type\":\"bytes\"}],\"name\":\"StaleUpkeepReport\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"Unpaused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"UpkeepAdminTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"UpkeepAdminTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"atBlockHeight\",\"type\":\"uint64\"}],\"name\":\"UpkeepCanceled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"components\":[{\"internalType\":\"uint96\",\"name\":\"gasChargeInBillingToken\",\"type\":\"uint96\"},{\"internalType\":\"uint96\",\"name\":\"premiumInBillingToken\",\"type\":\"uint96\"},{\"internalType\":\"uint96\",\"name\":\"gasReimbursementInJuels\",\"type\":\"uint96\"},{\"internalType\":\"uint96\",\"name\":\"premiumInJuels\",\"type\":\"uint96\"},{\"internalType\":\"contractIERC20Metadata\",\"name\":\"billingToken\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"linkUSD\",\"type\":\"uint96\"},{\"internalType\":\"uint96\",\"name\":\"nativeUSD\",\"type\":\"uint96\"},{\"internalType\":\"uint96\",\"name\":\"billingUSD\",\"type\":\"uint96\"}],\"indexed\":false,\"internalType\":\"structAutomationRegistryBase2_3.PaymentReceipt\",\"name\":\"receipt\",\"type\":\"tuple\"}],\"name\":\"UpkeepCharged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"newCheckData\",\"type\":\"bytes\"}],\"name\":\"UpkeepCheckDataSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"gasLimit\",\"type\":\"uint96\"}],\"name\":\"UpkeepGasLimitSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"remainingBalance\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"name\":\"UpkeepMigrated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"offchainConfig\",\"type\":\"bytes\"}],\"name\":\"UpkeepOffchainConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"UpkeepPaused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"bool\",\"name\":\"success\",\"type\":\"bool\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"totalPayment\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"gasUsed\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"gasOverhead\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"trigger\",\"type\":\"bytes\"}],\"name\":\"UpkeepPerformed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"privilegeConfig\",\"type\":\"bytes\"}],\"name\":\"UpkeepPrivilegeConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"startingBalance\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"importedFrom\",\"type\":\"address\"}],\"name\":\"UpkeepReceived\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"performGas\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"admin\",\"type\":\"address\"}],\"name\":\"UpkeepRegistered\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"triggerConfig\",\"type\":\"bytes\"}],\"name\":\"UpkeepTriggerConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"UpkeepUnpaused\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"acceptUpkeepAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"}],\"name\":\"addFunds\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"bytes[]\",\"name\":\"values\",\"type\":\"bytes[]\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"name\":\"checkCallback\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"upkeepNeeded\",\"type\":\"bool\"},{\"internalType\":\"bytes\",\"name\":\"performData\",\"type\":\"bytes\"},{\"internalType\":\"enumAutomationRegistryBase2_3.UpkeepFailureReason\",\"name\":\"upkeepFailureReason\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"gasUsed\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"triggerData\",\"type\":\"bytes\"}],\"name\":\"checkUpkeep\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"upkeepNeeded\",\"type\":\"bool\"},{\"internalType\":\"bytes\",\"name\":\"performData\",\"type\":\"bytes\"},{\"internalType\":\"enumAutomationRegistryBase2_3.UpkeepFailureReason\",\"name\":\"upkeepFailureReason\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"gasUsed\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"gasLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"fastGasWei\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"linkUSD\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"checkUpkeep\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"upkeepNeeded\",\"type\":\"bool\"},{\"internalType\":\"bytes\",\"name\":\"performData\",\"type\":\"bytes\"},{\"internalType\":\"enumAutomationRegistryBase2_3.UpkeepFailureReason\",\"name\":\"upkeepFailureReason\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"gasUsed\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"gasLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"fastGasWei\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"linkUSD\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"payload\",\"type\":\"bytes\"}],\"name\":\"executeCallback\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"upkeepNeeded\",\"type\":\"bool\"},{\"internalType\":\"bytes\",\"name\":\"performData\",\"type\":\"bytes\"},{\"internalType\":\"enumAutomationRegistryBase2_3.UpkeepFailureReason\",\"name\":\"upkeepFailureReason\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"gasUsed\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"fallbackTo\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"pauseUpkeep\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"removeBillingOverrides\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"components\":[{\"internalType\":\"uint32\",\"name\":\"gasFeePPB\",\"type\":\"uint32\"},{\"internalType\":\"uint24\",\"name\":\"flatFeeMilliCents\",\"type\":\"uint24\"}],\"internalType\":\"structAutomationRegistryBase2_3.BillingOverrides\",\"name\":\"billingOverrides\",\"type\":\"tuple\"}],\"name\":\"setBillingOverrides\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"newCheckData\",\"type\":\"bytes\"}],\"name\":\"setUpkeepCheckData\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"gasLimit\",\"type\":\"uint32\"}],\"name\":\"setUpkeepGasLimit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"config\",\"type\":\"bytes\"}],\"name\":\"setUpkeepOffchainConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"triggerConfig\",\"type\":\"bytes\"}],\"name\":\"setUpkeepTriggerConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"performData\",\"type\":\"bytes\"}],\"name\":\"simulatePerformUpkeep\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"success\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"gasUsed\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"proposed\",\"type\":\"address\"}],\"name\":\"transferUpkeepAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"unpauseUpkeep\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractIERC20Metadata\",\"name\":\"asset\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"withdrawERC20Fees\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"withdrawFunds\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"withdrawLink\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", - Bin: "0x6101806040523480156200001257600080fd5b5060405162005d2238038062005d2283398101604081905262000035916200062f565b80816001600160a01b031663ca30e6036040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000075573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200009b91906200062f565b826001600160a01b031663226cf83c6040518163ffffffff1660e01b8152600401602060405180830381865afa158015620000da573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200010091906200062f565b836001600160a01b031663614486af6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156200013f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200016591906200062f565b846001600160a01b0316636709d0e56040518163ffffffff1660e01b8152600401602060405180830381865afa158015620001a4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001ca91906200062f565b856001600160a01b0316635425d8ac6040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000209573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200022f91906200062f565b866001600160a01b031663a08714c06040518163ffffffff1660e01b8152600401602060405180830381865afa1580156200026e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200029491906200062f565b876001600160a01b031663c5b964e06040518163ffffffff1660e01b8152600401602060405180830381865afa158015620002d3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620002f9919062000656565b886001600160a01b031663ac4dc59a6040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000338573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200035e91906200062f565b3380600081620003b55760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620003e857620003e8816200056b565b5050506001600160a01b0380891660805287811660a05286811660c05285811660e052848116610100528316610120526025805483919060ff19166001838181111562000439576200043962000679565b0217905550806001600160a01b0316610140816001600160a01b03168152505060c0516001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa1580156200049a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620004c091906200068f565b60ff1660a0516001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000504573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200052a91906200068f565b60ff16146200054c576040516301f86e1760e41b815260040160405180910390fd5b5050506001600160a01b039095166101605250620006b4945050505050565b336001600160a01b03821603620005c55760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c660000000000000000006044820152606401620003ac565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b6001600160a01b03811681146200062c57600080fd5b50565b6000602082840312156200064257600080fd5b81516200064f8162000616565b9392505050565b6000602082840312156200066957600080fd5b8151600281106200064f57600080fd5b634e487b7160e01b600052602160045260246000fd5b600060208284031215620006a257600080fd5b815160ff811681146200064f57600080fd5b60805160a05160c05160e051610100516101205161014051610160516155e86200073a60003960008181610182015261022f0152600081816120e7015261228d01526000612bb30152600050506000612ee901526000613c5d01526000612fc3015260008181610c4701528181610d0801528181610dd30152612c7401526155e86000f3fe6080604052600436106101805760003560e01c80638765ecbe116100d6578063aed2e9291161007f578063ce7dc5b411610059578063ce7dc5b4146104b1578063f2fde38b146104d1578063f7d334ba146104f157610180565b8063aed2e9291461043a578063b148ab6b14610471578063cd7f71b51461049157610180565b8063948108f7116100b0578063948108f7146103e7578063a72aa27e146103fa578063a86e17811461041a57610180565b80638765ecbe1461037c5780638da5cb5b1461039c5780638dcf0fe7146103c757610180565b806354b7faae1161013857806371fae17f1161011257806371fae17f14610327578063744bfe611461034757806379ba50971461036757610180565b806354b7faae146102b457806368d369d8146102d457806371791aa0146102f457610180565b8063349e8cca11610169578063349e8cca146102205780634ee88d35146102745780635165f2f51461029457610180565b80631a2af011146101c757806329c5efad146101e7575b7f00000000000000000000000000000000000000000000000000000000000000003660008037600080366000845af43d6000803e8080156101c0573d6000f35b3d6000fd5b005b3480156101d357600080fd5b506101c56101e2366004614490565b610511565b3480156101f357600080fd5b50610207610202366004614604565b610617565b6040516102179493929190614723565b60405180910390f35b34801561022c57600080fd5b507f00000000000000000000000000000000000000000000000000000000000000005b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610217565b34801561028057600080fd5b506101c561028f3660046147a5565b6108f5565b3480156102a057600080fd5b506101c56102af3660046147f1565b610957565b3480156102c057600080fd5b506101c56102cf36600461480a565b610b09565b3480156102e057600080fd5b506101c56102ef366004614836565b610d7c565b34801561030057600080fd5b5061031461030f366004614604565b61102a565b6040516102179796959493929190614877565b34801561033357600080fd5b506101c56103423660046147f1565b61178e565b34801561035357600080fd5b506101c5610362366004614490565b611824565b34801561037357600080fd5b506101c5611c9c565b34801561038857600080fd5b506101c56103973660046147f1565b611d99565b3480156103a857600080fd5b5060005473ffffffffffffffffffffffffffffffffffffffff1661024f565b3480156103d357600080fd5b506101c56103e23660046147a5565b611f4e565b6101c56103f53660046148c5565b611fa3565b34801561040657600080fd5b506101c561041536600461490d565b612365565b34801561042657600080fd5b506101c5610435366004614932565b612464565b34801561044657600080fd5b5061045a6104553660046147a5565b612545565b604080519215158352602083019190915201610217565b34801561047d57600080fd5b506101c561048c3660046147f1565b6126f0565b34801561049d57600080fd5b506101c56104ac3660046147a5565b61291d565b3480156104bd57600080fd5b506102076104cc3660046149ac565b6129d4565b3480156104dd57600080fd5b506101c56104ec366004614a8e565b612a96565b3480156104fd57600080fd5b5061031461050c3660046147f1565b612aaa565b61051a82612ae6565b3373ffffffffffffffffffffffffffffffffffffffff821603610569576040517f8c8728c700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008281526006602052604090205473ffffffffffffffffffffffffffffffffffffffff8281169116146106135760008281526006602052604080822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff851690811790915590519091339185917fb1cbb2c4b8480034c27e06da5f096b8233a8fd4497028593a41ff6df79726b3591a45b5050565b60006060600080610626612b9b565b600086815260046020908152604091829020825161012081018452815460ff8082161515835261010080830490911615159483019490945263ffffffff620100008204811695830195909552660100000000000081048516606083015273ffffffffffffffffffffffffffffffffffffffff6a01000000000000000000009091048116608083015260018301546fffffffffffffffffffffffffffffffff811660a08401526bffffffffffffffffffffffff70010000000000000000000000000000000082041660c08401527c0100000000000000000000000000000000000000000000000000000000900490941660e0820152600290910154909216908201525a9150600080826080015173ffffffffffffffffffffffffffffffffffffffff1663f00e6a2a6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561077c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107a09190614abb565b73ffffffffffffffffffffffffffffffffffffffff16601660000160149054906101000a900463ffffffff1663ffffffff16896040516107e09190614ad8565b60006040518083038160008787f1925050503d806000811461081e576040519150601f19603f3d011682016040523d82523d6000602084013e610823565b606091505b50915091505a6108339085614b23565b93508161085c5760006040518060200160405280600081525060079650965096505050506108ec565b808060200190518101906108709190614b8b565b90975095508661089c5760006040518060200160405280600081525060049650965096505050506108ec565b60185486517401000000000000000000000000000000000000000090910463ffffffff1610156108e85760006040518060200160405280600081525060059650965096505050506108ec565b5050505b92959194509250565b6108fe83612ae6565b6000838152601d60205260409020610917828483614c70565b50827f2b72ac786c97e68dbab71023ed6f2bdbfc80ad9bb7808941929229d71b7d5664838360405161094a929190614dd4565b60405180910390a2505050565b61096081612ae6565b600081815260046020908152604091829020825161012081018452815460ff808216151580845261010080840490921615159584019590955262010000820463ffffffff9081169684019690965266010000000000008204861660608401526a010000000000000000000090910473ffffffffffffffffffffffffffffffffffffffff908116608084015260018401546fffffffffffffffffffffffffffffffff811660a085015270010000000000000000000000000000000081046bffffffffffffffffffffffff1660c08501527c0100000000000000000000000000000000000000000000000000000000900490951660e083015260029092015490931690830152610a9a576040517f1b88a78400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600082815260046020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055610ad9600283612c0c565b5060405182907f7bada562044eb163f6b4003c4553e4e62825344c0418eea087bed5ee05a4745690600090a25050565b610b11612c21565b73ffffffffffffffffffffffffffffffffffffffff8216610b5e576040517f9c8d2cd200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000610b68612c72565b90506000811215610bb4576040517fcf47918100000000000000000000000000000000000000000000000000000000815260006004820152602481018390526044015b60405180910390fd5b80821115610bf8576040517fcf4791810000000000000000000000000000000000000000000000000000000081526004810182905260248101839052604401610bab565b6040517fa9059cbb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8481166004830152602482018490526000917f00000000000000000000000000000000000000000000000000000000000000009091169063a9059cbb906044016020604051808303816000875af1158015610c92573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cb69190614de8565b905080610cef576040517f90b8ec1800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8373ffffffffffffffffffffffffffffffffffffffff167f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff167f5e110f8bc8a20b65dcc87f224bdf1cc039346e267118bae2739847f07321ffa885604051610d6e91815260200190565b60405180910390a350505050565b610d84612c21565b73ffffffffffffffffffffffffffffffffffffffff8216610dd1576040517f9c8d2cd200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603610e56576040517fc1ab6dc100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000610e60612c72565b128015610e835750600060255460ff166001811115610e8157610e816146b9565b145b15610eba576040517f981bb6a000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff83166000818152602160205260408082205490517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152919290916370a0823190602401602060405180830381865afa158015610f36573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f5a9190614e03565b610f649190614b23565b905080821115610faa576040517fcf4791810000000000000000000000000000000000000000000000000000000081526004810182905260248101839052604401610bab565b610fcb73ffffffffffffffffffffffffffffffffffffffff85168484612d41565b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f5e110f8bc8a20b65dcc87f224bdf1cc039346e267118bae2739847f07321ffa884604051610d6e91815260200190565b60006060600080600080600061103e612b9b565b60006110498a612e1a565b905060006014604051806101200160405290816000820160009054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff166bffffffffffffffffffffffff16815260200160008201600c9054906101000a900463ffffffff1663ffffffff1663ffffffff1681526020016000820160109054906101000a900462ffffff1662ffffff1662ffffff1681526020016000820160139054906101000a900461ffff1661ffff1661ffff1681526020016000820160159054906101000a900460ff1660ff1660ff1681526020016000820160169054906101000a900460ff161515151581526020016000820160179054906101000a900460ff161515151581526020016000820160189054906101000a900460ff161515151581526020016001820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152505090506000600460008d8152602001908152602001600020604051806101200160405290816000820160009054906101000a900460ff161515151581526020016000820160019054906101000a900460ff161515151581526020016000820160029054906101000a900463ffffffff1663ffffffff1663ffffffff1681526020016000820160069054906101000a900463ffffffff1663ffffffff1663ffffffff16815260200160008201600a9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016001820160009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff1681526020016001820160109054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff166bffffffffffffffffffffffff16815260200160018201601c9054906101000a900463ffffffff1663ffffffff1663ffffffff1681526020016002820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152505090506000808360a001511561140c5750506040805160208101825260008082529290910151919a5098506009975089965063ffffffff169450859350839250611782915050565b606083015163ffffffff908116146114565750506040805160208101825260008082529290910151919a5098506001975089965063ffffffff169450859350839250611782915050565b8251156114955750506040805160208101825260008082529290910151919a5098506002975089965063ffffffff169450859350839250611782915050565b61149e84612ec5565b8094508198508299505050506114c38e858786604001518b8b888a61010001516130b7565b9050806bffffffffffffffffffffffff168360c001516bffffffffffffffffffffffff1610156115255750506040805160208101825260008082529290910151919a5098506006975089965063ffffffff169450859350839250611782915050565b505060006115348d858e613427565b90505a9750600080836080015173ffffffffffffffffffffffffffffffffffffffff1663f00e6a2a6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561158b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115af9190614abb565b73ffffffffffffffffffffffffffffffffffffffff16601660000160149054906101000a900463ffffffff1663ffffffff16846040516115ef9190614ad8565b60006040518083038160008787f1925050503d806000811461162d576040519150601f19603f3d011682016040523d82523d6000602084013e611632565b606091505b50915091505a611642908b614b23565b9950816116c8576018548151780100000000000000000000000000000000000000000000000090910463ffffffff1610156116a75750506040805160208101825260008082529390910151929b509950600898505063ffffffff169450611782915050565b604090930151929a50600399505063ffffffff909116955061178292505050565b808060200190518101906116dc9190614b8b565b909d509b508c6117165750506040805160208101825260008082529390910151929b509950600498505063ffffffff169450611782915050565b6018548c517401000000000000000000000000000000000000000090910463ffffffff1610156117705750506040805160208101825260008082529390910151929b509950600598505063ffffffff169450611782915050565b5050506040015163ffffffff16945050505b92959891949750929550565b611796613607565b600081815260046020908152604080832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055602390915280822080547fffffffffffffffffffffffffffffffffffffffffffffffffff000000000000001690555182917f97d0ef3f46a56168af653f547bdb6f77ec2b1d7d9bc6ba0193c2b340ec68064a91a250565b60145477010000000000000000000000000000000000000000000000900460ff161561187c576040517f37ed32e800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b601480547fffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffffffff167701000000000000000000000000000000000000000000000017905573ffffffffffffffffffffffffffffffffffffffff811661190b576040517f9c8d2cd200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000828152600460209081526040808320815161012081018352815460ff8082161515835261010080830490911615158387015263ffffffff620100008304811684870152660100000000000083048116606085015273ffffffffffffffffffffffffffffffffffffffff6a01000000000000000000009093048316608085015260018501546fffffffffffffffffffffffffffffffff811660a08601526bffffffffffffffffffffffff70010000000000000000000000000000000082041660c08601527c010000000000000000000000000000000000000000000000000000000090041660e084015260029093015481169282019290925286855260059093529220549091163314611a4b576040517fa47c170600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b601554604080517f57e871e7000000000000000000000000000000000000000000000000000000008152905173ffffffffffffffffffffffffffffffffffffffff909216916357e871e7916004808201926020929091908290030181865afa158015611abb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611adf9190614e03565b816060015163ffffffff161115611b22576040517fff84e5dd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008381526004602090815260408083206001015461010085015173ffffffffffffffffffffffffffffffffffffffff1684526021909252909120547001000000000000000000000000000000009091046bffffffffffffffffffffffff1690611b8d908290614b23565b6101008301805173ffffffffffffffffffffffffffffffffffffffff908116600090815260216020908152604080832095909555888252600490529290922060010180547fffffffff000000000000000000000000ffffffffffffffffffffffffffffffff16905551611c109116846bffffffffffffffffffffffff8416612d41565b604080516bffffffffffffffffffffffff8316815273ffffffffffffffffffffffffffffffffffffffff8516602082015285917ff3b5906e5672f3e524854103bcafbbdba80dbdfeca2c35e116127b1060a68318910160405180910390a25050601480547fffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffffffff1690555050565b60015473ffffffffffffffffffffffffffffffffffffffff163314611d1d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e6572000000000000000000006044820152606401610bab565b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b611da281612ae6565b600081815260046020908152604091829020825161012081018452815460ff808216158015845261010080840490921615159584019590955262010000820463ffffffff9081169684019690965266010000000000008204861660608401526a010000000000000000000090910473ffffffffffffffffffffffffffffffffffffffff908116608084015260018401546fffffffffffffffffffffffffffffffff811660a085015270010000000000000000000000000000000081046bffffffffffffffffffffffff1660c08501527c0100000000000000000000000000000000000000000000000000000000900490951660e083015260029092015490931690830152611edc576040517f514b6c2400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600082815260046020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055611f1e600283613658565b5060405182907f8ab10247ce168c27748e656ecf852b951fcaac790c18106b19aa0ae57a8b741f90600090a25050565b611f5783612ae6565b6000838152601e60205260409020611f70828483614c70565b50827f3e8740446213c8a77d40e08f79136ce3f347d13ed270a6ebdf57159e0faf4850838360405161094a929190614dd4565b600082815260046020908152604091829020825161012081018452815460ff8082161515835261010080830490911615159483019490945263ffffffff6201000082048116958301959095526601000000000000810485166060830181905273ffffffffffffffffffffffffffffffffffffffff6a01000000000000000000009092048216608084015260018401546fffffffffffffffffffffffffffffffff811660a08501526bffffffffffffffffffffffff70010000000000000000000000000000000082041660c08501527c01000000000000000000000000000000000000000000000000000000009004861660e084015260029093015416928101929092529091146120df576040517f9c0083a200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b341561217b577f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1681610100015173ffffffffffffffffffffffffffffffffffffffff161461216f576040517fc1ab6dc100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61217834613664565b91505b818160c0015161218b9190614e1c565b600084815260046020908152604080832060010180547fffffffff000000000000000000000000ffffffffffffffffffffffffffffffff167001000000000000000000000000000000006bffffffffffffffffffffffff9687160217905561010085015173ffffffffffffffffffffffffffffffffffffffff168352602190915290205461221b91841690614e41565b61010082015173ffffffffffffffffffffffffffffffffffffffff1660009081526021602052604081209190915534900361228b576101008101516122869073ffffffffffffffffffffffffffffffffffffffff1633306bffffffffffffffffffffffff8616613706565b61231b565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663d0e30db0836bffffffffffffffffffffffff166040518263ffffffff1660e01b81526004016000604051808303818588803b15801561230157600080fd5b505af1158015612315573d6000803e3d6000fd5b50505050505b6040516bffffffffffffffffffffffff83168152339084907fafd24114486da8ebfc32f3626dada8863652e187461aa74d4bfa7348915062039060200160405180910390a3505050565b6108fc8163ffffffff1610806123a2575060165463ffffffff78010000000000000000000000000000000000000000000000009091048116908216115b156123d9576040517f14c237fb00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6123e282612ae6565b60008281526004602090815260409182902080547fffffffffffffffffffffffffffffffffffffffffffffffffffff00000000ffff166201000063ffffffff861690810291909117909155915191825283917fc24c07e655ce79fba8a589778987d3c015bc6af1632bb20cf9182e02a65d972c91015b60405180910390a25050565b61246c613607565b6000828152600460205260409020546601000000000000900463ffffffff908116146124c4576040517f9c0083a200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600082815260046020908152604080832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790556023909152902081906125128282614e65565b905050817fd8a6d79d170a55968079d3a89b960d86b4442aef6aac1d01e644c32b9e38b340826040516124589190614eec565b600080612550612b9b565b601454760100000000000000000000000000000000000000000000900460ff16156125a7576040517f24522f3400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600085815260046020908152604091829020825161012081018452815460ff8082161515835261010080830490911615158386015262010000820463ffffffff90811684880181905266010000000000008404821660608601526a010000000000000000000090930473ffffffffffffffffffffffffffffffffffffffff9081166080860181905260018701546fffffffffffffffffffffffffffffffff811660a088015270010000000000000000000000000000000081046bffffffffffffffffffffffff1660c08801527c0100000000000000000000000000000000000000000000000000000000900490921660e0860152600290950154909416908301528451601f890185900485028101850190955287855290936126e393899089908190840183828082843760009201919091525061376a92505050565b9097909650945050505050565b600081815260046020908152604091829020825161012081018452815460ff8082161515835261010080830490911615159483019490945263ffffffff6201000082048116958301959095526601000000000000810485166060830181905273ffffffffffffffffffffffffffffffffffffffff6a01000000000000000000009092048216608084015260018401546fffffffffffffffffffffffffffffffff811660a08501526bffffffffffffffffffffffff70010000000000000000000000000000000082041660c08501527c01000000000000000000000000000000000000000000000000000000009004861660e0840152600290930154169281019290925290911461282c576040517f9c0083a200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008281526006602052604090205473ffffffffffffffffffffffffffffffffffffffff163314612889576040517f6352a85300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008281526005602090815260408083208054337fffffffffffffffffffffffff0000000000000000000000000000000000000000808316821790935560069094528285208054909216909155905173ffffffffffffffffffffffffffffffffffffffff90911692839186917f5cff4db96bef051785e999f44bfcd21c18823e034fb92dd376e3db4ce0feeb2c91a4505050565b61292683612ae6565b6017547c0100000000000000000000000000000000000000000000000000000000900463ffffffff16811115612988576040517fae7235df00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008381526007602052604090206129a1828483614c70565b50827fcba2d5723b2ee59e53a8e8a82a4a7caf4fdfe70e9f7c582950bf7e7a5c24e83d838360405161094a929190614dd4565b600060606000806000634b56a42e60e01b8888886040516024016129fa93929190614f23565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff00000000000000000000000000000000000000000000000000000000909316929092179091529050612a838982610617565b929c919b50995090975095505050505050565b612a9e613985565b612aa781613a06565b50565b600060606000806000806000612acf886040518060200160405280600081525061102a565b959e949d50929b5090995097509550909350915050565b60008181526005602052604090205473ffffffffffffffffffffffffffffffffffffffff163314612b43576040517fa47c170600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000818152600460205260409020546601000000000000900463ffffffff90811614612aa7576040517f9c0083a200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b3273ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614612c0a576040517fb60ac5db00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b565b6000612c188383613afb565b90505b92915050565b60185473ffffffffffffffffffffffffffffffffffffffff163314612c0a576040517fb6dfb7a600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166000818152602160205260408082205490517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152919290916370a0823190602401602060405180830381865afa158015612d0e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d329190614e03565b612d3c9190614fb9565b905090565b60405173ffffffffffffffffffffffffffffffffffffffff8316602482015260448101829052612e159084907fa9059cbb00000000000000000000000000000000000000000000000000000000906064015b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152613b4a565b505050565b6000818160045b600f811015612ea7577fff000000000000000000000000000000000000000000000000000000000000008216838260208110612e5f57612e5f614fd9565b1a60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614612e9557506000949350505050565b80612e9f81615008565b915050612e21565b5081600f1a6001811115612ebd57612ebd6146b9565b949350505050565b600080600080846040015162ffffff1690506000808263ffffffff161190506000807f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663feaf968c6040518163ffffffff1660e01b815260040160a060405180830381865afa158015612f52573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f76919061505a565b5094509092505050600081131580612f8d57508142105b80612fae5750828015612fae5750612fa58242614b23565b8463ffffffff16105b15612fbd576019549650612fc1565b8096505b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663feaf968c6040518163ffffffff1660e01b815260040160a060405180830381865afa15801561302c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613050919061505a565b509450909250505060008113158061306757508142105b806130885750828015613088575061307f8242614b23565b8463ffffffff16105b1561309757601a54955061309b565b8095505b86866130a68a613c56565b965096509650505050509193909250565b60008080808960018111156130ce576130ce6146b9565b036130dd575062017f98613132565b60018960018111156130f1576130f16146b9565b0361310057506201de84613132565b6040517ff2b2d41200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008a60800151600161314591906150aa565b6131539060ff1660406150c3565b601854613181906103a49074010000000000000000000000000000000000000000900463ffffffff16614e41565b61318b9190614e41565b601554604080517fde9ee35e0000000000000000000000000000000000000000000000000000000081528151939450600093849373ffffffffffffffffffffffffffffffffffffffff169263de9ee35e92600480820193918290030181865afa1580156131fc573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061322091906150da565b90925090508183613232836018614e41565b61323c91906150c3565b60808f015161324c9060016150aa565b61325b9060ff166115e06150c3565b6132659190614e41565b61326f9190614e41565b6132799085614e41565b6101008e01516040517f125441400000000000000000000000000000000000000000000000000000000081526004810186905291955073ffffffffffffffffffffffffffffffffffffffff1690631254414090602401602060405180830381865afa1580156132ec573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906133109190614e03565b8d6060015161ffff1661332391906150c3565b945050505060006133348b86613d47565b60008d815260046020526040902054909150610100900460ff16156133995760008c81526023602090815260409182902082518084018452905463ffffffff811680835264010000000090910462ffffff908116928401928352928501525116908201525b60006134038c6040518061012001604052808d63ffffffff1681526020018681526020018781526020018c81526020018b81526020018a81526020018973ffffffffffffffffffffffffffffffffffffffff16815260200185815260200160001515815250613ec3565b6020810151815191925061341691614e1c565b9d9c50505050505050505050505050565b6060600083600181111561343d5761343d6146b9565b03613506576000848152600760205260409081902090517f6e04ff0d000000000000000000000000000000000000000000000000000000009161348291602401615199565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff00000000000000000000000000000000000000000000000000000000909316929092179091529050613600565b600183600181111561351a5761351a6146b9565b03613100576000828060200190518101906135359190615212565b6000868152600760205260409081902090519192507f40691db4000000000000000000000000000000000000000000000000000000009161357a918491602401615322565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff000000000000000000000000000000000000000000000000000000009093169290921790915291506136009050565b9392505050565b60175473ffffffffffffffffffffffffffffffffffffffff163314612c0a576040517f77c3599200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000612c18838361420a565b60006bffffffffffffffffffffffff821115613702576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203960448201527f36206269747300000000000000000000000000000000000000000000000000006064820152608401610bab565b5090565b60405173ffffffffffffffffffffffffffffffffffffffff808516602483015283166044820152606481018290526137649085907f23b872dd0000000000000000000000000000000000000000000000000000000090608401612d93565b50505050565b601454600090819077010000000000000000000000000000000000000000000000900460ff16156137c7576040517f37ed32e800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b601480547fffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffffffff16770100000000000000000000000000000000000000000000001790556040517f4585e33b000000000000000000000000000000000000000000000000000000009061383c9085906024016153ed565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff000000000000000000000000000000000000000000000000000000009094169390931790925290517f79188d1600000000000000000000000000000000000000000000000000000000815290935073ffffffffffffffffffffffffffffffffffffffff8616906379188d169061390f9087908790600401615400565b60408051808303816000875af115801561392d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906139519190615419565b601480547fffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffffffff16905590969095509350505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314612c0a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e6572000000000000000000006044820152606401610bab565b3373ffffffffffffffffffffffffffffffffffffffff821603613a85576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c660000000000000000006044820152606401610bab565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b6000818152600183016020526040812054613b4257508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155612c1b565b506000612c1b565b6000613bac826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166142fd9092919063ffffffff16565b805190915015612e155780806020019051810190613bca9190614de8565b612e15576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610bab565b60008060007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663feaf968c6040518163ffffffff1660e01b815260040160a060405180830381865afa158015613cc6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613cea919061505a565b50935050925050600082131580613d0057508042105b80613d3057506000846040015162ffffff16118015613d305750613d248142614b23565b846040015162ffffff16105b15613d40575050601b5492915050565b5092915050565b60408051608081018252600080825260208083018281528385018381526060850184905273ffffffffffffffffffffffffffffffffffffffff878116855260229093528584208054640100000000810462ffffff1690925263ffffffff82169092527b01000000000000000000000000000000000000000000000000000000810460ff16855285517ffeaf968c00000000000000000000000000000000000000000000000000000000815295519495919484936701000000000000009092049091169163feaf968c9160048083019260a09291908290030181865afa158015613e34573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613e58919061505a565b50935050925050600082131580613e6e57508042105b80613e9e57506000866040015162ffffff16118015613e9e5750613e928142614b23565b866040015162ffffff16105b15613eb25760018301546060850152613eba565b606084018290525b50505092915050565b6040805161010081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e081019190915260008260e001516000015160ff1690506000846060015161ffff168460600151613f2e91906150c3565b90508361010001518015613f415750803a105b15613f4957503a5b600060128311613f5a576001613f70565b613f65601284614b23565b613f7090600a615565565b9050600060128410613f83576001613f99565b613f8e846012614b23565b613f9990600a615565565b905060008660a00151876040015188602001518960000151613fbb9190614e41565b613fc590876150c3565b613fcf9190614e41565b613fd991906150c3565b9050614035828860e0015160600151613ff291906150c3565b6001848a60e001516060015161400891906150c3565b6140129190614b23565b61401c86856150c3565b6140269190614e41565b6140309190615571565b613664565b6bffffffffffffffffffffffff1686526080870151614058906140309083615571565b6bffffffffffffffffffffffff1660408088019190915260e088015101516000906140919062ffffff16683635c9adc5dea000006150c3565b9050600081633b9aca008a60a001518b60e001516020015163ffffffff168c604001518d600001518b6140c491906150c3565b6140ce9190614e41565b6140d891906150c3565b6140e291906150c3565b6140ec9190615571565b6140f69190614e41565b9050614139848a60e001516060015161410f91906150c3565b6001868c60e001516060015161412591906150c3565b61412f9190614b23565b61401c88856150c3565b6bffffffffffffffffffffffff166020890152608089015161415f906140309083615571565b6bffffffffffffffffffffffff16606089015260c089015173ffffffffffffffffffffffffffffffffffffffff166080808a01919091528901516141a290613664565b6bffffffffffffffffffffffff1660a0808a01919091528901516141c590613664565b6bffffffffffffffffffffffff1660c089015260e0890151606001516141ea90613664565b6bffffffffffffffffffffffff1660e08901525050505050505092915050565b600081815260018301602052604081205480156142f357600061422e600183614b23565b855490915060009061424290600190614b23565b90508181146142a757600086600001828154811061426257614262614fd9565b906000526020600020015490508087600001848154811061428557614285614fd9565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806142b8576142b86155ac565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050612c1b565b6000915050612c1b565b6060612ebd8484600085856000808673ffffffffffffffffffffffffffffffffffffffff1685876040516143319190614ad8565b60006040518083038185875af1925050503d806000811461436e576040519150601f19603f3d011682016040523d82523d6000602084013e614373565b606091505b50915091506143848783838761438f565b979650505050505050565b6060831561442557825160000361441e5773ffffffffffffffffffffffffffffffffffffffff85163b61441e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610bab565b5081612ebd565b612ebd838381511561443a5781518083602001fd5b806040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bab91906153ed565b73ffffffffffffffffffffffffffffffffffffffff81168114612aa757600080fd5b600080604083850312156144a357600080fd5b8235915060208301356144b58161446e565b809150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051610100810167ffffffffffffffff81118282101715614513576145136144c0565b60405290565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715614560576145606144c0565b604052919050565b600067ffffffffffffffff821115614582576145826144c0565b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b600082601f8301126145bf57600080fd5b81356145d26145cd82614568565b614519565b8181528460208386010111156145e757600080fd5b816020850160208301376000918101602001919091529392505050565b6000806040838503121561461757600080fd5b82359150602083013567ffffffffffffffff81111561463557600080fd5b614641858286016145ae565b9150509250929050565b60005b8381101561466657818101518382015260200161464e565b50506000910152565b6000815180845261468781602086016020860161464b565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b600a811061471f577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b9052565b841515815260806020820152600061473e608083018661466f565b905061474d60408301856146e8565b82606083015295945050505050565b60008083601f84011261476e57600080fd5b50813567ffffffffffffffff81111561478657600080fd5b60208301915083602082850101111561479e57600080fd5b9250929050565b6000806000604084860312156147ba57600080fd5b83359250602084013567ffffffffffffffff8111156147d857600080fd5b6147e48682870161475c565b9497909650939450505050565b60006020828403121561480357600080fd5b5035919050565b6000806040838503121561481d57600080fd5b82356148288161446e565b946020939093013593505050565b60008060006060848603121561484b57600080fd5b83356148568161446e565b925060208401356148668161446e565b929592945050506040919091013590565b871515815260e06020820152600061489260e083018961466f565b90506148a160408301886146e8565b8560608301528460808301528360a08301528260c083015298975050505050505050565b600080604083850312156148d857600080fd5b8235915060208301356bffffffffffffffffffffffff811681146144b557600080fd5b63ffffffff81168114612aa757600080fd5b6000806040838503121561492057600080fd5b8235915060208301356144b5816148fb565b600080828403606081121561494657600080fd5b8335925060407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08201121561497a57600080fd5b506020830190509250929050565b600067ffffffffffffffff8211156149a2576149a26144c0565b5060051b60200190565b600080600080606085870312156149c257600080fd5b8435935060208086013567ffffffffffffffff808211156149e257600080fd5b818801915088601f8301126149f657600080fd5b8135614a046145cd82614988565b81815260059190911b8301840190848101908b831115614a2357600080fd5b8585015b83811015614a5b57803585811115614a3f5760008081fd5b614a4d8e89838a01016145ae565b845250918601918601614a27565b50975050506040880135925080831115614a7457600080fd5b5050614a828782880161475c565b95989497509550505050565b600060208284031215614aa057600080fd5b81356136008161446e565b8051614ab68161446e565b919050565b600060208284031215614acd57600080fd5b81516136008161446e565b60008251614aea81846020870161464b565b9190910192915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b81810381811115612c1b57612c1b614af4565b80518015158114614ab657600080fd5b600082601f830112614b5757600080fd5b8151614b656145cd82614568565b818152846020838601011115614b7a57600080fd5b612ebd82602083016020870161464b565b60008060408385031215614b9e57600080fd5b614ba783614b36565b9150602083015167ffffffffffffffff811115614bc357600080fd5b61464185828601614b46565b600181811c90821680614be357607f821691505b602082108103614c1c577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b601f821115612e1557600081815260208120601f850160051c81016020861015614c495750805b601f850160051c820191505b81811015614c6857828155600101614c55565b505050505050565b67ffffffffffffffff831115614c8857614c886144c0565b614c9c83614c968354614bcf565b83614c22565b6000601f841160018114614cee5760008515614cb85750838201355b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600387901b1c1916600186901b178355614d84565b6000838152602090207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0861690835b82811015614d3d5786850135825560209485019460019092019101614d1d565b5086821015614d78577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60f88860031b161c19848701351681555b505060018560011b0183555b5050505050565b8183528181602085013750600060208284010152600060207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b602081526000612ebd602083018486614d8b565b600060208284031215614dfa57600080fd5b612c1882614b36565b600060208284031215614e1557600080fd5b5051919050565b6bffffffffffffffffffffffff818116838216019080821115613d4057613d40614af4565b80820180821115612c1b57612c1b614af4565b62ffffff81168114612aa757600080fd5b8135614e70816148fb565b63ffffffff811690508154817fffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000000082161783556020840135614eb081614e54565b66ffffff000000008160201b16837fffffffffffffffffffffffffffffffffffffffffffffffffff000000000000008416171784555050505050565b604081018235614efb816148fb565b63ffffffff1682526020830135614f1181614e54565b62ffffff811660208401525092915050565b6000604082016040835280865180835260608501915060608160051b8601019250602080890160005b83811015614f98577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa0888703018552614f8686835161466f565b95509382019390820190600101614f4c565b505085840381870152505050614faf818587614d8b565b9695505050505050565b8181036000831280158383131683831282161715613d4057613d40614af4565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361503957615039614af4565b5060010190565b805169ffffffffffffffffffff81168114614ab657600080fd5b600080600080600060a0868803121561507257600080fd5b61507b86615040565b945060208601519350604086015192506060860151915061509e60808701615040565b90509295509295909350565b60ff8181168382160190811115612c1b57612c1b614af4565b8082028115828204841417612c1b57612c1b614af4565b600080604083850312156150ed57600080fd5b505080516020909101519092909150565b6000815461510b81614bcf565b80855260206001838116801561512857600181146151605761518e565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff008516838901528284151560051b890101955061518e565b866000528260002060005b858110156151865781548a820186015290830190840161516b565b890184019650505b505050505092915050565b602081526000612c1860208301846150fe565b600082601f8301126151bd57600080fd5b815160206151cd6145cd83614988565b82815260059290921b840181019181810190868411156151ec57600080fd5b8286015b8481101561520757805183529183019183016151f0565b509695505050505050565b60006020828403121561522457600080fd5b815167ffffffffffffffff8082111561523c57600080fd5b90830190610100828603121561525157600080fd5b6152596144ef565b825181526020830151602082015260408301516040820152606083015160608201526080830151608082015261529160a08401614aab565b60a082015260c0830151828111156152a857600080fd5b6152b4878286016151ac565b60c08301525060e0830151828111156152cc57600080fd5b6152d887828601614b46565b60e08301525095945050505050565b600081518084526020808501945080840160005b83811015615317578151875295820195908201906001016152fb565b509495945050505050565b60408152825160408201526020830151606082015260408301516080820152606083015160a0820152608083015160c082015273ffffffffffffffffffffffffffffffffffffffff60a08401511660e0820152600060c08401516101008081850152506153936101408401826152e7565b905060e08501517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0848303016101208501526153cf828261466f565b91505082810360208401526153e481856150fe565b95945050505050565b602081526000612c18602083018461466f565b828152604060208201526000612ebd604083018461466f565b6000806040838503121561542c57600080fd5b61543583614b36565b9150602083015190509250929050565b600181815b8085111561549e57817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0482111561548457615484614af4565b8085161561549157918102915b93841c939080029061544a565b509250929050565b6000826154b557506001612c1b565b816154c257506000612c1b565b81600181146154d857600281146154e2576154fe565b6001915050612c1b565b60ff8411156154f3576154f3614af4565b50506001821b612c1b565b5060208310610133831016604e8410600b8410161715615521575081810a612c1b565b61552b8383615445565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0482111561555d5761555d614af4565b029392505050565b6000612c1883836154a6565b6000826155a7577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fdfea164736f6c6343000813000a", + Bin: "0x6101806040523480156200001257600080fd5b5060405162005d2238038062005d2283398101604081905262000035916200062f565b80816001600160a01b031663ca30e6036040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000075573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200009b91906200062f565b826001600160a01b031663226cf83c6040518163ffffffff1660e01b8152600401602060405180830381865afa158015620000da573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200010091906200062f565b836001600160a01b031663614486af6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156200013f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200016591906200062f565b846001600160a01b0316636709d0e56040518163ffffffff1660e01b8152600401602060405180830381865afa158015620001a4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001ca91906200062f565b856001600160a01b0316635425d8ac6040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000209573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200022f91906200062f565b866001600160a01b031663a08714c06040518163ffffffff1660e01b8152600401602060405180830381865afa1580156200026e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200029491906200062f565b876001600160a01b031663c5b964e06040518163ffffffff1660e01b8152600401602060405180830381865afa158015620002d3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620002f9919062000656565b886001600160a01b031663ac4dc59a6040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000338573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200035e91906200062f565b3380600081620003b55760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620003e857620003e8816200056b565b5050506001600160a01b0380891660805287811660a05286811660c05285811660e052848116610100528316610120526025805483919060ff19166001838181111562000439576200043962000679565b0217905550806001600160a01b0316610140816001600160a01b03168152505060c0516001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa1580156200049a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620004c091906200068f565b60ff1660a0516001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000504573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200052a91906200068f565b60ff16146200054c576040516301f86e1760e41b815260040160405180910390fd5b5050506001600160a01b039095166101605250620006b4945050505050565b336001600160a01b03821603620005c55760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c660000000000000000006044820152606401620003ac565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b6001600160a01b03811681146200062c57600080fd5b50565b6000602082840312156200064257600080fd5b81516200064f8162000616565b9392505050565b6000602082840312156200066957600080fd5b8151600281106200064f57600080fd5b634e487b7160e01b600052602160045260246000fd5b600060208284031215620006a257600080fd5b815160ff811681146200064f57600080fd5b60805160a05160c05160e051610100516101205161014051610160516155e86200073a60003960008181610182015261022f0152600081816120e7015261228d01526000612bb30152600050506000612ee901526000613c5d01526000612fc3015260008181610c4701528181610d0801528181610dd30152612c7401526155e86000f3fe6080604052600436106101805760003560e01c80638765ecbe116100d6578063aed2e9291161007f578063ce7dc5b411610059578063ce7dc5b4146104b1578063f2fde38b146104d1578063f7d334ba146104f157610180565b8063aed2e9291461043a578063b148ab6b14610471578063cd7f71b51461049157610180565b8063948108f7116100b0578063948108f7146103e7578063a72aa27e146103fa578063a86e17811461041a57610180565b80638765ecbe1461037c5780638da5cb5b1461039c5780638dcf0fe7146103c757610180565b806354b7faae1161013857806371fae17f1161011257806371fae17f14610327578063744bfe611461034757806379ba50971461036757610180565b806354b7faae146102b457806368d369d8146102d457806371791aa0146102f457610180565b8063349e8cca11610169578063349e8cca146102205780634ee88d35146102745780635165f2f51461029457610180565b80631a2af011146101c757806329c5efad146101e7575b7f00000000000000000000000000000000000000000000000000000000000000003660008037600080366000845af43d6000803e8080156101c0573d6000f35b3d6000fd5b005b3480156101d357600080fd5b506101c56101e2366004614490565b610511565b3480156101f357600080fd5b50610207610202366004614604565b610617565b6040516102179493929190614723565b60405180910390f35b34801561022c57600080fd5b507f00000000000000000000000000000000000000000000000000000000000000005b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610217565b34801561028057600080fd5b506101c561028f3660046147a5565b6108f5565b3480156102a057600080fd5b506101c56102af3660046147f1565b610957565b3480156102c057600080fd5b506101c56102cf36600461480a565b610b09565b3480156102e057600080fd5b506101c56102ef366004614836565b610d7c565b34801561030057600080fd5b5061031461030f366004614604565b61102a565b6040516102179796959493929190614877565b34801561033357600080fd5b506101c56103423660046147f1565b61178e565b34801561035357600080fd5b506101c5610362366004614490565b611824565b34801561037357600080fd5b506101c5611c9c565b34801561038857600080fd5b506101c56103973660046147f1565b611d99565b3480156103a857600080fd5b5060005473ffffffffffffffffffffffffffffffffffffffff1661024f565b3480156103d357600080fd5b506101c56103e23660046147a5565b611f4e565b6101c56103f53660046148c5565b611fa3565b34801561040657600080fd5b506101c561041536600461490d565b612365565b34801561042657600080fd5b506101c5610435366004614932565b612464565b34801561044657600080fd5b5061045a6104553660046147a5565b612545565b604080519215158352602083019190915201610217565b34801561047d57600080fd5b506101c561048c3660046147f1565b6126f0565b34801561049d57600080fd5b506101c56104ac3660046147a5565b61291d565b3480156104bd57600080fd5b506102076104cc3660046149ac565b6129d4565b3480156104dd57600080fd5b506101c56104ec366004614a8e565b612a96565b3480156104fd57600080fd5b5061031461050c3660046147f1565b612aaa565b61051a82612ae6565b3373ffffffffffffffffffffffffffffffffffffffff821603610569576040517f8c8728c700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008281526006602052604090205473ffffffffffffffffffffffffffffffffffffffff8281169116146106135760008281526006602052604080822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff851690811790915590519091339185917fb1cbb2c4b8480034c27e06da5f096b8233a8fd4497028593a41ff6df79726b3591a45b5050565b60006060600080610626612b9b565b600086815260046020908152604091829020825161012081018452815460ff8082161515835261010080830490911615159483019490945263ffffffff620100008204811695830195909552660100000000000081048516606083015273ffffffffffffffffffffffffffffffffffffffff6a01000000000000000000009091048116608083015260018301546fffffffffffffffffffffffffffffffff811660a08401526bffffffffffffffffffffffff70010000000000000000000000000000000082041660c08401527c0100000000000000000000000000000000000000000000000000000000900490941660e0820152600290910154909216908201525a9150600080826080015173ffffffffffffffffffffffffffffffffffffffff1663f00e6a2a6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561077c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107a09190614abb565b73ffffffffffffffffffffffffffffffffffffffff16601660000160149054906101000a900463ffffffff1663ffffffff16896040516107e09190614ad8565b60006040518083038160008787f1925050503d806000811461081e576040519150601f19603f3d011682016040523d82523d6000602084013e610823565b606091505b50915091505a6108339085614b23565b93508161085c5760006040518060200160405280600081525060079650965096505050506108ec565b808060200190518101906108709190614b8b565b90975095508661089c5760006040518060200160405280600081525060049650965096505050506108ec565b60185486517401000000000000000000000000000000000000000090910463ffffffff1610156108e85760006040518060200160405280600081525060059650965096505050506108ec565b5050505b92959194509250565b6108fe83612ae6565b6000838152601d60205260409020610917828483614c70565b50827f2b72ac786c97e68dbab71023ed6f2bdbfc80ad9bb7808941929229d71b7d5664838360405161094a929190614dd4565b60405180910390a2505050565b61096081612ae6565b600081815260046020908152604091829020825161012081018452815460ff808216151580845261010080840490921615159584019590955262010000820463ffffffff9081169684019690965266010000000000008204861660608401526a010000000000000000000090910473ffffffffffffffffffffffffffffffffffffffff908116608084015260018401546fffffffffffffffffffffffffffffffff811660a085015270010000000000000000000000000000000081046bffffffffffffffffffffffff1660c08501527c0100000000000000000000000000000000000000000000000000000000900490951660e083015260029092015490931690830152610a9a576040517f1b88a78400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600082815260046020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055610ad9600283612c0c565b5060405182907f7bada562044eb163f6b4003c4553e4e62825344c0418eea087bed5ee05a4745690600090a25050565b610b11612c21565b73ffffffffffffffffffffffffffffffffffffffff8216610b5e576040517f9c8d2cd200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000610b68612c72565b90506000811215610bb4576040517fcf47918100000000000000000000000000000000000000000000000000000000815260006004820152602481018390526044015b60405180910390fd5b80821115610bf8576040517fcf4791810000000000000000000000000000000000000000000000000000000081526004810182905260248101839052604401610bab565b6040517fa9059cbb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8481166004830152602482018490526000917f00000000000000000000000000000000000000000000000000000000000000009091169063a9059cbb906044016020604051808303816000875af1158015610c92573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cb69190614de8565b905080610cef576040517f90b8ec1800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8373ffffffffffffffffffffffffffffffffffffffff167f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff167f5e110f8bc8a20b65dcc87f224bdf1cc039346e267118bae2739847f07321ffa885604051610d6e91815260200190565b60405180910390a350505050565b610d84612c21565b73ffffffffffffffffffffffffffffffffffffffff8216610dd1576040517f9c8d2cd200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603610e56576040517fc1ab6dc100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000610e60612c72565b128015610e835750600060255460ff166001811115610e8157610e816146b9565b145b15610eba576040517f981bb6a000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff83166000818152602160205260408082205490517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152919290916370a0823190602401602060405180830381865afa158015610f36573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f5a9190614e03565b610f649190614b23565b905080821115610faa576040517fcf4791810000000000000000000000000000000000000000000000000000000081526004810182905260248101839052604401610bab565b610fcb73ffffffffffffffffffffffffffffffffffffffff85168484612d41565b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f5e110f8bc8a20b65dcc87f224bdf1cc039346e267118bae2739847f07321ffa884604051610d6e91815260200190565b60006060600080600080600061103e612b9b565b60006110498a612e1a565b905060006014604051806101200160405290816000820160009054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff166bffffffffffffffffffffffff16815260200160008201600c9054906101000a900463ffffffff1663ffffffff1663ffffffff1681526020016000820160109054906101000a900462ffffff1662ffffff1662ffffff1681526020016000820160139054906101000a900461ffff1661ffff1661ffff1681526020016000820160159054906101000a900460ff1660ff1660ff1681526020016000820160169054906101000a900460ff161515151581526020016000820160179054906101000a900460ff161515151581526020016000820160189054906101000a900460ff161515151581526020016001820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152505090506000600460008d8152602001908152602001600020604051806101200160405290816000820160009054906101000a900460ff161515151581526020016000820160019054906101000a900460ff161515151581526020016000820160029054906101000a900463ffffffff1663ffffffff1663ffffffff1681526020016000820160069054906101000a900463ffffffff1663ffffffff1663ffffffff16815260200160008201600a9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016001820160009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff1681526020016001820160109054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff166bffffffffffffffffffffffff16815260200160018201601c9054906101000a900463ffffffff1663ffffffff1663ffffffff1681526020016002820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152505090506000808360a001511561140c5750506040805160208101825260008082529290910151919a5098506009975089965063ffffffff169450859350839250611782915050565b606083015163ffffffff908116146114565750506040805160208101825260008082529290910151919a5098506001975089965063ffffffff169450859350839250611782915050565b8251156114955750506040805160208101825260008082529290910151919a5098506002975089965063ffffffff169450859350839250611782915050565b61149e84612ec5565b8094508198508299505050506114c38e858786604001518b8b888a61010001516130b7565b9050806bffffffffffffffffffffffff168360c001516bffffffffffffffffffffffff1610156115255750506040805160208101825260008082529290910151919a5098506006975089965063ffffffff169450859350839250611782915050565b505060006115348d858e613427565b90505a9750600080836080015173ffffffffffffffffffffffffffffffffffffffff1663f00e6a2a6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561158b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115af9190614abb565b73ffffffffffffffffffffffffffffffffffffffff16601660000160149054906101000a900463ffffffff1663ffffffff16846040516115ef9190614ad8565b60006040518083038160008787f1925050503d806000811461162d576040519150601f19603f3d011682016040523d82523d6000602084013e611632565b606091505b50915091505a611642908b614b23565b9950816116c8576018548151780100000000000000000000000000000000000000000000000090910463ffffffff1610156116a75750506040805160208101825260008082529390910151929b509950600898505063ffffffff169450611782915050565b604090930151929a50600399505063ffffffff909116955061178292505050565b808060200190518101906116dc9190614b8b565b909d509b508c6117165750506040805160208101825260008082529390910151929b509950600498505063ffffffff169450611782915050565b6018548c517401000000000000000000000000000000000000000090910463ffffffff1610156117705750506040805160208101825260008082529390910151929b509950600598505063ffffffff169450611782915050565b5050506040015163ffffffff16945050505b92959891949750929550565b611796613607565b600081815260046020908152604080832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055602390915280822080547fffffffffffffffffffffffffffffffffffffffffffffffffff000000000000001690555182917f97d0ef3f46a56168af653f547bdb6f77ec2b1d7d9bc6ba0193c2b340ec68064a91a250565b60145477010000000000000000000000000000000000000000000000900460ff161561187c576040517f37ed32e800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b601480547fffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffffffff167701000000000000000000000000000000000000000000000017905573ffffffffffffffffffffffffffffffffffffffff811661190b576040517f9c8d2cd200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000828152600460209081526040808320815161012081018352815460ff8082161515835261010080830490911615158387015263ffffffff620100008304811684870152660100000000000083048116606085015273ffffffffffffffffffffffffffffffffffffffff6a01000000000000000000009093048316608085015260018501546fffffffffffffffffffffffffffffffff811660a08601526bffffffffffffffffffffffff70010000000000000000000000000000000082041660c08601527c010000000000000000000000000000000000000000000000000000000090041660e084015260029093015481169282019290925286855260059093529220549091163314611a4b576040517fa47c170600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b601554604080517f57e871e7000000000000000000000000000000000000000000000000000000008152905173ffffffffffffffffffffffffffffffffffffffff909216916357e871e7916004808201926020929091908290030181865afa158015611abb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611adf9190614e03565b816060015163ffffffff161115611b22576040517fff84e5dd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008381526004602090815260408083206001015461010085015173ffffffffffffffffffffffffffffffffffffffff1684526021909252909120547001000000000000000000000000000000009091046bffffffffffffffffffffffff1690611b8d908290614b23565b6101008301805173ffffffffffffffffffffffffffffffffffffffff908116600090815260216020908152604080832095909555888252600490529290922060010180547fffffffff000000000000000000000000ffffffffffffffffffffffffffffffff16905551611c109116846bffffffffffffffffffffffff8416612d41565b604080516bffffffffffffffffffffffff8316815273ffffffffffffffffffffffffffffffffffffffff8516602082015285917ff3b5906e5672f3e524854103bcafbbdba80dbdfeca2c35e116127b1060a68318910160405180910390a25050601480547fffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffffffff1690555050565b60015473ffffffffffffffffffffffffffffffffffffffff163314611d1d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e6572000000000000000000006044820152606401610bab565b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b611da281612ae6565b600081815260046020908152604091829020825161012081018452815460ff808216158015845261010080840490921615159584019590955262010000820463ffffffff9081169684019690965266010000000000008204861660608401526a010000000000000000000090910473ffffffffffffffffffffffffffffffffffffffff908116608084015260018401546fffffffffffffffffffffffffffffffff811660a085015270010000000000000000000000000000000081046bffffffffffffffffffffffff1660c08501527c0100000000000000000000000000000000000000000000000000000000900490951660e083015260029092015490931690830152611edc576040517f514b6c2400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600082815260046020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055611f1e600283613658565b5060405182907f8ab10247ce168c27748e656ecf852b951fcaac790c18106b19aa0ae57a8b741f90600090a25050565b611f5783612ae6565b6000838152601e60205260409020611f70828483614c70565b50827f3e8740446213c8a77d40e08f79136ce3f347d13ed270a6ebdf57159e0faf4850838360405161094a929190614dd4565b600082815260046020908152604091829020825161012081018452815460ff8082161515835261010080830490911615159483019490945263ffffffff6201000082048116958301959095526601000000000000810485166060830181905273ffffffffffffffffffffffffffffffffffffffff6a01000000000000000000009092048216608084015260018401546fffffffffffffffffffffffffffffffff811660a08501526bffffffffffffffffffffffff70010000000000000000000000000000000082041660c08501527c01000000000000000000000000000000000000000000000000000000009004861660e084015260029093015416928101929092529091146120df576040517f9c0083a200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b341561217b577f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1681610100015173ffffffffffffffffffffffffffffffffffffffff161461216f576040517fc1ab6dc100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61217834613664565b91505b818160c0015161218b9190614e1c565b600084815260046020908152604080832060010180547fffffffff000000000000000000000000ffffffffffffffffffffffffffffffff167001000000000000000000000000000000006bffffffffffffffffffffffff9687160217905561010085015173ffffffffffffffffffffffffffffffffffffffff168352602190915290205461221b91841690614e41565b61010082015173ffffffffffffffffffffffffffffffffffffffff1660009081526021602052604081209190915534900361228b576101008101516122869073ffffffffffffffffffffffffffffffffffffffff1633306bffffffffffffffffffffffff8616613706565b61231b565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663d0e30db0836bffffffffffffffffffffffff166040518263ffffffff1660e01b81526004016000604051808303818588803b15801561230157600080fd5b505af1158015612315573d6000803e3d6000fd5b50505050505b6040516bffffffffffffffffffffffff83168152339084907fafd24114486da8ebfc32f3626dada8863652e187461aa74d4bfa7348915062039060200160405180910390a3505050565b6108fc8163ffffffff1610806123a2575060165463ffffffff78010000000000000000000000000000000000000000000000009091048116908216115b156123d9576040517f14c237fb00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6123e282612ae6565b60008281526004602090815260409182902080547fffffffffffffffffffffffffffffffffffffffffffffffffffff00000000ffff166201000063ffffffff861690810291909117909155915191825283917fc24c07e655ce79fba8a589778987d3c015bc6af1632bb20cf9182e02a65d972c91015b60405180910390a25050565b61246c613607565b6000828152600460205260409020546601000000000000900463ffffffff908116146124c4576040517f9c0083a200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600082815260046020908152604080832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790556023909152902081906125128282614e65565b905050817fd8a6d79d170a55968079d3a89b960d86b4442aef6aac1d01e644c32b9e38b340826040516124589190614eec565b600080612550612b9b565b601454760100000000000000000000000000000000000000000000900460ff16156125a7576040517f24522f3400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600085815260046020908152604091829020825161012081018452815460ff8082161515835261010080830490911615158386015262010000820463ffffffff90811684880181905266010000000000008404821660608601526a010000000000000000000090930473ffffffffffffffffffffffffffffffffffffffff9081166080860181905260018701546fffffffffffffffffffffffffffffffff811660a088015270010000000000000000000000000000000081046bffffffffffffffffffffffff1660c08801527c0100000000000000000000000000000000000000000000000000000000900490921660e0860152600290950154909416908301528451601f890185900485028101850190955287855290936126e393899089908190840183828082843760009201919091525061376a92505050565b9097909650945050505050565b600081815260046020908152604091829020825161012081018452815460ff8082161515835261010080830490911615159483019490945263ffffffff6201000082048116958301959095526601000000000000810485166060830181905273ffffffffffffffffffffffffffffffffffffffff6a01000000000000000000009092048216608084015260018401546fffffffffffffffffffffffffffffffff811660a08501526bffffffffffffffffffffffff70010000000000000000000000000000000082041660c08501527c01000000000000000000000000000000000000000000000000000000009004861660e0840152600290930154169281019290925290911461282c576040517f9c0083a200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008281526006602052604090205473ffffffffffffffffffffffffffffffffffffffff163314612889576040517f6352a85300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008281526005602090815260408083208054337fffffffffffffffffffffffff0000000000000000000000000000000000000000808316821790935560069094528285208054909216909155905173ffffffffffffffffffffffffffffffffffffffff90911692839186917f5cff4db96bef051785e999f44bfcd21c18823e034fb92dd376e3db4ce0feeb2c91a4505050565b61292683612ae6565b6017547c0100000000000000000000000000000000000000000000000000000000900463ffffffff16811115612988576040517fae7235df00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008381526007602052604090206129a1828483614c70565b50827fcba2d5723b2ee59e53a8e8a82a4a7caf4fdfe70e9f7c582950bf7e7a5c24e83d838360405161094a929190614dd4565b600060606000806000634b56a42e60e01b8888886040516024016129fa93929190614f23565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff00000000000000000000000000000000000000000000000000000000909316929092179091529050612a838982610617565b929c919b50995090975095505050505050565b612a9e613985565b612aa781613a06565b50565b600060606000806000806000612acf886040518060200160405280600081525061102a565b959e949d50929b5090995097509550909350915050565b60008181526005602052604090205473ffffffffffffffffffffffffffffffffffffffff163314612b43576040517fa47c170600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000818152600460205260409020546601000000000000900463ffffffff90811614612aa7576040517f9c0083a200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b3273ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614612c0a576040517fb60ac5db00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b565b6000612c188383613afb565b90505b92915050565b60185473ffffffffffffffffffffffffffffffffffffffff163314612c0a576040517fb6dfb7a600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166000818152602160205260408082205490517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152919290916370a0823190602401602060405180830381865afa158015612d0e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d329190614e03565b612d3c9190614fb9565b905090565b60405173ffffffffffffffffffffffffffffffffffffffff8316602482015260448101829052612e159084907fa9059cbb00000000000000000000000000000000000000000000000000000000906064015b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152613b4a565b505050565b6000818160045b600f811015612ea7577fff000000000000000000000000000000000000000000000000000000000000008216838260208110612e5f57612e5f614fd9565b1a60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614612e9557506000949350505050565b80612e9f81615008565b915050612e21565b5081600f1a6001811115612ebd57612ebd6146b9565b949350505050565b600080600080846040015162ffffff1690506000808263ffffffff161190506000807f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663feaf968c6040518163ffffffff1660e01b815260040160a060405180830381865afa158015612f52573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f76919061505a565b5094509092505050600081131580612f8d57508142105b80612fae5750828015612fae5750612fa58242614b23565b8463ffffffff16105b15612fbd576019549650612fc1565b8096505b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663feaf968c6040518163ffffffff1660e01b815260040160a060405180830381865afa15801561302c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613050919061505a565b509450909250505060008113158061306757508142105b806130885750828015613088575061307f8242614b23565b8463ffffffff16105b1561309757601a54955061309b565b8095505b86866130a68a613c56565b965096509650505050509193909250565b60008080808960018111156130ce576130ce6146b9565b036130dd575062017f98613132565b60018960018111156130f1576130f16146b9565b0361310057506201e26c613132565b6040517ff2b2d41200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008a60800151600161314591906150aa565b6131539060ff1660406150c3565b601854613181906103a49074010000000000000000000000000000000000000000900463ffffffff16614e41565b61318b9190614e41565b601554604080517fde9ee35e0000000000000000000000000000000000000000000000000000000081528151939450600093849373ffffffffffffffffffffffffffffffffffffffff169263de9ee35e92600480820193918290030181865afa1580156131fc573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061322091906150da565b90925090508183613232836018614e41565b61323c91906150c3565b60808f015161324c9060016150aa565b61325b9060ff166115e06150c3565b6132659190614e41565b61326f9190614e41565b6132799085614e41565b6101008e01516040517f125441400000000000000000000000000000000000000000000000000000000081526004810186905291955073ffffffffffffffffffffffffffffffffffffffff1690631254414090602401602060405180830381865afa1580156132ec573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906133109190614e03565b8d6060015161ffff1661332391906150c3565b945050505060006133348b86613d47565b60008d815260046020526040902054909150610100900460ff16156133995760008c81526023602090815260409182902082518084018452905463ffffffff811680835264010000000090910462ffffff908116928401928352928501525116908201525b60006134038c6040518061012001604052808d63ffffffff1681526020018681526020018781526020018c81526020018b81526020018a81526020018973ffffffffffffffffffffffffffffffffffffffff16815260200185815260200160001515815250613ec3565b6020810151815191925061341691614e1c565b9d9c50505050505050505050505050565b6060600083600181111561343d5761343d6146b9565b03613506576000848152600760205260409081902090517f6e04ff0d000000000000000000000000000000000000000000000000000000009161348291602401615199565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff00000000000000000000000000000000000000000000000000000000909316929092179091529050613600565b600183600181111561351a5761351a6146b9565b03613100576000828060200190518101906135359190615212565b6000868152600760205260409081902090519192507f40691db4000000000000000000000000000000000000000000000000000000009161357a918491602401615322565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff000000000000000000000000000000000000000000000000000000009093169290921790915291506136009050565b9392505050565b60175473ffffffffffffffffffffffffffffffffffffffff163314612c0a576040517f77c3599200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000612c18838361420a565b60006bffffffffffffffffffffffff821115613702576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203960448201527f36206269747300000000000000000000000000000000000000000000000000006064820152608401610bab565b5090565b60405173ffffffffffffffffffffffffffffffffffffffff808516602483015283166044820152606481018290526137649085907f23b872dd0000000000000000000000000000000000000000000000000000000090608401612d93565b50505050565b601454600090819077010000000000000000000000000000000000000000000000900460ff16156137c7576040517f37ed32e800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b601480547fffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffffffff16770100000000000000000000000000000000000000000000001790556040517f4585e33b000000000000000000000000000000000000000000000000000000009061383c9085906024016153ed565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff000000000000000000000000000000000000000000000000000000009094169390931790925290517f79188d1600000000000000000000000000000000000000000000000000000000815290935073ffffffffffffffffffffffffffffffffffffffff8616906379188d169061390f9087908790600401615400565b60408051808303816000875af115801561392d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906139519190615419565b601480547fffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffffffff16905590969095509350505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314612c0a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e6572000000000000000000006044820152606401610bab565b3373ffffffffffffffffffffffffffffffffffffffff821603613a85576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c660000000000000000006044820152606401610bab565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b6000818152600183016020526040812054613b4257508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155612c1b565b506000612c1b565b6000613bac826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166142fd9092919063ffffffff16565b805190915015612e155780806020019051810190613bca9190614de8565b612e15576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610bab565b60008060007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663feaf968c6040518163ffffffff1660e01b815260040160a060405180830381865afa158015613cc6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613cea919061505a565b50935050925050600082131580613d0057508042105b80613d3057506000846040015162ffffff16118015613d305750613d248142614b23565b846040015162ffffff16105b15613d40575050601b5492915050565b5092915050565b60408051608081018252600080825260208083018281528385018381526060850184905273ffffffffffffffffffffffffffffffffffffffff878116855260229093528584208054640100000000810462ffffff1690925263ffffffff82169092527b01000000000000000000000000000000000000000000000000000000810460ff16855285517ffeaf968c00000000000000000000000000000000000000000000000000000000815295519495919484936701000000000000009092049091169163feaf968c9160048083019260a09291908290030181865afa158015613e34573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613e58919061505a565b50935050925050600082131580613e6e57508042105b80613e9e57506000866040015162ffffff16118015613e9e5750613e928142614b23565b866040015162ffffff16105b15613eb25760018301546060850152613eba565b606084018290525b50505092915050565b6040805161010081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e081019190915260008260e001516000015160ff1690506000846060015161ffff168460600151613f2e91906150c3565b90508361010001518015613f415750803a105b15613f4957503a5b600060128311613f5a576001613f70565b613f65601284614b23565b613f7090600a615565565b9050600060128410613f83576001613f99565b613f8e846012614b23565b613f9990600a615565565b905060008660a00151876040015188602001518960000151613fbb9190614e41565b613fc590876150c3565b613fcf9190614e41565b613fd991906150c3565b9050614035828860e0015160600151613ff291906150c3565b6001848a60e001516060015161400891906150c3565b6140129190614b23565b61401c86856150c3565b6140269190614e41565b6140309190615571565b613664565b6bffffffffffffffffffffffff1686526080870151614058906140309083615571565b6bffffffffffffffffffffffff1660408088019190915260e088015101516000906140919062ffffff16683635c9adc5dea000006150c3565b9050600081633b9aca008a60a001518b60e001516020015163ffffffff168c604001518d600001518b6140c491906150c3565b6140ce9190614e41565b6140d891906150c3565b6140e291906150c3565b6140ec9190615571565b6140f69190614e41565b9050614139848a60e001516060015161410f91906150c3565b6001868c60e001516060015161412591906150c3565b61412f9190614b23565b61401c88856150c3565b6bffffffffffffffffffffffff166020890152608089015161415f906140309083615571565b6bffffffffffffffffffffffff16606089015260c089015173ffffffffffffffffffffffffffffffffffffffff166080808a01919091528901516141a290613664565b6bffffffffffffffffffffffff1660a0808a01919091528901516141c590613664565b6bffffffffffffffffffffffff1660c089015260e0890151606001516141ea90613664565b6bffffffffffffffffffffffff1660e08901525050505050505092915050565b600081815260018301602052604081205480156142f357600061422e600183614b23565b855490915060009061424290600190614b23565b90508181146142a757600086600001828154811061426257614262614fd9565b906000526020600020015490508087600001848154811061428557614285614fd9565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806142b8576142b86155ac565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050612c1b565b6000915050612c1b565b6060612ebd8484600085856000808673ffffffffffffffffffffffffffffffffffffffff1685876040516143319190614ad8565b60006040518083038185875af1925050503d806000811461436e576040519150601f19603f3d011682016040523d82523d6000602084013e614373565b606091505b50915091506143848783838761438f565b979650505050505050565b6060831561442557825160000361441e5773ffffffffffffffffffffffffffffffffffffffff85163b61441e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610bab565b5081612ebd565b612ebd838381511561443a5781518083602001fd5b806040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bab91906153ed565b73ffffffffffffffffffffffffffffffffffffffff81168114612aa757600080fd5b600080604083850312156144a357600080fd5b8235915060208301356144b58161446e565b809150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051610100810167ffffffffffffffff81118282101715614513576145136144c0565b60405290565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715614560576145606144c0565b604052919050565b600067ffffffffffffffff821115614582576145826144c0565b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b600082601f8301126145bf57600080fd5b81356145d26145cd82614568565b614519565b8181528460208386010111156145e757600080fd5b816020850160208301376000918101602001919091529392505050565b6000806040838503121561461757600080fd5b82359150602083013567ffffffffffffffff81111561463557600080fd5b614641858286016145ae565b9150509250929050565b60005b8381101561466657818101518382015260200161464e565b50506000910152565b6000815180845261468781602086016020860161464b565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b600a811061471f577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b9052565b841515815260806020820152600061473e608083018661466f565b905061474d60408301856146e8565b82606083015295945050505050565b60008083601f84011261476e57600080fd5b50813567ffffffffffffffff81111561478657600080fd5b60208301915083602082850101111561479e57600080fd5b9250929050565b6000806000604084860312156147ba57600080fd5b83359250602084013567ffffffffffffffff8111156147d857600080fd5b6147e48682870161475c565b9497909650939450505050565b60006020828403121561480357600080fd5b5035919050565b6000806040838503121561481d57600080fd5b82356148288161446e565b946020939093013593505050565b60008060006060848603121561484b57600080fd5b83356148568161446e565b925060208401356148668161446e565b929592945050506040919091013590565b871515815260e06020820152600061489260e083018961466f565b90506148a160408301886146e8565b8560608301528460808301528360a08301528260c083015298975050505050505050565b600080604083850312156148d857600080fd5b8235915060208301356bffffffffffffffffffffffff811681146144b557600080fd5b63ffffffff81168114612aa757600080fd5b6000806040838503121561492057600080fd5b8235915060208301356144b5816148fb565b600080828403606081121561494657600080fd5b8335925060407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08201121561497a57600080fd5b506020830190509250929050565b600067ffffffffffffffff8211156149a2576149a26144c0565b5060051b60200190565b600080600080606085870312156149c257600080fd5b8435935060208086013567ffffffffffffffff808211156149e257600080fd5b818801915088601f8301126149f657600080fd5b8135614a046145cd82614988565b81815260059190911b8301840190848101908b831115614a2357600080fd5b8585015b83811015614a5b57803585811115614a3f5760008081fd5b614a4d8e89838a01016145ae565b845250918601918601614a27565b50975050506040880135925080831115614a7457600080fd5b5050614a828782880161475c565b95989497509550505050565b600060208284031215614aa057600080fd5b81356136008161446e565b8051614ab68161446e565b919050565b600060208284031215614acd57600080fd5b81516136008161446e565b60008251614aea81846020870161464b565b9190910192915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b81810381811115612c1b57612c1b614af4565b80518015158114614ab657600080fd5b600082601f830112614b5757600080fd5b8151614b656145cd82614568565b818152846020838601011115614b7a57600080fd5b612ebd82602083016020870161464b565b60008060408385031215614b9e57600080fd5b614ba783614b36565b9150602083015167ffffffffffffffff811115614bc357600080fd5b61464185828601614b46565b600181811c90821680614be357607f821691505b602082108103614c1c577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b601f821115612e1557600081815260208120601f850160051c81016020861015614c495750805b601f850160051c820191505b81811015614c6857828155600101614c55565b505050505050565b67ffffffffffffffff831115614c8857614c886144c0565b614c9c83614c968354614bcf565b83614c22565b6000601f841160018114614cee5760008515614cb85750838201355b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600387901b1c1916600186901b178355614d84565b6000838152602090207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0861690835b82811015614d3d5786850135825560209485019460019092019101614d1d565b5086821015614d78577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60f88860031b161c19848701351681555b505060018560011b0183555b5050505050565b8183528181602085013750600060208284010152600060207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b602081526000612ebd602083018486614d8b565b600060208284031215614dfa57600080fd5b612c1882614b36565b600060208284031215614e1557600080fd5b5051919050565b6bffffffffffffffffffffffff818116838216019080821115613d4057613d40614af4565b80820180821115612c1b57612c1b614af4565b62ffffff81168114612aa757600080fd5b8135614e70816148fb565b63ffffffff811690508154817fffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000000082161783556020840135614eb081614e54565b66ffffff000000008160201b16837fffffffffffffffffffffffffffffffffffffffffffffffffff000000000000008416171784555050505050565b604081018235614efb816148fb565b63ffffffff1682526020830135614f1181614e54565b62ffffff811660208401525092915050565b6000604082016040835280865180835260608501915060608160051b8601019250602080890160005b83811015614f98577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa0888703018552614f8686835161466f565b95509382019390820190600101614f4c565b505085840381870152505050614faf818587614d8b565b9695505050505050565b8181036000831280158383131683831282161715613d4057613d40614af4565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361503957615039614af4565b5060010190565b805169ffffffffffffffffffff81168114614ab657600080fd5b600080600080600060a0868803121561507257600080fd5b61507b86615040565b945060208601519350604086015192506060860151915061509e60808701615040565b90509295509295909350565b60ff8181168382160190811115612c1b57612c1b614af4565b8082028115828204841417612c1b57612c1b614af4565b600080604083850312156150ed57600080fd5b505080516020909101519092909150565b6000815461510b81614bcf565b80855260206001838116801561512857600181146151605761518e565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff008516838901528284151560051b890101955061518e565b866000528260002060005b858110156151865781548a820186015290830190840161516b565b890184019650505b505050505092915050565b602081526000612c1860208301846150fe565b600082601f8301126151bd57600080fd5b815160206151cd6145cd83614988565b82815260059290921b840181019181810190868411156151ec57600080fd5b8286015b8481101561520757805183529183019183016151f0565b509695505050505050565b60006020828403121561522457600080fd5b815167ffffffffffffffff8082111561523c57600080fd5b90830190610100828603121561525157600080fd5b6152596144ef565b825181526020830151602082015260408301516040820152606083015160608201526080830151608082015261529160a08401614aab565b60a082015260c0830151828111156152a857600080fd5b6152b4878286016151ac565b60c08301525060e0830151828111156152cc57600080fd5b6152d887828601614b46565b60e08301525095945050505050565b600081518084526020808501945080840160005b83811015615317578151875295820195908201906001016152fb565b509495945050505050565b60408152825160408201526020830151606082015260408301516080820152606083015160a0820152608083015160c082015273ffffffffffffffffffffffffffffffffffffffff60a08401511660e0820152600060c08401516101008081850152506153936101408401826152e7565b905060e08501517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0848303016101208501526153cf828261466f565b91505082810360208401526153e481856150fe565b95945050505050565b602081526000612c18602083018461466f565b828152604060208201526000612ebd604083018461466f565b6000806040838503121561542c57600080fd5b61543583614b36565b9150602083015190509250929050565b600181815b8085111561549e57817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0482111561548457615484614af4565b8085161561549157918102915b93841c939080029061544a565b509250929050565b6000826154b557506001612c1b565b816154c257506000612c1b565b81600181146154d857600281146154e2576154fe565b6001915050612c1b565b60ff8411156154f3576154f3614af4565b50506001821b612c1b565b5060208310610133831016604e8410600b8410161715615521575081810a612c1b565b61552b8383615445565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0482111561555d5761555d614af4565b029392505050565b6000612c1883836154a6565b6000826155a7577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fdfea164736f6c6343000813000a", } var AutomationRegistryLogicBABI = AutomationRegistryLogicBMetaData.ABI diff --git a/core/gethwrappers/generated/automation_registry_logic_c_wrapper_2_3/automation_registry_logic_c_wrapper_2_3.go b/core/gethwrappers/generated/automation_registry_logic_c_wrapper_2_3/automation_registry_logic_c_wrapper_2_3.go index e32d6890ddd..d5e6d9d64ff 100644 --- a/core/gethwrappers/generated/automation_registry_logic_c_wrapper_2_3/automation_registry_logic_c_wrapper_2_3.go +++ b/core/gethwrappers/generated/automation_registry_logic_c_wrapper_2_3/automation_registry_logic_c_wrapper_2_3.go @@ -151,7 +151,7 @@ type IAutomationV21PlusCommonUpkeepInfoLegacy struct { var AutomationRegistryLogicCMetaData = &bind.MetaData{ ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"link\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"linkUSDFeed\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"nativeUSDFeed\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"fastGasFeed\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"automationForwarderLogic\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"allowedReadOnlyAddress\",\"type\":\"address\"},{\"internalType\":\"enumAutomationRegistryBase2_3.PayoutMode\",\"name\":\"payoutMode\",\"type\":\"uint8\"},{\"internalType\":\"address\",\"name\":\"wrappedNativeTokenAddress\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"ArrayHasNoEntries\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"CannotCancel\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"CheckDataExceedsLimit\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ConfigDigestMismatch\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DuplicateEntry\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DuplicateSigners\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"GasLimitCanOnlyIncrease\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"GasLimitOutsideRange\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"IncorrectNumberOfFaultyOracles\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"IncorrectNumberOfSignatures\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"IncorrectNumberOfSigners\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"IndexOutOfRange\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"available\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"requested\",\"type\":\"uint256\"}],\"name\":\"InsufficientBalance\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InsufficientLinkLiquidity\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidDataLength\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidFeed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidPayee\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidRecipient\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidReport\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidSigner\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidToken\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidTransmitter\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidTrigger\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidTriggerType\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"MigrationNotPermitted\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"MustSettleOffchain\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"MustSettleOnchain\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotAContract\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyActiveSigners\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyActiveTransmitters\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCallableByAdmin\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCallableByLINKToken\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCallableByOwnerOrAdmin\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCallableByOwnerOrRegistrar\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCallableByPayee\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCallableByProposedAdmin\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCallableByProposedPayee\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCallableByUpkeepPrivilegeManager\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyFinanceAdmin\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyPausedUpkeep\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlySimulatedBackend\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyUnpausedUpkeep\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ParameterLengthError\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ReentrantCall\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RegistryPaused\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RepeatedSigner\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RepeatedTransmitter\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"reason\",\"type\":\"bytes\"}],\"name\":\"TargetCheckReverted\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TooManyOracles\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TranscoderNotSet\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TransferFailed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UpkeepAlreadyExists\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UpkeepCancelled\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UpkeepNotCanceled\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UpkeepNotNeeded\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ValueNotChanged\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddressNotAllowed\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"admin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"privilegeConfig\",\"type\":\"bytes\"}],\"name\":\"AdminPrivilegeConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"components\":[{\"internalType\":\"uint32\",\"name\":\"gasFeePPB\",\"type\":\"uint32\"},{\"internalType\":\"uint24\",\"name\":\"flatFeeMilliCents\",\"type\":\"uint24\"}],\"indexed\":false,\"internalType\":\"structAutomationRegistryBase2_3.BillingOverrides\",\"name\":\"overrides\",\"type\":\"tuple\"}],\"name\":\"BillingConfigOverridden\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"BillingConfigOverrideRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contractIERC20Metadata\",\"name\":\"token\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"uint32\",\"name\":\"gasFeePPB\",\"type\":\"uint32\"},{\"internalType\":\"uint24\",\"name\":\"flatFeeMilliCents\",\"type\":\"uint24\"},{\"internalType\":\"contractAggregatorV3Interface\",\"name\":\"priceFeed\",\"type\":\"address\"},{\"internalType\":\"uint8\",\"name\":\"decimals\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"fallbackPrice\",\"type\":\"uint256\"},{\"internalType\":\"uint96\",\"name\":\"minSpend\",\"type\":\"uint96\"}],\"indexed\":false,\"internalType\":\"structAutomationRegistryBase2_3.BillingConfig\",\"name\":\"config\",\"type\":\"tuple\"}],\"name\":\"BillingConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"trigger\",\"type\":\"bytes\"}],\"name\":\"CancelledUpkeepReport\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newModule\",\"type\":\"address\"}],\"name\":\"ChainSpecificModuleUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"dedupKey\",\"type\":\"bytes32\"}],\"name\":\"DedupKeyAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"assetAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"FeesWithdrawn\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"}],\"name\":\"FundsAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"FundsWithdrawn\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"trigger\",\"type\":\"bytes\"}],\"name\":\"InsufficientFundsUpkeepReport\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"payees\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"uint256[]\",\"name\":\"payments\",\"type\":\"uint256[]\"}],\"name\":\"NOPsSettledOffchain\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"Paused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"transmitters\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"payees\",\"type\":\"address[]\"}],\"name\":\"PayeesUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"transmitter\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"PayeeshipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"transmitter\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"PayeeshipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"transmitter\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"payee\",\"type\":\"address\"}],\"name\":\"PaymentWithdrawn\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"trigger\",\"type\":\"bytes\"}],\"name\":\"ReorgedUpkeepReport\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"trigger\",\"type\":\"bytes\"}],\"name\":\"StaleUpkeepReport\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"Unpaused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"UpkeepAdminTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"UpkeepAdminTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"atBlockHeight\",\"type\":\"uint64\"}],\"name\":\"UpkeepCanceled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"components\":[{\"internalType\":\"uint96\",\"name\":\"gasChargeInBillingToken\",\"type\":\"uint96\"},{\"internalType\":\"uint96\",\"name\":\"premiumInBillingToken\",\"type\":\"uint96\"},{\"internalType\":\"uint96\",\"name\":\"gasReimbursementInJuels\",\"type\":\"uint96\"},{\"internalType\":\"uint96\",\"name\":\"premiumInJuels\",\"type\":\"uint96\"},{\"internalType\":\"contractIERC20Metadata\",\"name\":\"billingToken\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"linkUSD\",\"type\":\"uint96\"},{\"internalType\":\"uint96\",\"name\":\"nativeUSD\",\"type\":\"uint96\"},{\"internalType\":\"uint96\",\"name\":\"billingUSD\",\"type\":\"uint96\"}],\"indexed\":false,\"internalType\":\"structAutomationRegistryBase2_3.PaymentReceipt\",\"name\":\"receipt\",\"type\":\"tuple\"}],\"name\":\"UpkeepCharged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"newCheckData\",\"type\":\"bytes\"}],\"name\":\"UpkeepCheckDataSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"gasLimit\",\"type\":\"uint96\"}],\"name\":\"UpkeepGasLimitSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"remainingBalance\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"name\":\"UpkeepMigrated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"offchainConfig\",\"type\":\"bytes\"}],\"name\":\"UpkeepOffchainConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"UpkeepPaused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"bool\",\"name\":\"success\",\"type\":\"bool\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"totalPayment\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"gasUsed\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"gasOverhead\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"trigger\",\"type\":\"bytes\"}],\"name\":\"UpkeepPerformed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"privilegeConfig\",\"type\":\"bytes\"}],\"name\":\"UpkeepPrivilegeConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"startingBalance\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"importedFrom\",\"type\":\"address\"}],\"name\":\"UpkeepReceived\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"performGas\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"admin\",\"type\":\"address\"}],\"name\":\"UpkeepRegistered\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"triggerConfig\",\"type\":\"bytes\"}],\"name\":\"UpkeepTriggerConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"UpkeepUnpaused\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"transmitter\",\"type\":\"address\"}],\"name\":\"acceptPayeeship\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"disableOffchainPayments\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"startIndex\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxCount\",\"type\":\"uint256\"}],\"name\":\"getActiveUpkeepIDs\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"\",\"type\":\"uint256[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"admin\",\"type\":\"address\"}],\"name\":\"getAdminPrivilegeConfig\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAllowedReadOnlyAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAutomationForwarderLogic\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractIERC20Metadata\",\"name\":\"billingToken\",\"type\":\"address\"}],\"name\":\"getAvailableERC20ForPayment\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"getBalance\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"balance\",\"type\":\"uint96\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractIERC20Metadata\",\"name\":\"billingToken\",\"type\":\"address\"}],\"name\":\"getBillingConfig\",\"outputs\":[{\"components\":[{\"internalType\":\"uint32\",\"name\":\"gasFeePPB\",\"type\":\"uint32\"},{\"internalType\":\"uint24\",\"name\":\"flatFeeMilliCents\",\"type\":\"uint24\"},{\"internalType\":\"contractAggregatorV3Interface\",\"name\":\"priceFeed\",\"type\":\"address\"},{\"internalType\":\"uint8\",\"name\":\"decimals\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"fallbackPrice\",\"type\":\"uint256\"},{\"internalType\":\"uint96\",\"name\":\"minSpend\",\"type\":\"uint96\"}],\"internalType\":\"structAutomationRegistryBase2_3.BillingConfig\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"upkeepID\",\"type\":\"uint256\"}],\"name\":\"getBillingOverrides\",\"outputs\":[{\"components\":[{\"internalType\":\"uint32\",\"name\":\"gasFeePPB\",\"type\":\"uint32\"},{\"internalType\":\"uint24\",\"name\":\"flatFeeMilliCents\",\"type\":\"uint24\"}],\"internalType\":\"structAutomationRegistryBase2_3.BillingOverrides\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"upkeepID\",\"type\":\"uint256\"}],\"name\":\"getBillingOverridesEnabled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"upkeepID\",\"type\":\"uint256\"}],\"name\":\"getBillingToken\",\"outputs\":[{\"internalType\":\"contractIERC20Metadata\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractIERC20Metadata\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"getBillingTokenConfig\",\"outputs\":[{\"components\":[{\"internalType\":\"uint32\",\"name\":\"gasFeePPB\",\"type\":\"uint32\"},{\"internalType\":\"uint24\",\"name\":\"flatFeeMilliCents\",\"type\":\"uint24\"},{\"internalType\":\"contractAggregatorV3Interface\",\"name\":\"priceFeed\",\"type\":\"address\"},{\"internalType\":\"uint8\",\"name\":\"decimals\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"fallbackPrice\",\"type\":\"uint256\"},{\"internalType\":\"uint96\",\"name\":\"minSpend\",\"type\":\"uint96\"}],\"internalType\":\"structAutomationRegistryBase2_3.BillingConfig\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getBillingTokens\",\"outputs\":[{\"internalType\":\"contractIERC20Metadata[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getCancellationDelay\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getChainModule\",\"outputs\":[{\"internalType\":\"contractIChainModule\",\"name\":\"chainModule\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getConditionalGasOverhead\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getConfig\",\"outputs\":[{\"components\":[{\"internalType\":\"uint32\",\"name\":\"checkGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"maxPerformGas\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"maxCheckDataSize\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"transcoder\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"reorgProtectionEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint24\",\"name\":\"stalenessSeconds\",\"type\":\"uint24\"},{\"internalType\":\"uint32\",\"name\":\"maxPerformDataSize\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"maxRevertDataSize\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"upkeepPrivilegeManager\",\"type\":\"address\"},{\"internalType\":\"uint16\",\"name\":\"gasCeilingMultiplier\",\"type\":\"uint16\"},{\"internalType\":\"address\",\"name\":\"financeAdmin\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"fallbackGasPrice\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"fallbackLinkPrice\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"fallbackNativePrice\",\"type\":\"uint256\"},{\"internalType\":\"address[]\",\"name\":\"registrars\",\"type\":\"address[]\"},{\"internalType\":\"contractIChainModule\",\"name\":\"chainModule\",\"type\":\"address\"}],\"internalType\":\"structAutomationRegistryBase2_3.OnchainConfig\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getFallbackNativePrice\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getFastGasFeedAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"upkeepID\",\"type\":\"uint256\"}],\"name\":\"getForwarder\",\"outputs\":[{\"internalType\":\"contractIAutomationForwarder\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getHotVars\",\"outputs\":[{\"components\":[{\"internalType\":\"uint96\",\"name\":\"totalPremium\",\"type\":\"uint96\"},{\"internalType\":\"uint32\",\"name\":\"latestEpoch\",\"type\":\"uint32\"},{\"internalType\":\"uint24\",\"name\":\"stalenessSeconds\",\"type\":\"uint24\"},{\"internalType\":\"uint16\",\"name\":\"gasCeilingMultiplier\",\"type\":\"uint16\"},{\"internalType\":\"uint8\",\"name\":\"f\",\"type\":\"uint8\"},{\"internalType\":\"bool\",\"name\":\"paused\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"reentrancyGuard\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"reorgProtectionEnabled\",\"type\":\"bool\"},{\"internalType\":\"contractIChainModule\",\"name\":\"chainModule\",\"type\":\"address\"}],\"internalType\":\"structAutomationRegistryBase2_3.HotVars\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getLinkAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getLinkUSDFeedAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getLogGasOverhead\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"enumAutomationRegistryBase2_3.Trigger\",\"name\":\"triggerType\",\"type\":\"uint8\"},{\"internalType\":\"uint32\",\"name\":\"gasLimit\",\"type\":\"uint32\"},{\"internalType\":\"contractIERC20Metadata\",\"name\":\"billingToken\",\"type\":\"address\"}],\"name\":\"getMaxPaymentForGas\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"maxPayment\",\"type\":\"uint96\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"getMinBalance\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"\",\"type\":\"uint96\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"getMinBalanceForUpkeep\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"minBalance\",\"type\":\"uint96\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getNativeUSDFeedAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getNumUpkeeps\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getPayoutMode\",\"outputs\":[{\"internalType\":\"enumAutomationRegistryBase2_3.PayoutMode\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"peer\",\"type\":\"address\"}],\"name\":\"getPeerRegistryMigrationPermission\",\"outputs\":[{\"internalType\":\"enumAutomationRegistryBase2_3.MigrationPermission\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getPerPerformByteGasOverhead\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getPerSignerGasOverhead\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getReorgProtectionEnabled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"reorgProtectionEnabled\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractIERC20Metadata\",\"name\":\"billingToken\",\"type\":\"address\"}],\"name\":\"getReserveAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"query\",\"type\":\"address\"}],\"name\":\"getSignerInfo\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"active\",\"type\":\"bool\"},{\"internalType\":\"uint8\",\"name\":\"index\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getState\",\"outputs\":[{\"components\":[{\"internalType\":\"uint32\",\"name\":\"nonce\",\"type\":\"uint32\"},{\"internalType\":\"uint96\",\"name\":\"ownerLinkBalance\",\"type\":\"uint96\"},{\"internalType\":\"uint256\",\"name\":\"expectedLinkBalance\",\"type\":\"uint256\"},{\"internalType\":\"uint96\",\"name\":\"totalPremium\",\"type\":\"uint96\"},{\"internalType\":\"uint256\",\"name\":\"numUpkeeps\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"configCount\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"latestConfigBlockNumber\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"latestConfigDigest\",\"type\":\"bytes32\"},{\"internalType\":\"uint32\",\"name\":\"latestEpoch\",\"type\":\"uint32\"},{\"internalType\":\"bool\",\"name\":\"paused\",\"type\":\"bool\"}],\"internalType\":\"structIAutomationV21PlusCommon.StateLegacy\",\"name\":\"state\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint32\",\"name\":\"paymentPremiumPPB\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"flatFeeMicroLink\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"checkGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint24\",\"name\":\"stalenessSeconds\",\"type\":\"uint24\"},{\"internalType\":\"uint16\",\"name\":\"gasCeilingMultiplier\",\"type\":\"uint16\"},{\"internalType\":\"uint96\",\"name\":\"minUpkeepSpend\",\"type\":\"uint96\"},{\"internalType\":\"uint32\",\"name\":\"maxPerformGas\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"maxCheckDataSize\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"maxPerformDataSize\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"maxRevertDataSize\",\"type\":\"uint32\"},{\"internalType\":\"uint256\",\"name\":\"fallbackGasPrice\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"fallbackLinkPrice\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"transcoder\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"registrars\",\"type\":\"address[]\"},{\"internalType\":\"address\",\"name\":\"upkeepPrivilegeManager\",\"type\":\"address\"}],\"internalType\":\"structIAutomationV21PlusCommon.OnchainConfigLegacy\",\"name\":\"config\",\"type\":\"tuple\"},{\"internalType\":\"address[]\",\"name\":\"signers\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"transmitters\",\"type\":\"address[]\"},{\"internalType\":\"uint8\",\"name\":\"f\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getStorage\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"transcoder\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"checkGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"maxPerformGas\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"nonce\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"upkeepPrivilegeManager\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"configCount\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"latestConfigBlockNumber\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"maxCheckDataSize\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"financeAdmin\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"maxPerformDataSize\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"maxRevertDataSize\",\"type\":\"uint32\"}],\"internalType\":\"structAutomationRegistryBase2_3.Storage\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getTransmitCalldataFixedBytesOverhead\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getTransmitCalldataPerSignerBytesOverhead\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"query\",\"type\":\"address\"}],\"name\":\"getTransmitterInfo\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"active\",\"type\":\"bool\"},{\"internalType\":\"uint8\",\"name\":\"index\",\"type\":\"uint8\"},{\"internalType\":\"uint96\",\"name\":\"balance\",\"type\":\"uint96\"},{\"internalType\":\"uint96\",\"name\":\"lastCollected\",\"type\":\"uint96\"},{\"internalType\":\"address\",\"name\":\"payee\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getTransmittersWithPayees\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"transmitterAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"payeeAddress\",\"type\":\"address\"}],\"internalType\":\"structAutomationRegistryBase2_3.TransmitterPayeeInfo[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"upkeepId\",\"type\":\"uint256\"}],\"name\":\"getTriggerType\",\"outputs\":[{\"internalType\":\"enumAutomationRegistryBase2_3.Trigger\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"getUpkeep\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"performGas\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"checkData\",\"type\":\"bytes\"},{\"internalType\":\"uint96\",\"name\":\"balance\",\"type\":\"uint96\"},{\"internalType\":\"address\",\"name\":\"admin\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"maxValidBlocknumber\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"lastPerformedBlockNumber\",\"type\":\"uint32\"},{\"internalType\":\"uint96\",\"name\":\"amountSpent\",\"type\":\"uint96\"},{\"internalType\":\"bool\",\"name\":\"paused\",\"type\":\"bool\"},{\"internalType\":\"bytes\",\"name\":\"offchainConfig\",\"type\":\"bytes\"}],\"internalType\":\"structIAutomationV21PlusCommon.UpkeepInfoLegacy\",\"name\":\"upkeepInfo\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"upkeepId\",\"type\":\"uint256\"}],\"name\":\"getUpkeepPrivilegeConfig\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"upkeepId\",\"type\":\"uint256\"}],\"name\":\"getUpkeepTriggerConfig\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getWrappedNativeTokenAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"dedupKey\",\"type\":\"bytes32\"}],\"name\":\"hasDedupKey\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"linkAvailableForPayment\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"admin\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"newPrivilegeConfig\",\"type\":\"bytes\"}],\"name\":\"setAdminPrivilegeConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"payees\",\"type\":\"address[]\"}],\"name\":\"setPayees\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"peer\",\"type\":\"address\"},{\"internalType\":\"enumAutomationRegistryBase2_3.MigrationPermission\",\"name\":\"permission\",\"type\":\"uint8\"}],\"name\":\"setPeerRegistryMigrationPermission\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"upkeepId\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"newPrivilegeConfig\",\"type\":\"bytes\"}],\"name\":\"setUpkeepPrivilegeConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"settleNOPsOffchain\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractIERC20Metadata\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"supportsBillingToken\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"transmitter\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"proposed\",\"type\":\"address\"}],\"name\":\"transferPayeeship\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"unpause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"upkeepVersion\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"withdrawPayment\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", - Bin: "0x6101606040523480156200001257600080fd5b5060405162005c8738038062005c87833981016040819052620000359162000309565b87878787878787873380600081620000945760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000c757620000c78162000241565b5050506001600160a01b0380891660805287811660a05286811660c05285811660e052848116610100528316610120526025805483919060ff191660018381811115620001185762000118620003b6565b0217905550806001600160a01b0316610140816001600160a01b03168152505060c0516001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000179573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200019f9190620003cc565b60ff1660a0516001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015620001e3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620002099190620003cc565b60ff16146200022b576040516301f86e1760e41b815260040160405180910390fd5b50505050505050505050505050505050620003f8565b336001600160a01b038216036200029b5760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c6600000000000000000060448201526064016200008b565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b80516001600160a01b03811681146200030457600080fd5b919050565b600080600080600080600080610100898b0312156200032757600080fd5b6200033289620002ec565b97506200034260208a01620002ec565b96506200035260408a01620002ec565b95506200036260608a01620002ec565b94506200037260808a01620002ec565b93506200038260a08a01620002ec565b925060c0890151600281106200039757600080fd5b9150620003a760e08a01620002ec565b90509295985092959890939650565b634e487b7160e01b600052602160045260246000fd5b600060208284031215620003df57600080fd5b815160ff81168114620003f157600080fd5b9392505050565b60805160a05160c05160e051610100516101205161014051615803620004846000396000610b7001526000610ad2015260006107be0152600081816109a001526135b60152600081816109540152613e3201526000818161051d0152613690015260008181610c1801528181611df00152818161256b015281816125c80152613af601526158036000f3fe608060405234801561001057600080fd5b50600436106103d05760003560e01c80638ed02bab116101ff578063c3f909d41161011a578063eb5dcd6c116100ad578063f5a418461161007c578063f5a4184614610eb4578063f777ff0614610f35578063faa3e99614610f3c578063ffd242bd14610f8257600080fd5b8063eb5dcd6c14610de5578063ec4de4ba14610df8578063ed56b3e114610e2e578063f2fde38b14610ea157600080fd5b8063d09dc339116100e9578063d09dc33914610c3c578063d763264814610c44578063d85aa07c14610c57578063e80a3d4414610c5f57600080fd5b8063c3f909d414610bd6578063c5b964e014610beb578063c7c3a19a14610bf6578063ca30e60314610c1657600080fd5b8063aab9edd611610192578063b3596c2311610161578063b3596c23146107e2578063b6511a2a14610ba7578063b657bc9c14610bae578063ba87666814610bc157600080fd5b8063aab9edd614610b57578063abc76ae014610b66578063ac4dc59a14610b6e578063b121e14714610b9457600080fd5b8063a08714c0116101ce578063a08714c014610ad0578063a538b2eb14610af6578063a710b22114610b3c578063a87f45fe14610b4f57600080fd5b80638ed02bab14610a5c5780639089daa414610a7a57806393f6ebcf14610a8f5780639e0a99ed14610ac857600080fd5b806343cc055c116102ef5780636209e1e91161028257806379ba50971161025157806379ba5097146109ea57806379ea9943146109f25780638456cb5914610a365780638da5cb5b14610a3e57600080fd5b80636209e1e91461098b5780636709d0e51461099e578063671d36ed146109c45780636eec02a2146109d757600080fd5b80635425d8ac116102be5780635425d8ac146107bc57806357359584146107e2578063614486af146109525780636181d82d1461097857600080fd5b806343cc055c1461074957806344cb70b8146107705780634ca16c52146107935780635147cd591461079c57600080fd5b8063207b6516116103675780633b9cce59116103365780633b9cce59146106c05780633f4ba83a146106d3578063421d183b146106db57806343b46e5f1461074157600080fd5b8063207b651614610508578063226cf83c1461051b578063232c1cc5146105625780633408f73a1461056957600080fd5b8063187256e8116103a3578063187256e81461043b57806319d97a941461044e5780631e0104391461046e5780631efcf646146104d057600080fd5b8063050ee65d146103d557806306e3b632146103ed5780630b7d33e61461040d5780631865c57d14610422575b600080fd5b6201de845b6040519081526020015b60405180910390f35b6104006103fb36600461447a565b610f8a565b6040516103e491906144d7565b61042061041b366004614533565b6110a7565b005b61042a611108565b6040516103e495949392919061472b565b61042061044936600461486c565b611508565b61046161045c3660046148a9565b611579565b6040516103e49190614926565b6104b361047c3660046148a9565b60009081526004602052604090206001015470010000000000000000000000000000000090046bffffffffffffffffffffffff1690565b6040516bffffffffffffffffffffffff90911681526020016103e4565b6104f86104de3660046148a9565b600090815260046020526040902054610100900460ff1690565b60405190151581526020016103e4565b6104616105163660046148a9565b61161b565b7f00000000000000000000000000000000000000000000000000000000000000005b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016103e4565b60186103da565b6106b36040805161016081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e081018290526101008101829052610120810182905261014081019190915250604080516101608101825260165473ffffffffffffffffffffffffffffffffffffffff808216835263ffffffff740100000000000000000000000000000000000000008084048216602086015278010000000000000000000000000000000000000000000000008085048316968601969096527c010000000000000000000000000000000000000000000000000000000093849004821660608601526017548084166080870152818104831660a0870152868104831660c087015293909304811660e085015260185491821661010085015291810482166101208401529290920490911661014082015290565b6040516103e49190614939565b6104206106ce366004614a63565b611638565b61042061188e565b6106ee6106e9366004614ad8565b6118f4565b60408051951515865260ff90941660208601526bffffffffffffffffffffffff9283169385019390935216606083015273ffffffffffffffffffffffffffffffffffffffff16608082015260a0016103e4565b610420611a13565b6014547801000000000000000000000000000000000000000000000000900460ff166104f8565b6104f861077e3660046148a9565b60009081526008602052604090205460ff1690565b62017f986103da565b6107af6107aa3660046148a9565b611eaa565b6040516103e49190614b34565b7f000000000000000000000000000000000000000000000000000000000000000061053d565b6108d46107f0366004614ad8565b6040805160c081018252600080825260208201819052918101829052606081018290526080810182905260a08101919091525073ffffffffffffffffffffffffffffffffffffffff908116600090815260226020908152604091829020825160c081018452815463ffffffff81168252640100000000810462ffffff16938201939093526701000000000000008304909416928401929092527b01000000000000000000000000000000000000000000000000000000900460ff16606083015260018101546080830152600201546bffffffffffffffffffffffff1660a082015290565b6040516103e49190600060c08201905063ffffffff835116825262ffffff602084015116602083015273ffffffffffffffffffffffffffffffffffffffff604084015116604083015260ff6060840151166060830152608083015160808301526bffffffffffffffffffffffff60a08401511660a083015292915050565b7f000000000000000000000000000000000000000000000000000000000000000061053d565b6104b3610986366004614b47565b611eb5565b610461610999366004614ad8565b612010565b7f000000000000000000000000000000000000000000000000000000000000000061053d565b6104206109d2366004614ba7565b612043565b6103da6109e5366004614ad8565b6120c3565b61042061216d565b61053d610a003660046148a9565b6000908152600460205260409020546a0100000000000000000000900473ffffffffffffffffffffffffffffffffffffffff1690565b61042061226f565b60005473ffffffffffffffffffffffffffffffffffffffff1661053d565b60155473ffffffffffffffffffffffffffffffffffffffff1661053d565b610a826122e8565b6040516103e49190614be3565b61053d610a9d3660046148a9565b60009081526004602052604090206002015473ffffffffffffffffffffffffffffffffffffffff1690565b6103a46103da565b7f000000000000000000000000000000000000000000000000000000000000000061053d565b6104f8610b04366004614ad8565b73ffffffffffffffffffffffffffffffffffffffff908116600090815260226020526040902054670100000000000000900416151590565b610420610b4a366004614c4c565b6123fa565b610420612728565b604051600481526020016103e4565b6115e06103da565b7f000000000000000000000000000000000000000000000000000000000000000061053d565b610420610ba2366004614ad8565b61275a565b60326103da565b6104b3610bbc3660046148a9565b612852565b610bc9612979565b6040516103e49190614c7a565b610bde6129e8565b6040516103e49190614cd4565b60255460ff166107af565b610c09610c043660046148a9565b612bd0565b6040516103e49190614e5b565b7f000000000000000000000000000000000000000000000000000000000000000061053d565b6103da612fe0565b6104b3610c523660046148a9565b612fef565b601b546103da565b610dd86040805161012081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e081018290526101008101919091525060408051610120810182526014546bffffffffffffffffffffffff8116825263ffffffff6c01000000000000000000000000820416602083015262ffffff7001000000000000000000000000000000008204169282019290925261ffff730100000000000000000000000000000000000000830416606082015260ff750100000000000000000000000000000000000000000083048116608083015276010000000000000000000000000000000000000000000083048116151560a08301527701000000000000000000000000000000000000000000000083048116151560c08301527801000000000000000000000000000000000000000000000000909204909116151560e082015260155473ffffffffffffffffffffffffffffffffffffffff1661010082015290565b6040516103e49190614f92565b610420610df3366004614c4c565b612ffa565b6103da610e06366004614ad8565b73ffffffffffffffffffffffffffffffffffffffff1660009081526021602052604090205490565b610e88610e3c366004614ad8565b73ffffffffffffffffffffffffffffffffffffffff166000908152600c602090815260409182902082518084019093525460ff8082161515808552610100909204169290910182905291565b60408051921515835260ff9091166020830152016103e4565b610420610eaf366004614ad8565b613159565b610f0f610ec23660046148a9565b60408051808201909152600080825260208201525060009081526023602090815260409182902082518084019093525463ffffffff81168352640100000000900462ffffff169082015290565b60408051825163ffffffff16815260209283015162ffffff1692810192909252016103e4565b60406103da565b610f75610f4a366004614ad8565b73ffffffffffffffffffffffffffffffffffffffff166000908152601c602052604090205460ff1690565b6040516103e49190615062565b6103da61316d565b60606000610f986002613175565b9050808410610fd3576040517f1390f2a100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000610fdf84866150a5565b905081811180610fed575083155b610ff75780610ff9565b815b9050600061100786836150b8565b67ffffffffffffffff81111561101f5761101f6150cb565b604051908082528060200260200182016040528015611048578160200160208202803683370190505b50905060005b815181101561109b5761106c61106488836150a5565b60029061317f565b82828151811061107e5761107e6150fa565b60209081029190910101528061109381615129565b91505061104e565b50925050505b92915050565b6110af61318b565b6000838152601f602052604090206110c8828483615203565b50827f2fd8d70753a007014349d4591843cc031c2dd7a260d7dd82eca8253686ae776983836040516110fb92919061531e565b60405180910390a2505050565b6040805161014081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e081018290526101008101829052610120810191909152604080516101e08101825260008082526020820181905291810182905260608082018390526080820183905260a0820183905260c0820183905260e08201839052610100820183905261012082018390526101408201839052610160820183905261018082018390526101a08201526101c081019190915260408051610140810182526016547c0100000000000000000000000000000000000000000000000000000000900463ffffffff1681526000602082018190529181018290526014546bffffffffffffffffffffffff16606080830191909152918291608081016112416002613175565b81526017547401000000000000000000000000000000000000000080820463ffffffff908116602080860191909152780100000000000000000000000000000000000000000000000080850483166040808801919091526013546060808901919091526014546c01000000000000000000000000810486166080808b0191909152760100000000000000000000000000000000000000000000820460ff16151560a09a8b015283516101e0810185526000808252968101879052601654898104891695820195909552700100000000000000000000000000000000830462ffffff169381019390935273010000000000000000000000000000000000000090910461ffff169082015296870192909252808204831660c08701527c0100000000000000000000000000000000000000000000000000000000909404821660e086015260185492830482166101008601529290910416610120830152601954610140830152601a5461016083015273ffffffffffffffffffffffffffffffffffffffff166101808201529095506101a081016113dc60096131de565b815260175473ffffffffffffffffffffffffffffffffffffffff16602091820152601454600d80546040805182860281018601909152818152949850899489949293600e93750100000000000000000000000000000000000000000090910460ff1692859183018282801561148757602002820191906000526020600020905b815473ffffffffffffffffffffffffffffffffffffffff16815260019091019060200180831161145c575b50505050509250818054806020026020016040519081016040528092919081815260200182805480156114f057602002820191906000526020600020905b815473ffffffffffffffffffffffffffffffffffffffff1681526001909101906020018083116114c5575b50505050509150945094509450945094509091929394565b6115106131eb565b73ffffffffffffffffffffffffffffffffffffffff82166000908152601c6020526040902080548291907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600183600381111561157057611570614af5565b02179055505050565b6000818152601f6020526040902080546060919061159690615161565b80601f01602080910402602001604051908101604052809291908181526020018280546115c290615161565b801561160f5780601f106115e45761010080835404028352916020019161160f565b820191906000526020600020905b8154815290600101906020018083116115f257829003601f168201915b50505050509050919050565b6000818152601d6020526040902080546060919061159690615161565b6116406131eb565b600e54811461167b576040517fcf54c06a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b600e5481101561184d576000600e828154811061169d5761169d6150fa565b600091825260208083209091015473ffffffffffffffffffffffffffffffffffffffff9081168084526011909252604083205491935016908585858181106116e7576116e76150fa565b90506020020160208101906116fc9190614ad8565b905073ffffffffffffffffffffffffffffffffffffffff8116158061178f575073ffffffffffffffffffffffffffffffffffffffff82161580159061176d57508073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b801561178f575073ffffffffffffffffffffffffffffffffffffffff81811614155b156117c6576040517fb387a23800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff818116146118375773ffffffffffffffffffffffffffffffffffffffff838116600090815260116020526040902080547fffffffffffffffffffffffff0000000000000000000000000000000000000000169183169190911790555b505050808061184590615129565b91505061167e565b507fa46de38886467c59be07a0675f14781206a5477d871628af46c2443822fcb725600e83836040516118829392919061536b565b60405180910390a15050565b6118966131eb565b601480547fffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffffff1690556040513381527f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa906020015b60405180910390a1565b73ffffffffffffffffffffffffffffffffffffffff81166000908152600b602090815260408083208151608081018352905460ff80821615801584526101008304909116948301949094526bffffffffffffffffffffffff6201000082048116938301939093526e0100000000000000000000000000009004909116606082015282918291829182919082906119ba5760608201516014546000916119a6916bffffffffffffffffffffffff1661541d565b600e549091506119b69082615471565b9150505b8151602083015160408401516119d190849061549c565b6060949094015173ffffffffffffffffffffffffffffffffffffffff9a8b16600090815260116020526040902054929b919a9499509750921694509092505050565b611a1b61326c565b600060255460ff166001811115611a3457611a34614af5565b03611a6b576040517fe0262d7400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b601454600e546bffffffffffffffffffffffff909116906000611a8e600f613175565b90506000611a9c82846150a5565b905060008167ffffffffffffffff811115611ab957611ab96150cb565b604051908082528060200260200182016040528015611ae2578160200160208202803683370190505b50905060008267ffffffffffffffff811115611b0057611b006150cb565b604051908082528060200260200182016040528015611b29578160200160208202803683370190505b50905060005b85811015611c5b576000600e8281548110611b4c57611b4c6150fa565b600091825260208220015473ffffffffffffffffffffffffffffffffffffffff169150611b7a828a8a6132bd565b9050806bffffffffffffffffffffffff16858481518110611b9d57611b9d6150fa565b60209081029190910181019190915273ffffffffffffffffffffffffffffffffffffffff808416600090815260119092526040909120548551911690859085908110611beb57611beb6150fa565b73ffffffffffffffffffffffffffffffffffffffff92831660209182029290920181019190915292166000908152600b909252506040902080547fffffffffffffffffffffffffffffffffffff000000000000000000000000ffff16905580611c5381615129565b915050611b2f565b5060005b84811015611dd8576000611c74600f8361317f565b73ffffffffffffffffffffffffffffffffffffffff8082166000818152600b602090815260408083208151608081018352905460ff80821615158352610100820416828501526bffffffffffffffffffffffff6201000082048116838501526e0100000000000000000000000000009091041660608201529383526011909152902054929350911684611d078a866150a5565b81518110611d1757611d176150fa565b73ffffffffffffffffffffffffffffffffffffffff9092166020928302919091019091015260408101516bffffffffffffffffffffffff1685611d5a8a866150a5565b81518110611d6a57611d6a6150fa565b60209081029190910181019190915273ffffffffffffffffffffffffffffffffffffffff9092166000908152600b909252506040902080547fffffffffffffffffffffffffffffffffffff000000000000000000000000ffff16905580611dd081615129565b915050611c5f565b5073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000166000908152602160205260408120819055611e2b600f613175565b90505b8015611e6857611e55611e4d611e456001846150b8565b600f9061317f565b600f906134c5565b5080611e60816154c1565b915050611e2e565b507f5af23b715253628d12b660b27a4f3fc626562ea8a55040aa99ab3dc178989fad8183604051611e9a9291906154f6565b60405180910390a1505050505050565b60006110a1826134e7565b60408051610120810182526014546bffffffffffffffffffffffff8116825263ffffffff6c01000000000000000000000000820416602083015262ffffff7001000000000000000000000000000000008204169282019290925261ffff730100000000000000000000000000000000000000830416606082015260ff750100000000000000000000000000000000000000000083048116608083015276010000000000000000000000000000000000000000000083048116151560a08301527701000000000000000000000000000000000000000000000083048116151560c08301527801000000000000000000000000000000000000000000000000909204909116151560e082015260155473ffffffffffffffffffffffffffffffffffffffff16610100820152600090818080611fed84613592565b92509250925061200389858a8a8787878d613784565b9998505050505050505050565b73ffffffffffffffffffffffffffffffffffffffff81166000908152602080526040902080546060919061159690615161565b61204b61318b565b73ffffffffffffffffffffffffffffffffffffffff83166000908152602080526040902061207a828483615203565b508273ffffffffffffffffffffffffffffffffffffffff167f7c44b4eb59ee7873514e7e43e7718c269d872965938b288aa143befca62f99d283836040516110fb92919061531e565b73ffffffffffffffffffffffffffffffffffffffff81166000818152602160205260408082205490517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152919290916370a0823190602401602060405180830381865afa15801561213f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121639190615524565b6110a191906150b8565b60015473ffffffffffffffffffffffffffffffffffffffff1633146121f3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e65720000000000000000000060448201526064015b60405180910390fd5b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b6122776131eb565b601480547fffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffffff167601000000000000000000000000000000000000000000001790556040513381527f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258906020016118ea565b600e5460609060008167ffffffffffffffff811115612309576123096150cb565b60405190808252806020026020018201604052801561234e57816020015b60408051808201909152600080825260208201528152602001906001900390816123275790505b50905060005b828110156123f3576000600e8281548110612371576123716150fa565b600091825260208083209091015473ffffffffffffffffffffffffffffffffffffffff9081168084526011835260409384902054845180860190955281855290911691830182905285519093509091908590859081106123d3576123d36150fa565b6020026020010181905250505080806123eb90615129565b915050612354565b5092915050565b73ffffffffffffffffffffffffffffffffffffffff8116612447576040517f9c8d2cd200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600160255460ff16600181111561246057612460614af5565b03612497576040517f4a3578fb00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8281166000908152601160205260409020541633146124f7576040517fcebf515b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b601454600e5460009161251a9185916bffffffffffffffffffffffff16906132bd565b73ffffffffffffffffffffffffffffffffffffffff8085166000908152600b6020908152604080832080547fffffffffffffffffffffffffffffffffffff000000000000000000000000ffff1690557f000000000000000000000000000000000000000000000000000000000000000090931682526021905220549091506125b1906bffffffffffffffffffffffff8316906150b8565b73ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000081166000818152602160205260408082209490945592517fa9059cbb00000000000000000000000000000000000000000000000000000000815291851660048301526bffffffffffffffffffffffff841660248301529063a9059cbb906044016020604051808303816000875af1158015612666573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061268a919061553d565b9050806126c3576040517f90b8ec1800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60405133815273ffffffffffffffffffffffffffffffffffffffff808516916bffffffffffffffffffffffff8516918716907f9819093176a1851202c7bcfa46845809b4e47c261866550e94ed3775d2f406989060200160405180910390a450505050565b6127306131eb565b602580547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055565b73ffffffffffffffffffffffffffffffffffffffff8181166000908152601260205260409020541633146127ba576040517f6752e7aa00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff81811660008181526011602090815260408083208054337fffffffffffffffffffffffff000000000000000000000000000000000000000080831682179093556012909452828520805490921690915590519416939092849290917f78af32efdcad432315431e9b03d27e6cd98fb79c405fdc5af7c1714d9c0f75b39190a45050565b6000818152600460209081526040808320815161012081018352815460ff8082161515835261010080830490911615159583019590955263ffffffff620100008204811694830194909452660100000000000081048416606083015273ffffffffffffffffffffffffffffffffffffffff6a01000000000000000000009091048116608083015260018301546fffffffffffffffffffffffffffffffff811660a08401526bffffffffffffffffffffffff70010000000000000000000000000000000082041660c08401527c0100000000000000000000000000000000000000000000000000000000900490931660e08201526002909101549091169181019190915261297283612962816134e7565b8360400151846101000151611eb5565b9392505050565b606060248054806020026020016040519081016040528092919081815260200182805480156129de57602002820191906000526020600020905b815473ffffffffffffffffffffffffffffffffffffffff1681526001909101906020018083116129b3575b5050505050905090565b604080516102008101825260008082526020820181905291810182905260608082018390526080820183905260a0820183905260c0820183905260e08201839052610100820183905261012082018390526101408201839052610160820183905261018082018390526101a082018390526101c08201526101e0810191909152604080516102008101825260165463ffffffff74010000000000000000000000000000000000000000808304821684527801000000000000000000000000000000000000000000000000808404831660208601526017547c0100000000000000000000000000000000000000000000000000000000810484169686019690965273ffffffffffffffffffffffffffffffffffffffff938416606086015260145460ff828204161515608087015262ffffff70010000000000000000000000000000000082041660a0870152601854928304841660c087015290820490921660e085015293821661010084015261ffff7301000000000000000000000000000000000000009091041661012083015291909116610140820152601954610160820152601a54610180820152601b546101a08201526101c08101612baa60096131de565b815260155473ffffffffffffffffffffffffffffffffffffffff16602090910152919050565b604080516101408101825260008082526020820181905260609282018390528282018190526080820181905260a0820181905260c0820181905260e082018190526101008201526101208101919091526000828152600460209081526040808320815161012081018352815460ff8082161515835261010080830490911615159583019590955263ffffffff620100008204811694830194909452660100000000000081048416606083015273ffffffffffffffffffffffffffffffffffffffff6a010000000000000000000090910481166080830181905260018401546fffffffffffffffffffffffffffffffff811660a08501526bffffffffffffffffffffffff70010000000000000000000000000000000082041660c08501527c0100000000000000000000000000000000000000000000000000000000900490941660e08301526002909201549091169281019290925290919015612da557816080015173ffffffffffffffffffffffffffffffffffffffff1663f00e6a2a6040518163ffffffff1660e01b8152600401602060405180830381865afa158015612d7c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612da0919061555f565b612da8565b60005b90506040518061014001604052808273ffffffffffffffffffffffffffffffffffffffff168152602001836040015163ffffffff168152602001600760008781526020019081526020016000208054612e0090615161565b80601f0160208091040260200160405190810160405280929190818152602001828054612e2c90615161565b8015612e795780601f10612e4e57610100808354040283529160200191612e79565b820191906000526020600020905b815481529060010190602001808311612e5c57829003601f168201915b505050505081526020018360c001516bffffffffffffffffffffffff1681526020016005600087815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001836060015163ffffffff1667ffffffffffffffff1681526020018360e0015163ffffffff1681526020018360a001516bffffffffffffffffffffffff168152602001836000015115158152602001601e60008781526020019081526020016000208054612f5690615161565b80601f0160208091040260200160405190810160405280929190818152602001828054612f8290615161565b8015612fcf5780601f10612fa457610100808354040283529160200191612fcf565b820191906000526020600020905b815481529060010190602001808311612fb257829003601f168201915b505050505081525092505050919050565b6000612fea613af4565b905090565b60006110a182612852565b73ffffffffffffffffffffffffffffffffffffffff82811660009081526011602052604090205416331461305a576040517fcebf515b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b3373ffffffffffffffffffffffffffffffffffffffff8216036130a9576040517f8c8728c700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8281166000908152601260205260409020548116908216146131555773ffffffffffffffffffffffffffffffffffffffff82811660008181526012602052604080822080547fffffffffffffffffffffffff0000000000000000000000000000000000000000169486169485179055513392917f84f7c7c80bb8ed2279b4aab5f61cd05e6374073d38f46d7f32de8c30e9e3836791a45b5050565b6131616131eb565b61316a81613bbe565b50565b6000612fea60025b60006110a1825490565b60006129728383613cb3565b60175473ffffffffffffffffffffffffffffffffffffffff1633146131dc576040517f77c3599200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b565b6060600061297283613cdd565b60005473ffffffffffffffffffffffffffffffffffffffff1633146131dc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e65720000000000000000000060448201526064016121ea565b60185473ffffffffffffffffffffffffffffffffffffffff1633146131dc576040517fb6dfb7a600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff83166000908152600b602090815260408083208151608081018352905460ff80821615801584526101008304909116948301949094526bffffffffffffffffffffffff6201000082048116938301939093526e01000000000000000000000000000090049091166060820152906134b9576000816060015185613355919061541d565b905060006133638583615471565b90508083604001818151613377919061549c565b6bffffffffffffffffffffffff16905250613392858261557c565b836060018181516133a3919061549c565b6bffffffffffffffffffffffff90811690915273ffffffffffffffffffffffffffffffffffffffff89166000908152600b602090815260409182902087518154928901519389015160608a015186166e010000000000000000000000000000027fffffffffffff000000000000000000000000ffffffffffffffffffffffffffff919096166201000002167fffffffffffff000000000000000000000000000000000000000000000000ffff60ff95909516610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff921515929092167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000909416939093171792909216179190911790555050505b60400151949350505050565b60006129728373ffffffffffffffffffffffffffffffffffffffff8416613d38565b6000818160045b600f811015613574577fff00000000000000000000000000000000000000000000000000000000000000821683826020811061352c5761352c6150fa565b1a60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161461356257506000949350505050565b8061356c81615129565b9150506134ee565b5081600f1a600181111561358a5761358a614af5565b949350505050565b600080600080846040015162ffffff1690506000808263ffffffff161190506000807f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663feaf968c6040518163ffffffff1660e01b815260040160a060405180830381865afa15801561361f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061364391906155c3565b509450909250505060008113158061365a57508142105b8061367b575082801561367b575061367282426150b8565b8463ffffffff16105b1561368a57601954965061368e565b8096505b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663feaf968c6040518163ffffffff1660e01b815260040160a060405180830381865afa1580156136f9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061371d91906155c3565b509450909250505060008113158061373457508142105b806137555750828015613755575061374c82426150b8565b8463ffffffff16105b1561376457601a549550613768565b8095505b86866137738a613e2b565b965096509650505050509193909250565b600080808089600181111561379b5761379b614af5565b036137aa575062017f986137ff565b60018960018111156137be576137be614af5565b036137cd57506201de846137ff565b6040517ff2b2d41200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008a6080015160016138129190615613565b6138209060ff16604061562c565b60185461384e906103a49074010000000000000000000000000000000000000000900463ffffffff166150a5565b61385891906150a5565b601554604080517fde9ee35e0000000000000000000000000000000000000000000000000000000081528151939450600093849373ffffffffffffffffffffffffffffffffffffffff169263de9ee35e92600480820193918290030181865afa1580156138c9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906138ed9190615643565b909250905081836138ff8360186150a5565b613909919061562c565b60808f0151613919906001615613565b6139289060ff166115e061562c565b61393291906150a5565b61393c91906150a5565b61394690856150a5565b6101008e01516040517f125441400000000000000000000000000000000000000000000000000000000081526004810186905291955073ffffffffffffffffffffffffffffffffffffffff1690631254414090602401602060405180830381865afa1580156139b9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906139dd9190615524565b8d6060015161ffff166139f0919061562c565b94505050506000613a018b86613f15565b60008d815260046020526040902054909150610100900460ff1615613a665760008c81526023602090815260409182902082518084018452905463ffffffff811680835264010000000090910462ffffff908116928401928352928501525116908201525b6000613ad08c6040518061012001604052808d63ffffffff1681526020018681526020018781526020018c81526020018b81526020018a81526020018973ffffffffffffffffffffffffffffffffffffffff16815260200185815260200160001515815250614091565b60208101518151919250613ae39161549c565b9d9c50505050505050505050505050565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166000818152602160205260408082205490517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152919290916370a0823190602401602060405180830381865afa158015613b90573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613bb49190615524565b612fea9190615667565b3373ffffffffffffffffffffffffffffffffffffffff821603613c3d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c6600000000000000000060448201526064016121ea565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b6000826000018281548110613cca57613cca6150fa565b9060005260206000200154905092915050565b60608160000180548060200260200160405190810160405280929190818152602001828054801561160f57602002820191906000526020600020905b815481526020019060010190808311613d195750505050509050919050565b60008181526001830160205260408120548015613e21576000613d5c6001836150b8565b8554909150600090613d70906001906150b8565b9050818114613dd5576000866000018281548110613d9057613d906150fa565b9060005260206000200154905080876000018481548110613db357613db36150fa565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080613de657613de6615687565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506110a1565b60009150506110a1565b60008060007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663feaf968c6040518163ffffffff1660e01b815260040160a060405180830381865afa158015613e9b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613ebf91906155c3565b50935050925050600082131580613ed557508042105b80613f0557506000846040015162ffffff16118015613f055750613ef981426150b8565b846040015162ffffff16105b156123f3575050601b5492915050565b60408051608081018252600080825260208083018281528385018381526060850184905273ffffffffffffffffffffffffffffffffffffffff878116855260229093528584208054640100000000810462ffffff1690925263ffffffff82169092527b01000000000000000000000000000000000000000000000000000000810460ff16855285517ffeaf968c00000000000000000000000000000000000000000000000000000000815295519495919484936701000000000000009092049091169163feaf968c9160048083019260a09291908290030181865afa158015614002573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061402691906155c3565b5093505092505060008213158061403c57508042105b8061406c57506000866040015162ffffff1611801561406c575061406081426150b8565b866040015162ffffff16105b156140805760018301546060850152614088565b606084018290525b50505092915050565b6040805161010081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e081019190915260008260e001516000015160ff1690506000846060015161ffff1684606001516140fc919061562c565b9050836101000151801561410f5750803a105b1561411757503a5b60006012831161412857600161413e565b6141336012846150b8565b61413e90600a6157d6565b9050600060128410614151576001614167565b61415c8460126150b8565b61416790600a6157d6565b905060008660a0015187604001518860200151896000015161418991906150a5565b614193908761562c565b61419d91906150a5565b6141a7919061562c565b9050614203828860e00151606001516141c0919061562c565b6001848a60e00151606001516141d6919061562c565b6141e091906150b8565b6141ea868561562c565b6141f491906150a5565b6141fe91906157e2565b6143d8565b6bffffffffffffffffffffffff1686526080870151614226906141fe90836157e2565b6bffffffffffffffffffffffff1660408088019190915260e0880151015160009061425f9062ffffff16683635c9adc5dea0000061562c565b9050600081633b9aca008a60a001518b60e001516020015163ffffffff168c604001518d600001518b614292919061562c565b61429c91906150a5565b6142a6919061562c565b6142b0919061562c565b6142ba91906157e2565b6142c491906150a5565b9050614307848a60e00151606001516142dd919061562c565b6001868c60e00151606001516142f3919061562c565b6142fd91906150b8565b6141ea888561562c565b6bffffffffffffffffffffffff166020890152608089015161432d906141fe90836157e2565b6bffffffffffffffffffffffff16606089015260c089015173ffffffffffffffffffffffffffffffffffffffff166080808a0191909152890151614370906143d8565b6bffffffffffffffffffffffff1660a0808a0191909152890151614393906143d8565b6bffffffffffffffffffffffff1660c089015260e0890151606001516143b8906143d8565b6bffffffffffffffffffffffff1660e08901525050505050505092915050565b60006bffffffffffffffffffffffff821115614476576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203960448201527f362062697473000000000000000000000000000000000000000000000000000060648201526084016121ea565b5090565b6000806040838503121561448d57600080fd5b50508035926020909101359150565b600081518084526020808501945080840160005b838110156144cc578151875295820195908201906001016144b0565b509495945050505050565b602081526000612972602083018461449c565b60008083601f8401126144fc57600080fd5b50813567ffffffffffffffff81111561451457600080fd5b60208301915083602082850101111561452c57600080fd5b9250929050565b60008060006040848603121561454857600080fd5b83359250602084013567ffffffffffffffff81111561456657600080fd5b614572868287016144ea565b9497909650939450505050565b600081518084526020808501945080840160005b838110156144cc57815173ffffffffffffffffffffffffffffffffffffffff1687529582019590820190600101614593565b805163ffffffff16825260006101e060208301516145eb602086018263ffffffff169052565b506040830151614603604086018263ffffffff169052565b50606083015161461a606086018262ffffff169052565b506080830151614630608086018261ffff169052565b5060a083015161465060a08601826bffffffffffffffffffffffff169052565b5060c083015161466860c086018263ffffffff169052565b5060e083015161468060e086018263ffffffff169052565b506101008381015163ffffffff908116918601919091526101208085015190911690850152610140808401519085015261016080840151908501526101808084015173ffffffffffffffffffffffffffffffffffffffff16908501526101a0808401518186018390526146f58387018261457f565b925050506101c0808401516147218287018273ffffffffffffffffffffffffffffffffffffffff169052565b5090949350505050565b855163ffffffff16815260006101c0602088015161475960208501826bffffffffffffffffffffffff169052565b5060408801516040840152606088015161478360608501826bffffffffffffffffffffffff169052565b506080880151608084015260a08801516147a560a085018263ffffffff169052565b5060c08801516147bd60c085018263ffffffff169052565b5060e088015160e0840152610100808901516147e08286018263ffffffff169052565b5050610120888101511515908401526101408301819052614803818401886145c5565b9050828103610160840152614818818761457f565b905082810361018084015261482d818661457f565b9150506148406101a083018460ff169052565b9695505050505050565b73ffffffffffffffffffffffffffffffffffffffff8116811461316a57600080fd5b6000806040838503121561487f57600080fd5b823561488a8161484a565b915060208301356004811061489e57600080fd5b809150509250929050565b6000602082840312156148bb57600080fd5b5035919050565b6000815180845260005b818110156148e8576020818501810151868301820152016148cc565b5060006020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b60208152600061297260208301846148c2565b815173ffffffffffffffffffffffffffffffffffffffff1681526101608101602083015161496f602084018263ffffffff169052565b506040830151614987604084018263ffffffff169052565b50606083015161499f606084018263ffffffff169052565b5060808301516149c7608084018273ffffffffffffffffffffffffffffffffffffffff169052565b5060a08301516149df60a084018263ffffffff169052565b5060c08301516149f760c084018263ffffffff169052565b5060e0830151614a0f60e084018263ffffffff169052565b506101008381015173ffffffffffffffffffffffffffffffffffffffff81168483015250506101208381015163ffffffff81168483015250506101408381015163ffffffff8116848301525b505092915050565b60008060208385031215614a7657600080fd5b823567ffffffffffffffff80821115614a8e57600080fd5b818501915085601f830112614aa257600080fd5b813581811115614ab157600080fd5b8660208260051b8501011115614ac657600080fd5b60209290920196919550909350505050565b600060208284031215614aea57600080fd5b81356129728161484a565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b6002811061316a5761316a614af5565b60208101614b4183614b24565b91905290565b60008060008060808587031215614b5d57600080fd5b84359350602085013560028110614b7357600080fd5b9250604085013563ffffffff81168114614b8c57600080fd5b91506060850135614b9c8161484a565b939692955090935050565b600080600060408486031215614bbc57600080fd5b8335614bc78161484a565b9250602084013567ffffffffffffffff81111561456657600080fd5b602080825282518282018190526000919060409081850190868401855b82811015614c3f578151805173ffffffffffffffffffffffffffffffffffffffff90811686529087015116868501529284019290850190600101614c00565b5091979650505050505050565b60008060408385031215614c5f57600080fd5b8235614c6a8161484a565b9150602083013561489e8161484a565b6020808252825182820181905260009190848201906040850190845b81811015614cc857835173ffffffffffffffffffffffffffffffffffffffff1683529284019291840191600101614c96565b50909695505050505050565b60208152614ceb60208201835163ffffffff169052565b60006020830151614d04604084018263ffffffff169052565b50604083015163ffffffff8116606084015250606083015173ffffffffffffffffffffffffffffffffffffffff8116608084015250608083015180151560a08401525060a083015162ffffff811660c08401525060c083015163ffffffff811660e08401525060e0830151610100614d838185018363ffffffff169052565b8401519050610120614dac8482018373ffffffffffffffffffffffffffffffffffffffff169052565b8401519050610140614dc38482018361ffff169052565b8401519050610160614dec8482018373ffffffffffffffffffffffffffffffffffffffff169052565b840151610180848101919091528401516101a0808501919091528401516101c0808501919091528401516102006101e080860182905291925090614e3461022086018461457f565b9086015173ffffffffffffffffffffffffffffffffffffffff811683870152909250614721565b60208152614e8260208201835173ffffffffffffffffffffffffffffffffffffffff169052565b60006020830151614e9b604084018263ffffffff169052565b506040830151610140806060850152614eb86101608501836148c2565b91506060850151614ed960808601826bffffffffffffffffffffffff169052565b50608085015173ffffffffffffffffffffffffffffffffffffffff811660a08601525060a085015167ffffffffffffffff811660c08601525060c085015163ffffffff811660e08601525060e0850151610100614f45818701836bffffffffffffffffffffffff169052565b8601519050610120614f5a8682018315159052565b8601518584037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe00183870152905061484083826148c2565b6000610120820190506bffffffffffffffffffffffff835116825263ffffffff60208401511660208301526040830151614fd3604084018262ffffff169052565b506060830151614fe9606084018261ffff169052565b506080830151614ffe608084018260ff169052565b5060a083015161501260a084018215159052565b5060c083015161502660c084018215159052565b5060e083015161503a60e084018215159052565b506101008381015173ffffffffffffffffffffffffffffffffffffffff811684830152614a5b565b6020810160048310614b4157614b41614af5565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b808201808211156110a1576110a1615076565b818103818111156110a1576110a1615076565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361515a5761515a615076565b5060010190565b600181811c9082168061517557607f821691505b6020821081036151ae577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b601f8211156151fe57600081815260208120601f850160051c810160208610156151db5750805b601f850160051c820191505b818110156151fa578281556001016151e7565b5050505b505050565b67ffffffffffffffff83111561521b5761521b6150cb565b61522f836152298354615161565b836151b4565b6000601f841160018114615281576000851561524b5750838201355b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600387901b1c1916600186901b178355615317565b6000838152602090207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0861690835b828110156152d057868501358255602094850194600190920191016152b0565b508682101561530b577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60f88860031b161c19848701351681555b505060018560011b0183555b5050505050565b60208152816020820152818360408301376000818301604090810191909152601f9092017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0160101919050565b6000604082016040835280865480835260608501915087600052602092508260002060005b828110156153c257815473ffffffffffffffffffffffffffffffffffffffff1684529284019260019182019101615390565b505050838103828501528481528590820160005b868110156154115782356153e98161484a565b73ffffffffffffffffffffffffffffffffffffffff16825291830191908301906001016153d6565b50979650505050505050565b6bffffffffffffffffffffffff8281168282160390808211156123f3576123f3615076565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006bffffffffffffffffffffffff8084168061549057615490615442565b92169190910492915050565b6bffffffffffffffffffffffff8181168382160190808211156123f3576123f3615076565b6000816154d0576154d0615076565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190565b604081526000615509604083018561457f565b828103602084015261551b818561449c565b95945050505050565b60006020828403121561553657600080fd5b5051919050565b60006020828403121561554f57600080fd5b8151801515811461297257600080fd5b60006020828403121561557157600080fd5b81516129728161484a565b6bffffffffffffffffffffffff818116838216028082169190828114614a5b57614a5b615076565b805169ffffffffffffffffffff811681146155be57600080fd5b919050565b600080600080600060a086880312156155db57600080fd5b6155e4866155a4565b9450602086015193506040860151925060608601519150615607608087016155a4565b90509295509295909350565b60ff81811683821601908111156110a1576110a1615076565b80820281158282048414176110a1576110a1615076565b6000806040838503121561565657600080fd5b505080516020909101519092909150565b81810360008312801583831316838312821617156123f3576123f3615076565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b600181815b8085111561570f57817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048211156156f5576156f5615076565b8085161561570257918102915b93841c93908002906156bb565b509250929050565b600082615726575060016110a1565b81615733575060006110a1565b816001811461574957600281146157535761576f565b60019150506110a1565b60ff84111561576457615764615076565b50506001821b6110a1565b5060208310610133831016604e8410600b8410161715615792575081810a6110a1565b61579c83836156b6565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048211156157ce576157ce615076565b029392505050565b60006129728383615717565b6000826157f1576157f1615442565b50049056fea164736f6c6343000813000a", + Bin: "0x6101606040523480156200001257600080fd5b5060405162005c8738038062005c87833981016040819052620000359162000309565b87878787878787873380600081620000945760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000c757620000c78162000241565b5050506001600160a01b0380891660805287811660a05286811660c05285811660e052848116610100528316610120526025805483919060ff191660018381811115620001185762000118620003b6565b0217905550806001600160a01b0316610140816001600160a01b03168152505060c0516001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000179573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200019f9190620003cc565b60ff1660a0516001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015620001e3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620002099190620003cc565b60ff16146200022b576040516301f86e1760e41b815260040160405180910390fd5b50505050505050505050505050505050620003f8565b336001600160a01b038216036200029b5760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c6600000000000000000060448201526064016200008b565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b80516001600160a01b03811681146200030457600080fd5b919050565b600080600080600080600080610100898b0312156200032757600080fd5b6200033289620002ec565b97506200034260208a01620002ec565b96506200035260408a01620002ec565b95506200036260608a01620002ec565b94506200037260808a01620002ec565b93506200038260a08a01620002ec565b925060c0890151600281106200039757600080fd5b9150620003a760e08a01620002ec565b90509295985092959890939650565b634e487b7160e01b600052602160045260246000fd5b600060208284031215620003df57600080fd5b815160ff81168114620003f157600080fd5b9392505050565b60805160a05160c05160e051610100516101205161014051615803620004846000396000610b7001526000610ad2015260006107be0152600081816109a001526135b60152600081816109540152613e3201526000818161051d0152613690015260008181610c1801528181611df00152818161256b015281816125c80152613af601526158036000f3fe608060405234801561001057600080fd5b50600436106103d05760003560e01c80638ed02bab116101ff578063c3f909d41161011a578063eb5dcd6c116100ad578063f5a418461161007c578063f5a4184614610eb4578063f777ff0614610f35578063faa3e99614610f3c578063ffd242bd14610f8257600080fd5b8063eb5dcd6c14610de5578063ec4de4ba14610df8578063ed56b3e114610e2e578063f2fde38b14610ea157600080fd5b8063d09dc339116100e9578063d09dc33914610c3c578063d763264814610c44578063d85aa07c14610c57578063e80a3d4414610c5f57600080fd5b8063c3f909d414610bd6578063c5b964e014610beb578063c7c3a19a14610bf6578063ca30e60314610c1657600080fd5b8063aab9edd611610192578063b3596c2311610161578063b3596c23146107e2578063b6511a2a14610ba7578063b657bc9c14610bae578063ba87666814610bc157600080fd5b8063aab9edd614610b57578063abc76ae014610b66578063ac4dc59a14610b6e578063b121e14714610b9457600080fd5b8063a08714c0116101ce578063a08714c014610ad0578063a538b2eb14610af6578063a710b22114610b3c578063a87f45fe14610b4f57600080fd5b80638ed02bab14610a5c5780639089daa414610a7a57806393f6ebcf14610a8f5780639e0a99ed14610ac857600080fd5b806343cc055c116102ef5780636209e1e91161028257806379ba50971161025157806379ba5097146109ea57806379ea9943146109f25780638456cb5914610a365780638da5cb5b14610a3e57600080fd5b80636209e1e91461098b5780636709d0e51461099e578063671d36ed146109c45780636eec02a2146109d757600080fd5b80635425d8ac116102be5780635425d8ac146107bc57806357359584146107e2578063614486af146109525780636181d82d1461097857600080fd5b806343cc055c1461074957806344cb70b8146107705780634ca16c52146107935780635147cd591461079c57600080fd5b8063207b6516116103675780633b9cce59116103365780633b9cce59146106c05780633f4ba83a146106d3578063421d183b146106db57806343b46e5f1461074157600080fd5b8063207b651614610508578063226cf83c1461051b578063232c1cc5146105625780633408f73a1461056957600080fd5b8063187256e8116103a3578063187256e81461043b57806319d97a941461044e5780631e0104391461046e5780631efcf646146104d057600080fd5b8063050ee65d146103d557806306e3b632146103ed5780630b7d33e61461040d5780631865c57d14610422575b600080fd5b6201e26c5b6040519081526020015b60405180910390f35b6104006103fb36600461447a565b610f8a565b6040516103e491906144d7565b61042061041b366004614533565b6110a7565b005b61042a611108565b6040516103e495949392919061472b565b61042061044936600461486c565b611508565b61046161045c3660046148a9565b611579565b6040516103e49190614926565b6104b361047c3660046148a9565b60009081526004602052604090206001015470010000000000000000000000000000000090046bffffffffffffffffffffffff1690565b6040516bffffffffffffffffffffffff90911681526020016103e4565b6104f86104de3660046148a9565b600090815260046020526040902054610100900460ff1690565b60405190151581526020016103e4565b6104616105163660046148a9565b61161b565b7f00000000000000000000000000000000000000000000000000000000000000005b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016103e4565b60186103da565b6106b36040805161016081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e081018290526101008101829052610120810182905261014081019190915250604080516101608101825260165473ffffffffffffffffffffffffffffffffffffffff808216835263ffffffff740100000000000000000000000000000000000000008084048216602086015278010000000000000000000000000000000000000000000000008085048316968601969096527c010000000000000000000000000000000000000000000000000000000093849004821660608601526017548084166080870152818104831660a0870152868104831660c087015293909304811660e085015260185491821661010085015291810482166101208401529290920490911661014082015290565b6040516103e49190614939565b6104206106ce366004614a63565b611638565b61042061188e565b6106ee6106e9366004614ad8565b6118f4565b60408051951515865260ff90941660208601526bffffffffffffffffffffffff9283169385019390935216606083015273ffffffffffffffffffffffffffffffffffffffff16608082015260a0016103e4565b610420611a13565b6014547801000000000000000000000000000000000000000000000000900460ff166104f8565b6104f861077e3660046148a9565b60009081526008602052604090205460ff1690565b62017f986103da565b6107af6107aa3660046148a9565b611eaa565b6040516103e49190614b34565b7f000000000000000000000000000000000000000000000000000000000000000061053d565b6108d46107f0366004614ad8565b6040805160c081018252600080825260208201819052918101829052606081018290526080810182905260a08101919091525073ffffffffffffffffffffffffffffffffffffffff908116600090815260226020908152604091829020825160c081018452815463ffffffff81168252640100000000810462ffffff16938201939093526701000000000000008304909416928401929092527b01000000000000000000000000000000000000000000000000000000900460ff16606083015260018101546080830152600201546bffffffffffffffffffffffff1660a082015290565b6040516103e49190600060c08201905063ffffffff835116825262ffffff602084015116602083015273ffffffffffffffffffffffffffffffffffffffff604084015116604083015260ff6060840151166060830152608083015160808301526bffffffffffffffffffffffff60a08401511660a083015292915050565b7f000000000000000000000000000000000000000000000000000000000000000061053d565b6104b3610986366004614b47565b611eb5565b610461610999366004614ad8565b612010565b7f000000000000000000000000000000000000000000000000000000000000000061053d565b6104206109d2366004614ba7565b612043565b6103da6109e5366004614ad8565b6120c3565b61042061216d565b61053d610a003660046148a9565b6000908152600460205260409020546a0100000000000000000000900473ffffffffffffffffffffffffffffffffffffffff1690565b61042061226f565b60005473ffffffffffffffffffffffffffffffffffffffff1661053d565b60155473ffffffffffffffffffffffffffffffffffffffff1661053d565b610a826122e8565b6040516103e49190614be3565b61053d610a9d3660046148a9565b60009081526004602052604090206002015473ffffffffffffffffffffffffffffffffffffffff1690565b6103a46103da565b7f000000000000000000000000000000000000000000000000000000000000000061053d565b6104f8610b04366004614ad8565b73ffffffffffffffffffffffffffffffffffffffff908116600090815260226020526040902054670100000000000000900416151590565b610420610b4a366004614c4c565b6123fa565b610420612728565b604051600481526020016103e4565b6115e06103da565b7f000000000000000000000000000000000000000000000000000000000000000061053d565b610420610ba2366004614ad8565b61275a565b60326103da565b6104b3610bbc3660046148a9565b612852565b610bc9612979565b6040516103e49190614c7a565b610bde6129e8565b6040516103e49190614cd4565b60255460ff166107af565b610c09610c043660046148a9565b612bd0565b6040516103e49190614e5b565b7f000000000000000000000000000000000000000000000000000000000000000061053d565b6103da612fe0565b6104b3610c523660046148a9565b612fef565b601b546103da565b610dd86040805161012081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e081018290526101008101919091525060408051610120810182526014546bffffffffffffffffffffffff8116825263ffffffff6c01000000000000000000000000820416602083015262ffffff7001000000000000000000000000000000008204169282019290925261ffff730100000000000000000000000000000000000000830416606082015260ff750100000000000000000000000000000000000000000083048116608083015276010000000000000000000000000000000000000000000083048116151560a08301527701000000000000000000000000000000000000000000000083048116151560c08301527801000000000000000000000000000000000000000000000000909204909116151560e082015260155473ffffffffffffffffffffffffffffffffffffffff1661010082015290565b6040516103e49190614f92565b610420610df3366004614c4c565b612ffa565b6103da610e06366004614ad8565b73ffffffffffffffffffffffffffffffffffffffff1660009081526021602052604090205490565b610e88610e3c366004614ad8565b73ffffffffffffffffffffffffffffffffffffffff166000908152600c602090815260409182902082518084019093525460ff8082161515808552610100909204169290910182905291565b60408051921515835260ff9091166020830152016103e4565b610420610eaf366004614ad8565b613159565b610f0f610ec23660046148a9565b60408051808201909152600080825260208201525060009081526023602090815260409182902082518084019093525463ffffffff81168352640100000000900462ffffff169082015290565b60408051825163ffffffff16815260209283015162ffffff1692810192909252016103e4565b60406103da565b610f75610f4a366004614ad8565b73ffffffffffffffffffffffffffffffffffffffff166000908152601c602052604090205460ff1690565b6040516103e49190615062565b6103da61316d565b60606000610f986002613175565b9050808410610fd3576040517f1390f2a100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000610fdf84866150a5565b905081811180610fed575083155b610ff75780610ff9565b815b9050600061100786836150b8565b67ffffffffffffffff81111561101f5761101f6150cb565b604051908082528060200260200182016040528015611048578160200160208202803683370190505b50905060005b815181101561109b5761106c61106488836150a5565b60029061317f565b82828151811061107e5761107e6150fa565b60209081029190910101528061109381615129565b91505061104e565b50925050505b92915050565b6110af61318b565b6000838152601f602052604090206110c8828483615203565b50827f2fd8d70753a007014349d4591843cc031c2dd7a260d7dd82eca8253686ae776983836040516110fb92919061531e565b60405180910390a2505050565b6040805161014081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e081018290526101008101829052610120810191909152604080516101e08101825260008082526020820181905291810182905260608082018390526080820183905260a0820183905260c0820183905260e08201839052610100820183905261012082018390526101408201839052610160820183905261018082018390526101a08201526101c081019190915260408051610140810182526016547c0100000000000000000000000000000000000000000000000000000000900463ffffffff1681526000602082018190529181018290526014546bffffffffffffffffffffffff16606080830191909152918291608081016112416002613175565b81526017547401000000000000000000000000000000000000000080820463ffffffff908116602080860191909152780100000000000000000000000000000000000000000000000080850483166040808801919091526013546060808901919091526014546c01000000000000000000000000810486166080808b0191909152760100000000000000000000000000000000000000000000820460ff16151560a09a8b015283516101e0810185526000808252968101879052601654898104891695820195909552700100000000000000000000000000000000830462ffffff169381019390935273010000000000000000000000000000000000000090910461ffff169082015296870192909252808204831660c08701527c0100000000000000000000000000000000000000000000000000000000909404821660e086015260185492830482166101008601529290910416610120830152601954610140830152601a5461016083015273ffffffffffffffffffffffffffffffffffffffff166101808201529095506101a081016113dc60096131de565b815260175473ffffffffffffffffffffffffffffffffffffffff16602091820152601454600d80546040805182860281018601909152818152949850899489949293600e93750100000000000000000000000000000000000000000090910460ff1692859183018282801561148757602002820191906000526020600020905b815473ffffffffffffffffffffffffffffffffffffffff16815260019091019060200180831161145c575b50505050509250818054806020026020016040519081016040528092919081815260200182805480156114f057602002820191906000526020600020905b815473ffffffffffffffffffffffffffffffffffffffff1681526001909101906020018083116114c5575b50505050509150945094509450945094509091929394565b6115106131eb565b73ffffffffffffffffffffffffffffffffffffffff82166000908152601c6020526040902080548291907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600183600381111561157057611570614af5565b02179055505050565b6000818152601f6020526040902080546060919061159690615161565b80601f01602080910402602001604051908101604052809291908181526020018280546115c290615161565b801561160f5780601f106115e45761010080835404028352916020019161160f565b820191906000526020600020905b8154815290600101906020018083116115f257829003601f168201915b50505050509050919050565b6000818152601d6020526040902080546060919061159690615161565b6116406131eb565b600e54811461167b576040517fcf54c06a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b600e5481101561184d576000600e828154811061169d5761169d6150fa565b600091825260208083209091015473ffffffffffffffffffffffffffffffffffffffff9081168084526011909252604083205491935016908585858181106116e7576116e76150fa565b90506020020160208101906116fc9190614ad8565b905073ffffffffffffffffffffffffffffffffffffffff8116158061178f575073ffffffffffffffffffffffffffffffffffffffff82161580159061176d57508073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b801561178f575073ffffffffffffffffffffffffffffffffffffffff81811614155b156117c6576040517fb387a23800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff818116146118375773ffffffffffffffffffffffffffffffffffffffff838116600090815260116020526040902080547fffffffffffffffffffffffff0000000000000000000000000000000000000000169183169190911790555b505050808061184590615129565b91505061167e565b507fa46de38886467c59be07a0675f14781206a5477d871628af46c2443822fcb725600e83836040516118829392919061536b565b60405180910390a15050565b6118966131eb565b601480547fffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffffff1690556040513381527f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa906020015b60405180910390a1565b73ffffffffffffffffffffffffffffffffffffffff81166000908152600b602090815260408083208151608081018352905460ff80821615801584526101008304909116948301949094526bffffffffffffffffffffffff6201000082048116938301939093526e0100000000000000000000000000009004909116606082015282918291829182919082906119ba5760608201516014546000916119a6916bffffffffffffffffffffffff1661541d565b600e549091506119b69082615471565b9150505b8151602083015160408401516119d190849061549c565b6060949094015173ffffffffffffffffffffffffffffffffffffffff9a8b16600090815260116020526040902054929b919a9499509750921694509092505050565b611a1b61326c565b600060255460ff166001811115611a3457611a34614af5565b03611a6b576040517fe0262d7400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b601454600e546bffffffffffffffffffffffff909116906000611a8e600f613175565b90506000611a9c82846150a5565b905060008167ffffffffffffffff811115611ab957611ab96150cb565b604051908082528060200260200182016040528015611ae2578160200160208202803683370190505b50905060008267ffffffffffffffff811115611b0057611b006150cb565b604051908082528060200260200182016040528015611b29578160200160208202803683370190505b50905060005b85811015611c5b576000600e8281548110611b4c57611b4c6150fa565b600091825260208220015473ffffffffffffffffffffffffffffffffffffffff169150611b7a828a8a6132bd565b9050806bffffffffffffffffffffffff16858481518110611b9d57611b9d6150fa565b60209081029190910181019190915273ffffffffffffffffffffffffffffffffffffffff808416600090815260119092526040909120548551911690859085908110611beb57611beb6150fa565b73ffffffffffffffffffffffffffffffffffffffff92831660209182029290920181019190915292166000908152600b909252506040902080547fffffffffffffffffffffffffffffffffffff000000000000000000000000ffff16905580611c5381615129565b915050611b2f565b5060005b84811015611dd8576000611c74600f8361317f565b73ffffffffffffffffffffffffffffffffffffffff8082166000818152600b602090815260408083208151608081018352905460ff80821615158352610100820416828501526bffffffffffffffffffffffff6201000082048116838501526e0100000000000000000000000000009091041660608201529383526011909152902054929350911684611d078a866150a5565b81518110611d1757611d176150fa565b73ffffffffffffffffffffffffffffffffffffffff9092166020928302919091019091015260408101516bffffffffffffffffffffffff1685611d5a8a866150a5565b81518110611d6a57611d6a6150fa565b60209081029190910181019190915273ffffffffffffffffffffffffffffffffffffffff9092166000908152600b909252506040902080547fffffffffffffffffffffffffffffffffffff000000000000000000000000ffff16905580611dd081615129565b915050611c5f565b5073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000166000908152602160205260408120819055611e2b600f613175565b90505b8015611e6857611e55611e4d611e456001846150b8565b600f9061317f565b600f906134c5565b5080611e60816154c1565b915050611e2e565b507f5af23b715253628d12b660b27a4f3fc626562ea8a55040aa99ab3dc178989fad8183604051611e9a9291906154f6565b60405180910390a1505050505050565b60006110a1826134e7565b60408051610120810182526014546bffffffffffffffffffffffff8116825263ffffffff6c01000000000000000000000000820416602083015262ffffff7001000000000000000000000000000000008204169282019290925261ffff730100000000000000000000000000000000000000830416606082015260ff750100000000000000000000000000000000000000000083048116608083015276010000000000000000000000000000000000000000000083048116151560a08301527701000000000000000000000000000000000000000000000083048116151560c08301527801000000000000000000000000000000000000000000000000909204909116151560e082015260155473ffffffffffffffffffffffffffffffffffffffff16610100820152600090818080611fed84613592565b92509250925061200389858a8a8787878d613784565b9998505050505050505050565b73ffffffffffffffffffffffffffffffffffffffff81166000908152602080526040902080546060919061159690615161565b61204b61318b565b73ffffffffffffffffffffffffffffffffffffffff83166000908152602080526040902061207a828483615203565b508273ffffffffffffffffffffffffffffffffffffffff167f7c44b4eb59ee7873514e7e43e7718c269d872965938b288aa143befca62f99d283836040516110fb92919061531e565b73ffffffffffffffffffffffffffffffffffffffff81166000818152602160205260408082205490517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152919290916370a0823190602401602060405180830381865afa15801561213f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121639190615524565b6110a191906150b8565b60015473ffffffffffffffffffffffffffffffffffffffff1633146121f3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e65720000000000000000000060448201526064015b60405180910390fd5b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b6122776131eb565b601480547fffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffffff167601000000000000000000000000000000000000000000001790556040513381527f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258906020016118ea565b600e5460609060008167ffffffffffffffff811115612309576123096150cb565b60405190808252806020026020018201604052801561234e57816020015b60408051808201909152600080825260208201528152602001906001900390816123275790505b50905060005b828110156123f3576000600e8281548110612371576123716150fa565b600091825260208083209091015473ffffffffffffffffffffffffffffffffffffffff9081168084526011835260409384902054845180860190955281855290911691830182905285519093509091908590859081106123d3576123d36150fa565b6020026020010181905250505080806123eb90615129565b915050612354565b5092915050565b73ffffffffffffffffffffffffffffffffffffffff8116612447576040517f9c8d2cd200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600160255460ff16600181111561246057612460614af5565b03612497576040517f4a3578fb00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8281166000908152601160205260409020541633146124f7576040517fcebf515b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b601454600e5460009161251a9185916bffffffffffffffffffffffff16906132bd565b73ffffffffffffffffffffffffffffffffffffffff8085166000908152600b6020908152604080832080547fffffffffffffffffffffffffffffffffffff000000000000000000000000ffff1690557f000000000000000000000000000000000000000000000000000000000000000090931682526021905220549091506125b1906bffffffffffffffffffffffff8316906150b8565b73ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000081166000818152602160205260408082209490945592517fa9059cbb00000000000000000000000000000000000000000000000000000000815291851660048301526bffffffffffffffffffffffff841660248301529063a9059cbb906044016020604051808303816000875af1158015612666573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061268a919061553d565b9050806126c3576040517f90b8ec1800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60405133815273ffffffffffffffffffffffffffffffffffffffff808516916bffffffffffffffffffffffff8516918716907f9819093176a1851202c7bcfa46845809b4e47c261866550e94ed3775d2f406989060200160405180910390a450505050565b6127306131eb565b602580547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055565b73ffffffffffffffffffffffffffffffffffffffff8181166000908152601260205260409020541633146127ba576040517f6752e7aa00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff81811660008181526011602090815260408083208054337fffffffffffffffffffffffff000000000000000000000000000000000000000080831682179093556012909452828520805490921690915590519416939092849290917f78af32efdcad432315431e9b03d27e6cd98fb79c405fdc5af7c1714d9c0f75b39190a45050565b6000818152600460209081526040808320815161012081018352815460ff8082161515835261010080830490911615159583019590955263ffffffff620100008204811694830194909452660100000000000081048416606083015273ffffffffffffffffffffffffffffffffffffffff6a01000000000000000000009091048116608083015260018301546fffffffffffffffffffffffffffffffff811660a08401526bffffffffffffffffffffffff70010000000000000000000000000000000082041660c08401527c0100000000000000000000000000000000000000000000000000000000900490931660e08201526002909101549091169181019190915261297283612962816134e7565b8360400151846101000151611eb5565b9392505050565b606060248054806020026020016040519081016040528092919081815260200182805480156129de57602002820191906000526020600020905b815473ffffffffffffffffffffffffffffffffffffffff1681526001909101906020018083116129b3575b5050505050905090565b604080516102008101825260008082526020820181905291810182905260608082018390526080820183905260a0820183905260c0820183905260e08201839052610100820183905261012082018390526101408201839052610160820183905261018082018390526101a082018390526101c08201526101e0810191909152604080516102008101825260165463ffffffff74010000000000000000000000000000000000000000808304821684527801000000000000000000000000000000000000000000000000808404831660208601526017547c0100000000000000000000000000000000000000000000000000000000810484169686019690965273ffffffffffffffffffffffffffffffffffffffff938416606086015260145460ff828204161515608087015262ffffff70010000000000000000000000000000000082041660a0870152601854928304841660c087015290820490921660e085015293821661010084015261ffff7301000000000000000000000000000000000000009091041661012083015291909116610140820152601954610160820152601a54610180820152601b546101a08201526101c08101612baa60096131de565b815260155473ffffffffffffffffffffffffffffffffffffffff16602090910152919050565b604080516101408101825260008082526020820181905260609282018390528282018190526080820181905260a0820181905260c0820181905260e082018190526101008201526101208101919091526000828152600460209081526040808320815161012081018352815460ff8082161515835261010080830490911615159583019590955263ffffffff620100008204811694830194909452660100000000000081048416606083015273ffffffffffffffffffffffffffffffffffffffff6a010000000000000000000090910481166080830181905260018401546fffffffffffffffffffffffffffffffff811660a08501526bffffffffffffffffffffffff70010000000000000000000000000000000082041660c08501527c0100000000000000000000000000000000000000000000000000000000900490941660e08301526002909201549091169281019290925290919015612da557816080015173ffffffffffffffffffffffffffffffffffffffff1663f00e6a2a6040518163ffffffff1660e01b8152600401602060405180830381865afa158015612d7c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612da0919061555f565b612da8565b60005b90506040518061014001604052808273ffffffffffffffffffffffffffffffffffffffff168152602001836040015163ffffffff168152602001600760008781526020019081526020016000208054612e0090615161565b80601f0160208091040260200160405190810160405280929190818152602001828054612e2c90615161565b8015612e795780601f10612e4e57610100808354040283529160200191612e79565b820191906000526020600020905b815481529060010190602001808311612e5c57829003601f168201915b505050505081526020018360c001516bffffffffffffffffffffffff1681526020016005600087815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001836060015163ffffffff1667ffffffffffffffff1681526020018360e0015163ffffffff1681526020018360a001516bffffffffffffffffffffffff168152602001836000015115158152602001601e60008781526020019081526020016000208054612f5690615161565b80601f0160208091040260200160405190810160405280929190818152602001828054612f8290615161565b8015612fcf5780601f10612fa457610100808354040283529160200191612fcf565b820191906000526020600020905b815481529060010190602001808311612fb257829003601f168201915b505050505081525092505050919050565b6000612fea613af4565b905090565b60006110a182612852565b73ffffffffffffffffffffffffffffffffffffffff82811660009081526011602052604090205416331461305a576040517fcebf515b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b3373ffffffffffffffffffffffffffffffffffffffff8216036130a9576040517f8c8728c700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8281166000908152601260205260409020548116908216146131555773ffffffffffffffffffffffffffffffffffffffff82811660008181526012602052604080822080547fffffffffffffffffffffffff0000000000000000000000000000000000000000169486169485179055513392917f84f7c7c80bb8ed2279b4aab5f61cd05e6374073d38f46d7f32de8c30e9e3836791a45b5050565b6131616131eb565b61316a81613bbe565b50565b6000612fea60025b60006110a1825490565b60006129728383613cb3565b60175473ffffffffffffffffffffffffffffffffffffffff1633146131dc576040517f77c3599200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b565b6060600061297283613cdd565b60005473ffffffffffffffffffffffffffffffffffffffff1633146131dc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e65720000000000000000000060448201526064016121ea565b60185473ffffffffffffffffffffffffffffffffffffffff1633146131dc576040517fb6dfb7a600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff83166000908152600b602090815260408083208151608081018352905460ff80821615801584526101008304909116948301949094526bffffffffffffffffffffffff6201000082048116938301939093526e01000000000000000000000000000090049091166060820152906134b9576000816060015185613355919061541d565b905060006133638583615471565b90508083604001818151613377919061549c565b6bffffffffffffffffffffffff16905250613392858261557c565b836060018181516133a3919061549c565b6bffffffffffffffffffffffff90811690915273ffffffffffffffffffffffffffffffffffffffff89166000908152600b602090815260409182902087518154928901519389015160608a015186166e010000000000000000000000000000027fffffffffffff000000000000000000000000ffffffffffffffffffffffffffff919096166201000002167fffffffffffff000000000000000000000000000000000000000000000000ffff60ff95909516610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff921515929092167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000909416939093171792909216179190911790555050505b60400151949350505050565b60006129728373ffffffffffffffffffffffffffffffffffffffff8416613d38565b6000818160045b600f811015613574577fff00000000000000000000000000000000000000000000000000000000000000821683826020811061352c5761352c6150fa565b1a60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161461356257506000949350505050565b8061356c81615129565b9150506134ee565b5081600f1a600181111561358a5761358a614af5565b949350505050565b600080600080846040015162ffffff1690506000808263ffffffff161190506000807f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663feaf968c6040518163ffffffff1660e01b815260040160a060405180830381865afa15801561361f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061364391906155c3565b509450909250505060008113158061365a57508142105b8061367b575082801561367b575061367282426150b8565b8463ffffffff16105b1561368a57601954965061368e565b8096505b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663feaf968c6040518163ffffffff1660e01b815260040160a060405180830381865afa1580156136f9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061371d91906155c3565b509450909250505060008113158061373457508142105b806137555750828015613755575061374c82426150b8565b8463ffffffff16105b1561376457601a549550613768565b8095505b86866137738a613e2b565b965096509650505050509193909250565b600080808089600181111561379b5761379b614af5565b036137aa575062017f986137ff565b60018960018111156137be576137be614af5565b036137cd57506201e26c6137ff565b6040517ff2b2d41200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008a6080015160016138129190615613565b6138209060ff16604061562c565b60185461384e906103a49074010000000000000000000000000000000000000000900463ffffffff166150a5565b61385891906150a5565b601554604080517fde9ee35e0000000000000000000000000000000000000000000000000000000081528151939450600093849373ffffffffffffffffffffffffffffffffffffffff169263de9ee35e92600480820193918290030181865afa1580156138c9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906138ed9190615643565b909250905081836138ff8360186150a5565b613909919061562c565b60808f0151613919906001615613565b6139289060ff166115e061562c565b61393291906150a5565b61393c91906150a5565b61394690856150a5565b6101008e01516040517f125441400000000000000000000000000000000000000000000000000000000081526004810186905291955073ffffffffffffffffffffffffffffffffffffffff1690631254414090602401602060405180830381865afa1580156139b9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906139dd9190615524565b8d6060015161ffff166139f0919061562c565b94505050506000613a018b86613f15565b60008d815260046020526040902054909150610100900460ff1615613a665760008c81526023602090815260409182902082518084018452905463ffffffff811680835264010000000090910462ffffff908116928401928352928501525116908201525b6000613ad08c6040518061012001604052808d63ffffffff1681526020018681526020018781526020018c81526020018b81526020018a81526020018973ffffffffffffffffffffffffffffffffffffffff16815260200185815260200160001515815250614091565b60208101518151919250613ae39161549c565b9d9c50505050505050505050505050565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166000818152602160205260408082205490517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152919290916370a0823190602401602060405180830381865afa158015613b90573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613bb49190615524565b612fea9190615667565b3373ffffffffffffffffffffffffffffffffffffffff821603613c3d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c6600000000000000000060448201526064016121ea565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b6000826000018281548110613cca57613cca6150fa565b9060005260206000200154905092915050565b60608160000180548060200260200160405190810160405280929190818152602001828054801561160f57602002820191906000526020600020905b815481526020019060010190808311613d195750505050509050919050565b60008181526001830160205260408120548015613e21576000613d5c6001836150b8565b8554909150600090613d70906001906150b8565b9050818114613dd5576000866000018281548110613d9057613d906150fa565b9060005260206000200154905080876000018481548110613db357613db36150fa565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080613de657613de6615687565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506110a1565b60009150506110a1565b60008060007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663feaf968c6040518163ffffffff1660e01b815260040160a060405180830381865afa158015613e9b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613ebf91906155c3565b50935050925050600082131580613ed557508042105b80613f0557506000846040015162ffffff16118015613f055750613ef981426150b8565b846040015162ffffff16105b156123f3575050601b5492915050565b60408051608081018252600080825260208083018281528385018381526060850184905273ffffffffffffffffffffffffffffffffffffffff878116855260229093528584208054640100000000810462ffffff1690925263ffffffff82169092527b01000000000000000000000000000000000000000000000000000000810460ff16855285517ffeaf968c00000000000000000000000000000000000000000000000000000000815295519495919484936701000000000000009092049091169163feaf968c9160048083019260a09291908290030181865afa158015614002573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061402691906155c3565b5093505092505060008213158061403c57508042105b8061406c57506000866040015162ffffff1611801561406c575061406081426150b8565b866040015162ffffff16105b156140805760018301546060850152614088565b606084018290525b50505092915050565b6040805161010081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e081019190915260008260e001516000015160ff1690506000846060015161ffff1684606001516140fc919061562c565b9050836101000151801561410f5750803a105b1561411757503a5b60006012831161412857600161413e565b6141336012846150b8565b61413e90600a6157d6565b9050600060128410614151576001614167565b61415c8460126150b8565b61416790600a6157d6565b905060008660a0015187604001518860200151896000015161418991906150a5565b614193908761562c565b61419d91906150a5565b6141a7919061562c565b9050614203828860e00151606001516141c0919061562c565b6001848a60e00151606001516141d6919061562c565b6141e091906150b8565b6141ea868561562c565b6141f491906150a5565b6141fe91906157e2565b6143d8565b6bffffffffffffffffffffffff1686526080870151614226906141fe90836157e2565b6bffffffffffffffffffffffff1660408088019190915260e0880151015160009061425f9062ffffff16683635c9adc5dea0000061562c565b9050600081633b9aca008a60a001518b60e001516020015163ffffffff168c604001518d600001518b614292919061562c565b61429c91906150a5565b6142a6919061562c565b6142b0919061562c565b6142ba91906157e2565b6142c491906150a5565b9050614307848a60e00151606001516142dd919061562c565b6001868c60e00151606001516142f3919061562c565b6142fd91906150b8565b6141ea888561562c565b6bffffffffffffffffffffffff166020890152608089015161432d906141fe90836157e2565b6bffffffffffffffffffffffff16606089015260c089015173ffffffffffffffffffffffffffffffffffffffff166080808a0191909152890151614370906143d8565b6bffffffffffffffffffffffff1660a0808a0191909152890151614393906143d8565b6bffffffffffffffffffffffff1660c089015260e0890151606001516143b8906143d8565b6bffffffffffffffffffffffff1660e08901525050505050505092915050565b60006bffffffffffffffffffffffff821115614476576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203960448201527f362062697473000000000000000000000000000000000000000000000000000060648201526084016121ea565b5090565b6000806040838503121561448d57600080fd5b50508035926020909101359150565b600081518084526020808501945080840160005b838110156144cc578151875295820195908201906001016144b0565b509495945050505050565b602081526000612972602083018461449c565b60008083601f8401126144fc57600080fd5b50813567ffffffffffffffff81111561451457600080fd5b60208301915083602082850101111561452c57600080fd5b9250929050565b60008060006040848603121561454857600080fd5b83359250602084013567ffffffffffffffff81111561456657600080fd5b614572868287016144ea565b9497909650939450505050565b600081518084526020808501945080840160005b838110156144cc57815173ffffffffffffffffffffffffffffffffffffffff1687529582019590820190600101614593565b805163ffffffff16825260006101e060208301516145eb602086018263ffffffff169052565b506040830151614603604086018263ffffffff169052565b50606083015161461a606086018262ffffff169052565b506080830151614630608086018261ffff169052565b5060a083015161465060a08601826bffffffffffffffffffffffff169052565b5060c083015161466860c086018263ffffffff169052565b5060e083015161468060e086018263ffffffff169052565b506101008381015163ffffffff908116918601919091526101208085015190911690850152610140808401519085015261016080840151908501526101808084015173ffffffffffffffffffffffffffffffffffffffff16908501526101a0808401518186018390526146f58387018261457f565b925050506101c0808401516147218287018273ffffffffffffffffffffffffffffffffffffffff169052565b5090949350505050565b855163ffffffff16815260006101c0602088015161475960208501826bffffffffffffffffffffffff169052565b5060408801516040840152606088015161478360608501826bffffffffffffffffffffffff169052565b506080880151608084015260a08801516147a560a085018263ffffffff169052565b5060c08801516147bd60c085018263ffffffff169052565b5060e088015160e0840152610100808901516147e08286018263ffffffff169052565b5050610120888101511515908401526101408301819052614803818401886145c5565b9050828103610160840152614818818761457f565b905082810361018084015261482d818661457f565b9150506148406101a083018460ff169052565b9695505050505050565b73ffffffffffffffffffffffffffffffffffffffff8116811461316a57600080fd5b6000806040838503121561487f57600080fd5b823561488a8161484a565b915060208301356004811061489e57600080fd5b809150509250929050565b6000602082840312156148bb57600080fd5b5035919050565b6000815180845260005b818110156148e8576020818501810151868301820152016148cc565b5060006020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b60208152600061297260208301846148c2565b815173ffffffffffffffffffffffffffffffffffffffff1681526101608101602083015161496f602084018263ffffffff169052565b506040830151614987604084018263ffffffff169052565b50606083015161499f606084018263ffffffff169052565b5060808301516149c7608084018273ffffffffffffffffffffffffffffffffffffffff169052565b5060a08301516149df60a084018263ffffffff169052565b5060c08301516149f760c084018263ffffffff169052565b5060e0830151614a0f60e084018263ffffffff169052565b506101008381015173ffffffffffffffffffffffffffffffffffffffff81168483015250506101208381015163ffffffff81168483015250506101408381015163ffffffff8116848301525b505092915050565b60008060208385031215614a7657600080fd5b823567ffffffffffffffff80821115614a8e57600080fd5b818501915085601f830112614aa257600080fd5b813581811115614ab157600080fd5b8660208260051b8501011115614ac657600080fd5b60209290920196919550909350505050565b600060208284031215614aea57600080fd5b81356129728161484a565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b6002811061316a5761316a614af5565b60208101614b4183614b24565b91905290565b60008060008060808587031215614b5d57600080fd5b84359350602085013560028110614b7357600080fd5b9250604085013563ffffffff81168114614b8c57600080fd5b91506060850135614b9c8161484a565b939692955090935050565b600080600060408486031215614bbc57600080fd5b8335614bc78161484a565b9250602084013567ffffffffffffffff81111561456657600080fd5b602080825282518282018190526000919060409081850190868401855b82811015614c3f578151805173ffffffffffffffffffffffffffffffffffffffff90811686529087015116868501529284019290850190600101614c00565b5091979650505050505050565b60008060408385031215614c5f57600080fd5b8235614c6a8161484a565b9150602083013561489e8161484a565b6020808252825182820181905260009190848201906040850190845b81811015614cc857835173ffffffffffffffffffffffffffffffffffffffff1683529284019291840191600101614c96565b50909695505050505050565b60208152614ceb60208201835163ffffffff169052565b60006020830151614d04604084018263ffffffff169052565b50604083015163ffffffff8116606084015250606083015173ffffffffffffffffffffffffffffffffffffffff8116608084015250608083015180151560a08401525060a083015162ffffff811660c08401525060c083015163ffffffff811660e08401525060e0830151610100614d838185018363ffffffff169052565b8401519050610120614dac8482018373ffffffffffffffffffffffffffffffffffffffff169052565b8401519050610140614dc38482018361ffff169052565b8401519050610160614dec8482018373ffffffffffffffffffffffffffffffffffffffff169052565b840151610180848101919091528401516101a0808501919091528401516101c0808501919091528401516102006101e080860182905291925090614e3461022086018461457f565b9086015173ffffffffffffffffffffffffffffffffffffffff811683870152909250614721565b60208152614e8260208201835173ffffffffffffffffffffffffffffffffffffffff169052565b60006020830151614e9b604084018263ffffffff169052565b506040830151610140806060850152614eb86101608501836148c2565b91506060850151614ed960808601826bffffffffffffffffffffffff169052565b50608085015173ffffffffffffffffffffffffffffffffffffffff811660a08601525060a085015167ffffffffffffffff811660c08601525060c085015163ffffffff811660e08601525060e0850151610100614f45818701836bffffffffffffffffffffffff169052565b8601519050610120614f5a8682018315159052565b8601518584037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe00183870152905061484083826148c2565b6000610120820190506bffffffffffffffffffffffff835116825263ffffffff60208401511660208301526040830151614fd3604084018262ffffff169052565b506060830151614fe9606084018261ffff169052565b506080830151614ffe608084018260ff169052565b5060a083015161501260a084018215159052565b5060c083015161502660c084018215159052565b5060e083015161503a60e084018215159052565b506101008381015173ffffffffffffffffffffffffffffffffffffffff811684830152614a5b565b6020810160048310614b4157614b41614af5565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b808201808211156110a1576110a1615076565b818103818111156110a1576110a1615076565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361515a5761515a615076565b5060010190565b600181811c9082168061517557607f821691505b6020821081036151ae577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b601f8211156151fe57600081815260208120601f850160051c810160208610156151db5750805b601f850160051c820191505b818110156151fa578281556001016151e7565b5050505b505050565b67ffffffffffffffff83111561521b5761521b6150cb565b61522f836152298354615161565b836151b4565b6000601f841160018114615281576000851561524b5750838201355b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600387901b1c1916600186901b178355615317565b6000838152602090207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0861690835b828110156152d057868501358255602094850194600190920191016152b0565b508682101561530b577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60f88860031b161c19848701351681555b505060018560011b0183555b5050505050565b60208152816020820152818360408301376000818301604090810191909152601f9092017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0160101919050565b6000604082016040835280865480835260608501915087600052602092508260002060005b828110156153c257815473ffffffffffffffffffffffffffffffffffffffff1684529284019260019182019101615390565b505050838103828501528481528590820160005b868110156154115782356153e98161484a565b73ffffffffffffffffffffffffffffffffffffffff16825291830191908301906001016153d6565b50979650505050505050565b6bffffffffffffffffffffffff8281168282160390808211156123f3576123f3615076565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006bffffffffffffffffffffffff8084168061549057615490615442565b92169190910492915050565b6bffffffffffffffffffffffff8181168382160190808211156123f3576123f3615076565b6000816154d0576154d0615076565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190565b604081526000615509604083018561457f565b828103602084015261551b818561449c565b95945050505050565b60006020828403121561553657600080fd5b5051919050565b60006020828403121561554f57600080fd5b8151801515811461297257600080fd5b60006020828403121561557157600080fd5b81516129728161484a565b6bffffffffffffffffffffffff818116838216028082169190828114614a5b57614a5b615076565b805169ffffffffffffffffffff811681146155be57600080fd5b919050565b600080600080600060a086880312156155db57600080fd5b6155e4866155a4565b9450602086015193506040860151925060608601519150615607608087016155a4565b90509295509295909350565b60ff81811683821601908111156110a1576110a1615076565b80820281158282048414176110a1576110a1615076565b6000806040838503121561565657600080fd5b505080516020909101519092909150565b81810360008312801583831316838312821617156123f3576123f3615076565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b600181815b8085111561570f57817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048211156156f5576156f5615076565b8085161561570257918102915b93841c93908002906156bb565b509250929050565b600082615726575060016110a1565b81615733575060006110a1565b816001811461574957600281146157535761576f565b60019150506110a1565b60ff84111561576457615764615076565b50506001821b6110a1565b5060208310610133831016604e8410600b8410161715615792575081810a6110a1565b61579c83836156b6565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048211156157ce576157ce615076565b029392505050565b60006129728383615717565b6000826157f1576157f1615442565b50049056fea164736f6c6343000813000a", } var AutomationRegistryLogicCABI = AutomationRegistryLogicCMetaData.ABI diff --git a/core/gethwrappers/generated/automation_registry_wrapper_2_2/automation_registry_wrapper_2_2.go b/core/gethwrappers/generated/automation_registry_wrapper_2_2/automation_registry_wrapper_2_2.go index eb385cf7b03..a7fcf430b3f 100644 --- a/core/gethwrappers/generated/automation_registry_wrapper_2_2/automation_registry_wrapper_2_2.go +++ b/core/gethwrappers/generated/automation_registry_wrapper_2_2/automation_registry_wrapper_2_2.go @@ -52,7 +52,7 @@ type AutomationRegistryBase22OnchainConfig struct { var AutomationRegistryMetaData = &bind.MetaData{ ABI: "[{\"inputs\":[{\"internalType\":\"contractAutomationRegistryLogicB2_2\",\"name\":\"logicA\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"ArrayHasNoEntries\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"CannotCancel\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"CheckDataExceedsLimit\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ConfigDigestMismatch\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DuplicateEntry\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DuplicateSigners\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"GasLimitCanOnlyIncrease\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"GasLimitOutsideRange\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"IncorrectNumberOfFaultyOracles\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"IncorrectNumberOfSignatures\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"IncorrectNumberOfSigners\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"IndexOutOfRange\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidDataLength\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidPayee\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidRecipient\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidReport\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidSigner\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidTransmitter\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidTrigger\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidTriggerType\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"MaxCheckDataSizeCanOnlyIncrease\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"MaxPerformDataSizeCanOnlyIncrease\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"MigrationNotPermitted\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotAContract\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyActiveSigners\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyActiveTransmitters\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCallableByAdmin\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCallableByLINKToken\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCallableByOwnerOrAdmin\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCallableByOwnerOrRegistrar\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCallableByPayee\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCallableByProposedAdmin\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCallableByProposedPayee\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCallableByUpkeepPrivilegeManager\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyPausedUpkeep\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlySimulatedBackend\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyUnpausedUpkeep\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ParameterLengthError\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"PaymentGreaterThanAllLINK\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ReentrantCall\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RegistryPaused\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RepeatedSigner\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RepeatedTransmitter\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"reason\",\"type\":\"bytes\"}],\"name\":\"TargetCheckReverted\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TooManyOracles\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TranscoderNotSet\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UpkeepAlreadyExists\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UpkeepCancelled\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UpkeepNotCanceled\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UpkeepNotNeeded\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ValueNotChanged\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"admin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"privilegeConfig\",\"type\":\"bytes\"}],\"name\":\"AdminPrivilegeConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"trigger\",\"type\":\"bytes\"}],\"name\":\"CancelledUpkeepReport\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newModule\",\"type\":\"address\"}],\"name\":\"ChainSpecificModuleUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"previousConfigBlockNumber\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"configCount\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"signers\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"transmitters\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"f\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"onchainConfig\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"offchainConfigVersion\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"offchainConfig\",\"type\":\"bytes\"}],\"name\":\"ConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"dedupKey\",\"type\":\"bytes32\"}],\"name\":\"DedupKeyAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"}],\"name\":\"FundsAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"FundsWithdrawn\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"trigger\",\"type\":\"bytes\"}],\"name\":\"InsufficientFundsUpkeepReport\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"}],\"name\":\"OwnerFundsWithdrawn\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"Paused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"transmitters\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"payees\",\"type\":\"address[]\"}],\"name\":\"PayeesUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"transmitter\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"PayeeshipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"transmitter\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"PayeeshipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"transmitter\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"payee\",\"type\":\"address\"}],\"name\":\"PaymentWithdrawn\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"trigger\",\"type\":\"bytes\"}],\"name\":\"ReorgedUpkeepReport\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"trigger\",\"type\":\"bytes\"}],\"name\":\"StaleUpkeepReport\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"epoch\",\"type\":\"uint32\"}],\"name\":\"Transmitted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"Unpaused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"UpkeepAdminTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"UpkeepAdminTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"atBlockHeight\",\"type\":\"uint64\"}],\"name\":\"UpkeepCanceled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"newCheckData\",\"type\":\"bytes\"}],\"name\":\"UpkeepCheckDataSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"gasLimit\",\"type\":\"uint96\"}],\"name\":\"UpkeepGasLimitSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"remainingBalance\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"name\":\"UpkeepMigrated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"offchainConfig\",\"type\":\"bytes\"}],\"name\":\"UpkeepOffchainConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"UpkeepPaused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"bool\",\"name\":\"success\",\"type\":\"bool\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"totalPayment\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"gasUsed\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"gasOverhead\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"trigger\",\"type\":\"bytes\"}],\"name\":\"UpkeepPerformed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"privilegeConfig\",\"type\":\"bytes\"}],\"name\":\"UpkeepPrivilegeConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"startingBalance\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"importedFrom\",\"type\":\"address\"}],\"name\":\"UpkeepReceived\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"performGas\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"admin\",\"type\":\"address\"}],\"name\":\"UpkeepRegistered\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"triggerConfig\",\"type\":\"bytes\"}],\"name\":\"UpkeepTriggerConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"UpkeepUnpaused\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"fallbackTo\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestConfigDetails\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"configCount\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"blockNumber\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestConfigDigestAndEpoch\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"scanLogs\",\"type\":\"bool\"},{\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"internalType\":\"uint32\",\"name\":\"epoch\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"onTokenTransfer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"signers\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"transmitters\",\"type\":\"address[]\"},{\"internalType\":\"uint8\",\"name\":\"f\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"onchainConfigBytes\",\"type\":\"bytes\"},{\"internalType\":\"uint64\",\"name\":\"offchainConfigVersion\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"offchainConfig\",\"type\":\"bytes\"}],\"name\":\"setConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"signers\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"transmitters\",\"type\":\"address[]\"},{\"internalType\":\"uint8\",\"name\":\"f\",\"type\":\"uint8\"},{\"components\":[{\"internalType\":\"uint32\",\"name\":\"paymentPremiumPPB\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"flatFeeMicroLink\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"checkGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint24\",\"name\":\"stalenessSeconds\",\"type\":\"uint24\"},{\"internalType\":\"uint16\",\"name\":\"gasCeilingMultiplier\",\"type\":\"uint16\"},{\"internalType\":\"uint96\",\"name\":\"minUpkeepSpend\",\"type\":\"uint96\"},{\"internalType\":\"uint32\",\"name\":\"maxPerformGas\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"maxCheckDataSize\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"maxPerformDataSize\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"maxRevertDataSize\",\"type\":\"uint32\"},{\"internalType\":\"uint256\",\"name\":\"fallbackGasPrice\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"fallbackLinkPrice\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"transcoder\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"registrars\",\"type\":\"address[]\"},{\"internalType\":\"address\",\"name\":\"upkeepPrivilegeManager\",\"type\":\"address\"},{\"internalType\":\"contractIChainModule\",\"name\":\"chainModule\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"reorgProtectionEnabled\",\"type\":\"bool\"}],\"internalType\":\"structAutomationRegistryBase2_2.OnchainConfig\",\"name\":\"onchainConfig\",\"type\":\"tuple\"},{\"internalType\":\"uint64\",\"name\":\"offchainConfigVersion\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"offchainConfig\",\"type\":\"bytes\"}],\"name\":\"setConfigTypeSafe\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"performData\",\"type\":\"bytes\"}],\"name\":\"simulatePerformUpkeep\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"success\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"gasUsed\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32[3]\",\"name\":\"reportContext\",\"type\":\"bytes32[3]\"},{\"internalType\":\"bytes\",\"name\":\"rawReport\",\"type\":\"bytes\"},{\"internalType\":\"bytes32[]\",\"name\":\"rs\",\"type\":\"bytes32[]\"},{\"internalType\":\"bytes32[]\",\"name\":\"ss\",\"type\":\"bytes32[]\"},{\"internalType\":\"bytes32\",\"name\":\"rawVs\",\"type\":\"bytes32\"}],\"name\":\"transmit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", - Bin: "0x6101406040523480156200001257600080fd5b506040516200524a3803806200524a8339810160408190526200003591620003b1565b80816001600160a01b031663ca30e6036040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000075573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200009b9190620003b1565b826001600160a01b031663b10b673c6040518163ffffffff1660e01b8152600401602060405180830381865afa158015620000da573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001009190620003b1565b836001600160a01b0316636709d0e56040518163ffffffff1660e01b8152600401602060405180830381865afa1580156200013f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001659190620003b1565b846001600160a01b0316635425d8ac6040518163ffffffff1660e01b8152600401602060405180830381865afa158015620001a4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001ca9190620003b1565b856001600160a01b031663a08714c06040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000209573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200022f9190620003b1565b3380600081620002865760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620002b957620002b981620002ed565b5050506001600160a01b0394851660805292841660a05290831660c052821660e052811661010052166101205250620003d8565b336001600160a01b03821603620003475760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c6600000000000000000060448201526064016200027d565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b6001600160a01b0381168114620003ae57600080fd5b50565b600060208284031215620003c457600080fd5b8151620003d18162000398565b9392505050565b60805160a05160c05160e0516101005161012051614e25620004256000396000818160c9015261017c01526000611bb8015260005050600050506000505060006104c20152614e256000f3fe6080604052600436106100c75760003560e01c8063aed2e92911610074578063e3d0e7121161004e578063e3d0e71214610348578063f2fde38b14610368578063f75f6b1114610388576100c7565b8063aed2e929146102a3578063afcb95d7146102da578063b1dc65a414610328576100c7565b806381ff7048116100a557806381ff7048146101d65780638da5cb5b14610258578063a4c0ed3614610283576100c7565b8063181f5a771461010e578063349e8cca1461016d57806379ba5097146101c1575b7f00000000000000000000000000000000000000000000000000000000000000003660008037600080366000845af43d6000803e808015610107573d6000f35b3d6000fd5b005b34801561011a57600080fd5b506101576040518060400160405280601881526020017f4175746f6d6174696f6e526567697374727920322e322e30000000000000000081525081565b6040516101649190613b21565b60405180910390f35b34801561017957600080fd5b507f00000000000000000000000000000000000000000000000000000000000000005b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610164565b3480156101cd57600080fd5b5061010c6103a8565b3480156101e257600080fd5b5061023560155460115463ffffffff780100000000000000000000000000000000000000000000000083048116937c01000000000000000000000000000000000000000000000000000000009093041691565b6040805163ffffffff948516815293909216602084015290820152606001610164565b34801561026457600080fd5b5060005473ffffffffffffffffffffffffffffffffffffffff1661019c565b34801561028f57600080fd5b5061010c61029e366004613baf565b6104aa565b3480156102af57600080fd5b506102c36102be366004613c0b565b6106c6565b604080519215158352602083019190915201610164565b3480156102e657600080fd5b50601154601254604080516000815260208101939093527401000000000000000000000000000000000000000090910463ffffffff1690820152606001610164565b34801561033457600080fd5b5061010c610343366004613c9c565b61083c565b34801561035457600080fd5b5061010c610363366004613f6d565b610b77565b34801561037457600080fd5b5061010c61038336600461403a565b610ba0565b34801561039457600080fd5b5061010c6103a336600461423e565b610bb4565b60015473ffffffffffffffffffffffffffffffffffffffff16331461042e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e65720000000000000000000060448201526064015b60405180910390fd5b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b3373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614610519576040517fc8bad78d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60208114610553576040517fdfe9309000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000610561828401846142cd565b60008181526004602052604090205490915065010000000000900463ffffffff908116146105bb576040517f9c0083a200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000818152600460205260409020600101546105f69085906c0100000000000000000000000090046bffffffffffffffffffffffff16614315565b600082815260046020526040902060010180546bffffffffffffffffffffffff929092166c01000000000000000000000000027fffffffffffffffff000000000000000000000000ffffffffffffffffffffffff90921691909117905560195461066190859061433a565b6019556040516bffffffffffffffffffffffff8516815273ffffffffffffffffffffffffffffffffffffffff86169082907fafd24114486da8ebfc32f3626dada8863652e187461aa74d4bfa7348915062039060200160405180910390a35050505050565b6000806106d1611ba0565b6012547e01000000000000000000000000000000000000000000000000000000000000900460ff1615610730576040517f24522f3400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600085815260046020908152604091829020825160e081018452815460ff811615158252610100810463ffffffff908116838601819052650100000000008304821684880152690100000000000000000090920473ffffffffffffffffffffffffffffffffffffffff16606084018190526001909401546bffffffffffffffffffffffff80821660808601526c0100000000000000000000000082041660a0850152780100000000000000000000000000000000000000000000000090041660c08301528451601f8901859004850281018501909552878552909361082f938990899081908401838280828437600092019190915250611c1192505050565b9097909650945050505050565b60005a60408051610160810182526012546bffffffffffffffffffffffff8116825263ffffffff6c010000000000000000000000008204811660208401527001000000000000000000000000000000008204811693830193909352740100000000000000000000000000000000000000008104909216606082015262ffffff7801000000000000000000000000000000000000000000000000830416608082015261ffff7b0100000000000000000000000000000000000000000000000000000083041660a082015260ff7d0100000000000000000000000000000000000000000000000000000000008304811660c08301527e010000000000000000000000000000000000000000000000000000000000008304811615801560e08401527f01000000000000000000000000000000000000000000000000000000000000009093048116151561010080840191909152601354918216151561012084015273ffffffffffffffffffffffffffffffffffffffff9104166101408201529192506109f2576040517f24522f3400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b336000908152600b602052604090205460ff16610a3b576040517f1099ed7500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6011548a3514610a77576040517fdfdcf8e700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60c0810151610a8790600161437c565b60ff1686141580610a985750858414155b15610acf576040517f0244f71a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610adf8a8a8a8a8a8a8a8a611e3a565b6000610aeb8a8a6120a3565b905060208b0135600881901c63ffffffff16610b0884848761215e565b836060015163ffffffff168163ffffffff161115610b6857601280547fffffffffffffffff00000000ffffffffffffffffffffffffffffffffffffffff167401000000000000000000000000000000000000000063ffffffff8416021790555b50505050505050505050505050565b610b9886868686806020019051810190610b91919061443b565b8686610bb4565b505050505050565b610ba8612add565b610bb181612b5e565b50565b610bbc612add565b601f86511115610bf8576040517f25d0209c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8360ff16600003610c35576040517fe77dba5600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b84518651141580610c545750610c4c8460036145bd565b60ff16865111155b15610c8b576040517f1d2d1c5800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b601254600e546bffffffffffffffffffffffff9091169060005b816bffffffffffffffffffffffff16811015610d0d57610cfa600e8281548110610cd157610cd161434d565b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff168484612c53565b5080610d05816145d9565b915050610ca5565b5060008060005b836bffffffffffffffffffffffff16811015610e1657600d8181548110610d3d57610d3d61434d565b600091825260209091200154600e805473ffffffffffffffffffffffffffffffffffffffff90921694509082908110610d7857610d7861434d565b600091825260208083209091015473ffffffffffffffffffffffffffffffffffffffff8681168452600c8352604080852080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00001690559116808452600b90925290912080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055915080610e0e816145d9565b915050610d14565b50610e23600d6000613a00565b610e2f600e6000613a00565b604080516080810182526000808252602082018190529181018290526060810182905290805b8c5181101561129857600c60008e8381518110610e7457610e7461434d565b60209081029190910181015173ffffffffffffffffffffffffffffffffffffffff1682528101919091526040016000205460ff1615610edf576040517f77cea0fa00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168d8281518110610f0957610f0961434d565b602002602001015173ffffffffffffffffffffffffffffffffffffffff1603610f5e576040517f815e1d6400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60405180604001604052806001151581526020018260ff16815250600c60008f8481518110610f8f57610f8f61434d565b60209081029190910181015173ffffffffffffffffffffffffffffffffffffffff1682528181019290925260400160002082518154939092015160ff16610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff921515929092167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000909316929092171790558b518c90829081106110375761103761434d565b60200260200101519150600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036110a7576040517f58a70a0a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff82166000908152600b60209081526040918290208251608081018452905460ff80821615801584526101008304909116938301939093526bffffffffffffffffffffffff6201000082048116948301949094526e01000000000000000000000000000090049092166060830152909350611162576040517f6a7281ad00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001835260ff80821660208086019182526bffffffffffffffffffffffff808b166060880190815273ffffffffffffffffffffffffffffffffffffffff87166000908152600b909352604092839020885181549551948a0151925184166e010000000000000000000000000000027fffffffffffff000000000000000000000000ffffffffffffffffffffffffffff939094166201000002929092167fffffffffffff000000000000000000000000000000000000000000000000ffff94909616610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff921515929092167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00009095169490941717919091169290921791909117905580611290816145d9565b915050610e55565b50508a516112ae9150600d9060208d0190613a1e565b5088516112c290600e9060208c0190613a1e565b50604051806101600160405280856bffffffffffffffffffffffff168152602001886000015163ffffffff168152602001886020015163ffffffff168152602001600063ffffffff168152602001886060015162ffffff168152602001886080015161ffff1681526020018960ff1681526020016012600001601e9054906101000a900460ff16151581526020016012600001601f9054906101000a900460ff161515815260200188610200015115158152602001886101e0015173ffffffffffffffffffffffffffffffffffffffff16815250601260008201518160000160006101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff160217905550602082015181600001600c6101000a81548163ffffffff021916908363ffffffff16021790555060408201518160000160106101000a81548163ffffffff021916908363ffffffff16021790555060608201518160000160146101000a81548163ffffffff021916908363ffffffff16021790555060808201518160000160186101000a81548162ffffff021916908362ffffff16021790555060a082015181600001601b6101000a81548161ffff021916908361ffff16021790555060c082015181600001601d6101000a81548160ff021916908360ff16021790555060e082015181600001601e6101000a81548160ff02191690831515021790555061010082015181600001601f6101000a81548160ff0219169083151502179055506101208201518160010160006101000a81548160ff0219169083151502179055506101408201518160010160016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055509050506040518061018001604052808860a001516bffffffffffffffffffffffff16815260200188610180015173ffffffffffffffffffffffffffffffffffffffff168152602001601460010160009054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff168152602001886040015163ffffffff1681526020018860c0015163ffffffff168152602001601460010160149054906101000a900463ffffffff1663ffffffff168152602001601460010160189054906101000a900463ffffffff1663ffffffff1681526020016014600101601c9054906101000a900463ffffffff1663ffffffff1681526020018860e0015163ffffffff16815260200188610100015163ffffffff16815260200188610120015163ffffffff168152602001886101c0015173ffffffffffffffffffffffffffffffffffffffff16815250601460008201518160000160006101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff160217905550602082015181600001600c6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060408201518160010160006101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff160217905550606082015181600101600c6101000a81548163ffffffff021916908363ffffffff16021790555060808201518160010160106101000a81548163ffffffff021916908363ffffffff16021790555060a08201518160010160146101000a81548163ffffffff021916908363ffffffff16021790555060c08201518160010160186101000a81548163ffffffff021916908363ffffffff16021790555060e082015181600101601c6101000a81548163ffffffff021916908363ffffffff1602179055506101008201518160020160006101000a81548163ffffffff021916908363ffffffff1602179055506101208201518160020160046101000a81548163ffffffff021916908363ffffffff1602179055506101408201518160020160086101000a81548163ffffffff021916908363ffffffff16021790555061016082015181600201600c6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555090505086610140015160178190555086610160015160188190555060006014600101601c9054906101000a900463ffffffff169050876101e0015173ffffffffffffffffffffffffffffffffffffffff166357e871e76040518163ffffffff1660e01b8152600401602060405180830381865afa158015611963573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119879190614611565b601580547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167c010000000000000000000000000000000000000000000000000000000063ffffffff9384160217808255600192601891611a02918591780100000000000000000000000000000000000000000000000090041661462a565b92506101000a81548163ffffffff021916908363ffffffff160217905550600088604051602001611a339190614698565b604080518083037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0018152919052601554909150611a9c90469030907801000000000000000000000000000000000000000000000000900463ffffffff168f8f8f878f8f612e5b565b60115560005b611aac6009612f05565b811015611adc57611ac9611ac1600983612f0f565b600990612f22565b5080611ad4816145d9565b915050611aa2565b5060005b896101a0015151811015611b3357611b208a6101a001518281518110611b0857611b0861434d565b60200260200101516009612f4490919063ffffffff16565b5080611b2b816145d9565b915050611ae0565b507f1591690b8638f5fb2dbec82ac741805ac5da8b45dc5263f4875b0496fdce4e0582601154601460010160189054906101000a900463ffffffff168f8f8f878f8f604051611b8a9998979695949392919061483c565b60405180910390a1505050505050505050505050565b3273ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614611c0f576040517fb60ac5db00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b565b60125460009081907f0100000000000000000000000000000000000000000000000000000000000000900460ff1615611c76576040517f37ed32e800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b601280547effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f01000000000000000000000000000000000000000000000000000000000000001790556040517f4585e33b0000000000000000000000000000000000000000000000000000000090611cf2908590602401613b21565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff000000000000000000000000000000000000000000000000000000009094169390931790925290517f79188d1600000000000000000000000000000000000000000000000000000000815290935073ffffffffffffffffffffffffffffffffffffffff8616906379188d1690611dc590879087906004016148d2565b60408051808303816000875af1158015611de3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e0791906148eb565b601280547effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff16905590969095509350505050565b60008787604051611e4c929190614919565b604051908190038120611e63918b90602001614929565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815282825280516020918201208383019092526000808452908301819052909250906000805b8881101561203a57600185878360208110611ecf57611ecf61434d565b611edc91901a601b61437c565b8c8c85818110611eee57611eee61434d565b905060200201358b8b86818110611f0757611f0761434d565b9050602002013560405160008152602001604052604051611f44949392919093845260ff9290921660208401526040830152606082015260800190565b6020604051602081039080840390855afa158015611f66573d6000803e3d6000fd5b5050604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081015173ffffffffffffffffffffffffffffffffffffffff81166000908152600c602090815290849020838501909452925460ff8082161515808552610100909204169383019390935290955093509050612014576040517f0f4c073700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b826020015160080260ff166001901b840193508080612032906145d9565b915050611eb2565b50827e01010101010101010101010101010101010101010101010101010101010101841614612095576040517fc103be2e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b505050505050505050505050565b6120dc6040518060c001604052806000815260200160008152602001606081526020016060815260200160608152602001606081525090565b60006120ea83850185614a1a565b604081015151606082015151919250908114158061210d57508082608001515114155b8061211d5750808260a001515114155b15612154576040517fb55ac75400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5090505b92915050565b600082604001515167ffffffffffffffff81111561217e5761217e613d53565b60405190808252806020026020018201604052801561223a57816020015b604080516101c081018252600060e08201818152610100830182905261012083018290526101408301829052610160830182905261018083018290526101a0830182905282526020808301829052928201819052606082018190526080820181905260a0820181905260c082015282527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90920191018161219c5790505b50905060006040518060800160405280600061ffff1681526020016000815260200160006bffffffffffffffffffffffff16815260200160006bffffffffffffffffffffffff168152509050600085610140015173ffffffffffffffffffffffffffffffffffffffff166357e871e76040518163ffffffff1660e01b8152600401602060405180830381865afa1580156122d8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122fc9190614611565b9050600086610140015173ffffffffffffffffffffffffffffffffffffffff166318b8f6136040518163ffffffff1660e01b8152600401602060405180830381865afa158015612350573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123749190614611565b905060005b8660400151518110156127c35760046000886040015183815181106123a0576123a061434d565b6020908102919091018101518252818101929092526040908101600020815160e081018352815460ff811615158252610100810463ffffffff90811695830195909552650100000000008104851693820193909352690100000000000000000090920473ffffffffffffffffffffffffffffffffffffffff166060830152600101546bffffffffffffffffffffffff80821660808401526c0100000000000000000000000082041660a08301527801000000000000000000000000000000000000000000000000900490911660c082015285518690839081106124855761248561434d565b6020026020010151600001819052506124ba876040015182815181106124ad576124ad61434d565b6020026020010151612f66565b8582815181106124cc576124cc61434d565b60200260200101516060019060018111156124e9576124e9614b07565b908160018111156124fc576124fc614b07565b81525050612560876040015182815181106125195761251961434d565b602002602001015184896080015184815181106125385761253861434d565b60200260200101518885815181106125525761255261434d565b60200260200101518c613011565b8683815181106125725761257261434d565b602002602001015160200187848151811061258f5761258f61434d565b602002602001015160c00182815250821515151581525050508481815181106125ba576125ba61434d565b602002602001015160200151156125ea576001846000018181516125de9190614b36565b61ffff169052506125ef565b6127b1565b6126558582815181106126045761260461434d565b602002602001015160000151606001518860600151838151811061262a5761262a61434d565b60200260200101518960a0015184815181106126485761264861434d565b6020026020010151611c11565b8683815181106126675761266761434d565b60200260200101516040018784815181106126845761268461434d565b602090810291909101015160800191909152901515905260c08801516126ab90600161437c565b6126b99060ff166040614b51565b6103a48860a0015183815181106126d2576126d261434d565b6020026020010151516126e5919061433a565b6126ef919061433a565b8582815181106127015761270161434d565b602002602001015160a00181815250508481815181106127235761272361434d565b602002602001015160a0015184602001818151612740919061433a565b90525084518590829081106127575761275761434d565b6020026020010151608001518661276e9190614b68565b95506127b1876040015182815181106127895761278961434d565b6020026020010151848784815181106127a4576127a461434d565b6020026020010151613130565b806127bb816145d9565b915050612379565b50825161ffff166000036127da5750505050505050565b6155f06127e8366010614b51565b5a6127f39088614b68565b6127fd919061433a565b612807919061433a565b8351909550611b589061281e9061ffff1687614baa565b612828919061433a565b945060008060005b886040015151811015612a0c5786818151811061284f5761284f61434d565b602002602001015160200151156129fa576128e88a8a60400151838151811061287a5761287a61434d565b60200260200101518984815181106128945761289461434d565b6020026020010151608001518c600001518d602001518d8c602001518e89815181106128c2576128c261434d565b602002602001015160a001518c6128d99190614b51565b6128e39190614baa565b613235565b6060880180519295509093508391612901908390614315565b6bffffffffffffffffffffffff16905250604086018051849190612926908390614315565b6bffffffffffffffffffffffff16905250865187908290811061294b5761294b61434d565b60200260200101516040015115158960400151828151811061296f5761296f61434d565b60200260200101517fad8cc9579b21dfe2c2f6ea35ba15b656e46b4f5b0cb424f52739b8ce5cac9c5b84866129a49190614315565b8a85815181106129b6576129b661434d565b6020026020010151608001518c8e6080015187815181106129d9576129d961434d565b60200260200101516040516129f19493929190614bbe565b60405180910390a35b80612a04816145d9565b915050612830565b505050604083810151336000908152600b602052919091208054600290612a489084906201000090046bffffffffffffffffffffffff16614315565b92506101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055508260600151601260000160008282829054906101000a90046bffffffffffffffffffffffff16612aa69190614315565b92506101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff16021790555050505050505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314611c0f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e6572000000000000000000006044820152606401610425565b3373ffffffffffffffffffffffffffffffffffffffff821603612bdd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c660000000000000000006044820152606401610425565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b73ffffffffffffffffffffffffffffffffffffffff83166000908152600b602090815260408083208151608081018352905460ff80821615801584526101008304909116948301949094526bffffffffffffffffffffffff6201000082048116938301939093526e0100000000000000000000000000009004909116606082015290612e4f576000816060015185612ceb9190614bfb565b90506000612cf98583614c20565b90508083604001818151612d0d9190614315565b6bffffffffffffffffffffffff16905250612d288582614c4b565b83606001818151612d399190614315565b6bffffffffffffffffffffffff90811690915273ffffffffffffffffffffffffffffffffffffffff89166000908152600b602090815260409182902087518154928901519389015160608a015186166e010000000000000000000000000000027fffffffffffff000000000000000000000000ffffffffffffffffffffffffffff919096166201000002167fffffffffffff000000000000000000000000000000000000000000000000ffff60ff95909516610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff921515929092167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000909416939093171792909216179190911790555050505b60400151949350505050565b6000808a8a8a8a8a8a8a8a8a604051602001612e7f99989796959493929190614c7b565b604080518083037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe001815291905280516020909101207dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167e01000000000000000000000000000000000000000000000000000000000000179b9a5050505050505050505050565b6000612158825490565b6000612f1b83836133b8565b9392505050565b6000612f1b8373ffffffffffffffffffffffffffffffffffffffff84166133e2565b6000612f1b8373ffffffffffffffffffffffffffffffffffffffff84166134dc565b6000818160045b600f811015612ff3577fff000000000000000000000000000000000000000000000000000000000000008216838260208110612fab57612fab61434d565b1a60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614612fe157506000949350505050565b80612feb816145d9565b915050612f6d565b5081600f1a600181111561300957613009614b07565b949350505050565b60008080808560600151600181111561302c5761302c614b07565b036130525761303e888888888861352b565b61304d57600092509050613126565b6130ca565b60018560600151600181111561306a5761306a614b07565b0361309857600061307d898989886136b6565b92509050806130925750600092509050613126565b506130ca565b6040517ff2b2d41200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b84516040015163ffffffff16871061311f57877fc3237c8807c467c1b39b8d0395eff077313e691bf0a7388106792564ebfd56368760405161310c9190613b21565b60405180910390a2600092509050613126565b6001925090505b9550959350505050565b60008160600151600181111561314857613148614b07565b036131ac57600083815260046020526040902060010180547fffffffff00000000ffffffffffffffffffffffffffffffffffffffffffffffff16780100000000000000000000000000000000000000000000000063ffffffff851602179055505050565b6001816060015160018111156131c4576131c4614b07565b036132305760c08101805160009081526008602052604080822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055915191517fa4a4e334c0e330143f9437484fe516c13bc560b86b5b0daf58e7084aaac228f29190a25b505050565b600080613248898886868a8a60016138c4565b60008a8152600460205260408120600101549294509092506c010000000000000000000000009091046bffffffffffffffffffffffff169061328a8385614315565b9050836bffffffffffffffffffffffff16826bffffffffffffffffffffffff1610156132be575091506000905081806132f1565b806bffffffffffffffffffffffff16826bffffffffffffffffffffffff1610156132f15750806132ee8482614bfb565b92505b60008a81526004602052604090206001018054829190600c906133339084906c0100000000000000000000000090046bffffffffffffffffffffffff16614bfb565b82546101009290920a6bffffffffffffffffffffffff81810219909316918316021790915560008c81526004602052604081206001018054859450909261337c91859116614315565b92506101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff160217905550505097509795505050505050565b60008260000182815481106133cf576133cf61434d565b9060005260206000200154905092915050565b600081815260018301602052604081205480156134cb576000613406600183614b68565b855490915060009061341a90600190614b68565b905081811461347f57600086600001828154811061343a5761343a61434d565b906000526020600020015490508087600001848154811061345d5761345d61434d565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061349057613490614d10565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050612158565b6000915050612158565b5092915050565b600081815260018301602052604081205461352357508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155612158565b506000612158565b600080848060200190518101906135429190614d3f565b845160c00151815191925063ffffffff9081169116101561359f57867f405288ea7be309e16cfdf481367f90a413e1d4634fcdaf8966546db9b93012e88660405161358d9190613b21565b60405180910390a260009150506136ad565b826101200151801561366057506020810151158015906136605750602081015161014084015182516040517f85df51fd00000000000000000000000000000000000000000000000000000000815263ffffffff909116600482015273ffffffffffffffffffffffffffffffffffffffff909116906385df51fd90602401602060405180830381865afa158015613639573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061365d9190614611565b14155b806136725750805163ffffffff168611155b156136a757867f6aa7f60c176da7af894b384daea2249497448137f5943c1237ada8bc92bdc3018660405161358d9190613b21565b60019150505b95945050505050565b6000806000848060200190518101906136cf9190614d97565b905060008782600001518360200151846040015160405160200161373194939291909384526020840192909252604083015260e01b7fffffffff0000000000000000000000000000000000000000000000000000000016606082015260640190565b604051602081830303815290604052805190602001209050846101200151801561380d575060808201511580159061380d5750608082015161014086015160608401516040517f85df51fd00000000000000000000000000000000000000000000000000000000815263ffffffff909116600482015273ffffffffffffffffffffffffffffffffffffffff909116906385df51fd90602401602060405180830381865afa1580156137e6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061380a9190614611565b14155b80613822575086826060015163ffffffff1610155b1561386c57877f6aa7f60c176da7af894b384daea2249497448137f5943c1237ada8bc92bdc301876040516138579190613b21565b60405180910390a26000935091506138bb9050565b60008181526008602052604090205460ff16156138b357877f405288ea7be309e16cfdf481367f90a413e1d4634fcdaf8966546db9b93012e8876040516138579190613b21565b600193509150505b94509492505050565b60008060008960a0015161ffff16866138dd9190614b51565b90508380156138eb5750803a105b156138f357503a5b600085886139018b8d61433a565b61390b9085614b51565b613915919061433a565b61392790670de0b6b3a7640000614b51565b6139319190614baa565b905060008b6040015163ffffffff1664e8d4a510006139509190614b51565b60208d0151889063ffffffff168b6139688f88614b51565b613972919061433a565b61398090633b9aca00614b51565b61398a9190614b51565b6139949190614baa565b61399e919061433a565b90506b033b2e3c9fd0803ce80000006139b7828461433a565b11156139ef576040517f2ad7547a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b909b909a5098505050505050505050565b5080546000825590600052602060002090810190610bb19190613aa8565b828054828255906000526020600020908101928215613a98579160200282015b82811115613a9857825182547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff909116178255602090920191600190910190613a3e565b50613aa4929150613aa8565b5090565b5b80821115613aa45760008155600101613aa9565b6000815180845260005b81811015613ae357602081850181015186830182015201613ac7565b5060006020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b602081526000612f1b6020830184613abd565b73ffffffffffffffffffffffffffffffffffffffff81168114610bb157600080fd5b8035613b6181613b34565b919050565b60008083601f840112613b7857600080fd5b50813567ffffffffffffffff811115613b9057600080fd5b602083019150836020828501011115613ba857600080fd5b9250929050565b60008060008060608587031215613bc557600080fd5b8435613bd081613b34565b935060208501359250604085013567ffffffffffffffff811115613bf357600080fd5b613bff87828801613b66565b95989497509550505050565b600080600060408486031215613c2057600080fd5b83359250602084013567ffffffffffffffff811115613c3e57600080fd5b613c4a86828701613b66565b9497909650939450505050565b60008083601f840112613c6957600080fd5b50813567ffffffffffffffff811115613c8157600080fd5b6020830191508360208260051b8501011115613ba857600080fd5b60008060008060008060008060e0898b031215613cb857600080fd5b606089018a811115613cc957600080fd5b8998503567ffffffffffffffff80821115613ce357600080fd5b613cef8c838d01613b66565b909950975060808b0135915080821115613d0857600080fd5b613d148c838d01613c57565b909750955060a08b0135915080821115613d2d57600080fd5b50613d3a8b828c01613c57565b999c989b50969995989497949560c00135949350505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051610220810167ffffffffffffffff81118282101715613da657613da6613d53565b60405290565b60405160c0810167ffffffffffffffff81118282101715613da657613da6613d53565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715613e1657613e16613d53565b604052919050565b600067ffffffffffffffff821115613e3857613e38613d53565b5060051b60200190565b600082601f830112613e5357600080fd5b81356020613e68613e6383613e1e565b613dcf565b82815260059290921b84018101918181019086841115613e8757600080fd5b8286015b84811015613eab578035613e9e81613b34565b8352918301918301613e8b565b509695505050505050565b803560ff81168114613b6157600080fd5b600082601f830112613ed857600080fd5b813567ffffffffffffffff811115613ef257613ef2613d53565b613f2360207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f84011601613dcf565b818152846020838601011115613f3857600080fd5b816020850160208301376000918101602001919091529392505050565b803567ffffffffffffffff81168114613b6157600080fd5b60008060008060008060c08789031215613f8657600080fd5b863567ffffffffffffffff80821115613f9e57600080fd5b613faa8a838b01613e42565b97506020890135915080821115613fc057600080fd5b613fcc8a838b01613e42565b9650613fda60408a01613eb6565b95506060890135915080821115613ff057600080fd5b613ffc8a838b01613ec7565b945061400a60808a01613f55565b935060a089013591508082111561402057600080fd5b5061402d89828a01613ec7565b9150509295509295509295565b60006020828403121561404c57600080fd5b8135612f1b81613b34565b63ffffffff81168114610bb157600080fd5b8035613b6181614057565b62ffffff81168114610bb157600080fd5b8035613b6181614074565b61ffff81168114610bb157600080fd5b8035613b6181614090565b6bffffffffffffffffffffffff81168114610bb157600080fd5b8035613b61816140ab565b8015158114610bb157600080fd5b8035613b61816140d0565b600061022082840312156140fc57600080fd5b614104613d82565b905061410f82614069565b815261411d60208301614069565b602082015261412e60408301614069565b604082015261413f60608301614085565b6060820152614150608083016140a0565b608082015261416160a083016140c5565b60a082015261417260c08301614069565b60c082015261418360e08301614069565b60e0820152610100614196818401614069565b908201526101206141a8838201614069565b90820152610140828101359082015261016080830135908201526101806141d0818401613b56565b908201526101a08281013567ffffffffffffffff8111156141f057600080fd5b6141fc85828601613e42565b8284015250506101c0614210818401613b56565b908201526101e0614222838201613b56565b908201526102006142348382016140de565b9082015292915050565b60008060008060008060c0878903121561425757600080fd5b863567ffffffffffffffff8082111561426f57600080fd5b61427b8a838b01613e42565b9750602089013591508082111561429157600080fd5b61429d8a838b01613e42565b96506142ab60408a01613eb6565b955060608901359150808211156142c157600080fd5b613ffc8a838b016140e9565b6000602082840312156142df57600080fd5b5035919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6bffffffffffffffffffffffff8181168382160190808211156134d5576134d56142e6565b80820180821115612158576121586142e6565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60ff8181168382160190811115612158576121586142e6565b8051613b6181614057565b8051613b6181614074565b8051613b6181614090565b8051613b61816140ab565b8051613b6181613b34565b600082601f8301126143dd57600080fd5b815160206143ed613e6383613e1e565b82815260059290921b8401810191818101908684111561440c57600080fd5b8286015b84811015613eab57805161442381613b34565b8352918301918301614410565b8051613b61816140d0565b60006020828403121561444d57600080fd5b815167ffffffffffffffff8082111561446557600080fd5b90830190610220828603121561447a57600080fd5b614482613d82565b61448b83614395565b815261449960208401614395565b60208201526144aa60408401614395565b60408201526144bb606084016143a0565b60608201526144cc608084016143ab565b60808201526144dd60a084016143b6565b60a08201526144ee60c08401614395565b60c08201526144ff60e08401614395565b60e0820152610100614512818501614395565b90820152610120614524848201614395565b908201526101408381015190820152610160808401519082015261018061454c8185016143c1565b908201526101a0838101518381111561456457600080fd5b614570888287016143cc565b8284015250506101c091506145868284016143c1565b828201526101e0915061459a8284016143c1565b8282015261020091506145ae828401614430565b91810191909152949350505050565b60ff81811683821602908116908181146134d5576134d56142e6565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361460a5761460a6142e6565b5060010190565b60006020828403121561462357600080fd5b5051919050565b63ffffffff8181168382160190808211156134d5576134d56142e6565b600081518084526020808501945080840160005b8381101561468d57815173ffffffffffffffffffffffffffffffffffffffff168752958201959082019060010161465b565b509495945050505050565b602081526146af60208201835163ffffffff169052565b600060208301516146c8604084018263ffffffff169052565b50604083015163ffffffff8116606084015250606083015162ffffff8116608084015250608083015161ffff811660a08401525060a08301516bffffffffffffffffffffffff811660c08401525060c083015163ffffffff811660e08401525060e08301516101006147418185018363ffffffff169052565b840151905061012061475a8482018363ffffffff169052565b84015190506101406147738482018363ffffffff169052565b840151610160848101919091528401516101808085019190915284015190506101a06147b68185018373ffffffffffffffffffffffffffffffffffffffff169052565b808501519150506102206101c081818601526147d6610240860184614647565b908601519092506101e06148018682018373ffffffffffffffffffffffffffffffffffffffff169052565b860151905061020061482a8682018373ffffffffffffffffffffffffffffffffffffffff169052565b90950151151593019290925250919050565b600061012063ffffffff808d1684528b6020850152808b1660408501525080606084015261486c8184018a614647565b905082810360808401526148808189614647565b905060ff871660a084015282810360c084015261489d8187613abd565b905067ffffffffffffffff851660e08401528281036101008401526148c28185613abd565b9c9b505050505050505050505050565b8281526040602082015260006130096040830184613abd565b600080604083850312156148fe57600080fd5b8251614909816140d0565b6020939093015192949293505050565b8183823760009101908152919050565b8281526080810160608360208401379392505050565b600082601f83011261495057600080fd5b81356020614960613e6383613e1e565b82815260059290921b8401810191818101908684111561497f57600080fd5b8286015b84811015613eab5780358352918301918301614983565b600082601f8301126149ab57600080fd5b813560206149bb613e6383613e1e565b82815260059290921b840181019181810190868411156149da57600080fd5b8286015b84811015613eab57803567ffffffffffffffff8111156149fe5760008081fd5b614a0c8986838b0101613ec7565b8452509183019183016149de565b600060208284031215614a2c57600080fd5b813567ffffffffffffffff80821115614a4457600080fd5b9083019060c08286031215614a5857600080fd5b614a60613dac565b8235815260208301356020820152604083013582811115614a8057600080fd5b614a8c8782860161493f565b604083015250606083013582811115614aa457600080fd5b614ab08782860161493f565b606083015250608083013582811115614ac857600080fd5b614ad48782860161499a565b60808301525060a083013582811115614aec57600080fd5b614af88782860161499a565b60a08301525095945050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b61ffff8181168382160190808211156134d5576134d56142e6565b8082028115828204841417612158576121586142e6565b81810381811115612158576121586142e6565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600082614bb957614bb9614b7b565b500490565b6bffffffffffffffffffffffff85168152836020820152826040820152608060608201526000614bf16080830184613abd565b9695505050505050565b6bffffffffffffffffffffffff8281168282160390808211156134d5576134d56142e6565b60006bffffffffffffffffffffffff80841680614c3f57614c3f614b7b565b92169190910492915050565b6bffffffffffffffffffffffff818116838216028082169190828114614c7357614c736142e6565b505092915050565b60006101208b835273ffffffffffffffffffffffffffffffffffffffff8b16602084015267ffffffffffffffff808b166040850152816060850152614cc28285018b614647565b91508382036080850152614cd6828a614647565b915060ff881660a085015283820360c0850152614cf38288613abd565b90861660e085015283810361010085015290506148c28185613abd565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b600060408284031215614d5157600080fd5b6040516040810181811067ffffffffffffffff82111715614d7457614d74613d53565b6040528251614d8281614057565b81526020928301519281019290925250919050565b600060a08284031215614da957600080fd5b60405160a0810181811067ffffffffffffffff82111715614dcc57614dcc613d53565b806040525082518152602083015160208201526040830151614ded81614057565b60408201526060830151614e0081614057565b6060820152608092830151928101929092525091905056fea164736f6c6343000813000a", + Bin: "0x6101406040523480156200001257600080fd5b506040516200526d3803806200526d8339810160408190526200003591620003b1565b80816001600160a01b031663ca30e6036040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000075573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200009b9190620003b1565b826001600160a01b031663b10b673c6040518163ffffffff1660e01b8152600401602060405180830381865afa158015620000da573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001009190620003b1565b836001600160a01b0316636709d0e56040518163ffffffff1660e01b8152600401602060405180830381865afa1580156200013f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001659190620003b1565b846001600160a01b0316635425d8ac6040518163ffffffff1660e01b8152600401602060405180830381865afa158015620001a4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001ca9190620003b1565b856001600160a01b031663a08714c06040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000209573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200022f9190620003b1565b3380600081620002865760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620002b957620002b981620002ed565b5050506001600160a01b0394851660805292841660a05290831660c052821660e052811661010052166101205250620003d8565b336001600160a01b03821603620003475760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c6600000000000000000060448201526064016200027d565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b6001600160a01b0381168114620003ae57600080fd5b50565b600060208284031215620003c457600080fd5b8151620003d18162000398565b9392505050565b60805160a05160c05160e0516101005161012051614e48620004256000396000818160c9015261017c01526000611bb8015260005050600050506000505060006104c20152614e486000f3fe6080604052600436106100c75760003560e01c8063aed2e92911610074578063e3d0e7121161004e578063e3d0e71214610348578063f2fde38b14610368578063f75f6b1114610388576100c7565b8063aed2e929146102a3578063afcb95d7146102da578063b1dc65a414610328576100c7565b806381ff7048116100a557806381ff7048146101d65780638da5cb5b14610258578063a4c0ed3614610283576100c7565b8063181f5a771461010e578063349e8cca1461016d57806379ba5097146101c1575b7f00000000000000000000000000000000000000000000000000000000000000003660008037600080366000845af43d6000803e808015610107573d6000f35b3d6000fd5b005b34801561011a57600080fd5b506101576040518060400160405280601881526020017f4175746f6d6174696f6e526567697374727920322e322e30000000000000000081525081565b6040516101649190613b44565b60405180910390f35b34801561017957600080fd5b507f00000000000000000000000000000000000000000000000000000000000000005b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610164565b3480156101cd57600080fd5b5061010c6103a8565b3480156101e257600080fd5b5061023560155460115463ffffffff780100000000000000000000000000000000000000000000000083048116937c01000000000000000000000000000000000000000000000000000000009093041691565b6040805163ffffffff948516815293909216602084015290820152606001610164565b34801561026457600080fd5b5060005473ffffffffffffffffffffffffffffffffffffffff1661019c565b34801561028f57600080fd5b5061010c61029e366004613bd2565b6104aa565b3480156102af57600080fd5b506102c36102be366004613c2e565b6106c6565b604080519215158352602083019190915201610164565b3480156102e657600080fd5b50601154601254604080516000815260208101939093527401000000000000000000000000000000000000000090910463ffffffff1690820152606001610164565b34801561033457600080fd5b5061010c610343366004613cbf565b61083c565b34801561035457600080fd5b5061010c610363366004613f90565b610b77565b34801561037457600080fd5b5061010c61038336600461405d565b610ba0565b34801561039457600080fd5b5061010c6103a3366004614261565b610bb4565b60015473ffffffffffffffffffffffffffffffffffffffff16331461042e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e65720000000000000000000060448201526064015b60405180910390fd5b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b3373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614610519576040517fc8bad78d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60208114610553576040517fdfe9309000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000610561828401846142f0565b60008181526004602052604090205490915065010000000000900463ffffffff908116146105bb576040517f9c0083a200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000818152600460205260409020600101546105f69085906c0100000000000000000000000090046bffffffffffffffffffffffff16614338565b600082815260046020526040902060010180546bffffffffffffffffffffffff929092166c01000000000000000000000000027fffffffffffffffff000000000000000000000000ffffffffffffffffffffffff90921691909117905560195461066190859061435d565b6019556040516bffffffffffffffffffffffff8516815273ffffffffffffffffffffffffffffffffffffffff86169082907fafd24114486da8ebfc32f3626dada8863652e187461aa74d4bfa7348915062039060200160405180910390a35050505050565b6000806106d1611ba0565b6012547e01000000000000000000000000000000000000000000000000000000000000900460ff1615610730576040517f24522f3400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600085815260046020908152604091829020825160e081018452815460ff811615158252610100810463ffffffff908116838601819052650100000000008304821684880152690100000000000000000090920473ffffffffffffffffffffffffffffffffffffffff16606084018190526001909401546bffffffffffffffffffffffff80821660808601526c0100000000000000000000000082041660a0850152780100000000000000000000000000000000000000000000000090041660c08301528451601f8901859004850281018501909552878552909361082f938990899081908401838280828437600092019190915250611c1192505050565b9097909650945050505050565b60005a60408051610160810182526012546bffffffffffffffffffffffff8116825263ffffffff6c010000000000000000000000008204811660208401527001000000000000000000000000000000008204811693830193909352740100000000000000000000000000000000000000008104909216606082015262ffffff7801000000000000000000000000000000000000000000000000830416608082015261ffff7b0100000000000000000000000000000000000000000000000000000083041660a082015260ff7d0100000000000000000000000000000000000000000000000000000000008304811660c08301527e010000000000000000000000000000000000000000000000000000000000008304811615801560e08401527f01000000000000000000000000000000000000000000000000000000000000009093048116151561010080840191909152601354918216151561012084015273ffffffffffffffffffffffffffffffffffffffff9104166101408201529192506109f2576040517f24522f3400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b336000908152600b602052604090205460ff16610a3b576040517f1099ed7500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6011548a3514610a77576040517fdfdcf8e700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60c0810151610a8790600161439f565b60ff1686141580610a985750858414155b15610acf576040517f0244f71a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610adf8a8a8a8a8a8a8a8a611e3a565b6000610aeb8a8a6120a3565b905060208b0135600881901c63ffffffff16610b0884848761215e565b836060015163ffffffff168163ffffffff161115610b6857601280547fffffffffffffffff00000000ffffffffffffffffffffffffffffffffffffffff167401000000000000000000000000000000000000000063ffffffff8416021790555b50505050505050505050505050565b610b9886868686806020019051810190610b91919061445e565b8686610bb4565b505050505050565b610ba8612b00565b610bb181612b81565b50565b610bbc612b00565b601f86511115610bf8576040517f25d0209c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8360ff16600003610c35576040517fe77dba5600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b84518651141580610c545750610c4c8460036145e0565b60ff16865111155b15610c8b576040517f1d2d1c5800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b601254600e546bffffffffffffffffffffffff9091169060005b816bffffffffffffffffffffffff16811015610d0d57610cfa600e8281548110610cd157610cd1614370565b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff168484612c76565b5080610d05816145fc565b915050610ca5565b5060008060005b836bffffffffffffffffffffffff16811015610e1657600d8181548110610d3d57610d3d614370565b600091825260209091200154600e805473ffffffffffffffffffffffffffffffffffffffff90921694509082908110610d7857610d78614370565b600091825260208083209091015473ffffffffffffffffffffffffffffffffffffffff8681168452600c8352604080852080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00001690559116808452600b90925290912080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055915080610e0e816145fc565b915050610d14565b50610e23600d6000613a23565b610e2f600e6000613a23565b604080516080810182526000808252602082018190529181018290526060810182905290805b8c5181101561129857600c60008e8381518110610e7457610e74614370565b60209081029190910181015173ffffffffffffffffffffffffffffffffffffffff1682528101919091526040016000205460ff1615610edf576040517f77cea0fa00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168d8281518110610f0957610f09614370565b602002602001015173ffffffffffffffffffffffffffffffffffffffff1603610f5e576040517f815e1d6400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60405180604001604052806001151581526020018260ff16815250600c60008f8481518110610f8f57610f8f614370565b60209081029190910181015173ffffffffffffffffffffffffffffffffffffffff1682528181019290925260400160002082518154939092015160ff16610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff921515929092167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000909316929092171790558b518c908290811061103757611037614370565b60200260200101519150600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036110a7576040517f58a70a0a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff82166000908152600b60209081526040918290208251608081018452905460ff80821615801584526101008304909116938301939093526bffffffffffffffffffffffff6201000082048116948301949094526e01000000000000000000000000000090049092166060830152909350611162576040517f6a7281ad00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001835260ff80821660208086019182526bffffffffffffffffffffffff808b166060880190815273ffffffffffffffffffffffffffffffffffffffff87166000908152600b909352604092839020885181549551948a0151925184166e010000000000000000000000000000027fffffffffffff000000000000000000000000ffffffffffffffffffffffffffff939094166201000002929092167fffffffffffff000000000000000000000000000000000000000000000000ffff94909616610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff921515929092167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00009095169490941717919091169290921791909117905580611290816145fc565b915050610e55565b50508a516112ae9150600d9060208d0190613a41565b5088516112c290600e9060208c0190613a41565b50604051806101600160405280856bffffffffffffffffffffffff168152602001886000015163ffffffff168152602001886020015163ffffffff168152602001600063ffffffff168152602001886060015162ffffff168152602001886080015161ffff1681526020018960ff1681526020016012600001601e9054906101000a900460ff16151581526020016012600001601f9054906101000a900460ff161515815260200188610200015115158152602001886101e0015173ffffffffffffffffffffffffffffffffffffffff16815250601260008201518160000160006101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff160217905550602082015181600001600c6101000a81548163ffffffff021916908363ffffffff16021790555060408201518160000160106101000a81548163ffffffff021916908363ffffffff16021790555060608201518160000160146101000a81548163ffffffff021916908363ffffffff16021790555060808201518160000160186101000a81548162ffffff021916908362ffffff16021790555060a082015181600001601b6101000a81548161ffff021916908361ffff16021790555060c082015181600001601d6101000a81548160ff021916908360ff16021790555060e082015181600001601e6101000a81548160ff02191690831515021790555061010082015181600001601f6101000a81548160ff0219169083151502179055506101208201518160010160006101000a81548160ff0219169083151502179055506101408201518160010160016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055509050506040518061018001604052808860a001516bffffffffffffffffffffffff16815260200188610180015173ffffffffffffffffffffffffffffffffffffffff168152602001601460010160009054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff168152602001886040015163ffffffff1681526020018860c0015163ffffffff168152602001601460010160149054906101000a900463ffffffff1663ffffffff168152602001601460010160189054906101000a900463ffffffff1663ffffffff1681526020016014600101601c9054906101000a900463ffffffff1663ffffffff1681526020018860e0015163ffffffff16815260200188610100015163ffffffff16815260200188610120015163ffffffff168152602001886101c0015173ffffffffffffffffffffffffffffffffffffffff16815250601460008201518160000160006101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff160217905550602082015181600001600c6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060408201518160010160006101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff160217905550606082015181600101600c6101000a81548163ffffffff021916908363ffffffff16021790555060808201518160010160106101000a81548163ffffffff021916908363ffffffff16021790555060a08201518160010160146101000a81548163ffffffff021916908363ffffffff16021790555060c08201518160010160186101000a81548163ffffffff021916908363ffffffff16021790555060e082015181600101601c6101000a81548163ffffffff021916908363ffffffff1602179055506101008201518160020160006101000a81548163ffffffff021916908363ffffffff1602179055506101208201518160020160046101000a81548163ffffffff021916908363ffffffff1602179055506101408201518160020160086101000a81548163ffffffff021916908363ffffffff16021790555061016082015181600201600c6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555090505086610140015160178190555086610160015160188190555060006014600101601c9054906101000a900463ffffffff169050876101e0015173ffffffffffffffffffffffffffffffffffffffff166357e871e76040518163ffffffff1660e01b8152600401602060405180830381865afa158015611963573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119879190614634565b601580547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167c010000000000000000000000000000000000000000000000000000000063ffffffff9384160217808255600192601891611a02918591780100000000000000000000000000000000000000000000000090041661464d565b92506101000a81548163ffffffff021916908363ffffffff160217905550600088604051602001611a3391906146bb565b604080518083037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0018152919052601554909150611a9c90469030907801000000000000000000000000000000000000000000000000900463ffffffff168f8f8f878f8f612e7e565b60115560005b611aac6009612f28565b811015611adc57611ac9611ac1600983612f32565b600990612f45565b5080611ad4816145fc565b915050611aa2565b5060005b896101a0015151811015611b3357611b208a6101a001518281518110611b0857611b08614370565b60200260200101516009612f6790919063ffffffff16565b5080611b2b816145fc565b915050611ae0565b507f1591690b8638f5fb2dbec82ac741805ac5da8b45dc5263f4875b0496fdce4e0582601154601460010160189054906101000a900463ffffffff168f8f8f878f8f604051611b8a9998979695949392919061485f565b60405180910390a1505050505050505050505050565b3273ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614611c0f576040517fb60ac5db00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b565b60125460009081907f0100000000000000000000000000000000000000000000000000000000000000900460ff1615611c76576040517f37ed32e800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b601280547effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f01000000000000000000000000000000000000000000000000000000000000001790556040517f4585e33b0000000000000000000000000000000000000000000000000000000090611cf2908590602401613b44565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff000000000000000000000000000000000000000000000000000000009094169390931790925290517f79188d1600000000000000000000000000000000000000000000000000000000815290935073ffffffffffffffffffffffffffffffffffffffff8616906379188d1690611dc590879087906004016148f5565b60408051808303816000875af1158015611de3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e07919061490e565b601280547effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff16905590969095509350505050565b60008787604051611e4c92919061493c565b604051908190038120611e63918b9060200161494c565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815282825280516020918201208383019092526000808452908301819052909250906000805b8881101561203a57600185878360208110611ecf57611ecf614370565b611edc91901a601b61439f565b8c8c85818110611eee57611eee614370565b905060200201358b8b86818110611f0757611f07614370565b9050602002013560405160008152602001604052604051611f44949392919093845260ff9290921660208401526040830152606082015260800190565b6020604051602081039080840390855afa158015611f66573d6000803e3d6000fd5b5050604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081015173ffffffffffffffffffffffffffffffffffffffff81166000908152600c602090815290849020838501909452925460ff8082161515808552610100909204169383019390935290955093509050612014576040517f0f4c073700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b826020015160080260ff166001901b840193508080612032906145fc565b915050611eb2565b50827e01010101010101010101010101010101010101010101010101010101010101841614612095576040517fc103be2e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b505050505050505050505050565b6120dc6040518060c001604052806000815260200160008152602001606081526020016060815260200160608152602001606081525090565b60006120ea83850185614a3d565b604081015151606082015151919250908114158061210d57508082608001515114155b8061211d5750808260a001515114155b15612154576040517fb55ac75400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5090505b92915050565b600082604001515167ffffffffffffffff81111561217e5761217e613d76565b60405190808252806020026020018201604052801561223a57816020015b604080516101c081018252600060e08201818152610100830182905261012083018290526101408301829052610160830182905261018083018290526101a0830182905282526020808301829052928201819052606082018190526080820181905260a0820181905260c082015282527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90920191018161219c5790505b50905060006040518060800160405280600061ffff1681526020016000815260200160006bffffffffffffffffffffffff16815260200160006bffffffffffffffffffffffff168152509050600085610140015173ffffffffffffffffffffffffffffffffffffffff166357e871e76040518163ffffffff1660e01b8152600401602060405180830381865afa1580156122d8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122fc9190614634565b6101408701516040517f7810d12a00000000000000000000000000000000000000000000000000000000815236600482015291925060009173ffffffffffffffffffffffffffffffffffffffff90911690637810d12a90602401602060405180830381865afa158015612373573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123979190614634565b905060005b8660400151518110156127e65760046000886040015183815181106123c3576123c3614370565b6020908102919091018101518252818101929092526040908101600020815160e081018352815460ff811615158252610100810463ffffffff90811695830195909552650100000000008104851693820193909352690100000000000000000090920473ffffffffffffffffffffffffffffffffffffffff166060830152600101546bffffffffffffffffffffffff80821660808401526c0100000000000000000000000082041660a08301527801000000000000000000000000000000000000000000000000900490911660c082015285518690839081106124a8576124a8614370565b6020026020010151600001819052506124dd876040015182815181106124d0576124d0614370565b6020026020010151612f89565b8582815181106124ef576124ef614370565b602002602001015160600190600181111561250c5761250c614b2a565b9081600181111561251f5761251f614b2a565b815250506125838760400151828151811061253c5761253c614370565b6020026020010151848960800151848151811061255b5761255b614370565b602002602001015188858151811061257557612575614370565b60200260200101518c613034565b86838151811061259557612595614370565b60200260200101516020018784815181106125b2576125b2614370565b602002602001015160c00182815250821515151581525050508481815181106125dd576125dd614370565b6020026020010151602001511561260d576001846000018181516126019190614b59565b61ffff16905250612612565b6127d4565b61267885828151811061262757612627614370565b602002602001015160000151606001518860600151838151811061264d5761264d614370565b60200260200101518960a00151848151811061266b5761266b614370565b6020026020010151611c11565b86838151811061268a5761268a614370565b60200260200101516040018784815181106126a7576126a7614370565b602090810291909101015160800191909152901515905260c08801516126ce90600161439f565b6126dc9060ff166040614b74565b6103a48860a0015183815181106126f5576126f5614370565b602002602001015151612708919061435d565b612712919061435d565b85828151811061272457612724614370565b602002602001015160a001818152505084818151811061274657612746614370565b602002602001015160a0015184602001818151612763919061435d565b905250845185908290811061277a5761277a614370565b602002602001015160800151866127919190614b8b565b95506127d4876040015182815181106127ac576127ac614370565b6020026020010151848784815181106127c7576127c7614370565b6020026020010151613153565b806127de816145fc565b91505061239c565b50825161ffff166000036127fd5750505050505050565b6155f061280b366010614b74565b5a6128169088614b8b565b612820919061435d565b61282a919061435d565b8351909550611b58906128419061ffff1687614bcd565b61284b919061435d565b945060008060005b886040015151811015612a2f5786818151811061287257612872614370565b60200260200101516020015115612a1d5761290b8a8a60400151838151811061289d5761289d614370565b60200260200101518984815181106128b7576128b7614370565b6020026020010151608001518c600001518d602001518d8c602001518e89815181106128e5576128e5614370565b602002602001015160a001518c6128fc9190614b74565b6129069190614bcd565b613258565b6060880180519295509093508391612924908390614338565b6bffffffffffffffffffffffff16905250604086018051849190612949908390614338565b6bffffffffffffffffffffffff16905250865187908290811061296e5761296e614370565b60200260200101516040015115158960400151828151811061299257612992614370565b60200260200101517fad8cc9579b21dfe2c2f6ea35ba15b656e46b4f5b0cb424f52739b8ce5cac9c5b84866129c79190614338565b8a85815181106129d9576129d9614370565b6020026020010151608001518c8e6080015187815181106129fc576129fc614370565b6020026020010151604051612a149493929190614be1565b60405180910390a35b80612a27816145fc565b915050612853565b505050604083810151336000908152600b602052919091208054600290612a6b9084906201000090046bffffffffffffffffffffffff16614338565b92506101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055508260600151601260000160008282829054906101000a90046bffffffffffffffffffffffff16612ac99190614338565b92506101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff16021790555050505050505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314611c0f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e6572000000000000000000006044820152606401610425565b3373ffffffffffffffffffffffffffffffffffffffff821603612c00576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c660000000000000000006044820152606401610425565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b73ffffffffffffffffffffffffffffffffffffffff83166000908152600b602090815260408083208151608081018352905460ff80821615801584526101008304909116948301949094526bffffffffffffffffffffffff6201000082048116938301939093526e0100000000000000000000000000009004909116606082015290612e72576000816060015185612d0e9190614c1e565b90506000612d1c8583614c43565b90508083604001818151612d309190614338565b6bffffffffffffffffffffffff16905250612d4b8582614c6e565b83606001818151612d5c9190614338565b6bffffffffffffffffffffffff90811690915273ffffffffffffffffffffffffffffffffffffffff89166000908152600b602090815260409182902087518154928901519389015160608a015186166e010000000000000000000000000000027fffffffffffff000000000000000000000000ffffffffffffffffffffffffffff919096166201000002167fffffffffffff000000000000000000000000000000000000000000000000ffff60ff95909516610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff921515929092167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000909416939093171792909216179190911790555050505b60400151949350505050565b6000808a8a8a8a8a8a8a8a8a604051602001612ea299989796959493929190614c9e565b604080518083037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe001815291905280516020909101207dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167e01000000000000000000000000000000000000000000000000000000000000179b9a5050505050505050505050565b6000612158825490565b6000612f3e83836133db565b9392505050565b6000612f3e8373ffffffffffffffffffffffffffffffffffffffff8416613405565b6000612f3e8373ffffffffffffffffffffffffffffffffffffffff84166134ff565b6000818160045b600f811015613016577fff000000000000000000000000000000000000000000000000000000000000008216838260208110612fce57612fce614370565b1a60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161461300457506000949350505050565b8061300e816145fc565b915050612f90565b5081600f1a600181111561302c5761302c614b2a565b949350505050565b60008080808560600151600181111561304f5761304f614b2a565b0361307557613061888888888861354e565b61307057600092509050613149565b6130ed565b60018560600151600181111561308d5761308d614b2a565b036130bb5760006130a0898989886136d9565b92509050806130b55750600092509050613149565b506130ed565b6040517ff2b2d41200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b84516040015163ffffffff16871061314257877fc3237c8807c467c1b39b8d0395eff077313e691bf0a7388106792564ebfd56368760405161312f9190613b44565b60405180910390a2600092509050613149565b6001925090505b9550959350505050565b60008160600151600181111561316b5761316b614b2a565b036131cf57600083815260046020526040902060010180547fffffffff00000000ffffffffffffffffffffffffffffffffffffffffffffffff16780100000000000000000000000000000000000000000000000063ffffffff851602179055505050565b6001816060015160018111156131e7576131e7614b2a565b036132535760c08101805160009081526008602052604080822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055915191517fa4a4e334c0e330143f9437484fe516c13bc560b86b5b0daf58e7084aaac228f29190a25b505050565b60008061326b898886868a8a60016138e7565b60008a8152600460205260408120600101549294509092506c010000000000000000000000009091046bffffffffffffffffffffffff16906132ad8385614338565b9050836bffffffffffffffffffffffff16826bffffffffffffffffffffffff1610156132e157509150600090508180613314565b806bffffffffffffffffffffffff16826bffffffffffffffffffffffff1610156133145750806133118482614c1e565b92505b60008a81526004602052604090206001018054829190600c906133569084906c0100000000000000000000000090046bffffffffffffffffffffffff16614c1e565b82546101009290920a6bffffffffffffffffffffffff81810219909316918316021790915560008c81526004602052604081206001018054859450909261339f91859116614338565b92506101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff160217905550505097509795505050505050565b60008260000182815481106133f2576133f2614370565b9060005260206000200154905092915050565b600081815260018301602052604081205480156134ee576000613429600183614b8b565b855490915060009061343d90600190614b8b565b90508181146134a257600086600001828154811061345d5761345d614370565b906000526020600020015490508087600001848154811061348057613480614370565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806134b3576134b3614d33565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050612158565b6000915050612158565b5092915050565b600081815260018301602052604081205461354657508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155612158565b506000612158565b600080848060200190518101906135659190614d62565b845160c00151815191925063ffffffff908116911610156135c257867f405288ea7be309e16cfdf481367f90a413e1d4634fcdaf8966546db9b93012e8866040516135b09190613b44565b60405180910390a260009150506136d0565b826101200151801561368357506020810151158015906136835750602081015161014084015182516040517f85df51fd00000000000000000000000000000000000000000000000000000000815263ffffffff909116600482015273ffffffffffffffffffffffffffffffffffffffff909116906385df51fd90602401602060405180830381865afa15801561365c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906136809190614634565b14155b806136955750805163ffffffff168611155b156136ca57867f6aa7f60c176da7af894b384daea2249497448137f5943c1237ada8bc92bdc301866040516135b09190613b44565b60019150505b95945050505050565b6000806000848060200190518101906136f29190614dba565b905060008782600001518360200151846040015160405160200161375494939291909384526020840192909252604083015260e01b7fffffffff0000000000000000000000000000000000000000000000000000000016606082015260640190565b604051602081830303815290604052805190602001209050846101200151801561383057506080820151158015906138305750608082015161014086015160608401516040517f85df51fd00000000000000000000000000000000000000000000000000000000815263ffffffff909116600482015273ffffffffffffffffffffffffffffffffffffffff909116906385df51fd90602401602060405180830381865afa158015613809573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061382d9190614634565b14155b80613845575086826060015163ffffffff1610155b1561388f57877f6aa7f60c176da7af894b384daea2249497448137f5943c1237ada8bc92bdc3018760405161387a9190613b44565b60405180910390a26000935091506138de9050565b60008181526008602052604090205460ff16156138d657877f405288ea7be309e16cfdf481367f90a413e1d4634fcdaf8966546db9b93012e88760405161387a9190613b44565b600193509150505b94509492505050565b60008060008960a0015161ffff16866139009190614b74565b905083801561390e5750803a105b1561391657503a5b600085886139248b8d61435d565b61392e9085614b74565b613938919061435d565b61394a90670de0b6b3a7640000614b74565b6139549190614bcd565b905060008b6040015163ffffffff1664e8d4a510006139739190614b74565b60208d0151889063ffffffff168b61398b8f88614b74565b613995919061435d565b6139a390633b9aca00614b74565b6139ad9190614b74565b6139b79190614bcd565b6139c1919061435d565b90506b033b2e3c9fd0803ce80000006139da828461435d565b1115613a12576040517f2ad7547a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b909b909a5098505050505050505050565b5080546000825590600052602060002090810190610bb19190613acb565b828054828255906000526020600020908101928215613abb579160200282015b82811115613abb57825182547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff909116178255602090920191600190910190613a61565b50613ac7929150613acb565b5090565b5b80821115613ac75760008155600101613acc565b6000815180845260005b81811015613b0657602081850181015186830182015201613aea565b5060006020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b602081526000612f3e6020830184613ae0565b73ffffffffffffffffffffffffffffffffffffffff81168114610bb157600080fd5b8035613b8481613b57565b919050565b60008083601f840112613b9b57600080fd5b50813567ffffffffffffffff811115613bb357600080fd5b602083019150836020828501011115613bcb57600080fd5b9250929050565b60008060008060608587031215613be857600080fd5b8435613bf381613b57565b935060208501359250604085013567ffffffffffffffff811115613c1657600080fd5b613c2287828801613b89565b95989497509550505050565b600080600060408486031215613c4357600080fd5b83359250602084013567ffffffffffffffff811115613c6157600080fd5b613c6d86828701613b89565b9497909650939450505050565b60008083601f840112613c8c57600080fd5b50813567ffffffffffffffff811115613ca457600080fd5b6020830191508360208260051b8501011115613bcb57600080fd5b60008060008060008060008060e0898b031215613cdb57600080fd5b606089018a811115613cec57600080fd5b8998503567ffffffffffffffff80821115613d0657600080fd5b613d128c838d01613b89565b909950975060808b0135915080821115613d2b57600080fd5b613d378c838d01613c7a565b909750955060a08b0135915080821115613d5057600080fd5b50613d5d8b828c01613c7a565b999c989b50969995989497949560c00135949350505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051610220810167ffffffffffffffff81118282101715613dc957613dc9613d76565b60405290565b60405160c0810167ffffffffffffffff81118282101715613dc957613dc9613d76565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715613e3957613e39613d76565b604052919050565b600067ffffffffffffffff821115613e5b57613e5b613d76565b5060051b60200190565b600082601f830112613e7657600080fd5b81356020613e8b613e8683613e41565b613df2565b82815260059290921b84018101918181019086841115613eaa57600080fd5b8286015b84811015613ece578035613ec181613b57565b8352918301918301613eae565b509695505050505050565b803560ff81168114613b8457600080fd5b600082601f830112613efb57600080fd5b813567ffffffffffffffff811115613f1557613f15613d76565b613f4660207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f84011601613df2565b818152846020838601011115613f5b57600080fd5b816020850160208301376000918101602001919091529392505050565b803567ffffffffffffffff81168114613b8457600080fd5b60008060008060008060c08789031215613fa957600080fd5b863567ffffffffffffffff80821115613fc157600080fd5b613fcd8a838b01613e65565b97506020890135915080821115613fe357600080fd5b613fef8a838b01613e65565b9650613ffd60408a01613ed9565b9550606089013591508082111561401357600080fd5b61401f8a838b01613eea565b945061402d60808a01613f78565b935060a089013591508082111561404357600080fd5b5061405089828a01613eea565b9150509295509295509295565b60006020828403121561406f57600080fd5b8135612f3e81613b57565b63ffffffff81168114610bb157600080fd5b8035613b848161407a565b62ffffff81168114610bb157600080fd5b8035613b8481614097565b61ffff81168114610bb157600080fd5b8035613b84816140b3565b6bffffffffffffffffffffffff81168114610bb157600080fd5b8035613b84816140ce565b8015158114610bb157600080fd5b8035613b84816140f3565b6000610220828403121561411f57600080fd5b614127613da5565b90506141328261408c565b81526141406020830161408c565b60208201526141516040830161408c565b6040820152614162606083016140a8565b6060820152614173608083016140c3565b608082015261418460a083016140e8565b60a082015261419560c0830161408c565b60c08201526141a660e0830161408c565b60e08201526101006141b981840161408c565b908201526101206141cb83820161408c565b90820152610140828101359082015261016080830135908201526101806141f3818401613b79565b908201526101a08281013567ffffffffffffffff81111561421357600080fd5b61421f85828601613e65565b8284015250506101c0614233818401613b79565b908201526101e0614245838201613b79565b90820152610200614257838201614101565b9082015292915050565b60008060008060008060c0878903121561427a57600080fd5b863567ffffffffffffffff8082111561429257600080fd5b61429e8a838b01613e65565b975060208901359150808211156142b457600080fd5b6142c08a838b01613e65565b96506142ce60408a01613ed9565b955060608901359150808211156142e457600080fd5b61401f8a838b0161410c565b60006020828403121561430257600080fd5b5035919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6bffffffffffffffffffffffff8181168382160190808211156134f8576134f8614309565b8082018082111561215857612158614309565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60ff818116838216019081111561215857612158614309565b8051613b848161407a565b8051613b8481614097565b8051613b84816140b3565b8051613b84816140ce565b8051613b8481613b57565b600082601f83011261440057600080fd5b81516020614410613e8683613e41565b82815260059290921b8401810191818101908684111561442f57600080fd5b8286015b84811015613ece57805161444681613b57565b8352918301918301614433565b8051613b84816140f3565b60006020828403121561447057600080fd5b815167ffffffffffffffff8082111561448857600080fd5b90830190610220828603121561449d57600080fd5b6144a5613da5565b6144ae836143b8565b81526144bc602084016143b8565b60208201526144cd604084016143b8565b60408201526144de606084016143c3565b60608201526144ef608084016143ce565b608082015261450060a084016143d9565b60a082015261451160c084016143b8565b60c082015261452260e084016143b8565b60e08201526101006145358185016143b8565b908201526101206145478482016143b8565b908201526101408381015190820152610160808401519082015261018061456f8185016143e4565b908201526101a0838101518381111561458757600080fd5b614593888287016143ef565b8284015250506101c091506145a98284016143e4565b828201526101e091506145bd8284016143e4565b8282015261020091506145d1828401614453565b91810191909152949350505050565b60ff81811683821602908116908181146134f8576134f8614309565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361462d5761462d614309565b5060010190565b60006020828403121561464657600080fd5b5051919050565b63ffffffff8181168382160190808211156134f8576134f8614309565b600081518084526020808501945080840160005b838110156146b057815173ffffffffffffffffffffffffffffffffffffffff168752958201959082019060010161467e565b509495945050505050565b602081526146d260208201835163ffffffff169052565b600060208301516146eb604084018263ffffffff169052565b50604083015163ffffffff8116606084015250606083015162ffffff8116608084015250608083015161ffff811660a08401525060a08301516bffffffffffffffffffffffff811660c08401525060c083015163ffffffff811660e08401525060e08301516101006147648185018363ffffffff169052565b840151905061012061477d8482018363ffffffff169052565b84015190506101406147968482018363ffffffff169052565b840151610160848101919091528401516101808085019190915284015190506101a06147d98185018373ffffffffffffffffffffffffffffffffffffffff169052565b808501519150506102206101c081818601526147f961024086018461466a565b908601519092506101e06148248682018373ffffffffffffffffffffffffffffffffffffffff169052565b860151905061020061484d8682018373ffffffffffffffffffffffffffffffffffffffff169052565b90950151151593019290925250919050565b600061012063ffffffff808d1684528b6020850152808b1660408501525080606084015261488f8184018a61466a565b905082810360808401526148a3818961466a565b905060ff871660a084015282810360c08401526148c08187613ae0565b905067ffffffffffffffff851660e08401528281036101008401526148e58185613ae0565b9c9b505050505050505050505050565b82815260406020820152600061302c6040830184613ae0565b6000806040838503121561492157600080fd5b825161492c816140f3565b6020939093015192949293505050565b8183823760009101908152919050565b8281526080810160608360208401379392505050565b600082601f83011261497357600080fd5b81356020614983613e8683613e41565b82815260059290921b840181019181810190868411156149a257600080fd5b8286015b84811015613ece57803583529183019183016149a6565b600082601f8301126149ce57600080fd5b813560206149de613e8683613e41565b82815260059290921b840181019181810190868411156149fd57600080fd5b8286015b84811015613ece57803567ffffffffffffffff811115614a215760008081fd5b614a2f8986838b0101613eea565b845250918301918301614a01565b600060208284031215614a4f57600080fd5b813567ffffffffffffffff80821115614a6757600080fd5b9083019060c08286031215614a7b57600080fd5b614a83613dcf565b8235815260208301356020820152604083013582811115614aa357600080fd5b614aaf87828601614962565b604083015250606083013582811115614ac757600080fd5b614ad387828601614962565b606083015250608083013582811115614aeb57600080fd5b614af7878286016149bd565b60808301525060a083013582811115614b0f57600080fd5b614b1b878286016149bd565b60a08301525095945050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b61ffff8181168382160190808211156134f8576134f8614309565b808202811582820484141761215857612158614309565b8181038181111561215857612158614309565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600082614bdc57614bdc614b9e565b500490565b6bffffffffffffffffffffffff85168152836020820152826040820152608060608201526000614c146080830184613ae0565b9695505050505050565b6bffffffffffffffffffffffff8281168282160390808211156134f8576134f8614309565b60006bffffffffffffffffffffffff80841680614c6257614c62614b9e565b92169190910492915050565b6bffffffffffffffffffffffff818116838216028082169190828114614c9657614c96614309565b505092915050565b60006101208b835273ffffffffffffffffffffffffffffffffffffffff8b16602084015267ffffffffffffffff808b166040850152816060850152614ce58285018b61466a565b91508382036080850152614cf9828a61466a565b915060ff881660a085015283820360c0850152614d168288613ae0565b90861660e085015283810361010085015290506148e58185613ae0565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b600060408284031215614d7457600080fd5b6040516040810181811067ffffffffffffffff82111715614d9757614d97613d76565b6040528251614da58161407a565b81526020928301519281019290925250919050565b600060a08284031215614dcc57600080fd5b60405160a0810181811067ffffffffffffffff82111715614def57614def613d76565b806040525082518152602083015160208201526040830151614e108161407a565b60408201526060830151614e238161407a565b6060820152608092830151928101929092525091905056fea164736f6c6343000813000a", } var AutomationRegistryABI = AutomationRegistryMetaData.ABI diff --git a/core/gethwrappers/generated/automation_registry_wrapper_2_3/automation_registry_wrapper_2_3.go b/core/gethwrappers/generated/automation_registry_wrapper_2_3/automation_registry_wrapper_2_3.go index 1d460036fa0..97f0cfb113a 100644 --- a/core/gethwrappers/generated/automation_registry_wrapper_2_3/automation_registry_wrapper_2_3.go +++ b/core/gethwrappers/generated/automation_registry_wrapper_2_3/automation_registry_wrapper_2_3.go @@ -76,7 +76,7 @@ type AutomationRegistryBase23PaymentReceipt struct { var AutomationRegistryMetaData = &bind.MetaData{ ABI: "[{\"inputs\":[{\"internalType\":\"contractAutomationRegistryLogicA2_3\",\"name\":\"logicA\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"ArrayHasNoEntries\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"CannotCancel\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"CheckDataExceedsLimit\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ConfigDigestMismatch\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DuplicateEntry\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DuplicateSigners\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"GasLimitCanOnlyIncrease\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"GasLimitOutsideRange\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"IncorrectNumberOfFaultyOracles\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"IncorrectNumberOfSignatures\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"IncorrectNumberOfSigners\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"IndexOutOfRange\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"available\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"requested\",\"type\":\"uint256\"}],\"name\":\"InsufficientBalance\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InsufficientLinkLiquidity\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidDataLength\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidFeed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidPayee\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidRecipient\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidReport\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidSigner\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidToken\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidTransmitter\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidTrigger\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidTriggerType\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"MigrationNotPermitted\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"MustSettleOffchain\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"MustSettleOnchain\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotAContract\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyActiveSigners\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyActiveTransmitters\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCallableByAdmin\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCallableByLINKToken\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCallableByOwnerOrAdmin\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCallableByOwnerOrRegistrar\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCallableByPayee\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCallableByProposedAdmin\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCallableByProposedPayee\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCallableByUpkeepPrivilegeManager\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyFinanceAdmin\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyPausedUpkeep\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlySimulatedBackend\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyUnpausedUpkeep\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ParameterLengthError\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ReentrantCall\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RegistryPaused\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RepeatedSigner\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RepeatedTransmitter\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"reason\",\"type\":\"bytes\"}],\"name\":\"TargetCheckReverted\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TooManyOracles\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TranscoderNotSet\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TransferFailed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UpkeepAlreadyExists\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UpkeepCancelled\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UpkeepNotCanceled\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UpkeepNotNeeded\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ValueNotChanged\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddressNotAllowed\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"admin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"privilegeConfig\",\"type\":\"bytes\"}],\"name\":\"AdminPrivilegeConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"components\":[{\"internalType\":\"uint32\",\"name\":\"gasFeePPB\",\"type\":\"uint32\"},{\"internalType\":\"uint24\",\"name\":\"flatFeeMilliCents\",\"type\":\"uint24\"}],\"indexed\":false,\"internalType\":\"structAutomationRegistryBase2_3.BillingOverrides\",\"name\":\"overrides\",\"type\":\"tuple\"}],\"name\":\"BillingConfigOverridden\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"BillingConfigOverrideRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contractIERC20Metadata\",\"name\":\"token\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"uint32\",\"name\":\"gasFeePPB\",\"type\":\"uint32\"},{\"internalType\":\"uint24\",\"name\":\"flatFeeMilliCents\",\"type\":\"uint24\"},{\"internalType\":\"contractAggregatorV3Interface\",\"name\":\"priceFeed\",\"type\":\"address\"},{\"internalType\":\"uint8\",\"name\":\"decimals\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"fallbackPrice\",\"type\":\"uint256\"},{\"internalType\":\"uint96\",\"name\":\"minSpend\",\"type\":\"uint96\"}],\"indexed\":false,\"internalType\":\"structAutomationRegistryBase2_3.BillingConfig\",\"name\":\"config\",\"type\":\"tuple\"}],\"name\":\"BillingConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"trigger\",\"type\":\"bytes\"}],\"name\":\"CancelledUpkeepReport\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newModule\",\"type\":\"address\"}],\"name\":\"ChainSpecificModuleUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"previousConfigBlockNumber\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"configCount\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"signers\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"transmitters\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"f\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"onchainConfig\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"offchainConfigVersion\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"offchainConfig\",\"type\":\"bytes\"}],\"name\":\"ConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"dedupKey\",\"type\":\"bytes32\"}],\"name\":\"DedupKeyAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"assetAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"FeesWithdrawn\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"}],\"name\":\"FundsAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"FundsWithdrawn\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"trigger\",\"type\":\"bytes\"}],\"name\":\"InsufficientFundsUpkeepReport\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"payees\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"uint256[]\",\"name\":\"payments\",\"type\":\"uint256[]\"}],\"name\":\"NOPsSettledOffchain\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"Paused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"transmitters\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"payees\",\"type\":\"address[]\"}],\"name\":\"PayeesUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"transmitter\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"PayeeshipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"transmitter\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"PayeeshipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"transmitter\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"payee\",\"type\":\"address\"}],\"name\":\"PaymentWithdrawn\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"trigger\",\"type\":\"bytes\"}],\"name\":\"ReorgedUpkeepReport\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"trigger\",\"type\":\"bytes\"}],\"name\":\"StaleUpkeepReport\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"epoch\",\"type\":\"uint32\"}],\"name\":\"Transmitted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"Unpaused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"UpkeepAdminTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"UpkeepAdminTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"atBlockHeight\",\"type\":\"uint64\"}],\"name\":\"UpkeepCanceled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"components\":[{\"internalType\":\"uint96\",\"name\":\"gasChargeInBillingToken\",\"type\":\"uint96\"},{\"internalType\":\"uint96\",\"name\":\"premiumInBillingToken\",\"type\":\"uint96\"},{\"internalType\":\"uint96\",\"name\":\"gasReimbursementInJuels\",\"type\":\"uint96\"},{\"internalType\":\"uint96\",\"name\":\"premiumInJuels\",\"type\":\"uint96\"},{\"internalType\":\"contractIERC20Metadata\",\"name\":\"billingToken\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"linkUSD\",\"type\":\"uint96\"},{\"internalType\":\"uint96\",\"name\":\"nativeUSD\",\"type\":\"uint96\"},{\"internalType\":\"uint96\",\"name\":\"billingUSD\",\"type\":\"uint96\"}],\"indexed\":false,\"internalType\":\"structAutomationRegistryBase2_3.PaymentReceipt\",\"name\":\"receipt\",\"type\":\"tuple\"}],\"name\":\"UpkeepCharged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"newCheckData\",\"type\":\"bytes\"}],\"name\":\"UpkeepCheckDataSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"gasLimit\",\"type\":\"uint96\"}],\"name\":\"UpkeepGasLimitSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"remainingBalance\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"name\":\"UpkeepMigrated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"offchainConfig\",\"type\":\"bytes\"}],\"name\":\"UpkeepOffchainConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"UpkeepPaused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"bool\",\"name\":\"success\",\"type\":\"bool\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"totalPayment\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"gasUsed\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"gasOverhead\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"trigger\",\"type\":\"bytes\"}],\"name\":\"UpkeepPerformed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"privilegeConfig\",\"type\":\"bytes\"}],\"name\":\"UpkeepPrivilegeConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"startingBalance\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"importedFrom\",\"type\":\"address\"}],\"name\":\"UpkeepReceived\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"performGas\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"admin\",\"type\":\"address\"}],\"name\":\"UpkeepRegistered\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"triggerConfig\",\"type\":\"bytes\"}],\"name\":\"UpkeepTriggerConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"UpkeepUnpaused\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"fallbackTo\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestConfigDetails\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"configCount\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"blockNumber\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestConfigDigestAndEpoch\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"scanLogs\",\"type\":\"bool\"},{\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"internalType\":\"uint32\",\"name\":\"epoch\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"signers\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"transmitters\",\"type\":\"address[]\"},{\"internalType\":\"uint8\",\"name\":\"f\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"onchainConfigBytes\",\"type\":\"bytes\"},{\"internalType\":\"uint64\",\"name\":\"offchainConfigVersion\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"offchainConfig\",\"type\":\"bytes\"}],\"name\":\"setConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"signers\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"transmitters\",\"type\":\"address[]\"},{\"internalType\":\"uint8\",\"name\":\"f\",\"type\":\"uint8\"},{\"components\":[{\"internalType\":\"uint32\",\"name\":\"checkGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"maxPerformGas\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"maxCheckDataSize\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"transcoder\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"reorgProtectionEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint24\",\"name\":\"stalenessSeconds\",\"type\":\"uint24\"},{\"internalType\":\"uint32\",\"name\":\"maxPerformDataSize\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"maxRevertDataSize\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"upkeepPrivilegeManager\",\"type\":\"address\"},{\"internalType\":\"uint16\",\"name\":\"gasCeilingMultiplier\",\"type\":\"uint16\"},{\"internalType\":\"address\",\"name\":\"financeAdmin\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"fallbackGasPrice\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"fallbackLinkPrice\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"fallbackNativePrice\",\"type\":\"uint256\"},{\"internalType\":\"address[]\",\"name\":\"registrars\",\"type\":\"address[]\"},{\"internalType\":\"contractIChainModule\",\"name\":\"chainModule\",\"type\":\"address\"}],\"internalType\":\"structAutomationRegistryBase2_3.OnchainConfig\",\"name\":\"onchainConfig\",\"type\":\"tuple\"},{\"internalType\":\"uint64\",\"name\":\"offchainConfigVersion\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"offchainConfig\",\"type\":\"bytes\"},{\"internalType\":\"contractIERC20Metadata[]\",\"name\":\"billingTokens\",\"type\":\"address[]\"},{\"components\":[{\"internalType\":\"uint32\",\"name\":\"gasFeePPB\",\"type\":\"uint32\"},{\"internalType\":\"uint24\",\"name\":\"flatFeeMilliCents\",\"type\":\"uint24\"},{\"internalType\":\"contractAggregatorV3Interface\",\"name\":\"priceFeed\",\"type\":\"address\"},{\"internalType\":\"uint8\",\"name\":\"decimals\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"fallbackPrice\",\"type\":\"uint256\"},{\"internalType\":\"uint96\",\"name\":\"minSpend\",\"type\":\"uint96\"}],\"internalType\":\"structAutomationRegistryBase2_3.BillingConfig[]\",\"name\":\"billingConfigs\",\"type\":\"tuple[]\"}],\"name\":\"setConfigTypeSafe\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32[3]\",\"name\":\"reportContext\",\"type\":\"bytes32[3]\"},{\"internalType\":\"bytes\",\"name\":\"rawReport\",\"type\":\"bytes\"},{\"internalType\":\"bytes32[]\",\"name\":\"rs\",\"type\":\"bytes32[]\"},{\"internalType\":\"bytes32[]\",\"name\":\"ss\",\"type\":\"bytes32[]\"},{\"internalType\":\"bytes32\",\"name\":\"rawVs\",\"type\":\"bytes32\"}],\"name\":\"transmit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", - Bin: "0x6101806040523480156200001257600080fd5b506040516200651f3803806200651f83398101604081905262000035916200062f565b80816001600160a01b031663ca30e6036040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000075573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200009b91906200062f565b826001600160a01b031663226cf83c6040518163ffffffff1660e01b8152600401602060405180830381865afa158015620000da573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200010091906200062f565b836001600160a01b031663614486af6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156200013f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200016591906200062f565b846001600160a01b0316636709d0e56040518163ffffffff1660e01b8152600401602060405180830381865afa158015620001a4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001ca91906200062f565b856001600160a01b0316635425d8ac6040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000209573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200022f91906200062f565b866001600160a01b031663a08714c06040518163ffffffff1660e01b8152600401602060405180830381865afa1580156200026e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200029491906200062f565b876001600160a01b031663c5b964e06040518163ffffffff1660e01b8152600401602060405180830381865afa158015620002d3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620002f9919062000656565b886001600160a01b031663ac4dc59a6040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000338573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200035e91906200062f565b3380600081620003b55760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620003e857620003e8816200056b565b5050506001600160a01b0380891660805287811660a05286811660c05285811660e052848116610100528316610120526025805483919060ff19166001838181111562000439576200043962000679565b0217905550806001600160a01b0316610140816001600160a01b03168152505060c0516001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa1580156200049a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620004c091906200068f565b60ff1660a0516001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000504573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200052a91906200068f565b60ff16146200054c576040516301f86e1760e41b815260040160405180910390fd5b5050506001600160a01b039095166101605250620006b4945050505050565b336001600160a01b03821603620005c55760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c660000000000000000006044820152606401620003ac565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b6001600160a01b03811681146200062c57600080fd5b50565b6000602082840312156200064257600080fd5b81516200064f8162000616565b9392505050565b6000602082840312156200066957600080fd5b8151600281106200064f57600080fd5b634e487b7160e01b600052602160045260246000fd5b600060208284031215620006a257600080fd5b815160ff811681146200064f57600080fd5b60805160a05160c05160e05161010051610120516101405161016051615e07620007186000396000818160b30152610186015260005050600050506000505060005050600061379a015260005050600081816113710152612dc30152615e076000f3fe6080604052600436106100b15760003560e01c80638da5cb5b11610069578063b1dc65a41161004e578063b1dc65a4146102cb578063e3d0e712146102eb578063f2fde38b1461030b576100b1565b80638da5cb5b1461025a578063afcb95d714610285576100b1565b8063349e8cca1161009a578063349e8cca1461017757806379ba5097146101cb57806381ff7048146101e0576100b1565b80630870d3a1146100f8578063181f5a7714610118575b7f00000000000000000000000000000000000000000000000000000000000000003660008037600080366000845af43d6000803e8080156100f1573d6000f35b3d6000fd5b005b34801561010457600080fd5b506100f6610113366004614b7b565b61032b565b34801561012457600080fd5b506101616040518060400160405280601881526020017f4175746f6d6174696f6e526567697374727920322e332e30000000000000000081525081565b60405161016e9190614cf7565b60405180910390f35b34801561018357600080fd5b507f00000000000000000000000000000000000000000000000000000000000000005b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161016e565b3480156101d757600080fd5b506100f6610c0f565b3480156101ec57600080fd5b5061023760175460135463ffffffff74010000000000000000000000000000000000000000830481169378010000000000000000000000000000000000000000000000009093041691565b6040805163ffffffff94851681529390921660208401529082015260600161016e565b34801561026657600080fd5b5060005473ffffffffffffffffffffffffffffffffffffffff166101a6565b34801561029157600080fd5b50601354601454604080516000815260208101939093526c0100000000000000000000000090910463ffffffff169082015260600161016e565b3480156102d757600080fd5b506100f66102e6366004614d56565b610d11565b3480156102f757600080fd5b506100f6610306366004614e3b565b611051565b34801561031757600080fd5b506100f6610326366004614f08565b61108b565b61033361109f565b601f8851111561036f576040517f25d0209c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8560ff166000036103ac576040517fe77dba5600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b865188511415806103cb57506103c3866003614f54565b60ff16885111155b15610402576040517f1d2d1c5800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b805182511461043d576040517fcf54c06a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6104478282611122565b610451888861175a565b604051806101200160405280601460000160009054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff168152602001600063ffffffff1681526020018660a0015162ffffff16815260200186610120015161ffff1681526020018760ff168152602001601460000160169054906101000a900460ff1615158152602001601460000160179054906101000a900460ff1615158152602001866080015115158152602001866101e0015173ffffffffffffffffffffffffffffffffffffffff16815250601460008201518160000160006101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff160217905550602082015181600001600c6101000a81548163ffffffff021916908363ffffffff16021790555060408201518160000160106101000a81548162ffffff021916908362ffffff16021790555060608201518160000160136101000a81548161ffff021916908361ffff16021790555060808201518160000160156101000a81548160ff021916908360ff16021790555060a08201518160000160166101000a81548160ff02191690831515021790555060c08201518160000160176101000a81548160ff02191690831515021790555060e08201518160000160186101000a81548160ff0219169083151502179055506101008201518160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055509050506000601660010160189054906101000a900463ffffffff1690506000866101e0015173ffffffffffffffffffffffffffffffffffffffff166357e871e76040518163ffffffff1660e01b8152600401602060405180830381865afa158015610701573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107259190614f70565b6017549091506000906107579074010000000000000000000000000000000000000000900463ffffffff166001614f89565b9050604051806101600160405280896060015173ffffffffffffffffffffffffffffffffffffffff168152602001896000015163ffffffff168152602001896020015163ffffffff1681526020016016600001601c9054906101000a900463ffffffff1663ffffffff16815260200189610100015173ffffffffffffffffffffffffffffffffffffffff1681526020018263ffffffff1681526020018363ffffffff168152602001896040015163ffffffff16815260200189610140015173ffffffffffffffffffffffffffffffffffffffff1681526020018960c0015163ffffffff1681526020018960e0015163ffffffff16815250601660008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160000160146101000a81548163ffffffff021916908363ffffffff16021790555060408201518160000160186101000a81548163ffffffff021916908363ffffffff160217905550606082015181600001601c6101000a81548163ffffffff021916908363ffffffff16021790555060808201518160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060a08201518160010160146101000a81548163ffffffff021916908363ffffffff16021790555060c08201518160010160186101000a81548163ffffffff021916908363ffffffff16021790555060e082015181600101601c6101000a81548163ffffffff021916908363ffffffff1602179055506101008201518160020160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506101208201518160020160146101000a81548163ffffffff021916908363ffffffff1602179055506101408201518160020160186101000a81548163ffffffff021916908363ffffffff160217905550905050876101600151601981905550876101800151601a81905550876101a00151601b81905550600088604051602001610a9a9190614ff7565b604080518083037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0018152919052601754909150610aff904690309074010000000000000000000000000000000000000000900463ffffffff168f8f8f878f8f611e19565b6013556000610b0e6009611ec3565b90505b8015610b4b57610b38610b30610b2860018461517d565b600990611ed3565b600990611ee6565b5080610b4381615190565b915050610b11565b5060005b896101c0015151811015610ba257610b8f8a6101c001518281518110610b7757610b776151c5565b60200260200101516009611f0890919063ffffffff16565b5080610b9a816151f4565b915050610b4f565b507f1591690b8638f5fb2dbec82ac741805ac5da8b45dc5263f4875b0496fdce4e0584601354601660010160149054906101000a900463ffffffff168f8f8f878f8f604051610bf99998979695949392919061522c565b60405180910390a1505050505050505050505050565b60015473ffffffffffffffffffffffffffffffffffffffff163314610c95576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e65720000000000000000000060448201526064015b60405180910390fd5b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b60005a90506000610d238660406152c2565b610d2f896101446152d9565b610d3991906152d9565b9050368114610d74576040517fdfe9309000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60408051610120810182526014546bffffffffffffffffffffffff8116825263ffffffff6c01000000000000000000000000820416602083015262ffffff7001000000000000000000000000000000008204169282019290925261ffff730100000000000000000000000000000000000000830416606082015260ff75010000000000000000000000000000000000000000008304811660808301527601000000000000000000000000000000000000000000008304811615801560a08401527701000000000000000000000000000000000000000000000084048216151560c0840152780100000000000000000000000000000000000000000000000090930416151560e082015260155473ffffffffffffffffffffffffffffffffffffffff1661010082015290610ed3576040517f24522f3400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b336000908152600b602052604090205460ff16610f1c576040517f1099ed7500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6013548b3514610f58576040517fdfdcf8e700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6080810151610f689060016152ec565b60ff1687141580610f795750868514155b15610fb0576040517f0244f71a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610fc08b8b8b8b8b8b8b8b611f2a565b6000610fcc8b8b612193565b905060208c0135600881901c63ffffffff16610fe984848861224c565b836020015163ffffffff168163ffffffff16111561104157601480547fffffffffffffffffffffffffffffffff00000000ffffffffffffffffffffffff166c0100000000000000000000000063ffffffff8416021790555b5050505050505050505050505050565b60008060008580602001905181019061106a9190615472565b925092509250611080898989868989888861032b565b505050505050505050565b61109361109f565b61109c81612e39565b50565b60005473ffffffffffffffffffffffffffffffffffffffff163314611120576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e6572000000000000000000006044820152606401610c8c565b565b60005b6024548110156111e0576022600060248381548110611146576111466151c5565b600091825260208083209091015473ffffffffffffffffffffffffffffffffffffffff168352820192909252604001812080547fffffffff00000000000000000000000000000000000000000000000000000000168155600181019190915560020180547fffffffffffffffffffffffffffffffffffffffff000000000000000000000000169055806111d8816151f4565b915050611125565b506111ed602460006145cf565b60255460ff1660005b8351811015611754576000848281518110611213576112136151c5565b602002602001015190506000848381518110611231576112316151c5565b602002602001015190508173ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015611286573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112aa919061561d565b60ff16816060015160ff161415806113385750806040015173ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa15801561130c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611330919061561d565b60ff16600814155b1561136f576040517fc1ab6dc100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161480156113db575060018460018111156113d9576113d961563a565b145b15611412576040517fc1ab6dc100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8216158061144d5750604081015173ffffffffffffffffffffffffffffffffffffffff16155b15611484576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff828116600090815260226020526040902054670100000000000000900416156114ee576040517f357d0cc400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6024805460018181019092557f7cd332d19b93bcabe3cce7ca0c18a052f57e5fd03b4758a09f30f5ddc4b22ec401805473ffffffffffffffffffffffffffffffffffffffff8086167fffffffffffffffffffffffff0000000000000000000000000000000000000000909216821790925560008181526022602090815260409182902086518154928801518489015160608a015160ff167b01000000000000000000000000000000000000000000000000000000027fffffffff00ffffffffffffffffffffffffffffffffffffffffffffffffffffff9190981667010000000000000002167fffffffff000000000000000000000000000000000000000000ffffffffffffff62ffffff909216640100000000027fffffffffffffffffffffffffffffffffffffffffffffffffff0000000000000090951663ffffffff9093169290921793909317929092169190911793909317835560808501519383019390935560a0840151600290920180546bffffffffffffffffffffffff9093167fffffffffffffffffffffffffffffffffffffffff0000000000000000000000009093169290921790915590517fca93cbe727c73163ec538f71be6c0a64877d7f1f6dd35d5ca7cbaef3a3e34ba390611737908490600060c08201905063ffffffff835116825262ffffff602084015116602083015273ffffffffffffffffffffffffffffffffffffffff604084015116604083015260ff6060840151166060830152608083015160808301526bffffffffffffffffffffffff60a08401511660a083015292915050565b60405180910390a25050808061174c906151f4565b9150506111f6565b50505050565b600e546014546bffffffffffffffffffffffff1660005b600e548110156117cd576117ba600e8281548110611791576117916151c5565b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff168385612f2e565b50806117c5816151f4565b915050611771565b5060255460009060ff16815b600e5481101561193e57600e81815481106117f6576117f66151c5565b6000918252602082200154600d805473ffffffffffffffffffffffffffffffffffffffff9092169550600c929184908110611833576118336151c5565b600091825260208083209091015473ffffffffffffffffffffffffffffffffffffffff9081168452838201949094526040928301822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00001690559286168152600b909252902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905560018260018111156118d5576118d561563a565b14801561191a575073ffffffffffffffffffffffffffffffffffffffff83166000908152600b60205260409020546201000090046bffffffffffffffffffffffff1615155b1561192c5761192a600f84611f08565b505b80611936816151f4565b9150506117d9565b5061194b600d60006145cf565b611957600e60006145cf565b6040805160808101825260008082526020820181905291810182905260608101829052905b8751811015611de757600c600089838151811061199b5761199b6151c5565b60209081029190910181015173ffffffffffffffffffffffffffffffffffffffff1682528101919091526040016000205460ff1615611a06576040517f77cea0fa00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16888281518110611a3057611a306151c5565b602002602001015173ffffffffffffffffffffffffffffffffffffffff1603611a85576040517f815e1d6400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60405180604001604052806001151581526020018260ff16815250600c60008a8481518110611ab657611ab66151c5565b60209081029190910181015173ffffffffffffffffffffffffffffffffffffffff1682528181019290925260400160002082518154939092015160ff16610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff921515929092167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000909316929092171790558651879082908110611b5e57611b5e6151c5565b60200260200101519350600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1603611bce576040517f58a70a0a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff84166000908152600b60209081526040918290208251608081018452905460ff80821615801584526101008304909116938301939093526bffffffffffffffffffffffff6201000082048116948301949094526e01000000000000000000000000000090049092166060830152909250611c89576040517f6a7281ad00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600180835260ff80831660208086019182526014546bffffffffffffffffffffffff9081166060880190815273ffffffffffffffffffffffffffffffffffffffff8a166000908152600b909352604092839020885181549551948a0151925184166e010000000000000000000000000000027fffffffffffff000000000000000000000000ffffffffffffffffffffffffffff939094166201000002929092167fffffffffffff000000000000000000000000000000000000000000000000ffff94909616610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff921515929092167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000090951694909417179190911692909217919091179055836001811115611dc357611dc361563a565b03611dd557611dd3600f85611ee6565b505b80611ddf816151f4565b91505061197c565b508651611dfb90600d9060208a01906145ed565b508551611e0f90600e9060208901906145ed565b5050505050505050565b6000808a8a8a8a8a8a8a8a8a604051602001611e3d99989796959493929190615669565b604080518083037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe001815291905280516020909101207dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167e01000000000000000000000000000000000000000000000000000000000000179b9a5050505050505050505050565b6000611ecd825490565b92915050565b6000611edf8383613136565b9392505050565b6000611edf8373ffffffffffffffffffffffffffffffffffffffff8416613160565b6000611edf8373ffffffffffffffffffffffffffffffffffffffff841661325a565b60008787604051611f3c9291906156fe565b604051908190038120611f53918b9060200161570e565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815282825280516020918201208383019092526000808452908301819052909250906000805b8881101561212a57600185878360208110611fbf57611fbf6151c5565b611fcc91901a601b6152ec565b8c8c85818110611fde57611fde6151c5565b905060200201358b8b86818110611ff757611ff76151c5565b9050602002013560405160008152602001604052604051612034949392919093845260ff9290921660208401526040830152606082015260800190565b6020604051602081039080840390855afa158015612056573d6000803e3d6000fd5b5050604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081015173ffffffffffffffffffffffffffffffffffffffff81166000908152600c602090815290849020838501909452925460ff8082161515808552610100909204169383019390935290955093509050612104576040517f0f4c073700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b826020015160080260ff166001901b840193508080612122906151f4565b915050611fa2565b50827e01010101010101010101010101010101010101010101010101010101010101841614612185576040517fc103be2e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b505050505050505050505050565b6121cc6040518060c001604052806000815260200160008152602001606081526020016060815260200160608152602001606081525090565b60006121da838501856157ff565b60408101515160608201515191925090811415806121fd57508082608001515114155b8061220d5750808260a001515114155b15612244576040517fb55ac75400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b509392505050565b600082604001515167ffffffffffffffff81111561226c5761226c614684565b60405190808252806020026020018201604052801561233857816020015b6040805161020081018252600060e08201818152610100830182905261012083018290526101408301829052610160830182905261018083018290526101a083018290526101c083018290526101e0830182905282526020808301829052928201819052606082018190526080820181905260a0820181905260c082015282527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90920191018161228a5790505b50905060006040518060800160405280600061ffff16815260200160006bffffffffffffffffffffffff16815260200160006bffffffffffffffffffffffff16815260200160008152509050600085610100015173ffffffffffffffffffffffffffffffffffffffff166357e871e76040518163ffffffff1660e01b8152600401602060405180830381865afa1580156123d6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123fa9190614f70565b9050600086610100015173ffffffffffffffffffffffffffffffffffffffff166318b8f6136040518163ffffffff1660e01b8152600401602060405180830381865afa15801561244e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124729190614f70565b905060005b86604001515181101561290257600460008860400151838151811061249e5761249e6151c5565b6020908102919091018101518252818101929092526040908101600020815161012081018352815460ff8082161515835261010080830490911615159583019590955263ffffffff620100008204811694830194909452660100000000000081048416606083015273ffffffffffffffffffffffffffffffffffffffff6a01000000000000000000009091048116608083015260018301546fffffffffffffffffffffffffffffffff811660a08401526bffffffffffffffffffffffff70010000000000000000000000000000000082041660c08401527c0100000000000000000000000000000000000000000000000000000000900490931660e08201526002909101549091169181019190915285518690839081106125c1576125c16151c5565b6020026020010151600001819052506125f6876040015182815181106125e9576125e96151c5565b60200260200101516132a9565b858281518110612608576126086151c5565b60200260200101516060019060018111156126255761262561563a565b908160018111156126385761263861563a565b8152505061269c87604001518281518110612655576126556151c5565b60200260200101518489608001518481518110612674576126746151c5565b602002602001015188858151811061268e5761268e6151c5565b60200260200101518c613354565b8683815181106126ae576126ae6151c5565b60200260200101516020018784815181106126cb576126cb6151c5565b602002602001015160c00182815250821515151581525050508481815181106126f6576126f66151c5565b602002602001015160200151156127265760018460000181815161271a91906158ec565b61ffff1690525061272b565b6128f0565b612791858281518110612740576127406151c5565b6020026020010151600001516080015188606001518381518110612766576127666151c5565b60200260200101518960a001518481518110612784576127846151c5565b6020026020010151613473565b8683815181106127a3576127a36151c5565b60200260200101516040018784815181106127c0576127c06151c5565b60200260200101516080018281525082151515158152505050876080015160016127ea91906152ec565b6127f89060ff1660406152c2565b6103a48860a001518381518110612811576128116151c5565b60200260200101515161282491906152d9565b61282e91906152d9565b858281518110612840576128406151c5565b602002602001015160a0018181525050848181518110612862576128626151c5565b602002602001015160a001518460600181815161287f91906152d9565b9052508451859082908110612896576128966151c5565b602002602001015160800151866128ad919061517d565b95506128f0876040015182815181106128c8576128c86151c5565b6020026020010151848784815181106128e3576128e36151c5565b602002602001015161368e565b806128fa816151f4565b915050612477565b50825161ffff166000036129195750505050505050565b61c8006129273660106152c2565b5a612932908861517d565b61293c91906152d9565b61294691906152d9565b83519095506137789061295d9061ffff1687615936565b61296791906152d9565b604080516080810182526000808252602082018190529181018290526060810182905291965061299689613793565b905060005b886040015151811015612cd2578681815181106129ba576129ba6151c5565b60200260200101516020015115612cc057801580612a525750866129df60018361517d565b815181106129ef576129ef6151c5565b602002602001015160000151610100015173ffffffffffffffffffffffffffffffffffffffff16878281518110612a2857612a286151c5565b602002602001015160000151610100015173ffffffffffffffffffffffffffffffffffffffff1614155b15612a8657612a838a888381518110612a6d57612a6d6151c5565b602002602001015160000151610100015161387d565b92505b6000612ba48b6040518061012001604052808b8681518110612aaa57612aaa6151c5565b60200260200101516080015181526020018c81526020018a606001518c8781518110612ad857612ad86151c5565b602002602001015160a001518a612aef91906152c2565b612af99190615936565b81526020018d6000015181526020018d6020015181526020018681526020018b8681518110612b2a57612b2a6151c5565b602002602001015160000151610100015173ffffffffffffffffffffffffffffffffffffffff168152602001878152602001600115158152508c604001518581518110612b7957612b796151c5565b60200260200101518b8681518110612b9357612b936151c5565b6020026020010151600001516139f9565b9050806060015187604001818151612bbc919061594a565b6bffffffffffffffffffffffff169052506040810151602088018051612be390839061594a565b6bffffffffffffffffffffffff169052508751889083908110612c0857612c086151c5565b60200260200101516040015115158a604001518381518110612c2c57612c2c6151c5565b60200260200101517fad8cc9579b21dfe2c2f6ea35ba15b656e46b4f5b0cb424f52739b8ce5cac9c5b83602001518460000151612c69919061594a565b8b8681518110612c7b57612c7b6151c5565b6020026020010151608001518d8f608001518881518110612c9e57612c9e6151c5565b6020026020010151604051612cb6949392919061596f565b60405180910390a3505b80612cca816151f4565b91505061299b565b505050602083810151336000908152600b90925260409091208054600290612d0f9084906201000090046bffffffffffffffffffffffff1661594a565b92506101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055508260400151601460000160008282829054906101000a90046bffffffffffffffffffffffff16612d6d919061594a565b92506101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff16021790555082604001518360200151612daf919061594a565b6bffffffffffffffffffffffff16602160007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254612e2b91906152d9565b909155505050505050505050565b3373ffffffffffffffffffffffffffffffffffffffff821603612eb8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c660000000000000000006044820152606401610c8c565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b73ffffffffffffffffffffffffffffffffffffffff83166000908152600b602090815260408083208151608081018352905460ff80821615801584526101008304909116948301949094526bffffffffffffffffffffffff6201000082048116938301939093526e010000000000000000000000000000900490911660608201529061312a576000816060015185612fc691906159ac565b90506000612fd485836159d1565b90508083604001818151612fe8919061594a565b6bffffffffffffffffffffffff1690525061300385826159fc565b83606001818151613014919061594a565b6bffffffffffffffffffffffff90811690915273ffffffffffffffffffffffffffffffffffffffff89166000908152600b602090815260409182902087518154928901519389015160608a015186166e010000000000000000000000000000027fffffffffffff000000000000000000000000ffffffffffffffffffffffffffff919096166201000002167fffffffffffff000000000000000000000000000000000000000000000000ffff60ff95909516610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff921515929092167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000909416939093171792909216179190911790555050505b60400151949350505050565b600082600001828154811061314d5761314d6151c5565b9060005260206000200154905092915050565b6000818152600183016020526040812054801561324957600061318460018361517d565b85549091506000906131989060019061517d565b90508181146131fd5760008660000182815481106131b8576131b86151c5565b90600052602060002001549050808760000184815481106131db576131db6151c5565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061320e5761320e615a2c565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050611ecd565b6000915050611ecd565b5092915050565b60008181526001830160205260408120546132a157508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155611ecd565b506000611ecd565b6000818160045b600f811015613336577fff0000000000000000000000000000000000000000000000000000000000000082168382602081106132ee576132ee6151c5565b1a60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161461332457506000949350505050565b8061332e816151f4565b9150506132b0565b5081600f1a600181111561334c5761334c61563a565b949350505050565b60008080808560600151600181111561336f5761336f61563a565b03613395576133818888888888613e68565b61339057600092509050613469565b61340d565b6001856060015160018111156133ad576133ad61563a565b036133db5760006133c089898988613ff2565b92509050806133d55750600092509050613469565b5061340d565b6040517ff2b2d41200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b84516060015163ffffffff16871061346257877fc3237c8807c467c1b39b8d0395eff077313e691bf0a7388106792564ebfd56368760405161344f9190614cf7565b60405180910390a2600092509050613469565b6001925090505b9550959350505050565b601454600090819077010000000000000000000000000000000000000000000000900460ff16156134d0576040517f37ed32e800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b601480547fffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffffffff16770100000000000000000000000000000000000000000000001790556040517f4585e33b0000000000000000000000000000000000000000000000000000000090613545908590602401614cf7565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff000000000000000000000000000000000000000000000000000000009094169390931790925290517f79188d1600000000000000000000000000000000000000000000000000000000815290935073ffffffffffffffffffffffffffffffffffffffff8616906379188d16906136189087908790600401615a5b565b60408051808303816000875af1158015613636573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061365a9190615a74565b601480547fffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffffffff16905590969095509350505050565b6000816060015160018111156136a6576136a661563a565b0361370a57600083815260046020526040902060010180547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167c010000000000000000000000000000000000000000000000000000000063ffffffff851602179055505050565b6001816060015160018111156137225761372261563a565b0361378e5760c08101805160009081526008602052604080822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055915191517fa4a4e334c0e330143f9437484fe516c13bc560b86b5b0daf58e7084aaac228f29190a25b505050565b60008060007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663feaf968c6040518163ffffffff1660e01b815260040160a060405180830381865afa158015613803573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906138279190615abc565b5093505092505060008213158061383d57508042105b8061386d57506000846040015162ffffff1611801561386d5750613861814261517d565b846040015162ffffff16105b15613253575050601b5492915050565b60408051608081018252600080825260208083018281528385018381526060850184905273ffffffffffffffffffffffffffffffffffffffff878116855260229093528584208054640100000000810462ffffff1690925263ffffffff82169092527b01000000000000000000000000000000000000000000000000000000810460ff16855285517ffeaf968c00000000000000000000000000000000000000000000000000000000815295519495919484936701000000000000009092049091169163feaf968c9160048083019260a09291908290030181865afa15801561396a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061398e9190615abc565b509350509250506000821315806139a457508042105b806139d457506000866040015162ffffff161180156139d457506139c8814261517d565b866040015162ffffff16105b156139e857600183015460608501526139f0565b606084018290525b50505092915050565b604080516101008101825260008082526020808301829052928201819052606082018190526080820181905260a0820181905260c0820181905260e08201529082015115613a8f5760008381526023602090815260409182902082518084018452905463ffffffff811680835262ffffff640100000000909204821692840192835260e089018051909401529051915191169101525b6000613a9b86866141ff565b60c0840151602082015182519293509091600091613ab89161594a565b60e08801515190915060ff16600060128210613ad5576001613aeb565b613ae082601261517d565b613aeb90600a615c2c565b9050600060128311613afe576001613b14565b613b0960128461517d565b613b1490600a615c2c565b905085600001516bffffffffffffffffffffffff16856bffffffffffffffffffffffff161015613bbc57849350613b90818b60800151613b5491906152c2565b838c60e0015160600151886bffffffffffffffffffffffff16613b7791906152c2565b613b8191906152c2565b613b8b9190615936565b61452d565b6bffffffffffffffffffffffff9081166040880152600060608801819052602088015285168652613ce2565b836bffffffffffffffffffffffff16856bffffffffffffffffffffffff161015613ce257849350613c4a86604001516bffffffffffffffffffffffff16828c60800151613c0991906152c2565b848d60e0015160600151896bffffffffffffffffffffffff16613c2c91906152c2565b613c3691906152c2565b613c409190615936565b613b8b919061517d565b6bffffffffffffffffffffffff1660608088019190915260e08b01510151613cce90613c779084906152c2565b6001848d60e0015160600151613c8d91906152c2565b613c97919061517d565b838d608001518a606001516bffffffffffffffffffffffff16613cba91906152c2565b613cc491906152c2565b613b8191906152d9565b6bffffffffffffffffffffffff1660208701525b60008981526004602052604090206001018054859190601090613d2890849070010000000000000000000000000000000090046bffffffffffffffffffffffff166159ac565b82546101009290920a6bffffffffffffffffffffffff81810219909316918316021790915560008b81526004602052604081206001018054928816935091613d839084906fffffffffffffffffffffffffffffffff16615c38565b92506101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff160217905550836bffffffffffffffffffffffff16602160008c60c0015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254613e1a919061517d565b92505081905550887f801ba6ed51146ffe3e99d1dbd9dd0f4de6292e78a9a34c39c0183de17b3f40fc87604051613e519190615c61565b60405180910390a250939998505050505050505050565b60008084806020019051810190613e7f9190615d21565b845160e00151815191925063ffffffff90811691161015613edc57867f405288ea7be309e16cfdf481367f90a413e1d4634fcdaf8966546db9b93012e886604051613eca9190614cf7565b60405180910390a26000915050613fe9565b8260e001518015613f9c5750602081015115801590613f9c5750602081015161010084015182516040517f85df51fd00000000000000000000000000000000000000000000000000000000815263ffffffff909116600482015273ffffffffffffffffffffffffffffffffffffffff909116906385df51fd90602401602060405180830381865afa158015613f75573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613f999190614f70565b14155b80613fae5750805163ffffffff168611155b15613fe357867f6aa7f60c176da7af894b384daea2249497448137f5943c1237ada8bc92bdc30186604051613eca9190614cf7565b60019150505b95945050505050565b60008060008480602001905181019061400b9190615d79565b905060008782600001518360200151846040015160405160200161406d94939291909384526020840192909252604083015260e01b7fffffffff0000000000000000000000000000000000000000000000000000000016606082015260640190565b6040516020818303038152906040528051906020012090508460e00151801561414857506080820151158015906141485750608082015161010086015160608401516040517f85df51fd00000000000000000000000000000000000000000000000000000000815263ffffffff909116600482015273ffffffffffffffffffffffffffffffffffffffff909116906385df51fd90602401602060405180830381865afa158015614121573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906141459190614f70565b14155b8061415d575086826060015163ffffffff1610155b156141a757877f6aa7f60c176da7af894b384daea2249497448137f5943c1237ada8bc92bdc301876040516141929190614cf7565b60405180910390a26000935091506141f69050565b60008181526008602052604090205460ff16156141ee57877f405288ea7be309e16cfdf481367f90a413e1d4634fcdaf8966546db9b93012e8876040516141929190614cf7565b600193509150505b94509492505050565b6040805161010081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e081019190915260008260e001516000015160ff1690506000846060015161ffff16846060015161426a91906152c2565b9050836101000151801561427d5750803a105b1561428557503a5b6000601283116142965760016142ac565b6142a160128461517d565b6142ac90600a615c2c565b90506000601284106142bf5760016142d5565b6142ca84601261517d565b6142d590600a615c2c565b905060008660a001518760400151886020015189600001516142f791906152d9565b61430190876152c2565b61430b91906152d9565b61431591906152c2565b9050614358828860e001516060015161432e91906152c2565b6001848a60e001516060015161434491906152c2565b61434e919061517d565b613cc486856152c2565b6bffffffffffffffffffffffff168652608087015161437b90613b8b9083615936565b6bffffffffffffffffffffffff1660408088019190915260e088015101516000906143b49062ffffff16683635c9adc5dea000006152c2565b9050600081633b9aca008a60a001518b60e001516020015163ffffffff168c604001518d600001518b6143e791906152c2565b6143f191906152d9565b6143fb91906152c2565b61440591906152c2565b61440f9190615936565b61441991906152d9565b905061445c848a60e001516060015161443291906152c2565b6001868c60e001516060015161444891906152c2565b614452919061517d565b613cc488856152c2565b6bffffffffffffffffffffffff166020890152608089015161448290613b8b9083615936565b6bffffffffffffffffffffffff16606089015260c089015173ffffffffffffffffffffffffffffffffffffffff166080808a01919091528901516144c59061452d565b6bffffffffffffffffffffffff1660a0808a01919091528901516144e89061452d565b6bffffffffffffffffffffffff1660c089015260e08901516060015161450d9061452d565b6bffffffffffffffffffffffff1660e08901525050505050505092915050565b60006bffffffffffffffffffffffff8211156145cb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203960448201527f36206269747300000000000000000000000000000000000000000000000000006064820152608401610c8c565b5090565b508054600082559060005260206000209081019061109c919061466f565b828054828255906000526020600020908101928215614667579160200282015b8281111561466757825182547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff90911617825560209092019160019091019061460d565b506145cb9291505b5b808211156145cb5760008155600101614670565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051610200810167ffffffffffffffff811182821017156146d7576146d7614684565b60405290565b60405160c0810167ffffffffffffffff811182821017156146d7576146d7614684565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff8111828210171561474757614747614684565b604052919050565b600067ffffffffffffffff82111561476957614769614684565b5060051b60200190565b73ffffffffffffffffffffffffffffffffffffffff8116811461109c57600080fd5b80356147a081614773565b919050565b600082601f8301126147b657600080fd5b813560206147cb6147c68361474f565b614700565b82815260059290921b840181019181810190868411156147ea57600080fd5b8286015b8481101561480e57803561480181614773565b83529183019183016147ee565b509695505050505050565b60ff8116811461109c57600080fd5b80356147a081614819565b63ffffffff8116811461109c57600080fd5b80356147a081614833565b801515811461109c57600080fd5b80356147a081614850565b62ffffff8116811461109c57600080fd5b80356147a081614869565b61ffff8116811461109c57600080fd5b80356147a081614885565b600061020082840312156148b357600080fd5b6148bb6146b3565b90506148c682614845565b81526148d460208301614845565b60208201526148e560408301614845565b60408201526148f660608301614795565b60608201526149076080830161485e565b608082015261491860a0830161487a565b60a082015261492960c08301614845565b60c082015261493a60e08301614845565b60e082015261010061494d818401614795565b9082015261012061495f838201614895565b90820152610140614971838201614795565b90820152610160828101359082015261018080830135908201526101a080830135908201526101c08083013567ffffffffffffffff8111156149b257600080fd5b6149be858286016147a5565b8284015250506101e06149d2818401614795565b9082015292915050565b803567ffffffffffffffff811681146147a057600080fd5b600082601f830112614a0557600080fd5b813567ffffffffffffffff811115614a1f57614a1f614684565b614a5060207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f84011601614700565b818152846020838601011115614a6557600080fd5b816020850160208301376000918101602001919091529392505050565b6bffffffffffffffffffffffff8116811461109c57600080fd5b600082601f830112614aad57600080fd5b81356020614abd6147c68361474f565b82815260c09283028501820192828201919087851115614adc57600080fd5b8387015b85811015614b6e5781818a031215614af85760008081fd5b614b006146dd565b8135614b0b81614833565b815281860135614b1a81614869565b81870152604082810135614b2d81614773565b90820152606082810135614b4081614819565b908201526080828101359082015260a080830135614b5d81614a82565b908201528452928401928101614ae0565b5090979650505050505050565b600080600080600080600080610100898b031215614b9857600080fd5b883567ffffffffffffffff80821115614bb057600080fd5b614bbc8c838d016147a5565b995060208b0135915080821115614bd257600080fd5b614bde8c838d016147a5565b9850614bec60408c01614828565b975060608b0135915080821115614c0257600080fd5b614c0e8c838d016148a0565b9650614c1c60808c016149dc565b955060a08b0135915080821115614c3257600080fd5b614c3e8c838d016149f4565b945060c08b0135915080821115614c5457600080fd5b614c608c838d016147a5565b935060e08b0135915080821115614c7657600080fd5b50614c838b828c01614a9c565b9150509295985092959890939650565b6000815180845260005b81811015614cb957602081850181015186830182015201614c9d565b5060006020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b602081526000611edf6020830184614c93565b60008083601f840112614d1c57600080fd5b50813567ffffffffffffffff811115614d3457600080fd5b6020830191508360208260051b8501011115614d4f57600080fd5b9250929050565b60008060008060008060008060e0898b031215614d7257600080fd5b606089018a811115614d8357600080fd5b8998503567ffffffffffffffff80821115614d9d57600080fd5b818b0191508b601f830112614db157600080fd5b813581811115614dc057600080fd5b8c6020828501011115614dd257600080fd5b6020830199508098505060808b0135915080821115614df057600080fd5b614dfc8c838d01614d0a565b909750955060a08b0135915080821115614e1557600080fd5b50614e228b828c01614d0a565b999c989b50969995989497949560c00135949350505050565b60008060008060008060c08789031215614e5457600080fd5b863567ffffffffffffffff80821115614e6c57600080fd5b614e788a838b016147a5565b97506020890135915080821115614e8e57600080fd5b614e9a8a838b016147a5565b9650614ea860408a01614828565b95506060890135915080821115614ebe57600080fd5b614eca8a838b016149f4565b9450614ed860808a016149dc565b935060a0890135915080821115614eee57600080fd5b50614efb89828a016149f4565b9150509295509295509295565b600060208284031215614f1a57600080fd5b8135611edf81614773565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60ff818116838216029081169081811461325357613253614f25565b600060208284031215614f8257600080fd5b5051919050565b63ffffffff81811683821601908082111561325357613253614f25565b600081518084526020808501945080840160005b83811015614fec57815173ffffffffffffffffffffffffffffffffffffffff1687529582019590820190600101614fba565b509495945050505050565b6020815261500e60208201835163ffffffff169052565b60006020830151615027604084018263ffffffff169052565b50604083015163ffffffff8116606084015250606083015173ffffffffffffffffffffffffffffffffffffffff8116608084015250608083015180151560a08401525060a083015162ffffff811660c08401525060c083015163ffffffff811660e08401525060e08301516101006150a68185018363ffffffff169052565b84015190506101206150cf8482018373ffffffffffffffffffffffffffffffffffffffff169052565b84015190506101406150e68482018361ffff169052565b840151905061016061510f8482018373ffffffffffffffffffffffffffffffffffffffff169052565b840151610180848101919091528401516101a0808501919091528401516101c0808501919091528401516102006101e080860182905291925090615157610220860184614fa6565b95015173ffffffffffffffffffffffffffffffffffffffff169301929092525090919050565b81810381811115611ecd57611ecd614f25565b60008161519f5761519f614f25565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361522557615225614f25565b5060010190565b600061012063ffffffff808d1684528b6020850152808b1660408501525080606084015261525c8184018a614fa6565b905082810360808401526152708189614fa6565b905060ff871660a084015282810360c084015261528d8187614c93565b905067ffffffffffffffff851660e08401528281036101008401526152b28185614c93565b9c9b505050505050505050505050565b8082028115828204841417611ecd57611ecd614f25565b80820180821115611ecd57611ecd614f25565b60ff8181168382160190811115611ecd57611ecd614f25565b80516147a081614833565b80516147a081614773565b80516147a081614850565b80516147a081614869565b80516147a081614885565b600082601f83011261534d57600080fd5b8151602061535d6147c68361474f565b82815260059290921b8401810191818101908684111561537c57600080fd5b8286015b8481101561480e57805161539381614773565b8352918301918301615380565b600082601f8301126153b157600080fd5b815160206153c16147c68361474f565b82815260c092830285018201928282019190878511156153e057600080fd5b8387015b85811015614b6e5781818a0312156153fc5760008081fd5b6154046146dd565b815161540f81614833565b81528186015161541e81614869565b8187015260408281015161543181614773565b9082015260608281015161544481614819565b908201526080828101519082015260a08083015161546181614a82565b9082015284529284019281016153e4565b60008060006060848603121561548757600080fd5b835167ffffffffffffffff8082111561549f57600080fd5b9085019061020082880312156154b457600080fd5b6154bc6146b3565b6154c583615305565b81526154d360208401615305565b60208201526154e460408401615305565b60408201526154f560608401615310565b60608201526155066080840161531b565b608082015261551760a08401615326565b60a082015261552860c08401615305565b60c082015261553960e08401615305565b60e082015261010061554c818501615310565b9082015261012061555e848201615331565b90820152610140615570848201615310565b90820152610160838101519082015261018080840151908201526101a080840151908201526101c080840151838111156155a957600080fd5b6155b58a82870161533c565b8284015250506101e06155c9818501615310565b9082015260208701519095509150808211156155e457600080fd5b6155f08783880161533c565b9350604086015191508082111561560657600080fd5b50615613868287016153a0565b9150509250925092565b60006020828403121561562f57600080fd5b8151611edf81614819565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b60006101208b835273ffffffffffffffffffffffffffffffffffffffff8b16602084015267ffffffffffffffff808b1660408501528160608501526156b08285018b614fa6565b915083820360808501526156c4828a614fa6565b915060ff881660a085015283820360c08501526156e18288614c93565b90861660e085015283810361010085015290506152b28185614c93565b8183823760009101908152919050565b8281526080810160608360208401379392505050565b600082601f83011261573557600080fd5b813560206157456147c68361474f565b82815260059290921b8401810191818101908684111561576457600080fd5b8286015b8481101561480e5780358352918301918301615768565b600082601f83011261579057600080fd5b813560206157a06147c68361474f565b82815260059290921b840181019181810190868411156157bf57600080fd5b8286015b8481101561480e57803567ffffffffffffffff8111156157e35760008081fd5b6157f18986838b01016149f4565b8452509183019183016157c3565b60006020828403121561581157600080fd5b813567ffffffffffffffff8082111561582957600080fd5b9083019060c0828603121561583d57600080fd5b6158456146dd565b823581526020830135602082015260408301358281111561586557600080fd5b61587187828601615724565b60408301525060608301358281111561588957600080fd5b61589587828601615724565b6060830152506080830135828111156158ad57600080fd5b6158b98782860161577f565b60808301525060a0830135828111156158d157600080fd5b6158dd8782860161577f565b60a08301525095945050505050565b61ffff81811683821601908082111561325357613253614f25565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60008261594557615945615907565b500490565b6bffffffffffffffffffffffff81811683821601908082111561325357613253614f25565b6bffffffffffffffffffffffff851681528360208201528260408201526080606082015260006159a26080830184614c93565b9695505050505050565b6bffffffffffffffffffffffff82811682821603908082111561325357613253614f25565b60006bffffffffffffffffffffffff808416806159f0576159f0615907565b92169190910492915050565b6bffffffffffffffffffffffff818116838216028082169190828114615a2457615a24614f25565b505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b82815260406020820152600061334c6040830184614c93565b60008060408385031215615a8757600080fd5b8251615a9281614850565b6020939093015192949293505050565b805169ffffffffffffffffffff811681146147a057600080fd5b600080600080600060a08688031215615ad457600080fd5b615add86615aa2565b9450602086015193506040860151925060608601519150615b0060808701615aa2565b90509295509295909350565b600181815b80851115615b6557817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04821115615b4b57615b4b614f25565b80851615615b5857918102915b93841c9390800290615b11565b509250929050565b600082615b7c57506001611ecd565b81615b8957506000611ecd565b8160018114615b9f5760028114615ba957615bc5565b6001915050611ecd565b60ff841115615bba57615bba614f25565b50506001821b611ecd565b5060208310610133831016604e8410600b8410161715615be8575081810a611ecd565b615bf28383615b0c565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04821115615c2457615c24614f25565b029392505050565b6000611edf8383615b6d565b6fffffffffffffffffffffffffffffffff81811683821601908082111561325357613253614f25565b6000610100820190506bffffffffffffffffffffffff8084511683528060208501511660208401528060408501511660408401528060608501511660608401525073ffffffffffffffffffffffffffffffffffffffff608084015116608083015260a0830151615ce160a08401826bffffffffffffffffffffffff169052565b5060c0830151615d0160c08401826bffffffffffffffffffffffff169052565b5060e083015161325360e08401826bffffffffffffffffffffffff169052565b600060408284031215615d3357600080fd5b6040516040810181811067ffffffffffffffff82111715615d5657615d56614684565b6040528251615d6481614833565b81526020928301519281019290925250919050565b600060a08284031215615d8b57600080fd5b60405160a0810181811067ffffffffffffffff82111715615dae57615dae614684565b806040525082518152602083015160208201526040830151615dcf81614833565b60408201526060830151615de281614833565b6060820152608092830151928101929092525091905056fea164736f6c6343000813000a", + Bin: "0x6101806040523480156200001257600080fd5b50604051620065423803806200654283398101604081905262000035916200062f565b80816001600160a01b031663ca30e6036040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000075573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200009b91906200062f565b826001600160a01b031663226cf83c6040518163ffffffff1660e01b8152600401602060405180830381865afa158015620000da573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200010091906200062f565b836001600160a01b031663614486af6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156200013f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200016591906200062f565b846001600160a01b0316636709d0e56040518163ffffffff1660e01b8152600401602060405180830381865afa158015620001a4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001ca91906200062f565b856001600160a01b0316635425d8ac6040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000209573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200022f91906200062f565b866001600160a01b031663a08714c06040518163ffffffff1660e01b8152600401602060405180830381865afa1580156200026e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200029491906200062f565b876001600160a01b031663c5b964e06040518163ffffffff1660e01b8152600401602060405180830381865afa158015620002d3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620002f9919062000656565b886001600160a01b031663ac4dc59a6040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000338573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200035e91906200062f565b3380600081620003b55760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620003e857620003e8816200056b565b5050506001600160a01b0380891660805287811660a05286811660c05285811660e052848116610100528316610120526025805483919060ff19166001838181111562000439576200043962000679565b0217905550806001600160a01b0316610140816001600160a01b03168152505060c0516001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa1580156200049a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620004c091906200068f565b60ff1660a0516001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000504573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200052a91906200068f565b60ff16146200054c576040516301f86e1760e41b815260040160405180910390fd5b5050506001600160a01b039095166101605250620006b4945050505050565b336001600160a01b03821603620005c55760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c660000000000000000006044820152606401620003ac565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b6001600160a01b03811681146200062c57600080fd5b50565b6000602082840312156200064257600080fd5b81516200064f8162000616565b9392505050565b6000602082840312156200066957600080fd5b8151600281106200064f57600080fd5b634e487b7160e01b600052602160045260246000fd5b600060208284031215620006a257600080fd5b815160ff811681146200064f57600080fd5b60805160a05160c05160e05161010051610120516101405161016051615e2a620007186000396000818160b3015261018601526000505060005050600050506000505060006137bd015260005050600081816113710152612de60152615e2a6000f3fe6080604052600436106100b15760003560e01c80638da5cb5b11610069578063b1dc65a41161004e578063b1dc65a4146102cb578063e3d0e712146102eb578063f2fde38b1461030b576100b1565b80638da5cb5b1461025a578063afcb95d714610285576100b1565b8063349e8cca1161009a578063349e8cca1461017757806379ba5097146101cb57806381ff7048146101e0576100b1565b80630870d3a1146100f8578063181f5a7714610118575b7f00000000000000000000000000000000000000000000000000000000000000003660008037600080366000845af43d6000803e8080156100f1573d6000f35b3d6000fd5b005b34801561010457600080fd5b506100f6610113366004614b9e565b61032b565b34801561012457600080fd5b506101616040518060400160405280601881526020017f4175746f6d6174696f6e526567697374727920322e332e30000000000000000081525081565b60405161016e9190614d1a565b60405180910390f35b34801561018357600080fd5b507f00000000000000000000000000000000000000000000000000000000000000005b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161016e565b3480156101d757600080fd5b506100f6610c0f565b3480156101ec57600080fd5b5061023760175460135463ffffffff74010000000000000000000000000000000000000000830481169378010000000000000000000000000000000000000000000000009093041691565b6040805163ffffffff94851681529390921660208401529082015260600161016e565b34801561026657600080fd5b5060005473ffffffffffffffffffffffffffffffffffffffff166101a6565b34801561029157600080fd5b50601354601454604080516000815260208101939093526c0100000000000000000000000090910463ffffffff169082015260600161016e565b3480156102d757600080fd5b506100f66102e6366004614d79565b610d11565b3480156102f757600080fd5b506100f6610306366004614e5e565b611051565b34801561031757600080fd5b506100f6610326366004614f2b565b61108b565b61033361109f565b601f8851111561036f576040517f25d0209c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8560ff166000036103ac576040517fe77dba5600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b865188511415806103cb57506103c3866003614f77565b60ff16885111155b15610402576040517f1d2d1c5800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b805182511461043d576040517fcf54c06a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6104478282611122565b610451888861175a565b604051806101200160405280601460000160009054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff168152602001600063ffffffff1681526020018660a0015162ffffff16815260200186610120015161ffff1681526020018760ff168152602001601460000160169054906101000a900460ff1615158152602001601460000160179054906101000a900460ff1615158152602001866080015115158152602001866101e0015173ffffffffffffffffffffffffffffffffffffffff16815250601460008201518160000160006101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff160217905550602082015181600001600c6101000a81548163ffffffff021916908363ffffffff16021790555060408201518160000160106101000a81548162ffffff021916908362ffffff16021790555060608201518160000160136101000a81548161ffff021916908361ffff16021790555060808201518160000160156101000a81548160ff021916908360ff16021790555060a08201518160000160166101000a81548160ff02191690831515021790555060c08201518160000160176101000a81548160ff02191690831515021790555060e08201518160000160186101000a81548160ff0219169083151502179055506101008201518160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055509050506000601660010160189054906101000a900463ffffffff1690506000866101e0015173ffffffffffffffffffffffffffffffffffffffff166357e871e76040518163ffffffff1660e01b8152600401602060405180830381865afa158015610701573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107259190614f93565b6017549091506000906107579074010000000000000000000000000000000000000000900463ffffffff166001614fac565b9050604051806101600160405280896060015173ffffffffffffffffffffffffffffffffffffffff168152602001896000015163ffffffff168152602001896020015163ffffffff1681526020016016600001601c9054906101000a900463ffffffff1663ffffffff16815260200189610100015173ffffffffffffffffffffffffffffffffffffffff1681526020018263ffffffff1681526020018363ffffffff168152602001896040015163ffffffff16815260200189610140015173ffffffffffffffffffffffffffffffffffffffff1681526020018960c0015163ffffffff1681526020018960e0015163ffffffff16815250601660008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160000160146101000a81548163ffffffff021916908363ffffffff16021790555060408201518160000160186101000a81548163ffffffff021916908363ffffffff160217905550606082015181600001601c6101000a81548163ffffffff021916908363ffffffff16021790555060808201518160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060a08201518160010160146101000a81548163ffffffff021916908363ffffffff16021790555060c08201518160010160186101000a81548163ffffffff021916908363ffffffff16021790555060e082015181600101601c6101000a81548163ffffffff021916908363ffffffff1602179055506101008201518160020160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506101208201518160020160146101000a81548163ffffffff021916908363ffffffff1602179055506101408201518160020160186101000a81548163ffffffff021916908363ffffffff160217905550905050876101600151601981905550876101800151601a81905550876101a00151601b81905550600088604051602001610a9a919061501a565b604080518083037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0018152919052601754909150610aff904690309074010000000000000000000000000000000000000000900463ffffffff168f8f8f878f8f611e19565b6013556000610b0e6009611ec3565b90505b8015610b4b57610b38610b30610b286001846151a0565b600990611ed3565b600990611ee6565b5080610b43816151b3565b915050610b11565b5060005b896101c0015151811015610ba257610b8f8a6101c001518281518110610b7757610b776151e8565b60200260200101516009611f0890919063ffffffff16565b5080610b9a81615217565b915050610b4f565b507f1591690b8638f5fb2dbec82ac741805ac5da8b45dc5263f4875b0496fdce4e0584601354601660010160149054906101000a900463ffffffff168f8f8f878f8f604051610bf99998979695949392919061524f565b60405180910390a1505050505050505050505050565b60015473ffffffffffffffffffffffffffffffffffffffff163314610c95576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e65720000000000000000000060448201526064015b60405180910390fd5b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b60005a90506000610d238660406152e5565b610d2f896101446152fc565b610d3991906152fc565b9050368114610d74576040517fdfe9309000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60408051610120810182526014546bffffffffffffffffffffffff8116825263ffffffff6c01000000000000000000000000820416602083015262ffffff7001000000000000000000000000000000008204169282019290925261ffff730100000000000000000000000000000000000000830416606082015260ff75010000000000000000000000000000000000000000008304811660808301527601000000000000000000000000000000000000000000008304811615801560a08401527701000000000000000000000000000000000000000000000084048216151560c0840152780100000000000000000000000000000000000000000000000090930416151560e082015260155473ffffffffffffffffffffffffffffffffffffffff1661010082015290610ed3576040517f24522f3400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b336000908152600b602052604090205460ff16610f1c576040517f1099ed7500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6013548b3514610f58576040517fdfdcf8e700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6080810151610f6890600161530f565b60ff1687141580610f795750868514155b15610fb0576040517f0244f71a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610fc08b8b8b8b8b8b8b8b611f2a565b6000610fcc8b8b612193565b905060208c0135600881901c63ffffffff16610fe984848861224c565b836020015163ffffffff168163ffffffff16111561104157601480547fffffffffffffffffffffffffffffffff00000000ffffffffffffffffffffffff166c0100000000000000000000000063ffffffff8416021790555b5050505050505050505050505050565b60008060008580602001905181019061106a9190615495565b925092509250611080898989868989888861032b565b505050505050505050565b61109361109f565b61109c81612e5c565b50565b60005473ffffffffffffffffffffffffffffffffffffffff163314611120576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e6572000000000000000000006044820152606401610c8c565b565b60005b6024548110156111e0576022600060248381548110611146576111466151e8565b600091825260208083209091015473ffffffffffffffffffffffffffffffffffffffff168352820192909252604001812080547fffffffff00000000000000000000000000000000000000000000000000000000168155600181019190915560020180547fffffffffffffffffffffffffffffffffffffffff000000000000000000000000169055806111d881615217565b915050611125565b506111ed602460006145f2565b60255460ff1660005b8351811015611754576000848281518110611213576112136151e8565b602002602001015190506000848381518110611231576112316151e8565b602002602001015190508173ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015611286573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112aa9190615640565b60ff16816060015160ff161415806113385750806040015173ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa15801561130c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113309190615640565b60ff16600814155b1561136f576040517fc1ab6dc100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161480156113db575060018460018111156113d9576113d961565d565b145b15611412576040517fc1ab6dc100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8216158061144d5750604081015173ffffffffffffffffffffffffffffffffffffffff16155b15611484576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff828116600090815260226020526040902054670100000000000000900416156114ee576040517f357d0cc400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6024805460018181019092557f7cd332d19b93bcabe3cce7ca0c18a052f57e5fd03b4758a09f30f5ddc4b22ec401805473ffffffffffffffffffffffffffffffffffffffff8086167fffffffffffffffffffffffff0000000000000000000000000000000000000000909216821790925560008181526022602090815260409182902086518154928801518489015160608a015160ff167b01000000000000000000000000000000000000000000000000000000027fffffffff00ffffffffffffffffffffffffffffffffffffffffffffffffffffff9190981667010000000000000002167fffffffff000000000000000000000000000000000000000000ffffffffffffff62ffffff909216640100000000027fffffffffffffffffffffffffffffffffffffffffffffffffff0000000000000090951663ffffffff9093169290921793909317929092169190911793909317835560808501519383019390935560a0840151600290920180546bffffffffffffffffffffffff9093167fffffffffffffffffffffffffffffffffffffffff0000000000000000000000009093169290921790915590517fca93cbe727c73163ec538f71be6c0a64877d7f1f6dd35d5ca7cbaef3a3e34ba390611737908490600060c08201905063ffffffff835116825262ffffff602084015116602083015273ffffffffffffffffffffffffffffffffffffffff604084015116604083015260ff6060840151166060830152608083015160808301526bffffffffffffffffffffffff60a08401511660a083015292915050565b60405180910390a25050808061174c90615217565b9150506111f6565b50505050565b600e546014546bffffffffffffffffffffffff1660005b600e548110156117cd576117ba600e8281548110611791576117916151e8565b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff168385612f51565b50806117c581615217565b915050611771565b5060255460009060ff16815b600e5481101561193e57600e81815481106117f6576117f66151e8565b6000918252602082200154600d805473ffffffffffffffffffffffffffffffffffffffff9092169550600c929184908110611833576118336151e8565b600091825260208083209091015473ffffffffffffffffffffffffffffffffffffffff9081168452838201949094526040928301822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00001690559286168152600b909252902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905560018260018111156118d5576118d561565d565b14801561191a575073ffffffffffffffffffffffffffffffffffffffff83166000908152600b60205260409020546201000090046bffffffffffffffffffffffff1615155b1561192c5761192a600f84611f08565b505b8061193681615217565b9150506117d9565b5061194b600d60006145f2565b611957600e60006145f2565b6040805160808101825260008082526020820181905291810182905260608101829052905b8751811015611de757600c600089838151811061199b5761199b6151e8565b60209081029190910181015173ffffffffffffffffffffffffffffffffffffffff1682528101919091526040016000205460ff1615611a06576040517f77cea0fa00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16888281518110611a3057611a306151e8565b602002602001015173ffffffffffffffffffffffffffffffffffffffff1603611a85576040517f815e1d6400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60405180604001604052806001151581526020018260ff16815250600c60008a8481518110611ab657611ab66151e8565b60209081029190910181015173ffffffffffffffffffffffffffffffffffffffff1682528181019290925260400160002082518154939092015160ff16610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff921515929092167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000909316929092171790558651879082908110611b5e57611b5e6151e8565b60200260200101519350600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1603611bce576040517f58a70a0a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff84166000908152600b60209081526040918290208251608081018452905460ff80821615801584526101008304909116938301939093526bffffffffffffffffffffffff6201000082048116948301949094526e01000000000000000000000000000090049092166060830152909250611c89576040517f6a7281ad00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600180835260ff80831660208086019182526014546bffffffffffffffffffffffff9081166060880190815273ffffffffffffffffffffffffffffffffffffffff8a166000908152600b909352604092839020885181549551948a0151925184166e010000000000000000000000000000027fffffffffffff000000000000000000000000ffffffffffffffffffffffffffff939094166201000002929092167fffffffffffff000000000000000000000000000000000000000000000000ffff94909616610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff921515929092167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000090951694909417179190911692909217919091179055836001811115611dc357611dc361565d565b03611dd557611dd3600f85611ee6565b505b80611ddf81615217565b91505061197c565b508651611dfb90600d9060208a0190614610565b508551611e0f90600e906020890190614610565b5050505050505050565b6000808a8a8a8a8a8a8a8a8a604051602001611e3d9998979695949392919061568c565b604080518083037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe001815291905280516020909101207dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167e01000000000000000000000000000000000000000000000000000000000000179b9a5050505050505050505050565b6000611ecd825490565b92915050565b6000611edf8383613159565b9392505050565b6000611edf8373ffffffffffffffffffffffffffffffffffffffff8416613183565b6000611edf8373ffffffffffffffffffffffffffffffffffffffff841661327d565b60008787604051611f3c929190615721565b604051908190038120611f53918b90602001615731565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815282825280516020918201208383019092526000808452908301819052909250906000805b8881101561212a57600185878360208110611fbf57611fbf6151e8565b611fcc91901a601b61530f565b8c8c85818110611fde57611fde6151e8565b905060200201358b8b86818110611ff757611ff76151e8565b9050602002013560405160008152602001604052604051612034949392919093845260ff9290921660208401526040830152606082015260800190565b6020604051602081039080840390855afa158015612056573d6000803e3d6000fd5b5050604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081015173ffffffffffffffffffffffffffffffffffffffff81166000908152600c602090815290849020838501909452925460ff8082161515808552610100909204169383019390935290955093509050612104576040517f0f4c073700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b826020015160080260ff166001901b84019350808061212290615217565b915050611fa2565b50827e01010101010101010101010101010101010101010101010101010101010101841614612185576040517fc103be2e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b505050505050505050505050565b6121cc6040518060c001604052806000815260200160008152602001606081526020016060815260200160608152602001606081525090565b60006121da83850185615822565b60408101515160608201515191925090811415806121fd57508082608001515114155b8061220d5750808260a001515114155b15612244576040517fb55ac75400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b509392505050565b600082604001515167ffffffffffffffff81111561226c5761226c6146a7565b60405190808252806020026020018201604052801561233857816020015b6040805161020081018252600060e08201818152610100830182905261012083018290526101408301829052610160830182905261018083018290526101a083018290526101c083018290526101e0830182905282526020808301829052928201819052606082018190526080820181905260a0820181905260c082015282527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90920191018161228a5790505b50905060006040518060800160405280600061ffff16815260200160006bffffffffffffffffffffffff16815260200160006bffffffffffffffffffffffff16815260200160008152509050600085610100015173ffffffffffffffffffffffffffffffffffffffff166357e871e76040518163ffffffff1660e01b8152600401602060405180830381865afa1580156123d6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123fa9190614f93565b6101008701516040517f7810d12a00000000000000000000000000000000000000000000000000000000815236600482015291925060009173ffffffffffffffffffffffffffffffffffffffff90911690637810d12a90602401602060405180830381865afa158015612471573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124959190614f93565b905060005b8660400151518110156129255760046000886040015183815181106124c1576124c16151e8565b6020908102919091018101518252818101929092526040908101600020815161012081018352815460ff8082161515835261010080830490911615159583019590955263ffffffff620100008204811694830194909452660100000000000081048416606083015273ffffffffffffffffffffffffffffffffffffffff6a01000000000000000000009091048116608083015260018301546fffffffffffffffffffffffffffffffff811660a08401526bffffffffffffffffffffffff70010000000000000000000000000000000082041660c08401527c0100000000000000000000000000000000000000000000000000000000900490931660e08201526002909101549091169181019190915285518690839081106125e4576125e46151e8565b6020026020010151600001819052506126198760400151828151811061260c5761260c6151e8565b60200260200101516132cc565b85828151811061262b5761262b6151e8565b60200260200101516060019060018111156126485761264861565d565b9081600181111561265b5761265b61565d565b815250506126bf87604001518281518110612678576126786151e8565b60200260200101518489608001518481518110612697576126976151e8565b60200260200101518885815181106126b1576126b16151e8565b60200260200101518c613377565b8683815181106126d1576126d16151e8565b60200260200101516020018784815181106126ee576126ee6151e8565b602002602001015160c0018281525082151515158152505050848181518110612719576127196151e8565b602002602001015160200151156127495760018460000181815161273d919061590f565b61ffff1690525061274e565b612913565b6127b4858281518110612763576127636151e8565b6020026020010151600001516080015188606001518381518110612789576127896151e8565b60200260200101518960a0015184815181106127a7576127a76151e8565b6020026020010151613496565b8683815181106127c6576127c66151e8565b60200260200101516040018784815181106127e3576127e36151e8565b602002602001015160800182815250821515151581525050508760800151600161280d919061530f565b61281b9060ff1660406152e5565b6103a48860a001518381518110612834576128346151e8565b60200260200101515161284791906152fc565b61285191906152fc565b858281518110612863576128636151e8565b602002602001015160a0018181525050848181518110612885576128856151e8565b602002602001015160a00151846060018181516128a291906152fc565b90525084518590829081106128b9576128b96151e8565b602002602001015160800151866128d091906151a0565b9550612913876040015182815181106128eb576128eb6151e8565b602002602001015184878481518110612906576129066151e8565b60200260200101516136b1565b8061291d81615217565b91505061249a565b50825161ffff1660000361293c5750505050505050565b61c80061294a3660106152e5565b5a61295590886151a0565b61295f91906152fc565b61296991906152fc565b8351909550613778906129809061ffff1687615959565b61298a91906152fc565b60408051608081018252600080825260208201819052918101829052606081018290529196506129b9896137b6565b905060005b886040015151811015612cf5578681815181106129dd576129dd6151e8565b60200260200101516020015115612ce357801580612a75575086612a026001836151a0565b81518110612a1257612a126151e8565b602002602001015160000151610100015173ffffffffffffffffffffffffffffffffffffffff16878281518110612a4b57612a4b6151e8565b602002602001015160000151610100015173ffffffffffffffffffffffffffffffffffffffff1614155b15612aa957612aa68a888381518110612a9057612a906151e8565b60200260200101516000015161010001516138a0565b92505b6000612bc78b6040518061012001604052808b8681518110612acd57612acd6151e8565b60200260200101516080015181526020018c81526020018a606001518c8781518110612afb57612afb6151e8565b602002602001015160a001518a612b1291906152e5565b612b1c9190615959565b81526020018d6000015181526020018d6020015181526020018681526020018b8681518110612b4d57612b4d6151e8565b602002602001015160000151610100015173ffffffffffffffffffffffffffffffffffffffff168152602001878152602001600115158152508c604001518581518110612b9c57612b9c6151e8565b60200260200101518b8681518110612bb657612bb66151e8565b602002602001015160000151613a1c565b9050806060015187604001818151612bdf919061596d565b6bffffffffffffffffffffffff169052506040810151602088018051612c0690839061596d565b6bffffffffffffffffffffffff169052508751889083908110612c2b57612c2b6151e8565b60200260200101516040015115158a604001518381518110612c4f57612c4f6151e8565b60200260200101517fad8cc9579b21dfe2c2f6ea35ba15b656e46b4f5b0cb424f52739b8ce5cac9c5b83602001518460000151612c8c919061596d565b8b8681518110612c9e57612c9e6151e8565b6020026020010151608001518d8f608001518881518110612cc157612cc16151e8565b6020026020010151604051612cd99493929190615992565b60405180910390a3505b80612ced81615217565b9150506129be565b505050602083810151336000908152600b90925260409091208054600290612d329084906201000090046bffffffffffffffffffffffff1661596d565b92506101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055508260400151601460000160008282829054906101000a90046bffffffffffffffffffffffff16612d90919061596d565b92506101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff16021790555082604001518360200151612dd2919061596d565b6bffffffffffffffffffffffff16602160007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254612e4e91906152fc565b909155505050505050505050565b3373ffffffffffffffffffffffffffffffffffffffff821603612edb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c660000000000000000006044820152606401610c8c565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b73ffffffffffffffffffffffffffffffffffffffff83166000908152600b602090815260408083208151608081018352905460ff80821615801584526101008304909116948301949094526bffffffffffffffffffffffff6201000082048116938301939093526e010000000000000000000000000000900490911660608201529061314d576000816060015185612fe991906159cf565b90506000612ff785836159f4565b9050808360400181815161300b919061596d565b6bffffffffffffffffffffffff169052506130268582615a1f565b83606001818151613037919061596d565b6bffffffffffffffffffffffff90811690915273ffffffffffffffffffffffffffffffffffffffff89166000908152600b602090815260409182902087518154928901519389015160608a015186166e010000000000000000000000000000027fffffffffffff000000000000000000000000ffffffffffffffffffffffffffff919096166201000002167fffffffffffff000000000000000000000000000000000000000000000000ffff60ff95909516610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff921515929092167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000909416939093171792909216179190911790555050505b60400151949350505050565b6000826000018281548110613170576131706151e8565b9060005260206000200154905092915050565b6000818152600183016020526040812054801561326c5760006131a76001836151a0565b85549091506000906131bb906001906151a0565b90508181146132205760008660000182815481106131db576131db6151e8565b90600052602060002001549050808760000184815481106131fe576131fe6151e8565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061323157613231615a4f565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050611ecd565b6000915050611ecd565b5092915050565b60008181526001830160205260408120546132c457508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155611ecd565b506000611ecd565b6000818160045b600f811015613359577fff000000000000000000000000000000000000000000000000000000000000008216838260208110613311576133116151e8565b1a60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161461334757506000949350505050565b8061335181615217565b9150506132d3565b5081600f1a600181111561336f5761336f61565d565b949350505050565b6000808080856060015160018111156133925761339261565d565b036133b8576133a48888888888613e8b565b6133b35760009250905061348c565b613430565b6001856060015160018111156133d0576133d061565d565b036133fe5760006133e389898988614015565b92509050806133f8575060009250905061348c565b50613430565b6040517ff2b2d41200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b84516060015163ffffffff16871061348557877fc3237c8807c467c1b39b8d0395eff077313e691bf0a7388106792564ebfd5636876040516134729190614d1a565b60405180910390a260009250905061348c565b6001925090505b9550959350505050565b601454600090819077010000000000000000000000000000000000000000000000900460ff16156134f3576040517f37ed32e800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b601480547fffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffffffff16770100000000000000000000000000000000000000000000001790556040517f4585e33b0000000000000000000000000000000000000000000000000000000090613568908590602401614d1a565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff000000000000000000000000000000000000000000000000000000009094169390931790925290517f79188d1600000000000000000000000000000000000000000000000000000000815290935073ffffffffffffffffffffffffffffffffffffffff8616906379188d169061363b9087908790600401615a7e565b60408051808303816000875af1158015613659573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061367d9190615a97565b601480547fffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffffffff16905590969095509350505050565b6000816060015160018111156136c9576136c961565d565b0361372d57600083815260046020526040902060010180547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167c010000000000000000000000000000000000000000000000000000000063ffffffff851602179055505050565b6001816060015160018111156137455761374561565d565b036137b15760c08101805160009081526008602052604080822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055915191517fa4a4e334c0e330143f9437484fe516c13bc560b86b5b0daf58e7084aaac228f29190a25b505050565b60008060007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663feaf968c6040518163ffffffff1660e01b815260040160a060405180830381865afa158015613826573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061384a9190615adf565b5093505092505060008213158061386057508042105b8061389057506000846040015162ffffff16118015613890575061388481426151a0565b846040015162ffffff16105b15613276575050601b5492915050565b60408051608081018252600080825260208083018281528385018381526060850184905273ffffffffffffffffffffffffffffffffffffffff878116855260229093528584208054640100000000810462ffffff1690925263ffffffff82169092527b01000000000000000000000000000000000000000000000000000000810460ff16855285517ffeaf968c00000000000000000000000000000000000000000000000000000000815295519495919484936701000000000000009092049091169163feaf968c9160048083019260a09291908290030181865afa15801561398d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906139b19190615adf565b509350509250506000821315806139c757508042105b806139f757506000866040015162ffffff161180156139f757506139eb81426151a0565b866040015162ffffff16105b15613a0b5760018301546060850152613a13565b606084018290525b50505092915050565b604080516101008101825260008082526020808301829052928201819052606082018190526080820181905260a0820181905260c0820181905260e08201529082015115613ab25760008381526023602090815260409182902082518084018452905463ffffffff811680835262ffffff640100000000909204821692840192835260e089018051909401529051915191169101525b6000613abe8686614222565b60c0840151602082015182519293509091600091613adb9161596d565b60e08801515190915060ff16600060128210613af8576001613b0e565b613b038260126151a0565b613b0e90600a615c4f565b9050600060128311613b21576001613b37565b613b2c6012846151a0565b613b3790600a615c4f565b905085600001516bffffffffffffffffffffffff16856bffffffffffffffffffffffff161015613bdf57849350613bb3818b60800151613b7791906152e5565b838c60e0015160600151886bffffffffffffffffffffffff16613b9a91906152e5565b613ba491906152e5565b613bae9190615959565b614550565b6bffffffffffffffffffffffff9081166040880152600060608801819052602088015285168652613d05565b836bffffffffffffffffffffffff16856bffffffffffffffffffffffff161015613d0557849350613c6d86604001516bffffffffffffffffffffffff16828c60800151613c2c91906152e5565b848d60e0015160600151896bffffffffffffffffffffffff16613c4f91906152e5565b613c5991906152e5565b613c639190615959565b613bae91906151a0565b6bffffffffffffffffffffffff1660608088019190915260e08b01510151613cf190613c9a9084906152e5565b6001848d60e0015160600151613cb091906152e5565b613cba91906151a0565b838d608001518a606001516bffffffffffffffffffffffff16613cdd91906152e5565b613ce791906152e5565b613ba491906152fc565b6bffffffffffffffffffffffff1660208701525b60008981526004602052604090206001018054859190601090613d4b90849070010000000000000000000000000000000090046bffffffffffffffffffffffff166159cf565b82546101009290920a6bffffffffffffffffffffffff81810219909316918316021790915560008b81526004602052604081206001018054928816935091613da69084906fffffffffffffffffffffffffffffffff16615c5b565b92506101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff160217905550836bffffffffffffffffffffffff16602160008c60c0015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254613e3d91906151a0565b92505081905550887f801ba6ed51146ffe3e99d1dbd9dd0f4de6292e78a9a34c39c0183de17b3f40fc87604051613e749190615c84565b60405180910390a250939998505050505050505050565b60008084806020019051810190613ea29190615d44565b845160e00151815191925063ffffffff90811691161015613eff57867f405288ea7be309e16cfdf481367f90a413e1d4634fcdaf8966546db9b93012e886604051613eed9190614d1a565b60405180910390a2600091505061400c565b8260e001518015613fbf5750602081015115801590613fbf5750602081015161010084015182516040517f85df51fd00000000000000000000000000000000000000000000000000000000815263ffffffff909116600482015273ffffffffffffffffffffffffffffffffffffffff909116906385df51fd90602401602060405180830381865afa158015613f98573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613fbc9190614f93565b14155b80613fd15750805163ffffffff168611155b1561400657867f6aa7f60c176da7af894b384daea2249497448137f5943c1237ada8bc92bdc30186604051613eed9190614d1a565b60019150505b95945050505050565b60008060008480602001905181019061402e9190615d9c565b905060008782600001518360200151846040015160405160200161409094939291909384526020840192909252604083015260e01b7fffffffff0000000000000000000000000000000000000000000000000000000016606082015260640190565b6040516020818303038152906040528051906020012090508460e00151801561416b575060808201511580159061416b5750608082015161010086015160608401516040517f85df51fd00000000000000000000000000000000000000000000000000000000815263ffffffff909116600482015273ffffffffffffffffffffffffffffffffffffffff909116906385df51fd90602401602060405180830381865afa158015614144573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906141689190614f93565b14155b80614180575086826060015163ffffffff1610155b156141ca57877f6aa7f60c176da7af894b384daea2249497448137f5943c1237ada8bc92bdc301876040516141b59190614d1a565b60405180910390a26000935091506142199050565b60008181526008602052604090205460ff161561421157877f405288ea7be309e16cfdf481367f90a413e1d4634fcdaf8966546db9b93012e8876040516141b59190614d1a565b600193509150505b94509492505050565b6040805161010081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e081019190915260008260e001516000015160ff1690506000846060015161ffff16846060015161428d91906152e5565b905083610100015180156142a05750803a105b156142a857503a5b6000601283116142b95760016142cf565b6142c46012846151a0565b6142cf90600a615c4f565b90506000601284106142e25760016142f8565b6142ed8460126151a0565b6142f890600a615c4f565b905060008660a0015187604001518860200151896000015161431a91906152fc565b61432490876152e5565b61432e91906152fc565b61433891906152e5565b905061437b828860e001516060015161435191906152e5565b6001848a60e001516060015161436791906152e5565b61437191906151a0565b613ce786856152e5565b6bffffffffffffffffffffffff168652608087015161439e90613bae9083615959565b6bffffffffffffffffffffffff1660408088019190915260e088015101516000906143d79062ffffff16683635c9adc5dea000006152e5565b9050600081633b9aca008a60a001518b60e001516020015163ffffffff168c604001518d600001518b61440a91906152e5565b61441491906152fc565b61441e91906152e5565b61442891906152e5565b6144329190615959565b61443c91906152fc565b905061447f848a60e001516060015161445591906152e5565b6001868c60e001516060015161446b91906152e5565b61447591906151a0565b613ce788856152e5565b6bffffffffffffffffffffffff16602089015260808901516144a590613bae9083615959565b6bffffffffffffffffffffffff16606089015260c089015173ffffffffffffffffffffffffffffffffffffffff166080808a01919091528901516144e890614550565b6bffffffffffffffffffffffff1660a0808a019190915289015161450b90614550565b6bffffffffffffffffffffffff1660c089015260e08901516060015161453090614550565b6bffffffffffffffffffffffff1660e08901525050505050505092915050565b60006bffffffffffffffffffffffff8211156145ee576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203960448201527f36206269747300000000000000000000000000000000000000000000000000006064820152608401610c8c565b5090565b508054600082559060005260206000209081019061109c9190614692565b82805482825590600052602060002090810192821561468a579160200282015b8281111561468a57825182547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff909116178255602090920191600190910190614630565b506145ee9291505b5b808211156145ee5760008155600101614693565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051610200810167ffffffffffffffff811182821017156146fa576146fa6146a7565b60405290565b60405160c0810167ffffffffffffffff811182821017156146fa576146fa6146a7565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff8111828210171561476a5761476a6146a7565b604052919050565b600067ffffffffffffffff82111561478c5761478c6146a7565b5060051b60200190565b73ffffffffffffffffffffffffffffffffffffffff8116811461109c57600080fd5b80356147c381614796565b919050565b600082601f8301126147d957600080fd5b813560206147ee6147e983614772565b614723565b82815260059290921b8401810191818101908684111561480d57600080fd5b8286015b8481101561483157803561482481614796565b8352918301918301614811565b509695505050505050565b60ff8116811461109c57600080fd5b80356147c38161483c565b63ffffffff8116811461109c57600080fd5b80356147c381614856565b801515811461109c57600080fd5b80356147c381614873565b62ffffff8116811461109c57600080fd5b80356147c38161488c565b61ffff8116811461109c57600080fd5b80356147c3816148a8565b600061020082840312156148d657600080fd5b6148de6146d6565b90506148e982614868565b81526148f760208301614868565b602082015261490860408301614868565b6040820152614919606083016147b8565b606082015261492a60808301614881565b608082015261493b60a0830161489d565b60a082015261494c60c08301614868565b60c082015261495d60e08301614868565b60e08201526101006149708184016147b8565b908201526101206149828382016148b8565b908201526101406149948382016147b8565b90820152610160828101359082015261018080830135908201526101a080830135908201526101c08083013567ffffffffffffffff8111156149d557600080fd5b6149e1858286016147c8565b8284015250506101e06149f58184016147b8565b9082015292915050565b803567ffffffffffffffff811681146147c357600080fd5b600082601f830112614a2857600080fd5b813567ffffffffffffffff811115614a4257614a426146a7565b614a7360207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f84011601614723565b818152846020838601011115614a8857600080fd5b816020850160208301376000918101602001919091529392505050565b6bffffffffffffffffffffffff8116811461109c57600080fd5b600082601f830112614ad057600080fd5b81356020614ae06147e983614772565b82815260c09283028501820192828201919087851115614aff57600080fd5b8387015b85811015614b915781818a031215614b1b5760008081fd5b614b23614700565b8135614b2e81614856565b815281860135614b3d8161488c565b81870152604082810135614b5081614796565b90820152606082810135614b638161483c565b908201526080828101359082015260a080830135614b8081614aa5565b908201528452928401928101614b03565b5090979650505050505050565b600080600080600080600080610100898b031215614bbb57600080fd5b883567ffffffffffffffff80821115614bd357600080fd5b614bdf8c838d016147c8565b995060208b0135915080821115614bf557600080fd5b614c018c838d016147c8565b9850614c0f60408c0161484b565b975060608b0135915080821115614c2557600080fd5b614c318c838d016148c3565b9650614c3f60808c016149ff565b955060a08b0135915080821115614c5557600080fd5b614c618c838d01614a17565b945060c08b0135915080821115614c7757600080fd5b614c838c838d016147c8565b935060e08b0135915080821115614c9957600080fd5b50614ca68b828c01614abf565b9150509295985092959890939650565b6000815180845260005b81811015614cdc57602081850181015186830182015201614cc0565b5060006020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b602081526000611edf6020830184614cb6565b60008083601f840112614d3f57600080fd5b50813567ffffffffffffffff811115614d5757600080fd5b6020830191508360208260051b8501011115614d7257600080fd5b9250929050565b60008060008060008060008060e0898b031215614d9557600080fd5b606089018a811115614da657600080fd5b8998503567ffffffffffffffff80821115614dc057600080fd5b818b0191508b601f830112614dd457600080fd5b813581811115614de357600080fd5b8c6020828501011115614df557600080fd5b6020830199508098505060808b0135915080821115614e1357600080fd5b614e1f8c838d01614d2d565b909750955060a08b0135915080821115614e3857600080fd5b50614e458b828c01614d2d565b999c989b50969995989497949560c00135949350505050565b60008060008060008060c08789031215614e7757600080fd5b863567ffffffffffffffff80821115614e8f57600080fd5b614e9b8a838b016147c8565b97506020890135915080821115614eb157600080fd5b614ebd8a838b016147c8565b9650614ecb60408a0161484b565b95506060890135915080821115614ee157600080fd5b614eed8a838b01614a17565b9450614efb60808a016149ff565b935060a0890135915080821115614f1157600080fd5b50614f1e89828a01614a17565b9150509295509295509295565b600060208284031215614f3d57600080fd5b8135611edf81614796565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60ff818116838216029081169081811461327657613276614f48565b600060208284031215614fa557600080fd5b5051919050565b63ffffffff81811683821601908082111561327657613276614f48565b600081518084526020808501945080840160005b8381101561500f57815173ffffffffffffffffffffffffffffffffffffffff1687529582019590820190600101614fdd565b509495945050505050565b6020815261503160208201835163ffffffff169052565b6000602083015161504a604084018263ffffffff169052565b50604083015163ffffffff8116606084015250606083015173ffffffffffffffffffffffffffffffffffffffff8116608084015250608083015180151560a08401525060a083015162ffffff811660c08401525060c083015163ffffffff811660e08401525060e08301516101006150c98185018363ffffffff169052565b84015190506101206150f28482018373ffffffffffffffffffffffffffffffffffffffff169052565b84015190506101406151098482018361ffff169052565b84015190506101606151328482018373ffffffffffffffffffffffffffffffffffffffff169052565b840151610180848101919091528401516101a0808501919091528401516101c0808501919091528401516102006101e08086018290529192509061517a610220860184614fc9565b95015173ffffffffffffffffffffffffffffffffffffffff169301929092525090919050565b81810381811115611ecd57611ecd614f48565b6000816151c2576151c2614f48565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361524857615248614f48565b5060010190565b600061012063ffffffff808d1684528b6020850152808b1660408501525080606084015261527f8184018a614fc9565b905082810360808401526152938189614fc9565b905060ff871660a084015282810360c08401526152b08187614cb6565b905067ffffffffffffffff851660e08401528281036101008401526152d58185614cb6565b9c9b505050505050505050505050565b8082028115828204841417611ecd57611ecd614f48565b80820180821115611ecd57611ecd614f48565b60ff8181168382160190811115611ecd57611ecd614f48565b80516147c381614856565b80516147c381614796565b80516147c381614873565b80516147c38161488c565b80516147c3816148a8565b600082601f83011261537057600080fd5b815160206153806147e983614772565b82815260059290921b8401810191818101908684111561539f57600080fd5b8286015b848110156148315780516153b681614796565b83529183019183016153a3565b600082601f8301126153d457600080fd5b815160206153e46147e983614772565b82815260c0928302850182019282820191908785111561540357600080fd5b8387015b85811015614b915781818a03121561541f5760008081fd5b615427614700565b815161543281614856565b8152818601516154418161488c565b8187015260408281015161545481614796565b908201526060828101516154678161483c565b908201526080828101519082015260a08083015161548481614aa5565b908201528452928401928101615407565b6000806000606084860312156154aa57600080fd5b835167ffffffffffffffff808211156154c257600080fd5b9085019061020082880312156154d757600080fd5b6154df6146d6565b6154e883615328565b81526154f660208401615328565b602082015261550760408401615328565b604082015261551860608401615333565b60608201526155296080840161533e565b608082015261553a60a08401615349565b60a082015261554b60c08401615328565b60c082015261555c60e08401615328565b60e082015261010061556f818501615333565b90820152610120615581848201615354565b90820152610140615593848201615333565b90820152610160838101519082015261018080840151908201526101a080840151908201526101c080840151838111156155cc57600080fd5b6155d88a82870161535f565b8284015250506101e06155ec818501615333565b90820152602087015190955091508082111561560757600080fd5b6156138783880161535f565b9350604086015191508082111561562957600080fd5b50615636868287016153c3565b9150509250925092565b60006020828403121561565257600080fd5b8151611edf8161483c565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b60006101208b835273ffffffffffffffffffffffffffffffffffffffff8b16602084015267ffffffffffffffff808b1660408501528160608501526156d38285018b614fc9565b915083820360808501526156e7828a614fc9565b915060ff881660a085015283820360c08501526157048288614cb6565b90861660e085015283810361010085015290506152d58185614cb6565b8183823760009101908152919050565b8281526080810160608360208401379392505050565b600082601f83011261575857600080fd5b813560206157686147e983614772565b82815260059290921b8401810191818101908684111561578757600080fd5b8286015b84811015614831578035835291830191830161578b565b600082601f8301126157b357600080fd5b813560206157c36147e983614772565b82815260059290921b840181019181810190868411156157e257600080fd5b8286015b8481101561483157803567ffffffffffffffff8111156158065760008081fd5b6158148986838b0101614a17565b8452509183019183016157e6565b60006020828403121561583457600080fd5b813567ffffffffffffffff8082111561584c57600080fd5b9083019060c0828603121561586057600080fd5b615868614700565b823581526020830135602082015260408301358281111561588857600080fd5b61589487828601615747565b6040830152506060830135828111156158ac57600080fd5b6158b887828601615747565b6060830152506080830135828111156158d057600080fd5b6158dc878286016157a2565b60808301525060a0830135828111156158f457600080fd5b615900878286016157a2565b60a08301525095945050505050565b61ffff81811683821601908082111561327657613276614f48565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000826159685761596861592a565b500490565b6bffffffffffffffffffffffff81811683821601908082111561327657613276614f48565b6bffffffffffffffffffffffff851681528360208201528260408201526080606082015260006159c56080830184614cb6565b9695505050505050565b6bffffffffffffffffffffffff82811682821603908082111561327657613276614f48565b60006bffffffffffffffffffffffff80841680615a1357615a1361592a565b92169190910492915050565b6bffffffffffffffffffffffff818116838216028082169190828114615a4757615a47614f48565b505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b82815260406020820152600061336f6040830184614cb6565b60008060408385031215615aaa57600080fd5b8251615ab581614873565b6020939093015192949293505050565b805169ffffffffffffffffffff811681146147c357600080fd5b600080600080600060a08688031215615af757600080fd5b615b0086615ac5565b9450602086015193506040860151925060608601519150615b2360808701615ac5565b90509295509295909350565b600181815b80851115615b8857817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04821115615b6e57615b6e614f48565b80851615615b7b57918102915b93841c9390800290615b34565b509250929050565b600082615b9f57506001611ecd565b81615bac57506000611ecd565b8160018114615bc25760028114615bcc57615be8565b6001915050611ecd565b60ff841115615bdd57615bdd614f48565b50506001821b611ecd565b5060208310610133831016604e8410600b8410161715615c0b575081810a611ecd565b615c158383615b2f565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04821115615c4757615c47614f48565b029392505050565b6000611edf8383615b90565b6fffffffffffffffffffffffffffffffff81811683821601908082111561327657613276614f48565b6000610100820190506bffffffffffffffffffffffff8084511683528060208501511660208401528060408501511660408401528060608501511660608401525073ffffffffffffffffffffffffffffffffffffffff608084015116608083015260a0830151615d0460a08401826bffffffffffffffffffffffff169052565b5060c0830151615d2460c08401826bffffffffffffffffffffffff169052565b5060e083015161327660e08401826bffffffffffffffffffffffff169052565b600060408284031215615d5657600080fd5b6040516040810181811067ffffffffffffffff82111715615d7957615d796146a7565b6040528251615d8781614856565b81526020928301519281019290925250919050565b600060a08284031215615dae57600080fd5b60405160a0810181811067ffffffffffffffff82111715615dd157615dd16146a7565b806040525082518152602083015160208201526040830151615df281614856565b60408201526060830151615e0581614856565b6060820152608092830151928101929092525091905056fea164736f6c6343000813000a", } var AutomationRegistryABI = AutomationRegistryMetaData.ABI diff --git a/core/gethwrappers/generated/chain_module_base/chain_module_base.go b/core/gethwrappers/generated/chain_module_base/chain_module_base.go index bf98608aab7..19bc49298f5 100644 --- a/core/gethwrappers/generated/chain_module_base/chain_module_base.go +++ b/core/gethwrappers/generated/chain_module_base/chain_module_base.go @@ -29,8 +29,8 @@ var ( ) var ChainModuleBaseMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"n\",\"type\":\"uint256\"}],\"name\":\"blockHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"blockNumber\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getCurrentL1Fee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getGasOverhead\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"chainModuleFixedOverhead\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"chainModulePerByteOverhead\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"getMaxL1Fee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", - Bin: "0x608060405234801561001057600080fd5b5061015c806100206000396000f3fe608060405234801561001057600080fd5b50600436106100675760003560e01c806357e871e71161005057806357e871e71461009a57806385df51fd146100a0578063de9ee35e146100b357600080fd5b8063125441401461006c57806318b8f61314610093575b600080fd5b61008061007a3660046100f6565b50600090565b6040519081526020015b60405180910390f35b6000610080565b43610080565b6100806100ae3660046100f6565b6100c9565b6040805161012c8152600060208201520161008a565b600043821015806100e457506101006100e2834361010f565b115b156100f157506000919050565b504090565b60006020828403121561010857600080fd5b5035919050565b81810381811115610149577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b9291505056fea164736f6c6343000813000a", + ABI: "[{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"n\",\"type\":\"uint256\"}],\"name\":\"blockHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"blockNumber\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"getCurrentL1Fee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"l1Fee\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getGasOverhead\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"chainModuleFixedOverhead\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"chainModulePerByteOverhead\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"getMaxL1Fee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"maxL1Fee\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", + Bin: "0x608060405234801561001057600080fd5b50610155806100206000396000f3fe608060405234801561001057600080fd5b50600436106100675760003560e01c80637810d12a116100505780637810d12a1461006c57806385df51fd14610099578063de9ee35e146100ac57600080fd5b8063125441401461006c57806357e871e714610093575b600080fd5b61008061007a3660046100ef565b50600090565b6040519081526020015b60405180910390f35b43610080565b6100806100a73660046100ef565b6100c2565b6040805161012c8152600060208201520161008a565b600043821015806100dd57506101006100db8343610108565b115b156100ea57506000919050565b504090565b60006020828403121561010157600080fd5b5035919050565b81810381811115610142577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b9291505056fea164736f6c6343000813000a", } var ChainModuleBaseABI = ChainModuleBaseMetaData.ABI @@ -213,9 +213,9 @@ func (_ChainModuleBase *ChainModuleBaseCallerSession) BlockNumber() (*big.Int, e return _ChainModuleBase.Contract.BlockNumber(&_ChainModuleBase.CallOpts) } -func (_ChainModuleBase *ChainModuleBaseCaller) GetCurrentL1Fee(opts *bind.CallOpts) (*big.Int, error) { +func (_ChainModuleBase *ChainModuleBaseCaller) GetCurrentL1Fee(opts *bind.CallOpts, arg0 *big.Int) (*big.Int, error) { var out []interface{} - err := _ChainModuleBase.contract.Call(opts, &out, "getCurrentL1Fee") + err := _ChainModuleBase.contract.Call(opts, &out, "getCurrentL1Fee", arg0) if err != nil { return *new(*big.Int), err @@ -227,12 +227,12 @@ func (_ChainModuleBase *ChainModuleBaseCaller) GetCurrentL1Fee(opts *bind.CallOp } -func (_ChainModuleBase *ChainModuleBaseSession) GetCurrentL1Fee() (*big.Int, error) { - return _ChainModuleBase.Contract.GetCurrentL1Fee(&_ChainModuleBase.CallOpts) +func (_ChainModuleBase *ChainModuleBaseSession) GetCurrentL1Fee(arg0 *big.Int) (*big.Int, error) { + return _ChainModuleBase.Contract.GetCurrentL1Fee(&_ChainModuleBase.CallOpts, arg0) } -func (_ChainModuleBase *ChainModuleBaseCallerSession) GetCurrentL1Fee() (*big.Int, error) { - return _ChainModuleBase.Contract.GetCurrentL1Fee(&_ChainModuleBase.CallOpts) +func (_ChainModuleBase *ChainModuleBaseCallerSession) GetCurrentL1Fee(arg0 *big.Int) (*big.Int, error) { + return _ChainModuleBase.Contract.GetCurrentL1Fee(&_ChainModuleBase.CallOpts, arg0) } func (_ChainModuleBase *ChainModuleBaseCaller) GetGasOverhead(opts *bind.CallOpts) (GetGasOverhead, @@ -301,7 +301,7 @@ type ChainModuleBaseInterface interface { BlockNumber(opts *bind.CallOpts) (*big.Int, error) - GetCurrentL1Fee(opts *bind.CallOpts) (*big.Int, error) + GetCurrentL1Fee(opts *bind.CallOpts, arg0 *big.Int) (*big.Int, error) GetGasOverhead(opts *bind.CallOpts) (GetGasOverhead, diff --git a/core/gethwrappers/generated/chain_reader_tester/chain_reader_tester.go b/core/gethwrappers/generated/chain_reader_tester/chain_reader_tester.go index 17923820796..16b8b1d1aad 100644 --- a/core/gethwrappers/generated/chain_reader_tester/chain_reader_tester.go +++ b/core/gethwrappers/generated/chain_reader_tester/chain_reader_tester.go @@ -30,30 +30,41 @@ var ( _ = abi.ConvertType ) -type InnerTestStruct struct { +type InnerDynamicTestStruct struct { IntVal int64 S string } -type MidLevelTestStruct struct { +type InnerStaticTestStruct struct { + IntVal int64 + A common.Address +} + +type MidLevelDynamicTestStruct struct { + FixedBytes [2]byte + Inner InnerDynamicTestStruct +} + +type MidLevelStaticTestStruct struct { FixedBytes [2]byte - Inner InnerTestStruct + Inner InnerStaticTestStruct } type TestStruct struct { - Field int32 - DifferentField string - OracleId uint8 - OracleIds [32]uint8 - Account common.Address - Accounts []common.Address - BigField *big.Int - NestedStruct MidLevelTestStruct + Field int32 + DifferentField string + OracleId uint8 + OracleIds [32]uint8 + Account common.Address + Accounts []common.Address + BigField *big.Int + NestedDynamicStruct MidLevelDynamicTestStruct + NestedStaticStruct MidLevelStaticTestStruct } var ChainReaderTesterMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"int32\",\"name\":\"field\",\"type\":\"int32\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"differentField\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"oracleId\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"uint8[32]\",\"name\":\"oracleIds\",\"type\":\"uint8[32]\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"Account\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"Accounts\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"int192\",\"name\":\"bigField\",\"type\":\"int192\"},{\"components\":[{\"internalType\":\"bytes2\",\"name\":\"FixedBytes\",\"type\":\"bytes2\"},{\"components\":[{\"internalType\":\"int64\",\"name\":\"IntVal\",\"type\":\"int64\"},{\"internalType\":\"string\",\"name\":\"S\",\"type\":\"string\"}],\"internalType\":\"structInnerTestStruct\",\"name\":\"Inner\",\"type\":\"tuple\"}],\"indexed\":false,\"internalType\":\"structMidLevelTestStruct\",\"name\":\"nestedStruct\",\"type\":\"tuple\"}],\"name\":\"Triggered\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"string\",\"name\":\"fieldHash\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"field\",\"type\":\"string\"}],\"name\":\"TriggeredEventWithDynamicTopic\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"int32\",\"name\":\"field1\",\"type\":\"int32\"},{\"indexed\":true,\"internalType\":\"int32\",\"name\":\"field2\",\"type\":\"int32\"},{\"indexed\":true,\"internalType\":\"int32\",\"name\":\"field3\",\"type\":\"int32\"}],\"name\":\"TriggeredWithFourTopics\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"int32\",\"name\":\"field\",\"type\":\"int32\"},{\"internalType\":\"string\",\"name\":\"differentField\",\"type\":\"string\"},{\"internalType\":\"uint8\",\"name\":\"oracleId\",\"type\":\"uint8\"},{\"internalType\":\"uint8[32]\",\"name\":\"oracleIds\",\"type\":\"uint8[32]\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"accounts\",\"type\":\"address[]\"},{\"internalType\":\"int192\",\"name\":\"bigField\",\"type\":\"int192\"},{\"components\":[{\"internalType\":\"bytes2\",\"name\":\"FixedBytes\",\"type\":\"bytes2\"},{\"components\":[{\"internalType\":\"int64\",\"name\":\"IntVal\",\"type\":\"int64\"},{\"internalType\":\"string\",\"name\":\"S\",\"type\":\"string\"}],\"internalType\":\"structInnerTestStruct\",\"name\":\"Inner\",\"type\":\"tuple\"}],\"internalType\":\"structMidLevelTestStruct\",\"name\":\"nestedStruct\",\"type\":\"tuple\"}],\"name\":\"addTestStruct\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getDifferentPrimitiveValue\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"i\",\"type\":\"uint256\"}],\"name\":\"getElementAtIndex\",\"outputs\":[{\"components\":[{\"internalType\":\"int32\",\"name\":\"Field\",\"type\":\"int32\"},{\"internalType\":\"string\",\"name\":\"DifferentField\",\"type\":\"string\"},{\"internalType\":\"uint8\",\"name\":\"OracleId\",\"type\":\"uint8\"},{\"internalType\":\"uint8[32]\",\"name\":\"OracleIds\",\"type\":\"uint8[32]\"},{\"internalType\":\"address\",\"name\":\"Account\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"Accounts\",\"type\":\"address[]\"},{\"internalType\":\"int192\",\"name\":\"BigField\",\"type\":\"int192\"},{\"components\":[{\"internalType\":\"bytes2\",\"name\":\"FixedBytes\",\"type\":\"bytes2\"},{\"components\":[{\"internalType\":\"int64\",\"name\":\"IntVal\",\"type\":\"int64\"},{\"internalType\":\"string\",\"name\":\"S\",\"type\":\"string\"}],\"internalType\":\"structInnerTestStruct\",\"name\":\"Inner\",\"type\":\"tuple\"}],\"internalType\":\"structMidLevelTestStruct\",\"name\":\"NestedStruct\",\"type\":\"tuple\"}],\"internalType\":\"structTestStruct\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getPrimitiveValue\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getSliceValue\",\"outputs\":[{\"internalType\":\"uint64[]\",\"name\":\"\",\"type\":\"uint64[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"int32\",\"name\":\"field\",\"type\":\"int32\"},{\"internalType\":\"string\",\"name\":\"differentField\",\"type\":\"string\"},{\"internalType\":\"uint8\",\"name\":\"oracleId\",\"type\":\"uint8\"},{\"internalType\":\"uint8[32]\",\"name\":\"oracleIds\",\"type\":\"uint8[32]\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"accounts\",\"type\":\"address[]\"},{\"internalType\":\"int192\",\"name\":\"bigField\",\"type\":\"int192\"},{\"components\":[{\"internalType\":\"bytes2\",\"name\":\"FixedBytes\",\"type\":\"bytes2\"},{\"components\":[{\"internalType\":\"int64\",\"name\":\"IntVal\",\"type\":\"int64\"},{\"internalType\":\"string\",\"name\":\"S\",\"type\":\"string\"}],\"internalType\":\"structInnerTestStruct\",\"name\":\"Inner\",\"type\":\"tuple\"}],\"internalType\":\"structMidLevelTestStruct\",\"name\":\"nestedStruct\",\"type\":\"tuple\"}],\"name\":\"returnSeen\",\"outputs\":[{\"components\":[{\"internalType\":\"int32\",\"name\":\"Field\",\"type\":\"int32\"},{\"internalType\":\"string\",\"name\":\"DifferentField\",\"type\":\"string\"},{\"internalType\":\"uint8\",\"name\":\"OracleId\",\"type\":\"uint8\"},{\"internalType\":\"uint8[32]\",\"name\":\"OracleIds\",\"type\":\"uint8[32]\"},{\"internalType\":\"address\",\"name\":\"Account\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"Accounts\",\"type\":\"address[]\"},{\"internalType\":\"int192\",\"name\":\"BigField\",\"type\":\"int192\"},{\"components\":[{\"internalType\":\"bytes2\",\"name\":\"FixedBytes\",\"type\":\"bytes2\"},{\"components\":[{\"internalType\":\"int64\",\"name\":\"IntVal\",\"type\":\"int64\"},{\"internalType\":\"string\",\"name\":\"S\",\"type\":\"string\"}],\"internalType\":\"structInnerTestStruct\",\"name\":\"Inner\",\"type\":\"tuple\"}],\"internalType\":\"structMidLevelTestStruct\",\"name\":\"NestedStruct\",\"type\":\"tuple\"}],\"internalType\":\"structTestStruct\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"int32\",\"name\":\"field\",\"type\":\"int32\"},{\"internalType\":\"string\",\"name\":\"differentField\",\"type\":\"string\"},{\"internalType\":\"uint8\",\"name\":\"oracleId\",\"type\":\"uint8\"},{\"internalType\":\"uint8[32]\",\"name\":\"oracleIds\",\"type\":\"uint8[32]\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"accounts\",\"type\":\"address[]\"},{\"internalType\":\"int192\",\"name\":\"bigField\",\"type\":\"int192\"},{\"components\":[{\"internalType\":\"bytes2\",\"name\":\"FixedBytes\",\"type\":\"bytes2\"},{\"components\":[{\"internalType\":\"int64\",\"name\":\"IntVal\",\"type\":\"int64\"},{\"internalType\":\"string\",\"name\":\"S\",\"type\":\"string\"}],\"internalType\":\"structInnerTestStruct\",\"name\":\"Inner\",\"type\":\"tuple\"}],\"internalType\":\"structMidLevelTestStruct\",\"name\":\"nestedStruct\",\"type\":\"tuple\"}],\"name\":\"triggerEvent\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"field\",\"type\":\"string\"}],\"name\":\"triggerEventWithDynamicTopic\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"int32\",\"name\":\"field1\",\"type\":\"int32\"},{\"internalType\":\"int32\",\"name\":\"field2\",\"type\":\"int32\"},{\"internalType\":\"int32\",\"name\":\"field3\",\"type\":\"int32\"}],\"name\":\"triggerWithFourTopics\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", - Bin: "0x608060405234801561001057600080fd5b50600180548082018255600082905260048082047fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf6908101805460086003958616810261010090810a8088026001600160401b0391820219909416939093179093558654808801909755848704909301805496909516909202900a91820291021990921691909117905561176c806100a96000396000f3fe608060405234801561001057600080fd5b50600436106100a35760003560e01c80637f002d6711610076578063dbfd73321161005b578063dbfd73321461013e578063ef4e1ced14610151578063f6f871c81461015857600080fd5b80637f002d671461010e578063ab5e0b381461012157600080fd5b80632c45576f146100a85780633272b66c146100d157806349eac2ac146100e6578063679004a4146100f9575b600080fd5b6100bb6100b6366004610baa565b61016b565b6040516100c89190610d09565b60405180910390f35b6100e46100df366004610e48565b610446565b005b6100e46100f4366004610f5d565b61049b565b61010161079e565b6040516100c8919061104f565b6100e461011c366004610f5d565b61082a565b6107c65b60405167ffffffffffffffff90911681526020016100c8565b6100e461014c36600461109d565b610881565b6003610125565b6100bb610166366004610f5d565b6108be565b6101736109c7565b60006101806001846110e0565b815481106101905761019061111a565b6000918252602091829020604080516101008101909152600a90920201805460030b825260018101805492939192918401916101cb90611149565b80601f01602080910402602001604051908101604052809291908181526020018280546101f790611149565b80156102445780601f1061021957610100808354040283529160200191610244565b820191906000526020600020905b81548152906001019060200180831161022757829003601f168201915b5050509183525050600282015460ff166020808301919091526040805161040081018083529190930192916003850191826000855b825461010083900a900460ff1681526020600192830181810494850194909303909202910180841161027957505050928452505050600482015473ffffffffffffffffffffffffffffffffffffffff16602080830191909152600583018054604080518285028101850182528281529401939283018282801561033257602002820191906000526020600020905b815473ffffffffffffffffffffffffffffffffffffffff168152600190910190602001808311610307575b5050509183525050600682015460170b6020808301919091526040805180820182526007808601805460f01b7fffff0000000000000000000000000000000000000000000000000000000000001683528351808501855260088801805490930b815260098801805495909701969395919486830194919392840191906103b790611149565b80601f01602080910402602001604051908101604052809291908181526020018280546103e390611149565b80156104305780601f1061040557610100808354040283529160200191610430565b820191906000526020600020905b81548152906001019060200180831161041357829003601f168201915b5050509190925250505090525090525092915050565b8181604051610456929190611196565b60405180910390207f3d969732b1bbbb9f1d7eb9f3f14e4cb50a74d950b3ef916a397b85dfbab93c67838360405161048f9291906111ef565b60405180910390a25050565b60006040518061010001604052808c60030b81526020018b8b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050509082525060ff8a166020808301919091526040805161040081810183529190930192918b9183908390808284376000920191909152505050815273ffffffffffffffffffffffffffffffffffffffff8816602080830191909152604080518883028181018401835289825291909301929189918991829190850190849080828437600092019190915250505090825250601785900b602082015260400161058d846112ec565b905281546001808201845560009384526020938490208351600a9093020180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000001663ffffffff9093169290921782559282015191929091908201906105f39082611446565b5060408201516002820180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660ff90921691909117905560608201516106419060038301906020610a16565b5060808201516004820180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff90921691909117905560a082015180516106a8916005840191602090910190610aa9565b5060c08201516006820180547fffffffffffffffff0000000000000000000000000000000000000000000000001677ffffffffffffffffffffffffffffffffffffffffffffffff90921691909117905560e082015180516007830180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00001660f09290921c91909117815560208083015180516008860180547fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000001667ffffffffffffffff90921691909117815591810151909190600986019061078b9082611446565b5050505050505050505050505050505050565b6060600180548060200260200160405190810160405280929190818152602001828054801561082057602002820191906000526020600020906000905b82829054906101000a900467ffffffffffffffff1667ffffffffffffffff16815260200190600801906020826007010492830192600103820291508084116107db5790505b5050505050905090565b8960030b7f7188419dcd8b51877b71766f075f3626586c0ff190e7d056aa65ce9acb649a3d8a8a8a8a8a8a8a8a8a60405161086d999897969594939291906116a5565b60405180910390a250505050505050505050565b8060030b8260030b8460030b7f91c80dc390f3d041b3a04b0099b19634499541ea26972250986ee4b24a12fac560405160405180910390a4505050565b6108c66109c7565b6040518061010001604052808c60030b81526020018b8b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050509082525060ff8a166020808301919091526040805161040081810183529190930192918b9183908390808284376000920191909152505050815273ffffffffffffffffffffffffffffffffffffffff8816602080830191909152604080518883028181018401835289825291909301929189918991829190850190849080828437600092019190915250505090825250601785900b60208201526040016109b6846112ec565b90529b9a5050505050505050505050565b60408051610100810182526000808252606060208301819052928201529081016109ef610b23565b8152600060208201819052606060408301819052820152608001610a11610b42565b905290565b600183019183908215610a995791602002820160005b83821115610a6a57835183826101000a81548160ff021916908360ff1602179055509260200192600101602081600001049283019260010302610a2c565b8015610a975782816101000a81549060ff0219169055600101602081600001049283019260010302610a6a565b505b50610aa5929150610b95565b5090565b828054828255906000526020600020908101928215610a99579160200282015b82811115610a9957825182547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff909116178255602090920191600190910190610ac9565b6040518061040001604052806020906020820280368337509192915050565b604051806040016040528060007dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19168152602001610a116040518060400160405280600060070b8152602001606081525090565b5b80821115610aa55760008155600101610b96565b600060208284031215610bbc57600080fd5b5035919050565b6000815180845260005b81811015610be957602081850181015186830182015201610bcd565b5060006020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b8060005b6020808210610c3a5750610c51565b825160ff1685529384019390910190600101610c2b565b50505050565b600081518084526020808501945080840160005b83811015610c9d57815173ffffffffffffffffffffffffffffffffffffffff1687529582019590820190600101610c6b565b509495945050505050565b7fffff00000000000000000000000000000000000000000000000000000000000081511682526000602082015160406020850152805160070b60408501526020810151905060406060850152610d016080850182610bc3565b949350505050565b60208152610d1d60208201835160030b9052565b600060208301516104e0806040850152610d3b610500850183610bc3565b91506040850151610d51606086018260ff169052565b506060850151610d646080860182610c27565b50608085015173ffffffffffffffffffffffffffffffffffffffff1661048085015260a08501517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe085840381016104a0870152610dc18483610c57565b935060c08701519150610dda6104c087018360170b9052565b60e0870151915080868503018387015250610df58382610ca8565b9695505050505050565b60008083601f840112610e1157600080fd5b50813567ffffffffffffffff811115610e2957600080fd5b602083019150836020828501011115610e4157600080fd5b9250929050565b60008060208385031215610e5b57600080fd5b823567ffffffffffffffff811115610e7257600080fd5b610e7e85828601610dff565b90969095509350505050565b8035600381900b8114610e9c57600080fd5b919050565b803560ff81168114610e9c57600080fd5b806104008101831015610ec457600080fd5b92915050565b803573ffffffffffffffffffffffffffffffffffffffff81168114610e9c57600080fd5b60008083601f840112610f0057600080fd5b50813567ffffffffffffffff811115610f1857600080fd5b6020830191508360208260051b8501011115610e4157600080fd5b8035601781900b8114610e9c57600080fd5b600060408284031215610f5757600080fd5b50919050565b6000806000806000806000806000806104e08b8d031215610f7d57600080fd5b610f868b610e8a565b995060208b013567ffffffffffffffff80821115610fa357600080fd5b610faf8e838f01610dff565b909b509950899150610fc360408e01610ea1565b9850610fd28e60608f01610eb2565b9750610fe16104608e01610eca565b96506104808d0135915080821115610ff857600080fd5b6110048e838f01610eee565b90965094508491506110196104a08e01610f33565b93506104c08d013591508082111561103057600080fd5b5061103d8d828e01610f45565b9150509295989b9194979a5092959850565b6020808252825182820181905260009190848201906040850190845b8181101561109157835167ffffffffffffffff168352928401929184019160010161106b565b50909695505050505050565b6000806000606084860312156110b257600080fd5b6110bb84610e8a565b92506110c960208501610e8a565b91506110d760408501610e8a565b90509250925092565b81810381811115610ec4577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600181811c9082168061115d57607f821691505b602082108103610f57577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b8183823760009101908152919050565b8183528181602085013750600060208284010152600060207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b602081526000610d016020830184866111a6565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040805190810167ffffffffffffffff8111828210171561125557611255611203565b60405290565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff811182821017156112a2576112a2611203565b604052919050565b80357fffff00000000000000000000000000000000000000000000000000000000000081168114610e9c57600080fd5b8035600781900b8114610e9c57600080fd5b6000604082360312156112fe57600080fd5b611306611232565b61130f836112aa565b815260208084013567ffffffffffffffff8082111561132d57600080fd5b81860191506040823603121561134257600080fd5b61134a611232565b611353836112da565b8152838301358281111561136657600080fd5b929092019136601f84011261137a57600080fd5b82358281111561138c5761138c611203565b6113bc857fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8401160161125b565b925080835236858286010111156113d257600080fd5b8085850186850137600090830185015280840191909152918301919091525092915050565b601f82111561144157600081815260208120601f850160051c8101602086101561141e5750805b601f850160051c820191505b8181101561143d5782815560010161142a565b5050505b505050565b815167ffffffffffffffff81111561146057611460611203565b6114748161146e8454611149565b846113f7565b602080601f8311600181146114c757600084156114915750858301515b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600386901b1c1916600185901b17855561143d565b6000858152602081207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08616915b82811015611514578886015182559484019460019091019084016114f5565b508582101561155057878501517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600388901b60f8161c191681555b5050505050600190811b01905550565b8183526000602080850194508260005b85811015610c9d5773ffffffffffffffffffffffffffffffffffffffff61159683610eca565b1687529582019590820190600101611570565b7fffff0000000000000000000000000000000000000000000000000000000000006115d3826112aa565b168252600060208201357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc183360301811261160d57600080fd5b60406020850152820161161f816112da565b60070b604085015260208101357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe182360301811261165c57600080fd5b0160208101903567ffffffffffffffff81111561167857600080fd5b80360382131561168757600080fd5b6040606086015261169c6080860182846111a6565b95945050505050565b60006104c08083526116ba8184018c8e6111a6565b9050602060ff808c1682860152604085018b60005b848110156116f457836116e183610ea1565b16835291840191908401906001016116cf565b505050505073ffffffffffffffffffffffffffffffffffffffff881661044084015282810361046084015261172a818789611560565b905061173c61048084018660170b9052565b8281036104a084015261174f81856115a9565b9c9b50505050505050505050505056fea164736f6c6343000813000a", + ABI: "[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"int32\",\"name\":\"field\",\"type\":\"int32\"},{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"oracleId\",\"type\":\"uint8\"},{\"components\":[{\"internalType\":\"bytes2\",\"name\":\"FixedBytes\",\"type\":\"bytes2\"},{\"components\":[{\"internalType\":\"int64\",\"name\":\"IntVal\",\"type\":\"int64\"},{\"internalType\":\"string\",\"name\":\"S\",\"type\":\"string\"}],\"internalType\":\"structInnerDynamicTestStruct\",\"name\":\"Inner\",\"type\":\"tuple\"}],\"indexed\":false,\"internalType\":\"structMidLevelDynamicTestStruct\",\"name\":\"nestedDynamicStruct\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bytes2\",\"name\":\"FixedBytes\",\"type\":\"bytes2\"},{\"components\":[{\"internalType\":\"int64\",\"name\":\"IntVal\",\"type\":\"int64\"},{\"internalType\":\"address\",\"name\":\"A\",\"type\":\"address\"}],\"internalType\":\"structInnerStaticTestStruct\",\"name\":\"Inner\",\"type\":\"tuple\"}],\"indexed\":false,\"internalType\":\"structMidLevelStaticTestStruct\",\"name\":\"nestedStaticStruct\",\"type\":\"tuple\"},{\"indexed\":false,\"internalType\":\"uint8[32]\",\"name\":\"oracleIds\",\"type\":\"uint8[32]\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"Account\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"Accounts\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"differentField\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"int192\",\"name\":\"bigField\",\"type\":\"int192\"}],\"name\":\"Triggered\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"string\",\"name\":\"fieldHash\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"field\",\"type\":\"string\"}],\"name\":\"TriggeredEventWithDynamicTopic\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"int32\",\"name\":\"field1\",\"type\":\"int32\"},{\"indexed\":true,\"internalType\":\"int32\",\"name\":\"field2\",\"type\":\"int32\"},{\"indexed\":true,\"internalType\":\"int32\",\"name\":\"field3\",\"type\":\"int32\"}],\"name\":\"TriggeredWithFourTopics\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"string\",\"name\":\"field1\",\"type\":\"string\"},{\"indexed\":true,\"internalType\":\"uint8[32]\",\"name\":\"field2\",\"type\":\"uint8[32]\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"field3\",\"type\":\"bytes32\"}],\"name\":\"TriggeredWithFourTopicsWithHashed\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"int32\",\"name\":\"field\",\"type\":\"int32\"},{\"internalType\":\"string\",\"name\":\"differentField\",\"type\":\"string\"},{\"internalType\":\"uint8\",\"name\":\"oracleId\",\"type\":\"uint8\"},{\"internalType\":\"uint8[32]\",\"name\":\"oracleIds\",\"type\":\"uint8[32]\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"accounts\",\"type\":\"address[]\"},{\"internalType\":\"int192\",\"name\":\"bigField\",\"type\":\"int192\"},{\"components\":[{\"internalType\":\"bytes2\",\"name\":\"FixedBytes\",\"type\":\"bytes2\"},{\"components\":[{\"internalType\":\"int64\",\"name\":\"IntVal\",\"type\":\"int64\"},{\"internalType\":\"string\",\"name\":\"S\",\"type\":\"string\"}],\"internalType\":\"structInnerDynamicTestStruct\",\"name\":\"Inner\",\"type\":\"tuple\"}],\"internalType\":\"structMidLevelDynamicTestStruct\",\"name\":\"nestedDynamicStruct\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bytes2\",\"name\":\"FixedBytes\",\"type\":\"bytes2\"},{\"components\":[{\"internalType\":\"int64\",\"name\":\"IntVal\",\"type\":\"int64\"},{\"internalType\":\"address\",\"name\":\"A\",\"type\":\"address\"}],\"internalType\":\"structInnerStaticTestStruct\",\"name\":\"Inner\",\"type\":\"tuple\"}],\"internalType\":\"structMidLevelStaticTestStruct\",\"name\":\"nestedStaticStruct\",\"type\":\"tuple\"}],\"name\":\"addTestStruct\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAlterablePrimitiveValue\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getDifferentPrimitiveValue\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"i\",\"type\":\"uint256\"}],\"name\":\"getElementAtIndex\",\"outputs\":[{\"components\":[{\"internalType\":\"int32\",\"name\":\"Field\",\"type\":\"int32\"},{\"internalType\":\"string\",\"name\":\"DifferentField\",\"type\":\"string\"},{\"internalType\":\"uint8\",\"name\":\"OracleId\",\"type\":\"uint8\"},{\"internalType\":\"uint8[32]\",\"name\":\"OracleIds\",\"type\":\"uint8[32]\"},{\"internalType\":\"address\",\"name\":\"Account\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"Accounts\",\"type\":\"address[]\"},{\"internalType\":\"int192\",\"name\":\"BigField\",\"type\":\"int192\"},{\"components\":[{\"internalType\":\"bytes2\",\"name\":\"FixedBytes\",\"type\":\"bytes2\"},{\"components\":[{\"internalType\":\"int64\",\"name\":\"IntVal\",\"type\":\"int64\"},{\"internalType\":\"string\",\"name\":\"S\",\"type\":\"string\"}],\"internalType\":\"structInnerDynamicTestStruct\",\"name\":\"Inner\",\"type\":\"tuple\"}],\"internalType\":\"structMidLevelDynamicTestStruct\",\"name\":\"NestedDynamicStruct\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bytes2\",\"name\":\"FixedBytes\",\"type\":\"bytes2\"},{\"components\":[{\"internalType\":\"int64\",\"name\":\"IntVal\",\"type\":\"int64\"},{\"internalType\":\"address\",\"name\":\"A\",\"type\":\"address\"}],\"internalType\":\"structInnerStaticTestStruct\",\"name\":\"Inner\",\"type\":\"tuple\"}],\"internalType\":\"structMidLevelStaticTestStruct\",\"name\":\"NestedStaticStruct\",\"type\":\"tuple\"}],\"internalType\":\"structTestStruct\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getPrimitiveValue\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getSliceValue\",\"outputs\":[{\"internalType\":\"uint64[]\",\"name\":\"\",\"type\":\"uint64[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"int32\",\"name\":\"field\",\"type\":\"int32\"},{\"internalType\":\"string\",\"name\":\"differentField\",\"type\":\"string\"},{\"internalType\":\"uint8\",\"name\":\"oracleId\",\"type\":\"uint8\"},{\"internalType\":\"uint8[32]\",\"name\":\"oracleIds\",\"type\":\"uint8[32]\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"accounts\",\"type\":\"address[]\"},{\"internalType\":\"int192\",\"name\":\"bigField\",\"type\":\"int192\"},{\"components\":[{\"internalType\":\"bytes2\",\"name\":\"FixedBytes\",\"type\":\"bytes2\"},{\"components\":[{\"internalType\":\"int64\",\"name\":\"IntVal\",\"type\":\"int64\"},{\"internalType\":\"string\",\"name\":\"S\",\"type\":\"string\"}],\"internalType\":\"structInnerDynamicTestStruct\",\"name\":\"Inner\",\"type\":\"tuple\"}],\"internalType\":\"structMidLevelDynamicTestStruct\",\"name\":\"nestedDynamicStruct\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bytes2\",\"name\":\"FixedBytes\",\"type\":\"bytes2\"},{\"components\":[{\"internalType\":\"int64\",\"name\":\"IntVal\",\"type\":\"int64\"},{\"internalType\":\"address\",\"name\":\"A\",\"type\":\"address\"}],\"internalType\":\"structInnerStaticTestStruct\",\"name\":\"Inner\",\"type\":\"tuple\"}],\"internalType\":\"structMidLevelStaticTestStruct\",\"name\":\"nestedStaticStruct\",\"type\":\"tuple\"}],\"name\":\"returnSeen\",\"outputs\":[{\"components\":[{\"internalType\":\"int32\",\"name\":\"Field\",\"type\":\"int32\"},{\"internalType\":\"string\",\"name\":\"DifferentField\",\"type\":\"string\"},{\"internalType\":\"uint8\",\"name\":\"OracleId\",\"type\":\"uint8\"},{\"internalType\":\"uint8[32]\",\"name\":\"OracleIds\",\"type\":\"uint8[32]\"},{\"internalType\":\"address\",\"name\":\"Account\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"Accounts\",\"type\":\"address[]\"},{\"internalType\":\"int192\",\"name\":\"BigField\",\"type\":\"int192\"},{\"components\":[{\"internalType\":\"bytes2\",\"name\":\"FixedBytes\",\"type\":\"bytes2\"},{\"components\":[{\"internalType\":\"int64\",\"name\":\"IntVal\",\"type\":\"int64\"},{\"internalType\":\"string\",\"name\":\"S\",\"type\":\"string\"}],\"internalType\":\"structInnerDynamicTestStruct\",\"name\":\"Inner\",\"type\":\"tuple\"}],\"internalType\":\"structMidLevelDynamicTestStruct\",\"name\":\"NestedDynamicStruct\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bytes2\",\"name\":\"FixedBytes\",\"type\":\"bytes2\"},{\"components\":[{\"internalType\":\"int64\",\"name\":\"IntVal\",\"type\":\"int64\"},{\"internalType\":\"address\",\"name\":\"A\",\"type\":\"address\"}],\"internalType\":\"structInnerStaticTestStruct\",\"name\":\"Inner\",\"type\":\"tuple\"}],\"internalType\":\"structMidLevelStaticTestStruct\",\"name\":\"NestedStaticStruct\",\"type\":\"tuple\"}],\"internalType\":\"structTestStruct\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"value\",\"type\":\"uint64\"}],\"name\":\"setAlterablePrimitiveValue\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"int32\",\"name\":\"field\",\"type\":\"int32\"},{\"internalType\":\"uint8\",\"name\":\"oracleId\",\"type\":\"uint8\"},{\"components\":[{\"internalType\":\"bytes2\",\"name\":\"FixedBytes\",\"type\":\"bytes2\"},{\"components\":[{\"internalType\":\"int64\",\"name\":\"IntVal\",\"type\":\"int64\"},{\"internalType\":\"string\",\"name\":\"S\",\"type\":\"string\"}],\"internalType\":\"structInnerDynamicTestStruct\",\"name\":\"Inner\",\"type\":\"tuple\"}],\"internalType\":\"structMidLevelDynamicTestStruct\",\"name\":\"nestedDynamicStruct\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bytes2\",\"name\":\"FixedBytes\",\"type\":\"bytes2\"},{\"components\":[{\"internalType\":\"int64\",\"name\":\"IntVal\",\"type\":\"int64\"},{\"internalType\":\"address\",\"name\":\"A\",\"type\":\"address\"}],\"internalType\":\"structInnerStaticTestStruct\",\"name\":\"Inner\",\"type\":\"tuple\"}],\"internalType\":\"structMidLevelStaticTestStruct\",\"name\":\"nestedStaticStruct\",\"type\":\"tuple\"},{\"internalType\":\"uint8[32]\",\"name\":\"oracleIds\",\"type\":\"uint8[32]\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"accounts\",\"type\":\"address[]\"},{\"internalType\":\"string\",\"name\":\"differentField\",\"type\":\"string\"},{\"internalType\":\"int192\",\"name\":\"bigField\",\"type\":\"int192\"}],\"name\":\"triggerEvent\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"field\",\"type\":\"string\"}],\"name\":\"triggerEventWithDynamicTopic\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"int32\",\"name\":\"field1\",\"type\":\"int32\"},{\"internalType\":\"int32\",\"name\":\"field2\",\"type\":\"int32\"},{\"internalType\":\"int32\",\"name\":\"field3\",\"type\":\"int32\"}],\"name\":\"triggerWithFourTopics\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"field1\",\"type\":\"string\"},{\"internalType\":\"uint8[32]\",\"name\":\"field2\",\"type\":\"uint8[32]\"},{\"internalType\":\"bytes32\",\"name\":\"field3\",\"type\":\"bytes32\"}],\"name\":\"triggerWithFourTopicsWithHashed\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", + Bin: "0x608060405234801561001057600080fd5b50600180548082018255600082905260048082047fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf6908101805460086003958616810261010090810a8088026001600160401b0391820219909416939093179093558654808801909755848704909301805496909516909202900a918202910219909216919091179055611d9a806100a96000396000f3fe608060405234801561001057600080fd5b50600436106100d45760003560e01c80636c9a43b611610081578063dbfd73321161005b578063dbfd7332146101de578063ef4e1ced146101f1578063fbe9fbf6146101f857600080fd5b80636c9a43b614610165578063a90e1998146101ae578063ab5e0b38146101c157600080fd5b80634149667f116100b25780634149667f1461012a5780635f7104a21461013d578063679004a41461015057600080fd5b80631b48259e146100d95780632c45576f146100ee5780633272b66c14610117575b600080fd5b6100ec6100e7366004610f5d565b61020a565b005b6101016100fc366004611061565b610264565b60405161010e91906111ca565b60405180910390f35b6100ec610125366004611323565b6105bc565b610101610138366004611365565b610611565b6100ec61014b366004611365565b610731565b610158610af6565b60405161010e9190611458565b6100ec6101733660046114a6565b600280547fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000001667ffffffffffffffff92909216919091179055565b6100ec6101bc3660046115da565b610b82565b6107c65b60405167ffffffffffffffff909116815260200161010e565b6100ec6101ec36600461168f565b610bdc565b60036101c5565b60025467ffffffffffffffff166101c5565b8a60030b7fae927edae02672fdcce7d7e8cf34c611ed3856914a159df5f2a59307b767c25b8b8b8b8b8b8b8b8b8b8b60405161024f9a99989796959493929190611844565b60405180910390a25050505050505050505050565b61026c610c19565b60006102796001846119c4565b81548110610289576102896119fe565b6000918252602091829020604080516101208101909152600c90920201805460030b825260018101805492939192918401916102c490611a2d565b80601f01602080910402602001604051908101604052809291908181526020018280546102f090611a2d565b801561033d5780601f106103125761010080835404028352916020019161033d565b820191906000526020600020905b81548152906001019060200180831161032057829003601f168201915b5050509183525050600282015460ff166020808301919091526040805161040081018083529190930192916003850191826000855b825461010083900a900460ff1681526020600192830181810494850194909303909202910180841161037257505050928452505050600482015473ffffffffffffffffffffffffffffffffffffffff16602080830191909152600583018054604080518285028101850182528281529401939283018282801561042b57602002820191906000526020600020905b815473ffffffffffffffffffffffffffffffffffffffff168152600190910190602001808311610400575b5050509183525050600682015460170b6020808301919091526040805180820182526007808601805460f01b7fffff0000000000000000000000000000000000000000000000000000000000001683528351808501855260088801805490930b815260098801805495909701969395919486830194919392840191906104b090611a2d565b80601f01602080910402602001604051908101604052809291908181526020018280546104dc90611a2d565b80156105295780601f106104fe57610100808354040283529160200191610529565b820191906000526020600020905b81548152906001019060200180831161050c57829003601f168201915b505050919092525050509052508152604080518082018252600a84015460f01b7fffff0000000000000000000000000000000000000000000000000000000000001681528151808301909252600b90930154600781900b825268010000000000000000900473ffffffffffffffffffffffffffffffffffffffff1660208083019190915280840191909152015292915050565b81816040516105cc929190611a7a565b60405180910390207f3d969732b1bbbb9f1d7eb9f3f14e4cb50a74d950b3ef916a397b85dfbab93c678383604051610605929190611a8a565b60405180910390a25050565b610619610c19565b6040518061012001604052808d60030b81526020018c8c8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050509082525060ff8b166020808301919091526040805161040081810183529190930192918c9183908390808284376000920191909152505050815273ffffffffffffffffffffffffffffffffffffffff891660208083019190915260408051898302818101840183528a82529190930192918a918a91829190850190849080828437600092019190915250505090825250601786900b602082015260400161070985611a9e565b815260200161071d36859003850185611b3c565b905290505b9b9a5050505050505050505050565b60006040518061012001604052808d60030b81526020018c8c8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050509082525060ff8b166020808301919091526040805161040081810183529190930192918c9183908390808284376000920191909152505050815273ffffffffffffffffffffffffffffffffffffffff891660208083019190915260408051898302818101840183528a82529190930192918a918a91829190850190849080828437600092019190915250505090825250601786900b602082015260400161082385611a9e565b815260200161083736859003850185611b3c565b905281546001808201845560009384526020938490208351600c9093020180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000001663ffffffff90931692909217825592820151919290919082019061089d9082611c1b565b5060408201516002820180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660ff90921691909117905560608201516108eb9060038301906020610c9b565b5060808201516004820180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff90921691909117905560a08201518051610952916005840191602090910190610d2e565b5060c08201516006820180547fffffffffffffffff0000000000000000000000000000000000000000000000001677ffffffffffffffffffffffffffffffffffffffffffffffff90921691909117905560e082015180516007830180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00001660f09290921c91909117815560208083015180516008860180547fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000001667ffffffffffffffff909216919091178155918101519091906009860190610a359082611c1b565b5050505061010092909201518051600a8301805460f09290921c7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00009092169190911790556020908101518051600b9093018054919092015173ffffffffffffffffffffffffffffffffffffffff1668010000000000000000027fffffffff0000000000000000000000000000000000000000000000000000000090911667ffffffffffffffff90931692909217919091179055505050505050505050505050565b60606001805480602002602001604051908101604052809291908181526020018280548015610b7857602002820191906000526020600020906000905b82829054906101000a900467ffffffffffffffff1667ffffffffffffffff1681526020019060080190602082600701049283019260010382029150808411610b335790505b5050505050905090565b8082604051610b919190611d35565b604051809103902084604051610ba79190611d71565b604051908190038120907f7220e4dbe4e9d0ed5f71acd022bc89c26748ac6784f2c548bc17bb8e52af34b090600090a4505050565b8060030b8260030b8460030b7f91c80dc390f3d041b3a04b0099b19634499541ea26972250986ee4b24a12fac560405160405180910390a4505050565b6040805161012081018252600080825260606020830181905292820152908101610c41610da8565b8152600060208201819052606060408301819052820152608001610c63610dc7565b8152602001610c966040805180820182526000808252825180840190935280835260208381019190915290919082015290565b905290565b600183019183908215610d1e5791602002820160005b83821115610cef57835183826101000a81548160ff021916908360ff1602179055509260200192600101602081600001049283019260010302610cb1565b8015610d1c5782816101000a81549060ff0219169055600101602081600001049283019260010302610cef565b505b50610d2a929150610e1a565b5090565b828054828255906000526020600020908101928215610d1e579160200282015b82811115610d1e57825182547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff909116178255602090920191600190910190610d4e565b6040518061040001604052806020906020820280368337509192915050565b604051806040016040528060007dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19168152602001610c966040518060400160405280600060070b8152602001606081525090565b5b80821115610d2a5760008155600101610e1b565b8035600381900b8114610e4157600080fd5b919050565b803560ff81168114610e4157600080fd5b600060408284031215610e6957600080fd5b50919050565b600060608284031215610e6957600080fd5b806104008101831015610e9357600080fd5b92915050565b803573ffffffffffffffffffffffffffffffffffffffff81168114610e4157600080fd5b60008083601f840112610ecf57600080fd5b50813567ffffffffffffffff811115610ee757600080fd5b6020830191508360208260051b8501011115610f0257600080fd5b9250929050565b60008083601f840112610f1b57600080fd5b50813567ffffffffffffffff811115610f3357600080fd5b602083019150836020828501011115610f0257600080fd5b8035601781900b8114610e4157600080fd5b60008060008060008060008060008060006105408c8e031215610f7f57600080fd5b610f888c610e2f565b9a50610f9660208d01610e46565b995067ffffffffffffffff8060408e01351115610fb257600080fd5b610fc28e60408f01358f01610e57565b9950610fd18e60608f01610e6f565b9850610fe08e60c08f01610e81565b9750610fef6104c08e01610e99565b9650806104e08e0135111561100357600080fd5b6110148e6104e08f01358f01610ebd565b90965094506105008d013581101561102b57600080fd5b5061103d8d6105008e01358e01610f09565b909350915061104f6105208d01610f4b565b90509295989b509295989b9093969950565b60006020828403121561107357600080fd5b5035919050565b60005b8381101561109557818101518382015260200161107d565b50506000910152565b600081518084526110b681602086016020860161107a565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b8060005b60208082106110fb5750611112565b825160ff16855293840193909101906001016110ec565b50505050565b600081518084526020808501945080840160005b8381101561115e57815173ffffffffffffffffffffffffffffffffffffffff168752958201959082019060010161112c565b509495945050505050565b7fffff00000000000000000000000000000000000000000000000000000000000081511682526000602082015160406020850152805160070b604085015260208101519050604060608501526111c2608085018261109e565b949350505050565b602081526111de60208201835160030b9052565b6000602083015161054060408401526111fb61056084018261109e565b90506040840151611211606085018260ff169052565b50606084015161122460808501826110e8565b50608084015173ffffffffffffffffffffffffffffffffffffffff1661048084015260a08401517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe084830381016104a08601526112818383611118565b925060c0860151915061129a6104c086018360170b9052565b60e0860151915080858403016104e0860152506112b78282611169565b61010086015180517fffff00000000000000000000000000000000000000000000000000000000000016610500870152602080820151805160070b610520890152015173ffffffffffffffffffffffffffffffffffffffff166105408701529092509050509392505050565b6000806020838503121561133657600080fd5b823567ffffffffffffffff81111561134d57600080fd5b61135985828601610f09565b90969095509350505050565b60008060008060008060008060008060006105408c8e03121561138757600080fd5b6113908c610e2f565b9a5067ffffffffffffffff8060208e013511156113ac57600080fd5b6113bc8e60208f01358f01610f09565b909b5099506113cd60408e01610e46565b98506113dc8e60608f01610e81565b97506113eb6104608e01610e99565b9650806104808e013511156113ff57600080fd5b6114108e6104808f01358f01610ebd565b90965094506114226104a08e01610f4b565b9350806104c08e0135111561143657600080fd5b506114488d6104c08e01358e01610e57565b915061104f8d6104e08e01610e6f565b6020808252825182820181905260009190848201906040850190845b8181101561149a57835167ffffffffffffffff1683529284019291840191600101611474565b50909695505050505050565b6000602082840312156114b857600080fd5b813567ffffffffffffffff811681146114d057600080fd5b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040805190810167ffffffffffffffff81118282101715611529576115296114d7565b60405290565b600082601f83011261154057600080fd5b813567ffffffffffffffff8082111561155b5761155b6114d7565b604051601f83017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f011681019082821181831017156115a1576115a16114d7565b816040528381528660208588010111156115ba57600080fd5b836020870160208301376000602085830101528094505050505092915050565b600080600061044084860312156115f057600080fd5b833567ffffffffffffffff8082111561160857600080fd5b6116148783880161152f565b94506020915086603f87011261162957600080fd5b60405161040081018181108382111715611645576116456114d7565b60405290508061042087018881111561165d57600080fd5b8388015b8181101561167f5761167281610e46565b8452928401928401611661565b5095989097509435955050505050565b6000806000606084860312156116a457600080fd5b6116ad84610e2f565b92506116bb60208501610e2f565b91506116c960408501610e2f565b90509250925092565b80357fffff00000000000000000000000000000000000000000000000000000000000081168114610e4157600080fd5b8035600781900b8114610e4157600080fd5b8183528181602085013750600060208284010152600060207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b7fffff000000000000000000000000000000000000000000000000000000000000611787826116d2565b16825261179660208201611702565b60070b602083015273ffffffffffffffffffffffffffffffffffffffff6117bf60408301610e99565b1660408301525050565b8060005b60208082106117dc5750611112565b60ff6117e784610e46565b1685529384019391909101906001016117cd565b8183526000602080850194508260005b8581101561115e5773ffffffffffffffffffffffffffffffffffffffff61183183610e99565b168752958201959082019060010161180b565b600061052060ff8d1683528060208401527fffff00000000000000000000000000000000000000000000000000000000000061187f8d6116d2565b16818401525060208b01357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc18c36030181126118ba57600080fd5b60406105408401528b016118cd81611702565b60070b61056084015260208101357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe182360301811261190b57600080fd5b0160208101903567ffffffffffffffff81111561192757600080fd5b80360382131561193657600080fd5b604061058085015261194d6105a085018284611714565b91505061195d604084018c61175d565b61196a60a084018b6117c9565b73ffffffffffffffffffffffffffffffffffffffff89166104a08401528281036104c084015261199b81888a6117fb565b90508281036104e08401526119b1818688611714565b91505061072261050083018460170b9052565b81810381811115610e93577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600181811c90821680611a4157607f821691505b602082108103610e69577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b8183823760009101908152919050565b6020815260006111c2602083018486611714565b600060408236031215611ab057600080fd5b611ab8611506565b611ac1836116d2565b8152602083013567ffffffffffffffff80821115611ade57600080fd5b818501915060408236031215611af357600080fd5b611afb611506565b611b0483611702565b8152602083013582811115611b1857600080fd5b611b243682860161152f565b60208301525080602085015250505080915050919050565b60008183036060811215611b4f57600080fd5b611b57611506565b611b60846116d2565b815260407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe083011215611b9257600080fd5b611b9a611506565b9150611ba860208501611702565b8252611bb660408501610e99565b6020830152816020820152809250505092915050565b601f821115611c1657600081815260208120601f850160051c81016020861015611bf35750805b601f850160051c820191505b81811015611c1257828155600101611bff565b5050505b505050565b815167ffffffffffffffff811115611c3557611c356114d7565b611c4981611c438454611a2d565b84611bcc565b602080601f831160018114611c9c5760008415611c665750858301515b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600386901b1c1916600185901b178555611c12565b6000858152602081207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08616915b82811015611ce957888601518255948401946001909101908401611cca565b5085821015611d2557878501517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600388901b60f8161c191681555b5050505050600190811b01905550565b60008183825b6020808210611d4a5750611d61565b825160ff1684529283019290910190600101611d3b565b5050506104008201905092915050565b60008251611d8381846020870161107a565b919091019291505056fea164736f6c6343000813000a", } var ChainReaderTesterABI = ChainReaderTesterMetaData.ABI @@ -192,6 +203,28 @@ func (_ChainReaderTester *ChainReaderTesterTransactorRaw) Transact(opts *bind.Tr return _ChainReaderTester.Contract.contract.Transact(opts, method, params...) } +func (_ChainReaderTester *ChainReaderTesterCaller) GetAlterablePrimitiveValue(opts *bind.CallOpts) (uint64, error) { + var out []interface{} + err := _ChainReaderTester.contract.Call(opts, &out, "getAlterablePrimitiveValue") + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +func (_ChainReaderTester *ChainReaderTesterSession) GetAlterablePrimitiveValue() (uint64, error) { + return _ChainReaderTester.Contract.GetAlterablePrimitiveValue(&_ChainReaderTester.CallOpts) +} + +func (_ChainReaderTester *ChainReaderTesterCallerSession) GetAlterablePrimitiveValue() (uint64, error) { + return _ChainReaderTester.Contract.GetAlterablePrimitiveValue(&_ChainReaderTester.CallOpts) +} + func (_ChainReaderTester *ChainReaderTesterCaller) GetDifferentPrimitiveValue(opts *bind.CallOpts) (uint64, error) { var out []interface{} err := _ChainReaderTester.contract.Call(opts, &out, "getDifferentPrimitiveValue") @@ -280,9 +313,9 @@ func (_ChainReaderTester *ChainReaderTesterCallerSession) GetSliceValue() ([]uin return _ChainReaderTester.Contract.GetSliceValue(&_ChainReaderTester.CallOpts) } -func (_ChainReaderTester *ChainReaderTesterCaller) ReturnSeen(opts *bind.CallOpts, field int32, differentField string, oracleId uint8, oracleIds [32]uint8, account common.Address, accounts []common.Address, bigField *big.Int, nestedStruct MidLevelTestStruct) (TestStruct, error) { +func (_ChainReaderTester *ChainReaderTesterCaller) ReturnSeen(opts *bind.CallOpts, field int32, differentField string, oracleId uint8, oracleIds [32]uint8, account common.Address, accounts []common.Address, bigField *big.Int, nestedDynamicStruct MidLevelDynamicTestStruct, nestedStaticStruct MidLevelStaticTestStruct) (TestStruct, error) { var out []interface{} - err := _ChainReaderTester.contract.Call(opts, &out, "returnSeen", field, differentField, oracleId, oracleIds, account, accounts, bigField, nestedStruct) + err := _ChainReaderTester.contract.Call(opts, &out, "returnSeen", field, differentField, oracleId, oracleIds, account, accounts, bigField, nestedDynamicStruct, nestedStaticStruct) if err != nil { return *new(TestStruct), err @@ -294,36 +327,48 @@ func (_ChainReaderTester *ChainReaderTesterCaller) ReturnSeen(opts *bind.CallOpt } -func (_ChainReaderTester *ChainReaderTesterSession) ReturnSeen(field int32, differentField string, oracleId uint8, oracleIds [32]uint8, account common.Address, accounts []common.Address, bigField *big.Int, nestedStruct MidLevelTestStruct) (TestStruct, error) { - return _ChainReaderTester.Contract.ReturnSeen(&_ChainReaderTester.CallOpts, field, differentField, oracleId, oracleIds, account, accounts, bigField, nestedStruct) +func (_ChainReaderTester *ChainReaderTesterSession) ReturnSeen(field int32, differentField string, oracleId uint8, oracleIds [32]uint8, account common.Address, accounts []common.Address, bigField *big.Int, nestedDynamicStruct MidLevelDynamicTestStruct, nestedStaticStruct MidLevelStaticTestStruct) (TestStruct, error) { + return _ChainReaderTester.Contract.ReturnSeen(&_ChainReaderTester.CallOpts, field, differentField, oracleId, oracleIds, account, accounts, bigField, nestedDynamicStruct, nestedStaticStruct) +} + +func (_ChainReaderTester *ChainReaderTesterCallerSession) ReturnSeen(field int32, differentField string, oracleId uint8, oracleIds [32]uint8, account common.Address, accounts []common.Address, bigField *big.Int, nestedDynamicStruct MidLevelDynamicTestStruct, nestedStaticStruct MidLevelStaticTestStruct) (TestStruct, error) { + return _ChainReaderTester.Contract.ReturnSeen(&_ChainReaderTester.CallOpts, field, differentField, oracleId, oracleIds, account, accounts, bigField, nestedDynamicStruct, nestedStaticStruct) } -func (_ChainReaderTester *ChainReaderTesterCallerSession) ReturnSeen(field int32, differentField string, oracleId uint8, oracleIds [32]uint8, account common.Address, accounts []common.Address, bigField *big.Int, nestedStruct MidLevelTestStruct) (TestStruct, error) { - return _ChainReaderTester.Contract.ReturnSeen(&_ChainReaderTester.CallOpts, field, differentField, oracleId, oracleIds, account, accounts, bigField, nestedStruct) +func (_ChainReaderTester *ChainReaderTesterTransactor) AddTestStruct(opts *bind.TransactOpts, field int32, differentField string, oracleId uint8, oracleIds [32]uint8, account common.Address, accounts []common.Address, bigField *big.Int, nestedDynamicStruct MidLevelDynamicTestStruct, nestedStaticStruct MidLevelStaticTestStruct) (*types.Transaction, error) { + return _ChainReaderTester.contract.Transact(opts, "addTestStruct", field, differentField, oracleId, oracleIds, account, accounts, bigField, nestedDynamicStruct, nestedStaticStruct) } -func (_ChainReaderTester *ChainReaderTesterTransactor) AddTestStruct(opts *bind.TransactOpts, field int32, differentField string, oracleId uint8, oracleIds [32]uint8, account common.Address, accounts []common.Address, bigField *big.Int, nestedStruct MidLevelTestStruct) (*types.Transaction, error) { - return _ChainReaderTester.contract.Transact(opts, "addTestStruct", field, differentField, oracleId, oracleIds, account, accounts, bigField, nestedStruct) +func (_ChainReaderTester *ChainReaderTesterSession) AddTestStruct(field int32, differentField string, oracleId uint8, oracleIds [32]uint8, account common.Address, accounts []common.Address, bigField *big.Int, nestedDynamicStruct MidLevelDynamicTestStruct, nestedStaticStruct MidLevelStaticTestStruct) (*types.Transaction, error) { + return _ChainReaderTester.Contract.AddTestStruct(&_ChainReaderTester.TransactOpts, field, differentField, oracleId, oracleIds, account, accounts, bigField, nestedDynamicStruct, nestedStaticStruct) } -func (_ChainReaderTester *ChainReaderTesterSession) AddTestStruct(field int32, differentField string, oracleId uint8, oracleIds [32]uint8, account common.Address, accounts []common.Address, bigField *big.Int, nestedStruct MidLevelTestStruct) (*types.Transaction, error) { - return _ChainReaderTester.Contract.AddTestStruct(&_ChainReaderTester.TransactOpts, field, differentField, oracleId, oracleIds, account, accounts, bigField, nestedStruct) +func (_ChainReaderTester *ChainReaderTesterTransactorSession) AddTestStruct(field int32, differentField string, oracleId uint8, oracleIds [32]uint8, account common.Address, accounts []common.Address, bigField *big.Int, nestedDynamicStruct MidLevelDynamicTestStruct, nestedStaticStruct MidLevelStaticTestStruct) (*types.Transaction, error) { + return _ChainReaderTester.Contract.AddTestStruct(&_ChainReaderTester.TransactOpts, field, differentField, oracleId, oracleIds, account, accounts, bigField, nestedDynamicStruct, nestedStaticStruct) } -func (_ChainReaderTester *ChainReaderTesterTransactorSession) AddTestStruct(field int32, differentField string, oracleId uint8, oracleIds [32]uint8, account common.Address, accounts []common.Address, bigField *big.Int, nestedStruct MidLevelTestStruct) (*types.Transaction, error) { - return _ChainReaderTester.Contract.AddTestStruct(&_ChainReaderTester.TransactOpts, field, differentField, oracleId, oracleIds, account, accounts, bigField, nestedStruct) +func (_ChainReaderTester *ChainReaderTesterTransactor) SetAlterablePrimitiveValue(opts *bind.TransactOpts, value uint64) (*types.Transaction, error) { + return _ChainReaderTester.contract.Transact(opts, "setAlterablePrimitiveValue", value) } -func (_ChainReaderTester *ChainReaderTesterTransactor) TriggerEvent(opts *bind.TransactOpts, field int32, differentField string, oracleId uint8, oracleIds [32]uint8, account common.Address, accounts []common.Address, bigField *big.Int, nestedStruct MidLevelTestStruct) (*types.Transaction, error) { - return _ChainReaderTester.contract.Transact(opts, "triggerEvent", field, differentField, oracleId, oracleIds, account, accounts, bigField, nestedStruct) +func (_ChainReaderTester *ChainReaderTesterSession) SetAlterablePrimitiveValue(value uint64) (*types.Transaction, error) { + return _ChainReaderTester.Contract.SetAlterablePrimitiveValue(&_ChainReaderTester.TransactOpts, value) } -func (_ChainReaderTester *ChainReaderTesterSession) TriggerEvent(field int32, differentField string, oracleId uint8, oracleIds [32]uint8, account common.Address, accounts []common.Address, bigField *big.Int, nestedStruct MidLevelTestStruct) (*types.Transaction, error) { - return _ChainReaderTester.Contract.TriggerEvent(&_ChainReaderTester.TransactOpts, field, differentField, oracleId, oracleIds, account, accounts, bigField, nestedStruct) +func (_ChainReaderTester *ChainReaderTesterTransactorSession) SetAlterablePrimitiveValue(value uint64) (*types.Transaction, error) { + return _ChainReaderTester.Contract.SetAlterablePrimitiveValue(&_ChainReaderTester.TransactOpts, value) } -func (_ChainReaderTester *ChainReaderTesterTransactorSession) TriggerEvent(field int32, differentField string, oracleId uint8, oracleIds [32]uint8, account common.Address, accounts []common.Address, bigField *big.Int, nestedStruct MidLevelTestStruct) (*types.Transaction, error) { - return _ChainReaderTester.Contract.TriggerEvent(&_ChainReaderTester.TransactOpts, field, differentField, oracleId, oracleIds, account, accounts, bigField, nestedStruct) +func (_ChainReaderTester *ChainReaderTesterTransactor) TriggerEvent(opts *bind.TransactOpts, field int32, oracleId uint8, nestedDynamicStruct MidLevelDynamicTestStruct, nestedStaticStruct MidLevelStaticTestStruct, oracleIds [32]uint8, account common.Address, accounts []common.Address, differentField string, bigField *big.Int) (*types.Transaction, error) { + return _ChainReaderTester.contract.Transact(opts, "triggerEvent", field, oracleId, nestedDynamicStruct, nestedStaticStruct, oracleIds, account, accounts, differentField, bigField) +} + +func (_ChainReaderTester *ChainReaderTesterSession) TriggerEvent(field int32, oracleId uint8, nestedDynamicStruct MidLevelDynamicTestStruct, nestedStaticStruct MidLevelStaticTestStruct, oracleIds [32]uint8, account common.Address, accounts []common.Address, differentField string, bigField *big.Int) (*types.Transaction, error) { + return _ChainReaderTester.Contract.TriggerEvent(&_ChainReaderTester.TransactOpts, field, oracleId, nestedDynamicStruct, nestedStaticStruct, oracleIds, account, accounts, differentField, bigField) +} + +func (_ChainReaderTester *ChainReaderTesterTransactorSession) TriggerEvent(field int32, oracleId uint8, nestedDynamicStruct MidLevelDynamicTestStruct, nestedStaticStruct MidLevelStaticTestStruct, oracleIds [32]uint8, account common.Address, accounts []common.Address, differentField string, bigField *big.Int) (*types.Transaction, error) { + return _ChainReaderTester.Contract.TriggerEvent(&_ChainReaderTester.TransactOpts, field, oracleId, nestedDynamicStruct, nestedStaticStruct, oracleIds, account, accounts, differentField, bigField) } func (_ChainReaderTester *ChainReaderTesterTransactor) TriggerEventWithDynamicTopic(opts *bind.TransactOpts, field string) (*types.Transaction, error) { @@ -350,6 +395,18 @@ func (_ChainReaderTester *ChainReaderTesterTransactorSession) TriggerWithFourTop return _ChainReaderTester.Contract.TriggerWithFourTopics(&_ChainReaderTester.TransactOpts, field1, field2, field3) } +func (_ChainReaderTester *ChainReaderTesterTransactor) TriggerWithFourTopicsWithHashed(opts *bind.TransactOpts, field1 string, field2 [32]uint8, field3 [32]byte) (*types.Transaction, error) { + return _ChainReaderTester.contract.Transact(opts, "triggerWithFourTopicsWithHashed", field1, field2, field3) +} + +func (_ChainReaderTester *ChainReaderTesterSession) TriggerWithFourTopicsWithHashed(field1 string, field2 [32]uint8, field3 [32]byte) (*types.Transaction, error) { + return _ChainReaderTester.Contract.TriggerWithFourTopicsWithHashed(&_ChainReaderTester.TransactOpts, field1, field2, field3) +} + +func (_ChainReaderTester *ChainReaderTesterTransactorSession) TriggerWithFourTopicsWithHashed(field1 string, field2 [32]uint8, field3 [32]byte) (*types.Transaction, error) { + return _ChainReaderTester.Contract.TriggerWithFourTopicsWithHashed(&_ChainReaderTester.TransactOpts, field1, field2, field3) +} + type ChainReaderTesterTriggeredIterator struct { Event *ChainReaderTesterTriggered @@ -411,15 +468,16 @@ func (it *ChainReaderTesterTriggeredIterator) Close() error { } type ChainReaderTesterTriggered struct { - Field int32 - DifferentField string - OracleId uint8 - OracleIds [32]uint8 - Account common.Address - Accounts []common.Address - BigField *big.Int - NestedStruct MidLevelTestStruct - Raw types.Log + Field int32 + OracleId uint8 + NestedDynamicStruct MidLevelDynamicTestStruct + NestedStaticStruct MidLevelStaticTestStruct + OracleIds [32]uint8 + Account common.Address + Accounts []common.Address + DifferentField string + BigField *big.Int + Raw types.Log } func (_ChainReaderTester *ChainReaderTesterFilterer) FilterTriggered(opts *bind.FilterOpts, field []int32) (*ChainReaderTesterTriggeredIterator, error) { @@ -757,6 +815,151 @@ func (_ChainReaderTester *ChainReaderTesterFilterer) ParseTriggeredWithFourTopic return event, nil } +type ChainReaderTesterTriggeredWithFourTopicsWithHashedIterator struct { + Event *ChainReaderTesterTriggeredWithFourTopicsWithHashed + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *ChainReaderTesterTriggeredWithFourTopicsWithHashedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(ChainReaderTesterTriggeredWithFourTopicsWithHashed) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(ChainReaderTesterTriggeredWithFourTopicsWithHashed) + 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() + } +} + +func (it *ChainReaderTesterTriggeredWithFourTopicsWithHashedIterator) Error() error { + return it.fail +} + +func (it *ChainReaderTesterTriggeredWithFourTopicsWithHashedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type ChainReaderTesterTriggeredWithFourTopicsWithHashed struct { + Field1 common.Hash + Field2 [32]uint8 + Field3 [32]byte + Raw types.Log +} + +func (_ChainReaderTester *ChainReaderTesterFilterer) FilterTriggeredWithFourTopicsWithHashed(opts *bind.FilterOpts, field1 []string, field2 [][32]uint8, field3 [][32]byte) (*ChainReaderTesterTriggeredWithFourTopicsWithHashedIterator, error) { + + var field1Rule []interface{} + for _, field1Item := range field1 { + field1Rule = append(field1Rule, field1Item) + } + var field2Rule []interface{} + for _, field2Item := range field2 { + field2Rule = append(field2Rule, field2Item) + } + var field3Rule []interface{} + for _, field3Item := range field3 { + field3Rule = append(field3Rule, field3Item) + } + + logs, sub, err := _ChainReaderTester.contract.FilterLogs(opts, "TriggeredWithFourTopicsWithHashed", field1Rule, field2Rule, field3Rule) + if err != nil { + return nil, err + } + return &ChainReaderTesterTriggeredWithFourTopicsWithHashedIterator{contract: _ChainReaderTester.contract, event: "TriggeredWithFourTopicsWithHashed", logs: logs, sub: sub}, nil +} + +func (_ChainReaderTester *ChainReaderTesterFilterer) WatchTriggeredWithFourTopicsWithHashed(opts *bind.WatchOpts, sink chan<- *ChainReaderTesterTriggeredWithFourTopicsWithHashed, field1 []string, field2 [][32]uint8, field3 [][32]byte) (event.Subscription, error) { + + var field1Rule []interface{} + for _, field1Item := range field1 { + field1Rule = append(field1Rule, field1Item) + } + var field2Rule []interface{} + for _, field2Item := range field2 { + field2Rule = append(field2Rule, field2Item) + } + var field3Rule []interface{} + for _, field3Item := range field3 { + field3Rule = append(field3Rule, field3Item) + } + + logs, sub, err := _ChainReaderTester.contract.WatchLogs(opts, "TriggeredWithFourTopicsWithHashed", field1Rule, field2Rule, field3Rule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(ChainReaderTesterTriggeredWithFourTopicsWithHashed) + if err := _ChainReaderTester.contract.UnpackLog(event, "TriggeredWithFourTopicsWithHashed", 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 +} + +func (_ChainReaderTester *ChainReaderTesterFilterer) ParseTriggeredWithFourTopicsWithHashed(log types.Log) (*ChainReaderTesterTriggeredWithFourTopicsWithHashed, error) { + event := new(ChainReaderTesterTriggeredWithFourTopicsWithHashed) + if err := _ChainReaderTester.contract.UnpackLog(event, "TriggeredWithFourTopicsWithHashed", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + func (_ChainReaderTester *ChainReaderTester) ParseLog(log types.Log) (generated.AbigenLog, error) { switch log.Topics[0] { case _ChainReaderTester.abi.Events["Triggered"].ID: @@ -765,6 +968,8 @@ func (_ChainReaderTester *ChainReaderTester) ParseLog(log types.Log) (generated. return _ChainReaderTester.ParseTriggeredEventWithDynamicTopic(log) case _ChainReaderTester.abi.Events["TriggeredWithFourTopics"].ID: return _ChainReaderTester.ParseTriggeredWithFourTopics(log) + case _ChainReaderTester.abi.Events["TriggeredWithFourTopicsWithHashed"].ID: + return _ChainReaderTester.ParseTriggeredWithFourTopicsWithHashed(log) default: return nil, fmt.Errorf("abigen wrapper received unknown log topic: %v", log.Topics[0]) @@ -772,7 +977,7 @@ func (_ChainReaderTester *ChainReaderTester) ParseLog(log types.Log) (generated. } func (ChainReaderTesterTriggered) Topic() common.Hash { - return common.HexToHash("0x7188419dcd8b51877b71766f075f3626586c0ff190e7d056aa65ce9acb649a3d") + return common.HexToHash("0xae927edae02672fdcce7d7e8cf34c611ed3856914a159df5f2a59307b767c25b") } func (ChainReaderTesterTriggeredEventWithDynamicTopic) Topic() common.Hash { @@ -783,11 +988,17 @@ func (ChainReaderTesterTriggeredWithFourTopics) Topic() common.Hash { return common.HexToHash("0x91c80dc390f3d041b3a04b0099b19634499541ea26972250986ee4b24a12fac5") } +func (ChainReaderTesterTriggeredWithFourTopicsWithHashed) Topic() common.Hash { + return common.HexToHash("0x7220e4dbe4e9d0ed5f71acd022bc89c26748ac6784f2c548bc17bb8e52af34b0") +} + func (_ChainReaderTester *ChainReaderTester) Address() common.Address { return _ChainReaderTester.address } type ChainReaderTesterInterface interface { + GetAlterablePrimitiveValue(opts *bind.CallOpts) (uint64, error) + GetDifferentPrimitiveValue(opts *bind.CallOpts) (uint64, error) GetElementAtIndex(opts *bind.CallOpts, i *big.Int) (TestStruct, error) @@ -796,16 +1007,20 @@ type ChainReaderTesterInterface interface { GetSliceValue(opts *bind.CallOpts) ([]uint64, error) - ReturnSeen(opts *bind.CallOpts, field int32, differentField string, oracleId uint8, oracleIds [32]uint8, account common.Address, accounts []common.Address, bigField *big.Int, nestedStruct MidLevelTestStruct) (TestStruct, error) + ReturnSeen(opts *bind.CallOpts, field int32, differentField string, oracleId uint8, oracleIds [32]uint8, account common.Address, accounts []common.Address, bigField *big.Int, nestedDynamicStruct MidLevelDynamicTestStruct, nestedStaticStruct MidLevelStaticTestStruct) (TestStruct, error) - AddTestStruct(opts *bind.TransactOpts, field int32, differentField string, oracleId uint8, oracleIds [32]uint8, account common.Address, accounts []common.Address, bigField *big.Int, nestedStruct MidLevelTestStruct) (*types.Transaction, error) + AddTestStruct(opts *bind.TransactOpts, field int32, differentField string, oracleId uint8, oracleIds [32]uint8, account common.Address, accounts []common.Address, bigField *big.Int, nestedDynamicStruct MidLevelDynamicTestStruct, nestedStaticStruct MidLevelStaticTestStruct) (*types.Transaction, error) - TriggerEvent(opts *bind.TransactOpts, field int32, differentField string, oracleId uint8, oracleIds [32]uint8, account common.Address, accounts []common.Address, bigField *big.Int, nestedStruct MidLevelTestStruct) (*types.Transaction, error) + SetAlterablePrimitiveValue(opts *bind.TransactOpts, value uint64) (*types.Transaction, error) + + TriggerEvent(opts *bind.TransactOpts, field int32, oracleId uint8, nestedDynamicStruct MidLevelDynamicTestStruct, nestedStaticStruct MidLevelStaticTestStruct, oracleIds [32]uint8, account common.Address, accounts []common.Address, differentField string, bigField *big.Int) (*types.Transaction, error) TriggerEventWithDynamicTopic(opts *bind.TransactOpts, field string) (*types.Transaction, error) TriggerWithFourTopics(opts *bind.TransactOpts, field1 int32, field2 int32, field3 int32) (*types.Transaction, error) + TriggerWithFourTopicsWithHashed(opts *bind.TransactOpts, field1 string, field2 [32]uint8, field3 [32]byte) (*types.Transaction, error) + FilterTriggered(opts *bind.FilterOpts, field []int32) (*ChainReaderTesterTriggeredIterator, error) WatchTriggered(opts *bind.WatchOpts, sink chan<- *ChainReaderTesterTriggered, field []int32) (event.Subscription, error) @@ -824,6 +1039,12 @@ type ChainReaderTesterInterface interface { ParseTriggeredWithFourTopics(log types.Log) (*ChainReaderTesterTriggeredWithFourTopics, error) + FilterTriggeredWithFourTopicsWithHashed(opts *bind.FilterOpts, field1 []string, field2 [][32]uint8, field3 [][32]byte) (*ChainReaderTesterTriggeredWithFourTopicsWithHashedIterator, error) + + WatchTriggeredWithFourTopicsWithHashed(opts *bind.WatchOpts, sink chan<- *ChainReaderTesterTriggeredWithFourTopicsWithHashed, field1 []string, field2 [][32]uint8, field3 [][32]byte) (event.Subscription, error) + + ParseTriggeredWithFourTopicsWithHashed(log types.Log) (*ChainReaderTesterTriggeredWithFourTopicsWithHashed, error) + ParseLog(log types.Log) (generated.AbigenLog, error) Address() common.Address diff --git a/core/gethwrappers/generated/i_chain_module/i_chain_module.go b/core/gethwrappers/generated/i_chain_module/i_chain_module.go index 23cec8fb9c8..e432d912cc5 100644 --- a/core/gethwrappers/generated/i_chain_module/i_chain_module.go +++ b/core/gethwrappers/generated/i_chain_module/i_chain_module.go @@ -29,7 +29,7 @@ var ( ) var IChainModuleMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"blockHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"blockNumber\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getCurrentL1Fee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getGasOverhead\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"chainModuleFixedOverhead\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"chainModulePerByteOverhead\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"dataSize\",\"type\":\"uint256\"}],\"name\":\"getMaxL1Fee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", + ABI: "[{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"blockNumber\",\"type\":\"uint256\"}],\"name\":\"blockHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"blockNumber\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"blockNumber\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"dataSize\",\"type\":\"uint256\"}],\"name\":\"getCurrentL1Fee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"l1Fee\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getGasOverhead\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"chainModuleFixedOverhead\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"chainModulePerByteOverhead\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"dataSize\",\"type\":\"uint256\"}],\"name\":\"getMaxL1Fee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"maxL1Fee\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", } var IChainModuleABI = IChainModuleMetaData.ABI @@ -150,9 +150,9 @@ func (_IChainModule *IChainModuleTransactorRaw) Transact(opts *bind.TransactOpts return _IChainModule.Contract.contract.Transact(opts, method, params...) } -func (_IChainModule *IChainModuleCaller) BlockHash(opts *bind.CallOpts, arg0 *big.Int) ([32]byte, error) { +func (_IChainModule *IChainModuleCaller) BlockHash(opts *bind.CallOpts, blockNumber *big.Int) ([32]byte, error) { var out []interface{} - err := _IChainModule.contract.Call(opts, &out, "blockHash", arg0) + err := _IChainModule.contract.Call(opts, &out, "blockHash", blockNumber) if err != nil { return *new([32]byte), err @@ -164,12 +164,12 @@ func (_IChainModule *IChainModuleCaller) BlockHash(opts *bind.CallOpts, arg0 *bi } -func (_IChainModule *IChainModuleSession) BlockHash(arg0 *big.Int) ([32]byte, error) { - return _IChainModule.Contract.BlockHash(&_IChainModule.CallOpts, arg0) +func (_IChainModule *IChainModuleSession) BlockHash(blockNumber *big.Int) ([32]byte, error) { + return _IChainModule.Contract.BlockHash(&_IChainModule.CallOpts, blockNumber) } -func (_IChainModule *IChainModuleCallerSession) BlockHash(arg0 *big.Int) ([32]byte, error) { - return _IChainModule.Contract.BlockHash(&_IChainModule.CallOpts, arg0) +func (_IChainModule *IChainModuleCallerSession) BlockHash(blockNumber *big.Int) ([32]byte, error) { + return _IChainModule.Contract.BlockHash(&_IChainModule.CallOpts, blockNumber) } func (_IChainModule *IChainModuleCaller) BlockNumber(opts *bind.CallOpts) (*big.Int, error) { @@ -194,9 +194,9 @@ func (_IChainModule *IChainModuleCallerSession) BlockNumber() (*big.Int, error) return _IChainModule.Contract.BlockNumber(&_IChainModule.CallOpts) } -func (_IChainModule *IChainModuleCaller) GetCurrentL1Fee(opts *bind.CallOpts) (*big.Int, error) { +func (_IChainModule *IChainModuleCaller) GetCurrentL1Fee(opts *bind.CallOpts, dataSize *big.Int) (*big.Int, error) { var out []interface{} - err := _IChainModule.contract.Call(opts, &out, "getCurrentL1Fee") + err := _IChainModule.contract.Call(opts, &out, "getCurrentL1Fee", dataSize) if err != nil { return *new(*big.Int), err @@ -208,12 +208,12 @@ func (_IChainModule *IChainModuleCaller) GetCurrentL1Fee(opts *bind.CallOpts) (* } -func (_IChainModule *IChainModuleSession) GetCurrentL1Fee() (*big.Int, error) { - return _IChainModule.Contract.GetCurrentL1Fee(&_IChainModule.CallOpts) +func (_IChainModule *IChainModuleSession) GetCurrentL1Fee(dataSize *big.Int) (*big.Int, error) { + return _IChainModule.Contract.GetCurrentL1Fee(&_IChainModule.CallOpts, dataSize) } -func (_IChainModule *IChainModuleCallerSession) GetCurrentL1Fee() (*big.Int, error) { - return _IChainModule.Contract.GetCurrentL1Fee(&_IChainModule.CallOpts) +func (_IChainModule *IChainModuleCallerSession) GetCurrentL1Fee(dataSize *big.Int) (*big.Int, error) { + return _IChainModule.Contract.GetCurrentL1Fee(&_IChainModule.CallOpts, dataSize) } func (_IChainModule *IChainModuleCaller) GetGasOverhead(opts *bind.CallOpts) (GetGasOverhead, @@ -278,11 +278,11 @@ func (_IChainModule *IChainModule) Address() common.Address { } type IChainModuleInterface interface { - BlockHash(opts *bind.CallOpts, arg0 *big.Int) ([32]byte, error) + BlockHash(opts *bind.CallOpts, blockNumber *big.Int) ([32]byte, error) BlockNumber(opts *bind.CallOpts) (*big.Int, error) - GetCurrentL1Fee(opts *bind.CallOpts) (*big.Int, error) + GetCurrentL1Fee(opts *bind.CallOpts, dataSize *big.Int) (*big.Int, error) GetGasOverhead(opts *bind.CallOpts) (GetGasOverhead, diff --git a/core/gethwrappers/generated/optimism_module/optimism_module.go b/core/gethwrappers/generated/optimism_module/optimism_module.go index 009ab6d8cff..89b6a758fcf 100644 --- a/core/gethwrappers/generated/optimism_module/optimism_module.go +++ b/core/gethwrappers/generated/optimism_module/optimism_module.go @@ -29,8 +29,8 @@ var ( ) var OptimismModuleMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"n\",\"type\":\"uint256\"}],\"name\":\"blockHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"blockNumber\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getCurrentL1Fee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getGasOverhead\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"chainModuleFixedOverhead\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"chainModulePerByteOverhead\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"dataSize\",\"type\":\"uint256\"}],\"name\":\"getMaxL1Fee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", - Bin: "0x608060405234801561001057600080fd5b506104d1806100206000396000f3fe608060405234801561001057600080fd5b50600436106100675760003560e01c806357e871e71161005057806357e871e71461009a57806385df51fd146100a0578063de9ee35e146100b357600080fd5b8063125441401461006c57806318b8f61314610092575b600080fd5b61007f61007a3660046102e9565b6100ca565b6040519081526020015b60405180910390f35b61007f6101eb565b4361007f565b61007f6100ae3660046102e9565b6102bc565b6040805161ea60815261010e602082015201610089565b6000806100d8836004610331565b67ffffffffffffffff8111156100f0576100f061034e565b6040519080825280601f01601f19166020018201604052801561011a576020820181803683370190505b50905073420000000000000000000000000000000000000f73ffffffffffffffffffffffffffffffffffffffff166349948e0e82604051806080016040528060508152602001610475605091396040516020016101789291906103a1565b6040516020818303038152906040526040518263ffffffff1660e01b81526004016101a391906103d0565b602060405180830381865afa1580156101c0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101e49190610421565b9392505050565b600073420000000000000000000000000000000000000f73ffffffffffffffffffffffffffffffffffffffff166349948e0e6000366040518060800160405280605081526020016104756050913960405160200161024b9392919061043a565b6040516020818303038152906040526040518263ffffffff1660e01b815260040161027691906103d0565b602060405180830381865afa158015610293573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102b79190610421565b905090565b600043821015806102d757506101006102d58343610461565b115b156102e457506000919050565b504090565b6000602082840312156102fb57600080fd5b5035919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b808202811582820484141761034857610348610302565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60005b83811015610398578181015183820152602001610380565b50506000910152565b600083516103b381846020880161037d565b8351908301906103c781836020880161037d565b01949350505050565b60208152600082518060208401526103ef81604085016020870161037d565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b60006020828403121561043357600080fd5b5051919050565b82848237600083820160008152835161045781836020880161037d565b0195945050505050565b818103818111156103485761034861030256feffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa164736f6c6343000813000a", + ABI: "[{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"n\",\"type\":\"uint256\"}],\"name\":\"blockHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"blockNumber\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"dataSize\",\"type\":\"uint256\"}],\"name\":\"getCurrentL1Fee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getGasOverhead\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"chainModuleFixedOverhead\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"chainModulePerByteOverhead\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"dataSize\",\"type\":\"uint256\"}],\"name\":\"getMaxL1Fee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", + Bin: "0x608060405234801561001057600080fd5b506103dc806100206000396000f3fe608060405234801561001057600080fd5b50600436106100675760003560e01c80637810d12a116100505780637810d12a1461006c57806385df51fd14610098578063de9ee35e146100ab57600080fd5b8063125441401461006c57806357e871e714610092575b600080fd5b61007f61007a366004610221565b6100c2565b6040519081526020015b60405180910390f35b4361007f565b61007f6100a6366004610221565b6100d3565b6040805161ea60815261010e602082015201610089565b60006100cd82610100565b92915050565b600043821015806100ee57506101006100ec8343610269565b115b156100fb57506000919050565b504090565b60008061010e83600461027c565b67ffffffffffffffff81111561012657610126610293565b6040519080825280601f01601f191660200182016040528015610150576020820181803683370190505b50905073420000000000000000000000000000000000000f73ffffffffffffffffffffffffffffffffffffffff166349948e0e82604051806080016040528060508152602001610380605091396040516020016101ae9291906102e6565b6040516020818303038152906040526040518263ffffffff1660e01b81526004016101d99190610315565b602060405180830381865afa1580156101f6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061021a9190610366565b9392505050565b60006020828403121561023357600080fd5b5035919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b818103818111156100cd576100cd61023a565b80820281158282048414176100cd576100cd61023a565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60005b838110156102dd5781810151838201526020016102c5565b50506000910152565b600083516102f88184602088016102c2565b83519083019061030c8183602088016102c2565b01949350505050565b60208152600082518060208401526103348160408501602087016102c2565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b60006020828403121561037857600080fd5b505191905056feffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa164736f6c6343000813000a", } var OptimismModuleABI = OptimismModuleMetaData.ABI @@ -213,9 +213,9 @@ func (_OptimismModule *OptimismModuleCallerSession) BlockNumber() (*big.Int, err return _OptimismModule.Contract.BlockNumber(&_OptimismModule.CallOpts) } -func (_OptimismModule *OptimismModuleCaller) GetCurrentL1Fee(opts *bind.CallOpts) (*big.Int, error) { +func (_OptimismModule *OptimismModuleCaller) GetCurrentL1Fee(opts *bind.CallOpts, dataSize *big.Int) (*big.Int, error) { var out []interface{} - err := _OptimismModule.contract.Call(opts, &out, "getCurrentL1Fee") + err := _OptimismModule.contract.Call(opts, &out, "getCurrentL1Fee", dataSize) if err != nil { return *new(*big.Int), err @@ -227,12 +227,12 @@ func (_OptimismModule *OptimismModuleCaller) GetCurrentL1Fee(opts *bind.CallOpts } -func (_OptimismModule *OptimismModuleSession) GetCurrentL1Fee() (*big.Int, error) { - return _OptimismModule.Contract.GetCurrentL1Fee(&_OptimismModule.CallOpts) +func (_OptimismModule *OptimismModuleSession) GetCurrentL1Fee(dataSize *big.Int) (*big.Int, error) { + return _OptimismModule.Contract.GetCurrentL1Fee(&_OptimismModule.CallOpts, dataSize) } -func (_OptimismModule *OptimismModuleCallerSession) GetCurrentL1Fee() (*big.Int, error) { - return _OptimismModule.Contract.GetCurrentL1Fee(&_OptimismModule.CallOpts) +func (_OptimismModule *OptimismModuleCallerSession) GetCurrentL1Fee(dataSize *big.Int) (*big.Int, error) { + return _OptimismModule.Contract.GetCurrentL1Fee(&_OptimismModule.CallOpts, dataSize) } func (_OptimismModule *OptimismModuleCaller) GetGasOverhead(opts *bind.CallOpts) (GetGasOverhead, @@ -301,7 +301,7 @@ type OptimismModuleInterface interface { BlockNumber(opts *bind.CallOpts) (*big.Int, error) - GetCurrentL1Fee(opts *bind.CallOpts) (*big.Int, error) + GetCurrentL1Fee(opts *bind.CallOpts, dataSize *big.Int) (*big.Int, error) GetGasOverhead(opts *bind.CallOpts) (GetGasOverhead, diff --git a/core/gethwrappers/generated/optimism_module_v2/optimism_module_v2.go b/core/gethwrappers/generated/optimism_module_v2/optimism_module_v2.go new file mode 100644 index 00000000000..abad079caa3 --- /dev/null +++ b/core/gethwrappers/generated/optimism_module_v2/optimism_module_v2.go @@ -0,0 +1,840 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package optimism_module_v2 + +import ( + "errors" + "fmt" + "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" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" +) + +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +var OptimismModuleV2MetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"coefficient\",\"type\":\"uint8\"}],\"name\":\"InvalidL1FeeCoefficient\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"coefficient\",\"type\":\"uint8\"}],\"name\":\"L1FeeCoefficientSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"n\",\"type\":\"uint256\"}],\"name\":\"blockHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"blockNumber\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"dataSize\",\"type\":\"uint256\"}],\"name\":\"getCurrentL1Fee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getGasOverhead\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"chainModuleFixedOverhead\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"chainModulePerByteOverhead\",\"type\":\"uint256\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getL1FeeCoefficient\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"coefficient\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"dataSize\",\"type\":\"uint256\"}],\"name\":\"getMaxL1Fee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"coefficient\",\"type\":\"uint8\"}],\"name\":\"setL1FeeCalculation\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", + Bin: "0x60806040526001805460ff60a01b1916601960a21b17905534801561002357600080fd5b50338060008161007a5760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b03848116919091179091558116156100aa576100aa816100b2565b50505061015b565b336001600160a01b0382160361010a5760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c660000000000000000006044820152606401610071565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b61073f8061016a6000396000f3fe608060405234801561001057600080fd5b50600436106100be5760003560e01c80638da5cb5b11610076578063de9ee35e1161005b578063de9ee35e1461016a578063f22559a014610180578063f2fde38b1461019357600080fd5b80638da5cb5b1461011f578063d10a944e1461014757600080fd5b80637810d12a116100a75780637810d12a146100ef57806379ba50971461010257806385df51fd1461010c57600080fd5b806312544140146100c357806357e871e7146100e9575b600080fd5b6100d66100d136600461060c565b6101a6565b6040519081526020015b60405180910390f35b436100d6565b6100d66100fd36600461060c565b6101b7565b61010a6101f6565b005b6100d661011a36600461060c565b6102f8565b60005460405173ffffffffffffffffffffffffffffffffffffffff90911681526020016100e0565b60015474010000000000000000000000000000000000000000900460ff166100d6565b60408051616d60815260006020820152016100e0565b61010a61018e366004610625565b610325565b61010a6101a136600461064f565b6103f0565b60006101b182610404565b92915050565b600060646101c483610404565b6001546101ec919074010000000000000000000000000000000000000000900460ff166106b4565b6101b191906106cb565b60015473ffffffffffffffffffffffffffffffffffffffff16331461027c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e65720000000000000000000060448201526064015b60405180910390fd5b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b6000438210158061031357506101006103118343610706565b115b1561032057506000919050565b504090565b61032d610494565b60648160ff161115610370576040517f1a8a06a000000000000000000000000000000000000000000000000000000000815260ff82166004820152602401610273565b600180547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff167401000000000000000000000000000000000000000060ff8416908102919091179091556040519081527f29ec9e31de0d3fe0208a7ccb792bbc26a854f123146110daa3a77219cb74a5549060200160405180910390a150565b6103f8610494565b61040181610517565b50565b6040517ff1c7a58b0000000000000000000000000000000000000000000000000000000081526004810182905260009073420000000000000000000000000000000000000f9063f1c7a58b90602401602060405180830381865afa158015610470573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101b19190610719565b60005473ffffffffffffffffffffffffffffffffffffffff163314610515576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e6572000000000000000000006044820152606401610273565b565b3373ffffffffffffffffffffffffffffffffffffffff821603610596576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c660000000000000000006044820152606401610273565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b60006020828403121561061e57600080fd5b5035919050565b60006020828403121561063757600080fd5b813560ff8116811461064857600080fd5b9392505050565b60006020828403121561066157600080fd5b813573ffffffffffffffffffffffffffffffffffffffff8116811461064857600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b80820281158282048414176101b1576101b1610685565b600082610701577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b818103818111156101b1576101b1610685565b60006020828403121561072b57600080fd5b505191905056fea164736f6c6343000813000a", +} + +var OptimismModuleV2ABI = OptimismModuleV2MetaData.ABI + +var OptimismModuleV2Bin = OptimismModuleV2MetaData.Bin + +func DeployOptimismModuleV2(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *OptimismModuleV2, error) { + parsed, err := OptimismModuleV2MetaData.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(OptimismModuleV2Bin), backend) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &OptimismModuleV2{address: address, abi: *parsed, OptimismModuleV2Caller: OptimismModuleV2Caller{contract: contract}, OptimismModuleV2Transactor: OptimismModuleV2Transactor{contract: contract}, OptimismModuleV2Filterer: OptimismModuleV2Filterer{contract: contract}}, nil +} + +type OptimismModuleV2 struct { + address common.Address + abi abi.ABI + OptimismModuleV2Caller + OptimismModuleV2Transactor + OptimismModuleV2Filterer +} + +type OptimismModuleV2Caller struct { + contract *bind.BoundContract +} + +type OptimismModuleV2Transactor struct { + contract *bind.BoundContract +} + +type OptimismModuleV2Filterer struct { + contract *bind.BoundContract +} + +type OptimismModuleV2Session struct { + Contract *OptimismModuleV2 + CallOpts bind.CallOpts + TransactOpts bind.TransactOpts +} + +type OptimismModuleV2CallerSession struct { + Contract *OptimismModuleV2Caller + CallOpts bind.CallOpts +} + +type OptimismModuleV2TransactorSession struct { + Contract *OptimismModuleV2Transactor + TransactOpts bind.TransactOpts +} + +type OptimismModuleV2Raw struct { + Contract *OptimismModuleV2 +} + +type OptimismModuleV2CallerRaw struct { + Contract *OptimismModuleV2Caller +} + +type OptimismModuleV2TransactorRaw struct { + Contract *OptimismModuleV2Transactor +} + +func NewOptimismModuleV2(address common.Address, backend bind.ContractBackend) (*OptimismModuleV2, error) { + abi, err := abi.JSON(strings.NewReader(OptimismModuleV2ABI)) + if err != nil { + return nil, err + } + contract, err := bindOptimismModuleV2(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &OptimismModuleV2{address: address, abi: abi, OptimismModuleV2Caller: OptimismModuleV2Caller{contract: contract}, OptimismModuleV2Transactor: OptimismModuleV2Transactor{contract: contract}, OptimismModuleV2Filterer: OptimismModuleV2Filterer{contract: contract}}, nil +} + +func NewOptimismModuleV2Caller(address common.Address, caller bind.ContractCaller) (*OptimismModuleV2Caller, error) { + contract, err := bindOptimismModuleV2(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &OptimismModuleV2Caller{contract: contract}, nil +} + +func NewOptimismModuleV2Transactor(address common.Address, transactor bind.ContractTransactor) (*OptimismModuleV2Transactor, error) { + contract, err := bindOptimismModuleV2(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &OptimismModuleV2Transactor{contract: contract}, nil +} + +func NewOptimismModuleV2Filterer(address common.Address, filterer bind.ContractFilterer) (*OptimismModuleV2Filterer, error) { + contract, err := bindOptimismModuleV2(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &OptimismModuleV2Filterer{contract: contract}, nil +} + +func bindOptimismModuleV2(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := OptimismModuleV2MetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +func (_OptimismModuleV2 *OptimismModuleV2Raw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _OptimismModuleV2.Contract.OptimismModuleV2Caller.contract.Call(opts, result, method, params...) +} + +func (_OptimismModuleV2 *OptimismModuleV2Raw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _OptimismModuleV2.Contract.OptimismModuleV2Transactor.contract.Transfer(opts) +} + +func (_OptimismModuleV2 *OptimismModuleV2Raw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _OptimismModuleV2.Contract.OptimismModuleV2Transactor.contract.Transact(opts, method, params...) +} + +func (_OptimismModuleV2 *OptimismModuleV2CallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _OptimismModuleV2.Contract.contract.Call(opts, result, method, params...) +} + +func (_OptimismModuleV2 *OptimismModuleV2TransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _OptimismModuleV2.Contract.contract.Transfer(opts) +} + +func (_OptimismModuleV2 *OptimismModuleV2TransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _OptimismModuleV2.Contract.contract.Transact(opts, method, params...) +} + +func (_OptimismModuleV2 *OptimismModuleV2Caller) BlockHash(opts *bind.CallOpts, n *big.Int) ([32]byte, error) { + var out []interface{} + err := _OptimismModuleV2.contract.Call(opts, &out, "blockHash", n) + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +func (_OptimismModuleV2 *OptimismModuleV2Session) BlockHash(n *big.Int) ([32]byte, error) { + return _OptimismModuleV2.Contract.BlockHash(&_OptimismModuleV2.CallOpts, n) +} + +func (_OptimismModuleV2 *OptimismModuleV2CallerSession) BlockHash(n *big.Int) ([32]byte, error) { + return _OptimismModuleV2.Contract.BlockHash(&_OptimismModuleV2.CallOpts, n) +} + +func (_OptimismModuleV2 *OptimismModuleV2Caller) BlockNumber(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _OptimismModuleV2.contract.Call(opts, &out, "blockNumber") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_OptimismModuleV2 *OptimismModuleV2Session) BlockNumber() (*big.Int, error) { + return _OptimismModuleV2.Contract.BlockNumber(&_OptimismModuleV2.CallOpts) +} + +func (_OptimismModuleV2 *OptimismModuleV2CallerSession) BlockNumber() (*big.Int, error) { + return _OptimismModuleV2.Contract.BlockNumber(&_OptimismModuleV2.CallOpts) +} + +func (_OptimismModuleV2 *OptimismModuleV2Caller) GetCurrentL1Fee(opts *bind.CallOpts, dataSize *big.Int) (*big.Int, error) { + var out []interface{} + err := _OptimismModuleV2.contract.Call(opts, &out, "getCurrentL1Fee", dataSize) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_OptimismModuleV2 *OptimismModuleV2Session) GetCurrentL1Fee(dataSize *big.Int) (*big.Int, error) { + return _OptimismModuleV2.Contract.GetCurrentL1Fee(&_OptimismModuleV2.CallOpts, dataSize) +} + +func (_OptimismModuleV2 *OptimismModuleV2CallerSession) GetCurrentL1Fee(dataSize *big.Int) (*big.Int, error) { + return _OptimismModuleV2.Contract.GetCurrentL1Fee(&_OptimismModuleV2.CallOpts, dataSize) +} + +func (_OptimismModuleV2 *OptimismModuleV2Caller) GetGasOverhead(opts *bind.CallOpts) (GetGasOverhead, + + error) { + var out []interface{} + err := _OptimismModuleV2.contract.Call(opts, &out, "getGasOverhead") + + outstruct := new(GetGasOverhead) + if err != nil { + return *outstruct, err + } + + outstruct.ChainModuleFixedOverhead = *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + outstruct.ChainModulePerByteOverhead = *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) + + return *outstruct, err + +} + +func (_OptimismModuleV2 *OptimismModuleV2Session) GetGasOverhead() (GetGasOverhead, + + error) { + return _OptimismModuleV2.Contract.GetGasOverhead(&_OptimismModuleV2.CallOpts) +} + +func (_OptimismModuleV2 *OptimismModuleV2CallerSession) GetGasOverhead() (GetGasOverhead, + + error) { + return _OptimismModuleV2.Contract.GetGasOverhead(&_OptimismModuleV2.CallOpts) +} + +func (_OptimismModuleV2 *OptimismModuleV2Caller) GetL1FeeCoefficient(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _OptimismModuleV2.contract.Call(opts, &out, "getL1FeeCoefficient") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_OptimismModuleV2 *OptimismModuleV2Session) GetL1FeeCoefficient() (*big.Int, error) { + return _OptimismModuleV2.Contract.GetL1FeeCoefficient(&_OptimismModuleV2.CallOpts) +} + +func (_OptimismModuleV2 *OptimismModuleV2CallerSession) GetL1FeeCoefficient() (*big.Int, error) { + return _OptimismModuleV2.Contract.GetL1FeeCoefficient(&_OptimismModuleV2.CallOpts) +} + +func (_OptimismModuleV2 *OptimismModuleV2Caller) GetMaxL1Fee(opts *bind.CallOpts, dataSize *big.Int) (*big.Int, error) { + var out []interface{} + err := _OptimismModuleV2.contract.Call(opts, &out, "getMaxL1Fee", dataSize) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_OptimismModuleV2 *OptimismModuleV2Session) GetMaxL1Fee(dataSize *big.Int) (*big.Int, error) { + return _OptimismModuleV2.Contract.GetMaxL1Fee(&_OptimismModuleV2.CallOpts, dataSize) +} + +func (_OptimismModuleV2 *OptimismModuleV2CallerSession) GetMaxL1Fee(dataSize *big.Int) (*big.Int, error) { + return _OptimismModuleV2.Contract.GetMaxL1Fee(&_OptimismModuleV2.CallOpts, dataSize) +} + +func (_OptimismModuleV2 *OptimismModuleV2Caller) Owner(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _OptimismModuleV2.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 + +} + +func (_OptimismModuleV2 *OptimismModuleV2Session) Owner() (common.Address, error) { + return _OptimismModuleV2.Contract.Owner(&_OptimismModuleV2.CallOpts) +} + +func (_OptimismModuleV2 *OptimismModuleV2CallerSession) Owner() (common.Address, error) { + return _OptimismModuleV2.Contract.Owner(&_OptimismModuleV2.CallOpts) +} + +func (_OptimismModuleV2 *OptimismModuleV2Transactor) AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + return _OptimismModuleV2.contract.Transact(opts, "acceptOwnership") +} + +func (_OptimismModuleV2 *OptimismModuleV2Session) AcceptOwnership() (*types.Transaction, error) { + return _OptimismModuleV2.Contract.AcceptOwnership(&_OptimismModuleV2.TransactOpts) +} + +func (_OptimismModuleV2 *OptimismModuleV2TransactorSession) AcceptOwnership() (*types.Transaction, error) { + return _OptimismModuleV2.Contract.AcceptOwnership(&_OptimismModuleV2.TransactOpts) +} + +func (_OptimismModuleV2 *OptimismModuleV2Transactor) SetL1FeeCalculation(opts *bind.TransactOpts, coefficient uint8) (*types.Transaction, error) { + return _OptimismModuleV2.contract.Transact(opts, "setL1FeeCalculation", coefficient) +} + +func (_OptimismModuleV2 *OptimismModuleV2Session) SetL1FeeCalculation(coefficient uint8) (*types.Transaction, error) { + return _OptimismModuleV2.Contract.SetL1FeeCalculation(&_OptimismModuleV2.TransactOpts, coefficient) +} + +func (_OptimismModuleV2 *OptimismModuleV2TransactorSession) SetL1FeeCalculation(coefficient uint8) (*types.Transaction, error) { + return _OptimismModuleV2.Contract.SetL1FeeCalculation(&_OptimismModuleV2.TransactOpts, coefficient) +} + +func (_OptimismModuleV2 *OptimismModuleV2Transactor) TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) { + return _OptimismModuleV2.contract.Transact(opts, "transferOwnership", to) +} + +func (_OptimismModuleV2 *OptimismModuleV2Session) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _OptimismModuleV2.Contract.TransferOwnership(&_OptimismModuleV2.TransactOpts, to) +} + +func (_OptimismModuleV2 *OptimismModuleV2TransactorSession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _OptimismModuleV2.Contract.TransferOwnership(&_OptimismModuleV2.TransactOpts, to) +} + +type OptimismModuleV2L1FeeCoefficientSetIterator struct { + Event *OptimismModuleV2L1FeeCoefficientSet + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *OptimismModuleV2L1FeeCoefficientSetIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(OptimismModuleV2L1FeeCoefficientSet) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(OptimismModuleV2L1FeeCoefficientSet) + 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() + } +} + +func (it *OptimismModuleV2L1FeeCoefficientSetIterator) Error() error { + return it.fail +} + +func (it *OptimismModuleV2L1FeeCoefficientSetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type OptimismModuleV2L1FeeCoefficientSet struct { + Coefficient uint8 + Raw types.Log +} + +func (_OptimismModuleV2 *OptimismModuleV2Filterer) FilterL1FeeCoefficientSet(opts *bind.FilterOpts) (*OptimismModuleV2L1FeeCoefficientSetIterator, error) { + + logs, sub, err := _OptimismModuleV2.contract.FilterLogs(opts, "L1FeeCoefficientSet") + if err != nil { + return nil, err + } + return &OptimismModuleV2L1FeeCoefficientSetIterator{contract: _OptimismModuleV2.contract, event: "L1FeeCoefficientSet", logs: logs, sub: sub}, nil +} + +func (_OptimismModuleV2 *OptimismModuleV2Filterer) WatchL1FeeCoefficientSet(opts *bind.WatchOpts, sink chan<- *OptimismModuleV2L1FeeCoefficientSet) (event.Subscription, error) { + + logs, sub, err := _OptimismModuleV2.contract.WatchLogs(opts, "L1FeeCoefficientSet") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(OptimismModuleV2L1FeeCoefficientSet) + if err := _OptimismModuleV2.contract.UnpackLog(event, "L1FeeCoefficientSet", 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 +} + +func (_OptimismModuleV2 *OptimismModuleV2Filterer) ParseL1FeeCoefficientSet(log types.Log) (*OptimismModuleV2L1FeeCoefficientSet, error) { + event := new(OptimismModuleV2L1FeeCoefficientSet) + if err := _OptimismModuleV2.contract.UnpackLog(event, "L1FeeCoefficientSet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type OptimismModuleV2OwnershipTransferRequestedIterator struct { + Event *OptimismModuleV2OwnershipTransferRequested + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *OptimismModuleV2OwnershipTransferRequestedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(OptimismModuleV2OwnershipTransferRequested) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(OptimismModuleV2OwnershipTransferRequested) + 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() + } +} + +func (it *OptimismModuleV2OwnershipTransferRequestedIterator) Error() error { + return it.fail +} + +func (it *OptimismModuleV2OwnershipTransferRequestedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type OptimismModuleV2OwnershipTransferRequested struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_OptimismModuleV2 *OptimismModuleV2Filterer) FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*OptimismModuleV2OwnershipTransferRequestedIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _OptimismModuleV2.contract.FilterLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return &OptimismModuleV2OwnershipTransferRequestedIterator{contract: _OptimismModuleV2.contract, event: "OwnershipTransferRequested", logs: logs, sub: sub}, nil +} + +func (_OptimismModuleV2 *OptimismModuleV2Filterer) WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *OptimismModuleV2OwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _OptimismModuleV2.contract.WatchLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(OptimismModuleV2OwnershipTransferRequested) + if err := _OptimismModuleV2.contract.UnpackLog(event, "OwnershipTransferRequested", 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 +} + +func (_OptimismModuleV2 *OptimismModuleV2Filterer) ParseOwnershipTransferRequested(log types.Log) (*OptimismModuleV2OwnershipTransferRequested, error) { + event := new(OptimismModuleV2OwnershipTransferRequested) + if err := _OptimismModuleV2.contract.UnpackLog(event, "OwnershipTransferRequested", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type OptimismModuleV2OwnershipTransferredIterator struct { + Event *OptimismModuleV2OwnershipTransferred + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *OptimismModuleV2OwnershipTransferredIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(OptimismModuleV2OwnershipTransferred) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(OptimismModuleV2OwnershipTransferred) + 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() + } +} + +func (it *OptimismModuleV2OwnershipTransferredIterator) Error() error { + return it.fail +} + +func (it *OptimismModuleV2OwnershipTransferredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type OptimismModuleV2OwnershipTransferred struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_OptimismModuleV2 *OptimismModuleV2Filterer) FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*OptimismModuleV2OwnershipTransferredIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _OptimismModuleV2.contract.FilterLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return &OptimismModuleV2OwnershipTransferredIterator{contract: _OptimismModuleV2.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil +} + +func (_OptimismModuleV2 *OptimismModuleV2Filterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *OptimismModuleV2OwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _OptimismModuleV2.contract.WatchLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(OptimismModuleV2OwnershipTransferred) + if err := _OptimismModuleV2.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 +} + +func (_OptimismModuleV2 *OptimismModuleV2Filterer) ParseOwnershipTransferred(log types.Log) (*OptimismModuleV2OwnershipTransferred, error) { + event := new(OptimismModuleV2OwnershipTransferred) + if err := _OptimismModuleV2.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type GetGasOverhead struct { + ChainModuleFixedOverhead *big.Int + ChainModulePerByteOverhead *big.Int +} + +func (_OptimismModuleV2 *OptimismModuleV2) ParseLog(log types.Log) (generated.AbigenLog, error) { + switch log.Topics[0] { + case _OptimismModuleV2.abi.Events["L1FeeCoefficientSet"].ID: + return _OptimismModuleV2.ParseL1FeeCoefficientSet(log) + case _OptimismModuleV2.abi.Events["OwnershipTransferRequested"].ID: + return _OptimismModuleV2.ParseOwnershipTransferRequested(log) + case _OptimismModuleV2.abi.Events["OwnershipTransferred"].ID: + return _OptimismModuleV2.ParseOwnershipTransferred(log) + + default: + return nil, fmt.Errorf("abigen wrapper received unknown log topic: %v", log.Topics[0]) + } +} + +func (OptimismModuleV2L1FeeCoefficientSet) Topic() common.Hash { + return common.HexToHash("0x29ec9e31de0d3fe0208a7ccb792bbc26a854f123146110daa3a77219cb74a554") +} + +func (OptimismModuleV2OwnershipTransferRequested) Topic() common.Hash { + return common.HexToHash("0xed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae1278") +} + +func (OptimismModuleV2OwnershipTransferred) Topic() common.Hash { + return common.HexToHash("0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0") +} + +func (_OptimismModuleV2 *OptimismModuleV2) Address() common.Address { + return _OptimismModuleV2.address +} + +type OptimismModuleV2Interface interface { + BlockHash(opts *bind.CallOpts, n *big.Int) ([32]byte, error) + + BlockNumber(opts *bind.CallOpts) (*big.Int, error) + + GetCurrentL1Fee(opts *bind.CallOpts, dataSize *big.Int) (*big.Int, error) + + GetGasOverhead(opts *bind.CallOpts) (GetGasOverhead, + + error) + + GetL1FeeCoefficient(opts *bind.CallOpts) (*big.Int, error) + + GetMaxL1Fee(opts *bind.CallOpts, dataSize *big.Int) (*big.Int, error) + + Owner(opts *bind.CallOpts) (common.Address, error) + + AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) + + SetL1FeeCalculation(opts *bind.TransactOpts, coefficient uint8) (*types.Transaction, error) + + TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) + + FilterL1FeeCoefficientSet(opts *bind.FilterOpts) (*OptimismModuleV2L1FeeCoefficientSetIterator, error) + + WatchL1FeeCoefficientSet(opts *bind.WatchOpts, sink chan<- *OptimismModuleV2L1FeeCoefficientSet) (event.Subscription, error) + + ParseL1FeeCoefficientSet(log types.Log) (*OptimismModuleV2L1FeeCoefficientSet, error) + + FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*OptimismModuleV2OwnershipTransferRequestedIterator, error) + + WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *OptimismModuleV2OwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferRequested(log types.Log) (*OptimismModuleV2OwnershipTransferRequested, error) + + FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*OptimismModuleV2OwnershipTransferredIterator, error) + + WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *OptimismModuleV2OwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferred(log types.Log) (*OptimismModuleV2OwnershipTransferred, error) + + ParseLog(log types.Log) (generated.AbigenLog, error) + + Address() common.Address +} diff --git a/core/gethwrappers/generated/scroll_module/scroll_module.go b/core/gethwrappers/generated/scroll_module/scroll_module.go index 702cc39a7ae..e8f48da0d04 100644 --- a/core/gethwrappers/generated/scroll_module/scroll_module.go +++ b/core/gethwrappers/generated/scroll_module/scroll_module.go @@ -5,6 +5,7 @@ package scroll_module import ( "errors" + "fmt" "math/big" "strings" @@ -14,6 +15,7 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/event" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" ) var ( @@ -29,8 +31,8 @@ var ( ) var ScrollModuleMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"n\",\"type\":\"uint256\"}],\"name\":\"blockHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"blockNumber\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getCurrentL1Fee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getGasOverhead\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"chainModuleFixedOverhead\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"chainModulePerByteOverhead\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"dataSize\",\"type\":\"uint256\"}],\"name\":\"getMaxL1Fee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", - Bin: "0x608060405234801561001057600080fd5b5061050c806100206000396000f3fe608060405234801561001057600080fd5b50600436106100675760003560e01c806357e871e71161005057806357e871e71461009a57806385df51fd146100a0578063de9ee35e146100b357600080fd5b8063125441401461006c57806318b8f61314610092575b600080fd5b61007f61007a3660046102e8565b6100c9565b6040519081526020015b60405180910390f35b61007f6101ea565b4361007f565b61007f6100ae3660046102e8565b6102bb565b6040805161afc8815260aa602082015201610089565b6000806100d7836004610330565b67ffffffffffffffff8111156100ef576100ef61034d565b6040519080825280601f01601f191660200182016040528015610119576020820181803683370190505b50905073530000000000000000000000000000000000000273ffffffffffffffffffffffffffffffffffffffff166349948e0e826040518060c00160405280608c8152602001610474608c91396040516020016101779291906103a0565b6040516020818303038152906040526040518263ffffffff1660e01b81526004016101a291906103cf565b602060405180830381865afa1580156101bf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101e39190610420565b9392505050565b600073530000000000000000000000000000000000000273ffffffffffffffffffffffffffffffffffffffff166349948e0e6000366040518060c00160405280608c8152602001610474608c913960405160200161024a93929190610439565b6040516020818303038152906040526040518263ffffffff1660e01b815260040161027591906103cf565b602060405180830381865afa158015610292573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102b69190610420565b905090565b600043821015806102d657506101006102d48343610460565b115b156102e357506000919050565b504090565b6000602082840312156102fa57600080fd5b5035919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b808202811582820484141761034757610347610301565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60005b8381101561039757818101518382015260200161037f565b50506000910152565b600083516103b281846020880161037c565b8351908301906103c681836020880161037c565b01949350505050565b60208152600082518060208401526103ee81604085016020870161037c565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b60006020828403121561043257600080fd5b5051919050565b82848237600083820160008152835161045681836020880161037c565b0195945050505050565b818103818111156103475761034761030156feffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa164736f6c6343000813000a", + ABI: "[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"coefficient\",\"type\":\"uint8\"}],\"name\":\"InvalidL1FeeCoefficient\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"coefficient\",\"type\":\"uint8\"}],\"name\":\"L1FeeCoefficientSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"n\",\"type\":\"uint256\"}],\"name\":\"blockHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"blockNumber\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"dataSize\",\"type\":\"uint256\"}],\"name\":\"getCurrentL1Fee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getGasOverhead\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"chainModuleFixedOverhead\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"chainModulePerByteOverhead\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getL1FeeCoefficient\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"coefficient\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"dataSize\",\"type\":\"uint256\"}],\"name\":\"getMaxL1Fee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"coefficient\",\"type\":\"uint8\"}],\"name\":\"setL1FeeCalculation\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", + Bin: "0x60806040526001805460ff60a01b1916601960a21b17905534801561002357600080fd5b50338060008161007a5760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b03848116919091179091558116156100aa576100aa816100b2565b50505061015b565b336001600160a01b0382160361010a5760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c660000000000000000006044820152606401610071565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b6109288061016a6000396000f3fe608060405234801561001057600080fd5b50600436106100be5760003560e01c80638da5cb5b11610076578063de9ee35e1161005b578063de9ee35e1461016a578063f22559a014610180578063f2fde38b1461019357600080fd5b80638da5cb5b1461011f578063d10a944e1461014757600080fd5b80637810d12a116100a75780637810d12a146100ef57806379ba50971461010257806385df51fd1461010c57600080fd5b806312544140146100c357806357e871e7146100e9575b600080fd5b6100d66100d136600461069d565b6101a6565b6040519081526020015b60405180910390f35b436100d6565b6100d66100fd36600461069d565b6101b7565b61010a6101f6565b005b6100d661011a36600461069d565b6102f8565b60005460405173ffffffffffffffffffffffffffffffffffffffff90911681526020016100e0565b60015474010000000000000000000000000000000000000000900460ff166100d6565b6040805161afc8815260aa6020820152016100e0565b61010a61018e3660046106b6565b610325565b61010a6101a13660046106d9565b6103f0565b60006101b182610404565b92915050565b600060646101c483610404565b6001546101ec919074010000000000000000000000000000000000000000900460ff1661073e565b6101b19190610755565b60015473ffffffffffffffffffffffffffffffffffffffff16331461027c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e65720000000000000000000060448201526064015b60405180910390fd5b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b6000438210158061031357506101006103118343610790565b115b1561032057506000919050565b504090565b61032d610525565b60648160ff161115610370576040517f1a8a06a000000000000000000000000000000000000000000000000000000000815260ff82166004820152602401610273565b600180547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff167401000000000000000000000000000000000000000060ff8416908102919091179091556040519081527f29ec9e31de0d3fe0208a7ccb792bbc26a854f123146110daa3a77219cb74a5549060200160405180910390a150565b6103f8610525565b610401816105a8565b50565b60008061041283600461073e565b67ffffffffffffffff81111561042a5761042a6107a3565b6040519080825280601f01601f191660200182016040528015610454576020820181803683370190505b50905073530000000000000000000000000000000000000273ffffffffffffffffffffffffffffffffffffffff166349948e0e826040518060c00160405280608c8152602001610890608c91396040516020016104b29291906107f6565b6040516020818303038152906040526040518263ffffffff1660e01b81526004016104dd9190610825565b602060405180830381865afa1580156104fa573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061051e9190610876565b9392505050565b60005473ffffffffffffffffffffffffffffffffffffffff1633146105a6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e6572000000000000000000006044820152606401610273565b565b3373ffffffffffffffffffffffffffffffffffffffff821603610627576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c660000000000000000006044820152606401610273565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b6000602082840312156106af57600080fd5b5035919050565b6000602082840312156106c857600080fd5b813560ff8116811461051e57600080fd5b6000602082840312156106eb57600080fd5b813573ffffffffffffffffffffffffffffffffffffffff8116811461051e57600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b80820281158282048414176101b1576101b161070f565b60008261078b577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b818103818111156101b1576101b161070f565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60005b838110156107ed5781810151838201526020016107d5565b50506000910152565b600083516108088184602088016107d2565b83519083019061081c8183602088016107d2565b01949350505050565b60208152600082518060208401526108448160408501602087016107d2565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b60006020828403121561088857600080fd5b505191905056feffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa164736f6c6343000813000a", } var ScrollModuleABI = ScrollModuleMetaData.ABI @@ -213,9 +215,9 @@ func (_ScrollModule *ScrollModuleCallerSession) BlockNumber() (*big.Int, error) return _ScrollModule.Contract.BlockNumber(&_ScrollModule.CallOpts) } -func (_ScrollModule *ScrollModuleCaller) GetCurrentL1Fee(opts *bind.CallOpts) (*big.Int, error) { +func (_ScrollModule *ScrollModuleCaller) GetCurrentL1Fee(opts *bind.CallOpts, dataSize *big.Int) (*big.Int, error) { var out []interface{} - err := _ScrollModule.contract.Call(opts, &out, "getCurrentL1Fee") + err := _ScrollModule.contract.Call(opts, &out, "getCurrentL1Fee", dataSize) if err != nil { return *new(*big.Int), err @@ -227,12 +229,12 @@ func (_ScrollModule *ScrollModuleCaller) GetCurrentL1Fee(opts *bind.CallOpts) (* } -func (_ScrollModule *ScrollModuleSession) GetCurrentL1Fee() (*big.Int, error) { - return _ScrollModule.Contract.GetCurrentL1Fee(&_ScrollModule.CallOpts) +func (_ScrollModule *ScrollModuleSession) GetCurrentL1Fee(dataSize *big.Int) (*big.Int, error) { + return _ScrollModule.Contract.GetCurrentL1Fee(&_ScrollModule.CallOpts, dataSize) } -func (_ScrollModule *ScrollModuleCallerSession) GetCurrentL1Fee() (*big.Int, error) { - return _ScrollModule.Contract.GetCurrentL1Fee(&_ScrollModule.CallOpts) +func (_ScrollModule *ScrollModuleCallerSession) GetCurrentL1Fee(dataSize *big.Int) (*big.Int, error) { + return _ScrollModule.Contract.GetCurrentL1Fee(&_ScrollModule.CallOpts, dataSize) } func (_ScrollModule *ScrollModuleCaller) GetGasOverhead(opts *bind.CallOpts) (GetGasOverhead, @@ -265,6 +267,28 @@ func (_ScrollModule *ScrollModuleCallerSession) GetGasOverhead() (GetGasOverhead return _ScrollModule.Contract.GetGasOverhead(&_ScrollModule.CallOpts) } +func (_ScrollModule *ScrollModuleCaller) GetL1FeeCoefficient(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _ScrollModule.contract.Call(opts, &out, "getL1FeeCoefficient") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_ScrollModule *ScrollModuleSession) GetL1FeeCoefficient() (*big.Int, error) { + return _ScrollModule.Contract.GetL1FeeCoefficient(&_ScrollModule.CallOpts) +} + +func (_ScrollModule *ScrollModuleCallerSession) GetL1FeeCoefficient() (*big.Int, error) { + return _ScrollModule.Contract.GetL1FeeCoefficient(&_ScrollModule.CallOpts) +} + func (_ScrollModule *ScrollModuleCaller) GetMaxL1Fee(opts *bind.CallOpts, dataSize *big.Int) (*big.Int, error) { var out []interface{} err := _ScrollModule.contract.Call(opts, &out, "getMaxL1Fee", dataSize) @@ -287,11 +311,484 @@ func (_ScrollModule *ScrollModuleCallerSession) GetMaxL1Fee(dataSize *big.Int) ( return _ScrollModule.Contract.GetMaxL1Fee(&_ScrollModule.CallOpts, dataSize) } +func (_ScrollModule *ScrollModuleCaller) Owner(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _ScrollModule.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 + +} + +func (_ScrollModule *ScrollModuleSession) Owner() (common.Address, error) { + return _ScrollModule.Contract.Owner(&_ScrollModule.CallOpts) +} + +func (_ScrollModule *ScrollModuleCallerSession) Owner() (common.Address, error) { + return _ScrollModule.Contract.Owner(&_ScrollModule.CallOpts) +} + +func (_ScrollModule *ScrollModuleTransactor) AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + return _ScrollModule.contract.Transact(opts, "acceptOwnership") +} + +func (_ScrollModule *ScrollModuleSession) AcceptOwnership() (*types.Transaction, error) { + return _ScrollModule.Contract.AcceptOwnership(&_ScrollModule.TransactOpts) +} + +func (_ScrollModule *ScrollModuleTransactorSession) AcceptOwnership() (*types.Transaction, error) { + return _ScrollModule.Contract.AcceptOwnership(&_ScrollModule.TransactOpts) +} + +func (_ScrollModule *ScrollModuleTransactor) SetL1FeeCalculation(opts *bind.TransactOpts, coefficient uint8) (*types.Transaction, error) { + return _ScrollModule.contract.Transact(opts, "setL1FeeCalculation", coefficient) +} + +func (_ScrollModule *ScrollModuleSession) SetL1FeeCalculation(coefficient uint8) (*types.Transaction, error) { + return _ScrollModule.Contract.SetL1FeeCalculation(&_ScrollModule.TransactOpts, coefficient) +} + +func (_ScrollModule *ScrollModuleTransactorSession) SetL1FeeCalculation(coefficient uint8) (*types.Transaction, error) { + return _ScrollModule.Contract.SetL1FeeCalculation(&_ScrollModule.TransactOpts, coefficient) +} + +func (_ScrollModule *ScrollModuleTransactor) TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) { + return _ScrollModule.contract.Transact(opts, "transferOwnership", to) +} + +func (_ScrollModule *ScrollModuleSession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _ScrollModule.Contract.TransferOwnership(&_ScrollModule.TransactOpts, to) +} + +func (_ScrollModule *ScrollModuleTransactorSession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _ScrollModule.Contract.TransferOwnership(&_ScrollModule.TransactOpts, to) +} + +type ScrollModuleL1FeeCoefficientSetIterator struct { + Event *ScrollModuleL1FeeCoefficientSet + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *ScrollModuleL1FeeCoefficientSetIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(ScrollModuleL1FeeCoefficientSet) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(ScrollModuleL1FeeCoefficientSet) + 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() + } +} + +func (it *ScrollModuleL1FeeCoefficientSetIterator) Error() error { + return it.fail +} + +func (it *ScrollModuleL1FeeCoefficientSetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type ScrollModuleL1FeeCoefficientSet struct { + Coefficient uint8 + Raw types.Log +} + +func (_ScrollModule *ScrollModuleFilterer) FilterL1FeeCoefficientSet(opts *bind.FilterOpts) (*ScrollModuleL1FeeCoefficientSetIterator, error) { + + logs, sub, err := _ScrollModule.contract.FilterLogs(opts, "L1FeeCoefficientSet") + if err != nil { + return nil, err + } + return &ScrollModuleL1FeeCoefficientSetIterator{contract: _ScrollModule.contract, event: "L1FeeCoefficientSet", logs: logs, sub: sub}, nil +} + +func (_ScrollModule *ScrollModuleFilterer) WatchL1FeeCoefficientSet(opts *bind.WatchOpts, sink chan<- *ScrollModuleL1FeeCoefficientSet) (event.Subscription, error) { + + logs, sub, err := _ScrollModule.contract.WatchLogs(opts, "L1FeeCoefficientSet") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(ScrollModuleL1FeeCoefficientSet) + if err := _ScrollModule.contract.UnpackLog(event, "L1FeeCoefficientSet", 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 +} + +func (_ScrollModule *ScrollModuleFilterer) ParseL1FeeCoefficientSet(log types.Log) (*ScrollModuleL1FeeCoefficientSet, error) { + event := new(ScrollModuleL1FeeCoefficientSet) + if err := _ScrollModule.contract.UnpackLog(event, "L1FeeCoefficientSet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type ScrollModuleOwnershipTransferRequestedIterator struct { + Event *ScrollModuleOwnershipTransferRequested + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *ScrollModuleOwnershipTransferRequestedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(ScrollModuleOwnershipTransferRequested) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(ScrollModuleOwnershipTransferRequested) + 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() + } +} + +func (it *ScrollModuleOwnershipTransferRequestedIterator) Error() error { + return it.fail +} + +func (it *ScrollModuleOwnershipTransferRequestedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type ScrollModuleOwnershipTransferRequested struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_ScrollModule *ScrollModuleFilterer) FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*ScrollModuleOwnershipTransferRequestedIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _ScrollModule.contract.FilterLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return &ScrollModuleOwnershipTransferRequestedIterator{contract: _ScrollModule.contract, event: "OwnershipTransferRequested", logs: logs, sub: sub}, nil +} + +func (_ScrollModule *ScrollModuleFilterer) WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *ScrollModuleOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _ScrollModule.contract.WatchLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(ScrollModuleOwnershipTransferRequested) + if err := _ScrollModule.contract.UnpackLog(event, "OwnershipTransferRequested", 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 +} + +func (_ScrollModule *ScrollModuleFilterer) ParseOwnershipTransferRequested(log types.Log) (*ScrollModuleOwnershipTransferRequested, error) { + event := new(ScrollModuleOwnershipTransferRequested) + if err := _ScrollModule.contract.UnpackLog(event, "OwnershipTransferRequested", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type ScrollModuleOwnershipTransferredIterator struct { + Event *ScrollModuleOwnershipTransferred + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *ScrollModuleOwnershipTransferredIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(ScrollModuleOwnershipTransferred) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(ScrollModuleOwnershipTransferred) + 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() + } +} + +func (it *ScrollModuleOwnershipTransferredIterator) Error() error { + return it.fail +} + +func (it *ScrollModuleOwnershipTransferredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type ScrollModuleOwnershipTransferred struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_ScrollModule *ScrollModuleFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*ScrollModuleOwnershipTransferredIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _ScrollModule.contract.FilterLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return &ScrollModuleOwnershipTransferredIterator{contract: _ScrollModule.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil +} + +func (_ScrollModule *ScrollModuleFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *ScrollModuleOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _ScrollModule.contract.WatchLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(ScrollModuleOwnershipTransferred) + if err := _ScrollModule.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 +} + +func (_ScrollModule *ScrollModuleFilterer) ParseOwnershipTransferred(log types.Log) (*ScrollModuleOwnershipTransferred, error) { + event := new(ScrollModuleOwnershipTransferred) + if err := _ScrollModule.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + type GetGasOverhead struct { ChainModuleFixedOverhead *big.Int ChainModulePerByteOverhead *big.Int } +func (_ScrollModule *ScrollModule) ParseLog(log types.Log) (generated.AbigenLog, error) { + switch log.Topics[0] { + case _ScrollModule.abi.Events["L1FeeCoefficientSet"].ID: + return _ScrollModule.ParseL1FeeCoefficientSet(log) + case _ScrollModule.abi.Events["OwnershipTransferRequested"].ID: + return _ScrollModule.ParseOwnershipTransferRequested(log) + case _ScrollModule.abi.Events["OwnershipTransferred"].ID: + return _ScrollModule.ParseOwnershipTransferred(log) + + default: + return nil, fmt.Errorf("abigen wrapper received unknown log topic: %v", log.Topics[0]) + } +} + +func (ScrollModuleL1FeeCoefficientSet) Topic() common.Hash { + return common.HexToHash("0x29ec9e31de0d3fe0208a7ccb792bbc26a854f123146110daa3a77219cb74a554") +} + +func (ScrollModuleOwnershipTransferRequested) Topic() common.Hash { + return common.HexToHash("0xed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae1278") +} + +func (ScrollModuleOwnershipTransferred) Topic() common.Hash { + return common.HexToHash("0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0") +} + func (_ScrollModule *ScrollModule) Address() common.Address { return _ScrollModule.address } @@ -301,13 +798,43 @@ type ScrollModuleInterface interface { BlockNumber(opts *bind.CallOpts) (*big.Int, error) - GetCurrentL1Fee(opts *bind.CallOpts) (*big.Int, error) + GetCurrentL1Fee(opts *bind.CallOpts, dataSize *big.Int) (*big.Int, error) GetGasOverhead(opts *bind.CallOpts) (GetGasOverhead, error) + GetL1FeeCoefficient(opts *bind.CallOpts) (*big.Int, error) + GetMaxL1Fee(opts *bind.CallOpts, dataSize *big.Int) (*big.Int, error) + Owner(opts *bind.CallOpts) (common.Address, error) + + AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) + + SetL1FeeCalculation(opts *bind.TransactOpts, coefficient uint8) (*types.Transaction, error) + + TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) + + FilterL1FeeCoefficientSet(opts *bind.FilterOpts) (*ScrollModuleL1FeeCoefficientSetIterator, error) + + WatchL1FeeCoefficientSet(opts *bind.WatchOpts, sink chan<- *ScrollModuleL1FeeCoefficientSet) (event.Subscription, error) + + ParseL1FeeCoefficientSet(log types.Log) (*ScrollModuleL1FeeCoefficientSet, error) + + FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*ScrollModuleOwnershipTransferRequestedIterator, error) + + WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *ScrollModuleOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferRequested(log types.Log) (*ScrollModuleOwnershipTransferRequested, error) + + FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*ScrollModuleOwnershipTransferredIterator, error) + + WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *ScrollModuleOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferred(log types.Log) (*ScrollModuleOwnershipTransferred, error) + + ParseLog(log types.Log) (generated.AbigenLog, error) + Address() common.Address } diff --git a/core/gethwrappers/generated/vrf_coordinator_test_v2_5/vrf_coordinator_test_v2_5.go b/core/gethwrappers/generated/vrf_coordinator_test_v2_5/vrf_coordinator_test_v2_5.go new file mode 100644 index 00000000000..6d6d38ef381 --- /dev/null +++ b/core/gethwrappers/generated/vrf_coordinator_test_v2_5/vrf_coordinator_test_v2_5.go @@ -0,0 +1,3994 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package vrf_coordinator_test_v2_5 + +import ( + "errors" + "fmt" + "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" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" +) + +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +type VRFOldProof struct { + Pk [2]*big.Int + Gamma [2]*big.Int + C *big.Int + S *big.Int + Seed *big.Int + UWitness common.Address + CGammaWitness [2]*big.Int + SHashWitness [2]*big.Int + ZInv *big.Int +} + +type VRFTypesRequestCommitmentV2Plus struct { + BlockNum uint64 + SubId *big.Int + CallbackGasLimit uint32 + NumWords uint32 + Sender common.Address + ExtraArgs []byte +} + +type VRFV2PlusClientRandomWordsRequest struct { + KeyHash [32]byte + SubId *big.Int + RequestConfirmations uint16 + CallbackGasLimit uint32 + NumWords uint32 + ExtraArgs []byte +} + +var VRFCoordinatorTestV25MetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"blockhashStore\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"internalBalance\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"externalBalance\",\"type\":\"uint256\"}],\"name\":\"BalanceInvariantViolated\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"blockNum\",\"type\":\"uint256\"}],\"name\":\"BlockhashNotInStore\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"coordinatorAddress\",\"type\":\"address\"}],\"name\":\"CoordinatorAlreadyRegistered\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"coordinatorAddress\",\"type\":\"address\"}],\"name\":\"CoordinatorNotRegistered\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FailedToSendNative\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FailedToTransferLink\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"have\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"want\",\"type\":\"uint32\"}],\"name\":\"GasLimitTooBig\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"gasPrice\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxGas\",\"type\":\"uint256\"}],\"name\":\"GasPriceExceeded\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"IncorrectCommitment\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"IndexOutOfRange\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InsufficientBalance\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidCalldata\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"consumer\",\"type\":\"address\"}],\"name\":\"InvalidConsumer\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidExtraArgsTag\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"int256\",\"name\":\"linkWei\",\"type\":\"int256\"}],\"name\":\"InvalidLinkWeiPrice\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"premiumPercentage\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"max\",\"type\":\"uint8\"}],\"name\":\"InvalidPremiumPercentage\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"have\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"min\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"max\",\"type\":\"uint16\"}],\"name\":\"InvalidRequestConfirmations\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidSubscription\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"LinkAlreadySet\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"flatFeeLinkDiscountPPM\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"flatFeeNativePPM\",\"type\":\"uint32\"}],\"name\":\"LinkDiscountTooHigh\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"LinkNotSet\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"have\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"max\",\"type\":\"uint32\"}],\"name\":\"MsgDataTooBig\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"proposedOwner\",\"type\":\"address\"}],\"name\":\"MustBeRequestedOwner\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"MustBeSubOwner\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NoCorrespondingRequest\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"keyHash\",\"type\":\"bytes32\"}],\"name\":\"NoSuchProvingKey\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"have\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"want\",\"type\":\"uint32\"}],\"name\":\"NumWordsTooBig\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCallableFromLink\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"PaymentTooLarge\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"PendingRequestExists\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"keyHash\",\"type\":\"bytes32\"}],\"name\":\"ProvingKeyAlreadyRegistered\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Reentrant\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TooManyConsumers\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"minimumRequestConfirmations\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"maxGasLimit\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"stalenessSeconds\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"gasAfterPaymentCalculation\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"int256\",\"name\":\"fallbackWeiPerUnitLink\",\"type\":\"int256\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeNativePPM\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeLinkDiscountPPM\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"nativePremiumPercentage\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"linkPremiumPercentage\",\"type\":\"uint8\"}],\"name\":\"ConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"coordinatorAddress\",\"type\":\"address\"}],\"name\":\"CoordinatorDeregistered\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"coordinatorAddress\",\"type\":\"address\"}],\"name\":\"CoordinatorRegistered\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"int256\",\"name\":\"fallbackWeiPerUnitLink\",\"type\":\"int256\"}],\"name\":\"FallbackWeiPerUnitLinkUsed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"FundsRecovered\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newCoordinator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"}],\"name\":\"MigrationCompleted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"NativeFundsRecovered\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"keyHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"maxGas\",\"type\":\"uint64\"}],\"name\":\"ProvingKeyDeregistered\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"keyHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"maxGas\",\"type\":\"uint64\"}],\"name\":\"ProvingKeyRegistered\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"outputSeed\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"payment\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"nativePayment\",\"type\":\"bool\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"success\",\"type\":\"bool\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"onlyPremium\",\"type\":\"bool\"}],\"name\":\"RandomWordsFulfilled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"keyHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"preSeed\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"minimumRequestConfirmations\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"callbackGasLimit\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"numWords\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"extraArgs\",\"type\":\"bytes\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"RandomWordsRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amountLink\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amountNative\",\"type\":\"uint256\"}],\"name\":\"SubscriptionCanceled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"consumer\",\"type\":\"address\"}],\"name\":\"SubscriptionConsumerAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"consumer\",\"type\":\"address\"}],\"name\":\"SubscriptionConsumerRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"SubscriptionCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldBalance\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newBalance\",\"type\":\"uint256\"}],\"name\":\"SubscriptionFunded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldNativeBalance\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newNativeBalance\",\"type\":\"uint256\"}],\"name\":\"SubscriptionFundedWithNative\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"SubscriptionOwnerTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"SubscriptionOwnerTransferred\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"BLOCKHASH_STORE\",\"outputs\":[{\"internalType\":\"contractBlockhashStoreInterface\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"LINK\",\"outputs\":[{\"internalType\":\"contractLinkTokenInterface\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"LINK_NATIVE_FEED\",\"outputs\":[{\"internalType\":\"contractAggregatorV3Interface\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MAX_CONSUMERS\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MAX_NUM_WORDS\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MAX_REQUEST_CONFIRMATIONS\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"}],\"name\":\"acceptSubscriptionOwnerTransfer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"consumer\",\"type\":\"address\"}],\"name\":\"addConsumer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"cancelSubscription\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"createSubscription\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"}],\"name\":\"deregisterMigratableCoordinator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[2]\",\"name\":\"publicProvingKey\",\"type\":\"uint256[2]\"}],\"name\":\"deregisterProvingKey\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256[2]\",\"name\":\"pk\",\"type\":\"uint256[2]\"},{\"internalType\":\"uint256[2]\",\"name\":\"gamma\",\"type\":\"uint256[2]\"},{\"internalType\":\"uint256\",\"name\":\"c\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"s\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"seed\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"uWitness\",\"type\":\"address\"},{\"internalType\":\"uint256[2]\",\"name\":\"cGammaWitness\",\"type\":\"uint256[2]\"},{\"internalType\":\"uint256[2]\",\"name\":\"sHashWitness\",\"type\":\"uint256[2]\"},{\"internalType\":\"uint256\",\"name\":\"zInv\",\"type\":\"uint256\"}],\"internalType\":\"structVRFOld.Proof\",\"name\":\"proof\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"blockNum\",\"type\":\"uint64\"},{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"numWords\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"extraArgs\",\"type\":\"bytes\"}],\"internalType\":\"structVRFTypes.RequestCommitmentV2Plus\",\"name\":\"rc\",\"type\":\"tuple\"},{\"internalType\":\"bool\",\"name\":\"onlyPremium\",\"type\":\"bool\"}],\"name\":\"fulfillRandomWords\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"payment\",\"type\":\"uint96\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"}],\"name\":\"fundSubscriptionWithNative\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"startIndex\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxCount\",\"type\":\"uint256\"}],\"name\":\"getActiveSubscriptionIds\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"ids\",\"type\":\"uint256[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"}],\"name\":\"getSubscription\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"balance\",\"type\":\"uint96\"},{\"internalType\":\"uint96\",\"name\":\"nativeBalance\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"reqCount\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"subOwner\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"consumers\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[2]\",\"name\":\"publicKey\",\"type\":\"uint256[2]\"}],\"name\":\"hashOfKey\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"newCoordinator\",\"type\":\"address\"}],\"name\":\"migrate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"onTokenTransfer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"}],\"name\":\"ownerCancelSubscription\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"}],\"name\":\"pendingRequestExists\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"recoverFunds\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"addresspayable\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"recoverNativeFunds\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"}],\"name\":\"registerMigratableCoordinator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[2]\",\"name\":\"publicProvingKey\",\"type\":\"uint256[2]\"},{\"internalType\":\"uint64\",\"name\":\"maxGas\",\"type\":\"uint64\"}],\"name\":\"registerProvingKey\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"consumer\",\"type\":\"address\"}],\"name\":\"removeConsumer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"keyHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"internalType\":\"uint16\",\"name\":\"requestConfirmations\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"numWords\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraArgs\",\"type\":\"bytes\"}],\"internalType\":\"structVRFV2PlusClient.RandomWordsRequest\",\"name\":\"req\",\"type\":\"tuple\"}],\"name\":\"requestRandomWords\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"subId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"requestSubscriptionOwnerTransfer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_config\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"minimumRequestConfirmations\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"maxGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"bool\",\"name\":\"reentrancyLock\",\"type\":\"bool\"},{\"internalType\":\"uint32\",\"name\":\"stalenessSeconds\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"gasAfterPaymentCalculation\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeNativePPM\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeLinkDiscountPPM\",\"type\":\"uint32\"},{\"internalType\":\"uint8\",\"name\":\"nativePremiumPercentage\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"linkPremiumPercentage\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_currentSubNonce\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_fallbackWeiPerUnitLink\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"s_provingKeyHashes\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"s_provingKeys\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"exists\",\"type\":\"bool\"},{\"internalType\":\"uint64\",\"name\":\"maxGas\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"s_requestCommitments\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_totalBalance\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"\",\"type\":\"uint96\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_totalNativeBalance\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"\",\"type\":\"uint96\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"minimumRequestConfirmations\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"maxGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"stalenessSeconds\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"gasAfterPaymentCalculation\",\"type\":\"uint32\"},{\"internalType\":\"int256\",\"name\":\"fallbackWeiPerUnitLink\",\"type\":\"int256\"},{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeNativePPM\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"fulfillmentFlatFeeLinkDiscountPPM\",\"type\":\"uint32\"},{\"internalType\":\"uint8\",\"name\":\"nativePremiumPercentage\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"linkPremiumPercentage\",\"type\":\"uint8\"}],\"name\":\"setConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"link\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"linkNativeFeed\",\"type\":\"address\"}],\"name\":\"setLINKAndLINKNativeFeed\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"}],\"name\":\"withdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"addresspayable\",\"name\":\"recipient\",\"type\":\"address\"}],\"name\":\"withdrawNative\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", + Bin: "0x60a06040523480156200001157600080fd5b5060405162005e6338038062005e6383398101604081905262000034916200017e565b33806000816200008b5760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000be57620000be81620000d3565b5050506001600160a01b0316608052620001b0565b336001600160a01b038216036200012d5760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640162000082565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b6000602082840312156200019157600080fd5b81516001600160a01b0381168114620001a957600080fd5b9392505050565b608051615c90620001d3600039600081816105d2015261331e0152615c906000f3fe60806040526004361061028c5760003560e01c80638402595e11610164578063b2a7cac5116100c6578063da2f26101161008a578063e72f6e3011610064578063e72f6e3014610904578063ee9d2d3814610924578063f2fde38b1461095157600080fd5b8063da2f261014610854578063dac83d29146108b3578063dc311dd3146108d357600080fd5b8063b2a7cac5146107b4578063bec4c08c146107d4578063caf70c4a146107f4578063cb63179714610814578063d98e620e1461083457600080fd5b80639d40a6fd11610128578063a63e0bfb11610102578063a63e0bfb14610747578063aa433aff14610767578063aefb212f1461078757600080fd5b80639d40a6fd146106da578063a21a23e414610712578063a4c0ed361461072757600080fd5b80638402595e1461064957806386fe91c7146106695780638da5cb5b1461068957806395b55cfc146106a75780639b1c385e146106ba57600080fd5b8063405b84fa1161020d57806364d51a2a116101d157806372e9d565116101ab57806372e9d565146105f457806379ba5097146106145780637a5a2aef1461062957600080fd5b806364d51a2a1461058b57806365982744146105a0578063689c4517146105c057600080fd5b8063405b84fa146104d057806340d6bb82146104f057806341af6c871461051b57806351cff8d91461054b5780635d06b4ab1461056b57600080fd5b806315c48b841161025457806315c48b84146103f157806318e3dd27146104195780631b6b6d23146104585780632f622e6b14610490578063301f42e9146104b057600080fd5b806304104edb14610291578063043bd6ae146102b3578063088070f5146102dc57806308821d58146103b15780630ae09540146103d1575b600080fd5b34801561029d57600080fd5b506102b16102ac366004614f21565b610971565b005b3480156102bf57600080fd5b506102c960105481565b6040519081526020015b60405180910390f35b3480156102e857600080fd5b50600c546103549061ffff81169063ffffffff62010000820481169160ff660100000000000082048116926701000000000000008304811692600160581b8104821692600160781b8204831692600160981b83041691600160b81b8104821691600160c01b9091041689565b6040805161ffff909a168a5263ffffffff98891660208b01529615159689019690965293861660608801529185166080870152841660a08601529290921660c084015260ff91821660e084015216610100820152610120016102d3565b3480156103bd57600080fd5b506102b16103cc366004614f4f565b610aea565b3480156103dd57600080fd5b506102b16103ec366004614f6b565b610ca7565b3480156103fd57600080fd5b5061040660c881565b60405161ffff90911681526020016102d3565b34801561042557600080fd5b50600a5461044090600160601b90046001600160601b031681565b6040516001600160601b0390911681526020016102d3565b34801561046457600080fd5b50600254610478906001600160a01b031681565b6040516001600160a01b0390911681526020016102d3565b34801561049c57600080fd5b506102b16104ab366004614f21565b610cef565b3480156104bc57600080fd5b506104406104cb3660046151cd565b610d95565b3480156104dc57600080fd5b506102b16104eb366004614f6b565b6110ab565b3480156104fc57600080fd5b506105066101f481565b60405163ffffffff90911681526020016102d3565b34801561052757600080fd5b5061053b6105363660046152bb565b61148d565b60405190151581526020016102d3565b34801561055757600080fd5b506102b1610566366004614f21565b611541565b34801561057757600080fd5b506102b1610586366004614f21565b611666565b34801561059757600080fd5b50610406606481565b3480156105ac57600080fd5b506102b16105bb3660046152d4565b611724565b3480156105cc57600080fd5b506104787f000000000000000000000000000000000000000000000000000000000000000081565b34801561060057600080fd5b50600354610478906001600160a01b031681565b34801561062057600080fd5b506102b1611784565b34801561063557600080fd5b506102b1610644366004615302565b611835565b34801561065557600080fd5b506102b1610664366004614f21565b611969565b34801561067557600080fd5b50600a54610440906001600160601b031681565b34801561069557600080fd5b506000546001600160a01b0316610478565b6102b16106b53660046152bb565b611a84565b3480156106c657600080fd5b506102c96106d5366004615336565b611b94565b3480156106e657600080fd5b506007546106fa906001600160401b031681565b6040516001600160401b0390911681526020016102d3565b34801561071e57600080fd5b506102c9611fda565b34801561073357600080fd5b506102b1610742366004615370565b6121c1565b34801561075357600080fd5b506102b161076236600461541b565b612329565b34801561077357600080fd5b506102b16107823660046152bb565b612610565b34801561079357600080fd5b506107a76107a23660046154bc565b612643565b6040516102d39190615519565b3480156107c057600080fd5b506102b16107cf3660046152bb565b612745565b3480156107e057600080fd5b506102b16107ef366004614f6b565b612834565b34801561080057600080fd5b506102c961080f36600461552c565b612927565b34801561082057600080fd5b506102b161082f366004614f6b565b612957565b34801561084057600080fd5b506102c961084f3660046152bb565b612bc5565b34801561086057600080fd5b5061089461086f3660046152bb565b600d6020526000908152604090205460ff81169061010090046001600160401b031682565b6040805192151583526001600160401b039091166020830152016102d3565b3480156108bf57600080fd5b506102b16108ce366004614f6b565b612be6565b3480156108df57600080fd5b506108f36108ee3660046152bb565b612c81565b6040516102d3959493929190615581565b34801561091057600080fd5b506102b161091f366004614f21565b612d5a565b34801561093057600080fd5b506102c961093f3660046152bb565b600f6020526000908152604090205481565b34801561095d57600080fd5b506102b161096c366004614f21565b612f1b565b610979612f2c565b60115460005b81811015610abd57826001600160a01b0316601182815481106109a4576109a46155d6565b6000918252602090912001546001600160a01b031603610aad5760116109cb600184615602565b815481106109db576109db6155d6565b600091825260209091200154601180546001600160a01b039092169183908110610a0757610a076155d6565b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b031602179055506011805480610a4657610a46615615565b6000828152602090819020600019908301810180546001600160a01b03191690559091019091556040516001600160a01b03851681527ff80a1a97fd42251f3c33cda98635e7399253033a6774fe37cd3f650b5282af3791015b60405180910390a1505050565b610ab68161562b565b905061097f565b50604051635428d44960e01b81526001600160a01b03831660048201526024015b60405180910390fd5b50565b610af2612f2c565b604080518082018252600091610b21919084906002908390839080828437600092019190915250612927915050565b6000818152600d602090815260409182902082518084019093525460ff811615158084526101009091046001600160401b03169183019190915291925090610b7f57604051631dfd6e1360e21b815260048101839052602401610ade565b6000828152600d60205260408120805468ffffffffffffffffff19169055600e54905b81811015610c515783600e8281548110610bbe57610bbe6155d6565b906000526020600020015403610c4157600e610bdb600184615602565b81548110610beb57610beb6155d6565b9060005260206000200154600e8281548110610c0957610c096155d6565b600091825260209091200155600e805480610c2657610c26615615565b60019003818190600052602060002001600090559055610c51565b610c4a8161562b565b9050610ba2565b507f9b6868e0eb737bcd72205360baa6bfd0ba4e4819a33ade2db384e8a8025639a5838360200151604051610c999291909182526001600160401b0316602082015260400190565b60405180910390a150505050565b81610cb181612f88565b610cb9612fdd565b610cc28361148d565b15610ce057604051631685ecdd60e31b815260040160405180910390fd5b610cea838361300b565b505050565b610cf7612fdd565b610cff612f2c565b600b54600160601b90046001600160601b0316610d1d8115156130ee565b600b80546bffffffffffffffffffffffff60601b19169055600a8054829190600c90610d5a908490600160601b90046001600160601b0316615644565b92506101000a8154816001600160601b0302191690836001600160601b03160217905550610d9182826001600160601b031661310c565b5050565b6000610d9f612fdd565b60005a9050610324361115610dd157604051630f28961b60e01b81523660048201526103246024820152604401610ade565b6000610ddd8686613180565b90506000610df385836000015160200151613431565b60408301516060888101519293509163ffffffff16806001600160401b03811115610e2057610e20614f9b565b604051908082528060200260200182016040528015610e49578160200160208202803683370190505b50925060005b81811015610eb15760408051602081018590529081018290526060016040516020818303038152906040528051906020012060001c848281518110610e9657610e966155d6565b6020908102919091010152610eaa8161562b565b9050610e4f565b5050602080850180516000908152600f9092526040822082905551610ed7908a8561348c565b60208a8101516000908152600690915260409020805491925090601890610f0d90600160c01b90046001600160401b0316615664565b82546101009290920a6001600160401b0381810219909316918316021790915560808a01516001600160a01b03166000908152600460209081526040808320828e01518452909152902080549091600991610f7091600160481b9091041661568a565b91906101000a8154816001600160401b0302191690836001600160401b0316021790555060008960a0015160018b60a0015151610fad9190615602565b81518110610fbd57610fbd6155d6565b60209101015160f81c60011490506000610fd98887848d613530565b909950905080156110245760208088015160105460408051928352928201527f6ca648a381f22ead7e37773d934e64885dcf861fbfbb26c40354cbf0c4662d1a910160405180910390a15b5061103488828c60200151613568565b6020808b015187820151604080518781526001600160601b038d16948101949094528415159084015284151560608401528b1515608084015290917faeb4b4786571e184246d39587f659abf0e26f41f6a3358692250382c0cdb47b79060a00160405180910390a3505050505050505b9392505050565b6110b3612fdd565b6110bc816136c5565b6110e457604051635428d44960e01b81526001600160a01b0382166004820152602401610ade565b6000806000806110f386612c81565b945094505093509350336001600160a01b0316826001600160a01b03161461115d5760405162461bcd60e51b815260206004820152601660248201527f4e6f7420737562736372697074696f6e206f776e6572000000000000000000006044820152606401610ade565b6111668661148d565b156111b35760405162461bcd60e51b815260206004820152601660248201527f50656e64696e67207265717565737420657869737473000000000000000000006044820152606401610ade565b6040805160c0810182526001815260208082018990526001600160a01b03851682840152606082018490526001600160601b038088166080840152861660a083015291519091600091611208918491016156ad565b604051602081830303815290604052905061122288613730565b505060405163ce3f471960e01b81526001600160a01b0388169063ce3f4719906001600160601b0388169061125b908590600401615772565b6000604051808303818588803b15801561127457600080fd5b505af1158015611288573d6000803e3d6000fd5b50506002546001600160a01b0316158015935091506112b1905057506001600160601b03861615155b156113815760025460405163a9059cbb60e01b81526001600160a01b0389811660048301526001600160601b03891660248301529091169063a9059cbb906044016020604051808303816000875af1158015611311573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113359190615785565b6113815760405162461bcd60e51b815260206004820152601260248201527f696e73756666696369656e742066756e647300000000000000000000000000006044820152606401610ade565b600c805466ff0000000000001916660100000000000017905560005b8351811015611430578381815181106113b8576113b86155d6565b6020908102919091010151604051638ea9811760e01b81526001600160a01b038a8116600483015290911690638ea9811790602401600060405180830381600087803b15801561140757600080fd5b505af115801561141b573d6000803e3d6000fd5b50505050806114299061562b565b905061139d565b50600c805466ff00000000000019169055604080516001600160a01b0389168152602081018a90527fd63ca8cb945956747ee69bfdc3ea754c24a4caf7418db70e46052f7850be4187910160405180910390a15050505050505050565b600081815260056020526040812060020180548083036114b1575060009392505050565b60005b81811015611536576000600460008584815481106114d4576114d46155d6565b60009182526020808320909101546001600160a01b0316835282810193909352604091820181208982529092529020546001600160401b03600160481b90910416111561152657506001949350505050565b61152f8161562b565b90506114b4565b506000949350505050565b611549612fdd565b611551612f2c565b6002546001600160a01b031661157a5760405163c1f0c0a160e01b815260040160405180910390fd5b600b546001600160601b03166115918115156130ee565b600b80546bffffffffffffffffffffffff19169055600a80548291906000906115c49084906001600160601b0316615644565b82546101009290920a6001600160601b0381810219909316918316021790915560025460405163a9059cbb60e01b81526001600160a01b0386811660048301529285166024820152610d91935091169063a9059cbb906044015b6020604051808303816000875af115801561163d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116619190615785565b6130ee565b61166e612f2c565b611677816136c5565b156116a05760405163ac8a27ef60e01b81526001600160a01b0382166004820152602401610ade565b601180546001810182556000919091527f31ecc21a745e3968a04e9570e4425bc18fa8019c68028196b546d1669c200c680180546001600160a01b0319166001600160a01b0383169081179091556040519081527fb7cabbfc11e66731fc77de0444614282023bcbd41d16781c753a431d0af016259060200160405180910390a150565b61172c612f2c565b6002546001600160a01b03161561175657604051631688c53760e11b815260040160405180910390fd5b600280546001600160a01b039384166001600160a01b03199182161790915560038054929093169116179055565b6001546001600160a01b031633146117de5760405162461bcd60e51b815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e6572000000000000000000006044820152606401610ade565b60008054336001600160a01b0319808316821784556001805490911690556040516001600160a01b0390921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b61183d612f2c565b60408051808201825260009161186c919085906002908390839080828437600092019190915250612927915050565b6000818152600d602052604090205490915060ff16156118a257604051634a0b8fa760e01b815260048101829052602401610ade565b60408051808201825260018082526001600160401b0385811660208085018281526000888152600d835287812096518754925168ffffffffffffffffff1990931690151568ffffffffffffffff00191617610100929095169190910293909317909455600e805493840181559091527fbb7b4a454dc3493923482f07822329ed19e8244eff582cc204f8554c3620c3fd9091018490558251848152918201527f9b911b2c240bfbef3b6a8f7ed6ee321d1258bb2a3fe6becab52ac1cd3210afd39101610aa0565b611971612f2c565b600a544790600160601b90046001600160601b0316818111156119b1576040516354ced18160e11b81526004810182905260248101839052604401610ade565b81811015610cea5760006119c58284615602565b90506000846001600160a01b03168260405160006040518083038185875af1925050503d8060008114611a14576040519150601f19603f3d011682016040523d82523d6000602084013e611a19565b606091505b5050905080611a3b5760405163950b247960e01b815260040160405180910390fd5b604080516001600160a01b0387168152602081018490527f4aed7c8eed0496c8c19ea2681fcca25741c1602342e38b045d9f1e8e905d2e9c910160405180910390a15050505050565b611a8c612fdd565b600081815260056020526040902054611aad906001600160a01b03166138e2565b60008181526006602052604090208054600160601b90046001600160601b0316903490600c611adc83856157a2565b92506101000a8154816001600160601b0302191690836001600160601b0316021790555034600a600c8282829054906101000a90046001600160601b0316611b2491906157a2565b92506101000a8154816001600160601b0302191690836001600160601b03160217905550817f7603b205d03651ee812f803fccde89f1012e545a9c99f0abfea9cedd0fd8e902823484611b7791906157c2565b604080519283526020830191909152015b60405180910390a25050565b6000611b9e612fdd565b602080830135600081815260059092526040909120546001600160a01b0316611bda57604051630fb532db60e11b815260040160405180910390fd5b336000908152600460209081526040808320848452808352928190208151606081018352905460ff811615158083526001600160401b036101008304811695840195909552600160481b9091049093169181019190915290611c58576040516379bfd40160e01b815260048101849052336024820152604401610ade565b600c5461ffff16611c6f60608701604088016157d5565b61ffff161080611c92575060c8611c8c60608701604088016157d5565b61ffff16115b15611cd857611ca760608601604087016157d5565b600c5460405163539c34bb60e11b815261ffff92831660048201529116602482015260c86044820152606401610ade565b600c5462010000900463ffffffff16611cf760808701606088016157f0565b63ffffffff161115611d4757611d1360808601606087016157f0565b600c54604051637aebf00f60e11b815263ffffffff9283166004820152620100009091049091166024820152604401610ade565b6101f4611d5a60a08701608088016157f0565b63ffffffff161115611da057611d7660a08601608087016157f0565b6040516311ce1afb60e21b815263ffffffff90911660048201526101f46024820152604401610ade565b806020018051611daf90615664565b6001600160401b03169052604081018051611dc990615664565b6001600160401b03908116909152602082810151604080518935818501819052338284015260608201899052929094166080808601919091528151808603909101815260a08501825280519084012060c085019290925260e08085018390528151808603909101815261010090940190528251929091019190912060009190955090506000611e6b611e66611e6160a08a018a61580b565b613909565b61398a565b905085611e766139fb565b86611e8760808b0160608c016157f0565b611e9760a08c0160808d016157f0565b3386604051602001611eaf9796959493929190615858565b60405160208183030381529060405280519060200120600f600088815260200190815260200160002081905550336001600160a01b03168588600001357feb0e3652e0f44f417695e6e90f2f42c99b65cd7169074c5a654b16b9748c3a4e89868c6040016020810190611f2291906157d5565b8d6060016020810190611f3591906157f0565b8e6080016020810190611f4891906157f0565b89604051611f5b969594939291906158af565b60405180910390a45050600092835260209182526040928390208151815493830151929094015168ffffffffffffffffff1990931693151568ffffffffffffffff001916939093176101006001600160401b03928316021770ffffffffffffffff0000000000000000001916600160481b91909216021790555b919050565b6000611fe4612fdd565b6007546001600160401b031633611ffc600143615602565b6040516bffffffffffffffffffffffff19606093841b81166020830152914060348201523090921b1660548201526001600160c01b031960c083901b16606882015260700160408051601f19818403018152919052805160209091012091506120668160016158ee565b6007805467ffffffffffffffff19166001600160401b03928316179055604080516000808252608082018352602080830182815283850183815260608086018581528a86526006855287862093518454935191516001600160601b039182166001600160c01b031990951694909417600160601b91909216021777ffffffffffffffffffffffffffffffffffffffffffffffff16600160c01b9290981691909102969096179055835194850184523385528481018281528585018481528884526005835294909220855181546001600160a01b03199081166001600160a01b0392831617835593516001830180549095169116179092559251805192949391926121769260028501920190614e0f565b5061218691506008905084613a7c565b5060405133815283907f1d3015d7ba850fa198dc7b1a3f5d42779313a681035f77c8c03764c61005518d9060200160405180910390a2505090565b6121c9612fdd565b6002546001600160a01b031633146121f4576040516344b0e3c360e01b815260040160405180910390fd5b6020811461221557604051638129bbcd60e01b815260040160405180910390fd5b6000612223828401846152bb565b600081815260056020526040902054909150612247906001600160a01b03166138e2565b600081815260066020526040812080546001600160601b03169186919061226e83856157a2565b92506101000a8154816001600160601b0302191690836001600160601b0316021790555084600a60008282829054906101000a90046001600160601b03166122b691906157a2565b92506101000a8154816001600160601b0302191690836001600160601b03160217905550817f1ced9348ff549fceab2ac57cd3a9de38edaaab274b725ee82c23e8fc8c4eec7a82878461230991906157c2565b6040805192835260208301919091520160405180910390a2505050505050565b612331612f2c565b60c861ffff8a16111561236b5760405163539c34bb60e11b815261ffff8a1660048201819052602482015260c86044820152606401610ade565b6000851361238f576040516321ea67b360e11b815260048101869052602401610ade565b8363ffffffff168363ffffffff1611156123cc576040516313c06e5960e11b815263ffffffff808516600483015285166024820152604401610ade565b609b60ff831611156123fd57604051631d66288d60e11b815260ff83166004820152609b6024820152604401610ade565b609b60ff8216111561242e57604051631d66288d60e11b815260ff82166004820152609b6024820152604401610ade565b604080516101208101825261ffff8b1680825263ffffffff808c16602084018190526000848601528b8216606085018190528b8316608086018190528a841660a08701819052938a1660c0870181905260ff808b1660e08901819052908a16610100909801889052600c8054600160c01b90990260ff60c01b19600160b81b9093029290921661ffff60b81b19600160981b90940263ffffffff60981b19600160781b9099029890981676ffffffffffffffff00000000000000000000000000000019600160581b9096026effffffff000000000000000000000019670100000000000000909802979097166effffffffffffffffff000000000000196201000090990265ffffffffffff19909c16909a179a909a1796909616979097179390931791909116959095179290921793909316929092179190911790556010869055517f2c6b6b12413678366b05b145c5f00745bdd00e739131ab5de82484a50c9d78b6906125fd908b908b908b908b908b908b908b908b908b9061ffff99909916895263ffffffff97881660208a0152958716604089015293861660608801526080870192909252841660a086015290921660c084015260ff91821660e0840152166101008201526101200190565b60405180910390a1505050505050505050565b612618612f2c565b6000818152600560205260409020546001600160a01b0316612639816138e2565b610d91828261300b565b606060006126516008613a88565b905080841061267357604051631390f2a160e01b815260040160405180910390fd5b600061267f84866157c2565b90508181118061268d575083155b6126975780612699565b815b905060006126a78683615602565b9050806001600160401b038111156126c1576126c1614f9b565b6040519080825280602002602001820160405280156126ea578160200160208202803683370190505b50935060005b8181101561273a5761270d61270588836157c2565b600890613a92565b85828151811061271f5761271f6155d6565b60209081029190910101526127338161562b565b90506126f0565b505050505b92915050565b61274d612fdd565b6000818152600560205260409020546001600160a01b031661276e816138e2565b6000828152600560205260409020600101546001600160a01b031633146127c7576000828152600560205260409081902060010154905163d084e97560e01b81526001600160a01b039091166004820152602401610ade565b6000828152600560209081526040918290208054336001600160a01b03199182168117835560019092018054909116905582516001600160a01b03851681529182015283917fd4114ab6e9af9f597c52041f32d62dc57c5c4e4c0d4427006069635e216c93869101611b88565b8161283e81612f88565b612846612fdd565b6001600160a01b03821660009081526004602090815260408083208684529091529020805460ff16156128795750505050565b60008481526005602052604090206002018054606319016128ad576040516305a48e0f60e01b815260040160405180910390fd5b8154600160ff199091168117835581549081018255600082815260209081902090910180546001600160a01b0319166001600160a01b03871690811790915560405190815286917f1e980d04aa7648e205713e5e8ea3808672ac163d10936d36f91b2c88ac1575e191015b60405180910390a25050505050565b60008160405160200161293a9190615931565b604051602081830303815290604052805190602001209050919050565b8161296181612f88565b612969612fdd565b6129728361148d565b1561299057604051631685ecdd60e31b815260040160405180910390fd5b6001600160a01b038216600090815260046020908152604080832086845290915290205460ff166129e6576040516379bfd40160e01b8152600481018490526001600160a01b0383166024820152604401610ade565b600083815260056020908152604080832060020180548251818502810185019093528083529192909190830182828015612a4957602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311612a2b575b50505050509050600060018251612a609190615602565b905060005b8251811015612b6957846001600160a01b0316838281518110612a8a57612a8a6155d6565b60200260200101516001600160a01b031603612b59576000838381518110612ab457612ab46155d6565b6020026020010151905080600560008981526020019081526020016000206002018381548110612ae657612ae66155d6565b600091825260208083209190910180546001600160a01b0319166001600160a01b039490941693909317909255888152600590915260409020600201805480612b3157612b31615615565b600082815260209020810160001990810180546001600160a01b031916905501905550612b69565b612b628161562b565b9050612a65565b506001600160a01b0384166000818152600460209081526040808320898452825291829020805460ff19169055905191825286917f32158c6058347c1601b2d12bc696ac6901d8a9a9aa3ba10c27ab0a983e8425a79101612918565b600e8181548110612bd557600080fd5b600091825260209091200154905081565b81612bf081612f88565b612bf8612fdd565b600083815260056020526040902060018101546001600160a01b03848116911614612c7b576001810180546001600160a01b0319166001600160a01b03851690811790915560408051338152602081019290925285917f21a4dad170a6bf476c31bbcf4a16628295b0e450672eec25d7c93308e05344a191015b60405180910390a25b50505050565b600081815260056020526040812054819081906001600160a01b03166060612ca8826138e2565b600086815260066020908152604080832054600583529281902060020180548251818502810185019093528083526001600160601b0380861695600160601b810490911694600160c01b9091046001600160401b0316938893929091839190830182828015612d4057602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311612d22575b505050505090509450945094509450945091939590929450565b612d62612f2c565b6002546001600160a01b0316612d8b5760405163c1f0c0a160e01b815260040160405180910390fd5b6002546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa158015612dd4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612df8919061593f565b600a549091506001600160601b031681811115612e32576040516354ced18160e11b81526004810182905260248101839052604401610ade565b81811015610cea576000612e468284615602565b60025460405163a9059cbb60e01b81526001600160a01b0387811660048301526024820184905292935091169063a9059cbb906044016020604051808303816000875af1158015612e9b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ebf9190615785565b612edc57604051631f01ff1360e21b815260040160405180910390fd5b604080516001600160a01b0386168152602081018390527f59bfc682b673f8cbf945f1e454df9334834abf7dfe7f92237ca29ecb9b4366009101610c99565b612f23612f2c565b610ae781613a9e565b6000546001600160a01b03163314612f865760405162461bcd60e51b815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e6572000000000000000000006044820152606401610ade565b565b6000818152600560205260409020546001600160a01b0316612fa9816138e2565b336001600160a01b03821614610d9157604051636c51fda960e11b81526001600160a01b0382166004820152602401610ade565b600c546601000000000000900460ff1615612f865760405163769dd35360e11b815260040160405180910390fd5b60008061301784613730565b60025491935091506001600160a01b03161580159061303e57506001600160601b03821615155b156130865760025460405163a9059cbb60e01b81526001600160a01b0385811660048301526001600160601b038516602483015261308692169063a9059cbb9060440161161e565b61309983826001600160601b031661310c565b604080516001600160a01b03851681526001600160601b03808516602083015283169181019190915284907f8c74ce8b8cf87f5eb001275c8be27eb34ea2b62bfab6814fcc62192bb63e81c490606001612c72565b80610ae757604051631e9acf1760e31b815260040160405180910390fd5b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114613159576040519150601f19603f3d011682016040523d82523d6000602084013e61315e565b606091505b5050905080610cea5760405163950b247960e01b815260040160405180910390fd5b6040805160a081018252600060608201818152608083018290528252602082018190529181019190915260006131b98460000151612927565b6000818152600d602090815260409182902082518084019093525460ff811615158084526101009091046001600160401b0316918301919091529192509061321757604051631dfd6e1360e21b815260048101839052602401610ade565b6000828660800151604051602001613239929190918252602082015260400190565b60408051601f1981840301815291815281516020928301206000818152600f909352908220549092509081900361328357604051631b44092560e11b815260040160405180910390fd5b85516020808801516040808a015160608b015160808c015160a08d015193516132b2978a979096959101615958565b6040516020818303038152906040528051906020012081146132e75760405163354a450b60e21b815260040160405180910390fd5b60006132f68760000151613b47565b9050806133bf578651604051631d2827a760e31b81526001600160401b0390911660048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063e9413d3890602401602060405180830381865afa15801561336d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613391919061593f565b9050806133bf57865160405163175dadad60e01b81526001600160401b039091166004820152602401610ade565b60008860800151826040516020016133e1929190918252602082015260400190565b6040516020818303038152906040528051906020012060001c905060006134088a83613c1a565b604080516060810182529788526020880196909652948601949094525092979650505050505050565b6000816001600160401b03163a111561348457821561345a57506001600160401b03811661273f565b60405163435e532d60e11b81523a60048201526001600160401b0383166024820152604401610ade565b503a92915050565b6000806000631fe543e360e01b86856040516024016134ac9291906159ab565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b031990941693909317909252600c805466ff000000000000191666010000000000001790559086015160808701519192506135169163ffffffff9091169083613c85565b600c805466ff000000000000191690559695505050505050565b600080831561354f57613544868685613cd1565b60009150915061355f565b61355a868685613de2565b915091505b94509492505050565b6000818152600660205260409020821561362c5780546001600160601b03600160601b90910481169085168110156135b357604051631e9acf1760e31b815260040160405180910390fd5b6135bd8582615644565b82546bffffffffffffffffffffffff60601b1916600160601b6001600160601b039283168102919091178455600b805488939192600c926136029286929004166157a2565b92506101000a8154816001600160601b0302191690836001600160601b0316021790555050612c7b565b80546001600160601b0390811690851681101561365c57604051631e9acf1760e31b815260040160405180910390fd5b6136668582615644565b82546bffffffffffffffffffffffff19166001600160601b03918216178355600b8054879260009161369a918591166157a2565b92506101000a8154816001600160601b0302191690836001600160601b031602179055505050505050565b601154600090815b8181101561372657836001600160a01b0316601182815481106136f2576136f26155d6565b6000918252602090912001546001600160a01b031603613716575060019392505050565b61371f8161562b565b90506136cd565b5060009392505050565b60008181526005602090815260408083206006909252822054600290910180546001600160601b0380841694600160601b90940416925b818110156137dc5760046000848381548110613785576137856155d6565b60009182526020808320909101546001600160a01b0316835282810193909352604091820181208982529092529020805470ffffffffffffffffffffffffffffffffff191690556137d58161562b565b9050613767565b50600085815260056020526040812080546001600160a01b031990811682556001820180549091169055906138146002830182614e74565b5050600085815260066020526040812055613830600886613fd4565b506001600160601b0384161561388357600a805485919060009061385e9084906001600160601b0316615644565b92506101000a8154816001600160601b0302191690836001600160601b031602179055505b6001600160601b038316156138db5782600a600c8282829054906101000a90046001600160601b03166138b69190615644565b92506101000a8154816001600160601b0302191690836001600160601b031602179055505b5050915091565b6001600160a01b038116610ae757604051630fb532db60e11b815260040160405180910390fd5b6040805160208101909152600081526000829003613936575060408051602081019091526000815261273f565b63125fa26760e31b61394883856159cc565b6001600160e01b0319161461397057604051632923fee760e11b815260040160405180910390fd5b61397d82600481866159fc565b8101906110a49190615a26565b60607f92fd13387c7fe7befbc38d303d6468778fb9731bc4583f17d92989c6fcfdeaaa826040516024016139c391511515815260200190565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915292915050565b600046613a0781613fe0565b15613a755760646001600160a01b031663a3b1b31d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015613a4b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613a6f919061593f565b91505090565b4391505090565b60006110a48383614003565b600061273f825490565b60006110a48383614052565b336001600160a01b03821603613af65760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c660000000000000000006044820152606401610ade565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b600046613b5381613fe0565b15613c0b57610100836001600160401b0316613b6d6139fb565b613b779190615602565b1180613b935750613b866139fb565b836001600160401b031610155b15613ba15750600092915050565b6040516315a03d4160e11b81526001600160401b0384166004820152606490632b407a82906024015b602060405180830381865afa158015613be7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110a4919061593f565b50506001600160401b03164090565b6000613c4e8360000151846020015185604001518660600151868860a001518960c001518a60e001518b610100015161407c565b60038360200151604051602001613c66929190615a71565b60408051601f1981840301815291905280516020909101209392505050565b60005a611388811015613c9757600080fd5b611388810390508460408204820311613caf57600080fd5b50823b613cbb57600080fd5b60008083516020850160008789f1949350505050565b600080613d146000368080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506142a792505050565b905060005a600c54613d34908890600160581b900463ffffffff166157c2565b613d3e9190615602565b613d489086615a85565b600c54909150600090613d6d90600160781b900463ffffffff1664e8d4a51000615a85565b90508415613db957600c548190606490600160b81b900460ff16613d9185876157c2565b613d9b9190615a85565b613da59190615ab2565b613daf91906157c2565b93505050506110a4565b600c548190606490613dd590600160b81b900460ff1682615ac6565b60ff16613d9185876157c2565b600080600080613df0614387565b9150915060008213613e18576040516321ea67b360e11b815260048101839052602401610ade565b6000613e5a6000368080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506142a792505050565b9050600083825a600c54613e7c908d90600160581b900463ffffffff166157c2565b613e869190615602565b613e90908b615a85565b613e9a91906157c2565b613eac90670de0b6b3a7640000615a85565b613eb69190615ab2565b600c54909150600090613edf9063ffffffff600160981b8204811691600160781b900416615adf565b613ef49063ffffffff1664e8d4a51000615a85565b9050600085613f0b83670de0b6b3a7640000615a85565b613f159190615ab2565b905060008915613f5657600c548290606490613f3b90600160c01b900460ff1687615a85565b613f459190615ab2565b613f4f91906157c2565b9050613f96565b600c548290606490613f7290600160c01b900460ff1682615ac6565b613f7f9060ff1687615a85565b613f899190615ab2565b613f9391906157c2565b90505b6b033b2e3c9fd0803ce8000000811115613fc35760405163e80fa38160e01b815260040160405180910390fd5b9b949a509398505050505050505050565b60006110a48383614452565b600061a4b1821480613ff4575062066eed82145b8061273f57505062066eee1490565b600081815260018301602052604081205461404a5750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915561273f565b50600061273f565b6000826000018281548110614069576140696155d6565b9060005260206000200154905092915050565b6140858961454c565b6140d15760405162461bcd60e51b815260206004820152601a60248201527f7075626c6963206b6579206973206e6f74206f6e2063757276650000000000006044820152606401610ade565b6140da8861454c565b6141265760405162461bcd60e51b815260206004820152601560248201527f67616d6d61206973206e6f74206f6e20637572766500000000000000000000006044820152606401610ade565b61412f8361454c565b61417b5760405162461bcd60e51b815260206004820152601d60248201527f6347616d6d615769746e657373206973206e6f74206f6e2063757276650000006044820152606401610ade565b6141848261454c565b6141d05760405162461bcd60e51b815260206004820152601c60248201527f73486173685769746e657373206973206e6f74206f6e206375727665000000006044820152606401610ade565b6141dc878a8887614625565b6142285760405162461bcd60e51b815260206004820152601960248201527f6164647228632a706b2b732a6729213d5f755769746e657373000000000000006044820152606401610ade565b60006142348a87614748565b90506000614247898b878b8689896147ac565b90506000614258838d8d8a866148d8565b9050808a146142995760405162461bcd60e51b815260206004820152600d60248201526c34b73b30b634b210383937b7b360991b6044820152606401610ade565b505050505050505050505050565b6000466142b381613fe0565b156142f757606c6001600160a01b031663c6f7de0e6040518163ffffffff1660e01b8152600401602060405180830381865afa158015613be7573d6000803e3d6000fd5b61430081614918565b1561437e5773420000000000000000000000000000000000000f6001600160a01b03166349948e0e84604051806080016040528060488152602001615c3c60489139604051602001614353929190615afc565b6040516020818303038152906040526040518263ffffffff1660e01b8152600401613bca9190615772565b50600092915050565b600c5460035460408051633fabe5a360e21b81529051600093849367010000000000000090910463ffffffff169284926001600160a01b039092169163feaf968c9160048082019260a0929091908290030181865afa1580156143ee573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906144129190615b45565b50919650909250505063ffffffff82161580159061443e57506144358142615602565b8263ffffffff16105b9250821561444c5760105493505b50509091565b6000818152600183016020526040812054801561453b576000614476600183615602565b855490915060009061448a90600190615602565b90508181146144ef5760008660000182815481106144aa576144aa6155d6565b90600052602060002001549050808760000184815481106144cd576144cd6155d6565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061450057614500615615565b60019003818190600052602060002001600090559055856001016000868152602001908152602001600020600090556001935050505061273f565b600091505061273f565b5092915050565b80516000906401000003d019116145a55760405162461bcd60e51b815260206004820152601260248201527f696e76616c696420782d6f7264696e61746500000000000000000000000000006044820152606401610ade565b60208201516401000003d019116145fe5760405162461bcd60e51b815260206004820152601260248201527f696e76616c696420792d6f7264696e61746500000000000000000000000000006044820152606401610ade565b60208201516401000003d01990800961461e8360005b602002015161495f565b1492915050565b60006001600160a01b03821661466b5760405162461bcd60e51b815260206004820152600b60248201526a626164207769746e65737360a81b6044820152606401610ade565b60208401516000906001161561468257601c614685565b601b5b9050600070014551231950b75fc4402da1732fc9bebe1985876000602002015109865170014551231950b75fc4402da1732fc9bebe19918203925060009190890987516040805160008082526020820180845287905260ff88169282019290925260608101929092526080820183905291925060019060a0016020604051602081039080840390855afa158015614720573d6000803e3d6000fd5b5050604051601f1901516001600160a01b039081169088161495505050505050949350505050565b614750614e92565b61477d6001848460405160200161476993929190615b95565b604051602081830303815290604052614983565b90505b6147898161454c565b61273f5780516040805160208101929092526147a59101614769565b9050614780565b6147b4614e92565b825186516401000003d01991829006919006036148135760405162461bcd60e51b815260206004820152601e60248201527f706f696e747320696e2073756d206d7573742062652064697374696e637400006044820152606401610ade565b61481e8789886149d0565b61486a5760405162461bcd60e51b815260206004820152601660248201527f4669727374206d756c20636865636b206661696c6564000000000000000000006044820152606401610ade565b6148758486856149d0565b6148c15760405162461bcd60e51b815260206004820152601760248201527f5365636f6e64206d756c20636865636b206661696c65640000000000000000006044820152606401610ade565b6148cc868484614afb565b98975050505050505050565b6000600286868685876040516020016148f696959493929190615bb6565b60408051601f1981840301815291905280516020909101209695505050505050565b6000600a82148061492a57506101a482145b80614937575062aa37dc82145b80614943575061210582145b80614950575062014a3382145b8061273f57505062014a341490565b6000806401000003d01980848509840990506401000003d019600782089392505050565b61498b614e92565b61499482614bc2565b81526149a96149a4826000614614565b614bfd565b6020820181905260029006600103611fd5576020810180516401000003d019039052919050565b600082600003614a105760405162461bcd60e51b815260206004820152600b60248201526a3d32b9379039b1b0b630b960a91b6044820152606401610ade565b83516020850151600090614a2690600290615c15565b15614a3257601c614a35565b601b5b9050600070014551231950b75fc4402da1732fc9bebe198387096040805160008082526020820180845281905260ff86169282019290925260608101869052608081018390529192509060019060a0016020604051602081039080840390855afa158015614aa7573d6000803e3d6000fd5b505050602060405103519050600086604051602001614ac69190615c29565b60408051601f1981840301815291905280516020909101206001600160a01b0392831692169190911498975050505050505050565b614b03614e92565b835160208086015185519186015160009384938493614b2493909190614c1d565b919450925090506401000003d019858209600114614b845760405162461bcd60e51b815260206004820152601960248201527f696e765a206d75737420626520696e7665727365206f66207a000000000000006044820152606401610ade565b60405180604001604052806401000003d01980614ba357614ba3615a9c565b87860981526020016401000003d0198785099052979650505050505050565b805160208201205b6401000003d0198110611fd557604080516020808201939093528151808203840181529082019091528051910120614bca565b600061273f826002614c166401000003d01960016157c2565b901c614cfd565b60008080600180826401000003d019896401000003d019038808905060006401000003d0198b6401000003d019038a0890506000614c5d83838585614da2565b9098509050614c6e88828e88614dc6565b9098509050614c7f88828c87614dc6565b90985090506000614c928d878b85614dc6565b9098509050614ca388828686614da2565b9098509050614cb488828e89614dc6565b9098509050818114614ce9576401000003d019818a0998506401000003d01982890997506401000003d0198183099650614ced565b8196505b5050505050509450945094915050565b600080614d08614eb0565b6020808252818101819052604082015260608101859052608081018490526401000003d01960a0820152614d3a614ece565b60208160c0846005600019fa925082600003614d985760405162461bcd60e51b815260206004820152601260248201527f6269674d6f64457870206661696c7572652100000000000000000000000000006044820152606401610ade565b5195945050505050565b6000806401000003d0198487096401000003d0198487099097909650945050505050565b600080806401000003d019878509905060006401000003d01987876401000003d019030990506401000003d0198183086401000003d01986890990999098509650505050505050565b828054828255906000526020600020908101928215614e64579160200282015b82811115614e6457825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190614e2f565b50614e70929150614eec565b5090565b5080546000825590600052602060002090810190610ae79190614eec565b60405180604001604052806002906020820280368337509192915050565b6040518060c001604052806006906020820280368337509192915050565b60405180602001604052806001906020820280368337509192915050565b5b80821115614e705760008155600101614eed565b6001600160a01b0381168114610ae757600080fd5b8035611fd581614f01565b600060208284031215614f3357600080fd5b81356110a481614f01565b806040810183101561273f57600080fd5b600060408284031215614f6157600080fd5b6110a48383614f3e565b60008060408385031215614f7e57600080fd5b823591506020830135614f9081614f01565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b60405160c081016001600160401b0381118282101715614fd357614fd3614f9b565b60405290565b60405161012081016001600160401b0381118282101715614fd357614fd3614f9b565b604051601f8201601f191681016001600160401b038111828210171561502457615024614f9b565b604052919050565b600082601f83011261503d57600080fd5b604051604081018181106001600160401b038211171561505f5761505f614f9b565b806040525080604084018581111561507657600080fd5b845b81811015615090578035835260209283019201615078565b509195945050505050565b80356001600160401b0381168114611fd557600080fd5b803563ffffffff81168114611fd557600080fd5b600060c082840312156150d857600080fd5b6150e0614fb1565b90506150eb8261509b565b815260208083013581830152615103604084016150b2565b6040830152615114606084016150b2565b6060830152608083013561512781614f01565b608083015260a08301356001600160401b038082111561514657600080fd5b818501915085601f83011261515a57600080fd5b81358181111561516c5761516c614f9b565b61517e601f8201601f19168501614ffc565b9150808252868482850101111561519457600080fd5b80848401858401376000848284010152508060a085015250505092915050565b8015158114610ae757600080fd5b8035611fd5816151b4565b60008060008385036101e08112156151e457600080fd5b6101a0808212156151f457600080fd5b6151fc614fd9565b9150615208878761502c565b8252615217876040880161502c565b60208301526080860135604083015260a0860135606083015260c0860135608083015261524660e08701614f16565b60a083015261010061525a8882890161502c565b60c084015261526d88610140890161502c565b60e0840152610180870135908301529093508401356001600160401b0381111561529657600080fd5b6152a2868287016150c6565b9250506152b26101c085016151c2565b90509250925092565b6000602082840312156152cd57600080fd5b5035919050565b600080604083850312156152e757600080fd5b82356152f281614f01565b91506020830135614f9081614f01565b6000806060838503121561531557600080fd5b61531f8484614f3e565b915061532d6040840161509b565b90509250929050565b60006020828403121561534857600080fd5b81356001600160401b0381111561535e57600080fd5b820160c081850312156110a457600080fd5b6000806000806060858703121561538657600080fd5b843561539181614f01565b93506020850135925060408501356001600160401b03808211156153b457600080fd5b818701915087601f8301126153c857600080fd5b8135818111156153d757600080fd5b8860208285010111156153e957600080fd5b95989497505060200194505050565b803561ffff81168114611fd557600080fd5b803560ff81168114611fd557600080fd5b60008060008060008060008060006101208a8c03121561543a57600080fd5b6154438a6153f8565b985061545160208b016150b2565b975061545f60408b016150b2565b965061546d60608b016150b2565b955060808a0135945061548260a08b016150b2565b935061549060c08b016150b2565b925061549e60e08b0161540a565b91506154ad6101008b0161540a565b90509295985092959850929598565b600080604083850312156154cf57600080fd5b50508035926020909101359150565b600081518084526020808501945080840160005b8381101561550e578151875295820195908201906001016154f2565b509495945050505050565b6020815260006110a460208301846154de565b60006040828403121561553e57600080fd5b6110a4838361502c565b600081518084526020808501945080840160005b8381101561550e5781516001600160a01b03168752958201959082019060010161555c565b60006001600160601b0380881683528087166020840152506001600160401b03851660408301526001600160a01b038416606083015260a060808301526155cb60a0830184615548565b979650505050505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b8181038181111561273f5761273f6155ec565b634e487b7160e01b600052603160045260246000fd5b60006001820161563d5761563d6155ec565b5060010190565b6001600160601b03828116828216039080821115614545576145456155ec565b60006001600160401b03808316818103615680576156806155ec565b6001019392505050565b60006001600160401b038216806156a3576156a36155ec565b6000190192915050565b6020815260ff8251166020820152602082015160408201526001600160a01b0360408301511660608201526000606083015160c060808401526156f360e0840182615548565b905060808401516001600160601b0380821660a08601528060a08701511660c086015250508091505092915050565b60005b8381101561573d578181015183820152602001615725565b50506000910152565b6000815180845261575e816020860160208601615722565b601f01601f19169290920160200192915050565b6020815260006110a46020830184615746565b60006020828403121561579757600080fd5b81516110a4816151b4565b6001600160601b03818116838216019080821115614545576145456155ec565b8082018082111561273f5761273f6155ec565b6000602082840312156157e757600080fd5b6110a4826153f8565b60006020828403121561580257600080fd5b6110a4826150b2565b6000808335601e1984360301811261582257600080fd5b8301803591506001600160401b0382111561583c57600080fd5b60200191503681900382131561585157600080fd5b9250929050565b878152866020820152856040820152600063ffffffff80871660608401528086166080840152506001600160a01b03841660a083015260e060c08301526158a260e0830184615746565b9998505050505050505050565b86815285602082015261ffff85166040820152600063ffffffff808616606084015280851660808401525060c060a08301526148cc60c0830184615746565b6001600160401b03818116838216019080821115614545576145456155ec565b8060005b6002811015612c7b578151845260209384019390910190600101615912565b6040810161273f828461590e565b60006020828403121561595157600080fd5b5051919050565b8781526001600160401b0387166020820152856040820152600063ffffffff80871660608401528086166080840152506001600160a01b03841660a083015260e060c08301526158a260e0830184615746565b8281526040602082015260006159c460408301846154de565b949350505050565b6001600160e01b031981358181169160048510156159f45780818660040360031b1b83161692505b505092915050565b60008085851115615a0c57600080fd5b83861115615a1957600080fd5b5050820193919092039150565b600060208284031215615a3857600080fd5b604051602081018181106001600160401b0382111715615a5a57615a5a614f9b565b6040528235615a68816151b4565b81529392505050565b828152606081016110a4602083018461590e565b808202811582820484141761273f5761273f6155ec565b634e487b7160e01b600052601260045260246000fd5b600082615ac157615ac1615a9c565b500490565b60ff818116838216019081111561273f5761273f6155ec565b63ffffffff828116828216039080821115614545576145456155ec565b60008351615b0e818460208801615722565b835190830190615b22818360208801615722565b01949350505050565b805169ffffffffffffffffffff81168114611fd557600080fd5b600080600080600060a08688031215615b5d57600080fd5b615b6686615b2b565b9450602086015193506040860151925060608601519150615b8960808701615b2b565b90509295509295909350565b838152615ba5602082018461590e565b606081019190915260800192915050565b868152615bc6602082018761590e565b615bd3606082018661590e565b615be060a082018561590e565b615bed60e082018461590e565b60609190911b6bffffffffffffffffffffffff19166101208201526101340195945050505050565b600082615c2457615c24615a9c565b500690565b615c33818361590e565b60400191905056fe307866666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666a164736f6c6343000813000a", +} + +var VRFCoordinatorTestV25ABI = VRFCoordinatorTestV25MetaData.ABI + +var VRFCoordinatorTestV25Bin = VRFCoordinatorTestV25MetaData.Bin + +func DeployVRFCoordinatorTestV25(auth *bind.TransactOpts, backend bind.ContractBackend, blockhashStore common.Address) (common.Address, *types.Transaction, *VRFCoordinatorTestV25, error) { + parsed, err := VRFCoordinatorTestV25MetaData.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(VRFCoordinatorTestV25Bin), backend, blockhashStore) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &VRFCoordinatorTestV25{address: address, abi: *parsed, VRFCoordinatorTestV25Caller: VRFCoordinatorTestV25Caller{contract: contract}, VRFCoordinatorTestV25Transactor: VRFCoordinatorTestV25Transactor{contract: contract}, VRFCoordinatorTestV25Filterer: VRFCoordinatorTestV25Filterer{contract: contract}}, nil +} + +type VRFCoordinatorTestV25 struct { + address common.Address + abi abi.ABI + VRFCoordinatorTestV25Caller + VRFCoordinatorTestV25Transactor + VRFCoordinatorTestV25Filterer +} + +type VRFCoordinatorTestV25Caller struct { + contract *bind.BoundContract +} + +type VRFCoordinatorTestV25Transactor struct { + contract *bind.BoundContract +} + +type VRFCoordinatorTestV25Filterer struct { + contract *bind.BoundContract +} + +type VRFCoordinatorTestV25Session struct { + Contract *VRFCoordinatorTestV25 + CallOpts bind.CallOpts + TransactOpts bind.TransactOpts +} + +type VRFCoordinatorTestV25CallerSession struct { + Contract *VRFCoordinatorTestV25Caller + CallOpts bind.CallOpts +} + +type VRFCoordinatorTestV25TransactorSession struct { + Contract *VRFCoordinatorTestV25Transactor + TransactOpts bind.TransactOpts +} + +type VRFCoordinatorTestV25Raw struct { + Contract *VRFCoordinatorTestV25 +} + +type VRFCoordinatorTestV25CallerRaw struct { + Contract *VRFCoordinatorTestV25Caller +} + +type VRFCoordinatorTestV25TransactorRaw struct { + Contract *VRFCoordinatorTestV25Transactor +} + +func NewVRFCoordinatorTestV25(address common.Address, backend bind.ContractBackend) (*VRFCoordinatorTestV25, error) { + abi, err := abi.JSON(strings.NewReader(VRFCoordinatorTestV25ABI)) + if err != nil { + return nil, err + } + contract, err := bindVRFCoordinatorTestV25(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &VRFCoordinatorTestV25{address: address, abi: abi, VRFCoordinatorTestV25Caller: VRFCoordinatorTestV25Caller{contract: contract}, VRFCoordinatorTestV25Transactor: VRFCoordinatorTestV25Transactor{contract: contract}, VRFCoordinatorTestV25Filterer: VRFCoordinatorTestV25Filterer{contract: contract}}, nil +} + +func NewVRFCoordinatorTestV25Caller(address common.Address, caller bind.ContractCaller) (*VRFCoordinatorTestV25Caller, error) { + contract, err := bindVRFCoordinatorTestV25(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &VRFCoordinatorTestV25Caller{contract: contract}, nil +} + +func NewVRFCoordinatorTestV25Transactor(address common.Address, transactor bind.ContractTransactor) (*VRFCoordinatorTestV25Transactor, error) { + contract, err := bindVRFCoordinatorTestV25(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &VRFCoordinatorTestV25Transactor{contract: contract}, nil +} + +func NewVRFCoordinatorTestV25Filterer(address common.Address, filterer bind.ContractFilterer) (*VRFCoordinatorTestV25Filterer, error) { + contract, err := bindVRFCoordinatorTestV25(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &VRFCoordinatorTestV25Filterer{contract: contract}, nil +} + +func bindVRFCoordinatorTestV25(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := VRFCoordinatorTestV25MetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Raw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _VRFCoordinatorTestV25.Contract.VRFCoordinatorTestV25Caller.contract.Call(opts, result, method, params...) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Raw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _VRFCoordinatorTestV25.Contract.VRFCoordinatorTestV25Transactor.contract.Transfer(opts) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Raw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _VRFCoordinatorTestV25.Contract.VRFCoordinatorTestV25Transactor.contract.Transact(opts, method, params...) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25CallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _VRFCoordinatorTestV25.Contract.contract.Call(opts, result, method, params...) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25TransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _VRFCoordinatorTestV25.Contract.contract.Transfer(opts) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25TransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _VRFCoordinatorTestV25.Contract.contract.Transact(opts, method, params...) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Caller) BLOCKHASHSTORE(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _VRFCoordinatorTestV25.contract.Call(opts, &out, "BLOCKHASH_STORE") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Session) BLOCKHASHSTORE() (common.Address, error) { + return _VRFCoordinatorTestV25.Contract.BLOCKHASHSTORE(&_VRFCoordinatorTestV25.CallOpts) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25CallerSession) BLOCKHASHSTORE() (common.Address, error) { + return _VRFCoordinatorTestV25.Contract.BLOCKHASHSTORE(&_VRFCoordinatorTestV25.CallOpts) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Caller) LINK(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _VRFCoordinatorTestV25.contract.Call(opts, &out, "LINK") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Session) LINK() (common.Address, error) { + return _VRFCoordinatorTestV25.Contract.LINK(&_VRFCoordinatorTestV25.CallOpts) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25CallerSession) LINK() (common.Address, error) { + return _VRFCoordinatorTestV25.Contract.LINK(&_VRFCoordinatorTestV25.CallOpts) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Caller) LINKNATIVEFEED(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _VRFCoordinatorTestV25.contract.Call(opts, &out, "LINK_NATIVE_FEED") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Session) LINKNATIVEFEED() (common.Address, error) { + return _VRFCoordinatorTestV25.Contract.LINKNATIVEFEED(&_VRFCoordinatorTestV25.CallOpts) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25CallerSession) LINKNATIVEFEED() (common.Address, error) { + return _VRFCoordinatorTestV25.Contract.LINKNATIVEFEED(&_VRFCoordinatorTestV25.CallOpts) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Caller) MAXCONSUMERS(opts *bind.CallOpts) (uint16, error) { + var out []interface{} + err := _VRFCoordinatorTestV25.contract.Call(opts, &out, "MAX_CONSUMERS") + + if err != nil { + return *new(uint16), err + } + + out0 := *abi.ConvertType(out[0], new(uint16)).(*uint16) + + return out0, err + +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Session) MAXCONSUMERS() (uint16, error) { + return _VRFCoordinatorTestV25.Contract.MAXCONSUMERS(&_VRFCoordinatorTestV25.CallOpts) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25CallerSession) MAXCONSUMERS() (uint16, error) { + return _VRFCoordinatorTestV25.Contract.MAXCONSUMERS(&_VRFCoordinatorTestV25.CallOpts) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Caller) MAXNUMWORDS(opts *bind.CallOpts) (uint32, error) { + var out []interface{} + err := _VRFCoordinatorTestV25.contract.Call(opts, &out, "MAX_NUM_WORDS") + + if err != nil { + return *new(uint32), err + } + + out0 := *abi.ConvertType(out[0], new(uint32)).(*uint32) + + return out0, err + +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Session) MAXNUMWORDS() (uint32, error) { + return _VRFCoordinatorTestV25.Contract.MAXNUMWORDS(&_VRFCoordinatorTestV25.CallOpts) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25CallerSession) MAXNUMWORDS() (uint32, error) { + return _VRFCoordinatorTestV25.Contract.MAXNUMWORDS(&_VRFCoordinatorTestV25.CallOpts) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Caller) MAXREQUESTCONFIRMATIONS(opts *bind.CallOpts) (uint16, error) { + var out []interface{} + err := _VRFCoordinatorTestV25.contract.Call(opts, &out, "MAX_REQUEST_CONFIRMATIONS") + + if err != nil { + return *new(uint16), err + } + + out0 := *abi.ConvertType(out[0], new(uint16)).(*uint16) + + return out0, err + +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Session) MAXREQUESTCONFIRMATIONS() (uint16, error) { + return _VRFCoordinatorTestV25.Contract.MAXREQUESTCONFIRMATIONS(&_VRFCoordinatorTestV25.CallOpts) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25CallerSession) MAXREQUESTCONFIRMATIONS() (uint16, error) { + return _VRFCoordinatorTestV25.Contract.MAXREQUESTCONFIRMATIONS(&_VRFCoordinatorTestV25.CallOpts) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Caller) GetActiveSubscriptionIds(opts *bind.CallOpts, startIndex *big.Int, maxCount *big.Int) ([]*big.Int, error) { + var out []interface{} + err := _VRFCoordinatorTestV25.contract.Call(opts, &out, "getActiveSubscriptionIds", startIndex, maxCount) + + if err != nil { + return *new([]*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new([]*big.Int)).(*[]*big.Int) + + return out0, err + +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Session) GetActiveSubscriptionIds(startIndex *big.Int, maxCount *big.Int) ([]*big.Int, error) { + return _VRFCoordinatorTestV25.Contract.GetActiveSubscriptionIds(&_VRFCoordinatorTestV25.CallOpts, startIndex, maxCount) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25CallerSession) GetActiveSubscriptionIds(startIndex *big.Int, maxCount *big.Int) ([]*big.Int, error) { + return _VRFCoordinatorTestV25.Contract.GetActiveSubscriptionIds(&_VRFCoordinatorTestV25.CallOpts, startIndex, maxCount) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Caller) GetSubscription(opts *bind.CallOpts, subId *big.Int) (GetSubscription, + + error) { + var out []interface{} + err := _VRFCoordinatorTestV25.contract.Call(opts, &out, "getSubscription", subId) + + outstruct := new(GetSubscription) + if err != nil { + return *outstruct, err + } + + outstruct.Balance = *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + outstruct.NativeBalance = *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) + outstruct.ReqCount = *abi.ConvertType(out[2], new(uint64)).(*uint64) + outstruct.SubOwner = *abi.ConvertType(out[3], new(common.Address)).(*common.Address) + outstruct.Consumers = *abi.ConvertType(out[4], new([]common.Address)).(*[]common.Address) + + return *outstruct, err + +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Session) GetSubscription(subId *big.Int) (GetSubscription, + + error) { + return _VRFCoordinatorTestV25.Contract.GetSubscription(&_VRFCoordinatorTestV25.CallOpts, subId) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25CallerSession) GetSubscription(subId *big.Int) (GetSubscription, + + error) { + return _VRFCoordinatorTestV25.Contract.GetSubscription(&_VRFCoordinatorTestV25.CallOpts, subId) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Caller) HashOfKey(opts *bind.CallOpts, publicKey [2]*big.Int) ([32]byte, error) { + var out []interface{} + err := _VRFCoordinatorTestV25.contract.Call(opts, &out, "hashOfKey", publicKey) + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Session) HashOfKey(publicKey [2]*big.Int) ([32]byte, error) { + return _VRFCoordinatorTestV25.Contract.HashOfKey(&_VRFCoordinatorTestV25.CallOpts, publicKey) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25CallerSession) HashOfKey(publicKey [2]*big.Int) ([32]byte, error) { + return _VRFCoordinatorTestV25.Contract.HashOfKey(&_VRFCoordinatorTestV25.CallOpts, publicKey) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Caller) Owner(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _VRFCoordinatorTestV25.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 + +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Session) Owner() (common.Address, error) { + return _VRFCoordinatorTestV25.Contract.Owner(&_VRFCoordinatorTestV25.CallOpts) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25CallerSession) Owner() (common.Address, error) { + return _VRFCoordinatorTestV25.Contract.Owner(&_VRFCoordinatorTestV25.CallOpts) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Caller) PendingRequestExists(opts *bind.CallOpts, subId *big.Int) (bool, error) { + var out []interface{} + err := _VRFCoordinatorTestV25.contract.Call(opts, &out, "pendingRequestExists", subId) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Session) PendingRequestExists(subId *big.Int) (bool, error) { + return _VRFCoordinatorTestV25.Contract.PendingRequestExists(&_VRFCoordinatorTestV25.CallOpts, subId) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25CallerSession) PendingRequestExists(subId *big.Int) (bool, error) { + return _VRFCoordinatorTestV25.Contract.PendingRequestExists(&_VRFCoordinatorTestV25.CallOpts, subId) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Caller) SConfig(opts *bind.CallOpts) (SConfig, + + error) { + var out []interface{} + err := _VRFCoordinatorTestV25.contract.Call(opts, &out, "s_config") + + outstruct := new(SConfig) + if err != nil { + return *outstruct, err + } + + outstruct.MinimumRequestConfirmations = *abi.ConvertType(out[0], new(uint16)).(*uint16) + outstruct.MaxGasLimit = *abi.ConvertType(out[1], new(uint32)).(*uint32) + outstruct.ReentrancyLock = *abi.ConvertType(out[2], new(bool)).(*bool) + outstruct.StalenessSeconds = *abi.ConvertType(out[3], new(uint32)).(*uint32) + outstruct.GasAfterPaymentCalculation = *abi.ConvertType(out[4], new(uint32)).(*uint32) + outstruct.FulfillmentFlatFeeNativePPM = *abi.ConvertType(out[5], new(uint32)).(*uint32) + outstruct.FulfillmentFlatFeeLinkDiscountPPM = *abi.ConvertType(out[6], new(uint32)).(*uint32) + outstruct.NativePremiumPercentage = *abi.ConvertType(out[7], new(uint8)).(*uint8) + outstruct.LinkPremiumPercentage = *abi.ConvertType(out[8], new(uint8)).(*uint8) + + return *outstruct, err + +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Session) SConfig() (SConfig, + + error) { + return _VRFCoordinatorTestV25.Contract.SConfig(&_VRFCoordinatorTestV25.CallOpts) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25CallerSession) SConfig() (SConfig, + + error) { + return _VRFCoordinatorTestV25.Contract.SConfig(&_VRFCoordinatorTestV25.CallOpts) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Caller) SCurrentSubNonce(opts *bind.CallOpts) (uint64, error) { + var out []interface{} + err := _VRFCoordinatorTestV25.contract.Call(opts, &out, "s_currentSubNonce") + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Session) SCurrentSubNonce() (uint64, error) { + return _VRFCoordinatorTestV25.Contract.SCurrentSubNonce(&_VRFCoordinatorTestV25.CallOpts) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25CallerSession) SCurrentSubNonce() (uint64, error) { + return _VRFCoordinatorTestV25.Contract.SCurrentSubNonce(&_VRFCoordinatorTestV25.CallOpts) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Caller) SFallbackWeiPerUnitLink(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _VRFCoordinatorTestV25.contract.Call(opts, &out, "s_fallbackWeiPerUnitLink") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Session) SFallbackWeiPerUnitLink() (*big.Int, error) { + return _VRFCoordinatorTestV25.Contract.SFallbackWeiPerUnitLink(&_VRFCoordinatorTestV25.CallOpts) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25CallerSession) SFallbackWeiPerUnitLink() (*big.Int, error) { + return _VRFCoordinatorTestV25.Contract.SFallbackWeiPerUnitLink(&_VRFCoordinatorTestV25.CallOpts) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Caller) SProvingKeyHashes(opts *bind.CallOpts, arg0 *big.Int) ([32]byte, error) { + var out []interface{} + err := _VRFCoordinatorTestV25.contract.Call(opts, &out, "s_provingKeyHashes", arg0) + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Session) SProvingKeyHashes(arg0 *big.Int) ([32]byte, error) { + return _VRFCoordinatorTestV25.Contract.SProvingKeyHashes(&_VRFCoordinatorTestV25.CallOpts, arg0) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25CallerSession) SProvingKeyHashes(arg0 *big.Int) ([32]byte, error) { + return _VRFCoordinatorTestV25.Contract.SProvingKeyHashes(&_VRFCoordinatorTestV25.CallOpts, arg0) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Caller) SProvingKeys(opts *bind.CallOpts, arg0 [32]byte) (SProvingKeys, + + error) { + var out []interface{} + err := _VRFCoordinatorTestV25.contract.Call(opts, &out, "s_provingKeys", arg0) + + outstruct := new(SProvingKeys) + if err != nil { + return *outstruct, err + } + + outstruct.Exists = *abi.ConvertType(out[0], new(bool)).(*bool) + outstruct.MaxGas = *abi.ConvertType(out[1], new(uint64)).(*uint64) + + return *outstruct, err + +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Session) SProvingKeys(arg0 [32]byte) (SProvingKeys, + + error) { + return _VRFCoordinatorTestV25.Contract.SProvingKeys(&_VRFCoordinatorTestV25.CallOpts, arg0) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25CallerSession) SProvingKeys(arg0 [32]byte) (SProvingKeys, + + error) { + return _VRFCoordinatorTestV25.Contract.SProvingKeys(&_VRFCoordinatorTestV25.CallOpts, arg0) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Caller) SRequestCommitments(opts *bind.CallOpts, arg0 *big.Int) ([32]byte, error) { + var out []interface{} + err := _VRFCoordinatorTestV25.contract.Call(opts, &out, "s_requestCommitments", arg0) + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Session) SRequestCommitments(arg0 *big.Int) ([32]byte, error) { + return _VRFCoordinatorTestV25.Contract.SRequestCommitments(&_VRFCoordinatorTestV25.CallOpts, arg0) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25CallerSession) SRequestCommitments(arg0 *big.Int) ([32]byte, error) { + return _VRFCoordinatorTestV25.Contract.SRequestCommitments(&_VRFCoordinatorTestV25.CallOpts, arg0) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Caller) STotalBalance(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _VRFCoordinatorTestV25.contract.Call(opts, &out, "s_totalBalance") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Session) STotalBalance() (*big.Int, error) { + return _VRFCoordinatorTestV25.Contract.STotalBalance(&_VRFCoordinatorTestV25.CallOpts) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25CallerSession) STotalBalance() (*big.Int, error) { + return _VRFCoordinatorTestV25.Contract.STotalBalance(&_VRFCoordinatorTestV25.CallOpts) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Caller) STotalNativeBalance(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _VRFCoordinatorTestV25.contract.Call(opts, &out, "s_totalNativeBalance") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Session) STotalNativeBalance() (*big.Int, error) { + return _VRFCoordinatorTestV25.Contract.STotalNativeBalance(&_VRFCoordinatorTestV25.CallOpts) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25CallerSession) STotalNativeBalance() (*big.Int, error) { + return _VRFCoordinatorTestV25.Contract.STotalNativeBalance(&_VRFCoordinatorTestV25.CallOpts) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Transactor) AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + return _VRFCoordinatorTestV25.contract.Transact(opts, "acceptOwnership") +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Session) AcceptOwnership() (*types.Transaction, error) { + return _VRFCoordinatorTestV25.Contract.AcceptOwnership(&_VRFCoordinatorTestV25.TransactOpts) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25TransactorSession) AcceptOwnership() (*types.Transaction, error) { + return _VRFCoordinatorTestV25.Contract.AcceptOwnership(&_VRFCoordinatorTestV25.TransactOpts) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Transactor) AcceptSubscriptionOwnerTransfer(opts *bind.TransactOpts, subId *big.Int) (*types.Transaction, error) { + return _VRFCoordinatorTestV25.contract.Transact(opts, "acceptSubscriptionOwnerTransfer", subId) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Session) AcceptSubscriptionOwnerTransfer(subId *big.Int) (*types.Transaction, error) { + return _VRFCoordinatorTestV25.Contract.AcceptSubscriptionOwnerTransfer(&_VRFCoordinatorTestV25.TransactOpts, subId) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25TransactorSession) AcceptSubscriptionOwnerTransfer(subId *big.Int) (*types.Transaction, error) { + return _VRFCoordinatorTestV25.Contract.AcceptSubscriptionOwnerTransfer(&_VRFCoordinatorTestV25.TransactOpts, subId) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Transactor) AddConsumer(opts *bind.TransactOpts, subId *big.Int, consumer common.Address) (*types.Transaction, error) { + return _VRFCoordinatorTestV25.contract.Transact(opts, "addConsumer", subId, consumer) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Session) AddConsumer(subId *big.Int, consumer common.Address) (*types.Transaction, error) { + return _VRFCoordinatorTestV25.Contract.AddConsumer(&_VRFCoordinatorTestV25.TransactOpts, subId, consumer) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25TransactorSession) AddConsumer(subId *big.Int, consumer common.Address) (*types.Transaction, error) { + return _VRFCoordinatorTestV25.Contract.AddConsumer(&_VRFCoordinatorTestV25.TransactOpts, subId, consumer) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Transactor) CancelSubscription(opts *bind.TransactOpts, subId *big.Int, to common.Address) (*types.Transaction, error) { + return _VRFCoordinatorTestV25.contract.Transact(opts, "cancelSubscription", subId, to) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Session) CancelSubscription(subId *big.Int, to common.Address) (*types.Transaction, error) { + return _VRFCoordinatorTestV25.Contract.CancelSubscription(&_VRFCoordinatorTestV25.TransactOpts, subId, to) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25TransactorSession) CancelSubscription(subId *big.Int, to common.Address) (*types.Transaction, error) { + return _VRFCoordinatorTestV25.Contract.CancelSubscription(&_VRFCoordinatorTestV25.TransactOpts, subId, to) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Transactor) CreateSubscription(opts *bind.TransactOpts) (*types.Transaction, error) { + return _VRFCoordinatorTestV25.contract.Transact(opts, "createSubscription") +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Session) CreateSubscription() (*types.Transaction, error) { + return _VRFCoordinatorTestV25.Contract.CreateSubscription(&_VRFCoordinatorTestV25.TransactOpts) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25TransactorSession) CreateSubscription() (*types.Transaction, error) { + return _VRFCoordinatorTestV25.Contract.CreateSubscription(&_VRFCoordinatorTestV25.TransactOpts) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Transactor) DeregisterMigratableCoordinator(opts *bind.TransactOpts, target common.Address) (*types.Transaction, error) { + return _VRFCoordinatorTestV25.contract.Transact(opts, "deregisterMigratableCoordinator", target) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Session) DeregisterMigratableCoordinator(target common.Address) (*types.Transaction, error) { + return _VRFCoordinatorTestV25.Contract.DeregisterMigratableCoordinator(&_VRFCoordinatorTestV25.TransactOpts, target) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25TransactorSession) DeregisterMigratableCoordinator(target common.Address) (*types.Transaction, error) { + return _VRFCoordinatorTestV25.Contract.DeregisterMigratableCoordinator(&_VRFCoordinatorTestV25.TransactOpts, target) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Transactor) DeregisterProvingKey(opts *bind.TransactOpts, publicProvingKey [2]*big.Int) (*types.Transaction, error) { + return _VRFCoordinatorTestV25.contract.Transact(opts, "deregisterProvingKey", publicProvingKey) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Session) DeregisterProvingKey(publicProvingKey [2]*big.Int) (*types.Transaction, error) { + return _VRFCoordinatorTestV25.Contract.DeregisterProvingKey(&_VRFCoordinatorTestV25.TransactOpts, publicProvingKey) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25TransactorSession) DeregisterProvingKey(publicProvingKey [2]*big.Int) (*types.Transaction, error) { + return _VRFCoordinatorTestV25.Contract.DeregisterProvingKey(&_VRFCoordinatorTestV25.TransactOpts, publicProvingKey) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Transactor) FulfillRandomWords(opts *bind.TransactOpts, proof VRFOldProof, rc VRFTypesRequestCommitmentV2Plus, onlyPremium bool) (*types.Transaction, error) { + return _VRFCoordinatorTestV25.contract.Transact(opts, "fulfillRandomWords", proof, rc, onlyPremium) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Session) FulfillRandomWords(proof VRFOldProof, rc VRFTypesRequestCommitmentV2Plus, onlyPremium bool) (*types.Transaction, error) { + return _VRFCoordinatorTestV25.Contract.FulfillRandomWords(&_VRFCoordinatorTestV25.TransactOpts, proof, rc, onlyPremium) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25TransactorSession) FulfillRandomWords(proof VRFOldProof, rc VRFTypesRequestCommitmentV2Plus, onlyPremium bool) (*types.Transaction, error) { + return _VRFCoordinatorTestV25.Contract.FulfillRandomWords(&_VRFCoordinatorTestV25.TransactOpts, proof, rc, onlyPremium) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Transactor) FundSubscriptionWithNative(opts *bind.TransactOpts, subId *big.Int) (*types.Transaction, error) { + return _VRFCoordinatorTestV25.contract.Transact(opts, "fundSubscriptionWithNative", subId) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Session) FundSubscriptionWithNative(subId *big.Int) (*types.Transaction, error) { + return _VRFCoordinatorTestV25.Contract.FundSubscriptionWithNative(&_VRFCoordinatorTestV25.TransactOpts, subId) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25TransactorSession) FundSubscriptionWithNative(subId *big.Int) (*types.Transaction, error) { + return _VRFCoordinatorTestV25.Contract.FundSubscriptionWithNative(&_VRFCoordinatorTestV25.TransactOpts, subId) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Transactor) Migrate(opts *bind.TransactOpts, subId *big.Int, newCoordinator common.Address) (*types.Transaction, error) { + return _VRFCoordinatorTestV25.contract.Transact(opts, "migrate", subId, newCoordinator) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Session) Migrate(subId *big.Int, newCoordinator common.Address) (*types.Transaction, error) { + return _VRFCoordinatorTestV25.Contract.Migrate(&_VRFCoordinatorTestV25.TransactOpts, subId, newCoordinator) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25TransactorSession) Migrate(subId *big.Int, newCoordinator common.Address) (*types.Transaction, error) { + return _VRFCoordinatorTestV25.Contract.Migrate(&_VRFCoordinatorTestV25.TransactOpts, subId, newCoordinator) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Transactor) OnTokenTransfer(opts *bind.TransactOpts, arg0 common.Address, amount *big.Int, data []byte) (*types.Transaction, error) { + return _VRFCoordinatorTestV25.contract.Transact(opts, "onTokenTransfer", arg0, amount, data) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Session) OnTokenTransfer(arg0 common.Address, amount *big.Int, data []byte) (*types.Transaction, error) { + return _VRFCoordinatorTestV25.Contract.OnTokenTransfer(&_VRFCoordinatorTestV25.TransactOpts, arg0, amount, data) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25TransactorSession) OnTokenTransfer(arg0 common.Address, amount *big.Int, data []byte) (*types.Transaction, error) { + return _VRFCoordinatorTestV25.Contract.OnTokenTransfer(&_VRFCoordinatorTestV25.TransactOpts, arg0, amount, data) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Transactor) OwnerCancelSubscription(opts *bind.TransactOpts, subId *big.Int) (*types.Transaction, error) { + return _VRFCoordinatorTestV25.contract.Transact(opts, "ownerCancelSubscription", subId) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Session) OwnerCancelSubscription(subId *big.Int) (*types.Transaction, error) { + return _VRFCoordinatorTestV25.Contract.OwnerCancelSubscription(&_VRFCoordinatorTestV25.TransactOpts, subId) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25TransactorSession) OwnerCancelSubscription(subId *big.Int) (*types.Transaction, error) { + return _VRFCoordinatorTestV25.Contract.OwnerCancelSubscription(&_VRFCoordinatorTestV25.TransactOpts, subId) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Transactor) RecoverFunds(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) { + return _VRFCoordinatorTestV25.contract.Transact(opts, "recoverFunds", to) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Session) RecoverFunds(to common.Address) (*types.Transaction, error) { + return _VRFCoordinatorTestV25.Contract.RecoverFunds(&_VRFCoordinatorTestV25.TransactOpts, to) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25TransactorSession) RecoverFunds(to common.Address) (*types.Transaction, error) { + return _VRFCoordinatorTestV25.Contract.RecoverFunds(&_VRFCoordinatorTestV25.TransactOpts, to) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Transactor) RecoverNativeFunds(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) { + return _VRFCoordinatorTestV25.contract.Transact(opts, "recoverNativeFunds", to) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Session) RecoverNativeFunds(to common.Address) (*types.Transaction, error) { + return _VRFCoordinatorTestV25.Contract.RecoverNativeFunds(&_VRFCoordinatorTestV25.TransactOpts, to) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25TransactorSession) RecoverNativeFunds(to common.Address) (*types.Transaction, error) { + return _VRFCoordinatorTestV25.Contract.RecoverNativeFunds(&_VRFCoordinatorTestV25.TransactOpts, to) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Transactor) RegisterMigratableCoordinator(opts *bind.TransactOpts, target common.Address) (*types.Transaction, error) { + return _VRFCoordinatorTestV25.contract.Transact(opts, "registerMigratableCoordinator", target) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Session) RegisterMigratableCoordinator(target common.Address) (*types.Transaction, error) { + return _VRFCoordinatorTestV25.Contract.RegisterMigratableCoordinator(&_VRFCoordinatorTestV25.TransactOpts, target) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25TransactorSession) RegisterMigratableCoordinator(target common.Address) (*types.Transaction, error) { + return _VRFCoordinatorTestV25.Contract.RegisterMigratableCoordinator(&_VRFCoordinatorTestV25.TransactOpts, target) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Transactor) RegisterProvingKey(opts *bind.TransactOpts, publicProvingKey [2]*big.Int, maxGas uint64) (*types.Transaction, error) { + return _VRFCoordinatorTestV25.contract.Transact(opts, "registerProvingKey", publicProvingKey, maxGas) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Session) RegisterProvingKey(publicProvingKey [2]*big.Int, maxGas uint64) (*types.Transaction, error) { + return _VRFCoordinatorTestV25.Contract.RegisterProvingKey(&_VRFCoordinatorTestV25.TransactOpts, publicProvingKey, maxGas) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25TransactorSession) RegisterProvingKey(publicProvingKey [2]*big.Int, maxGas uint64) (*types.Transaction, error) { + return _VRFCoordinatorTestV25.Contract.RegisterProvingKey(&_VRFCoordinatorTestV25.TransactOpts, publicProvingKey, maxGas) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Transactor) RemoveConsumer(opts *bind.TransactOpts, subId *big.Int, consumer common.Address) (*types.Transaction, error) { + return _VRFCoordinatorTestV25.contract.Transact(opts, "removeConsumer", subId, consumer) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Session) RemoveConsumer(subId *big.Int, consumer common.Address) (*types.Transaction, error) { + return _VRFCoordinatorTestV25.Contract.RemoveConsumer(&_VRFCoordinatorTestV25.TransactOpts, subId, consumer) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25TransactorSession) RemoveConsumer(subId *big.Int, consumer common.Address) (*types.Transaction, error) { + return _VRFCoordinatorTestV25.Contract.RemoveConsumer(&_VRFCoordinatorTestV25.TransactOpts, subId, consumer) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Transactor) RequestRandomWords(opts *bind.TransactOpts, req VRFV2PlusClientRandomWordsRequest) (*types.Transaction, error) { + return _VRFCoordinatorTestV25.contract.Transact(opts, "requestRandomWords", req) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Session) RequestRandomWords(req VRFV2PlusClientRandomWordsRequest) (*types.Transaction, error) { + return _VRFCoordinatorTestV25.Contract.RequestRandomWords(&_VRFCoordinatorTestV25.TransactOpts, req) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25TransactorSession) RequestRandomWords(req VRFV2PlusClientRandomWordsRequest) (*types.Transaction, error) { + return _VRFCoordinatorTestV25.Contract.RequestRandomWords(&_VRFCoordinatorTestV25.TransactOpts, req) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Transactor) RequestSubscriptionOwnerTransfer(opts *bind.TransactOpts, subId *big.Int, newOwner common.Address) (*types.Transaction, error) { + return _VRFCoordinatorTestV25.contract.Transact(opts, "requestSubscriptionOwnerTransfer", subId, newOwner) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Session) RequestSubscriptionOwnerTransfer(subId *big.Int, newOwner common.Address) (*types.Transaction, error) { + return _VRFCoordinatorTestV25.Contract.RequestSubscriptionOwnerTransfer(&_VRFCoordinatorTestV25.TransactOpts, subId, newOwner) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25TransactorSession) RequestSubscriptionOwnerTransfer(subId *big.Int, newOwner common.Address) (*types.Transaction, error) { + return _VRFCoordinatorTestV25.Contract.RequestSubscriptionOwnerTransfer(&_VRFCoordinatorTestV25.TransactOpts, subId, newOwner) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Transactor) SetConfig(opts *bind.TransactOpts, minimumRequestConfirmations uint16, maxGasLimit uint32, stalenessSeconds uint32, gasAfterPaymentCalculation uint32, fallbackWeiPerUnitLink *big.Int, fulfillmentFlatFeeNativePPM uint32, fulfillmentFlatFeeLinkDiscountPPM uint32, nativePremiumPercentage uint8, linkPremiumPercentage uint8) (*types.Transaction, error) { + return _VRFCoordinatorTestV25.contract.Transact(opts, "setConfig", minimumRequestConfirmations, maxGasLimit, stalenessSeconds, gasAfterPaymentCalculation, fallbackWeiPerUnitLink, fulfillmentFlatFeeNativePPM, fulfillmentFlatFeeLinkDiscountPPM, nativePremiumPercentage, linkPremiumPercentage) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Session) SetConfig(minimumRequestConfirmations uint16, maxGasLimit uint32, stalenessSeconds uint32, gasAfterPaymentCalculation uint32, fallbackWeiPerUnitLink *big.Int, fulfillmentFlatFeeNativePPM uint32, fulfillmentFlatFeeLinkDiscountPPM uint32, nativePremiumPercentage uint8, linkPremiumPercentage uint8) (*types.Transaction, error) { + return _VRFCoordinatorTestV25.Contract.SetConfig(&_VRFCoordinatorTestV25.TransactOpts, minimumRequestConfirmations, maxGasLimit, stalenessSeconds, gasAfterPaymentCalculation, fallbackWeiPerUnitLink, fulfillmentFlatFeeNativePPM, fulfillmentFlatFeeLinkDiscountPPM, nativePremiumPercentage, linkPremiumPercentage) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25TransactorSession) SetConfig(minimumRequestConfirmations uint16, maxGasLimit uint32, stalenessSeconds uint32, gasAfterPaymentCalculation uint32, fallbackWeiPerUnitLink *big.Int, fulfillmentFlatFeeNativePPM uint32, fulfillmentFlatFeeLinkDiscountPPM uint32, nativePremiumPercentage uint8, linkPremiumPercentage uint8) (*types.Transaction, error) { + return _VRFCoordinatorTestV25.Contract.SetConfig(&_VRFCoordinatorTestV25.TransactOpts, minimumRequestConfirmations, maxGasLimit, stalenessSeconds, gasAfterPaymentCalculation, fallbackWeiPerUnitLink, fulfillmentFlatFeeNativePPM, fulfillmentFlatFeeLinkDiscountPPM, nativePremiumPercentage, linkPremiumPercentage) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Transactor) SetLINKAndLINKNativeFeed(opts *bind.TransactOpts, link common.Address, linkNativeFeed common.Address) (*types.Transaction, error) { + return _VRFCoordinatorTestV25.contract.Transact(opts, "setLINKAndLINKNativeFeed", link, linkNativeFeed) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Session) SetLINKAndLINKNativeFeed(link common.Address, linkNativeFeed common.Address) (*types.Transaction, error) { + return _VRFCoordinatorTestV25.Contract.SetLINKAndLINKNativeFeed(&_VRFCoordinatorTestV25.TransactOpts, link, linkNativeFeed) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25TransactorSession) SetLINKAndLINKNativeFeed(link common.Address, linkNativeFeed common.Address) (*types.Transaction, error) { + return _VRFCoordinatorTestV25.Contract.SetLINKAndLINKNativeFeed(&_VRFCoordinatorTestV25.TransactOpts, link, linkNativeFeed) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Transactor) TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) { + return _VRFCoordinatorTestV25.contract.Transact(opts, "transferOwnership", to) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Session) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _VRFCoordinatorTestV25.Contract.TransferOwnership(&_VRFCoordinatorTestV25.TransactOpts, to) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25TransactorSession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _VRFCoordinatorTestV25.Contract.TransferOwnership(&_VRFCoordinatorTestV25.TransactOpts, to) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Transactor) Withdraw(opts *bind.TransactOpts, recipient common.Address) (*types.Transaction, error) { + return _VRFCoordinatorTestV25.contract.Transact(opts, "withdraw", recipient) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Session) Withdraw(recipient common.Address) (*types.Transaction, error) { + return _VRFCoordinatorTestV25.Contract.Withdraw(&_VRFCoordinatorTestV25.TransactOpts, recipient) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25TransactorSession) Withdraw(recipient common.Address) (*types.Transaction, error) { + return _VRFCoordinatorTestV25.Contract.Withdraw(&_VRFCoordinatorTestV25.TransactOpts, recipient) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Transactor) WithdrawNative(opts *bind.TransactOpts, recipient common.Address) (*types.Transaction, error) { + return _VRFCoordinatorTestV25.contract.Transact(opts, "withdrawNative", recipient) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Session) WithdrawNative(recipient common.Address) (*types.Transaction, error) { + return _VRFCoordinatorTestV25.Contract.WithdrawNative(&_VRFCoordinatorTestV25.TransactOpts, recipient) +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25TransactorSession) WithdrawNative(recipient common.Address) (*types.Transaction, error) { + return _VRFCoordinatorTestV25.Contract.WithdrawNative(&_VRFCoordinatorTestV25.TransactOpts, recipient) +} + +type VRFCoordinatorTestV25ConfigSetIterator struct { + Event *VRFCoordinatorTestV25ConfigSet + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *VRFCoordinatorTestV25ConfigSetIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(VRFCoordinatorTestV25ConfigSet) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(VRFCoordinatorTestV25ConfigSet) + 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() + } +} + +func (it *VRFCoordinatorTestV25ConfigSetIterator) Error() error { + return it.fail +} + +func (it *VRFCoordinatorTestV25ConfigSetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type VRFCoordinatorTestV25ConfigSet struct { + MinimumRequestConfirmations uint16 + MaxGasLimit uint32 + StalenessSeconds uint32 + GasAfterPaymentCalculation uint32 + FallbackWeiPerUnitLink *big.Int + FulfillmentFlatFeeNativePPM uint32 + FulfillmentFlatFeeLinkDiscountPPM uint32 + NativePremiumPercentage uint8 + LinkPremiumPercentage uint8 + Raw types.Log +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Filterer) FilterConfigSet(opts *bind.FilterOpts) (*VRFCoordinatorTestV25ConfigSetIterator, error) { + + logs, sub, err := _VRFCoordinatorTestV25.contract.FilterLogs(opts, "ConfigSet") + if err != nil { + return nil, err + } + return &VRFCoordinatorTestV25ConfigSetIterator{contract: _VRFCoordinatorTestV25.contract, event: "ConfigSet", logs: logs, sub: sub}, nil +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Filterer) WatchConfigSet(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorTestV25ConfigSet) (event.Subscription, error) { + + logs, sub, err := _VRFCoordinatorTestV25.contract.WatchLogs(opts, "ConfigSet") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(VRFCoordinatorTestV25ConfigSet) + if err := _VRFCoordinatorTestV25.contract.UnpackLog(event, "ConfigSet", 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 +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Filterer) ParseConfigSet(log types.Log) (*VRFCoordinatorTestV25ConfigSet, error) { + event := new(VRFCoordinatorTestV25ConfigSet) + if err := _VRFCoordinatorTestV25.contract.UnpackLog(event, "ConfigSet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type VRFCoordinatorTestV25CoordinatorDeregisteredIterator struct { + Event *VRFCoordinatorTestV25CoordinatorDeregistered + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *VRFCoordinatorTestV25CoordinatorDeregisteredIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(VRFCoordinatorTestV25CoordinatorDeregistered) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(VRFCoordinatorTestV25CoordinatorDeregistered) + 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() + } +} + +func (it *VRFCoordinatorTestV25CoordinatorDeregisteredIterator) Error() error { + return it.fail +} + +func (it *VRFCoordinatorTestV25CoordinatorDeregisteredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type VRFCoordinatorTestV25CoordinatorDeregistered struct { + CoordinatorAddress common.Address + Raw types.Log +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Filterer) FilterCoordinatorDeregistered(opts *bind.FilterOpts) (*VRFCoordinatorTestV25CoordinatorDeregisteredIterator, error) { + + logs, sub, err := _VRFCoordinatorTestV25.contract.FilterLogs(opts, "CoordinatorDeregistered") + if err != nil { + return nil, err + } + return &VRFCoordinatorTestV25CoordinatorDeregisteredIterator{contract: _VRFCoordinatorTestV25.contract, event: "CoordinatorDeregistered", logs: logs, sub: sub}, nil +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Filterer) WatchCoordinatorDeregistered(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorTestV25CoordinatorDeregistered) (event.Subscription, error) { + + logs, sub, err := _VRFCoordinatorTestV25.contract.WatchLogs(opts, "CoordinatorDeregistered") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(VRFCoordinatorTestV25CoordinatorDeregistered) + if err := _VRFCoordinatorTestV25.contract.UnpackLog(event, "CoordinatorDeregistered", 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 +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Filterer) ParseCoordinatorDeregistered(log types.Log) (*VRFCoordinatorTestV25CoordinatorDeregistered, error) { + event := new(VRFCoordinatorTestV25CoordinatorDeregistered) + if err := _VRFCoordinatorTestV25.contract.UnpackLog(event, "CoordinatorDeregistered", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type VRFCoordinatorTestV25CoordinatorRegisteredIterator struct { + Event *VRFCoordinatorTestV25CoordinatorRegistered + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *VRFCoordinatorTestV25CoordinatorRegisteredIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(VRFCoordinatorTestV25CoordinatorRegistered) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(VRFCoordinatorTestV25CoordinatorRegistered) + 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() + } +} + +func (it *VRFCoordinatorTestV25CoordinatorRegisteredIterator) Error() error { + return it.fail +} + +func (it *VRFCoordinatorTestV25CoordinatorRegisteredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type VRFCoordinatorTestV25CoordinatorRegistered struct { + CoordinatorAddress common.Address + Raw types.Log +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Filterer) FilterCoordinatorRegistered(opts *bind.FilterOpts) (*VRFCoordinatorTestV25CoordinatorRegisteredIterator, error) { + + logs, sub, err := _VRFCoordinatorTestV25.contract.FilterLogs(opts, "CoordinatorRegistered") + if err != nil { + return nil, err + } + return &VRFCoordinatorTestV25CoordinatorRegisteredIterator{contract: _VRFCoordinatorTestV25.contract, event: "CoordinatorRegistered", logs: logs, sub: sub}, nil +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Filterer) WatchCoordinatorRegistered(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorTestV25CoordinatorRegistered) (event.Subscription, error) { + + logs, sub, err := _VRFCoordinatorTestV25.contract.WatchLogs(opts, "CoordinatorRegistered") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(VRFCoordinatorTestV25CoordinatorRegistered) + if err := _VRFCoordinatorTestV25.contract.UnpackLog(event, "CoordinatorRegistered", 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 +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Filterer) ParseCoordinatorRegistered(log types.Log) (*VRFCoordinatorTestV25CoordinatorRegistered, error) { + event := new(VRFCoordinatorTestV25CoordinatorRegistered) + if err := _VRFCoordinatorTestV25.contract.UnpackLog(event, "CoordinatorRegistered", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type VRFCoordinatorTestV25FallbackWeiPerUnitLinkUsedIterator struct { + Event *VRFCoordinatorTestV25FallbackWeiPerUnitLinkUsed + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *VRFCoordinatorTestV25FallbackWeiPerUnitLinkUsedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(VRFCoordinatorTestV25FallbackWeiPerUnitLinkUsed) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(VRFCoordinatorTestV25FallbackWeiPerUnitLinkUsed) + 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() + } +} + +func (it *VRFCoordinatorTestV25FallbackWeiPerUnitLinkUsedIterator) Error() error { + return it.fail +} + +func (it *VRFCoordinatorTestV25FallbackWeiPerUnitLinkUsedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type VRFCoordinatorTestV25FallbackWeiPerUnitLinkUsed struct { + RequestId *big.Int + FallbackWeiPerUnitLink *big.Int + Raw types.Log +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Filterer) FilterFallbackWeiPerUnitLinkUsed(opts *bind.FilterOpts) (*VRFCoordinatorTestV25FallbackWeiPerUnitLinkUsedIterator, error) { + + logs, sub, err := _VRFCoordinatorTestV25.contract.FilterLogs(opts, "FallbackWeiPerUnitLinkUsed") + if err != nil { + return nil, err + } + return &VRFCoordinatorTestV25FallbackWeiPerUnitLinkUsedIterator{contract: _VRFCoordinatorTestV25.contract, event: "FallbackWeiPerUnitLinkUsed", logs: logs, sub: sub}, nil +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Filterer) WatchFallbackWeiPerUnitLinkUsed(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorTestV25FallbackWeiPerUnitLinkUsed) (event.Subscription, error) { + + logs, sub, err := _VRFCoordinatorTestV25.contract.WatchLogs(opts, "FallbackWeiPerUnitLinkUsed") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(VRFCoordinatorTestV25FallbackWeiPerUnitLinkUsed) + if err := _VRFCoordinatorTestV25.contract.UnpackLog(event, "FallbackWeiPerUnitLinkUsed", 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 +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Filterer) ParseFallbackWeiPerUnitLinkUsed(log types.Log) (*VRFCoordinatorTestV25FallbackWeiPerUnitLinkUsed, error) { + event := new(VRFCoordinatorTestV25FallbackWeiPerUnitLinkUsed) + if err := _VRFCoordinatorTestV25.contract.UnpackLog(event, "FallbackWeiPerUnitLinkUsed", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type VRFCoordinatorTestV25FundsRecoveredIterator struct { + Event *VRFCoordinatorTestV25FundsRecovered + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *VRFCoordinatorTestV25FundsRecoveredIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(VRFCoordinatorTestV25FundsRecovered) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(VRFCoordinatorTestV25FundsRecovered) + 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() + } +} + +func (it *VRFCoordinatorTestV25FundsRecoveredIterator) Error() error { + return it.fail +} + +func (it *VRFCoordinatorTestV25FundsRecoveredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type VRFCoordinatorTestV25FundsRecovered struct { + To common.Address + Amount *big.Int + Raw types.Log +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Filterer) FilterFundsRecovered(opts *bind.FilterOpts) (*VRFCoordinatorTestV25FundsRecoveredIterator, error) { + + logs, sub, err := _VRFCoordinatorTestV25.contract.FilterLogs(opts, "FundsRecovered") + if err != nil { + return nil, err + } + return &VRFCoordinatorTestV25FundsRecoveredIterator{contract: _VRFCoordinatorTestV25.contract, event: "FundsRecovered", logs: logs, sub: sub}, nil +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Filterer) WatchFundsRecovered(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorTestV25FundsRecovered) (event.Subscription, error) { + + logs, sub, err := _VRFCoordinatorTestV25.contract.WatchLogs(opts, "FundsRecovered") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(VRFCoordinatorTestV25FundsRecovered) + if err := _VRFCoordinatorTestV25.contract.UnpackLog(event, "FundsRecovered", 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 +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Filterer) ParseFundsRecovered(log types.Log) (*VRFCoordinatorTestV25FundsRecovered, error) { + event := new(VRFCoordinatorTestV25FundsRecovered) + if err := _VRFCoordinatorTestV25.contract.UnpackLog(event, "FundsRecovered", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type VRFCoordinatorTestV25MigrationCompletedIterator struct { + Event *VRFCoordinatorTestV25MigrationCompleted + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *VRFCoordinatorTestV25MigrationCompletedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(VRFCoordinatorTestV25MigrationCompleted) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(VRFCoordinatorTestV25MigrationCompleted) + 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() + } +} + +func (it *VRFCoordinatorTestV25MigrationCompletedIterator) Error() error { + return it.fail +} + +func (it *VRFCoordinatorTestV25MigrationCompletedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type VRFCoordinatorTestV25MigrationCompleted struct { + NewCoordinator common.Address + SubId *big.Int + Raw types.Log +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Filterer) FilterMigrationCompleted(opts *bind.FilterOpts) (*VRFCoordinatorTestV25MigrationCompletedIterator, error) { + + logs, sub, err := _VRFCoordinatorTestV25.contract.FilterLogs(opts, "MigrationCompleted") + if err != nil { + return nil, err + } + return &VRFCoordinatorTestV25MigrationCompletedIterator{contract: _VRFCoordinatorTestV25.contract, event: "MigrationCompleted", logs: logs, sub: sub}, nil +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Filterer) WatchMigrationCompleted(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorTestV25MigrationCompleted) (event.Subscription, error) { + + logs, sub, err := _VRFCoordinatorTestV25.contract.WatchLogs(opts, "MigrationCompleted") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(VRFCoordinatorTestV25MigrationCompleted) + if err := _VRFCoordinatorTestV25.contract.UnpackLog(event, "MigrationCompleted", 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 +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Filterer) ParseMigrationCompleted(log types.Log) (*VRFCoordinatorTestV25MigrationCompleted, error) { + event := new(VRFCoordinatorTestV25MigrationCompleted) + if err := _VRFCoordinatorTestV25.contract.UnpackLog(event, "MigrationCompleted", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type VRFCoordinatorTestV25NativeFundsRecoveredIterator struct { + Event *VRFCoordinatorTestV25NativeFundsRecovered + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *VRFCoordinatorTestV25NativeFundsRecoveredIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(VRFCoordinatorTestV25NativeFundsRecovered) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(VRFCoordinatorTestV25NativeFundsRecovered) + 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() + } +} + +func (it *VRFCoordinatorTestV25NativeFundsRecoveredIterator) Error() error { + return it.fail +} + +func (it *VRFCoordinatorTestV25NativeFundsRecoveredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type VRFCoordinatorTestV25NativeFundsRecovered struct { + To common.Address + Amount *big.Int + Raw types.Log +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Filterer) FilterNativeFundsRecovered(opts *bind.FilterOpts) (*VRFCoordinatorTestV25NativeFundsRecoveredIterator, error) { + + logs, sub, err := _VRFCoordinatorTestV25.contract.FilterLogs(opts, "NativeFundsRecovered") + if err != nil { + return nil, err + } + return &VRFCoordinatorTestV25NativeFundsRecoveredIterator{contract: _VRFCoordinatorTestV25.contract, event: "NativeFundsRecovered", logs: logs, sub: sub}, nil +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Filterer) WatchNativeFundsRecovered(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorTestV25NativeFundsRecovered) (event.Subscription, error) { + + logs, sub, err := _VRFCoordinatorTestV25.contract.WatchLogs(opts, "NativeFundsRecovered") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(VRFCoordinatorTestV25NativeFundsRecovered) + if err := _VRFCoordinatorTestV25.contract.UnpackLog(event, "NativeFundsRecovered", 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 +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Filterer) ParseNativeFundsRecovered(log types.Log) (*VRFCoordinatorTestV25NativeFundsRecovered, error) { + event := new(VRFCoordinatorTestV25NativeFundsRecovered) + if err := _VRFCoordinatorTestV25.contract.UnpackLog(event, "NativeFundsRecovered", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type VRFCoordinatorTestV25OwnershipTransferRequestedIterator struct { + Event *VRFCoordinatorTestV25OwnershipTransferRequested + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *VRFCoordinatorTestV25OwnershipTransferRequestedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(VRFCoordinatorTestV25OwnershipTransferRequested) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(VRFCoordinatorTestV25OwnershipTransferRequested) + 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() + } +} + +func (it *VRFCoordinatorTestV25OwnershipTransferRequestedIterator) Error() error { + return it.fail +} + +func (it *VRFCoordinatorTestV25OwnershipTransferRequestedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type VRFCoordinatorTestV25OwnershipTransferRequested struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Filterer) FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*VRFCoordinatorTestV25OwnershipTransferRequestedIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _VRFCoordinatorTestV25.contract.FilterLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return &VRFCoordinatorTestV25OwnershipTransferRequestedIterator{contract: _VRFCoordinatorTestV25.contract, event: "OwnershipTransferRequested", logs: logs, sub: sub}, nil +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Filterer) WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorTestV25OwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _VRFCoordinatorTestV25.contract.WatchLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(VRFCoordinatorTestV25OwnershipTransferRequested) + if err := _VRFCoordinatorTestV25.contract.UnpackLog(event, "OwnershipTransferRequested", 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 +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Filterer) ParseOwnershipTransferRequested(log types.Log) (*VRFCoordinatorTestV25OwnershipTransferRequested, error) { + event := new(VRFCoordinatorTestV25OwnershipTransferRequested) + if err := _VRFCoordinatorTestV25.contract.UnpackLog(event, "OwnershipTransferRequested", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type VRFCoordinatorTestV25OwnershipTransferredIterator struct { + Event *VRFCoordinatorTestV25OwnershipTransferred + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *VRFCoordinatorTestV25OwnershipTransferredIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(VRFCoordinatorTestV25OwnershipTransferred) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(VRFCoordinatorTestV25OwnershipTransferred) + 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() + } +} + +func (it *VRFCoordinatorTestV25OwnershipTransferredIterator) Error() error { + return it.fail +} + +func (it *VRFCoordinatorTestV25OwnershipTransferredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type VRFCoordinatorTestV25OwnershipTransferred struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Filterer) FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*VRFCoordinatorTestV25OwnershipTransferredIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _VRFCoordinatorTestV25.contract.FilterLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return &VRFCoordinatorTestV25OwnershipTransferredIterator{contract: _VRFCoordinatorTestV25.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Filterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorTestV25OwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _VRFCoordinatorTestV25.contract.WatchLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(VRFCoordinatorTestV25OwnershipTransferred) + if err := _VRFCoordinatorTestV25.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 +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Filterer) ParseOwnershipTransferred(log types.Log) (*VRFCoordinatorTestV25OwnershipTransferred, error) { + event := new(VRFCoordinatorTestV25OwnershipTransferred) + if err := _VRFCoordinatorTestV25.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type VRFCoordinatorTestV25ProvingKeyDeregisteredIterator struct { + Event *VRFCoordinatorTestV25ProvingKeyDeregistered + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *VRFCoordinatorTestV25ProvingKeyDeregisteredIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(VRFCoordinatorTestV25ProvingKeyDeregistered) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(VRFCoordinatorTestV25ProvingKeyDeregistered) + 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() + } +} + +func (it *VRFCoordinatorTestV25ProvingKeyDeregisteredIterator) Error() error { + return it.fail +} + +func (it *VRFCoordinatorTestV25ProvingKeyDeregisteredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type VRFCoordinatorTestV25ProvingKeyDeregistered struct { + KeyHash [32]byte + MaxGas uint64 + Raw types.Log +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Filterer) FilterProvingKeyDeregistered(opts *bind.FilterOpts) (*VRFCoordinatorTestV25ProvingKeyDeregisteredIterator, error) { + + logs, sub, err := _VRFCoordinatorTestV25.contract.FilterLogs(opts, "ProvingKeyDeregistered") + if err != nil { + return nil, err + } + return &VRFCoordinatorTestV25ProvingKeyDeregisteredIterator{contract: _VRFCoordinatorTestV25.contract, event: "ProvingKeyDeregistered", logs: logs, sub: sub}, nil +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Filterer) WatchProvingKeyDeregistered(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorTestV25ProvingKeyDeregistered) (event.Subscription, error) { + + logs, sub, err := _VRFCoordinatorTestV25.contract.WatchLogs(opts, "ProvingKeyDeregistered") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(VRFCoordinatorTestV25ProvingKeyDeregistered) + if err := _VRFCoordinatorTestV25.contract.UnpackLog(event, "ProvingKeyDeregistered", 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 +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Filterer) ParseProvingKeyDeregistered(log types.Log) (*VRFCoordinatorTestV25ProvingKeyDeregistered, error) { + event := new(VRFCoordinatorTestV25ProvingKeyDeregistered) + if err := _VRFCoordinatorTestV25.contract.UnpackLog(event, "ProvingKeyDeregistered", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type VRFCoordinatorTestV25ProvingKeyRegisteredIterator struct { + Event *VRFCoordinatorTestV25ProvingKeyRegistered + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *VRFCoordinatorTestV25ProvingKeyRegisteredIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(VRFCoordinatorTestV25ProvingKeyRegistered) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(VRFCoordinatorTestV25ProvingKeyRegistered) + 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() + } +} + +func (it *VRFCoordinatorTestV25ProvingKeyRegisteredIterator) Error() error { + return it.fail +} + +func (it *VRFCoordinatorTestV25ProvingKeyRegisteredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type VRFCoordinatorTestV25ProvingKeyRegistered struct { + KeyHash [32]byte + MaxGas uint64 + Raw types.Log +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Filterer) FilterProvingKeyRegistered(opts *bind.FilterOpts) (*VRFCoordinatorTestV25ProvingKeyRegisteredIterator, error) { + + logs, sub, err := _VRFCoordinatorTestV25.contract.FilterLogs(opts, "ProvingKeyRegistered") + if err != nil { + return nil, err + } + return &VRFCoordinatorTestV25ProvingKeyRegisteredIterator{contract: _VRFCoordinatorTestV25.contract, event: "ProvingKeyRegistered", logs: logs, sub: sub}, nil +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Filterer) WatchProvingKeyRegistered(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorTestV25ProvingKeyRegistered) (event.Subscription, error) { + + logs, sub, err := _VRFCoordinatorTestV25.contract.WatchLogs(opts, "ProvingKeyRegistered") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(VRFCoordinatorTestV25ProvingKeyRegistered) + if err := _VRFCoordinatorTestV25.contract.UnpackLog(event, "ProvingKeyRegistered", 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 +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Filterer) ParseProvingKeyRegistered(log types.Log) (*VRFCoordinatorTestV25ProvingKeyRegistered, error) { + event := new(VRFCoordinatorTestV25ProvingKeyRegistered) + if err := _VRFCoordinatorTestV25.contract.UnpackLog(event, "ProvingKeyRegistered", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type VRFCoordinatorTestV25RandomWordsFulfilledIterator struct { + Event *VRFCoordinatorTestV25RandomWordsFulfilled + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *VRFCoordinatorTestV25RandomWordsFulfilledIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(VRFCoordinatorTestV25RandomWordsFulfilled) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(VRFCoordinatorTestV25RandomWordsFulfilled) + 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() + } +} + +func (it *VRFCoordinatorTestV25RandomWordsFulfilledIterator) Error() error { + return it.fail +} + +func (it *VRFCoordinatorTestV25RandomWordsFulfilledIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type VRFCoordinatorTestV25RandomWordsFulfilled struct { + RequestId *big.Int + OutputSeed *big.Int + SubId *big.Int + Payment *big.Int + NativePayment bool + Success bool + OnlyPremium bool + Raw types.Log +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Filterer) FilterRandomWordsFulfilled(opts *bind.FilterOpts, requestId []*big.Int, subId []*big.Int) (*VRFCoordinatorTestV25RandomWordsFulfilledIterator, error) { + + var requestIdRule []interface{} + for _, requestIdItem := range requestId { + requestIdRule = append(requestIdRule, requestIdItem) + } + + var subIdRule []interface{} + for _, subIdItem := range subId { + subIdRule = append(subIdRule, subIdItem) + } + + logs, sub, err := _VRFCoordinatorTestV25.contract.FilterLogs(opts, "RandomWordsFulfilled", requestIdRule, subIdRule) + if err != nil { + return nil, err + } + return &VRFCoordinatorTestV25RandomWordsFulfilledIterator{contract: _VRFCoordinatorTestV25.contract, event: "RandomWordsFulfilled", logs: logs, sub: sub}, nil +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Filterer) WatchRandomWordsFulfilled(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorTestV25RandomWordsFulfilled, requestId []*big.Int, subId []*big.Int) (event.Subscription, error) { + + var requestIdRule []interface{} + for _, requestIdItem := range requestId { + requestIdRule = append(requestIdRule, requestIdItem) + } + + var subIdRule []interface{} + for _, subIdItem := range subId { + subIdRule = append(subIdRule, subIdItem) + } + + logs, sub, err := _VRFCoordinatorTestV25.contract.WatchLogs(opts, "RandomWordsFulfilled", requestIdRule, subIdRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(VRFCoordinatorTestV25RandomWordsFulfilled) + if err := _VRFCoordinatorTestV25.contract.UnpackLog(event, "RandomWordsFulfilled", 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 +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Filterer) ParseRandomWordsFulfilled(log types.Log) (*VRFCoordinatorTestV25RandomWordsFulfilled, error) { + event := new(VRFCoordinatorTestV25RandomWordsFulfilled) + if err := _VRFCoordinatorTestV25.contract.UnpackLog(event, "RandomWordsFulfilled", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type VRFCoordinatorTestV25RandomWordsRequestedIterator struct { + Event *VRFCoordinatorTestV25RandomWordsRequested + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *VRFCoordinatorTestV25RandomWordsRequestedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(VRFCoordinatorTestV25RandomWordsRequested) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(VRFCoordinatorTestV25RandomWordsRequested) + 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() + } +} + +func (it *VRFCoordinatorTestV25RandomWordsRequestedIterator) Error() error { + return it.fail +} + +func (it *VRFCoordinatorTestV25RandomWordsRequestedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type VRFCoordinatorTestV25RandomWordsRequested struct { + KeyHash [32]byte + RequestId *big.Int + PreSeed *big.Int + SubId *big.Int + MinimumRequestConfirmations uint16 + CallbackGasLimit uint32 + NumWords uint32 + ExtraArgs []byte + Sender common.Address + Raw types.Log +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Filterer) FilterRandomWordsRequested(opts *bind.FilterOpts, keyHash [][32]byte, subId []*big.Int, sender []common.Address) (*VRFCoordinatorTestV25RandomWordsRequestedIterator, error) { + + var keyHashRule []interface{} + for _, keyHashItem := range keyHash { + keyHashRule = append(keyHashRule, keyHashItem) + } + + var subIdRule []interface{} + for _, subIdItem := range subId { + subIdRule = append(subIdRule, subIdItem) + } + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _VRFCoordinatorTestV25.contract.FilterLogs(opts, "RandomWordsRequested", keyHashRule, subIdRule, senderRule) + if err != nil { + return nil, err + } + return &VRFCoordinatorTestV25RandomWordsRequestedIterator{contract: _VRFCoordinatorTestV25.contract, event: "RandomWordsRequested", logs: logs, sub: sub}, nil +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Filterer) WatchRandomWordsRequested(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorTestV25RandomWordsRequested, keyHash [][32]byte, subId []*big.Int, sender []common.Address) (event.Subscription, error) { + + var keyHashRule []interface{} + for _, keyHashItem := range keyHash { + keyHashRule = append(keyHashRule, keyHashItem) + } + + var subIdRule []interface{} + for _, subIdItem := range subId { + subIdRule = append(subIdRule, subIdItem) + } + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _VRFCoordinatorTestV25.contract.WatchLogs(opts, "RandomWordsRequested", keyHashRule, subIdRule, senderRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(VRFCoordinatorTestV25RandomWordsRequested) + if err := _VRFCoordinatorTestV25.contract.UnpackLog(event, "RandomWordsRequested", 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 +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Filterer) ParseRandomWordsRequested(log types.Log) (*VRFCoordinatorTestV25RandomWordsRequested, error) { + event := new(VRFCoordinatorTestV25RandomWordsRequested) + if err := _VRFCoordinatorTestV25.contract.UnpackLog(event, "RandomWordsRequested", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type VRFCoordinatorTestV25SubscriptionCanceledIterator struct { + Event *VRFCoordinatorTestV25SubscriptionCanceled + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *VRFCoordinatorTestV25SubscriptionCanceledIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(VRFCoordinatorTestV25SubscriptionCanceled) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(VRFCoordinatorTestV25SubscriptionCanceled) + 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() + } +} + +func (it *VRFCoordinatorTestV25SubscriptionCanceledIterator) Error() error { + return it.fail +} + +func (it *VRFCoordinatorTestV25SubscriptionCanceledIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type VRFCoordinatorTestV25SubscriptionCanceled struct { + SubId *big.Int + To common.Address + AmountLink *big.Int + AmountNative *big.Int + Raw types.Log +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Filterer) FilterSubscriptionCanceled(opts *bind.FilterOpts, subId []*big.Int) (*VRFCoordinatorTestV25SubscriptionCanceledIterator, error) { + + var subIdRule []interface{} + for _, subIdItem := range subId { + subIdRule = append(subIdRule, subIdItem) + } + + logs, sub, err := _VRFCoordinatorTestV25.contract.FilterLogs(opts, "SubscriptionCanceled", subIdRule) + if err != nil { + return nil, err + } + return &VRFCoordinatorTestV25SubscriptionCanceledIterator{contract: _VRFCoordinatorTestV25.contract, event: "SubscriptionCanceled", logs: logs, sub: sub}, nil +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Filterer) WatchSubscriptionCanceled(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorTestV25SubscriptionCanceled, subId []*big.Int) (event.Subscription, error) { + + var subIdRule []interface{} + for _, subIdItem := range subId { + subIdRule = append(subIdRule, subIdItem) + } + + logs, sub, err := _VRFCoordinatorTestV25.contract.WatchLogs(opts, "SubscriptionCanceled", subIdRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(VRFCoordinatorTestV25SubscriptionCanceled) + if err := _VRFCoordinatorTestV25.contract.UnpackLog(event, "SubscriptionCanceled", 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 +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Filterer) ParseSubscriptionCanceled(log types.Log) (*VRFCoordinatorTestV25SubscriptionCanceled, error) { + event := new(VRFCoordinatorTestV25SubscriptionCanceled) + if err := _VRFCoordinatorTestV25.contract.UnpackLog(event, "SubscriptionCanceled", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type VRFCoordinatorTestV25SubscriptionConsumerAddedIterator struct { + Event *VRFCoordinatorTestV25SubscriptionConsumerAdded + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *VRFCoordinatorTestV25SubscriptionConsumerAddedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(VRFCoordinatorTestV25SubscriptionConsumerAdded) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(VRFCoordinatorTestV25SubscriptionConsumerAdded) + 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() + } +} + +func (it *VRFCoordinatorTestV25SubscriptionConsumerAddedIterator) Error() error { + return it.fail +} + +func (it *VRFCoordinatorTestV25SubscriptionConsumerAddedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type VRFCoordinatorTestV25SubscriptionConsumerAdded struct { + SubId *big.Int + Consumer common.Address + Raw types.Log +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Filterer) FilterSubscriptionConsumerAdded(opts *bind.FilterOpts, subId []*big.Int) (*VRFCoordinatorTestV25SubscriptionConsumerAddedIterator, error) { + + var subIdRule []interface{} + for _, subIdItem := range subId { + subIdRule = append(subIdRule, subIdItem) + } + + logs, sub, err := _VRFCoordinatorTestV25.contract.FilterLogs(opts, "SubscriptionConsumerAdded", subIdRule) + if err != nil { + return nil, err + } + return &VRFCoordinatorTestV25SubscriptionConsumerAddedIterator{contract: _VRFCoordinatorTestV25.contract, event: "SubscriptionConsumerAdded", logs: logs, sub: sub}, nil +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Filterer) WatchSubscriptionConsumerAdded(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorTestV25SubscriptionConsumerAdded, subId []*big.Int) (event.Subscription, error) { + + var subIdRule []interface{} + for _, subIdItem := range subId { + subIdRule = append(subIdRule, subIdItem) + } + + logs, sub, err := _VRFCoordinatorTestV25.contract.WatchLogs(opts, "SubscriptionConsumerAdded", subIdRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(VRFCoordinatorTestV25SubscriptionConsumerAdded) + if err := _VRFCoordinatorTestV25.contract.UnpackLog(event, "SubscriptionConsumerAdded", 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 +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Filterer) ParseSubscriptionConsumerAdded(log types.Log) (*VRFCoordinatorTestV25SubscriptionConsumerAdded, error) { + event := new(VRFCoordinatorTestV25SubscriptionConsumerAdded) + if err := _VRFCoordinatorTestV25.contract.UnpackLog(event, "SubscriptionConsumerAdded", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type VRFCoordinatorTestV25SubscriptionConsumerRemovedIterator struct { + Event *VRFCoordinatorTestV25SubscriptionConsumerRemoved + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *VRFCoordinatorTestV25SubscriptionConsumerRemovedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(VRFCoordinatorTestV25SubscriptionConsumerRemoved) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(VRFCoordinatorTestV25SubscriptionConsumerRemoved) + 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() + } +} + +func (it *VRFCoordinatorTestV25SubscriptionConsumerRemovedIterator) Error() error { + return it.fail +} + +func (it *VRFCoordinatorTestV25SubscriptionConsumerRemovedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type VRFCoordinatorTestV25SubscriptionConsumerRemoved struct { + SubId *big.Int + Consumer common.Address + Raw types.Log +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Filterer) FilterSubscriptionConsumerRemoved(opts *bind.FilterOpts, subId []*big.Int) (*VRFCoordinatorTestV25SubscriptionConsumerRemovedIterator, error) { + + var subIdRule []interface{} + for _, subIdItem := range subId { + subIdRule = append(subIdRule, subIdItem) + } + + logs, sub, err := _VRFCoordinatorTestV25.contract.FilterLogs(opts, "SubscriptionConsumerRemoved", subIdRule) + if err != nil { + return nil, err + } + return &VRFCoordinatorTestV25SubscriptionConsumerRemovedIterator{contract: _VRFCoordinatorTestV25.contract, event: "SubscriptionConsumerRemoved", logs: logs, sub: sub}, nil +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Filterer) WatchSubscriptionConsumerRemoved(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorTestV25SubscriptionConsumerRemoved, subId []*big.Int) (event.Subscription, error) { + + var subIdRule []interface{} + for _, subIdItem := range subId { + subIdRule = append(subIdRule, subIdItem) + } + + logs, sub, err := _VRFCoordinatorTestV25.contract.WatchLogs(opts, "SubscriptionConsumerRemoved", subIdRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(VRFCoordinatorTestV25SubscriptionConsumerRemoved) + if err := _VRFCoordinatorTestV25.contract.UnpackLog(event, "SubscriptionConsumerRemoved", 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 +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Filterer) ParseSubscriptionConsumerRemoved(log types.Log) (*VRFCoordinatorTestV25SubscriptionConsumerRemoved, error) { + event := new(VRFCoordinatorTestV25SubscriptionConsumerRemoved) + if err := _VRFCoordinatorTestV25.contract.UnpackLog(event, "SubscriptionConsumerRemoved", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type VRFCoordinatorTestV25SubscriptionCreatedIterator struct { + Event *VRFCoordinatorTestV25SubscriptionCreated + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *VRFCoordinatorTestV25SubscriptionCreatedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(VRFCoordinatorTestV25SubscriptionCreated) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(VRFCoordinatorTestV25SubscriptionCreated) + 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() + } +} + +func (it *VRFCoordinatorTestV25SubscriptionCreatedIterator) Error() error { + return it.fail +} + +func (it *VRFCoordinatorTestV25SubscriptionCreatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type VRFCoordinatorTestV25SubscriptionCreated struct { + SubId *big.Int + Owner common.Address + Raw types.Log +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Filterer) FilterSubscriptionCreated(opts *bind.FilterOpts, subId []*big.Int) (*VRFCoordinatorTestV25SubscriptionCreatedIterator, error) { + + var subIdRule []interface{} + for _, subIdItem := range subId { + subIdRule = append(subIdRule, subIdItem) + } + + logs, sub, err := _VRFCoordinatorTestV25.contract.FilterLogs(opts, "SubscriptionCreated", subIdRule) + if err != nil { + return nil, err + } + return &VRFCoordinatorTestV25SubscriptionCreatedIterator{contract: _VRFCoordinatorTestV25.contract, event: "SubscriptionCreated", logs: logs, sub: sub}, nil +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Filterer) WatchSubscriptionCreated(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorTestV25SubscriptionCreated, subId []*big.Int) (event.Subscription, error) { + + var subIdRule []interface{} + for _, subIdItem := range subId { + subIdRule = append(subIdRule, subIdItem) + } + + logs, sub, err := _VRFCoordinatorTestV25.contract.WatchLogs(opts, "SubscriptionCreated", subIdRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(VRFCoordinatorTestV25SubscriptionCreated) + if err := _VRFCoordinatorTestV25.contract.UnpackLog(event, "SubscriptionCreated", 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 +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Filterer) ParseSubscriptionCreated(log types.Log) (*VRFCoordinatorTestV25SubscriptionCreated, error) { + event := new(VRFCoordinatorTestV25SubscriptionCreated) + if err := _VRFCoordinatorTestV25.contract.UnpackLog(event, "SubscriptionCreated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type VRFCoordinatorTestV25SubscriptionFundedIterator struct { + Event *VRFCoordinatorTestV25SubscriptionFunded + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *VRFCoordinatorTestV25SubscriptionFundedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(VRFCoordinatorTestV25SubscriptionFunded) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(VRFCoordinatorTestV25SubscriptionFunded) + 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() + } +} + +func (it *VRFCoordinatorTestV25SubscriptionFundedIterator) Error() error { + return it.fail +} + +func (it *VRFCoordinatorTestV25SubscriptionFundedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type VRFCoordinatorTestV25SubscriptionFunded struct { + SubId *big.Int + OldBalance *big.Int + NewBalance *big.Int + Raw types.Log +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Filterer) FilterSubscriptionFunded(opts *bind.FilterOpts, subId []*big.Int) (*VRFCoordinatorTestV25SubscriptionFundedIterator, error) { + + var subIdRule []interface{} + for _, subIdItem := range subId { + subIdRule = append(subIdRule, subIdItem) + } + + logs, sub, err := _VRFCoordinatorTestV25.contract.FilterLogs(opts, "SubscriptionFunded", subIdRule) + if err != nil { + return nil, err + } + return &VRFCoordinatorTestV25SubscriptionFundedIterator{contract: _VRFCoordinatorTestV25.contract, event: "SubscriptionFunded", logs: logs, sub: sub}, nil +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Filterer) WatchSubscriptionFunded(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorTestV25SubscriptionFunded, subId []*big.Int) (event.Subscription, error) { + + var subIdRule []interface{} + for _, subIdItem := range subId { + subIdRule = append(subIdRule, subIdItem) + } + + logs, sub, err := _VRFCoordinatorTestV25.contract.WatchLogs(opts, "SubscriptionFunded", subIdRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(VRFCoordinatorTestV25SubscriptionFunded) + if err := _VRFCoordinatorTestV25.contract.UnpackLog(event, "SubscriptionFunded", 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 +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Filterer) ParseSubscriptionFunded(log types.Log) (*VRFCoordinatorTestV25SubscriptionFunded, error) { + event := new(VRFCoordinatorTestV25SubscriptionFunded) + if err := _VRFCoordinatorTestV25.contract.UnpackLog(event, "SubscriptionFunded", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type VRFCoordinatorTestV25SubscriptionFundedWithNativeIterator struct { + Event *VRFCoordinatorTestV25SubscriptionFundedWithNative + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *VRFCoordinatorTestV25SubscriptionFundedWithNativeIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(VRFCoordinatorTestV25SubscriptionFundedWithNative) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(VRFCoordinatorTestV25SubscriptionFundedWithNative) + 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() + } +} + +func (it *VRFCoordinatorTestV25SubscriptionFundedWithNativeIterator) Error() error { + return it.fail +} + +func (it *VRFCoordinatorTestV25SubscriptionFundedWithNativeIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type VRFCoordinatorTestV25SubscriptionFundedWithNative struct { + SubId *big.Int + OldNativeBalance *big.Int + NewNativeBalance *big.Int + Raw types.Log +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Filterer) FilterSubscriptionFundedWithNative(opts *bind.FilterOpts, subId []*big.Int) (*VRFCoordinatorTestV25SubscriptionFundedWithNativeIterator, error) { + + var subIdRule []interface{} + for _, subIdItem := range subId { + subIdRule = append(subIdRule, subIdItem) + } + + logs, sub, err := _VRFCoordinatorTestV25.contract.FilterLogs(opts, "SubscriptionFundedWithNative", subIdRule) + if err != nil { + return nil, err + } + return &VRFCoordinatorTestV25SubscriptionFundedWithNativeIterator{contract: _VRFCoordinatorTestV25.contract, event: "SubscriptionFundedWithNative", logs: logs, sub: sub}, nil +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Filterer) WatchSubscriptionFundedWithNative(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorTestV25SubscriptionFundedWithNative, subId []*big.Int) (event.Subscription, error) { + + var subIdRule []interface{} + for _, subIdItem := range subId { + subIdRule = append(subIdRule, subIdItem) + } + + logs, sub, err := _VRFCoordinatorTestV25.contract.WatchLogs(opts, "SubscriptionFundedWithNative", subIdRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(VRFCoordinatorTestV25SubscriptionFundedWithNative) + if err := _VRFCoordinatorTestV25.contract.UnpackLog(event, "SubscriptionFundedWithNative", 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 +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Filterer) ParseSubscriptionFundedWithNative(log types.Log) (*VRFCoordinatorTestV25SubscriptionFundedWithNative, error) { + event := new(VRFCoordinatorTestV25SubscriptionFundedWithNative) + if err := _VRFCoordinatorTestV25.contract.UnpackLog(event, "SubscriptionFundedWithNative", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type VRFCoordinatorTestV25SubscriptionOwnerTransferRequestedIterator struct { + Event *VRFCoordinatorTestV25SubscriptionOwnerTransferRequested + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *VRFCoordinatorTestV25SubscriptionOwnerTransferRequestedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(VRFCoordinatorTestV25SubscriptionOwnerTransferRequested) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(VRFCoordinatorTestV25SubscriptionOwnerTransferRequested) + 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() + } +} + +func (it *VRFCoordinatorTestV25SubscriptionOwnerTransferRequestedIterator) Error() error { + return it.fail +} + +func (it *VRFCoordinatorTestV25SubscriptionOwnerTransferRequestedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type VRFCoordinatorTestV25SubscriptionOwnerTransferRequested struct { + SubId *big.Int + From common.Address + To common.Address + Raw types.Log +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Filterer) FilterSubscriptionOwnerTransferRequested(opts *bind.FilterOpts, subId []*big.Int) (*VRFCoordinatorTestV25SubscriptionOwnerTransferRequestedIterator, error) { + + var subIdRule []interface{} + for _, subIdItem := range subId { + subIdRule = append(subIdRule, subIdItem) + } + + logs, sub, err := _VRFCoordinatorTestV25.contract.FilterLogs(opts, "SubscriptionOwnerTransferRequested", subIdRule) + if err != nil { + return nil, err + } + return &VRFCoordinatorTestV25SubscriptionOwnerTransferRequestedIterator{contract: _VRFCoordinatorTestV25.contract, event: "SubscriptionOwnerTransferRequested", logs: logs, sub: sub}, nil +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Filterer) WatchSubscriptionOwnerTransferRequested(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorTestV25SubscriptionOwnerTransferRequested, subId []*big.Int) (event.Subscription, error) { + + var subIdRule []interface{} + for _, subIdItem := range subId { + subIdRule = append(subIdRule, subIdItem) + } + + logs, sub, err := _VRFCoordinatorTestV25.contract.WatchLogs(opts, "SubscriptionOwnerTransferRequested", subIdRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(VRFCoordinatorTestV25SubscriptionOwnerTransferRequested) + if err := _VRFCoordinatorTestV25.contract.UnpackLog(event, "SubscriptionOwnerTransferRequested", 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 +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Filterer) ParseSubscriptionOwnerTransferRequested(log types.Log) (*VRFCoordinatorTestV25SubscriptionOwnerTransferRequested, error) { + event := new(VRFCoordinatorTestV25SubscriptionOwnerTransferRequested) + if err := _VRFCoordinatorTestV25.contract.UnpackLog(event, "SubscriptionOwnerTransferRequested", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type VRFCoordinatorTestV25SubscriptionOwnerTransferredIterator struct { + Event *VRFCoordinatorTestV25SubscriptionOwnerTransferred + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *VRFCoordinatorTestV25SubscriptionOwnerTransferredIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(VRFCoordinatorTestV25SubscriptionOwnerTransferred) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(VRFCoordinatorTestV25SubscriptionOwnerTransferred) + 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() + } +} + +func (it *VRFCoordinatorTestV25SubscriptionOwnerTransferredIterator) Error() error { + return it.fail +} + +func (it *VRFCoordinatorTestV25SubscriptionOwnerTransferredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type VRFCoordinatorTestV25SubscriptionOwnerTransferred struct { + SubId *big.Int + From common.Address + To common.Address + Raw types.Log +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Filterer) FilterSubscriptionOwnerTransferred(opts *bind.FilterOpts, subId []*big.Int) (*VRFCoordinatorTestV25SubscriptionOwnerTransferredIterator, error) { + + var subIdRule []interface{} + for _, subIdItem := range subId { + subIdRule = append(subIdRule, subIdItem) + } + + logs, sub, err := _VRFCoordinatorTestV25.contract.FilterLogs(opts, "SubscriptionOwnerTransferred", subIdRule) + if err != nil { + return nil, err + } + return &VRFCoordinatorTestV25SubscriptionOwnerTransferredIterator{contract: _VRFCoordinatorTestV25.contract, event: "SubscriptionOwnerTransferred", logs: logs, sub: sub}, nil +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Filterer) WatchSubscriptionOwnerTransferred(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorTestV25SubscriptionOwnerTransferred, subId []*big.Int) (event.Subscription, error) { + + var subIdRule []interface{} + for _, subIdItem := range subId { + subIdRule = append(subIdRule, subIdItem) + } + + logs, sub, err := _VRFCoordinatorTestV25.contract.WatchLogs(opts, "SubscriptionOwnerTransferred", subIdRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(VRFCoordinatorTestV25SubscriptionOwnerTransferred) + if err := _VRFCoordinatorTestV25.contract.UnpackLog(event, "SubscriptionOwnerTransferred", 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 +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25Filterer) ParseSubscriptionOwnerTransferred(log types.Log) (*VRFCoordinatorTestV25SubscriptionOwnerTransferred, error) { + event := new(VRFCoordinatorTestV25SubscriptionOwnerTransferred) + if err := _VRFCoordinatorTestV25.contract.UnpackLog(event, "SubscriptionOwnerTransferred", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type GetSubscription struct { + Balance *big.Int + NativeBalance *big.Int + ReqCount uint64 + SubOwner common.Address + Consumers []common.Address +} +type SConfig struct { + MinimumRequestConfirmations uint16 + MaxGasLimit uint32 + ReentrancyLock bool + StalenessSeconds uint32 + GasAfterPaymentCalculation uint32 + FulfillmentFlatFeeNativePPM uint32 + FulfillmentFlatFeeLinkDiscountPPM uint32 + NativePremiumPercentage uint8 + LinkPremiumPercentage uint8 +} +type SProvingKeys struct { + Exists bool + MaxGas uint64 +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25) ParseLog(log types.Log) (generated.AbigenLog, error) { + switch log.Topics[0] { + case _VRFCoordinatorTestV25.abi.Events["ConfigSet"].ID: + return _VRFCoordinatorTestV25.ParseConfigSet(log) + case _VRFCoordinatorTestV25.abi.Events["CoordinatorDeregistered"].ID: + return _VRFCoordinatorTestV25.ParseCoordinatorDeregistered(log) + case _VRFCoordinatorTestV25.abi.Events["CoordinatorRegistered"].ID: + return _VRFCoordinatorTestV25.ParseCoordinatorRegistered(log) + case _VRFCoordinatorTestV25.abi.Events["FallbackWeiPerUnitLinkUsed"].ID: + return _VRFCoordinatorTestV25.ParseFallbackWeiPerUnitLinkUsed(log) + case _VRFCoordinatorTestV25.abi.Events["FundsRecovered"].ID: + return _VRFCoordinatorTestV25.ParseFundsRecovered(log) + case _VRFCoordinatorTestV25.abi.Events["MigrationCompleted"].ID: + return _VRFCoordinatorTestV25.ParseMigrationCompleted(log) + case _VRFCoordinatorTestV25.abi.Events["NativeFundsRecovered"].ID: + return _VRFCoordinatorTestV25.ParseNativeFundsRecovered(log) + case _VRFCoordinatorTestV25.abi.Events["OwnershipTransferRequested"].ID: + return _VRFCoordinatorTestV25.ParseOwnershipTransferRequested(log) + case _VRFCoordinatorTestV25.abi.Events["OwnershipTransferred"].ID: + return _VRFCoordinatorTestV25.ParseOwnershipTransferred(log) + case _VRFCoordinatorTestV25.abi.Events["ProvingKeyDeregistered"].ID: + return _VRFCoordinatorTestV25.ParseProvingKeyDeregistered(log) + case _VRFCoordinatorTestV25.abi.Events["ProvingKeyRegistered"].ID: + return _VRFCoordinatorTestV25.ParseProvingKeyRegistered(log) + case _VRFCoordinatorTestV25.abi.Events["RandomWordsFulfilled"].ID: + return _VRFCoordinatorTestV25.ParseRandomWordsFulfilled(log) + case _VRFCoordinatorTestV25.abi.Events["RandomWordsRequested"].ID: + return _VRFCoordinatorTestV25.ParseRandomWordsRequested(log) + case _VRFCoordinatorTestV25.abi.Events["SubscriptionCanceled"].ID: + return _VRFCoordinatorTestV25.ParseSubscriptionCanceled(log) + case _VRFCoordinatorTestV25.abi.Events["SubscriptionConsumerAdded"].ID: + return _VRFCoordinatorTestV25.ParseSubscriptionConsumerAdded(log) + case _VRFCoordinatorTestV25.abi.Events["SubscriptionConsumerRemoved"].ID: + return _VRFCoordinatorTestV25.ParseSubscriptionConsumerRemoved(log) + case _VRFCoordinatorTestV25.abi.Events["SubscriptionCreated"].ID: + return _VRFCoordinatorTestV25.ParseSubscriptionCreated(log) + case _VRFCoordinatorTestV25.abi.Events["SubscriptionFunded"].ID: + return _VRFCoordinatorTestV25.ParseSubscriptionFunded(log) + case _VRFCoordinatorTestV25.abi.Events["SubscriptionFundedWithNative"].ID: + return _VRFCoordinatorTestV25.ParseSubscriptionFundedWithNative(log) + case _VRFCoordinatorTestV25.abi.Events["SubscriptionOwnerTransferRequested"].ID: + return _VRFCoordinatorTestV25.ParseSubscriptionOwnerTransferRequested(log) + case _VRFCoordinatorTestV25.abi.Events["SubscriptionOwnerTransferred"].ID: + return _VRFCoordinatorTestV25.ParseSubscriptionOwnerTransferred(log) + + default: + return nil, fmt.Errorf("abigen wrapper received unknown log topic: %v", log.Topics[0]) + } +} + +func (VRFCoordinatorTestV25ConfigSet) Topic() common.Hash { + return common.HexToHash("0x2c6b6b12413678366b05b145c5f00745bdd00e739131ab5de82484a50c9d78b6") +} + +func (VRFCoordinatorTestV25CoordinatorDeregistered) Topic() common.Hash { + return common.HexToHash("0xf80a1a97fd42251f3c33cda98635e7399253033a6774fe37cd3f650b5282af37") +} + +func (VRFCoordinatorTestV25CoordinatorRegistered) Topic() common.Hash { + return common.HexToHash("0xb7cabbfc11e66731fc77de0444614282023bcbd41d16781c753a431d0af01625") +} + +func (VRFCoordinatorTestV25FallbackWeiPerUnitLinkUsed) Topic() common.Hash { + return common.HexToHash("0x6ca648a381f22ead7e37773d934e64885dcf861fbfbb26c40354cbf0c4662d1a") +} + +func (VRFCoordinatorTestV25FundsRecovered) Topic() common.Hash { + return common.HexToHash("0x59bfc682b673f8cbf945f1e454df9334834abf7dfe7f92237ca29ecb9b436600") +} + +func (VRFCoordinatorTestV25MigrationCompleted) Topic() common.Hash { + return common.HexToHash("0xd63ca8cb945956747ee69bfdc3ea754c24a4caf7418db70e46052f7850be4187") +} + +func (VRFCoordinatorTestV25NativeFundsRecovered) Topic() common.Hash { + return common.HexToHash("0x4aed7c8eed0496c8c19ea2681fcca25741c1602342e38b045d9f1e8e905d2e9c") +} + +func (VRFCoordinatorTestV25OwnershipTransferRequested) Topic() common.Hash { + return common.HexToHash("0xed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae1278") +} + +func (VRFCoordinatorTestV25OwnershipTransferred) Topic() common.Hash { + return common.HexToHash("0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0") +} + +func (VRFCoordinatorTestV25ProvingKeyDeregistered) Topic() common.Hash { + return common.HexToHash("0x9b6868e0eb737bcd72205360baa6bfd0ba4e4819a33ade2db384e8a8025639a5") +} + +func (VRFCoordinatorTestV25ProvingKeyRegistered) Topic() common.Hash { + return common.HexToHash("0x9b911b2c240bfbef3b6a8f7ed6ee321d1258bb2a3fe6becab52ac1cd3210afd3") +} + +func (VRFCoordinatorTestV25RandomWordsFulfilled) Topic() common.Hash { + return common.HexToHash("0xaeb4b4786571e184246d39587f659abf0e26f41f6a3358692250382c0cdb47b7") +} + +func (VRFCoordinatorTestV25RandomWordsRequested) Topic() common.Hash { + return common.HexToHash("0xeb0e3652e0f44f417695e6e90f2f42c99b65cd7169074c5a654b16b9748c3a4e") +} + +func (VRFCoordinatorTestV25SubscriptionCanceled) Topic() common.Hash { + return common.HexToHash("0x8c74ce8b8cf87f5eb001275c8be27eb34ea2b62bfab6814fcc62192bb63e81c4") +} + +func (VRFCoordinatorTestV25SubscriptionConsumerAdded) Topic() common.Hash { + return common.HexToHash("0x1e980d04aa7648e205713e5e8ea3808672ac163d10936d36f91b2c88ac1575e1") +} + +func (VRFCoordinatorTestV25SubscriptionConsumerRemoved) Topic() common.Hash { + return common.HexToHash("0x32158c6058347c1601b2d12bc696ac6901d8a9a9aa3ba10c27ab0a983e8425a7") +} + +func (VRFCoordinatorTestV25SubscriptionCreated) Topic() common.Hash { + return common.HexToHash("0x1d3015d7ba850fa198dc7b1a3f5d42779313a681035f77c8c03764c61005518d") +} + +func (VRFCoordinatorTestV25SubscriptionFunded) Topic() common.Hash { + return common.HexToHash("0x1ced9348ff549fceab2ac57cd3a9de38edaaab274b725ee82c23e8fc8c4eec7a") +} + +func (VRFCoordinatorTestV25SubscriptionFundedWithNative) Topic() common.Hash { + return common.HexToHash("0x7603b205d03651ee812f803fccde89f1012e545a9c99f0abfea9cedd0fd8e902") +} + +func (VRFCoordinatorTestV25SubscriptionOwnerTransferRequested) Topic() common.Hash { + return common.HexToHash("0x21a4dad170a6bf476c31bbcf4a16628295b0e450672eec25d7c93308e05344a1") +} + +func (VRFCoordinatorTestV25SubscriptionOwnerTransferred) Topic() common.Hash { + return common.HexToHash("0xd4114ab6e9af9f597c52041f32d62dc57c5c4e4c0d4427006069635e216c9386") +} + +func (_VRFCoordinatorTestV25 *VRFCoordinatorTestV25) Address() common.Address { + return _VRFCoordinatorTestV25.address +} + +type VRFCoordinatorTestV25Interface interface { + BLOCKHASHSTORE(opts *bind.CallOpts) (common.Address, error) + + LINK(opts *bind.CallOpts) (common.Address, error) + + LINKNATIVEFEED(opts *bind.CallOpts) (common.Address, error) + + MAXCONSUMERS(opts *bind.CallOpts) (uint16, error) + + MAXNUMWORDS(opts *bind.CallOpts) (uint32, error) + + MAXREQUESTCONFIRMATIONS(opts *bind.CallOpts) (uint16, error) + + GetActiveSubscriptionIds(opts *bind.CallOpts, startIndex *big.Int, maxCount *big.Int) ([]*big.Int, error) + + GetSubscription(opts *bind.CallOpts, subId *big.Int) (GetSubscription, + + error) + + HashOfKey(opts *bind.CallOpts, publicKey [2]*big.Int) ([32]byte, error) + + Owner(opts *bind.CallOpts) (common.Address, error) + + PendingRequestExists(opts *bind.CallOpts, subId *big.Int) (bool, error) + + SConfig(opts *bind.CallOpts) (SConfig, + + error) + + SCurrentSubNonce(opts *bind.CallOpts) (uint64, error) + + SFallbackWeiPerUnitLink(opts *bind.CallOpts) (*big.Int, error) + + SProvingKeyHashes(opts *bind.CallOpts, arg0 *big.Int) ([32]byte, error) + + SProvingKeys(opts *bind.CallOpts, arg0 [32]byte) (SProvingKeys, + + error) + + SRequestCommitments(opts *bind.CallOpts, arg0 *big.Int) ([32]byte, error) + + STotalBalance(opts *bind.CallOpts) (*big.Int, error) + + STotalNativeBalance(opts *bind.CallOpts) (*big.Int, error) + + AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) + + AcceptSubscriptionOwnerTransfer(opts *bind.TransactOpts, subId *big.Int) (*types.Transaction, error) + + AddConsumer(opts *bind.TransactOpts, subId *big.Int, consumer common.Address) (*types.Transaction, error) + + CancelSubscription(opts *bind.TransactOpts, subId *big.Int, to common.Address) (*types.Transaction, error) + + CreateSubscription(opts *bind.TransactOpts) (*types.Transaction, error) + + DeregisterMigratableCoordinator(opts *bind.TransactOpts, target common.Address) (*types.Transaction, error) + + DeregisterProvingKey(opts *bind.TransactOpts, publicProvingKey [2]*big.Int) (*types.Transaction, error) + + FulfillRandomWords(opts *bind.TransactOpts, proof VRFOldProof, rc VRFTypesRequestCommitmentV2Plus, onlyPremium bool) (*types.Transaction, error) + + FundSubscriptionWithNative(opts *bind.TransactOpts, subId *big.Int) (*types.Transaction, error) + + Migrate(opts *bind.TransactOpts, subId *big.Int, newCoordinator common.Address) (*types.Transaction, error) + + OnTokenTransfer(opts *bind.TransactOpts, arg0 common.Address, amount *big.Int, data []byte) (*types.Transaction, error) + + OwnerCancelSubscription(opts *bind.TransactOpts, subId *big.Int) (*types.Transaction, error) + + RecoverFunds(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) + + RecoverNativeFunds(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) + + RegisterMigratableCoordinator(opts *bind.TransactOpts, target common.Address) (*types.Transaction, error) + + RegisterProvingKey(opts *bind.TransactOpts, publicProvingKey [2]*big.Int, maxGas uint64) (*types.Transaction, error) + + RemoveConsumer(opts *bind.TransactOpts, subId *big.Int, consumer common.Address) (*types.Transaction, error) + + RequestRandomWords(opts *bind.TransactOpts, req VRFV2PlusClientRandomWordsRequest) (*types.Transaction, error) + + RequestSubscriptionOwnerTransfer(opts *bind.TransactOpts, subId *big.Int, newOwner common.Address) (*types.Transaction, error) + + SetConfig(opts *bind.TransactOpts, minimumRequestConfirmations uint16, maxGasLimit uint32, stalenessSeconds uint32, gasAfterPaymentCalculation uint32, fallbackWeiPerUnitLink *big.Int, fulfillmentFlatFeeNativePPM uint32, fulfillmentFlatFeeLinkDiscountPPM uint32, nativePremiumPercentage uint8, linkPremiumPercentage uint8) (*types.Transaction, error) + + SetLINKAndLINKNativeFeed(opts *bind.TransactOpts, link common.Address, linkNativeFeed common.Address) (*types.Transaction, error) + + TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) + + Withdraw(opts *bind.TransactOpts, recipient common.Address) (*types.Transaction, error) + + WithdrawNative(opts *bind.TransactOpts, recipient common.Address) (*types.Transaction, error) + + FilterConfigSet(opts *bind.FilterOpts) (*VRFCoordinatorTestV25ConfigSetIterator, error) + + WatchConfigSet(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorTestV25ConfigSet) (event.Subscription, error) + + ParseConfigSet(log types.Log) (*VRFCoordinatorTestV25ConfigSet, error) + + FilterCoordinatorDeregistered(opts *bind.FilterOpts) (*VRFCoordinatorTestV25CoordinatorDeregisteredIterator, error) + + WatchCoordinatorDeregistered(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorTestV25CoordinatorDeregistered) (event.Subscription, error) + + ParseCoordinatorDeregistered(log types.Log) (*VRFCoordinatorTestV25CoordinatorDeregistered, error) + + FilterCoordinatorRegistered(opts *bind.FilterOpts) (*VRFCoordinatorTestV25CoordinatorRegisteredIterator, error) + + WatchCoordinatorRegistered(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorTestV25CoordinatorRegistered) (event.Subscription, error) + + ParseCoordinatorRegistered(log types.Log) (*VRFCoordinatorTestV25CoordinatorRegistered, error) + + FilterFallbackWeiPerUnitLinkUsed(opts *bind.FilterOpts) (*VRFCoordinatorTestV25FallbackWeiPerUnitLinkUsedIterator, error) + + WatchFallbackWeiPerUnitLinkUsed(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorTestV25FallbackWeiPerUnitLinkUsed) (event.Subscription, error) + + ParseFallbackWeiPerUnitLinkUsed(log types.Log) (*VRFCoordinatorTestV25FallbackWeiPerUnitLinkUsed, error) + + FilterFundsRecovered(opts *bind.FilterOpts) (*VRFCoordinatorTestV25FundsRecoveredIterator, error) + + WatchFundsRecovered(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorTestV25FundsRecovered) (event.Subscription, error) + + ParseFundsRecovered(log types.Log) (*VRFCoordinatorTestV25FundsRecovered, error) + + FilterMigrationCompleted(opts *bind.FilterOpts) (*VRFCoordinatorTestV25MigrationCompletedIterator, error) + + WatchMigrationCompleted(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorTestV25MigrationCompleted) (event.Subscription, error) + + ParseMigrationCompleted(log types.Log) (*VRFCoordinatorTestV25MigrationCompleted, error) + + FilterNativeFundsRecovered(opts *bind.FilterOpts) (*VRFCoordinatorTestV25NativeFundsRecoveredIterator, error) + + WatchNativeFundsRecovered(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorTestV25NativeFundsRecovered) (event.Subscription, error) + + ParseNativeFundsRecovered(log types.Log) (*VRFCoordinatorTestV25NativeFundsRecovered, error) + + FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*VRFCoordinatorTestV25OwnershipTransferRequestedIterator, error) + + WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorTestV25OwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferRequested(log types.Log) (*VRFCoordinatorTestV25OwnershipTransferRequested, error) + + FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*VRFCoordinatorTestV25OwnershipTransferredIterator, error) + + WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorTestV25OwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferred(log types.Log) (*VRFCoordinatorTestV25OwnershipTransferred, error) + + FilterProvingKeyDeregistered(opts *bind.FilterOpts) (*VRFCoordinatorTestV25ProvingKeyDeregisteredIterator, error) + + WatchProvingKeyDeregistered(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorTestV25ProvingKeyDeregistered) (event.Subscription, error) + + ParseProvingKeyDeregistered(log types.Log) (*VRFCoordinatorTestV25ProvingKeyDeregistered, error) + + FilterProvingKeyRegistered(opts *bind.FilterOpts) (*VRFCoordinatorTestV25ProvingKeyRegisteredIterator, error) + + WatchProvingKeyRegistered(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorTestV25ProvingKeyRegistered) (event.Subscription, error) + + ParseProvingKeyRegistered(log types.Log) (*VRFCoordinatorTestV25ProvingKeyRegistered, error) + + FilterRandomWordsFulfilled(opts *bind.FilterOpts, requestId []*big.Int, subId []*big.Int) (*VRFCoordinatorTestV25RandomWordsFulfilledIterator, error) + + WatchRandomWordsFulfilled(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorTestV25RandomWordsFulfilled, requestId []*big.Int, subId []*big.Int) (event.Subscription, error) + + ParseRandomWordsFulfilled(log types.Log) (*VRFCoordinatorTestV25RandomWordsFulfilled, error) + + FilterRandomWordsRequested(opts *bind.FilterOpts, keyHash [][32]byte, subId []*big.Int, sender []common.Address) (*VRFCoordinatorTestV25RandomWordsRequestedIterator, error) + + WatchRandomWordsRequested(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorTestV25RandomWordsRequested, keyHash [][32]byte, subId []*big.Int, sender []common.Address) (event.Subscription, error) + + ParseRandomWordsRequested(log types.Log) (*VRFCoordinatorTestV25RandomWordsRequested, error) + + FilterSubscriptionCanceled(opts *bind.FilterOpts, subId []*big.Int) (*VRFCoordinatorTestV25SubscriptionCanceledIterator, error) + + WatchSubscriptionCanceled(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorTestV25SubscriptionCanceled, subId []*big.Int) (event.Subscription, error) + + ParseSubscriptionCanceled(log types.Log) (*VRFCoordinatorTestV25SubscriptionCanceled, error) + + FilterSubscriptionConsumerAdded(opts *bind.FilterOpts, subId []*big.Int) (*VRFCoordinatorTestV25SubscriptionConsumerAddedIterator, error) + + WatchSubscriptionConsumerAdded(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorTestV25SubscriptionConsumerAdded, subId []*big.Int) (event.Subscription, error) + + ParseSubscriptionConsumerAdded(log types.Log) (*VRFCoordinatorTestV25SubscriptionConsumerAdded, error) + + FilterSubscriptionConsumerRemoved(opts *bind.FilterOpts, subId []*big.Int) (*VRFCoordinatorTestV25SubscriptionConsumerRemovedIterator, error) + + WatchSubscriptionConsumerRemoved(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorTestV25SubscriptionConsumerRemoved, subId []*big.Int) (event.Subscription, error) + + ParseSubscriptionConsumerRemoved(log types.Log) (*VRFCoordinatorTestV25SubscriptionConsumerRemoved, error) + + FilterSubscriptionCreated(opts *bind.FilterOpts, subId []*big.Int) (*VRFCoordinatorTestV25SubscriptionCreatedIterator, error) + + WatchSubscriptionCreated(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorTestV25SubscriptionCreated, subId []*big.Int) (event.Subscription, error) + + ParseSubscriptionCreated(log types.Log) (*VRFCoordinatorTestV25SubscriptionCreated, error) + + FilterSubscriptionFunded(opts *bind.FilterOpts, subId []*big.Int) (*VRFCoordinatorTestV25SubscriptionFundedIterator, error) + + WatchSubscriptionFunded(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorTestV25SubscriptionFunded, subId []*big.Int) (event.Subscription, error) + + ParseSubscriptionFunded(log types.Log) (*VRFCoordinatorTestV25SubscriptionFunded, error) + + FilterSubscriptionFundedWithNative(opts *bind.FilterOpts, subId []*big.Int) (*VRFCoordinatorTestV25SubscriptionFundedWithNativeIterator, error) + + WatchSubscriptionFundedWithNative(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorTestV25SubscriptionFundedWithNative, subId []*big.Int) (event.Subscription, error) + + ParseSubscriptionFundedWithNative(log types.Log) (*VRFCoordinatorTestV25SubscriptionFundedWithNative, error) + + FilterSubscriptionOwnerTransferRequested(opts *bind.FilterOpts, subId []*big.Int) (*VRFCoordinatorTestV25SubscriptionOwnerTransferRequestedIterator, error) + + WatchSubscriptionOwnerTransferRequested(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorTestV25SubscriptionOwnerTransferRequested, subId []*big.Int) (event.Subscription, error) + + ParseSubscriptionOwnerTransferRequested(log types.Log) (*VRFCoordinatorTestV25SubscriptionOwnerTransferRequested, error) + + FilterSubscriptionOwnerTransferred(opts *bind.FilterOpts, subId []*big.Int) (*VRFCoordinatorTestV25SubscriptionOwnerTransferredIterator, error) + + WatchSubscriptionOwnerTransferred(opts *bind.WatchOpts, sink chan<- *VRFCoordinatorTestV25SubscriptionOwnerTransferred, subId []*big.Int) (event.Subscription, error) + + ParseSubscriptionOwnerTransferred(log types.Log) (*VRFCoordinatorTestV25SubscriptionOwnerTransferred, error) + + ParseLog(log types.Log) (generated.AbigenLog, error) + + Address() common.Address +} diff --git a/core/gethwrappers/generated/weth9_wrapper/weth9_wrapper.go b/core/gethwrappers/generated/weth9_wrapper/weth9_wrapper.go index f38435143b9..87849c786f4 100644 --- a/core/gethwrappers/generated/weth9_wrapper/weth9_wrapper.go +++ b/core/gethwrappers/generated/weth9_wrapper/weth9_wrapper.go @@ -32,7 +32,7 @@ var ( var WETH9MetaData = &bind.MetaData{ ABI: "[{\"inputs\":[],\"name\":\"InsufficientBalance\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"src\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"guy\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"wad\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"dst\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"wad\",\"type\":\"uint256\"}],\"name\":\"Deposit\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"src\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"dst\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"wad\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"src\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"wad\",\"type\":\"uint256\"}],\"name\":\"Withdrawal\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"guy\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"wad\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"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\":\"deposit\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"mint\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"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\":\"dst\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"wad\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"src\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"dst\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"wad\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"wad\",\"type\":\"uint256\"}],\"name\":\"withdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]", - Bin: "0x60c0604052600d60809081526c2bb930b83832b21022ba3432b960991b60a05260009061002c9082610114565b506040805180820190915260048152630ae8aa8960e31b60208201526001906100559082610114565b506002805460ff1916601217905534801561006f57600080fd5b506101d3565b634e487b7160e01b600052604160045260246000fd5b600181811c9082168061009f57607f821691505b6020821081036100bf57634e487b7160e01b600052602260045260246000fd5b50919050565b601f82111561010f57600081815260208120601f850160051c810160208610156100ec5750805b601f850160051c820191505b8181101561010b578281556001016100f8565b5050505b505050565b81516001600160401b0381111561012d5761012d610075565b6101418161013b845461008b565b846100c5565b602080601f831160018114610176576000841561015e5750858301515b600019600386901b1c1916600185901b17855561010b565b600085815260208120601f198616915b828110156101a557888601518255948401946001909101908401610186565b50858210156101c35787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b61099c80620001e36000396000f3fe6080604052600436106100cb5760003560e01c806340c10f1911610074578063a9059cbb1161004e578063a9059cbb14610225578063d0e30db014610245578063dd62ed3e1461024d57600080fd5b806340c10f19146101c357806370a08231146101e357806395d89b411461021057600080fd5b806323b872dd116100a557806323b872dd146101575780632e1a7d4d14610177578063313ce5671461019757600080fd5b806306fdde03146100df578063095ea7b31461010a57806318160ddd1461013a57600080fd5b366100da576100d8610285565b005b600080fd5b3480156100eb57600080fd5b506100f46102e0565b6040516101019190610785565b60405180910390f35b34801561011657600080fd5b5061012a61012536600461081a565b61036e565b6040519015158152602001610101565b34801561014657600080fd5b50475b604051908152602001610101565b34801561016357600080fd5b5061012a610172366004610844565b6103e8565b34801561018357600080fd5b506100d8610192366004610880565b610649565b3480156101a357600080fd5b506002546101b19060ff1681565b60405160ff9091168152602001610101565b3480156101cf57600080fd5b506100d86101de36600461081a565b61071c565b3480156101ef57600080fd5b506101496101fe366004610899565b60036020526000908152604090205481565b34801561021c57600080fd5b506100f461075a565b34801561023157600080fd5b5061012a61024036600461081a565b610767565b6100d861077b565b34801561025957600080fd5b506101496102683660046108b4565b600460209081526000928352604080842090915290825290205481565b33600090815260036020526040812080543492906102a4908490610916565b909155505060405134815233907fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9060200160405180910390a2565b600080546102ed90610929565b80601f016020809104026020016040519081016040528092919081815260200182805461031990610929565b80156103665780601f1061033b57610100808354040283529160200191610366565b820191906000526020600020905b81548152906001019060200180831161034957829003601f168201915b505050505081565b33600081815260046020908152604080832073ffffffffffffffffffffffffffffffffffffffff8716808552925280832085905551919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906103d69086815260200190565b60405180910390a35060015b92915050565b73ffffffffffffffffffffffffffffffffffffffff8316600090815260036020526040812054821115610447576040517ff4d678b800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff841633148015906104ad575073ffffffffffffffffffffffffffffffffffffffff841660009081526004602090815260408083203384529091529020546fffffffffffffffffffffffffffffffff14155b156105625773ffffffffffffffffffffffffffffffffffffffff8416600090815260046020908152604080832033845290915290205482111561051c576040517ff4d678b800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff841660009081526004602090815260408083203384529091528120805484929061055c90849061097c565b90915550505b73ffffffffffffffffffffffffffffffffffffffff84166000908152600360205260408120805484929061059790849061097c565b909155505073ffffffffffffffffffffffffffffffffffffffff8316600090815260036020526040812080548492906105d1908490610916565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161063791815260200190565b60405180910390a35060019392505050565b33600090815260036020526040902054811115610692576040517ff4d678b800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b33600090815260036020526040812080548392906106b190849061097c565b9091555050604051339082156108fc029083906000818181858888f193505050501580156106e3573d6000803e3d6000fd5b5060405181815233907f7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b659060200160405180910390a250565b73ffffffffffffffffffffffffffffffffffffffff821660009081526003602052604081208054839290610751908490610916565b90915550505050565b600180546102ed90610929565b60006107743384846103e8565b9392505050565b610783610285565b565b600060208083528351808285015260005b818110156107b257858101830151858201604001528201610796565b5060006040828601015260407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8301168501019250505092915050565b803573ffffffffffffffffffffffffffffffffffffffff8116811461081557600080fd5b919050565b6000806040838503121561082d57600080fd5b610836836107f1565b946020939093013593505050565b60008060006060848603121561085957600080fd5b610862846107f1565b9250610870602085016107f1565b9150604084013590509250925092565b60006020828403121561089257600080fd5b5035919050565b6000602082840312156108ab57600080fd5b610774826107f1565b600080604083850312156108c757600080fd5b6108d0836107f1565b91506108de602084016107f1565b90509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b808201808211156103e2576103e26108e7565b600181811c9082168061093d57607f821691505b602082108103610976577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b818103818111156103e2576103e26108e756fea164736f6c6343000813000a", + Bin: "0x60c0604052600d60809081526c2bb930b83832b21022ba3432b960991b60a05260009061002c9082610114565b506040805180820190915260048152630ae8aa8960e31b60208201526001906100559082610114565b506002805460ff1916601217905534801561006f57600080fd5b506101d3565b634e487b7160e01b600052604160045260246000fd5b600181811c9082168061009f57607f821691505b6020821081036100bf57634e487b7160e01b600052602260045260246000fd5b50919050565b601f82111561010f57600081815260208120601f850160051c810160208610156100ec5750805b601f850160051c820191505b8181101561010b578281556001016100f8565b5050505b505050565b81516001600160401b0381111561012d5761012d610075565b6101418161013b845461008b565b846100c5565b602080601f831160018114610176576000841561015e5750858301515b600019600386901b1c1916600185901b17855561010b565b600085815260208120601f198616915b828110156101a557888601518255948401946001909101908401610186565b50858210156101c35787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6109b680620001e36000396000f3fe6080604052600436106100cb5760003560e01c806340c10f1911610074578063a9059cbb1161004e578063a9059cbb14610225578063d0e30db014610245578063dd62ed3e1461024d57600080fd5b806340c10f19146101c357806370a08231146101e357806395d89b411461021057600080fd5b806323b872dd116100a557806323b872dd146101575780632e1a7d4d14610177578063313ce5671461019757600080fd5b806306fdde03146100df578063095ea7b31461010a57806318160ddd1461013a57600080fd5b366100da576100d8610285565b005b600080fd5b3480156100eb57600080fd5b506100f46102e0565b604051610101919061079f565b60405180910390f35b34801561011657600080fd5b5061012a610125366004610834565b61036e565b6040519015158152602001610101565b34801561014657600080fd5b50475b604051908152602001610101565b34801561016357600080fd5b5061012a61017236600461085e565b6103e8565b34801561018357600080fd5b506100d861019236600461089a565b610649565b3480156101a357600080fd5b506002546101b19060ff1681565b60405160ff9091168152602001610101565b3480156101cf57600080fd5b506100d86101de366004610834565b610736565b3480156101ef57600080fd5b506101496101fe3660046108b3565b60036020526000908152604090205481565b34801561021c57600080fd5b506100f4610774565b34801561023157600080fd5b5061012a610240366004610834565b610781565b6100d8610795565b34801561025957600080fd5b506101496102683660046108ce565b600460209081526000928352604080842090915290825290205481565b33600090815260036020526040812080543492906102a4908490610930565b909155505060405134815233907fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9060200160405180910390a2565b600080546102ed90610943565b80601f016020809104026020016040519081016040528092919081815260200182805461031990610943565b80156103665780601f1061033b57610100808354040283529160200191610366565b820191906000526020600020905b81548152906001019060200180831161034957829003601f168201915b505050505081565b33600081815260046020908152604080832073ffffffffffffffffffffffffffffffffffffffff8716808552925280832085905551919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906103d69086815260200190565b60405180910390a35060015b92915050565b73ffffffffffffffffffffffffffffffffffffffff8316600090815260036020526040812054821115610447576040517ff4d678b800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff841633148015906104ad575073ffffffffffffffffffffffffffffffffffffffff841660009081526004602090815260408083203384529091529020546fffffffffffffffffffffffffffffffff14155b156105625773ffffffffffffffffffffffffffffffffffffffff8416600090815260046020908152604080832033845290915290205482111561051c576040517ff4d678b800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff841660009081526004602090815260408083203384529091528120805484929061055c908490610996565b90915550505b73ffffffffffffffffffffffffffffffffffffffff841660009081526003602052604081208054849290610597908490610996565b909155505073ffffffffffffffffffffffffffffffffffffffff8316600090815260036020526040812080548492906105d1908490610930565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161063791815260200190565b60405180910390a35060019392505050565b33600090815260036020526040902054811115610692576040517ff4d678b800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b33600090815260036020526040812080548392906106b1908490610996565b909155505060405133908290600081818185875af1925050503d80600081146106f6576040519150601f19603f3d011682016040523d82523d6000602084013e6106fb565b606091505b50506040518281523391507f7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b659060200160405180910390a250565b73ffffffffffffffffffffffffffffffffffffffff82166000908152600360205260408120805483929061076b908490610930565b90915550505050565b600180546102ed90610943565b600061078e3384846103e8565b9392505050565b61079d610285565b565b600060208083528351808285015260005b818110156107cc578581018301518582016040015282016107b0565b5060006040828601015260407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8301168501019250505092915050565b803573ffffffffffffffffffffffffffffffffffffffff8116811461082f57600080fd5b919050565b6000806040838503121561084757600080fd5b6108508361080b565b946020939093013593505050565b60008060006060848603121561087357600080fd5b61087c8461080b565b925061088a6020850161080b565b9150604084013590509250925092565b6000602082840312156108ac57600080fd5b5035919050565b6000602082840312156108c557600080fd5b61078e8261080b565b600080604083850312156108e157600080fd5b6108ea8361080b565b91506108f86020840161080b565b90509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b808201808211156103e2576103e2610901565b600181811c9082168061095757607f821691505b602082108103610990577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b818103818111156103e2576103e261090156fea164736f6c6343000813000a", } var WETH9ABI = WETH9MetaData.ABI diff --git a/core/gethwrappers/generation/generated-wrapper-dependency-versions-do-not-edit.txt b/core/gethwrappers/generation/generated-wrapper-dependency-versions-do-not-edit.txt index c12433ee662..b1b5a56186a 100644 --- a/core/gethwrappers/generation/generated-wrapper-dependency-versions-do-not-edit.txt +++ b/core/gethwrappers/generation/generated-wrapper-dependency-versions-do-not-edit.txt @@ -1,7 +1,7 @@ GETH_VERSION: 1.13.8 aggregator_v2v3_interface: ../../contracts/solc/v0.8.6/AggregatorV2V3Interface/AggregatorV2V3Interface.abi ../../contracts/solc/v0.8.6/AggregatorV2V3Interface/AggregatorV2V3Interface.bin 95e8814b408bb05bf21742ef580d98698b7db6a9bac6a35c3de12b23aec4ee28 aggregator_v3_interface: ../../contracts/solc/v0.8.6/AggregatorV2V3Interface/AggregatorV3Interface.abi ../../contracts/solc/v0.8.6/AggregatorV2V3Interface/AggregatorV3Interface.bin 351b55d3b0f04af67db6dfb5c92f1c64479400ca1fec77afc20bc0ce65cb49ab -arbitrum_module: ../../contracts/solc/v0.8.19/ArbitrumModule/ArbitrumModule.abi ../../contracts/solc/v0.8.19/ArbitrumModule/ArbitrumModule.bin b76cf77e3e8200c5f292e93af3f620f68f207f83634aacaaee43d682701dfea3 +arbitrum_module: ../../contracts/solc/v0.8.19/ArbitrumModule/ArbitrumModule.abi ../../contracts/solc/v0.8.19/ArbitrumModule/ArbitrumModule.bin 12a7bad1f887d832d101a73ae279a91a90c93fd72befea9983e85eff493f62f4 authorized_forwarder: ../../contracts/solc/v0.8.19/AuthorizedForwarder/AuthorizedForwarder.abi ../../contracts/solc/v0.8.19/AuthorizedForwarder/AuthorizedForwarder.bin 8ea76c883d460f8353a45a493f2aebeb5a2d9a7b4619d1bc4fff5fb590bb3e10 authorized_receiver: ../../contracts/solc/v0.8.19/AuthorizedReceiver/AuthorizedReceiver.abi ../../contracts/solc/v0.8.19/AuthorizedReceiver/AuthorizedReceiver.bin 18e8969ba3234b027e1b16c11a783aca58d0ea5c2361010ec597f134b7bf1c4f automation_compatible_utils: ../../contracts/solc/v0.8.19/AutomationCompatibleUtils/AutomationCompatibleUtils.abi ../../contracts/solc/v0.8.19/AutomationCompatibleUtils/AutomationCompatibleUtils.bin dfe88f4f40d124b8cb5f36a7e9f9328008ca57f7ec5d07a28d949d569d5f2834 @@ -12,10 +12,10 @@ automation_registrar_wrapper2_3: ../../contracts/solc/v0.8.19/AutomationRegistra automation_registry_logic_a_wrapper_2_2: ../../contracts/solc/v0.8.19/AutomationRegistryLogicA2_2/AutomationRegistryLogicA2_2.abi ../../contracts/solc/v0.8.19/AutomationRegistryLogicA2_2/AutomationRegistryLogicA2_2.bin 2f267fb8467a15c587ce4586ac56069f7229344ad3936430d7c7624c0528a171 automation_registry_logic_a_wrapper_2_3: ../../contracts/solc/v0.8.19/AutomationRegistryLogicA2_3/AutomationRegistryLogicA2_3.abi ../../contracts/solc/v0.8.19/AutomationRegistryLogicA2_3/AutomationRegistryLogicA2_3.bin 73b5cc3ece642abbf6f2a4c9188335b71404f4dd0ad10b761390b6397af6f1c8 automation_registry_logic_b_wrapper_2_2: ../../contracts/solc/v0.8.19/AutomationRegistryLogicB2_2/AutomationRegistryLogicB2_2.abi ../../contracts/solc/v0.8.19/AutomationRegistryLogicB2_2/AutomationRegistryLogicB2_2.bin a6d33dfbbfb0ff253eb59a51f4f6d6d4c22ea5ec95aae52d25d49a312b37a22f -automation_registry_logic_b_wrapper_2_3: ../../contracts/solc/v0.8.19/AutomationRegistryLogicB2_3/AutomationRegistryLogicB2_3.abi ../../contracts/solc/v0.8.19/AutomationRegistryLogicB2_3/AutomationRegistryLogicB2_3.bin fbf6f6cf4e6858855ff5da847c3baa4859dd997cfae51f2fa0651e4fa15b92c9 -automation_registry_logic_c_wrapper_2_3: ../../contracts/solc/v0.8.19/AutomationRegistryLogicC2_3/AutomationRegistryLogicC2_3.abi ../../contracts/solc/v0.8.19/AutomationRegistryLogicC2_3/AutomationRegistryLogicC2_3.bin 6bfe0f54fa7a587a83b6981ffdef28b3cb5e24cae1c95becdf59eed21147d289 -automation_registry_wrapper_2_2: ../../contracts/solc/v0.8.19/AutomationRegistry2_2/AutomationRegistry2_2.abi ../../contracts/solc/v0.8.19/AutomationRegistry2_2/AutomationRegistry2_2.bin de60f69878e9b32a291a001c91fc8636544c2cfbd9b507c8c1a4873b602bfb62 -automation_registry_wrapper_2_3: ../../contracts/solc/v0.8.19/AutomationRegistry2_3/AutomationRegistry2_3.abi ../../contracts/solc/v0.8.19/AutomationRegistry2_3/AutomationRegistry2_3.bin f8f920a225fdb1e36948dd95bae3aa46ecc2b01fd113480e111960b5e5f95624 +automation_registry_logic_b_wrapper_2_3: ../../contracts/solc/v0.8.19/AutomationRegistryLogicB2_3/AutomationRegistryLogicB2_3.abi ../../contracts/solc/v0.8.19/AutomationRegistryLogicB2_3/AutomationRegistryLogicB2_3.bin e628b4ba1ca8bf45c2b08c6b80f0b14efbd2dff13b85e5a9ebf643df32335ed2 +automation_registry_logic_c_wrapper_2_3: ../../contracts/solc/v0.8.19/AutomationRegistryLogicC2_3/AutomationRegistryLogicC2_3.abi ../../contracts/solc/v0.8.19/AutomationRegistryLogicC2_3/AutomationRegistryLogicC2_3.bin 19d59318e42f28777756eff60d5c5e52563a2fffb8e3f0f0b07b6d36d82b2c55 +automation_registry_wrapper_2_2: ../../contracts/solc/v0.8.19/AutomationRegistry2_2/AutomationRegistry2_2.abi ../../contracts/solc/v0.8.19/AutomationRegistry2_2/AutomationRegistry2_2.bin 7072ba90159d84572f427ec816e78aa032cf907b39bf228185e0c446842f7c11 +automation_registry_wrapper_2_3: ../../contracts/solc/v0.8.19/AutomationRegistry2_3/AutomationRegistry2_3.abi ../../contracts/solc/v0.8.19/AutomationRegistry2_3/AutomationRegistry2_3.bin b6163402434b84e3b66bc078f6efac121c1e1240dca0e8ea89c43db46b4e308b automation_utils_2_1: ../../contracts/solc/v0.8.16/AutomationUtils2_1/AutomationUtils2_1.abi ../../contracts/solc/v0.8.16/AutomationUtils2_1/AutomationUtils2_1.bin 815b17b63f15d26a0274b962eefad98cdee4ec897ead58688bbb8e2470e585f5 automation_utils_2_2: ../../contracts/solc/v0.8.19/AutomationUtils2_2/AutomationUtils2_2.abi ../../contracts/solc/v0.8.19/AutomationUtils2_2/AutomationUtils2_2.bin 8743f6231aaefa3f2a0b2d484258070d506e2d0860690e66890dccc3949edb2e automation_utils_2_3: ../../contracts/solc/v0.8.19/AutomationUtils2_3/AutomationUtils2_3.abi ../../contracts/solc/v0.8.19/AutomationUtils2_3/AutomationUtils2_3.bin 11e2b481dc9a4d936e3443345d45d2cc571164459d214917b42a8054b295393b @@ -23,8 +23,8 @@ batch_blockhash_store: ../../contracts/solc/v0.8.19/BatchBlockhashStore/BatchBlo batch_vrf_coordinator_v2: ../../contracts/solc/v0.8.6/BatchVRFCoordinatorV2/BatchVRFCoordinatorV2.abi ../../contracts/solc/v0.8.6/BatchVRFCoordinatorV2/BatchVRFCoordinatorV2.bin 4512f4313bc5c078215c9241a69045a2a3cfecd6adfcef2f13037183a2d71483 batch_vrf_coordinator_v2plus: ../../contracts/solc/v0.8.19/BatchVRFCoordinatorV2Plus/BatchVRFCoordinatorV2Plus.abi ../../contracts/solc/v0.8.19/BatchVRFCoordinatorV2Plus/BatchVRFCoordinatorV2Plus.bin f13715b38b5b9084b08bffa571fb1c8ef686001535902e1255052f074b31ad4e blockhash_store: ../../contracts/solc/v0.8.19/BlockhashStore/BlockhashStore.abi ../../contracts/solc/v0.8.19/BlockhashStore/BlockhashStore.bin 31b118f9577240c8834c35f8b5a1440e82a6ca8aea702970de2601824b6ab0e1 -chain_module_base: ../../contracts/solc/v0.8.19/ChainModuleBase/ChainModuleBase.abi ../../contracts/solc/v0.8.19/ChainModuleBase/ChainModuleBase.bin 39dfce79330e921e5c169051b11c6e5ea15cd4db5a7b09c06aabbe9658148915 -chain_reader_tester: ../../contracts/solc/v0.8.19/ChainReaderTester/ChainReaderTester.abi ../../contracts/solc/v0.8.19/ChainReaderTester/ChainReaderTester.bin de88c7e68de36b96aa2bec844bdc96fcd7c9017b38e25062b3b9f9cec42c814f +chain_module_base: ../../contracts/solc/v0.8.19/ChainModuleBase/ChainModuleBase.abi ../../contracts/solc/v0.8.19/ChainModuleBase/ChainModuleBase.bin 7a82cc28014761090185c2650239ad01a0901181f1b2b899b42ca293bcda3741 +chain_reader_tester: ../../contracts/solc/v0.8.19/ChainReaderTester/ChainReaderTester.abi ../../contracts/solc/v0.8.19/ChainReaderTester/ChainReaderTester.bin b9a488fc786f584a617764d8dc1722acdb30defb6b8f638e0ae03442795eaf3e chain_specific_util_helper: ../../contracts/solc/v0.8.6/ChainSpecificUtilHelper/ChainSpecificUtilHelper.abi ../../contracts/solc/v0.8.6/ChainSpecificUtilHelper/ChainSpecificUtilHelper.bin 66eb30b0717fefe05672df5ec863c0b9a5a654623c4757307a2726d8f31e26b1 counter: ../../contracts/solc/v0.8.6/Counter/Counter.abi ../../contracts/solc/v0.8.6/Counter/Counter.bin 6ca06e000e8423573ffa0bdfda749d88236ab3da2a4cbb4a868c706da90488c9 cron_upkeep_factory_wrapper: ../../contracts/solc/v0.8.6/CronUpkeepFactory/CronUpkeepFactory.abi - dacb0f8cdf54ae9d2781c5e720fc314b32ed5e58eddccff512c75d6067292cd7 @@ -35,7 +35,7 @@ gas_wrapper_mock: ../../contracts/solc/v0.8.6/KeeperRegistryCheckUpkeepGasUsageW i_automation_registry_master_wrapper_2_2: ../../contracts/solc/v0.8.19/IAutomationRegistryMaster/IAutomationRegistryMaster.abi ../../contracts/solc/v0.8.19/IAutomationRegistryMaster/IAutomationRegistryMaster.bin 9ff7087179f89f9b05964ebc3e71332fce11f1b8e85058f7b16b3bc0dd6fb96b i_automation_registry_master_wrapper_2_3: ../../contracts/solc/v0.8.19/IAutomationRegistryMaster2_3/IAutomationRegistryMaster2_3.abi ../../contracts/solc/v0.8.19/IAutomationRegistryMaster2_3/IAutomationRegistryMaster2_3.bin 06cc87c122452f63fbe84f65329978f30281613be0caa261e53503d94763e921 i_automation_v21_plus_common: ../../contracts/solc/v0.8.19/IAutomationV21PlusCommon/IAutomationV21PlusCommon.abi ../../contracts/solc/v0.8.19/IAutomationV21PlusCommon/IAutomationV21PlusCommon.bin e8a601ec382c0a2e83c49759de13b0622b5e04e6b95901e96a1e9504329e594c -i_chain_module: ../../contracts/solc/v0.8.19/IChainModule/IChainModule.abi ../../contracts/solc/v0.8.19/IChainModule/IChainModule.bin 383611981c86c70522f41b8750719faacc7d7933a22849d5004799ebef3371fa +i_chain_module: ../../contracts/solc/v0.8.19/IChainModule/IChainModule.abi ../../contracts/solc/v0.8.19/IChainModule/IChainModule.bin 8ccb8fcfd1ae331a46b4469e1567c380e2a6d2bf21a9976d6c4c655a716aaa42 i_keeper_registry_master_wrapper_2_1: ../../contracts/solc/v0.8.16/IKeeperRegistryMaster/IKeeperRegistryMaster.abi ../../contracts/solc/v0.8.16/IKeeperRegistryMaster/IKeeperRegistryMaster.bin ee0f150b3afbab2df3d24ff3f4c87851efa635da30db04cd1f70cb4e185a1781 i_log_automation: ../../contracts/solc/v0.8.16/ILogAutomation/ILogAutomation.abi ../../contracts/solc/v0.8.16/ILogAutomation/ILogAutomation.bin 296beccb6af655d6fc3a6e676b244831cce2da6688d3afc4f21f8738ae59e03e keeper_consumer_performance_wrapper: ../../contracts/solc/v0.8.16/KeeperConsumerPerformance/KeeperConsumerPerformance.abi ../../contracts/solc/v0.8.16/KeeperConsumerPerformance/KeeperConsumerPerformance.bin eeda39f5d3e1c8ffa0fb6cd1803731b98a4bc262d41833458e3fe8b40933ae90 @@ -60,9 +60,9 @@ mock_ethusd_aggregator_wrapper: ../../contracts/solc/v0.8.19/MockETHUSDAggregato offchain_aggregator_wrapper: OffchainAggregator/OffchainAggregator.abi - 5c8d6562e94166d4790f1ee6e4321d359d9f7262e6c5452a712b1f1c896f45cf operator_factory: ../../contracts/solc/v0.8.19/OperatorFactory/OperatorFactory.abi ../../contracts/solc/v0.8.19/OperatorFactory/OperatorFactory.bin 88e6baa5d9b255eea02616fbcb2cbe21a25ab46adeb6395f6289d169dec949ae operator_wrapper: ../../contracts/solc/v0.8.19/Operator/Operator.abi ../../contracts/solc/v0.8.19/Operator/Operator.bin 23c3888eaa7259e6adf2153d09abae8f4b1987dc44200363faab1e65483f32d5 -optimism_module: ../../contracts/solc/v0.8.19/OptimismModule/OptimismModule.abi ../../contracts/solc/v0.8.19/OptimismModule/OptimismModule.bin a1f8ee97e12b1b2311db03b94dc52b91f3c2e9a2f8d554031a9c7b41e4432280 +optimism_module_v2: ../../contracts/solc/v0.8.19/OptimismModuleV2/OptimismModuleV2.abi ../../contracts/solc/v0.8.19/OptimismModuleV2/OptimismModuleV2.bin 6bc8f93d3a49b3fdecc169214565e6fe5690427860ca4f674818c611dd719502 perform_data_checker_wrapper: ../../contracts/solc/v0.8.16/PerformDataChecker/PerformDataChecker.abi ../../contracts/solc/v0.8.16/PerformDataChecker/PerformDataChecker.bin 48d8309c2117c29a24e1155917ab0b780956b2cd6a8a39ef06ae66a7f6d94f73 -scroll_module: ../../contracts/solc/v0.8.19/ScrollModule/ScrollModule.abi ../../contracts/solc/v0.8.19/ScrollModule/ScrollModule.bin 8de157cb7e5bc78146548212803d60926c8483aca7e912d802b7c66dc5d2ab11 +scroll_module: ../../contracts/solc/v0.8.19/ScrollModule/ScrollModule.abi ../../contracts/solc/v0.8.19/ScrollModule/ScrollModule.bin 0b99b89ff0c8d95a2ab273c93355e572b9e052ce2a9507498a06e0915b541a86 simple_log_upkeep_counter_wrapper: ../../contracts/solc/v0.8.6/SimpleLogUpkeepCounter/SimpleLogUpkeepCounter.abi ../../contracts/solc/v0.8.6/SimpleLogUpkeepCounter/SimpleLogUpkeepCounter.bin 7557d117a066cd8cf35f635bc085ee11795442073c18f8610ede9037b74fd814 solidity_vrf_consumer_interface_v08: ../../contracts/solc/v0.8.6/VRFConsumer/VRFConsumer.abi ../../contracts/solc/v0.8.6/VRFConsumer/VRFConsumer.bin b14f9136b15e3dc9d6154d5700f3ed4cf88ddc4f70f20c3bb57fc46050904c8f solidity_vrf_request_id_v08: ../../contracts/solc/v0.8.6/VRFRequestIDBaseTestHelper/VRFRequestIDBaseTestHelper.abi ../../contracts/solc/v0.8.6/VRFRequestIDBaseTestHelper/VRFRequestIDBaseTestHelper.bin f2559015d6f3e5d285c57b011be9b2300632e93dd6c4524e58202d6200f09edc @@ -82,6 +82,7 @@ vrf_consumer_v2_plus_upgradeable_example: ../../contracts/solc/v0.8.19/VRFConsum vrf_consumer_v2_upgradeable_example: ../../contracts/solc/v0.8.6/VRFConsumerV2UpgradeableExample/VRFConsumerV2UpgradeableExample.abi ../../contracts/solc/v0.8.6/VRFConsumerV2UpgradeableExample/VRFConsumerV2UpgradeableExample.bin f1790a9a2f2a04c730593e483459709cb89e897f8a19d7a3ac0cfe6a97265e6e vrf_coordinator_mock: ../../contracts/solc/v0.8.6/VRFCoordinatorMock/VRFCoordinatorMock.abi ../../contracts/solc/v0.8.6/VRFCoordinatorMock/VRFCoordinatorMock.bin 5c495cf8df1f46d8736b9150cdf174cce358cb8352f60f0d5bb9581e23920501 vrf_coordinator_test_v2: ../../contracts/solc/v0.8.6/VRFCoordinatorTestV2/VRFCoordinatorTestV2.abi ../../contracts/solc/v0.8.6/VRFCoordinatorTestV2/VRFCoordinatorTestV2.bin ff6c0056c6181ea75f667beed21ff4610f417dd50ceabf2dec8fa42e84851f50 +vrf_coordinator_test_v2_5: ../../contracts/solc/v0.8.19/VRFCoordinatorTestV2_5/VRFCoordinatorTestV2_5.abi ../../contracts/solc/v0.8.19/VRFCoordinatorTestV2_5/VRFCoordinatorTestV2_5.bin ab793e7d72b2d10d5c80b5358ca98caf5ff8a8686700735b198ed811272d7910 vrf_coordinator_v2: ../../contracts/solc/v0.8.6/VRFCoordinatorV2/VRFCoordinatorV2.abi ../../contracts/solc/v0.8.6/VRFCoordinatorV2/VRFCoordinatorV2.bin 156fbbc19489383901087c2076648ccd343bcd9a332f1ad25974da834c5be961 vrf_coordinator_v2_5: ../../contracts/solc/v0.8.19/VRFCoordinatorV2_5/VRFCoordinatorV2_5.abi ../../contracts/solc/v0.8.19/VRFCoordinatorV2_5/VRFCoordinatorV2_5.bin 3c766dbdefcc895ad475de96c65b6c48c868b8dc889ee750bba6711b1e5ec41d vrf_coordinator_v2_5_arbitrum: ../../contracts/solc/v0.8.19/VRFCoordinatorV2_5_Arbitrum/VRFCoordinatorV2_5_Arbitrum.abi ../../contracts/solc/v0.8.19/VRFCoordinatorV2_5_Arbitrum/VRFCoordinatorV2_5_Arbitrum.bin 1a2431ee76e307b45f683c439d08b9096a08f08aaf9ca132ea5b36b409962abe @@ -121,4 +122,4 @@ vrfv2plus_wrapper_arbitrum: ../../contracts/solc/v0.8.19/VRFV2PlusWrapper_Arbitr vrfv2plus_wrapper_consumer_example: ../../contracts/solc/v0.8.19/VRFV2PlusWrapperConsumerExample/VRFV2PlusWrapperConsumerExample.abi ../../contracts/solc/v0.8.19/VRFV2PlusWrapperConsumerExample/VRFV2PlusWrapperConsumerExample.bin aeb0c681fa264f90971f65cba1e8d41064948070b217c8204a80ac95e1fa2294 vrfv2plus_wrapper_load_test_consumer: ../../contracts/solc/v0.8.19/VRFV2PlusWrapperLoadTestConsumer/VRFV2PlusWrapperLoadTestConsumer.abi ../../contracts/solc/v0.8.19/VRFV2PlusWrapperLoadTestConsumer/VRFV2PlusWrapperLoadTestConsumer.bin 5ca0223d3f6f6073ddfee4f9ddca13ea5f87297eb5f800359d7a1c41d04b6776 vrfv2plus_wrapper_optimism: ../../contracts/solc/v0.8.19/VRFV2PlusWrapper_Optimism/VRFV2PlusWrapper_Optimism.abi ../../contracts/solc/v0.8.19/VRFV2PlusWrapper_Optimism/VRFV2PlusWrapper_Optimism.bin 12a8c7a96716a5472a8ca712b10ab631085d4f5eb17bd5f7e0d2412556058ce9 -weth9_wrapper: ../../contracts/solc/v0.8.19/WETH9/WETH9.abi ../../contracts/solc/v0.8.19/WETH9/WETH9.bin 7f600a1de0c02a071cb13bcf9eb1dbf11c3e3eccd1e78ed4b4ecb2960f2bb020 +weth9_wrapper: ../../contracts/solc/v0.8.19/WETH9/WETH9.abi ../../contracts/solc/v0.8.19/WETH9/WETH9.bin 393b7b1ea2d1dc5a520a60cc6736dc489726cb0bd1481ea8b22d2872d4a510b1 diff --git a/core/gethwrappers/go_generate.go b/core/gethwrappers/go_generate.go index c916380cb43..32db02f2bf7 100644 --- a/core/gethwrappers/go_generate.go +++ b/core/gethwrappers/go_generate.go @@ -53,7 +53,7 @@ package gethwrappers //go:generate go run ./generation/generate/wrap.go ../../contracts/solc/v0.8.19/AutomationUtils2_3/AutomationUtils2_3.abi ../../contracts/solc/v0.8.19/AutomationUtils2_3/AutomationUtils2_3.bin AutomationUtils automation_utils_2_3 //go:generate go run ./generation/generate/wrap.go ../../contracts/solc/v0.8.19/ArbitrumModule/ArbitrumModule.abi ../../contracts/solc/v0.8.19/ArbitrumModule/ArbitrumModule.bin ArbitrumModule arbitrum_module //go:generate go run ./generation/generate/wrap.go ../../contracts/solc/v0.8.19/ChainModuleBase/ChainModuleBase.abi ../../contracts/solc/v0.8.19/ChainModuleBase/ChainModuleBase.bin ChainModuleBase chain_module_base -//go:generate go run ./generation/generate/wrap.go ../../contracts/solc/v0.8.19/OptimismModule/OptimismModule.abi ../../contracts/solc/v0.8.19/OptimismModule/OptimismModule.bin OptimismModule optimism_module +//go:generate go run ./generation/generate/wrap.go ../../contracts/solc/v0.8.19/OptimismModuleV2/OptimismModuleV2.abi ../../contracts/solc/v0.8.19/OptimismModuleV2/OptimismModuleV2.bin OptimismModuleV2 optimism_module_v2 //go:generate go run ./generation/generate/wrap.go ../../contracts/solc/v0.8.19/ScrollModule/ScrollModule.abi ../../contracts/solc/v0.8.19/ScrollModule/ScrollModule.bin ScrollModule scroll_module //go:generate go run ./generation/generate/wrap.go ../../contracts/solc/v0.8.19/IChainModule/IChainModule.abi ../../contracts/solc/v0.8.19/IChainModule/IChainModule.bin IChainModule i_chain_module //go:generate go run ./generation/generate/wrap.go ../../contracts/solc/v0.8.19/IAutomationV21PlusCommon/IAutomationV21PlusCommon.abi ../../contracts/solc/v0.8.19/IAutomationV21PlusCommon/IAutomationV21PlusCommon.bin IAutomationV21PlusCommon i_automation_v21_plus_common @@ -143,6 +143,7 @@ package gethwrappers //go:generate go run ./generation/generate/wrap.go ../../contracts/solc/v0.8.19/VRFCoordinatorV2_5_Optimism/VRFCoordinatorV2_5_Optimism.abi ../../contracts/solc/v0.8.19/VRFCoordinatorV2_5_Optimism/VRFCoordinatorV2_5_Optimism.bin VRFCoordinatorV2_5_Optimism vrf_coordinator_v2_5_optimism //go:generate go run ./generation/generate/wrap.go ../../contracts/solc/v0.8.19/VRFV2PlusWrapper_Arbitrum/VRFV2PlusWrapper_Arbitrum.abi ../../contracts/solc/v0.8.19/VRFV2PlusWrapper_Arbitrum/VRFV2PlusWrapper_Arbitrum.bin VRFV2PlusWrapper_Arbitrum vrfv2plus_wrapper_arbitrum //go:generate go run ./generation/generate/wrap.go ../../contracts/solc/v0.8.19/VRFV2PlusWrapper_Optimism/VRFV2PlusWrapper_Optimism.abi ../../contracts/solc/v0.8.19/VRFV2PlusWrapper_Optimism/VRFV2PlusWrapper_Optimism.bin VRFV2PlusWrapper_Optimism vrfv2plus_wrapper_optimism +//go:generate go run ./generation/generate/wrap.go ../../contracts/solc/v0.8.19/VRFCoordinatorTestV2_5/VRFCoordinatorTestV2_5.abi ../../contracts/solc/v0.8.19/VRFCoordinatorTestV2_5/VRFCoordinatorTestV2_5.bin VRFCoordinatorTestV2_5 vrf_coordinator_test_v2_5 // Aggregators //go:generate go run ./generation/generate/wrap.go ../../contracts/solc/v0.8.6/AggregatorV2V3Interface/AggregatorV2V3Interface.abi ../../contracts/solc/v0.8.6/AggregatorV2V3Interface/AggregatorV2V3Interface.bin AggregatorV2V3Interface aggregator_v2v3_interface @@ -154,20 +155,14 @@ package gethwrappers // ChainReader test contract //go:generate go run ./generation/generate/wrap.go ../../contracts/solc/v0.8.19/ChainReaderTester/ChainReaderTester.abi ../../contracts/solc/v0.8.19/ChainReaderTester/ChainReaderTester.bin ChainReaderTester chain_reader_tester -// Chainlink Functions //go:generate go generate ./functions - -// Chainlink Keystone //go:generate go generate ./keystone - -// Mercury //go:generate go generate ./llo-feeds - -// Operator Forwarder //go:generate go generate ./operatorforwarder - -// Shared //go:generate go generate ./shared +//go:generate go generate ./transmission +//go:generate go generate ./ccip +//go:generate go generate ./liquiditymanager // Mocks that contain only events and functions to emit them // These contracts are used in testing Atlas flows. The contracts contain no logic, only events, structures, and functions to emit them. @@ -177,6 +172,3 @@ package gethwrappers // 3. Compile events mock contracts. ./generation/compile_event_mock_contract.sh calls contracts/scripts/native_solc_compile_all_events_mock to compile events mock contracts. // 4. Generate wrappers for events mock contracts. //go:generate ./generation/compile_event_mock_contract.sh - -// Transmission -//go:generate go generate ./transmission diff --git a/core/gethwrappers/keystone/generated/capabilities_registry/capabilities_registry.go b/core/gethwrappers/keystone/generated/capabilities_registry/capabilities_registry.go index bb920010856..d9c7dbe69fb 100644 --- a/core/gethwrappers/keystone/generated/capabilities_registry/capabilities_registry.go +++ b/core/gethwrappers/keystone/generated/capabilities_registry/capabilities_registry.go @@ -86,8 +86,8 @@ type CapabilitiesRegistryNodeParams struct { } var CapabilitiesRegistryMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"AccessForbidden\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"hashedCapabilityId\",\"type\":\"bytes32\"}],\"name\":\"CapabilityAlreadyExists\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"hashedCapabilityId\",\"type\":\"bytes32\"}],\"name\":\"CapabilityDoesNotExist\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"hashedCapabilityId\",\"type\":\"bytes32\"}],\"name\":\"CapabilityIsDeprecated\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"hashedCapabilityId\",\"type\":\"bytes32\"},{\"internalType\":\"uint32\",\"name\":\"donId\",\"type\":\"uint32\"}],\"name\":\"CapabilityRequiredByDON\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"donId\",\"type\":\"uint32\"}],\"name\":\"DONDoesNotExist\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"donId\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"capabilityId\",\"type\":\"bytes32\"}],\"name\":\"DuplicateDONCapability\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"donId\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"nodeP2PId\",\"type\":\"bytes32\"}],\"name\":\"DuplicateDONNode\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"proposedConfigurationContract\",\"type\":\"address\"}],\"name\":\"InvalidCapabilityConfigurationContractInterface\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"f\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"nodeCount\",\"type\":\"uint256\"}],\"name\":\"InvalidFaultTolerance\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32[]\",\"name\":\"hashedCapabilityIds\",\"type\":\"bytes32[]\"}],\"name\":\"InvalidNodeCapabilities\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidNodeOperatorAdmin\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"p2pId\",\"type\":\"bytes32\"}],\"name\":\"InvalidNodeP2PId\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidNodeSigner\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"lengthOne\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"lengthTwo\",\"type\":\"uint256\"}],\"name\":\"LengthMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"nodeP2PId\",\"type\":\"bytes32\"}],\"name\":\"NodeAlreadyExists\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"nodeP2PId\",\"type\":\"bytes32\"}],\"name\":\"NodeDoesNotExist\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"nodeP2PId\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"capabilityId\",\"type\":\"bytes32\"}],\"name\":\"NodeDoesNotSupportCapability\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"nodeOperatorId\",\"type\":\"uint32\"}],\"name\":\"NodeOperatorDoesNotExist\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"donId\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"nodeP2PId\",\"type\":\"bytes32\"}],\"name\":\"NodePartOfCapabilitiesDON\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"donId\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"nodeP2PId\",\"type\":\"bytes32\"}],\"name\":\"NodePartOfWorkflowDON\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"hashedCapabilityId\",\"type\":\"bytes32\"}],\"name\":\"CapabilityConfigured\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"hashedCapabilityId\",\"type\":\"bytes32\"}],\"name\":\"CapabilityDeprecated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"donId\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"configCount\",\"type\":\"uint32\"}],\"name\":\"ConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"p2pId\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"uint32\",\"name\":\"nodeOperatorId\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signer\",\"type\":\"bytes32\"}],\"name\":\"NodeAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint32\",\"name\":\"nodeOperatorId\",\"type\":\"uint32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"admin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"}],\"name\":\"NodeOperatorAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint32\",\"name\":\"nodeOperatorId\",\"type\":\"uint32\"}],\"name\":\"NodeOperatorRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint32\",\"name\":\"nodeOperatorId\",\"type\":\"uint32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"admin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"}],\"name\":\"NodeOperatorUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"p2pId\",\"type\":\"bytes32\"}],\"name\":\"NodeRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"p2pId\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"uint32\",\"name\":\"nodeOperatorId\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signer\",\"type\":\"bytes32\"}],\"name\":\"NodeUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"string\",\"name\":\"labelledName\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"version\",\"type\":\"string\"},{\"internalType\":\"enumCapabilitiesRegistry.CapabilityType\",\"name\":\"capabilityType\",\"type\":\"uint8\"},{\"internalType\":\"enumCapabilitiesRegistry.CapabilityResponseType\",\"name\":\"responseType\",\"type\":\"uint8\"},{\"internalType\":\"address\",\"name\":\"configurationContract\",\"type\":\"address\"}],\"internalType\":\"structCapabilitiesRegistry.Capability[]\",\"name\":\"capabilities\",\"type\":\"tuple[]\"}],\"name\":\"addCapabilities\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32[]\",\"name\":\"nodes\",\"type\":\"bytes32[]\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"capabilityId\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"config\",\"type\":\"bytes\"}],\"internalType\":\"structCapabilitiesRegistry.CapabilityConfiguration[]\",\"name\":\"capabilityConfigurations\",\"type\":\"tuple[]\"},{\"internalType\":\"bool\",\"name\":\"isPublic\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"acceptsWorkflows\",\"type\":\"bool\"},{\"internalType\":\"uint8\",\"name\":\"f\",\"type\":\"uint8\"}],\"name\":\"addDON\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"admin\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"}],\"internalType\":\"structCapabilitiesRegistry.NodeOperator[]\",\"name\":\"nodeOperators\",\"type\":\"tuple[]\"}],\"name\":\"addNodeOperators\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint32\",\"name\":\"nodeOperatorId\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"signer\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"p2pId\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32[]\",\"name\":\"hashedCapabilityIds\",\"type\":\"bytes32[]\"}],\"internalType\":\"structCapabilitiesRegistry.NodeParams[]\",\"name\":\"nodes\",\"type\":\"tuple[]\"}],\"name\":\"addNodes\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32[]\",\"name\":\"hashedCapabilityIds\",\"type\":\"bytes32[]\"}],\"name\":\"deprecateCapabilities\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getCapabilities\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"hashedId\",\"type\":\"bytes32\"},{\"internalType\":\"string\",\"name\":\"labelledName\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"version\",\"type\":\"string\"},{\"internalType\":\"enumCapabilitiesRegistry.CapabilityType\",\"name\":\"capabilityType\",\"type\":\"uint8\"},{\"internalType\":\"enumCapabilitiesRegistry.CapabilityResponseType\",\"name\":\"responseType\",\"type\":\"uint8\"},{\"internalType\":\"address\",\"name\":\"configurationContract\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"isDeprecated\",\"type\":\"bool\"}],\"internalType\":\"structCapabilitiesRegistry.CapabilityInfo[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"hashedId\",\"type\":\"bytes32\"}],\"name\":\"getCapability\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"hashedId\",\"type\":\"bytes32\"},{\"internalType\":\"string\",\"name\":\"labelledName\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"version\",\"type\":\"string\"},{\"internalType\":\"enumCapabilitiesRegistry.CapabilityType\",\"name\":\"capabilityType\",\"type\":\"uint8\"},{\"internalType\":\"enumCapabilitiesRegistry.CapabilityResponseType\",\"name\":\"responseType\",\"type\":\"uint8\"},{\"internalType\":\"address\",\"name\":\"configurationContract\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"isDeprecated\",\"type\":\"bool\"}],\"internalType\":\"structCapabilitiesRegistry.CapabilityInfo\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"donId\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"capabilityId\",\"type\":\"bytes32\"}],\"name\":\"getCapabilityConfigs\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"donId\",\"type\":\"uint32\"}],\"name\":\"getDON\",\"outputs\":[{\"components\":[{\"internalType\":\"uint32\",\"name\":\"id\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"configCount\",\"type\":\"uint32\"},{\"internalType\":\"uint8\",\"name\":\"f\",\"type\":\"uint8\"},{\"internalType\":\"bool\",\"name\":\"isPublic\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"acceptsWorkflows\",\"type\":\"bool\"},{\"internalType\":\"bytes32[]\",\"name\":\"nodeP2PIds\",\"type\":\"bytes32[]\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"capabilityId\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"config\",\"type\":\"bytes\"}],\"internalType\":\"structCapabilitiesRegistry.CapabilityConfiguration[]\",\"name\":\"capabilityConfigurations\",\"type\":\"tuple[]\"}],\"internalType\":\"structCapabilitiesRegistry.DONInfo\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getDONs\",\"outputs\":[{\"components\":[{\"internalType\":\"uint32\",\"name\":\"id\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"configCount\",\"type\":\"uint32\"},{\"internalType\":\"uint8\",\"name\":\"f\",\"type\":\"uint8\"},{\"internalType\":\"bool\",\"name\":\"isPublic\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"acceptsWorkflows\",\"type\":\"bool\"},{\"internalType\":\"bytes32[]\",\"name\":\"nodeP2PIds\",\"type\":\"bytes32[]\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"capabilityId\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"config\",\"type\":\"bytes\"}],\"internalType\":\"structCapabilitiesRegistry.CapabilityConfiguration[]\",\"name\":\"capabilityConfigurations\",\"type\":\"tuple[]\"}],\"internalType\":\"structCapabilitiesRegistry.DONInfo[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"labelledName\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"version\",\"type\":\"string\"}],\"name\":\"getHashedCapabilityId\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"p2pId\",\"type\":\"bytes32\"}],\"name\":\"getNode\",\"outputs\":[{\"components\":[{\"internalType\":\"uint32\",\"name\":\"nodeOperatorId\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"configCount\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"workflowDONId\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"signer\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"p2pId\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32[]\",\"name\":\"hashedCapabilityIds\",\"type\":\"bytes32[]\"},{\"internalType\":\"uint256[]\",\"name\":\"capabilitiesDONIds\",\"type\":\"uint256[]\"}],\"internalType\":\"structCapabilitiesRegistry.NodeInfo\",\"name\":\"nodeInfo\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"nodeOperatorId\",\"type\":\"uint32\"}],\"name\":\"getNodeOperator\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"admin\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"}],\"internalType\":\"structCapabilitiesRegistry.NodeOperator\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getNodeOperators\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"admin\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"}],\"internalType\":\"structCapabilitiesRegistry.NodeOperator[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getNodes\",\"outputs\":[{\"components\":[{\"internalType\":\"uint32\",\"name\":\"nodeOperatorId\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"configCount\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"workflowDONId\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"signer\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"p2pId\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32[]\",\"name\":\"hashedCapabilityIds\",\"type\":\"bytes32[]\"},{\"internalType\":\"uint256[]\",\"name\":\"capabilitiesDONIds\",\"type\":\"uint256[]\"}],\"internalType\":\"structCapabilitiesRegistry.NodeInfo[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"hashedCapabilityId\",\"type\":\"bytes32\"}],\"name\":\"isCapabilityDeprecated\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32[]\",\"name\":\"donIds\",\"type\":\"uint32[]\"}],\"name\":\"removeDONs\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32[]\",\"name\":\"nodeOperatorIds\",\"type\":\"uint32[]\"}],\"name\":\"removeNodeOperators\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32[]\",\"name\":\"removedNodeP2PIds\",\"type\":\"bytes32[]\"}],\"name\":\"removeNodes\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"donId\",\"type\":\"uint32\"},{\"internalType\":\"bytes32[]\",\"name\":\"nodes\",\"type\":\"bytes32[]\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"capabilityId\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"config\",\"type\":\"bytes\"}],\"internalType\":\"structCapabilitiesRegistry.CapabilityConfiguration[]\",\"name\":\"capabilityConfigurations\",\"type\":\"tuple[]\"},{\"internalType\":\"bool\",\"name\":\"isPublic\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"acceptsWorkflows\",\"type\":\"bool\"},{\"internalType\":\"uint8\",\"name\":\"f\",\"type\":\"uint8\"}],\"name\":\"updateDON\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32[]\",\"name\":\"nodeOperatorIds\",\"type\":\"uint32[]\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"admin\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"}],\"internalType\":\"structCapabilitiesRegistry.NodeOperator[]\",\"name\":\"nodeOperators\",\"type\":\"tuple[]\"}],\"name\":\"updateNodeOperators\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint32\",\"name\":\"nodeOperatorId\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"signer\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"p2pId\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32[]\",\"name\":\"hashedCapabilityIds\",\"type\":\"bytes32[]\"}],\"internalType\":\"structCapabilitiesRegistry.NodeParams[]\",\"name\":\"nodes\",\"type\":\"tuple[]\"}],\"name\":\"updateNodes\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", - Bin: "0x6080604052600e80546001600160401b0319166401000000011790553480156200002857600080fd5b503380600081620000805760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000b357620000b381620000bc565b50505062000167565b336001600160a01b03821603620001165760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640162000077565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b6150f680620001776000396000f3fe608060405234801561001057600080fd5b50600436106101ae5760003560e01c80635e65e309116100ee5780638da5cb5b11610097578063d8bc7b6811610071578063d8bc7b68146103f6578063ddbe4f8214610409578063e29581aa1461041e578063f2fde38b1461043357600080fd5b80638da5cb5b1461039b5780639cb7c5f4146103c3578063d59a79f6146103e357600080fd5b806373ac22b4116100c857806373ac22b41461036d57806379ba50971461038057806386fa42461461038857600080fd5b80635e65e3091461033257806366acaa3314610345578063715f52951461035a57600080fd5b8063235374051161015b578063398f377311610135578063398f3773146102cb5780633f2a13c9146102de57806350c946fe146102ff5780635d83d9671461031f57600080fd5b80632353740514610285578063275459f2146102a55780632c01a1e8146102b857600080fd5b80631d05394c1161018c5780631d05394c1461023b578063214502431461025057806322bdbcbc1461026557600080fd5b80630fe5800a146101b357806312570011146101d9578063181f5a77146101fc575b600080fd5b6101c66101c1366004613e8b565b610446565b6040519081526020015b60405180910390f35b6101ec6101e7366004613eef565b61047a565b60405190151581526020016101d0565b604080518082018252601a81527f4361706162696c6974696573526567697374727920312e302e30000000000000602082015290516101d09190613f76565b61024e610249366004613fce565b610487565b005b61025861069c565b6040516101d09190614150565b6102786102733660046141eb565b6107f9565b6040516101d09190614243565b6102986102933660046141eb565b6108e6565b6040516101d09190614256565b61024e6102b3366004613fce565b61092a565b61024e6102c6366004613fce565b610a01565b61024e6102d9366004613fce565b610c9d565b6102f16102ec366004614269565b610e5c565b6040516101d0929190614293565b61031261030d366004613eef565b611048565b6040516101d09190614358565b61024e61032d366004613fce565b611122565b61024e610340366004613fce565b611217565b61034d61193f565b6040516101d0919061436b565b61024e610368366004613fce565b611b22565b61024e61037b366004613fce565b611bd4565b61024e6120a2565b61024e6103963660046143e0565b61219f565b60005460405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101d0565b6103d66103d1366004613eef565b6124df565b6040516101d0919061452f565b61024e6103f1366004614561565b61271a565b61024e610404366004614616565b6127e3565b6104116128ad565b6040516101d091906146bb565b6104266129a1565b6040516101d09190614730565b61024e6104413660046147c9565b612aaa565b6000828260405160200161045b929190614293565b6040516020818303038152906040528051906020012090505b92915050565b6000610474600583612abe565b61048f612ad9565b60005b818110156106975760008383838181106104ae576104ae6147e4565b90506020020160208101906104c391906141eb565b63ffffffff8181166000908152600d60209081526040808320805464010000000081049095168085526001820190935290832094955093909290916a010000000000000000000090910460ff16905b61051b83612b5c565b8110156105bb57811561057157600c60006105368584612b66565b8152602081019190915260400160002080547fffffffffffffffffffffffffffffffffffffffff00000000ffffffffffffffff1690556105b3565b6105b18663ffffffff16600c60006105928588612b6690919063ffffffff16565b8152602001908152602001600020600401612b7290919063ffffffff16565b505b600101610512565b508354640100000000900463ffffffff16600003610612576040517f2b62be9b00000000000000000000000000000000000000000000000000000000815263ffffffff861660048201526024015b60405180910390fd5b63ffffffff85166000818152600d6020908152604080832080547fffffffffffffffffffffffffffffffffffffffffff00000000000000000000001690558051938452908301919091527ff264aae70bf6a9d90e68e0f9b393f4e7fbea67b063b0f336e0b36c1581703651910160405180910390a15050505050806001019050610492565b505050565b600e54606090640100000000900463ffffffff1660006106bd600183614842565b63ffffffff1667ffffffffffffffff8111156106db576106db613d25565b60405190808252806020026020018201604052801561076257816020015b6040805160e081018252600080825260208083018290529282018190526060808301829052608083019190915260a0820181905260c082015282527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9092019101816106f95790505b509050600060015b8363ffffffff168163ffffffff1610156107d65763ffffffff8082166000908152600d602052604090205416156107ce576107a481612b7e565b8383815181106107b6576107b66147e4565b6020026020010181905250816107cb9061485f565b91505b60010161076a565b506107e2600184614842565b63ffffffff1681146107f2578082525b5092915050565b60408051808201909152600081526060602082015263ffffffff82166000908152600b60209081526040918290208251808401909352805473ffffffffffffffffffffffffffffffffffffffff168352600181018054919284019161085d90614897565b80601f016020809104026020016040519081016040528092919081815260200182805461088990614897565b80156108d65780601f106108ab576101008083540402835291602001916108d6565b820191906000526020600020905b8154815290600101906020018083116108b957829003601f168201915b5050505050815250509050919050565b6040805160e0810182526000808252602082018190529181018290526060808201839052608082019290925260a0810182905260c081019190915261047482612b7e565b610932612ad9565b60005b63ffffffff811682111561069757600083838363ffffffff1681811061095d5761095d6147e4565b905060200201602081019061097291906141eb565b63ffffffff81166000908152600b6020526040812080547fffffffffffffffffffffffff00000000000000000000000000000000000000001681559192506109bd6001830182613cb8565b505060405163ffffffff8216907fa59268ca81d40429e65ccea5385b59cf2d3fc6519371dee92f8eb1dae5107a7a90600090a2506109fa816148ea565b9050610935565b6000805473ffffffffffffffffffffffffffffffffffffffff163314905b82811015610c97576000848483818110610a3b57610a3b6147e4565b602090810292909201356000818152600c90935260409092206001810154929350919050610a98576040517fd82f6adb00000000000000000000000000000000000000000000000000000000815260048101839052602401610609565b6000610aa682600401612b5c565b1115610afb57610ab96004820184612b66565b6040517f60a6d89800000000000000000000000000000000000000000000000000000000815263ffffffff909116600482015260248101839052604401610609565b805468010000000000000000900463ffffffff1615610b635780546040517f60b9df730000000000000000000000000000000000000000000000000000000081526801000000000000000090910463ffffffff16600482015260248101839052604401610609565b83158015610b9d5750805463ffffffff166000908152600b602052604090205473ffffffffffffffffffffffffffffffffffffffff163314155b15610bd6576040517f9473075d000000000000000000000000000000000000000000000000000000008152336004820152602401610609565b6001810154610be790600790612b72565b506002810154610bf990600990612b72565b506000828152600c6020526040812080547fffffffffffffffffffffffffffffffffffffffff00000000000000000000000016815560018101829055600281018290559060048201818181610c4e8282613cf2565b5050505050507f5254e609a97bab37b7cc79fe128f85c097bd6015c6e1624ae0ba392eb975320582604051610c8591815260200190565b60405180910390a15050600101610a1f565b50505050565b610ca5612ad9565b60005b81811015610697576000838383818110610cc457610cc46147e4565b9050602002810190610cd6919061490d565b610cdf9061494b565b805190915073ffffffffffffffffffffffffffffffffffffffff16610d30576040517feeacd93900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600e54604080518082018252835173ffffffffffffffffffffffffffffffffffffffff908116825260208086015181840190815263ffffffff9095166000818152600b909252939020825181547fffffffffffffffffffffffff00000000000000000000000000000000000000001692169190911781559251919290916001820190610dbc9082614a05565b5050600e8054909150600090610dd79063ffffffff166148ea565b91906101000a81548163ffffffff021916908363ffffffff160217905550816000015173ffffffffffffffffffffffffffffffffffffffff168163ffffffff167f78e94ca80be2c30abc061b99e7eb8583b1254781734b1e3ce339abb57da2fe8e8460200151604051610e4a9190613f76565b60405180910390a35050600101610ca8565b63ffffffff8083166000908152600d60209081526040808320805464010000000090049094168084526001909401825280832085845260030190915281208054606093849390929091610eae90614897565b80601f0160208091040260200160405190810160405280929190818152602001828054610eda90614897565b8015610f275780601f10610efc57610100808354040283529160200191610f27565b820191906000526020600020905b815481529060010190602001808311610f0a57829003601f168201915b5050506000888152600260208190526040909120015492935060609262010000900473ffffffffffffffffffffffffffffffffffffffff1615915061103a905057600086815260026020819052604091829020015490517f8318ed5d00000000000000000000000000000000000000000000000000000000815263ffffffff891660048201526201000090910473ffffffffffffffffffffffffffffffffffffffff1690638318ed5d90602401600060405180830381865afa158015610ff1573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682016040526110379190810190614b1f565b90505b9093509150505b9250929050565b6040805160e0810182526000808252602082018190529181018290526060808201839052608082019290925260a0810182905260c08101919091526040805160e0810182526000848152600c6020908152838220805463ffffffff8082168652640100000000820481168487018190526801000000000000000090920416858701526001820154606086015260028201546080860152835260030190529190912060a08201906110f790612e49565b815260200161111a600c6000868152602001908152602001600020600401612e49565b905292915050565b61112a612ad9565b60005b81811015610697576000838383818110611149576111496147e4565b905060200201359050611166816003612abe90919063ffffffff16565b61119f576040517fe181733f00000000000000000000000000000000000000000000000000000000815260048101829052602401610609565b6111aa600582612e56565b6111e3576040517ff7d7a29400000000000000000000000000000000000000000000000000000000815260048101829052602401610609565b60405181907fdcea1b78b6ddc31592a94607d537543fcaafda6cc52d6d5cc7bbfca1422baf2190600090a25060010161112d565b6000805473ffffffffffffffffffffffffffffffffffffffff163314905b82811015610c97576000848483818110611251576112516147e4565b90506020028101906112639190614b8d565b61126c90614bc1565b805163ffffffff166000908152600b602090815260408083208151808301909252805473ffffffffffffffffffffffffffffffffffffffff1682526001810180549596509394919390928401916112c290614897565b80601f01602080910402602001604051908101604052809291908181526020018280546112ee90614897565b801561133b5780601f106113105761010080835404028352916020019161133b565b820191906000526020600020905b81548152906001019060200180831161131e57829003601f168201915b50505050508152505090508315801561136b5750805173ffffffffffffffffffffffffffffffffffffffff163314155b156113a4576040517f9473075d000000000000000000000000000000000000000000000000000000008152336004820152602401610609565b6040808301516000908152600c6020522060018101546113f85782604001516040517fd82f6adb00000000000000000000000000000000000000000000000000000000815260040161060991815260200190565b6020830151611433576040517f8377314600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001810154602084015181146114b457602084015161145490600790612abe565b1561148b576040517f8377314600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b602084015160018301556114a0600782612b72565b5060208401516114b290600790612e56565b505b606084015180516000036114f657806040517f3748d4c60000000000000000000000000000000000000000000000000000000081526004016106099190614c94565b8254600090849060049061151790640100000000900463ffffffff166148ea565b91906101000a81548163ffffffff021916908363ffffffff1602179055905060005b82518110156115fc5761156f838281518110611557576115576147e4565b60200260200101516003612abe90919063ffffffff16565b6115a757826040517f3748d4c60000000000000000000000000000000000000000000000000000000081526004016106099190614c94565b6115f38382815181106115bc576115bc6147e4565b60200260200101518660030160008563ffffffff1663ffffffff168152602001908152602001600020612e5690919063ffffffff16565b50600101611539565b50835468010000000000000000900463ffffffff16801561175d5763ffffffff8082166000908152600d60209081526040808320805464010000000090049094168352600190930181528282206002018054845181840281018401909552808552929392909183018282801561169157602002820191906000526020600020905b81548152602001906001019080831161167d575b5050505050905060005b815181101561175a576116f08282815181106116b9576116b96147e4565b60200260200101518860030160008763ffffffff1663ffffffff168152602001908152602001600020612abe90919063ffffffff16565b61175257818181518110611706576117066147e4565b6020026020010151836040517f03dcd86200000000000000000000000000000000000000000000000000000000815260040161060992919091825263ffffffff16602082015260400190565b60010161169b565b50505b600061176b86600401612e49565b905060005b81518163ffffffff1610156118b1576000828263ffffffff1681518110611799576117996147e4565b60209081029190910181015163ffffffff8082166000908152600d8452604080822080546401000000009004909316825260019092018452818120600201805483518187028101870190945280845293955090939192909183018282801561182057602002820191906000526020600020905b81548152602001906001019080831161180c575b5050505050905060005b815181101561189d5761187f828281518110611848576118486147e4565b60200260200101518b60030160008a63ffffffff1663ffffffff168152602001908152602001600020612abe90919063ffffffff16565b61189557818181518110611706576117066147e4565b60010161182a565b505050806118aa906148ea565b9050611770565b50875186547fffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000001663ffffffff90911690811787556040808a0151600289018190556020808c01518351928352908201527f4b5b465e22eea0c3d40c30e936643245b80d19b2dcf75788c0699fe8d8db645b910160405180910390a25050505050505050806001019050611235565b600e5460609063ffffffff166000611958600183614842565b63ffffffff1667ffffffffffffffff81111561197657611976613d25565b6040519080825280602002602001820160405280156119bc57816020015b6040805180820190915260008152606060208201528152602001906001900390816119945790505b509050600060015b8363ffffffff168163ffffffff161015611b0c5763ffffffff81166000908152600b602052604090205473ffffffffffffffffffffffffffffffffffffffff1615611b045763ffffffff81166000908152600b60209081526040918290208251808401909352805473ffffffffffffffffffffffffffffffffffffffff1683526001810180549192840191611a5890614897565b80601f0160208091040260200160405190810160405280929190818152602001828054611a8490614897565b8015611ad15780601f10611aa657610100808354040283529160200191611ad1565b820191906000526020600020905b815481529060010190602001808311611ab457829003601f168201915b505050505081525050838381518110611aec57611aec6147e4565b602002602001018190525081611b019061485f565b91505b6001016119c4565b50600e546107e29060019063ffffffff16614842565b611b2a612ad9565b60005b81811015610697576000838383818110611b4957611b496147e4565b9050602002810190611b5b9190614cd8565b611b6490614d1b565b90506000611b7a82600001518360200151610446565b9050611b87600382612e56565b611bc0576040517febf5255100000000000000000000000000000000000000000000000000000000815260048101829052602401610609565b611bca8183612e62565b5050600101611b2d565b6000805473ffffffffffffffffffffffffffffffffffffffff163314905b82811015610c97576000848483818110611c0e57611c0e6147e4565b9050602002810190611c209190614b8d565b611c2990614bc1565b805163ffffffff166000908152600b602090815260408083208151808301909252805473ffffffffffffffffffffffffffffffffffffffff168252600181018054959650939491939092840191611c7f90614897565b80601f0160208091040260200160405190810160405280929190818152602001828054611cab90614897565b8015611cf85780601f10611ccd57610100808354040283529160200191611cf8565b820191906000526020600020905b815481529060010190602001808311611cdb57829003601f168201915b50505091909252505081519192505073ffffffffffffffffffffffffffffffffffffffff16611d5e5781516040517fadd9ae1e00000000000000000000000000000000000000000000000000000000815263ffffffff9091166004820152602401610609565b83158015611d835750805173ffffffffffffffffffffffffffffffffffffffff163314155b15611dbc576040517f9473075d000000000000000000000000000000000000000000000000000000008152336004820152602401610609565b6040808301516000908152600c60205220600181015415611e115782604001516040517f5461848300000000000000000000000000000000000000000000000000000000815260040161060991815260200190565b6040830151611e545782604001516040517f64e2ee9200000000000000000000000000000000000000000000000000000000815260040161060991815260200190565b60208301511580611e7157506020830151611e7190600790612abe565b15611ea8576040517f8377314600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60608301518051600003611eea57806040517f3748d4c60000000000000000000000000000000000000000000000000000000081526004016106099190614c94565b81548290600490611f0890640100000000900463ffffffff166148ea565b82546101009290920a63ffffffff818102199093169183160217909155825464010000000090041660005b8251811015611fde57611f51838281518110611557576115576147e4565b611f8957826040517f3748d4c60000000000000000000000000000000000000000000000000000000081526004016106099190614c94565b611fd5838281518110611f9e57611f9e6147e4565b60200260200101518560030160008563ffffffff1663ffffffff168152602001908152602001600020612e5690919063ffffffff16565b50600101611f33565b50845183547fffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000001663ffffffff918216178455604086015160028501556020860151600185018190556120349160079190612e5616565b50604085015161204690600990612e56565b50845160408087015160208089015183519283529082015263ffffffff909216917f74becb12a5e8fd0e98077d02dfba8f647c9670c9df177e42c2418cf17a636f05910160405180910390a25050505050806001019050611bf2565b60015473ffffffffffffffffffffffffffffffffffffffff163314612123576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e6572000000000000000000006044820152606401610609565b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b8281146121e2576040517fab8b67c60000000000000000000000000000000000000000000000000000000081526004810184905260248101829052604401610609565b6000805473ffffffffffffffffffffffffffffffffffffffff16905b848110156124d757600086868381811061221a5761221a6147e4565b905060200201602081019061222f91906141eb565b63ffffffff81166000908152600b6020526040902080549192509073ffffffffffffffffffffffffffffffffffffffff1661229e576040517fadd9ae1e00000000000000000000000000000000000000000000000000000000815263ffffffff83166004820152602401610609565b60008686858181106122b2576122b26147e4565b90506020028101906122c4919061490d565b6122cd9061494b565b805190915073ffffffffffffffffffffffffffffffffffffffff1661231e576040517feeacd93900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b805173ffffffffffffffffffffffffffffffffffffffff16331480159061235b57503373ffffffffffffffffffffffffffffffffffffffff861614155b15612394576040517f9473075d000000000000000000000000000000000000000000000000000000008152336004820152602401610609565b8051825473ffffffffffffffffffffffffffffffffffffffff908116911614158061241057506020808201516040516123cd9201613f76565b60405160208183030381529060405280519060200120826001016040516020016123f79190614dc1565b6040516020818303038152906040528051906020012014155b156124c957805182547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff9091161782556020810151600183019061246a9082614a05565b50806000015173ffffffffffffffffffffffffffffffffffffffff168363ffffffff167f86f41145bde5dd7f523305452e4aad3685508c181432ec733d5f345009358a2883602001516040516124c09190613f76565b60405180910390a35b5050508060010190506121fe565b505050505050565b6125206040805160e0810182526000808252606060208301819052928201839052909182019081526020016000815260006020820181905260409091015290565b6040805160e0810182528381526000848152600260209081529290208054919283019161254c90614897565b80601f016020809104026020016040519081016040528092919081815260200182805461257890614897565b80156125c55780601f1061259a576101008083540402835291602001916125c5565b820191906000526020600020905b8154815290600101906020018083116125a857829003601f168201915b505050505081526020016002600085815260200190815260200160002060010180546125f090614897565b80601f016020809104026020016040519081016040528092919081815260200182805461261c90614897565b80156126695780601f1061263e57610100808354040283529160200191612669565b820191906000526020600020905b81548152906001019060200180831161264c57829003601f168201915b50505091835250506000848152600260208181526040909220015491019060ff16600381111561269b5761269b61444c565b815260008481526002602081815260409092200154910190610100900460ff1660018111156126cc576126cc61444c565b81526000848152600260208181526040928390209091015462010000900473ffffffffffffffffffffffffffffffffffffffff169083015201612710600585612abe565b1515905292915050565b612722612ad9565b63ffffffff8089166000908152600d6020526040812054640100000000900490911690819003612786576040517f2b62be9b00000000000000000000000000000000000000000000000000000000815263ffffffff8a166004820152602401610609565b6127d8888888886040518060a001604052808f63ffffffff168152602001876127ae906148ea565b97508763ffffffff1681526020018a1515815260200189151581526020018860ff168152506130f6565b505050505050505050565b6127eb612ad9565b600e805460009164010000000090910463ffffffff1690600461280d836148ea565b82546101009290920a63ffffffff81810219909316918316021790915581166000818152600d602090815260409182902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000001684179055815160a08101835292835260019083015286151590820152841515606082015260ff841660808201529091506128a39089908990899089906130f6565b5050505050505050565b606060006128bb6003612e49565b90506000815167ffffffffffffffff8111156128d9576128d9613d25565b60405190808252806020026020018201604052801561294b57816020015b6129386040805160e0810182526000808252606060208301819052928201839052909182019081526020016000815260006020820181905260409091015290565b8152602001906001900390816128f75790505b50905060005b82518110156107f25761297c83828151811061296f5761296f6147e4565b60200260200101516124df565b82828151811061298e5761298e6147e4565b6020908102919091010152600101612951565b606060006129af6009612e49565b90506000815167ffffffffffffffff8111156129cd576129cd613d25565b604051908082528060200260200182016040528015612a5457816020015b6040805160e081018252600080825260208083018290529282018190526060808301829052608083019190915260a0820181905260c082015282527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9092019101816129eb5790505b50905060005b82518110156107f257612a85838281518110612a7857612a786147e4565b6020026020010151611048565b828281518110612a9757612a976147e4565b6020908102919091010152600101612a5a565b612ab2612ad9565b612abb8161391a565b50565b600081815260018301602052604081205415155b9392505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314612b5a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e6572000000000000000000006044820152606401610609565b565b6000610474825490565b6000612ad28383613a0f565b6000612ad28383613a39565b6040805160e0810182526000808252602080830182905282840182905260608084018390526080840183905260a0840181905260c084015263ffffffff8581168352600d8252848320805464010000000090049091168084526001909101825284832060028101805487518186028101860190985280885295969295919493909190830182828015612c2f57602002820191906000526020600020905b815481526020019060010190808311612c1b575b505050505090506000815167ffffffffffffffff811115612c5257612c52613d25565b604051908082528060200260200182016040528015612c9857816020015b604080518082019091526000815260606020820152815260200190600190039081612c705790505b50905060005b8151811015612db0576040518060400160405280848381518110612cc457612cc46147e4565b60200260200101518152602001856003016000868581518110612ce957612ce96147e4565b602002602001015181526020019081526020016000208054612d0a90614897565b80601f0160208091040260200160405190810160405280929190818152602001828054612d3690614897565b8015612d835780601f10612d5857610100808354040283529160200191612d83565b820191906000526020600020905b815481529060010190602001808311612d6657829003601f168201915b5050505050815250828281518110612d9d57612d9d6147e4565b6020908102919091010152600101612c9e565b506040805160e08101825263ffffffff8089166000818152600d6020818152868320548086168752948b168187015260ff680100000000000000008604811697870197909752690100000000000000000085048716151560608701529290915290526a010000000000000000000090049091161515608082015260a08101612e3785612e49565b81526020019190915295945050505050565b60606000612ad283613b2c565b6000612ad28383613b88565b608081015173ffffffffffffffffffffffffffffffffffffffff1615612fb057608081015173ffffffffffffffffffffffffffffffffffffffff163b1580612f5b575060808101516040517f01ffc9a70000000000000000000000000000000000000000000000000000000081527f78bea72100000000000000000000000000000000000000000000000000000000600482015273ffffffffffffffffffffffffffffffffffffffff909116906301ffc9a790602401602060405180830381865afa158015612f35573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f599190614e6f565b155b15612fb05760808101516040517fabb5e3fd00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9091166004820152602401610609565b600082815260026020526040902081518291908190612fcf9082614a05565b5060208201516001820190612fe49082614a05565b5060408201516002820180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660018360038111156130265761302661444c565b021790555060608201516002820180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff1661010083600181111561306d5761306d61444c565b0217905550608091909101516002909101805473ffffffffffffffffffffffffffffffffffffffff90921662010000027fffffffffffffffffffff0000000000000000000000000000000000000000ffff90921691909117905560405182907f04f0a9bcf3f3a3b42a4d7ca081119755f82ebe43e0d30c8f7292c4fe0dc4a2ae90600090a25050565b805163ffffffff9081166000908152600d602090815260408083208286015190941683526001909301905220608082015160ff161580613148575060808201518590613143906001614e8c565b60ff16115b156131915760808201516040517f25b4d61800000000000000000000000000000000000000000000000000000000815260ff909116600482015260248101869052604401610609565b6001826020015163ffffffff16111561327957815163ffffffff166000908152600d6020908152604082209084015160019182019183916131d29190614842565b63ffffffff1663ffffffff168152602001908152602001600020905060005b6131fa82612b5c565b81101561327657613229846000015163ffffffff16600c60006105928587600001612b6690919063ffffffff16565b50600c60006132388484612b66565b8152602081019190915260400160002080547fffffffffffffffffffffffffffffffffffffffff00000000ffffffffffffffff1690556001016131f1565b50505b60005b858110156134b3576132a9878783818110613299576132996147e4565b8592602090910201359050612e56565b61330a5782518787838181106132c1576132c16147e4565b6040517f636e405700000000000000000000000000000000000000000000000000000000815263ffffffff90941660048501526020029190910135602483015250604401610609565b82606001511561346157825163ffffffff16600c6000898985818110613332576133326147e4565b602090810292909201358352508101919091526040016000205468010000000000000000900463ffffffff16148015906133ac5750600c600088888481811061337d5761337d6147e4565b602090810292909201358352508101919091526040016000205468010000000000000000900463ffffffff1615155b1561340e5782518787838181106133c5576133c56147e4565b6040517f60b9df7300000000000000000000000000000000000000000000000000000000815263ffffffff90941660048501526020029190910135602483015250604401610609565b8251600c6000898985818110613426576134266147e4565b90506020020135815260200190815260200160002060000160086101000a81548163ffffffff021916908363ffffffff1602179055506134ab565b82516134a99063ffffffff16600c60008a8a86818110613483576134836147e4565b905060200201358152602001908152602001600020600401612e5690919063ffffffff16565b505b60010161327c565b5060005b8381101561378f57368585838181106134d2576134d26147e4565b90506020028101906134e4919061490d565b90506134f260038235612abe565b61352b576040517fe181733f00000000000000000000000000000000000000000000000000000000815281356004820152602401610609565b61353760058235612abe565b15613571576040517ff7d7a29400000000000000000000000000000000000000000000000000000000815281356004820152602401610609565b803560009081526003840160205260408120805461358e90614897565b905011156135da5783516040517f3927d08000000000000000000000000000000000000000000000000000000000815263ffffffff909116600482015281356024820152604401610609565b60005b878110156136e4576136818235600c60008c8c86818110613600576136006147e4565b9050602002013581526020019081526020016000206003016000600c60008e8e88818110613630576136306147e4565b90506020020135815260200190815260200160002060000160049054906101000a900463ffffffff1663ffffffff1663ffffffff168152602001908152602001600020612abe90919063ffffffff16565b6136dc57888882818110613697576136976147e4565b6040517fa7e792500000000000000000000000000000000000000000000000000000000081526020909102929092013560048301525082356024820152604401610609565b6001016135dd565b506002830180546001810182556000918252602091829020833591015561370d90820182614ea5565b8235600090815260038601602052604090209161372b919083614f0a565b50835160208086015161378692918435908c908c9061374c90880188614ea5565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250613bd792505050565b506001016134b7565b50604080830151835163ffffffff9081166000908152600d602090815284822080549415156901000000000000000000027fffffffffffffffffffffffffffffffffffffffffffff00ffffffffffffffffff90951694909417909355606086015186518316825284822080549115156a0100000000000000000000027fffffffffffffffffffffffffffffffffffffffffff00ffffffffffffffffffff9092169190911790556080860151865183168252848220805460ff9290921668010000000000000000027fffffffffffffffffffffffffffffffffffffffffffffff00ffffffffffffffff909216919091179055918501805186518316845292849020805493909216640100000000027fffffffffffffffffffffffffffffffffffffffffffffffff00000000ffffffff9093169290921790558351905191517ff264aae70bf6a9d90e68e0f9b393f4e7fbea67b063b0f336e0b36c15817036519261390a929163ffffffff92831681529116602082015260400190565b60405180910390a1505050505050565b3373ffffffffffffffffffffffffffffffffffffffff821603613999576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c660000000000000000006044820152606401610609565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b6000826000018281548110613a2657613a266147e4565b9060005260206000200154905092915050565b60008181526001830160205260408120548015613b22576000613a5d600183615025565b8554909150600090613a7190600190615025565b9050818114613ad6576000866000018281548110613a9157613a916147e4565b9060005260206000200154905080876000018481548110613ab457613ab46147e4565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080613ae757613ae7615038565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610474565b6000915050610474565b606081600001805480602002602001604051908101604052809291908181526020018280548015613b7c57602002820191906000526020600020905b815481526020019060010190808311613b68575b50505050509050919050565b6000818152600183016020526040812054613bcf57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610474565b506000610474565b6000848152600260208190526040909120015462010000900473ffffffffffffffffffffffffffffffffffffffff16156124d757600084815260026020819052604091829020015490517ffba64a7c0000000000000000000000000000000000000000000000000000000081526201000090910473ffffffffffffffffffffffffffffffffffffffff169063fba64a7c90613c7e908690869086908b908d90600401615067565b600060405180830381600087803b158015613c9857600080fd5b505af1158015613cac573d6000803e3d6000fd5b50505050505050505050565b508054613cc490614897565b6000825580601f10613cd4575050565b601f016020900490600052602060002090810190612abb9190613d0c565b5080546000825590600052602060002090810190612abb91905b5b80821115613d215760008155600101613d0d565b5090565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040516080810167ffffffffffffffff81118282101715613d7757613d77613d25565b60405290565b60405160a0810167ffffffffffffffff81118282101715613d7757613d77613d25565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715613de757613de7613d25565b604052919050565b600067ffffffffffffffff821115613e0957613e09613d25565b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b600082601f830112613e4657600080fd5b8135613e59613e5482613def565b613da0565b818152846020838601011115613e6e57600080fd5b816020850160208301376000918101602001919091529392505050565b60008060408385031215613e9e57600080fd5b823567ffffffffffffffff80821115613eb657600080fd5b613ec286838701613e35565b93506020850135915080821115613ed857600080fd5b50613ee585828601613e35565b9150509250929050565b600060208284031215613f0157600080fd5b5035919050565b60005b83811015613f23578181015183820152602001613f0b565b50506000910152565b60008151808452613f44816020860160208601613f08565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b602081526000612ad26020830184613f2c565b60008083601f840112613f9b57600080fd5b50813567ffffffffffffffff811115613fb357600080fd5b6020830191508360208260051b850101111561104157600080fd5b60008060208385031215613fe157600080fd5b823567ffffffffffffffff811115613ff857600080fd5b61400485828601613f89565b90969095509350505050565b60008151808452602080850194506020840160005b8381101561404157815187529582019590820190600101614025565b509495945050505050565b600082825180855260208086019550808260051b84010181860160005b848110156140c9578583037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe001895281518051845284015160408585018190526140b581860183613f2c565b9a86019a9450505090830190600101614069565b5090979650505050505050565b600063ffffffff8083511684528060208401511660208501525060ff604083015116604084015260608201511515606084015260808201511515608084015260a082015160e060a085015261412e60e0850182614010565b905060c083015184820360c0860152614147828261404c565b95945050505050565b600060208083016020845280855180835260408601915060408160051b87010192506020870160005b828110156141c5577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc08886030184526141b38583516140d6565b94509285019290850190600101614179565b5092979650505050505050565b803563ffffffff811681146141e657600080fd5b919050565b6000602082840312156141fd57600080fd5b612ad2826141d2565b73ffffffffffffffffffffffffffffffffffffffff8151168252600060208201516040602085015261423b6040850182613f2c565b949350505050565b602081526000612ad26020830184614206565b602081526000612ad260208301846140d6565b6000806040838503121561427c57600080fd5b614285836141d2565b946020939093013593505050565b6040815260006142a66040830185613f2c565b82810360208401526141478185613f2c565b600063ffffffff808351168452602081818501511681860152816040850151166040860152606084015160608601526080840151608086015260a0840151915060e060a086015261430c60e0860183614010565b60c08581015187830391880191909152805180835290830193506000918301905b8083101561434d578451825293830193600192909201919083019061432d565b509695505050505050565b602081526000612ad260208301846142b8565b600060208083016020845280855180835260408601915060408160051b87010192506020870160005b828110156141c5577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc08886030184526143ce858351614206565b94509285019290850190600101614394565b600080600080604085870312156143f657600080fd5b843567ffffffffffffffff8082111561440e57600080fd5b61441a88838901613f89565b9096509450602087013591508082111561443357600080fd5b5061444087828801613f89565b95989497509550505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b805182526000602082015160e0602085015261449a60e0850182613f2c565b9050604083015184820360408601526144b38282613f2c565b9150506060830151600481106144cb576144cb61444c565b60608501526080830151600281106144e5576144e561444c565b8060808601525060a083015161451360a086018273ffffffffffffffffffffffffffffffffffffffff169052565b5060c083015161452760c086018215159052565b509392505050565b602081526000612ad2602083018461447b565b8015158114612abb57600080fd5b803560ff811681146141e657600080fd5b60008060008060008060008060c0898b03121561457d57600080fd5b614586896141d2565b9750602089013567ffffffffffffffff808211156145a357600080fd5b6145af8c838d01613f89565b909950975060408b01359150808211156145c857600080fd5b506145d58b828c01613f89565b90965094505060608901356145e981614542565b925060808901356145f981614542565b915061460760a08a01614550565b90509295985092959890939650565b600080600080600080600060a0888a03121561463157600080fd5b873567ffffffffffffffff8082111561464957600080fd5b6146558b838c01613f89565b909950975060208a013591508082111561466e57600080fd5b5061467b8a828b01613f89565b909650945050604088013561468f81614542565b9250606088013561469f81614542565b91506146ad60808901614550565b905092959891949750929550565b600060208083016020845280855180835260408601915060408160051b87010192506020870160005b828110156141c5577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc088860301845261471e85835161447b565b945092850192908501906001016146e4565b600060208083016020845280855180835260408601915060408160051b87010192506020870160005b828110156141c5577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc08886030184526147938583516142b8565b94509285019290850190600101614759565b803573ffffffffffffffffffffffffffffffffffffffff811681146141e657600080fd5b6000602082840312156147db57600080fd5b612ad2826147a5565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b63ffffffff8281168282160390808211156107f2576107f2614813565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361489057614890614813565b5060010190565b600181811c908216806148ab57607f821691505b6020821081036148e4577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b600063ffffffff80831681810361490357614903614813565b6001019392505050565b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc183360301811261494157600080fd5b9190910192915050565b60006040823603121561495d57600080fd5b6040516040810167ffffffffffffffff828210818311171561498157614981613d25565b8160405261498e856147a5565b835260208501359150808211156149a457600080fd5b506149b136828601613e35565b60208301525092915050565b601f821115610697576000816000526020600020601f850160051c810160208610156149e65750805b601f850160051c820191505b818110156124d7578281556001016149f2565b815167ffffffffffffffff811115614a1f57614a1f613d25565b614a3381614a2d8454614897565b846149bd565b602080601f831160018114614a865760008415614a505750858301515b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600386901b1c1916600185901b1785556124d7565b6000858152602081207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08616915b82811015614ad357888601518255948401946001909101908401614ab4565b5085821015614b0f57878501517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600388901b60f8161c191681555b5050505050600190811b01905550565b600060208284031215614b3157600080fd5b815167ffffffffffffffff811115614b4857600080fd5b8201601f81018413614b5957600080fd5b8051614b67613e5482613def565b818152856020838501011115614b7c57600080fd5b614147826020830160208601613f08565b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8183360301811261494157600080fd5b600060808236031215614bd357600080fd5b614bdb613d54565b614be4836141d2565b81526020808401358183015260408401356040830152606084013567ffffffffffffffff80821115614c1557600080fd5b9085019036601f830112614c2857600080fd5b813581811115614c3a57614c3a613d25565b8060051b9150614c4b848301613da0565b8181529183018401918481019036841115614c6557600080fd5b938501935b83851015614c8357843582529385019390850190614c6a565b606087015250939695505050505050565b6020808252825182820181905260009190848201906040850190845b81811015614ccc57835183529284019291840191600101614cb0565b50909695505050505050565b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6183360301811261494157600080fd5b8035600281106141e657600080fd5b600060a08236031215614d2d57600080fd5b614d35613d7d565b823567ffffffffffffffff80821115614d4d57600080fd5b614d5936838701613e35565b83526020850135915080821115614d6f57600080fd5b50614d7c36828601613e35565b602083015250604083013560048110614d9457600080fd5b6040820152614da560608401614d0c565b6060820152614db6608084016147a5565b608082015292915050565b6000602080835260008454614dd581614897565b8060208701526040600180841660008114614df75760018114614e3157614e61565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00851660408a0152604084151560051b8a01019550614e61565b89600052602060002060005b85811015614e585781548b8201860152908301908801614e3d565b8a016040019650505b509398975050505050505050565b600060208284031215614e8157600080fd5b8151612ad281614542565b60ff818116838216019081111561047457610474614813565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112614eda57600080fd5b83018035915067ffffffffffffffff821115614ef557600080fd5b60200191503681900382131561104157600080fd5b67ffffffffffffffff831115614f2257614f22613d25565b614f3683614f308354614897565b836149bd565b6000601f841160018114614f885760008515614f525750838201355b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600387901b1c1916600186901b17835561501e565b6000838152602090207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0861690835b82811015614fd75786850135825560209485019460019092019101614fb7565b5086821015615012577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60f88860031b161c19848701351681555b505060018560011b0183555b5050505050565b8181038181111561047457610474614813565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b6080815284608082015260007f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8611156150a057600080fd5b8560051b808860a0850137820182810360a090810160208501526150c690820187613f2c565b91505063ffffffff8085166040840152808416606084015250969550505050505056fea164736f6c6343000818000a", + ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"AccessForbidden\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"hashedCapabilityId\",\"type\":\"bytes32\"}],\"name\":\"CapabilityAlreadyExists\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"hashedCapabilityId\",\"type\":\"bytes32\"}],\"name\":\"CapabilityDoesNotExist\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"hashedCapabilityId\",\"type\":\"bytes32\"}],\"name\":\"CapabilityIsDeprecated\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"hashedCapabilityId\",\"type\":\"bytes32\"},{\"internalType\":\"uint32\",\"name\":\"donId\",\"type\":\"uint32\"}],\"name\":\"CapabilityRequiredByDON\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"donId\",\"type\":\"uint32\"}],\"name\":\"DONDoesNotExist\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"donId\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"capabilityId\",\"type\":\"bytes32\"}],\"name\":\"DuplicateDONCapability\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"donId\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"nodeP2PId\",\"type\":\"bytes32\"}],\"name\":\"DuplicateDONNode\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"proposedConfigurationContract\",\"type\":\"address\"}],\"name\":\"InvalidCapabilityConfigurationContractInterface\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"f\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"nodeCount\",\"type\":\"uint256\"}],\"name\":\"InvalidFaultTolerance\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32[]\",\"name\":\"hashedCapabilityIds\",\"type\":\"bytes32[]\"}],\"name\":\"InvalidNodeCapabilities\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidNodeOperatorAdmin\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"p2pId\",\"type\":\"bytes32\"}],\"name\":\"InvalidNodeP2PId\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidNodeSigner\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"lengthOne\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"lengthTwo\",\"type\":\"uint256\"}],\"name\":\"LengthMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"nodeP2PId\",\"type\":\"bytes32\"}],\"name\":\"NodeAlreadyExists\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"nodeP2PId\",\"type\":\"bytes32\"}],\"name\":\"NodeDoesNotExist\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"nodeP2PId\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"capabilityId\",\"type\":\"bytes32\"}],\"name\":\"NodeDoesNotSupportCapability\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"nodeOperatorId\",\"type\":\"uint32\"}],\"name\":\"NodeOperatorDoesNotExist\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"donId\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"nodeP2PId\",\"type\":\"bytes32\"}],\"name\":\"NodePartOfCapabilitiesDON\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"donId\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"nodeP2PId\",\"type\":\"bytes32\"}],\"name\":\"NodePartOfWorkflowDON\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"hashedCapabilityId\",\"type\":\"bytes32\"}],\"name\":\"CapabilityConfigured\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"hashedCapabilityId\",\"type\":\"bytes32\"}],\"name\":\"CapabilityDeprecated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint32\",\"name\":\"donId\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"configCount\",\"type\":\"uint32\"}],\"name\":\"ConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"p2pId\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"uint32\",\"name\":\"nodeOperatorId\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signer\",\"type\":\"bytes32\"}],\"name\":\"NodeAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint32\",\"name\":\"nodeOperatorId\",\"type\":\"uint32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"admin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"}],\"name\":\"NodeOperatorAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint32\",\"name\":\"nodeOperatorId\",\"type\":\"uint32\"}],\"name\":\"NodeOperatorRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint32\",\"name\":\"nodeOperatorId\",\"type\":\"uint32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"admin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"}],\"name\":\"NodeOperatorUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"p2pId\",\"type\":\"bytes32\"}],\"name\":\"NodeRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"p2pId\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"uint32\",\"name\":\"nodeOperatorId\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signer\",\"type\":\"bytes32\"}],\"name\":\"NodeUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"string\",\"name\":\"labelledName\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"version\",\"type\":\"string\"},{\"internalType\":\"enumCapabilitiesRegistry.CapabilityType\",\"name\":\"capabilityType\",\"type\":\"uint8\"},{\"internalType\":\"enumCapabilitiesRegistry.CapabilityResponseType\",\"name\":\"responseType\",\"type\":\"uint8\"},{\"internalType\":\"address\",\"name\":\"configurationContract\",\"type\":\"address\"}],\"internalType\":\"structCapabilitiesRegistry.Capability[]\",\"name\":\"capabilities\",\"type\":\"tuple[]\"}],\"name\":\"addCapabilities\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32[]\",\"name\":\"nodes\",\"type\":\"bytes32[]\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"capabilityId\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"config\",\"type\":\"bytes\"}],\"internalType\":\"structCapabilitiesRegistry.CapabilityConfiguration[]\",\"name\":\"capabilityConfigurations\",\"type\":\"tuple[]\"},{\"internalType\":\"bool\",\"name\":\"isPublic\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"acceptsWorkflows\",\"type\":\"bool\"},{\"internalType\":\"uint8\",\"name\":\"f\",\"type\":\"uint8\"}],\"name\":\"addDON\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"admin\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"}],\"internalType\":\"structCapabilitiesRegistry.NodeOperator[]\",\"name\":\"nodeOperators\",\"type\":\"tuple[]\"}],\"name\":\"addNodeOperators\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint32\",\"name\":\"nodeOperatorId\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"signer\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"p2pId\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32[]\",\"name\":\"hashedCapabilityIds\",\"type\":\"bytes32[]\"}],\"internalType\":\"structCapabilitiesRegistry.NodeParams[]\",\"name\":\"nodes\",\"type\":\"tuple[]\"}],\"name\":\"addNodes\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32[]\",\"name\":\"hashedCapabilityIds\",\"type\":\"bytes32[]\"}],\"name\":\"deprecateCapabilities\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getCapabilities\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"hashedId\",\"type\":\"bytes32\"},{\"internalType\":\"string\",\"name\":\"labelledName\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"version\",\"type\":\"string\"},{\"internalType\":\"enumCapabilitiesRegistry.CapabilityType\",\"name\":\"capabilityType\",\"type\":\"uint8\"},{\"internalType\":\"enumCapabilitiesRegistry.CapabilityResponseType\",\"name\":\"responseType\",\"type\":\"uint8\"},{\"internalType\":\"address\",\"name\":\"configurationContract\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"isDeprecated\",\"type\":\"bool\"}],\"internalType\":\"structCapabilitiesRegistry.CapabilityInfo[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"hashedId\",\"type\":\"bytes32\"}],\"name\":\"getCapability\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"hashedId\",\"type\":\"bytes32\"},{\"internalType\":\"string\",\"name\":\"labelledName\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"version\",\"type\":\"string\"},{\"internalType\":\"enumCapabilitiesRegistry.CapabilityType\",\"name\":\"capabilityType\",\"type\":\"uint8\"},{\"internalType\":\"enumCapabilitiesRegistry.CapabilityResponseType\",\"name\":\"responseType\",\"type\":\"uint8\"},{\"internalType\":\"address\",\"name\":\"configurationContract\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"isDeprecated\",\"type\":\"bool\"}],\"internalType\":\"structCapabilitiesRegistry.CapabilityInfo\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"donId\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"capabilityId\",\"type\":\"bytes32\"}],\"name\":\"getCapabilityConfigs\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"donId\",\"type\":\"uint32\"}],\"name\":\"getDON\",\"outputs\":[{\"components\":[{\"internalType\":\"uint32\",\"name\":\"id\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"configCount\",\"type\":\"uint32\"},{\"internalType\":\"uint8\",\"name\":\"f\",\"type\":\"uint8\"},{\"internalType\":\"bool\",\"name\":\"isPublic\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"acceptsWorkflows\",\"type\":\"bool\"},{\"internalType\":\"bytes32[]\",\"name\":\"nodeP2PIds\",\"type\":\"bytes32[]\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"capabilityId\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"config\",\"type\":\"bytes\"}],\"internalType\":\"structCapabilitiesRegistry.CapabilityConfiguration[]\",\"name\":\"capabilityConfigurations\",\"type\":\"tuple[]\"}],\"internalType\":\"structCapabilitiesRegistry.DONInfo\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getDONs\",\"outputs\":[{\"components\":[{\"internalType\":\"uint32\",\"name\":\"id\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"configCount\",\"type\":\"uint32\"},{\"internalType\":\"uint8\",\"name\":\"f\",\"type\":\"uint8\"},{\"internalType\":\"bool\",\"name\":\"isPublic\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"acceptsWorkflows\",\"type\":\"bool\"},{\"internalType\":\"bytes32[]\",\"name\":\"nodeP2PIds\",\"type\":\"bytes32[]\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"capabilityId\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"config\",\"type\":\"bytes\"}],\"internalType\":\"structCapabilitiesRegistry.CapabilityConfiguration[]\",\"name\":\"capabilityConfigurations\",\"type\":\"tuple[]\"}],\"internalType\":\"structCapabilitiesRegistry.DONInfo[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"labelledName\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"version\",\"type\":\"string\"}],\"name\":\"getHashedCapabilityId\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"p2pId\",\"type\":\"bytes32\"}],\"name\":\"getNode\",\"outputs\":[{\"components\":[{\"internalType\":\"uint32\",\"name\":\"nodeOperatorId\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"configCount\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"workflowDONId\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"signer\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"p2pId\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32[]\",\"name\":\"hashedCapabilityIds\",\"type\":\"bytes32[]\"},{\"internalType\":\"uint256[]\",\"name\":\"capabilitiesDONIds\",\"type\":\"uint256[]\"}],\"internalType\":\"structCapabilitiesRegistry.NodeInfo\",\"name\":\"nodeInfo\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"nodeOperatorId\",\"type\":\"uint32\"}],\"name\":\"getNodeOperator\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"admin\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"}],\"internalType\":\"structCapabilitiesRegistry.NodeOperator\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getNodeOperators\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"admin\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"}],\"internalType\":\"structCapabilitiesRegistry.NodeOperator[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getNodes\",\"outputs\":[{\"components\":[{\"internalType\":\"uint32\",\"name\":\"nodeOperatorId\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"configCount\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"workflowDONId\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"signer\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"p2pId\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32[]\",\"name\":\"hashedCapabilityIds\",\"type\":\"bytes32[]\"},{\"internalType\":\"uint256[]\",\"name\":\"capabilitiesDONIds\",\"type\":\"uint256[]\"}],\"internalType\":\"structCapabilitiesRegistry.NodeInfo[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"hashedCapabilityId\",\"type\":\"bytes32\"}],\"name\":\"isCapabilityDeprecated\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32[]\",\"name\":\"donIds\",\"type\":\"uint32[]\"}],\"name\":\"removeDONs\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32[]\",\"name\":\"nodeOperatorIds\",\"type\":\"uint32[]\"}],\"name\":\"removeNodeOperators\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32[]\",\"name\":\"removedNodeP2PIds\",\"type\":\"bytes32[]\"}],\"name\":\"removeNodes\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"donId\",\"type\":\"uint32\"},{\"internalType\":\"bytes32[]\",\"name\":\"nodes\",\"type\":\"bytes32[]\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"capabilityId\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"config\",\"type\":\"bytes\"}],\"internalType\":\"structCapabilitiesRegistry.CapabilityConfiguration[]\",\"name\":\"capabilityConfigurations\",\"type\":\"tuple[]\"},{\"internalType\":\"bool\",\"name\":\"isPublic\",\"type\":\"bool\"},{\"internalType\":\"uint8\",\"name\":\"f\",\"type\":\"uint8\"}],\"name\":\"updateDON\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32[]\",\"name\":\"nodeOperatorIds\",\"type\":\"uint32[]\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"admin\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"}],\"internalType\":\"structCapabilitiesRegistry.NodeOperator[]\",\"name\":\"nodeOperators\",\"type\":\"tuple[]\"}],\"name\":\"updateNodeOperators\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint32\",\"name\":\"nodeOperatorId\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"signer\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"p2pId\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32[]\",\"name\":\"hashedCapabilityIds\",\"type\":\"bytes32[]\"}],\"internalType\":\"structCapabilitiesRegistry.NodeParams[]\",\"name\":\"nodes\",\"type\":\"tuple[]\"}],\"name\":\"updateNodes\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", + Bin: "0x6080604052600e80546001600160401b0319166401000000011790553480156200002857600080fd5b503380600081620000805760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000b357620000b381620000bc565b50505062000167565b336001600160a01b03821603620001165760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640162000077565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b61514e80620001776000396000f3fe608060405234801561001057600080fd5b50600436106101ae5760003560e01c80635d83d967116100ee57806386fa424611610097578063d8bc7b6811610071578063d8bc7b68146103f6578063ddbe4f8214610409578063e29581aa1461041e578063f2fde38b1461043357600080fd5b806386fa42461461039b5780638da5cb5b146103ae5780639cb7c5f4146103d657600080fd5b8063715f5295116100c8578063715f52951461036d57806373ac22b41461038057806379ba50971461039357600080fd5b80635d83d967146103325780635e65e3091461034557806366acaa331461035857600080fd5b8063235374051161015b5780632c01a1e8116101355780632c01a1e8146102cb578063398f3773146102de5780633f2a13c9146102f157806350c946fe1461031257600080fd5b80632353740514610285578063275459f2146102a55780632a852933146102b857600080fd5b80631d05394c1161018c5780631d05394c1461023b578063214502431461025057806322bdbcbc1461026557600080fd5b80630fe5800a146101b357806312570011146101d9578063181f5a77146101fc575b600080fd5b6101c66101c1366004613f30565b610446565b6040519081526020015b60405180910390f35b6101ec6101e7366004613f94565b61047a565b60405190151581526020016101d0565b604080518082018252601a81527f4361706162696c6974696573526567697374727920312e302e30000000000000602082015290516101d0919061401b565b61024e610249366004614073565b610487565b005b610258610694565b6040516101d091906141f5565b610278610273366004614290565b6107f1565b6040516101d091906142e8565b610298610293366004614290565b6108de565b6040516101d091906142fb565b61024e6102b3366004614073565b610922565b61024e6102c636600461432f565b6109f9565b61024e6102d9366004614073565b610ad9565b61024e6102ec366004614073565b610d75565b6103046102ff3660046143d1565b610f34565b6040516101d09291906143fb565b610325610320366004613f94565b611120565b6040516101d091906144c0565b61024e610340366004614073565b6111fa565b61024e610353366004614073565b6112ef565b610360611a17565b6040516101d091906144d3565b61024e61037b366004614073565b611bfa565b61024e61038e366004614073565b611cac565b61024e61217a565b61024e6103a9366004614548565b612277565b60005460405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101d0565b6103e96103e4366004613f94565b6125b7565b6040516101d09190614697565b61024e6104043660046146aa565b6127f2565b6104116128bc565b6040516101d09190614730565b6104266129b0565b6040516101d091906147a5565b61024e61044136600461483e565b612ab9565b6000828260405160200161045b9291906143fb565b6040516020818303038152906040528051906020012090505b92915050565b6000610474600583612acd565b61048f612ae8565b60005b8181101561068f5760008383838181106104ae576104ae614859565b90506020020160208101906104c39190614290565b63ffffffff8181166000908152600d60209081526040808320805464010000000081049095168085526001820190935290832094955093909290916a010000000000000000000090910460ff16905b61051b83612b6b565b8110156105bb57811561057157600c60006105368584612b75565b8152602081019190915260400160002080547fffffffffffffffffffffffffffffffffffffffff00000000ffffffffffffffff1690556105b3565b6105b18663ffffffff16600c60006105928588612b7590919063ffffffff16565b8152602001908152602001600020600401612b8190919063ffffffff16565b505b600101610512565b508354640100000000900463ffffffff16600003610612576040517f2b62be9b00000000000000000000000000000000000000000000000000000000815263ffffffff861660048201526024015b60405180910390fd5b63ffffffff85166000818152600d6020908152604080832080547fffffffffffffffffffffffffffffffffffffffffff0000000000000000000000169055519182527ff264aae70bf6a9d90e68e0f9b393f4e7fbea67b063b0f336e0b36c1581703651910160405180910390a25050505050806001019050610492565b505050565b600e54606090640100000000900463ffffffff1660006106b56001836148b7565b63ffffffff1667ffffffffffffffff8111156106d3576106d3613dca565b60405190808252806020026020018201604052801561075a57816020015b6040805160e081018252600080825260208083018290529282018190526060808301829052608083019190915260a0820181905260c082015282527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9092019101816106f15790505b509050600060015b8363ffffffff168163ffffffff1610156107ce5763ffffffff8082166000908152600d602052604090205416156107c65761079c81612b8d565b8383815181106107ae576107ae614859565b6020026020010181905250816107c3906148d4565b91505b600101610762565b506107da6001846148b7565b63ffffffff1681146107ea578082525b5092915050565b60408051808201909152600081526060602082015263ffffffff82166000908152600b60209081526040918290208251808401909352805473ffffffffffffffffffffffffffffffffffffffff16835260018101805491928401916108559061490c565b80601f01602080910402602001604051908101604052809291908181526020018280546108819061490c565b80156108ce5780601f106108a3576101008083540402835291602001916108ce565b820191906000526020600020905b8154815290600101906020018083116108b157829003601f168201915b5050505050815250509050919050565b6040805160e0810182526000808252602082018190529181018290526060808201839052608082019290925260a0810182905260c081019190915261047482612b8d565b61092a612ae8565b60005b63ffffffff811682111561068f57600083838363ffffffff1681811061095557610955614859565b905060200201602081019061096a9190614290565b63ffffffff81166000908152600b6020526040812080547fffffffffffffffffffffffff00000000000000000000000000000000000000001681559192506109b56001830182613d5d565b505060405163ffffffff8216907fa59268ca81d40429e65ccea5385b59cf2d3fc6519371dee92f8eb1dae5107a7a90600090a2506109f28161495f565b905061092d565b610a01612ae8565b63ffffffff8088166000908152600d60205260408120805490926401000000009091041690819003610a67576040517f2b62be9b00000000000000000000000000000000000000000000000000000000815263ffffffff8a166004820152602401610609565b610ace888888886040518060a001604052808f63ffffffff16815260200187610a8f9061495f565b63ffffffff811682528b15156020830152895460ff6a01000000000000000000009091048116151560408401528b166060909201919091529650612e58565b505050505050505050565b6000805473ffffffffffffffffffffffffffffffffffffffff163314905b82811015610d6f576000848483818110610b1357610b13614859565b602090810292909201356000818152600c90935260409092206001810154929350919050610b70576040517fd82f6adb00000000000000000000000000000000000000000000000000000000815260048101839052602401610609565b6000610b7e82600401612b6b565b1115610bd357610b916004820184612b75565b6040517f60a6d89800000000000000000000000000000000000000000000000000000000815263ffffffff909116600482015260248101839052604401610609565b805468010000000000000000900463ffffffff1615610c3b5780546040517f60b9df730000000000000000000000000000000000000000000000000000000081526801000000000000000090910463ffffffff16600482015260248101839052604401610609565b83158015610c755750805463ffffffff166000908152600b602052604090205473ffffffffffffffffffffffffffffffffffffffff163314155b15610cae576040517f9473075d000000000000000000000000000000000000000000000000000000008152336004820152602401610609565b6001810154610cbf90600790612b81565b506002810154610cd190600990612b81565b506000828152600c6020526040812080547fffffffffffffffffffffffffffffffffffffffff00000000000000000000000016815560018101829055600281018290559060048201818181610d268282613d97565b5050505050507f5254e609a97bab37b7cc79fe128f85c097bd6015c6e1624ae0ba392eb975320582604051610d5d91815260200190565b60405180910390a15050600101610af7565b50505050565b610d7d612ae8565b60005b8181101561068f576000838383818110610d9c57610d9c614859565b9050602002810190610dae9190614982565b610db7906149c0565b805190915073ffffffffffffffffffffffffffffffffffffffff16610e08576040517feeacd93900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600e54604080518082018252835173ffffffffffffffffffffffffffffffffffffffff908116825260208086015181840190815263ffffffff9095166000818152600b909252939020825181547fffffffffffffffffffffffff00000000000000000000000000000000000000001692169190911781559251919290916001820190610e949082614a7a565b5050600e8054909150600090610eaf9063ffffffff1661495f565b91906101000a81548163ffffffff021916908363ffffffff160217905550816000015173ffffffffffffffffffffffffffffffffffffffff168163ffffffff167f78e94ca80be2c30abc061b99e7eb8583b1254781734b1e3ce339abb57da2fe8e8460200151604051610f22919061401b565b60405180910390a35050600101610d80565b63ffffffff8083166000908152600d60209081526040808320805464010000000090049094168084526001909401825280832085845260030190915281208054606093849390929091610f869061490c565b80601f0160208091040260200160405190810160405280929190818152602001828054610fb29061490c565b8015610fff5780601f10610fd457610100808354040283529160200191610fff565b820191906000526020600020905b815481529060010190602001808311610fe257829003601f168201915b5050506000888152600260208190526040909120015492935060609262010000900473ffffffffffffffffffffffffffffffffffffffff16159150611112905057600086815260026020819052604091829020015490517f8318ed5d00000000000000000000000000000000000000000000000000000000815263ffffffff891660048201526201000090910473ffffffffffffffffffffffffffffffffffffffff1690638318ed5d90602401600060405180830381865afa1580156110c9573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820160405261110f9190810190614b94565b90505b9093509150505b9250929050565b6040805160e0810182526000808252602082018190529181018290526060808201839052608082019290925260a0810182905260c08101919091526040805160e0810182526000848152600c6020908152838220805463ffffffff8082168652640100000000820481168487018190526801000000000000000090920416858701526001820154606086015260028201546080860152835260030190529190912060a08201906111cf9061366f565b81526020016111f2600c600086815260200190815260200160002060040161366f565b905292915050565b611202612ae8565b60005b8181101561068f57600083838381811061122157611221614859565b90506020020135905061123e816003612acd90919063ffffffff16565b611277576040517fe181733f00000000000000000000000000000000000000000000000000000000815260048101829052602401610609565b61128260058261367c565b6112bb576040517ff7d7a29400000000000000000000000000000000000000000000000000000000815260048101829052602401610609565b60405181907fdcea1b78b6ddc31592a94607d537543fcaafda6cc52d6d5cc7bbfca1422baf2190600090a250600101611205565b6000805473ffffffffffffffffffffffffffffffffffffffff163314905b82811015610d6f57600084848381811061132957611329614859565b905060200281019061133b9190614c02565b61134490614c36565b6040808201516000908152600c6020908152828220805463ffffffff168352600b82528383208451808601909552805473ffffffffffffffffffffffffffffffffffffffff16855260018101805496975091959394939092840191906113a99061490c565b80601f01602080910402602001604051908101604052809291908181526020018280546113d59061490c565b80156114225780601f106113f757610100808354040283529160200191611422565b820191906000526020600020905b81548152906001019060200180831161140557829003601f168201915b5050509190925250505060018301549091506114725782604001516040517fd82f6adb00000000000000000000000000000000000000000000000000000000815260040161060991815260200190565b841580156114975750805173ffffffffffffffffffffffffffffffffffffffff163314155b156114d0576040517f9473075d000000000000000000000000000000000000000000000000000000008152336004820152602401610609565b602083015161150b576040517f8377314600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60018201546020840151811461158c57602084015161152c90600790612acd565b15611563576040517f8377314600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60208401516001840155611578600782612b81565b50602084015161158a9060079061367c565b505b606084015180516000036115ce57806040517f3748d4c60000000000000000000000000000000000000000000000000000000081526004016106099190614d09565b835460009085906004906115ef90640100000000900463ffffffff1661495f565b91906101000a81548163ffffffff021916908363ffffffff1602179055905060005b82518110156116d45761164783828151811061162f5761162f614859565b60200260200101516003612acd90919063ffffffff16565b61167f57826040517f3748d4c60000000000000000000000000000000000000000000000000000000081526004016106099190614d09565b6116cb83828151811061169457611694614859565b60200260200101518760030160008563ffffffff1663ffffffff16815260200190815260200160002061367c90919063ffffffff16565b50600101611611565b50845468010000000000000000900463ffffffff1680156118355763ffffffff8082166000908152600d60209081526040808320805464010000000090049094168352600190930181528282206002018054845181840281018401909552808552929392909183018282801561176957602002820191906000526020600020905b815481526020019060010190808311611755575b5050505050905060005b8151811015611832576117c882828151811061179157611791614859565b60200260200101518960030160008763ffffffff1663ffffffff168152602001908152602001600020612acd90919063ffffffff16565b61182a578181815181106117de576117de614859565b6020026020010151836040517f03dcd86200000000000000000000000000000000000000000000000000000000815260040161060992919091825263ffffffff16602082015260400190565b600101611773565b50505b60006118438760040161366f565b905060005b81518163ffffffff161015611989576000828263ffffffff168151811061187157611871614859565b60209081029190910181015163ffffffff8082166000908152600d845260408082208054640100000000900490931682526001909201845281812060020180548351818702810187019094528084529395509093919290918301828280156118f857602002820191906000526020600020905b8154815260200190600101908083116118e4575b5050505050905060005b81518110156119755761195782828151811061192057611920614859565b60200260200101518c60030160008a63ffffffff1663ffffffff168152602001908152602001600020612acd90919063ffffffff16565b61196d578181815181106117de576117de614859565b600101611902565b505050806119829061495f565b9050611848565b50875187547fffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000001663ffffffff90911690811788556040808a015160028a018190556020808c01518351928352908201527f4b5b465e22eea0c3d40c30e936643245b80d19b2dcf75788c0699fe8d8db645b910160405180910390a2505050505050505080600101905061130d565b600e5460609063ffffffff166000611a306001836148b7565b63ffffffff1667ffffffffffffffff811115611a4e57611a4e613dca565b604051908082528060200260200182016040528015611a9457816020015b604080518082019091526000815260606020820152815260200190600190039081611a6c5790505b509050600060015b8363ffffffff168163ffffffff161015611be45763ffffffff81166000908152600b602052604090205473ffffffffffffffffffffffffffffffffffffffff1615611bdc5763ffffffff81166000908152600b60209081526040918290208251808401909352805473ffffffffffffffffffffffffffffffffffffffff1683526001810180549192840191611b309061490c565b80601f0160208091040260200160405190810160405280929190818152602001828054611b5c9061490c565b8015611ba95780601f10611b7e57610100808354040283529160200191611ba9565b820191906000526020600020905b815481529060010190602001808311611b8c57829003601f168201915b505050505081525050838381518110611bc457611bc4614859565b602002602001018190525081611bd9906148d4565b91505b600101611a9c565b50600e546107da9060019063ffffffff166148b7565b611c02612ae8565b60005b8181101561068f576000838383818110611c2157611c21614859565b9050602002810190611c339190614d4d565b611c3c90614d90565b90506000611c5282600001518360200151610446565b9050611c5f60038261367c565b611c98576040517febf5255100000000000000000000000000000000000000000000000000000000815260048101829052602401610609565b611ca28183613688565b5050600101611c05565b6000805473ffffffffffffffffffffffffffffffffffffffff163314905b82811015610d6f576000848483818110611ce657611ce6614859565b9050602002810190611cf89190614c02565b611d0190614c36565b805163ffffffff166000908152600b602090815260408083208151808301909252805473ffffffffffffffffffffffffffffffffffffffff168252600181018054959650939491939092840191611d579061490c565b80601f0160208091040260200160405190810160405280929190818152602001828054611d839061490c565b8015611dd05780601f10611da557610100808354040283529160200191611dd0565b820191906000526020600020905b815481529060010190602001808311611db357829003601f168201915b50505091909252505081519192505073ffffffffffffffffffffffffffffffffffffffff16611e365781516040517fadd9ae1e00000000000000000000000000000000000000000000000000000000815263ffffffff9091166004820152602401610609565b83158015611e5b5750805173ffffffffffffffffffffffffffffffffffffffff163314155b15611e94576040517f9473075d000000000000000000000000000000000000000000000000000000008152336004820152602401610609565b6040808301516000908152600c60205220600181015415611ee95782604001516040517f5461848300000000000000000000000000000000000000000000000000000000815260040161060991815260200190565b6040830151611f2c5782604001516040517f64e2ee9200000000000000000000000000000000000000000000000000000000815260040161060991815260200190565b60208301511580611f4957506020830151611f4990600790612acd565b15611f80576040517f8377314600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60608301518051600003611fc257806040517f3748d4c60000000000000000000000000000000000000000000000000000000081526004016106099190614d09565b81548290600490611fe090640100000000900463ffffffff1661495f565b82546101009290920a63ffffffff818102199093169183160217909155825464010000000090041660005b82518110156120b65761202983828151811061162f5761162f614859565b61206157826040517f3748d4c60000000000000000000000000000000000000000000000000000000081526004016106099190614d09565b6120ad83828151811061207657612076614859565b60200260200101518560030160008563ffffffff1663ffffffff16815260200190815260200160002061367c90919063ffffffff16565b5060010161200b565b50845183547fffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000001663ffffffff9182161784556040860151600285015560208601516001850181905561210c916007919061367c16565b50604085015161211e9060099061367c565b50845160408087015160208089015183519283529082015263ffffffff909216917f74becb12a5e8fd0e98077d02dfba8f647c9670c9df177e42c2418cf17a636f05910160405180910390a25050505050806001019050611cca565b60015473ffffffffffffffffffffffffffffffffffffffff1633146121fb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e6572000000000000000000006044820152606401610609565b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b8281146122ba576040517fab8b67c60000000000000000000000000000000000000000000000000000000081526004810184905260248101829052604401610609565b6000805473ffffffffffffffffffffffffffffffffffffffff16905b848110156125af5760008686838181106122f2576122f2614859565b90506020020160208101906123079190614290565b63ffffffff81166000908152600b6020526040902080549192509073ffffffffffffffffffffffffffffffffffffffff16612376576040517fadd9ae1e00000000000000000000000000000000000000000000000000000000815263ffffffff83166004820152602401610609565b600086868581811061238a5761238a614859565b905060200281019061239c9190614982565b6123a5906149c0565b805190915073ffffffffffffffffffffffffffffffffffffffff166123f6576040517feeacd93900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b815473ffffffffffffffffffffffffffffffffffffffff16331480159061243357503373ffffffffffffffffffffffffffffffffffffffff861614155b1561246c576040517f9473075d000000000000000000000000000000000000000000000000000000008152336004820152602401610609565b8051825473ffffffffffffffffffffffffffffffffffffffff90811691161415806124e857506020808201516040516124a5920161401b565b60405160208183030381529060405280519060200120826001016040516020016124cf9190614e36565b6040516020818303038152906040528051906020012014155b156125a157805182547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff909116178255602081015160018301906125429082614a7a565b50806000015173ffffffffffffffffffffffffffffffffffffffff168363ffffffff167f86f41145bde5dd7f523305452e4aad3685508c181432ec733d5f345009358a288360200151604051612598919061401b565b60405180910390a35b5050508060010190506122d6565b505050505050565b6125f86040805160e0810182526000808252606060208301819052928201839052909182019081526020016000815260006020820181905260409091015290565b6040805160e081018252838152600084815260026020908152929020805491928301916126249061490c565b80601f01602080910402602001604051908101604052809291908181526020018280546126509061490c565b801561269d5780601f106126725761010080835404028352916020019161269d565b820191906000526020600020905b81548152906001019060200180831161268057829003601f168201915b505050505081526020016002600085815260200190815260200160002060010180546126c89061490c565b80601f01602080910402602001604051908101604052809291908181526020018280546126f49061490c565b80156127415780601f1061271657610100808354040283529160200191612741565b820191906000526020600020905b81548152906001019060200180831161272457829003601f168201915b50505091835250506000848152600260208181526040909220015491019060ff166003811115612773576127736145b4565b815260008481526002602081815260409092200154910190610100900460ff1660018111156127a4576127a46145b4565b81526000848152600260208181526040928390209091015462010000900473ffffffffffffffffffffffffffffffffffffffff1690830152016127e8600585612acd565b1515905292915050565b6127fa612ae8565b600e805460009164010000000090910463ffffffff1690600461281c8361495f565b82546101009290920a63ffffffff81810219909316918316021790915581166000818152600d602090815260409182902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000001684179055815160a08101835292835260019083015286151590820152841515606082015260ff841660808201529091506128b2908990899089908990612e58565b5050505050505050565b606060006128ca600361366f565b90506000815167ffffffffffffffff8111156128e8576128e8613dca565b60405190808252806020026020018201604052801561295a57816020015b6129476040805160e0810182526000808252606060208301819052928201839052909182019081526020016000815260006020820181905260409091015290565b8152602001906001900390816129065790505b50905060005b82518110156107ea5761298b83828151811061297e5761297e614859565b60200260200101516125b7565b82828151811061299d5761299d614859565b6020908102919091010152600101612960565b606060006129be600961366f565b90506000815167ffffffffffffffff8111156129dc576129dc613dca565b604051908082528060200260200182016040528015612a6357816020015b6040805160e081018252600080825260208083018290529282018190526060808301829052608083019190915260a0820181905260c082015282527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9092019101816129fa5790505b50905060005b82518110156107ea57612a94838281518110612a8757612a87614859565b6020026020010151611120565b828281518110612aa657612aa6614859565b6020908102919091010152600101612a69565b612ac1612ae8565b612aca81613870565b50565b600081815260018301602052604081205415155b9392505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314612b69576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e6572000000000000000000006044820152606401610609565b565b6000610474825490565b6000612ae18383613965565b6000612ae1838361398f565b6040805160e0810182526000808252602080830182905282840182905260608084018390526080840183905260a0840181905260c084015263ffffffff8581168352600d8252848320805464010000000090049091168084526001909101825284832060028101805487518186028101860190985280885295969295919493909190830182828015612c3e57602002820191906000526020600020905b815481526020019060010190808311612c2a575b505050505090506000815167ffffffffffffffff811115612c6157612c61613dca565b604051908082528060200260200182016040528015612ca757816020015b604080518082019091526000815260606020820152815260200190600190039081612c7f5790505b50905060005b8151811015612dbf576040518060400160405280848381518110612cd357612cd3614859565b60200260200101518152602001856003016000868581518110612cf857612cf8614859565b602002602001015181526020019081526020016000208054612d199061490c565b80601f0160208091040260200160405190810160405280929190818152602001828054612d459061490c565b8015612d925780601f10612d6757610100808354040283529160200191612d92565b820191906000526020600020905b815481529060010190602001808311612d7557829003601f168201915b5050505050815250828281518110612dac57612dac614859565b6020908102919091010152600101612cad565b506040805160e08101825263ffffffff8089166000818152600d6020818152868320548086168752948b168187015260ff680100000000000000008604811697870197909752690100000000000000000085048716151560608701529290915290526a010000000000000000000090049091161515608082015260a08101612e468561366f565b81526020019190915295945050505050565b805163ffffffff9081166000908152600d602090815260408083208286015190941683526001909301905220608082015160ff161580612eaa575060808201518590612ea5906001614ee4565b60ff16115b15612ef35760808201516040517f25b4d61800000000000000000000000000000000000000000000000000000000815260ff909116600482015260248101869052604401610609565b6001826020015163ffffffff161115612fdb57815163ffffffff166000908152600d602090815260408220908401516001918201918391612f3491906148b7565b63ffffffff1663ffffffff168152602001908152602001600020905060005b612f5c82612b6b565b811015612fd857612f8b846000015163ffffffff16600c60006105928587600001612b7590919063ffffffff16565b50600c6000612f9a8484612b75565b8152602081019190915260400160002080547fffffffffffffffffffffffffffffffffffffffff00000000ffffffffffffffff169055600101612f53565b50505b60005b858110156132155761300b878783818110612ffb57612ffb614859565b859260209091020135905061367c565b61306c57825187878381811061302357613023614859565b6040517f636e405700000000000000000000000000000000000000000000000000000000815263ffffffff90941660048501526020029190910135602483015250604401610609565b8260600151156131c357825163ffffffff16600c600089898581811061309457613094614859565b602090810292909201358352508101919091526040016000205468010000000000000000900463ffffffff161480159061310e5750600c60008888848181106130df576130df614859565b602090810292909201358352508101919091526040016000205468010000000000000000900463ffffffff1615155b1561317057825187878381811061312757613127614859565b6040517f60b9df7300000000000000000000000000000000000000000000000000000000815263ffffffff90941660048501526020029190910135602483015250604401610609565b8251600c600089898581811061318857613188614859565b90506020020135815260200190815260200160002060000160086101000a81548163ffffffff021916908363ffffffff16021790555061320d565b825161320b9063ffffffff16600c60008a8a868181106131e5576131e5614859565b90506020020135815260200190815260200160002060040161367c90919063ffffffff16565b505b600101612fde565b5060005b83811015613623573685858381811061323457613234614859565b90506020028101906132469190614982565b905061325460038235612acd565b61328d576040517fe181733f00000000000000000000000000000000000000000000000000000000815281356004820152602401610609565b61329960058235612acd565b156132d3576040517ff7d7a29400000000000000000000000000000000000000000000000000000000815281356004820152602401610609565b80356000908152600384016020526040812080546132f09061490c565b9050111561333c5783516040517f3927d08000000000000000000000000000000000000000000000000000000000815263ffffffff909116600482015281356024820152604401610609565b60005b87811015613446576133e38235600c60008c8c8681811061336257613362614859565b9050602002013581526020019081526020016000206003016000600c60008e8e8881811061339257613392614859565b90506020020135815260200190815260200160002060000160049054906101000a900463ffffffff1663ffffffff1663ffffffff168152602001908152602001600020612acd90919063ffffffff16565b61343e578888828181106133f9576133f9614859565b6040517fa7e792500000000000000000000000000000000000000000000000000000000081526020909102929092013560048301525082356024820152604401610609565b60010161333f565b506002830180546001810182556000918252602091829020833591015561346f90820182614efd565b8235600090815260038601602052604090209161348d919083614f62565b50604080850151855163ffffffff9081166000908152600d602090815284822080549415156901000000000000000000027fffffffffffffffffffffffffffffffffffffffffffff00ffffffffffffffffff90951694909417909355606088015188518316825284822080549115156a0100000000000000000000027fffffffffffffffffffffffffffffffffffffffffff00ffffffffffffffffffff9092169190911790556080880151885183168252848220805460ff9290921668010000000000000000027fffffffffffffffffffffffffffffffffffffffffffffff00ffffffffffffffff909216919091179055828801805189518416835294909120805494909216640100000000027fffffffffffffffffffffffffffffffffffffffffffffffff00000000ffffffff9094169390931790558551915161361a92918435908c908c906135e090880188614efd565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250613a8292505050565b50600101613219565b50815160208084015160405163ffffffff91821681529216917ff264aae70bf6a9d90e68e0f9b393f4e7fbea67b063b0f336e0b36c1581703651910160405180910390a2505050505050565b60606000612ae183613b63565b6000612ae18383613bbf565b608081015173ffffffffffffffffffffffffffffffffffffffff161561372a576136d681608001517f78bea72100000000000000000000000000000000000000000000000000000000613c0e565b61372a5760808101516040517fabb5e3fd00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9091166004820152602401610609565b6000828152600260205260409020815182919081906137499082614a7a565b506020820151600182019061375e9082614a7a565b5060408201516002820180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660018360038111156137a0576137a06145b4565b021790555060608201516002820180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101008360018111156137e7576137e76145b4565b0217905550608091909101516002909101805473ffffffffffffffffffffffffffffffffffffffff90921662010000027fffffffffffffffffffff0000000000000000000000000000000000000000ffff90921691909117905560405182907f04f0a9bcf3f3a3b42a4d7ca081119755f82ebe43e0d30c8f7292c4fe0dc4a2ae90600090a25050565b3373ffffffffffffffffffffffffffffffffffffffff8216036138ef576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c660000000000000000006044820152606401610609565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b600082600001828154811061397c5761397c614859565b9060005260206000200154905092915050565b60008181526001830160205260408120548015613a785760006139b360018361507d565b85549091506000906139c79060019061507d565b9050818114613a2c5760008660000182815481106139e7576139e7614859565b9060005260206000200154905080876000018481548110613a0a57613a0a614859565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080613a3d57613a3d615090565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610474565b6000915050610474565b6000848152600260208190526040909120015462010000900473ffffffffffffffffffffffffffffffffffffffff16156125af57600084815260026020819052604091829020015490517ffba64a7c0000000000000000000000000000000000000000000000000000000081526201000090910473ffffffffffffffffffffffffffffffffffffffff169063fba64a7c90613b29908690869086908b908d906004016150bf565b600060405180830381600087803b158015613b4357600080fd5b505af1158015613b57573d6000803e3d6000fd5b50505050505050505050565b606081600001805480602002602001604051908101604052809291908181526020018280548015613bb357602002820191906000526020600020905b815481526020019060010190808311613b9f575b50505050509050919050565b6000818152600183016020526040812054613c0657508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610474565b506000610474565b6000613c1983613c2a565b8015612ae15750612ae18383613c8e565b6000613c56827f01ffc9a700000000000000000000000000000000000000000000000000000000613c8e565b80156104745750613c87827fffffffff00000000000000000000000000000000000000000000000000000000613c8e565b1592915050565b604080517fffffffff000000000000000000000000000000000000000000000000000000008316602480830191909152825180830390910181526044909101909152602080820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f01ffc9a700000000000000000000000000000000000000000000000000000000178152825160009392849283928392918391908a617530fa92503d91506000519050828015613d46575060208210155b8015613d525750600081115b979650505050505050565b508054613d699061490c565b6000825580601f10613d79575050565b601f016020900490600052602060002090810190612aca9190613db1565b5080546000825590600052602060002090810190612aca91905b5b80821115613dc65760008155600101613db2565b5090565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040516080810167ffffffffffffffff81118282101715613e1c57613e1c613dca565b60405290565b60405160a0810167ffffffffffffffff81118282101715613e1c57613e1c613dca565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715613e8c57613e8c613dca565b604052919050565b600067ffffffffffffffff821115613eae57613eae613dca565b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b600082601f830112613eeb57600080fd5b8135613efe613ef982613e94565b613e45565b818152846020838601011115613f1357600080fd5b816020850160208301376000918101602001919091529392505050565b60008060408385031215613f4357600080fd5b823567ffffffffffffffff80821115613f5b57600080fd5b613f6786838701613eda565b93506020850135915080821115613f7d57600080fd5b50613f8a85828601613eda565b9150509250929050565b600060208284031215613fa657600080fd5b5035919050565b60005b83811015613fc8578181015183820152602001613fb0565b50506000910152565b60008151808452613fe9816020860160208601613fad565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b602081526000612ae16020830184613fd1565b60008083601f84011261404057600080fd5b50813567ffffffffffffffff81111561405857600080fd5b6020830191508360208260051b850101111561111957600080fd5b6000806020838503121561408657600080fd5b823567ffffffffffffffff81111561409d57600080fd5b6140a98582860161402e565b90969095509350505050565b60008151808452602080850194506020840160005b838110156140e6578151875295820195908201906001016140ca565b509495945050505050565b600082825180855260208086019550808260051b84010181860160005b8481101561416e578583037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0018952815180518452840151604085850181905261415a81860183613fd1565b9a86019a945050509083019060010161410e565b5090979650505050505050565b600063ffffffff8083511684528060208401511660208501525060ff604083015116604084015260608201511515606084015260808201511515608084015260a082015160e060a08501526141d360e08501826140b5565b905060c083015184820360c08601526141ec82826140f1565b95945050505050565b600060208083016020845280855180835260408601915060408160051b87010192506020870160005b8281101561426a577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc088860301845261425885835161417b565b9450928501929085019060010161421e565b5092979650505050505050565b803563ffffffff8116811461428b57600080fd5b919050565b6000602082840312156142a257600080fd5b612ae182614277565b73ffffffffffffffffffffffffffffffffffffffff815116825260006020820151604060208501526142e06040850182613fd1565b949350505050565b602081526000612ae160208301846142ab565b602081526000612ae1602083018461417b565b8035801515811461428b57600080fd5b803560ff8116811461428b57600080fd5b600080600080600080600060a0888a03121561434a57600080fd5b61435388614277565b9650602088013567ffffffffffffffff8082111561437057600080fd5b61437c8b838c0161402e565b909850965060408a013591508082111561439557600080fd5b506143a28a828b0161402e565b90955093506143b590506060890161430e565b91506143c36080890161431e565b905092959891949750929550565b600080604083850312156143e457600080fd5b6143ed83614277565b946020939093013593505050565b60408152600061440e6040830185613fd1565b82810360208401526141ec8185613fd1565b600063ffffffff808351168452602081818501511681860152816040850151166040860152606084015160608601526080840151608086015260a0840151915060e060a086015261447460e08601836140b5565b60c08581015187830391880191909152805180835290830193506000918301905b808310156144b55784518252938301936001929092019190830190614495565b509695505050505050565b602081526000612ae16020830184614420565b600060208083016020845280855180835260408601915060408160051b87010192506020870160005b8281101561426a577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc08886030184526145368583516142ab565b945092850192908501906001016144fc565b6000806000806040858703121561455e57600080fd5b843567ffffffffffffffff8082111561457657600080fd5b6145828883890161402e565b9096509450602087013591508082111561459b57600080fd5b506145a88782880161402e565b95989497509550505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b805182526000602082015160e0602085015261460260e0850182613fd1565b90506040830151848203604086015261461b8282613fd1565b915050606083015160048110614633576146336145b4565b606085015260808301516002811061464d5761464d6145b4565b8060808601525060a083015161467b60a086018273ffffffffffffffffffffffffffffffffffffffff169052565b5060c083015161468f60c086018215159052565b509392505050565b602081526000612ae160208301846145e3565b600080600080600080600060a0888a0312156146c557600080fd5b873567ffffffffffffffff808211156146dd57600080fd5b6146e98b838c0161402e565b909950975060208a013591508082111561470257600080fd5b5061470f8a828b0161402e565b909650945061472290506040890161430e565b92506143b56060890161430e565b600060208083016020845280855180835260408601915060408160051b87010192506020870160005b8281101561426a577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc08886030184526147938583516145e3565b94509285019290850190600101614759565b600060208083016020845280855180835260408601915060408160051b87010192506020870160005b8281101561426a577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0888603018452614808858351614420565b945092850192908501906001016147ce565b803573ffffffffffffffffffffffffffffffffffffffff8116811461428b57600080fd5b60006020828403121561485057600080fd5b612ae18261481a565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b63ffffffff8281168282160390808211156107ea576107ea614888565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361490557614905614888565b5060010190565b600181811c9082168061492057607f821691505b602082108103614959577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b600063ffffffff80831681810361497857614978614888565b6001019392505050565b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc18336030181126149b657600080fd5b9190910192915050565b6000604082360312156149d257600080fd5b6040516040810167ffffffffffffffff82821081831117156149f6576149f6613dca565b81604052614a038561481a565b83526020850135915080821115614a1957600080fd5b50614a2636828601613eda565b60208301525092915050565b601f82111561068f576000816000526020600020601f850160051c81016020861015614a5b5750805b601f850160051c820191505b818110156125af57828155600101614a67565b815167ffffffffffffffff811115614a9457614a94613dca565b614aa881614aa2845461490c565b84614a32565b602080601f831160018114614afb5760008415614ac55750858301515b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600386901b1c1916600185901b1785556125af565b6000858152602081207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08616915b82811015614b4857888601518255948401946001909101908401614b29565b5085821015614b8457878501517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600388901b60f8161c191681555b5050505050600190811b01905550565b600060208284031215614ba657600080fd5b815167ffffffffffffffff811115614bbd57600080fd5b8201601f81018413614bce57600080fd5b8051614bdc613ef982613e94565b818152856020838501011115614bf157600080fd5b6141ec826020830160208601613fad565b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff818336030181126149b657600080fd5b600060808236031215614c4857600080fd5b614c50613df9565b614c5983614277565b81526020808401358183015260408401356040830152606084013567ffffffffffffffff80821115614c8a57600080fd5b9085019036601f830112614c9d57600080fd5b813581811115614caf57614caf613dca565b8060051b9150614cc0848301613e45565b8181529183018401918481019036841115614cda57600080fd5b938501935b83851015614cf857843582529385019390850190614cdf565b606087015250939695505050505050565b6020808252825182820181905260009190848201906040850190845b81811015614d4157835183529284019291840191600101614d25565b50909695505050505050565b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff618336030181126149b657600080fd5b80356002811061428b57600080fd5b600060a08236031215614da257600080fd5b614daa613e22565b823567ffffffffffffffff80821115614dc257600080fd5b614dce36838701613eda565b83526020850135915080821115614de457600080fd5b50614df136828601613eda565b602083015250604083013560048110614e0957600080fd5b6040820152614e1a60608401614d81565b6060820152614e2b6080840161481a565b608082015292915050565b6000602080835260008454614e4a8161490c565b8060208701526040600180841660008114614e6c5760018114614ea657614ed6565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00851660408a0152604084151560051b8a01019550614ed6565b89600052602060002060005b85811015614ecd5781548b8201860152908301908801614eb2565b8a016040019650505b509398975050505050505050565b60ff818116838216019081111561047457610474614888565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112614f3257600080fd5b83018035915067ffffffffffffffff821115614f4d57600080fd5b60200191503681900382131561111957600080fd5b67ffffffffffffffff831115614f7a57614f7a613dca565b614f8e83614f88835461490c565b83614a32565b6000601f841160018114614fe05760008515614faa5750838201355b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600387901b1c1916600186901b178355615076565b6000838152602090207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0861690835b8281101561502f578685013582556020948501946001909201910161500f565b508682101561506a577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60f88860031b161c19848701351681555b505060018560011b0183555b5050505050565b8181038181111561047457610474614888565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b6080815284608082015260007f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8611156150f857600080fd5b8560051b808860a0850137820182810360a0908101602085015261511e90820187613fd1565b91505063ffffffff8085166040840152808416606084015250969550505050505056fea164736f6c6343000818000a", } var CapabilitiesRegistryABI = CapabilitiesRegistryMetaData.ABI @@ -633,16 +633,16 @@ func (_CapabilitiesRegistry *CapabilitiesRegistryTransactorSession) TransferOwne return _CapabilitiesRegistry.Contract.TransferOwnership(&_CapabilitiesRegistry.TransactOpts, to) } -func (_CapabilitiesRegistry *CapabilitiesRegistryTransactor) UpdateDON(opts *bind.TransactOpts, donId uint32, nodes [][32]byte, capabilityConfigurations []CapabilitiesRegistryCapabilityConfiguration, isPublic bool, acceptsWorkflows bool, f uint8) (*types.Transaction, error) { - return _CapabilitiesRegistry.contract.Transact(opts, "updateDON", donId, nodes, capabilityConfigurations, isPublic, acceptsWorkflows, f) +func (_CapabilitiesRegistry *CapabilitiesRegistryTransactor) UpdateDON(opts *bind.TransactOpts, donId uint32, nodes [][32]byte, capabilityConfigurations []CapabilitiesRegistryCapabilityConfiguration, isPublic bool, f uint8) (*types.Transaction, error) { + return _CapabilitiesRegistry.contract.Transact(opts, "updateDON", donId, nodes, capabilityConfigurations, isPublic, f) } -func (_CapabilitiesRegistry *CapabilitiesRegistrySession) UpdateDON(donId uint32, nodes [][32]byte, capabilityConfigurations []CapabilitiesRegistryCapabilityConfiguration, isPublic bool, acceptsWorkflows bool, f uint8) (*types.Transaction, error) { - return _CapabilitiesRegistry.Contract.UpdateDON(&_CapabilitiesRegistry.TransactOpts, donId, nodes, capabilityConfigurations, isPublic, acceptsWorkflows, f) +func (_CapabilitiesRegistry *CapabilitiesRegistrySession) UpdateDON(donId uint32, nodes [][32]byte, capabilityConfigurations []CapabilitiesRegistryCapabilityConfiguration, isPublic bool, f uint8) (*types.Transaction, error) { + return _CapabilitiesRegistry.Contract.UpdateDON(&_CapabilitiesRegistry.TransactOpts, donId, nodes, capabilityConfigurations, isPublic, f) } -func (_CapabilitiesRegistry *CapabilitiesRegistryTransactorSession) UpdateDON(donId uint32, nodes [][32]byte, capabilityConfigurations []CapabilitiesRegistryCapabilityConfiguration, isPublic bool, acceptsWorkflows bool, f uint8) (*types.Transaction, error) { - return _CapabilitiesRegistry.Contract.UpdateDON(&_CapabilitiesRegistry.TransactOpts, donId, nodes, capabilityConfigurations, isPublic, acceptsWorkflows, f) +func (_CapabilitiesRegistry *CapabilitiesRegistryTransactorSession) UpdateDON(donId uint32, nodes [][32]byte, capabilityConfigurations []CapabilitiesRegistryCapabilityConfiguration, isPublic bool, f uint8) (*types.Transaction, error) { + return _CapabilitiesRegistry.Contract.UpdateDON(&_CapabilitiesRegistry.TransactOpts, donId, nodes, capabilityConfigurations, isPublic, f) } func (_CapabilitiesRegistry *CapabilitiesRegistryTransactor) UpdateNodeOperators(opts *bind.TransactOpts, nodeOperatorIds []uint32, nodeOperators []CapabilitiesRegistryNodeOperator) (*types.Transaction, error) { @@ -989,18 +989,28 @@ type CapabilitiesRegistryConfigSet struct { Raw types.Log } -func (_CapabilitiesRegistry *CapabilitiesRegistryFilterer) FilterConfigSet(opts *bind.FilterOpts) (*CapabilitiesRegistryConfigSetIterator, error) { +func (_CapabilitiesRegistry *CapabilitiesRegistryFilterer) FilterConfigSet(opts *bind.FilterOpts, donId []uint32) (*CapabilitiesRegistryConfigSetIterator, error) { - logs, sub, err := _CapabilitiesRegistry.contract.FilterLogs(opts, "ConfigSet") + var donIdRule []interface{} + for _, donIdItem := range donId { + donIdRule = append(donIdRule, donIdItem) + } + + logs, sub, err := _CapabilitiesRegistry.contract.FilterLogs(opts, "ConfigSet", donIdRule) if err != nil { return nil, err } return &CapabilitiesRegistryConfigSetIterator{contract: _CapabilitiesRegistry.contract, event: "ConfigSet", logs: logs, sub: sub}, nil } -func (_CapabilitiesRegistry *CapabilitiesRegistryFilterer) WatchConfigSet(opts *bind.WatchOpts, sink chan<- *CapabilitiesRegistryConfigSet) (event.Subscription, error) { +func (_CapabilitiesRegistry *CapabilitiesRegistryFilterer) WatchConfigSet(opts *bind.WatchOpts, sink chan<- *CapabilitiesRegistryConfigSet, donId []uint32) (event.Subscription, error) { + + var donIdRule []interface{} + for _, donIdItem := range donId { + donIdRule = append(donIdRule, donIdItem) + } - logs, sub, err := _CapabilitiesRegistry.contract.WatchLogs(opts, "ConfigSet") + logs, sub, err := _CapabilitiesRegistry.contract.WatchLogs(opts, "ConfigSet", donIdRule) if err != nil { return nil, err } @@ -2214,7 +2224,7 @@ type CapabilitiesRegistryInterface interface { TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) - UpdateDON(opts *bind.TransactOpts, donId uint32, nodes [][32]byte, capabilityConfigurations []CapabilitiesRegistryCapabilityConfiguration, isPublic bool, acceptsWorkflows bool, f uint8) (*types.Transaction, error) + UpdateDON(opts *bind.TransactOpts, donId uint32, nodes [][32]byte, capabilityConfigurations []CapabilitiesRegistryCapabilityConfiguration, isPublic bool, f uint8) (*types.Transaction, error) UpdateNodeOperators(opts *bind.TransactOpts, nodeOperatorIds []uint32, nodeOperators []CapabilitiesRegistryNodeOperator) (*types.Transaction, error) @@ -2232,9 +2242,9 @@ type CapabilitiesRegistryInterface interface { ParseCapabilityDeprecated(log types.Log) (*CapabilitiesRegistryCapabilityDeprecated, error) - FilterConfigSet(opts *bind.FilterOpts) (*CapabilitiesRegistryConfigSetIterator, error) + FilterConfigSet(opts *bind.FilterOpts, donId []uint32) (*CapabilitiesRegistryConfigSetIterator, error) - WatchConfigSet(opts *bind.WatchOpts, sink chan<- *CapabilitiesRegistryConfigSet) (event.Subscription, error) + WatchConfigSet(opts *bind.WatchOpts, sink chan<- *CapabilitiesRegistryConfigSet, donId []uint32) (event.Subscription, error) ParseConfigSet(log types.Log) (*CapabilitiesRegistryConfigSet, error) diff --git a/core/gethwrappers/keystone/generated/feeds_consumer/feeds_consumer.go b/core/gethwrappers/keystone/generated/feeds_consumer/feeds_consumer.go new file mode 100644 index 00000000000..8b618fbddb5 --- /dev/null +++ b/core/gethwrappers/keystone/generated/feeds_consumer/feeds_consumer.go @@ -0,0 +1,756 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package feeds_consumer + +import ( + "errors" + "fmt" + "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" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" +) + +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +var KeystoneFeedsConsumerMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"UnauthorizedSender\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes10\",\"name\":\"workflowName\",\"type\":\"bytes10\"}],\"name\":\"UnauthorizedWorkflowName\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"workflowOwner\",\"type\":\"address\"}],\"name\":\"UnauthorizedWorkflowOwner\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"feedId\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint224\",\"name\":\"price\",\"type\":\"uint224\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"}],\"name\":\"FeedReceived\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"feedId\",\"type\":\"bytes32\"}],\"name\":\"getPrice\",\"outputs\":[{\"internalType\":\"uint224\",\"name\":\"\",\"type\":\"uint224\"},{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"metadata\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"rawReport\",\"type\":\"bytes\"}],\"name\":\"onReport\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"_allowedSendersList\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"_allowedWorkflowOwnersList\",\"type\":\"address[]\"},{\"internalType\":\"bytes10[]\",\"name\":\"_allowedWorkflowNamesList\",\"type\":\"bytes10[]\"}],\"name\":\"setConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", + Bin: "0x608060405234801561001057600080fd5b5033806000816100675760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615610097576100978161009f565b505050610148565b336001600160a01b038216036100f75760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640161005e565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b6112d8806101576000396000f3fe608060405234801561001057600080fd5b506004361061007d5760003560e01c8063805f21321161005b578063805f2132146101695780638da5cb5b1461017c578063e3401711146101a4578063f2fde38b146101b757600080fd5b806301ffc9a71461008257806331d98b3f146100aa57806379ba50971461015f575b600080fd5b610095610090366004610e2b565b6101ca565b60405190151581526020015b60405180910390f35b6101266100b8366004610e74565b6000908152600260209081526040918290208251808401909352547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff81168084527c010000000000000000000000000000000000000000000000000000000090910463ffffffff169290910182905291565b604080517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff909316835263ffffffff9091166020830152016100a1565b610167610263565b005b610167610177366004610ed6565b610365565b60005460405173ffffffffffffffffffffffffffffffffffffffff90911681526020016100a1565b6101676101b2366004610f87565b6106e4565b6101676101c5366004611021565b610b24565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f805f213200000000000000000000000000000000000000000000000000000000148061025d57507fffffffff0000000000000000000000000000000000000000000000000000000082167f01ffc9a700000000000000000000000000000000000000000000000000000000145b92915050565b60015473ffffffffffffffffffffffffffffffffffffffff1633146102e9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e65720000000000000000000060448201526064015b60405180910390fd5b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b3360009081526004602052604090205460ff166103b0576040517f3fcc3f170000000000000000000000000000000000000000000000000000000081523360048201526024016102e0565b6000806103f286868080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610b3892505050565b7fffffffffffffffffffff000000000000000000000000000000000000000000008216600090815260086020526040902054919350915060ff16610486576040517f4b942f800000000000000000000000000000000000000000000000000000000081527fffffffffffffffffffff00000000000000000000000000000000000000000000831660048201526024016102e0565b73ffffffffffffffffffffffffffffffffffffffff811660009081526006602052604090205460ff166104fd576040517fbf24162300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff821660048201526024016102e0565b600061050b848601866110fe565b905060005b81518110156106da57604051806040016040528083838151811061053657610536611210565b6020026020010151602001517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff16815260200183838151811061057757610577611210565b60200260200101516040015163ffffffff16815250600260008484815181106105a2576105a2611210565b602090810291909101810151518252818101929092526040016000208251929091015163ffffffff167c0100000000000000000000000000000000000000000000000000000000027bffffffffffffffffffffffffffffffffffffffffffffffffffffffff909216919091179055815182908290811061062457610624611210565b6020026020010151600001517f2c30f5cb3caf4239d0f994ce539d7ef24817fa550169c388e3a110f02e40197d83838151811061066357610663611210565b60200260200101516020015184848151811061068157610681611210565b6020026020010151604001516040516106ca9291907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff92909216825263ffffffff16602082015260400190565b60405180910390a2600101610510565b5050505050505050565b6106ec610b4e565b60005b60035463ffffffff8216101561078d5760006004600060038463ffffffff168154811061071e5761071e611210565b60009182526020808320919091015473ffffffffffffffffffffffffffffffffffffffff168352820192909252604001902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169115159190911790556107868161123f565b90506106ef565b5060005b63ffffffff81168611156108355760016004600089898563ffffffff168181106107bd576107bd611210565b90506020020160208101906107d29190611021565b73ffffffffffffffffffffffffffffffffffffffff168152602081019190915260400160002080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001691151591909117905561082e8161123f565b9050610791565b5061084260038787610cc6565b5060005b60055463ffffffff821610156108e45760006006600060058463ffffffff168154811061087557610875611210565b60009182526020808320919091015473ffffffffffffffffffffffffffffffffffffffff168352820192909252604001902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169115159190911790556108dd8161123f565b9050610846565b5060005b63ffffffff811684111561098c5760016006600087878563ffffffff1681811061091457610914611210565b90506020020160208101906109299190611021565b73ffffffffffffffffffffffffffffffffffffffff168152602081019190915260400160002080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169115159190911790556109858161123f565b90506108e8565b5061099960058585610cc6565b5060005b60075463ffffffff82161015610a5a5760006008600060078463ffffffff16815481106109cc576109cc611210565b600091825260208083206003808404909101549206600a026101000a90910460b01b7fffffffffffffffffffff00000000000000000000000000000000000000000000168352820192909252604001902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016911515919091179055610a538161123f565b905061099d565b5060005b63ffffffff8116821115610b0e5760016008600085858563ffffffff16818110610a8a57610a8a611210565b9050602002016020810190610a9f9190611289565b7fffffffffffffffffffff00000000000000000000000000000000000000000000168152602081019190915260400160002080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016911515919091179055610b078161123f565b9050610a5e565b50610b1b60078383610d4e565b50505050505050565b610b2c610b4e565b610b3581610bd1565b50565b6040810151604a90910151909160609190911c90565b60005473ffffffffffffffffffffffffffffffffffffffff163314610bcf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e65720000000000000000000060448201526064016102e0565b565b3373ffffffffffffffffffffffffffffffffffffffff821603610c50576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c6600000000000000000060448201526064016102e0565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b828054828255906000526020600020908101928215610d3e579160200282015b82811115610d3e5781547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff843516178255602090920191600190910190610ce6565b50610d4a929150610e16565b5090565b82805482825590600052602060002090600201600390048101928215610d3e5791602002820160005b83821115610dd757833575ffffffffffffffffffffffffffffffffffffffffffff191683826101000a81548169ffffffffffffffffffff021916908360b01c02179055509260200192600a01602081600901049283019260010302610d77565b8015610e0d5782816101000a81549069ffffffffffffffffffff0219169055600a01602081600901049283019260010302610dd7565b5050610d4a9291505b5b80821115610d4a5760008155600101610e17565b600060208284031215610e3d57600080fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114610e6d57600080fd5b9392505050565b600060208284031215610e8657600080fd5b5035919050565b60008083601f840112610e9f57600080fd5b50813567ffffffffffffffff811115610eb757600080fd5b602083019150836020828501011115610ecf57600080fd5b9250929050565b60008060008060408587031215610eec57600080fd5b843567ffffffffffffffff80821115610f0457600080fd5b610f1088838901610e8d565b90965094506020870135915080821115610f2957600080fd5b50610f3687828801610e8d565b95989497509550505050565b60008083601f840112610f5457600080fd5b50813567ffffffffffffffff811115610f6c57600080fd5b6020830191508360208260051b8501011115610ecf57600080fd5b60008060008060008060608789031215610fa057600080fd5b863567ffffffffffffffff80821115610fb857600080fd5b610fc48a838b01610f42565b90985096506020890135915080821115610fdd57600080fd5b610fe98a838b01610f42565b9096509450604089013591508082111561100257600080fd5b5061100f89828a01610f42565b979a9699509497509295939492505050565b60006020828403121561103357600080fd5b813573ffffffffffffffffffffffffffffffffffffffff81168114610e6d57600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040516060810167ffffffffffffffff811182821017156110a9576110a9611057565b60405290565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff811182821017156110f6576110f6611057565b604052919050565b6000602080838503121561111157600080fd5b823567ffffffffffffffff8082111561112957600080fd5b818501915085601f83011261113d57600080fd5b81358181111561114f5761114f611057565b61115d848260051b016110af565b8181528481019250606091820284018501918883111561117c57600080fd5b938501935b828510156112045780858a0312156111995760008081fd5b6111a1611086565b85358152868601357bffffffffffffffffffffffffffffffffffffffffffffffffffffffff811681146111d45760008081fd5b8188015260408681013563ffffffff811681146111f15760008081fd5b9082015284529384019392850192611181565b50979650505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600063ffffffff80831681810361127f577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6001019392505050565b60006020828403121561129b57600080fd5b81357fffffffffffffffffffff0000000000000000000000000000000000000000000081168114610e6d57600080fdfea164736f6c6343000818000a", +} + +var KeystoneFeedsConsumerABI = KeystoneFeedsConsumerMetaData.ABI + +var KeystoneFeedsConsumerBin = KeystoneFeedsConsumerMetaData.Bin + +func DeployKeystoneFeedsConsumer(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *KeystoneFeedsConsumer, error) { + parsed, err := KeystoneFeedsConsumerMetaData.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(KeystoneFeedsConsumerBin), backend) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &KeystoneFeedsConsumer{address: address, abi: *parsed, KeystoneFeedsConsumerCaller: KeystoneFeedsConsumerCaller{contract: contract}, KeystoneFeedsConsumerTransactor: KeystoneFeedsConsumerTransactor{contract: contract}, KeystoneFeedsConsumerFilterer: KeystoneFeedsConsumerFilterer{contract: contract}}, nil +} + +type KeystoneFeedsConsumer struct { + address common.Address + abi abi.ABI + KeystoneFeedsConsumerCaller + KeystoneFeedsConsumerTransactor + KeystoneFeedsConsumerFilterer +} + +type KeystoneFeedsConsumerCaller struct { + contract *bind.BoundContract +} + +type KeystoneFeedsConsumerTransactor struct { + contract *bind.BoundContract +} + +type KeystoneFeedsConsumerFilterer struct { + contract *bind.BoundContract +} + +type KeystoneFeedsConsumerSession struct { + Contract *KeystoneFeedsConsumer + CallOpts bind.CallOpts + TransactOpts bind.TransactOpts +} + +type KeystoneFeedsConsumerCallerSession struct { + Contract *KeystoneFeedsConsumerCaller + CallOpts bind.CallOpts +} + +type KeystoneFeedsConsumerTransactorSession struct { + Contract *KeystoneFeedsConsumerTransactor + TransactOpts bind.TransactOpts +} + +type KeystoneFeedsConsumerRaw struct { + Contract *KeystoneFeedsConsumer +} + +type KeystoneFeedsConsumerCallerRaw struct { + Contract *KeystoneFeedsConsumerCaller +} + +type KeystoneFeedsConsumerTransactorRaw struct { + Contract *KeystoneFeedsConsumerTransactor +} + +func NewKeystoneFeedsConsumer(address common.Address, backend bind.ContractBackend) (*KeystoneFeedsConsumer, error) { + abi, err := abi.JSON(strings.NewReader(KeystoneFeedsConsumerABI)) + if err != nil { + return nil, err + } + contract, err := bindKeystoneFeedsConsumer(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &KeystoneFeedsConsumer{address: address, abi: abi, KeystoneFeedsConsumerCaller: KeystoneFeedsConsumerCaller{contract: contract}, KeystoneFeedsConsumerTransactor: KeystoneFeedsConsumerTransactor{contract: contract}, KeystoneFeedsConsumerFilterer: KeystoneFeedsConsumerFilterer{contract: contract}}, nil +} + +func NewKeystoneFeedsConsumerCaller(address common.Address, caller bind.ContractCaller) (*KeystoneFeedsConsumerCaller, error) { + contract, err := bindKeystoneFeedsConsumer(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &KeystoneFeedsConsumerCaller{contract: contract}, nil +} + +func NewKeystoneFeedsConsumerTransactor(address common.Address, transactor bind.ContractTransactor) (*KeystoneFeedsConsumerTransactor, error) { + contract, err := bindKeystoneFeedsConsumer(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &KeystoneFeedsConsumerTransactor{contract: contract}, nil +} + +func NewKeystoneFeedsConsumerFilterer(address common.Address, filterer bind.ContractFilterer) (*KeystoneFeedsConsumerFilterer, error) { + contract, err := bindKeystoneFeedsConsumer(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &KeystoneFeedsConsumerFilterer{contract: contract}, nil +} + +func bindKeystoneFeedsConsumer(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := KeystoneFeedsConsumerMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +func (_KeystoneFeedsConsumer *KeystoneFeedsConsumerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _KeystoneFeedsConsumer.Contract.KeystoneFeedsConsumerCaller.contract.Call(opts, result, method, params...) +} + +func (_KeystoneFeedsConsumer *KeystoneFeedsConsumerRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _KeystoneFeedsConsumer.Contract.KeystoneFeedsConsumerTransactor.contract.Transfer(opts) +} + +func (_KeystoneFeedsConsumer *KeystoneFeedsConsumerRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _KeystoneFeedsConsumer.Contract.KeystoneFeedsConsumerTransactor.contract.Transact(opts, method, params...) +} + +func (_KeystoneFeedsConsumer *KeystoneFeedsConsumerCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _KeystoneFeedsConsumer.Contract.contract.Call(opts, result, method, params...) +} + +func (_KeystoneFeedsConsumer *KeystoneFeedsConsumerTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _KeystoneFeedsConsumer.Contract.contract.Transfer(opts) +} + +func (_KeystoneFeedsConsumer *KeystoneFeedsConsumerTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _KeystoneFeedsConsumer.Contract.contract.Transact(opts, method, params...) +} + +func (_KeystoneFeedsConsumer *KeystoneFeedsConsumerCaller) GetPrice(opts *bind.CallOpts, feedId [32]byte) (*big.Int, uint32, error) { + var out []interface{} + err := _KeystoneFeedsConsumer.contract.Call(opts, &out, "getPrice", feedId) + + if err != nil { + return *new(*big.Int), *new(uint32), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + out1 := *abi.ConvertType(out[1], new(uint32)).(*uint32) + + return out0, out1, err + +} + +func (_KeystoneFeedsConsumer *KeystoneFeedsConsumerSession) GetPrice(feedId [32]byte) (*big.Int, uint32, error) { + return _KeystoneFeedsConsumer.Contract.GetPrice(&_KeystoneFeedsConsumer.CallOpts, feedId) +} + +func (_KeystoneFeedsConsumer *KeystoneFeedsConsumerCallerSession) GetPrice(feedId [32]byte) (*big.Int, uint32, error) { + return _KeystoneFeedsConsumer.Contract.GetPrice(&_KeystoneFeedsConsumer.CallOpts, feedId) +} + +func (_KeystoneFeedsConsumer *KeystoneFeedsConsumerCaller) Owner(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _KeystoneFeedsConsumer.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 + +} + +func (_KeystoneFeedsConsumer *KeystoneFeedsConsumerSession) Owner() (common.Address, error) { + return _KeystoneFeedsConsumer.Contract.Owner(&_KeystoneFeedsConsumer.CallOpts) +} + +func (_KeystoneFeedsConsumer *KeystoneFeedsConsumerCallerSession) Owner() (common.Address, error) { + return _KeystoneFeedsConsumer.Contract.Owner(&_KeystoneFeedsConsumer.CallOpts) +} + +func (_KeystoneFeedsConsumer *KeystoneFeedsConsumerCaller) SupportsInterface(opts *bind.CallOpts, interfaceId [4]byte) (bool, error) { + var out []interface{} + err := _KeystoneFeedsConsumer.contract.Call(opts, &out, "supportsInterface", interfaceId) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_KeystoneFeedsConsumer *KeystoneFeedsConsumerSession) SupportsInterface(interfaceId [4]byte) (bool, error) { + return _KeystoneFeedsConsumer.Contract.SupportsInterface(&_KeystoneFeedsConsumer.CallOpts, interfaceId) +} + +func (_KeystoneFeedsConsumer *KeystoneFeedsConsumerCallerSession) SupportsInterface(interfaceId [4]byte) (bool, error) { + return _KeystoneFeedsConsumer.Contract.SupportsInterface(&_KeystoneFeedsConsumer.CallOpts, interfaceId) +} + +func (_KeystoneFeedsConsumer *KeystoneFeedsConsumerTransactor) AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + return _KeystoneFeedsConsumer.contract.Transact(opts, "acceptOwnership") +} + +func (_KeystoneFeedsConsumer *KeystoneFeedsConsumerSession) AcceptOwnership() (*types.Transaction, error) { + return _KeystoneFeedsConsumer.Contract.AcceptOwnership(&_KeystoneFeedsConsumer.TransactOpts) +} + +func (_KeystoneFeedsConsumer *KeystoneFeedsConsumerTransactorSession) AcceptOwnership() (*types.Transaction, error) { + return _KeystoneFeedsConsumer.Contract.AcceptOwnership(&_KeystoneFeedsConsumer.TransactOpts) +} + +func (_KeystoneFeedsConsumer *KeystoneFeedsConsumerTransactor) OnReport(opts *bind.TransactOpts, metadata []byte, rawReport []byte) (*types.Transaction, error) { + return _KeystoneFeedsConsumer.contract.Transact(opts, "onReport", metadata, rawReport) +} + +func (_KeystoneFeedsConsumer *KeystoneFeedsConsumerSession) OnReport(metadata []byte, rawReport []byte) (*types.Transaction, error) { + return _KeystoneFeedsConsumer.Contract.OnReport(&_KeystoneFeedsConsumer.TransactOpts, metadata, rawReport) +} + +func (_KeystoneFeedsConsumer *KeystoneFeedsConsumerTransactorSession) OnReport(metadata []byte, rawReport []byte) (*types.Transaction, error) { + return _KeystoneFeedsConsumer.Contract.OnReport(&_KeystoneFeedsConsumer.TransactOpts, metadata, rawReport) +} + +func (_KeystoneFeedsConsumer *KeystoneFeedsConsumerTransactor) SetConfig(opts *bind.TransactOpts, _allowedSendersList []common.Address, _allowedWorkflowOwnersList []common.Address, _allowedWorkflowNamesList [][10]byte) (*types.Transaction, error) { + return _KeystoneFeedsConsumer.contract.Transact(opts, "setConfig", _allowedSendersList, _allowedWorkflowOwnersList, _allowedWorkflowNamesList) +} + +func (_KeystoneFeedsConsumer *KeystoneFeedsConsumerSession) SetConfig(_allowedSendersList []common.Address, _allowedWorkflowOwnersList []common.Address, _allowedWorkflowNamesList [][10]byte) (*types.Transaction, error) { + return _KeystoneFeedsConsumer.Contract.SetConfig(&_KeystoneFeedsConsumer.TransactOpts, _allowedSendersList, _allowedWorkflowOwnersList, _allowedWorkflowNamesList) +} + +func (_KeystoneFeedsConsumer *KeystoneFeedsConsumerTransactorSession) SetConfig(_allowedSendersList []common.Address, _allowedWorkflowOwnersList []common.Address, _allowedWorkflowNamesList [][10]byte) (*types.Transaction, error) { + return _KeystoneFeedsConsumer.Contract.SetConfig(&_KeystoneFeedsConsumer.TransactOpts, _allowedSendersList, _allowedWorkflowOwnersList, _allowedWorkflowNamesList) +} + +func (_KeystoneFeedsConsumer *KeystoneFeedsConsumerTransactor) TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) { + return _KeystoneFeedsConsumer.contract.Transact(opts, "transferOwnership", to) +} + +func (_KeystoneFeedsConsumer *KeystoneFeedsConsumerSession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _KeystoneFeedsConsumer.Contract.TransferOwnership(&_KeystoneFeedsConsumer.TransactOpts, to) +} + +func (_KeystoneFeedsConsumer *KeystoneFeedsConsumerTransactorSession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _KeystoneFeedsConsumer.Contract.TransferOwnership(&_KeystoneFeedsConsumer.TransactOpts, to) +} + +type KeystoneFeedsConsumerFeedReceivedIterator struct { + Event *KeystoneFeedsConsumerFeedReceived + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *KeystoneFeedsConsumerFeedReceivedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(KeystoneFeedsConsumerFeedReceived) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(KeystoneFeedsConsumerFeedReceived) + 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() + } +} + +func (it *KeystoneFeedsConsumerFeedReceivedIterator) Error() error { + return it.fail +} + +func (it *KeystoneFeedsConsumerFeedReceivedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type KeystoneFeedsConsumerFeedReceived struct { + FeedId [32]byte + Price *big.Int + Timestamp uint32 + Raw types.Log +} + +func (_KeystoneFeedsConsumer *KeystoneFeedsConsumerFilterer) FilterFeedReceived(opts *bind.FilterOpts, feedId [][32]byte) (*KeystoneFeedsConsumerFeedReceivedIterator, error) { + + var feedIdRule []interface{} + for _, feedIdItem := range feedId { + feedIdRule = append(feedIdRule, feedIdItem) + } + + logs, sub, err := _KeystoneFeedsConsumer.contract.FilterLogs(opts, "FeedReceived", feedIdRule) + if err != nil { + return nil, err + } + return &KeystoneFeedsConsumerFeedReceivedIterator{contract: _KeystoneFeedsConsumer.contract, event: "FeedReceived", logs: logs, sub: sub}, nil +} + +func (_KeystoneFeedsConsumer *KeystoneFeedsConsumerFilterer) WatchFeedReceived(opts *bind.WatchOpts, sink chan<- *KeystoneFeedsConsumerFeedReceived, feedId [][32]byte) (event.Subscription, error) { + + var feedIdRule []interface{} + for _, feedIdItem := range feedId { + feedIdRule = append(feedIdRule, feedIdItem) + } + + logs, sub, err := _KeystoneFeedsConsumer.contract.WatchLogs(opts, "FeedReceived", feedIdRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(KeystoneFeedsConsumerFeedReceived) + if err := _KeystoneFeedsConsumer.contract.UnpackLog(event, "FeedReceived", 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 +} + +func (_KeystoneFeedsConsumer *KeystoneFeedsConsumerFilterer) ParseFeedReceived(log types.Log) (*KeystoneFeedsConsumerFeedReceived, error) { + event := new(KeystoneFeedsConsumerFeedReceived) + if err := _KeystoneFeedsConsumer.contract.UnpackLog(event, "FeedReceived", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type KeystoneFeedsConsumerOwnershipTransferRequestedIterator struct { + Event *KeystoneFeedsConsumerOwnershipTransferRequested + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *KeystoneFeedsConsumerOwnershipTransferRequestedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(KeystoneFeedsConsumerOwnershipTransferRequested) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(KeystoneFeedsConsumerOwnershipTransferRequested) + 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() + } +} + +func (it *KeystoneFeedsConsumerOwnershipTransferRequestedIterator) Error() error { + return it.fail +} + +func (it *KeystoneFeedsConsumerOwnershipTransferRequestedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type KeystoneFeedsConsumerOwnershipTransferRequested struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_KeystoneFeedsConsumer *KeystoneFeedsConsumerFilterer) FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*KeystoneFeedsConsumerOwnershipTransferRequestedIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _KeystoneFeedsConsumer.contract.FilterLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return &KeystoneFeedsConsumerOwnershipTransferRequestedIterator{contract: _KeystoneFeedsConsumer.contract, event: "OwnershipTransferRequested", logs: logs, sub: sub}, nil +} + +func (_KeystoneFeedsConsumer *KeystoneFeedsConsumerFilterer) WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *KeystoneFeedsConsumerOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _KeystoneFeedsConsumer.contract.WatchLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(KeystoneFeedsConsumerOwnershipTransferRequested) + if err := _KeystoneFeedsConsumer.contract.UnpackLog(event, "OwnershipTransferRequested", 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 +} + +func (_KeystoneFeedsConsumer *KeystoneFeedsConsumerFilterer) ParseOwnershipTransferRequested(log types.Log) (*KeystoneFeedsConsumerOwnershipTransferRequested, error) { + event := new(KeystoneFeedsConsumerOwnershipTransferRequested) + if err := _KeystoneFeedsConsumer.contract.UnpackLog(event, "OwnershipTransferRequested", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type KeystoneFeedsConsumerOwnershipTransferredIterator struct { + Event *KeystoneFeedsConsumerOwnershipTransferred + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *KeystoneFeedsConsumerOwnershipTransferredIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(KeystoneFeedsConsumerOwnershipTransferred) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(KeystoneFeedsConsumerOwnershipTransferred) + 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() + } +} + +func (it *KeystoneFeedsConsumerOwnershipTransferredIterator) Error() error { + return it.fail +} + +func (it *KeystoneFeedsConsumerOwnershipTransferredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type KeystoneFeedsConsumerOwnershipTransferred struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_KeystoneFeedsConsumer *KeystoneFeedsConsumerFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*KeystoneFeedsConsumerOwnershipTransferredIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _KeystoneFeedsConsumer.contract.FilterLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return &KeystoneFeedsConsumerOwnershipTransferredIterator{contract: _KeystoneFeedsConsumer.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil +} + +func (_KeystoneFeedsConsumer *KeystoneFeedsConsumerFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *KeystoneFeedsConsumerOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _KeystoneFeedsConsumer.contract.WatchLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(KeystoneFeedsConsumerOwnershipTransferred) + if err := _KeystoneFeedsConsumer.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 +} + +func (_KeystoneFeedsConsumer *KeystoneFeedsConsumerFilterer) ParseOwnershipTransferred(log types.Log) (*KeystoneFeedsConsumerOwnershipTransferred, error) { + event := new(KeystoneFeedsConsumerOwnershipTransferred) + if err := _KeystoneFeedsConsumer.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +func (_KeystoneFeedsConsumer *KeystoneFeedsConsumer) ParseLog(log types.Log) (generated.AbigenLog, error) { + switch log.Topics[0] { + case _KeystoneFeedsConsumer.abi.Events["FeedReceived"].ID: + return _KeystoneFeedsConsumer.ParseFeedReceived(log) + case _KeystoneFeedsConsumer.abi.Events["OwnershipTransferRequested"].ID: + return _KeystoneFeedsConsumer.ParseOwnershipTransferRequested(log) + case _KeystoneFeedsConsumer.abi.Events["OwnershipTransferred"].ID: + return _KeystoneFeedsConsumer.ParseOwnershipTransferred(log) + + default: + return nil, fmt.Errorf("abigen wrapper received unknown log topic: %v", log.Topics[0]) + } +} + +func (KeystoneFeedsConsumerFeedReceived) Topic() common.Hash { + return common.HexToHash("0x2c30f5cb3caf4239d0f994ce539d7ef24817fa550169c388e3a110f02e40197d") +} + +func (KeystoneFeedsConsumerOwnershipTransferRequested) Topic() common.Hash { + return common.HexToHash("0xed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae1278") +} + +func (KeystoneFeedsConsumerOwnershipTransferred) Topic() common.Hash { + return common.HexToHash("0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0") +} + +func (_KeystoneFeedsConsumer *KeystoneFeedsConsumer) Address() common.Address { + return _KeystoneFeedsConsumer.address +} + +type KeystoneFeedsConsumerInterface interface { + GetPrice(opts *bind.CallOpts, feedId [32]byte) (*big.Int, uint32, error) + + Owner(opts *bind.CallOpts) (common.Address, error) + + SupportsInterface(opts *bind.CallOpts, interfaceId [4]byte) (bool, error) + + AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) + + OnReport(opts *bind.TransactOpts, metadata []byte, rawReport []byte) (*types.Transaction, error) + + SetConfig(opts *bind.TransactOpts, _allowedSendersList []common.Address, _allowedWorkflowOwnersList []common.Address, _allowedWorkflowNamesList [][10]byte) (*types.Transaction, error) + + TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) + + FilterFeedReceived(opts *bind.FilterOpts, feedId [][32]byte) (*KeystoneFeedsConsumerFeedReceivedIterator, error) + + WatchFeedReceived(opts *bind.WatchOpts, sink chan<- *KeystoneFeedsConsumerFeedReceived, feedId [][32]byte) (event.Subscription, error) + + ParseFeedReceived(log types.Log) (*KeystoneFeedsConsumerFeedReceived, error) + + FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*KeystoneFeedsConsumerOwnershipTransferRequestedIterator, error) + + WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *KeystoneFeedsConsumerOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferRequested(log types.Log) (*KeystoneFeedsConsumerOwnershipTransferRequested, error) + + FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*KeystoneFeedsConsumerOwnershipTransferredIterator, error) + + WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *KeystoneFeedsConsumerOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferred(log types.Log) (*KeystoneFeedsConsumerOwnershipTransferred, error) + + ParseLog(log types.Log) (generated.AbigenLog, error) + + Address() common.Address +} diff --git a/core/gethwrappers/keystone/generated/forwarder/forwarder.go b/core/gethwrappers/keystone/generated/forwarder/forwarder.go index 0412241cf77..5c95cfef2b6 100644 --- a/core/gethwrappers/keystone/generated/forwarder/forwarder.go +++ b/core/gethwrappers/keystone/generated/forwarder/forwarder.go @@ -30,9 +30,18 @@ var ( _ = abi.ConvertType ) +type IRouterTransmissionInfo struct { + TransmissionId [32]byte + State uint8 + Transmitter common.Address + InvalidReceiver bool + Success bool + GasLimit *big.Int +} + var KeystoneForwarderMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"transmissionId\",\"type\":\"bytes32\"}],\"name\":\"AlreadyAttempted\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"signer\",\"type\":\"address\"}],\"name\":\"DuplicateSigner\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"numSigners\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxSigners\",\"type\":\"uint256\"}],\"name\":\"ExcessSigners\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FaultToleranceMustBePositive\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"numSigners\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"minSigners\",\"type\":\"uint256\"}],\"name\":\"InsufficientSigners\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"configId\",\"type\":\"uint64\"}],\"name\":\"InvalidConfig\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidReport\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"name\":\"InvalidSignature\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expected\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"received\",\"type\":\"uint256\"}],\"name\":\"InvalidSignatureCount\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"signer\",\"type\":\"address\"}],\"name\":\"InvalidSigner\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UnauthorizedForwarder\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint32\",\"name\":\"donId\",\"type\":\"uint32\"},{\"indexed\":true,\"internalType\":\"uint32\",\"name\":\"configVersion\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"f\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"signers\",\"type\":\"address[]\"}],\"name\":\"ConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"forwarder\",\"type\":\"address\"}],\"name\":\"ForwarderAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"forwarder\",\"type\":\"address\"}],\"name\":\"ForwarderRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"workflowExecutionId\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"bytes2\",\"name\":\"reportId\",\"type\":\"bytes2\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"result\",\"type\":\"bool\"}],\"name\":\"ReportProcessed\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"forwarder\",\"type\":\"address\"}],\"name\":\"addForwarder\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"donId\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"configVersion\",\"type\":\"uint32\"}],\"name\":\"clearConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"workflowExecutionId\",\"type\":\"bytes32\"},{\"internalType\":\"bytes2\",\"name\":\"reportId\",\"type\":\"bytes2\"}],\"name\":\"getTransmissionId\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"workflowExecutionId\",\"type\":\"bytes32\"},{\"internalType\":\"bytes2\",\"name\":\"reportId\",\"type\":\"bytes2\"}],\"name\":\"getTransmissionState\",\"outputs\":[{\"internalType\":\"enumIRouter.TransmissionState\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"workflowExecutionId\",\"type\":\"bytes32\"},{\"internalType\":\"bytes2\",\"name\":\"reportId\",\"type\":\"bytes2\"}],\"name\":\"getTransmitter\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"forwarder\",\"type\":\"address\"}],\"name\":\"isForwarder\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"forwarder\",\"type\":\"address\"}],\"name\":\"removeForwarder\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"rawReport\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"reportContext\",\"type\":\"bytes\"},{\"internalType\":\"bytes[]\",\"name\":\"signatures\",\"type\":\"bytes[]\"}],\"name\":\"report\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"transmissionId\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"transmitter\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"metadata\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"validatedReport\",\"type\":\"bytes\"}],\"name\":\"route\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"donId\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"configVersion\",\"type\":\"uint32\"},{\"internalType\":\"uint8\",\"name\":\"f\",\"type\":\"uint8\"},{\"internalType\":\"address[]\",\"name\":\"signers\",\"type\":\"address[]\"}],\"name\":\"setConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", - Bin: "0x608060405234801561001057600080fd5b5033806000816100675760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b038481169190911790915581161561009757610097816100b9565b5050306000908152600360205260409020805460ff1916600117905550610162565b336001600160a01b038216036101115760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640161005e565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b611b2d80620001726000396000f3fe608060405234801561001057600080fd5b50600436106100ea5760003560e01c806379ba50971161008c578063abcef55411610066578063abcef5541461023e578063ee59d26c14610277578063ef6e17a01461028a578063f2fde38b1461029d57600080fd5b806379ba5097146101e05780638864b864146101e85780638da5cb5b1461022057600080fd5b8063354bdd66116100c8578063354bdd661461017957806343c164671461019a5780634d93172d146101ba5780635c41d2fe146101cd57600080fd5b806311289565146100ef578063181f5a7714610104578063233fd52d14610156575b600080fd5b6101026100fd366004611474565b6102b0565b005b6101406040518060400160405280601a81526020017f466f7277617264657220616e6420526f7574657220312e302e3000000000000081525081565b60405161014d919061151f565b60405180910390f35b61016961016436600461158c565b61080d565b604051901515815260200161014d565b61018c610187366004611614565b610a00565b60405190815260200161014d565b6101ad6101a8366004611614565b610a84565b60405161014d9190611679565b6101026101c83660046116ba565b610b09565b6101026101db3660046116ba565b610b85565b610102610c04565b6101fb6101f6366004611614565b610d01565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161014d565b60005473ffffffffffffffffffffffffffffffffffffffff166101fb565b61016961024c3660046116ba565b73ffffffffffffffffffffffffffffffffffffffff1660009081526003602052604090205460ff1690565b6101026102853660046116e9565b610d41565b610102610298366004611767565b6110ba565b6101026102ab3660046116ba565b61115a565b606d8510156102eb576040517fb55ac75400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600080600061032f89898080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061116e92505050565b67ffffffffffffffff8216600090815260026020526040812080549497509195509193509160ff16908190036103a2576040517fdf3b81ea00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff841660048201526024015b60405180910390fd5b856103ae8260016117c9565b60ff1614610400576103c18160016117c9565b6040517fd6022e8e00000000000000000000000000000000000000000000000000000000815260ff909116600482015260248101879052604401610399565b60008b8b6040516104129291906117e8565b60405190819003812061042b918c908c906020016117f8565b60405160208183030381529060405280519060200120905061044b611301565b60005b888110156106cd573660008b8b8481811061046b5761046b611812565b905060200281019061047d9190611841565b9092509050604181146104c05781816040517f2adfdc300000000000000000000000000000000000000000000000000000000081526004016103999291906118ef565b6000600186848460408181106104d8576104d8611812565b6104ea92013560f81c9050601b6117c9565b6104f860206000878961190b565b61050191611935565b61050f60406020888a61190b565b61051891611935565b6040805160008152602081018083529590955260ff909316928401929092526060830152608082015260a0016020604051602081039080840390855afa158015610566573d6000803e3d6000fd5b5050604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015173ffffffffffffffffffffffffffffffffffffffff8116600090815260028c0160205291822054909350915081900361060c576040517fbf18af4300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff83166004820152602401610399565b600086826020811061062057610620611812565b602002015173ffffffffffffffffffffffffffffffffffffffff161461068a576040517fe021c4f200000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff83166004820152602401610399565b8186826020811061069d5761069d611812565b73ffffffffffffffffffffffffffffffffffffffff909216602092909202015250506001909201915061044e9050565b50505050505060003073ffffffffffffffffffffffffffffffffffffffff1663233fd52d6106fc8c8686610a00565b338d8d8d602d90606d926107129392919061190b565b8f8f606d9080926107259392919061190b565b6040518863ffffffff1660e01b81526004016107479796959493929190611971565b6020604051808303816000875af1158015610766573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061078a91906119d2565b9050817dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916838b73ffffffffffffffffffffffffffffffffffffffff167f3617b009e9785c42daebadb6d3fb553243a4bf586d07ea72d65d80013ce116b5846040516107f9911515815260200190565b60405180910390a450505050505050505050565b3360009081526003602052604081205460ff16610856576040517fd79e123d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008881526004602052604090205473ffffffffffffffffffffffffffffffffffffffff16156108b5576040517fa53dc8ca00000000000000000000000000000000000000000000000000000000815260048101899052602401610399565b600088815260046020526040812080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8a81169190911790915587163b9003610917575060006109f5565b6040517f805f213200000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff87169063805f21329061096f9088908890889088906004016119f4565b600060405180830381600087803b15801561098957600080fd5b505af192505050801561099a575060015b6109a6575060006109f5565b50600087815260046020526040902080547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff167401000000000000000000000000000000000000000017905560015b979650505050505050565b6040517fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606085901b166020820152603481018390527fffff000000000000000000000000000000000000000000000000000000000000821660548201526000906056016040516020818303038152906040528051906020012090505b9392505050565b600080610a92858585610a00565b60008181526004602052604090205490915073ffffffffffffffffffffffffffffffffffffffff16610ac8576000915050610a7d565b60008181526004602052604090205474010000000000000000000000000000000000000000900460ff16610afd576002610b00565b60015b95945050505050565b610b11611189565b73ffffffffffffffffffffffffffffffffffffffff811660008181526003602052604080822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055517fb96d15bf9258c7b8df062753a6a262864611fc7b060a5ee2e57e79b85f898d389190a250565b610b8d611189565b73ffffffffffffffffffffffffffffffffffffffff811660008181526003602052604080822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055517f0ea0ce2c048ff45a4a95f2947879de3fb94abec2f152190400cab2d1272a68e79190a250565b60015473ffffffffffffffffffffffffffffffffffffffff163314610c85576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e6572000000000000000000006044820152606401610399565b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b600060046000610d12868686610a00565b815260208101919091526040016000205473ffffffffffffffffffffffffffffffffffffffff16949350505050565b610d49611189565b8260ff16600003610d86576040517f0743bae600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b601f811115610dcb576040517f61750f4000000000000000000000000000000000000000000000000000000000815260048101829052601f6024820152604401610399565b610dd6836003611a1b565b60ff168111610e345780610deb846003611a1b565b610df69060016117c9565b6040517f9dd9e6d8000000000000000000000000000000000000000000000000000000008152600481019290925260ff166024820152604401610399565b67ffffffff00000000602086901b1663ffffffff85161760005b67ffffffffffffffff8216600090815260026020526040902060010154811015610ee45767ffffffffffffffff8216600090815260026020819052604082206001810180549190920192919084908110610eaa57610eaa611812565b600091825260208083209091015473ffffffffffffffffffffffffffffffffffffffff168352820192909252604001812055600101610e4e565b5060005b82811015610ffc576000848483818110610f0457610f04611812565b9050602002016020810190610f1991906116ba565b67ffffffffffffffff8416600090815260026020818152604080842073ffffffffffffffffffffffffffffffffffffffff86168552909201905290205490915015610fa8576040517fe021c4f200000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff82166004820152602401610399565b610fb3826001611a3e565b67ffffffffffffffff8416600090815260026020818152604080842073ffffffffffffffffffffffffffffffffffffffff90961684529490910190529190912055600101610ee8565b5067ffffffffffffffff81166000908152600260205260409020611024906001018484611320565b5067ffffffffffffffff81166000908152600260205260409081902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660ff87161790555163ffffffff86811691908816907f4120bd3b23957dd423555817d55654d4481b438aa15485c21b4180c784f1a455906110aa90889088908890611a51565b60405180910390a3505050505050565b6110c2611189565b63ffffffff818116602084811b67ffffffff00000000168217600090815260028252604080822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690558051828152928301905291928516917f4120bd3b23957dd423555817d55654d4481b438aa15485c21b4180c784f1a4559160405161114e929190611ab7565b60405180910390a35050565b611162611189565b61116b8161120c565b50565b60218101516045820151608b90920151909260c09290921c91565b60005473ffffffffffffffffffffffffffffffffffffffff16331461120a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e6572000000000000000000006044820152606401610399565b565b3373ffffffffffffffffffffffffffffffffffffffff82160361128b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c660000000000000000006044820152606401610399565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b6040518061040001604052806020906020820280368337509192915050565b828054828255906000526020600020908101928215611398579160200282015b828111156113985781547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff843516178255602090920191600190910190611340565b506113a49291506113a8565b5090565b5b808211156113a457600081556001016113a9565b803573ffffffffffffffffffffffffffffffffffffffff811681146113e157600080fd5b919050565b60008083601f8401126113f857600080fd5b50813567ffffffffffffffff81111561141057600080fd5b60208301915083602082850101111561142857600080fd5b9250929050565b60008083601f84011261144157600080fd5b50813567ffffffffffffffff81111561145957600080fd5b6020830191508360208260051b850101111561142857600080fd5b60008060008060008060006080888a03121561148f57600080fd5b611498886113bd565b9650602088013567ffffffffffffffff808211156114b557600080fd5b6114c18b838c016113e6565b909850965060408a01359150808211156114da57600080fd5b6114e68b838c016113e6565b909650945060608a01359150808211156114ff57600080fd5b5061150c8a828b0161142f565b989b979a50959850939692959293505050565b60006020808352835180602085015260005b8181101561154d57858101830151858201604001528201611531565b5060006040828601015260407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8301168501019250505092915050565b600080600080600080600060a0888a0312156115a757600080fd5b873596506115b7602089016113bd565b95506115c5604089016113bd565b9450606088013567ffffffffffffffff808211156115e257600080fd5b6115ee8b838c016113e6565b909650945060808a013591508082111561160757600080fd5b5061150c8a828b016113e6565b60008060006060848603121561162957600080fd5b611632846113bd565b92506020840135915060408401357fffff0000000000000000000000000000000000000000000000000000000000008116811461166e57600080fd5b809150509250925092565b60208101600383106116b4577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b91905290565b6000602082840312156116cc57600080fd5b610a7d826113bd565b803563ffffffff811681146113e157600080fd5b60008060008060006080868803121561170157600080fd5b61170a866116d5565b9450611718602087016116d5565b9350604086013560ff8116811461172e57600080fd5b9250606086013567ffffffffffffffff81111561174a57600080fd5b6117568882890161142f565b969995985093965092949392505050565b6000806040838503121561177a57600080fd5b611783836116d5565b9150611791602084016116d5565b90509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60ff81811683821601908111156117e2576117e261179a565b92915050565b8183823760009101908152919050565b838152818360208301376000910160200190815292915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe184360301811261187657600080fd5b83018035915067ffffffffffffffff82111561189157600080fd5b60200191503681900382131561142857600080fd5b8183528181602085013750600060208284010152600060207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b6020815260006119036020830184866118a6565b949350505050565b6000808585111561191b57600080fd5b8386111561192857600080fd5b5050820193919092039150565b803560208310156117e2577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff602084900360031b1b1692915050565b878152600073ffffffffffffffffffffffffffffffffffffffff808916602084015280881660408401525060a060608301526119b160a0830186886118a6565b82810360808401526119c48185876118a6565b9a9950505050505050505050565b6000602082840312156119e457600080fd5b81518015158114610a7d57600080fd5b604081526000611a086040830186886118a6565b82810360208401526109f58185876118a6565b60ff8181168382160290811690818114611a3757611a3761179a565b5092915050565b808201808211156117e2576117e261179a565b60ff8416815260406020808301829052908201839052600090849060608401835b86811015611aab5773ffffffffffffffffffffffffffffffffffffffff611a98856113bd565b1682529282019290820190600101611a72565b50979650505050505050565b60006040820160ff8516835260206040602085015281855180845260608601915060208701935060005b81811015611b1357845173ffffffffffffffffffffffffffffffffffffffff1683529383019391830191600101611ae1565b509097965050505050505056fea164736f6c6343000818000a", + ABI: "[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"transmissionId\",\"type\":\"bytes32\"}],\"name\":\"AlreadyAttempted\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"signer\",\"type\":\"address\"}],\"name\":\"DuplicateSigner\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"numSigners\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxSigners\",\"type\":\"uint256\"}],\"name\":\"ExcessSigners\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FaultToleranceMustBePositive\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"transmissionId\",\"type\":\"bytes32\"}],\"name\":\"InsufficientGasForRouting\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"numSigners\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"minSigners\",\"type\":\"uint256\"}],\"name\":\"InsufficientSigners\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"configId\",\"type\":\"uint64\"}],\"name\":\"InvalidConfig\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidReport\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"name\":\"InvalidSignature\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expected\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"received\",\"type\":\"uint256\"}],\"name\":\"InvalidSignatureCount\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"signer\",\"type\":\"address\"}],\"name\":\"InvalidSigner\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UnauthorizedForwarder\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint32\",\"name\":\"donId\",\"type\":\"uint32\"},{\"indexed\":true,\"internalType\":\"uint32\",\"name\":\"configVersion\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"f\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"signers\",\"type\":\"address[]\"}],\"name\":\"ConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"forwarder\",\"type\":\"address\"}],\"name\":\"ForwarderAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"forwarder\",\"type\":\"address\"}],\"name\":\"ForwarderRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"workflowExecutionId\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"bytes2\",\"name\":\"reportId\",\"type\":\"bytes2\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"result\",\"type\":\"bool\"}],\"name\":\"ReportProcessed\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"forwarder\",\"type\":\"address\"}],\"name\":\"addForwarder\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"donId\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"configVersion\",\"type\":\"uint32\"}],\"name\":\"clearConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"workflowExecutionId\",\"type\":\"bytes32\"},{\"internalType\":\"bytes2\",\"name\":\"reportId\",\"type\":\"bytes2\"}],\"name\":\"getTransmissionId\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"workflowExecutionId\",\"type\":\"bytes32\"},{\"internalType\":\"bytes2\",\"name\":\"reportId\",\"type\":\"bytes2\"}],\"name\":\"getTransmissionInfo\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"transmissionId\",\"type\":\"bytes32\"},{\"internalType\":\"enumIRouter.TransmissionState\",\"name\":\"state\",\"type\":\"uint8\"},{\"internalType\":\"address\",\"name\":\"transmitter\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"invalidReceiver\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"success\",\"type\":\"bool\"},{\"internalType\":\"uint80\",\"name\":\"gasLimit\",\"type\":\"uint80\"}],\"internalType\":\"structIRouter.TransmissionInfo\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"workflowExecutionId\",\"type\":\"bytes32\"},{\"internalType\":\"bytes2\",\"name\":\"reportId\",\"type\":\"bytes2\"}],\"name\":\"getTransmitter\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"forwarder\",\"type\":\"address\"}],\"name\":\"isForwarder\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"forwarder\",\"type\":\"address\"}],\"name\":\"removeForwarder\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"rawReport\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"reportContext\",\"type\":\"bytes\"},{\"internalType\":\"bytes[]\",\"name\":\"signatures\",\"type\":\"bytes[]\"}],\"name\":\"report\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"transmissionId\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"transmitter\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"metadata\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"validatedReport\",\"type\":\"bytes\"}],\"name\":\"route\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"donId\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"configVersion\",\"type\":\"uint32\"},{\"internalType\":\"uint8\",\"name\":\"f\",\"type\":\"uint8\"},{\"internalType\":\"address[]\",\"name\":\"signers\",\"type\":\"address[]\"}],\"name\":\"setConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", + Bin: "0x60806040523480156200001157600080fd5b503380600081620000695760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b03848116919091179091558116156200009c576200009c81620000bf565b5050306000908152600360205260409020805460ff19166001179055506200016a565b336001600160a01b03821603620001195760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640162000060565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b61218f806200017a6000396000f3fe608060405234801561001057600080fd5b50600436106100ea5760003560e01c806379ba50971161008c578063abcef55411610066578063abcef5541461035d578063ee59d26c14610396578063ef6e17a0146103a9578063f2fde38b146103bc57600080fd5b806379ba50971461025e5780638864b864146102665780638da5cb5b1461033f57600080fd5b8063272cbd93116100c8578063272cbd9314610179578063354bdd66146101995780634d93172d146102385780635c41d2fe1461024b57600080fd5b806311289565146100ef578063181f5a7714610104578063233fd52d14610156575b600080fd5b6101026100fd366004611a33565b6103cf565b005b6101406040518060400160405280601a81526020017f466f7277617264657220616e6420526f7574657220312e302e3000000000000081525081565b60405161014d9190611ade565b60405180910390f35b610169610164366004611b4b565b610989565b604051901515815260200161014d565b61018c610187366004611bd3565b610d4a565b60405161014d9190611c67565b61022a6101a7366004611bd3565b6040517fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606085901b166020820152603481018390527fffff000000000000000000000000000000000000000000000000000000000000821660548201526000906056016040516020818303038152906040528051906020012090509392505050565b60405190815260200161014d565b610102610246366004611d0f565b610f50565b610102610259366004611d0f565b610fcc565b61010261104b565b61031a610274366004611bd3565b6040805160609490941b7fffffffffffffffffffffffffffffffffffffffff0000000000000000000000001660208086019190915260348501939093527fffff000000000000000000000000000000000000000000000000000000000000919091166054840152805160368185030181526056909301815282519282019290922060009081526004909152205473ffffffffffffffffffffffffffffffffffffffff1690565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161014d565b60005473ffffffffffffffffffffffffffffffffffffffff1661031a565b61016961036b366004611d0f565b73ffffffffffffffffffffffffffffffffffffffff1660009081526003602052604090205460ff1690565b6101026103a4366004611d3e565b611148565b6101026103b7366004611dbc565b611525565b6101026103ca366004611d0f565b6115c5565b606d85101561040a576040517fb55ac75400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600080600061044e89898080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506115d992505050565b67ffffffffffffffff8216600090815260026020526040812080549497509195509193509160ff16908190036104c1576040517fdf3b81ea00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff841660048201526024015b60405180910390fd5b856104cd826001611e1e565b60ff161461051f576104e0816001611e1e565b6040517fd6022e8e00000000000000000000000000000000000000000000000000000000815260ff9091166004820152602481018790526044016104b8565b60008b8b604051610531929190611e37565b60405190819003812061054a918c908c90602001611e47565b60405160208183030381529060405280519060200120905061056a6118c0565b60005b888110156107ec573660008b8b8481811061058a5761058a611e61565b905060200281019061059c9190611e90565b9092509050604181146105df5781816040517f2adfdc300000000000000000000000000000000000000000000000000000000081526004016104b8929190611f3e565b6000600186848460408181106105f7576105f7611e61565b61060992013560f81c9050601b611e1e565b610617602060008789611f5a565b61062091611f84565b61062e60406020888a611f5a565b61063791611f84565b6040805160008152602081018083529590955260ff909316928401929092526060830152608082015260a0016020604051602081039080840390855afa158015610685573d6000803e3d6000fd5b5050604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015173ffffffffffffffffffffffffffffffffffffffff8116600090815260028c0160205291822054909350915081900361072b576040517fbf18af4300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff831660048201526024016104b8565b600086826020811061073f5761073f611e61565b602002015173ffffffffffffffffffffffffffffffffffffffff16146107a9576040517fe021c4f200000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff831660048201526024016104b8565b818682602081106107bc576107bc611e61565b73ffffffffffffffffffffffffffffffffffffffff909216602092909202015250506001909201915061056d9050565b50506040805160608f901b7fffffffffffffffffffffffffffffffffffffffff00000000000000000000000016602080830191909152603482018990527fffff0000000000000000000000000000000000000000000000000000000000008816605483015282516036818403018152605690920190925280519101206000945030935063233fd52d92509050338d8d8d602d90606d9261088e93929190611f5a565b8f8f606d9080926108a193929190611f5a565b6040518863ffffffff1660e01b81526004016108c39796959493929190611fc0565b6020604051808303816000875af11580156108e2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109069190612021565b9050817dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916838b73ffffffffffffffffffffffffffffffffffffffff167f3617b009e9785c42daebadb6d3fb553243a4bf586d07ea72d65d80013ce116b584604051610975911515815260200190565b60405180910390a450505050505050505050565b3360009081526003602052604081205460ff166109d2576040517fd79e123d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006109e26113886161a861204a565b5a6109ed919061205d565b90506109fd6113886161a861204a565b610a0a9062015f9061204a565b610a169061271061204a565b811015610a52576040517f0bfecd63000000000000000000000000000000000000000000000000000000008152600481018a90526024016104b8565b6000898152600460209081526040918290208251608081018452905473ffffffffffffffffffffffffffffffffffffffff8116825274010000000000000000000000000000000000000000810460ff90811615159383019390935275010000000000000000000000000000000000000000008104909216151592810183905276010000000000000000000000000000000000000000000090910469ffffffffffffffffffff1660608201529080610b0a575080602001515b15610b44576040517fa53dc8ca000000000000000000000000000000000000000000000000000000008152600481018b90526024016104b8565b60008a8152600460205260409020805469ffffffffffffffffffff84167601000000000000000000000000000000000000000000000275ffff000000000000000000000000000000000000000090911673ffffffffffffffffffffffffffffffffffffffff8c1617179055610bd9887f805f2132000000000000000000000000000000000000000000000000000000006115f4565b610c3057505050600087815260046020526040812080547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1674010000000000000000000000000000000000000000179055610d3f565b60008088888888604051602401610c4a9493929190612070565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f805f213200000000000000000000000000000000000000000000000000000000179052905060006113885a610cd2919061205d565b905060008083516020850160008f86f192508215610d375760008d815260046020526040902080547fffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffff1675010000000000000000000000000000000000000000001790555b509093505050505b979650505050505050565b6040805160c0810182526000808252602080830182905282840182905260608084018390526080840183905260a0840183905284519088901b7fffffffffffffffffffffffffffffffffffffffff0000000000000000000000001681830152603481018790527fffff000000000000000000000000000000000000000000000000000000000000861660548201528451603681830301815260568201808752815191840191909120808552600490935285842060d68301909652945473ffffffffffffffffffffffffffffffffffffffff811680875274010000000000000000000000000000000000000000820460ff9081161515607685015275010000000000000000000000000000000000000000008304161515609684015276010000000000000000000000000000000000000000000090910469ffffffffffffffffffff1660b69092019190915292939092909190610ea857506000610ed0565b816020015115610eba57506002610ed0565b8160400151610eca576003610ecd565b60015b90505b6040518060c00160405280848152602001826003811115610ef357610ef3611c38565b8152602001836000015173ffffffffffffffffffffffffffffffffffffffff168152602001836020015115158152602001836040015115158152602001836060015169ffffffffffffffffffff1681525093505050509392505050565b610f58611619565b73ffffffffffffffffffffffffffffffffffffffff811660008181526003602052604080822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055517fb96d15bf9258c7b8df062753a6a262864611fc7b060a5ee2e57e79b85f898d389190a250565b610fd4611619565b73ffffffffffffffffffffffffffffffffffffffff811660008181526003602052604080822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055517f0ea0ce2c048ff45a4a95f2947879de3fb94abec2f152190400cab2d1272a68e79190a250565b60015473ffffffffffffffffffffffffffffffffffffffff1633146110cc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e65720000000000000000000060448201526064016104b8565b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b611150611619565b8260ff1660000361118d576040517f0743bae600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b601f8111156111d2576040517f61750f4000000000000000000000000000000000000000000000000000000000815260048101829052601f60248201526044016104b8565b6111dd836003612097565b60ff16811161123b57806111f2846003612097565b6111fd906001611e1e565b6040517f9dd9e6d8000000000000000000000000000000000000000000000000000000008152600481019290925260ff1660248201526044016104b8565b67ffffffff00000000602086901b1663ffffffff85161760005b67ffffffffffffffff82166000908152600260205260409020600101548110156112eb5767ffffffffffffffff82166000908152600260208190526040822060018101805491909201929190849081106112b1576112b1611e61565b600091825260208083209091015473ffffffffffffffffffffffffffffffffffffffff168352820192909252604001812055600101611255565b5060005b8281101561146757600084848381811061130b5761130b611e61565b90506020020160208101906113209190611d0f565b905073ffffffffffffffffffffffffffffffffffffffff8116611387576040517fbf18af4300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff821660048201526024016104b8565b67ffffffffffffffff8316600090815260026020818152604080842073ffffffffffffffffffffffffffffffffffffffff86168552909201905290205415611413576040517fe021c4f200000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff821660048201526024016104b8565b61141e82600161204a565b67ffffffffffffffff8416600090815260026020818152604080842073ffffffffffffffffffffffffffffffffffffffff909616845294909101905291909120556001016112ef565b5067ffffffffffffffff8116600090815260026020526040902061148f9060010184846118df565b5067ffffffffffffffff81166000908152600260205260409081902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660ff87161790555163ffffffff86811691908816907f4120bd3b23957dd423555817d55654d4481b438aa15485c21b4180c784f1a45590611515908890889088906120b3565b60405180910390a3505050505050565b61152d611619565b63ffffffff818116602084811b67ffffffff00000000168217600090815260028252604080822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690558051828152928301905291928516917f4120bd3b23957dd423555817d55654d4481b438aa15485c21b4180c784f1a455916040516115b9929190612119565b60405180910390a35050565b6115cd611619565b6115d68161169c565b50565b60218101516045820151608b90920151909260c09290921c91565b60006115ff83611791565b8015611610575061161083836117f5565b90505b92915050565b60005473ffffffffffffffffffffffffffffffffffffffff16331461169a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e65720000000000000000000060448201526064016104b8565b565b3373ffffffffffffffffffffffffffffffffffffffff82160361171b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c6600000000000000000060448201526064016104b8565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b60006117bd827f01ffc9a7000000000000000000000000000000000000000000000000000000006117f5565b801561161357506117ee827fffffffff000000000000000000000000000000000000000000000000000000006117f5565b1592915050565b604080517fffffffff000000000000000000000000000000000000000000000000000000008316602480830191909152825180830390910181526044909101909152602080820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f01ffc9a700000000000000000000000000000000000000000000000000000000178152825160009392849283928392918391908a617530fa92503d915060005190508280156118ad575060208210155b8015610d3f575015159695505050505050565b6040518061040001604052806020906020820280368337509192915050565b828054828255906000526020600020908101928215611957579160200282015b828111156119575781547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8435161782556020909201916001909101906118ff565b50611963929150611967565b5090565b5b808211156119635760008155600101611968565b803573ffffffffffffffffffffffffffffffffffffffff811681146119a057600080fd5b919050565b60008083601f8401126119b757600080fd5b50813567ffffffffffffffff8111156119cf57600080fd5b6020830191508360208285010111156119e757600080fd5b9250929050565b60008083601f840112611a0057600080fd5b50813567ffffffffffffffff811115611a1857600080fd5b6020830191508360208260051b85010111156119e757600080fd5b60008060008060008060006080888a031215611a4e57600080fd5b611a578861197c565b9650602088013567ffffffffffffffff80821115611a7457600080fd5b611a808b838c016119a5565b909850965060408a0135915080821115611a9957600080fd5b611aa58b838c016119a5565b909650945060608a0135915080821115611abe57600080fd5b50611acb8a828b016119ee565b989b979a50959850939692959293505050565b60006020808352835180602085015260005b81811015611b0c57858101830151858201604001528201611af0565b5060006040828601015260407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8301168501019250505092915050565b600080600080600080600060a0888a031215611b6657600080fd5b87359650611b766020890161197c565b9550611b846040890161197c565b9450606088013567ffffffffffffffff80821115611ba157600080fd5b611bad8b838c016119a5565b909650945060808a0135915080821115611bc657600080fd5b50611acb8a828b016119a5565b600080600060608486031215611be857600080fd5b611bf18461197c565b92506020840135915060408401357fffff00000000000000000000000000000000000000000000000000000000000081168114611c2d57600080fd5b809150509250925092565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b81518152602082015160c082019060048110611cac577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b8060208401525073ffffffffffffffffffffffffffffffffffffffff604084015116604083015260608301511515606083015260808301511515608083015260a0830151611d0860a084018269ffffffffffffffffffff169052565b5092915050565b600060208284031215611d2157600080fd5b6116108261197c565b803563ffffffff811681146119a057600080fd5b600080600080600060808688031215611d5657600080fd5b611d5f86611d2a565b9450611d6d60208701611d2a565b9350604086013560ff81168114611d8357600080fd5b9250606086013567ffffffffffffffff811115611d9f57600080fd5b611dab888289016119ee565b969995985093965092949392505050565b60008060408385031215611dcf57600080fd5b611dd883611d2a565b9150611de660208401611d2a565b90509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60ff818116838216019081111561161357611613611def565b8183823760009101908152919050565b838152818360208301376000910160200190815292915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112611ec557600080fd5b83018035915067ffffffffffffffff821115611ee057600080fd5b6020019150368190038213156119e757600080fd5b8183528181602085013750600060208284010152600060207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b602081526000611f52602083018486611ef5565b949350505050565b60008085851115611f6a57600080fd5b83861115611f7757600080fd5b5050820193919092039150565b80356020831015611613577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff602084900360031b1b1692915050565b878152600073ffffffffffffffffffffffffffffffffffffffff808916602084015280881660408401525060a0606083015261200060a083018688611ef5565b8281036080840152612013818587611ef5565b9a9950505050505050505050565b60006020828403121561203357600080fd5b8151801515811461204357600080fd5b9392505050565b8082018082111561161357611613611def565b8181038181111561161357611613611def565b604081526000612084604083018688611ef5565b8281036020840152610d3f818587611ef5565b60ff8181168382160290811690818114611d0857611d08611def565b60ff8416815260406020808301829052908201839052600090849060608401835b8681101561210d5773ffffffffffffffffffffffffffffffffffffffff6120fa8561197c565b16825292820192908201906001016120d4565b50979650505050505050565b60006040820160ff8516835260206040602085015281855180845260608601915060208701935060005b8181101561217557845173ffffffffffffffffffffffffffffffffffffffff1683529383019391830191600101612143565b509097965050505050505056fea164736f6c6343000818000a", } var KeystoneForwarderABI = KeystoneForwarderMetaData.ABI @@ -193,26 +202,26 @@ func (_KeystoneForwarder *KeystoneForwarderCallerSession) GetTransmissionId(rece return _KeystoneForwarder.Contract.GetTransmissionId(&_KeystoneForwarder.CallOpts, receiver, workflowExecutionId, reportId) } -func (_KeystoneForwarder *KeystoneForwarderCaller) GetTransmissionState(opts *bind.CallOpts, receiver common.Address, workflowExecutionId [32]byte, reportId [2]byte) (uint8, error) { +func (_KeystoneForwarder *KeystoneForwarderCaller) GetTransmissionInfo(opts *bind.CallOpts, receiver common.Address, workflowExecutionId [32]byte, reportId [2]byte) (IRouterTransmissionInfo, error) { var out []interface{} - err := _KeystoneForwarder.contract.Call(opts, &out, "getTransmissionState", receiver, workflowExecutionId, reportId) + err := _KeystoneForwarder.contract.Call(opts, &out, "getTransmissionInfo", receiver, workflowExecutionId, reportId) if err != nil { - return *new(uint8), err + return *new(IRouterTransmissionInfo), err } - out0 := *abi.ConvertType(out[0], new(uint8)).(*uint8) + out0 := *abi.ConvertType(out[0], new(IRouterTransmissionInfo)).(*IRouterTransmissionInfo) return out0, err } -func (_KeystoneForwarder *KeystoneForwarderSession) GetTransmissionState(receiver common.Address, workflowExecutionId [32]byte, reportId [2]byte) (uint8, error) { - return _KeystoneForwarder.Contract.GetTransmissionState(&_KeystoneForwarder.CallOpts, receiver, workflowExecutionId, reportId) +func (_KeystoneForwarder *KeystoneForwarderSession) GetTransmissionInfo(receiver common.Address, workflowExecutionId [32]byte, reportId [2]byte) (IRouterTransmissionInfo, error) { + return _KeystoneForwarder.Contract.GetTransmissionInfo(&_KeystoneForwarder.CallOpts, receiver, workflowExecutionId, reportId) } -func (_KeystoneForwarder *KeystoneForwarderCallerSession) GetTransmissionState(receiver common.Address, workflowExecutionId [32]byte, reportId [2]byte) (uint8, error) { - return _KeystoneForwarder.Contract.GetTransmissionState(&_KeystoneForwarder.CallOpts, receiver, workflowExecutionId, reportId) +func (_KeystoneForwarder *KeystoneForwarderCallerSession) GetTransmissionInfo(receiver common.Address, workflowExecutionId [32]byte, reportId [2]byte) (IRouterTransmissionInfo, error) { + return _KeystoneForwarder.Contract.GetTransmissionInfo(&_KeystoneForwarder.CallOpts, receiver, workflowExecutionId, reportId) } func (_KeystoneForwarder *KeystoneForwarderCaller) GetTransmitter(opts *bind.CallOpts, receiver common.Address, workflowExecutionId [32]byte, reportId [2]byte) (common.Address, error) { @@ -1260,7 +1269,7 @@ func (_KeystoneForwarder *KeystoneForwarder) Address() common.Address { type KeystoneForwarderInterface interface { GetTransmissionId(opts *bind.CallOpts, receiver common.Address, workflowExecutionId [32]byte, reportId [2]byte) ([32]byte, error) - GetTransmissionState(opts *bind.CallOpts, receiver common.Address, workflowExecutionId [32]byte, reportId [2]byte) (uint8, error) + GetTransmissionInfo(opts *bind.CallOpts, receiver common.Address, workflowExecutionId [32]byte, reportId [2]byte) (IRouterTransmissionInfo, error) GetTransmitter(opts *bind.CallOpts, receiver common.Address, workflowExecutionId [32]byte, reportId [2]byte) (common.Address, error) diff --git a/core/gethwrappers/keystone/generated/ocr3_capability/ocr3_capability.go b/core/gethwrappers/keystone/generated/ocr3_capability/ocr3_capability.go index e51f4762d88..21aeb4975c9 100644 --- a/core/gethwrappers/keystone/generated/ocr3_capability/ocr3_capability.go +++ b/core/gethwrappers/keystone/generated/ocr3_capability/ocr3_capability.go @@ -31,8 +31,8 @@ var ( ) var OCR3CapabilityMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"message\",\"type\":\"string\"}],\"name\":\"InvalidConfig\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"message\",\"type\":\"string\"}],\"name\":\"ReportInvalid\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ReportingUnsupported\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"previousConfigBlockNumber\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"configCount\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"signers\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"transmitters\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"f\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"onchainConfig\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"offchainConfigVersion\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"offchainConfig\",\"type\":\"bytes\"}],\"name\":\"ConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"epoch\",\"type\":\"uint32\"}],\"name\":\"Transmitted\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestConfigDetails\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"configCount\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"blockNumber\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestConfigDigestAndEpoch\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"scanLogs\",\"type\":\"bool\"},{\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"internalType\":\"uint32\",\"name\":\"epoch\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"_signers\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"_transmitters\",\"type\":\"address[]\"},{\"internalType\":\"uint8\",\"name\":\"_f\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"_onchainConfig\",\"type\":\"bytes\"},{\"internalType\":\"uint64\",\"name\":\"_offchainConfigVersion\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"_offchainConfig\",\"type\":\"bytes\"}],\"name\":\"setConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32[3]\",\"name\":\"reportContext\",\"type\":\"bytes32[3]\"},{\"internalType\":\"bytes\",\"name\":\"report\",\"type\":\"bytes\"},{\"internalType\":\"bytes32[]\",\"name\":\"rs\",\"type\":\"bytes32[]\"},{\"internalType\":\"bytes32[]\",\"name\":\"ss\",\"type\":\"bytes32[]\"},{\"internalType\":\"bytes32\",\"name\":\"rawVs\",\"type\":\"bytes32\"}],\"name\":\"transmit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"transmitters\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"pure\",\"type\":\"function\"}]", - Bin: "0x60806040523480156200001157600080fd5b503380600081620000695760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b03848116919091179091558116156200009c576200009c81620000a5565b50505062000150565b336001600160a01b03821603620000ff5760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640162000060565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b611fe180620001606000396000f3fe608060405234801561001057600080fd5b50600436106100a35760003560e01c80638da5cb5b11610076578063b1dc65a41161005b578063b1dc65a4146101c4578063e3d0e712146101d7578063f2fde38b146101ea57600080fd5b80638da5cb5b1461017c578063afcb95d7146101a457600080fd5b8063181f5a77146100a857806379ba5097146100f057806381411834146100fa57806381ff70481461010f575b600080fd5b604080518082018252600e81527f4b657973746f6e6520312e302e30000000000000000000000000000000000000602082015290516100e79190611883565b60405180910390f35b6100f86101fd565b005b6101026102ff565b6040516100e791906118ef565b61015960015460025463ffffffff74010000000000000000000000000000000000000000830481169378010000000000000000000000000000000000000000000000009093041691565b6040805163ffffffff9485168152939092166020840152908201526060016100e7565b60005460405173ffffffffffffffffffffffffffffffffffffffff90911681526020016100e7565b6040805160018152600060208201819052918101919091526060016100e7565b6100f86101d236600461194e565b61036e565b6100f86101e5366004611c18565b610975565b6100f86101f8366004611ce5565b6114e0565b60015473ffffffffffffffffffffffffffffffffffffffff163314610283576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e65720000000000000000000060448201526064015b60405180910390fd5b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b6060600680548060200260200160405190810160405280929190818152602001828054801561036457602002820191906000526020600020905b815473ffffffffffffffffffffffffffffffffffffffff168152600190910190602001808311610339575b5050505050905090565b60005a604080518b3580825262ffffff6020808f0135600881901c929092169084015293945092917fb04e63db38c49950639fa09d29872f21f5d49d614f3a969d8adf3d4b52e41a62910160405180910390a16103cf8a8a8a8a8a8a6114f4565b6003546000906002906103ed9060ff80821691610100900416611d5e565b6103f79190611d7d565b610402906001611d5e565b60ff169050878114610470576040517f660bd4ba00000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f77726f6e67206e756d626572206f66207369676e617475726573000000000000604482015260640161027a565b8786146104ff576040517f660bd4ba00000000000000000000000000000000000000000000000000000000815260206004820152602860248201527f7265706f727420727320616e64207373206d757374206265206f66206571756160448201527f6c206c656e677468000000000000000000000000000000000000000000000000606482015260840161027a565b3360009081526004602090815260408083208151808301909252805460ff8082168452929391929184019161010090910416600281111561054257610542611dc6565b600281111561055357610553611dc6565b905250905060028160200151600281111561057057610570611dc6565b141580156105b957506006816000015160ff168154811061059357610593611d00565b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff163314155b15610620576040517f660bd4ba00000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f756e617574686f72697a6564207472616e736d69747465720000000000000000604482015260640161027a565b5050505061062c611800565b6000808a8a60405161063f929190611df5565b604051908190038120610656918e90602001611e05565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181528282528051602091820120838301909252600080845290830152915060005b898110156109575760006001848984602081106106bf576106bf611d00565b6106cc91901a601b611d5e565b8e8e868181106106de576106de611d00565b905060200201358d8d878181106106f7576106f7611d00565b9050602002013560405160008152602001604052604051610734949392919093845260ff9290921660208401526040830152606082015260800190565b6020604051602081039080840390855afa158015610756573d6000803e3d6000fd5b5050604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081015173ffffffffffffffffffffffffffffffffffffffff811660009081526004602090815290849020838501909452835460ff808216855292965092945084019161010090041660028111156107d6576107d6611dc6565b60028111156107e7576107e7611dc6565b905250925060018360200151600281111561080457610804611dc6565b1461086b576040517f660bd4ba00000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f61646472657373206e6f7420617574686f72697a656420746f207369676e0000604482015260640161027a565b8251600090879060ff16601f811061088557610885611d00565b602002015173ffffffffffffffffffffffffffffffffffffffff1614610907576040517f660bd4ba00000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f6e6f6e2d756e69717565207369676e6174757265000000000000000000000000604482015260640161027a565b8086846000015160ff16601f811061092157610921611d00565b73ffffffffffffffffffffffffffffffffffffffff909216602092909202015261094c600186611d5e565b9450506001016106a0565b505050610968833383858e8e6115ab565b5050505050505050505050565b855185518560ff16601f8311156109e8576040517f89a6198900000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f746f6f206d616e79207369676e65727300000000000000000000000000000000604482015260640161027a565b80600003610a52576040517f89a6198900000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f66206d75737420626520706f7369746976650000000000000000000000000000604482015260640161027a565b818314610ae0576040517f89a61989000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f6f7261636c6520616464726573736573206f7574206f6620726567697374726160448201527f74696f6e00000000000000000000000000000000000000000000000000000000606482015260840161027a565b610aeb816003611e19565b8311610b53576040517f89a6198900000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f6661756c74792d6f7261636c65206620746f6f20686967680000000000000000604482015260640161027a565b610b5b6115dd565b6040805160c0810182528a8152602081018a905260ff8916918101919091526060810187905267ffffffffffffffff8616608082015260a081018590525b60055415610d4e57600554600090610bb390600190611e30565b9050600060058281548110610bca57610bca611d00565b60009182526020822001546006805473ffffffffffffffffffffffffffffffffffffffff90921693509084908110610c0457610c04611d00565b600091825260208083209091015473ffffffffffffffffffffffffffffffffffffffff85811684526004909252604080842080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000090811690915592909116808452922080549091169055600580549192509080610c8457610c84611e43565b60008281526020902081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90810180547fffffffffffffffffffffffff00000000000000000000000000000000000000001690550190556006805480610ced57610ced611e43565b60008281526020902081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90810180547fffffffffffffffffffffffff000000000000000000000000000000000000000016905501905550610b99915050565b60005b8151518110156112fd57815180516000919083908110610d7357610d73611d00565b602002602001015173ffffffffffffffffffffffffffffffffffffffff1603610df8576040517f89a6198900000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f7369676e6572206d757374206e6f7420626520656d7074790000000000000000604482015260640161027a565b600073ffffffffffffffffffffffffffffffffffffffff1682602001518281518110610e2657610e26611d00565b602002602001015173ffffffffffffffffffffffffffffffffffffffff1603610eab576040517f89a6198900000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f7472616e736d6974746572206d757374206e6f7420626520656d707479000000604482015260640161027a565b60006004600084600001518481518110610ec757610ec7611d00565b60209081029190910181015173ffffffffffffffffffffffffffffffffffffffff16825281019190915260400160002054610100900460ff166002811115610f1157610f11611dc6565b14610f78576040517f89a6198900000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f7265706561746564207369676e65722061646472657373000000000000000000604482015260640161027a565b6040805180820190915260ff82168152600160208201528251805160049160009185908110610fa957610fa9611d00565b60209081029190910181015173ffffffffffffffffffffffffffffffffffffffff168252818101929092526040016000208251815460ff9091167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0082168117835592840151919283917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000161761010083600281111561104a5761104a611dc6565b02179055506000915061105a9050565b600460008460200151848151811061107457611074611d00565b60209081029190910181015173ffffffffffffffffffffffffffffffffffffffff16825281019190915260400160002054610100900460ff1660028111156110be576110be611dc6565b14611125576040517f89a6198900000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f7265706561746564207472616e736d6974746572206164647265737300000000604482015260640161027a565b6040805180820190915260ff82168152602081016002815250600460008460200151848151811061115857611158611d00565b60209081029190910181015173ffffffffffffffffffffffffffffffffffffffff168252818101929092526040016000208251815460ff9091167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0082168117835592840151919283917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000016176101008360028111156111f9576111f9611dc6565b02179055505082518051600592508390811061121757611217611d00565b602090810291909101810151825460018101845560009384529282902090920180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff909316929092179091558201518051600691908390811061129357611293611d00565b60209081029190910181015182546001808201855560009485529290932090920180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff9093169290921790915501610d51565b506040810151600380547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660ff909216919091179055600180547fffffffff00000000ffffffffffffffffffffffffffffffffffffffffffffffff8116780100000000000000000000000000000000000000000000000063ffffffff43811682029290921780855592048116929182916014916113b591849174010000000000000000000000000000000000000000900416611e72565b92506101000a81548163ffffffff021916908363ffffffff1602179055506114144630600160149054906101000a900463ffffffff1663ffffffff16856000015186602001518760400151886060015189608001518a60a00151611660565b600281905582518051600380547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff1661010060ff9093169290920291909117905560015460208501516040808701516060880151608089015160a08a015193517f1591690b8638f5fb2dbec82ac741805ac5da8b45dc5263f4875b0496fdce4e05986114cb988b9891977401000000000000000000000000000000000000000090920463ffffffff16969095919491939192611e96565b60405180910390a15050505050505050505050565b6114e86115dd565b6114f18161170b565b50565b6000611501826020611e19565b61150c856020611e19565b61151888610144611f2c565b6115229190611f2c565b61152c9190611f2c565b611537906000611f2c565b90503681146115a2576040517f660bd4ba00000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f63616c6c64617461206c656e677468206d69736d617463680000000000000000604482015260640161027a565b50505050505050565b6040517f0750181900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005473ffffffffffffffffffffffffffffffffffffffff16331461165e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e657200000000000000000000604482015260640161027a565b565b6000808a8a8a8a8a8a8a8a8a60405160200161168499989796959493929190611f3f565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815291905280516020909101207dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167e01000000000000000000000000000000000000000000000000000000000000179150509998505050505050505050565b3373ffffffffffffffffffffffffffffffffffffffff82160361178a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640161027a565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b604051806103e00160405280601f906020820280368337509192915050565b6000815180845260005b8181101561184557602081850181015186830182015201611829565b5060006020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b602081526000611896602083018461181f565b9392505050565b60008151808452602080850194506020840160005b838110156118e457815173ffffffffffffffffffffffffffffffffffffffff16875295820195908201906001016118b2565b509495945050505050565b602081526000611896602083018461189d565b60008083601f84011261191457600080fd5b50813567ffffffffffffffff81111561192c57600080fd5b6020830191508360208260051b850101111561194757600080fd5b9250929050565b60008060008060008060008060e0898b03121561196a57600080fd5b606089018a81111561197b57600080fd5b8998503567ffffffffffffffff8082111561199557600080fd5b818b0191508b601f8301126119a957600080fd5b8135818111156119b857600080fd5b8c60208285010111156119ca57600080fd5b6020830199508098505060808b01359150808211156119e857600080fd5b6119f48c838d01611902565b909750955060a08b0135915080821115611a0d57600080fd5b50611a1a8b828c01611902565b999c989b50969995989497949560c00135949350505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715611aa957611aa9611a33565b604052919050565b803573ffffffffffffffffffffffffffffffffffffffff81168114611ad557600080fd5b919050565b600082601f830112611aeb57600080fd5b8135602067ffffffffffffffff821115611b0757611b07611a33565b8160051b611b16828201611a62565b9283528481018201928281019087851115611b3057600080fd5b83870192505b84831015611b5657611b4783611ab1565b82529183019190830190611b36565b979650505050505050565b803560ff81168114611ad557600080fd5b600082601f830112611b8357600080fd5b813567ffffffffffffffff811115611b9d57611b9d611a33565b611bce60207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f84011601611a62565b818152846020838601011115611be357600080fd5b816020850160208301376000918101602001919091529392505050565b803567ffffffffffffffff81168114611ad557600080fd5b60008060008060008060c08789031215611c3157600080fd5b863567ffffffffffffffff80821115611c4957600080fd5b611c558a838b01611ada565b97506020890135915080821115611c6b57600080fd5b611c778a838b01611ada565b9650611c8560408a01611b61565b95506060890135915080821115611c9b57600080fd5b611ca78a838b01611b72565b9450611cb560808a01611c00565b935060a0890135915080821115611ccb57600080fd5b50611cd889828a01611b72565b9150509295509295509295565b600060208284031215611cf757600080fd5b61189682611ab1565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60ff8181168382160190811115611d7757611d77611d2f565b92915050565b600060ff831680611db7577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b8060ff84160491505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b8183823760009101908152919050565b828152606082602083013760800192915050565b8082028115828204841417611d7757611d77611d2f565b81810381811115611d7757611d77611d2f565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b63ffffffff818116838216019080821115611e8f57611e8f611d2f565b5092915050565b600061012063ffffffff808d1684528b6020850152808b16604085015250806060840152611ec68184018a61189d565b90508281036080840152611eda818961189d565b905060ff871660a084015282810360c0840152611ef7818761181f565b905067ffffffffffffffff851660e0840152828103610100840152611f1c818561181f565b9c9b505050505050505050505050565b80820180821115611d7757611d77611d2f565b60006101208b835273ffffffffffffffffffffffffffffffffffffffff8b16602084015267ffffffffffffffff808b166040850152816060850152611f868285018b61189d565b91508382036080850152611f9a828a61189d565b915060ff881660a085015283820360c0850152611fb7828861181f565b90861660e08501528381036101008501529050611f1c818561181f56fea164736f6c6343000818000a", + ABI: "[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"message\",\"type\":\"string\"}],\"name\":\"InvalidConfig\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ReportingUnsupported\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"previousConfigBlockNumber\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"configCount\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes[]\",\"name\":\"signers\",\"type\":\"bytes[]\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"transmitters\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"f\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"onchainConfig\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"offchainConfigVersion\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"offchainConfig\",\"type\":\"bytes\"}],\"name\":\"ConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"epoch\",\"type\":\"uint32\"}],\"name\":\"Transmitted\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestConfigDetails\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"configCount\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"blockNumber\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestConfigDigestAndEpoch\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"scanLogs\",\"type\":\"bool\"},{\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"internalType\":\"uint32\",\"name\":\"epoch\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes[]\",\"name\":\"_signers\",\"type\":\"bytes[]\"},{\"internalType\":\"address[]\",\"name\":\"_transmitters\",\"type\":\"address[]\"},{\"internalType\":\"uint8\",\"name\":\"_f\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"_onchainConfig\",\"type\":\"bytes\"},{\"internalType\":\"uint64\",\"name\":\"_offchainConfigVersion\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"_offchainConfig\",\"type\":\"bytes\"}],\"name\":\"setConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32[3]\",\"name\":\"\",\"type\":\"bytes32[3]\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"},{\"internalType\":\"bytes32[]\",\"name\":\"\",\"type\":\"bytes32[]\"},{\"internalType\":\"bytes32[]\",\"name\":\"\",\"type\":\"bytes32[]\"},{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"transmit\",\"outputs\":[],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"pure\",\"type\":\"function\"}]", + Bin: "0x608060405234801561001057600080fd5b5033806000816100675760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615610097576100978161009f565b505050610148565b336001600160a01b038216036100f75760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640161005e565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b611266806101576000396000f3fe608060405234801561001057600080fd5b50600436106100885760003560e01c80638da5cb5b1161005b5780638da5cb5b1461015f578063afcb95d714610187578063b1dc65a4146101a7578063f2fde38b146101ba57600080fd5b8063181f5a771461008d57806379ba5097146100d55780637f3c87d3146100df57806381ff7048146100f2575b600080fd5b604080518082018252600e81527f4b657973746f6e6520312e302e30000000000000000000000000000000000000602082015290516100cc9190610b02565b60405180910390f35b6100dd6101cd565b005b6100dd6100ed366004610c70565b6102cf565b61013c60015460025463ffffffff74010000000000000000000000000000000000000000830481169378010000000000000000000000000000000000000000000000009093041691565b6040805163ffffffff9485168152939092166020840152908201526060016100cc565b60005460405173ffffffffffffffffffffffffffffffffffffffff90911681526020016100cc565b6040805160018152600060208201819052918101919091526060016100cc565b6100dd6101b5366004610d4c565b61082f565b6100dd6101c8366004610e55565b610861565b60015473ffffffffffffffffffffffffffffffffffffffff163314610253576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e65720000000000000000000060448201526064015b60405180910390fd5b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b868560ff8616601f831115610340576040517f89a6198900000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f746f6f206d616e79207369676e65727300000000000000000000000000000000604482015260640161024a565b806000036103aa576040517f89a6198900000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f66206d75737420626520706f7369746976650000000000000000000000000000604482015260640161024a565b818314610438576040517f89a61989000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f6f7261636c6520616464726573736573206f7574206f6620726567697374726160448201527f74696f6e00000000000000000000000000000000000000000000000000000000606482015260840161024a565b610443816003610e9f565b83116104ab576040517f89a6198900000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f6661756c74792d6f7261636c65206620746f6f20686967680000000000000000604482015260640161024a565b6104b3610875565b60005b8a81101561069d5760008a8a838181106104d2576104d2610ebc565b90506020020160208101906104e79190610e55565b73ffffffffffffffffffffffffffffffffffffffff1603610564576040517f89a6198900000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f7472616e736d6974746572206d757374206e6f7420626520656d707479000000604482015260640161024a565b3660008d8d8481811061057957610579610ebc565b905060200281019061058b9190610eeb565b90925090506000815b8061ffff168261ffff16101561068d57600084848461ffff168181106105bc576105bc610ebc565b919091013560f81c915060009050600886866105d9876002610f50565b61ffff168181106105ec576105ec610ebc565b919091013560f81c90911b90508686610606876001610f50565b61ffff1681811061061957610619610ebc565b61062a9392013560f81c9050610f50565b9050366000878761063c886003610f50565b61ffff16908561064d8a6003610f50565b6106579190610f50565b61ffff169261066893929190610f72565b9092509050610678836003610f50565b6106829087610f50565b955050505050610594565b5050600190920191506104b69050565b50600380547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660ff8916179055600180547fffffffff00000000ffffffffffffffffffffffffffffffffffffffffffffffff8116780100000000000000000000000000000000000000000000000063ffffffff438116820292909217808555920481169291829160149161074c91849174010000000000000000000000000000000000000000900416610f9c565b92506101000a81548163ffffffff021916908363ffffffff1602179055506107954630600160149054906101000a900463ffffffff1663ffffffff168f8f8f8f8f8f8f8f6108f8565b6002600001819055508b8b9050600260010160016101000a81548160ff021916908360ff1602179055507f36257c6e8d535293ad661e377c0baac536289be6707b8a488ac175ddaa4055c881600260000154600160149054906101000a900463ffffffff168f8f8f8f8f8f8f8f6040516108199b9a99989796959493929190611128565b60405180910390a1505050505050505050505050565b6040517f0750181900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610869610875565b610872816109a9565b50565b60005473ffffffffffffffffffffffffffffffffffffffff1633146108f6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e657200000000000000000000604482015260640161024a565b565b6000808c8c8c8c8c8c8c8c8c8c8c6040516020016109209b9a999897969594939291906111c2565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815291905280516020909101207dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167e0e000000000000000000000000000000000000000000000000000000000000179150509b9a5050505050505050505050565b3373ffffffffffffffffffffffffffffffffffffffff821603610a28576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640161024a565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b6000815180845260005b81811015610ac457602081850181015186830182015201610aa8565b5060006020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b602081526000610b156020830184610a9e565b9392505050565b60008083601f840112610b2e57600080fd5b50813567ffffffffffffffff811115610b4657600080fd5b6020830191508360208260051b8501011115610b6157600080fd5b9250929050565b803560ff81168114610b7957600080fd5b919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600082601f830112610bbe57600080fd5b813567ffffffffffffffff80821115610bd957610bd9610b7e565b604051601f83017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f01168101908282118183101715610c1f57610c1f610b7e565b81604052838152866020858801011115610c3857600080fd5b836020870160208301376000602085830101528094505050505092915050565b803567ffffffffffffffff81168114610b7957600080fd5b60008060008060008060008060c0898b031215610c8c57600080fd5b883567ffffffffffffffff80821115610ca457600080fd5b610cb08c838d01610b1c565b909a50985060208b0135915080821115610cc957600080fd5b610cd58c838d01610b1c565b9098509650869150610ce960408c01610b68565b955060608b0135915080821115610cff57600080fd5b610d0b8c838d01610bad565b9450610d1960808c01610c58565b935060a08b0135915080821115610d2f57600080fd5b50610d3c8b828c01610bad565b9150509295985092959890939650565b60008060008060008060008060e0898b031215610d6857600080fd5b606089018a811115610d7957600080fd5b8998503567ffffffffffffffff80821115610d9357600080fd5b818b0191508b601f830112610da757600080fd5b813581811115610db657600080fd5b8c6020828501011115610dc857600080fd5b6020830199508098505060808b0135915080821115610de657600080fd5b610df28c838d01610b1c565b909750955060a08b0135915080821115610e0b57600080fd5b50610e188b828c01610b1c565b999c989b50969995989497949560c00135949350505050565b803573ffffffffffffffffffffffffffffffffffffffff81168114610b7957600080fd5b600060208284031215610e6757600080fd5b610b1582610e31565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8082028115828204841417610eb657610eb6610e70565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112610f2057600080fd5b83018035915067ffffffffffffffff821115610f3b57600080fd5b602001915036819003821315610b6157600080fd5b61ffff818116838216019080821115610f6b57610f6b610e70565b5092915050565b60008085851115610f8257600080fd5b83861115610f8f57600080fd5b5050820193919092039150565b63ffffffff818116838216019080821115610f6b57610f6b610e70565b8183528181602085013750600060208284010152600060207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b6000838385526020808601955060208560051b8301018460005b878110156110c7577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe085840301895281357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe188360301811261107d57600080fd5b8701848101903567ffffffffffffffff81111561109957600080fd5b8036038213156110a857600080fd5b6110b3858284610fb9565b9a86019a945050509083019060010161101c565b5090979650505050505050565b8183526000602080850194508260005b8581101561111d5773ffffffffffffffffffffffffffffffffffffffff61110a83610e31565b16875295820195908201906001016110e4565b509495945050505050565b600061012063ffffffff808f1684528d6020850152808d166040850152508060608401526111598184018b8d611002565b9050828103608084015261116e81898b6110d4565b905060ff871660a084015282810360c084015261118b8187610a9e565b905067ffffffffffffffff851660e08401528281036101008401526111b08185610a9e565b9e9d5050505050505050505050505050565b60006101208d835273ffffffffffffffffffffffffffffffffffffffff8d16602084015267ffffffffffffffff808d16604085015281606085015261120a8285018c8e611002565b9150838203608085015261121f828a8c6110d4565b915060ff881660a085015283820360c085015261123c8288610a9e565b90861660e085015283810361010085015290506111b08185610a9e56fea164736f6c6343000818000a", } var OCR3CapabilityABI = OCR3CapabilityMetaData.ABI @@ -255,26 +255,24 @@ func (_OCR3Capability *OCR3CapabilityCallerSession) Owner() (common.Address, err return _OCR3Capability.Contract.Owner(&_OCR3Capability.CallOpts) } -func (_OCR3Capability *OCR3CapabilityCaller) Transmitters(opts *bind.CallOpts) ([]common.Address, error) { +func (_OCR3Capability *OCR3CapabilityCaller) Transmit(opts *bind.CallOpts, arg0 [3][32]byte, arg1 []byte, arg2 [][32]byte, arg3 [][32]byte, arg4 [32]byte) error { var out []interface{} - err := _OCR3Capability.contract.Call(opts, &out, "transmitters") + err := _OCR3Capability.contract.Call(opts, &out, "transmit", arg0, arg1, arg2, arg3, arg4) if err != nil { - return *new([]common.Address), err + return err } - out0 := *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) - - return out0, err + return err } -func (_OCR3Capability *OCR3CapabilitySession) Transmitters() ([]common.Address, error) { - return _OCR3Capability.Contract.Transmitters(&_OCR3Capability.CallOpts) +func (_OCR3Capability *OCR3CapabilitySession) Transmit(arg0 [3][32]byte, arg1 []byte, arg2 [][32]byte, arg3 [][32]byte, arg4 [32]byte) error { + return _OCR3Capability.Contract.Transmit(&_OCR3Capability.CallOpts, arg0, arg1, arg2, arg3, arg4) } -func (_OCR3Capability *OCR3CapabilityCallerSession) Transmitters() ([]common.Address, error) { - return _OCR3Capability.Contract.Transmitters(&_OCR3Capability.CallOpts) +func (_OCR3Capability *OCR3CapabilityCallerSession) Transmit(arg0 [3][32]byte, arg1 []byte, arg2 [][32]byte, arg3 [][32]byte, arg4 [32]byte) error { + return _OCR3Capability.Contract.Transmit(&_OCR3Capability.CallOpts, arg0, arg1, arg2, arg3, arg4) } func (_OCR3Capability *OCR3CapabilityCaller) TypeAndVersion(opts *bind.CallOpts) (string, error) { @@ -311,15 +309,15 @@ func (_OCR3Capability *OCR3CapabilityTransactorSession) AcceptOwnership() (*type return _OCR3Capability.Contract.AcceptOwnership(&_OCR3Capability.TransactOpts) } -func (_OCR3Capability *OCR3CapabilityTransactor) SetConfig(opts *bind.TransactOpts, _signers []common.Address, _transmitters []common.Address, _f uint8, _onchainConfig []byte, _offchainConfigVersion uint64, _offchainConfig []byte) (*types.Transaction, error) { +func (_OCR3Capability *OCR3CapabilityTransactor) SetConfig(opts *bind.TransactOpts, _signers [][]byte, _transmitters []common.Address, _f uint8, _onchainConfig []byte, _offchainConfigVersion uint64, _offchainConfig []byte) (*types.Transaction, error) { return _OCR3Capability.contract.Transact(opts, "setConfig", _signers, _transmitters, _f, _onchainConfig, _offchainConfigVersion, _offchainConfig) } -func (_OCR3Capability *OCR3CapabilitySession) SetConfig(_signers []common.Address, _transmitters []common.Address, _f uint8, _onchainConfig []byte, _offchainConfigVersion uint64, _offchainConfig []byte) (*types.Transaction, error) { +func (_OCR3Capability *OCR3CapabilitySession) SetConfig(_signers [][]byte, _transmitters []common.Address, _f uint8, _onchainConfig []byte, _offchainConfigVersion uint64, _offchainConfig []byte) (*types.Transaction, error) { return _OCR3Capability.Contract.SetConfig(&_OCR3Capability.TransactOpts, _signers, _transmitters, _f, _onchainConfig, _offchainConfigVersion, _offchainConfig) } -func (_OCR3Capability *OCR3CapabilityTransactorSession) SetConfig(_signers []common.Address, _transmitters []common.Address, _f uint8, _onchainConfig []byte, _offchainConfigVersion uint64, _offchainConfig []byte) (*types.Transaction, error) { +func (_OCR3Capability *OCR3CapabilityTransactorSession) SetConfig(_signers [][]byte, _transmitters []common.Address, _f uint8, _onchainConfig []byte, _offchainConfigVersion uint64, _offchainConfig []byte) (*types.Transaction, error) { return _OCR3Capability.Contract.SetConfig(&_OCR3Capability.TransactOpts, _signers, _transmitters, _f, _onchainConfig, _offchainConfigVersion, _offchainConfig) } @@ -335,18 +333,6 @@ func (_OCR3Capability *OCR3CapabilityTransactorSession) TransferOwnership(to com return _OCR3Capability.Contract.TransferOwnership(&_OCR3Capability.TransactOpts, to) } -func (_OCR3Capability *OCR3CapabilityTransactor) Transmit(opts *bind.TransactOpts, reportContext [3][32]byte, report []byte, rs [][32]byte, ss [][32]byte, rawVs [32]byte) (*types.Transaction, error) { - return _OCR3Capability.contract.Transact(opts, "transmit", reportContext, report, rs, ss, rawVs) -} - -func (_OCR3Capability *OCR3CapabilitySession) Transmit(reportContext [3][32]byte, report []byte, rs [][32]byte, ss [][32]byte, rawVs [32]byte) (*types.Transaction, error) { - return _OCR3Capability.Contract.Transmit(&_OCR3Capability.TransactOpts, reportContext, report, rs, ss, rawVs) -} - -func (_OCR3Capability *OCR3CapabilityTransactorSession) Transmit(reportContext [3][32]byte, report []byte, rs [][32]byte, ss [][32]byte, rawVs [32]byte) (*types.Transaction, error) { - return _OCR3Capability.Contract.Transmit(&_OCR3Capability.TransactOpts, reportContext, report, rs, ss, rawVs) -} - type OCR3CapabilityConfigSetIterator struct { Event *OCR3CapabilityConfigSet @@ -411,7 +397,7 @@ type OCR3CapabilityConfigSet struct { PreviousConfigBlockNumber uint32 ConfigDigest [32]byte ConfigCount uint64 - Signers []common.Address + Signers [][]byte Transmitters []common.Address F uint8 OnchainConfig []byte @@ -890,7 +876,7 @@ func (_OCR3Capability *OCR3Capability) ParseLog(log types.Log) (generated.Abigen } func (OCR3CapabilityConfigSet) Topic() common.Hash { - return common.HexToHash("0x1591690b8638f5fb2dbec82ac741805ac5da8b45dc5263f4875b0496fdce4e05") + return common.HexToHash("0x36257c6e8d535293ad661e377c0baac536289be6707b8a488ac175ddaa4055c8") } func (OCR3CapabilityOwnershipTransferRequested) Topic() common.Hash { @@ -920,18 +906,16 @@ type OCR3CapabilityInterface interface { Owner(opts *bind.CallOpts) (common.Address, error) - Transmitters(opts *bind.CallOpts) ([]common.Address, error) + Transmit(opts *bind.CallOpts, arg0 [3][32]byte, arg1 []byte, arg2 [][32]byte, arg3 [][32]byte, arg4 [32]byte) error TypeAndVersion(opts *bind.CallOpts) (string, error) AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) - SetConfig(opts *bind.TransactOpts, _signers []common.Address, _transmitters []common.Address, _f uint8, _onchainConfig []byte, _offchainConfigVersion uint64, _offchainConfig []byte) (*types.Transaction, error) + SetConfig(opts *bind.TransactOpts, _signers [][]byte, _transmitters []common.Address, _f uint8, _onchainConfig []byte, _offchainConfigVersion uint64, _offchainConfig []byte) (*types.Transaction, error) TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) - Transmit(opts *bind.TransactOpts, reportContext [3][32]byte, report []byte, rs [][32]byte, ss [][32]byte, rawVs [32]byte) (*types.Transaction, error) - FilterConfigSet(opts *bind.FilterOpts) (*OCR3CapabilityConfigSetIterator, error) WatchConfigSet(opts *bind.WatchOpts, sink chan<- *OCR3CapabilityConfigSet) (event.Subscription, error) diff --git a/core/gethwrappers/keystone/generation/generated-wrapper-dependency-versions-do-not-edit.txt b/core/gethwrappers/keystone/generation/generated-wrapper-dependency-versions-do-not-edit.txt index 4051f950208..74d3b73e6a9 100644 --- a/core/gethwrappers/keystone/generation/generated-wrapper-dependency-versions-do-not-edit.txt +++ b/core/gethwrappers/keystone/generation/generated-wrapper-dependency-versions-do-not-edit.txt @@ -1,4 +1,5 @@ GETH_VERSION: 1.13.8 -capabilities_registry: ../../../contracts/solc/v0.8.24/CapabilitiesRegistry/CapabilitiesRegistry.abi ../../../contracts/solc/v0.8.24/CapabilitiesRegistry/CapabilitiesRegistry.bin 3a082f0307411f41c30db26e61d59adcd5b003141a5aa8fe79d7779619028e26 -forwarder: ../../../contracts/solc/v0.8.24/KeystoneForwarder/KeystoneForwarder.abi ../../../contracts/solc/v0.8.24/KeystoneForwarder/KeystoneForwarder.bin dc98a86a3775ead987b79d5b6079ee0e26f31c0626032bdd6508f986e2423227 -ocr3_capability: ../../../contracts/solc/v0.8.24/OCR3Capability/OCR3Capability.abi ../../../contracts/solc/v0.8.24/OCR3Capability/OCR3Capability.bin 8bf0f53f222efce7143dea6134552eb26ea1eef845407b4475a0d79b7d7ba9f8 +capabilities_registry: ../../../contracts/solc/v0.8.24/CapabilitiesRegistry/CapabilitiesRegistry.abi ../../../contracts/solc/v0.8.24/CapabilitiesRegistry/CapabilitiesRegistry.bin cb3e79280a928979bc37de154b12b876996bdbe10f1827e683ee2bfa7a429a6c +feeds_consumer: ../../../contracts/solc/v0.8.24/KeystoneFeedsConsumer/KeystoneFeedsConsumer.abi ../../../contracts/solc/v0.8.24/KeystoneFeedsConsumer/KeystoneFeedsConsumer.bin 6ac5b12eff3b022a35c3c40d5ed0285bf9bfec0e3669a4b12307332a216048ca +forwarder: ../../../contracts/solc/v0.8.24/KeystoneForwarder/KeystoneForwarder.abi ../../../contracts/solc/v0.8.24/KeystoneForwarder/KeystoneForwarder.bin 03911334d0c88f8ee8ee2d9832fd312bc8a48c824fcda5c807585af2d0e6a148 +ocr3_capability: ../../../contracts/solc/v0.8.24/OCR3Capability/OCR3Capability.abi ../../../contracts/solc/v0.8.24/OCR3Capability/OCR3Capability.bin 2a6bfae30ccf38327fc7e78605a226839dfa0ce5a1a22e0414b91d24c35b3a53 diff --git a/core/gethwrappers/keystone/go_generate.go b/core/gethwrappers/keystone/go_generate.go index 36b27852ad6..79f49264b39 100644 --- a/core/gethwrappers/keystone/go_generate.go +++ b/core/gethwrappers/keystone/go_generate.go @@ -7,3 +7,4 @@ package gethwrappers //go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.24/KeystoneForwarder/KeystoneForwarder.abi ../../../contracts/solc/v0.8.24/KeystoneForwarder/KeystoneForwarder.bin KeystoneForwarder forwarder //go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.24/OCR3Capability/OCR3Capability.abi ../../../contracts/solc/v0.8.24/OCR3Capability/OCR3Capability.bin OCR3Capability ocr3_capability //go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.24/CapabilitiesRegistry/CapabilitiesRegistry.abi ../../../contracts/solc/v0.8.24/CapabilitiesRegistry/CapabilitiesRegistry.bin CapabilitiesRegistry capabilities_registry +//go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.24/KeystoneFeedsConsumer/KeystoneFeedsConsumer.abi ../../../contracts/solc/v0.8.24/KeystoneFeedsConsumer/KeystoneFeedsConsumer.bin KeystoneFeedsConsumer feeds_consumer diff --git a/core/gethwrappers/liquiditymanager/generated/abstract_arbitrum_token_gateway/abstract_arbitrum_token_gateway.go b/core/gethwrappers/liquiditymanager/generated/abstract_arbitrum_token_gateway/abstract_arbitrum_token_gateway.go new file mode 100644 index 00000000000..d9dd3f435de --- /dev/null +++ b/core/gethwrappers/liquiditymanager/generated/abstract_arbitrum_token_gateway/abstract_arbitrum_token_gateway.go @@ -0,0 +1,283 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package abstract_arbitrum_token_gateway + +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" +) + +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +var AbstractArbitrumTokenGatewayMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"l1ERC20\",\"type\":\"address\"}],\"name\":\"calculateL2TokenAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"counterpartGateway\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_token\",\"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\":\"finalizeInboundTransfer\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_token\",\"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\":\"getOutboundCalldata\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_token\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_maxGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_gasPriceBid\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"outboundTransfer\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"router\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", +} + +var AbstractArbitrumTokenGatewayABI = AbstractArbitrumTokenGatewayMetaData.ABI + +type AbstractArbitrumTokenGateway struct { + address common.Address + abi abi.ABI + AbstractArbitrumTokenGatewayCaller + AbstractArbitrumTokenGatewayTransactor + AbstractArbitrumTokenGatewayFilterer +} + +type AbstractArbitrumTokenGatewayCaller struct { + contract *bind.BoundContract +} + +type AbstractArbitrumTokenGatewayTransactor struct { + contract *bind.BoundContract +} + +type AbstractArbitrumTokenGatewayFilterer struct { + contract *bind.BoundContract +} + +type AbstractArbitrumTokenGatewaySession struct { + Contract *AbstractArbitrumTokenGateway + CallOpts bind.CallOpts + TransactOpts bind.TransactOpts +} + +type AbstractArbitrumTokenGatewayCallerSession struct { + Contract *AbstractArbitrumTokenGatewayCaller + CallOpts bind.CallOpts +} + +type AbstractArbitrumTokenGatewayTransactorSession struct { + Contract *AbstractArbitrumTokenGatewayTransactor + TransactOpts bind.TransactOpts +} + +type AbstractArbitrumTokenGatewayRaw struct { + Contract *AbstractArbitrumTokenGateway +} + +type AbstractArbitrumTokenGatewayCallerRaw struct { + Contract *AbstractArbitrumTokenGatewayCaller +} + +type AbstractArbitrumTokenGatewayTransactorRaw struct { + Contract *AbstractArbitrumTokenGatewayTransactor +} + +func NewAbstractArbitrumTokenGateway(address common.Address, backend bind.ContractBackend) (*AbstractArbitrumTokenGateway, error) { + abi, err := abi.JSON(strings.NewReader(AbstractArbitrumTokenGatewayABI)) + if err != nil { + return nil, err + } + contract, err := bindAbstractArbitrumTokenGateway(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &AbstractArbitrumTokenGateway{address: address, abi: abi, AbstractArbitrumTokenGatewayCaller: AbstractArbitrumTokenGatewayCaller{contract: contract}, AbstractArbitrumTokenGatewayTransactor: AbstractArbitrumTokenGatewayTransactor{contract: contract}, AbstractArbitrumTokenGatewayFilterer: AbstractArbitrumTokenGatewayFilterer{contract: contract}}, nil +} + +func NewAbstractArbitrumTokenGatewayCaller(address common.Address, caller bind.ContractCaller) (*AbstractArbitrumTokenGatewayCaller, error) { + contract, err := bindAbstractArbitrumTokenGateway(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &AbstractArbitrumTokenGatewayCaller{contract: contract}, nil +} + +func NewAbstractArbitrumTokenGatewayTransactor(address common.Address, transactor bind.ContractTransactor) (*AbstractArbitrumTokenGatewayTransactor, error) { + contract, err := bindAbstractArbitrumTokenGateway(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &AbstractArbitrumTokenGatewayTransactor{contract: contract}, nil +} + +func NewAbstractArbitrumTokenGatewayFilterer(address common.Address, filterer bind.ContractFilterer) (*AbstractArbitrumTokenGatewayFilterer, error) { + contract, err := bindAbstractArbitrumTokenGateway(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &AbstractArbitrumTokenGatewayFilterer{contract: contract}, nil +} + +func bindAbstractArbitrumTokenGateway(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := AbstractArbitrumTokenGatewayMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +func (_AbstractArbitrumTokenGateway *AbstractArbitrumTokenGatewayRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _AbstractArbitrumTokenGateway.Contract.AbstractArbitrumTokenGatewayCaller.contract.Call(opts, result, method, params...) +} + +func (_AbstractArbitrumTokenGateway *AbstractArbitrumTokenGatewayRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _AbstractArbitrumTokenGateway.Contract.AbstractArbitrumTokenGatewayTransactor.contract.Transfer(opts) +} + +func (_AbstractArbitrumTokenGateway *AbstractArbitrumTokenGatewayRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _AbstractArbitrumTokenGateway.Contract.AbstractArbitrumTokenGatewayTransactor.contract.Transact(opts, method, params...) +} + +func (_AbstractArbitrumTokenGateway *AbstractArbitrumTokenGatewayCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _AbstractArbitrumTokenGateway.Contract.contract.Call(opts, result, method, params...) +} + +func (_AbstractArbitrumTokenGateway *AbstractArbitrumTokenGatewayTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _AbstractArbitrumTokenGateway.Contract.contract.Transfer(opts) +} + +func (_AbstractArbitrumTokenGateway *AbstractArbitrumTokenGatewayTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _AbstractArbitrumTokenGateway.Contract.contract.Transact(opts, method, params...) +} + +func (_AbstractArbitrumTokenGateway *AbstractArbitrumTokenGatewayCaller) CalculateL2TokenAddress(opts *bind.CallOpts, l1ERC20 common.Address) (common.Address, error) { + var out []interface{} + err := _AbstractArbitrumTokenGateway.contract.Call(opts, &out, "calculateL2TokenAddress", l1ERC20) + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_AbstractArbitrumTokenGateway *AbstractArbitrumTokenGatewaySession) CalculateL2TokenAddress(l1ERC20 common.Address) (common.Address, error) { + return _AbstractArbitrumTokenGateway.Contract.CalculateL2TokenAddress(&_AbstractArbitrumTokenGateway.CallOpts, l1ERC20) +} + +func (_AbstractArbitrumTokenGateway *AbstractArbitrumTokenGatewayCallerSession) CalculateL2TokenAddress(l1ERC20 common.Address) (common.Address, error) { + return _AbstractArbitrumTokenGateway.Contract.CalculateL2TokenAddress(&_AbstractArbitrumTokenGateway.CallOpts, l1ERC20) +} + +func (_AbstractArbitrumTokenGateway *AbstractArbitrumTokenGatewayCaller) CounterpartGateway(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _AbstractArbitrumTokenGateway.contract.Call(opts, &out, "counterpartGateway") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_AbstractArbitrumTokenGateway *AbstractArbitrumTokenGatewaySession) CounterpartGateway() (common.Address, error) { + return _AbstractArbitrumTokenGateway.Contract.CounterpartGateway(&_AbstractArbitrumTokenGateway.CallOpts) +} + +func (_AbstractArbitrumTokenGateway *AbstractArbitrumTokenGatewayCallerSession) CounterpartGateway() (common.Address, error) { + return _AbstractArbitrumTokenGateway.Contract.CounterpartGateway(&_AbstractArbitrumTokenGateway.CallOpts) +} + +func (_AbstractArbitrumTokenGateway *AbstractArbitrumTokenGatewayCaller) GetOutboundCalldata(opts *bind.CallOpts, _token common.Address, _from common.Address, _to common.Address, _amount *big.Int, _data []byte) ([]byte, error) { + var out []interface{} + err := _AbstractArbitrumTokenGateway.contract.Call(opts, &out, "getOutboundCalldata", _token, _from, _to, _amount, _data) + + if err != nil { + return *new([]byte), err + } + + out0 := *abi.ConvertType(out[0], new([]byte)).(*[]byte) + + return out0, err + +} + +func (_AbstractArbitrumTokenGateway *AbstractArbitrumTokenGatewaySession) GetOutboundCalldata(_token common.Address, _from common.Address, _to common.Address, _amount *big.Int, _data []byte) ([]byte, error) { + return _AbstractArbitrumTokenGateway.Contract.GetOutboundCalldata(&_AbstractArbitrumTokenGateway.CallOpts, _token, _from, _to, _amount, _data) +} + +func (_AbstractArbitrumTokenGateway *AbstractArbitrumTokenGatewayCallerSession) GetOutboundCalldata(_token common.Address, _from common.Address, _to common.Address, _amount *big.Int, _data []byte) ([]byte, error) { + return _AbstractArbitrumTokenGateway.Contract.GetOutboundCalldata(&_AbstractArbitrumTokenGateway.CallOpts, _token, _from, _to, _amount, _data) +} + +func (_AbstractArbitrumTokenGateway *AbstractArbitrumTokenGatewayCaller) Router(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _AbstractArbitrumTokenGateway.contract.Call(opts, &out, "router") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_AbstractArbitrumTokenGateway *AbstractArbitrumTokenGatewaySession) Router() (common.Address, error) { + return _AbstractArbitrumTokenGateway.Contract.Router(&_AbstractArbitrumTokenGateway.CallOpts) +} + +func (_AbstractArbitrumTokenGateway *AbstractArbitrumTokenGatewayCallerSession) Router() (common.Address, error) { + return _AbstractArbitrumTokenGateway.Contract.Router(&_AbstractArbitrumTokenGateway.CallOpts) +} + +func (_AbstractArbitrumTokenGateway *AbstractArbitrumTokenGatewayTransactor) FinalizeInboundTransfer(opts *bind.TransactOpts, _token common.Address, _from common.Address, _to common.Address, _amount *big.Int, _data []byte) (*types.Transaction, error) { + return _AbstractArbitrumTokenGateway.contract.Transact(opts, "finalizeInboundTransfer", _token, _from, _to, _amount, _data) +} + +func (_AbstractArbitrumTokenGateway *AbstractArbitrumTokenGatewaySession) FinalizeInboundTransfer(_token common.Address, _from common.Address, _to common.Address, _amount *big.Int, _data []byte) (*types.Transaction, error) { + return _AbstractArbitrumTokenGateway.Contract.FinalizeInboundTransfer(&_AbstractArbitrumTokenGateway.TransactOpts, _token, _from, _to, _amount, _data) +} + +func (_AbstractArbitrumTokenGateway *AbstractArbitrumTokenGatewayTransactorSession) FinalizeInboundTransfer(_token common.Address, _from common.Address, _to common.Address, _amount *big.Int, _data []byte) (*types.Transaction, error) { + return _AbstractArbitrumTokenGateway.Contract.FinalizeInboundTransfer(&_AbstractArbitrumTokenGateway.TransactOpts, _token, _from, _to, _amount, _data) +} + +func (_AbstractArbitrumTokenGateway *AbstractArbitrumTokenGatewayTransactor) OutboundTransfer(opts *bind.TransactOpts, _token common.Address, _to common.Address, _amount *big.Int, _maxGas *big.Int, _gasPriceBid *big.Int, _data []byte) (*types.Transaction, error) { + return _AbstractArbitrumTokenGateway.contract.Transact(opts, "outboundTransfer", _token, _to, _amount, _maxGas, _gasPriceBid, _data) +} + +func (_AbstractArbitrumTokenGateway *AbstractArbitrumTokenGatewaySession) OutboundTransfer(_token common.Address, _to common.Address, _amount *big.Int, _maxGas *big.Int, _gasPriceBid *big.Int, _data []byte) (*types.Transaction, error) { + return _AbstractArbitrumTokenGateway.Contract.OutboundTransfer(&_AbstractArbitrumTokenGateway.TransactOpts, _token, _to, _amount, _maxGas, _gasPriceBid, _data) +} + +func (_AbstractArbitrumTokenGateway *AbstractArbitrumTokenGatewayTransactorSession) OutboundTransfer(_token common.Address, _to common.Address, _amount *big.Int, _maxGas *big.Int, _gasPriceBid *big.Int, _data []byte) (*types.Transaction, error) { + return _AbstractArbitrumTokenGateway.Contract.OutboundTransfer(&_AbstractArbitrumTokenGateway.TransactOpts, _token, _to, _amount, _maxGas, _gasPriceBid, _data) +} + +func (_AbstractArbitrumTokenGateway *AbstractArbitrumTokenGateway) Address() common.Address { + return _AbstractArbitrumTokenGateway.address +} + +type AbstractArbitrumTokenGatewayInterface interface { + CalculateL2TokenAddress(opts *bind.CallOpts, l1ERC20 common.Address) (common.Address, error) + + CounterpartGateway(opts *bind.CallOpts) (common.Address, error) + + GetOutboundCalldata(opts *bind.CallOpts, _token common.Address, _from common.Address, _to common.Address, _amount *big.Int, _data []byte) ([]byte, error) + + Router(opts *bind.CallOpts) (common.Address, error) + + FinalizeInboundTransfer(opts *bind.TransactOpts, _token common.Address, _from common.Address, _to common.Address, _amount *big.Int, _data []byte) (*types.Transaction, error) + + OutboundTransfer(opts *bind.TransactOpts, _token common.Address, _to common.Address, _amount *big.Int, _maxGas *big.Int, _gasPriceBid *big.Int, _data []byte) (*types.Transaction, error) + + Address() common.Address +} diff --git a/core/gethwrappers/liquiditymanager/generated/arb_node_interface/arb_node_interface.go b/core/gethwrappers/liquiditymanager/generated/arb_node_interface/arb_node_interface.go new file mode 100644 index 00000000000..966c9f73168 --- /dev/null +++ b/core/gethwrappers/liquiditymanager/generated/arb_node_interface/arb_node_interface.go @@ -0,0 +1,428 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package arb_node_interface + +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" +) + +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +var NodeInterfaceMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"l2BlockNum\",\"type\":\"uint64\"}],\"name\":\"blockL1Num\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"l1BlockNum\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"size\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"leaf\",\"type\":\"uint64\"}],\"name\":\"constructOutboxProof\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"send\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"root\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32[]\",\"name\":\"proof\",\"type\":\"bytes32[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"deposit\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"l2CallValue\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"excessFeeRefundAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"callValueRefundAddress\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"estimateRetryableTicket\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockNum\",\"type\":\"uint64\"}],\"name\":\"findBatchContainingBlock\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"batch\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"contractCreation\",\"type\":\"bool\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"gasEstimateComponents\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"gasEstimate\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"gasEstimateForL1\",\"type\":\"uint64\"},{\"internalType\":\"uint256\",\"name\":\"baseFee\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"l1BaseFeeEstimate\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"contractCreation\",\"type\":\"bool\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"gasEstimateL1Component\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"gasEstimateForL1\",\"type\":\"uint64\"},{\"internalType\":\"uint256\",\"name\":\"baseFee\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"l1BaseFeeEstimate\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"}],\"name\":\"getL1Confirmations\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"confirmations\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockNum\",\"type\":\"uint64\"}],\"name\":\"l2BlockRangeForL1\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"firstBlock\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"lastBlock\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"batchNum\",\"type\":\"uint256\"},{\"internalType\":\"uint64\",\"name\":\"index\",\"type\":\"uint64\"}],\"name\":\"legacyLookupMessageBatchProof\",\"outputs\":[{\"internalType\":\"bytes32[]\",\"name\":\"proof\",\"type\":\"bytes32[]\"},{\"internalType\":\"uint256\",\"name\":\"path\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"l2Sender\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"l1Dest\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"l2Block\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"l1Block\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"calldataForL1\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"nitroGenesisBlock\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"number\",\"type\":\"uint256\"}],\"stateMutability\":\"pure\",\"type\":\"function\"}]", +} + +var NodeInterfaceABI = NodeInterfaceMetaData.ABI + +type NodeInterface struct { + address common.Address + abi abi.ABI + NodeInterfaceCaller + NodeInterfaceTransactor + NodeInterfaceFilterer +} + +type NodeInterfaceCaller struct { + contract *bind.BoundContract +} + +type NodeInterfaceTransactor struct { + contract *bind.BoundContract +} + +type NodeInterfaceFilterer struct { + contract *bind.BoundContract +} + +type NodeInterfaceSession struct { + Contract *NodeInterface + CallOpts bind.CallOpts + TransactOpts bind.TransactOpts +} + +type NodeInterfaceCallerSession struct { + Contract *NodeInterfaceCaller + CallOpts bind.CallOpts +} + +type NodeInterfaceTransactorSession struct { + Contract *NodeInterfaceTransactor + TransactOpts bind.TransactOpts +} + +type NodeInterfaceRaw struct { + Contract *NodeInterface +} + +type NodeInterfaceCallerRaw struct { + Contract *NodeInterfaceCaller +} + +type NodeInterfaceTransactorRaw struct { + Contract *NodeInterfaceTransactor +} + +func NewNodeInterface(address common.Address, backend bind.ContractBackend) (*NodeInterface, error) { + abi, err := abi.JSON(strings.NewReader(NodeInterfaceABI)) + if err != nil { + return nil, err + } + contract, err := bindNodeInterface(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &NodeInterface{address: address, abi: abi, NodeInterfaceCaller: NodeInterfaceCaller{contract: contract}, NodeInterfaceTransactor: NodeInterfaceTransactor{contract: contract}, NodeInterfaceFilterer: NodeInterfaceFilterer{contract: contract}}, nil +} + +func NewNodeInterfaceCaller(address common.Address, caller bind.ContractCaller) (*NodeInterfaceCaller, error) { + contract, err := bindNodeInterface(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &NodeInterfaceCaller{contract: contract}, nil +} + +func NewNodeInterfaceTransactor(address common.Address, transactor bind.ContractTransactor) (*NodeInterfaceTransactor, error) { + contract, err := bindNodeInterface(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &NodeInterfaceTransactor{contract: contract}, nil +} + +func NewNodeInterfaceFilterer(address common.Address, filterer bind.ContractFilterer) (*NodeInterfaceFilterer, error) { + contract, err := bindNodeInterface(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &NodeInterfaceFilterer{contract: contract}, nil +} + +func bindNodeInterface(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := NodeInterfaceMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +func (_NodeInterface *NodeInterfaceRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _NodeInterface.Contract.NodeInterfaceCaller.contract.Call(opts, result, method, params...) +} + +func (_NodeInterface *NodeInterfaceRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _NodeInterface.Contract.NodeInterfaceTransactor.contract.Transfer(opts) +} + +func (_NodeInterface *NodeInterfaceRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _NodeInterface.Contract.NodeInterfaceTransactor.contract.Transact(opts, method, params...) +} + +func (_NodeInterface *NodeInterfaceCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _NodeInterface.Contract.contract.Call(opts, result, method, params...) +} + +func (_NodeInterface *NodeInterfaceTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _NodeInterface.Contract.contract.Transfer(opts) +} + +func (_NodeInterface *NodeInterfaceTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _NodeInterface.Contract.contract.Transact(opts, method, params...) +} + +func (_NodeInterface *NodeInterfaceCaller) BlockL1Num(opts *bind.CallOpts, l2BlockNum uint64) (uint64, error) { + var out []interface{} + err := _NodeInterface.contract.Call(opts, &out, "blockL1Num", l2BlockNum) + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +func (_NodeInterface *NodeInterfaceSession) BlockL1Num(l2BlockNum uint64) (uint64, error) { + return _NodeInterface.Contract.BlockL1Num(&_NodeInterface.CallOpts, l2BlockNum) +} + +func (_NodeInterface *NodeInterfaceCallerSession) BlockL1Num(l2BlockNum uint64) (uint64, error) { + return _NodeInterface.Contract.BlockL1Num(&_NodeInterface.CallOpts, l2BlockNum) +} + +func (_NodeInterface *NodeInterfaceCaller) ConstructOutboxProof(opts *bind.CallOpts, size uint64, leaf uint64) (ConstructOutboxProof, + + error) { + var out []interface{} + err := _NodeInterface.contract.Call(opts, &out, "constructOutboxProof", size, leaf) + + outstruct := new(ConstructOutboxProof) + if err != nil { + return *outstruct, err + } + + outstruct.Send = *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + outstruct.Root = *abi.ConvertType(out[1], new([32]byte)).(*[32]byte) + outstruct.Proof = *abi.ConvertType(out[2], new([][32]byte)).(*[][32]byte) + + return *outstruct, err + +} + +func (_NodeInterface *NodeInterfaceSession) ConstructOutboxProof(size uint64, leaf uint64) (ConstructOutboxProof, + + error) { + return _NodeInterface.Contract.ConstructOutboxProof(&_NodeInterface.CallOpts, size, leaf) +} + +func (_NodeInterface *NodeInterfaceCallerSession) ConstructOutboxProof(size uint64, leaf uint64) (ConstructOutboxProof, + + error) { + return _NodeInterface.Contract.ConstructOutboxProof(&_NodeInterface.CallOpts, size, leaf) +} + +func (_NodeInterface *NodeInterfaceCaller) FindBatchContainingBlock(opts *bind.CallOpts, blockNum uint64) (uint64, error) { + var out []interface{} + err := _NodeInterface.contract.Call(opts, &out, "findBatchContainingBlock", blockNum) + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +func (_NodeInterface *NodeInterfaceSession) FindBatchContainingBlock(blockNum uint64) (uint64, error) { + return _NodeInterface.Contract.FindBatchContainingBlock(&_NodeInterface.CallOpts, blockNum) +} + +func (_NodeInterface *NodeInterfaceCallerSession) FindBatchContainingBlock(blockNum uint64) (uint64, error) { + return _NodeInterface.Contract.FindBatchContainingBlock(&_NodeInterface.CallOpts, blockNum) +} + +func (_NodeInterface *NodeInterfaceCaller) GetL1Confirmations(opts *bind.CallOpts, blockHash [32]byte) (uint64, error) { + var out []interface{} + err := _NodeInterface.contract.Call(opts, &out, "getL1Confirmations", blockHash) + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +func (_NodeInterface *NodeInterfaceSession) GetL1Confirmations(blockHash [32]byte) (uint64, error) { + return _NodeInterface.Contract.GetL1Confirmations(&_NodeInterface.CallOpts, blockHash) +} + +func (_NodeInterface *NodeInterfaceCallerSession) GetL1Confirmations(blockHash [32]byte) (uint64, error) { + return _NodeInterface.Contract.GetL1Confirmations(&_NodeInterface.CallOpts, blockHash) +} + +func (_NodeInterface *NodeInterfaceCaller) L2BlockRangeForL1(opts *bind.CallOpts, blockNum uint64) (L2BlockRangeForL1, + + error) { + var out []interface{} + err := _NodeInterface.contract.Call(opts, &out, "l2BlockRangeForL1", blockNum) + + outstruct := new(L2BlockRangeForL1) + if err != nil { + return *outstruct, err + } + + outstruct.FirstBlock = *abi.ConvertType(out[0], new(uint64)).(*uint64) + outstruct.LastBlock = *abi.ConvertType(out[1], new(uint64)).(*uint64) + + return *outstruct, err + +} + +func (_NodeInterface *NodeInterfaceSession) L2BlockRangeForL1(blockNum uint64) (L2BlockRangeForL1, + + error) { + return _NodeInterface.Contract.L2BlockRangeForL1(&_NodeInterface.CallOpts, blockNum) +} + +func (_NodeInterface *NodeInterfaceCallerSession) L2BlockRangeForL1(blockNum uint64) (L2BlockRangeForL1, + + error) { + return _NodeInterface.Contract.L2BlockRangeForL1(&_NodeInterface.CallOpts, blockNum) +} + +func (_NodeInterface *NodeInterfaceCaller) LegacyLookupMessageBatchProof(opts *bind.CallOpts, batchNum *big.Int, index uint64) (LegacyLookupMessageBatchProof, + + error) { + var out []interface{} + err := _NodeInterface.contract.Call(opts, &out, "legacyLookupMessageBatchProof", batchNum, index) + + outstruct := new(LegacyLookupMessageBatchProof) + if err != nil { + return *outstruct, err + } + + outstruct.Proof = *abi.ConvertType(out[0], new([][32]byte)).(*[][32]byte) + outstruct.Path = *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) + outstruct.L2Sender = *abi.ConvertType(out[2], new(common.Address)).(*common.Address) + outstruct.L1Dest = *abi.ConvertType(out[3], new(common.Address)).(*common.Address) + outstruct.L2Block = *abi.ConvertType(out[4], new(*big.Int)).(**big.Int) + outstruct.L1Block = *abi.ConvertType(out[5], new(*big.Int)).(**big.Int) + outstruct.Timestamp = *abi.ConvertType(out[6], new(*big.Int)).(**big.Int) + outstruct.Amount = *abi.ConvertType(out[7], new(*big.Int)).(**big.Int) + outstruct.CalldataForL1 = *abi.ConvertType(out[8], new([]byte)).(*[]byte) + + return *outstruct, err + +} + +func (_NodeInterface *NodeInterfaceSession) LegacyLookupMessageBatchProof(batchNum *big.Int, index uint64) (LegacyLookupMessageBatchProof, + + error) { + return _NodeInterface.Contract.LegacyLookupMessageBatchProof(&_NodeInterface.CallOpts, batchNum, index) +} + +func (_NodeInterface *NodeInterfaceCallerSession) LegacyLookupMessageBatchProof(batchNum *big.Int, index uint64) (LegacyLookupMessageBatchProof, + + error) { + return _NodeInterface.Contract.LegacyLookupMessageBatchProof(&_NodeInterface.CallOpts, batchNum, index) +} + +func (_NodeInterface *NodeInterfaceCaller) NitroGenesisBlock(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _NodeInterface.contract.Call(opts, &out, "nitroGenesisBlock") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_NodeInterface *NodeInterfaceSession) NitroGenesisBlock() (*big.Int, error) { + return _NodeInterface.Contract.NitroGenesisBlock(&_NodeInterface.CallOpts) +} + +func (_NodeInterface *NodeInterfaceCallerSession) NitroGenesisBlock() (*big.Int, error) { + return _NodeInterface.Contract.NitroGenesisBlock(&_NodeInterface.CallOpts) +} + +func (_NodeInterface *NodeInterfaceTransactor) EstimateRetryableTicket(opts *bind.TransactOpts, sender common.Address, deposit *big.Int, to common.Address, l2CallValue *big.Int, excessFeeRefundAddress common.Address, callValueRefundAddress common.Address, data []byte) (*types.Transaction, error) { + return _NodeInterface.contract.Transact(opts, "estimateRetryableTicket", sender, deposit, to, l2CallValue, excessFeeRefundAddress, callValueRefundAddress, data) +} + +func (_NodeInterface *NodeInterfaceSession) EstimateRetryableTicket(sender common.Address, deposit *big.Int, to common.Address, l2CallValue *big.Int, excessFeeRefundAddress common.Address, callValueRefundAddress common.Address, data []byte) (*types.Transaction, error) { + return _NodeInterface.Contract.EstimateRetryableTicket(&_NodeInterface.TransactOpts, sender, deposit, to, l2CallValue, excessFeeRefundAddress, callValueRefundAddress, data) +} + +func (_NodeInterface *NodeInterfaceTransactorSession) EstimateRetryableTicket(sender common.Address, deposit *big.Int, to common.Address, l2CallValue *big.Int, excessFeeRefundAddress common.Address, callValueRefundAddress common.Address, data []byte) (*types.Transaction, error) { + return _NodeInterface.Contract.EstimateRetryableTicket(&_NodeInterface.TransactOpts, sender, deposit, to, l2CallValue, excessFeeRefundAddress, callValueRefundAddress, data) +} + +func (_NodeInterface *NodeInterfaceTransactor) GasEstimateComponents(opts *bind.TransactOpts, to common.Address, contractCreation bool, data []byte) (*types.Transaction, error) { + return _NodeInterface.contract.Transact(opts, "gasEstimateComponents", to, contractCreation, data) +} + +func (_NodeInterface *NodeInterfaceSession) GasEstimateComponents(to common.Address, contractCreation bool, data []byte) (*types.Transaction, error) { + return _NodeInterface.Contract.GasEstimateComponents(&_NodeInterface.TransactOpts, to, contractCreation, data) +} + +func (_NodeInterface *NodeInterfaceTransactorSession) GasEstimateComponents(to common.Address, contractCreation bool, data []byte) (*types.Transaction, error) { + return _NodeInterface.Contract.GasEstimateComponents(&_NodeInterface.TransactOpts, to, contractCreation, data) +} + +func (_NodeInterface *NodeInterfaceTransactor) GasEstimateL1Component(opts *bind.TransactOpts, to common.Address, contractCreation bool, data []byte) (*types.Transaction, error) { + return _NodeInterface.contract.Transact(opts, "gasEstimateL1Component", to, contractCreation, data) +} + +func (_NodeInterface *NodeInterfaceSession) GasEstimateL1Component(to common.Address, contractCreation bool, data []byte) (*types.Transaction, error) { + return _NodeInterface.Contract.GasEstimateL1Component(&_NodeInterface.TransactOpts, to, contractCreation, data) +} + +func (_NodeInterface *NodeInterfaceTransactorSession) GasEstimateL1Component(to common.Address, contractCreation bool, data []byte) (*types.Transaction, error) { + return _NodeInterface.Contract.GasEstimateL1Component(&_NodeInterface.TransactOpts, to, contractCreation, data) +} + +type ConstructOutboxProof struct { + Send [32]byte + Root [32]byte + Proof [][32]byte +} +type L2BlockRangeForL1 struct { + FirstBlock uint64 + LastBlock uint64 +} +type LegacyLookupMessageBatchProof struct { + Proof [][32]byte + Path *big.Int + L2Sender common.Address + L1Dest common.Address + L2Block *big.Int + L1Block *big.Int + Timestamp *big.Int + Amount *big.Int + CalldataForL1 []byte +} + +func (_NodeInterface *NodeInterface) Address() common.Address { + return _NodeInterface.address +} + +type NodeInterfaceInterface interface { + BlockL1Num(opts *bind.CallOpts, l2BlockNum uint64) (uint64, error) + + ConstructOutboxProof(opts *bind.CallOpts, size uint64, leaf uint64) (ConstructOutboxProof, + + error) + + FindBatchContainingBlock(opts *bind.CallOpts, blockNum uint64) (uint64, error) + + GetL1Confirmations(opts *bind.CallOpts, blockHash [32]byte) (uint64, error) + + L2BlockRangeForL1(opts *bind.CallOpts, blockNum uint64) (L2BlockRangeForL1, + + error) + + LegacyLookupMessageBatchProof(opts *bind.CallOpts, batchNum *big.Int, index uint64) (LegacyLookupMessageBatchProof, + + error) + + NitroGenesisBlock(opts *bind.CallOpts) (*big.Int, error) + + EstimateRetryableTicket(opts *bind.TransactOpts, sender common.Address, deposit *big.Int, to common.Address, l2CallValue *big.Int, excessFeeRefundAddress common.Address, callValueRefundAddress common.Address, data []byte) (*types.Transaction, error) + + GasEstimateComponents(opts *bind.TransactOpts, to common.Address, contractCreation bool, data []byte) (*types.Transaction, error) + + GasEstimateL1Component(opts *bind.TransactOpts, to common.Address, contractCreation bool, data []byte) (*types.Transaction, error) + + Address() common.Address +} diff --git a/core/gethwrappers/liquiditymanager/generated/arbitrum_gateway_router/arbitrum_gateway_router.go b/core/gethwrappers/liquiditymanager/generated/arbitrum_gateway_router/arbitrum_gateway_router.go new file mode 100644 index 00000000000..2e16cbb7b48 --- /dev/null +++ b/core/gethwrappers/liquiditymanager/generated/arbitrum_gateway_router/arbitrum_gateway_router.go @@ -0,0 +1,730 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package arbitrum_gateway_router + +import ( + "errors" + "fmt" + "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" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" +) + +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +var ArbitrumGatewayRouterMetaData = &bind.MetaData{ + ABI: "[{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newDefaultGateway\",\"type\":\"address\"}],\"name\":\"DefaultGatewayUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"l1Token\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"gateway\",\"type\":\"address\"}],\"name\":\"GatewaySet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_userFrom\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_userTo\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"gateway\",\"type\":\"address\"}],\"name\":\"TransferRouted\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"l1ERC20\",\"type\":\"address\"}],\"name\":\"calculateL2TokenAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"defaultGateway\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"gateway\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_token\",\"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\":\"finalizeInboundTransfer\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_token\",\"type\":\"address\"}],\"name\":\"getGateway\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"gateway\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_token\",\"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\":\"getOutboundCalldata\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_token\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_maxGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_gasPriceBid\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"outboundTransfer\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"function\"}]", +} + +var ArbitrumGatewayRouterABI = ArbitrumGatewayRouterMetaData.ABI + +type ArbitrumGatewayRouter struct { + address common.Address + abi abi.ABI + ArbitrumGatewayRouterCaller + ArbitrumGatewayRouterTransactor + ArbitrumGatewayRouterFilterer +} + +type ArbitrumGatewayRouterCaller struct { + contract *bind.BoundContract +} + +type ArbitrumGatewayRouterTransactor struct { + contract *bind.BoundContract +} + +type ArbitrumGatewayRouterFilterer struct { + contract *bind.BoundContract +} + +type ArbitrumGatewayRouterSession struct { + Contract *ArbitrumGatewayRouter + CallOpts bind.CallOpts + TransactOpts bind.TransactOpts +} + +type ArbitrumGatewayRouterCallerSession struct { + Contract *ArbitrumGatewayRouterCaller + CallOpts bind.CallOpts +} + +type ArbitrumGatewayRouterTransactorSession struct { + Contract *ArbitrumGatewayRouterTransactor + TransactOpts bind.TransactOpts +} + +type ArbitrumGatewayRouterRaw struct { + Contract *ArbitrumGatewayRouter +} + +type ArbitrumGatewayRouterCallerRaw struct { + Contract *ArbitrumGatewayRouterCaller +} + +type ArbitrumGatewayRouterTransactorRaw struct { + Contract *ArbitrumGatewayRouterTransactor +} + +func NewArbitrumGatewayRouter(address common.Address, backend bind.ContractBackend) (*ArbitrumGatewayRouter, error) { + abi, err := abi.JSON(strings.NewReader(ArbitrumGatewayRouterABI)) + if err != nil { + return nil, err + } + contract, err := bindArbitrumGatewayRouter(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &ArbitrumGatewayRouter{address: address, abi: abi, ArbitrumGatewayRouterCaller: ArbitrumGatewayRouterCaller{contract: contract}, ArbitrumGatewayRouterTransactor: ArbitrumGatewayRouterTransactor{contract: contract}, ArbitrumGatewayRouterFilterer: ArbitrumGatewayRouterFilterer{contract: contract}}, nil +} + +func NewArbitrumGatewayRouterCaller(address common.Address, caller bind.ContractCaller) (*ArbitrumGatewayRouterCaller, error) { + contract, err := bindArbitrumGatewayRouter(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &ArbitrumGatewayRouterCaller{contract: contract}, nil +} + +func NewArbitrumGatewayRouterTransactor(address common.Address, transactor bind.ContractTransactor) (*ArbitrumGatewayRouterTransactor, error) { + contract, err := bindArbitrumGatewayRouter(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &ArbitrumGatewayRouterTransactor{contract: contract}, nil +} + +func NewArbitrumGatewayRouterFilterer(address common.Address, filterer bind.ContractFilterer) (*ArbitrumGatewayRouterFilterer, error) { + contract, err := bindArbitrumGatewayRouter(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &ArbitrumGatewayRouterFilterer{contract: contract}, nil +} + +func bindArbitrumGatewayRouter(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := ArbitrumGatewayRouterMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +func (_ArbitrumGatewayRouter *ArbitrumGatewayRouterRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _ArbitrumGatewayRouter.Contract.ArbitrumGatewayRouterCaller.contract.Call(opts, result, method, params...) +} + +func (_ArbitrumGatewayRouter *ArbitrumGatewayRouterRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _ArbitrumGatewayRouter.Contract.ArbitrumGatewayRouterTransactor.contract.Transfer(opts) +} + +func (_ArbitrumGatewayRouter *ArbitrumGatewayRouterRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _ArbitrumGatewayRouter.Contract.ArbitrumGatewayRouterTransactor.contract.Transact(opts, method, params...) +} + +func (_ArbitrumGatewayRouter *ArbitrumGatewayRouterCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _ArbitrumGatewayRouter.Contract.contract.Call(opts, result, method, params...) +} + +func (_ArbitrumGatewayRouter *ArbitrumGatewayRouterTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _ArbitrumGatewayRouter.Contract.contract.Transfer(opts) +} + +func (_ArbitrumGatewayRouter *ArbitrumGatewayRouterTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _ArbitrumGatewayRouter.Contract.contract.Transact(opts, method, params...) +} + +func (_ArbitrumGatewayRouter *ArbitrumGatewayRouterCaller) CalculateL2TokenAddress(opts *bind.CallOpts, l1ERC20 common.Address) (common.Address, error) { + var out []interface{} + err := _ArbitrumGatewayRouter.contract.Call(opts, &out, "calculateL2TokenAddress", l1ERC20) + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_ArbitrumGatewayRouter *ArbitrumGatewayRouterSession) CalculateL2TokenAddress(l1ERC20 common.Address) (common.Address, error) { + return _ArbitrumGatewayRouter.Contract.CalculateL2TokenAddress(&_ArbitrumGatewayRouter.CallOpts, l1ERC20) +} + +func (_ArbitrumGatewayRouter *ArbitrumGatewayRouterCallerSession) CalculateL2TokenAddress(l1ERC20 common.Address) (common.Address, error) { + return _ArbitrumGatewayRouter.Contract.CalculateL2TokenAddress(&_ArbitrumGatewayRouter.CallOpts, l1ERC20) +} + +func (_ArbitrumGatewayRouter *ArbitrumGatewayRouterCaller) DefaultGateway(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _ArbitrumGatewayRouter.contract.Call(opts, &out, "defaultGateway") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_ArbitrumGatewayRouter *ArbitrumGatewayRouterSession) DefaultGateway() (common.Address, error) { + return _ArbitrumGatewayRouter.Contract.DefaultGateway(&_ArbitrumGatewayRouter.CallOpts) +} + +func (_ArbitrumGatewayRouter *ArbitrumGatewayRouterCallerSession) DefaultGateway() (common.Address, error) { + return _ArbitrumGatewayRouter.Contract.DefaultGateway(&_ArbitrumGatewayRouter.CallOpts) +} + +func (_ArbitrumGatewayRouter *ArbitrumGatewayRouterCaller) GetGateway(opts *bind.CallOpts, _token common.Address) (common.Address, error) { + var out []interface{} + err := _ArbitrumGatewayRouter.contract.Call(opts, &out, "getGateway", _token) + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_ArbitrumGatewayRouter *ArbitrumGatewayRouterSession) GetGateway(_token common.Address) (common.Address, error) { + return _ArbitrumGatewayRouter.Contract.GetGateway(&_ArbitrumGatewayRouter.CallOpts, _token) +} + +func (_ArbitrumGatewayRouter *ArbitrumGatewayRouterCallerSession) GetGateway(_token common.Address) (common.Address, error) { + return _ArbitrumGatewayRouter.Contract.GetGateway(&_ArbitrumGatewayRouter.CallOpts, _token) +} + +func (_ArbitrumGatewayRouter *ArbitrumGatewayRouterCaller) GetOutboundCalldata(opts *bind.CallOpts, _token common.Address, _from common.Address, _to common.Address, _amount *big.Int, _data []byte) ([]byte, error) { + var out []interface{} + err := _ArbitrumGatewayRouter.contract.Call(opts, &out, "getOutboundCalldata", _token, _from, _to, _amount, _data) + + if err != nil { + return *new([]byte), err + } + + out0 := *abi.ConvertType(out[0], new([]byte)).(*[]byte) + + return out0, err + +} + +func (_ArbitrumGatewayRouter *ArbitrumGatewayRouterSession) GetOutboundCalldata(_token common.Address, _from common.Address, _to common.Address, _amount *big.Int, _data []byte) ([]byte, error) { + return _ArbitrumGatewayRouter.Contract.GetOutboundCalldata(&_ArbitrumGatewayRouter.CallOpts, _token, _from, _to, _amount, _data) +} + +func (_ArbitrumGatewayRouter *ArbitrumGatewayRouterCallerSession) GetOutboundCalldata(_token common.Address, _from common.Address, _to common.Address, _amount *big.Int, _data []byte) ([]byte, error) { + return _ArbitrumGatewayRouter.Contract.GetOutboundCalldata(&_ArbitrumGatewayRouter.CallOpts, _token, _from, _to, _amount, _data) +} + +func (_ArbitrumGatewayRouter *ArbitrumGatewayRouterTransactor) FinalizeInboundTransfer(opts *bind.TransactOpts, _token common.Address, _from common.Address, _to common.Address, _amount *big.Int, _data []byte) (*types.Transaction, error) { + return _ArbitrumGatewayRouter.contract.Transact(opts, "finalizeInboundTransfer", _token, _from, _to, _amount, _data) +} + +func (_ArbitrumGatewayRouter *ArbitrumGatewayRouterSession) FinalizeInboundTransfer(_token common.Address, _from common.Address, _to common.Address, _amount *big.Int, _data []byte) (*types.Transaction, error) { + return _ArbitrumGatewayRouter.Contract.FinalizeInboundTransfer(&_ArbitrumGatewayRouter.TransactOpts, _token, _from, _to, _amount, _data) +} + +func (_ArbitrumGatewayRouter *ArbitrumGatewayRouterTransactorSession) FinalizeInboundTransfer(_token common.Address, _from common.Address, _to common.Address, _amount *big.Int, _data []byte) (*types.Transaction, error) { + return _ArbitrumGatewayRouter.Contract.FinalizeInboundTransfer(&_ArbitrumGatewayRouter.TransactOpts, _token, _from, _to, _amount, _data) +} + +func (_ArbitrumGatewayRouter *ArbitrumGatewayRouterTransactor) OutboundTransfer(opts *bind.TransactOpts, _token common.Address, _to common.Address, _amount *big.Int, _maxGas *big.Int, _gasPriceBid *big.Int, _data []byte) (*types.Transaction, error) { + return _ArbitrumGatewayRouter.contract.Transact(opts, "outboundTransfer", _token, _to, _amount, _maxGas, _gasPriceBid, _data) +} + +func (_ArbitrumGatewayRouter *ArbitrumGatewayRouterSession) OutboundTransfer(_token common.Address, _to common.Address, _amount *big.Int, _maxGas *big.Int, _gasPriceBid *big.Int, _data []byte) (*types.Transaction, error) { + return _ArbitrumGatewayRouter.Contract.OutboundTransfer(&_ArbitrumGatewayRouter.TransactOpts, _token, _to, _amount, _maxGas, _gasPriceBid, _data) +} + +func (_ArbitrumGatewayRouter *ArbitrumGatewayRouterTransactorSession) OutboundTransfer(_token common.Address, _to common.Address, _amount *big.Int, _maxGas *big.Int, _gasPriceBid *big.Int, _data []byte) (*types.Transaction, error) { + return _ArbitrumGatewayRouter.Contract.OutboundTransfer(&_ArbitrumGatewayRouter.TransactOpts, _token, _to, _amount, _maxGas, _gasPriceBid, _data) +} + +type ArbitrumGatewayRouterDefaultGatewayUpdatedIterator struct { + Event *ArbitrumGatewayRouterDefaultGatewayUpdated + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *ArbitrumGatewayRouterDefaultGatewayUpdatedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(ArbitrumGatewayRouterDefaultGatewayUpdated) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(ArbitrumGatewayRouterDefaultGatewayUpdated) + 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() + } +} + +func (it *ArbitrumGatewayRouterDefaultGatewayUpdatedIterator) Error() error { + return it.fail +} + +func (it *ArbitrumGatewayRouterDefaultGatewayUpdatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type ArbitrumGatewayRouterDefaultGatewayUpdated struct { + NewDefaultGateway common.Address + Raw types.Log +} + +func (_ArbitrumGatewayRouter *ArbitrumGatewayRouterFilterer) FilterDefaultGatewayUpdated(opts *bind.FilterOpts) (*ArbitrumGatewayRouterDefaultGatewayUpdatedIterator, error) { + + logs, sub, err := _ArbitrumGatewayRouter.contract.FilterLogs(opts, "DefaultGatewayUpdated") + if err != nil { + return nil, err + } + return &ArbitrumGatewayRouterDefaultGatewayUpdatedIterator{contract: _ArbitrumGatewayRouter.contract, event: "DefaultGatewayUpdated", logs: logs, sub: sub}, nil +} + +func (_ArbitrumGatewayRouter *ArbitrumGatewayRouterFilterer) WatchDefaultGatewayUpdated(opts *bind.WatchOpts, sink chan<- *ArbitrumGatewayRouterDefaultGatewayUpdated) (event.Subscription, error) { + + logs, sub, err := _ArbitrumGatewayRouter.contract.WatchLogs(opts, "DefaultGatewayUpdated") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(ArbitrumGatewayRouterDefaultGatewayUpdated) + if err := _ArbitrumGatewayRouter.contract.UnpackLog(event, "DefaultGatewayUpdated", 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 +} + +func (_ArbitrumGatewayRouter *ArbitrumGatewayRouterFilterer) ParseDefaultGatewayUpdated(log types.Log) (*ArbitrumGatewayRouterDefaultGatewayUpdated, error) { + event := new(ArbitrumGatewayRouterDefaultGatewayUpdated) + if err := _ArbitrumGatewayRouter.contract.UnpackLog(event, "DefaultGatewayUpdated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type ArbitrumGatewayRouterGatewaySetIterator struct { + Event *ArbitrumGatewayRouterGatewaySet + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *ArbitrumGatewayRouterGatewaySetIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(ArbitrumGatewayRouterGatewaySet) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(ArbitrumGatewayRouterGatewaySet) + 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() + } +} + +func (it *ArbitrumGatewayRouterGatewaySetIterator) Error() error { + return it.fail +} + +func (it *ArbitrumGatewayRouterGatewaySetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type ArbitrumGatewayRouterGatewaySet struct { + L1Token common.Address + Gateway common.Address + Raw types.Log +} + +func (_ArbitrumGatewayRouter *ArbitrumGatewayRouterFilterer) FilterGatewaySet(opts *bind.FilterOpts, l1Token []common.Address, gateway []common.Address) (*ArbitrumGatewayRouterGatewaySetIterator, error) { + + var l1TokenRule []interface{} + for _, l1TokenItem := range l1Token { + l1TokenRule = append(l1TokenRule, l1TokenItem) + } + var gatewayRule []interface{} + for _, gatewayItem := range gateway { + gatewayRule = append(gatewayRule, gatewayItem) + } + + logs, sub, err := _ArbitrumGatewayRouter.contract.FilterLogs(opts, "GatewaySet", l1TokenRule, gatewayRule) + if err != nil { + return nil, err + } + return &ArbitrumGatewayRouterGatewaySetIterator{contract: _ArbitrumGatewayRouter.contract, event: "GatewaySet", logs: logs, sub: sub}, nil +} + +func (_ArbitrumGatewayRouter *ArbitrumGatewayRouterFilterer) WatchGatewaySet(opts *bind.WatchOpts, sink chan<- *ArbitrumGatewayRouterGatewaySet, l1Token []common.Address, gateway []common.Address) (event.Subscription, error) { + + var l1TokenRule []interface{} + for _, l1TokenItem := range l1Token { + l1TokenRule = append(l1TokenRule, l1TokenItem) + } + var gatewayRule []interface{} + for _, gatewayItem := range gateway { + gatewayRule = append(gatewayRule, gatewayItem) + } + + logs, sub, err := _ArbitrumGatewayRouter.contract.WatchLogs(opts, "GatewaySet", l1TokenRule, gatewayRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(ArbitrumGatewayRouterGatewaySet) + if err := _ArbitrumGatewayRouter.contract.UnpackLog(event, "GatewaySet", 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 +} + +func (_ArbitrumGatewayRouter *ArbitrumGatewayRouterFilterer) ParseGatewaySet(log types.Log) (*ArbitrumGatewayRouterGatewaySet, error) { + event := new(ArbitrumGatewayRouterGatewaySet) + if err := _ArbitrumGatewayRouter.contract.UnpackLog(event, "GatewaySet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type ArbitrumGatewayRouterTransferRoutedIterator struct { + Event *ArbitrumGatewayRouterTransferRouted + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *ArbitrumGatewayRouterTransferRoutedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(ArbitrumGatewayRouterTransferRouted) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(ArbitrumGatewayRouterTransferRouted) + 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() + } +} + +func (it *ArbitrumGatewayRouterTransferRoutedIterator) Error() error { + return it.fail +} + +func (it *ArbitrumGatewayRouterTransferRoutedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type ArbitrumGatewayRouterTransferRouted struct { + Token common.Address + UserFrom common.Address + UserTo common.Address + Gateway common.Address + Raw types.Log +} + +func (_ArbitrumGatewayRouter *ArbitrumGatewayRouterFilterer) FilterTransferRouted(opts *bind.FilterOpts, token []common.Address, _userFrom []common.Address, _userTo []common.Address) (*ArbitrumGatewayRouterTransferRoutedIterator, error) { + + var tokenRule []interface{} + for _, tokenItem := range token { + tokenRule = append(tokenRule, tokenItem) + } + var _userFromRule []interface{} + for _, _userFromItem := range _userFrom { + _userFromRule = append(_userFromRule, _userFromItem) + } + var _userToRule []interface{} + for _, _userToItem := range _userTo { + _userToRule = append(_userToRule, _userToItem) + } + + logs, sub, err := _ArbitrumGatewayRouter.contract.FilterLogs(opts, "TransferRouted", tokenRule, _userFromRule, _userToRule) + if err != nil { + return nil, err + } + return &ArbitrumGatewayRouterTransferRoutedIterator{contract: _ArbitrumGatewayRouter.contract, event: "TransferRouted", logs: logs, sub: sub}, nil +} + +func (_ArbitrumGatewayRouter *ArbitrumGatewayRouterFilterer) WatchTransferRouted(opts *bind.WatchOpts, sink chan<- *ArbitrumGatewayRouterTransferRouted, token []common.Address, _userFrom []common.Address, _userTo []common.Address) (event.Subscription, error) { + + var tokenRule []interface{} + for _, tokenItem := range token { + tokenRule = append(tokenRule, tokenItem) + } + var _userFromRule []interface{} + for _, _userFromItem := range _userFrom { + _userFromRule = append(_userFromRule, _userFromItem) + } + var _userToRule []interface{} + for _, _userToItem := range _userTo { + _userToRule = append(_userToRule, _userToItem) + } + + logs, sub, err := _ArbitrumGatewayRouter.contract.WatchLogs(opts, "TransferRouted", tokenRule, _userFromRule, _userToRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(ArbitrumGatewayRouterTransferRouted) + if err := _ArbitrumGatewayRouter.contract.UnpackLog(event, "TransferRouted", 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 +} + +func (_ArbitrumGatewayRouter *ArbitrumGatewayRouterFilterer) ParseTransferRouted(log types.Log) (*ArbitrumGatewayRouterTransferRouted, error) { + event := new(ArbitrumGatewayRouterTransferRouted) + if err := _ArbitrumGatewayRouter.contract.UnpackLog(event, "TransferRouted", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +func (_ArbitrumGatewayRouter *ArbitrumGatewayRouter) ParseLog(log types.Log) (generated.AbigenLog, error) { + switch log.Topics[0] { + case _ArbitrumGatewayRouter.abi.Events["DefaultGatewayUpdated"].ID: + return _ArbitrumGatewayRouter.ParseDefaultGatewayUpdated(log) + case _ArbitrumGatewayRouter.abi.Events["GatewaySet"].ID: + return _ArbitrumGatewayRouter.ParseGatewaySet(log) + case _ArbitrumGatewayRouter.abi.Events["TransferRouted"].ID: + return _ArbitrumGatewayRouter.ParseTransferRouted(log) + + default: + return nil, fmt.Errorf("abigen wrapper received unknown log topic: %v", log.Topics[0]) + } +} + +func (ArbitrumGatewayRouterDefaultGatewayUpdated) Topic() common.Hash { + return common.HexToHash("0x3a8f8eb961383a94d41d193e16a3af73eaddfd5764a4c640257323a1603ac331") +} + +func (ArbitrumGatewayRouterGatewaySet) Topic() common.Hash { + return common.HexToHash("0x812ca95fe4492a9e2d1f2723c2c40c03a60a27b059581ae20ac4e4d73bfba354") +} + +func (ArbitrumGatewayRouterTransferRouted) Topic() common.Hash { + return common.HexToHash("0x85291dff2161a93c2f12c819d31889c96c63042116f5bc5a205aa701c2c429f5") +} + +func (_ArbitrumGatewayRouter *ArbitrumGatewayRouter) Address() common.Address { + return _ArbitrumGatewayRouter.address +} + +type ArbitrumGatewayRouterInterface interface { + CalculateL2TokenAddress(opts *bind.CallOpts, l1ERC20 common.Address) (common.Address, error) + + DefaultGateway(opts *bind.CallOpts) (common.Address, error) + + GetGateway(opts *bind.CallOpts, _token common.Address) (common.Address, error) + + GetOutboundCalldata(opts *bind.CallOpts, _token common.Address, _from common.Address, _to common.Address, _amount *big.Int, _data []byte) ([]byte, error) + + FinalizeInboundTransfer(opts *bind.TransactOpts, _token common.Address, _from common.Address, _to common.Address, _amount *big.Int, _data []byte) (*types.Transaction, error) + + OutboundTransfer(opts *bind.TransactOpts, _token common.Address, _to common.Address, _amount *big.Int, _maxGas *big.Int, _gasPriceBid *big.Int, _data []byte) (*types.Transaction, error) + + FilterDefaultGatewayUpdated(opts *bind.FilterOpts) (*ArbitrumGatewayRouterDefaultGatewayUpdatedIterator, error) + + WatchDefaultGatewayUpdated(opts *bind.WatchOpts, sink chan<- *ArbitrumGatewayRouterDefaultGatewayUpdated) (event.Subscription, error) + + ParseDefaultGatewayUpdated(log types.Log) (*ArbitrumGatewayRouterDefaultGatewayUpdated, error) + + FilterGatewaySet(opts *bind.FilterOpts, l1Token []common.Address, gateway []common.Address) (*ArbitrumGatewayRouterGatewaySetIterator, error) + + WatchGatewaySet(opts *bind.WatchOpts, sink chan<- *ArbitrumGatewayRouterGatewaySet, l1Token []common.Address, gateway []common.Address) (event.Subscription, error) + + ParseGatewaySet(log types.Log) (*ArbitrumGatewayRouterGatewaySet, error) + + FilterTransferRouted(opts *bind.FilterOpts, token []common.Address, _userFrom []common.Address, _userTo []common.Address) (*ArbitrumGatewayRouterTransferRoutedIterator, error) + + WatchTransferRouted(opts *bind.WatchOpts, sink chan<- *ArbitrumGatewayRouterTransferRouted, token []common.Address, _userFrom []common.Address, _userTo []common.Address) (event.Subscription, error) + + ParseTransferRouted(log types.Log) (*ArbitrumGatewayRouterTransferRouted, error) + + ParseLog(log types.Log) (generated.AbigenLog, error) + + Address() common.Address +} diff --git a/core/gethwrappers/liquiditymanager/generated/arbitrum_inbox/arbitrum_inbox.go b/core/gethwrappers/liquiditymanager/generated/arbitrum_inbox/arbitrum_inbox.go new file mode 100644 index 00000000000..4632ae6ba72 --- /dev/null +++ b/core/gethwrappers/liquiditymanager/generated/arbitrum_inbox/arbitrum_inbox.go @@ -0,0 +1,744 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package arbitrum_inbox + +import ( + "errors" + "fmt" + "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" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" +) + +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +var ArbitrumInboxMetaData = &bind.MetaData{ + ABI: "[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"messageNum\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"InboxMessageDelivered\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"messageNum\",\"type\":\"uint256\"}],\"name\":\"InboxMessageDeliveredFromOrigin\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"allowListEnabled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"bridge\",\"outputs\":[{\"internalType\":\"contractIBridge\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"dataLength\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"baseFee\",\"type\":\"uint256\"}],\"name\":\"calculateRetryableSubmissionFee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getProxyAdmin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractIBridge\",\"name\":\"_bridge\",\"type\":\"address\"},{\"internalType\":\"contractISequencerInbox\",\"name\":\"_sequencerInbox\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"}],\"name\":\"isAllowed\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"maxDataSize\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"gasLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxFeePerGas\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"sendContractTransaction\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"messageData\",\"type\":\"bytes\"}],\"name\":\"sendL2Message\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"messageData\",\"type\":\"bytes\"}],\"name\":\"sendL2MessageFromOrigin\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"gasLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxFeePerGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"sendUnsignedTransaction\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"sequencerInbox\",\"outputs\":[{\"internalType\":\"contractISequencerInbox\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"user\",\"type\":\"address[]\"},{\"internalType\":\"bool[]\",\"name\":\"val\",\"type\":\"bool[]\"}],\"name\":\"setAllowList\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bool\",\"name\":\"_allowListEnabled\",\"type\":\"bool\"}],\"name\":\"setAllowListEnabled\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"unpause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", +} + +var ArbitrumInboxABI = ArbitrumInboxMetaData.ABI + +type ArbitrumInbox struct { + address common.Address + abi abi.ABI + ArbitrumInboxCaller + ArbitrumInboxTransactor + ArbitrumInboxFilterer +} + +type ArbitrumInboxCaller struct { + contract *bind.BoundContract +} + +type ArbitrumInboxTransactor struct { + contract *bind.BoundContract +} + +type ArbitrumInboxFilterer struct { + contract *bind.BoundContract +} + +type ArbitrumInboxSession struct { + Contract *ArbitrumInbox + CallOpts bind.CallOpts + TransactOpts bind.TransactOpts +} + +type ArbitrumInboxCallerSession struct { + Contract *ArbitrumInboxCaller + CallOpts bind.CallOpts +} + +type ArbitrumInboxTransactorSession struct { + Contract *ArbitrumInboxTransactor + TransactOpts bind.TransactOpts +} + +type ArbitrumInboxRaw struct { + Contract *ArbitrumInbox +} + +type ArbitrumInboxCallerRaw struct { + Contract *ArbitrumInboxCaller +} + +type ArbitrumInboxTransactorRaw struct { + Contract *ArbitrumInboxTransactor +} + +func NewArbitrumInbox(address common.Address, backend bind.ContractBackend) (*ArbitrumInbox, error) { + abi, err := abi.JSON(strings.NewReader(ArbitrumInboxABI)) + if err != nil { + return nil, err + } + contract, err := bindArbitrumInbox(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &ArbitrumInbox{address: address, abi: abi, ArbitrumInboxCaller: ArbitrumInboxCaller{contract: contract}, ArbitrumInboxTransactor: ArbitrumInboxTransactor{contract: contract}, ArbitrumInboxFilterer: ArbitrumInboxFilterer{contract: contract}}, nil +} + +func NewArbitrumInboxCaller(address common.Address, caller bind.ContractCaller) (*ArbitrumInboxCaller, error) { + contract, err := bindArbitrumInbox(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &ArbitrumInboxCaller{contract: contract}, nil +} + +func NewArbitrumInboxTransactor(address common.Address, transactor bind.ContractTransactor) (*ArbitrumInboxTransactor, error) { + contract, err := bindArbitrumInbox(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &ArbitrumInboxTransactor{contract: contract}, nil +} + +func NewArbitrumInboxFilterer(address common.Address, filterer bind.ContractFilterer) (*ArbitrumInboxFilterer, error) { + contract, err := bindArbitrumInbox(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &ArbitrumInboxFilterer{contract: contract}, nil +} + +func bindArbitrumInbox(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := ArbitrumInboxMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +func (_ArbitrumInbox *ArbitrumInboxRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _ArbitrumInbox.Contract.ArbitrumInboxCaller.contract.Call(opts, result, method, params...) +} + +func (_ArbitrumInbox *ArbitrumInboxRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _ArbitrumInbox.Contract.ArbitrumInboxTransactor.contract.Transfer(opts) +} + +func (_ArbitrumInbox *ArbitrumInboxRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _ArbitrumInbox.Contract.ArbitrumInboxTransactor.contract.Transact(opts, method, params...) +} + +func (_ArbitrumInbox *ArbitrumInboxCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _ArbitrumInbox.Contract.contract.Call(opts, result, method, params...) +} + +func (_ArbitrumInbox *ArbitrumInboxTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _ArbitrumInbox.Contract.contract.Transfer(opts) +} + +func (_ArbitrumInbox *ArbitrumInboxTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _ArbitrumInbox.Contract.contract.Transact(opts, method, params...) +} + +func (_ArbitrumInbox *ArbitrumInboxCaller) AllowListEnabled(opts *bind.CallOpts) (bool, error) { + var out []interface{} + err := _ArbitrumInbox.contract.Call(opts, &out, "allowListEnabled") + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_ArbitrumInbox *ArbitrumInboxSession) AllowListEnabled() (bool, error) { + return _ArbitrumInbox.Contract.AllowListEnabled(&_ArbitrumInbox.CallOpts) +} + +func (_ArbitrumInbox *ArbitrumInboxCallerSession) AllowListEnabled() (bool, error) { + return _ArbitrumInbox.Contract.AllowListEnabled(&_ArbitrumInbox.CallOpts) +} + +func (_ArbitrumInbox *ArbitrumInboxCaller) Bridge(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _ArbitrumInbox.contract.Call(opts, &out, "bridge") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_ArbitrumInbox *ArbitrumInboxSession) Bridge() (common.Address, error) { + return _ArbitrumInbox.Contract.Bridge(&_ArbitrumInbox.CallOpts) +} + +func (_ArbitrumInbox *ArbitrumInboxCallerSession) Bridge() (common.Address, error) { + return _ArbitrumInbox.Contract.Bridge(&_ArbitrumInbox.CallOpts) +} + +func (_ArbitrumInbox *ArbitrumInboxCaller) CalculateRetryableSubmissionFee(opts *bind.CallOpts, dataLength *big.Int, baseFee *big.Int) (*big.Int, error) { + var out []interface{} + err := _ArbitrumInbox.contract.Call(opts, &out, "calculateRetryableSubmissionFee", dataLength, baseFee) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_ArbitrumInbox *ArbitrumInboxSession) CalculateRetryableSubmissionFee(dataLength *big.Int, baseFee *big.Int) (*big.Int, error) { + return _ArbitrumInbox.Contract.CalculateRetryableSubmissionFee(&_ArbitrumInbox.CallOpts, dataLength, baseFee) +} + +func (_ArbitrumInbox *ArbitrumInboxCallerSession) CalculateRetryableSubmissionFee(dataLength *big.Int, baseFee *big.Int) (*big.Int, error) { + return _ArbitrumInbox.Contract.CalculateRetryableSubmissionFee(&_ArbitrumInbox.CallOpts, dataLength, baseFee) +} + +func (_ArbitrumInbox *ArbitrumInboxCaller) GetProxyAdmin(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _ArbitrumInbox.contract.Call(opts, &out, "getProxyAdmin") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_ArbitrumInbox *ArbitrumInboxSession) GetProxyAdmin() (common.Address, error) { + return _ArbitrumInbox.Contract.GetProxyAdmin(&_ArbitrumInbox.CallOpts) +} + +func (_ArbitrumInbox *ArbitrumInboxCallerSession) GetProxyAdmin() (common.Address, error) { + return _ArbitrumInbox.Contract.GetProxyAdmin(&_ArbitrumInbox.CallOpts) +} + +func (_ArbitrumInbox *ArbitrumInboxCaller) IsAllowed(opts *bind.CallOpts, user common.Address) (bool, error) { + var out []interface{} + err := _ArbitrumInbox.contract.Call(opts, &out, "isAllowed", user) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_ArbitrumInbox *ArbitrumInboxSession) IsAllowed(user common.Address) (bool, error) { + return _ArbitrumInbox.Contract.IsAllowed(&_ArbitrumInbox.CallOpts, user) +} + +func (_ArbitrumInbox *ArbitrumInboxCallerSession) IsAllowed(user common.Address) (bool, error) { + return _ArbitrumInbox.Contract.IsAllowed(&_ArbitrumInbox.CallOpts, user) +} + +func (_ArbitrumInbox *ArbitrumInboxCaller) MaxDataSize(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _ArbitrumInbox.contract.Call(opts, &out, "maxDataSize") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_ArbitrumInbox *ArbitrumInboxSession) MaxDataSize() (*big.Int, error) { + return _ArbitrumInbox.Contract.MaxDataSize(&_ArbitrumInbox.CallOpts) +} + +func (_ArbitrumInbox *ArbitrumInboxCallerSession) MaxDataSize() (*big.Int, error) { + return _ArbitrumInbox.Contract.MaxDataSize(&_ArbitrumInbox.CallOpts) +} + +func (_ArbitrumInbox *ArbitrumInboxCaller) SequencerInbox(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _ArbitrumInbox.contract.Call(opts, &out, "sequencerInbox") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_ArbitrumInbox *ArbitrumInboxSession) SequencerInbox() (common.Address, error) { + return _ArbitrumInbox.Contract.SequencerInbox(&_ArbitrumInbox.CallOpts) +} + +func (_ArbitrumInbox *ArbitrumInboxCallerSession) SequencerInbox() (common.Address, error) { + return _ArbitrumInbox.Contract.SequencerInbox(&_ArbitrumInbox.CallOpts) +} + +func (_ArbitrumInbox *ArbitrumInboxTransactor) Initialize(opts *bind.TransactOpts, _bridge common.Address, _sequencerInbox common.Address) (*types.Transaction, error) { + return _ArbitrumInbox.contract.Transact(opts, "initialize", _bridge, _sequencerInbox) +} + +func (_ArbitrumInbox *ArbitrumInboxSession) Initialize(_bridge common.Address, _sequencerInbox common.Address) (*types.Transaction, error) { + return _ArbitrumInbox.Contract.Initialize(&_ArbitrumInbox.TransactOpts, _bridge, _sequencerInbox) +} + +func (_ArbitrumInbox *ArbitrumInboxTransactorSession) Initialize(_bridge common.Address, _sequencerInbox common.Address) (*types.Transaction, error) { + return _ArbitrumInbox.Contract.Initialize(&_ArbitrumInbox.TransactOpts, _bridge, _sequencerInbox) +} + +func (_ArbitrumInbox *ArbitrumInboxTransactor) Pause(opts *bind.TransactOpts) (*types.Transaction, error) { + return _ArbitrumInbox.contract.Transact(opts, "pause") +} + +func (_ArbitrumInbox *ArbitrumInboxSession) Pause() (*types.Transaction, error) { + return _ArbitrumInbox.Contract.Pause(&_ArbitrumInbox.TransactOpts) +} + +func (_ArbitrumInbox *ArbitrumInboxTransactorSession) Pause() (*types.Transaction, error) { + return _ArbitrumInbox.Contract.Pause(&_ArbitrumInbox.TransactOpts) +} + +func (_ArbitrumInbox *ArbitrumInboxTransactor) SendContractTransaction(opts *bind.TransactOpts, gasLimit *big.Int, maxFeePerGas *big.Int, to common.Address, value *big.Int, data []byte) (*types.Transaction, error) { + return _ArbitrumInbox.contract.Transact(opts, "sendContractTransaction", gasLimit, maxFeePerGas, to, value, data) +} + +func (_ArbitrumInbox *ArbitrumInboxSession) SendContractTransaction(gasLimit *big.Int, maxFeePerGas *big.Int, to common.Address, value *big.Int, data []byte) (*types.Transaction, error) { + return _ArbitrumInbox.Contract.SendContractTransaction(&_ArbitrumInbox.TransactOpts, gasLimit, maxFeePerGas, to, value, data) +} + +func (_ArbitrumInbox *ArbitrumInboxTransactorSession) SendContractTransaction(gasLimit *big.Int, maxFeePerGas *big.Int, to common.Address, value *big.Int, data []byte) (*types.Transaction, error) { + return _ArbitrumInbox.Contract.SendContractTransaction(&_ArbitrumInbox.TransactOpts, gasLimit, maxFeePerGas, to, value, data) +} + +func (_ArbitrumInbox *ArbitrumInboxTransactor) SendL2Message(opts *bind.TransactOpts, messageData []byte) (*types.Transaction, error) { + return _ArbitrumInbox.contract.Transact(opts, "sendL2Message", messageData) +} + +func (_ArbitrumInbox *ArbitrumInboxSession) SendL2Message(messageData []byte) (*types.Transaction, error) { + return _ArbitrumInbox.Contract.SendL2Message(&_ArbitrumInbox.TransactOpts, messageData) +} + +func (_ArbitrumInbox *ArbitrumInboxTransactorSession) SendL2Message(messageData []byte) (*types.Transaction, error) { + return _ArbitrumInbox.Contract.SendL2Message(&_ArbitrumInbox.TransactOpts, messageData) +} + +func (_ArbitrumInbox *ArbitrumInboxTransactor) SendL2MessageFromOrigin(opts *bind.TransactOpts, messageData []byte) (*types.Transaction, error) { + return _ArbitrumInbox.contract.Transact(opts, "sendL2MessageFromOrigin", messageData) +} + +func (_ArbitrumInbox *ArbitrumInboxSession) SendL2MessageFromOrigin(messageData []byte) (*types.Transaction, error) { + return _ArbitrumInbox.Contract.SendL2MessageFromOrigin(&_ArbitrumInbox.TransactOpts, messageData) +} + +func (_ArbitrumInbox *ArbitrumInboxTransactorSession) SendL2MessageFromOrigin(messageData []byte) (*types.Transaction, error) { + return _ArbitrumInbox.Contract.SendL2MessageFromOrigin(&_ArbitrumInbox.TransactOpts, messageData) +} + +func (_ArbitrumInbox *ArbitrumInboxTransactor) SendUnsignedTransaction(opts *bind.TransactOpts, gasLimit *big.Int, maxFeePerGas *big.Int, nonce *big.Int, to common.Address, value *big.Int, data []byte) (*types.Transaction, error) { + return _ArbitrumInbox.contract.Transact(opts, "sendUnsignedTransaction", gasLimit, maxFeePerGas, nonce, to, value, data) +} + +func (_ArbitrumInbox *ArbitrumInboxSession) SendUnsignedTransaction(gasLimit *big.Int, maxFeePerGas *big.Int, nonce *big.Int, to common.Address, value *big.Int, data []byte) (*types.Transaction, error) { + return _ArbitrumInbox.Contract.SendUnsignedTransaction(&_ArbitrumInbox.TransactOpts, gasLimit, maxFeePerGas, nonce, to, value, data) +} + +func (_ArbitrumInbox *ArbitrumInboxTransactorSession) SendUnsignedTransaction(gasLimit *big.Int, maxFeePerGas *big.Int, nonce *big.Int, to common.Address, value *big.Int, data []byte) (*types.Transaction, error) { + return _ArbitrumInbox.Contract.SendUnsignedTransaction(&_ArbitrumInbox.TransactOpts, gasLimit, maxFeePerGas, nonce, to, value, data) +} + +func (_ArbitrumInbox *ArbitrumInboxTransactor) SetAllowList(opts *bind.TransactOpts, user []common.Address, val []bool) (*types.Transaction, error) { + return _ArbitrumInbox.contract.Transact(opts, "setAllowList", user, val) +} + +func (_ArbitrumInbox *ArbitrumInboxSession) SetAllowList(user []common.Address, val []bool) (*types.Transaction, error) { + return _ArbitrumInbox.Contract.SetAllowList(&_ArbitrumInbox.TransactOpts, user, val) +} + +func (_ArbitrumInbox *ArbitrumInboxTransactorSession) SetAllowList(user []common.Address, val []bool) (*types.Transaction, error) { + return _ArbitrumInbox.Contract.SetAllowList(&_ArbitrumInbox.TransactOpts, user, val) +} + +func (_ArbitrumInbox *ArbitrumInboxTransactor) SetAllowListEnabled(opts *bind.TransactOpts, _allowListEnabled bool) (*types.Transaction, error) { + return _ArbitrumInbox.contract.Transact(opts, "setAllowListEnabled", _allowListEnabled) +} + +func (_ArbitrumInbox *ArbitrumInboxSession) SetAllowListEnabled(_allowListEnabled bool) (*types.Transaction, error) { + return _ArbitrumInbox.Contract.SetAllowListEnabled(&_ArbitrumInbox.TransactOpts, _allowListEnabled) +} + +func (_ArbitrumInbox *ArbitrumInboxTransactorSession) SetAllowListEnabled(_allowListEnabled bool) (*types.Transaction, error) { + return _ArbitrumInbox.Contract.SetAllowListEnabled(&_ArbitrumInbox.TransactOpts, _allowListEnabled) +} + +func (_ArbitrumInbox *ArbitrumInboxTransactor) Unpause(opts *bind.TransactOpts) (*types.Transaction, error) { + return _ArbitrumInbox.contract.Transact(opts, "unpause") +} + +func (_ArbitrumInbox *ArbitrumInboxSession) Unpause() (*types.Transaction, error) { + return _ArbitrumInbox.Contract.Unpause(&_ArbitrumInbox.TransactOpts) +} + +func (_ArbitrumInbox *ArbitrumInboxTransactorSession) Unpause() (*types.Transaction, error) { + return _ArbitrumInbox.Contract.Unpause(&_ArbitrumInbox.TransactOpts) +} + +type ArbitrumInboxInboxMessageDeliveredIterator struct { + Event *ArbitrumInboxInboxMessageDelivered + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *ArbitrumInboxInboxMessageDeliveredIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(ArbitrumInboxInboxMessageDelivered) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(ArbitrumInboxInboxMessageDelivered) + 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() + } +} + +func (it *ArbitrumInboxInboxMessageDeliveredIterator) Error() error { + return it.fail +} + +func (it *ArbitrumInboxInboxMessageDeliveredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type ArbitrumInboxInboxMessageDelivered struct { + MessageNum *big.Int + Data []byte + Raw types.Log +} + +func (_ArbitrumInbox *ArbitrumInboxFilterer) FilterInboxMessageDelivered(opts *bind.FilterOpts, messageNum []*big.Int) (*ArbitrumInboxInboxMessageDeliveredIterator, error) { + + var messageNumRule []interface{} + for _, messageNumItem := range messageNum { + messageNumRule = append(messageNumRule, messageNumItem) + } + + logs, sub, err := _ArbitrumInbox.contract.FilterLogs(opts, "InboxMessageDelivered", messageNumRule) + if err != nil { + return nil, err + } + return &ArbitrumInboxInboxMessageDeliveredIterator{contract: _ArbitrumInbox.contract, event: "InboxMessageDelivered", logs: logs, sub: sub}, nil +} + +func (_ArbitrumInbox *ArbitrumInboxFilterer) WatchInboxMessageDelivered(opts *bind.WatchOpts, sink chan<- *ArbitrumInboxInboxMessageDelivered, messageNum []*big.Int) (event.Subscription, error) { + + var messageNumRule []interface{} + for _, messageNumItem := range messageNum { + messageNumRule = append(messageNumRule, messageNumItem) + } + + logs, sub, err := _ArbitrumInbox.contract.WatchLogs(opts, "InboxMessageDelivered", messageNumRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(ArbitrumInboxInboxMessageDelivered) + if err := _ArbitrumInbox.contract.UnpackLog(event, "InboxMessageDelivered", 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 +} + +func (_ArbitrumInbox *ArbitrumInboxFilterer) ParseInboxMessageDelivered(log types.Log) (*ArbitrumInboxInboxMessageDelivered, error) { + event := new(ArbitrumInboxInboxMessageDelivered) + if err := _ArbitrumInbox.contract.UnpackLog(event, "InboxMessageDelivered", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type ArbitrumInboxInboxMessageDeliveredFromOriginIterator struct { + Event *ArbitrumInboxInboxMessageDeliveredFromOrigin + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *ArbitrumInboxInboxMessageDeliveredFromOriginIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(ArbitrumInboxInboxMessageDeliveredFromOrigin) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(ArbitrumInboxInboxMessageDeliveredFromOrigin) + 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() + } +} + +func (it *ArbitrumInboxInboxMessageDeliveredFromOriginIterator) Error() error { + return it.fail +} + +func (it *ArbitrumInboxInboxMessageDeliveredFromOriginIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type ArbitrumInboxInboxMessageDeliveredFromOrigin struct { + MessageNum *big.Int + Raw types.Log +} + +func (_ArbitrumInbox *ArbitrumInboxFilterer) FilterInboxMessageDeliveredFromOrigin(opts *bind.FilterOpts, messageNum []*big.Int) (*ArbitrumInboxInboxMessageDeliveredFromOriginIterator, error) { + + var messageNumRule []interface{} + for _, messageNumItem := range messageNum { + messageNumRule = append(messageNumRule, messageNumItem) + } + + logs, sub, err := _ArbitrumInbox.contract.FilterLogs(opts, "InboxMessageDeliveredFromOrigin", messageNumRule) + if err != nil { + return nil, err + } + return &ArbitrumInboxInboxMessageDeliveredFromOriginIterator{contract: _ArbitrumInbox.contract, event: "InboxMessageDeliveredFromOrigin", logs: logs, sub: sub}, nil +} + +func (_ArbitrumInbox *ArbitrumInboxFilterer) WatchInboxMessageDeliveredFromOrigin(opts *bind.WatchOpts, sink chan<- *ArbitrumInboxInboxMessageDeliveredFromOrigin, messageNum []*big.Int) (event.Subscription, error) { + + var messageNumRule []interface{} + for _, messageNumItem := range messageNum { + messageNumRule = append(messageNumRule, messageNumItem) + } + + logs, sub, err := _ArbitrumInbox.contract.WatchLogs(opts, "InboxMessageDeliveredFromOrigin", messageNumRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(ArbitrumInboxInboxMessageDeliveredFromOrigin) + if err := _ArbitrumInbox.contract.UnpackLog(event, "InboxMessageDeliveredFromOrigin", 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 +} + +func (_ArbitrumInbox *ArbitrumInboxFilterer) ParseInboxMessageDeliveredFromOrigin(log types.Log) (*ArbitrumInboxInboxMessageDeliveredFromOrigin, error) { + event := new(ArbitrumInboxInboxMessageDeliveredFromOrigin) + if err := _ArbitrumInbox.contract.UnpackLog(event, "InboxMessageDeliveredFromOrigin", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +func (_ArbitrumInbox *ArbitrumInbox) ParseLog(log types.Log) (generated.AbigenLog, error) { + switch log.Topics[0] { + case _ArbitrumInbox.abi.Events["InboxMessageDelivered"].ID: + return _ArbitrumInbox.ParseInboxMessageDelivered(log) + case _ArbitrumInbox.abi.Events["InboxMessageDeliveredFromOrigin"].ID: + return _ArbitrumInbox.ParseInboxMessageDeliveredFromOrigin(log) + + default: + return nil, fmt.Errorf("abigen wrapper received unknown log topic: %v", log.Topics[0]) + } +} + +func (ArbitrumInboxInboxMessageDelivered) Topic() common.Hash { + return common.HexToHash("0xff64905f73a67fb594e0f940a8075a860db489ad991e032f48c81123eb52d60b") +} + +func (ArbitrumInboxInboxMessageDeliveredFromOrigin) Topic() common.Hash { + return common.HexToHash("0xab532385be8f1005a4b6ba8fa20a2245facb346134ac739fe9a5198dc1580b9c") +} + +func (_ArbitrumInbox *ArbitrumInbox) Address() common.Address { + return _ArbitrumInbox.address +} + +type ArbitrumInboxInterface interface { + AllowListEnabled(opts *bind.CallOpts) (bool, error) + + Bridge(opts *bind.CallOpts) (common.Address, error) + + CalculateRetryableSubmissionFee(opts *bind.CallOpts, dataLength *big.Int, baseFee *big.Int) (*big.Int, error) + + GetProxyAdmin(opts *bind.CallOpts) (common.Address, error) + + IsAllowed(opts *bind.CallOpts, user common.Address) (bool, error) + + MaxDataSize(opts *bind.CallOpts) (*big.Int, error) + + SequencerInbox(opts *bind.CallOpts) (common.Address, error) + + Initialize(opts *bind.TransactOpts, _bridge common.Address, _sequencerInbox common.Address) (*types.Transaction, error) + + Pause(opts *bind.TransactOpts) (*types.Transaction, error) + + SendContractTransaction(opts *bind.TransactOpts, gasLimit *big.Int, maxFeePerGas *big.Int, to common.Address, value *big.Int, data []byte) (*types.Transaction, error) + + SendL2Message(opts *bind.TransactOpts, messageData []byte) (*types.Transaction, error) + + SendL2MessageFromOrigin(opts *bind.TransactOpts, messageData []byte) (*types.Transaction, error) + + SendUnsignedTransaction(opts *bind.TransactOpts, gasLimit *big.Int, maxFeePerGas *big.Int, nonce *big.Int, to common.Address, value *big.Int, data []byte) (*types.Transaction, error) + + SetAllowList(opts *bind.TransactOpts, user []common.Address, val []bool) (*types.Transaction, error) + + SetAllowListEnabled(opts *bind.TransactOpts, _allowListEnabled bool) (*types.Transaction, error) + + Unpause(opts *bind.TransactOpts) (*types.Transaction, error) + + FilterInboxMessageDelivered(opts *bind.FilterOpts, messageNum []*big.Int) (*ArbitrumInboxInboxMessageDeliveredIterator, error) + + WatchInboxMessageDelivered(opts *bind.WatchOpts, sink chan<- *ArbitrumInboxInboxMessageDelivered, messageNum []*big.Int) (event.Subscription, error) + + ParseInboxMessageDelivered(log types.Log) (*ArbitrumInboxInboxMessageDelivered, error) + + FilterInboxMessageDeliveredFromOrigin(opts *bind.FilterOpts, messageNum []*big.Int) (*ArbitrumInboxInboxMessageDeliveredFromOriginIterator, error) + + WatchInboxMessageDeliveredFromOrigin(opts *bind.WatchOpts, sink chan<- *ArbitrumInboxInboxMessageDeliveredFromOrigin, messageNum []*big.Int) (event.Subscription, error) + + ParseInboxMessageDeliveredFromOrigin(log types.Log) (*ArbitrumInboxInboxMessageDeliveredFromOrigin, error) + + ParseLog(log types.Log) (generated.AbigenLog, error) + + Address() common.Address +} diff --git a/core/gethwrappers/liquiditymanager/generated/arbitrum_l1_bridge_adapter/arbitrum_l1_bridge_adapter.go b/core/gethwrappers/liquiditymanager/generated/arbitrum_l1_bridge_adapter/arbitrum_l1_bridge_adapter.go new file mode 100644 index 00000000000..d0ddb797f18 --- /dev/null +++ b/core/gethwrappers/liquiditymanager/generated/arbitrum_l1_bridge_adapter/arbitrum_l1_bridge_adapter.go @@ -0,0 +1,316 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package arbitrum_l1_bridge_adapter + +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" +) + +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +type ArbitrumL1BridgeAdapterArbitrumFinalizationPayload struct { + Proof [][32]byte + Index *big.Int + L2Sender common.Address + To common.Address + L2Block *big.Int + L1Block *big.Int + L2Timestamp *big.Int + Value *big.Int + Data []byte +} + +type ArbitrumL1BridgeAdapterSendERC20Params struct { + GasLimit *big.Int + MaxSubmissionCost *big.Int + MaxFeePerGas *big.Int +} + +var ArbitrumL1BridgeAdapterMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"internalType\":\"contractIL1GatewayRouter\",\"name\":\"l1GatewayRouter\",\"type\":\"address\"},{\"internalType\":\"contractIOutbox\",\"name\":\"l1Outbox\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"BridgeAddressCannotBeZero\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"wanted\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"got\",\"type\":\"uint256\"}],\"name\":\"InsufficientEthValue\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"MsgShouldNotContainValue\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"msgValue\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"MsgValueDoesNotMatchAmount\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"NoGatewayForToken\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Unimplemented\",\"type\":\"error\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes32[]\",\"name\":\"proof\",\"type\":\"bytes32[]\"},{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"l2Sender\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"l2Block\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"l1Block\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"l2Timestamp\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"internalType\":\"structArbitrumL1BridgeAdapter.ArbitrumFinalizationPayload\",\"name\":\"payload\",\"type\":\"tuple\"}],\"name\":\"exposeArbitrumFinalizationPayload\",\"outputs\":[],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"gasLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxSubmissionCost\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxFeePerGas\",\"type\":\"uint256\"}],\"internalType\":\"structArbitrumL1BridgeAdapter.SendERC20Params\",\"name\":\"params\",\"type\":\"tuple\"}],\"name\":\"exposeSendERC20Params\",\"outputs\":[],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"arbitrumFinalizationPayload\",\"type\":\"bytes\"}],\"name\":\"finalizeWithdrawERC20\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getBridgeFeeInNative\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"l1Token\",\"type\":\"address\"}],\"name\":\"getL2Token\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"localToken\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"bridgeSpecificPayload\",\"type\":\"bytes\"}],\"name\":\"sendERC20\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"function\"}]", + Bin: "0x60c060405234801561001057600080fd5b50604051620013c0380380620013c08339810160408190526100319161009b565b6001600160a01b038216158061004e57506001600160a01b038116155b1561006c57604051635e9c404d60e11b815260040160405180910390fd5b6001600160a01b039182166080521660a0526100d5565b6001600160a01b038116811461009857600080fd5b50565b600080604083850312156100ae57600080fd5b82516100b981610083565b60208401519092506100ca81610083565b809150509250929050565b60805160a0516112b76200010960003960006102100152600081816102f90152818161047101526105cd01526112b76000f3fe6080604052600436106100655760003560e01c8063b5399c9e11610043578063b5399c9e146100e2578063c7665dd214610102578063c985069c1461011d57600080fd5b80632e4b1fc91461006a57806338314bb214610092578063a71d98b7146100c2575b600080fd5b34801561007657600080fd5b5061007f610162565b6040519081526020015b60405180910390f35b34801561009e57600080fd5b506100b26100ad366004610ba1565b610196565b6040519015158152602001610089565b6100d56100d0366004610c06565b61028d565b6040516100899190610cf9565b3480156100ee57600080fd5b506101006100fd366004610dbb565b50565b005b34801561010e57600080fd5b506101006100fd366004610f28565b34801561012957600080fd5b5061013d610138366004611012565b610585565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610089565b60006040517f6e12839900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000806101a583850185610f28565b805160208201516040808401516060850151608086015160a087015160c088015160e08901516101008a015196517f08635a95000000000000000000000000000000000000000000000000000000008152999a5073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016996308635a959961024d999098909796959493929160040161102f565b600060405180830381600087803b15801561026757600080fd5b505af115801561027b573d6000803e3d6000fd5b5050505060019150505b949350505050565b60606102b173ffffffffffffffffffffffffffffffffffffffff8816333087610640565b6040517fbda009fe00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff88811660048301526000917f00000000000000000000000000000000000000000000000000000000000000009091169063bda009fe90602401602060405180830381865afa158015610342573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061036691906110ed565b905073ffffffffffffffffffffffffffffffffffffffff81166103d2576040517f6c1460f400000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff891660048201526024015b60405180910390fd5b6103f373ffffffffffffffffffffffffffffffffffffffff89168287610722565b600061040184860186610dbb565b9050600081602001518260400151836000015161041e9190611139565b6104289190611150565b90508034101561046d576040517f03da4d23000000000000000000000000000000000000000000000000000000008152346004820152602481018290526044016103c9565b60007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16634fb1a07b348d8c8d8d89600001518a604001518b60200151604051806020016040528060008152506040516020016104e0929190611163565b6040516020818303038152906040526040518963ffffffff1660e01b8152600401610511979695949392919061117c565b60006040518083038185885af115801561052f573d6000803e3d6000fd5b50505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820160405261057691908101906111dc565b9b9a5050505050505050505050565b6040517fa7e28d4800000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff82811660048301526000917f00000000000000000000000000000000000000000000000000000000000000009091169063a7e28d4890602401602060405180830381865afa158015610616573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061063a91906110ed565b92915050565b60405173ffffffffffffffffffffffffffffffffffffffff8085166024830152831660448201526064810182905261071c9085907f23b872dd00000000000000000000000000000000000000000000000000000000906084015b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff00000000000000000000000000000000000000000000000000000000909316929092179091526108a9565b50505050565b8015806107c257506040517fdd62ed3e00000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff838116602483015284169063dd62ed3e90604401602060405180830381865afa15801561079c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107c09190611253565b155b61084e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527f20746f206e6f6e2d7a65726f20616c6c6f77616e63650000000000000000000060648201526084016103c9565b60405173ffffffffffffffffffffffffffffffffffffffff83166024820152604481018290526108a49084907f095ea7b3000000000000000000000000000000000000000000000000000000009060640161069a565b505050565b600061090b826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166109b59092919063ffffffff16565b8051909150156108a45780806020019051810190610929919061126c565b6108a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f7420737563636565640000000000000000000000000000000000000000000060648201526084016103c9565b60606102858484600085856000808673ffffffffffffffffffffffffffffffffffffffff1685876040516109e9919061128e565b60006040518083038185875af1925050503d8060008114610a26576040519150601f19603f3d011682016040523d82523d6000602084013e610a2b565b606091505b5091509150610a3c87838387610a47565b979650505050505050565b60608315610add578251600003610ad65773ffffffffffffffffffffffffffffffffffffffff85163b610ad6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016103c9565b5081610285565b6102858383815115610af25781518083602001fd5b806040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103c99190610cf9565b73ffffffffffffffffffffffffffffffffffffffff811681146100fd57600080fd5b8035610b5381610b26565b919050565b60008083601f840112610b6a57600080fd5b50813567ffffffffffffffff811115610b8257600080fd5b602083019150836020828501011115610b9a57600080fd5b9250929050565b60008060008060608587031215610bb757600080fd5b8435610bc281610b26565b93506020850135610bd281610b26565b9250604085013567ffffffffffffffff811115610bee57600080fd5b610bfa87828801610b58565b95989497509550505050565b60008060008060008060a08789031215610c1f57600080fd5b8635610c2a81610b26565b95506020870135610c3a81610b26565b94506040870135610c4a81610b26565b935060608701359250608087013567ffffffffffffffff811115610c6d57600080fd5b610c7989828a01610b58565b979a9699509497509295939492505050565b60005b83811015610ca6578181015183820152602001610c8e565b50506000910152565b60008151808452610cc7816020860160208601610c8b565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b602081526000610d0c6020830184610caf565b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051610120810167ffffffffffffffff81118282101715610d6657610d66610d13565b60405290565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715610db357610db3610d13565b604052919050565b600060608284031215610dcd57600080fd5b6040516060810181811067ffffffffffffffff82111715610df057610df0610d13565b80604052508235815260208301356020820152604083013560408201528091505092915050565b600082601f830112610e2857600080fd5b8135602067ffffffffffffffff821115610e4457610e44610d13565b8160051b610e53828201610d6c565b9283528481018201928281019087851115610e6d57600080fd5b83870192505b84831015610a3c57823582529183019190830190610e73565b600067ffffffffffffffff821115610ea657610ea6610d13565b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b600082601f830112610ee357600080fd5b8135610ef6610ef182610e8c565b610d6c565b818152846020838601011115610f0b57600080fd5b816020850160208301376000918101602001919091529392505050565b600060208284031215610f3a57600080fd5b813567ffffffffffffffff80821115610f5257600080fd5b908301906101208286031215610f6757600080fd5b610f6f610d42565b823582811115610f7e57600080fd5b610f8a87828601610e17565b82525060208301356020820152610fa360408401610b48565b6040820152610fb460608401610b48565b60608201526080830135608082015260a083013560a082015260c083013560c082015260e083013560e08201526101008084013583811115610ff557600080fd5b61100188828701610ed2565b918301919091525095945050505050565b60006020828403121561102457600080fd5b8135610d0c81610b26565b6101208082528a51908201819052600090610140830190602090818e01845b8281101561106a5781518552938301939083019060010161104e565b505050508a6020840152611096604084018b73ffffffffffffffffffffffffffffffffffffffff169052565b73ffffffffffffffffffffffffffffffffffffffff891660608401528760808401528660a08401528560c08401528460e08401528281036101008401526110dd8185610caf565b9c9b505050505050505050505050565b6000602082840312156110ff57600080fd5b8151610d0c81610b26565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b808202811582820484141761063a5761063a61110a565b8082018082111561063a5761063a61110a565b8281526040602082015260006102856040830184610caf565b600073ffffffffffffffffffffffffffffffffffffffff808a16835280891660208401528088166040840152508560608301528460808301528360a083015260e060c08301526111cf60e0830184610caf565b9998505050505050505050565b6000602082840312156111ee57600080fd5b815167ffffffffffffffff81111561120557600080fd5b8201601f8101841361121657600080fd5b8051611224610ef182610e8c565b81815285602083850101111561123957600080fd5b61124a826020830160208601610c8b565b95945050505050565b60006020828403121561126557600080fd5b5051919050565b60006020828403121561127e57600080fd5b81518015158114610d0c57600080fd5b600082516112a0818460208701610c8b565b919091019291505056fea164736f6c6343000818000a", +} + +var ArbitrumL1BridgeAdapterABI = ArbitrumL1BridgeAdapterMetaData.ABI + +var ArbitrumL1BridgeAdapterBin = ArbitrumL1BridgeAdapterMetaData.Bin + +func DeployArbitrumL1BridgeAdapter(auth *bind.TransactOpts, backend bind.ContractBackend, l1GatewayRouter common.Address, l1Outbox common.Address) (common.Address, *types.Transaction, *ArbitrumL1BridgeAdapter, error) { + parsed, err := ArbitrumL1BridgeAdapterMetaData.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(ArbitrumL1BridgeAdapterBin), backend, l1GatewayRouter, l1Outbox) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &ArbitrumL1BridgeAdapter{address: address, abi: *parsed, ArbitrumL1BridgeAdapterCaller: ArbitrumL1BridgeAdapterCaller{contract: contract}, ArbitrumL1BridgeAdapterTransactor: ArbitrumL1BridgeAdapterTransactor{contract: contract}, ArbitrumL1BridgeAdapterFilterer: ArbitrumL1BridgeAdapterFilterer{contract: contract}}, nil +} + +type ArbitrumL1BridgeAdapter struct { + address common.Address + abi abi.ABI + ArbitrumL1BridgeAdapterCaller + ArbitrumL1BridgeAdapterTransactor + ArbitrumL1BridgeAdapterFilterer +} + +type ArbitrumL1BridgeAdapterCaller struct { + contract *bind.BoundContract +} + +type ArbitrumL1BridgeAdapterTransactor struct { + contract *bind.BoundContract +} + +type ArbitrumL1BridgeAdapterFilterer struct { + contract *bind.BoundContract +} + +type ArbitrumL1BridgeAdapterSession struct { + Contract *ArbitrumL1BridgeAdapter + CallOpts bind.CallOpts + TransactOpts bind.TransactOpts +} + +type ArbitrumL1BridgeAdapterCallerSession struct { + Contract *ArbitrumL1BridgeAdapterCaller + CallOpts bind.CallOpts +} + +type ArbitrumL1BridgeAdapterTransactorSession struct { + Contract *ArbitrumL1BridgeAdapterTransactor + TransactOpts bind.TransactOpts +} + +type ArbitrumL1BridgeAdapterRaw struct { + Contract *ArbitrumL1BridgeAdapter +} + +type ArbitrumL1BridgeAdapterCallerRaw struct { + Contract *ArbitrumL1BridgeAdapterCaller +} + +type ArbitrumL1BridgeAdapterTransactorRaw struct { + Contract *ArbitrumL1BridgeAdapterTransactor +} + +func NewArbitrumL1BridgeAdapter(address common.Address, backend bind.ContractBackend) (*ArbitrumL1BridgeAdapter, error) { + abi, err := abi.JSON(strings.NewReader(ArbitrumL1BridgeAdapterABI)) + if err != nil { + return nil, err + } + contract, err := bindArbitrumL1BridgeAdapter(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &ArbitrumL1BridgeAdapter{address: address, abi: abi, ArbitrumL1BridgeAdapterCaller: ArbitrumL1BridgeAdapterCaller{contract: contract}, ArbitrumL1BridgeAdapterTransactor: ArbitrumL1BridgeAdapterTransactor{contract: contract}, ArbitrumL1BridgeAdapterFilterer: ArbitrumL1BridgeAdapterFilterer{contract: contract}}, nil +} + +func NewArbitrumL1BridgeAdapterCaller(address common.Address, caller bind.ContractCaller) (*ArbitrumL1BridgeAdapterCaller, error) { + contract, err := bindArbitrumL1BridgeAdapter(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &ArbitrumL1BridgeAdapterCaller{contract: contract}, nil +} + +func NewArbitrumL1BridgeAdapterTransactor(address common.Address, transactor bind.ContractTransactor) (*ArbitrumL1BridgeAdapterTransactor, error) { + contract, err := bindArbitrumL1BridgeAdapter(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &ArbitrumL1BridgeAdapterTransactor{contract: contract}, nil +} + +func NewArbitrumL1BridgeAdapterFilterer(address common.Address, filterer bind.ContractFilterer) (*ArbitrumL1BridgeAdapterFilterer, error) { + contract, err := bindArbitrumL1BridgeAdapter(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &ArbitrumL1BridgeAdapterFilterer{contract: contract}, nil +} + +func bindArbitrumL1BridgeAdapter(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := ArbitrumL1BridgeAdapterMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +func (_ArbitrumL1BridgeAdapter *ArbitrumL1BridgeAdapterRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _ArbitrumL1BridgeAdapter.Contract.ArbitrumL1BridgeAdapterCaller.contract.Call(opts, result, method, params...) +} + +func (_ArbitrumL1BridgeAdapter *ArbitrumL1BridgeAdapterRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _ArbitrumL1BridgeAdapter.Contract.ArbitrumL1BridgeAdapterTransactor.contract.Transfer(opts) +} + +func (_ArbitrumL1BridgeAdapter *ArbitrumL1BridgeAdapterRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _ArbitrumL1BridgeAdapter.Contract.ArbitrumL1BridgeAdapterTransactor.contract.Transact(opts, method, params...) +} + +func (_ArbitrumL1BridgeAdapter *ArbitrumL1BridgeAdapterCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _ArbitrumL1BridgeAdapter.Contract.contract.Call(opts, result, method, params...) +} + +func (_ArbitrumL1BridgeAdapter *ArbitrumL1BridgeAdapterTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _ArbitrumL1BridgeAdapter.Contract.contract.Transfer(opts) +} + +func (_ArbitrumL1BridgeAdapter *ArbitrumL1BridgeAdapterTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _ArbitrumL1BridgeAdapter.Contract.contract.Transact(opts, method, params...) +} + +func (_ArbitrumL1BridgeAdapter *ArbitrumL1BridgeAdapterCaller) ExposeArbitrumFinalizationPayload(opts *bind.CallOpts, payload ArbitrumL1BridgeAdapterArbitrumFinalizationPayload) error { + var out []interface{} + err := _ArbitrumL1BridgeAdapter.contract.Call(opts, &out, "exposeArbitrumFinalizationPayload", payload) + + if err != nil { + return err + } + + return err + +} + +func (_ArbitrumL1BridgeAdapter *ArbitrumL1BridgeAdapterSession) ExposeArbitrumFinalizationPayload(payload ArbitrumL1BridgeAdapterArbitrumFinalizationPayload) error { + return _ArbitrumL1BridgeAdapter.Contract.ExposeArbitrumFinalizationPayload(&_ArbitrumL1BridgeAdapter.CallOpts, payload) +} + +func (_ArbitrumL1BridgeAdapter *ArbitrumL1BridgeAdapterCallerSession) ExposeArbitrumFinalizationPayload(payload ArbitrumL1BridgeAdapterArbitrumFinalizationPayload) error { + return _ArbitrumL1BridgeAdapter.Contract.ExposeArbitrumFinalizationPayload(&_ArbitrumL1BridgeAdapter.CallOpts, payload) +} + +func (_ArbitrumL1BridgeAdapter *ArbitrumL1BridgeAdapterCaller) ExposeSendERC20Params(opts *bind.CallOpts, params ArbitrumL1BridgeAdapterSendERC20Params) error { + var out []interface{} + err := _ArbitrumL1BridgeAdapter.contract.Call(opts, &out, "exposeSendERC20Params", params) + + if err != nil { + return err + } + + return err + +} + +func (_ArbitrumL1BridgeAdapter *ArbitrumL1BridgeAdapterSession) ExposeSendERC20Params(params ArbitrumL1BridgeAdapterSendERC20Params) error { + return _ArbitrumL1BridgeAdapter.Contract.ExposeSendERC20Params(&_ArbitrumL1BridgeAdapter.CallOpts, params) +} + +func (_ArbitrumL1BridgeAdapter *ArbitrumL1BridgeAdapterCallerSession) ExposeSendERC20Params(params ArbitrumL1BridgeAdapterSendERC20Params) error { + return _ArbitrumL1BridgeAdapter.Contract.ExposeSendERC20Params(&_ArbitrumL1BridgeAdapter.CallOpts, params) +} + +func (_ArbitrumL1BridgeAdapter *ArbitrumL1BridgeAdapterCaller) GetBridgeFeeInNative(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _ArbitrumL1BridgeAdapter.contract.Call(opts, &out, "getBridgeFeeInNative") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_ArbitrumL1BridgeAdapter *ArbitrumL1BridgeAdapterSession) GetBridgeFeeInNative() (*big.Int, error) { + return _ArbitrumL1BridgeAdapter.Contract.GetBridgeFeeInNative(&_ArbitrumL1BridgeAdapter.CallOpts) +} + +func (_ArbitrumL1BridgeAdapter *ArbitrumL1BridgeAdapterCallerSession) GetBridgeFeeInNative() (*big.Int, error) { + return _ArbitrumL1BridgeAdapter.Contract.GetBridgeFeeInNative(&_ArbitrumL1BridgeAdapter.CallOpts) +} + +func (_ArbitrumL1BridgeAdapter *ArbitrumL1BridgeAdapterCaller) GetL2Token(opts *bind.CallOpts, l1Token common.Address) (common.Address, error) { + var out []interface{} + err := _ArbitrumL1BridgeAdapter.contract.Call(opts, &out, "getL2Token", l1Token) + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_ArbitrumL1BridgeAdapter *ArbitrumL1BridgeAdapterSession) GetL2Token(l1Token common.Address) (common.Address, error) { + return _ArbitrumL1BridgeAdapter.Contract.GetL2Token(&_ArbitrumL1BridgeAdapter.CallOpts, l1Token) +} + +func (_ArbitrumL1BridgeAdapter *ArbitrumL1BridgeAdapterCallerSession) GetL2Token(l1Token common.Address) (common.Address, error) { + return _ArbitrumL1BridgeAdapter.Contract.GetL2Token(&_ArbitrumL1BridgeAdapter.CallOpts, l1Token) +} + +func (_ArbitrumL1BridgeAdapter *ArbitrumL1BridgeAdapterTransactor) FinalizeWithdrawERC20(opts *bind.TransactOpts, arg0 common.Address, arg1 common.Address, arbitrumFinalizationPayload []byte) (*types.Transaction, error) { + return _ArbitrumL1BridgeAdapter.contract.Transact(opts, "finalizeWithdrawERC20", arg0, arg1, arbitrumFinalizationPayload) +} + +func (_ArbitrumL1BridgeAdapter *ArbitrumL1BridgeAdapterSession) FinalizeWithdrawERC20(arg0 common.Address, arg1 common.Address, arbitrumFinalizationPayload []byte) (*types.Transaction, error) { + return _ArbitrumL1BridgeAdapter.Contract.FinalizeWithdrawERC20(&_ArbitrumL1BridgeAdapter.TransactOpts, arg0, arg1, arbitrumFinalizationPayload) +} + +func (_ArbitrumL1BridgeAdapter *ArbitrumL1BridgeAdapterTransactorSession) FinalizeWithdrawERC20(arg0 common.Address, arg1 common.Address, arbitrumFinalizationPayload []byte) (*types.Transaction, error) { + return _ArbitrumL1BridgeAdapter.Contract.FinalizeWithdrawERC20(&_ArbitrumL1BridgeAdapter.TransactOpts, arg0, arg1, arbitrumFinalizationPayload) +} + +func (_ArbitrumL1BridgeAdapter *ArbitrumL1BridgeAdapterTransactor) SendERC20(opts *bind.TransactOpts, localToken common.Address, arg1 common.Address, recipient common.Address, amount *big.Int, bridgeSpecificPayload []byte) (*types.Transaction, error) { + return _ArbitrumL1BridgeAdapter.contract.Transact(opts, "sendERC20", localToken, arg1, recipient, amount, bridgeSpecificPayload) +} + +func (_ArbitrumL1BridgeAdapter *ArbitrumL1BridgeAdapterSession) SendERC20(localToken common.Address, arg1 common.Address, recipient common.Address, amount *big.Int, bridgeSpecificPayload []byte) (*types.Transaction, error) { + return _ArbitrumL1BridgeAdapter.Contract.SendERC20(&_ArbitrumL1BridgeAdapter.TransactOpts, localToken, arg1, recipient, amount, bridgeSpecificPayload) +} + +func (_ArbitrumL1BridgeAdapter *ArbitrumL1BridgeAdapterTransactorSession) SendERC20(localToken common.Address, arg1 common.Address, recipient common.Address, amount *big.Int, bridgeSpecificPayload []byte) (*types.Transaction, error) { + return _ArbitrumL1BridgeAdapter.Contract.SendERC20(&_ArbitrumL1BridgeAdapter.TransactOpts, localToken, arg1, recipient, amount, bridgeSpecificPayload) +} + +func (_ArbitrumL1BridgeAdapter *ArbitrumL1BridgeAdapter) Address() common.Address { + return _ArbitrumL1BridgeAdapter.address +} + +type ArbitrumL1BridgeAdapterInterface interface { + ExposeArbitrumFinalizationPayload(opts *bind.CallOpts, payload ArbitrumL1BridgeAdapterArbitrumFinalizationPayload) error + + ExposeSendERC20Params(opts *bind.CallOpts, params ArbitrumL1BridgeAdapterSendERC20Params) error + + GetBridgeFeeInNative(opts *bind.CallOpts) (*big.Int, error) + + GetL2Token(opts *bind.CallOpts, l1Token common.Address) (common.Address, error) + + FinalizeWithdrawERC20(opts *bind.TransactOpts, arg0 common.Address, arg1 common.Address, arbitrumFinalizationPayload []byte) (*types.Transaction, error) + + SendERC20(opts *bind.TransactOpts, localToken common.Address, arg1 common.Address, recipient common.Address, amount *big.Int, bridgeSpecificPayload []byte) (*types.Transaction, error) + + Address() common.Address +} diff --git a/core/gethwrappers/liquiditymanager/generated/arbitrum_l1_gateway_router/arbitrum_l1_gateway_router.go b/core/gethwrappers/liquiditymanager/generated/arbitrum_l1_gateway_router/arbitrum_l1_gateway_router.go new file mode 100644 index 00000000000..e2e76e5f5bb --- /dev/null +++ b/core/gethwrappers/liquiditymanager/generated/arbitrum_l1_gateway_router/arbitrum_l1_gateway_router.go @@ -0,0 +1,349 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package arbitrum_l1_gateway_router + +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" +) + +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +var ArbitrumL1GatewayRouterMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"l1ERC20\",\"type\":\"address\"}],\"name\":\"calculateL2TokenAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_token\",\"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\":\"finalizeInboundTransfer\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_token\",\"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\":\"getOutboundCalldata\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"inbox\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_token\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_maxGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_gasPriceBid\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"outboundTransfer\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_token\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_refundTo\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_maxGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_gasPriceBid\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"outboundTransferCustomRefund\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_gateway\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_maxGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_gasPriceBid\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_maxSubmissionCost\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"_creditBackAddress\",\"type\":\"address\"}],\"name\":\"setGateway\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_gateway\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_maxGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_gasPriceBid\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_maxSubmissionCost\",\"type\":\"uint256\"}],\"name\":\"setGateway\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", +} + +var ArbitrumL1GatewayRouterABI = ArbitrumL1GatewayRouterMetaData.ABI + +type ArbitrumL1GatewayRouter struct { + address common.Address + abi abi.ABI + ArbitrumL1GatewayRouterCaller + ArbitrumL1GatewayRouterTransactor + ArbitrumL1GatewayRouterFilterer +} + +type ArbitrumL1GatewayRouterCaller struct { + contract *bind.BoundContract +} + +type ArbitrumL1GatewayRouterTransactor struct { + contract *bind.BoundContract +} + +type ArbitrumL1GatewayRouterFilterer struct { + contract *bind.BoundContract +} + +type ArbitrumL1GatewayRouterSession struct { + Contract *ArbitrumL1GatewayRouter + CallOpts bind.CallOpts + TransactOpts bind.TransactOpts +} + +type ArbitrumL1GatewayRouterCallerSession struct { + Contract *ArbitrumL1GatewayRouterCaller + CallOpts bind.CallOpts +} + +type ArbitrumL1GatewayRouterTransactorSession struct { + Contract *ArbitrumL1GatewayRouterTransactor + TransactOpts bind.TransactOpts +} + +type ArbitrumL1GatewayRouterRaw struct { + Contract *ArbitrumL1GatewayRouter +} + +type ArbitrumL1GatewayRouterCallerRaw struct { + Contract *ArbitrumL1GatewayRouterCaller +} + +type ArbitrumL1GatewayRouterTransactorRaw struct { + Contract *ArbitrumL1GatewayRouterTransactor +} + +func NewArbitrumL1GatewayRouter(address common.Address, backend bind.ContractBackend) (*ArbitrumL1GatewayRouter, error) { + abi, err := abi.JSON(strings.NewReader(ArbitrumL1GatewayRouterABI)) + if err != nil { + return nil, err + } + contract, err := bindArbitrumL1GatewayRouter(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &ArbitrumL1GatewayRouter{address: address, abi: abi, ArbitrumL1GatewayRouterCaller: ArbitrumL1GatewayRouterCaller{contract: contract}, ArbitrumL1GatewayRouterTransactor: ArbitrumL1GatewayRouterTransactor{contract: contract}, ArbitrumL1GatewayRouterFilterer: ArbitrumL1GatewayRouterFilterer{contract: contract}}, nil +} + +func NewArbitrumL1GatewayRouterCaller(address common.Address, caller bind.ContractCaller) (*ArbitrumL1GatewayRouterCaller, error) { + contract, err := bindArbitrumL1GatewayRouter(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &ArbitrumL1GatewayRouterCaller{contract: contract}, nil +} + +func NewArbitrumL1GatewayRouterTransactor(address common.Address, transactor bind.ContractTransactor) (*ArbitrumL1GatewayRouterTransactor, error) { + contract, err := bindArbitrumL1GatewayRouter(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &ArbitrumL1GatewayRouterTransactor{contract: contract}, nil +} + +func NewArbitrumL1GatewayRouterFilterer(address common.Address, filterer bind.ContractFilterer) (*ArbitrumL1GatewayRouterFilterer, error) { + contract, err := bindArbitrumL1GatewayRouter(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &ArbitrumL1GatewayRouterFilterer{contract: contract}, nil +} + +func bindArbitrumL1GatewayRouter(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := ArbitrumL1GatewayRouterMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +func (_ArbitrumL1GatewayRouter *ArbitrumL1GatewayRouterRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _ArbitrumL1GatewayRouter.Contract.ArbitrumL1GatewayRouterCaller.contract.Call(opts, result, method, params...) +} + +func (_ArbitrumL1GatewayRouter *ArbitrumL1GatewayRouterRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _ArbitrumL1GatewayRouter.Contract.ArbitrumL1GatewayRouterTransactor.contract.Transfer(opts) +} + +func (_ArbitrumL1GatewayRouter *ArbitrumL1GatewayRouterRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _ArbitrumL1GatewayRouter.Contract.ArbitrumL1GatewayRouterTransactor.contract.Transact(opts, method, params...) +} + +func (_ArbitrumL1GatewayRouter *ArbitrumL1GatewayRouterCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _ArbitrumL1GatewayRouter.Contract.contract.Call(opts, result, method, params...) +} + +func (_ArbitrumL1GatewayRouter *ArbitrumL1GatewayRouterTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _ArbitrumL1GatewayRouter.Contract.contract.Transfer(opts) +} + +func (_ArbitrumL1GatewayRouter *ArbitrumL1GatewayRouterTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _ArbitrumL1GatewayRouter.Contract.contract.Transact(opts, method, params...) +} + +func (_ArbitrumL1GatewayRouter *ArbitrumL1GatewayRouterCaller) CalculateL2TokenAddress(opts *bind.CallOpts, l1ERC20 common.Address) (common.Address, error) { + var out []interface{} + err := _ArbitrumL1GatewayRouter.contract.Call(opts, &out, "calculateL2TokenAddress", l1ERC20) + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_ArbitrumL1GatewayRouter *ArbitrumL1GatewayRouterSession) CalculateL2TokenAddress(l1ERC20 common.Address) (common.Address, error) { + return _ArbitrumL1GatewayRouter.Contract.CalculateL2TokenAddress(&_ArbitrumL1GatewayRouter.CallOpts, l1ERC20) +} + +func (_ArbitrumL1GatewayRouter *ArbitrumL1GatewayRouterCallerSession) CalculateL2TokenAddress(l1ERC20 common.Address) (common.Address, error) { + return _ArbitrumL1GatewayRouter.Contract.CalculateL2TokenAddress(&_ArbitrumL1GatewayRouter.CallOpts, l1ERC20) +} + +func (_ArbitrumL1GatewayRouter *ArbitrumL1GatewayRouterCaller) GetOutboundCalldata(opts *bind.CallOpts, _token common.Address, _from common.Address, _to common.Address, _amount *big.Int, _data []byte) ([]byte, error) { + var out []interface{} + err := _ArbitrumL1GatewayRouter.contract.Call(opts, &out, "getOutboundCalldata", _token, _from, _to, _amount, _data) + + if err != nil { + return *new([]byte), err + } + + out0 := *abi.ConvertType(out[0], new([]byte)).(*[]byte) + + return out0, err + +} + +func (_ArbitrumL1GatewayRouter *ArbitrumL1GatewayRouterSession) GetOutboundCalldata(_token common.Address, _from common.Address, _to common.Address, _amount *big.Int, _data []byte) ([]byte, error) { + return _ArbitrumL1GatewayRouter.Contract.GetOutboundCalldata(&_ArbitrumL1GatewayRouter.CallOpts, _token, _from, _to, _amount, _data) +} + +func (_ArbitrumL1GatewayRouter *ArbitrumL1GatewayRouterCallerSession) GetOutboundCalldata(_token common.Address, _from common.Address, _to common.Address, _amount *big.Int, _data []byte) ([]byte, error) { + return _ArbitrumL1GatewayRouter.Contract.GetOutboundCalldata(&_ArbitrumL1GatewayRouter.CallOpts, _token, _from, _to, _amount, _data) +} + +func (_ArbitrumL1GatewayRouter *ArbitrumL1GatewayRouterCaller) Inbox(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _ArbitrumL1GatewayRouter.contract.Call(opts, &out, "inbox") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_ArbitrumL1GatewayRouter *ArbitrumL1GatewayRouterSession) Inbox() (common.Address, error) { + return _ArbitrumL1GatewayRouter.Contract.Inbox(&_ArbitrumL1GatewayRouter.CallOpts) +} + +func (_ArbitrumL1GatewayRouter *ArbitrumL1GatewayRouterCallerSession) Inbox() (common.Address, error) { + return _ArbitrumL1GatewayRouter.Contract.Inbox(&_ArbitrumL1GatewayRouter.CallOpts) +} + +func (_ArbitrumL1GatewayRouter *ArbitrumL1GatewayRouterCaller) Owner(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _ArbitrumL1GatewayRouter.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 + +} + +func (_ArbitrumL1GatewayRouter *ArbitrumL1GatewayRouterSession) Owner() (common.Address, error) { + return _ArbitrumL1GatewayRouter.Contract.Owner(&_ArbitrumL1GatewayRouter.CallOpts) +} + +func (_ArbitrumL1GatewayRouter *ArbitrumL1GatewayRouterCallerSession) Owner() (common.Address, error) { + return _ArbitrumL1GatewayRouter.Contract.Owner(&_ArbitrumL1GatewayRouter.CallOpts) +} + +func (_ArbitrumL1GatewayRouter *ArbitrumL1GatewayRouterCaller) SupportsInterface(opts *bind.CallOpts, interfaceId [4]byte) (bool, error) { + var out []interface{} + err := _ArbitrumL1GatewayRouter.contract.Call(opts, &out, "supportsInterface", interfaceId) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_ArbitrumL1GatewayRouter *ArbitrumL1GatewayRouterSession) SupportsInterface(interfaceId [4]byte) (bool, error) { + return _ArbitrumL1GatewayRouter.Contract.SupportsInterface(&_ArbitrumL1GatewayRouter.CallOpts, interfaceId) +} + +func (_ArbitrumL1GatewayRouter *ArbitrumL1GatewayRouterCallerSession) SupportsInterface(interfaceId [4]byte) (bool, error) { + return _ArbitrumL1GatewayRouter.Contract.SupportsInterface(&_ArbitrumL1GatewayRouter.CallOpts, interfaceId) +} + +func (_ArbitrumL1GatewayRouter *ArbitrumL1GatewayRouterTransactor) FinalizeInboundTransfer(opts *bind.TransactOpts, _token common.Address, _from common.Address, _to common.Address, _amount *big.Int, _data []byte) (*types.Transaction, error) { + return _ArbitrumL1GatewayRouter.contract.Transact(opts, "finalizeInboundTransfer", _token, _from, _to, _amount, _data) +} + +func (_ArbitrumL1GatewayRouter *ArbitrumL1GatewayRouterSession) FinalizeInboundTransfer(_token common.Address, _from common.Address, _to common.Address, _amount *big.Int, _data []byte) (*types.Transaction, error) { + return _ArbitrumL1GatewayRouter.Contract.FinalizeInboundTransfer(&_ArbitrumL1GatewayRouter.TransactOpts, _token, _from, _to, _amount, _data) +} + +func (_ArbitrumL1GatewayRouter *ArbitrumL1GatewayRouterTransactorSession) FinalizeInboundTransfer(_token common.Address, _from common.Address, _to common.Address, _amount *big.Int, _data []byte) (*types.Transaction, error) { + return _ArbitrumL1GatewayRouter.Contract.FinalizeInboundTransfer(&_ArbitrumL1GatewayRouter.TransactOpts, _token, _from, _to, _amount, _data) +} + +func (_ArbitrumL1GatewayRouter *ArbitrumL1GatewayRouterTransactor) OutboundTransfer(opts *bind.TransactOpts, _token common.Address, _to common.Address, _amount *big.Int, _maxGas *big.Int, _gasPriceBid *big.Int, _data []byte) (*types.Transaction, error) { + return _ArbitrumL1GatewayRouter.contract.Transact(opts, "outboundTransfer", _token, _to, _amount, _maxGas, _gasPriceBid, _data) +} + +func (_ArbitrumL1GatewayRouter *ArbitrumL1GatewayRouterSession) OutboundTransfer(_token common.Address, _to common.Address, _amount *big.Int, _maxGas *big.Int, _gasPriceBid *big.Int, _data []byte) (*types.Transaction, error) { + return _ArbitrumL1GatewayRouter.Contract.OutboundTransfer(&_ArbitrumL1GatewayRouter.TransactOpts, _token, _to, _amount, _maxGas, _gasPriceBid, _data) +} + +func (_ArbitrumL1GatewayRouter *ArbitrumL1GatewayRouterTransactorSession) OutboundTransfer(_token common.Address, _to common.Address, _amount *big.Int, _maxGas *big.Int, _gasPriceBid *big.Int, _data []byte) (*types.Transaction, error) { + return _ArbitrumL1GatewayRouter.Contract.OutboundTransfer(&_ArbitrumL1GatewayRouter.TransactOpts, _token, _to, _amount, _maxGas, _gasPriceBid, _data) +} + +func (_ArbitrumL1GatewayRouter *ArbitrumL1GatewayRouterTransactor) OutboundTransferCustomRefund(opts *bind.TransactOpts, _token common.Address, _refundTo common.Address, _to common.Address, _amount *big.Int, _maxGas *big.Int, _gasPriceBid *big.Int, _data []byte) (*types.Transaction, error) { + return _ArbitrumL1GatewayRouter.contract.Transact(opts, "outboundTransferCustomRefund", _token, _refundTo, _to, _amount, _maxGas, _gasPriceBid, _data) +} + +func (_ArbitrumL1GatewayRouter *ArbitrumL1GatewayRouterSession) OutboundTransferCustomRefund(_token common.Address, _refundTo common.Address, _to common.Address, _amount *big.Int, _maxGas *big.Int, _gasPriceBid *big.Int, _data []byte) (*types.Transaction, error) { + return _ArbitrumL1GatewayRouter.Contract.OutboundTransferCustomRefund(&_ArbitrumL1GatewayRouter.TransactOpts, _token, _refundTo, _to, _amount, _maxGas, _gasPriceBid, _data) +} + +func (_ArbitrumL1GatewayRouter *ArbitrumL1GatewayRouterTransactorSession) OutboundTransferCustomRefund(_token common.Address, _refundTo common.Address, _to common.Address, _amount *big.Int, _maxGas *big.Int, _gasPriceBid *big.Int, _data []byte) (*types.Transaction, error) { + return _ArbitrumL1GatewayRouter.Contract.OutboundTransferCustomRefund(&_ArbitrumL1GatewayRouter.TransactOpts, _token, _refundTo, _to, _amount, _maxGas, _gasPriceBid, _data) +} + +func (_ArbitrumL1GatewayRouter *ArbitrumL1GatewayRouterTransactor) SetGateway(opts *bind.TransactOpts, _gateway common.Address, _maxGas *big.Int, _gasPriceBid *big.Int, _maxSubmissionCost *big.Int, _creditBackAddress common.Address) (*types.Transaction, error) { + return _ArbitrumL1GatewayRouter.contract.Transact(opts, "setGateway", _gateway, _maxGas, _gasPriceBid, _maxSubmissionCost, _creditBackAddress) +} + +func (_ArbitrumL1GatewayRouter *ArbitrumL1GatewayRouterSession) SetGateway(_gateway common.Address, _maxGas *big.Int, _gasPriceBid *big.Int, _maxSubmissionCost *big.Int, _creditBackAddress common.Address) (*types.Transaction, error) { + return _ArbitrumL1GatewayRouter.Contract.SetGateway(&_ArbitrumL1GatewayRouter.TransactOpts, _gateway, _maxGas, _gasPriceBid, _maxSubmissionCost, _creditBackAddress) +} + +func (_ArbitrumL1GatewayRouter *ArbitrumL1GatewayRouterTransactorSession) SetGateway(_gateway common.Address, _maxGas *big.Int, _gasPriceBid *big.Int, _maxSubmissionCost *big.Int, _creditBackAddress common.Address) (*types.Transaction, error) { + return _ArbitrumL1GatewayRouter.Contract.SetGateway(&_ArbitrumL1GatewayRouter.TransactOpts, _gateway, _maxGas, _gasPriceBid, _maxSubmissionCost, _creditBackAddress) +} + +func (_ArbitrumL1GatewayRouter *ArbitrumL1GatewayRouterTransactor) SetGateway0(opts *bind.TransactOpts, _gateway common.Address, _maxGas *big.Int, _gasPriceBid *big.Int, _maxSubmissionCost *big.Int) (*types.Transaction, error) { + return _ArbitrumL1GatewayRouter.contract.Transact(opts, "setGateway0", _gateway, _maxGas, _gasPriceBid, _maxSubmissionCost) +} + +func (_ArbitrumL1GatewayRouter *ArbitrumL1GatewayRouterSession) SetGateway0(_gateway common.Address, _maxGas *big.Int, _gasPriceBid *big.Int, _maxSubmissionCost *big.Int) (*types.Transaction, error) { + return _ArbitrumL1GatewayRouter.Contract.SetGateway0(&_ArbitrumL1GatewayRouter.TransactOpts, _gateway, _maxGas, _gasPriceBid, _maxSubmissionCost) +} + +func (_ArbitrumL1GatewayRouter *ArbitrumL1GatewayRouterTransactorSession) SetGateway0(_gateway common.Address, _maxGas *big.Int, _gasPriceBid *big.Int, _maxSubmissionCost *big.Int) (*types.Transaction, error) { + return _ArbitrumL1GatewayRouter.Contract.SetGateway0(&_ArbitrumL1GatewayRouter.TransactOpts, _gateway, _maxGas, _gasPriceBid, _maxSubmissionCost) +} + +func (_ArbitrumL1GatewayRouter *ArbitrumL1GatewayRouter) Address() common.Address { + return _ArbitrumL1GatewayRouter.address +} + +type ArbitrumL1GatewayRouterInterface interface { + CalculateL2TokenAddress(opts *bind.CallOpts, l1ERC20 common.Address) (common.Address, error) + + GetOutboundCalldata(opts *bind.CallOpts, _token common.Address, _from common.Address, _to common.Address, _amount *big.Int, _data []byte) ([]byte, error) + + Inbox(opts *bind.CallOpts) (common.Address, error) + + Owner(opts *bind.CallOpts) (common.Address, error) + + SupportsInterface(opts *bind.CallOpts, interfaceId [4]byte) (bool, error) + + FinalizeInboundTransfer(opts *bind.TransactOpts, _token common.Address, _from common.Address, _to common.Address, _amount *big.Int, _data []byte) (*types.Transaction, error) + + OutboundTransfer(opts *bind.TransactOpts, _token common.Address, _to common.Address, _amount *big.Int, _maxGas *big.Int, _gasPriceBid *big.Int, _data []byte) (*types.Transaction, error) + + OutboundTransferCustomRefund(opts *bind.TransactOpts, _token common.Address, _refundTo common.Address, _to common.Address, _amount *big.Int, _maxGas *big.Int, _gasPriceBid *big.Int, _data []byte) (*types.Transaction, error) + + SetGateway(opts *bind.TransactOpts, _gateway common.Address, _maxGas *big.Int, _gasPriceBid *big.Int, _maxSubmissionCost *big.Int, _creditBackAddress common.Address) (*types.Transaction, error) + + SetGateway0(opts *bind.TransactOpts, _gateway common.Address, _maxGas *big.Int, _gasPriceBid *big.Int, _maxSubmissionCost *big.Int) (*types.Transaction, error) + + Address() common.Address +} diff --git a/core/gethwrappers/liquiditymanager/generated/arbitrum_l2_bridge_adapter/arbitrum_l2_bridge_adapter.go b/core/gethwrappers/liquiditymanager/generated/arbitrum_l2_bridge_adapter/arbitrum_l2_bridge_adapter.go new file mode 100644 index 00000000000..245daddaa4c --- /dev/null +++ b/core/gethwrappers/liquiditymanager/generated/arbitrum_l2_bridge_adapter/arbitrum_l2_bridge_adapter.go @@ -0,0 +1,254 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package arbitrum_l2_bridge_adapter + +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" +) + +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +var ArbitrumL2BridgeAdapterMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"internalType\":\"contractIL2GatewayRouter\",\"name\":\"l2GatewayRouter\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"BridgeAddressCannotBeZero\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"wanted\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"got\",\"type\":\"uint256\"}],\"name\":\"InsufficientEthValue\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"MsgShouldNotContainValue\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"msgValue\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"MsgValueDoesNotMatchAmount\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"}],\"name\":\"depositNativeToL1\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"finalizeWithdrawERC20\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getBridgeFeeInNative\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"localToken\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"remoteToken\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"sendERC20\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"function\"}]", + Bin: "0x60a060405234801561001057600080fd5b50604051610a24380380610a2483398101604081905261002f91610067565b6001600160a01b03811661005657604051635e9c404d60e11b815260040160405180910390fd5b6001600160a01b0316608052610097565b60006020828403121561007957600080fd5b81516001600160a01b038116811461009057600080fd5b9392505050565b6080516109726100b2600039600061021a01526109726000f3fe60806040526004361061003f5760003560e01c80630ff98e31146100445780632e4b1fc91461005957806338314bb21461007a578063a71d98b7146100aa575b600080fd5b61005761005236600461060a565b6100ca565b005b34801561006557600080fd5b50604051600081526020015b60405180910390f35b34801561008657600080fd5b5061009a610095366004610675565b610161565b6040519015158152602001610071565b6100bd6100b83660046106d6565b61016c565b60405161007191906107c3565b6040517f25e1606300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff821660048201526064906325e1606390349060240160206040518083038185885af1158015610138573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061015d91906107d6565b5050565b60015b949350505050565b606034156101ad576040517f2543d86e0000000000000000000000000000000000000000000000000000000081523460048201526024015b60405180910390fd5b6101cf73ffffffffffffffffffffffffffffffffffffffff88163330876102c4565b60408051602081018252600080825291517f7b3a3c8b00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001691637b3a3c8b91610253918b918b918b916004016107ef565b6000604051808303816000875af1158015610272573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682016040526102b89190810190610867565b98975050505050505050565b6040805173ffffffffffffffffffffffffffffffffffffffff85811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f23b872dd0000000000000000000000000000000000000000000000000000000017905261035990859061035f565b50505050565b60006103c1826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166104709092919063ffffffff16565b80519091501561046b57808060200190518101906103df9190610927565b61046b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f7420737563636565640000000000000000000000000000000000000000000060648201526084016101a4565b505050565b60606101648484600085856000808673ffffffffffffffffffffffffffffffffffffffff1685876040516104a49190610949565b60006040518083038185875af1925050503d80600081146104e1576040519150601f19603f3d011682016040523d82523d6000602084013e6104e6565b606091505b50915091506104f787838387610502565b979650505050505050565b606083156105985782516000036105915773ffffffffffffffffffffffffffffffffffffffff85163b610591576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016101a4565b5081610164565b61016483838151156105ad5781518083602001fd5b806040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101a491906107c3565b803573ffffffffffffffffffffffffffffffffffffffff8116811461060557600080fd5b919050565b60006020828403121561061c57600080fd5b610625826105e1565b9392505050565b60008083601f84011261063e57600080fd5b50813567ffffffffffffffff81111561065657600080fd5b60208301915083602082850101111561066e57600080fd5b9250929050565b6000806000806060858703121561068b57600080fd5b610694856105e1565b93506106a2602086016105e1565b9250604085013567ffffffffffffffff8111156106be57600080fd5b6106ca8782880161062c565b95989497509550505050565b60008060008060008060a087890312156106ef57600080fd5b6106f8876105e1565b9550610706602088016105e1565b9450610714604088016105e1565b935060608701359250608087013567ffffffffffffffff81111561073757600080fd5b61074389828a0161062c565b979a9699509497509295939492505050565b60005b83811015610770578181015183820152602001610758565b50506000910152565b60008151808452610791816020860160208601610755565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b6020815260006106256020830184610779565b6000602082840312156107e857600080fd5b5051919050565b600073ffffffffffffffffffffffffffffffffffffffff80871683528086166020840152508360408301526080606083015261082e6080830184610779565b9695505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60006020828403121561087957600080fd5b815167ffffffffffffffff8082111561089157600080fd5b818401915084601f8301126108a557600080fd5b8151818111156108b7576108b7610838565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f011681019083821181831017156108fd576108fd610838565b8160405282815287602084870101111561091657600080fd5b6104f7836020830160208801610755565b60006020828403121561093957600080fd5b8151801515811461062557600080fd5b6000825161095b818460208701610755565b919091019291505056fea164736f6c6343000818000a", +} + +var ArbitrumL2BridgeAdapterABI = ArbitrumL2BridgeAdapterMetaData.ABI + +var ArbitrumL2BridgeAdapterBin = ArbitrumL2BridgeAdapterMetaData.Bin + +func DeployArbitrumL2BridgeAdapter(auth *bind.TransactOpts, backend bind.ContractBackend, l2GatewayRouter common.Address) (common.Address, *types.Transaction, *ArbitrumL2BridgeAdapter, error) { + parsed, err := ArbitrumL2BridgeAdapterMetaData.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(ArbitrumL2BridgeAdapterBin), backend, l2GatewayRouter) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &ArbitrumL2BridgeAdapter{address: address, abi: *parsed, ArbitrumL2BridgeAdapterCaller: ArbitrumL2BridgeAdapterCaller{contract: contract}, ArbitrumL2BridgeAdapterTransactor: ArbitrumL2BridgeAdapterTransactor{contract: contract}, ArbitrumL2BridgeAdapterFilterer: ArbitrumL2BridgeAdapterFilterer{contract: contract}}, nil +} + +type ArbitrumL2BridgeAdapter struct { + address common.Address + abi abi.ABI + ArbitrumL2BridgeAdapterCaller + ArbitrumL2BridgeAdapterTransactor + ArbitrumL2BridgeAdapterFilterer +} + +type ArbitrumL2BridgeAdapterCaller struct { + contract *bind.BoundContract +} + +type ArbitrumL2BridgeAdapterTransactor struct { + contract *bind.BoundContract +} + +type ArbitrumL2BridgeAdapterFilterer struct { + contract *bind.BoundContract +} + +type ArbitrumL2BridgeAdapterSession struct { + Contract *ArbitrumL2BridgeAdapter + CallOpts bind.CallOpts + TransactOpts bind.TransactOpts +} + +type ArbitrumL2BridgeAdapterCallerSession struct { + Contract *ArbitrumL2BridgeAdapterCaller + CallOpts bind.CallOpts +} + +type ArbitrumL2BridgeAdapterTransactorSession struct { + Contract *ArbitrumL2BridgeAdapterTransactor + TransactOpts bind.TransactOpts +} + +type ArbitrumL2BridgeAdapterRaw struct { + Contract *ArbitrumL2BridgeAdapter +} + +type ArbitrumL2BridgeAdapterCallerRaw struct { + Contract *ArbitrumL2BridgeAdapterCaller +} + +type ArbitrumL2BridgeAdapterTransactorRaw struct { + Contract *ArbitrumL2BridgeAdapterTransactor +} + +func NewArbitrumL2BridgeAdapter(address common.Address, backend bind.ContractBackend) (*ArbitrumL2BridgeAdapter, error) { + abi, err := abi.JSON(strings.NewReader(ArbitrumL2BridgeAdapterABI)) + if err != nil { + return nil, err + } + contract, err := bindArbitrumL2BridgeAdapter(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &ArbitrumL2BridgeAdapter{address: address, abi: abi, ArbitrumL2BridgeAdapterCaller: ArbitrumL2BridgeAdapterCaller{contract: contract}, ArbitrumL2BridgeAdapterTransactor: ArbitrumL2BridgeAdapterTransactor{contract: contract}, ArbitrumL2BridgeAdapterFilterer: ArbitrumL2BridgeAdapterFilterer{contract: contract}}, nil +} + +func NewArbitrumL2BridgeAdapterCaller(address common.Address, caller bind.ContractCaller) (*ArbitrumL2BridgeAdapterCaller, error) { + contract, err := bindArbitrumL2BridgeAdapter(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &ArbitrumL2BridgeAdapterCaller{contract: contract}, nil +} + +func NewArbitrumL2BridgeAdapterTransactor(address common.Address, transactor bind.ContractTransactor) (*ArbitrumL2BridgeAdapterTransactor, error) { + contract, err := bindArbitrumL2BridgeAdapter(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &ArbitrumL2BridgeAdapterTransactor{contract: contract}, nil +} + +func NewArbitrumL2BridgeAdapterFilterer(address common.Address, filterer bind.ContractFilterer) (*ArbitrumL2BridgeAdapterFilterer, error) { + contract, err := bindArbitrumL2BridgeAdapter(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &ArbitrumL2BridgeAdapterFilterer{contract: contract}, nil +} + +func bindArbitrumL2BridgeAdapter(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := ArbitrumL2BridgeAdapterMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +func (_ArbitrumL2BridgeAdapter *ArbitrumL2BridgeAdapterRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _ArbitrumL2BridgeAdapter.Contract.ArbitrumL2BridgeAdapterCaller.contract.Call(opts, result, method, params...) +} + +func (_ArbitrumL2BridgeAdapter *ArbitrumL2BridgeAdapterRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _ArbitrumL2BridgeAdapter.Contract.ArbitrumL2BridgeAdapterTransactor.contract.Transfer(opts) +} + +func (_ArbitrumL2BridgeAdapter *ArbitrumL2BridgeAdapterRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _ArbitrumL2BridgeAdapter.Contract.ArbitrumL2BridgeAdapterTransactor.contract.Transact(opts, method, params...) +} + +func (_ArbitrumL2BridgeAdapter *ArbitrumL2BridgeAdapterCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _ArbitrumL2BridgeAdapter.Contract.contract.Call(opts, result, method, params...) +} + +func (_ArbitrumL2BridgeAdapter *ArbitrumL2BridgeAdapterTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _ArbitrumL2BridgeAdapter.Contract.contract.Transfer(opts) +} + +func (_ArbitrumL2BridgeAdapter *ArbitrumL2BridgeAdapterTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _ArbitrumL2BridgeAdapter.Contract.contract.Transact(opts, method, params...) +} + +func (_ArbitrumL2BridgeAdapter *ArbitrumL2BridgeAdapterCaller) FinalizeWithdrawERC20(opts *bind.CallOpts, arg0 common.Address, arg1 common.Address, arg2 []byte) (bool, error) { + var out []interface{} + err := _ArbitrumL2BridgeAdapter.contract.Call(opts, &out, "finalizeWithdrawERC20", arg0, arg1, arg2) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_ArbitrumL2BridgeAdapter *ArbitrumL2BridgeAdapterSession) FinalizeWithdrawERC20(arg0 common.Address, arg1 common.Address, arg2 []byte) (bool, error) { + return _ArbitrumL2BridgeAdapter.Contract.FinalizeWithdrawERC20(&_ArbitrumL2BridgeAdapter.CallOpts, arg0, arg1, arg2) +} + +func (_ArbitrumL2BridgeAdapter *ArbitrumL2BridgeAdapterCallerSession) FinalizeWithdrawERC20(arg0 common.Address, arg1 common.Address, arg2 []byte) (bool, error) { + return _ArbitrumL2BridgeAdapter.Contract.FinalizeWithdrawERC20(&_ArbitrumL2BridgeAdapter.CallOpts, arg0, arg1, arg2) +} + +func (_ArbitrumL2BridgeAdapter *ArbitrumL2BridgeAdapterCaller) GetBridgeFeeInNative(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _ArbitrumL2BridgeAdapter.contract.Call(opts, &out, "getBridgeFeeInNative") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_ArbitrumL2BridgeAdapter *ArbitrumL2BridgeAdapterSession) GetBridgeFeeInNative() (*big.Int, error) { + return _ArbitrumL2BridgeAdapter.Contract.GetBridgeFeeInNative(&_ArbitrumL2BridgeAdapter.CallOpts) +} + +func (_ArbitrumL2BridgeAdapter *ArbitrumL2BridgeAdapterCallerSession) GetBridgeFeeInNative() (*big.Int, error) { + return _ArbitrumL2BridgeAdapter.Contract.GetBridgeFeeInNative(&_ArbitrumL2BridgeAdapter.CallOpts) +} + +func (_ArbitrumL2BridgeAdapter *ArbitrumL2BridgeAdapterTransactor) DepositNativeToL1(opts *bind.TransactOpts, recipient common.Address) (*types.Transaction, error) { + return _ArbitrumL2BridgeAdapter.contract.Transact(opts, "depositNativeToL1", recipient) +} + +func (_ArbitrumL2BridgeAdapter *ArbitrumL2BridgeAdapterSession) DepositNativeToL1(recipient common.Address) (*types.Transaction, error) { + return _ArbitrumL2BridgeAdapter.Contract.DepositNativeToL1(&_ArbitrumL2BridgeAdapter.TransactOpts, recipient) +} + +func (_ArbitrumL2BridgeAdapter *ArbitrumL2BridgeAdapterTransactorSession) DepositNativeToL1(recipient common.Address) (*types.Transaction, error) { + return _ArbitrumL2BridgeAdapter.Contract.DepositNativeToL1(&_ArbitrumL2BridgeAdapter.TransactOpts, recipient) +} + +func (_ArbitrumL2BridgeAdapter *ArbitrumL2BridgeAdapterTransactor) SendERC20(opts *bind.TransactOpts, localToken common.Address, remoteToken common.Address, recipient common.Address, amount *big.Int, arg4 []byte) (*types.Transaction, error) { + return _ArbitrumL2BridgeAdapter.contract.Transact(opts, "sendERC20", localToken, remoteToken, recipient, amount, arg4) +} + +func (_ArbitrumL2BridgeAdapter *ArbitrumL2BridgeAdapterSession) SendERC20(localToken common.Address, remoteToken common.Address, recipient common.Address, amount *big.Int, arg4 []byte) (*types.Transaction, error) { + return _ArbitrumL2BridgeAdapter.Contract.SendERC20(&_ArbitrumL2BridgeAdapter.TransactOpts, localToken, remoteToken, recipient, amount, arg4) +} + +func (_ArbitrumL2BridgeAdapter *ArbitrumL2BridgeAdapterTransactorSession) SendERC20(localToken common.Address, remoteToken common.Address, recipient common.Address, amount *big.Int, arg4 []byte) (*types.Transaction, error) { + return _ArbitrumL2BridgeAdapter.Contract.SendERC20(&_ArbitrumL2BridgeAdapter.TransactOpts, localToken, remoteToken, recipient, amount, arg4) +} + +func (_ArbitrumL2BridgeAdapter *ArbitrumL2BridgeAdapter) Address() common.Address { + return _ArbitrumL2BridgeAdapter.address +} + +type ArbitrumL2BridgeAdapterInterface interface { + FinalizeWithdrawERC20(opts *bind.CallOpts, arg0 common.Address, arg1 common.Address, arg2 []byte) (bool, error) + + GetBridgeFeeInNative(opts *bind.CallOpts) (*big.Int, error) + + DepositNativeToL1(opts *bind.TransactOpts, recipient common.Address) (*types.Transaction, error) + + SendERC20(opts *bind.TransactOpts, localToken common.Address, remoteToken common.Address, recipient common.Address, amount *big.Int, arg4 []byte) (*types.Transaction, error) + + Address() common.Address +} diff --git a/core/gethwrappers/liquiditymanager/generated/arbitrum_rollup_core/arbitrum_rollup_core.go b/core/gethwrappers/liquiditymanager/generated/arbitrum_rollup_core/arbitrum_rollup_core.go new file mode 100644 index 00000000000..f90cc869d5d --- /dev/null +++ b/core/gethwrappers/liquiditymanager/generated/arbitrum_rollup_core/arbitrum_rollup_core.go @@ -0,0 +1,2022 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package arbitrum_rollup_core + +import ( + "errors" + "fmt" + "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" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" +) + +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +type Assertion struct { + BeforeState ExecutionState + AfterState ExecutionState + NumBlocks uint64 +} + +type ExecutionState struct { + GlobalState GlobalState + MachineStatus uint8 +} + +type GlobalState struct { + Bytes32Vals [2][32]byte + U64Vals [2]uint64 +} + +type IRollupCoreStaker struct { + AmountStaked *big.Int + Index uint64 + LatestStakedNode uint64 + CurrentChallenge uint64 + IsStaked bool +} + +type Node struct { + StateHash [32]byte + ChallengeHash [32]byte + ConfirmData [32]byte + PrevNum uint64 + DeadlineBlock uint64 + NoChildConfirmedBeforeBlock uint64 + StakerCount uint64 + ChildStakerCount uint64 + FirstChildBlock uint64 + LatestChildNumber uint64 + CreatedAtBlock uint64 + NodeHash [32]byte +} + +var ArbRollupCoreMetaData = &bind.MetaData{ + ABI: "[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"nodeNum\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"sendRoot\",\"type\":\"bytes32\"}],\"name\":\"NodeConfirmed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"nodeNum\",\"type\":\"uint64\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"parentNodeHash\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"nodeHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"executionHash\",\"type\":\"bytes32\"},{\"components\":[{\"components\":[{\"components\":[{\"internalType\":\"bytes32[2]\",\"name\":\"bytes32Vals\",\"type\":\"bytes32[2]\"},{\"internalType\":\"uint64[2]\",\"name\":\"u64Vals\",\"type\":\"uint64[2]\"}],\"internalType\":\"structGlobalState\",\"name\":\"globalState\",\"type\":\"tuple\"},{\"internalType\":\"enumMachineStatus\",\"name\":\"machineStatus\",\"type\":\"uint8\"}],\"internalType\":\"structExecutionState\",\"name\":\"beforeState\",\"type\":\"tuple\"},{\"components\":[{\"components\":[{\"internalType\":\"bytes32[2]\",\"name\":\"bytes32Vals\",\"type\":\"bytes32[2]\"},{\"internalType\":\"uint64[2]\",\"name\":\"u64Vals\",\"type\":\"uint64[2]\"}],\"internalType\":\"structGlobalState\",\"name\":\"globalState\",\"type\":\"tuple\"},{\"internalType\":\"enumMachineStatus\",\"name\":\"machineStatus\",\"type\":\"uint8\"}],\"internalType\":\"structExecutionState\",\"name\":\"afterState\",\"type\":\"tuple\"},{\"internalType\":\"uint64\",\"name\":\"numBlocks\",\"type\":\"uint64\"}],\"indexed\":false,\"internalType\":\"structAssertion\",\"name\":\"assertion\",\"type\":\"tuple\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"afterInboxBatchAcc\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"wasmModuleRoot\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"inboxMaxCount\",\"type\":\"uint256\"}],\"name\":\"NodeCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"nodeNum\",\"type\":\"uint64\"}],\"name\":\"NodeRejected\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"challengeIndex\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"asserter\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"challenger\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"challengedNode\",\"type\":\"uint64\"}],\"name\":\"RollupChallengeStarted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"machineHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"}],\"name\":\"RollupInitialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"initialBalance\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"finalBalance\",\"type\":\"uint256\"}],\"name\":\"UserStakeUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"initialBalance\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"finalBalance\",\"type\":\"uint256\"}],\"name\":\"UserWithdrawableFundsUpdated\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"staker\",\"type\":\"address\"}],\"name\":\"amountStaked\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"baseStake\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"bridge\",\"outputs\":[{\"internalType\":\"contractIBridge\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"chainId\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"challengeManager\",\"outputs\":[{\"internalType\":\"contractIChallengeManager\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"confirmPeriodBlocks\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"staker\",\"type\":\"address\"}],\"name\":\"currentChallenge\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"extraChallengeTimeBlocks\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"firstUnresolvedNode\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"nodeNum\",\"type\":\"uint64\"}],\"name\":\"getNode\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"stateHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"challengeHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"confirmData\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"prevNum\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"deadlineBlock\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"noChildConfirmedBeforeBlock\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"stakerCount\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"childStakerCount\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"firstChildBlock\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"latestChildNumber\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"createdAtBlock\",\"type\":\"uint64\"},{\"internalType\":\"bytes32\",\"name\":\"nodeHash\",\"type\":\"bytes32\"}],\"internalType\":\"structNode\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"nodeNum\",\"type\":\"uint64\"}],\"name\":\"getNodeCreationBlockForLogLookup\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"staker\",\"type\":\"address\"}],\"name\":\"getStaker\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"amountStaked\",\"type\":\"uint256\"},{\"internalType\":\"uint64\",\"name\":\"index\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"latestStakedNode\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"currentChallenge\",\"type\":\"uint64\"},{\"internalType\":\"bool\",\"name\":\"isStaked\",\"type\":\"bool\"}],\"internalType\":\"structIRollupCore.Staker\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"stakerNum\",\"type\":\"uint64\"}],\"name\":\"getStakerAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"staker\",\"type\":\"address\"}],\"name\":\"isStaked\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"isValidator\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"staker\",\"type\":\"address\"}],\"name\":\"isZombie\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"lastStakeBlock\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestConfirmed\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestNodeCreated\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"staker\",\"type\":\"address\"}],\"name\":\"latestStakedNode\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"loserStakeEscrow\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"minimumAssertionPeriod\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"nodeNum\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"staker\",\"type\":\"address\"}],\"name\":\"nodeHasStaker\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"outbox\",\"outputs\":[{\"internalType\":\"contractIOutbox\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"rollupEventInbox\",\"outputs\":[{\"internalType\":\"contractIRollupEventInbox\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"sequencerInbox\",\"outputs\":[{\"internalType\":\"contractISequencerInbox\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"stakeToken\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"stakerCount\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"validatorWhitelistDisabled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"wasmModuleRoot\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"withdrawableFunds\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"zombieNum\",\"type\":\"uint256\"}],\"name\":\"zombieAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"zombieCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"zombieNum\",\"type\":\"uint256\"}],\"name\":\"zombieLatestStakedNode\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", +} + +var ArbRollupCoreABI = ArbRollupCoreMetaData.ABI + +type ArbRollupCore struct { + address common.Address + abi abi.ABI + ArbRollupCoreCaller + ArbRollupCoreTransactor + ArbRollupCoreFilterer +} + +type ArbRollupCoreCaller struct { + contract *bind.BoundContract +} + +type ArbRollupCoreTransactor struct { + contract *bind.BoundContract +} + +type ArbRollupCoreFilterer struct { + contract *bind.BoundContract +} + +type ArbRollupCoreSession struct { + Contract *ArbRollupCore + CallOpts bind.CallOpts + TransactOpts bind.TransactOpts +} + +type ArbRollupCoreCallerSession struct { + Contract *ArbRollupCoreCaller + CallOpts bind.CallOpts +} + +type ArbRollupCoreTransactorSession struct { + Contract *ArbRollupCoreTransactor + TransactOpts bind.TransactOpts +} + +type ArbRollupCoreRaw struct { + Contract *ArbRollupCore +} + +type ArbRollupCoreCallerRaw struct { + Contract *ArbRollupCoreCaller +} + +type ArbRollupCoreTransactorRaw struct { + Contract *ArbRollupCoreTransactor +} + +func NewArbRollupCore(address common.Address, backend bind.ContractBackend) (*ArbRollupCore, error) { + abi, err := abi.JSON(strings.NewReader(ArbRollupCoreABI)) + if err != nil { + return nil, err + } + contract, err := bindArbRollupCore(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &ArbRollupCore{address: address, abi: abi, ArbRollupCoreCaller: ArbRollupCoreCaller{contract: contract}, ArbRollupCoreTransactor: ArbRollupCoreTransactor{contract: contract}, ArbRollupCoreFilterer: ArbRollupCoreFilterer{contract: contract}}, nil +} + +func NewArbRollupCoreCaller(address common.Address, caller bind.ContractCaller) (*ArbRollupCoreCaller, error) { + contract, err := bindArbRollupCore(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &ArbRollupCoreCaller{contract: contract}, nil +} + +func NewArbRollupCoreTransactor(address common.Address, transactor bind.ContractTransactor) (*ArbRollupCoreTransactor, error) { + contract, err := bindArbRollupCore(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &ArbRollupCoreTransactor{contract: contract}, nil +} + +func NewArbRollupCoreFilterer(address common.Address, filterer bind.ContractFilterer) (*ArbRollupCoreFilterer, error) { + contract, err := bindArbRollupCore(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &ArbRollupCoreFilterer{contract: contract}, nil +} + +func bindArbRollupCore(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := ArbRollupCoreMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +func (_ArbRollupCore *ArbRollupCoreRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _ArbRollupCore.Contract.ArbRollupCoreCaller.contract.Call(opts, result, method, params...) +} + +func (_ArbRollupCore *ArbRollupCoreRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _ArbRollupCore.Contract.ArbRollupCoreTransactor.contract.Transfer(opts) +} + +func (_ArbRollupCore *ArbRollupCoreRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _ArbRollupCore.Contract.ArbRollupCoreTransactor.contract.Transact(opts, method, params...) +} + +func (_ArbRollupCore *ArbRollupCoreCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _ArbRollupCore.Contract.contract.Call(opts, result, method, params...) +} + +func (_ArbRollupCore *ArbRollupCoreTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _ArbRollupCore.Contract.contract.Transfer(opts) +} + +func (_ArbRollupCore *ArbRollupCoreTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _ArbRollupCore.Contract.contract.Transact(opts, method, params...) +} + +func (_ArbRollupCore *ArbRollupCoreCaller) AmountStaked(opts *bind.CallOpts, staker common.Address) (*big.Int, error) { + var out []interface{} + err := _ArbRollupCore.contract.Call(opts, &out, "amountStaked", staker) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_ArbRollupCore *ArbRollupCoreSession) AmountStaked(staker common.Address) (*big.Int, error) { + return _ArbRollupCore.Contract.AmountStaked(&_ArbRollupCore.CallOpts, staker) +} + +func (_ArbRollupCore *ArbRollupCoreCallerSession) AmountStaked(staker common.Address) (*big.Int, error) { + return _ArbRollupCore.Contract.AmountStaked(&_ArbRollupCore.CallOpts, staker) +} + +func (_ArbRollupCore *ArbRollupCoreCaller) BaseStake(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _ArbRollupCore.contract.Call(opts, &out, "baseStake") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_ArbRollupCore *ArbRollupCoreSession) BaseStake() (*big.Int, error) { + return _ArbRollupCore.Contract.BaseStake(&_ArbRollupCore.CallOpts) +} + +func (_ArbRollupCore *ArbRollupCoreCallerSession) BaseStake() (*big.Int, error) { + return _ArbRollupCore.Contract.BaseStake(&_ArbRollupCore.CallOpts) +} + +func (_ArbRollupCore *ArbRollupCoreCaller) Bridge(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _ArbRollupCore.contract.Call(opts, &out, "bridge") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_ArbRollupCore *ArbRollupCoreSession) Bridge() (common.Address, error) { + return _ArbRollupCore.Contract.Bridge(&_ArbRollupCore.CallOpts) +} + +func (_ArbRollupCore *ArbRollupCoreCallerSession) Bridge() (common.Address, error) { + return _ArbRollupCore.Contract.Bridge(&_ArbRollupCore.CallOpts) +} + +func (_ArbRollupCore *ArbRollupCoreCaller) ChainId(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _ArbRollupCore.contract.Call(opts, &out, "chainId") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_ArbRollupCore *ArbRollupCoreSession) ChainId() (*big.Int, error) { + return _ArbRollupCore.Contract.ChainId(&_ArbRollupCore.CallOpts) +} + +func (_ArbRollupCore *ArbRollupCoreCallerSession) ChainId() (*big.Int, error) { + return _ArbRollupCore.Contract.ChainId(&_ArbRollupCore.CallOpts) +} + +func (_ArbRollupCore *ArbRollupCoreCaller) ChallengeManager(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _ArbRollupCore.contract.Call(opts, &out, "challengeManager") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_ArbRollupCore *ArbRollupCoreSession) ChallengeManager() (common.Address, error) { + return _ArbRollupCore.Contract.ChallengeManager(&_ArbRollupCore.CallOpts) +} + +func (_ArbRollupCore *ArbRollupCoreCallerSession) ChallengeManager() (common.Address, error) { + return _ArbRollupCore.Contract.ChallengeManager(&_ArbRollupCore.CallOpts) +} + +func (_ArbRollupCore *ArbRollupCoreCaller) ConfirmPeriodBlocks(opts *bind.CallOpts) (uint64, error) { + var out []interface{} + err := _ArbRollupCore.contract.Call(opts, &out, "confirmPeriodBlocks") + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +func (_ArbRollupCore *ArbRollupCoreSession) ConfirmPeriodBlocks() (uint64, error) { + return _ArbRollupCore.Contract.ConfirmPeriodBlocks(&_ArbRollupCore.CallOpts) +} + +func (_ArbRollupCore *ArbRollupCoreCallerSession) ConfirmPeriodBlocks() (uint64, error) { + return _ArbRollupCore.Contract.ConfirmPeriodBlocks(&_ArbRollupCore.CallOpts) +} + +func (_ArbRollupCore *ArbRollupCoreCaller) CurrentChallenge(opts *bind.CallOpts, staker common.Address) (uint64, error) { + var out []interface{} + err := _ArbRollupCore.contract.Call(opts, &out, "currentChallenge", staker) + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +func (_ArbRollupCore *ArbRollupCoreSession) CurrentChallenge(staker common.Address) (uint64, error) { + return _ArbRollupCore.Contract.CurrentChallenge(&_ArbRollupCore.CallOpts, staker) +} + +func (_ArbRollupCore *ArbRollupCoreCallerSession) CurrentChallenge(staker common.Address) (uint64, error) { + return _ArbRollupCore.Contract.CurrentChallenge(&_ArbRollupCore.CallOpts, staker) +} + +func (_ArbRollupCore *ArbRollupCoreCaller) ExtraChallengeTimeBlocks(opts *bind.CallOpts) (uint64, error) { + var out []interface{} + err := _ArbRollupCore.contract.Call(opts, &out, "extraChallengeTimeBlocks") + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +func (_ArbRollupCore *ArbRollupCoreSession) ExtraChallengeTimeBlocks() (uint64, error) { + return _ArbRollupCore.Contract.ExtraChallengeTimeBlocks(&_ArbRollupCore.CallOpts) +} + +func (_ArbRollupCore *ArbRollupCoreCallerSession) ExtraChallengeTimeBlocks() (uint64, error) { + return _ArbRollupCore.Contract.ExtraChallengeTimeBlocks(&_ArbRollupCore.CallOpts) +} + +func (_ArbRollupCore *ArbRollupCoreCaller) FirstUnresolvedNode(opts *bind.CallOpts) (uint64, error) { + var out []interface{} + err := _ArbRollupCore.contract.Call(opts, &out, "firstUnresolvedNode") + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +func (_ArbRollupCore *ArbRollupCoreSession) FirstUnresolvedNode() (uint64, error) { + return _ArbRollupCore.Contract.FirstUnresolvedNode(&_ArbRollupCore.CallOpts) +} + +func (_ArbRollupCore *ArbRollupCoreCallerSession) FirstUnresolvedNode() (uint64, error) { + return _ArbRollupCore.Contract.FirstUnresolvedNode(&_ArbRollupCore.CallOpts) +} + +func (_ArbRollupCore *ArbRollupCoreCaller) GetNode(opts *bind.CallOpts, nodeNum uint64) (Node, error) { + var out []interface{} + err := _ArbRollupCore.contract.Call(opts, &out, "getNode", nodeNum) + + if err != nil { + return *new(Node), err + } + + out0 := *abi.ConvertType(out[0], new(Node)).(*Node) + + return out0, err + +} + +func (_ArbRollupCore *ArbRollupCoreSession) GetNode(nodeNum uint64) (Node, error) { + return _ArbRollupCore.Contract.GetNode(&_ArbRollupCore.CallOpts, nodeNum) +} + +func (_ArbRollupCore *ArbRollupCoreCallerSession) GetNode(nodeNum uint64) (Node, error) { + return _ArbRollupCore.Contract.GetNode(&_ArbRollupCore.CallOpts, nodeNum) +} + +func (_ArbRollupCore *ArbRollupCoreCaller) GetNodeCreationBlockForLogLookup(opts *bind.CallOpts, nodeNum uint64) (*big.Int, error) { + var out []interface{} + err := _ArbRollupCore.contract.Call(opts, &out, "getNodeCreationBlockForLogLookup", nodeNum) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_ArbRollupCore *ArbRollupCoreSession) GetNodeCreationBlockForLogLookup(nodeNum uint64) (*big.Int, error) { + return _ArbRollupCore.Contract.GetNodeCreationBlockForLogLookup(&_ArbRollupCore.CallOpts, nodeNum) +} + +func (_ArbRollupCore *ArbRollupCoreCallerSession) GetNodeCreationBlockForLogLookup(nodeNum uint64) (*big.Int, error) { + return _ArbRollupCore.Contract.GetNodeCreationBlockForLogLookup(&_ArbRollupCore.CallOpts, nodeNum) +} + +func (_ArbRollupCore *ArbRollupCoreCaller) GetStaker(opts *bind.CallOpts, staker common.Address) (IRollupCoreStaker, error) { + var out []interface{} + err := _ArbRollupCore.contract.Call(opts, &out, "getStaker", staker) + + if err != nil { + return *new(IRollupCoreStaker), err + } + + out0 := *abi.ConvertType(out[0], new(IRollupCoreStaker)).(*IRollupCoreStaker) + + return out0, err + +} + +func (_ArbRollupCore *ArbRollupCoreSession) GetStaker(staker common.Address) (IRollupCoreStaker, error) { + return _ArbRollupCore.Contract.GetStaker(&_ArbRollupCore.CallOpts, staker) +} + +func (_ArbRollupCore *ArbRollupCoreCallerSession) GetStaker(staker common.Address) (IRollupCoreStaker, error) { + return _ArbRollupCore.Contract.GetStaker(&_ArbRollupCore.CallOpts, staker) +} + +func (_ArbRollupCore *ArbRollupCoreCaller) GetStakerAddress(opts *bind.CallOpts, stakerNum uint64) (common.Address, error) { + var out []interface{} + err := _ArbRollupCore.contract.Call(opts, &out, "getStakerAddress", stakerNum) + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_ArbRollupCore *ArbRollupCoreSession) GetStakerAddress(stakerNum uint64) (common.Address, error) { + return _ArbRollupCore.Contract.GetStakerAddress(&_ArbRollupCore.CallOpts, stakerNum) +} + +func (_ArbRollupCore *ArbRollupCoreCallerSession) GetStakerAddress(stakerNum uint64) (common.Address, error) { + return _ArbRollupCore.Contract.GetStakerAddress(&_ArbRollupCore.CallOpts, stakerNum) +} + +func (_ArbRollupCore *ArbRollupCoreCaller) IsStaked(opts *bind.CallOpts, staker common.Address) (bool, error) { + var out []interface{} + err := _ArbRollupCore.contract.Call(opts, &out, "isStaked", staker) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_ArbRollupCore *ArbRollupCoreSession) IsStaked(staker common.Address) (bool, error) { + return _ArbRollupCore.Contract.IsStaked(&_ArbRollupCore.CallOpts, staker) +} + +func (_ArbRollupCore *ArbRollupCoreCallerSession) IsStaked(staker common.Address) (bool, error) { + return _ArbRollupCore.Contract.IsStaked(&_ArbRollupCore.CallOpts, staker) +} + +func (_ArbRollupCore *ArbRollupCoreCaller) IsValidator(opts *bind.CallOpts, arg0 common.Address) (bool, error) { + var out []interface{} + err := _ArbRollupCore.contract.Call(opts, &out, "isValidator", arg0) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_ArbRollupCore *ArbRollupCoreSession) IsValidator(arg0 common.Address) (bool, error) { + return _ArbRollupCore.Contract.IsValidator(&_ArbRollupCore.CallOpts, arg0) +} + +func (_ArbRollupCore *ArbRollupCoreCallerSession) IsValidator(arg0 common.Address) (bool, error) { + return _ArbRollupCore.Contract.IsValidator(&_ArbRollupCore.CallOpts, arg0) +} + +func (_ArbRollupCore *ArbRollupCoreCaller) IsZombie(opts *bind.CallOpts, staker common.Address) (bool, error) { + var out []interface{} + err := _ArbRollupCore.contract.Call(opts, &out, "isZombie", staker) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_ArbRollupCore *ArbRollupCoreSession) IsZombie(staker common.Address) (bool, error) { + return _ArbRollupCore.Contract.IsZombie(&_ArbRollupCore.CallOpts, staker) +} + +func (_ArbRollupCore *ArbRollupCoreCallerSession) IsZombie(staker common.Address) (bool, error) { + return _ArbRollupCore.Contract.IsZombie(&_ArbRollupCore.CallOpts, staker) +} + +func (_ArbRollupCore *ArbRollupCoreCaller) LastStakeBlock(opts *bind.CallOpts) (uint64, error) { + var out []interface{} + err := _ArbRollupCore.contract.Call(opts, &out, "lastStakeBlock") + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +func (_ArbRollupCore *ArbRollupCoreSession) LastStakeBlock() (uint64, error) { + return _ArbRollupCore.Contract.LastStakeBlock(&_ArbRollupCore.CallOpts) +} + +func (_ArbRollupCore *ArbRollupCoreCallerSession) LastStakeBlock() (uint64, error) { + return _ArbRollupCore.Contract.LastStakeBlock(&_ArbRollupCore.CallOpts) +} + +func (_ArbRollupCore *ArbRollupCoreCaller) LatestConfirmed(opts *bind.CallOpts) (uint64, error) { + var out []interface{} + err := _ArbRollupCore.contract.Call(opts, &out, "latestConfirmed") + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +func (_ArbRollupCore *ArbRollupCoreSession) LatestConfirmed() (uint64, error) { + return _ArbRollupCore.Contract.LatestConfirmed(&_ArbRollupCore.CallOpts) +} + +func (_ArbRollupCore *ArbRollupCoreCallerSession) LatestConfirmed() (uint64, error) { + return _ArbRollupCore.Contract.LatestConfirmed(&_ArbRollupCore.CallOpts) +} + +func (_ArbRollupCore *ArbRollupCoreCaller) LatestNodeCreated(opts *bind.CallOpts) (uint64, error) { + var out []interface{} + err := _ArbRollupCore.contract.Call(opts, &out, "latestNodeCreated") + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +func (_ArbRollupCore *ArbRollupCoreSession) LatestNodeCreated() (uint64, error) { + return _ArbRollupCore.Contract.LatestNodeCreated(&_ArbRollupCore.CallOpts) +} + +func (_ArbRollupCore *ArbRollupCoreCallerSession) LatestNodeCreated() (uint64, error) { + return _ArbRollupCore.Contract.LatestNodeCreated(&_ArbRollupCore.CallOpts) +} + +func (_ArbRollupCore *ArbRollupCoreCaller) LatestStakedNode(opts *bind.CallOpts, staker common.Address) (uint64, error) { + var out []interface{} + err := _ArbRollupCore.contract.Call(opts, &out, "latestStakedNode", staker) + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +func (_ArbRollupCore *ArbRollupCoreSession) LatestStakedNode(staker common.Address) (uint64, error) { + return _ArbRollupCore.Contract.LatestStakedNode(&_ArbRollupCore.CallOpts, staker) +} + +func (_ArbRollupCore *ArbRollupCoreCallerSession) LatestStakedNode(staker common.Address) (uint64, error) { + return _ArbRollupCore.Contract.LatestStakedNode(&_ArbRollupCore.CallOpts, staker) +} + +func (_ArbRollupCore *ArbRollupCoreCaller) LoserStakeEscrow(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _ArbRollupCore.contract.Call(opts, &out, "loserStakeEscrow") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_ArbRollupCore *ArbRollupCoreSession) LoserStakeEscrow() (common.Address, error) { + return _ArbRollupCore.Contract.LoserStakeEscrow(&_ArbRollupCore.CallOpts) +} + +func (_ArbRollupCore *ArbRollupCoreCallerSession) LoserStakeEscrow() (common.Address, error) { + return _ArbRollupCore.Contract.LoserStakeEscrow(&_ArbRollupCore.CallOpts) +} + +func (_ArbRollupCore *ArbRollupCoreCaller) MinimumAssertionPeriod(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _ArbRollupCore.contract.Call(opts, &out, "minimumAssertionPeriod") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_ArbRollupCore *ArbRollupCoreSession) MinimumAssertionPeriod() (*big.Int, error) { + return _ArbRollupCore.Contract.MinimumAssertionPeriod(&_ArbRollupCore.CallOpts) +} + +func (_ArbRollupCore *ArbRollupCoreCallerSession) MinimumAssertionPeriod() (*big.Int, error) { + return _ArbRollupCore.Contract.MinimumAssertionPeriod(&_ArbRollupCore.CallOpts) +} + +func (_ArbRollupCore *ArbRollupCoreCaller) NodeHasStaker(opts *bind.CallOpts, nodeNum uint64, staker common.Address) (bool, error) { + var out []interface{} + err := _ArbRollupCore.contract.Call(opts, &out, "nodeHasStaker", nodeNum, staker) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_ArbRollupCore *ArbRollupCoreSession) NodeHasStaker(nodeNum uint64, staker common.Address) (bool, error) { + return _ArbRollupCore.Contract.NodeHasStaker(&_ArbRollupCore.CallOpts, nodeNum, staker) +} + +func (_ArbRollupCore *ArbRollupCoreCallerSession) NodeHasStaker(nodeNum uint64, staker common.Address) (bool, error) { + return _ArbRollupCore.Contract.NodeHasStaker(&_ArbRollupCore.CallOpts, nodeNum, staker) +} + +func (_ArbRollupCore *ArbRollupCoreCaller) Outbox(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _ArbRollupCore.contract.Call(opts, &out, "outbox") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_ArbRollupCore *ArbRollupCoreSession) Outbox() (common.Address, error) { + return _ArbRollupCore.Contract.Outbox(&_ArbRollupCore.CallOpts) +} + +func (_ArbRollupCore *ArbRollupCoreCallerSession) Outbox() (common.Address, error) { + return _ArbRollupCore.Contract.Outbox(&_ArbRollupCore.CallOpts) +} + +func (_ArbRollupCore *ArbRollupCoreCaller) RollupEventInbox(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _ArbRollupCore.contract.Call(opts, &out, "rollupEventInbox") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_ArbRollupCore *ArbRollupCoreSession) RollupEventInbox() (common.Address, error) { + return _ArbRollupCore.Contract.RollupEventInbox(&_ArbRollupCore.CallOpts) +} + +func (_ArbRollupCore *ArbRollupCoreCallerSession) RollupEventInbox() (common.Address, error) { + return _ArbRollupCore.Contract.RollupEventInbox(&_ArbRollupCore.CallOpts) +} + +func (_ArbRollupCore *ArbRollupCoreCaller) SequencerInbox(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _ArbRollupCore.contract.Call(opts, &out, "sequencerInbox") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_ArbRollupCore *ArbRollupCoreSession) SequencerInbox() (common.Address, error) { + return _ArbRollupCore.Contract.SequencerInbox(&_ArbRollupCore.CallOpts) +} + +func (_ArbRollupCore *ArbRollupCoreCallerSession) SequencerInbox() (common.Address, error) { + return _ArbRollupCore.Contract.SequencerInbox(&_ArbRollupCore.CallOpts) +} + +func (_ArbRollupCore *ArbRollupCoreCaller) StakeToken(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _ArbRollupCore.contract.Call(opts, &out, "stakeToken") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_ArbRollupCore *ArbRollupCoreSession) StakeToken() (common.Address, error) { + return _ArbRollupCore.Contract.StakeToken(&_ArbRollupCore.CallOpts) +} + +func (_ArbRollupCore *ArbRollupCoreCallerSession) StakeToken() (common.Address, error) { + return _ArbRollupCore.Contract.StakeToken(&_ArbRollupCore.CallOpts) +} + +func (_ArbRollupCore *ArbRollupCoreCaller) StakerCount(opts *bind.CallOpts) (uint64, error) { + var out []interface{} + err := _ArbRollupCore.contract.Call(opts, &out, "stakerCount") + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +func (_ArbRollupCore *ArbRollupCoreSession) StakerCount() (uint64, error) { + return _ArbRollupCore.Contract.StakerCount(&_ArbRollupCore.CallOpts) +} + +func (_ArbRollupCore *ArbRollupCoreCallerSession) StakerCount() (uint64, error) { + return _ArbRollupCore.Contract.StakerCount(&_ArbRollupCore.CallOpts) +} + +func (_ArbRollupCore *ArbRollupCoreCaller) ValidatorWhitelistDisabled(opts *bind.CallOpts) (bool, error) { + var out []interface{} + err := _ArbRollupCore.contract.Call(opts, &out, "validatorWhitelistDisabled") + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_ArbRollupCore *ArbRollupCoreSession) ValidatorWhitelistDisabled() (bool, error) { + return _ArbRollupCore.Contract.ValidatorWhitelistDisabled(&_ArbRollupCore.CallOpts) +} + +func (_ArbRollupCore *ArbRollupCoreCallerSession) ValidatorWhitelistDisabled() (bool, error) { + return _ArbRollupCore.Contract.ValidatorWhitelistDisabled(&_ArbRollupCore.CallOpts) +} + +func (_ArbRollupCore *ArbRollupCoreCaller) WasmModuleRoot(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _ArbRollupCore.contract.Call(opts, &out, "wasmModuleRoot") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +func (_ArbRollupCore *ArbRollupCoreSession) WasmModuleRoot() ([32]byte, error) { + return _ArbRollupCore.Contract.WasmModuleRoot(&_ArbRollupCore.CallOpts) +} + +func (_ArbRollupCore *ArbRollupCoreCallerSession) WasmModuleRoot() ([32]byte, error) { + return _ArbRollupCore.Contract.WasmModuleRoot(&_ArbRollupCore.CallOpts) +} + +func (_ArbRollupCore *ArbRollupCoreCaller) WithdrawableFunds(opts *bind.CallOpts, owner common.Address) (*big.Int, error) { + var out []interface{} + err := _ArbRollupCore.contract.Call(opts, &out, "withdrawableFunds", owner) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_ArbRollupCore *ArbRollupCoreSession) WithdrawableFunds(owner common.Address) (*big.Int, error) { + return _ArbRollupCore.Contract.WithdrawableFunds(&_ArbRollupCore.CallOpts, owner) +} + +func (_ArbRollupCore *ArbRollupCoreCallerSession) WithdrawableFunds(owner common.Address) (*big.Int, error) { + return _ArbRollupCore.Contract.WithdrawableFunds(&_ArbRollupCore.CallOpts, owner) +} + +func (_ArbRollupCore *ArbRollupCoreCaller) ZombieAddress(opts *bind.CallOpts, zombieNum *big.Int) (common.Address, error) { + var out []interface{} + err := _ArbRollupCore.contract.Call(opts, &out, "zombieAddress", zombieNum) + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_ArbRollupCore *ArbRollupCoreSession) ZombieAddress(zombieNum *big.Int) (common.Address, error) { + return _ArbRollupCore.Contract.ZombieAddress(&_ArbRollupCore.CallOpts, zombieNum) +} + +func (_ArbRollupCore *ArbRollupCoreCallerSession) ZombieAddress(zombieNum *big.Int) (common.Address, error) { + return _ArbRollupCore.Contract.ZombieAddress(&_ArbRollupCore.CallOpts, zombieNum) +} + +func (_ArbRollupCore *ArbRollupCoreCaller) ZombieCount(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _ArbRollupCore.contract.Call(opts, &out, "zombieCount") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_ArbRollupCore *ArbRollupCoreSession) ZombieCount() (*big.Int, error) { + return _ArbRollupCore.Contract.ZombieCount(&_ArbRollupCore.CallOpts) +} + +func (_ArbRollupCore *ArbRollupCoreCallerSession) ZombieCount() (*big.Int, error) { + return _ArbRollupCore.Contract.ZombieCount(&_ArbRollupCore.CallOpts) +} + +func (_ArbRollupCore *ArbRollupCoreCaller) ZombieLatestStakedNode(opts *bind.CallOpts, zombieNum *big.Int) (uint64, error) { + var out []interface{} + err := _ArbRollupCore.contract.Call(opts, &out, "zombieLatestStakedNode", zombieNum) + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +func (_ArbRollupCore *ArbRollupCoreSession) ZombieLatestStakedNode(zombieNum *big.Int) (uint64, error) { + return _ArbRollupCore.Contract.ZombieLatestStakedNode(&_ArbRollupCore.CallOpts, zombieNum) +} + +func (_ArbRollupCore *ArbRollupCoreCallerSession) ZombieLatestStakedNode(zombieNum *big.Int) (uint64, error) { + return _ArbRollupCore.Contract.ZombieLatestStakedNode(&_ArbRollupCore.CallOpts, zombieNum) +} + +type ArbRollupCoreNodeConfirmedIterator struct { + Event *ArbRollupCoreNodeConfirmed + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *ArbRollupCoreNodeConfirmedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(ArbRollupCoreNodeConfirmed) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(ArbRollupCoreNodeConfirmed) + 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() + } +} + +func (it *ArbRollupCoreNodeConfirmedIterator) Error() error { + return it.fail +} + +func (it *ArbRollupCoreNodeConfirmedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type ArbRollupCoreNodeConfirmed struct { + NodeNum uint64 + BlockHash [32]byte + SendRoot [32]byte + Raw types.Log +} + +func (_ArbRollupCore *ArbRollupCoreFilterer) FilterNodeConfirmed(opts *bind.FilterOpts, nodeNum []uint64) (*ArbRollupCoreNodeConfirmedIterator, error) { + + var nodeNumRule []interface{} + for _, nodeNumItem := range nodeNum { + nodeNumRule = append(nodeNumRule, nodeNumItem) + } + + logs, sub, err := _ArbRollupCore.contract.FilterLogs(opts, "NodeConfirmed", nodeNumRule) + if err != nil { + return nil, err + } + return &ArbRollupCoreNodeConfirmedIterator{contract: _ArbRollupCore.contract, event: "NodeConfirmed", logs: logs, sub: sub}, nil +} + +func (_ArbRollupCore *ArbRollupCoreFilterer) WatchNodeConfirmed(opts *bind.WatchOpts, sink chan<- *ArbRollupCoreNodeConfirmed, nodeNum []uint64) (event.Subscription, error) { + + var nodeNumRule []interface{} + for _, nodeNumItem := range nodeNum { + nodeNumRule = append(nodeNumRule, nodeNumItem) + } + + logs, sub, err := _ArbRollupCore.contract.WatchLogs(opts, "NodeConfirmed", nodeNumRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(ArbRollupCoreNodeConfirmed) + if err := _ArbRollupCore.contract.UnpackLog(event, "NodeConfirmed", 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 +} + +func (_ArbRollupCore *ArbRollupCoreFilterer) ParseNodeConfirmed(log types.Log) (*ArbRollupCoreNodeConfirmed, error) { + event := new(ArbRollupCoreNodeConfirmed) + if err := _ArbRollupCore.contract.UnpackLog(event, "NodeConfirmed", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type ArbRollupCoreNodeCreatedIterator struct { + Event *ArbRollupCoreNodeCreated + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *ArbRollupCoreNodeCreatedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(ArbRollupCoreNodeCreated) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(ArbRollupCoreNodeCreated) + 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() + } +} + +func (it *ArbRollupCoreNodeCreatedIterator) Error() error { + return it.fail +} + +func (it *ArbRollupCoreNodeCreatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type ArbRollupCoreNodeCreated struct { + NodeNum uint64 + ParentNodeHash [32]byte + NodeHash [32]byte + ExecutionHash [32]byte + Assertion Assertion + AfterInboxBatchAcc [32]byte + WasmModuleRoot [32]byte + InboxMaxCount *big.Int + Raw types.Log +} + +func (_ArbRollupCore *ArbRollupCoreFilterer) FilterNodeCreated(opts *bind.FilterOpts, nodeNum []uint64, parentNodeHash [][32]byte, nodeHash [][32]byte) (*ArbRollupCoreNodeCreatedIterator, error) { + + var nodeNumRule []interface{} + for _, nodeNumItem := range nodeNum { + nodeNumRule = append(nodeNumRule, nodeNumItem) + } + var parentNodeHashRule []interface{} + for _, parentNodeHashItem := range parentNodeHash { + parentNodeHashRule = append(parentNodeHashRule, parentNodeHashItem) + } + var nodeHashRule []interface{} + for _, nodeHashItem := range nodeHash { + nodeHashRule = append(nodeHashRule, nodeHashItem) + } + + logs, sub, err := _ArbRollupCore.contract.FilterLogs(opts, "NodeCreated", nodeNumRule, parentNodeHashRule, nodeHashRule) + if err != nil { + return nil, err + } + return &ArbRollupCoreNodeCreatedIterator{contract: _ArbRollupCore.contract, event: "NodeCreated", logs: logs, sub: sub}, nil +} + +func (_ArbRollupCore *ArbRollupCoreFilterer) WatchNodeCreated(opts *bind.WatchOpts, sink chan<- *ArbRollupCoreNodeCreated, nodeNum []uint64, parentNodeHash [][32]byte, nodeHash [][32]byte) (event.Subscription, error) { + + var nodeNumRule []interface{} + for _, nodeNumItem := range nodeNum { + nodeNumRule = append(nodeNumRule, nodeNumItem) + } + var parentNodeHashRule []interface{} + for _, parentNodeHashItem := range parentNodeHash { + parentNodeHashRule = append(parentNodeHashRule, parentNodeHashItem) + } + var nodeHashRule []interface{} + for _, nodeHashItem := range nodeHash { + nodeHashRule = append(nodeHashRule, nodeHashItem) + } + + logs, sub, err := _ArbRollupCore.contract.WatchLogs(opts, "NodeCreated", nodeNumRule, parentNodeHashRule, nodeHashRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(ArbRollupCoreNodeCreated) + if err := _ArbRollupCore.contract.UnpackLog(event, "NodeCreated", 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 +} + +func (_ArbRollupCore *ArbRollupCoreFilterer) ParseNodeCreated(log types.Log) (*ArbRollupCoreNodeCreated, error) { + event := new(ArbRollupCoreNodeCreated) + if err := _ArbRollupCore.contract.UnpackLog(event, "NodeCreated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type ArbRollupCoreNodeRejectedIterator struct { + Event *ArbRollupCoreNodeRejected + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *ArbRollupCoreNodeRejectedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(ArbRollupCoreNodeRejected) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(ArbRollupCoreNodeRejected) + 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() + } +} + +func (it *ArbRollupCoreNodeRejectedIterator) Error() error { + return it.fail +} + +func (it *ArbRollupCoreNodeRejectedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type ArbRollupCoreNodeRejected struct { + NodeNum uint64 + Raw types.Log +} + +func (_ArbRollupCore *ArbRollupCoreFilterer) FilterNodeRejected(opts *bind.FilterOpts, nodeNum []uint64) (*ArbRollupCoreNodeRejectedIterator, error) { + + var nodeNumRule []interface{} + for _, nodeNumItem := range nodeNum { + nodeNumRule = append(nodeNumRule, nodeNumItem) + } + + logs, sub, err := _ArbRollupCore.contract.FilterLogs(opts, "NodeRejected", nodeNumRule) + if err != nil { + return nil, err + } + return &ArbRollupCoreNodeRejectedIterator{contract: _ArbRollupCore.contract, event: "NodeRejected", logs: logs, sub: sub}, nil +} + +func (_ArbRollupCore *ArbRollupCoreFilterer) WatchNodeRejected(opts *bind.WatchOpts, sink chan<- *ArbRollupCoreNodeRejected, nodeNum []uint64) (event.Subscription, error) { + + var nodeNumRule []interface{} + for _, nodeNumItem := range nodeNum { + nodeNumRule = append(nodeNumRule, nodeNumItem) + } + + logs, sub, err := _ArbRollupCore.contract.WatchLogs(opts, "NodeRejected", nodeNumRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(ArbRollupCoreNodeRejected) + if err := _ArbRollupCore.contract.UnpackLog(event, "NodeRejected", 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 +} + +func (_ArbRollupCore *ArbRollupCoreFilterer) ParseNodeRejected(log types.Log) (*ArbRollupCoreNodeRejected, error) { + event := new(ArbRollupCoreNodeRejected) + if err := _ArbRollupCore.contract.UnpackLog(event, "NodeRejected", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type ArbRollupCoreRollupChallengeStartedIterator struct { + Event *ArbRollupCoreRollupChallengeStarted + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *ArbRollupCoreRollupChallengeStartedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(ArbRollupCoreRollupChallengeStarted) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(ArbRollupCoreRollupChallengeStarted) + 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() + } +} + +func (it *ArbRollupCoreRollupChallengeStartedIterator) Error() error { + return it.fail +} + +func (it *ArbRollupCoreRollupChallengeStartedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type ArbRollupCoreRollupChallengeStarted struct { + ChallengeIndex uint64 + Asserter common.Address + Challenger common.Address + ChallengedNode uint64 + Raw types.Log +} + +func (_ArbRollupCore *ArbRollupCoreFilterer) FilterRollupChallengeStarted(opts *bind.FilterOpts, challengeIndex []uint64) (*ArbRollupCoreRollupChallengeStartedIterator, error) { + + var challengeIndexRule []interface{} + for _, challengeIndexItem := range challengeIndex { + challengeIndexRule = append(challengeIndexRule, challengeIndexItem) + } + + logs, sub, err := _ArbRollupCore.contract.FilterLogs(opts, "RollupChallengeStarted", challengeIndexRule) + if err != nil { + return nil, err + } + return &ArbRollupCoreRollupChallengeStartedIterator{contract: _ArbRollupCore.contract, event: "RollupChallengeStarted", logs: logs, sub: sub}, nil +} + +func (_ArbRollupCore *ArbRollupCoreFilterer) WatchRollupChallengeStarted(opts *bind.WatchOpts, sink chan<- *ArbRollupCoreRollupChallengeStarted, challengeIndex []uint64) (event.Subscription, error) { + + var challengeIndexRule []interface{} + for _, challengeIndexItem := range challengeIndex { + challengeIndexRule = append(challengeIndexRule, challengeIndexItem) + } + + logs, sub, err := _ArbRollupCore.contract.WatchLogs(opts, "RollupChallengeStarted", challengeIndexRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(ArbRollupCoreRollupChallengeStarted) + if err := _ArbRollupCore.contract.UnpackLog(event, "RollupChallengeStarted", 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 +} + +func (_ArbRollupCore *ArbRollupCoreFilterer) ParseRollupChallengeStarted(log types.Log) (*ArbRollupCoreRollupChallengeStarted, error) { + event := new(ArbRollupCoreRollupChallengeStarted) + if err := _ArbRollupCore.contract.UnpackLog(event, "RollupChallengeStarted", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type ArbRollupCoreRollupInitializedIterator struct { + Event *ArbRollupCoreRollupInitialized + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *ArbRollupCoreRollupInitializedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(ArbRollupCoreRollupInitialized) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(ArbRollupCoreRollupInitialized) + 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() + } +} + +func (it *ArbRollupCoreRollupInitializedIterator) Error() error { + return it.fail +} + +func (it *ArbRollupCoreRollupInitializedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type ArbRollupCoreRollupInitialized struct { + MachineHash [32]byte + ChainId *big.Int + Raw types.Log +} + +func (_ArbRollupCore *ArbRollupCoreFilterer) FilterRollupInitialized(opts *bind.FilterOpts) (*ArbRollupCoreRollupInitializedIterator, error) { + + logs, sub, err := _ArbRollupCore.contract.FilterLogs(opts, "RollupInitialized") + if err != nil { + return nil, err + } + return &ArbRollupCoreRollupInitializedIterator{contract: _ArbRollupCore.contract, event: "RollupInitialized", logs: logs, sub: sub}, nil +} + +func (_ArbRollupCore *ArbRollupCoreFilterer) WatchRollupInitialized(opts *bind.WatchOpts, sink chan<- *ArbRollupCoreRollupInitialized) (event.Subscription, error) { + + logs, sub, err := _ArbRollupCore.contract.WatchLogs(opts, "RollupInitialized") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(ArbRollupCoreRollupInitialized) + if err := _ArbRollupCore.contract.UnpackLog(event, "RollupInitialized", 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 +} + +func (_ArbRollupCore *ArbRollupCoreFilterer) ParseRollupInitialized(log types.Log) (*ArbRollupCoreRollupInitialized, error) { + event := new(ArbRollupCoreRollupInitialized) + if err := _ArbRollupCore.contract.UnpackLog(event, "RollupInitialized", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type ArbRollupCoreUserStakeUpdatedIterator struct { + Event *ArbRollupCoreUserStakeUpdated + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *ArbRollupCoreUserStakeUpdatedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(ArbRollupCoreUserStakeUpdated) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(ArbRollupCoreUserStakeUpdated) + 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() + } +} + +func (it *ArbRollupCoreUserStakeUpdatedIterator) Error() error { + return it.fail +} + +func (it *ArbRollupCoreUserStakeUpdatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type ArbRollupCoreUserStakeUpdated struct { + User common.Address + InitialBalance *big.Int + FinalBalance *big.Int + Raw types.Log +} + +func (_ArbRollupCore *ArbRollupCoreFilterer) FilterUserStakeUpdated(opts *bind.FilterOpts, user []common.Address) (*ArbRollupCoreUserStakeUpdatedIterator, error) { + + var userRule []interface{} + for _, userItem := range user { + userRule = append(userRule, userItem) + } + + logs, sub, err := _ArbRollupCore.contract.FilterLogs(opts, "UserStakeUpdated", userRule) + if err != nil { + return nil, err + } + return &ArbRollupCoreUserStakeUpdatedIterator{contract: _ArbRollupCore.contract, event: "UserStakeUpdated", logs: logs, sub: sub}, nil +} + +func (_ArbRollupCore *ArbRollupCoreFilterer) WatchUserStakeUpdated(opts *bind.WatchOpts, sink chan<- *ArbRollupCoreUserStakeUpdated, user []common.Address) (event.Subscription, error) { + + var userRule []interface{} + for _, userItem := range user { + userRule = append(userRule, userItem) + } + + logs, sub, err := _ArbRollupCore.contract.WatchLogs(opts, "UserStakeUpdated", userRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(ArbRollupCoreUserStakeUpdated) + if err := _ArbRollupCore.contract.UnpackLog(event, "UserStakeUpdated", 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 +} + +func (_ArbRollupCore *ArbRollupCoreFilterer) ParseUserStakeUpdated(log types.Log) (*ArbRollupCoreUserStakeUpdated, error) { + event := new(ArbRollupCoreUserStakeUpdated) + if err := _ArbRollupCore.contract.UnpackLog(event, "UserStakeUpdated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type ArbRollupCoreUserWithdrawableFundsUpdatedIterator struct { + Event *ArbRollupCoreUserWithdrawableFundsUpdated + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *ArbRollupCoreUserWithdrawableFundsUpdatedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(ArbRollupCoreUserWithdrawableFundsUpdated) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(ArbRollupCoreUserWithdrawableFundsUpdated) + 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() + } +} + +func (it *ArbRollupCoreUserWithdrawableFundsUpdatedIterator) Error() error { + return it.fail +} + +func (it *ArbRollupCoreUserWithdrawableFundsUpdatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type ArbRollupCoreUserWithdrawableFundsUpdated struct { + User common.Address + InitialBalance *big.Int + FinalBalance *big.Int + Raw types.Log +} + +func (_ArbRollupCore *ArbRollupCoreFilterer) FilterUserWithdrawableFundsUpdated(opts *bind.FilterOpts, user []common.Address) (*ArbRollupCoreUserWithdrawableFundsUpdatedIterator, error) { + + var userRule []interface{} + for _, userItem := range user { + userRule = append(userRule, userItem) + } + + logs, sub, err := _ArbRollupCore.contract.FilterLogs(opts, "UserWithdrawableFundsUpdated", userRule) + if err != nil { + return nil, err + } + return &ArbRollupCoreUserWithdrawableFundsUpdatedIterator{contract: _ArbRollupCore.contract, event: "UserWithdrawableFundsUpdated", logs: logs, sub: sub}, nil +} + +func (_ArbRollupCore *ArbRollupCoreFilterer) WatchUserWithdrawableFundsUpdated(opts *bind.WatchOpts, sink chan<- *ArbRollupCoreUserWithdrawableFundsUpdated, user []common.Address) (event.Subscription, error) { + + var userRule []interface{} + for _, userItem := range user { + userRule = append(userRule, userItem) + } + + logs, sub, err := _ArbRollupCore.contract.WatchLogs(opts, "UserWithdrawableFundsUpdated", userRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(ArbRollupCoreUserWithdrawableFundsUpdated) + if err := _ArbRollupCore.contract.UnpackLog(event, "UserWithdrawableFundsUpdated", 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 +} + +func (_ArbRollupCore *ArbRollupCoreFilterer) ParseUserWithdrawableFundsUpdated(log types.Log) (*ArbRollupCoreUserWithdrawableFundsUpdated, error) { + event := new(ArbRollupCoreUserWithdrawableFundsUpdated) + if err := _ArbRollupCore.contract.UnpackLog(event, "UserWithdrawableFundsUpdated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +func (_ArbRollupCore *ArbRollupCore) ParseLog(log types.Log) (generated.AbigenLog, error) { + switch log.Topics[0] { + case _ArbRollupCore.abi.Events["NodeConfirmed"].ID: + return _ArbRollupCore.ParseNodeConfirmed(log) + case _ArbRollupCore.abi.Events["NodeCreated"].ID: + return _ArbRollupCore.ParseNodeCreated(log) + case _ArbRollupCore.abi.Events["NodeRejected"].ID: + return _ArbRollupCore.ParseNodeRejected(log) + case _ArbRollupCore.abi.Events["RollupChallengeStarted"].ID: + return _ArbRollupCore.ParseRollupChallengeStarted(log) + case _ArbRollupCore.abi.Events["RollupInitialized"].ID: + return _ArbRollupCore.ParseRollupInitialized(log) + case _ArbRollupCore.abi.Events["UserStakeUpdated"].ID: + return _ArbRollupCore.ParseUserStakeUpdated(log) + case _ArbRollupCore.abi.Events["UserWithdrawableFundsUpdated"].ID: + return _ArbRollupCore.ParseUserWithdrawableFundsUpdated(log) + + default: + return nil, fmt.Errorf("abigen wrapper received unknown log topic: %v", log.Topics[0]) + } +} + +func (ArbRollupCoreNodeConfirmed) Topic() common.Hash { + return common.HexToHash("0x22ef0479a7ff660660d1c2fe35f1b632cf31675c2d9378db8cec95b00d8ffa3c") +} + +func (ArbRollupCoreNodeCreated) Topic() common.Hash { + return common.HexToHash("0x4f4caa9e67fb994e349dd35d1ad0ce23053d4323f83ce11dc817b5435031d096") +} + +func (ArbRollupCoreNodeRejected) Topic() common.Hash { + return common.HexToHash("0xeaffa3d968707ec919a2fc9f31d5ab2b86c905881ff561725d5a82fc95ad4640") +} + +func (ArbRollupCoreRollupChallengeStarted) Topic() common.Hash { + return common.HexToHash("0x6db7dc2f507647d135035469b27aa79cea90582779d084a7821d6cd092cbd873") +} + +func (ArbRollupCoreRollupInitialized) Topic() common.Hash { + return common.HexToHash("0xfc1b83c11d99d08a938e0b82a0bd45f822f71ff5abf23f999c93c4533d752464") +} + +func (ArbRollupCoreUserStakeUpdated) Topic() common.Hash { + return common.HexToHash("0xebd093d389ab57f3566918d2c379a2b4d9539e8eb95efad9d5e465457833fde6") +} + +func (ArbRollupCoreUserWithdrawableFundsUpdated) Topic() common.Hash { + return common.HexToHash("0xa740af14c56e4e04a617b1de1eb20de73270decbaaead14f142aabf3038e5ae2") +} + +func (_ArbRollupCore *ArbRollupCore) Address() common.Address { + return _ArbRollupCore.address +} + +type ArbRollupCoreInterface interface { + AmountStaked(opts *bind.CallOpts, staker common.Address) (*big.Int, error) + + BaseStake(opts *bind.CallOpts) (*big.Int, error) + + Bridge(opts *bind.CallOpts) (common.Address, error) + + ChainId(opts *bind.CallOpts) (*big.Int, error) + + ChallengeManager(opts *bind.CallOpts) (common.Address, error) + + ConfirmPeriodBlocks(opts *bind.CallOpts) (uint64, error) + + CurrentChallenge(opts *bind.CallOpts, staker common.Address) (uint64, error) + + ExtraChallengeTimeBlocks(opts *bind.CallOpts) (uint64, error) + + FirstUnresolvedNode(opts *bind.CallOpts) (uint64, error) + + GetNode(opts *bind.CallOpts, nodeNum uint64) (Node, error) + + GetNodeCreationBlockForLogLookup(opts *bind.CallOpts, nodeNum uint64) (*big.Int, error) + + GetStaker(opts *bind.CallOpts, staker common.Address) (IRollupCoreStaker, error) + + GetStakerAddress(opts *bind.CallOpts, stakerNum uint64) (common.Address, error) + + IsStaked(opts *bind.CallOpts, staker common.Address) (bool, error) + + IsValidator(opts *bind.CallOpts, arg0 common.Address) (bool, error) + + IsZombie(opts *bind.CallOpts, staker common.Address) (bool, error) + + LastStakeBlock(opts *bind.CallOpts) (uint64, error) + + LatestConfirmed(opts *bind.CallOpts) (uint64, error) + + LatestNodeCreated(opts *bind.CallOpts) (uint64, error) + + LatestStakedNode(opts *bind.CallOpts, staker common.Address) (uint64, error) + + LoserStakeEscrow(opts *bind.CallOpts) (common.Address, error) + + MinimumAssertionPeriod(opts *bind.CallOpts) (*big.Int, error) + + NodeHasStaker(opts *bind.CallOpts, nodeNum uint64, staker common.Address) (bool, error) + + Outbox(opts *bind.CallOpts) (common.Address, error) + + RollupEventInbox(opts *bind.CallOpts) (common.Address, error) + + SequencerInbox(opts *bind.CallOpts) (common.Address, error) + + StakeToken(opts *bind.CallOpts) (common.Address, error) + + StakerCount(opts *bind.CallOpts) (uint64, error) + + ValidatorWhitelistDisabled(opts *bind.CallOpts) (bool, error) + + WasmModuleRoot(opts *bind.CallOpts) ([32]byte, error) + + WithdrawableFunds(opts *bind.CallOpts, owner common.Address) (*big.Int, error) + + ZombieAddress(opts *bind.CallOpts, zombieNum *big.Int) (common.Address, error) + + ZombieCount(opts *bind.CallOpts) (*big.Int, error) + + ZombieLatestStakedNode(opts *bind.CallOpts, zombieNum *big.Int) (uint64, error) + + FilterNodeConfirmed(opts *bind.FilterOpts, nodeNum []uint64) (*ArbRollupCoreNodeConfirmedIterator, error) + + WatchNodeConfirmed(opts *bind.WatchOpts, sink chan<- *ArbRollupCoreNodeConfirmed, nodeNum []uint64) (event.Subscription, error) + + ParseNodeConfirmed(log types.Log) (*ArbRollupCoreNodeConfirmed, error) + + FilterNodeCreated(opts *bind.FilterOpts, nodeNum []uint64, parentNodeHash [][32]byte, nodeHash [][32]byte) (*ArbRollupCoreNodeCreatedIterator, error) + + WatchNodeCreated(opts *bind.WatchOpts, sink chan<- *ArbRollupCoreNodeCreated, nodeNum []uint64, parentNodeHash [][32]byte, nodeHash [][32]byte) (event.Subscription, error) + + ParseNodeCreated(log types.Log) (*ArbRollupCoreNodeCreated, error) + + FilterNodeRejected(opts *bind.FilterOpts, nodeNum []uint64) (*ArbRollupCoreNodeRejectedIterator, error) + + WatchNodeRejected(opts *bind.WatchOpts, sink chan<- *ArbRollupCoreNodeRejected, nodeNum []uint64) (event.Subscription, error) + + ParseNodeRejected(log types.Log) (*ArbRollupCoreNodeRejected, error) + + FilterRollupChallengeStarted(opts *bind.FilterOpts, challengeIndex []uint64) (*ArbRollupCoreRollupChallengeStartedIterator, error) + + WatchRollupChallengeStarted(opts *bind.WatchOpts, sink chan<- *ArbRollupCoreRollupChallengeStarted, challengeIndex []uint64) (event.Subscription, error) + + ParseRollupChallengeStarted(log types.Log) (*ArbRollupCoreRollupChallengeStarted, error) + + FilterRollupInitialized(opts *bind.FilterOpts) (*ArbRollupCoreRollupInitializedIterator, error) + + WatchRollupInitialized(opts *bind.WatchOpts, sink chan<- *ArbRollupCoreRollupInitialized) (event.Subscription, error) + + ParseRollupInitialized(log types.Log) (*ArbRollupCoreRollupInitialized, error) + + FilterUserStakeUpdated(opts *bind.FilterOpts, user []common.Address) (*ArbRollupCoreUserStakeUpdatedIterator, error) + + WatchUserStakeUpdated(opts *bind.WatchOpts, sink chan<- *ArbRollupCoreUserStakeUpdated, user []common.Address) (event.Subscription, error) + + ParseUserStakeUpdated(log types.Log) (*ArbRollupCoreUserStakeUpdated, error) + + FilterUserWithdrawableFundsUpdated(opts *bind.FilterOpts, user []common.Address) (*ArbRollupCoreUserWithdrawableFundsUpdatedIterator, error) + + WatchUserWithdrawableFundsUpdated(opts *bind.WatchOpts, sink chan<- *ArbRollupCoreUserWithdrawableFundsUpdated, user []common.Address) (event.Subscription, error) + + ParseUserWithdrawableFundsUpdated(log types.Log) (*ArbRollupCoreUserWithdrawableFundsUpdated, error) + + ParseLog(log types.Log) (generated.AbigenLog, error) + + Address() common.Address +} diff --git a/core/gethwrappers/liquiditymanager/generated/arbitrum_token_gateway/arbitrum_token_gateway.go b/core/gethwrappers/liquiditymanager/generated/arbitrum_token_gateway/arbitrum_token_gateway.go new file mode 100644 index 00000000000..db303b881f2 --- /dev/null +++ b/core/gethwrappers/liquiditymanager/generated/arbitrum_token_gateway/arbitrum_token_gateway.go @@ -0,0 +1,235 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package arbitrum_token_gateway + +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" +) + +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +var ArbitrumTokenGatewayMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"l1ERC20\",\"type\":\"address\"}],\"name\":\"calculateL2TokenAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_token\",\"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\":\"finalizeInboundTransfer\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_token\",\"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\":\"getOutboundCalldata\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_token\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_maxGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_gasPriceBid\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"outboundTransfer\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"function\"}]", +} + +var ArbitrumTokenGatewayABI = ArbitrumTokenGatewayMetaData.ABI + +type ArbitrumTokenGateway struct { + address common.Address + abi abi.ABI + ArbitrumTokenGatewayCaller + ArbitrumTokenGatewayTransactor + ArbitrumTokenGatewayFilterer +} + +type ArbitrumTokenGatewayCaller struct { + contract *bind.BoundContract +} + +type ArbitrumTokenGatewayTransactor struct { + contract *bind.BoundContract +} + +type ArbitrumTokenGatewayFilterer struct { + contract *bind.BoundContract +} + +type ArbitrumTokenGatewaySession struct { + Contract *ArbitrumTokenGateway + CallOpts bind.CallOpts + TransactOpts bind.TransactOpts +} + +type ArbitrumTokenGatewayCallerSession struct { + Contract *ArbitrumTokenGatewayCaller + CallOpts bind.CallOpts +} + +type ArbitrumTokenGatewayTransactorSession struct { + Contract *ArbitrumTokenGatewayTransactor + TransactOpts bind.TransactOpts +} + +type ArbitrumTokenGatewayRaw struct { + Contract *ArbitrumTokenGateway +} + +type ArbitrumTokenGatewayCallerRaw struct { + Contract *ArbitrumTokenGatewayCaller +} + +type ArbitrumTokenGatewayTransactorRaw struct { + Contract *ArbitrumTokenGatewayTransactor +} + +func NewArbitrumTokenGateway(address common.Address, backend bind.ContractBackend) (*ArbitrumTokenGateway, error) { + abi, err := abi.JSON(strings.NewReader(ArbitrumTokenGatewayABI)) + if err != nil { + return nil, err + } + contract, err := bindArbitrumTokenGateway(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &ArbitrumTokenGateway{address: address, abi: abi, ArbitrumTokenGatewayCaller: ArbitrumTokenGatewayCaller{contract: contract}, ArbitrumTokenGatewayTransactor: ArbitrumTokenGatewayTransactor{contract: contract}, ArbitrumTokenGatewayFilterer: ArbitrumTokenGatewayFilterer{contract: contract}}, nil +} + +func NewArbitrumTokenGatewayCaller(address common.Address, caller bind.ContractCaller) (*ArbitrumTokenGatewayCaller, error) { + contract, err := bindArbitrumTokenGateway(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &ArbitrumTokenGatewayCaller{contract: contract}, nil +} + +func NewArbitrumTokenGatewayTransactor(address common.Address, transactor bind.ContractTransactor) (*ArbitrumTokenGatewayTransactor, error) { + contract, err := bindArbitrumTokenGateway(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &ArbitrumTokenGatewayTransactor{contract: contract}, nil +} + +func NewArbitrumTokenGatewayFilterer(address common.Address, filterer bind.ContractFilterer) (*ArbitrumTokenGatewayFilterer, error) { + contract, err := bindArbitrumTokenGateway(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &ArbitrumTokenGatewayFilterer{contract: contract}, nil +} + +func bindArbitrumTokenGateway(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := ArbitrumTokenGatewayMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +func (_ArbitrumTokenGateway *ArbitrumTokenGatewayRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _ArbitrumTokenGateway.Contract.ArbitrumTokenGatewayCaller.contract.Call(opts, result, method, params...) +} + +func (_ArbitrumTokenGateway *ArbitrumTokenGatewayRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _ArbitrumTokenGateway.Contract.ArbitrumTokenGatewayTransactor.contract.Transfer(opts) +} + +func (_ArbitrumTokenGateway *ArbitrumTokenGatewayRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _ArbitrumTokenGateway.Contract.ArbitrumTokenGatewayTransactor.contract.Transact(opts, method, params...) +} + +func (_ArbitrumTokenGateway *ArbitrumTokenGatewayCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _ArbitrumTokenGateway.Contract.contract.Call(opts, result, method, params...) +} + +func (_ArbitrumTokenGateway *ArbitrumTokenGatewayTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _ArbitrumTokenGateway.Contract.contract.Transfer(opts) +} + +func (_ArbitrumTokenGateway *ArbitrumTokenGatewayTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _ArbitrumTokenGateway.Contract.contract.Transact(opts, method, params...) +} + +func (_ArbitrumTokenGateway *ArbitrumTokenGatewayCaller) CalculateL2TokenAddress(opts *bind.CallOpts, l1ERC20 common.Address) (common.Address, error) { + var out []interface{} + err := _ArbitrumTokenGateway.contract.Call(opts, &out, "calculateL2TokenAddress", l1ERC20) + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_ArbitrumTokenGateway *ArbitrumTokenGatewaySession) CalculateL2TokenAddress(l1ERC20 common.Address) (common.Address, error) { + return _ArbitrumTokenGateway.Contract.CalculateL2TokenAddress(&_ArbitrumTokenGateway.CallOpts, l1ERC20) +} + +func (_ArbitrumTokenGateway *ArbitrumTokenGatewayCallerSession) CalculateL2TokenAddress(l1ERC20 common.Address) (common.Address, error) { + return _ArbitrumTokenGateway.Contract.CalculateL2TokenAddress(&_ArbitrumTokenGateway.CallOpts, l1ERC20) +} + +func (_ArbitrumTokenGateway *ArbitrumTokenGatewayCaller) GetOutboundCalldata(opts *bind.CallOpts, _token common.Address, _from common.Address, _to common.Address, _amount *big.Int, _data []byte) ([]byte, error) { + var out []interface{} + err := _ArbitrumTokenGateway.contract.Call(opts, &out, "getOutboundCalldata", _token, _from, _to, _amount, _data) + + if err != nil { + return *new([]byte), err + } + + out0 := *abi.ConvertType(out[0], new([]byte)).(*[]byte) + + return out0, err + +} + +func (_ArbitrumTokenGateway *ArbitrumTokenGatewaySession) GetOutboundCalldata(_token common.Address, _from common.Address, _to common.Address, _amount *big.Int, _data []byte) ([]byte, error) { + return _ArbitrumTokenGateway.Contract.GetOutboundCalldata(&_ArbitrumTokenGateway.CallOpts, _token, _from, _to, _amount, _data) +} + +func (_ArbitrumTokenGateway *ArbitrumTokenGatewayCallerSession) GetOutboundCalldata(_token common.Address, _from common.Address, _to common.Address, _amount *big.Int, _data []byte) ([]byte, error) { + return _ArbitrumTokenGateway.Contract.GetOutboundCalldata(&_ArbitrumTokenGateway.CallOpts, _token, _from, _to, _amount, _data) +} + +func (_ArbitrumTokenGateway *ArbitrumTokenGatewayTransactor) FinalizeInboundTransfer(opts *bind.TransactOpts, _token common.Address, _from common.Address, _to common.Address, _amount *big.Int, _data []byte) (*types.Transaction, error) { + return _ArbitrumTokenGateway.contract.Transact(opts, "finalizeInboundTransfer", _token, _from, _to, _amount, _data) +} + +func (_ArbitrumTokenGateway *ArbitrumTokenGatewaySession) FinalizeInboundTransfer(_token common.Address, _from common.Address, _to common.Address, _amount *big.Int, _data []byte) (*types.Transaction, error) { + return _ArbitrumTokenGateway.Contract.FinalizeInboundTransfer(&_ArbitrumTokenGateway.TransactOpts, _token, _from, _to, _amount, _data) +} + +func (_ArbitrumTokenGateway *ArbitrumTokenGatewayTransactorSession) FinalizeInboundTransfer(_token common.Address, _from common.Address, _to common.Address, _amount *big.Int, _data []byte) (*types.Transaction, error) { + return _ArbitrumTokenGateway.Contract.FinalizeInboundTransfer(&_ArbitrumTokenGateway.TransactOpts, _token, _from, _to, _amount, _data) +} + +func (_ArbitrumTokenGateway *ArbitrumTokenGatewayTransactor) OutboundTransfer(opts *bind.TransactOpts, _token common.Address, _to common.Address, _amount *big.Int, _maxGas *big.Int, _gasPriceBid *big.Int, _data []byte) (*types.Transaction, error) { + return _ArbitrumTokenGateway.contract.Transact(opts, "outboundTransfer", _token, _to, _amount, _maxGas, _gasPriceBid, _data) +} + +func (_ArbitrumTokenGateway *ArbitrumTokenGatewaySession) OutboundTransfer(_token common.Address, _to common.Address, _amount *big.Int, _maxGas *big.Int, _gasPriceBid *big.Int, _data []byte) (*types.Transaction, error) { + return _ArbitrumTokenGateway.Contract.OutboundTransfer(&_ArbitrumTokenGateway.TransactOpts, _token, _to, _amount, _maxGas, _gasPriceBid, _data) +} + +func (_ArbitrumTokenGateway *ArbitrumTokenGatewayTransactorSession) OutboundTransfer(_token common.Address, _to common.Address, _amount *big.Int, _maxGas *big.Int, _gasPriceBid *big.Int, _data []byte) (*types.Transaction, error) { + return _ArbitrumTokenGateway.Contract.OutboundTransfer(&_ArbitrumTokenGateway.TransactOpts, _token, _to, _amount, _maxGas, _gasPriceBid, _data) +} + +func (_ArbitrumTokenGateway *ArbitrumTokenGateway) Address() common.Address { + return _ArbitrumTokenGateway.address +} + +type ArbitrumTokenGatewayInterface interface { + CalculateL2TokenAddress(opts *bind.CallOpts, l1ERC20 common.Address) (common.Address, error) + + GetOutboundCalldata(opts *bind.CallOpts, _token common.Address, _from common.Address, _to common.Address, _amount *big.Int, _data []byte) ([]byte, error) + + FinalizeInboundTransfer(opts *bind.TransactOpts, _token common.Address, _from common.Address, _to common.Address, _amount *big.Int, _data []byte) (*types.Transaction, error) + + OutboundTransfer(opts *bind.TransactOpts, _token common.Address, _to common.Address, _amount *big.Int, _maxGas *big.Int, _gasPriceBid *big.Int, _data []byte) (*types.Transaction, error) + + Address() common.Address +} diff --git a/core/gethwrappers/liquiditymanager/generated/arbsys/arbsys.go b/core/gethwrappers/liquiditymanager/generated/arbsys/arbsys.go new file mode 100644 index 00000000000..fe9eb5e75bc --- /dev/null +++ b/core/gethwrappers/liquiditymanager/generated/arbsys/arbsys.go @@ -0,0 +1,940 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package arbsys + +import ( + "errors" + "fmt" + "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" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" +) + +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +var ArbSysMetaData = &bind.MetaData{ + ABI: "[{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"uniqueId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"batchNumber\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"indexInBatch\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"arbBlockNum\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"ethBlockNum\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"callvalue\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"L2ToL1Transaction\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"hash\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"position\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"arbBlockNum\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"ethBlockNum\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"callvalue\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"L2ToL1Tx\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"reserved\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"hash\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"position\",\"type\":\"uint256\"}],\"name\":\"SendMerkleUpdate\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"arbBlockNum\",\"type\":\"uint256\"}],\"name\":\"arbBlockHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"arbBlockNumber\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"arbChainID\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"arbOSVersion\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getStorageGasAvailable\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isTopLevelCall\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"unused\",\"type\":\"address\"}],\"name\":\"mapL1SenderContractAddressToL2Alias\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"myCallersAddressWithoutAliasing\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"sendMerkleTreeState\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"size\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"root\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32[]\",\"name\":\"partials\",\"type\":\"bytes32[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"sendTxToL1\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"wasMyCallersAddressAliased\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"name\":\"withdrawEth\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"}]", +} + +var ArbSysABI = ArbSysMetaData.ABI + +type ArbSys struct { + address common.Address + abi abi.ABI + ArbSysCaller + ArbSysTransactor + ArbSysFilterer +} + +type ArbSysCaller struct { + contract *bind.BoundContract +} + +type ArbSysTransactor struct { + contract *bind.BoundContract +} + +type ArbSysFilterer struct { + contract *bind.BoundContract +} + +type ArbSysSession struct { + Contract *ArbSys + CallOpts bind.CallOpts + TransactOpts bind.TransactOpts +} + +type ArbSysCallerSession struct { + Contract *ArbSysCaller + CallOpts bind.CallOpts +} + +type ArbSysTransactorSession struct { + Contract *ArbSysTransactor + TransactOpts bind.TransactOpts +} + +type ArbSysRaw struct { + Contract *ArbSys +} + +type ArbSysCallerRaw struct { + Contract *ArbSysCaller +} + +type ArbSysTransactorRaw struct { + Contract *ArbSysTransactor +} + +func NewArbSys(address common.Address, backend bind.ContractBackend) (*ArbSys, error) { + abi, err := abi.JSON(strings.NewReader(ArbSysABI)) + if err != nil { + return nil, err + } + contract, err := bindArbSys(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &ArbSys{address: address, abi: abi, ArbSysCaller: ArbSysCaller{contract: contract}, ArbSysTransactor: ArbSysTransactor{contract: contract}, ArbSysFilterer: ArbSysFilterer{contract: contract}}, nil +} + +func NewArbSysCaller(address common.Address, caller bind.ContractCaller) (*ArbSysCaller, error) { + contract, err := bindArbSys(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &ArbSysCaller{contract: contract}, nil +} + +func NewArbSysTransactor(address common.Address, transactor bind.ContractTransactor) (*ArbSysTransactor, error) { + contract, err := bindArbSys(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &ArbSysTransactor{contract: contract}, nil +} + +func NewArbSysFilterer(address common.Address, filterer bind.ContractFilterer) (*ArbSysFilterer, error) { + contract, err := bindArbSys(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &ArbSysFilterer{contract: contract}, nil +} + +func bindArbSys(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := ArbSysMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +func (_ArbSys *ArbSysRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _ArbSys.Contract.ArbSysCaller.contract.Call(opts, result, method, params...) +} + +func (_ArbSys *ArbSysRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _ArbSys.Contract.ArbSysTransactor.contract.Transfer(opts) +} + +func (_ArbSys *ArbSysRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _ArbSys.Contract.ArbSysTransactor.contract.Transact(opts, method, params...) +} + +func (_ArbSys *ArbSysCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _ArbSys.Contract.contract.Call(opts, result, method, params...) +} + +func (_ArbSys *ArbSysTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _ArbSys.Contract.contract.Transfer(opts) +} + +func (_ArbSys *ArbSysTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _ArbSys.Contract.contract.Transact(opts, method, params...) +} + +func (_ArbSys *ArbSysCaller) ArbBlockHash(opts *bind.CallOpts, arbBlockNum *big.Int) ([32]byte, error) { + var out []interface{} + err := _ArbSys.contract.Call(opts, &out, "arbBlockHash", arbBlockNum) + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +func (_ArbSys *ArbSysSession) ArbBlockHash(arbBlockNum *big.Int) ([32]byte, error) { + return _ArbSys.Contract.ArbBlockHash(&_ArbSys.CallOpts, arbBlockNum) +} + +func (_ArbSys *ArbSysCallerSession) ArbBlockHash(arbBlockNum *big.Int) ([32]byte, error) { + return _ArbSys.Contract.ArbBlockHash(&_ArbSys.CallOpts, arbBlockNum) +} + +func (_ArbSys *ArbSysCaller) ArbBlockNumber(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _ArbSys.contract.Call(opts, &out, "arbBlockNumber") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_ArbSys *ArbSysSession) ArbBlockNumber() (*big.Int, error) { + return _ArbSys.Contract.ArbBlockNumber(&_ArbSys.CallOpts) +} + +func (_ArbSys *ArbSysCallerSession) ArbBlockNumber() (*big.Int, error) { + return _ArbSys.Contract.ArbBlockNumber(&_ArbSys.CallOpts) +} + +func (_ArbSys *ArbSysCaller) ArbChainID(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _ArbSys.contract.Call(opts, &out, "arbChainID") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_ArbSys *ArbSysSession) ArbChainID() (*big.Int, error) { + return _ArbSys.Contract.ArbChainID(&_ArbSys.CallOpts) +} + +func (_ArbSys *ArbSysCallerSession) ArbChainID() (*big.Int, error) { + return _ArbSys.Contract.ArbChainID(&_ArbSys.CallOpts) +} + +func (_ArbSys *ArbSysCaller) ArbOSVersion(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _ArbSys.contract.Call(opts, &out, "arbOSVersion") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_ArbSys *ArbSysSession) ArbOSVersion() (*big.Int, error) { + return _ArbSys.Contract.ArbOSVersion(&_ArbSys.CallOpts) +} + +func (_ArbSys *ArbSysCallerSession) ArbOSVersion() (*big.Int, error) { + return _ArbSys.Contract.ArbOSVersion(&_ArbSys.CallOpts) +} + +func (_ArbSys *ArbSysCaller) GetStorageGasAvailable(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _ArbSys.contract.Call(opts, &out, "getStorageGasAvailable") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_ArbSys *ArbSysSession) GetStorageGasAvailable() (*big.Int, error) { + return _ArbSys.Contract.GetStorageGasAvailable(&_ArbSys.CallOpts) +} + +func (_ArbSys *ArbSysCallerSession) GetStorageGasAvailable() (*big.Int, error) { + return _ArbSys.Contract.GetStorageGasAvailable(&_ArbSys.CallOpts) +} + +func (_ArbSys *ArbSysCaller) IsTopLevelCall(opts *bind.CallOpts) (bool, error) { + var out []interface{} + err := _ArbSys.contract.Call(opts, &out, "isTopLevelCall") + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_ArbSys *ArbSysSession) IsTopLevelCall() (bool, error) { + return _ArbSys.Contract.IsTopLevelCall(&_ArbSys.CallOpts) +} + +func (_ArbSys *ArbSysCallerSession) IsTopLevelCall() (bool, error) { + return _ArbSys.Contract.IsTopLevelCall(&_ArbSys.CallOpts) +} + +func (_ArbSys *ArbSysCaller) MapL1SenderContractAddressToL2Alias(opts *bind.CallOpts, sender common.Address, unused common.Address) (common.Address, error) { + var out []interface{} + err := _ArbSys.contract.Call(opts, &out, "mapL1SenderContractAddressToL2Alias", sender, unused) + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_ArbSys *ArbSysSession) MapL1SenderContractAddressToL2Alias(sender common.Address, unused common.Address) (common.Address, error) { + return _ArbSys.Contract.MapL1SenderContractAddressToL2Alias(&_ArbSys.CallOpts, sender, unused) +} + +func (_ArbSys *ArbSysCallerSession) MapL1SenderContractAddressToL2Alias(sender common.Address, unused common.Address) (common.Address, error) { + return _ArbSys.Contract.MapL1SenderContractAddressToL2Alias(&_ArbSys.CallOpts, sender, unused) +} + +func (_ArbSys *ArbSysCaller) MyCallersAddressWithoutAliasing(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _ArbSys.contract.Call(opts, &out, "myCallersAddressWithoutAliasing") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_ArbSys *ArbSysSession) MyCallersAddressWithoutAliasing() (common.Address, error) { + return _ArbSys.Contract.MyCallersAddressWithoutAliasing(&_ArbSys.CallOpts) +} + +func (_ArbSys *ArbSysCallerSession) MyCallersAddressWithoutAliasing() (common.Address, error) { + return _ArbSys.Contract.MyCallersAddressWithoutAliasing(&_ArbSys.CallOpts) +} + +func (_ArbSys *ArbSysCaller) SendMerkleTreeState(opts *bind.CallOpts) (SendMerkleTreeState, + + error) { + var out []interface{} + err := _ArbSys.contract.Call(opts, &out, "sendMerkleTreeState") + + outstruct := new(SendMerkleTreeState) + if err != nil { + return *outstruct, err + } + + outstruct.Size = *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + outstruct.Root = *abi.ConvertType(out[1], new([32]byte)).(*[32]byte) + outstruct.Partials = *abi.ConvertType(out[2], new([][32]byte)).(*[][32]byte) + + return *outstruct, err + +} + +func (_ArbSys *ArbSysSession) SendMerkleTreeState() (SendMerkleTreeState, + + error) { + return _ArbSys.Contract.SendMerkleTreeState(&_ArbSys.CallOpts) +} + +func (_ArbSys *ArbSysCallerSession) SendMerkleTreeState() (SendMerkleTreeState, + + error) { + return _ArbSys.Contract.SendMerkleTreeState(&_ArbSys.CallOpts) +} + +func (_ArbSys *ArbSysCaller) WasMyCallersAddressAliased(opts *bind.CallOpts) (bool, error) { + var out []interface{} + err := _ArbSys.contract.Call(opts, &out, "wasMyCallersAddressAliased") + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_ArbSys *ArbSysSession) WasMyCallersAddressAliased() (bool, error) { + return _ArbSys.Contract.WasMyCallersAddressAliased(&_ArbSys.CallOpts) +} + +func (_ArbSys *ArbSysCallerSession) WasMyCallersAddressAliased() (bool, error) { + return _ArbSys.Contract.WasMyCallersAddressAliased(&_ArbSys.CallOpts) +} + +func (_ArbSys *ArbSysTransactor) SendTxToL1(opts *bind.TransactOpts, destination common.Address, data []byte) (*types.Transaction, error) { + return _ArbSys.contract.Transact(opts, "sendTxToL1", destination, data) +} + +func (_ArbSys *ArbSysSession) SendTxToL1(destination common.Address, data []byte) (*types.Transaction, error) { + return _ArbSys.Contract.SendTxToL1(&_ArbSys.TransactOpts, destination, data) +} + +func (_ArbSys *ArbSysTransactorSession) SendTxToL1(destination common.Address, data []byte) (*types.Transaction, error) { + return _ArbSys.Contract.SendTxToL1(&_ArbSys.TransactOpts, destination, data) +} + +func (_ArbSys *ArbSysTransactor) WithdrawEth(opts *bind.TransactOpts, destination common.Address) (*types.Transaction, error) { + return _ArbSys.contract.Transact(opts, "withdrawEth", destination) +} + +func (_ArbSys *ArbSysSession) WithdrawEth(destination common.Address) (*types.Transaction, error) { + return _ArbSys.Contract.WithdrawEth(&_ArbSys.TransactOpts, destination) +} + +func (_ArbSys *ArbSysTransactorSession) WithdrawEth(destination common.Address) (*types.Transaction, error) { + return _ArbSys.Contract.WithdrawEth(&_ArbSys.TransactOpts, destination) +} + +type ArbSysL2ToL1TransactionIterator struct { + Event *ArbSysL2ToL1Transaction + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *ArbSysL2ToL1TransactionIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(ArbSysL2ToL1Transaction) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(ArbSysL2ToL1Transaction) + 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() + } +} + +func (it *ArbSysL2ToL1TransactionIterator) Error() error { + return it.fail +} + +func (it *ArbSysL2ToL1TransactionIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type ArbSysL2ToL1Transaction struct { + Caller common.Address + Destination common.Address + UniqueId *big.Int + BatchNumber *big.Int + IndexInBatch *big.Int + ArbBlockNum *big.Int + EthBlockNum *big.Int + Timestamp *big.Int + Callvalue *big.Int + Data []byte + Raw types.Log +} + +func (_ArbSys *ArbSysFilterer) FilterL2ToL1Transaction(opts *bind.FilterOpts, destination []common.Address, uniqueId []*big.Int, batchNumber []*big.Int) (*ArbSysL2ToL1TransactionIterator, error) { + + var destinationRule []interface{} + for _, destinationItem := range destination { + destinationRule = append(destinationRule, destinationItem) + } + var uniqueIdRule []interface{} + for _, uniqueIdItem := range uniqueId { + uniqueIdRule = append(uniqueIdRule, uniqueIdItem) + } + var batchNumberRule []interface{} + for _, batchNumberItem := range batchNumber { + batchNumberRule = append(batchNumberRule, batchNumberItem) + } + + logs, sub, err := _ArbSys.contract.FilterLogs(opts, "L2ToL1Transaction", destinationRule, uniqueIdRule, batchNumberRule) + if err != nil { + return nil, err + } + return &ArbSysL2ToL1TransactionIterator{contract: _ArbSys.contract, event: "L2ToL1Transaction", logs: logs, sub: sub}, nil +} + +func (_ArbSys *ArbSysFilterer) WatchL2ToL1Transaction(opts *bind.WatchOpts, sink chan<- *ArbSysL2ToL1Transaction, destination []common.Address, uniqueId []*big.Int, batchNumber []*big.Int) (event.Subscription, error) { + + var destinationRule []interface{} + for _, destinationItem := range destination { + destinationRule = append(destinationRule, destinationItem) + } + var uniqueIdRule []interface{} + for _, uniqueIdItem := range uniqueId { + uniqueIdRule = append(uniqueIdRule, uniqueIdItem) + } + var batchNumberRule []interface{} + for _, batchNumberItem := range batchNumber { + batchNumberRule = append(batchNumberRule, batchNumberItem) + } + + logs, sub, err := _ArbSys.contract.WatchLogs(opts, "L2ToL1Transaction", destinationRule, uniqueIdRule, batchNumberRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(ArbSysL2ToL1Transaction) + if err := _ArbSys.contract.UnpackLog(event, "L2ToL1Transaction", 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 +} + +func (_ArbSys *ArbSysFilterer) ParseL2ToL1Transaction(log types.Log) (*ArbSysL2ToL1Transaction, error) { + event := new(ArbSysL2ToL1Transaction) + if err := _ArbSys.contract.UnpackLog(event, "L2ToL1Transaction", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type ArbSysL2ToL1TxIterator struct { + Event *ArbSysL2ToL1Tx + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *ArbSysL2ToL1TxIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(ArbSysL2ToL1Tx) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(ArbSysL2ToL1Tx) + 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() + } +} + +func (it *ArbSysL2ToL1TxIterator) Error() error { + return it.fail +} + +func (it *ArbSysL2ToL1TxIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type ArbSysL2ToL1Tx struct { + Caller common.Address + Destination common.Address + Hash *big.Int + Position *big.Int + ArbBlockNum *big.Int + EthBlockNum *big.Int + Timestamp *big.Int + Callvalue *big.Int + Data []byte + Raw types.Log +} + +func (_ArbSys *ArbSysFilterer) FilterL2ToL1Tx(opts *bind.FilterOpts, destination []common.Address, hash []*big.Int, position []*big.Int) (*ArbSysL2ToL1TxIterator, error) { + + var destinationRule []interface{} + for _, destinationItem := range destination { + destinationRule = append(destinationRule, destinationItem) + } + var hashRule []interface{} + for _, hashItem := range hash { + hashRule = append(hashRule, hashItem) + } + var positionRule []interface{} + for _, positionItem := range position { + positionRule = append(positionRule, positionItem) + } + + logs, sub, err := _ArbSys.contract.FilterLogs(opts, "L2ToL1Tx", destinationRule, hashRule, positionRule) + if err != nil { + return nil, err + } + return &ArbSysL2ToL1TxIterator{contract: _ArbSys.contract, event: "L2ToL1Tx", logs: logs, sub: sub}, nil +} + +func (_ArbSys *ArbSysFilterer) WatchL2ToL1Tx(opts *bind.WatchOpts, sink chan<- *ArbSysL2ToL1Tx, destination []common.Address, hash []*big.Int, position []*big.Int) (event.Subscription, error) { + + var destinationRule []interface{} + for _, destinationItem := range destination { + destinationRule = append(destinationRule, destinationItem) + } + var hashRule []interface{} + for _, hashItem := range hash { + hashRule = append(hashRule, hashItem) + } + var positionRule []interface{} + for _, positionItem := range position { + positionRule = append(positionRule, positionItem) + } + + logs, sub, err := _ArbSys.contract.WatchLogs(opts, "L2ToL1Tx", destinationRule, hashRule, positionRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(ArbSysL2ToL1Tx) + if err := _ArbSys.contract.UnpackLog(event, "L2ToL1Tx", 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 +} + +func (_ArbSys *ArbSysFilterer) ParseL2ToL1Tx(log types.Log) (*ArbSysL2ToL1Tx, error) { + event := new(ArbSysL2ToL1Tx) + if err := _ArbSys.contract.UnpackLog(event, "L2ToL1Tx", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type ArbSysSendMerkleUpdateIterator struct { + Event *ArbSysSendMerkleUpdate + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *ArbSysSendMerkleUpdateIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(ArbSysSendMerkleUpdate) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(ArbSysSendMerkleUpdate) + 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() + } +} + +func (it *ArbSysSendMerkleUpdateIterator) Error() error { + return it.fail +} + +func (it *ArbSysSendMerkleUpdateIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type ArbSysSendMerkleUpdate struct { + Reserved *big.Int + Hash [32]byte + Position *big.Int + Raw types.Log +} + +func (_ArbSys *ArbSysFilterer) FilterSendMerkleUpdate(opts *bind.FilterOpts, reserved []*big.Int, hash [][32]byte, position []*big.Int) (*ArbSysSendMerkleUpdateIterator, error) { + + var reservedRule []interface{} + for _, reservedItem := range reserved { + reservedRule = append(reservedRule, reservedItem) + } + var hashRule []interface{} + for _, hashItem := range hash { + hashRule = append(hashRule, hashItem) + } + var positionRule []interface{} + for _, positionItem := range position { + positionRule = append(positionRule, positionItem) + } + + logs, sub, err := _ArbSys.contract.FilterLogs(opts, "SendMerkleUpdate", reservedRule, hashRule, positionRule) + if err != nil { + return nil, err + } + return &ArbSysSendMerkleUpdateIterator{contract: _ArbSys.contract, event: "SendMerkleUpdate", logs: logs, sub: sub}, nil +} + +func (_ArbSys *ArbSysFilterer) WatchSendMerkleUpdate(opts *bind.WatchOpts, sink chan<- *ArbSysSendMerkleUpdate, reserved []*big.Int, hash [][32]byte, position []*big.Int) (event.Subscription, error) { + + var reservedRule []interface{} + for _, reservedItem := range reserved { + reservedRule = append(reservedRule, reservedItem) + } + var hashRule []interface{} + for _, hashItem := range hash { + hashRule = append(hashRule, hashItem) + } + var positionRule []interface{} + for _, positionItem := range position { + positionRule = append(positionRule, positionItem) + } + + logs, sub, err := _ArbSys.contract.WatchLogs(opts, "SendMerkleUpdate", reservedRule, hashRule, positionRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(ArbSysSendMerkleUpdate) + if err := _ArbSys.contract.UnpackLog(event, "SendMerkleUpdate", 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 +} + +func (_ArbSys *ArbSysFilterer) ParseSendMerkleUpdate(log types.Log) (*ArbSysSendMerkleUpdate, error) { + event := new(ArbSysSendMerkleUpdate) + if err := _ArbSys.contract.UnpackLog(event, "SendMerkleUpdate", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type SendMerkleTreeState struct { + Size *big.Int + Root [32]byte + Partials [][32]byte +} + +func (_ArbSys *ArbSys) ParseLog(log types.Log) (generated.AbigenLog, error) { + switch log.Topics[0] { + case _ArbSys.abi.Events["L2ToL1Transaction"].ID: + return _ArbSys.ParseL2ToL1Transaction(log) + case _ArbSys.abi.Events["L2ToL1Tx"].ID: + return _ArbSys.ParseL2ToL1Tx(log) + case _ArbSys.abi.Events["SendMerkleUpdate"].ID: + return _ArbSys.ParseSendMerkleUpdate(log) + + default: + return nil, fmt.Errorf("abigen wrapper received unknown log topic: %v", log.Topics[0]) + } +} + +func (ArbSysL2ToL1Transaction) Topic() common.Hash { + return common.HexToHash("0x5baaa87db386365b5c161be377bc3d8e317e8d98d71a3ca7ed7d555340c8f767") +} + +func (ArbSysL2ToL1Tx) Topic() common.Hash { + return common.HexToHash("0x3e7aafa77dbf186b7fd488006beff893744caa3c4f6f299e8a709fa2087374fc") +} + +func (ArbSysSendMerkleUpdate) Topic() common.Hash { + return common.HexToHash("0xe9e13da364699fb5b0496ff5a0fc70760ad5836e93ba96568a4e42b9914a8b95") +} + +func (_ArbSys *ArbSys) Address() common.Address { + return _ArbSys.address +} + +type ArbSysInterface interface { + ArbBlockHash(opts *bind.CallOpts, arbBlockNum *big.Int) ([32]byte, error) + + ArbBlockNumber(opts *bind.CallOpts) (*big.Int, error) + + ArbChainID(opts *bind.CallOpts) (*big.Int, error) + + ArbOSVersion(opts *bind.CallOpts) (*big.Int, error) + + GetStorageGasAvailable(opts *bind.CallOpts) (*big.Int, error) + + IsTopLevelCall(opts *bind.CallOpts) (bool, error) + + MapL1SenderContractAddressToL2Alias(opts *bind.CallOpts, sender common.Address, unused common.Address) (common.Address, error) + + MyCallersAddressWithoutAliasing(opts *bind.CallOpts) (common.Address, error) + + SendMerkleTreeState(opts *bind.CallOpts) (SendMerkleTreeState, + + error) + + WasMyCallersAddressAliased(opts *bind.CallOpts) (bool, error) + + SendTxToL1(opts *bind.TransactOpts, destination common.Address, data []byte) (*types.Transaction, error) + + WithdrawEth(opts *bind.TransactOpts, destination common.Address) (*types.Transaction, error) + + FilterL2ToL1Transaction(opts *bind.FilterOpts, destination []common.Address, uniqueId []*big.Int, batchNumber []*big.Int) (*ArbSysL2ToL1TransactionIterator, error) + + WatchL2ToL1Transaction(opts *bind.WatchOpts, sink chan<- *ArbSysL2ToL1Transaction, destination []common.Address, uniqueId []*big.Int, batchNumber []*big.Int) (event.Subscription, error) + + ParseL2ToL1Transaction(log types.Log) (*ArbSysL2ToL1Transaction, error) + + FilterL2ToL1Tx(opts *bind.FilterOpts, destination []common.Address, hash []*big.Int, position []*big.Int) (*ArbSysL2ToL1TxIterator, error) + + WatchL2ToL1Tx(opts *bind.WatchOpts, sink chan<- *ArbSysL2ToL1Tx, destination []common.Address, hash []*big.Int, position []*big.Int) (event.Subscription, error) + + ParseL2ToL1Tx(log types.Log) (*ArbSysL2ToL1Tx, error) + + FilterSendMerkleUpdate(opts *bind.FilterOpts, reserved []*big.Int, hash [][32]byte, position []*big.Int) (*ArbSysSendMerkleUpdateIterator, error) + + WatchSendMerkleUpdate(opts *bind.WatchOpts, sink chan<- *ArbSysSendMerkleUpdate, reserved []*big.Int, hash [][32]byte, position []*big.Int) (event.Subscription, error) + + ParseSendMerkleUpdate(log types.Log) (*ArbSysSendMerkleUpdate, error) + + ParseLog(log types.Log) (generated.AbigenLog, error) + + Address() common.Address +} diff --git a/core/gethwrappers/liquiditymanager/generated/l2_arbitrum_gateway/l2_arbitrum_gateway.go b/core/gethwrappers/liquiditymanager/generated/l2_arbitrum_gateway/l2_arbitrum_gateway.go new file mode 100644 index 00000000000..4e5ab36f5db --- /dev/null +++ b/core/gethwrappers/liquiditymanager/generated/l2_arbitrum_gateway/l2_arbitrum_gateway.go @@ -0,0 +1,823 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package l2_arbitrum_gateway + +import ( + "errors" + "fmt" + "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" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" +) + +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +var L2ArbitrumGatewayMetaData = &bind.MetaData{ + ABI: "[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"l1Token\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"DepositFinalized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"TxToL1\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"l1Token\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_l2ToL1Id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_exitNum\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"WithdrawalInitiated\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"l1ERC20\",\"type\":\"address\"}],\"name\":\"calculateL2TokenAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"counterpartGateway\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"exitNum\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_token\",\"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\":\"finalizeInboundTransfer\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_token\",\"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\":\"getOutboundCalldata\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"outboundCalldata\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_l1Token\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"outboundTransfer\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_l1Token\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"outboundTransfer\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"res\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"postUpgradeInit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"router\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", +} + +var L2ArbitrumGatewayABI = L2ArbitrumGatewayMetaData.ABI + +type L2ArbitrumGateway struct { + address common.Address + abi abi.ABI + L2ArbitrumGatewayCaller + L2ArbitrumGatewayTransactor + L2ArbitrumGatewayFilterer +} + +type L2ArbitrumGatewayCaller struct { + contract *bind.BoundContract +} + +type L2ArbitrumGatewayTransactor struct { + contract *bind.BoundContract +} + +type L2ArbitrumGatewayFilterer struct { + contract *bind.BoundContract +} + +type L2ArbitrumGatewaySession struct { + Contract *L2ArbitrumGateway + CallOpts bind.CallOpts + TransactOpts bind.TransactOpts +} + +type L2ArbitrumGatewayCallerSession struct { + Contract *L2ArbitrumGatewayCaller + CallOpts bind.CallOpts +} + +type L2ArbitrumGatewayTransactorSession struct { + Contract *L2ArbitrumGatewayTransactor + TransactOpts bind.TransactOpts +} + +type L2ArbitrumGatewayRaw struct { + Contract *L2ArbitrumGateway +} + +type L2ArbitrumGatewayCallerRaw struct { + Contract *L2ArbitrumGatewayCaller +} + +type L2ArbitrumGatewayTransactorRaw struct { + Contract *L2ArbitrumGatewayTransactor +} + +func NewL2ArbitrumGateway(address common.Address, backend bind.ContractBackend) (*L2ArbitrumGateway, error) { + abi, err := abi.JSON(strings.NewReader(L2ArbitrumGatewayABI)) + if err != nil { + return nil, err + } + contract, err := bindL2ArbitrumGateway(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &L2ArbitrumGateway{address: address, abi: abi, L2ArbitrumGatewayCaller: L2ArbitrumGatewayCaller{contract: contract}, L2ArbitrumGatewayTransactor: L2ArbitrumGatewayTransactor{contract: contract}, L2ArbitrumGatewayFilterer: L2ArbitrumGatewayFilterer{contract: contract}}, nil +} + +func NewL2ArbitrumGatewayCaller(address common.Address, caller bind.ContractCaller) (*L2ArbitrumGatewayCaller, error) { + contract, err := bindL2ArbitrumGateway(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &L2ArbitrumGatewayCaller{contract: contract}, nil +} + +func NewL2ArbitrumGatewayTransactor(address common.Address, transactor bind.ContractTransactor) (*L2ArbitrumGatewayTransactor, error) { + contract, err := bindL2ArbitrumGateway(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &L2ArbitrumGatewayTransactor{contract: contract}, nil +} + +func NewL2ArbitrumGatewayFilterer(address common.Address, filterer bind.ContractFilterer) (*L2ArbitrumGatewayFilterer, error) { + contract, err := bindL2ArbitrumGateway(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &L2ArbitrumGatewayFilterer{contract: contract}, nil +} + +func bindL2ArbitrumGateway(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := L2ArbitrumGatewayMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +func (_L2ArbitrumGateway *L2ArbitrumGatewayRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _L2ArbitrumGateway.Contract.L2ArbitrumGatewayCaller.contract.Call(opts, result, method, params...) +} + +func (_L2ArbitrumGateway *L2ArbitrumGatewayRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _L2ArbitrumGateway.Contract.L2ArbitrumGatewayTransactor.contract.Transfer(opts) +} + +func (_L2ArbitrumGateway *L2ArbitrumGatewayRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _L2ArbitrumGateway.Contract.L2ArbitrumGatewayTransactor.contract.Transact(opts, method, params...) +} + +func (_L2ArbitrumGateway *L2ArbitrumGatewayCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _L2ArbitrumGateway.Contract.contract.Call(opts, result, method, params...) +} + +func (_L2ArbitrumGateway *L2ArbitrumGatewayTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _L2ArbitrumGateway.Contract.contract.Transfer(opts) +} + +func (_L2ArbitrumGateway *L2ArbitrumGatewayTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _L2ArbitrumGateway.Contract.contract.Transact(opts, method, params...) +} + +func (_L2ArbitrumGateway *L2ArbitrumGatewayCaller) CalculateL2TokenAddress(opts *bind.CallOpts, l1ERC20 common.Address) (common.Address, error) { + var out []interface{} + err := _L2ArbitrumGateway.contract.Call(opts, &out, "calculateL2TokenAddress", l1ERC20) + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_L2ArbitrumGateway *L2ArbitrumGatewaySession) CalculateL2TokenAddress(l1ERC20 common.Address) (common.Address, error) { + return _L2ArbitrumGateway.Contract.CalculateL2TokenAddress(&_L2ArbitrumGateway.CallOpts, l1ERC20) +} + +func (_L2ArbitrumGateway *L2ArbitrumGatewayCallerSession) CalculateL2TokenAddress(l1ERC20 common.Address) (common.Address, error) { + return _L2ArbitrumGateway.Contract.CalculateL2TokenAddress(&_L2ArbitrumGateway.CallOpts, l1ERC20) +} + +func (_L2ArbitrumGateway *L2ArbitrumGatewayCaller) CounterpartGateway(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _L2ArbitrumGateway.contract.Call(opts, &out, "counterpartGateway") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_L2ArbitrumGateway *L2ArbitrumGatewaySession) CounterpartGateway() (common.Address, error) { + return _L2ArbitrumGateway.Contract.CounterpartGateway(&_L2ArbitrumGateway.CallOpts) +} + +func (_L2ArbitrumGateway *L2ArbitrumGatewayCallerSession) CounterpartGateway() (common.Address, error) { + return _L2ArbitrumGateway.Contract.CounterpartGateway(&_L2ArbitrumGateway.CallOpts) +} + +func (_L2ArbitrumGateway *L2ArbitrumGatewayCaller) ExitNum(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _L2ArbitrumGateway.contract.Call(opts, &out, "exitNum") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_L2ArbitrumGateway *L2ArbitrumGatewaySession) ExitNum() (*big.Int, error) { + return _L2ArbitrumGateway.Contract.ExitNum(&_L2ArbitrumGateway.CallOpts) +} + +func (_L2ArbitrumGateway *L2ArbitrumGatewayCallerSession) ExitNum() (*big.Int, error) { + return _L2ArbitrumGateway.Contract.ExitNum(&_L2ArbitrumGateway.CallOpts) +} + +func (_L2ArbitrumGateway *L2ArbitrumGatewayCaller) GetOutboundCalldata(opts *bind.CallOpts, _token common.Address, _from common.Address, _to common.Address, _amount *big.Int, _data []byte) ([]byte, error) { + var out []interface{} + err := _L2ArbitrumGateway.contract.Call(opts, &out, "getOutboundCalldata", _token, _from, _to, _amount, _data) + + if err != nil { + return *new([]byte), err + } + + out0 := *abi.ConvertType(out[0], new([]byte)).(*[]byte) + + return out0, err + +} + +func (_L2ArbitrumGateway *L2ArbitrumGatewaySession) GetOutboundCalldata(_token common.Address, _from common.Address, _to common.Address, _amount *big.Int, _data []byte) ([]byte, error) { + return _L2ArbitrumGateway.Contract.GetOutboundCalldata(&_L2ArbitrumGateway.CallOpts, _token, _from, _to, _amount, _data) +} + +func (_L2ArbitrumGateway *L2ArbitrumGatewayCallerSession) GetOutboundCalldata(_token common.Address, _from common.Address, _to common.Address, _amount *big.Int, _data []byte) ([]byte, error) { + return _L2ArbitrumGateway.Contract.GetOutboundCalldata(&_L2ArbitrumGateway.CallOpts, _token, _from, _to, _amount, _data) +} + +func (_L2ArbitrumGateway *L2ArbitrumGatewayCaller) Router(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _L2ArbitrumGateway.contract.Call(opts, &out, "router") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_L2ArbitrumGateway *L2ArbitrumGatewaySession) Router() (common.Address, error) { + return _L2ArbitrumGateway.Contract.Router(&_L2ArbitrumGateway.CallOpts) +} + +func (_L2ArbitrumGateway *L2ArbitrumGatewayCallerSession) Router() (common.Address, error) { + return _L2ArbitrumGateway.Contract.Router(&_L2ArbitrumGateway.CallOpts) +} + +func (_L2ArbitrumGateway *L2ArbitrumGatewayTransactor) FinalizeInboundTransfer(opts *bind.TransactOpts, _token common.Address, _from common.Address, _to common.Address, _amount *big.Int, _data []byte) (*types.Transaction, error) { + return _L2ArbitrumGateway.contract.Transact(opts, "finalizeInboundTransfer", _token, _from, _to, _amount, _data) +} + +func (_L2ArbitrumGateway *L2ArbitrumGatewaySession) FinalizeInboundTransfer(_token common.Address, _from common.Address, _to common.Address, _amount *big.Int, _data []byte) (*types.Transaction, error) { + return _L2ArbitrumGateway.Contract.FinalizeInboundTransfer(&_L2ArbitrumGateway.TransactOpts, _token, _from, _to, _amount, _data) +} + +func (_L2ArbitrumGateway *L2ArbitrumGatewayTransactorSession) FinalizeInboundTransfer(_token common.Address, _from common.Address, _to common.Address, _amount *big.Int, _data []byte) (*types.Transaction, error) { + return _L2ArbitrumGateway.Contract.FinalizeInboundTransfer(&_L2ArbitrumGateway.TransactOpts, _token, _from, _to, _amount, _data) +} + +func (_L2ArbitrumGateway *L2ArbitrumGatewayTransactor) OutboundTransfer(opts *bind.TransactOpts, _l1Token common.Address, _to common.Address, _amount *big.Int, _data []byte) (*types.Transaction, error) { + return _L2ArbitrumGateway.contract.Transact(opts, "outboundTransfer", _l1Token, _to, _amount, _data) +} + +func (_L2ArbitrumGateway *L2ArbitrumGatewaySession) OutboundTransfer(_l1Token common.Address, _to common.Address, _amount *big.Int, _data []byte) (*types.Transaction, error) { + return _L2ArbitrumGateway.Contract.OutboundTransfer(&_L2ArbitrumGateway.TransactOpts, _l1Token, _to, _amount, _data) +} + +func (_L2ArbitrumGateway *L2ArbitrumGatewayTransactorSession) OutboundTransfer(_l1Token common.Address, _to common.Address, _amount *big.Int, _data []byte) (*types.Transaction, error) { + return _L2ArbitrumGateway.Contract.OutboundTransfer(&_L2ArbitrumGateway.TransactOpts, _l1Token, _to, _amount, _data) +} + +func (_L2ArbitrumGateway *L2ArbitrumGatewayTransactor) OutboundTransfer0(opts *bind.TransactOpts, _l1Token common.Address, _to common.Address, _amount *big.Int, arg3 *big.Int, arg4 *big.Int, _data []byte) (*types.Transaction, error) { + return _L2ArbitrumGateway.contract.Transact(opts, "outboundTransfer0", _l1Token, _to, _amount, arg3, arg4, _data) +} + +func (_L2ArbitrumGateway *L2ArbitrumGatewaySession) OutboundTransfer0(_l1Token common.Address, _to common.Address, _amount *big.Int, arg3 *big.Int, arg4 *big.Int, _data []byte) (*types.Transaction, error) { + return _L2ArbitrumGateway.Contract.OutboundTransfer0(&_L2ArbitrumGateway.TransactOpts, _l1Token, _to, _amount, arg3, arg4, _data) +} + +func (_L2ArbitrumGateway *L2ArbitrumGatewayTransactorSession) OutboundTransfer0(_l1Token common.Address, _to common.Address, _amount *big.Int, arg3 *big.Int, arg4 *big.Int, _data []byte) (*types.Transaction, error) { + return _L2ArbitrumGateway.Contract.OutboundTransfer0(&_L2ArbitrumGateway.TransactOpts, _l1Token, _to, _amount, arg3, arg4, _data) +} + +func (_L2ArbitrumGateway *L2ArbitrumGatewayTransactor) PostUpgradeInit(opts *bind.TransactOpts) (*types.Transaction, error) { + return _L2ArbitrumGateway.contract.Transact(opts, "postUpgradeInit") +} + +func (_L2ArbitrumGateway *L2ArbitrumGatewaySession) PostUpgradeInit() (*types.Transaction, error) { + return _L2ArbitrumGateway.Contract.PostUpgradeInit(&_L2ArbitrumGateway.TransactOpts) +} + +func (_L2ArbitrumGateway *L2ArbitrumGatewayTransactorSession) PostUpgradeInit() (*types.Transaction, error) { + return _L2ArbitrumGateway.Contract.PostUpgradeInit(&_L2ArbitrumGateway.TransactOpts) +} + +type L2ArbitrumGatewayDepositFinalizedIterator struct { + Event *L2ArbitrumGatewayDepositFinalized + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *L2ArbitrumGatewayDepositFinalizedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(L2ArbitrumGatewayDepositFinalized) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(L2ArbitrumGatewayDepositFinalized) + 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() + } +} + +func (it *L2ArbitrumGatewayDepositFinalizedIterator) Error() error { + return it.fail +} + +func (it *L2ArbitrumGatewayDepositFinalizedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type L2ArbitrumGatewayDepositFinalized struct { + L1Token common.Address + From common.Address + To common.Address + Amount *big.Int + Raw types.Log +} + +func (_L2ArbitrumGateway *L2ArbitrumGatewayFilterer) FilterDepositFinalized(opts *bind.FilterOpts, l1Token []common.Address, _from []common.Address, _to []common.Address) (*L2ArbitrumGatewayDepositFinalizedIterator, error) { + + var l1TokenRule []interface{} + for _, l1TokenItem := range l1Token { + l1TokenRule = append(l1TokenRule, l1TokenItem) + } + var _fromRule []interface{} + for _, _fromItem := range _from { + _fromRule = append(_fromRule, _fromItem) + } + var _toRule []interface{} + for _, _toItem := range _to { + _toRule = append(_toRule, _toItem) + } + + logs, sub, err := _L2ArbitrumGateway.contract.FilterLogs(opts, "DepositFinalized", l1TokenRule, _fromRule, _toRule) + if err != nil { + return nil, err + } + return &L2ArbitrumGatewayDepositFinalizedIterator{contract: _L2ArbitrumGateway.contract, event: "DepositFinalized", logs: logs, sub: sub}, nil +} + +func (_L2ArbitrumGateway *L2ArbitrumGatewayFilterer) WatchDepositFinalized(opts *bind.WatchOpts, sink chan<- *L2ArbitrumGatewayDepositFinalized, l1Token []common.Address, _from []common.Address, _to []common.Address) (event.Subscription, error) { + + var l1TokenRule []interface{} + for _, l1TokenItem := range l1Token { + l1TokenRule = append(l1TokenRule, l1TokenItem) + } + var _fromRule []interface{} + for _, _fromItem := range _from { + _fromRule = append(_fromRule, _fromItem) + } + var _toRule []interface{} + for _, _toItem := range _to { + _toRule = append(_toRule, _toItem) + } + + logs, sub, err := _L2ArbitrumGateway.contract.WatchLogs(opts, "DepositFinalized", l1TokenRule, _fromRule, _toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(L2ArbitrumGatewayDepositFinalized) + if err := _L2ArbitrumGateway.contract.UnpackLog(event, "DepositFinalized", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +func (_L2ArbitrumGateway *L2ArbitrumGatewayFilterer) ParseDepositFinalized(log types.Log) (*L2ArbitrumGatewayDepositFinalized, error) { + event := new(L2ArbitrumGatewayDepositFinalized) + if err := _L2ArbitrumGateway.contract.UnpackLog(event, "DepositFinalized", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type L2ArbitrumGatewayTxToL1Iterator struct { + Event *L2ArbitrumGatewayTxToL1 + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *L2ArbitrumGatewayTxToL1Iterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(L2ArbitrumGatewayTxToL1) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(L2ArbitrumGatewayTxToL1) + 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() + } +} + +func (it *L2ArbitrumGatewayTxToL1Iterator) Error() error { + return it.fail +} + +func (it *L2ArbitrumGatewayTxToL1Iterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type L2ArbitrumGatewayTxToL1 struct { + From common.Address + To common.Address + Id *big.Int + Data []byte + Raw types.Log +} + +func (_L2ArbitrumGateway *L2ArbitrumGatewayFilterer) FilterTxToL1(opts *bind.FilterOpts, _from []common.Address, _to []common.Address, _id []*big.Int) (*L2ArbitrumGatewayTxToL1Iterator, error) { + + var _fromRule []interface{} + for _, _fromItem := range _from { + _fromRule = append(_fromRule, _fromItem) + } + var _toRule []interface{} + for _, _toItem := range _to { + _toRule = append(_toRule, _toItem) + } + var _idRule []interface{} + for _, _idItem := range _id { + _idRule = append(_idRule, _idItem) + } + + logs, sub, err := _L2ArbitrumGateway.contract.FilterLogs(opts, "TxToL1", _fromRule, _toRule, _idRule) + if err != nil { + return nil, err + } + return &L2ArbitrumGatewayTxToL1Iterator{contract: _L2ArbitrumGateway.contract, event: "TxToL1", logs: logs, sub: sub}, nil +} + +func (_L2ArbitrumGateway *L2ArbitrumGatewayFilterer) WatchTxToL1(opts *bind.WatchOpts, sink chan<- *L2ArbitrumGatewayTxToL1, _from []common.Address, _to []common.Address, _id []*big.Int) (event.Subscription, error) { + + var _fromRule []interface{} + for _, _fromItem := range _from { + _fromRule = append(_fromRule, _fromItem) + } + var _toRule []interface{} + for _, _toItem := range _to { + _toRule = append(_toRule, _toItem) + } + var _idRule []interface{} + for _, _idItem := range _id { + _idRule = append(_idRule, _idItem) + } + + logs, sub, err := _L2ArbitrumGateway.contract.WatchLogs(opts, "TxToL1", _fromRule, _toRule, _idRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(L2ArbitrumGatewayTxToL1) + if err := _L2ArbitrumGateway.contract.UnpackLog(event, "TxToL1", 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 +} + +func (_L2ArbitrumGateway *L2ArbitrumGatewayFilterer) ParseTxToL1(log types.Log) (*L2ArbitrumGatewayTxToL1, error) { + event := new(L2ArbitrumGatewayTxToL1) + if err := _L2ArbitrumGateway.contract.UnpackLog(event, "TxToL1", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type L2ArbitrumGatewayWithdrawalInitiatedIterator struct { + Event *L2ArbitrumGatewayWithdrawalInitiated + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *L2ArbitrumGatewayWithdrawalInitiatedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(L2ArbitrumGatewayWithdrawalInitiated) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(L2ArbitrumGatewayWithdrawalInitiated) + 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() + } +} + +func (it *L2ArbitrumGatewayWithdrawalInitiatedIterator) Error() error { + return it.fail +} + +func (it *L2ArbitrumGatewayWithdrawalInitiatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type L2ArbitrumGatewayWithdrawalInitiated struct { + L1Token common.Address + From common.Address + To common.Address + L2ToL1Id *big.Int + ExitNum *big.Int + Amount *big.Int + Raw types.Log +} + +func (_L2ArbitrumGateway *L2ArbitrumGatewayFilterer) FilterWithdrawalInitiated(opts *bind.FilterOpts, _from []common.Address, _to []common.Address, _l2ToL1Id []*big.Int) (*L2ArbitrumGatewayWithdrawalInitiatedIterator, error) { + + var _fromRule []interface{} + for _, _fromItem := range _from { + _fromRule = append(_fromRule, _fromItem) + } + var _toRule []interface{} + for _, _toItem := range _to { + _toRule = append(_toRule, _toItem) + } + var _l2ToL1IdRule []interface{} + for _, _l2ToL1IdItem := range _l2ToL1Id { + _l2ToL1IdRule = append(_l2ToL1IdRule, _l2ToL1IdItem) + } + + logs, sub, err := _L2ArbitrumGateway.contract.FilterLogs(opts, "WithdrawalInitiated", _fromRule, _toRule, _l2ToL1IdRule) + if err != nil { + return nil, err + } + return &L2ArbitrumGatewayWithdrawalInitiatedIterator{contract: _L2ArbitrumGateway.contract, event: "WithdrawalInitiated", logs: logs, sub: sub}, nil +} + +func (_L2ArbitrumGateway *L2ArbitrumGatewayFilterer) WatchWithdrawalInitiated(opts *bind.WatchOpts, sink chan<- *L2ArbitrumGatewayWithdrawalInitiated, _from []common.Address, _to []common.Address, _l2ToL1Id []*big.Int) (event.Subscription, error) { + + var _fromRule []interface{} + for _, _fromItem := range _from { + _fromRule = append(_fromRule, _fromItem) + } + var _toRule []interface{} + for _, _toItem := range _to { + _toRule = append(_toRule, _toItem) + } + var _l2ToL1IdRule []interface{} + for _, _l2ToL1IdItem := range _l2ToL1Id { + _l2ToL1IdRule = append(_l2ToL1IdRule, _l2ToL1IdItem) + } + + logs, sub, err := _L2ArbitrumGateway.contract.WatchLogs(opts, "WithdrawalInitiated", _fromRule, _toRule, _l2ToL1IdRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(L2ArbitrumGatewayWithdrawalInitiated) + if err := _L2ArbitrumGateway.contract.UnpackLog(event, "WithdrawalInitiated", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +func (_L2ArbitrumGateway *L2ArbitrumGatewayFilterer) ParseWithdrawalInitiated(log types.Log) (*L2ArbitrumGatewayWithdrawalInitiated, error) { + event := new(L2ArbitrumGatewayWithdrawalInitiated) + if err := _L2ArbitrumGateway.contract.UnpackLog(event, "WithdrawalInitiated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +func (_L2ArbitrumGateway *L2ArbitrumGateway) ParseLog(log types.Log) (generated.AbigenLog, error) { + switch log.Topics[0] { + case _L2ArbitrumGateway.abi.Events["DepositFinalized"].ID: + return _L2ArbitrumGateway.ParseDepositFinalized(log) + case _L2ArbitrumGateway.abi.Events["TxToL1"].ID: + return _L2ArbitrumGateway.ParseTxToL1(log) + case _L2ArbitrumGateway.abi.Events["WithdrawalInitiated"].ID: + return _L2ArbitrumGateway.ParseWithdrawalInitiated(log) + + default: + return nil, fmt.Errorf("abigen wrapper received unknown log topic: %v", log.Topics[0]) + } +} + +func (L2ArbitrumGatewayDepositFinalized) Topic() common.Hash { + return common.HexToHash("0xc7f2e9c55c40a50fbc217dfc70cd39a222940dfa62145aa0ca49eb9535d4fcb2") +} + +func (L2ArbitrumGatewayTxToL1) Topic() common.Hash { + return common.HexToHash("0x2b986d32a0536b7e19baa48ab949fec7b903b7fad7730820b20632d100cc3a68") +} + +func (L2ArbitrumGatewayWithdrawalInitiated) Topic() common.Hash { + return common.HexToHash("0x3073a74ecb728d10be779fe19a74a1428e20468f5b4d167bf9c73d9067847d73") +} + +func (_L2ArbitrumGateway *L2ArbitrumGateway) Address() common.Address { + return _L2ArbitrumGateway.address +} + +type L2ArbitrumGatewayInterface interface { + CalculateL2TokenAddress(opts *bind.CallOpts, l1ERC20 common.Address) (common.Address, error) + + CounterpartGateway(opts *bind.CallOpts) (common.Address, error) + + ExitNum(opts *bind.CallOpts) (*big.Int, error) + + GetOutboundCalldata(opts *bind.CallOpts, _token common.Address, _from common.Address, _to common.Address, _amount *big.Int, _data []byte) ([]byte, error) + + Router(opts *bind.CallOpts) (common.Address, error) + + FinalizeInboundTransfer(opts *bind.TransactOpts, _token common.Address, _from common.Address, _to common.Address, _amount *big.Int, _data []byte) (*types.Transaction, error) + + OutboundTransfer(opts *bind.TransactOpts, _l1Token common.Address, _to common.Address, _amount *big.Int, _data []byte) (*types.Transaction, error) + + OutboundTransfer0(opts *bind.TransactOpts, _l1Token common.Address, _to common.Address, _amount *big.Int, arg3 *big.Int, arg4 *big.Int, _data []byte) (*types.Transaction, error) + + PostUpgradeInit(opts *bind.TransactOpts) (*types.Transaction, error) + + FilterDepositFinalized(opts *bind.FilterOpts, l1Token []common.Address, _from []common.Address, _to []common.Address) (*L2ArbitrumGatewayDepositFinalizedIterator, error) + + WatchDepositFinalized(opts *bind.WatchOpts, sink chan<- *L2ArbitrumGatewayDepositFinalized, l1Token []common.Address, _from []common.Address, _to []common.Address) (event.Subscription, error) + + ParseDepositFinalized(log types.Log) (*L2ArbitrumGatewayDepositFinalized, error) + + FilterTxToL1(opts *bind.FilterOpts, _from []common.Address, _to []common.Address, _id []*big.Int) (*L2ArbitrumGatewayTxToL1Iterator, error) + + WatchTxToL1(opts *bind.WatchOpts, sink chan<- *L2ArbitrumGatewayTxToL1, _from []common.Address, _to []common.Address, _id []*big.Int) (event.Subscription, error) + + ParseTxToL1(log types.Log) (*L2ArbitrumGatewayTxToL1, error) + + FilterWithdrawalInitiated(opts *bind.FilterOpts, _from []common.Address, _to []common.Address, _l2ToL1Id []*big.Int) (*L2ArbitrumGatewayWithdrawalInitiatedIterator, error) + + WatchWithdrawalInitiated(opts *bind.WatchOpts, sink chan<- *L2ArbitrumGatewayWithdrawalInitiated, _from []common.Address, _to []common.Address, _l2ToL1Id []*big.Int) (event.Subscription, error) + + ParseWithdrawalInitiated(log types.Log) (*L2ArbitrumGatewayWithdrawalInitiated, error) + + ParseLog(log types.Log) (generated.AbigenLog, error) + + Address() common.Address +} diff --git a/core/gethwrappers/liquiditymanager/generated/l2_arbitrum_messenger/l2_arbitrum_messenger.go b/core/gethwrappers/liquiditymanager/generated/l2_arbitrum_messenger/l2_arbitrum_messenger.go new file mode 100644 index 00000000000..4aa2952efcf --- /dev/null +++ b/core/gethwrappers/liquiditymanager/generated/l2_arbitrum_messenger/l2_arbitrum_messenger.go @@ -0,0 +1,329 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package l2_arbitrum_messenger + +import ( + "errors" + "fmt" + "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" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" +) + +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +var L2ArbitrumMessengerMetaData = &bind.MetaData{ + ABI: "[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"TxToL1\",\"type\":\"event\"}]", +} + +var L2ArbitrumMessengerABI = L2ArbitrumMessengerMetaData.ABI + +type L2ArbitrumMessenger struct { + address common.Address + abi abi.ABI + L2ArbitrumMessengerCaller + L2ArbitrumMessengerTransactor + L2ArbitrumMessengerFilterer +} + +type L2ArbitrumMessengerCaller struct { + contract *bind.BoundContract +} + +type L2ArbitrumMessengerTransactor struct { + contract *bind.BoundContract +} + +type L2ArbitrumMessengerFilterer struct { + contract *bind.BoundContract +} + +type L2ArbitrumMessengerSession struct { + Contract *L2ArbitrumMessenger + CallOpts bind.CallOpts + TransactOpts bind.TransactOpts +} + +type L2ArbitrumMessengerCallerSession struct { + Contract *L2ArbitrumMessengerCaller + CallOpts bind.CallOpts +} + +type L2ArbitrumMessengerTransactorSession struct { + Contract *L2ArbitrumMessengerTransactor + TransactOpts bind.TransactOpts +} + +type L2ArbitrumMessengerRaw struct { + Contract *L2ArbitrumMessenger +} + +type L2ArbitrumMessengerCallerRaw struct { + Contract *L2ArbitrumMessengerCaller +} + +type L2ArbitrumMessengerTransactorRaw struct { + Contract *L2ArbitrumMessengerTransactor +} + +func NewL2ArbitrumMessenger(address common.Address, backend bind.ContractBackend) (*L2ArbitrumMessenger, error) { + abi, err := abi.JSON(strings.NewReader(L2ArbitrumMessengerABI)) + if err != nil { + return nil, err + } + contract, err := bindL2ArbitrumMessenger(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &L2ArbitrumMessenger{address: address, abi: abi, L2ArbitrumMessengerCaller: L2ArbitrumMessengerCaller{contract: contract}, L2ArbitrumMessengerTransactor: L2ArbitrumMessengerTransactor{contract: contract}, L2ArbitrumMessengerFilterer: L2ArbitrumMessengerFilterer{contract: contract}}, nil +} + +func NewL2ArbitrumMessengerCaller(address common.Address, caller bind.ContractCaller) (*L2ArbitrumMessengerCaller, error) { + contract, err := bindL2ArbitrumMessenger(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &L2ArbitrumMessengerCaller{contract: contract}, nil +} + +func NewL2ArbitrumMessengerTransactor(address common.Address, transactor bind.ContractTransactor) (*L2ArbitrumMessengerTransactor, error) { + contract, err := bindL2ArbitrumMessenger(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &L2ArbitrumMessengerTransactor{contract: contract}, nil +} + +func NewL2ArbitrumMessengerFilterer(address common.Address, filterer bind.ContractFilterer) (*L2ArbitrumMessengerFilterer, error) { + contract, err := bindL2ArbitrumMessenger(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &L2ArbitrumMessengerFilterer{contract: contract}, nil +} + +func bindL2ArbitrumMessenger(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := L2ArbitrumMessengerMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +func (_L2ArbitrumMessenger *L2ArbitrumMessengerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _L2ArbitrumMessenger.Contract.L2ArbitrumMessengerCaller.contract.Call(opts, result, method, params...) +} + +func (_L2ArbitrumMessenger *L2ArbitrumMessengerRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _L2ArbitrumMessenger.Contract.L2ArbitrumMessengerTransactor.contract.Transfer(opts) +} + +func (_L2ArbitrumMessenger *L2ArbitrumMessengerRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _L2ArbitrumMessenger.Contract.L2ArbitrumMessengerTransactor.contract.Transact(opts, method, params...) +} + +func (_L2ArbitrumMessenger *L2ArbitrumMessengerCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _L2ArbitrumMessenger.Contract.contract.Call(opts, result, method, params...) +} + +func (_L2ArbitrumMessenger *L2ArbitrumMessengerTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _L2ArbitrumMessenger.Contract.contract.Transfer(opts) +} + +func (_L2ArbitrumMessenger *L2ArbitrumMessengerTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _L2ArbitrumMessenger.Contract.contract.Transact(opts, method, params...) +} + +type L2ArbitrumMessengerTxToL1Iterator struct { + Event *L2ArbitrumMessengerTxToL1 + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *L2ArbitrumMessengerTxToL1Iterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(L2ArbitrumMessengerTxToL1) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(L2ArbitrumMessengerTxToL1) + 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() + } +} + +func (it *L2ArbitrumMessengerTxToL1Iterator) Error() error { + return it.fail +} + +func (it *L2ArbitrumMessengerTxToL1Iterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type L2ArbitrumMessengerTxToL1 struct { + From common.Address + To common.Address + Id *big.Int + Data []byte + Raw types.Log +} + +func (_L2ArbitrumMessenger *L2ArbitrumMessengerFilterer) FilterTxToL1(opts *bind.FilterOpts, _from []common.Address, _to []common.Address, _id []*big.Int) (*L2ArbitrumMessengerTxToL1Iterator, error) { + + var _fromRule []interface{} + for _, _fromItem := range _from { + _fromRule = append(_fromRule, _fromItem) + } + var _toRule []interface{} + for _, _toItem := range _to { + _toRule = append(_toRule, _toItem) + } + var _idRule []interface{} + for _, _idItem := range _id { + _idRule = append(_idRule, _idItem) + } + + logs, sub, err := _L2ArbitrumMessenger.contract.FilterLogs(opts, "TxToL1", _fromRule, _toRule, _idRule) + if err != nil { + return nil, err + } + return &L2ArbitrumMessengerTxToL1Iterator{contract: _L2ArbitrumMessenger.contract, event: "TxToL1", logs: logs, sub: sub}, nil +} + +func (_L2ArbitrumMessenger *L2ArbitrumMessengerFilterer) WatchTxToL1(opts *bind.WatchOpts, sink chan<- *L2ArbitrumMessengerTxToL1, _from []common.Address, _to []common.Address, _id []*big.Int) (event.Subscription, error) { + + var _fromRule []interface{} + for _, _fromItem := range _from { + _fromRule = append(_fromRule, _fromItem) + } + var _toRule []interface{} + for _, _toItem := range _to { + _toRule = append(_toRule, _toItem) + } + var _idRule []interface{} + for _, _idItem := range _id { + _idRule = append(_idRule, _idItem) + } + + logs, sub, err := _L2ArbitrumMessenger.contract.WatchLogs(opts, "TxToL1", _fromRule, _toRule, _idRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(L2ArbitrumMessengerTxToL1) + if err := _L2ArbitrumMessenger.contract.UnpackLog(event, "TxToL1", 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 +} + +func (_L2ArbitrumMessenger *L2ArbitrumMessengerFilterer) ParseTxToL1(log types.Log) (*L2ArbitrumMessengerTxToL1, error) { + event := new(L2ArbitrumMessengerTxToL1) + if err := _L2ArbitrumMessenger.contract.UnpackLog(event, "TxToL1", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +func (_L2ArbitrumMessenger *L2ArbitrumMessenger) ParseLog(log types.Log) (generated.AbigenLog, error) { + switch log.Topics[0] { + case _L2ArbitrumMessenger.abi.Events["TxToL1"].ID: + return _L2ArbitrumMessenger.ParseTxToL1(log) + + default: + return nil, fmt.Errorf("abigen wrapper received unknown log topic: %v", log.Topics[0]) + } +} + +func (L2ArbitrumMessengerTxToL1) Topic() common.Hash { + return common.HexToHash("0x2b986d32a0536b7e19baa48ab949fec7b903b7fad7730820b20632d100cc3a68") +} + +func (_L2ArbitrumMessenger *L2ArbitrumMessenger) Address() common.Address { + return _L2ArbitrumMessenger.address +} + +type L2ArbitrumMessengerInterface interface { + FilterTxToL1(opts *bind.FilterOpts, _from []common.Address, _to []common.Address, _id []*big.Int) (*L2ArbitrumMessengerTxToL1Iterator, error) + + WatchTxToL1(opts *bind.WatchOpts, sink chan<- *L2ArbitrumMessengerTxToL1, _from []common.Address, _to []common.Address, _id []*big.Int) (event.Subscription, error) + + ParseTxToL1(log types.Log) (*L2ArbitrumMessengerTxToL1, error) + + ParseLog(log types.Log) (generated.AbigenLog, error) + + Address() common.Address +} diff --git a/core/gethwrappers/liquiditymanager/generated/liquiditymanager/liquiditymanager.go b/core/gethwrappers/liquiditymanager/generated/liquiditymanager/liquiditymanager.go new file mode 100644 index 00000000000..6c0cfd3f6f9 --- /dev/null +++ b/core/gethwrappers/liquiditymanager/generated/liquiditymanager/liquiditymanager.go @@ -0,0 +1,2878 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package liquiditymanager + +import ( + "errors" + "fmt" + "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" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" +) + +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +type ILiquidityManagerCrossChainRebalancerArgs struct { + RemoteRebalancer common.Address + LocalBridge common.Address + RemoteToken common.Address + RemoteChainSelector uint64 + Enabled bool +} + +type LiquidityManagerCrossChainRebalancer struct { + RemoteRebalancer common.Address + LocalBridge common.Address + RemoteToken common.Address + Enabled bool +} + +var LiquidityManagerMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"internalType\":\"contractIERC20\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"localChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"contractILiquidityContainer\",\"name\":\"localLiquidityContainer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"minimumLiquidity\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"finance\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"expected\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"actual\",\"type\":\"bytes32\"}],\"name\":\"ConfigDigestMismatch\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"EmptyReport\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expected\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"actual\",\"type\":\"uint256\"}],\"name\":\"ForkedChain\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"requested\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"available\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"reserve\",\"type\":\"uint256\"}],\"name\":\"InsufficientLiquidity\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"message\",\"type\":\"string\"}],\"name\":\"InvalidConfig\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"}],\"name\":\"InvalidRemoteChain\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"sequenceNumber\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"latestSequenceNumber\",\"type\":\"uint64\"}],\"name\":\"NonIncreasingSequenceNumber\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NonUniqueSignatures\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyFinanceRole\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OracleCannotBeZeroAddress\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"SignaturesOutOfRegistration\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TransferFailed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UnauthorizedSigner\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UnauthorizedTransmitter\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expected\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"actual\",\"type\":\"uint256\"}],\"name\":\"WrongMessageLength\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"WrongNumberOfSignatures\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddress\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroChainSelector\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"previousConfigBlockNumber\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"configCount\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"signers\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"transmitters\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"f\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"onchainConfig\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"offchainConfigVersion\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"offchainConfig\",\"type\":\"bytes\"}],\"name\":\"ConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"contractIBridgeAdapter\",\"name\":\"localBridge\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"remoteToken\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"remoteRebalancer\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"enabled\",\"type\":\"bool\"}],\"name\":\"CrossChainRebalancerSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"ocrSeqNum\",\"type\":\"uint64\"},{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"bridgeSpecificData\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"reason\",\"type\":\"bytes\"}],\"name\":\"FinalizationFailed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"ocrSeqNum\",\"type\":\"uint64\"},{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"bridgeSpecificData\",\"type\":\"bytes\"}],\"name\":\"FinalizationStepCompleted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"financeRole\",\"type\":\"address\"}],\"name\":\"FinanceRoleSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"provider\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"LiquidityAddedToContainer\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newLiquidityContainer\",\"type\":\"address\"}],\"name\":\"LiquidityContainerSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"remover\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"LiquidityRemovedFromContainer\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"ocrSeqNum\",\"type\":\"uint64\"},{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"fromChainSelector\",\"type\":\"uint64\"},{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"toChainSelector\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"bridgeSpecificData\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"bridgeReturnData\",\"type\":\"bytes\"}],\"name\":\"LiquidityTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldBalance\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newBalance\",\"type\":\"uint256\"}],\"name\":\"MinimumLiquiditySet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"depositor\",\"type\":\"address\"}],\"name\":\"NativeDeposited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"name\":\"NativeWithdrawn\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"sequenceNumber\",\"type\":\"uint64\"}],\"name\":\"Transmitted\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"addLiquidity\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAllCrossChainRebalancers\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"remoteRebalancer\",\"type\":\"address\"},{\"internalType\":\"contractIBridgeAdapter\",\"name\":\"localBridge\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"remoteToken\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"bool\",\"name\":\"enabled\",\"type\":\"bool\"}],\"internalType\":\"structILiquidityManager.CrossChainRebalancerArgs[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"}],\"name\":\"getCrossChainRebalancer\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"remoteRebalancer\",\"type\":\"address\"},{\"internalType\":\"contractIBridgeAdapter\",\"name\":\"localBridge\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"remoteToken\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"enabled\",\"type\":\"bool\"}],\"internalType\":\"structLiquidityManager.CrossChainRebalancer\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getFinanceRole\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getLiquidity\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"currentLiquidity\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getLocalLiquidityContainer\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getMinimumLiquidity\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getSupportedDestChains\",\"outputs\":[{\"internalType\":\"uint64[]\",\"name\":\"\",\"type\":\"uint64[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getTransmitters\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"i_localToken\",\"outputs\":[{\"internalType\":\"contractIERC20\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestConfigDetails\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"configCount\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"blockNumber\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestSequenceNumber\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"sequenceNumber\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"nativeBridgeFee\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"bridgeSpecificPayload\",\"type\":\"bytes\"}],\"name\":\"rebalanceLiquidity\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"shouldWrapNative\",\"type\":\"bool\"},{\"internalType\":\"bytes\",\"name\":\"bridgeSpecificPayload\",\"type\":\"bytes\"}],\"name\":\"receiveLiquidity\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"removeLiquidity\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"remoteRebalancer\",\"type\":\"address\"},{\"internalType\":\"contractIBridgeAdapter\",\"name\":\"localBridge\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"remoteToken\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"bool\",\"name\":\"enabled\",\"type\":\"bool\"}],\"internalType\":\"structILiquidityManager.CrossChainRebalancerArgs\",\"name\":\"crossChainLiqManager\",\"type\":\"tuple\"}],\"name\":\"setCrossChainRebalancer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"remoteRebalancer\",\"type\":\"address\"},{\"internalType\":\"contractIBridgeAdapter\",\"name\":\"localBridge\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"remoteToken\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"bool\",\"name\":\"enabled\",\"type\":\"bool\"}],\"internalType\":\"structILiquidityManager.CrossChainRebalancerArgs[]\",\"name\":\"crossChainRebalancers\",\"type\":\"tuple[]\"}],\"name\":\"setCrossChainRebalancers\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"finance\",\"type\":\"address\"}],\"name\":\"setFinanceRole\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractILiquidityContainer\",\"name\":\"localLiquidityContainer\",\"type\":\"address\"}],\"name\":\"setLocalLiquidityContainer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"minimumLiquidity\",\"type\":\"uint256\"}],\"name\":\"setMinimumLiquidity\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"signers\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"transmitters\",\"type\":\"address[]\"},{\"internalType\":\"uint8\",\"name\":\"f\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"onchainConfig\",\"type\":\"bytes\"},{\"internalType\":\"uint64\",\"name\":\"offchainConfigVersion\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"offchainConfig\",\"type\":\"bytes\"}],\"name\":\"setOCR3Config\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32[3]\",\"name\":\"reportContext\",\"type\":\"bytes32[3]\"},{\"internalType\":\"bytes\",\"name\":\"report\",\"type\":\"bytes\"},{\"internalType\":\"bytes32[]\",\"name\":\"rs\",\"type\":\"bytes32[]\"},{\"internalType\":\"bytes32[]\",\"name\":\"ss\",\"type\":\"bytes32[]\"},{\"internalType\":\"bytes32\",\"name\":\"rawVs\",\"type\":\"bytes32\"}],\"name\":\"transmit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"name\":\"withdrawERC20\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"addresspayable\",\"name\":\"destination\",\"type\":\"address\"}],\"name\":\"withdrawNative\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]", + Bin: "0x60e06040523480156200001157600080fd5b5060405162004b8538038062004b85833981016040819052620000349162000239565b33806000816200008b5760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000be57620000be8162000175565b505046608052506001600160401b038416600003620000f05760405163f89d762960e01b815260040160405180910390fd5b6001600160a01b03851615806200010e57506001600160a01b038316155b156200012d5760405163d92e233d60e01b815260040160405180910390fd5b6001600160a01b0394851660a0526001600160401b0390931660c052600b80549285166001600160a01b0319938416179055600855600c8054929093169116179055620002b8565b336001600160a01b03821603620001cf5760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640162000082565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b6001600160a01b03811681146200023657600080fd5b50565b600080600080600060a086880312156200025257600080fd5b85516200025f8162000220565b60208701519095506001600160401b03811681146200027d57600080fd5b6040870151909450620002908162000220565b606087015160808801519194509250620002aa8162000220565b809150509295509295909350565b60805160a05160c0516148576200032e6000396000818161321a01526133ef0152600081816104850152818161078201528181610a1f01528181610a6501528181611762015281816130f801528181613179015281816132a201526133400152600081816118ff015261194b01526148576000f3fe6080604052600436106101bb5760003560e01c8063791781f5116100ec578063b7e7fa051161008a578063f1c0461611610064578063f1c0461614610696578063f2fde38b146106d5578063f8c2d8fa146106f5578063fe65d5af1461071557600080fd5b8063b7e7fa051461062b578063b8ca8dd81461064b578063da9c0f961461066b57600080fd5b806383d34afe116100c657806383d34afe146105ab5780638da5cb5b146105c05780639c8f9f23146105eb578063b1dc65a41461060b57600080fd5b8063791781f51461052e57806379ba50971461055957806381ff70481461056e57600080fd5b806351c6590a116101595780636511d919116101335780636511d91914610473578063666cab8d146104cc5780636a11ee90146104ee578063706bf6451461050e57600080fd5b806351c6590a14610321578063568446e7146103415780635fc3ea0b1461045357600080fd5b80633275636e116101955780633275636e1461029f578063348759c1146102bf5780634f814d04146102e157806350a197d71461030157600080fd5b80630910a510146101ff578063181f5a7714610227578063282567b41461027d57600080fd5b366101fa57604080513481523360208201527f3c597f6ac9fe7f0ed6da50b07618f5850a642e459ad587f7fab491a71f8b0ab8910160405180910390a1005b600080fd5b34801561020b57600080fd5b50610214610737565b6040519081526020015b60405180910390f35b34801561023357600080fd5b506102706040518060400160405280601a81526020017f4c69717569646974794d616e6167657220312e302e302d64657600000000000081525081565b60405161021e91906139c6565b34801561028957600080fd5b5061029d6102983660046139e0565b6107f2565b005b3480156102ab57600080fd5b5061029d6102ba3660046139f9565b61083f565b3480156102cb57600080fd5b506102d4610853565b60405161021e9190613a11565b3480156102ed57600080fd5b5061029d6102fc366004613a81565b6108df565b34801561030d57600080fd5b5061029d61031c366004613b12565b610960565b34801561032d57600080fd5b5061029d61033c3660046139e0565b610a05565b34801561034d57600080fd5b5061040461035c366004613b83565b6040805160808101825260008082526020820181905291810182905260608101919091525067ffffffffffffffff166000908152600960209081526040918290208251608081018452815473ffffffffffffffffffffffffffffffffffffffff908116825260018301548116938201939093526002909101549182169281019290925274010000000000000000000000000000000000000000900460ff161515606082015290565b60408051825173ffffffffffffffffffffffffffffffffffffffff908116825260208085015182169083015283830151169181019190915260609182015115159181019190915260800161021e565b34801561045f57600080fd5b5061029d61046e366004613b9e565b610b42565b34801561047f57600080fd5b506104a77f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161021e565b3480156104d857600080fd5b506104e1610bb9565b60405161021e9190613c32565b3480156104fa57600080fd5b5061029d610509366004613e53565b610c27565b34801561051a57600080fd5b5061029d610529366004613a81565b61145b565b34801561053a57600080fd5b50600b5473ffffffffffffffffffffffffffffffffffffffff166104a7565b34801561056557600080fd5b5061029d61151f565b34801561057a57600080fd5b506004546002546040805163ffffffff8085168252640100000000909404909316602084015282015260600161021e565b3480156105b757600080fd5b50600854610214565b3480156105cc57600080fd5b5060005473ffffffffffffffffffffffffffffffffffffffff166104a7565b3480156105f757600080fd5b5061029d6106063660046139e0565b61161c565b34801561061757600080fd5b5061029d610626366004613f65565b6117bc565b34801561063757600080fd5b5061029d61064636600461401c565b611e2d565b34801561065757600080fd5b5061029d610666366004614091565b611e68565b34801561067757600080fd5b50600c5473ffffffffffffffffffffffffffffffffffffffff166104a7565b3480156106a257600080fd5b5060045468010000000000000000900467ffffffffffffffff1660405167ffffffffffffffff909116815260200161021e565b3480156106e157600080fd5b5061029d6106f0366004613a81565b611fa6565b34801561070157600080fd5b5061029d6107103660046140c1565b611fb7565b34801561072157600080fd5b5061072a612053565b60405161021e919061410c565b600b546040517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff91821660048201526000917f000000000000000000000000000000000000000000000000000000000000000016906370a0823190602401602060405180830381865afa1580156107c9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107ed91906141a1565b905090565b6107fa612214565b600880549082905560408051828152602081018490527ff97e758c8b3d81df7b0e1b7327a6a7fcf09a41536b2d274b9103015d715f11eb910160405180910390a15050565b610847612214565b61085081612297565b50565b6060600a8054806020026020016040519081016040528092919081815260200182805480156108d557602002820191906000526020600020906000905b82829054906101000a900467ffffffffffffffff1667ffffffffffffffff16815260200190600801906020826007010492830192600103820291508084116108905790505b5050505050905090565b6108e7612214565b600c80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83169081179091556040519081527f58024d20c07d3ebb87b192861d337d3a60995665acc5b8ce29596458b1f251709060200160405180910390a150565b600c5473ffffffffffffffffffffffffffffffffffffffff1633146109b1576040517fb2a59b2700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6109fe858584848080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525089925067ffffffffffffffff91506126939050565b5050505050565b610a4773ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016333084612918565b600b54610a8e9073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000081169116836129fa565b600b546040517feb521a4c0000000000000000000000000000000000000000000000000000000081526004810183905273ffffffffffffffffffffffffffffffffffffffff9091169063eb521a4c90602401600060405180830381600087803b158015610afa57600080fd5b505af1158015610b0e573d6000803e3d6000fd5b50506040518392503391507f5414b81d05ac3542606f164e16a9a107d05d21e906539cc5ceb61d7b6b707eb590600090a350565b600c5473ffffffffffffffffffffffffffffffffffffffff163314610b93576040517fb2a59b2700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610bb473ffffffffffffffffffffffffffffffffffffffff84168284612b7c565b505050565b606060078054806020026020016040519081016040528092919081815260200182805480156108d557602002820191906000526020600020905b815473ffffffffffffffffffffffffffffffffffffffff168152600190910190602001808311610bf3575050505050905090565b855185518560ff16601f831115610c9f576040517f89a6198900000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f746f6f206d616e79207369676e6572730000000000000000000000000000000060448201526064015b60405180910390fd5b80600003610d09576040517f89a6198900000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f66206d75737420626520706f73697469766500000000000000000000000000006044820152606401610c96565b818314610d97576040517f89a61989000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f6f7261636c6520616464726573736573206f7574206f6620726567697374726160448201527f74696f6e000000000000000000000000000000000000000000000000000000006064820152608401610c96565b610da28160036141e9565b8311610e0a576040517f89a6198900000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f6661756c74792d6f7261636c65206620746f6f206869676800000000000000006044820152606401610c96565b610e12612214565b60065460005b81811015610f06576005600060068381548110610e3757610e37614206565b600091825260208083209091015473ffffffffffffffffffffffffffffffffffffffff168352820192909252604001812080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000016905560078054600592919084908110610ea757610ea7614206565b600091825260208083209091015473ffffffffffffffffffffffffffffffffffffffff168352820192909252604001902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000169055600101610e18565b50895160005b818110156112d95760008c8281518110610f2857610f28614206565b6020026020010151905060006002811115610f4557610f45614235565b73ffffffffffffffffffffffffffffffffffffffff8216600090815260056020526040902054610100900460ff166002811115610f8457610f84614235565b14610feb576040517f89a6198900000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f7265706561746564207369676e657220616464726573730000000000000000006044820152606401610c96565b73ffffffffffffffffffffffffffffffffffffffff8116611038576040517fd6c62c9b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040805180820190915260ff83168152602081016001905273ffffffffffffffffffffffffffffffffffffffff821660009081526005602090815260409091208251815460ff9091167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0082168117835592840151919283917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000016176101008360028111156110e8576110e8614235565b021790555090505060008c838151811061110457611104614206565b602002602001015190506000600281111561112157611121614235565b73ffffffffffffffffffffffffffffffffffffffff8216600090815260056020526040902054610100900460ff16600281111561116057611160614235565b146111c7576040517f89a6198900000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f7265706561746564207472616e736d69747465722061646472657373000000006044820152606401610c96565b73ffffffffffffffffffffffffffffffffffffffff8116611214576040517fd6c62c9b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040805180820190915260ff84168152602081016002905273ffffffffffffffffffffffffffffffffffffffff821660009081526005602090815260409091208251815460ff9091167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0082168117835592840151919283917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000016176101008360028111156112c4576112c4614235565b02179055509050505050806001019050610f0c565b508a516112ed9060069060208e019061389a565b5089516113019060079060208d019061389a565b506003805460ff838116610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000909216908c1617179055600480546113879146913091906000906113599063ffffffff16614264565b91906101000a81548163ffffffff021916908363ffffffff160217905563ffffffff168e8e8e8e8e8e612bd2565b600260000181905550600060048054906101000a900463ffffffff169050436004806101000a81548163ffffffff021916908363ffffffff1602179055506000600460086101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055507f1591690b8638f5fb2dbec82ac741805ac5da8b45dc5263f4875b0496fdce4e0581600260000154600460009054906101000a900463ffffffff168f8f8f8f8f8f60405161144599989796959493929190614287565b60405180910390a1505050505050505050505050565b611463612214565b73ffffffffffffffffffffffffffffffffffffffff81166114b0576040517fd92e233d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600b80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83169081179091556040517f07dc474694ac40123aadcd2445f1b38d2eb353edd9319dcea043548ab34990ec90600090a250565b60015473ffffffffffffffffffffffffffffffffffffffff1633146115a0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e6572000000000000000000006044820152606401610c96565b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b600c5473ffffffffffffffffffffffffffffffffffffffff16331461166d576040517fb2a59b2700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000611677610737565b9050818110156116c4576040517fd54d0fc4000000000000000000000000000000000000000000000000000000008152600481018390526024810182905260006044820152606401610c96565b600b546040517f0a861f2a0000000000000000000000000000000000000000000000000000000081526004810184905273ffffffffffffffffffffffffffffffffffffffff90911690630a861f2a90602401600060405180830381600087803b15801561173057600080fd5b505af1158015611744573d6000803e3d6000fd5b5061178b92505073ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001690503384612b7c565b604051829033907f2bda316674f8d73d289689d7a3acdf8e353b7a142fb5a68ac2aa475104039c1890600090a35050565b60045460208901359067ffffffffffffffff6801000000000000000090910481169082161161183f57600480546040517f6e376b6600000000000000000000000000000000000000000000000000000000815267ffffffffffffffff80851693820193909352680100000000000000009091049091166024820152604401610c96565b61184a888883612c7d565b600480547fffffffffffffffffffffffffffffffff0000000000000000ffffffffffffffff166801000000000000000067ffffffffffffffff8416021790556040805160608101825260025480825260035460ff808216602085015261010090910416928201929092528a359182146118fc5780516040517f93df584c000000000000000000000000000000000000000000000000000000008152600481019190915260248101839052604401610c96565b467f00000000000000000000000000000000000000000000000000000000000000001461197d576040517f0f01ce850000000000000000000000000000000000000000000000000000000081527f00000000000000000000000000000000000000000000000000000000000000006004820152466024820152604401610c96565b6040805183815267ffffffffffffffff851660208201527fe893c2681d327421d89e1cb54fbe64645b4dcea668d6826130b62cf4c6eefea2910160405180910390a160208101516119cf90600161431d565b60ff168714611a0a576040517f71253a2500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b868514611a43576040517fa75d88af00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b3360009081526005602090815260408083208151808301909252805460ff80821684529293919291840191610100909104166002811115611a8657611a86614235565b6002811115611a9757611a97614235565b9052509050600281602001516002811115611ab457611ab4614235565b148015611afb57506007816000015160ff1681548110611ad657611ad6614206565b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff1633145b611b31576040517fda0f08e800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b506000611b3f8660206141e9565b611b4a8960206141e9565b611b568c610144614336565b611b609190614336565b611b6a9190614336565b9050368114611bae576040517f8e1192e100000000000000000000000000000000000000000000000000000000815260048101829052366024820152604401610c96565b5060008a8a604051611bc1929190614349565b604051908190038120611bd8918e90602001614359565b604051602081830303815290604052805190602001209050611bf8613924565b8860005b81811015611e1c5760006001858a8460208110611c1b57611c1b614206565b611c2891901a601b61431d565b8f8f86818110611c3a57611c3a614206565b905060200201358e8e87818110611c5357611c53614206565b9050602002013560405160008152602001604052604051611c90949392919093845260ff9290921660208401526040830152606082015260800190565b6020604051602081039080840390855afa158015611cb2573d6000803e3d6000fd5b5050604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081015173ffffffffffffffffffffffffffffffffffffffff8116600090815260056020908152848220848601909552845460ff8082168652939750919550929392840191610100909104166002811115611d3557611d35614235565b6002811115611d4657611d46614235565b9052509050600181602001516002811115611d6357611d63614235565b14611d9a576040517fca31867a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8051859060ff16601f8110611db157611db1614206565b602002015115611ded576040517ff67bc7c400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600185826000015160ff16601f8110611e0857611e08614206565b911515602090920201525050600101611bfc565b505050505050505050505050505050565b611e35612214565b60005b81811015610bb457611e60838383818110611e5557611e55614206565b905060a00201612297565b600101611e38565b600c5473ffffffffffffffffffffffffffffffffffffffff163314611eb9576040517fb2a59b2700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008173ffffffffffffffffffffffffffffffffffffffff168360405160006040518083038185875af1925050503d8060008114611f13576040519150601f19603f3d011682016040523d82523d6000602084013e611f18565b606091505b5050905080611f53576040517f90b8ec1800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040805184815273ffffffffffffffffffffffffffffffffffffffff841660208201527f6b84d241b711af111ecfa0e518239e6ca212da442a76548fe8a1f4e77518256a910160405180910390a1505050565b611fae612214565b61085081612e2c565b600c5473ffffffffffffffffffffffffffffffffffffffff163314612008576040517fb2a59b2700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6109fe85858567ffffffffffffffff86868080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250612f2192505050565b600a5460609060008167ffffffffffffffff81111561207457612074613c45565b6040519080825280602002602001820160405280156120eb57816020015b6040805160a0810182526000808252602080830182905292820181905260608201819052608082015282527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9092019101816120925790505b50905060005b8281101561220d576000600a828154811061210e5761210e614206565b6000918252602080832060048304015460039092166008026101000a90910467ffffffffffffffff1680835260098252604092839020835160808082018652825473ffffffffffffffffffffffffffffffffffffffff9081168352600184015481168387019081526002909401548082168489019081527401000000000000000000000000000000000000000090910460ff1615156060808601918252895160a081018b528651851681529651841698870198909852905190911696840196909652938201839052935115159281019290925285519093508590859081106121f8576121f8614206565b602090810291909101015250506001016120f1565b5092915050565b60005473ffffffffffffffffffffffffffffffffffffffff163314612295576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e6572000000000000000000006044820152606401610c96565b565b6122a76080820160608301613b83565b67ffffffffffffffff166000036122ea576040517ff89d762900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006122f96020830183613a81565b73ffffffffffffffffffffffffffffffffffffffff161480612340575060006123286040830160208401613a81565b73ffffffffffffffffffffffffffffffffffffffff16145b80612370575060006123586060830160408401613a81565b73ffffffffffffffffffffffffffffffffffffffff16145b156123a7576040517fd92e233d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006009816123bc6080850160608601613b83565b67ffffffffffffffff16815260208101919091526040016000206002015473ffffffffffffffffffffffffffffffffffffffff160361244857600a6124076080830160608401613b83565b8154600181018355600092835260209092206004830401805460039093166008026101000a67ffffffffffffffff8181021990941692909316929092021790555b6040805160808101909152806124616020840184613a81565b73ffffffffffffffffffffffffffffffffffffffff16815260200182602001602081019061248f9190613a81565b73ffffffffffffffffffffffffffffffffffffffff1681526020016124ba6060840160408501613a81565b73ffffffffffffffffffffffffffffffffffffffff1681526020016124e560a084016080850161436d565b15159052600960006124fd6080850160608601613b83565b67ffffffffffffffff16815260208082019290925260409081016000208351815473ffffffffffffffffffffffffffffffffffffffff9182167fffffffffffffffffffffffff00000000000000000000000000000000000000009182161783559385015160018301805491831691909516179093559083015160029091018054606094850151151574010000000000000000000000000000000000000000027fffffffffffffffffffffff00000000000000000000000000000000000000000090911692909316919091179190911790556125de9060808301908301613b83565b67ffffffffffffffff167fab9bd0e4888101232b8f09dae2952ff59a6eea4a19fbddf2a8ca7b23f0e4cb406126196040840160208501613a81565b6126296060850160408601613a81565b6126366020860186613a81565b61264660a087016080880161436d565b604051612688949392919073ffffffffffffffffffffffffffffffffffffffff9485168152928416602084015292166040820152901515606082015260800190565b60405180910390a250565b67ffffffffffffffff85166000908152600960209081526040918290208251608081018452815473ffffffffffffffffffffffffffffffffffffffff908116825260018301548116938201939093526002909101549182169281019290925274010000000000000000000000000000000000000000900460ff16151560608201819052612758576040517fc9ff038f00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff87166004820152602401610c96565b602081015181516040517f38314bb200000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff909216916338314bb2916127b4913090899060040161438a565b6020604051808303816000875af192505050801561280d575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820190925261280a918101906143cc565b60015b612896573d80801561283b576040519150601f19603f3d011682016040523d82523d6000602084013e612840565b606091505b508667ffffffffffffffff168367ffffffffffffffff167fa481d91c3f9574c23ee84fef85246354b760a0527a535d6382354e4684703ce387846040516128889291906143e9565b60405180910390a350612903565b80156128ae576128a9868489888861329a565b6128fc565b8667ffffffffffffffff168367ffffffffffffffff167f8d3121fe961b40270f336aa75feb1213f1c979a33993311c60da4dd0f24526cf876040516128f391906139c6565b60405180910390a35b50506109fe565b612910858388878761329a565b505050505050565b60405173ffffffffffffffffffffffffffffffffffffffff808516602483015283166044820152606481018290526129f49085907f23b872dd00000000000000000000000000000000000000000000000000000000906084015b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152613481565b50505050565b801580612a9a57506040517fdd62ed3e00000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff838116602483015284169063dd62ed3e90604401602060405180830381865afa158015612a74573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a9891906141a1565b155b612b26576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527f20746f206e6f6e2d7a65726f20616c6c6f77616e6365000000000000000000006064820152608401610c96565b60405173ffffffffffffffffffffffffffffffffffffffff8316602482015260448101829052610bb49084907f095ea7b30000000000000000000000000000000000000000000000000000000090606401612972565b60405173ffffffffffffffffffffffffffffffffffffffff8316602482015260448101829052610bb49084907fa9059cbb0000000000000000000000000000000000000000000000000000000090606401612972565b6000808a8a8a8a8a8a8a8a8a604051602001612bf69998979695949392919061440e565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815291905280516020909101207dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167e01000000000000000000000000000000000000000000000000000000000000179150509998505050505050505050565b6000612c8b838501856145ab565b8051516020820151519192509081158015612ca4575080155b15612cda576040517ebf199700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b82811015612d7e57612d7684600001518281518110612cfe57612cfe614206565b60200260200101516040015185600001518381518110612d2057612d20614206565b60200260200101516000015186600001518481518110612d4257612d42614206565b6020026020010151602001518888600001518681518110612d6557612d65614206565b602002602001015160600151612f21565b600101612cdd565b5060005b81811015612e2357612e1b84602001518281518110612da357612da3614206565b60200260200101516020015185602001518381518110612dc557612dc5614206565b60200260200101516000015186602001518481518110612de757612de7614206565b60200260200101516060015187602001518581518110612e0957612e09614206565b60200260200101516040015189612693565b600101612d82565b50505050505050565b3373ffffffffffffffffffffffffffffffffffffffff821603612eab576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c660000000000000000006044820152606401610c96565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b6000612f2b610737565b60085490915080821080612f47575085612f45828461471f565b105b15612f8f576040517fd54d0fc4000000000000000000000000000000000000000000000000000000008152600481018790526024810183905260448101829052606401610c96565b67ffffffffffffffff87166000908152600960209081526040918290208251608081018452815473ffffffffffffffffffffffffffffffffffffffff908116825260018301548116938201939093526002909101549182169281019290925274010000000000000000000000000000000000000000900460ff16151560608201819052613054576040517fc9ff038f00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff89166004820152602401610c96565b600b546040517f0a861f2a0000000000000000000000000000000000000000000000000000000081526004810189905273ffffffffffffffffffffffffffffffffffffffff90911690630a861f2a90602401600060405180830381600087803b1580156130c057600080fd5b505af11580156130d4573d6000803e3d6000fd5b505050602082015161311f915073ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001690896129fa565b6020810151604080830151835191517fa71d98b700000000000000000000000000000000000000000000000000000000815260009373ffffffffffffffffffffffffffffffffffffffff169263a71d98b7928b926131a6927f000000000000000000000000000000000000000000000000000000000000000092918f908d90600401614732565b60006040518083038185885af11580156131c4573d6000803e3d6000fd5b50505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820160405261320b9190810190614779565b90508867ffffffffffffffff167f000000000000000000000000000000000000000000000000000000000000000067ffffffffffffffff168767ffffffffffffffff167f2a0b69eaf1b415ca57005b4f87582ddefc6d960325ff30dc62a9b3e1e1e5b8a885600001518c8a8760405161328794939291906147e7565b60405180910390a4505050505050505050565b8015613322577f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663d0e30db0866040518263ffffffff1660e01b81526004016000604051808303818588803b15801561330857600080fd5b505af115801561331c573d6000803e3d6000fd5b50505050505b600b546133699073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000811691168761358d565b600b546040517feb521a4c0000000000000000000000000000000000000000000000000000000081526004810187905273ffffffffffffffffffffffffffffffffffffffff9091169063eb521a4c90602401600060405180830381600087803b1580156133d557600080fd5b505af11580156133e9573d6000803e3d6000fd5b505050507f000000000000000000000000000000000000000000000000000000000000000067ffffffffffffffff168367ffffffffffffffff168567ffffffffffffffff167f2a0b69eaf1b415ca57005b4f87582ddefc6d960325ff30dc62a9b3e1e1e5b8a83089876040518060200160405280600081525060405161347294939291906147e7565b60405180910390a45050505050565b60006134e3826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff1661368b9092919063ffffffff16565b805190915015610bb4578080602001905181019061350191906143cc565b610bb4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610c96565b6040517fdd62ed3e00000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff8381166024830152600091839186169063dd62ed3e90604401602060405180830381865afa158015613604573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061362891906141a1565b6136329190614336565b60405173ffffffffffffffffffffffffffffffffffffffff85166024820152604481018290529091506129f49085907f095ea7b30000000000000000000000000000000000000000000000000000000090606401612972565b606061369a84846000856136a2565b949350505050565b606082471015613734576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610c96565b6000808673ffffffffffffffffffffffffffffffffffffffff16858760405161375d919061482e565b60006040518083038185875af1925050503d806000811461379a576040519150601f19603f3d011682016040523d82523d6000602084013e61379f565b606091505b50915091506137b0878383876137bb565b979650505050505050565b6060831561385157825160000361384a5773ffffffffffffffffffffffffffffffffffffffff85163b61384a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610c96565b508161369a565b61369a83838151156138665781518083602001fd5b806040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c9691906139c6565b828054828255906000526020600020908101928215613914579160200282015b8281111561391457825182547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff9091161782556020909201916001909101906138ba565b50613920929150613943565b5090565b604051806103e00160405280601f906020820280368337509192915050565b5b808211156139205760008155600101613944565b60005b8381101561397357818101518382015260200161395b565b50506000910152565b60008151808452613994816020860160208601613958565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b6020815260006139d9602083018461397c565b9392505050565b6000602082840312156139f257600080fd5b5035919050565b600060a08284031215613a0b57600080fd5b50919050565b6020808252825182820181905260009190848201906040850190845b81811015613a5357835167ffffffffffffffff1683529284019291840191600101613a2d565b50909695505050505050565b73ffffffffffffffffffffffffffffffffffffffff8116811461085057600080fd5b600060208284031215613a9357600080fd5b81356139d981613a5f565b803567ffffffffffffffff81168114613ab657600080fd5b919050565b801515811461085057600080fd5b60008083601f840112613adb57600080fd5b50813567ffffffffffffffff811115613af357600080fd5b602083019150836020828501011115613b0b57600080fd5b9250929050565b600080600080600060808688031215613b2a57600080fd5b613b3386613a9e565b9450602086013593506040860135613b4a81613abb565b9250606086013567ffffffffffffffff811115613b6657600080fd5b613b7288828901613ac9565b969995985093965092949392505050565b600060208284031215613b9557600080fd5b6139d982613a9e565b600080600060608486031215613bb357600080fd5b8335613bbe81613a5f565b9250602084013591506040840135613bd581613a5f565b809150509250925092565b60008151808452602080850194506020840160005b83811015613c2757815173ffffffffffffffffffffffffffffffffffffffff1687529582019590820190600101613bf5565b509495945050505050565b6020815260006139d96020830184613be0565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040516080810167ffffffffffffffff81118282101715613c9757613c97613c45565b60405290565b6040805190810167ffffffffffffffff81118282101715613c9757613c97613c45565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715613d0757613d07613c45565b604052919050565b600067ffffffffffffffff821115613d2957613d29613c45565b5060051b60200190565b600082601f830112613d4457600080fd5b81356020613d59613d5483613d0f565b613cc0565b8083825260208201915060208460051b870101935086841115613d7b57600080fd5b602086015b84811015613da0578035613d9381613a5f565b8352918301918301613d80565b509695505050505050565b803560ff81168114613ab657600080fd5b600067ffffffffffffffff821115613dd657613dd6613c45565b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b600082601f830112613e1357600080fd5b8135613e21613d5482613dbc565b818152846020838601011115613e3657600080fd5b816020850160208301376000918101602001919091529392505050565b60008060008060008060c08789031215613e6c57600080fd5b863567ffffffffffffffff80821115613e8457600080fd5b613e908a838b01613d33565b97506020890135915080821115613ea657600080fd5b613eb28a838b01613d33565b9650613ec060408a01613dab565b95506060890135915080821115613ed657600080fd5b613ee28a838b01613e02565b9450613ef060808a01613a9e565b935060a0890135915080821115613f0657600080fd5b50613f1389828a01613e02565b9150509295509295509295565b60008083601f840112613f3257600080fd5b50813567ffffffffffffffff811115613f4a57600080fd5b6020830191508360208260051b8501011115613b0b57600080fd5b60008060008060008060008060e0898b031215613f8157600080fd5b606089018a811115613f9257600080fd5b8998503567ffffffffffffffff80821115613fac57600080fd5b613fb88c838d01613ac9565b909950975060808b0135915080821115613fd157600080fd5b613fdd8c838d01613f20565b909750955060a08b0135915080821115613ff657600080fd5b506140038b828c01613f20565b999c989b50969995989497949560c00135949350505050565b6000806020838503121561402f57600080fd5b823567ffffffffffffffff8082111561404757600080fd5b818501915085601f83011261405b57600080fd5b81358181111561406a57600080fd5b86602060a08302850101111561407f57600080fd5b60209290920196919550909350505050565b600080604083850312156140a457600080fd5b8235915060208301356140b681613a5f565b809150509250929050565b6000806000806000608086880312156140d957600080fd5b6140e286613a9e565b94506020860135935060408601359250606086013567ffffffffffffffff811115613b6657600080fd5b602080825282518282018190526000919060409081850190868401855b82811015614194578151805173ffffffffffffffffffffffffffffffffffffffff90811686528782015181168887015286820151168686015260608082015167ffffffffffffffff169086015260809081015115159085015260a09093019290850190600101614129565b5091979650505050505050565b6000602082840312156141b357600080fd5b5051919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8082028115828204841417614200576142006141ba565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b600063ffffffff80831681810361427d5761427d6141ba565b6001019392505050565b600061012063ffffffff808d1684528b6020850152808b166040850152508060608401526142b78184018a613be0565b905082810360808401526142cb8189613be0565b905060ff871660a084015282810360c08401526142e8818761397c565b905067ffffffffffffffff851660e084015282810361010084015261430d818561397c565b9c9b505050505050505050505050565b60ff8181168382160190811115614200576142006141ba565b80820180821115614200576142006141ba565b8183823760009101908152919050565b828152606082602083013760800192915050565b60006020828403121561437f57600080fd5b81356139d981613abb565b600073ffffffffffffffffffffffffffffffffffffffff8086168352808516602084015250606060408301526143c3606083018461397c565b95945050505050565b6000602082840312156143de57600080fd5b81516139d981613abb565b6040815260006143fc604083018561397c565b82810360208401526143c3818561397c565b60006101208b835273ffffffffffffffffffffffffffffffffffffffff8b16602084015267ffffffffffffffff808b1660408501528160608501526144558285018b613be0565b91508382036080850152614469828a613be0565b915060ff881660a085015283820360c0850152614486828861397c565b90861660e0850152838103610100850152905061430d818561397c565b600082601f8301126144b457600080fd5b813560206144c4613d5483613d0f565b82815260059290921b840181019181810190868411156144e357600080fd5b8286015b84811015613da057803567ffffffffffffffff808211156145085760008081fd5b81890191506080807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0848d030112156145415760008081fd5b614549613c74565b878401358152604061455c818601613a9e565b8983015260608086013561456f81613abb565b8383015292850135928484111561458857600091508182fd5b6145968e8b86890101613e02565b908301525086525050509183019183016144e7565b600060208083850312156145be57600080fd5b823567ffffffffffffffff808211156145d657600080fd5b90840190604082870312156145ea57600080fd5b6145f2613c9d565b82358281111561460157600080fd5b8301601f8101881361461257600080fd5b8035614620613d5482613d0f565b81815260059190911b8201860190868101908a83111561463f57600080fd5b8784015b838110156146eb5780358781111561465a57600080fd5b85016080818e037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe001121561468e57600080fd5b614696613c74565b8a820135815260408201358b8201526146b160608301613a9e565b60408201526080820135898111156146c95760008081fd5b6146d78f8d83860101613e02565b606083015250845250918801918801614643565b508452505050828401358281111561470257600080fd5b61470e888286016144a3565b948201949094529695505050505050565b81810381811115614200576142006141ba565b600073ffffffffffffffffffffffffffffffffffffffff8088168352808716602084015280861660408401525083606083015260a060808301526137b060a083018461397c565b60006020828403121561478b57600080fd5b815167ffffffffffffffff8111156147a257600080fd5b8201601f810184136147b357600080fd5b80516147c1613d5482613dbc565b8181528560208385010111156147d657600080fd5b6143c3826020830160208601613958565b73ffffffffffffffffffffffffffffffffffffffff8516815283602082015260806040820152600061481c608083018561397c565b82810360608401526137b0818561397c565b60008251614840818460208701613958565b919091019291505056fea164736f6c6343000818000a", +} + +var LiquidityManagerABI = LiquidityManagerMetaData.ABI + +var LiquidityManagerBin = LiquidityManagerMetaData.Bin + +func DeployLiquidityManager(auth *bind.TransactOpts, backend bind.ContractBackend, token common.Address, localChainSelector uint64, localLiquidityContainer common.Address, minimumLiquidity *big.Int, finance common.Address) (common.Address, *types.Transaction, *LiquidityManager, error) { + parsed, err := LiquidityManagerMetaData.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(LiquidityManagerBin), backend, token, localChainSelector, localLiquidityContainer, minimumLiquidity, finance) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &LiquidityManager{address: address, abi: *parsed, LiquidityManagerCaller: LiquidityManagerCaller{contract: contract}, LiquidityManagerTransactor: LiquidityManagerTransactor{contract: contract}, LiquidityManagerFilterer: LiquidityManagerFilterer{contract: contract}}, nil +} + +type LiquidityManager struct { + address common.Address + abi abi.ABI + LiquidityManagerCaller + LiquidityManagerTransactor + LiquidityManagerFilterer +} + +type LiquidityManagerCaller struct { + contract *bind.BoundContract +} + +type LiquidityManagerTransactor struct { + contract *bind.BoundContract +} + +type LiquidityManagerFilterer struct { + contract *bind.BoundContract +} + +type LiquidityManagerSession struct { + Contract *LiquidityManager + CallOpts bind.CallOpts + TransactOpts bind.TransactOpts +} + +type LiquidityManagerCallerSession struct { + Contract *LiquidityManagerCaller + CallOpts bind.CallOpts +} + +type LiquidityManagerTransactorSession struct { + Contract *LiquidityManagerTransactor + TransactOpts bind.TransactOpts +} + +type LiquidityManagerRaw struct { + Contract *LiquidityManager +} + +type LiquidityManagerCallerRaw struct { + Contract *LiquidityManagerCaller +} + +type LiquidityManagerTransactorRaw struct { + Contract *LiquidityManagerTransactor +} + +func NewLiquidityManager(address common.Address, backend bind.ContractBackend) (*LiquidityManager, error) { + abi, err := abi.JSON(strings.NewReader(LiquidityManagerABI)) + if err != nil { + return nil, err + } + contract, err := bindLiquidityManager(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &LiquidityManager{address: address, abi: abi, LiquidityManagerCaller: LiquidityManagerCaller{contract: contract}, LiquidityManagerTransactor: LiquidityManagerTransactor{contract: contract}, LiquidityManagerFilterer: LiquidityManagerFilterer{contract: contract}}, nil +} + +func NewLiquidityManagerCaller(address common.Address, caller bind.ContractCaller) (*LiquidityManagerCaller, error) { + contract, err := bindLiquidityManager(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &LiquidityManagerCaller{contract: contract}, nil +} + +func NewLiquidityManagerTransactor(address common.Address, transactor bind.ContractTransactor) (*LiquidityManagerTransactor, error) { + contract, err := bindLiquidityManager(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &LiquidityManagerTransactor{contract: contract}, nil +} + +func NewLiquidityManagerFilterer(address common.Address, filterer bind.ContractFilterer) (*LiquidityManagerFilterer, error) { + contract, err := bindLiquidityManager(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &LiquidityManagerFilterer{contract: contract}, nil +} + +func bindLiquidityManager(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := LiquidityManagerMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +func (_LiquidityManager *LiquidityManagerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _LiquidityManager.Contract.LiquidityManagerCaller.contract.Call(opts, result, method, params...) +} + +func (_LiquidityManager *LiquidityManagerRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _LiquidityManager.Contract.LiquidityManagerTransactor.contract.Transfer(opts) +} + +func (_LiquidityManager *LiquidityManagerRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _LiquidityManager.Contract.LiquidityManagerTransactor.contract.Transact(opts, method, params...) +} + +func (_LiquidityManager *LiquidityManagerCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _LiquidityManager.Contract.contract.Call(opts, result, method, params...) +} + +func (_LiquidityManager *LiquidityManagerTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _LiquidityManager.Contract.contract.Transfer(opts) +} + +func (_LiquidityManager *LiquidityManagerTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _LiquidityManager.Contract.contract.Transact(opts, method, params...) +} + +func (_LiquidityManager *LiquidityManagerCaller) GetAllCrossChainRebalancers(opts *bind.CallOpts) ([]ILiquidityManagerCrossChainRebalancerArgs, error) { + var out []interface{} + err := _LiquidityManager.contract.Call(opts, &out, "getAllCrossChainRebalancers") + + if err != nil { + return *new([]ILiquidityManagerCrossChainRebalancerArgs), err + } + + out0 := *abi.ConvertType(out[0], new([]ILiquidityManagerCrossChainRebalancerArgs)).(*[]ILiquidityManagerCrossChainRebalancerArgs) + + return out0, err + +} + +func (_LiquidityManager *LiquidityManagerSession) GetAllCrossChainRebalancers() ([]ILiquidityManagerCrossChainRebalancerArgs, error) { + return _LiquidityManager.Contract.GetAllCrossChainRebalancers(&_LiquidityManager.CallOpts) +} + +func (_LiquidityManager *LiquidityManagerCallerSession) GetAllCrossChainRebalancers() ([]ILiquidityManagerCrossChainRebalancerArgs, error) { + return _LiquidityManager.Contract.GetAllCrossChainRebalancers(&_LiquidityManager.CallOpts) +} + +func (_LiquidityManager *LiquidityManagerCaller) GetCrossChainRebalancer(opts *bind.CallOpts, chainSelector uint64) (LiquidityManagerCrossChainRebalancer, error) { + var out []interface{} + err := _LiquidityManager.contract.Call(opts, &out, "getCrossChainRebalancer", chainSelector) + + if err != nil { + return *new(LiquidityManagerCrossChainRebalancer), err + } + + out0 := *abi.ConvertType(out[0], new(LiquidityManagerCrossChainRebalancer)).(*LiquidityManagerCrossChainRebalancer) + + return out0, err + +} + +func (_LiquidityManager *LiquidityManagerSession) GetCrossChainRebalancer(chainSelector uint64) (LiquidityManagerCrossChainRebalancer, error) { + return _LiquidityManager.Contract.GetCrossChainRebalancer(&_LiquidityManager.CallOpts, chainSelector) +} + +func (_LiquidityManager *LiquidityManagerCallerSession) GetCrossChainRebalancer(chainSelector uint64) (LiquidityManagerCrossChainRebalancer, error) { + return _LiquidityManager.Contract.GetCrossChainRebalancer(&_LiquidityManager.CallOpts, chainSelector) +} + +func (_LiquidityManager *LiquidityManagerCaller) GetFinanceRole(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _LiquidityManager.contract.Call(opts, &out, "getFinanceRole") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_LiquidityManager *LiquidityManagerSession) GetFinanceRole() (common.Address, error) { + return _LiquidityManager.Contract.GetFinanceRole(&_LiquidityManager.CallOpts) +} + +func (_LiquidityManager *LiquidityManagerCallerSession) GetFinanceRole() (common.Address, error) { + return _LiquidityManager.Contract.GetFinanceRole(&_LiquidityManager.CallOpts) +} + +func (_LiquidityManager *LiquidityManagerCaller) GetLiquidity(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _LiquidityManager.contract.Call(opts, &out, "getLiquidity") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_LiquidityManager *LiquidityManagerSession) GetLiquidity() (*big.Int, error) { + return _LiquidityManager.Contract.GetLiquidity(&_LiquidityManager.CallOpts) +} + +func (_LiquidityManager *LiquidityManagerCallerSession) GetLiquidity() (*big.Int, error) { + return _LiquidityManager.Contract.GetLiquidity(&_LiquidityManager.CallOpts) +} + +func (_LiquidityManager *LiquidityManagerCaller) GetLocalLiquidityContainer(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _LiquidityManager.contract.Call(opts, &out, "getLocalLiquidityContainer") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_LiquidityManager *LiquidityManagerSession) GetLocalLiquidityContainer() (common.Address, error) { + return _LiquidityManager.Contract.GetLocalLiquidityContainer(&_LiquidityManager.CallOpts) +} + +func (_LiquidityManager *LiquidityManagerCallerSession) GetLocalLiquidityContainer() (common.Address, error) { + return _LiquidityManager.Contract.GetLocalLiquidityContainer(&_LiquidityManager.CallOpts) +} + +func (_LiquidityManager *LiquidityManagerCaller) GetMinimumLiquidity(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _LiquidityManager.contract.Call(opts, &out, "getMinimumLiquidity") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_LiquidityManager *LiquidityManagerSession) GetMinimumLiquidity() (*big.Int, error) { + return _LiquidityManager.Contract.GetMinimumLiquidity(&_LiquidityManager.CallOpts) +} + +func (_LiquidityManager *LiquidityManagerCallerSession) GetMinimumLiquidity() (*big.Int, error) { + return _LiquidityManager.Contract.GetMinimumLiquidity(&_LiquidityManager.CallOpts) +} + +func (_LiquidityManager *LiquidityManagerCaller) GetSupportedDestChains(opts *bind.CallOpts) ([]uint64, error) { + var out []interface{} + err := _LiquidityManager.contract.Call(opts, &out, "getSupportedDestChains") + + if err != nil { + return *new([]uint64), err + } + + out0 := *abi.ConvertType(out[0], new([]uint64)).(*[]uint64) + + return out0, err + +} + +func (_LiquidityManager *LiquidityManagerSession) GetSupportedDestChains() ([]uint64, error) { + return _LiquidityManager.Contract.GetSupportedDestChains(&_LiquidityManager.CallOpts) +} + +func (_LiquidityManager *LiquidityManagerCallerSession) GetSupportedDestChains() ([]uint64, error) { + return _LiquidityManager.Contract.GetSupportedDestChains(&_LiquidityManager.CallOpts) +} + +func (_LiquidityManager *LiquidityManagerCaller) GetTransmitters(opts *bind.CallOpts) ([]common.Address, error) { + var out []interface{} + err := _LiquidityManager.contract.Call(opts, &out, "getTransmitters") + + if err != nil { + return *new([]common.Address), err + } + + out0 := *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) + + return out0, err + +} + +func (_LiquidityManager *LiquidityManagerSession) GetTransmitters() ([]common.Address, error) { + return _LiquidityManager.Contract.GetTransmitters(&_LiquidityManager.CallOpts) +} + +func (_LiquidityManager *LiquidityManagerCallerSession) GetTransmitters() ([]common.Address, error) { + return _LiquidityManager.Contract.GetTransmitters(&_LiquidityManager.CallOpts) +} + +func (_LiquidityManager *LiquidityManagerCaller) ILocalToken(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _LiquidityManager.contract.Call(opts, &out, "i_localToken") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_LiquidityManager *LiquidityManagerSession) ILocalToken() (common.Address, error) { + return _LiquidityManager.Contract.ILocalToken(&_LiquidityManager.CallOpts) +} + +func (_LiquidityManager *LiquidityManagerCallerSession) ILocalToken() (common.Address, error) { + return _LiquidityManager.Contract.ILocalToken(&_LiquidityManager.CallOpts) +} + +func (_LiquidityManager *LiquidityManagerCaller) LatestConfigDetails(opts *bind.CallOpts) (LatestConfigDetails, + + error) { + var out []interface{} + err := _LiquidityManager.contract.Call(opts, &out, "latestConfigDetails") + + outstruct := new(LatestConfigDetails) + if err != nil { + return *outstruct, err + } + + outstruct.ConfigCount = *abi.ConvertType(out[0], new(uint32)).(*uint32) + outstruct.BlockNumber = *abi.ConvertType(out[1], new(uint32)).(*uint32) + outstruct.ConfigDigest = *abi.ConvertType(out[2], new([32]byte)).(*[32]byte) + + return *outstruct, err + +} + +func (_LiquidityManager *LiquidityManagerSession) LatestConfigDetails() (LatestConfigDetails, + + error) { + return _LiquidityManager.Contract.LatestConfigDetails(&_LiquidityManager.CallOpts) +} + +func (_LiquidityManager *LiquidityManagerCallerSession) LatestConfigDetails() (LatestConfigDetails, + + error) { + return _LiquidityManager.Contract.LatestConfigDetails(&_LiquidityManager.CallOpts) +} + +func (_LiquidityManager *LiquidityManagerCaller) LatestSequenceNumber(opts *bind.CallOpts) (uint64, error) { + var out []interface{} + err := _LiquidityManager.contract.Call(opts, &out, "latestSequenceNumber") + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +func (_LiquidityManager *LiquidityManagerSession) LatestSequenceNumber() (uint64, error) { + return _LiquidityManager.Contract.LatestSequenceNumber(&_LiquidityManager.CallOpts) +} + +func (_LiquidityManager *LiquidityManagerCallerSession) LatestSequenceNumber() (uint64, error) { + return _LiquidityManager.Contract.LatestSequenceNumber(&_LiquidityManager.CallOpts) +} + +func (_LiquidityManager *LiquidityManagerCaller) Owner(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _LiquidityManager.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 + +} + +func (_LiquidityManager *LiquidityManagerSession) Owner() (common.Address, error) { + return _LiquidityManager.Contract.Owner(&_LiquidityManager.CallOpts) +} + +func (_LiquidityManager *LiquidityManagerCallerSession) Owner() (common.Address, error) { + return _LiquidityManager.Contract.Owner(&_LiquidityManager.CallOpts) +} + +func (_LiquidityManager *LiquidityManagerCaller) TypeAndVersion(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _LiquidityManager.contract.Call(opts, &out, "typeAndVersion") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +func (_LiquidityManager *LiquidityManagerSession) TypeAndVersion() (string, error) { + return _LiquidityManager.Contract.TypeAndVersion(&_LiquidityManager.CallOpts) +} + +func (_LiquidityManager *LiquidityManagerCallerSession) TypeAndVersion() (string, error) { + return _LiquidityManager.Contract.TypeAndVersion(&_LiquidityManager.CallOpts) +} + +func (_LiquidityManager *LiquidityManagerTransactor) AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + return _LiquidityManager.contract.Transact(opts, "acceptOwnership") +} + +func (_LiquidityManager *LiquidityManagerSession) AcceptOwnership() (*types.Transaction, error) { + return _LiquidityManager.Contract.AcceptOwnership(&_LiquidityManager.TransactOpts) +} + +func (_LiquidityManager *LiquidityManagerTransactorSession) AcceptOwnership() (*types.Transaction, error) { + return _LiquidityManager.Contract.AcceptOwnership(&_LiquidityManager.TransactOpts) +} + +func (_LiquidityManager *LiquidityManagerTransactor) AddLiquidity(opts *bind.TransactOpts, amount *big.Int) (*types.Transaction, error) { + return _LiquidityManager.contract.Transact(opts, "addLiquidity", amount) +} + +func (_LiquidityManager *LiquidityManagerSession) AddLiquidity(amount *big.Int) (*types.Transaction, error) { + return _LiquidityManager.Contract.AddLiquidity(&_LiquidityManager.TransactOpts, amount) +} + +func (_LiquidityManager *LiquidityManagerTransactorSession) AddLiquidity(amount *big.Int) (*types.Transaction, error) { + return _LiquidityManager.Contract.AddLiquidity(&_LiquidityManager.TransactOpts, amount) +} + +func (_LiquidityManager *LiquidityManagerTransactor) RebalanceLiquidity(opts *bind.TransactOpts, chainSelector uint64, amount *big.Int, nativeBridgeFee *big.Int, bridgeSpecificPayload []byte) (*types.Transaction, error) { + return _LiquidityManager.contract.Transact(opts, "rebalanceLiquidity", chainSelector, amount, nativeBridgeFee, bridgeSpecificPayload) +} + +func (_LiquidityManager *LiquidityManagerSession) RebalanceLiquidity(chainSelector uint64, amount *big.Int, nativeBridgeFee *big.Int, bridgeSpecificPayload []byte) (*types.Transaction, error) { + return _LiquidityManager.Contract.RebalanceLiquidity(&_LiquidityManager.TransactOpts, chainSelector, amount, nativeBridgeFee, bridgeSpecificPayload) +} + +func (_LiquidityManager *LiquidityManagerTransactorSession) RebalanceLiquidity(chainSelector uint64, amount *big.Int, nativeBridgeFee *big.Int, bridgeSpecificPayload []byte) (*types.Transaction, error) { + return _LiquidityManager.Contract.RebalanceLiquidity(&_LiquidityManager.TransactOpts, chainSelector, amount, nativeBridgeFee, bridgeSpecificPayload) +} + +func (_LiquidityManager *LiquidityManagerTransactor) ReceiveLiquidity(opts *bind.TransactOpts, remoteChainSelector uint64, amount *big.Int, shouldWrapNative bool, bridgeSpecificPayload []byte) (*types.Transaction, error) { + return _LiquidityManager.contract.Transact(opts, "receiveLiquidity", remoteChainSelector, amount, shouldWrapNative, bridgeSpecificPayload) +} + +func (_LiquidityManager *LiquidityManagerSession) ReceiveLiquidity(remoteChainSelector uint64, amount *big.Int, shouldWrapNative bool, bridgeSpecificPayload []byte) (*types.Transaction, error) { + return _LiquidityManager.Contract.ReceiveLiquidity(&_LiquidityManager.TransactOpts, remoteChainSelector, amount, shouldWrapNative, bridgeSpecificPayload) +} + +func (_LiquidityManager *LiquidityManagerTransactorSession) ReceiveLiquidity(remoteChainSelector uint64, amount *big.Int, shouldWrapNative bool, bridgeSpecificPayload []byte) (*types.Transaction, error) { + return _LiquidityManager.Contract.ReceiveLiquidity(&_LiquidityManager.TransactOpts, remoteChainSelector, amount, shouldWrapNative, bridgeSpecificPayload) +} + +func (_LiquidityManager *LiquidityManagerTransactor) RemoveLiquidity(opts *bind.TransactOpts, amount *big.Int) (*types.Transaction, error) { + return _LiquidityManager.contract.Transact(opts, "removeLiquidity", amount) +} + +func (_LiquidityManager *LiquidityManagerSession) RemoveLiquidity(amount *big.Int) (*types.Transaction, error) { + return _LiquidityManager.Contract.RemoveLiquidity(&_LiquidityManager.TransactOpts, amount) +} + +func (_LiquidityManager *LiquidityManagerTransactorSession) RemoveLiquidity(amount *big.Int) (*types.Transaction, error) { + return _LiquidityManager.Contract.RemoveLiquidity(&_LiquidityManager.TransactOpts, amount) +} + +func (_LiquidityManager *LiquidityManagerTransactor) SetCrossChainRebalancer(opts *bind.TransactOpts, crossChainLiqManager ILiquidityManagerCrossChainRebalancerArgs) (*types.Transaction, error) { + return _LiquidityManager.contract.Transact(opts, "setCrossChainRebalancer", crossChainLiqManager) +} + +func (_LiquidityManager *LiquidityManagerSession) SetCrossChainRebalancer(crossChainLiqManager ILiquidityManagerCrossChainRebalancerArgs) (*types.Transaction, error) { + return _LiquidityManager.Contract.SetCrossChainRebalancer(&_LiquidityManager.TransactOpts, crossChainLiqManager) +} + +func (_LiquidityManager *LiquidityManagerTransactorSession) SetCrossChainRebalancer(crossChainLiqManager ILiquidityManagerCrossChainRebalancerArgs) (*types.Transaction, error) { + return _LiquidityManager.Contract.SetCrossChainRebalancer(&_LiquidityManager.TransactOpts, crossChainLiqManager) +} + +func (_LiquidityManager *LiquidityManagerTransactor) SetCrossChainRebalancers(opts *bind.TransactOpts, crossChainRebalancers []ILiquidityManagerCrossChainRebalancerArgs) (*types.Transaction, error) { + return _LiquidityManager.contract.Transact(opts, "setCrossChainRebalancers", crossChainRebalancers) +} + +func (_LiquidityManager *LiquidityManagerSession) SetCrossChainRebalancers(crossChainRebalancers []ILiquidityManagerCrossChainRebalancerArgs) (*types.Transaction, error) { + return _LiquidityManager.Contract.SetCrossChainRebalancers(&_LiquidityManager.TransactOpts, crossChainRebalancers) +} + +func (_LiquidityManager *LiquidityManagerTransactorSession) SetCrossChainRebalancers(crossChainRebalancers []ILiquidityManagerCrossChainRebalancerArgs) (*types.Transaction, error) { + return _LiquidityManager.Contract.SetCrossChainRebalancers(&_LiquidityManager.TransactOpts, crossChainRebalancers) +} + +func (_LiquidityManager *LiquidityManagerTransactor) SetFinanceRole(opts *bind.TransactOpts, finance common.Address) (*types.Transaction, error) { + return _LiquidityManager.contract.Transact(opts, "setFinanceRole", finance) +} + +func (_LiquidityManager *LiquidityManagerSession) SetFinanceRole(finance common.Address) (*types.Transaction, error) { + return _LiquidityManager.Contract.SetFinanceRole(&_LiquidityManager.TransactOpts, finance) +} + +func (_LiquidityManager *LiquidityManagerTransactorSession) SetFinanceRole(finance common.Address) (*types.Transaction, error) { + return _LiquidityManager.Contract.SetFinanceRole(&_LiquidityManager.TransactOpts, finance) +} + +func (_LiquidityManager *LiquidityManagerTransactor) SetLocalLiquidityContainer(opts *bind.TransactOpts, localLiquidityContainer common.Address) (*types.Transaction, error) { + return _LiquidityManager.contract.Transact(opts, "setLocalLiquidityContainer", localLiquidityContainer) +} + +func (_LiquidityManager *LiquidityManagerSession) SetLocalLiquidityContainer(localLiquidityContainer common.Address) (*types.Transaction, error) { + return _LiquidityManager.Contract.SetLocalLiquidityContainer(&_LiquidityManager.TransactOpts, localLiquidityContainer) +} + +func (_LiquidityManager *LiquidityManagerTransactorSession) SetLocalLiquidityContainer(localLiquidityContainer common.Address) (*types.Transaction, error) { + return _LiquidityManager.Contract.SetLocalLiquidityContainer(&_LiquidityManager.TransactOpts, localLiquidityContainer) +} + +func (_LiquidityManager *LiquidityManagerTransactor) SetMinimumLiquidity(opts *bind.TransactOpts, minimumLiquidity *big.Int) (*types.Transaction, error) { + return _LiquidityManager.contract.Transact(opts, "setMinimumLiquidity", minimumLiquidity) +} + +func (_LiquidityManager *LiquidityManagerSession) SetMinimumLiquidity(minimumLiquidity *big.Int) (*types.Transaction, error) { + return _LiquidityManager.Contract.SetMinimumLiquidity(&_LiquidityManager.TransactOpts, minimumLiquidity) +} + +func (_LiquidityManager *LiquidityManagerTransactorSession) SetMinimumLiquidity(minimumLiquidity *big.Int) (*types.Transaction, error) { + return _LiquidityManager.Contract.SetMinimumLiquidity(&_LiquidityManager.TransactOpts, minimumLiquidity) +} + +func (_LiquidityManager *LiquidityManagerTransactor) SetOCR3Config(opts *bind.TransactOpts, signers []common.Address, transmitters []common.Address, f uint8, onchainConfig []byte, offchainConfigVersion uint64, offchainConfig []byte) (*types.Transaction, error) { + return _LiquidityManager.contract.Transact(opts, "setOCR3Config", signers, transmitters, f, onchainConfig, offchainConfigVersion, offchainConfig) +} + +func (_LiquidityManager *LiquidityManagerSession) SetOCR3Config(signers []common.Address, transmitters []common.Address, f uint8, onchainConfig []byte, offchainConfigVersion uint64, offchainConfig []byte) (*types.Transaction, error) { + return _LiquidityManager.Contract.SetOCR3Config(&_LiquidityManager.TransactOpts, signers, transmitters, f, onchainConfig, offchainConfigVersion, offchainConfig) +} + +func (_LiquidityManager *LiquidityManagerTransactorSession) SetOCR3Config(signers []common.Address, transmitters []common.Address, f uint8, onchainConfig []byte, offchainConfigVersion uint64, offchainConfig []byte) (*types.Transaction, error) { + return _LiquidityManager.Contract.SetOCR3Config(&_LiquidityManager.TransactOpts, signers, transmitters, f, onchainConfig, offchainConfigVersion, offchainConfig) +} + +func (_LiquidityManager *LiquidityManagerTransactor) TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) { + return _LiquidityManager.contract.Transact(opts, "transferOwnership", to) +} + +func (_LiquidityManager *LiquidityManagerSession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _LiquidityManager.Contract.TransferOwnership(&_LiquidityManager.TransactOpts, to) +} + +func (_LiquidityManager *LiquidityManagerTransactorSession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _LiquidityManager.Contract.TransferOwnership(&_LiquidityManager.TransactOpts, to) +} + +func (_LiquidityManager *LiquidityManagerTransactor) Transmit(opts *bind.TransactOpts, reportContext [3][32]byte, report []byte, rs [][32]byte, ss [][32]byte, rawVs [32]byte) (*types.Transaction, error) { + return _LiquidityManager.contract.Transact(opts, "transmit", reportContext, report, rs, ss, rawVs) +} + +func (_LiquidityManager *LiquidityManagerSession) Transmit(reportContext [3][32]byte, report []byte, rs [][32]byte, ss [][32]byte, rawVs [32]byte) (*types.Transaction, error) { + return _LiquidityManager.Contract.Transmit(&_LiquidityManager.TransactOpts, reportContext, report, rs, ss, rawVs) +} + +func (_LiquidityManager *LiquidityManagerTransactorSession) Transmit(reportContext [3][32]byte, report []byte, rs [][32]byte, ss [][32]byte, rawVs [32]byte) (*types.Transaction, error) { + return _LiquidityManager.Contract.Transmit(&_LiquidityManager.TransactOpts, reportContext, report, rs, ss, rawVs) +} + +func (_LiquidityManager *LiquidityManagerTransactor) WithdrawERC20(opts *bind.TransactOpts, token common.Address, amount *big.Int, destination common.Address) (*types.Transaction, error) { + return _LiquidityManager.contract.Transact(opts, "withdrawERC20", token, amount, destination) +} + +func (_LiquidityManager *LiquidityManagerSession) WithdrawERC20(token common.Address, amount *big.Int, destination common.Address) (*types.Transaction, error) { + return _LiquidityManager.Contract.WithdrawERC20(&_LiquidityManager.TransactOpts, token, amount, destination) +} + +func (_LiquidityManager *LiquidityManagerTransactorSession) WithdrawERC20(token common.Address, amount *big.Int, destination common.Address) (*types.Transaction, error) { + return _LiquidityManager.Contract.WithdrawERC20(&_LiquidityManager.TransactOpts, token, amount, destination) +} + +func (_LiquidityManager *LiquidityManagerTransactor) WithdrawNative(opts *bind.TransactOpts, amount *big.Int, destination common.Address) (*types.Transaction, error) { + return _LiquidityManager.contract.Transact(opts, "withdrawNative", amount, destination) +} + +func (_LiquidityManager *LiquidityManagerSession) WithdrawNative(amount *big.Int, destination common.Address) (*types.Transaction, error) { + return _LiquidityManager.Contract.WithdrawNative(&_LiquidityManager.TransactOpts, amount, destination) +} + +func (_LiquidityManager *LiquidityManagerTransactorSession) WithdrawNative(amount *big.Int, destination common.Address) (*types.Transaction, error) { + return _LiquidityManager.Contract.WithdrawNative(&_LiquidityManager.TransactOpts, amount, destination) +} + +func (_LiquidityManager *LiquidityManagerTransactor) Receive(opts *bind.TransactOpts) (*types.Transaction, error) { + return _LiquidityManager.contract.RawTransact(opts, nil) +} + +func (_LiquidityManager *LiquidityManagerSession) Receive() (*types.Transaction, error) { + return _LiquidityManager.Contract.Receive(&_LiquidityManager.TransactOpts) +} + +func (_LiquidityManager *LiquidityManagerTransactorSession) Receive() (*types.Transaction, error) { + return _LiquidityManager.Contract.Receive(&_LiquidityManager.TransactOpts) +} + +type LiquidityManagerConfigSetIterator struct { + Event *LiquidityManagerConfigSet + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *LiquidityManagerConfigSetIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(LiquidityManagerConfigSet) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(LiquidityManagerConfigSet) + 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() + } +} + +func (it *LiquidityManagerConfigSetIterator) Error() error { + return it.fail +} + +func (it *LiquidityManagerConfigSetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type LiquidityManagerConfigSet struct { + PreviousConfigBlockNumber uint32 + ConfigDigest [32]byte + ConfigCount uint64 + Signers []common.Address + Transmitters []common.Address + F uint8 + OnchainConfig []byte + OffchainConfigVersion uint64 + OffchainConfig []byte + Raw types.Log +} + +func (_LiquidityManager *LiquidityManagerFilterer) FilterConfigSet(opts *bind.FilterOpts) (*LiquidityManagerConfigSetIterator, error) { + + logs, sub, err := _LiquidityManager.contract.FilterLogs(opts, "ConfigSet") + if err != nil { + return nil, err + } + return &LiquidityManagerConfigSetIterator{contract: _LiquidityManager.contract, event: "ConfigSet", logs: logs, sub: sub}, nil +} + +func (_LiquidityManager *LiquidityManagerFilterer) WatchConfigSet(opts *bind.WatchOpts, sink chan<- *LiquidityManagerConfigSet) (event.Subscription, error) { + + logs, sub, err := _LiquidityManager.contract.WatchLogs(opts, "ConfigSet") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(LiquidityManagerConfigSet) + if err := _LiquidityManager.contract.UnpackLog(event, "ConfigSet", 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 +} + +func (_LiquidityManager *LiquidityManagerFilterer) ParseConfigSet(log types.Log) (*LiquidityManagerConfigSet, error) { + event := new(LiquidityManagerConfigSet) + if err := _LiquidityManager.contract.UnpackLog(event, "ConfigSet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type LiquidityManagerCrossChainRebalancerSetIterator struct { + Event *LiquidityManagerCrossChainRebalancerSet + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *LiquidityManagerCrossChainRebalancerSetIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(LiquidityManagerCrossChainRebalancerSet) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(LiquidityManagerCrossChainRebalancerSet) + 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() + } +} + +func (it *LiquidityManagerCrossChainRebalancerSetIterator) Error() error { + return it.fail +} + +func (it *LiquidityManagerCrossChainRebalancerSetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type LiquidityManagerCrossChainRebalancerSet struct { + RemoteChainSelector uint64 + LocalBridge common.Address + RemoteToken common.Address + RemoteRebalancer common.Address + Enabled bool + Raw types.Log +} + +func (_LiquidityManager *LiquidityManagerFilterer) FilterCrossChainRebalancerSet(opts *bind.FilterOpts, remoteChainSelector []uint64) (*LiquidityManagerCrossChainRebalancerSetIterator, error) { + + var remoteChainSelectorRule []interface{} + for _, remoteChainSelectorItem := range remoteChainSelector { + remoteChainSelectorRule = append(remoteChainSelectorRule, remoteChainSelectorItem) + } + + logs, sub, err := _LiquidityManager.contract.FilterLogs(opts, "CrossChainRebalancerSet", remoteChainSelectorRule) + if err != nil { + return nil, err + } + return &LiquidityManagerCrossChainRebalancerSetIterator{contract: _LiquidityManager.contract, event: "CrossChainRebalancerSet", logs: logs, sub: sub}, nil +} + +func (_LiquidityManager *LiquidityManagerFilterer) WatchCrossChainRebalancerSet(opts *bind.WatchOpts, sink chan<- *LiquidityManagerCrossChainRebalancerSet, remoteChainSelector []uint64) (event.Subscription, error) { + + var remoteChainSelectorRule []interface{} + for _, remoteChainSelectorItem := range remoteChainSelector { + remoteChainSelectorRule = append(remoteChainSelectorRule, remoteChainSelectorItem) + } + + logs, sub, err := _LiquidityManager.contract.WatchLogs(opts, "CrossChainRebalancerSet", remoteChainSelectorRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(LiquidityManagerCrossChainRebalancerSet) + if err := _LiquidityManager.contract.UnpackLog(event, "CrossChainRebalancerSet", 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 +} + +func (_LiquidityManager *LiquidityManagerFilterer) ParseCrossChainRebalancerSet(log types.Log) (*LiquidityManagerCrossChainRebalancerSet, error) { + event := new(LiquidityManagerCrossChainRebalancerSet) + if err := _LiquidityManager.contract.UnpackLog(event, "CrossChainRebalancerSet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type LiquidityManagerFinalizationFailedIterator struct { + Event *LiquidityManagerFinalizationFailed + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *LiquidityManagerFinalizationFailedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(LiquidityManagerFinalizationFailed) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(LiquidityManagerFinalizationFailed) + 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() + } +} + +func (it *LiquidityManagerFinalizationFailedIterator) Error() error { + return it.fail +} + +func (it *LiquidityManagerFinalizationFailedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type LiquidityManagerFinalizationFailed struct { + OcrSeqNum uint64 + RemoteChainSelector uint64 + BridgeSpecificData []byte + Reason []byte + Raw types.Log +} + +func (_LiquidityManager *LiquidityManagerFilterer) FilterFinalizationFailed(opts *bind.FilterOpts, ocrSeqNum []uint64, remoteChainSelector []uint64) (*LiquidityManagerFinalizationFailedIterator, error) { + + var ocrSeqNumRule []interface{} + for _, ocrSeqNumItem := range ocrSeqNum { + ocrSeqNumRule = append(ocrSeqNumRule, ocrSeqNumItem) + } + var remoteChainSelectorRule []interface{} + for _, remoteChainSelectorItem := range remoteChainSelector { + remoteChainSelectorRule = append(remoteChainSelectorRule, remoteChainSelectorItem) + } + + logs, sub, err := _LiquidityManager.contract.FilterLogs(opts, "FinalizationFailed", ocrSeqNumRule, remoteChainSelectorRule) + if err != nil { + return nil, err + } + return &LiquidityManagerFinalizationFailedIterator{contract: _LiquidityManager.contract, event: "FinalizationFailed", logs: logs, sub: sub}, nil +} + +func (_LiquidityManager *LiquidityManagerFilterer) WatchFinalizationFailed(opts *bind.WatchOpts, sink chan<- *LiquidityManagerFinalizationFailed, ocrSeqNum []uint64, remoteChainSelector []uint64) (event.Subscription, error) { + + var ocrSeqNumRule []interface{} + for _, ocrSeqNumItem := range ocrSeqNum { + ocrSeqNumRule = append(ocrSeqNumRule, ocrSeqNumItem) + } + var remoteChainSelectorRule []interface{} + for _, remoteChainSelectorItem := range remoteChainSelector { + remoteChainSelectorRule = append(remoteChainSelectorRule, remoteChainSelectorItem) + } + + logs, sub, err := _LiquidityManager.contract.WatchLogs(opts, "FinalizationFailed", ocrSeqNumRule, remoteChainSelectorRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(LiquidityManagerFinalizationFailed) + if err := _LiquidityManager.contract.UnpackLog(event, "FinalizationFailed", 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 +} + +func (_LiquidityManager *LiquidityManagerFilterer) ParseFinalizationFailed(log types.Log) (*LiquidityManagerFinalizationFailed, error) { + event := new(LiquidityManagerFinalizationFailed) + if err := _LiquidityManager.contract.UnpackLog(event, "FinalizationFailed", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type LiquidityManagerFinalizationStepCompletedIterator struct { + Event *LiquidityManagerFinalizationStepCompleted + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *LiquidityManagerFinalizationStepCompletedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(LiquidityManagerFinalizationStepCompleted) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(LiquidityManagerFinalizationStepCompleted) + 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() + } +} + +func (it *LiquidityManagerFinalizationStepCompletedIterator) Error() error { + return it.fail +} + +func (it *LiquidityManagerFinalizationStepCompletedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type LiquidityManagerFinalizationStepCompleted struct { + OcrSeqNum uint64 + RemoteChainSelector uint64 + BridgeSpecificData []byte + Raw types.Log +} + +func (_LiquidityManager *LiquidityManagerFilterer) FilterFinalizationStepCompleted(opts *bind.FilterOpts, ocrSeqNum []uint64, remoteChainSelector []uint64) (*LiquidityManagerFinalizationStepCompletedIterator, error) { + + var ocrSeqNumRule []interface{} + for _, ocrSeqNumItem := range ocrSeqNum { + ocrSeqNumRule = append(ocrSeqNumRule, ocrSeqNumItem) + } + var remoteChainSelectorRule []interface{} + for _, remoteChainSelectorItem := range remoteChainSelector { + remoteChainSelectorRule = append(remoteChainSelectorRule, remoteChainSelectorItem) + } + + logs, sub, err := _LiquidityManager.contract.FilterLogs(opts, "FinalizationStepCompleted", ocrSeqNumRule, remoteChainSelectorRule) + if err != nil { + return nil, err + } + return &LiquidityManagerFinalizationStepCompletedIterator{contract: _LiquidityManager.contract, event: "FinalizationStepCompleted", logs: logs, sub: sub}, nil +} + +func (_LiquidityManager *LiquidityManagerFilterer) WatchFinalizationStepCompleted(opts *bind.WatchOpts, sink chan<- *LiquidityManagerFinalizationStepCompleted, ocrSeqNum []uint64, remoteChainSelector []uint64) (event.Subscription, error) { + + var ocrSeqNumRule []interface{} + for _, ocrSeqNumItem := range ocrSeqNum { + ocrSeqNumRule = append(ocrSeqNumRule, ocrSeqNumItem) + } + var remoteChainSelectorRule []interface{} + for _, remoteChainSelectorItem := range remoteChainSelector { + remoteChainSelectorRule = append(remoteChainSelectorRule, remoteChainSelectorItem) + } + + logs, sub, err := _LiquidityManager.contract.WatchLogs(opts, "FinalizationStepCompleted", ocrSeqNumRule, remoteChainSelectorRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(LiquidityManagerFinalizationStepCompleted) + if err := _LiquidityManager.contract.UnpackLog(event, "FinalizationStepCompleted", 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 +} + +func (_LiquidityManager *LiquidityManagerFilterer) ParseFinalizationStepCompleted(log types.Log) (*LiquidityManagerFinalizationStepCompleted, error) { + event := new(LiquidityManagerFinalizationStepCompleted) + if err := _LiquidityManager.contract.UnpackLog(event, "FinalizationStepCompleted", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type LiquidityManagerFinanceRoleSetIterator struct { + Event *LiquidityManagerFinanceRoleSet + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *LiquidityManagerFinanceRoleSetIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(LiquidityManagerFinanceRoleSet) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(LiquidityManagerFinanceRoleSet) + 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() + } +} + +func (it *LiquidityManagerFinanceRoleSetIterator) Error() error { + return it.fail +} + +func (it *LiquidityManagerFinanceRoleSetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type LiquidityManagerFinanceRoleSet struct { + FinanceRole common.Address + Raw types.Log +} + +func (_LiquidityManager *LiquidityManagerFilterer) FilterFinanceRoleSet(opts *bind.FilterOpts) (*LiquidityManagerFinanceRoleSetIterator, error) { + + logs, sub, err := _LiquidityManager.contract.FilterLogs(opts, "FinanceRoleSet") + if err != nil { + return nil, err + } + return &LiquidityManagerFinanceRoleSetIterator{contract: _LiquidityManager.contract, event: "FinanceRoleSet", logs: logs, sub: sub}, nil +} + +func (_LiquidityManager *LiquidityManagerFilterer) WatchFinanceRoleSet(opts *bind.WatchOpts, sink chan<- *LiquidityManagerFinanceRoleSet) (event.Subscription, error) { + + logs, sub, err := _LiquidityManager.contract.WatchLogs(opts, "FinanceRoleSet") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(LiquidityManagerFinanceRoleSet) + if err := _LiquidityManager.contract.UnpackLog(event, "FinanceRoleSet", 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 +} + +func (_LiquidityManager *LiquidityManagerFilterer) ParseFinanceRoleSet(log types.Log) (*LiquidityManagerFinanceRoleSet, error) { + event := new(LiquidityManagerFinanceRoleSet) + if err := _LiquidityManager.contract.UnpackLog(event, "FinanceRoleSet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type LiquidityManagerLiquidityAddedToContainerIterator struct { + Event *LiquidityManagerLiquidityAddedToContainer + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *LiquidityManagerLiquidityAddedToContainerIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(LiquidityManagerLiquidityAddedToContainer) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(LiquidityManagerLiquidityAddedToContainer) + 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() + } +} + +func (it *LiquidityManagerLiquidityAddedToContainerIterator) Error() error { + return it.fail +} + +func (it *LiquidityManagerLiquidityAddedToContainerIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type LiquidityManagerLiquidityAddedToContainer struct { + Provider common.Address + Amount *big.Int + Raw types.Log +} + +func (_LiquidityManager *LiquidityManagerFilterer) FilterLiquidityAddedToContainer(opts *bind.FilterOpts, provider []common.Address, amount []*big.Int) (*LiquidityManagerLiquidityAddedToContainerIterator, error) { + + var providerRule []interface{} + for _, providerItem := range provider { + providerRule = append(providerRule, providerItem) + } + var amountRule []interface{} + for _, amountItem := range amount { + amountRule = append(amountRule, amountItem) + } + + logs, sub, err := _LiquidityManager.contract.FilterLogs(opts, "LiquidityAddedToContainer", providerRule, amountRule) + if err != nil { + return nil, err + } + return &LiquidityManagerLiquidityAddedToContainerIterator{contract: _LiquidityManager.contract, event: "LiquidityAddedToContainer", logs: logs, sub: sub}, nil +} + +func (_LiquidityManager *LiquidityManagerFilterer) WatchLiquidityAddedToContainer(opts *bind.WatchOpts, sink chan<- *LiquidityManagerLiquidityAddedToContainer, provider []common.Address, amount []*big.Int) (event.Subscription, error) { + + var providerRule []interface{} + for _, providerItem := range provider { + providerRule = append(providerRule, providerItem) + } + var amountRule []interface{} + for _, amountItem := range amount { + amountRule = append(amountRule, amountItem) + } + + logs, sub, err := _LiquidityManager.contract.WatchLogs(opts, "LiquidityAddedToContainer", providerRule, amountRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(LiquidityManagerLiquidityAddedToContainer) + if err := _LiquidityManager.contract.UnpackLog(event, "LiquidityAddedToContainer", 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 +} + +func (_LiquidityManager *LiquidityManagerFilterer) ParseLiquidityAddedToContainer(log types.Log) (*LiquidityManagerLiquidityAddedToContainer, error) { + event := new(LiquidityManagerLiquidityAddedToContainer) + if err := _LiquidityManager.contract.UnpackLog(event, "LiquidityAddedToContainer", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type LiquidityManagerLiquidityContainerSetIterator struct { + Event *LiquidityManagerLiquidityContainerSet + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *LiquidityManagerLiquidityContainerSetIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(LiquidityManagerLiquidityContainerSet) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(LiquidityManagerLiquidityContainerSet) + 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() + } +} + +func (it *LiquidityManagerLiquidityContainerSetIterator) Error() error { + return it.fail +} + +func (it *LiquidityManagerLiquidityContainerSetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type LiquidityManagerLiquidityContainerSet struct { + NewLiquidityContainer common.Address + Raw types.Log +} + +func (_LiquidityManager *LiquidityManagerFilterer) FilterLiquidityContainerSet(opts *bind.FilterOpts, newLiquidityContainer []common.Address) (*LiquidityManagerLiquidityContainerSetIterator, error) { + + var newLiquidityContainerRule []interface{} + for _, newLiquidityContainerItem := range newLiquidityContainer { + newLiquidityContainerRule = append(newLiquidityContainerRule, newLiquidityContainerItem) + } + + logs, sub, err := _LiquidityManager.contract.FilterLogs(opts, "LiquidityContainerSet", newLiquidityContainerRule) + if err != nil { + return nil, err + } + return &LiquidityManagerLiquidityContainerSetIterator{contract: _LiquidityManager.contract, event: "LiquidityContainerSet", logs: logs, sub: sub}, nil +} + +func (_LiquidityManager *LiquidityManagerFilterer) WatchLiquidityContainerSet(opts *bind.WatchOpts, sink chan<- *LiquidityManagerLiquidityContainerSet, newLiquidityContainer []common.Address) (event.Subscription, error) { + + var newLiquidityContainerRule []interface{} + for _, newLiquidityContainerItem := range newLiquidityContainer { + newLiquidityContainerRule = append(newLiquidityContainerRule, newLiquidityContainerItem) + } + + logs, sub, err := _LiquidityManager.contract.WatchLogs(opts, "LiquidityContainerSet", newLiquidityContainerRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(LiquidityManagerLiquidityContainerSet) + if err := _LiquidityManager.contract.UnpackLog(event, "LiquidityContainerSet", 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 +} + +func (_LiquidityManager *LiquidityManagerFilterer) ParseLiquidityContainerSet(log types.Log) (*LiquidityManagerLiquidityContainerSet, error) { + event := new(LiquidityManagerLiquidityContainerSet) + if err := _LiquidityManager.contract.UnpackLog(event, "LiquidityContainerSet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type LiquidityManagerLiquidityRemovedFromContainerIterator struct { + Event *LiquidityManagerLiquidityRemovedFromContainer + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *LiquidityManagerLiquidityRemovedFromContainerIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(LiquidityManagerLiquidityRemovedFromContainer) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(LiquidityManagerLiquidityRemovedFromContainer) + 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() + } +} + +func (it *LiquidityManagerLiquidityRemovedFromContainerIterator) Error() error { + return it.fail +} + +func (it *LiquidityManagerLiquidityRemovedFromContainerIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type LiquidityManagerLiquidityRemovedFromContainer struct { + Remover common.Address + Amount *big.Int + Raw types.Log +} + +func (_LiquidityManager *LiquidityManagerFilterer) FilterLiquidityRemovedFromContainer(opts *bind.FilterOpts, remover []common.Address, amount []*big.Int) (*LiquidityManagerLiquidityRemovedFromContainerIterator, error) { + + var removerRule []interface{} + for _, removerItem := range remover { + removerRule = append(removerRule, removerItem) + } + var amountRule []interface{} + for _, amountItem := range amount { + amountRule = append(amountRule, amountItem) + } + + logs, sub, err := _LiquidityManager.contract.FilterLogs(opts, "LiquidityRemovedFromContainer", removerRule, amountRule) + if err != nil { + return nil, err + } + return &LiquidityManagerLiquidityRemovedFromContainerIterator{contract: _LiquidityManager.contract, event: "LiquidityRemovedFromContainer", logs: logs, sub: sub}, nil +} + +func (_LiquidityManager *LiquidityManagerFilterer) WatchLiquidityRemovedFromContainer(opts *bind.WatchOpts, sink chan<- *LiquidityManagerLiquidityRemovedFromContainer, remover []common.Address, amount []*big.Int) (event.Subscription, error) { + + var removerRule []interface{} + for _, removerItem := range remover { + removerRule = append(removerRule, removerItem) + } + var amountRule []interface{} + for _, amountItem := range amount { + amountRule = append(amountRule, amountItem) + } + + logs, sub, err := _LiquidityManager.contract.WatchLogs(opts, "LiquidityRemovedFromContainer", removerRule, amountRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(LiquidityManagerLiquidityRemovedFromContainer) + if err := _LiquidityManager.contract.UnpackLog(event, "LiquidityRemovedFromContainer", 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 +} + +func (_LiquidityManager *LiquidityManagerFilterer) ParseLiquidityRemovedFromContainer(log types.Log) (*LiquidityManagerLiquidityRemovedFromContainer, error) { + event := new(LiquidityManagerLiquidityRemovedFromContainer) + if err := _LiquidityManager.contract.UnpackLog(event, "LiquidityRemovedFromContainer", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type LiquidityManagerLiquidityTransferredIterator struct { + Event *LiquidityManagerLiquidityTransferred + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *LiquidityManagerLiquidityTransferredIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(LiquidityManagerLiquidityTransferred) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(LiquidityManagerLiquidityTransferred) + 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() + } +} + +func (it *LiquidityManagerLiquidityTransferredIterator) Error() error { + return it.fail +} + +func (it *LiquidityManagerLiquidityTransferredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type LiquidityManagerLiquidityTransferred struct { + OcrSeqNum uint64 + FromChainSelector uint64 + ToChainSelector uint64 + To common.Address + Amount *big.Int + BridgeSpecificData []byte + BridgeReturnData []byte + Raw types.Log +} + +func (_LiquidityManager *LiquidityManagerFilterer) FilterLiquidityTransferred(opts *bind.FilterOpts, ocrSeqNum []uint64, fromChainSelector []uint64, toChainSelector []uint64) (*LiquidityManagerLiquidityTransferredIterator, error) { + + var ocrSeqNumRule []interface{} + for _, ocrSeqNumItem := range ocrSeqNum { + ocrSeqNumRule = append(ocrSeqNumRule, ocrSeqNumItem) + } + var fromChainSelectorRule []interface{} + for _, fromChainSelectorItem := range fromChainSelector { + fromChainSelectorRule = append(fromChainSelectorRule, fromChainSelectorItem) + } + var toChainSelectorRule []interface{} + for _, toChainSelectorItem := range toChainSelector { + toChainSelectorRule = append(toChainSelectorRule, toChainSelectorItem) + } + + logs, sub, err := _LiquidityManager.contract.FilterLogs(opts, "LiquidityTransferred", ocrSeqNumRule, fromChainSelectorRule, toChainSelectorRule) + if err != nil { + return nil, err + } + return &LiquidityManagerLiquidityTransferredIterator{contract: _LiquidityManager.contract, event: "LiquidityTransferred", logs: logs, sub: sub}, nil +} + +func (_LiquidityManager *LiquidityManagerFilterer) WatchLiquidityTransferred(opts *bind.WatchOpts, sink chan<- *LiquidityManagerLiquidityTransferred, ocrSeqNum []uint64, fromChainSelector []uint64, toChainSelector []uint64) (event.Subscription, error) { + + var ocrSeqNumRule []interface{} + for _, ocrSeqNumItem := range ocrSeqNum { + ocrSeqNumRule = append(ocrSeqNumRule, ocrSeqNumItem) + } + var fromChainSelectorRule []interface{} + for _, fromChainSelectorItem := range fromChainSelector { + fromChainSelectorRule = append(fromChainSelectorRule, fromChainSelectorItem) + } + var toChainSelectorRule []interface{} + for _, toChainSelectorItem := range toChainSelector { + toChainSelectorRule = append(toChainSelectorRule, toChainSelectorItem) + } + + logs, sub, err := _LiquidityManager.contract.WatchLogs(opts, "LiquidityTransferred", ocrSeqNumRule, fromChainSelectorRule, toChainSelectorRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(LiquidityManagerLiquidityTransferred) + if err := _LiquidityManager.contract.UnpackLog(event, "LiquidityTransferred", 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 +} + +func (_LiquidityManager *LiquidityManagerFilterer) ParseLiquidityTransferred(log types.Log) (*LiquidityManagerLiquidityTransferred, error) { + event := new(LiquidityManagerLiquidityTransferred) + if err := _LiquidityManager.contract.UnpackLog(event, "LiquidityTransferred", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type LiquidityManagerMinimumLiquiditySetIterator struct { + Event *LiquidityManagerMinimumLiquiditySet + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *LiquidityManagerMinimumLiquiditySetIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(LiquidityManagerMinimumLiquiditySet) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(LiquidityManagerMinimumLiquiditySet) + 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() + } +} + +func (it *LiquidityManagerMinimumLiquiditySetIterator) Error() error { + return it.fail +} + +func (it *LiquidityManagerMinimumLiquiditySetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type LiquidityManagerMinimumLiquiditySet struct { + OldBalance *big.Int + NewBalance *big.Int + Raw types.Log +} + +func (_LiquidityManager *LiquidityManagerFilterer) FilterMinimumLiquiditySet(opts *bind.FilterOpts) (*LiquidityManagerMinimumLiquiditySetIterator, error) { + + logs, sub, err := _LiquidityManager.contract.FilterLogs(opts, "MinimumLiquiditySet") + if err != nil { + return nil, err + } + return &LiquidityManagerMinimumLiquiditySetIterator{contract: _LiquidityManager.contract, event: "MinimumLiquiditySet", logs: logs, sub: sub}, nil +} + +func (_LiquidityManager *LiquidityManagerFilterer) WatchMinimumLiquiditySet(opts *bind.WatchOpts, sink chan<- *LiquidityManagerMinimumLiquiditySet) (event.Subscription, error) { + + logs, sub, err := _LiquidityManager.contract.WatchLogs(opts, "MinimumLiquiditySet") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(LiquidityManagerMinimumLiquiditySet) + if err := _LiquidityManager.contract.UnpackLog(event, "MinimumLiquiditySet", 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 +} + +func (_LiquidityManager *LiquidityManagerFilterer) ParseMinimumLiquiditySet(log types.Log) (*LiquidityManagerMinimumLiquiditySet, error) { + event := new(LiquidityManagerMinimumLiquiditySet) + if err := _LiquidityManager.contract.UnpackLog(event, "MinimumLiquiditySet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type LiquidityManagerNativeDepositedIterator struct { + Event *LiquidityManagerNativeDeposited + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *LiquidityManagerNativeDepositedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(LiquidityManagerNativeDeposited) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(LiquidityManagerNativeDeposited) + 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() + } +} + +func (it *LiquidityManagerNativeDepositedIterator) Error() error { + return it.fail +} + +func (it *LiquidityManagerNativeDepositedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type LiquidityManagerNativeDeposited struct { + Amount *big.Int + Depositor common.Address + Raw types.Log +} + +func (_LiquidityManager *LiquidityManagerFilterer) FilterNativeDeposited(opts *bind.FilterOpts) (*LiquidityManagerNativeDepositedIterator, error) { + + logs, sub, err := _LiquidityManager.contract.FilterLogs(opts, "NativeDeposited") + if err != nil { + return nil, err + } + return &LiquidityManagerNativeDepositedIterator{contract: _LiquidityManager.contract, event: "NativeDeposited", logs: logs, sub: sub}, nil +} + +func (_LiquidityManager *LiquidityManagerFilterer) WatchNativeDeposited(opts *bind.WatchOpts, sink chan<- *LiquidityManagerNativeDeposited) (event.Subscription, error) { + + logs, sub, err := _LiquidityManager.contract.WatchLogs(opts, "NativeDeposited") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(LiquidityManagerNativeDeposited) + if err := _LiquidityManager.contract.UnpackLog(event, "NativeDeposited", 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 +} + +func (_LiquidityManager *LiquidityManagerFilterer) ParseNativeDeposited(log types.Log) (*LiquidityManagerNativeDeposited, error) { + event := new(LiquidityManagerNativeDeposited) + if err := _LiquidityManager.contract.UnpackLog(event, "NativeDeposited", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type LiquidityManagerNativeWithdrawnIterator struct { + Event *LiquidityManagerNativeWithdrawn + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *LiquidityManagerNativeWithdrawnIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(LiquidityManagerNativeWithdrawn) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(LiquidityManagerNativeWithdrawn) + 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() + } +} + +func (it *LiquidityManagerNativeWithdrawnIterator) Error() error { + return it.fail +} + +func (it *LiquidityManagerNativeWithdrawnIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type LiquidityManagerNativeWithdrawn struct { + Amount *big.Int + Destination common.Address + Raw types.Log +} + +func (_LiquidityManager *LiquidityManagerFilterer) FilterNativeWithdrawn(opts *bind.FilterOpts) (*LiquidityManagerNativeWithdrawnIterator, error) { + + logs, sub, err := _LiquidityManager.contract.FilterLogs(opts, "NativeWithdrawn") + if err != nil { + return nil, err + } + return &LiquidityManagerNativeWithdrawnIterator{contract: _LiquidityManager.contract, event: "NativeWithdrawn", logs: logs, sub: sub}, nil +} + +func (_LiquidityManager *LiquidityManagerFilterer) WatchNativeWithdrawn(opts *bind.WatchOpts, sink chan<- *LiquidityManagerNativeWithdrawn) (event.Subscription, error) { + + logs, sub, err := _LiquidityManager.contract.WatchLogs(opts, "NativeWithdrawn") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(LiquidityManagerNativeWithdrawn) + if err := _LiquidityManager.contract.UnpackLog(event, "NativeWithdrawn", 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 +} + +func (_LiquidityManager *LiquidityManagerFilterer) ParseNativeWithdrawn(log types.Log) (*LiquidityManagerNativeWithdrawn, error) { + event := new(LiquidityManagerNativeWithdrawn) + if err := _LiquidityManager.contract.UnpackLog(event, "NativeWithdrawn", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type LiquidityManagerOwnershipTransferRequestedIterator struct { + Event *LiquidityManagerOwnershipTransferRequested + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *LiquidityManagerOwnershipTransferRequestedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(LiquidityManagerOwnershipTransferRequested) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(LiquidityManagerOwnershipTransferRequested) + 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() + } +} + +func (it *LiquidityManagerOwnershipTransferRequestedIterator) Error() error { + return it.fail +} + +func (it *LiquidityManagerOwnershipTransferRequestedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type LiquidityManagerOwnershipTransferRequested struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_LiquidityManager *LiquidityManagerFilterer) FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*LiquidityManagerOwnershipTransferRequestedIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _LiquidityManager.contract.FilterLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return &LiquidityManagerOwnershipTransferRequestedIterator{contract: _LiquidityManager.contract, event: "OwnershipTransferRequested", logs: logs, sub: sub}, nil +} + +func (_LiquidityManager *LiquidityManagerFilterer) WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *LiquidityManagerOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _LiquidityManager.contract.WatchLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(LiquidityManagerOwnershipTransferRequested) + if err := _LiquidityManager.contract.UnpackLog(event, "OwnershipTransferRequested", 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 +} + +func (_LiquidityManager *LiquidityManagerFilterer) ParseOwnershipTransferRequested(log types.Log) (*LiquidityManagerOwnershipTransferRequested, error) { + event := new(LiquidityManagerOwnershipTransferRequested) + if err := _LiquidityManager.contract.UnpackLog(event, "OwnershipTransferRequested", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type LiquidityManagerOwnershipTransferredIterator struct { + Event *LiquidityManagerOwnershipTransferred + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *LiquidityManagerOwnershipTransferredIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(LiquidityManagerOwnershipTransferred) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(LiquidityManagerOwnershipTransferred) + 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() + } +} + +func (it *LiquidityManagerOwnershipTransferredIterator) Error() error { + return it.fail +} + +func (it *LiquidityManagerOwnershipTransferredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type LiquidityManagerOwnershipTransferred struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_LiquidityManager *LiquidityManagerFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*LiquidityManagerOwnershipTransferredIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _LiquidityManager.contract.FilterLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return &LiquidityManagerOwnershipTransferredIterator{contract: _LiquidityManager.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil +} + +func (_LiquidityManager *LiquidityManagerFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *LiquidityManagerOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _LiquidityManager.contract.WatchLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(LiquidityManagerOwnershipTransferred) + if err := _LiquidityManager.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 +} + +func (_LiquidityManager *LiquidityManagerFilterer) ParseOwnershipTransferred(log types.Log) (*LiquidityManagerOwnershipTransferred, error) { + event := new(LiquidityManagerOwnershipTransferred) + if err := _LiquidityManager.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type LiquidityManagerTransmittedIterator struct { + Event *LiquidityManagerTransmitted + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *LiquidityManagerTransmittedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(LiquidityManagerTransmitted) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(LiquidityManagerTransmitted) + 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() + } +} + +func (it *LiquidityManagerTransmittedIterator) Error() error { + return it.fail +} + +func (it *LiquidityManagerTransmittedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type LiquidityManagerTransmitted struct { + ConfigDigest [32]byte + SequenceNumber uint64 + Raw types.Log +} + +func (_LiquidityManager *LiquidityManagerFilterer) FilterTransmitted(opts *bind.FilterOpts) (*LiquidityManagerTransmittedIterator, error) { + + logs, sub, err := _LiquidityManager.contract.FilterLogs(opts, "Transmitted") + if err != nil { + return nil, err + } + return &LiquidityManagerTransmittedIterator{contract: _LiquidityManager.contract, event: "Transmitted", logs: logs, sub: sub}, nil +} + +func (_LiquidityManager *LiquidityManagerFilterer) WatchTransmitted(opts *bind.WatchOpts, sink chan<- *LiquidityManagerTransmitted) (event.Subscription, error) { + + logs, sub, err := _LiquidityManager.contract.WatchLogs(opts, "Transmitted") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(LiquidityManagerTransmitted) + if err := _LiquidityManager.contract.UnpackLog(event, "Transmitted", 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 +} + +func (_LiquidityManager *LiquidityManagerFilterer) ParseTransmitted(log types.Log) (*LiquidityManagerTransmitted, error) { + event := new(LiquidityManagerTransmitted) + if err := _LiquidityManager.contract.UnpackLog(event, "Transmitted", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type LatestConfigDetails struct { + ConfigCount uint32 + BlockNumber uint32 + ConfigDigest [32]byte +} + +func (_LiquidityManager *LiquidityManager) ParseLog(log types.Log) (generated.AbigenLog, error) { + switch log.Topics[0] { + case _LiquidityManager.abi.Events["ConfigSet"].ID: + return _LiquidityManager.ParseConfigSet(log) + case _LiquidityManager.abi.Events["CrossChainRebalancerSet"].ID: + return _LiquidityManager.ParseCrossChainRebalancerSet(log) + case _LiquidityManager.abi.Events["FinalizationFailed"].ID: + return _LiquidityManager.ParseFinalizationFailed(log) + case _LiquidityManager.abi.Events["FinalizationStepCompleted"].ID: + return _LiquidityManager.ParseFinalizationStepCompleted(log) + case _LiquidityManager.abi.Events["FinanceRoleSet"].ID: + return _LiquidityManager.ParseFinanceRoleSet(log) + case _LiquidityManager.abi.Events["LiquidityAddedToContainer"].ID: + return _LiquidityManager.ParseLiquidityAddedToContainer(log) + case _LiquidityManager.abi.Events["LiquidityContainerSet"].ID: + return _LiquidityManager.ParseLiquidityContainerSet(log) + case _LiquidityManager.abi.Events["LiquidityRemovedFromContainer"].ID: + return _LiquidityManager.ParseLiquidityRemovedFromContainer(log) + case _LiquidityManager.abi.Events["LiquidityTransferred"].ID: + return _LiquidityManager.ParseLiquidityTransferred(log) + case _LiquidityManager.abi.Events["MinimumLiquiditySet"].ID: + return _LiquidityManager.ParseMinimumLiquiditySet(log) + case _LiquidityManager.abi.Events["NativeDeposited"].ID: + return _LiquidityManager.ParseNativeDeposited(log) + case _LiquidityManager.abi.Events["NativeWithdrawn"].ID: + return _LiquidityManager.ParseNativeWithdrawn(log) + case _LiquidityManager.abi.Events["OwnershipTransferRequested"].ID: + return _LiquidityManager.ParseOwnershipTransferRequested(log) + case _LiquidityManager.abi.Events["OwnershipTransferred"].ID: + return _LiquidityManager.ParseOwnershipTransferred(log) + case _LiquidityManager.abi.Events["Transmitted"].ID: + return _LiquidityManager.ParseTransmitted(log) + + default: + return nil, fmt.Errorf("abigen wrapper received unknown log topic: %v", log.Topics[0]) + } +} + +func (LiquidityManagerConfigSet) Topic() common.Hash { + return common.HexToHash("0x1591690b8638f5fb2dbec82ac741805ac5da8b45dc5263f4875b0496fdce4e05") +} + +func (LiquidityManagerCrossChainRebalancerSet) Topic() common.Hash { + return common.HexToHash("0xab9bd0e4888101232b8f09dae2952ff59a6eea4a19fbddf2a8ca7b23f0e4cb40") +} + +func (LiquidityManagerFinalizationFailed) Topic() common.Hash { + return common.HexToHash("0xa481d91c3f9574c23ee84fef85246354b760a0527a535d6382354e4684703ce3") +} + +func (LiquidityManagerFinalizationStepCompleted) Topic() common.Hash { + return common.HexToHash("0x8d3121fe961b40270f336aa75feb1213f1c979a33993311c60da4dd0f24526cf") +} + +func (LiquidityManagerFinanceRoleSet) Topic() common.Hash { + return common.HexToHash("0x58024d20c07d3ebb87b192861d337d3a60995665acc5b8ce29596458b1f25170") +} + +func (LiquidityManagerLiquidityAddedToContainer) Topic() common.Hash { + return common.HexToHash("0x5414b81d05ac3542606f164e16a9a107d05d21e906539cc5ceb61d7b6b707eb5") +} + +func (LiquidityManagerLiquidityContainerSet) Topic() common.Hash { + return common.HexToHash("0x07dc474694ac40123aadcd2445f1b38d2eb353edd9319dcea043548ab34990ec") +} + +func (LiquidityManagerLiquidityRemovedFromContainer) Topic() common.Hash { + return common.HexToHash("0x2bda316674f8d73d289689d7a3acdf8e353b7a142fb5a68ac2aa475104039c18") +} + +func (LiquidityManagerLiquidityTransferred) Topic() common.Hash { + return common.HexToHash("0x2a0b69eaf1b415ca57005b4f87582ddefc6d960325ff30dc62a9b3e1e1e5b8a8") +} + +func (LiquidityManagerMinimumLiquiditySet) Topic() common.Hash { + return common.HexToHash("0xf97e758c8b3d81df7b0e1b7327a6a7fcf09a41536b2d274b9103015d715f11eb") +} + +func (LiquidityManagerNativeDeposited) Topic() common.Hash { + return common.HexToHash("0x3c597f6ac9fe7f0ed6da50b07618f5850a642e459ad587f7fab491a71f8b0ab8") +} + +func (LiquidityManagerNativeWithdrawn) Topic() common.Hash { + return common.HexToHash("0x6b84d241b711af111ecfa0e518239e6ca212da442a76548fe8a1f4e77518256a") +} + +func (LiquidityManagerOwnershipTransferRequested) Topic() common.Hash { + return common.HexToHash("0xed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae1278") +} + +func (LiquidityManagerOwnershipTransferred) Topic() common.Hash { + return common.HexToHash("0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0") +} + +func (LiquidityManagerTransmitted) Topic() common.Hash { + return common.HexToHash("0xe893c2681d327421d89e1cb54fbe64645b4dcea668d6826130b62cf4c6eefea2") +} + +func (_LiquidityManager *LiquidityManager) Address() common.Address { + return _LiquidityManager.address +} + +type LiquidityManagerInterface interface { + GetAllCrossChainRebalancers(opts *bind.CallOpts) ([]ILiquidityManagerCrossChainRebalancerArgs, error) + + GetCrossChainRebalancer(opts *bind.CallOpts, chainSelector uint64) (LiquidityManagerCrossChainRebalancer, error) + + GetFinanceRole(opts *bind.CallOpts) (common.Address, error) + + GetLiquidity(opts *bind.CallOpts) (*big.Int, error) + + GetLocalLiquidityContainer(opts *bind.CallOpts) (common.Address, error) + + GetMinimumLiquidity(opts *bind.CallOpts) (*big.Int, error) + + GetSupportedDestChains(opts *bind.CallOpts) ([]uint64, error) + + GetTransmitters(opts *bind.CallOpts) ([]common.Address, error) + + ILocalToken(opts *bind.CallOpts) (common.Address, error) + + LatestConfigDetails(opts *bind.CallOpts) (LatestConfigDetails, + + error) + + LatestSequenceNumber(opts *bind.CallOpts) (uint64, error) + + Owner(opts *bind.CallOpts) (common.Address, error) + + TypeAndVersion(opts *bind.CallOpts) (string, error) + + AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) + + AddLiquidity(opts *bind.TransactOpts, amount *big.Int) (*types.Transaction, error) + + RebalanceLiquidity(opts *bind.TransactOpts, chainSelector uint64, amount *big.Int, nativeBridgeFee *big.Int, bridgeSpecificPayload []byte) (*types.Transaction, error) + + ReceiveLiquidity(opts *bind.TransactOpts, remoteChainSelector uint64, amount *big.Int, shouldWrapNative bool, bridgeSpecificPayload []byte) (*types.Transaction, error) + + RemoveLiquidity(opts *bind.TransactOpts, amount *big.Int) (*types.Transaction, error) + + SetCrossChainRebalancer(opts *bind.TransactOpts, crossChainLiqManager ILiquidityManagerCrossChainRebalancerArgs) (*types.Transaction, error) + + SetCrossChainRebalancers(opts *bind.TransactOpts, crossChainRebalancers []ILiquidityManagerCrossChainRebalancerArgs) (*types.Transaction, error) + + SetFinanceRole(opts *bind.TransactOpts, finance common.Address) (*types.Transaction, error) + + SetLocalLiquidityContainer(opts *bind.TransactOpts, localLiquidityContainer common.Address) (*types.Transaction, error) + + SetMinimumLiquidity(opts *bind.TransactOpts, minimumLiquidity *big.Int) (*types.Transaction, error) + + SetOCR3Config(opts *bind.TransactOpts, signers []common.Address, transmitters []common.Address, f uint8, onchainConfig []byte, offchainConfigVersion uint64, offchainConfig []byte) (*types.Transaction, error) + + TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) + + Transmit(opts *bind.TransactOpts, reportContext [3][32]byte, report []byte, rs [][32]byte, ss [][32]byte, rawVs [32]byte) (*types.Transaction, error) + + WithdrawERC20(opts *bind.TransactOpts, token common.Address, amount *big.Int, destination common.Address) (*types.Transaction, error) + + WithdrawNative(opts *bind.TransactOpts, amount *big.Int, destination common.Address) (*types.Transaction, error) + + Receive(opts *bind.TransactOpts) (*types.Transaction, error) + + FilterConfigSet(opts *bind.FilterOpts) (*LiquidityManagerConfigSetIterator, error) + + WatchConfigSet(opts *bind.WatchOpts, sink chan<- *LiquidityManagerConfigSet) (event.Subscription, error) + + ParseConfigSet(log types.Log) (*LiquidityManagerConfigSet, error) + + FilterCrossChainRebalancerSet(opts *bind.FilterOpts, remoteChainSelector []uint64) (*LiquidityManagerCrossChainRebalancerSetIterator, error) + + WatchCrossChainRebalancerSet(opts *bind.WatchOpts, sink chan<- *LiquidityManagerCrossChainRebalancerSet, remoteChainSelector []uint64) (event.Subscription, error) + + ParseCrossChainRebalancerSet(log types.Log) (*LiquidityManagerCrossChainRebalancerSet, error) + + FilterFinalizationFailed(opts *bind.FilterOpts, ocrSeqNum []uint64, remoteChainSelector []uint64) (*LiquidityManagerFinalizationFailedIterator, error) + + WatchFinalizationFailed(opts *bind.WatchOpts, sink chan<- *LiquidityManagerFinalizationFailed, ocrSeqNum []uint64, remoteChainSelector []uint64) (event.Subscription, error) + + ParseFinalizationFailed(log types.Log) (*LiquidityManagerFinalizationFailed, error) + + FilterFinalizationStepCompleted(opts *bind.FilterOpts, ocrSeqNum []uint64, remoteChainSelector []uint64) (*LiquidityManagerFinalizationStepCompletedIterator, error) + + WatchFinalizationStepCompleted(opts *bind.WatchOpts, sink chan<- *LiquidityManagerFinalizationStepCompleted, ocrSeqNum []uint64, remoteChainSelector []uint64) (event.Subscription, error) + + ParseFinalizationStepCompleted(log types.Log) (*LiquidityManagerFinalizationStepCompleted, error) + + FilterFinanceRoleSet(opts *bind.FilterOpts) (*LiquidityManagerFinanceRoleSetIterator, error) + + WatchFinanceRoleSet(opts *bind.WatchOpts, sink chan<- *LiquidityManagerFinanceRoleSet) (event.Subscription, error) + + ParseFinanceRoleSet(log types.Log) (*LiquidityManagerFinanceRoleSet, error) + + FilterLiquidityAddedToContainer(opts *bind.FilterOpts, provider []common.Address, amount []*big.Int) (*LiquidityManagerLiquidityAddedToContainerIterator, error) + + WatchLiquidityAddedToContainer(opts *bind.WatchOpts, sink chan<- *LiquidityManagerLiquidityAddedToContainer, provider []common.Address, amount []*big.Int) (event.Subscription, error) + + ParseLiquidityAddedToContainer(log types.Log) (*LiquidityManagerLiquidityAddedToContainer, error) + + FilterLiquidityContainerSet(opts *bind.FilterOpts, newLiquidityContainer []common.Address) (*LiquidityManagerLiquidityContainerSetIterator, error) + + WatchLiquidityContainerSet(opts *bind.WatchOpts, sink chan<- *LiquidityManagerLiquidityContainerSet, newLiquidityContainer []common.Address) (event.Subscription, error) + + ParseLiquidityContainerSet(log types.Log) (*LiquidityManagerLiquidityContainerSet, error) + + FilterLiquidityRemovedFromContainer(opts *bind.FilterOpts, remover []common.Address, amount []*big.Int) (*LiquidityManagerLiquidityRemovedFromContainerIterator, error) + + WatchLiquidityRemovedFromContainer(opts *bind.WatchOpts, sink chan<- *LiquidityManagerLiquidityRemovedFromContainer, remover []common.Address, amount []*big.Int) (event.Subscription, error) + + ParseLiquidityRemovedFromContainer(log types.Log) (*LiquidityManagerLiquidityRemovedFromContainer, error) + + FilterLiquidityTransferred(opts *bind.FilterOpts, ocrSeqNum []uint64, fromChainSelector []uint64, toChainSelector []uint64) (*LiquidityManagerLiquidityTransferredIterator, error) + + WatchLiquidityTransferred(opts *bind.WatchOpts, sink chan<- *LiquidityManagerLiquidityTransferred, ocrSeqNum []uint64, fromChainSelector []uint64, toChainSelector []uint64) (event.Subscription, error) + + ParseLiquidityTransferred(log types.Log) (*LiquidityManagerLiquidityTransferred, error) + + FilterMinimumLiquiditySet(opts *bind.FilterOpts) (*LiquidityManagerMinimumLiquiditySetIterator, error) + + WatchMinimumLiquiditySet(opts *bind.WatchOpts, sink chan<- *LiquidityManagerMinimumLiquiditySet) (event.Subscription, error) + + ParseMinimumLiquiditySet(log types.Log) (*LiquidityManagerMinimumLiquiditySet, error) + + FilterNativeDeposited(opts *bind.FilterOpts) (*LiquidityManagerNativeDepositedIterator, error) + + WatchNativeDeposited(opts *bind.WatchOpts, sink chan<- *LiquidityManagerNativeDeposited) (event.Subscription, error) + + ParseNativeDeposited(log types.Log) (*LiquidityManagerNativeDeposited, error) + + FilterNativeWithdrawn(opts *bind.FilterOpts) (*LiquidityManagerNativeWithdrawnIterator, error) + + WatchNativeWithdrawn(opts *bind.WatchOpts, sink chan<- *LiquidityManagerNativeWithdrawn) (event.Subscription, error) + + ParseNativeWithdrawn(log types.Log) (*LiquidityManagerNativeWithdrawn, error) + + FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*LiquidityManagerOwnershipTransferRequestedIterator, error) + + WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *LiquidityManagerOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferRequested(log types.Log) (*LiquidityManagerOwnershipTransferRequested, error) + + FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*LiquidityManagerOwnershipTransferredIterator, error) + + WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *LiquidityManagerOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferred(log types.Log) (*LiquidityManagerOwnershipTransferred, error) + + FilterTransmitted(opts *bind.FilterOpts) (*LiquidityManagerTransmittedIterator, error) + + WatchTransmitted(opts *bind.WatchOpts, sink chan<- *LiquidityManagerTransmitted) (event.Subscription, error) + + ParseTransmitted(log types.Log) (*LiquidityManagerTransmitted, error) + + ParseLog(log types.Log) (generated.AbigenLog, error) + + Address() common.Address +} diff --git a/core/gethwrappers/liquiditymanager/generated/mock_l1_bridge_adapter/mock_l1_bridge_adapter.go b/core/gethwrappers/liquiditymanager/generated/mock_l1_bridge_adapter/mock_l1_bridge_adapter.go new file mode 100644 index 00000000000..bbfbb1079d5 --- /dev/null +++ b/core/gethwrappers/liquiditymanager/generated/mock_l1_bridge_adapter/mock_l1_bridge_adapter.go @@ -0,0 +1,660 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package mock_l1_bridge_adapter + +import ( + "errors" + "fmt" + "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" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" +) + +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +type MockL1BridgeAdapterFinalizePayload struct { + Nonce *big.Int + Amount *big.Int +} + +type MockL1BridgeAdapterPayload struct { + Action uint8 + Data []byte +} + +type MockL1BridgeAdapterProvePayload struct { + Nonce *big.Int +} + +var MockL1BridgeAdapterMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"internalType\":\"contractIERC20\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"holdNative\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"BridgeAddressCannotBeZero\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"wanted\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"got\",\"type\":\"uint256\"}],\"name\":\"InsufficientEthValue\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InsufficientLiquidity\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidFinalizationAction\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"MsgShouldNotContainValue\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"msgValue\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"MsgValueDoesNotMatchAmount\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NativeSendFailed\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"NonceAlreadyUsed\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"NonceNotProven\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"provider\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"LiquidityAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"provider\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"LiquidityRemoved\",\"type\":\"event\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"internalType\":\"structMockL1BridgeAdapter.FinalizePayload\",\"name\":\"payload\",\"type\":\"tuple\"}],\"name\":\"encodeFinalizePayload\",\"outputs\":[],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"enumMockL1BridgeAdapter.FinalizationAction\",\"name\":\"action\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"internalType\":\"structMockL1BridgeAdapter.Payload\",\"name\":\"payload\",\"type\":\"tuple\"}],\"name\":\"encodePayload\",\"outputs\":[],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"}],\"internalType\":\"structMockL1BridgeAdapter.ProvePayload\",\"name\":\"payload\",\"type\":\"tuple\"}],\"name\":\"encodeProvePayload\",\"outputs\":[],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"localReceiver\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"bridgeSpecificPayload\",\"type\":\"bytes\"}],\"name\":\"finalizeWithdrawERC20\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getBridgeFeeInNative\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"provideLiquidity\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"localToken\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"sendERC20\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"withdrawLiquidity\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]", + Bin: "0x60c0604052600160005534801561001557600080fd5b5060405161126f38038061126f8339810160408190526100349161004c565b6001600160a01b03909116608052151560a052610097565b6000806040838503121561005f57600080fd5b82516001600160a01b038116811461007657600080fd5b6020840151909250801515811461008c57600080fd5b809150509250929050565b60805160a0516111906100df6000396000818161042801526109cf0152600081816101c2015281816102940152818161047b015281816105660152610aa701526111906000f3fe60806040526004361061007f5760003560e01c8063a71d98b71161004e578063a71d98b71461011c578063aee0c3881461013c578063eb521a4c14610157578063f19e1eb61461017757600080fd5b80630a861f2a1461008b5780632e4b1fc9146100ad578063331e5ff0146100ce57806338314bb2146100ec57600080fd5b3661008657005b600080fd5b34801561009757600080fd5b506100ab6100a6366004610c43565b610192565b005b3480156100b957600080fd5b50604051600081526020015b60405180910390f35b3480156100da57600080fd5b506100ab6100e9366004610d26565b50565b3480156100f857600080fd5b5061010c610107366004610e8a565b6102eb565b60405190151581526020016100c5565b61012f61012a366004610eeb565b610385565b6040516100c59190610fd8565b34801561014857600080fd5b506100ab6100e9366004610ff2565b34801561016357600080fd5b506100ab610172366004610c43565b61054c565b34801561018357600080fd5b506100ab6100e9366004611024565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015281907f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16906370a0823190602401602060405180830381865afa15801561021e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102429190611048565b101561027a576040517fbb55fd2700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6102bb73ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001633836105be565b604051819033907fc2c3f06e49b9f15e7b4af9055e183b0d73362e033ad82a07dec9bf984017171990600090a350565b6000806102fa83850185610d26565b905060008151600181111561031157610311611061565b036103275761031f81610697565b91505061037d565b60018151600181111561033c5761033c611061565b0361034b5761031f818661074b565b6040517fee2ef09800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b949350505050565b6040517f23b872dd0000000000000000000000000000000000000000000000000000000081523360048201523060248201526044810184905260609073ffffffffffffffffffffffffffffffffffffffff8816906323b872dd906064016020604051808303816000875af1158015610401573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104259190611090565b507f0000000000000000000000000000000000000000000000000000000000000000156104ed576040517f2e1a7d4d000000000000000000000000000000000000000000000000000000008152600481018590527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1690632e1a7d4d90602401600060405180830381600087803b1580156104d457600080fd5b505af11580156104e8573d6000803e3d6000fd5b505050505b6000805481806104fc836110b2565b9190505560405160200161051291815260200190565b604080518083037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe001815291905298975050505050505050565b61058e73ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001633308461085d565b604051819033907fc17cea59c2955cb181b03393209566960365771dbba9dc3d510180e7cb31208890600090a350565b60405173ffffffffffffffffffffffffffffffffffffffff83166024820152604481018290526106929084907fa9059cbb00000000000000000000000000000000000000000000000000000000906064015b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff00000000000000000000000000000000000000000000000000000000909316929092179091526108c1565b505050565b60008082602001518060200190518101906106b29190611111565b805160009081526001602052604090205490915060ff161561070b5780516040517f91cab50400000000000000000000000000000000000000000000000000000000815260048101919091526024015b60405180910390fd5b516000908152600160208190526040822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016909117905592915050565b60008083602001518060200190518101906107669190611135565b805160009081526001602052604090205490915060ff166107b95780516040517f974f61110000000000000000000000000000000000000000000000000000000081526004810191909152602401610702565b805160009081526002602052604090205460ff161561080a5780516040517f91cab5040000000000000000000000000000000000000000000000000000000081526004810191909152602401610702565b8051600090815260026020908152604090912080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905581015161085390846109cd565b5060019392505050565b60405173ffffffffffffffffffffffffffffffffffffffff808516602483015283166044820152606481018290526108bb9085907f23b872dd0000000000000000000000000000000000000000000000000000000090608401610610565b50505050565b6000610923826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16610ad29092919063ffffffff16565b80519091501561069257808060200190518101906109419190611090565b610692576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610702565b7f000000000000000000000000000000000000000000000000000000000000000015610a8d5760008173ffffffffffffffffffffffffffffffffffffffff168360405160006040518083038185875af1925050503d8060008114610a4d576040519150601f19603f3d011682016040523d82523d6000602084013e610a52565b606091505b5050905080610692576040517fa0c968e700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610ace73ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001682846105be565b5050565b606061037d8484600085856000808673ffffffffffffffffffffffffffffffffffffffff168587604051610b069190611167565b60006040518083038185875af1925050503d8060008114610b43576040519150601f19603f3d011682016040523d82523d6000602084013e610b48565b606091505b5091509150610b5987838387610b64565b979650505050505050565b60608315610bfa578251600003610bf35773ffffffffffffffffffffffffffffffffffffffff85163b610bf3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610702565b508161037d565b61037d8383815115610c0f5781518083602001fd5b806040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107029190610fd8565b600060208284031215610c5557600080fd5b5035919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040805190810167ffffffffffffffff81118282101715610cae57610cae610c5c565b60405290565b6040516020810167ffffffffffffffff81118282101715610cae57610cae610c5c565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715610d1e57610d1e610c5c565b604052919050565b60006020808385031215610d3957600080fd5b823567ffffffffffffffff80821115610d5157600080fd5b9084019060408287031215610d6557600080fd5b610d6d610c8b565b823560028110610d7c57600080fd5b81528284013582811115610d8f57600080fd5b80840193505086601f840112610da457600080fd5b823582811115610db657610db6610c5c565b610de6857fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f84011601610cd7565b92508083528785828601011115610dfc57600080fd5b8085850186850137600090830185015292830152509392505050565b803573ffffffffffffffffffffffffffffffffffffffff81168114610e3c57600080fd5b919050565b60008083601f840112610e5357600080fd5b50813567ffffffffffffffff811115610e6b57600080fd5b602083019150836020828501011115610e8357600080fd5b9250929050565b60008060008060608587031215610ea057600080fd5b610ea985610e18565b9350610eb760208601610e18565b9250604085013567ffffffffffffffff811115610ed357600080fd5b610edf87828801610e41565b95989497509550505050565b60008060008060008060a08789031215610f0457600080fd5b610f0d87610e18565b9550610f1b60208801610e18565b9450610f2960408801610e18565b935060608701359250608087013567ffffffffffffffff811115610f4c57600080fd5b610f5889828a01610e41565b979a9699509497509295939492505050565b60005b83811015610f85578181015183820152602001610f6d565b50506000910152565b60008151808452610fa6816020860160208601610f6a565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b602081526000610feb6020830184610f8e565b9392505050565b60006040828403121561100457600080fd5b61100c610c8b565b82358152602083013560208201528091505092915050565b60006020828403121561103657600080fd5b61103e610cb4565b9135825250919050565b60006020828403121561105a57600080fd5b5051919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b6000602082840312156110a257600080fd5b81518015158114610feb57600080fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361110a577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b5060010190565b60006020828403121561112357600080fd5b61112b610cb4565b9151825250919050565b60006040828403121561114757600080fd5b61114f610c8b565b82518152602083015160208201528091505092915050565b60008251611179818460208701610f6a565b919091019291505056fea164736f6c6343000818000a", +} + +var MockL1BridgeAdapterABI = MockL1BridgeAdapterMetaData.ABI + +var MockL1BridgeAdapterBin = MockL1BridgeAdapterMetaData.Bin + +func DeployMockL1BridgeAdapter(auth *bind.TransactOpts, backend bind.ContractBackend, token common.Address, holdNative bool) (common.Address, *types.Transaction, *MockL1BridgeAdapter, error) { + parsed, err := MockL1BridgeAdapterMetaData.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(MockL1BridgeAdapterBin), backend, token, holdNative) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &MockL1BridgeAdapter{address: address, abi: *parsed, MockL1BridgeAdapterCaller: MockL1BridgeAdapterCaller{contract: contract}, MockL1BridgeAdapterTransactor: MockL1BridgeAdapterTransactor{contract: contract}, MockL1BridgeAdapterFilterer: MockL1BridgeAdapterFilterer{contract: contract}}, nil +} + +type MockL1BridgeAdapter struct { + address common.Address + abi abi.ABI + MockL1BridgeAdapterCaller + MockL1BridgeAdapterTransactor + MockL1BridgeAdapterFilterer +} + +type MockL1BridgeAdapterCaller struct { + contract *bind.BoundContract +} + +type MockL1BridgeAdapterTransactor struct { + contract *bind.BoundContract +} + +type MockL1BridgeAdapterFilterer struct { + contract *bind.BoundContract +} + +type MockL1BridgeAdapterSession struct { + Contract *MockL1BridgeAdapter + CallOpts bind.CallOpts + TransactOpts bind.TransactOpts +} + +type MockL1BridgeAdapterCallerSession struct { + Contract *MockL1BridgeAdapterCaller + CallOpts bind.CallOpts +} + +type MockL1BridgeAdapterTransactorSession struct { + Contract *MockL1BridgeAdapterTransactor + TransactOpts bind.TransactOpts +} + +type MockL1BridgeAdapterRaw struct { + Contract *MockL1BridgeAdapter +} + +type MockL1BridgeAdapterCallerRaw struct { + Contract *MockL1BridgeAdapterCaller +} + +type MockL1BridgeAdapterTransactorRaw struct { + Contract *MockL1BridgeAdapterTransactor +} + +func NewMockL1BridgeAdapter(address common.Address, backend bind.ContractBackend) (*MockL1BridgeAdapter, error) { + abi, err := abi.JSON(strings.NewReader(MockL1BridgeAdapterABI)) + if err != nil { + return nil, err + } + contract, err := bindMockL1BridgeAdapter(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &MockL1BridgeAdapter{address: address, abi: abi, MockL1BridgeAdapterCaller: MockL1BridgeAdapterCaller{contract: contract}, MockL1BridgeAdapterTransactor: MockL1BridgeAdapterTransactor{contract: contract}, MockL1BridgeAdapterFilterer: MockL1BridgeAdapterFilterer{contract: contract}}, nil +} + +func NewMockL1BridgeAdapterCaller(address common.Address, caller bind.ContractCaller) (*MockL1BridgeAdapterCaller, error) { + contract, err := bindMockL1BridgeAdapter(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &MockL1BridgeAdapterCaller{contract: contract}, nil +} + +func NewMockL1BridgeAdapterTransactor(address common.Address, transactor bind.ContractTransactor) (*MockL1BridgeAdapterTransactor, error) { + contract, err := bindMockL1BridgeAdapter(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &MockL1BridgeAdapterTransactor{contract: contract}, nil +} + +func NewMockL1BridgeAdapterFilterer(address common.Address, filterer bind.ContractFilterer) (*MockL1BridgeAdapterFilterer, error) { + contract, err := bindMockL1BridgeAdapter(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &MockL1BridgeAdapterFilterer{contract: contract}, nil +} + +func bindMockL1BridgeAdapter(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := MockL1BridgeAdapterMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +func (_MockL1BridgeAdapter *MockL1BridgeAdapterRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _MockL1BridgeAdapter.Contract.MockL1BridgeAdapterCaller.contract.Call(opts, result, method, params...) +} + +func (_MockL1BridgeAdapter *MockL1BridgeAdapterRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _MockL1BridgeAdapter.Contract.MockL1BridgeAdapterTransactor.contract.Transfer(opts) +} + +func (_MockL1BridgeAdapter *MockL1BridgeAdapterRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _MockL1BridgeAdapter.Contract.MockL1BridgeAdapterTransactor.contract.Transact(opts, method, params...) +} + +func (_MockL1BridgeAdapter *MockL1BridgeAdapterCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _MockL1BridgeAdapter.Contract.contract.Call(opts, result, method, params...) +} + +func (_MockL1BridgeAdapter *MockL1BridgeAdapterTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _MockL1BridgeAdapter.Contract.contract.Transfer(opts) +} + +func (_MockL1BridgeAdapter *MockL1BridgeAdapterTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _MockL1BridgeAdapter.Contract.contract.Transact(opts, method, params...) +} + +func (_MockL1BridgeAdapter *MockL1BridgeAdapterCaller) EncodeFinalizePayload(opts *bind.CallOpts, payload MockL1BridgeAdapterFinalizePayload) error { + var out []interface{} + err := _MockL1BridgeAdapter.contract.Call(opts, &out, "encodeFinalizePayload", payload) + + if err != nil { + return err + } + + return err + +} + +func (_MockL1BridgeAdapter *MockL1BridgeAdapterSession) EncodeFinalizePayload(payload MockL1BridgeAdapterFinalizePayload) error { + return _MockL1BridgeAdapter.Contract.EncodeFinalizePayload(&_MockL1BridgeAdapter.CallOpts, payload) +} + +func (_MockL1BridgeAdapter *MockL1BridgeAdapterCallerSession) EncodeFinalizePayload(payload MockL1BridgeAdapterFinalizePayload) error { + return _MockL1BridgeAdapter.Contract.EncodeFinalizePayload(&_MockL1BridgeAdapter.CallOpts, payload) +} + +func (_MockL1BridgeAdapter *MockL1BridgeAdapterCaller) EncodePayload(opts *bind.CallOpts, payload MockL1BridgeAdapterPayload) error { + var out []interface{} + err := _MockL1BridgeAdapter.contract.Call(opts, &out, "encodePayload", payload) + + if err != nil { + return err + } + + return err + +} + +func (_MockL1BridgeAdapter *MockL1BridgeAdapterSession) EncodePayload(payload MockL1BridgeAdapterPayload) error { + return _MockL1BridgeAdapter.Contract.EncodePayload(&_MockL1BridgeAdapter.CallOpts, payload) +} + +func (_MockL1BridgeAdapter *MockL1BridgeAdapterCallerSession) EncodePayload(payload MockL1BridgeAdapterPayload) error { + return _MockL1BridgeAdapter.Contract.EncodePayload(&_MockL1BridgeAdapter.CallOpts, payload) +} + +func (_MockL1BridgeAdapter *MockL1BridgeAdapterCaller) EncodeProvePayload(opts *bind.CallOpts, payload MockL1BridgeAdapterProvePayload) error { + var out []interface{} + err := _MockL1BridgeAdapter.contract.Call(opts, &out, "encodeProvePayload", payload) + + if err != nil { + return err + } + + return err + +} + +func (_MockL1BridgeAdapter *MockL1BridgeAdapterSession) EncodeProvePayload(payload MockL1BridgeAdapterProvePayload) error { + return _MockL1BridgeAdapter.Contract.EncodeProvePayload(&_MockL1BridgeAdapter.CallOpts, payload) +} + +func (_MockL1BridgeAdapter *MockL1BridgeAdapterCallerSession) EncodeProvePayload(payload MockL1BridgeAdapterProvePayload) error { + return _MockL1BridgeAdapter.Contract.EncodeProvePayload(&_MockL1BridgeAdapter.CallOpts, payload) +} + +func (_MockL1BridgeAdapter *MockL1BridgeAdapterCaller) GetBridgeFeeInNative(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _MockL1BridgeAdapter.contract.Call(opts, &out, "getBridgeFeeInNative") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_MockL1BridgeAdapter *MockL1BridgeAdapterSession) GetBridgeFeeInNative() (*big.Int, error) { + return _MockL1BridgeAdapter.Contract.GetBridgeFeeInNative(&_MockL1BridgeAdapter.CallOpts) +} + +func (_MockL1BridgeAdapter *MockL1BridgeAdapterCallerSession) GetBridgeFeeInNative() (*big.Int, error) { + return _MockL1BridgeAdapter.Contract.GetBridgeFeeInNative(&_MockL1BridgeAdapter.CallOpts) +} + +func (_MockL1BridgeAdapter *MockL1BridgeAdapterTransactor) FinalizeWithdrawERC20(opts *bind.TransactOpts, arg0 common.Address, localReceiver common.Address, bridgeSpecificPayload []byte) (*types.Transaction, error) { + return _MockL1BridgeAdapter.contract.Transact(opts, "finalizeWithdrawERC20", arg0, localReceiver, bridgeSpecificPayload) +} + +func (_MockL1BridgeAdapter *MockL1BridgeAdapterSession) FinalizeWithdrawERC20(arg0 common.Address, localReceiver common.Address, bridgeSpecificPayload []byte) (*types.Transaction, error) { + return _MockL1BridgeAdapter.Contract.FinalizeWithdrawERC20(&_MockL1BridgeAdapter.TransactOpts, arg0, localReceiver, bridgeSpecificPayload) +} + +func (_MockL1BridgeAdapter *MockL1BridgeAdapterTransactorSession) FinalizeWithdrawERC20(arg0 common.Address, localReceiver common.Address, bridgeSpecificPayload []byte) (*types.Transaction, error) { + return _MockL1BridgeAdapter.Contract.FinalizeWithdrawERC20(&_MockL1BridgeAdapter.TransactOpts, arg0, localReceiver, bridgeSpecificPayload) +} + +func (_MockL1BridgeAdapter *MockL1BridgeAdapterTransactor) ProvideLiquidity(opts *bind.TransactOpts, amount *big.Int) (*types.Transaction, error) { + return _MockL1BridgeAdapter.contract.Transact(opts, "provideLiquidity", amount) +} + +func (_MockL1BridgeAdapter *MockL1BridgeAdapterSession) ProvideLiquidity(amount *big.Int) (*types.Transaction, error) { + return _MockL1BridgeAdapter.Contract.ProvideLiquidity(&_MockL1BridgeAdapter.TransactOpts, amount) +} + +func (_MockL1BridgeAdapter *MockL1BridgeAdapterTransactorSession) ProvideLiquidity(amount *big.Int) (*types.Transaction, error) { + return _MockL1BridgeAdapter.Contract.ProvideLiquidity(&_MockL1BridgeAdapter.TransactOpts, amount) +} + +func (_MockL1BridgeAdapter *MockL1BridgeAdapterTransactor) SendERC20(opts *bind.TransactOpts, localToken common.Address, arg1 common.Address, arg2 common.Address, amount *big.Int, arg4 []byte) (*types.Transaction, error) { + return _MockL1BridgeAdapter.contract.Transact(opts, "sendERC20", localToken, arg1, arg2, amount, arg4) +} + +func (_MockL1BridgeAdapter *MockL1BridgeAdapterSession) SendERC20(localToken common.Address, arg1 common.Address, arg2 common.Address, amount *big.Int, arg4 []byte) (*types.Transaction, error) { + return _MockL1BridgeAdapter.Contract.SendERC20(&_MockL1BridgeAdapter.TransactOpts, localToken, arg1, arg2, amount, arg4) +} + +func (_MockL1BridgeAdapter *MockL1BridgeAdapterTransactorSession) SendERC20(localToken common.Address, arg1 common.Address, arg2 common.Address, amount *big.Int, arg4 []byte) (*types.Transaction, error) { + return _MockL1BridgeAdapter.Contract.SendERC20(&_MockL1BridgeAdapter.TransactOpts, localToken, arg1, arg2, amount, arg4) +} + +func (_MockL1BridgeAdapter *MockL1BridgeAdapterTransactor) WithdrawLiquidity(opts *bind.TransactOpts, amount *big.Int) (*types.Transaction, error) { + return _MockL1BridgeAdapter.contract.Transact(opts, "withdrawLiquidity", amount) +} + +func (_MockL1BridgeAdapter *MockL1BridgeAdapterSession) WithdrawLiquidity(amount *big.Int) (*types.Transaction, error) { + return _MockL1BridgeAdapter.Contract.WithdrawLiquidity(&_MockL1BridgeAdapter.TransactOpts, amount) +} + +func (_MockL1BridgeAdapter *MockL1BridgeAdapterTransactorSession) WithdrawLiquidity(amount *big.Int) (*types.Transaction, error) { + return _MockL1BridgeAdapter.Contract.WithdrawLiquidity(&_MockL1BridgeAdapter.TransactOpts, amount) +} + +func (_MockL1BridgeAdapter *MockL1BridgeAdapterTransactor) Receive(opts *bind.TransactOpts) (*types.Transaction, error) { + return _MockL1BridgeAdapter.contract.RawTransact(opts, nil) +} + +func (_MockL1BridgeAdapter *MockL1BridgeAdapterSession) Receive() (*types.Transaction, error) { + return _MockL1BridgeAdapter.Contract.Receive(&_MockL1BridgeAdapter.TransactOpts) +} + +func (_MockL1BridgeAdapter *MockL1BridgeAdapterTransactorSession) Receive() (*types.Transaction, error) { + return _MockL1BridgeAdapter.Contract.Receive(&_MockL1BridgeAdapter.TransactOpts) +} + +type MockL1BridgeAdapterLiquidityAddedIterator struct { + Event *MockL1BridgeAdapterLiquidityAdded + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *MockL1BridgeAdapterLiquidityAddedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(MockL1BridgeAdapterLiquidityAdded) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(MockL1BridgeAdapterLiquidityAdded) + 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() + } +} + +func (it *MockL1BridgeAdapterLiquidityAddedIterator) Error() error { + return it.fail +} + +func (it *MockL1BridgeAdapterLiquidityAddedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type MockL1BridgeAdapterLiquidityAdded struct { + Provider common.Address + Amount *big.Int + Raw types.Log +} + +func (_MockL1BridgeAdapter *MockL1BridgeAdapterFilterer) FilterLiquidityAdded(opts *bind.FilterOpts, provider []common.Address, amount []*big.Int) (*MockL1BridgeAdapterLiquidityAddedIterator, error) { + + var providerRule []interface{} + for _, providerItem := range provider { + providerRule = append(providerRule, providerItem) + } + var amountRule []interface{} + for _, amountItem := range amount { + amountRule = append(amountRule, amountItem) + } + + logs, sub, err := _MockL1BridgeAdapter.contract.FilterLogs(opts, "LiquidityAdded", providerRule, amountRule) + if err != nil { + return nil, err + } + return &MockL1BridgeAdapterLiquidityAddedIterator{contract: _MockL1BridgeAdapter.contract, event: "LiquidityAdded", logs: logs, sub: sub}, nil +} + +func (_MockL1BridgeAdapter *MockL1BridgeAdapterFilterer) WatchLiquidityAdded(opts *bind.WatchOpts, sink chan<- *MockL1BridgeAdapterLiquidityAdded, provider []common.Address, amount []*big.Int) (event.Subscription, error) { + + var providerRule []interface{} + for _, providerItem := range provider { + providerRule = append(providerRule, providerItem) + } + var amountRule []interface{} + for _, amountItem := range amount { + amountRule = append(amountRule, amountItem) + } + + logs, sub, err := _MockL1BridgeAdapter.contract.WatchLogs(opts, "LiquidityAdded", providerRule, amountRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(MockL1BridgeAdapterLiquidityAdded) + if err := _MockL1BridgeAdapter.contract.UnpackLog(event, "LiquidityAdded", 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 +} + +func (_MockL1BridgeAdapter *MockL1BridgeAdapterFilterer) ParseLiquidityAdded(log types.Log) (*MockL1BridgeAdapterLiquidityAdded, error) { + event := new(MockL1BridgeAdapterLiquidityAdded) + if err := _MockL1BridgeAdapter.contract.UnpackLog(event, "LiquidityAdded", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type MockL1BridgeAdapterLiquidityRemovedIterator struct { + Event *MockL1BridgeAdapterLiquidityRemoved + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *MockL1BridgeAdapterLiquidityRemovedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(MockL1BridgeAdapterLiquidityRemoved) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(MockL1BridgeAdapterLiquidityRemoved) + 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() + } +} + +func (it *MockL1BridgeAdapterLiquidityRemovedIterator) Error() error { + return it.fail +} + +func (it *MockL1BridgeAdapterLiquidityRemovedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type MockL1BridgeAdapterLiquidityRemoved struct { + Provider common.Address + Amount *big.Int + Raw types.Log +} + +func (_MockL1BridgeAdapter *MockL1BridgeAdapterFilterer) FilterLiquidityRemoved(opts *bind.FilterOpts, provider []common.Address, amount []*big.Int) (*MockL1BridgeAdapterLiquidityRemovedIterator, error) { + + var providerRule []interface{} + for _, providerItem := range provider { + providerRule = append(providerRule, providerItem) + } + var amountRule []interface{} + for _, amountItem := range amount { + amountRule = append(amountRule, amountItem) + } + + logs, sub, err := _MockL1BridgeAdapter.contract.FilterLogs(opts, "LiquidityRemoved", providerRule, amountRule) + if err != nil { + return nil, err + } + return &MockL1BridgeAdapterLiquidityRemovedIterator{contract: _MockL1BridgeAdapter.contract, event: "LiquidityRemoved", logs: logs, sub: sub}, nil +} + +func (_MockL1BridgeAdapter *MockL1BridgeAdapterFilterer) WatchLiquidityRemoved(opts *bind.WatchOpts, sink chan<- *MockL1BridgeAdapterLiquidityRemoved, provider []common.Address, amount []*big.Int) (event.Subscription, error) { + + var providerRule []interface{} + for _, providerItem := range provider { + providerRule = append(providerRule, providerItem) + } + var amountRule []interface{} + for _, amountItem := range amount { + amountRule = append(amountRule, amountItem) + } + + logs, sub, err := _MockL1BridgeAdapter.contract.WatchLogs(opts, "LiquidityRemoved", providerRule, amountRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(MockL1BridgeAdapterLiquidityRemoved) + if err := _MockL1BridgeAdapter.contract.UnpackLog(event, "LiquidityRemoved", 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 +} + +func (_MockL1BridgeAdapter *MockL1BridgeAdapterFilterer) ParseLiquidityRemoved(log types.Log) (*MockL1BridgeAdapterLiquidityRemoved, error) { + event := new(MockL1BridgeAdapterLiquidityRemoved) + if err := _MockL1BridgeAdapter.contract.UnpackLog(event, "LiquidityRemoved", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +func (_MockL1BridgeAdapter *MockL1BridgeAdapter) ParseLog(log types.Log) (generated.AbigenLog, error) { + switch log.Topics[0] { + case _MockL1BridgeAdapter.abi.Events["LiquidityAdded"].ID: + return _MockL1BridgeAdapter.ParseLiquidityAdded(log) + case _MockL1BridgeAdapter.abi.Events["LiquidityRemoved"].ID: + return _MockL1BridgeAdapter.ParseLiquidityRemoved(log) + + default: + return nil, fmt.Errorf("abigen wrapper received unknown log topic: %v", log.Topics[0]) + } +} + +func (MockL1BridgeAdapterLiquidityAdded) Topic() common.Hash { + return common.HexToHash("0xc17cea59c2955cb181b03393209566960365771dbba9dc3d510180e7cb312088") +} + +func (MockL1BridgeAdapterLiquidityRemoved) Topic() common.Hash { + return common.HexToHash("0xc2c3f06e49b9f15e7b4af9055e183b0d73362e033ad82a07dec9bf9840171719") +} + +func (_MockL1BridgeAdapter *MockL1BridgeAdapter) Address() common.Address { + return _MockL1BridgeAdapter.address +} + +type MockL1BridgeAdapterInterface interface { + EncodeFinalizePayload(opts *bind.CallOpts, payload MockL1BridgeAdapterFinalizePayload) error + + EncodePayload(opts *bind.CallOpts, payload MockL1BridgeAdapterPayload) error + + EncodeProvePayload(opts *bind.CallOpts, payload MockL1BridgeAdapterProvePayload) error + + GetBridgeFeeInNative(opts *bind.CallOpts) (*big.Int, error) + + FinalizeWithdrawERC20(opts *bind.TransactOpts, arg0 common.Address, localReceiver common.Address, bridgeSpecificPayload []byte) (*types.Transaction, error) + + ProvideLiquidity(opts *bind.TransactOpts, amount *big.Int) (*types.Transaction, error) + + SendERC20(opts *bind.TransactOpts, localToken common.Address, arg1 common.Address, arg2 common.Address, amount *big.Int, arg4 []byte) (*types.Transaction, error) + + WithdrawLiquidity(opts *bind.TransactOpts, amount *big.Int) (*types.Transaction, error) + + Receive(opts *bind.TransactOpts) (*types.Transaction, error) + + FilterLiquidityAdded(opts *bind.FilterOpts, provider []common.Address, amount []*big.Int) (*MockL1BridgeAdapterLiquidityAddedIterator, error) + + WatchLiquidityAdded(opts *bind.WatchOpts, sink chan<- *MockL1BridgeAdapterLiquidityAdded, provider []common.Address, amount []*big.Int) (event.Subscription, error) + + ParseLiquidityAdded(log types.Log) (*MockL1BridgeAdapterLiquidityAdded, error) + + FilterLiquidityRemoved(opts *bind.FilterOpts, provider []common.Address, amount []*big.Int) (*MockL1BridgeAdapterLiquidityRemovedIterator, error) + + WatchLiquidityRemoved(opts *bind.WatchOpts, sink chan<- *MockL1BridgeAdapterLiquidityRemoved, provider []common.Address, amount []*big.Int) (event.Subscription, error) + + ParseLiquidityRemoved(log types.Log) (*MockL1BridgeAdapterLiquidityRemoved, error) + + ParseLog(log types.Log) (generated.AbigenLog, error) + + Address() common.Address +} diff --git a/core/gethwrappers/liquiditymanager/generated/mock_l2_bridge_adapter/mock_l2_bridge_adapter.go b/core/gethwrappers/liquiditymanager/generated/mock_l2_bridge_adapter/mock_l2_bridge_adapter.go new file mode 100644 index 00000000000..463214247fd --- /dev/null +++ b/core/gethwrappers/liquiditymanager/generated/mock_l2_bridge_adapter/mock_l2_bridge_adapter.go @@ -0,0 +1,240 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package mock_l2_bridge_adapter + +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" +) + +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +var MockL2BridgeAdapterMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[],\"name\":\"BridgeAddressCannotBeZero\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"wanted\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"got\",\"type\":\"uint256\"}],\"name\":\"InsufficientEthValue\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"MsgShouldNotContainValue\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"msgValue\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"MsgValueDoesNotMatchAmount\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"finalizeWithdrawERC20\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getBridgeFeeInNative\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"localToken\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"sendERC20\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"function\"}]", + Bin: "0x608060405234801561001057600080fd5b5061035f806100206000396000f3fe6080604052600436106100345760003560e01c80632e4b1fc91461003957806338314bb21461005a578063a71d98b71461008f575b600080fd5b34801561004557600080fd5b50604051600081526020015b60405180910390f35b34801561006657600080fd5b5061007f6100753660046101dc565b6001949350505050565b6040519015158152602001610051565b6100a261009d36600461023d565b6100af565b60405161005191906102bc565b6040517f23b872dd0000000000000000000000000000000000000000000000000000000081523360048201523060248201526044810184905260609073ffffffffffffffffffffffffffffffffffffffff8816906323b872dd906064016020604051808303816000875af115801561012b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061014f9190610329565b50506040805160208101909152600081529695505050505050565b803573ffffffffffffffffffffffffffffffffffffffff8116811461018e57600080fd5b919050565b60008083601f8401126101a557600080fd5b50813567ffffffffffffffff8111156101bd57600080fd5b6020830191508360208285010111156101d557600080fd5b9250929050565b600080600080606085870312156101f257600080fd5b6101fb8561016a565b93506102096020860161016a565b9250604085013567ffffffffffffffff81111561022557600080fd5b61023187828801610193565b95989497509550505050565b60008060008060008060a0878903121561025657600080fd5b61025f8761016a565b955061026d6020880161016a565b945061027b6040880161016a565b935060608701359250608087013567ffffffffffffffff81111561029e57600080fd5b6102aa89828a01610193565b979a9699509497509295939492505050565b60006020808352835180602085015260005b818110156102ea578581018301518582016040015282016102ce565b5060006040828601015260407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8301168501019250505092915050565b60006020828403121561033b57600080fd5b8151801515811461034b57600080fd5b939250505056fea164736f6c6343000818000a", +} + +var MockL2BridgeAdapterABI = MockL2BridgeAdapterMetaData.ABI + +var MockL2BridgeAdapterBin = MockL2BridgeAdapterMetaData.Bin + +func DeployMockL2BridgeAdapter(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *MockL2BridgeAdapter, error) { + parsed, err := MockL2BridgeAdapterMetaData.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(MockL2BridgeAdapterBin), backend) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &MockL2BridgeAdapter{address: address, abi: *parsed, MockL2BridgeAdapterCaller: MockL2BridgeAdapterCaller{contract: contract}, MockL2BridgeAdapterTransactor: MockL2BridgeAdapterTransactor{contract: contract}, MockL2BridgeAdapterFilterer: MockL2BridgeAdapterFilterer{contract: contract}}, nil +} + +type MockL2BridgeAdapter struct { + address common.Address + abi abi.ABI + MockL2BridgeAdapterCaller + MockL2BridgeAdapterTransactor + MockL2BridgeAdapterFilterer +} + +type MockL2BridgeAdapterCaller struct { + contract *bind.BoundContract +} + +type MockL2BridgeAdapterTransactor struct { + contract *bind.BoundContract +} + +type MockL2BridgeAdapterFilterer struct { + contract *bind.BoundContract +} + +type MockL2BridgeAdapterSession struct { + Contract *MockL2BridgeAdapter + CallOpts bind.CallOpts + TransactOpts bind.TransactOpts +} + +type MockL2BridgeAdapterCallerSession struct { + Contract *MockL2BridgeAdapterCaller + CallOpts bind.CallOpts +} + +type MockL2BridgeAdapterTransactorSession struct { + Contract *MockL2BridgeAdapterTransactor + TransactOpts bind.TransactOpts +} + +type MockL2BridgeAdapterRaw struct { + Contract *MockL2BridgeAdapter +} + +type MockL2BridgeAdapterCallerRaw struct { + Contract *MockL2BridgeAdapterCaller +} + +type MockL2BridgeAdapterTransactorRaw struct { + Contract *MockL2BridgeAdapterTransactor +} + +func NewMockL2BridgeAdapter(address common.Address, backend bind.ContractBackend) (*MockL2BridgeAdapter, error) { + abi, err := abi.JSON(strings.NewReader(MockL2BridgeAdapterABI)) + if err != nil { + return nil, err + } + contract, err := bindMockL2BridgeAdapter(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &MockL2BridgeAdapter{address: address, abi: abi, MockL2BridgeAdapterCaller: MockL2BridgeAdapterCaller{contract: contract}, MockL2BridgeAdapterTransactor: MockL2BridgeAdapterTransactor{contract: contract}, MockL2BridgeAdapterFilterer: MockL2BridgeAdapterFilterer{contract: contract}}, nil +} + +func NewMockL2BridgeAdapterCaller(address common.Address, caller bind.ContractCaller) (*MockL2BridgeAdapterCaller, error) { + contract, err := bindMockL2BridgeAdapter(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &MockL2BridgeAdapterCaller{contract: contract}, nil +} + +func NewMockL2BridgeAdapterTransactor(address common.Address, transactor bind.ContractTransactor) (*MockL2BridgeAdapterTransactor, error) { + contract, err := bindMockL2BridgeAdapter(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &MockL2BridgeAdapterTransactor{contract: contract}, nil +} + +func NewMockL2BridgeAdapterFilterer(address common.Address, filterer bind.ContractFilterer) (*MockL2BridgeAdapterFilterer, error) { + contract, err := bindMockL2BridgeAdapter(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &MockL2BridgeAdapterFilterer{contract: contract}, nil +} + +func bindMockL2BridgeAdapter(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := MockL2BridgeAdapterMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +func (_MockL2BridgeAdapter *MockL2BridgeAdapterRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _MockL2BridgeAdapter.Contract.MockL2BridgeAdapterCaller.contract.Call(opts, result, method, params...) +} + +func (_MockL2BridgeAdapter *MockL2BridgeAdapterRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _MockL2BridgeAdapter.Contract.MockL2BridgeAdapterTransactor.contract.Transfer(opts) +} + +func (_MockL2BridgeAdapter *MockL2BridgeAdapterRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _MockL2BridgeAdapter.Contract.MockL2BridgeAdapterTransactor.contract.Transact(opts, method, params...) +} + +func (_MockL2BridgeAdapter *MockL2BridgeAdapterCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _MockL2BridgeAdapter.Contract.contract.Call(opts, result, method, params...) +} + +func (_MockL2BridgeAdapter *MockL2BridgeAdapterTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _MockL2BridgeAdapter.Contract.contract.Transfer(opts) +} + +func (_MockL2BridgeAdapter *MockL2BridgeAdapterTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _MockL2BridgeAdapter.Contract.contract.Transact(opts, method, params...) +} + +func (_MockL2BridgeAdapter *MockL2BridgeAdapterCaller) FinalizeWithdrawERC20(opts *bind.CallOpts, arg0 common.Address, arg1 common.Address, arg2 []byte) (bool, error) { + var out []interface{} + err := _MockL2BridgeAdapter.contract.Call(opts, &out, "finalizeWithdrawERC20", arg0, arg1, arg2) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_MockL2BridgeAdapter *MockL2BridgeAdapterSession) FinalizeWithdrawERC20(arg0 common.Address, arg1 common.Address, arg2 []byte) (bool, error) { + return _MockL2BridgeAdapter.Contract.FinalizeWithdrawERC20(&_MockL2BridgeAdapter.CallOpts, arg0, arg1, arg2) +} + +func (_MockL2BridgeAdapter *MockL2BridgeAdapterCallerSession) FinalizeWithdrawERC20(arg0 common.Address, arg1 common.Address, arg2 []byte) (bool, error) { + return _MockL2BridgeAdapter.Contract.FinalizeWithdrawERC20(&_MockL2BridgeAdapter.CallOpts, arg0, arg1, arg2) +} + +func (_MockL2BridgeAdapter *MockL2BridgeAdapterCaller) GetBridgeFeeInNative(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _MockL2BridgeAdapter.contract.Call(opts, &out, "getBridgeFeeInNative") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_MockL2BridgeAdapter *MockL2BridgeAdapterSession) GetBridgeFeeInNative() (*big.Int, error) { + return _MockL2BridgeAdapter.Contract.GetBridgeFeeInNative(&_MockL2BridgeAdapter.CallOpts) +} + +func (_MockL2BridgeAdapter *MockL2BridgeAdapterCallerSession) GetBridgeFeeInNative() (*big.Int, error) { + return _MockL2BridgeAdapter.Contract.GetBridgeFeeInNative(&_MockL2BridgeAdapter.CallOpts) +} + +func (_MockL2BridgeAdapter *MockL2BridgeAdapterTransactor) SendERC20(opts *bind.TransactOpts, localToken common.Address, arg1 common.Address, arg2 common.Address, amount *big.Int, arg4 []byte) (*types.Transaction, error) { + return _MockL2BridgeAdapter.contract.Transact(opts, "sendERC20", localToken, arg1, arg2, amount, arg4) +} + +func (_MockL2BridgeAdapter *MockL2BridgeAdapterSession) SendERC20(localToken common.Address, arg1 common.Address, arg2 common.Address, amount *big.Int, arg4 []byte) (*types.Transaction, error) { + return _MockL2BridgeAdapter.Contract.SendERC20(&_MockL2BridgeAdapter.TransactOpts, localToken, arg1, arg2, amount, arg4) +} + +func (_MockL2BridgeAdapter *MockL2BridgeAdapterTransactorSession) SendERC20(localToken common.Address, arg1 common.Address, arg2 common.Address, amount *big.Int, arg4 []byte) (*types.Transaction, error) { + return _MockL2BridgeAdapter.Contract.SendERC20(&_MockL2BridgeAdapter.TransactOpts, localToken, arg1, arg2, amount, arg4) +} + +func (_MockL2BridgeAdapter *MockL2BridgeAdapter) Address() common.Address { + return _MockL2BridgeAdapter.address +} + +type MockL2BridgeAdapterInterface interface { + FinalizeWithdrawERC20(opts *bind.CallOpts, arg0 common.Address, arg1 common.Address, arg2 []byte) (bool, error) + + GetBridgeFeeInNative(opts *bind.CallOpts) (*big.Int, error) + + SendERC20(opts *bind.TransactOpts, localToken common.Address, arg1 common.Address, arg2 common.Address, amount *big.Int, arg4 []byte) (*types.Transaction, error) + + Address() common.Address +} diff --git a/core/gethwrappers/liquiditymanager/generated/no_op_ocr3/no_op_ocr3.go b/core/gethwrappers/liquiditymanager/generated/no_op_ocr3/no_op_ocr3.go new file mode 100644 index 00000000000..c9dca8b5f4f --- /dev/null +++ b/core/gethwrappers/liquiditymanager/generated/no_op_ocr3/no_op_ocr3.go @@ -0,0 +1,946 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package no_op_ocr3 + +import ( + "errors" + "fmt" + "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" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" +) + +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +var NoOpOCR3MetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"expected\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"actual\",\"type\":\"bytes32\"}],\"name\":\"ConfigDigestMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expected\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"actual\",\"type\":\"uint256\"}],\"name\":\"ForkedChain\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"message\",\"type\":\"string\"}],\"name\":\"InvalidConfig\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"sequenceNumber\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"latestSequenceNumber\",\"type\":\"uint64\"}],\"name\":\"NonIncreasingSequenceNumber\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NonUniqueSignatures\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OracleCannotBeZeroAddress\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"SignaturesOutOfRegistration\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UnauthorizedSigner\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UnauthorizedTransmitter\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expected\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"actual\",\"type\":\"uint256\"}],\"name\":\"WrongMessageLength\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"WrongNumberOfSignatures\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"previousConfigBlockNumber\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"configCount\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"signers\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"transmitters\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"f\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"onchainConfig\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"offchainConfigVersion\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"offchainConfig\",\"type\":\"bytes\"}],\"name\":\"ConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"sequenceNumber\",\"type\":\"uint64\"}],\"name\":\"Transmitted\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getTransmitters\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestConfigDetails\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"configCount\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"blockNumber\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestSequenceNumber\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"sequenceNumber\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"signers\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"transmitters\",\"type\":\"address[]\"},{\"internalType\":\"uint8\",\"name\":\"f\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"onchainConfig\",\"type\":\"bytes\"},{\"internalType\":\"uint64\",\"name\":\"offchainConfigVersion\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"offchainConfig\",\"type\":\"bytes\"}],\"name\":\"setOCR3Config\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32[3]\",\"name\":\"reportContext\",\"type\":\"bytes32[3]\"},{\"internalType\":\"bytes\",\"name\":\"report\",\"type\":\"bytes\"},{\"internalType\":\"bytes32[]\",\"name\":\"rs\",\"type\":\"bytes32[]\"},{\"internalType\":\"bytes32[]\",\"name\":\"ss\",\"type\":\"bytes32[]\"},{\"internalType\":\"bytes32\",\"name\":\"rawVs\",\"type\":\"bytes32\"}],\"name\":\"transmit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", + Bin: "0x60a060405234801561001057600080fd5b5033806000816100675760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b038481169190911790915581161561009757610097816100a3565b5050466080525061014c565b336001600160a01b038216036100fb5760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640161005e565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b608051611c0d6200016f60003960008181610cb40152610d000152611c0d6000f3fe608060405234801561001057600080fd5b50600436106100a35760003560e01c806381ff704811610076578063b1dc65a41161005b578063b1dc65a414610184578063f1c0461614610197578063f2fde38b146101c957600080fd5b806381ff70481461012c5780638da5cb5b1461015c57600080fd5b8063181f5a77146100a8578063666cab8d146100fa5780636a11ee901461010f57806379ba509714610124575b600080fd5b6100e46040518060400160405280600e81526020017f4e6f4f704f43523320312e302e3000000000000000000000000000000000000081525081565b6040516100f1919061153b565b60405180910390f35b6101026101dc565b6040516100f191906115a7565b61012261011d36600461179f565b61024b565b005b610122610a7f565b6004546002546040805163ffffffff808516825264010000000090940490931660208401528201526060016100f1565b60005460405173ffffffffffffffffffffffffffffffffffffffff90911681526020016100f1565b6101226101923660046118b8565b610b7c565b60045468010000000000000000900467ffffffffffffffff1660405167ffffffffffffffff90911681526020016100f1565b6101226101d736600461199d565b6111e2565b6060600780548060200260200160405190810160405280929190818152602001828054801561024157602002820191906000526020600020905b815473ffffffffffffffffffffffffffffffffffffffff168152600190910190602001808311610216575b5050505050905090565b855185518560ff16601f8311156102c3576040517f89a6198900000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f746f6f206d616e79207369676e6572730000000000000000000000000000000060448201526064015b60405180910390fd5b8060000361032d576040517f89a6198900000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f66206d75737420626520706f736974697665000000000000000000000000000060448201526064016102ba565b8183146103bb576040517f89a61989000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f6f7261636c6520616464726573736573206f7574206f6620726567697374726160448201527f74696f6e0000000000000000000000000000000000000000000000000000000060648201526084016102ba565b6103c68160036119e7565b831161042e576040517f89a6198900000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f6661756c74792d6f7261636c65206620746f6f2068696768000000000000000060448201526064016102ba565b6104366111f6565b60065460005b8181101561052a57600560006006838154811061045b5761045b611a04565b600091825260208083209091015473ffffffffffffffffffffffffffffffffffffffff168352820192909252604001812080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000169055600780546005929190849081106104cb576104cb611a04565b600091825260208083209091015473ffffffffffffffffffffffffffffffffffffffff168352820192909252604001902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000016905560010161043c565b50895160005b818110156108fd5760008c828151811061054c5761054c611a04565b602002602001015190506000600281111561056957610569611a33565b73ffffffffffffffffffffffffffffffffffffffff8216600090815260056020526040902054610100900460ff1660028111156105a8576105a8611a33565b1461060f576040517f89a6198900000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f7265706561746564207369676e6572206164647265737300000000000000000060448201526064016102ba565b73ffffffffffffffffffffffffffffffffffffffff811661065c576040517fd6c62c9b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040805180820190915260ff83168152602081016001905273ffffffffffffffffffffffffffffffffffffffff821660009081526005602090815260409091208251815460ff9091167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0082168117835592840151919283917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000161761010083600281111561070c5761070c611a33565b021790555090505060008c838151811061072857610728611a04565b602002602001015190506000600281111561074557610745611a33565b73ffffffffffffffffffffffffffffffffffffffff8216600090815260056020526040902054610100900460ff16600281111561078457610784611a33565b146107eb576040517f89a6198900000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f7265706561746564207472616e736d697474657220616464726573730000000060448201526064016102ba565b73ffffffffffffffffffffffffffffffffffffffff8116610838576040517fd6c62c9b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040805180820190915260ff84168152602081016002905273ffffffffffffffffffffffffffffffffffffffff821660009081526005602090815260409091208251815460ff9091167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0082168117835592840151919283917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000016176101008360028111156108e8576108e8611a33565b02179055509050505050806001019050610530565b508a516109119060069060208e0190611419565b5089516109259060079060208d0190611419565b506003805460ff838116610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000909216908c1617179055600480546109ab91469130919060009061097d9063ffffffff16611a62565b91906101000a81548163ffffffff021916908363ffffffff160217905563ffffffff168e8e8e8e8e8e611279565b600260000181905550600060048054906101000a900463ffffffff169050436004806101000a81548163ffffffff021916908363ffffffff1602179055506000600460086101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055507f1591690b8638f5fb2dbec82ac741805ac5da8b45dc5263f4875b0496fdce4e0581600260000154600460009054906101000a900463ffffffff168f8f8f8f8f8f604051610a6999989796959493929190611a85565b60405180910390a1505050505050505050505050565b60015473ffffffffffffffffffffffffffffffffffffffff163314610b00576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e65720000000000000000000060448201526064016102ba565b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b60045460208901359067ffffffffffffffff68010000000000000000909104811690821611610bff57600480546040517f6e376b6600000000000000000000000000000000000000000000000000000000815267ffffffffffffffff808516938201939093526801000000000000000090910490911660248201526044016102ba565b600480547fffffffffffffffffffffffffffffffff0000000000000000ffffffffffffffff166801000000000000000067ffffffffffffffff8416021790556040805160608101825260025480825260035460ff808216602085015261010090910416928201929092528a35918214610cb15780516040517f93df584c0000000000000000000000000000000000000000000000000000000081526004810191909152602481018390526044016102ba565b467f000000000000000000000000000000000000000000000000000000000000000014610d32576040517f0f01ce850000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000060048201524660248201526044016102ba565b6040805183815267ffffffffffffffff851660208201527fe893c2681d327421d89e1cb54fbe64645b4dcea668d6826130b62cf4c6eefea2910160405180910390a16020810151610d84906001611b1b565b60ff168714610dbf576040517f71253a2500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b868514610df8576040517fa75d88af00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b3360009081526005602090815260408083208151808301909252805460ff80821684529293919291840191610100909104166002811115610e3b57610e3b611a33565b6002811115610e4c57610e4c611a33565b9052509050600281602001516002811115610e6957610e69611a33565b148015610eb057506007816000015160ff1681548110610e8b57610e8b611a04565b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff1633145b610ee6576040517fda0f08e800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b506000610ef48660206119e7565b610eff8960206119e7565b610f0b8c610144611b34565b610f159190611b34565b610f1f9190611b34565b9050368114610f63576040517f8e1192e1000000000000000000000000000000000000000000000000000000008152600481018290523660248201526044016102ba565b5060008a8a604051610f76929190611b47565b604051908190038120610f8d918e90602001611b57565b604051602081830303815290604052805190602001209050610fad6114a3565b8860005b818110156111d15760006001858a8460208110610fd057610fd0611a04565b610fdd91901a601b611b1b565b8f8f86818110610fef57610fef611a04565b905060200201358e8e8781811061100857611008611a04565b9050602002013560405160008152602001604052604051611045949392919093845260ff9290921660208401526040830152606082015260800190565b6020604051602081039080840390855afa158015611067573d6000803e3d6000fd5b5050604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081015173ffffffffffffffffffffffffffffffffffffffff8116600090815260056020908152848220848601909552845460ff80821686529397509195509293928401916101009091041660028111156110ea576110ea611a33565b60028111156110fb576110fb611a33565b905250905060018160200151600281111561111857611118611a33565b1461114f576040517fca31867a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8051859060ff16601f811061116657611166611a04565b6020020151156111a2576040517ff67bc7c400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600185826000015160ff16601f81106111bd576111bd611a04565b911515602090920201525050600101610fb1565b505050505050505050505050505050565b6111ea6111f6565b6111f381611324565b50565b60005473ffffffffffffffffffffffffffffffffffffffff163314611277576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e65720000000000000000000060448201526064016102ba565b565b6000808a8a8a8a8a8a8a8a8a60405160200161129d99989796959493929190611b6b565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815291905280516020909101207dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167e01000000000000000000000000000000000000000000000000000000000000179150509998505050505050505050565b3373ffffffffffffffffffffffffffffffffffffffff8216036113a3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c6600000000000000000060448201526064016102ba565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b828054828255906000526020600020908101928215611493579160200282015b8281111561149357825182547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff909116178255602090920191600190910190611439565b5061149f9291506114c2565b5090565b604051806103e00160405280601f906020820280368337509192915050565b5b8082111561149f57600081556001016114c3565b6000815180845260005b818110156114fd576020818501810151868301820152016114e1565b5060006020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b60208152600061154e60208301846114d7565b9392505050565b60008151808452602080850194506020840160005b8381101561159c57815173ffffffffffffffffffffffffffffffffffffffff168752958201959082019060010161156a565b509495945050505050565b60208152600061154e6020830184611555565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715611630576116306115ba565b604052919050565b803573ffffffffffffffffffffffffffffffffffffffff8116811461165c57600080fd5b919050565b600082601f83011261167257600080fd5b8135602067ffffffffffffffff82111561168e5761168e6115ba565b8160051b61169d8282016115e9565b92835284810182019282810190878511156116b757600080fd5b83870192505b848310156116dd576116ce83611638565b825291830191908301906116bd565b979650505050505050565b803560ff8116811461165c57600080fd5b600082601f83011261170a57600080fd5b813567ffffffffffffffff811115611724576117246115ba565b61175560207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116016115e9565b81815284602083860101111561176a57600080fd5b816020850160208301376000918101602001919091529392505050565b803567ffffffffffffffff8116811461165c57600080fd5b60008060008060008060c087890312156117b857600080fd5b863567ffffffffffffffff808211156117d057600080fd5b6117dc8a838b01611661565b975060208901359150808211156117f257600080fd5b6117fe8a838b01611661565b965061180c60408a016116e8565b9550606089013591508082111561182257600080fd5b61182e8a838b016116f9565b945061183c60808a01611787565b935060a089013591508082111561185257600080fd5b5061185f89828a016116f9565b9150509295509295509295565b60008083601f84011261187e57600080fd5b50813567ffffffffffffffff81111561189657600080fd5b6020830191508360208260051b85010111156118b157600080fd5b9250929050565b60008060008060008060008060e0898b0312156118d457600080fd5b606089018a8111156118e557600080fd5b8998503567ffffffffffffffff808211156118ff57600080fd5b818b0191508b601f83011261191357600080fd5b81358181111561192257600080fd5b8c602082850101111561193457600080fd5b6020830199508098505060808b013591508082111561195257600080fd5b61195e8c838d0161186c565b909750955060a08b013591508082111561197757600080fd5b506119848b828c0161186c565b999c989b50969995989497949560c00135949350505050565b6000602082840312156119af57600080fd5b61154e82611638565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b80820281158282048414176119fe576119fe6119b8565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b600063ffffffff808316818103611a7b57611a7b6119b8565b6001019392505050565b600061012063ffffffff808d1684528b6020850152808b16604085015250806060840152611ab58184018a611555565b90508281036080840152611ac98189611555565b905060ff871660a084015282810360c0840152611ae681876114d7565b905067ffffffffffffffff851660e0840152828103610100840152611b0b81856114d7565b9c9b505050505050505050505050565b60ff81811683821601908111156119fe576119fe6119b8565b808201808211156119fe576119fe6119b8565b8183823760009101908152919050565b828152606082602083013760800192915050565b60006101208b835273ffffffffffffffffffffffffffffffffffffffff8b16602084015267ffffffffffffffff808b166040850152816060850152611bb28285018b611555565b91508382036080850152611bc6828a611555565b915060ff881660a085015283820360c0850152611be382886114d7565b90861660e08501528381036101008501529050611b0b81856114d756fea164736f6c6343000818000a", +} + +var NoOpOCR3ABI = NoOpOCR3MetaData.ABI + +var NoOpOCR3Bin = NoOpOCR3MetaData.Bin + +func DeployNoOpOCR3(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *NoOpOCR3, error) { + parsed, err := NoOpOCR3MetaData.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(NoOpOCR3Bin), backend) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &NoOpOCR3{address: address, abi: *parsed, NoOpOCR3Caller: NoOpOCR3Caller{contract: contract}, NoOpOCR3Transactor: NoOpOCR3Transactor{contract: contract}, NoOpOCR3Filterer: NoOpOCR3Filterer{contract: contract}}, nil +} + +type NoOpOCR3 struct { + address common.Address + abi abi.ABI + NoOpOCR3Caller + NoOpOCR3Transactor + NoOpOCR3Filterer +} + +type NoOpOCR3Caller struct { + contract *bind.BoundContract +} + +type NoOpOCR3Transactor struct { + contract *bind.BoundContract +} + +type NoOpOCR3Filterer struct { + contract *bind.BoundContract +} + +type NoOpOCR3Session struct { + Contract *NoOpOCR3 + CallOpts bind.CallOpts + TransactOpts bind.TransactOpts +} + +type NoOpOCR3CallerSession struct { + Contract *NoOpOCR3Caller + CallOpts bind.CallOpts +} + +type NoOpOCR3TransactorSession struct { + Contract *NoOpOCR3Transactor + TransactOpts bind.TransactOpts +} + +type NoOpOCR3Raw struct { + Contract *NoOpOCR3 +} + +type NoOpOCR3CallerRaw struct { + Contract *NoOpOCR3Caller +} + +type NoOpOCR3TransactorRaw struct { + Contract *NoOpOCR3Transactor +} + +func NewNoOpOCR3(address common.Address, backend bind.ContractBackend) (*NoOpOCR3, error) { + abi, err := abi.JSON(strings.NewReader(NoOpOCR3ABI)) + if err != nil { + return nil, err + } + contract, err := bindNoOpOCR3(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &NoOpOCR3{address: address, abi: abi, NoOpOCR3Caller: NoOpOCR3Caller{contract: contract}, NoOpOCR3Transactor: NoOpOCR3Transactor{contract: contract}, NoOpOCR3Filterer: NoOpOCR3Filterer{contract: contract}}, nil +} + +func NewNoOpOCR3Caller(address common.Address, caller bind.ContractCaller) (*NoOpOCR3Caller, error) { + contract, err := bindNoOpOCR3(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &NoOpOCR3Caller{contract: contract}, nil +} + +func NewNoOpOCR3Transactor(address common.Address, transactor bind.ContractTransactor) (*NoOpOCR3Transactor, error) { + contract, err := bindNoOpOCR3(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &NoOpOCR3Transactor{contract: contract}, nil +} + +func NewNoOpOCR3Filterer(address common.Address, filterer bind.ContractFilterer) (*NoOpOCR3Filterer, error) { + contract, err := bindNoOpOCR3(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &NoOpOCR3Filterer{contract: contract}, nil +} + +func bindNoOpOCR3(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := NoOpOCR3MetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +func (_NoOpOCR3 *NoOpOCR3Raw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _NoOpOCR3.Contract.NoOpOCR3Caller.contract.Call(opts, result, method, params...) +} + +func (_NoOpOCR3 *NoOpOCR3Raw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _NoOpOCR3.Contract.NoOpOCR3Transactor.contract.Transfer(opts) +} + +func (_NoOpOCR3 *NoOpOCR3Raw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _NoOpOCR3.Contract.NoOpOCR3Transactor.contract.Transact(opts, method, params...) +} + +func (_NoOpOCR3 *NoOpOCR3CallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _NoOpOCR3.Contract.contract.Call(opts, result, method, params...) +} + +func (_NoOpOCR3 *NoOpOCR3TransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _NoOpOCR3.Contract.contract.Transfer(opts) +} + +func (_NoOpOCR3 *NoOpOCR3TransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _NoOpOCR3.Contract.contract.Transact(opts, method, params...) +} + +func (_NoOpOCR3 *NoOpOCR3Caller) GetTransmitters(opts *bind.CallOpts) ([]common.Address, error) { + var out []interface{} + err := _NoOpOCR3.contract.Call(opts, &out, "getTransmitters") + + if err != nil { + return *new([]common.Address), err + } + + out0 := *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) + + return out0, err + +} + +func (_NoOpOCR3 *NoOpOCR3Session) GetTransmitters() ([]common.Address, error) { + return _NoOpOCR3.Contract.GetTransmitters(&_NoOpOCR3.CallOpts) +} + +func (_NoOpOCR3 *NoOpOCR3CallerSession) GetTransmitters() ([]common.Address, error) { + return _NoOpOCR3.Contract.GetTransmitters(&_NoOpOCR3.CallOpts) +} + +func (_NoOpOCR3 *NoOpOCR3Caller) LatestConfigDetails(opts *bind.CallOpts) (LatestConfigDetails, + + error) { + var out []interface{} + err := _NoOpOCR3.contract.Call(opts, &out, "latestConfigDetails") + + outstruct := new(LatestConfigDetails) + if err != nil { + return *outstruct, err + } + + outstruct.ConfigCount = *abi.ConvertType(out[0], new(uint32)).(*uint32) + outstruct.BlockNumber = *abi.ConvertType(out[1], new(uint32)).(*uint32) + outstruct.ConfigDigest = *abi.ConvertType(out[2], new([32]byte)).(*[32]byte) + + return *outstruct, err + +} + +func (_NoOpOCR3 *NoOpOCR3Session) LatestConfigDetails() (LatestConfigDetails, + + error) { + return _NoOpOCR3.Contract.LatestConfigDetails(&_NoOpOCR3.CallOpts) +} + +func (_NoOpOCR3 *NoOpOCR3CallerSession) LatestConfigDetails() (LatestConfigDetails, + + error) { + return _NoOpOCR3.Contract.LatestConfigDetails(&_NoOpOCR3.CallOpts) +} + +func (_NoOpOCR3 *NoOpOCR3Caller) LatestSequenceNumber(opts *bind.CallOpts) (uint64, error) { + var out []interface{} + err := _NoOpOCR3.contract.Call(opts, &out, "latestSequenceNumber") + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +func (_NoOpOCR3 *NoOpOCR3Session) LatestSequenceNumber() (uint64, error) { + return _NoOpOCR3.Contract.LatestSequenceNumber(&_NoOpOCR3.CallOpts) +} + +func (_NoOpOCR3 *NoOpOCR3CallerSession) LatestSequenceNumber() (uint64, error) { + return _NoOpOCR3.Contract.LatestSequenceNumber(&_NoOpOCR3.CallOpts) +} + +func (_NoOpOCR3 *NoOpOCR3Caller) Owner(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _NoOpOCR3.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 + +} + +func (_NoOpOCR3 *NoOpOCR3Session) Owner() (common.Address, error) { + return _NoOpOCR3.Contract.Owner(&_NoOpOCR3.CallOpts) +} + +func (_NoOpOCR3 *NoOpOCR3CallerSession) Owner() (common.Address, error) { + return _NoOpOCR3.Contract.Owner(&_NoOpOCR3.CallOpts) +} + +func (_NoOpOCR3 *NoOpOCR3Caller) TypeAndVersion(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _NoOpOCR3.contract.Call(opts, &out, "typeAndVersion") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +func (_NoOpOCR3 *NoOpOCR3Session) TypeAndVersion() (string, error) { + return _NoOpOCR3.Contract.TypeAndVersion(&_NoOpOCR3.CallOpts) +} + +func (_NoOpOCR3 *NoOpOCR3CallerSession) TypeAndVersion() (string, error) { + return _NoOpOCR3.Contract.TypeAndVersion(&_NoOpOCR3.CallOpts) +} + +func (_NoOpOCR3 *NoOpOCR3Transactor) AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + return _NoOpOCR3.contract.Transact(opts, "acceptOwnership") +} + +func (_NoOpOCR3 *NoOpOCR3Session) AcceptOwnership() (*types.Transaction, error) { + return _NoOpOCR3.Contract.AcceptOwnership(&_NoOpOCR3.TransactOpts) +} + +func (_NoOpOCR3 *NoOpOCR3TransactorSession) AcceptOwnership() (*types.Transaction, error) { + return _NoOpOCR3.Contract.AcceptOwnership(&_NoOpOCR3.TransactOpts) +} + +func (_NoOpOCR3 *NoOpOCR3Transactor) SetOCR3Config(opts *bind.TransactOpts, signers []common.Address, transmitters []common.Address, f uint8, onchainConfig []byte, offchainConfigVersion uint64, offchainConfig []byte) (*types.Transaction, error) { + return _NoOpOCR3.contract.Transact(opts, "setOCR3Config", signers, transmitters, f, onchainConfig, offchainConfigVersion, offchainConfig) +} + +func (_NoOpOCR3 *NoOpOCR3Session) SetOCR3Config(signers []common.Address, transmitters []common.Address, f uint8, onchainConfig []byte, offchainConfigVersion uint64, offchainConfig []byte) (*types.Transaction, error) { + return _NoOpOCR3.Contract.SetOCR3Config(&_NoOpOCR3.TransactOpts, signers, transmitters, f, onchainConfig, offchainConfigVersion, offchainConfig) +} + +func (_NoOpOCR3 *NoOpOCR3TransactorSession) SetOCR3Config(signers []common.Address, transmitters []common.Address, f uint8, onchainConfig []byte, offchainConfigVersion uint64, offchainConfig []byte) (*types.Transaction, error) { + return _NoOpOCR3.Contract.SetOCR3Config(&_NoOpOCR3.TransactOpts, signers, transmitters, f, onchainConfig, offchainConfigVersion, offchainConfig) +} + +func (_NoOpOCR3 *NoOpOCR3Transactor) TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) { + return _NoOpOCR3.contract.Transact(opts, "transferOwnership", to) +} + +func (_NoOpOCR3 *NoOpOCR3Session) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _NoOpOCR3.Contract.TransferOwnership(&_NoOpOCR3.TransactOpts, to) +} + +func (_NoOpOCR3 *NoOpOCR3TransactorSession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _NoOpOCR3.Contract.TransferOwnership(&_NoOpOCR3.TransactOpts, to) +} + +func (_NoOpOCR3 *NoOpOCR3Transactor) Transmit(opts *bind.TransactOpts, reportContext [3][32]byte, report []byte, rs [][32]byte, ss [][32]byte, rawVs [32]byte) (*types.Transaction, error) { + return _NoOpOCR3.contract.Transact(opts, "transmit", reportContext, report, rs, ss, rawVs) +} + +func (_NoOpOCR3 *NoOpOCR3Session) Transmit(reportContext [3][32]byte, report []byte, rs [][32]byte, ss [][32]byte, rawVs [32]byte) (*types.Transaction, error) { + return _NoOpOCR3.Contract.Transmit(&_NoOpOCR3.TransactOpts, reportContext, report, rs, ss, rawVs) +} + +func (_NoOpOCR3 *NoOpOCR3TransactorSession) Transmit(reportContext [3][32]byte, report []byte, rs [][32]byte, ss [][32]byte, rawVs [32]byte) (*types.Transaction, error) { + return _NoOpOCR3.Contract.Transmit(&_NoOpOCR3.TransactOpts, reportContext, report, rs, ss, rawVs) +} + +type NoOpOCR3ConfigSetIterator struct { + Event *NoOpOCR3ConfigSet + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *NoOpOCR3ConfigSetIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(NoOpOCR3ConfigSet) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(NoOpOCR3ConfigSet) + 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() + } +} + +func (it *NoOpOCR3ConfigSetIterator) Error() error { + return it.fail +} + +func (it *NoOpOCR3ConfigSetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type NoOpOCR3ConfigSet struct { + PreviousConfigBlockNumber uint32 + ConfigDigest [32]byte + ConfigCount uint64 + Signers []common.Address + Transmitters []common.Address + F uint8 + OnchainConfig []byte + OffchainConfigVersion uint64 + OffchainConfig []byte + Raw types.Log +} + +func (_NoOpOCR3 *NoOpOCR3Filterer) FilterConfigSet(opts *bind.FilterOpts) (*NoOpOCR3ConfigSetIterator, error) { + + logs, sub, err := _NoOpOCR3.contract.FilterLogs(opts, "ConfigSet") + if err != nil { + return nil, err + } + return &NoOpOCR3ConfigSetIterator{contract: _NoOpOCR3.contract, event: "ConfigSet", logs: logs, sub: sub}, nil +} + +func (_NoOpOCR3 *NoOpOCR3Filterer) WatchConfigSet(opts *bind.WatchOpts, sink chan<- *NoOpOCR3ConfigSet) (event.Subscription, error) { + + logs, sub, err := _NoOpOCR3.contract.WatchLogs(opts, "ConfigSet") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(NoOpOCR3ConfigSet) + if err := _NoOpOCR3.contract.UnpackLog(event, "ConfigSet", 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 +} + +func (_NoOpOCR3 *NoOpOCR3Filterer) ParseConfigSet(log types.Log) (*NoOpOCR3ConfigSet, error) { + event := new(NoOpOCR3ConfigSet) + if err := _NoOpOCR3.contract.UnpackLog(event, "ConfigSet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type NoOpOCR3OwnershipTransferRequestedIterator struct { + Event *NoOpOCR3OwnershipTransferRequested + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *NoOpOCR3OwnershipTransferRequestedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(NoOpOCR3OwnershipTransferRequested) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(NoOpOCR3OwnershipTransferRequested) + 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() + } +} + +func (it *NoOpOCR3OwnershipTransferRequestedIterator) Error() error { + return it.fail +} + +func (it *NoOpOCR3OwnershipTransferRequestedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type NoOpOCR3OwnershipTransferRequested struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_NoOpOCR3 *NoOpOCR3Filterer) FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*NoOpOCR3OwnershipTransferRequestedIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _NoOpOCR3.contract.FilterLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return &NoOpOCR3OwnershipTransferRequestedIterator{contract: _NoOpOCR3.contract, event: "OwnershipTransferRequested", logs: logs, sub: sub}, nil +} + +func (_NoOpOCR3 *NoOpOCR3Filterer) WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *NoOpOCR3OwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _NoOpOCR3.contract.WatchLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(NoOpOCR3OwnershipTransferRequested) + if err := _NoOpOCR3.contract.UnpackLog(event, "OwnershipTransferRequested", 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 +} + +func (_NoOpOCR3 *NoOpOCR3Filterer) ParseOwnershipTransferRequested(log types.Log) (*NoOpOCR3OwnershipTransferRequested, error) { + event := new(NoOpOCR3OwnershipTransferRequested) + if err := _NoOpOCR3.contract.UnpackLog(event, "OwnershipTransferRequested", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type NoOpOCR3OwnershipTransferredIterator struct { + Event *NoOpOCR3OwnershipTransferred + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *NoOpOCR3OwnershipTransferredIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(NoOpOCR3OwnershipTransferred) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(NoOpOCR3OwnershipTransferred) + 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() + } +} + +func (it *NoOpOCR3OwnershipTransferredIterator) Error() error { + return it.fail +} + +func (it *NoOpOCR3OwnershipTransferredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type NoOpOCR3OwnershipTransferred struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_NoOpOCR3 *NoOpOCR3Filterer) FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*NoOpOCR3OwnershipTransferredIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _NoOpOCR3.contract.FilterLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return &NoOpOCR3OwnershipTransferredIterator{contract: _NoOpOCR3.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil +} + +func (_NoOpOCR3 *NoOpOCR3Filterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *NoOpOCR3OwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _NoOpOCR3.contract.WatchLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(NoOpOCR3OwnershipTransferred) + if err := _NoOpOCR3.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 +} + +func (_NoOpOCR3 *NoOpOCR3Filterer) ParseOwnershipTransferred(log types.Log) (*NoOpOCR3OwnershipTransferred, error) { + event := new(NoOpOCR3OwnershipTransferred) + if err := _NoOpOCR3.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type NoOpOCR3TransmittedIterator struct { + Event *NoOpOCR3Transmitted + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *NoOpOCR3TransmittedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(NoOpOCR3Transmitted) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(NoOpOCR3Transmitted) + 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() + } +} + +func (it *NoOpOCR3TransmittedIterator) Error() error { + return it.fail +} + +func (it *NoOpOCR3TransmittedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type NoOpOCR3Transmitted struct { + ConfigDigest [32]byte + SequenceNumber uint64 + Raw types.Log +} + +func (_NoOpOCR3 *NoOpOCR3Filterer) FilterTransmitted(opts *bind.FilterOpts) (*NoOpOCR3TransmittedIterator, error) { + + logs, sub, err := _NoOpOCR3.contract.FilterLogs(opts, "Transmitted") + if err != nil { + return nil, err + } + return &NoOpOCR3TransmittedIterator{contract: _NoOpOCR3.contract, event: "Transmitted", logs: logs, sub: sub}, nil +} + +func (_NoOpOCR3 *NoOpOCR3Filterer) WatchTransmitted(opts *bind.WatchOpts, sink chan<- *NoOpOCR3Transmitted) (event.Subscription, error) { + + logs, sub, err := _NoOpOCR3.contract.WatchLogs(opts, "Transmitted") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(NoOpOCR3Transmitted) + if err := _NoOpOCR3.contract.UnpackLog(event, "Transmitted", 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 +} + +func (_NoOpOCR3 *NoOpOCR3Filterer) ParseTransmitted(log types.Log) (*NoOpOCR3Transmitted, error) { + event := new(NoOpOCR3Transmitted) + if err := _NoOpOCR3.contract.UnpackLog(event, "Transmitted", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type LatestConfigDetails struct { + ConfigCount uint32 + BlockNumber uint32 + ConfigDigest [32]byte +} + +func (_NoOpOCR3 *NoOpOCR3) ParseLog(log types.Log) (generated.AbigenLog, error) { + switch log.Topics[0] { + case _NoOpOCR3.abi.Events["ConfigSet"].ID: + return _NoOpOCR3.ParseConfigSet(log) + case _NoOpOCR3.abi.Events["OwnershipTransferRequested"].ID: + return _NoOpOCR3.ParseOwnershipTransferRequested(log) + case _NoOpOCR3.abi.Events["OwnershipTransferred"].ID: + return _NoOpOCR3.ParseOwnershipTransferred(log) + case _NoOpOCR3.abi.Events["Transmitted"].ID: + return _NoOpOCR3.ParseTransmitted(log) + + default: + return nil, fmt.Errorf("abigen wrapper received unknown log topic: %v", log.Topics[0]) + } +} + +func (NoOpOCR3ConfigSet) Topic() common.Hash { + return common.HexToHash("0x1591690b8638f5fb2dbec82ac741805ac5da8b45dc5263f4875b0496fdce4e05") +} + +func (NoOpOCR3OwnershipTransferRequested) Topic() common.Hash { + return common.HexToHash("0xed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae1278") +} + +func (NoOpOCR3OwnershipTransferred) Topic() common.Hash { + return common.HexToHash("0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0") +} + +func (NoOpOCR3Transmitted) Topic() common.Hash { + return common.HexToHash("0xe893c2681d327421d89e1cb54fbe64645b4dcea668d6826130b62cf4c6eefea2") +} + +func (_NoOpOCR3 *NoOpOCR3) Address() common.Address { + return _NoOpOCR3.address +} + +type NoOpOCR3Interface interface { + GetTransmitters(opts *bind.CallOpts) ([]common.Address, error) + + LatestConfigDetails(opts *bind.CallOpts) (LatestConfigDetails, + + error) + + LatestSequenceNumber(opts *bind.CallOpts) (uint64, error) + + Owner(opts *bind.CallOpts) (common.Address, error) + + TypeAndVersion(opts *bind.CallOpts) (string, error) + + AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) + + SetOCR3Config(opts *bind.TransactOpts, signers []common.Address, transmitters []common.Address, f uint8, onchainConfig []byte, offchainConfigVersion uint64, offchainConfig []byte) (*types.Transaction, error) + + TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) + + Transmit(opts *bind.TransactOpts, reportContext [3][32]byte, report []byte, rs [][32]byte, ss [][32]byte, rawVs [32]byte) (*types.Transaction, error) + + FilterConfigSet(opts *bind.FilterOpts) (*NoOpOCR3ConfigSetIterator, error) + + WatchConfigSet(opts *bind.WatchOpts, sink chan<- *NoOpOCR3ConfigSet) (event.Subscription, error) + + ParseConfigSet(log types.Log) (*NoOpOCR3ConfigSet, error) + + FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*NoOpOCR3OwnershipTransferRequestedIterator, error) + + WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *NoOpOCR3OwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferRequested(log types.Log) (*NoOpOCR3OwnershipTransferRequested, error) + + FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*NoOpOCR3OwnershipTransferredIterator, error) + + WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *NoOpOCR3OwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferred(log types.Log) (*NoOpOCR3OwnershipTransferred, error) + + FilterTransmitted(opts *bind.FilterOpts) (*NoOpOCR3TransmittedIterator, error) + + WatchTransmitted(opts *bind.WatchOpts, sink chan<- *NoOpOCR3Transmitted) (event.Subscription, error) + + ParseTransmitted(log types.Log) (*NoOpOCR3Transmitted, error) + + ParseLog(log types.Log) (generated.AbigenLog, error) + + Address() common.Address +} diff --git a/core/gethwrappers/liquiditymanager/generated/optimism_cross_domain_messenger/optimism_cross_domain_messenger.go b/core/gethwrappers/liquiditymanager/generated/optimism_cross_domain_messenger/optimism_cross_domain_messenger.go new file mode 100644 index 00000000000..599d2e3739f --- /dev/null +++ b/core/gethwrappers/liquiditymanager/generated/optimism_cross_domain_messenger/optimism_cross_domain_messenger.go @@ -0,0 +1,328 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package optimism_cross_domain_messenger + +import ( + "errors" + "fmt" + "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" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" +) + +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +var OptimismCrossDomainMessengerMetaData = &bind.MetaData{ + ABI: "[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"message\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"messageNonce\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"gasLimit\",\"type\":\"uint256\"}],\"name\":\"SentMessage\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_nonce\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"_sender\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_target\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_value\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_minGasLimit\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_message\",\"type\":\"bytes\"}],\"name\":\"relayMessage\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"}]", +} + +var OptimismCrossDomainMessengerABI = OptimismCrossDomainMessengerMetaData.ABI + +type OptimismCrossDomainMessenger struct { + address common.Address + abi abi.ABI + OptimismCrossDomainMessengerCaller + OptimismCrossDomainMessengerTransactor + OptimismCrossDomainMessengerFilterer +} + +type OptimismCrossDomainMessengerCaller struct { + contract *bind.BoundContract +} + +type OptimismCrossDomainMessengerTransactor struct { + contract *bind.BoundContract +} + +type OptimismCrossDomainMessengerFilterer struct { + contract *bind.BoundContract +} + +type OptimismCrossDomainMessengerSession struct { + Contract *OptimismCrossDomainMessenger + CallOpts bind.CallOpts + TransactOpts bind.TransactOpts +} + +type OptimismCrossDomainMessengerCallerSession struct { + Contract *OptimismCrossDomainMessengerCaller + CallOpts bind.CallOpts +} + +type OptimismCrossDomainMessengerTransactorSession struct { + Contract *OptimismCrossDomainMessengerTransactor + TransactOpts bind.TransactOpts +} + +type OptimismCrossDomainMessengerRaw struct { + Contract *OptimismCrossDomainMessenger +} + +type OptimismCrossDomainMessengerCallerRaw struct { + Contract *OptimismCrossDomainMessengerCaller +} + +type OptimismCrossDomainMessengerTransactorRaw struct { + Contract *OptimismCrossDomainMessengerTransactor +} + +func NewOptimismCrossDomainMessenger(address common.Address, backend bind.ContractBackend) (*OptimismCrossDomainMessenger, error) { + abi, err := abi.JSON(strings.NewReader(OptimismCrossDomainMessengerABI)) + if err != nil { + return nil, err + } + contract, err := bindOptimismCrossDomainMessenger(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &OptimismCrossDomainMessenger{address: address, abi: abi, OptimismCrossDomainMessengerCaller: OptimismCrossDomainMessengerCaller{contract: contract}, OptimismCrossDomainMessengerTransactor: OptimismCrossDomainMessengerTransactor{contract: contract}, OptimismCrossDomainMessengerFilterer: OptimismCrossDomainMessengerFilterer{contract: contract}}, nil +} + +func NewOptimismCrossDomainMessengerCaller(address common.Address, caller bind.ContractCaller) (*OptimismCrossDomainMessengerCaller, error) { + contract, err := bindOptimismCrossDomainMessenger(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &OptimismCrossDomainMessengerCaller{contract: contract}, nil +} + +func NewOptimismCrossDomainMessengerTransactor(address common.Address, transactor bind.ContractTransactor) (*OptimismCrossDomainMessengerTransactor, error) { + contract, err := bindOptimismCrossDomainMessenger(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &OptimismCrossDomainMessengerTransactor{contract: contract}, nil +} + +func NewOptimismCrossDomainMessengerFilterer(address common.Address, filterer bind.ContractFilterer) (*OptimismCrossDomainMessengerFilterer, error) { + contract, err := bindOptimismCrossDomainMessenger(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &OptimismCrossDomainMessengerFilterer{contract: contract}, nil +} + +func bindOptimismCrossDomainMessenger(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := OptimismCrossDomainMessengerMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +func (_OptimismCrossDomainMessenger *OptimismCrossDomainMessengerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _OptimismCrossDomainMessenger.Contract.OptimismCrossDomainMessengerCaller.contract.Call(opts, result, method, params...) +} + +func (_OptimismCrossDomainMessenger *OptimismCrossDomainMessengerRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _OptimismCrossDomainMessenger.Contract.OptimismCrossDomainMessengerTransactor.contract.Transfer(opts) +} + +func (_OptimismCrossDomainMessenger *OptimismCrossDomainMessengerRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _OptimismCrossDomainMessenger.Contract.OptimismCrossDomainMessengerTransactor.contract.Transact(opts, method, params...) +} + +func (_OptimismCrossDomainMessenger *OptimismCrossDomainMessengerCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _OptimismCrossDomainMessenger.Contract.contract.Call(opts, result, method, params...) +} + +func (_OptimismCrossDomainMessenger *OptimismCrossDomainMessengerTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _OptimismCrossDomainMessenger.Contract.contract.Transfer(opts) +} + +func (_OptimismCrossDomainMessenger *OptimismCrossDomainMessengerTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _OptimismCrossDomainMessenger.Contract.contract.Transact(opts, method, params...) +} + +func (_OptimismCrossDomainMessenger *OptimismCrossDomainMessengerTransactor) RelayMessage(opts *bind.TransactOpts, _nonce *big.Int, _sender common.Address, _target common.Address, _value *big.Int, _minGasLimit *big.Int, _message []byte) (*types.Transaction, error) { + return _OptimismCrossDomainMessenger.contract.Transact(opts, "relayMessage", _nonce, _sender, _target, _value, _minGasLimit, _message) +} + +func (_OptimismCrossDomainMessenger *OptimismCrossDomainMessengerSession) RelayMessage(_nonce *big.Int, _sender common.Address, _target common.Address, _value *big.Int, _minGasLimit *big.Int, _message []byte) (*types.Transaction, error) { + return _OptimismCrossDomainMessenger.Contract.RelayMessage(&_OptimismCrossDomainMessenger.TransactOpts, _nonce, _sender, _target, _value, _minGasLimit, _message) +} + +func (_OptimismCrossDomainMessenger *OptimismCrossDomainMessengerTransactorSession) RelayMessage(_nonce *big.Int, _sender common.Address, _target common.Address, _value *big.Int, _minGasLimit *big.Int, _message []byte) (*types.Transaction, error) { + return _OptimismCrossDomainMessenger.Contract.RelayMessage(&_OptimismCrossDomainMessenger.TransactOpts, _nonce, _sender, _target, _value, _minGasLimit, _message) +} + +type OptimismCrossDomainMessengerSentMessageIterator struct { + Event *OptimismCrossDomainMessengerSentMessage + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *OptimismCrossDomainMessengerSentMessageIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(OptimismCrossDomainMessengerSentMessage) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(OptimismCrossDomainMessengerSentMessage) + 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() + } +} + +func (it *OptimismCrossDomainMessengerSentMessageIterator) Error() error { + return it.fail +} + +func (it *OptimismCrossDomainMessengerSentMessageIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type OptimismCrossDomainMessengerSentMessage struct { + Target common.Address + Sender common.Address + Message []byte + MessageNonce *big.Int + GasLimit *big.Int + Raw types.Log +} + +func (_OptimismCrossDomainMessenger *OptimismCrossDomainMessengerFilterer) FilterSentMessage(opts *bind.FilterOpts, target []common.Address) (*OptimismCrossDomainMessengerSentMessageIterator, error) { + + var targetRule []interface{} + for _, targetItem := range target { + targetRule = append(targetRule, targetItem) + } + + logs, sub, err := _OptimismCrossDomainMessenger.contract.FilterLogs(opts, "SentMessage", targetRule) + if err != nil { + return nil, err + } + return &OptimismCrossDomainMessengerSentMessageIterator{contract: _OptimismCrossDomainMessenger.contract, event: "SentMessage", logs: logs, sub: sub}, nil +} + +func (_OptimismCrossDomainMessenger *OptimismCrossDomainMessengerFilterer) WatchSentMessage(opts *bind.WatchOpts, sink chan<- *OptimismCrossDomainMessengerSentMessage, target []common.Address) (event.Subscription, error) { + + var targetRule []interface{} + for _, targetItem := range target { + targetRule = append(targetRule, targetItem) + } + + logs, sub, err := _OptimismCrossDomainMessenger.contract.WatchLogs(opts, "SentMessage", targetRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(OptimismCrossDomainMessengerSentMessage) + if err := _OptimismCrossDomainMessenger.contract.UnpackLog(event, "SentMessage", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +func (_OptimismCrossDomainMessenger *OptimismCrossDomainMessengerFilterer) ParseSentMessage(log types.Log) (*OptimismCrossDomainMessengerSentMessage, error) { + event := new(OptimismCrossDomainMessengerSentMessage) + if err := _OptimismCrossDomainMessenger.contract.UnpackLog(event, "SentMessage", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +func (_OptimismCrossDomainMessenger *OptimismCrossDomainMessenger) ParseLog(log types.Log) (generated.AbigenLog, error) { + switch log.Topics[0] { + case _OptimismCrossDomainMessenger.abi.Events["SentMessage"].ID: + return _OptimismCrossDomainMessenger.ParseSentMessage(log) + + default: + return nil, fmt.Errorf("abigen wrapper received unknown log topic: %v", log.Topics[0]) + } +} + +func (OptimismCrossDomainMessengerSentMessage) Topic() common.Hash { + return common.HexToHash("0xcb0f7ffd78f9aee47a248fae8db181db6eee833039123e026dcbff529522e52a") +} + +func (_OptimismCrossDomainMessenger *OptimismCrossDomainMessenger) Address() common.Address { + return _OptimismCrossDomainMessenger.address +} + +type OptimismCrossDomainMessengerInterface interface { + RelayMessage(opts *bind.TransactOpts, _nonce *big.Int, _sender common.Address, _target common.Address, _value *big.Int, _minGasLimit *big.Int, _message []byte) (*types.Transaction, error) + + FilterSentMessage(opts *bind.FilterOpts, target []common.Address) (*OptimismCrossDomainMessengerSentMessageIterator, error) + + WatchSentMessage(opts *bind.WatchOpts, sink chan<- *OptimismCrossDomainMessengerSentMessage, target []common.Address) (event.Subscription, error) + + ParseSentMessage(log types.Log) (*OptimismCrossDomainMessengerSentMessage, error) + + ParseLog(log types.Log) (generated.AbigenLog, error) + + Address() common.Address +} diff --git a/core/gethwrappers/liquiditymanager/generated/optimism_dispute_game_factory/optimism_dispute_game_factory.go b/core/gethwrappers/liquiditymanager/generated/optimism_dispute_game_factory/optimism_dispute_game_factory.go new file mode 100644 index 00000000000..909324ad1fb --- /dev/null +++ b/core/gethwrappers/liquiditymanager/generated/optimism_dispute_game_factory/optimism_dispute_game_factory.go @@ -0,0 +1,215 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package optimism_dispute_game_factory + +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" +) + +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +type IOptimismDisputeGameFactoryGameSearchResult struct { + Index *big.Int + Metadata [32]byte + Timestamp uint64 + RootClaim [32]byte + ExtraData []byte +} + +var OptimismDisputeGameFactoryMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"internalType\":\"GameType\",\"name\":\"_gameType\",\"type\":\"uint32\"},{\"internalType\":\"uint256\",\"name\":\"_start\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_n\",\"type\":\"uint256\"}],\"name\":\"findLatestGames\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"},{\"internalType\":\"GameId\",\"name\":\"metadata\",\"type\":\"bytes32\"},{\"internalType\":\"Timestamp\",\"name\":\"timestamp\",\"type\":\"uint64\"},{\"internalType\":\"Claim\",\"name\":\"rootClaim\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"structIOptimismDisputeGameFactory.GameSearchResult[]\",\"name\":\"games_\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gameCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"gameCount_\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", +} + +var OptimismDisputeGameFactoryABI = OptimismDisputeGameFactoryMetaData.ABI + +type OptimismDisputeGameFactory struct { + address common.Address + abi abi.ABI + OptimismDisputeGameFactoryCaller + OptimismDisputeGameFactoryTransactor + OptimismDisputeGameFactoryFilterer +} + +type OptimismDisputeGameFactoryCaller struct { + contract *bind.BoundContract +} + +type OptimismDisputeGameFactoryTransactor struct { + contract *bind.BoundContract +} + +type OptimismDisputeGameFactoryFilterer struct { + contract *bind.BoundContract +} + +type OptimismDisputeGameFactorySession struct { + Contract *OptimismDisputeGameFactory + CallOpts bind.CallOpts + TransactOpts bind.TransactOpts +} + +type OptimismDisputeGameFactoryCallerSession struct { + Contract *OptimismDisputeGameFactoryCaller + CallOpts bind.CallOpts +} + +type OptimismDisputeGameFactoryTransactorSession struct { + Contract *OptimismDisputeGameFactoryTransactor + TransactOpts bind.TransactOpts +} + +type OptimismDisputeGameFactoryRaw struct { + Contract *OptimismDisputeGameFactory +} + +type OptimismDisputeGameFactoryCallerRaw struct { + Contract *OptimismDisputeGameFactoryCaller +} + +type OptimismDisputeGameFactoryTransactorRaw struct { + Contract *OptimismDisputeGameFactoryTransactor +} + +func NewOptimismDisputeGameFactory(address common.Address, backend bind.ContractBackend) (*OptimismDisputeGameFactory, error) { + abi, err := abi.JSON(strings.NewReader(OptimismDisputeGameFactoryABI)) + if err != nil { + return nil, err + } + contract, err := bindOptimismDisputeGameFactory(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &OptimismDisputeGameFactory{address: address, abi: abi, OptimismDisputeGameFactoryCaller: OptimismDisputeGameFactoryCaller{contract: contract}, OptimismDisputeGameFactoryTransactor: OptimismDisputeGameFactoryTransactor{contract: contract}, OptimismDisputeGameFactoryFilterer: OptimismDisputeGameFactoryFilterer{contract: contract}}, nil +} + +func NewOptimismDisputeGameFactoryCaller(address common.Address, caller bind.ContractCaller) (*OptimismDisputeGameFactoryCaller, error) { + contract, err := bindOptimismDisputeGameFactory(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &OptimismDisputeGameFactoryCaller{contract: contract}, nil +} + +func NewOptimismDisputeGameFactoryTransactor(address common.Address, transactor bind.ContractTransactor) (*OptimismDisputeGameFactoryTransactor, error) { + contract, err := bindOptimismDisputeGameFactory(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &OptimismDisputeGameFactoryTransactor{contract: contract}, nil +} + +func NewOptimismDisputeGameFactoryFilterer(address common.Address, filterer bind.ContractFilterer) (*OptimismDisputeGameFactoryFilterer, error) { + contract, err := bindOptimismDisputeGameFactory(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &OptimismDisputeGameFactoryFilterer{contract: contract}, nil +} + +func bindOptimismDisputeGameFactory(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := OptimismDisputeGameFactoryMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +func (_OptimismDisputeGameFactory *OptimismDisputeGameFactoryRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _OptimismDisputeGameFactory.Contract.OptimismDisputeGameFactoryCaller.contract.Call(opts, result, method, params...) +} + +func (_OptimismDisputeGameFactory *OptimismDisputeGameFactoryRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _OptimismDisputeGameFactory.Contract.OptimismDisputeGameFactoryTransactor.contract.Transfer(opts) +} + +func (_OptimismDisputeGameFactory *OptimismDisputeGameFactoryRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _OptimismDisputeGameFactory.Contract.OptimismDisputeGameFactoryTransactor.contract.Transact(opts, method, params...) +} + +func (_OptimismDisputeGameFactory *OptimismDisputeGameFactoryCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _OptimismDisputeGameFactory.Contract.contract.Call(opts, result, method, params...) +} + +func (_OptimismDisputeGameFactory *OptimismDisputeGameFactoryTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _OptimismDisputeGameFactory.Contract.contract.Transfer(opts) +} + +func (_OptimismDisputeGameFactory *OptimismDisputeGameFactoryTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _OptimismDisputeGameFactory.Contract.contract.Transact(opts, method, params...) +} + +func (_OptimismDisputeGameFactory *OptimismDisputeGameFactoryCaller) FindLatestGames(opts *bind.CallOpts, _gameType uint32, _start *big.Int, _n *big.Int) ([]IOptimismDisputeGameFactoryGameSearchResult, error) { + var out []interface{} + err := _OptimismDisputeGameFactory.contract.Call(opts, &out, "findLatestGames", _gameType, _start, _n) + + if err != nil { + return *new([]IOptimismDisputeGameFactoryGameSearchResult), err + } + + out0 := *abi.ConvertType(out[0], new([]IOptimismDisputeGameFactoryGameSearchResult)).(*[]IOptimismDisputeGameFactoryGameSearchResult) + + return out0, err + +} + +func (_OptimismDisputeGameFactory *OptimismDisputeGameFactorySession) FindLatestGames(_gameType uint32, _start *big.Int, _n *big.Int) ([]IOptimismDisputeGameFactoryGameSearchResult, error) { + return _OptimismDisputeGameFactory.Contract.FindLatestGames(&_OptimismDisputeGameFactory.CallOpts, _gameType, _start, _n) +} + +func (_OptimismDisputeGameFactory *OptimismDisputeGameFactoryCallerSession) FindLatestGames(_gameType uint32, _start *big.Int, _n *big.Int) ([]IOptimismDisputeGameFactoryGameSearchResult, error) { + return _OptimismDisputeGameFactory.Contract.FindLatestGames(&_OptimismDisputeGameFactory.CallOpts, _gameType, _start, _n) +} + +func (_OptimismDisputeGameFactory *OptimismDisputeGameFactoryCaller) GameCount(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _OptimismDisputeGameFactory.contract.Call(opts, &out, "gameCount") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_OptimismDisputeGameFactory *OptimismDisputeGameFactorySession) GameCount() (*big.Int, error) { + return _OptimismDisputeGameFactory.Contract.GameCount(&_OptimismDisputeGameFactory.CallOpts) +} + +func (_OptimismDisputeGameFactory *OptimismDisputeGameFactoryCallerSession) GameCount() (*big.Int, error) { + return _OptimismDisputeGameFactory.Contract.GameCount(&_OptimismDisputeGameFactory.CallOpts) +} + +func (_OptimismDisputeGameFactory *OptimismDisputeGameFactory) Address() common.Address { + return _OptimismDisputeGameFactory.address +} + +type OptimismDisputeGameFactoryInterface interface { + FindLatestGames(opts *bind.CallOpts, _gameType uint32, _start *big.Int, _n *big.Int) ([]IOptimismDisputeGameFactoryGameSearchResult, error) + + GameCount(opts *bind.CallOpts) (*big.Int, error) + + Address() common.Address +} diff --git a/core/gethwrappers/liquiditymanager/generated/optimism_l1_bridge_adapter/optimism_l1_bridge_adapter.go b/core/gethwrappers/liquiditymanager/generated/optimism_l1_bridge_adapter/optimism_l1_bridge_adapter.go new file mode 100644 index 00000000000..189d13dd43d --- /dev/null +++ b/core/gethwrappers/liquiditymanager/generated/optimism_l1_bridge_adapter/optimism_l1_bridge_adapter.go @@ -0,0 +1,316 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package optimism_l1_bridge_adapter + +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" +) + +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +var OptimismL1BridgeAdapterMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"internalType\":\"contractIL1StandardBridge\",\"name\":\"l1Bridge\",\"type\":\"address\"},{\"internalType\":\"contractIWrappedNative\",\"name\":\"wrappedNative\",\"type\":\"address\"},{\"internalType\":\"contractIOptimismPortal\",\"name\":\"optimismPortal\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"BridgeAddressCannotBeZero\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"wanted\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"got\",\"type\":\"uint256\"}],\"name\":\"InsufficientEthValue\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidFinalizationAction\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"MsgShouldNotContainValue\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"msgValue\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"MsgValueDoesNotMatchAmount\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"finalizeWithdrawERC20\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getBridgeFeeInNative\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getL1Bridge\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getOptimismPortal\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getWrappedNative\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"localToken\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"remoteToken\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"sendERC20\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]", + Bin: "0x60e0604052600080546001600160401b03191690553480156200002157600080fd5b50604051620016e7380380620016e78339810160408190526200004491620000cb565b6001600160a01b03831615806200006257506001600160a01b038216155b806200007557506001600160a01b038116155b156200009457604051635e9c404d60e11b815260040160405180910390fd5b6001600160a01b0392831660805290821660a0521660c0526200011f565b6001600160a01b0381168114620000c857600080fd5b50565b600080600060608486031215620000e157600080fd5b8351620000ee81620000b2565b60208501519093506200010181620000b2565b60408501519092506200011481620000b2565b809150509250925092565b60805160a05160c0516115686200017f6000396000818160d5015281816105f901526106da01526000818161017c0152818161035401526103d40152600081816101490152818161048001528181610515015261057701526115686000f3fe6080604052600436106100695760003560e01c8063a71d98b711610043578063a71d98b71461011a578063c86d5bdd1461013a578063e861e9071461016d57600080fd5b80632e4b1fc91461007557806338314bb21461009657806354fd969f146100c657600080fd5b3661007057005b600080fd5b34801561008157600080fd5b50604051600081526020015b60405180910390f35b3480156100a257600080fd5b506100b66100b1366004610c62565b6101a0565b604051901515815260200161008d565b3480156100d257600080fd5b507f00000000000000000000000000000000000000000000000000000000000000005b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161008d565b61012d610128366004610cc7565b61027f565b60405161008d9190610dba565b34801561014657600080fd5b507f00000000000000000000000000000000000000000000000000000000000000006100f5565b34801561017957600080fd5b507f00000000000000000000000000000000000000000000000000000000000000006100f5565b6000806101af83850185610ee4565b90506000815160018111156101c6576101c6610faa565b036101fb57600081602001518060200190518101906101e5919061116c565b90506101f0816105f7565b600092505050610277565b60018151600181111561021057610210610faa565b03610245576000816020015180602001905181019061022f919061126a565b905061023a8161069b565b600192505050610277565b6040517fee2ef09800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b949350505050565b60606102a373ffffffffffffffffffffffffffffffffffffffff881633308761070e565b34156102e2576040517f2543d86e0000000000000000000000000000000000000000000000000000000081523460048201526024015b60405180910390fd5b6000805467ffffffffffffffff1681806102fb836112ed565b91906101000a81548167ffffffffffffffff021916908367ffffffffffffffff160217905550604051602001610341919067ffffffffffffffff91909116815260200190565b60405160208183030381529060405290507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff16036104f9576040517f2e1a7d4d000000000000000000000000000000000000000000000000000000008152600481018690527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1690632e1a7d4d90602401600060405180830381600087803b15801561042d57600080fd5b505af1158015610441573d6000803e3d6000fd5b50506040517f9a2ac6d500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000169250639a2ac6d5915087906104be908a90600090879060040161133b565b6000604051808303818588803b1580156104d757600080fd5b505af11580156104eb573d6000803e3d6000fd5b5050505050809150506105ed565b61053a73ffffffffffffffffffffffffffffffffffffffff89167f0000000000000000000000000000000000000000000000000000000000000000876107f0565b6040517f838b252000000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000169063838b2520906105b7908b908b908b908b90600090899060040161137f565b600060405180830381600087803b1580156105d157600080fd5b505af11580156105e5573d6000803e3d6000fd5b509293505050505b9695505050505050565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16634870496f82600001518360200151846040015185606001516040518563ffffffff1660e01b81526004016106669493929190611435565b600060405180830381600087803b15801561068057600080fd5b505af1158015610694573d6000803e3d6000fd5b5050505050565b80516040517f8c3152e900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001691638c3152e99161066691906004016114f1565b60405173ffffffffffffffffffffffffffffffffffffffff808516602483015283166044820152606481018290526107ea9085907f23b872dd00000000000000000000000000000000000000000000000000000000906084015b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152610977565b50505050565b80158061089057506040517fdd62ed3e00000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff838116602483015284169063dd62ed3e90604401602060405180830381865afa15801561086a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061088e9190611504565b155b61091c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527f20746f206e6f6e2d7a65726f20616c6c6f77616e63650000000000000000000060648201526084016102d9565b60405173ffffffffffffffffffffffffffffffffffffffff83166024820152604481018290526109729084907f095ea7b30000000000000000000000000000000000000000000000000000000090606401610768565b505050565b60006109d9826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16610a839092919063ffffffff16565b80519091501561097257808060200190518101906109f7919061151d565b610972576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f7420737563636565640000000000000000000000000000000000000000000060648201526084016102d9565b60606102778484600085856000808673ffffffffffffffffffffffffffffffffffffffff168587604051610ab7919061153f565b60006040518083038185875af1925050503d8060008114610af4576040519150601f19603f3d011682016040523d82523d6000602084013e610af9565b606091505b5091509150610b0a87838387610b15565b979650505050505050565b60608315610bab578251600003610ba45773ffffffffffffffffffffffffffffffffffffffff85163b610ba4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016102d9565b5081610277565b6102778383815115610bc05781518083602001fd5b806040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102d99190610dba565b73ffffffffffffffffffffffffffffffffffffffff81168114610c1657600080fd5b50565b60008083601f840112610c2b57600080fd5b50813567ffffffffffffffff811115610c4357600080fd5b602083019150836020828501011115610c5b57600080fd5b9250929050565b60008060008060608587031215610c7857600080fd5b8435610c8381610bf4565b93506020850135610c9381610bf4565b9250604085013567ffffffffffffffff811115610caf57600080fd5b610cbb87828801610c19565b95989497509550505050565b60008060008060008060a08789031215610ce057600080fd5b8635610ceb81610bf4565b95506020870135610cfb81610bf4565b94506040870135610d0b81610bf4565b935060608701359250608087013567ffffffffffffffff811115610d2e57600080fd5b610d3a89828a01610c19565b979a9699509497509295939492505050565b60005b83811015610d67578181015183820152602001610d4f565b50506000910152565b60008151808452610d88816020860160208601610d4c565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b602081526000610dcd6020830184610d70565b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040805190810167ffffffffffffffff81118282101715610e2657610e26610dd4565b60405290565b6040516080810167ffffffffffffffff81118282101715610e2657610e26610dd4565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715610e9657610e96610dd4565b604052919050565b600067ffffffffffffffff821115610eb857610eb8610dd4565b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b60006020808385031215610ef757600080fd5b823567ffffffffffffffff80821115610f0f57600080fd5b9084019060408287031215610f2357600080fd5b610f2b610e03565b823560028110610f3a57600080fd5b81528284013582811115610f4d57600080fd5b80840193505086601f840112610f6257600080fd5b82359150610f77610f7283610e9e565b610e4f565b8281528785848601011115610f8b57600080fd5b8285850186830137600092810185019290925292830152509392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b600082601f830112610fea57600080fd5b8151610ff8610f7282610e9e565b81815284602083860101111561100d57600080fd5b610277826020830160208701610d4c565b600060c0828403121561103057600080fd5b60405160c0810167ffffffffffffffff828210818311171561105457611054610dd4565b81604052829350845183526020850151915061106f82610bf4565b8160208401526040850151915061108582610bf4565b816040840152606085015160608401526080850151608084015260a08501519150808211156110b357600080fd5b506110c085828601610fd9565b60a0830152505092915050565b600082601f8301126110de57600080fd5b8151602067ffffffffffffffff808311156110fb576110fb610dd4565b8260051b61110a838201610e4f565b938452858101830193838101908886111561112457600080fd5b84880192505b85831015611160578251848111156111425760008081fd5b6111508a87838c0101610fd9565b835250918401919084019061112a565b98975050505050505050565b60006020828403121561117e57600080fd5b815167ffffffffffffffff8082111561119657600080fd5b9083019081850360e08112156111ab57600080fd5b6111b3610e2c565b8351838111156111c257600080fd5b6111ce8882870161101e565b8252506020840151602082015260807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc08301121561120b57600080fd5b611213610e2c565b6040858101518252606080870151602084015260808701518284015260a08701519083015282015260c084015191508282111561124f57600080fd5b61125b878386016110cd565b60608201529695505050505050565b60006020828403121561127c57600080fd5b815167ffffffffffffffff8082111561129457600080fd5b90830190602082860312156112a857600080fd5b6040516020810181811083821117156112c3576112c3610dd4565b6040528251828111156112d557600080fd5b6112e18782860161101e565b82525095945050505050565b600067ffffffffffffffff808316818103611331577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6001019392505050565b73ffffffffffffffffffffffffffffffffffffffff8416815263ffffffff831660208201526060604082015260006113766060830184610d70565b95945050505050565b600073ffffffffffffffffffffffffffffffffffffffff8089168352808816602084015280871660408401525084606083015263ffffffff8416608083015260c060a083015261116060c0830184610d70565b805182526000602082015173ffffffffffffffffffffffffffffffffffffffff80821660208601528060408501511660408601525050606082015160608401526080820151608084015260a082015160c060a085015261027760c0850182610d70565b60e08152600061144860e08301876113d2565b602086818501528551604085015280860151606085015260408601516080850152606086015160a085015283820360c08501528185518084528284019150828160051b85010183880160005b838110156114e0577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08784030185526114ce838351610d70565b94860194925090850190600101611494565b50909b9a5050505050505050505050565b602081526000610dcd60208301846113d2565b60006020828403121561151657600080fd5b5051919050565b60006020828403121561152f57600080fd5b81518015158114610dcd57600080fd5b60008251611551818460208701610d4c565b919091019291505056fea164736f6c6343000818000a", +} + +var OptimismL1BridgeAdapterABI = OptimismL1BridgeAdapterMetaData.ABI + +var OptimismL1BridgeAdapterBin = OptimismL1BridgeAdapterMetaData.Bin + +func DeployOptimismL1BridgeAdapter(auth *bind.TransactOpts, backend bind.ContractBackend, l1Bridge common.Address, wrappedNative common.Address, optimismPortal common.Address) (common.Address, *types.Transaction, *OptimismL1BridgeAdapter, error) { + parsed, err := OptimismL1BridgeAdapterMetaData.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(OptimismL1BridgeAdapterBin), backend, l1Bridge, wrappedNative, optimismPortal) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &OptimismL1BridgeAdapter{address: address, abi: *parsed, OptimismL1BridgeAdapterCaller: OptimismL1BridgeAdapterCaller{contract: contract}, OptimismL1BridgeAdapterTransactor: OptimismL1BridgeAdapterTransactor{contract: contract}, OptimismL1BridgeAdapterFilterer: OptimismL1BridgeAdapterFilterer{contract: contract}}, nil +} + +type OptimismL1BridgeAdapter struct { + address common.Address + abi abi.ABI + OptimismL1BridgeAdapterCaller + OptimismL1BridgeAdapterTransactor + OptimismL1BridgeAdapterFilterer +} + +type OptimismL1BridgeAdapterCaller struct { + contract *bind.BoundContract +} + +type OptimismL1BridgeAdapterTransactor struct { + contract *bind.BoundContract +} + +type OptimismL1BridgeAdapterFilterer struct { + contract *bind.BoundContract +} + +type OptimismL1BridgeAdapterSession struct { + Contract *OptimismL1BridgeAdapter + CallOpts bind.CallOpts + TransactOpts bind.TransactOpts +} + +type OptimismL1BridgeAdapterCallerSession struct { + Contract *OptimismL1BridgeAdapterCaller + CallOpts bind.CallOpts +} + +type OptimismL1BridgeAdapterTransactorSession struct { + Contract *OptimismL1BridgeAdapterTransactor + TransactOpts bind.TransactOpts +} + +type OptimismL1BridgeAdapterRaw struct { + Contract *OptimismL1BridgeAdapter +} + +type OptimismL1BridgeAdapterCallerRaw struct { + Contract *OptimismL1BridgeAdapterCaller +} + +type OptimismL1BridgeAdapterTransactorRaw struct { + Contract *OptimismL1BridgeAdapterTransactor +} + +func NewOptimismL1BridgeAdapter(address common.Address, backend bind.ContractBackend) (*OptimismL1BridgeAdapter, error) { + abi, err := abi.JSON(strings.NewReader(OptimismL1BridgeAdapterABI)) + if err != nil { + return nil, err + } + contract, err := bindOptimismL1BridgeAdapter(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &OptimismL1BridgeAdapter{address: address, abi: abi, OptimismL1BridgeAdapterCaller: OptimismL1BridgeAdapterCaller{contract: contract}, OptimismL1BridgeAdapterTransactor: OptimismL1BridgeAdapterTransactor{contract: contract}, OptimismL1BridgeAdapterFilterer: OptimismL1BridgeAdapterFilterer{contract: contract}}, nil +} + +func NewOptimismL1BridgeAdapterCaller(address common.Address, caller bind.ContractCaller) (*OptimismL1BridgeAdapterCaller, error) { + contract, err := bindOptimismL1BridgeAdapter(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &OptimismL1BridgeAdapterCaller{contract: contract}, nil +} + +func NewOptimismL1BridgeAdapterTransactor(address common.Address, transactor bind.ContractTransactor) (*OptimismL1BridgeAdapterTransactor, error) { + contract, err := bindOptimismL1BridgeAdapter(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &OptimismL1BridgeAdapterTransactor{contract: contract}, nil +} + +func NewOptimismL1BridgeAdapterFilterer(address common.Address, filterer bind.ContractFilterer) (*OptimismL1BridgeAdapterFilterer, error) { + contract, err := bindOptimismL1BridgeAdapter(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &OptimismL1BridgeAdapterFilterer{contract: contract}, nil +} + +func bindOptimismL1BridgeAdapter(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := OptimismL1BridgeAdapterMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +func (_OptimismL1BridgeAdapter *OptimismL1BridgeAdapterRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _OptimismL1BridgeAdapter.Contract.OptimismL1BridgeAdapterCaller.contract.Call(opts, result, method, params...) +} + +func (_OptimismL1BridgeAdapter *OptimismL1BridgeAdapterRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _OptimismL1BridgeAdapter.Contract.OptimismL1BridgeAdapterTransactor.contract.Transfer(opts) +} + +func (_OptimismL1BridgeAdapter *OptimismL1BridgeAdapterRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _OptimismL1BridgeAdapter.Contract.OptimismL1BridgeAdapterTransactor.contract.Transact(opts, method, params...) +} + +func (_OptimismL1BridgeAdapter *OptimismL1BridgeAdapterCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _OptimismL1BridgeAdapter.Contract.contract.Call(opts, result, method, params...) +} + +func (_OptimismL1BridgeAdapter *OptimismL1BridgeAdapterTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _OptimismL1BridgeAdapter.Contract.contract.Transfer(opts) +} + +func (_OptimismL1BridgeAdapter *OptimismL1BridgeAdapterTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _OptimismL1BridgeAdapter.Contract.contract.Transact(opts, method, params...) +} + +func (_OptimismL1BridgeAdapter *OptimismL1BridgeAdapterCaller) GetBridgeFeeInNative(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _OptimismL1BridgeAdapter.contract.Call(opts, &out, "getBridgeFeeInNative") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_OptimismL1BridgeAdapter *OptimismL1BridgeAdapterSession) GetBridgeFeeInNative() (*big.Int, error) { + return _OptimismL1BridgeAdapter.Contract.GetBridgeFeeInNative(&_OptimismL1BridgeAdapter.CallOpts) +} + +func (_OptimismL1BridgeAdapter *OptimismL1BridgeAdapterCallerSession) GetBridgeFeeInNative() (*big.Int, error) { + return _OptimismL1BridgeAdapter.Contract.GetBridgeFeeInNative(&_OptimismL1BridgeAdapter.CallOpts) +} + +func (_OptimismL1BridgeAdapter *OptimismL1BridgeAdapterCaller) GetL1Bridge(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _OptimismL1BridgeAdapter.contract.Call(opts, &out, "getL1Bridge") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_OptimismL1BridgeAdapter *OptimismL1BridgeAdapterSession) GetL1Bridge() (common.Address, error) { + return _OptimismL1BridgeAdapter.Contract.GetL1Bridge(&_OptimismL1BridgeAdapter.CallOpts) +} + +func (_OptimismL1BridgeAdapter *OptimismL1BridgeAdapterCallerSession) GetL1Bridge() (common.Address, error) { + return _OptimismL1BridgeAdapter.Contract.GetL1Bridge(&_OptimismL1BridgeAdapter.CallOpts) +} + +func (_OptimismL1BridgeAdapter *OptimismL1BridgeAdapterCaller) GetOptimismPortal(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _OptimismL1BridgeAdapter.contract.Call(opts, &out, "getOptimismPortal") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_OptimismL1BridgeAdapter *OptimismL1BridgeAdapterSession) GetOptimismPortal() (common.Address, error) { + return _OptimismL1BridgeAdapter.Contract.GetOptimismPortal(&_OptimismL1BridgeAdapter.CallOpts) +} + +func (_OptimismL1BridgeAdapter *OptimismL1BridgeAdapterCallerSession) GetOptimismPortal() (common.Address, error) { + return _OptimismL1BridgeAdapter.Contract.GetOptimismPortal(&_OptimismL1BridgeAdapter.CallOpts) +} + +func (_OptimismL1BridgeAdapter *OptimismL1BridgeAdapterCaller) GetWrappedNative(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _OptimismL1BridgeAdapter.contract.Call(opts, &out, "getWrappedNative") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_OptimismL1BridgeAdapter *OptimismL1BridgeAdapterSession) GetWrappedNative() (common.Address, error) { + return _OptimismL1BridgeAdapter.Contract.GetWrappedNative(&_OptimismL1BridgeAdapter.CallOpts) +} + +func (_OptimismL1BridgeAdapter *OptimismL1BridgeAdapterCallerSession) GetWrappedNative() (common.Address, error) { + return _OptimismL1BridgeAdapter.Contract.GetWrappedNative(&_OptimismL1BridgeAdapter.CallOpts) +} + +func (_OptimismL1BridgeAdapter *OptimismL1BridgeAdapterTransactor) FinalizeWithdrawERC20(opts *bind.TransactOpts, arg0 common.Address, arg1 common.Address, data []byte) (*types.Transaction, error) { + return _OptimismL1BridgeAdapter.contract.Transact(opts, "finalizeWithdrawERC20", arg0, arg1, data) +} + +func (_OptimismL1BridgeAdapter *OptimismL1BridgeAdapterSession) FinalizeWithdrawERC20(arg0 common.Address, arg1 common.Address, data []byte) (*types.Transaction, error) { + return _OptimismL1BridgeAdapter.Contract.FinalizeWithdrawERC20(&_OptimismL1BridgeAdapter.TransactOpts, arg0, arg1, data) +} + +func (_OptimismL1BridgeAdapter *OptimismL1BridgeAdapterTransactorSession) FinalizeWithdrawERC20(arg0 common.Address, arg1 common.Address, data []byte) (*types.Transaction, error) { + return _OptimismL1BridgeAdapter.Contract.FinalizeWithdrawERC20(&_OptimismL1BridgeAdapter.TransactOpts, arg0, arg1, data) +} + +func (_OptimismL1BridgeAdapter *OptimismL1BridgeAdapterTransactor) SendERC20(opts *bind.TransactOpts, localToken common.Address, remoteToken common.Address, recipient common.Address, amount *big.Int, arg4 []byte) (*types.Transaction, error) { + return _OptimismL1BridgeAdapter.contract.Transact(opts, "sendERC20", localToken, remoteToken, recipient, amount, arg4) +} + +func (_OptimismL1BridgeAdapter *OptimismL1BridgeAdapterSession) SendERC20(localToken common.Address, remoteToken common.Address, recipient common.Address, amount *big.Int, arg4 []byte) (*types.Transaction, error) { + return _OptimismL1BridgeAdapter.Contract.SendERC20(&_OptimismL1BridgeAdapter.TransactOpts, localToken, remoteToken, recipient, amount, arg4) +} + +func (_OptimismL1BridgeAdapter *OptimismL1BridgeAdapterTransactorSession) SendERC20(localToken common.Address, remoteToken common.Address, recipient common.Address, amount *big.Int, arg4 []byte) (*types.Transaction, error) { + return _OptimismL1BridgeAdapter.Contract.SendERC20(&_OptimismL1BridgeAdapter.TransactOpts, localToken, remoteToken, recipient, amount, arg4) +} + +func (_OptimismL1BridgeAdapter *OptimismL1BridgeAdapterTransactor) Receive(opts *bind.TransactOpts) (*types.Transaction, error) { + return _OptimismL1BridgeAdapter.contract.RawTransact(opts, nil) +} + +func (_OptimismL1BridgeAdapter *OptimismL1BridgeAdapterSession) Receive() (*types.Transaction, error) { + return _OptimismL1BridgeAdapter.Contract.Receive(&_OptimismL1BridgeAdapter.TransactOpts) +} + +func (_OptimismL1BridgeAdapter *OptimismL1BridgeAdapterTransactorSession) Receive() (*types.Transaction, error) { + return _OptimismL1BridgeAdapter.Contract.Receive(&_OptimismL1BridgeAdapter.TransactOpts) +} + +func (_OptimismL1BridgeAdapter *OptimismL1BridgeAdapter) Address() common.Address { + return _OptimismL1BridgeAdapter.address +} + +type OptimismL1BridgeAdapterInterface interface { + GetBridgeFeeInNative(opts *bind.CallOpts) (*big.Int, error) + + GetL1Bridge(opts *bind.CallOpts) (common.Address, error) + + GetOptimismPortal(opts *bind.CallOpts) (common.Address, error) + + GetWrappedNative(opts *bind.CallOpts) (common.Address, error) + + FinalizeWithdrawERC20(opts *bind.TransactOpts, arg0 common.Address, arg1 common.Address, data []byte) (*types.Transaction, error) + + SendERC20(opts *bind.TransactOpts, localToken common.Address, remoteToken common.Address, recipient common.Address, amount *big.Int, arg4 []byte) (*types.Transaction, error) + + Receive(opts *bind.TransactOpts) (*types.Transaction, error) + + Address() common.Address +} diff --git a/core/gethwrappers/liquiditymanager/generated/optimism_l1_bridge_adapter_encoder/optimism_l1_bridge_adapter_encoder.go b/core/gethwrappers/liquiditymanager/generated/optimism_l1_bridge_adapter_encoder/optimism_l1_bridge_adapter_encoder.go new file mode 100644 index 00000000000..14aa651399b --- /dev/null +++ b/core/gethwrappers/liquiditymanager/generated/optimism_l1_bridge_adapter_encoder/optimism_l1_bridge_adapter_encoder.go @@ -0,0 +1,257 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package optimism_l1_bridge_adapter_encoder + +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" +) + +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +type OptimismL1BridgeAdapterFinalizeWithdrawERC20Payload struct { + Action uint8 + Data []byte +} + +type OptimismL1BridgeAdapterOptimismFinalizationPayload struct { + WithdrawalTransaction TypesWithdrawalTransaction +} + +type OptimismL1BridgeAdapterOptimismProveWithdrawalPayload struct { + WithdrawalTransaction TypesWithdrawalTransaction + L2OutputIndex *big.Int + OutputRootProof TypesOutputRootProof + WithdrawalProof [][]byte +} + +type TypesOutputRootProof struct { + Version [32]byte + StateRoot [32]byte + MessagePasserStorageRoot [32]byte + LatestBlockhash [32]byte +} + +type TypesWithdrawalTransaction struct { + Nonce *big.Int + Sender common.Address + Target common.Address + Value *big.Int + GasLimit *big.Int + Data []byte +} + +var OptimismL1BridgeAdapterEncoderMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"components\":[{\"internalType\":\"enumOptimismL1BridgeAdapter.FinalizationAction\",\"name\":\"action\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"internalType\":\"structOptimismL1BridgeAdapter.FinalizeWithdrawERC20Payload\",\"name\":\"payload\",\"type\":\"tuple\"}],\"name\":\"encodeFinalizeWithdrawalERC20Payload\",\"outputs\":[],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"gasLimit\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"internalType\":\"structTypes.WithdrawalTransaction\",\"name\":\"withdrawalTransaction\",\"type\":\"tuple\"}],\"internalType\":\"structOptimismL1BridgeAdapter.OptimismFinalizationPayload\",\"name\":\"payload\",\"type\":\"tuple\"}],\"name\":\"encodeOptimismFinalizationPayload\",\"outputs\":[],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"gasLimit\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"internalType\":\"structTypes.WithdrawalTransaction\",\"name\":\"withdrawalTransaction\",\"type\":\"tuple\"},{\"internalType\":\"uint256\",\"name\":\"l2OutputIndex\",\"type\":\"uint256\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"version\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"stateRoot\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"messagePasserStorageRoot\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"latestBlockhash\",\"type\":\"bytes32\"}],\"internalType\":\"structTypes.OutputRootProof\",\"name\":\"outputRootProof\",\"type\":\"tuple\"},{\"internalType\":\"bytes[]\",\"name\":\"withdrawalProof\",\"type\":\"bytes[]\"}],\"internalType\":\"structOptimismL1BridgeAdapter.OptimismProveWithdrawalPayload\",\"name\":\"payload\",\"type\":\"tuple\"}],\"name\":\"encodeOptimismProveWithdrawalPayload\",\"outputs\":[],\"stateMutability\":\"pure\",\"type\":\"function\"}]", +} + +var OptimismL1BridgeAdapterEncoderABI = OptimismL1BridgeAdapterEncoderMetaData.ABI + +type OptimismL1BridgeAdapterEncoder struct { + address common.Address + abi abi.ABI + OptimismL1BridgeAdapterEncoderCaller + OptimismL1BridgeAdapterEncoderTransactor + OptimismL1BridgeAdapterEncoderFilterer +} + +type OptimismL1BridgeAdapterEncoderCaller struct { + contract *bind.BoundContract +} + +type OptimismL1BridgeAdapterEncoderTransactor struct { + contract *bind.BoundContract +} + +type OptimismL1BridgeAdapterEncoderFilterer struct { + contract *bind.BoundContract +} + +type OptimismL1BridgeAdapterEncoderSession struct { + Contract *OptimismL1BridgeAdapterEncoder + CallOpts bind.CallOpts + TransactOpts bind.TransactOpts +} + +type OptimismL1BridgeAdapterEncoderCallerSession struct { + Contract *OptimismL1BridgeAdapterEncoderCaller + CallOpts bind.CallOpts +} + +type OptimismL1BridgeAdapterEncoderTransactorSession struct { + Contract *OptimismL1BridgeAdapterEncoderTransactor + TransactOpts bind.TransactOpts +} + +type OptimismL1BridgeAdapterEncoderRaw struct { + Contract *OptimismL1BridgeAdapterEncoder +} + +type OptimismL1BridgeAdapterEncoderCallerRaw struct { + Contract *OptimismL1BridgeAdapterEncoderCaller +} + +type OptimismL1BridgeAdapterEncoderTransactorRaw struct { + Contract *OptimismL1BridgeAdapterEncoderTransactor +} + +func NewOptimismL1BridgeAdapterEncoder(address common.Address, backend bind.ContractBackend) (*OptimismL1BridgeAdapterEncoder, error) { + abi, err := abi.JSON(strings.NewReader(OptimismL1BridgeAdapterEncoderABI)) + if err != nil { + return nil, err + } + contract, err := bindOptimismL1BridgeAdapterEncoder(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &OptimismL1BridgeAdapterEncoder{address: address, abi: abi, OptimismL1BridgeAdapterEncoderCaller: OptimismL1BridgeAdapterEncoderCaller{contract: contract}, OptimismL1BridgeAdapterEncoderTransactor: OptimismL1BridgeAdapterEncoderTransactor{contract: contract}, OptimismL1BridgeAdapterEncoderFilterer: OptimismL1BridgeAdapterEncoderFilterer{contract: contract}}, nil +} + +func NewOptimismL1BridgeAdapterEncoderCaller(address common.Address, caller bind.ContractCaller) (*OptimismL1BridgeAdapterEncoderCaller, error) { + contract, err := bindOptimismL1BridgeAdapterEncoder(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &OptimismL1BridgeAdapterEncoderCaller{contract: contract}, nil +} + +func NewOptimismL1BridgeAdapterEncoderTransactor(address common.Address, transactor bind.ContractTransactor) (*OptimismL1BridgeAdapterEncoderTransactor, error) { + contract, err := bindOptimismL1BridgeAdapterEncoder(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &OptimismL1BridgeAdapterEncoderTransactor{contract: contract}, nil +} + +func NewOptimismL1BridgeAdapterEncoderFilterer(address common.Address, filterer bind.ContractFilterer) (*OptimismL1BridgeAdapterEncoderFilterer, error) { + contract, err := bindOptimismL1BridgeAdapterEncoder(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &OptimismL1BridgeAdapterEncoderFilterer{contract: contract}, nil +} + +func bindOptimismL1BridgeAdapterEncoder(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := OptimismL1BridgeAdapterEncoderMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +func (_OptimismL1BridgeAdapterEncoder *OptimismL1BridgeAdapterEncoderRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _OptimismL1BridgeAdapterEncoder.Contract.OptimismL1BridgeAdapterEncoderCaller.contract.Call(opts, result, method, params...) +} + +func (_OptimismL1BridgeAdapterEncoder *OptimismL1BridgeAdapterEncoderRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _OptimismL1BridgeAdapterEncoder.Contract.OptimismL1BridgeAdapterEncoderTransactor.contract.Transfer(opts) +} + +func (_OptimismL1BridgeAdapterEncoder *OptimismL1BridgeAdapterEncoderRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _OptimismL1BridgeAdapterEncoder.Contract.OptimismL1BridgeAdapterEncoderTransactor.contract.Transact(opts, method, params...) +} + +func (_OptimismL1BridgeAdapterEncoder *OptimismL1BridgeAdapterEncoderCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _OptimismL1BridgeAdapterEncoder.Contract.contract.Call(opts, result, method, params...) +} + +func (_OptimismL1BridgeAdapterEncoder *OptimismL1BridgeAdapterEncoderTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _OptimismL1BridgeAdapterEncoder.Contract.contract.Transfer(opts) +} + +func (_OptimismL1BridgeAdapterEncoder *OptimismL1BridgeAdapterEncoderTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _OptimismL1BridgeAdapterEncoder.Contract.contract.Transact(opts, method, params...) +} + +func (_OptimismL1BridgeAdapterEncoder *OptimismL1BridgeAdapterEncoderCaller) EncodeFinalizeWithdrawalERC20Payload(opts *bind.CallOpts, payload OptimismL1BridgeAdapterFinalizeWithdrawERC20Payload) error { + var out []interface{} + err := _OptimismL1BridgeAdapterEncoder.contract.Call(opts, &out, "encodeFinalizeWithdrawalERC20Payload", payload) + + if err != nil { + return err + } + + return err + +} + +func (_OptimismL1BridgeAdapterEncoder *OptimismL1BridgeAdapterEncoderSession) EncodeFinalizeWithdrawalERC20Payload(payload OptimismL1BridgeAdapterFinalizeWithdrawERC20Payload) error { + return _OptimismL1BridgeAdapterEncoder.Contract.EncodeFinalizeWithdrawalERC20Payload(&_OptimismL1BridgeAdapterEncoder.CallOpts, payload) +} + +func (_OptimismL1BridgeAdapterEncoder *OptimismL1BridgeAdapterEncoderCallerSession) EncodeFinalizeWithdrawalERC20Payload(payload OptimismL1BridgeAdapterFinalizeWithdrawERC20Payload) error { + return _OptimismL1BridgeAdapterEncoder.Contract.EncodeFinalizeWithdrawalERC20Payload(&_OptimismL1BridgeAdapterEncoder.CallOpts, payload) +} + +func (_OptimismL1BridgeAdapterEncoder *OptimismL1BridgeAdapterEncoderCaller) EncodeOptimismFinalizationPayload(opts *bind.CallOpts, payload OptimismL1BridgeAdapterOptimismFinalizationPayload) error { + var out []interface{} + err := _OptimismL1BridgeAdapterEncoder.contract.Call(opts, &out, "encodeOptimismFinalizationPayload", payload) + + if err != nil { + return err + } + + return err + +} + +func (_OptimismL1BridgeAdapterEncoder *OptimismL1BridgeAdapterEncoderSession) EncodeOptimismFinalizationPayload(payload OptimismL1BridgeAdapterOptimismFinalizationPayload) error { + return _OptimismL1BridgeAdapterEncoder.Contract.EncodeOptimismFinalizationPayload(&_OptimismL1BridgeAdapterEncoder.CallOpts, payload) +} + +func (_OptimismL1BridgeAdapterEncoder *OptimismL1BridgeAdapterEncoderCallerSession) EncodeOptimismFinalizationPayload(payload OptimismL1BridgeAdapterOptimismFinalizationPayload) error { + return _OptimismL1BridgeAdapterEncoder.Contract.EncodeOptimismFinalizationPayload(&_OptimismL1BridgeAdapterEncoder.CallOpts, payload) +} + +func (_OptimismL1BridgeAdapterEncoder *OptimismL1BridgeAdapterEncoderCaller) EncodeOptimismProveWithdrawalPayload(opts *bind.CallOpts, payload OptimismL1BridgeAdapterOptimismProveWithdrawalPayload) error { + var out []interface{} + err := _OptimismL1BridgeAdapterEncoder.contract.Call(opts, &out, "encodeOptimismProveWithdrawalPayload", payload) + + if err != nil { + return err + } + + return err + +} + +func (_OptimismL1BridgeAdapterEncoder *OptimismL1BridgeAdapterEncoderSession) EncodeOptimismProveWithdrawalPayload(payload OptimismL1BridgeAdapterOptimismProveWithdrawalPayload) error { + return _OptimismL1BridgeAdapterEncoder.Contract.EncodeOptimismProveWithdrawalPayload(&_OptimismL1BridgeAdapterEncoder.CallOpts, payload) +} + +func (_OptimismL1BridgeAdapterEncoder *OptimismL1BridgeAdapterEncoderCallerSession) EncodeOptimismProveWithdrawalPayload(payload OptimismL1BridgeAdapterOptimismProveWithdrawalPayload) error { + return _OptimismL1BridgeAdapterEncoder.Contract.EncodeOptimismProveWithdrawalPayload(&_OptimismL1BridgeAdapterEncoder.CallOpts, payload) +} + +func (_OptimismL1BridgeAdapterEncoder *OptimismL1BridgeAdapterEncoder) Address() common.Address { + return _OptimismL1BridgeAdapterEncoder.address +} + +type OptimismL1BridgeAdapterEncoderInterface interface { + EncodeFinalizeWithdrawalERC20Payload(opts *bind.CallOpts, payload OptimismL1BridgeAdapterFinalizeWithdrawERC20Payload) error + + EncodeOptimismFinalizationPayload(opts *bind.CallOpts, payload OptimismL1BridgeAdapterOptimismFinalizationPayload) error + + EncodeOptimismProveWithdrawalPayload(opts *bind.CallOpts, payload OptimismL1BridgeAdapterOptimismProveWithdrawalPayload) error + + Address() common.Address +} diff --git a/core/gethwrappers/liquiditymanager/generated/optimism_l1_standard_bridge/optimism_l1_standard_bridge.go b/core/gethwrappers/liquiditymanager/generated/optimism_l1_standard_bridge/optimism_l1_standard_bridge.go new file mode 100644 index 00000000000..b376a334355 --- /dev/null +++ b/core/gethwrappers/liquiditymanager/generated/optimism_l1_standard_bridge/optimism_l1_standard_bridge.go @@ -0,0 +1,173 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package optimism_l1_standard_bridge + +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" +) + +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +var OptimismL1StandardBridgeMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"_minGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"_extraData\",\"type\":\"bytes\"}],\"name\":\"depositETHTo\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"}]", +} + +var OptimismL1StandardBridgeABI = OptimismL1StandardBridgeMetaData.ABI + +type OptimismL1StandardBridge struct { + address common.Address + abi abi.ABI + OptimismL1StandardBridgeCaller + OptimismL1StandardBridgeTransactor + OptimismL1StandardBridgeFilterer +} + +type OptimismL1StandardBridgeCaller struct { + contract *bind.BoundContract +} + +type OptimismL1StandardBridgeTransactor struct { + contract *bind.BoundContract +} + +type OptimismL1StandardBridgeFilterer struct { + contract *bind.BoundContract +} + +type OptimismL1StandardBridgeSession struct { + Contract *OptimismL1StandardBridge + CallOpts bind.CallOpts + TransactOpts bind.TransactOpts +} + +type OptimismL1StandardBridgeCallerSession struct { + Contract *OptimismL1StandardBridgeCaller + CallOpts bind.CallOpts +} + +type OptimismL1StandardBridgeTransactorSession struct { + Contract *OptimismL1StandardBridgeTransactor + TransactOpts bind.TransactOpts +} + +type OptimismL1StandardBridgeRaw struct { + Contract *OptimismL1StandardBridge +} + +type OptimismL1StandardBridgeCallerRaw struct { + Contract *OptimismL1StandardBridgeCaller +} + +type OptimismL1StandardBridgeTransactorRaw struct { + Contract *OptimismL1StandardBridgeTransactor +} + +func NewOptimismL1StandardBridge(address common.Address, backend bind.ContractBackend) (*OptimismL1StandardBridge, error) { + abi, err := abi.JSON(strings.NewReader(OptimismL1StandardBridgeABI)) + if err != nil { + return nil, err + } + contract, err := bindOptimismL1StandardBridge(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &OptimismL1StandardBridge{address: address, abi: abi, OptimismL1StandardBridgeCaller: OptimismL1StandardBridgeCaller{contract: contract}, OptimismL1StandardBridgeTransactor: OptimismL1StandardBridgeTransactor{contract: contract}, OptimismL1StandardBridgeFilterer: OptimismL1StandardBridgeFilterer{contract: contract}}, nil +} + +func NewOptimismL1StandardBridgeCaller(address common.Address, caller bind.ContractCaller) (*OptimismL1StandardBridgeCaller, error) { + contract, err := bindOptimismL1StandardBridge(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &OptimismL1StandardBridgeCaller{contract: contract}, nil +} + +func NewOptimismL1StandardBridgeTransactor(address common.Address, transactor bind.ContractTransactor) (*OptimismL1StandardBridgeTransactor, error) { + contract, err := bindOptimismL1StandardBridge(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &OptimismL1StandardBridgeTransactor{contract: contract}, nil +} + +func NewOptimismL1StandardBridgeFilterer(address common.Address, filterer bind.ContractFilterer) (*OptimismL1StandardBridgeFilterer, error) { + contract, err := bindOptimismL1StandardBridge(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &OptimismL1StandardBridgeFilterer{contract: contract}, nil +} + +func bindOptimismL1StandardBridge(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := OptimismL1StandardBridgeMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +func (_OptimismL1StandardBridge *OptimismL1StandardBridgeRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _OptimismL1StandardBridge.Contract.OptimismL1StandardBridgeCaller.contract.Call(opts, result, method, params...) +} + +func (_OptimismL1StandardBridge *OptimismL1StandardBridgeRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _OptimismL1StandardBridge.Contract.OptimismL1StandardBridgeTransactor.contract.Transfer(opts) +} + +func (_OptimismL1StandardBridge *OptimismL1StandardBridgeRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _OptimismL1StandardBridge.Contract.OptimismL1StandardBridgeTransactor.contract.Transact(opts, method, params...) +} + +func (_OptimismL1StandardBridge *OptimismL1StandardBridgeCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _OptimismL1StandardBridge.Contract.contract.Call(opts, result, method, params...) +} + +func (_OptimismL1StandardBridge *OptimismL1StandardBridgeTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _OptimismL1StandardBridge.Contract.contract.Transfer(opts) +} + +func (_OptimismL1StandardBridge *OptimismL1StandardBridgeTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _OptimismL1StandardBridge.Contract.contract.Transact(opts, method, params...) +} + +func (_OptimismL1StandardBridge *OptimismL1StandardBridgeTransactor) DepositETHTo(opts *bind.TransactOpts, _to common.Address, _minGasLimit uint32, _extraData []byte) (*types.Transaction, error) { + return _OptimismL1StandardBridge.contract.Transact(opts, "depositETHTo", _to, _minGasLimit, _extraData) +} + +func (_OptimismL1StandardBridge *OptimismL1StandardBridgeSession) DepositETHTo(_to common.Address, _minGasLimit uint32, _extraData []byte) (*types.Transaction, error) { + return _OptimismL1StandardBridge.Contract.DepositETHTo(&_OptimismL1StandardBridge.TransactOpts, _to, _minGasLimit, _extraData) +} + +func (_OptimismL1StandardBridge *OptimismL1StandardBridgeTransactorSession) DepositETHTo(_to common.Address, _minGasLimit uint32, _extraData []byte) (*types.Transaction, error) { + return _OptimismL1StandardBridge.Contract.DepositETHTo(&_OptimismL1StandardBridge.TransactOpts, _to, _minGasLimit, _extraData) +} + +func (_OptimismL1StandardBridge *OptimismL1StandardBridge) Address() common.Address { + return _OptimismL1StandardBridge.address +} + +type OptimismL1StandardBridgeInterface interface { + DepositETHTo(opts *bind.TransactOpts, _to common.Address, _minGasLimit uint32, _extraData []byte) (*types.Transaction, error) + + Address() common.Address +} diff --git a/core/gethwrappers/liquiditymanager/generated/optimism_l2_bridge_adapter/optimism_l2_bridge_adapter.go b/core/gethwrappers/liquiditymanager/generated/optimism_l2_bridge_adapter/optimism_l2_bridge_adapter.go new file mode 100644 index 00000000000..589db5ceb4b --- /dev/null +++ b/core/gethwrappers/liquiditymanager/generated/optimism_l2_bridge_adapter/optimism_l2_bridge_adapter.go @@ -0,0 +1,302 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package optimism_l2_bridge_adapter + +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" +) + +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +var OptimismL2BridgeAdapterMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"internalType\":\"contractIWrappedNative\",\"name\":\"wrappedNative\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"BridgeAddressCannotBeZero\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"wanted\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"got\",\"type\":\"uint256\"}],\"name\":\"InsufficientEthValue\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"MsgShouldNotContainValue\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"msgValue\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"MsgValueDoesNotMatchAmount\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"finalizeWithdrawERC20\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getBridgeFeeInNative\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getL2Bridge\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getWrappedNative\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"localToken\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"sendERC20\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]", + Bin: "0x60c0604052734200000000000000000000000000000000000010608052600080546001600160401b031916905534801561003857600080fd5b50604051610c2e380380610c2e83398101604081905261005791610068565b6001600160a01b031660a052610098565b60006020828403121561007a57600080fd5b81516001600160a01b038116811461009157600080fd5b9392505050565b60805160a051610b4f6100df6000396000818161013e0152818161024201526102c2015260008181609a0152818161036e0152818161043c01526104f60152610b4f6000f3fe60806040526004361061005e5760003560e01c806338314bb21161004357806338314bb2146100df578063a71d98b71461010f578063e861e9071461012f57600080fd5b80632e4b1fc91461006a5780633429072c1461008b57600080fd5b3661006557005b600080fd5b34801561007657600080fd5b50604051600081526020015b60405180910390f35b34801561009757600080fd5b507f00000000000000000000000000000000000000000000000000000000000000005b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610082565b3480156100eb57600080fd5b506100ff6100fa366004610903565b610162565b6040519015158152602001610082565b61012261011d366004610964565b61016d565b6040516100829190610a51565b34801561013b57600080fd5b507f00000000000000000000000000000000000000000000000000000000000000006100ba565b60015b949350505050565b606034156101ae576040517f2543d86e0000000000000000000000000000000000000000000000000000000081523460048201526024015b60405180910390fd5b6101d073ffffffffffffffffffffffffffffffffffffffff8816333087610574565b6000805467ffffffffffffffff1681806101e983610a6b565b91906101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060405160200161022f919067ffffffffffffffff91909116815260200190565b60405160208183030381529060405290507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff16036103ff576040517f2e1a7d4d000000000000000000000000000000000000000000000000000000008152600481018690527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1690632e1a7d4d90602401600060405180830381600087803b15801561031b57600080fd5b505af115801561032f573d6000803e3d6000fd5b50506040517fa3a7954800000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016925063a3a79548915087906103c49073deaddeaddeaddeaddeaddeaddeaddeaddead0000908b9084906000908990600401610ab9565b6000604051808303818588803b1580156103dd57600080fd5b505af11580156103f1573d6000803e3d6000fd5b50505050508091505061056a565b6040517f095ea7b300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000811660048301526024820187905289169063095ea7b3906044016020604051808303816000875af1158015610494573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104b89190610b04565b506040517fa3a7954800000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000169063a3a7954890610534908b908a908a906000908890600401610ab9565b600060405180830381600087803b15801561054e57600080fd5b505af1158015610562573d6000803e3d6000fd5b509293505050505b9695505050505050565b6040805173ffffffffffffffffffffffffffffffffffffffff85811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f23b872dd0000000000000000000000000000000000000000000000000000000017905261060990859061060f565b50505050565b6000610671826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166107209092919063ffffffff16565b80519091501561071b578080602001905181019061068f9190610b04565b61071b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f7420737563636565640000000000000000000000000000000000000000000060648201526084016101a5565b505050565b60606101658484600085856000808673ffffffffffffffffffffffffffffffffffffffff1685876040516107549190610b26565b60006040518083038185875af1925050503d8060008114610791576040519150601f19603f3d011682016040523d82523d6000602084013e610796565b606091505b50915091506107a7878383876107b2565b979650505050505050565b606083156108485782516000036108415773ffffffffffffffffffffffffffffffffffffffff85163b610841576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016101a5565b5081610165565b610165838381511561085d5781518083602001fd5b806040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101a59190610a51565b803573ffffffffffffffffffffffffffffffffffffffff811681146108b557600080fd5b919050565b60008083601f8401126108cc57600080fd5b50813567ffffffffffffffff8111156108e457600080fd5b6020830191508360208285010111156108fc57600080fd5b9250929050565b6000806000806060858703121561091957600080fd5b61092285610891565b935061093060208601610891565b9250604085013567ffffffffffffffff81111561094c57600080fd5b610958878288016108ba565b95989497509550505050565b60008060008060008060a0878903121561097d57600080fd5b61098687610891565b955061099460208801610891565b94506109a260408801610891565b935060608701359250608087013567ffffffffffffffff8111156109c557600080fd5b6109d189828a016108ba565b979a9699509497509295939492505050565b60005b838110156109fe5781810151838201526020016109e6565b50506000910152565b60008151808452610a1f8160208601602086016109e3565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b602081526000610a646020830184610a07565b9392505050565b600067ffffffffffffffff808316818103610aaf577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6001019392505050565b600073ffffffffffffffffffffffffffffffffffffffff808816835280871660208401525084604083015263ffffffff8416606083015260a060808301526107a760a0830184610a07565b600060208284031215610b1657600080fd5b81518015158114610a6457600080fd5b60008251610b388184602087016109e3565b919091019291505056fea164736f6c6343000818000a", +} + +var OptimismL2BridgeAdapterABI = OptimismL2BridgeAdapterMetaData.ABI + +var OptimismL2BridgeAdapterBin = OptimismL2BridgeAdapterMetaData.Bin + +func DeployOptimismL2BridgeAdapter(auth *bind.TransactOpts, backend bind.ContractBackend, wrappedNative common.Address) (common.Address, *types.Transaction, *OptimismL2BridgeAdapter, error) { + parsed, err := OptimismL2BridgeAdapterMetaData.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(OptimismL2BridgeAdapterBin), backend, wrappedNative) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &OptimismL2BridgeAdapter{address: address, abi: *parsed, OptimismL2BridgeAdapterCaller: OptimismL2BridgeAdapterCaller{contract: contract}, OptimismL2BridgeAdapterTransactor: OptimismL2BridgeAdapterTransactor{contract: contract}, OptimismL2BridgeAdapterFilterer: OptimismL2BridgeAdapterFilterer{contract: contract}}, nil +} + +type OptimismL2BridgeAdapter struct { + address common.Address + abi abi.ABI + OptimismL2BridgeAdapterCaller + OptimismL2BridgeAdapterTransactor + OptimismL2BridgeAdapterFilterer +} + +type OptimismL2BridgeAdapterCaller struct { + contract *bind.BoundContract +} + +type OptimismL2BridgeAdapterTransactor struct { + contract *bind.BoundContract +} + +type OptimismL2BridgeAdapterFilterer struct { + contract *bind.BoundContract +} + +type OptimismL2BridgeAdapterSession struct { + Contract *OptimismL2BridgeAdapter + CallOpts bind.CallOpts + TransactOpts bind.TransactOpts +} + +type OptimismL2BridgeAdapterCallerSession struct { + Contract *OptimismL2BridgeAdapterCaller + CallOpts bind.CallOpts +} + +type OptimismL2BridgeAdapterTransactorSession struct { + Contract *OptimismL2BridgeAdapterTransactor + TransactOpts bind.TransactOpts +} + +type OptimismL2BridgeAdapterRaw struct { + Contract *OptimismL2BridgeAdapter +} + +type OptimismL2BridgeAdapterCallerRaw struct { + Contract *OptimismL2BridgeAdapterCaller +} + +type OptimismL2BridgeAdapterTransactorRaw struct { + Contract *OptimismL2BridgeAdapterTransactor +} + +func NewOptimismL2BridgeAdapter(address common.Address, backend bind.ContractBackend) (*OptimismL2BridgeAdapter, error) { + abi, err := abi.JSON(strings.NewReader(OptimismL2BridgeAdapterABI)) + if err != nil { + return nil, err + } + contract, err := bindOptimismL2BridgeAdapter(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &OptimismL2BridgeAdapter{address: address, abi: abi, OptimismL2BridgeAdapterCaller: OptimismL2BridgeAdapterCaller{contract: contract}, OptimismL2BridgeAdapterTransactor: OptimismL2BridgeAdapterTransactor{contract: contract}, OptimismL2BridgeAdapterFilterer: OptimismL2BridgeAdapterFilterer{contract: contract}}, nil +} + +func NewOptimismL2BridgeAdapterCaller(address common.Address, caller bind.ContractCaller) (*OptimismL2BridgeAdapterCaller, error) { + contract, err := bindOptimismL2BridgeAdapter(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &OptimismL2BridgeAdapterCaller{contract: contract}, nil +} + +func NewOptimismL2BridgeAdapterTransactor(address common.Address, transactor bind.ContractTransactor) (*OptimismL2BridgeAdapterTransactor, error) { + contract, err := bindOptimismL2BridgeAdapter(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &OptimismL2BridgeAdapterTransactor{contract: contract}, nil +} + +func NewOptimismL2BridgeAdapterFilterer(address common.Address, filterer bind.ContractFilterer) (*OptimismL2BridgeAdapterFilterer, error) { + contract, err := bindOptimismL2BridgeAdapter(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &OptimismL2BridgeAdapterFilterer{contract: contract}, nil +} + +func bindOptimismL2BridgeAdapter(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := OptimismL2BridgeAdapterMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +func (_OptimismL2BridgeAdapter *OptimismL2BridgeAdapterRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _OptimismL2BridgeAdapter.Contract.OptimismL2BridgeAdapterCaller.contract.Call(opts, result, method, params...) +} + +func (_OptimismL2BridgeAdapter *OptimismL2BridgeAdapterRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _OptimismL2BridgeAdapter.Contract.OptimismL2BridgeAdapterTransactor.contract.Transfer(opts) +} + +func (_OptimismL2BridgeAdapter *OptimismL2BridgeAdapterRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _OptimismL2BridgeAdapter.Contract.OptimismL2BridgeAdapterTransactor.contract.Transact(opts, method, params...) +} + +func (_OptimismL2BridgeAdapter *OptimismL2BridgeAdapterCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _OptimismL2BridgeAdapter.Contract.contract.Call(opts, result, method, params...) +} + +func (_OptimismL2BridgeAdapter *OptimismL2BridgeAdapterTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _OptimismL2BridgeAdapter.Contract.contract.Transfer(opts) +} + +func (_OptimismL2BridgeAdapter *OptimismL2BridgeAdapterTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _OptimismL2BridgeAdapter.Contract.contract.Transact(opts, method, params...) +} + +func (_OptimismL2BridgeAdapter *OptimismL2BridgeAdapterCaller) FinalizeWithdrawERC20(opts *bind.CallOpts, arg0 common.Address, arg1 common.Address, arg2 []byte) (bool, error) { + var out []interface{} + err := _OptimismL2BridgeAdapter.contract.Call(opts, &out, "finalizeWithdrawERC20", arg0, arg1, arg2) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_OptimismL2BridgeAdapter *OptimismL2BridgeAdapterSession) FinalizeWithdrawERC20(arg0 common.Address, arg1 common.Address, arg2 []byte) (bool, error) { + return _OptimismL2BridgeAdapter.Contract.FinalizeWithdrawERC20(&_OptimismL2BridgeAdapter.CallOpts, arg0, arg1, arg2) +} + +func (_OptimismL2BridgeAdapter *OptimismL2BridgeAdapterCallerSession) FinalizeWithdrawERC20(arg0 common.Address, arg1 common.Address, arg2 []byte) (bool, error) { + return _OptimismL2BridgeAdapter.Contract.FinalizeWithdrawERC20(&_OptimismL2BridgeAdapter.CallOpts, arg0, arg1, arg2) +} + +func (_OptimismL2BridgeAdapter *OptimismL2BridgeAdapterCaller) GetBridgeFeeInNative(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _OptimismL2BridgeAdapter.contract.Call(opts, &out, "getBridgeFeeInNative") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_OptimismL2BridgeAdapter *OptimismL2BridgeAdapterSession) GetBridgeFeeInNative() (*big.Int, error) { + return _OptimismL2BridgeAdapter.Contract.GetBridgeFeeInNative(&_OptimismL2BridgeAdapter.CallOpts) +} + +func (_OptimismL2BridgeAdapter *OptimismL2BridgeAdapterCallerSession) GetBridgeFeeInNative() (*big.Int, error) { + return _OptimismL2BridgeAdapter.Contract.GetBridgeFeeInNative(&_OptimismL2BridgeAdapter.CallOpts) +} + +func (_OptimismL2BridgeAdapter *OptimismL2BridgeAdapterCaller) GetL2Bridge(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _OptimismL2BridgeAdapter.contract.Call(opts, &out, "getL2Bridge") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_OptimismL2BridgeAdapter *OptimismL2BridgeAdapterSession) GetL2Bridge() (common.Address, error) { + return _OptimismL2BridgeAdapter.Contract.GetL2Bridge(&_OptimismL2BridgeAdapter.CallOpts) +} + +func (_OptimismL2BridgeAdapter *OptimismL2BridgeAdapterCallerSession) GetL2Bridge() (common.Address, error) { + return _OptimismL2BridgeAdapter.Contract.GetL2Bridge(&_OptimismL2BridgeAdapter.CallOpts) +} + +func (_OptimismL2BridgeAdapter *OptimismL2BridgeAdapterCaller) GetWrappedNative(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _OptimismL2BridgeAdapter.contract.Call(opts, &out, "getWrappedNative") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_OptimismL2BridgeAdapter *OptimismL2BridgeAdapterSession) GetWrappedNative() (common.Address, error) { + return _OptimismL2BridgeAdapter.Contract.GetWrappedNative(&_OptimismL2BridgeAdapter.CallOpts) +} + +func (_OptimismL2BridgeAdapter *OptimismL2BridgeAdapterCallerSession) GetWrappedNative() (common.Address, error) { + return _OptimismL2BridgeAdapter.Contract.GetWrappedNative(&_OptimismL2BridgeAdapter.CallOpts) +} + +func (_OptimismL2BridgeAdapter *OptimismL2BridgeAdapterTransactor) SendERC20(opts *bind.TransactOpts, localToken common.Address, arg1 common.Address, recipient common.Address, amount *big.Int, arg4 []byte) (*types.Transaction, error) { + return _OptimismL2BridgeAdapter.contract.Transact(opts, "sendERC20", localToken, arg1, recipient, amount, arg4) +} + +func (_OptimismL2BridgeAdapter *OptimismL2BridgeAdapterSession) SendERC20(localToken common.Address, arg1 common.Address, recipient common.Address, amount *big.Int, arg4 []byte) (*types.Transaction, error) { + return _OptimismL2BridgeAdapter.Contract.SendERC20(&_OptimismL2BridgeAdapter.TransactOpts, localToken, arg1, recipient, amount, arg4) +} + +func (_OptimismL2BridgeAdapter *OptimismL2BridgeAdapterTransactorSession) SendERC20(localToken common.Address, arg1 common.Address, recipient common.Address, amount *big.Int, arg4 []byte) (*types.Transaction, error) { + return _OptimismL2BridgeAdapter.Contract.SendERC20(&_OptimismL2BridgeAdapter.TransactOpts, localToken, arg1, recipient, amount, arg4) +} + +func (_OptimismL2BridgeAdapter *OptimismL2BridgeAdapterTransactor) Receive(opts *bind.TransactOpts) (*types.Transaction, error) { + return _OptimismL2BridgeAdapter.contract.RawTransact(opts, nil) +} + +func (_OptimismL2BridgeAdapter *OptimismL2BridgeAdapterSession) Receive() (*types.Transaction, error) { + return _OptimismL2BridgeAdapter.Contract.Receive(&_OptimismL2BridgeAdapter.TransactOpts) +} + +func (_OptimismL2BridgeAdapter *OptimismL2BridgeAdapterTransactorSession) Receive() (*types.Transaction, error) { + return _OptimismL2BridgeAdapter.Contract.Receive(&_OptimismL2BridgeAdapter.TransactOpts) +} + +func (_OptimismL2BridgeAdapter *OptimismL2BridgeAdapter) Address() common.Address { + return _OptimismL2BridgeAdapter.address +} + +type OptimismL2BridgeAdapterInterface interface { + FinalizeWithdrawERC20(opts *bind.CallOpts, arg0 common.Address, arg1 common.Address, arg2 []byte) (bool, error) + + GetBridgeFeeInNative(opts *bind.CallOpts) (*big.Int, error) + + GetL2Bridge(opts *bind.CallOpts) (common.Address, error) + + GetWrappedNative(opts *bind.CallOpts) (common.Address, error) + + SendERC20(opts *bind.TransactOpts, localToken common.Address, arg1 common.Address, recipient common.Address, amount *big.Int, arg4 []byte) (*types.Transaction, error) + + Receive(opts *bind.TransactOpts) (*types.Transaction, error) + + Address() common.Address +} diff --git a/core/gethwrappers/liquiditymanager/generated/optimism_l2_output_oracle/optimism_l2_output_oracle.go b/core/gethwrappers/liquiditymanager/generated/optimism_l2_output_oracle/optimism_l2_output_oracle.go new file mode 100644 index 00000000000..ddcd6e47ca9 --- /dev/null +++ b/core/gethwrappers/liquiditymanager/generated/optimism_l2_output_oracle/optimism_l2_output_oracle.go @@ -0,0 +1,213 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package optimism_l2_output_oracle + +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" +) + +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +type TypesOutputProposal struct { + OutputRoot [32]byte + Timestamp *big.Int + L2BlockNumber *big.Int +} + +var OptimismL2OutputOracleMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_l2OutputIndex\",\"type\":\"uint256\"}],\"name\":\"getL2Output\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"outputRoot\",\"type\":\"bytes32\"},{\"internalType\":\"uint128\",\"name\":\"timestamp\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"l2BlockNumber\",\"type\":\"uint128\"}],\"internalType\":\"structTypes.OutputProposal\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_l2BlockNumber\",\"type\":\"uint256\"}],\"name\":\"getL2OutputIndexAfter\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", +} + +var OptimismL2OutputOracleABI = OptimismL2OutputOracleMetaData.ABI + +type OptimismL2OutputOracle struct { + address common.Address + abi abi.ABI + OptimismL2OutputOracleCaller + OptimismL2OutputOracleTransactor + OptimismL2OutputOracleFilterer +} + +type OptimismL2OutputOracleCaller struct { + contract *bind.BoundContract +} + +type OptimismL2OutputOracleTransactor struct { + contract *bind.BoundContract +} + +type OptimismL2OutputOracleFilterer struct { + contract *bind.BoundContract +} + +type OptimismL2OutputOracleSession struct { + Contract *OptimismL2OutputOracle + CallOpts bind.CallOpts + TransactOpts bind.TransactOpts +} + +type OptimismL2OutputOracleCallerSession struct { + Contract *OptimismL2OutputOracleCaller + CallOpts bind.CallOpts +} + +type OptimismL2OutputOracleTransactorSession struct { + Contract *OptimismL2OutputOracleTransactor + TransactOpts bind.TransactOpts +} + +type OptimismL2OutputOracleRaw struct { + Contract *OptimismL2OutputOracle +} + +type OptimismL2OutputOracleCallerRaw struct { + Contract *OptimismL2OutputOracleCaller +} + +type OptimismL2OutputOracleTransactorRaw struct { + Contract *OptimismL2OutputOracleTransactor +} + +func NewOptimismL2OutputOracle(address common.Address, backend bind.ContractBackend) (*OptimismL2OutputOracle, error) { + abi, err := abi.JSON(strings.NewReader(OptimismL2OutputOracleABI)) + if err != nil { + return nil, err + } + contract, err := bindOptimismL2OutputOracle(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &OptimismL2OutputOracle{address: address, abi: abi, OptimismL2OutputOracleCaller: OptimismL2OutputOracleCaller{contract: contract}, OptimismL2OutputOracleTransactor: OptimismL2OutputOracleTransactor{contract: contract}, OptimismL2OutputOracleFilterer: OptimismL2OutputOracleFilterer{contract: contract}}, nil +} + +func NewOptimismL2OutputOracleCaller(address common.Address, caller bind.ContractCaller) (*OptimismL2OutputOracleCaller, error) { + contract, err := bindOptimismL2OutputOracle(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &OptimismL2OutputOracleCaller{contract: contract}, nil +} + +func NewOptimismL2OutputOracleTransactor(address common.Address, transactor bind.ContractTransactor) (*OptimismL2OutputOracleTransactor, error) { + contract, err := bindOptimismL2OutputOracle(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &OptimismL2OutputOracleTransactor{contract: contract}, nil +} + +func NewOptimismL2OutputOracleFilterer(address common.Address, filterer bind.ContractFilterer) (*OptimismL2OutputOracleFilterer, error) { + contract, err := bindOptimismL2OutputOracle(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &OptimismL2OutputOracleFilterer{contract: contract}, nil +} + +func bindOptimismL2OutputOracle(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := OptimismL2OutputOracleMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +func (_OptimismL2OutputOracle *OptimismL2OutputOracleRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _OptimismL2OutputOracle.Contract.OptimismL2OutputOracleCaller.contract.Call(opts, result, method, params...) +} + +func (_OptimismL2OutputOracle *OptimismL2OutputOracleRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _OptimismL2OutputOracle.Contract.OptimismL2OutputOracleTransactor.contract.Transfer(opts) +} + +func (_OptimismL2OutputOracle *OptimismL2OutputOracleRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _OptimismL2OutputOracle.Contract.OptimismL2OutputOracleTransactor.contract.Transact(opts, method, params...) +} + +func (_OptimismL2OutputOracle *OptimismL2OutputOracleCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _OptimismL2OutputOracle.Contract.contract.Call(opts, result, method, params...) +} + +func (_OptimismL2OutputOracle *OptimismL2OutputOracleTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _OptimismL2OutputOracle.Contract.contract.Transfer(opts) +} + +func (_OptimismL2OutputOracle *OptimismL2OutputOracleTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _OptimismL2OutputOracle.Contract.contract.Transact(opts, method, params...) +} + +func (_OptimismL2OutputOracle *OptimismL2OutputOracleCaller) GetL2Output(opts *bind.CallOpts, _l2OutputIndex *big.Int) (TypesOutputProposal, error) { + var out []interface{} + err := _OptimismL2OutputOracle.contract.Call(opts, &out, "getL2Output", _l2OutputIndex) + + if err != nil { + return *new(TypesOutputProposal), err + } + + out0 := *abi.ConvertType(out[0], new(TypesOutputProposal)).(*TypesOutputProposal) + + return out0, err + +} + +func (_OptimismL2OutputOracle *OptimismL2OutputOracleSession) GetL2Output(_l2OutputIndex *big.Int) (TypesOutputProposal, error) { + return _OptimismL2OutputOracle.Contract.GetL2Output(&_OptimismL2OutputOracle.CallOpts, _l2OutputIndex) +} + +func (_OptimismL2OutputOracle *OptimismL2OutputOracleCallerSession) GetL2Output(_l2OutputIndex *big.Int) (TypesOutputProposal, error) { + return _OptimismL2OutputOracle.Contract.GetL2Output(&_OptimismL2OutputOracle.CallOpts, _l2OutputIndex) +} + +func (_OptimismL2OutputOracle *OptimismL2OutputOracleCaller) GetL2OutputIndexAfter(opts *bind.CallOpts, _l2BlockNumber *big.Int) (*big.Int, error) { + var out []interface{} + err := _OptimismL2OutputOracle.contract.Call(opts, &out, "getL2OutputIndexAfter", _l2BlockNumber) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_OptimismL2OutputOracle *OptimismL2OutputOracleSession) GetL2OutputIndexAfter(_l2BlockNumber *big.Int) (*big.Int, error) { + return _OptimismL2OutputOracle.Contract.GetL2OutputIndexAfter(&_OptimismL2OutputOracle.CallOpts, _l2BlockNumber) +} + +func (_OptimismL2OutputOracle *OptimismL2OutputOracleCallerSession) GetL2OutputIndexAfter(_l2BlockNumber *big.Int) (*big.Int, error) { + return _OptimismL2OutputOracle.Contract.GetL2OutputIndexAfter(&_OptimismL2OutputOracle.CallOpts, _l2BlockNumber) +} + +func (_OptimismL2OutputOracle *OptimismL2OutputOracle) Address() common.Address { + return _OptimismL2OutputOracle.address +} + +type OptimismL2OutputOracleInterface interface { + GetL2Output(opts *bind.CallOpts, _l2OutputIndex *big.Int) (TypesOutputProposal, error) + + GetL2OutputIndexAfter(opts *bind.CallOpts, _l2BlockNumber *big.Int) (*big.Int, error) + + Address() common.Address +} diff --git a/core/gethwrappers/liquiditymanager/generated/optimism_l2_to_l1_message_passer/optimism_l2_to_l1_message_passer.go b/core/gethwrappers/liquiditymanager/generated/optimism_l2_to_l1_message_passer/optimism_l2_to_l1_message_passer.go new file mode 100644 index 00000000000..69ee5a2ba27 --- /dev/null +++ b/core/gethwrappers/liquiditymanager/generated/optimism_l2_to_l1_message_passer/optimism_l2_to_l1_message_passer.go @@ -0,0 +1,332 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package optimism_l2_to_l1_message_passer + +import ( + "errors" + "fmt" + "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" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" +) + +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +var OptimismL2ToL1MessagePasserMetaData = &bind.MetaData{ + ABI: "[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"gasLimit\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"withdrawalHash\",\"type\":\"bytes32\"}],\"name\":\"MessagePassed\",\"type\":\"event\"}]", +} + +var OptimismL2ToL1MessagePasserABI = OptimismL2ToL1MessagePasserMetaData.ABI + +type OptimismL2ToL1MessagePasser struct { + address common.Address + abi abi.ABI + OptimismL2ToL1MessagePasserCaller + OptimismL2ToL1MessagePasserTransactor + OptimismL2ToL1MessagePasserFilterer +} + +type OptimismL2ToL1MessagePasserCaller struct { + contract *bind.BoundContract +} + +type OptimismL2ToL1MessagePasserTransactor struct { + contract *bind.BoundContract +} + +type OptimismL2ToL1MessagePasserFilterer struct { + contract *bind.BoundContract +} + +type OptimismL2ToL1MessagePasserSession struct { + Contract *OptimismL2ToL1MessagePasser + CallOpts bind.CallOpts + TransactOpts bind.TransactOpts +} + +type OptimismL2ToL1MessagePasserCallerSession struct { + Contract *OptimismL2ToL1MessagePasserCaller + CallOpts bind.CallOpts +} + +type OptimismL2ToL1MessagePasserTransactorSession struct { + Contract *OptimismL2ToL1MessagePasserTransactor + TransactOpts bind.TransactOpts +} + +type OptimismL2ToL1MessagePasserRaw struct { + Contract *OptimismL2ToL1MessagePasser +} + +type OptimismL2ToL1MessagePasserCallerRaw struct { + Contract *OptimismL2ToL1MessagePasserCaller +} + +type OptimismL2ToL1MessagePasserTransactorRaw struct { + Contract *OptimismL2ToL1MessagePasserTransactor +} + +func NewOptimismL2ToL1MessagePasser(address common.Address, backend bind.ContractBackend) (*OptimismL2ToL1MessagePasser, error) { + abi, err := abi.JSON(strings.NewReader(OptimismL2ToL1MessagePasserABI)) + if err != nil { + return nil, err + } + contract, err := bindOptimismL2ToL1MessagePasser(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &OptimismL2ToL1MessagePasser{address: address, abi: abi, OptimismL2ToL1MessagePasserCaller: OptimismL2ToL1MessagePasserCaller{contract: contract}, OptimismL2ToL1MessagePasserTransactor: OptimismL2ToL1MessagePasserTransactor{contract: contract}, OptimismL2ToL1MessagePasserFilterer: OptimismL2ToL1MessagePasserFilterer{contract: contract}}, nil +} + +func NewOptimismL2ToL1MessagePasserCaller(address common.Address, caller bind.ContractCaller) (*OptimismL2ToL1MessagePasserCaller, error) { + contract, err := bindOptimismL2ToL1MessagePasser(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &OptimismL2ToL1MessagePasserCaller{contract: contract}, nil +} + +func NewOptimismL2ToL1MessagePasserTransactor(address common.Address, transactor bind.ContractTransactor) (*OptimismL2ToL1MessagePasserTransactor, error) { + contract, err := bindOptimismL2ToL1MessagePasser(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &OptimismL2ToL1MessagePasserTransactor{contract: contract}, nil +} + +func NewOptimismL2ToL1MessagePasserFilterer(address common.Address, filterer bind.ContractFilterer) (*OptimismL2ToL1MessagePasserFilterer, error) { + contract, err := bindOptimismL2ToL1MessagePasser(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &OptimismL2ToL1MessagePasserFilterer{contract: contract}, nil +} + +func bindOptimismL2ToL1MessagePasser(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := OptimismL2ToL1MessagePasserMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +func (_OptimismL2ToL1MessagePasser *OptimismL2ToL1MessagePasserRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _OptimismL2ToL1MessagePasser.Contract.OptimismL2ToL1MessagePasserCaller.contract.Call(opts, result, method, params...) +} + +func (_OptimismL2ToL1MessagePasser *OptimismL2ToL1MessagePasserRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _OptimismL2ToL1MessagePasser.Contract.OptimismL2ToL1MessagePasserTransactor.contract.Transfer(opts) +} + +func (_OptimismL2ToL1MessagePasser *OptimismL2ToL1MessagePasserRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _OptimismL2ToL1MessagePasser.Contract.OptimismL2ToL1MessagePasserTransactor.contract.Transact(opts, method, params...) +} + +func (_OptimismL2ToL1MessagePasser *OptimismL2ToL1MessagePasserCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _OptimismL2ToL1MessagePasser.Contract.contract.Call(opts, result, method, params...) +} + +func (_OptimismL2ToL1MessagePasser *OptimismL2ToL1MessagePasserTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _OptimismL2ToL1MessagePasser.Contract.contract.Transfer(opts) +} + +func (_OptimismL2ToL1MessagePasser *OptimismL2ToL1MessagePasserTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _OptimismL2ToL1MessagePasser.Contract.contract.Transact(opts, method, params...) +} + +type OptimismL2ToL1MessagePasserMessagePassedIterator struct { + Event *OptimismL2ToL1MessagePasserMessagePassed + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *OptimismL2ToL1MessagePasserMessagePassedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(OptimismL2ToL1MessagePasserMessagePassed) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(OptimismL2ToL1MessagePasserMessagePassed) + 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() + } +} + +func (it *OptimismL2ToL1MessagePasserMessagePassedIterator) Error() error { + return it.fail +} + +func (it *OptimismL2ToL1MessagePasserMessagePassedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type OptimismL2ToL1MessagePasserMessagePassed struct { + Nonce *big.Int + Sender common.Address + Target common.Address + Value *big.Int + GasLimit *big.Int + Data []byte + WithdrawalHash [32]byte + Raw types.Log +} + +func (_OptimismL2ToL1MessagePasser *OptimismL2ToL1MessagePasserFilterer) FilterMessagePassed(opts *bind.FilterOpts, nonce []*big.Int, sender []common.Address, target []common.Address) (*OptimismL2ToL1MessagePasserMessagePassedIterator, error) { + + var nonceRule []interface{} + for _, nonceItem := range nonce { + nonceRule = append(nonceRule, nonceItem) + } + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + var targetRule []interface{} + for _, targetItem := range target { + targetRule = append(targetRule, targetItem) + } + + logs, sub, err := _OptimismL2ToL1MessagePasser.contract.FilterLogs(opts, "MessagePassed", nonceRule, senderRule, targetRule) + if err != nil { + return nil, err + } + return &OptimismL2ToL1MessagePasserMessagePassedIterator{contract: _OptimismL2ToL1MessagePasser.contract, event: "MessagePassed", logs: logs, sub: sub}, nil +} + +func (_OptimismL2ToL1MessagePasser *OptimismL2ToL1MessagePasserFilterer) WatchMessagePassed(opts *bind.WatchOpts, sink chan<- *OptimismL2ToL1MessagePasserMessagePassed, nonce []*big.Int, sender []common.Address, target []common.Address) (event.Subscription, error) { + + var nonceRule []interface{} + for _, nonceItem := range nonce { + nonceRule = append(nonceRule, nonceItem) + } + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + var targetRule []interface{} + for _, targetItem := range target { + targetRule = append(targetRule, targetItem) + } + + logs, sub, err := _OptimismL2ToL1MessagePasser.contract.WatchLogs(opts, "MessagePassed", nonceRule, senderRule, targetRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(OptimismL2ToL1MessagePasserMessagePassed) + if err := _OptimismL2ToL1MessagePasser.contract.UnpackLog(event, "MessagePassed", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +func (_OptimismL2ToL1MessagePasser *OptimismL2ToL1MessagePasserFilterer) ParseMessagePassed(log types.Log) (*OptimismL2ToL1MessagePasserMessagePassed, error) { + event := new(OptimismL2ToL1MessagePasserMessagePassed) + if err := _OptimismL2ToL1MessagePasser.contract.UnpackLog(event, "MessagePassed", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +func (_OptimismL2ToL1MessagePasser *OptimismL2ToL1MessagePasser) ParseLog(log types.Log) (generated.AbigenLog, error) { + switch log.Topics[0] { + case _OptimismL2ToL1MessagePasser.abi.Events["MessagePassed"].ID: + return _OptimismL2ToL1MessagePasser.ParseMessagePassed(log) + + default: + return nil, fmt.Errorf("abigen wrapper received unknown log topic: %v", log.Topics[0]) + } +} + +func (OptimismL2ToL1MessagePasserMessagePassed) Topic() common.Hash { + return common.HexToHash("0x02a52367d10742d8032712c1bb8e0144ff1ec5ffda1ed7d70bb05a2744955054") +} + +func (_OptimismL2ToL1MessagePasser *OptimismL2ToL1MessagePasser) Address() common.Address { + return _OptimismL2ToL1MessagePasser.address +} + +type OptimismL2ToL1MessagePasserInterface interface { + FilterMessagePassed(opts *bind.FilterOpts, nonce []*big.Int, sender []common.Address, target []common.Address) (*OptimismL2ToL1MessagePasserMessagePassedIterator, error) + + WatchMessagePassed(opts *bind.WatchOpts, sink chan<- *OptimismL2ToL1MessagePasserMessagePassed, nonce []*big.Int, sender []common.Address, target []common.Address) (event.Subscription, error) + + ParseMessagePassed(log types.Log) (*OptimismL2ToL1MessagePasserMessagePassed, error) + + ParseLog(log types.Log) (generated.AbigenLog, error) + + Address() common.Address +} diff --git a/core/gethwrappers/liquiditymanager/generated/optimism_portal/optimism_portal.go b/core/gethwrappers/liquiditymanager/generated/optimism_portal/optimism_portal.go new file mode 100644 index 00000000000..e142d700fc1 --- /dev/null +++ b/core/gethwrappers/liquiditymanager/generated/optimism_portal/optimism_portal.go @@ -0,0 +1,227 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package optimism_portal + +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" +) + +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +type TypesOutputRootProof struct { + Version [32]byte + StateRoot [32]byte + MessagePasserStorageRoot [32]byte + LatestBlockhash [32]byte +} + +type TypesWithdrawalTransaction struct { + Nonce *big.Int + Sender common.Address + Target common.Address + Value *big.Int + GasLimit *big.Int + Data []byte +} + +var OptimismPortalMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"gasLimit\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"internalType\":\"structTypes.WithdrawalTransaction\",\"name\":\"_tx\",\"type\":\"tuple\"}],\"name\":\"finalizeWithdrawalTransaction\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"gasLimit\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"internalType\":\"structTypes.WithdrawalTransaction\",\"name\":\"_tx\",\"type\":\"tuple\"},{\"internalType\":\"uint256\",\"name\":\"_l2OutputIndex\",\"type\":\"uint256\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"version\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"stateRoot\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"messagePasserStorageRoot\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"latestBlockhash\",\"type\":\"bytes32\"}],\"internalType\":\"structTypes.OutputRootProof\",\"name\":\"_outputRootProof\",\"type\":\"tuple\"},{\"internalType\":\"bytes[]\",\"name\":\"_withdrawalProof\",\"type\":\"bytes[]\"}],\"name\":\"proveWithdrawalTransaction\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"version\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", +} + +var OptimismPortalABI = OptimismPortalMetaData.ABI + +type OptimismPortal struct { + address common.Address + abi abi.ABI + OptimismPortalCaller + OptimismPortalTransactor + OptimismPortalFilterer +} + +type OptimismPortalCaller struct { + contract *bind.BoundContract +} + +type OptimismPortalTransactor struct { + contract *bind.BoundContract +} + +type OptimismPortalFilterer struct { + contract *bind.BoundContract +} + +type OptimismPortalSession struct { + Contract *OptimismPortal + CallOpts bind.CallOpts + TransactOpts bind.TransactOpts +} + +type OptimismPortalCallerSession struct { + Contract *OptimismPortalCaller + CallOpts bind.CallOpts +} + +type OptimismPortalTransactorSession struct { + Contract *OptimismPortalTransactor + TransactOpts bind.TransactOpts +} + +type OptimismPortalRaw struct { + Contract *OptimismPortal +} + +type OptimismPortalCallerRaw struct { + Contract *OptimismPortalCaller +} + +type OptimismPortalTransactorRaw struct { + Contract *OptimismPortalTransactor +} + +func NewOptimismPortal(address common.Address, backend bind.ContractBackend) (*OptimismPortal, error) { + abi, err := abi.JSON(strings.NewReader(OptimismPortalABI)) + if err != nil { + return nil, err + } + contract, err := bindOptimismPortal(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &OptimismPortal{address: address, abi: abi, OptimismPortalCaller: OptimismPortalCaller{contract: contract}, OptimismPortalTransactor: OptimismPortalTransactor{contract: contract}, OptimismPortalFilterer: OptimismPortalFilterer{contract: contract}}, nil +} + +func NewOptimismPortalCaller(address common.Address, caller bind.ContractCaller) (*OptimismPortalCaller, error) { + contract, err := bindOptimismPortal(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &OptimismPortalCaller{contract: contract}, nil +} + +func NewOptimismPortalTransactor(address common.Address, transactor bind.ContractTransactor) (*OptimismPortalTransactor, error) { + contract, err := bindOptimismPortal(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &OptimismPortalTransactor{contract: contract}, nil +} + +func NewOptimismPortalFilterer(address common.Address, filterer bind.ContractFilterer) (*OptimismPortalFilterer, error) { + contract, err := bindOptimismPortal(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &OptimismPortalFilterer{contract: contract}, nil +} + +func bindOptimismPortal(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := OptimismPortalMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +func (_OptimismPortal *OptimismPortalRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _OptimismPortal.Contract.OptimismPortalCaller.contract.Call(opts, result, method, params...) +} + +func (_OptimismPortal *OptimismPortalRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _OptimismPortal.Contract.OptimismPortalTransactor.contract.Transfer(opts) +} + +func (_OptimismPortal *OptimismPortalRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _OptimismPortal.Contract.OptimismPortalTransactor.contract.Transact(opts, method, params...) +} + +func (_OptimismPortal *OptimismPortalCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _OptimismPortal.Contract.contract.Call(opts, result, method, params...) +} + +func (_OptimismPortal *OptimismPortalTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _OptimismPortal.Contract.contract.Transfer(opts) +} + +func (_OptimismPortal *OptimismPortalTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _OptimismPortal.Contract.contract.Transact(opts, method, params...) +} + +func (_OptimismPortal *OptimismPortalCaller) Version(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _OptimismPortal.contract.Call(opts, &out, "version") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +func (_OptimismPortal *OptimismPortalSession) Version() (string, error) { + return _OptimismPortal.Contract.Version(&_OptimismPortal.CallOpts) +} + +func (_OptimismPortal *OptimismPortalCallerSession) Version() (string, error) { + return _OptimismPortal.Contract.Version(&_OptimismPortal.CallOpts) +} + +func (_OptimismPortal *OptimismPortalTransactor) FinalizeWithdrawalTransaction(opts *bind.TransactOpts, _tx TypesWithdrawalTransaction) (*types.Transaction, error) { + return _OptimismPortal.contract.Transact(opts, "finalizeWithdrawalTransaction", _tx) +} + +func (_OptimismPortal *OptimismPortalSession) FinalizeWithdrawalTransaction(_tx TypesWithdrawalTransaction) (*types.Transaction, error) { + return _OptimismPortal.Contract.FinalizeWithdrawalTransaction(&_OptimismPortal.TransactOpts, _tx) +} + +func (_OptimismPortal *OptimismPortalTransactorSession) FinalizeWithdrawalTransaction(_tx TypesWithdrawalTransaction) (*types.Transaction, error) { + return _OptimismPortal.Contract.FinalizeWithdrawalTransaction(&_OptimismPortal.TransactOpts, _tx) +} + +func (_OptimismPortal *OptimismPortalTransactor) ProveWithdrawalTransaction(opts *bind.TransactOpts, _tx TypesWithdrawalTransaction, _l2OutputIndex *big.Int, _outputRootProof TypesOutputRootProof, _withdrawalProof [][]byte) (*types.Transaction, error) { + return _OptimismPortal.contract.Transact(opts, "proveWithdrawalTransaction", _tx, _l2OutputIndex, _outputRootProof, _withdrawalProof) +} + +func (_OptimismPortal *OptimismPortalSession) ProveWithdrawalTransaction(_tx TypesWithdrawalTransaction, _l2OutputIndex *big.Int, _outputRootProof TypesOutputRootProof, _withdrawalProof [][]byte) (*types.Transaction, error) { + return _OptimismPortal.Contract.ProveWithdrawalTransaction(&_OptimismPortal.TransactOpts, _tx, _l2OutputIndex, _outputRootProof, _withdrawalProof) +} + +func (_OptimismPortal *OptimismPortalTransactorSession) ProveWithdrawalTransaction(_tx TypesWithdrawalTransaction, _l2OutputIndex *big.Int, _outputRootProof TypesOutputRootProof, _withdrawalProof [][]byte) (*types.Transaction, error) { + return _OptimismPortal.Contract.ProveWithdrawalTransaction(&_OptimismPortal.TransactOpts, _tx, _l2OutputIndex, _outputRootProof, _withdrawalProof) +} + +func (_OptimismPortal *OptimismPortal) Address() common.Address { + return _OptimismPortal.address +} + +type OptimismPortalInterface interface { + Version(opts *bind.CallOpts) (string, error) + + FinalizeWithdrawalTransaction(opts *bind.TransactOpts, _tx TypesWithdrawalTransaction) (*types.Transaction, error) + + ProveWithdrawalTransaction(opts *bind.TransactOpts, _tx TypesWithdrawalTransaction, _l2OutputIndex *big.Int, _outputRootProof TypesOutputRootProof, _withdrawalProof [][]byte) (*types.Transaction, error) + + Address() common.Address +} diff --git a/core/gethwrappers/liquiditymanager/generated/optimism_portal_2/optimism_portal_2.go b/core/gethwrappers/liquiditymanager/generated/optimism_portal_2/optimism_portal_2.go new file mode 100644 index 00000000000..1759ca12514 --- /dev/null +++ b/core/gethwrappers/liquiditymanager/generated/optimism_portal_2/optimism_portal_2.go @@ -0,0 +1,207 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package optimism_portal_2 + +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" +) + +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +var OptimismPortal2MetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[],\"name\":\"disputeGameFactory\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"respectedGameType\",\"outputs\":[{\"internalType\":\"GameType\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", +} + +var OptimismPortal2ABI = OptimismPortal2MetaData.ABI + +type OptimismPortal2 struct { + address common.Address + abi abi.ABI + OptimismPortal2Caller + OptimismPortal2Transactor + OptimismPortal2Filterer +} + +type OptimismPortal2Caller struct { + contract *bind.BoundContract +} + +type OptimismPortal2Transactor struct { + contract *bind.BoundContract +} + +type OptimismPortal2Filterer struct { + contract *bind.BoundContract +} + +type OptimismPortal2Session struct { + Contract *OptimismPortal2 + CallOpts bind.CallOpts + TransactOpts bind.TransactOpts +} + +type OptimismPortal2CallerSession struct { + Contract *OptimismPortal2Caller + CallOpts bind.CallOpts +} + +type OptimismPortal2TransactorSession struct { + Contract *OptimismPortal2Transactor + TransactOpts bind.TransactOpts +} + +type OptimismPortal2Raw struct { + Contract *OptimismPortal2 +} + +type OptimismPortal2CallerRaw struct { + Contract *OptimismPortal2Caller +} + +type OptimismPortal2TransactorRaw struct { + Contract *OptimismPortal2Transactor +} + +func NewOptimismPortal2(address common.Address, backend bind.ContractBackend) (*OptimismPortal2, error) { + abi, err := abi.JSON(strings.NewReader(OptimismPortal2ABI)) + if err != nil { + return nil, err + } + contract, err := bindOptimismPortal2(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &OptimismPortal2{address: address, abi: abi, OptimismPortal2Caller: OptimismPortal2Caller{contract: contract}, OptimismPortal2Transactor: OptimismPortal2Transactor{contract: contract}, OptimismPortal2Filterer: OptimismPortal2Filterer{contract: contract}}, nil +} + +func NewOptimismPortal2Caller(address common.Address, caller bind.ContractCaller) (*OptimismPortal2Caller, error) { + contract, err := bindOptimismPortal2(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &OptimismPortal2Caller{contract: contract}, nil +} + +func NewOptimismPortal2Transactor(address common.Address, transactor bind.ContractTransactor) (*OptimismPortal2Transactor, error) { + contract, err := bindOptimismPortal2(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &OptimismPortal2Transactor{contract: contract}, nil +} + +func NewOptimismPortal2Filterer(address common.Address, filterer bind.ContractFilterer) (*OptimismPortal2Filterer, error) { + contract, err := bindOptimismPortal2(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &OptimismPortal2Filterer{contract: contract}, nil +} + +func bindOptimismPortal2(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := OptimismPortal2MetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +func (_OptimismPortal2 *OptimismPortal2Raw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _OptimismPortal2.Contract.OptimismPortal2Caller.contract.Call(opts, result, method, params...) +} + +func (_OptimismPortal2 *OptimismPortal2Raw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _OptimismPortal2.Contract.OptimismPortal2Transactor.contract.Transfer(opts) +} + +func (_OptimismPortal2 *OptimismPortal2Raw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _OptimismPortal2.Contract.OptimismPortal2Transactor.contract.Transact(opts, method, params...) +} + +func (_OptimismPortal2 *OptimismPortal2CallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _OptimismPortal2.Contract.contract.Call(opts, result, method, params...) +} + +func (_OptimismPortal2 *OptimismPortal2TransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _OptimismPortal2.Contract.contract.Transfer(opts) +} + +func (_OptimismPortal2 *OptimismPortal2TransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _OptimismPortal2.Contract.contract.Transact(opts, method, params...) +} + +func (_OptimismPortal2 *OptimismPortal2Caller) DisputeGameFactory(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _OptimismPortal2.contract.Call(opts, &out, "disputeGameFactory") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_OptimismPortal2 *OptimismPortal2Session) DisputeGameFactory() (common.Address, error) { + return _OptimismPortal2.Contract.DisputeGameFactory(&_OptimismPortal2.CallOpts) +} + +func (_OptimismPortal2 *OptimismPortal2CallerSession) DisputeGameFactory() (common.Address, error) { + return _OptimismPortal2.Contract.DisputeGameFactory(&_OptimismPortal2.CallOpts) +} + +func (_OptimismPortal2 *OptimismPortal2Caller) RespectedGameType(opts *bind.CallOpts) (uint32, error) { + var out []interface{} + err := _OptimismPortal2.contract.Call(opts, &out, "respectedGameType") + + if err != nil { + return *new(uint32), err + } + + out0 := *abi.ConvertType(out[0], new(uint32)).(*uint32) + + return out0, err + +} + +func (_OptimismPortal2 *OptimismPortal2Session) RespectedGameType() (uint32, error) { + return _OptimismPortal2.Contract.RespectedGameType(&_OptimismPortal2.CallOpts) +} + +func (_OptimismPortal2 *OptimismPortal2CallerSession) RespectedGameType() (uint32, error) { + return _OptimismPortal2.Contract.RespectedGameType(&_OptimismPortal2.CallOpts) +} + +func (_OptimismPortal2 *OptimismPortal2) Address() common.Address { + return _OptimismPortal2.address +} + +type OptimismPortal2Interface interface { + DisputeGameFactory(opts *bind.CallOpts) (common.Address, error) + + RespectedGameType(opts *bind.CallOpts) (uint32, error) + + Address() common.Address +} diff --git a/core/gethwrappers/liquiditymanager/generated/optimism_standard_bridge/optimism_standard_bridge.go b/core/gethwrappers/liquiditymanager/generated/optimism_standard_bridge/optimism_standard_bridge.go new file mode 100644 index 00000000000..b6a7d451439 --- /dev/null +++ b/core/gethwrappers/liquiditymanager/generated/optimism_standard_bridge/optimism_standard_bridge.go @@ -0,0 +1,345 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package optimism_standard_bridge + +import ( + "errors" + "fmt" + "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" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" +) + +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +var OptimismStandardBridgeMetaData = &bind.MetaData{ + ABI: "[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"localToken\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"remoteToken\",\"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\":\"extraData\",\"type\":\"bytes\"}],\"name\":\"ERC20BridgeFinalized\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_localToken\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_remoteToken\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_extraData\",\"type\":\"bytes\"}],\"name\":\"finalizeBridgeERC20\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", +} + +var OptimismStandardBridgeABI = OptimismStandardBridgeMetaData.ABI + +type OptimismStandardBridge struct { + address common.Address + abi abi.ABI + OptimismStandardBridgeCaller + OptimismStandardBridgeTransactor + OptimismStandardBridgeFilterer +} + +type OptimismStandardBridgeCaller struct { + contract *bind.BoundContract +} + +type OptimismStandardBridgeTransactor struct { + contract *bind.BoundContract +} + +type OptimismStandardBridgeFilterer struct { + contract *bind.BoundContract +} + +type OptimismStandardBridgeSession struct { + Contract *OptimismStandardBridge + CallOpts bind.CallOpts + TransactOpts bind.TransactOpts +} + +type OptimismStandardBridgeCallerSession struct { + Contract *OptimismStandardBridgeCaller + CallOpts bind.CallOpts +} + +type OptimismStandardBridgeTransactorSession struct { + Contract *OptimismStandardBridgeTransactor + TransactOpts bind.TransactOpts +} + +type OptimismStandardBridgeRaw struct { + Contract *OptimismStandardBridge +} + +type OptimismStandardBridgeCallerRaw struct { + Contract *OptimismStandardBridgeCaller +} + +type OptimismStandardBridgeTransactorRaw struct { + Contract *OptimismStandardBridgeTransactor +} + +func NewOptimismStandardBridge(address common.Address, backend bind.ContractBackend) (*OptimismStandardBridge, error) { + abi, err := abi.JSON(strings.NewReader(OptimismStandardBridgeABI)) + if err != nil { + return nil, err + } + contract, err := bindOptimismStandardBridge(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &OptimismStandardBridge{address: address, abi: abi, OptimismStandardBridgeCaller: OptimismStandardBridgeCaller{contract: contract}, OptimismStandardBridgeTransactor: OptimismStandardBridgeTransactor{contract: contract}, OptimismStandardBridgeFilterer: OptimismStandardBridgeFilterer{contract: contract}}, nil +} + +func NewOptimismStandardBridgeCaller(address common.Address, caller bind.ContractCaller) (*OptimismStandardBridgeCaller, error) { + contract, err := bindOptimismStandardBridge(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &OptimismStandardBridgeCaller{contract: contract}, nil +} + +func NewOptimismStandardBridgeTransactor(address common.Address, transactor bind.ContractTransactor) (*OptimismStandardBridgeTransactor, error) { + contract, err := bindOptimismStandardBridge(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &OptimismStandardBridgeTransactor{contract: contract}, nil +} + +func NewOptimismStandardBridgeFilterer(address common.Address, filterer bind.ContractFilterer) (*OptimismStandardBridgeFilterer, error) { + contract, err := bindOptimismStandardBridge(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &OptimismStandardBridgeFilterer{contract: contract}, nil +} + +func bindOptimismStandardBridge(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := OptimismStandardBridgeMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +func (_OptimismStandardBridge *OptimismStandardBridgeRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _OptimismStandardBridge.Contract.OptimismStandardBridgeCaller.contract.Call(opts, result, method, params...) +} + +func (_OptimismStandardBridge *OptimismStandardBridgeRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _OptimismStandardBridge.Contract.OptimismStandardBridgeTransactor.contract.Transfer(opts) +} + +func (_OptimismStandardBridge *OptimismStandardBridgeRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _OptimismStandardBridge.Contract.OptimismStandardBridgeTransactor.contract.Transact(opts, method, params...) +} + +func (_OptimismStandardBridge *OptimismStandardBridgeCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _OptimismStandardBridge.Contract.contract.Call(opts, result, method, params...) +} + +func (_OptimismStandardBridge *OptimismStandardBridgeTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _OptimismStandardBridge.Contract.contract.Transfer(opts) +} + +func (_OptimismStandardBridge *OptimismStandardBridgeTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _OptimismStandardBridge.Contract.contract.Transact(opts, method, params...) +} + +func (_OptimismStandardBridge *OptimismStandardBridgeTransactor) FinalizeBridgeERC20(opts *bind.TransactOpts, _localToken common.Address, _remoteToken common.Address, _from common.Address, _to common.Address, _amount *big.Int, _extraData []byte) (*types.Transaction, error) { + return _OptimismStandardBridge.contract.Transact(opts, "finalizeBridgeERC20", _localToken, _remoteToken, _from, _to, _amount, _extraData) +} + +func (_OptimismStandardBridge *OptimismStandardBridgeSession) FinalizeBridgeERC20(_localToken common.Address, _remoteToken common.Address, _from common.Address, _to common.Address, _amount *big.Int, _extraData []byte) (*types.Transaction, error) { + return _OptimismStandardBridge.Contract.FinalizeBridgeERC20(&_OptimismStandardBridge.TransactOpts, _localToken, _remoteToken, _from, _to, _amount, _extraData) +} + +func (_OptimismStandardBridge *OptimismStandardBridgeTransactorSession) FinalizeBridgeERC20(_localToken common.Address, _remoteToken common.Address, _from common.Address, _to common.Address, _amount *big.Int, _extraData []byte) (*types.Transaction, error) { + return _OptimismStandardBridge.Contract.FinalizeBridgeERC20(&_OptimismStandardBridge.TransactOpts, _localToken, _remoteToken, _from, _to, _amount, _extraData) +} + +type OptimismStandardBridgeERC20BridgeFinalizedIterator struct { + Event *OptimismStandardBridgeERC20BridgeFinalized + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *OptimismStandardBridgeERC20BridgeFinalizedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(OptimismStandardBridgeERC20BridgeFinalized) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(OptimismStandardBridgeERC20BridgeFinalized) + 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() + } +} + +func (it *OptimismStandardBridgeERC20BridgeFinalizedIterator) Error() error { + return it.fail +} + +func (it *OptimismStandardBridgeERC20BridgeFinalizedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type OptimismStandardBridgeERC20BridgeFinalized struct { + LocalToken common.Address + RemoteToken common.Address + From common.Address + To common.Address + Amount *big.Int + ExtraData []byte + Raw types.Log +} + +func (_OptimismStandardBridge *OptimismStandardBridgeFilterer) FilterERC20BridgeFinalized(opts *bind.FilterOpts, localToken []common.Address, remoteToken []common.Address, from []common.Address) (*OptimismStandardBridgeERC20BridgeFinalizedIterator, error) { + + var localTokenRule []interface{} + for _, localTokenItem := range localToken { + localTokenRule = append(localTokenRule, localTokenItem) + } + var remoteTokenRule []interface{} + for _, remoteTokenItem := range remoteToken { + remoteTokenRule = append(remoteTokenRule, remoteTokenItem) + } + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + + logs, sub, err := _OptimismStandardBridge.contract.FilterLogs(opts, "ERC20BridgeFinalized", localTokenRule, remoteTokenRule, fromRule) + if err != nil { + return nil, err + } + return &OptimismStandardBridgeERC20BridgeFinalizedIterator{contract: _OptimismStandardBridge.contract, event: "ERC20BridgeFinalized", logs: logs, sub: sub}, nil +} + +func (_OptimismStandardBridge *OptimismStandardBridgeFilterer) WatchERC20BridgeFinalized(opts *bind.WatchOpts, sink chan<- *OptimismStandardBridgeERC20BridgeFinalized, localToken []common.Address, remoteToken []common.Address, from []common.Address) (event.Subscription, error) { + + var localTokenRule []interface{} + for _, localTokenItem := range localToken { + localTokenRule = append(localTokenRule, localTokenItem) + } + var remoteTokenRule []interface{} + for _, remoteTokenItem := range remoteToken { + remoteTokenRule = append(remoteTokenRule, remoteTokenItem) + } + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + + logs, sub, err := _OptimismStandardBridge.contract.WatchLogs(opts, "ERC20BridgeFinalized", localTokenRule, remoteTokenRule, fromRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(OptimismStandardBridgeERC20BridgeFinalized) + if err := _OptimismStandardBridge.contract.UnpackLog(event, "ERC20BridgeFinalized", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +func (_OptimismStandardBridge *OptimismStandardBridgeFilterer) ParseERC20BridgeFinalized(log types.Log) (*OptimismStandardBridgeERC20BridgeFinalized, error) { + event := new(OptimismStandardBridgeERC20BridgeFinalized) + if err := _OptimismStandardBridge.contract.UnpackLog(event, "ERC20BridgeFinalized", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +func (_OptimismStandardBridge *OptimismStandardBridge) ParseLog(log types.Log) (generated.AbigenLog, error) { + switch log.Topics[0] { + case _OptimismStandardBridge.abi.Events["ERC20BridgeFinalized"].ID: + return _OptimismStandardBridge.ParseERC20BridgeFinalized(log) + + default: + return nil, fmt.Errorf("abigen wrapper received unknown log topic: %v", log.Topics[0]) + } +} + +func (OptimismStandardBridgeERC20BridgeFinalized) Topic() common.Hash { + return common.HexToHash("0xd59c65b35445225835c83f50b6ede06a7be047d22e357073e250d9af537518cd") +} + +func (_OptimismStandardBridge *OptimismStandardBridge) Address() common.Address { + return _OptimismStandardBridge.address +} + +type OptimismStandardBridgeInterface interface { + FinalizeBridgeERC20(opts *bind.TransactOpts, _localToken common.Address, _remoteToken common.Address, _from common.Address, _to common.Address, _amount *big.Int, _extraData []byte) (*types.Transaction, error) + + FilterERC20BridgeFinalized(opts *bind.FilterOpts, localToken []common.Address, remoteToken []common.Address, from []common.Address) (*OptimismStandardBridgeERC20BridgeFinalizedIterator, error) + + WatchERC20BridgeFinalized(opts *bind.WatchOpts, sink chan<- *OptimismStandardBridgeERC20BridgeFinalized, localToken []common.Address, remoteToken []common.Address, from []common.Address) (event.Subscription, error) + + ParseERC20BridgeFinalized(log types.Log) (*OptimismStandardBridgeERC20BridgeFinalized, error) + + ParseLog(log types.Log) (generated.AbigenLog, error) + + Address() common.Address +} diff --git a/core/gethwrappers/liquiditymanager/generated/report_encoder/report_encoder.go b/core/gethwrappers/liquiditymanager/generated/report_encoder/report_encoder.go new file mode 100644 index 00000000000..1e14ea185e3 --- /dev/null +++ b/core/gethwrappers/liquiditymanager/generated/report_encoder/report_encoder.go @@ -0,0 +1,256 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package report_encoder + +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" +) + +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +type ILiquidityManagerCrossChainRebalancerArgs struct { + RemoteRebalancer common.Address + LocalBridge common.Address + RemoteToken common.Address + RemoteChainSelector uint64 + Enabled bool +} + +type ILiquidityManagerLiquidityInstructions struct { + SendLiquidityParams []ILiquidityManagerSendLiquidityParams + ReceiveLiquidityParams []ILiquidityManagerReceiveLiquidityParams +} + +type ILiquidityManagerReceiveLiquidityParams struct { + Amount *big.Int + RemoteChainSelector uint64 + ShouldWrapNative bool + BridgeData []byte +} + +type ILiquidityManagerSendLiquidityParams struct { + Amount *big.Int + NativeBridgeFee *big.Int + RemoteChainSelector uint64 + BridgeData []byte +} + +var ReportEncoderMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"nativeBridgeFee\",\"type\":\"uint256\"},{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"bridgeData\",\"type\":\"bytes\"}],\"internalType\":\"structILiquidityManager.SendLiquidityParams[]\",\"name\":\"sendLiquidityParams\",\"type\":\"tuple[]\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"bool\",\"name\":\"shouldWrapNative\",\"type\":\"bool\"},{\"internalType\":\"bytes\",\"name\":\"bridgeData\",\"type\":\"bytes\"}],\"internalType\":\"structILiquidityManager.ReceiveLiquidityParams[]\",\"name\":\"receiveLiquidityParams\",\"type\":\"tuple[]\"}],\"internalType\":\"structILiquidityManager.LiquidityInstructions\",\"name\":\"instructions\",\"type\":\"tuple\"}],\"name\":\"exposeForEncoding\",\"outputs\":[],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAllCrossChainRebalancers\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"remoteRebalancer\",\"type\":\"address\"},{\"internalType\":\"contractIBridgeAdapter\",\"name\":\"localBridge\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"remoteToken\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"remoteChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"bool\",\"name\":\"enabled\",\"type\":\"bool\"}],\"internalType\":\"structILiquidityManager.CrossChainRebalancerArgs[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getLiquidity\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"currentLiquidity\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", +} + +var ReportEncoderABI = ReportEncoderMetaData.ABI + +type ReportEncoder struct { + address common.Address + abi abi.ABI + ReportEncoderCaller + ReportEncoderTransactor + ReportEncoderFilterer +} + +type ReportEncoderCaller struct { + contract *bind.BoundContract +} + +type ReportEncoderTransactor struct { + contract *bind.BoundContract +} + +type ReportEncoderFilterer struct { + contract *bind.BoundContract +} + +type ReportEncoderSession struct { + Contract *ReportEncoder + CallOpts bind.CallOpts + TransactOpts bind.TransactOpts +} + +type ReportEncoderCallerSession struct { + Contract *ReportEncoderCaller + CallOpts bind.CallOpts +} + +type ReportEncoderTransactorSession struct { + Contract *ReportEncoderTransactor + TransactOpts bind.TransactOpts +} + +type ReportEncoderRaw struct { + Contract *ReportEncoder +} + +type ReportEncoderCallerRaw struct { + Contract *ReportEncoderCaller +} + +type ReportEncoderTransactorRaw struct { + Contract *ReportEncoderTransactor +} + +func NewReportEncoder(address common.Address, backend bind.ContractBackend) (*ReportEncoder, error) { + abi, err := abi.JSON(strings.NewReader(ReportEncoderABI)) + if err != nil { + return nil, err + } + contract, err := bindReportEncoder(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &ReportEncoder{address: address, abi: abi, ReportEncoderCaller: ReportEncoderCaller{contract: contract}, ReportEncoderTransactor: ReportEncoderTransactor{contract: contract}, ReportEncoderFilterer: ReportEncoderFilterer{contract: contract}}, nil +} + +func NewReportEncoderCaller(address common.Address, caller bind.ContractCaller) (*ReportEncoderCaller, error) { + contract, err := bindReportEncoder(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &ReportEncoderCaller{contract: contract}, nil +} + +func NewReportEncoderTransactor(address common.Address, transactor bind.ContractTransactor) (*ReportEncoderTransactor, error) { + contract, err := bindReportEncoder(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &ReportEncoderTransactor{contract: contract}, nil +} + +func NewReportEncoderFilterer(address common.Address, filterer bind.ContractFilterer) (*ReportEncoderFilterer, error) { + contract, err := bindReportEncoder(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &ReportEncoderFilterer{contract: contract}, nil +} + +func bindReportEncoder(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := ReportEncoderMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +func (_ReportEncoder *ReportEncoderRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _ReportEncoder.Contract.ReportEncoderCaller.contract.Call(opts, result, method, params...) +} + +func (_ReportEncoder *ReportEncoderRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _ReportEncoder.Contract.ReportEncoderTransactor.contract.Transfer(opts) +} + +func (_ReportEncoder *ReportEncoderRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _ReportEncoder.Contract.ReportEncoderTransactor.contract.Transact(opts, method, params...) +} + +func (_ReportEncoder *ReportEncoderCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _ReportEncoder.Contract.contract.Call(opts, result, method, params...) +} + +func (_ReportEncoder *ReportEncoderTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _ReportEncoder.Contract.contract.Transfer(opts) +} + +func (_ReportEncoder *ReportEncoderTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _ReportEncoder.Contract.contract.Transact(opts, method, params...) +} + +func (_ReportEncoder *ReportEncoderCaller) ExposeForEncoding(opts *bind.CallOpts, instructions ILiquidityManagerLiquidityInstructions) error { + var out []interface{} + err := _ReportEncoder.contract.Call(opts, &out, "exposeForEncoding", instructions) + + if err != nil { + return err + } + + return err + +} + +func (_ReportEncoder *ReportEncoderSession) ExposeForEncoding(instructions ILiquidityManagerLiquidityInstructions) error { + return _ReportEncoder.Contract.ExposeForEncoding(&_ReportEncoder.CallOpts, instructions) +} + +func (_ReportEncoder *ReportEncoderCallerSession) ExposeForEncoding(instructions ILiquidityManagerLiquidityInstructions) error { + return _ReportEncoder.Contract.ExposeForEncoding(&_ReportEncoder.CallOpts, instructions) +} + +func (_ReportEncoder *ReportEncoderCaller) GetAllCrossChainRebalancers(opts *bind.CallOpts) ([]ILiquidityManagerCrossChainRebalancerArgs, error) { + var out []interface{} + err := _ReportEncoder.contract.Call(opts, &out, "getAllCrossChainRebalancers") + + if err != nil { + return *new([]ILiquidityManagerCrossChainRebalancerArgs), err + } + + out0 := *abi.ConvertType(out[0], new([]ILiquidityManagerCrossChainRebalancerArgs)).(*[]ILiquidityManagerCrossChainRebalancerArgs) + + return out0, err + +} + +func (_ReportEncoder *ReportEncoderSession) GetAllCrossChainRebalancers() ([]ILiquidityManagerCrossChainRebalancerArgs, error) { + return _ReportEncoder.Contract.GetAllCrossChainRebalancers(&_ReportEncoder.CallOpts) +} + +func (_ReportEncoder *ReportEncoderCallerSession) GetAllCrossChainRebalancers() ([]ILiquidityManagerCrossChainRebalancerArgs, error) { + return _ReportEncoder.Contract.GetAllCrossChainRebalancers(&_ReportEncoder.CallOpts) +} + +func (_ReportEncoder *ReportEncoderCaller) GetLiquidity(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _ReportEncoder.contract.Call(opts, &out, "getLiquidity") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_ReportEncoder *ReportEncoderSession) GetLiquidity() (*big.Int, error) { + return _ReportEncoder.Contract.GetLiquidity(&_ReportEncoder.CallOpts) +} + +func (_ReportEncoder *ReportEncoderCallerSession) GetLiquidity() (*big.Int, error) { + return _ReportEncoder.Contract.GetLiquidity(&_ReportEncoder.CallOpts) +} + +func (_ReportEncoder *ReportEncoder) Address() common.Address { + return _ReportEncoder.address +} + +type ReportEncoderInterface interface { + ExposeForEncoding(opts *bind.CallOpts, instructions ILiquidityManagerLiquidityInstructions) error + + GetAllCrossChainRebalancers(opts *bind.CallOpts) ([]ILiquidityManagerCrossChainRebalancerArgs, error) + + GetLiquidity(opts *bind.CallOpts) (*big.Int, error) + + Address() common.Address +} diff --git a/core/gethwrappers/liquiditymanager/generation/generated-wrapper-dependency-versions-do-not-edit.txt b/core/gethwrappers/liquiditymanager/generation/generated-wrapper-dependency-versions-do-not-edit.txt new file mode 100644 index 00000000000..a4fe8720abf --- /dev/null +++ b/core/gethwrappers/liquiditymanager/generation/generated-wrapper-dependency-versions-do-not-edit.txt @@ -0,0 +1,29 @@ +GETH_VERSION: 1.13.8 +abstract_arbitrum_token_gateway: ../../../contracts/solc/v0.8.24/IAbstractArbitrumTokenGateway/IAbstractArbitrumTokenGateway.abi ../../../contracts/solc/v0.8.24/IAbstractArbitrumTokenGateway/IAbstractArbitrumTokenGateway.bin 779e05d8fb797d4fcfa565174c071ad9f0161d103d6a322f6d0e1e42be568fa0 +arb_node_interface: ../../../contracts/solc/v0.8.24/INodeInterface/INodeInterface.abi ../../../contracts/solc/v0.8.24/INodeInterface/INodeInterface.bin c72f9e9d1e9b9c371c42817590a490a327e743775f423d9417982914d6136ff7 +arbitrum_gateway_router: ../../../contracts/solc/v0.8.24/IArbitrumGatewayRouter/IArbitrumGatewayRouter.abi ../../../contracts/solc/v0.8.24/IArbitrumGatewayRouter/IArbitrumGatewayRouter.bin d02c8ed0b4bfe50630e0fce452f9aef23d394bd28110314356954185a6544cb8 +arbitrum_inbox: ../../../contracts/solc/v0.8.24/IArbitrumInbox/IArbitrumInbox.abi ../../../contracts/solc/v0.8.24/IArbitrumInbox/IArbitrumInbox.bin 815c2ba12fadd3a6961330d746645dd1920a06253ce9555b46b4c8526065dbaf +arbitrum_l1_bridge_adapter: ../../../contracts/solc/v0.8.24/ArbitrumL1BridgeAdapter/ArbitrumL1BridgeAdapter.abi ../../../contracts/solc/v0.8.24/ArbitrumL1BridgeAdapter/ArbitrumL1BridgeAdapter.bin 1a3719911f8af8652fbf7653ca514a21e7e1acbac4c8bed56f353b8ce69c98d6 +arbitrum_l1_gateway_router: ../../../contracts/solc/v0.8.24/IArbitrumL1GatewayRouter/IArbitrumL1GatewayRouter.abi ../../../contracts/solc/v0.8.24/IArbitrumL1GatewayRouter/IArbitrumL1GatewayRouter.bin 48b098f0667521be7c4a31f2c361a2898536c5ab5406c18c2cedf8c8238909ad +arbitrum_l2_bridge_adapter: ../../../contracts/solc/v0.8.24/ArbitrumL2BridgeAdapter/ArbitrumL2BridgeAdapter.abi ../../../contracts/solc/v0.8.24/ArbitrumL2BridgeAdapter/ArbitrumL2BridgeAdapter.bin c22f2cf6a940dbedf96329a2041d8e396094c172665ace33727bcc0b4aaf9535 +arbitrum_rollup_core: ../../../contracts/solc/v0.8.24/IArbRollupCore/IArbRollupCore.abi ../../../contracts/solc/v0.8.24/IArbRollupCore/IArbRollupCore.bin 18ebdef208265cde0cde8671214840afdffaf57b5d82627d18604727b6210fa6 +arbitrum_token_gateway: ../../../contracts/solc/v0.8.24/IArbitrumTokenGateway/IArbitrumTokenGateway.abi ../../../contracts/solc/v0.8.24/IArbitrumTokenGateway/IArbitrumTokenGateway.bin c3d42c4f174317fe06f96435952ebe7ca8b042c787a61bf3f69060c00c396eae +arbsys: ../../../contracts/solc/v0.8.24/IArbSys/IArbSys.abi ../../../contracts/solc/v0.8.24/IArbSys/IArbSys.bin 70adb49f157d8e077485d1a5c87ddf64b214822aef736bb68e122a77bab78a16 +l2_arbitrum_gateway: ../../../contracts/solc/v0.8.24/IL2ArbitrumGateway/IL2ArbitrumGateway.abi ../../../contracts/solc/v0.8.24/IL2ArbitrumGateway/IL2ArbitrumGateway.bin 4d1af2bdb0aeb0b15e3cbc4ed2158f9bcba4925f68ed3669e0ecfde14115c893 +l2_arbitrum_messenger: ../../../contracts/solc/v0.8.24/IL2ArbitrumMessenger/IL2ArbitrumMessenger.abi ../../../contracts/solc/v0.8.24/IL2ArbitrumMessenger/IL2ArbitrumMessenger.bin 84d4bfedf16e92e3fb15880832fa54a3a21808dffea8a7c0946cde3b5e17a0c3 +liquiditymanager: ../../../contracts/solc/v0.8.24/LiquidityManager/LiquidityManager.abi ../../../contracts/solc/v0.8.24/LiquidityManager/LiquidityManager.bin 6e9aecb13ccf2e92e799e4a2a75c98d58949e34a04e30878f29765f3653993e4 +mock_l1_bridge_adapter: ../../../contracts/solc/v0.8.24/MockBridgeAdapter/MockL1BridgeAdapter.abi ../../../contracts/solc/v0.8.24/MockBridgeAdapter/MockL1BridgeAdapter.bin 538d2e3855031bcb4ef28ab8f0c54c8249e90936a588cde81b965d1dd2d08ad4 +mock_l2_bridge_adapter: ../../../contracts/solc/v0.8.24/MockBridgeAdapter/MockL2BridgeAdapter.abi ../../../contracts/solc/v0.8.24/MockBridgeAdapter/MockL2BridgeAdapter.bin 8ff182e2ac6aac98e1fe85c37d6d92a0b0570de695ed1292127ae25babe96bda +no_op_ocr3: ../../../contracts/solc/v0.8.24/NoOpOCR3/NoOpOCR3.abi ../../../contracts/solc/v0.8.24/NoOpOCR3/NoOpOCR3.bin 8797017885f77efaa7784d3adab29924c95231562baac947949269592c88a441 +optimism_cross_domain_messenger: ../../../contracts/solc/v0.8.24/IOptimismCrossDomainMessenger/IOptimismCrossDomainMessenger.abi ../../../contracts/solc/v0.8.24/IOptimismCrossDomainMessenger/IOptimismCrossDomainMessenger.bin e6d54a344ca1cf29e3b2d320bad4ab4b5aa6c197705d7a65586d4d215d751fca +optimism_dispute_game_factory: ../../../contracts/solc/v0.8.24/IOptimismDisputeGameFactory/IOptimismDisputeGameFactory.abi ../../../contracts/solc/v0.8.24/IOptimismDisputeGameFactory/IOptimismDisputeGameFactory.bin d4bcd96a87fdc6316b3788bd33eb8d96140002f7716b123a03ba4196a5aeeb72 +optimism_l1_bridge_adapter: ../../../contracts/solc/v0.8.24/OptimismL1BridgeAdapter/OptimismL1BridgeAdapter.abi ../../../contracts/solc/v0.8.24/OptimismL1BridgeAdapter/OptimismL1BridgeAdapter.bin f05678747b99fa7bc4255e7c11a44e5e49f51f749a97f5b41ac9badae0592ac1 +optimism_l1_bridge_adapter_encoder: ../../../contracts/solc/v0.8.24/OptimismL1BridgeAdapterEncoder/OptimismL1BridgeAdapterEncoder.abi ../../../contracts/solc/v0.8.24/OptimismL1BridgeAdapterEncoder/OptimismL1BridgeAdapterEncoder.bin 449f12408130b7d0a17aa1da14b5bbae7f22d90307422992ebf26c7fe93b85f2 +optimism_l1_standard_bridge: ../../../contracts/solc/v0.8.24/IOptimismL1StandardBridge/IOptimismL1StandardBridge.abi ../../../contracts/solc/v0.8.24/IOptimismL1StandardBridge/IOptimismL1StandardBridge.bin ba8676c979f072983617d55b51ea3bc482abe06356830da57816c28f5397eb2e +optimism_l2_bridge_adapter: ../../../contracts/solc/v0.8.24/OptimismL2BridgeAdapter/OptimismL2BridgeAdapter.abi ../../../contracts/solc/v0.8.24/OptimismL2BridgeAdapter/OptimismL2BridgeAdapter.bin ac707b967a62f8a70c8d1b1d02d28d1d8474f0511c279f709b68bbb3e08067bd +optimism_l2_output_oracle: ../../../contracts/solc/v0.8.24/IOptimismL2OutputOracle/IOptimismL2OutputOracle.abi ../../../contracts/solc/v0.8.24/IOptimismL2OutputOracle/IOptimismL2OutputOracle.bin c89386866c41c4b31fed4b8b945ba27aa8258ad472968da98a81448a8a95e43c +optimism_l2_to_l1_message_passer: ../../../contracts/solc/v0.8.24/IOptimismL2ToL1MessagePasser/IOptimismL2ToL1MessagePasser.abi ../../../contracts/solc/v0.8.24/IOptimismL2ToL1MessagePasser/IOptimismL2ToL1MessagePasser.bin 51f4568aa734c564a9aa82169f06e974e30650aeccbd07b20b0c8c60d48459fd +optimism_portal: ../../../contracts/solc/v0.8.24/IOptimismPortal/IOptimismPortal.abi ../../../contracts/solc/v0.8.24/IOptimismPortal/IOptimismPortal.bin a644f108c9267f16bcea1648c8935e0e3741484b9b9ba7e87e0c2cb02bd0839f +optimism_portal_2: ../../../contracts/solc/v0.8.24/IOptimismPortal2/IOptimismPortal2.abi ../../../contracts/solc/v0.8.24/IOptimismPortal2/IOptimismPortal2.bin a205fe314abb9056a23ee1ed609e182d012e3809d886c68c96c7b13da9513ab4 +optimism_standard_bridge: ../../../contracts/solc/v0.8.24/IOptimismStandardBridge/IOptimismStandardBridge.abi ../../../contracts/solc/v0.8.24/IOptimismStandardBridge/IOptimismStandardBridge.bin aaa354f8d9a45484aacb896eb148d315ac58587fad0e607adcd468723e653a94 +report_encoder: ../../../contracts/solc/v0.8.24/ReportEncoder/ReportEncoder.abi ../../../contracts/solc/v0.8.24/ReportEncoder/ReportEncoder.bin 43c10d4541b687ce08e754e07ccaa8ac6e5a4f2973d359ece4a56a02b68149d1 diff --git a/core/gethwrappers/liquiditymanager/go_generate.go b/core/gethwrappers/liquiditymanager/go_generate.go new file mode 100644 index 00000000000..93507793bbd --- /dev/null +++ b/core/gethwrappers/liquiditymanager/go_generate.go @@ -0,0 +1,37 @@ +// Package gethwrappers_ccip provides tools for wrapping solidity contracts with +// golang packages, using abigen. +package liquiditymanager + +// LiquidityManager contracts +//go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.24/LiquidityManager/LiquidityManager.abi ../../../contracts/solc/v0.8.24/LiquidityManager/LiquidityManager.bin LiquidityManager liquiditymanager +//go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.24/ArbitrumL1BridgeAdapter/ArbitrumL1BridgeAdapter.abi ../../../contracts/solc/v0.8.24/ArbitrumL1BridgeAdapter/ArbitrumL1BridgeAdapter.bin ArbitrumL1BridgeAdapter arbitrum_l1_bridge_adapter +//go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.24/ArbitrumL2BridgeAdapter/ArbitrumL2BridgeAdapter.abi ../../../contracts/solc/v0.8.24/ArbitrumL2BridgeAdapter/ArbitrumL2BridgeAdapter.bin ArbitrumL2BridgeAdapter arbitrum_l2_bridge_adapter +//go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.24/OptimismL1BridgeAdapter/OptimismL1BridgeAdapter.abi ../../../contracts/solc/v0.8.24/OptimismL1BridgeAdapter/OptimismL1BridgeAdapter.bin OptimismL1BridgeAdapter optimism_l1_bridge_adapter +//go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.24/OptimismL2BridgeAdapter/OptimismL2BridgeAdapter.abi ../../../contracts/solc/v0.8.24/OptimismL2BridgeAdapter/OptimismL2BridgeAdapter.bin OptimismL2BridgeAdapter optimism_l2_bridge_adapter +//go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.24/NoOpOCR3/NoOpOCR3.abi ../../../contracts/solc/v0.8.24/NoOpOCR3/NoOpOCR3.bin NoOpOCR3 no_op_ocr3 +//go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.24/MockBridgeAdapter/MockL2BridgeAdapter.abi ../../../contracts/solc/v0.8.24/MockBridgeAdapter/MockL2BridgeAdapter.bin MockL2BridgeAdapter mock_l2_bridge_adapter +//go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.24/MockBridgeAdapter/MockL1BridgeAdapter.abi ../../../contracts/solc/v0.8.24/MockBridgeAdapter/MockL1BridgeAdapter.bin MockL1BridgeAdapter mock_l1_bridge_adapter +//go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.24/ReportEncoder/ReportEncoder.abi ../../../contracts/solc/v0.8.24/ReportEncoder/ReportEncoder.bin ReportEncoder report_encoder +//go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.24/OptimismL1BridgeAdapterEncoder/OptimismL1BridgeAdapterEncoder.abi ../../../contracts/solc/v0.8.24/OptimismL1BridgeAdapterEncoder/OptimismL1BridgeAdapterEncoder.bin OptimismL1BridgeAdapterEncoder optimism_l1_bridge_adapter_encoder + +// Arbitrum helpers +//go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.24/IArbSys/IArbSys.abi ../../../contracts/solc/v0.8.24/IArbSys/IArbSys.bin ArbSys arbsys +//go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.24/INodeInterface/INodeInterface.abi ../../../contracts/solc/v0.8.24/INodeInterface/INodeInterface.bin NodeInterface arb_node_interface +//go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.24/IL2ArbitrumGateway/IL2ArbitrumGateway.abi ../../../contracts/solc/v0.8.24/IL2ArbitrumGateway/IL2ArbitrumGateway.bin L2ArbitrumGateway l2_arbitrum_gateway +//go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.24/IL2ArbitrumMessenger/IL2ArbitrumMessenger.abi ../../../contracts/solc/v0.8.24/IL2ArbitrumMessenger/IL2ArbitrumMessenger.bin L2ArbitrumMessenger l2_arbitrum_messenger +//go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.24/IArbRollupCore/IArbRollupCore.abi ../../../contracts/solc/v0.8.24/IArbRollupCore/IArbRollupCore.bin ArbRollupCore arbitrum_rollup_core +//go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.24/IArbitrumL1GatewayRouter/IArbitrumL1GatewayRouter.abi ../../../contracts/solc/v0.8.24/IArbitrumL1GatewayRouter/IArbitrumL1GatewayRouter.bin ArbitrumL1GatewayRouter arbitrum_l1_gateway_router +//go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.24/IArbitrumInbox/IArbitrumInbox.abi ../../../contracts/solc/v0.8.24/IArbitrumInbox/IArbitrumInbox.bin ArbitrumInbox arbitrum_inbox +//go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.24/IArbitrumGatewayRouter/IArbitrumGatewayRouter.abi ../../../contracts/solc/v0.8.24/IArbitrumGatewayRouter/IArbitrumGatewayRouter.bin ArbitrumGatewayRouter arbitrum_gateway_router +//go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.24/IArbitrumTokenGateway/IArbitrumTokenGateway.abi ../../../contracts/solc/v0.8.24/IArbitrumTokenGateway/IArbitrumTokenGateway.bin ArbitrumTokenGateway arbitrum_token_gateway +//go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.24/IAbstractArbitrumTokenGateway/IAbstractArbitrumTokenGateway.abi ../../../contracts/solc/v0.8.24/IAbstractArbitrumTokenGateway/IAbstractArbitrumTokenGateway.bin AbstractArbitrumTokenGateway abstract_arbitrum_token_gateway + +// Optimism helpers +//go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.24/IOptimismPortal/IOptimismPortal.abi ../../../contracts/solc/v0.8.24/IOptimismPortal/IOptimismPortal.bin OptimismPortal optimism_portal +//go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.24/IOptimismL2OutputOracle/IOptimismL2OutputOracle.abi ../../../contracts/solc/v0.8.24/IOptimismL2OutputOracle/IOptimismL2OutputOracle.bin OptimismL2OutputOracle optimism_l2_output_oracle +//go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.24/IOptimismL2ToL1MessagePasser/IOptimismL2ToL1MessagePasser.abi ../../../contracts/solc/v0.8.24/IOptimismL2ToL1MessagePasser/IOptimismL2ToL1MessagePasser.bin OptimismL2ToL1MessagePasser optimism_l2_to_l1_message_passer +//go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.24/IOptimismCrossDomainMessenger/IOptimismCrossDomainMessenger.abi ../../../contracts/solc/v0.8.24/IOptimismCrossDomainMessenger/IOptimismCrossDomainMessenger.bin OptimismCrossDomainMessenger optimism_cross_domain_messenger +//go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.24/IOptimismPortal2/IOptimismPortal2.abi ../../../contracts/solc/v0.8.24/IOptimismPortal2/IOptimismPortal2.bin OptimismPortal2 optimism_portal_2 +//go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.24/IOptimismDisputeGameFactory/IOptimismDisputeGameFactory.abi ../../../contracts/solc/v0.8.24/IOptimismDisputeGameFactory/IOptimismDisputeGameFactory.bin OptimismDisputeGameFactory optimism_dispute_game_factory +//go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.24/IOptimismStandardBridge/IOptimismStandardBridge.abi ../../../contracts/solc/v0.8.24/IOptimismStandardBridge/IOptimismStandardBridge.bin OptimismStandardBridge optimism_standard_bridge +//go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.24/IOptimismL1StandardBridge/IOptimismL1StandardBridge.abi ../../../contracts/solc/v0.8.24/IOptimismL1StandardBridge/IOptimismL1StandardBridge.bin OptimismL1StandardBridge optimism_l1_standard_bridge diff --git a/core/gethwrappers/liquiditymanager/mocks/mock_arbitrum_gateway_router/arbitrum_gateway_router_interface.go b/core/gethwrappers/liquiditymanager/mocks/mock_arbitrum_gateway_router/arbitrum_gateway_router_interface.go new file mode 100644 index 00000000000..7503e5357e3 --- /dev/null +++ b/core/gethwrappers/liquiditymanager/mocks/mock_arbitrum_gateway_router/arbitrum_gateway_router_interface.go @@ -0,0 +1,1054 @@ +// Code generated by mockery v2.43.2. DO NOT EDIT. + +package mock_arbitrum_gateway_router + +import ( + big "math/big" + + arbitrum_gateway_router "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/liquiditymanager/generated/arbitrum_gateway_router" + + bind "github.com/ethereum/go-ethereum/accounts/abi/bind" + + common "github.com/ethereum/go-ethereum/common" + + event "github.com/ethereum/go-ethereum/event" + + generated "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" + + mock "github.com/stretchr/testify/mock" + + types "github.com/ethereum/go-ethereum/core/types" +) + +// ArbitrumGatewayRouterInterface is an autogenerated mock type for the ArbitrumGatewayRouterInterface type +type ArbitrumGatewayRouterInterface struct { + mock.Mock +} + +type ArbitrumGatewayRouterInterface_Expecter struct { + mock *mock.Mock +} + +func (_m *ArbitrumGatewayRouterInterface) EXPECT() *ArbitrumGatewayRouterInterface_Expecter { + return &ArbitrumGatewayRouterInterface_Expecter{mock: &_m.Mock} +} + +// Address provides a mock function with given fields: +func (_m *ArbitrumGatewayRouterInterface) Address() common.Address { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Address") + } + + var r0 common.Address + if rf, ok := ret.Get(0).(func() common.Address); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Address) + } + } + + return r0 +} + +// ArbitrumGatewayRouterInterface_Address_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Address' +type ArbitrumGatewayRouterInterface_Address_Call struct { + *mock.Call +} + +// Address is a helper method to define mock.On call +func (_e *ArbitrumGatewayRouterInterface_Expecter) Address() *ArbitrumGatewayRouterInterface_Address_Call { + return &ArbitrumGatewayRouterInterface_Address_Call{Call: _e.mock.On("Address")} +} + +func (_c *ArbitrumGatewayRouterInterface_Address_Call) Run(run func()) *ArbitrumGatewayRouterInterface_Address_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ArbitrumGatewayRouterInterface_Address_Call) Return(_a0 common.Address) *ArbitrumGatewayRouterInterface_Address_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ArbitrumGatewayRouterInterface_Address_Call) RunAndReturn(run func() common.Address) *ArbitrumGatewayRouterInterface_Address_Call { + _c.Call.Return(run) + return _c +} + +// CalculateL2TokenAddress provides a mock function with given fields: opts, l1ERC20 +func (_m *ArbitrumGatewayRouterInterface) CalculateL2TokenAddress(opts *bind.CallOpts, l1ERC20 common.Address) (common.Address, error) { + ret := _m.Called(opts, l1ERC20) + + if len(ret) == 0 { + panic("no return value specified for CalculateL2TokenAddress") + } + + var r0 common.Address + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts, common.Address) (common.Address, error)); ok { + return rf(opts, l1ERC20) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts, common.Address) common.Address); ok { + r0 = rf(opts, l1ERC20) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Address) + } + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts, common.Address) error); ok { + r1 = rf(opts, l1ERC20) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbitrumGatewayRouterInterface_CalculateL2TokenAddress_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CalculateL2TokenAddress' +type ArbitrumGatewayRouterInterface_CalculateL2TokenAddress_Call struct { + *mock.Call +} + +// CalculateL2TokenAddress is a helper method to define mock.On call +// - opts *bind.CallOpts +// - l1ERC20 common.Address +func (_e *ArbitrumGatewayRouterInterface_Expecter) CalculateL2TokenAddress(opts interface{}, l1ERC20 interface{}) *ArbitrumGatewayRouterInterface_CalculateL2TokenAddress_Call { + return &ArbitrumGatewayRouterInterface_CalculateL2TokenAddress_Call{Call: _e.mock.On("CalculateL2TokenAddress", opts, l1ERC20)} +} + +func (_c *ArbitrumGatewayRouterInterface_CalculateL2TokenAddress_Call) Run(run func(opts *bind.CallOpts, l1ERC20 common.Address)) *ArbitrumGatewayRouterInterface_CalculateL2TokenAddress_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts), args[1].(common.Address)) + }) + return _c +} + +func (_c *ArbitrumGatewayRouterInterface_CalculateL2TokenAddress_Call) Return(_a0 common.Address, _a1 error) *ArbitrumGatewayRouterInterface_CalculateL2TokenAddress_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbitrumGatewayRouterInterface_CalculateL2TokenAddress_Call) RunAndReturn(run func(*bind.CallOpts, common.Address) (common.Address, error)) *ArbitrumGatewayRouterInterface_CalculateL2TokenAddress_Call { + _c.Call.Return(run) + return _c +} + +// DefaultGateway provides a mock function with given fields: opts +func (_m *ArbitrumGatewayRouterInterface) DefaultGateway(opts *bind.CallOpts) (common.Address, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for DefaultGateway") + } + + var r0 common.Address + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts) (common.Address, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts) common.Address); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Address) + } + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbitrumGatewayRouterInterface_DefaultGateway_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DefaultGateway' +type ArbitrumGatewayRouterInterface_DefaultGateway_Call struct { + *mock.Call +} + +// DefaultGateway is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *ArbitrumGatewayRouterInterface_Expecter) DefaultGateway(opts interface{}) *ArbitrumGatewayRouterInterface_DefaultGateway_Call { + return &ArbitrumGatewayRouterInterface_DefaultGateway_Call{Call: _e.mock.On("DefaultGateway", opts)} +} + +func (_c *ArbitrumGatewayRouterInterface_DefaultGateway_Call) Run(run func(opts *bind.CallOpts)) *ArbitrumGatewayRouterInterface_DefaultGateway_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *ArbitrumGatewayRouterInterface_DefaultGateway_Call) Return(_a0 common.Address, _a1 error) *ArbitrumGatewayRouterInterface_DefaultGateway_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbitrumGatewayRouterInterface_DefaultGateway_Call) RunAndReturn(run func(*bind.CallOpts) (common.Address, error)) *ArbitrumGatewayRouterInterface_DefaultGateway_Call { + _c.Call.Return(run) + return _c +} + +// FilterDefaultGatewayUpdated provides a mock function with given fields: opts +func (_m *ArbitrumGatewayRouterInterface) FilterDefaultGatewayUpdated(opts *bind.FilterOpts) (*arbitrum_gateway_router.ArbitrumGatewayRouterDefaultGatewayUpdatedIterator, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for FilterDefaultGatewayUpdated") + } + + var r0 *arbitrum_gateway_router.ArbitrumGatewayRouterDefaultGatewayUpdatedIterator + var r1 error + if rf, ok := ret.Get(0).(func(*bind.FilterOpts) (*arbitrum_gateway_router.ArbitrumGatewayRouterDefaultGatewayUpdatedIterator, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.FilterOpts) *arbitrum_gateway_router.ArbitrumGatewayRouterDefaultGatewayUpdatedIterator); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*arbitrum_gateway_router.ArbitrumGatewayRouterDefaultGatewayUpdatedIterator) + } + } + + if rf, ok := ret.Get(1).(func(*bind.FilterOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbitrumGatewayRouterInterface_FilterDefaultGatewayUpdated_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterDefaultGatewayUpdated' +type ArbitrumGatewayRouterInterface_FilterDefaultGatewayUpdated_Call struct { + *mock.Call +} + +// FilterDefaultGatewayUpdated is a helper method to define mock.On call +// - opts *bind.FilterOpts +func (_e *ArbitrumGatewayRouterInterface_Expecter) FilterDefaultGatewayUpdated(opts interface{}) *ArbitrumGatewayRouterInterface_FilterDefaultGatewayUpdated_Call { + return &ArbitrumGatewayRouterInterface_FilterDefaultGatewayUpdated_Call{Call: _e.mock.On("FilterDefaultGatewayUpdated", opts)} +} + +func (_c *ArbitrumGatewayRouterInterface_FilterDefaultGatewayUpdated_Call) Run(run func(opts *bind.FilterOpts)) *ArbitrumGatewayRouterInterface_FilterDefaultGatewayUpdated_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts)) + }) + return _c +} + +func (_c *ArbitrumGatewayRouterInterface_FilterDefaultGatewayUpdated_Call) Return(_a0 *arbitrum_gateway_router.ArbitrumGatewayRouterDefaultGatewayUpdatedIterator, _a1 error) *ArbitrumGatewayRouterInterface_FilterDefaultGatewayUpdated_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbitrumGatewayRouterInterface_FilterDefaultGatewayUpdated_Call) RunAndReturn(run func(*bind.FilterOpts) (*arbitrum_gateway_router.ArbitrumGatewayRouterDefaultGatewayUpdatedIterator, error)) *ArbitrumGatewayRouterInterface_FilterDefaultGatewayUpdated_Call { + _c.Call.Return(run) + return _c +} + +// FilterGatewaySet provides a mock function with given fields: opts, l1Token, gateway +func (_m *ArbitrumGatewayRouterInterface) FilterGatewaySet(opts *bind.FilterOpts, l1Token []common.Address, gateway []common.Address) (*arbitrum_gateway_router.ArbitrumGatewayRouterGatewaySetIterator, error) { + ret := _m.Called(opts, l1Token, gateway) + + if len(ret) == 0 { + panic("no return value specified for FilterGatewaySet") + } + + var r0 *arbitrum_gateway_router.ArbitrumGatewayRouterGatewaySetIterator + var r1 error + if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []common.Address, []common.Address) (*arbitrum_gateway_router.ArbitrumGatewayRouterGatewaySetIterator, error)); ok { + return rf(opts, l1Token, gateway) + } + if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []common.Address, []common.Address) *arbitrum_gateway_router.ArbitrumGatewayRouterGatewaySetIterator); ok { + r0 = rf(opts, l1Token, gateway) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*arbitrum_gateway_router.ArbitrumGatewayRouterGatewaySetIterator) + } + } + + if rf, ok := ret.Get(1).(func(*bind.FilterOpts, []common.Address, []common.Address) error); ok { + r1 = rf(opts, l1Token, gateway) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbitrumGatewayRouterInterface_FilterGatewaySet_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterGatewaySet' +type ArbitrumGatewayRouterInterface_FilterGatewaySet_Call struct { + *mock.Call +} + +// FilterGatewaySet is a helper method to define mock.On call +// - opts *bind.FilterOpts +// - l1Token []common.Address +// - gateway []common.Address +func (_e *ArbitrumGatewayRouterInterface_Expecter) FilterGatewaySet(opts interface{}, l1Token interface{}, gateway interface{}) *ArbitrumGatewayRouterInterface_FilterGatewaySet_Call { + return &ArbitrumGatewayRouterInterface_FilterGatewaySet_Call{Call: _e.mock.On("FilterGatewaySet", opts, l1Token, gateway)} +} + +func (_c *ArbitrumGatewayRouterInterface_FilterGatewaySet_Call) Run(run func(opts *bind.FilterOpts, l1Token []common.Address, gateway []common.Address)) *ArbitrumGatewayRouterInterface_FilterGatewaySet_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts), args[1].([]common.Address), args[2].([]common.Address)) + }) + return _c +} + +func (_c *ArbitrumGatewayRouterInterface_FilterGatewaySet_Call) Return(_a0 *arbitrum_gateway_router.ArbitrumGatewayRouterGatewaySetIterator, _a1 error) *ArbitrumGatewayRouterInterface_FilterGatewaySet_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbitrumGatewayRouterInterface_FilterGatewaySet_Call) RunAndReturn(run func(*bind.FilterOpts, []common.Address, []common.Address) (*arbitrum_gateway_router.ArbitrumGatewayRouterGatewaySetIterator, error)) *ArbitrumGatewayRouterInterface_FilterGatewaySet_Call { + _c.Call.Return(run) + return _c +} + +// FilterTransferRouted provides a mock function with given fields: opts, token, _userFrom, _userTo +func (_m *ArbitrumGatewayRouterInterface) FilterTransferRouted(opts *bind.FilterOpts, token []common.Address, _userFrom []common.Address, _userTo []common.Address) (*arbitrum_gateway_router.ArbitrumGatewayRouterTransferRoutedIterator, error) { + ret := _m.Called(opts, token, _userFrom, _userTo) + + if len(ret) == 0 { + panic("no return value specified for FilterTransferRouted") + } + + var r0 *arbitrum_gateway_router.ArbitrumGatewayRouterTransferRoutedIterator + var r1 error + if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []common.Address, []common.Address, []common.Address) (*arbitrum_gateway_router.ArbitrumGatewayRouterTransferRoutedIterator, error)); ok { + return rf(opts, token, _userFrom, _userTo) + } + if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []common.Address, []common.Address, []common.Address) *arbitrum_gateway_router.ArbitrumGatewayRouterTransferRoutedIterator); ok { + r0 = rf(opts, token, _userFrom, _userTo) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*arbitrum_gateway_router.ArbitrumGatewayRouterTransferRoutedIterator) + } + } + + if rf, ok := ret.Get(1).(func(*bind.FilterOpts, []common.Address, []common.Address, []common.Address) error); ok { + r1 = rf(opts, token, _userFrom, _userTo) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbitrumGatewayRouterInterface_FilterTransferRouted_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterTransferRouted' +type ArbitrumGatewayRouterInterface_FilterTransferRouted_Call struct { + *mock.Call +} + +// FilterTransferRouted is a helper method to define mock.On call +// - opts *bind.FilterOpts +// - token []common.Address +// - _userFrom []common.Address +// - _userTo []common.Address +func (_e *ArbitrumGatewayRouterInterface_Expecter) FilterTransferRouted(opts interface{}, token interface{}, _userFrom interface{}, _userTo interface{}) *ArbitrumGatewayRouterInterface_FilterTransferRouted_Call { + return &ArbitrumGatewayRouterInterface_FilterTransferRouted_Call{Call: _e.mock.On("FilterTransferRouted", opts, token, _userFrom, _userTo)} +} + +func (_c *ArbitrumGatewayRouterInterface_FilterTransferRouted_Call) Run(run func(opts *bind.FilterOpts, token []common.Address, _userFrom []common.Address, _userTo []common.Address)) *ArbitrumGatewayRouterInterface_FilterTransferRouted_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts), args[1].([]common.Address), args[2].([]common.Address), args[3].([]common.Address)) + }) + return _c +} + +func (_c *ArbitrumGatewayRouterInterface_FilterTransferRouted_Call) Return(_a0 *arbitrum_gateway_router.ArbitrumGatewayRouterTransferRoutedIterator, _a1 error) *ArbitrumGatewayRouterInterface_FilterTransferRouted_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbitrumGatewayRouterInterface_FilterTransferRouted_Call) RunAndReturn(run func(*bind.FilterOpts, []common.Address, []common.Address, []common.Address) (*arbitrum_gateway_router.ArbitrumGatewayRouterTransferRoutedIterator, error)) *ArbitrumGatewayRouterInterface_FilterTransferRouted_Call { + _c.Call.Return(run) + return _c +} + +// FinalizeInboundTransfer provides a mock function with given fields: opts, _token, _from, _to, _amount, _data +func (_m *ArbitrumGatewayRouterInterface) FinalizeInboundTransfer(opts *bind.TransactOpts, _token common.Address, _from common.Address, _to common.Address, _amount *big.Int, _data []byte) (*types.Transaction, error) { + ret := _m.Called(opts, _token, _from, _to, _amount, _data) + + if len(ret) == 0 { + panic("no return value specified for FinalizeInboundTransfer") + } + + var r0 *types.Transaction + var r1 error + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, common.Address, common.Address, common.Address, *big.Int, []byte) (*types.Transaction, error)); ok { + return rf(opts, _token, _from, _to, _amount, _data) + } + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, common.Address, common.Address, common.Address, *big.Int, []byte) *types.Transaction); ok { + r0 = rf(opts, _token, _from, _to, _amount, _data) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Transaction) + } + } + + if rf, ok := ret.Get(1).(func(*bind.TransactOpts, common.Address, common.Address, common.Address, *big.Int, []byte) error); ok { + r1 = rf(opts, _token, _from, _to, _amount, _data) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbitrumGatewayRouterInterface_FinalizeInboundTransfer_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FinalizeInboundTransfer' +type ArbitrumGatewayRouterInterface_FinalizeInboundTransfer_Call struct { + *mock.Call +} + +// FinalizeInboundTransfer is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - _token common.Address +// - _from common.Address +// - _to common.Address +// - _amount *big.Int +// - _data []byte +func (_e *ArbitrumGatewayRouterInterface_Expecter) FinalizeInboundTransfer(opts interface{}, _token interface{}, _from interface{}, _to interface{}, _amount interface{}, _data interface{}) *ArbitrumGatewayRouterInterface_FinalizeInboundTransfer_Call { + return &ArbitrumGatewayRouterInterface_FinalizeInboundTransfer_Call{Call: _e.mock.On("FinalizeInboundTransfer", opts, _token, _from, _to, _amount, _data)} +} + +func (_c *ArbitrumGatewayRouterInterface_FinalizeInboundTransfer_Call) Run(run func(opts *bind.TransactOpts, _token common.Address, _from common.Address, _to common.Address, _amount *big.Int, _data []byte)) *ArbitrumGatewayRouterInterface_FinalizeInboundTransfer_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].(common.Address), args[2].(common.Address), args[3].(common.Address), args[4].(*big.Int), args[5].([]byte)) + }) + return _c +} + +func (_c *ArbitrumGatewayRouterInterface_FinalizeInboundTransfer_Call) Return(_a0 *types.Transaction, _a1 error) *ArbitrumGatewayRouterInterface_FinalizeInboundTransfer_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbitrumGatewayRouterInterface_FinalizeInboundTransfer_Call) RunAndReturn(run func(*bind.TransactOpts, common.Address, common.Address, common.Address, *big.Int, []byte) (*types.Transaction, error)) *ArbitrumGatewayRouterInterface_FinalizeInboundTransfer_Call { + _c.Call.Return(run) + return _c +} + +// GetGateway provides a mock function with given fields: opts, _token +func (_m *ArbitrumGatewayRouterInterface) GetGateway(opts *bind.CallOpts, _token common.Address) (common.Address, error) { + ret := _m.Called(opts, _token) + + if len(ret) == 0 { + panic("no return value specified for GetGateway") + } + + var r0 common.Address + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts, common.Address) (common.Address, error)); ok { + return rf(opts, _token) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts, common.Address) common.Address); ok { + r0 = rf(opts, _token) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Address) + } + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts, common.Address) error); ok { + r1 = rf(opts, _token) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbitrumGatewayRouterInterface_GetGateway_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetGateway' +type ArbitrumGatewayRouterInterface_GetGateway_Call struct { + *mock.Call +} + +// GetGateway is a helper method to define mock.On call +// - opts *bind.CallOpts +// - _token common.Address +func (_e *ArbitrumGatewayRouterInterface_Expecter) GetGateway(opts interface{}, _token interface{}) *ArbitrumGatewayRouterInterface_GetGateway_Call { + return &ArbitrumGatewayRouterInterface_GetGateway_Call{Call: _e.mock.On("GetGateway", opts, _token)} +} + +func (_c *ArbitrumGatewayRouterInterface_GetGateway_Call) Run(run func(opts *bind.CallOpts, _token common.Address)) *ArbitrumGatewayRouterInterface_GetGateway_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts), args[1].(common.Address)) + }) + return _c +} + +func (_c *ArbitrumGatewayRouterInterface_GetGateway_Call) Return(_a0 common.Address, _a1 error) *ArbitrumGatewayRouterInterface_GetGateway_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbitrumGatewayRouterInterface_GetGateway_Call) RunAndReturn(run func(*bind.CallOpts, common.Address) (common.Address, error)) *ArbitrumGatewayRouterInterface_GetGateway_Call { + _c.Call.Return(run) + return _c +} + +// GetOutboundCalldata provides a mock function with given fields: opts, _token, _from, _to, _amount, _data +func (_m *ArbitrumGatewayRouterInterface) GetOutboundCalldata(opts *bind.CallOpts, _token common.Address, _from common.Address, _to common.Address, _amount *big.Int, _data []byte) ([]byte, error) { + ret := _m.Called(opts, _token, _from, _to, _amount, _data) + + if len(ret) == 0 { + panic("no return value specified for GetOutboundCalldata") + } + + var r0 []byte + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts, common.Address, common.Address, common.Address, *big.Int, []byte) ([]byte, error)); ok { + return rf(opts, _token, _from, _to, _amount, _data) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts, common.Address, common.Address, common.Address, *big.Int, []byte) []byte); ok { + r0 = rf(opts, _token, _from, _to, _amount, _data) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]byte) + } + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts, common.Address, common.Address, common.Address, *big.Int, []byte) error); ok { + r1 = rf(opts, _token, _from, _to, _amount, _data) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbitrumGatewayRouterInterface_GetOutboundCalldata_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetOutboundCalldata' +type ArbitrumGatewayRouterInterface_GetOutboundCalldata_Call struct { + *mock.Call +} + +// GetOutboundCalldata is a helper method to define mock.On call +// - opts *bind.CallOpts +// - _token common.Address +// - _from common.Address +// - _to common.Address +// - _amount *big.Int +// - _data []byte +func (_e *ArbitrumGatewayRouterInterface_Expecter) GetOutboundCalldata(opts interface{}, _token interface{}, _from interface{}, _to interface{}, _amount interface{}, _data interface{}) *ArbitrumGatewayRouterInterface_GetOutboundCalldata_Call { + return &ArbitrumGatewayRouterInterface_GetOutboundCalldata_Call{Call: _e.mock.On("GetOutboundCalldata", opts, _token, _from, _to, _amount, _data)} +} + +func (_c *ArbitrumGatewayRouterInterface_GetOutboundCalldata_Call) Run(run func(opts *bind.CallOpts, _token common.Address, _from common.Address, _to common.Address, _amount *big.Int, _data []byte)) *ArbitrumGatewayRouterInterface_GetOutboundCalldata_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts), args[1].(common.Address), args[2].(common.Address), args[3].(common.Address), args[4].(*big.Int), args[5].([]byte)) + }) + return _c +} + +func (_c *ArbitrumGatewayRouterInterface_GetOutboundCalldata_Call) Return(_a0 []byte, _a1 error) *ArbitrumGatewayRouterInterface_GetOutboundCalldata_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbitrumGatewayRouterInterface_GetOutboundCalldata_Call) RunAndReturn(run func(*bind.CallOpts, common.Address, common.Address, common.Address, *big.Int, []byte) ([]byte, error)) *ArbitrumGatewayRouterInterface_GetOutboundCalldata_Call { + _c.Call.Return(run) + return _c +} + +// OutboundTransfer provides a mock function with given fields: opts, _token, _to, _amount, _maxGas, _gasPriceBid, _data +func (_m *ArbitrumGatewayRouterInterface) OutboundTransfer(opts *bind.TransactOpts, _token common.Address, _to common.Address, _amount *big.Int, _maxGas *big.Int, _gasPriceBid *big.Int, _data []byte) (*types.Transaction, error) { + ret := _m.Called(opts, _token, _to, _amount, _maxGas, _gasPriceBid, _data) + + if len(ret) == 0 { + panic("no return value specified for OutboundTransfer") + } + + var r0 *types.Transaction + var r1 error + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, common.Address, common.Address, *big.Int, *big.Int, *big.Int, []byte) (*types.Transaction, error)); ok { + return rf(opts, _token, _to, _amount, _maxGas, _gasPriceBid, _data) + } + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, common.Address, common.Address, *big.Int, *big.Int, *big.Int, []byte) *types.Transaction); ok { + r0 = rf(opts, _token, _to, _amount, _maxGas, _gasPriceBid, _data) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Transaction) + } + } + + if rf, ok := ret.Get(1).(func(*bind.TransactOpts, common.Address, common.Address, *big.Int, *big.Int, *big.Int, []byte) error); ok { + r1 = rf(opts, _token, _to, _amount, _maxGas, _gasPriceBid, _data) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbitrumGatewayRouterInterface_OutboundTransfer_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OutboundTransfer' +type ArbitrumGatewayRouterInterface_OutboundTransfer_Call struct { + *mock.Call +} + +// OutboundTransfer is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - _token common.Address +// - _to common.Address +// - _amount *big.Int +// - _maxGas *big.Int +// - _gasPriceBid *big.Int +// - _data []byte +func (_e *ArbitrumGatewayRouterInterface_Expecter) OutboundTransfer(opts interface{}, _token interface{}, _to interface{}, _amount interface{}, _maxGas interface{}, _gasPriceBid interface{}, _data interface{}) *ArbitrumGatewayRouterInterface_OutboundTransfer_Call { + return &ArbitrumGatewayRouterInterface_OutboundTransfer_Call{Call: _e.mock.On("OutboundTransfer", opts, _token, _to, _amount, _maxGas, _gasPriceBid, _data)} +} + +func (_c *ArbitrumGatewayRouterInterface_OutboundTransfer_Call) Run(run func(opts *bind.TransactOpts, _token common.Address, _to common.Address, _amount *big.Int, _maxGas *big.Int, _gasPriceBid *big.Int, _data []byte)) *ArbitrumGatewayRouterInterface_OutboundTransfer_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].(common.Address), args[2].(common.Address), args[3].(*big.Int), args[4].(*big.Int), args[5].(*big.Int), args[6].([]byte)) + }) + return _c +} + +func (_c *ArbitrumGatewayRouterInterface_OutboundTransfer_Call) Return(_a0 *types.Transaction, _a1 error) *ArbitrumGatewayRouterInterface_OutboundTransfer_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbitrumGatewayRouterInterface_OutboundTransfer_Call) RunAndReturn(run func(*bind.TransactOpts, common.Address, common.Address, *big.Int, *big.Int, *big.Int, []byte) (*types.Transaction, error)) *ArbitrumGatewayRouterInterface_OutboundTransfer_Call { + _c.Call.Return(run) + return _c +} + +// ParseDefaultGatewayUpdated provides a mock function with given fields: log +func (_m *ArbitrumGatewayRouterInterface) ParseDefaultGatewayUpdated(log types.Log) (*arbitrum_gateway_router.ArbitrumGatewayRouterDefaultGatewayUpdated, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParseDefaultGatewayUpdated") + } + + var r0 *arbitrum_gateway_router.ArbitrumGatewayRouterDefaultGatewayUpdated + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (*arbitrum_gateway_router.ArbitrumGatewayRouterDefaultGatewayUpdated, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) *arbitrum_gateway_router.ArbitrumGatewayRouterDefaultGatewayUpdated); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*arbitrum_gateway_router.ArbitrumGatewayRouterDefaultGatewayUpdated) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbitrumGatewayRouterInterface_ParseDefaultGatewayUpdated_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseDefaultGatewayUpdated' +type ArbitrumGatewayRouterInterface_ParseDefaultGatewayUpdated_Call struct { + *mock.Call +} + +// ParseDefaultGatewayUpdated is a helper method to define mock.On call +// - log types.Log +func (_e *ArbitrumGatewayRouterInterface_Expecter) ParseDefaultGatewayUpdated(log interface{}) *ArbitrumGatewayRouterInterface_ParseDefaultGatewayUpdated_Call { + return &ArbitrumGatewayRouterInterface_ParseDefaultGatewayUpdated_Call{Call: _e.mock.On("ParseDefaultGatewayUpdated", log)} +} + +func (_c *ArbitrumGatewayRouterInterface_ParseDefaultGatewayUpdated_Call) Run(run func(log types.Log)) *ArbitrumGatewayRouterInterface_ParseDefaultGatewayUpdated_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *ArbitrumGatewayRouterInterface_ParseDefaultGatewayUpdated_Call) Return(_a0 *arbitrum_gateway_router.ArbitrumGatewayRouterDefaultGatewayUpdated, _a1 error) *ArbitrumGatewayRouterInterface_ParseDefaultGatewayUpdated_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbitrumGatewayRouterInterface_ParseDefaultGatewayUpdated_Call) RunAndReturn(run func(types.Log) (*arbitrum_gateway_router.ArbitrumGatewayRouterDefaultGatewayUpdated, error)) *ArbitrumGatewayRouterInterface_ParseDefaultGatewayUpdated_Call { + _c.Call.Return(run) + return _c +} + +// ParseGatewaySet provides a mock function with given fields: log +func (_m *ArbitrumGatewayRouterInterface) ParseGatewaySet(log types.Log) (*arbitrum_gateway_router.ArbitrumGatewayRouterGatewaySet, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParseGatewaySet") + } + + var r0 *arbitrum_gateway_router.ArbitrumGatewayRouterGatewaySet + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (*arbitrum_gateway_router.ArbitrumGatewayRouterGatewaySet, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) *arbitrum_gateway_router.ArbitrumGatewayRouterGatewaySet); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*arbitrum_gateway_router.ArbitrumGatewayRouterGatewaySet) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbitrumGatewayRouterInterface_ParseGatewaySet_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseGatewaySet' +type ArbitrumGatewayRouterInterface_ParseGatewaySet_Call struct { + *mock.Call +} + +// ParseGatewaySet is a helper method to define mock.On call +// - log types.Log +func (_e *ArbitrumGatewayRouterInterface_Expecter) ParseGatewaySet(log interface{}) *ArbitrumGatewayRouterInterface_ParseGatewaySet_Call { + return &ArbitrumGatewayRouterInterface_ParseGatewaySet_Call{Call: _e.mock.On("ParseGatewaySet", log)} +} + +func (_c *ArbitrumGatewayRouterInterface_ParseGatewaySet_Call) Run(run func(log types.Log)) *ArbitrumGatewayRouterInterface_ParseGatewaySet_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *ArbitrumGatewayRouterInterface_ParseGatewaySet_Call) Return(_a0 *arbitrum_gateway_router.ArbitrumGatewayRouterGatewaySet, _a1 error) *ArbitrumGatewayRouterInterface_ParseGatewaySet_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbitrumGatewayRouterInterface_ParseGatewaySet_Call) RunAndReturn(run func(types.Log) (*arbitrum_gateway_router.ArbitrumGatewayRouterGatewaySet, error)) *ArbitrumGatewayRouterInterface_ParseGatewaySet_Call { + _c.Call.Return(run) + return _c +} + +// ParseLog provides a mock function with given fields: log +func (_m *ArbitrumGatewayRouterInterface) ParseLog(log types.Log) (generated.AbigenLog, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParseLog") + } + + var r0 generated.AbigenLog + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (generated.AbigenLog, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) generated.AbigenLog); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(generated.AbigenLog) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbitrumGatewayRouterInterface_ParseLog_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseLog' +type ArbitrumGatewayRouterInterface_ParseLog_Call struct { + *mock.Call +} + +// ParseLog is a helper method to define mock.On call +// - log types.Log +func (_e *ArbitrumGatewayRouterInterface_Expecter) ParseLog(log interface{}) *ArbitrumGatewayRouterInterface_ParseLog_Call { + return &ArbitrumGatewayRouterInterface_ParseLog_Call{Call: _e.mock.On("ParseLog", log)} +} + +func (_c *ArbitrumGatewayRouterInterface_ParseLog_Call) Run(run func(log types.Log)) *ArbitrumGatewayRouterInterface_ParseLog_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *ArbitrumGatewayRouterInterface_ParseLog_Call) Return(_a0 generated.AbigenLog, _a1 error) *ArbitrumGatewayRouterInterface_ParseLog_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbitrumGatewayRouterInterface_ParseLog_Call) RunAndReturn(run func(types.Log) (generated.AbigenLog, error)) *ArbitrumGatewayRouterInterface_ParseLog_Call { + _c.Call.Return(run) + return _c +} + +// ParseTransferRouted provides a mock function with given fields: log +func (_m *ArbitrumGatewayRouterInterface) ParseTransferRouted(log types.Log) (*arbitrum_gateway_router.ArbitrumGatewayRouterTransferRouted, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParseTransferRouted") + } + + var r0 *arbitrum_gateway_router.ArbitrumGatewayRouterTransferRouted + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (*arbitrum_gateway_router.ArbitrumGatewayRouterTransferRouted, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) *arbitrum_gateway_router.ArbitrumGatewayRouterTransferRouted); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*arbitrum_gateway_router.ArbitrumGatewayRouterTransferRouted) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbitrumGatewayRouterInterface_ParseTransferRouted_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseTransferRouted' +type ArbitrumGatewayRouterInterface_ParseTransferRouted_Call struct { + *mock.Call +} + +// ParseTransferRouted is a helper method to define mock.On call +// - log types.Log +func (_e *ArbitrumGatewayRouterInterface_Expecter) ParseTransferRouted(log interface{}) *ArbitrumGatewayRouterInterface_ParseTransferRouted_Call { + return &ArbitrumGatewayRouterInterface_ParseTransferRouted_Call{Call: _e.mock.On("ParseTransferRouted", log)} +} + +func (_c *ArbitrumGatewayRouterInterface_ParseTransferRouted_Call) Run(run func(log types.Log)) *ArbitrumGatewayRouterInterface_ParseTransferRouted_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *ArbitrumGatewayRouterInterface_ParseTransferRouted_Call) Return(_a0 *arbitrum_gateway_router.ArbitrumGatewayRouterTransferRouted, _a1 error) *ArbitrumGatewayRouterInterface_ParseTransferRouted_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbitrumGatewayRouterInterface_ParseTransferRouted_Call) RunAndReturn(run func(types.Log) (*arbitrum_gateway_router.ArbitrumGatewayRouterTransferRouted, error)) *ArbitrumGatewayRouterInterface_ParseTransferRouted_Call { + _c.Call.Return(run) + return _c +} + +// WatchDefaultGatewayUpdated provides a mock function with given fields: opts, sink +func (_m *ArbitrumGatewayRouterInterface) WatchDefaultGatewayUpdated(opts *bind.WatchOpts, sink chan<- *arbitrum_gateway_router.ArbitrumGatewayRouterDefaultGatewayUpdated) (event.Subscription, error) { + ret := _m.Called(opts, sink) + + if len(ret) == 0 { + panic("no return value specified for WatchDefaultGatewayUpdated") + } + + var r0 event.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *arbitrum_gateway_router.ArbitrumGatewayRouterDefaultGatewayUpdated) (event.Subscription, error)); ok { + return rf(opts, sink) + } + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *arbitrum_gateway_router.ArbitrumGatewayRouterDefaultGatewayUpdated) event.Subscription); ok { + r0 = rf(opts, sink) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(event.Subscription) + } + } + + if rf, ok := ret.Get(1).(func(*bind.WatchOpts, chan<- *arbitrum_gateway_router.ArbitrumGatewayRouterDefaultGatewayUpdated) error); ok { + r1 = rf(opts, sink) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbitrumGatewayRouterInterface_WatchDefaultGatewayUpdated_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchDefaultGatewayUpdated' +type ArbitrumGatewayRouterInterface_WatchDefaultGatewayUpdated_Call struct { + *mock.Call +} + +// WatchDefaultGatewayUpdated is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *arbitrum_gateway_router.ArbitrumGatewayRouterDefaultGatewayUpdated +func (_e *ArbitrumGatewayRouterInterface_Expecter) WatchDefaultGatewayUpdated(opts interface{}, sink interface{}) *ArbitrumGatewayRouterInterface_WatchDefaultGatewayUpdated_Call { + return &ArbitrumGatewayRouterInterface_WatchDefaultGatewayUpdated_Call{Call: _e.mock.On("WatchDefaultGatewayUpdated", opts, sink)} +} + +func (_c *ArbitrumGatewayRouterInterface_WatchDefaultGatewayUpdated_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *arbitrum_gateway_router.ArbitrumGatewayRouterDefaultGatewayUpdated)) *ArbitrumGatewayRouterInterface_WatchDefaultGatewayUpdated_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *arbitrum_gateway_router.ArbitrumGatewayRouterDefaultGatewayUpdated)) + }) + return _c +} + +func (_c *ArbitrumGatewayRouterInterface_WatchDefaultGatewayUpdated_Call) Return(_a0 event.Subscription, _a1 error) *ArbitrumGatewayRouterInterface_WatchDefaultGatewayUpdated_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbitrumGatewayRouterInterface_WatchDefaultGatewayUpdated_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *arbitrum_gateway_router.ArbitrumGatewayRouterDefaultGatewayUpdated) (event.Subscription, error)) *ArbitrumGatewayRouterInterface_WatchDefaultGatewayUpdated_Call { + _c.Call.Return(run) + return _c +} + +// WatchGatewaySet provides a mock function with given fields: opts, sink, l1Token, gateway +func (_m *ArbitrumGatewayRouterInterface) WatchGatewaySet(opts *bind.WatchOpts, sink chan<- *arbitrum_gateway_router.ArbitrumGatewayRouterGatewaySet, l1Token []common.Address, gateway []common.Address) (event.Subscription, error) { + ret := _m.Called(opts, sink, l1Token, gateway) + + if len(ret) == 0 { + panic("no return value specified for WatchGatewaySet") + } + + var r0 event.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *arbitrum_gateway_router.ArbitrumGatewayRouterGatewaySet, []common.Address, []common.Address) (event.Subscription, error)); ok { + return rf(opts, sink, l1Token, gateway) + } + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *arbitrum_gateway_router.ArbitrumGatewayRouterGatewaySet, []common.Address, []common.Address) event.Subscription); ok { + r0 = rf(opts, sink, l1Token, gateway) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(event.Subscription) + } + } + + if rf, ok := ret.Get(1).(func(*bind.WatchOpts, chan<- *arbitrum_gateway_router.ArbitrumGatewayRouterGatewaySet, []common.Address, []common.Address) error); ok { + r1 = rf(opts, sink, l1Token, gateway) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbitrumGatewayRouterInterface_WatchGatewaySet_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchGatewaySet' +type ArbitrumGatewayRouterInterface_WatchGatewaySet_Call struct { + *mock.Call +} + +// WatchGatewaySet is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *arbitrum_gateway_router.ArbitrumGatewayRouterGatewaySet +// - l1Token []common.Address +// - gateway []common.Address +func (_e *ArbitrumGatewayRouterInterface_Expecter) WatchGatewaySet(opts interface{}, sink interface{}, l1Token interface{}, gateway interface{}) *ArbitrumGatewayRouterInterface_WatchGatewaySet_Call { + return &ArbitrumGatewayRouterInterface_WatchGatewaySet_Call{Call: _e.mock.On("WatchGatewaySet", opts, sink, l1Token, gateway)} +} + +func (_c *ArbitrumGatewayRouterInterface_WatchGatewaySet_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *arbitrum_gateway_router.ArbitrumGatewayRouterGatewaySet, l1Token []common.Address, gateway []common.Address)) *ArbitrumGatewayRouterInterface_WatchGatewaySet_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *arbitrum_gateway_router.ArbitrumGatewayRouterGatewaySet), args[2].([]common.Address), args[3].([]common.Address)) + }) + return _c +} + +func (_c *ArbitrumGatewayRouterInterface_WatchGatewaySet_Call) Return(_a0 event.Subscription, _a1 error) *ArbitrumGatewayRouterInterface_WatchGatewaySet_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbitrumGatewayRouterInterface_WatchGatewaySet_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *arbitrum_gateway_router.ArbitrumGatewayRouterGatewaySet, []common.Address, []common.Address) (event.Subscription, error)) *ArbitrumGatewayRouterInterface_WatchGatewaySet_Call { + _c.Call.Return(run) + return _c +} + +// WatchTransferRouted provides a mock function with given fields: opts, sink, token, _userFrom, _userTo +func (_m *ArbitrumGatewayRouterInterface) WatchTransferRouted(opts *bind.WatchOpts, sink chan<- *arbitrum_gateway_router.ArbitrumGatewayRouterTransferRouted, token []common.Address, _userFrom []common.Address, _userTo []common.Address) (event.Subscription, error) { + ret := _m.Called(opts, sink, token, _userFrom, _userTo) + + if len(ret) == 0 { + panic("no return value specified for WatchTransferRouted") + } + + var r0 event.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *arbitrum_gateway_router.ArbitrumGatewayRouterTransferRouted, []common.Address, []common.Address, []common.Address) (event.Subscription, error)); ok { + return rf(opts, sink, token, _userFrom, _userTo) + } + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *arbitrum_gateway_router.ArbitrumGatewayRouterTransferRouted, []common.Address, []common.Address, []common.Address) event.Subscription); ok { + r0 = rf(opts, sink, token, _userFrom, _userTo) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(event.Subscription) + } + } + + if rf, ok := ret.Get(1).(func(*bind.WatchOpts, chan<- *arbitrum_gateway_router.ArbitrumGatewayRouterTransferRouted, []common.Address, []common.Address, []common.Address) error); ok { + r1 = rf(opts, sink, token, _userFrom, _userTo) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbitrumGatewayRouterInterface_WatchTransferRouted_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchTransferRouted' +type ArbitrumGatewayRouterInterface_WatchTransferRouted_Call struct { + *mock.Call +} + +// WatchTransferRouted is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *arbitrum_gateway_router.ArbitrumGatewayRouterTransferRouted +// - token []common.Address +// - _userFrom []common.Address +// - _userTo []common.Address +func (_e *ArbitrumGatewayRouterInterface_Expecter) WatchTransferRouted(opts interface{}, sink interface{}, token interface{}, _userFrom interface{}, _userTo interface{}) *ArbitrumGatewayRouterInterface_WatchTransferRouted_Call { + return &ArbitrumGatewayRouterInterface_WatchTransferRouted_Call{Call: _e.mock.On("WatchTransferRouted", opts, sink, token, _userFrom, _userTo)} +} + +func (_c *ArbitrumGatewayRouterInterface_WatchTransferRouted_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *arbitrum_gateway_router.ArbitrumGatewayRouterTransferRouted, token []common.Address, _userFrom []common.Address, _userTo []common.Address)) *ArbitrumGatewayRouterInterface_WatchTransferRouted_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *arbitrum_gateway_router.ArbitrumGatewayRouterTransferRouted), args[2].([]common.Address), args[3].([]common.Address), args[4].([]common.Address)) + }) + return _c +} + +func (_c *ArbitrumGatewayRouterInterface_WatchTransferRouted_Call) Return(_a0 event.Subscription, _a1 error) *ArbitrumGatewayRouterInterface_WatchTransferRouted_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbitrumGatewayRouterInterface_WatchTransferRouted_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *arbitrum_gateway_router.ArbitrumGatewayRouterTransferRouted, []common.Address, []common.Address, []common.Address) (event.Subscription, error)) *ArbitrumGatewayRouterInterface_WatchTransferRouted_Call { + _c.Call.Return(run) + return _c +} + +// NewArbitrumGatewayRouterInterface creates a new instance of ArbitrumGatewayRouterInterface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewArbitrumGatewayRouterInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *ArbitrumGatewayRouterInterface { + mock := &ArbitrumGatewayRouterInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/core/gethwrappers/liquiditymanager/mocks/mock_arbitrum_inbox/arbitrum_inbox_interface.go b/core/gethwrappers/liquiditymanager/mocks/mock_arbitrum_inbox/arbitrum_inbox_interface.go new file mode 100644 index 00000000000..ca259c06211 --- /dev/null +++ b/core/gethwrappers/liquiditymanager/mocks/mock_arbitrum_inbox/arbitrum_inbox_interface.go @@ -0,0 +1,1452 @@ +// Code generated by mockery v2.43.2. DO NOT EDIT. + +package mock_arbitrum_inbox + +import ( + big "math/big" + + arbitrum_inbox "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/liquiditymanager/generated/arbitrum_inbox" + + bind "github.com/ethereum/go-ethereum/accounts/abi/bind" + + common "github.com/ethereum/go-ethereum/common" + + event "github.com/ethereum/go-ethereum/event" + + generated "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" + + mock "github.com/stretchr/testify/mock" + + types "github.com/ethereum/go-ethereum/core/types" +) + +// ArbitrumInboxInterface is an autogenerated mock type for the ArbitrumInboxInterface type +type ArbitrumInboxInterface struct { + mock.Mock +} + +type ArbitrumInboxInterface_Expecter struct { + mock *mock.Mock +} + +func (_m *ArbitrumInboxInterface) EXPECT() *ArbitrumInboxInterface_Expecter { + return &ArbitrumInboxInterface_Expecter{mock: &_m.Mock} +} + +// Address provides a mock function with given fields: +func (_m *ArbitrumInboxInterface) Address() common.Address { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Address") + } + + var r0 common.Address + if rf, ok := ret.Get(0).(func() common.Address); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Address) + } + } + + return r0 +} + +// ArbitrumInboxInterface_Address_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Address' +type ArbitrumInboxInterface_Address_Call struct { + *mock.Call +} + +// Address is a helper method to define mock.On call +func (_e *ArbitrumInboxInterface_Expecter) Address() *ArbitrumInboxInterface_Address_Call { + return &ArbitrumInboxInterface_Address_Call{Call: _e.mock.On("Address")} +} + +func (_c *ArbitrumInboxInterface_Address_Call) Run(run func()) *ArbitrumInboxInterface_Address_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ArbitrumInboxInterface_Address_Call) Return(_a0 common.Address) *ArbitrumInboxInterface_Address_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ArbitrumInboxInterface_Address_Call) RunAndReturn(run func() common.Address) *ArbitrumInboxInterface_Address_Call { + _c.Call.Return(run) + return _c +} + +// AllowListEnabled provides a mock function with given fields: opts +func (_m *ArbitrumInboxInterface) AllowListEnabled(opts *bind.CallOpts) (bool, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for AllowListEnabled") + } + + var r0 bool + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts) (bool, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts) bool); ok { + r0 = rf(opts) + } else { + r0 = ret.Get(0).(bool) + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbitrumInboxInterface_AllowListEnabled_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AllowListEnabled' +type ArbitrumInboxInterface_AllowListEnabled_Call struct { + *mock.Call +} + +// AllowListEnabled is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *ArbitrumInboxInterface_Expecter) AllowListEnabled(opts interface{}) *ArbitrumInboxInterface_AllowListEnabled_Call { + return &ArbitrumInboxInterface_AllowListEnabled_Call{Call: _e.mock.On("AllowListEnabled", opts)} +} + +func (_c *ArbitrumInboxInterface_AllowListEnabled_Call) Run(run func(opts *bind.CallOpts)) *ArbitrumInboxInterface_AllowListEnabled_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *ArbitrumInboxInterface_AllowListEnabled_Call) Return(_a0 bool, _a1 error) *ArbitrumInboxInterface_AllowListEnabled_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbitrumInboxInterface_AllowListEnabled_Call) RunAndReturn(run func(*bind.CallOpts) (bool, error)) *ArbitrumInboxInterface_AllowListEnabled_Call { + _c.Call.Return(run) + return _c +} + +// Bridge provides a mock function with given fields: opts +func (_m *ArbitrumInboxInterface) Bridge(opts *bind.CallOpts) (common.Address, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for Bridge") + } + + var r0 common.Address + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts) (common.Address, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts) common.Address); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Address) + } + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbitrumInboxInterface_Bridge_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Bridge' +type ArbitrumInboxInterface_Bridge_Call struct { + *mock.Call +} + +// Bridge is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *ArbitrumInboxInterface_Expecter) Bridge(opts interface{}) *ArbitrumInboxInterface_Bridge_Call { + return &ArbitrumInboxInterface_Bridge_Call{Call: _e.mock.On("Bridge", opts)} +} + +func (_c *ArbitrumInboxInterface_Bridge_Call) Run(run func(opts *bind.CallOpts)) *ArbitrumInboxInterface_Bridge_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *ArbitrumInboxInterface_Bridge_Call) Return(_a0 common.Address, _a1 error) *ArbitrumInboxInterface_Bridge_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbitrumInboxInterface_Bridge_Call) RunAndReturn(run func(*bind.CallOpts) (common.Address, error)) *ArbitrumInboxInterface_Bridge_Call { + _c.Call.Return(run) + return _c +} + +// CalculateRetryableSubmissionFee provides a mock function with given fields: opts, dataLength, baseFee +func (_m *ArbitrumInboxInterface) CalculateRetryableSubmissionFee(opts *bind.CallOpts, dataLength *big.Int, baseFee *big.Int) (*big.Int, error) { + ret := _m.Called(opts, dataLength, baseFee) + + if len(ret) == 0 { + panic("no return value specified for CalculateRetryableSubmissionFee") + } + + var r0 *big.Int + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts, *big.Int, *big.Int) (*big.Int, error)); ok { + return rf(opts, dataLength, baseFee) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts, *big.Int, *big.Int) *big.Int); ok { + r0 = rf(opts, dataLength, baseFee) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*big.Int) + } + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts, *big.Int, *big.Int) error); ok { + r1 = rf(opts, dataLength, baseFee) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbitrumInboxInterface_CalculateRetryableSubmissionFee_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CalculateRetryableSubmissionFee' +type ArbitrumInboxInterface_CalculateRetryableSubmissionFee_Call struct { + *mock.Call +} + +// CalculateRetryableSubmissionFee is a helper method to define mock.On call +// - opts *bind.CallOpts +// - dataLength *big.Int +// - baseFee *big.Int +func (_e *ArbitrumInboxInterface_Expecter) CalculateRetryableSubmissionFee(opts interface{}, dataLength interface{}, baseFee interface{}) *ArbitrumInboxInterface_CalculateRetryableSubmissionFee_Call { + return &ArbitrumInboxInterface_CalculateRetryableSubmissionFee_Call{Call: _e.mock.On("CalculateRetryableSubmissionFee", opts, dataLength, baseFee)} +} + +func (_c *ArbitrumInboxInterface_CalculateRetryableSubmissionFee_Call) Run(run func(opts *bind.CallOpts, dataLength *big.Int, baseFee *big.Int)) *ArbitrumInboxInterface_CalculateRetryableSubmissionFee_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts), args[1].(*big.Int), args[2].(*big.Int)) + }) + return _c +} + +func (_c *ArbitrumInboxInterface_CalculateRetryableSubmissionFee_Call) Return(_a0 *big.Int, _a1 error) *ArbitrumInboxInterface_CalculateRetryableSubmissionFee_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbitrumInboxInterface_CalculateRetryableSubmissionFee_Call) RunAndReturn(run func(*bind.CallOpts, *big.Int, *big.Int) (*big.Int, error)) *ArbitrumInboxInterface_CalculateRetryableSubmissionFee_Call { + _c.Call.Return(run) + return _c +} + +// FilterInboxMessageDelivered provides a mock function with given fields: opts, messageNum +func (_m *ArbitrumInboxInterface) FilterInboxMessageDelivered(opts *bind.FilterOpts, messageNum []*big.Int) (*arbitrum_inbox.ArbitrumInboxInboxMessageDeliveredIterator, error) { + ret := _m.Called(opts, messageNum) + + if len(ret) == 0 { + panic("no return value specified for FilterInboxMessageDelivered") + } + + var r0 *arbitrum_inbox.ArbitrumInboxInboxMessageDeliveredIterator + var r1 error + if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []*big.Int) (*arbitrum_inbox.ArbitrumInboxInboxMessageDeliveredIterator, error)); ok { + return rf(opts, messageNum) + } + if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []*big.Int) *arbitrum_inbox.ArbitrumInboxInboxMessageDeliveredIterator); ok { + r0 = rf(opts, messageNum) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*arbitrum_inbox.ArbitrumInboxInboxMessageDeliveredIterator) + } + } + + if rf, ok := ret.Get(1).(func(*bind.FilterOpts, []*big.Int) error); ok { + r1 = rf(opts, messageNum) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbitrumInboxInterface_FilterInboxMessageDelivered_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterInboxMessageDelivered' +type ArbitrumInboxInterface_FilterInboxMessageDelivered_Call struct { + *mock.Call +} + +// FilterInboxMessageDelivered is a helper method to define mock.On call +// - opts *bind.FilterOpts +// - messageNum []*big.Int +func (_e *ArbitrumInboxInterface_Expecter) FilterInboxMessageDelivered(opts interface{}, messageNum interface{}) *ArbitrumInboxInterface_FilterInboxMessageDelivered_Call { + return &ArbitrumInboxInterface_FilterInboxMessageDelivered_Call{Call: _e.mock.On("FilterInboxMessageDelivered", opts, messageNum)} +} + +func (_c *ArbitrumInboxInterface_FilterInboxMessageDelivered_Call) Run(run func(opts *bind.FilterOpts, messageNum []*big.Int)) *ArbitrumInboxInterface_FilterInboxMessageDelivered_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts), args[1].([]*big.Int)) + }) + return _c +} + +func (_c *ArbitrumInboxInterface_FilterInboxMessageDelivered_Call) Return(_a0 *arbitrum_inbox.ArbitrumInboxInboxMessageDeliveredIterator, _a1 error) *ArbitrumInboxInterface_FilterInboxMessageDelivered_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbitrumInboxInterface_FilterInboxMessageDelivered_Call) RunAndReturn(run func(*bind.FilterOpts, []*big.Int) (*arbitrum_inbox.ArbitrumInboxInboxMessageDeliveredIterator, error)) *ArbitrumInboxInterface_FilterInboxMessageDelivered_Call { + _c.Call.Return(run) + return _c +} + +// FilterInboxMessageDeliveredFromOrigin provides a mock function with given fields: opts, messageNum +func (_m *ArbitrumInboxInterface) FilterInboxMessageDeliveredFromOrigin(opts *bind.FilterOpts, messageNum []*big.Int) (*arbitrum_inbox.ArbitrumInboxInboxMessageDeliveredFromOriginIterator, error) { + ret := _m.Called(opts, messageNum) + + if len(ret) == 0 { + panic("no return value specified for FilterInboxMessageDeliveredFromOrigin") + } + + var r0 *arbitrum_inbox.ArbitrumInboxInboxMessageDeliveredFromOriginIterator + var r1 error + if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []*big.Int) (*arbitrum_inbox.ArbitrumInboxInboxMessageDeliveredFromOriginIterator, error)); ok { + return rf(opts, messageNum) + } + if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []*big.Int) *arbitrum_inbox.ArbitrumInboxInboxMessageDeliveredFromOriginIterator); ok { + r0 = rf(opts, messageNum) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*arbitrum_inbox.ArbitrumInboxInboxMessageDeliveredFromOriginIterator) + } + } + + if rf, ok := ret.Get(1).(func(*bind.FilterOpts, []*big.Int) error); ok { + r1 = rf(opts, messageNum) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbitrumInboxInterface_FilterInboxMessageDeliveredFromOrigin_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterInboxMessageDeliveredFromOrigin' +type ArbitrumInboxInterface_FilterInboxMessageDeliveredFromOrigin_Call struct { + *mock.Call +} + +// FilterInboxMessageDeliveredFromOrigin is a helper method to define mock.On call +// - opts *bind.FilterOpts +// - messageNum []*big.Int +func (_e *ArbitrumInboxInterface_Expecter) FilterInboxMessageDeliveredFromOrigin(opts interface{}, messageNum interface{}) *ArbitrumInboxInterface_FilterInboxMessageDeliveredFromOrigin_Call { + return &ArbitrumInboxInterface_FilterInboxMessageDeliveredFromOrigin_Call{Call: _e.mock.On("FilterInboxMessageDeliveredFromOrigin", opts, messageNum)} +} + +func (_c *ArbitrumInboxInterface_FilterInboxMessageDeliveredFromOrigin_Call) Run(run func(opts *bind.FilterOpts, messageNum []*big.Int)) *ArbitrumInboxInterface_FilterInboxMessageDeliveredFromOrigin_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts), args[1].([]*big.Int)) + }) + return _c +} + +func (_c *ArbitrumInboxInterface_FilterInboxMessageDeliveredFromOrigin_Call) Return(_a0 *arbitrum_inbox.ArbitrumInboxInboxMessageDeliveredFromOriginIterator, _a1 error) *ArbitrumInboxInterface_FilterInboxMessageDeliveredFromOrigin_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbitrumInboxInterface_FilterInboxMessageDeliveredFromOrigin_Call) RunAndReturn(run func(*bind.FilterOpts, []*big.Int) (*arbitrum_inbox.ArbitrumInboxInboxMessageDeliveredFromOriginIterator, error)) *ArbitrumInboxInterface_FilterInboxMessageDeliveredFromOrigin_Call { + _c.Call.Return(run) + return _c +} + +// GetProxyAdmin provides a mock function with given fields: opts +func (_m *ArbitrumInboxInterface) GetProxyAdmin(opts *bind.CallOpts) (common.Address, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for GetProxyAdmin") + } + + var r0 common.Address + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts) (common.Address, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts) common.Address); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Address) + } + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbitrumInboxInterface_GetProxyAdmin_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetProxyAdmin' +type ArbitrumInboxInterface_GetProxyAdmin_Call struct { + *mock.Call +} + +// GetProxyAdmin is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *ArbitrumInboxInterface_Expecter) GetProxyAdmin(opts interface{}) *ArbitrumInboxInterface_GetProxyAdmin_Call { + return &ArbitrumInboxInterface_GetProxyAdmin_Call{Call: _e.mock.On("GetProxyAdmin", opts)} +} + +func (_c *ArbitrumInboxInterface_GetProxyAdmin_Call) Run(run func(opts *bind.CallOpts)) *ArbitrumInboxInterface_GetProxyAdmin_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *ArbitrumInboxInterface_GetProxyAdmin_Call) Return(_a0 common.Address, _a1 error) *ArbitrumInboxInterface_GetProxyAdmin_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbitrumInboxInterface_GetProxyAdmin_Call) RunAndReturn(run func(*bind.CallOpts) (common.Address, error)) *ArbitrumInboxInterface_GetProxyAdmin_Call { + _c.Call.Return(run) + return _c +} + +// Initialize provides a mock function with given fields: opts, _bridge, _sequencerInbox +func (_m *ArbitrumInboxInterface) Initialize(opts *bind.TransactOpts, _bridge common.Address, _sequencerInbox common.Address) (*types.Transaction, error) { + ret := _m.Called(opts, _bridge, _sequencerInbox) + + if len(ret) == 0 { + panic("no return value specified for Initialize") + } + + var r0 *types.Transaction + var r1 error + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, common.Address, common.Address) (*types.Transaction, error)); ok { + return rf(opts, _bridge, _sequencerInbox) + } + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, common.Address, common.Address) *types.Transaction); ok { + r0 = rf(opts, _bridge, _sequencerInbox) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Transaction) + } + } + + if rf, ok := ret.Get(1).(func(*bind.TransactOpts, common.Address, common.Address) error); ok { + r1 = rf(opts, _bridge, _sequencerInbox) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbitrumInboxInterface_Initialize_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Initialize' +type ArbitrumInboxInterface_Initialize_Call struct { + *mock.Call +} + +// Initialize is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - _bridge common.Address +// - _sequencerInbox common.Address +func (_e *ArbitrumInboxInterface_Expecter) Initialize(opts interface{}, _bridge interface{}, _sequencerInbox interface{}) *ArbitrumInboxInterface_Initialize_Call { + return &ArbitrumInboxInterface_Initialize_Call{Call: _e.mock.On("Initialize", opts, _bridge, _sequencerInbox)} +} + +func (_c *ArbitrumInboxInterface_Initialize_Call) Run(run func(opts *bind.TransactOpts, _bridge common.Address, _sequencerInbox common.Address)) *ArbitrumInboxInterface_Initialize_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].(common.Address), args[2].(common.Address)) + }) + return _c +} + +func (_c *ArbitrumInboxInterface_Initialize_Call) Return(_a0 *types.Transaction, _a1 error) *ArbitrumInboxInterface_Initialize_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbitrumInboxInterface_Initialize_Call) RunAndReturn(run func(*bind.TransactOpts, common.Address, common.Address) (*types.Transaction, error)) *ArbitrumInboxInterface_Initialize_Call { + _c.Call.Return(run) + return _c +} + +// IsAllowed provides a mock function with given fields: opts, user +func (_m *ArbitrumInboxInterface) IsAllowed(opts *bind.CallOpts, user common.Address) (bool, error) { + ret := _m.Called(opts, user) + + if len(ret) == 0 { + panic("no return value specified for IsAllowed") + } + + var r0 bool + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts, common.Address) (bool, error)); ok { + return rf(opts, user) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts, common.Address) bool); ok { + r0 = rf(opts, user) + } else { + r0 = ret.Get(0).(bool) + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts, common.Address) error); ok { + r1 = rf(opts, user) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbitrumInboxInterface_IsAllowed_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsAllowed' +type ArbitrumInboxInterface_IsAllowed_Call struct { + *mock.Call +} + +// IsAllowed is a helper method to define mock.On call +// - opts *bind.CallOpts +// - user common.Address +func (_e *ArbitrumInboxInterface_Expecter) IsAllowed(opts interface{}, user interface{}) *ArbitrumInboxInterface_IsAllowed_Call { + return &ArbitrumInboxInterface_IsAllowed_Call{Call: _e.mock.On("IsAllowed", opts, user)} +} + +func (_c *ArbitrumInboxInterface_IsAllowed_Call) Run(run func(opts *bind.CallOpts, user common.Address)) *ArbitrumInboxInterface_IsAllowed_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts), args[1].(common.Address)) + }) + return _c +} + +func (_c *ArbitrumInboxInterface_IsAllowed_Call) Return(_a0 bool, _a1 error) *ArbitrumInboxInterface_IsAllowed_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbitrumInboxInterface_IsAllowed_Call) RunAndReturn(run func(*bind.CallOpts, common.Address) (bool, error)) *ArbitrumInboxInterface_IsAllowed_Call { + _c.Call.Return(run) + return _c +} + +// MaxDataSize provides a mock function with given fields: opts +func (_m *ArbitrumInboxInterface) MaxDataSize(opts *bind.CallOpts) (*big.Int, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for MaxDataSize") + } + + var r0 *big.Int + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts) (*big.Int, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts) *big.Int); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*big.Int) + } + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbitrumInboxInterface_MaxDataSize_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MaxDataSize' +type ArbitrumInboxInterface_MaxDataSize_Call struct { + *mock.Call +} + +// MaxDataSize is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *ArbitrumInboxInterface_Expecter) MaxDataSize(opts interface{}) *ArbitrumInboxInterface_MaxDataSize_Call { + return &ArbitrumInboxInterface_MaxDataSize_Call{Call: _e.mock.On("MaxDataSize", opts)} +} + +func (_c *ArbitrumInboxInterface_MaxDataSize_Call) Run(run func(opts *bind.CallOpts)) *ArbitrumInboxInterface_MaxDataSize_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *ArbitrumInboxInterface_MaxDataSize_Call) Return(_a0 *big.Int, _a1 error) *ArbitrumInboxInterface_MaxDataSize_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbitrumInboxInterface_MaxDataSize_Call) RunAndReturn(run func(*bind.CallOpts) (*big.Int, error)) *ArbitrumInboxInterface_MaxDataSize_Call { + _c.Call.Return(run) + return _c +} + +// ParseInboxMessageDelivered provides a mock function with given fields: log +func (_m *ArbitrumInboxInterface) ParseInboxMessageDelivered(log types.Log) (*arbitrum_inbox.ArbitrumInboxInboxMessageDelivered, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParseInboxMessageDelivered") + } + + var r0 *arbitrum_inbox.ArbitrumInboxInboxMessageDelivered + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (*arbitrum_inbox.ArbitrumInboxInboxMessageDelivered, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) *arbitrum_inbox.ArbitrumInboxInboxMessageDelivered); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*arbitrum_inbox.ArbitrumInboxInboxMessageDelivered) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbitrumInboxInterface_ParseInboxMessageDelivered_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseInboxMessageDelivered' +type ArbitrumInboxInterface_ParseInboxMessageDelivered_Call struct { + *mock.Call +} + +// ParseInboxMessageDelivered is a helper method to define mock.On call +// - log types.Log +func (_e *ArbitrumInboxInterface_Expecter) ParseInboxMessageDelivered(log interface{}) *ArbitrumInboxInterface_ParseInboxMessageDelivered_Call { + return &ArbitrumInboxInterface_ParseInboxMessageDelivered_Call{Call: _e.mock.On("ParseInboxMessageDelivered", log)} +} + +func (_c *ArbitrumInboxInterface_ParseInboxMessageDelivered_Call) Run(run func(log types.Log)) *ArbitrumInboxInterface_ParseInboxMessageDelivered_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *ArbitrumInboxInterface_ParseInboxMessageDelivered_Call) Return(_a0 *arbitrum_inbox.ArbitrumInboxInboxMessageDelivered, _a1 error) *ArbitrumInboxInterface_ParseInboxMessageDelivered_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbitrumInboxInterface_ParseInboxMessageDelivered_Call) RunAndReturn(run func(types.Log) (*arbitrum_inbox.ArbitrumInboxInboxMessageDelivered, error)) *ArbitrumInboxInterface_ParseInboxMessageDelivered_Call { + _c.Call.Return(run) + return _c +} + +// ParseInboxMessageDeliveredFromOrigin provides a mock function with given fields: log +func (_m *ArbitrumInboxInterface) ParseInboxMessageDeliveredFromOrigin(log types.Log) (*arbitrum_inbox.ArbitrumInboxInboxMessageDeliveredFromOrigin, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParseInboxMessageDeliveredFromOrigin") + } + + var r0 *arbitrum_inbox.ArbitrumInboxInboxMessageDeliveredFromOrigin + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (*arbitrum_inbox.ArbitrumInboxInboxMessageDeliveredFromOrigin, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) *arbitrum_inbox.ArbitrumInboxInboxMessageDeliveredFromOrigin); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*arbitrum_inbox.ArbitrumInboxInboxMessageDeliveredFromOrigin) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbitrumInboxInterface_ParseInboxMessageDeliveredFromOrigin_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseInboxMessageDeliveredFromOrigin' +type ArbitrumInboxInterface_ParseInboxMessageDeliveredFromOrigin_Call struct { + *mock.Call +} + +// ParseInboxMessageDeliveredFromOrigin is a helper method to define mock.On call +// - log types.Log +func (_e *ArbitrumInboxInterface_Expecter) ParseInboxMessageDeliveredFromOrigin(log interface{}) *ArbitrumInboxInterface_ParseInboxMessageDeliveredFromOrigin_Call { + return &ArbitrumInboxInterface_ParseInboxMessageDeliveredFromOrigin_Call{Call: _e.mock.On("ParseInboxMessageDeliveredFromOrigin", log)} +} + +func (_c *ArbitrumInboxInterface_ParseInboxMessageDeliveredFromOrigin_Call) Run(run func(log types.Log)) *ArbitrumInboxInterface_ParseInboxMessageDeliveredFromOrigin_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *ArbitrumInboxInterface_ParseInboxMessageDeliveredFromOrigin_Call) Return(_a0 *arbitrum_inbox.ArbitrumInboxInboxMessageDeliveredFromOrigin, _a1 error) *ArbitrumInboxInterface_ParseInboxMessageDeliveredFromOrigin_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbitrumInboxInterface_ParseInboxMessageDeliveredFromOrigin_Call) RunAndReturn(run func(types.Log) (*arbitrum_inbox.ArbitrumInboxInboxMessageDeliveredFromOrigin, error)) *ArbitrumInboxInterface_ParseInboxMessageDeliveredFromOrigin_Call { + _c.Call.Return(run) + return _c +} + +// ParseLog provides a mock function with given fields: log +func (_m *ArbitrumInboxInterface) ParseLog(log types.Log) (generated.AbigenLog, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParseLog") + } + + var r0 generated.AbigenLog + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (generated.AbigenLog, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) generated.AbigenLog); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(generated.AbigenLog) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbitrumInboxInterface_ParseLog_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseLog' +type ArbitrumInboxInterface_ParseLog_Call struct { + *mock.Call +} + +// ParseLog is a helper method to define mock.On call +// - log types.Log +func (_e *ArbitrumInboxInterface_Expecter) ParseLog(log interface{}) *ArbitrumInboxInterface_ParseLog_Call { + return &ArbitrumInboxInterface_ParseLog_Call{Call: _e.mock.On("ParseLog", log)} +} + +func (_c *ArbitrumInboxInterface_ParseLog_Call) Run(run func(log types.Log)) *ArbitrumInboxInterface_ParseLog_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *ArbitrumInboxInterface_ParseLog_Call) Return(_a0 generated.AbigenLog, _a1 error) *ArbitrumInboxInterface_ParseLog_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbitrumInboxInterface_ParseLog_Call) RunAndReturn(run func(types.Log) (generated.AbigenLog, error)) *ArbitrumInboxInterface_ParseLog_Call { + _c.Call.Return(run) + return _c +} + +// Pause provides a mock function with given fields: opts +func (_m *ArbitrumInboxInterface) Pause(opts *bind.TransactOpts) (*types.Transaction, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for Pause") + } + + var r0 *types.Transaction + var r1 error + if rf, ok := ret.Get(0).(func(*bind.TransactOpts) (*types.Transaction, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.TransactOpts) *types.Transaction); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Transaction) + } + } + + if rf, ok := ret.Get(1).(func(*bind.TransactOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbitrumInboxInterface_Pause_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Pause' +type ArbitrumInboxInterface_Pause_Call struct { + *mock.Call +} + +// Pause is a helper method to define mock.On call +// - opts *bind.TransactOpts +func (_e *ArbitrumInboxInterface_Expecter) Pause(opts interface{}) *ArbitrumInboxInterface_Pause_Call { + return &ArbitrumInboxInterface_Pause_Call{Call: _e.mock.On("Pause", opts)} +} + +func (_c *ArbitrumInboxInterface_Pause_Call) Run(run func(opts *bind.TransactOpts)) *ArbitrumInboxInterface_Pause_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts)) + }) + return _c +} + +func (_c *ArbitrumInboxInterface_Pause_Call) Return(_a0 *types.Transaction, _a1 error) *ArbitrumInboxInterface_Pause_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbitrumInboxInterface_Pause_Call) RunAndReturn(run func(*bind.TransactOpts) (*types.Transaction, error)) *ArbitrumInboxInterface_Pause_Call { + _c.Call.Return(run) + return _c +} + +// SendContractTransaction provides a mock function with given fields: opts, gasLimit, maxFeePerGas, to, value, data +func (_m *ArbitrumInboxInterface) SendContractTransaction(opts *bind.TransactOpts, gasLimit *big.Int, maxFeePerGas *big.Int, to common.Address, value *big.Int, data []byte) (*types.Transaction, error) { + ret := _m.Called(opts, gasLimit, maxFeePerGas, to, value, data) + + if len(ret) == 0 { + panic("no return value specified for SendContractTransaction") + } + + var r0 *types.Transaction + var r1 error + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, *big.Int, *big.Int, common.Address, *big.Int, []byte) (*types.Transaction, error)); ok { + return rf(opts, gasLimit, maxFeePerGas, to, value, data) + } + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, *big.Int, *big.Int, common.Address, *big.Int, []byte) *types.Transaction); ok { + r0 = rf(opts, gasLimit, maxFeePerGas, to, value, data) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Transaction) + } + } + + if rf, ok := ret.Get(1).(func(*bind.TransactOpts, *big.Int, *big.Int, common.Address, *big.Int, []byte) error); ok { + r1 = rf(opts, gasLimit, maxFeePerGas, to, value, data) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbitrumInboxInterface_SendContractTransaction_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SendContractTransaction' +type ArbitrumInboxInterface_SendContractTransaction_Call struct { + *mock.Call +} + +// SendContractTransaction is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - gasLimit *big.Int +// - maxFeePerGas *big.Int +// - to common.Address +// - value *big.Int +// - data []byte +func (_e *ArbitrumInboxInterface_Expecter) SendContractTransaction(opts interface{}, gasLimit interface{}, maxFeePerGas interface{}, to interface{}, value interface{}, data interface{}) *ArbitrumInboxInterface_SendContractTransaction_Call { + return &ArbitrumInboxInterface_SendContractTransaction_Call{Call: _e.mock.On("SendContractTransaction", opts, gasLimit, maxFeePerGas, to, value, data)} +} + +func (_c *ArbitrumInboxInterface_SendContractTransaction_Call) Run(run func(opts *bind.TransactOpts, gasLimit *big.Int, maxFeePerGas *big.Int, to common.Address, value *big.Int, data []byte)) *ArbitrumInboxInterface_SendContractTransaction_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].(*big.Int), args[2].(*big.Int), args[3].(common.Address), args[4].(*big.Int), args[5].([]byte)) + }) + return _c +} + +func (_c *ArbitrumInboxInterface_SendContractTransaction_Call) Return(_a0 *types.Transaction, _a1 error) *ArbitrumInboxInterface_SendContractTransaction_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbitrumInboxInterface_SendContractTransaction_Call) RunAndReturn(run func(*bind.TransactOpts, *big.Int, *big.Int, common.Address, *big.Int, []byte) (*types.Transaction, error)) *ArbitrumInboxInterface_SendContractTransaction_Call { + _c.Call.Return(run) + return _c +} + +// SendL2Message provides a mock function with given fields: opts, messageData +func (_m *ArbitrumInboxInterface) SendL2Message(opts *bind.TransactOpts, messageData []byte) (*types.Transaction, error) { + ret := _m.Called(opts, messageData) + + if len(ret) == 0 { + panic("no return value specified for SendL2Message") + } + + var r0 *types.Transaction + var r1 error + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, []byte) (*types.Transaction, error)); ok { + return rf(opts, messageData) + } + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, []byte) *types.Transaction); ok { + r0 = rf(opts, messageData) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Transaction) + } + } + + if rf, ok := ret.Get(1).(func(*bind.TransactOpts, []byte) error); ok { + r1 = rf(opts, messageData) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbitrumInboxInterface_SendL2Message_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SendL2Message' +type ArbitrumInboxInterface_SendL2Message_Call struct { + *mock.Call +} + +// SendL2Message is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - messageData []byte +func (_e *ArbitrumInboxInterface_Expecter) SendL2Message(opts interface{}, messageData interface{}) *ArbitrumInboxInterface_SendL2Message_Call { + return &ArbitrumInboxInterface_SendL2Message_Call{Call: _e.mock.On("SendL2Message", opts, messageData)} +} + +func (_c *ArbitrumInboxInterface_SendL2Message_Call) Run(run func(opts *bind.TransactOpts, messageData []byte)) *ArbitrumInboxInterface_SendL2Message_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].([]byte)) + }) + return _c +} + +func (_c *ArbitrumInboxInterface_SendL2Message_Call) Return(_a0 *types.Transaction, _a1 error) *ArbitrumInboxInterface_SendL2Message_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbitrumInboxInterface_SendL2Message_Call) RunAndReturn(run func(*bind.TransactOpts, []byte) (*types.Transaction, error)) *ArbitrumInboxInterface_SendL2Message_Call { + _c.Call.Return(run) + return _c +} + +// SendL2MessageFromOrigin provides a mock function with given fields: opts, messageData +func (_m *ArbitrumInboxInterface) SendL2MessageFromOrigin(opts *bind.TransactOpts, messageData []byte) (*types.Transaction, error) { + ret := _m.Called(opts, messageData) + + if len(ret) == 0 { + panic("no return value specified for SendL2MessageFromOrigin") + } + + var r0 *types.Transaction + var r1 error + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, []byte) (*types.Transaction, error)); ok { + return rf(opts, messageData) + } + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, []byte) *types.Transaction); ok { + r0 = rf(opts, messageData) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Transaction) + } + } + + if rf, ok := ret.Get(1).(func(*bind.TransactOpts, []byte) error); ok { + r1 = rf(opts, messageData) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbitrumInboxInterface_SendL2MessageFromOrigin_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SendL2MessageFromOrigin' +type ArbitrumInboxInterface_SendL2MessageFromOrigin_Call struct { + *mock.Call +} + +// SendL2MessageFromOrigin is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - messageData []byte +func (_e *ArbitrumInboxInterface_Expecter) SendL2MessageFromOrigin(opts interface{}, messageData interface{}) *ArbitrumInboxInterface_SendL2MessageFromOrigin_Call { + return &ArbitrumInboxInterface_SendL2MessageFromOrigin_Call{Call: _e.mock.On("SendL2MessageFromOrigin", opts, messageData)} +} + +func (_c *ArbitrumInboxInterface_SendL2MessageFromOrigin_Call) Run(run func(opts *bind.TransactOpts, messageData []byte)) *ArbitrumInboxInterface_SendL2MessageFromOrigin_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].([]byte)) + }) + return _c +} + +func (_c *ArbitrumInboxInterface_SendL2MessageFromOrigin_Call) Return(_a0 *types.Transaction, _a1 error) *ArbitrumInboxInterface_SendL2MessageFromOrigin_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbitrumInboxInterface_SendL2MessageFromOrigin_Call) RunAndReturn(run func(*bind.TransactOpts, []byte) (*types.Transaction, error)) *ArbitrumInboxInterface_SendL2MessageFromOrigin_Call { + _c.Call.Return(run) + return _c +} + +// SendUnsignedTransaction provides a mock function with given fields: opts, gasLimit, maxFeePerGas, nonce, to, value, data +func (_m *ArbitrumInboxInterface) SendUnsignedTransaction(opts *bind.TransactOpts, gasLimit *big.Int, maxFeePerGas *big.Int, nonce *big.Int, to common.Address, value *big.Int, data []byte) (*types.Transaction, error) { + ret := _m.Called(opts, gasLimit, maxFeePerGas, nonce, to, value, data) + + if len(ret) == 0 { + panic("no return value specified for SendUnsignedTransaction") + } + + var r0 *types.Transaction + var r1 error + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, *big.Int, *big.Int, *big.Int, common.Address, *big.Int, []byte) (*types.Transaction, error)); ok { + return rf(opts, gasLimit, maxFeePerGas, nonce, to, value, data) + } + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, *big.Int, *big.Int, *big.Int, common.Address, *big.Int, []byte) *types.Transaction); ok { + r0 = rf(opts, gasLimit, maxFeePerGas, nonce, to, value, data) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Transaction) + } + } + + if rf, ok := ret.Get(1).(func(*bind.TransactOpts, *big.Int, *big.Int, *big.Int, common.Address, *big.Int, []byte) error); ok { + r1 = rf(opts, gasLimit, maxFeePerGas, nonce, to, value, data) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbitrumInboxInterface_SendUnsignedTransaction_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SendUnsignedTransaction' +type ArbitrumInboxInterface_SendUnsignedTransaction_Call struct { + *mock.Call +} + +// SendUnsignedTransaction is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - gasLimit *big.Int +// - maxFeePerGas *big.Int +// - nonce *big.Int +// - to common.Address +// - value *big.Int +// - data []byte +func (_e *ArbitrumInboxInterface_Expecter) SendUnsignedTransaction(opts interface{}, gasLimit interface{}, maxFeePerGas interface{}, nonce interface{}, to interface{}, value interface{}, data interface{}) *ArbitrumInboxInterface_SendUnsignedTransaction_Call { + return &ArbitrumInboxInterface_SendUnsignedTransaction_Call{Call: _e.mock.On("SendUnsignedTransaction", opts, gasLimit, maxFeePerGas, nonce, to, value, data)} +} + +func (_c *ArbitrumInboxInterface_SendUnsignedTransaction_Call) Run(run func(opts *bind.TransactOpts, gasLimit *big.Int, maxFeePerGas *big.Int, nonce *big.Int, to common.Address, value *big.Int, data []byte)) *ArbitrumInboxInterface_SendUnsignedTransaction_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].(*big.Int), args[2].(*big.Int), args[3].(*big.Int), args[4].(common.Address), args[5].(*big.Int), args[6].([]byte)) + }) + return _c +} + +func (_c *ArbitrumInboxInterface_SendUnsignedTransaction_Call) Return(_a0 *types.Transaction, _a1 error) *ArbitrumInboxInterface_SendUnsignedTransaction_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbitrumInboxInterface_SendUnsignedTransaction_Call) RunAndReturn(run func(*bind.TransactOpts, *big.Int, *big.Int, *big.Int, common.Address, *big.Int, []byte) (*types.Transaction, error)) *ArbitrumInboxInterface_SendUnsignedTransaction_Call { + _c.Call.Return(run) + return _c +} + +// SequencerInbox provides a mock function with given fields: opts +func (_m *ArbitrumInboxInterface) SequencerInbox(opts *bind.CallOpts) (common.Address, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for SequencerInbox") + } + + var r0 common.Address + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts) (common.Address, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts) common.Address); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Address) + } + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbitrumInboxInterface_SequencerInbox_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SequencerInbox' +type ArbitrumInboxInterface_SequencerInbox_Call struct { + *mock.Call +} + +// SequencerInbox is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *ArbitrumInboxInterface_Expecter) SequencerInbox(opts interface{}) *ArbitrumInboxInterface_SequencerInbox_Call { + return &ArbitrumInboxInterface_SequencerInbox_Call{Call: _e.mock.On("SequencerInbox", opts)} +} + +func (_c *ArbitrumInboxInterface_SequencerInbox_Call) Run(run func(opts *bind.CallOpts)) *ArbitrumInboxInterface_SequencerInbox_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *ArbitrumInboxInterface_SequencerInbox_Call) Return(_a0 common.Address, _a1 error) *ArbitrumInboxInterface_SequencerInbox_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbitrumInboxInterface_SequencerInbox_Call) RunAndReturn(run func(*bind.CallOpts) (common.Address, error)) *ArbitrumInboxInterface_SequencerInbox_Call { + _c.Call.Return(run) + return _c +} + +// SetAllowList provides a mock function with given fields: opts, user, val +func (_m *ArbitrumInboxInterface) SetAllowList(opts *bind.TransactOpts, user []common.Address, val []bool) (*types.Transaction, error) { + ret := _m.Called(opts, user, val) + + if len(ret) == 0 { + panic("no return value specified for SetAllowList") + } + + var r0 *types.Transaction + var r1 error + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, []common.Address, []bool) (*types.Transaction, error)); ok { + return rf(opts, user, val) + } + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, []common.Address, []bool) *types.Transaction); ok { + r0 = rf(opts, user, val) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Transaction) + } + } + + if rf, ok := ret.Get(1).(func(*bind.TransactOpts, []common.Address, []bool) error); ok { + r1 = rf(opts, user, val) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbitrumInboxInterface_SetAllowList_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetAllowList' +type ArbitrumInboxInterface_SetAllowList_Call struct { + *mock.Call +} + +// SetAllowList is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - user []common.Address +// - val []bool +func (_e *ArbitrumInboxInterface_Expecter) SetAllowList(opts interface{}, user interface{}, val interface{}) *ArbitrumInboxInterface_SetAllowList_Call { + return &ArbitrumInboxInterface_SetAllowList_Call{Call: _e.mock.On("SetAllowList", opts, user, val)} +} + +func (_c *ArbitrumInboxInterface_SetAllowList_Call) Run(run func(opts *bind.TransactOpts, user []common.Address, val []bool)) *ArbitrumInboxInterface_SetAllowList_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].([]common.Address), args[2].([]bool)) + }) + return _c +} + +func (_c *ArbitrumInboxInterface_SetAllowList_Call) Return(_a0 *types.Transaction, _a1 error) *ArbitrumInboxInterface_SetAllowList_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbitrumInboxInterface_SetAllowList_Call) RunAndReturn(run func(*bind.TransactOpts, []common.Address, []bool) (*types.Transaction, error)) *ArbitrumInboxInterface_SetAllowList_Call { + _c.Call.Return(run) + return _c +} + +// SetAllowListEnabled provides a mock function with given fields: opts, _allowListEnabled +func (_m *ArbitrumInboxInterface) SetAllowListEnabled(opts *bind.TransactOpts, _allowListEnabled bool) (*types.Transaction, error) { + ret := _m.Called(opts, _allowListEnabled) + + if len(ret) == 0 { + panic("no return value specified for SetAllowListEnabled") + } + + var r0 *types.Transaction + var r1 error + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, bool) (*types.Transaction, error)); ok { + return rf(opts, _allowListEnabled) + } + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, bool) *types.Transaction); ok { + r0 = rf(opts, _allowListEnabled) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Transaction) + } + } + + if rf, ok := ret.Get(1).(func(*bind.TransactOpts, bool) error); ok { + r1 = rf(opts, _allowListEnabled) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbitrumInboxInterface_SetAllowListEnabled_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetAllowListEnabled' +type ArbitrumInboxInterface_SetAllowListEnabled_Call struct { + *mock.Call +} + +// SetAllowListEnabled is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - _allowListEnabled bool +func (_e *ArbitrumInboxInterface_Expecter) SetAllowListEnabled(opts interface{}, _allowListEnabled interface{}) *ArbitrumInboxInterface_SetAllowListEnabled_Call { + return &ArbitrumInboxInterface_SetAllowListEnabled_Call{Call: _e.mock.On("SetAllowListEnabled", opts, _allowListEnabled)} +} + +func (_c *ArbitrumInboxInterface_SetAllowListEnabled_Call) Run(run func(opts *bind.TransactOpts, _allowListEnabled bool)) *ArbitrumInboxInterface_SetAllowListEnabled_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].(bool)) + }) + return _c +} + +func (_c *ArbitrumInboxInterface_SetAllowListEnabled_Call) Return(_a0 *types.Transaction, _a1 error) *ArbitrumInboxInterface_SetAllowListEnabled_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbitrumInboxInterface_SetAllowListEnabled_Call) RunAndReturn(run func(*bind.TransactOpts, bool) (*types.Transaction, error)) *ArbitrumInboxInterface_SetAllowListEnabled_Call { + _c.Call.Return(run) + return _c +} + +// Unpause provides a mock function with given fields: opts +func (_m *ArbitrumInboxInterface) Unpause(opts *bind.TransactOpts) (*types.Transaction, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for Unpause") + } + + var r0 *types.Transaction + var r1 error + if rf, ok := ret.Get(0).(func(*bind.TransactOpts) (*types.Transaction, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.TransactOpts) *types.Transaction); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Transaction) + } + } + + if rf, ok := ret.Get(1).(func(*bind.TransactOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbitrumInboxInterface_Unpause_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Unpause' +type ArbitrumInboxInterface_Unpause_Call struct { + *mock.Call +} + +// Unpause is a helper method to define mock.On call +// - opts *bind.TransactOpts +func (_e *ArbitrumInboxInterface_Expecter) Unpause(opts interface{}) *ArbitrumInboxInterface_Unpause_Call { + return &ArbitrumInboxInterface_Unpause_Call{Call: _e.mock.On("Unpause", opts)} +} + +func (_c *ArbitrumInboxInterface_Unpause_Call) Run(run func(opts *bind.TransactOpts)) *ArbitrumInboxInterface_Unpause_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts)) + }) + return _c +} + +func (_c *ArbitrumInboxInterface_Unpause_Call) Return(_a0 *types.Transaction, _a1 error) *ArbitrumInboxInterface_Unpause_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbitrumInboxInterface_Unpause_Call) RunAndReturn(run func(*bind.TransactOpts) (*types.Transaction, error)) *ArbitrumInboxInterface_Unpause_Call { + _c.Call.Return(run) + return _c +} + +// WatchInboxMessageDelivered provides a mock function with given fields: opts, sink, messageNum +func (_m *ArbitrumInboxInterface) WatchInboxMessageDelivered(opts *bind.WatchOpts, sink chan<- *arbitrum_inbox.ArbitrumInboxInboxMessageDelivered, messageNum []*big.Int) (event.Subscription, error) { + ret := _m.Called(opts, sink, messageNum) + + if len(ret) == 0 { + panic("no return value specified for WatchInboxMessageDelivered") + } + + var r0 event.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *arbitrum_inbox.ArbitrumInboxInboxMessageDelivered, []*big.Int) (event.Subscription, error)); ok { + return rf(opts, sink, messageNum) + } + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *arbitrum_inbox.ArbitrumInboxInboxMessageDelivered, []*big.Int) event.Subscription); ok { + r0 = rf(opts, sink, messageNum) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(event.Subscription) + } + } + + if rf, ok := ret.Get(1).(func(*bind.WatchOpts, chan<- *arbitrum_inbox.ArbitrumInboxInboxMessageDelivered, []*big.Int) error); ok { + r1 = rf(opts, sink, messageNum) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbitrumInboxInterface_WatchInboxMessageDelivered_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchInboxMessageDelivered' +type ArbitrumInboxInterface_WatchInboxMessageDelivered_Call struct { + *mock.Call +} + +// WatchInboxMessageDelivered is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *arbitrum_inbox.ArbitrumInboxInboxMessageDelivered +// - messageNum []*big.Int +func (_e *ArbitrumInboxInterface_Expecter) WatchInboxMessageDelivered(opts interface{}, sink interface{}, messageNum interface{}) *ArbitrumInboxInterface_WatchInboxMessageDelivered_Call { + return &ArbitrumInboxInterface_WatchInboxMessageDelivered_Call{Call: _e.mock.On("WatchInboxMessageDelivered", opts, sink, messageNum)} +} + +func (_c *ArbitrumInboxInterface_WatchInboxMessageDelivered_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *arbitrum_inbox.ArbitrumInboxInboxMessageDelivered, messageNum []*big.Int)) *ArbitrumInboxInterface_WatchInboxMessageDelivered_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *arbitrum_inbox.ArbitrumInboxInboxMessageDelivered), args[2].([]*big.Int)) + }) + return _c +} + +func (_c *ArbitrumInboxInterface_WatchInboxMessageDelivered_Call) Return(_a0 event.Subscription, _a1 error) *ArbitrumInboxInterface_WatchInboxMessageDelivered_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbitrumInboxInterface_WatchInboxMessageDelivered_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *arbitrum_inbox.ArbitrumInboxInboxMessageDelivered, []*big.Int) (event.Subscription, error)) *ArbitrumInboxInterface_WatchInboxMessageDelivered_Call { + _c.Call.Return(run) + return _c +} + +// WatchInboxMessageDeliveredFromOrigin provides a mock function with given fields: opts, sink, messageNum +func (_m *ArbitrumInboxInterface) WatchInboxMessageDeliveredFromOrigin(opts *bind.WatchOpts, sink chan<- *arbitrum_inbox.ArbitrumInboxInboxMessageDeliveredFromOrigin, messageNum []*big.Int) (event.Subscription, error) { + ret := _m.Called(opts, sink, messageNum) + + if len(ret) == 0 { + panic("no return value specified for WatchInboxMessageDeliveredFromOrigin") + } + + var r0 event.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *arbitrum_inbox.ArbitrumInboxInboxMessageDeliveredFromOrigin, []*big.Int) (event.Subscription, error)); ok { + return rf(opts, sink, messageNum) + } + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *arbitrum_inbox.ArbitrumInboxInboxMessageDeliveredFromOrigin, []*big.Int) event.Subscription); ok { + r0 = rf(opts, sink, messageNum) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(event.Subscription) + } + } + + if rf, ok := ret.Get(1).(func(*bind.WatchOpts, chan<- *arbitrum_inbox.ArbitrumInboxInboxMessageDeliveredFromOrigin, []*big.Int) error); ok { + r1 = rf(opts, sink, messageNum) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbitrumInboxInterface_WatchInboxMessageDeliveredFromOrigin_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchInboxMessageDeliveredFromOrigin' +type ArbitrumInboxInterface_WatchInboxMessageDeliveredFromOrigin_Call struct { + *mock.Call +} + +// WatchInboxMessageDeliveredFromOrigin is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *arbitrum_inbox.ArbitrumInboxInboxMessageDeliveredFromOrigin +// - messageNum []*big.Int +func (_e *ArbitrumInboxInterface_Expecter) WatchInboxMessageDeliveredFromOrigin(opts interface{}, sink interface{}, messageNum interface{}) *ArbitrumInboxInterface_WatchInboxMessageDeliveredFromOrigin_Call { + return &ArbitrumInboxInterface_WatchInboxMessageDeliveredFromOrigin_Call{Call: _e.mock.On("WatchInboxMessageDeliveredFromOrigin", opts, sink, messageNum)} +} + +func (_c *ArbitrumInboxInterface_WatchInboxMessageDeliveredFromOrigin_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *arbitrum_inbox.ArbitrumInboxInboxMessageDeliveredFromOrigin, messageNum []*big.Int)) *ArbitrumInboxInterface_WatchInboxMessageDeliveredFromOrigin_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *arbitrum_inbox.ArbitrumInboxInboxMessageDeliveredFromOrigin), args[2].([]*big.Int)) + }) + return _c +} + +func (_c *ArbitrumInboxInterface_WatchInboxMessageDeliveredFromOrigin_Call) Return(_a0 event.Subscription, _a1 error) *ArbitrumInboxInterface_WatchInboxMessageDeliveredFromOrigin_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbitrumInboxInterface_WatchInboxMessageDeliveredFromOrigin_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *arbitrum_inbox.ArbitrumInboxInboxMessageDeliveredFromOrigin, []*big.Int) (event.Subscription, error)) *ArbitrumInboxInterface_WatchInboxMessageDeliveredFromOrigin_Call { + _c.Call.Return(run) + return _c +} + +// NewArbitrumInboxInterface creates a new instance of ArbitrumInboxInterface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewArbitrumInboxInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *ArbitrumInboxInterface { + mock := &ArbitrumInboxInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/core/gethwrappers/liquiditymanager/mocks/mock_arbitrum_l1_bridge_adapter/arbitrum_l1_bridge_adapter_interface.go b/core/gethwrappers/liquiditymanager/mocks/mock_arbitrum_l1_bridge_adapter/arbitrum_l1_bridge_adapter_interface.go new file mode 100644 index 00000000000..94c24efa200 --- /dev/null +++ b/core/gethwrappers/liquiditymanager/mocks/mock_arbitrum_l1_bridge_adapter/arbitrum_l1_bridge_adapter_interface.go @@ -0,0 +1,426 @@ +// Code generated by mockery v2.43.2. DO NOT EDIT. + +package mock_arbitrum_l1_bridge_adapter + +import ( + big "math/big" + + arbitrum_l1_bridge_adapter "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/liquiditymanager/generated/arbitrum_l1_bridge_adapter" + + bind "github.com/ethereum/go-ethereum/accounts/abi/bind" + + common "github.com/ethereum/go-ethereum/common" + + mock "github.com/stretchr/testify/mock" + + types "github.com/ethereum/go-ethereum/core/types" +) + +// ArbitrumL1BridgeAdapterInterface is an autogenerated mock type for the ArbitrumL1BridgeAdapterInterface type +type ArbitrumL1BridgeAdapterInterface struct { + mock.Mock +} + +type ArbitrumL1BridgeAdapterInterface_Expecter struct { + mock *mock.Mock +} + +func (_m *ArbitrumL1BridgeAdapterInterface) EXPECT() *ArbitrumL1BridgeAdapterInterface_Expecter { + return &ArbitrumL1BridgeAdapterInterface_Expecter{mock: &_m.Mock} +} + +// Address provides a mock function with given fields: +func (_m *ArbitrumL1BridgeAdapterInterface) Address() common.Address { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Address") + } + + var r0 common.Address + if rf, ok := ret.Get(0).(func() common.Address); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Address) + } + } + + return r0 +} + +// ArbitrumL1BridgeAdapterInterface_Address_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Address' +type ArbitrumL1BridgeAdapterInterface_Address_Call struct { + *mock.Call +} + +// Address is a helper method to define mock.On call +func (_e *ArbitrumL1BridgeAdapterInterface_Expecter) Address() *ArbitrumL1BridgeAdapterInterface_Address_Call { + return &ArbitrumL1BridgeAdapterInterface_Address_Call{Call: _e.mock.On("Address")} +} + +func (_c *ArbitrumL1BridgeAdapterInterface_Address_Call) Run(run func()) *ArbitrumL1BridgeAdapterInterface_Address_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ArbitrumL1BridgeAdapterInterface_Address_Call) Return(_a0 common.Address) *ArbitrumL1BridgeAdapterInterface_Address_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ArbitrumL1BridgeAdapterInterface_Address_Call) RunAndReturn(run func() common.Address) *ArbitrumL1BridgeAdapterInterface_Address_Call { + _c.Call.Return(run) + return _c +} + +// ExposeArbitrumFinalizationPayload provides a mock function with given fields: opts, payload +func (_m *ArbitrumL1BridgeAdapterInterface) ExposeArbitrumFinalizationPayload(opts *bind.CallOpts, payload arbitrum_l1_bridge_adapter.ArbitrumL1BridgeAdapterArbitrumFinalizationPayload) error { + ret := _m.Called(opts, payload) + + if len(ret) == 0 { + panic("no return value specified for ExposeArbitrumFinalizationPayload") + } + + var r0 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts, arbitrum_l1_bridge_adapter.ArbitrumL1BridgeAdapterArbitrumFinalizationPayload) error); ok { + r0 = rf(opts, payload) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// ArbitrumL1BridgeAdapterInterface_ExposeArbitrumFinalizationPayload_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ExposeArbitrumFinalizationPayload' +type ArbitrumL1BridgeAdapterInterface_ExposeArbitrumFinalizationPayload_Call struct { + *mock.Call +} + +// ExposeArbitrumFinalizationPayload is a helper method to define mock.On call +// - opts *bind.CallOpts +// - payload arbitrum_l1_bridge_adapter.ArbitrumL1BridgeAdapterArbitrumFinalizationPayload +func (_e *ArbitrumL1BridgeAdapterInterface_Expecter) ExposeArbitrumFinalizationPayload(opts interface{}, payload interface{}) *ArbitrumL1BridgeAdapterInterface_ExposeArbitrumFinalizationPayload_Call { + return &ArbitrumL1BridgeAdapterInterface_ExposeArbitrumFinalizationPayload_Call{Call: _e.mock.On("ExposeArbitrumFinalizationPayload", opts, payload)} +} + +func (_c *ArbitrumL1BridgeAdapterInterface_ExposeArbitrumFinalizationPayload_Call) Run(run func(opts *bind.CallOpts, payload arbitrum_l1_bridge_adapter.ArbitrumL1BridgeAdapterArbitrumFinalizationPayload)) *ArbitrumL1BridgeAdapterInterface_ExposeArbitrumFinalizationPayload_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts), args[1].(arbitrum_l1_bridge_adapter.ArbitrumL1BridgeAdapterArbitrumFinalizationPayload)) + }) + return _c +} + +func (_c *ArbitrumL1BridgeAdapterInterface_ExposeArbitrumFinalizationPayload_Call) Return(_a0 error) *ArbitrumL1BridgeAdapterInterface_ExposeArbitrumFinalizationPayload_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ArbitrumL1BridgeAdapterInterface_ExposeArbitrumFinalizationPayload_Call) RunAndReturn(run func(*bind.CallOpts, arbitrum_l1_bridge_adapter.ArbitrumL1BridgeAdapterArbitrumFinalizationPayload) error) *ArbitrumL1BridgeAdapterInterface_ExposeArbitrumFinalizationPayload_Call { + _c.Call.Return(run) + return _c +} + +// ExposeSendERC20Params provides a mock function with given fields: opts, params +func (_m *ArbitrumL1BridgeAdapterInterface) ExposeSendERC20Params(opts *bind.CallOpts, params arbitrum_l1_bridge_adapter.ArbitrumL1BridgeAdapterSendERC20Params) error { + ret := _m.Called(opts, params) + + if len(ret) == 0 { + panic("no return value specified for ExposeSendERC20Params") + } + + var r0 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts, arbitrum_l1_bridge_adapter.ArbitrumL1BridgeAdapterSendERC20Params) error); ok { + r0 = rf(opts, params) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// ArbitrumL1BridgeAdapterInterface_ExposeSendERC20Params_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ExposeSendERC20Params' +type ArbitrumL1BridgeAdapterInterface_ExposeSendERC20Params_Call struct { + *mock.Call +} + +// ExposeSendERC20Params is a helper method to define mock.On call +// - opts *bind.CallOpts +// - params arbitrum_l1_bridge_adapter.ArbitrumL1BridgeAdapterSendERC20Params +func (_e *ArbitrumL1BridgeAdapterInterface_Expecter) ExposeSendERC20Params(opts interface{}, params interface{}) *ArbitrumL1BridgeAdapterInterface_ExposeSendERC20Params_Call { + return &ArbitrumL1BridgeAdapterInterface_ExposeSendERC20Params_Call{Call: _e.mock.On("ExposeSendERC20Params", opts, params)} +} + +func (_c *ArbitrumL1BridgeAdapterInterface_ExposeSendERC20Params_Call) Run(run func(opts *bind.CallOpts, params arbitrum_l1_bridge_adapter.ArbitrumL1BridgeAdapterSendERC20Params)) *ArbitrumL1BridgeAdapterInterface_ExposeSendERC20Params_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts), args[1].(arbitrum_l1_bridge_adapter.ArbitrumL1BridgeAdapterSendERC20Params)) + }) + return _c +} + +func (_c *ArbitrumL1BridgeAdapterInterface_ExposeSendERC20Params_Call) Return(_a0 error) *ArbitrumL1BridgeAdapterInterface_ExposeSendERC20Params_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ArbitrumL1BridgeAdapterInterface_ExposeSendERC20Params_Call) RunAndReturn(run func(*bind.CallOpts, arbitrum_l1_bridge_adapter.ArbitrumL1BridgeAdapterSendERC20Params) error) *ArbitrumL1BridgeAdapterInterface_ExposeSendERC20Params_Call { + _c.Call.Return(run) + return _c +} + +// FinalizeWithdrawERC20 provides a mock function with given fields: opts, arg0, arg1, arbitrumFinalizationPayload +func (_m *ArbitrumL1BridgeAdapterInterface) FinalizeWithdrawERC20(opts *bind.TransactOpts, arg0 common.Address, arg1 common.Address, arbitrumFinalizationPayload []byte) (*types.Transaction, error) { + ret := _m.Called(opts, arg0, arg1, arbitrumFinalizationPayload) + + if len(ret) == 0 { + panic("no return value specified for FinalizeWithdrawERC20") + } + + var r0 *types.Transaction + var r1 error + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, common.Address, common.Address, []byte) (*types.Transaction, error)); ok { + return rf(opts, arg0, arg1, arbitrumFinalizationPayload) + } + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, common.Address, common.Address, []byte) *types.Transaction); ok { + r0 = rf(opts, arg0, arg1, arbitrumFinalizationPayload) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Transaction) + } + } + + if rf, ok := ret.Get(1).(func(*bind.TransactOpts, common.Address, common.Address, []byte) error); ok { + r1 = rf(opts, arg0, arg1, arbitrumFinalizationPayload) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbitrumL1BridgeAdapterInterface_FinalizeWithdrawERC20_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FinalizeWithdrawERC20' +type ArbitrumL1BridgeAdapterInterface_FinalizeWithdrawERC20_Call struct { + *mock.Call +} + +// FinalizeWithdrawERC20 is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - arg0 common.Address +// - arg1 common.Address +// - arbitrumFinalizationPayload []byte +func (_e *ArbitrumL1BridgeAdapterInterface_Expecter) FinalizeWithdrawERC20(opts interface{}, arg0 interface{}, arg1 interface{}, arbitrumFinalizationPayload interface{}) *ArbitrumL1BridgeAdapterInterface_FinalizeWithdrawERC20_Call { + return &ArbitrumL1BridgeAdapterInterface_FinalizeWithdrawERC20_Call{Call: _e.mock.On("FinalizeWithdrawERC20", opts, arg0, arg1, arbitrumFinalizationPayload)} +} + +func (_c *ArbitrumL1BridgeAdapterInterface_FinalizeWithdrawERC20_Call) Run(run func(opts *bind.TransactOpts, arg0 common.Address, arg1 common.Address, arbitrumFinalizationPayload []byte)) *ArbitrumL1BridgeAdapterInterface_FinalizeWithdrawERC20_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].(common.Address), args[2].(common.Address), args[3].([]byte)) + }) + return _c +} + +func (_c *ArbitrumL1BridgeAdapterInterface_FinalizeWithdrawERC20_Call) Return(_a0 *types.Transaction, _a1 error) *ArbitrumL1BridgeAdapterInterface_FinalizeWithdrawERC20_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbitrumL1BridgeAdapterInterface_FinalizeWithdrawERC20_Call) RunAndReturn(run func(*bind.TransactOpts, common.Address, common.Address, []byte) (*types.Transaction, error)) *ArbitrumL1BridgeAdapterInterface_FinalizeWithdrawERC20_Call { + _c.Call.Return(run) + return _c +} + +// GetBridgeFeeInNative provides a mock function with given fields: opts +func (_m *ArbitrumL1BridgeAdapterInterface) GetBridgeFeeInNative(opts *bind.CallOpts) (*big.Int, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for GetBridgeFeeInNative") + } + + var r0 *big.Int + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts) (*big.Int, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts) *big.Int); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*big.Int) + } + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbitrumL1BridgeAdapterInterface_GetBridgeFeeInNative_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetBridgeFeeInNative' +type ArbitrumL1BridgeAdapterInterface_GetBridgeFeeInNative_Call struct { + *mock.Call +} + +// GetBridgeFeeInNative is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *ArbitrumL1BridgeAdapterInterface_Expecter) GetBridgeFeeInNative(opts interface{}) *ArbitrumL1BridgeAdapterInterface_GetBridgeFeeInNative_Call { + return &ArbitrumL1BridgeAdapterInterface_GetBridgeFeeInNative_Call{Call: _e.mock.On("GetBridgeFeeInNative", opts)} +} + +func (_c *ArbitrumL1BridgeAdapterInterface_GetBridgeFeeInNative_Call) Run(run func(opts *bind.CallOpts)) *ArbitrumL1BridgeAdapterInterface_GetBridgeFeeInNative_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *ArbitrumL1BridgeAdapterInterface_GetBridgeFeeInNative_Call) Return(_a0 *big.Int, _a1 error) *ArbitrumL1BridgeAdapterInterface_GetBridgeFeeInNative_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbitrumL1BridgeAdapterInterface_GetBridgeFeeInNative_Call) RunAndReturn(run func(*bind.CallOpts) (*big.Int, error)) *ArbitrumL1BridgeAdapterInterface_GetBridgeFeeInNative_Call { + _c.Call.Return(run) + return _c +} + +// GetL2Token provides a mock function with given fields: opts, l1Token +func (_m *ArbitrumL1BridgeAdapterInterface) GetL2Token(opts *bind.CallOpts, l1Token common.Address) (common.Address, error) { + ret := _m.Called(opts, l1Token) + + if len(ret) == 0 { + panic("no return value specified for GetL2Token") + } + + var r0 common.Address + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts, common.Address) (common.Address, error)); ok { + return rf(opts, l1Token) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts, common.Address) common.Address); ok { + r0 = rf(opts, l1Token) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Address) + } + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts, common.Address) error); ok { + r1 = rf(opts, l1Token) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbitrumL1BridgeAdapterInterface_GetL2Token_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetL2Token' +type ArbitrumL1BridgeAdapterInterface_GetL2Token_Call struct { + *mock.Call +} + +// GetL2Token is a helper method to define mock.On call +// - opts *bind.CallOpts +// - l1Token common.Address +func (_e *ArbitrumL1BridgeAdapterInterface_Expecter) GetL2Token(opts interface{}, l1Token interface{}) *ArbitrumL1BridgeAdapterInterface_GetL2Token_Call { + return &ArbitrumL1BridgeAdapterInterface_GetL2Token_Call{Call: _e.mock.On("GetL2Token", opts, l1Token)} +} + +func (_c *ArbitrumL1BridgeAdapterInterface_GetL2Token_Call) Run(run func(opts *bind.CallOpts, l1Token common.Address)) *ArbitrumL1BridgeAdapterInterface_GetL2Token_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts), args[1].(common.Address)) + }) + return _c +} + +func (_c *ArbitrumL1BridgeAdapterInterface_GetL2Token_Call) Return(_a0 common.Address, _a1 error) *ArbitrumL1BridgeAdapterInterface_GetL2Token_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbitrumL1BridgeAdapterInterface_GetL2Token_Call) RunAndReturn(run func(*bind.CallOpts, common.Address) (common.Address, error)) *ArbitrumL1BridgeAdapterInterface_GetL2Token_Call { + _c.Call.Return(run) + return _c +} + +// SendERC20 provides a mock function with given fields: opts, localToken, arg1, recipient, amount, bridgeSpecificPayload +func (_m *ArbitrumL1BridgeAdapterInterface) SendERC20(opts *bind.TransactOpts, localToken common.Address, arg1 common.Address, recipient common.Address, amount *big.Int, bridgeSpecificPayload []byte) (*types.Transaction, error) { + ret := _m.Called(opts, localToken, arg1, recipient, amount, bridgeSpecificPayload) + + if len(ret) == 0 { + panic("no return value specified for SendERC20") + } + + var r0 *types.Transaction + var r1 error + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, common.Address, common.Address, common.Address, *big.Int, []byte) (*types.Transaction, error)); ok { + return rf(opts, localToken, arg1, recipient, amount, bridgeSpecificPayload) + } + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, common.Address, common.Address, common.Address, *big.Int, []byte) *types.Transaction); ok { + r0 = rf(opts, localToken, arg1, recipient, amount, bridgeSpecificPayload) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Transaction) + } + } + + if rf, ok := ret.Get(1).(func(*bind.TransactOpts, common.Address, common.Address, common.Address, *big.Int, []byte) error); ok { + r1 = rf(opts, localToken, arg1, recipient, amount, bridgeSpecificPayload) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbitrumL1BridgeAdapterInterface_SendERC20_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SendERC20' +type ArbitrumL1BridgeAdapterInterface_SendERC20_Call struct { + *mock.Call +} + +// SendERC20 is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - localToken common.Address +// - arg1 common.Address +// - recipient common.Address +// - amount *big.Int +// - bridgeSpecificPayload []byte +func (_e *ArbitrumL1BridgeAdapterInterface_Expecter) SendERC20(opts interface{}, localToken interface{}, arg1 interface{}, recipient interface{}, amount interface{}, bridgeSpecificPayload interface{}) *ArbitrumL1BridgeAdapterInterface_SendERC20_Call { + return &ArbitrumL1BridgeAdapterInterface_SendERC20_Call{Call: _e.mock.On("SendERC20", opts, localToken, arg1, recipient, amount, bridgeSpecificPayload)} +} + +func (_c *ArbitrumL1BridgeAdapterInterface_SendERC20_Call) Run(run func(opts *bind.TransactOpts, localToken common.Address, arg1 common.Address, recipient common.Address, amount *big.Int, bridgeSpecificPayload []byte)) *ArbitrumL1BridgeAdapterInterface_SendERC20_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].(common.Address), args[2].(common.Address), args[3].(common.Address), args[4].(*big.Int), args[5].([]byte)) + }) + return _c +} + +func (_c *ArbitrumL1BridgeAdapterInterface_SendERC20_Call) Return(_a0 *types.Transaction, _a1 error) *ArbitrumL1BridgeAdapterInterface_SendERC20_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbitrumL1BridgeAdapterInterface_SendERC20_Call) RunAndReturn(run func(*bind.TransactOpts, common.Address, common.Address, common.Address, *big.Int, []byte) (*types.Transaction, error)) *ArbitrumL1BridgeAdapterInterface_SendERC20_Call { + _c.Call.Return(run) + return _c +} + +// NewArbitrumL1BridgeAdapterInterface creates a new instance of ArbitrumL1BridgeAdapterInterface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewArbitrumL1BridgeAdapterInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *ArbitrumL1BridgeAdapterInterface { + mock := &ArbitrumL1BridgeAdapterInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/core/gethwrappers/liquiditymanager/mocks/mock_arbitrum_l2_bridge_adapter/arbitrum_l2_bridge_adapter_interface.go b/core/gethwrappers/liquiditymanager/mocks/mock_arbitrum_l2_bridge_adapter/arbitrum_l2_bridge_adapter_interface.go new file mode 100644 index 00000000000..01d025790a6 --- /dev/null +++ b/core/gethwrappers/liquiditymanager/mocks/mock_arbitrum_l2_bridge_adapter/arbitrum_l2_bridge_adapter_interface.go @@ -0,0 +1,327 @@ +// Code generated by mockery v2.43.2. DO NOT EDIT. + +package mock_arbitrum_l2_bridge_adapter + +import ( + big "math/big" + + bind "github.com/ethereum/go-ethereum/accounts/abi/bind" + common "github.com/ethereum/go-ethereum/common" + + mock "github.com/stretchr/testify/mock" + + types "github.com/ethereum/go-ethereum/core/types" +) + +// ArbitrumL2BridgeAdapterInterface is an autogenerated mock type for the ArbitrumL2BridgeAdapterInterface type +type ArbitrumL2BridgeAdapterInterface struct { + mock.Mock +} + +type ArbitrumL2BridgeAdapterInterface_Expecter struct { + mock *mock.Mock +} + +func (_m *ArbitrumL2BridgeAdapterInterface) EXPECT() *ArbitrumL2BridgeAdapterInterface_Expecter { + return &ArbitrumL2BridgeAdapterInterface_Expecter{mock: &_m.Mock} +} + +// Address provides a mock function with given fields: +func (_m *ArbitrumL2BridgeAdapterInterface) Address() common.Address { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Address") + } + + var r0 common.Address + if rf, ok := ret.Get(0).(func() common.Address); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Address) + } + } + + return r0 +} + +// ArbitrumL2BridgeAdapterInterface_Address_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Address' +type ArbitrumL2BridgeAdapterInterface_Address_Call struct { + *mock.Call +} + +// Address is a helper method to define mock.On call +func (_e *ArbitrumL2BridgeAdapterInterface_Expecter) Address() *ArbitrumL2BridgeAdapterInterface_Address_Call { + return &ArbitrumL2BridgeAdapterInterface_Address_Call{Call: _e.mock.On("Address")} +} + +func (_c *ArbitrumL2BridgeAdapterInterface_Address_Call) Run(run func()) *ArbitrumL2BridgeAdapterInterface_Address_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ArbitrumL2BridgeAdapterInterface_Address_Call) Return(_a0 common.Address) *ArbitrumL2BridgeAdapterInterface_Address_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ArbitrumL2BridgeAdapterInterface_Address_Call) RunAndReturn(run func() common.Address) *ArbitrumL2BridgeAdapterInterface_Address_Call { + _c.Call.Return(run) + return _c +} + +// DepositNativeToL1 provides a mock function with given fields: opts, recipient +func (_m *ArbitrumL2BridgeAdapterInterface) DepositNativeToL1(opts *bind.TransactOpts, recipient common.Address) (*types.Transaction, error) { + ret := _m.Called(opts, recipient) + + if len(ret) == 0 { + panic("no return value specified for DepositNativeToL1") + } + + var r0 *types.Transaction + var r1 error + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, common.Address) (*types.Transaction, error)); ok { + return rf(opts, recipient) + } + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, common.Address) *types.Transaction); ok { + r0 = rf(opts, recipient) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Transaction) + } + } + + if rf, ok := ret.Get(1).(func(*bind.TransactOpts, common.Address) error); ok { + r1 = rf(opts, recipient) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbitrumL2BridgeAdapterInterface_DepositNativeToL1_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DepositNativeToL1' +type ArbitrumL2BridgeAdapterInterface_DepositNativeToL1_Call struct { + *mock.Call +} + +// DepositNativeToL1 is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - recipient common.Address +func (_e *ArbitrumL2BridgeAdapterInterface_Expecter) DepositNativeToL1(opts interface{}, recipient interface{}) *ArbitrumL2BridgeAdapterInterface_DepositNativeToL1_Call { + return &ArbitrumL2BridgeAdapterInterface_DepositNativeToL1_Call{Call: _e.mock.On("DepositNativeToL1", opts, recipient)} +} + +func (_c *ArbitrumL2BridgeAdapterInterface_DepositNativeToL1_Call) Run(run func(opts *bind.TransactOpts, recipient common.Address)) *ArbitrumL2BridgeAdapterInterface_DepositNativeToL1_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].(common.Address)) + }) + return _c +} + +func (_c *ArbitrumL2BridgeAdapterInterface_DepositNativeToL1_Call) Return(_a0 *types.Transaction, _a1 error) *ArbitrumL2BridgeAdapterInterface_DepositNativeToL1_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbitrumL2BridgeAdapterInterface_DepositNativeToL1_Call) RunAndReturn(run func(*bind.TransactOpts, common.Address) (*types.Transaction, error)) *ArbitrumL2BridgeAdapterInterface_DepositNativeToL1_Call { + _c.Call.Return(run) + return _c +} + +// FinalizeWithdrawERC20 provides a mock function with given fields: opts, arg0, arg1, arg2 +func (_m *ArbitrumL2BridgeAdapterInterface) FinalizeWithdrawERC20(opts *bind.CallOpts, arg0 common.Address, arg1 common.Address, arg2 []byte) (bool, error) { + ret := _m.Called(opts, arg0, arg1, arg2) + + if len(ret) == 0 { + panic("no return value specified for FinalizeWithdrawERC20") + } + + var r0 bool + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts, common.Address, common.Address, []byte) (bool, error)); ok { + return rf(opts, arg0, arg1, arg2) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts, common.Address, common.Address, []byte) bool); ok { + r0 = rf(opts, arg0, arg1, arg2) + } else { + r0 = ret.Get(0).(bool) + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts, common.Address, common.Address, []byte) error); ok { + r1 = rf(opts, arg0, arg1, arg2) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbitrumL2BridgeAdapterInterface_FinalizeWithdrawERC20_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FinalizeWithdrawERC20' +type ArbitrumL2BridgeAdapterInterface_FinalizeWithdrawERC20_Call struct { + *mock.Call +} + +// FinalizeWithdrawERC20 is a helper method to define mock.On call +// - opts *bind.CallOpts +// - arg0 common.Address +// - arg1 common.Address +// - arg2 []byte +func (_e *ArbitrumL2BridgeAdapterInterface_Expecter) FinalizeWithdrawERC20(opts interface{}, arg0 interface{}, arg1 interface{}, arg2 interface{}) *ArbitrumL2BridgeAdapterInterface_FinalizeWithdrawERC20_Call { + return &ArbitrumL2BridgeAdapterInterface_FinalizeWithdrawERC20_Call{Call: _e.mock.On("FinalizeWithdrawERC20", opts, arg0, arg1, arg2)} +} + +func (_c *ArbitrumL2BridgeAdapterInterface_FinalizeWithdrawERC20_Call) Run(run func(opts *bind.CallOpts, arg0 common.Address, arg1 common.Address, arg2 []byte)) *ArbitrumL2BridgeAdapterInterface_FinalizeWithdrawERC20_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts), args[1].(common.Address), args[2].(common.Address), args[3].([]byte)) + }) + return _c +} + +func (_c *ArbitrumL2BridgeAdapterInterface_FinalizeWithdrawERC20_Call) Return(_a0 bool, _a1 error) *ArbitrumL2BridgeAdapterInterface_FinalizeWithdrawERC20_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbitrumL2BridgeAdapterInterface_FinalizeWithdrawERC20_Call) RunAndReturn(run func(*bind.CallOpts, common.Address, common.Address, []byte) (bool, error)) *ArbitrumL2BridgeAdapterInterface_FinalizeWithdrawERC20_Call { + _c.Call.Return(run) + return _c +} + +// GetBridgeFeeInNative provides a mock function with given fields: opts +func (_m *ArbitrumL2BridgeAdapterInterface) GetBridgeFeeInNative(opts *bind.CallOpts) (*big.Int, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for GetBridgeFeeInNative") + } + + var r0 *big.Int + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts) (*big.Int, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts) *big.Int); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*big.Int) + } + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbitrumL2BridgeAdapterInterface_GetBridgeFeeInNative_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetBridgeFeeInNative' +type ArbitrumL2BridgeAdapterInterface_GetBridgeFeeInNative_Call struct { + *mock.Call +} + +// GetBridgeFeeInNative is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *ArbitrumL2BridgeAdapterInterface_Expecter) GetBridgeFeeInNative(opts interface{}) *ArbitrumL2BridgeAdapterInterface_GetBridgeFeeInNative_Call { + return &ArbitrumL2BridgeAdapterInterface_GetBridgeFeeInNative_Call{Call: _e.mock.On("GetBridgeFeeInNative", opts)} +} + +func (_c *ArbitrumL2BridgeAdapterInterface_GetBridgeFeeInNative_Call) Run(run func(opts *bind.CallOpts)) *ArbitrumL2BridgeAdapterInterface_GetBridgeFeeInNative_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *ArbitrumL2BridgeAdapterInterface_GetBridgeFeeInNative_Call) Return(_a0 *big.Int, _a1 error) *ArbitrumL2BridgeAdapterInterface_GetBridgeFeeInNative_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbitrumL2BridgeAdapterInterface_GetBridgeFeeInNative_Call) RunAndReturn(run func(*bind.CallOpts) (*big.Int, error)) *ArbitrumL2BridgeAdapterInterface_GetBridgeFeeInNative_Call { + _c.Call.Return(run) + return _c +} + +// SendERC20 provides a mock function with given fields: opts, localToken, remoteToken, recipient, amount, arg4 +func (_m *ArbitrumL2BridgeAdapterInterface) SendERC20(opts *bind.TransactOpts, localToken common.Address, remoteToken common.Address, recipient common.Address, amount *big.Int, arg4 []byte) (*types.Transaction, error) { + ret := _m.Called(opts, localToken, remoteToken, recipient, amount, arg4) + + if len(ret) == 0 { + panic("no return value specified for SendERC20") + } + + var r0 *types.Transaction + var r1 error + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, common.Address, common.Address, common.Address, *big.Int, []byte) (*types.Transaction, error)); ok { + return rf(opts, localToken, remoteToken, recipient, amount, arg4) + } + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, common.Address, common.Address, common.Address, *big.Int, []byte) *types.Transaction); ok { + r0 = rf(opts, localToken, remoteToken, recipient, amount, arg4) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Transaction) + } + } + + if rf, ok := ret.Get(1).(func(*bind.TransactOpts, common.Address, common.Address, common.Address, *big.Int, []byte) error); ok { + r1 = rf(opts, localToken, remoteToken, recipient, amount, arg4) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbitrumL2BridgeAdapterInterface_SendERC20_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SendERC20' +type ArbitrumL2BridgeAdapterInterface_SendERC20_Call struct { + *mock.Call +} + +// SendERC20 is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - localToken common.Address +// - remoteToken common.Address +// - recipient common.Address +// - amount *big.Int +// - arg4 []byte +func (_e *ArbitrumL2BridgeAdapterInterface_Expecter) SendERC20(opts interface{}, localToken interface{}, remoteToken interface{}, recipient interface{}, amount interface{}, arg4 interface{}) *ArbitrumL2BridgeAdapterInterface_SendERC20_Call { + return &ArbitrumL2BridgeAdapterInterface_SendERC20_Call{Call: _e.mock.On("SendERC20", opts, localToken, remoteToken, recipient, amount, arg4)} +} + +func (_c *ArbitrumL2BridgeAdapterInterface_SendERC20_Call) Run(run func(opts *bind.TransactOpts, localToken common.Address, remoteToken common.Address, recipient common.Address, amount *big.Int, arg4 []byte)) *ArbitrumL2BridgeAdapterInterface_SendERC20_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].(common.Address), args[2].(common.Address), args[3].(common.Address), args[4].(*big.Int), args[5].([]byte)) + }) + return _c +} + +func (_c *ArbitrumL2BridgeAdapterInterface_SendERC20_Call) Return(_a0 *types.Transaction, _a1 error) *ArbitrumL2BridgeAdapterInterface_SendERC20_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbitrumL2BridgeAdapterInterface_SendERC20_Call) RunAndReturn(run func(*bind.TransactOpts, common.Address, common.Address, common.Address, *big.Int, []byte) (*types.Transaction, error)) *ArbitrumL2BridgeAdapterInterface_SendERC20_Call { + _c.Call.Return(run) + return _c +} + +// NewArbitrumL2BridgeAdapterInterface creates a new instance of ArbitrumL2BridgeAdapterInterface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewArbitrumL2BridgeAdapterInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *ArbitrumL2BridgeAdapterInterface { + mock := &ArbitrumL2BridgeAdapterInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/core/gethwrappers/liquiditymanager/mocks/mock_arbitrum_rollup_core/arb_rollup_core_interface.go b/core/gethwrappers/liquiditymanager/mocks/mock_arbitrum_rollup_core/arb_rollup_core_interface.go new file mode 100644 index 00000000000..bc18ea95f14 --- /dev/null +++ b/core/gethwrappers/liquiditymanager/mocks/mock_arbitrum_rollup_core/arb_rollup_core_interface.go @@ -0,0 +1,3347 @@ +// Code generated by mockery v2.43.2. DO NOT EDIT. + +package mock_arbitrum_rollup_core + +import ( + big "math/big" + + arbitrum_rollup_core "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/liquiditymanager/generated/arbitrum_rollup_core" + + bind "github.com/ethereum/go-ethereum/accounts/abi/bind" + + common "github.com/ethereum/go-ethereum/common" + + event "github.com/ethereum/go-ethereum/event" + + generated "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" + + mock "github.com/stretchr/testify/mock" + + types "github.com/ethereum/go-ethereum/core/types" +) + +// ArbRollupCoreInterface is an autogenerated mock type for the ArbRollupCoreInterface type +type ArbRollupCoreInterface struct { + mock.Mock +} + +type ArbRollupCoreInterface_Expecter struct { + mock *mock.Mock +} + +func (_m *ArbRollupCoreInterface) EXPECT() *ArbRollupCoreInterface_Expecter { + return &ArbRollupCoreInterface_Expecter{mock: &_m.Mock} +} + +// Address provides a mock function with given fields: +func (_m *ArbRollupCoreInterface) Address() common.Address { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Address") + } + + var r0 common.Address + if rf, ok := ret.Get(0).(func() common.Address); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Address) + } + } + + return r0 +} + +// ArbRollupCoreInterface_Address_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Address' +type ArbRollupCoreInterface_Address_Call struct { + *mock.Call +} + +// Address is a helper method to define mock.On call +func (_e *ArbRollupCoreInterface_Expecter) Address() *ArbRollupCoreInterface_Address_Call { + return &ArbRollupCoreInterface_Address_Call{Call: _e.mock.On("Address")} +} + +func (_c *ArbRollupCoreInterface_Address_Call) Run(run func()) *ArbRollupCoreInterface_Address_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ArbRollupCoreInterface_Address_Call) Return(_a0 common.Address) *ArbRollupCoreInterface_Address_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ArbRollupCoreInterface_Address_Call) RunAndReturn(run func() common.Address) *ArbRollupCoreInterface_Address_Call { + _c.Call.Return(run) + return _c +} + +// AmountStaked provides a mock function with given fields: opts, staker +func (_m *ArbRollupCoreInterface) AmountStaked(opts *bind.CallOpts, staker common.Address) (*big.Int, error) { + ret := _m.Called(opts, staker) + + if len(ret) == 0 { + panic("no return value specified for AmountStaked") + } + + var r0 *big.Int + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts, common.Address) (*big.Int, error)); ok { + return rf(opts, staker) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts, common.Address) *big.Int); ok { + r0 = rf(opts, staker) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*big.Int) + } + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts, common.Address) error); ok { + r1 = rf(opts, staker) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbRollupCoreInterface_AmountStaked_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AmountStaked' +type ArbRollupCoreInterface_AmountStaked_Call struct { + *mock.Call +} + +// AmountStaked is a helper method to define mock.On call +// - opts *bind.CallOpts +// - staker common.Address +func (_e *ArbRollupCoreInterface_Expecter) AmountStaked(opts interface{}, staker interface{}) *ArbRollupCoreInterface_AmountStaked_Call { + return &ArbRollupCoreInterface_AmountStaked_Call{Call: _e.mock.On("AmountStaked", opts, staker)} +} + +func (_c *ArbRollupCoreInterface_AmountStaked_Call) Run(run func(opts *bind.CallOpts, staker common.Address)) *ArbRollupCoreInterface_AmountStaked_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts), args[1].(common.Address)) + }) + return _c +} + +func (_c *ArbRollupCoreInterface_AmountStaked_Call) Return(_a0 *big.Int, _a1 error) *ArbRollupCoreInterface_AmountStaked_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbRollupCoreInterface_AmountStaked_Call) RunAndReturn(run func(*bind.CallOpts, common.Address) (*big.Int, error)) *ArbRollupCoreInterface_AmountStaked_Call { + _c.Call.Return(run) + return _c +} + +// BaseStake provides a mock function with given fields: opts +func (_m *ArbRollupCoreInterface) BaseStake(opts *bind.CallOpts) (*big.Int, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for BaseStake") + } + + var r0 *big.Int + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts) (*big.Int, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts) *big.Int); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*big.Int) + } + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbRollupCoreInterface_BaseStake_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BaseStake' +type ArbRollupCoreInterface_BaseStake_Call struct { + *mock.Call +} + +// BaseStake is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *ArbRollupCoreInterface_Expecter) BaseStake(opts interface{}) *ArbRollupCoreInterface_BaseStake_Call { + return &ArbRollupCoreInterface_BaseStake_Call{Call: _e.mock.On("BaseStake", opts)} +} + +func (_c *ArbRollupCoreInterface_BaseStake_Call) Run(run func(opts *bind.CallOpts)) *ArbRollupCoreInterface_BaseStake_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *ArbRollupCoreInterface_BaseStake_Call) Return(_a0 *big.Int, _a1 error) *ArbRollupCoreInterface_BaseStake_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbRollupCoreInterface_BaseStake_Call) RunAndReturn(run func(*bind.CallOpts) (*big.Int, error)) *ArbRollupCoreInterface_BaseStake_Call { + _c.Call.Return(run) + return _c +} + +// Bridge provides a mock function with given fields: opts +func (_m *ArbRollupCoreInterface) Bridge(opts *bind.CallOpts) (common.Address, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for Bridge") + } + + var r0 common.Address + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts) (common.Address, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts) common.Address); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Address) + } + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbRollupCoreInterface_Bridge_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Bridge' +type ArbRollupCoreInterface_Bridge_Call struct { + *mock.Call +} + +// Bridge is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *ArbRollupCoreInterface_Expecter) Bridge(opts interface{}) *ArbRollupCoreInterface_Bridge_Call { + return &ArbRollupCoreInterface_Bridge_Call{Call: _e.mock.On("Bridge", opts)} +} + +func (_c *ArbRollupCoreInterface_Bridge_Call) Run(run func(opts *bind.CallOpts)) *ArbRollupCoreInterface_Bridge_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *ArbRollupCoreInterface_Bridge_Call) Return(_a0 common.Address, _a1 error) *ArbRollupCoreInterface_Bridge_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbRollupCoreInterface_Bridge_Call) RunAndReturn(run func(*bind.CallOpts) (common.Address, error)) *ArbRollupCoreInterface_Bridge_Call { + _c.Call.Return(run) + return _c +} + +// ChainId provides a mock function with given fields: opts +func (_m *ArbRollupCoreInterface) ChainId(opts *bind.CallOpts) (*big.Int, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for ChainId") + } + + var r0 *big.Int + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts) (*big.Int, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts) *big.Int); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*big.Int) + } + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbRollupCoreInterface_ChainId_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ChainId' +type ArbRollupCoreInterface_ChainId_Call struct { + *mock.Call +} + +// ChainId is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *ArbRollupCoreInterface_Expecter) ChainId(opts interface{}) *ArbRollupCoreInterface_ChainId_Call { + return &ArbRollupCoreInterface_ChainId_Call{Call: _e.mock.On("ChainId", opts)} +} + +func (_c *ArbRollupCoreInterface_ChainId_Call) Run(run func(opts *bind.CallOpts)) *ArbRollupCoreInterface_ChainId_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *ArbRollupCoreInterface_ChainId_Call) Return(_a0 *big.Int, _a1 error) *ArbRollupCoreInterface_ChainId_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbRollupCoreInterface_ChainId_Call) RunAndReturn(run func(*bind.CallOpts) (*big.Int, error)) *ArbRollupCoreInterface_ChainId_Call { + _c.Call.Return(run) + return _c +} + +// ChallengeManager provides a mock function with given fields: opts +func (_m *ArbRollupCoreInterface) ChallengeManager(opts *bind.CallOpts) (common.Address, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for ChallengeManager") + } + + var r0 common.Address + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts) (common.Address, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts) common.Address); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Address) + } + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbRollupCoreInterface_ChallengeManager_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ChallengeManager' +type ArbRollupCoreInterface_ChallengeManager_Call struct { + *mock.Call +} + +// ChallengeManager is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *ArbRollupCoreInterface_Expecter) ChallengeManager(opts interface{}) *ArbRollupCoreInterface_ChallengeManager_Call { + return &ArbRollupCoreInterface_ChallengeManager_Call{Call: _e.mock.On("ChallengeManager", opts)} +} + +func (_c *ArbRollupCoreInterface_ChallengeManager_Call) Run(run func(opts *bind.CallOpts)) *ArbRollupCoreInterface_ChallengeManager_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *ArbRollupCoreInterface_ChallengeManager_Call) Return(_a0 common.Address, _a1 error) *ArbRollupCoreInterface_ChallengeManager_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbRollupCoreInterface_ChallengeManager_Call) RunAndReturn(run func(*bind.CallOpts) (common.Address, error)) *ArbRollupCoreInterface_ChallengeManager_Call { + _c.Call.Return(run) + return _c +} + +// ConfirmPeriodBlocks provides a mock function with given fields: opts +func (_m *ArbRollupCoreInterface) ConfirmPeriodBlocks(opts *bind.CallOpts) (uint64, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for ConfirmPeriodBlocks") + } + + var r0 uint64 + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts) (uint64, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts) uint64); ok { + r0 = rf(opts) + } else { + r0 = ret.Get(0).(uint64) + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbRollupCoreInterface_ConfirmPeriodBlocks_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ConfirmPeriodBlocks' +type ArbRollupCoreInterface_ConfirmPeriodBlocks_Call struct { + *mock.Call +} + +// ConfirmPeriodBlocks is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *ArbRollupCoreInterface_Expecter) ConfirmPeriodBlocks(opts interface{}) *ArbRollupCoreInterface_ConfirmPeriodBlocks_Call { + return &ArbRollupCoreInterface_ConfirmPeriodBlocks_Call{Call: _e.mock.On("ConfirmPeriodBlocks", opts)} +} + +func (_c *ArbRollupCoreInterface_ConfirmPeriodBlocks_Call) Run(run func(opts *bind.CallOpts)) *ArbRollupCoreInterface_ConfirmPeriodBlocks_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *ArbRollupCoreInterface_ConfirmPeriodBlocks_Call) Return(_a0 uint64, _a1 error) *ArbRollupCoreInterface_ConfirmPeriodBlocks_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbRollupCoreInterface_ConfirmPeriodBlocks_Call) RunAndReturn(run func(*bind.CallOpts) (uint64, error)) *ArbRollupCoreInterface_ConfirmPeriodBlocks_Call { + _c.Call.Return(run) + return _c +} + +// CurrentChallenge provides a mock function with given fields: opts, staker +func (_m *ArbRollupCoreInterface) CurrentChallenge(opts *bind.CallOpts, staker common.Address) (uint64, error) { + ret := _m.Called(opts, staker) + + if len(ret) == 0 { + panic("no return value specified for CurrentChallenge") + } + + var r0 uint64 + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts, common.Address) (uint64, error)); ok { + return rf(opts, staker) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts, common.Address) uint64); ok { + r0 = rf(opts, staker) + } else { + r0 = ret.Get(0).(uint64) + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts, common.Address) error); ok { + r1 = rf(opts, staker) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbRollupCoreInterface_CurrentChallenge_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CurrentChallenge' +type ArbRollupCoreInterface_CurrentChallenge_Call struct { + *mock.Call +} + +// CurrentChallenge is a helper method to define mock.On call +// - opts *bind.CallOpts +// - staker common.Address +func (_e *ArbRollupCoreInterface_Expecter) CurrentChallenge(opts interface{}, staker interface{}) *ArbRollupCoreInterface_CurrentChallenge_Call { + return &ArbRollupCoreInterface_CurrentChallenge_Call{Call: _e.mock.On("CurrentChallenge", opts, staker)} +} + +func (_c *ArbRollupCoreInterface_CurrentChallenge_Call) Run(run func(opts *bind.CallOpts, staker common.Address)) *ArbRollupCoreInterface_CurrentChallenge_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts), args[1].(common.Address)) + }) + return _c +} + +func (_c *ArbRollupCoreInterface_CurrentChallenge_Call) Return(_a0 uint64, _a1 error) *ArbRollupCoreInterface_CurrentChallenge_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbRollupCoreInterface_CurrentChallenge_Call) RunAndReturn(run func(*bind.CallOpts, common.Address) (uint64, error)) *ArbRollupCoreInterface_CurrentChallenge_Call { + _c.Call.Return(run) + return _c +} + +// ExtraChallengeTimeBlocks provides a mock function with given fields: opts +func (_m *ArbRollupCoreInterface) ExtraChallengeTimeBlocks(opts *bind.CallOpts) (uint64, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for ExtraChallengeTimeBlocks") + } + + var r0 uint64 + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts) (uint64, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts) uint64); ok { + r0 = rf(opts) + } else { + r0 = ret.Get(0).(uint64) + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbRollupCoreInterface_ExtraChallengeTimeBlocks_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ExtraChallengeTimeBlocks' +type ArbRollupCoreInterface_ExtraChallengeTimeBlocks_Call struct { + *mock.Call +} + +// ExtraChallengeTimeBlocks is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *ArbRollupCoreInterface_Expecter) ExtraChallengeTimeBlocks(opts interface{}) *ArbRollupCoreInterface_ExtraChallengeTimeBlocks_Call { + return &ArbRollupCoreInterface_ExtraChallengeTimeBlocks_Call{Call: _e.mock.On("ExtraChallengeTimeBlocks", opts)} +} + +func (_c *ArbRollupCoreInterface_ExtraChallengeTimeBlocks_Call) Run(run func(opts *bind.CallOpts)) *ArbRollupCoreInterface_ExtraChallengeTimeBlocks_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *ArbRollupCoreInterface_ExtraChallengeTimeBlocks_Call) Return(_a0 uint64, _a1 error) *ArbRollupCoreInterface_ExtraChallengeTimeBlocks_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbRollupCoreInterface_ExtraChallengeTimeBlocks_Call) RunAndReturn(run func(*bind.CallOpts) (uint64, error)) *ArbRollupCoreInterface_ExtraChallengeTimeBlocks_Call { + _c.Call.Return(run) + return _c +} + +// FilterNodeConfirmed provides a mock function with given fields: opts, nodeNum +func (_m *ArbRollupCoreInterface) FilterNodeConfirmed(opts *bind.FilterOpts, nodeNum []uint64) (*arbitrum_rollup_core.ArbRollupCoreNodeConfirmedIterator, error) { + ret := _m.Called(opts, nodeNum) + + if len(ret) == 0 { + panic("no return value specified for FilterNodeConfirmed") + } + + var r0 *arbitrum_rollup_core.ArbRollupCoreNodeConfirmedIterator + var r1 error + if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []uint64) (*arbitrum_rollup_core.ArbRollupCoreNodeConfirmedIterator, error)); ok { + return rf(opts, nodeNum) + } + if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []uint64) *arbitrum_rollup_core.ArbRollupCoreNodeConfirmedIterator); ok { + r0 = rf(opts, nodeNum) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*arbitrum_rollup_core.ArbRollupCoreNodeConfirmedIterator) + } + } + + if rf, ok := ret.Get(1).(func(*bind.FilterOpts, []uint64) error); ok { + r1 = rf(opts, nodeNum) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbRollupCoreInterface_FilterNodeConfirmed_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterNodeConfirmed' +type ArbRollupCoreInterface_FilterNodeConfirmed_Call struct { + *mock.Call +} + +// FilterNodeConfirmed is a helper method to define mock.On call +// - opts *bind.FilterOpts +// - nodeNum []uint64 +func (_e *ArbRollupCoreInterface_Expecter) FilterNodeConfirmed(opts interface{}, nodeNum interface{}) *ArbRollupCoreInterface_FilterNodeConfirmed_Call { + return &ArbRollupCoreInterface_FilterNodeConfirmed_Call{Call: _e.mock.On("FilterNodeConfirmed", opts, nodeNum)} +} + +func (_c *ArbRollupCoreInterface_FilterNodeConfirmed_Call) Run(run func(opts *bind.FilterOpts, nodeNum []uint64)) *ArbRollupCoreInterface_FilterNodeConfirmed_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts), args[1].([]uint64)) + }) + return _c +} + +func (_c *ArbRollupCoreInterface_FilterNodeConfirmed_Call) Return(_a0 *arbitrum_rollup_core.ArbRollupCoreNodeConfirmedIterator, _a1 error) *ArbRollupCoreInterface_FilterNodeConfirmed_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbRollupCoreInterface_FilterNodeConfirmed_Call) RunAndReturn(run func(*bind.FilterOpts, []uint64) (*arbitrum_rollup_core.ArbRollupCoreNodeConfirmedIterator, error)) *ArbRollupCoreInterface_FilterNodeConfirmed_Call { + _c.Call.Return(run) + return _c +} + +// FilterNodeCreated provides a mock function with given fields: opts, nodeNum, parentNodeHash, nodeHash +func (_m *ArbRollupCoreInterface) FilterNodeCreated(opts *bind.FilterOpts, nodeNum []uint64, parentNodeHash [][32]byte, nodeHash [][32]byte) (*arbitrum_rollup_core.ArbRollupCoreNodeCreatedIterator, error) { + ret := _m.Called(opts, nodeNum, parentNodeHash, nodeHash) + + if len(ret) == 0 { + panic("no return value specified for FilterNodeCreated") + } + + var r0 *arbitrum_rollup_core.ArbRollupCoreNodeCreatedIterator + var r1 error + if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []uint64, [][32]byte, [][32]byte) (*arbitrum_rollup_core.ArbRollupCoreNodeCreatedIterator, error)); ok { + return rf(opts, nodeNum, parentNodeHash, nodeHash) + } + if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []uint64, [][32]byte, [][32]byte) *arbitrum_rollup_core.ArbRollupCoreNodeCreatedIterator); ok { + r0 = rf(opts, nodeNum, parentNodeHash, nodeHash) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*arbitrum_rollup_core.ArbRollupCoreNodeCreatedIterator) + } + } + + if rf, ok := ret.Get(1).(func(*bind.FilterOpts, []uint64, [][32]byte, [][32]byte) error); ok { + r1 = rf(opts, nodeNum, parentNodeHash, nodeHash) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbRollupCoreInterface_FilterNodeCreated_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterNodeCreated' +type ArbRollupCoreInterface_FilterNodeCreated_Call struct { + *mock.Call +} + +// FilterNodeCreated is a helper method to define mock.On call +// - opts *bind.FilterOpts +// - nodeNum []uint64 +// - parentNodeHash [][32]byte +// - nodeHash [][32]byte +func (_e *ArbRollupCoreInterface_Expecter) FilterNodeCreated(opts interface{}, nodeNum interface{}, parentNodeHash interface{}, nodeHash interface{}) *ArbRollupCoreInterface_FilterNodeCreated_Call { + return &ArbRollupCoreInterface_FilterNodeCreated_Call{Call: _e.mock.On("FilterNodeCreated", opts, nodeNum, parentNodeHash, nodeHash)} +} + +func (_c *ArbRollupCoreInterface_FilterNodeCreated_Call) Run(run func(opts *bind.FilterOpts, nodeNum []uint64, parentNodeHash [][32]byte, nodeHash [][32]byte)) *ArbRollupCoreInterface_FilterNodeCreated_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts), args[1].([]uint64), args[2].([][32]byte), args[3].([][32]byte)) + }) + return _c +} + +func (_c *ArbRollupCoreInterface_FilterNodeCreated_Call) Return(_a0 *arbitrum_rollup_core.ArbRollupCoreNodeCreatedIterator, _a1 error) *ArbRollupCoreInterface_FilterNodeCreated_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbRollupCoreInterface_FilterNodeCreated_Call) RunAndReturn(run func(*bind.FilterOpts, []uint64, [][32]byte, [][32]byte) (*arbitrum_rollup_core.ArbRollupCoreNodeCreatedIterator, error)) *ArbRollupCoreInterface_FilterNodeCreated_Call { + _c.Call.Return(run) + return _c +} + +// FilterNodeRejected provides a mock function with given fields: opts, nodeNum +func (_m *ArbRollupCoreInterface) FilterNodeRejected(opts *bind.FilterOpts, nodeNum []uint64) (*arbitrum_rollup_core.ArbRollupCoreNodeRejectedIterator, error) { + ret := _m.Called(opts, nodeNum) + + if len(ret) == 0 { + panic("no return value specified for FilterNodeRejected") + } + + var r0 *arbitrum_rollup_core.ArbRollupCoreNodeRejectedIterator + var r1 error + if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []uint64) (*arbitrum_rollup_core.ArbRollupCoreNodeRejectedIterator, error)); ok { + return rf(opts, nodeNum) + } + if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []uint64) *arbitrum_rollup_core.ArbRollupCoreNodeRejectedIterator); ok { + r0 = rf(opts, nodeNum) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*arbitrum_rollup_core.ArbRollupCoreNodeRejectedIterator) + } + } + + if rf, ok := ret.Get(1).(func(*bind.FilterOpts, []uint64) error); ok { + r1 = rf(opts, nodeNum) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbRollupCoreInterface_FilterNodeRejected_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterNodeRejected' +type ArbRollupCoreInterface_FilterNodeRejected_Call struct { + *mock.Call +} + +// FilterNodeRejected is a helper method to define mock.On call +// - opts *bind.FilterOpts +// - nodeNum []uint64 +func (_e *ArbRollupCoreInterface_Expecter) FilterNodeRejected(opts interface{}, nodeNum interface{}) *ArbRollupCoreInterface_FilterNodeRejected_Call { + return &ArbRollupCoreInterface_FilterNodeRejected_Call{Call: _e.mock.On("FilterNodeRejected", opts, nodeNum)} +} + +func (_c *ArbRollupCoreInterface_FilterNodeRejected_Call) Run(run func(opts *bind.FilterOpts, nodeNum []uint64)) *ArbRollupCoreInterface_FilterNodeRejected_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts), args[1].([]uint64)) + }) + return _c +} + +func (_c *ArbRollupCoreInterface_FilterNodeRejected_Call) Return(_a0 *arbitrum_rollup_core.ArbRollupCoreNodeRejectedIterator, _a1 error) *ArbRollupCoreInterface_FilterNodeRejected_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbRollupCoreInterface_FilterNodeRejected_Call) RunAndReturn(run func(*bind.FilterOpts, []uint64) (*arbitrum_rollup_core.ArbRollupCoreNodeRejectedIterator, error)) *ArbRollupCoreInterface_FilterNodeRejected_Call { + _c.Call.Return(run) + return _c +} + +// FilterRollupChallengeStarted provides a mock function with given fields: opts, challengeIndex +func (_m *ArbRollupCoreInterface) FilterRollupChallengeStarted(opts *bind.FilterOpts, challengeIndex []uint64) (*arbitrum_rollup_core.ArbRollupCoreRollupChallengeStartedIterator, error) { + ret := _m.Called(opts, challengeIndex) + + if len(ret) == 0 { + panic("no return value specified for FilterRollupChallengeStarted") + } + + var r0 *arbitrum_rollup_core.ArbRollupCoreRollupChallengeStartedIterator + var r1 error + if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []uint64) (*arbitrum_rollup_core.ArbRollupCoreRollupChallengeStartedIterator, error)); ok { + return rf(opts, challengeIndex) + } + if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []uint64) *arbitrum_rollup_core.ArbRollupCoreRollupChallengeStartedIterator); ok { + r0 = rf(opts, challengeIndex) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*arbitrum_rollup_core.ArbRollupCoreRollupChallengeStartedIterator) + } + } + + if rf, ok := ret.Get(1).(func(*bind.FilterOpts, []uint64) error); ok { + r1 = rf(opts, challengeIndex) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbRollupCoreInterface_FilterRollupChallengeStarted_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterRollupChallengeStarted' +type ArbRollupCoreInterface_FilterRollupChallengeStarted_Call struct { + *mock.Call +} + +// FilterRollupChallengeStarted is a helper method to define mock.On call +// - opts *bind.FilterOpts +// - challengeIndex []uint64 +func (_e *ArbRollupCoreInterface_Expecter) FilterRollupChallengeStarted(opts interface{}, challengeIndex interface{}) *ArbRollupCoreInterface_FilterRollupChallengeStarted_Call { + return &ArbRollupCoreInterface_FilterRollupChallengeStarted_Call{Call: _e.mock.On("FilterRollupChallengeStarted", opts, challengeIndex)} +} + +func (_c *ArbRollupCoreInterface_FilterRollupChallengeStarted_Call) Run(run func(opts *bind.FilterOpts, challengeIndex []uint64)) *ArbRollupCoreInterface_FilterRollupChallengeStarted_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts), args[1].([]uint64)) + }) + return _c +} + +func (_c *ArbRollupCoreInterface_FilterRollupChallengeStarted_Call) Return(_a0 *arbitrum_rollup_core.ArbRollupCoreRollupChallengeStartedIterator, _a1 error) *ArbRollupCoreInterface_FilterRollupChallengeStarted_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbRollupCoreInterface_FilterRollupChallengeStarted_Call) RunAndReturn(run func(*bind.FilterOpts, []uint64) (*arbitrum_rollup_core.ArbRollupCoreRollupChallengeStartedIterator, error)) *ArbRollupCoreInterface_FilterRollupChallengeStarted_Call { + _c.Call.Return(run) + return _c +} + +// FilterRollupInitialized provides a mock function with given fields: opts +func (_m *ArbRollupCoreInterface) FilterRollupInitialized(opts *bind.FilterOpts) (*arbitrum_rollup_core.ArbRollupCoreRollupInitializedIterator, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for FilterRollupInitialized") + } + + var r0 *arbitrum_rollup_core.ArbRollupCoreRollupInitializedIterator + var r1 error + if rf, ok := ret.Get(0).(func(*bind.FilterOpts) (*arbitrum_rollup_core.ArbRollupCoreRollupInitializedIterator, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.FilterOpts) *arbitrum_rollup_core.ArbRollupCoreRollupInitializedIterator); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*arbitrum_rollup_core.ArbRollupCoreRollupInitializedIterator) + } + } + + if rf, ok := ret.Get(1).(func(*bind.FilterOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbRollupCoreInterface_FilterRollupInitialized_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterRollupInitialized' +type ArbRollupCoreInterface_FilterRollupInitialized_Call struct { + *mock.Call +} + +// FilterRollupInitialized is a helper method to define mock.On call +// - opts *bind.FilterOpts +func (_e *ArbRollupCoreInterface_Expecter) FilterRollupInitialized(opts interface{}) *ArbRollupCoreInterface_FilterRollupInitialized_Call { + return &ArbRollupCoreInterface_FilterRollupInitialized_Call{Call: _e.mock.On("FilterRollupInitialized", opts)} +} + +func (_c *ArbRollupCoreInterface_FilterRollupInitialized_Call) Run(run func(opts *bind.FilterOpts)) *ArbRollupCoreInterface_FilterRollupInitialized_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts)) + }) + return _c +} + +func (_c *ArbRollupCoreInterface_FilterRollupInitialized_Call) Return(_a0 *arbitrum_rollup_core.ArbRollupCoreRollupInitializedIterator, _a1 error) *ArbRollupCoreInterface_FilterRollupInitialized_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbRollupCoreInterface_FilterRollupInitialized_Call) RunAndReturn(run func(*bind.FilterOpts) (*arbitrum_rollup_core.ArbRollupCoreRollupInitializedIterator, error)) *ArbRollupCoreInterface_FilterRollupInitialized_Call { + _c.Call.Return(run) + return _c +} + +// FilterUserStakeUpdated provides a mock function with given fields: opts, user +func (_m *ArbRollupCoreInterface) FilterUserStakeUpdated(opts *bind.FilterOpts, user []common.Address) (*arbitrum_rollup_core.ArbRollupCoreUserStakeUpdatedIterator, error) { + ret := _m.Called(opts, user) + + if len(ret) == 0 { + panic("no return value specified for FilterUserStakeUpdated") + } + + var r0 *arbitrum_rollup_core.ArbRollupCoreUserStakeUpdatedIterator + var r1 error + if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []common.Address) (*arbitrum_rollup_core.ArbRollupCoreUserStakeUpdatedIterator, error)); ok { + return rf(opts, user) + } + if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []common.Address) *arbitrum_rollup_core.ArbRollupCoreUserStakeUpdatedIterator); ok { + r0 = rf(opts, user) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*arbitrum_rollup_core.ArbRollupCoreUserStakeUpdatedIterator) + } + } + + if rf, ok := ret.Get(1).(func(*bind.FilterOpts, []common.Address) error); ok { + r1 = rf(opts, user) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbRollupCoreInterface_FilterUserStakeUpdated_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterUserStakeUpdated' +type ArbRollupCoreInterface_FilterUserStakeUpdated_Call struct { + *mock.Call +} + +// FilterUserStakeUpdated is a helper method to define mock.On call +// - opts *bind.FilterOpts +// - user []common.Address +func (_e *ArbRollupCoreInterface_Expecter) FilterUserStakeUpdated(opts interface{}, user interface{}) *ArbRollupCoreInterface_FilterUserStakeUpdated_Call { + return &ArbRollupCoreInterface_FilterUserStakeUpdated_Call{Call: _e.mock.On("FilterUserStakeUpdated", opts, user)} +} + +func (_c *ArbRollupCoreInterface_FilterUserStakeUpdated_Call) Run(run func(opts *bind.FilterOpts, user []common.Address)) *ArbRollupCoreInterface_FilterUserStakeUpdated_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts), args[1].([]common.Address)) + }) + return _c +} + +func (_c *ArbRollupCoreInterface_FilterUserStakeUpdated_Call) Return(_a0 *arbitrum_rollup_core.ArbRollupCoreUserStakeUpdatedIterator, _a1 error) *ArbRollupCoreInterface_FilterUserStakeUpdated_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbRollupCoreInterface_FilterUserStakeUpdated_Call) RunAndReturn(run func(*bind.FilterOpts, []common.Address) (*arbitrum_rollup_core.ArbRollupCoreUserStakeUpdatedIterator, error)) *ArbRollupCoreInterface_FilterUserStakeUpdated_Call { + _c.Call.Return(run) + return _c +} + +// FilterUserWithdrawableFundsUpdated provides a mock function with given fields: opts, user +func (_m *ArbRollupCoreInterface) FilterUserWithdrawableFundsUpdated(opts *bind.FilterOpts, user []common.Address) (*arbitrum_rollup_core.ArbRollupCoreUserWithdrawableFundsUpdatedIterator, error) { + ret := _m.Called(opts, user) + + if len(ret) == 0 { + panic("no return value specified for FilterUserWithdrawableFundsUpdated") + } + + var r0 *arbitrum_rollup_core.ArbRollupCoreUserWithdrawableFundsUpdatedIterator + var r1 error + if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []common.Address) (*arbitrum_rollup_core.ArbRollupCoreUserWithdrawableFundsUpdatedIterator, error)); ok { + return rf(opts, user) + } + if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []common.Address) *arbitrum_rollup_core.ArbRollupCoreUserWithdrawableFundsUpdatedIterator); ok { + r0 = rf(opts, user) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*arbitrum_rollup_core.ArbRollupCoreUserWithdrawableFundsUpdatedIterator) + } + } + + if rf, ok := ret.Get(1).(func(*bind.FilterOpts, []common.Address) error); ok { + r1 = rf(opts, user) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbRollupCoreInterface_FilterUserWithdrawableFundsUpdated_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterUserWithdrawableFundsUpdated' +type ArbRollupCoreInterface_FilterUserWithdrawableFundsUpdated_Call struct { + *mock.Call +} + +// FilterUserWithdrawableFundsUpdated is a helper method to define mock.On call +// - opts *bind.FilterOpts +// - user []common.Address +func (_e *ArbRollupCoreInterface_Expecter) FilterUserWithdrawableFundsUpdated(opts interface{}, user interface{}) *ArbRollupCoreInterface_FilterUserWithdrawableFundsUpdated_Call { + return &ArbRollupCoreInterface_FilterUserWithdrawableFundsUpdated_Call{Call: _e.mock.On("FilterUserWithdrawableFundsUpdated", opts, user)} +} + +func (_c *ArbRollupCoreInterface_FilterUserWithdrawableFundsUpdated_Call) Run(run func(opts *bind.FilterOpts, user []common.Address)) *ArbRollupCoreInterface_FilterUserWithdrawableFundsUpdated_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts), args[1].([]common.Address)) + }) + return _c +} + +func (_c *ArbRollupCoreInterface_FilterUserWithdrawableFundsUpdated_Call) Return(_a0 *arbitrum_rollup_core.ArbRollupCoreUserWithdrawableFundsUpdatedIterator, _a1 error) *ArbRollupCoreInterface_FilterUserWithdrawableFundsUpdated_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbRollupCoreInterface_FilterUserWithdrawableFundsUpdated_Call) RunAndReturn(run func(*bind.FilterOpts, []common.Address) (*arbitrum_rollup_core.ArbRollupCoreUserWithdrawableFundsUpdatedIterator, error)) *ArbRollupCoreInterface_FilterUserWithdrawableFundsUpdated_Call { + _c.Call.Return(run) + return _c +} + +// FirstUnresolvedNode provides a mock function with given fields: opts +func (_m *ArbRollupCoreInterface) FirstUnresolvedNode(opts *bind.CallOpts) (uint64, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for FirstUnresolvedNode") + } + + var r0 uint64 + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts) (uint64, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts) uint64); ok { + r0 = rf(opts) + } else { + r0 = ret.Get(0).(uint64) + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbRollupCoreInterface_FirstUnresolvedNode_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FirstUnresolvedNode' +type ArbRollupCoreInterface_FirstUnresolvedNode_Call struct { + *mock.Call +} + +// FirstUnresolvedNode is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *ArbRollupCoreInterface_Expecter) FirstUnresolvedNode(opts interface{}) *ArbRollupCoreInterface_FirstUnresolvedNode_Call { + return &ArbRollupCoreInterface_FirstUnresolvedNode_Call{Call: _e.mock.On("FirstUnresolvedNode", opts)} +} + +func (_c *ArbRollupCoreInterface_FirstUnresolvedNode_Call) Run(run func(opts *bind.CallOpts)) *ArbRollupCoreInterface_FirstUnresolvedNode_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *ArbRollupCoreInterface_FirstUnresolvedNode_Call) Return(_a0 uint64, _a1 error) *ArbRollupCoreInterface_FirstUnresolvedNode_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbRollupCoreInterface_FirstUnresolvedNode_Call) RunAndReturn(run func(*bind.CallOpts) (uint64, error)) *ArbRollupCoreInterface_FirstUnresolvedNode_Call { + _c.Call.Return(run) + return _c +} + +// GetNode provides a mock function with given fields: opts, nodeNum +func (_m *ArbRollupCoreInterface) GetNode(opts *bind.CallOpts, nodeNum uint64) (arbitrum_rollup_core.Node, error) { + ret := _m.Called(opts, nodeNum) + + if len(ret) == 0 { + panic("no return value specified for GetNode") + } + + var r0 arbitrum_rollup_core.Node + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts, uint64) (arbitrum_rollup_core.Node, error)); ok { + return rf(opts, nodeNum) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts, uint64) arbitrum_rollup_core.Node); ok { + r0 = rf(opts, nodeNum) + } else { + r0 = ret.Get(0).(arbitrum_rollup_core.Node) + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts, uint64) error); ok { + r1 = rf(opts, nodeNum) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbRollupCoreInterface_GetNode_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetNode' +type ArbRollupCoreInterface_GetNode_Call struct { + *mock.Call +} + +// GetNode is a helper method to define mock.On call +// - opts *bind.CallOpts +// - nodeNum uint64 +func (_e *ArbRollupCoreInterface_Expecter) GetNode(opts interface{}, nodeNum interface{}) *ArbRollupCoreInterface_GetNode_Call { + return &ArbRollupCoreInterface_GetNode_Call{Call: _e.mock.On("GetNode", opts, nodeNum)} +} + +func (_c *ArbRollupCoreInterface_GetNode_Call) Run(run func(opts *bind.CallOpts, nodeNum uint64)) *ArbRollupCoreInterface_GetNode_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts), args[1].(uint64)) + }) + return _c +} + +func (_c *ArbRollupCoreInterface_GetNode_Call) Return(_a0 arbitrum_rollup_core.Node, _a1 error) *ArbRollupCoreInterface_GetNode_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbRollupCoreInterface_GetNode_Call) RunAndReturn(run func(*bind.CallOpts, uint64) (arbitrum_rollup_core.Node, error)) *ArbRollupCoreInterface_GetNode_Call { + _c.Call.Return(run) + return _c +} + +// GetNodeCreationBlockForLogLookup provides a mock function with given fields: opts, nodeNum +func (_m *ArbRollupCoreInterface) GetNodeCreationBlockForLogLookup(opts *bind.CallOpts, nodeNum uint64) (*big.Int, error) { + ret := _m.Called(opts, nodeNum) + + if len(ret) == 0 { + panic("no return value specified for GetNodeCreationBlockForLogLookup") + } + + var r0 *big.Int + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts, uint64) (*big.Int, error)); ok { + return rf(opts, nodeNum) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts, uint64) *big.Int); ok { + r0 = rf(opts, nodeNum) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*big.Int) + } + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts, uint64) error); ok { + r1 = rf(opts, nodeNum) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbRollupCoreInterface_GetNodeCreationBlockForLogLookup_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetNodeCreationBlockForLogLookup' +type ArbRollupCoreInterface_GetNodeCreationBlockForLogLookup_Call struct { + *mock.Call +} + +// GetNodeCreationBlockForLogLookup is a helper method to define mock.On call +// - opts *bind.CallOpts +// - nodeNum uint64 +func (_e *ArbRollupCoreInterface_Expecter) GetNodeCreationBlockForLogLookup(opts interface{}, nodeNum interface{}) *ArbRollupCoreInterface_GetNodeCreationBlockForLogLookup_Call { + return &ArbRollupCoreInterface_GetNodeCreationBlockForLogLookup_Call{Call: _e.mock.On("GetNodeCreationBlockForLogLookup", opts, nodeNum)} +} + +func (_c *ArbRollupCoreInterface_GetNodeCreationBlockForLogLookup_Call) Run(run func(opts *bind.CallOpts, nodeNum uint64)) *ArbRollupCoreInterface_GetNodeCreationBlockForLogLookup_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts), args[1].(uint64)) + }) + return _c +} + +func (_c *ArbRollupCoreInterface_GetNodeCreationBlockForLogLookup_Call) Return(_a0 *big.Int, _a1 error) *ArbRollupCoreInterface_GetNodeCreationBlockForLogLookup_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbRollupCoreInterface_GetNodeCreationBlockForLogLookup_Call) RunAndReturn(run func(*bind.CallOpts, uint64) (*big.Int, error)) *ArbRollupCoreInterface_GetNodeCreationBlockForLogLookup_Call { + _c.Call.Return(run) + return _c +} + +// GetStaker provides a mock function with given fields: opts, staker +func (_m *ArbRollupCoreInterface) GetStaker(opts *bind.CallOpts, staker common.Address) (arbitrum_rollup_core.IRollupCoreStaker, error) { + ret := _m.Called(opts, staker) + + if len(ret) == 0 { + panic("no return value specified for GetStaker") + } + + var r0 arbitrum_rollup_core.IRollupCoreStaker + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts, common.Address) (arbitrum_rollup_core.IRollupCoreStaker, error)); ok { + return rf(opts, staker) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts, common.Address) arbitrum_rollup_core.IRollupCoreStaker); ok { + r0 = rf(opts, staker) + } else { + r0 = ret.Get(0).(arbitrum_rollup_core.IRollupCoreStaker) + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts, common.Address) error); ok { + r1 = rf(opts, staker) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbRollupCoreInterface_GetStaker_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetStaker' +type ArbRollupCoreInterface_GetStaker_Call struct { + *mock.Call +} + +// GetStaker is a helper method to define mock.On call +// - opts *bind.CallOpts +// - staker common.Address +func (_e *ArbRollupCoreInterface_Expecter) GetStaker(opts interface{}, staker interface{}) *ArbRollupCoreInterface_GetStaker_Call { + return &ArbRollupCoreInterface_GetStaker_Call{Call: _e.mock.On("GetStaker", opts, staker)} +} + +func (_c *ArbRollupCoreInterface_GetStaker_Call) Run(run func(opts *bind.CallOpts, staker common.Address)) *ArbRollupCoreInterface_GetStaker_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts), args[1].(common.Address)) + }) + return _c +} + +func (_c *ArbRollupCoreInterface_GetStaker_Call) Return(_a0 arbitrum_rollup_core.IRollupCoreStaker, _a1 error) *ArbRollupCoreInterface_GetStaker_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbRollupCoreInterface_GetStaker_Call) RunAndReturn(run func(*bind.CallOpts, common.Address) (arbitrum_rollup_core.IRollupCoreStaker, error)) *ArbRollupCoreInterface_GetStaker_Call { + _c.Call.Return(run) + return _c +} + +// GetStakerAddress provides a mock function with given fields: opts, stakerNum +func (_m *ArbRollupCoreInterface) GetStakerAddress(opts *bind.CallOpts, stakerNum uint64) (common.Address, error) { + ret := _m.Called(opts, stakerNum) + + if len(ret) == 0 { + panic("no return value specified for GetStakerAddress") + } + + var r0 common.Address + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts, uint64) (common.Address, error)); ok { + return rf(opts, stakerNum) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts, uint64) common.Address); ok { + r0 = rf(opts, stakerNum) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Address) + } + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts, uint64) error); ok { + r1 = rf(opts, stakerNum) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbRollupCoreInterface_GetStakerAddress_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetStakerAddress' +type ArbRollupCoreInterface_GetStakerAddress_Call struct { + *mock.Call +} + +// GetStakerAddress is a helper method to define mock.On call +// - opts *bind.CallOpts +// - stakerNum uint64 +func (_e *ArbRollupCoreInterface_Expecter) GetStakerAddress(opts interface{}, stakerNum interface{}) *ArbRollupCoreInterface_GetStakerAddress_Call { + return &ArbRollupCoreInterface_GetStakerAddress_Call{Call: _e.mock.On("GetStakerAddress", opts, stakerNum)} +} + +func (_c *ArbRollupCoreInterface_GetStakerAddress_Call) Run(run func(opts *bind.CallOpts, stakerNum uint64)) *ArbRollupCoreInterface_GetStakerAddress_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts), args[1].(uint64)) + }) + return _c +} + +func (_c *ArbRollupCoreInterface_GetStakerAddress_Call) Return(_a0 common.Address, _a1 error) *ArbRollupCoreInterface_GetStakerAddress_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbRollupCoreInterface_GetStakerAddress_Call) RunAndReturn(run func(*bind.CallOpts, uint64) (common.Address, error)) *ArbRollupCoreInterface_GetStakerAddress_Call { + _c.Call.Return(run) + return _c +} + +// IsStaked provides a mock function with given fields: opts, staker +func (_m *ArbRollupCoreInterface) IsStaked(opts *bind.CallOpts, staker common.Address) (bool, error) { + ret := _m.Called(opts, staker) + + if len(ret) == 0 { + panic("no return value specified for IsStaked") + } + + var r0 bool + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts, common.Address) (bool, error)); ok { + return rf(opts, staker) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts, common.Address) bool); ok { + r0 = rf(opts, staker) + } else { + r0 = ret.Get(0).(bool) + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts, common.Address) error); ok { + r1 = rf(opts, staker) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbRollupCoreInterface_IsStaked_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsStaked' +type ArbRollupCoreInterface_IsStaked_Call struct { + *mock.Call +} + +// IsStaked is a helper method to define mock.On call +// - opts *bind.CallOpts +// - staker common.Address +func (_e *ArbRollupCoreInterface_Expecter) IsStaked(opts interface{}, staker interface{}) *ArbRollupCoreInterface_IsStaked_Call { + return &ArbRollupCoreInterface_IsStaked_Call{Call: _e.mock.On("IsStaked", opts, staker)} +} + +func (_c *ArbRollupCoreInterface_IsStaked_Call) Run(run func(opts *bind.CallOpts, staker common.Address)) *ArbRollupCoreInterface_IsStaked_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts), args[1].(common.Address)) + }) + return _c +} + +func (_c *ArbRollupCoreInterface_IsStaked_Call) Return(_a0 bool, _a1 error) *ArbRollupCoreInterface_IsStaked_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbRollupCoreInterface_IsStaked_Call) RunAndReturn(run func(*bind.CallOpts, common.Address) (bool, error)) *ArbRollupCoreInterface_IsStaked_Call { + _c.Call.Return(run) + return _c +} + +// IsValidator provides a mock function with given fields: opts, arg0 +func (_m *ArbRollupCoreInterface) IsValidator(opts *bind.CallOpts, arg0 common.Address) (bool, error) { + ret := _m.Called(opts, arg0) + + if len(ret) == 0 { + panic("no return value specified for IsValidator") + } + + var r0 bool + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts, common.Address) (bool, error)); ok { + return rf(opts, arg0) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts, common.Address) bool); ok { + r0 = rf(opts, arg0) + } else { + r0 = ret.Get(0).(bool) + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts, common.Address) error); ok { + r1 = rf(opts, arg0) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbRollupCoreInterface_IsValidator_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsValidator' +type ArbRollupCoreInterface_IsValidator_Call struct { + *mock.Call +} + +// IsValidator is a helper method to define mock.On call +// - opts *bind.CallOpts +// - arg0 common.Address +func (_e *ArbRollupCoreInterface_Expecter) IsValidator(opts interface{}, arg0 interface{}) *ArbRollupCoreInterface_IsValidator_Call { + return &ArbRollupCoreInterface_IsValidator_Call{Call: _e.mock.On("IsValidator", opts, arg0)} +} + +func (_c *ArbRollupCoreInterface_IsValidator_Call) Run(run func(opts *bind.CallOpts, arg0 common.Address)) *ArbRollupCoreInterface_IsValidator_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts), args[1].(common.Address)) + }) + return _c +} + +func (_c *ArbRollupCoreInterface_IsValidator_Call) Return(_a0 bool, _a1 error) *ArbRollupCoreInterface_IsValidator_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbRollupCoreInterface_IsValidator_Call) RunAndReturn(run func(*bind.CallOpts, common.Address) (bool, error)) *ArbRollupCoreInterface_IsValidator_Call { + _c.Call.Return(run) + return _c +} + +// IsZombie provides a mock function with given fields: opts, staker +func (_m *ArbRollupCoreInterface) IsZombie(opts *bind.CallOpts, staker common.Address) (bool, error) { + ret := _m.Called(opts, staker) + + if len(ret) == 0 { + panic("no return value specified for IsZombie") + } + + var r0 bool + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts, common.Address) (bool, error)); ok { + return rf(opts, staker) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts, common.Address) bool); ok { + r0 = rf(opts, staker) + } else { + r0 = ret.Get(0).(bool) + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts, common.Address) error); ok { + r1 = rf(opts, staker) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbRollupCoreInterface_IsZombie_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsZombie' +type ArbRollupCoreInterface_IsZombie_Call struct { + *mock.Call +} + +// IsZombie is a helper method to define mock.On call +// - opts *bind.CallOpts +// - staker common.Address +func (_e *ArbRollupCoreInterface_Expecter) IsZombie(opts interface{}, staker interface{}) *ArbRollupCoreInterface_IsZombie_Call { + return &ArbRollupCoreInterface_IsZombie_Call{Call: _e.mock.On("IsZombie", opts, staker)} +} + +func (_c *ArbRollupCoreInterface_IsZombie_Call) Run(run func(opts *bind.CallOpts, staker common.Address)) *ArbRollupCoreInterface_IsZombie_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts), args[1].(common.Address)) + }) + return _c +} + +func (_c *ArbRollupCoreInterface_IsZombie_Call) Return(_a0 bool, _a1 error) *ArbRollupCoreInterface_IsZombie_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbRollupCoreInterface_IsZombie_Call) RunAndReturn(run func(*bind.CallOpts, common.Address) (bool, error)) *ArbRollupCoreInterface_IsZombie_Call { + _c.Call.Return(run) + return _c +} + +// LastStakeBlock provides a mock function with given fields: opts +func (_m *ArbRollupCoreInterface) LastStakeBlock(opts *bind.CallOpts) (uint64, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for LastStakeBlock") + } + + var r0 uint64 + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts) (uint64, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts) uint64); ok { + r0 = rf(opts) + } else { + r0 = ret.Get(0).(uint64) + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbRollupCoreInterface_LastStakeBlock_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LastStakeBlock' +type ArbRollupCoreInterface_LastStakeBlock_Call struct { + *mock.Call +} + +// LastStakeBlock is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *ArbRollupCoreInterface_Expecter) LastStakeBlock(opts interface{}) *ArbRollupCoreInterface_LastStakeBlock_Call { + return &ArbRollupCoreInterface_LastStakeBlock_Call{Call: _e.mock.On("LastStakeBlock", opts)} +} + +func (_c *ArbRollupCoreInterface_LastStakeBlock_Call) Run(run func(opts *bind.CallOpts)) *ArbRollupCoreInterface_LastStakeBlock_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *ArbRollupCoreInterface_LastStakeBlock_Call) Return(_a0 uint64, _a1 error) *ArbRollupCoreInterface_LastStakeBlock_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbRollupCoreInterface_LastStakeBlock_Call) RunAndReturn(run func(*bind.CallOpts) (uint64, error)) *ArbRollupCoreInterface_LastStakeBlock_Call { + _c.Call.Return(run) + return _c +} + +// LatestConfirmed provides a mock function with given fields: opts +func (_m *ArbRollupCoreInterface) LatestConfirmed(opts *bind.CallOpts) (uint64, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for LatestConfirmed") + } + + var r0 uint64 + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts) (uint64, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts) uint64); ok { + r0 = rf(opts) + } else { + r0 = ret.Get(0).(uint64) + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbRollupCoreInterface_LatestConfirmed_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LatestConfirmed' +type ArbRollupCoreInterface_LatestConfirmed_Call struct { + *mock.Call +} + +// LatestConfirmed is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *ArbRollupCoreInterface_Expecter) LatestConfirmed(opts interface{}) *ArbRollupCoreInterface_LatestConfirmed_Call { + return &ArbRollupCoreInterface_LatestConfirmed_Call{Call: _e.mock.On("LatestConfirmed", opts)} +} + +func (_c *ArbRollupCoreInterface_LatestConfirmed_Call) Run(run func(opts *bind.CallOpts)) *ArbRollupCoreInterface_LatestConfirmed_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *ArbRollupCoreInterface_LatestConfirmed_Call) Return(_a0 uint64, _a1 error) *ArbRollupCoreInterface_LatestConfirmed_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbRollupCoreInterface_LatestConfirmed_Call) RunAndReturn(run func(*bind.CallOpts) (uint64, error)) *ArbRollupCoreInterface_LatestConfirmed_Call { + _c.Call.Return(run) + return _c +} + +// LatestNodeCreated provides a mock function with given fields: opts +func (_m *ArbRollupCoreInterface) LatestNodeCreated(opts *bind.CallOpts) (uint64, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for LatestNodeCreated") + } + + var r0 uint64 + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts) (uint64, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts) uint64); ok { + r0 = rf(opts) + } else { + r0 = ret.Get(0).(uint64) + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbRollupCoreInterface_LatestNodeCreated_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LatestNodeCreated' +type ArbRollupCoreInterface_LatestNodeCreated_Call struct { + *mock.Call +} + +// LatestNodeCreated is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *ArbRollupCoreInterface_Expecter) LatestNodeCreated(opts interface{}) *ArbRollupCoreInterface_LatestNodeCreated_Call { + return &ArbRollupCoreInterface_LatestNodeCreated_Call{Call: _e.mock.On("LatestNodeCreated", opts)} +} + +func (_c *ArbRollupCoreInterface_LatestNodeCreated_Call) Run(run func(opts *bind.CallOpts)) *ArbRollupCoreInterface_LatestNodeCreated_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *ArbRollupCoreInterface_LatestNodeCreated_Call) Return(_a0 uint64, _a1 error) *ArbRollupCoreInterface_LatestNodeCreated_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbRollupCoreInterface_LatestNodeCreated_Call) RunAndReturn(run func(*bind.CallOpts) (uint64, error)) *ArbRollupCoreInterface_LatestNodeCreated_Call { + _c.Call.Return(run) + return _c +} + +// LatestStakedNode provides a mock function with given fields: opts, staker +func (_m *ArbRollupCoreInterface) LatestStakedNode(opts *bind.CallOpts, staker common.Address) (uint64, error) { + ret := _m.Called(opts, staker) + + if len(ret) == 0 { + panic("no return value specified for LatestStakedNode") + } + + var r0 uint64 + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts, common.Address) (uint64, error)); ok { + return rf(opts, staker) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts, common.Address) uint64); ok { + r0 = rf(opts, staker) + } else { + r0 = ret.Get(0).(uint64) + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts, common.Address) error); ok { + r1 = rf(opts, staker) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbRollupCoreInterface_LatestStakedNode_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LatestStakedNode' +type ArbRollupCoreInterface_LatestStakedNode_Call struct { + *mock.Call +} + +// LatestStakedNode is a helper method to define mock.On call +// - opts *bind.CallOpts +// - staker common.Address +func (_e *ArbRollupCoreInterface_Expecter) LatestStakedNode(opts interface{}, staker interface{}) *ArbRollupCoreInterface_LatestStakedNode_Call { + return &ArbRollupCoreInterface_LatestStakedNode_Call{Call: _e.mock.On("LatestStakedNode", opts, staker)} +} + +func (_c *ArbRollupCoreInterface_LatestStakedNode_Call) Run(run func(opts *bind.CallOpts, staker common.Address)) *ArbRollupCoreInterface_LatestStakedNode_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts), args[1].(common.Address)) + }) + return _c +} + +func (_c *ArbRollupCoreInterface_LatestStakedNode_Call) Return(_a0 uint64, _a1 error) *ArbRollupCoreInterface_LatestStakedNode_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbRollupCoreInterface_LatestStakedNode_Call) RunAndReturn(run func(*bind.CallOpts, common.Address) (uint64, error)) *ArbRollupCoreInterface_LatestStakedNode_Call { + _c.Call.Return(run) + return _c +} + +// LoserStakeEscrow provides a mock function with given fields: opts +func (_m *ArbRollupCoreInterface) LoserStakeEscrow(opts *bind.CallOpts) (common.Address, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for LoserStakeEscrow") + } + + var r0 common.Address + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts) (common.Address, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts) common.Address); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Address) + } + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbRollupCoreInterface_LoserStakeEscrow_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LoserStakeEscrow' +type ArbRollupCoreInterface_LoserStakeEscrow_Call struct { + *mock.Call +} + +// LoserStakeEscrow is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *ArbRollupCoreInterface_Expecter) LoserStakeEscrow(opts interface{}) *ArbRollupCoreInterface_LoserStakeEscrow_Call { + return &ArbRollupCoreInterface_LoserStakeEscrow_Call{Call: _e.mock.On("LoserStakeEscrow", opts)} +} + +func (_c *ArbRollupCoreInterface_LoserStakeEscrow_Call) Run(run func(opts *bind.CallOpts)) *ArbRollupCoreInterface_LoserStakeEscrow_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *ArbRollupCoreInterface_LoserStakeEscrow_Call) Return(_a0 common.Address, _a1 error) *ArbRollupCoreInterface_LoserStakeEscrow_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbRollupCoreInterface_LoserStakeEscrow_Call) RunAndReturn(run func(*bind.CallOpts) (common.Address, error)) *ArbRollupCoreInterface_LoserStakeEscrow_Call { + _c.Call.Return(run) + return _c +} + +// MinimumAssertionPeriod provides a mock function with given fields: opts +func (_m *ArbRollupCoreInterface) MinimumAssertionPeriod(opts *bind.CallOpts) (*big.Int, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for MinimumAssertionPeriod") + } + + var r0 *big.Int + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts) (*big.Int, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts) *big.Int); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*big.Int) + } + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbRollupCoreInterface_MinimumAssertionPeriod_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MinimumAssertionPeriod' +type ArbRollupCoreInterface_MinimumAssertionPeriod_Call struct { + *mock.Call +} + +// MinimumAssertionPeriod is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *ArbRollupCoreInterface_Expecter) MinimumAssertionPeriod(opts interface{}) *ArbRollupCoreInterface_MinimumAssertionPeriod_Call { + return &ArbRollupCoreInterface_MinimumAssertionPeriod_Call{Call: _e.mock.On("MinimumAssertionPeriod", opts)} +} + +func (_c *ArbRollupCoreInterface_MinimumAssertionPeriod_Call) Run(run func(opts *bind.CallOpts)) *ArbRollupCoreInterface_MinimumAssertionPeriod_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *ArbRollupCoreInterface_MinimumAssertionPeriod_Call) Return(_a0 *big.Int, _a1 error) *ArbRollupCoreInterface_MinimumAssertionPeriod_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbRollupCoreInterface_MinimumAssertionPeriod_Call) RunAndReturn(run func(*bind.CallOpts) (*big.Int, error)) *ArbRollupCoreInterface_MinimumAssertionPeriod_Call { + _c.Call.Return(run) + return _c +} + +// NodeHasStaker provides a mock function with given fields: opts, nodeNum, staker +func (_m *ArbRollupCoreInterface) NodeHasStaker(opts *bind.CallOpts, nodeNum uint64, staker common.Address) (bool, error) { + ret := _m.Called(opts, nodeNum, staker) + + if len(ret) == 0 { + panic("no return value specified for NodeHasStaker") + } + + var r0 bool + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts, uint64, common.Address) (bool, error)); ok { + return rf(opts, nodeNum, staker) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts, uint64, common.Address) bool); ok { + r0 = rf(opts, nodeNum, staker) + } else { + r0 = ret.Get(0).(bool) + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts, uint64, common.Address) error); ok { + r1 = rf(opts, nodeNum, staker) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbRollupCoreInterface_NodeHasStaker_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NodeHasStaker' +type ArbRollupCoreInterface_NodeHasStaker_Call struct { + *mock.Call +} + +// NodeHasStaker is a helper method to define mock.On call +// - opts *bind.CallOpts +// - nodeNum uint64 +// - staker common.Address +func (_e *ArbRollupCoreInterface_Expecter) NodeHasStaker(opts interface{}, nodeNum interface{}, staker interface{}) *ArbRollupCoreInterface_NodeHasStaker_Call { + return &ArbRollupCoreInterface_NodeHasStaker_Call{Call: _e.mock.On("NodeHasStaker", opts, nodeNum, staker)} +} + +func (_c *ArbRollupCoreInterface_NodeHasStaker_Call) Run(run func(opts *bind.CallOpts, nodeNum uint64, staker common.Address)) *ArbRollupCoreInterface_NodeHasStaker_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts), args[1].(uint64), args[2].(common.Address)) + }) + return _c +} + +func (_c *ArbRollupCoreInterface_NodeHasStaker_Call) Return(_a0 bool, _a1 error) *ArbRollupCoreInterface_NodeHasStaker_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbRollupCoreInterface_NodeHasStaker_Call) RunAndReturn(run func(*bind.CallOpts, uint64, common.Address) (bool, error)) *ArbRollupCoreInterface_NodeHasStaker_Call { + _c.Call.Return(run) + return _c +} + +// Outbox provides a mock function with given fields: opts +func (_m *ArbRollupCoreInterface) Outbox(opts *bind.CallOpts) (common.Address, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for Outbox") + } + + var r0 common.Address + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts) (common.Address, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts) common.Address); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Address) + } + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbRollupCoreInterface_Outbox_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Outbox' +type ArbRollupCoreInterface_Outbox_Call struct { + *mock.Call +} + +// Outbox is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *ArbRollupCoreInterface_Expecter) Outbox(opts interface{}) *ArbRollupCoreInterface_Outbox_Call { + return &ArbRollupCoreInterface_Outbox_Call{Call: _e.mock.On("Outbox", opts)} +} + +func (_c *ArbRollupCoreInterface_Outbox_Call) Run(run func(opts *bind.CallOpts)) *ArbRollupCoreInterface_Outbox_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *ArbRollupCoreInterface_Outbox_Call) Return(_a0 common.Address, _a1 error) *ArbRollupCoreInterface_Outbox_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbRollupCoreInterface_Outbox_Call) RunAndReturn(run func(*bind.CallOpts) (common.Address, error)) *ArbRollupCoreInterface_Outbox_Call { + _c.Call.Return(run) + return _c +} + +// ParseLog provides a mock function with given fields: log +func (_m *ArbRollupCoreInterface) ParseLog(log types.Log) (generated.AbigenLog, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParseLog") + } + + var r0 generated.AbigenLog + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (generated.AbigenLog, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) generated.AbigenLog); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(generated.AbigenLog) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbRollupCoreInterface_ParseLog_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseLog' +type ArbRollupCoreInterface_ParseLog_Call struct { + *mock.Call +} + +// ParseLog is a helper method to define mock.On call +// - log types.Log +func (_e *ArbRollupCoreInterface_Expecter) ParseLog(log interface{}) *ArbRollupCoreInterface_ParseLog_Call { + return &ArbRollupCoreInterface_ParseLog_Call{Call: _e.mock.On("ParseLog", log)} +} + +func (_c *ArbRollupCoreInterface_ParseLog_Call) Run(run func(log types.Log)) *ArbRollupCoreInterface_ParseLog_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *ArbRollupCoreInterface_ParseLog_Call) Return(_a0 generated.AbigenLog, _a1 error) *ArbRollupCoreInterface_ParseLog_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbRollupCoreInterface_ParseLog_Call) RunAndReturn(run func(types.Log) (generated.AbigenLog, error)) *ArbRollupCoreInterface_ParseLog_Call { + _c.Call.Return(run) + return _c +} + +// ParseNodeConfirmed provides a mock function with given fields: log +func (_m *ArbRollupCoreInterface) ParseNodeConfirmed(log types.Log) (*arbitrum_rollup_core.ArbRollupCoreNodeConfirmed, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParseNodeConfirmed") + } + + var r0 *arbitrum_rollup_core.ArbRollupCoreNodeConfirmed + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (*arbitrum_rollup_core.ArbRollupCoreNodeConfirmed, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) *arbitrum_rollup_core.ArbRollupCoreNodeConfirmed); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*arbitrum_rollup_core.ArbRollupCoreNodeConfirmed) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbRollupCoreInterface_ParseNodeConfirmed_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseNodeConfirmed' +type ArbRollupCoreInterface_ParseNodeConfirmed_Call struct { + *mock.Call +} + +// ParseNodeConfirmed is a helper method to define mock.On call +// - log types.Log +func (_e *ArbRollupCoreInterface_Expecter) ParseNodeConfirmed(log interface{}) *ArbRollupCoreInterface_ParseNodeConfirmed_Call { + return &ArbRollupCoreInterface_ParseNodeConfirmed_Call{Call: _e.mock.On("ParseNodeConfirmed", log)} +} + +func (_c *ArbRollupCoreInterface_ParseNodeConfirmed_Call) Run(run func(log types.Log)) *ArbRollupCoreInterface_ParseNodeConfirmed_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *ArbRollupCoreInterface_ParseNodeConfirmed_Call) Return(_a0 *arbitrum_rollup_core.ArbRollupCoreNodeConfirmed, _a1 error) *ArbRollupCoreInterface_ParseNodeConfirmed_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbRollupCoreInterface_ParseNodeConfirmed_Call) RunAndReturn(run func(types.Log) (*arbitrum_rollup_core.ArbRollupCoreNodeConfirmed, error)) *ArbRollupCoreInterface_ParseNodeConfirmed_Call { + _c.Call.Return(run) + return _c +} + +// ParseNodeCreated provides a mock function with given fields: log +func (_m *ArbRollupCoreInterface) ParseNodeCreated(log types.Log) (*arbitrum_rollup_core.ArbRollupCoreNodeCreated, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParseNodeCreated") + } + + var r0 *arbitrum_rollup_core.ArbRollupCoreNodeCreated + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (*arbitrum_rollup_core.ArbRollupCoreNodeCreated, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) *arbitrum_rollup_core.ArbRollupCoreNodeCreated); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*arbitrum_rollup_core.ArbRollupCoreNodeCreated) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbRollupCoreInterface_ParseNodeCreated_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseNodeCreated' +type ArbRollupCoreInterface_ParseNodeCreated_Call struct { + *mock.Call +} + +// ParseNodeCreated is a helper method to define mock.On call +// - log types.Log +func (_e *ArbRollupCoreInterface_Expecter) ParseNodeCreated(log interface{}) *ArbRollupCoreInterface_ParseNodeCreated_Call { + return &ArbRollupCoreInterface_ParseNodeCreated_Call{Call: _e.mock.On("ParseNodeCreated", log)} +} + +func (_c *ArbRollupCoreInterface_ParseNodeCreated_Call) Run(run func(log types.Log)) *ArbRollupCoreInterface_ParseNodeCreated_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *ArbRollupCoreInterface_ParseNodeCreated_Call) Return(_a0 *arbitrum_rollup_core.ArbRollupCoreNodeCreated, _a1 error) *ArbRollupCoreInterface_ParseNodeCreated_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbRollupCoreInterface_ParseNodeCreated_Call) RunAndReturn(run func(types.Log) (*arbitrum_rollup_core.ArbRollupCoreNodeCreated, error)) *ArbRollupCoreInterface_ParseNodeCreated_Call { + _c.Call.Return(run) + return _c +} + +// ParseNodeRejected provides a mock function with given fields: log +func (_m *ArbRollupCoreInterface) ParseNodeRejected(log types.Log) (*arbitrum_rollup_core.ArbRollupCoreNodeRejected, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParseNodeRejected") + } + + var r0 *arbitrum_rollup_core.ArbRollupCoreNodeRejected + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (*arbitrum_rollup_core.ArbRollupCoreNodeRejected, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) *arbitrum_rollup_core.ArbRollupCoreNodeRejected); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*arbitrum_rollup_core.ArbRollupCoreNodeRejected) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbRollupCoreInterface_ParseNodeRejected_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseNodeRejected' +type ArbRollupCoreInterface_ParseNodeRejected_Call struct { + *mock.Call +} + +// ParseNodeRejected is a helper method to define mock.On call +// - log types.Log +func (_e *ArbRollupCoreInterface_Expecter) ParseNodeRejected(log interface{}) *ArbRollupCoreInterface_ParseNodeRejected_Call { + return &ArbRollupCoreInterface_ParseNodeRejected_Call{Call: _e.mock.On("ParseNodeRejected", log)} +} + +func (_c *ArbRollupCoreInterface_ParseNodeRejected_Call) Run(run func(log types.Log)) *ArbRollupCoreInterface_ParseNodeRejected_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *ArbRollupCoreInterface_ParseNodeRejected_Call) Return(_a0 *arbitrum_rollup_core.ArbRollupCoreNodeRejected, _a1 error) *ArbRollupCoreInterface_ParseNodeRejected_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbRollupCoreInterface_ParseNodeRejected_Call) RunAndReturn(run func(types.Log) (*arbitrum_rollup_core.ArbRollupCoreNodeRejected, error)) *ArbRollupCoreInterface_ParseNodeRejected_Call { + _c.Call.Return(run) + return _c +} + +// ParseRollupChallengeStarted provides a mock function with given fields: log +func (_m *ArbRollupCoreInterface) ParseRollupChallengeStarted(log types.Log) (*arbitrum_rollup_core.ArbRollupCoreRollupChallengeStarted, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParseRollupChallengeStarted") + } + + var r0 *arbitrum_rollup_core.ArbRollupCoreRollupChallengeStarted + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (*arbitrum_rollup_core.ArbRollupCoreRollupChallengeStarted, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) *arbitrum_rollup_core.ArbRollupCoreRollupChallengeStarted); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*arbitrum_rollup_core.ArbRollupCoreRollupChallengeStarted) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbRollupCoreInterface_ParseRollupChallengeStarted_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseRollupChallengeStarted' +type ArbRollupCoreInterface_ParseRollupChallengeStarted_Call struct { + *mock.Call +} + +// ParseRollupChallengeStarted is a helper method to define mock.On call +// - log types.Log +func (_e *ArbRollupCoreInterface_Expecter) ParseRollupChallengeStarted(log interface{}) *ArbRollupCoreInterface_ParseRollupChallengeStarted_Call { + return &ArbRollupCoreInterface_ParseRollupChallengeStarted_Call{Call: _e.mock.On("ParseRollupChallengeStarted", log)} +} + +func (_c *ArbRollupCoreInterface_ParseRollupChallengeStarted_Call) Run(run func(log types.Log)) *ArbRollupCoreInterface_ParseRollupChallengeStarted_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *ArbRollupCoreInterface_ParseRollupChallengeStarted_Call) Return(_a0 *arbitrum_rollup_core.ArbRollupCoreRollupChallengeStarted, _a1 error) *ArbRollupCoreInterface_ParseRollupChallengeStarted_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbRollupCoreInterface_ParseRollupChallengeStarted_Call) RunAndReturn(run func(types.Log) (*arbitrum_rollup_core.ArbRollupCoreRollupChallengeStarted, error)) *ArbRollupCoreInterface_ParseRollupChallengeStarted_Call { + _c.Call.Return(run) + return _c +} + +// ParseRollupInitialized provides a mock function with given fields: log +func (_m *ArbRollupCoreInterface) ParseRollupInitialized(log types.Log) (*arbitrum_rollup_core.ArbRollupCoreRollupInitialized, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParseRollupInitialized") + } + + var r0 *arbitrum_rollup_core.ArbRollupCoreRollupInitialized + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (*arbitrum_rollup_core.ArbRollupCoreRollupInitialized, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) *arbitrum_rollup_core.ArbRollupCoreRollupInitialized); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*arbitrum_rollup_core.ArbRollupCoreRollupInitialized) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbRollupCoreInterface_ParseRollupInitialized_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseRollupInitialized' +type ArbRollupCoreInterface_ParseRollupInitialized_Call struct { + *mock.Call +} + +// ParseRollupInitialized is a helper method to define mock.On call +// - log types.Log +func (_e *ArbRollupCoreInterface_Expecter) ParseRollupInitialized(log interface{}) *ArbRollupCoreInterface_ParseRollupInitialized_Call { + return &ArbRollupCoreInterface_ParseRollupInitialized_Call{Call: _e.mock.On("ParseRollupInitialized", log)} +} + +func (_c *ArbRollupCoreInterface_ParseRollupInitialized_Call) Run(run func(log types.Log)) *ArbRollupCoreInterface_ParseRollupInitialized_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *ArbRollupCoreInterface_ParseRollupInitialized_Call) Return(_a0 *arbitrum_rollup_core.ArbRollupCoreRollupInitialized, _a1 error) *ArbRollupCoreInterface_ParseRollupInitialized_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbRollupCoreInterface_ParseRollupInitialized_Call) RunAndReturn(run func(types.Log) (*arbitrum_rollup_core.ArbRollupCoreRollupInitialized, error)) *ArbRollupCoreInterface_ParseRollupInitialized_Call { + _c.Call.Return(run) + return _c +} + +// ParseUserStakeUpdated provides a mock function with given fields: log +func (_m *ArbRollupCoreInterface) ParseUserStakeUpdated(log types.Log) (*arbitrum_rollup_core.ArbRollupCoreUserStakeUpdated, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParseUserStakeUpdated") + } + + var r0 *arbitrum_rollup_core.ArbRollupCoreUserStakeUpdated + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (*arbitrum_rollup_core.ArbRollupCoreUserStakeUpdated, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) *arbitrum_rollup_core.ArbRollupCoreUserStakeUpdated); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*arbitrum_rollup_core.ArbRollupCoreUserStakeUpdated) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbRollupCoreInterface_ParseUserStakeUpdated_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseUserStakeUpdated' +type ArbRollupCoreInterface_ParseUserStakeUpdated_Call struct { + *mock.Call +} + +// ParseUserStakeUpdated is a helper method to define mock.On call +// - log types.Log +func (_e *ArbRollupCoreInterface_Expecter) ParseUserStakeUpdated(log interface{}) *ArbRollupCoreInterface_ParseUserStakeUpdated_Call { + return &ArbRollupCoreInterface_ParseUserStakeUpdated_Call{Call: _e.mock.On("ParseUserStakeUpdated", log)} +} + +func (_c *ArbRollupCoreInterface_ParseUserStakeUpdated_Call) Run(run func(log types.Log)) *ArbRollupCoreInterface_ParseUserStakeUpdated_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *ArbRollupCoreInterface_ParseUserStakeUpdated_Call) Return(_a0 *arbitrum_rollup_core.ArbRollupCoreUserStakeUpdated, _a1 error) *ArbRollupCoreInterface_ParseUserStakeUpdated_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbRollupCoreInterface_ParseUserStakeUpdated_Call) RunAndReturn(run func(types.Log) (*arbitrum_rollup_core.ArbRollupCoreUserStakeUpdated, error)) *ArbRollupCoreInterface_ParseUserStakeUpdated_Call { + _c.Call.Return(run) + return _c +} + +// ParseUserWithdrawableFundsUpdated provides a mock function with given fields: log +func (_m *ArbRollupCoreInterface) ParseUserWithdrawableFundsUpdated(log types.Log) (*arbitrum_rollup_core.ArbRollupCoreUserWithdrawableFundsUpdated, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParseUserWithdrawableFundsUpdated") + } + + var r0 *arbitrum_rollup_core.ArbRollupCoreUserWithdrawableFundsUpdated + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (*arbitrum_rollup_core.ArbRollupCoreUserWithdrawableFundsUpdated, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) *arbitrum_rollup_core.ArbRollupCoreUserWithdrawableFundsUpdated); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*arbitrum_rollup_core.ArbRollupCoreUserWithdrawableFundsUpdated) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbRollupCoreInterface_ParseUserWithdrawableFundsUpdated_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseUserWithdrawableFundsUpdated' +type ArbRollupCoreInterface_ParseUserWithdrawableFundsUpdated_Call struct { + *mock.Call +} + +// ParseUserWithdrawableFundsUpdated is a helper method to define mock.On call +// - log types.Log +func (_e *ArbRollupCoreInterface_Expecter) ParseUserWithdrawableFundsUpdated(log interface{}) *ArbRollupCoreInterface_ParseUserWithdrawableFundsUpdated_Call { + return &ArbRollupCoreInterface_ParseUserWithdrawableFundsUpdated_Call{Call: _e.mock.On("ParseUserWithdrawableFundsUpdated", log)} +} + +func (_c *ArbRollupCoreInterface_ParseUserWithdrawableFundsUpdated_Call) Run(run func(log types.Log)) *ArbRollupCoreInterface_ParseUserWithdrawableFundsUpdated_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *ArbRollupCoreInterface_ParseUserWithdrawableFundsUpdated_Call) Return(_a0 *arbitrum_rollup_core.ArbRollupCoreUserWithdrawableFundsUpdated, _a1 error) *ArbRollupCoreInterface_ParseUserWithdrawableFundsUpdated_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbRollupCoreInterface_ParseUserWithdrawableFundsUpdated_Call) RunAndReturn(run func(types.Log) (*arbitrum_rollup_core.ArbRollupCoreUserWithdrawableFundsUpdated, error)) *ArbRollupCoreInterface_ParseUserWithdrawableFundsUpdated_Call { + _c.Call.Return(run) + return _c +} + +// RollupEventInbox provides a mock function with given fields: opts +func (_m *ArbRollupCoreInterface) RollupEventInbox(opts *bind.CallOpts) (common.Address, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for RollupEventInbox") + } + + var r0 common.Address + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts) (common.Address, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts) common.Address); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Address) + } + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbRollupCoreInterface_RollupEventInbox_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RollupEventInbox' +type ArbRollupCoreInterface_RollupEventInbox_Call struct { + *mock.Call +} + +// RollupEventInbox is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *ArbRollupCoreInterface_Expecter) RollupEventInbox(opts interface{}) *ArbRollupCoreInterface_RollupEventInbox_Call { + return &ArbRollupCoreInterface_RollupEventInbox_Call{Call: _e.mock.On("RollupEventInbox", opts)} +} + +func (_c *ArbRollupCoreInterface_RollupEventInbox_Call) Run(run func(opts *bind.CallOpts)) *ArbRollupCoreInterface_RollupEventInbox_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *ArbRollupCoreInterface_RollupEventInbox_Call) Return(_a0 common.Address, _a1 error) *ArbRollupCoreInterface_RollupEventInbox_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbRollupCoreInterface_RollupEventInbox_Call) RunAndReturn(run func(*bind.CallOpts) (common.Address, error)) *ArbRollupCoreInterface_RollupEventInbox_Call { + _c.Call.Return(run) + return _c +} + +// SequencerInbox provides a mock function with given fields: opts +func (_m *ArbRollupCoreInterface) SequencerInbox(opts *bind.CallOpts) (common.Address, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for SequencerInbox") + } + + var r0 common.Address + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts) (common.Address, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts) common.Address); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Address) + } + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbRollupCoreInterface_SequencerInbox_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SequencerInbox' +type ArbRollupCoreInterface_SequencerInbox_Call struct { + *mock.Call +} + +// SequencerInbox is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *ArbRollupCoreInterface_Expecter) SequencerInbox(opts interface{}) *ArbRollupCoreInterface_SequencerInbox_Call { + return &ArbRollupCoreInterface_SequencerInbox_Call{Call: _e.mock.On("SequencerInbox", opts)} +} + +func (_c *ArbRollupCoreInterface_SequencerInbox_Call) Run(run func(opts *bind.CallOpts)) *ArbRollupCoreInterface_SequencerInbox_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *ArbRollupCoreInterface_SequencerInbox_Call) Return(_a0 common.Address, _a1 error) *ArbRollupCoreInterface_SequencerInbox_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbRollupCoreInterface_SequencerInbox_Call) RunAndReturn(run func(*bind.CallOpts) (common.Address, error)) *ArbRollupCoreInterface_SequencerInbox_Call { + _c.Call.Return(run) + return _c +} + +// StakeToken provides a mock function with given fields: opts +func (_m *ArbRollupCoreInterface) StakeToken(opts *bind.CallOpts) (common.Address, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for StakeToken") + } + + var r0 common.Address + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts) (common.Address, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts) common.Address); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Address) + } + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbRollupCoreInterface_StakeToken_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StakeToken' +type ArbRollupCoreInterface_StakeToken_Call struct { + *mock.Call +} + +// StakeToken is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *ArbRollupCoreInterface_Expecter) StakeToken(opts interface{}) *ArbRollupCoreInterface_StakeToken_Call { + return &ArbRollupCoreInterface_StakeToken_Call{Call: _e.mock.On("StakeToken", opts)} +} + +func (_c *ArbRollupCoreInterface_StakeToken_Call) Run(run func(opts *bind.CallOpts)) *ArbRollupCoreInterface_StakeToken_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *ArbRollupCoreInterface_StakeToken_Call) Return(_a0 common.Address, _a1 error) *ArbRollupCoreInterface_StakeToken_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbRollupCoreInterface_StakeToken_Call) RunAndReturn(run func(*bind.CallOpts) (common.Address, error)) *ArbRollupCoreInterface_StakeToken_Call { + _c.Call.Return(run) + return _c +} + +// StakerCount provides a mock function with given fields: opts +func (_m *ArbRollupCoreInterface) StakerCount(opts *bind.CallOpts) (uint64, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for StakerCount") + } + + var r0 uint64 + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts) (uint64, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts) uint64); ok { + r0 = rf(opts) + } else { + r0 = ret.Get(0).(uint64) + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbRollupCoreInterface_StakerCount_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StakerCount' +type ArbRollupCoreInterface_StakerCount_Call struct { + *mock.Call +} + +// StakerCount is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *ArbRollupCoreInterface_Expecter) StakerCount(opts interface{}) *ArbRollupCoreInterface_StakerCount_Call { + return &ArbRollupCoreInterface_StakerCount_Call{Call: _e.mock.On("StakerCount", opts)} +} + +func (_c *ArbRollupCoreInterface_StakerCount_Call) Run(run func(opts *bind.CallOpts)) *ArbRollupCoreInterface_StakerCount_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *ArbRollupCoreInterface_StakerCount_Call) Return(_a0 uint64, _a1 error) *ArbRollupCoreInterface_StakerCount_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbRollupCoreInterface_StakerCount_Call) RunAndReturn(run func(*bind.CallOpts) (uint64, error)) *ArbRollupCoreInterface_StakerCount_Call { + _c.Call.Return(run) + return _c +} + +// ValidatorWhitelistDisabled provides a mock function with given fields: opts +func (_m *ArbRollupCoreInterface) ValidatorWhitelistDisabled(opts *bind.CallOpts) (bool, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for ValidatorWhitelistDisabled") + } + + var r0 bool + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts) (bool, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts) bool); ok { + r0 = rf(opts) + } else { + r0 = ret.Get(0).(bool) + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbRollupCoreInterface_ValidatorWhitelistDisabled_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ValidatorWhitelistDisabled' +type ArbRollupCoreInterface_ValidatorWhitelistDisabled_Call struct { + *mock.Call +} + +// ValidatorWhitelistDisabled is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *ArbRollupCoreInterface_Expecter) ValidatorWhitelistDisabled(opts interface{}) *ArbRollupCoreInterface_ValidatorWhitelistDisabled_Call { + return &ArbRollupCoreInterface_ValidatorWhitelistDisabled_Call{Call: _e.mock.On("ValidatorWhitelistDisabled", opts)} +} + +func (_c *ArbRollupCoreInterface_ValidatorWhitelistDisabled_Call) Run(run func(opts *bind.CallOpts)) *ArbRollupCoreInterface_ValidatorWhitelistDisabled_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *ArbRollupCoreInterface_ValidatorWhitelistDisabled_Call) Return(_a0 bool, _a1 error) *ArbRollupCoreInterface_ValidatorWhitelistDisabled_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbRollupCoreInterface_ValidatorWhitelistDisabled_Call) RunAndReturn(run func(*bind.CallOpts) (bool, error)) *ArbRollupCoreInterface_ValidatorWhitelistDisabled_Call { + _c.Call.Return(run) + return _c +} + +// WasmModuleRoot provides a mock function with given fields: opts +func (_m *ArbRollupCoreInterface) WasmModuleRoot(opts *bind.CallOpts) ([32]byte, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for WasmModuleRoot") + } + + var r0 [32]byte + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts) ([32]byte, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts) [32]byte); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([32]byte) + } + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbRollupCoreInterface_WasmModuleRoot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WasmModuleRoot' +type ArbRollupCoreInterface_WasmModuleRoot_Call struct { + *mock.Call +} + +// WasmModuleRoot is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *ArbRollupCoreInterface_Expecter) WasmModuleRoot(opts interface{}) *ArbRollupCoreInterface_WasmModuleRoot_Call { + return &ArbRollupCoreInterface_WasmModuleRoot_Call{Call: _e.mock.On("WasmModuleRoot", opts)} +} + +func (_c *ArbRollupCoreInterface_WasmModuleRoot_Call) Run(run func(opts *bind.CallOpts)) *ArbRollupCoreInterface_WasmModuleRoot_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *ArbRollupCoreInterface_WasmModuleRoot_Call) Return(_a0 [32]byte, _a1 error) *ArbRollupCoreInterface_WasmModuleRoot_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbRollupCoreInterface_WasmModuleRoot_Call) RunAndReturn(run func(*bind.CallOpts) ([32]byte, error)) *ArbRollupCoreInterface_WasmModuleRoot_Call { + _c.Call.Return(run) + return _c +} + +// WatchNodeConfirmed provides a mock function with given fields: opts, sink, nodeNum +func (_m *ArbRollupCoreInterface) WatchNodeConfirmed(opts *bind.WatchOpts, sink chan<- *arbitrum_rollup_core.ArbRollupCoreNodeConfirmed, nodeNum []uint64) (event.Subscription, error) { + ret := _m.Called(opts, sink, nodeNum) + + if len(ret) == 0 { + panic("no return value specified for WatchNodeConfirmed") + } + + var r0 event.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *arbitrum_rollup_core.ArbRollupCoreNodeConfirmed, []uint64) (event.Subscription, error)); ok { + return rf(opts, sink, nodeNum) + } + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *arbitrum_rollup_core.ArbRollupCoreNodeConfirmed, []uint64) event.Subscription); ok { + r0 = rf(opts, sink, nodeNum) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(event.Subscription) + } + } + + if rf, ok := ret.Get(1).(func(*bind.WatchOpts, chan<- *arbitrum_rollup_core.ArbRollupCoreNodeConfirmed, []uint64) error); ok { + r1 = rf(opts, sink, nodeNum) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbRollupCoreInterface_WatchNodeConfirmed_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchNodeConfirmed' +type ArbRollupCoreInterface_WatchNodeConfirmed_Call struct { + *mock.Call +} + +// WatchNodeConfirmed is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *arbitrum_rollup_core.ArbRollupCoreNodeConfirmed +// - nodeNum []uint64 +func (_e *ArbRollupCoreInterface_Expecter) WatchNodeConfirmed(opts interface{}, sink interface{}, nodeNum interface{}) *ArbRollupCoreInterface_WatchNodeConfirmed_Call { + return &ArbRollupCoreInterface_WatchNodeConfirmed_Call{Call: _e.mock.On("WatchNodeConfirmed", opts, sink, nodeNum)} +} + +func (_c *ArbRollupCoreInterface_WatchNodeConfirmed_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *arbitrum_rollup_core.ArbRollupCoreNodeConfirmed, nodeNum []uint64)) *ArbRollupCoreInterface_WatchNodeConfirmed_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *arbitrum_rollup_core.ArbRollupCoreNodeConfirmed), args[2].([]uint64)) + }) + return _c +} + +func (_c *ArbRollupCoreInterface_WatchNodeConfirmed_Call) Return(_a0 event.Subscription, _a1 error) *ArbRollupCoreInterface_WatchNodeConfirmed_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbRollupCoreInterface_WatchNodeConfirmed_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *arbitrum_rollup_core.ArbRollupCoreNodeConfirmed, []uint64) (event.Subscription, error)) *ArbRollupCoreInterface_WatchNodeConfirmed_Call { + _c.Call.Return(run) + return _c +} + +// WatchNodeCreated provides a mock function with given fields: opts, sink, nodeNum, parentNodeHash, nodeHash +func (_m *ArbRollupCoreInterface) WatchNodeCreated(opts *bind.WatchOpts, sink chan<- *arbitrum_rollup_core.ArbRollupCoreNodeCreated, nodeNum []uint64, parentNodeHash [][32]byte, nodeHash [][32]byte) (event.Subscription, error) { + ret := _m.Called(opts, sink, nodeNum, parentNodeHash, nodeHash) + + if len(ret) == 0 { + panic("no return value specified for WatchNodeCreated") + } + + var r0 event.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *arbitrum_rollup_core.ArbRollupCoreNodeCreated, []uint64, [][32]byte, [][32]byte) (event.Subscription, error)); ok { + return rf(opts, sink, nodeNum, parentNodeHash, nodeHash) + } + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *arbitrum_rollup_core.ArbRollupCoreNodeCreated, []uint64, [][32]byte, [][32]byte) event.Subscription); ok { + r0 = rf(opts, sink, nodeNum, parentNodeHash, nodeHash) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(event.Subscription) + } + } + + if rf, ok := ret.Get(1).(func(*bind.WatchOpts, chan<- *arbitrum_rollup_core.ArbRollupCoreNodeCreated, []uint64, [][32]byte, [][32]byte) error); ok { + r1 = rf(opts, sink, nodeNum, parentNodeHash, nodeHash) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbRollupCoreInterface_WatchNodeCreated_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchNodeCreated' +type ArbRollupCoreInterface_WatchNodeCreated_Call struct { + *mock.Call +} + +// WatchNodeCreated is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *arbitrum_rollup_core.ArbRollupCoreNodeCreated +// - nodeNum []uint64 +// - parentNodeHash [][32]byte +// - nodeHash [][32]byte +func (_e *ArbRollupCoreInterface_Expecter) WatchNodeCreated(opts interface{}, sink interface{}, nodeNum interface{}, parentNodeHash interface{}, nodeHash interface{}) *ArbRollupCoreInterface_WatchNodeCreated_Call { + return &ArbRollupCoreInterface_WatchNodeCreated_Call{Call: _e.mock.On("WatchNodeCreated", opts, sink, nodeNum, parentNodeHash, nodeHash)} +} + +func (_c *ArbRollupCoreInterface_WatchNodeCreated_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *arbitrum_rollup_core.ArbRollupCoreNodeCreated, nodeNum []uint64, parentNodeHash [][32]byte, nodeHash [][32]byte)) *ArbRollupCoreInterface_WatchNodeCreated_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *arbitrum_rollup_core.ArbRollupCoreNodeCreated), args[2].([]uint64), args[3].([][32]byte), args[4].([][32]byte)) + }) + return _c +} + +func (_c *ArbRollupCoreInterface_WatchNodeCreated_Call) Return(_a0 event.Subscription, _a1 error) *ArbRollupCoreInterface_WatchNodeCreated_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbRollupCoreInterface_WatchNodeCreated_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *arbitrum_rollup_core.ArbRollupCoreNodeCreated, []uint64, [][32]byte, [][32]byte) (event.Subscription, error)) *ArbRollupCoreInterface_WatchNodeCreated_Call { + _c.Call.Return(run) + return _c +} + +// WatchNodeRejected provides a mock function with given fields: opts, sink, nodeNum +func (_m *ArbRollupCoreInterface) WatchNodeRejected(opts *bind.WatchOpts, sink chan<- *arbitrum_rollup_core.ArbRollupCoreNodeRejected, nodeNum []uint64) (event.Subscription, error) { + ret := _m.Called(opts, sink, nodeNum) + + if len(ret) == 0 { + panic("no return value specified for WatchNodeRejected") + } + + var r0 event.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *arbitrum_rollup_core.ArbRollupCoreNodeRejected, []uint64) (event.Subscription, error)); ok { + return rf(opts, sink, nodeNum) + } + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *arbitrum_rollup_core.ArbRollupCoreNodeRejected, []uint64) event.Subscription); ok { + r0 = rf(opts, sink, nodeNum) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(event.Subscription) + } + } + + if rf, ok := ret.Get(1).(func(*bind.WatchOpts, chan<- *arbitrum_rollup_core.ArbRollupCoreNodeRejected, []uint64) error); ok { + r1 = rf(opts, sink, nodeNum) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbRollupCoreInterface_WatchNodeRejected_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchNodeRejected' +type ArbRollupCoreInterface_WatchNodeRejected_Call struct { + *mock.Call +} + +// WatchNodeRejected is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *arbitrum_rollup_core.ArbRollupCoreNodeRejected +// - nodeNum []uint64 +func (_e *ArbRollupCoreInterface_Expecter) WatchNodeRejected(opts interface{}, sink interface{}, nodeNum interface{}) *ArbRollupCoreInterface_WatchNodeRejected_Call { + return &ArbRollupCoreInterface_WatchNodeRejected_Call{Call: _e.mock.On("WatchNodeRejected", opts, sink, nodeNum)} +} + +func (_c *ArbRollupCoreInterface_WatchNodeRejected_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *arbitrum_rollup_core.ArbRollupCoreNodeRejected, nodeNum []uint64)) *ArbRollupCoreInterface_WatchNodeRejected_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *arbitrum_rollup_core.ArbRollupCoreNodeRejected), args[2].([]uint64)) + }) + return _c +} + +func (_c *ArbRollupCoreInterface_WatchNodeRejected_Call) Return(_a0 event.Subscription, _a1 error) *ArbRollupCoreInterface_WatchNodeRejected_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbRollupCoreInterface_WatchNodeRejected_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *arbitrum_rollup_core.ArbRollupCoreNodeRejected, []uint64) (event.Subscription, error)) *ArbRollupCoreInterface_WatchNodeRejected_Call { + _c.Call.Return(run) + return _c +} + +// WatchRollupChallengeStarted provides a mock function with given fields: opts, sink, challengeIndex +func (_m *ArbRollupCoreInterface) WatchRollupChallengeStarted(opts *bind.WatchOpts, sink chan<- *arbitrum_rollup_core.ArbRollupCoreRollupChallengeStarted, challengeIndex []uint64) (event.Subscription, error) { + ret := _m.Called(opts, sink, challengeIndex) + + if len(ret) == 0 { + panic("no return value specified for WatchRollupChallengeStarted") + } + + var r0 event.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *arbitrum_rollup_core.ArbRollupCoreRollupChallengeStarted, []uint64) (event.Subscription, error)); ok { + return rf(opts, sink, challengeIndex) + } + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *arbitrum_rollup_core.ArbRollupCoreRollupChallengeStarted, []uint64) event.Subscription); ok { + r0 = rf(opts, sink, challengeIndex) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(event.Subscription) + } + } + + if rf, ok := ret.Get(1).(func(*bind.WatchOpts, chan<- *arbitrum_rollup_core.ArbRollupCoreRollupChallengeStarted, []uint64) error); ok { + r1 = rf(opts, sink, challengeIndex) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbRollupCoreInterface_WatchRollupChallengeStarted_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchRollupChallengeStarted' +type ArbRollupCoreInterface_WatchRollupChallengeStarted_Call struct { + *mock.Call +} + +// WatchRollupChallengeStarted is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *arbitrum_rollup_core.ArbRollupCoreRollupChallengeStarted +// - challengeIndex []uint64 +func (_e *ArbRollupCoreInterface_Expecter) WatchRollupChallengeStarted(opts interface{}, sink interface{}, challengeIndex interface{}) *ArbRollupCoreInterface_WatchRollupChallengeStarted_Call { + return &ArbRollupCoreInterface_WatchRollupChallengeStarted_Call{Call: _e.mock.On("WatchRollupChallengeStarted", opts, sink, challengeIndex)} +} + +func (_c *ArbRollupCoreInterface_WatchRollupChallengeStarted_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *arbitrum_rollup_core.ArbRollupCoreRollupChallengeStarted, challengeIndex []uint64)) *ArbRollupCoreInterface_WatchRollupChallengeStarted_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *arbitrum_rollup_core.ArbRollupCoreRollupChallengeStarted), args[2].([]uint64)) + }) + return _c +} + +func (_c *ArbRollupCoreInterface_WatchRollupChallengeStarted_Call) Return(_a0 event.Subscription, _a1 error) *ArbRollupCoreInterface_WatchRollupChallengeStarted_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbRollupCoreInterface_WatchRollupChallengeStarted_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *arbitrum_rollup_core.ArbRollupCoreRollupChallengeStarted, []uint64) (event.Subscription, error)) *ArbRollupCoreInterface_WatchRollupChallengeStarted_Call { + _c.Call.Return(run) + return _c +} + +// WatchRollupInitialized provides a mock function with given fields: opts, sink +func (_m *ArbRollupCoreInterface) WatchRollupInitialized(opts *bind.WatchOpts, sink chan<- *arbitrum_rollup_core.ArbRollupCoreRollupInitialized) (event.Subscription, error) { + ret := _m.Called(opts, sink) + + if len(ret) == 0 { + panic("no return value specified for WatchRollupInitialized") + } + + var r0 event.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *arbitrum_rollup_core.ArbRollupCoreRollupInitialized) (event.Subscription, error)); ok { + return rf(opts, sink) + } + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *arbitrum_rollup_core.ArbRollupCoreRollupInitialized) event.Subscription); ok { + r0 = rf(opts, sink) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(event.Subscription) + } + } + + if rf, ok := ret.Get(1).(func(*bind.WatchOpts, chan<- *arbitrum_rollup_core.ArbRollupCoreRollupInitialized) error); ok { + r1 = rf(opts, sink) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbRollupCoreInterface_WatchRollupInitialized_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchRollupInitialized' +type ArbRollupCoreInterface_WatchRollupInitialized_Call struct { + *mock.Call +} + +// WatchRollupInitialized is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *arbitrum_rollup_core.ArbRollupCoreRollupInitialized +func (_e *ArbRollupCoreInterface_Expecter) WatchRollupInitialized(opts interface{}, sink interface{}) *ArbRollupCoreInterface_WatchRollupInitialized_Call { + return &ArbRollupCoreInterface_WatchRollupInitialized_Call{Call: _e.mock.On("WatchRollupInitialized", opts, sink)} +} + +func (_c *ArbRollupCoreInterface_WatchRollupInitialized_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *arbitrum_rollup_core.ArbRollupCoreRollupInitialized)) *ArbRollupCoreInterface_WatchRollupInitialized_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *arbitrum_rollup_core.ArbRollupCoreRollupInitialized)) + }) + return _c +} + +func (_c *ArbRollupCoreInterface_WatchRollupInitialized_Call) Return(_a0 event.Subscription, _a1 error) *ArbRollupCoreInterface_WatchRollupInitialized_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbRollupCoreInterface_WatchRollupInitialized_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *arbitrum_rollup_core.ArbRollupCoreRollupInitialized) (event.Subscription, error)) *ArbRollupCoreInterface_WatchRollupInitialized_Call { + _c.Call.Return(run) + return _c +} + +// WatchUserStakeUpdated provides a mock function with given fields: opts, sink, user +func (_m *ArbRollupCoreInterface) WatchUserStakeUpdated(opts *bind.WatchOpts, sink chan<- *arbitrum_rollup_core.ArbRollupCoreUserStakeUpdated, user []common.Address) (event.Subscription, error) { + ret := _m.Called(opts, sink, user) + + if len(ret) == 0 { + panic("no return value specified for WatchUserStakeUpdated") + } + + var r0 event.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *arbitrum_rollup_core.ArbRollupCoreUserStakeUpdated, []common.Address) (event.Subscription, error)); ok { + return rf(opts, sink, user) + } + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *arbitrum_rollup_core.ArbRollupCoreUserStakeUpdated, []common.Address) event.Subscription); ok { + r0 = rf(opts, sink, user) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(event.Subscription) + } + } + + if rf, ok := ret.Get(1).(func(*bind.WatchOpts, chan<- *arbitrum_rollup_core.ArbRollupCoreUserStakeUpdated, []common.Address) error); ok { + r1 = rf(opts, sink, user) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbRollupCoreInterface_WatchUserStakeUpdated_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchUserStakeUpdated' +type ArbRollupCoreInterface_WatchUserStakeUpdated_Call struct { + *mock.Call +} + +// WatchUserStakeUpdated is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *arbitrum_rollup_core.ArbRollupCoreUserStakeUpdated +// - user []common.Address +func (_e *ArbRollupCoreInterface_Expecter) WatchUserStakeUpdated(opts interface{}, sink interface{}, user interface{}) *ArbRollupCoreInterface_WatchUserStakeUpdated_Call { + return &ArbRollupCoreInterface_WatchUserStakeUpdated_Call{Call: _e.mock.On("WatchUserStakeUpdated", opts, sink, user)} +} + +func (_c *ArbRollupCoreInterface_WatchUserStakeUpdated_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *arbitrum_rollup_core.ArbRollupCoreUserStakeUpdated, user []common.Address)) *ArbRollupCoreInterface_WatchUserStakeUpdated_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *arbitrum_rollup_core.ArbRollupCoreUserStakeUpdated), args[2].([]common.Address)) + }) + return _c +} + +func (_c *ArbRollupCoreInterface_WatchUserStakeUpdated_Call) Return(_a0 event.Subscription, _a1 error) *ArbRollupCoreInterface_WatchUserStakeUpdated_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbRollupCoreInterface_WatchUserStakeUpdated_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *arbitrum_rollup_core.ArbRollupCoreUserStakeUpdated, []common.Address) (event.Subscription, error)) *ArbRollupCoreInterface_WatchUserStakeUpdated_Call { + _c.Call.Return(run) + return _c +} + +// WatchUserWithdrawableFundsUpdated provides a mock function with given fields: opts, sink, user +func (_m *ArbRollupCoreInterface) WatchUserWithdrawableFundsUpdated(opts *bind.WatchOpts, sink chan<- *arbitrum_rollup_core.ArbRollupCoreUserWithdrawableFundsUpdated, user []common.Address) (event.Subscription, error) { + ret := _m.Called(opts, sink, user) + + if len(ret) == 0 { + panic("no return value specified for WatchUserWithdrawableFundsUpdated") + } + + var r0 event.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *arbitrum_rollup_core.ArbRollupCoreUserWithdrawableFundsUpdated, []common.Address) (event.Subscription, error)); ok { + return rf(opts, sink, user) + } + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *arbitrum_rollup_core.ArbRollupCoreUserWithdrawableFundsUpdated, []common.Address) event.Subscription); ok { + r0 = rf(opts, sink, user) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(event.Subscription) + } + } + + if rf, ok := ret.Get(1).(func(*bind.WatchOpts, chan<- *arbitrum_rollup_core.ArbRollupCoreUserWithdrawableFundsUpdated, []common.Address) error); ok { + r1 = rf(opts, sink, user) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbRollupCoreInterface_WatchUserWithdrawableFundsUpdated_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchUserWithdrawableFundsUpdated' +type ArbRollupCoreInterface_WatchUserWithdrawableFundsUpdated_Call struct { + *mock.Call +} + +// WatchUserWithdrawableFundsUpdated is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *arbitrum_rollup_core.ArbRollupCoreUserWithdrawableFundsUpdated +// - user []common.Address +func (_e *ArbRollupCoreInterface_Expecter) WatchUserWithdrawableFundsUpdated(opts interface{}, sink interface{}, user interface{}) *ArbRollupCoreInterface_WatchUserWithdrawableFundsUpdated_Call { + return &ArbRollupCoreInterface_WatchUserWithdrawableFundsUpdated_Call{Call: _e.mock.On("WatchUserWithdrawableFundsUpdated", opts, sink, user)} +} + +func (_c *ArbRollupCoreInterface_WatchUserWithdrawableFundsUpdated_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *arbitrum_rollup_core.ArbRollupCoreUserWithdrawableFundsUpdated, user []common.Address)) *ArbRollupCoreInterface_WatchUserWithdrawableFundsUpdated_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *arbitrum_rollup_core.ArbRollupCoreUserWithdrawableFundsUpdated), args[2].([]common.Address)) + }) + return _c +} + +func (_c *ArbRollupCoreInterface_WatchUserWithdrawableFundsUpdated_Call) Return(_a0 event.Subscription, _a1 error) *ArbRollupCoreInterface_WatchUserWithdrawableFundsUpdated_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbRollupCoreInterface_WatchUserWithdrawableFundsUpdated_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *arbitrum_rollup_core.ArbRollupCoreUserWithdrawableFundsUpdated, []common.Address) (event.Subscription, error)) *ArbRollupCoreInterface_WatchUserWithdrawableFundsUpdated_Call { + _c.Call.Return(run) + return _c +} + +// WithdrawableFunds provides a mock function with given fields: opts, owner +func (_m *ArbRollupCoreInterface) WithdrawableFunds(opts *bind.CallOpts, owner common.Address) (*big.Int, error) { + ret := _m.Called(opts, owner) + + if len(ret) == 0 { + panic("no return value specified for WithdrawableFunds") + } + + var r0 *big.Int + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts, common.Address) (*big.Int, error)); ok { + return rf(opts, owner) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts, common.Address) *big.Int); ok { + r0 = rf(opts, owner) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*big.Int) + } + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts, common.Address) error); ok { + r1 = rf(opts, owner) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbRollupCoreInterface_WithdrawableFunds_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WithdrawableFunds' +type ArbRollupCoreInterface_WithdrawableFunds_Call struct { + *mock.Call +} + +// WithdrawableFunds is a helper method to define mock.On call +// - opts *bind.CallOpts +// - owner common.Address +func (_e *ArbRollupCoreInterface_Expecter) WithdrawableFunds(opts interface{}, owner interface{}) *ArbRollupCoreInterface_WithdrawableFunds_Call { + return &ArbRollupCoreInterface_WithdrawableFunds_Call{Call: _e.mock.On("WithdrawableFunds", opts, owner)} +} + +func (_c *ArbRollupCoreInterface_WithdrawableFunds_Call) Run(run func(opts *bind.CallOpts, owner common.Address)) *ArbRollupCoreInterface_WithdrawableFunds_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts), args[1].(common.Address)) + }) + return _c +} + +func (_c *ArbRollupCoreInterface_WithdrawableFunds_Call) Return(_a0 *big.Int, _a1 error) *ArbRollupCoreInterface_WithdrawableFunds_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbRollupCoreInterface_WithdrawableFunds_Call) RunAndReturn(run func(*bind.CallOpts, common.Address) (*big.Int, error)) *ArbRollupCoreInterface_WithdrawableFunds_Call { + _c.Call.Return(run) + return _c +} + +// ZombieAddress provides a mock function with given fields: opts, zombieNum +func (_m *ArbRollupCoreInterface) ZombieAddress(opts *bind.CallOpts, zombieNum *big.Int) (common.Address, error) { + ret := _m.Called(opts, zombieNum) + + if len(ret) == 0 { + panic("no return value specified for ZombieAddress") + } + + var r0 common.Address + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts, *big.Int) (common.Address, error)); ok { + return rf(opts, zombieNum) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts, *big.Int) common.Address); ok { + r0 = rf(opts, zombieNum) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Address) + } + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts, *big.Int) error); ok { + r1 = rf(opts, zombieNum) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbRollupCoreInterface_ZombieAddress_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ZombieAddress' +type ArbRollupCoreInterface_ZombieAddress_Call struct { + *mock.Call +} + +// ZombieAddress is a helper method to define mock.On call +// - opts *bind.CallOpts +// - zombieNum *big.Int +func (_e *ArbRollupCoreInterface_Expecter) ZombieAddress(opts interface{}, zombieNum interface{}) *ArbRollupCoreInterface_ZombieAddress_Call { + return &ArbRollupCoreInterface_ZombieAddress_Call{Call: _e.mock.On("ZombieAddress", opts, zombieNum)} +} + +func (_c *ArbRollupCoreInterface_ZombieAddress_Call) Run(run func(opts *bind.CallOpts, zombieNum *big.Int)) *ArbRollupCoreInterface_ZombieAddress_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts), args[1].(*big.Int)) + }) + return _c +} + +func (_c *ArbRollupCoreInterface_ZombieAddress_Call) Return(_a0 common.Address, _a1 error) *ArbRollupCoreInterface_ZombieAddress_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbRollupCoreInterface_ZombieAddress_Call) RunAndReturn(run func(*bind.CallOpts, *big.Int) (common.Address, error)) *ArbRollupCoreInterface_ZombieAddress_Call { + _c.Call.Return(run) + return _c +} + +// ZombieCount provides a mock function with given fields: opts +func (_m *ArbRollupCoreInterface) ZombieCount(opts *bind.CallOpts) (*big.Int, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for ZombieCount") + } + + var r0 *big.Int + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts) (*big.Int, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts) *big.Int); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*big.Int) + } + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbRollupCoreInterface_ZombieCount_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ZombieCount' +type ArbRollupCoreInterface_ZombieCount_Call struct { + *mock.Call +} + +// ZombieCount is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *ArbRollupCoreInterface_Expecter) ZombieCount(opts interface{}) *ArbRollupCoreInterface_ZombieCount_Call { + return &ArbRollupCoreInterface_ZombieCount_Call{Call: _e.mock.On("ZombieCount", opts)} +} + +func (_c *ArbRollupCoreInterface_ZombieCount_Call) Run(run func(opts *bind.CallOpts)) *ArbRollupCoreInterface_ZombieCount_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *ArbRollupCoreInterface_ZombieCount_Call) Return(_a0 *big.Int, _a1 error) *ArbRollupCoreInterface_ZombieCount_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbRollupCoreInterface_ZombieCount_Call) RunAndReturn(run func(*bind.CallOpts) (*big.Int, error)) *ArbRollupCoreInterface_ZombieCount_Call { + _c.Call.Return(run) + return _c +} + +// ZombieLatestStakedNode provides a mock function with given fields: opts, zombieNum +func (_m *ArbRollupCoreInterface) ZombieLatestStakedNode(opts *bind.CallOpts, zombieNum *big.Int) (uint64, error) { + ret := _m.Called(opts, zombieNum) + + if len(ret) == 0 { + panic("no return value specified for ZombieLatestStakedNode") + } + + var r0 uint64 + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts, *big.Int) (uint64, error)); ok { + return rf(opts, zombieNum) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts, *big.Int) uint64); ok { + r0 = rf(opts, zombieNum) + } else { + r0 = ret.Get(0).(uint64) + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts, *big.Int) error); ok { + r1 = rf(opts, zombieNum) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbRollupCoreInterface_ZombieLatestStakedNode_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ZombieLatestStakedNode' +type ArbRollupCoreInterface_ZombieLatestStakedNode_Call struct { + *mock.Call +} + +// ZombieLatestStakedNode is a helper method to define mock.On call +// - opts *bind.CallOpts +// - zombieNum *big.Int +func (_e *ArbRollupCoreInterface_Expecter) ZombieLatestStakedNode(opts interface{}, zombieNum interface{}) *ArbRollupCoreInterface_ZombieLatestStakedNode_Call { + return &ArbRollupCoreInterface_ZombieLatestStakedNode_Call{Call: _e.mock.On("ZombieLatestStakedNode", opts, zombieNum)} +} + +func (_c *ArbRollupCoreInterface_ZombieLatestStakedNode_Call) Run(run func(opts *bind.CallOpts, zombieNum *big.Int)) *ArbRollupCoreInterface_ZombieLatestStakedNode_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts), args[1].(*big.Int)) + }) + return _c +} + +func (_c *ArbRollupCoreInterface_ZombieLatestStakedNode_Call) Return(_a0 uint64, _a1 error) *ArbRollupCoreInterface_ZombieLatestStakedNode_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbRollupCoreInterface_ZombieLatestStakedNode_Call) RunAndReturn(run func(*bind.CallOpts, *big.Int) (uint64, error)) *ArbRollupCoreInterface_ZombieLatestStakedNode_Call { + _c.Call.Return(run) + return _c +} + +// NewArbRollupCoreInterface creates a new instance of ArbRollupCoreInterface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewArbRollupCoreInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *ArbRollupCoreInterface { + mock := &ArbRollupCoreInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/core/gethwrappers/liquiditymanager/mocks/mock_arbsys/arb_sys_interface.go b/core/gethwrappers/liquiditymanager/mocks/mock_arbsys/arb_sys_interface.go new file mode 100644 index 00000000000..609cff0ceda --- /dev/null +++ b/core/gethwrappers/liquiditymanager/mocks/mock_arbsys/arb_sys_interface.go @@ -0,0 +1,1392 @@ +// Code generated by mockery v2.43.2. DO NOT EDIT. + +package mock_arbsys + +import ( + big "math/big" + + arbsys "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/liquiditymanager/generated/arbsys" + + bind "github.com/ethereum/go-ethereum/accounts/abi/bind" + + common "github.com/ethereum/go-ethereum/common" + + event "github.com/ethereum/go-ethereum/event" + + generated "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" + + mock "github.com/stretchr/testify/mock" + + types "github.com/ethereum/go-ethereum/core/types" +) + +// ArbSysInterface is an autogenerated mock type for the ArbSysInterface type +type ArbSysInterface struct { + mock.Mock +} + +type ArbSysInterface_Expecter struct { + mock *mock.Mock +} + +func (_m *ArbSysInterface) EXPECT() *ArbSysInterface_Expecter { + return &ArbSysInterface_Expecter{mock: &_m.Mock} +} + +// Address provides a mock function with given fields: +func (_m *ArbSysInterface) Address() common.Address { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Address") + } + + var r0 common.Address + if rf, ok := ret.Get(0).(func() common.Address); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Address) + } + } + + return r0 +} + +// ArbSysInterface_Address_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Address' +type ArbSysInterface_Address_Call struct { + *mock.Call +} + +// Address is a helper method to define mock.On call +func (_e *ArbSysInterface_Expecter) Address() *ArbSysInterface_Address_Call { + return &ArbSysInterface_Address_Call{Call: _e.mock.On("Address")} +} + +func (_c *ArbSysInterface_Address_Call) Run(run func()) *ArbSysInterface_Address_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ArbSysInterface_Address_Call) Return(_a0 common.Address) *ArbSysInterface_Address_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ArbSysInterface_Address_Call) RunAndReturn(run func() common.Address) *ArbSysInterface_Address_Call { + _c.Call.Return(run) + return _c +} + +// ArbBlockHash provides a mock function with given fields: opts, arbBlockNum +func (_m *ArbSysInterface) ArbBlockHash(opts *bind.CallOpts, arbBlockNum *big.Int) ([32]byte, error) { + ret := _m.Called(opts, arbBlockNum) + + if len(ret) == 0 { + panic("no return value specified for ArbBlockHash") + } + + var r0 [32]byte + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts, *big.Int) ([32]byte, error)); ok { + return rf(opts, arbBlockNum) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts, *big.Int) [32]byte); ok { + r0 = rf(opts, arbBlockNum) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([32]byte) + } + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts, *big.Int) error); ok { + r1 = rf(opts, arbBlockNum) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbSysInterface_ArbBlockHash_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ArbBlockHash' +type ArbSysInterface_ArbBlockHash_Call struct { + *mock.Call +} + +// ArbBlockHash is a helper method to define mock.On call +// - opts *bind.CallOpts +// - arbBlockNum *big.Int +func (_e *ArbSysInterface_Expecter) ArbBlockHash(opts interface{}, arbBlockNum interface{}) *ArbSysInterface_ArbBlockHash_Call { + return &ArbSysInterface_ArbBlockHash_Call{Call: _e.mock.On("ArbBlockHash", opts, arbBlockNum)} +} + +func (_c *ArbSysInterface_ArbBlockHash_Call) Run(run func(opts *bind.CallOpts, arbBlockNum *big.Int)) *ArbSysInterface_ArbBlockHash_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts), args[1].(*big.Int)) + }) + return _c +} + +func (_c *ArbSysInterface_ArbBlockHash_Call) Return(_a0 [32]byte, _a1 error) *ArbSysInterface_ArbBlockHash_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbSysInterface_ArbBlockHash_Call) RunAndReturn(run func(*bind.CallOpts, *big.Int) ([32]byte, error)) *ArbSysInterface_ArbBlockHash_Call { + _c.Call.Return(run) + return _c +} + +// ArbBlockNumber provides a mock function with given fields: opts +func (_m *ArbSysInterface) ArbBlockNumber(opts *bind.CallOpts) (*big.Int, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for ArbBlockNumber") + } + + var r0 *big.Int + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts) (*big.Int, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts) *big.Int); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*big.Int) + } + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbSysInterface_ArbBlockNumber_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ArbBlockNumber' +type ArbSysInterface_ArbBlockNumber_Call struct { + *mock.Call +} + +// ArbBlockNumber is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *ArbSysInterface_Expecter) ArbBlockNumber(opts interface{}) *ArbSysInterface_ArbBlockNumber_Call { + return &ArbSysInterface_ArbBlockNumber_Call{Call: _e.mock.On("ArbBlockNumber", opts)} +} + +func (_c *ArbSysInterface_ArbBlockNumber_Call) Run(run func(opts *bind.CallOpts)) *ArbSysInterface_ArbBlockNumber_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *ArbSysInterface_ArbBlockNumber_Call) Return(_a0 *big.Int, _a1 error) *ArbSysInterface_ArbBlockNumber_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbSysInterface_ArbBlockNumber_Call) RunAndReturn(run func(*bind.CallOpts) (*big.Int, error)) *ArbSysInterface_ArbBlockNumber_Call { + _c.Call.Return(run) + return _c +} + +// ArbChainID provides a mock function with given fields: opts +func (_m *ArbSysInterface) ArbChainID(opts *bind.CallOpts) (*big.Int, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for ArbChainID") + } + + var r0 *big.Int + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts) (*big.Int, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts) *big.Int); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*big.Int) + } + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbSysInterface_ArbChainID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ArbChainID' +type ArbSysInterface_ArbChainID_Call struct { + *mock.Call +} + +// ArbChainID is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *ArbSysInterface_Expecter) ArbChainID(opts interface{}) *ArbSysInterface_ArbChainID_Call { + return &ArbSysInterface_ArbChainID_Call{Call: _e.mock.On("ArbChainID", opts)} +} + +func (_c *ArbSysInterface_ArbChainID_Call) Run(run func(opts *bind.CallOpts)) *ArbSysInterface_ArbChainID_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *ArbSysInterface_ArbChainID_Call) Return(_a0 *big.Int, _a1 error) *ArbSysInterface_ArbChainID_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbSysInterface_ArbChainID_Call) RunAndReturn(run func(*bind.CallOpts) (*big.Int, error)) *ArbSysInterface_ArbChainID_Call { + _c.Call.Return(run) + return _c +} + +// ArbOSVersion provides a mock function with given fields: opts +func (_m *ArbSysInterface) ArbOSVersion(opts *bind.CallOpts) (*big.Int, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for ArbOSVersion") + } + + var r0 *big.Int + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts) (*big.Int, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts) *big.Int); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*big.Int) + } + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbSysInterface_ArbOSVersion_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ArbOSVersion' +type ArbSysInterface_ArbOSVersion_Call struct { + *mock.Call +} + +// ArbOSVersion is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *ArbSysInterface_Expecter) ArbOSVersion(opts interface{}) *ArbSysInterface_ArbOSVersion_Call { + return &ArbSysInterface_ArbOSVersion_Call{Call: _e.mock.On("ArbOSVersion", opts)} +} + +func (_c *ArbSysInterface_ArbOSVersion_Call) Run(run func(opts *bind.CallOpts)) *ArbSysInterface_ArbOSVersion_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *ArbSysInterface_ArbOSVersion_Call) Return(_a0 *big.Int, _a1 error) *ArbSysInterface_ArbOSVersion_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbSysInterface_ArbOSVersion_Call) RunAndReturn(run func(*bind.CallOpts) (*big.Int, error)) *ArbSysInterface_ArbOSVersion_Call { + _c.Call.Return(run) + return _c +} + +// FilterL2ToL1Transaction provides a mock function with given fields: opts, destination, uniqueId, batchNumber +func (_m *ArbSysInterface) FilterL2ToL1Transaction(opts *bind.FilterOpts, destination []common.Address, uniqueId []*big.Int, batchNumber []*big.Int) (*arbsys.ArbSysL2ToL1TransactionIterator, error) { + ret := _m.Called(opts, destination, uniqueId, batchNumber) + + if len(ret) == 0 { + panic("no return value specified for FilterL2ToL1Transaction") + } + + var r0 *arbsys.ArbSysL2ToL1TransactionIterator + var r1 error + if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []common.Address, []*big.Int, []*big.Int) (*arbsys.ArbSysL2ToL1TransactionIterator, error)); ok { + return rf(opts, destination, uniqueId, batchNumber) + } + if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []common.Address, []*big.Int, []*big.Int) *arbsys.ArbSysL2ToL1TransactionIterator); ok { + r0 = rf(opts, destination, uniqueId, batchNumber) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*arbsys.ArbSysL2ToL1TransactionIterator) + } + } + + if rf, ok := ret.Get(1).(func(*bind.FilterOpts, []common.Address, []*big.Int, []*big.Int) error); ok { + r1 = rf(opts, destination, uniqueId, batchNumber) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbSysInterface_FilterL2ToL1Transaction_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterL2ToL1Transaction' +type ArbSysInterface_FilterL2ToL1Transaction_Call struct { + *mock.Call +} + +// FilterL2ToL1Transaction is a helper method to define mock.On call +// - opts *bind.FilterOpts +// - destination []common.Address +// - uniqueId []*big.Int +// - batchNumber []*big.Int +func (_e *ArbSysInterface_Expecter) FilterL2ToL1Transaction(opts interface{}, destination interface{}, uniqueId interface{}, batchNumber interface{}) *ArbSysInterface_FilterL2ToL1Transaction_Call { + return &ArbSysInterface_FilterL2ToL1Transaction_Call{Call: _e.mock.On("FilterL2ToL1Transaction", opts, destination, uniqueId, batchNumber)} +} + +func (_c *ArbSysInterface_FilterL2ToL1Transaction_Call) Run(run func(opts *bind.FilterOpts, destination []common.Address, uniqueId []*big.Int, batchNumber []*big.Int)) *ArbSysInterface_FilterL2ToL1Transaction_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts), args[1].([]common.Address), args[2].([]*big.Int), args[3].([]*big.Int)) + }) + return _c +} + +func (_c *ArbSysInterface_FilterL2ToL1Transaction_Call) Return(_a0 *arbsys.ArbSysL2ToL1TransactionIterator, _a1 error) *ArbSysInterface_FilterL2ToL1Transaction_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbSysInterface_FilterL2ToL1Transaction_Call) RunAndReturn(run func(*bind.FilterOpts, []common.Address, []*big.Int, []*big.Int) (*arbsys.ArbSysL2ToL1TransactionIterator, error)) *ArbSysInterface_FilterL2ToL1Transaction_Call { + _c.Call.Return(run) + return _c +} + +// FilterL2ToL1Tx provides a mock function with given fields: opts, destination, hash, position +func (_m *ArbSysInterface) FilterL2ToL1Tx(opts *bind.FilterOpts, destination []common.Address, hash []*big.Int, position []*big.Int) (*arbsys.ArbSysL2ToL1TxIterator, error) { + ret := _m.Called(opts, destination, hash, position) + + if len(ret) == 0 { + panic("no return value specified for FilterL2ToL1Tx") + } + + var r0 *arbsys.ArbSysL2ToL1TxIterator + var r1 error + if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []common.Address, []*big.Int, []*big.Int) (*arbsys.ArbSysL2ToL1TxIterator, error)); ok { + return rf(opts, destination, hash, position) + } + if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []common.Address, []*big.Int, []*big.Int) *arbsys.ArbSysL2ToL1TxIterator); ok { + r0 = rf(opts, destination, hash, position) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*arbsys.ArbSysL2ToL1TxIterator) + } + } + + if rf, ok := ret.Get(1).(func(*bind.FilterOpts, []common.Address, []*big.Int, []*big.Int) error); ok { + r1 = rf(opts, destination, hash, position) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbSysInterface_FilterL2ToL1Tx_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterL2ToL1Tx' +type ArbSysInterface_FilterL2ToL1Tx_Call struct { + *mock.Call +} + +// FilterL2ToL1Tx is a helper method to define mock.On call +// - opts *bind.FilterOpts +// - destination []common.Address +// - hash []*big.Int +// - position []*big.Int +func (_e *ArbSysInterface_Expecter) FilterL2ToL1Tx(opts interface{}, destination interface{}, hash interface{}, position interface{}) *ArbSysInterface_FilterL2ToL1Tx_Call { + return &ArbSysInterface_FilterL2ToL1Tx_Call{Call: _e.mock.On("FilterL2ToL1Tx", opts, destination, hash, position)} +} + +func (_c *ArbSysInterface_FilterL2ToL1Tx_Call) Run(run func(opts *bind.FilterOpts, destination []common.Address, hash []*big.Int, position []*big.Int)) *ArbSysInterface_FilterL2ToL1Tx_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts), args[1].([]common.Address), args[2].([]*big.Int), args[3].([]*big.Int)) + }) + return _c +} + +func (_c *ArbSysInterface_FilterL2ToL1Tx_Call) Return(_a0 *arbsys.ArbSysL2ToL1TxIterator, _a1 error) *ArbSysInterface_FilterL2ToL1Tx_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbSysInterface_FilterL2ToL1Tx_Call) RunAndReturn(run func(*bind.FilterOpts, []common.Address, []*big.Int, []*big.Int) (*arbsys.ArbSysL2ToL1TxIterator, error)) *ArbSysInterface_FilterL2ToL1Tx_Call { + _c.Call.Return(run) + return _c +} + +// FilterSendMerkleUpdate provides a mock function with given fields: opts, reserved, hash, position +func (_m *ArbSysInterface) FilterSendMerkleUpdate(opts *bind.FilterOpts, reserved []*big.Int, hash [][32]byte, position []*big.Int) (*arbsys.ArbSysSendMerkleUpdateIterator, error) { + ret := _m.Called(opts, reserved, hash, position) + + if len(ret) == 0 { + panic("no return value specified for FilterSendMerkleUpdate") + } + + var r0 *arbsys.ArbSysSendMerkleUpdateIterator + var r1 error + if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []*big.Int, [][32]byte, []*big.Int) (*arbsys.ArbSysSendMerkleUpdateIterator, error)); ok { + return rf(opts, reserved, hash, position) + } + if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []*big.Int, [][32]byte, []*big.Int) *arbsys.ArbSysSendMerkleUpdateIterator); ok { + r0 = rf(opts, reserved, hash, position) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*arbsys.ArbSysSendMerkleUpdateIterator) + } + } + + if rf, ok := ret.Get(1).(func(*bind.FilterOpts, []*big.Int, [][32]byte, []*big.Int) error); ok { + r1 = rf(opts, reserved, hash, position) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbSysInterface_FilterSendMerkleUpdate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterSendMerkleUpdate' +type ArbSysInterface_FilterSendMerkleUpdate_Call struct { + *mock.Call +} + +// FilterSendMerkleUpdate is a helper method to define mock.On call +// - opts *bind.FilterOpts +// - reserved []*big.Int +// - hash [][32]byte +// - position []*big.Int +func (_e *ArbSysInterface_Expecter) FilterSendMerkleUpdate(opts interface{}, reserved interface{}, hash interface{}, position interface{}) *ArbSysInterface_FilterSendMerkleUpdate_Call { + return &ArbSysInterface_FilterSendMerkleUpdate_Call{Call: _e.mock.On("FilterSendMerkleUpdate", opts, reserved, hash, position)} +} + +func (_c *ArbSysInterface_FilterSendMerkleUpdate_Call) Run(run func(opts *bind.FilterOpts, reserved []*big.Int, hash [][32]byte, position []*big.Int)) *ArbSysInterface_FilterSendMerkleUpdate_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts), args[1].([]*big.Int), args[2].([][32]byte), args[3].([]*big.Int)) + }) + return _c +} + +func (_c *ArbSysInterface_FilterSendMerkleUpdate_Call) Return(_a0 *arbsys.ArbSysSendMerkleUpdateIterator, _a1 error) *ArbSysInterface_FilterSendMerkleUpdate_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbSysInterface_FilterSendMerkleUpdate_Call) RunAndReturn(run func(*bind.FilterOpts, []*big.Int, [][32]byte, []*big.Int) (*arbsys.ArbSysSendMerkleUpdateIterator, error)) *ArbSysInterface_FilterSendMerkleUpdate_Call { + _c.Call.Return(run) + return _c +} + +// GetStorageGasAvailable provides a mock function with given fields: opts +func (_m *ArbSysInterface) GetStorageGasAvailable(opts *bind.CallOpts) (*big.Int, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for GetStorageGasAvailable") + } + + var r0 *big.Int + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts) (*big.Int, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts) *big.Int); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*big.Int) + } + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbSysInterface_GetStorageGasAvailable_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetStorageGasAvailable' +type ArbSysInterface_GetStorageGasAvailable_Call struct { + *mock.Call +} + +// GetStorageGasAvailable is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *ArbSysInterface_Expecter) GetStorageGasAvailable(opts interface{}) *ArbSysInterface_GetStorageGasAvailable_Call { + return &ArbSysInterface_GetStorageGasAvailable_Call{Call: _e.mock.On("GetStorageGasAvailable", opts)} +} + +func (_c *ArbSysInterface_GetStorageGasAvailable_Call) Run(run func(opts *bind.CallOpts)) *ArbSysInterface_GetStorageGasAvailable_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *ArbSysInterface_GetStorageGasAvailable_Call) Return(_a0 *big.Int, _a1 error) *ArbSysInterface_GetStorageGasAvailable_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbSysInterface_GetStorageGasAvailable_Call) RunAndReturn(run func(*bind.CallOpts) (*big.Int, error)) *ArbSysInterface_GetStorageGasAvailable_Call { + _c.Call.Return(run) + return _c +} + +// IsTopLevelCall provides a mock function with given fields: opts +func (_m *ArbSysInterface) IsTopLevelCall(opts *bind.CallOpts) (bool, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for IsTopLevelCall") + } + + var r0 bool + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts) (bool, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts) bool); ok { + r0 = rf(opts) + } else { + r0 = ret.Get(0).(bool) + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbSysInterface_IsTopLevelCall_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsTopLevelCall' +type ArbSysInterface_IsTopLevelCall_Call struct { + *mock.Call +} + +// IsTopLevelCall is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *ArbSysInterface_Expecter) IsTopLevelCall(opts interface{}) *ArbSysInterface_IsTopLevelCall_Call { + return &ArbSysInterface_IsTopLevelCall_Call{Call: _e.mock.On("IsTopLevelCall", opts)} +} + +func (_c *ArbSysInterface_IsTopLevelCall_Call) Run(run func(opts *bind.CallOpts)) *ArbSysInterface_IsTopLevelCall_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *ArbSysInterface_IsTopLevelCall_Call) Return(_a0 bool, _a1 error) *ArbSysInterface_IsTopLevelCall_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbSysInterface_IsTopLevelCall_Call) RunAndReturn(run func(*bind.CallOpts) (bool, error)) *ArbSysInterface_IsTopLevelCall_Call { + _c.Call.Return(run) + return _c +} + +// MapL1SenderContractAddressToL2Alias provides a mock function with given fields: opts, sender, unused +func (_m *ArbSysInterface) MapL1SenderContractAddressToL2Alias(opts *bind.CallOpts, sender common.Address, unused common.Address) (common.Address, error) { + ret := _m.Called(opts, sender, unused) + + if len(ret) == 0 { + panic("no return value specified for MapL1SenderContractAddressToL2Alias") + } + + var r0 common.Address + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts, common.Address, common.Address) (common.Address, error)); ok { + return rf(opts, sender, unused) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts, common.Address, common.Address) common.Address); ok { + r0 = rf(opts, sender, unused) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Address) + } + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts, common.Address, common.Address) error); ok { + r1 = rf(opts, sender, unused) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbSysInterface_MapL1SenderContractAddressToL2Alias_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MapL1SenderContractAddressToL2Alias' +type ArbSysInterface_MapL1SenderContractAddressToL2Alias_Call struct { + *mock.Call +} + +// MapL1SenderContractAddressToL2Alias is a helper method to define mock.On call +// - opts *bind.CallOpts +// - sender common.Address +// - unused common.Address +func (_e *ArbSysInterface_Expecter) MapL1SenderContractAddressToL2Alias(opts interface{}, sender interface{}, unused interface{}) *ArbSysInterface_MapL1SenderContractAddressToL2Alias_Call { + return &ArbSysInterface_MapL1SenderContractAddressToL2Alias_Call{Call: _e.mock.On("MapL1SenderContractAddressToL2Alias", opts, sender, unused)} +} + +func (_c *ArbSysInterface_MapL1SenderContractAddressToL2Alias_Call) Run(run func(opts *bind.CallOpts, sender common.Address, unused common.Address)) *ArbSysInterface_MapL1SenderContractAddressToL2Alias_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts), args[1].(common.Address), args[2].(common.Address)) + }) + return _c +} + +func (_c *ArbSysInterface_MapL1SenderContractAddressToL2Alias_Call) Return(_a0 common.Address, _a1 error) *ArbSysInterface_MapL1SenderContractAddressToL2Alias_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbSysInterface_MapL1SenderContractAddressToL2Alias_Call) RunAndReturn(run func(*bind.CallOpts, common.Address, common.Address) (common.Address, error)) *ArbSysInterface_MapL1SenderContractAddressToL2Alias_Call { + _c.Call.Return(run) + return _c +} + +// MyCallersAddressWithoutAliasing provides a mock function with given fields: opts +func (_m *ArbSysInterface) MyCallersAddressWithoutAliasing(opts *bind.CallOpts) (common.Address, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for MyCallersAddressWithoutAliasing") + } + + var r0 common.Address + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts) (common.Address, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts) common.Address); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Address) + } + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbSysInterface_MyCallersAddressWithoutAliasing_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MyCallersAddressWithoutAliasing' +type ArbSysInterface_MyCallersAddressWithoutAliasing_Call struct { + *mock.Call +} + +// MyCallersAddressWithoutAliasing is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *ArbSysInterface_Expecter) MyCallersAddressWithoutAliasing(opts interface{}) *ArbSysInterface_MyCallersAddressWithoutAliasing_Call { + return &ArbSysInterface_MyCallersAddressWithoutAliasing_Call{Call: _e.mock.On("MyCallersAddressWithoutAliasing", opts)} +} + +func (_c *ArbSysInterface_MyCallersAddressWithoutAliasing_Call) Run(run func(opts *bind.CallOpts)) *ArbSysInterface_MyCallersAddressWithoutAliasing_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *ArbSysInterface_MyCallersAddressWithoutAliasing_Call) Return(_a0 common.Address, _a1 error) *ArbSysInterface_MyCallersAddressWithoutAliasing_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbSysInterface_MyCallersAddressWithoutAliasing_Call) RunAndReturn(run func(*bind.CallOpts) (common.Address, error)) *ArbSysInterface_MyCallersAddressWithoutAliasing_Call { + _c.Call.Return(run) + return _c +} + +// ParseL2ToL1Transaction provides a mock function with given fields: log +func (_m *ArbSysInterface) ParseL2ToL1Transaction(log types.Log) (*arbsys.ArbSysL2ToL1Transaction, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParseL2ToL1Transaction") + } + + var r0 *arbsys.ArbSysL2ToL1Transaction + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (*arbsys.ArbSysL2ToL1Transaction, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) *arbsys.ArbSysL2ToL1Transaction); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*arbsys.ArbSysL2ToL1Transaction) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbSysInterface_ParseL2ToL1Transaction_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseL2ToL1Transaction' +type ArbSysInterface_ParseL2ToL1Transaction_Call struct { + *mock.Call +} + +// ParseL2ToL1Transaction is a helper method to define mock.On call +// - log types.Log +func (_e *ArbSysInterface_Expecter) ParseL2ToL1Transaction(log interface{}) *ArbSysInterface_ParseL2ToL1Transaction_Call { + return &ArbSysInterface_ParseL2ToL1Transaction_Call{Call: _e.mock.On("ParseL2ToL1Transaction", log)} +} + +func (_c *ArbSysInterface_ParseL2ToL1Transaction_Call) Run(run func(log types.Log)) *ArbSysInterface_ParseL2ToL1Transaction_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *ArbSysInterface_ParseL2ToL1Transaction_Call) Return(_a0 *arbsys.ArbSysL2ToL1Transaction, _a1 error) *ArbSysInterface_ParseL2ToL1Transaction_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbSysInterface_ParseL2ToL1Transaction_Call) RunAndReturn(run func(types.Log) (*arbsys.ArbSysL2ToL1Transaction, error)) *ArbSysInterface_ParseL2ToL1Transaction_Call { + _c.Call.Return(run) + return _c +} + +// ParseL2ToL1Tx provides a mock function with given fields: log +func (_m *ArbSysInterface) ParseL2ToL1Tx(log types.Log) (*arbsys.ArbSysL2ToL1Tx, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParseL2ToL1Tx") + } + + var r0 *arbsys.ArbSysL2ToL1Tx + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (*arbsys.ArbSysL2ToL1Tx, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) *arbsys.ArbSysL2ToL1Tx); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*arbsys.ArbSysL2ToL1Tx) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbSysInterface_ParseL2ToL1Tx_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseL2ToL1Tx' +type ArbSysInterface_ParseL2ToL1Tx_Call struct { + *mock.Call +} + +// ParseL2ToL1Tx is a helper method to define mock.On call +// - log types.Log +func (_e *ArbSysInterface_Expecter) ParseL2ToL1Tx(log interface{}) *ArbSysInterface_ParseL2ToL1Tx_Call { + return &ArbSysInterface_ParseL2ToL1Tx_Call{Call: _e.mock.On("ParseL2ToL1Tx", log)} +} + +func (_c *ArbSysInterface_ParseL2ToL1Tx_Call) Run(run func(log types.Log)) *ArbSysInterface_ParseL2ToL1Tx_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *ArbSysInterface_ParseL2ToL1Tx_Call) Return(_a0 *arbsys.ArbSysL2ToL1Tx, _a1 error) *ArbSysInterface_ParseL2ToL1Tx_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbSysInterface_ParseL2ToL1Tx_Call) RunAndReturn(run func(types.Log) (*arbsys.ArbSysL2ToL1Tx, error)) *ArbSysInterface_ParseL2ToL1Tx_Call { + _c.Call.Return(run) + return _c +} + +// ParseLog provides a mock function with given fields: log +func (_m *ArbSysInterface) ParseLog(log types.Log) (generated.AbigenLog, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParseLog") + } + + var r0 generated.AbigenLog + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (generated.AbigenLog, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) generated.AbigenLog); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(generated.AbigenLog) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbSysInterface_ParseLog_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseLog' +type ArbSysInterface_ParseLog_Call struct { + *mock.Call +} + +// ParseLog is a helper method to define mock.On call +// - log types.Log +func (_e *ArbSysInterface_Expecter) ParseLog(log interface{}) *ArbSysInterface_ParseLog_Call { + return &ArbSysInterface_ParseLog_Call{Call: _e.mock.On("ParseLog", log)} +} + +func (_c *ArbSysInterface_ParseLog_Call) Run(run func(log types.Log)) *ArbSysInterface_ParseLog_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *ArbSysInterface_ParseLog_Call) Return(_a0 generated.AbigenLog, _a1 error) *ArbSysInterface_ParseLog_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbSysInterface_ParseLog_Call) RunAndReturn(run func(types.Log) (generated.AbigenLog, error)) *ArbSysInterface_ParseLog_Call { + _c.Call.Return(run) + return _c +} + +// ParseSendMerkleUpdate provides a mock function with given fields: log +func (_m *ArbSysInterface) ParseSendMerkleUpdate(log types.Log) (*arbsys.ArbSysSendMerkleUpdate, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParseSendMerkleUpdate") + } + + var r0 *arbsys.ArbSysSendMerkleUpdate + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (*arbsys.ArbSysSendMerkleUpdate, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) *arbsys.ArbSysSendMerkleUpdate); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*arbsys.ArbSysSendMerkleUpdate) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbSysInterface_ParseSendMerkleUpdate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseSendMerkleUpdate' +type ArbSysInterface_ParseSendMerkleUpdate_Call struct { + *mock.Call +} + +// ParseSendMerkleUpdate is a helper method to define mock.On call +// - log types.Log +func (_e *ArbSysInterface_Expecter) ParseSendMerkleUpdate(log interface{}) *ArbSysInterface_ParseSendMerkleUpdate_Call { + return &ArbSysInterface_ParseSendMerkleUpdate_Call{Call: _e.mock.On("ParseSendMerkleUpdate", log)} +} + +func (_c *ArbSysInterface_ParseSendMerkleUpdate_Call) Run(run func(log types.Log)) *ArbSysInterface_ParseSendMerkleUpdate_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *ArbSysInterface_ParseSendMerkleUpdate_Call) Return(_a0 *arbsys.ArbSysSendMerkleUpdate, _a1 error) *ArbSysInterface_ParseSendMerkleUpdate_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbSysInterface_ParseSendMerkleUpdate_Call) RunAndReturn(run func(types.Log) (*arbsys.ArbSysSendMerkleUpdate, error)) *ArbSysInterface_ParseSendMerkleUpdate_Call { + _c.Call.Return(run) + return _c +} + +// SendMerkleTreeState provides a mock function with given fields: opts +func (_m *ArbSysInterface) SendMerkleTreeState(opts *bind.CallOpts) (arbsys.SendMerkleTreeState, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for SendMerkleTreeState") + } + + var r0 arbsys.SendMerkleTreeState + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts) (arbsys.SendMerkleTreeState, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts) arbsys.SendMerkleTreeState); ok { + r0 = rf(opts) + } else { + r0 = ret.Get(0).(arbsys.SendMerkleTreeState) + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbSysInterface_SendMerkleTreeState_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SendMerkleTreeState' +type ArbSysInterface_SendMerkleTreeState_Call struct { + *mock.Call +} + +// SendMerkleTreeState is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *ArbSysInterface_Expecter) SendMerkleTreeState(opts interface{}) *ArbSysInterface_SendMerkleTreeState_Call { + return &ArbSysInterface_SendMerkleTreeState_Call{Call: _e.mock.On("SendMerkleTreeState", opts)} +} + +func (_c *ArbSysInterface_SendMerkleTreeState_Call) Run(run func(opts *bind.CallOpts)) *ArbSysInterface_SendMerkleTreeState_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *ArbSysInterface_SendMerkleTreeState_Call) Return(_a0 arbsys.SendMerkleTreeState, _a1 error) *ArbSysInterface_SendMerkleTreeState_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbSysInterface_SendMerkleTreeState_Call) RunAndReturn(run func(*bind.CallOpts) (arbsys.SendMerkleTreeState, error)) *ArbSysInterface_SendMerkleTreeState_Call { + _c.Call.Return(run) + return _c +} + +// SendTxToL1 provides a mock function with given fields: opts, destination, data +func (_m *ArbSysInterface) SendTxToL1(opts *bind.TransactOpts, destination common.Address, data []byte) (*types.Transaction, error) { + ret := _m.Called(opts, destination, data) + + if len(ret) == 0 { + panic("no return value specified for SendTxToL1") + } + + var r0 *types.Transaction + var r1 error + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, common.Address, []byte) (*types.Transaction, error)); ok { + return rf(opts, destination, data) + } + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, common.Address, []byte) *types.Transaction); ok { + r0 = rf(opts, destination, data) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Transaction) + } + } + + if rf, ok := ret.Get(1).(func(*bind.TransactOpts, common.Address, []byte) error); ok { + r1 = rf(opts, destination, data) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbSysInterface_SendTxToL1_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SendTxToL1' +type ArbSysInterface_SendTxToL1_Call struct { + *mock.Call +} + +// SendTxToL1 is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - destination common.Address +// - data []byte +func (_e *ArbSysInterface_Expecter) SendTxToL1(opts interface{}, destination interface{}, data interface{}) *ArbSysInterface_SendTxToL1_Call { + return &ArbSysInterface_SendTxToL1_Call{Call: _e.mock.On("SendTxToL1", opts, destination, data)} +} + +func (_c *ArbSysInterface_SendTxToL1_Call) Run(run func(opts *bind.TransactOpts, destination common.Address, data []byte)) *ArbSysInterface_SendTxToL1_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].(common.Address), args[2].([]byte)) + }) + return _c +} + +func (_c *ArbSysInterface_SendTxToL1_Call) Return(_a0 *types.Transaction, _a1 error) *ArbSysInterface_SendTxToL1_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbSysInterface_SendTxToL1_Call) RunAndReturn(run func(*bind.TransactOpts, common.Address, []byte) (*types.Transaction, error)) *ArbSysInterface_SendTxToL1_Call { + _c.Call.Return(run) + return _c +} + +// WasMyCallersAddressAliased provides a mock function with given fields: opts +func (_m *ArbSysInterface) WasMyCallersAddressAliased(opts *bind.CallOpts) (bool, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for WasMyCallersAddressAliased") + } + + var r0 bool + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts) (bool, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts) bool); ok { + r0 = rf(opts) + } else { + r0 = ret.Get(0).(bool) + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbSysInterface_WasMyCallersAddressAliased_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WasMyCallersAddressAliased' +type ArbSysInterface_WasMyCallersAddressAliased_Call struct { + *mock.Call +} + +// WasMyCallersAddressAliased is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *ArbSysInterface_Expecter) WasMyCallersAddressAliased(opts interface{}) *ArbSysInterface_WasMyCallersAddressAliased_Call { + return &ArbSysInterface_WasMyCallersAddressAliased_Call{Call: _e.mock.On("WasMyCallersAddressAliased", opts)} +} + +func (_c *ArbSysInterface_WasMyCallersAddressAliased_Call) Run(run func(opts *bind.CallOpts)) *ArbSysInterface_WasMyCallersAddressAliased_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *ArbSysInterface_WasMyCallersAddressAliased_Call) Return(_a0 bool, _a1 error) *ArbSysInterface_WasMyCallersAddressAliased_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbSysInterface_WasMyCallersAddressAliased_Call) RunAndReturn(run func(*bind.CallOpts) (bool, error)) *ArbSysInterface_WasMyCallersAddressAliased_Call { + _c.Call.Return(run) + return _c +} + +// WatchL2ToL1Transaction provides a mock function with given fields: opts, sink, destination, uniqueId, batchNumber +func (_m *ArbSysInterface) WatchL2ToL1Transaction(opts *bind.WatchOpts, sink chan<- *arbsys.ArbSysL2ToL1Transaction, destination []common.Address, uniqueId []*big.Int, batchNumber []*big.Int) (event.Subscription, error) { + ret := _m.Called(opts, sink, destination, uniqueId, batchNumber) + + if len(ret) == 0 { + panic("no return value specified for WatchL2ToL1Transaction") + } + + var r0 event.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *arbsys.ArbSysL2ToL1Transaction, []common.Address, []*big.Int, []*big.Int) (event.Subscription, error)); ok { + return rf(opts, sink, destination, uniqueId, batchNumber) + } + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *arbsys.ArbSysL2ToL1Transaction, []common.Address, []*big.Int, []*big.Int) event.Subscription); ok { + r0 = rf(opts, sink, destination, uniqueId, batchNumber) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(event.Subscription) + } + } + + if rf, ok := ret.Get(1).(func(*bind.WatchOpts, chan<- *arbsys.ArbSysL2ToL1Transaction, []common.Address, []*big.Int, []*big.Int) error); ok { + r1 = rf(opts, sink, destination, uniqueId, batchNumber) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbSysInterface_WatchL2ToL1Transaction_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchL2ToL1Transaction' +type ArbSysInterface_WatchL2ToL1Transaction_Call struct { + *mock.Call +} + +// WatchL2ToL1Transaction is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *arbsys.ArbSysL2ToL1Transaction +// - destination []common.Address +// - uniqueId []*big.Int +// - batchNumber []*big.Int +func (_e *ArbSysInterface_Expecter) WatchL2ToL1Transaction(opts interface{}, sink interface{}, destination interface{}, uniqueId interface{}, batchNumber interface{}) *ArbSysInterface_WatchL2ToL1Transaction_Call { + return &ArbSysInterface_WatchL2ToL1Transaction_Call{Call: _e.mock.On("WatchL2ToL1Transaction", opts, sink, destination, uniqueId, batchNumber)} +} + +func (_c *ArbSysInterface_WatchL2ToL1Transaction_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *arbsys.ArbSysL2ToL1Transaction, destination []common.Address, uniqueId []*big.Int, batchNumber []*big.Int)) *ArbSysInterface_WatchL2ToL1Transaction_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *arbsys.ArbSysL2ToL1Transaction), args[2].([]common.Address), args[3].([]*big.Int), args[4].([]*big.Int)) + }) + return _c +} + +func (_c *ArbSysInterface_WatchL2ToL1Transaction_Call) Return(_a0 event.Subscription, _a1 error) *ArbSysInterface_WatchL2ToL1Transaction_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbSysInterface_WatchL2ToL1Transaction_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *arbsys.ArbSysL2ToL1Transaction, []common.Address, []*big.Int, []*big.Int) (event.Subscription, error)) *ArbSysInterface_WatchL2ToL1Transaction_Call { + _c.Call.Return(run) + return _c +} + +// WatchL2ToL1Tx provides a mock function with given fields: opts, sink, destination, hash, position +func (_m *ArbSysInterface) WatchL2ToL1Tx(opts *bind.WatchOpts, sink chan<- *arbsys.ArbSysL2ToL1Tx, destination []common.Address, hash []*big.Int, position []*big.Int) (event.Subscription, error) { + ret := _m.Called(opts, sink, destination, hash, position) + + if len(ret) == 0 { + panic("no return value specified for WatchL2ToL1Tx") + } + + var r0 event.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *arbsys.ArbSysL2ToL1Tx, []common.Address, []*big.Int, []*big.Int) (event.Subscription, error)); ok { + return rf(opts, sink, destination, hash, position) + } + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *arbsys.ArbSysL2ToL1Tx, []common.Address, []*big.Int, []*big.Int) event.Subscription); ok { + r0 = rf(opts, sink, destination, hash, position) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(event.Subscription) + } + } + + if rf, ok := ret.Get(1).(func(*bind.WatchOpts, chan<- *arbsys.ArbSysL2ToL1Tx, []common.Address, []*big.Int, []*big.Int) error); ok { + r1 = rf(opts, sink, destination, hash, position) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbSysInterface_WatchL2ToL1Tx_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchL2ToL1Tx' +type ArbSysInterface_WatchL2ToL1Tx_Call struct { + *mock.Call +} + +// WatchL2ToL1Tx is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *arbsys.ArbSysL2ToL1Tx +// - destination []common.Address +// - hash []*big.Int +// - position []*big.Int +func (_e *ArbSysInterface_Expecter) WatchL2ToL1Tx(opts interface{}, sink interface{}, destination interface{}, hash interface{}, position interface{}) *ArbSysInterface_WatchL2ToL1Tx_Call { + return &ArbSysInterface_WatchL2ToL1Tx_Call{Call: _e.mock.On("WatchL2ToL1Tx", opts, sink, destination, hash, position)} +} + +func (_c *ArbSysInterface_WatchL2ToL1Tx_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *arbsys.ArbSysL2ToL1Tx, destination []common.Address, hash []*big.Int, position []*big.Int)) *ArbSysInterface_WatchL2ToL1Tx_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *arbsys.ArbSysL2ToL1Tx), args[2].([]common.Address), args[3].([]*big.Int), args[4].([]*big.Int)) + }) + return _c +} + +func (_c *ArbSysInterface_WatchL2ToL1Tx_Call) Return(_a0 event.Subscription, _a1 error) *ArbSysInterface_WatchL2ToL1Tx_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbSysInterface_WatchL2ToL1Tx_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *arbsys.ArbSysL2ToL1Tx, []common.Address, []*big.Int, []*big.Int) (event.Subscription, error)) *ArbSysInterface_WatchL2ToL1Tx_Call { + _c.Call.Return(run) + return _c +} + +// WatchSendMerkleUpdate provides a mock function with given fields: opts, sink, reserved, hash, position +func (_m *ArbSysInterface) WatchSendMerkleUpdate(opts *bind.WatchOpts, sink chan<- *arbsys.ArbSysSendMerkleUpdate, reserved []*big.Int, hash [][32]byte, position []*big.Int) (event.Subscription, error) { + ret := _m.Called(opts, sink, reserved, hash, position) + + if len(ret) == 0 { + panic("no return value specified for WatchSendMerkleUpdate") + } + + var r0 event.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *arbsys.ArbSysSendMerkleUpdate, []*big.Int, [][32]byte, []*big.Int) (event.Subscription, error)); ok { + return rf(opts, sink, reserved, hash, position) + } + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *arbsys.ArbSysSendMerkleUpdate, []*big.Int, [][32]byte, []*big.Int) event.Subscription); ok { + r0 = rf(opts, sink, reserved, hash, position) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(event.Subscription) + } + } + + if rf, ok := ret.Get(1).(func(*bind.WatchOpts, chan<- *arbsys.ArbSysSendMerkleUpdate, []*big.Int, [][32]byte, []*big.Int) error); ok { + r1 = rf(opts, sink, reserved, hash, position) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbSysInterface_WatchSendMerkleUpdate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchSendMerkleUpdate' +type ArbSysInterface_WatchSendMerkleUpdate_Call struct { + *mock.Call +} + +// WatchSendMerkleUpdate is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *arbsys.ArbSysSendMerkleUpdate +// - reserved []*big.Int +// - hash [][32]byte +// - position []*big.Int +func (_e *ArbSysInterface_Expecter) WatchSendMerkleUpdate(opts interface{}, sink interface{}, reserved interface{}, hash interface{}, position interface{}) *ArbSysInterface_WatchSendMerkleUpdate_Call { + return &ArbSysInterface_WatchSendMerkleUpdate_Call{Call: _e.mock.On("WatchSendMerkleUpdate", opts, sink, reserved, hash, position)} +} + +func (_c *ArbSysInterface_WatchSendMerkleUpdate_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *arbsys.ArbSysSendMerkleUpdate, reserved []*big.Int, hash [][32]byte, position []*big.Int)) *ArbSysInterface_WatchSendMerkleUpdate_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *arbsys.ArbSysSendMerkleUpdate), args[2].([]*big.Int), args[3].([][32]byte), args[4].([]*big.Int)) + }) + return _c +} + +func (_c *ArbSysInterface_WatchSendMerkleUpdate_Call) Return(_a0 event.Subscription, _a1 error) *ArbSysInterface_WatchSendMerkleUpdate_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbSysInterface_WatchSendMerkleUpdate_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *arbsys.ArbSysSendMerkleUpdate, []*big.Int, [][32]byte, []*big.Int) (event.Subscription, error)) *ArbSysInterface_WatchSendMerkleUpdate_Call { + _c.Call.Return(run) + return _c +} + +// WithdrawEth provides a mock function with given fields: opts, destination +func (_m *ArbSysInterface) WithdrawEth(opts *bind.TransactOpts, destination common.Address) (*types.Transaction, error) { + ret := _m.Called(opts, destination) + + if len(ret) == 0 { + panic("no return value specified for WithdrawEth") + } + + var r0 *types.Transaction + var r1 error + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, common.Address) (*types.Transaction, error)); ok { + return rf(opts, destination) + } + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, common.Address) *types.Transaction); ok { + r0 = rf(opts, destination) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Transaction) + } + } + + if rf, ok := ret.Get(1).(func(*bind.TransactOpts, common.Address) error); ok { + r1 = rf(opts, destination) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ArbSysInterface_WithdrawEth_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WithdrawEth' +type ArbSysInterface_WithdrawEth_Call struct { + *mock.Call +} + +// WithdrawEth is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - destination common.Address +func (_e *ArbSysInterface_Expecter) WithdrawEth(opts interface{}, destination interface{}) *ArbSysInterface_WithdrawEth_Call { + return &ArbSysInterface_WithdrawEth_Call{Call: _e.mock.On("WithdrawEth", opts, destination)} +} + +func (_c *ArbSysInterface_WithdrawEth_Call) Run(run func(opts *bind.TransactOpts, destination common.Address)) *ArbSysInterface_WithdrawEth_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].(common.Address)) + }) + return _c +} + +func (_c *ArbSysInterface_WithdrawEth_Call) Return(_a0 *types.Transaction, _a1 error) *ArbSysInterface_WithdrawEth_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ArbSysInterface_WithdrawEth_Call) RunAndReturn(run func(*bind.TransactOpts, common.Address) (*types.Transaction, error)) *ArbSysInterface_WithdrawEth_Call { + _c.Call.Return(run) + return _c +} + +// NewArbSysInterface creates a new instance of ArbSysInterface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewArbSysInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *ArbSysInterface { + mock := &ArbSysInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/core/gethwrappers/liquiditymanager/mocks/mock_l2_arbitrum_gateway/l2_arbitrum_gateway_interface.go b/core/gethwrappers/liquiditymanager/mocks/mock_l2_arbitrum_gateway/l2_arbitrum_gateway_interface.go new file mode 100644 index 00000000000..6ed290e9125 --- /dev/null +++ b/core/gethwrappers/liquiditymanager/mocks/mock_l2_arbitrum_gateway/l2_arbitrum_gateway_interface.go @@ -0,0 +1,1238 @@ +// Code generated by mockery v2.43.2. DO NOT EDIT. + +package mock_l2_arbitrum_gateway + +import ( + big "math/big" + + bind "github.com/ethereum/go-ethereum/accounts/abi/bind" + common "github.com/ethereum/go-ethereum/common" + + event "github.com/ethereum/go-ethereum/event" + + generated "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" + + l2_arbitrum_gateway "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/liquiditymanager/generated/l2_arbitrum_gateway" + + mock "github.com/stretchr/testify/mock" + + types "github.com/ethereum/go-ethereum/core/types" +) + +// L2ArbitrumGatewayInterface is an autogenerated mock type for the L2ArbitrumGatewayInterface type +type L2ArbitrumGatewayInterface struct { + mock.Mock +} + +type L2ArbitrumGatewayInterface_Expecter struct { + mock *mock.Mock +} + +func (_m *L2ArbitrumGatewayInterface) EXPECT() *L2ArbitrumGatewayInterface_Expecter { + return &L2ArbitrumGatewayInterface_Expecter{mock: &_m.Mock} +} + +// Address provides a mock function with given fields: +func (_m *L2ArbitrumGatewayInterface) Address() common.Address { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Address") + } + + var r0 common.Address + if rf, ok := ret.Get(0).(func() common.Address); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Address) + } + } + + return r0 +} + +// L2ArbitrumGatewayInterface_Address_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Address' +type L2ArbitrumGatewayInterface_Address_Call struct { + *mock.Call +} + +// Address is a helper method to define mock.On call +func (_e *L2ArbitrumGatewayInterface_Expecter) Address() *L2ArbitrumGatewayInterface_Address_Call { + return &L2ArbitrumGatewayInterface_Address_Call{Call: _e.mock.On("Address")} +} + +func (_c *L2ArbitrumGatewayInterface_Address_Call) Run(run func()) *L2ArbitrumGatewayInterface_Address_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *L2ArbitrumGatewayInterface_Address_Call) Return(_a0 common.Address) *L2ArbitrumGatewayInterface_Address_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *L2ArbitrumGatewayInterface_Address_Call) RunAndReturn(run func() common.Address) *L2ArbitrumGatewayInterface_Address_Call { + _c.Call.Return(run) + return _c +} + +// CalculateL2TokenAddress provides a mock function with given fields: opts, l1ERC20 +func (_m *L2ArbitrumGatewayInterface) CalculateL2TokenAddress(opts *bind.CallOpts, l1ERC20 common.Address) (common.Address, error) { + ret := _m.Called(opts, l1ERC20) + + if len(ret) == 0 { + panic("no return value specified for CalculateL2TokenAddress") + } + + var r0 common.Address + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts, common.Address) (common.Address, error)); ok { + return rf(opts, l1ERC20) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts, common.Address) common.Address); ok { + r0 = rf(opts, l1ERC20) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Address) + } + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts, common.Address) error); ok { + r1 = rf(opts, l1ERC20) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// L2ArbitrumGatewayInterface_CalculateL2TokenAddress_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CalculateL2TokenAddress' +type L2ArbitrumGatewayInterface_CalculateL2TokenAddress_Call struct { + *mock.Call +} + +// CalculateL2TokenAddress is a helper method to define mock.On call +// - opts *bind.CallOpts +// - l1ERC20 common.Address +func (_e *L2ArbitrumGatewayInterface_Expecter) CalculateL2TokenAddress(opts interface{}, l1ERC20 interface{}) *L2ArbitrumGatewayInterface_CalculateL2TokenAddress_Call { + return &L2ArbitrumGatewayInterface_CalculateL2TokenAddress_Call{Call: _e.mock.On("CalculateL2TokenAddress", opts, l1ERC20)} +} + +func (_c *L2ArbitrumGatewayInterface_CalculateL2TokenAddress_Call) Run(run func(opts *bind.CallOpts, l1ERC20 common.Address)) *L2ArbitrumGatewayInterface_CalculateL2TokenAddress_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts), args[1].(common.Address)) + }) + return _c +} + +func (_c *L2ArbitrumGatewayInterface_CalculateL2TokenAddress_Call) Return(_a0 common.Address, _a1 error) *L2ArbitrumGatewayInterface_CalculateL2TokenAddress_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *L2ArbitrumGatewayInterface_CalculateL2TokenAddress_Call) RunAndReturn(run func(*bind.CallOpts, common.Address) (common.Address, error)) *L2ArbitrumGatewayInterface_CalculateL2TokenAddress_Call { + _c.Call.Return(run) + return _c +} + +// CounterpartGateway provides a mock function with given fields: opts +func (_m *L2ArbitrumGatewayInterface) CounterpartGateway(opts *bind.CallOpts) (common.Address, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for CounterpartGateway") + } + + var r0 common.Address + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts) (common.Address, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts) common.Address); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Address) + } + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// L2ArbitrumGatewayInterface_CounterpartGateway_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CounterpartGateway' +type L2ArbitrumGatewayInterface_CounterpartGateway_Call struct { + *mock.Call +} + +// CounterpartGateway is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *L2ArbitrumGatewayInterface_Expecter) CounterpartGateway(opts interface{}) *L2ArbitrumGatewayInterface_CounterpartGateway_Call { + return &L2ArbitrumGatewayInterface_CounterpartGateway_Call{Call: _e.mock.On("CounterpartGateway", opts)} +} + +func (_c *L2ArbitrumGatewayInterface_CounterpartGateway_Call) Run(run func(opts *bind.CallOpts)) *L2ArbitrumGatewayInterface_CounterpartGateway_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *L2ArbitrumGatewayInterface_CounterpartGateway_Call) Return(_a0 common.Address, _a1 error) *L2ArbitrumGatewayInterface_CounterpartGateway_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *L2ArbitrumGatewayInterface_CounterpartGateway_Call) RunAndReturn(run func(*bind.CallOpts) (common.Address, error)) *L2ArbitrumGatewayInterface_CounterpartGateway_Call { + _c.Call.Return(run) + return _c +} + +// ExitNum provides a mock function with given fields: opts +func (_m *L2ArbitrumGatewayInterface) ExitNum(opts *bind.CallOpts) (*big.Int, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for ExitNum") + } + + var r0 *big.Int + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts) (*big.Int, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts) *big.Int); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*big.Int) + } + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// L2ArbitrumGatewayInterface_ExitNum_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ExitNum' +type L2ArbitrumGatewayInterface_ExitNum_Call struct { + *mock.Call +} + +// ExitNum is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *L2ArbitrumGatewayInterface_Expecter) ExitNum(opts interface{}) *L2ArbitrumGatewayInterface_ExitNum_Call { + return &L2ArbitrumGatewayInterface_ExitNum_Call{Call: _e.mock.On("ExitNum", opts)} +} + +func (_c *L2ArbitrumGatewayInterface_ExitNum_Call) Run(run func(opts *bind.CallOpts)) *L2ArbitrumGatewayInterface_ExitNum_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *L2ArbitrumGatewayInterface_ExitNum_Call) Return(_a0 *big.Int, _a1 error) *L2ArbitrumGatewayInterface_ExitNum_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *L2ArbitrumGatewayInterface_ExitNum_Call) RunAndReturn(run func(*bind.CallOpts) (*big.Int, error)) *L2ArbitrumGatewayInterface_ExitNum_Call { + _c.Call.Return(run) + return _c +} + +// FilterDepositFinalized provides a mock function with given fields: opts, l1Token, _from, _to +func (_m *L2ArbitrumGatewayInterface) FilterDepositFinalized(opts *bind.FilterOpts, l1Token []common.Address, _from []common.Address, _to []common.Address) (*l2_arbitrum_gateway.L2ArbitrumGatewayDepositFinalizedIterator, error) { + ret := _m.Called(opts, l1Token, _from, _to) + + if len(ret) == 0 { + panic("no return value specified for FilterDepositFinalized") + } + + var r0 *l2_arbitrum_gateway.L2ArbitrumGatewayDepositFinalizedIterator + var r1 error + if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []common.Address, []common.Address, []common.Address) (*l2_arbitrum_gateway.L2ArbitrumGatewayDepositFinalizedIterator, error)); ok { + return rf(opts, l1Token, _from, _to) + } + if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []common.Address, []common.Address, []common.Address) *l2_arbitrum_gateway.L2ArbitrumGatewayDepositFinalizedIterator); ok { + r0 = rf(opts, l1Token, _from, _to) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*l2_arbitrum_gateway.L2ArbitrumGatewayDepositFinalizedIterator) + } + } + + if rf, ok := ret.Get(1).(func(*bind.FilterOpts, []common.Address, []common.Address, []common.Address) error); ok { + r1 = rf(opts, l1Token, _from, _to) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// L2ArbitrumGatewayInterface_FilterDepositFinalized_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterDepositFinalized' +type L2ArbitrumGatewayInterface_FilterDepositFinalized_Call struct { + *mock.Call +} + +// FilterDepositFinalized is a helper method to define mock.On call +// - opts *bind.FilterOpts +// - l1Token []common.Address +// - _from []common.Address +// - _to []common.Address +func (_e *L2ArbitrumGatewayInterface_Expecter) FilterDepositFinalized(opts interface{}, l1Token interface{}, _from interface{}, _to interface{}) *L2ArbitrumGatewayInterface_FilterDepositFinalized_Call { + return &L2ArbitrumGatewayInterface_FilterDepositFinalized_Call{Call: _e.mock.On("FilterDepositFinalized", opts, l1Token, _from, _to)} +} + +func (_c *L2ArbitrumGatewayInterface_FilterDepositFinalized_Call) Run(run func(opts *bind.FilterOpts, l1Token []common.Address, _from []common.Address, _to []common.Address)) *L2ArbitrumGatewayInterface_FilterDepositFinalized_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts), args[1].([]common.Address), args[2].([]common.Address), args[3].([]common.Address)) + }) + return _c +} + +func (_c *L2ArbitrumGatewayInterface_FilterDepositFinalized_Call) Return(_a0 *l2_arbitrum_gateway.L2ArbitrumGatewayDepositFinalizedIterator, _a1 error) *L2ArbitrumGatewayInterface_FilterDepositFinalized_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *L2ArbitrumGatewayInterface_FilterDepositFinalized_Call) RunAndReturn(run func(*bind.FilterOpts, []common.Address, []common.Address, []common.Address) (*l2_arbitrum_gateway.L2ArbitrumGatewayDepositFinalizedIterator, error)) *L2ArbitrumGatewayInterface_FilterDepositFinalized_Call { + _c.Call.Return(run) + return _c +} + +// FilterTxToL1 provides a mock function with given fields: opts, _from, _to, _id +func (_m *L2ArbitrumGatewayInterface) FilterTxToL1(opts *bind.FilterOpts, _from []common.Address, _to []common.Address, _id []*big.Int) (*l2_arbitrum_gateway.L2ArbitrumGatewayTxToL1Iterator, error) { + ret := _m.Called(opts, _from, _to, _id) + + if len(ret) == 0 { + panic("no return value specified for FilterTxToL1") + } + + var r0 *l2_arbitrum_gateway.L2ArbitrumGatewayTxToL1Iterator + var r1 error + if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []common.Address, []common.Address, []*big.Int) (*l2_arbitrum_gateway.L2ArbitrumGatewayTxToL1Iterator, error)); ok { + return rf(opts, _from, _to, _id) + } + if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []common.Address, []common.Address, []*big.Int) *l2_arbitrum_gateway.L2ArbitrumGatewayTxToL1Iterator); ok { + r0 = rf(opts, _from, _to, _id) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*l2_arbitrum_gateway.L2ArbitrumGatewayTxToL1Iterator) + } + } + + if rf, ok := ret.Get(1).(func(*bind.FilterOpts, []common.Address, []common.Address, []*big.Int) error); ok { + r1 = rf(opts, _from, _to, _id) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// L2ArbitrumGatewayInterface_FilterTxToL1_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterTxToL1' +type L2ArbitrumGatewayInterface_FilterTxToL1_Call struct { + *mock.Call +} + +// FilterTxToL1 is a helper method to define mock.On call +// - opts *bind.FilterOpts +// - _from []common.Address +// - _to []common.Address +// - _id []*big.Int +func (_e *L2ArbitrumGatewayInterface_Expecter) FilterTxToL1(opts interface{}, _from interface{}, _to interface{}, _id interface{}) *L2ArbitrumGatewayInterface_FilterTxToL1_Call { + return &L2ArbitrumGatewayInterface_FilterTxToL1_Call{Call: _e.mock.On("FilterTxToL1", opts, _from, _to, _id)} +} + +func (_c *L2ArbitrumGatewayInterface_FilterTxToL1_Call) Run(run func(opts *bind.FilterOpts, _from []common.Address, _to []common.Address, _id []*big.Int)) *L2ArbitrumGatewayInterface_FilterTxToL1_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts), args[1].([]common.Address), args[2].([]common.Address), args[3].([]*big.Int)) + }) + return _c +} + +func (_c *L2ArbitrumGatewayInterface_FilterTxToL1_Call) Return(_a0 *l2_arbitrum_gateway.L2ArbitrumGatewayTxToL1Iterator, _a1 error) *L2ArbitrumGatewayInterface_FilterTxToL1_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *L2ArbitrumGatewayInterface_FilterTxToL1_Call) RunAndReturn(run func(*bind.FilterOpts, []common.Address, []common.Address, []*big.Int) (*l2_arbitrum_gateway.L2ArbitrumGatewayTxToL1Iterator, error)) *L2ArbitrumGatewayInterface_FilterTxToL1_Call { + _c.Call.Return(run) + return _c +} + +// FilterWithdrawalInitiated provides a mock function with given fields: opts, _from, _to, _l2ToL1Id +func (_m *L2ArbitrumGatewayInterface) FilterWithdrawalInitiated(opts *bind.FilterOpts, _from []common.Address, _to []common.Address, _l2ToL1Id []*big.Int) (*l2_arbitrum_gateway.L2ArbitrumGatewayWithdrawalInitiatedIterator, error) { + ret := _m.Called(opts, _from, _to, _l2ToL1Id) + + if len(ret) == 0 { + panic("no return value specified for FilterWithdrawalInitiated") + } + + var r0 *l2_arbitrum_gateway.L2ArbitrumGatewayWithdrawalInitiatedIterator + var r1 error + if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []common.Address, []common.Address, []*big.Int) (*l2_arbitrum_gateway.L2ArbitrumGatewayWithdrawalInitiatedIterator, error)); ok { + return rf(opts, _from, _to, _l2ToL1Id) + } + if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []common.Address, []common.Address, []*big.Int) *l2_arbitrum_gateway.L2ArbitrumGatewayWithdrawalInitiatedIterator); ok { + r0 = rf(opts, _from, _to, _l2ToL1Id) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*l2_arbitrum_gateway.L2ArbitrumGatewayWithdrawalInitiatedIterator) + } + } + + if rf, ok := ret.Get(1).(func(*bind.FilterOpts, []common.Address, []common.Address, []*big.Int) error); ok { + r1 = rf(opts, _from, _to, _l2ToL1Id) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// L2ArbitrumGatewayInterface_FilterWithdrawalInitiated_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterWithdrawalInitiated' +type L2ArbitrumGatewayInterface_FilterWithdrawalInitiated_Call struct { + *mock.Call +} + +// FilterWithdrawalInitiated is a helper method to define mock.On call +// - opts *bind.FilterOpts +// - _from []common.Address +// - _to []common.Address +// - _l2ToL1Id []*big.Int +func (_e *L2ArbitrumGatewayInterface_Expecter) FilterWithdrawalInitiated(opts interface{}, _from interface{}, _to interface{}, _l2ToL1Id interface{}) *L2ArbitrumGatewayInterface_FilterWithdrawalInitiated_Call { + return &L2ArbitrumGatewayInterface_FilterWithdrawalInitiated_Call{Call: _e.mock.On("FilterWithdrawalInitiated", opts, _from, _to, _l2ToL1Id)} +} + +func (_c *L2ArbitrumGatewayInterface_FilterWithdrawalInitiated_Call) Run(run func(opts *bind.FilterOpts, _from []common.Address, _to []common.Address, _l2ToL1Id []*big.Int)) *L2ArbitrumGatewayInterface_FilterWithdrawalInitiated_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts), args[1].([]common.Address), args[2].([]common.Address), args[3].([]*big.Int)) + }) + return _c +} + +func (_c *L2ArbitrumGatewayInterface_FilterWithdrawalInitiated_Call) Return(_a0 *l2_arbitrum_gateway.L2ArbitrumGatewayWithdrawalInitiatedIterator, _a1 error) *L2ArbitrumGatewayInterface_FilterWithdrawalInitiated_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *L2ArbitrumGatewayInterface_FilterWithdrawalInitiated_Call) RunAndReturn(run func(*bind.FilterOpts, []common.Address, []common.Address, []*big.Int) (*l2_arbitrum_gateway.L2ArbitrumGatewayWithdrawalInitiatedIterator, error)) *L2ArbitrumGatewayInterface_FilterWithdrawalInitiated_Call { + _c.Call.Return(run) + return _c +} + +// FinalizeInboundTransfer provides a mock function with given fields: opts, _token, _from, _to, _amount, _data +func (_m *L2ArbitrumGatewayInterface) FinalizeInboundTransfer(opts *bind.TransactOpts, _token common.Address, _from common.Address, _to common.Address, _amount *big.Int, _data []byte) (*types.Transaction, error) { + ret := _m.Called(opts, _token, _from, _to, _amount, _data) + + if len(ret) == 0 { + panic("no return value specified for FinalizeInboundTransfer") + } + + var r0 *types.Transaction + var r1 error + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, common.Address, common.Address, common.Address, *big.Int, []byte) (*types.Transaction, error)); ok { + return rf(opts, _token, _from, _to, _amount, _data) + } + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, common.Address, common.Address, common.Address, *big.Int, []byte) *types.Transaction); ok { + r0 = rf(opts, _token, _from, _to, _amount, _data) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Transaction) + } + } + + if rf, ok := ret.Get(1).(func(*bind.TransactOpts, common.Address, common.Address, common.Address, *big.Int, []byte) error); ok { + r1 = rf(opts, _token, _from, _to, _amount, _data) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// L2ArbitrumGatewayInterface_FinalizeInboundTransfer_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FinalizeInboundTransfer' +type L2ArbitrumGatewayInterface_FinalizeInboundTransfer_Call struct { + *mock.Call +} + +// FinalizeInboundTransfer is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - _token common.Address +// - _from common.Address +// - _to common.Address +// - _amount *big.Int +// - _data []byte +func (_e *L2ArbitrumGatewayInterface_Expecter) FinalizeInboundTransfer(opts interface{}, _token interface{}, _from interface{}, _to interface{}, _amount interface{}, _data interface{}) *L2ArbitrumGatewayInterface_FinalizeInboundTransfer_Call { + return &L2ArbitrumGatewayInterface_FinalizeInboundTransfer_Call{Call: _e.mock.On("FinalizeInboundTransfer", opts, _token, _from, _to, _amount, _data)} +} + +func (_c *L2ArbitrumGatewayInterface_FinalizeInboundTransfer_Call) Run(run func(opts *bind.TransactOpts, _token common.Address, _from common.Address, _to common.Address, _amount *big.Int, _data []byte)) *L2ArbitrumGatewayInterface_FinalizeInboundTransfer_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].(common.Address), args[2].(common.Address), args[3].(common.Address), args[4].(*big.Int), args[5].([]byte)) + }) + return _c +} + +func (_c *L2ArbitrumGatewayInterface_FinalizeInboundTransfer_Call) Return(_a0 *types.Transaction, _a1 error) *L2ArbitrumGatewayInterface_FinalizeInboundTransfer_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *L2ArbitrumGatewayInterface_FinalizeInboundTransfer_Call) RunAndReturn(run func(*bind.TransactOpts, common.Address, common.Address, common.Address, *big.Int, []byte) (*types.Transaction, error)) *L2ArbitrumGatewayInterface_FinalizeInboundTransfer_Call { + _c.Call.Return(run) + return _c +} + +// GetOutboundCalldata provides a mock function with given fields: opts, _token, _from, _to, _amount, _data +func (_m *L2ArbitrumGatewayInterface) GetOutboundCalldata(opts *bind.CallOpts, _token common.Address, _from common.Address, _to common.Address, _amount *big.Int, _data []byte) ([]byte, error) { + ret := _m.Called(opts, _token, _from, _to, _amount, _data) + + if len(ret) == 0 { + panic("no return value specified for GetOutboundCalldata") + } + + var r0 []byte + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts, common.Address, common.Address, common.Address, *big.Int, []byte) ([]byte, error)); ok { + return rf(opts, _token, _from, _to, _amount, _data) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts, common.Address, common.Address, common.Address, *big.Int, []byte) []byte); ok { + r0 = rf(opts, _token, _from, _to, _amount, _data) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]byte) + } + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts, common.Address, common.Address, common.Address, *big.Int, []byte) error); ok { + r1 = rf(opts, _token, _from, _to, _amount, _data) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// L2ArbitrumGatewayInterface_GetOutboundCalldata_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetOutboundCalldata' +type L2ArbitrumGatewayInterface_GetOutboundCalldata_Call struct { + *mock.Call +} + +// GetOutboundCalldata is a helper method to define mock.On call +// - opts *bind.CallOpts +// - _token common.Address +// - _from common.Address +// - _to common.Address +// - _amount *big.Int +// - _data []byte +func (_e *L2ArbitrumGatewayInterface_Expecter) GetOutboundCalldata(opts interface{}, _token interface{}, _from interface{}, _to interface{}, _amount interface{}, _data interface{}) *L2ArbitrumGatewayInterface_GetOutboundCalldata_Call { + return &L2ArbitrumGatewayInterface_GetOutboundCalldata_Call{Call: _e.mock.On("GetOutboundCalldata", opts, _token, _from, _to, _amount, _data)} +} + +func (_c *L2ArbitrumGatewayInterface_GetOutboundCalldata_Call) Run(run func(opts *bind.CallOpts, _token common.Address, _from common.Address, _to common.Address, _amount *big.Int, _data []byte)) *L2ArbitrumGatewayInterface_GetOutboundCalldata_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts), args[1].(common.Address), args[2].(common.Address), args[3].(common.Address), args[4].(*big.Int), args[5].([]byte)) + }) + return _c +} + +func (_c *L2ArbitrumGatewayInterface_GetOutboundCalldata_Call) Return(_a0 []byte, _a1 error) *L2ArbitrumGatewayInterface_GetOutboundCalldata_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *L2ArbitrumGatewayInterface_GetOutboundCalldata_Call) RunAndReturn(run func(*bind.CallOpts, common.Address, common.Address, common.Address, *big.Int, []byte) ([]byte, error)) *L2ArbitrumGatewayInterface_GetOutboundCalldata_Call { + _c.Call.Return(run) + return _c +} + +// OutboundTransfer provides a mock function with given fields: opts, _l1Token, _to, _amount, _data +func (_m *L2ArbitrumGatewayInterface) OutboundTransfer(opts *bind.TransactOpts, _l1Token common.Address, _to common.Address, _amount *big.Int, _data []byte) (*types.Transaction, error) { + ret := _m.Called(opts, _l1Token, _to, _amount, _data) + + if len(ret) == 0 { + panic("no return value specified for OutboundTransfer") + } + + var r0 *types.Transaction + var r1 error + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, common.Address, common.Address, *big.Int, []byte) (*types.Transaction, error)); ok { + return rf(opts, _l1Token, _to, _amount, _data) + } + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, common.Address, common.Address, *big.Int, []byte) *types.Transaction); ok { + r0 = rf(opts, _l1Token, _to, _amount, _data) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Transaction) + } + } + + if rf, ok := ret.Get(1).(func(*bind.TransactOpts, common.Address, common.Address, *big.Int, []byte) error); ok { + r1 = rf(opts, _l1Token, _to, _amount, _data) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// L2ArbitrumGatewayInterface_OutboundTransfer_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OutboundTransfer' +type L2ArbitrumGatewayInterface_OutboundTransfer_Call struct { + *mock.Call +} + +// OutboundTransfer is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - _l1Token common.Address +// - _to common.Address +// - _amount *big.Int +// - _data []byte +func (_e *L2ArbitrumGatewayInterface_Expecter) OutboundTransfer(opts interface{}, _l1Token interface{}, _to interface{}, _amount interface{}, _data interface{}) *L2ArbitrumGatewayInterface_OutboundTransfer_Call { + return &L2ArbitrumGatewayInterface_OutboundTransfer_Call{Call: _e.mock.On("OutboundTransfer", opts, _l1Token, _to, _amount, _data)} +} + +func (_c *L2ArbitrumGatewayInterface_OutboundTransfer_Call) Run(run func(opts *bind.TransactOpts, _l1Token common.Address, _to common.Address, _amount *big.Int, _data []byte)) *L2ArbitrumGatewayInterface_OutboundTransfer_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].(common.Address), args[2].(common.Address), args[3].(*big.Int), args[4].([]byte)) + }) + return _c +} + +func (_c *L2ArbitrumGatewayInterface_OutboundTransfer_Call) Return(_a0 *types.Transaction, _a1 error) *L2ArbitrumGatewayInterface_OutboundTransfer_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *L2ArbitrumGatewayInterface_OutboundTransfer_Call) RunAndReturn(run func(*bind.TransactOpts, common.Address, common.Address, *big.Int, []byte) (*types.Transaction, error)) *L2ArbitrumGatewayInterface_OutboundTransfer_Call { + _c.Call.Return(run) + return _c +} + +// OutboundTransfer0 provides a mock function with given fields: opts, _l1Token, _to, _amount, arg3, arg4, _data +func (_m *L2ArbitrumGatewayInterface) OutboundTransfer0(opts *bind.TransactOpts, _l1Token common.Address, _to common.Address, _amount *big.Int, arg3 *big.Int, arg4 *big.Int, _data []byte) (*types.Transaction, error) { + ret := _m.Called(opts, _l1Token, _to, _amount, arg3, arg4, _data) + + if len(ret) == 0 { + panic("no return value specified for OutboundTransfer0") + } + + var r0 *types.Transaction + var r1 error + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, common.Address, common.Address, *big.Int, *big.Int, *big.Int, []byte) (*types.Transaction, error)); ok { + return rf(opts, _l1Token, _to, _amount, arg3, arg4, _data) + } + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, common.Address, common.Address, *big.Int, *big.Int, *big.Int, []byte) *types.Transaction); ok { + r0 = rf(opts, _l1Token, _to, _amount, arg3, arg4, _data) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Transaction) + } + } + + if rf, ok := ret.Get(1).(func(*bind.TransactOpts, common.Address, common.Address, *big.Int, *big.Int, *big.Int, []byte) error); ok { + r1 = rf(opts, _l1Token, _to, _amount, arg3, arg4, _data) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// L2ArbitrumGatewayInterface_OutboundTransfer0_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OutboundTransfer0' +type L2ArbitrumGatewayInterface_OutboundTransfer0_Call struct { + *mock.Call +} + +// OutboundTransfer0 is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - _l1Token common.Address +// - _to common.Address +// - _amount *big.Int +// - arg3 *big.Int +// - arg4 *big.Int +// - _data []byte +func (_e *L2ArbitrumGatewayInterface_Expecter) OutboundTransfer0(opts interface{}, _l1Token interface{}, _to interface{}, _amount interface{}, arg3 interface{}, arg4 interface{}, _data interface{}) *L2ArbitrumGatewayInterface_OutboundTransfer0_Call { + return &L2ArbitrumGatewayInterface_OutboundTransfer0_Call{Call: _e.mock.On("OutboundTransfer0", opts, _l1Token, _to, _amount, arg3, arg4, _data)} +} + +func (_c *L2ArbitrumGatewayInterface_OutboundTransfer0_Call) Run(run func(opts *bind.TransactOpts, _l1Token common.Address, _to common.Address, _amount *big.Int, arg3 *big.Int, arg4 *big.Int, _data []byte)) *L2ArbitrumGatewayInterface_OutboundTransfer0_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].(common.Address), args[2].(common.Address), args[3].(*big.Int), args[4].(*big.Int), args[5].(*big.Int), args[6].([]byte)) + }) + return _c +} + +func (_c *L2ArbitrumGatewayInterface_OutboundTransfer0_Call) Return(_a0 *types.Transaction, _a1 error) *L2ArbitrumGatewayInterface_OutboundTransfer0_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *L2ArbitrumGatewayInterface_OutboundTransfer0_Call) RunAndReturn(run func(*bind.TransactOpts, common.Address, common.Address, *big.Int, *big.Int, *big.Int, []byte) (*types.Transaction, error)) *L2ArbitrumGatewayInterface_OutboundTransfer0_Call { + _c.Call.Return(run) + return _c +} + +// ParseDepositFinalized provides a mock function with given fields: log +func (_m *L2ArbitrumGatewayInterface) ParseDepositFinalized(log types.Log) (*l2_arbitrum_gateway.L2ArbitrumGatewayDepositFinalized, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParseDepositFinalized") + } + + var r0 *l2_arbitrum_gateway.L2ArbitrumGatewayDepositFinalized + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (*l2_arbitrum_gateway.L2ArbitrumGatewayDepositFinalized, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) *l2_arbitrum_gateway.L2ArbitrumGatewayDepositFinalized); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*l2_arbitrum_gateway.L2ArbitrumGatewayDepositFinalized) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// L2ArbitrumGatewayInterface_ParseDepositFinalized_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseDepositFinalized' +type L2ArbitrumGatewayInterface_ParseDepositFinalized_Call struct { + *mock.Call +} + +// ParseDepositFinalized is a helper method to define mock.On call +// - log types.Log +func (_e *L2ArbitrumGatewayInterface_Expecter) ParseDepositFinalized(log interface{}) *L2ArbitrumGatewayInterface_ParseDepositFinalized_Call { + return &L2ArbitrumGatewayInterface_ParseDepositFinalized_Call{Call: _e.mock.On("ParseDepositFinalized", log)} +} + +func (_c *L2ArbitrumGatewayInterface_ParseDepositFinalized_Call) Run(run func(log types.Log)) *L2ArbitrumGatewayInterface_ParseDepositFinalized_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *L2ArbitrumGatewayInterface_ParseDepositFinalized_Call) Return(_a0 *l2_arbitrum_gateway.L2ArbitrumGatewayDepositFinalized, _a1 error) *L2ArbitrumGatewayInterface_ParseDepositFinalized_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *L2ArbitrumGatewayInterface_ParseDepositFinalized_Call) RunAndReturn(run func(types.Log) (*l2_arbitrum_gateway.L2ArbitrumGatewayDepositFinalized, error)) *L2ArbitrumGatewayInterface_ParseDepositFinalized_Call { + _c.Call.Return(run) + return _c +} + +// ParseLog provides a mock function with given fields: log +func (_m *L2ArbitrumGatewayInterface) ParseLog(log types.Log) (generated.AbigenLog, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParseLog") + } + + var r0 generated.AbigenLog + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (generated.AbigenLog, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) generated.AbigenLog); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(generated.AbigenLog) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// L2ArbitrumGatewayInterface_ParseLog_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseLog' +type L2ArbitrumGatewayInterface_ParseLog_Call struct { + *mock.Call +} + +// ParseLog is a helper method to define mock.On call +// - log types.Log +func (_e *L2ArbitrumGatewayInterface_Expecter) ParseLog(log interface{}) *L2ArbitrumGatewayInterface_ParseLog_Call { + return &L2ArbitrumGatewayInterface_ParseLog_Call{Call: _e.mock.On("ParseLog", log)} +} + +func (_c *L2ArbitrumGatewayInterface_ParseLog_Call) Run(run func(log types.Log)) *L2ArbitrumGatewayInterface_ParseLog_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *L2ArbitrumGatewayInterface_ParseLog_Call) Return(_a0 generated.AbigenLog, _a1 error) *L2ArbitrumGatewayInterface_ParseLog_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *L2ArbitrumGatewayInterface_ParseLog_Call) RunAndReturn(run func(types.Log) (generated.AbigenLog, error)) *L2ArbitrumGatewayInterface_ParseLog_Call { + _c.Call.Return(run) + return _c +} + +// ParseTxToL1 provides a mock function with given fields: log +func (_m *L2ArbitrumGatewayInterface) ParseTxToL1(log types.Log) (*l2_arbitrum_gateway.L2ArbitrumGatewayTxToL1, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParseTxToL1") + } + + var r0 *l2_arbitrum_gateway.L2ArbitrumGatewayTxToL1 + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (*l2_arbitrum_gateway.L2ArbitrumGatewayTxToL1, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) *l2_arbitrum_gateway.L2ArbitrumGatewayTxToL1); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*l2_arbitrum_gateway.L2ArbitrumGatewayTxToL1) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// L2ArbitrumGatewayInterface_ParseTxToL1_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseTxToL1' +type L2ArbitrumGatewayInterface_ParseTxToL1_Call struct { + *mock.Call +} + +// ParseTxToL1 is a helper method to define mock.On call +// - log types.Log +func (_e *L2ArbitrumGatewayInterface_Expecter) ParseTxToL1(log interface{}) *L2ArbitrumGatewayInterface_ParseTxToL1_Call { + return &L2ArbitrumGatewayInterface_ParseTxToL1_Call{Call: _e.mock.On("ParseTxToL1", log)} +} + +func (_c *L2ArbitrumGatewayInterface_ParseTxToL1_Call) Run(run func(log types.Log)) *L2ArbitrumGatewayInterface_ParseTxToL1_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *L2ArbitrumGatewayInterface_ParseTxToL1_Call) Return(_a0 *l2_arbitrum_gateway.L2ArbitrumGatewayTxToL1, _a1 error) *L2ArbitrumGatewayInterface_ParseTxToL1_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *L2ArbitrumGatewayInterface_ParseTxToL1_Call) RunAndReturn(run func(types.Log) (*l2_arbitrum_gateway.L2ArbitrumGatewayTxToL1, error)) *L2ArbitrumGatewayInterface_ParseTxToL1_Call { + _c.Call.Return(run) + return _c +} + +// ParseWithdrawalInitiated provides a mock function with given fields: log +func (_m *L2ArbitrumGatewayInterface) ParseWithdrawalInitiated(log types.Log) (*l2_arbitrum_gateway.L2ArbitrumGatewayWithdrawalInitiated, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParseWithdrawalInitiated") + } + + var r0 *l2_arbitrum_gateway.L2ArbitrumGatewayWithdrawalInitiated + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (*l2_arbitrum_gateway.L2ArbitrumGatewayWithdrawalInitiated, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) *l2_arbitrum_gateway.L2ArbitrumGatewayWithdrawalInitiated); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*l2_arbitrum_gateway.L2ArbitrumGatewayWithdrawalInitiated) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// L2ArbitrumGatewayInterface_ParseWithdrawalInitiated_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseWithdrawalInitiated' +type L2ArbitrumGatewayInterface_ParseWithdrawalInitiated_Call struct { + *mock.Call +} + +// ParseWithdrawalInitiated is a helper method to define mock.On call +// - log types.Log +func (_e *L2ArbitrumGatewayInterface_Expecter) ParseWithdrawalInitiated(log interface{}) *L2ArbitrumGatewayInterface_ParseWithdrawalInitiated_Call { + return &L2ArbitrumGatewayInterface_ParseWithdrawalInitiated_Call{Call: _e.mock.On("ParseWithdrawalInitiated", log)} +} + +func (_c *L2ArbitrumGatewayInterface_ParseWithdrawalInitiated_Call) Run(run func(log types.Log)) *L2ArbitrumGatewayInterface_ParseWithdrawalInitiated_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *L2ArbitrumGatewayInterface_ParseWithdrawalInitiated_Call) Return(_a0 *l2_arbitrum_gateway.L2ArbitrumGatewayWithdrawalInitiated, _a1 error) *L2ArbitrumGatewayInterface_ParseWithdrawalInitiated_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *L2ArbitrumGatewayInterface_ParseWithdrawalInitiated_Call) RunAndReturn(run func(types.Log) (*l2_arbitrum_gateway.L2ArbitrumGatewayWithdrawalInitiated, error)) *L2ArbitrumGatewayInterface_ParseWithdrawalInitiated_Call { + _c.Call.Return(run) + return _c +} + +// PostUpgradeInit provides a mock function with given fields: opts +func (_m *L2ArbitrumGatewayInterface) PostUpgradeInit(opts *bind.TransactOpts) (*types.Transaction, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for PostUpgradeInit") + } + + var r0 *types.Transaction + var r1 error + if rf, ok := ret.Get(0).(func(*bind.TransactOpts) (*types.Transaction, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.TransactOpts) *types.Transaction); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Transaction) + } + } + + if rf, ok := ret.Get(1).(func(*bind.TransactOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// L2ArbitrumGatewayInterface_PostUpgradeInit_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PostUpgradeInit' +type L2ArbitrumGatewayInterface_PostUpgradeInit_Call struct { + *mock.Call +} + +// PostUpgradeInit is a helper method to define mock.On call +// - opts *bind.TransactOpts +func (_e *L2ArbitrumGatewayInterface_Expecter) PostUpgradeInit(opts interface{}) *L2ArbitrumGatewayInterface_PostUpgradeInit_Call { + return &L2ArbitrumGatewayInterface_PostUpgradeInit_Call{Call: _e.mock.On("PostUpgradeInit", opts)} +} + +func (_c *L2ArbitrumGatewayInterface_PostUpgradeInit_Call) Run(run func(opts *bind.TransactOpts)) *L2ArbitrumGatewayInterface_PostUpgradeInit_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts)) + }) + return _c +} + +func (_c *L2ArbitrumGatewayInterface_PostUpgradeInit_Call) Return(_a0 *types.Transaction, _a1 error) *L2ArbitrumGatewayInterface_PostUpgradeInit_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *L2ArbitrumGatewayInterface_PostUpgradeInit_Call) RunAndReturn(run func(*bind.TransactOpts) (*types.Transaction, error)) *L2ArbitrumGatewayInterface_PostUpgradeInit_Call { + _c.Call.Return(run) + return _c +} + +// Router provides a mock function with given fields: opts +func (_m *L2ArbitrumGatewayInterface) Router(opts *bind.CallOpts) (common.Address, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for Router") + } + + var r0 common.Address + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts) (common.Address, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts) common.Address); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Address) + } + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// L2ArbitrumGatewayInterface_Router_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Router' +type L2ArbitrumGatewayInterface_Router_Call struct { + *mock.Call +} + +// Router is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *L2ArbitrumGatewayInterface_Expecter) Router(opts interface{}) *L2ArbitrumGatewayInterface_Router_Call { + return &L2ArbitrumGatewayInterface_Router_Call{Call: _e.mock.On("Router", opts)} +} + +func (_c *L2ArbitrumGatewayInterface_Router_Call) Run(run func(opts *bind.CallOpts)) *L2ArbitrumGatewayInterface_Router_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *L2ArbitrumGatewayInterface_Router_Call) Return(_a0 common.Address, _a1 error) *L2ArbitrumGatewayInterface_Router_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *L2ArbitrumGatewayInterface_Router_Call) RunAndReturn(run func(*bind.CallOpts) (common.Address, error)) *L2ArbitrumGatewayInterface_Router_Call { + _c.Call.Return(run) + return _c +} + +// WatchDepositFinalized provides a mock function with given fields: opts, sink, l1Token, _from, _to +func (_m *L2ArbitrumGatewayInterface) WatchDepositFinalized(opts *bind.WatchOpts, sink chan<- *l2_arbitrum_gateway.L2ArbitrumGatewayDepositFinalized, l1Token []common.Address, _from []common.Address, _to []common.Address) (event.Subscription, error) { + ret := _m.Called(opts, sink, l1Token, _from, _to) + + if len(ret) == 0 { + panic("no return value specified for WatchDepositFinalized") + } + + var r0 event.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *l2_arbitrum_gateway.L2ArbitrumGatewayDepositFinalized, []common.Address, []common.Address, []common.Address) (event.Subscription, error)); ok { + return rf(opts, sink, l1Token, _from, _to) + } + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *l2_arbitrum_gateway.L2ArbitrumGatewayDepositFinalized, []common.Address, []common.Address, []common.Address) event.Subscription); ok { + r0 = rf(opts, sink, l1Token, _from, _to) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(event.Subscription) + } + } + + if rf, ok := ret.Get(1).(func(*bind.WatchOpts, chan<- *l2_arbitrum_gateway.L2ArbitrumGatewayDepositFinalized, []common.Address, []common.Address, []common.Address) error); ok { + r1 = rf(opts, sink, l1Token, _from, _to) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// L2ArbitrumGatewayInterface_WatchDepositFinalized_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchDepositFinalized' +type L2ArbitrumGatewayInterface_WatchDepositFinalized_Call struct { + *mock.Call +} + +// WatchDepositFinalized is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *l2_arbitrum_gateway.L2ArbitrumGatewayDepositFinalized +// - l1Token []common.Address +// - _from []common.Address +// - _to []common.Address +func (_e *L2ArbitrumGatewayInterface_Expecter) WatchDepositFinalized(opts interface{}, sink interface{}, l1Token interface{}, _from interface{}, _to interface{}) *L2ArbitrumGatewayInterface_WatchDepositFinalized_Call { + return &L2ArbitrumGatewayInterface_WatchDepositFinalized_Call{Call: _e.mock.On("WatchDepositFinalized", opts, sink, l1Token, _from, _to)} +} + +func (_c *L2ArbitrumGatewayInterface_WatchDepositFinalized_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *l2_arbitrum_gateway.L2ArbitrumGatewayDepositFinalized, l1Token []common.Address, _from []common.Address, _to []common.Address)) *L2ArbitrumGatewayInterface_WatchDepositFinalized_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *l2_arbitrum_gateway.L2ArbitrumGatewayDepositFinalized), args[2].([]common.Address), args[3].([]common.Address), args[4].([]common.Address)) + }) + return _c +} + +func (_c *L2ArbitrumGatewayInterface_WatchDepositFinalized_Call) Return(_a0 event.Subscription, _a1 error) *L2ArbitrumGatewayInterface_WatchDepositFinalized_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *L2ArbitrumGatewayInterface_WatchDepositFinalized_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *l2_arbitrum_gateway.L2ArbitrumGatewayDepositFinalized, []common.Address, []common.Address, []common.Address) (event.Subscription, error)) *L2ArbitrumGatewayInterface_WatchDepositFinalized_Call { + _c.Call.Return(run) + return _c +} + +// WatchTxToL1 provides a mock function with given fields: opts, sink, _from, _to, _id +func (_m *L2ArbitrumGatewayInterface) WatchTxToL1(opts *bind.WatchOpts, sink chan<- *l2_arbitrum_gateway.L2ArbitrumGatewayTxToL1, _from []common.Address, _to []common.Address, _id []*big.Int) (event.Subscription, error) { + ret := _m.Called(opts, sink, _from, _to, _id) + + if len(ret) == 0 { + panic("no return value specified for WatchTxToL1") + } + + var r0 event.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *l2_arbitrum_gateway.L2ArbitrumGatewayTxToL1, []common.Address, []common.Address, []*big.Int) (event.Subscription, error)); ok { + return rf(opts, sink, _from, _to, _id) + } + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *l2_arbitrum_gateway.L2ArbitrumGatewayTxToL1, []common.Address, []common.Address, []*big.Int) event.Subscription); ok { + r0 = rf(opts, sink, _from, _to, _id) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(event.Subscription) + } + } + + if rf, ok := ret.Get(1).(func(*bind.WatchOpts, chan<- *l2_arbitrum_gateway.L2ArbitrumGatewayTxToL1, []common.Address, []common.Address, []*big.Int) error); ok { + r1 = rf(opts, sink, _from, _to, _id) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// L2ArbitrumGatewayInterface_WatchTxToL1_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchTxToL1' +type L2ArbitrumGatewayInterface_WatchTxToL1_Call struct { + *mock.Call +} + +// WatchTxToL1 is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *l2_arbitrum_gateway.L2ArbitrumGatewayTxToL1 +// - _from []common.Address +// - _to []common.Address +// - _id []*big.Int +func (_e *L2ArbitrumGatewayInterface_Expecter) WatchTxToL1(opts interface{}, sink interface{}, _from interface{}, _to interface{}, _id interface{}) *L2ArbitrumGatewayInterface_WatchTxToL1_Call { + return &L2ArbitrumGatewayInterface_WatchTxToL1_Call{Call: _e.mock.On("WatchTxToL1", opts, sink, _from, _to, _id)} +} + +func (_c *L2ArbitrumGatewayInterface_WatchTxToL1_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *l2_arbitrum_gateway.L2ArbitrumGatewayTxToL1, _from []common.Address, _to []common.Address, _id []*big.Int)) *L2ArbitrumGatewayInterface_WatchTxToL1_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *l2_arbitrum_gateway.L2ArbitrumGatewayTxToL1), args[2].([]common.Address), args[3].([]common.Address), args[4].([]*big.Int)) + }) + return _c +} + +func (_c *L2ArbitrumGatewayInterface_WatchTxToL1_Call) Return(_a0 event.Subscription, _a1 error) *L2ArbitrumGatewayInterface_WatchTxToL1_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *L2ArbitrumGatewayInterface_WatchTxToL1_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *l2_arbitrum_gateway.L2ArbitrumGatewayTxToL1, []common.Address, []common.Address, []*big.Int) (event.Subscription, error)) *L2ArbitrumGatewayInterface_WatchTxToL1_Call { + _c.Call.Return(run) + return _c +} + +// WatchWithdrawalInitiated provides a mock function with given fields: opts, sink, _from, _to, _l2ToL1Id +func (_m *L2ArbitrumGatewayInterface) WatchWithdrawalInitiated(opts *bind.WatchOpts, sink chan<- *l2_arbitrum_gateway.L2ArbitrumGatewayWithdrawalInitiated, _from []common.Address, _to []common.Address, _l2ToL1Id []*big.Int) (event.Subscription, error) { + ret := _m.Called(opts, sink, _from, _to, _l2ToL1Id) + + if len(ret) == 0 { + panic("no return value specified for WatchWithdrawalInitiated") + } + + var r0 event.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *l2_arbitrum_gateway.L2ArbitrumGatewayWithdrawalInitiated, []common.Address, []common.Address, []*big.Int) (event.Subscription, error)); ok { + return rf(opts, sink, _from, _to, _l2ToL1Id) + } + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *l2_arbitrum_gateway.L2ArbitrumGatewayWithdrawalInitiated, []common.Address, []common.Address, []*big.Int) event.Subscription); ok { + r0 = rf(opts, sink, _from, _to, _l2ToL1Id) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(event.Subscription) + } + } + + if rf, ok := ret.Get(1).(func(*bind.WatchOpts, chan<- *l2_arbitrum_gateway.L2ArbitrumGatewayWithdrawalInitiated, []common.Address, []common.Address, []*big.Int) error); ok { + r1 = rf(opts, sink, _from, _to, _l2ToL1Id) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// L2ArbitrumGatewayInterface_WatchWithdrawalInitiated_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchWithdrawalInitiated' +type L2ArbitrumGatewayInterface_WatchWithdrawalInitiated_Call struct { + *mock.Call +} + +// WatchWithdrawalInitiated is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *l2_arbitrum_gateway.L2ArbitrumGatewayWithdrawalInitiated +// - _from []common.Address +// - _to []common.Address +// - _l2ToL1Id []*big.Int +func (_e *L2ArbitrumGatewayInterface_Expecter) WatchWithdrawalInitiated(opts interface{}, sink interface{}, _from interface{}, _to interface{}, _l2ToL1Id interface{}) *L2ArbitrumGatewayInterface_WatchWithdrawalInitiated_Call { + return &L2ArbitrumGatewayInterface_WatchWithdrawalInitiated_Call{Call: _e.mock.On("WatchWithdrawalInitiated", opts, sink, _from, _to, _l2ToL1Id)} +} + +func (_c *L2ArbitrumGatewayInterface_WatchWithdrawalInitiated_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *l2_arbitrum_gateway.L2ArbitrumGatewayWithdrawalInitiated, _from []common.Address, _to []common.Address, _l2ToL1Id []*big.Int)) *L2ArbitrumGatewayInterface_WatchWithdrawalInitiated_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *l2_arbitrum_gateway.L2ArbitrumGatewayWithdrawalInitiated), args[2].([]common.Address), args[3].([]common.Address), args[4].([]*big.Int)) + }) + return _c +} + +func (_c *L2ArbitrumGatewayInterface_WatchWithdrawalInitiated_Call) Return(_a0 event.Subscription, _a1 error) *L2ArbitrumGatewayInterface_WatchWithdrawalInitiated_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *L2ArbitrumGatewayInterface_WatchWithdrawalInitiated_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *l2_arbitrum_gateway.L2ArbitrumGatewayWithdrawalInitiated, []common.Address, []common.Address, []*big.Int) (event.Subscription, error)) *L2ArbitrumGatewayInterface_WatchWithdrawalInitiated_Call { + _c.Call.Return(run) + return _c +} + +// NewL2ArbitrumGatewayInterface creates a new instance of L2ArbitrumGatewayInterface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewL2ArbitrumGatewayInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *L2ArbitrumGatewayInterface { + mock := &L2ArbitrumGatewayInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/core/gethwrappers/liquiditymanager/mocks/mock_l2_arbitrum_messenger/l2_arbitrum_messenger_interface.go b/core/gethwrappers/liquiditymanager/mocks/mock_l2_arbitrum_messenger/l2_arbitrum_messenger_interface.go new file mode 100644 index 00000000000..126f870685b --- /dev/null +++ b/core/gethwrappers/liquiditymanager/mocks/mock_l2_arbitrum_messenger/l2_arbitrum_messenger_interface.go @@ -0,0 +1,333 @@ +// Code generated by mockery v2.43.2. DO NOT EDIT. + +package mock_l2_arbitrum_messenger + +import ( + big "math/big" + + bind "github.com/ethereum/go-ethereum/accounts/abi/bind" + common "github.com/ethereum/go-ethereum/common" + + event "github.com/ethereum/go-ethereum/event" + + generated "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" + + l2_arbitrum_messenger "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/liquiditymanager/generated/l2_arbitrum_messenger" + + mock "github.com/stretchr/testify/mock" + + types "github.com/ethereum/go-ethereum/core/types" +) + +// L2ArbitrumMessengerInterface is an autogenerated mock type for the L2ArbitrumMessengerInterface type +type L2ArbitrumMessengerInterface struct { + mock.Mock +} + +type L2ArbitrumMessengerInterface_Expecter struct { + mock *mock.Mock +} + +func (_m *L2ArbitrumMessengerInterface) EXPECT() *L2ArbitrumMessengerInterface_Expecter { + return &L2ArbitrumMessengerInterface_Expecter{mock: &_m.Mock} +} + +// Address provides a mock function with given fields: +func (_m *L2ArbitrumMessengerInterface) Address() common.Address { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Address") + } + + var r0 common.Address + if rf, ok := ret.Get(0).(func() common.Address); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Address) + } + } + + return r0 +} + +// L2ArbitrumMessengerInterface_Address_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Address' +type L2ArbitrumMessengerInterface_Address_Call struct { + *mock.Call +} + +// Address is a helper method to define mock.On call +func (_e *L2ArbitrumMessengerInterface_Expecter) Address() *L2ArbitrumMessengerInterface_Address_Call { + return &L2ArbitrumMessengerInterface_Address_Call{Call: _e.mock.On("Address")} +} + +func (_c *L2ArbitrumMessengerInterface_Address_Call) Run(run func()) *L2ArbitrumMessengerInterface_Address_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *L2ArbitrumMessengerInterface_Address_Call) Return(_a0 common.Address) *L2ArbitrumMessengerInterface_Address_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *L2ArbitrumMessengerInterface_Address_Call) RunAndReturn(run func() common.Address) *L2ArbitrumMessengerInterface_Address_Call { + _c.Call.Return(run) + return _c +} + +// FilterTxToL1 provides a mock function with given fields: opts, _from, _to, _id +func (_m *L2ArbitrumMessengerInterface) FilterTxToL1(opts *bind.FilterOpts, _from []common.Address, _to []common.Address, _id []*big.Int) (*l2_arbitrum_messenger.L2ArbitrumMessengerTxToL1Iterator, error) { + ret := _m.Called(opts, _from, _to, _id) + + if len(ret) == 0 { + panic("no return value specified for FilterTxToL1") + } + + var r0 *l2_arbitrum_messenger.L2ArbitrumMessengerTxToL1Iterator + var r1 error + if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []common.Address, []common.Address, []*big.Int) (*l2_arbitrum_messenger.L2ArbitrumMessengerTxToL1Iterator, error)); ok { + return rf(opts, _from, _to, _id) + } + if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []common.Address, []common.Address, []*big.Int) *l2_arbitrum_messenger.L2ArbitrumMessengerTxToL1Iterator); ok { + r0 = rf(opts, _from, _to, _id) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*l2_arbitrum_messenger.L2ArbitrumMessengerTxToL1Iterator) + } + } + + if rf, ok := ret.Get(1).(func(*bind.FilterOpts, []common.Address, []common.Address, []*big.Int) error); ok { + r1 = rf(opts, _from, _to, _id) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// L2ArbitrumMessengerInterface_FilterTxToL1_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterTxToL1' +type L2ArbitrumMessengerInterface_FilterTxToL1_Call struct { + *mock.Call +} + +// FilterTxToL1 is a helper method to define mock.On call +// - opts *bind.FilterOpts +// - _from []common.Address +// - _to []common.Address +// - _id []*big.Int +func (_e *L2ArbitrumMessengerInterface_Expecter) FilterTxToL1(opts interface{}, _from interface{}, _to interface{}, _id interface{}) *L2ArbitrumMessengerInterface_FilterTxToL1_Call { + return &L2ArbitrumMessengerInterface_FilterTxToL1_Call{Call: _e.mock.On("FilterTxToL1", opts, _from, _to, _id)} +} + +func (_c *L2ArbitrumMessengerInterface_FilterTxToL1_Call) Run(run func(opts *bind.FilterOpts, _from []common.Address, _to []common.Address, _id []*big.Int)) *L2ArbitrumMessengerInterface_FilterTxToL1_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts), args[1].([]common.Address), args[2].([]common.Address), args[3].([]*big.Int)) + }) + return _c +} + +func (_c *L2ArbitrumMessengerInterface_FilterTxToL1_Call) Return(_a0 *l2_arbitrum_messenger.L2ArbitrumMessengerTxToL1Iterator, _a1 error) *L2ArbitrumMessengerInterface_FilterTxToL1_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *L2ArbitrumMessengerInterface_FilterTxToL1_Call) RunAndReturn(run func(*bind.FilterOpts, []common.Address, []common.Address, []*big.Int) (*l2_arbitrum_messenger.L2ArbitrumMessengerTxToL1Iterator, error)) *L2ArbitrumMessengerInterface_FilterTxToL1_Call { + _c.Call.Return(run) + return _c +} + +// ParseLog provides a mock function with given fields: log +func (_m *L2ArbitrumMessengerInterface) ParseLog(log types.Log) (generated.AbigenLog, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParseLog") + } + + var r0 generated.AbigenLog + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (generated.AbigenLog, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) generated.AbigenLog); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(generated.AbigenLog) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// L2ArbitrumMessengerInterface_ParseLog_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseLog' +type L2ArbitrumMessengerInterface_ParseLog_Call struct { + *mock.Call +} + +// ParseLog is a helper method to define mock.On call +// - log types.Log +func (_e *L2ArbitrumMessengerInterface_Expecter) ParseLog(log interface{}) *L2ArbitrumMessengerInterface_ParseLog_Call { + return &L2ArbitrumMessengerInterface_ParseLog_Call{Call: _e.mock.On("ParseLog", log)} +} + +func (_c *L2ArbitrumMessengerInterface_ParseLog_Call) Run(run func(log types.Log)) *L2ArbitrumMessengerInterface_ParseLog_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *L2ArbitrumMessengerInterface_ParseLog_Call) Return(_a0 generated.AbigenLog, _a1 error) *L2ArbitrumMessengerInterface_ParseLog_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *L2ArbitrumMessengerInterface_ParseLog_Call) RunAndReturn(run func(types.Log) (generated.AbigenLog, error)) *L2ArbitrumMessengerInterface_ParseLog_Call { + _c.Call.Return(run) + return _c +} + +// ParseTxToL1 provides a mock function with given fields: log +func (_m *L2ArbitrumMessengerInterface) ParseTxToL1(log types.Log) (*l2_arbitrum_messenger.L2ArbitrumMessengerTxToL1, error) { + ret := _m.Called(log) + + if len(ret) == 0 { + panic("no return value specified for ParseTxToL1") + } + + var r0 *l2_arbitrum_messenger.L2ArbitrumMessengerTxToL1 + var r1 error + if rf, ok := ret.Get(0).(func(types.Log) (*l2_arbitrum_messenger.L2ArbitrumMessengerTxToL1, error)); ok { + return rf(log) + } + if rf, ok := ret.Get(0).(func(types.Log) *l2_arbitrum_messenger.L2ArbitrumMessengerTxToL1); ok { + r0 = rf(log) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*l2_arbitrum_messenger.L2ArbitrumMessengerTxToL1) + } + } + + if rf, ok := ret.Get(1).(func(types.Log) error); ok { + r1 = rf(log) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// L2ArbitrumMessengerInterface_ParseTxToL1_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseTxToL1' +type L2ArbitrumMessengerInterface_ParseTxToL1_Call struct { + *mock.Call +} + +// ParseTxToL1 is a helper method to define mock.On call +// - log types.Log +func (_e *L2ArbitrumMessengerInterface_Expecter) ParseTxToL1(log interface{}) *L2ArbitrumMessengerInterface_ParseTxToL1_Call { + return &L2ArbitrumMessengerInterface_ParseTxToL1_Call{Call: _e.mock.On("ParseTxToL1", log)} +} + +func (_c *L2ArbitrumMessengerInterface_ParseTxToL1_Call) Run(run func(log types.Log)) *L2ArbitrumMessengerInterface_ParseTxToL1_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *L2ArbitrumMessengerInterface_ParseTxToL1_Call) Return(_a0 *l2_arbitrum_messenger.L2ArbitrumMessengerTxToL1, _a1 error) *L2ArbitrumMessengerInterface_ParseTxToL1_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *L2ArbitrumMessengerInterface_ParseTxToL1_Call) RunAndReturn(run func(types.Log) (*l2_arbitrum_messenger.L2ArbitrumMessengerTxToL1, error)) *L2ArbitrumMessengerInterface_ParseTxToL1_Call { + _c.Call.Return(run) + return _c +} + +// WatchTxToL1 provides a mock function with given fields: opts, sink, _from, _to, _id +func (_m *L2ArbitrumMessengerInterface) WatchTxToL1(opts *bind.WatchOpts, sink chan<- *l2_arbitrum_messenger.L2ArbitrumMessengerTxToL1, _from []common.Address, _to []common.Address, _id []*big.Int) (event.Subscription, error) { + ret := _m.Called(opts, sink, _from, _to, _id) + + if len(ret) == 0 { + panic("no return value specified for WatchTxToL1") + } + + var r0 event.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *l2_arbitrum_messenger.L2ArbitrumMessengerTxToL1, []common.Address, []common.Address, []*big.Int) (event.Subscription, error)); ok { + return rf(opts, sink, _from, _to, _id) + } + if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *l2_arbitrum_messenger.L2ArbitrumMessengerTxToL1, []common.Address, []common.Address, []*big.Int) event.Subscription); ok { + r0 = rf(opts, sink, _from, _to, _id) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(event.Subscription) + } + } + + if rf, ok := ret.Get(1).(func(*bind.WatchOpts, chan<- *l2_arbitrum_messenger.L2ArbitrumMessengerTxToL1, []common.Address, []common.Address, []*big.Int) error); ok { + r1 = rf(opts, sink, _from, _to, _id) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// L2ArbitrumMessengerInterface_WatchTxToL1_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchTxToL1' +type L2ArbitrumMessengerInterface_WatchTxToL1_Call struct { + *mock.Call +} + +// WatchTxToL1 is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *l2_arbitrum_messenger.L2ArbitrumMessengerTxToL1 +// - _from []common.Address +// - _to []common.Address +// - _id []*big.Int +func (_e *L2ArbitrumMessengerInterface_Expecter) WatchTxToL1(opts interface{}, sink interface{}, _from interface{}, _to interface{}, _id interface{}) *L2ArbitrumMessengerInterface_WatchTxToL1_Call { + return &L2ArbitrumMessengerInterface_WatchTxToL1_Call{Call: _e.mock.On("WatchTxToL1", opts, sink, _from, _to, _id)} +} + +func (_c *L2ArbitrumMessengerInterface_WatchTxToL1_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *l2_arbitrum_messenger.L2ArbitrumMessengerTxToL1, _from []common.Address, _to []common.Address, _id []*big.Int)) *L2ArbitrumMessengerInterface_WatchTxToL1_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *l2_arbitrum_messenger.L2ArbitrumMessengerTxToL1), args[2].([]common.Address), args[3].([]common.Address), args[4].([]*big.Int)) + }) + return _c +} + +func (_c *L2ArbitrumMessengerInterface_WatchTxToL1_Call) Return(_a0 event.Subscription, _a1 error) *L2ArbitrumMessengerInterface_WatchTxToL1_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *L2ArbitrumMessengerInterface_WatchTxToL1_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *l2_arbitrum_messenger.L2ArbitrumMessengerTxToL1, []common.Address, []common.Address, []*big.Int) (event.Subscription, error)) *L2ArbitrumMessengerInterface_WatchTxToL1_Call { + _c.Call.Return(run) + return _c +} + +// NewL2ArbitrumMessengerInterface creates a new instance of L2ArbitrumMessengerInterface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewL2ArbitrumMessengerInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *L2ArbitrumMessengerInterface { + mock := &L2ArbitrumMessengerInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/core/gethwrappers/liquiditymanager/mocks/mock_node_interface/node_interface_interface.go b/core/gethwrappers/liquiditymanager/mocks/mock_node_interface/node_interface_interface.go new file mode 100644 index 00000000000..8210f1050e7 --- /dev/null +++ b/core/gethwrappers/liquiditymanager/mocks/mock_node_interface/node_interface_interface.go @@ -0,0 +1,680 @@ +// Code generated by mockery v2.43.2. DO NOT EDIT. + +package mock_node_interface + +import ( + big "math/big" + + arb_node_interface "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/liquiditymanager/generated/arb_node_interface" + + bind "github.com/ethereum/go-ethereum/accounts/abi/bind" + + common "github.com/ethereum/go-ethereum/common" + + mock "github.com/stretchr/testify/mock" + + types "github.com/ethereum/go-ethereum/core/types" +) + +// NodeInterfaceInterface is an autogenerated mock type for the NodeInterfaceInterface type +type NodeInterfaceInterface struct { + mock.Mock +} + +type NodeInterfaceInterface_Expecter struct { + mock *mock.Mock +} + +func (_m *NodeInterfaceInterface) EXPECT() *NodeInterfaceInterface_Expecter { + return &NodeInterfaceInterface_Expecter{mock: &_m.Mock} +} + +// Address provides a mock function with given fields: +func (_m *NodeInterfaceInterface) Address() common.Address { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Address") + } + + var r0 common.Address + if rf, ok := ret.Get(0).(func() common.Address); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Address) + } + } + + return r0 +} + +// NodeInterfaceInterface_Address_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Address' +type NodeInterfaceInterface_Address_Call struct { + *mock.Call +} + +// Address is a helper method to define mock.On call +func (_e *NodeInterfaceInterface_Expecter) Address() *NodeInterfaceInterface_Address_Call { + return &NodeInterfaceInterface_Address_Call{Call: _e.mock.On("Address")} +} + +func (_c *NodeInterfaceInterface_Address_Call) Run(run func()) *NodeInterfaceInterface_Address_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *NodeInterfaceInterface_Address_Call) Return(_a0 common.Address) *NodeInterfaceInterface_Address_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *NodeInterfaceInterface_Address_Call) RunAndReturn(run func() common.Address) *NodeInterfaceInterface_Address_Call { + _c.Call.Return(run) + return _c +} + +// BlockL1Num provides a mock function with given fields: opts, l2BlockNum +func (_m *NodeInterfaceInterface) BlockL1Num(opts *bind.CallOpts, l2BlockNum uint64) (uint64, error) { + ret := _m.Called(opts, l2BlockNum) + + if len(ret) == 0 { + panic("no return value specified for BlockL1Num") + } + + var r0 uint64 + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts, uint64) (uint64, error)); ok { + return rf(opts, l2BlockNum) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts, uint64) uint64); ok { + r0 = rf(opts, l2BlockNum) + } else { + r0 = ret.Get(0).(uint64) + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts, uint64) error); ok { + r1 = rf(opts, l2BlockNum) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// NodeInterfaceInterface_BlockL1Num_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BlockL1Num' +type NodeInterfaceInterface_BlockL1Num_Call struct { + *mock.Call +} + +// BlockL1Num is a helper method to define mock.On call +// - opts *bind.CallOpts +// - l2BlockNum uint64 +func (_e *NodeInterfaceInterface_Expecter) BlockL1Num(opts interface{}, l2BlockNum interface{}) *NodeInterfaceInterface_BlockL1Num_Call { + return &NodeInterfaceInterface_BlockL1Num_Call{Call: _e.mock.On("BlockL1Num", opts, l2BlockNum)} +} + +func (_c *NodeInterfaceInterface_BlockL1Num_Call) Run(run func(opts *bind.CallOpts, l2BlockNum uint64)) *NodeInterfaceInterface_BlockL1Num_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts), args[1].(uint64)) + }) + return _c +} + +func (_c *NodeInterfaceInterface_BlockL1Num_Call) Return(_a0 uint64, _a1 error) *NodeInterfaceInterface_BlockL1Num_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *NodeInterfaceInterface_BlockL1Num_Call) RunAndReturn(run func(*bind.CallOpts, uint64) (uint64, error)) *NodeInterfaceInterface_BlockL1Num_Call { + _c.Call.Return(run) + return _c +} + +// ConstructOutboxProof provides a mock function with given fields: opts, size, leaf +func (_m *NodeInterfaceInterface) ConstructOutboxProof(opts *bind.CallOpts, size uint64, leaf uint64) (arb_node_interface.ConstructOutboxProof, error) { + ret := _m.Called(opts, size, leaf) + + if len(ret) == 0 { + panic("no return value specified for ConstructOutboxProof") + } + + var r0 arb_node_interface.ConstructOutboxProof + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts, uint64, uint64) (arb_node_interface.ConstructOutboxProof, error)); ok { + return rf(opts, size, leaf) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts, uint64, uint64) arb_node_interface.ConstructOutboxProof); ok { + r0 = rf(opts, size, leaf) + } else { + r0 = ret.Get(0).(arb_node_interface.ConstructOutboxProof) + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts, uint64, uint64) error); ok { + r1 = rf(opts, size, leaf) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// NodeInterfaceInterface_ConstructOutboxProof_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ConstructOutboxProof' +type NodeInterfaceInterface_ConstructOutboxProof_Call struct { + *mock.Call +} + +// ConstructOutboxProof is a helper method to define mock.On call +// - opts *bind.CallOpts +// - size uint64 +// - leaf uint64 +func (_e *NodeInterfaceInterface_Expecter) ConstructOutboxProof(opts interface{}, size interface{}, leaf interface{}) *NodeInterfaceInterface_ConstructOutboxProof_Call { + return &NodeInterfaceInterface_ConstructOutboxProof_Call{Call: _e.mock.On("ConstructOutboxProof", opts, size, leaf)} +} + +func (_c *NodeInterfaceInterface_ConstructOutboxProof_Call) Run(run func(opts *bind.CallOpts, size uint64, leaf uint64)) *NodeInterfaceInterface_ConstructOutboxProof_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts), args[1].(uint64), args[2].(uint64)) + }) + return _c +} + +func (_c *NodeInterfaceInterface_ConstructOutboxProof_Call) Return(_a0 arb_node_interface.ConstructOutboxProof, _a1 error) *NodeInterfaceInterface_ConstructOutboxProof_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *NodeInterfaceInterface_ConstructOutboxProof_Call) RunAndReturn(run func(*bind.CallOpts, uint64, uint64) (arb_node_interface.ConstructOutboxProof, error)) *NodeInterfaceInterface_ConstructOutboxProof_Call { + _c.Call.Return(run) + return _c +} + +// EstimateRetryableTicket provides a mock function with given fields: opts, sender, deposit, to, l2CallValue, excessFeeRefundAddress, callValueRefundAddress, data +func (_m *NodeInterfaceInterface) EstimateRetryableTicket(opts *bind.TransactOpts, sender common.Address, deposit *big.Int, to common.Address, l2CallValue *big.Int, excessFeeRefundAddress common.Address, callValueRefundAddress common.Address, data []byte) (*types.Transaction, error) { + ret := _m.Called(opts, sender, deposit, to, l2CallValue, excessFeeRefundAddress, callValueRefundAddress, data) + + if len(ret) == 0 { + panic("no return value specified for EstimateRetryableTicket") + } + + var r0 *types.Transaction + var r1 error + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, common.Address, *big.Int, common.Address, *big.Int, common.Address, common.Address, []byte) (*types.Transaction, error)); ok { + return rf(opts, sender, deposit, to, l2CallValue, excessFeeRefundAddress, callValueRefundAddress, data) + } + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, common.Address, *big.Int, common.Address, *big.Int, common.Address, common.Address, []byte) *types.Transaction); ok { + r0 = rf(opts, sender, deposit, to, l2CallValue, excessFeeRefundAddress, callValueRefundAddress, data) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Transaction) + } + } + + if rf, ok := ret.Get(1).(func(*bind.TransactOpts, common.Address, *big.Int, common.Address, *big.Int, common.Address, common.Address, []byte) error); ok { + r1 = rf(opts, sender, deposit, to, l2CallValue, excessFeeRefundAddress, callValueRefundAddress, data) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// NodeInterfaceInterface_EstimateRetryableTicket_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EstimateRetryableTicket' +type NodeInterfaceInterface_EstimateRetryableTicket_Call struct { + *mock.Call +} + +// EstimateRetryableTicket is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - sender common.Address +// - deposit *big.Int +// - to common.Address +// - l2CallValue *big.Int +// - excessFeeRefundAddress common.Address +// - callValueRefundAddress common.Address +// - data []byte +func (_e *NodeInterfaceInterface_Expecter) EstimateRetryableTicket(opts interface{}, sender interface{}, deposit interface{}, to interface{}, l2CallValue interface{}, excessFeeRefundAddress interface{}, callValueRefundAddress interface{}, data interface{}) *NodeInterfaceInterface_EstimateRetryableTicket_Call { + return &NodeInterfaceInterface_EstimateRetryableTicket_Call{Call: _e.mock.On("EstimateRetryableTicket", opts, sender, deposit, to, l2CallValue, excessFeeRefundAddress, callValueRefundAddress, data)} +} + +func (_c *NodeInterfaceInterface_EstimateRetryableTicket_Call) Run(run func(opts *bind.TransactOpts, sender common.Address, deposit *big.Int, to common.Address, l2CallValue *big.Int, excessFeeRefundAddress common.Address, callValueRefundAddress common.Address, data []byte)) *NodeInterfaceInterface_EstimateRetryableTicket_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].(common.Address), args[2].(*big.Int), args[3].(common.Address), args[4].(*big.Int), args[5].(common.Address), args[6].(common.Address), args[7].([]byte)) + }) + return _c +} + +func (_c *NodeInterfaceInterface_EstimateRetryableTicket_Call) Return(_a0 *types.Transaction, _a1 error) *NodeInterfaceInterface_EstimateRetryableTicket_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *NodeInterfaceInterface_EstimateRetryableTicket_Call) RunAndReturn(run func(*bind.TransactOpts, common.Address, *big.Int, common.Address, *big.Int, common.Address, common.Address, []byte) (*types.Transaction, error)) *NodeInterfaceInterface_EstimateRetryableTicket_Call { + _c.Call.Return(run) + return _c +} + +// FindBatchContainingBlock provides a mock function with given fields: opts, blockNum +func (_m *NodeInterfaceInterface) FindBatchContainingBlock(opts *bind.CallOpts, blockNum uint64) (uint64, error) { + ret := _m.Called(opts, blockNum) + + if len(ret) == 0 { + panic("no return value specified for FindBatchContainingBlock") + } + + var r0 uint64 + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts, uint64) (uint64, error)); ok { + return rf(opts, blockNum) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts, uint64) uint64); ok { + r0 = rf(opts, blockNum) + } else { + r0 = ret.Get(0).(uint64) + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts, uint64) error); ok { + r1 = rf(opts, blockNum) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// NodeInterfaceInterface_FindBatchContainingBlock_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindBatchContainingBlock' +type NodeInterfaceInterface_FindBatchContainingBlock_Call struct { + *mock.Call +} + +// FindBatchContainingBlock is a helper method to define mock.On call +// - opts *bind.CallOpts +// - blockNum uint64 +func (_e *NodeInterfaceInterface_Expecter) FindBatchContainingBlock(opts interface{}, blockNum interface{}) *NodeInterfaceInterface_FindBatchContainingBlock_Call { + return &NodeInterfaceInterface_FindBatchContainingBlock_Call{Call: _e.mock.On("FindBatchContainingBlock", opts, blockNum)} +} + +func (_c *NodeInterfaceInterface_FindBatchContainingBlock_Call) Run(run func(opts *bind.CallOpts, blockNum uint64)) *NodeInterfaceInterface_FindBatchContainingBlock_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts), args[1].(uint64)) + }) + return _c +} + +func (_c *NodeInterfaceInterface_FindBatchContainingBlock_Call) Return(_a0 uint64, _a1 error) *NodeInterfaceInterface_FindBatchContainingBlock_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *NodeInterfaceInterface_FindBatchContainingBlock_Call) RunAndReturn(run func(*bind.CallOpts, uint64) (uint64, error)) *NodeInterfaceInterface_FindBatchContainingBlock_Call { + _c.Call.Return(run) + return _c +} + +// GasEstimateComponents provides a mock function with given fields: opts, to, contractCreation, data +func (_m *NodeInterfaceInterface) GasEstimateComponents(opts *bind.TransactOpts, to common.Address, contractCreation bool, data []byte) (*types.Transaction, error) { + ret := _m.Called(opts, to, contractCreation, data) + + if len(ret) == 0 { + panic("no return value specified for GasEstimateComponents") + } + + var r0 *types.Transaction + var r1 error + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, common.Address, bool, []byte) (*types.Transaction, error)); ok { + return rf(opts, to, contractCreation, data) + } + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, common.Address, bool, []byte) *types.Transaction); ok { + r0 = rf(opts, to, contractCreation, data) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Transaction) + } + } + + if rf, ok := ret.Get(1).(func(*bind.TransactOpts, common.Address, bool, []byte) error); ok { + r1 = rf(opts, to, contractCreation, data) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// NodeInterfaceInterface_GasEstimateComponents_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GasEstimateComponents' +type NodeInterfaceInterface_GasEstimateComponents_Call struct { + *mock.Call +} + +// GasEstimateComponents is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - to common.Address +// - contractCreation bool +// - data []byte +func (_e *NodeInterfaceInterface_Expecter) GasEstimateComponents(opts interface{}, to interface{}, contractCreation interface{}, data interface{}) *NodeInterfaceInterface_GasEstimateComponents_Call { + return &NodeInterfaceInterface_GasEstimateComponents_Call{Call: _e.mock.On("GasEstimateComponents", opts, to, contractCreation, data)} +} + +func (_c *NodeInterfaceInterface_GasEstimateComponents_Call) Run(run func(opts *bind.TransactOpts, to common.Address, contractCreation bool, data []byte)) *NodeInterfaceInterface_GasEstimateComponents_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].(common.Address), args[2].(bool), args[3].([]byte)) + }) + return _c +} + +func (_c *NodeInterfaceInterface_GasEstimateComponents_Call) Return(_a0 *types.Transaction, _a1 error) *NodeInterfaceInterface_GasEstimateComponents_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *NodeInterfaceInterface_GasEstimateComponents_Call) RunAndReturn(run func(*bind.TransactOpts, common.Address, bool, []byte) (*types.Transaction, error)) *NodeInterfaceInterface_GasEstimateComponents_Call { + _c.Call.Return(run) + return _c +} + +// GasEstimateL1Component provides a mock function with given fields: opts, to, contractCreation, data +func (_m *NodeInterfaceInterface) GasEstimateL1Component(opts *bind.TransactOpts, to common.Address, contractCreation bool, data []byte) (*types.Transaction, error) { + ret := _m.Called(opts, to, contractCreation, data) + + if len(ret) == 0 { + panic("no return value specified for GasEstimateL1Component") + } + + var r0 *types.Transaction + var r1 error + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, common.Address, bool, []byte) (*types.Transaction, error)); ok { + return rf(opts, to, contractCreation, data) + } + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, common.Address, bool, []byte) *types.Transaction); ok { + r0 = rf(opts, to, contractCreation, data) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Transaction) + } + } + + if rf, ok := ret.Get(1).(func(*bind.TransactOpts, common.Address, bool, []byte) error); ok { + r1 = rf(opts, to, contractCreation, data) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// NodeInterfaceInterface_GasEstimateL1Component_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GasEstimateL1Component' +type NodeInterfaceInterface_GasEstimateL1Component_Call struct { + *mock.Call +} + +// GasEstimateL1Component is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - to common.Address +// - contractCreation bool +// - data []byte +func (_e *NodeInterfaceInterface_Expecter) GasEstimateL1Component(opts interface{}, to interface{}, contractCreation interface{}, data interface{}) *NodeInterfaceInterface_GasEstimateL1Component_Call { + return &NodeInterfaceInterface_GasEstimateL1Component_Call{Call: _e.mock.On("GasEstimateL1Component", opts, to, contractCreation, data)} +} + +func (_c *NodeInterfaceInterface_GasEstimateL1Component_Call) Run(run func(opts *bind.TransactOpts, to common.Address, contractCreation bool, data []byte)) *NodeInterfaceInterface_GasEstimateL1Component_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].(common.Address), args[2].(bool), args[3].([]byte)) + }) + return _c +} + +func (_c *NodeInterfaceInterface_GasEstimateL1Component_Call) Return(_a0 *types.Transaction, _a1 error) *NodeInterfaceInterface_GasEstimateL1Component_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *NodeInterfaceInterface_GasEstimateL1Component_Call) RunAndReturn(run func(*bind.TransactOpts, common.Address, bool, []byte) (*types.Transaction, error)) *NodeInterfaceInterface_GasEstimateL1Component_Call { + _c.Call.Return(run) + return _c +} + +// GetL1Confirmations provides a mock function with given fields: opts, blockHash +func (_m *NodeInterfaceInterface) GetL1Confirmations(opts *bind.CallOpts, blockHash [32]byte) (uint64, error) { + ret := _m.Called(opts, blockHash) + + if len(ret) == 0 { + panic("no return value specified for GetL1Confirmations") + } + + var r0 uint64 + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts, [32]byte) (uint64, error)); ok { + return rf(opts, blockHash) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts, [32]byte) uint64); ok { + r0 = rf(opts, blockHash) + } else { + r0 = ret.Get(0).(uint64) + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts, [32]byte) error); ok { + r1 = rf(opts, blockHash) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// NodeInterfaceInterface_GetL1Confirmations_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetL1Confirmations' +type NodeInterfaceInterface_GetL1Confirmations_Call struct { + *mock.Call +} + +// GetL1Confirmations is a helper method to define mock.On call +// - opts *bind.CallOpts +// - blockHash [32]byte +func (_e *NodeInterfaceInterface_Expecter) GetL1Confirmations(opts interface{}, blockHash interface{}) *NodeInterfaceInterface_GetL1Confirmations_Call { + return &NodeInterfaceInterface_GetL1Confirmations_Call{Call: _e.mock.On("GetL1Confirmations", opts, blockHash)} +} + +func (_c *NodeInterfaceInterface_GetL1Confirmations_Call) Run(run func(opts *bind.CallOpts, blockHash [32]byte)) *NodeInterfaceInterface_GetL1Confirmations_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts), args[1].([32]byte)) + }) + return _c +} + +func (_c *NodeInterfaceInterface_GetL1Confirmations_Call) Return(_a0 uint64, _a1 error) *NodeInterfaceInterface_GetL1Confirmations_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *NodeInterfaceInterface_GetL1Confirmations_Call) RunAndReturn(run func(*bind.CallOpts, [32]byte) (uint64, error)) *NodeInterfaceInterface_GetL1Confirmations_Call { + _c.Call.Return(run) + return _c +} + +// L2BlockRangeForL1 provides a mock function with given fields: opts, blockNum +func (_m *NodeInterfaceInterface) L2BlockRangeForL1(opts *bind.CallOpts, blockNum uint64) (arb_node_interface.L2BlockRangeForL1, error) { + ret := _m.Called(opts, blockNum) + + if len(ret) == 0 { + panic("no return value specified for L2BlockRangeForL1") + } + + var r0 arb_node_interface.L2BlockRangeForL1 + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts, uint64) (arb_node_interface.L2BlockRangeForL1, error)); ok { + return rf(opts, blockNum) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts, uint64) arb_node_interface.L2BlockRangeForL1); ok { + r0 = rf(opts, blockNum) + } else { + r0 = ret.Get(0).(arb_node_interface.L2BlockRangeForL1) + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts, uint64) error); ok { + r1 = rf(opts, blockNum) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// NodeInterfaceInterface_L2BlockRangeForL1_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'L2BlockRangeForL1' +type NodeInterfaceInterface_L2BlockRangeForL1_Call struct { + *mock.Call +} + +// L2BlockRangeForL1 is a helper method to define mock.On call +// - opts *bind.CallOpts +// - blockNum uint64 +func (_e *NodeInterfaceInterface_Expecter) L2BlockRangeForL1(opts interface{}, blockNum interface{}) *NodeInterfaceInterface_L2BlockRangeForL1_Call { + return &NodeInterfaceInterface_L2BlockRangeForL1_Call{Call: _e.mock.On("L2BlockRangeForL1", opts, blockNum)} +} + +func (_c *NodeInterfaceInterface_L2BlockRangeForL1_Call) Run(run func(opts *bind.CallOpts, blockNum uint64)) *NodeInterfaceInterface_L2BlockRangeForL1_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts), args[1].(uint64)) + }) + return _c +} + +func (_c *NodeInterfaceInterface_L2BlockRangeForL1_Call) Return(_a0 arb_node_interface.L2BlockRangeForL1, _a1 error) *NodeInterfaceInterface_L2BlockRangeForL1_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *NodeInterfaceInterface_L2BlockRangeForL1_Call) RunAndReturn(run func(*bind.CallOpts, uint64) (arb_node_interface.L2BlockRangeForL1, error)) *NodeInterfaceInterface_L2BlockRangeForL1_Call { + _c.Call.Return(run) + return _c +} + +// LegacyLookupMessageBatchProof provides a mock function with given fields: opts, batchNum, index +func (_m *NodeInterfaceInterface) LegacyLookupMessageBatchProof(opts *bind.CallOpts, batchNum *big.Int, index uint64) (arb_node_interface.LegacyLookupMessageBatchProof, error) { + ret := _m.Called(opts, batchNum, index) + + if len(ret) == 0 { + panic("no return value specified for LegacyLookupMessageBatchProof") + } + + var r0 arb_node_interface.LegacyLookupMessageBatchProof + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts, *big.Int, uint64) (arb_node_interface.LegacyLookupMessageBatchProof, error)); ok { + return rf(opts, batchNum, index) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts, *big.Int, uint64) arb_node_interface.LegacyLookupMessageBatchProof); ok { + r0 = rf(opts, batchNum, index) + } else { + r0 = ret.Get(0).(arb_node_interface.LegacyLookupMessageBatchProof) + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts, *big.Int, uint64) error); ok { + r1 = rf(opts, batchNum, index) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// NodeInterfaceInterface_LegacyLookupMessageBatchProof_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LegacyLookupMessageBatchProof' +type NodeInterfaceInterface_LegacyLookupMessageBatchProof_Call struct { + *mock.Call +} + +// LegacyLookupMessageBatchProof is a helper method to define mock.On call +// - opts *bind.CallOpts +// - batchNum *big.Int +// - index uint64 +func (_e *NodeInterfaceInterface_Expecter) LegacyLookupMessageBatchProof(opts interface{}, batchNum interface{}, index interface{}) *NodeInterfaceInterface_LegacyLookupMessageBatchProof_Call { + return &NodeInterfaceInterface_LegacyLookupMessageBatchProof_Call{Call: _e.mock.On("LegacyLookupMessageBatchProof", opts, batchNum, index)} +} + +func (_c *NodeInterfaceInterface_LegacyLookupMessageBatchProof_Call) Run(run func(opts *bind.CallOpts, batchNum *big.Int, index uint64)) *NodeInterfaceInterface_LegacyLookupMessageBatchProof_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts), args[1].(*big.Int), args[2].(uint64)) + }) + return _c +} + +func (_c *NodeInterfaceInterface_LegacyLookupMessageBatchProof_Call) Return(_a0 arb_node_interface.LegacyLookupMessageBatchProof, _a1 error) *NodeInterfaceInterface_LegacyLookupMessageBatchProof_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *NodeInterfaceInterface_LegacyLookupMessageBatchProof_Call) RunAndReturn(run func(*bind.CallOpts, *big.Int, uint64) (arb_node_interface.LegacyLookupMessageBatchProof, error)) *NodeInterfaceInterface_LegacyLookupMessageBatchProof_Call { + _c.Call.Return(run) + return _c +} + +// NitroGenesisBlock provides a mock function with given fields: opts +func (_m *NodeInterfaceInterface) NitroGenesisBlock(opts *bind.CallOpts) (*big.Int, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for NitroGenesisBlock") + } + + var r0 *big.Int + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts) (*big.Int, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts) *big.Int); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*big.Int) + } + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// NodeInterfaceInterface_NitroGenesisBlock_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NitroGenesisBlock' +type NodeInterfaceInterface_NitroGenesisBlock_Call struct { + *mock.Call +} + +// NitroGenesisBlock is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *NodeInterfaceInterface_Expecter) NitroGenesisBlock(opts interface{}) *NodeInterfaceInterface_NitroGenesisBlock_Call { + return &NodeInterfaceInterface_NitroGenesisBlock_Call{Call: _e.mock.On("NitroGenesisBlock", opts)} +} + +func (_c *NodeInterfaceInterface_NitroGenesisBlock_Call) Run(run func(opts *bind.CallOpts)) *NodeInterfaceInterface_NitroGenesisBlock_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *NodeInterfaceInterface_NitroGenesisBlock_Call) Return(_a0 *big.Int, _a1 error) *NodeInterfaceInterface_NitroGenesisBlock_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *NodeInterfaceInterface_NitroGenesisBlock_Call) RunAndReturn(run func(*bind.CallOpts) (*big.Int, error)) *NodeInterfaceInterface_NitroGenesisBlock_Call { + _c.Call.Return(run) + return _c +} + +// NewNodeInterfaceInterface creates a new instance of NodeInterfaceInterface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewNodeInterfaceInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *NodeInterfaceInterface { + mock := &NodeInterfaceInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/core/gethwrappers/liquiditymanager/mocks/mock_optimism_dispute_game_factory/optimism_dispute_game_factory_interface.go b/core/gethwrappers/liquiditymanager/mocks/mock_optimism_dispute_game_factory/optimism_dispute_game_factory_interface.go new file mode 100644 index 00000000000..3f0b69f1a08 --- /dev/null +++ b/core/gethwrappers/liquiditymanager/mocks/mock_optimism_dispute_game_factory/optimism_dispute_game_factory_interface.go @@ -0,0 +1,207 @@ +// Code generated by mockery v2.43.2. DO NOT EDIT. + +package mock_optimism_dispute_game_factory + +import ( + big "math/big" + + bind "github.com/ethereum/go-ethereum/accounts/abi/bind" + common "github.com/ethereum/go-ethereum/common" + + mock "github.com/stretchr/testify/mock" + + optimism_dispute_game_factory "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/liquiditymanager/generated/optimism_dispute_game_factory" +) + +// OptimismDisputeGameFactoryInterface is an autogenerated mock type for the OptimismDisputeGameFactoryInterface type +type OptimismDisputeGameFactoryInterface struct { + mock.Mock +} + +type OptimismDisputeGameFactoryInterface_Expecter struct { + mock *mock.Mock +} + +func (_m *OptimismDisputeGameFactoryInterface) EXPECT() *OptimismDisputeGameFactoryInterface_Expecter { + return &OptimismDisputeGameFactoryInterface_Expecter{mock: &_m.Mock} +} + +// Address provides a mock function with given fields: +func (_m *OptimismDisputeGameFactoryInterface) Address() common.Address { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Address") + } + + var r0 common.Address + if rf, ok := ret.Get(0).(func() common.Address); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Address) + } + } + + return r0 +} + +// OptimismDisputeGameFactoryInterface_Address_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Address' +type OptimismDisputeGameFactoryInterface_Address_Call struct { + *mock.Call +} + +// Address is a helper method to define mock.On call +func (_e *OptimismDisputeGameFactoryInterface_Expecter) Address() *OptimismDisputeGameFactoryInterface_Address_Call { + return &OptimismDisputeGameFactoryInterface_Address_Call{Call: _e.mock.On("Address")} +} + +func (_c *OptimismDisputeGameFactoryInterface_Address_Call) Run(run func()) *OptimismDisputeGameFactoryInterface_Address_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *OptimismDisputeGameFactoryInterface_Address_Call) Return(_a0 common.Address) *OptimismDisputeGameFactoryInterface_Address_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *OptimismDisputeGameFactoryInterface_Address_Call) RunAndReturn(run func() common.Address) *OptimismDisputeGameFactoryInterface_Address_Call { + _c.Call.Return(run) + return _c +} + +// FindLatestGames provides a mock function with given fields: opts, _gameType, _start, _n +func (_m *OptimismDisputeGameFactoryInterface) FindLatestGames(opts *bind.CallOpts, _gameType uint32, _start *big.Int, _n *big.Int) ([]optimism_dispute_game_factory.IOptimismDisputeGameFactoryGameSearchResult, error) { + ret := _m.Called(opts, _gameType, _start, _n) + + if len(ret) == 0 { + panic("no return value specified for FindLatestGames") + } + + var r0 []optimism_dispute_game_factory.IOptimismDisputeGameFactoryGameSearchResult + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts, uint32, *big.Int, *big.Int) ([]optimism_dispute_game_factory.IOptimismDisputeGameFactoryGameSearchResult, error)); ok { + return rf(opts, _gameType, _start, _n) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts, uint32, *big.Int, *big.Int) []optimism_dispute_game_factory.IOptimismDisputeGameFactoryGameSearchResult); ok { + r0 = rf(opts, _gameType, _start, _n) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]optimism_dispute_game_factory.IOptimismDisputeGameFactoryGameSearchResult) + } + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts, uint32, *big.Int, *big.Int) error); ok { + r1 = rf(opts, _gameType, _start, _n) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// OptimismDisputeGameFactoryInterface_FindLatestGames_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindLatestGames' +type OptimismDisputeGameFactoryInterface_FindLatestGames_Call struct { + *mock.Call +} + +// FindLatestGames is a helper method to define mock.On call +// - opts *bind.CallOpts +// - _gameType uint32 +// - _start *big.Int +// - _n *big.Int +func (_e *OptimismDisputeGameFactoryInterface_Expecter) FindLatestGames(opts interface{}, _gameType interface{}, _start interface{}, _n interface{}) *OptimismDisputeGameFactoryInterface_FindLatestGames_Call { + return &OptimismDisputeGameFactoryInterface_FindLatestGames_Call{Call: _e.mock.On("FindLatestGames", opts, _gameType, _start, _n)} +} + +func (_c *OptimismDisputeGameFactoryInterface_FindLatestGames_Call) Run(run func(opts *bind.CallOpts, _gameType uint32, _start *big.Int, _n *big.Int)) *OptimismDisputeGameFactoryInterface_FindLatestGames_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts), args[1].(uint32), args[2].(*big.Int), args[3].(*big.Int)) + }) + return _c +} + +func (_c *OptimismDisputeGameFactoryInterface_FindLatestGames_Call) Return(_a0 []optimism_dispute_game_factory.IOptimismDisputeGameFactoryGameSearchResult, _a1 error) *OptimismDisputeGameFactoryInterface_FindLatestGames_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *OptimismDisputeGameFactoryInterface_FindLatestGames_Call) RunAndReturn(run func(*bind.CallOpts, uint32, *big.Int, *big.Int) ([]optimism_dispute_game_factory.IOptimismDisputeGameFactoryGameSearchResult, error)) *OptimismDisputeGameFactoryInterface_FindLatestGames_Call { + _c.Call.Return(run) + return _c +} + +// GameCount provides a mock function with given fields: opts +func (_m *OptimismDisputeGameFactoryInterface) GameCount(opts *bind.CallOpts) (*big.Int, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for GameCount") + } + + var r0 *big.Int + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts) (*big.Int, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts) *big.Int); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*big.Int) + } + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// OptimismDisputeGameFactoryInterface_GameCount_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GameCount' +type OptimismDisputeGameFactoryInterface_GameCount_Call struct { + *mock.Call +} + +// GameCount is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *OptimismDisputeGameFactoryInterface_Expecter) GameCount(opts interface{}) *OptimismDisputeGameFactoryInterface_GameCount_Call { + return &OptimismDisputeGameFactoryInterface_GameCount_Call{Call: _e.mock.On("GameCount", opts)} +} + +func (_c *OptimismDisputeGameFactoryInterface_GameCount_Call) Run(run func(opts *bind.CallOpts)) *OptimismDisputeGameFactoryInterface_GameCount_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *OptimismDisputeGameFactoryInterface_GameCount_Call) Return(_a0 *big.Int, _a1 error) *OptimismDisputeGameFactoryInterface_GameCount_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *OptimismDisputeGameFactoryInterface_GameCount_Call) RunAndReturn(run func(*bind.CallOpts) (*big.Int, error)) *OptimismDisputeGameFactoryInterface_GameCount_Call { + _c.Call.Return(run) + return _c +} + +// NewOptimismDisputeGameFactoryInterface creates a new instance of OptimismDisputeGameFactoryInterface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewOptimismDisputeGameFactoryInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *OptimismDisputeGameFactoryInterface { + mock := &OptimismDisputeGameFactoryInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/core/gethwrappers/liquiditymanager/mocks/mock_optimism_l2_output_oracle/optimism_l2_output_oracle_interface.go b/core/gethwrappers/liquiditymanager/mocks/mock_optimism_l2_output_oracle/optimism_l2_output_oracle_interface.go new file mode 100644 index 00000000000..f93bee3bf59 --- /dev/null +++ b/core/gethwrappers/liquiditymanager/mocks/mock_optimism_l2_output_oracle/optimism_l2_output_oracle_interface.go @@ -0,0 +1,204 @@ +// Code generated by mockery v2.43.2. DO NOT EDIT. + +package mock_optimism_l2_output_oracle + +import ( + big "math/big" + + bind "github.com/ethereum/go-ethereum/accounts/abi/bind" + common "github.com/ethereum/go-ethereum/common" + + mock "github.com/stretchr/testify/mock" + + optimism_l2_output_oracle "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/liquiditymanager/generated/optimism_l2_output_oracle" +) + +// OptimismL2OutputOracleInterface is an autogenerated mock type for the OptimismL2OutputOracleInterface type +type OptimismL2OutputOracleInterface struct { + mock.Mock +} + +type OptimismL2OutputOracleInterface_Expecter struct { + mock *mock.Mock +} + +func (_m *OptimismL2OutputOracleInterface) EXPECT() *OptimismL2OutputOracleInterface_Expecter { + return &OptimismL2OutputOracleInterface_Expecter{mock: &_m.Mock} +} + +// Address provides a mock function with given fields: +func (_m *OptimismL2OutputOracleInterface) Address() common.Address { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Address") + } + + var r0 common.Address + if rf, ok := ret.Get(0).(func() common.Address); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Address) + } + } + + return r0 +} + +// OptimismL2OutputOracleInterface_Address_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Address' +type OptimismL2OutputOracleInterface_Address_Call struct { + *mock.Call +} + +// Address is a helper method to define mock.On call +func (_e *OptimismL2OutputOracleInterface_Expecter) Address() *OptimismL2OutputOracleInterface_Address_Call { + return &OptimismL2OutputOracleInterface_Address_Call{Call: _e.mock.On("Address")} +} + +func (_c *OptimismL2OutputOracleInterface_Address_Call) Run(run func()) *OptimismL2OutputOracleInterface_Address_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *OptimismL2OutputOracleInterface_Address_Call) Return(_a0 common.Address) *OptimismL2OutputOracleInterface_Address_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *OptimismL2OutputOracleInterface_Address_Call) RunAndReturn(run func() common.Address) *OptimismL2OutputOracleInterface_Address_Call { + _c.Call.Return(run) + return _c +} + +// GetL2Output provides a mock function with given fields: opts, _l2OutputIndex +func (_m *OptimismL2OutputOracleInterface) GetL2Output(opts *bind.CallOpts, _l2OutputIndex *big.Int) (optimism_l2_output_oracle.TypesOutputProposal, error) { + ret := _m.Called(opts, _l2OutputIndex) + + if len(ret) == 0 { + panic("no return value specified for GetL2Output") + } + + var r0 optimism_l2_output_oracle.TypesOutputProposal + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts, *big.Int) (optimism_l2_output_oracle.TypesOutputProposal, error)); ok { + return rf(opts, _l2OutputIndex) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts, *big.Int) optimism_l2_output_oracle.TypesOutputProposal); ok { + r0 = rf(opts, _l2OutputIndex) + } else { + r0 = ret.Get(0).(optimism_l2_output_oracle.TypesOutputProposal) + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts, *big.Int) error); ok { + r1 = rf(opts, _l2OutputIndex) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// OptimismL2OutputOracleInterface_GetL2Output_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetL2Output' +type OptimismL2OutputOracleInterface_GetL2Output_Call struct { + *mock.Call +} + +// GetL2Output is a helper method to define mock.On call +// - opts *bind.CallOpts +// - _l2OutputIndex *big.Int +func (_e *OptimismL2OutputOracleInterface_Expecter) GetL2Output(opts interface{}, _l2OutputIndex interface{}) *OptimismL2OutputOracleInterface_GetL2Output_Call { + return &OptimismL2OutputOracleInterface_GetL2Output_Call{Call: _e.mock.On("GetL2Output", opts, _l2OutputIndex)} +} + +func (_c *OptimismL2OutputOracleInterface_GetL2Output_Call) Run(run func(opts *bind.CallOpts, _l2OutputIndex *big.Int)) *OptimismL2OutputOracleInterface_GetL2Output_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts), args[1].(*big.Int)) + }) + return _c +} + +func (_c *OptimismL2OutputOracleInterface_GetL2Output_Call) Return(_a0 optimism_l2_output_oracle.TypesOutputProposal, _a1 error) *OptimismL2OutputOracleInterface_GetL2Output_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *OptimismL2OutputOracleInterface_GetL2Output_Call) RunAndReturn(run func(*bind.CallOpts, *big.Int) (optimism_l2_output_oracle.TypesOutputProposal, error)) *OptimismL2OutputOracleInterface_GetL2Output_Call { + _c.Call.Return(run) + return _c +} + +// GetL2OutputIndexAfter provides a mock function with given fields: opts, _l2BlockNumber +func (_m *OptimismL2OutputOracleInterface) GetL2OutputIndexAfter(opts *bind.CallOpts, _l2BlockNumber *big.Int) (*big.Int, error) { + ret := _m.Called(opts, _l2BlockNumber) + + if len(ret) == 0 { + panic("no return value specified for GetL2OutputIndexAfter") + } + + var r0 *big.Int + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts, *big.Int) (*big.Int, error)); ok { + return rf(opts, _l2BlockNumber) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts, *big.Int) *big.Int); ok { + r0 = rf(opts, _l2BlockNumber) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*big.Int) + } + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts, *big.Int) error); ok { + r1 = rf(opts, _l2BlockNumber) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// OptimismL2OutputOracleInterface_GetL2OutputIndexAfter_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetL2OutputIndexAfter' +type OptimismL2OutputOracleInterface_GetL2OutputIndexAfter_Call struct { + *mock.Call +} + +// GetL2OutputIndexAfter is a helper method to define mock.On call +// - opts *bind.CallOpts +// - _l2BlockNumber *big.Int +func (_e *OptimismL2OutputOracleInterface_Expecter) GetL2OutputIndexAfter(opts interface{}, _l2BlockNumber interface{}) *OptimismL2OutputOracleInterface_GetL2OutputIndexAfter_Call { + return &OptimismL2OutputOracleInterface_GetL2OutputIndexAfter_Call{Call: _e.mock.On("GetL2OutputIndexAfter", opts, _l2BlockNumber)} +} + +func (_c *OptimismL2OutputOracleInterface_GetL2OutputIndexAfter_Call) Run(run func(opts *bind.CallOpts, _l2BlockNumber *big.Int)) *OptimismL2OutputOracleInterface_GetL2OutputIndexAfter_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts), args[1].(*big.Int)) + }) + return _c +} + +func (_c *OptimismL2OutputOracleInterface_GetL2OutputIndexAfter_Call) Return(_a0 *big.Int, _a1 error) *OptimismL2OutputOracleInterface_GetL2OutputIndexAfter_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *OptimismL2OutputOracleInterface_GetL2OutputIndexAfter_Call) RunAndReturn(run func(*bind.CallOpts, *big.Int) (*big.Int, error)) *OptimismL2OutputOracleInterface_GetL2OutputIndexAfter_Call { + _c.Call.Return(run) + return _c +} + +// NewOptimismL2OutputOracleInterface creates a new instance of OptimismL2OutputOracleInterface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewOptimismL2OutputOracleInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *OptimismL2OutputOracleInterface { + mock := &OptimismL2OutputOracleInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/core/gethwrappers/liquiditymanager/mocks/mock_optimism_portal/optimism_portal_interface.go b/core/gethwrappers/liquiditymanager/mocks/mock_optimism_portal/optimism_portal_interface.go new file mode 100644 index 00000000000..eede00e7d9a --- /dev/null +++ b/core/gethwrappers/liquiditymanager/mocks/mock_optimism_portal/optimism_portal_interface.go @@ -0,0 +1,267 @@ +// Code generated by mockery v2.43.2. DO NOT EDIT. + +package mock_optimism_portal + +import ( + big "math/big" + + bind "github.com/ethereum/go-ethereum/accounts/abi/bind" + common "github.com/ethereum/go-ethereum/common" + + mock "github.com/stretchr/testify/mock" + + optimism_portal "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/liquiditymanager/generated/optimism_portal" + + types "github.com/ethereum/go-ethereum/core/types" +) + +// OptimismPortalInterface is an autogenerated mock type for the OptimismPortalInterface type +type OptimismPortalInterface struct { + mock.Mock +} + +type OptimismPortalInterface_Expecter struct { + mock *mock.Mock +} + +func (_m *OptimismPortalInterface) EXPECT() *OptimismPortalInterface_Expecter { + return &OptimismPortalInterface_Expecter{mock: &_m.Mock} +} + +// Address provides a mock function with given fields: +func (_m *OptimismPortalInterface) Address() common.Address { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Address") + } + + var r0 common.Address + if rf, ok := ret.Get(0).(func() common.Address); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Address) + } + } + + return r0 +} + +// OptimismPortalInterface_Address_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Address' +type OptimismPortalInterface_Address_Call struct { + *mock.Call +} + +// Address is a helper method to define mock.On call +func (_e *OptimismPortalInterface_Expecter) Address() *OptimismPortalInterface_Address_Call { + return &OptimismPortalInterface_Address_Call{Call: _e.mock.On("Address")} +} + +func (_c *OptimismPortalInterface_Address_Call) Run(run func()) *OptimismPortalInterface_Address_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *OptimismPortalInterface_Address_Call) Return(_a0 common.Address) *OptimismPortalInterface_Address_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *OptimismPortalInterface_Address_Call) RunAndReturn(run func() common.Address) *OptimismPortalInterface_Address_Call { + _c.Call.Return(run) + return _c +} + +// FinalizeWithdrawalTransaction provides a mock function with given fields: opts, _tx +func (_m *OptimismPortalInterface) FinalizeWithdrawalTransaction(opts *bind.TransactOpts, _tx optimism_portal.TypesWithdrawalTransaction) (*types.Transaction, error) { + ret := _m.Called(opts, _tx) + + if len(ret) == 0 { + panic("no return value specified for FinalizeWithdrawalTransaction") + } + + var r0 *types.Transaction + var r1 error + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, optimism_portal.TypesWithdrawalTransaction) (*types.Transaction, error)); ok { + return rf(opts, _tx) + } + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, optimism_portal.TypesWithdrawalTransaction) *types.Transaction); ok { + r0 = rf(opts, _tx) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Transaction) + } + } + + if rf, ok := ret.Get(1).(func(*bind.TransactOpts, optimism_portal.TypesWithdrawalTransaction) error); ok { + r1 = rf(opts, _tx) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// OptimismPortalInterface_FinalizeWithdrawalTransaction_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FinalizeWithdrawalTransaction' +type OptimismPortalInterface_FinalizeWithdrawalTransaction_Call struct { + *mock.Call +} + +// FinalizeWithdrawalTransaction is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - _tx optimism_portal.TypesWithdrawalTransaction +func (_e *OptimismPortalInterface_Expecter) FinalizeWithdrawalTransaction(opts interface{}, _tx interface{}) *OptimismPortalInterface_FinalizeWithdrawalTransaction_Call { + return &OptimismPortalInterface_FinalizeWithdrawalTransaction_Call{Call: _e.mock.On("FinalizeWithdrawalTransaction", opts, _tx)} +} + +func (_c *OptimismPortalInterface_FinalizeWithdrawalTransaction_Call) Run(run func(opts *bind.TransactOpts, _tx optimism_portal.TypesWithdrawalTransaction)) *OptimismPortalInterface_FinalizeWithdrawalTransaction_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].(optimism_portal.TypesWithdrawalTransaction)) + }) + return _c +} + +func (_c *OptimismPortalInterface_FinalizeWithdrawalTransaction_Call) Return(_a0 *types.Transaction, _a1 error) *OptimismPortalInterface_FinalizeWithdrawalTransaction_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *OptimismPortalInterface_FinalizeWithdrawalTransaction_Call) RunAndReturn(run func(*bind.TransactOpts, optimism_portal.TypesWithdrawalTransaction) (*types.Transaction, error)) *OptimismPortalInterface_FinalizeWithdrawalTransaction_Call { + _c.Call.Return(run) + return _c +} + +// ProveWithdrawalTransaction provides a mock function with given fields: opts, _tx, _l2OutputIndex, _outputRootProof, _withdrawalProof +func (_m *OptimismPortalInterface) ProveWithdrawalTransaction(opts *bind.TransactOpts, _tx optimism_portal.TypesWithdrawalTransaction, _l2OutputIndex *big.Int, _outputRootProof optimism_portal.TypesOutputRootProof, _withdrawalProof [][]byte) (*types.Transaction, error) { + ret := _m.Called(opts, _tx, _l2OutputIndex, _outputRootProof, _withdrawalProof) + + if len(ret) == 0 { + panic("no return value specified for ProveWithdrawalTransaction") + } + + var r0 *types.Transaction + var r1 error + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, optimism_portal.TypesWithdrawalTransaction, *big.Int, optimism_portal.TypesOutputRootProof, [][]byte) (*types.Transaction, error)); ok { + return rf(opts, _tx, _l2OutputIndex, _outputRootProof, _withdrawalProof) + } + if rf, ok := ret.Get(0).(func(*bind.TransactOpts, optimism_portal.TypesWithdrawalTransaction, *big.Int, optimism_portal.TypesOutputRootProof, [][]byte) *types.Transaction); ok { + r0 = rf(opts, _tx, _l2OutputIndex, _outputRootProof, _withdrawalProof) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Transaction) + } + } + + if rf, ok := ret.Get(1).(func(*bind.TransactOpts, optimism_portal.TypesWithdrawalTransaction, *big.Int, optimism_portal.TypesOutputRootProof, [][]byte) error); ok { + r1 = rf(opts, _tx, _l2OutputIndex, _outputRootProof, _withdrawalProof) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// OptimismPortalInterface_ProveWithdrawalTransaction_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ProveWithdrawalTransaction' +type OptimismPortalInterface_ProveWithdrawalTransaction_Call struct { + *mock.Call +} + +// ProveWithdrawalTransaction is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - _tx optimism_portal.TypesWithdrawalTransaction +// - _l2OutputIndex *big.Int +// - _outputRootProof optimism_portal.TypesOutputRootProof +// - _withdrawalProof [][]byte +func (_e *OptimismPortalInterface_Expecter) ProveWithdrawalTransaction(opts interface{}, _tx interface{}, _l2OutputIndex interface{}, _outputRootProof interface{}, _withdrawalProof interface{}) *OptimismPortalInterface_ProveWithdrawalTransaction_Call { + return &OptimismPortalInterface_ProveWithdrawalTransaction_Call{Call: _e.mock.On("ProveWithdrawalTransaction", opts, _tx, _l2OutputIndex, _outputRootProof, _withdrawalProof)} +} + +func (_c *OptimismPortalInterface_ProveWithdrawalTransaction_Call) Run(run func(opts *bind.TransactOpts, _tx optimism_portal.TypesWithdrawalTransaction, _l2OutputIndex *big.Int, _outputRootProof optimism_portal.TypesOutputRootProof, _withdrawalProof [][]byte)) *OptimismPortalInterface_ProveWithdrawalTransaction_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].(optimism_portal.TypesWithdrawalTransaction), args[2].(*big.Int), args[3].(optimism_portal.TypesOutputRootProof), args[4].([][]byte)) + }) + return _c +} + +func (_c *OptimismPortalInterface_ProveWithdrawalTransaction_Call) Return(_a0 *types.Transaction, _a1 error) *OptimismPortalInterface_ProveWithdrawalTransaction_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *OptimismPortalInterface_ProveWithdrawalTransaction_Call) RunAndReturn(run func(*bind.TransactOpts, optimism_portal.TypesWithdrawalTransaction, *big.Int, optimism_portal.TypesOutputRootProof, [][]byte) (*types.Transaction, error)) *OptimismPortalInterface_ProveWithdrawalTransaction_Call { + _c.Call.Return(run) + return _c +} + +// Version provides a mock function with given fields: opts +func (_m *OptimismPortalInterface) Version(opts *bind.CallOpts) (string, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for Version") + } + + var r0 string + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts) (string, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts) string); ok { + r0 = rf(opts) + } else { + r0 = ret.Get(0).(string) + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// OptimismPortalInterface_Version_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Version' +type OptimismPortalInterface_Version_Call struct { + *mock.Call +} + +// Version is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *OptimismPortalInterface_Expecter) Version(opts interface{}) *OptimismPortalInterface_Version_Call { + return &OptimismPortalInterface_Version_Call{Call: _e.mock.On("Version", opts)} +} + +func (_c *OptimismPortalInterface_Version_Call) Run(run func(opts *bind.CallOpts)) *OptimismPortalInterface_Version_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *OptimismPortalInterface_Version_Call) Return(_a0 string, _a1 error) *OptimismPortalInterface_Version_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *OptimismPortalInterface_Version_Call) RunAndReturn(run func(*bind.CallOpts) (string, error)) *OptimismPortalInterface_Version_Call { + _c.Call.Return(run) + return _c +} + +// NewOptimismPortalInterface creates a new instance of OptimismPortalInterface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewOptimismPortalInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *OptimismPortalInterface { + mock := &OptimismPortalInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/core/gethwrappers/liquiditymanager/mocks/mock_optimism_portal_2/optimism_portal2_interface.go b/core/gethwrappers/liquiditymanager/mocks/mock_optimism_portal_2/optimism_portal2_interface.go new file mode 100644 index 00000000000..e3d1312120f --- /dev/null +++ b/core/gethwrappers/liquiditymanager/mocks/mock_optimism_portal_2/optimism_portal2_interface.go @@ -0,0 +1,198 @@ +// Code generated by mockery v2.43.2. DO NOT EDIT. + +package mock_optimism_portal_2 + +import ( + bind "github.com/ethereum/go-ethereum/accounts/abi/bind" + common "github.com/ethereum/go-ethereum/common" + + mock "github.com/stretchr/testify/mock" +) + +// OptimismPortal2Interface is an autogenerated mock type for the OptimismPortal2Interface type +type OptimismPortal2Interface struct { + mock.Mock +} + +type OptimismPortal2Interface_Expecter struct { + mock *mock.Mock +} + +func (_m *OptimismPortal2Interface) EXPECT() *OptimismPortal2Interface_Expecter { + return &OptimismPortal2Interface_Expecter{mock: &_m.Mock} +} + +// Address provides a mock function with given fields: +func (_m *OptimismPortal2Interface) Address() common.Address { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Address") + } + + var r0 common.Address + if rf, ok := ret.Get(0).(func() common.Address); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Address) + } + } + + return r0 +} + +// OptimismPortal2Interface_Address_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Address' +type OptimismPortal2Interface_Address_Call struct { + *mock.Call +} + +// Address is a helper method to define mock.On call +func (_e *OptimismPortal2Interface_Expecter) Address() *OptimismPortal2Interface_Address_Call { + return &OptimismPortal2Interface_Address_Call{Call: _e.mock.On("Address")} +} + +func (_c *OptimismPortal2Interface_Address_Call) Run(run func()) *OptimismPortal2Interface_Address_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *OptimismPortal2Interface_Address_Call) Return(_a0 common.Address) *OptimismPortal2Interface_Address_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *OptimismPortal2Interface_Address_Call) RunAndReturn(run func() common.Address) *OptimismPortal2Interface_Address_Call { + _c.Call.Return(run) + return _c +} + +// DisputeGameFactory provides a mock function with given fields: opts +func (_m *OptimismPortal2Interface) DisputeGameFactory(opts *bind.CallOpts) (common.Address, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for DisputeGameFactory") + } + + var r0 common.Address + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts) (common.Address, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts) common.Address); ok { + r0 = rf(opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Address) + } + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// OptimismPortal2Interface_DisputeGameFactory_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DisputeGameFactory' +type OptimismPortal2Interface_DisputeGameFactory_Call struct { + *mock.Call +} + +// DisputeGameFactory is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *OptimismPortal2Interface_Expecter) DisputeGameFactory(opts interface{}) *OptimismPortal2Interface_DisputeGameFactory_Call { + return &OptimismPortal2Interface_DisputeGameFactory_Call{Call: _e.mock.On("DisputeGameFactory", opts)} +} + +func (_c *OptimismPortal2Interface_DisputeGameFactory_Call) Run(run func(opts *bind.CallOpts)) *OptimismPortal2Interface_DisputeGameFactory_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *OptimismPortal2Interface_DisputeGameFactory_Call) Return(_a0 common.Address, _a1 error) *OptimismPortal2Interface_DisputeGameFactory_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *OptimismPortal2Interface_DisputeGameFactory_Call) RunAndReturn(run func(*bind.CallOpts) (common.Address, error)) *OptimismPortal2Interface_DisputeGameFactory_Call { + _c.Call.Return(run) + return _c +} + +// RespectedGameType provides a mock function with given fields: opts +func (_m *OptimismPortal2Interface) RespectedGameType(opts *bind.CallOpts) (uint32, error) { + ret := _m.Called(opts) + + if len(ret) == 0 { + panic("no return value specified for RespectedGameType") + } + + var r0 uint32 + var r1 error + if rf, ok := ret.Get(0).(func(*bind.CallOpts) (uint32, error)); ok { + return rf(opts) + } + if rf, ok := ret.Get(0).(func(*bind.CallOpts) uint32); ok { + r0 = rf(opts) + } else { + r0 = ret.Get(0).(uint32) + } + + if rf, ok := ret.Get(1).(func(*bind.CallOpts) error); ok { + r1 = rf(opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// OptimismPortal2Interface_RespectedGameType_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RespectedGameType' +type OptimismPortal2Interface_RespectedGameType_Call struct { + *mock.Call +} + +// RespectedGameType is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *OptimismPortal2Interface_Expecter) RespectedGameType(opts interface{}) *OptimismPortal2Interface_RespectedGameType_Call { + return &OptimismPortal2Interface_RespectedGameType_Call{Call: _e.mock.On("RespectedGameType", opts)} +} + +func (_c *OptimismPortal2Interface_RespectedGameType_Call) Run(run func(opts *bind.CallOpts)) *OptimismPortal2Interface_RespectedGameType_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *OptimismPortal2Interface_RespectedGameType_Call) Return(_a0 uint32, _a1 error) *OptimismPortal2Interface_RespectedGameType_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *OptimismPortal2Interface_RespectedGameType_Call) RunAndReturn(run func(*bind.CallOpts) (uint32, error)) *OptimismPortal2Interface_RespectedGameType_Call { + _c.Call.Return(run) + return _c +} + +// NewOptimismPortal2Interface creates a new instance of OptimismPortal2Interface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewOptimismPortal2Interface(t interface { + mock.TestingT + Cleanup(func()) +}) *OptimismPortal2Interface { + mock := &OptimismPortal2Interface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/core/gethwrappers/llo-feeds/generated/channel_config_store/channel_config_store.go b/core/gethwrappers/llo-feeds/generated/channel_config_store/channel_config_store.go index 3c67b642273..7dd4407b3a3 100644 --- a/core/gethwrappers/llo-feeds/generated/channel_config_store/channel_config_store.go +++ b/core/gethwrappers/llo-feeds/generated/channel_config_store/channel_config_store.go @@ -30,15 +30,9 @@ var ( _ = abi.ConvertType ) -type IChannelConfigStoreChannelDefinition struct { - ReportFormat uint32 - ChainSelector uint64 - StreamIDs []uint32 -} - var ChannelConfigStoreMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"ChannelDefinitionNotFound\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"EmptyStreamIDs\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCallableByEOA\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"StagingConfigAlreadyPromoted\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroChainSelector\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroReportFormat\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"channelId\",\"type\":\"uint32\"}],\"name\":\"ChannelDefinitionRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"channelId\",\"type\":\"uint32\"},{\"components\":[{\"internalType\":\"uint32\",\"name\":\"reportFormat\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint32[]\",\"name\":\"streamIDs\",\"type\":\"uint32[]\"}],\"indexed\":false,\"internalType\":\"structIChannelConfigStore.ChannelDefinition\",\"name\":\"channelDefinition\",\"type\":\"tuple\"}],\"name\":\"NewChannelDefinition\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"channelId\",\"type\":\"uint32\"}],\"name\":\"PromoteStagingConfig\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"channelId\",\"type\":\"uint32\"},{\"components\":[{\"internalType\":\"uint32\",\"name\":\"reportFormat\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint32[]\",\"name\":\"streamIDs\",\"type\":\"uint32[]\"}],\"internalType\":\"structIChannelConfigStore.ChannelDefinition\",\"name\":\"channelDefinition\",\"type\":\"tuple\"}],\"name\":\"addChannel\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"channelId\",\"type\":\"uint32\"}],\"name\":\"getChannelDefinitions\",\"outputs\":[{\"components\":[{\"internalType\":\"uint32\",\"name\":\"reportFormat\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint32[]\",\"name\":\"streamIDs\",\"type\":\"uint32[]\"}],\"internalType\":\"structIChannelConfigStore.ChannelDefinition\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"channelId\",\"type\":\"uint32\"}],\"name\":\"removeChannel\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"pure\",\"type\":\"function\"}]", - Bin: "0x608060405234801561001057600080fd5b5033806000816100675760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615610097576100978161009f565b505050610148565b336001600160a01b038216036100f75760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640161005e565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b610e4f806101576000396000f3fe608060405234801561001057600080fd5b50600436106100885760003560e01c80638da5cb5b1161005b5780638da5cb5b146101535780639682a4501461017b578063f2fde38b1461018e578063f5810719146101a157600080fd5b806301ffc9a71461008d578063181f5a77146100f757806379ba5097146101365780637e37e71914610140575b600080fd5b6100e261009b3660046107d1565b7fffffffff00000000000000000000000000000000000000000000000000000000167f1d344450000000000000000000000000000000000000000000000000000000001490565b60405190151581526020015b60405180910390f35b604080518082018252601881527f4368616e6e656c436f6e66696753746f726520302e302e300000000000000000602082015290516100ee919061081a565b61013e6101c1565b005b61013e61014e366004610898565b6102c3565b60005460405173ffffffffffffffffffffffffffffffffffffffff90911681526020016100ee565b61013e6101893660046108b5565b6103a3565b61013e61019c36600461090c565b6104f3565b6101b46101af366004610898565b610507565b6040516100ee9190610942565b60015473ffffffffffffffffffffffffffffffffffffffff163314610247576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e65720000000000000000000060448201526064015b60405180910390fd5b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b6102cb610620565b63ffffffff8116600090815260026020526040812060010154900361031c576040517fd1a751e200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b63ffffffff8116600090815260026020526040812080547fffffffffffffffffffffffffffffffffffffffff000000000000000000000000168155906103656001830182610798565b505060405163ffffffff821681527f334e877e9691ecae0660510061973bebaa8b4fb37332ed6090052e630c9798619060200160405180910390a150565b6103ab610620565b6103b860408201826109bc565b90506000036103f3576040517f4b620e2400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6104036040820160208301610a41565b67ffffffffffffffff16600003610446576040517ff89d762900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6104536020820182610898565b63ffffffff16600003610492576040517febd3ef0200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b63ffffffff8216600090815260026020526040902081906104b38282610c37565b9050507f35d63e43dd8abd374a4c4e0b5b02c8294dd20e1f493e7344a1751123d11ecc1482826040516104e7929190610d7f565b60405180910390a15050565b6104fb610620565b610504816106a3565b50565b6040805160608082018352600080835260208301529181019190915233321461055c576040517f74e2cd5100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b63ffffffff82811660009081526002602090815260409182902082516060810184528154948516815264010000000090940467ffffffffffffffff16848301526001810180548451818502810185018652818152929486019383018282801561061057602002820191906000526020600020906000905b82829054906101000a900463ffffffff1663ffffffff16815260200190600401906020826003010492830192600103820291508084116105d35790505b5050505050815250509050919050565b60005473ffffffffffffffffffffffffffffffffffffffff1633146106a1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e657200000000000000000000604482015260640161023e565b565b3373ffffffffffffffffffffffffffffffffffffffff821603610722576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640161023e565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b50805460008255600701600890049060005260206000209081019061050491905b808211156107cd57600081556001016107b9565b5090565b6000602082840312156107e357600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461081357600080fd5b9392505050565b600060208083528351808285015260005b818110156108475785810183015185820160400152820161082b565b5060006040828601015260407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8301168501019250505092915050565b63ffffffff8116811461050457600080fd5b6000602082840312156108aa57600080fd5b813561081381610886565b600080604083850312156108c857600080fd5b82356108d381610886565b9150602083013567ffffffffffffffff8111156108ef57600080fd5b83016060818603121561090157600080fd5b809150509250929050565b60006020828403121561091e57600080fd5b813573ffffffffffffffffffffffffffffffffffffffff8116811461081357600080fd5b600060208083526080830163ffffffff808651168386015267ffffffffffffffff83870151166040860152604086015160608087015282815180855260a0880191508583019450600092505b808310156109b05784518416825293850193600192909201919085019061098e565b50979650505050505050565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe18436030181126109f157600080fd5b83018035915067ffffffffffffffff821115610a0c57600080fd5b6020019150600581901b3603821315610a2457600080fd5b9250929050565b67ffffffffffffffff8116811461050457600080fd5b600060208284031215610a5357600080fd5b813561081381610a2b565b60008135610a6b81610886565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b68010000000000000000821115610ab957610ab9610a71565b805482825580831015610b3e576000828152602081206007850160031c81016007840160031c82019150601c8660021b168015610b25577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8083018054828460200360031b1c16815550505b505b81811015610b3a57828155600101610b27565b5050505b505050565b67ffffffffffffffff831115610b5b57610b5b610a71565b610b658382610aa0565b60008181526020902082908460031c60005b81811015610bd0576000805b6008811015610bc357610bb2610b9887610a5e565b63ffffffff908116600584901b90811b91901b1984161790565b602096909601959150600101610b83565b5083820155600101610b77565b507ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff88616808703818814610c2d576000805b82811015610c2757610c16610b9888610a5e565b602097909701969150600101610c02565b50848401555b5050505050505050565b8135610c4281610886565b63ffffffff811690508154817fffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000000082161783556020840135610c8281610a2b565b6bffffffffffffffff000000008160201b16837fffffffffffffffffffffffffffffffffffffffff00000000000000000000000084161717845550505060408201357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1833603018112610cf457600080fd5b8201803567ffffffffffffffff811115610d0d57600080fd5b6020820191508060051b3603821315610d2557600080fd5b610d33818360018601610b43565b50505050565b8183526000602080850194508260005b85811015610d74578135610d5c81610886565b63ffffffff1687529582019590820190600101610d49565b509495945050505050565b600063ffffffff8085168352604060208401528335610d9d81610886565b1660408301526020830135610db181610a2b565b67ffffffffffffffff8082166060850152604085013591507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1853603018212610df957600080fd5b6020918501918201913581811115610e1057600080fd5b8060051b3603831315610e2257600080fd5b60606080860152610e3760a086018285610d39565b97965050505050505056fea164736f6c6343000813000a", + ABI: "[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"donId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"version\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"url\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"sha\",\"type\":\"bytes32\"}],\"name\":\"NewChannelDefinition\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"donId\",\"type\":\"uint32\"},{\"internalType\":\"string\",\"name\":\"url\",\"type\":\"string\"},{\"internalType\":\"bytes32\",\"name\":\"sha\",\"type\":\"bytes32\"}],\"name\":\"setChannelDefinitions\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"pure\",\"type\":\"function\"}]", + Bin: "0x608060405234801561001057600080fd5b5033806000816100675760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615610097576100978161009f565b505050610148565b336001600160a01b038216036100f75760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640161005e565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b6106d2806101576000396000f3fe608060405234801561001057600080fd5b50600436106100725760003560e01c806379ba50971161005057806379ba5097146101355780638da5cb5b1461013d578063f2fde38b1461016557600080fd5b806301ffc9a714610077578063181f5a77146100e15780635ba5bac214610120575b600080fd5b6100cc610085366004610483565b7fffffffff00000000000000000000000000000000000000000000000000000000167f5ba5bac2000000000000000000000000000000000000000000000000000000001490565b60405190151581526020015b60405180910390f35b604080518082018252601881527f4368616e6e656c436f6e66696753746f726520302e302e310000000000000000602082015290516100d891906104cc565b61013361012e366004610538565b610178565b005b6101336101f5565b60005460405173ffffffffffffffffffffffffffffffffffffffff90911681526020016100d8565b6101336101733660046105cc565b6102f7565b61018061030b565b63ffffffff84166000908152600260205260408120805482906101a290610602565b91905081905590508463ffffffff167fe5b641a7879fb491e4e5a35a1ce950f0237b2537ee9b1b1e4fb65e29aff1f5e8828686866040516101e69493929190610661565b60405180910390a25050505050565b60015473ffffffffffffffffffffffffffffffffffffffff16331461027b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e65720000000000000000000060448201526064015b60405180910390fd5b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b6102ff61030b565b6103088161038e565b50565b60005473ffffffffffffffffffffffffffffffffffffffff16331461038c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e6572000000000000000000006044820152606401610272565b565b3373ffffffffffffffffffffffffffffffffffffffff82160361040d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c660000000000000000006044820152606401610272565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b60006020828403121561049557600080fd5b81357fffffffff00000000000000000000000000000000000000000000000000000000811681146104c557600080fd5b9392505050565b600060208083528351808285015260005b818110156104f9578581018301518582016040015282016104dd565b5060006040828601015260407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8301168501019250505092915050565b6000806000806060858703121561054e57600080fd5b843563ffffffff8116811461056257600080fd5b9350602085013567ffffffffffffffff8082111561057f57600080fd5b818701915087601f83011261059357600080fd5b8135818111156105a257600080fd5b8860208285010111156105b457600080fd5b95986020929092019750949560400135945092505050565b6000602082840312156105de57600080fd5b813573ffffffffffffffffffffffffffffffffffffffff811681146104c557600080fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361065a577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b5060010190565b63ffffffff851681526060602082015282606082015282846080830137600060808483010152600060807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f86011683010190508260408301529594505050505056fea164736f6c6343000813000a", } var ChannelConfigStoreABI = ChannelConfigStoreMetaData.ABI @@ -177,28 +171,6 @@ func (_ChannelConfigStore *ChannelConfigStoreTransactorRaw) Transact(opts *bind. return _ChannelConfigStore.Contract.contract.Transact(opts, method, params...) } -func (_ChannelConfigStore *ChannelConfigStoreCaller) GetChannelDefinitions(opts *bind.CallOpts, channelId uint32) (IChannelConfigStoreChannelDefinition, error) { - var out []interface{} - err := _ChannelConfigStore.contract.Call(opts, &out, "getChannelDefinitions", channelId) - - if err != nil { - return *new(IChannelConfigStoreChannelDefinition), err - } - - out0 := *abi.ConvertType(out[0], new(IChannelConfigStoreChannelDefinition)).(*IChannelConfigStoreChannelDefinition) - - return out0, err - -} - -func (_ChannelConfigStore *ChannelConfigStoreSession) GetChannelDefinitions(channelId uint32) (IChannelConfigStoreChannelDefinition, error) { - return _ChannelConfigStore.Contract.GetChannelDefinitions(&_ChannelConfigStore.CallOpts, channelId) -} - -func (_ChannelConfigStore *ChannelConfigStoreCallerSession) GetChannelDefinitions(channelId uint32) (IChannelConfigStoreChannelDefinition, error) { - return _ChannelConfigStore.Contract.GetChannelDefinitions(&_ChannelConfigStore.CallOpts, channelId) -} - func (_ChannelConfigStore *ChannelConfigStoreCaller) Owner(opts *bind.CallOpts) (common.Address, error) { var out []interface{} err := _ChannelConfigStore.contract.Call(opts, &out, "owner") @@ -277,28 +249,16 @@ func (_ChannelConfigStore *ChannelConfigStoreTransactorSession) AcceptOwnership( return _ChannelConfigStore.Contract.AcceptOwnership(&_ChannelConfigStore.TransactOpts) } -func (_ChannelConfigStore *ChannelConfigStoreTransactor) AddChannel(opts *bind.TransactOpts, channelId uint32, channelDefinition IChannelConfigStoreChannelDefinition) (*types.Transaction, error) { - return _ChannelConfigStore.contract.Transact(opts, "addChannel", channelId, channelDefinition) -} - -func (_ChannelConfigStore *ChannelConfigStoreSession) AddChannel(channelId uint32, channelDefinition IChannelConfigStoreChannelDefinition) (*types.Transaction, error) { - return _ChannelConfigStore.Contract.AddChannel(&_ChannelConfigStore.TransactOpts, channelId, channelDefinition) -} - -func (_ChannelConfigStore *ChannelConfigStoreTransactorSession) AddChannel(channelId uint32, channelDefinition IChannelConfigStoreChannelDefinition) (*types.Transaction, error) { - return _ChannelConfigStore.Contract.AddChannel(&_ChannelConfigStore.TransactOpts, channelId, channelDefinition) -} - -func (_ChannelConfigStore *ChannelConfigStoreTransactor) RemoveChannel(opts *bind.TransactOpts, channelId uint32) (*types.Transaction, error) { - return _ChannelConfigStore.contract.Transact(opts, "removeChannel", channelId) +func (_ChannelConfigStore *ChannelConfigStoreTransactor) SetChannelDefinitions(opts *bind.TransactOpts, donId uint32, url string, sha [32]byte) (*types.Transaction, error) { + return _ChannelConfigStore.contract.Transact(opts, "setChannelDefinitions", donId, url, sha) } -func (_ChannelConfigStore *ChannelConfigStoreSession) RemoveChannel(channelId uint32) (*types.Transaction, error) { - return _ChannelConfigStore.Contract.RemoveChannel(&_ChannelConfigStore.TransactOpts, channelId) +func (_ChannelConfigStore *ChannelConfigStoreSession) SetChannelDefinitions(donId uint32, url string, sha [32]byte) (*types.Transaction, error) { + return _ChannelConfigStore.Contract.SetChannelDefinitions(&_ChannelConfigStore.TransactOpts, donId, url, sha) } -func (_ChannelConfigStore *ChannelConfigStoreTransactorSession) RemoveChannel(channelId uint32) (*types.Transaction, error) { - return _ChannelConfigStore.Contract.RemoveChannel(&_ChannelConfigStore.TransactOpts, channelId) +func (_ChannelConfigStore *ChannelConfigStoreTransactorSession) SetChannelDefinitions(donId uint32, url string, sha [32]byte) (*types.Transaction, error) { + return _ChannelConfigStore.Contract.SetChannelDefinitions(&_ChannelConfigStore.TransactOpts, donId, url, sha) } func (_ChannelConfigStore *ChannelConfigStoreTransactor) TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) { @@ -313,123 +273,6 @@ func (_ChannelConfigStore *ChannelConfigStoreTransactorSession) TransferOwnershi return _ChannelConfigStore.Contract.TransferOwnership(&_ChannelConfigStore.TransactOpts, to) } -type ChannelConfigStoreChannelDefinitionRemovedIterator struct { - Event *ChannelConfigStoreChannelDefinitionRemoved - - contract *bind.BoundContract - event string - - logs chan types.Log - sub ethereum.Subscription - done bool - fail error -} - -func (it *ChannelConfigStoreChannelDefinitionRemovedIterator) Next() bool { - - if it.fail != nil { - return false - } - - if it.done { - select { - case log := <-it.logs: - it.Event = new(ChannelConfigStoreChannelDefinitionRemoved) - 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 - } - } - - select { - case log := <-it.logs: - it.Event = new(ChannelConfigStoreChannelDefinitionRemoved) - 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() - } -} - -func (it *ChannelConfigStoreChannelDefinitionRemovedIterator) Error() error { - return it.fail -} - -func (it *ChannelConfigStoreChannelDefinitionRemovedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -type ChannelConfigStoreChannelDefinitionRemoved struct { - ChannelId uint32 - Raw types.Log -} - -func (_ChannelConfigStore *ChannelConfigStoreFilterer) FilterChannelDefinitionRemoved(opts *bind.FilterOpts) (*ChannelConfigStoreChannelDefinitionRemovedIterator, error) { - - logs, sub, err := _ChannelConfigStore.contract.FilterLogs(opts, "ChannelDefinitionRemoved") - if err != nil { - return nil, err - } - return &ChannelConfigStoreChannelDefinitionRemovedIterator{contract: _ChannelConfigStore.contract, event: "ChannelDefinitionRemoved", logs: logs, sub: sub}, nil -} - -func (_ChannelConfigStore *ChannelConfigStoreFilterer) WatchChannelDefinitionRemoved(opts *bind.WatchOpts, sink chan<- *ChannelConfigStoreChannelDefinitionRemoved) (event.Subscription, error) { - - logs, sub, err := _ChannelConfigStore.contract.WatchLogs(opts, "ChannelDefinitionRemoved") - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - - event := new(ChannelConfigStoreChannelDefinitionRemoved) - if err := _ChannelConfigStore.contract.UnpackLog(event, "ChannelDefinitionRemoved", 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 -} - -func (_ChannelConfigStore *ChannelConfigStoreFilterer) ParseChannelDefinitionRemoved(log types.Log) (*ChannelConfigStoreChannelDefinitionRemoved, error) { - event := new(ChannelConfigStoreChannelDefinitionRemoved) - if err := _ChannelConfigStore.contract.UnpackLog(event, "ChannelDefinitionRemoved", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - type ChannelConfigStoreNewChannelDefinitionIterator struct { Event *ChannelConfigStoreNewChannelDefinition @@ -491,23 +334,35 @@ func (it *ChannelConfigStoreNewChannelDefinitionIterator) Close() error { } type ChannelConfigStoreNewChannelDefinition struct { - ChannelId uint32 - ChannelDefinition IChannelConfigStoreChannelDefinition - Raw types.Log + DonId *big.Int + Version uint32 + Url string + Sha [32]byte + Raw types.Log } -func (_ChannelConfigStore *ChannelConfigStoreFilterer) FilterNewChannelDefinition(opts *bind.FilterOpts) (*ChannelConfigStoreNewChannelDefinitionIterator, error) { +func (_ChannelConfigStore *ChannelConfigStoreFilterer) FilterNewChannelDefinition(opts *bind.FilterOpts, donId []*big.Int) (*ChannelConfigStoreNewChannelDefinitionIterator, error) { + + var donIdRule []interface{} + for _, donIdItem := range donId { + donIdRule = append(donIdRule, donIdItem) + } - logs, sub, err := _ChannelConfigStore.contract.FilterLogs(opts, "NewChannelDefinition") + logs, sub, err := _ChannelConfigStore.contract.FilterLogs(opts, "NewChannelDefinition", donIdRule) if err != nil { return nil, err } return &ChannelConfigStoreNewChannelDefinitionIterator{contract: _ChannelConfigStore.contract, event: "NewChannelDefinition", logs: logs, sub: sub}, nil } -func (_ChannelConfigStore *ChannelConfigStoreFilterer) WatchNewChannelDefinition(opts *bind.WatchOpts, sink chan<- *ChannelConfigStoreNewChannelDefinition) (event.Subscription, error) { +func (_ChannelConfigStore *ChannelConfigStoreFilterer) WatchNewChannelDefinition(opts *bind.WatchOpts, sink chan<- *ChannelConfigStoreNewChannelDefinition, donId []*big.Int) (event.Subscription, error) { + + var donIdRule []interface{} + for _, donIdItem := range donId { + donIdRule = append(donIdRule, donIdItem) + } - logs, sub, err := _ChannelConfigStore.contract.WatchLogs(opts, "NewChannelDefinition") + logs, sub, err := _ChannelConfigStore.contract.WatchLogs(opts, "NewChannelDefinition", donIdRule) if err != nil { return nil, err } @@ -820,147 +675,22 @@ func (_ChannelConfigStore *ChannelConfigStoreFilterer) ParseOwnershipTransferred return event, nil } -type ChannelConfigStorePromoteStagingConfigIterator struct { - Event *ChannelConfigStorePromoteStagingConfig - - contract *bind.BoundContract - event string - - logs chan types.Log - sub ethereum.Subscription - done bool - fail error -} - -func (it *ChannelConfigStorePromoteStagingConfigIterator) Next() bool { - - if it.fail != nil { - return false - } - - if it.done { - select { - case log := <-it.logs: - it.Event = new(ChannelConfigStorePromoteStagingConfig) - 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 - } - } - - select { - case log := <-it.logs: - it.Event = new(ChannelConfigStorePromoteStagingConfig) - 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() - } -} - -func (it *ChannelConfigStorePromoteStagingConfigIterator) Error() error { - return it.fail -} - -func (it *ChannelConfigStorePromoteStagingConfigIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -type ChannelConfigStorePromoteStagingConfig struct { - ChannelId uint32 - Raw types.Log -} - -func (_ChannelConfigStore *ChannelConfigStoreFilterer) FilterPromoteStagingConfig(opts *bind.FilterOpts) (*ChannelConfigStorePromoteStagingConfigIterator, error) { - - logs, sub, err := _ChannelConfigStore.contract.FilterLogs(opts, "PromoteStagingConfig") - if err != nil { - return nil, err - } - return &ChannelConfigStorePromoteStagingConfigIterator{contract: _ChannelConfigStore.contract, event: "PromoteStagingConfig", logs: logs, sub: sub}, nil -} - -func (_ChannelConfigStore *ChannelConfigStoreFilterer) WatchPromoteStagingConfig(opts *bind.WatchOpts, sink chan<- *ChannelConfigStorePromoteStagingConfig) (event.Subscription, error) { - - logs, sub, err := _ChannelConfigStore.contract.WatchLogs(opts, "PromoteStagingConfig") - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - - event := new(ChannelConfigStorePromoteStagingConfig) - if err := _ChannelConfigStore.contract.UnpackLog(event, "PromoteStagingConfig", 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 -} - -func (_ChannelConfigStore *ChannelConfigStoreFilterer) ParsePromoteStagingConfig(log types.Log) (*ChannelConfigStorePromoteStagingConfig, error) { - event := new(ChannelConfigStorePromoteStagingConfig) - if err := _ChannelConfigStore.contract.UnpackLog(event, "PromoteStagingConfig", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - func (_ChannelConfigStore *ChannelConfigStore) ParseLog(log types.Log) (generated.AbigenLog, error) { switch log.Topics[0] { - case _ChannelConfigStore.abi.Events["ChannelDefinitionRemoved"].ID: - return _ChannelConfigStore.ParseChannelDefinitionRemoved(log) case _ChannelConfigStore.abi.Events["NewChannelDefinition"].ID: return _ChannelConfigStore.ParseNewChannelDefinition(log) case _ChannelConfigStore.abi.Events["OwnershipTransferRequested"].ID: return _ChannelConfigStore.ParseOwnershipTransferRequested(log) case _ChannelConfigStore.abi.Events["OwnershipTransferred"].ID: return _ChannelConfigStore.ParseOwnershipTransferred(log) - case _ChannelConfigStore.abi.Events["PromoteStagingConfig"].ID: - return _ChannelConfigStore.ParsePromoteStagingConfig(log) default: return nil, fmt.Errorf("abigen wrapper received unknown log topic: %v", log.Topics[0]) } } -func (ChannelConfigStoreChannelDefinitionRemoved) Topic() common.Hash { - return common.HexToHash("0x334e877e9691ecae0660510061973bebaa8b4fb37332ed6090052e630c979861") -} - func (ChannelConfigStoreNewChannelDefinition) Topic() common.Hash { - return common.HexToHash("0x35d63e43dd8abd374a4c4e0b5b02c8294dd20e1f493e7344a1751123d11ecc14") + return common.HexToHash("0xe5b641a7879fb491e4e5a35a1ce950f0237b2537ee9b1b1e4fb65e29aff1f5e8") } func (ChannelConfigStoreOwnershipTransferRequested) Topic() common.Hash { @@ -971,17 +701,11 @@ func (ChannelConfigStoreOwnershipTransferred) Topic() common.Hash { return common.HexToHash("0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0") } -func (ChannelConfigStorePromoteStagingConfig) Topic() common.Hash { - return common.HexToHash("0xbdd8ee023f9979bf23e8af6fd7241f484024e83fb0fabd11bb7fd5e9bed7308a") -} - func (_ChannelConfigStore *ChannelConfigStore) Address() common.Address { return _ChannelConfigStore.address } type ChannelConfigStoreInterface interface { - GetChannelDefinitions(opts *bind.CallOpts, channelId uint32) (IChannelConfigStoreChannelDefinition, error) - Owner(opts *bind.CallOpts) (common.Address, error) SupportsInterface(opts *bind.CallOpts, interfaceId [4]byte) (bool, error) @@ -990,21 +714,13 @@ type ChannelConfigStoreInterface interface { AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) - AddChannel(opts *bind.TransactOpts, channelId uint32, channelDefinition IChannelConfigStoreChannelDefinition) (*types.Transaction, error) - - RemoveChannel(opts *bind.TransactOpts, channelId uint32) (*types.Transaction, error) + SetChannelDefinitions(opts *bind.TransactOpts, donId uint32, url string, sha [32]byte) (*types.Transaction, error) TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) - FilterChannelDefinitionRemoved(opts *bind.FilterOpts) (*ChannelConfigStoreChannelDefinitionRemovedIterator, error) - - WatchChannelDefinitionRemoved(opts *bind.WatchOpts, sink chan<- *ChannelConfigStoreChannelDefinitionRemoved) (event.Subscription, error) - - ParseChannelDefinitionRemoved(log types.Log) (*ChannelConfigStoreChannelDefinitionRemoved, error) - - FilterNewChannelDefinition(opts *bind.FilterOpts) (*ChannelConfigStoreNewChannelDefinitionIterator, error) + FilterNewChannelDefinition(opts *bind.FilterOpts, donId []*big.Int) (*ChannelConfigStoreNewChannelDefinitionIterator, error) - WatchNewChannelDefinition(opts *bind.WatchOpts, sink chan<- *ChannelConfigStoreNewChannelDefinition) (event.Subscription, error) + WatchNewChannelDefinition(opts *bind.WatchOpts, sink chan<- *ChannelConfigStoreNewChannelDefinition, donId []*big.Int) (event.Subscription, error) ParseNewChannelDefinition(log types.Log) (*ChannelConfigStoreNewChannelDefinition, error) @@ -1020,12 +736,6 @@ type ChannelConfigStoreInterface interface { ParseOwnershipTransferred(log types.Log) (*ChannelConfigStoreOwnershipTransferred, error) - FilterPromoteStagingConfig(opts *bind.FilterOpts) (*ChannelConfigStorePromoteStagingConfigIterator, error) - - WatchPromoteStagingConfig(opts *bind.WatchOpts, sink chan<- *ChannelConfigStorePromoteStagingConfig) (event.Subscription, error) - - ParsePromoteStagingConfig(log types.Log) (*ChannelConfigStorePromoteStagingConfig, error) - ParseLog(log types.Log) (generated.AbigenLog, error) Address() common.Address diff --git a/core/gethwrappers/llo-feeds/generated/channel_verifier/channel_verifier.go b/core/gethwrappers/llo-feeds/generated/channel_verifier/channel_verifier.go deleted file mode 100644 index 104cab61040..00000000000 --- a/core/gethwrappers/llo-feeds/generated/channel_verifier/channel_verifier.go +++ /dev/null @@ -1,1583 +0,0 @@ -// Code generated - DO NOT EDIT. -// This file is a generated binding and any manual changes will be lost. - -package channel_verifier - -import ( - "errors" - "fmt" - "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" - "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" -) - -var ( - _ = errors.New - _ = big.NewInt - _ = strings.NewReader - _ = ethereum.NotFound - _ = bind.Bind - _ = common.Big1 - _ = types.BloomLookup - _ = event.NewSubscription - _ = abi.ConvertType -) - -type CommonAddressAndWeight struct { - Addr common.Address - Weight uint64 -} - -var ChannelVerifierMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"verifierProxyAddr\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"AccessForbidden\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"BadVerification\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"}],\"name\":\"CannotDeactivateLatestConfig\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DigestEmpty\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"}],\"name\":\"DigestInactive\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"}],\"name\":\"DigestNotSet\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"numSigners\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxSigners\",\"type\":\"uint256\"}],\"name\":\"ExcessSigners\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FaultToleranceMustBePositive\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FeedIdEmpty\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"feedId\",\"type\":\"bytes32\"}],\"name\":\"InactiveFeed\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"numSigners\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expectedNumSigners\",\"type\":\"uint256\"}],\"name\":\"IncorrectSignatureCount\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"numSigners\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"minSigners\",\"type\":\"uint256\"}],\"name\":\"InsufficientSigners\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"feedId\",\"type\":\"bytes32\"}],\"name\":\"InvalidFeed\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"rsLength\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"ssLength\",\"type\":\"uint256\"}],\"name\":\"MismatchedSignatures\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NonUniqueSignatures\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddress\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"}],\"name\":\"ConfigActivated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"}],\"name\":\"ConfigDeactivated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"previousConfigBlockNumber\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"configCount\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"signers\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"bytes32[]\",\"name\":\"offchainTransmitters\",\"type\":\"bytes32[]\"},{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"f\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"onchainConfig\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"offchainConfigVersion\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"offchainConfig\",\"type\":\"bytes\"}],\"name\":\"ConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"feedId\",\"type\":\"bytes32\"}],\"name\":\"FeedActivated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"feedId\",\"type\":\"bytes32\"}],\"name\":\"FeedDeactivated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"feedId\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"requester\",\"type\":\"address\"}],\"name\":\"ReportVerified\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"}],\"name\":\"activateConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"feedId\",\"type\":\"bytes32\"}],\"name\":\"activateFeed\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"}],\"name\":\"deactivateConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"feedId\",\"type\":\"bytes32\"}],\"name\":\"deactivateFeed\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestConfigDetails\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"configCount\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"blockNumber\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestConfigDigestAndEpoch\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"scanLogs\",\"type\":\"bool\"},{\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"internalType\":\"uint32\",\"name\":\"epoch\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"signers\",\"type\":\"address[]\"},{\"internalType\":\"bytes32[]\",\"name\":\"offchainTransmitters\",\"type\":\"bytes32[]\"},{\"internalType\":\"uint8\",\"name\":\"f\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"onchainConfig\",\"type\":\"bytes\"},{\"internalType\":\"uint64\",\"name\":\"offchainConfigVersion\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"offchainConfig\",\"type\":\"bytes\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"weight\",\"type\":\"uint64\"}],\"internalType\":\"structCommon.AddressAndWeight[]\",\"name\":\"recipientAddressesAndWeights\",\"type\":\"tuple[]\"}],\"name\":\"setConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"sourceChainId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"sourceAddress\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"newConfigCount\",\"type\":\"uint32\"},{\"internalType\":\"address[]\",\"name\":\"signers\",\"type\":\"address[]\"},{\"internalType\":\"bytes32[]\",\"name\":\"offchainTransmitters\",\"type\":\"bytes32[]\"},{\"internalType\":\"uint8\",\"name\":\"f\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"onchainConfig\",\"type\":\"bytes\"},{\"internalType\":\"uint64\",\"name\":\"offchainConfigVersion\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"offchainConfig\",\"type\":\"bytes\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"weight\",\"type\":\"uint64\"}],\"internalType\":\"structCommon.AddressAndWeight[]\",\"name\":\"recipientAddressesAndWeights\",\"type\":\"tuple[]\"}],\"name\":\"setConfigFromSource\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"isVerifier\",\"type\":\"bool\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"signedReport\",\"type\":\"bytes\"},{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"verify\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"verifierResponse\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", - Bin: "0x60a06040523480156200001157600080fd5b50604051620020ed380380620020ed8339810160408190526200003491620001a6565b33806000816200008b5760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000be57620000be81620000fb565b5050506001600160a01b038116620000e95760405163d92e233d60e01b815260040160405180910390fd5b6001600160a01b0316608052620001d8565b336001600160a01b03821603620001555760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640162000082565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b600060208284031215620001b957600080fd5b81516001600160a01b0381168114620001d157600080fd5b9392505050565b608051611ef9620001f4600039600061051a0152611ef96000f3fe608060405234801561001057600080fd5b50600436106100ea5760003560e01c8063564a0a7a1161008c5780638da5cb5b116100665780638da5cb5b14610247578063afcb95d71461026f578063eb1dc803146102a4578063f2fde38b146102b757600080fd5b8063564a0a7a146101fc57806379ba50971461020f57806381ff70481461021757600080fd5b8063181f5a77116100c8578063181f5a77146101815780633d3ac1b5146101c35780633dd86430146101d657806354e68a81146101e957600080fd5b806301ffc9a7146100ef5780630d1d79af146101595780630f672ef41461016e575b600080fd5b6101446100fd3660046113d0565b7fffffffff00000000000000000000000000000000000000000000000000000000167f3d3ac1b5000000000000000000000000000000000000000000000000000000001490565b60405190151581526020015b60405180910390f35b61016c610167366004611419565b6102ca565b005b61016c61017c366004611419565b6103d0565b60408051808201909152601581527f4368616e6e656c566572696669657220302e302e30000000000000000000000060208201525b6040516101509190611496565b6101b66101d13660046114d2565b610500565b61016c6101e4366004611419565b610680565b61016c6101f7366004611866565b6106fd565b61016c61020a366004611419565b61080d565b61016c61088d565b6002546003546040805163ffffffff80851682526401000000009094049093166020840152820152606001610150565b60005460405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610150565b600354600254604080516000815260208101939093526801000000000000000090910463ffffffff1690820152606001610150565b61016c6102b2366004611986565b61098a565b61016c6102c5366004611a79565b610a52565b6102d2610a63565b80610309576040517fe332262700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008181526005602052604081205460ff16900361035b576040517f74eb4b93000000000000000000000000000000000000000000000000000000008152600481018290526024015b60405180910390fd5b6000818152600560205260409081902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff16610100179055517fa543797a0501218bba8a3daf75a71c8df8d1a7f791f4e44d40e43b6450183cea906103c59083815260200190565b60405180910390a150565b6103d8610a63565b8061040f576040517fe332262700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008181526005602052604081205460ff16900361045c576040517f74eb4b9300000000000000000000000000000000000000000000000000000000815260048101829052602401610352565b600354810361049a576040517f67863f4400000000000000000000000000000000000000000000000000000000815260048101829052602401610352565b6000818152600560205260409081902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055517f5bfaab86edc1b932e3c334327a591c9ded067cb521abae19b95ca927d6076579906103c59083815260200190565b60603373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614610571576040517fef67f5d800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600080808080610583888a018a611a94565b9450945094509450945060008461059990611b6f565b60008181526004602052604090205490915060ff16156105e8576040517f36dbe74800000000000000000000000000000000000000000000000000000000815260048101829052602401610352565b8551600081815260056020526040902061060482878784610ae6565b61060f886002610bda565b86516020880120610624818a89898987610c42565b60405173ffffffffffffffffffffffffffffffffffffffff8c16815284907f58ca9502e98a536e06e72d680fcc251e5d10b72291a281665a2c2dc0ac30fcc59060200160405180910390a250959b9a5050505050505050505050565b610688610a63565b60008181526004602052604090205460ff166106fa5760008181526004602052604080822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690555182917ff438564f793525caa89c6e3a26d41e16aa39d1e589747595751e3f3df75cb2b491a25b50565b86518560ff168060000361073d576040517f0743bae600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b601f821115610782576040517f61750f4000000000000000000000000000000000000000000000000000000000815260048101839052601f6024820152604401610352565b61078d816003611c12565b82116107e5578161079f826003611c12565b6107aa906001611c2f565b6040517f9dd9e6d800000000000000000000000000000000000000000000000000000000815260048101929092526024820152604401610352565b6107ed610a63565b6107ff8c8c8c8c8c8c8c8c8c8c610ebe565b505050505050505050505050565b610815610a63565b60008181526004602052604090205460ff16156106fa5760008181526004602052604080822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790555182917ffc4f79b8c65b6be1773063461984c0974400d1e99654c79477a092ace83fd06191a250565b60015473ffffffffffffffffffffffffffffffffffffffff16331461090e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e6572000000000000000000006044820152606401610352565b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b86518560ff16806000036109ca576040517f0743bae600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b601f821115610a0f576040517f61750f4000000000000000000000000000000000000000000000000000000000815260048101839052601f6024820152604401610352565b610a1a816003611c12565b8211610a2c578161079f826003611c12565b610a34610a63565b610a47463060008c8c8c8c8c8c8c610ebe565b505050505050505050565b610a5a610a63565b6106fa81611230565b60005473ffffffffffffffffffffffffffffffffffffffff163314610ae4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e6572000000000000000000006044820152606401610352565b565b8054600090610af99060ff166001611c42565b8254909150610100900460ff16610b3f576040517fd990d62100000000000000000000000000000000000000000000000000000000815260048101869052602401610352565b8060ff16845114610b8b5783516040517f5348a282000000000000000000000000000000000000000000000000000000008152600481019190915260ff82166024820152604401610352565b8251845114610bd357835183516040517ff0d3140800000000000000000000000000000000000000000000000000000000815260048101929092526024820152604401610352565b5050505050565b6020820151815463ffffffff600883901c81169168010000000000000000900416811115610c3c5782547fffffffffffffffffffffffffffffffffffffffff00000000ffffffffffffffff166801000000000000000063ffffffff8316021783555b50505050565b60008686604051602001610c57929190611c5b565b6040516020818303038152906040528051906020012090506000610c8b604080518082019091526000808252602082015290565b8651600090815b81811015610e5657600186898360208110610caf57610caf611bb4565b610cbc91901a601b611c42565b8c8481518110610cce57610cce611bb4565b60200260200101518c8581518110610ce857610ce8611bb4565b602002602001015160405160008152602001604052604051610d26949392919093845260ff9290921660208401526040830152606082015260800190565b6020604051602081039080840390855afa158015610d48573d6000803e3d6000fd5b5050604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081015173ffffffffffffffffffffffffffffffffffffffff811660009081526001808d01602090815291859020848601909552845460ff808216865293995093955090850192610100900490911690811115610dcd57610dcd611c97565b6001811115610dde57610dde611c97565b9052509350600184602001516001811115610dfb57610dfb611c97565b14610e32576040517f4df18f0700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b836000015160080260ff166001901b8501945080610e4f90611cc6565b9050610c92565b50837e01010101010101010101010101010101010101010101010101010101010101851614610eb1576040517f4df18f0700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5050505050505050505050565b63ffffffff881615610eff57600280547fffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000001663ffffffff8a16179055610f35565b6002805463ffffffff16906000610f1583611cfe565b91906101000a81548163ffffffff021916908363ffffffff160217905550505b600254600090610f54908c908c9063ffffffff168b8b8b8b8b8b611325565b600081815260056020526040812080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00001660ff8a16176101001790559091505b88518160ff16101561118f576000898260ff1681518110610fb857610fb8611bb4565b60200260200101519050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603611028576040517fd92e233d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600080600085815260056020908152604080832073ffffffffffffffffffffffffffffffffffffffff87168452600190810190925290912054610100900460ff169081111561107957611079611c97565b14801591506110b4576040517ff67bc7c400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040805180820190915260ff841681526020810160019052600085815260056020908152604080832073ffffffffffffffffffffffffffffffffffffffff871684526001908101835292208351815460ff9091167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00821681178355928501519193919284927fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000909216179061010090849081111561117457611174611c97565b021790555090505050508061118890611d21565b9050610f95565b506002546040517f1074b4b9a073f79bd1f7f5c808348125ce0f25c27188df7efcaa7a08276051b3916111e29163ffffffff640100000000830481169286929116908d908d908d908d908d908d90611dc1565b60405180910390a1600280547fffffffffffffffffffffffffffffffffffffffff0000000000000000ffffffff1664010000000063ffffffff43160217905560035550505050505050505050565b3373ffffffffffffffffffffffffffffffffffffffff8216036112af576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c660000000000000000006044820152606401610352565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b6000808a8a8a8a8a8a8a8a8a60405160200161134999989796959493929190611e57565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815291905280516020909101207dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167e09000000000000000000000000000000000000000000000000000000000000179150509998505050505050505050565b6000602082840312156113e257600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461141257600080fd5b9392505050565b60006020828403121561142b57600080fd5b5035919050565b6000815180845260005b818110156114585760208185018101518683018201520161143c565b5060006020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b6020815260006114126020830184611432565b803573ffffffffffffffffffffffffffffffffffffffff811681146114cd57600080fd5b919050565b6000806000604084860312156114e757600080fd5b833567ffffffffffffffff808211156114ff57600080fd5b818601915086601f83011261151357600080fd5b81358181111561152257600080fd5b87602082850101111561153457600080fd5b60209283019550935061154a91860190506114a9565b90509250925092565b803563ffffffff811681146114cd57600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040805190810167ffffffffffffffff811182821017156115b9576115b9611567565b60405290565b6040516060810167ffffffffffffffff811182821017156115b9576115b9611567565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff8111828210171561162957611629611567565b604052919050565b600067ffffffffffffffff82111561164b5761164b611567565b5060051b60200190565b600082601f83011261166657600080fd5b8135602061167b61167683611631565b6115e2565b82815260059290921b8401810191818101908684111561169a57600080fd5b8286015b848110156116bc576116af816114a9565b835291830191830161169e565b509695505050505050565b600082601f8301126116d857600080fd5b813560206116e861167683611631565b82815260059290921b8401810191818101908684111561170757600080fd5b8286015b848110156116bc578035835291830191830161170b565b803560ff811681146114cd57600080fd5b600082601f83011261174457600080fd5b813567ffffffffffffffff81111561175e5761175e611567565b61178f60207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116016115e2565b8181528460208386010111156117a457600080fd5b816020850160208301376000918101602001919091529392505050565b803567ffffffffffffffff811681146114cd57600080fd5b600082601f8301126117ea57600080fd5b813560206117fa61167683611631565b82815260069290921b8401810191818101908684111561181957600080fd5b8286015b848110156116bc57604081890312156118365760008081fd5b61183e611596565b611847826114a9565b81526118548583016117c1565b8186015283529183019160400161181d565b6000806000806000806000806000806101408b8d03121561188657600080fd5b8a35995061189660208c016114a9565b98506118a460408c01611553565b975060608b013567ffffffffffffffff808211156118c157600080fd5b6118cd8e838f01611655565b985060808d01359150808211156118e357600080fd5b6118ef8e838f016116c7565b97506118fd60a08e01611722565b965060c08d013591508082111561191357600080fd5b61191f8e838f01611733565b955061192d60e08e016117c1565b94506101008d013591508082111561194457600080fd5b6119508e838f01611733565b93506101208d013591508082111561196757600080fd5b506119748d828e016117d9565b9150509295989b9194979a5092959850565b600080600080600080600060e0888a0312156119a157600080fd5b873567ffffffffffffffff808211156119b957600080fd5b6119c58b838c01611655565b985060208a01359150808211156119db57600080fd5b6119e78b838c016116c7565b97506119f560408b01611722565b965060608a0135915080821115611a0b57600080fd5b611a178b838c01611733565b9550611a2560808b016117c1565b945060a08a0135915080821115611a3b57600080fd5b611a478b838c01611733565b935060c08a0135915080821115611a5d57600080fd5b50611a6a8a828b016117d9565b91505092959891949750929550565b600060208284031215611a8b57600080fd5b611412826114a9565b600080600080600060e08688031215611aac57600080fd5b86601f870112611abb57600080fd5b611ac36115bf565b806060880189811115611ad557600080fd5b885b81811015611aef578035845260209384019301611ad7565b5090965035905067ffffffffffffffff80821115611b0c57600080fd5b611b1889838a01611733565b95506080880135915080821115611b2e57600080fd5b611b3a89838a016116c7565b945060a0880135915080821115611b5057600080fd5b50611b5d888289016116c7565b9598949750929560c001359392505050565b80516020808301519190811015611bae577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8160200360031b1b821691505b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8082028115828204841417611c2957611c29611be3565b92915050565b80820180821115611c2957611c29611be3565b60ff8181168382160190811115611c2957611c29611be3565b828152600060208083018460005b6003811015611c8657815183529183019190830190600101611c69565b505050506080820190509392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203611cf757611cf7611be3565b5060010190565b600063ffffffff808316818103611d1757611d17611be3565b6001019392505050565b600060ff821660ff8103611d3757611d37611be3565b60010192915050565b600081518084526020808501945080840160005b83811015611d8657815173ffffffffffffffffffffffffffffffffffffffff1687529582019590820190600101611d54565b509495945050505050565b600081518084526020808501945080840160005b83811015611d8657815187529582019590820190600101611da5565b600061012063ffffffff808d1684528b6020850152808b16604085015250806060840152611df18184018a611d40565b90508281036080840152611e058189611d91565b905060ff871660a084015282810360c0840152611e228187611432565b905067ffffffffffffffff851660e0840152828103610100840152611e478185611432565b9c9b505050505050505050505050565b60006101208b835273ffffffffffffffffffffffffffffffffffffffff8b16602084015267ffffffffffffffff808b166040850152816060850152611e9e8285018b611d40565b91508382036080850152611eb2828a611d91565b915060ff881660a085015283820360c0850152611ecf8288611432565b90861660e08501528381036101008501529050611e47818561143256fea164736f6c6343000813000a", -} - -var ChannelVerifierABI = ChannelVerifierMetaData.ABI - -var ChannelVerifierBin = ChannelVerifierMetaData.Bin - -func DeployChannelVerifier(auth *bind.TransactOpts, backend bind.ContractBackend, verifierProxyAddr common.Address) (common.Address, *types.Transaction, *ChannelVerifier, error) { - parsed, err := ChannelVerifierMetaData.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(ChannelVerifierBin), backend, verifierProxyAddr) - if err != nil { - return common.Address{}, nil, nil, err - } - return address, tx, &ChannelVerifier{address: address, abi: *parsed, ChannelVerifierCaller: ChannelVerifierCaller{contract: contract}, ChannelVerifierTransactor: ChannelVerifierTransactor{contract: contract}, ChannelVerifierFilterer: ChannelVerifierFilterer{contract: contract}}, nil -} - -type ChannelVerifier struct { - address common.Address - abi abi.ABI - ChannelVerifierCaller - ChannelVerifierTransactor - ChannelVerifierFilterer -} - -type ChannelVerifierCaller struct { - contract *bind.BoundContract -} - -type ChannelVerifierTransactor struct { - contract *bind.BoundContract -} - -type ChannelVerifierFilterer struct { - contract *bind.BoundContract -} - -type ChannelVerifierSession struct { - Contract *ChannelVerifier - CallOpts bind.CallOpts - TransactOpts bind.TransactOpts -} - -type ChannelVerifierCallerSession struct { - Contract *ChannelVerifierCaller - CallOpts bind.CallOpts -} - -type ChannelVerifierTransactorSession struct { - Contract *ChannelVerifierTransactor - TransactOpts bind.TransactOpts -} - -type ChannelVerifierRaw struct { - Contract *ChannelVerifier -} - -type ChannelVerifierCallerRaw struct { - Contract *ChannelVerifierCaller -} - -type ChannelVerifierTransactorRaw struct { - Contract *ChannelVerifierTransactor -} - -func NewChannelVerifier(address common.Address, backend bind.ContractBackend) (*ChannelVerifier, error) { - abi, err := abi.JSON(strings.NewReader(ChannelVerifierABI)) - if err != nil { - return nil, err - } - contract, err := bindChannelVerifier(address, backend, backend, backend) - if err != nil { - return nil, err - } - return &ChannelVerifier{address: address, abi: abi, ChannelVerifierCaller: ChannelVerifierCaller{contract: contract}, ChannelVerifierTransactor: ChannelVerifierTransactor{contract: contract}, ChannelVerifierFilterer: ChannelVerifierFilterer{contract: contract}}, nil -} - -func NewChannelVerifierCaller(address common.Address, caller bind.ContractCaller) (*ChannelVerifierCaller, error) { - contract, err := bindChannelVerifier(address, caller, nil, nil) - if err != nil { - return nil, err - } - return &ChannelVerifierCaller{contract: contract}, nil -} - -func NewChannelVerifierTransactor(address common.Address, transactor bind.ContractTransactor) (*ChannelVerifierTransactor, error) { - contract, err := bindChannelVerifier(address, nil, transactor, nil) - if err != nil { - return nil, err - } - return &ChannelVerifierTransactor{contract: contract}, nil -} - -func NewChannelVerifierFilterer(address common.Address, filterer bind.ContractFilterer) (*ChannelVerifierFilterer, error) { - contract, err := bindChannelVerifier(address, nil, nil, filterer) - if err != nil { - return nil, err - } - return &ChannelVerifierFilterer{contract: contract}, nil -} - -func bindChannelVerifier(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { - parsed, err := ChannelVerifierMetaData.GetAbi() - if err != nil { - return nil, err - } - return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil -} - -func (_ChannelVerifier *ChannelVerifierRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _ChannelVerifier.Contract.ChannelVerifierCaller.contract.Call(opts, result, method, params...) -} - -func (_ChannelVerifier *ChannelVerifierRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _ChannelVerifier.Contract.ChannelVerifierTransactor.contract.Transfer(opts) -} - -func (_ChannelVerifier *ChannelVerifierRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _ChannelVerifier.Contract.ChannelVerifierTransactor.contract.Transact(opts, method, params...) -} - -func (_ChannelVerifier *ChannelVerifierCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _ChannelVerifier.Contract.contract.Call(opts, result, method, params...) -} - -func (_ChannelVerifier *ChannelVerifierTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _ChannelVerifier.Contract.contract.Transfer(opts) -} - -func (_ChannelVerifier *ChannelVerifierTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _ChannelVerifier.Contract.contract.Transact(opts, method, params...) -} - -func (_ChannelVerifier *ChannelVerifierCaller) LatestConfigDetails(opts *bind.CallOpts) (LatestConfigDetails, - - error) { - var out []interface{} - err := _ChannelVerifier.contract.Call(opts, &out, "latestConfigDetails") - - outstruct := new(LatestConfigDetails) - if err != nil { - return *outstruct, err - } - - outstruct.ConfigCount = *abi.ConvertType(out[0], new(uint32)).(*uint32) - outstruct.BlockNumber = *abi.ConvertType(out[1], new(uint32)).(*uint32) - outstruct.ConfigDigest = *abi.ConvertType(out[2], new([32]byte)).(*[32]byte) - - return *outstruct, err - -} - -func (_ChannelVerifier *ChannelVerifierSession) LatestConfigDetails() (LatestConfigDetails, - - error) { - return _ChannelVerifier.Contract.LatestConfigDetails(&_ChannelVerifier.CallOpts) -} - -func (_ChannelVerifier *ChannelVerifierCallerSession) LatestConfigDetails() (LatestConfigDetails, - - error) { - return _ChannelVerifier.Contract.LatestConfigDetails(&_ChannelVerifier.CallOpts) -} - -func (_ChannelVerifier *ChannelVerifierCaller) LatestConfigDigestAndEpoch(opts *bind.CallOpts) (LatestConfigDigestAndEpoch, - - error) { - var out []interface{} - err := _ChannelVerifier.contract.Call(opts, &out, "latestConfigDigestAndEpoch") - - outstruct := new(LatestConfigDigestAndEpoch) - if err != nil { - return *outstruct, err - } - - outstruct.ScanLogs = *abi.ConvertType(out[0], new(bool)).(*bool) - outstruct.ConfigDigest = *abi.ConvertType(out[1], new([32]byte)).(*[32]byte) - outstruct.Epoch = *abi.ConvertType(out[2], new(uint32)).(*uint32) - - return *outstruct, err - -} - -func (_ChannelVerifier *ChannelVerifierSession) LatestConfigDigestAndEpoch() (LatestConfigDigestAndEpoch, - - error) { - return _ChannelVerifier.Contract.LatestConfigDigestAndEpoch(&_ChannelVerifier.CallOpts) -} - -func (_ChannelVerifier *ChannelVerifierCallerSession) LatestConfigDigestAndEpoch() (LatestConfigDigestAndEpoch, - - error) { - return _ChannelVerifier.Contract.LatestConfigDigestAndEpoch(&_ChannelVerifier.CallOpts) -} - -func (_ChannelVerifier *ChannelVerifierCaller) Owner(opts *bind.CallOpts) (common.Address, error) { - var out []interface{} - err := _ChannelVerifier.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 - -} - -func (_ChannelVerifier *ChannelVerifierSession) Owner() (common.Address, error) { - return _ChannelVerifier.Contract.Owner(&_ChannelVerifier.CallOpts) -} - -func (_ChannelVerifier *ChannelVerifierCallerSession) Owner() (common.Address, error) { - return _ChannelVerifier.Contract.Owner(&_ChannelVerifier.CallOpts) -} - -func (_ChannelVerifier *ChannelVerifierCaller) SupportsInterface(opts *bind.CallOpts, interfaceId [4]byte) (bool, error) { - var out []interface{} - err := _ChannelVerifier.contract.Call(opts, &out, "supportsInterface", interfaceId) - - if err != nil { - return *new(bool), err - } - - out0 := *abi.ConvertType(out[0], new(bool)).(*bool) - - return out0, err - -} - -func (_ChannelVerifier *ChannelVerifierSession) SupportsInterface(interfaceId [4]byte) (bool, error) { - return _ChannelVerifier.Contract.SupportsInterface(&_ChannelVerifier.CallOpts, interfaceId) -} - -func (_ChannelVerifier *ChannelVerifierCallerSession) SupportsInterface(interfaceId [4]byte) (bool, error) { - return _ChannelVerifier.Contract.SupportsInterface(&_ChannelVerifier.CallOpts, interfaceId) -} - -func (_ChannelVerifier *ChannelVerifierCaller) TypeAndVersion(opts *bind.CallOpts) (string, error) { - var out []interface{} - err := _ChannelVerifier.contract.Call(opts, &out, "typeAndVersion") - - if err != nil { - return *new(string), err - } - - out0 := *abi.ConvertType(out[0], new(string)).(*string) - - return out0, err - -} - -func (_ChannelVerifier *ChannelVerifierSession) TypeAndVersion() (string, error) { - return _ChannelVerifier.Contract.TypeAndVersion(&_ChannelVerifier.CallOpts) -} - -func (_ChannelVerifier *ChannelVerifierCallerSession) TypeAndVersion() (string, error) { - return _ChannelVerifier.Contract.TypeAndVersion(&_ChannelVerifier.CallOpts) -} - -func (_ChannelVerifier *ChannelVerifierTransactor) AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { - return _ChannelVerifier.contract.Transact(opts, "acceptOwnership") -} - -func (_ChannelVerifier *ChannelVerifierSession) AcceptOwnership() (*types.Transaction, error) { - return _ChannelVerifier.Contract.AcceptOwnership(&_ChannelVerifier.TransactOpts) -} - -func (_ChannelVerifier *ChannelVerifierTransactorSession) AcceptOwnership() (*types.Transaction, error) { - return _ChannelVerifier.Contract.AcceptOwnership(&_ChannelVerifier.TransactOpts) -} - -func (_ChannelVerifier *ChannelVerifierTransactor) ActivateConfig(opts *bind.TransactOpts, configDigest [32]byte) (*types.Transaction, error) { - return _ChannelVerifier.contract.Transact(opts, "activateConfig", configDigest) -} - -func (_ChannelVerifier *ChannelVerifierSession) ActivateConfig(configDigest [32]byte) (*types.Transaction, error) { - return _ChannelVerifier.Contract.ActivateConfig(&_ChannelVerifier.TransactOpts, configDigest) -} - -func (_ChannelVerifier *ChannelVerifierTransactorSession) ActivateConfig(configDigest [32]byte) (*types.Transaction, error) { - return _ChannelVerifier.Contract.ActivateConfig(&_ChannelVerifier.TransactOpts, configDigest) -} - -func (_ChannelVerifier *ChannelVerifierTransactor) ActivateFeed(opts *bind.TransactOpts, feedId [32]byte) (*types.Transaction, error) { - return _ChannelVerifier.contract.Transact(opts, "activateFeed", feedId) -} - -func (_ChannelVerifier *ChannelVerifierSession) ActivateFeed(feedId [32]byte) (*types.Transaction, error) { - return _ChannelVerifier.Contract.ActivateFeed(&_ChannelVerifier.TransactOpts, feedId) -} - -func (_ChannelVerifier *ChannelVerifierTransactorSession) ActivateFeed(feedId [32]byte) (*types.Transaction, error) { - return _ChannelVerifier.Contract.ActivateFeed(&_ChannelVerifier.TransactOpts, feedId) -} - -func (_ChannelVerifier *ChannelVerifierTransactor) DeactivateConfig(opts *bind.TransactOpts, configDigest [32]byte) (*types.Transaction, error) { - return _ChannelVerifier.contract.Transact(opts, "deactivateConfig", configDigest) -} - -func (_ChannelVerifier *ChannelVerifierSession) DeactivateConfig(configDigest [32]byte) (*types.Transaction, error) { - return _ChannelVerifier.Contract.DeactivateConfig(&_ChannelVerifier.TransactOpts, configDigest) -} - -func (_ChannelVerifier *ChannelVerifierTransactorSession) DeactivateConfig(configDigest [32]byte) (*types.Transaction, error) { - return _ChannelVerifier.Contract.DeactivateConfig(&_ChannelVerifier.TransactOpts, configDigest) -} - -func (_ChannelVerifier *ChannelVerifierTransactor) DeactivateFeed(opts *bind.TransactOpts, feedId [32]byte) (*types.Transaction, error) { - return _ChannelVerifier.contract.Transact(opts, "deactivateFeed", feedId) -} - -func (_ChannelVerifier *ChannelVerifierSession) DeactivateFeed(feedId [32]byte) (*types.Transaction, error) { - return _ChannelVerifier.Contract.DeactivateFeed(&_ChannelVerifier.TransactOpts, feedId) -} - -func (_ChannelVerifier *ChannelVerifierTransactorSession) DeactivateFeed(feedId [32]byte) (*types.Transaction, error) { - return _ChannelVerifier.Contract.DeactivateFeed(&_ChannelVerifier.TransactOpts, feedId) -} - -func (_ChannelVerifier *ChannelVerifierTransactor) SetConfig(opts *bind.TransactOpts, signers []common.Address, offchainTransmitters [][32]byte, f uint8, onchainConfig []byte, offchainConfigVersion uint64, offchainConfig []byte, recipientAddressesAndWeights []CommonAddressAndWeight) (*types.Transaction, error) { - return _ChannelVerifier.contract.Transact(opts, "setConfig", signers, offchainTransmitters, f, onchainConfig, offchainConfigVersion, offchainConfig, recipientAddressesAndWeights) -} - -func (_ChannelVerifier *ChannelVerifierSession) SetConfig(signers []common.Address, offchainTransmitters [][32]byte, f uint8, onchainConfig []byte, offchainConfigVersion uint64, offchainConfig []byte, recipientAddressesAndWeights []CommonAddressAndWeight) (*types.Transaction, error) { - return _ChannelVerifier.Contract.SetConfig(&_ChannelVerifier.TransactOpts, signers, offchainTransmitters, f, onchainConfig, offchainConfigVersion, offchainConfig, recipientAddressesAndWeights) -} - -func (_ChannelVerifier *ChannelVerifierTransactorSession) SetConfig(signers []common.Address, offchainTransmitters [][32]byte, f uint8, onchainConfig []byte, offchainConfigVersion uint64, offchainConfig []byte, recipientAddressesAndWeights []CommonAddressAndWeight) (*types.Transaction, error) { - return _ChannelVerifier.Contract.SetConfig(&_ChannelVerifier.TransactOpts, signers, offchainTransmitters, f, onchainConfig, offchainConfigVersion, offchainConfig, recipientAddressesAndWeights) -} - -func (_ChannelVerifier *ChannelVerifierTransactor) SetConfigFromSource(opts *bind.TransactOpts, sourceChainId *big.Int, sourceAddress common.Address, newConfigCount uint32, signers []common.Address, offchainTransmitters [][32]byte, f uint8, onchainConfig []byte, offchainConfigVersion uint64, offchainConfig []byte, recipientAddressesAndWeights []CommonAddressAndWeight) (*types.Transaction, error) { - return _ChannelVerifier.contract.Transact(opts, "setConfigFromSource", sourceChainId, sourceAddress, newConfigCount, signers, offchainTransmitters, f, onchainConfig, offchainConfigVersion, offchainConfig, recipientAddressesAndWeights) -} - -func (_ChannelVerifier *ChannelVerifierSession) SetConfigFromSource(sourceChainId *big.Int, sourceAddress common.Address, newConfigCount uint32, signers []common.Address, offchainTransmitters [][32]byte, f uint8, onchainConfig []byte, offchainConfigVersion uint64, offchainConfig []byte, recipientAddressesAndWeights []CommonAddressAndWeight) (*types.Transaction, error) { - return _ChannelVerifier.Contract.SetConfigFromSource(&_ChannelVerifier.TransactOpts, sourceChainId, sourceAddress, newConfigCount, signers, offchainTransmitters, f, onchainConfig, offchainConfigVersion, offchainConfig, recipientAddressesAndWeights) -} - -func (_ChannelVerifier *ChannelVerifierTransactorSession) SetConfigFromSource(sourceChainId *big.Int, sourceAddress common.Address, newConfigCount uint32, signers []common.Address, offchainTransmitters [][32]byte, f uint8, onchainConfig []byte, offchainConfigVersion uint64, offchainConfig []byte, recipientAddressesAndWeights []CommonAddressAndWeight) (*types.Transaction, error) { - return _ChannelVerifier.Contract.SetConfigFromSource(&_ChannelVerifier.TransactOpts, sourceChainId, sourceAddress, newConfigCount, signers, offchainTransmitters, f, onchainConfig, offchainConfigVersion, offchainConfig, recipientAddressesAndWeights) -} - -func (_ChannelVerifier *ChannelVerifierTransactor) TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) { - return _ChannelVerifier.contract.Transact(opts, "transferOwnership", to) -} - -func (_ChannelVerifier *ChannelVerifierSession) TransferOwnership(to common.Address) (*types.Transaction, error) { - return _ChannelVerifier.Contract.TransferOwnership(&_ChannelVerifier.TransactOpts, to) -} - -func (_ChannelVerifier *ChannelVerifierTransactorSession) TransferOwnership(to common.Address) (*types.Transaction, error) { - return _ChannelVerifier.Contract.TransferOwnership(&_ChannelVerifier.TransactOpts, to) -} - -func (_ChannelVerifier *ChannelVerifierTransactor) Verify(opts *bind.TransactOpts, signedReport []byte, sender common.Address) (*types.Transaction, error) { - return _ChannelVerifier.contract.Transact(opts, "verify", signedReport, sender) -} - -func (_ChannelVerifier *ChannelVerifierSession) Verify(signedReport []byte, sender common.Address) (*types.Transaction, error) { - return _ChannelVerifier.Contract.Verify(&_ChannelVerifier.TransactOpts, signedReport, sender) -} - -func (_ChannelVerifier *ChannelVerifierTransactorSession) Verify(signedReport []byte, sender common.Address) (*types.Transaction, error) { - return _ChannelVerifier.Contract.Verify(&_ChannelVerifier.TransactOpts, signedReport, sender) -} - -type ChannelVerifierConfigActivatedIterator struct { - Event *ChannelVerifierConfigActivated - - contract *bind.BoundContract - event string - - logs chan types.Log - sub ethereum.Subscription - done bool - fail error -} - -func (it *ChannelVerifierConfigActivatedIterator) Next() bool { - - if it.fail != nil { - return false - } - - if it.done { - select { - case log := <-it.logs: - it.Event = new(ChannelVerifierConfigActivated) - 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 - } - } - - select { - case log := <-it.logs: - it.Event = new(ChannelVerifierConfigActivated) - 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() - } -} - -func (it *ChannelVerifierConfigActivatedIterator) Error() error { - return it.fail -} - -func (it *ChannelVerifierConfigActivatedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -type ChannelVerifierConfigActivated struct { - ConfigDigest [32]byte - Raw types.Log -} - -func (_ChannelVerifier *ChannelVerifierFilterer) FilterConfigActivated(opts *bind.FilterOpts) (*ChannelVerifierConfigActivatedIterator, error) { - - logs, sub, err := _ChannelVerifier.contract.FilterLogs(opts, "ConfigActivated") - if err != nil { - return nil, err - } - return &ChannelVerifierConfigActivatedIterator{contract: _ChannelVerifier.contract, event: "ConfigActivated", logs: logs, sub: sub}, nil -} - -func (_ChannelVerifier *ChannelVerifierFilterer) WatchConfigActivated(opts *bind.WatchOpts, sink chan<- *ChannelVerifierConfigActivated) (event.Subscription, error) { - - logs, sub, err := _ChannelVerifier.contract.WatchLogs(opts, "ConfigActivated") - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - - event := new(ChannelVerifierConfigActivated) - if err := _ChannelVerifier.contract.UnpackLog(event, "ConfigActivated", 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 -} - -func (_ChannelVerifier *ChannelVerifierFilterer) ParseConfigActivated(log types.Log) (*ChannelVerifierConfigActivated, error) { - event := new(ChannelVerifierConfigActivated) - if err := _ChannelVerifier.contract.UnpackLog(event, "ConfigActivated", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -type ChannelVerifierConfigDeactivatedIterator struct { - Event *ChannelVerifierConfigDeactivated - - contract *bind.BoundContract - event string - - logs chan types.Log - sub ethereum.Subscription - done bool - fail error -} - -func (it *ChannelVerifierConfigDeactivatedIterator) Next() bool { - - if it.fail != nil { - return false - } - - if it.done { - select { - case log := <-it.logs: - it.Event = new(ChannelVerifierConfigDeactivated) - 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 - } - } - - select { - case log := <-it.logs: - it.Event = new(ChannelVerifierConfigDeactivated) - 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() - } -} - -func (it *ChannelVerifierConfigDeactivatedIterator) Error() error { - return it.fail -} - -func (it *ChannelVerifierConfigDeactivatedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -type ChannelVerifierConfigDeactivated struct { - ConfigDigest [32]byte - Raw types.Log -} - -func (_ChannelVerifier *ChannelVerifierFilterer) FilterConfigDeactivated(opts *bind.FilterOpts) (*ChannelVerifierConfigDeactivatedIterator, error) { - - logs, sub, err := _ChannelVerifier.contract.FilterLogs(opts, "ConfigDeactivated") - if err != nil { - return nil, err - } - return &ChannelVerifierConfigDeactivatedIterator{contract: _ChannelVerifier.contract, event: "ConfigDeactivated", logs: logs, sub: sub}, nil -} - -func (_ChannelVerifier *ChannelVerifierFilterer) WatchConfigDeactivated(opts *bind.WatchOpts, sink chan<- *ChannelVerifierConfigDeactivated) (event.Subscription, error) { - - logs, sub, err := _ChannelVerifier.contract.WatchLogs(opts, "ConfigDeactivated") - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - - event := new(ChannelVerifierConfigDeactivated) - if err := _ChannelVerifier.contract.UnpackLog(event, "ConfigDeactivated", 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 -} - -func (_ChannelVerifier *ChannelVerifierFilterer) ParseConfigDeactivated(log types.Log) (*ChannelVerifierConfigDeactivated, error) { - event := new(ChannelVerifierConfigDeactivated) - if err := _ChannelVerifier.contract.UnpackLog(event, "ConfigDeactivated", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -type ChannelVerifierConfigSetIterator struct { - Event *ChannelVerifierConfigSet - - contract *bind.BoundContract - event string - - logs chan types.Log - sub ethereum.Subscription - done bool - fail error -} - -func (it *ChannelVerifierConfigSetIterator) Next() bool { - - if it.fail != nil { - return false - } - - if it.done { - select { - case log := <-it.logs: - it.Event = new(ChannelVerifierConfigSet) - 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 - } - } - - select { - case log := <-it.logs: - it.Event = new(ChannelVerifierConfigSet) - 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() - } -} - -func (it *ChannelVerifierConfigSetIterator) Error() error { - return it.fail -} - -func (it *ChannelVerifierConfigSetIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -type ChannelVerifierConfigSet struct { - PreviousConfigBlockNumber uint32 - ConfigDigest [32]byte - ConfigCount uint64 - Signers []common.Address - OffchainTransmitters [][32]byte - F uint8 - OnchainConfig []byte - OffchainConfigVersion uint64 - OffchainConfig []byte - Raw types.Log -} - -func (_ChannelVerifier *ChannelVerifierFilterer) FilterConfigSet(opts *bind.FilterOpts) (*ChannelVerifierConfigSetIterator, error) { - - logs, sub, err := _ChannelVerifier.contract.FilterLogs(opts, "ConfigSet") - if err != nil { - return nil, err - } - return &ChannelVerifierConfigSetIterator{contract: _ChannelVerifier.contract, event: "ConfigSet", logs: logs, sub: sub}, nil -} - -func (_ChannelVerifier *ChannelVerifierFilterer) WatchConfigSet(opts *bind.WatchOpts, sink chan<- *ChannelVerifierConfigSet) (event.Subscription, error) { - - logs, sub, err := _ChannelVerifier.contract.WatchLogs(opts, "ConfigSet") - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - - event := new(ChannelVerifierConfigSet) - if err := _ChannelVerifier.contract.UnpackLog(event, "ConfigSet", 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 -} - -func (_ChannelVerifier *ChannelVerifierFilterer) ParseConfigSet(log types.Log) (*ChannelVerifierConfigSet, error) { - event := new(ChannelVerifierConfigSet) - if err := _ChannelVerifier.contract.UnpackLog(event, "ConfigSet", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -type ChannelVerifierFeedActivatedIterator struct { - Event *ChannelVerifierFeedActivated - - contract *bind.BoundContract - event string - - logs chan types.Log - sub ethereum.Subscription - done bool - fail error -} - -func (it *ChannelVerifierFeedActivatedIterator) Next() bool { - - if it.fail != nil { - return false - } - - if it.done { - select { - case log := <-it.logs: - it.Event = new(ChannelVerifierFeedActivated) - 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 - } - } - - select { - case log := <-it.logs: - it.Event = new(ChannelVerifierFeedActivated) - 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() - } -} - -func (it *ChannelVerifierFeedActivatedIterator) Error() error { - return it.fail -} - -func (it *ChannelVerifierFeedActivatedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -type ChannelVerifierFeedActivated struct { - FeedId [32]byte - Raw types.Log -} - -func (_ChannelVerifier *ChannelVerifierFilterer) FilterFeedActivated(opts *bind.FilterOpts, feedId [][32]byte) (*ChannelVerifierFeedActivatedIterator, error) { - - var feedIdRule []interface{} - for _, feedIdItem := range feedId { - feedIdRule = append(feedIdRule, feedIdItem) - } - - logs, sub, err := _ChannelVerifier.contract.FilterLogs(opts, "FeedActivated", feedIdRule) - if err != nil { - return nil, err - } - return &ChannelVerifierFeedActivatedIterator{contract: _ChannelVerifier.contract, event: "FeedActivated", logs: logs, sub: sub}, nil -} - -func (_ChannelVerifier *ChannelVerifierFilterer) WatchFeedActivated(opts *bind.WatchOpts, sink chan<- *ChannelVerifierFeedActivated, feedId [][32]byte) (event.Subscription, error) { - - var feedIdRule []interface{} - for _, feedIdItem := range feedId { - feedIdRule = append(feedIdRule, feedIdItem) - } - - logs, sub, err := _ChannelVerifier.contract.WatchLogs(opts, "FeedActivated", feedIdRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - - event := new(ChannelVerifierFeedActivated) - if err := _ChannelVerifier.contract.UnpackLog(event, "FeedActivated", 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 -} - -func (_ChannelVerifier *ChannelVerifierFilterer) ParseFeedActivated(log types.Log) (*ChannelVerifierFeedActivated, error) { - event := new(ChannelVerifierFeedActivated) - if err := _ChannelVerifier.contract.UnpackLog(event, "FeedActivated", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -type ChannelVerifierFeedDeactivatedIterator struct { - Event *ChannelVerifierFeedDeactivated - - contract *bind.BoundContract - event string - - logs chan types.Log - sub ethereum.Subscription - done bool - fail error -} - -func (it *ChannelVerifierFeedDeactivatedIterator) Next() bool { - - if it.fail != nil { - return false - } - - if it.done { - select { - case log := <-it.logs: - it.Event = new(ChannelVerifierFeedDeactivated) - 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 - } - } - - select { - case log := <-it.logs: - it.Event = new(ChannelVerifierFeedDeactivated) - 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() - } -} - -func (it *ChannelVerifierFeedDeactivatedIterator) Error() error { - return it.fail -} - -func (it *ChannelVerifierFeedDeactivatedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -type ChannelVerifierFeedDeactivated struct { - FeedId [32]byte - Raw types.Log -} - -func (_ChannelVerifier *ChannelVerifierFilterer) FilterFeedDeactivated(opts *bind.FilterOpts, feedId [][32]byte) (*ChannelVerifierFeedDeactivatedIterator, error) { - - var feedIdRule []interface{} - for _, feedIdItem := range feedId { - feedIdRule = append(feedIdRule, feedIdItem) - } - - logs, sub, err := _ChannelVerifier.contract.FilterLogs(opts, "FeedDeactivated", feedIdRule) - if err != nil { - return nil, err - } - return &ChannelVerifierFeedDeactivatedIterator{contract: _ChannelVerifier.contract, event: "FeedDeactivated", logs: logs, sub: sub}, nil -} - -func (_ChannelVerifier *ChannelVerifierFilterer) WatchFeedDeactivated(opts *bind.WatchOpts, sink chan<- *ChannelVerifierFeedDeactivated, feedId [][32]byte) (event.Subscription, error) { - - var feedIdRule []interface{} - for _, feedIdItem := range feedId { - feedIdRule = append(feedIdRule, feedIdItem) - } - - logs, sub, err := _ChannelVerifier.contract.WatchLogs(opts, "FeedDeactivated", feedIdRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - - event := new(ChannelVerifierFeedDeactivated) - if err := _ChannelVerifier.contract.UnpackLog(event, "FeedDeactivated", 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 -} - -func (_ChannelVerifier *ChannelVerifierFilterer) ParseFeedDeactivated(log types.Log) (*ChannelVerifierFeedDeactivated, error) { - event := new(ChannelVerifierFeedDeactivated) - if err := _ChannelVerifier.contract.UnpackLog(event, "FeedDeactivated", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -type ChannelVerifierOwnershipTransferRequestedIterator struct { - Event *ChannelVerifierOwnershipTransferRequested - - contract *bind.BoundContract - event string - - logs chan types.Log - sub ethereum.Subscription - done bool - fail error -} - -func (it *ChannelVerifierOwnershipTransferRequestedIterator) Next() bool { - - if it.fail != nil { - return false - } - - if it.done { - select { - case log := <-it.logs: - it.Event = new(ChannelVerifierOwnershipTransferRequested) - 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 - } - } - - select { - case log := <-it.logs: - it.Event = new(ChannelVerifierOwnershipTransferRequested) - 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() - } -} - -func (it *ChannelVerifierOwnershipTransferRequestedIterator) Error() error { - return it.fail -} - -func (it *ChannelVerifierOwnershipTransferRequestedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -type ChannelVerifierOwnershipTransferRequested struct { - From common.Address - To common.Address - Raw types.Log -} - -func (_ChannelVerifier *ChannelVerifierFilterer) FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*ChannelVerifierOwnershipTransferRequestedIterator, error) { - - var fromRule []interface{} - for _, fromItem := range from { - fromRule = append(fromRule, fromItem) - } - var toRule []interface{} - for _, toItem := range to { - toRule = append(toRule, toItem) - } - - logs, sub, err := _ChannelVerifier.contract.FilterLogs(opts, "OwnershipTransferRequested", fromRule, toRule) - if err != nil { - return nil, err - } - return &ChannelVerifierOwnershipTransferRequestedIterator{contract: _ChannelVerifier.contract, event: "OwnershipTransferRequested", logs: logs, sub: sub}, nil -} - -func (_ChannelVerifier *ChannelVerifierFilterer) WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *ChannelVerifierOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) { - - var fromRule []interface{} - for _, fromItem := range from { - fromRule = append(fromRule, fromItem) - } - var toRule []interface{} - for _, toItem := range to { - toRule = append(toRule, toItem) - } - - logs, sub, err := _ChannelVerifier.contract.WatchLogs(opts, "OwnershipTransferRequested", fromRule, toRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - - event := new(ChannelVerifierOwnershipTransferRequested) - if err := _ChannelVerifier.contract.UnpackLog(event, "OwnershipTransferRequested", 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 -} - -func (_ChannelVerifier *ChannelVerifierFilterer) ParseOwnershipTransferRequested(log types.Log) (*ChannelVerifierOwnershipTransferRequested, error) { - event := new(ChannelVerifierOwnershipTransferRequested) - if err := _ChannelVerifier.contract.UnpackLog(event, "OwnershipTransferRequested", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -type ChannelVerifierOwnershipTransferredIterator struct { - Event *ChannelVerifierOwnershipTransferred - - contract *bind.BoundContract - event string - - logs chan types.Log - sub ethereum.Subscription - done bool - fail error -} - -func (it *ChannelVerifierOwnershipTransferredIterator) Next() bool { - - if it.fail != nil { - return false - } - - if it.done { - select { - case log := <-it.logs: - it.Event = new(ChannelVerifierOwnershipTransferred) - 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 - } - } - - select { - case log := <-it.logs: - it.Event = new(ChannelVerifierOwnershipTransferred) - 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() - } -} - -func (it *ChannelVerifierOwnershipTransferredIterator) Error() error { - return it.fail -} - -func (it *ChannelVerifierOwnershipTransferredIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -type ChannelVerifierOwnershipTransferred struct { - From common.Address - To common.Address - Raw types.Log -} - -func (_ChannelVerifier *ChannelVerifierFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*ChannelVerifierOwnershipTransferredIterator, error) { - - var fromRule []interface{} - for _, fromItem := range from { - fromRule = append(fromRule, fromItem) - } - var toRule []interface{} - for _, toItem := range to { - toRule = append(toRule, toItem) - } - - logs, sub, err := _ChannelVerifier.contract.FilterLogs(opts, "OwnershipTransferred", fromRule, toRule) - if err != nil { - return nil, err - } - return &ChannelVerifierOwnershipTransferredIterator{contract: _ChannelVerifier.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil -} - -func (_ChannelVerifier *ChannelVerifierFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *ChannelVerifierOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) { - - var fromRule []interface{} - for _, fromItem := range from { - fromRule = append(fromRule, fromItem) - } - var toRule []interface{} - for _, toItem := range to { - toRule = append(toRule, toItem) - } - - logs, sub, err := _ChannelVerifier.contract.WatchLogs(opts, "OwnershipTransferred", fromRule, toRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - - event := new(ChannelVerifierOwnershipTransferred) - if err := _ChannelVerifier.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 -} - -func (_ChannelVerifier *ChannelVerifierFilterer) ParseOwnershipTransferred(log types.Log) (*ChannelVerifierOwnershipTransferred, error) { - event := new(ChannelVerifierOwnershipTransferred) - if err := _ChannelVerifier.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -type ChannelVerifierReportVerifiedIterator struct { - Event *ChannelVerifierReportVerified - - contract *bind.BoundContract - event string - - logs chan types.Log - sub ethereum.Subscription - done bool - fail error -} - -func (it *ChannelVerifierReportVerifiedIterator) Next() bool { - - if it.fail != nil { - return false - } - - if it.done { - select { - case log := <-it.logs: - it.Event = new(ChannelVerifierReportVerified) - 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 - } - } - - select { - case log := <-it.logs: - it.Event = new(ChannelVerifierReportVerified) - 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() - } -} - -func (it *ChannelVerifierReportVerifiedIterator) Error() error { - return it.fail -} - -func (it *ChannelVerifierReportVerifiedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -type ChannelVerifierReportVerified struct { - FeedId [32]byte - Requester common.Address - Raw types.Log -} - -func (_ChannelVerifier *ChannelVerifierFilterer) FilterReportVerified(opts *bind.FilterOpts, feedId [][32]byte) (*ChannelVerifierReportVerifiedIterator, error) { - - var feedIdRule []interface{} - for _, feedIdItem := range feedId { - feedIdRule = append(feedIdRule, feedIdItem) - } - - logs, sub, err := _ChannelVerifier.contract.FilterLogs(opts, "ReportVerified", feedIdRule) - if err != nil { - return nil, err - } - return &ChannelVerifierReportVerifiedIterator{contract: _ChannelVerifier.contract, event: "ReportVerified", logs: logs, sub: sub}, nil -} - -func (_ChannelVerifier *ChannelVerifierFilterer) WatchReportVerified(opts *bind.WatchOpts, sink chan<- *ChannelVerifierReportVerified, feedId [][32]byte) (event.Subscription, error) { - - var feedIdRule []interface{} - for _, feedIdItem := range feedId { - feedIdRule = append(feedIdRule, feedIdItem) - } - - logs, sub, err := _ChannelVerifier.contract.WatchLogs(opts, "ReportVerified", feedIdRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - - event := new(ChannelVerifierReportVerified) - if err := _ChannelVerifier.contract.UnpackLog(event, "ReportVerified", 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 -} - -func (_ChannelVerifier *ChannelVerifierFilterer) ParseReportVerified(log types.Log) (*ChannelVerifierReportVerified, error) { - event := new(ChannelVerifierReportVerified) - if err := _ChannelVerifier.contract.UnpackLog(event, "ReportVerified", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -type LatestConfigDetails struct { - ConfigCount uint32 - BlockNumber uint32 - ConfigDigest [32]byte -} -type LatestConfigDigestAndEpoch struct { - ScanLogs bool - ConfigDigest [32]byte - Epoch uint32 -} - -func (_ChannelVerifier *ChannelVerifier) ParseLog(log types.Log) (generated.AbigenLog, error) { - switch log.Topics[0] { - case _ChannelVerifier.abi.Events["ConfigActivated"].ID: - return _ChannelVerifier.ParseConfigActivated(log) - case _ChannelVerifier.abi.Events["ConfigDeactivated"].ID: - return _ChannelVerifier.ParseConfigDeactivated(log) - case _ChannelVerifier.abi.Events["ConfigSet"].ID: - return _ChannelVerifier.ParseConfigSet(log) - case _ChannelVerifier.abi.Events["FeedActivated"].ID: - return _ChannelVerifier.ParseFeedActivated(log) - case _ChannelVerifier.abi.Events["FeedDeactivated"].ID: - return _ChannelVerifier.ParseFeedDeactivated(log) - case _ChannelVerifier.abi.Events["OwnershipTransferRequested"].ID: - return _ChannelVerifier.ParseOwnershipTransferRequested(log) - case _ChannelVerifier.abi.Events["OwnershipTransferred"].ID: - return _ChannelVerifier.ParseOwnershipTransferred(log) - case _ChannelVerifier.abi.Events["ReportVerified"].ID: - return _ChannelVerifier.ParseReportVerified(log) - - default: - return nil, fmt.Errorf("abigen wrapper received unknown log topic: %v", log.Topics[0]) - } -} - -func (ChannelVerifierConfigActivated) Topic() common.Hash { - return common.HexToHash("0xa543797a0501218bba8a3daf75a71c8df8d1a7f791f4e44d40e43b6450183cea") -} - -func (ChannelVerifierConfigDeactivated) Topic() common.Hash { - return common.HexToHash("0x5bfaab86edc1b932e3c334327a591c9ded067cb521abae19b95ca927d6076579") -} - -func (ChannelVerifierConfigSet) Topic() common.Hash { - return common.HexToHash("0x1074b4b9a073f79bd1f7f5c808348125ce0f25c27188df7efcaa7a08276051b3") -} - -func (ChannelVerifierFeedActivated) Topic() common.Hash { - return common.HexToHash("0xf438564f793525caa89c6e3a26d41e16aa39d1e589747595751e3f3df75cb2b4") -} - -func (ChannelVerifierFeedDeactivated) Topic() common.Hash { - return common.HexToHash("0xfc4f79b8c65b6be1773063461984c0974400d1e99654c79477a092ace83fd061") -} - -func (ChannelVerifierOwnershipTransferRequested) Topic() common.Hash { - return common.HexToHash("0xed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae1278") -} - -func (ChannelVerifierOwnershipTransferred) Topic() common.Hash { - return common.HexToHash("0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0") -} - -func (ChannelVerifierReportVerified) Topic() common.Hash { - return common.HexToHash("0x58ca9502e98a536e06e72d680fcc251e5d10b72291a281665a2c2dc0ac30fcc5") -} - -func (_ChannelVerifier *ChannelVerifier) Address() common.Address { - return _ChannelVerifier.address -} - -type ChannelVerifierInterface interface { - LatestConfigDetails(opts *bind.CallOpts) (LatestConfigDetails, - - error) - - LatestConfigDigestAndEpoch(opts *bind.CallOpts) (LatestConfigDigestAndEpoch, - - error) - - Owner(opts *bind.CallOpts) (common.Address, error) - - SupportsInterface(opts *bind.CallOpts, interfaceId [4]byte) (bool, error) - - TypeAndVersion(opts *bind.CallOpts) (string, error) - - AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) - - ActivateConfig(opts *bind.TransactOpts, configDigest [32]byte) (*types.Transaction, error) - - ActivateFeed(opts *bind.TransactOpts, feedId [32]byte) (*types.Transaction, error) - - DeactivateConfig(opts *bind.TransactOpts, configDigest [32]byte) (*types.Transaction, error) - - DeactivateFeed(opts *bind.TransactOpts, feedId [32]byte) (*types.Transaction, error) - - SetConfig(opts *bind.TransactOpts, signers []common.Address, offchainTransmitters [][32]byte, f uint8, onchainConfig []byte, offchainConfigVersion uint64, offchainConfig []byte, recipientAddressesAndWeights []CommonAddressAndWeight) (*types.Transaction, error) - - SetConfigFromSource(opts *bind.TransactOpts, sourceChainId *big.Int, sourceAddress common.Address, newConfigCount uint32, signers []common.Address, offchainTransmitters [][32]byte, f uint8, onchainConfig []byte, offchainConfigVersion uint64, offchainConfig []byte, recipientAddressesAndWeights []CommonAddressAndWeight) (*types.Transaction, error) - - TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) - - Verify(opts *bind.TransactOpts, signedReport []byte, sender common.Address) (*types.Transaction, error) - - FilterConfigActivated(opts *bind.FilterOpts) (*ChannelVerifierConfigActivatedIterator, error) - - WatchConfigActivated(opts *bind.WatchOpts, sink chan<- *ChannelVerifierConfigActivated) (event.Subscription, error) - - ParseConfigActivated(log types.Log) (*ChannelVerifierConfigActivated, error) - - FilterConfigDeactivated(opts *bind.FilterOpts) (*ChannelVerifierConfigDeactivatedIterator, error) - - WatchConfigDeactivated(opts *bind.WatchOpts, sink chan<- *ChannelVerifierConfigDeactivated) (event.Subscription, error) - - ParseConfigDeactivated(log types.Log) (*ChannelVerifierConfigDeactivated, error) - - FilterConfigSet(opts *bind.FilterOpts) (*ChannelVerifierConfigSetIterator, error) - - WatchConfigSet(opts *bind.WatchOpts, sink chan<- *ChannelVerifierConfigSet) (event.Subscription, error) - - ParseConfigSet(log types.Log) (*ChannelVerifierConfigSet, error) - - FilterFeedActivated(opts *bind.FilterOpts, feedId [][32]byte) (*ChannelVerifierFeedActivatedIterator, error) - - WatchFeedActivated(opts *bind.WatchOpts, sink chan<- *ChannelVerifierFeedActivated, feedId [][32]byte) (event.Subscription, error) - - ParseFeedActivated(log types.Log) (*ChannelVerifierFeedActivated, error) - - FilterFeedDeactivated(opts *bind.FilterOpts, feedId [][32]byte) (*ChannelVerifierFeedDeactivatedIterator, error) - - WatchFeedDeactivated(opts *bind.WatchOpts, sink chan<- *ChannelVerifierFeedDeactivated, feedId [][32]byte) (event.Subscription, error) - - ParseFeedDeactivated(log types.Log) (*ChannelVerifierFeedDeactivated, error) - - FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*ChannelVerifierOwnershipTransferRequestedIterator, error) - - WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *ChannelVerifierOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) - - ParseOwnershipTransferRequested(log types.Log) (*ChannelVerifierOwnershipTransferRequested, error) - - FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*ChannelVerifierOwnershipTransferredIterator, error) - - WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *ChannelVerifierOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) - - ParseOwnershipTransferred(log types.Log) (*ChannelVerifierOwnershipTransferred, error) - - FilterReportVerified(opts *bind.FilterOpts, feedId [][32]byte) (*ChannelVerifierReportVerifiedIterator, error) - - WatchReportVerified(opts *bind.WatchOpts, sink chan<- *ChannelVerifierReportVerified, feedId [][32]byte) (event.Subscription, error) - - ParseReportVerified(log types.Log) (*ChannelVerifierReportVerified, error) - - ParseLog(log types.Log) (generated.AbigenLog, error) - - Address() common.Address -} diff --git a/core/gethwrappers/llo-feeds/generated/configurator/configurator.go b/core/gethwrappers/llo-feeds/generated/configurator/configurator.go new file mode 100644 index 00000000000..3e6f1c7e2d6 --- /dev/null +++ b/core/gethwrappers/llo-feeds/generated/configurator/configurator.go @@ -0,0 +1,748 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package configurator + +import ( + "errors" + "fmt" + "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" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" +) + +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +var ConfiguratorMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"numSigners\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxSigners\",\"type\":\"uint256\"}],\"name\":\"ExcessSigners\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FaultToleranceMustBePositive\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"numSigners\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"minSigners\",\"type\":\"uint256\"}],\"name\":\"InsufficientSigners\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"configId\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"previousConfigBlockNumber\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"configCount\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"signers\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"bytes32[]\",\"name\":\"offchainTransmitters\",\"type\":\"bytes32[]\"},{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"f\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"onchainConfig\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"offchainConfigVersion\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"offchainConfig\",\"type\":\"bytes\"}],\"name\":\"ConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"donId\",\"type\":\"bytes32\"},{\"internalType\":\"address[]\",\"name\":\"signers\",\"type\":\"address[]\"},{\"internalType\":\"bytes32[]\",\"name\":\"offchainTransmitters\",\"type\":\"bytes32[]\"},{\"internalType\":\"uint8\",\"name\":\"f\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"onchainConfig\",\"type\":\"bytes\"},{\"internalType\":\"uint64\",\"name\":\"offchainConfigVersion\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"offchainConfig\",\"type\":\"bytes\"}],\"name\":\"setConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"isVerifier\",\"type\":\"bool\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"pure\",\"type\":\"function\"}]", + Bin: "0x608060405234801561001057600080fd5b5033806000816100675760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615610097576100978161009f565b505050610148565b336001600160a01b038216036100f75760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640161005e565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b610d21806101576000396000f3fe608060405234801561001057600080fd5b50600436106100725760003560e01c806379ba50971161005057806379ba5097146101355780638da5cb5b1461013d578063f2fde38b1461016557600080fd5b806301ffc9a714610077578063181f5a77146100e157806344a0b2ad14610120575b600080fd5b6100cc6100853660046106c9565b7fffffffff00000000000000000000000000000000000000000000000000000000167f44a0b2ad000000000000000000000000000000000000000000000000000000001490565b60405190151581526020015b60405180910390f35b604080518082018252601281527f436f6e666967757261746f7220302e342e300000000000000000000000000000602082015290516100d89190610776565b61013361012e3660046109d8565b610178565b005b610133610289565b60005460405173ffffffffffffffffffffffffffffffffffffffff90911681526020016100d8565b610133610173366004610ab0565b610386565b85518460ff16806000036101b8576040517f0743bae600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b601f821115610202576040517f61750f4000000000000000000000000000000000000000000000000000000000815260048101839052601f60248201526044015b60405180910390fd5b61020d816003610afa565b8211610265578161021f826003610afa565b61022a906001610b17565b6040517f9dd9e6d8000000000000000000000000000000000000000000000000000000008152600481019290925260248201526044016101f9565b61026d61039a565b61027e8946308b8b8b8b8b8b61041d565b505050505050505050565b60015473ffffffffffffffffffffffffffffffffffffffff16331461030a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e65720000000000000000000060448201526064016101f9565b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b61038e61039a565b61039781610526565b50565b60005473ffffffffffffffffffffffffffffffffffffffff16331461041b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e65720000000000000000000060448201526064016101f9565b565b60008981526002602052604081208054909190829082906104479067ffffffffffffffff16610b2a565b91906101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055905060006104828c8c8c858d8d8d8d8d8d61061b565b90508b7fa23a88453230b183877098801ff5a8f771a120e2573eea559ce6c4c2e305a4da8460000160089054906101000a900463ffffffff1683858d8d8d8d8d8d6040516104d899989796959493929190610bd2565b60405180910390a2505080547fffffffffffffffffffffffffffffffffffffffff00000000ffffffffffffffff16680100000000000000004363ffffffff1602179055505050505050505050565b3373ffffffffffffffffffffffffffffffffffffffff8216036105a5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c6600000000000000000060448201526064016101f9565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b6000808b8b8b8b8b8b8b8b8b8b6040516020016106419a99989796959493929190610c67565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815291905280516020909101207dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167e09000000000000000000000000000000000000000000000000000000000000179150509a9950505050505050505050565b6000602082840312156106db57600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461070b57600080fd5b9392505050565b6000815180845260005b818110156107385760208185018101518683018201520161071c565b5060006020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b60208152600061070b6020830184610712565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff811182821017156107ff576107ff610789565b604052919050565b600067ffffffffffffffff82111561082157610821610789565b5060051b60200190565b803573ffffffffffffffffffffffffffffffffffffffff8116811461084f57600080fd5b919050565b600082601f83011261086557600080fd5b8135602061087a61087583610807565b6107b8565b82815260059290921b8401810191818101908684111561089957600080fd5b8286015b848110156108bb576108ae8161082b565b835291830191830161089d565b509695505050505050565b600082601f8301126108d757600080fd5b813560206108e761087583610807565b82815260059290921b8401810191818101908684111561090657600080fd5b8286015b848110156108bb578035835291830191830161090a565b803560ff8116811461084f57600080fd5b600082601f83011261094357600080fd5b813567ffffffffffffffff81111561095d5761095d610789565b61098e60207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116016107b8565b8181528460208386010111156109a357600080fd5b816020850160208301376000918101602001919091529392505050565b803567ffffffffffffffff8116811461084f57600080fd5b600080600080600080600060e0888a0312156109f357600080fd5b87359650602088013567ffffffffffffffff80821115610a1257600080fd5b610a1e8b838c01610854565b975060408a0135915080821115610a3457600080fd5b610a408b838c016108c6565b9650610a4e60608b01610921565b955060808a0135915080821115610a6457600080fd5b610a708b838c01610932565b9450610a7e60a08b016109c0565b935060c08a0135915080821115610a9457600080fd5b50610aa18a828b01610932565b91505092959891949750929550565b600060208284031215610ac257600080fd5b61070b8261082b565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8082028115828204841417610b1157610b11610acb565b92915050565b80820180821115610b1157610b11610acb565b600067ffffffffffffffff808316818103610b4757610b47610acb565b6001019392505050565b600081518084526020808501945080840160005b83811015610b9757815173ffffffffffffffffffffffffffffffffffffffff1687529582019590820190600101610b65565b509495945050505050565b600081518084526020808501945080840160005b83811015610b9757815187529582019590820190600101610bb6565b600061012063ffffffff8c1683528a602084015267ffffffffffffffff808b166040850152816060850152610c098285018b610b51565b91508382036080850152610c1d828a610ba2565b915060ff881660a085015283820360c0850152610c3a8288610712565b90861660e08501528381036101008501529050610c578185610712565b9c9b505050505050505050505050565b60006101408c83528b602084015273ffffffffffffffffffffffffffffffffffffffff8b16604084015267ffffffffffffffff808b166060850152816080850152610cb48285018b610b51565b915083820360a0850152610cc8828a610ba2565b915060ff881660c085015283820360e0850152610ce58288610712565b9086166101008501528381036101208501529050610d038185610712565b9d9c5050505050505050505050505056fea164736f6c6343000813000a", +} + +var ConfiguratorABI = ConfiguratorMetaData.ABI + +var ConfiguratorBin = ConfiguratorMetaData.Bin + +func DeployConfigurator(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *Configurator, error) { + parsed, err := ConfiguratorMetaData.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(ConfiguratorBin), backend) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &Configurator{address: address, abi: *parsed, ConfiguratorCaller: ConfiguratorCaller{contract: contract}, ConfiguratorTransactor: ConfiguratorTransactor{contract: contract}, ConfiguratorFilterer: ConfiguratorFilterer{contract: contract}}, nil +} + +type Configurator struct { + address common.Address + abi abi.ABI + ConfiguratorCaller + ConfiguratorTransactor + ConfiguratorFilterer +} + +type ConfiguratorCaller struct { + contract *bind.BoundContract +} + +type ConfiguratorTransactor struct { + contract *bind.BoundContract +} + +type ConfiguratorFilterer struct { + contract *bind.BoundContract +} + +type ConfiguratorSession struct { + Contract *Configurator + CallOpts bind.CallOpts + TransactOpts bind.TransactOpts +} + +type ConfiguratorCallerSession struct { + Contract *ConfiguratorCaller + CallOpts bind.CallOpts +} + +type ConfiguratorTransactorSession struct { + Contract *ConfiguratorTransactor + TransactOpts bind.TransactOpts +} + +type ConfiguratorRaw struct { + Contract *Configurator +} + +type ConfiguratorCallerRaw struct { + Contract *ConfiguratorCaller +} + +type ConfiguratorTransactorRaw struct { + Contract *ConfiguratorTransactor +} + +func NewConfigurator(address common.Address, backend bind.ContractBackend) (*Configurator, error) { + abi, err := abi.JSON(strings.NewReader(ConfiguratorABI)) + if err != nil { + return nil, err + } + contract, err := bindConfigurator(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &Configurator{address: address, abi: abi, ConfiguratorCaller: ConfiguratorCaller{contract: contract}, ConfiguratorTransactor: ConfiguratorTransactor{contract: contract}, ConfiguratorFilterer: ConfiguratorFilterer{contract: contract}}, nil +} + +func NewConfiguratorCaller(address common.Address, caller bind.ContractCaller) (*ConfiguratorCaller, error) { + contract, err := bindConfigurator(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &ConfiguratorCaller{contract: contract}, nil +} + +func NewConfiguratorTransactor(address common.Address, transactor bind.ContractTransactor) (*ConfiguratorTransactor, error) { + contract, err := bindConfigurator(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &ConfiguratorTransactor{contract: contract}, nil +} + +func NewConfiguratorFilterer(address common.Address, filterer bind.ContractFilterer) (*ConfiguratorFilterer, error) { + contract, err := bindConfigurator(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &ConfiguratorFilterer{contract: contract}, nil +} + +func bindConfigurator(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := ConfiguratorMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +func (_Configurator *ConfiguratorRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _Configurator.Contract.ConfiguratorCaller.contract.Call(opts, result, method, params...) +} + +func (_Configurator *ConfiguratorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Configurator.Contract.ConfiguratorTransactor.contract.Transfer(opts) +} + +func (_Configurator *ConfiguratorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _Configurator.Contract.ConfiguratorTransactor.contract.Transact(opts, method, params...) +} + +func (_Configurator *ConfiguratorCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _Configurator.Contract.contract.Call(opts, result, method, params...) +} + +func (_Configurator *ConfiguratorTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Configurator.Contract.contract.Transfer(opts) +} + +func (_Configurator *ConfiguratorTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _Configurator.Contract.contract.Transact(opts, method, params...) +} + +func (_Configurator *ConfiguratorCaller) Owner(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _Configurator.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 + +} + +func (_Configurator *ConfiguratorSession) Owner() (common.Address, error) { + return _Configurator.Contract.Owner(&_Configurator.CallOpts) +} + +func (_Configurator *ConfiguratorCallerSession) Owner() (common.Address, error) { + return _Configurator.Contract.Owner(&_Configurator.CallOpts) +} + +func (_Configurator *ConfiguratorCaller) SupportsInterface(opts *bind.CallOpts, interfaceId [4]byte) (bool, error) { + var out []interface{} + err := _Configurator.contract.Call(opts, &out, "supportsInterface", interfaceId) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_Configurator *ConfiguratorSession) SupportsInterface(interfaceId [4]byte) (bool, error) { + return _Configurator.Contract.SupportsInterface(&_Configurator.CallOpts, interfaceId) +} + +func (_Configurator *ConfiguratorCallerSession) SupportsInterface(interfaceId [4]byte) (bool, error) { + return _Configurator.Contract.SupportsInterface(&_Configurator.CallOpts, interfaceId) +} + +func (_Configurator *ConfiguratorCaller) TypeAndVersion(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _Configurator.contract.Call(opts, &out, "typeAndVersion") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +func (_Configurator *ConfiguratorSession) TypeAndVersion() (string, error) { + return _Configurator.Contract.TypeAndVersion(&_Configurator.CallOpts) +} + +func (_Configurator *ConfiguratorCallerSession) TypeAndVersion() (string, error) { + return _Configurator.Contract.TypeAndVersion(&_Configurator.CallOpts) +} + +func (_Configurator *ConfiguratorTransactor) AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Configurator.contract.Transact(opts, "acceptOwnership") +} + +func (_Configurator *ConfiguratorSession) AcceptOwnership() (*types.Transaction, error) { + return _Configurator.Contract.AcceptOwnership(&_Configurator.TransactOpts) +} + +func (_Configurator *ConfiguratorTransactorSession) AcceptOwnership() (*types.Transaction, error) { + return _Configurator.Contract.AcceptOwnership(&_Configurator.TransactOpts) +} + +func (_Configurator *ConfiguratorTransactor) SetConfig(opts *bind.TransactOpts, donId [32]byte, signers []common.Address, offchainTransmitters [][32]byte, f uint8, onchainConfig []byte, offchainConfigVersion uint64, offchainConfig []byte) (*types.Transaction, error) { + return _Configurator.contract.Transact(opts, "setConfig", donId, signers, offchainTransmitters, f, onchainConfig, offchainConfigVersion, offchainConfig) +} + +func (_Configurator *ConfiguratorSession) SetConfig(donId [32]byte, signers []common.Address, offchainTransmitters [][32]byte, f uint8, onchainConfig []byte, offchainConfigVersion uint64, offchainConfig []byte) (*types.Transaction, error) { + return _Configurator.Contract.SetConfig(&_Configurator.TransactOpts, donId, signers, offchainTransmitters, f, onchainConfig, offchainConfigVersion, offchainConfig) +} + +func (_Configurator *ConfiguratorTransactorSession) SetConfig(donId [32]byte, signers []common.Address, offchainTransmitters [][32]byte, f uint8, onchainConfig []byte, offchainConfigVersion uint64, offchainConfig []byte) (*types.Transaction, error) { + return _Configurator.Contract.SetConfig(&_Configurator.TransactOpts, donId, signers, offchainTransmitters, f, onchainConfig, offchainConfigVersion, offchainConfig) +} + +func (_Configurator *ConfiguratorTransactor) TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) { + return _Configurator.contract.Transact(opts, "transferOwnership", to) +} + +func (_Configurator *ConfiguratorSession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _Configurator.Contract.TransferOwnership(&_Configurator.TransactOpts, to) +} + +func (_Configurator *ConfiguratorTransactorSession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _Configurator.Contract.TransferOwnership(&_Configurator.TransactOpts, to) +} + +type ConfiguratorConfigSetIterator struct { + Event *ConfiguratorConfigSet + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *ConfiguratorConfigSetIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(ConfiguratorConfigSet) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(ConfiguratorConfigSet) + 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() + } +} + +func (it *ConfiguratorConfigSetIterator) Error() error { + return it.fail +} + +func (it *ConfiguratorConfigSetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type ConfiguratorConfigSet struct { + ConfigId [32]byte + PreviousConfigBlockNumber uint32 + ConfigDigest [32]byte + ConfigCount uint64 + Signers []common.Address + OffchainTransmitters [][32]byte + F uint8 + OnchainConfig []byte + OffchainConfigVersion uint64 + OffchainConfig []byte + Raw types.Log +} + +func (_Configurator *ConfiguratorFilterer) FilterConfigSet(opts *bind.FilterOpts, configId [][32]byte) (*ConfiguratorConfigSetIterator, error) { + + var configIdRule []interface{} + for _, configIdItem := range configId { + configIdRule = append(configIdRule, configIdItem) + } + + logs, sub, err := _Configurator.contract.FilterLogs(opts, "ConfigSet", configIdRule) + if err != nil { + return nil, err + } + return &ConfiguratorConfigSetIterator{contract: _Configurator.contract, event: "ConfigSet", logs: logs, sub: sub}, nil +} + +func (_Configurator *ConfiguratorFilterer) WatchConfigSet(opts *bind.WatchOpts, sink chan<- *ConfiguratorConfigSet, configId [][32]byte) (event.Subscription, error) { + + var configIdRule []interface{} + for _, configIdItem := range configId { + configIdRule = append(configIdRule, configIdItem) + } + + logs, sub, err := _Configurator.contract.WatchLogs(opts, "ConfigSet", configIdRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(ConfiguratorConfigSet) + if err := _Configurator.contract.UnpackLog(event, "ConfigSet", 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 +} + +func (_Configurator *ConfiguratorFilterer) ParseConfigSet(log types.Log) (*ConfiguratorConfigSet, error) { + event := new(ConfiguratorConfigSet) + if err := _Configurator.contract.UnpackLog(event, "ConfigSet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type ConfiguratorOwnershipTransferRequestedIterator struct { + Event *ConfiguratorOwnershipTransferRequested + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *ConfiguratorOwnershipTransferRequestedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(ConfiguratorOwnershipTransferRequested) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(ConfiguratorOwnershipTransferRequested) + 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() + } +} + +func (it *ConfiguratorOwnershipTransferRequestedIterator) Error() error { + return it.fail +} + +func (it *ConfiguratorOwnershipTransferRequestedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type ConfiguratorOwnershipTransferRequested struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_Configurator *ConfiguratorFilterer) FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*ConfiguratorOwnershipTransferRequestedIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _Configurator.contract.FilterLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return &ConfiguratorOwnershipTransferRequestedIterator{contract: _Configurator.contract, event: "OwnershipTransferRequested", logs: logs, sub: sub}, nil +} + +func (_Configurator *ConfiguratorFilterer) WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *ConfiguratorOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _Configurator.contract.WatchLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(ConfiguratorOwnershipTransferRequested) + if err := _Configurator.contract.UnpackLog(event, "OwnershipTransferRequested", 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 +} + +func (_Configurator *ConfiguratorFilterer) ParseOwnershipTransferRequested(log types.Log) (*ConfiguratorOwnershipTransferRequested, error) { + event := new(ConfiguratorOwnershipTransferRequested) + if err := _Configurator.contract.UnpackLog(event, "OwnershipTransferRequested", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type ConfiguratorOwnershipTransferredIterator struct { + Event *ConfiguratorOwnershipTransferred + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *ConfiguratorOwnershipTransferredIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(ConfiguratorOwnershipTransferred) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(ConfiguratorOwnershipTransferred) + 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() + } +} + +func (it *ConfiguratorOwnershipTransferredIterator) Error() error { + return it.fail +} + +func (it *ConfiguratorOwnershipTransferredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type ConfiguratorOwnershipTransferred struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_Configurator *ConfiguratorFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*ConfiguratorOwnershipTransferredIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _Configurator.contract.FilterLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return &ConfiguratorOwnershipTransferredIterator{contract: _Configurator.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil +} + +func (_Configurator *ConfiguratorFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *ConfiguratorOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _Configurator.contract.WatchLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(ConfiguratorOwnershipTransferred) + if err := _Configurator.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 +} + +func (_Configurator *ConfiguratorFilterer) ParseOwnershipTransferred(log types.Log) (*ConfiguratorOwnershipTransferred, error) { + event := new(ConfiguratorOwnershipTransferred) + if err := _Configurator.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +func (_Configurator *Configurator) ParseLog(log types.Log) (generated.AbigenLog, error) { + switch log.Topics[0] { + case _Configurator.abi.Events["ConfigSet"].ID: + return _Configurator.ParseConfigSet(log) + case _Configurator.abi.Events["OwnershipTransferRequested"].ID: + return _Configurator.ParseOwnershipTransferRequested(log) + case _Configurator.abi.Events["OwnershipTransferred"].ID: + return _Configurator.ParseOwnershipTransferred(log) + + default: + return nil, fmt.Errorf("abigen wrapper received unknown log topic: %v", log.Topics[0]) + } +} + +func (ConfiguratorConfigSet) Topic() common.Hash { + return common.HexToHash("0xa23a88453230b183877098801ff5a8f771a120e2573eea559ce6c4c2e305a4da") +} + +func (ConfiguratorOwnershipTransferRequested) Topic() common.Hash { + return common.HexToHash("0xed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae1278") +} + +func (ConfiguratorOwnershipTransferred) Topic() common.Hash { + return common.HexToHash("0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0") +} + +func (_Configurator *Configurator) Address() common.Address { + return _Configurator.address +} + +type ConfiguratorInterface interface { + Owner(opts *bind.CallOpts) (common.Address, error) + + SupportsInterface(opts *bind.CallOpts, interfaceId [4]byte) (bool, error) + + TypeAndVersion(opts *bind.CallOpts) (string, error) + + AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) + + SetConfig(opts *bind.TransactOpts, donId [32]byte, signers []common.Address, offchainTransmitters [][32]byte, f uint8, onchainConfig []byte, offchainConfigVersion uint64, offchainConfig []byte) (*types.Transaction, error) + + TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) + + FilterConfigSet(opts *bind.FilterOpts, configId [][32]byte) (*ConfiguratorConfigSetIterator, error) + + WatchConfigSet(opts *bind.WatchOpts, sink chan<- *ConfiguratorConfigSet, configId [][32]byte) (event.Subscription, error) + + ParseConfigSet(log types.Log) (*ConfiguratorConfigSet, error) + + FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*ConfiguratorOwnershipTransferRequestedIterator, error) + + WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *ConfiguratorOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferRequested(log types.Log) (*ConfiguratorOwnershipTransferRequested, error) + + FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*ConfiguratorOwnershipTransferredIterator, error) + + WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *ConfiguratorOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferred(log types.Log) (*ConfiguratorOwnershipTransferred, error) + + ParseLog(log types.Log) (generated.AbigenLog, error) + + Address() common.Address +} diff --git a/core/gethwrappers/llo-feeds/generated/destination_fee_manager/destination_fee_manager.go b/core/gethwrappers/llo-feeds/generated/destination_fee_manager/destination_fee_manager.go new file mode 100644 index 00000000000..fc9cda0b3d0 --- /dev/null +++ b/core/gethwrappers/llo-feeds/generated/destination_fee_manager/destination_fee_manager.go @@ -0,0 +1,1828 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package destination_fee_manager + +import ( + "errors" + "fmt" + "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" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" +) + +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +type CommonAddressAndWeight struct { + Addr common.Address + Weight uint64 +} + +type CommonAsset struct { + AssetAddress common.Address + Amount *big.Int +} + +type IDestinationRewardManagerFeePayment struct { + PoolId [32]byte + Amount *big.Int +} + +var DestinationFeeManagerMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_linkAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_nativeAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_verifierAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_rewardManagerAddress\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"ExpiredReport\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidAddress\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidDeposit\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidDiscount\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidQuote\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidReceivingAddress\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidSurcharge\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"PoolIdMismatch\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Unauthorized\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroDeficit\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"subscriber\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"assetAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"indexed\":false,\"internalType\":\"structCommon.Asset\",\"name\":\"fee\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"assetAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"indexed\":false,\"internalType\":\"structCommon.Asset\",\"name\":\"reward\",\"type\":\"tuple\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"appliedDiscount\",\"type\":\"uint256\"}],\"name\":\"DiscountApplied\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"poolId\",\"type\":\"bytes32\"},{\"internalType\":\"uint192\",\"name\":\"amount\",\"type\":\"uint192\"}],\"indexed\":false,\"internalType\":\"structIDestinationRewardManager.FeePayment[]\",\"name\":\"rewards\",\"type\":\"tuple[]\"}],\"name\":\"InsufficientLink\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"linkQuantity\",\"type\":\"uint256\"}],\"name\":\"LinkDeficitCleared\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"newSurcharge\",\"type\":\"uint64\"}],\"name\":\"NativeSurchargeUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"subscriber\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"feedId\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"discount\",\"type\":\"uint64\"}],\"name\":\"SubscriberDiscountUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"adminAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"assetAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint192\",\"name\":\"quantity\",\"type\":\"uint192\"}],\"name\":\"Withdraw\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"verifierAddress\",\"type\":\"address\"}],\"name\":\"addVerifier\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"subscriber\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"report\",\"type\":\"bytes\"},{\"internalType\":\"address\",\"name\":\"quoteAddress\",\"type\":\"address\"}],\"name\":\"getFeeAndReward\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"assetAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"internalType\":\"structCommon.Asset\",\"name\":\"\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"assetAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"internalType\":\"structCommon.Asset\",\"name\":\"\",\"type\":\"tuple\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"i_linkAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"i_nativeAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"i_rewardManager\",\"outputs\":[{\"internalType\":\"contractIDestinationRewardManager\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"linkAvailableForPayment\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"}],\"name\":\"payLinkDeficit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"recipient\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"payload\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"parameterPayload\",\"type\":\"bytes\"},{\"internalType\":\"address\",\"name\":\"subscriber\",\"type\":\"address\"}],\"name\":\"processFee\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32[]\",\"name\":\"poolIds\",\"type\":\"bytes32[]\"},{\"internalType\":\"bytes[]\",\"name\":\"payloads\",\"type\":\"bytes[]\"},{\"internalType\":\"bytes\",\"name\":\"parameterPayload\",\"type\":\"bytes\"},{\"internalType\":\"address\",\"name\":\"subscriber\",\"type\":\"address\"}],\"name\":\"processFeeBulk\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"verifierAddress\",\"type\":\"address\"}],\"name\":\"removeVerifier\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"s_globalDiscounts\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"s_linkDeficit\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_nativeSurcharge\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"s_subscriberDiscounts\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"s_verifierAddressList\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"weight\",\"type\":\"uint64\"}],\"internalType\":\"structCommon.AddressAndWeight[]\",\"name\":\"rewardRecipientAndWeights\",\"type\":\"tuple[]\"}],\"name\":\"setFeeRecipients\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"surcharge\",\"type\":\"uint64\"}],\"name\":\"setNativeSurcharge\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"rewardManagerAddress\",\"type\":\"address\"}],\"name\":\"setRewardManager\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"subscriber\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"feedId\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"discount\",\"type\":\"uint64\"}],\"name\":\"updateSubscriberDiscount\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"subscriber\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"discount\",\"type\":\"uint64\"}],\"name\":\"updateSubscriberGlobalDiscount\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"assetAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint192\",\"name\":\"quantity\",\"type\":\"uint192\"}],\"name\":\"withdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", + Bin: "0x60c06040523480156200001157600080fd5b5060405162003d4538038062003d458339810160408190526200003491620002ae565b33806000816200008b5760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000be57620000be81620001e6565b5050506001600160a01b0384161580620000df57506001600160a01b038316155b80620000f257506001600160a01b038216155b806200010557506001600160a01b038116155b15620001245760405163e6c4247b60e01b815260040160405180910390fd5b6001600160a01b03848116608081905284821660a0528382166000818152600560205260409081902080546001600160a01b03199081169093179055600680549092169385169384179091555163095ea7b360e01b8152600481019290925260001960248301529063095ea7b3906044016020604051808303816000875af1158015620001b5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001db91906200030b565b505050505062000336565b336001600160a01b03821603620002405760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640162000082565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b80516001600160a01b0381168114620002a957600080fd5b919050565b60008060008060808587031215620002c557600080fd5b620002d08562000291565b9350620002e06020860162000291565b9250620002f06040860162000291565b9150620003006060860162000291565b905092959194509250565b6000602082840312156200031e57600080fd5b815180151581146200032f57600080fd5b9392505050565b60805160a051613956620003ef6000396000818161038901528181610f3d01528181611577015281816117d50152818161182c01528181611b2a0152818161251401526125bd0152600081816105b1015281816108340152818161093e01528181610d4101528181610ee60152818161124f01528181611520015281816116b7015281816117fa0152818161188301528181611a1b01528181611a8601528181611ac60152818161218f01526126b101526139566000f3fe6080604052600436106101a15760003560e01c806379ba5097116100e1578063ce7817d11161008a578063e389d9a411610064578063e389d9a41461057f578063ea4b861b1461059f578063f2fde38b146105d3578063f65df962146105f357600080fd5b8063ce7817d1146104df578063d09dc339146104ff578063e03dab1a1461051457600080fd5b80638da5cb5b116100bb5780638da5cb5b146104745780639000b3d61461049f578063ca2dfd0a146104bf57600080fd5b806379ba50971461040e57806386968cfd1461042357806387d6d8431461043657600080fd5b806332f5f7461161014e57806350538094116101285780635053809414610357578063638786681461037757806376cf3187146103ab5780637700feeb146103cb57600080fd5b806332f5f746146102dc57806336907509146102f25780633aa5ac071461030557600080fd5b8063181f5a771161017f578063181f5a77146102385780631cc7f2d8146102845780631d4d84a2146102bc57600080fd5b8063013f542b146101a657806301ffc9a7146101e6578063153ee55414610216575b600080fd5b3480156101b257600080fd5b506101d36101c1366004612e20565b60046020526000908152604090205481565b6040519081526020015b60405180910390f35b3480156101f257600080fd5b50610206610201366004612e39565b610613565b60405190151581526020016101dd565b34801561022257600080fd5b50610236610231366004612ead565b6106ac565b005b34801561024457600080fd5b50604080518082018252601b81527f44657374696e6174696f6e4665654d616e6167657220302e342e300000000000602082015290516101dd9190612eee565b34801561029057600080fd5b506101d361029f366004612f3f565b600360209081526000928352604080842090915290825290205481565b3480156102c857600080fd5b506102366102d7366004612f9e565b6109b1565b3480156102e857600080fd5b506101d360075481565b6102366103003660046130f5565b610b45565b34801561031157600080fd5b506006546103329073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101dd565b34801561036357600080fd5b50610236610372366004613215565b610df6565b34801561038357600080fd5b506103327f000000000000000000000000000000000000000000000000000000000000000081565b3480156103b757600080fd5b506102366103c6366004613230565b610e90565b3480156103d757600080fd5b506103326103e6366004612ead565b60056020526000908152604090205473ffffffffffffffffffffffffffffffffffffffff1681565b34801561041a57600080fd5b50610236611045565b610236610431366004613277565b611147565b34801561044257600080fd5b506101d3610451366004613303565b600260209081526000938452604080852082529284528284209052825290205481565b34801561048057600080fd5b5060005473ffffffffffffffffffffffffffffffffffffffff16610332565b3480156104ab57600080fd5b506102366104ba366004612ead565b6112c8565b3480156104cb57600080fd5b506102366104da366004612ead565b6113cb565b3480156104eb57600080fd5b506102366104fa36600461333a565b6114ca565b34801561050b57600080fd5b506101d3611686565b34801561052057600080fd5b5061053461052f366004613419565b61173c565b60408051845173ffffffffffffffffffffffffffffffffffffffff9081168252602095860151868301528451169181019190915292909101516060830152608082015260a0016101dd565b34801561058b57600080fd5b5061023661059a366004612e20565b611b8c565b3480156105ab57600080fd5b506103327f000000000000000000000000000000000000000000000000000000000000000081565b3480156105df57600080fd5b506102366105ee366004612ead565b611d41565b3480156105ff57600080fd5b5061023661060e366004613472565b611d55565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f6993386f0000000000000000000000000000000000000000000000000000000014806106a657507fffffffff0000000000000000000000000000000000000000000000000000000082167f465b009600000000000000000000000000000000000000000000000000000000145b92915050565b6106b4611e43565b73ffffffffffffffffffffffffffffffffffffffff8116610701576040517fe6c4247b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f01ffc9a70000000000000000000000000000000000000000000000000000000081527f768ffd3a00000000000000000000000000000000000000000000000000000000600482015273ffffffffffffffffffffffffffffffffffffffff8216906301ffc9a790602401602060405180830381865afa15801561078b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107af91906134f1565b6107e5576040517fe6c4247b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6006546040517f095ea7b300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9182166004820152600060248201527f00000000000000000000000000000000000000000000000000000000000000009091169063095ea7b3906044016020604051808303816000875af115801561087f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108a391906134f1565b50600680547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8381169182179092556040517f095ea7b300000000000000000000000000000000000000000000000000000000815260048101919091527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60248201527f00000000000000000000000000000000000000000000000000000000000000009091169063095ea7b3906044016020604051808303816000875af1158015610989573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109ad91906134f1565b5050565b6109b9611e43565b73ffffffffffffffffffffffffffffffffffffffff8316610a8e5760008273ffffffffffffffffffffffffffffffffffffffff168277ffffffffffffffffffffffffffffffffffffffffffffffff1660405160006040518083038185875af1925050503d8060008114610a48576040519150601f19603f3d011682016040523d82523d6000602084013e610a4d565b606091505b5050905080610a88576040517fef2af20100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50505050565b610ac973ffffffffffffffffffffffffffffffffffffffff84168377ffffffffffffffffffffffffffffffffffffffffffffffff8416611ec6565b6040805133815273ffffffffffffffffffffffffffffffffffffffff848116602083015285168183015277ffffffffffffffffffffffffffffffffffffffffffffffff8316606082015290517f7ff78a71698bdb18dcca96f52ab25e0a1b146fb6a49adf8e6845299e49021f299181900360800190a15b505050565b3360008181526005602052604090205473ffffffffffffffffffffffffffffffffffffffff1614610ba2576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b85518414610bdb576040517e154a0200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008467ffffffffffffffff811115610bf657610bf6612fe9565b604051908082528060200260200182016040528015610c2f57816020015b610c1c612d93565b815260200190600190039081610c145790505b5090506000806000805b88811015610dbc576000801b8b8281518110610c5757610c57613513565b602002602001015103610c96576040517fe6c4247b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000806000610cca8d8d86818110610cb057610cb0613513565b9050602002810190610cc29190613542565b8d8d8d611f9a565b9250925092508260200151600014610da85760405180608001604052808f8681518110610cf957610cf9613513565b6020026020010151815260200184815260200183815260200182815250888680610d22906135d6565b975081518110610d3457610d34613513565b60200260200101819052507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16836000015173ffffffffffffffffffffffffffffffffffffffff1603610da157866001019650610da8565b8560010195505b50505080610db5906135d6565b9050610c39565b5082151580610dca57508115155b15610de057610ddb858585856120aa565b610dea565b610dea85346128a4565b50505050505050505050565b610dfe611e43565b670de0b6b3a764000067ffffffffffffffff82161115610e4a576040517f05e8ac2900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b67ffffffffffffffff811660078190556040519081527f08f7c0d17932ddb8523bc06754d42ff19ebc77d76a8b9bfde02c28ab1ed3d6399060200160405180910390a150565b610e98611e43565b670de0b6b3a764000067ffffffffffffffff82161115610ee4576040517f997ea36000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614158015610f8c57507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15610fc3576040517fe6c4247b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff838116600081815260036020908152604080832094871680845294825280832067ffffffffffffffff87169081905581519586529185019190915290927f5eba5a8afa39780f0f99b6cbeb95f3da6a7040ca00abd46bdc91a0a060134139910160405180910390a3505050565b60015473ffffffffffffffffffffffffffffffffffffffff1633146110cb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e65720000000000000000000060448201526064015b60405180910390fd5b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b3360008181526005602052604090205473ffffffffffffffffffffffffffffffffffffffff16146111a4576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008060006111b68888888888611f9a565b92509250925082602001516000036111da576111d284346128a4565b5050506112c0565b604080516001808252818301909252600091816020015b6111f9612d93565b8152602001906001900390816111f157905050905060405180608001604052808b8152602001858152602001848152602001838152508160008151811061124257611242613513565b60200260200101819052507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16846000015173ffffffffffffffffffffffffffffffffffffffff16036112b257610ddb8582600160006120aa565b610dea8582600060016120aa565b505050505050565b6112d0611e43565b73ffffffffffffffffffffffffffffffffffffffff811661131d576040517fe6c4247b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff818116600090815260056020526040902054161561137c576040517fe6c4247b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff16600081815260056020526040902080547fffffffffffffffffffffffff0000000000000000000000000000000000000000169091179055565b6113d3611e43565b73ffffffffffffffffffffffffffffffffffffffff8116611420576040517fe6c4247b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8181166000908152600560205260409020541661147e576040517fe6c4247b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff16600090815260056020526040902080547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055565b6114d2611e43565b670de0b6b3a764000067ffffffffffffffff8216111561151e576040517f997ea36000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141580156115c657507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156115fd576040517fe6c4247b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff848116600081815260026020908152604080832088845282528083209487168084529482529182902067ffffffffffffffff86169081905582519485529084015285927f5eba5a8afa39780f0f99b6cbeb95f3da6a7040ca00abd46bdc91a0a060134139910160405180910390a350505050565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526000907f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16906370a0823190602401602060405180830381865afa158015611713573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611737919061360e565b905090565b604080518082018252600080825260208083018290528351808501855282815280820183905284518086018652838152808301849052855180870190965283865291850183905292938261178f88613627565b90507fffff00000000000000000000000000000000000000000000000000000000000080821690810161182a57505073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000811683527f0000000000000000000000000000000000000000000000000000000000000000168152909350915060009050611b83565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff16141580156118d257507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff1614155b15611909576040517ff861803000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008060008b8060200190518101906119229190613680565b77ffffffffffffffffffffffffffffffffffffffffffffffff91821698509116955063ffffffff169350505042821015905061198a576040517fb6c405f500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff808e1660009081526002602090815260408083208984528252808320938f1683529290529081205490819003611a04575073ffffffffffffffffffffffffffffffffffffffff808e166000908152600360209081526040808320938f16835292905220545b73ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168752611a6a611a5282670de0b6b3a76400006136e6565b611a5c90866136f9565b670de0b6b3a76400006128ed565b602088015273ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000008116908d1603611af75773ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016885260208088015190890152611b74565b600754600090611b1390611a5290670de0b6b3a7640000613710565b73ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168a529050611b6d611b6383670de0b6b3a76400006136e6565b611a5c90836136f9565b60208a0152505b96995094975094955050505050505b93509350939050565b611b94611e43565b60008181526004602052604081205490819003611bdd576040517f03aad31200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000828152600460205260408082208290558051600180825281830190925290816020015b6040805180820190915260008082526020820152815260200190600190039081611c0257905050905060405180604001604052808481526020018377ffffffffffffffffffffffffffffffffffffffffffffffff1681525081600081518110611c6d57611c6d613513565b60209081029190910101526006546040517fb0d9fa1900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9091169063b0d9fa1990611cd09084903090600401613783565b600060405180830381600087803b158015611cea57600080fd5b505af1158015611cfe573d6000803e3d6000fd5b50505050827f843f0b103e50b42b08f9d30f12f961845a6d02623730872e24644899c0dd989583604051611d3491815260200190565b60405180910390a2505050565b611d49611e43565b611d5281612925565b50565b3360008181526005602052604090205473ffffffffffffffffffffffffffffffffffffffff1614611db2576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6006546040517f14060f2300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff909116906314060f2390611e0c908690869086906004016137bb565b600060405180830381600087803b158015611e2657600080fd5b505af1158015611e3a573d6000803e3d6000fd5b50505050505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314611ec4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e65720000000000000000000060448201526064016110c2565b565b60405173ffffffffffffffffffffffffffffffffffffffff8316602482015260448101829052610b409084907fa9059cbb00000000000000000000000000000000000000000000000000000000906064015b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152612a1a565b6040805180820190915260008082526020820152604080518082019091526000808252602082015260003073ffffffffffffffffffffffffffffffffffffffff851603612013576040517fe6c4247b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000612021888a018a61383b565b91505060008161203090613627565b905060007e010000000000000000000000000000000000000000000000000000000000007fffff00000000000000000000000000000000000000000000000000000000000083161461208b57612088888a018a612ead565b90505b61209687848361173c565b955095509550505050955095509592505050565b60008267ffffffffffffffff8111156120c5576120c5612fe9565b60405190808252806020026020018201604052801561210a57816020015b60408051808201909152600080825260208201528152602001906001900390816120e35790505b50905060008267ffffffffffffffff81111561212857612128612fe9565b60405190808252806020026020018201604052801561216d57816020015b60408051808201909152600080825260208201528152602001906001900390816121465790505b509050600080808080612180888a613710565b905060005b818110156124cf577f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168b82815181106121d6576121d6613513565b6020026020010151602001516000015173ffffffffffffffffffffffffffffffffffffffff160361229c5760405180604001604052808c838151811061221e5761221e613513565b60200260200101516000015181526020018c838151811061224157612241613513565b6020026020010151604001516020015177ffffffffffffffffffffffffffffffffffffffffffffffff1681525088858061227a906135d6565b96508151811061228c5761228c613513565b6020026020010181905250612391565b60405180604001604052808c83815181106122b9576122b9613513565b60200260200101516000015181526020018c83815181106122dc576122dc613513565b6020026020010151604001516020015177ffffffffffffffffffffffffffffffffffffffffffffffff16815250878480612315906135d6565b95508151811061232757612327613513565b60200260200101819052508a818151811061234457612344613513565b602002602001015160200151602001518661235f9190613710565b95508a818151811061237357612373613513565b602002602001015160400151602001518561238e9190613710565b94505b8a81815181106123a3576123a3613513565b6020026020010151606001516000146124bf578b73ffffffffffffffffffffffffffffffffffffffff168b82815181106123df576123df613513565b6020026020010151600001517f88b15eb682210089cddf967648e2cb2a4535aeadc8f8f36050922e33c04e71258d848151811061241e5761241e613513565b6020026020010151602001518e858151811061243c5761243c613513565b6020026020010151604001518f868151811061245a5761245a613513565b6020026020010151606001516040516124b693929190835173ffffffffffffffffffffffffffffffffffffffff908116825260209485015185830152835116604082015291909201516060820152608081019190915260a00190565b60405180910390a35b6124c8816135d6565b9050612185565b506000341561259d5734861115612512576040517fb2e532de00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663d0e30db0876040518263ffffffff1660e01b81526004016000604051808303818588803b15801561257a57600080fd5b505af115801561258e573d6000803e3d6000fd5b505050505085340390506125e5565b85156125e5576125e573ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168d3089612b26565b87511561267c57600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b0d9fa19898e6040518363ffffffff1660e01b8152600401612649929190613783565b600060405180830381600087803b15801561266357600080fd5b505af1158015612677573d6000803e3d6000fd5b505050505b86511561288c576040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16906370a0823190602401602060405180830381865afa15801561270d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612731919061360e565b8511156128015760005b87518110156127c45787818151811061275657612756613513565b60200260200101516020015177ffffffffffffffffffffffffffffffffffffffffffffffff16600460008a848151811061279257612792613513565b602090810291909101810151518252810191909152604001600020805490910190556127bd816135d6565b905061273b565b507ff52e5907b69d97c33392936c12d78b494463b78c5b72df50b4c497eee5720b67876040516127f491906138df565b60405180910390a161288c565b6006546040517fb0d9fa1900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9091169063b0d9fa1990612859908a903090600401613783565b600060405180830381600087803b15801561287357600080fd5b505af1158015612887573d6000803e3d6000fd5b505050505b6128968c826128a4565b505050505050505050505050565b80156109ad5760405173ffffffffffffffffffffffffffffffffffffffff83169082156108fc029083906000818181858888f19350505050158015610b40573d6000803e3d6000fd5b6000821561291b57816129016001856136e6565b61290b91906138f2565b612916906001613710565b61291e565b60005b9392505050565b3373ffffffffffffffffffffffffffffffffffffffff8216036129a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c6600000000000000000060448201526064016110c2565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b6000612a7c826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16612b849092919063ffffffff16565b805190915015610b405780806020019051810190612a9a91906134f1565b610b40576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f7420737563636565640000000000000000000000000000000000000000000060648201526084016110c2565b60405173ffffffffffffffffffffffffffffffffffffffff80851660248301528316604482015260648101829052610a889085907f23b872dd0000000000000000000000000000000000000000000000000000000090608401611f18565b6060612b938484600085612b9b565b949350505050565b606082471015612c2d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c000000000000000000000000000000000000000000000000000060648201526084016110c2565b6000808673ffffffffffffffffffffffffffffffffffffffff168587604051612c56919061392d565b60006040518083038185875af1925050503d8060008114612c93576040519150601f19603f3d011682016040523d82523d6000602084013e612c98565b606091505b5091509150612ca987838387612cb4565b979650505050505050565b60608315612d4a578251600003612d435773ffffffffffffffffffffffffffffffffffffffff85163b612d43576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016110c2565b5081612b93565b612b938383815115612d5f5781518083602001fd5b806040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110c29190612eee565b604051806080016040528060008019168152602001612ddb6040518060400160405280600073ffffffffffffffffffffffffffffffffffffffff168152602001600081525090565b8152602001612e136040518060400160405280600073ffffffffffffffffffffffffffffffffffffffff168152602001600081525090565b8152602001600081525090565b600060208284031215612e3257600080fd5b5035919050565b600060208284031215612e4b57600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461291e57600080fd5b73ffffffffffffffffffffffffffffffffffffffff81168114611d5257600080fd5b8035612ea881612e7b565b919050565b600060208284031215612ebf57600080fd5b813561291e81612e7b565b60005b83811015612ee5578181015183820152602001612ecd565b50506000910152565b6020815260008251806020840152612f0d816040850160208701612eca565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b60008060408385031215612f5257600080fd5b8235612f5d81612e7b565b91506020830135612f6d81612e7b565b809150509250929050565b77ffffffffffffffffffffffffffffffffffffffffffffffff81168114611d5257600080fd5b600080600060608486031215612fb357600080fd5b8335612fbe81612e7b565b92506020840135612fce81612e7b565b91506040840135612fde81612f78565b809150509250925092565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff8111828210171561305f5761305f612fe9565b604052919050565b60008083601f84011261307957600080fd5b50813567ffffffffffffffff81111561309157600080fd5b6020830191508360208260051b85010111156130ac57600080fd5b9250929050565b60008083601f8401126130c557600080fd5b50813567ffffffffffffffff8111156130dd57600080fd5b6020830191508360208285010111156130ac57600080fd5b6000806000806000806080878903121561310e57600080fd5b863567ffffffffffffffff8082111561312657600080fd5b818901915089601f83011261313a57600080fd5b813560208282111561314e5761314e612fe9565b8160051b61315d828201613018565b928352848101820192828101908e85111561317757600080fd5b958301955b848710156131955786358252958301959083019061317c565b9b5050508a0135925050808211156131ac57600080fd5b6131b88a838b01613067565b909750955060408901359150808211156131d157600080fd5b506131de89828a016130b3565b90945092506131f1905060608801612e9d565b90509295509295509295565b803567ffffffffffffffff81168114612ea857600080fd5b60006020828403121561322757600080fd5b61291e826131fd565b60008060006060848603121561324557600080fd5b833561325081612e7b565b9250602084013561326081612e7b565b915061326e604085016131fd565b90509250925092565b6000806000806000806080878903121561329057600080fd5b86359550602087013567ffffffffffffffff808211156132af57600080fd5b6132bb8a838b016130b3565b909750955060408901359150808211156132d457600080fd5b506132e189828a016130b3565b90945092505060608701356132f581612e7b565b809150509295509295509295565b60008060006060848603121561331857600080fd5b833561332381612e7b565b9250602084013591506040840135612fde81612e7b565b6000806000806080858703121561335057600080fd5b843561335b81612e7b565b935060208501359250604085013561337281612e7b565b9150613380606086016131fd565b905092959194509250565b600082601f83011261339c57600080fd5b813567ffffffffffffffff8111156133b6576133b6612fe9565b6133e760207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f84011601613018565b8181528460208386010111156133fc57600080fd5b816020850160208301376000918101602001919091529392505050565b60008060006060848603121561342e57600080fd5b833561343981612e7b565b9250602084013567ffffffffffffffff81111561345557600080fd5b6134618682870161338b565b9250506040840135612fde81612e7b565b60008060006040848603121561348757600080fd5b83359250602084013567ffffffffffffffff808211156134a657600080fd5b818601915086601f8301126134ba57600080fd5b8135818111156134c957600080fd5b8760208260061b85010111156134de57600080fd5b6020830194508093505050509250925092565b60006020828403121561350357600080fd5b8151801515811461291e57600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe184360301811261357757600080fd5b83018035915067ffffffffffffffff82111561359257600080fd5b6020019150368190038213156130ac57600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203613607576136076135a7565b5060010190565b60006020828403121561362057600080fd5b5051919050565b80516020808301519190811015613666577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8160200360031b1b821691505b50919050565b805163ffffffff81168114612ea857600080fd5b60008060008060008060c0878903121561369957600080fd5b865195506136a96020880161366c565b94506136b76040880161366c565b935060608701516136c781612f78565b60808801519093506136d881612f78565b91506131f160a0880161366c565b818103818111156106a6576106a66135a7565b80820281158282048414176106a6576106a66135a7565b808201808211156106a6576106a66135a7565b600081518084526020808501945080840160005b838110156137785781518051885283015177ffffffffffffffffffffffffffffffffffffffffffffffff168388015260409096019590820190600101613737565b509495945050505050565b6040815260006137966040830185613723565b905073ffffffffffffffffffffffffffffffffffffffff831660208301529392505050565b8381526040602080830182905282820184905260009190859060608501845b8781101561382e5783356137ed81612e7b565b73ffffffffffffffffffffffffffffffffffffffff16825267ffffffffffffffff6138198585016131fd565b168284015292840192908401906001016137da565b5098975050505050505050565b6000806080838503121561384e57600080fd5b83601f84011261385d57600080fd5b6040516060810167ffffffffffffffff828210818311171561388157613881612fe9565b81604052829150606086018781111561389957600080fd5b865b818110156138b357803584526020938401930161389b565b50929450913591808311156138c757600080fd5b50506138d58582860161338b565b9150509250929050565b60208152600061291e6020830184613723565b600082613928577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b6000825161393f818460208701612eca565b919091019291505056fea164736f6c6343000813000a", +} + +var DestinationFeeManagerABI = DestinationFeeManagerMetaData.ABI + +var DestinationFeeManagerBin = DestinationFeeManagerMetaData.Bin + +func DeployDestinationFeeManager(auth *bind.TransactOpts, backend bind.ContractBackend, _linkAddress common.Address, _nativeAddress common.Address, _verifierAddress common.Address, _rewardManagerAddress common.Address) (common.Address, *types.Transaction, *DestinationFeeManager, error) { + parsed, err := DestinationFeeManagerMetaData.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(DestinationFeeManagerBin), backend, _linkAddress, _nativeAddress, _verifierAddress, _rewardManagerAddress) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &DestinationFeeManager{address: address, abi: *parsed, DestinationFeeManagerCaller: DestinationFeeManagerCaller{contract: contract}, DestinationFeeManagerTransactor: DestinationFeeManagerTransactor{contract: contract}, DestinationFeeManagerFilterer: DestinationFeeManagerFilterer{contract: contract}}, nil +} + +type DestinationFeeManager struct { + address common.Address + abi abi.ABI + DestinationFeeManagerCaller + DestinationFeeManagerTransactor + DestinationFeeManagerFilterer +} + +type DestinationFeeManagerCaller struct { + contract *bind.BoundContract +} + +type DestinationFeeManagerTransactor struct { + contract *bind.BoundContract +} + +type DestinationFeeManagerFilterer struct { + contract *bind.BoundContract +} + +type DestinationFeeManagerSession struct { + Contract *DestinationFeeManager + CallOpts bind.CallOpts + TransactOpts bind.TransactOpts +} + +type DestinationFeeManagerCallerSession struct { + Contract *DestinationFeeManagerCaller + CallOpts bind.CallOpts +} + +type DestinationFeeManagerTransactorSession struct { + Contract *DestinationFeeManagerTransactor + TransactOpts bind.TransactOpts +} + +type DestinationFeeManagerRaw struct { + Contract *DestinationFeeManager +} + +type DestinationFeeManagerCallerRaw struct { + Contract *DestinationFeeManagerCaller +} + +type DestinationFeeManagerTransactorRaw struct { + Contract *DestinationFeeManagerTransactor +} + +func NewDestinationFeeManager(address common.Address, backend bind.ContractBackend) (*DestinationFeeManager, error) { + abi, err := abi.JSON(strings.NewReader(DestinationFeeManagerABI)) + if err != nil { + return nil, err + } + contract, err := bindDestinationFeeManager(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &DestinationFeeManager{address: address, abi: abi, DestinationFeeManagerCaller: DestinationFeeManagerCaller{contract: contract}, DestinationFeeManagerTransactor: DestinationFeeManagerTransactor{contract: contract}, DestinationFeeManagerFilterer: DestinationFeeManagerFilterer{contract: contract}}, nil +} + +func NewDestinationFeeManagerCaller(address common.Address, caller bind.ContractCaller) (*DestinationFeeManagerCaller, error) { + contract, err := bindDestinationFeeManager(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &DestinationFeeManagerCaller{contract: contract}, nil +} + +func NewDestinationFeeManagerTransactor(address common.Address, transactor bind.ContractTransactor) (*DestinationFeeManagerTransactor, error) { + contract, err := bindDestinationFeeManager(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &DestinationFeeManagerTransactor{contract: contract}, nil +} + +func NewDestinationFeeManagerFilterer(address common.Address, filterer bind.ContractFilterer) (*DestinationFeeManagerFilterer, error) { + contract, err := bindDestinationFeeManager(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &DestinationFeeManagerFilterer{contract: contract}, nil +} + +func bindDestinationFeeManager(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := DestinationFeeManagerMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +func (_DestinationFeeManager *DestinationFeeManagerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _DestinationFeeManager.Contract.DestinationFeeManagerCaller.contract.Call(opts, result, method, params...) +} + +func (_DestinationFeeManager *DestinationFeeManagerRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _DestinationFeeManager.Contract.DestinationFeeManagerTransactor.contract.Transfer(opts) +} + +func (_DestinationFeeManager *DestinationFeeManagerRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _DestinationFeeManager.Contract.DestinationFeeManagerTransactor.contract.Transact(opts, method, params...) +} + +func (_DestinationFeeManager *DestinationFeeManagerCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _DestinationFeeManager.Contract.contract.Call(opts, result, method, params...) +} + +func (_DestinationFeeManager *DestinationFeeManagerTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _DestinationFeeManager.Contract.contract.Transfer(opts) +} + +func (_DestinationFeeManager *DestinationFeeManagerTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _DestinationFeeManager.Contract.contract.Transact(opts, method, params...) +} + +func (_DestinationFeeManager *DestinationFeeManagerCaller) GetFeeAndReward(opts *bind.CallOpts, subscriber common.Address, report []byte, quoteAddress common.Address) (CommonAsset, CommonAsset, *big.Int, error) { + var out []interface{} + err := _DestinationFeeManager.contract.Call(opts, &out, "getFeeAndReward", subscriber, report, quoteAddress) + + if err != nil { + return *new(CommonAsset), *new(CommonAsset), *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(CommonAsset)).(*CommonAsset) + out1 := *abi.ConvertType(out[1], new(CommonAsset)).(*CommonAsset) + out2 := *abi.ConvertType(out[2], new(*big.Int)).(**big.Int) + + return out0, out1, out2, err + +} + +func (_DestinationFeeManager *DestinationFeeManagerSession) GetFeeAndReward(subscriber common.Address, report []byte, quoteAddress common.Address) (CommonAsset, CommonAsset, *big.Int, error) { + return _DestinationFeeManager.Contract.GetFeeAndReward(&_DestinationFeeManager.CallOpts, subscriber, report, quoteAddress) +} + +func (_DestinationFeeManager *DestinationFeeManagerCallerSession) GetFeeAndReward(subscriber common.Address, report []byte, quoteAddress common.Address) (CommonAsset, CommonAsset, *big.Int, error) { + return _DestinationFeeManager.Contract.GetFeeAndReward(&_DestinationFeeManager.CallOpts, subscriber, report, quoteAddress) +} + +func (_DestinationFeeManager *DestinationFeeManagerCaller) ILinkAddress(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _DestinationFeeManager.contract.Call(opts, &out, "i_linkAddress") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_DestinationFeeManager *DestinationFeeManagerSession) ILinkAddress() (common.Address, error) { + return _DestinationFeeManager.Contract.ILinkAddress(&_DestinationFeeManager.CallOpts) +} + +func (_DestinationFeeManager *DestinationFeeManagerCallerSession) ILinkAddress() (common.Address, error) { + return _DestinationFeeManager.Contract.ILinkAddress(&_DestinationFeeManager.CallOpts) +} + +func (_DestinationFeeManager *DestinationFeeManagerCaller) INativeAddress(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _DestinationFeeManager.contract.Call(opts, &out, "i_nativeAddress") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_DestinationFeeManager *DestinationFeeManagerSession) INativeAddress() (common.Address, error) { + return _DestinationFeeManager.Contract.INativeAddress(&_DestinationFeeManager.CallOpts) +} + +func (_DestinationFeeManager *DestinationFeeManagerCallerSession) INativeAddress() (common.Address, error) { + return _DestinationFeeManager.Contract.INativeAddress(&_DestinationFeeManager.CallOpts) +} + +func (_DestinationFeeManager *DestinationFeeManagerCaller) IRewardManager(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _DestinationFeeManager.contract.Call(opts, &out, "i_rewardManager") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_DestinationFeeManager *DestinationFeeManagerSession) IRewardManager() (common.Address, error) { + return _DestinationFeeManager.Contract.IRewardManager(&_DestinationFeeManager.CallOpts) +} + +func (_DestinationFeeManager *DestinationFeeManagerCallerSession) IRewardManager() (common.Address, error) { + return _DestinationFeeManager.Contract.IRewardManager(&_DestinationFeeManager.CallOpts) +} + +func (_DestinationFeeManager *DestinationFeeManagerCaller) LinkAvailableForPayment(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _DestinationFeeManager.contract.Call(opts, &out, "linkAvailableForPayment") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_DestinationFeeManager *DestinationFeeManagerSession) LinkAvailableForPayment() (*big.Int, error) { + return _DestinationFeeManager.Contract.LinkAvailableForPayment(&_DestinationFeeManager.CallOpts) +} + +func (_DestinationFeeManager *DestinationFeeManagerCallerSession) LinkAvailableForPayment() (*big.Int, error) { + return _DestinationFeeManager.Contract.LinkAvailableForPayment(&_DestinationFeeManager.CallOpts) +} + +func (_DestinationFeeManager *DestinationFeeManagerCaller) Owner(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _DestinationFeeManager.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 + +} + +func (_DestinationFeeManager *DestinationFeeManagerSession) Owner() (common.Address, error) { + return _DestinationFeeManager.Contract.Owner(&_DestinationFeeManager.CallOpts) +} + +func (_DestinationFeeManager *DestinationFeeManagerCallerSession) Owner() (common.Address, error) { + return _DestinationFeeManager.Contract.Owner(&_DestinationFeeManager.CallOpts) +} + +func (_DestinationFeeManager *DestinationFeeManagerCaller) SGlobalDiscounts(opts *bind.CallOpts, arg0 common.Address, arg1 common.Address) (*big.Int, error) { + var out []interface{} + err := _DestinationFeeManager.contract.Call(opts, &out, "s_globalDiscounts", arg0, arg1) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_DestinationFeeManager *DestinationFeeManagerSession) SGlobalDiscounts(arg0 common.Address, arg1 common.Address) (*big.Int, error) { + return _DestinationFeeManager.Contract.SGlobalDiscounts(&_DestinationFeeManager.CallOpts, arg0, arg1) +} + +func (_DestinationFeeManager *DestinationFeeManagerCallerSession) SGlobalDiscounts(arg0 common.Address, arg1 common.Address) (*big.Int, error) { + return _DestinationFeeManager.Contract.SGlobalDiscounts(&_DestinationFeeManager.CallOpts, arg0, arg1) +} + +func (_DestinationFeeManager *DestinationFeeManagerCaller) SLinkDeficit(opts *bind.CallOpts, arg0 [32]byte) (*big.Int, error) { + var out []interface{} + err := _DestinationFeeManager.contract.Call(opts, &out, "s_linkDeficit", arg0) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_DestinationFeeManager *DestinationFeeManagerSession) SLinkDeficit(arg0 [32]byte) (*big.Int, error) { + return _DestinationFeeManager.Contract.SLinkDeficit(&_DestinationFeeManager.CallOpts, arg0) +} + +func (_DestinationFeeManager *DestinationFeeManagerCallerSession) SLinkDeficit(arg0 [32]byte) (*big.Int, error) { + return _DestinationFeeManager.Contract.SLinkDeficit(&_DestinationFeeManager.CallOpts, arg0) +} + +func (_DestinationFeeManager *DestinationFeeManagerCaller) SNativeSurcharge(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _DestinationFeeManager.contract.Call(opts, &out, "s_nativeSurcharge") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_DestinationFeeManager *DestinationFeeManagerSession) SNativeSurcharge() (*big.Int, error) { + return _DestinationFeeManager.Contract.SNativeSurcharge(&_DestinationFeeManager.CallOpts) +} + +func (_DestinationFeeManager *DestinationFeeManagerCallerSession) SNativeSurcharge() (*big.Int, error) { + return _DestinationFeeManager.Contract.SNativeSurcharge(&_DestinationFeeManager.CallOpts) +} + +func (_DestinationFeeManager *DestinationFeeManagerCaller) SSubscriberDiscounts(opts *bind.CallOpts, arg0 common.Address, arg1 [32]byte, arg2 common.Address) (*big.Int, error) { + var out []interface{} + err := _DestinationFeeManager.contract.Call(opts, &out, "s_subscriberDiscounts", arg0, arg1, arg2) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_DestinationFeeManager *DestinationFeeManagerSession) SSubscriberDiscounts(arg0 common.Address, arg1 [32]byte, arg2 common.Address) (*big.Int, error) { + return _DestinationFeeManager.Contract.SSubscriberDiscounts(&_DestinationFeeManager.CallOpts, arg0, arg1, arg2) +} + +func (_DestinationFeeManager *DestinationFeeManagerCallerSession) SSubscriberDiscounts(arg0 common.Address, arg1 [32]byte, arg2 common.Address) (*big.Int, error) { + return _DestinationFeeManager.Contract.SSubscriberDiscounts(&_DestinationFeeManager.CallOpts, arg0, arg1, arg2) +} + +func (_DestinationFeeManager *DestinationFeeManagerCaller) SVerifierAddressList(opts *bind.CallOpts, arg0 common.Address) (common.Address, error) { + var out []interface{} + err := _DestinationFeeManager.contract.Call(opts, &out, "s_verifierAddressList", arg0) + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_DestinationFeeManager *DestinationFeeManagerSession) SVerifierAddressList(arg0 common.Address) (common.Address, error) { + return _DestinationFeeManager.Contract.SVerifierAddressList(&_DestinationFeeManager.CallOpts, arg0) +} + +func (_DestinationFeeManager *DestinationFeeManagerCallerSession) SVerifierAddressList(arg0 common.Address) (common.Address, error) { + return _DestinationFeeManager.Contract.SVerifierAddressList(&_DestinationFeeManager.CallOpts, arg0) +} + +func (_DestinationFeeManager *DestinationFeeManagerCaller) SupportsInterface(opts *bind.CallOpts, interfaceId [4]byte) (bool, error) { + var out []interface{} + err := _DestinationFeeManager.contract.Call(opts, &out, "supportsInterface", interfaceId) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_DestinationFeeManager *DestinationFeeManagerSession) SupportsInterface(interfaceId [4]byte) (bool, error) { + return _DestinationFeeManager.Contract.SupportsInterface(&_DestinationFeeManager.CallOpts, interfaceId) +} + +func (_DestinationFeeManager *DestinationFeeManagerCallerSession) SupportsInterface(interfaceId [4]byte) (bool, error) { + return _DestinationFeeManager.Contract.SupportsInterface(&_DestinationFeeManager.CallOpts, interfaceId) +} + +func (_DestinationFeeManager *DestinationFeeManagerCaller) TypeAndVersion(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _DestinationFeeManager.contract.Call(opts, &out, "typeAndVersion") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +func (_DestinationFeeManager *DestinationFeeManagerSession) TypeAndVersion() (string, error) { + return _DestinationFeeManager.Contract.TypeAndVersion(&_DestinationFeeManager.CallOpts) +} + +func (_DestinationFeeManager *DestinationFeeManagerCallerSession) TypeAndVersion() (string, error) { + return _DestinationFeeManager.Contract.TypeAndVersion(&_DestinationFeeManager.CallOpts) +} + +func (_DestinationFeeManager *DestinationFeeManagerTransactor) AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + return _DestinationFeeManager.contract.Transact(opts, "acceptOwnership") +} + +func (_DestinationFeeManager *DestinationFeeManagerSession) AcceptOwnership() (*types.Transaction, error) { + return _DestinationFeeManager.Contract.AcceptOwnership(&_DestinationFeeManager.TransactOpts) +} + +func (_DestinationFeeManager *DestinationFeeManagerTransactorSession) AcceptOwnership() (*types.Transaction, error) { + return _DestinationFeeManager.Contract.AcceptOwnership(&_DestinationFeeManager.TransactOpts) +} + +func (_DestinationFeeManager *DestinationFeeManagerTransactor) AddVerifier(opts *bind.TransactOpts, verifierAddress common.Address) (*types.Transaction, error) { + return _DestinationFeeManager.contract.Transact(opts, "addVerifier", verifierAddress) +} + +func (_DestinationFeeManager *DestinationFeeManagerSession) AddVerifier(verifierAddress common.Address) (*types.Transaction, error) { + return _DestinationFeeManager.Contract.AddVerifier(&_DestinationFeeManager.TransactOpts, verifierAddress) +} + +func (_DestinationFeeManager *DestinationFeeManagerTransactorSession) AddVerifier(verifierAddress common.Address) (*types.Transaction, error) { + return _DestinationFeeManager.Contract.AddVerifier(&_DestinationFeeManager.TransactOpts, verifierAddress) +} + +func (_DestinationFeeManager *DestinationFeeManagerTransactor) PayLinkDeficit(opts *bind.TransactOpts, configDigest [32]byte) (*types.Transaction, error) { + return _DestinationFeeManager.contract.Transact(opts, "payLinkDeficit", configDigest) +} + +func (_DestinationFeeManager *DestinationFeeManagerSession) PayLinkDeficit(configDigest [32]byte) (*types.Transaction, error) { + return _DestinationFeeManager.Contract.PayLinkDeficit(&_DestinationFeeManager.TransactOpts, configDigest) +} + +func (_DestinationFeeManager *DestinationFeeManagerTransactorSession) PayLinkDeficit(configDigest [32]byte) (*types.Transaction, error) { + return _DestinationFeeManager.Contract.PayLinkDeficit(&_DestinationFeeManager.TransactOpts, configDigest) +} + +func (_DestinationFeeManager *DestinationFeeManagerTransactor) ProcessFee(opts *bind.TransactOpts, recipient [32]byte, payload []byte, parameterPayload []byte, subscriber common.Address) (*types.Transaction, error) { + return _DestinationFeeManager.contract.Transact(opts, "processFee", recipient, payload, parameterPayload, subscriber) +} + +func (_DestinationFeeManager *DestinationFeeManagerSession) ProcessFee(recipient [32]byte, payload []byte, parameterPayload []byte, subscriber common.Address) (*types.Transaction, error) { + return _DestinationFeeManager.Contract.ProcessFee(&_DestinationFeeManager.TransactOpts, recipient, payload, parameterPayload, subscriber) +} + +func (_DestinationFeeManager *DestinationFeeManagerTransactorSession) ProcessFee(recipient [32]byte, payload []byte, parameterPayload []byte, subscriber common.Address) (*types.Transaction, error) { + return _DestinationFeeManager.Contract.ProcessFee(&_DestinationFeeManager.TransactOpts, recipient, payload, parameterPayload, subscriber) +} + +func (_DestinationFeeManager *DestinationFeeManagerTransactor) ProcessFeeBulk(opts *bind.TransactOpts, poolIds [][32]byte, payloads [][]byte, parameterPayload []byte, subscriber common.Address) (*types.Transaction, error) { + return _DestinationFeeManager.contract.Transact(opts, "processFeeBulk", poolIds, payloads, parameterPayload, subscriber) +} + +func (_DestinationFeeManager *DestinationFeeManagerSession) ProcessFeeBulk(poolIds [][32]byte, payloads [][]byte, parameterPayload []byte, subscriber common.Address) (*types.Transaction, error) { + return _DestinationFeeManager.Contract.ProcessFeeBulk(&_DestinationFeeManager.TransactOpts, poolIds, payloads, parameterPayload, subscriber) +} + +func (_DestinationFeeManager *DestinationFeeManagerTransactorSession) ProcessFeeBulk(poolIds [][32]byte, payloads [][]byte, parameterPayload []byte, subscriber common.Address) (*types.Transaction, error) { + return _DestinationFeeManager.Contract.ProcessFeeBulk(&_DestinationFeeManager.TransactOpts, poolIds, payloads, parameterPayload, subscriber) +} + +func (_DestinationFeeManager *DestinationFeeManagerTransactor) RemoveVerifier(opts *bind.TransactOpts, verifierAddress common.Address) (*types.Transaction, error) { + return _DestinationFeeManager.contract.Transact(opts, "removeVerifier", verifierAddress) +} + +func (_DestinationFeeManager *DestinationFeeManagerSession) RemoveVerifier(verifierAddress common.Address) (*types.Transaction, error) { + return _DestinationFeeManager.Contract.RemoveVerifier(&_DestinationFeeManager.TransactOpts, verifierAddress) +} + +func (_DestinationFeeManager *DestinationFeeManagerTransactorSession) RemoveVerifier(verifierAddress common.Address) (*types.Transaction, error) { + return _DestinationFeeManager.Contract.RemoveVerifier(&_DestinationFeeManager.TransactOpts, verifierAddress) +} + +func (_DestinationFeeManager *DestinationFeeManagerTransactor) SetFeeRecipients(opts *bind.TransactOpts, configDigest [32]byte, rewardRecipientAndWeights []CommonAddressAndWeight) (*types.Transaction, error) { + return _DestinationFeeManager.contract.Transact(opts, "setFeeRecipients", configDigest, rewardRecipientAndWeights) +} + +func (_DestinationFeeManager *DestinationFeeManagerSession) SetFeeRecipients(configDigest [32]byte, rewardRecipientAndWeights []CommonAddressAndWeight) (*types.Transaction, error) { + return _DestinationFeeManager.Contract.SetFeeRecipients(&_DestinationFeeManager.TransactOpts, configDigest, rewardRecipientAndWeights) +} + +func (_DestinationFeeManager *DestinationFeeManagerTransactorSession) SetFeeRecipients(configDigest [32]byte, rewardRecipientAndWeights []CommonAddressAndWeight) (*types.Transaction, error) { + return _DestinationFeeManager.Contract.SetFeeRecipients(&_DestinationFeeManager.TransactOpts, configDigest, rewardRecipientAndWeights) +} + +func (_DestinationFeeManager *DestinationFeeManagerTransactor) SetNativeSurcharge(opts *bind.TransactOpts, surcharge uint64) (*types.Transaction, error) { + return _DestinationFeeManager.contract.Transact(opts, "setNativeSurcharge", surcharge) +} + +func (_DestinationFeeManager *DestinationFeeManagerSession) SetNativeSurcharge(surcharge uint64) (*types.Transaction, error) { + return _DestinationFeeManager.Contract.SetNativeSurcharge(&_DestinationFeeManager.TransactOpts, surcharge) +} + +func (_DestinationFeeManager *DestinationFeeManagerTransactorSession) SetNativeSurcharge(surcharge uint64) (*types.Transaction, error) { + return _DestinationFeeManager.Contract.SetNativeSurcharge(&_DestinationFeeManager.TransactOpts, surcharge) +} + +func (_DestinationFeeManager *DestinationFeeManagerTransactor) SetRewardManager(opts *bind.TransactOpts, rewardManagerAddress common.Address) (*types.Transaction, error) { + return _DestinationFeeManager.contract.Transact(opts, "setRewardManager", rewardManagerAddress) +} + +func (_DestinationFeeManager *DestinationFeeManagerSession) SetRewardManager(rewardManagerAddress common.Address) (*types.Transaction, error) { + return _DestinationFeeManager.Contract.SetRewardManager(&_DestinationFeeManager.TransactOpts, rewardManagerAddress) +} + +func (_DestinationFeeManager *DestinationFeeManagerTransactorSession) SetRewardManager(rewardManagerAddress common.Address) (*types.Transaction, error) { + return _DestinationFeeManager.Contract.SetRewardManager(&_DestinationFeeManager.TransactOpts, rewardManagerAddress) +} + +func (_DestinationFeeManager *DestinationFeeManagerTransactor) TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) { + return _DestinationFeeManager.contract.Transact(opts, "transferOwnership", to) +} + +func (_DestinationFeeManager *DestinationFeeManagerSession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _DestinationFeeManager.Contract.TransferOwnership(&_DestinationFeeManager.TransactOpts, to) +} + +func (_DestinationFeeManager *DestinationFeeManagerTransactorSession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _DestinationFeeManager.Contract.TransferOwnership(&_DestinationFeeManager.TransactOpts, to) +} + +func (_DestinationFeeManager *DestinationFeeManagerTransactor) UpdateSubscriberDiscount(opts *bind.TransactOpts, subscriber common.Address, feedId [32]byte, token common.Address, discount uint64) (*types.Transaction, error) { + return _DestinationFeeManager.contract.Transact(opts, "updateSubscriberDiscount", subscriber, feedId, token, discount) +} + +func (_DestinationFeeManager *DestinationFeeManagerSession) UpdateSubscriberDiscount(subscriber common.Address, feedId [32]byte, token common.Address, discount uint64) (*types.Transaction, error) { + return _DestinationFeeManager.Contract.UpdateSubscriberDiscount(&_DestinationFeeManager.TransactOpts, subscriber, feedId, token, discount) +} + +func (_DestinationFeeManager *DestinationFeeManagerTransactorSession) UpdateSubscriberDiscount(subscriber common.Address, feedId [32]byte, token common.Address, discount uint64) (*types.Transaction, error) { + return _DestinationFeeManager.Contract.UpdateSubscriberDiscount(&_DestinationFeeManager.TransactOpts, subscriber, feedId, token, discount) +} + +func (_DestinationFeeManager *DestinationFeeManagerTransactor) UpdateSubscriberGlobalDiscount(opts *bind.TransactOpts, subscriber common.Address, token common.Address, discount uint64) (*types.Transaction, error) { + return _DestinationFeeManager.contract.Transact(opts, "updateSubscriberGlobalDiscount", subscriber, token, discount) +} + +func (_DestinationFeeManager *DestinationFeeManagerSession) UpdateSubscriberGlobalDiscount(subscriber common.Address, token common.Address, discount uint64) (*types.Transaction, error) { + return _DestinationFeeManager.Contract.UpdateSubscriberGlobalDiscount(&_DestinationFeeManager.TransactOpts, subscriber, token, discount) +} + +func (_DestinationFeeManager *DestinationFeeManagerTransactorSession) UpdateSubscriberGlobalDiscount(subscriber common.Address, token common.Address, discount uint64) (*types.Transaction, error) { + return _DestinationFeeManager.Contract.UpdateSubscriberGlobalDiscount(&_DestinationFeeManager.TransactOpts, subscriber, token, discount) +} + +func (_DestinationFeeManager *DestinationFeeManagerTransactor) Withdraw(opts *bind.TransactOpts, assetAddress common.Address, recipient common.Address, quantity *big.Int) (*types.Transaction, error) { + return _DestinationFeeManager.contract.Transact(opts, "withdraw", assetAddress, recipient, quantity) +} + +func (_DestinationFeeManager *DestinationFeeManagerSession) Withdraw(assetAddress common.Address, recipient common.Address, quantity *big.Int) (*types.Transaction, error) { + return _DestinationFeeManager.Contract.Withdraw(&_DestinationFeeManager.TransactOpts, assetAddress, recipient, quantity) +} + +func (_DestinationFeeManager *DestinationFeeManagerTransactorSession) Withdraw(assetAddress common.Address, recipient common.Address, quantity *big.Int) (*types.Transaction, error) { + return _DestinationFeeManager.Contract.Withdraw(&_DestinationFeeManager.TransactOpts, assetAddress, recipient, quantity) +} + +type DestinationFeeManagerDiscountAppliedIterator struct { + Event *DestinationFeeManagerDiscountApplied + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *DestinationFeeManagerDiscountAppliedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(DestinationFeeManagerDiscountApplied) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(DestinationFeeManagerDiscountApplied) + 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() + } +} + +func (it *DestinationFeeManagerDiscountAppliedIterator) Error() error { + return it.fail +} + +func (it *DestinationFeeManagerDiscountAppliedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type DestinationFeeManagerDiscountApplied struct { + ConfigDigest [32]byte + Subscriber common.Address + Fee CommonAsset + Reward CommonAsset + AppliedDiscount *big.Int + Raw types.Log +} + +func (_DestinationFeeManager *DestinationFeeManagerFilterer) FilterDiscountApplied(opts *bind.FilterOpts, configDigest [][32]byte, subscriber []common.Address) (*DestinationFeeManagerDiscountAppliedIterator, error) { + + var configDigestRule []interface{} + for _, configDigestItem := range configDigest { + configDigestRule = append(configDigestRule, configDigestItem) + } + var subscriberRule []interface{} + for _, subscriberItem := range subscriber { + subscriberRule = append(subscriberRule, subscriberItem) + } + + logs, sub, err := _DestinationFeeManager.contract.FilterLogs(opts, "DiscountApplied", configDigestRule, subscriberRule) + if err != nil { + return nil, err + } + return &DestinationFeeManagerDiscountAppliedIterator{contract: _DestinationFeeManager.contract, event: "DiscountApplied", logs: logs, sub: sub}, nil +} + +func (_DestinationFeeManager *DestinationFeeManagerFilterer) WatchDiscountApplied(opts *bind.WatchOpts, sink chan<- *DestinationFeeManagerDiscountApplied, configDigest [][32]byte, subscriber []common.Address) (event.Subscription, error) { + + var configDigestRule []interface{} + for _, configDigestItem := range configDigest { + configDigestRule = append(configDigestRule, configDigestItem) + } + var subscriberRule []interface{} + for _, subscriberItem := range subscriber { + subscriberRule = append(subscriberRule, subscriberItem) + } + + logs, sub, err := _DestinationFeeManager.contract.WatchLogs(opts, "DiscountApplied", configDigestRule, subscriberRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(DestinationFeeManagerDiscountApplied) + if err := _DestinationFeeManager.contract.UnpackLog(event, "DiscountApplied", 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 +} + +func (_DestinationFeeManager *DestinationFeeManagerFilterer) ParseDiscountApplied(log types.Log) (*DestinationFeeManagerDiscountApplied, error) { + event := new(DestinationFeeManagerDiscountApplied) + if err := _DestinationFeeManager.contract.UnpackLog(event, "DiscountApplied", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type DestinationFeeManagerInsufficientLinkIterator struct { + Event *DestinationFeeManagerInsufficientLink + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *DestinationFeeManagerInsufficientLinkIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(DestinationFeeManagerInsufficientLink) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(DestinationFeeManagerInsufficientLink) + 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() + } +} + +func (it *DestinationFeeManagerInsufficientLinkIterator) Error() error { + return it.fail +} + +func (it *DestinationFeeManagerInsufficientLinkIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type DestinationFeeManagerInsufficientLink struct { + Rewards []IDestinationRewardManagerFeePayment + Raw types.Log +} + +func (_DestinationFeeManager *DestinationFeeManagerFilterer) FilterInsufficientLink(opts *bind.FilterOpts) (*DestinationFeeManagerInsufficientLinkIterator, error) { + + logs, sub, err := _DestinationFeeManager.contract.FilterLogs(opts, "InsufficientLink") + if err != nil { + return nil, err + } + return &DestinationFeeManagerInsufficientLinkIterator{contract: _DestinationFeeManager.contract, event: "InsufficientLink", logs: logs, sub: sub}, nil +} + +func (_DestinationFeeManager *DestinationFeeManagerFilterer) WatchInsufficientLink(opts *bind.WatchOpts, sink chan<- *DestinationFeeManagerInsufficientLink) (event.Subscription, error) { + + logs, sub, err := _DestinationFeeManager.contract.WatchLogs(opts, "InsufficientLink") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(DestinationFeeManagerInsufficientLink) + if err := _DestinationFeeManager.contract.UnpackLog(event, "InsufficientLink", 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 +} + +func (_DestinationFeeManager *DestinationFeeManagerFilterer) ParseInsufficientLink(log types.Log) (*DestinationFeeManagerInsufficientLink, error) { + event := new(DestinationFeeManagerInsufficientLink) + if err := _DestinationFeeManager.contract.UnpackLog(event, "InsufficientLink", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type DestinationFeeManagerLinkDeficitClearedIterator struct { + Event *DestinationFeeManagerLinkDeficitCleared + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *DestinationFeeManagerLinkDeficitClearedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(DestinationFeeManagerLinkDeficitCleared) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(DestinationFeeManagerLinkDeficitCleared) + 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() + } +} + +func (it *DestinationFeeManagerLinkDeficitClearedIterator) Error() error { + return it.fail +} + +func (it *DestinationFeeManagerLinkDeficitClearedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type DestinationFeeManagerLinkDeficitCleared struct { + ConfigDigest [32]byte + LinkQuantity *big.Int + Raw types.Log +} + +func (_DestinationFeeManager *DestinationFeeManagerFilterer) FilterLinkDeficitCleared(opts *bind.FilterOpts, configDigest [][32]byte) (*DestinationFeeManagerLinkDeficitClearedIterator, error) { + + var configDigestRule []interface{} + for _, configDigestItem := range configDigest { + configDigestRule = append(configDigestRule, configDigestItem) + } + + logs, sub, err := _DestinationFeeManager.contract.FilterLogs(opts, "LinkDeficitCleared", configDigestRule) + if err != nil { + return nil, err + } + return &DestinationFeeManagerLinkDeficitClearedIterator{contract: _DestinationFeeManager.contract, event: "LinkDeficitCleared", logs: logs, sub: sub}, nil +} + +func (_DestinationFeeManager *DestinationFeeManagerFilterer) WatchLinkDeficitCleared(opts *bind.WatchOpts, sink chan<- *DestinationFeeManagerLinkDeficitCleared, configDigest [][32]byte) (event.Subscription, error) { + + var configDigestRule []interface{} + for _, configDigestItem := range configDigest { + configDigestRule = append(configDigestRule, configDigestItem) + } + + logs, sub, err := _DestinationFeeManager.contract.WatchLogs(opts, "LinkDeficitCleared", configDigestRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(DestinationFeeManagerLinkDeficitCleared) + if err := _DestinationFeeManager.contract.UnpackLog(event, "LinkDeficitCleared", 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 +} + +func (_DestinationFeeManager *DestinationFeeManagerFilterer) ParseLinkDeficitCleared(log types.Log) (*DestinationFeeManagerLinkDeficitCleared, error) { + event := new(DestinationFeeManagerLinkDeficitCleared) + if err := _DestinationFeeManager.contract.UnpackLog(event, "LinkDeficitCleared", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type DestinationFeeManagerNativeSurchargeUpdatedIterator struct { + Event *DestinationFeeManagerNativeSurchargeUpdated + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *DestinationFeeManagerNativeSurchargeUpdatedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(DestinationFeeManagerNativeSurchargeUpdated) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(DestinationFeeManagerNativeSurchargeUpdated) + 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() + } +} + +func (it *DestinationFeeManagerNativeSurchargeUpdatedIterator) Error() error { + return it.fail +} + +func (it *DestinationFeeManagerNativeSurchargeUpdatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type DestinationFeeManagerNativeSurchargeUpdated struct { + NewSurcharge uint64 + Raw types.Log +} + +func (_DestinationFeeManager *DestinationFeeManagerFilterer) FilterNativeSurchargeUpdated(opts *bind.FilterOpts) (*DestinationFeeManagerNativeSurchargeUpdatedIterator, error) { + + logs, sub, err := _DestinationFeeManager.contract.FilterLogs(opts, "NativeSurchargeUpdated") + if err != nil { + return nil, err + } + return &DestinationFeeManagerNativeSurchargeUpdatedIterator{contract: _DestinationFeeManager.contract, event: "NativeSurchargeUpdated", logs: logs, sub: sub}, nil +} + +func (_DestinationFeeManager *DestinationFeeManagerFilterer) WatchNativeSurchargeUpdated(opts *bind.WatchOpts, sink chan<- *DestinationFeeManagerNativeSurchargeUpdated) (event.Subscription, error) { + + logs, sub, err := _DestinationFeeManager.contract.WatchLogs(opts, "NativeSurchargeUpdated") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(DestinationFeeManagerNativeSurchargeUpdated) + if err := _DestinationFeeManager.contract.UnpackLog(event, "NativeSurchargeUpdated", 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 +} + +func (_DestinationFeeManager *DestinationFeeManagerFilterer) ParseNativeSurchargeUpdated(log types.Log) (*DestinationFeeManagerNativeSurchargeUpdated, error) { + event := new(DestinationFeeManagerNativeSurchargeUpdated) + if err := _DestinationFeeManager.contract.UnpackLog(event, "NativeSurchargeUpdated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type DestinationFeeManagerOwnershipTransferRequestedIterator struct { + Event *DestinationFeeManagerOwnershipTransferRequested + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *DestinationFeeManagerOwnershipTransferRequestedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(DestinationFeeManagerOwnershipTransferRequested) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(DestinationFeeManagerOwnershipTransferRequested) + 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() + } +} + +func (it *DestinationFeeManagerOwnershipTransferRequestedIterator) Error() error { + return it.fail +} + +func (it *DestinationFeeManagerOwnershipTransferRequestedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type DestinationFeeManagerOwnershipTransferRequested struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_DestinationFeeManager *DestinationFeeManagerFilterer) FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*DestinationFeeManagerOwnershipTransferRequestedIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _DestinationFeeManager.contract.FilterLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return &DestinationFeeManagerOwnershipTransferRequestedIterator{contract: _DestinationFeeManager.contract, event: "OwnershipTransferRequested", logs: logs, sub: sub}, nil +} + +func (_DestinationFeeManager *DestinationFeeManagerFilterer) WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *DestinationFeeManagerOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _DestinationFeeManager.contract.WatchLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(DestinationFeeManagerOwnershipTransferRequested) + if err := _DestinationFeeManager.contract.UnpackLog(event, "OwnershipTransferRequested", 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 +} + +func (_DestinationFeeManager *DestinationFeeManagerFilterer) ParseOwnershipTransferRequested(log types.Log) (*DestinationFeeManagerOwnershipTransferRequested, error) { + event := new(DestinationFeeManagerOwnershipTransferRequested) + if err := _DestinationFeeManager.contract.UnpackLog(event, "OwnershipTransferRequested", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type DestinationFeeManagerOwnershipTransferredIterator struct { + Event *DestinationFeeManagerOwnershipTransferred + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *DestinationFeeManagerOwnershipTransferredIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(DestinationFeeManagerOwnershipTransferred) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(DestinationFeeManagerOwnershipTransferred) + 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() + } +} + +func (it *DestinationFeeManagerOwnershipTransferredIterator) Error() error { + return it.fail +} + +func (it *DestinationFeeManagerOwnershipTransferredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type DestinationFeeManagerOwnershipTransferred struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_DestinationFeeManager *DestinationFeeManagerFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*DestinationFeeManagerOwnershipTransferredIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _DestinationFeeManager.contract.FilterLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return &DestinationFeeManagerOwnershipTransferredIterator{contract: _DestinationFeeManager.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil +} + +func (_DestinationFeeManager *DestinationFeeManagerFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *DestinationFeeManagerOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _DestinationFeeManager.contract.WatchLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(DestinationFeeManagerOwnershipTransferred) + if err := _DestinationFeeManager.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 +} + +func (_DestinationFeeManager *DestinationFeeManagerFilterer) ParseOwnershipTransferred(log types.Log) (*DestinationFeeManagerOwnershipTransferred, error) { + event := new(DestinationFeeManagerOwnershipTransferred) + if err := _DestinationFeeManager.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type DestinationFeeManagerSubscriberDiscountUpdatedIterator struct { + Event *DestinationFeeManagerSubscriberDiscountUpdated + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *DestinationFeeManagerSubscriberDiscountUpdatedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(DestinationFeeManagerSubscriberDiscountUpdated) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(DestinationFeeManagerSubscriberDiscountUpdated) + 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() + } +} + +func (it *DestinationFeeManagerSubscriberDiscountUpdatedIterator) Error() error { + return it.fail +} + +func (it *DestinationFeeManagerSubscriberDiscountUpdatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type DestinationFeeManagerSubscriberDiscountUpdated struct { + Subscriber common.Address + FeedId [32]byte + Token common.Address + Discount uint64 + Raw types.Log +} + +func (_DestinationFeeManager *DestinationFeeManagerFilterer) FilterSubscriberDiscountUpdated(opts *bind.FilterOpts, subscriber []common.Address, feedId [][32]byte) (*DestinationFeeManagerSubscriberDiscountUpdatedIterator, error) { + + var subscriberRule []interface{} + for _, subscriberItem := range subscriber { + subscriberRule = append(subscriberRule, subscriberItem) + } + var feedIdRule []interface{} + for _, feedIdItem := range feedId { + feedIdRule = append(feedIdRule, feedIdItem) + } + + logs, sub, err := _DestinationFeeManager.contract.FilterLogs(opts, "SubscriberDiscountUpdated", subscriberRule, feedIdRule) + if err != nil { + return nil, err + } + return &DestinationFeeManagerSubscriberDiscountUpdatedIterator{contract: _DestinationFeeManager.contract, event: "SubscriberDiscountUpdated", logs: logs, sub: sub}, nil +} + +func (_DestinationFeeManager *DestinationFeeManagerFilterer) WatchSubscriberDiscountUpdated(opts *bind.WatchOpts, sink chan<- *DestinationFeeManagerSubscriberDiscountUpdated, subscriber []common.Address, feedId [][32]byte) (event.Subscription, error) { + + var subscriberRule []interface{} + for _, subscriberItem := range subscriber { + subscriberRule = append(subscriberRule, subscriberItem) + } + var feedIdRule []interface{} + for _, feedIdItem := range feedId { + feedIdRule = append(feedIdRule, feedIdItem) + } + + logs, sub, err := _DestinationFeeManager.contract.WatchLogs(opts, "SubscriberDiscountUpdated", subscriberRule, feedIdRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(DestinationFeeManagerSubscriberDiscountUpdated) + if err := _DestinationFeeManager.contract.UnpackLog(event, "SubscriberDiscountUpdated", 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 +} + +func (_DestinationFeeManager *DestinationFeeManagerFilterer) ParseSubscriberDiscountUpdated(log types.Log) (*DestinationFeeManagerSubscriberDiscountUpdated, error) { + event := new(DestinationFeeManagerSubscriberDiscountUpdated) + if err := _DestinationFeeManager.contract.UnpackLog(event, "SubscriberDiscountUpdated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type DestinationFeeManagerWithdrawIterator struct { + Event *DestinationFeeManagerWithdraw + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *DestinationFeeManagerWithdrawIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(DestinationFeeManagerWithdraw) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(DestinationFeeManagerWithdraw) + 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() + } +} + +func (it *DestinationFeeManagerWithdrawIterator) Error() error { + return it.fail +} + +func (it *DestinationFeeManagerWithdrawIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type DestinationFeeManagerWithdraw struct { + AdminAddress common.Address + Recipient common.Address + AssetAddress common.Address + Quantity *big.Int + Raw types.Log +} + +func (_DestinationFeeManager *DestinationFeeManagerFilterer) FilterWithdraw(opts *bind.FilterOpts) (*DestinationFeeManagerWithdrawIterator, error) { + + logs, sub, err := _DestinationFeeManager.contract.FilterLogs(opts, "Withdraw") + if err != nil { + return nil, err + } + return &DestinationFeeManagerWithdrawIterator{contract: _DestinationFeeManager.contract, event: "Withdraw", logs: logs, sub: sub}, nil +} + +func (_DestinationFeeManager *DestinationFeeManagerFilterer) WatchWithdraw(opts *bind.WatchOpts, sink chan<- *DestinationFeeManagerWithdraw) (event.Subscription, error) { + + logs, sub, err := _DestinationFeeManager.contract.WatchLogs(opts, "Withdraw") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(DestinationFeeManagerWithdraw) + if err := _DestinationFeeManager.contract.UnpackLog(event, "Withdraw", 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 +} + +func (_DestinationFeeManager *DestinationFeeManagerFilterer) ParseWithdraw(log types.Log) (*DestinationFeeManagerWithdraw, error) { + event := new(DestinationFeeManagerWithdraw) + if err := _DestinationFeeManager.contract.UnpackLog(event, "Withdraw", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +func (_DestinationFeeManager *DestinationFeeManager) ParseLog(log types.Log) (generated.AbigenLog, error) { + switch log.Topics[0] { + case _DestinationFeeManager.abi.Events["DiscountApplied"].ID: + return _DestinationFeeManager.ParseDiscountApplied(log) + case _DestinationFeeManager.abi.Events["InsufficientLink"].ID: + return _DestinationFeeManager.ParseInsufficientLink(log) + case _DestinationFeeManager.abi.Events["LinkDeficitCleared"].ID: + return _DestinationFeeManager.ParseLinkDeficitCleared(log) + case _DestinationFeeManager.abi.Events["NativeSurchargeUpdated"].ID: + return _DestinationFeeManager.ParseNativeSurchargeUpdated(log) + case _DestinationFeeManager.abi.Events["OwnershipTransferRequested"].ID: + return _DestinationFeeManager.ParseOwnershipTransferRequested(log) + case _DestinationFeeManager.abi.Events["OwnershipTransferred"].ID: + return _DestinationFeeManager.ParseOwnershipTransferred(log) + case _DestinationFeeManager.abi.Events["SubscriberDiscountUpdated"].ID: + return _DestinationFeeManager.ParseSubscriberDiscountUpdated(log) + case _DestinationFeeManager.abi.Events["Withdraw"].ID: + return _DestinationFeeManager.ParseWithdraw(log) + + default: + return nil, fmt.Errorf("abigen wrapper received unknown log topic: %v", log.Topics[0]) + } +} + +func (DestinationFeeManagerDiscountApplied) Topic() common.Hash { + return common.HexToHash("0x88b15eb682210089cddf967648e2cb2a4535aeadc8f8f36050922e33c04e7125") +} + +func (DestinationFeeManagerInsufficientLink) Topic() common.Hash { + return common.HexToHash("0xf52e5907b69d97c33392936c12d78b494463b78c5b72df50b4c497eee5720b67") +} + +func (DestinationFeeManagerLinkDeficitCleared) Topic() common.Hash { + return common.HexToHash("0x843f0b103e50b42b08f9d30f12f961845a6d02623730872e24644899c0dd9895") +} + +func (DestinationFeeManagerNativeSurchargeUpdated) Topic() common.Hash { + return common.HexToHash("0x08f7c0d17932ddb8523bc06754d42ff19ebc77d76a8b9bfde02c28ab1ed3d639") +} + +func (DestinationFeeManagerOwnershipTransferRequested) Topic() common.Hash { + return common.HexToHash("0xed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae1278") +} + +func (DestinationFeeManagerOwnershipTransferred) Topic() common.Hash { + return common.HexToHash("0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0") +} + +func (DestinationFeeManagerSubscriberDiscountUpdated) Topic() common.Hash { + return common.HexToHash("0x5eba5a8afa39780f0f99b6cbeb95f3da6a7040ca00abd46bdc91a0a060134139") +} + +func (DestinationFeeManagerWithdraw) Topic() common.Hash { + return common.HexToHash("0x7ff78a71698bdb18dcca96f52ab25e0a1b146fb6a49adf8e6845299e49021f29") +} + +func (_DestinationFeeManager *DestinationFeeManager) Address() common.Address { + return _DestinationFeeManager.address +} + +type DestinationFeeManagerInterface interface { + GetFeeAndReward(opts *bind.CallOpts, subscriber common.Address, report []byte, quoteAddress common.Address) (CommonAsset, CommonAsset, *big.Int, error) + + ILinkAddress(opts *bind.CallOpts) (common.Address, error) + + INativeAddress(opts *bind.CallOpts) (common.Address, error) + + IRewardManager(opts *bind.CallOpts) (common.Address, error) + + LinkAvailableForPayment(opts *bind.CallOpts) (*big.Int, error) + + Owner(opts *bind.CallOpts) (common.Address, error) + + SGlobalDiscounts(opts *bind.CallOpts, arg0 common.Address, arg1 common.Address) (*big.Int, error) + + SLinkDeficit(opts *bind.CallOpts, arg0 [32]byte) (*big.Int, error) + + SNativeSurcharge(opts *bind.CallOpts) (*big.Int, error) + + SSubscriberDiscounts(opts *bind.CallOpts, arg0 common.Address, arg1 [32]byte, arg2 common.Address) (*big.Int, error) + + SVerifierAddressList(opts *bind.CallOpts, arg0 common.Address) (common.Address, error) + + SupportsInterface(opts *bind.CallOpts, interfaceId [4]byte) (bool, error) + + TypeAndVersion(opts *bind.CallOpts) (string, error) + + AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) + + AddVerifier(opts *bind.TransactOpts, verifierAddress common.Address) (*types.Transaction, error) + + PayLinkDeficit(opts *bind.TransactOpts, configDigest [32]byte) (*types.Transaction, error) + + ProcessFee(opts *bind.TransactOpts, recipient [32]byte, payload []byte, parameterPayload []byte, subscriber common.Address) (*types.Transaction, error) + + ProcessFeeBulk(opts *bind.TransactOpts, poolIds [][32]byte, payloads [][]byte, parameterPayload []byte, subscriber common.Address) (*types.Transaction, error) + + RemoveVerifier(opts *bind.TransactOpts, verifierAddress common.Address) (*types.Transaction, error) + + SetFeeRecipients(opts *bind.TransactOpts, configDigest [32]byte, rewardRecipientAndWeights []CommonAddressAndWeight) (*types.Transaction, error) + + SetNativeSurcharge(opts *bind.TransactOpts, surcharge uint64) (*types.Transaction, error) + + SetRewardManager(opts *bind.TransactOpts, rewardManagerAddress common.Address) (*types.Transaction, error) + + TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) + + UpdateSubscriberDiscount(opts *bind.TransactOpts, subscriber common.Address, feedId [32]byte, token common.Address, discount uint64) (*types.Transaction, error) + + UpdateSubscriberGlobalDiscount(opts *bind.TransactOpts, subscriber common.Address, token common.Address, discount uint64) (*types.Transaction, error) + + Withdraw(opts *bind.TransactOpts, assetAddress common.Address, recipient common.Address, quantity *big.Int) (*types.Transaction, error) + + FilterDiscountApplied(opts *bind.FilterOpts, configDigest [][32]byte, subscriber []common.Address) (*DestinationFeeManagerDiscountAppliedIterator, error) + + WatchDiscountApplied(opts *bind.WatchOpts, sink chan<- *DestinationFeeManagerDiscountApplied, configDigest [][32]byte, subscriber []common.Address) (event.Subscription, error) + + ParseDiscountApplied(log types.Log) (*DestinationFeeManagerDiscountApplied, error) + + FilterInsufficientLink(opts *bind.FilterOpts) (*DestinationFeeManagerInsufficientLinkIterator, error) + + WatchInsufficientLink(opts *bind.WatchOpts, sink chan<- *DestinationFeeManagerInsufficientLink) (event.Subscription, error) + + ParseInsufficientLink(log types.Log) (*DestinationFeeManagerInsufficientLink, error) + + FilterLinkDeficitCleared(opts *bind.FilterOpts, configDigest [][32]byte) (*DestinationFeeManagerLinkDeficitClearedIterator, error) + + WatchLinkDeficitCleared(opts *bind.WatchOpts, sink chan<- *DestinationFeeManagerLinkDeficitCleared, configDigest [][32]byte) (event.Subscription, error) + + ParseLinkDeficitCleared(log types.Log) (*DestinationFeeManagerLinkDeficitCleared, error) + + FilterNativeSurchargeUpdated(opts *bind.FilterOpts) (*DestinationFeeManagerNativeSurchargeUpdatedIterator, error) + + WatchNativeSurchargeUpdated(opts *bind.WatchOpts, sink chan<- *DestinationFeeManagerNativeSurchargeUpdated) (event.Subscription, error) + + ParseNativeSurchargeUpdated(log types.Log) (*DestinationFeeManagerNativeSurchargeUpdated, error) + + FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*DestinationFeeManagerOwnershipTransferRequestedIterator, error) + + WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *DestinationFeeManagerOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferRequested(log types.Log) (*DestinationFeeManagerOwnershipTransferRequested, error) + + FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*DestinationFeeManagerOwnershipTransferredIterator, error) + + WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *DestinationFeeManagerOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferred(log types.Log) (*DestinationFeeManagerOwnershipTransferred, error) + + FilterSubscriberDiscountUpdated(opts *bind.FilterOpts, subscriber []common.Address, feedId [][32]byte) (*DestinationFeeManagerSubscriberDiscountUpdatedIterator, error) + + WatchSubscriberDiscountUpdated(opts *bind.WatchOpts, sink chan<- *DestinationFeeManagerSubscriberDiscountUpdated, subscriber []common.Address, feedId [][32]byte) (event.Subscription, error) + + ParseSubscriberDiscountUpdated(log types.Log) (*DestinationFeeManagerSubscriberDiscountUpdated, error) + + FilterWithdraw(opts *bind.FilterOpts) (*DestinationFeeManagerWithdrawIterator, error) + + WatchWithdraw(opts *bind.WatchOpts, sink chan<- *DestinationFeeManagerWithdraw) (event.Subscription, error) + + ParseWithdraw(log types.Log) (*DestinationFeeManagerWithdraw, error) + + ParseLog(log types.Log) (generated.AbigenLog, error) + + Address() common.Address +} diff --git a/core/gethwrappers/llo-feeds/generated/destination_reward_manager/destination_reward_manager.go b/core/gethwrappers/llo-feeds/generated/destination_reward_manager/destination_reward_manager.go new file mode 100644 index 00000000000..75ff7abe7ee --- /dev/null +++ b/core/gethwrappers/llo-feeds/generated/destination_reward_manager/destination_reward_manager.go @@ -0,0 +1,1434 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package destination_reward_manager + +import ( + "errors" + "fmt" + "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" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" +) + +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +type CommonAddressAndWeight struct { + Addr common.Address + Weight uint64 +} + +type IDestinationRewardManagerFeePayment struct { + PoolId [32]byte + Amount *big.Int +} + +var DestinationRewardManagerMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"linkAddress\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"InvalidAddress\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidPoolId\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidPoolLength\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidWeights\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Unauthorized\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newFeeManagerAddress\",\"type\":\"address\"}],\"name\":\"FeeManagerUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"poolId\",\"type\":\"bytes32\"},{\"internalType\":\"uint192\",\"name\":\"amount\",\"type\":\"uint192\"}],\"indexed\":false,\"internalType\":\"structIDestinationRewardManager.FeePayment[]\",\"name\":\"payments\",\"type\":\"tuple[]\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"payer\",\"type\":\"address\"}],\"name\":\"FeePaid\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"poolId\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"weight\",\"type\":\"uint64\"}],\"indexed\":false,\"internalType\":\"structCommon.AddressAndWeight[]\",\"name\":\"newRewardRecipients\",\"type\":\"tuple[]\"}],\"name\":\"RewardRecipientsUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"poolId\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint192\",\"name\":\"quantity\",\"type\":\"uint192\"}],\"name\":\"RewardsClaimed\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newFeeManagerAddress\",\"type\":\"address\"}],\"name\":\"addFeeManager\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32[]\",\"name\":\"poolIds\",\"type\":\"bytes32[]\"}],\"name\":\"claimRewards\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"startIndex\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"endIndex\",\"type\":\"uint256\"}],\"name\":\"getAvailableRewardPoolIds\",\"outputs\":[{\"internalType\":\"bytes32[]\",\"name\":\"\",\"type\":\"bytes32[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"i_linkAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"poolId\",\"type\":\"bytes32\"},{\"internalType\":\"uint192\",\"name\":\"amount\",\"type\":\"uint192\"}],\"internalType\":\"structIDestinationRewardManager.FeePayment[]\",\"name\":\"payments\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"payer\",\"type\":\"address\"}],\"name\":\"onFeePaid\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"poolId\",\"type\":\"bytes32\"},{\"internalType\":\"address[]\",\"name\":\"recipients\",\"type\":\"address[]\"}],\"name\":\"payRecipients\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"feeManagerAddress\",\"type\":\"address\"}],\"name\":\"removeFeeManager\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"s_feeManagerAddressList\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"s_registeredPoolIds\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"s_rewardRecipientWeights\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"s_rewardRecipientWeightsSet\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"s_totalRewardRecipientFees\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"s_totalRewardRecipientFeesLastClaimedAmounts\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"poolId\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"weight\",\"type\":\"uint64\"}],\"internalType\":\"structCommon.AddressAndWeight[]\",\"name\":\"rewardRecipientAndWeights\",\"type\":\"tuple[]\"}],\"name\":\"setRewardRecipients\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"poolId\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"weight\",\"type\":\"uint64\"}],\"internalType\":\"structCommon.AddressAndWeight[]\",\"name\":\"newRewardRecipients\",\"type\":\"tuple[]\"}],\"name\":\"updateRewardRecipients\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", + Bin: "0x60a06040523480156200001157600080fd5b5060405162002205380380620022058339810160408190526200003491620001a6565b33806000816200008b5760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000be57620000be81620000fb565b5050506001600160a01b038116620000e95760405163e6c4247b60e01b815260040160405180910390fd5b6001600160a01b0316608052620001d8565b336001600160a01b03821603620001555760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640162000082565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b600060208284031215620001b957600080fd5b81516001600160a01b0381168114620001d157600080fd5b9392505050565b60805161200362000202600039600081816103fd01528181610e26015261106101526120036000f3fe608060405234801561001057600080fd5b506004361061016c5760003560e01c806360122608116100cd5780639604d05f11610081578063cd5f729211610066578063cd5f7292146103e5578063ea4b861b146103f8578063f2fde38b1461041f57600080fd5b80639604d05f1461039c578063b0d9fa19146103d257600080fd5b80638115c9cc116100b25780638115c9cc1461031f5780638ac85a5c146103325780638da5cb5b1461035d57600080fd5b806360122608146102ec57806379ba50971461031757600080fd5b806339ee81e1116101245780634944832f116101095780634944832f146102a35780634d322084146102b657806359256201146102c957600080fd5b806339ee81e114610255578063472264751461028357600080fd5b806314060f231161015557806314060f23146101f0578063181f5a77146102035780631f2d32c31461024257600080fd5b806301ffc9a7146101715780630f3c34d1146101db575b600080fd5b6101c661017f3660046118ef565b7fffffffff00000000000000000000000000000000000000000000000000000000167f768ffd3a000000000000000000000000000000000000000000000000000000001490565b60405190151581526020015b60405180910390f35b6101ee6101e93660046119af565b610432565b005b6101ee6101fe366004611aa1565b610440565b604080518082018252601e81527f44657374696e6174696f6e5265776172644d616e6167657220302e342e300000602082015290516101d29190611b11565b6101ee610250366004611b8b565b610602565b610275610263366004611bad565b60026020526000908152604090205481565b6040519081526020016101d2565b610296610291366004611bc6565b61073a565b6040516101d29190611bf9565b6101ee6102b1366004611aa1565b6108c4565b6101ee6102c4366004611c3d565b610a0d565b6101c66102d7366004611bad565b60056020526000908152604090205460ff1681565b6102756102fa366004611cbc565b600360209081526000928352604080842090915290825290205481565b6101ee610b1b565b6101ee61032d366004611b8b565b610c1d565b610275610340366004611cbc565b600460209081526000928352604080842090915290825290205481565b60005473ffffffffffffffffffffffffffffffffffffffff165b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101d2565b6103776103aa366004611b8b565b60076020526000908152604090205473ffffffffffffffffffffffffffffffffffffffff1681565b6101ee6103e0366004611ce8565b610ccf565b6102756103f3366004611bad565b610e8f565b6103777f000000000000000000000000000000000000000000000000000000000000000081565b6101ee61042d366004611b8b565b610eb0565b61043c3382610ec4565b5050565b3360008181526007602052604090205473ffffffffffffffffffffffffffffffffffffffff161480159061048c575060005473ffffffffffffffffffffffffffffffffffffffff163314155b156104c3576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008190036104fe576040517fe6c4247b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008381526005602052604090205460ff1615610547576040517f0afa7ee800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6006805460018181019092557ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f01849055600084815260056020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690911790556105c3838383670de0b6b3a7640000611091565b827f8f668d6090683f98b3373a8b83d214da45737f7486cb7de554cc07b54e61cfe683836040516105f5929190611d54565b60405180910390a2505050565b61060a611268565b73ffffffffffffffffffffffffffffffffffffffff8116610657576040517fe6c4247b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff81811660009081526007602052604090205416156106b6576040517fe6c4247b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff811660008181526007602090815260409182902080547fffffffffffffffffffffffff0000000000000000000000000000000000000000168417905590519182527fe45f5e140399b0a7e12971ab020724b828fbed8ac408c420884dc7d1bbe506b4910160405180910390a150565b600654606090600081841161074f5783610751565b815b90508085111561078d576040517fa22caccc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006107998683611deb565b67ffffffffffffffff8111156107b1576107b1611931565b6040519080825280602002602001820160405280156107da578160200160208202803683370190505b5090506000865b838110156108b7576000600682815481106107fe576107fe611dfe565b600091825260208083209091015480835260048252604080842073ffffffffffffffffffffffffffffffffffffffff8f168552909252912054909150156108a6576000818152600260209081526040808320546003835281842073ffffffffffffffffffffffffffffffffffffffff8f1685529092529091205481146108a4578185858060010196508151811061089757610897611dfe565b6020026020010181815250505b505b506108b081611e2d565b90506107e1565b5090979650505050505050565b6108cc611268565b60408051600180825281830190925260009160208083019080368337019050509050838160008151811061090257610902611dfe565b6020026020010181815250506000805b838110156109bf57600085858381811061092e5761092e611dfe565b6109449260206040909202019081019150611b8b565b600088815260046020908152604080832073ffffffffffffffffffffffffffffffffffffffff851684529091529020549091506109a887878581811061098c5761098c611dfe565b6109a29260206040909202019081019150611b8b565b86610ec4565b509290920191506109b881611e2d565b9050610912565b506109cc85858584611091565b847f8f668d6090683f98b3373a8b83d214da45737f7486cb7de554cc07b54e61cfe685856040516109fe929190611d54565b60405180910390a25050505050565b60008381526004602090815260408083203384529091529020548390158015610a4e575060005473ffffffffffffffffffffffffffffffffffffffff163314155b15610a85576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b604080516001808252818301909252600091602080830190803683370190505090508481600081518110610abb57610abb611dfe565b60200260200101818152505060005b83811015610b1357610b02858583818110610ae757610ae7611dfe565b9050602002016020810190610afc9190611b8b565b83610ec4565b50610b0c81611e2d565b9050610aca565b505050505050565b60015473ffffffffffffffffffffffffffffffffffffffff163314610ba1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e65720000000000000000000060448201526064015b60405180910390fd5b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b610c25611268565b73ffffffffffffffffffffffffffffffffffffffff81811660009081526007602052604090205416610c83576040517fe6c4247b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff16600090815260076020526040902080547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055565b3360008181526007602052604090205473ffffffffffffffffffffffffffffffffffffffff1614610d2c576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000805b83811015610e0b57848482818110610d4a57610d4a611dfe565b9050604002016020016020810190610d629190611e8d565b77ffffffffffffffffffffffffffffffffffffffffffffffff1660026000878785818110610d9257610d92611dfe565b6040908102929092013583525060208201929092520160002080549091019055848482818110610dc457610dc4611dfe565b9050604002016020016020810190610ddc9190611e8d565b77ffffffffffffffffffffffffffffffffffffffffffffffff168201915080610e0490611e2d565b9050610d30565b50610e4e73ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168330846112eb565b7fa1cc025ea76bacce5d740ee4bc331899375dc2c5f2ab33933aaacbd9ba001b66848484604051610e8193929190611ea8565b60405180910390a150505050565b60068181548110610e9f57600080fd5b600091825260209091200154905081565b610eb8611268565b610ec1816113cd565b50565b60008060005b8351811015611040576000848281518110610ee757610ee7611dfe565b6020026020010151905060006002600083815260200190815260200160002054905080600003610f18575050611030565b600082815260036020908152604080832073ffffffffffffffffffffffffffffffffffffffff8b16808552908352818420548685526004845282852091855292528220549083039190670de0b6b3a764000090830204905080600003610f815750505050611030565b600084815260036020908152604080832073ffffffffffffffffffffffffffffffffffffffff8d168085529252909120849055885196820196899087908110610fcc57610fcc611dfe565b60200260200101517f989969655bc1d593922527fe85d71347bb8e12fa423cc71f362dd8ef7cb10ef283604051611023919077ffffffffffffffffffffffffffffffffffffffffffffffff91909116815260200190565b60405180910390a3505050505b61103981611e2d565b9050610eca565b5080156110885761108873ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001685836114c2565b90505b92915050565b6110ec8383808060200260200160405190810160405280939291908181526020016000905b828210156110e2576110d360408302860136819003810190611f2f565b815260200190600101906110b6565b505050505061151d565b15611123576040517fe6c4247b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000805b8381101561122757600085858381811061114357611143611dfe565b905060400201602001602081019061115b9190611f8a565b67ffffffffffffffff169050600086868481811061117b5761117b611dfe565b6111919260206040909202019081019150611b8b565b905073ffffffffffffffffffffffffffffffffffffffff81166111e0576040517fe6c4247b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600088815260046020908152604080832073ffffffffffffffffffffffffffffffffffffffff909416835292905220819055919091019061122081611e2d565b9050611127565b50818114611261576040517f84677ce800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5050505050565b60005473ffffffffffffffffffffffffffffffffffffffff1633146112e9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e6572000000000000000000006044820152606401610b98565b565b60405173ffffffffffffffffffffffffffffffffffffffff808516602483015283166044820152606481018290526113c79085907f23b872dd00000000000000000000000000000000000000000000000000000000906084015b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff00000000000000000000000000000000000000000000000000000000909316929092179091526115d4565b50505050565b3373ffffffffffffffffffffffffffffffffffffffff82160361144c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c660000000000000000006044820152606401610b98565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b60405173ffffffffffffffffffffffffffffffffffffffff83166024820152604481018290526115189084907fa9059cbb0000000000000000000000000000000000000000000000000000000090606401611345565b505050565b6000805b82518110156115cb576000611537826001611fa5565b90505b83518110156115c25783818151811061155557611555611dfe565b60200260200101516000015173ffffffffffffffffffffffffffffffffffffffff1684838151811061158957611589611dfe565b60200260200101516000015173ffffffffffffffffffffffffffffffffffffffff16036115ba575060019392505050565b60010161153a565b50600101611521565b50600092915050565b6000611636826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166116e09092919063ffffffff16565b80519091501561151857808060200190518101906116549190611fb8565b611518576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610b98565b60606116ef84846000856116f7565b949350505050565b606082471015611789576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610b98565b6000808673ffffffffffffffffffffffffffffffffffffffff1685876040516117b29190611fda565b60006040518083038185875af1925050503d80600081146117ef576040519150601f19603f3d011682016040523d82523d6000602084013e6117f4565b606091505b509150915061180587838387611810565b979650505050505050565b606083156118a657825160000361189f5773ffffffffffffffffffffffffffffffffffffffff85163b61189f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610b98565b50816116ef565b6116ef83838151156118bb5781518083602001fd5b806040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b989190611b11565b60006020828403121561190157600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461108857600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff811182821017156119a7576119a7611931565b604052919050565b600060208083850312156119c257600080fd5b823567ffffffffffffffff808211156119da57600080fd5b818501915085601f8301126119ee57600080fd5b813581811115611a0057611a00611931565b8060051b9150611a11848301611960565b8181529183018401918481019088841115611a2b57600080fd5b938501935b83851015611a4957843582529385019390850190611a30565b98975050505050505050565b60008083601f840112611a6757600080fd5b50813567ffffffffffffffff811115611a7f57600080fd5b6020830191508360208260061b8501011115611a9a57600080fd5b9250929050565b600080600060408486031215611ab657600080fd5b83359250602084013567ffffffffffffffff811115611ad457600080fd5b611ae086828701611a55565b9497909650939450505050565b60005b83811015611b08578181015183820152602001611af0565b50506000910152565b6020815260008251806020840152611b30816040850160208701611aed565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b803573ffffffffffffffffffffffffffffffffffffffff81168114611b8657600080fd5b919050565b600060208284031215611b9d57600080fd5b611ba682611b62565b9392505050565b600060208284031215611bbf57600080fd5b5035919050565b600080600060608486031215611bdb57600080fd5b611be484611b62565b95602085013595506040909401359392505050565b6020808252825182820181905260009190848201906040850190845b81811015611c3157835183529284019291840191600101611c15565b50909695505050505050565b600080600060408486031215611c5257600080fd5b83359250602084013567ffffffffffffffff80821115611c7157600080fd5b818601915086601f830112611c8557600080fd5b813581811115611c9457600080fd5b8760208260051b8501011115611ca957600080fd5b6020830194508093505050509250925092565b60008060408385031215611ccf57600080fd5b82359150611cdf60208401611b62565b90509250929050565b600080600060408486031215611cfd57600080fd5b833567ffffffffffffffff811115611d1457600080fd5b611d2086828701611a55565b9094509250611d33905060208501611b62565b90509250925092565b803567ffffffffffffffff81168114611b8657600080fd5b6020808252818101839052600090604080840186845b878110156108b75773ffffffffffffffffffffffffffffffffffffffff611d9083611b62565b16835267ffffffffffffffff611da7868401611d3c565b16838601529183019190830190600101611d6a565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8181038181111561108b5761108b611dbc565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203611e5e57611e5e611dbc565b5060010190565b803577ffffffffffffffffffffffffffffffffffffffffffffffff81168114611b8657600080fd5b600060208284031215611e9f57600080fd5b611ba682611e65565b60408082528181018490526000908560608401835b87811015611f045782358252602077ffffffffffffffffffffffffffffffffffffffffffffffff611eef828601611e65565b16908301529183019190830190600101611ebd565b5080935050505073ffffffffffffffffffffffffffffffffffffffff83166020830152949350505050565b600060408284031215611f4157600080fd5b6040516040810181811067ffffffffffffffff82111715611f6457611f64611931565b604052611f7083611b62565b8152611f7e60208401611d3c565b60208201529392505050565b600060208284031215611f9c57600080fd5b611ba682611d3c565b8082018082111561108b5761108b611dbc565b600060208284031215611fca57600080fd5b8151801515811461108857600080fd5b60008251611fec818460208701611aed565b919091019291505056fea164736f6c6343000813000a", +} + +var DestinationRewardManagerABI = DestinationRewardManagerMetaData.ABI + +var DestinationRewardManagerBin = DestinationRewardManagerMetaData.Bin + +func DeployDestinationRewardManager(auth *bind.TransactOpts, backend bind.ContractBackend, linkAddress common.Address) (common.Address, *types.Transaction, *DestinationRewardManager, error) { + parsed, err := DestinationRewardManagerMetaData.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(DestinationRewardManagerBin), backend, linkAddress) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &DestinationRewardManager{address: address, abi: *parsed, DestinationRewardManagerCaller: DestinationRewardManagerCaller{contract: contract}, DestinationRewardManagerTransactor: DestinationRewardManagerTransactor{contract: contract}, DestinationRewardManagerFilterer: DestinationRewardManagerFilterer{contract: contract}}, nil +} + +type DestinationRewardManager struct { + address common.Address + abi abi.ABI + DestinationRewardManagerCaller + DestinationRewardManagerTransactor + DestinationRewardManagerFilterer +} + +type DestinationRewardManagerCaller struct { + contract *bind.BoundContract +} + +type DestinationRewardManagerTransactor struct { + contract *bind.BoundContract +} + +type DestinationRewardManagerFilterer struct { + contract *bind.BoundContract +} + +type DestinationRewardManagerSession struct { + Contract *DestinationRewardManager + CallOpts bind.CallOpts + TransactOpts bind.TransactOpts +} + +type DestinationRewardManagerCallerSession struct { + Contract *DestinationRewardManagerCaller + CallOpts bind.CallOpts +} + +type DestinationRewardManagerTransactorSession struct { + Contract *DestinationRewardManagerTransactor + TransactOpts bind.TransactOpts +} + +type DestinationRewardManagerRaw struct { + Contract *DestinationRewardManager +} + +type DestinationRewardManagerCallerRaw struct { + Contract *DestinationRewardManagerCaller +} + +type DestinationRewardManagerTransactorRaw struct { + Contract *DestinationRewardManagerTransactor +} + +func NewDestinationRewardManager(address common.Address, backend bind.ContractBackend) (*DestinationRewardManager, error) { + abi, err := abi.JSON(strings.NewReader(DestinationRewardManagerABI)) + if err != nil { + return nil, err + } + contract, err := bindDestinationRewardManager(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &DestinationRewardManager{address: address, abi: abi, DestinationRewardManagerCaller: DestinationRewardManagerCaller{contract: contract}, DestinationRewardManagerTransactor: DestinationRewardManagerTransactor{contract: contract}, DestinationRewardManagerFilterer: DestinationRewardManagerFilterer{contract: contract}}, nil +} + +func NewDestinationRewardManagerCaller(address common.Address, caller bind.ContractCaller) (*DestinationRewardManagerCaller, error) { + contract, err := bindDestinationRewardManager(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &DestinationRewardManagerCaller{contract: contract}, nil +} + +func NewDestinationRewardManagerTransactor(address common.Address, transactor bind.ContractTransactor) (*DestinationRewardManagerTransactor, error) { + contract, err := bindDestinationRewardManager(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &DestinationRewardManagerTransactor{contract: contract}, nil +} + +func NewDestinationRewardManagerFilterer(address common.Address, filterer bind.ContractFilterer) (*DestinationRewardManagerFilterer, error) { + contract, err := bindDestinationRewardManager(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &DestinationRewardManagerFilterer{contract: contract}, nil +} + +func bindDestinationRewardManager(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := DestinationRewardManagerMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +func (_DestinationRewardManager *DestinationRewardManagerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _DestinationRewardManager.Contract.DestinationRewardManagerCaller.contract.Call(opts, result, method, params...) +} + +func (_DestinationRewardManager *DestinationRewardManagerRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _DestinationRewardManager.Contract.DestinationRewardManagerTransactor.contract.Transfer(opts) +} + +func (_DestinationRewardManager *DestinationRewardManagerRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _DestinationRewardManager.Contract.DestinationRewardManagerTransactor.contract.Transact(opts, method, params...) +} + +func (_DestinationRewardManager *DestinationRewardManagerCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _DestinationRewardManager.Contract.contract.Call(opts, result, method, params...) +} + +func (_DestinationRewardManager *DestinationRewardManagerTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _DestinationRewardManager.Contract.contract.Transfer(opts) +} + +func (_DestinationRewardManager *DestinationRewardManagerTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _DestinationRewardManager.Contract.contract.Transact(opts, method, params...) +} + +func (_DestinationRewardManager *DestinationRewardManagerCaller) GetAvailableRewardPoolIds(opts *bind.CallOpts, recipient common.Address, startIndex *big.Int, endIndex *big.Int) ([][32]byte, error) { + var out []interface{} + err := _DestinationRewardManager.contract.Call(opts, &out, "getAvailableRewardPoolIds", recipient, startIndex, endIndex) + + if err != nil { + return *new([][32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([][32]byte)).(*[][32]byte) + + return out0, err + +} + +func (_DestinationRewardManager *DestinationRewardManagerSession) GetAvailableRewardPoolIds(recipient common.Address, startIndex *big.Int, endIndex *big.Int) ([][32]byte, error) { + return _DestinationRewardManager.Contract.GetAvailableRewardPoolIds(&_DestinationRewardManager.CallOpts, recipient, startIndex, endIndex) +} + +func (_DestinationRewardManager *DestinationRewardManagerCallerSession) GetAvailableRewardPoolIds(recipient common.Address, startIndex *big.Int, endIndex *big.Int) ([][32]byte, error) { + return _DestinationRewardManager.Contract.GetAvailableRewardPoolIds(&_DestinationRewardManager.CallOpts, recipient, startIndex, endIndex) +} + +func (_DestinationRewardManager *DestinationRewardManagerCaller) ILinkAddress(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _DestinationRewardManager.contract.Call(opts, &out, "i_linkAddress") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_DestinationRewardManager *DestinationRewardManagerSession) ILinkAddress() (common.Address, error) { + return _DestinationRewardManager.Contract.ILinkAddress(&_DestinationRewardManager.CallOpts) +} + +func (_DestinationRewardManager *DestinationRewardManagerCallerSession) ILinkAddress() (common.Address, error) { + return _DestinationRewardManager.Contract.ILinkAddress(&_DestinationRewardManager.CallOpts) +} + +func (_DestinationRewardManager *DestinationRewardManagerCaller) Owner(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _DestinationRewardManager.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 + +} + +func (_DestinationRewardManager *DestinationRewardManagerSession) Owner() (common.Address, error) { + return _DestinationRewardManager.Contract.Owner(&_DestinationRewardManager.CallOpts) +} + +func (_DestinationRewardManager *DestinationRewardManagerCallerSession) Owner() (common.Address, error) { + return _DestinationRewardManager.Contract.Owner(&_DestinationRewardManager.CallOpts) +} + +func (_DestinationRewardManager *DestinationRewardManagerCaller) SFeeManagerAddressList(opts *bind.CallOpts, arg0 common.Address) (common.Address, error) { + var out []interface{} + err := _DestinationRewardManager.contract.Call(opts, &out, "s_feeManagerAddressList", arg0) + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_DestinationRewardManager *DestinationRewardManagerSession) SFeeManagerAddressList(arg0 common.Address) (common.Address, error) { + return _DestinationRewardManager.Contract.SFeeManagerAddressList(&_DestinationRewardManager.CallOpts, arg0) +} + +func (_DestinationRewardManager *DestinationRewardManagerCallerSession) SFeeManagerAddressList(arg0 common.Address) (common.Address, error) { + return _DestinationRewardManager.Contract.SFeeManagerAddressList(&_DestinationRewardManager.CallOpts, arg0) +} + +func (_DestinationRewardManager *DestinationRewardManagerCaller) SRegisteredPoolIds(opts *bind.CallOpts, arg0 *big.Int) ([32]byte, error) { + var out []interface{} + err := _DestinationRewardManager.contract.Call(opts, &out, "s_registeredPoolIds", arg0) + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +func (_DestinationRewardManager *DestinationRewardManagerSession) SRegisteredPoolIds(arg0 *big.Int) ([32]byte, error) { + return _DestinationRewardManager.Contract.SRegisteredPoolIds(&_DestinationRewardManager.CallOpts, arg0) +} + +func (_DestinationRewardManager *DestinationRewardManagerCallerSession) SRegisteredPoolIds(arg0 *big.Int) ([32]byte, error) { + return _DestinationRewardManager.Contract.SRegisteredPoolIds(&_DestinationRewardManager.CallOpts, arg0) +} + +func (_DestinationRewardManager *DestinationRewardManagerCaller) SRewardRecipientWeights(opts *bind.CallOpts, arg0 [32]byte, arg1 common.Address) (*big.Int, error) { + var out []interface{} + err := _DestinationRewardManager.contract.Call(opts, &out, "s_rewardRecipientWeights", arg0, arg1) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_DestinationRewardManager *DestinationRewardManagerSession) SRewardRecipientWeights(arg0 [32]byte, arg1 common.Address) (*big.Int, error) { + return _DestinationRewardManager.Contract.SRewardRecipientWeights(&_DestinationRewardManager.CallOpts, arg0, arg1) +} + +func (_DestinationRewardManager *DestinationRewardManagerCallerSession) SRewardRecipientWeights(arg0 [32]byte, arg1 common.Address) (*big.Int, error) { + return _DestinationRewardManager.Contract.SRewardRecipientWeights(&_DestinationRewardManager.CallOpts, arg0, arg1) +} + +func (_DestinationRewardManager *DestinationRewardManagerCaller) SRewardRecipientWeightsSet(opts *bind.CallOpts, arg0 [32]byte) (bool, error) { + var out []interface{} + err := _DestinationRewardManager.contract.Call(opts, &out, "s_rewardRecipientWeightsSet", arg0) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_DestinationRewardManager *DestinationRewardManagerSession) SRewardRecipientWeightsSet(arg0 [32]byte) (bool, error) { + return _DestinationRewardManager.Contract.SRewardRecipientWeightsSet(&_DestinationRewardManager.CallOpts, arg0) +} + +func (_DestinationRewardManager *DestinationRewardManagerCallerSession) SRewardRecipientWeightsSet(arg0 [32]byte) (bool, error) { + return _DestinationRewardManager.Contract.SRewardRecipientWeightsSet(&_DestinationRewardManager.CallOpts, arg0) +} + +func (_DestinationRewardManager *DestinationRewardManagerCaller) STotalRewardRecipientFees(opts *bind.CallOpts, arg0 [32]byte) (*big.Int, error) { + var out []interface{} + err := _DestinationRewardManager.contract.Call(opts, &out, "s_totalRewardRecipientFees", arg0) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_DestinationRewardManager *DestinationRewardManagerSession) STotalRewardRecipientFees(arg0 [32]byte) (*big.Int, error) { + return _DestinationRewardManager.Contract.STotalRewardRecipientFees(&_DestinationRewardManager.CallOpts, arg0) +} + +func (_DestinationRewardManager *DestinationRewardManagerCallerSession) STotalRewardRecipientFees(arg0 [32]byte) (*big.Int, error) { + return _DestinationRewardManager.Contract.STotalRewardRecipientFees(&_DestinationRewardManager.CallOpts, arg0) +} + +func (_DestinationRewardManager *DestinationRewardManagerCaller) STotalRewardRecipientFeesLastClaimedAmounts(opts *bind.CallOpts, arg0 [32]byte, arg1 common.Address) (*big.Int, error) { + var out []interface{} + err := _DestinationRewardManager.contract.Call(opts, &out, "s_totalRewardRecipientFeesLastClaimedAmounts", arg0, arg1) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +func (_DestinationRewardManager *DestinationRewardManagerSession) STotalRewardRecipientFeesLastClaimedAmounts(arg0 [32]byte, arg1 common.Address) (*big.Int, error) { + return _DestinationRewardManager.Contract.STotalRewardRecipientFeesLastClaimedAmounts(&_DestinationRewardManager.CallOpts, arg0, arg1) +} + +func (_DestinationRewardManager *DestinationRewardManagerCallerSession) STotalRewardRecipientFeesLastClaimedAmounts(arg0 [32]byte, arg1 common.Address) (*big.Int, error) { + return _DestinationRewardManager.Contract.STotalRewardRecipientFeesLastClaimedAmounts(&_DestinationRewardManager.CallOpts, arg0, arg1) +} + +func (_DestinationRewardManager *DestinationRewardManagerCaller) SupportsInterface(opts *bind.CallOpts, interfaceId [4]byte) (bool, error) { + var out []interface{} + err := _DestinationRewardManager.contract.Call(opts, &out, "supportsInterface", interfaceId) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_DestinationRewardManager *DestinationRewardManagerSession) SupportsInterface(interfaceId [4]byte) (bool, error) { + return _DestinationRewardManager.Contract.SupportsInterface(&_DestinationRewardManager.CallOpts, interfaceId) +} + +func (_DestinationRewardManager *DestinationRewardManagerCallerSession) SupportsInterface(interfaceId [4]byte) (bool, error) { + return _DestinationRewardManager.Contract.SupportsInterface(&_DestinationRewardManager.CallOpts, interfaceId) +} + +func (_DestinationRewardManager *DestinationRewardManagerCaller) TypeAndVersion(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _DestinationRewardManager.contract.Call(opts, &out, "typeAndVersion") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +func (_DestinationRewardManager *DestinationRewardManagerSession) TypeAndVersion() (string, error) { + return _DestinationRewardManager.Contract.TypeAndVersion(&_DestinationRewardManager.CallOpts) +} + +func (_DestinationRewardManager *DestinationRewardManagerCallerSession) TypeAndVersion() (string, error) { + return _DestinationRewardManager.Contract.TypeAndVersion(&_DestinationRewardManager.CallOpts) +} + +func (_DestinationRewardManager *DestinationRewardManagerTransactor) AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + return _DestinationRewardManager.contract.Transact(opts, "acceptOwnership") +} + +func (_DestinationRewardManager *DestinationRewardManagerSession) AcceptOwnership() (*types.Transaction, error) { + return _DestinationRewardManager.Contract.AcceptOwnership(&_DestinationRewardManager.TransactOpts) +} + +func (_DestinationRewardManager *DestinationRewardManagerTransactorSession) AcceptOwnership() (*types.Transaction, error) { + return _DestinationRewardManager.Contract.AcceptOwnership(&_DestinationRewardManager.TransactOpts) +} + +func (_DestinationRewardManager *DestinationRewardManagerTransactor) AddFeeManager(opts *bind.TransactOpts, newFeeManagerAddress common.Address) (*types.Transaction, error) { + return _DestinationRewardManager.contract.Transact(opts, "addFeeManager", newFeeManagerAddress) +} + +func (_DestinationRewardManager *DestinationRewardManagerSession) AddFeeManager(newFeeManagerAddress common.Address) (*types.Transaction, error) { + return _DestinationRewardManager.Contract.AddFeeManager(&_DestinationRewardManager.TransactOpts, newFeeManagerAddress) +} + +func (_DestinationRewardManager *DestinationRewardManagerTransactorSession) AddFeeManager(newFeeManagerAddress common.Address) (*types.Transaction, error) { + return _DestinationRewardManager.Contract.AddFeeManager(&_DestinationRewardManager.TransactOpts, newFeeManagerAddress) +} + +func (_DestinationRewardManager *DestinationRewardManagerTransactor) ClaimRewards(opts *bind.TransactOpts, poolIds [][32]byte) (*types.Transaction, error) { + return _DestinationRewardManager.contract.Transact(opts, "claimRewards", poolIds) +} + +func (_DestinationRewardManager *DestinationRewardManagerSession) ClaimRewards(poolIds [][32]byte) (*types.Transaction, error) { + return _DestinationRewardManager.Contract.ClaimRewards(&_DestinationRewardManager.TransactOpts, poolIds) +} + +func (_DestinationRewardManager *DestinationRewardManagerTransactorSession) ClaimRewards(poolIds [][32]byte) (*types.Transaction, error) { + return _DestinationRewardManager.Contract.ClaimRewards(&_DestinationRewardManager.TransactOpts, poolIds) +} + +func (_DestinationRewardManager *DestinationRewardManagerTransactor) OnFeePaid(opts *bind.TransactOpts, payments []IDestinationRewardManagerFeePayment, payer common.Address) (*types.Transaction, error) { + return _DestinationRewardManager.contract.Transact(opts, "onFeePaid", payments, payer) +} + +func (_DestinationRewardManager *DestinationRewardManagerSession) OnFeePaid(payments []IDestinationRewardManagerFeePayment, payer common.Address) (*types.Transaction, error) { + return _DestinationRewardManager.Contract.OnFeePaid(&_DestinationRewardManager.TransactOpts, payments, payer) +} + +func (_DestinationRewardManager *DestinationRewardManagerTransactorSession) OnFeePaid(payments []IDestinationRewardManagerFeePayment, payer common.Address) (*types.Transaction, error) { + return _DestinationRewardManager.Contract.OnFeePaid(&_DestinationRewardManager.TransactOpts, payments, payer) +} + +func (_DestinationRewardManager *DestinationRewardManagerTransactor) PayRecipients(opts *bind.TransactOpts, poolId [32]byte, recipients []common.Address) (*types.Transaction, error) { + return _DestinationRewardManager.contract.Transact(opts, "payRecipients", poolId, recipients) +} + +func (_DestinationRewardManager *DestinationRewardManagerSession) PayRecipients(poolId [32]byte, recipients []common.Address) (*types.Transaction, error) { + return _DestinationRewardManager.Contract.PayRecipients(&_DestinationRewardManager.TransactOpts, poolId, recipients) +} + +func (_DestinationRewardManager *DestinationRewardManagerTransactorSession) PayRecipients(poolId [32]byte, recipients []common.Address) (*types.Transaction, error) { + return _DestinationRewardManager.Contract.PayRecipients(&_DestinationRewardManager.TransactOpts, poolId, recipients) +} + +func (_DestinationRewardManager *DestinationRewardManagerTransactor) RemoveFeeManager(opts *bind.TransactOpts, feeManagerAddress common.Address) (*types.Transaction, error) { + return _DestinationRewardManager.contract.Transact(opts, "removeFeeManager", feeManagerAddress) +} + +func (_DestinationRewardManager *DestinationRewardManagerSession) RemoveFeeManager(feeManagerAddress common.Address) (*types.Transaction, error) { + return _DestinationRewardManager.Contract.RemoveFeeManager(&_DestinationRewardManager.TransactOpts, feeManagerAddress) +} + +func (_DestinationRewardManager *DestinationRewardManagerTransactorSession) RemoveFeeManager(feeManagerAddress common.Address) (*types.Transaction, error) { + return _DestinationRewardManager.Contract.RemoveFeeManager(&_DestinationRewardManager.TransactOpts, feeManagerAddress) +} + +func (_DestinationRewardManager *DestinationRewardManagerTransactor) SetRewardRecipients(opts *bind.TransactOpts, poolId [32]byte, rewardRecipientAndWeights []CommonAddressAndWeight) (*types.Transaction, error) { + return _DestinationRewardManager.contract.Transact(opts, "setRewardRecipients", poolId, rewardRecipientAndWeights) +} + +func (_DestinationRewardManager *DestinationRewardManagerSession) SetRewardRecipients(poolId [32]byte, rewardRecipientAndWeights []CommonAddressAndWeight) (*types.Transaction, error) { + return _DestinationRewardManager.Contract.SetRewardRecipients(&_DestinationRewardManager.TransactOpts, poolId, rewardRecipientAndWeights) +} + +func (_DestinationRewardManager *DestinationRewardManagerTransactorSession) SetRewardRecipients(poolId [32]byte, rewardRecipientAndWeights []CommonAddressAndWeight) (*types.Transaction, error) { + return _DestinationRewardManager.Contract.SetRewardRecipients(&_DestinationRewardManager.TransactOpts, poolId, rewardRecipientAndWeights) +} + +func (_DestinationRewardManager *DestinationRewardManagerTransactor) TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) { + return _DestinationRewardManager.contract.Transact(opts, "transferOwnership", to) +} + +func (_DestinationRewardManager *DestinationRewardManagerSession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _DestinationRewardManager.Contract.TransferOwnership(&_DestinationRewardManager.TransactOpts, to) +} + +func (_DestinationRewardManager *DestinationRewardManagerTransactorSession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _DestinationRewardManager.Contract.TransferOwnership(&_DestinationRewardManager.TransactOpts, to) +} + +func (_DestinationRewardManager *DestinationRewardManagerTransactor) UpdateRewardRecipients(opts *bind.TransactOpts, poolId [32]byte, newRewardRecipients []CommonAddressAndWeight) (*types.Transaction, error) { + return _DestinationRewardManager.contract.Transact(opts, "updateRewardRecipients", poolId, newRewardRecipients) +} + +func (_DestinationRewardManager *DestinationRewardManagerSession) UpdateRewardRecipients(poolId [32]byte, newRewardRecipients []CommonAddressAndWeight) (*types.Transaction, error) { + return _DestinationRewardManager.Contract.UpdateRewardRecipients(&_DestinationRewardManager.TransactOpts, poolId, newRewardRecipients) +} + +func (_DestinationRewardManager *DestinationRewardManagerTransactorSession) UpdateRewardRecipients(poolId [32]byte, newRewardRecipients []CommonAddressAndWeight) (*types.Transaction, error) { + return _DestinationRewardManager.Contract.UpdateRewardRecipients(&_DestinationRewardManager.TransactOpts, poolId, newRewardRecipients) +} + +type DestinationRewardManagerFeeManagerUpdatedIterator struct { + Event *DestinationRewardManagerFeeManagerUpdated + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *DestinationRewardManagerFeeManagerUpdatedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(DestinationRewardManagerFeeManagerUpdated) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(DestinationRewardManagerFeeManagerUpdated) + 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() + } +} + +func (it *DestinationRewardManagerFeeManagerUpdatedIterator) Error() error { + return it.fail +} + +func (it *DestinationRewardManagerFeeManagerUpdatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type DestinationRewardManagerFeeManagerUpdated struct { + NewFeeManagerAddress common.Address + Raw types.Log +} + +func (_DestinationRewardManager *DestinationRewardManagerFilterer) FilterFeeManagerUpdated(opts *bind.FilterOpts) (*DestinationRewardManagerFeeManagerUpdatedIterator, error) { + + logs, sub, err := _DestinationRewardManager.contract.FilterLogs(opts, "FeeManagerUpdated") + if err != nil { + return nil, err + } + return &DestinationRewardManagerFeeManagerUpdatedIterator{contract: _DestinationRewardManager.contract, event: "FeeManagerUpdated", logs: logs, sub: sub}, nil +} + +func (_DestinationRewardManager *DestinationRewardManagerFilterer) WatchFeeManagerUpdated(opts *bind.WatchOpts, sink chan<- *DestinationRewardManagerFeeManagerUpdated) (event.Subscription, error) { + + logs, sub, err := _DestinationRewardManager.contract.WatchLogs(opts, "FeeManagerUpdated") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(DestinationRewardManagerFeeManagerUpdated) + if err := _DestinationRewardManager.contract.UnpackLog(event, "FeeManagerUpdated", 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 +} + +func (_DestinationRewardManager *DestinationRewardManagerFilterer) ParseFeeManagerUpdated(log types.Log) (*DestinationRewardManagerFeeManagerUpdated, error) { + event := new(DestinationRewardManagerFeeManagerUpdated) + if err := _DestinationRewardManager.contract.UnpackLog(event, "FeeManagerUpdated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type DestinationRewardManagerFeePaidIterator struct { + Event *DestinationRewardManagerFeePaid + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *DestinationRewardManagerFeePaidIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(DestinationRewardManagerFeePaid) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(DestinationRewardManagerFeePaid) + 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() + } +} + +func (it *DestinationRewardManagerFeePaidIterator) Error() error { + return it.fail +} + +func (it *DestinationRewardManagerFeePaidIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type DestinationRewardManagerFeePaid struct { + Payments []IDestinationRewardManagerFeePayment + Payer common.Address + Raw types.Log +} + +func (_DestinationRewardManager *DestinationRewardManagerFilterer) FilterFeePaid(opts *bind.FilterOpts) (*DestinationRewardManagerFeePaidIterator, error) { + + logs, sub, err := _DestinationRewardManager.contract.FilterLogs(opts, "FeePaid") + if err != nil { + return nil, err + } + return &DestinationRewardManagerFeePaidIterator{contract: _DestinationRewardManager.contract, event: "FeePaid", logs: logs, sub: sub}, nil +} + +func (_DestinationRewardManager *DestinationRewardManagerFilterer) WatchFeePaid(opts *bind.WatchOpts, sink chan<- *DestinationRewardManagerFeePaid) (event.Subscription, error) { + + logs, sub, err := _DestinationRewardManager.contract.WatchLogs(opts, "FeePaid") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(DestinationRewardManagerFeePaid) + if err := _DestinationRewardManager.contract.UnpackLog(event, "FeePaid", 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 +} + +func (_DestinationRewardManager *DestinationRewardManagerFilterer) ParseFeePaid(log types.Log) (*DestinationRewardManagerFeePaid, error) { + event := new(DestinationRewardManagerFeePaid) + if err := _DestinationRewardManager.contract.UnpackLog(event, "FeePaid", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type DestinationRewardManagerOwnershipTransferRequestedIterator struct { + Event *DestinationRewardManagerOwnershipTransferRequested + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *DestinationRewardManagerOwnershipTransferRequestedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(DestinationRewardManagerOwnershipTransferRequested) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(DestinationRewardManagerOwnershipTransferRequested) + 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() + } +} + +func (it *DestinationRewardManagerOwnershipTransferRequestedIterator) Error() error { + return it.fail +} + +func (it *DestinationRewardManagerOwnershipTransferRequestedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type DestinationRewardManagerOwnershipTransferRequested struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_DestinationRewardManager *DestinationRewardManagerFilterer) FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*DestinationRewardManagerOwnershipTransferRequestedIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _DestinationRewardManager.contract.FilterLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return &DestinationRewardManagerOwnershipTransferRequestedIterator{contract: _DestinationRewardManager.contract, event: "OwnershipTransferRequested", logs: logs, sub: sub}, nil +} + +func (_DestinationRewardManager *DestinationRewardManagerFilterer) WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *DestinationRewardManagerOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _DestinationRewardManager.contract.WatchLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(DestinationRewardManagerOwnershipTransferRequested) + if err := _DestinationRewardManager.contract.UnpackLog(event, "OwnershipTransferRequested", 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 +} + +func (_DestinationRewardManager *DestinationRewardManagerFilterer) ParseOwnershipTransferRequested(log types.Log) (*DestinationRewardManagerOwnershipTransferRequested, error) { + event := new(DestinationRewardManagerOwnershipTransferRequested) + if err := _DestinationRewardManager.contract.UnpackLog(event, "OwnershipTransferRequested", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type DestinationRewardManagerOwnershipTransferredIterator struct { + Event *DestinationRewardManagerOwnershipTransferred + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *DestinationRewardManagerOwnershipTransferredIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(DestinationRewardManagerOwnershipTransferred) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(DestinationRewardManagerOwnershipTransferred) + 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() + } +} + +func (it *DestinationRewardManagerOwnershipTransferredIterator) Error() error { + return it.fail +} + +func (it *DestinationRewardManagerOwnershipTransferredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type DestinationRewardManagerOwnershipTransferred struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_DestinationRewardManager *DestinationRewardManagerFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*DestinationRewardManagerOwnershipTransferredIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _DestinationRewardManager.contract.FilterLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return &DestinationRewardManagerOwnershipTransferredIterator{contract: _DestinationRewardManager.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil +} + +func (_DestinationRewardManager *DestinationRewardManagerFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *DestinationRewardManagerOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _DestinationRewardManager.contract.WatchLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(DestinationRewardManagerOwnershipTransferred) + if err := _DestinationRewardManager.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 +} + +func (_DestinationRewardManager *DestinationRewardManagerFilterer) ParseOwnershipTransferred(log types.Log) (*DestinationRewardManagerOwnershipTransferred, error) { + event := new(DestinationRewardManagerOwnershipTransferred) + if err := _DestinationRewardManager.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type DestinationRewardManagerRewardRecipientsUpdatedIterator struct { + Event *DestinationRewardManagerRewardRecipientsUpdated + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *DestinationRewardManagerRewardRecipientsUpdatedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(DestinationRewardManagerRewardRecipientsUpdated) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(DestinationRewardManagerRewardRecipientsUpdated) + 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() + } +} + +func (it *DestinationRewardManagerRewardRecipientsUpdatedIterator) Error() error { + return it.fail +} + +func (it *DestinationRewardManagerRewardRecipientsUpdatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type DestinationRewardManagerRewardRecipientsUpdated struct { + PoolId [32]byte + NewRewardRecipients []CommonAddressAndWeight + Raw types.Log +} + +func (_DestinationRewardManager *DestinationRewardManagerFilterer) FilterRewardRecipientsUpdated(opts *bind.FilterOpts, poolId [][32]byte) (*DestinationRewardManagerRewardRecipientsUpdatedIterator, error) { + + var poolIdRule []interface{} + for _, poolIdItem := range poolId { + poolIdRule = append(poolIdRule, poolIdItem) + } + + logs, sub, err := _DestinationRewardManager.contract.FilterLogs(opts, "RewardRecipientsUpdated", poolIdRule) + if err != nil { + return nil, err + } + return &DestinationRewardManagerRewardRecipientsUpdatedIterator{contract: _DestinationRewardManager.contract, event: "RewardRecipientsUpdated", logs: logs, sub: sub}, nil +} + +func (_DestinationRewardManager *DestinationRewardManagerFilterer) WatchRewardRecipientsUpdated(opts *bind.WatchOpts, sink chan<- *DestinationRewardManagerRewardRecipientsUpdated, poolId [][32]byte) (event.Subscription, error) { + + var poolIdRule []interface{} + for _, poolIdItem := range poolId { + poolIdRule = append(poolIdRule, poolIdItem) + } + + logs, sub, err := _DestinationRewardManager.contract.WatchLogs(opts, "RewardRecipientsUpdated", poolIdRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(DestinationRewardManagerRewardRecipientsUpdated) + if err := _DestinationRewardManager.contract.UnpackLog(event, "RewardRecipientsUpdated", 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 +} + +func (_DestinationRewardManager *DestinationRewardManagerFilterer) ParseRewardRecipientsUpdated(log types.Log) (*DestinationRewardManagerRewardRecipientsUpdated, error) { + event := new(DestinationRewardManagerRewardRecipientsUpdated) + if err := _DestinationRewardManager.contract.UnpackLog(event, "RewardRecipientsUpdated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type DestinationRewardManagerRewardsClaimedIterator struct { + Event *DestinationRewardManagerRewardsClaimed + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *DestinationRewardManagerRewardsClaimedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(DestinationRewardManagerRewardsClaimed) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(DestinationRewardManagerRewardsClaimed) + 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() + } +} + +func (it *DestinationRewardManagerRewardsClaimedIterator) Error() error { + return it.fail +} + +func (it *DestinationRewardManagerRewardsClaimedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type DestinationRewardManagerRewardsClaimed struct { + PoolId [32]byte + Recipient common.Address + Quantity *big.Int + Raw types.Log +} + +func (_DestinationRewardManager *DestinationRewardManagerFilterer) FilterRewardsClaimed(opts *bind.FilterOpts, poolId [][32]byte, recipient []common.Address) (*DestinationRewardManagerRewardsClaimedIterator, error) { + + var poolIdRule []interface{} + for _, poolIdItem := range poolId { + poolIdRule = append(poolIdRule, poolIdItem) + } + var recipientRule []interface{} + for _, recipientItem := range recipient { + recipientRule = append(recipientRule, recipientItem) + } + + logs, sub, err := _DestinationRewardManager.contract.FilterLogs(opts, "RewardsClaimed", poolIdRule, recipientRule) + if err != nil { + return nil, err + } + return &DestinationRewardManagerRewardsClaimedIterator{contract: _DestinationRewardManager.contract, event: "RewardsClaimed", logs: logs, sub: sub}, nil +} + +func (_DestinationRewardManager *DestinationRewardManagerFilterer) WatchRewardsClaimed(opts *bind.WatchOpts, sink chan<- *DestinationRewardManagerRewardsClaimed, poolId [][32]byte, recipient []common.Address) (event.Subscription, error) { + + var poolIdRule []interface{} + for _, poolIdItem := range poolId { + poolIdRule = append(poolIdRule, poolIdItem) + } + var recipientRule []interface{} + for _, recipientItem := range recipient { + recipientRule = append(recipientRule, recipientItem) + } + + logs, sub, err := _DestinationRewardManager.contract.WatchLogs(opts, "RewardsClaimed", poolIdRule, recipientRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(DestinationRewardManagerRewardsClaimed) + if err := _DestinationRewardManager.contract.UnpackLog(event, "RewardsClaimed", 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 +} + +func (_DestinationRewardManager *DestinationRewardManagerFilterer) ParseRewardsClaimed(log types.Log) (*DestinationRewardManagerRewardsClaimed, error) { + event := new(DestinationRewardManagerRewardsClaimed) + if err := _DestinationRewardManager.contract.UnpackLog(event, "RewardsClaimed", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +func (_DestinationRewardManager *DestinationRewardManager) ParseLog(log types.Log) (generated.AbigenLog, error) { + switch log.Topics[0] { + case _DestinationRewardManager.abi.Events["FeeManagerUpdated"].ID: + return _DestinationRewardManager.ParseFeeManagerUpdated(log) + case _DestinationRewardManager.abi.Events["FeePaid"].ID: + return _DestinationRewardManager.ParseFeePaid(log) + case _DestinationRewardManager.abi.Events["OwnershipTransferRequested"].ID: + return _DestinationRewardManager.ParseOwnershipTransferRequested(log) + case _DestinationRewardManager.abi.Events["OwnershipTransferred"].ID: + return _DestinationRewardManager.ParseOwnershipTransferred(log) + case _DestinationRewardManager.abi.Events["RewardRecipientsUpdated"].ID: + return _DestinationRewardManager.ParseRewardRecipientsUpdated(log) + case _DestinationRewardManager.abi.Events["RewardsClaimed"].ID: + return _DestinationRewardManager.ParseRewardsClaimed(log) + + default: + return nil, fmt.Errorf("abigen wrapper received unknown log topic: %v", log.Topics[0]) + } +} + +func (DestinationRewardManagerFeeManagerUpdated) Topic() common.Hash { + return common.HexToHash("0xe45f5e140399b0a7e12971ab020724b828fbed8ac408c420884dc7d1bbe506b4") +} + +func (DestinationRewardManagerFeePaid) Topic() common.Hash { + return common.HexToHash("0xa1cc025ea76bacce5d740ee4bc331899375dc2c5f2ab33933aaacbd9ba001b66") +} + +func (DestinationRewardManagerOwnershipTransferRequested) Topic() common.Hash { + return common.HexToHash("0xed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae1278") +} + +func (DestinationRewardManagerOwnershipTransferred) Topic() common.Hash { + return common.HexToHash("0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0") +} + +func (DestinationRewardManagerRewardRecipientsUpdated) Topic() common.Hash { + return common.HexToHash("0x8f668d6090683f98b3373a8b83d214da45737f7486cb7de554cc07b54e61cfe6") +} + +func (DestinationRewardManagerRewardsClaimed) Topic() common.Hash { + return common.HexToHash("0x989969655bc1d593922527fe85d71347bb8e12fa423cc71f362dd8ef7cb10ef2") +} + +func (_DestinationRewardManager *DestinationRewardManager) Address() common.Address { + return _DestinationRewardManager.address +} + +type DestinationRewardManagerInterface interface { + GetAvailableRewardPoolIds(opts *bind.CallOpts, recipient common.Address, startIndex *big.Int, endIndex *big.Int) ([][32]byte, error) + + ILinkAddress(opts *bind.CallOpts) (common.Address, error) + + Owner(opts *bind.CallOpts) (common.Address, error) + + SFeeManagerAddressList(opts *bind.CallOpts, arg0 common.Address) (common.Address, error) + + SRegisteredPoolIds(opts *bind.CallOpts, arg0 *big.Int) ([32]byte, error) + + SRewardRecipientWeights(opts *bind.CallOpts, arg0 [32]byte, arg1 common.Address) (*big.Int, error) + + SRewardRecipientWeightsSet(opts *bind.CallOpts, arg0 [32]byte) (bool, error) + + STotalRewardRecipientFees(opts *bind.CallOpts, arg0 [32]byte) (*big.Int, error) + + STotalRewardRecipientFeesLastClaimedAmounts(opts *bind.CallOpts, arg0 [32]byte, arg1 common.Address) (*big.Int, error) + + SupportsInterface(opts *bind.CallOpts, interfaceId [4]byte) (bool, error) + + TypeAndVersion(opts *bind.CallOpts) (string, error) + + AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) + + AddFeeManager(opts *bind.TransactOpts, newFeeManagerAddress common.Address) (*types.Transaction, error) + + ClaimRewards(opts *bind.TransactOpts, poolIds [][32]byte) (*types.Transaction, error) + + OnFeePaid(opts *bind.TransactOpts, payments []IDestinationRewardManagerFeePayment, payer common.Address) (*types.Transaction, error) + + PayRecipients(opts *bind.TransactOpts, poolId [32]byte, recipients []common.Address) (*types.Transaction, error) + + RemoveFeeManager(opts *bind.TransactOpts, feeManagerAddress common.Address) (*types.Transaction, error) + + SetRewardRecipients(opts *bind.TransactOpts, poolId [32]byte, rewardRecipientAndWeights []CommonAddressAndWeight) (*types.Transaction, error) + + TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) + + UpdateRewardRecipients(opts *bind.TransactOpts, poolId [32]byte, newRewardRecipients []CommonAddressAndWeight) (*types.Transaction, error) + + FilterFeeManagerUpdated(opts *bind.FilterOpts) (*DestinationRewardManagerFeeManagerUpdatedIterator, error) + + WatchFeeManagerUpdated(opts *bind.WatchOpts, sink chan<- *DestinationRewardManagerFeeManagerUpdated) (event.Subscription, error) + + ParseFeeManagerUpdated(log types.Log) (*DestinationRewardManagerFeeManagerUpdated, error) + + FilterFeePaid(opts *bind.FilterOpts) (*DestinationRewardManagerFeePaidIterator, error) + + WatchFeePaid(opts *bind.WatchOpts, sink chan<- *DestinationRewardManagerFeePaid) (event.Subscription, error) + + ParseFeePaid(log types.Log) (*DestinationRewardManagerFeePaid, error) + + FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*DestinationRewardManagerOwnershipTransferRequestedIterator, error) + + WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *DestinationRewardManagerOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferRequested(log types.Log) (*DestinationRewardManagerOwnershipTransferRequested, error) + + FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*DestinationRewardManagerOwnershipTransferredIterator, error) + + WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *DestinationRewardManagerOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferred(log types.Log) (*DestinationRewardManagerOwnershipTransferred, error) + + FilterRewardRecipientsUpdated(opts *bind.FilterOpts, poolId [][32]byte) (*DestinationRewardManagerRewardRecipientsUpdatedIterator, error) + + WatchRewardRecipientsUpdated(opts *bind.WatchOpts, sink chan<- *DestinationRewardManagerRewardRecipientsUpdated, poolId [][32]byte) (event.Subscription, error) + + ParseRewardRecipientsUpdated(log types.Log) (*DestinationRewardManagerRewardRecipientsUpdated, error) + + FilterRewardsClaimed(opts *bind.FilterOpts, poolId [][32]byte, recipient []common.Address) (*DestinationRewardManagerRewardsClaimedIterator, error) + + WatchRewardsClaimed(opts *bind.WatchOpts, sink chan<- *DestinationRewardManagerRewardsClaimed, poolId [][32]byte, recipient []common.Address) (event.Subscription, error) + + ParseRewardsClaimed(log types.Log) (*DestinationRewardManagerRewardsClaimed, error) + + ParseLog(log types.Log) (generated.AbigenLog, error) + + Address() common.Address +} diff --git a/core/gethwrappers/llo-feeds/generated/destination_verifier/destination_verifier.go b/core/gethwrappers/llo-feeds/generated/destination_verifier/destination_verifier.go new file mode 100644 index 00000000000..41ae715fe95 --- /dev/null +++ b/core/gethwrappers/llo-feeds/generated/destination_verifier/destination_verifier.go @@ -0,0 +1,1577 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package destination_verifier + +import ( + "errors" + "fmt" + "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" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" +) + +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +type CommonAddressAndWeight struct { + Addr common.Address + Weight uint64 +} + +var DestinationVerifierMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"verifierProxy\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"AccessForbidden\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"BadActivationTime\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"BadVerification\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes24\",\"name\":\"donConfigId\",\"type\":\"bytes24\"}],\"name\":\"DonConfigAlreadyExists\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DonConfigDoesNotExist\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"numSigners\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxSigners\",\"type\":\"uint256\"}],\"name\":\"ExcessSigners\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FaultToleranceMustBePositive\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FeeManagerInvalid\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"numSigners\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"minSigners\",\"type\":\"uint256\"}],\"name\":\"InsufficientSigners\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"rsLength\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"ssLength\",\"type\":\"uint256\"}],\"name\":\"MismatchedSignatures\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NoSigners\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NonUniqueSignatures\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddress\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"oldAccessController\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAccessController\",\"type\":\"address\"}],\"name\":\"AccessControllerSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes24\",\"name\":\"donConfigId\",\"type\":\"bytes24\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"isActive\",\"type\":\"bool\"}],\"name\":\"ConfigActivated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes24\",\"name\":\"donConfigId\",\"type\":\"bytes24\"}],\"name\":\"ConfigRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes24\",\"name\":\"donConfigId\",\"type\":\"bytes24\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"signers\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"f\",\"type\":\"uint8\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"weight\",\"type\":\"uint64\"}],\"indexed\":false,\"internalType\":\"structCommon.AddressAndWeight[]\",\"name\":\"recipientAddressesAndWeights\",\"type\":\"tuple[]\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"donConfigIndex\",\"type\":\"uint16\"}],\"name\":\"ConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"oldFeeManager\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newFeeManager\",\"type\":\"address\"}],\"name\":\"FeeManagerSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"feedId\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"requester\",\"type\":\"address\"}],\"name\":\"ReportVerified\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"i_verifierProxy\",\"outputs\":[{\"internalType\":\"contractIDestinationVerifierProxy\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"removeLatestConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_accessController\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_feeManager\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"accessController\",\"type\":\"address\"}],\"name\":\"setAccessController\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"signers\",\"type\":\"address[]\"},{\"internalType\":\"uint8\",\"name\":\"f\",\"type\":\"uint8\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"weight\",\"type\":\"uint64\"}],\"internalType\":\"structCommon.AddressAndWeight[]\",\"name\":\"recipientAddressesAndWeights\",\"type\":\"tuple[]\"}],\"name\":\"setConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"donConfigIndex\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"isActive\",\"type\":\"bool\"}],\"name\":\"setConfigActive\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"signers\",\"type\":\"address[]\"},{\"internalType\":\"uint8\",\"name\":\"f\",\"type\":\"uint8\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"weight\",\"type\":\"uint64\"}],\"internalType\":\"structCommon.AddressAndWeight[]\",\"name\":\"recipientAddressesAndWeights\",\"type\":\"tuple[]\"},{\"internalType\":\"uint32\",\"name\":\"activationTime\",\"type\":\"uint32\"}],\"name\":\"setConfigWithActivationTime\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"feeManager\",\"type\":\"address\"}],\"name\":\"setFeeManager\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"signedReport\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"parameterPayload\",\"type\":\"bytes\"},{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"verify\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes[]\",\"name\":\"signedReports\",\"type\":\"bytes[]\"},{\"internalType\":\"bytes\",\"name\":\"parameterPayload\",\"type\":\"bytes\"},{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"verifyBulk\",\"outputs\":[{\"internalType\":\"bytes[]\",\"name\":\"\",\"type\":\"bytes[]\"}],\"stateMutability\":\"payable\",\"type\":\"function\"}]", + Bin: "0x60a06040523480156200001157600080fd5b50604051620033d8380380620033d88339810160408190526200003491620001a6565b33806000816200008b5760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000be57620000be81620000fb565b5050506001600160a01b038116620000e95760405163d92e233d60e01b815260040160405180910390fd5b6001600160a01b0316608052620001d8565b336001600160a01b03821603620001555760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640162000082565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b600060208284031215620001b957600080fd5b81516001600160a01b0381168114620001d157600080fd5b9392505050565b6080516131d662000202600039600081816102d7015281816104160152610ce201526131d66000f3fe6080604052600436106100f35760003560e01c80638da5cb5b1161008a578063d7c72e4e11610059578063d7c72e4e146102f9578063f08391d814610319578063f2fde38b14610339578063f9c7bf771461035957600080fd5b80638da5cb5b1461025857806394ba284614610283578063af4fed24146102b0578063b97455c7146102c557600080fd5b8063453ec61b116100c6578063453ec61b146101e1578063472d35b9146102035780635ad72fae1461022357806379ba50971461024357600080fd5b806301ffc9a7146100f8578063181f5a771461012d578063294d2bb11461017c57806338416b5b1461018f575b600080fd5b34801561010457600080fd5b50610118610113366004612246565b610379565b60405190151581526020015b60405180910390f35b34801561013957600080fd5b5060408051808201909152601981527f44657374696e6174696f6e566572696669657220302e342e300000000000000060208201525b60405161012491906122f3565b61016f61018a366004612378565b610412565b34801561019b57600080fd5b506004546101bc9073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610124565b3480156101ed57600080fd5b506102016101fc366004612607565b61065f565b005b34801561020f57600080fd5b5061020161021e36600461267b565b610767565b34801561022f57600080fd5b5061020161023e3660046126a4565b6108da565b34801561024f57600080fd5b506102016109f0565b34801561026457600080fd5b5060005473ffffffffffffffffffffffffffffffffffffffff166101bc565b34801561028f57600080fd5b506005546101bc9073ffffffffffffffffffffffffffffffffffffffff1681565b3480156102bc57600080fd5b50610201610aed565b3480156102d157600080fd5b506101bc7f000000000000000000000000000000000000000000000000000000000000000081565b61030c6103073660046126d4565b610cde565b6040516101249190612757565b34801561032557600080fd5b5061020161033436600461267b565b610fd0565b34801561034557600080fd5b5061020161035436600461267b565b611057565b34801561036557600080fd5b506102016103743660046127e9565b61106b565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167ffecf1f8700000000000000000000000000000000000000000000000000000000148061040c57507fffffffff0000000000000000000000000000000000000000000000000000000082167f527146e200000000000000000000000000000000000000000000000000000000145b92915050565b60607f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff163314610483576040517fef67f5d800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600554829073ffffffffffffffffffffffffffffffffffffffff16801580159061054257506040517f6b14daf800000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff821690636b14daf8906104ff90859060009036906004016128b9565b602060405180830381865afa15801561051c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061054091906128f2565b155b15610579576040517fef67f5d800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000806105878a8a88611129565b600454919350915073ffffffffffffffffffffffffffffffffffffffff168015610650578073ffffffffffffffffffffffffffffffffffffffff166386968cfd34848e8e8e8e8e6040518863ffffffff1660e01b81526004016105ef9695949392919061290f565b6000604051808303818588803b15801561060857600080fd5b505af19350505050801561061a575060015b610650576040517f4df18f0700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50909998505050505050505050565b82518260ff168060000361069f576040517f0743bae600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b601f8211156106e9576040517f61750f4000000000000000000000000000000000000000000000000000000000815260048101839052601f60248201526044015b60405180910390fd5b6106f4816003612995565b821161074c5781610706826003612995565b6107119060016129ac565b6040517f9dd9e6d8000000000000000000000000000000000000000000000000000000008152600481019290925260248201526044016106e0565b61075461162e565b610760858585426116b1565b5050505050565b61076f61162e565b6040517f01ffc9a70000000000000000000000000000000000000000000000000000000081527f465b009600000000000000000000000000000000000000000000000000000000600482015273ffffffffffffffffffffffffffffffffffffffff8216906301ffc9a790602401602060405180830381865afa1580156107f9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061081d91906128f2565b610853576040517f8238941900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6004805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff000000000000000000000000000000000000000083168117909355604080519190921680825260208201939093527f04628abcaa6b1674651352125cb94b65b289145bc2bc4d67720bb7d966372f0391015b60405180910390a15050565b6108e261162e565b600354821061091d576040517f5a0d6fe200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600060038381548110610932576109326129bf565b600091825260209182902001805484151579010000000000000000000000000000000000000000000000000081027fffffffffffff00ffffffffffffffffffffffffffffffffffffffffffffffffff909216919091178083556040805191811b7fffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000168252938101919091529092507f90186a1e77b498ec417ea88bd026cae00d7043c357cc45221777623bda582dd4910160405180910390a1505050565b60015473ffffffffffffffffffffffffffffffffffffffff163314610a71576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e65720000000000000000000060448201526064016106e0565b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b610af561162e565b600354600003610b31576040517f5a0d6fe200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6003805460009190610b45906001906129ee565b81548110610b5557610b556129bf565b600091825260209182902060408051608081018252929091015480821b7fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000001683527801000000000000000000000000000000000000000000000000810460ff9081169484019490945279010000000000000000000000000000000000000000000000000081049093161515908201527a01000000000000000000000000000000000000000000000000000090910463ffffffff166060820152600380549192509080610c2357610c23612a01565b60008281526020902081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90810180547fffff00000000000000000000000000000000000000000000000000000000000016905501905580516040517f970fd8f3ebdd9a271080aacf9807a5c709be0b448e4047a6fc212b8cc165368d91610cd3917fffffffffffffffffffffffffffffffffffffffffffffffff000000000000000091909116815260200190565b60405180910390a150565b60607f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff163314610d4f576040517fef67f5d800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600554829073ffffffffffffffffffffffffffffffffffffffff168015801590610e0e57506040517f6b14daf800000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff821690636b14daf890610dcb90859060009036906004016128b9565b602060405180830381865afa158015610de8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e0c91906128f2565b155b15610e45576040517fef67f5d800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008767ffffffffffffffff811115610e6057610e606123f9565b604051908082528060200260200182016040528015610e9357816020015b6060815260200190600190039081610e7e5790505b50905060008867ffffffffffffffff811115610eb157610eb16123f9565b604051908082528060200260200182016040528015610eda578160200160208202803683370190505b50905060005b89811015610f6c57600080610f188d8d85818110610f0057610f006129bf565b9050602002810190610f129190612a30565b8b611129565b9150915081858481518110610f2f57610f2f6129bf565b602002602001018190525080848481518110610f4d57610f4d6129bf565b602002602001018181525050505080610f6590612a95565b9050610ee0565b5060045473ffffffffffffffffffffffffffffffffffffffff168015610650578073ffffffffffffffffffffffffffffffffffffffff16633690750934848e8e8e8e8e6040518863ffffffff1660e01b81526004016105ef96959493929190612acd565b610fd861162e565b6005805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff000000000000000000000000000000000000000083168117909355604080519190921680825260208201939093527f953e92b1a6442e9c3242531154a3f6f6eb00b4e9c719ba8118fa6235e4ce89b691016108ce565b61105f61162e565b61106881611d0f565b50565b83518360ff16806000036110ab576040517f0743bae600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b601f8211156110f0576040517f61750f4000000000000000000000000000000000000000000000000000000000815260048101839052601f60248201526044016106e0565b6110fb816003612995565b821161110d5781610706826003612995565b61111561162e565b611121868686866116b1565b505050505050565b60606000808080808061113e898b018b612cff565b94509450945094509450815183511461119057825182516040517ff0d31408000000000000000000000000000000000000000000000000000000008152600481019290925260248201526044016106e0565b82516000036111cb576040517fc7af40f000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008480519060200120866040516020016111e7929190612dda565b6040516020818303038152906040528051906020012090506000845167ffffffffffffffff81111561121b5761121b6123f9565b604051908082528060200260200182016040528015611244578160200160208202803683370190505b50905060005b855181101561135257600183858360208110611268576112686129bf565b61127591901a601b612e16565b888481518110611287576112876129bf565b60200260200101518885815181106112a1576112a16129bf565b6020026020010151604051600081526020016040526040516112df949392919093845260ff9290921660208401526040830152606082015260800190565b6020604051602081039080840390855afa158015611301573d6000803e3d6000fd5b5050506020604051035182828151811061131d5761131d6129bf565b73ffffffffffffffffffffffffffffffffffffffff9092166020928302919091019091015261134b81612a95565b905061124a565b5061135c81611e04565b15611393576040517f4df18f0700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600061139e87611eb3565b905060006113ab82611ed9565b80519091507fffffffffffffffffffffffffffffffffffffffffffffffff000000000000000016611408576040517f4df18f0700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8060400151611443576040517f4df18f0700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b806020015160ff16835111611484576040517f4df18f0700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000805b84518110156115a2578481815181106114a3576114a36129bf565b6020026020010151836000015160405160200161151392919060609290921b7fffffffffffffffffffffffffffffffffffffffff0000000000000000000000001682527fffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000166014820152602c0190565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815291815281516020928301206000818152600290935291205490925060ff16611592576040517f4df18f0700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61159b81612a95565b9050611488565b506115ac89612e2f565b60405173ffffffffffffffffffffffffffffffffffffffff8f1681527f58ca9502e98a536e06e72d680fcc251e5d10b72291a281665a2c2dc0ac30fcc59060200160405180910390a25051969d7fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000009097169c50959a5050505050505050505050565b60005473ffffffffffffffffffffffffffffffffffffffff1633146116af576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e65720000000000000000000060448201526064016106e0565b565b6116ba84611e04565b156116f1576040517ff67bc7c400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b428163ffffffff161115611731576040517f0114c7e600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61174a8460006001875161174591906129ee565b61205e565b6000848460405160200161175f929190612e74565b60405160208183030381529060405280519060200120905060005b855181101561190657600073ffffffffffffffffffffffffffffffffffffffff168682815181106117ad576117ad6129bf565b602002602001015173ffffffffffffffffffffffffffffffffffffffff1603611802576040517fd92e233d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60016002600088848151811061181a5761181a6129bf565b60200260200101518560405160200161188692919060609290921b7fffffffffffffffffffffffffffffffffffffffff0000000000000000000000001682527fffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000166014820152602c0190565b604080518083037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe001815291815281516020928301208352908201929092520160002080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169115159190911790556118ff81612a95565b905061177a565b50600354801580159061196b575063ffffffff831660036119286001846129ee565b81548110611938576119386129bf565b6000918252602090912001547a010000000000000000000000000000000000000000000000000000900463ffffffff1610155b156119a2576040517f0114c7e600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600081118015611a2057507fffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000821660036119dd6001846129ee565b815481106119ed576119ed6129bf565b60009182526020909120015460401b7fffffffffffffffffffffffffffffffffffffffffffffffff000000000000000016145b15611a7b576040517fc0178c860000000000000000000000000000000000000000000000000000000081527fffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000831660048201526024016106e0565b835115611b5b5760045473ffffffffffffffffffffffffffffffffffffffff16611ad1576040517f8238941900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600480546040517ff65df96200000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9091169163f65df96291611b28918691899101612f52565b600060405180830381600087803b158015611b4257600080fd5b505af1158015611b56573d6000803e3d6000fd5b505050505b604080516080810182527fffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000841680825260ff80891660208401908152600184860181815263ffffffff808b166060880190815260038054948501815560005296517fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b90930180549451925197519091167a010000000000000000000000000000000000000000000000000000027fffff00000000ffffffffffffffffffffffffffffffffffffffffffffffffffff97151579010000000000000000000000000000000000000000000000000002979097167fffff0000000000ffffffffffffffffffffffffffffffffffffffffffffffffff929095167801000000000000000000000000000000000000000000000000027fffffffffffffff0000000000000000000000000000000000000000000000000090941692881c929092179290921791909116919091179290921790915590517fa7d03f81dd1c1d8a55355fd71e1221d5959b7d9fb171fbb6389f207f63598fa590611cff908990899089908790612f95565b60405180910390a2505050505050565b3373ffffffffffffffffffffffffffffffffffffffff821603611d8e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c6600000000000000000060448201526064016106e0565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b6000805b8251811015611eaa576000611e1e8260016129ac565b90505b8351811015611ea157838181518110611e3c57611e3c6129bf565b602002602001015173ffffffffffffffffffffffffffffffffffffffff16848381518110611e6c57611e6c6129bf565b602002602001015173ffffffffffffffffffffffffffffffffffffffff1603611e99575060019392505050565b600101611e21565b50600101611e08565b50600092915050565b60008082806020019051810190611eca9190613018565b63ffffffff1695945050505050565b6040805160808101825260008082526020820181905291810182905260608101919091526040805160808101825260008082526020820181905291810182905260608101919091526003545b801561205757611f348161305b565b90508360038281548110611f4a57611f4a6129bf565b6000918252602090912001547a010000000000000000000000000000000000000000000000000000900463ffffffff16116120525760038181548110611f9257611f926129bf565b600091825260209182902060408051608081018252929091015480821b7fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000001683527801000000000000000000000000000000000000000000000000810460ff9081169484019490945279010000000000000000000000000000000000000000000000000081049093161515908201527a01000000000000000000000000000000000000000000000000000090910463ffffffff1660608201529150612057565b611f25565b5092915050565b818180820361206e575050505050565b600085600261207d8787613090565b61208791906130b0565b612091908761313f565b815181106120a1576120a16129bf565b602002602001015190505b818313612220575b8073ffffffffffffffffffffffffffffffffffffffff168684815181106120dd576120dd6129bf565b602002602001015173ffffffffffffffffffffffffffffffffffffffff161015612113578261210b81613167565b9350506120b4565b858281518110612125576121256129bf565b602002602001015173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161015612172578161216a81613198565b925050612113565b81831361221b5785828151811061218b5761218b6129bf565b60200260200101518684815181106121a5576121a56129bf565b60200260200101518785815181106121bf576121bf6129bf565b602002602001018885815181106121d8576121d86129bf565b73ffffffffffffffffffffffffffffffffffffffff9384166020918202929092010152911690528261220981613167565b935050818061221790613198565b9250505b6120ac565b818512156122335761223386868461205e565b838312156111215761112186848661205e565b60006020828403121561225857600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461228857600080fd5b9392505050565b6000815180845260005b818110156122b557602081850181015186830182015201612299565b5060006020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b602081526000612288602083018461228f565b60008083601f84011261231857600080fd5b50813567ffffffffffffffff81111561233057600080fd5b60208301915083602082850101111561234857600080fd5b9250929050565b803573ffffffffffffffffffffffffffffffffffffffff8116811461237357600080fd5b919050565b60008060008060006060868803121561239057600080fd5b853567ffffffffffffffff808211156123a857600080fd5b6123b489838a01612306565b909750955060208801359150808211156123cd57600080fd5b506123da88828901612306565b90945092506123ed90506040870161234f565b90509295509295909350565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040805190810167ffffffffffffffff8111828210171561244b5761244b6123f9565b60405290565b6040516060810167ffffffffffffffff8111828210171561244b5761244b6123f9565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff811182821017156124bb576124bb6123f9565b604052919050565b600067ffffffffffffffff8211156124dd576124dd6123f9565b5060051b60200190565b600082601f8301126124f857600080fd5b8135602061250d612508836124c3565b612474565b82815260059290921b8401810191818101908684111561252c57600080fd5b8286015b8481101561254e576125418161234f565b8352918301918301612530565b509695505050505050565b803560ff8116811461237357600080fd5b600082601f83011261257b57600080fd5b8135602061258b612508836124c3565b82815260069290921b840181019181810190868411156125aa57600080fd5b8286015b8481101561254e57604081890312156125c75760008081fd5b6125cf612428565b6125d88261234f565b81528482013567ffffffffffffffff811681146125f55760008081fd5b818601528352918301916040016125ae565b60008060006060848603121561261c57600080fd5b833567ffffffffffffffff8082111561263457600080fd5b612640878388016124e7565b945061264e60208701612559565b9350604086013591508082111561266457600080fd5b506126718682870161256a565b9150509250925092565b60006020828403121561268d57600080fd5b6122888261234f565b801515811461106857600080fd5b600080604083850312156126b757600080fd5b8235915060208301356126c981612696565b809150509250929050565b6000806000806000606086880312156126ec57600080fd5b853567ffffffffffffffff8082111561270457600080fd5b818801915088601f83011261271857600080fd5b81358181111561272757600080fd5b8960208260051b850101111561273c57600080fd5b6020928301975095509087013590808211156123cd57600080fd5b6000602080830181845280855180835260408601915060408160051b870101925083870160005b828110156127ca577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc08886030184526127b885835161228f565b9450928501929085019060010161277e565b5092979650505050505050565b63ffffffff8116811461106857600080fd5b600080600080608085870312156127ff57600080fd5b843567ffffffffffffffff8082111561281757600080fd5b612823888389016124e7565b955061283160208801612559565b9450604087013591508082111561284757600080fd5b506128548782880161256a565b9250506060850135612865816127d7565b939692955090935050565b8183528181602085013750600060208284010152600060207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b73ffffffffffffffffffffffffffffffffffffffff841681526040602082015260006128e9604083018486612870565b95945050505050565b60006020828403121561290457600080fd5b815161228881612696565b868152608060208201526000612929608083018789612870565b828103604084015261293c818688612870565b91505073ffffffffffffffffffffffffffffffffffffffff83166060830152979650505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b808202811582820484141761040c5761040c612966565b8082018082111561040c5761040c612966565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b8181038181111561040c5761040c612966565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112612a6557600080fd5b83018035915067ffffffffffffffff821115612a8057600080fd5b60200191503681900382131561234857600080fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203612ac657612ac6612966565b5060010190565b6080808252875190820181905260009060209060a0840190828b01845b82811015612b0657815184529284019290840190600101612aea565b50505083810382850152878152818101600589901b820183018a60005b8b811015612bce577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe085840301845281357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe18e3603018112612b8457600080fd5b8d01868101903567ffffffffffffffff811115612ba057600080fd5b803603821315612baf57600080fd5b612bba858284612870565b958801959450505090850190600101612b23565b50508581036040870152612be381898b612870565b945050505050612c0b606083018473ffffffffffffffffffffffffffffffffffffffff169052565b979650505050505050565b600082601f830112612c2757600080fd5b813567ffffffffffffffff811115612c4157612c416123f9565b612c7260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f84011601612474565b818152846020838601011115612c8757600080fd5b816020850160208301376000918101602001919091529392505050565b600082601f830112612cb557600080fd5b81356020612cc5612508836124c3565b82815260059290921b84018101918181019086841115612ce457600080fd5b8286015b8481101561254e5780358352918301918301612ce8565b600080600080600060e08688031215612d1757600080fd5b86601f870112612d2657600080fd5b612d2e612451565b806060880189811115612d4057600080fd5b885b81811015612d5a578035845260209384019301612d42565b5090965035905067ffffffffffffffff80821115612d7757600080fd5b612d8389838a01612c16565b95506080880135915080821115612d9957600080fd5b612da589838a01612ca4565b945060a0880135915080821115612dbb57600080fd5b50612dc888828901612ca4565b9598949750929560c001359392505050565b828152600060208083018460005b6003811015612e0557815183529183019190830190600101612de8565b505050506080820190509392505050565b60ff818116838216019081111561040c5761040c612966565b80516020808301519190811015612e6e577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8160200360031b1b821691505b50919050565b825160009082906020808701845b83811015612eb457815173ffffffffffffffffffffffffffffffffffffffff1685529382019390820190600101612e82565b5050505060f89390931b7fff000000000000000000000000000000000000000000000000000000000000001683525050600101919050565b600081518084526020808501945080840160005b83811015612f47578151805173ffffffffffffffffffffffffffffffffffffffff16885283015167ffffffffffffffff168388015260409096019590820190600101612f00565b509495945050505050565b7fffffffffffffffffffffffffffffffffffffffffffffffff000000000000000083168152604060208201526000612f8d6040830184612eec565b949350505050565b6080808252855190820181905260009060209060a0840190828901845b82811015612fe457815173ffffffffffffffffffffffffffffffffffffffff1684529284019290840190600101612fb2565b50505060ff87168285015283810360408501526130018187612eec565b9250505061ffff8316606083015295945050505050565b60008060006060848603121561302d57600080fd5b83519250602084015161303f816127d7565b6040850151909250613050816127d7565b809150509250925092565b60008161306a5761306a612966565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190565b818103600083128015838313168383128216171561205757612057612966565b6000826130e6577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff83147f80000000000000000000000000000000000000000000000000000000000000008314161561313a5761313a612966565b500590565b808201828112600083128015821682158216171561315f5761315f612966565b505092915050565b60007f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203612ac657612ac6612966565b60007f8000000000000000000000000000000000000000000000000000000000000000820361306a5761306a61296656fea164736f6c6343000813000a", +} + +var DestinationVerifierABI = DestinationVerifierMetaData.ABI + +var DestinationVerifierBin = DestinationVerifierMetaData.Bin + +func DeployDestinationVerifier(auth *bind.TransactOpts, backend bind.ContractBackend, verifierProxy common.Address) (common.Address, *types.Transaction, *DestinationVerifier, error) { + parsed, err := DestinationVerifierMetaData.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(DestinationVerifierBin), backend, verifierProxy) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &DestinationVerifier{address: address, abi: *parsed, DestinationVerifierCaller: DestinationVerifierCaller{contract: contract}, DestinationVerifierTransactor: DestinationVerifierTransactor{contract: contract}, DestinationVerifierFilterer: DestinationVerifierFilterer{contract: contract}}, nil +} + +type DestinationVerifier struct { + address common.Address + abi abi.ABI + DestinationVerifierCaller + DestinationVerifierTransactor + DestinationVerifierFilterer +} + +type DestinationVerifierCaller struct { + contract *bind.BoundContract +} + +type DestinationVerifierTransactor struct { + contract *bind.BoundContract +} + +type DestinationVerifierFilterer struct { + contract *bind.BoundContract +} + +type DestinationVerifierSession struct { + Contract *DestinationVerifier + CallOpts bind.CallOpts + TransactOpts bind.TransactOpts +} + +type DestinationVerifierCallerSession struct { + Contract *DestinationVerifierCaller + CallOpts bind.CallOpts +} + +type DestinationVerifierTransactorSession struct { + Contract *DestinationVerifierTransactor + TransactOpts bind.TransactOpts +} + +type DestinationVerifierRaw struct { + Contract *DestinationVerifier +} + +type DestinationVerifierCallerRaw struct { + Contract *DestinationVerifierCaller +} + +type DestinationVerifierTransactorRaw struct { + Contract *DestinationVerifierTransactor +} + +func NewDestinationVerifier(address common.Address, backend bind.ContractBackend) (*DestinationVerifier, error) { + abi, err := abi.JSON(strings.NewReader(DestinationVerifierABI)) + if err != nil { + return nil, err + } + contract, err := bindDestinationVerifier(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &DestinationVerifier{address: address, abi: abi, DestinationVerifierCaller: DestinationVerifierCaller{contract: contract}, DestinationVerifierTransactor: DestinationVerifierTransactor{contract: contract}, DestinationVerifierFilterer: DestinationVerifierFilterer{contract: contract}}, nil +} + +func NewDestinationVerifierCaller(address common.Address, caller bind.ContractCaller) (*DestinationVerifierCaller, error) { + contract, err := bindDestinationVerifier(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &DestinationVerifierCaller{contract: contract}, nil +} + +func NewDestinationVerifierTransactor(address common.Address, transactor bind.ContractTransactor) (*DestinationVerifierTransactor, error) { + contract, err := bindDestinationVerifier(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &DestinationVerifierTransactor{contract: contract}, nil +} + +func NewDestinationVerifierFilterer(address common.Address, filterer bind.ContractFilterer) (*DestinationVerifierFilterer, error) { + contract, err := bindDestinationVerifier(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &DestinationVerifierFilterer{contract: contract}, nil +} + +func bindDestinationVerifier(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := DestinationVerifierMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +func (_DestinationVerifier *DestinationVerifierRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _DestinationVerifier.Contract.DestinationVerifierCaller.contract.Call(opts, result, method, params...) +} + +func (_DestinationVerifier *DestinationVerifierRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _DestinationVerifier.Contract.DestinationVerifierTransactor.contract.Transfer(opts) +} + +func (_DestinationVerifier *DestinationVerifierRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _DestinationVerifier.Contract.DestinationVerifierTransactor.contract.Transact(opts, method, params...) +} + +func (_DestinationVerifier *DestinationVerifierCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _DestinationVerifier.Contract.contract.Call(opts, result, method, params...) +} + +func (_DestinationVerifier *DestinationVerifierTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _DestinationVerifier.Contract.contract.Transfer(opts) +} + +func (_DestinationVerifier *DestinationVerifierTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _DestinationVerifier.Contract.contract.Transact(opts, method, params...) +} + +func (_DestinationVerifier *DestinationVerifierCaller) IVerifierProxy(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _DestinationVerifier.contract.Call(opts, &out, "i_verifierProxy") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_DestinationVerifier *DestinationVerifierSession) IVerifierProxy() (common.Address, error) { + return _DestinationVerifier.Contract.IVerifierProxy(&_DestinationVerifier.CallOpts) +} + +func (_DestinationVerifier *DestinationVerifierCallerSession) IVerifierProxy() (common.Address, error) { + return _DestinationVerifier.Contract.IVerifierProxy(&_DestinationVerifier.CallOpts) +} + +func (_DestinationVerifier *DestinationVerifierCaller) Owner(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _DestinationVerifier.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 + +} + +func (_DestinationVerifier *DestinationVerifierSession) Owner() (common.Address, error) { + return _DestinationVerifier.Contract.Owner(&_DestinationVerifier.CallOpts) +} + +func (_DestinationVerifier *DestinationVerifierCallerSession) Owner() (common.Address, error) { + return _DestinationVerifier.Contract.Owner(&_DestinationVerifier.CallOpts) +} + +func (_DestinationVerifier *DestinationVerifierCaller) SAccessController(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _DestinationVerifier.contract.Call(opts, &out, "s_accessController") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_DestinationVerifier *DestinationVerifierSession) SAccessController() (common.Address, error) { + return _DestinationVerifier.Contract.SAccessController(&_DestinationVerifier.CallOpts) +} + +func (_DestinationVerifier *DestinationVerifierCallerSession) SAccessController() (common.Address, error) { + return _DestinationVerifier.Contract.SAccessController(&_DestinationVerifier.CallOpts) +} + +func (_DestinationVerifier *DestinationVerifierCaller) SFeeManager(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _DestinationVerifier.contract.Call(opts, &out, "s_feeManager") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_DestinationVerifier *DestinationVerifierSession) SFeeManager() (common.Address, error) { + return _DestinationVerifier.Contract.SFeeManager(&_DestinationVerifier.CallOpts) +} + +func (_DestinationVerifier *DestinationVerifierCallerSession) SFeeManager() (common.Address, error) { + return _DestinationVerifier.Contract.SFeeManager(&_DestinationVerifier.CallOpts) +} + +func (_DestinationVerifier *DestinationVerifierCaller) SupportsInterface(opts *bind.CallOpts, interfaceId [4]byte) (bool, error) { + var out []interface{} + err := _DestinationVerifier.contract.Call(opts, &out, "supportsInterface", interfaceId) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_DestinationVerifier *DestinationVerifierSession) SupportsInterface(interfaceId [4]byte) (bool, error) { + return _DestinationVerifier.Contract.SupportsInterface(&_DestinationVerifier.CallOpts, interfaceId) +} + +func (_DestinationVerifier *DestinationVerifierCallerSession) SupportsInterface(interfaceId [4]byte) (bool, error) { + return _DestinationVerifier.Contract.SupportsInterface(&_DestinationVerifier.CallOpts, interfaceId) +} + +func (_DestinationVerifier *DestinationVerifierCaller) TypeAndVersion(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _DestinationVerifier.contract.Call(opts, &out, "typeAndVersion") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +func (_DestinationVerifier *DestinationVerifierSession) TypeAndVersion() (string, error) { + return _DestinationVerifier.Contract.TypeAndVersion(&_DestinationVerifier.CallOpts) +} + +func (_DestinationVerifier *DestinationVerifierCallerSession) TypeAndVersion() (string, error) { + return _DestinationVerifier.Contract.TypeAndVersion(&_DestinationVerifier.CallOpts) +} + +func (_DestinationVerifier *DestinationVerifierTransactor) AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + return _DestinationVerifier.contract.Transact(opts, "acceptOwnership") +} + +func (_DestinationVerifier *DestinationVerifierSession) AcceptOwnership() (*types.Transaction, error) { + return _DestinationVerifier.Contract.AcceptOwnership(&_DestinationVerifier.TransactOpts) +} + +func (_DestinationVerifier *DestinationVerifierTransactorSession) AcceptOwnership() (*types.Transaction, error) { + return _DestinationVerifier.Contract.AcceptOwnership(&_DestinationVerifier.TransactOpts) +} + +func (_DestinationVerifier *DestinationVerifierTransactor) RemoveLatestConfig(opts *bind.TransactOpts) (*types.Transaction, error) { + return _DestinationVerifier.contract.Transact(opts, "removeLatestConfig") +} + +func (_DestinationVerifier *DestinationVerifierSession) RemoveLatestConfig() (*types.Transaction, error) { + return _DestinationVerifier.Contract.RemoveLatestConfig(&_DestinationVerifier.TransactOpts) +} + +func (_DestinationVerifier *DestinationVerifierTransactorSession) RemoveLatestConfig() (*types.Transaction, error) { + return _DestinationVerifier.Contract.RemoveLatestConfig(&_DestinationVerifier.TransactOpts) +} + +func (_DestinationVerifier *DestinationVerifierTransactor) SetAccessController(opts *bind.TransactOpts, accessController common.Address) (*types.Transaction, error) { + return _DestinationVerifier.contract.Transact(opts, "setAccessController", accessController) +} + +func (_DestinationVerifier *DestinationVerifierSession) SetAccessController(accessController common.Address) (*types.Transaction, error) { + return _DestinationVerifier.Contract.SetAccessController(&_DestinationVerifier.TransactOpts, accessController) +} + +func (_DestinationVerifier *DestinationVerifierTransactorSession) SetAccessController(accessController common.Address) (*types.Transaction, error) { + return _DestinationVerifier.Contract.SetAccessController(&_DestinationVerifier.TransactOpts, accessController) +} + +func (_DestinationVerifier *DestinationVerifierTransactor) SetConfig(opts *bind.TransactOpts, signers []common.Address, f uint8, recipientAddressesAndWeights []CommonAddressAndWeight) (*types.Transaction, error) { + return _DestinationVerifier.contract.Transact(opts, "setConfig", signers, f, recipientAddressesAndWeights) +} + +func (_DestinationVerifier *DestinationVerifierSession) SetConfig(signers []common.Address, f uint8, recipientAddressesAndWeights []CommonAddressAndWeight) (*types.Transaction, error) { + return _DestinationVerifier.Contract.SetConfig(&_DestinationVerifier.TransactOpts, signers, f, recipientAddressesAndWeights) +} + +func (_DestinationVerifier *DestinationVerifierTransactorSession) SetConfig(signers []common.Address, f uint8, recipientAddressesAndWeights []CommonAddressAndWeight) (*types.Transaction, error) { + return _DestinationVerifier.Contract.SetConfig(&_DestinationVerifier.TransactOpts, signers, f, recipientAddressesAndWeights) +} + +func (_DestinationVerifier *DestinationVerifierTransactor) SetConfigActive(opts *bind.TransactOpts, donConfigIndex *big.Int, isActive bool) (*types.Transaction, error) { + return _DestinationVerifier.contract.Transact(opts, "setConfigActive", donConfigIndex, isActive) +} + +func (_DestinationVerifier *DestinationVerifierSession) SetConfigActive(donConfigIndex *big.Int, isActive bool) (*types.Transaction, error) { + return _DestinationVerifier.Contract.SetConfigActive(&_DestinationVerifier.TransactOpts, donConfigIndex, isActive) +} + +func (_DestinationVerifier *DestinationVerifierTransactorSession) SetConfigActive(donConfigIndex *big.Int, isActive bool) (*types.Transaction, error) { + return _DestinationVerifier.Contract.SetConfigActive(&_DestinationVerifier.TransactOpts, donConfigIndex, isActive) +} + +func (_DestinationVerifier *DestinationVerifierTransactor) SetConfigWithActivationTime(opts *bind.TransactOpts, signers []common.Address, f uint8, recipientAddressesAndWeights []CommonAddressAndWeight, activationTime uint32) (*types.Transaction, error) { + return _DestinationVerifier.contract.Transact(opts, "setConfigWithActivationTime", signers, f, recipientAddressesAndWeights, activationTime) +} + +func (_DestinationVerifier *DestinationVerifierSession) SetConfigWithActivationTime(signers []common.Address, f uint8, recipientAddressesAndWeights []CommonAddressAndWeight, activationTime uint32) (*types.Transaction, error) { + return _DestinationVerifier.Contract.SetConfigWithActivationTime(&_DestinationVerifier.TransactOpts, signers, f, recipientAddressesAndWeights, activationTime) +} + +func (_DestinationVerifier *DestinationVerifierTransactorSession) SetConfigWithActivationTime(signers []common.Address, f uint8, recipientAddressesAndWeights []CommonAddressAndWeight, activationTime uint32) (*types.Transaction, error) { + return _DestinationVerifier.Contract.SetConfigWithActivationTime(&_DestinationVerifier.TransactOpts, signers, f, recipientAddressesAndWeights, activationTime) +} + +func (_DestinationVerifier *DestinationVerifierTransactor) SetFeeManager(opts *bind.TransactOpts, feeManager common.Address) (*types.Transaction, error) { + return _DestinationVerifier.contract.Transact(opts, "setFeeManager", feeManager) +} + +func (_DestinationVerifier *DestinationVerifierSession) SetFeeManager(feeManager common.Address) (*types.Transaction, error) { + return _DestinationVerifier.Contract.SetFeeManager(&_DestinationVerifier.TransactOpts, feeManager) +} + +func (_DestinationVerifier *DestinationVerifierTransactorSession) SetFeeManager(feeManager common.Address) (*types.Transaction, error) { + return _DestinationVerifier.Contract.SetFeeManager(&_DestinationVerifier.TransactOpts, feeManager) +} + +func (_DestinationVerifier *DestinationVerifierTransactor) TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) { + return _DestinationVerifier.contract.Transact(opts, "transferOwnership", to) +} + +func (_DestinationVerifier *DestinationVerifierSession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _DestinationVerifier.Contract.TransferOwnership(&_DestinationVerifier.TransactOpts, to) +} + +func (_DestinationVerifier *DestinationVerifierTransactorSession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _DestinationVerifier.Contract.TransferOwnership(&_DestinationVerifier.TransactOpts, to) +} + +func (_DestinationVerifier *DestinationVerifierTransactor) Verify(opts *bind.TransactOpts, signedReport []byte, parameterPayload []byte, sender common.Address) (*types.Transaction, error) { + return _DestinationVerifier.contract.Transact(opts, "verify", signedReport, parameterPayload, sender) +} + +func (_DestinationVerifier *DestinationVerifierSession) Verify(signedReport []byte, parameterPayload []byte, sender common.Address) (*types.Transaction, error) { + return _DestinationVerifier.Contract.Verify(&_DestinationVerifier.TransactOpts, signedReport, parameterPayload, sender) +} + +func (_DestinationVerifier *DestinationVerifierTransactorSession) Verify(signedReport []byte, parameterPayload []byte, sender common.Address) (*types.Transaction, error) { + return _DestinationVerifier.Contract.Verify(&_DestinationVerifier.TransactOpts, signedReport, parameterPayload, sender) +} + +func (_DestinationVerifier *DestinationVerifierTransactor) VerifyBulk(opts *bind.TransactOpts, signedReports [][]byte, parameterPayload []byte, sender common.Address) (*types.Transaction, error) { + return _DestinationVerifier.contract.Transact(opts, "verifyBulk", signedReports, parameterPayload, sender) +} + +func (_DestinationVerifier *DestinationVerifierSession) VerifyBulk(signedReports [][]byte, parameterPayload []byte, sender common.Address) (*types.Transaction, error) { + return _DestinationVerifier.Contract.VerifyBulk(&_DestinationVerifier.TransactOpts, signedReports, parameterPayload, sender) +} + +func (_DestinationVerifier *DestinationVerifierTransactorSession) VerifyBulk(signedReports [][]byte, parameterPayload []byte, sender common.Address) (*types.Transaction, error) { + return _DestinationVerifier.Contract.VerifyBulk(&_DestinationVerifier.TransactOpts, signedReports, parameterPayload, sender) +} + +type DestinationVerifierAccessControllerSetIterator struct { + Event *DestinationVerifierAccessControllerSet + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *DestinationVerifierAccessControllerSetIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(DestinationVerifierAccessControllerSet) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(DestinationVerifierAccessControllerSet) + 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() + } +} + +func (it *DestinationVerifierAccessControllerSetIterator) Error() error { + return it.fail +} + +func (it *DestinationVerifierAccessControllerSetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type DestinationVerifierAccessControllerSet struct { + OldAccessController common.Address + NewAccessController common.Address + Raw types.Log +} + +func (_DestinationVerifier *DestinationVerifierFilterer) FilterAccessControllerSet(opts *bind.FilterOpts) (*DestinationVerifierAccessControllerSetIterator, error) { + + logs, sub, err := _DestinationVerifier.contract.FilterLogs(opts, "AccessControllerSet") + if err != nil { + return nil, err + } + return &DestinationVerifierAccessControllerSetIterator{contract: _DestinationVerifier.contract, event: "AccessControllerSet", logs: logs, sub: sub}, nil +} + +func (_DestinationVerifier *DestinationVerifierFilterer) WatchAccessControllerSet(opts *bind.WatchOpts, sink chan<- *DestinationVerifierAccessControllerSet) (event.Subscription, error) { + + logs, sub, err := _DestinationVerifier.contract.WatchLogs(opts, "AccessControllerSet") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(DestinationVerifierAccessControllerSet) + if err := _DestinationVerifier.contract.UnpackLog(event, "AccessControllerSet", 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 +} + +func (_DestinationVerifier *DestinationVerifierFilterer) ParseAccessControllerSet(log types.Log) (*DestinationVerifierAccessControllerSet, error) { + event := new(DestinationVerifierAccessControllerSet) + if err := _DestinationVerifier.contract.UnpackLog(event, "AccessControllerSet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type DestinationVerifierConfigActivatedIterator struct { + Event *DestinationVerifierConfigActivated + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *DestinationVerifierConfigActivatedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(DestinationVerifierConfigActivated) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(DestinationVerifierConfigActivated) + 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() + } +} + +func (it *DestinationVerifierConfigActivatedIterator) Error() error { + return it.fail +} + +func (it *DestinationVerifierConfigActivatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type DestinationVerifierConfigActivated struct { + DonConfigId [24]byte + IsActive bool + Raw types.Log +} + +func (_DestinationVerifier *DestinationVerifierFilterer) FilterConfigActivated(opts *bind.FilterOpts) (*DestinationVerifierConfigActivatedIterator, error) { + + logs, sub, err := _DestinationVerifier.contract.FilterLogs(opts, "ConfigActivated") + if err != nil { + return nil, err + } + return &DestinationVerifierConfigActivatedIterator{contract: _DestinationVerifier.contract, event: "ConfigActivated", logs: logs, sub: sub}, nil +} + +func (_DestinationVerifier *DestinationVerifierFilterer) WatchConfigActivated(opts *bind.WatchOpts, sink chan<- *DestinationVerifierConfigActivated) (event.Subscription, error) { + + logs, sub, err := _DestinationVerifier.contract.WatchLogs(opts, "ConfigActivated") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(DestinationVerifierConfigActivated) + if err := _DestinationVerifier.contract.UnpackLog(event, "ConfigActivated", 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 +} + +func (_DestinationVerifier *DestinationVerifierFilterer) ParseConfigActivated(log types.Log) (*DestinationVerifierConfigActivated, error) { + event := new(DestinationVerifierConfigActivated) + if err := _DestinationVerifier.contract.UnpackLog(event, "ConfigActivated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type DestinationVerifierConfigRemovedIterator struct { + Event *DestinationVerifierConfigRemoved + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *DestinationVerifierConfigRemovedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(DestinationVerifierConfigRemoved) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(DestinationVerifierConfigRemoved) + 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() + } +} + +func (it *DestinationVerifierConfigRemovedIterator) Error() error { + return it.fail +} + +func (it *DestinationVerifierConfigRemovedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type DestinationVerifierConfigRemoved struct { + DonConfigId [24]byte + Raw types.Log +} + +func (_DestinationVerifier *DestinationVerifierFilterer) FilterConfigRemoved(opts *bind.FilterOpts) (*DestinationVerifierConfigRemovedIterator, error) { + + logs, sub, err := _DestinationVerifier.contract.FilterLogs(opts, "ConfigRemoved") + if err != nil { + return nil, err + } + return &DestinationVerifierConfigRemovedIterator{contract: _DestinationVerifier.contract, event: "ConfigRemoved", logs: logs, sub: sub}, nil +} + +func (_DestinationVerifier *DestinationVerifierFilterer) WatchConfigRemoved(opts *bind.WatchOpts, sink chan<- *DestinationVerifierConfigRemoved) (event.Subscription, error) { + + logs, sub, err := _DestinationVerifier.contract.WatchLogs(opts, "ConfigRemoved") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(DestinationVerifierConfigRemoved) + if err := _DestinationVerifier.contract.UnpackLog(event, "ConfigRemoved", 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 +} + +func (_DestinationVerifier *DestinationVerifierFilterer) ParseConfigRemoved(log types.Log) (*DestinationVerifierConfigRemoved, error) { + event := new(DestinationVerifierConfigRemoved) + if err := _DestinationVerifier.contract.UnpackLog(event, "ConfigRemoved", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type DestinationVerifierConfigSetIterator struct { + Event *DestinationVerifierConfigSet + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *DestinationVerifierConfigSetIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(DestinationVerifierConfigSet) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(DestinationVerifierConfigSet) + 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() + } +} + +func (it *DestinationVerifierConfigSetIterator) Error() error { + return it.fail +} + +func (it *DestinationVerifierConfigSetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type DestinationVerifierConfigSet struct { + DonConfigId [24]byte + Signers []common.Address + F uint8 + RecipientAddressesAndWeights []CommonAddressAndWeight + DonConfigIndex uint16 + Raw types.Log +} + +func (_DestinationVerifier *DestinationVerifierFilterer) FilterConfigSet(opts *bind.FilterOpts, donConfigId [][24]byte) (*DestinationVerifierConfigSetIterator, error) { + + var donConfigIdRule []interface{} + for _, donConfigIdItem := range donConfigId { + donConfigIdRule = append(donConfigIdRule, donConfigIdItem) + } + + logs, sub, err := _DestinationVerifier.contract.FilterLogs(opts, "ConfigSet", donConfigIdRule) + if err != nil { + return nil, err + } + return &DestinationVerifierConfigSetIterator{contract: _DestinationVerifier.contract, event: "ConfigSet", logs: logs, sub: sub}, nil +} + +func (_DestinationVerifier *DestinationVerifierFilterer) WatchConfigSet(opts *bind.WatchOpts, sink chan<- *DestinationVerifierConfigSet, donConfigId [][24]byte) (event.Subscription, error) { + + var donConfigIdRule []interface{} + for _, donConfigIdItem := range donConfigId { + donConfigIdRule = append(donConfigIdRule, donConfigIdItem) + } + + logs, sub, err := _DestinationVerifier.contract.WatchLogs(opts, "ConfigSet", donConfigIdRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(DestinationVerifierConfigSet) + if err := _DestinationVerifier.contract.UnpackLog(event, "ConfigSet", 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 +} + +func (_DestinationVerifier *DestinationVerifierFilterer) ParseConfigSet(log types.Log) (*DestinationVerifierConfigSet, error) { + event := new(DestinationVerifierConfigSet) + if err := _DestinationVerifier.contract.UnpackLog(event, "ConfigSet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type DestinationVerifierFeeManagerSetIterator struct { + Event *DestinationVerifierFeeManagerSet + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *DestinationVerifierFeeManagerSetIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(DestinationVerifierFeeManagerSet) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(DestinationVerifierFeeManagerSet) + 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() + } +} + +func (it *DestinationVerifierFeeManagerSetIterator) Error() error { + return it.fail +} + +func (it *DestinationVerifierFeeManagerSetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type DestinationVerifierFeeManagerSet struct { + OldFeeManager common.Address + NewFeeManager common.Address + Raw types.Log +} + +func (_DestinationVerifier *DestinationVerifierFilterer) FilterFeeManagerSet(opts *bind.FilterOpts) (*DestinationVerifierFeeManagerSetIterator, error) { + + logs, sub, err := _DestinationVerifier.contract.FilterLogs(opts, "FeeManagerSet") + if err != nil { + return nil, err + } + return &DestinationVerifierFeeManagerSetIterator{contract: _DestinationVerifier.contract, event: "FeeManagerSet", logs: logs, sub: sub}, nil +} + +func (_DestinationVerifier *DestinationVerifierFilterer) WatchFeeManagerSet(opts *bind.WatchOpts, sink chan<- *DestinationVerifierFeeManagerSet) (event.Subscription, error) { + + logs, sub, err := _DestinationVerifier.contract.WatchLogs(opts, "FeeManagerSet") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(DestinationVerifierFeeManagerSet) + if err := _DestinationVerifier.contract.UnpackLog(event, "FeeManagerSet", 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 +} + +func (_DestinationVerifier *DestinationVerifierFilterer) ParseFeeManagerSet(log types.Log) (*DestinationVerifierFeeManagerSet, error) { + event := new(DestinationVerifierFeeManagerSet) + if err := _DestinationVerifier.contract.UnpackLog(event, "FeeManagerSet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type DestinationVerifierOwnershipTransferRequestedIterator struct { + Event *DestinationVerifierOwnershipTransferRequested + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *DestinationVerifierOwnershipTransferRequestedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(DestinationVerifierOwnershipTransferRequested) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(DestinationVerifierOwnershipTransferRequested) + 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() + } +} + +func (it *DestinationVerifierOwnershipTransferRequestedIterator) Error() error { + return it.fail +} + +func (it *DestinationVerifierOwnershipTransferRequestedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type DestinationVerifierOwnershipTransferRequested struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_DestinationVerifier *DestinationVerifierFilterer) FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*DestinationVerifierOwnershipTransferRequestedIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _DestinationVerifier.contract.FilterLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return &DestinationVerifierOwnershipTransferRequestedIterator{contract: _DestinationVerifier.contract, event: "OwnershipTransferRequested", logs: logs, sub: sub}, nil +} + +func (_DestinationVerifier *DestinationVerifierFilterer) WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *DestinationVerifierOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _DestinationVerifier.contract.WatchLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(DestinationVerifierOwnershipTransferRequested) + if err := _DestinationVerifier.contract.UnpackLog(event, "OwnershipTransferRequested", 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 +} + +func (_DestinationVerifier *DestinationVerifierFilterer) ParseOwnershipTransferRequested(log types.Log) (*DestinationVerifierOwnershipTransferRequested, error) { + event := new(DestinationVerifierOwnershipTransferRequested) + if err := _DestinationVerifier.contract.UnpackLog(event, "OwnershipTransferRequested", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type DestinationVerifierOwnershipTransferredIterator struct { + Event *DestinationVerifierOwnershipTransferred + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *DestinationVerifierOwnershipTransferredIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(DestinationVerifierOwnershipTransferred) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(DestinationVerifierOwnershipTransferred) + 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() + } +} + +func (it *DestinationVerifierOwnershipTransferredIterator) Error() error { + return it.fail +} + +func (it *DestinationVerifierOwnershipTransferredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type DestinationVerifierOwnershipTransferred struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_DestinationVerifier *DestinationVerifierFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*DestinationVerifierOwnershipTransferredIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _DestinationVerifier.contract.FilterLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return &DestinationVerifierOwnershipTransferredIterator{contract: _DestinationVerifier.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil +} + +func (_DestinationVerifier *DestinationVerifierFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *DestinationVerifierOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _DestinationVerifier.contract.WatchLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(DestinationVerifierOwnershipTransferred) + if err := _DestinationVerifier.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 +} + +func (_DestinationVerifier *DestinationVerifierFilterer) ParseOwnershipTransferred(log types.Log) (*DestinationVerifierOwnershipTransferred, error) { + event := new(DestinationVerifierOwnershipTransferred) + if err := _DestinationVerifier.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type DestinationVerifierReportVerifiedIterator struct { + Event *DestinationVerifierReportVerified + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *DestinationVerifierReportVerifiedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(DestinationVerifierReportVerified) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(DestinationVerifierReportVerified) + 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() + } +} + +func (it *DestinationVerifierReportVerifiedIterator) Error() error { + return it.fail +} + +func (it *DestinationVerifierReportVerifiedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type DestinationVerifierReportVerified struct { + FeedId [32]byte + Requester common.Address + Raw types.Log +} + +func (_DestinationVerifier *DestinationVerifierFilterer) FilterReportVerified(opts *bind.FilterOpts, feedId [][32]byte) (*DestinationVerifierReportVerifiedIterator, error) { + + var feedIdRule []interface{} + for _, feedIdItem := range feedId { + feedIdRule = append(feedIdRule, feedIdItem) + } + + logs, sub, err := _DestinationVerifier.contract.FilterLogs(opts, "ReportVerified", feedIdRule) + if err != nil { + return nil, err + } + return &DestinationVerifierReportVerifiedIterator{contract: _DestinationVerifier.contract, event: "ReportVerified", logs: logs, sub: sub}, nil +} + +func (_DestinationVerifier *DestinationVerifierFilterer) WatchReportVerified(opts *bind.WatchOpts, sink chan<- *DestinationVerifierReportVerified, feedId [][32]byte) (event.Subscription, error) { + + var feedIdRule []interface{} + for _, feedIdItem := range feedId { + feedIdRule = append(feedIdRule, feedIdItem) + } + + logs, sub, err := _DestinationVerifier.contract.WatchLogs(opts, "ReportVerified", feedIdRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(DestinationVerifierReportVerified) + if err := _DestinationVerifier.contract.UnpackLog(event, "ReportVerified", 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 +} + +func (_DestinationVerifier *DestinationVerifierFilterer) ParseReportVerified(log types.Log) (*DestinationVerifierReportVerified, error) { + event := new(DestinationVerifierReportVerified) + if err := _DestinationVerifier.contract.UnpackLog(event, "ReportVerified", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +func (_DestinationVerifier *DestinationVerifier) ParseLog(log types.Log) (generated.AbigenLog, error) { + switch log.Topics[0] { + case _DestinationVerifier.abi.Events["AccessControllerSet"].ID: + return _DestinationVerifier.ParseAccessControllerSet(log) + case _DestinationVerifier.abi.Events["ConfigActivated"].ID: + return _DestinationVerifier.ParseConfigActivated(log) + case _DestinationVerifier.abi.Events["ConfigRemoved"].ID: + return _DestinationVerifier.ParseConfigRemoved(log) + case _DestinationVerifier.abi.Events["ConfigSet"].ID: + return _DestinationVerifier.ParseConfigSet(log) + case _DestinationVerifier.abi.Events["FeeManagerSet"].ID: + return _DestinationVerifier.ParseFeeManagerSet(log) + case _DestinationVerifier.abi.Events["OwnershipTransferRequested"].ID: + return _DestinationVerifier.ParseOwnershipTransferRequested(log) + case _DestinationVerifier.abi.Events["OwnershipTransferred"].ID: + return _DestinationVerifier.ParseOwnershipTransferred(log) + case _DestinationVerifier.abi.Events["ReportVerified"].ID: + return _DestinationVerifier.ParseReportVerified(log) + + default: + return nil, fmt.Errorf("abigen wrapper received unknown log topic: %v", log.Topics[0]) + } +} + +func (DestinationVerifierAccessControllerSet) Topic() common.Hash { + return common.HexToHash("0x953e92b1a6442e9c3242531154a3f6f6eb00b4e9c719ba8118fa6235e4ce89b6") +} + +func (DestinationVerifierConfigActivated) Topic() common.Hash { + return common.HexToHash("0x90186a1e77b498ec417ea88bd026cae00d7043c357cc45221777623bda582dd4") +} + +func (DestinationVerifierConfigRemoved) Topic() common.Hash { + return common.HexToHash("0x970fd8f3ebdd9a271080aacf9807a5c709be0b448e4047a6fc212b8cc165368d") +} + +func (DestinationVerifierConfigSet) Topic() common.Hash { + return common.HexToHash("0xa7d03f81dd1c1d8a55355fd71e1221d5959b7d9fb171fbb6389f207f63598fa5") +} + +func (DestinationVerifierFeeManagerSet) Topic() common.Hash { + return common.HexToHash("0x04628abcaa6b1674651352125cb94b65b289145bc2bc4d67720bb7d966372f03") +} + +func (DestinationVerifierOwnershipTransferRequested) Topic() common.Hash { + return common.HexToHash("0xed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae1278") +} + +func (DestinationVerifierOwnershipTransferred) Topic() common.Hash { + return common.HexToHash("0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0") +} + +func (DestinationVerifierReportVerified) Topic() common.Hash { + return common.HexToHash("0x58ca9502e98a536e06e72d680fcc251e5d10b72291a281665a2c2dc0ac30fcc5") +} + +func (_DestinationVerifier *DestinationVerifier) Address() common.Address { + return _DestinationVerifier.address +} + +type DestinationVerifierInterface interface { + IVerifierProxy(opts *bind.CallOpts) (common.Address, error) + + Owner(opts *bind.CallOpts) (common.Address, error) + + SAccessController(opts *bind.CallOpts) (common.Address, error) + + SFeeManager(opts *bind.CallOpts) (common.Address, error) + + SupportsInterface(opts *bind.CallOpts, interfaceId [4]byte) (bool, error) + + TypeAndVersion(opts *bind.CallOpts) (string, error) + + AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) + + RemoveLatestConfig(opts *bind.TransactOpts) (*types.Transaction, error) + + SetAccessController(opts *bind.TransactOpts, accessController common.Address) (*types.Transaction, error) + + SetConfig(opts *bind.TransactOpts, signers []common.Address, f uint8, recipientAddressesAndWeights []CommonAddressAndWeight) (*types.Transaction, error) + + SetConfigActive(opts *bind.TransactOpts, donConfigIndex *big.Int, isActive bool) (*types.Transaction, error) + + SetConfigWithActivationTime(opts *bind.TransactOpts, signers []common.Address, f uint8, recipientAddressesAndWeights []CommonAddressAndWeight, activationTime uint32) (*types.Transaction, error) + + SetFeeManager(opts *bind.TransactOpts, feeManager common.Address) (*types.Transaction, error) + + TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) + + Verify(opts *bind.TransactOpts, signedReport []byte, parameterPayload []byte, sender common.Address) (*types.Transaction, error) + + VerifyBulk(opts *bind.TransactOpts, signedReports [][]byte, parameterPayload []byte, sender common.Address) (*types.Transaction, error) + + FilterAccessControllerSet(opts *bind.FilterOpts) (*DestinationVerifierAccessControllerSetIterator, error) + + WatchAccessControllerSet(opts *bind.WatchOpts, sink chan<- *DestinationVerifierAccessControllerSet) (event.Subscription, error) + + ParseAccessControllerSet(log types.Log) (*DestinationVerifierAccessControllerSet, error) + + FilterConfigActivated(opts *bind.FilterOpts) (*DestinationVerifierConfigActivatedIterator, error) + + WatchConfigActivated(opts *bind.WatchOpts, sink chan<- *DestinationVerifierConfigActivated) (event.Subscription, error) + + ParseConfigActivated(log types.Log) (*DestinationVerifierConfigActivated, error) + + FilterConfigRemoved(opts *bind.FilterOpts) (*DestinationVerifierConfigRemovedIterator, error) + + WatchConfigRemoved(opts *bind.WatchOpts, sink chan<- *DestinationVerifierConfigRemoved) (event.Subscription, error) + + ParseConfigRemoved(log types.Log) (*DestinationVerifierConfigRemoved, error) + + FilterConfigSet(opts *bind.FilterOpts, donConfigId [][24]byte) (*DestinationVerifierConfigSetIterator, error) + + WatchConfigSet(opts *bind.WatchOpts, sink chan<- *DestinationVerifierConfigSet, donConfigId [][24]byte) (event.Subscription, error) + + ParseConfigSet(log types.Log) (*DestinationVerifierConfigSet, error) + + FilterFeeManagerSet(opts *bind.FilterOpts) (*DestinationVerifierFeeManagerSetIterator, error) + + WatchFeeManagerSet(opts *bind.WatchOpts, sink chan<- *DestinationVerifierFeeManagerSet) (event.Subscription, error) + + ParseFeeManagerSet(log types.Log) (*DestinationVerifierFeeManagerSet, error) + + FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*DestinationVerifierOwnershipTransferRequestedIterator, error) + + WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *DestinationVerifierOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferRequested(log types.Log) (*DestinationVerifierOwnershipTransferRequested, error) + + FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*DestinationVerifierOwnershipTransferredIterator, error) + + WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *DestinationVerifierOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferred(log types.Log) (*DestinationVerifierOwnershipTransferred, error) + + FilterReportVerified(opts *bind.FilterOpts, feedId [][32]byte) (*DestinationVerifierReportVerifiedIterator, error) + + WatchReportVerified(opts *bind.WatchOpts, sink chan<- *DestinationVerifierReportVerified, feedId [][32]byte) (event.Subscription, error) + + ParseReportVerified(log types.Log) (*DestinationVerifierReportVerified, error) + + ParseLog(log types.Log) (generated.AbigenLog, error) + + Address() common.Address +} diff --git a/core/gethwrappers/llo-feeds/generated/destination_verifier_proxy/destination_verifier_proxy.go b/core/gethwrappers/llo-feeds/generated/destination_verifier_proxy/destination_verifier_proxy.go new file mode 100644 index 00000000000..7111fc77639 --- /dev/null +++ b/core/gethwrappers/llo-feeds/generated/destination_verifier_proxy/destination_verifier_proxy.go @@ -0,0 +1,676 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package destination_verifier_proxy + +import ( + "errors" + "fmt" + "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" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" +) + +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +var DestinationVerifierProxyMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"verifierAddress\",\"type\":\"address\"}],\"name\":\"VerifierInvalid\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddress\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_accessController\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_feeManager\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"verifierAddress\",\"type\":\"address\"}],\"name\":\"setVerifier\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"payload\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"parameterPayload\",\"type\":\"bytes\"}],\"name\":\"verify\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes[]\",\"name\":\"payloads\",\"type\":\"bytes[]\"},{\"internalType\":\"bytes\",\"name\":\"parameterPayload\",\"type\":\"bytes\"}],\"name\":\"verifyBulk\",\"outputs\":[{\"internalType\":\"bytes[]\",\"name\":\"verifiedReports\",\"type\":\"bytes[]\"}],\"stateMutability\":\"payable\",\"type\":\"function\"}]", + Bin: "0x608060405234801561001057600080fd5b5033806000816100675760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615610097576100978161009f565b505050610148565b336001600160a01b038216036100f75760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640161005e565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b610fac806101576000396000f3fe6080604052600436106100b15760003560e01c80638da5cb5b11610069578063f2fde38b1161004e578063f2fde38b1461022d578063f7e83aee1461024d578063f873a61c1461026057600080fd5b80638da5cb5b146101ed57806394ba28461461021857600080fd5b806338416b5b1161009a57806338416b5b1461017c5780635437988d146101b657806379ba5097146101d857600080fd5b806301ffc9a7146100b6578063181f5a771461012d575b600080fd5b3480156100c257600080fd5b506101186100d13660046108f7565b7fffffffff00000000000000000000000000000000000000000000000000000000167ff7574762000000000000000000000000000000000000000000000000000000001490565b60405190151581526020015b60405180910390f35b34801561013957600080fd5b5060408051808201909152601e81527f44657374696e6174696f6e566572696669657250726f787920302e342e30000060208201525b60405161012491906109ae565b34801561018857600080fd5b50610191610280565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610124565b3480156101c257600080fd5b506101d66101d13660046109e3565b610319565b005b3480156101e457600080fd5b506101d6610469565b3480156101f957600080fd5b5060005473ffffffffffffffffffffffffffffffffffffffff16610191565b34801561022457600080fd5b50610191610566565b34801561023957600080fd5b506101d66102483660046109e3565b6105d6565b61016f61025b366004610a49565b6105ea565b61027361026e366004610ab5565b6106b9565b6040516101249190610b36565b600254604080517f38416b5b000000000000000000000000000000000000000000000000000000008152905160009273ffffffffffffffffffffffffffffffffffffffff16916338416b5b9160048083019260209291908290030181865afa1580156102f0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103149190610bb6565b905090565b61032161077f565b6040517f01ffc9a70000000000000000000000000000000000000000000000000000000081527f527146e200000000000000000000000000000000000000000000000000000000600482015273ffffffffffffffffffffffffffffffffffffffff8216906301ffc9a790602401602060405180830381865afa1580156103ab573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103cf9190610bd3565b610422576040517f96ac86f300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff821660048201526024015b60405180910390fd5b600280547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60015473ffffffffffffffffffffffffffffffffffffffff1633146104ea576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e6572000000000000000000006044820152606401610419565b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b600254604080517f94ba2846000000000000000000000000000000000000000000000000000000008152905160009273ffffffffffffffffffffffffffffffffffffffff16916394ba28469160048083019260209291908290030181865afa1580156102f0573d6000803e3d6000fd5b6105de61077f565b6105e781610802565b50565b6002546040517f294d2bb100000000000000000000000000000000000000000000000000000000815260609173ffffffffffffffffffffffffffffffffffffffff169063294d2bb190349061064b9089908990899089903390600401610c3e565b60006040518083038185885af1158015610669573d6000803e3d6000fd5b50505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682016040526106b09190810190610d96565b95945050505050565b6002546040517fd7c72e4e00000000000000000000000000000000000000000000000000000000815260609173ffffffffffffffffffffffffffffffffffffffff169063d7c72e4e90349061071a9089908990899089903390600401610dcb565b60006040518083038185885af1158015610738573d6000803e3d6000fd5b50505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682016040526106b09190810190610edc565b60005473ffffffffffffffffffffffffffffffffffffffff163314610800576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e6572000000000000000000006044820152606401610419565b565b3373ffffffffffffffffffffffffffffffffffffffff821603610881576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c660000000000000000006044820152606401610419565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b60006020828403121561090957600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461093957600080fd5b9392505050565b60005b8381101561095b578181015183820152602001610943565b50506000910152565b6000815180845261097c816020860160208601610940565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b6020815260006109396020830184610964565b73ffffffffffffffffffffffffffffffffffffffff811681146105e757600080fd5b6000602082840312156109f557600080fd5b8135610939816109c1565b60008083601f840112610a1257600080fd5b50813567ffffffffffffffff811115610a2a57600080fd5b602083019150836020828501011115610a4257600080fd5b9250929050565b60008060008060408587031215610a5f57600080fd5b843567ffffffffffffffff80821115610a7757600080fd5b610a8388838901610a00565b90965094506020870135915080821115610a9c57600080fd5b50610aa987828801610a00565b95989497509550505050565b60008060008060408587031215610acb57600080fd5b843567ffffffffffffffff80821115610ae357600080fd5b818701915087601f830112610af757600080fd5b813581811115610b0657600080fd5b8860208260051b8501011115610b1b57600080fd5b602092830196509450908601359080821115610a9c57600080fd5b6000602080830181845280855180835260408601915060408160051b870101925083870160005b82811015610ba9577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0888603018452610b97858351610964565b94509285019290850190600101610b5d565b5092979650505050505050565b600060208284031215610bc857600080fd5b8151610939816109c1565b600060208284031215610be557600080fd5b8151801515811461093957600080fd5b8183528181602085013750600060208284010152600060207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b606081526000610c52606083018789610bf5565b8281036020840152610c65818688610bf5565b91505073ffffffffffffffffffffffffffffffffffffffff831660408301529695505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715610d0457610d04610c8e565b604052919050565b600082601f830112610d1d57600080fd5b815167ffffffffffffffff811115610d3757610d37610c8e565b610d6860207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f84011601610cbd565b818152846020838601011115610d7d57600080fd5b610d8e826020830160208701610940565b949350505050565b600060208284031215610da857600080fd5b815167ffffffffffffffff811115610dbf57600080fd5b610d8e84828501610d0c565b6060808252810185905260006080600587901b8301810190830188835b89811015610e97577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8086850301835281357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe18c3603018112610e4957600080fd5b8b01602081810191359067ffffffffffffffff821115610e6857600080fd5b813603831315610e7757600080fd5b610e82878385610bf5565b96509485019493909301925050600101610de8565b5050508281036020840152610ead818688610bf5565b915050610ed2604083018473ffffffffffffffffffffffffffffffffffffffff169052565b9695505050505050565b60006020808385031215610eef57600080fd5b825167ffffffffffffffff80821115610f0757600080fd5b818501915085601f830112610f1b57600080fd5b815181811115610f2d57610f2d610c8e565b8060051b610f3c858201610cbd565b9182528381018501918581019089841115610f5657600080fd5b86860192505b83831015610f9257825185811115610f745760008081fd5b610f828b89838a0101610d0c565b8352509186019190860190610f5c565b999850505050505050505056fea164736f6c6343000813000a", +} + +var DestinationVerifierProxyABI = DestinationVerifierProxyMetaData.ABI + +var DestinationVerifierProxyBin = DestinationVerifierProxyMetaData.Bin + +func DeployDestinationVerifierProxy(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *DestinationVerifierProxy, error) { + parsed, err := DestinationVerifierProxyMetaData.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(DestinationVerifierProxyBin), backend) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &DestinationVerifierProxy{address: address, abi: *parsed, DestinationVerifierProxyCaller: DestinationVerifierProxyCaller{contract: contract}, DestinationVerifierProxyTransactor: DestinationVerifierProxyTransactor{contract: contract}, DestinationVerifierProxyFilterer: DestinationVerifierProxyFilterer{contract: contract}}, nil +} + +type DestinationVerifierProxy struct { + address common.Address + abi abi.ABI + DestinationVerifierProxyCaller + DestinationVerifierProxyTransactor + DestinationVerifierProxyFilterer +} + +type DestinationVerifierProxyCaller struct { + contract *bind.BoundContract +} + +type DestinationVerifierProxyTransactor struct { + contract *bind.BoundContract +} + +type DestinationVerifierProxyFilterer struct { + contract *bind.BoundContract +} + +type DestinationVerifierProxySession struct { + Contract *DestinationVerifierProxy + CallOpts bind.CallOpts + TransactOpts bind.TransactOpts +} + +type DestinationVerifierProxyCallerSession struct { + Contract *DestinationVerifierProxyCaller + CallOpts bind.CallOpts +} + +type DestinationVerifierProxyTransactorSession struct { + Contract *DestinationVerifierProxyTransactor + TransactOpts bind.TransactOpts +} + +type DestinationVerifierProxyRaw struct { + Contract *DestinationVerifierProxy +} + +type DestinationVerifierProxyCallerRaw struct { + Contract *DestinationVerifierProxyCaller +} + +type DestinationVerifierProxyTransactorRaw struct { + Contract *DestinationVerifierProxyTransactor +} + +func NewDestinationVerifierProxy(address common.Address, backend bind.ContractBackend) (*DestinationVerifierProxy, error) { + abi, err := abi.JSON(strings.NewReader(DestinationVerifierProxyABI)) + if err != nil { + return nil, err + } + contract, err := bindDestinationVerifierProxy(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &DestinationVerifierProxy{address: address, abi: abi, DestinationVerifierProxyCaller: DestinationVerifierProxyCaller{contract: contract}, DestinationVerifierProxyTransactor: DestinationVerifierProxyTransactor{contract: contract}, DestinationVerifierProxyFilterer: DestinationVerifierProxyFilterer{contract: contract}}, nil +} + +func NewDestinationVerifierProxyCaller(address common.Address, caller bind.ContractCaller) (*DestinationVerifierProxyCaller, error) { + contract, err := bindDestinationVerifierProxy(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &DestinationVerifierProxyCaller{contract: contract}, nil +} + +func NewDestinationVerifierProxyTransactor(address common.Address, transactor bind.ContractTransactor) (*DestinationVerifierProxyTransactor, error) { + contract, err := bindDestinationVerifierProxy(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &DestinationVerifierProxyTransactor{contract: contract}, nil +} + +func NewDestinationVerifierProxyFilterer(address common.Address, filterer bind.ContractFilterer) (*DestinationVerifierProxyFilterer, error) { + contract, err := bindDestinationVerifierProxy(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &DestinationVerifierProxyFilterer{contract: contract}, nil +} + +func bindDestinationVerifierProxy(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := DestinationVerifierProxyMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +func (_DestinationVerifierProxy *DestinationVerifierProxyRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _DestinationVerifierProxy.Contract.DestinationVerifierProxyCaller.contract.Call(opts, result, method, params...) +} + +func (_DestinationVerifierProxy *DestinationVerifierProxyRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _DestinationVerifierProxy.Contract.DestinationVerifierProxyTransactor.contract.Transfer(opts) +} + +func (_DestinationVerifierProxy *DestinationVerifierProxyRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _DestinationVerifierProxy.Contract.DestinationVerifierProxyTransactor.contract.Transact(opts, method, params...) +} + +func (_DestinationVerifierProxy *DestinationVerifierProxyCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _DestinationVerifierProxy.Contract.contract.Call(opts, result, method, params...) +} + +func (_DestinationVerifierProxy *DestinationVerifierProxyTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _DestinationVerifierProxy.Contract.contract.Transfer(opts) +} + +func (_DestinationVerifierProxy *DestinationVerifierProxyTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _DestinationVerifierProxy.Contract.contract.Transact(opts, method, params...) +} + +func (_DestinationVerifierProxy *DestinationVerifierProxyCaller) Owner(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _DestinationVerifierProxy.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 + +} + +func (_DestinationVerifierProxy *DestinationVerifierProxySession) Owner() (common.Address, error) { + return _DestinationVerifierProxy.Contract.Owner(&_DestinationVerifierProxy.CallOpts) +} + +func (_DestinationVerifierProxy *DestinationVerifierProxyCallerSession) Owner() (common.Address, error) { + return _DestinationVerifierProxy.Contract.Owner(&_DestinationVerifierProxy.CallOpts) +} + +func (_DestinationVerifierProxy *DestinationVerifierProxyCaller) SAccessController(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _DestinationVerifierProxy.contract.Call(opts, &out, "s_accessController") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_DestinationVerifierProxy *DestinationVerifierProxySession) SAccessController() (common.Address, error) { + return _DestinationVerifierProxy.Contract.SAccessController(&_DestinationVerifierProxy.CallOpts) +} + +func (_DestinationVerifierProxy *DestinationVerifierProxyCallerSession) SAccessController() (common.Address, error) { + return _DestinationVerifierProxy.Contract.SAccessController(&_DestinationVerifierProxy.CallOpts) +} + +func (_DestinationVerifierProxy *DestinationVerifierProxyCaller) SFeeManager(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _DestinationVerifierProxy.contract.Call(opts, &out, "s_feeManager") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +func (_DestinationVerifierProxy *DestinationVerifierProxySession) SFeeManager() (common.Address, error) { + return _DestinationVerifierProxy.Contract.SFeeManager(&_DestinationVerifierProxy.CallOpts) +} + +func (_DestinationVerifierProxy *DestinationVerifierProxyCallerSession) SFeeManager() (common.Address, error) { + return _DestinationVerifierProxy.Contract.SFeeManager(&_DestinationVerifierProxy.CallOpts) +} + +func (_DestinationVerifierProxy *DestinationVerifierProxyCaller) SupportsInterface(opts *bind.CallOpts, interfaceId [4]byte) (bool, error) { + var out []interface{} + err := _DestinationVerifierProxy.contract.Call(opts, &out, "supportsInterface", interfaceId) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +func (_DestinationVerifierProxy *DestinationVerifierProxySession) SupportsInterface(interfaceId [4]byte) (bool, error) { + return _DestinationVerifierProxy.Contract.SupportsInterface(&_DestinationVerifierProxy.CallOpts, interfaceId) +} + +func (_DestinationVerifierProxy *DestinationVerifierProxyCallerSession) SupportsInterface(interfaceId [4]byte) (bool, error) { + return _DestinationVerifierProxy.Contract.SupportsInterface(&_DestinationVerifierProxy.CallOpts, interfaceId) +} + +func (_DestinationVerifierProxy *DestinationVerifierProxyCaller) TypeAndVersion(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _DestinationVerifierProxy.contract.Call(opts, &out, "typeAndVersion") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +func (_DestinationVerifierProxy *DestinationVerifierProxySession) TypeAndVersion() (string, error) { + return _DestinationVerifierProxy.Contract.TypeAndVersion(&_DestinationVerifierProxy.CallOpts) +} + +func (_DestinationVerifierProxy *DestinationVerifierProxyCallerSession) TypeAndVersion() (string, error) { + return _DestinationVerifierProxy.Contract.TypeAndVersion(&_DestinationVerifierProxy.CallOpts) +} + +func (_DestinationVerifierProxy *DestinationVerifierProxyTransactor) AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + return _DestinationVerifierProxy.contract.Transact(opts, "acceptOwnership") +} + +func (_DestinationVerifierProxy *DestinationVerifierProxySession) AcceptOwnership() (*types.Transaction, error) { + return _DestinationVerifierProxy.Contract.AcceptOwnership(&_DestinationVerifierProxy.TransactOpts) +} + +func (_DestinationVerifierProxy *DestinationVerifierProxyTransactorSession) AcceptOwnership() (*types.Transaction, error) { + return _DestinationVerifierProxy.Contract.AcceptOwnership(&_DestinationVerifierProxy.TransactOpts) +} + +func (_DestinationVerifierProxy *DestinationVerifierProxyTransactor) SetVerifier(opts *bind.TransactOpts, verifierAddress common.Address) (*types.Transaction, error) { + return _DestinationVerifierProxy.contract.Transact(opts, "setVerifier", verifierAddress) +} + +func (_DestinationVerifierProxy *DestinationVerifierProxySession) SetVerifier(verifierAddress common.Address) (*types.Transaction, error) { + return _DestinationVerifierProxy.Contract.SetVerifier(&_DestinationVerifierProxy.TransactOpts, verifierAddress) +} + +func (_DestinationVerifierProxy *DestinationVerifierProxyTransactorSession) SetVerifier(verifierAddress common.Address) (*types.Transaction, error) { + return _DestinationVerifierProxy.Contract.SetVerifier(&_DestinationVerifierProxy.TransactOpts, verifierAddress) +} + +func (_DestinationVerifierProxy *DestinationVerifierProxyTransactor) TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) { + return _DestinationVerifierProxy.contract.Transact(opts, "transferOwnership", to) +} + +func (_DestinationVerifierProxy *DestinationVerifierProxySession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _DestinationVerifierProxy.Contract.TransferOwnership(&_DestinationVerifierProxy.TransactOpts, to) +} + +func (_DestinationVerifierProxy *DestinationVerifierProxyTransactorSession) TransferOwnership(to common.Address) (*types.Transaction, error) { + return _DestinationVerifierProxy.Contract.TransferOwnership(&_DestinationVerifierProxy.TransactOpts, to) +} + +func (_DestinationVerifierProxy *DestinationVerifierProxyTransactor) Verify(opts *bind.TransactOpts, payload []byte, parameterPayload []byte) (*types.Transaction, error) { + return _DestinationVerifierProxy.contract.Transact(opts, "verify", payload, parameterPayload) +} + +func (_DestinationVerifierProxy *DestinationVerifierProxySession) Verify(payload []byte, parameterPayload []byte) (*types.Transaction, error) { + return _DestinationVerifierProxy.Contract.Verify(&_DestinationVerifierProxy.TransactOpts, payload, parameterPayload) +} + +func (_DestinationVerifierProxy *DestinationVerifierProxyTransactorSession) Verify(payload []byte, parameterPayload []byte) (*types.Transaction, error) { + return _DestinationVerifierProxy.Contract.Verify(&_DestinationVerifierProxy.TransactOpts, payload, parameterPayload) +} + +func (_DestinationVerifierProxy *DestinationVerifierProxyTransactor) VerifyBulk(opts *bind.TransactOpts, payloads [][]byte, parameterPayload []byte) (*types.Transaction, error) { + return _DestinationVerifierProxy.contract.Transact(opts, "verifyBulk", payloads, parameterPayload) +} + +func (_DestinationVerifierProxy *DestinationVerifierProxySession) VerifyBulk(payloads [][]byte, parameterPayload []byte) (*types.Transaction, error) { + return _DestinationVerifierProxy.Contract.VerifyBulk(&_DestinationVerifierProxy.TransactOpts, payloads, parameterPayload) +} + +func (_DestinationVerifierProxy *DestinationVerifierProxyTransactorSession) VerifyBulk(payloads [][]byte, parameterPayload []byte) (*types.Transaction, error) { + return _DestinationVerifierProxy.Contract.VerifyBulk(&_DestinationVerifierProxy.TransactOpts, payloads, parameterPayload) +} + +type DestinationVerifierProxyOwnershipTransferRequestedIterator struct { + Event *DestinationVerifierProxyOwnershipTransferRequested + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *DestinationVerifierProxyOwnershipTransferRequestedIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(DestinationVerifierProxyOwnershipTransferRequested) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(DestinationVerifierProxyOwnershipTransferRequested) + 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() + } +} + +func (it *DestinationVerifierProxyOwnershipTransferRequestedIterator) Error() error { + return it.fail +} + +func (it *DestinationVerifierProxyOwnershipTransferRequestedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type DestinationVerifierProxyOwnershipTransferRequested struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_DestinationVerifierProxy *DestinationVerifierProxyFilterer) FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*DestinationVerifierProxyOwnershipTransferRequestedIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _DestinationVerifierProxy.contract.FilterLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return &DestinationVerifierProxyOwnershipTransferRequestedIterator{contract: _DestinationVerifierProxy.contract, event: "OwnershipTransferRequested", logs: logs, sub: sub}, nil +} + +func (_DestinationVerifierProxy *DestinationVerifierProxyFilterer) WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *DestinationVerifierProxyOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _DestinationVerifierProxy.contract.WatchLogs(opts, "OwnershipTransferRequested", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(DestinationVerifierProxyOwnershipTransferRequested) + if err := _DestinationVerifierProxy.contract.UnpackLog(event, "OwnershipTransferRequested", 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 +} + +func (_DestinationVerifierProxy *DestinationVerifierProxyFilterer) ParseOwnershipTransferRequested(log types.Log) (*DestinationVerifierProxyOwnershipTransferRequested, error) { + event := new(DestinationVerifierProxyOwnershipTransferRequested) + if err := _DestinationVerifierProxy.contract.UnpackLog(event, "OwnershipTransferRequested", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +type DestinationVerifierProxyOwnershipTransferredIterator struct { + Event *DestinationVerifierProxyOwnershipTransferred + + contract *bind.BoundContract + event string + + logs chan types.Log + sub ethereum.Subscription + done bool + fail error +} + +func (it *DestinationVerifierProxyOwnershipTransferredIterator) Next() bool { + + if it.fail != nil { + return false + } + + if it.done { + select { + case log := <-it.logs: + it.Event = new(DestinationVerifierProxyOwnershipTransferred) + 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 + } + } + + select { + case log := <-it.logs: + it.Event = new(DestinationVerifierProxyOwnershipTransferred) + 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() + } +} + +func (it *DestinationVerifierProxyOwnershipTransferredIterator) Error() error { + return it.fail +} + +func (it *DestinationVerifierProxyOwnershipTransferredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +type DestinationVerifierProxyOwnershipTransferred struct { + From common.Address + To common.Address + Raw types.Log +} + +func (_DestinationVerifierProxy *DestinationVerifierProxyFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*DestinationVerifierProxyOwnershipTransferredIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _DestinationVerifierProxy.contract.FilterLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return &DestinationVerifierProxyOwnershipTransferredIterator{contract: _DestinationVerifierProxy.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil +} + +func (_DestinationVerifierProxy *DestinationVerifierProxyFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *DestinationVerifierProxyOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _DestinationVerifierProxy.contract.WatchLogs(opts, "OwnershipTransferred", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + + event := new(DestinationVerifierProxyOwnershipTransferred) + if err := _DestinationVerifierProxy.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 +} + +func (_DestinationVerifierProxy *DestinationVerifierProxyFilterer) ParseOwnershipTransferred(log types.Log) (*DestinationVerifierProxyOwnershipTransferred, error) { + event := new(DestinationVerifierProxyOwnershipTransferred) + if err := _DestinationVerifierProxy.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +func (_DestinationVerifierProxy *DestinationVerifierProxy) ParseLog(log types.Log) (generated.AbigenLog, error) { + switch log.Topics[0] { + case _DestinationVerifierProxy.abi.Events["OwnershipTransferRequested"].ID: + return _DestinationVerifierProxy.ParseOwnershipTransferRequested(log) + case _DestinationVerifierProxy.abi.Events["OwnershipTransferred"].ID: + return _DestinationVerifierProxy.ParseOwnershipTransferred(log) + + default: + return nil, fmt.Errorf("abigen wrapper received unknown log topic: %v", log.Topics[0]) + } +} + +func (DestinationVerifierProxyOwnershipTransferRequested) Topic() common.Hash { + return common.HexToHash("0xed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae1278") +} + +func (DestinationVerifierProxyOwnershipTransferred) Topic() common.Hash { + return common.HexToHash("0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0") +} + +func (_DestinationVerifierProxy *DestinationVerifierProxy) Address() common.Address { + return _DestinationVerifierProxy.address +} + +type DestinationVerifierProxyInterface interface { + Owner(opts *bind.CallOpts) (common.Address, error) + + SAccessController(opts *bind.CallOpts) (common.Address, error) + + SFeeManager(opts *bind.CallOpts) (common.Address, error) + + SupportsInterface(opts *bind.CallOpts, interfaceId [4]byte) (bool, error) + + TypeAndVersion(opts *bind.CallOpts) (string, error) + + AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) + + SetVerifier(opts *bind.TransactOpts, verifierAddress common.Address) (*types.Transaction, error) + + TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) + + Verify(opts *bind.TransactOpts, payload []byte, parameterPayload []byte) (*types.Transaction, error) + + VerifyBulk(opts *bind.TransactOpts, payloads [][]byte, parameterPayload []byte) (*types.Transaction, error) + + FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*DestinationVerifierProxyOwnershipTransferRequestedIterator, error) + + WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *DestinationVerifierProxyOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferRequested(log types.Log) (*DestinationVerifierProxyOwnershipTransferRequested, error) + + FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*DestinationVerifierProxyOwnershipTransferredIterator, error) + + WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *DestinationVerifierProxyOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) + + ParseOwnershipTransferred(log types.Log) (*DestinationVerifierProxyOwnershipTransferred, error) + + ParseLog(log types.Log) (generated.AbigenLog, error) + + Address() common.Address +} diff --git a/core/gethwrappers/llo-feeds/generated/errored_verifier/errored_verifier.go b/core/gethwrappers/llo-feeds/generated/errored_verifier/errored_verifier.go index 4d140ea064a..f834686dfef 100644 --- a/core/gethwrappers/llo-feeds/generated/errored_verifier/errored_verifier.go +++ b/core/gethwrappers/llo-feeds/generated/errored_verifier/errored_verifier.go @@ -34,8 +34,8 @@ type CommonAddressAndWeight struct { } var ErroredVerifierMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"activateConfig\",\"outputs\":[],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"activateFeed\",\"outputs\":[],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"deactivateConfig\",\"outputs\":[],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"deactivateFeed\",\"outputs\":[],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"latestConfigDetails\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"latestConfigDigestAndEpoch\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"},{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"},{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"},{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"},{\"internalType\":\"bytes32[]\",\"name\":\"\",\"type\":\"bytes32[]\"},{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"},{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"weight\",\"type\":\"uint64\"}],\"internalType\":\"structCommon.AddressAndWeight[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"name\":\"setConfig\",\"outputs\":[],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"},{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"},{\"internalType\":\"bytes32[]\",\"name\":\"\",\"type\":\"bytes32[]\"},{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"},{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"weight\",\"type\":\"uint64\"}],\"internalType\":\"structCommon.AddressAndWeight[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"name\":\"setConfigFromSource\",\"outputs\":[],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"verify\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"pure\",\"type\":\"function\"}]", - Bin: "0x608060405234801561001057600080fd5b50610c2e806100206000396000f3fe608060405234801561001057600080fd5b50600436106100be5760003560e01c8063b70d929d11610076578063e7db9c2a1161005b578063e7db9c2a146101d1578063e84f128e146101e4578063f01072211461021a57600080fd5b8063b70d929d14610188578063ded6307c146101be57600080fd5b80633dd86430116100a75780633dd864301461014d578063564a0a7a1461016257806394d959801461017557600080fd5b806301ffc9a7146100c35780633d3ac1b51461012d575b600080fd5b6101186100d136600461059a565b7fffffffff00000000000000000000000000000000000000000000000000000000167f3d3ac1b5000000000000000000000000000000000000000000000000000000001490565b60405190151581526020015b60405180910390f35b61014061013b366004610741565b610228565b604051610124919061078f565b61016061015b3660046107fb565b610292565b005b6101606101703660046107fb565b6102f4565b610160610183366004610814565b610356565b61019b6101963660046107fb565b6103b8565b604080519315158452602084019290925263ffffffff1690820152606001610124565b6101606101cc366004610814565b610447565b6101606101df3660046109f1565b6104a9565b6101f76101f23660046107fb565b61050b565b6040805163ffffffff948516815293909216602084015290820152606001610124565b6101606101df366004610b24565b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f4661696c656420746f207665726966790000000000000000000000000000000060448201526060906064015b60405180910390fd5b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f4661696c656420746f20616374697661746520666565640000000000000000006044820152606401610289565b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f4661696c656420746f20646561637469766174652066656564000000000000006044820152606401610289565b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f4661696c656420746f206465616374697661746520636f6e66696700000000006044820152606401610289565b60008060006040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610289906020808252602c908201527f4661696c656420746f20676574206c617465737420636f6e666967206469676560408201527f737420616e642065706f63680000000000000000000000000000000000000000606082015260800190565b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f4661696c656420746f20616374697661746520636f6e666967000000000000006044820152606401610289565b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f4661696c656420746f2073657420636f6e6669670000000000000000000000006044820152606401610289565b60008060006040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102899060208082526023908201527f4661696c656420746f20676574206c617465737420636f6e666967206465746160408201527f696c730000000000000000000000000000000000000000000000000000000000606082015260800190565b6000602082840312156105ac57600080fd5b81357fffffffff00000000000000000000000000000000000000000000000000000000811681146105dc57600080fd5b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040805190810167ffffffffffffffff81118282101715610635576106356105e3565b60405290565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715610682576106826105e3565b604052919050565b600082601f83011261069b57600080fd5b813567ffffffffffffffff8111156106b5576106b56105e3565b6106e660207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8401160161063b565b8181528460208386010111156106fb57600080fd5b816020850160208301376000918101602001919091529392505050565b803573ffffffffffffffffffffffffffffffffffffffff8116811461073c57600080fd5b919050565b6000806040838503121561075457600080fd5b823567ffffffffffffffff81111561076b57600080fd5b6107778582860161068a565b92505061078660208401610718565b90509250929050565b600060208083528351808285015260005b818110156107bc578581018301518582016040015282016107a0565b5060006040828601015260407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8301168501019250505092915050565b60006020828403121561080d57600080fd5b5035919050565b6000806040838503121561082757600080fd5b50508035926020909101359150565b803563ffffffff8116811461073c57600080fd5b600067ffffffffffffffff821115610864576108646105e3565b5060051b60200190565b600082601f83011261087f57600080fd5b8135602061089461088f8361084a565b61063b565b82815260059290921b840181019181810190868411156108b357600080fd5b8286015b848110156108d5576108c881610718565b83529183019183016108b7565b509695505050505050565b600082601f8301126108f157600080fd5b8135602061090161088f8361084a565b82815260059290921b8401810191818101908684111561092057600080fd5b8286015b848110156108d55780358352918301918301610924565b803560ff8116811461073c57600080fd5b803567ffffffffffffffff8116811461073c57600080fd5b600082601f83011261097557600080fd5b8135602061098561088f8361084a565b82815260069290921b840181019181810190868411156109a457600080fd5b8286015b848110156108d557604081890312156109c15760008081fd5b6109c9610612565b6109d282610718565b81526109df85830161094c565b818601528352918301916040016109a8565b60008060008060008060008060008060006101608c8e031215610a1357600080fd5b8b359a5060208c01359950610a2a60408d01610718565b9850610a3860608d01610836565b975067ffffffffffffffff8060808e01351115610a5457600080fd5b610a648e60808f01358f0161086e565b97508060a08e01351115610a7757600080fd5b610a878e60a08f01358f016108e0565b9650610a9560c08e0161093b565b95508060e08e01351115610aa857600080fd5b610ab88e60e08f01358f0161068a565b9450610ac76101008e0161094c565b9350806101208e01351115610adb57600080fd5b610aec8e6101208f01358f0161068a565b9250806101408e01351115610b0057600080fd5b50610b128d6101408e01358e01610964565b90509295989b509295989b9093969950565b600080600080600080600080610100898b031215610b4157600080fd5b88359750602089013567ffffffffffffffff80821115610b6057600080fd5b610b6c8c838d0161086e565b985060408b0135915080821115610b8257600080fd5b610b8e8c838d016108e0565b9750610b9c60608c0161093b565b965060808b0135915080821115610bb257600080fd5b610bbe8c838d0161068a565b9550610bcc60a08c0161094c565b945060c08b0135915080821115610be257600080fd5b610bee8c838d0161068a565b935060e08b0135915080821115610c0457600080fd5b50610c118b828c01610964565b915050929598509295989093965056fea164736f6c6343000813000a", + ABI: "[{\"inputs\":[],\"name\":\"FailedToActivateConfig\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FailedToActivateFeed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FailedToDeactivateConfig\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FailedToDeactivateFeed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FailedToGetLatestConfigDetails\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FailedToGetLatestConfigDigestAndEpoch\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FailedToSetConfig\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FailedToVerify\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"activateConfig\",\"outputs\":[],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"activateFeed\",\"outputs\":[],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"deactivateConfig\",\"outputs\":[],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"deactivateFeed\",\"outputs\":[],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"latestConfigDetails\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"latestConfigDigestAndEpoch\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"},{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"},{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"},{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"},{\"internalType\":\"bytes32[]\",\"name\":\"\",\"type\":\"bytes32[]\"},{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"},{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"weight\",\"type\":\"uint64\"}],\"internalType\":\"structCommon.AddressAndWeight[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"name\":\"setConfig\",\"outputs\":[],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"},{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"},{\"internalType\":\"bytes32[]\",\"name\":\"\",\"type\":\"bytes32[]\"},{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"},{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"weight\",\"type\":\"uint64\"}],\"internalType\":\"structCommon.AddressAndWeight[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"name\":\"setConfigFromSource\",\"outputs\":[],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"verify\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"pure\",\"type\":\"function\"}]", + Bin: "0x608060405234801561001057600080fd5b50610a58806100206000396000f3fe608060405234801561001057600080fd5b50600436106100be5760003560e01c8063b70d929d11610076578063e7db9c2a1161005b578063e7db9c2a146101d1578063e84f128e146101e4578063f01072211461021a57600080fd5b8063b70d929d14610188578063ded6307c146101be57600080fd5b80633dd86430116100a75780633dd864301461014d578063564a0a7a1461016257806394d959801461017557600080fd5b806301ffc9a7146100c35780633d3ac1b51461012d575b600080fd5b6101186100d13660046103c4565b7fffffffff00000000000000000000000000000000000000000000000000000000167f3d3ac1b5000000000000000000000000000000000000000000000000000000001490565b60405190151581526020015b60405180910390f35b61014061013b36600461056b565b610228565b60405161012491906105b9565b61016061015b366004610625565b61025c565b005b610160610170366004610625565b61028e565b61016061018336600461063e565b6102c0565b61019b610196366004610625565b6102f2565b604080519315158452602084019290925263ffffffff1690820152606001610124565b6101606101cc36600461063e565b610329565b6101606101df36600461081b565b61035b565b6101f76101f2366004610625565b61038d565b6040805163ffffffff948516815293909216602084015290820152606001610124565b6101606101df36600461094e565b60606040517fcf2e344600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f9601b68300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517fa03564b300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f8a406e4600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008060006040517fbbc0083000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f7adb7c9600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f35e91bf100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008060006040517fa06d64a000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000602082840312156103d657600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461040657600080fd5b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040805190810167ffffffffffffffff8111828210171561045f5761045f61040d565b60405290565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff811182821017156104ac576104ac61040d565b604052919050565b600082601f8301126104c557600080fd5b813567ffffffffffffffff8111156104df576104df61040d565b61051060207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f84011601610465565b81815284602083860101111561052557600080fd5b816020850160208301376000918101602001919091529392505050565b803573ffffffffffffffffffffffffffffffffffffffff8116811461056657600080fd5b919050565b6000806040838503121561057e57600080fd5b823567ffffffffffffffff81111561059557600080fd5b6105a1858286016104b4565b9250506105b060208401610542565b90509250929050565b600060208083528351808285015260005b818110156105e6578581018301518582016040015282016105ca565b5060006040828601015260407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8301168501019250505092915050565b60006020828403121561063757600080fd5b5035919050565b6000806040838503121561065157600080fd5b50508035926020909101359150565b803563ffffffff8116811461056657600080fd5b600067ffffffffffffffff82111561068e5761068e61040d565b5060051b60200190565b600082601f8301126106a957600080fd5b813560206106be6106b983610674565b610465565b82815260059290921b840181019181810190868411156106dd57600080fd5b8286015b848110156106ff576106f281610542565b83529183019183016106e1565b509695505050505050565b600082601f83011261071b57600080fd5b8135602061072b6106b983610674565b82815260059290921b8401810191818101908684111561074a57600080fd5b8286015b848110156106ff578035835291830191830161074e565b803560ff8116811461056657600080fd5b803567ffffffffffffffff8116811461056657600080fd5b600082601f83011261079f57600080fd5b813560206107af6106b983610674565b82815260069290921b840181019181810190868411156107ce57600080fd5b8286015b848110156106ff57604081890312156107eb5760008081fd5b6107f361043c565b6107fc82610542565b8152610809858301610776565b818601528352918301916040016107d2565b60008060008060008060008060008060006101608c8e03121561083d57600080fd5b8b359a5060208c0135995061085460408d01610542565b985061086260608d01610660565b975067ffffffffffffffff8060808e0135111561087e57600080fd5b61088e8e60808f01358f01610698565b97508060a08e013511156108a157600080fd5b6108b18e60a08f01358f0161070a565b96506108bf60c08e01610765565b95508060e08e013511156108d257600080fd5b6108e28e60e08f01358f016104b4565b94506108f16101008e01610776565b9350806101208e0135111561090557600080fd5b6109168e6101208f01358f016104b4565b9250806101408e0135111561092a57600080fd5b5061093c8d6101408e01358e0161078e565b90509295989b509295989b9093969950565b600080600080600080600080610100898b03121561096b57600080fd5b88359750602089013567ffffffffffffffff8082111561098a57600080fd5b6109968c838d01610698565b985060408b01359150808211156109ac57600080fd5b6109b88c838d0161070a565b97506109c660608c01610765565b965060808b01359150808211156109dc57600080fd5b6109e88c838d016104b4565b95506109f660a08c01610776565b945060c08b0135915080821115610a0c57600080fd5b610a188c838d016104b4565b935060e08b0135915080821115610a2e57600080fd5b50610a3b8b828c0161078e565b915050929598509295989093965056fea164736f6c6343000813000a", } var ErroredVerifierABI = ErroredVerifierMetaData.ABI diff --git a/core/gethwrappers/llo-feeds/generated/exposed_channel_verifier/exposed_channel_verifier.go b/core/gethwrappers/llo-feeds/generated/exposed_channel_verifier/exposed_channel_verifier.go deleted file mode 100644 index e516b9a247f..00000000000 --- a/core/gethwrappers/llo-feeds/generated/exposed_channel_verifier/exposed_channel_verifier.go +++ /dev/null @@ -1,202 +0,0 @@ -// Code generated - DO NOT EDIT. -// This file is a generated binding and any manual changes will be lost. - -package exposed_channel_verifier - -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" -) - -var ( - _ = errors.New - _ = big.NewInt - _ = strings.NewReader - _ = ethereum.NotFound - _ = bind.Bind - _ = common.Big1 - _ = types.BloomLookup - _ = event.NewSubscription - _ = abi.ConvertType -) - -var ExposedChannelVerifierMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_chainId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"_contractAddress\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"_configCount\",\"type\":\"uint64\"},{\"internalType\":\"address[]\",\"name\":\"_signers\",\"type\":\"address[]\"},{\"internalType\":\"bytes32[]\",\"name\":\"_offchainTransmitters\",\"type\":\"bytes32[]\"},{\"internalType\":\"uint8\",\"name\":\"_f\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"_onchainConfig\",\"type\":\"bytes\"},{\"internalType\":\"uint64\",\"name\":\"_encodedConfigVersion\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"_encodedConfig\",\"type\":\"bytes\"}],\"name\":\"exposedConfigDigestFromConfigData\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"pure\",\"type\":\"function\"}]", - Bin: "0x608060405234801561001057600080fd5b5061067e806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c8063b05a355014610030575b600080fd5b61004361003e3660046103f2565b610055565b60405190815260200160405180910390f35b60006100a08b8b8b8b8b8b8b8b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508d92508c91506100af9050565b9b9a5050505050505050505050565b6000808a8a8a8a8a8a8a8a8a6040516020016100d399989796959493929190610594565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815291905280516020909101207dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167e09000000000000000000000000000000000000000000000000000000000000179150509998505050505050505050565b803573ffffffffffffffffffffffffffffffffffffffff8116811461017e57600080fd5b919050565b803567ffffffffffffffff8116811461017e57600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff811182821017156102115761021161019b565b604052919050565b600067ffffffffffffffff8211156102335761023361019b565b5060051b60200190565b600082601f83011261024e57600080fd5b8135602061026361025e83610219565b6101ca565b82815260059290921b8401810191818101908684111561028257600080fd5b8286015b848110156102a4576102978161015a565b8352918301918301610286565b509695505050505050565b600082601f8301126102c057600080fd5b813560206102d061025e83610219565b82815260059290921b840181019181810190868411156102ef57600080fd5b8286015b848110156102a457803583529183019183016102f3565b803560ff8116811461017e57600080fd5b60008083601f84011261032d57600080fd5b50813567ffffffffffffffff81111561034557600080fd5b60208301915083602082850101111561035d57600080fd5b9250929050565b600082601f83011261037557600080fd5b813567ffffffffffffffff81111561038f5761038f61019b565b6103c060207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116016101ca565b8181528460208386010111156103d557600080fd5b816020850160208301376000918101602001919091529392505050565b6000806000806000806000806000806101208b8d03121561041257600080fd5b8a35995061042260208c0161015a565b985061043060408c01610183565b975060608b013567ffffffffffffffff8082111561044d57600080fd5b6104598e838f0161023d565b985060808d013591508082111561046f57600080fd5b61047b8e838f016102af565b975061048960a08e0161030a565b965060c08d013591508082111561049f57600080fd5b6104ab8e838f0161031b565b90965094508491506104bf60e08e01610183565b93506101008d01359150808211156104d657600080fd5b506104e38d828e01610364565b9150509295989b9194979a5092959850565b600081518084526020808501945080840160005b8381101561052557815187529582019590820190600101610509565b509495945050505050565b6000815180845260005b818110156105565760208185018101518683018201520161053a565b5060006020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b60006101208083018c8452602073ffffffffffffffffffffffffffffffffffffffff808e168287015267ffffffffffffffff8d1660408701528360608701528293508b5180845261014087019450828d01935060005b818110156106085784518316865294830194938301936001016105ea565b5050505050828103608084015261061f81896104f5565b60ff881660a0850152905082810360c084015261063c8187610530565b67ffffffffffffffff861660e085015290508281036101008401526106618185610530565b9c9b50505050505050505050505056fea164736f6c6343000813000a", -} - -var ExposedChannelVerifierABI = ExposedChannelVerifierMetaData.ABI - -var ExposedChannelVerifierBin = ExposedChannelVerifierMetaData.Bin - -func DeployExposedChannelVerifier(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *ExposedChannelVerifier, error) { - parsed, err := ExposedChannelVerifierMetaData.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(ExposedChannelVerifierBin), backend) - if err != nil { - return common.Address{}, nil, nil, err - } - return address, tx, &ExposedChannelVerifier{address: address, abi: *parsed, ExposedChannelVerifierCaller: ExposedChannelVerifierCaller{contract: contract}, ExposedChannelVerifierTransactor: ExposedChannelVerifierTransactor{contract: contract}, ExposedChannelVerifierFilterer: ExposedChannelVerifierFilterer{contract: contract}}, nil -} - -type ExposedChannelVerifier struct { - address common.Address - abi abi.ABI - ExposedChannelVerifierCaller - ExposedChannelVerifierTransactor - ExposedChannelVerifierFilterer -} - -type ExposedChannelVerifierCaller struct { - contract *bind.BoundContract -} - -type ExposedChannelVerifierTransactor struct { - contract *bind.BoundContract -} - -type ExposedChannelVerifierFilterer struct { - contract *bind.BoundContract -} - -type ExposedChannelVerifierSession struct { - Contract *ExposedChannelVerifier - CallOpts bind.CallOpts - TransactOpts bind.TransactOpts -} - -type ExposedChannelVerifierCallerSession struct { - Contract *ExposedChannelVerifierCaller - CallOpts bind.CallOpts -} - -type ExposedChannelVerifierTransactorSession struct { - Contract *ExposedChannelVerifierTransactor - TransactOpts bind.TransactOpts -} - -type ExposedChannelVerifierRaw struct { - Contract *ExposedChannelVerifier -} - -type ExposedChannelVerifierCallerRaw struct { - Contract *ExposedChannelVerifierCaller -} - -type ExposedChannelVerifierTransactorRaw struct { - Contract *ExposedChannelVerifierTransactor -} - -func NewExposedChannelVerifier(address common.Address, backend bind.ContractBackend) (*ExposedChannelVerifier, error) { - abi, err := abi.JSON(strings.NewReader(ExposedChannelVerifierABI)) - if err != nil { - return nil, err - } - contract, err := bindExposedChannelVerifier(address, backend, backend, backend) - if err != nil { - return nil, err - } - return &ExposedChannelVerifier{address: address, abi: abi, ExposedChannelVerifierCaller: ExposedChannelVerifierCaller{contract: contract}, ExposedChannelVerifierTransactor: ExposedChannelVerifierTransactor{contract: contract}, ExposedChannelVerifierFilterer: ExposedChannelVerifierFilterer{contract: contract}}, nil -} - -func NewExposedChannelVerifierCaller(address common.Address, caller bind.ContractCaller) (*ExposedChannelVerifierCaller, error) { - contract, err := bindExposedChannelVerifier(address, caller, nil, nil) - if err != nil { - return nil, err - } - return &ExposedChannelVerifierCaller{contract: contract}, nil -} - -func NewExposedChannelVerifierTransactor(address common.Address, transactor bind.ContractTransactor) (*ExposedChannelVerifierTransactor, error) { - contract, err := bindExposedChannelVerifier(address, nil, transactor, nil) - if err != nil { - return nil, err - } - return &ExposedChannelVerifierTransactor{contract: contract}, nil -} - -func NewExposedChannelVerifierFilterer(address common.Address, filterer bind.ContractFilterer) (*ExposedChannelVerifierFilterer, error) { - contract, err := bindExposedChannelVerifier(address, nil, nil, filterer) - if err != nil { - return nil, err - } - return &ExposedChannelVerifierFilterer{contract: contract}, nil -} - -func bindExposedChannelVerifier(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { - parsed, err := ExposedChannelVerifierMetaData.GetAbi() - if err != nil { - return nil, err - } - return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil -} - -func (_ExposedChannelVerifier *ExposedChannelVerifierRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _ExposedChannelVerifier.Contract.ExposedChannelVerifierCaller.contract.Call(opts, result, method, params...) -} - -func (_ExposedChannelVerifier *ExposedChannelVerifierRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _ExposedChannelVerifier.Contract.ExposedChannelVerifierTransactor.contract.Transfer(opts) -} - -func (_ExposedChannelVerifier *ExposedChannelVerifierRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _ExposedChannelVerifier.Contract.ExposedChannelVerifierTransactor.contract.Transact(opts, method, params...) -} - -func (_ExposedChannelVerifier *ExposedChannelVerifierCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _ExposedChannelVerifier.Contract.contract.Call(opts, result, method, params...) -} - -func (_ExposedChannelVerifier *ExposedChannelVerifierTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _ExposedChannelVerifier.Contract.contract.Transfer(opts) -} - -func (_ExposedChannelVerifier *ExposedChannelVerifierTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _ExposedChannelVerifier.Contract.contract.Transact(opts, method, params...) -} - -func (_ExposedChannelVerifier *ExposedChannelVerifierCaller) ExposedConfigDigestFromConfigData(opts *bind.CallOpts, _chainId *big.Int, _contractAddress common.Address, _configCount uint64, _signers []common.Address, _offchainTransmitters [][32]byte, _f uint8, _onchainConfig []byte, _encodedConfigVersion uint64, _encodedConfig []byte) ([32]byte, error) { - var out []interface{} - err := _ExposedChannelVerifier.contract.Call(opts, &out, "exposedConfigDigestFromConfigData", _chainId, _contractAddress, _configCount, _signers, _offchainTransmitters, _f, _onchainConfig, _encodedConfigVersion, _encodedConfig) - - if err != nil { - return *new([32]byte), err - } - - out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) - - return out0, err - -} - -func (_ExposedChannelVerifier *ExposedChannelVerifierSession) ExposedConfigDigestFromConfigData(_chainId *big.Int, _contractAddress common.Address, _configCount uint64, _signers []common.Address, _offchainTransmitters [][32]byte, _f uint8, _onchainConfig []byte, _encodedConfigVersion uint64, _encodedConfig []byte) ([32]byte, error) { - return _ExposedChannelVerifier.Contract.ExposedConfigDigestFromConfigData(&_ExposedChannelVerifier.CallOpts, _chainId, _contractAddress, _configCount, _signers, _offchainTransmitters, _f, _onchainConfig, _encodedConfigVersion, _encodedConfig) -} - -func (_ExposedChannelVerifier *ExposedChannelVerifierCallerSession) ExposedConfigDigestFromConfigData(_chainId *big.Int, _contractAddress common.Address, _configCount uint64, _signers []common.Address, _offchainTransmitters [][32]byte, _f uint8, _onchainConfig []byte, _encodedConfigVersion uint64, _encodedConfig []byte) ([32]byte, error) { - return _ExposedChannelVerifier.Contract.ExposedConfigDigestFromConfigData(&_ExposedChannelVerifier.CallOpts, _chainId, _contractAddress, _configCount, _signers, _offchainTransmitters, _f, _onchainConfig, _encodedConfigVersion, _encodedConfig) -} - -func (_ExposedChannelVerifier *ExposedChannelVerifier) Address() common.Address { - return _ExposedChannelVerifier.address -} - -type ExposedChannelVerifierInterface interface { - ExposedConfigDigestFromConfigData(opts *bind.CallOpts, _chainId *big.Int, _contractAddress common.Address, _configCount uint64, _signers []common.Address, _offchainTransmitters [][32]byte, _f uint8, _onchainConfig []byte, _encodedConfigVersion uint64, _encodedConfig []byte) ([32]byte, error) - - Address() common.Address -} diff --git a/core/gethwrappers/llo-feeds/generation/generated-wrapper-dependency-versions-do-not-edit.txt b/core/gethwrappers/llo-feeds/generation/generated-wrapper-dependency-versions-do-not-edit.txt index 729d3a295cd..7d7d655ddce 100644 --- a/core/gethwrappers/llo-feeds/generation/generated-wrapper-dependency-versions-do-not-edit.txt +++ b/core/gethwrappers/llo-feeds/generation/generated-wrapper-dependency-versions-do-not-edit.txt @@ -1,8 +1,13 @@ GETH_VERSION: 1.13.8 -channel_config_store: ../../../contracts/solc/v0.8.19/ChannelConfigStore/ChannelConfigStore.abi ../../../contracts/solc/v0.8.19/ChannelConfigStore/ChannelConfigStore.bin c90e29d9f1a885098982b6175e0447416431b28c605273c807694ac7141e9167 +channel_config_store: ../../../contracts/solc/v0.8.19/ChannelConfigStore/ChannelConfigStore.abi ../../../contracts/solc/v0.8.19/ChannelConfigStore/ChannelConfigStore.bin 3fafe83ea21d50488f5533962f62683988ffa6fd1476dccbbb9040be2369cb37 channel_config_verifier_proxy: ../../../contracts/solc/v0.8.19/ChannelVerifierProxy/ChannelVerifierProxy.abi ../../../contracts/solc/v0.8.19/ChannelVerifierProxy/ChannelVerifierProxy.bin 655658e5f61dfadfe3268de04f948b7e690ad03ca45676e645d6cd6018154661 channel_verifier: ../../../contracts/solc/v0.8.19/ChannelVerifier/ChannelVerifier.abi ../../../contracts/solc/v0.8.19/ChannelVerifier/ChannelVerifier.bin e6020553bd8e3e6b250fcaffe7efd22aea955c8c1a0eb05d282fdeb0ab6550b7 -errored_verifier: ../../../contracts/solc/v0.8.19/ErroredVerifier/ErroredVerifier.abi ../../../contracts/solc/v0.8.19/ErroredVerifier/ErroredVerifier.bin a3e5a77262e13ee30fe8d35551b32a3452d71929e43fd780bbfefeaf4aa62e43 +configurator: ../../../contracts/solc/v0.8.19/Configurator/Configurator.abi ../../../contracts/solc/v0.8.19/Configurator/Configurator.bin 75b9809e6e1cd00d1438028df3bbc7ce00d667dfd882a348081b4286edcdc4e0 +destination_fee_manager: ../../../contracts/solc/v0.8.19/DestinationFeeManager/DestinationFeeManager.abi ../../../contracts/solc/v0.8.19/DestinationFeeManager/DestinationFeeManager.bin a56ae53e35e6610269f086b1e915ca1e80f5d0bf5695d09156e82fccfc2d77b3 +destination_reward_manager: ../../../contracts/solc/v0.8.19/DestinationRewardManager/DestinationRewardManager.abi ../../../contracts/solc/v0.8.19/DestinationRewardManager/DestinationRewardManager.bin 77874e97a54ecbd9c61132964da5b053f0b584dc7b774d75dd51baedd2bc7c40 +destination_verifier: ../../../contracts/solc/v0.8.19/DestinationVerifier/DestinationVerifier.abi ../../../contracts/solc/v0.8.19/DestinationVerifier/DestinationVerifier.bin 369323ce520923b9eb31ed90885f5ebd0f46b6799288fbf4da5d6ede7d697aef +destination_verifier_proxy: ../../../contracts/solc/v0.8.19/DestinationVerifierProxy/DestinationVerifierProxy.abi ../../../contracts/solc/v0.8.19/DestinationVerifierProxy/DestinationVerifierProxy.bin 4e255301cf6657777e7292eccea3e4c0ce65281404341e9248e095703a9fe392 +errored_verifier: ../../../contracts/solc/v0.8.19/ErroredVerifier/ErroredVerifier.abi ../../../contracts/solc/v0.8.19/ErroredVerifier/ErroredVerifier.bin ad8ac8d6b99890081725e2304d79d1ba7dd5212b89d130aa9689f4269eed4691 exposed_channel_verifier: ../../../contracts/solc/v0.8.19/ExposedChannelVerifier/ExposedChannelVerifier.abi ../../../contracts/solc/v0.8.19/ExposedChannelVerifier/ExposedChannelVerifier.bin c21cde078900241c06de69e2bc5d906c5ef558b52db66caa68bed065940a2253 exposed_verifier: ../../../contracts/solc/v0.8.19/ExposedVerifier/ExposedVerifier.abi ../../../contracts/solc/v0.8.19/ExposedVerifier/ExposedVerifier.bin 00816ab345f768e522c79abadeadf9155c2c688067e18f8f73e5d6ab71037663 fee_manager: ../../../contracts/solc/v0.8.19/FeeManager/FeeManager.abi ../../../contracts/solc/v0.8.19/FeeManager/FeeManager.bin edc85f34294ae7c90d45c4c71eb5c105c60a4842dfbbf700c692870ffcc403a1 diff --git a/core/gethwrappers/llo-feeds/go_generate.go b/core/gethwrappers/llo-feeds/go_generate.go index 5e5b841b72d..ec950124e96 100644 --- a/core/gethwrappers/llo-feeds/go_generate.go +++ b/core/gethwrappers/llo-feeds/go_generate.go @@ -10,5 +10,9 @@ package gethwrappers //go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.19/RewardManager/RewardManager.abi ../../../contracts/solc/v0.8.19/RewardManager/RewardManager.bin RewardManager reward_manager //go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.19/FeeManager/FeeManager.abi ../../../contracts/solc/v0.8.19/FeeManager/FeeManager.bin FeeManager fee_manager //go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.19/ChannelConfigStore/ChannelConfigStore.abi ../../../contracts/solc/v0.8.19/ChannelConfigStore/ChannelConfigStore.bin ChannelConfigStore channel_config_store -//go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.19/ChannelVerifier/ChannelVerifier.abi ../../../contracts/solc/v0.8.19/ChannelVerifier/ChannelVerifier.bin ChannelVerifier channel_verifier -//go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.19/ExposedChannelVerifier/ExposedChannelVerifier.abi ../../../contracts/solc/v0.8.19/ExposedChannelVerifier/ExposedChannelVerifier.bin ExposedChannelVerifier exposed_channel_verifier + +//go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.19/DestinationVerifier/DestinationVerifier.abi ../../../contracts/solc/v0.8.19/DestinationVerifier/DestinationVerifier.bin DestinationVerifier destination_verifier +//go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.19/DestinationVerifierProxy/DestinationVerifierProxy.abi ../../../contracts/solc/v0.8.19/DestinationVerifierProxy/DestinationVerifierProxy.bin DestinationVerifierProxy destination_verifier_proxy +//go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.19/DestinationFeeManager/DestinationFeeManager.abi ../../../contracts/solc/v0.8.19/DestinationFeeManager/DestinationFeeManager.bin DestinationFeeManager destination_fee_manager +//go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.19/DestinationRewardManager/DestinationRewardManager.abi ../../../contracts/solc/v0.8.19/DestinationRewardManager/DestinationRewardManager.bin DestinationRewardManager destination_reward_manager +//go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.19/Configurator/Configurator.abi ../../../contracts/solc/v0.8.19/Configurator/Configurator.bin Configurator configurator diff --git a/core/internal/cltest/cltest.go b/core/internal/cltest/cltest.go index 508dde86a05..b60dd8d73ce 100644 --- a/core/internal/cltest/cltest.go +++ b/core/internal/cltest/cltest.go @@ -37,6 +37,10 @@ import ( ocrtypes "github.com/smartcontractkit/libocr/offchainreporting/types" + "github.com/smartcontractkit/chainlink/v2/core/capabilities" + remotetypes "github.com/smartcontractkit/chainlink/v2/core/capabilities/remote/types" + p2ptypes "github.com/smartcontractkit/chainlink/v2/core/services/p2p/types" + "github.com/smartcontractkit/chainlink-common/pkg/loop" "github.com/smartcontractkit/chainlink-common/pkg/sqlutil" "github.com/smartcontractkit/chainlink-common/pkg/utils/mailbox" @@ -208,7 +212,12 @@ type TestApplication struct { func NewApplicationEVMDisabled(t *testing.T) *TestApplication { t.Helper() - c := configtest.NewGeneralConfig(t, nil) + c := configtest.NewGeneralConfig(t, func(config *chainlink.Config, secrets *chainlink.Secrets) { + f := false + for _, c := range config.EVM { + c.Enabled = &f + } + }) return NewApplicationWithConfig(t, c) } @@ -316,6 +325,31 @@ func NewApplicationWithConfig(t testing.TB, cfg chainlink.GeneralConfig, flagsAn auditLogger = audit.NoopLogger } + var capabilitiesRegistry *capabilities.Registry + capabilitiesRegistry = capabilities.NewRegistry(lggr) + for _, dep := range flagsAndDeps { + registry, _ := dep.(*capabilities.Registry) + if registry != nil { + capabilitiesRegistry = registry + } + } + + var dispatcher remotetypes.Dispatcher + for _, dep := range flagsAndDeps { + dispatcher, _ = dep.(remotetypes.Dispatcher) + if dispatcher != nil { + break + } + } + + var peerWrapper p2ptypes.PeerWrapper + for _, dep := range flagsAndDeps { + peerWrapper, _ = dep.(p2ptypes.PeerWrapper) + if peerWrapper != nil { + break + } + } + url := cfg.Database().URL() db, err := pg.NewConnection(url.String(), cfg.Database().Dialect(), cfg.Database()) require.NoError(t, err) @@ -345,7 +379,7 @@ func NewApplicationWithConfig(t testing.TB, cfg chainlink.GeneralConfig, flagsAn keyStore := keystore.NewInMemory(ds, utils.FastScryptParams, lggr) mailMon := mailbox.NewMonitor(cfg.AppID().String(), lggr.Named("Mailbox")) - loopRegistry := plugins.NewLoopRegistry(lggr, nil) + loopRegistry := plugins.NewLoopRegistry(lggr, nil, nil) mercuryPool := wsrpc.NewPool(lggr, cache.Config{ LatestReportTTL: cfg.Mercury().Cache().LatestReportTTL(), @@ -353,11 +387,14 @@ func NewApplicationWithConfig(t testing.TB, cfg chainlink.GeneralConfig, flagsAn LatestReportDeadline: cfg.Mercury().Cache().LatestReportDeadline(), }) + c := clhttptest.NewTestLocalOnlyHTTPClient() relayerFactory := chainlink.RelayerFactory{ - Logger: lggr, - LoopRegistry: loopRegistry, - GRPCOpts: loop.GRPCOpts{}, - MercuryPool: mercuryPool, + Logger: lggr, + LoopRegistry: loopRegistry, + GRPCOpts: loop.GRPCOpts{}, + MercuryPool: mercuryPool, + CapabilitiesRegistry: capabilitiesRegistry, + HTTPClient: c, } evmOpts := chainlink.EVMFactoryConfig{ @@ -409,11 +446,18 @@ func NewApplicationWithConfig(t testing.TB, cfg chainlink.GeneralConfig, flagsAn } initOps = append(initOps, chainlink.InitStarknet(testCtx, relayerFactory, starkCfg)) } + if cfg.AptosEnabled() { + aptosCfg := chainlink.AptosFactoryConfig{ + Keystore: keyStore.Aptos(), + TOMLConfigs: cfg.AptosConfigs(), + } + initOps = append(initOps, chainlink.InitAptos(testCtx, relayerFactory, aptosCfg)) + } + relayChainInterops, err := chainlink.NewCoreRelayerChainInteroperators(initOps...) if err != nil { t.Fatal(err) } - c := clhttptest.NewTestLocalOnlyHTTPClient() appInstance, err := chainlink.NewApplication(chainlink.ApplicationOpts{ Config: cfg, MailMon: mailMon, @@ -427,9 +471,13 @@ func NewApplicationWithConfig(t testing.TB, cfg chainlink.GeneralConfig, flagsAn RestrictedHTTPClient: c, UnrestrictedHTTPClient: c, SecretGenerator: MockSecretGenerator{}, - LoopRegistry: plugins.NewLoopRegistry(lggr, nil), + LoopRegistry: plugins.NewLoopRegistry(lggr, nil, nil), MercuryPool: mercuryPool, + CapabilitiesRegistry: capabilitiesRegistry, + CapabilitiesDispatcher: dispatcher, + CapabilitiesPeerWrapper: peerWrapper, }) + require.NoError(t, err) app := appInstance.(*chainlink.ChainlinkApplication) ta := &TestApplication{ @@ -1341,7 +1389,7 @@ func (b *Blocks) ForkAt(t *testing.T, blockNum int64, numHashes int) *Blocks { } forked.Heads[blockNum].ParentHash = b.Heads[blockNum].ParentHash - forked.Heads[blockNum].Parent = b.Heads[blockNum].Parent + forked.Heads[blockNum].Parent.Store(b.Heads[blockNum].Parent.Load()) return forked } @@ -1355,10 +1403,10 @@ func (b *Blocks) NewHead(number uint64) *evmtypes.Head { Number: parent.Number + 1, Hash: evmutils.NewHash(), ParentHash: parent.Hash, - Parent: parent, Timestamp: time.Unix(parent.Number+1, 0), EVMChainID: ubig.New(&FixtureChainID), } + head.Parent.Store(parent) return head } @@ -1399,7 +1447,7 @@ func NewBlocks(t *testing.T, numHashes int) *Blocks { heads[i] = &evmtypes.Head{Hash: hash, Number: i, Timestamp: time.Unix(i, 0), EVMChainID: ubig.New(&FixtureChainID)} if i > 0 { parent := heads[i-1] - heads[i].Parent = parent + heads[i].Parent.Store(parent) heads[i].ParentHash = parent.Hash } } diff --git a/core/internal/cltest/factories.go b/core/internal/cltest/factories.go index c488dca94a9..8f4b2260a02 100644 --- a/core/internal/cltest/factories.go +++ b/core/internal/cltest/factories.go @@ -25,6 +25,7 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/sqlutil" "github.com/smartcontractkit/chainlink-common/pkg/utils/jsonserializable" + txmgrcommon "github.com/smartcontractkit/chainlink/v2/common/txmgr" txmgrtypes "github.com/smartcontractkit/chainlink/v2/common/txmgr/types" "github.com/smartcontractkit/chainlink/v2/core/auth" @@ -318,13 +319,13 @@ func MustGenerateRandomKeyState(_ testing.TB) ethkey.State { return ethkey.State{Address: NewEIP55Address()} } -func MustInsertHead(t *testing.T, ds sqlutil.DataSource, number int64) evmtypes.Head { +func MustInsertHead(t *testing.T, ds sqlutil.DataSource, number int64) *evmtypes.Head { h := evmtypes.NewHead(big.NewInt(number), evmutils.NewHash(), evmutils.NewHash(), 0, ubig.New(&FixtureChainID)) horm := headtracker.NewORM(FixtureChainID, ds) err := horm.IdempotentInsertHead(testutils.Context(t), &h) require.NoError(t, err) - return h + return &h } func MustInsertV2JobSpec(t *testing.T, db *sqlx.DB, transmitterAddress common.Address) job.Job { diff --git a/core/internal/cltest/heavyweight/orm.go b/core/internal/cltest/heavyweight/orm.go deleted file mode 100644 index f49a94be05b..00000000000 --- a/core/internal/cltest/heavyweight/orm.go +++ /dev/null @@ -1,96 +0,0 @@ -// Package heavyweight contains test helpers that are costly and you should -// think **real carefully** before using in your tests. -package heavyweight - -import ( - "os" - "path" - "runtime" - "strings" - "testing" - - "github.com/google/uuid" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - - "github.com/jmoiron/sqlx" - - "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" - "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/configtest" - "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" - "github.com/smartcontractkit/chainlink/v2/core/services/pg" - "github.com/smartcontractkit/chainlink/v2/core/store/dialects" - "github.com/smartcontractkit/chainlink/v2/core/store/models" - "github.com/smartcontractkit/chainlink/v2/internal/testdb" -) - -// FullTestDBV2 creates a pristine DB which runs in a separate database than the normal -// unit tests, so you can do things like use other Postgres connection types with it. -func FullTestDBV2(t testing.TB, overrideFn func(c *chainlink.Config, s *chainlink.Secrets)) (chainlink.GeneralConfig, *sqlx.DB) { - return KindFixtures.PrepareDB(t, overrideFn) -} - -// FullTestDBNoFixturesV2 is the same as FullTestDB, but it does not load fixtures. -func FullTestDBNoFixturesV2(t testing.TB, overrideFn func(c *chainlink.Config, s *chainlink.Secrets)) (chainlink.GeneralConfig, *sqlx.DB) { - return KindTemplate.PrepareDB(t, overrideFn) -} - -// FullTestDBEmptyV2 creates an empty DB (without migrations). -func FullTestDBEmptyV2(t testing.TB, overrideFn func(c *chainlink.Config, s *chainlink.Secrets)) (chainlink.GeneralConfig, *sqlx.DB) { - return KindEmpty.PrepareDB(t, overrideFn) -} - -func generateName() string { - return strings.ReplaceAll(uuid.New().String(), "-", "") -} - -type Kind int - -const ( - KindEmpty Kind = iota - KindTemplate - KindFixtures -) - -func (c Kind) PrepareDB(t testing.TB, overrideFn func(c *chainlink.Config, s *chainlink.Secrets)) (chainlink.GeneralConfig, *sqlx.DB) { - testutils.SkipShort(t, "FullTestDB") - - gcfg := configtest.NewGeneralConfigSimulated(t, func(c *chainlink.Config, s *chainlink.Secrets) { - c.Database.Dialect = dialects.Postgres - if overrideFn != nil { - overrideFn(c, s) - } - }) - - require.NoError(t, os.MkdirAll(gcfg.RootDir(), 0700)) - migrationTestDBURL, err := testdb.CreateOrReplace(gcfg.Database().URL(), generateName(), c != KindEmpty) - require.NoError(t, err) - db, err := pg.NewConnection(migrationTestDBURL, dialects.Postgres, gcfg.Database()) - require.NoError(t, err) - t.Cleanup(func() { - assert.NoError(t, db.Close()) - os.RemoveAll(gcfg.RootDir()) - }) - - gcfg = configtest.NewGeneralConfigSimulated(t, func(c *chainlink.Config, s *chainlink.Secrets) { - c.Database.Dialect = dialects.Postgres - s.Database.URL = models.MustSecretURL(migrationTestDBURL) - if overrideFn != nil { - overrideFn(c, s) - } - }) - - if c == KindFixtures { - _, filename, _, ok := runtime.Caller(1) - if !ok { - t.Fatal("could not get runtime.Caller(1)") - } - filepath := path.Join(path.Dir(filename), "../../../store/fixtures/fixtures.sql") - fixturesSQL, err := os.ReadFile(filepath) - require.NoError(t, err) - _, err = db.Exec(string(fixturesSQL)) - require.NoError(t, err) - } - - return gcfg, db -} diff --git a/core/internal/cltest/mocks.go b/core/internal/cltest/mocks.go index 9e0ee2f3f20..fd01f72c131 100644 --- a/core/internal/cltest/mocks.go +++ b/core/internal/cltest/mocks.go @@ -392,6 +392,7 @@ func NewLegacyChainsWithMockChain(t testing.TB, ethClient evmclient.Client, cfg scopedCfg := evmtest.NewChainScopedConfig(t, cfg) ch.On("ID").Return(scopedCfg.EVM().ChainID()) ch.On("Config").Return(scopedCfg) + ch.On("HeadTracker").Return(nil) return NewLegacyChainsWithChain(ch, cfg) } diff --git a/core/internal/features/features_test.go b/core/internal/features/features_test.go index 046f21b7f7d..159ea27e939 100644 --- a/core/internal/features/features_test.go +++ b/core/internal/features/features_test.go @@ -41,6 +41,7 @@ import ( commonconfig "github.com/smartcontractkit/chainlink-common/pkg/config" "github.com/smartcontractkit/chainlink-common/pkg/services/servicetest" + "github.com/smartcontractkit/chainlink/v2/core/auth" "github.com/smartcontractkit/chainlink/v2/core/bridges" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" @@ -57,7 +58,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/multiwordconsumer_wrapper" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/operator_wrapper" "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" - "github.com/smartcontractkit/chainlink/v2/core/internal/cltest/heavyweight" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/configtest" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/evmtest" @@ -74,6 +74,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/static" "github.com/smartcontractkit/chainlink/v2/core/store/models" "github.com/smartcontractkit/chainlink/v2/core/utils" + "github.com/smartcontractkit/chainlink/v2/core/utils/testutils/heavyweight" "github.com/smartcontractkit/chainlink/v2/core/web" webauth "github.com/smartcontractkit/chainlink/v2/core/web/auth" ) @@ -1339,7 +1340,7 @@ func TestIntegration_BlockHistoryEstimator(t *testing.T) { chain := evmtest.MustGetDefaultChain(t, legacyChains) estimator := chain.GasEstimator() - gasPrice, gasLimit, err := estimator.GetFee(testutils.Context(t), nil, 500_000, maxGasPrice) + gasPrice, gasLimit, err := estimator.GetFee(testutils.Context(t), nil, 500_000, maxGasPrice, nil, nil) require.NoError(t, err) assert.Equal(t, uint64(500000), gasLimit) assert.Equal(t, "41.5 gwei", gasPrice.Legacy.String()) @@ -1360,7 +1361,7 @@ func TestIntegration_BlockHistoryEstimator(t *testing.T) { newHeads.TrySend(h43) gomega.NewWithT(t).Eventually(func() string { - gasPrice, _, err := estimator.GetFee(testutils.Context(t), nil, 500000, maxGasPrice) + gasPrice, _, err := estimator.GetFee(testutils.Context(t), nil, 500000, maxGasPrice, nil, nil) require.NoError(t, err) return gasPrice.Legacy.String() }, testutils.WaitTimeout(t), cltest.DBPollingInterval).Should(gomega.Equal("45 gwei")) diff --git a/core/internal/features/ocr2/features_ocr2_test.go b/core/internal/features/ocr2/features_ocr2_test.go index d0f157d8bd4..9160310261f 100644 --- a/core/internal/features/ocr2/features_ocr2_test.go +++ b/core/internal/features/ocr2/features_ocr2_test.go @@ -43,7 +43,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/authorized_forwarder" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/link_token_interface" "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" - "github.com/smartcontractkit/chainlink/v2/core/internal/cltest/heavyweight" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" @@ -54,6 +53,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/ocrbootstrap" "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm" "github.com/smartcontractkit/chainlink/v2/core/store/models" + "github.com/smartcontractkit/chainlink/v2/core/utils/testutils/heavyweight" ) type ocr2Node struct { diff --git a/core/internal/mocks/application.go b/core/internal/mocks/application.go index cbb8ebaaa04..aaccbafc949 100644 --- a/core/internal/mocks/application.go +++ b/core/internal/mocks/application.go @@ -53,6 +53,14 @@ type Application struct { mock.Mock } +type Application_Expecter struct { + mock *mock.Mock +} + +func (_m *Application) EXPECT() *Application_Expecter { + return &Application_Expecter{mock: &_m.Mock} +} + // AddJobV2 provides a mock function with given fields: ctx, _a1 func (_m *Application) AddJobV2(ctx context.Context, _a1 *job.Job) error { ret := _m.Called(ctx, _a1) @@ -71,6 +79,35 @@ func (_m *Application) AddJobV2(ctx context.Context, _a1 *job.Job) error { return r0 } +// Application_AddJobV2_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddJobV2' +type Application_AddJobV2_Call struct { + *mock.Call +} + +// AddJobV2 is a helper method to define mock.On call +// - ctx context.Context +// - _a1 *job.Job +func (_e *Application_Expecter) AddJobV2(ctx interface{}, _a1 interface{}) *Application_AddJobV2_Call { + return &Application_AddJobV2_Call{Call: _e.mock.On("AddJobV2", ctx, _a1)} +} + +func (_c *Application_AddJobV2_Call) Run(run func(ctx context.Context, _a1 *job.Job)) *Application_AddJobV2_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*job.Job)) + }) + return _c +} + +func (_c *Application_AddJobV2_Call) Return(_a0 error) *Application_AddJobV2_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Application_AddJobV2_Call) RunAndReturn(run func(context.Context, *job.Job) error) *Application_AddJobV2_Call { + _c.Call.Return(run) + return _c +} + // AuthenticationProvider provides a mock function with given fields: func (_m *Application) AuthenticationProvider() sessions.AuthenticationProvider { ret := _m.Called() @@ -91,6 +128,33 @@ func (_m *Application) AuthenticationProvider() sessions.AuthenticationProvider return r0 } +// Application_AuthenticationProvider_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AuthenticationProvider' +type Application_AuthenticationProvider_Call struct { + *mock.Call +} + +// AuthenticationProvider is a helper method to define mock.On call +func (_e *Application_Expecter) AuthenticationProvider() *Application_AuthenticationProvider_Call { + return &Application_AuthenticationProvider_Call{Call: _e.mock.On("AuthenticationProvider")} +} + +func (_c *Application_AuthenticationProvider_Call) Run(run func()) *Application_AuthenticationProvider_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Application_AuthenticationProvider_Call) Return(_a0 sessions.AuthenticationProvider) *Application_AuthenticationProvider_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Application_AuthenticationProvider_Call) RunAndReturn(run func() sessions.AuthenticationProvider) *Application_AuthenticationProvider_Call { + _c.Call.Return(run) + return _c +} + // BasicAdminUsersORM provides a mock function with given fields: func (_m *Application) BasicAdminUsersORM() sessions.BasicAdminUsersORM { ret := _m.Called() @@ -111,6 +175,33 @@ func (_m *Application) BasicAdminUsersORM() sessions.BasicAdminUsersORM { return r0 } +// Application_BasicAdminUsersORM_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BasicAdminUsersORM' +type Application_BasicAdminUsersORM_Call struct { + *mock.Call +} + +// BasicAdminUsersORM is a helper method to define mock.On call +func (_e *Application_Expecter) BasicAdminUsersORM() *Application_BasicAdminUsersORM_Call { + return &Application_BasicAdminUsersORM_Call{Call: _e.mock.On("BasicAdminUsersORM")} +} + +func (_c *Application_BasicAdminUsersORM_Call) Run(run func()) *Application_BasicAdminUsersORM_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Application_BasicAdminUsersORM_Call) Return(_a0 sessions.BasicAdminUsersORM) *Application_BasicAdminUsersORM_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Application_BasicAdminUsersORM_Call) RunAndReturn(run func() sessions.BasicAdminUsersORM) *Application_BasicAdminUsersORM_Call { + _c.Call.Return(run) + return _c +} + // BridgeORM provides a mock function with given fields: func (_m *Application) BridgeORM() bridges.ORM { ret := _m.Called() @@ -131,6 +222,33 @@ func (_m *Application) BridgeORM() bridges.ORM { return r0 } +// Application_BridgeORM_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BridgeORM' +type Application_BridgeORM_Call struct { + *mock.Call +} + +// BridgeORM is a helper method to define mock.On call +func (_e *Application_Expecter) BridgeORM() *Application_BridgeORM_Call { + return &Application_BridgeORM_Call{Call: _e.mock.On("BridgeORM")} +} + +func (_c *Application_BridgeORM_Call) Run(run func()) *Application_BridgeORM_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Application_BridgeORM_Call) Return(_a0 bridges.ORM) *Application_BridgeORM_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Application_BridgeORM_Call) RunAndReturn(run func() bridges.ORM) *Application_BridgeORM_Call { + _c.Call.Return(run) + return _c +} + // DeleteJob provides a mock function with given fields: ctx, jobID func (_m *Application) DeleteJob(ctx context.Context, jobID int32) error { ret := _m.Called(ctx, jobID) @@ -149,6 +267,35 @@ func (_m *Application) DeleteJob(ctx context.Context, jobID int32) error { return r0 } +// Application_DeleteJob_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteJob' +type Application_DeleteJob_Call struct { + *mock.Call +} + +// DeleteJob is a helper method to define mock.On call +// - ctx context.Context +// - jobID int32 +func (_e *Application_Expecter) DeleteJob(ctx interface{}, jobID interface{}) *Application_DeleteJob_Call { + return &Application_DeleteJob_Call{Call: _e.mock.On("DeleteJob", ctx, jobID)} +} + +func (_c *Application_DeleteJob_Call) Run(run func(ctx context.Context, jobID int32)) *Application_DeleteJob_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(int32)) + }) + return _c +} + +func (_c *Application_DeleteJob_Call) Return(_a0 error) *Application_DeleteJob_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Application_DeleteJob_Call) RunAndReturn(run func(context.Context, int32) error) *Application_DeleteJob_Call { + _c.Call.Return(run) + return _c +} + // DeleteLogPollerDataAfter provides a mock function with given fields: ctx, chainID, start func (_m *Application) DeleteLogPollerDataAfter(ctx context.Context, chainID *big.Int, start int64) error { ret := _m.Called(ctx, chainID, start) @@ -167,6 +314,36 @@ func (_m *Application) DeleteLogPollerDataAfter(ctx context.Context, chainID *bi return r0 } +// Application_DeleteLogPollerDataAfter_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteLogPollerDataAfter' +type Application_DeleteLogPollerDataAfter_Call struct { + *mock.Call +} + +// DeleteLogPollerDataAfter is a helper method to define mock.On call +// - ctx context.Context +// - chainID *big.Int +// - start int64 +func (_e *Application_Expecter) DeleteLogPollerDataAfter(ctx interface{}, chainID interface{}, start interface{}) *Application_DeleteLogPollerDataAfter_Call { + return &Application_DeleteLogPollerDataAfter_Call{Call: _e.mock.On("DeleteLogPollerDataAfter", ctx, chainID, start)} +} + +func (_c *Application_DeleteLogPollerDataAfter_Call) Run(run func(ctx context.Context, chainID *big.Int, start int64)) *Application_DeleteLogPollerDataAfter_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*big.Int), args[2].(int64)) + }) + return _c +} + +func (_c *Application_DeleteLogPollerDataAfter_Call) Return(_a0 error) *Application_DeleteLogPollerDataAfter_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Application_DeleteLogPollerDataAfter_Call) RunAndReturn(run func(context.Context, *big.Int, int64) error) *Application_DeleteLogPollerDataAfter_Call { + _c.Call.Return(run) + return _c +} + // EVMORM provides a mock function with given fields: func (_m *Application) EVMORM() types.Configs { ret := _m.Called() @@ -187,6 +364,33 @@ func (_m *Application) EVMORM() types.Configs { return r0 } +// Application_EVMORM_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EVMORM' +type Application_EVMORM_Call struct { + *mock.Call +} + +// EVMORM is a helper method to define mock.On call +func (_e *Application_Expecter) EVMORM() *Application_EVMORM_Call { + return &Application_EVMORM_Call{Call: _e.mock.On("EVMORM")} +} + +func (_c *Application_EVMORM_Call) Run(run func()) *Application_EVMORM_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Application_EVMORM_Call) Return(_a0 types.Configs) *Application_EVMORM_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Application_EVMORM_Call) RunAndReturn(run func() types.Configs) *Application_EVMORM_Call { + _c.Call.Return(run) + return _c +} + // FindLCA provides a mock function with given fields: ctx, chainID func (_m *Application) FindLCA(ctx context.Context, chainID *big.Int) (*logpoller.LogPollerBlock, error) { ret := _m.Called(ctx, chainID) @@ -217,6 +421,35 @@ func (_m *Application) FindLCA(ctx context.Context, chainID *big.Int) (*logpolle return r0, r1 } +// Application_FindLCA_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindLCA' +type Application_FindLCA_Call struct { + *mock.Call +} + +// FindLCA is a helper method to define mock.On call +// - ctx context.Context +// - chainID *big.Int +func (_e *Application_Expecter) FindLCA(ctx interface{}, chainID interface{}) *Application_FindLCA_Call { + return &Application_FindLCA_Call{Call: _e.mock.On("FindLCA", ctx, chainID)} +} + +func (_c *Application_FindLCA_Call) Run(run func(ctx context.Context, chainID *big.Int)) *Application_FindLCA_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*big.Int)) + }) + return _c +} + +func (_c *Application_FindLCA_Call) Return(_a0 *logpoller.LogPollerBlock, _a1 error) *Application_FindLCA_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Application_FindLCA_Call) RunAndReturn(run func(context.Context, *big.Int) (*logpoller.LogPollerBlock, error)) *Application_FindLCA_Call { + _c.Call.Return(run) + return _c +} + // GetAuditLogger provides a mock function with given fields: func (_m *Application) GetAuditLogger() audit.AuditLogger { ret := _m.Called() @@ -237,6 +470,33 @@ func (_m *Application) GetAuditLogger() audit.AuditLogger { return r0 } +// Application_GetAuditLogger_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAuditLogger' +type Application_GetAuditLogger_Call struct { + *mock.Call +} + +// GetAuditLogger is a helper method to define mock.On call +func (_e *Application_Expecter) GetAuditLogger() *Application_GetAuditLogger_Call { + return &Application_GetAuditLogger_Call{Call: _e.mock.On("GetAuditLogger")} +} + +func (_c *Application_GetAuditLogger_Call) Run(run func()) *Application_GetAuditLogger_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Application_GetAuditLogger_Call) Return(_a0 audit.AuditLogger) *Application_GetAuditLogger_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Application_GetAuditLogger_Call) RunAndReturn(run func() audit.AuditLogger) *Application_GetAuditLogger_Call { + _c.Call.Return(run) + return _c +} + // GetConfig provides a mock function with given fields: func (_m *Application) GetConfig() chainlink.GeneralConfig { ret := _m.Called() @@ -257,6 +517,33 @@ func (_m *Application) GetConfig() chainlink.GeneralConfig { return r0 } +// Application_GetConfig_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetConfig' +type Application_GetConfig_Call struct { + *mock.Call +} + +// GetConfig is a helper method to define mock.On call +func (_e *Application_Expecter) GetConfig() *Application_GetConfig_Call { + return &Application_GetConfig_Call{Call: _e.mock.On("GetConfig")} +} + +func (_c *Application_GetConfig_Call) Run(run func()) *Application_GetConfig_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Application_GetConfig_Call) Return(_a0 chainlink.GeneralConfig) *Application_GetConfig_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Application_GetConfig_Call) RunAndReturn(run func() chainlink.GeneralConfig) *Application_GetConfig_Call { + _c.Call.Return(run) + return _c +} + // GetDB provides a mock function with given fields: func (_m *Application) GetDB() sqlutil.DataSource { ret := _m.Called() @@ -277,6 +564,33 @@ func (_m *Application) GetDB() sqlutil.DataSource { return r0 } +// Application_GetDB_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetDB' +type Application_GetDB_Call struct { + *mock.Call +} + +// GetDB is a helper method to define mock.On call +func (_e *Application_Expecter) GetDB() *Application_GetDB_Call { + return &Application_GetDB_Call{Call: _e.mock.On("GetDB")} +} + +func (_c *Application_GetDB_Call) Run(run func()) *Application_GetDB_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Application_GetDB_Call) Return(_a0 sqlutil.DataSource) *Application_GetDB_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Application_GetDB_Call) RunAndReturn(run func() sqlutil.DataSource) *Application_GetDB_Call { + _c.Call.Return(run) + return _c +} + // GetExternalInitiatorManager provides a mock function with given fields: func (_m *Application) GetExternalInitiatorManager() webhook.ExternalInitiatorManager { ret := _m.Called() @@ -297,6 +611,33 @@ func (_m *Application) GetExternalInitiatorManager() webhook.ExternalInitiatorMa return r0 } +// Application_GetExternalInitiatorManager_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetExternalInitiatorManager' +type Application_GetExternalInitiatorManager_Call struct { + *mock.Call +} + +// GetExternalInitiatorManager is a helper method to define mock.On call +func (_e *Application_Expecter) GetExternalInitiatorManager() *Application_GetExternalInitiatorManager_Call { + return &Application_GetExternalInitiatorManager_Call{Call: _e.mock.On("GetExternalInitiatorManager")} +} + +func (_c *Application_GetExternalInitiatorManager_Call) Run(run func()) *Application_GetExternalInitiatorManager_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Application_GetExternalInitiatorManager_Call) Return(_a0 webhook.ExternalInitiatorManager) *Application_GetExternalInitiatorManager_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Application_GetExternalInitiatorManager_Call) RunAndReturn(run func() webhook.ExternalInitiatorManager) *Application_GetExternalInitiatorManager_Call { + _c.Call.Return(run) + return _c +} + // GetFeedsService provides a mock function with given fields: func (_m *Application) GetFeedsService() feeds.Service { ret := _m.Called() @@ -317,6 +658,33 @@ func (_m *Application) GetFeedsService() feeds.Service { return r0 } +// Application_GetFeedsService_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetFeedsService' +type Application_GetFeedsService_Call struct { + *mock.Call +} + +// GetFeedsService is a helper method to define mock.On call +func (_e *Application_Expecter) GetFeedsService() *Application_GetFeedsService_Call { + return &Application_GetFeedsService_Call{Call: _e.mock.On("GetFeedsService")} +} + +func (_c *Application_GetFeedsService_Call) Run(run func()) *Application_GetFeedsService_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Application_GetFeedsService_Call) Return(_a0 feeds.Service) *Application_GetFeedsService_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Application_GetFeedsService_Call) RunAndReturn(run func() feeds.Service) *Application_GetFeedsService_Call { + _c.Call.Return(run) + return _c +} + // GetHealthChecker provides a mock function with given fields: func (_m *Application) GetHealthChecker() services.Checker { ret := _m.Called() @@ -337,6 +705,33 @@ func (_m *Application) GetHealthChecker() services.Checker { return r0 } +// Application_GetHealthChecker_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetHealthChecker' +type Application_GetHealthChecker_Call struct { + *mock.Call +} + +// GetHealthChecker is a helper method to define mock.On call +func (_e *Application_Expecter) GetHealthChecker() *Application_GetHealthChecker_Call { + return &Application_GetHealthChecker_Call{Call: _e.mock.On("GetHealthChecker")} +} + +func (_c *Application_GetHealthChecker_Call) Run(run func()) *Application_GetHealthChecker_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Application_GetHealthChecker_Call) Return(_a0 services.Checker) *Application_GetHealthChecker_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Application_GetHealthChecker_Call) RunAndReturn(run func() services.Checker) *Application_GetHealthChecker_Call { + _c.Call.Return(run) + return _c +} + // GetKeyStore provides a mock function with given fields: func (_m *Application) GetKeyStore() keystore.Master { ret := _m.Called() @@ -357,6 +752,33 @@ func (_m *Application) GetKeyStore() keystore.Master { return r0 } +// Application_GetKeyStore_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetKeyStore' +type Application_GetKeyStore_Call struct { + *mock.Call +} + +// GetKeyStore is a helper method to define mock.On call +func (_e *Application_Expecter) GetKeyStore() *Application_GetKeyStore_Call { + return &Application_GetKeyStore_Call{Call: _e.mock.On("GetKeyStore")} +} + +func (_c *Application_GetKeyStore_Call) Run(run func()) *Application_GetKeyStore_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Application_GetKeyStore_Call) Return(_a0 keystore.Master) *Application_GetKeyStore_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Application_GetKeyStore_Call) RunAndReturn(run func() keystore.Master) *Application_GetKeyStore_Call { + _c.Call.Return(run) + return _c +} + // GetLogger provides a mock function with given fields: func (_m *Application) GetLogger() logger.SugaredLogger { ret := _m.Called() @@ -377,6 +799,33 @@ func (_m *Application) GetLogger() logger.SugaredLogger { return r0 } +// Application_GetLogger_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetLogger' +type Application_GetLogger_Call struct { + *mock.Call +} + +// GetLogger is a helper method to define mock.On call +func (_e *Application_Expecter) GetLogger() *Application_GetLogger_Call { + return &Application_GetLogger_Call{Call: _e.mock.On("GetLogger")} +} + +func (_c *Application_GetLogger_Call) Run(run func()) *Application_GetLogger_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Application_GetLogger_Call) Return(_a0 logger.SugaredLogger) *Application_GetLogger_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Application_GetLogger_Call) RunAndReturn(run func() logger.SugaredLogger) *Application_GetLogger_Call { + _c.Call.Return(run) + return _c +} + // GetLoopRegistrarConfig provides a mock function with given fields: func (_m *Application) GetLoopRegistrarConfig() plugins.RegistrarConfig { ret := _m.Called() @@ -397,6 +846,33 @@ func (_m *Application) GetLoopRegistrarConfig() plugins.RegistrarConfig { return r0 } +// Application_GetLoopRegistrarConfig_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetLoopRegistrarConfig' +type Application_GetLoopRegistrarConfig_Call struct { + *mock.Call +} + +// GetLoopRegistrarConfig is a helper method to define mock.On call +func (_e *Application_Expecter) GetLoopRegistrarConfig() *Application_GetLoopRegistrarConfig_Call { + return &Application_GetLoopRegistrarConfig_Call{Call: _e.mock.On("GetLoopRegistrarConfig")} +} + +func (_c *Application_GetLoopRegistrarConfig_Call) Run(run func()) *Application_GetLoopRegistrarConfig_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Application_GetLoopRegistrarConfig_Call) Return(_a0 plugins.RegistrarConfig) *Application_GetLoopRegistrarConfig_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Application_GetLoopRegistrarConfig_Call) RunAndReturn(run func() plugins.RegistrarConfig) *Application_GetLoopRegistrarConfig_Call { + _c.Call.Return(run) + return _c +} + // GetLoopRegistry provides a mock function with given fields: func (_m *Application) GetLoopRegistry() *plugins.LoopRegistry { ret := _m.Called() @@ -417,6 +893,33 @@ func (_m *Application) GetLoopRegistry() *plugins.LoopRegistry { return r0 } +// Application_GetLoopRegistry_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetLoopRegistry' +type Application_GetLoopRegistry_Call struct { + *mock.Call +} + +// GetLoopRegistry is a helper method to define mock.On call +func (_e *Application_Expecter) GetLoopRegistry() *Application_GetLoopRegistry_Call { + return &Application_GetLoopRegistry_Call{Call: _e.mock.On("GetLoopRegistry")} +} + +func (_c *Application_GetLoopRegistry_Call) Run(run func()) *Application_GetLoopRegistry_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Application_GetLoopRegistry_Call) Return(_a0 *plugins.LoopRegistry) *Application_GetLoopRegistry_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Application_GetLoopRegistry_Call) RunAndReturn(run func() *plugins.LoopRegistry) *Application_GetLoopRegistry_Call { + _c.Call.Return(run) + return _c +} + // GetRelayers provides a mock function with given fields: func (_m *Application) GetRelayers() chainlink.RelayerChainInteroperators { ret := _m.Called() @@ -437,6 +940,33 @@ func (_m *Application) GetRelayers() chainlink.RelayerChainInteroperators { return r0 } +// Application_GetRelayers_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetRelayers' +type Application_GetRelayers_Call struct { + *mock.Call +} + +// GetRelayers is a helper method to define mock.On call +func (_e *Application_Expecter) GetRelayers() *Application_GetRelayers_Call { + return &Application_GetRelayers_Call{Call: _e.mock.On("GetRelayers")} +} + +func (_c *Application_GetRelayers_Call) Run(run func()) *Application_GetRelayers_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Application_GetRelayers_Call) Return(_a0 chainlink.RelayerChainInteroperators) *Application_GetRelayers_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Application_GetRelayers_Call) RunAndReturn(run func() chainlink.RelayerChainInteroperators) *Application_GetRelayers_Call { + _c.Call.Return(run) + return _c +} + // GetWebAuthnConfiguration provides a mock function with given fields: func (_m *Application) GetWebAuthnConfiguration() sessions.WebAuthnConfiguration { ret := _m.Called() @@ -455,6 +985,33 @@ func (_m *Application) GetWebAuthnConfiguration() sessions.WebAuthnConfiguration return r0 } +// Application_GetWebAuthnConfiguration_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetWebAuthnConfiguration' +type Application_GetWebAuthnConfiguration_Call struct { + *mock.Call +} + +// GetWebAuthnConfiguration is a helper method to define mock.On call +func (_e *Application_Expecter) GetWebAuthnConfiguration() *Application_GetWebAuthnConfiguration_Call { + return &Application_GetWebAuthnConfiguration_Call{Call: _e.mock.On("GetWebAuthnConfiguration")} +} + +func (_c *Application_GetWebAuthnConfiguration_Call) Run(run func()) *Application_GetWebAuthnConfiguration_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Application_GetWebAuthnConfiguration_Call) Return(_a0 sessions.WebAuthnConfiguration) *Application_GetWebAuthnConfiguration_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Application_GetWebAuthnConfiguration_Call) RunAndReturn(run func() sessions.WebAuthnConfiguration) *Application_GetWebAuthnConfiguration_Call { + _c.Call.Return(run) + return _c +} + // ID provides a mock function with given fields: func (_m *Application) ID() uuid.UUID { ret := _m.Called() @@ -475,6 +1032,33 @@ func (_m *Application) ID() uuid.UUID { return r0 } +// Application_ID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ID' +type Application_ID_Call struct { + *mock.Call +} + +// ID is a helper method to define mock.On call +func (_e *Application_Expecter) ID() *Application_ID_Call { + return &Application_ID_Call{Call: _e.mock.On("ID")} +} + +func (_c *Application_ID_Call) Run(run func()) *Application_ID_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Application_ID_Call) Return(_a0 uuid.UUID) *Application_ID_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Application_ID_Call) RunAndReturn(run func() uuid.UUID) *Application_ID_Call { + _c.Call.Return(run) + return _c +} + // JobORM provides a mock function with given fields: func (_m *Application) JobORM() job.ORM { ret := _m.Called() @@ -495,6 +1079,33 @@ func (_m *Application) JobORM() job.ORM { return r0 } +// Application_JobORM_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'JobORM' +type Application_JobORM_Call struct { + *mock.Call +} + +// JobORM is a helper method to define mock.On call +func (_e *Application_Expecter) JobORM() *Application_JobORM_Call { + return &Application_JobORM_Call{Call: _e.mock.On("JobORM")} +} + +func (_c *Application_JobORM_Call) Run(run func()) *Application_JobORM_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Application_JobORM_Call) Return(_a0 job.ORM) *Application_JobORM_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Application_JobORM_Call) RunAndReturn(run func() job.ORM) *Application_JobORM_Call { + _c.Call.Return(run) + return _c +} + // JobSpawner provides a mock function with given fields: func (_m *Application) JobSpawner() job.Spawner { ret := _m.Called() @@ -515,6 +1126,33 @@ func (_m *Application) JobSpawner() job.Spawner { return r0 } +// Application_JobSpawner_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'JobSpawner' +type Application_JobSpawner_Call struct { + *mock.Call +} + +// JobSpawner is a helper method to define mock.On call +func (_e *Application_Expecter) JobSpawner() *Application_JobSpawner_Call { + return &Application_JobSpawner_Call{Call: _e.mock.On("JobSpawner")} +} + +func (_c *Application_JobSpawner_Call) Run(run func()) *Application_JobSpawner_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Application_JobSpawner_Call) Return(_a0 job.Spawner) *Application_JobSpawner_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Application_JobSpawner_Call) RunAndReturn(run func() job.Spawner) *Application_JobSpawner_Call { + _c.Call.Return(run) + return _c +} + // PipelineORM provides a mock function with given fields: func (_m *Application) PipelineORM() pipeline.ORM { ret := _m.Called() @@ -535,6 +1173,33 @@ func (_m *Application) PipelineORM() pipeline.ORM { return r0 } +// Application_PipelineORM_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PipelineORM' +type Application_PipelineORM_Call struct { + *mock.Call +} + +// PipelineORM is a helper method to define mock.On call +func (_e *Application_Expecter) PipelineORM() *Application_PipelineORM_Call { + return &Application_PipelineORM_Call{Call: _e.mock.On("PipelineORM")} +} + +func (_c *Application_PipelineORM_Call) Run(run func()) *Application_PipelineORM_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Application_PipelineORM_Call) Return(_a0 pipeline.ORM) *Application_PipelineORM_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Application_PipelineORM_Call) RunAndReturn(run func() pipeline.ORM) *Application_PipelineORM_Call { + _c.Call.Return(run) + return _c +} + // ReplayFromBlock provides a mock function with given fields: chainID, number, forceBroadcast func (_m *Application) ReplayFromBlock(chainID *big.Int, number uint64, forceBroadcast bool) error { ret := _m.Called(chainID, number, forceBroadcast) @@ -553,6 +1218,36 @@ func (_m *Application) ReplayFromBlock(chainID *big.Int, number uint64, forceBro return r0 } +// Application_ReplayFromBlock_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ReplayFromBlock' +type Application_ReplayFromBlock_Call struct { + *mock.Call +} + +// ReplayFromBlock is a helper method to define mock.On call +// - chainID *big.Int +// - number uint64 +// - forceBroadcast bool +func (_e *Application_Expecter) ReplayFromBlock(chainID interface{}, number interface{}, forceBroadcast interface{}) *Application_ReplayFromBlock_Call { + return &Application_ReplayFromBlock_Call{Call: _e.mock.On("ReplayFromBlock", chainID, number, forceBroadcast)} +} + +func (_c *Application_ReplayFromBlock_Call) Run(run func(chainID *big.Int, number uint64, forceBroadcast bool)) *Application_ReplayFromBlock_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*big.Int), args[1].(uint64), args[2].(bool)) + }) + return _c +} + +func (_c *Application_ReplayFromBlock_Call) Return(_a0 error) *Application_ReplayFromBlock_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Application_ReplayFromBlock_Call) RunAndReturn(run func(*big.Int, uint64, bool) error) *Application_ReplayFromBlock_Call { + _c.Call.Return(run) + return _c +} + // ResumeJobV2 provides a mock function with given fields: ctx, taskID, result func (_m *Application) ResumeJobV2(ctx context.Context, taskID uuid.UUID, result pipeline.Result) error { ret := _m.Called(ctx, taskID, result) @@ -571,6 +1266,36 @@ func (_m *Application) ResumeJobV2(ctx context.Context, taskID uuid.UUID, result return r0 } +// Application_ResumeJobV2_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ResumeJobV2' +type Application_ResumeJobV2_Call struct { + *mock.Call +} + +// ResumeJobV2 is a helper method to define mock.On call +// - ctx context.Context +// - taskID uuid.UUID +// - result pipeline.Result +func (_e *Application_Expecter) ResumeJobV2(ctx interface{}, taskID interface{}, result interface{}) *Application_ResumeJobV2_Call { + return &Application_ResumeJobV2_Call{Call: _e.mock.On("ResumeJobV2", ctx, taskID, result)} +} + +func (_c *Application_ResumeJobV2_Call) Run(run func(ctx context.Context, taskID uuid.UUID, result pipeline.Result)) *Application_ResumeJobV2_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(uuid.UUID), args[2].(pipeline.Result)) + }) + return _c +} + +func (_c *Application_ResumeJobV2_Call) Return(_a0 error) *Application_ResumeJobV2_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Application_ResumeJobV2_Call) RunAndReturn(run func(context.Context, uuid.UUID, pipeline.Result) error) *Application_ResumeJobV2_Call { + _c.Call.Return(run) + return _c +} + // RunJobV2 provides a mock function with given fields: ctx, jobID, meta func (_m *Application) RunJobV2(ctx context.Context, jobID int32, meta map[string]interface{}) (int64, error) { ret := _m.Called(ctx, jobID, meta) @@ -599,6 +1324,36 @@ func (_m *Application) RunJobV2(ctx context.Context, jobID int32, meta map[strin return r0, r1 } +// Application_RunJobV2_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RunJobV2' +type Application_RunJobV2_Call struct { + *mock.Call +} + +// RunJobV2 is a helper method to define mock.On call +// - ctx context.Context +// - jobID int32 +// - meta map[string]interface{} +func (_e *Application_Expecter) RunJobV2(ctx interface{}, jobID interface{}, meta interface{}) *Application_RunJobV2_Call { + return &Application_RunJobV2_Call{Call: _e.mock.On("RunJobV2", ctx, jobID, meta)} +} + +func (_c *Application_RunJobV2_Call) Run(run func(ctx context.Context, jobID int32, meta map[string]interface{})) *Application_RunJobV2_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(int32), args[2].(map[string]interface{})) + }) + return _c +} + +func (_c *Application_RunJobV2_Call) Return(_a0 int64, _a1 error) *Application_RunJobV2_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Application_RunJobV2_Call) RunAndReturn(run func(context.Context, int32, map[string]interface{}) (int64, error)) *Application_RunJobV2_Call { + _c.Call.Return(run) + return _c +} + // RunWebhookJobV2 provides a mock function with given fields: ctx, jobUUID, requestBody, meta func (_m *Application) RunWebhookJobV2(ctx context.Context, jobUUID uuid.UUID, requestBody string, meta jsonserializable.JSONSerializable) (int64, error) { ret := _m.Called(ctx, jobUUID, requestBody, meta) @@ -627,6 +1382,37 @@ func (_m *Application) RunWebhookJobV2(ctx context.Context, jobUUID uuid.UUID, r return r0, r1 } +// Application_RunWebhookJobV2_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RunWebhookJobV2' +type Application_RunWebhookJobV2_Call struct { + *mock.Call +} + +// RunWebhookJobV2 is a helper method to define mock.On call +// - ctx context.Context +// - jobUUID uuid.UUID +// - requestBody string +// - meta jsonserializable.JSONSerializable +func (_e *Application_Expecter) RunWebhookJobV2(ctx interface{}, jobUUID interface{}, requestBody interface{}, meta interface{}) *Application_RunWebhookJobV2_Call { + return &Application_RunWebhookJobV2_Call{Call: _e.mock.On("RunWebhookJobV2", ctx, jobUUID, requestBody, meta)} +} + +func (_c *Application_RunWebhookJobV2_Call) Run(run func(ctx context.Context, jobUUID uuid.UUID, requestBody string, meta jsonserializable.JSONSerializable)) *Application_RunWebhookJobV2_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(uuid.UUID), args[2].(string), args[3].(jsonserializable.JSONSerializable)) + }) + return _c +} + +func (_c *Application_RunWebhookJobV2_Call) Return(_a0 int64, _a1 error) *Application_RunWebhookJobV2_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Application_RunWebhookJobV2_Call) RunAndReturn(run func(context.Context, uuid.UUID, string, jsonserializable.JSONSerializable) (int64, error)) *Application_RunWebhookJobV2_Call { + _c.Call.Return(run) + return _c +} + // SecretGenerator provides a mock function with given fields: func (_m *Application) SecretGenerator() chainlink.SecretGenerator { ret := _m.Called() @@ -647,6 +1433,33 @@ func (_m *Application) SecretGenerator() chainlink.SecretGenerator { return r0 } +// Application_SecretGenerator_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SecretGenerator' +type Application_SecretGenerator_Call struct { + *mock.Call +} + +// SecretGenerator is a helper method to define mock.On call +func (_e *Application_Expecter) SecretGenerator() *Application_SecretGenerator_Call { + return &Application_SecretGenerator_Call{Call: _e.mock.On("SecretGenerator")} +} + +func (_c *Application_SecretGenerator_Call) Run(run func()) *Application_SecretGenerator_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Application_SecretGenerator_Call) Return(_a0 chainlink.SecretGenerator) *Application_SecretGenerator_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Application_SecretGenerator_Call) RunAndReturn(run func() chainlink.SecretGenerator) *Application_SecretGenerator_Call { + _c.Call.Return(run) + return _c +} + // SetLogLevel provides a mock function with given fields: lvl func (_m *Application) SetLogLevel(lvl zapcore.Level) error { ret := _m.Called(lvl) @@ -665,6 +1478,34 @@ func (_m *Application) SetLogLevel(lvl zapcore.Level) error { return r0 } +// Application_SetLogLevel_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetLogLevel' +type Application_SetLogLevel_Call struct { + *mock.Call +} + +// SetLogLevel is a helper method to define mock.On call +// - lvl zapcore.Level +func (_e *Application_Expecter) SetLogLevel(lvl interface{}) *Application_SetLogLevel_Call { + return &Application_SetLogLevel_Call{Call: _e.mock.On("SetLogLevel", lvl)} +} + +func (_c *Application_SetLogLevel_Call) Run(run func(lvl zapcore.Level)) *Application_SetLogLevel_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(zapcore.Level)) + }) + return _c +} + +func (_c *Application_SetLogLevel_Call) Return(_a0 error) *Application_SetLogLevel_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Application_SetLogLevel_Call) RunAndReturn(run func(zapcore.Level) error) *Application_SetLogLevel_Call { + _c.Call.Return(run) + return _c +} + // Start provides a mock function with given fields: ctx func (_m *Application) Start(ctx context.Context) error { ret := _m.Called(ctx) @@ -683,6 +1524,34 @@ func (_m *Application) Start(ctx context.Context) error { return r0 } +// Application_Start_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Start' +type Application_Start_Call struct { + *mock.Call +} + +// Start is a helper method to define mock.On call +// - ctx context.Context +func (_e *Application_Expecter) Start(ctx interface{}) *Application_Start_Call { + return &Application_Start_Call{Call: _e.mock.On("Start", ctx)} +} + +func (_c *Application_Start_Call) Run(run func(ctx context.Context)) *Application_Start_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *Application_Start_Call) Return(_a0 error) *Application_Start_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Application_Start_Call) RunAndReturn(run func(context.Context) error) *Application_Start_Call { + _c.Call.Return(run) + return _c +} + // Stop provides a mock function with given fields: func (_m *Application) Stop() error { ret := _m.Called() @@ -701,6 +1570,33 @@ func (_m *Application) Stop() error { return r0 } +// Application_Stop_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Stop' +type Application_Stop_Call struct { + *mock.Call +} + +// Stop is a helper method to define mock.On call +func (_e *Application_Expecter) Stop() *Application_Stop_Call { + return &Application_Stop_Call{Call: _e.mock.On("Stop")} +} + +func (_c *Application_Stop_Call) Run(run func()) *Application_Stop_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Application_Stop_Call) Return(_a0 error) *Application_Stop_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Application_Stop_Call) RunAndReturn(run func() error) *Application_Stop_Call { + _c.Call.Return(run) + return _c +} + // TxmStorageService provides a mock function with given fields: func (_m *Application) TxmStorageService() txmgr.EvmTxStore { ret := _m.Called() @@ -721,11 +1617,65 @@ func (_m *Application) TxmStorageService() txmgr.EvmTxStore { return r0 } +// Application_TxmStorageService_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TxmStorageService' +type Application_TxmStorageService_Call struct { + *mock.Call +} + +// TxmStorageService is a helper method to define mock.On call +func (_e *Application_Expecter) TxmStorageService() *Application_TxmStorageService_Call { + return &Application_TxmStorageService_Call{Call: _e.mock.On("TxmStorageService")} +} + +func (_c *Application_TxmStorageService_Call) Run(run func()) *Application_TxmStorageService_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Application_TxmStorageService_Call) Return(_a0 txmgr.EvmTxStore) *Application_TxmStorageService_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Application_TxmStorageService_Call) RunAndReturn(run func() txmgr.EvmTxStore) *Application_TxmStorageService_Call { + _c.Call.Return(run) + return _c +} + // WakeSessionReaper provides a mock function with given fields: func (_m *Application) WakeSessionReaper() { _m.Called() } +// Application_WakeSessionReaper_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WakeSessionReaper' +type Application_WakeSessionReaper_Call struct { + *mock.Call +} + +// WakeSessionReaper is a helper method to define mock.On call +func (_e *Application_Expecter) WakeSessionReaper() *Application_WakeSessionReaper_Call { + return &Application_WakeSessionReaper_Call{Call: _e.mock.On("WakeSessionReaper")} +} + +func (_c *Application_WakeSessionReaper_Call) Run(run func()) *Application_WakeSessionReaper_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Application_WakeSessionReaper_Call) Return() *Application_WakeSessionReaper_Call { + _c.Call.Return() + return _c +} + +func (_c *Application_WakeSessionReaper_Call) RunAndReturn(run func()) *Application_WakeSessionReaper_Call { + _c.Call.Return(run) + return _c +} + // NewApplication creates a new instance of Application. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewApplication(t interface { diff --git a/core/internal/mocks/flags.go b/core/internal/mocks/flags.go index 7d38a96d924..35efa75cafc 100644 --- a/core/internal/mocks/flags.go +++ b/core/internal/mocks/flags.go @@ -22,6 +22,14 @@ type Flags struct { mock.Mock } +type Flags_Expecter struct { + mock *mock.Mock +} + +func (_m *Flags) EXPECT() *Flags_Expecter { + return &Flags_Expecter{mock: &_m.Mock} +} + // AcceptOwnership provides a mock function with given fields: opts func (_m *Flags) AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { ret := _m.Called(opts) @@ -52,6 +60,34 @@ func (_m *Flags) AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, e return r0, r1 } +// Flags_AcceptOwnership_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AcceptOwnership' +type Flags_AcceptOwnership_Call struct { + *mock.Call +} + +// AcceptOwnership is a helper method to define mock.On call +// - opts *bind.TransactOpts +func (_e *Flags_Expecter) AcceptOwnership(opts interface{}) *Flags_AcceptOwnership_Call { + return &Flags_AcceptOwnership_Call{Call: _e.mock.On("AcceptOwnership", opts)} +} + +func (_c *Flags_AcceptOwnership_Call) Run(run func(opts *bind.TransactOpts)) *Flags_AcceptOwnership_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts)) + }) + return _c +} + +func (_c *Flags_AcceptOwnership_Call) Return(_a0 *types.Transaction, _a1 error) *Flags_AcceptOwnership_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Flags_AcceptOwnership_Call) RunAndReturn(run func(*bind.TransactOpts) (*types.Transaction, error)) *Flags_AcceptOwnership_Call { + _c.Call.Return(run) + return _c +} + // AddAccess provides a mock function with given fields: opts, _user func (_m *Flags) AddAccess(opts *bind.TransactOpts, _user common.Address) (*types.Transaction, error) { ret := _m.Called(opts, _user) @@ -82,6 +118,35 @@ func (_m *Flags) AddAccess(opts *bind.TransactOpts, _user common.Address) (*type return r0, r1 } +// Flags_AddAccess_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddAccess' +type Flags_AddAccess_Call struct { + *mock.Call +} + +// AddAccess is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - _user common.Address +func (_e *Flags_Expecter) AddAccess(opts interface{}, _user interface{}) *Flags_AddAccess_Call { + return &Flags_AddAccess_Call{Call: _e.mock.On("AddAccess", opts, _user)} +} + +func (_c *Flags_AddAccess_Call) Run(run func(opts *bind.TransactOpts, _user common.Address)) *Flags_AddAccess_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].(common.Address)) + }) + return _c +} + +func (_c *Flags_AddAccess_Call) Return(_a0 *types.Transaction, _a1 error) *Flags_AddAccess_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Flags_AddAccess_Call) RunAndReturn(run func(*bind.TransactOpts, common.Address) (*types.Transaction, error)) *Flags_AddAccess_Call { + _c.Call.Return(run) + return _c +} + // Address provides a mock function with given fields: func (_m *Flags) Address() common.Address { ret := _m.Called() @@ -102,6 +167,33 @@ func (_m *Flags) Address() common.Address { return r0 } +// Flags_Address_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Address' +type Flags_Address_Call struct { + *mock.Call +} + +// Address is a helper method to define mock.On call +func (_e *Flags_Expecter) Address() *Flags_Address_Call { + return &Flags_Address_Call{Call: _e.mock.On("Address")} +} + +func (_c *Flags_Address_Call) Run(run func()) *Flags_Address_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Flags_Address_Call) Return(_a0 common.Address) *Flags_Address_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Flags_Address_Call) RunAndReturn(run func() common.Address) *Flags_Address_Call { + _c.Call.Return(run) + return _c +} + // CheckEnabled provides a mock function with given fields: opts func (_m *Flags) CheckEnabled(opts *bind.CallOpts) (bool, error) { ret := _m.Called(opts) @@ -130,6 +222,34 @@ func (_m *Flags) CheckEnabled(opts *bind.CallOpts) (bool, error) { return r0, r1 } +// Flags_CheckEnabled_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CheckEnabled' +type Flags_CheckEnabled_Call struct { + *mock.Call +} + +// CheckEnabled is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *Flags_Expecter) CheckEnabled(opts interface{}) *Flags_CheckEnabled_Call { + return &Flags_CheckEnabled_Call{Call: _e.mock.On("CheckEnabled", opts)} +} + +func (_c *Flags_CheckEnabled_Call) Run(run func(opts *bind.CallOpts)) *Flags_CheckEnabled_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *Flags_CheckEnabled_Call) Return(_a0 bool, _a1 error) *Flags_CheckEnabled_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Flags_CheckEnabled_Call) RunAndReturn(run func(*bind.CallOpts) (bool, error)) *Flags_CheckEnabled_Call { + _c.Call.Return(run) + return _c +} + // DisableAccessCheck provides a mock function with given fields: opts func (_m *Flags) DisableAccessCheck(opts *bind.TransactOpts) (*types.Transaction, error) { ret := _m.Called(opts) @@ -160,6 +280,34 @@ func (_m *Flags) DisableAccessCheck(opts *bind.TransactOpts) (*types.Transaction return r0, r1 } +// Flags_DisableAccessCheck_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DisableAccessCheck' +type Flags_DisableAccessCheck_Call struct { + *mock.Call +} + +// DisableAccessCheck is a helper method to define mock.On call +// - opts *bind.TransactOpts +func (_e *Flags_Expecter) DisableAccessCheck(opts interface{}) *Flags_DisableAccessCheck_Call { + return &Flags_DisableAccessCheck_Call{Call: _e.mock.On("DisableAccessCheck", opts)} +} + +func (_c *Flags_DisableAccessCheck_Call) Run(run func(opts *bind.TransactOpts)) *Flags_DisableAccessCheck_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts)) + }) + return _c +} + +func (_c *Flags_DisableAccessCheck_Call) Return(_a0 *types.Transaction, _a1 error) *Flags_DisableAccessCheck_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Flags_DisableAccessCheck_Call) RunAndReturn(run func(*bind.TransactOpts) (*types.Transaction, error)) *Flags_DisableAccessCheck_Call { + _c.Call.Return(run) + return _c +} + // EnableAccessCheck provides a mock function with given fields: opts func (_m *Flags) EnableAccessCheck(opts *bind.TransactOpts) (*types.Transaction, error) { ret := _m.Called(opts) @@ -190,6 +338,34 @@ func (_m *Flags) EnableAccessCheck(opts *bind.TransactOpts) (*types.Transaction, return r0, r1 } +// Flags_EnableAccessCheck_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EnableAccessCheck' +type Flags_EnableAccessCheck_Call struct { + *mock.Call +} + +// EnableAccessCheck is a helper method to define mock.On call +// - opts *bind.TransactOpts +func (_e *Flags_Expecter) EnableAccessCheck(opts interface{}) *Flags_EnableAccessCheck_Call { + return &Flags_EnableAccessCheck_Call{Call: _e.mock.On("EnableAccessCheck", opts)} +} + +func (_c *Flags_EnableAccessCheck_Call) Run(run func(opts *bind.TransactOpts)) *Flags_EnableAccessCheck_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts)) + }) + return _c +} + +func (_c *Flags_EnableAccessCheck_Call) Return(_a0 *types.Transaction, _a1 error) *Flags_EnableAccessCheck_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Flags_EnableAccessCheck_Call) RunAndReturn(run func(*bind.TransactOpts) (*types.Transaction, error)) *Flags_EnableAccessCheck_Call { + _c.Call.Return(run) + return _c +} + // FilterAddedAccess provides a mock function with given fields: opts func (_m *Flags) FilterAddedAccess(opts *bind.FilterOpts) (*flags_wrapper.FlagsAddedAccessIterator, error) { ret := _m.Called(opts) @@ -220,6 +396,34 @@ func (_m *Flags) FilterAddedAccess(opts *bind.FilterOpts) (*flags_wrapper.FlagsA return r0, r1 } +// Flags_FilterAddedAccess_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterAddedAccess' +type Flags_FilterAddedAccess_Call struct { + *mock.Call +} + +// FilterAddedAccess is a helper method to define mock.On call +// - opts *bind.FilterOpts +func (_e *Flags_Expecter) FilterAddedAccess(opts interface{}) *Flags_FilterAddedAccess_Call { + return &Flags_FilterAddedAccess_Call{Call: _e.mock.On("FilterAddedAccess", opts)} +} + +func (_c *Flags_FilterAddedAccess_Call) Run(run func(opts *bind.FilterOpts)) *Flags_FilterAddedAccess_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts)) + }) + return _c +} + +func (_c *Flags_FilterAddedAccess_Call) Return(_a0 *flags_wrapper.FlagsAddedAccessIterator, _a1 error) *Flags_FilterAddedAccess_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Flags_FilterAddedAccess_Call) RunAndReturn(run func(*bind.FilterOpts) (*flags_wrapper.FlagsAddedAccessIterator, error)) *Flags_FilterAddedAccess_Call { + _c.Call.Return(run) + return _c +} + // FilterCheckAccessDisabled provides a mock function with given fields: opts func (_m *Flags) FilterCheckAccessDisabled(opts *bind.FilterOpts) (*flags_wrapper.FlagsCheckAccessDisabledIterator, error) { ret := _m.Called(opts) @@ -250,6 +454,34 @@ func (_m *Flags) FilterCheckAccessDisabled(opts *bind.FilterOpts) (*flags_wrappe return r0, r1 } +// Flags_FilterCheckAccessDisabled_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterCheckAccessDisabled' +type Flags_FilterCheckAccessDisabled_Call struct { + *mock.Call +} + +// FilterCheckAccessDisabled is a helper method to define mock.On call +// - opts *bind.FilterOpts +func (_e *Flags_Expecter) FilterCheckAccessDisabled(opts interface{}) *Flags_FilterCheckAccessDisabled_Call { + return &Flags_FilterCheckAccessDisabled_Call{Call: _e.mock.On("FilterCheckAccessDisabled", opts)} +} + +func (_c *Flags_FilterCheckAccessDisabled_Call) Run(run func(opts *bind.FilterOpts)) *Flags_FilterCheckAccessDisabled_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts)) + }) + return _c +} + +func (_c *Flags_FilterCheckAccessDisabled_Call) Return(_a0 *flags_wrapper.FlagsCheckAccessDisabledIterator, _a1 error) *Flags_FilterCheckAccessDisabled_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Flags_FilterCheckAccessDisabled_Call) RunAndReturn(run func(*bind.FilterOpts) (*flags_wrapper.FlagsCheckAccessDisabledIterator, error)) *Flags_FilterCheckAccessDisabled_Call { + _c.Call.Return(run) + return _c +} + // FilterCheckAccessEnabled provides a mock function with given fields: opts func (_m *Flags) FilterCheckAccessEnabled(opts *bind.FilterOpts) (*flags_wrapper.FlagsCheckAccessEnabledIterator, error) { ret := _m.Called(opts) @@ -280,6 +512,34 @@ func (_m *Flags) FilterCheckAccessEnabled(opts *bind.FilterOpts) (*flags_wrapper return r0, r1 } +// Flags_FilterCheckAccessEnabled_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterCheckAccessEnabled' +type Flags_FilterCheckAccessEnabled_Call struct { + *mock.Call +} + +// FilterCheckAccessEnabled is a helper method to define mock.On call +// - opts *bind.FilterOpts +func (_e *Flags_Expecter) FilterCheckAccessEnabled(opts interface{}) *Flags_FilterCheckAccessEnabled_Call { + return &Flags_FilterCheckAccessEnabled_Call{Call: _e.mock.On("FilterCheckAccessEnabled", opts)} +} + +func (_c *Flags_FilterCheckAccessEnabled_Call) Run(run func(opts *bind.FilterOpts)) *Flags_FilterCheckAccessEnabled_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts)) + }) + return _c +} + +func (_c *Flags_FilterCheckAccessEnabled_Call) Return(_a0 *flags_wrapper.FlagsCheckAccessEnabledIterator, _a1 error) *Flags_FilterCheckAccessEnabled_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Flags_FilterCheckAccessEnabled_Call) RunAndReturn(run func(*bind.FilterOpts) (*flags_wrapper.FlagsCheckAccessEnabledIterator, error)) *Flags_FilterCheckAccessEnabled_Call { + _c.Call.Return(run) + return _c +} + // FilterFlagLowered provides a mock function with given fields: opts, subject func (_m *Flags) FilterFlagLowered(opts *bind.FilterOpts, subject []common.Address) (*flags_wrapper.FlagsFlagLoweredIterator, error) { ret := _m.Called(opts, subject) @@ -310,6 +570,35 @@ func (_m *Flags) FilterFlagLowered(opts *bind.FilterOpts, subject []common.Addre return r0, r1 } +// Flags_FilterFlagLowered_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterFlagLowered' +type Flags_FilterFlagLowered_Call struct { + *mock.Call +} + +// FilterFlagLowered is a helper method to define mock.On call +// - opts *bind.FilterOpts +// - subject []common.Address +func (_e *Flags_Expecter) FilterFlagLowered(opts interface{}, subject interface{}) *Flags_FilterFlagLowered_Call { + return &Flags_FilterFlagLowered_Call{Call: _e.mock.On("FilterFlagLowered", opts, subject)} +} + +func (_c *Flags_FilterFlagLowered_Call) Run(run func(opts *bind.FilterOpts, subject []common.Address)) *Flags_FilterFlagLowered_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts), args[1].([]common.Address)) + }) + return _c +} + +func (_c *Flags_FilterFlagLowered_Call) Return(_a0 *flags_wrapper.FlagsFlagLoweredIterator, _a1 error) *Flags_FilterFlagLowered_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Flags_FilterFlagLowered_Call) RunAndReturn(run func(*bind.FilterOpts, []common.Address) (*flags_wrapper.FlagsFlagLoweredIterator, error)) *Flags_FilterFlagLowered_Call { + _c.Call.Return(run) + return _c +} + // FilterFlagRaised provides a mock function with given fields: opts, subject func (_m *Flags) FilterFlagRaised(opts *bind.FilterOpts, subject []common.Address) (*flags_wrapper.FlagsFlagRaisedIterator, error) { ret := _m.Called(opts, subject) @@ -340,6 +629,35 @@ func (_m *Flags) FilterFlagRaised(opts *bind.FilterOpts, subject []common.Addres return r0, r1 } +// Flags_FilterFlagRaised_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterFlagRaised' +type Flags_FilterFlagRaised_Call struct { + *mock.Call +} + +// FilterFlagRaised is a helper method to define mock.On call +// - opts *bind.FilterOpts +// - subject []common.Address +func (_e *Flags_Expecter) FilterFlagRaised(opts interface{}, subject interface{}) *Flags_FilterFlagRaised_Call { + return &Flags_FilterFlagRaised_Call{Call: _e.mock.On("FilterFlagRaised", opts, subject)} +} + +func (_c *Flags_FilterFlagRaised_Call) Run(run func(opts *bind.FilterOpts, subject []common.Address)) *Flags_FilterFlagRaised_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts), args[1].([]common.Address)) + }) + return _c +} + +func (_c *Flags_FilterFlagRaised_Call) Return(_a0 *flags_wrapper.FlagsFlagRaisedIterator, _a1 error) *Flags_FilterFlagRaised_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Flags_FilterFlagRaised_Call) RunAndReturn(run func(*bind.FilterOpts, []common.Address) (*flags_wrapper.FlagsFlagRaisedIterator, error)) *Flags_FilterFlagRaised_Call { + _c.Call.Return(run) + return _c +} + // FilterOwnershipTransferRequested provides a mock function with given fields: opts, from, to func (_m *Flags) FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*flags_wrapper.FlagsOwnershipTransferRequestedIterator, error) { ret := _m.Called(opts, from, to) @@ -370,6 +688,36 @@ func (_m *Flags) FilterOwnershipTransferRequested(opts *bind.FilterOpts, from [] return r0, r1 } +// Flags_FilterOwnershipTransferRequested_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterOwnershipTransferRequested' +type Flags_FilterOwnershipTransferRequested_Call struct { + *mock.Call +} + +// FilterOwnershipTransferRequested is a helper method to define mock.On call +// - opts *bind.FilterOpts +// - from []common.Address +// - to []common.Address +func (_e *Flags_Expecter) FilterOwnershipTransferRequested(opts interface{}, from interface{}, to interface{}) *Flags_FilterOwnershipTransferRequested_Call { + return &Flags_FilterOwnershipTransferRequested_Call{Call: _e.mock.On("FilterOwnershipTransferRequested", opts, from, to)} +} + +func (_c *Flags_FilterOwnershipTransferRequested_Call) Run(run func(opts *bind.FilterOpts, from []common.Address, to []common.Address)) *Flags_FilterOwnershipTransferRequested_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts), args[1].([]common.Address), args[2].([]common.Address)) + }) + return _c +} + +func (_c *Flags_FilterOwnershipTransferRequested_Call) Return(_a0 *flags_wrapper.FlagsOwnershipTransferRequestedIterator, _a1 error) *Flags_FilterOwnershipTransferRequested_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Flags_FilterOwnershipTransferRequested_Call) RunAndReturn(run func(*bind.FilterOpts, []common.Address, []common.Address) (*flags_wrapper.FlagsOwnershipTransferRequestedIterator, error)) *Flags_FilterOwnershipTransferRequested_Call { + _c.Call.Return(run) + return _c +} + // FilterOwnershipTransferred provides a mock function with given fields: opts, from, to func (_m *Flags) FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*flags_wrapper.FlagsOwnershipTransferredIterator, error) { ret := _m.Called(opts, from, to) @@ -400,6 +748,36 @@ func (_m *Flags) FilterOwnershipTransferred(opts *bind.FilterOpts, from []common return r0, r1 } +// Flags_FilterOwnershipTransferred_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterOwnershipTransferred' +type Flags_FilterOwnershipTransferred_Call struct { + *mock.Call +} + +// FilterOwnershipTransferred is a helper method to define mock.On call +// - opts *bind.FilterOpts +// - from []common.Address +// - to []common.Address +func (_e *Flags_Expecter) FilterOwnershipTransferred(opts interface{}, from interface{}, to interface{}) *Flags_FilterOwnershipTransferred_Call { + return &Flags_FilterOwnershipTransferred_Call{Call: _e.mock.On("FilterOwnershipTransferred", opts, from, to)} +} + +func (_c *Flags_FilterOwnershipTransferred_Call) Run(run func(opts *bind.FilterOpts, from []common.Address, to []common.Address)) *Flags_FilterOwnershipTransferred_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts), args[1].([]common.Address), args[2].([]common.Address)) + }) + return _c +} + +func (_c *Flags_FilterOwnershipTransferred_Call) Return(_a0 *flags_wrapper.FlagsOwnershipTransferredIterator, _a1 error) *Flags_FilterOwnershipTransferred_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Flags_FilterOwnershipTransferred_Call) RunAndReturn(run func(*bind.FilterOpts, []common.Address, []common.Address) (*flags_wrapper.FlagsOwnershipTransferredIterator, error)) *Flags_FilterOwnershipTransferred_Call { + _c.Call.Return(run) + return _c +} + // FilterRaisingAccessControllerUpdated provides a mock function with given fields: opts, previous, current func (_m *Flags) FilterRaisingAccessControllerUpdated(opts *bind.FilterOpts, previous []common.Address, current []common.Address) (*flags_wrapper.FlagsRaisingAccessControllerUpdatedIterator, error) { ret := _m.Called(opts, previous, current) @@ -430,6 +808,36 @@ func (_m *Flags) FilterRaisingAccessControllerUpdated(opts *bind.FilterOpts, pre return r0, r1 } +// Flags_FilterRaisingAccessControllerUpdated_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterRaisingAccessControllerUpdated' +type Flags_FilterRaisingAccessControllerUpdated_Call struct { + *mock.Call +} + +// FilterRaisingAccessControllerUpdated is a helper method to define mock.On call +// - opts *bind.FilterOpts +// - previous []common.Address +// - current []common.Address +func (_e *Flags_Expecter) FilterRaisingAccessControllerUpdated(opts interface{}, previous interface{}, current interface{}) *Flags_FilterRaisingAccessControllerUpdated_Call { + return &Flags_FilterRaisingAccessControllerUpdated_Call{Call: _e.mock.On("FilterRaisingAccessControllerUpdated", opts, previous, current)} +} + +func (_c *Flags_FilterRaisingAccessControllerUpdated_Call) Run(run func(opts *bind.FilterOpts, previous []common.Address, current []common.Address)) *Flags_FilterRaisingAccessControllerUpdated_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts), args[1].([]common.Address), args[2].([]common.Address)) + }) + return _c +} + +func (_c *Flags_FilterRaisingAccessControllerUpdated_Call) Return(_a0 *flags_wrapper.FlagsRaisingAccessControllerUpdatedIterator, _a1 error) *Flags_FilterRaisingAccessControllerUpdated_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Flags_FilterRaisingAccessControllerUpdated_Call) RunAndReturn(run func(*bind.FilterOpts, []common.Address, []common.Address) (*flags_wrapper.FlagsRaisingAccessControllerUpdatedIterator, error)) *Flags_FilterRaisingAccessControllerUpdated_Call { + _c.Call.Return(run) + return _c +} + // FilterRemovedAccess provides a mock function with given fields: opts func (_m *Flags) FilterRemovedAccess(opts *bind.FilterOpts) (*flags_wrapper.FlagsRemovedAccessIterator, error) { ret := _m.Called(opts) @@ -460,6 +868,34 @@ func (_m *Flags) FilterRemovedAccess(opts *bind.FilterOpts) (*flags_wrapper.Flag return r0, r1 } +// Flags_FilterRemovedAccess_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterRemovedAccess' +type Flags_FilterRemovedAccess_Call struct { + *mock.Call +} + +// FilterRemovedAccess is a helper method to define mock.On call +// - opts *bind.FilterOpts +func (_e *Flags_Expecter) FilterRemovedAccess(opts interface{}) *Flags_FilterRemovedAccess_Call { + return &Flags_FilterRemovedAccess_Call{Call: _e.mock.On("FilterRemovedAccess", opts)} +} + +func (_c *Flags_FilterRemovedAccess_Call) Run(run func(opts *bind.FilterOpts)) *Flags_FilterRemovedAccess_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts)) + }) + return _c +} + +func (_c *Flags_FilterRemovedAccess_Call) Return(_a0 *flags_wrapper.FlagsRemovedAccessIterator, _a1 error) *Flags_FilterRemovedAccess_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Flags_FilterRemovedAccess_Call) RunAndReturn(run func(*bind.FilterOpts) (*flags_wrapper.FlagsRemovedAccessIterator, error)) *Flags_FilterRemovedAccess_Call { + _c.Call.Return(run) + return _c +} + // GetFlag provides a mock function with given fields: opts, subject func (_m *Flags) GetFlag(opts *bind.CallOpts, subject common.Address) (bool, error) { ret := _m.Called(opts, subject) @@ -488,6 +924,35 @@ func (_m *Flags) GetFlag(opts *bind.CallOpts, subject common.Address) (bool, err return r0, r1 } +// Flags_GetFlag_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetFlag' +type Flags_GetFlag_Call struct { + *mock.Call +} + +// GetFlag is a helper method to define mock.On call +// - opts *bind.CallOpts +// - subject common.Address +func (_e *Flags_Expecter) GetFlag(opts interface{}, subject interface{}) *Flags_GetFlag_Call { + return &Flags_GetFlag_Call{Call: _e.mock.On("GetFlag", opts, subject)} +} + +func (_c *Flags_GetFlag_Call) Run(run func(opts *bind.CallOpts, subject common.Address)) *Flags_GetFlag_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts), args[1].(common.Address)) + }) + return _c +} + +func (_c *Flags_GetFlag_Call) Return(_a0 bool, _a1 error) *Flags_GetFlag_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Flags_GetFlag_Call) RunAndReturn(run func(*bind.CallOpts, common.Address) (bool, error)) *Flags_GetFlag_Call { + _c.Call.Return(run) + return _c +} + // GetFlags provides a mock function with given fields: opts, subjects func (_m *Flags) GetFlags(opts *bind.CallOpts, subjects []common.Address) ([]bool, error) { ret := _m.Called(opts, subjects) @@ -518,6 +983,35 @@ func (_m *Flags) GetFlags(opts *bind.CallOpts, subjects []common.Address) ([]boo return r0, r1 } +// Flags_GetFlags_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetFlags' +type Flags_GetFlags_Call struct { + *mock.Call +} + +// GetFlags is a helper method to define mock.On call +// - opts *bind.CallOpts +// - subjects []common.Address +func (_e *Flags_Expecter) GetFlags(opts interface{}, subjects interface{}) *Flags_GetFlags_Call { + return &Flags_GetFlags_Call{Call: _e.mock.On("GetFlags", opts, subjects)} +} + +func (_c *Flags_GetFlags_Call) Run(run func(opts *bind.CallOpts, subjects []common.Address)) *Flags_GetFlags_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts), args[1].([]common.Address)) + }) + return _c +} + +func (_c *Flags_GetFlags_Call) Return(_a0 []bool, _a1 error) *Flags_GetFlags_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Flags_GetFlags_Call) RunAndReturn(run func(*bind.CallOpts, []common.Address) ([]bool, error)) *Flags_GetFlags_Call { + _c.Call.Return(run) + return _c +} + // HasAccess provides a mock function with given fields: opts, _user, _calldata func (_m *Flags) HasAccess(opts *bind.CallOpts, _user common.Address, _calldata []byte) (bool, error) { ret := _m.Called(opts, _user, _calldata) @@ -546,6 +1040,36 @@ func (_m *Flags) HasAccess(opts *bind.CallOpts, _user common.Address, _calldata return r0, r1 } +// Flags_HasAccess_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HasAccess' +type Flags_HasAccess_Call struct { + *mock.Call +} + +// HasAccess is a helper method to define mock.On call +// - opts *bind.CallOpts +// - _user common.Address +// - _calldata []byte +func (_e *Flags_Expecter) HasAccess(opts interface{}, _user interface{}, _calldata interface{}) *Flags_HasAccess_Call { + return &Flags_HasAccess_Call{Call: _e.mock.On("HasAccess", opts, _user, _calldata)} +} + +func (_c *Flags_HasAccess_Call) Run(run func(opts *bind.CallOpts, _user common.Address, _calldata []byte)) *Flags_HasAccess_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts), args[1].(common.Address), args[2].([]byte)) + }) + return _c +} + +func (_c *Flags_HasAccess_Call) Return(_a0 bool, _a1 error) *Flags_HasAccess_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Flags_HasAccess_Call) RunAndReturn(run func(*bind.CallOpts, common.Address, []byte) (bool, error)) *Flags_HasAccess_Call { + _c.Call.Return(run) + return _c +} + // LowerFlags provides a mock function with given fields: opts, subjects func (_m *Flags) LowerFlags(opts *bind.TransactOpts, subjects []common.Address) (*types.Transaction, error) { ret := _m.Called(opts, subjects) @@ -576,6 +1100,35 @@ func (_m *Flags) LowerFlags(opts *bind.TransactOpts, subjects []common.Address) return r0, r1 } +// Flags_LowerFlags_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LowerFlags' +type Flags_LowerFlags_Call struct { + *mock.Call +} + +// LowerFlags is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - subjects []common.Address +func (_e *Flags_Expecter) LowerFlags(opts interface{}, subjects interface{}) *Flags_LowerFlags_Call { + return &Flags_LowerFlags_Call{Call: _e.mock.On("LowerFlags", opts, subjects)} +} + +func (_c *Flags_LowerFlags_Call) Run(run func(opts *bind.TransactOpts, subjects []common.Address)) *Flags_LowerFlags_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].([]common.Address)) + }) + return _c +} + +func (_c *Flags_LowerFlags_Call) Return(_a0 *types.Transaction, _a1 error) *Flags_LowerFlags_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Flags_LowerFlags_Call) RunAndReturn(run func(*bind.TransactOpts, []common.Address) (*types.Transaction, error)) *Flags_LowerFlags_Call { + _c.Call.Return(run) + return _c +} + // Owner provides a mock function with given fields: opts func (_m *Flags) Owner(opts *bind.CallOpts) (common.Address, error) { ret := _m.Called(opts) @@ -606,6 +1159,34 @@ func (_m *Flags) Owner(opts *bind.CallOpts) (common.Address, error) { return r0, r1 } +// Flags_Owner_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Owner' +type Flags_Owner_Call struct { + *mock.Call +} + +// Owner is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *Flags_Expecter) Owner(opts interface{}) *Flags_Owner_Call { + return &Flags_Owner_Call{Call: _e.mock.On("Owner", opts)} +} + +func (_c *Flags_Owner_Call) Run(run func(opts *bind.CallOpts)) *Flags_Owner_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *Flags_Owner_Call) Return(_a0 common.Address, _a1 error) *Flags_Owner_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Flags_Owner_Call) RunAndReturn(run func(*bind.CallOpts) (common.Address, error)) *Flags_Owner_Call { + _c.Call.Return(run) + return _c +} + // ParseAddedAccess provides a mock function with given fields: log func (_m *Flags) ParseAddedAccess(log types.Log) (*flags_wrapper.FlagsAddedAccess, error) { ret := _m.Called(log) @@ -636,6 +1217,34 @@ func (_m *Flags) ParseAddedAccess(log types.Log) (*flags_wrapper.FlagsAddedAcces return r0, r1 } +// Flags_ParseAddedAccess_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseAddedAccess' +type Flags_ParseAddedAccess_Call struct { + *mock.Call +} + +// ParseAddedAccess is a helper method to define mock.On call +// - log types.Log +func (_e *Flags_Expecter) ParseAddedAccess(log interface{}) *Flags_ParseAddedAccess_Call { + return &Flags_ParseAddedAccess_Call{Call: _e.mock.On("ParseAddedAccess", log)} +} + +func (_c *Flags_ParseAddedAccess_Call) Run(run func(log types.Log)) *Flags_ParseAddedAccess_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *Flags_ParseAddedAccess_Call) Return(_a0 *flags_wrapper.FlagsAddedAccess, _a1 error) *Flags_ParseAddedAccess_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Flags_ParseAddedAccess_Call) RunAndReturn(run func(types.Log) (*flags_wrapper.FlagsAddedAccess, error)) *Flags_ParseAddedAccess_Call { + _c.Call.Return(run) + return _c +} + // ParseCheckAccessDisabled provides a mock function with given fields: log func (_m *Flags) ParseCheckAccessDisabled(log types.Log) (*flags_wrapper.FlagsCheckAccessDisabled, error) { ret := _m.Called(log) @@ -666,6 +1275,34 @@ func (_m *Flags) ParseCheckAccessDisabled(log types.Log) (*flags_wrapper.FlagsCh return r0, r1 } +// Flags_ParseCheckAccessDisabled_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseCheckAccessDisabled' +type Flags_ParseCheckAccessDisabled_Call struct { + *mock.Call +} + +// ParseCheckAccessDisabled is a helper method to define mock.On call +// - log types.Log +func (_e *Flags_Expecter) ParseCheckAccessDisabled(log interface{}) *Flags_ParseCheckAccessDisabled_Call { + return &Flags_ParseCheckAccessDisabled_Call{Call: _e.mock.On("ParseCheckAccessDisabled", log)} +} + +func (_c *Flags_ParseCheckAccessDisabled_Call) Run(run func(log types.Log)) *Flags_ParseCheckAccessDisabled_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *Flags_ParseCheckAccessDisabled_Call) Return(_a0 *flags_wrapper.FlagsCheckAccessDisabled, _a1 error) *Flags_ParseCheckAccessDisabled_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Flags_ParseCheckAccessDisabled_Call) RunAndReturn(run func(types.Log) (*flags_wrapper.FlagsCheckAccessDisabled, error)) *Flags_ParseCheckAccessDisabled_Call { + _c.Call.Return(run) + return _c +} + // ParseCheckAccessEnabled provides a mock function with given fields: log func (_m *Flags) ParseCheckAccessEnabled(log types.Log) (*flags_wrapper.FlagsCheckAccessEnabled, error) { ret := _m.Called(log) @@ -696,6 +1333,34 @@ func (_m *Flags) ParseCheckAccessEnabled(log types.Log) (*flags_wrapper.FlagsChe return r0, r1 } +// Flags_ParseCheckAccessEnabled_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseCheckAccessEnabled' +type Flags_ParseCheckAccessEnabled_Call struct { + *mock.Call +} + +// ParseCheckAccessEnabled is a helper method to define mock.On call +// - log types.Log +func (_e *Flags_Expecter) ParseCheckAccessEnabled(log interface{}) *Flags_ParseCheckAccessEnabled_Call { + return &Flags_ParseCheckAccessEnabled_Call{Call: _e.mock.On("ParseCheckAccessEnabled", log)} +} + +func (_c *Flags_ParseCheckAccessEnabled_Call) Run(run func(log types.Log)) *Flags_ParseCheckAccessEnabled_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *Flags_ParseCheckAccessEnabled_Call) Return(_a0 *flags_wrapper.FlagsCheckAccessEnabled, _a1 error) *Flags_ParseCheckAccessEnabled_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Flags_ParseCheckAccessEnabled_Call) RunAndReturn(run func(types.Log) (*flags_wrapper.FlagsCheckAccessEnabled, error)) *Flags_ParseCheckAccessEnabled_Call { + _c.Call.Return(run) + return _c +} + // ParseFlagLowered provides a mock function with given fields: log func (_m *Flags) ParseFlagLowered(log types.Log) (*flags_wrapper.FlagsFlagLowered, error) { ret := _m.Called(log) @@ -726,6 +1391,34 @@ func (_m *Flags) ParseFlagLowered(log types.Log) (*flags_wrapper.FlagsFlagLowere return r0, r1 } +// Flags_ParseFlagLowered_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseFlagLowered' +type Flags_ParseFlagLowered_Call struct { + *mock.Call +} + +// ParseFlagLowered is a helper method to define mock.On call +// - log types.Log +func (_e *Flags_Expecter) ParseFlagLowered(log interface{}) *Flags_ParseFlagLowered_Call { + return &Flags_ParseFlagLowered_Call{Call: _e.mock.On("ParseFlagLowered", log)} +} + +func (_c *Flags_ParseFlagLowered_Call) Run(run func(log types.Log)) *Flags_ParseFlagLowered_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *Flags_ParseFlagLowered_Call) Return(_a0 *flags_wrapper.FlagsFlagLowered, _a1 error) *Flags_ParseFlagLowered_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Flags_ParseFlagLowered_Call) RunAndReturn(run func(types.Log) (*flags_wrapper.FlagsFlagLowered, error)) *Flags_ParseFlagLowered_Call { + _c.Call.Return(run) + return _c +} + // ParseFlagRaised provides a mock function with given fields: log func (_m *Flags) ParseFlagRaised(log types.Log) (*flags_wrapper.FlagsFlagRaised, error) { ret := _m.Called(log) @@ -756,6 +1449,34 @@ func (_m *Flags) ParseFlagRaised(log types.Log) (*flags_wrapper.FlagsFlagRaised, return r0, r1 } +// Flags_ParseFlagRaised_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseFlagRaised' +type Flags_ParseFlagRaised_Call struct { + *mock.Call +} + +// ParseFlagRaised is a helper method to define mock.On call +// - log types.Log +func (_e *Flags_Expecter) ParseFlagRaised(log interface{}) *Flags_ParseFlagRaised_Call { + return &Flags_ParseFlagRaised_Call{Call: _e.mock.On("ParseFlagRaised", log)} +} + +func (_c *Flags_ParseFlagRaised_Call) Run(run func(log types.Log)) *Flags_ParseFlagRaised_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *Flags_ParseFlagRaised_Call) Return(_a0 *flags_wrapper.FlagsFlagRaised, _a1 error) *Flags_ParseFlagRaised_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Flags_ParseFlagRaised_Call) RunAndReturn(run func(types.Log) (*flags_wrapper.FlagsFlagRaised, error)) *Flags_ParseFlagRaised_Call { + _c.Call.Return(run) + return _c +} + // ParseLog provides a mock function with given fields: log func (_m *Flags) ParseLog(log types.Log) (generated.AbigenLog, error) { ret := _m.Called(log) @@ -786,6 +1507,34 @@ func (_m *Flags) ParseLog(log types.Log) (generated.AbigenLog, error) { return r0, r1 } +// Flags_ParseLog_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseLog' +type Flags_ParseLog_Call struct { + *mock.Call +} + +// ParseLog is a helper method to define mock.On call +// - log types.Log +func (_e *Flags_Expecter) ParseLog(log interface{}) *Flags_ParseLog_Call { + return &Flags_ParseLog_Call{Call: _e.mock.On("ParseLog", log)} +} + +func (_c *Flags_ParseLog_Call) Run(run func(log types.Log)) *Flags_ParseLog_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *Flags_ParseLog_Call) Return(_a0 generated.AbigenLog, _a1 error) *Flags_ParseLog_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Flags_ParseLog_Call) RunAndReturn(run func(types.Log) (generated.AbigenLog, error)) *Flags_ParseLog_Call { + _c.Call.Return(run) + return _c +} + // ParseOwnershipTransferRequested provides a mock function with given fields: log func (_m *Flags) ParseOwnershipTransferRequested(log types.Log) (*flags_wrapper.FlagsOwnershipTransferRequested, error) { ret := _m.Called(log) @@ -816,6 +1565,34 @@ func (_m *Flags) ParseOwnershipTransferRequested(log types.Log) (*flags_wrapper. return r0, r1 } +// Flags_ParseOwnershipTransferRequested_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseOwnershipTransferRequested' +type Flags_ParseOwnershipTransferRequested_Call struct { + *mock.Call +} + +// ParseOwnershipTransferRequested is a helper method to define mock.On call +// - log types.Log +func (_e *Flags_Expecter) ParseOwnershipTransferRequested(log interface{}) *Flags_ParseOwnershipTransferRequested_Call { + return &Flags_ParseOwnershipTransferRequested_Call{Call: _e.mock.On("ParseOwnershipTransferRequested", log)} +} + +func (_c *Flags_ParseOwnershipTransferRequested_Call) Run(run func(log types.Log)) *Flags_ParseOwnershipTransferRequested_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *Flags_ParseOwnershipTransferRequested_Call) Return(_a0 *flags_wrapper.FlagsOwnershipTransferRequested, _a1 error) *Flags_ParseOwnershipTransferRequested_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Flags_ParseOwnershipTransferRequested_Call) RunAndReturn(run func(types.Log) (*flags_wrapper.FlagsOwnershipTransferRequested, error)) *Flags_ParseOwnershipTransferRequested_Call { + _c.Call.Return(run) + return _c +} + // ParseOwnershipTransferred provides a mock function with given fields: log func (_m *Flags) ParseOwnershipTransferred(log types.Log) (*flags_wrapper.FlagsOwnershipTransferred, error) { ret := _m.Called(log) @@ -846,6 +1623,34 @@ func (_m *Flags) ParseOwnershipTransferred(log types.Log) (*flags_wrapper.FlagsO return r0, r1 } +// Flags_ParseOwnershipTransferred_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseOwnershipTransferred' +type Flags_ParseOwnershipTransferred_Call struct { + *mock.Call +} + +// ParseOwnershipTransferred is a helper method to define mock.On call +// - log types.Log +func (_e *Flags_Expecter) ParseOwnershipTransferred(log interface{}) *Flags_ParseOwnershipTransferred_Call { + return &Flags_ParseOwnershipTransferred_Call{Call: _e.mock.On("ParseOwnershipTransferred", log)} +} + +func (_c *Flags_ParseOwnershipTransferred_Call) Run(run func(log types.Log)) *Flags_ParseOwnershipTransferred_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *Flags_ParseOwnershipTransferred_Call) Return(_a0 *flags_wrapper.FlagsOwnershipTransferred, _a1 error) *Flags_ParseOwnershipTransferred_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Flags_ParseOwnershipTransferred_Call) RunAndReturn(run func(types.Log) (*flags_wrapper.FlagsOwnershipTransferred, error)) *Flags_ParseOwnershipTransferred_Call { + _c.Call.Return(run) + return _c +} + // ParseRaisingAccessControllerUpdated provides a mock function with given fields: log func (_m *Flags) ParseRaisingAccessControllerUpdated(log types.Log) (*flags_wrapper.FlagsRaisingAccessControllerUpdated, error) { ret := _m.Called(log) @@ -876,6 +1681,34 @@ func (_m *Flags) ParseRaisingAccessControllerUpdated(log types.Log) (*flags_wrap return r0, r1 } +// Flags_ParseRaisingAccessControllerUpdated_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseRaisingAccessControllerUpdated' +type Flags_ParseRaisingAccessControllerUpdated_Call struct { + *mock.Call +} + +// ParseRaisingAccessControllerUpdated is a helper method to define mock.On call +// - log types.Log +func (_e *Flags_Expecter) ParseRaisingAccessControllerUpdated(log interface{}) *Flags_ParseRaisingAccessControllerUpdated_Call { + return &Flags_ParseRaisingAccessControllerUpdated_Call{Call: _e.mock.On("ParseRaisingAccessControllerUpdated", log)} +} + +func (_c *Flags_ParseRaisingAccessControllerUpdated_Call) Run(run func(log types.Log)) *Flags_ParseRaisingAccessControllerUpdated_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *Flags_ParseRaisingAccessControllerUpdated_Call) Return(_a0 *flags_wrapper.FlagsRaisingAccessControllerUpdated, _a1 error) *Flags_ParseRaisingAccessControllerUpdated_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Flags_ParseRaisingAccessControllerUpdated_Call) RunAndReturn(run func(types.Log) (*flags_wrapper.FlagsRaisingAccessControllerUpdated, error)) *Flags_ParseRaisingAccessControllerUpdated_Call { + _c.Call.Return(run) + return _c +} + // ParseRemovedAccess provides a mock function with given fields: log func (_m *Flags) ParseRemovedAccess(log types.Log) (*flags_wrapper.FlagsRemovedAccess, error) { ret := _m.Called(log) @@ -906,6 +1739,34 @@ func (_m *Flags) ParseRemovedAccess(log types.Log) (*flags_wrapper.FlagsRemovedA return r0, r1 } +// Flags_ParseRemovedAccess_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseRemovedAccess' +type Flags_ParseRemovedAccess_Call struct { + *mock.Call +} + +// ParseRemovedAccess is a helper method to define mock.On call +// - log types.Log +func (_e *Flags_Expecter) ParseRemovedAccess(log interface{}) *Flags_ParseRemovedAccess_Call { + return &Flags_ParseRemovedAccess_Call{Call: _e.mock.On("ParseRemovedAccess", log)} +} + +func (_c *Flags_ParseRemovedAccess_Call) Run(run func(log types.Log)) *Flags_ParseRemovedAccess_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *Flags_ParseRemovedAccess_Call) Return(_a0 *flags_wrapper.FlagsRemovedAccess, _a1 error) *Flags_ParseRemovedAccess_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Flags_ParseRemovedAccess_Call) RunAndReturn(run func(types.Log) (*flags_wrapper.FlagsRemovedAccess, error)) *Flags_ParseRemovedAccess_Call { + _c.Call.Return(run) + return _c +} + // RaiseFlag provides a mock function with given fields: opts, subject func (_m *Flags) RaiseFlag(opts *bind.TransactOpts, subject common.Address) (*types.Transaction, error) { ret := _m.Called(opts, subject) @@ -936,6 +1797,35 @@ func (_m *Flags) RaiseFlag(opts *bind.TransactOpts, subject common.Address) (*ty return r0, r1 } +// Flags_RaiseFlag_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RaiseFlag' +type Flags_RaiseFlag_Call struct { + *mock.Call +} + +// RaiseFlag is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - subject common.Address +func (_e *Flags_Expecter) RaiseFlag(opts interface{}, subject interface{}) *Flags_RaiseFlag_Call { + return &Flags_RaiseFlag_Call{Call: _e.mock.On("RaiseFlag", opts, subject)} +} + +func (_c *Flags_RaiseFlag_Call) Run(run func(opts *bind.TransactOpts, subject common.Address)) *Flags_RaiseFlag_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].(common.Address)) + }) + return _c +} + +func (_c *Flags_RaiseFlag_Call) Return(_a0 *types.Transaction, _a1 error) *Flags_RaiseFlag_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Flags_RaiseFlag_Call) RunAndReturn(run func(*bind.TransactOpts, common.Address) (*types.Transaction, error)) *Flags_RaiseFlag_Call { + _c.Call.Return(run) + return _c +} + // RaiseFlags provides a mock function with given fields: opts, subjects func (_m *Flags) RaiseFlags(opts *bind.TransactOpts, subjects []common.Address) (*types.Transaction, error) { ret := _m.Called(opts, subjects) @@ -966,6 +1856,35 @@ func (_m *Flags) RaiseFlags(opts *bind.TransactOpts, subjects []common.Address) return r0, r1 } +// Flags_RaiseFlags_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RaiseFlags' +type Flags_RaiseFlags_Call struct { + *mock.Call +} + +// RaiseFlags is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - subjects []common.Address +func (_e *Flags_Expecter) RaiseFlags(opts interface{}, subjects interface{}) *Flags_RaiseFlags_Call { + return &Flags_RaiseFlags_Call{Call: _e.mock.On("RaiseFlags", opts, subjects)} +} + +func (_c *Flags_RaiseFlags_Call) Run(run func(opts *bind.TransactOpts, subjects []common.Address)) *Flags_RaiseFlags_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].([]common.Address)) + }) + return _c +} + +func (_c *Flags_RaiseFlags_Call) Return(_a0 *types.Transaction, _a1 error) *Flags_RaiseFlags_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Flags_RaiseFlags_Call) RunAndReturn(run func(*bind.TransactOpts, []common.Address) (*types.Transaction, error)) *Flags_RaiseFlags_Call { + _c.Call.Return(run) + return _c +} + // RaisingAccessController provides a mock function with given fields: opts func (_m *Flags) RaisingAccessController(opts *bind.CallOpts) (common.Address, error) { ret := _m.Called(opts) @@ -996,6 +1915,34 @@ func (_m *Flags) RaisingAccessController(opts *bind.CallOpts) (common.Address, e return r0, r1 } +// Flags_RaisingAccessController_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RaisingAccessController' +type Flags_RaisingAccessController_Call struct { + *mock.Call +} + +// RaisingAccessController is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *Flags_Expecter) RaisingAccessController(opts interface{}) *Flags_RaisingAccessController_Call { + return &Flags_RaisingAccessController_Call{Call: _e.mock.On("RaisingAccessController", opts)} +} + +func (_c *Flags_RaisingAccessController_Call) Run(run func(opts *bind.CallOpts)) *Flags_RaisingAccessController_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *Flags_RaisingAccessController_Call) Return(_a0 common.Address, _a1 error) *Flags_RaisingAccessController_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Flags_RaisingAccessController_Call) RunAndReturn(run func(*bind.CallOpts) (common.Address, error)) *Flags_RaisingAccessController_Call { + _c.Call.Return(run) + return _c +} + // RemoveAccess provides a mock function with given fields: opts, _user func (_m *Flags) RemoveAccess(opts *bind.TransactOpts, _user common.Address) (*types.Transaction, error) { ret := _m.Called(opts, _user) @@ -1026,6 +1973,35 @@ func (_m *Flags) RemoveAccess(opts *bind.TransactOpts, _user common.Address) (*t return r0, r1 } +// Flags_RemoveAccess_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveAccess' +type Flags_RemoveAccess_Call struct { + *mock.Call +} + +// RemoveAccess is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - _user common.Address +func (_e *Flags_Expecter) RemoveAccess(opts interface{}, _user interface{}) *Flags_RemoveAccess_Call { + return &Flags_RemoveAccess_Call{Call: _e.mock.On("RemoveAccess", opts, _user)} +} + +func (_c *Flags_RemoveAccess_Call) Run(run func(opts *bind.TransactOpts, _user common.Address)) *Flags_RemoveAccess_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].(common.Address)) + }) + return _c +} + +func (_c *Flags_RemoveAccess_Call) Return(_a0 *types.Transaction, _a1 error) *Flags_RemoveAccess_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Flags_RemoveAccess_Call) RunAndReturn(run func(*bind.TransactOpts, common.Address) (*types.Transaction, error)) *Flags_RemoveAccess_Call { + _c.Call.Return(run) + return _c +} + // SetRaisingAccessController provides a mock function with given fields: opts, racAddress func (_m *Flags) SetRaisingAccessController(opts *bind.TransactOpts, racAddress common.Address) (*types.Transaction, error) { ret := _m.Called(opts, racAddress) @@ -1056,6 +2032,35 @@ func (_m *Flags) SetRaisingAccessController(opts *bind.TransactOpts, racAddress return r0, r1 } +// Flags_SetRaisingAccessController_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetRaisingAccessController' +type Flags_SetRaisingAccessController_Call struct { + *mock.Call +} + +// SetRaisingAccessController is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - racAddress common.Address +func (_e *Flags_Expecter) SetRaisingAccessController(opts interface{}, racAddress interface{}) *Flags_SetRaisingAccessController_Call { + return &Flags_SetRaisingAccessController_Call{Call: _e.mock.On("SetRaisingAccessController", opts, racAddress)} +} + +func (_c *Flags_SetRaisingAccessController_Call) Run(run func(opts *bind.TransactOpts, racAddress common.Address)) *Flags_SetRaisingAccessController_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].(common.Address)) + }) + return _c +} + +func (_c *Flags_SetRaisingAccessController_Call) Return(_a0 *types.Transaction, _a1 error) *Flags_SetRaisingAccessController_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Flags_SetRaisingAccessController_Call) RunAndReturn(run func(*bind.TransactOpts, common.Address) (*types.Transaction, error)) *Flags_SetRaisingAccessController_Call { + _c.Call.Return(run) + return _c +} + // TransferOwnership provides a mock function with given fields: opts, _to func (_m *Flags) TransferOwnership(opts *bind.TransactOpts, _to common.Address) (*types.Transaction, error) { ret := _m.Called(opts, _to) @@ -1086,6 +2091,35 @@ func (_m *Flags) TransferOwnership(opts *bind.TransactOpts, _to common.Address) return r0, r1 } +// Flags_TransferOwnership_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TransferOwnership' +type Flags_TransferOwnership_Call struct { + *mock.Call +} + +// TransferOwnership is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - _to common.Address +func (_e *Flags_Expecter) TransferOwnership(opts interface{}, _to interface{}) *Flags_TransferOwnership_Call { + return &Flags_TransferOwnership_Call{Call: _e.mock.On("TransferOwnership", opts, _to)} +} + +func (_c *Flags_TransferOwnership_Call) Run(run func(opts *bind.TransactOpts, _to common.Address)) *Flags_TransferOwnership_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].(common.Address)) + }) + return _c +} + +func (_c *Flags_TransferOwnership_Call) Return(_a0 *types.Transaction, _a1 error) *Flags_TransferOwnership_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Flags_TransferOwnership_Call) RunAndReturn(run func(*bind.TransactOpts, common.Address) (*types.Transaction, error)) *Flags_TransferOwnership_Call { + _c.Call.Return(run) + return _c +} + // WatchAddedAccess provides a mock function with given fields: opts, sink func (_m *Flags) WatchAddedAccess(opts *bind.WatchOpts, sink chan<- *flags_wrapper.FlagsAddedAccess) (event.Subscription, error) { ret := _m.Called(opts, sink) @@ -1116,6 +2150,35 @@ func (_m *Flags) WatchAddedAccess(opts *bind.WatchOpts, sink chan<- *flags_wrapp return r0, r1 } +// Flags_WatchAddedAccess_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchAddedAccess' +type Flags_WatchAddedAccess_Call struct { + *mock.Call +} + +// WatchAddedAccess is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *flags_wrapper.FlagsAddedAccess +func (_e *Flags_Expecter) WatchAddedAccess(opts interface{}, sink interface{}) *Flags_WatchAddedAccess_Call { + return &Flags_WatchAddedAccess_Call{Call: _e.mock.On("WatchAddedAccess", opts, sink)} +} + +func (_c *Flags_WatchAddedAccess_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *flags_wrapper.FlagsAddedAccess)) *Flags_WatchAddedAccess_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *flags_wrapper.FlagsAddedAccess)) + }) + return _c +} + +func (_c *Flags_WatchAddedAccess_Call) Return(_a0 event.Subscription, _a1 error) *Flags_WatchAddedAccess_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Flags_WatchAddedAccess_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *flags_wrapper.FlagsAddedAccess) (event.Subscription, error)) *Flags_WatchAddedAccess_Call { + _c.Call.Return(run) + return _c +} + // WatchCheckAccessDisabled provides a mock function with given fields: opts, sink func (_m *Flags) WatchCheckAccessDisabled(opts *bind.WatchOpts, sink chan<- *flags_wrapper.FlagsCheckAccessDisabled) (event.Subscription, error) { ret := _m.Called(opts, sink) @@ -1146,6 +2209,35 @@ func (_m *Flags) WatchCheckAccessDisabled(opts *bind.WatchOpts, sink chan<- *fla return r0, r1 } +// Flags_WatchCheckAccessDisabled_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchCheckAccessDisabled' +type Flags_WatchCheckAccessDisabled_Call struct { + *mock.Call +} + +// WatchCheckAccessDisabled is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *flags_wrapper.FlagsCheckAccessDisabled +func (_e *Flags_Expecter) WatchCheckAccessDisabled(opts interface{}, sink interface{}) *Flags_WatchCheckAccessDisabled_Call { + return &Flags_WatchCheckAccessDisabled_Call{Call: _e.mock.On("WatchCheckAccessDisabled", opts, sink)} +} + +func (_c *Flags_WatchCheckAccessDisabled_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *flags_wrapper.FlagsCheckAccessDisabled)) *Flags_WatchCheckAccessDisabled_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *flags_wrapper.FlagsCheckAccessDisabled)) + }) + return _c +} + +func (_c *Flags_WatchCheckAccessDisabled_Call) Return(_a0 event.Subscription, _a1 error) *Flags_WatchCheckAccessDisabled_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Flags_WatchCheckAccessDisabled_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *flags_wrapper.FlagsCheckAccessDisabled) (event.Subscription, error)) *Flags_WatchCheckAccessDisabled_Call { + _c.Call.Return(run) + return _c +} + // WatchCheckAccessEnabled provides a mock function with given fields: opts, sink func (_m *Flags) WatchCheckAccessEnabled(opts *bind.WatchOpts, sink chan<- *flags_wrapper.FlagsCheckAccessEnabled) (event.Subscription, error) { ret := _m.Called(opts, sink) @@ -1176,6 +2268,35 @@ func (_m *Flags) WatchCheckAccessEnabled(opts *bind.WatchOpts, sink chan<- *flag return r0, r1 } +// Flags_WatchCheckAccessEnabled_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchCheckAccessEnabled' +type Flags_WatchCheckAccessEnabled_Call struct { + *mock.Call +} + +// WatchCheckAccessEnabled is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *flags_wrapper.FlagsCheckAccessEnabled +func (_e *Flags_Expecter) WatchCheckAccessEnabled(opts interface{}, sink interface{}) *Flags_WatchCheckAccessEnabled_Call { + return &Flags_WatchCheckAccessEnabled_Call{Call: _e.mock.On("WatchCheckAccessEnabled", opts, sink)} +} + +func (_c *Flags_WatchCheckAccessEnabled_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *flags_wrapper.FlagsCheckAccessEnabled)) *Flags_WatchCheckAccessEnabled_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *flags_wrapper.FlagsCheckAccessEnabled)) + }) + return _c +} + +func (_c *Flags_WatchCheckAccessEnabled_Call) Return(_a0 event.Subscription, _a1 error) *Flags_WatchCheckAccessEnabled_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Flags_WatchCheckAccessEnabled_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *flags_wrapper.FlagsCheckAccessEnabled) (event.Subscription, error)) *Flags_WatchCheckAccessEnabled_Call { + _c.Call.Return(run) + return _c +} + // WatchFlagLowered provides a mock function with given fields: opts, sink, subject func (_m *Flags) WatchFlagLowered(opts *bind.WatchOpts, sink chan<- *flags_wrapper.FlagsFlagLowered, subject []common.Address) (event.Subscription, error) { ret := _m.Called(opts, sink, subject) @@ -1206,6 +2327,36 @@ func (_m *Flags) WatchFlagLowered(opts *bind.WatchOpts, sink chan<- *flags_wrapp return r0, r1 } +// Flags_WatchFlagLowered_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchFlagLowered' +type Flags_WatchFlagLowered_Call struct { + *mock.Call +} + +// WatchFlagLowered is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *flags_wrapper.FlagsFlagLowered +// - subject []common.Address +func (_e *Flags_Expecter) WatchFlagLowered(opts interface{}, sink interface{}, subject interface{}) *Flags_WatchFlagLowered_Call { + return &Flags_WatchFlagLowered_Call{Call: _e.mock.On("WatchFlagLowered", opts, sink, subject)} +} + +func (_c *Flags_WatchFlagLowered_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *flags_wrapper.FlagsFlagLowered, subject []common.Address)) *Flags_WatchFlagLowered_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *flags_wrapper.FlagsFlagLowered), args[2].([]common.Address)) + }) + return _c +} + +func (_c *Flags_WatchFlagLowered_Call) Return(_a0 event.Subscription, _a1 error) *Flags_WatchFlagLowered_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Flags_WatchFlagLowered_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *flags_wrapper.FlagsFlagLowered, []common.Address) (event.Subscription, error)) *Flags_WatchFlagLowered_Call { + _c.Call.Return(run) + return _c +} + // WatchFlagRaised provides a mock function with given fields: opts, sink, subject func (_m *Flags) WatchFlagRaised(opts *bind.WatchOpts, sink chan<- *flags_wrapper.FlagsFlagRaised, subject []common.Address) (event.Subscription, error) { ret := _m.Called(opts, sink, subject) @@ -1236,6 +2387,36 @@ func (_m *Flags) WatchFlagRaised(opts *bind.WatchOpts, sink chan<- *flags_wrappe return r0, r1 } +// Flags_WatchFlagRaised_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchFlagRaised' +type Flags_WatchFlagRaised_Call struct { + *mock.Call +} + +// WatchFlagRaised is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *flags_wrapper.FlagsFlagRaised +// - subject []common.Address +func (_e *Flags_Expecter) WatchFlagRaised(opts interface{}, sink interface{}, subject interface{}) *Flags_WatchFlagRaised_Call { + return &Flags_WatchFlagRaised_Call{Call: _e.mock.On("WatchFlagRaised", opts, sink, subject)} +} + +func (_c *Flags_WatchFlagRaised_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *flags_wrapper.FlagsFlagRaised, subject []common.Address)) *Flags_WatchFlagRaised_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *flags_wrapper.FlagsFlagRaised), args[2].([]common.Address)) + }) + return _c +} + +func (_c *Flags_WatchFlagRaised_Call) Return(_a0 event.Subscription, _a1 error) *Flags_WatchFlagRaised_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Flags_WatchFlagRaised_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *flags_wrapper.FlagsFlagRaised, []common.Address) (event.Subscription, error)) *Flags_WatchFlagRaised_Call { + _c.Call.Return(run) + return _c +} + // WatchOwnershipTransferRequested provides a mock function with given fields: opts, sink, from, to func (_m *Flags) WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *flags_wrapper.FlagsOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) { ret := _m.Called(opts, sink, from, to) @@ -1266,6 +2447,37 @@ func (_m *Flags) WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan return r0, r1 } +// Flags_WatchOwnershipTransferRequested_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchOwnershipTransferRequested' +type Flags_WatchOwnershipTransferRequested_Call struct { + *mock.Call +} + +// WatchOwnershipTransferRequested is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *flags_wrapper.FlagsOwnershipTransferRequested +// - from []common.Address +// - to []common.Address +func (_e *Flags_Expecter) WatchOwnershipTransferRequested(opts interface{}, sink interface{}, from interface{}, to interface{}) *Flags_WatchOwnershipTransferRequested_Call { + return &Flags_WatchOwnershipTransferRequested_Call{Call: _e.mock.On("WatchOwnershipTransferRequested", opts, sink, from, to)} +} + +func (_c *Flags_WatchOwnershipTransferRequested_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *flags_wrapper.FlagsOwnershipTransferRequested, from []common.Address, to []common.Address)) *Flags_WatchOwnershipTransferRequested_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *flags_wrapper.FlagsOwnershipTransferRequested), args[2].([]common.Address), args[3].([]common.Address)) + }) + return _c +} + +func (_c *Flags_WatchOwnershipTransferRequested_Call) Return(_a0 event.Subscription, _a1 error) *Flags_WatchOwnershipTransferRequested_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Flags_WatchOwnershipTransferRequested_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *flags_wrapper.FlagsOwnershipTransferRequested, []common.Address, []common.Address) (event.Subscription, error)) *Flags_WatchOwnershipTransferRequested_Call { + _c.Call.Return(run) + return _c +} + // WatchOwnershipTransferred provides a mock function with given fields: opts, sink, from, to func (_m *Flags) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *flags_wrapper.FlagsOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) { ret := _m.Called(opts, sink, from, to) @@ -1296,6 +2508,37 @@ func (_m *Flags) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *fl return r0, r1 } +// Flags_WatchOwnershipTransferred_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchOwnershipTransferred' +type Flags_WatchOwnershipTransferred_Call struct { + *mock.Call +} + +// WatchOwnershipTransferred is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *flags_wrapper.FlagsOwnershipTransferred +// - from []common.Address +// - to []common.Address +func (_e *Flags_Expecter) WatchOwnershipTransferred(opts interface{}, sink interface{}, from interface{}, to interface{}) *Flags_WatchOwnershipTransferred_Call { + return &Flags_WatchOwnershipTransferred_Call{Call: _e.mock.On("WatchOwnershipTransferred", opts, sink, from, to)} +} + +func (_c *Flags_WatchOwnershipTransferred_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *flags_wrapper.FlagsOwnershipTransferred, from []common.Address, to []common.Address)) *Flags_WatchOwnershipTransferred_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *flags_wrapper.FlagsOwnershipTransferred), args[2].([]common.Address), args[3].([]common.Address)) + }) + return _c +} + +func (_c *Flags_WatchOwnershipTransferred_Call) Return(_a0 event.Subscription, _a1 error) *Flags_WatchOwnershipTransferred_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Flags_WatchOwnershipTransferred_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *flags_wrapper.FlagsOwnershipTransferred, []common.Address, []common.Address) (event.Subscription, error)) *Flags_WatchOwnershipTransferred_Call { + _c.Call.Return(run) + return _c +} + // WatchRaisingAccessControllerUpdated provides a mock function with given fields: opts, sink, previous, current func (_m *Flags) WatchRaisingAccessControllerUpdated(opts *bind.WatchOpts, sink chan<- *flags_wrapper.FlagsRaisingAccessControllerUpdated, previous []common.Address, current []common.Address) (event.Subscription, error) { ret := _m.Called(opts, sink, previous, current) @@ -1326,6 +2569,37 @@ func (_m *Flags) WatchRaisingAccessControllerUpdated(opts *bind.WatchOpts, sink return r0, r1 } +// Flags_WatchRaisingAccessControllerUpdated_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchRaisingAccessControllerUpdated' +type Flags_WatchRaisingAccessControllerUpdated_Call struct { + *mock.Call +} + +// WatchRaisingAccessControllerUpdated is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *flags_wrapper.FlagsRaisingAccessControllerUpdated +// - previous []common.Address +// - current []common.Address +func (_e *Flags_Expecter) WatchRaisingAccessControllerUpdated(opts interface{}, sink interface{}, previous interface{}, current interface{}) *Flags_WatchRaisingAccessControllerUpdated_Call { + return &Flags_WatchRaisingAccessControllerUpdated_Call{Call: _e.mock.On("WatchRaisingAccessControllerUpdated", opts, sink, previous, current)} +} + +func (_c *Flags_WatchRaisingAccessControllerUpdated_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *flags_wrapper.FlagsRaisingAccessControllerUpdated, previous []common.Address, current []common.Address)) *Flags_WatchRaisingAccessControllerUpdated_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *flags_wrapper.FlagsRaisingAccessControllerUpdated), args[2].([]common.Address), args[3].([]common.Address)) + }) + return _c +} + +func (_c *Flags_WatchRaisingAccessControllerUpdated_Call) Return(_a0 event.Subscription, _a1 error) *Flags_WatchRaisingAccessControllerUpdated_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Flags_WatchRaisingAccessControllerUpdated_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *flags_wrapper.FlagsRaisingAccessControllerUpdated, []common.Address, []common.Address) (event.Subscription, error)) *Flags_WatchRaisingAccessControllerUpdated_Call { + _c.Call.Return(run) + return _c +} + // WatchRemovedAccess provides a mock function with given fields: opts, sink func (_m *Flags) WatchRemovedAccess(opts *bind.WatchOpts, sink chan<- *flags_wrapper.FlagsRemovedAccess) (event.Subscription, error) { ret := _m.Called(opts, sink) @@ -1356,6 +2630,35 @@ func (_m *Flags) WatchRemovedAccess(opts *bind.WatchOpts, sink chan<- *flags_wra return r0, r1 } +// Flags_WatchRemovedAccess_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchRemovedAccess' +type Flags_WatchRemovedAccess_Call struct { + *mock.Call +} + +// WatchRemovedAccess is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *flags_wrapper.FlagsRemovedAccess +func (_e *Flags_Expecter) WatchRemovedAccess(opts interface{}, sink interface{}) *Flags_WatchRemovedAccess_Call { + return &Flags_WatchRemovedAccess_Call{Call: _e.mock.On("WatchRemovedAccess", opts, sink)} +} + +func (_c *Flags_WatchRemovedAccess_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *flags_wrapper.FlagsRemovedAccess)) *Flags_WatchRemovedAccess_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *flags_wrapper.FlagsRemovedAccess)) + }) + return _c +} + +func (_c *Flags_WatchRemovedAccess_Call) Return(_a0 event.Subscription, _a1 error) *Flags_WatchRemovedAccess_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Flags_WatchRemovedAccess_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *flags_wrapper.FlagsRemovedAccess) (event.Subscription, error)) *Flags_WatchRemovedAccess_Call { + _c.Call.Return(run) + return _c +} + // NewFlags creates a new instance of Flags. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewFlags(t interface { diff --git a/core/internal/mocks/flux_aggregator.go b/core/internal/mocks/flux_aggregator.go index 1501e36e941..84c456d1eaa 100644 --- a/core/internal/mocks/flux_aggregator.go +++ b/core/internal/mocks/flux_aggregator.go @@ -24,6 +24,14 @@ type FluxAggregator struct { mock.Mock } +type FluxAggregator_Expecter struct { + mock *mock.Mock +} + +func (_m *FluxAggregator) EXPECT() *FluxAggregator_Expecter { + return &FluxAggregator_Expecter{mock: &_m.Mock} +} + // AcceptAdmin provides a mock function with given fields: opts, _oracle func (_m *FluxAggregator) AcceptAdmin(opts *bind.TransactOpts, _oracle common.Address) (*types.Transaction, error) { ret := _m.Called(opts, _oracle) @@ -54,6 +62,35 @@ func (_m *FluxAggregator) AcceptAdmin(opts *bind.TransactOpts, _oracle common.Ad return r0, r1 } +// FluxAggregator_AcceptAdmin_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AcceptAdmin' +type FluxAggregator_AcceptAdmin_Call struct { + *mock.Call +} + +// AcceptAdmin is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - _oracle common.Address +func (_e *FluxAggregator_Expecter) AcceptAdmin(opts interface{}, _oracle interface{}) *FluxAggregator_AcceptAdmin_Call { + return &FluxAggregator_AcceptAdmin_Call{Call: _e.mock.On("AcceptAdmin", opts, _oracle)} +} + +func (_c *FluxAggregator_AcceptAdmin_Call) Run(run func(opts *bind.TransactOpts, _oracle common.Address)) *FluxAggregator_AcceptAdmin_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].(common.Address)) + }) + return _c +} + +func (_c *FluxAggregator_AcceptAdmin_Call) Return(_a0 *types.Transaction, _a1 error) *FluxAggregator_AcceptAdmin_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FluxAggregator_AcceptAdmin_Call) RunAndReturn(run func(*bind.TransactOpts, common.Address) (*types.Transaction, error)) *FluxAggregator_AcceptAdmin_Call { + _c.Call.Return(run) + return _c +} + // AcceptOwnership provides a mock function with given fields: opts func (_m *FluxAggregator) AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { ret := _m.Called(opts) @@ -84,6 +121,34 @@ func (_m *FluxAggregator) AcceptOwnership(opts *bind.TransactOpts) (*types.Trans return r0, r1 } +// FluxAggregator_AcceptOwnership_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AcceptOwnership' +type FluxAggregator_AcceptOwnership_Call struct { + *mock.Call +} + +// AcceptOwnership is a helper method to define mock.On call +// - opts *bind.TransactOpts +func (_e *FluxAggregator_Expecter) AcceptOwnership(opts interface{}) *FluxAggregator_AcceptOwnership_Call { + return &FluxAggregator_AcceptOwnership_Call{Call: _e.mock.On("AcceptOwnership", opts)} +} + +func (_c *FluxAggregator_AcceptOwnership_Call) Run(run func(opts *bind.TransactOpts)) *FluxAggregator_AcceptOwnership_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts)) + }) + return _c +} + +func (_c *FluxAggregator_AcceptOwnership_Call) Return(_a0 *types.Transaction, _a1 error) *FluxAggregator_AcceptOwnership_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FluxAggregator_AcceptOwnership_Call) RunAndReturn(run func(*bind.TransactOpts) (*types.Transaction, error)) *FluxAggregator_AcceptOwnership_Call { + _c.Call.Return(run) + return _c +} + // Address provides a mock function with given fields: func (_m *FluxAggregator) Address() common.Address { ret := _m.Called() @@ -104,6 +169,33 @@ func (_m *FluxAggregator) Address() common.Address { return r0 } +// FluxAggregator_Address_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Address' +type FluxAggregator_Address_Call struct { + *mock.Call +} + +// Address is a helper method to define mock.On call +func (_e *FluxAggregator_Expecter) Address() *FluxAggregator_Address_Call { + return &FluxAggregator_Address_Call{Call: _e.mock.On("Address")} +} + +func (_c *FluxAggregator_Address_Call) Run(run func()) *FluxAggregator_Address_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *FluxAggregator_Address_Call) Return(_a0 common.Address) *FluxAggregator_Address_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *FluxAggregator_Address_Call) RunAndReturn(run func() common.Address) *FluxAggregator_Address_Call { + _c.Call.Return(run) + return _c +} + // AllocatedFunds provides a mock function with given fields: opts func (_m *FluxAggregator) AllocatedFunds(opts *bind.CallOpts) (*big.Int, error) { ret := _m.Called(opts) @@ -134,6 +226,34 @@ func (_m *FluxAggregator) AllocatedFunds(opts *bind.CallOpts) (*big.Int, error) return r0, r1 } +// FluxAggregator_AllocatedFunds_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AllocatedFunds' +type FluxAggregator_AllocatedFunds_Call struct { + *mock.Call +} + +// AllocatedFunds is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *FluxAggregator_Expecter) AllocatedFunds(opts interface{}) *FluxAggregator_AllocatedFunds_Call { + return &FluxAggregator_AllocatedFunds_Call{Call: _e.mock.On("AllocatedFunds", opts)} +} + +func (_c *FluxAggregator_AllocatedFunds_Call) Run(run func(opts *bind.CallOpts)) *FluxAggregator_AllocatedFunds_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *FluxAggregator_AllocatedFunds_Call) Return(_a0 *big.Int, _a1 error) *FluxAggregator_AllocatedFunds_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FluxAggregator_AllocatedFunds_Call) RunAndReturn(run func(*bind.CallOpts) (*big.Int, error)) *FluxAggregator_AllocatedFunds_Call { + _c.Call.Return(run) + return _c +} + // AvailableFunds provides a mock function with given fields: opts func (_m *FluxAggregator) AvailableFunds(opts *bind.CallOpts) (*big.Int, error) { ret := _m.Called(opts) @@ -164,6 +284,34 @@ func (_m *FluxAggregator) AvailableFunds(opts *bind.CallOpts) (*big.Int, error) return r0, r1 } +// FluxAggregator_AvailableFunds_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AvailableFunds' +type FluxAggregator_AvailableFunds_Call struct { + *mock.Call +} + +// AvailableFunds is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *FluxAggregator_Expecter) AvailableFunds(opts interface{}) *FluxAggregator_AvailableFunds_Call { + return &FluxAggregator_AvailableFunds_Call{Call: _e.mock.On("AvailableFunds", opts)} +} + +func (_c *FluxAggregator_AvailableFunds_Call) Run(run func(opts *bind.CallOpts)) *FluxAggregator_AvailableFunds_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *FluxAggregator_AvailableFunds_Call) Return(_a0 *big.Int, _a1 error) *FluxAggregator_AvailableFunds_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FluxAggregator_AvailableFunds_Call) RunAndReturn(run func(*bind.CallOpts) (*big.Int, error)) *FluxAggregator_AvailableFunds_Call { + _c.Call.Return(run) + return _c +} + // ChangeOracles provides a mock function with given fields: opts, _removed, _added, _addedAdmins, _minSubmissions, _maxSubmissions, _restartDelay func (_m *FluxAggregator) ChangeOracles(opts *bind.TransactOpts, _removed []common.Address, _added []common.Address, _addedAdmins []common.Address, _minSubmissions uint32, _maxSubmissions uint32, _restartDelay uint32) (*types.Transaction, error) { ret := _m.Called(opts, _removed, _added, _addedAdmins, _minSubmissions, _maxSubmissions, _restartDelay) @@ -194,6 +342,40 @@ func (_m *FluxAggregator) ChangeOracles(opts *bind.TransactOpts, _removed []comm return r0, r1 } +// FluxAggregator_ChangeOracles_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ChangeOracles' +type FluxAggregator_ChangeOracles_Call struct { + *mock.Call +} + +// ChangeOracles is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - _removed []common.Address +// - _added []common.Address +// - _addedAdmins []common.Address +// - _minSubmissions uint32 +// - _maxSubmissions uint32 +// - _restartDelay uint32 +func (_e *FluxAggregator_Expecter) ChangeOracles(opts interface{}, _removed interface{}, _added interface{}, _addedAdmins interface{}, _minSubmissions interface{}, _maxSubmissions interface{}, _restartDelay interface{}) *FluxAggregator_ChangeOracles_Call { + return &FluxAggregator_ChangeOracles_Call{Call: _e.mock.On("ChangeOracles", opts, _removed, _added, _addedAdmins, _minSubmissions, _maxSubmissions, _restartDelay)} +} + +func (_c *FluxAggregator_ChangeOracles_Call) Run(run func(opts *bind.TransactOpts, _removed []common.Address, _added []common.Address, _addedAdmins []common.Address, _minSubmissions uint32, _maxSubmissions uint32, _restartDelay uint32)) *FluxAggregator_ChangeOracles_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].([]common.Address), args[2].([]common.Address), args[3].([]common.Address), args[4].(uint32), args[5].(uint32), args[6].(uint32)) + }) + return _c +} + +func (_c *FluxAggregator_ChangeOracles_Call) Return(_a0 *types.Transaction, _a1 error) *FluxAggregator_ChangeOracles_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FluxAggregator_ChangeOracles_Call) RunAndReturn(run func(*bind.TransactOpts, []common.Address, []common.Address, []common.Address, uint32, uint32, uint32) (*types.Transaction, error)) *FluxAggregator_ChangeOracles_Call { + _c.Call.Return(run) + return _c +} + // Decimals provides a mock function with given fields: opts func (_m *FluxAggregator) Decimals(opts *bind.CallOpts) (uint8, error) { ret := _m.Called(opts) @@ -222,6 +404,34 @@ func (_m *FluxAggregator) Decimals(opts *bind.CallOpts) (uint8, error) { return r0, r1 } +// FluxAggregator_Decimals_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Decimals' +type FluxAggregator_Decimals_Call struct { + *mock.Call +} + +// Decimals is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *FluxAggregator_Expecter) Decimals(opts interface{}) *FluxAggregator_Decimals_Call { + return &FluxAggregator_Decimals_Call{Call: _e.mock.On("Decimals", opts)} +} + +func (_c *FluxAggregator_Decimals_Call) Run(run func(opts *bind.CallOpts)) *FluxAggregator_Decimals_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *FluxAggregator_Decimals_Call) Return(_a0 uint8, _a1 error) *FluxAggregator_Decimals_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FluxAggregator_Decimals_Call) RunAndReturn(run func(*bind.CallOpts) (uint8, error)) *FluxAggregator_Decimals_Call { + _c.Call.Return(run) + return _c +} + // Description provides a mock function with given fields: opts func (_m *FluxAggregator) Description(opts *bind.CallOpts) (string, error) { ret := _m.Called(opts) @@ -250,6 +460,34 @@ func (_m *FluxAggregator) Description(opts *bind.CallOpts) (string, error) { return r0, r1 } +// FluxAggregator_Description_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Description' +type FluxAggregator_Description_Call struct { + *mock.Call +} + +// Description is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *FluxAggregator_Expecter) Description(opts interface{}) *FluxAggregator_Description_Call { + return &FluxAggregator_Description_Call{Call: _e.mock.On("Description", opts)} +} + +func (_c *FluxAggregator_Description_Call) Run(run func(opts *bind.CallOpts)) *FluxAggregator_Description_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *FluxAggregator_Description_Call) Return(_a0 string, _a1 error) *FluxAggregator_Description_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FluxAggregator_Description_Call) RunAndReturn(run func(*bind.CallOpts) (string, error)) *FluxAggregator_Description_Call { + _c.Call.Return(run) + return _c +} + // FilterAnswerUpdated provides a mock function with given fields: opts, current, roundId func (_m *FluxAggregator) FilterAnswerUpdated(opts *bind.FilterOpts, current []*big.Int, roundId []*big.Int) (*flux_aggregator_wrapper.FluxAggregatorAnswerUpdatedIterator, error) { ret := _m.Called(opts, current, roundId) @@ -280,6 +518,36 @@ func (_m *FluxAggregator) FilterAnswerUpdated(opts *bind.FilterOpts, current []* return r0, r1 } +// FluxAggregator_FilterAnswerUpdated_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterAnswerUpdated' +type FluxAggregator_FilterAnswerUpdated_Call struct { + *mock.Call +} + +// FilterAnswerUpdated is a helper method to define mock.On call +// - opts *bind.FilterOpts +// - current []*big.Int +// - roundId []*big.Int +func (_e *FluxAggregator_Expecter) FilterAnswerUpdated(opts interface{}, current interface{}, roundId interface{}) *FluxAggregator_FilterAnswerUpdated_Call { + return &FluxAggregator_FilterAnswerUpdated_Call{Call: _e.mock.On("FilterAnswerUpdated", opts, current, roundId)} +} + +func (_c *FluxAggregator_FilterAnswerUpdated_Call) Run(run func(opts *bind.FilterOpts, current []*big.Int, roundId []*big.Int)) *FluxAggregator_FilterAnswerUpdated_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts), args[1].([]*big.Int), args[2].([]*big.Int)) + }) + return _c +} + +func (_c *FluxAggregator_FilterAnswerUpdated_Call) Return(_a0 *flux_aggregator_wrapper.FluxAggregatorAnswerUpdatedIterator, _a1 error) *FluxAggregator_FilterAnswerUpdated_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FluxAggregator_FilterAnswerUpdated_Call) RunAndReturn(run func(*bind.FilterOpts, []*big.Int, []*big.Int) (*flux_aggregator_wrapper.FluxAggregatorAnswerUpdatedIterator, error)) *FluxAggregator_FilterAnswerUpdated_Call { + _c.Call.Return(run) + return _c +} + // FilterAvailableFundsUpdated provides a mock function with given fields: opts, amount func (_m *FluxAggregator) FilterAvailableFundsUpdated(opts *bind.FilterOpts, amount []*big.Int) (*flux_aggregator_wrapper.FluxAggregatorAvailableFundsUpdatedIterator, error) { ret := _m.Called(opts, amount) @@ -310,6 +578,35 @@ func (_m *FluxAggregator) FilterAvailableFundsUpdated(opts *bind.FilterOpts, amo return r0, r1 } +// FluxAggregator_FilterAvailableFundsUpdated_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterAvailableFundsUpdated' +type FluxAggregator_FilterAvailableFundsUpdated_Call struct { + *mock.Call +} + +// FilterAvailableFundsUpdated is a helper method to define mock.On call +// - opts *bind.FilterOpts +// - amount []*big.Int +func (_e *FluxAggregator_Expecter) FilterAvailableFundsUpdated(opts interface{}, amount interface{}) *FluxAggregator_FilterAvailableFundsUpdated_Call { + return &FluxAggregator_FilterAvailableFundsUpdated_Call{Call: _e.mock.On("FilterAvailableFundsUpdated", opts, amount)} +} + +func (_c *FluxAggregator_FilterAvailableFundsUpdated_Call) Run(run func(opts *bind.FilterOpts, amount []*big.Int)) *FluxAggregator_FilterAvailableFundsUpdated_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts), args[1].([]*big.Int)) + }) + return _c +} + +func (_c *FluxAggregator_FilterAvailableFundsUpdated_Call) Return(_a0 *flux_aggregator_wrapper.FluxAggregatorAvailableFundsUpdatedIterator, _a1 error) *FluxAggregator_FilterAvailableFundsUpdated_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FluxAggregator_FilterAvailableFundsUpdated_Call) RunAndReturn(run func(*bind.FilterOpts, []*big.Int) (*flux_aggregator_wrapper.FluxAggregatorAvailableFundsUpdatedIterator, error)) *FluxAggregator_FilterAvailableFundsUpdated_Call { + _c.Call.Return(run) + return _c +} + // FilterNewRound provides a mock function with given fields: opts, roundId, startedBy func (_m *FluxAggregator) FilterNewRound(opts *bind.FilterOpts, roundId []*big.Int, startedBy []common.Address) (*flux_aggregator_wrapper.FluxAggregatorNewRoundIterator, error) { ret := _m.Called(opts, roundId, startedBy) @@ -340,6 +637,36 @@ func (_m *FluxAggregator) FilterNewRound(opts *bind.FilterOpts, roundId []*big.I return r0, r1 } +// FluxAggregator_FilterNewRound_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterNewRound' +type FluxAggregator_FilterNewRound_Call struct { + *mock.Call +} + +// FilterNewRound is a helper method to define mock.On call +// - opts *bind.FilterOpts +// - roundId []*big.Int +// - startedBy []common.Address +func (_e *FluxAggregator_Expecter) FilterNewRound(opts interface{}, roundId interface{}, startedBy interface{}) *FluxAggregator_FilterNewRound_Call { + return &FluxAggregator_FilterNewRound_Call{Call: _e.mock.On("FilterNewRound", opts, roundId, startedBy)} +} + +func (_c *FluxAggregator_FilterNewRound_Call) Run(run func(opts *bind.FilterOpts, roundId []*big.Int, startedBy []common.Address)) *FluxAggregator_FilterNewRound_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts), args[1].([]*big.Int), args[2].([]common.Address)) + }) + return _c +} + +func (_c *FluxAggregator_FilterNewRound_Call) Return(_a0 *flux_aggregator_wrapper.FluxAggregatorNewRoundIterator, _a1 error) *FluxAggregator_FilterNewRound_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FluxAggregator_FilterNewRound_Call) RunAndReturn(run func(*bind.FilterOpts, []*big.Int, []common.Address) (*flux_aggregator_wrapper.FluxAggregatorNewRoundIterator, error)) *FluxAggregator_FilterNewRound_Call { + _c.Call.Return(run) + return _c +} + // FilterOracleAdminUpdateRequested provides a mock function with given fields: opts, oracle func (_m *FluxAggregator) FilterOracleAdminUpdateRequested(opts *bind.FilterOpts, oracle []common.Address) (*flux_aggregator_wrapper.FluxAggregatorOracleAdminUpdateRequestedIterator, error) { ret := _m.Called(opts, oracle) @@ -370,6 +697,35 @@ func (_m *FluxAggregator) FilterOracleAdminUpdateRequested(opts *bind.FilterOpts return r0, r1 } +// FluxAggregator_FilterOracleAdminUpdateRequested_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterOracleAdminUpdateRequested' +type FluxAggregator_FilterOracleAdminUpdateRequested_Call struct { + *mock.Call +} + +// FilterOracleAdminUpdateRequested is a helper method to define mock.On call +// - opts *bind.FilterOpts +// - oracle []common.Address +func (_e *FluxAggregator_Expecter) FilterOracleAdminUpdateRequested(opts interface{}, oracle interface{}) *FluxAggregator_FilterOracleAdminUpdateRequested_Call { + return &FluxAggregator_FilterOracleAdminUpdateRequested_Call{Call: _e.mock.On("FilterOracleAdminUpdateRequested", opts, oracle)} +} + +func (_c *FluxAggregator_FilterOracleAdminUpdateRequested_Call) Run(run func(opts *bind.FilterOpts, oracle []common.Address)) *FluxAggregator_FilterOracleAdminUpdateRequested_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts), args[1].([]common.Address)) + }) + return _c +} + +func (_c *FluxAggregator_FilterOracleAdminUpdateRequested_Call) Return(_a0 *flux_aggregator_wrapper.FluxAggregatorOracleAdminUpdateRequestedIterator, _a1 error) *FluxAggregator_FilterOracleAdminUpdateRequested_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FluxAggregator_FilterOracleAdminUpdateRequested_Call) RunAndReturn(run func(*bind.FilterOpts, []common.Address) (*flux_aggregator_wrapper.FluxAggregatorOracleAdminUpdateRequestedIterator, error)) *FluxAggregator_FilterOracleAdminUpdateRequested_Call { + _c.Call.Return(run) + return _c +} + // FilterOracleAdminUpdated provides a mock function with given fields: opts, oracle, newAdmin func (_m *FluxAggregator) FilterOracleAdminUpdated(opts *bind.FilterOpts, oracle []common.Address, newAdmin []common.Address) (*flux_aggregator_wrapper.FluxAggregatorOracleAdminUpdatedIterator, error) { ret := _m.Called(opts, oracle, newAdmin) @@ -400,6 +756,36 @@ func (_m *FluxAggregator) FilterOracleAdminUpdated(opts *bind.FilterOpts, oracle return r0, r1 } +// FluxAggregator_FilterOracleAdminUpdated_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterOracleAdminUpdated' +type FluxAggregator_FilterOracleAdminUpdated_Call struct { + *mock.Call +} + +// FilterOracleAdminUpdated is a helper method to define mock.On call +// - opts *bind.FilterOpts +// - oracle []common.Address +// - newAdmin []common.Address +func (_e *FluxAggregator_Expecter) FilterOracleAdminUpdated(opts interface{}, oracle interface{}, newAdmin interface{}) *FluxAggregator_FilterOracleAdminUpdated_Call { + return &FluxAggregator_FilterOracleAdminUpdated_Call{Call: _e.mock.On("FilterOracleAdminUpdated", opts, oracle, newAdmin)} +} + +func (_c *FluxAggregator_FilterOracleAdminUpdated_Call) Run(run func(opts *bind.FilterOpts, oracle []common.Address, newAdmin []common.Address)) *FluxAggregator_FilterOracleAdminUpdated_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts), args[1].([]common.Address), args[2].([]common.Address)) + }) + return _c +} + +func (_c *FluxAggregator_FilterOracleAdminUpdated_Call) Return(_a0 *flux_aggregator_wrapper.FluxAggregatorOracleAdminUpdatedIterator, _a1 error) *FluxAggregator_FilterOracleAdminUpdated_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FluxAggregator_FilterOracleAdminUpdated_Call) RunAndReturn(run func(*bind.FilterOpts, []common.Address, []common.Address) (*flux_aggregator_wrapper.FluxAggregatorOracleAdminUpdatedIterator, error)) *FluxAggregator_FilterOracleAdminUpdated_Call { + _c.Call.Return(run) + return _c +} + // FilterOraclePermissionsUpdated provides a mock function with given fields: opts, oracle, whitelisted func (_m *FluxAggregator) FilterOraclePermissionsUpdated(opts *bind.FilterOpts, oracle []common.Address, whitelisted []bool) (*flux_aggregator_wrapper.FluxAggregatorOraclePermissionsUpdatedIterator, error) { ret := _m.Called(opts, oracle, whitelisted) @@ -430,6 +816,36 @@ func (_m *FluxAggregator) FilterOraclePermissionsUpdated(opts *bind.FilterOpts, return r0, r1 } +// FluxAggregator_FilterOraclePermissionsUpdated_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterOraclePermissionsUpdated' +type FluxAggregator_FilterOraclePermissionsUpdated_Call struct { + *mock.Call +} + +// FilterOraclePermissionsUpdated is a helper method to define mock.On call +// - opts *bind.FilterOpts +// - oracle []common.Address +// - whitelisted []bool +func (_e *FluxAggregator_Expecter) FilterOraclePermissionsUpdated(opts interface{}, oracle interface{}, whitelisted interface{}) *FluxAggregator_FilterOraclePermissionsUpdated_Call { + return &FluxAggregator_FilterOraclePermissionsUpdated_Call{Call: _e.mock.On("FilterOraclePermissionsUpdated", opts, oracle, whitelisted)} +} + +func (_c *FluxAggregator_FilterOraclePermissionsUpdated_Call) Run(run func(opts *bind.FilterOpts, oracle []common.Address, whitelisted []bool)) *FluxAggregator_FilterOraclePermissionsUpdated_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts), args[1].([]common.Address), args[2].([]bool)) + }) + return _c +} + +func (_c *FluxAggregator_FilterOraclePermissionsUpdated_Call) Return(_a0 *flux_aggregator_wrapper.FluxAggregatorOraclePermissionsUpdatedIterator, _a1 error) *FluxAggregator_FilterOraclePermissionsUpdated_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FluxAggregator_FilterOraclePermissionsUpdated_Call) RunAndReturn(run func(*bind.FilterOpts, []common.Address, []bool) (*flux_aggregator_wrapper.FluxAggregatorOraclePermissionsUpdatedIterator, error)) *FluxAggregator_FilterOraclePermissionsUpdated_Call { + _c.Call.Return(run) + return _c +} + // FilterOwnershipTransferRequested provides a mock function with given fields: opts, from, to func (_m *FluxAggregator) FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*flux_aggregator_wrapper.FluxAggregatorOwnershipTransferRequestedIterator, error) { ret := _m.Called(opts, from, to) @@ -460,6 +876,36 @@ func (_m *FluxAggregator) FilterOwnershipTransferRequested(opts *bind.FilterOpts return r0, r1 } +// FluxAggregator_FilterOwnershipTransferRequested_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterOwnershipTransferRequested' +type FluxAggregator_FilterOwnershipTransferRequested_Call struct { + *mock.Call +} + +// FilterOwnershipTransferRequested is a helper method to define mock.On call +// - opts *bind.FilterOpts +// - from []common.Address +// - to []common.Address +func (_e *FluxAggregator_Expecter) FilterOwnershipTransferRequested(opts interface{}, from interface{}, to interface{}) *FluxAggregator_FilterOwnershipTransferRequested_Call { + return &FluxAggregator_FilterOwnershipTransferRequested_Call{Call: _e.mock.On("FilterOwnershipTransferRequested", opts, from, to)} +} + +func (_c *FluxAggregator_FilterOwnershipTransferRequested_Call) Run(run func(opts *bind.FilterOpts, from []common.Address, to []common.Address)) *FluxAggregator_FilterOwnershipTransferRequested_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts), args[1].([]common.Address), args[2].([]common.Address)) + }) + return _c +} + +func (_c *FluxAggregator_FilterOwnershipTransferRequested_Call) Return(_a0 *flux_aggregator_wrapper.FluxAggregatorOwnershipTransferRequestedIterator, _a1 error) *FluxAggregator_FilterOwnershipTransferRequested_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FluxAggregator_FilterOwnershipTransferRequested_Call) RunAndReturn(run func(*bind.FilterOpts, []common.Address, []common.Address) (*flux_aggregator_wrapper.FluxAggregatorOwnershipTransferRequestedIterator, error)) *FluxAggregator_FilterOwnershipTransferRequested_Call { + _c.Call.Return(run) + return _c +} + // FilterOwnershipTransferred provides a mock function with given fields: opts, from, to func (_m *FluxAggregator) FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*flux_aggregator_wrapper.FluxAggregatorOwnershipTransferredIterator, error) { ret := _m.Called(opts, from, to) @@ -490,6 +936,36 @@ func (_m *FluxAggregator) FilterOwnershipTransferred(opts *bind.FilterOpts, from return r0, r1 } +// FluxAggregator_FilterOwnershipTransferred_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterOwnershipTransferred' +type FluxAggregator_FilterOwnershipTransferred_Call struct { + *mock.Call +} + +// FilterOwnershipTransferred is a helper method to define mock.On call +// - opts *bind.FilterOpts +// - from []common.Address +// - to []common.Address +func (_e *FluxAggregator_Expecter) FilterOwnershipTransferred(opts interface{}, from interface{}, to interface{}) *FluxAggregator_FilterOwnershipTransferred_Call { + return &FluxAggregator_FilterOwnershipTransferred_Call{Call: _e.mock.On("FilterOwnershipTransferred", opts, from, to)} +} + +func (_c *FluxAggregator_FilterOwnershipTransferred_Call) Run(run func(opts *bind.FilterOpts, from []common.Address, to []common.Address)) *FluxAggregator_FilterOwnershipTransferred_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts), args[1].([]common.Address), args[2].([]common.Address)) + }) + return _c +} + +func (_c *FluxAggregator_FilterOwnershipTransferred_Call) Return(_a0 *flux_aggregator_wrapper.FluxAggregatorOwnershipTransferredIterator, _a1 error) *FluxAggregator_FilterOwnershipTransferred_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FluxAggregator_FilterOwnershipTransferred_Call) RunAndReturn(run func(*bind.FilterOpts, []common.Address, []common.Address) (*flux_aggregator_wrapper.FluxAggregatorOwnershipTransferredIterator, error)) *FluxAggregator_FilterOwnershipTransferred_Call { + _c.Call.Return(run) + return _c +} + // FilterRequesterPermissionsSet provides a mock function with given fields: opts, requester func (_m *FluxAggregator) FilterRequesterPermissionsSet(opts *bind.FilterOpts, requester []common.Address) (*flux_aggregator_wrapper.FluxAggregatorRequesterPermissionsSetIterator, error) { ret := _m.Called(opts, requester) @@ -520,6 +996,35 @@ func (_m *FluxAggregator) FilterRequesterPermissionsSet(opts *bind.FilterOpts, r return r0, r1 } +// FluxAggregator_FilterRequesterPermissionsSet_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterRequesterPermissionsSet' +type FluxAggregator_FilterRequesterPermissionsSet_Call struct { + *mock.Call +} + +// FilterRequesterPermissionsSet is a helper method to define mock.On call +// - opts *bind.FilterOpts +// - requester []common.Address +func (_e *FluxAggregator_Expecter) FilterRequesterPermissionsSet(opts interface{}, requester interface{}) *FluxAggregator_FilterRequesterPermissionsSet_Call { + return &FluxAggregator_FilterRequesterPermissionsSet_Call{Call: _e.mock.On("FilterRequesterPermissionsSet", opts, requester)} +} + +func (_c *FluxAggregator_FilterRequesterPermissionsSet_Call) Run(run func(opts *bind.FilterOpts, requester []common.Address)) *FluxAggregator_FilterRequesterPermissionsSet_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts), args[1].([]common.Address)) + }) + return _c +} + +func (_c *FluxAggregator_FilterRequesterPermissionsSet_Call) Return(_a0 *flux_aggregator_wrapper.FluxAggregatorRequesterPermissionsSetIterator, _a1 error) *FluxAggregator_FilterRequesterPermissionsSet_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FluxAggregator_FilterRequesterPermissionsSet_Call) RunAndReturn(run func(*bind.FilterOpts, []common.Address) (*flux_aggregator_wrapper.FluxAggregatorRequesterPermissionsSetIterator, error)) *FluxAggregator_FilterRequesterPermissionsSet_Call { + _c.Call.Return(run) + return _c +} + // FilterRoundDetailsUpdated provides a mock function with given fields: opts, paymentAmount, minSubmissionCount, maxSubmissionCount func (_m *FluxAggregator) FilterRoundDetailsUpdated(opts *bind.FilterOpts, paymentAmount []*big.Int, minSubmissionCount []uint32, maxSubmissionCount []uint32) (*flux_aggregator_wrapper.FluxAggregatorRoundDetailsUpdatedIterator, error) { ret := _m.Called(opts, paymentAmount, minSubmissionCount, maxSubmissionCount) @@ -550,6 +1055,37 @@ func (_m *FluxAggregator) FilterRoundDetailsUpdated(opts *bind.FilterOpts, payme return r0, r1 } +// FluxAggregator_FilterRoundDetailsUpdated_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterRoundDetailsUpdated' +type FluxAggregator_FilterRoundDetailsUpdated_Call struct { + *mock.Call +} + +// FilterRoundDetailsUpdated is a helper method to define mock.On call +// - opts *bind.FilterOpts +// - paymentAmount []*big.Int +// - minSubmissionCount []uint32 +// - maxSubmissionCount []uint32 +func (_e *FluxAggregator_Expecter) FilterRoundDetailsUpdated(opts interface{}, paymentAmount interface{}, minSubmissionCount interface{}, maxSubmissionCount interface{}) *FluxAggregator_FilterRoundDetailsUpdated_Call { + return &FluxAggregator_FilterRoundDetailsUpdated_Call{Call: _e.mock.On("FilterRoundDetailsUpdated", opts, paymentAmount, minSubmissionCount, maxSubmissionCount)} +} + +func (_c *FluxAggregator_FilterRoundDetailsUpdated_Call) Run(run func(opts *bind.FilterOpts, paymentAmount []*big.Int, minSubmissionCount []uint32, maxSubmissionCount []uint32)) *FluxAggregator_FilterRoundDetailsUpdated_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts), args[1].([]*big.Int), args[2].([]uint32), args[3].([]uint32)) + }) + return _c +} + +func (_c *FluxAggregator_FilterRoundDetailsUpdated_Call) Return(_a0 *flux_aggregator_wrapper.FluxAggregatorRoundDetailsUpdatedIterator, _a1 error) *FluxAggregator_FilterRoundDetailsUpdated_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FluxAggregator_FilterRoundDetailsUpdated_Call) RunAndReturn(run func(*bind.FilterOpts, []*big.Int, []uint32, []uint32) (*flux_aggregator_wrapper.FluxAggregatorRoundDetailsUpdatedIterator, error)) *FluxAggregator_FilterRoundDetailsUpdated_Call { + _c.Call.Return(run) + return _c +} + // FilterSubmissionReceived provides a mock function with given fields: opts, submission, round, oracle func (_m *FluxAggregator) FilterSubmissionReceived(opts *bind.FilterOpts, submission []*big.Int, round []uint32, oracle []common.Address) (*flux_aggregator_wrapper.FluxAggregatorSubmissionReceivedIterator, error) { ret := _m.Called(opts, submission, round, oracle) @@ -580,6 +1116,37 @@ func (_m *FluxAggregator) FilterSubmissionReceived(opts *bind.FilterOpts, submis return r0, r1 } +// FluxAggregator_FilterSubmissionReceived_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterSubmissionReceived' +type FluxAggregator_FilterSubmissionReceived_Call struct { + *mock.Call +} + +// FilterSubmissionReceived is a helper method to define mock.On call +// - opts *bind.FilterOpts +// - submission []*big.Int +// - round []uint32 +// - oracle []common.Address +func (_e *FluxAggregator_Expecter) FilterSubmissionReceived(opts interface{}, submission interface{}, round interface{}, oracle interface{}) *FluxAggregator_FilterSubmissionReceived_Call { + return &FluxAggregator_FilterSubmissionReceived_Call{Call: _e.mock.On("FilterSubmissionReceived", opts, submission, round, oracle)} +} + +func (_c *FluxAggregator_FilterSubmissionReceived_Call) Run(run func(opts *bind.FilterOpts, submission []*big.Int, round []uint32, oracle []common.Address)) *FluxAggregator_FilterSubmissionReceived_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts), args[1].([]*big.Int), args[2].([]uint32), args[3].([]common.Address)) + }) + return _c +} + +func (_c *FluxAggregator_FilterSubmissionReceived_Call) Return(_a0 *flux_aggregator_wrapper.FluxAggregatorSubmissionReceivedIterator, _a1 error) *FluxAggregator_FilterSubmissionReceived_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FluxAggregator_FilterSubmissionReceived_Call) RunAndReturn(run func(*bind.FilterOpts, []*big.Int, []uint32, []common.Address) (*flux_aggregator_wrapper.FluxAggregatorSubmissionReceivedIterator, error)) *FluxAggregator_FilterSubmissionReceived_Call { + _c.Call.Return(run) + return _c +} + // FilterValidatorUpdated provides a mock function with given fields: opts, previous, current func (_m *FluxAggregator) FilterValidatorUpdated(opts *bind.FilterOpts, previous []common.Address, current []common.Address) (*flux_aggregator_wrapper.FluxAggregatorValidatorUpdatedIterator, error) { ret := _m.Called(opts, previous, current) @@ -610,6 +1177,36 @@ func (_m *FluxAggregator) FilterValidatorUpdated(opts *bind.FilterOpts, previous return r0, r1 } +// FluxAggregator_FilterValidatorUpdated_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterValidatorUpdated' +type FluxAggregator_FilterValidatorUpdated_Call struct { + *mock.Call +} + +// FilterValidatorUpdated is a helper method to define mock.On call +// - opts *bind.FilterOpts +// - previous []common.Address +// - current []common.Address +func (_e *FluxAggregator_Expecter) FilterValidatorUpdated(opts interface{}, previous interface{}, current interface{}) *FluxAggregator_FilterValidatorUpdated_Call { + return &FluxAggregator_FilterValidatorUpdated_Call{Call: _e.mock.On("FilterValidatorUpdated", opts, previous, current)} +} + +func (_c *FluxAggregator_FilterValidatorUpdated_Call) Run(run func(opts *bind.FilterOpts, previous []common.Address, current []common.Address)) *FluxAggregator_FilterValidatorUpdated_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts), args[1].([]common.Address), args[2].([]common.Address)) + }) + return _c +} + +func (_c *FluxAggregator_FilterValidatorUpdated_Call) Return(_a0 *flux_aggregator_wrapper.FluxAggregatorValidatorUpdatedIterator, _a1 error) *FluxAggregator_FilterValidatorUpdated_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FluxAggregator_FilterValidatorUpdated_Call) RunAndReturn(run func(*bind.FilterOpts, []common.Address, []common.Address) (*flux_aggregator_wrapper.FluxAggregatorValidatorUpdatedIterator, error)) *FluxAggregator_FilterValidatorUpdated_Call { + _c.Call.Return(run) + return _c +} + // GetAdmin provides a mock function with given fields: opts, _oracle func (_m *FluxAggregator) GetAdmin(opts *bind.CallOpts, _oracle common.Address) (common.Address, error) { ret := _m.Called(opts, _oracle) @@ -640,6 +1237,35 @@ func (_m *FluxAggregator) GetAdmin(opts *bind.CallOpts, _oracle common.Address) return r0, r1 } +// FluxAggregator_GetAdmin_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAdmin' +type FluxAggregator_GetAdmin_Call struct { + *mock.Call +} + +// GetAdmin is a helper method to define mock.On call +// - opts *bind.CallOpts +// - _oracle common.Address +func (_e *FluxAggregator_Expecter) GetAdmin(opts interface{}, _oracle interface{}) *FluxAggregator_GetAdmin_Call { + return &FluxAggregator_GetAdmin_Call{Call: _e.mock.On("GetAdmin", opts, _oracle)} +} + +func (_c *FluxAggregator_GetAdmin_Call) Run(run func(opts *bind.CallOpts, _oracle common.Address)) *FluxAggregator_GetAdmin_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts), args[1].(common.Address)) + }) + return _c +} + +func (_c *FluxAggregator_GetAdmin_Call) Return(_a0 common.Address, _a1 error) *FluxAggregator_GetAdmin_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FluxAggregator_GetAdmin_Call) RunAndReturn(run func(*bind.CallOpts, common.Address) (common.Address, error)) *FluxAggregator_GetAdmin_Call { + _c.Call.Return(run) + return _c +} + // GetAnswer provides a mock function with given fields: opts, _roundId func (_m *FluxAggregator) GetAnswer(opts *bind.CallOpts, _roundId *big.Int) (*big.Int, error) { ret := _m.Called(opts, _roundId) @@ -670,6 +1296,35 @@ func (_m *FluxAggregator) GetAnswer(opts *bind.CallOpts, _roundId *big.Int) (*bi return r0, r1 } +// FluxAggregator_GetAnswer_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAnswer' +type FluxAggregator_GetAnswer_Call struct { + *mock.Call +} + +// GetAnswer is a helper method to define mock.On call +// - opts *bind.CallOpts +// - _roundId *big.Int +func (_e *FluxAggregator_Expecter) GetAnswer(opts interface{}, _roundId interface{}) *FluxAggregator_GetAnswer_Call { + return &FluxAggregator_GetAnswer_Call{Call: _e.mock.On("GetAnswer", opts, _roundId)} +} + +func (_c *FluxAggregator_GetAnswer_Call) Run(run func(opts *bind.CallOpts, _roundId *big.Int)) *FluxAggregator_GetAnswer_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts), args[1].(*big.Int)) + }) + return _c +} + +func (_c *FluxAggregator_GetAnswer_Call) Return(_a0 *big.Int, _a1 error) *FluxAggregator_GetAnswer_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FluxAggregator_GetAnswer_Call) RunAndReturn(run func(*bind.CallOpts, *big.Int) (*big.Int, error)) *FluxAggregator_GetAnswer_Call { + _c.Call.Return(run) + return _c +} + // GetOracles provides a mock function with given fields: opts func (_m *FluxAggregator) GetOracles(opts *bind.CallOpts) ([]common.Address, error) { ret := _m.Called(opts) @@ -700,6 +1355,34 @@ func (_m *FluxAggregator) GetOracles(opts *bind.CallOpts) ([]common.Address, err return r0, r1 } +// FluxAggregator_GetOracles_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetOracles' +type FluxAggregator_GetOracles_Call struct { + *mock.Call +} + +// GetOracles is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *FluxAggregator_Expecter) GetOracles(opts interface{}) *FluxAggregator_GetOracles_Call { + return &FluxAggregator_GetOracles_Call{Call: _e.mock.On("GetOracles", opts)} +} + +func (_c *FluxAggregator_GetOracles_Call) Run(run func(opts *bind.CallOpts)) *FluxAggregator_GetOracles_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *FluxAggregator_GetOracles_Call) Return(_a0 []common.Address, _a1 error) *FluxAggregator_GetOracles_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FluxAggregator_GetOracles_Call) RunAndReturn(run func(*bind.CallOpts) ([]common.Address, error)) *FluxAggregator_GetOracles_Call { + _c.Call.Return(run) + return _c +} + // GetRoundData provides a mock function with given fields: opts, _roundId func (_m *FluxAggregator) GetRoundData(opts *bind.CallOpts, _roundId *big.Int) (flux_aggregator_wrapper.GetRoundData, error) { ret := _m.Called(opts, _roundId) @@ -728,6 +1411,35 @@ func (_m *FluxAggregator) GetRoundData(opts *bind.CallOpts, _roundId *big.Int) ( return r0, r1 } +// FluxAggregator_GetRoundData_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetRoundData' +type FluxAggregator_GetRoundData_Call struct { + *mock.Call +} + +// GetRoundData is a helper method to define mock.On call +// - opts *bind.CallOpts +// - _roundId *big.Int +func (_e *FluxAggregator_Expecter) GetRoundData(opts interface{}, _roundId interface{}) *FluxAggregator_GetRoundData_Call { + return &FluxAggregator_GetRoundData_Call{Call: _e.mock.On("GetRoundData", opts, _roundId)} +} + +func (_c *FluxAggregator_GetRoundData_Call) Run(run func(opts *bind.CallOpts, _roundId *big.Int)) *FluxAggregator_GetRoundData_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts), args[1].(*big.Int)) + }) + return _c +} + +func (_c *FluxAggregator_GetRoundData_Call) Return(_a0 flux_aggregator_wrapper.GetRoundData, _a1 error) *FluxAggregator_GetRoundData_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FluxAggregator_GetRoundData_Call) RunAndReturn(run func(*bind.CallOpts, *big.Int) (flux_aggregator_wrapper.GetRoundData, error)) *FluxAggregator_GetRoundData_Call { + _c.Call.Return(run) + return _c +} + // GetTimestamp provides a mock function with given fields: opts, _roundId func (_m *FluxAggregator) GetTimestamp(opts *bind.CallOpts, _roundId *big.Int) (*big.Int, error) { ret := _m.Called(opts, _roundId) @@ -758,6 +1470,35 @@ func (_m *FluxAggregator) GetTimestamp(opts *bind.CallOpts, _roundId *big.Int) ( return r0, r1 } +// FluxAggregator_GetTimestamp_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetTimestamp' +type FluxAggregator_GetTimestamp_Call struct { + *mock.Call +} + +// GetTimestamp is a helper method to define mock.On call +// - opts *bind.CallOpts +// - _roundId *big.Int +func (_e *FluxAggregator_Expecter) GetTimestamp(opts interface{}, _roundId interface{}) *FluxAggregator_GetTimestamp_Call { + return &FluxAggregator_GetTimestamp_Call{Call: _e.mock.On("GetTimestamp", opts, _roundId)} +} + +func (_c *FluxAggregator_GetTimestamp_Call) Run(run func(opts *bind.CallOpts, _roundId *big.Int)) *FluxAggregator_GetTimestamp_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts), args[1].(*big.Int)) + }) + return _c +} + +func (_c *FluxAggregator_GetTimestamp_Call) Return(_a0 *big.Int, _a1 error) *FluxAggregator_GetTimestamp_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FluxAggregator_GetTimestamp_Call) RunAndReturn(run func(*bind.CallOpts, *big.Int) (*big.Int, error)) *FluxAggregator_GetTimestamp_Call { + _c.Call.Return(run) + return _c +} + // LatestAnswer provides a mock function with given fields: opts func (_m *FluxAggregator) LatestAnswer(opts *bind.CallOpts) (*big.Int, error) { ret := _m.Called(opts) @@ -788,8 +1529,36 @@ func (_m *FluxAggregator) LatestAnswer(opts *bind.CallOpts) (*big.Int, error) { return r0, r1 } -// LatestRound provides a mock function with given fields: opts -func (_m *FluxAggregator) LatestRound(opts *bind.CallOpts) (*big.Int, error) { +// FluxAggregator_LatestAnswer_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LatestAnswer' +type FluxAggregator_LatestAnswer_Call struct { + *mock.Call +} + +// LatestAnswer is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *FluxAggregator_Expecter) LatestAnswer(opts interface{}) *FluxAggregator_LatestAnswer_Call { + return &FluxAggregator_LatestAnswer_Call{Call: _e.mock.On("LatestAnswer", opts)} +} + +func (_c *FluxAggregator_LatestAnswer_Call) Run(run func(opts *bind.CallOpts)) *FluxAggregator_LatestAnswer_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *FluxAggregator_LatestAnswer_Call) Return(_a0 *big.Int, _a1 error) *FluxAggregator_LatestAnswer_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FluxAggregator_LatestAnswer_Call) RunAndReturn(run func(*bind.CallOpts) (*big.Int, error)) *FluxAggregator_LatestAnswer_Call { + _c.Call.Return(run) + return _c +} + +// LatestRound provides a mock function with given fields: opts +func (_m *FluxAggregator) LatestRound(opts *bind.CallOpts) (*big.Int, error) { ret := _m.Called(opts) if len(ret) == 0 { @@ -818,6 +1587,34 @@ func (_m *FluxAggregator) LatestRound(opts *bind.CallOpts) (*big.Int, error) { return r0, r1 } +// FluxAggregator_LatestRound_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LatestRound' +type FluxAggregator_LatestRound_Call struct { + *mock.Call +} + +// LatestRound is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *FluxAggregator_Expecter) LatestRound(opts interface{}) *FluxAggregator_LatestRound_Call { + return &FluxAggregator_LatestRound_Call{Call: _e.mock.On("LatestRound", opts)} +} + +func (_c *FluxAggregator_LatestRound_Call) Run(run func(opts *bind.CallOpts)) *FluxAggregator_LatestRound_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *FluxAggregator_LatestRound_Call) Return(_a0 *big.Int, _a1 error) *FluxAggregator_LatestRound_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FluxAggregator_LatestRound_Call) RunAndReturn(run func(*bind.CallOpts) (*big.Int, error)) *FluxAggregator_LatestRound_Call { + _c.Call.Return(run) + return _c +} + // LatestRoundData provides a mock function with given fields: opts func (_m *FluxAggregator) LatestRoundData(opts *bind.CallOpts) (flux_aggregator_wrapper.LatestRoundData, error) { ret := _m.Called(opts) @@ -846,6 +1643,34 @@ func (_m *FluxAggregator) LatestRoundData(opts *bind.CallOpts) (flux_aggregator_ return r0, r1 } +// FluxAggregator_LatestRoundData_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LatestRoundData' +type FluxAggregator_LatestRoundData_Call struct { + *mock.Call +} + +// LatestRoundData is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *FluxAggregator_Expecter) LatestRoundData(opts interface{}) *FluxAggregator_LatestRoundData_Call { + return &FluxAggregator_LatestRoundData_Call{Call: _e.mock.On("LatestRoundData", opts)} +} + +func (_c *FluxAggregator_LatestRoundData_Call) Run(run func(opts *bind.CallOpts)) *FluxAggregator_LatestRoundData_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *FluxAggregator_LatestRoundData_Call) Return(_a0 flux_aggregator_wrapper.LatestRoundData, _a1 error) *FluxAggregator_LatestRoundData_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FluxAggregator_LatestRoundData_Call) RunAndReturn(run func(*bind.CallOpts) (flux_aggregator_wrapper.LatestRoundData, error)) *FluxAggregator_LatestRoundData_Call { + _c.Call.Return(run) + return _c +} + // LatestTimestamp provides a mock function with given fields: opts func (_m *FluxAggregator) LatestTimestamp(opts *bind.CallOpts) (*big.Int, error) { ret := _m.Called(opts) @@ -876,6 +1701,34 @@ func (_m *FluxAggregator) LatestTimestamp(opts *bind.CallOpts) (*big.Int, error) return r0, r1 } +// FluxAggregator_LatestTimestamp_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LatestTimestamp' +type FluxAggregator_LatestTimestamp_Call struct { + *mock.Call +} + +// LatestTimestamp is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *FluxAggregator_Expecter) LatestTimestamp(opts interface{}) *FluxAggregator_LatestTimestamp_Call { + return &FluxAggregator_LatestTimestamp_Call{Call: _e.mock.On("LatestTimestamp", opts)} +} + +func (_c *FluxAggregator_LatestTimestamp_Call) Run(run func(opts *bind.CallOpts)) *FluxAggregator_LatestTimestamp_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *FluxAggregator_LatestTimestamp_Call) Return(_a0 *big.Int, _a1 error) *FluxAggregator_LatestTimestamp_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FluxAggregator_LatestTimestamp_Call) RunAndReturn(run func(*bind.CallOpts) (*big.Int, error)) *FluxAggregator_LatestTimestamp_Call { + _c.Call.Return(run) + return _c +} + // LinkToken provides a mock function with given fields: opts func (_m *FluxAggregator) LinkToken(opts *bind.CallOpts) (common.Address, error) { ret := _m.Called(opts) @@ -906,6 +1759,34 @@ func (_m *FluxAggregator) LinkToken(opts *bind.CallOpts) (common.Address, error) return r0, r1 } +// FluxAggregator_LinkToken_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LinkToken' +type FluxAggregator_LinkToken_Call struct { + *mock.Call +} + +// LinkToken is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *FluxAggregator_Expecter) LinkToken(opts interface{}) *FluxAggregator_LinkToken_Call { + return &FluxAggregator_LinkToken_Call{Call: _e.mock.On("LinkToken", opts)} +} + +func (_c *FluxAggregator_LinkToken_Call) Run(run func(opts *bind.CallOpts)) *FluxAggregator_LinkToken_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *FluxAggregator_LinkToken_Call) Return(_a0 common.Address, _a1 error) *FluxAggregator_LinkToken_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FluxAggregator_LinkToken_Call) RunAndReturn(run func(*bind.CallOpts) (common.Address, error)) *FluxAggregator_LinkToken_Call { + _c.Call.Return(run) + return _c +} + // MaxSubmissionCount provides a mock function with given fields: opts func (_m *FluxAggregator) MaxSubmissionCount(opts *bind.CallOpts) (uint32, error) { ret := _m.Called(opts) @@ -934,6 +1815,34 @@ func (_m *FluxAggregator) MaxSubmissionCount(opts *bind.CallOpts) (uint32, error return r0, r1 } +// FluxAggregator_MaxSubmissionCount_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MaxSubmissionCount' +type FluxAggregator_MaxSubmissionCount_Call struct { + *mock.Call +} + +// MaxSubmissionCount is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *FluxAggregator_Expecter) MaxSubmissionCount(opts interface{}) *FluxAggregator_MaxSubmissionCount_Call { + return &FluxAggregator_MaxSubmissionCount_Call{Call: _e.mock.On("MaxSubmissionCount", opts)} +} + +func (_c *FluxAggregator_MaxSubmissionCount_Call) Run(run func(opts *bind.CallOpts)) *FluxAggregator_MaxSubmissionCount_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *FluxAggregator_MaxSubmissionCount_Call) Return(_a0 uint32, _a1 error) *FluxAggregator_MaxSubmissionCount_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FluxAggregator_MaxSubmissionCount_Call) RunAndReturn(run func(*bind.CallOpts) (uint32, error)) *FluxAggregator_MaxSubmissionCount_Call { + _c.Call.Return(run) + return _c +} + // MaxSubmissionValue provides a mock function with given fields: opts func (_m *FluxAggregator) MaxSubmissionValue(opts *bind.CallOpts) (*big.Int, error) { ret := _m.Called(opts) @@ -964,6 +1873,34 @@ func (_m *FluxAggregator) MaxSubmissionValue(opts *bind.CallOpts) (*big.Int, err return r0, r1 } +// FluxAggregator_MaxSubmissionValue_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MaxSubmissionValue' +type FluxAggregator_MaxSubmissionValue_Call struct { + *mock.Call +} + +// MaxSubmissionValue is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *FluxAggregator_Expecter) MaxSubmissionValue(opts interface{}) *FluxAggregator_MaxSubmissionValue_Call { + return &FluxAggregator_MaxSubmissionValue_Call{Call: _e.mock.On("MaxSubmissionValue", opts)} +} + +func (_c *FluxAggregator_MaxSubmissionValue_Call) Run(run func(opts *bind.CallOpts)) *FluxAggregator_MaxSubmissionValue_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *FluxAggregator_MaxSubmissionValue_Call) Return(_a0 *big.Int, _a1 error) *FluxAggregator_MaxSubmissionValue_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FluxAggregator_MaxSubmissionValue_Call) RunAndReturn(run func(*bind.CallOpts) (*big.Int, error)) *FluxAggregator_MaxSubmissionValue_Call { + _c.Call.Return(run) + return _c +} + // MinSubmissionCount provides a mock function with given fields: opts func (_m *FluxAggregator) MinSubmissionCount(opts *bind.CallOpts) (uint32, error) { ret := _m.Called(opts) @@ -992,6 +1929,34 @@ func (_m *FluxAggregator) MinSubmissionCount(opts *bind.CallOpts) (uint32, error return r0, r1 } +// FluxAggregator_MinSubmissionCount_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MinSubmissionCount' +type FluxAggregator_MinSubmissionCount_Call struct { + *mock.Call +} + +// MinSubmissionCount is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *FluxAggregator_Expecter) MinSubmissionCount(opts interface{}) *FluxAggregator_MinSubmissionCount_Call { + return &FluxAggregator_MinSubmissionCount_Call{Call: _e.mock.On("MinSubmissionCount", opts)} +} + +func (_c *FluxAggregator_MinSubmissionCount_Call) Run(run func(opts *bind.CallOpts)) *FluxAggregator_MinSubmissionCount_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *FluxAggregator_MinSubmissionCount_Call) Return(_a0 uint32, _a1 error) *FluxAggregator_MinSubmissionCount_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FluxAggregator_MinSubmissionCount_Call) RunAndReturn(run func(*bind.CallOpts) (uint32, error)) *FluxAggregator_MinSubmissionCount_Call { + _c.Call.Return(run) + return _c +} + // MinSubmissionValue provides a mock function with given fields: opts func (_m *FluxAggregator) MinSubmissionValue(opts *bind.CallOpts) (*big.Int, error) { ret := _m.Called(opts) @@ -1022,6 +1987,34 @@ func (_m *FluxAggregator) MinSubmissionValue(opts *bind.CallOpts) (*big.Int, err return r0, r1 } +// FluxAggregator_MinSubmissionValue_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MinSubmissionValue' +type FluxAggregator_MinSubmissionValue_Call struct { + *mock.Call +} + +// MinSubmissionValue is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *FluxAggregator_Expecter) MinSubmissionValue(opts interface{}) *FluxAggregator_MinSubmissionValue_Call { + return &FluxAggregator_MinSubmissionValue_Call{Call: _e.mock.On("MinSubmissionValue", opts)} +} + +func (_c *FluxAggregator_MinSubmissionValue_Call) Run(run func(opts *bind.CallOpts)) *FluxAggregator_MinSubmissionValue_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *FluxAggregator_MinSubmissionValue_Call) Return(_a0 *big.Int, _a1 error) *FluxAggregator_MinSubmissionValue_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FluxAggregator_MinSubmissionValue_Call) RunAndReturn(run func(*bind.CallOpts) (*big.Int, error)) *FluxAggregator_MinSubmissionValue_Call { + _c.Call.Return(run) + return _c +} + // OnTokenTransfer provides a mock function with given fields: opts, arg0, arg1, _data func (_m *FluxAggregator) OnTokenTransfer(opts *bind.TransactOpts, arg0 common.Address, arg1 *big.Int, _data []byte) (*types.Transaction, error) { ret := _m.Called(opts, arg0, arg1, _data) @@ -1052,6 +2045,37 @@ func (_m *FluxAggregator) OnTokenTransfer(opts *bind.TransactOpts, arg0 common.A return r0, r1 } +// FluxAggregator_OnTokenTransfer_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OnTokenTransfer' +type FluxAggregator_OnTokenTransfer_Call struct { + *mock.Call +} + +// OnTokenTransfer is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - arg0 common.Address +// - arg1 *big.Int +// - _data []byte +func (_e *FluxAggregator_Expecter) OnTokenTransfer(opts interface{}, arg0 interface{}, arg1 interface{}, _data interface{}) *FluxAggregator_OnTokenTransfer_Call { + return &FluxAggregator_OnTokenTransfer_Call{Call: _e.mock.On("OnTokenTransfer", opts, arg0, arg1, _data)} +} + +func (_c *FluxAggregator_OnTokenTransfer_Call) Run(run func(opts *bind.TransactOpts, arg0 common.Address, arg1 *big.Int, _data []byte)) *FluxAggregator_OnTokenTransfer_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].(common.Address), args[2].(*big.Int), args[3].([]byte)) + }) + return _c +} + +func (_c *FluxAggregator_OnTokenTransfer_Call) Return(_a0 *types.Transaction, _a1 error) *FluxAggregator_OnTokenTransfer_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FluxAggregator_OnTokenTransfer_Call) RunAndReturn(run func(*bind.TransactOpts, common.Address, *big.Int, []byte) (*types.Transaction, error)) *FluxAggregator_OnTokenTransfer_Call { + _c.Call.Return(run) + return _c +} + // OracleCount provides a mock function with given fields: opts func (_m *FluxAggregator) OracleCount(opts *bind.CallOpts) (uint8, error) { ret := _m.Called(opts) @@ -1080,6 +2104,34 @@ func (_m *FluxAggregator) OracleCount(opts *bind.CallOpts) (uint8, error) { return r0, r1 } +// FluxAggregator_OracleCount_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OracleCount' +type FluxAggregator_OracleCount_Call struct { + *mock.Call +} + +// OracleCount is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *FluxAggregator_Expecter) OracleCount(opts interface{}) *FluxAggregator_OracleCount_Call { + return &FluxAggregator_OracleCount_Call{Call: _e.mock.On("OracleCount", opts)} +} + +func (_c *FluxAggregator_OracleCount_Call) Run(run func(opts *bind.CallOpts)) *FluxAggregator_OracleCount_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *FluxAggregator_OracleCount_Call) Return(_a0 uint8, _a1 error) *FluxAggregator_OracleCount_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FluxAggregator_OracleCount_Call) RunAndReturn(run func(*bind.CallOpts) (uint8, error)) *FluxAggregator_OracleCount_Call { + _c.Call.Return(run) + return _c +} + // OracleRoundState provides a mock function with given fields: opts, _oracle, _queriedRoundId func (_m *FluxAggregator) OracleRoundState(opts *bind.CallOpts, _oracle common.Address, _queriedRoundId uint32) (flux_aggregator_wrapper.OracleRoundState, error) { ret := _m.Called(opts, _oracle, _queriedRoundId) @@ -1108,6 +2160,36 @@ func (_m *FluxAggregator) OracleRoundState(opts *bind.CallOpts, _oracle common.A return r0, r1 } +// FluxAggregator_OracleRoundState_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OracleRoundState' +type FluxAggregator_OracleRoundState_Call struct { + *mock.Call +} + +// OracleRoundState is a helper method to define mock.On call +// - opts *bind.CallOpts +// - _oracle common.Address +// - _queriedRoundId uint32 +func (_e *FluxAggregator_Expecter) OracleRoundState(opts interface{}, _oracle interface{}, _queriedRoundId interface{}) *FluxAggregator_OracleRoundState_Call { + return &FluxAggregator_OracleRoundState_Call{Call: _e.mock.On("OracleRoundState", opts, _oracle, _queriedRoundId)} +} + +func (_c *FluxAggregator_OracleRoundState_Call) Run(run func(opts *bind.CallOpts, _oracle common.Address, _queriedRoundId uint32)) *FluxAggregator_OracleRoundState_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts), args[1].(common.Address), args[2].(uint32)) + }) + return _c +} + +func (_c *FluxAggregator_OracleRoundState_Call) Return(_a0 flux_aggregator_wrapper.OracleRoundState, _a1 error) *FluxAggregator_OracleRoundState_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FluxAggregator_OracleRoundState_Call) RunAndReturn(run func(*bind.CallOpts, common.Address, uint32) (flux_aggregator_wrapper.OracleRoundState, error)) *FluxAggregator_OracleRoundState_Call { + _c.Call.Return(run) + return _c +} + // Owner provides a mock function with given fields: opts func (_m *FluxAggregator) Owner(opts *bind.CallOpts) (common.Address, error) { ret := _m.Called(opts) @@ -1138,6 +2220,34 @@ func (_m *FluxAggregator) Owner(opts *bind.CallOpts) (common.Address, error) { return r0, r1 } +// FluxAggregator_Owner_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Owner' +type FluxAggregator_Owner_Call struct { + *mock.Call +} + +// Owner is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *FluxAggregator_Expecter) Owner(opts interface{}) *FluxAggregator_Owner_Call { + return &FluxAggregator_Owner_Call{Call: _e.mock.On("Owner", opts)} +} + +func (_c *FluxAggregator_Owner_Call) Run(run func(opts *bind.CallOpts)) *FluxAggregator_Owner_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *FluxAggregator_Owner_Call) Return(_a0 common.Address, _a1 error) *FluxAggregator_Owner_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FluxAggregator_Owner_Call) RunAndReturn(run func(*bind.CallOpts) (common.Address, error)) *FluxAggregator_Owner_Call { + _c.Call.Return(run) + return _c +} + // ParseAnswerUpdated provides a mock function with given fields: log func (_m *FluxAggregator) ParseAnswerUpdated(log types.Log) (*flux_aggregator_wrapper.FluxAggregatorAnswerUpdated, error) { ret := _m.Called(log) @@ -1168,6 +2278,34 @@ func (_m *FluxAggregator) ParseAnswerUpdated(log types.Log) (*flux_aggregator_wr return r0, r1 } +// FluxAggregator_ParseAnswerUpdated_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseAnswerUpdated' +type FluxAggregator_ParseAnswerUpdated_Call struct { + *mock.Call +} + +// ParseAnswerUpdated is a helper method to define mock.On call +// - log types.Log +func (_e *FluxAggregator_Expecter) ParseAnswerUpdated(log interface{}) *FluxAggregator_ParseAnswerUpdated_Call { + return &FluxAggregator_ParseAnswerUpdated_Call{Call: _e.mock.On("ParseAnswerUpdated", log)} +} + +func (_c *FluxAggregator_ParseAnswerUpdated_Call) Run(run func(log types.Log)) *FluxAggregator_ParseAnswerUpdated_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *FluxAggregator_ParseAnswerUpdated_Call) Return(_a0 *flux_aggregator_wrapper.FluxAggregatorAnswerUpdated, _a1 error) *FluxAggregator_ParseAnswerUpdated_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FluxAggregator_ParseAnswerUpdated_Call) RunAndReturn(run func(types.Log) (*flux_aggregator_wrapper.FluxAggregatorAnswerUpdated, error)) *FluxAggregator_ParseAnswerUpdated_Call { + _c.Call.Return(run) + return _c +} + // ParseAvailableFundsUpdated provides a mock function with given fields: log func (_m *FluxAggregator) ParseAvailableFundsUpdated(log types.Log) (*flux_aggregator_wrapper.FluxAggregatorAvailableFundsUpdated, error) { ret := _m.Called(log) @@ -1198,6 +2336,34 @@ func (_m *FluxAggregator) ParseAvailableFundsUpdated(log types.Log) (*flux_aggre return r0, r1 } +// FluxAggregator_ParseAvailableFundsUpdated_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseAvailableFundsUpdated' +type FluxAggregator_ParseAvailableFundsUpdated_Call struct { + *mock.Call +} + +// ParseAvailableFundsUpdated is a helper method to define mock.On call +// - log types.Log +func (_e *FluxAggregator_Expecter) ParseAvailableFundsUpdated(log interface{}) *FluxAggregator_ParseAvailableFundsUpdated_Call { + return &FluxAggregator_ParseAvailableFundsUpdated_Call{Call: _e.mock.On("ParseAvailableFundsUpdated", log)} +} + +func (_c *FluxAggregator_ParseAvailableFundsUpdated_Call) Run(run func(log types.Log)) *FluxAggregator_ParseAvailableFundsUpdated_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *FluxAggregator_ParseAvailableFundsUpdated_Call) Return(_a0 *flux_aggregator_wrapper.FluxAggregatorAvailableFundsUpdated, _a1 error) *FluxAggregator_ParseAvailableFundsUpdated_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FluxAggregator_ParseAvailableFundsUpdated_Call) RunAndReturn(run func(types.Log) (*flux_aggregator_wrapper.FluxAggregatorAvailableFundsUpdated, error)) *FluxAggregator_ParseAvailableFundsUpdated_Call { + _c.Call.Return(run) + return _c +} + // ParseLog provides a mock function with given fields: log func (_m *FluxAggregator) ParseLog(log types.Log) (generated.AbigenLog, error) { ret := _m.Called(log) @@ -1228,6 +2394,34 @@ func (_m *FluxAggregator) ParseLog(log types.Log) (generated.AbigenLog, error) { return r0, r1 } +// FluxAggregator_ParseLog_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseLog' +type FluxAggregator_ParseLog_Call struct { + *mock.Call +} + +// ParseLog is a helper method to define mock.On call +// - log types.Log +func (_e *FluxAggregator_Expecter) ParseLog(log interface{}) *FluxAggregator_ParseLog_Call { + return &FluxAggregator_ParseLog_Call{Call: _e.mock.On("ParseLog", log)} +} + +func (_c *FluxAggregator_ParseLog_Call) Run(run func(log types.Log)) *FluxAggregator_ParseLog_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *FluxAggregator_ParseLog_Call) Return(_a0 generated.AbigenLog, _a1 error) *FluxAggregator_ParseLog_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FluxAggregator_ParseLog_Call) RunAndReturn(run func(types.Log) (generated.AbigenLog, error)) *FluxAggregator_ParseLog_Call { + _c.Call.Return(run) + return _c +} + // ParseNewRound provides a mock function with given fields: log func (_m *FluxAggregator) ParseNewRound(log types.Log) (*flux_aggregator_wrapper.FluxAggregatorNewRound, error) { ret := _m.Called(log) @@ -1258,6 +2452,34 @@ func (_m *FluxAggregator) ParseNewRound(log types.Log) (*flux_aggregator_wrapper return r0, r1 } +// FluxAggregator_ParseNewRound_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseNewRound' +type FluxAggregator_ParseNewRound_Call struct { + *mock.Call +} + +// ParseNewRound is a helper method to define mock.On call +// - log types.Log +func (_e *FluxAggregator_Expecter) ParseNewRound(log interface{}) *FluxAggregator_ParseNewRound_Call { + return &FluxAggregator_ParseNewRound_Call{Call: _e.mock.On("ParseNewRound", log)} +} + +func (_c *FluxAggregator_ParseNewRound_Call) Run(run func(log types.Log)) *FluxAggregator_ParseNewRound_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *FluxAggregator_ParseNewRound_Call) Return(_a0 *flux_aggregator_wrapper.FluxAggregatorNewRound, _a1 error) *FluxAggregator_ParseNewRound_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FluxAggregator_ParseNewRound_Call) RunAndReturn(run func(types.Log) (*flux_aggregator_wrapper.FluxAggregatorNewRound, error)) *FluxAggregator_ParseNewRound_Call { + _c.Call.Return(run) + return _c +} + // ParseOracleAdminUpdateRequested provides a mock function with given fields: log func (_m *FluxAggregator) ParseOracleAdminUpdateRequested(log types.Log) (*flux_aggregator_wrapper.FluxAggregatorOracleAdminUpdateRequested, error) { ret := _m.Called(log) @@ -1288,6 +2510,34 @@ func (_m *FluxAggregator) ParseOracleAdminUpdateRequested(log types.Log) (*flux_ return r0, r1 } +// FluxAggregator_ParseOracleAdminUpdateRequested_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseOracleAdminUpdateRequested' +type FluxAggregator_ParseOracleAdminUpdateRequested_Call struct { + *mock.Call +} + +// ParseOracleAdminUpdateRequested is a helper method to define mock.On call +// - log types.Log +func (_e *FluxAggregator_Expecter) ParseOracleAdminUpdateRequested(log interface{}) *FluxAggregator_ParseOracleAdminUpdateRequested_Call { + return &FluxAggregator_ParseOracleAdminUpdateRequested_Call{Call: _e.mock.On("ParseOracleAdminUpdateRequested", log)} +} + +func (_c *FluxAggregator_ParseOracleAdminUpdateRequested_Call) Run(run func(log types.Log)) *FluxAggregator_ParseOracleAdminUpdateRequested_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *FluxAggregator_ParseOracleAdminUpdateRequested_Call) Return(_a0 *flux_aggregator_wrapper.FluxAggregatorOracleAdminUpdateRequested, _a1 error) *FluxAggregator_ParseOracleAdminUpdateRequested_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FluxAggregator_ParseOracleAdminUpdateRequested_Call) RunAndReturn(run func(types.Log) (*flux_aggregator_wrapper.FluxAggregatorOracleAdminUpdateRequested, error)) *FluxAggregator_ParseOracleAdminUpdateRequested_Call { + _c.Call.Return(run) + return _c +} + // ParseOracleAdminUpdated provides a mock function with given fields: log func (_m *FluxAggregator) ParseOracleAdminUpdated(log types.Log) (*flux_aggregator_wrapper.FluxAggregatorOracleAdminUpdated, error) { ret := _m.Called(log) @@ -1318,6 +2568,34 @@ func (_m *FluxAggregator) ParseOracleAdminUpdated(log types.Log) (*flux_aggregat return r0, r1 } +// FluxAggregator_ParseOracleAdminUpdated_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseOracleAdminUpdated' +type FluxAggregator_ParseOracleAdminUpdated_Call struct { + *mock.Call +} + +// ParseOracleAdminUpdated is a helper method to define mock.On call +// - log types.Log +func (_e *FluxAggregator_Expecter) ParseOracleAdminUpdated(log interface{}) *FluxAggregator_ParseOracleAdminUpdated_Call { + return &FluxAggregator_ParseOracleAdminUpdated_Call{Call: _e.mock.On("ParseOracleAdminUpdated", log)} +} + +func (_c *FluxAggregator_ParseOracleAdminUpdated_Call) Run(run func(log types.Log)) *FluxAggregator_ParseOracleAdminUpdated_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *FluxAggregator_ParseOracleAdminUpdated_Call) Return(_a0 *flux_aggregator_wrapper.FluxAggregatorOracleAdminUpdated, _a1 error) *FluxAggregator_ParseOracleAdminUpdated_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FluxAggregator_ParseOracleAdminUpdated_Call) RunAndReturn(run func(types.Log) (*flux_aggregator_wrapper.FluxAggregatorOracleAdminUpdated, error)) *FluxAggregator_ParseOracleAdminUpdated_Call { + _c.Call.Return(run) + return _c +} + // ParseOraclePermissionsUpdated provides a mock function with given fields: log func (_m *FluxAggregator) ParseOraclePermissionsUpdated(log types.Log) (*flux_aggregator_wrapper.FluxAggregatorOraclePermissionsUpdated, error) { ret := _m.Called(log) @@ -1348,6 +2626,34 @@ func (_m *FluxAggregator) ParseOraclePermissionsUpdated(log types.Log) (*flux_ag return r0, r1 } +// FluxAggregator_ParseOraclePermissionsUpdated_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseOraclePermissionsUpdated' +type FluxAggregator_ParseOraclePermissionsUpdated_Call struct { + *mock.Call +} + +// ParseOraclePermissionsUpdated is a helper method to define mock.On call +// - log types.Log +func (_e *FluxAggregator_Expecter) ParseOraclePermissionsUpdated(log interface{}) *FluxAggregator_ParseOraclePermissionsUpdated_Call { + return &FluxAggregator_ParseOraclePermissionsUpdated_Call{Call: _e.mock.On("ParseOraclePermissionsUpdated", log)} +} + +func (_c *FluxAggregator_ParseOraclePermissionsUpdated_Call) Run(run func(log types.Log)) *FluxAggregator_ParseOraclePermissionsUpdated_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *FluxAggregator_ParseOraclePermissionsUpdated_Call) Return(_a0 *flux_aggregator_wrapper.FluxAggregatorOraclePermissionsUpdated, _a1 error) *FluxAggregator_ParseOraclePermissionsUpdated_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FluxAggregator_ParseOraclePermissionsUpdated_Call) RunAndReturn(run func(types.Log) (*flux_aggregator_wrapper.FluxAggregatorOraclePermissionsUpdated, error)) *FluxAggregator_ParseOraclePermissionsUpdated_Call { + _c.Call.Return(run) + return _c +} + // ParseOwnershipTransferRequested provides a mock function with given fields: log func (_m *FluxAggregator) ParseOwnershipTransferRequested(log types.Log) (*flux_aggregator_wrapper.FluxAggregatorOwnershipTransferRequested, error) { ret := _m.Called(log) @@ -1378,6 +2684,34 @@ func (_m *FluxAggregator) ParseOwnershipTransferRequested(log types.Log) (*flux_ return r0, r1 } +// FluxAggregator_ParseOwnershipTransferRequested_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseOwnershipTransferRequested' +type FluxAggregator_ParseOwnershipTransferRequested_Call struct { + *mock.Call +} + +// ParseOwnershipTransferRequested is a helper method to define mock.On call +// - log types.Log +func (_e *FluxAggregator_Expecter) ParseOwnershipTransferRequested(log interface{}) *FluxAggregator_ParseOwnershipTransferRequested_Call { + return &FluxAggregator_ParseOwnershipTransferRequested_Call{Call: _e.mock.On("ParseOwnershipTransferRequested", log)} +} + +func (_c *FluxAggregator_ParseOwnershipTransferRequested_Call) Run(run func(log types.Log)) *FluxAggregator_ParseOwnershipTransferRequested_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *FluxAggregator_ParseOwnershipTransferRequested_Call) Return(_a0 *flux_aggregator_wrapper.FluxAggregatorOwnershipTransferRequested, _a1 error) *FluxAggregator_ParseOwnershipTransferRequested_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FluxAggregator_ParseOwnershipTransferRequested_Call) RunAndReturn(run func(types.Log) (*flux_aggregator_wrapper.FluxAggregatorOwnershipTransferRequested, error)) *FluxAggregator_ParseOwnershipTransferRequested_Call { + _c.Call.Return(run) + return _c +} + // ParseOwnershipTransferred provides a mock function with given fields: log func (_m *FluxAggregator) ParseOwnershipTransferred(log types.Log) (*flux_aggregator_wrapper.FluxAggregatorOwnershipTransferred, error) { ret := _m.Called(log) @@ -1408,6 +2742,34 @@ func (_m *FluxAggregator) ParseOwnershipTransferred(log types.Log) (*flux_aggreg return r0, r1 } +// FluxAggregator_ParseOwnershipTransferred_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseOwnershipTransferred' +type FluxAggregator_ParseOwnershipTransferred_Call struct { + *mock.Call +} + +// ParseOwnershipTransferred is a helper method to define mock.On call +// - log types.Log +func (_e *FluxAggregator_Expecter) ParseOwnershipTransferred(log interface{}) *FluxAggregator_ParseOwnershipTransferred_Call { + return &FluxAggregator_ParseOwnershipTransferred_Call{Call: _e.mock.On("ParseOwnershipTransferred", log)} +} + +func (_c *FluxAggregator_ParseOwnershipTransferred_Call) Run(run func(log types.Log)) *FluxAggregator_ParseOwnershipTransferred_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *FluxAggregator_ParseOwnershipTransferred_Call) Return(_a0 *flux_aggregator_wrapper.FluxAggregatorOwnershipTransferred, _a1 error) *FluxAggregator_ParseOwnershipTransferred_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FluxAggregator_ParseOwnershipTransferred_Call) RunAndReturn(run func(types.Log) (*flux_aggregator_wrapper.FluxAggregatorOwnershipTransferred, error)) *FluxAggregator_ParseOwnershipTransferred_Call { + _c.Call.Return(run) + return _c +} + // ParseRequesterPermissionsSet provides a mock function with given fields: log func (_m *FluxAggregator) ParseRequesterPermissionsSet(log types.Log) (*flux_aggregator_wrapper.FluxAggregatorRequesterPermissionsSet, error) { ret := _m.Called(log) @@ -1438,6 +2800,34 @@ func (_m *FluxAggregator) ParseRequesterPermissionsSet(log types.Log) (*flux_agg return r0, r1 } +// FluxAggregator_ParseRequesterPermissionsSet_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseRequesterPermissionsSet' +type FluxAggregator_ParseRequesterPermissionsSet_Call struct { + *mock.Call +} + +// ParseRequesterPermissionsSet is a helper method to define mock.On call +// - log types.Log +func (_e *FluxAggregator_Expecter) ParseRequesterPermissionsSet(log interface{}) *FluxAggregator_ParseRequesterPermissionsSet_Call { + return &FluxAggregator_ParseRequesterPermissionsSet_Call{Call: _e.mock.On("ParseRequesterPermissionsSet", log)} +} + +func (_c *FluxAggregator_ParseRequesterPermissionsSet_Call) Run(run func(log types.Log)) *FluxAggregator_ParseRequesterPermissionsSet_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *FluxAggregator_ParseRequesterPermissionsSet_Call) Return(_a0 *flux_aggregator_wrapper.FluxAggregatorRequesterPermissionsSet, _a1 error) *FluxAggregator_ParseRequesterPermissionsSet_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FluxAggregator_ParseRequesterPermissionsSet_Call) RunAndReturn(run func(types.Log) (*flux_aggregator_wrapper.FluxAggregatorRequesterPermissionsSet, error)) *FluxAggregator_ParseRequesterPermissionsSet_Call { + _c.Call.Return(run) + return _c +} + // ParseRoundDetailsUpdated provides a mock function with given fields: log func (_m *FluxAggregator) ParseRoundDetailsUpdated(log types.Log) (*flux_aggregator_wrapper.FluxAggregatorRoundDetailsUpdated, error) { ret := _m.Called(log) @@ -1468,6 +2858,34 @@ func (_m *FluxAggregator) ParseRoundDetailsUpdated(log types.Log) (*flux_aggrega return r0, r1 } +// FluxAggregator_ParseRoundDetailsUpdated_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseRoundDetailsUpdated' +type FluxAggregator_ParseRoundDetailsUpdated_Call struct { + *mock.Call +} + +// ParseRoundDetailsUpdated is a helper method to define mock.On call +// - log types.Log +func (_e *FluxAggregator_Expecter) ParseRoundDetailsUpdated(log interface{}) *FluxAggregator_ParseRoundDetailsUpdated_Call { + return &FluxAggregator_ParseRoundDetailsUpdated_Call{Call: _e.mock.On("ParseRoundDetailsUpdated", log)} +} + +func (_c *FluxAggregator_ParseRoundDetailsUpdated_Call) Run(run func(log types.Log)) *FluxAggregator_ParseRoundDetailsUpdated_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *FluxAggregator_ParseRoundDetailsUpdated_Call) Return(_a0 *flux_aggregator_wrapper.FluxAggregatorRoundDetailsUpdated, _a1 error) *FluxAggregator_ParseRoundDetailsUpdated_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FluxAggregator_ParseRoundDetailsUpdated_Call) RunAndReturn(run func(types.Log) (*flux_aggregator_wrapper.FluxAggregatorRoundDetailsUpdated, error)) *FluxAggregator_ParseRoundDetailsUpdated_Call { + _c.Call.Return(run) + return _c +} + // ParseSubmissionReceived provides a mock function with given fields: log func (_m *FluxAggregator) ParseSubmissionReceived(log types.Log) (*flux_aggregator_wrapper.FluxAggregatorSubmissionReceived, error) { ret := _m.Called(log) @@ -1498,6 +2916,34 @@ func (_m *FluxAggregator) ParseSubmissionReceived(log types.Log) (*flux_aggregat return r0, r1 } +// FluxAggregator_ParseSubmissionReceived_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseSubmissionReceived' +type FluxAggregator_ParseSubmissionReceived_Call struct { + *mock.Call +} + +// ParseSubmissionReceived is a helper method to define mock.On call +// - log types.Log +func (_e *FluxAggregator_Expecter) ParseSubmissionReceived(log interface{}) *FluxAggregator_ParseSubmissionReceived_Call { + return &FluxAggregator_ParseSubmissionReceived_Call{Call: _e.mock.On("ParseSubmissionReceived", log)} +} + +func (_c *FluxAggregator_ParseSubmissionReceived_Call) Run(run func(log types.Log)) *FluxAggregator_ParseSubmissionReceived_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *FluxAggregator_ParseSubmissionReceived_Call) Return(_a0 *flux_aggregator_wrapper.FluxAggregatorSubmissionReceived, _a1 error) *FluxAggregator_ParseSubmissionReceived_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FluxAggregator_ParseSubmissionReceived_Call) RunAndReturn(run func(types.Log) (*flux_aggregator_wrapper.FluxAggregatorSubmissionReceived, error)) *FluxAggregator_ParseSubmissionReceived_Call { + _c.Call.Return(run) + return _c +} + // ParseValidatorUpdated provides a mock function with given fields: log func (_m *FluxAggregator) ParseValidatorUpdated(log types.Log) (*flux_aggregator_wrapper.FluxAggregatorValidatorUpdated, error) { ret := _m.Called(log) @@ -1528,6 +2974,34 @@ func (_m *FluxAggregator) ParseValidatorUpdated(log types.Log) (*flux_aggregator return r0, r1 } +// FluxAggregator_ParseValidatorUpdated_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseValidatorUpdated' +type FluxAggregator_ParseValidatorUpdated_Call struct { + *mock.Call +} + +// ParseValidatorUpdated is a helper method to define mock.On call +// - log types.Log +func (_e *FluxAggregator_Expecter) ParseValidatorUpdated(log interface{}) *FluxAggregator_ParseValidatorUpdated_Call { + return &FluxAggregator_ParseValidatorUpdated_Call{Call: _e.mock.On("ParseValidatorUpdated", log)} +} + +func (_c *FluxAggregator_ParseValidatorUpdated_Call) Run(run func(log types.Log)) *FluxAggregator_ParseValidatorUpdated_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *FluxAggregator_ParseValidatorUpdated_Call) Return(_a0 *flux_aggregator_wrapper.FluxAggregatorValidatorUpdated, _a1 error) *FluxAggregator_ParseValidatorUpdated_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FluxAggregator_ParseValidatorUpdated_Call) RunAndReturn(run func(types.Log) (*flux_aggregator_wrapper.FluxAggregatorValidatorUpdated, error)) *FluxAggregator_ParseValidatorUpdated_Call { + _c.Call.Return(run) + return _c +} + // PaymentAmount provides a mock function with given fields: opts func (_m *FluxAggregator) PaymentAmount(opts *bind.CallOpts) (*big.Int, error) { ret := _m.Called(opts) @@ -1558,6 +3032,34 @@ func (_m *FluxAggregator) PaymentAmount(opts *bind.CallOpts) (*big.Int, error) { return r0, r1 } +// FluxAggregator_PaymentAmount_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PaymentAmount' +type FluxAggregator_PaymentAmount_Call struct { + *mock.Call +} + +// PaymentAmount is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *FluxAggregator_Expecter) PaymentAmount(opts interface{}) *FluxAggregator_PaymentAmount_Call { + return &FluxAggregator_PaymentAmount_Call{Call: _e.mock.On("PaymentAmount", opts)} +} + +func (_c *FluxAggregator_PaymentAmount_Call) Run(run func(opts *bind.CallOpts)) *FluxAggregator_PaymentAmount_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *FluxAggregator_PaymentAmount_Call) Return(_a0 *big.Int, _a1 error) *FluxAggregator_PaymentAmount_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FluxAggregator_PaymentAmount_Call) RunAndReturn(run func(*bind.CallOpts) (*big.Int, error)) *FluxAggregator_PaymentAmount_Call { + _c.Call.Return(run) + return _c +} + // RequestNewRound provides a mock function with given fields: opts func (_m *FluxAggregator) RequestNewRound(opts *bind.TransactOpts) (*types.Transaction, error) { ret := _m.Called(opts) @@ -1588,6 +3090,34 @@ func (_m *FluxAggregator) RequestNewRound(opts *bind.TransactOpts) (*types.Trans return r0, r1 } +// FluxAggregator_RequestNewRound_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RequestNewRound' +type FluxAggregator_RequestNewRound_Call struct { + *mock.Call +} + +// RequestNewRound is a helper method to define mock.On call +// - opts *bind.TransactOpts +func (_e *FluxAggregator_Expecter) RequestNewRound(opts interface{}) *FluxAggregator_RequestNewRound_Call { + return &FluxAggregator_RequestNewRound_Call{Call: _e.mock.On("RequestNewRound", opts)} +} + +func (_c *FluxAggregator_RequestNewRound_Call) Run(run func(opts *bind.TransactOpts)) *FluxAggregator_RequestNewRound_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts)) + }) + return _c +} + +func (_c *FluxAggregator_RequestNewRound_Call) Return(_a0 *types.Transaction, _a1 error) *FluxAggregator_RequestNewRound_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FluxAggregator_RequestNewRound_Call) RunAndReturn(run func(*bind.TransactOpts) (*types.Transaction, error)) *FluxAggregator_RequestNewRound_Call { + _c.Call.Return(run) + return _c +} + // RestartDelay provides a mock function with given fields: opts func (_m *FluxAggregator) RestartDelay(opts *bind.CallOpts) (uint32, error) { ret := _m.Called(opts) @@ -1613,7 +3143,35 @@ func (_m *FluxAggregator) RestartDelay(opts *bind.CallOpts) (uint32, error) { r1 = ret.Error(1) } - return r0, r1 + return r0, r1 +} + +// FluxAggregator_RestartDelay_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RestartDelay' +type FluxAggregator_RestartDelay_Call struct { + *mock.Call +} + +// RestartDelay is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *FluxAggregator_Expecter) RestartDelay(opts interface{}) *FluxAggregator_RestartDelay_Call { + return &FluxAggregator_RestartDelay_Call{Call: _e.mock.On("RestartDelay", opts)} +} + +func (_c *FluxAggregator_RestartDelay_Call) Run(run func(opts *bind.CallOpts)) *FluxAggregator_RestartDelay_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *FluxAggregator_RestartDelay_Call) Return(_a0 uint32, _a1 error) *FluxAggregator_RestartDelay_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FluxAggregator_RestartDelay_Call) RunAndReturn(run func(*bind.CallOpts) (uint32, error)) *FluxAggregator_RestartDelay_Call { + _c.Call.Return(run) + return _c } // SetRequesterPermissions provides a mock function with given fields: opts, _requester, _authorized, _delay @@ -1646,6 +3204,37 @@ func (_m *FluxAggregator) SetRequesterPermissions(opts *bind.TransactOpts, _requ return r0, r1 } +// FluxAggregator_SetRequesterPermissions_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetRequesterPermissions' +type FluxAggregator_SetRequesterPermissions_Call struct { + *mock.Call +} + +// SetRequesterPermissions is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - _requester common.Address +// - _authorized bool +// - _delay uint32 +func (_e *FluxAggregator_Expecter) SetRequesterPermissions(opts interface{}, _requester interface{}, _authorized interface{}, _delay interface{}) *FluxAggregator_SetRequesterPermissions_Call { + return &FluxAggregator_SetRequesterPermissions_Call{Call: _e.mock.On("SetRequesterPermissions", opts, _requester, _authorized, _delay)} +} + +func (_c *FluxAggregator_SetRequesterPermissions_Call) Run(run func(opts *bind.TransactOpts, _requester common.Address, _authorized bool, _delay uint32)) *FluxAggregator_SetRequesterPermissions_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].(common.Address), args[2].(bool), args[3].(uint32)) + }) + return _c +} + +func (_c *FluxAggregator_SetRequesterPermissions_Call) Return(_a0 *types.Transaction, _a1 error) *FluxAggregator_SetRequesterPermissions_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FluxAggregator_SetRequesterPermissions_Call) RunAndReturn(run func(*bind.TransactOpts, common.Address, bool, uint32) (*types.Transaction, error)) *FluxAggregator_SetRequesterPermissions_Call { + _c.Call.Return(run) + return _c +} + // SetValidator provides a mock function with given fields: opts, _newValidator func (_m *FluxAggregator) SetValidator(opts *bind.TransactOpts, _newValidator common.Address) (*types.Transaction, error) { ret := _m.Called(opts, _newValidator) @@ -1676,6 +3265,35 @@ func (_m *FluxAggregator) SetValidator(opts *bind.TransactOpts, _newValidator co return r0, r1 } +// FluxAggregator_SetValidator_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetValidator' +type FluxAggregator_SetValidator_Call struct { + *mock.Call +} + +// SetValidator is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - _newValidator common.Address +func (_e *FluxAggregator_Expecter) SetValidator(opts interface{}, _newValidator interface{}) *FluxAggregator_SetValidator_Call { + return &FluxAggregator_SetValidator_Call{Call: _e.mock.On("SetValidator", opts, _newValidator)} +} + +func (_c *FluxAggregator_SetValidator_Call) Run(run func(opts *bind.TransactOpts, _newValidator common.Address)) *FluxAggregator_SetValidator_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].(common.Address)) + }) + return _c +} + +func (_c *FluxAggregator_SetValidator_Call) Return(_a0 *types.Transaction, _a1 error) *FluxAggregator_SetValidator_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FluxAggregator_SetValidator_Call) RunAndReturn(run func(*bind.TransactOpts, common.Address) (*types.Transaction, error)) *FluxAggregator_SetValidator_Call { + _c.Call.Return(run) + return _c +} + // Submit provides a mock function with given fields: opts, _roundId, _submission func (_m *FluxAggregator) Submit(opts *bind.TransactOpts, _roundId *big.Int, _submission *big.Int) (*types.Transaction, error) { ret := _m.Called(opts, _roundId, _submission) @@ -1706,6 +3324,36 @@ func (_m *FluxAggregator) Submit(opts *bind.TransactOpts, _roundId *big.Int, _su return r0, r1 } +// FluxAggregator_Submit_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Submit' +type FluxAggregator_Submit_Call struct { + *mock.Call +} + +// Submit is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - _roundId *big.Int +// - _submission *big.Int +func (_e *FluxAggregator_Expecter) Submit(opts interface{}, _roundId interface{}, _submission interface{}) *FluxAggregator_Submit_Call { + return &FluxAggregator_Submit_Call{Call: _e.mock.On("Submit", opts, _roundId, _submission)} +} + +func (_c *FluxAggregator_Submit_Call) Run(run func(opts *bind.TransactOpts, _roundId *big.Int, _submission *big.Int)) *FluxAggregator_Submit_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].(*big.Int), args[2].(*big.Int)) + }) + return _c +} + +func (_c *FluxAggregator_Submit_Call) Return(_a0 *types.Transaction, _a1 error) *FluxAggregator_Submit_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FluxAggregator_Submit_Call) RunAndReturn(run func(*bind.TransactOpts, *big.Int, *big.Int) (*types.Transaction, error)) *FluxAggregator_Submit_Call { + _c.Call.Return(run) + return _c +} + // Timeout provides a mock function with given fields: opts func (_m *FluxAggregator) Timeout(opts *bind.CallOpts) (uint32, error) { ret := _m.Called(opts) @@ -1734,6 +3382,34 @@ func (_m *FluxAggregator) Timeout(opts *bind.CallOpts) (uint32, error) { return r0, r1 } +// FluxAggregator_Timeout_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Timeout' +type FluxAggregator_Timeout_Call struct { + *mock.Call +} + +// Timeout is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *FluxAggregator_Expecter) Timeout(opts interface{}) *FluxAggregator_Timeout_Call { + return &FluxAggregator_Timeout_Call{Call: _e.mock.On("Timeout", opts)} +} + +func (_c *FluxAggregator_Timeout_Call) Run(run func(opts *bind.CallOpts)) *FluxAggregator_Timeout_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *FluxAggregator_Timeout_Call) Return(_a0 uint32, _a1 error) *FluxAggregator_Timeout_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FluxAggregator_Timeout_Call) RunAndReturn(run func(*bind.CallOpts) (uint32, error)) *FluxAggregator_Timeout_Call { + _c.Call.Return(run) + return _c +} + // TransferAdmin provides a mock function with given fields: opts, _oracle, _newAdmin func (_m *FluxAggregator) TransferAdmin(opts *bind.TransactOpts, _oracle common.Address, _newAdmin common.Address) (*types.Transaction, error) { ret := _m.Called(opts, _oracle, _newAdmin) @@ -1764,6 +3440,36 @@ func (_m *FluxAggregator) TransferAdmin(opts *bind.TransactOpts, _oracle common. return r0, r1 } +// FluxAggregator_TransferAdmin_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TransferAdmin' +type FluxAggregator_TransferAdmin_Call struct { + *mock.Call +} + +// TransferAdmin is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - _oracle common.Address +// - _newAdmin common.Address +func (_e *FluxAggregator_Expecter) TransferAdmin(opts interface{}, _oracle interface{}, _newAdmin interface{}) *FluxAggregator_TransferAdmin_Call { + return &FluxAggregator_TransferAdmin_Call{Call: _e.mock.On("TransferAdmin", opts, _oracle, _newAdmin)} +} + +func (_c *FluxAggregator_TransferAdmin_Call) Run(run func(opts *bind.TransactOpts, _oracle common.Address, _newAdmin common.Address)) *FluxAggregator_TransferAdmin_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].(common.Address), args[2].(common.Address)) + }) + return _c +} + +func (_c *FluxAggregator_TransferAdmin_Call) Return(_a0 *types.Transaction, _a1 error) *FluxAggregator_TransferAdmin_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FluxAggregator_TransferAdmin_Call) RunAndReturn(run func(*bind.TransactOpts, common.Address, common.Address) (*types.Transaction, error)) *FluxAggregator_TransferAdmin_Call { + _c.Call.Return(run) + return _c +} + // TransferOwnership provides a mock function with given fields: opts, _to func (_m *FluxAggregator) TransferOwnership(opts *bind.TransactOpts, _to common.Address) (*types.Transaction, error) { ret := _m.Called(opts, _to) @@ -1794,6 +3500,35 @@ func (_m *FluxAggregator) TransferOwnership(opts *bind.TransactOpts, _to common. return r0, r1 } +// FluxAggregator_TransferOwnership_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TransferOwnership' +type FluxAggregator_TransferOwnership_Call struct { + *mock.Call +} + +// TransferOwnership is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - _to common.Address +func (_e *FluxAggregator_Expecter) TransferOwnership(opts interface{}, _to interface{}) *FluxAggregator_TransferOwnership_Call { + return &FluxAggregator_TransferOwnership_Call{Call: _e.mock.On("TransferOwnership", opts, _to)} +} + +func (_c *FluxAggregator_TransferOwnership_Call) Run(run func(opts *bind.TransactOpts, _to common.Address)) *FluxAggregator_TransferOwnership_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].(common.Address)) + }) + return _c +} + +func (_c *FluxAggregator_TransferOwnership_Call) Return(_a0 *types.Transaction, _a1 error) *FluxAggregator_TransferOwnership_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FluxAggregator_TransferOwnership_Call) RunAndReturn(run func(*bind.TransactOpts, common.Address) (*types.Transaction, error)) *FluxAggregator_TransferOwnership_Call { + _c.Call.Return(run) + return _c +} + // UpdateAvailableFunds provides a mock function with given fields: opts func (_m *FluxAggregator) UpdateAvailableFunds(opts *bind.TransactOpts) (*types.Transaction, error) { ret := _m.Called(opts) @@ -1824,6 +3559,34 @@ func (_m *FluxAggregator) UpdateAvailableFunds(opts *bind.TransactOpts) (*types. return r0, r1 } +// FluxAggregator_UpdateAvailableFunds_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateAvailableFunds' +type FluxAggregator_UpdateAvailableFunds_Call struct { + *mock.Call +} + +// UpdateAvailableFunds is a helper method to define mock.On call +// - opts *bind.TransactOpts +func (_e *FluxAggregator_Expecter) UpdateAvailableFunds(opts interface{}) *FluxAggregator_UpdateAvailableFunds_Call { + return &FluxAggregator_UpdateAvailableFunds_Call{Call: _e.mock.On("UpdateAvailableFunds", opts)} +} + +func (_c *FluxAggregator_UpdateAvailableFunds_Call) Run(run func(opts *bind.TransactOpts)) *FluxAggregator_UpdateAvailableFunds_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts)) + }) + return _c +} + +func (_c *FluxAggregator_UpdateAvailableFunds_Call) Return(_a0 *types.Transaction, _a1 error) *FluxAggregator_UpdateAvailableFunds_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FluxAggregator_UpdateAvailableFunds_Call) RunAndReturn(run func(*bind.TransactOpts) (*types.Transaction, error)) *FluxAggregator_UpdateAvailableFunds_Call { + _c.Call.Return(run) + return _c +} + // UpdateFutureRounds provides a mock function with given fields: opts, _paymentAmount, _minSubmissions, _maxSubmissions, _restartDelay, _timeout func (_m *FluxAggregator) UpdateFutureRounds(opts *bind.TransactOpts, _paymentAmount *big.Int, _minSubmissions uint32, _maxSubmissions uint32, _restartDelay uint32, _timeout uint32) (*types.Transaction, error) { ret := _m.Called(opts, _paymentAmount, _minSubmissions, _maxSubmissions, _restartDelay, _timeout) @@ -1854,6 +3617,39 @@ func (_m *FluxAggregator) UpdateFutureRounds(opts *bind.TransactOpts, _paymentAm return r0, r1 } +// FluxAggregator_UpdateFutureRounds_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateFutureRounds' +type FluxAggregator_UpdateFutureRounds_Call struct { + *mock.Call +} + +// UpdateFutureRounds is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - _paymentAmount *big.Int +// - _minSubmissions uint32 +// - _maxSubmissions uint32 +// - _restartDelay uint32 +// - _timeout uint32 +func (_e *FluxAggregator_Expecter) UpdateFutureRounds(opts interface{}, _paymentAmount interface{}, _minSubmissions interface{}, _maxSubmissions interface{}, _restartDelay interface{}, _timeout interface{}) *FluxAggregator_UpdateFutureRounds_Call { + return &FluxAggregator_UpdateFutureRounds_Call{Call: _e.mock.On("UpdateFutureRounds", opts, _paymentAmount, _minSubmissions, _maxSubmissions, _restartDelay, _timeout)} +} + +func (_c *FluxAggregator_UpdateFutureRounds_Call) Run(run func(opts *bind.TransactOpts, _paymentAmount *big.Int, _minSubmissions uint32, _maxSubmissions uint32, _restartDelay uint32, _timeout uint32)) *FluxAggregator_UpdateFutureRounds_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].(*big.Int), args[2].(uint32), args[3].(uint32), args[4].(uint32), args[5].(uint32)) + }) + return _c +} + +func (_c *FluxAggregator_UpdateFutureRounds_Call) Return(_a0 *types.Transaction, _a1 error) *FluxAggregator_UpdateFutureRounds_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FluxAggregator_UpdateFutureRounds_Call) RunAndReturn(run func(*bind.TransactOpts, *big.Int, uint32, uint32, uint32, uint32) (*types.Transaction, error)) *FluxAggregator_UpdateFutureRounds_Call { + _c.Call.Return(run) + return _c +} + // Validator provides a mock function with given fields: opts func (_m *FluxAggregator) Validator(opts *bind.CallOpts) (common.Address, error) { ret := _m.Called(opts) @@ -1884,6 +3680,34 @@ func (_m *FluxAggregator) Validator(opts *bind.CallOpts) (common.Address, error) return r0, r1 } +// FluxAggregator_Validator_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Validator' +type FluxAggregator_Validator_Call struct { + *mock.Call +} + +// Validator is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *FluxAggregator_Expecter) Validator(opts interface{}) *FluxAggregator_Validator_Call { + return &FluxAggregator_Validator_Call{Call: _e.mock.On("Validator", opts)} +} + +func (_c *FluxAggregator_Validator_Call) Run(run func(opts *bind.CallOpts)) *FluxAggregator_Validator_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *FluxAggregator_Validator_Call) Return(_a0 common.Address, _a1 error) *FluxAggregator_Validator_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FluxAggregator_Validator_Call) RunAndReturn(run func(*bind.CallOpts) (common.Address, error)) *FluxAggregator_Validator_Call { + _c.Call.Return(run) + return _c +} + // Version provides a mock function with given fields: opts func (_m *FluxAggregator) Version(opts *bind.CallOpts) (*big.Int, error) { ret := _m.Called(opts) @@ -1914,6 +3738,34 @@ func (_m *FluxAggregator) Version(opts *bind.CallOpts) (*big.Int, error) { return r0, r1 } +// FluxAggregator_Version_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Version' +type FluxAggregator_Version_Call struct { + *mock.Call +} + +// Version is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *FluxAggregator_Expecter) Version(opts interface{}) *FluxAggregator_Version_Call { + return &FluxAggregator_Version_Call{Call: _e.mock.On("Version", opts)} +} + +func (_c *FluxAggregator_Version_Call) Run(run func(opts *bind.CallOpts)) *FluxAggregator_Version_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *FluxAggregator_Version_Call) Return(_a0 *big.Int, _a1 error) *FluxAggregator_Version_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FluxAggregator_Version_Call) RunAndReturn(run func(*bind.CallOpts) (*big.Int, error)) *FluxAggregator_Version_Call { + _c.Call.Return(run) + return _c +} + // WatchAnswerUpdated provides a mock function with given fields: opts, sink, current, roundId func (_m *FluxAggregator) WatchAnswerUpdated(opts *bind.WatchOpts, sink chan<- *flux_aggregator_wrapper.FluxAggregatorAnswerUpdated, current []*big.Int, roundId []*big.Int) (event.Subscription, error) { ret := _m.Called(opts, sink, current, roundId) @@ -1944,6 +3796,37 @@ func (_m *FluxAggregator) WatchAnswerUpdated(opts *bind.WatchOpts, sink chan<- * return r0, r1 } +// FluxAggregator_WatchAnswerUpdated_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchAnswerUpdated' +type FluxAggregator_WatchAnswerUpdated_Call struct { + *mock.Call +} + +// WatchAnswerUpdated is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *flux_aggregator_wrapper.FluxAggregatorAnswerUpdated +// - current []*big.Int +// - roundId []*big.Int +func (_e *FluxAggregator_Expecter) WatchAnswerUpdated(opts interface{}, sink interface{}, current interface{}, roundId interface{}) *FluxAggregator_WatchAnswerUpdated_Call { + return &FluxAggregator_WatchAnswerUpdated_Call{Call: _e.mock.On("WatchAnswerUpdated", opts, sink, current, roundId)} +} + +func (_c *FluxAggregator_WatchAnswerUpdated_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *flux_aggregator_wrapper.FluxAggregatorAnswerUpdated, current []*big.Int, roundId []*big.Int)) *FluxAggregator_WatchAnswerUpdated_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *flux_aggregator_wrapper.FluxAggregatorAnswerUpdated), args[2].([]*big.Int), args[3].([]*big.Int)) + }) + return _c +} + +func (_c *FluxAggregator_WatchAnswerUpdated_Call) Return(_a0 event.Subscription, _a1 error) *FluxAggregator_WatchAnswerUpdated_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FluxAggregator_WatchAnswerUpdated_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *flux_aggregator_wrapper.FluxAggregatorAnswerUpdated, []*big.Int, []*big.Int) (event.Subscription, error)) *FluxAggregator_WatchAnswerUpdated_Call { + _c.Call.Return(run) + return _c +} + // WatchAvailableFundsUpdated provides a mock function with given fields: opts, sink, amount func (_m *FluxAggregator) WatchAvailableFundsUpdated(opts *bind.WatchOpts, sink chan<- *flux_aggregator_wrapper.FluxAggregatorAvailableFundsUpdated, amount []*big.Int) (event.Subscription, error) { ret := _m.Called(opts, sink, amount) @@ -1974,6 +3857,36 @@ func (_m *FluxAggregator) WatchAvailableFundsUpdated(opts *bind.WatchOpts, sink return r0, r1 } +// FluxAggregator_WatchAvailableFundsUpdated_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchAvailableFundsUpdated' +type FluxAggregator_WatchAvailableFundsUpdated_Call struct { + *mock.Call +} + +// WatchAvailableFundsUpdated is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *flux_aggregator_wrapper.FluxAggregatorAvailableFundsUpdated +// - amount []*big.Int +func (_e *FluxAggregator_Expecter) WatchAvailableFundsUpdated(opts interface{}, sink interface{}, amount interface{}) *FluxAggregator_WatchAvailableFundsUpdated_Call { + return &FluxAggregator_WatchAvailableFundsUpdated_Call{Call: _e.mock.On("WatchAvailableFundsUpdated", opts, sink, amount)} +} + +func (_c *FluxAggregator_WatchAvailableFundsUpdated_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *flux_aggregator_wrapper.FluxAggregatorAvailableFundsUpdated, amount []*big.Int)) *FluxAggregator_WatchAvailableFundsUpdated_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *flux_aggregator_wrapper.FluxAggregatorAvailableFundsUpdated), args[2].([]*big.Int)) + }) + return _c +} + +func (_c *FluxAggregator_WatchAvailableFundsUpdated_Call) Return(_a0 event.Subscription, _a1 error) *FluxAggregator_WatchAvailableFundsUpdated_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FluxAggregator_WatchAvailableFundsUpdated_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *flux_aggregator_wrapper.FluxAggregatorAvailableFundsUpdated, []*big.Int) (event.Subscription, error)) *FluxAggregator_WatchAvailableFundsUpdated_Call { + _c.Call.Return(run) + return _c +} + // WatchNewRound provides a mock function with given fields: opts, sink, roundId, startedBy func (_m *FluxAggregator) WatchNewRound(opts *bind.WatchOpts, sink chan<- *flux_aggregator_wrapper.FluxAggregatorNewRound, roundId []*big.Int, startedBy []common.Address) (event.Subscription, error) { ret := _m.Called(opts, sink, roundId, startedBy) @@ -2004,6 +3917,37 @@ func (_m *FluxAggregator) WatchNewRound(opts *bind.WatchOpts, sink chan<- *flux_ return r0, r1 } +// FluxAggregator_WatchNewRound_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchNewRound' +type FluxAggregator_WatchNewRound_Call struct { + *mock.Call +} + +// WatchNewRound is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *flux_aggregator_wrapper.FluxAggregatorNewRound +// - roundId []*big.Int +// - startedBy []common.Address +func (_e *FluxAggregator_Expecter) WatchNewRound(opts interface{}, sink interface{}, roundId interface{}, startedBy interface{}) *FluxAggregator_WatchNewRound_Call { + return &FluxAggregator_WatchNewRound_Call{Call: _e.mock.On("WatchNewRound", opts, sink, roundId, startedBy)} +} + +func (_c *FluxAggregator_WatchNewRound_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *flux_aggregator_wrapper.FluxAggregatorNewRound, roundId []*big.Int, startedBy []common.Address)) *FluxAggregator_WatchNewRound_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *flux_aggregator_wrapper.FluxAggregatorNewRound), args[2].([]*big.Int), args[3].([]common.Address)) + }) + return _c +} + +func (_c *FluxAggregator_WatchNewRound_Call) Return(_a0 event.Subscription, _a1 error) *FluxAggregator_WatchNewRound_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FluxAggregator_WatchNewRound_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *flux_aggregator_wrapper.FluxAggregatorNewRound, []*big.Int, []common.Address) (event.Subscription, error)) *FluxAggregator_WatchNewRound_Call { + _c.Call.Return(run) + return _c +} + // WatchOracleAdminUpdateRequested provides a mock function with given fields: opts, sink, oracle func (_m *FluxAggregator) WatchOracleAdminUpdateRequested(opts *bind.WatchOpts, sink chan<- *flux_aggregator_wrapper.FluxAggregatorOracleAdminUpdateRequested, oracle []common.Address) (event.Subscription, error) { ret := _m.Called(opts, sink, oracle) @@ -2034,6 +3978,36 @@ func (_m *FluxAggregator) WatchOracleAdminUpdateRequested(opts *bind.WatchOpts, return r0, r1 } +// FluxAggregator_WatchOracleAdminUpdateRequested_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchOracleAdminUpdateRequested' +type FluxAggregator_WatchOracleAdminUpdateRequested_Call struct { + *mock.Call +} + +// WatchOracleAdminUpdateRequested is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *flux_aggregator_wrapper.FluxAggregatorOracleAdminUpdateRequested +// - oracle []common.Address +func (_e *FluxAggregator_Expecter) WatchOracleAdminUpdateRequested(opts interface{}, sink interface{}, oracle interface{}) *FluxAggregator_WatchOracleAdminUpdateRequested_Call { + return &FluxAggregator_WatchOracleAdminUpdateRequested_Call{Call: _e.mock.On("WatchOracleAdminUpdateRequested", opts, sink, oracle)} +} + +func (_c *FluxAggregator_WatchOracleAdminUpdateRequested_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *flux_aggregator_wrapper.FluxAggregatorOracleAdminUpdateRequested, oracle []common.Address)) *FluxAggregator_WatchOracleAdminUpdateRequested_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *flux_aggregator_wrapper.FluxAggregatorOracleAdminUpdateRequested), args[2].([]common.Address)) + }) + return _c +} + +func (_c *FluxAggregator_WatchOracleAdminUpdateRequested_Call) Return(_a0 event.Subscription, _a1 error) *FluxAggregator_WatchOracleAdminUpdateRequested_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FluxAggregator_WatchOracleAdminUpdateRequested_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *flux_aggregator_wrapper.FluxAggregatorOracleAdminUpdateRequested, []common.Address) (event.Subscription, error)) *FluxAggregator_WatchOracleAdminUpdateRequested_Call { + _c.Call.Return(run) + return _c +} + // WatchOracleAdminUpdated provides a mock function with given fields: opts, sink, oracle, newAdmin func (_m *FluxAggregator) WatchOracleAdminUpdated(opts *bind.WatchOpts, sink chan<- *flux_aggregator_wrapper.FluxAggregatorOracleAdminUpdated, oracle []common.Address, newAdmin []common.Address) (event.Subscription, error) { ret := _m.Called(opts, sink, oracle, newAdmin) @@ -2064,6 +4038,37 @@ func (_m *FluxAggregator) WatchOracleAdminUpdated(opts *bind.WatchOpts, sink cha return r0, r1 } +// FluxAggregator_WatchOracleAdminUpdated_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchOracleAdminUpdated' +type FluxAggregator_WatchOracleAdminUpdated_Call struct { + *mock.Call +} + +// WatchOracleAdminUpdated is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *flux_aggregator_wrapper.FluxAggregatorOracleAdminUpdated +// - oracle []common.Address +// - newAdmin []common.Address +func (_e *FluxAggregator_Expecter) WatchOracleAdminUpdated(opts interface{}, sink interface{}, oracle interface{}, newAdmin interface{}) *FluxAggregator_WatchOracleAdminUpdated_Call { + return &FluxAggregator_WatchOracleAdminUpdated_Call{Call: _e.mock.On("WatchOracleAdminUpdated", opts, sink, oracle, newAdmin)} +} + +func (_c *FluxAggregator_WatchOracleAdminUpdated_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *flux_aggregator_wrapper.FluxAggregatorOracleAdminUpdated, oracle []common.Address, newAdmin []common.Address)) *FluxAggregator_WatchOracleAdminUpdated_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *flux_aggregator_wrapper.FluxAggregatorOracleAdminUpdated), args[2].([]common.Address), args[3].([]common.Address)) + }) + return _c +} + +func (_c *FluxAggregator_WatchOracleAdminUpdated_Call) Return(_a0 event.Subscription, _a1 error) *FluxAggregator_WatchOracleAdminUpdated_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FluxAggregator_WatchOracleAdminUpdated_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *flux_aggregator_wrapper.FluxAggregatorOracleAdminUpdated, []common.Address, []common.Address) (event.Subscription, error)) *FluxAggregator_WatchOracleAdminUpdated_Call { + _c.Call.Return(run) + return _c +} + // WatchOraclePermissionsUpdated provides a mock function with given fields: opts, sink, oracle, whitelisted func (_m *FluxAggregator) WatchOraclePermissionsUpdated(opts *bind.WatchOpts, sink chan<- *flux_aggregator_wrapper.FluxAggregatorOraclePermissionsUpdated, oracle []common.Address, whitelisted []bool) (event.Subscription, error) { ret := _m.Called(opts, sink, oracle, whitelisted) @@ -2094,6 +4099,37 @@ func (_m *FluxAggregator) WatchOraclePermissionsUpdated(opts *bind.WatchOpts, si return r0, r1 } +// FluxAggregator_WatchOraclePermissionsUpdated_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchOraclePermissionsUpdated' +type FluxAggregator_WatchOraclePermissionsUpdated_Call struct { + *mock.Call +} + +// WatchOraclePermissionsUpdated is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *flux_aggregator_wrapper.FluxAggregatorOraclePermissionsUpdated +// - oracle []common.Address +// - whitelisted []bool +func (_e *FluxAggregator_Expecter) WatchOraclePermissionsUpdated(opts interface{}, sink interface{}, oracle interface{}, whitelisted interface{}) *FluxAggregator_WatchOraclePermissionsUpdated_Call { + return &FluxAggregator_WatchOraclePermissionsUpdated_Call{Call: _e.mock.On("WatchOraclePermissionsUpdated", opts, sink, oracle, whitelisted)} +} + +func (_c *FluxAggregator_WatchOraclePermissionsUpdated_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *flux_aggregator_wrapper.FluxAggregatorOraclePermissionsUpdated, oracle []common.Address, whitelisted []bool)) *FluxAggregator_WatchOraclePermissionsUpdated_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *flux_aggregator_wrapper.FluxAggregatorOraclePermissionsUpdated), args[2].([]common.Address), args[3].([]bool)) + }) + return _c +} + +func (_c *FluxAggregator_WatchOraclePermissionsUpdated_Call) Return(_a0 event.Subscription, _a1 error) *FluxAggregator_WatchOraclePermissionsUpdated_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FluxAggregator_WatchOraclePermissionsUpdated_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *flux_aggregator_wrapper.FluxAggregatorOraclePermissionsUpdated, []common.Address, []bool) (event.Subscription, error)) *FluxAggregator_WatchOraclePermissionsUpdated_Call { + _c.Call.Return(run) + return _c +} + // WatchOwnershipTransferRequested provides a mock function with given fields: opts, sink, from, to func (_m *FluxAggregator) WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *flux_aggregator_wrapper.FluxAggregatorOwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) { ret := _m.Called(opts, sink, from, to) @@ -2124,6 +4160,37 @@ func (_m *FluxAggregator) WatchOwnershipTransferRequested(opts *bind.WatchOpts, return r0, r1 } +// FluxAggregator_WatchOwnershipTransferRequested_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchOwnershipTransferRequested' +type FluxAggregator_WatchOwnershipTransferRequested_Call struct { + *mock.Call +} + +// WatchOwnershipTransferRequested is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *flux_aggregator_wrapper.FluxAggregatorOwnershipTransferRequested +// - from []common.Address +// - to []common.Address +func (_e *FluxAggregator_Expecter) WatchOwnershipTransferRequested(opts interface{}, sink interface{}, from interface{}, to interface{}) *FluxAggregator_WatchOwnershipTransferRequested_Call { + return &FluxAggregator_WatchOwnershipTransferRequested_Call{Call: _e.mock.On("WatchOwnershipTransferRequested", opts, sink, from, to)} +} + +func (_c *FluxAggregator_WatchOwnershipTransferRequested_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *flux_aggregator_wrapper.FluxAggregatorOwnershipTransferRequested, from []common.Address, to []common.Address)) *FluxAggregator_WatchOwnershipTransferRequested_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *flux_aggregator_wrapper.FluxAggregatorOwnershipTransferRequested), args[2].([]common.Address), args[3].([]common.Address)) + }) + return _c +} + +func (_c *FluxAggregator_WatchOwnershipTransferRequested_Call) Return(_a0 event.Subscription, _a1 error) *FluxAggregator_WatchOwnershipTransferRequested_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FluxAggregator_WatchOwnershipTransferRequested_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *flux_aggregator_wrapper.FluxAggregatorOwnershipTransferRequested, []common.Address, []common.Address) (event.Subscription, error)) *FluxAggregator_WatchOwnershipTransferRequested_Call { + _c.Call.Return(run) + return _c +} + // WatchOwnershipTransferred provides a mock function with given fields: opts, sink, from, to func (_m *FluxAggregator) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *flux_aggregator_wrapper.FluxAggregatorOwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) { ret := _m.Called(opts, sink, from, to) @@ -2154,6 +4221,37 @@ func (_m *FluxAggregator) WatchOwnershipTransferred(opts *bind.WatchOpts, sink c return r0, r1 } +// FluxAggregator_WatchOwnershipTransferred_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchOwnershipTransferred' +type FluxAggregator_WatchOwnershipTransferred_Call struct { + *mock.Call +} + +// WatchOwnershipTransferred is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *flux_aggregator_wrapper.FluxAggregatorOwnershipTransferred +// - from []common.Address +// - to []common.Address +func (_e *FluxAggregator_Expecter) WatchOwnershipTransferred(opts interface{}, sink interface{}, from interface{}, to interface{}) *FluxAggregator_WatchOwnershipTransferred_Call { + return &FluxAggregator_WatchOwnershipTransferred_Call{Call: _e.mock.On("WatchOwnershipTransferred", opts, sink, from, to)} +} + +func (_c *FluxAggregator_WatchOwnershipTransferred_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *flux_aggregator_wrapper.FluxAggregatorOwnershipTransferred, from []common.Address, to []common.Address)) *FluxAggregator_WatchOwnershipTransferred_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *flux_aggregator_wrapper.FluxAggregatorOwnershipTransferred), args[2].([]common.Address), args[3].([]common.Address)) + }) + return _c +} + +func (_c *FluxAggregator_WatchOwnershipTransferred_Call) Return(_a0 event.Subscription, _a1 error) *FluxAggregator_WatchOwnershipTransferred_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FluxAggregator_WatchOwnershipTransferred_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *flux_aggregator_wrapper.FluxAggregatorOwnershipTransferred, []common.Address, []common.Address) (event.Subscription, error)) *FluxAggregator_WatchOwnershipTransferred_Call { + _c.Call.Return(run) + return _c +} + // WatchRequesterPermissionsSet provides a mock function with given fields: opts, sink, requester func (_m *FluxAggregator) WatchRequesterPermissionsSet(opts *bind.WatchOpts, sink chan<- *flux_aggregator_wrapper.FluxAggregatorRequesterPermissionsSet, requester []common.Address) (event.Subscription, error) { ret := _m.Called(opts, sink, requester) @@ -2184,6 +4282,36 @@ func (_m *FluxAggregator) WatchRequesterPermissionsSet(opts *bind.WatchOpts, sin return r0, r1 } +// FluxAggregator_WatchRequesterPermissionsSet_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchRequesterPermissionsSet' +type FluxAggregator_WatchRequesterPermissionsSet_Call struct { + *mock.Call +} + +// WatchRequesterPermissionsSet is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *flux_aggregator_wrapper.FluxAggregatorRequesterPermissionsSet +// - requester []common.Address +func (_e *FluxAggregator_Expecter) WatchRequesterPermissionsSet(opts interface{}, sink interface{}, requester interface{}) *FluxAggregator_WatchRequesterPermissionsSet_Call { + return &FluxAggregator_WatchRequesterPermissionsSet_Call{Call: _e.mock.On("WatchRequesterPermissionsSet", opts, sink, requester)} +} + +func (_c *FluxAggregator_WatchRequesterPermissionsSet_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *flux_aggregator_wrapper.FluxAggregatorRequesterPermissionsSet, requester []common.Address)) *FluxAggregator_WatchRequesterPermissionsSet_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *flux_aggregator_wrapper.FluxAggregatorRequesterPermissionsSet), args[2].([]common.Address)) + }) + return _c +} + +func (_c *FluxAggregator_WatchRequesterPermissionsSet_Call) Return(_a0 event.Subscription, _a1 error) *FluxAggregator_WatchRequesterPermissionsSet_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FluxAggregator_WatchRequesterPermissionsSet_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *flux_aggregator_wrapper.FluxAggregatorRequesterPermissionsSet, []common.Address) (event.Subscription, error)) *FluxAggregator_WatchRequesterPermissionsSet_Call { + _c.Call.Return(run) + return _c +} + // WatchRoundDetailsUpdated provides a mock function with given fields: opts, sink, paymentAmount, minSubmissionCount, maxSubmissionCount func (_m *FluxAggregator) WatchRoundDetailsUpdated(opts *bind.WatchOpts, sink chan<- *flux_aggregator_wrapper.FluxAggregatorRoundDetailsUpdated, paymentAmount []*big.Int, minSubmissionCount []uint32, maxSubmissionCount []uint32) (event.Subscription, error) { ret := _m.Called(opts, sink, paymentAmount, minSubmissionCount, maxSubmissionCount) @@ -2214,6 +4342,38 @@ func (_m *FluxAggregator) WatchRoundDetailsUpdated(opts *bind.WatchOpts, sink ch return r0, r1 } +// FluxAggregator_WatchRoundDetailsUpdated_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchRoundDetailsUpdated' +type FluxAggregator_WatchRoundDetailsUpdated_Call struct { + *mock.Call +} + +// WatchRoundDetailsUpdated is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *flux_aggregator_wrapper.FluxAggregatorRoundDetailsUpdated +// - paymentAmount []*big.Int +// - minSubmissionCount []uint32 +// - maxSubmissionCount []uint32 +func (_e *FluxAggregator_Expecter) WatchRoundDetailsUpdated(opts interface{}, sink interface{}, paymentAmount interface{}, minSubmissionCount interface{}, maxSubmissionCount interface{}) *FluxAggregator_WatchRoundDetailsUpdated_Call { + return &FluxAggregator_WatchRoundDetailsUpdated_Call{Call: _e.mock.On("WatchRoundDetailsUpdated", opts, sink, paymentAmount, minSubmissionCount, maxSubmissionCount)} +} + +func (_c *FluxAggregator_WatchRoundDetailsUpdated_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *flux_aggregator_wrapper.FluxAggregatorRoundDetailsUpdated, paymentAmount []*big.Int, minSubmissionCount []uint32, maxSubmissionCount []uint32)) *FluxAggregator_WatchRoundDetailsUpdated_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *flux_aggregator_wrapper.FluxAggregatorRoundDetailsUpdated), args[2].([]*big.Int), args[3].([]uint32), args[4].([]uint32)) + }) + return _c +} + +func (_c *FluxAggregator_WatchRoundDetailsUpdated_Call) Return(_a0 event.Subscription, _a1 error) *FluxAggregator_WatchRoundDetailsUpdated_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FluxAggregator_WatchRoundDetailsUpdated_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *flux_aggregator_wrapper.FluxAggregatorRoundDetailsUpdated, []*big.Int, []uint32, []uint32) (event.Subscription, error)) *FluxAggregator_WatchRoundDetailsUpdated_Call { + _c.Call.Return(run) + return _c +} + // WatchSubmissionReceived provides a mock function with given fields: opts, sink, submission, round, oracle func (_m *FluxAggregator) WatchSubmissionReceived(opts *bind.WatchOpts, sink chan<- *flux_aggregator_wrapper.FluxAggregatorSubmissionReceived, submission []*big.Int, round []uint32, oracle []common.Address) (event.Subscription, error) { ret := _m.Called(opts, sink, submission, round, oracle) @@ -2244,6 +4404,38 @@ func (_m *FluxAggregator) WatchSubmissionReceived(opts *bind.WatchOpts, sink cha return r0, r1 } +// FluxAggregator_WatchSubmissionReceived_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchSubmissionReceived' +type FluxAggregator_WatchSubmissionReceived_Call struct { + *mock.Call +} + +// WatchSubmissionReceived is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *flux_aggregator_wrapper.FluxAggregatorSubmissionReceived +// - submission []*big.Int +// - round []uint32 +// - oracle []common.Address +func (_e *FluxAggregator_Expecter) WatchSubmissionReceived(opts interface{}, sink interface{}, submission interface{}, round interface{}, oracle interface{}) *FluxAggregator_WatchSubmissionReceived_Call { + return &FluxAggregator_WatchSubmissionReceived_Call{Call: _e.mock.On("WatchSubmissionReceived", opts, sink, submission, round, oracle)} +} + +func (_c *FluxAggregator_WatchSubmissionReceived_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *flux_aggregator_wrapper.FluxAggregatorSubmissionReceived, submission []*big.Int, round []uint32, oracle []common.Address)) *FluxAggregator_WatchSubmissionReceived_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *flux_aggregator_wrapper.FluxAggregatorSubmissionReceived), args[2].([]*big.Int), args[3].([]uint32), args[4].([]common.Address)) + }) + return _c +} + +func (_c *FluxAggregator_WatchSubmissionReceived_Call) Return(_a0 event.Subscription, _a1 error) *FluxAggregator_WatchSubmissionReceived_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FluxAggregator_WatchSubmissionReceived_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *flux_aggregator_wrapper.FluxAggregatorSubmissionReceived, []*big.Int, []uint32, []common.Address) (event.Subscription, error)) *FluxAggregator_WatchSubmissionReceived_Call { + _c.Call.Return(run) + return _c +} + // WatchValidatorUpdated provides a mock function with given fields: opts, sink, previous, current func (_m *FluxAggregator) WatchValidatorUpdated(opts *bind.WatchOpts, sink chan<- *flux_aggregator_wrapper.FluxAggregatorValidatorUpdated, previous []common.Address, current []common.Address) (event.Subscription, error) { ret := _m.Called(opts, sink, previous, current) @@ -2274,6 +4466,37 @@ func (_m *FluxAggregator) WatchValidatorUpdated(opts *bind.WatchOpts, sink chan< return r0, r1 } +// FluxAggregator_WatchValidatorUpdated_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchValidatorUpdated' +type FluxAggregator_WatchValidatorUpdated_Call struct { + *mock.Call +} + +// WatchValidatorUpdated is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *flux_aggregator_wrapper.FluxAggregatorValidatorUpdated +// - previous []common.Address +// - current []common.Address +func (_e *FluxAggregator_Expecter) WatchValidatorUpdated(opts interface{}, sink interface{}, previous interface{}, current interface{}) *FluxAggregator_WatchValidatorUpdated_Call { + return &FluxAggregator_WatchValidatorUpdated_Call{Call: _e.mock.On("WatchValidatorUpdated", opts, sink, previous, current)} +} + +func (_c *FluxAggregator_WatchValidatorUpdated_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *flux_aggregator_wrapper.FluxAggregatorValidatorUpdated, previous []common.Address, current []common.Address)) *FluxAggregator_WatchValidatorUpdated_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *flux_aggregator_wrapper.FluxAggregatorValidatorUpdated), args[2].([]common.Address), args[3].([]common.Address)) + }) + return _c +} + +func (_c *FluxAggregator_WatchValidatorUpdated_Call) Return(_a0 event.Subscription, _a1 error) *FluxAggregator_WatchValidatorUpdated_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FluxAggregator_WatchValidatorUpdated_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *flux_aggregator_wrapper.FluxAggregatorValidatorUpdated, []common.Address, []common.Address) (event.Subscription, error)) *FluxAggregator_WatchValidatorUpdated_Call { + _c.Call.Return(run) + return _c +} + // WithdrawFunds provides a mock function with given fields: opts, _recipient, _amount func (_m *FluxAggregator) WithdrawFunds(opts *bind.TransactOpts, _recipient common.Address, _amount *big.Int) (*types.Transaction, error) { ret := _m.Called(opts, _recipient, _amount) @@ -2304,6 +4527,36 @@ func (_m *FluxAggregator) WithdrawFunds(opts *bind.TransactOpts, _recipient comm return r0, r1 } +// FluxAggregator_WithdrawFunds_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WithdrawFunds' +type FluxAggregator_WithdrawFunds_Call struct { + *mock.Call +} + +// WithdrawFunds is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - _recipient common.Address +// - _amount *big.Int +func (_e *FluxAggregator_Expecter) WithdrawFunds(opts interface{}, _recipient interface{}, _amount interface{}) *FluxAggregator_WithdrawFunds_Call { + return &FluxAggregator_WithdrawFunds_Call{Call: _e.mock.On("WithdrawFunds", opts, _recipient, _amount)} +} + +func (_c *FluxAggregator_WithdrawFunds_Call) Run(run func(opts *bind.TransactOpts, _recipient common.Address, _amount *big.Int)) *FluxAggregator_WithdrawFunds_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].(common.Address), args[2].(*big.Int)) + }) + return _c +} + +func (_c *FluxAggregator_WithdrawFunds_Call) Return(_a0 *types.Transaction, _a1 error) *FluxAggregator_WithdrawFunds_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FluxAggregator_WithdrawFunds_Call) RunAndReturn(run func(*bind.TransactOpts, common.Address, *big.Int) (*types.Transaction, error)) *FluxAggregator_WithdrawFunds_Call { + _c.Call.Return(run) + return _c +} + // WithdrawPayment provides a mock function with given fields: opts, _oracle, _recipient, _amount func (_m *FluxAggregator) WithdrawPayment(opts *bind.TransactOpts, _oracle common.Address, _recipient common.Address, _amount *big.Int) (*types.Transaction, error) { ret := _m.Called(opts, _oracle, _recipient, _amount) @@ -2334,6 +4587,37 @@ func (_m *FluxAggregator) WithdrawPayment(opts *bind.TransactOpts, _oracle commo return r0, r1 } +// FluxAggregator_WithdrawPayment_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WithdrawPayment' +type FluxAggregator_WithdrawPayment_Call struct { + *mock.Call +} + +// WithdrawPayment is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - _oracle common.Address +// - _recipient common.Address +// - _amount *big.Int +func (_e *FluxAggregator_Expecter) WithdrawPayment(opts interface{}, _oracle interface{}, _recipient interface{}, _amount interface{}) *FluxAggregator_WithdrawPayment_Call { + return &FluxAggregator_WithdrawPayment_Call{Call: _e.mock.On("WithdrawPayment", opts, _oracle, _recipient, _amount)} +} + +func (_c *FluxAggregator_WithdrawPayment_Call) Run(run func(opts *bind.TransactOpts, _oracle common.Address, _recipient common.Address, _amount *big.Int)) *FluxAggregator_WithdrawPayment_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].(common.Address), args[2].(common.Address), args[3].(*big.Int)) + }) + return _c +} + +func (_c *FluxAggregator_WithdrawPayment_Call) Return(_a0 *types.Transaction, _a1 error) *FluxAggregator_WithdrawPayment_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FluxAggregator_WithdrawPayment_Call) RunAndReturn(run func(*bind.TransactOpts, common.Address, common.Address, *big.Int) (*types.Transaction, error)) *FluxAggregator_WithdrawPayment_Call { + _c.Call.Return(run) + return _c +} + // WithdrawablePayment provides a mock function with given fields: opts, _oracle func (_m *FluxAggregator) WithdrawablePayment(opts *bind.CallOpts, _oracle common.Address) (*big.Int, error) { ret := _m.Called(opts, _oracle) @@ -2364,6 +4648,35 @@ func (_m *FluxAggregator) WithdrawablePayment(opts *bind.CallOpts, _oracle commo return r0, r1 } +// FluxAggregator_WithdrawablePayment_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WithdrawablePayment' +type FluxAggregator_WithdrawablePayment_Call struct { + *mock.Call +} + +// WithdrawablePayment is a helper method to define mock.On call +// - opts *bind.CallOpts +// - _oracle common.Address +func (_e *FluxAggregator_Expecter) WithdrawablePayment(opts interface{}, _oracle interface{}) *FluxAggregator_WithdrawablePayment_Call { + return &FluxAggregator_WithdrawablePayment_Call{Call: _e.mock.On("WithdrawablePayment", opts, _oracle)} +} + +func (_c *FluxAggregator_WithdrawablePayment_Call) Run(run func(opts *bind.CallOpts, _oracle common.Address)) *FluxAggregator_WithdrawablePayment_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts), args[1].(common.Address)) + }) + return _c +} + +func (_c *FluxAggregator_WithdrawablePayment_Call) Return(_a0 *big.Int, _a1 error) *FluxAggregator_WithdrawablePayment_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FluxAggregator_WithdrawablePayment_Call) RunAndReturn(run func(*bind.CallOpts, common.Address) (*big.Int, error)) *FluxAggregator_WithdrawablePayment_Call { + _c.Call.Return(run) + return _c +} + // NewFluxAggregator creates a new instance of FluxAggregator. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewFluxAggregator(t interface { diff --git a/core/internal/mocks/go_generate.go b/core/internal/mocks/go_generate.go deleted file mode 100644 index 07a16c2b6cc..00000000000 --- a/core/internal/mocks/go_generate.go +++ /dev/null @@ -1,6 +0,0 @@ -package mocks - -//go:generate mockery --quiet --srcpkg github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/flux_aggregator_wrapper --name FluxAggregatorInterface --output . --case=underscore --structname FluxAggregator --filename flux_aggregator.go -//go:generate mockery --quiet --srcpkg github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/flags_wrapper --name FlagsInterface --output . --case=underscore --structname Flags --filename flags.go -//go:generate mockery --quiet --srcpkg github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/aggregator_v3_interface --name AggregatorV3InterfaceInterface --output ../../services/vrf/mocks/ --case=underscore --structname AggregatorV3Interface --filename aggregator_v3_interface.go -//go:generate mockery --quiet --srcpkg github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_coordinator_v2 --name VRFCoordinatorV2Interface --output ../../services/vrf/mocks/ --case=underscore --structname VRFCoordinatorV2Interface --filename vrf_coordinator_v2.go diff --git a/core/internal/mocks/prometheus_backend.go b/core/internal/mocks/prometheus_backend.go deleted file mode 100644 index 65cc7390307..00000000000 --- a/core/internal/mocks/prometheus_backend.go +++ /dev/null @@ -1,53 +0,0 @@ -// Code generated by mockery v2.43.2. DO NOT EDIT. - -package mocks - -import ( - big "math/big" - - mock "github.com/stretchr/testify/mock" -) - -// PrometheusBackend is an autogenerated mock type for the PrometheusBackend type -type PrometheusBackend struct { - mock.Mock -} - -// SetMaxUnconfirmedAge provides a mock function with given fields: _a0, _a1 -func (_m *PrometheusBackend) SetMaxUnconfirmedAge(_a0 *big.Int, _a1 float64) { - _m.Called(_a0, _a1) -} - -// SetMaxUnconfirmedBlocks provides a mock function with given fields: _a0, _a1 -func (_m *PrometheusBackend) SetMaxUnconfirmedBlocks(_a0 *big.Int, _a1 int64) { - _m.Called(_a0, _a1) -} - -// SetPipelineRunsQueued provides a mock function with given fields: n -func (_m *PrometheusBackend) SetPipelineRunsQueued(n int) { - _m.Called(n) -} - -// SetPipelineTaskRunsQueued provides a mock function with given fields: n -func (_m *PrometheusBackend) SetPipelineTaskRunsQueued(n int) { - _m.Called(n) -} - -// SetUnconfirmedTransactions provides a mock function with given fields: _a0, _a1 -func (_m *PrometheusBackend) SetUnconfirmedTransactions(_a0 *big.Int, _a1 int64) { - _m.Called(_a0, _a1) -} - -// NewPrometheusBackend creates a new instance of PrometheusBackend. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewPrometheusBackend(t interface { - mock.TestingT - Cleanup(func()) -}) *PrometheusBackend { - mock := &PrometheusBackend{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/core/internal/testutils/testutils.go b/core/internal/testutils/testutils.go index 45609488b46..4e7f9b05c8a 100644 --- a/core/internal/testutils/testutils.go +++ b/core/internal/testutils/testutils.go @@ -380,6 +380,19 @@ func WaitForLogMessage(t *testing.T, observedLogs *observer.ObservedLogs, msg st return } +func WaitForLogMessageWithField(t *testing.T, observedLogs *observer.ObservedLogs, msg, field, value string) (le observer.LoggedEntry) { + AssertEventually(t, func() bool { + for _, l := range observedLogs.All() { + if strings.Contains(l.Message, msg) && strings.Contains(l.ContextMap()[field].(string), value) { + le = l + return true + } + } + return false + }) + return +} + // WaitForLogMessageCount waits until at least count log message containing the // specified msg is emitted func WaitForLogMessageCount(t *testing.T, observedLogs *observer.ObservedLogs, msg string, count int) { diff --git a/core/logger/logger.go b/core/logger/logger.go index 1feaf0f5d6d..881c7b6a760 100644 --- a/core/logger/logger.go +++ b/core/logger/logger.go @@ -51,9 +51,6 @@ func init() { var _ common.Logger = (Logger)(nil) -//go:generate mockery --quiet --name Logger --output . --filename logger_mock_test.go --inpackage --case=underscore -//go:generate mockery --quiet --name Logger --output ./mocks/ --case=underscore - // Logger is the main interface of this package. // It implements uber/zap's SugaredLogger interface and adds conditional logging helpers. // diff --git a/core/logger/logger_mock_test.go b/core/logger/logger_mock_test.go deleted file mode 100644 index 0c901c7eb21..00000000000 --- a/core/logger/logger_mock_test.go +++ /dev/null @@ -1,319 +0,0 @@ -// Code generated by mockery v2.43.2. DO NOT EDIT. - -package logger - -import ( - mock "github.com/stretchr/testify/mock" - zapcore "go.uber.org/zap/zapcore" -) - -// MockLogger is an autogenerated mock type for the Logger type -type MockLogger struct { - mock.Mock -} - -// Critical provides a mock function with given fields: args -func (_m *MockLogger) Critical(args ...interface{}) { - var _ca []interface{} - _ca = append(_ca, args...) - _m.Called(_ca...) -} - -// Criticalf provides a mock function with given fields: format, values -func (_m *MockLogger) Criticalf(format string, values ...interface{}) { - var _ca []interface{} - _ca = append(_ca, format) - _ca = append(_ca, values...) - _m.Called(_ca...) -} - -// Criticalw provides a mock function with given fields: msg, keysAndValues -func (_m *MockLogger) Criticalw(msg string, keysAndValues ...interface{}) { - var _ca []interface{} - _ca = append(_ca, msg) - _ca = append(_ca, keysAndValues...) - _m.Called(_ca...) -} - -// Debug provides a mock function with given fields: args -func (_m *MockLogger) Debug(args ...interface{}) { - var _ca []interface{} - _ca = append(_ca, args...) - _m.Called(_ca...) -} - -// Debugf provides a mock function with given fields: format, values -func (_m *MockLogger) Debugf(format string, values ...interface{}) { - var _ca []interface{} - _ca = append(_ca, format) - _ca = append(_ca, values...) - _m.Called(_ca...) -} - -// Debugw provides a mock function with given fields: msg, keysAndValues -func (_m *MockLogger) Debugw(msg string, keysAndValues ...interface{}) { - var _ca []interface{} - _ca = append(_ca, msg) - _ca = append(_ca, keysAndValues...) - _m.Called(_ca...) -} - -// Error provides a mock function with given fields: args -func (_m *MockLogger) Error(args ...interface{}) { - var _ca []interface{} - _ca = append(_ca, args...) - _m.Called(_ca...) -} - -// Errorf provides a mock function with given fields: format, values -func (_m *MockLogger) Errorf(format string, values ...interface{}) { - var _ca []interface{} - _ca = append(_ca, format) - _ca = append(_ca, values...) - _m.Called(_ca...) -} - -// Errorw provides a mock function with given fields: msg, keysAndValues -func (_m *MockLogger) Errorw(msg string, keysAndValues ...interface{}) { - var _ca []interface{} - _ca = append(_ca, msg) - _ca = append(_ca, keysAndValues...) - _m.Called(_ca...) -} - -// Fatal provides a mock function with given fields: args -func (_m *MockLogger) Fatal(args ...interface{}) { - var _ca []interface{} - _ca = append(_ca, args...) - _m.Called(_ca...) -} - -// Fatalf provides a mock function with given fields: format, values -func (_m *MockLogger) Fatalf(format string, values ...interface{}) { - var _ca []interface{} - _ca = append(_ca, format) - _ca = append(_ca, values...) - _m.Called(_ca...) -} - -// Fatalw provides a mock function with given fields: msg, keysAndValues -func (_m *MockLogger) Fatalw(msg string, keysAndValues ...interface{}) { - var _ca []interface{} - _ca = append(_ca, msg) - _ca = append(_ca, keysAndValues...) - _m.Called(_ca...) -} - -// Helper provides a mock function with given fields: skip -func (_m *MockLogger) Helper(skip int) Logger { - ret := _m.Called(skip) - - if len(ret) == 0 { - panic("no return value specified for Helper") - } - - var r0 Logger - if rf, ok := ret.Get(0).(func(int) Logger); ok { - r0 = rf(skip) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(Logger) - } - } - - return r0 -} - -// Info provides a mock function with given fields: args -func (_m *MockLogger) Info(args ...interface{}) { - var _ca []interface{} - _ca = append(_ca, args...) - _m.Called(_ca...) -} - -// Infof provides a mock function with given fields: format, values -func (_m *MockLogger) Infof(format string, values ...interface{}) { - var _ca []interface{} - _ca = append(_ca, format) - _ca = append(_ca, values...) - _m.Called(_ca...) -} - -// Infow provides a mock function with given fields: msg, keysAndValues -func (_m *MockLogger) Infow(msg string, keysAndValues ...interface{}) { - var _ca []interface{} - _ca = append(_ca, msg) - _ca = append(_ca, keysAndValues...) - _m.Called(_ca...) -} - -// Name provides a mock function with given fields: -func (_m *MockLogger) Name() string { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for Name") - } - - var r0 string - if rf, ok := ret.Get(0).(func() string); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(string) - } - - return r0 -} - -// Named provides a mock function with given fields: name -func (_m *MockLogger) Named(name string) Logger { - ret := _m.Called(name) - - if len(ret) == 0 { - panic("no return value specified for Named") - } - - var r0 Logger - if rf, ok := ret.Get(0).(func(string) Logger); ok { - r0 = rf(name) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(Logger) - } - } - - return r0 -} - -// Panic provides a mock function with given fields: args -func (_m *MockLogger) Panic(args ...interface{}) { - var _ca []interface{} - _ca = append(_ca, args...) - _m.Called(_ca...) -} - -// Panicf provides a mock function with given fields: format, values -func (_m *MockLogger) Panicf(format string, values ...interface{}) { - var _ca []interface{} - _ca = append(_ca, format) - _ca = append(_ca, values...) - _m.Called(_ca...) -} - -// Panicw provides a mock function with given fields: msg, keysAndValues -func (_m *MockLogger) Panicw(msg string, keysAndValues ...interface{}) { - var _ca []interface{} - _ca = append(_ca, msg) - _ca = append(_ca, keysAndValues...) - _m.Called(_ca...) -} - -// Recover provides a mock function with given fields: panicErr -func (_m *MockLogger) Recover(panicErr interface{}) { - _m.Called(panicErr) -} - -// SetLogLevel provides a mock function with given fields: _a0 -func (_m *MockLogger) SetLogLevel(_a0 zapcore.Level) { - _m.Called(_a0) -} - -// Sync provides a mock function with given fields: -func (_m *MockLogger) Sync() error { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for Sync") - } - - var r0 error - if rf, ok := ret.Get(0).(func() error); ok { - r0 = rf() - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// Trace provides a mock function with given fields: args -func (_m *MockLogger) Trace(args ...interface{}) { - var _ca []interface{} - _ca = append(_ca, args...) - _m.Called(_ca...) -} - -// Tracef provides a mock function with given fields: format, values -func (_m *MockLogger) Tracef(format string, values ...interface{}) { - var _ca []interface{} - _ca = append(_ca, format) - _ca = append(_ca, values...) - _m.Called(_ca...) -} - -// Tracew provides a mock function with given fields: msg, keysAndValues -func (_m *MockLogger) Tracew(msg string, keysAndValues ...interface{}) { - var _ca []interface{} - _ca = append(_ca, msg) - _ca = append(_ca, keysAndValues...) - _m.Called(_ca...) -} - -// Warn provides a mock function with given fields: args -func (_m *MockLogger) Warn(args ...interface{}) { - var _ca []interface{} - _ca = append(_ca, args...) - _m.Called(_ca...) -} - -// Warnf provides a mock function with given fields: format, values -func (_m *MockLogger) Warnf(format string, values ...interface{}) { - var _ca []interface{} - _ca = append(_ca, format) - _ca = append(_ca, values...) - _m.Called(_ca...) -} - -// Warnw provides a mock function with given fields: msg, keysAndValues -func (_m *MockLogger) Warnw(msg string, keysAndValues ...interface{}) { - var _ca []interface{} - _ca = append(_ca, msg) - _ca = append(_ca, keysAndValues...) - _m.Called(_ca...) -} - -// With provides a mock function with given fields: args -func (_m *MockLogger) With(args ...interface{}) Logger { - var _ca []interface{} - _ca = append(_ca, args...) - ret := _m.Called(_ca...) - - if len(ret) == 0 { - panic("no return value specified for With") - } - - var r0 Logger - if rf, ok := ret.Get(0).(func(...interface{}) Logger); ok { - r0 = rf(args...) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(Logger) - } - } - - return r0 -} - -// NewMockLogger creates a new instance of MockLogger. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewMockLogger(t interface { - mock.TestingT - Cleanup(func()) -}) *MockLogger { - mock := &MockLogger{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/core/logger/logger_mocks.go b/core/logger/logger_mocks.go new file mode 100644 index 00000000000..106de3dd61a --- /dev/null +++ b/core/logger/logger_mocks.go @@ -0,0 +1,1384 @@ +// Code generated by mockery v2.43.2. DO NOT EDIT. + +package logger + +import ( + mock "github.com/stretchr/testify/mock" + zapcore "go.uber.org/zap/zapcore" +) + +// MockLogger is an autogenerated mock type for the Logger type +type MockLogger struct { + mock.Mock +} + +type MockLogger_Expecter struct { + mock *mock.Mock +} + +func (_m *MockLogger) EXPECT() *MockLogger_Expecter { + return &MockLogger_Expecter{mock: &_m.Mock} +} + +// Critical provides a mock function with given fields: args +func (_m *MockLogger) Critical(args ...interface{}) { + var _ca []interface{} + _ca = append(_ca, args...) + _m.Called(_ca...) +} + +// MockLogger_Critical_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Critical' +type MockLogger_Critical_Call struct { + *mock.Call +} + +// Critical is a helper method to define mock.On call +// - args ...interface{} +func (_e *MockLogger_Expecter) Critical(args ...interface{}) *MockLogger_Critical_Call { + return &MockLogger_Critical_Call{Call: _e.mock.On("Critical", + append([]interface{}{}, args...)...)} +} + +func (_c *MockLogger_Critical_Call) Run(run func(args ...interface{})) *MockLogger_Critical_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-0) + for i, a := range args[0:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(variadicArgs...) + }) + return _c +} + +func (_c *MockLogger_Critical_Call) Return() *MockLogger_Critical_Call { + _c.Call.Return() + return _c +} + +func (_c *MockLogger_Critical_Call) RunAndReturn(run func(...interface{})) *MockLogger_Critical_Call { + _c.Call.Return(run) + return _c +} + +// Criticalf provides a mock function with given fields: format, values +func (_m *MockLogger) Criticalf(format string, values ...interface{}) { + var _ca []interface{} + _ca = append(_ca, format) + _ca = append(_ca, values...) + _m.Called(_ca...) +} + +// MockLogger_Criticalf_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Criticalf' +type MockLogger_Criticalf_Call struct { + *mock.Call +} + +// Criticalf is a helper method to define mock.On call +// - format string +// - values ...interface{} +func (_e *MockLogger_Expecter) Criticalf(format interface{}, values ...interface{}) *MockLogger_Criticalf_Call { + return &MockLogger_Criticalf_Call{Call: _e.mock.On("Criticalf", + append([]interface{}{format}, values...)...)} +} + +func (_c *MockLogger_Criticalf_Call) Run(run func(format string, values ...interface{})) *MockLogger_Criticalf_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(args[0].(string), variadicArgs...) + }) + return _c +} + +func (_c *MockLogger_Criticalf_Call) Return() *MockLogger_Criticalf_Call { + _c.Call.Return() + return _c +} + +func (_c *MockLogger_Criticalf_Call) RunAndReturn(run func(string, ...interface{})) *MockLogger_Criticalf_Call { + _c.Call.Return(run) + return _c +} + +// Criticalw provides a mock function with given fields: msg, keysAndValues +func (_m *MockLogger) Criticalw(msg string, keysAndValues ...interface{}) { + var _ca []interface{} + _ca = append(_ca, msg) + _ca = append(_ca, keysAndValues...) + _m.Called(_ca...) +} + +// MockLogger_Criticalw_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Criticalw' +type MockLogger_Criticalw_Call struct { + *mock.Call +} + +// Criticalw is a helper method to define mock.On call +// - msg string +// - keysAndValues ...interface{} +func (_e *MockLogger_Expecter) Criticalw(msg interface{}, keysAndValues ...interface{}) *MockLogger_Criticalw_Call { + return &MockLogger_Criticalw_Call{Call: _e.mock.On("Criticalw", + append([]interface{}{msg}, keysAndValues...)...)} +} + +func (_c *MockLogger_Criticalw_Call) Run(run func(msg string, keysAndValues ...interface{})) *MockLogger_Criticalw_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(args[0].(string), variadicArgs...) + }) + return _c +} + +func (_c *MockLogger_Criticalw_Call) Return() *MockLogger_Criticalw_Call { + _c.Call.Return() + return _c +} + +func (_c *MockLogger_Criticalw_Call) RunAndReturn(run func(string, ...interface{})) *MockLogger_Criticalw_Call { + _c.Call.Return(run) + return _c +} + +// Debug provides a mock function with given fields: args +func (_m *MockLogger) Debug(args ...interface{}) { + var _ca []interface{} + _ca = append(_ca, args...) + _m.Called(_ca...) +} + +// MockLogger_Debug_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Debug' +type MockLogger_Debug_Call struct { + *mock.Call +} + +// Debug is a helper method to define mock.On call +// - args ...interface{} +func (_e *MockLogger_Expecter) Debug(args ...interface{}) *MockLogger_Debug_Call { + return &MockLogger_Debug_Call{Call: _e.mock.On("Debug", + append([]interface{}{}, args...)...)} +} + +func (_c *MockLogger_Debug_Call) Run(run func(args ...interface{})) *MockLogger_Debug_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-0) + for i, a := range args[0:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(variadicArgs...) + }) + return _c +} + +func (_c *MockLogger_Debug_Call) Return() *MockLogger_Debug_Call { + _c.Call.Return() + return _c +} + +func (_c *MockLogger_Debug_Call) RunAndReturn(run func(...interface{})) *MockLogger_Debug_Call { + _c.Call.Return(run) + return _c +} + +// Debugf provides a mock function with given fields: format, values +func (_m *MockLogger) Debugf(format string, values ...interface{}) { + var _ca []interface{} + _ca = append(_ca, format) + _ca = append(_ca, values...) + _m.Called(_ca...) +} + +// MockLogger_Debugf_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Debugf' +type MockLogger_Debugf_Call struct { + *mock.Call +} + +// Debugf is a helper method to define mock.On call +// - format string +// - values ...interface{} +func (_e *MockLogger_Expecter) Debugf(format interface{}, values ...interface{}) *MockLogger_Debugf_Call { + return &MockLogger_Debugf_Call{Call: _e.mock.On("Debugf", + append([]interface{}{format}, values...)...)} +} + +func (_c *MockLogger_Debugf_Call) Run(run func(format string, values ...interface{})) *MockLogger_Debugf_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(args[0].(string), variadicArgs...) + }) + return _c +} + +func (_c *MockLogger_Debugf_Call) Return() *MockLogger_Debugf_Call { + _c.Call.Return() + return _c +} + +func (_c *MockLogger_Debugf_Call) RunAndReturn(run func(string, ...interface{})) *MockLogger_Debugf_Call { + _c.Call.Return(run) + return _c +} + +// Debugw provides a mock function with given fields: msg, keysAndValues +func (_m *MockLogger) Debugw(msg string, keysAndValues ...interface{}) { + var _ca []interface{} + _ca = append(_ca, msg) + _ca = append(_ca, keysAndValues...) + _m.Called(_ca...) +} + +// MockLogger_Debugw_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Debugw' +type MockLogger_Debugw_Call struct { + *mock.Call +} + +// Debugw is a helper method to define mock.On call +// - msg string +// - keysAndValues ...interface{} +func (_e *MockLogger_Expecter) Debugw(msg interface{}, keysAndValues ...interface{}) *MockLogger_Debugw_Call { + return &MockLogger_Debugw_Call{Call: _e.mock.On("Debugw", + append([]interface{}{msg}, keysAndValues...)...)} +} + +func (_c *MockLogger_Debugw_Call) Run(run func(msg string, keysAndValues ...interface{})) *MockLogger_Debugw_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(args[0].(string), variadicArgs...) + }) + return _c +} + +func (_c *MockLogger_Debugw_Call) Return() *MockLogger_Debugw_Call { + _c.Call.Return() + return _c +} + +func (_c *MockLogger_Debugw_Call) RunAndReturn(run func(string, ...interface{})) *MockLogger_Debugw_Call { + _c.Call.Return(run) + return _c +} + +// Error provides a mock function with given fields: args +func (_m *MockLogger) Error(args ...interface{}) { + var _ca []interface{} + _ca = append(_ca, args...) + _m.Called(_ca...) +} + +// MockLogger_Error_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Error' +type MockLogger_Error_Call struct { + *mock.Call +} + +// Error is a helper method to define mock.On call +// - args ...interface{} +func (_e *MockLogger_Expecter) Error(args ...interface{}) *MockLogger_Error_Call { + return &MockLogger_Error_Call{Call: _e.mock.On("Error", + append([]interface{}{}, args...)...)} +} + +func (_c *MockLogger_Error_Call) Run(run func(args ...interface{})) *MockLogger_Error_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-0) + for i, a := range args[0:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(variadicArgs...) + }) + return _c +} + +func (_c *MockLogger_Error_Call) Return() *MockLogger_Error_Call { + _c.Call.Return() + return _c +} + +func (_c *MockLogger_Error_Call) RunAndReturn(run func(...interface{})) *MockLogger_Error_Call { + _c.Call.Return(run) + return _c +} + +// Errorf provides a mock function with given fields: format, values +func (_m *MockLogger) Errorf(format string, values ...interface{}) { + var _ca []interface{} + _ca = append(_ca, format) + _ca = append(_ca, values...) + _m.Called(_ca...) +} + +// MockLogger_Errorf_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Errorf' +type MockLogger_Errorf_Call struct { + *mock.Call +} + +// Errorf is a helper method to define mock.On call +// - format string +// - values ...interface{} +func (_e *MockLogger_Expecter) Errorf(format interface{}, values ...interface{}) *MockLogger_Errorf_Call { + return &MockLogger_Errorf_Call{Call: _e.mock.On("Errorf", + append([]interface{}{format}, values...)...)} +} + +func (_c *MockLogger_Errorf_Call) Run(run func(format string, values ...interface{})) *MockLogger_Errorf_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(args[0].(string), variadicArgs...) + }) + return _c +} + +func (_c *MockLogger_Errorf_Call) Return() *MockLogger_Errorf_Call { + _c.Call.Return() + return _c +} + +func (_c *MockLogger_Errorf_Call) RunAndReturn(run func(string, ...interface{})) *MockLogger_Errorf_Call { + _c.Call.Return(run) + return _c +} + +// Errorw provides a mock function with given fields: msg, keysAndValues +func (_m *MockLogger) Errorw(msg string, keysAndValues ...interface{}) { + var _ca []interface{} + _ca = append(_ca, msg) + _ca = append(_ca, keysAndValues...) + _m.Called(_ca...) +} + +// MockLogger_Errorw_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Errorw' +type MockLogger_Errorw_Call struct { + *mock.Call +} + +// Errorw is a helper method to define mock.On call +// - msg string +// - keysAndValues ...interface{} +func (_e *MockLogger_Expecter) Errorw(msg interface{}, keysAndValues ...interface{}) *MockLogger_Errorw_Call { + return &MockLogger_Errorw_Call{Call: _e.mock.On("Errorw", + append([]interface{}{msg}, keysAndValues...)...)} +} + +func (_c *MockLogger_Errorw_Call) Run(run func(msg string, keysAndValues ...interface{})) *MockLogger_Errorw_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(args[0].(string), variadicArgs...) + }) + return _c +} + +func (_c *MockLogger_Errorw_Call) Return() *MockLogger_Errorw_Call { + _c.Call.Return() + return _c +} + +func (_c *MockLogger_Errorw_Call) RunAndReturn(run func(string, ...interface{})) *MockLogger_Errorw_Call { + _c.Call.Return(run) + return _c +} + +// Fatal provides a mock function with given fields: args +func (_m *MockLogger) Fatal(args ...interface{}) { + var _ca []interface{} + _ca = append(_ca, args...) + _m.Called(_ca...) +} + +// MockLogger_Fatal_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Fatal' +type MockLogger_Fatal_Call struct { + *mock.Call +} + +// Fatal is a helper method to define mock.On call +// - args ...interface{} +func (_e *MockLogger_Expecter) Fatal(args ...interface{}) *MockLogger_Fatal_Call { + return &MockLogger_Fatal_Call{Call: _e.mock.On("Fatal", + append([]interface{}{}, args...)...)} +} + +func (_c *MockLogger_Fatal_Call) Run(run func(args ...interface{})) *MockLogger_Fatal_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-0) + for i, a := range args[0:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(variadicArgs...) + }) + return _c +} + +func (_c *MockLogger_Fatal_Call) Return() *MockLogger_Fatal_Call { + _c.Call.Return() + return _c +} + +func (_c *MockLogger_Fatal_Call) RunAndReturn(run func(...interface{})) *MockLogger_Fatal_Call { + _c.Call.Return(run) + return _c +} + +// Fatalf provides a mock function with given fields: format, values +func (_m *MockLogger) Fatalf(format string, values ...interface{}) { + var _ca []interface{} + _ca = append(_ca, format) + _ca = append(_ca, values...) + _m.Called(_ca...) +} + +// MockLogger_Fatalf_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Fatalf' +type MockLogger_Fatalf_Call struct { + *mock.Call +} + +// Fatalf is a helper method to define mock.On call +// - format string +// - values ...interface{} +func (_e *MockLogger_Expecter) Fatalf(format interface{}, values ...interface{}) *MockLogger_Fatalf_Call { + return &MockLogger_Fatalf_Call{Call: _e.mock.On("Fatalf", + append([]interface{}{format}, values...)...)} +} + +func (_c *MockLogger_Fatalf_Call) Run(run func(format string, values ...interface{})) *MockLogger_Fatalf_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(args[0].(string), variadicArgs...) + }) + return _c +} + +func (_c *MockLogger_Fatalf_Call) Return() *MockLogger_Fatalf_Call { + _c.Call.Return() + return _c +} + +func (_c *MockLogger_Fatalf_Call) RunAndReturn(run func(string, ...interface{})) *MockLogger_Fatalf_Call { + _c.Call.Return(run) + return _c +} + +// Fatalw provides a mock function with given fields: msg, keysAndValues +func (_m *MockLogger) Fatalw(msg string, keysAndValues ...interface{}) { + var _ca []interface{} + _ca = append(_ca, msg) + _ca = append(_ca, keysAndValues...) + _m.Called(_ca...) +} + +// MockLogger_Fatalw_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Fatalw' +type MockLogger_Fatalw_Call struct { + *mock.Call +} + +// Fatalw is a helper method to define mock.On call +// - msg string +// - keysAndValues ...interface{} +func (_e *MockLogger_Expecter) Fatalw(msg interface{}, keysAndValues ...interface{}) *MockLogger_Fatalw_Call { + return &MockLogger_Fatalw_Call{Call: _e.mock.On("Fatalw", + append([]interface{}{msg}, keysAndValues...)...)} +} + +func (_c *MockLogger_Fatalw_Call) Run(run func(msg string, keysAndValues ...interface{})) *MockLogger_Fatalw_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(args[0].(string), variadicArgs...) + }) + return _c +} + +func (_c *MockLogger_Fatalw_Call) Return() *MockLogger_Fatalw_Call { + _c.Call.Return() + return _c +} + +func (_c *MockLogger_Fatalw_Call) RunAndReturn(run func(string, ...interface{})) *MockLogger_Fatalw_Call { + _c.Call.Return(run) + return _c +} + +// Helper provides a mock function with given fields: skip +func (_m *MockLogger) Helper(skip int) Logger { + ret := _m.Called(skip) + + if len(ret) == 0 { + panic("no return value specified for Helper") + } + + var r0 Logger + if rf, ok := ret.Get(0).(func(int) Logger); ok { + r0 = rf(skip) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(Logger) + } + } + + return r0 +} + +// MockLogger_Helper_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Helper' +type MockLogger_Helper_Call struct { + *mock.Call +} + +// Helper is a helper method to define mock.On call +// - skip int +func (_e *MockLogger_Expecter) Helper(skip interface{}) *MockLogger_Helper_Call { + return &MockLogger_Helper_Call{Call: _e.mock.On("Helper", skip)} +} + +func (_c *MockLogger_Helper_Call) Run(run func(skip int)) *MockLogger_Helper_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(int)) + }) + return _c +} + +func (_c *MockLogger_Helper_Call) Return(_a0 Logger) *MockLogger_Helper_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockLogger_Helper_Call) RunAndReturn(run func(int) Logger) *MockLogger_Helper_Call { + _c.Call.Return(run) + return _c +} + +// Info provides a mock function with given fields: args +func (_m *MockLogger) Info(args ...interface{}) { + var _ca []interface{} + _ca = append(_ca, args...) + _m.Called(_ca...) +} + +// MockLogger_Info_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Info' +type MockLogger_Info_Call struct { + *mock.Call +} + +// Info is a helper method to define mock.On call +// - args ...interface{} +func (_e *MockLogger_Expecter) Info(args ...interface{}) *MockLogger_Info_Call { + return &MockLogger_Info_Call{Call: _e.mock.On("Info", + append([]interface{}{}, args...)...)} +} + +func (_c *MockLogger_Info_Call) Run(run func(args ...interface{})) *MockLogger_Info_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-0) + for i, a := range args[0:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(variadicArgs...) + }) + return _c +} + +func (_c *MockLogger_Info_Call) Return() *MockLogger_Info_Call { + _c.Call.Return() + return _c +} + +func (_c *MockLogger_Info_Call) RunAndReturn(run func(...interface{})) *MockLogger_Info_Call { + _c.Call.Return(run) + return _c +} + +// Infof provides a mock function with given fields: format, values +func (_m *MockLogger) Infof(format string, values ...interface{}) { + var _ca []interface{} + _ca = append(_ca, format) + _ca = append(_ca, values...) + _m.Called(_ca...) +} + +// MockLogger_Infof_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Infof' +type MockLogger_Infof_Call struct { + *mock.Call +} + +// Infof is a helper method to define mock.On call +// - format string +// - values ...interface{} +func (_e *MockLogger_Expecter) Infof(format interface{}, values ...interface{}) *MockLogger_Infof_Call { + return &MockLogger_Infof_Call{Call: _e.mock.On("Infof", + append([]interface{}{format}, values...)...)} +} + +func (_c *MockLogger_Infof_Call) Run(run func(format string, values ...interface{})) *MockLogger_Infof_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(args[0].(string), variadicArgs...) + }) + return _c +} + +func (_c *MockLogger_Infof_Call) Return() *MockLogger_Infof_Call { + _c.Call.Return() + return _c +} + +func (_c *MockLogger_Infof_Call) RunAndReturn(run func(string, ...interface{})) *MockLogger_Infof_Call { + _c.Call.Return(run) + return _c +} + +// Infow provides a mock function with given fields: msg, keysAndValues +func (_m *MockLogger) Infow(msg string, keysAndValues ...interface{}) { + var _ca []interface{} + _ca = append(_ca, msg) + _ca = append(_ca, keysAndValues...) + _m.Called(_ca...) +} + +// MockLogger_Infow_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Infow' +type MockLogger_Infow_Call struct { + *mock.Call +} + +// Infow is a helper method to define mock.On call +// - msg string +// - keysAndValues ...interface{} +func (_e *MockLogger_Expecter) Infow(msg interface{}, keysAndValues ...interface{}) *MockLogger_Infow_Call { + return &MockLogger_Infow_Call{Call: _e.mock.On("Infow", + append([]interface{}{msg}, keysAndValues...)...)} +} + +func (_c *MockLogger_Infow_Call) Run(run func(msg string, keysAndValues ...interface{})) *MockLogger_Infow_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(args[0].(string), variadicArgs...) + }) + return _c +} + +func (_c *MockLogger_Infow_Call) Return() *MockLogger_Infow_Call { + _c.Call.Return() + return _c +} + +func (_c *MockLogger_Infow_Call) RunAndReturn(run func(string, ...interface{})) *MockLogger_Infow_Call { + _c.Call.Return(run) + return _c +} + +// Name provides a mock function with given fields: +func (_m *MockLogger) Name() string { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Name") + } + + var r0 string + if rf, ok := ret.Get(0).(func() string); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// MockLogger_Name_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Name' +type MockLogger_Name_Call struct { + *mock.Call +} + +// Name is a helper method to define mock.On call +func (_e *MockLogger_Expecter) Name() *MockLogger_Name_Call { + return &MockLogger_Name_Call{Call: _e.mock.On("Name")} +} + +func (_c *MockLogger_Name_Call) Run(run func()) *MockLogger_Name_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockLogger_Name_Call) Return(_a0 string) *MockLogger_Name_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockLogger_Name_Call) RunAndReturn(run func() string) *MockLogger_Name_Call { + _c.Call.Return(run) + return _c +} + +// Named provides a mock function with given fields: name +func (_m *MockLogger) Named(name string) Logger { + ret := _m.Called(name) + + if len(ret) == 0 { + panic("no return value specified for Named") + } + + var r0 Logger + if rf, ok := ret.Get(0).(func(string) Logger); ok { + r0 = rf(name) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(Logger) + } + } + + return r0 +} + +// MockLogger_Named_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Named' +type MockLogger_Named_Call struct { + *mock.Call +} + +// Named is a helper method to define mock.On call +// - name string +func (_e *MockLogger_Expecter) Named(name interface{}) *MockLogger_Named_Call { + return &MockLogger_Named_Call{Call: _e.mock.On("Named", name)} +} + +func (_c *MockLogger_Named_Call) Run(run func(name string)) *MockLogger_Named_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *MockLogger_Named_Call) Return(_a0 Logger) *MockLogger_Named_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockLogger_Named_Call) RunAndReturn(run func(string) Logger) *MockLogger_Named_Call { + _c.Call.Return(run) + return _c +} + +// Panic provides a mock function with given fields: args +func (_m *MockLogger) Panic(args ...interface{}) { + var _ca []interface{} + _ca = append(_ca, args...) + _m.Called(_ca...) +} + +// MockLogger_Panic_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Panic' +type MockLogger_Panic_Call struct { + *mock.Call +} + +// Panic is a helper method to define mock.On call +// - args ...interface{} +func (_e *MockLogger_Expecter) Panic(args ...interface{}) *MockLogger_Panic_Call { + return &MockLogger_Panic_Call{Call: _e.mock.On("Panic", + append([]interface{}{}, args...)...)} +} + +func (_c *MockLogger_Panic_Call) Run(run func(args ...interface{})) *MockLogger_Panic_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-0) + for i, a := range args[0:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(variadicArgs...) + }) + return _c +} + +func (_c *MockLogger_Panic_Call) Return() *MockLogger_Panic_Call { + _c.Call.Return() + return _c +} + +func (_c *MockLogger_Panic_Call) RunAndReturn(run func(...interface{})) *MockLogger_Panic_Call { + _c.Call.Return(run) + return _c +} + +// Panicf provides a mock function with given fields: format, values +func (_m *MockLogger) Panicf(format string, values ...interface{}) { + var _ca []interface{} + _ca = append(_ca, format) + _ca = append(_ca, values...) + _m.Called(_ca...) +} + +// MockLogger_Panicf_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Panicf' +type MockLogger_Panicf_Call struct { + *mock.Call +} + +// Panicf is a helper method to define mock.On call +// - format string +// - values ...interface{} +func (_e *MockLogger_Expecter) Panicf(format interface{}, values ...interface{}) *MockLogger_Panicf_Call { + return &MockLogger_Panicf_Call{Call: _e.mock.On("Panicf", + append([]interface{}{format}, values...)...)} +} + +func (_c *MockLogger_Panicf_Call) Run(run func(format string, values ...interface{})) *MockLogger_Panicf_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(args[0].(string), variadicArgs...) + }) + return _c +} + +func (_c *MockLogger_Panicf_Call) Return() *MockLogger_Panicf_Call { + _c.Call.Return() + return _c +} + +func (_c *MockLogger_Panicf_Call) RunAndReturn(run func(string, ...interface{})) *MockLogger_Panicf_Call { + _c.Call.Return(run) + return _c +} + +// Panicw provides a mock function with given fields: msg, keysAndValues +func (_m *MockLogger) Panicw(msg string, keysAndValues ...interface{}) { + var _ca []interface{} + _ca = append(_ca, msg) + _ca = append(_ca, keysAndValues...) + _m.Called(_ca...) +} + +// MockLogger_Panicw_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Panicw' +type MockLogger_Panicw_Call struct { + *mock.Call +} + +// Panicw is a helper method to define mock.On call +// - msg string +// - keysAndValues ...interface{} +func (_e *MockLogger_Expecter) Panicw(msg interface{}, keysAndValues ...interface{}) *MockLogger_Panicw_Call { + return &MockLogger_Panicw_Call{Call: _e.mock.On("Panicw", + append([]interface{}{msg}, keysAndValues...)...)} +} + +func (_c *MockLogger_Panicw_Call) Run(run func(msg string, keysAndValues ...interface{})) *MockLogger_Panicw_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(args[0].(string), variadicArgs...) + }) + return _c +} + +func (_c *MockLogger_Panicw_Call) Return() *MockLogger_Panicw_Call { + _c.Call.Return() + return _c +} + +func (_c *MockLogger_Panicw_Call) RunAndReturn(run func(string, ...interface{})) *MockLogger_Panicw_Call { + _c.Call.Return(run) + return _c +} + +// Recover provides a mock function with given fields: panicErr +func (_m *MockLogger) Recover(panicErr interface{}) { + _m.Called(panicErr) +} + +// MockLogger_Recover_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Recover' +type MockLogger_Recover_Call struct { + *mock.Call +} + +// Recover is a helper method to define mock.On call +// - panicErr interface{} +func (_e *MockLogger_Expecter) Recover(panicErr interface{}) *MockLogger_Recover_Call { + return &MockLogger_Recover_Call{Call: _e.mock.On("Recover", panicErr)} +} + +func (_c *MockLogger_Recover_Call) Run(run func(panicErr interface{})) *MockLogger_Recover_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(interface{})) + }) + return _c +} + +func (_c *MockLogger_Recover_Call) Return() *MockLogger_Recover_Call { + _c.Call.Return() + return _c +} + +func (_c *MockLogger_Recover_Call) RunAndReturn(run func(interface{})) *MockLogger_Recover_Call { + _c.Call.Return(run) + return _c +} + +// SetLogLevel provides a mock function with given fields: _a0 +func (_m *MockLogger) SetLogLevel(_a0 zapcore.Level) { + _m.Called(_a0) +} + +// MockLogger_SetLogLevel_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetLogLevel' +type MockLogger_SetLogLevel_Call struct { + *mock.Call +} + +// SetLogLevel is a helper method to define mock.On call +// - _a0 zapcore.Level +func (_e *MockLogger_Expecter) SetLogLevel(_a0 interface{}) *MockLogger_SetLogLevel_Call { + return &MockLogger_SetLogLevel_Call{Call: _e.mock.On("SetLogLevel", _a0)} +} + +func (_c *MockLogger_SetLogLevel_Call) Run(run func(_a0 zapcore.Level)) *MockLogger_SetLogLevel_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(zapcore.Level)) + }) + return _c +} + +func (_c *MockLogger_SetLogLevel_Call) Return() *MockLogger_SetLogLevel_Call { + _c.Call.Return() + return _c +} + +func (_c *MockLogger_SetLogLevel_Call) RunAndReturn(run func(zapcore.Level)) *MockLogger_SetLogLevel_Call { + _c.Call.Return(run) + return _c +} + +// Sync provides a mock function with given fields: +func (_m *MockLogger) Sync() error { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Sync") + } + + var r0 error + if rf, ok := ret.Get(0).(func() error); ok { + r0 = rf() + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockLogger_Sync_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Sync' +type MockLogger_Sync_Call struct { + *mock.Call +} + +// Sync is a helper method to define mock.On call +func (_e *MockLogger_Expecter) Sync() *MockLogger_Sync_Call { + return &MockLogger_Sync_Call{Call: _e.mock.On("Sync")} +} + +func (_c *MockLogger_Sync_Call) Run(run func()) *MockLogger_Sync_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockLogger_Sync_Call) Return(_a0 error) *MockLogger_Sync_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockLogger_Sync_Call) RunAndReturn(run func() error) *MockLogger_Sync_Call { + _c.Call.Return(run) + return _c +} + +// Trace provides a mock function with given fields: args +func (_m *MockLogger) Trace(args ...interface{}) { + var _ca []interface{} + _ca = append(_ca, args...) + _m.Called(_ca...) +} + +// MockLogger_Trace_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Trace' +type MockLogger_Trace_Call struct { + *mock.Call +} + +// Trace is a helper method to define mock.On call +// - args ...interface{} +func (_e *MockLogger_Expecter) Trace(args ...interface{}) *MockLogger_Trace_Call { + return &MockLogger_Trace_Call{Call: _e.mock.On("Trace", + append([]interface{}{}, args...)...)} +} + +func (_c *MockLogger_Trace_Call) Run(run func(args ...interface{})) *MockLogger_Trace_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-0) + for i, a := range args[0:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(variadicArgs...) + }) + return _c +} + +func (_c *MockLogger_Trace_Call) Return() *MockLogger_Trace_Call { + _c.Call.Return() + return _c +} + +func (_c *MockLogger_Trace_Call) RunAndReturn(run func(...interface{})) *MockLogger_Trace_Call { + _c.Call.Return(run) + return _c +} + +// Tracef provides a mock function with given fields: format, values +func (_m *MockLogger) Tracef(format string, values ...interface{}) { + var _ca []interface{} + _ca = append(_ca, format) + _ca = append(_ca, values...) + _m.Called(_ca...) +} + +// MockLogger_Tracef_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Tracef' +type MockLogger_Tracef_Call struct { + *mock.Call +} + +// Tracef is a helper method to define mock.On call +// - format string +// - values ...interface{} +func (_e *MockLogger_Expecter) Tracef(format interface{}, values ...interface{}) *MockLogger_Tracef_Call { + return &MockLogger_Tracef_Call{Call: _e.mock.On("Tracef", + append([]interface{}{format}, values...)...)} +} + +func (_c *MockLogger_Tracef_Call) Run(run func(format string, values ...interface{})) *MockLogger_Tracef_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(args[0].(string), variadicArgs...) + }) + return _c +} + +func (_c *MockLogger_Tracef_Call) Return() *MockLogger_Tracef_Call { + _c.Call.Return() + return _c +} + +func (_c *MockLogger_Tracef_Call) RunAndReturn(run func(string, ...interface{})) *MockLogger_Tracef_Call { + _c.Call.Return(run) + return _c +} + +// Tracew provides a mock function with given fields: msg, keysAndValues +func (_m *MockLogger) Tracew(msg string, keysAndValues ...interface{}) { + var _ca []interface{} + _ca = append(_ca, msg) + _ca = append(_ca, keysAndValues...) + _m.Called(_ca...) +} + +// MockLogger_Tracew_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Tracew' +type MockLogger_Tracew_Call struct { + *mock.Call +} + +// Tracew is a helper method to define mock.On call +// - msg string +// - keysAndValues ...interface{} +func (_e *MockLogger_Expecter) Tracew(msg interface{}, keysAndValues ...interface{}) *MockLogger_Tracew_Call { + return &MockLogger_Tracew_Call{Call: _e.mock.On("Tracew", + append([]interface{}{msg}, keysAndValues...)...)} +} + +func (_c *MockLogger_Tracew_Call) Run(run func(msg string, keysAndValues ...interface{})) *MockLogger_Tracew_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(args[0].(string), variadicArgs...) + }) + return _c +} + +func (_c *MockLogger_Tracew_Call) Return() *MockLogger_Tracew_Call { + _c.Call.Return() + return _c +} + +func (_c *MockLogger_Tracew_Call) RunAndReturn(run func(string, ...interface{})) *MockLogger_Tracew_Call { + _c.Call.Return(run) + return _c +} + +// Warn provides a mock function with given fields: args +func (_m *MockLogger) Warn(args ...interface{}) { + var _ca []interface{} + _ca = append(_ca, args...) + _m.Called(_ca...) +} + +// MockLogger_Warn_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Warn' +type MockLogger_Warn_Call struct { + *mock.Call +} + +// Warn is a helper method to define mock.On call +// - args ...interface{} +func (_e *MockLogger_Expecter) Warn(args ...interface{}) *MockLogger_Warn_Call { + return &MockLogger_Warn_Call{Call: _e.mock.On("Warn", + append([]interface{}{}, args...)...)} +} + +func (_c *MockLogger_Warn_Call) Run(run func(args ...interface{})) *MockLogger_Warn_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-0) + for i, a := range args[0:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(variadicArgs...) + }) + return _c +} + +func (_c *MockLogger_Warn_Call) Return() *MockLogger_Warn_Call { + _c.Call.Return() + return _c +} + +func (_c *MockLogger_Warn_Call) RunAndReturn(run func(...interface{})) *MockLogger_Warn_Call { + _c.Call.Return(run) + return _c +} + +// Warnf provides a mock function with given fields: format, values +func (_m *MockLogger) Warnf(format string, values ...interface{}) { + var _ca []interface{} + _ca = append(_ca, format) + _ca = append(_ca, values...) + _m.Called(_ca...) +} + +// MockLogger_Warnf_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Warnf' +type MockLogger_Warnf_Call struct { + *mock.Call +} + +// Warnf is a helper method to define mock.On call +// - format string +// - values ...interface{} +func (_e *MockLogger_Expecter) Warnf(format interface{}, values ...interface{}) *MockLogger_Warnf_Call { + return &MockLogger_Warnf_Call{Call: _e.mock.On("Warnf", + append([]interface{}{format}, values...)...)} +} + +func (_c *MockLogger_Warnf_Call) Run(run func(format string, values ...interface{})) *MockLogger_Warnf_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(args[0].(string), variadicArgs...) + }) + return _c +} + +func (_c *MockLogger_Warnf_Call) Return() *MockLogger_Warnf_Call { + _c.Call.Return() + return _c +} + +func (_c *MockLogger_Warnf_Call) RunAndReturn(run func(string, ...interface{})) *MockLogger_Warnf_Call { + _c.Call.Return(run) + return _c +} + +// Warnw provides a mock function with given fields: msg, keysAndValues +func (_m *MockLogger) Warnw(msg string, keysAndValues ...interface{}) { + var _ca []interface{} + _ca = append(_ca, msg) + _ca = append(_ca, keysAndValues...) + _m.Called(_ca...) +} + +// MockLogger_Warnw_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Warnw' +type MockLogger_Warnw_Call struct { + *mock.Call +} + +// Warnw is a helper method to define mock.On call +// - msg string +// - keysAndValues ...interface{} +func (_e *MockLogger_Expecter) Warnw(msg interface{}, keysAndValues ...interface{}) *MockLogger_Warnw_Call { + return &MockLogger_Warnw_Call{Call: _e.mock.On("Warnw", + append([]interface{}{msg}, keysAndValues...)...)} +} + +func (_c *MockLogger_Warnw_Call) Run(run func(msg string, keysAndValues ...interface{})) *MockLogger_Warnw_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(args[0].(string), variadicArgs...) + }) + return _c +} + +func (_c *MockLogger_Warnw_Call) Return() *MockLogger_Warnw_Call { + _c.Call.Return() + return _c +} + +func (_c *MockLogger_Warnw_Call) RunAndReturn(run func(string, ...interface{})) *MockLogger_Warnw_Call { + _c.Call.Return(run) + return _c +} + +// With provides a mock function with given fields: args +func (_m *MockLogger) With(args ...interface{}) Logger { + var _ca []interface{} + _ca = append(_ca, args...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for With") + } + + var r0 Logger + if rf, ok := ret.Get(0).(func(...interface{}) Logger); ok { + r0 = rf(args...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(Logger) + } + } + + return r0 +} + +// MockLogger_With_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'With' +type MockLogger_With_Call struct { + *mock.Call +} + +// With is a helper method to define mock.On call +// - args ...interface{} +func (_e *MockLogger_Expecter) With(args ...interface{}) *MockLogger_With_Call { + return &MockLogger_With_Call{Call: _e.mock.On("With", + append([]interface{}{}, args...)...)} +} + +func (_c *MockLogger_With_Call) Run(run func(args ...interface{})) *MockLogger_With_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-0) + for i, a := range args[0:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(variadicArgs...) + }) + return _c +} + +func (_c *MockLogger_With_Call) Return(_a0 Logger) *MockLogger_With_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockLogger_With_Call) RunAndReturn(run func(...interface{}) Logger) *MockLogger_With_Call { + _c.Call.Return(run) + return _c +} + +// NewMockLogger creates a new instance of MockLogger. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewMockLogger(t interface { + mock.TestingT + Cleanup(func()) +}) *MockLogger { + mock := &MockLogger{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/core/logger/mocks/logger.go b/core/logger/mocks/logger.go deleted file mode 100644 index da881894d1a..00000000000 --- a/core/logger/mocks/logger.go +++ /dev/null @@ -1,321 +0,0 @@ -// Code generated by mockery v2.43.2. DO NOT EDIT. - -package mocks - -import ( - logger "github.com/smartcontractkit/chainlink/v2/core/logger" - mock "github.com/stretchr/testify/mock" - - zapcore "go.uber.org/zap/zapcore" -) - -// Logger is an autogenerated mock type for the Logger type -type Logger struct { - mock.Mock -} - -// Critical provides a mock function with given fields: args -func (_m *Logger) Critical(args ...interface{}) { - var _ca []interface{} - _ca = append(_ca, args...) - _m.Called(_ca...) -} - -// Criticalf provides a mock function with given fields: format, values -func (_m *Logger) Criticalf(format string, values ...interface{}) { - var _ca []interface{} - _ca = append(_ca, format) - _ca = append(_ca, values...) - _m.Called(_ca...) -} - -// Criticalw provides a mock function with given fields: msg, keysAndValues -func (_m *Logger) Criticalw(msg string, keysAndValues ...interface{}) { - var _ca []interface{} - _ca = append(_ca, msg) - _ca = append(_ca, keysAndValues...) - _m.Called(_ca...) -} - -// Debug provides a mock function with given fields: args -func (_m *Logger) Debug(args ...interface{}) { - var _ca []interface{} - _ca = append(_ca, args...) - _m.Called(_ca...) -} - -// Debugf provides a mock function with given fields: format, values -func (_m *Logger) Debugf(format string, values ...interface{}) { - var _ca []interface{} - _ca = append(_ca, format) - _ca = append(_ca, values...) - _m.Called(_ca...) -} - -// Debugw provides a mock function with given fields: msg, keysAndValues -func (_m *Logger) Debugw(msg string, keysAndValues ...interface{}) { - var _ca []interface{} - _ca = append(_ca, msg) - _ca = append(_ca, keysAndValues...) - _m.Called(_ca...) -} - -// Error provides a mock function with given fields: args -func (_m *Logger) Error(args ...interface{}) { - var _ca []interface{} - _ca = append(_ca, args...) - _m.Called(_ca...) -} - -// Errorf provides a mock function with given fields: format, values -func (_m *Logger) Errorf(format string, values ...interface{}) { - var _ca []interface{} - _ca = append(_ca, format) - _ca = append(_ca, values...) - _m.Called(_ca...) -} - -// Errorw provides a mock function with given fields: msg, keysAndValues -func (_m *Logger) Errorw(msg string, keysAndValues ...interface{}) { - var _ca []interface{} - _ca = append(_ca, msg) - _ca = append(_ca, keysAndValues...) - _m.Called(_ca...) -} - -// Fatal provides a mock function with given fields: args -func (_m *Logger) Fatal(args ...interface{}) { - var _ca []interface{} - _ca = append(_ca, args...) - _m.Called(_ca...) -} - -// Fatalf provides a mock function with given fields: format, values -func (_m *Logger) Fatalf(format string, values ...interface{}) { - var _ca []interface{} - _ca = append(_ca, format) - _ca = append(_ca, values...) - _m.Called(_ca...) -} - -// Fatalw provides a mock function with given fields: msg, keysAndValues -func (_m *Logger) Fatalw(msg string, keysAndValues ...interface{}) { - var _ca []interface{} - _ca = append(_ca, msg) - _ca = append(_ca, keysAndValues...) - _m.Called(_ca...) -} - -// Helper provides a mock function with given fields: skip -func (_m *Logger) Helper(skip int) logger.Logger { - ret := _m.Called(skip) - - if len(ret) == 0 { - panic("no return value specified for Helper") - } - - var r0 logger.Logger - if rf, ok := ret.Get(0).(func(int) logger.Logger); ok { - r0 = rf(skip) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(logger.Logger) - } - } - - return r0 -} - -// Info provides a mock function with given fields: args -func (_m *Logger) Info(args ...interface{}) { - var _ca []interface{} - _ca = append(_ca, args...) - _m.Called(_ca...) -} - -// Infof provides a mock function with given fields: format, values -func (_m *Logger) Infof(format string, values ...interface{}) { - var _ca []interface{} - _ca = append(_ca, format) - _ca = append(_ca, values...) - _m.Called(_ca...) -} - -// Infow provides a mock function with given fields: msg, keysAndValues -func (_m *Logger) Infow(msg string, keysAndValues ...interface{}) { - var _ca []interface{} - _ca = append(_ca, msg) - _ca = append(_ca, keysAndValues...) - _m.Called(_ca...) -} - -// Name provides a mock function with given fields: -func (_m *Logger) Name() string { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for Name") - } - - var r0 string - if rf, ok := ret.Get(0).(func() string); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(string) - } - - return r0 -} - -// Named provides a mock function with given fields: name -func (_m *Logger) Named(name string) logger.Logger { - ret := _m.Called(name) - - if len(ret) == 0 { - panic("no return value specified for Named") - } - - var r0 logger.Logger - if rf, ok := ret.Get(0).(func(string) logger.Logger); ok { - r0 = rf(name) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(logger.Logger) - } - } - - return r0 -} - -// Panic provides a mock function with given fields: args -func (_m *Logger) Panic(args ...interface{}) { - var _ca []interface{} - _ca = append(_ca, args...) - _m.Called(_ca...) -} - -// Panicf provides a mock function with given fields: format, values -func (_m *Logger) Panicf(format string, values ...interface{}) { - var _ca []interface{} - _ca = append(_ca, format) - _ca = append(_ca, values...) - _m.Called(_ca...) -} - -// Panicw provides a mock function with given fields: msg, keysAndValues -func (_m *Logger) Panicw(msg string, keysAndValues ...interface{}) { - var _ca []interface{} - _ca = append(_ca, msg) - _ca = append(_ca, keysAndValues...) - _m.Called(_ca...) -} - -// Recover provides a mock function with given fields: panicErr -func (_m *Logger) Recover(panicErr interface{}) { - _m.Called(panicErr) -} - -// SetLogLevel provides a mock function with given fields: _a0 -func (_m *Logger) SetLogLevel(_a0 zapcore.Level) { - _m.Called(_a0) -} - -// Sync provides a mock function with given fields: -func (_m *Logger) Sync() error { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for Sync") - } - - var r0 error - if rf, ok := ret.Get(0).(func() error); ok { - r0 = rf() - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// Trace provides a mock function with given fields: args -func (_m *Logger) Trace(args ...interface{}) { - var _ca []interface{} - _ca = append(_ca, args...) - _m.Called(_ca...) -} - -// Tracef provides a mock function with given fields: format, values -func (_m *Logger) Tracef(format string, values ...interface{}) { - var _ca []interface{} - _ca = append(_ca, format) - _ca = append(_ca, values...) - _m.Called(_ca...) -} - -// Tracew provides a mock function with given fields: msg, keysAndValues -func (_m *Logger) Tracew(msg string, keysAndValues ...interface{}) { - var _ca []interface{} - _ca = append(_ca, msg) - _ca = append(_ca, keysAndValues...) - _m.Called(_ca...) -} - -// Warn provides a mock function with given fields: args -func (_m *Logger) Warn(args ...interface{}) { - var _ca []interface{} - _ca = append(_ca, args...) - _m.Called(_ca...) -} - -// Warnf provides a mock function with given fields: format, values -func (_m *Logger) Warnf(format string, values ...interface{}) { - var _ca []interface{} - _ca = append(_ca, format) - _ca = append(_ca, values...) - _m.Called(_ca...) -} - -// Warnw provides a mock function with given fields: msg, keysAndValues -func (_m *Logger) Warnw(msg string, keysAndValues ...interface{}) { - var _ca []interface{} - _ca = append(_ca, msg) - _ca = append(_ca, keysAndValues...) - _m.Called(_ca...) -} - -// With provides a mock function with given fields: args -func (_m *Logger) With(args ...interface{}) logger.Logger { - var _ca []interface{} - _ca = append(_ca, args...) - ret := _m.Called(_ca...) - - if len(ret) == 0 { - panic("no return value specified for With") - } - - var r0 logger.Logger - if rf, ok := ret.Get(0).(func(...interface{}) logger.Logger); ok { - r0 = rf(args...) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(logger.Logger) - } - } - - return r0 -} - -// NewLogger creates a new instance of Logger. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewLogger(t interface { - mock.TestingT - Cleanup(func()) -}) *Logger { - mock := &Logger{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/core/recovery/recover.go b/core/recovery/recover.go index 8e485abc556..61315defa9a 100644 --- a/core/recovery/recover.go +++ b/core/recovery/recover.go @@ -3,38 +3,38 @@ package recovery import ( "github.com/getsentry/sentry-go" - "github.com/smartcontractkit/chainlink/v2/core/logger" + "github.com/smartcontractkit/chainlink-common/pkg/logger" + + corelogger "github.com/smartcontractkit/chainlink/v2/core/logger" ) func ReportPanics(fn func()) { - defer func() { - if err := recover(); err != nil { - sentry.CurrentHub().Recover(err) - sentry.Flush(logger.SentryFlushDeadline) + HandleFn(fn, func(err any) { + sentry.CurrentHub().Recover(err) + sentry.Flush(corelogger.SentryFlushDeadline) - panic(err) - } - }() - fn() + panic(err) + }) } func WrapRecover(lggr logger.Logger, fn func()) { - defer func() { - if err := recover(); err != nil { - lggr.Recover(err) + WrapRecoverHandle(lggr, fn, nil) +} + +func WrapRecoverHandle(lggr logger.Logger, fn func(), onPanic func(recovered any)) { + HandleFn(fn, func(recovered any) { + logger.Sugared(lggr).Criticalw("Recovered goroutine panic", "panic", recovered) + + if onPanic != nil { + onPanic(recovered) } - }() - fn() + }) } -func WrapRecoverHandle(lggr logger.Logger, fn func(), onPanic func(interface{})) { +func HandleFn(fn func(), onPanic func(recovered any)) { defer func() { - if err := recover(); err != nil { - lggr.Recover(err) - - if onPanic != nil { - onPanic(err) - } + if recovered := recover(); recovered != nil { + onPanic(recovered) } }() fn() diff --git a/core/scripts/chaincli/DEBUGGING.md b/core/scripts/chaincli/DEBUGGING.md index 3696b225cb6..d032228f3ce 100644 --- a/core/scripts/chaincli/DEBUGGING.md +++ b/core/scripts/chaincli/DEBUGGING.md @@ -6,6 +6,9 @@ Use this script to debug and diagnose possible issues with registered upkeeps in Before starting, you will need: +- An archival RPC URL (required) and Tenderly credential (optional) + In order to get an archive URL, it's recommended to go to your Infura or Alchemy account (free tier should do) and get + a RPC URL. - A registered [upkeep](https://docs.chain.link/chainlink-automation/overview/getting-started) - A working [Go](https://go.dev/doc/install) installation, please use this Go [version](https://github.com/smartcontractkit/chainlink/blob/develop/go.mod#L3) diff --git a/core/scripts/chaincli/handler/debug.go b/core/scripts/chaincli/handler/debug.go index eac3233ea58..e60bc8749ff 100644 --- a/core/scripts/chaincli/handler/debug.go +++ b/core/scripts/chaincli/handler/debug.go @@ -24,6 +24,8 @@ import ( ocr2keepers "github.com/smartcontractkit/chainlink-common/pkg/types/automation" + "github.com/smartcontractkit/chainlink/v2/core/cbor" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" evm21 "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21" commonhex "github.com/smartcontractkit/chainlink-common/pkg/utils/hex" @@ -43,9 +45,14 @@ import ( const ( ConditionTrigger uint8 = iota LogTrigger - expectedTypeAndVersion = "KeeperRegistry 2.1.0" + expectedVersion21 = "KeeperRegistry 2.1.0" + expectedVersion23 = "AutomationRegistry 2.3.0" ) +type UpkeepOffchainConfig struct { + MaxGasPrice *big.Int `json:"maxGasPrice" cbor:"maxGasPrice"` +} + var mercuryPacker = mercury.NewAbiPacker() var packer = encoding.NewAbiPacker() @@ -85,8 +92,8 @@ func (k *Keeper) Debug(ctx context.Context, args []string) { if err != nil { failCheckConfig("failed to get typeAndVersion: make sure your registry contract address and archive node are valid", err) } - if typeAndVersion != expectedTypeAndVersion { - failCheckConfig(fmt.Sprintf("invalid registry contract: this command can only debug %s, got: %s", expectedTypeAndVersion, typeAndVersion), nil) + if typeAndVersion != expectedVersion21 && typeAndVersion != expectedVersion23 { + failCheckConfig(fmt.Sprintf("invalid registry contract: this command can only debug %s or %s, got: %s", expectedVersion21, expectedVersion23, typeAndVersion), nil) } // get upkeepID from command args upkeepID := big.NewInt(0) @@ -134,6 +141,10 @@ func (k *Keeper) Debug(ctx context.Context, args []string) { // do basic checks upkeepInfo = getUpkeepInfoAndRunBasicChecks(v2common, triggerCallOpts, upkeepID, chainID) + cgp, mgp := getGasPrice(ctx, k, upkeepInfo) + log.Printf("CURRENT gas price (you cannot call eth_gasPrice on any non latest block) is %s, this upkeep's MAX gas price is %s\n", cgp, mgp) + log.Printf("If upkeep's max gas price (if configured) is lower than the gas price when this upkeep was previously checked, the simulation will fail and this upkeep won't be performed.\n") + var tmpCheckResult autov2common.CheckUpkeep0 tmpCheckResult, err = v2common.CheckUpkeep0(triggerCallOpts, upkeepID) if err != nil { @@ -208,6 +219,10 @@ func (k *Keeper) Debug(ctx context.Context, args []string) { // do basic checks upkeepInfo = getUpkeepInfoAndRunBasicChecks(v2common, triggerCallOpts, upkeepID, chainID) + cgp, mgp := getGasPrice(ctx, k, upkeepInfo) + log.Printf("CURRENT gas price (you cannot call eth_gasPrice on any non latest block) is %s, this upkeep's MAX gas price is %s\n", cgp, mgp) + log.Printf("If upkeep's max gas price (if configured) is lower than the gas price when this upkeep was previously checked, the simulation will fail and this upkeep won't be performed.\n") + var rawTriggerConfig []byte rawTriggerConfig, err = v2common.GetUpkeepTriggerConfig(triggerCallOpts, upkeepID) if err != nil { @@ -386,6 +401,36 @@ func (k *Keeper) Debug(ctx context.Context, args []string) { } } +func getGasPrice(ctx context.Context, k *Keeper, upkeepInfo autov2common.IAutomationV21PlusCommonUpkeepInfoLegacy) (*assets.Wei, *assets.Wei) { + var cgp *assets.Wei + var err error + var gp *big.Int + // get gas price, eth_gasPrice does not take arguments, so we cannot access gas price at an older block + gp, err = k.client.SuggestGasPrice(ctx) + if err != nil { + log.Printf("⚠️ failed to get current gas price due to %v", err) + } else { + cgp = assets.NewWei(gp) + log.Printf("current gas price is %s", cgp) + } + + var mgp *assets.Wei + // check if max gas price is configured + if len(upkeepInfo.OffchainConfig) != 0 { + var offchainConfig UpkeepOffchainConfig + err := cbor.ParseDietCBORToStruct(upkeepInfo.OffchainConfig, &offchainConfig) + if err != nil { + log.Printf("failed to parse offchain config bytes to max gas price\n") + } else { + mgp = assets.NewWei(offchainConfig.MaxGasPrice) + } + } else { + log.Printf("offchain config is not configured for this upkeep\n") + } + + return cgp, mgp +} + func getUpkeepInfoAndRunBasicChecks(keeperRegistry21 *autov2common.IAutomationV21PlusCommon, callOpts *bind.CallOpts, upkeepID *big.Int, chainID int64) autov2common.IAutomationV21PlusCommonUpkeepInfoLegacy { // get upkeep info upkeepInfo, err := keeperRegistry21.GetUpkeep(callOpts, upkeepID) diff --git a/core/scripts/gateway/connector/run_connector.go b/core/scripts/gateway/connector/run_connector.go index 8d74bb88aec..2a2445c1d92 100644 --- a/core/scripts/gateway/connector/run_connector.go +++ b/core/scripts/gateway/connector/run_connector.go @@ -69,7 +69,13 @@ func main() { sampleKey, _ := crypto.HexToECDSA("cd47d3fafdbd652dd2b66c6104fa79b372c13cb01f4a4fbfc36107cce913ac1d") lggr, _ := logger.NewLogger() client := &client{privateKey: sampleKey, lggr: lggr} - connector, _ := connector.NewGatewayConnector(&cfg, client, client, clockwork.NewRealClock(), lggr) + // client acts as a signer here + connector, _ := connector.NewGatewayConnector(&cfg, client, clockwork.NewRealClock(), lggr) + err = connector.AddHandler([]string{"test_method"}, client) + if err != nil { + fmt.Println("error adding handler:", err) + return + } client.connector = connector ctx, _ := signal.NotifyContext(context.Background(), os.Interrupt) diff --git a/core/scripts/go.mod b/core/scripts/go.mod index e735959f4e6..82baeff7bdc 100644 --- a/core/scripts/go.mod +++ b/core/scripts/go.mod @@ -1,39 +1,37 @@ module github.com/smartcontractkit/chainlink/core/scripts -go 1.22.0 - -toolchain go1.22.3 +go 1.22.5 // Make sure we're working with the latest chainlink libs replace github.com/smartcontractkit/chainlink/v2 => ../../ require ( github.com/docker/docker v24.0.7+incompatible - github.com/docker/go-connections v0.4.0 + github.com/docker/go-connections v0.5.0 github.com/ethereum/go-ethereum v1.13.8 github.com/gkampitakis/go-snaps v0.5.4 github.com/google/go-cmp v0.6.0 github.com/google/uuid v1.6.0 github.com/jmoiron/sqlx v1.4.0 - github.com/joho/godotenv v1.4.0 + github.com/joho/godotenv v1.5.1 github.com/jonboulle/clockwork v0.4.0 github.com/manyminds/api2go v0.0.0-20171030193247-e7b693844a6f github.com/montanaflynn/stats v0.7.1 github.com/olekukonko/tablewriter v0.0.5 - github.com/pelletier/go-toml/v2 v2.2.0 - github.com/prometheus/client_golang v1.17.0 - github.com/shopspring/decimal v1.3.1 + github.com/pelletier/go-toml/v2 v2.2.2 + github.com/prometheus/client_golang v1.20.0 + github.com/shopspring/decimal v1.4.0 github.com/smartcontractkit/chainlink-automation v1.0.4 - github.com/smartcontractkit/chainlink-common v0.1.7-0.20240709155552-d76403db14e5 + github.com/smartcontractkit/chainlink-common v0.2.3-0.20240927162447-20630b333f57 github.com/smartcontractkit/chainlink/v2 v2.0.0-00010101000000-000000000000 - github.com/smartcontractkit/libocr v0.0.0-20240702141926-063ceef8c42e - github.com/spf13/cobra v1.8.0 - github.com/spf13/viper v1.15.0 + github.com/smartcontractkit/libocr v0.0.0-20240717100443-f6226e09bee7 + github.com/spf13/cobra v1.8.1 + github.com/spf13/viper v1.18.2 github.com/stretchr/testify v1.9.0 github.com/umbracle/ethgo v0.1.3 github.com/umbracle/fastrlp v0.0.0-20220527094140-59d5dd30e722 github.com/urfave/cli v1.22.14 - google.golang.org/protobuf v1.34.1 + google.golang.org/protobuf v1.34.2 k8s.io/api v0.30.0 k8s.io/apimachinery v0.30.0 k8s.io/client-go v0.30.0 @@ -43,14 +41,14 @@ require ( contrib.go.opencensus.io/exporter/stackdriver v0.13.5 // indirect cosmossdk.io/api v0.3.1 // indirect cosmossdk.io/core v0.5.1 // indirect - cosmossdk.io/depinject v1.0.0-alpha.3 // indirect - cosmossdk.io/errors v1.0.0 // indirect - cosmossdk.io/math v1.0.1 // indirect + cosmossdk.io/depinject v1.0.0-alpha.4 // indirect + cosmossdk.io/errors v1.0.1 // indirect + cosmossdk.io/math v1.3.0 // indirect filippo.io/edwards25519 v1.1.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.1 // indirect github.com/Azure/go-ntlmssp v0.0.0-20221128193559-754e69321358 // indirect - github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d // indirect + github.com/ChainSafe/go-schnorrkel v1.0.0 // indirect github.com/CosmWasm/wasmd v0.40.1 // indirect github.com/CosmWasm/wasmvm v1.2.4 // indirect github.com/DataDog/zstd v1.5.2 // indirect @@ -62,7 +60,7 @@ require ( github.com/VictoriaMetrics/fastcache v1.12.1 // indirect github.com/XSAM/otelsql v0.27.0 // indirect github.com/armon/go-metrics v0.4.1 // indirect - github.com/avast/retry-go/v4 v4.5.1 // indirect + github.com/avast/retry-go/v4 v4.6.0 // indirect github.com/bahlo/generic-list-go v0.2.0 // indirect github.com/benbjohnson/clock v1.3.5 // indirect github.com/beorn7/perks v1.0.1 // indirect @@ -76,35 +74,35 @@ require ( github.com/cenkalti/backoff v2.2.1+incompatible // indirect github.com/cenkalti/backoff/v4 v4.3.0 // indirect github.com/cespare/xxhash v1.1.0 // indirect - github.com/cespare/xxhash/v2 v2.2.0 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d // indirect github.com/chenzhuoyu/iasm v0.9.0 // indirect - github.com/cockroachdb/errors v1.9.1 // indirect + github.com/cockroachdb/errors v1.10.0 // indirect github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect github.com/cockroachdb/pebble v0.0.0-20230928194634-aa077af62593 // indirect - github.com/cockroachdb/redact v1.1.3 // indirect + github.com/cockroachdb/redact v1.1.5 // indirect github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect - github.com/cometbft/cometbft v0.37.2 // indirect + github.com/cometbft/cometbft v0.37.5 // indirect github.com/cometbft/cometbft-db v0.7.0 // indirect github.com/confio/ics23/go v0.9.0 // indirect github.com/consensys/bavard v0.1.13 // indirect github.com/consensys/gnark-crypto v0.12.1 // indirect github.com/cosmos/btcutil v1.0.5 // indirect - github.com/cosmos/cosmos-proto v1.0.0-beta.2 // indirect - github.com/cosmos/cosmos-sdk v0.47.4 // indirect + github.com/cosmos/cosmos-proto v1.0.0-beta.5 // indirect + github.com/cosmos/cosmos-sdk v0.47.11 // indirect github.com/cosmos/go-bip39 v1.0.0 // indirect github.com/cosmos/gogoproto v1.4.11 // indirect - github.com/cosmos/iavl v0.20.0 // indirect + github.com/cosmos/iavl v0.20.1 // indirect github.com/cosmos/ibc-go/v7 v7.0.1 // indirect github.com/cosmos/ics23/go v0.9.1-0.20221207100636-b1abd8678aab // indirect - github.com/cosmos/ledger-cosmos-go v0.12.1 // indirect - github.com/cpuguy83/go-md2man/v2 v2.0.3 // indirect + github.com/cosmos/ledger-cosmos-go v0.12.4 // indirect + github.com/cpuguy83/go-md2man/v2 v2.0.4 // indirect github.com/crate-crypto/go-ipa v0.0.0-20231025140028-3c0104f4b233 // indirect github.com/crate-crypto/go-kzg-4844 v0.7.0 // indirect github.com/danieljoos/wincred v1.1.2 // indirect github.com/danielkov/gin-helmet v0.0.0-20171108135313-1387e224435e // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect - github.com/deckarep/golang-set/v2 v2.3.0 // indirect + github.com/deckarep/golang-set/v2 v2.6.0 // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect github.com/dfuse-io/logging v0.0.0-20210109005628-b97a57253f70 // indirect github.com/dgraph-io/badger/v2 v2.2007.4 // indirect @@ -118,17 +116,17 @@ require ( github.com/emicklei/go-restful/v3 v3.11.0 // indirect github.com/esote/minmaxheap v1.0.0 // indirect github.com/ethereum/c-kzg-4844 v0.4.0 // indirect - github.com/fatih/color v1.16.0 // indirect - github.com/fsnotify/fsnotify v1.6.0 // indirect - github.com/fxamacker/cbor/v2 v2.6.0 // indirect - github.com/gabriel-vasile/mimetype v1.4.2 // indirect + github.com/fatih/color v1.17.0 // indirect + github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/fxamacker/cbor/v2 v2.7.0 // indirect + github.com/gabriel-vasile/mimetype v1.4.3 // indirect github.com/gagliardetto/binary v0.7.7 // indirect github.com/gagliardetto/solana-go v1.8.4 // indirect github.com/gagliardetto/treeout v0.1.4 // indirect github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08 // indirect github.com/gballet/go-verkle v0.1.1-0.20231031103413-a67434b50f46 // indirect github.com/gedex/inflector v0.0.0-20170307190818-16278e9db813 // indirect - github.com/getsentry/sentry-go v0.19.0 // indirect + github.com/getsentry/sentry-go v0.23.0 // indirect github.com/gin-contrib/cors v1.5.0 // indirect github.com/gin-contrib/expvar v0.0.1 // indirect github.com/gin-contrib/sessions v0.0.5 // indirect @@ -143,7 +141,7 @@ require ( github.com/go-kit/log v0.2.1 // indirect github.com/go-ldap/ldap/v3 v3.4.6 // indirect github.com/go-logfmt/logfmt v0.6.0 // indirect - github.com/go-logr/logr v1.4.1 // indirect + github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/go-ole/go-ole v1.2.6 // indirect github.com/go-openapi/jsonpointer v0.20.0 // indirect @@ -151,7 +149,8 @@ require ( github.com/go-openapi/swag v0.22.4 // indirect github.com/go-playground/locales v0.14.1 // indirect github.com/go-playground/universal-translator v0.18.1 // indirect - github.com/go-playground/validator/v10 v10.15.5 // indirect + github.com/go-playground/validator/v10 v10.22.0 // indirect + github.com/go-viper/mapstructure/v2 v2.1.0 // indirect github.com/go-webauthn/webauthn v0.9.4 // indirect github.com/go-webauthn/x v0.1.5 // indirect github.com/goccy/go-json v0.10.2 // indirect @@ -159,7 +158,7 @@ require ( github.com/gofrs/flock v0.8.1 // indirect github.com/gogo/protobuf v1.3.3 // indirect github.com/golang-jwt/jwt/v5 v5.2.0 // indirect - github.com/golang/glog v1.2.0 // indirect + github.com/golang/glog v1.2.1 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/protobuf v1.5.4 // indirect github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb // indirect @@ -167,20 +166,20 @@ require ( github.com/google/gnostic-models v0.6.8 // indirect github.com/google/go-tpm v0.9.0 // indirect github.com/google/gofuzz v1.2.0 // indirect - github.com/google/pprof v0.0.0-20231023181126-ff6d637d2a7b // indirect + github.com/google/pprof v0.0.0-20240424215950-a892ee059fd6 // indirect github.com/gorilla/context v1.1.1 // indirect github.com/gorilla/securecookie v1.1.2 // indirect github.com/gorilla/sessions v1.2.2 // indirect github.com/gorilla/websocket v1.5.1 // indirect github.com/grafana/pyroscope-go v1.1.1 // indirect - github.com/grafana/pyroscope-go/godeltaprof v0.1.6 // indirect + github.com/grafana/pyroscope-go/godeltaprof v0.1.8 // indirect github.com/graph-gophers/dataloader v5.0.0+incompatible // indirect - github.com/graph-gophers/graphql-go v1.3.0 // indirect + github.com/graph-gophers/graphql-go v1.5.0 // indirect github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus v1.0.1 // indirect github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.1.0 // indirect github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect - github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0 // indirect github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect github.com/gtank/merlin v0.1.1 // indirect github.com/gtank/ristretto255 v0.1.2 // indirect @@ -189,7 +188,7 @@ require ( github.com/hashicorp/go-envparse v0.1.0 // indirect github.com/hashicorp/go-hclog v1.5.0 // indirect github.com/hashicorp/go-immutable-radix v1.3.1 // indirect - github.com/hashicorp/go-plugin v1.6.0 // indirect + github.com/hashicorp/go-plugin v1.6.2-0.20240829161738-06afb6d7ae99 // indirect github.com/hashicorp/go-retryablehttp v0.7.5 // indirect github.com/hashicorp/golang-lru v0.6.0 // indirect github.com/hashicorp/hcl v1.0.0 // indirect @@ -215,13 +214,13 @@ require ( github.com/josharian/intern v1.0.0 // indirect github.com/jpillora/backoff v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect - github.com/klauspost/compress v1.17.3 // indirect + github.com/klauspost/compress v1.17.9 // indirect github.com/klauspost/cpuid/v2 v2.2.5 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect github.com/kylelemons/godebug v1.1.0 // indirect github.com/leanovate/gopter v0.2.10-0.20210127095200-9abe2343507a // indirect - github.com/leodido/go-urn v1.2.4 // indirect + github.com/leodido/go-urn v1.4.0 // indirect github.com/lib/pq v1.10.9 // indirect github.com/libp2p/go-buffer-pool v0.1.0 // indirect github.com/logrusorgru/aurora v2.0.3+incompatible // indirect @@ -231,7 +230,6 @@ require ( github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect github.com/mattn/go-runewidth v0.0.14 // indirect - github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 // indirect github.com/mfridman/interpolate v0.0.2 // indirect github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect @@ -244,7 +242,6 @@ require ( github.com/mr-tron/base58 v1.2.0 // indirect github.com/mtibben/percent v0.2.1 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect - github.com/mwitkow/grpc-proxy v0.0.0-20230212185441-f345521cb9c9 // indirect github.com/oklog/run v1.1.0 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect github.com/opencontainers/image-spec v1.1.0-rc5 // indirect @@ -256,37 +253,42 @@ require ( github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect github.com/pressly/goose/v3 v3.21.1 // indirect - github.com/prometheus/client_model v0.5.0 // indirect - github.com/prometheus/common v0.45.0 // indirect - github.com/prometheus/procfs v0.12.0 // indirect + github.com/prometheus/client_model v0.6.1 // indirect + github.com/prometheus/common v0.59.1 // indirect + github.com/prometheus/procfs v0.15.1 // indirect github.com/prometheus/prometheus v0.48.1 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect github.com/rivo/uniseg v0.4.4 // indirect github.com/robfig/cron/v3 v3.0.1 // indirect github.com/rogpeppe/go-internal v1.12.0 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect + github.com/sagikazarmark/locafero v0.4.0 // indirect + github.com/sagikazarmark/slog-shim v0.1.0 // indirect github.com/santhosh-tekuri/jsonschema/v5 v5.3.1 // indirect github.com/sasha-s/go-deadlock v0.3.1 // indirect github.com/scylladb/go-reflectx v1.0.1 // indirect github.com/sethvargo/go-retry v0.2.4 // indirect github.com/shirou/gopsutil v3.21.11+incompatible // indirect github.com/shirou/gopsutil/v3 v3.24.3 // indirect - github.com/smartcontractkit/chain-selectors v1.0.10 // indirect - github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20240710121324-3ed288aa9b45 // indirect - github.com/smartcontractkit/chainlink-data-streams v0.0.0-20240702145022-37a2c3a742d1 // indirect - github.com/smartcontractkit/chainlink-feeds v0.0.0-20240522213638-159fb2d99917 // indirect - github.com/smartcontractkit/chainlink-solana v1.0.3-0.20240708150922-0546185ead68 // indirect - github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240709043547-03612098f799 // indirect + github.com/smartcontractkit/chain-selectors v1.0.23 // indirect + github.com/smartcontractkit/chainlink-ccip v0.0.0-20240930060710-158d2a9ac9ca // indirect + github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20240911175228-daf2600bb7b7 // indirect + github.com/smartcontractkit/chainlink-data-streams v0.0.0-20240916152957-433914114bd2 // indirect + github.com/smartcontractkit/chainlink-feeds v0.0.0-20240910155501-42f20443189f // indirect + github.com/smartcontractkit/chainlink-solana v1.1.1-0.20240927143737-7e527aa85bff // indirect + github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240911194142-506bc469d8ae // indirect + github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7 // indirect github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin v0.0.0-20230906073235-9e478e5e19f1 // indirect github.com/smartcontractkit/tdh2/go/tdh2 v0.0.0-20230906073235-9e478e5e19f1 // indirect - github.com/smartcontractkit/wsrpc v0.7.3 // indirect - github.com/spf13/afero v1.9.5 // indirect + github.com/smartcontractkit/wsrpc v0.8.2 // indirect + github.com/sourcegraph/conc v0.3.0 // indirect + github.com/spf13/afero v1.11.0 // indirect github.com/spf13/cast v1.6.0 // indirect - github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/status-im/keycard-go v0.2.0 // indirect github.com/streamingfast/logging v0.0.0-20220405224725-2755dab2ce75 // indirect - github.com/subosito/gotenv v1.4.2 // indirect + github.com/stretchr/objx v0.5.2 // indirect + github.com/subosito/gotenv v1.6.0 // indirect github.com/supranational/blst v0.3.11 // indirect github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c // indirect @@ -310,42 +312,50 @@ require ( github.com/wk8/go-ordered-map/v2 v2.1.8 // indirect github.com/x448/float16 v0.8.4 // indirect github.com/yusufpapurcu/wmi v1.2.4 // indirect - github.com/zondax/hid v0.9.1 // indirect - github.com/zondax/ledger-go v0.14.1 // indirect + github.com/zondax/hid v0.9.2 // indirect + github.com/zondax/ledger-go v0.14.3 // indirect go.dedis.ch/fixbuf v1.0.3 // indirect go.dedis.ch/kyber/v3 v3.1.0 // indirect go.etcd.io/bbolt v1.3.7 // indirect go.mongodb.org/mongo-driver v1.15.0 // indirect go.opencensus.io v0.24.0 // indirect go.opentelemetry.io/contrib/instrumentation/github.com/gin-gonic/gin/otelgin v0.49.0 // indirect - go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.52.0 // indirect - go.opentelemetry.io/otel v1.27.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.27.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.27.0 // indirect - go.opentelemetry.io/otel/metric v1.27.0 // indirect - go.opentelemetry.io/otel/sdk v1.27.0 // indirect - go.opentelemetry.io/otel/trace v1.27.0 // indirect - go.opentelemetry.io/proto/otlp v1.2.0 // indirect + go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.53.0 // indirect + go.opentelemetry.io/otel v1.28.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.0.0-20240823153156-2a54df7bffb9 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.28.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.28.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.28.0 // indirect + go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.4.0 // indirect + go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.28.0 // indirect + go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.28.0 // indirect + go.opentelemetry.io/otel/log v0.4.0 // indirect + go.opentelemetry.io/otel/metric v1.28.0 // indirect + go.opentelemetry.io/otel/sdk v1.28.0 // indirect + go.opentelemetry.io/otel/sdk/log v0.4.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.28.0 // indirect + go.opentelemetry.io/otel/trace v1.28.0 // indirect + go.opentelemetry.io/proto/otlp v1.3.1 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/ratelimit v0.3.0 // indirect - go.uber.org/zap v1.26.0 // indirect - golang.org/x/arch v0.7.0 // indirect - golang.org/x/crypto v0.24.0 // indirect - golang.org/x/exp v0.0.0-20240325151524-a685a6edb6d8 // indirect - golang.org/x/mod v0.17.0 // indirect - golang.org/x/net v0.25.0 // indirect - golang.org/x/oauth2 v0.20.0 // indirect - golang.org/x/sync v0.7.0 // indirect - golang.org/x/sys v0.21.0 // indirect - golang.org/x/term v0.21.0 // indirect - golang.org/x/text v0.16.0 // indirect - golang.org/x/time v0.5.0 // indirect - golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect - gonum.org/v1/gonum v0.14.0 // indirect - google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20240520151616-dc85e6b867a5 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240520151616-dc85e6b867a5 // indirect - google.golang.org/grpc v1.64.0 // indirect + go.uber.org/zap v1.27.0 // indirect + golang.org/x/arch v0.8.0 // indirect + golang.org/x/crypto v0.27.0 // indirect + golang.org/x/exp v0.0.0-20240909161429-701f63a606c0 // indirect + golang.org/x/mod v0.21.0 // indirect + golang.org/x/net v0.29.0 // indirect + golang.org/x/oauth2 v0.22.0 // indirect + golang.org/x/sync v0.8.0 // indirect + golang.org/x/sys v0.25.0 // indirect + golang.org/x/term v0.24.0 // indirect + golang.org/x/text v0.18.0 // indirect + golang.org/x/time v0.6.0 // indirect + golang.org/x/tools v0.25.0 // indirect + gonum.org/v1/gonum v0.15.0 // indirect + google.golang.org/genproto v0.0.0-20240711142825-46eb208f015d // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20240822170219-fc7c04adadcd // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd // indirect + google.golang.org/grpc v1.65.0 // indirect gopkg.in/guregu/null.v4 v4.0.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/ini.v1 v1.67.0 // indirect @@ -354,8 +364,8 @@ require ( gopkg.in/yaml.v3 v3.0.1 // indirect k8s.io/klog/v2 v2.120.1 // indirect k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 // indirect - k8s.io/utils v0.0.0-20230726121419-3b25d923346b // indirect - pgregory.net/rapid v0.5.5 // indirect + k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 // indirect + pgregory.net/rapid v1.1.0 // indirect rsc.io/tmplfunc v0.0.3 // indirect sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect @@ -363,13 +373,11 @@ require ( ) replace ( + // until merged upstream: https://github.com/omissis/go-jsonschema/pull/264 + github.com/atombender/go-jsonschema => github.com/nolag/go-jsonschema v0.16.0-rtinianov + // replicating the replace directive on cosmos SDK github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1 - - // until merged upstream: https://github.com/hashicorp/go-plugin/pull/257 - github.com/hashicorp/go-plugin => github.com/smartcontractkit/go-plugin v0.0.0-20240208201424-b3b91517de16 - - // until merged upstream: https://github.com/mwitkow/grpc-proxy/pull/69 - github.com/mwitkow/grpc-proxy => github.com/smartcontractkit/grpc-proxy v0.0.0-20230731113816-f1be6620749f - ) + +replace github.com/sourcegraph/sourcegraph/lib => github.com/sourcegraph/sourcegraph-public-snapshot/lib v0.0.0-20240822153003-c864f15af264 diff --git a/core/scripts/go.sum b/core/scripts/go.sum index 707002a52d0..c94eb80a17c 100644 --- a/core/scripts/go.sum +++ b/core/scripts/go.sum @@ -4,48 +4,37 @@ cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSR cloud.google.com/go v0.43.0/go.mod h1:BOSR3VbTLkk6FDC/TcffxP4NF/FFBGA5ku+jvKOP7pg= cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= -cloud.google.com/go v0.44.3/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= -cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= -cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= -cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= -cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= -cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= -cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= -cloud.google.com/go v0.75.0/go.mod h1:VGuuCn7PG0dwsd5XPVm2Mm3wlh3EL55/79EKB6hlPTY= -cloud.google.com/go v0.112.1 h1:uJSeirPke5UNZHIb4SxfZklVSiWWVqW4oXlETwZziwM= -cloud.google.com/go v0.112.1/go.mod h1:+Vbu+Y1UU+I1rjmzeMOb/8RfkKJK2Gyxi1X6jJCZLo4= +cloud.google.com/go v0.115.0 h1:CnFSK6Xo3lDYRoBKEcAtia6VSC837/ZkJuRduSFnr14= +cloud.google.com/go v0.115.0/go.mod h1:8jIM5vVgoAEoiVxQ/O4BFTfHqulPZgs/ufEzMcFMdWU= +cloud.google.com/go/auth v0.7.1 h1:Iv1bbpzJ2OIg16m94XI9/tlzZZl3cdeR3nGVGj78N7s= +cloud.google.com/go/auth v0.7.1/go.mod h1:VEc4p5NNxycWQTMQEDQF0bd6aTMb6VgYDXEwiJJQAbs= +cloud.google.com/go/auth/oauth2adapt v0.2.3 h1:MlxF+Pd3OmSudg/b1yZ5lJwoXCEaeedAguodky1PcKI= +cloud.google.com/go/auth/oauth2adapt v0.2.3/go.mod h1:tMQXOfZzFuNuUxOypHlQEXgdfX5cuhwU+ffUuXRJE8I= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= -cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= -cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= -cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= -cloud.google.com/go/compute v1.25.1 h1:ZRpHJedLtTpKgr3RV1Fx23NuaAEN1Zfx9hw1u4aJdjU= -cloud.google.com/go/compute/metadata v0.3.0 h1:Tz+eQXMEqDIKRsmY3cHTL6FVaynIjX2QxYC4trgAKZc= -cloud.google.com/go/compute/metadata v0.3.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k= +cloud.google.com/go/compute v1.27.2 h1:5cE5hdrwJV/92ravlwIFRGnyH9CpLGhh4N0ZDVTU+BA= +cloud.google.com/go/compute/metadata v0.5.0 h1:Zr0eK8JbFv6+Wi4ilXAR8FJ3wyNdpxHKJNPos6LTZOY= +cloud.google.com/go/compute/metadata v0.5.0/go.mod h1:aHnloV2TPI38yx4s9+wAZhHykWvVCfu7hQbF+9CWoiY= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= -cloud.google.com/go/iam v1.1.6 h1:bEa06k05IO4f4uJonbB5iAgKTPpABy1ayxaIZV/GHVc= -cloud.google.com/go/iam v1.1.6/go.mod h1:O0zxdPeGBoFdWW3HWmBxJsk0pfvNM/p/qa82rWOGTwI= +cloud.google.com/go/iam v1.1.11 h1:0mQ8UKSfdHLut6pH9FM3bI55KWR46ketn0PuXleDyxw= +cloud.google.com/go/iam v1.1.11/go.mod h1:biXoiLWYIKntto2joP+62sd9uW5EpkZmKIvfNcTWlnQ= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= -cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= -cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= -cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= -cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= -cloud.google.com/go/storage v1.38.0 h1:Az68ZRGlnNTpIBbLjSMIV2BDcwwXYlRlQzis0llkpJg= -cloud.google.com/go/storage v1.38.0/go.mod h1:tlUADB0mAb9BgYls9lq+8MGkfzOXuLrnHXlpHmvFJoY= +cloud.google.com/go/storage v1.43.0 h1:CcxnSohZwizt4LCzQHWvBf1/kvtHUn7gk9QERXPyXFs= +cloud.google.com/go/storage v1.43.0/go.mod h1:ajvxEa7WmZS1PxvKRq4bq0tFT3vMd502JwstCcYv0Q0= contrib.go.opencensus.io/exporter/stackdriver v0.12.6/go.mod h1:8x999/OcIPy5ivx/wDiV7Gx4D+VUPODf0mWRGRc5kSk= contrib.go.opencensus.io/exporter/stackdriver v0.13.4/go.mod h1:aXENhDJ1Y4lIg4EUaVTwzvYETVNZk10Pu26tevFKLUc= contrib.go.opencensus.io/exporter/stackdriver v0.13.5 h1:TNaexHK16gPUoc7uzELKOU7JULqccn1NDuqUxmxSqfo= @@ -54,14 +43,14 @@ cosmossdk.io/api v0.3.1 h1:NNiOclKRR0AOlO4KIqeaG6PS6kswOMhHD0ir0SscNXE= cosmossdk.io/api v0.3.1/go.mod h1:DfHfMkiNA2Uhy8fj0JJlOCYOBp4eWUUJ1te5zBGNyIw= cosmossdk.io/core v0.5.1 h1:vQVtFrIYOQJDV3f7rw4pjjVqc1id4+mE0L9hHP66pyI= cosmossdk.io/core v0.5.1/go.mod h1:KZtwHCLjcFuo0nmDc24Xy6CRNEL9Vl/MeimQ2aC7NLE= -cosmossdk.io/depinject v1.0.0-alpha.3 h1:6evFIgj//Y3w09bqOUOzEpFj5tsxBqdc5CfkO7z+zfw= -cosmossdk.io/depinject v1.0.0-alpha.3/go.mod h1:eRbcdQ7MRpIPEM5YUJh8k97nxHpYbc3sMUnEtt8HPWU= -cosmossdk.io/errors v1.0.0 h1:nxF07lmlBbB8NKQhtJ+sJm6ef5uV1XkvPXG2bUntb04= -cosmossdk.io/errors v1.0.0/go.mod h1:+hJZLuhdDE0pYN8HkOrVNwrIOYvUGnn6+4fjnJs/oV0= -cosmossdk.io/log v1.1.1-0.20230704160919-88f2c830b0ca h1:msenprh2BLLRwNT7zN56TbBHOGk/7ARQckXHxXyvjoQ= -cosmossdk.io/log v1.1.1-0.20230704160919-88f2c830b0ca/go.mod h1:PkIAKXZvaxrTRc++z53XMRvFk8AcGGWYHcMIPzVYX9c= -cosmossdk.io/math v1.0.1 h1:Qx3ifyOPaMLNH/89WeZFH268yCvU4xEcnPLu3sJqPPg= -cosmossdk.io/math v1.0.1/go.mod h1:Ygz4wBHrgc7g0N+8+MrnTfS9LLn9aaTGa9hKopuym5k= +cosmossdk.io/depinject v1.0.0-alpha.4 h1:PLNp8ZYAMPTUKyG9IK2hsbciDWqna2z1Wsl98okJopc= +cosmossdk.io/depinject v1.0.0-alpha.4/go.mod h1:HeDk7IkR5ckZ3lMGs/o91AVUc7E596vMaOmslGFM3yU= +cosmossdk.io/errors v1.0.1 h1:bzu+Kcr0kS/1DuPBtUFdWjzLqyUuCiyHjyJB6srBV/0= +cosmossdk.io/errors v1.0.1/go.mod h1:MeelVSZThMi4bEakzhhhE/CKqVv3nOJDA25bIqRDu/U= +cosmossdk.io/log v1.3.1 h1:UZx8nWIkfbbNEWusZqzAx3ZGvu54TZacWib3EzUYmGI= +cosmossdk.io/log v1.3.1/go.mod h1:2/dIomt8mKdk6vl3OWJcPk2be3pGOS8OQaLUM/3/tCM= +cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= +cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= cosmossdk.io/tools/rosetta v0.2.1 h1:ddOMatOH+pbxWbrGJKRAawdBkPYLfKXutK9IETnjYxw= cosmossdk.io/tools/rosetta v0.2.1/go.mod h1:Pqdc1FdvkNV3LcNIkYWt2RQY6IP1ge6YWZk8MhhO9Hw= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= @@ -74,7 +63,6 @@ github.com/99designs/keyring v1.2.1 h1:tYLp1ULvO7i3fI5vE21ReQuj99QFSs7lGm0xWyJo8 github.com/99designs/keyring v1.2.1/go.mod h1:fc+wB5KTk9wQ9sDx0kFXB3A0MaeGHM9AwRStKOQ5vOA= github.com/AlekSi/pointer v1.1.0 h1:SSDMPcXD9jSl8FPy9cRzoRaMJtm9g9ggGTxecRUbQoI= github.com/AlekSi/pointer v1.1.0/go.mod h1:y7BvfRI3wXPWKXEBhU71nbnIEEZX0QTSB2Bj48UJIZE= -github.com/AndreasBriese/bbloom v0.0.0-20190306092124-e2d15f34fcf9/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8= github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25UVaW/CKtUDjefjrs0SPonmDGUVOYP0= github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/Azure/go-ntlmssp v0.0.0-20221128193559-754e69321358 h1:mFRzDkZVAjdal+s7s0MwaRv9igoPqLRdzOLzw/8Xvq8= @@ -82,10 +70,8 @@ github.com/Azure/go-ntlmssp v0.0.0-20221128193559-754e69321358/go.mod h1:chxPXzS github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d h1:nalkkPQcITbvhmL4+C4cKA87NW0tfm3Kl9VXRoPywFg= -github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d/go.mod h1:URdX5+vg25ts3aCh8H5IFZybJYKWhJHYMTnf+ULtoC4= -github.com/CloudyKit/fastprinter v0.0.0-20200109182630-33d98a066a53/go.mod h1:+3IMCy2vIlbG1XG/0ggNQv0SvxCAIpPM5b1nCz56Xno= -github.com/CloudyKit/jet/v3 v3.0.0/go.mod h1:HKQPgSJmdK8hdoAbKUUWajkHyHo4RaU5rMdUywE7VMo= +github.com/ChainSafe/go-schnorrkel v1.0.0 h1:3aDA67lAykLaG1y3AOjs88dMxC88PgUuHRrLeDnvGIM= +github.com/ChainSafe/go-schnorrkel v1.0.0/go.mod h1:dpzHYVxLZcp8pjlV+O+UR8K0Hp/z7vcchBSbMBEhCw4= github.com/CosmWasm/wasmd v0.40.1 h1:LxbO78t/6S8TkeQlUrJ0m5O87HtAwLx4RGHq3rdrOEU= github.com/CosmWasm/wasmd v0.40.1/go.mod h1:6EOwnv7MpuFaEqxcUOdFV9i4yvrdOciaY6VQ1o7A3yg= github.com/CosmWasm/wasmvm v1.2.4 h1:6OfeZuEcEH/9iqwrg2pkeVtDCkMoj9U6PpKtcrCyVrQ= @@ -97,7 +83,6 @@ github.com/Depado/ginprom v1.8.0 h1:zaaibRLNI1dMiiuj1MKzatm8qrcHzikMlCc1anqOdyo= github.com/Depado/ginprom v1.8.0/go.mod h1:XBaKzeNBqPF4vxJpNLincSQZeMDnZp1tIbU0FU0UKgg= github.com/GeertJohan/go.incremental v1.0.0/go.mod h1:6fAjUhbVuX1KcMD3c8TEgVUqmo4seqhv0i0kdATSkM0= github.com/GeertJohan/go.rice v1.0.0/go.mod h1:eH6gbSOAUv07dQuZVnBmoDP8mgsM1rtixis4Tib9if0= -github.com/Joker/hpp v1.0.0/go.mod h1:8x5n+M1Hp5hC0g8okX3sR3vFQwynaX/UgSOM9MeBKzY= github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= github.com/Masterminds/semver/v3 v3.2.1 h1:RN9w6+7QoMeJVGyfmbcgs28Br8cvmnucEXnY0rYXWg0= github.com/Masterminds/semver/v3 v3.2.1/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYrf8m9wsX0PNOMQ= @@ -112,7 +97,6 @@ github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5/go.mod h1:lmUJ/7eu/Q8 github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/OneOfOne/xxhash v1.2.8 h1:31czK/TI9sNkxIKfaUfGlU47BAxQ0ztGgd9vPyqimf8= github.com/OneOfOne/xxhash v1.2.8/go.mod h1:eZbhyaAYD41SGSSsnmcpxVoRiQ/MPUTjUdIIOT9Um7Q= -github.com/Shopify/goreferrer v0.0.0-20181106222321-ec9c9a553398/go.mod h1:a1uqRtAwp2Xwc6WNPJEufxJ7fx3npB4UV/JOLmbu5I0= github.com/VictoriaMetrics/fastcache v1.12.1 h1:i0mICQuojGDL3KblA7wUNlY5lOK6a4bwt3uRKnkZU40= github.com/VictoriaMetrics/fastcache v1.12.1/go.mod h1:tX04vaqcNoQeGLD+ra5pU5sWkuxnzWhEzLwhP9w653o= github.com/VividCortex/gohistogram v1.0.0 h1:6+hBz+qvs0JOrrNhhmR7lFxo5sINxBCGXrdtl/UvroE= @@ -120,10 +104,7 @@ github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/ github.com/XSAM/otelsql v0.27.0 h1:i9xtxtdcqXV768a5C6SoT/RkG+ue3JTOgkYInzlTOqs= github.com/XSAM/otelsql v0.27.0/go.mod h1:0mFB3TvLa7NCuhm/2nU7/b2wEtsczkj8Rey8ygO7V+A= github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII= -github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY= github.com/akavel/rsrc v0.8.0/go.mod h1:uLoCtb9J+EyAqh+26kdrTgmzRBFPGOolLWKpdxkKq+c= -github.com/alecthomas/participle/v2 v2.0.0-alpha7 h1:cK4vjj0VSgb3lN1nuKA5F7dw+1s1pWBe5bx7nNCnN+c= -github.com/alecthomas/participle/v2 v2.0.0-alpha7/go.mod h1:NumScqsC42o9x+dGj8/YqsIfhrIQjFEOFovxotbBirA= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= @@ -143,13 +124,12 @@ github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmV github.com/armon/go-metrics v0.4.1 h1:hR91U9KYmb6bLBYLQjyM+3j+rcd/UhE+G78SFnF8gJA= github.com/armon/go-metrics v0.4.1/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+3JqfkOG4= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= -github.com/avast/retry-go/v4 v4.5.1 h1:AxIx0HGi4VZ3I02jr78j5lZ3M6x1E0Ivxa6b0pUUh7o= -github.com/avast/retry-go/v4 v4.5.1/go.mod h1:/sipNsvNB3RRuT5iNcb6h73nw3IBmXJ/H3XrCQYSOpc= +github.com/avast/retry-go/v4 v4.6.0 h1:K9xNA+KeB8HHc2aWFuLb25Offp+0iVRXEvFx8IinRJA= +github.com/avast/retry-go/v4 v4.6.0/go.mod h1:gvWlPhBVsvBbLkVGDg/KwvBv0bEkCOLRRSHKIr2PyOE= github.com/aws/aws-sdk-go v1.22.1/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.23.20/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.45.25 h1:c4fLlh5sLdK2DCRTY1z0hyuJZU4ygxX8m1FswL6/nF4= github.com/aws/aws-sdk-go v1.45.25/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= -github.com/aymerick/raymond v2.0.3-0.20180322193309-b565731e1464+incompatible/go.mod h1:osfaiScAUVup+UC9Nfq76eWqDhXlp+4UYaA8uhTBO6g= github.com/bahlo/generic-list-go v0.2.0 h1:5sz/EEAK+ls5wF+NeqDpk5+iNdMDXrh3z3nPnH1Wvgk= github.com/bahlo/generic-list-go v0.2.0/go.mod h1:2KvAjgMlE5NNynlg/5iLrrCCZ2+5xWbdbCW3pNTGyYg= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= @@ -212,8 +192,9 @@ github.com/cespare/cp v1.1.1/go.mod h1:SOGHArjBr4JWaSDEVpWpo/hNg6RoKrls6Oh40hiwW github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/chenzhuoyu/base64x v0.0.0-20211019084208-fb5309c8db06/go.mod h1:DH46F32mSOjUmXrMHnKwZdA8wcEefY7UVqBKYGjpdQY= github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311/go.mod h1:b583jCggY9gE99b6G5LEC39OIiVsWj+R97kbl5odCEk= github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d h1:77cEq6EriyTZ0g/qfRdp61a3Uu/AWrgIq2s0ClJV1g0= @@ -229,33 +210,27 @@ github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6D github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= -github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cockroachdb/apd v1.1.0 h1:3LFP3629v+1aKXU5Q37mxmRxX/pIu1nijXydLShEq5I= github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ= github.com/cockroachdb/apd/v2 v2.0.2 h1:weh8u7Cneje73dDh+2tEVLUvyBc89iwepWCD8b8034E= github.com/cockroachdb/apd/v2 v2.0.2/go.mod h1:DDxRlzC2lo3/vSlmSoS7JkqbbrARPuFOGr0B9pvN3Gw= -github.com/cockroachdb/apd/v3 v3.1.0 h1:MK3Ow7LH0W8zkd5GMKA1PvS9qG3bWFI95WaVNfyZJ/w= -github.com/cockroachdb/apd/v3 v3.1.0/go.mod h1:6qgPBMXjATAdD/VefbRP9NoSLKjbB4LCoA7gN4LpHs4= -github.com/cockroachdb/datadriven v1.0.2/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f h1:otljaYPt5hWxV3MUfO5dFPFiOXg9CyG5/kCfayTqsJ4= github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= -github.com/cockroachdb/errors v1.9.1 h1:yFVvsI0VxmRShfawbt/laCIDy/mtTqqnvoNgiy5bEV8= -github.com/cockroachdb/errors v1.9.1/go.mod h1:2sxOtL2WIc096WSZqZ5h8fa17rdDq9HZOZLBCor4mBk= -github.com/cockroachdb/logtags v0.0.0-20211118104740-dabe8e521a4f/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= +github.com/cockroachdb/errors v1.10.0 h1:lfxS8zZz1+OjtV4MtNWgboi/W5tyLEB6VQZBXN+0VUU= +github.com/cockroachdb/errors v1.10.0/go.mod h1:lknhIsEVQ9Ss/qKDBQS/UqFSvPQjOwNq2qyKAxtHRqE= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= github.com/cockroachdb/pebble v0.0.0-20230928194634-aa077af62593 h1:aPEJyR4rPBvDmeyi+l/FS/VtA00IWvjeFvjen1m1l1A= github.com/cockroachdb/pebble v0.0.0-20230928194634-aa077af62593/go.mod h1:6hk1eMY/u5t+Cf18q5lFMUA1Rc+Sm5I6Ra1QuPyxXCo= -github.com/cockroachdb/redact v1.1.3 h1:AKZds10rFSIj7qADf0g46UixK8NNLwWTNdCIGS5wfSQ= -github.com/cockroachdb/redact v1.1.3/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= +github.com/cockroachdb/redact v1.1.5 h1:u1PMllDkdFfPWaNGMyLD1+so+aq3uUItthCFqzwPJ30= +github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= -github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0/go.mod h1:4Zcjuz89kmFXt9morQgcfYZAYZ5n8WHjt81YYWIwtTM= github.com/coinbase/rosetta-sdk-go/types v1.0.0 h1:jpVIwLcPoOeCR6o1tU+Xv7r5bMONNbHU7MuEHboiFuA= github.com/coinbase/rosetta-sdk-go/types v1.0.0/go.mod h1:eq7W2TMRH22GTW0N0beDnN931DW0/WOI1R2sdHNHG4c= -github.com/cometbft/cometbft v0.37.2 h1:XB0yyHGT0lwmJlFmM4+rsRnczPlHoAKFX6K8Zgc2/Jc= -github.com/cometbft/cometbft v0.37.2/go.mod h1:Y2MMMN//O5K4YKd8ze4r9jmk4Y7h0ajqILXbH5JQFVs= +github.com/cometbft/cometbft v0.37.5 h1:/U/TlgMh4NdnXNo+YU9T2NMCWyhXNDF34Mx582jlvq0= +github.com/cometbft/cometbft v0.37.5/go.mod h1:QC+mU0lBhKn8r9qvmnq53Dmf3DWBt4VtkcKw2C81wxY= github.com/cometbft/cometbft-db v0.7.0 h1:uBjbrBx4QzU0zOEnU8KxoDl18dMNgDh+zZRUE0ucsbo= github.com/cometbft/cometbft-db v0.7.0/go.mod h1:yiKJIm2WKrt6x8Cyxtq9YTEcIMPcEe4XPxhgX59Fzf0= github.com/confio/ics23/go v0.9.0 h1:cWs+wdbS2KRPZezoaaj+qBleXgUk5WOQFMP3CQFGTr4= @@ -277,10 +252,10 @@ github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f/go.mod h1:F5haX7 github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cosmos/btcutil v1.0.5 h1:t+ZFcX77LpKtDBhjucvnOH8C2l2ioGsBNEQ3jef8xFk= github.com/cosmos/btcutil v1.0.5/go.mod h1:IyB7iuqZMJlthe2tkIFL33xPyzbFYP0XVdS8P5lUPis= -github.com/cosmos/cosmos-proto v1.0.0-beta.2 h1:X3OKvWgK9Gsejo0F1qs5l8Qn6xJV/AzgIWR2wZ8Nua8= -github.com/cosmos/cosmos-proto v1.0.0-beta.2/go.mod h1:+XRCLJ14pr5HFEHIUcn51IKXD1Fy3rkEQqt4WqmN4V0= -github.com/cosmos/cosmos-sdk v0.47.4 h1:FVUpEprm58nMmBX4xkRdMDaIG5Nr4yy92HZAfGAw9bg= -github.com/cosmos/cosmos-sdk v0.47.4/go.mod h1:R5n+uM7vguVPFap4pgkdvQCT1nVo/OtPwrlAU40rvok= +github.com/cosmos/cosmos-proto v1.0.0-beta.5 h1:eNcayDLpip+zVLRLYafhzLvQlSmyab+RC5W7ZfmxJLA= +github.com/cosmos/cosmos-proto v1.0.0-beta.5/go.mod h1:hQGLpiIUloJBMdQMMWb/4wRApmI9hjHH05nefC0Ojec= +github.com/cosmos/cosmos-sdk v0.47.11 h1:0Qx7eORw0RJqPv+mvDuU8NQ1LV3nJJKJnPoYblWHolc= +github.com/cosmos/cosmos-sdk v0.47.11/go.mod h1:ADjORYzUQqQv/FxDi0H0K5gW/rAk1CiDR3ZKsExfJV0= github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= @@ -288,21 +263,21 @@ github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiK github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ4GUkT+tbFI= github.com/cosmos/gogoproto v1.4.11 h1:LZcMHrx4FjUgrqQSWeaGC1v/TeuVFqSLa43CC6aWR2g= github.com/cosmos/gogoproto v1.4.11/go.mod h1:/g39Mh8m17X8Q/GDEs5zYTSNaNnInBSohtaxzQnYq1Y= -github.com/cosmos/iavl v0.20.0 h1:fTVznVlepH0KK8NyKq8w+U7c2L6jofa27aFX6YGlm38= -github.com/cosmos/iavl v0.20.0/go.mod h1:WO7FyvaZJoH65+HFOsDir7xU9FWk2w9cHXNW1XHcl7A= +github.com/cosmos/iavl v0.20.1 h1:rM1kqeG3/HBT85vsZdoSNsehciqUQPWrR4BYmqE2+zg= +github.com/cosmos/iavl v0.20.1/go.mod h1:WO7FyvaZJoH65+HFOsDir7xU9FWk2w9cHXNW1XHcl7A= github.com/cosmos/ibc-go/v7 v7.0.1 h1:NIBNRWjlOoFvFQu1ZlgwkaSeHO5avf4C1YQiWegt8jw= github.com/cosmos/ibc-go/v7 v7.0.1/go.mod h1:vEaapV6nuLPQlS+g8IKmxMo6auPi0i7HMv1PhViht/E= github.com/cosmos/ics23/go v0.9.1-0.20221207100636-b1abd8678aab h1:I9ialKTQo7248V827Bba4OuKPmk+FPzmTVHsLXaIJWw= github.com/cosmos/ics23/go v0.9.1-0.20221207100636-b1abd8678aab/go.mod h1:2CwqasX5dSD7Hbp/9b6lhK6BwoBDCBldx7gPKRukR60= -github.com/cosmos/ledger-cosmos-go v0.12.1 h1:sMBxza5p/rNK/06nBSNmsI/WDqI0pVJFVNihy1Y984w= -github.com/cosmos/ledger-cosmos-go v0.12.1/go.mod h1:dhO6kj+Y+AHIOgAe4L9HL/6NDdyyth4q238I9yFpD2g= +github.com/cosmos/ledger-cosmos-go v0.12.4 h1:drvWt+GJP7Aiw550yeb3ON/zsrgW0jgh5saFCr7pDnw= +github.com/cosmos/ledger-cosmos-go v0.12.4/go.mod h1:fjfVWRf++Xkygt9wzCsjEBdjcf7wiiY35fv3ctT+k4M= github.com/cosmos/rosetta-sdk-go v0.10.0 h1:E5RhTruuoA7KTIXUcMicL76cffyeoyvNybzUGSKFTcM= github.com/cosmos/rosetta-sdk-go v0.10.0/go.mod h1:SImAZkb96YbwvoRkzSMQB6noNJXFgWl/ENIznEoYQI4= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= -github.com/cpuguy83/go-md2man/v2 v2.0.3 h1:qMCsGGgs+MAzDFyp9LpAe1Lqy/fY/qCovCm0qnXZOBM= -github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/cpuguy83/go-md2man/v2 v2.0.4 h1:wfIWP927BUkWJb2NmU/kNDYIBTh/ziUX91+lVfRxZq4= +github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/crate-crypto/go-ipa v0.0.0-20231025140028-3c0104f4b233 h1:d28BXYi+wUpz1KBmiF9bWrjEMacUEREV6MBi2ODnrfQ= github.com/crate-crypto/go-ipa v0.0.0-20231025140028-3c0104f4b233/go.mod h1:geZJZH3SzKCqnz5VT0q/DyIG/tvu/dZk+VIfXicupJs= github.com/crate-crypto/go-kzg-4844 v0.7.0 h1:C0vgZRk4q4EZ/JgPfzuSoxdCq3C3mOZMBShovmncxvA= @@ -311,10 +286,6 @@ github.com/creachadair/taskgroup v0.4.2 h1:jsBLdAJE42asreGss2xZGZ8fJra7WtwnHWeJF github.com/creachadair/taskgroup v0.4.2/go.mod h1:qiXUOSrbwAY3u0JPGTzObbE3yf9hcXHDKBZ2ZjpCbgM= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/cucumber/common/gherkin/go/v22 v22.0.0 h1:4K8NqptbvdOrjL9DEea6HFjSpbdT9+Q5kgLpmmsHYl0= -github.com/cucumber/common/gherkin/go/v22 v22.0.0/go.mod h1:3mJT10B2GGn3MvVPd3FwR7m2u4tLhSRhWUqJU4KN4Fg= -github.com/cucumber/common/messages/go/v17 v17.1.1 h1:RNqopvIFyLWnKv0LfATh34SWBhXeoFTJnSrgm9cT/Ts= -github.com/cucumber/common/messages/go/v17 v17.1.1/go.mod h1:bpGxb57tDE385Rb2EohgUadLkAbhoC4IyCFi89u/JQI= github.com/daaku/go.zipexe v1.0.0/go.mod h1:z8IiR6TsVLEYKwXAoE/I+8ys/sDkgTzSL0CLnGVd57E= github.com/danieljoos/wincred v1.1.2 h1:QLdCxFs1/Yl4zduvBdcHB8goaYk9RARS2SgLLRuAyr0= github.com/danieljoos/wincred v1.1.2/go.mod h1:GijpziifJoIBfYh+S7BbkdUTU4LfM+QnGqR5Vl2tAx0= @@ -325,8 +296,8 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/deckarep/golang-set/v2 v2.3.0 h1:qs18EKUfHm2X9fA50Mr/M5hccg2tNnVqsiBImnyDs0g= -github.com/deckarep/golang-set/v2 v2.3.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4= +github.com/deckarep/golang-set/v2 v2.6.0 h1:XfcQbWM1LlMB8BsJ8N9vW5ehnnPVIw0je80NsVHagjM= +github.com/deckarep/golang-set/v2 v2.6.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4= github.com/decred/dcrd/crypto/blake256 v1.0.0/go.mod h1:sQl2p6Y26YV+ZOcSTP6thNdn47hh8kt6rqSlvmrXFAc= github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y= github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= @@ -339,7 +310,6 @@ github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f/go.mod h1:xH/i4TFM github.com/dfuse-io/logging v0.0.0-20201110202154-26697de88c79/go.mod h1:V+ED4kT/t/lKtH99JQmKIb0v9WL3VaYkJ36CfHlVECI= github.com/dfuse-io/logging v0.0.0-20210109005628-b97a57253f70 h1:CuJS05R9jmNlUK8GOxrEELPbfXm0EuGh/30LjkjN5vo= github.com/dfuse-io/logging v0.0.0-20210109005628-b97a57253f70/go.mod h1:EoK/8RFbMEteaCaz89uessDTnCWjbbcr+DXcBh4el5o= -github.com/dgraph-io/badger v1.6.0/go.mod h1:zwt7syl517jmP8s94KqSxTlM6IMsdhYy6psNgSztDR4= github.com/dgraph-io/badger/v2 v2.2007.4 h1:TRWBQg8UrlUhaFdco01nO2uXwzKS7zd+HVdwV/GHc4o= github.com/dgraph-io/badger/v2 v2.2007.4/go.mod h1:vSw/ax2qojzbN6eXHIx6KPKtCSHJN/Uz0X0VPruTIhk= github.com/dgraph-io/ristretto v0.0.3-0.20200630154024-f66de99634de/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70dGTu2u+Ahh6E= @@ -354,8 +324,8 @@ github.com/docker/distribution v2.8.2+incompatible h1:T3de5rq0dB1j30rp0sA2rER+m3 github.com/docker/distribution v2.8.2+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= github.com/docker/docker v24.0.7+incompatible h1:Wo6l37AuwP3JaMnZa226lzVXGA3F9Ig1seQen0cKYlM= github.com/docker/docker v24.0.7+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= -github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= -github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= +github.com/docker/go-connections v0.5.0 h1:USnMq7hx7gwdVZq1L49hLXaFtUdTADjXGp+uj1Br63c= +github.com/docker/go-connections v0.5.0/go.mod h1:ov60Kzw0kKElRwhNs9UlUHAE/F9Fe6GLaXnqyDdmEXc= github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/dominikbraun/graph v0.23.0 h1:TdZB4pPqCLFxYhdyMFb1TBdFxp8XLcJfTTBQucVPgCo= @@ -365,19 +335,15 @@ github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkp github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= github.com/dvsekhvalnov/jose2go v1.7.0 h1:bnQc8+GMnidJZA8zc6lLEAb4xNrIqHwO+9TzqvtQZPo= github.com/dvsekhvalnov/jose2go v1.7.0/go.mod h1:QsHjhyTlD/lAVqn/NSbVZmSCGeDehTB/mPZadG+mhXU= -github.com/eknkc/amber v0.0.0-20171010120322-cdade1c07385/go.mod h1:0vRUJqYpeSZifjYj7uP3BG/gKcuzL9xWVV/Y+cK33KM= github.com/emicklei/go-restful/v3 v3.11.0 h1:rAQeMHw1c7zTmncogyy8VvRZwtkmkZ4FxERmMY4rD+g= github.com/emicklei/go-restful/v3 v3.11.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= -github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/esote/minmaxheap v1.0.0 h1:rgA7StnXXpZG6qlM0S7pUmEv1KpWe32rYT4x8J8ntaA= github.com/esote/minmaxheap v1.0.0/go.mod h1:Ln8+i7fS1k3PLgZI2JAo0iA1as95QnIYiGCrqSJ5FZk= -github.com/etcd-io/bbolt v1.3.3/go.mod h1:ZF2nL25h33cCyBtcyWeZ2/I3HQOfTP+0PIEvHjkjCrw= github.com/ethereum/c-kzg-4844 v0.4.0 h1:3MS1s4JtA868KpJxroZoepdV0ZKBp3u/O5HcZ7R3nlY= github.com/ethereum/c-kzg-4844 v0.4.0/go.mod h1:VewdlzQmpT5QSrVhbBuGoCdFJkpaJlO1aQputP83wc0= github.com/ethereum/go-ethereum v1.13.8 h1:1od+thJel3tM52ZUNQwvpYOeRHlbkVFZ5S8fhi0Lgsg= @@ -388,13 +354,11 @@ github.com/facebookgo/stack v0.0.0-20160209184415-751773369052 h1:JWuenKqqX8nojt github.com/facebookgo/stack v0.0.0-20160209184415-751773369052/go.mod h1:UbMTZqLaRiH3MsBH8va0n7s1pQYcu3uTb8G4tygF4Zg= github.com/facebookgo/subset v0.0.0-20200203212716-c811ad88dec4 h1:7HZCaLC5+BZpmbhCOZJ293Lz68O7PYrF2EzeiFMwCLk= github.com/facebookgo/subset v0.0.0-20200203212716-c811ad88dec4/go.mod h1:5tD+neXqOorC30/tWg0LCSkrqj/AR6gu8yY8/fpw1q0= -github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072/go.mod h1:duJ4Jxv5lDcvg4QuQr0oowTf7dz4/CR8NtyCooz9HL8= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= -github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM= -github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE= -github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= +github.com/fatih/color v1.17.0 h1:GlRw1BRJxkpqUCBKzKOw098ed57fEsKeNjpTe3cSjK4= +github.com/fatih/color v1.17.0/go.mod h1:YZ7TlrGPkiz6ku9fK3TLD/pl3CpsiFyu8N92HLgmosI= github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5 h1:FtmdgXiUlNeRsoNMFlKLDt+S+6hbjVMEW6RGQ7aUf7c= @@ -406,12 +370,12 @@ github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7z github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= -github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= -github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= -github.com/fxamacker/cbor/v2 v2.6.0 h1:sU6J2usfADwWlYDAFhZBQ6TnLFBHxgesMrQfQgk1tWA= -github.com/fxamacker/cbor/v2 v2.6.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ= -github.com/gabriel-vasile/mimetype v1.4.2 h1:w5qFW6JKBz9Y393Y4q372O9A7cUSequkh1Q7OhCmWKU= -github.com/gabriel-vasile/mimetype v1.4.2/go.mod h1:zApsH/mKG4w07erKIaJPFiX0Tsq9BFQgN3qGY5GnNgA= +github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= +github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= +github.com/fxamacker/cbor/v2 v2.7.0 h1:iM5WgngdRBanHcxugY4JySA0nk1wZorNOpTgCMedv5E= +github.com/fxamacker/cbor/v2 v2.7.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ= +github.com/gabriel-vasile/mimetype v1.4.3 h1:in2uUcidCuFcDKtdcBxlR0rJ1+fsokWf+uqxgUFjbI0= +github.com/gabriel-vasile/mimetype v1.4.3/go.mod h1:d8uq/6HKRL6CGdk+aubisF/M5GcPfT7nKyLpA0lbSSk= github.com/gagliardetto/binary v0.7.7 h1:QZpT38+sgoPg+TIQjH94sLbl/vX+nlIRA37pEyOsjfY= github.com/gagliardetto/binary v0.7.7/go.mod h1:mUuay5LL8wFVnIlecHakSZMvcdqfs+CsotR5n77kyjM= github.com/gagliardetto/gofuzz v1.2.2 h1:XL/8qDMzcgvR4+CyRQW9UGdwPRPMHVJfqQ/uMvSUuQw= @@ -420,16 +384,14 @@ github.com/gagliardetto/solana-go v1.8.4 h1:vmD/JmTlonyXGy39bAo0inMhmbdAwV7rXZtL github.com/gagliardetto/solana-go v1.8.4/go.mod h1:i+7aAyNDTHG0jK8GZIBSI4OVvDqkt2Qx+LklYclRNG8= github.com/gagliardetto/treeout v0.1.4 h1:ozeYerrLCmCubo1TcIjFiOWTTGteOOHND1twdFpgwaw= github.com/gagliardetto/treeout v0.1.4/go.mod h1:loUefvXTrlRG5rYmJmExNryyBRh8f89VZhmMOyCyqok= -github.com/gavv/httpexpect v2.0.0+incompatible/go.mod h1:x+9tiU1YnrOvnB725RkpoLv1M62hOWzwo5OXotisrKc= github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08 h1:f6D9Hr8xV8uYKlyuj8XIruxlh9WjVjdh1gIicAS7ays= github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= github.com/gballet/go-verkle v0.1.1-0.20231031103413-a67434b50f46 h1:BAIP2GihuqhwdILrV+7GJel5lyPV3u1+PgzrWLc0TkE= github.com/gballet/go-verkle v0.1.1-0.20231031103413-a67434b50f46/go.mod h1:QNpY22eby74jVhqH4WhDLDwxc/vqsern6pW+u2kbkpc= github.com/gedex/inflector v0.0.0-20170307190818-16278e9db813 h1:Uc+IZ7gYqAf/rSGFplbWBSHaGolEQlNLgMgSE3ccnIQ= github.com/gedex/inflector v0.0.0-20170307190818-16278e9db813/go.mod h1:P+oSoE9yhSRvsmYyZsshflcR6ePWYLql6UU1amW13IM= -github.com/getsentry/sentry-go v0.12.0/go.mod h1:NSap0JBYWzHND8oMbyi0+XZhUalc1TBdRL1M71JZW2c= -github.com/getsentry/sentry-go v0.19.0 h1:BcCH3CN5tXt5aML+gwmbFwVptLLQA+eT866fCO9wVOM= -github.com/getsentry/sentry-go v0.19.0/go.mod h1:y3+lGEFEFexZtpbG1GUE2WD/f9zGyKYwpEqryTOC/nE= +github.com/getsentry/sentry-go v0.23.0 h1:dn+QRCeJv4pPt9OjVXiMcGIBIefaTJPw/h0bZWO05nE= +github.com/getsentry/sentry-go v0.23.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gin-contrib/cors v1.5.0 h1:DgGKV7DDoOn36DFkNtbHrjoRiT5ExCe+PC9/xp7aKvk= github.com/gin-contrib/cors v1.5.0/go.mod h1:TvU7MAZ3EwrPLI2ztzTt3tqgvBCq+wn8WpZmfADjupI= @@ -454,8 +416,6 @@ github.com/gkampitakis/go-snaps v0.5.4 h1:GX+dkKmVsRenz7SoTbdIEL4KQARZctkMiZ8ZKp github.com/gkampitakis/go-snaps v0.5.4/go.mod h1:ZABkO14uCuVxBHAXAfKG+bqNz+aa1bGPAg8jkI0Nk8Y= github.com/go-asn1-ber/asn1-ber v1.5.5 h1:MNHlNMBDgEKD4TcKr36vQN68BA00aDfjIt3/bD50WnA= github.com/go-asn1-ber/asn1-ber v1.5.5/go.mod h1:hEBeB/ic+5LoWskz+yKT7vGhhPYkProFKoKdwZRWMe0= -github.com/go-check/check v0.0.0-20180628173108-788fd7840127/go.mod h1:9ES+weclKsC9YodN5RgxqK/VD9HM9JsCSh7rNhMZE98= -github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= @@ -478,11 +438,11 @@ github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG github.com/go-logfmt/logfmt v0.6.0 h1:wGYYu3uicYdqXVgoYbvnkrPVXkuLM1p1ifugDMEdRi4= github.com/go-logfmt/logfmt v0.6.0/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= -github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= +github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= -github.com/go-martini/martini v0.0.0-20170121215854-22fa46961aab/go.mod h1:/P9AEU963A2AYjv4d1V5eVL1CQbEJq6aCNHDDjibzu8= github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs= @@ -503,21 +463,20 @@ github.com/go-playground/universal-translator v0.18.0/go.mod h1:UvRDBj+xPUEGrFYl github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= github.com/go-playground/validator/v10 v10.10.0/go.mod h1:74x4gJWsvQexRdW8Pn3dXSGrTK4nAUsbPlLADvpJkos= -github.com/go-playground/validator/v10 v10.15.5 h1:LEBecTWb/1j5TNY1YYG2RcOUN3R7NLylN+x8TTueE24= -github.com/go-playground/validator/v10 v10.15.5/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU= +github.com/go-playground/validator/v10 v10.22.0 h1:k6HsTZ0sTnROkhS//R0O+55JgM8C4Bx7ia+JlgcnOao= +github.com/go-playground/validator/v10 v10.22.0/go.mod h1:dbuPbCMFw/DrkbEynArYaCwl3amGuJotoKCe95atGMM= github.com/go-sql-driver/mysql v1.8.1 h1:LedoTUt/eveggdHS9qUFC1EFSa8bU2+1pZjSRpvNJ1Y= github.com/go-sql-driver/mysql v1.8.1/go.mod h1:wEBSXgmK//2ZFJyE+qWnIsVGmvmEKlqwuVSjsCm7DZg= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls= +github.com/go-viper/mapstructure/v2 v2.1.0 h1:gHnMa2Y/pIxElCH2GlZZ1lZSsn6XMtufpGyP1XxdC/w= +github.com/go-viper/mapstructure/v2 v2.1.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= github.com/go-webauthn/webauthn v0.9.4 h1:YxvHSqgUyc5AK2pZbqkWWR55qKeDPhP8zLDr6lpIc2g= github.com/go-webauthn/webauthn v0.9.4/go.mod h1:LqupCtzSef38FcxzaklmOn7AykGKhAhr9xlRbdbgnTw= github.com/go-webauthn/x v0.1.5 h1:V2TCzDU2TGLd0kSZOXdrqDVV5JB9ILnKxA9S53CSBw0= github.com/go-webauthn/x v0.1.5/go.mod h1:qbzWwcFcv4rTwtCLOZd+icnr6B7oSsAGZJqlt8cukqY= -github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo= -github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= -github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM= github.com/goccy/go-json v0.9.7/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU= github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= @@ -528,19 +487,15 @@ github.com/gofrs/flock v0.8.1/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14j github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gofrs/uuid v4.3.1+incompatible h1:0/KbAdpx3UXAx1kEOWHJeOkpbgRFGHVgv+CFIY7dBJI= github.com/gofrs/uuid v4.3.1+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= -github.com/gogo/googleapis v0.0.0-20180223154316-0cd9801be74a/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= github.com/gogo/googleapis v1.4.1 h1:1Yx4Myt7BxzvUr5ldGSbwYiZG6t9wGBZ+8/fX3Wvtq0= github.com/gogo/googleapis v1.4.1/go.mod h1:2lpHqI5OcWCtVElxXnPt+s8oJvMpySlOyM6xDCrzib4= -github.com/gogo/status v1.1.0/go.mod h1:BFv9nrluPLmrS0EmGVvLaPNmRosr9KapBYd5/hpY1WM= -github.com/golang-jwt/jwt v3.2.2+incompatible h1:IfV12K8xAKAnZqdXVzCZ+TOjboZ2keLg81eXfW3O+oY= -github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg= github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= github.com/golang-jwt/jwt/v5 v5.2.0 h1:d/ix8ftRUorsN+5eMIlF4T6J8CAt9rch3My2winC1Jw= github.com/golang-jwt/jwt/v5 v5.2.0/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/glog v1.2.0 h1:uCdmnmatrKCgMBlM4rMuJZWOkPDqdbZPnrMXDY4gI68= -github.com/golang/glog v1.2.0/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w= +github.com/golang/glog v1.2.1 h1:OptwRhECazUx5ix5TTWC3EZhsZEHWcYWY4FQHTIubm4= +github.com/golang/glog v1.2.1/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w= github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -551,9 +506,7 @@ github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfb github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -561,7 +514,6 @@ github.com/golang/protobuf v1.3.0/go.mod h1:Qd/q+1AKNOZr9uGQzbzCmRO6sUih6GTPZv6a github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= @@ -581,7 +533,6 @@ github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEW github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb h1:PBC98N2aIaM3XXiurYmW7fx4GZkL8feAMVq7nEjURHk= github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/gomodule/redigo v1.7.1-0.20190724094224-574c33c3df38/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.1.2 h1:xf4v41cLI2Z6FxbKm+8Bu+m8ifhj15JuZ9sa0jZCMUU= @@ -592,18 +543,15 @@ github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5a github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= github.com/google/go-tpm v0.9.0 h1:sQF6YqWMi+SCXpsmS3fd21oPy/vSddwZry4JnmltHVk= github.com/google/go-tpm v0.9.0/go.mod h1:FkNVkc6C+IsvDI9Jw1OveJmxGZUUaKxtrpOS47QWKfU= github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= @@ -611,8 +559,6 @@ github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/ github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= -github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= -github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/orderedcode v0.0.1 h1:UzfcAexk9Vhv8+9pNOgRu41f16lHq725vPwnSeiG/Us= github.com/google/orderedcode v0.0.1/go.mod h1:iVyU4/qPKHY5h/wSd6rZZCDcLJNxiWO6dvsYES2Sb20= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= @@ -620,20 +566,14 @@ github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OI github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20231023181126-ff6d637d2a7b h1:RMpPgZTSApbPf7xaVel+QkoGPRLFLrwFO89uDUHEGf0= -github.com/google/pprof v0.0.0-20231023181126-ff6d637d2a7b/go.mod h1:czg5+yv1E0ZGTi6S6vVK1mke0fV+FaUhNGcd6VRS9Ik= +github.com/google/pprof v0.0.0-20240424215950-a892ee059fd6 h1:k7nVchz72niMH6YLQNvHSdIE7iqsQxK1P41mySCvssg= +github.com/google/pprof v0.0.0-20240424215950-a892ee059fd6/go.mod h1:kf6iHlnVGwgKolg33glAes7Yg/8iWP8ukqeldJSO7jw= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/s2a-go v0.1.7 h1:60BLSyTrOV4/haCDW4zb1guZItoSq8foHCXrAnjBo/o= github.com/google/s2a-go v0.1.7/go.mod h1:50CgR4k1jNlWBu4UfS4AcfhVe1r6pdZPygJ3R8F0Qdw= github.com/google/subcommands v1.2.0/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -641,9 +581,8 @@ github.com/googleapis/enterprise-certificate-proxy v0.3.2 h1:Vie5ybvEvT75RniqhfF github.com/googleapis/enterprise-certificate-proxy v0.3.2/go.mod h1:VLSiSSBs/ksPL8kq3OBOQ6WRI2QnaFynd1DCjZ62+V0= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/googleapis/gax-go/v2 v2.12.2 h1:mhN09QQW1jEWeMF74zGR81R30z4VJzjZsfkUhuHF+DA= -github.com/googleapis/gax-go/v2 v2.12.2/go.mod h1:61M8vcyyXR2kqKFxKrfA22jaA8JGF7Dc8App1U3H6jc= -github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= +github.com/googleapis/gax-go/v2 v2.12.0 h1:A+gCJKdRfqXkr+BIRGtZLibNXf0m1f9E4HG56etFpas= +github.com/googleapis/gax-go/v2 v2.12.0/go.mod h1:y+aIqrI5eb1YGMVJfuV3185Ts/D7qKpsEkdD5+I6QGU= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/context v1.1.1 h1:AWwleXJkX/nhcU9bZSnZoi3h/qGYqQAGhq6zZe/aQW8= github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= @@ -656,18 +595,17 @@ github.com/gorilla/securecookie v1.1.2 h1:YCIWL56dvtr73r6715mJs5ZvhtnY73hBvEF8kX github.com/gorilla/securecookie v1.1.2/go.mod h1:NfCASbcHqRSY+3a8tlWJwsQap2VX5pwzwo4h3eOamfo= github.com/gorilla/sessions v1.2.2 h1:lqzMYz6bOfvn2WriPUjNByzeXIlVzURcPmgMczkmTjY= github.com/gorilla/sessions v1.2.2/go.mod h1:ePLdVu+jbEgHH+KWw8I1z2wqd0BAdAQh/8LRvBeoNcQ= -github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY= github.com/gorilla/websocket v1.5.1/go.mod h1:x3kM2JMyaluk02fnUJpQuwD2dCS5NDG2ZHL0uE0tcaY= github.com/grafana/pyroscope-go v1.1.1 h1:PQoUU9oWtO3ve/fgIiklYuGilvsm8qaGhlY4Vw6MAcQ= github.com/grafana/pyroscope-go v1.1.1/go.mod h1:Mw26jU7jsL/KStNSGGuuVYdUq7Qghem5P8aXYXSXG88= -github.com/grafana/pyroscope-go/godeltaprof v0.1.6 h1:nEdZ8louGAplSvIJi1HVp7kWvFvdiiYg3COLlTwJiFo= -github.com/grafana/pyroscope-go/godeltaprof v0.1.6/go.mod h1:Tk376Nbldo4Cha9RgiU7ik8WKFkNpfds98aUzS8omLE= +github.com/grafana/pyroscope-go/godeltaprof v0.1.8 h1:iwOtYXeeVSAeYefJNaxDytgjKtUuKQbJqgAIjlnicKg= +github.com/grafana/pyroscope-go/godeltaprof v0.1.8/go.mod h1:2+l7K7twW49Ct4wFluZD3tZ6e0SjanjcUUBPVD/UuGU= github.com/graph-gophers/dataloader v5.0.0+incompatible h1:R+yjsbrNq1Mo3aPG+Z/EKYrXrXXUNJHOgbRt+U6jOug= github.com/graph-gophers/dataloader v5.0.0+incompatible/go.mod h1:jk4jk0c5ZISbKaMe8WsVopGB5/15GvGHMdMdPtwlRp4= -github.com/graph-gophers/graphql-go v1.3.0 h1:Eb9x/q6MFpCLz7jBCiP/WTxjSDrYLR1QY41SORZyNJ0= -github.com/graph-gophers/graphql-go v1.3.0/go.mod h1:9CQHMSxwO4MprSdzoIEobiHpoLtHm77vfxsvsIN5Vuc= +github.com/graph-gophers/graphql-go v1.5.0 h1:fDqblo50TEpD0LY7RXk/LFVYEVqo3+tXMNMPSVXA1yc= +github.com/graph-gophers/graphql-go v1.5.0/go.mod h1:YtmJZDLbF1YYNrlNAuiO5zAStUWc3XZT07iGsVqe1Os= github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 h1:+9834+KizmvFV7pXQGSXQTsaWhq2GjuNUt0aUU0YBYw= github.com/grpc-ecosystem/go-grpc-middleware v1.3.0/go.mod h1:z0ButlSOZa5vEBq9m2m2hlwIgKw+rp3sdCBRoJY+30Y= @@ -679,8 +617,8 @@ github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgf github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 h1:bkypFPDjIYGfCYD5mRBvpqxfYX1YCS1PXdKYWi8FsN0= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0/go.mod h1:P+Lt/0by1T8bfcF3z737NnSbmxQAppXMRziHUxPOC8k= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0 h1:asbCHRVmodnJTuQ3qamDwqVOIjwqUPTYmYuemVOx+Ys= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0/go.mod h1:ggCgvZ2r7uOoQjOyu2Y1NhHmEPPzzuhWgcza5M1Ji1I= github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c h1:6rhixN/i8ZofjG1Y75iExal34USq5p+wiN1tpie8IrU= github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c/go.mod h1:NMPJylDgVpX0MLRlPy15sqSwOFv/U1GZ2m21JhFfek0= github.com/gtank/merlin v0.1.1-0.20191105220539-8318aed1a79f/go.mod h1:T86dnYJhcGOh5BjZFCJWTDeTK7XW8uE+E21Cy/bIQ+s= @@ -711,6 +649,8 @@ github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJ github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= +github.com/hashicorp/go-plugin v1.6.2-0.20240829161738-06afb6d7ae99 h1:OSQYEsRT3tRttZkk6zyC3aAaliwd7Loi/KgXgXxGtwA= +github.com/hashicorp/go-plugin v1.6.2-0.20240829161738-06afb6d7ae99/go.mod h1:CkgLQ5CZqNmdL9U9JzM532t8ZiYQ35+pj3b1FD37R0Q= github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= github.com/hashicorp/go-retryablehttp v0.7.5 h1:bJj+Pj19UZMIweq/iie+1u5YCdGrnxCT9yvm0e+Nd5M= github.com/hashicorp/go-retryablehttp v0.7.5/go.mod h1:Jy/gPYAdjqffZ/yFGCFV2doI5wjtH1ewM9u8iYVjtX8= @@ -723,7 +663,6 @@ github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/b github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8= github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek= github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= @@ -757,12 +696,10 @@ github.com/huandu/skiplist v1.2.0 h1:gox56QD77HzSC0w+Ws3MH3iie755GBJU1OER3h5VsYw github.com/huandu/skiplist v1.2.0/go.mod h1:7v3iFjLcSAzO4fN5B8dvebvo/qsfumiLiDXMrPiHF9w= github.com/huin/goupnp v1.3.0 h1:UvLUlWDNpoUdYzb2TCn+MuTWtcjXKSza2n6CBdQ0xXc= github.com/huin/goupnp v1.3.0/go.mod h1:gnGPsThkYa7bFi/KWmEysQRf48l2dvR5bxr2OFckNX8= -github.com/hydrogen18/memlistener v0.0.0-20200120041712-dcc25e7acd91/go.mod h1:qEIFzExnS6016fRpRfxrExeVn2gbClQA99gQhnIcdhE= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/imdario/mergo v0.3.16 h1:wwQJbIsHYGMUyLSPrEq1CT16AhnhNJQ51+4fdHUnCl4= github.com/imdario/mergo v0.3.16/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+hD27ysY= -github.com/imkira/go-interpol v1.1.0/go.mod h1:z0h2/2T3XF8kyEPpRgJ3kmNv+C43p+I/CoI+jC3w2iA= github.com/improbable-eng/grpc-web v0.15.0 h1:BN+7z6uNXZ1tQGcNAuaU1YjsLTApzkjt2tzCixLaUPQ= github.com/improbable-eng/grpc-web v0.15.0/go.mod h1:1sy9HKV4Jt9aEs9JSnkWlRJPuPtwNr0l57L4f878wP8= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= @@ -770,11 +707,6 @@ github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2 github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/invopop/jsonschema v0.12.0 h1:6ovsNSuvn9wEQVOyc72aycBMVQFKz7cPdMJn10CvzRI= github.com/invopop/jsonschema v0.12.0/go.mod h1:ffZ5Km5SWWRAIN6wbDXItl95euhFz2uON45H2qjYt+0= -github.com/iris-contrib/blackfriday v2.0.0+incompatible/go.mod h1:UzZ2bDEoaSGPbkg6SAB4att1aAwTmVIx/5gCVqeyUdI= -github.com/iris-contrib/go.uuid v2.0.0+incompatible/go.mod h1:iz2lgM/1UnEf1kP0L/+fafWORmlnuysV2EMP8MW+qe0= -github.com/iris-contrib/jade v1.1.3/go.mod h1:H/geBymxJhShH5kecoiOCSssPX7QWYH7UaeZTSWddIk= -github.com/iris-contrib/pongo2 v0.0.1/go.mod h1:Ssh+00+3GAZqSQb30AvBRNxBx7rf0GqwkjqxNd0u65g= -github.com/iris-contrib/schema v0.0.1/go.mod h1:urYA3uvUNG1TIIjOSCzHr9/LmbQo8LrOcOqfqxa4hXw= github.com/jackc/chunkreader v1.0.0/go.mod h1:RT6O25fNZIuasFJRyZ4R/Y2BbhasbmZXF9QQ7T3kePo= github.com/jackc/chunkreader/v2 v2.0.0/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk= github.com/jackc/chunkreader/v2 v2.0.1 h1:i+RDz65UE+mmpjTfyz0MoVTnzeYxroil2G82ki7MGG8= @@ -835,8 +767,8 @@ github.com/jmhodges/levigo v1.0.0 h1:q5EC36kV79HWeTBWsod3mG11EgStG3qArTKcvlksN1U github.com/jmhodges/levigo v1.0.0/go.mod h1:Q6Qx+uH3RAqyK4rFQroq9RL7mdkABMcfhEI+nNuzMJQ= github.com/jmoiron/sqlx v1.4.0 h1:1PLqN7S1UYp5t4SrVVnt4nUVNemrDAtxlulVe+Qgm3o= github.com/jmoiron/sqlx v1.4.0/go.mod h1:ZrZ7UsYB/weZdl2Bxg6jCRO9c3YHl8r3ahlKmRT4JLY= -github.com/joho/godotenv v1.4.0 h1:3l4+N6zfMWnkbPEXKng2o2/MR5mSwTrBih4ZEkkz1lg= -github.com/joho/godotenv v1.4.0/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= +github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0= +github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/jonboulle/clockwork v0.4.0 h1:p4Cf1aMWXnXAUh8lVfewRBx1zaTSYKrKMF2g3ST4RZ4= github.com/jonboulle/clockwork v0.4.0/go.mod h1:xgRqUGwRcjKCO1vbZUEtSLrqKoPSsUpK7fnezOII0kc= @@ -853,30 +785,20 @@ github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1 github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= -github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88/go.mod h1:3w7q1U84EfirKl04SVQ/s7nPm1ZPhiXd34z40TNz36k= -github.com/kataras/golog v0.0.10/go.mod h1:yJ8YKCmyL+nWjERB90Qwn+bdyBZsaQwU3bTVFgkFIp8= -github.com/kataras/iris/v12 v12.1.8/go.mod h1:LMYy4VlP67TQ3Zgriz8RE2h2kMZV2SgMYbq3UhfoFmE= -github.com/kataras/neffos v0.0.14/go.mod h1:8lqADm8PnbeFfL7CLXh1WHw53dG27MC3pgi2R1rmoTE= -github.com/kataras/pio v0.0.2/go.mod h1:hAoW0t9UmXi4R5Oyq5Z4irTbaTsOemSrDGUtaTl7Dro= -github.com/kataras/sitemap v0.0.5/go.mod h1:KY2eugMKiPwsJgx7+U103YZehfvNGOXURubcGyk0Bz8= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4= -github.com/klauspost/compress v1.8.2/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= -github.com/klauspost/compress v1.9.7/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/klauspost/compress v1.11.4/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= -github.com/klauspost/compress v1.17.3 h1:qkRjuerhUU1EmXLYGkSH6EZL+vPSxIrYjLNAK4slzwA= -github.com/klauspost/compress v1.17.3/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= -github.com/klauspost/cpuid v1.2.1/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= +github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA= +github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/klauspost/cpuid/v2 v2.2.5 h1:0E5MSMDEoAulmXNFquVs//DdoomxaoTY1kUhbc/qbZg= github.com/klauspost/cpuid/v2 v2.2.5/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= github.com/knz/go-libedit v1.10.1/go.mod h1:MZTVkCWyz0oBc7JOWP3wNAzd002ZbM/5hgShxwh4x8M= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= @@ -890,13 +812,11 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/labstack/echo/v4 v4.5.0/go.mod h1:czIriw4a0C1dFun+ObrXp7ok03xON0N1awStJ6ArI7Y= -github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL7NoOu+k= github.com/leanovate/gopter v0.2.10-0.20210127095200-9abe2343507a h1:dHCfT5W7gghzPtfsW488uPmEOm85wewI+ypUwibyTdU= github.com/leanovate/gopter v0.2.10-0.20210127095200-9abe2343507a/go.mod h1:U2L/78B+KVFIx2VmW6onHJQzXtFb+p5y3y2Sh+Jxxv8= github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= -github.com/leodido/go-urn v1.2.4 h1:XlAE/cm/ms7TE/VMVoduSpNBoyc2dOxHs5MZSwAN63Q= -github.com/leodido/go-urn v1.2.4/go.mod h1:7ZrI8mTSeBSHl/UaRyKQW1qZeMgak41ANeCNaVckg+4= +github.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ= +github.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI= github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.1.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= @@ -922,12 +842,9 @@ github.com/maruel/natural v1.1.1 h1:Hja7XhhmvEFhcByqDoHz9QZbkWey+COd9xWfCfn1ioo= github.com/maruel/natural v1.1.1/go.mod h1:v+Rfd79xlw1AgVBjbO0BEQmptqb5HvL/k9GRHB7ZKEg= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= -github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-colorable v0.1.11/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= @@ -935,7 +852,6 @@ github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNx github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= @@ -948,14 +864,9 @@ github.com/mattn/go-runewidth v0.0.14/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh github.com/mattn/go-sqlite3 v1.14.22/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y= github.com/mattn/go-sqlite3 v2.0.3+incompatible h1:gXHsfypPkaMZrKbD5209QV9jbUTJKjyR5WD3HYQSd+U= github.com/mattn/go-sqlite3 v2.0.3+incompatible/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= -github.com/mattn/goveralls v0.0.2/go.mod h1:8d1ZMHsd7fW6IRPKQh46F2WRpyib5/X4FOpevwGNQEw= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 h1:jWpvCLoY8Z/e3VKvlsiIGKtc+UG6U5vzxaoagmhXfyg= -github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0/go.mod h1:QUyp042oQthUoa9bqDv0ER0wrtXnBruoNd7aNjkbP+k= -github.com/mediocregopher/radix/v3 v3.4.2/go.mod h1:8FL3F6UQRXHXIBSPUs5h0RybMF8i4n7wVopoX3x7Bv8= github.com/mfridman/interpolate v0.0.2 h1:pnuTK7MQIxxFz1Gr+rjSIx9u7qVjf5VOoM/u6BbAxPY= github.com/mfridman/interpolate v0.0.2/go.mod h1:p+7uk6oE07mpE/Ik1b8EckO0O4ZXiGAfshKBWLUM9Xg= -github.com/microcosm-cc/bluemonday v1.0.2/go.mod h1:iVP4YcDBq+n/5fb23BhYFvIMq/leAFZyRl6bYmGDlGc= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/mimoo/StrobeGo v0.0.0-20181016162300-f8f6d4d2b643/go.mod h1:43+3pMjjKimDBf5Kr4ZFNGbLql1zKkbImw+fZbw3geM= github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 h1:QRUSJEgZn2Snx0EmT/QLXibWjSUDjKWvXIT19NBVp94= @@ -996,7 +907,6 @@ github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A= github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= github.com/mostynb/zstdpool-freelist v0.0.0-20201229113212-927304c0c3b1 h1:mPMvm6X6tf4w8y7j9YIt6V9jfWhL6QlbEc7CCmeQlWk= github.com/mostynb/zstdpool-freelist v0.0.0-20201229113212-927304c0c3b1/go.mod h1:ye2e/VUEtE2BHE+G/QcKkcLQVAEJoYRFj5VUOQatCRE= -github.com/moul/http2curl v1.0.0/go.mod h1:8UbvGypXm98wA/IqH45anm5Y2Z6ep6O31QGOAZ3H0fQ= github.com/mr-tron/base58 v1.2.0 h1:T/HDJBh4ZCPbU39/+c3rRvE0uKBQlU27+QI8LJ4t64o= github.com/mr-tron/base58 v1.2.0/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= github.com/mtibben/percent v0.2.1 h1:5gssi8Nqo8QU/r2pynCm+hBQHpkB/uNK7BJCFogWdzs= @@ -1004,10 +914,6 @@ github.com/mtibben/percent v0.2.1/go.mod h1:KG9uO+SZkUp+VkRHsCdYQV3XSZrrSpR3O9ib github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5VglpSg= -github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzEE/Zbp4w= -github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= -github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= github.com/ncruces/go-strftime v0.1.9 h1:bY0MQC28UADQmHmaF5dgpLmImcShSi2kHU9XLdhx/f4= github.com/ncruces/go-strftime v0.1.9/go.mod h1:Fwc5htZGVVkseilnfgOVb9mKy6w1naJmn9CehxcKcls= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= @@ -1024,7 +930,6 @@ github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= @@ -1039,8 +944,8 @@ github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7J github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= -github.com/onsi/gomega v1.31.0 h1:54UJxxj6cPInHS3a35wm6BK/F9nHYueZ1NVujHDrnXE= -github.com/onsi/gomega v1.31.0/go.mod h1:DW9aCi7U6Yi40wNVAvT6kzFnEVEI5n3DloYBiKiT6zk= +github.com/onsi/gomega v1.33.1 h1:dsYjIxxSR755MDmKVsaFQTE22ChNBcuuTWgkUDSubOk= +github.com/onsi/gomega v1.33.1/go.mod h1:U4R44UsT+9eLIaYRB2a5qajjtQYn0hauxvRm16AVYg0= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= github.com/opencontainers/image-spec v1.1.0-rc5 h1:Ygwkfw9bpDvs+c9E34SdgGOj41dX/cbdlwvlWt0pnFI= @@ -1061,8 +966,8 @@ github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/9 github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8= github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= github.com/pelletier/go-toml/v2 v2.0.1/go.mod h1:r9LEWfGN8R5k0VXJ+0BkIe7MYkRdwZOjgMj2KwnJFUo= -github.com/pelletier/go-toml/v2 v2.2.0 h1:QLgLl2yMN7N+ruc31VynXs1vhMZa7CeHHejIeBAsoHo= -github.com/pelletier/go-toml/v2 v2.2.0/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs= +github.com/pelletier/go-toml/v2 v2.2.2 h1:aYUidT7k73Pcl9nb2gScu7NSrKCSHIDE89b3+6Wq+LM= +github.com/pelletier/go-toml/v2 v2.2.2/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs= github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08 h1:hDSdbBuw3Lefr6R18ax0tZ2BJeNB3NehB3trOwYBsdU= github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= @@ -1073,7 +978,6 @@ github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= @@ -1086,26 +990,26 @@ github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXP github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= -github.com/prometheus/client_golang v1.17.0 h1:rl2sfwZMtSthVU752MqfjQozy7blglC+1SOtjMAMh+Q= -github.com/prometheus/client_golang v1.17.0/go.mod h1:VeL+gMmOAxkS2IqfCq0ZmHSL+LjWfWDUmp1mBz9JgUY= +github.com/prometheus/client_golang v1.20.0 h1:jBzTZ7B099Rg24tny+qngoynol8LtVYlA2bqx3vEloI= +github.com/prometheus/client_golang v1.20.0/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.5.0 h1:VQw1hfvPvk3Uv6Qf29VrPF32JB6rtbgI6cYPYQjL0Qw= -github.com/prometheus/client_model v0.5.0/go.mod h1:dTiFglRmd66nLR9Pv9f0mZi7B7fk5Pm3gvsjB5tr+kI= +github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= +github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= -github.com/prometheus/common v0.45.0 h1:2BGz0eBc2hdMDLnO/8n0jeB3oPrt2D08CekT0lneoxM= -github.com/prometheus/common v0.45.0/go.mod h1:YJmSTw9BoKxJplESWWxlbyttQR4uaEcGyv9MZjVOJsY= +github.com/prometheus/common v0.59.1 h1:LXb1quJHWm1P6wq/U824uxYi4Sg0oGvNeUm1z5dJoX0= +github.com/prometheus/common v0.59.1/go.mod h1:GpWM7dewqmVYcd7SmRaiWVe9SSqjf0UrwnYnpEZNuT0= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= -github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= -github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= +github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= +github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/prometheus/prometheus v0.48.1 h1:CTszphSNTXkuCG6O0IfpKdHcJkvvnAAE1GbELKS+NFk= github.com/prometheus/prometheus v0.48.1/go.mod h1:SRw624aMAxTfryAcP8rOjg4S/sHHaetx2lyJJ2nM83g= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= @@ -1113,8 +1017,6 @@ github.com/rakyll/statik v0.1.7 h1:OF3QCZUuyPxuGEP7B4ypUa7sB/iHtqOTDYZXGM8KOdQ= github.com/rakyll/statik v0.1.7/go.mod h1:AlZONWzMtEnMs7W4e/1LURLiI49pIMmp6V9Unghqrcc= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= -github.com/regen-network/gocuke v0.6.2 h1:pHviZ0kKAq2U2hN2q3smKNxct6hS0mGByFMHGnWA97M= -github.com/regen-network/gocuke v0.6.2/go.mod h1:zYaqIHZobHyd0xOrHGPQjbhGJsuZ1oElx150u2o1xuk= github.com/regen-network/protobuf v1.3.3-alpha.regen.1 h1:OHEc+q5iIAXpqiqFKeLpu5NwTIkVXUs48vFMwzqpqY4= github.com/regen-network/protobuf v1.3.3-alpha.regen.1/go.mod h1:2DjTFR1HhMQhiWC5sZ4OhQ3+NtdbZ6oBDKQwq5Ou+FI= github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE= @@ -1129,7 +1031,6 @@ github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6L github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= -github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= @@ -1138,24 +1039,25 @@ github.com/rs/cors v1.8.3/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= github.com/rs/zerolog v1.13.0/go.mod h1:YbFCdg8HfsridGWAh22vktObvhZbQsZXe4/zB0OKkWU= github.com/rs/zerolog v1.15.0/go.mod h1:xYTKnLHcpfU2225ny5qZjxnj9NvkumZYjJHlAThCjNc= -github.com/rs/zerolog v1.30.0 h1:SymVODrcRsaRaSInD9yQtKbtWqwsfoPcRff/oRXLj4c= -github.com/rs/zerolog v1.30.0/go.mod h1:/tk+P47gFdPXq4QYjvCmT5/Gsug2nagsFWBWhAiSi1w= +github.com/rs/zerolog v1.32.0 h1:keLypqrlIjaFsbmJOBdB/qvyF8KEtCWHwobLp5l/mQ0= +github.com/rs/zerolog v1.32.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= -github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= +github.com/sagikazarmark/locafero v0.4.0 h1:HApY1R9zGo4DBgr7dqsTH/JJxLTTsOt7u6keLGt6kNQ= +github.com/sagikazarmark/locafero v0.4.0/go.mod h1:Pe1W6UlPYUk/+wc/6KFhbORCfqzgYEpgQ3O5fPuL3H4= +github.com/sagikazarmark/slog-shim v0.1.0 h1:diDBnUNK9N/354PgrxMywXnAwEr1QZcOr6gto+ugjYE= +github.com/sagikazarmark/slog-shim v0.1.0/go.mod h1:SrcSrq8aKtyuqEI1uvTDTK1arOWRIczQRv+GVI1AkeQ= github.com/santhosh-tekuri/jsonschema/v5 v5.3.1 h1:lZUw3E0/J3roVtGQ+SCrUrg3ON6NgVqpn3+iol9aGu4= github.com/santhosh-tekuri/jsonschema/v5 v5.3.1/go.mod h1:uToXkOrWAZ6/Oc07xWQrPOhJotwFIyu2bBVN41fcDUY= github.com/sasha-s/go-deadlock v0.3.1 h1:sqv7fDNShgjcaxkO0JNcOAlr8B9+cV5Ey/OB71efZx0= github.com/sasha-s/go-deadlock v0.3.1/go.mod h1:F73l+cr82YSh10GxyRI6qZiCgK64VaZjwesgfQ1/iLM= github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= -github.com/schollz/closestmatch v2.1.0+incompatible/go.mod h1:RtP1ddjLong6gTkbtmuhtR2uUrrJOpYzYRvbcPAid+g= github.com/scylladb/go-reflectx v1.0.1 h1:b917wZM7189pZdlND9PbIJ6NQxfDPfBvUaQ7cjj1iZQ= github.com/scylladb/go-reflectx v1.0.1/go.mod h1:rWnOfDIRWBGN0miMLIcoPt/Dhi2doCMZqwMCJ3KupFc= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= -github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/sethvargo/go-retry v0.2.4 h1:T+jHEQy/zKJf5s95UkguisicE0zuF9y7+/vgz08Ocec= github.com/sethvargo/go-retry v0.2.4/go.mod h1:1afjQuvh7s4gflMObvjLPaWgluLLyhA1wmVZ6KLpICw= github.com/shirou/gopsutil v3.21.11+incompatible h1:+1+c1VGhc88SSonWP6foOcLhvnKlUeu/erjjvaPEYiI= @@ -1166,69 +1068,70 @@ github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg github.com/shoenig/test v0.6.4/go.mod h1:byHiCGXqrVaflBLAMq/srcZIHynQPQgeyvkvXnjqq0k= github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4= github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= -github.com/shopspring/decimal v1.3.1 h1:2Usl1nmF/WZucqkFZhnfFYxxxu8LG21F6nPQBE5gKV8= github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= +github.com/shopspring/decimal v1.4.0 h1:bxl37RwXBklmTi0C79JfXCEBD1cqqHt0bbgBAGFp81k= +github.com/shopspring/decimal v1.4.0/go.mod h1:gawqmDU56v4yIKSwfBSFip1HdCCXN8/+DMd9qYNcwME= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= -github.com/smartcontractkit/chain-selectors v1.0.10 h1:t9kJeE6B6G+hKD0GYR4kGJSCqR1LNS7aI3jT0V+xGrg= -github.com/smartcontractkit/chain-selectors v1.0.10/go.mod h1:d4Hi+E1zqjy9HqMkjBE5q1vcG9VGgxf5VxiRHfzi2kE= +github.com/smartcontractkit/chain-selectors v1.0.23 h1:D2Eaex4Cw/O7Lg3tX6WklOqnjjIQAEBnutCtksPzVDY= +github.com/smartcontractkit/chain-selectors v1.0.23/go.mod h1:d4Hi+E1zqjy9HqMkjBE5q1vcG9VGgxf5VxiRHfzi2kE= github.com/smartcontractkit/chainlink-automation v1.0.4 h1:iyW181JjKHLNMnDleI8umfIfVVlwC7+n5izbLSFgjw8= github.com/smartcontractkit/chainlink-automation v1.0.4/go.mod h1:u4NbPZKJ5XiayfKHD/v3z3iflQWqvtdhj13jVZXj/cM= -github.com/smartcontractkit/chainlink-common v0.1.7-0.20240709155552-d76403db14e5 h1:1J1M+rpMJn+5R4EPaU8hbCqR17PFClEBOJyazsvbWck= -github.com/smartcontractkit/chainlink-common v0.1.7-0.20240709155552-d76403db14e5/go.mod h1:fh9eBbrReCmv31bfz52ENCAMa7nTKQbdhb2B3+S2VGo= -github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20240710121324-3ed288aa9b45 h1:NBQLtqk8zsyY4qTJs+NElI3aDFTcAo83JHvqD04EvB0= -github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20240710121324-3ed288aa9b45/go.mod h1:LV0h7QBQUpoC2UUi6TcUvcIFm1xjP/DtEcqV8+qeLUs= -github.com/smartcontractkit/chainlink-data-streams v0.0.0-20240702145022-37a2c3a742d1 h1:dsTmitRaVizHxoYFoGz4+y/zVa8XnvKUiTaZdx+6t9M= -github.com/smartcontractkit/chainlink-data-streams v0.0.0-20240702145022-37a2c3a742d1/go.mod h1:6DgCnHMGdBaIh0bLs1dK0MtdeMZfeNhc/nvBUN6KIUg= -github.com/smartcontractkit/chainlink-feeds v0.0.0-20240522213638-159fb2d99917 h1:MD80ZRCTvxxJ8PBmhtrKoTnky8cVNYrCrIBLVRbrOM0= -github.com/smartcontractkit/chainlink-feeds v0.0.0-20240522213638-159fb2d99917/go.mod h1:jwVxhctE6BgLOSSsVq9wbREpZ8Ev34H+UBxeUhESZRs= -github.com/smartcontractkit/chainlink-solana v1.0.3-0.20240708150922-0546185ead68 h1:kLf20IgCHTNoON0EzWqF5QiZJWZW+i7xWvFPCyIUZTM= -github.com/smartcontractkit/chainlink-solana v1.0.3-0.20240708150922-0546185ead68/go.mod h1:NbXXQaNFskVMYRut0MvBlcHu/vDgipGMwYjamvjVB9Y= -github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240709043547-03612098f799 h1:HyLTySm7BR+oNfZqDTkVJ25wnmcTtxBBD31UkFL+kEM= -github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240709043547-03612098f799/go.mod h1:UVFRacRkP7O7TQAzFmR52v5mUlxf+G1ovMlCQAB/cHU= -github.com/smartcontractkit/go-plugin v0.0.0-20240208201424-b3b91517de16 h1:TFe+FvzxClblt6qRfqEhUfa4kFQx5UobuoFGO2W4mMo= -github.com/smartcontractkit/go-plugin v0.0.0-20240208201424-b3b91517de16/go.mod h1:lBS5MtSSBZk0SHc66KACcjjlU6WzEVP/8pwz68aMkCI= -github.com/smartcontractkit/grpc-proxy v0.0.0-20230731113816-f1be6620749f h1:hgJif132UCdjo8u43i7iPN1/MFnu49hv7lFGFftCHKU= -github.com/smartcontractkit/grpc-proxy v0.0.0-20230731113816-f1be6620749f/go.mod h1:MvMXoufZAtqExNexqi4cjrNYE9MefKddKylxjS+//n0= -github.com/smartcontractkit/libocr v0.0.0-20240702141926-063ceef8c42e h1:9ypZ/8aW8Vm497i1gXHcT96oNLiu88jbg9QdX+IUE3E= -github.com/smartcontractkit/libocr v0.0.0-20240702141926-063ceef8c42e/go.mod h1:fb1ZDVXACvu4frX3APHZaEBp0xi1DIm34DcA0CwTsZM= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20240930060710-158d2a9ac9ca h1:cvifSiZr9VifpKjgVtGaEqknz2MwpY4shQhoOLpgQUE= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20240930060710-158d2a9ac9ca/go.mod h1:hxKOwuo3HBC9a5hoNOvstl2wVF6Z9kZDssHU5VCdqk8= +github.com/smartcontractkit/chainlink-common v0.2.3-0.20240927162447-20630b333f57 h1:pRiTiFOkPEyvgG0hchcCSZzwUbwYydnZBu0QbVaRnVk= +github.com/smartcontractkit/chainlink-common v0.2.3-0.20240927162447-20630b333f57/go.mod h1:F6WUS6N4mP5ScwpwyTyAJc9/vjR+GXbMCRUOVekQi1g= +github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20240911175228-daf2600bb7b7 h1:lTGIOQYLk1Ufn++X/AvZnt6VOcuhste5yp+C157No/Q= +github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20240911175228-daf2600bb7b7/go.mod h1:BMYE1vC/pGmdFSsOJdPrAA0/4gZ0Xo0SxTMdGspBtRo= +github.com/smartcontractkit/chainlink-data-streams v0.0.0-20240916152957-433914114bd2 h1:yRk4ektpx/UxwarqAfgxUXLrsYXlaNeP1NOwzHGrK2Q= +github.com/smartcontractkit/chainlink-data-streams v0.0.0-20240916152957-433914114bd2/go.mod h1:rNhNSrrRMvkgAm5SA6bNTdh2340bTQQZdUVNtZ2o2bk= +github.com/smartcontractkit/chainlink-feeds v0.0.0-20240910155501-42f20443189f h1:p4p3jBT91EQyLuAMvHD+zNJsuAYI/QjJbzuGUJ7wIgg= +github.com/smartcontractkit/chainlink-feeds v0.0.0-20240910155501-42f20443189f/go.mod h1:FLlWBt2hwiMVgt9AcSo6wBJYIRd/nsc8ENbV1Wir1bw= +github.com/smartcontractkit/chainlink-solana v1.1.1-0.20240927143737-7e527aa85bff h1:piMugtrRlbVdcC6xZF37me686eS1YwpLQ0kN2v2b9YE= +github.com/smartcontractkit/chainlink-solana v1.1.1-0.20240927143737-7e527aa85bff/go.mod h1:5jD47oCERRQ4eGi0iNdk9ZV5HMEdolfQwHpUX1+Ix4s= +github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240911194142-506bc469d8ae h1:d+B8y2Nd/PrnPMNoaSPn3eDgUgxcVcIqAxGrvYu/gGw= +github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240911194142-506bc469d8ae/go.mod h1:ec/a20UZ7YRK4oxJcnTBFzp1+DBcJcwqEaerUMsktMs= +github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7 h1:12ijqMM9tvYVEm+nR826WsrNi6zCKpwBhuApq127wHs= +github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7/go.mod h1:FX7/bVdoep147QQhsOPkYsPEXhGZjeYx6lBSaSXtZOA= +github.com/smartcontractkit/libocr v0.0.0-20240717100443-f6226e09bee7 h1:e38V5FYE7DA1JfKXeD5Buo/7lczALuVXlJ8YNTAUxcw= +github.com/smartcontractkit/libocr v0.0.0-20240717100443-f6226e09bee7/go.mod h1:fb1ZDVXACvu4frX3APHZaEBp0xi1DIm34DcA0CwTsZM= github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin v0.0.0-20230906073235-9e478e5e19f1 h1:yiKnypAqP8l0OX0P3klzZ7SCcBUxy5KqTAKZmQOvSQE= github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin v0.0.0-20230906073235-9e478e5e19f1/go.mod h1:q6f4fe39oZPdsh1i57WznEZgxd8siidMaSFq3wdPmVg= github.com/smartcontractkit/tdh2/go/tdh2 v0.0.0-20230906073235-9e478e5e19f1 h1:Dai1bn+Q5cpeGMQwRdjOdVjG8mmFFROVkSKuUgBErRQ= github.com/smartcontractkit/tdh2/go/tdh2 v0.0.0-20230906073235-9e478e5e19f1/go.mod h1:G5Sd/yzHWf26rQ+X0nG9E0buKPqRGPMJAfk2gwCzOOw= -github.com/smartcontractkit/wsrpc v0.7.3 h1:CKYZfawZShZGfvsQep1F9oBansnFk9ByZPCdTMpLphw= -github.com/smartcontractkit/wsrpc v0.7.3/go.mod h1:sj7QX2NQibhkhxTfs3KOhAj/5xwgqMipTvJVSssT9i0= +github.com/smartcontractkit/wsrpc v0.8.2 h1:XB/xcn/MMseHW+8JE8+a/rceA86ck7Ur6cEa9LiUC8M= +github.com/smartcontractkit/wsrpc v0.8.2/go.mod h1:2u/wfnhl5R4RlSXseN4n6HHIWk8w1Am3AT6gWftQbNg= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= +github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo= +github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= -github.com/spf13/afero v1.9.5 h1:stMpOSZFs//0Lv29HduCmli3GUfpFoF3Y1Q/aXj/wVM= -github.com/spf13/afero v1.9.5/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ= +github.com/spf13/afero v1.11.0 h1:WJQKhtpdm3v2IzqG8VMqrr6Rf3UYpEF239Jy9wNepM8= +github.com/spf13/afero v1.11.0/go.mod h1:GH9Y3pIexgf1MTIWtNGyogA5MwRIDXGUr+hbWNoBjkY= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cast v1.6.0 h1:GEiTHELF+vaR5dhz3VqZfFSzZjYbgeKDpBxQVS4GYJ0= github.com/spf13/cast v1.6.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= github.com/spf13/cobra v1.1.1/go.mod h1:WnodtKOvamDL/PwE2M4iKs8aMDBZ5Q5klgD3qfVJQMI= -github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0= -github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho= +github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM= +github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= -github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= -github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= github.com/spf13/viper v1.7.1/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= -github.com/spf13/viper v1.15.0 h1:js3yy885G8xwJa6iOISGFwd+qlUo5AvyXb7CiihdtiU= -github.com/spf13/viper v1.15.0/go.mod h1:fFcTBJxvhhzSJiZy8n+PeW6t8l+KeT/uTARa0jHOQLA= +github.com/spf13/viper v1.18.2 h1:LUXCnvUvSM6FXAsj6nnfc8Q2tp1dIgUfY9Kc8GsSOiQ= +github.com/spf13/viper v1.18.2/go.mod h1:EKmWIqdnk5lOcmR72yw6hS+8OPYcwD0jteitLMVB+yk= github.com/status-im/keycard-go v0.2.0 h1:QDLFswOQu1r5jsycloeQh3bVU8n/NatHHaZobtDnDzA= github.com/status-im/keycard-go v0.2.0/go.mod h1:wlp8ZLbsmrF6g6WjugPAx+IzoLrkdf9+mHxBEeo3Hbg= github.com/streamingfast/logging v0.0.0-20220405224725-2755dab2ce75 h1:ZqpS7rAhhKD7S7DnrpEdrnW1/gZcv82ytpMviovkli4= @@ -1250,13 +1153,12 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= -github.com/subosito/gotenv v1.4.2 h1:X1TuBLAMDFbaTAChgCBLu3DU3UPyELpnF2jjJ2cz/S8= -github.com/subosito/gotenv v1.4.2/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= +github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= +github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= github.com/supranational/blst v0.3.11 h1:LyU6FolezeWAhvQk0k6O/d49jqgO52MSDDfYgbeoEm4= github.com/supranational/blst v0.3.11/go.mod h1:jZJtfjgudtNl4en1tzwPIV3KjUnQUvG3/j+w+fVonLw= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= @@ -1298,10 +1200,8 @@ github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2 github.com/tyler-smith/go-bip39 v1.1.0 h1:5eUemwrMargf3BSLRRCalXT93Ns6pQJIjYQN2nyfOP8= github.com/tyler-smith/go-bip39 v1.1.0/go.mod h1:gUYDtqQw1JS3ZJ8UWVcGTGqqr6YIN3CWg+kkNaLt55U= github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= -github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= github.com/ugorji/go v1.2.7/go.mod h1:nF9osbDWLy6bDVv/Rtoh6QgnvNDpmCalQV5urGCCS6M= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= -github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= github.com/ugorji/go/codec v1.2.7/go.mod h1:WGN1fab3R1fzQlVQTkfxVtIBhWDRqOviHU95kRgeqEY= github.com/ugorji/go/codec v1.2.12 h1:9LC83zGrHhuUA9l16C9AHXAqEV/2wBQ4nkvumAE65EE= github.com/ugorji/go/codec v1.2.12/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= @@ -1319,14 +1219,10 @@ github.com/urfave/cli v1.22.14 h1:ebbhrRiGK2i4naQJr+1Xj92HXZCrK7MsyTS/ob3HnAk= github.com/urfave/cli v1.22.14/go.mod h1:X0eDS6pD6Exaclxm99NJ3FiCDRED7vIHpx2mDOHLvkA= github.com/urfave/cli/v2 v2.25.7 h1:VAzn5oq403l5pHjc4OhD54+XGO9cdKVL/7lDjF+iKUs= github.com/urfave/cli/v2 v2.25.7/go.mod h1:8qnjx1vcq5s2/wpsqoZFndg2CE5tNFyrTvS6SinrnYQ= -github.com/urfave/negroni v1.0.0/go.mod h1:Meg73S6kFm/4PpbYdq35yYWoCZ9mS/YSx+lKnmiohz4= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= -github.com/valyala/fasthttp v1.6.0/go.mod h1:FstJa9V+Pj9vQ7OJie2qMHdwemEDaDiSdBnvPM1Su9w= github.com/valyala/fastjson v1.4.1 h1:hrltpHpIpkaxll8QltMU8c3QZ5+qIiCL8yKqPFJI/yE= github.com/valyala/fastjson v1.4.1/go.mod h1:nV6MsjxL2IMJQUoHDIrjEI7oLyeqK6aBD7EFWPsvP8o= github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= -github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= -github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a/go.mod h1:v3UYOV9WzVtRmSR+PDvWpU/qWl4Wa5LApYYX4ZtKbio= github.com/wk8/go-ordered-map/v2 v2.1.8 h1:5h/BUHu93oj4gIdvHHHGsScSTMijfx5PeYkE/fJgbpc= github.com/wk8/go-ordered-map/v2 v2.1.8/go.mod h1:5nJHM5DyteebpVlHnWMV0rPz6Zp7+xBAnxjb1X5vnTw= github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= @@ -1334,31 +1230,23 @@ github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcY github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI= github.com/xdg-go/scram v1.1.1/go.mod h1:RaEWvsqvNKKvBPvcKeFjrG2cJqOkHTiyTpzz23ni57g= github.com/xdg-go/stringprep v1.0.3/go.mod h1:W3f5j4i+9rC0kuIEJL0ky1VpHXQU3ocBgklLGvcBnW8= -github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= -github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= -github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU= github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8= -github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0/go.mod h1:/LWChgwKmvncFJFHJ7Gvn9wZArjbV5/FppcK2fKk/tI= github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7JulP+udvsHwJoVG1YGAP6VLg4y9I5dyZdqmA= -github.com/yudai/gojsondiff v1.0.0/go.mod h1:AY32+k2cwILAkW1fbgxQ5mUmMiZFgLIV+FBNExI05xg= -github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82/go.mod h1:lgjkn3NuSvDfVJdfcVVdX+jpBxNmX4rDAzaS45IcYoM= -github.com/yudai/pp v2.0.1+incompatible/go.mod h1:PuxR/8QJ7cyCkFp/aUDS+JY727OFEZkTdatxwunjIkc= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0= github.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q= -github.com/zondax/hid v0.9.1 h1:gQe66rtmyZ8VeGFcOpbuH3r7erYtNEAezCAYu8LdkJo= -github.com/zondax/hid v0.9.1/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= -github.com/zondax/ledger-go v0.14.1 h1:Pip65OOl4iJ84WTpA4BKChvOufMhhbxED3BaihoZN4c= -github.com/zondax/ledger-go v0.14.1/go.mod h1:fZ3Dqg6qcdXWSOJFKMG8GCTnD7slO/RL2feOQv8K320= +github.com/zondax/hid v0.9.2 h1:WCJFnEDMiqGF64nlZz28E9qLVZ0KSJ7xpc5DLEyma2U= +github.com/zondax/hid v0.9.2/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= +github.com/zondax/ledger-go v0.14.3 h1:wEpJt2CEcBJ428md/5MgSLsXLBos98sBOyxNmCjfUCw= +github.com/zondax/ledger-go v0.14.3/go.mod h1:IKKaoxupuB43g4NxeQmbLXv7T9AlQyie1UpHb342ycI= go.dedis.ch/fixbuf v1.0.3 h1:hGcV9Cd/znUxlusJ64eAlExS+5cJDIyTyEG+otu5wQs= go.dedis.ch/fixbuf v1.0.3/go.mod h1:yzJMt34Wa5xD37V5RTdmp38cz3QhMagdGoem9anUalw= go.dedis.ch/kyber/v3 v3.0.4/go.mod h1:OzvaEnPvKlyrWyp3kGXlFdp7ap1VC6RkZDTaPikqhsQ= @@ -1385,28 +1273,44 @@ go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= go.opentelemetry.io/contrib/instrumentation/github.com/gin-gonic/gin/otelgin v0.49.0 h1:1f31+6grJmV3X4lxcEvUy13i5/kfDw1nJZwhd8mA4tg= go.opentelemetry.io/contrib/instrumentation/github.com/gin-gonic/gin/otelgin v0.49.0/go.mod h1:1P/02zM3OwkX9uki+Wmxw3a5GVb6KUXRsa7m7bOC9Fg= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.52.0 h1:vS1Ao/R55RNV4O7TA2Qopok8yN+X0LIP6RVWLFkprck= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.52.0/go.mod h1:BMsdeOxN04K0L5FNUBfjFdvwWGNe/rkmSwH4Aelu/X0= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 h1:jq9TW8u3so/bN+JPT166wjOI6/vQPF6Xe7nMNIltagk= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0/go.mod h1:p8pYQP+m5XfbZm9fxtSKAbM6oIllS7s2AfxrChvc7iw= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.53.0 h1:9G6E0TXzGFVfTnawRzrPl83iHOAV7L8NJiR8RSGYV1g= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.53.0/go.mod h1:azvtTADFQJA8mX80jIH/akaE7h+dbm/sVuaHqN13w74= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.53.0 h1:4K4tsIXefpVJtvA/8srF4V4y0akAoPHkIslgAkjixJA= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.53.0/go.mod h1:jjdQuTGVsXV4vSs+CJ2qYDeDPf9yIJV23qlIzBm73Vg= go.opentelemetry.io/contrib/propagators/b3 v1.24.0 h1:n4xwCdTx3pZqZs2CjS/CUZAs03y3dZcGhC/FepKtEUY= go.opentelemetry.io/contrib/propagators/b3 v1.24.0/go.mod h1:k5wRxKRU2uXx2F8uNJ4TaonuEO/V7/5xoz7kdsDACT8= -go.opentelemetry.io/otel v1.27.0 h1:9BZoF3yMK/O1AafMiQTVu0YDj5Ea4hPhxCs7sGva+cg= -go.opentelemetry.io/otel v1.27.0/go.mod h1:DMpAK8fzYRzs+bi3rS5REupisuqTheUlSZJ1WnZaPAQ= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.27.0 h1:R9DE4kQ4k+YtfLI2ULwX82VtNQ2J8yZmA7ZIF/D+7Mc= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.27.0/go.mod h1:OQFyQVrDlbe+R7xrEyDr/2Wr67Ol0hRUgsfA+V5A95s= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.27.0 h1:qFffATk0X+HD+f1Z8lswGiOQYKHRlzfmdJm0wEaVrFA= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.27.0/go.mod h1:MOiCmryaYtc+V0Ei+Tx9o5S1ZjA7kzLucuVuyzBZloQ= -go.opentelemetry.io/otel/metric v1.27.0 h1:hvj3vdEKyeCi4YaYfNjv2NUje8FqKqUY8IlF0FxV/ik= -go.opentelemetry.io/otel/metric v1.27.0/go.mod h1:mVFgmRlhljgBiuk/MP/oKylr4hs85GZAylncepAX/ak= -go.opentelemetry.io/otel/sdk v1.27.0 h1:mlk+/Y1gLPLn84U4tI8d3GNJmGT/eXe3ZuOXN9kTWmI= -go.opentelemetry.io/otel/sdk v1.27.0/go.mod h1:Ha9vbLwJE6W86YstIywK2xFfPjbWlCuwPtMkKdz/Y4A= -go.opentelemetry.io/otel/sdk/metric v1.21.0 h1:smhI5oD714d6jHE6Tie36fPx4WDFIg+Y6RfAY4ICcR0= -go.opentelemetry.io/otel/sdk/metric v1.21.0/go.mod h1:FJ8RAsoPGv/wYMgBdUJXOm+6pzFY3YdljnXtv1SBE8Q= -go.opentelemetry.io/otel/trace v1.27.0 h1:IqYb813p7cmbHk0a5y6pD5JPakbVfftRXABGt5/Rscw= -go.opentelemetry.io/otel/trace v1.27.0/go.mod h1:6RiD1hkAprV4/q+yd2ln1HG9GoPx39SuvvstaLBl+l4= -go.opentelemetry.io/proto/otlp v1.2.0 h1:pVeZGk7nXDC9O2hncA6nHldxEjm6LByfA2aN8IOkz94= -go.opentelemetry.io/proto/otlp v1.2.0/go.mod h1:gGpR8txAl5M03pDhMC79G6SdqNV26naRm/KDsgaHD8A= +go.opentelemetry.io/otel v1.6.3/go.mod h1:7BgNga5fNlF/iZjG06hM3yofffp0ofKCDwSXx1GC4dI= +go.opentelemetry.io/otel v1.28.0 h1:/SqNcYk+idO0CxKEUOtKQClMK/MimZihKYMruSMViUo= +go.opentelemetry.io/otel v1.28.0/go.mod h1:q68ijF8Fc8CnMHKyzqL6akLO46ePnjkgfIMIjUIX9z4= +go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.0.0-20240823153156-2a54df7bffb9 h1:UiRNKd1OgqsLbFwE+wkAWTdiAxXtCBqKIHeBIse4FUA= +go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.0.0-20240823153156-2a54df7bffb9/go.mod h1:eqZlW3pJWhjyexnDPrdQxix1pn0wwhI4AO4GKpP/bMI= +go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.28.0 h1:U2guen0GhqH8o/G2un8f/aG/y++OuW6MyCo6hT9prXk= +go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.28.0/go.mod h1:yeGZANgEcpdx/WK0IvvRFC+2oLiMS2u4L/0Rj2M2Qr0= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.28.0 h1:3Q/xZUyC1BBkualc9ROb4G8qkH90LXEIICcs5zv1OYY= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.28.0/go.mod h1:s75jGIWA9OfCMzF0xr+ZgfrB5FEbbV7UuYo32ahUiFI= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.28.0 h1:R3X6ZXmNPRR8ul6i3WgFURCHzaXjHdm0karRG/+dj3s= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.28.0/go.mod h1:QWFXnDavXWwMx2EEcZsf3yxgEKAqsxQ+Syjp+seyInw= +go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.4.0 h1:0MH3f8lZrflbUWXVxyBg/zviDFdGE062uKh5+fu8Vv0= +go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.4.0/go.mod h1:Vh68vYiHY5mPdekTr0ox0sALsqjoVy0w3Os278yX5SQ= +go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.28.0 h1:BJee2iLkfRfl9lc7aFmBwkWxY/RI1RDdXepSF6y8TPE= +go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.28.0/go.mod h1:DIzlHs3DRscCIBU3Y9YSzPfScwnYnzfnCd4g8zA7bZc= +go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.28.0 h1:EVSnY9JbEEW92bEkIYOVMw4q1WJxIAGoFTrtYOzWuRQ= +go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.28.0/go.mod h1:Ea1N1QQryNXpCD0I1fdLibBAIpQuBkznMmkdKrapk1Y= +go.opentelemetry.io/otel/log v0.4.0 h1:/vZ+3Utqh18e8TPjuc3ecg284078KWrR8BRz+PQAj3o= +go.opentelemetry.io/otel/log v0.4.0/go.mod h1:DhGnQvky7pHy82MIRV43iXh3FlKN8UUKftn0KbLOq6I= +go.opentelemetry.io/otel/metric v1.28.0 h1:f0HGvSl1KRAU1DLgLGFjrwVyismPlnuU6JD6bOeuA5Q= +go.opentelemetry.io/otel/metric v1.28.0/go.mod h1:Fb1eVBFZmLVTMb6PPohq3TO9IIhUisDsbJoL/+uQW4s= +go.opentelemetry.io/otel/sdk v1.28.0 h1:b9d7hIry8yZsgtbmM0DKyPWMMUMlK9NEKuIG4aBqWyE= +go.opentelemetry.io/otel/sdk v1.28.0/go.mod h1:oYj7ClPUA7Iw3m+r7GeEjz0qckQRJK2B8zjcZEfu7Pg= +go.opentelemetry.io/otel/sdk/log v0.4.0 h1:1mMI22L82zLqf6KtkjrRy5BbagOTWdJsqMY/HSqILAA= +go.opentelemetry.io/otel/sdk/log v0.4.0/go.mod h1:AYJ9FVF0hNOgAVzUG/ybg/QttnXhUePWAupmCqtdESo= +go.opentelemetry.io/otel/sdk/metric v1.28.0 h1:OkuaKgKrgAbYrrY0t92c+cC+2F6hsFNnCQArXCKlg08= +go.opentelemetry.io/otel/sdk/metric v1.28.0/go.mod h1:cWPjykihLAPvXKi4iZc1dpER3Jdq2Z0YLse3moQUCpg= +go.opentelemetry.io/otel/trace v1.6.3/go.mod h1:GNJQusJlUgZl9/TQBPKU/Y/ty+0iVB5fjhKeJGZPGFs= +go.opentelemetry.io/otel/trace v1.28.0 h1:GhQ9cUuQGmNDd5BTCP2dAvv75RdMxEfTmYejp+lkx9g= +go.opentelemetry.io/otel/trace v1.28.0/go.mod h1:jPyXzNPg6da9+38HEwElrQiHlVMTnVfM3/yv2OlIHaI= +go.opentelemetry.io/proto/otlp v1.3.1 h1:TrMUixzpM0yuc/znrFTP9MMRh8trP93mkCiDVeXrui0= +go.opentelemetry.io/proto/otlp v1.3.1/go.mod h1:0X1WI4de4ZsLrrJNLAQbFeLCm3T7yBkR0XqQ7niQU+8= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= @@ -1433,12 +1337,11 @@ go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= go.uber.org/zap v1.14.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= go.uber.org/zap v1.16.0/go.mod h1:MA8QOfq0BHJwdXa996Y4dYkAqRKB8/1K1QMMZVaNZjQ= go.uber.org/zap v1.21.0/go.mod h1:wjWOCqI0f2ZZrJF/UufIOkiC8ii6tm1iqIsLo76RfJw= -go.uber.org/zap v1.24.0/go.mod h1:2kMP+WWQ8aoFoedH3T2sq6iJ2yDWpHbP0f6MQbS9Gkg= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= +go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= -golang.org/x/arch v0.7.0 h1:pskyeJh/3AmoQ8CPE95vxHLqp1G1GfGNXTmcl9NEKTc= -golang.org/x/arch v0.7.0/go.mod h1:FEVrYAQjsQXMVJ1nsMoVVXPZg6p2JE2mx8psSWTDQys= +golang.org/x/arch v0.8.0 h1:3wRIsP3pM4yUptoR96otTUOXI367OS0+c9eeRi9doIc= +golang.org/x/arch v0.8.0/go.mod h1:FEVrYAQjsQXMVJ1nsMoVVXPZg6p2JE2mx8psSWTDQys= golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= @@ -1448,26 +1351,21 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk golang.org/x/crypto v0.0.0-20190411191339-88737f569e3a/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20191227163750-53104e6ec876/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201203163018-be400aefbc4c/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= -golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= -golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220214200702-86341886e292/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc= -golang.org/x/crypto v0.24.0 h1:mnl8DM0o513X8fdIkmyFE/5hTYxbwYOjDS/+rK6qpRI= -golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM= +golang.org/x/crypto v0.27.0 h1:GXm2NjJrPaiv/h1tb2UH8QfgC/hOf/+z0p6PT8o1w7A= +golang.org/x/crypto v0.27.0/go.mod h1:1Xngt8kV6Dvbssa53Ziq6Eqn0HqbZi5Z6R0ZpwQzt70= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -1478,8 +1376,8 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20240325151524-a685a6edb6d8 h1:aAcj0Da7eBAtrTp03QXWvm88pSyOt+UgdZw2BFZ+lEw= -golang.org/x/exp v0.0.0-20240325151524-a685a6edb6d8/go.mod h1:CQ1k9gNrJ50XIzaKCRR2hssIjF07kZFEiieALBM/ARQ= +golang.org/x/exp v0.0.0-20240909161429-701f63a606c0 h1:e66Fs6Z+fZTbFBAxKfP3PALWBtpfqks2bwGcexMxgtk= +golang.org/x/exp v0.0.0-20240909161429-701f63a606c0/go.mod h1:2TbTHSBQa924w8M6Xs1QcRcFwyucIwBGpK1p2f1YFFY= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -1493,7 +1391,6 @@ golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRu golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= @@ -1502,13 +1399,11 @@ golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzB golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA= -golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.21.0 h1:vvrHzRwRfVKSiLrG+d4FMl/Qi4ukBCE6kZlTUkDYRT0= +golang.org/x/mod v0.21.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1520,64 +1415,46 @@ golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73r golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190327091125-710a502c58a2/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= golang.org/x/net v0.0.0-20210331212208-0fccb6fa2b5c/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= -golang.org/x/net v0.0.0-20211008194852-3b03d305991f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= -golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac= -golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= +golang.org/x/net v0.29.0 h1:5ORfpBpCs4HzDYoodCDBbwHzdR5UrLBZ3sOnUJmFoHo= +golang.org/x/net v0.29.0/go.mod h1:gLkgy8jTGERgjzMic6DS9+SP0ajcu6Xu3Orq/SpETg0= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.20.0 h1:4mQdhULixXKP1rwYBW0vAijoXnkTG0BLCDRzfe1idMo= -golang.org/x/oauth2 v0.20.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= +golang.org/x/oauth2 v0.22.0 h1:BzDx2FehcG7jJwgWLELCdmLuxk2i+x9UDpSiss2u0ZA= +golang.org/x/oauth2 v0.22.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1585,14 +1462,12 @@ golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= -golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1630,47 +1505,32 @@ golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210331175145-43e1dd70ce54/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210819135213-f52c844e1c1c/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-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -1678,8 +1538,8 @@ golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= -golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34= +golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= 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-20201210144234-2321bbc49cbf/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= @@ -1687,8 +1547,8 @@ golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuX golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU= -golang.org/x/term v0.21.0 h1:WVXCp+/EBEHOj53Rvu+7KiT/iElMrO8ACK16SMZ3jaA= -golang.org/x/term v0.21.0/go.mod h1:ooXLefLobQVslOqselCNF4SxFAaoS6KujMbsGzSDmX0= +golang.org/x/term v0.24.0 h1:Mh5cbb+Zk2hqqXNO7S1iTjEphVL+jb8ZWaqh/g+JWkM= +golang.org/x/term v0.24.0/go.mod h1:lOBK/LVxemqiMij05LGJ0tzNr8xlmwBRJ81PX6wVLH8= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1701,22 +1561,19 @@ golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= -golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= -golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= +golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224= +golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20201208040808-7e3f01d25324/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= -golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= +golang.org/x/time v0.6.0 h1:eTDhh4ZXt5Qf0augr54TN6suAUudPcawVZeIAPU7D4U= +golang.org/x/time v0.6.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181221001348-537d06c36207/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190327201419-c70d86f8b7cf/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190425163242-31fd60d6bfdc/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= @@ -1749,33 +1606,16 @@ golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapK golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= -golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= -golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= -golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg= -golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= +golang.org/x/tools v0.25.0 h1:oFU9pkj/iJgs+0DT+VMHrx+oBKs/LJMV+Uvg78sl+fE= +golang.org/x/tools v0.25.0/go.mod h1:/vtpO8WL1N9cQC3FN5zPqb//fRXskFHbLKk4OW1Q7rg= golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -1783,8 +1623,8 @@ golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= -gonum.org/v1/gonum v0.14.0 h1:2NiG67LD1tEH0D7kM+ps2V+fXmsAnpUeec7n8tcr4S0= -gonum.org/v1/gonum v0.14.0/go.mod h1:AoWeoz0becf9QMWtE8iWXNXc27fK4fNeHNf/oMejGfU= +gonum.org/v1/gonum v0.15.0 h1:2lYxjRbTYyxkJxlhC+LvJIx3SsANPdRybu1tGj9/OrQ= +gonum.org/v1/gonum v0.15.0/go.mod h1:xzZVBJBtS+Mz4q0Yl2LJTk+OxOg4jiXZ7qBoM0uISGo= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= @@ -1795,27 +1635,16 @@ google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsb google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= -google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= -google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= -google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= -google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= -google.golang.org/api v0.169.0 h1:QwWPy71FgMWqJN/l6jVlFHUa29a7dcUy02I8o799nPY= -google.golang.org/api v0.169.0/go.mod h1:gpNOiMA2tZ4mf5R9Iwf4rK/Dcz0fbdIgWYWVoxmsyLg= +google.golang.org/api v0.188.0 h1:51y8fJ/b1AaaBRJr4yWm96fPcuxSo0JcegXE3DaHQHw= +google.golang.org/api v0.188.0/go.mod h1:VR0d+2SIiWOYG3r/jdm7adPW9hI2aRv9ETOSCQ9Beag= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= google.golang.org/appengine v1.6.2/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/genproto v0.0.0-20180518175338-11a468237815/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= @@ -1835,37 +1664,18 @@ google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvx google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200324203455-a04cca1dde73/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= -google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210401141331-865547bb08e2/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= -google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= -google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 h1:9+tzLLstTlPTRyJTh+ah5wIMsBW5c4tQwGTN3thOW9Y= -google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9/go.mod h1:mqHbVIp48Muh7Ywss/AD6I5kNVKZMmAa/QEW58Gxp2s= -google.golang.org/genproto/googleapis/api v0.0.0-20240520151616-dc85e6b867a5 h1:P8OJ/WCl/Xo4E4zoe4/bifHpSmmKwARqyqE4nW6J2GQ= -google.golang.org/genproto/googleapis/api v0.0.0-20240520151616-dc85e6b867a5/go.mod h1:RGnPtTG7r4i8sPlNyDeikXF99hMM+hN6QMm4ooG9g2g= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240520151616-dc85e6b867a5 h1:Q2RxlXqh1cgzzUgV261vBO2jI5R/3DD1J2pM0nI4NhU= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240520151616-dc85e6b867a5/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0= -google.golang.org/grpc v1.12.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= +google.golang.org/genproto v0.0.0-20240711142825-46eb208f015d h1:/hmn0Ku5kWij/kjGsrcJeC1T/MrJi2iNWwgAqrihFwc= +google.golang.org/genproto v0.0.0-20240711142825-46eb208f015d/go.mod h1:FfBgJBJg9GcpPvKIuHSZ/aE1g2ecGL74upMzGZjiGEY= +google.golang.org/genproto/googleapis/api v0.0.0-20240822170219-fc7c04adadcd h1:BBOTEWLuuEGQy9n1y9MhVJ9Qt0BDu21X8qZs71/uPZo= +google.golang.org/genproto/googleapis/api v0.0.0-20240822170219-fc7c04adadcd/go.mod h1:fO8wJzT2zbQbAjbIoos1285VfEIYKDDY+Dt+WpTkh6g= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd h1:6TEm2ZxXoQmFWFlt1vNxvVOa1Q0dXFQD1m/rYjXmS0E= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= @@ -1878,17 +1688,11 @@ google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8 google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= -google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= -google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= -google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.64.0 h1:KH3VH9y/MgNQg1dE7b3XfVK0GsPSIzJwdF617gUSbvY= -google.golang.org/grpc v1.64.0/go.mod h1:oxjF8E3FBnjp+/gVFYdWacaLDx9na1aqy9oovLpxQYg= +google.golang.org/grpc v1.65.0 h1:bs/cUb4lp1G5iImFFd3u5ixQzweKizoZJAwBNLR42lc= +google.golang.org/grpc v1.65.0/go.mod h1:WgYC2ypjlB0EiQi6wdKixMqukr6lBc0Vo+oOgjrM5ZQ= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -1897,13 +1701,12 @@ google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzi google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= 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/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= -google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -1923,10 +1726,8 @@ gopkg.in/inconshreveable/log15.v2 v2.0.0-20180818164646-67afb5ed74ec/go.mod h1:a gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/ini.v1 v1.51.1/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/mgo.v2 v2.0.0-20180705113604-9856a29383ce/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA= gopkg.in/natefinch/lumberjack.v2 v2.2.1 h1:bBRl1b0OH9s/DuPhuXpNl+VtCaJXFZ5/uEFST95x9zc= gopkg.in/natefinch/lumberjack.v2 v2.2.1/go.mod h1:YD8tP3GAjkrDg1eZH7EGmyESg/lsYskCTPBJVb9jqSc= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= @@ -1942,21 +1743,19 @@ gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= -gopkg.in/yaml.v3 v3.0.0-20191120175047-4206685974f2/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= -gotest.tools/v3 v3.5.0 h1:Ljk6PdHdOhAb5aDMWXjDLMMhph+BpztA4v1QdqEW2eY= -gotest.tools/v3 v3.5.0/go.mod h1:isy3WKz7GK6uNw/sbHzfKBLvlvXwUyV06n6brMxxopU= +gotest.tools/v3 v3.5.1 h1:EENdUnS3pdur5nybKYIh2Vfgc8IUNBjxDPSjtiJcOzU= +gotest.tools/v3 v3.5.1/go.mod h1:isy3WKz7GK6uNw/sbHzfKBLvlvXwUyV06n6brMxxopU= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.1.3/go.mod h1:NgwopIslSNH47DimFoV78dnkksY2EFtX0ajyb3K/las= k8s.io/api v0.30.0 h1:siWhRq7cNjy2iHssOB9SCGNCl2spiF1dO3dABqZ8niA= k8s.io/api v0.30.0/go.mod h1:OPlaYhoHs8EQ1ql0R/TsUgaRPhpKNxIMrKQfWUp8QSE= @@ -1968,8 +1767,8 @@ k8s.io/klog/v2 v2.120.1 h1:QXU6cPEOIslTGvZaXvFWiP9VKyeet3sawzTOvdXb4Vw= k8s.io/klog/v2 v2.120.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 h1:BZqlfIlq5YbRMFko6/PM7FjZpUb45WallggurYhKGag= k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340/go.mod h1:yD4MZYeKMBwQKVht279WycxKyM84kkAx2DPrTXaeb98= -k8s.io/utils v0.0.0-20230726121419-3b25d923346b h1:sgn3ZU783SCgtaSJjpcVVlRqd6GSnlTLKgpAAttJvpI= -k8s.io/utils v0.0.0-20230726121419-3b25d923346b/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= +k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 h1:pUdcCO1Lk/tbT5ztQWOBi5HBgbBP1J8+AsQnQCKsi8A= +k8s.io/utils v0.0.0-20240711033017-18e509b52bc8/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= modernc.org/gc/v3 v3.0.0-20240107210532-573471604cb6 h1:5D53IMaUuA5InSeMu9eJtlQXS2NxAhyWQvkKEgXZhHI= modernc.org/gc/v3 v3.0.0-20240107210532-573471604cb6/go.mod h1:Qz0X07sNOR1jWYCrJMEnbW/X55x206Q7Vt4mz6/wHp4= modernc.org/libc v1.41.0 h1:g9YAc6BkKlgORsUWj+JwqoB1wU3o4DE3bM3yvA3k+Gk= @@ -1987,8 +1786,8 @@ modernc.org/token v1.1.0/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM= nhooyr.io/websocket v1.8.10 h1:mv4p+MnGrLDcPlBoWsvPP7XCzTYMXP9F9eIGoKbgx7Q= nhooyr.io/websocket v1.8.10/go.mod h1:rN9OFWIUwuxg4fR5tELlYC04bXYowCP9GX47ivo2l+c= nullprogram.com/x/optparse v1.0.0/go.mod h1:KdyPE+Igbe0jQUrVfMqDMeJQIJZEuyV7pjYmp6pbG50= -pgregory.net/rapid v0.5.5 h1:jkgx1TjbQPD/feRoK+S/mXw9e1uj6WilpHrXJowi6oA= -pgregory.net/rapid v0.5.5/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= +pgregory.net/rapid v1.1.0 h1:CMa0sjHSru3puNx+J0MIAuiiEV4N0qj8/cMWGBBCsjw= +pgregory.net/rapid v1.1.0/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= diff --git a/core/scripts/keystone/.gitignore b/core/scripts/keystone/.gitignore index 4af4a42a015..92bf9aabc58 100644 --- a/core/scripts/keystone/.gitignore +++ b/core/scripts/keystone/.gitignore @@ -3,3 +3,4 @@ !*-sample.sh keystone .cache/ +artefacts/ diff --git a/core/scripts/keystone/main.go b/core/scripts/keystone/main.go index 571623578ac..3486830ca32 100644 --- a/core/scripts/keystone/main.go +++ b/core/scripts/keystone/main.go @@ -20,6 +20,8 @@ func main() { src.NewGenerateCribClusterOverridesCommand(), src.NewDeleteJobsCommand(), src.NewDeployAndInitializeCapabilitiesRegistryCommand(), + src.NewDeployWorkflowsCommand(), + src.NewDeleteWorkflowsCommand(), } commandsList := func(commands []command) string { diff --git a/core/scripts/keystone/src/01_deploy_contracts_cmd.go b/core/scripts/keystone/src/01_deploy_contracts_cmd.go index 2ca60bdfaf2..b3049737956 100644 --- a/core/scripts/keystone/src/01_deploy_contracts_cmd.go +++ b/core/scripts/keystone/src/01_deploy_contracts_cmd.go @@ -52,8 +52,12 @@ func (g *deployContracts) Run(args []string) { skipFunding := fs.Bool("skipfunding", false, "skip funding the transmitters") onlySetConfig := fs.Bool("onlysetconfig", false, "set the config on the OCR3 contract without deploying the contracts or funding transmitters") dryRun := fs.Bool("dryrun", false, "dry run, don't actually deploy the contracts and do not fund transmitters") + publicKeys := fs.String("publickeys", "", "Custom public keys json location") + nodeList := fs.String("nodes", "", "Custom node list location") + artefactsDir := fs.String("artefacts", "", "Custom artefacts directory location") err := fs.Parse(args) + if err != nil || *ocrConfigFile == "" || ocrConfigFile == nil || *ethUrl == "" || ethUrl == nil || @@ -63,11 +67,21 @@ func (g *deployContracts) Run(args []string) { os.Exit(1) } + if *artefactsDir == "" { + *artefactsDir = defaultArtefactsDir + } + if *publicKeys == "" { + *publicKeys = defaultPublicKeys + } + if *nodeList == "" { + *nodeList = defaultNodeList + } + os.Setenv("ETH_URL", *ethUrl) os.Setenv("ETH_CHAIN_ID", fmt.Sprintf("%d", *chainID)) os.Setenv("ACCOUNT_KEY", *accountKey) - deploy(*ocrConfigFile, *skipFunding, *dryRun, *onlySetConfig) + deploy(*nodeList, *publicKeys, *ocrConfigFile, *skipFunding, *dryRun, *onlySetConfig, *artefactsDir) } // deploy does the following: @@ -77,16 +91,20 @@ func (g *deployContracts) Run(args []string) { // 4. Writes the deployed contract addresses to a file // 5. Funds the transmitters func deploy( + nodeList string, + publicKeys string, configFile string, skipFunding bool, dryRun bool, onlySetConfig bool, + artefacts string, ) { env := helpers.SetupEnv(false) ocrConfig := generateOCR3Config( + nodeList, configFile, env.ChainID, - ".cache/PublicKeys.json", + publicKeys, ) if dryRun { @@ -96,11 +114,11 @@ func deploy( if onlySetConfig { fmt.Println("Skipping deployment of contracts and skipping funding transmitters, only setting config") - setOCR3Config(env, ocrConfig) + setOCR3Config(env, ocrConfig, artefacts) return } - if ContractsAlreadyDeployed() { + if ContractsAlreadyDeployed(artefacts) { fmt.Println("Contracts already deployed") return } @@ -118,10 +136,10 @@ func deploy( jsonBytes, err := json.Marshal(contracts) PanicErr(err) - err = os.WriteFile(DeployedContractsFilePath(), jsonBytes, 0600) + err = os.WriteFile(DeployedContractsFilePath(artefacts), jsonBytes, 0600) PanicErr(err) - setOCR3Config(env, ocrConfig) + setOCR3Config(env, ocrConfig, artefacts) if skipFunding { fmt.Println("Skipping funding transmitters") @@ -139,8 +157,9 @@ func deploy( func setOCR3Config( env helpers.Environment, ocrConfig orc2drOracleConfig, + artefacts string, ) { - loadedContracts, err := LoadDeployedContracts() + loadedContracts, err := LoadDeployedContracts(artefacts) PanicErr(err) ocrContract, err := ocr3_capability.NewOCR3Capability(loadedContracts.OCRContract, env.Ec) @@ -161,16 +180,16 @@ func setOCR3Config( loadedContracts.SetConfigTxBlock = receipt.BlockNumber.Uint64() jsonBytes, err := json.Marshal(loadedContracts) PanicErr(err) - err = os.WriteFile(DeployedContractsFilePath(), jsonBytes, 0600) + err = os.WriteFile(DeployedContractsFilePath(artefacts), jsonBytes, 0600) PanicErr(err) } -func LoadDeployedContracts() (deployedContracts, error) { - if !ContractsAlreadyDeployed() { +func LoadDeployedContracts(artefacts string) (deployedContracts, error) { + if !ContractsAlreadyDeployed(artefacts) { return deployedContracts{}, fmt.Errorf("no deployed contracts found, run deploy first") } - jsonBytes, err := os.ReadFile(DeployedContractsFilePath()) + jsonBytes, err := os.ReadFile(DeployedContractsFilePath(artefacts)) if err != nil { return deployedContracts{}, err } @@ -180,13 +199,13 @@ func LoadDeployedContracts() (deployedContracts, error) { return contracts, err } -func ContractsAlreadyDeployed() bool { - _, err := os.Stat(DeployedContractsFilePath()) +func ContractsAlreadyDeployed(artefacts string) bool { + _, err := os.Stat(DeployedContractsFilePath(artefacts)) return err == nil } -func DeployedContractsFilePath() string { - return filepath.Join(artefactsDir, deployedContractsJSON) +func DeployedContractsFilePath(artefacts string) string { + return filepath.Join(artefacts, deployedContractsJSON) } func DeployForwarder(e helpers.Environment) *forwarder.KeystoneForwarder { diff --git a/core/scripts/keystone/src/02_deploy_jobspecs_cmd.go b/core/scripts/keystone/src/02_deploy_jobspecs_cmd.go index 5918650cf88..275943d6388 100644 --- a/core/scripts/keystone/src/02_deploy_jobspecs_cmd.go +++ b/core/scripts/keystone/src/02_deploy_jobspecs_cmd.go @@ -16,8 +16,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/cmd" ) -type deployJobSpecs struct { -} +type deployJobSpecs struct{} func NewDeployJobSpecsCommand() *deployJobSpecs { return &deployJobSpecs{} @@ -32,6 +31,11 @@ func (g *deployJobSpecs) Run(args []string) { chainID := fs.Int64("chainid", 11155111, "chain id") p2pPort := fs.Int64("p2pport", 6690, "p2p port") onlyReplay := fs.Bool("onlyreplay", false, "only replay the block from the OCR3 contract setConfig transaction") + templatesLocation := fs.String("templates", "", "Custom templates location") + nodeList := fs.String("nodes", "", "Custom node list location") + publicKeys := fs.String("publickeys", "", "Custom public keys json location") + artefactsDir := fs.String("artefacts", "", "Custom artefacts directory location") + err := fs.Parse(args) if err != nil || chainID == nil || *chainID == 0 || p2pPort == nil || *p2pPort == 0 || onlyReplay == nil { fs.Usage() @@ -43,12 +47,27 @@ func (g *deployJobSpecs) Run(args []string) { fmt.Println("Deploying OCR3 job specs") } - nodes := downloadNodeAPICredentialsDefault() - deployedContracts, err := LoadDeployedContracts() + if *artefactsDir == "" { + *artefactsDir = defaultArtefactsDir + } + if *publicKeys == "" { + *publicKeys = defaultPublicKeys + } + if *nodeList == "" { + *nodeList = defaultNodeList + } + if *templatesLocation == "" { + *templatesLocation = "templates" + } + + nodes := downloadNodeAPICredentials(*nodeList) + deployedContracts, err := LoadDeployedContracts(*artefactsDir) PanicErr(err) jobspecs := genSpecs( - ".cache/PublicKeys.json", ".cache/NodeList.txt", "templates", + *publicKeys, + *nodeList, + *templatesLocation, *chainID, *p2pPort, deployedContracts.OCRContract.Hex(), ) flattenedSpecs := []hostSpec{jobspecs.bootstrap} diff --git a/core/scripts/keystone/src/03_gen_crib_cluster_overrides_cmd.go b/core/scripts/keystone/src/03_gen_crib_cluster_overrides_cmd.go index cb3acf903b3..6b98951459e 100644 --- a/core/scripts/keystone/src/03_gen_crib_cluster_overrides_cmd.go +++ b/core/scripts/keystone/src/03_gen_crib_cluster_overrides_cmd.go @@ -9,8 +9,7 @@ import ( helpers "github.com/smartcontractkit/chainlink/core/scripts/common" ) -type generateCribClusterOverrides struct { -} +type generateCribClusterOverrides struct{} func NewGenerateCribClusterOverridesCommand() *generateCribClusterOverrides { return &generateCribClusterOverrides{} @@ -24,25 +23,39 @@ func (g *generateCribClusterOverrides) Run(args []string) { fs := flag.NewFlagSet(g.Name(), flag.ContinueOnError) chainID := fs.Int64("chainid", 11155111, "chain id") outputPath := fs.String("outpath", "../crib", "the path to output the generated overrides") + publicKeys := fs.String("publickeys", "", "Custom public keys json location") + nodeList := fs.String("nodes", "", "Custom node list location") + artefactsDir := fs.String("artefacts", "", "Custom artefacts directory location") - deployedContracts, err := LoadDeployedContracts() - helpers.PanicErr(err) templatesDir := "templates" - err = fs.Parse(args) + err := fs.Parse(args) if err != nil || outputPath == nil || *outputPath == "" || chainID == nil || *chainID == 0 { fs.Usage() os.Exit(1) } - lines := generateCribConfig(".cache/PublicKeys.json", chainID, templatesDir, deployedContracts.ForwarderContract.Hex()) + if *artefactsDir == "" { + *artefactsDir = defaultArtefactsDir + } + if *publicKeys == "" { + *publicKeys = defaultPublicKeys + } + if *nodeList == "" { + *nodeList = defaultNodeList + } + + deployedContracts, err := LoadDeployedContracts(*artefactsDir) + helpers.PanicErr(err) + + lines := generateCribConfig(*nodeList, *publicKeys, chainID, templatesDir, deployedContracts.ForwarderContract.Hex()) cribOverridesStr := strings.Join(lines, "\n") err = os.WriteFile(filepath.Join(*outputPath, "crib-cluster-overrides.yaml"), []byte(cribOverridesStr), 0600) helpers.PanicErr(err) } -func generateCribConfig(pubKeysPath string, chainID *int64, templatesDir string, forwarderAddress string) []string { - nca := downloadNodePubKeys(*chainID, pubKeysPath) +func generateCribConfig(nodeList string, pubKeysPath string, chainID *int64, templatesDir string, forwarderAddress string) []string { + nca := downloadNodePubKeys(nodeList, *chainID, pubKeysPath) nodeAddresses := []string{} for _, node := range nca[1:] { diff --git a/core/scripts/keystone/src/03_gen_crib_cluster_overrides_cmd_test.go b/core/scripts/keystone/src/03_gen_crib_cluster_overrides_cmd_test.go index 722b01e91c3..53d43c2342f 100644 --- a/core/scripts/keystone/src/03_gen_crib_cluster_overrides_cmd_test.go +++ b/core/scripts/keystone/src/03_gen_crib_cluster_overrides_cmd_test.go @@ -13,7 +13,7 @@ func TestGenerateCribConfig(t *testing.T) { forwarderAddress := "0x1234567890abcdef" publicKeysPath := "./testdata/PublicKeys.json" - lines := generateCribConfig(publicKeysPath, &chainID, templatesDir, forwarderAddress) + lines := generateCribConfig(defaultNodeList, publicKeysPath, &chainID, templatesDir, forwarderAddress) snaps.MatchSnapshot(t, strings.Join(lines, "\n")) } diff --git a/core/scripts/keystone/src/04_delete_ocr3_jobs_cmd.go b/core/scripts/keystone/src/04_delete_ocr3_jobs_cmd.go index 2ebed000ed4..136691962dd 100644 --- a/core/scripts/keystone/src/04_delete_ocr3_jobs_cmd.go +++ b/core/scripts/keystone/src/04_delete_ocr3_jobs_cmd.go @@ -5,14 +5,14 @@ import ( "encoding/json" "flag" "fmt" + "os" "github.com/urfave/cli" helpers "github.com/smartcontractkit/chainlink/core/scripts/common" ) -type deleteJobs struct { -} +type deleteJobs struct{} type OCRSpec struct { ContractID string @@ -22,11 +22,16 @@ type BootSpec struct { ContractID string } +type WorkflowSpec struct { + WorkflowID string +} + type JobSpec struct { Id string Name string BootstrapSpec BootSpec OffChainReporting2OracleSpec OCRSpec + WorkflowSpec WorkflowSpec } func NewDeleteJobsCommand() *deleteJobs { @@ -38,9 +43,26 @@ func (g *deleteJobs) Name() string { } func (g *deleteJobs) Run(args []string) { - deployedContracts, err := LoadDeployedContracts() + fs := flag.NewFlagSet(g.Name(), flag.ContinueOnError) + nodeList := fs.String("nodes", "", "Custom node list location") + artefactsDir := fs.String("artefacts", "", "Custom artefacts directory location") + + err := fs.Parse(args) + if err != nil { + fs.Usage() + os.Exit(1) + } + + if *artefactsDir == "" { + *artefactsDir = defaultArtefactsDir + } + if *nodeList == "" { + *nodeList = defaultNodeList + } + + deployedContracts, err := LoadDeployedContracts(*artefactsDir) helpers.PanicErr(err) - nodes := downloadNodeAPICredentialsDefault() + nodes := downloadNodeAPICredentials(*nodeList) for _, node := range nodes { output := &bytes.Buffer{} diff --git a/core/scripts/keystone/src/05_deploy_initialize_capabilities_registry.go b/core/scripts/keystone/src/05_deploy_initialize_capabilities_registry.go index 338a582a768..4ff92b62103 100644 --- a/core/scripts/keystone/src/05_deploy_initialize_capabilities_registry.go +++ b/core/scripts/keystone/src/05_deploy_initialize_capabilities_registry.go @@ -8,15 +8,20 @@ import ( "log" "os" "strings" + "time" "github.com/ethereum/go-ethereum/common" - ragetypes "github.com/smartcontractkit/libocr/ragep2p/types" "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/types/known/durationpb" + + ragetypes "github.com/smartcontractkit/libocr/ragep2p/types" + + capabilitiespb "github.com/smartcontractkit/chainlink-common/pkg/capabilities/pb" + "github.com/smartcontractkit/chainlink-common/pkg/values" "github.com/ethereum/go-ethereum/accounts/abi/bind" helpers "github.com/smartcontractkit/chainlink/core/scripts/common" - remotetypes "github.com/smartcontractkit/chainlink/v2/core/capabilities/remote/types" kcr "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/capabilities_registry" ) @@ -104,6 +109,29 @@ var ( Signer: "0x1a684B3d8f917fe496b7B1A8b29EDDAED64F649f", }, } + + aptosTargetDonPeers = []peer{ + { + PeerID: "12D3KooWNBr1AD3vD3dzSLgg1tK56qyJoenDx7EYNnZpbr1g4jD6", + Signer: "a41f9a561ff2266d94240996a76f9c2b3b7d8184", + }, + { + PeerID: "12D3KooWRRgWiZGw5GYsPa62CkwFNKJb5u4hWo4DinnvjG6GE6Nj", + Signer: "e4f3c7204776530fb7833db6f9dbfdb8bd0ec96892965324a71c20d6776f67f0", + }, + { + PeerID: "12D3KooWKwzgUHw5YbqUsYUVt3yiLSJcqc8ANofUtqHX6qTm7ox2", + Signer: "4071ea00e2e2c76b3406018ba9f66bf6b9aee3a6762e62ac823b1ee91ba7d7b0", + }, + { + PeerID: "12D3KooWBRux5o2bw1j3SQwEHzCspjkt7Xe3Y3agRUuab2SUnExj", + Signer: "6f5180c7d276876dbe413bf9b0efff7301d1367f39f4bac64180090cab70989b", + }, + { + PeerID: "12D3KooWFqvDaMSDGa6eMSTF9en6G2c3ZbGLmaA5Xs3AgxVBPb8B", + Signer: "dbce9a6df8a04d54e52a109d01ee9b5d32873b1d2436cf7b7fae61fd6eca46f8", + }, + } ) type deployAndInitializeCapabilitiesRegistryCommand struct{} @@ -162,6 +190,12 @@ func peerToNode(nopID uint32, p peer) (kcr.CapabilitiesRegistryNodeParams, error }, nil } +func newCapabilityConfig() *capabilitiespb.CapabilityConfig { + return &capabilitiespb.CapabilityConfig{ + DefaultConfig: values.Proto(values.EmptyMap()).GetMapValue(), + } +} + // Run expects the following environment variables to be set: // // 1. Deploys the CapabilitiesRegistry contract @@ -225,6 +259,16 @@ func (c *deployAndInitializeCapabilitiesRegistryCommand) Run(args []string) { log.Printf("failed to call GetHashedCapabilityId: %s", err) } + aptosWriteChain := kcr.CapabilitiesRegistryCapability{ + LabelledName: "write_aptos", + Version: "1.0.0", + CapabilityType: uint8(3), // target + } + awid, err := reg.GetHashedCapabilityId(&bind.CallOpts{}, aptosWriteChain.LabelledName, aptosWriteChain.Version) + if err != nil { + log.Printf("failed to call GetHashedCapabilityId: %s", err) + } + ocr := kcr.CapabilitiesRegistryCapability{ LabelledName: "offchain_reporting", Version: "1.0.0", @@ -238,6 +282,7 @@ func (c *deployAndInitializeCapabilitiesRegistryCommand) Run(args []string) { tx, err := reg.AddCapabilities(env.Owner, []kcr.CapabilitiesRegistryCapability{ streamsTrigger, writeChain, + aptosWriteChain, ocr, }) if err != nil { @@ -295,6 +340,16 @@ func (c *deployAndInitializeCapabilitiesRegistryCommand) Run(args []string) { nodes = append(nodes, n) } + for _, targetPeer := range aptosTargetDonPeers { + n, innerErr := peerToNode(nopID, targetPeer) + if innerErr != nil { + panic(innerErr) + } + + n.HashedCapabilityIds = [][32]byte{awid} + nodes = append(nodes, n) + } + tx, err = reg.AddNodes(env.Owner, nodes) if err != nil { log.Printf("failed to AddNodes: %s", err) @@ -308,9 +363,16 @@ func (c *deployAndInitializeCapabilitiesRegistryCommand) Run(args []string) { panic(err) } + cc := newCapabilityConfig() + ccb, err := proto.Marshal(cc) + if err != nil { + panic(err) + } + cfgs := []kcr.CapabilitiesRegistryCapabilityConfiguration{ { CapabilityId: ocrid, + Config: ccb, }, } _, err = reg.AddDON(env.Owner, ps, cfgs, true, true, 2) @@ -324,11 +386,16 @@ func (c *deployAndInitializeCapabilitiesRegistryCommand) Run(args []string) { panic(err) } - config := &remotetypes.RemoteTriggerConfig{ - RegistrationRefreshMs: 20000, - RegistrationExpiryMs: 60000, - // F + 1 - MinResponsesToAggregate: uint32(1) + 1, + config := &capabilitiespb.CapabilityConfig{ + DefaultConfig: values.Proto(values.EmptyMap()).GetMapValue(), + RemoteConfig: &capabilitiespb.CapabilityConfig_RemoteTriggerConfig{ + RemoteTriggerConfig: &capabilitiespb.RemoteTriggerConfig{ + RegistrationRefresh: durationpb.New(20 * time.Second), + RegistrationExpiry: durationpb.New(60 * time.Second), + // F + 1 + MinResponsesToAggregate: uint32(1) + 1, + }, + }, } configb, err := proto.Marshal(config) if err != nil { @@ -351,9 +418,51 @@ func (c *deployAndInitializeCapabilitiesRegistryCommand) Run(args []string) { panic(err) } + targetCapabilityConfig := newCapabilityConfig() + targetCapabilityConfig.RemoteConfig = &capabilitiespb.CapabilityConfig_RemoteTargetConfig{ + RemoteTargetConfig: &capabilitiespb.RemoteTargetConfig{ + RequestHashExcludedAttributes: []string{"signed_report.Signatures"}, + }, + } + + remoteTargetConfigBytes, err := proto.Marshal(targetCapabilityConfig) + if err != nil { + panic(err) + } + cfgs = []kcr.CapabilitiesRegistryCapabilityConfiguration{ { CapabilityId: wid, + Config: remoteTargetConfigBytes, + }, + } + _, err = reg.AddDON(env.Owner, ps, cfgs, true, false, 1) + if err != nil { + log.Printf("targetDON: failed to AddDON: %s", err) + } + + // Aptos target DON + ps, err = peers(aptosTargetDonPeers) + if err != nil { + panic(err) + } + + targetCapabilityConfig = newCapabilityConfig() + targetCapabilityConfig.RemoteConfig = &capabilitiespb.CapabilityConfig_RemoteTargetConfig{ + RemoteTargetConfig: &capabilitiespb.RemoteTargetConfig{ + RequestHashExcludedAttributes: []string{"signed_report.Signatures"}, + }, + } + + remoteTargetConfigBytes, err = proto.Marshal(targetCapabilityConfig) + if err != nil { + panic(err) + } + + cfgs = []kcr.CapabilitiesRegistryCapabilityConfiguration{ + { + CapabilityId: awid, + Config: remoteTargetConfigBytes, }, } _, err = reg.AddDON(env.Owner, ps, cfgs, true, false, 1) diff --git a/core/scripts/keystone/src/06_deploy_workflows_cmd.go b/core/scripts/keystone/src/06_deploy_workflows_cmd.go new file mode 100644 index 00000000000..0ca8e5d4a7b --- /dev/null +++ b/core/scripts/keystone/src/06_deploy_workflows_cmd.go @@ -0,0 +1,71 @@ +package src + +import ( + "bytes" + "errors" + "flag" + "fmt" + "os" + + "github.com/urfave/cli" + + helpers "github.com/smartcontractkit/chainlink/core/scripts/common" +) + +type deployWorkflows struct{} + +func NewDeployWorkflowsCommand() *deployWorkflows { + return &deployWorkflows{} +} + +func (g *deployWorkflows) Name() string { + return "deploy-workflows" +} + +func (g *deployWorkflows) Run(args []string) { + fs := flag.NewFlagSet(g.Name(), flag.ContinueOnError) + workflowFile := fs.String("workflow", "workflow.yml", "path to workflow file") + nodeList := fs.String("nodes", "", "Custom node list location") + err := fs.Parse(args) + if err != nil || workflowFile == nil || *workflowFile == "" { + fs.Usage() + os.Exit(1) + } + if *nodeList == "" { + *nodeList = defaultNodeList + } + fmt.Println("Deploying workflows") + + // use a separate list + nodes := downloadNodeAPICredentials(*nodeList) + + if _, err = os.Stat(*workflowFile); err != nil { + PanicErr(errors.New("toml file does not exist")) + } + + for i, n := range nodes { + if i == 0 { + continue // skip bootstrap node + } + output := &bytes.Buffer{} + client, app := newApp(n, output) + fmt.Println("Logging in:", n.url) + loginFs := flag.NewFlagSet("test", flag.ContinueOnError) + loginFs.Bool("bypass-version-check", true, "") + loginCtx := cli.NewContext(app, loginFs, nil) + err := client.RemoteLogin(loginCtx) + helpers.PanicErr(err) + output.Reset() + + fmt.Printf("Deploying workflow\n... \n") + fs := flag.NewFlagSet("test", flag.ExitOnError) + err = fs.Parse([]string{*workflowFile}) + + helpers.PanicErr(err) + err = client.CreateJob(cli.NewContext(app, fs, nil)) + if err != nil { + fmt.Println("Failed to deploy workflow:", "Error:", err) + } + output.Reset() + } +} diff --git a/core/scripts/keystone/src/07_delete_workflows_cmd.go b/core/scripts/keystone/src/07_delete_workflows_cmd.go new file mode 100644 index 00000000000..cccedaf9e70 --- /dev/null +++ b/core/scripts/keystone/src/07_delete_workflows_cmd.go @@ -0,0 +1,74 @@ +package src + +import ( + "bytes" + "encoding/json" + "flag" + "fmt" + "os" + + "github.com/urfave/cli" + + helpers "github.com/smartcontractkit/chainlink/core/scripts/common" +) + +type deleteWorkflows struct{} + +func NewDeleteWorkflowsCommand() *deleteWorkflows { + return &deleteWorkflows{} +} + +func (g *deleteWorkflows) Name() string { + return "delete-workflows" +} + +func (g *deleteWorkflows) Run(args []string) { + fs := flag.NewFlagSet(g.Name(), flag.ExitOnError) + nodeList := fs.String("nodes", "", "Custom node list location") + + err := fs.Parse(args) + if err != nil { + fs.Usage() + os.Exit(1) + } + + if *nodeList == "" { + *nodeList = defaultNodeList + } + + nodes := downloadNodeAPICredentials(*nodeList) + + for _, node := range nodes { + output := &bytes.Buffer{} + client, app := newApp(node, output) + + fmt.Println("Logging in:", node.url) + loginFs := flag.NewFlagSet("test", flag.ContinueOnError) + loginFs.Bool("bypass-version-check", true, "") + loginCtx := cli.NewContext(app, loginFs, nil) + err := client.RemoteLogin(loginCtx) + helpers.PanicErr(err) + output.Reset() + + fileFs := flag.NewFlagSet("test", flag.ExitOnError) + err = client.ListJobs(cli.NewContext(app, fileFs, nil)) + helpers.PanicErr(err) + + var parsed []JobSpec + err = json.Unmarshal(output.Bytes(), &parsed) + helpers.PanicErr(err) + + for _, jobSpec := range parsed { + if jobSpec.WorkflowSpec.WorkflowID != "" { + fmt.Println("Deleting workflow job ID:", jobSpec.Id, "name:", jobSpec.Name) + set := flag.NewFlagSet("test", flag.ExitOnError) + err = set.Parse([]string{jobSpec.Id}) + helpers.PanicErr(err) + err = client.DeleteJob(cli.NewContext(app, set, nil)) + helpers.PanicErr(err) + } + } + + output.Reset() + } +} diff --git a/core/scripts/keystone/src/88_gen_jobspecs.go b/core/scripts/keystone/src/88_gen_jobspecs.go index 6a9c911a5f5..39adcac2671 100644 --- a/core/scripts/keystone/src/88_gen_jobspecs.go +++ b/core/scripts/keystone/src/88_gen_jobspecs.go @@ -34,12 +34,12 @@ func genSpecs( ocrConfigContractAddress string, ) donHostSpec { nodes := downloadNodeAPICredentials(nodeListPath) - nca := downloadNodePubKeys(chainID, pubkeysPath) + nca := downloadNodePubKeys(nodeListPath, chainID, pubkeysPath) bootstrapNode := nca[0] bootstrapSpecLines, err := readLines(filepath.Join(templatesDir, bootstrapSpecTemplate)) helpers.PanicErr(err) - bootHost := nodes[0].url.Host + bootHost := nodes[0].remoteURL.Hostname() bootstrapSpecLines = replacePlaceholders( bootstrapSpecLines, chainID, p2pPort, @@ -59,7 +59,7 @@ func genSpecs( ocrConfigContractAddress, bootHost, bootstrapNode, nca[i], ) - oracles = append(oracles, hostSpec{oracleSpecLines, nodes[i].url.Host}) + oracles = append(oracles, hostSpec{oracleSpecLines, nodes[i].remoteURL.Host}) } return donHostSpec{ @@ -82,6 +82,7 @@ func replacePlaceholders( l = strings.Replace(l, "{{ ocr_config_contract_address }}", contractAddress, 1) l = strings.Replace(l, "{{ transmitter_id }}", node.EthAddress, 1) l = strings.Replace(l, "{{ ocr_key_bundle_id }}", node.OCR2BundleID, 1) + l = strings.Replace(l, "{{ aptos_key_bundle_id }}", node.AptosBundleID, 1) l = strings.Replace(l, "{{ bootstrapper_p2p_id }}", bootstrapper, 1) output = append(output, l) } diff --git a/core/scripts/keystone/src/88_gen_ocr3_config.go b/core/scripts/keystone/src/88_gen_ocr3_config.go index fe9241a2bde..f0a03ecafb3 100644 --- a/core/scripts/keystone/src/88_gen_ocr3_config.go +++ b/core/scripts/keystone/src/88_gen_ocr3_config.go @@ -4,6 +4,7 @@ import ( "crypto/ed25519" "encoding/hex" "encoding/json" + "fmt" "time" "github.com/ethereum/go-ethereum/common" @@ -13,6 +14,7 @@ import ( "github.com/smartcontractkit/libocr/offchainreporting2plus/types" helpers "github.com/smartcontractkit/chainlink/core/scripts/common" + "github.com/smartcontractkit/chainlink/v2/core/services/ocrcommon" "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm" ) @@ -46,17 +48,20 @@ type OracleConfigSource struct { } type NodeKeys struct { - EthAddress string - P2PPeerID string // p2p_ - OCR2BundleID string // used only in job spec - OCR2OnchainPublicKey string // ocr2on_evm_ - OCR2OffchainPublicKey string // ocr2off_evm_ - OCR2ConfigPublicKey string // ocr2cfg_evm_ - CSAPublicKey string + EthAddress string `json:"EthAddress"` + AptosAccount string `json:"AptosAccount"` + AptosBundleID string `json:"AptosBundleID"` + AptosOnchainPublicKey string `json:"AptosOnchainPublicKey"` + P2PPeerID string `json:"P2PPeerID"` // p2p_ + OCR2BundleID string `json:"OCR2BundleID"` // used only in job spec + OCR2OnchainPublicKey string `json:"OCR2OnchainPublicKey"` // ocr2on_evm_ + OCR2OffchainPublicKey string `json:"OCR2OffchainPublicKey"` // ocr2off_evm_ + OCR2ConfigPublicKey string `json:"OCR2ConfigPublicKey"` // ocr2cfg_evm_ + CSAPublicKey string `json:"CSAPublicKey"` } type orc2drOracleConfig struct { - Signers []common.Address + Signers [][]byte Transmitters []common.Address F uint8 OnchainConfig []byte @@ -82,7 +87,7 @@ func (c orc2drOracleConfig) MarshalJSON() ([]byte, error) { } for i, signer := range c.Signers { - alias.Signers[i] = signer.Hex() + alias.Signers[i] = hex.EncodeToString(signer) } for i, transmitter := range c.Transmitters { @@ -96,14 +101,37 @@ func mustReadConfig(fileName string) (output TopLevelConfigSource) { return mustParseJSON[TopLevelConfigSource](fileName) } -func generateOCR3Config(configFile string, chainID int64, pubKeysPath string) orc2drOracleConfig { +func generateOCR3Config(nodeList string, configFile string, chainID int64, pubKeysPath string) orc2drOracleConfig { topLevelCfg := mustReadConfig(configFile) cfg := topLevelCfg.OracleConfig - nca := downloadNodePubKeys(chainID, pubKeysPath) + nca := downloadNodePubKeys(nodeList, chainID, pubKeysPath) - onchainPubKeys := []common.Address{} + onchainPubKeys := [][]byte{} + allPubKeys := map[string]any{} for _, n := range nca { - onchainPubKeys = append(onchainPubKeys, common.HexToAddress(n.OCR2OnchainPublicKey)) + ethPubKey := common.HexToAddress(n.OCR2OnchainPublicKey) + aptosPubKey, err := hex.DecodeString(n.AptosOnchainPublicKey) + if err != nil { + panic(err) + } + pubKeys := map[string]types.OnchainPublicKey{ + "evm": ethPubKey[:], + "aptos": aptosPubKey, + } + // validate uniqueness of each individual key + for _, key := range pubKeys { + raw := hex.EncodeToString(key) + _, exists := allPubKeys[raw] + if exists { + panic(fmt.Sprintf("Duplicate onchain public key: %v", raw)) + } + allPubKeys[raw] = struct{}{} + } + pubKey, err := ocrcommon.MarshalMultichainPublicKey(pubKeys) + if err != nil { + panic(err) + } + onchainPubKeys = append(onchainPubKeys, pubKey) } offchainPubKeysBytes := []types.OffchainPublicKey{} @@ -170,13 +198,16 @@ func generateOCR3Config(configFile string, chainID int64, pubKeysPath string) or ) helpers.PanicErr(err) - signerAddresses, err := evm.OnchainPublicKeyToAddress(signers) - PanicErr(err) + var configSigners [][]byte + for _, signer := range signers { + configSigners = append(configSigners, signer) + } + transmitterAddresses, err := evm.AccountToAddress(transmitters) PanicErr(err) config := orc2drOracleConfig{ - Signers: signerAddresses, + Signers: configSigners, Transmitters: transmitterAddresses, F: f, OnchainConfig: onchainConfig, diff --git a/core/scripts/keystone/src/88_gen_ocr3_config_test.go b/core/scripts/keystone/src/88_gen_ocr3_config_test.go index 185354ec2fe..10cdc07b204 100644 --- a/core/scripts/keystone/src/88_gen_ocr3_config_test.go +++ b/core/scripts/keystone/src/88_gen_ocr3_config_test.go @@ -10,7 +10,7 @@ import ( func TestGenerateOCR3Config(t *testing.T) { // Generate OCR3 config - config := generateOCR3Config("./testdata/SampleConfig.json", 11155111, "./testdata/PublicKeys.json") + config := generateOCR3Config(".cache/NodeList.txt", "./testdata/SampleConfig.json", 11155111, "./testdata/PublicKeys.json") matchOffchainConfig := match.Custom("OffchainConfig", func(s any) (any, error) { // coerce the value to a string diff --git a/core/scripts/keystone/src/99_fetch_keys.go b/core/scripts/keystone/src/99_fetch_keys.go index 4fcb6f138a7..91750f7422d 100644 --- a/core/scripts/keystone/src/99_fetch_keys.go +++ b/core/scripts/keystone/src/99_fetch_keys.go @@ -14,17 +14,18 @@ import ( helpers "github.com/smartcontractkit/chainlink/core/scripts/common" ubig "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils/big" + "github.com/smartcontractkit/chainlink/v2/core/cmd" "github.com/smartcontractkit/chainlink/v2/core/web/presenters" ) -func downloadNodePubKeys(chainID int64, pubKeysPath string) []NodeKeys { +func downloadNodePubKeys(nodeList string, chainID int64, pubKeysPath string) []NodeKeys { // Check if file exists already, and if so, return the keys if _, err := os.Stat(pubKeysPath); err == nil { fmt.Println("Loading existing public keys at:", pubKeysPath) return mustParseJSON[[]NodeKeys](pubKeysPath) } - nodes := downloadNodeAPICredentialsDefault() + nodes := downloadNodeAPICredentials(nodeList) nodesKeys := mustFetchNodesKeys(chainID, nodes) marshalledNodeKeys, err := json.MarshalIndent(nodesKeys, "", " ") @@ -40,13 +41,6 @@ func downloadNodePubKeys(chainID int64, pubKeysPath string) []NodeKeys { return nodesKeys } -// downloadNodeAPICredentialsDefault downloads the node API credentials, or loads them from disk if they already exist -// -// The nodes are sorted by URL. In the case of crib, the bootstrap node is the first node in the list. -func downloadNodeAPICredentialsDefault() []*node { - return downloadNodeAPICredentials(".cache/NodeList.txt") -} - // downloadNodeAPICredentials downloads the node API credentials, or loads them from disk if they already exist // // The nodes are sorted by URL. In the case of crib, the bootstrap node is the first node in the list. @@ -125,6 +119,19 @@ func mustFetchNodesKeys(chainID int64, nodes []*node) (nca []NodeKeys) { helpers.PanicErr(err) output.Reset() + keysClient := cmd.NewAptosKeysClient(client) + err = keysClient.ListKeys(&cli.Context{ + App: app, + }) + helpers.PanicErr(err) + var aptosKeys []presenters.AptosKeyResource + helpers.PanicErr(json.Unmarshal(output.Bytes(), &aptosKeys)) + if len(aptosKeys) != 1 { + helpers.PanicErr(errors.New("node must have single aptos key")) + } + aptosAccount := aptosKeys[0].Account + output.Reset() + err = client.ListP2PKeys(&cli.Context{ App: app, }) @@ -137,18 +144,20 @@ func mustFetchNodesKeys(chainID int64, nodes []*node) (nca []NodeKeys) { peerID := strings.TrimPrefix(p2pKeys[0].PeerID, "p2p_") output.Reset() + chainType := "evm" + var ocr2Bundles []ocr2Bundle err = client.ListOCR2KeyBundles(&cli.Context{ App: app, }) helpers.PanicErr(err) helpers.PanicErr(json.Unmarshal(output.Bytes(), &ocr2Bundles)) - ocr2BundleIndex := findEvmOCR2Bundle(ocr2Bundles) + ocr2BundleIndex := findOCR2Bundle(ocr2Bundles, chainType) output.Reset() if ocr2BundleIndex == -1 { fmt.Println("WARN: node does not have EVM OCR2 bundle, creating one") fs := flag.NewFlagSet("test", flag.ContinueOnError) - err = fs.Parse([]string{"evm"}) + err = fs.Parse([]string{chainType}) helpers.PanicErr(err) ocr2CreateBundleCtx := cli.NewContext(app, fs, nil) err = client.CreateOCR2KeyBundle(ocr2CreateBundleCtx) @@ -160,12 +169,35 @@ func mustFetchNodesKeys(chainID int64, nodes []*node) (nca []NodeKeys) { }) helpers.PanicErr(err) helpers.PanicErr(json.Unmarshal(output.Bytes(), &ocr2Bundles)) - ocr2BundleIndex = findEvmOCR2Bundle(ocr2Bundles) + ocr2BundleIndex = findOCR2Bundle(ocr2Bundles, chainType) output.Reset() } ocr2Bndl := ocr2Bundles[ocr2BundleIndex] + aptosBundleIndex := findOCR2Bundle(ocr2Bundles, "aptos") + if aptosBundleIndex == -1 { + chainType2 := "aptos" + fmt.Println("WARN: node does not have Aptos OCR2 bundle, creating one") + fs := flag.NewFlagSet("test", flag.ContinueOnError) + err = fs.Parse([]string{chainType2}) + helpers.PanicErr(err) + ocr2CreateBundleCtx := cli.NewContext(app, fs, nil) + err = client.CreateOCR2KeyBundle(ocr2CreateBundleCtx) + helpers.PanicErr(err) + output.Reset() + + err = client.ListOCR2KeyBundles(&cli.Context{ + App: app, + }) + helpers.PanicErr(err) + helpers.PanicErr(json.Unmarshal(output.Bytes(), &ocr2Bundles)) + aptosBundleIndex = findOCR2Bundle(ocr2Bundles, chainType2) + output.Reset() + } + + aptosBundle := ocr2Bundles[aptosBundleIndex] + err = client.ListCSAKeys(&cli.Context{ App: app, }) @@ -178,11 +210,14 @@ func mustFetchNodesKeys(chainID int64, nodes []*node) (nca []NodeKeys) { nc := NodeKeys{ EthAddress: ethAddress, + AptosAccount: aptosAccount, P2PPeerID: peerID, + AptosBundleID: aptosBundle.ID, + AptosOnchainPublicKey: strings.TrimPrefix(aptosBundle.OnchainPublicKey, fmt.Sprintf("ocr2on_%s_", "aptos")), OCR2BundleID: ocr2Bndl.ID, - OCR2ConfigPublicKey: strings.TrimPrefix(ocr2Bndl.ConfigPublicKey, "ocr2cfg_evm_"), - OCR2OnchainPublicKey: strings.TrimPrefix(ocr2Bndl.OnchainPublicKey, "ocr2on_evm_"), - OCR2OffchainPublicKey: strings.TrimPrefix(ocr2Bndl.OffchainPublicKey, "ocr2off_evm_"), + OCR2ConfigPublicKey: strings.TrimPrefix(ocr2Bndl.ConfigPublicKey, fmt.Sprintf("ocr2cfg_%s_", chainType)), + OCR2OnchainPublicKey: strings.TrimPrefix(ocr2Bndl.OnchainPublicKey, fmt.Sprintf("ocr2on_%s_", chainType)), + OCR2OffchainPublicKey: strings.TrimPrefix(ocr2Bndl.OffchainPublicKey, fmt.Sprintf("ocr2off_%s_", chainType)), CSAPublicKey: csaPubKey, } @@ -198,9 +233,9 @@ func findFirstCSAPublicKey(csaKeyResources []presenters.CSAKeyResource) (string, return "", errors.New("did not find any CSA Key Resources") } -func findEvmOCR2Bundle(ocr2Bundles []ocr2Bundle) int { +func findOCR2Bundle(ocr2Bundles []ocr2Bundle, chainType string) int { for i, b := range ocr2Bundles { - if b.ChainType == "evm" { + if b.ChainType == chainType { return i } } diff --git a/core/scripts/keystone/src/99_files.go b/core/scripts/keystone/src/99_files.go index d334b0fd56c..08ba12e4194 100644 --- a/core/scripts/keystone/src/99_files.go +++ b/core/scripts/keystone/src/99_files.go @@ -11,7 +11,9 @@ import ( ) const ( - artefactsDir = "artefacts" + defaultArtefactsDir = "artefacts" + defaultPublicKeys = ".cache/PublicKeys.json" + defaultNodeList = ".cache/NodeList.txt" deployedContractsJSON = "deployed_contracts.json" bootstrapSpecTemplate = "bootstrap.toml" cribOverrideTemplate = "crib-overrides.yaml" diff --git a/core/scripts/keystone/src/99_nodes.go b/core/scripts/keystone/src/99_nodes.go index 961d58c4b19..68d3621ce63 100644 --- a/core/scripts/keystone/src/99_nodes.go +++ b/core/scripts/keystone/src/99_nodes.go @@ -10,9 +10,10 @@ import ( ) type node struct { - url *url.URL - login string - password string + url *url.URL + remoteURL *url.URL + login string + password string } func (n node) IsTerminal() bool { @@ -50,7 +51,7 @@ func mustReadNodesList(path string) []*node { continue } s := strings.Split(rr, " ") - if len(s) != 3 { + if len(s) != 4 { helpers.PanicErr(errors.New("wrong nodes list format")) } if strings.Contains(s[0], "boot") && hasBoot { @@ -58,11 +59,13 @@ func mustReadNodesList(path string) []*node { } hasBoot = true url, err := url.Parse(s[0]) + remoteURL, err := url.Parse(s[1]) helpers.PanicErr(err) nodes = append(nodes, &node{ - url: url, - login: s[1], - password: s[2], + url: url, + remoteURL: remoteURL, + login: s[2], + password: s[3], }) } return nodes diff --git a/core/scripts/keystone/src/__snapshots__/88_gen_jobspecs_test.snap b/core/scripts/keystone/src/__snapshots__/88_gen_jobspecs_test.snap index 1ee7f678945..c0c7c7d7e67 100755 --- a/core/scripts/keystone/src/__snapshots__/88_gen_jobspecs_test.snap +++ b/core/scripts/keystone/src/__snapshots__/88_gen_jobspecs_test.snap @@ -10,6 +10,7 @@ relay = "evm" [relayConfig] chainID = "11155111" +providerType = "ocr3-capability" Oracles: Oracle 0: @@ -33,13 +34,14 @@ chainID = "11155111" command = "chainlink-ocr3-capability" ocrVersion = 3 pluginName = "ocr-capability" -providerType = "plugin" +providerType = "ocr3-capability" telemetryType = "plugin" [onchainSigningStrategy] -strategyName = 'single-chain' +strategyName = 'multi-chain' [onchainSigningStrategy.config] -publicKey = '8fa807463ad73f9ee855cfd60ba406dcf98a2855b3dd8af613107b0f6890a707' +evm = "b3df4d8748b67731a1112e8b45a764941974f5590c93672eebbc4f3504dd10ed" +aptos = "9bebfa953e7a7522746f72b4023308de36db626f3e0bcb9033407b8a183e8bfb" -------------------------------- Oracle 1: @@ -63,13 +65,14 @@ chainID = "11155111" command = "chainlink-ocr3-capability" ocrVersion = 3 pluginName = "ocr-capability" -providerType = "plugin" +providerType = "ocr3-capability" telemetryType = "plugin" [onchainSigningStrategy] -strategyName = 'single-chain' +strategyName = 'multi-chain' [onchainSigningStrategy.config] -publicKey = '8fa807463ad73f9ee855cfd60ba406dcf98a2855b3dd8af613107b0f6890a707' +evm = "38459ae37f29f2c1fde0f25972a973322be8cada82acf43f464756836725be97" +aptos = "9bebfa953e7a7522746f72b4023308de36db626f3e0bcb9033407b8a183e8bfc" -------------------------------- Oracle 2: @@ -93,13 +96,14 @@ chainID = "11155111" command = "chainlink-ocr3-capability" ocrVersion = 3 pluginName = "ocr-capability" -providerType = "plugin" +providerType = "ocr3-capability" telemetryType = "plugin" [onchainSigningStrategy] -strategyName = 'single-chain' +strategyName = 'multi-chain' [onchainSigningStrategy.config] -publicKey = '8fa807463ad73f9ee855cfd60ba406dcf98a2855b3dd8af613107b0f6890a707' +evm = "b5dbc4c9da983cddde2e3226b85807eb7beaf818694a22576af4d80f352702ed" +aptos = "9bebfa953e7a7522746f72b4023308de36db626f3e0bcb9033407b8a183e8bfd" -------------------------------- Oracle 3: @@ -123,13 +127,14 @@ chainID = "11155111" command = "chainlink-ocr3-capability" ocrVersion = 3 pluginName = "ocr-capability" -providerType = "plugin" +providerType = "ocr3-capability" telemetryType = "plugin" [onchainSigningStrategy] -strategyName = 'single-chain' +strategyName = 'multi-chain' [onchainSigningStrategy.config] -publicKey = '8fa807463ad73f9ee855cfd60ba406dcf98a2855b3dd8af613107b0f6890a707' +evm = "260d5c1a618cdf5324509d7db95f5a117511864ebb9e1f709e8969339eb225af" +aptos = "9bebfa953e7a7522746f72b4023308de36db626f3e0bcb9033407b8a183e8bfe" --- diff --git a/core/scripts/keystone/src/__snapshots__/88_gen_ocr3_config_test.snap b/core/scripts/keystone/src/__snapshots__/88_gen_ocr3_config_test.snap index a2ecd236f74..eac3cdaff4c 100755 --- a/core/scripts/keystone/src/__snapshots__/88_gen_ocr3_config_test.snap +++ b/core/scripts/keystone/src/__snapshots__/88_gen_ocr3_config_test.snap @@ -6,11 +6,11 @@ "OffchainConfigVersion": 30, "OnchainConfig": "0x", "Signers": [ - "0xA2402db8E549f094EA31e1C0EDd77623F4cA5b12", - "0x4af19c802B244D1d085492C3946391C965E10519", - "0x61925685d2B80b121537341d063c4E57B2F9323c", - "0xFd97eFD53FC20acc098Fcd746C04d8d7540D97E0", - "0xA0b67Dc5345a71D02B396147AE2cb75dDA63CbE9" + "011400a2402db8e549f094ea31e1c0edd77623f4ca5b12052000ea551e503b93a1c9ae26262b4db8f66db4cbe5ddcb6039e29d2665a634d48e4a", + "0114004af19c802b244d1d085492c3946391c965e10519052000ea551e503b93a1c9ae26262b4db8f66db4cbe5ddcb6039e29d2665a634d48e4b", + "01140061925685d2b80b121537341d063c4e57b2f9323c052000ea551e503b93a1c9ae26262b4db8f66db4cbe5ddcb6039e29d2665a634d48e4c", + "011400fd97efd53fc20acc098fcd746c04d8d7540d97e0052000ea551e503b93a1c9ae26262b4db8f66db4cbe5ddcb6039e29d2665a634d48e4d", + "011400a0b67dc5345a71d02b396147ae2cb75dda63cbe9052000ea551e503b93a1c9ae26262b4db8f66db4cbe5ddcb6039e29d2665a634d48e4e" ], "Transmitters": [ "0xF4e7e516146c8567F8E8be0ED1f1A92798628d35", diff --git a/core/scripts/keystone/src/testdata/NodeList.txt b/core/scripts/keystone/src/testdata/NodeList.txt index 9a895e0f3fa..6fb65dded69 100644 --- a/core/scripts/keystone/src/testdata/NodeList.txt +++ b/core/scripts/keystone/src/testdata/NodeList.txt @@ -1,5 +1,5 @@ -https://crib-henry-keystone-node1.main.stage.cldev.sh notreal@fakeemail.ch fj293fbBnlQ!f9vNs -https://crib-henry-keystone-node2.main.stage.cldev.sh notreal@fakeemail.ch fj293fbBnlQ!f9vNs -https://crib-henry-keystone-node3.main.stage.cldev.sh notreal@fakeemail.ch fj293fbBnlQ!f9vNs -https://crib-henry-keystone-node4.main.stage.cldev.sh notreal@fakeemail.ch fj293fbBnlQ!f9vNs -https://crib-henry-keystone-node5.main.stage.cldev.sh notreal@fakeemail.ch fj293fbBnlQ!f9vNs +https://local-node1 https://crib-henry-keystone-node1.main.stage.cldev.sh notreal@fakeemail.ch fj293fbBnlQ!f9vNs +https://local-node2 https://crib-henry-keystone-node2.main.stage.cldev.sh notreal@fakeemail.ch fj293fbBnlQ!f9vNs +https://local-node3 https://crib-henry-keystone-node3.main.stage.cldev.sh notreal@fakeemail.ch fj293fbBnlQ!f9vNs +https://local-node4 https://crib-henry-keystone-node4.main.stage.cldev.sh notreal@fakeemail.ch fj293fbBnlQ!f9vNs +https://local-node5 https://crib-henry-keystone-node5.main.stage.cldev.sh notreal@fakeemail.ch fj293fbBnlQ!f9vNs diff --git a/core/scripts/keystone/src/testdata/PublicKeys.json b/core/scripts/keystone/src/testdata/PublicKeys.json index 7ade3d45ad3..b29e8290895 100644 --- a/core/scripts/keystone/src/testdata/PublicKeys.json +++ b/core/scripts/keystone/src/testdata/PublicKeys.json @@ -1,5 +1,7 @@ [ { + "AptosBundleID": "9bebfa953e7a7522746f72b4023308de36db626f3e0bcb9033407b8a183e8bfa", + "AptosOnchainPublicKey": "ea551e503b93a1c9ae26262b4db8f66db4cbe5ddcb6039e29d2665a634d48e4a", "EthAddress": "0xF4e7e516146c8567F8E8be0ED1f1A92798628d35", "P2PPeerID": "12D3KooWNmhKZL1XW4Vv3rNjLXzJ6mqcVerihdijjGYuexPrFUFZ", "OCR2BundleID": "2f92c96da20fbe39c89e59516e3a7473254523316887394e406527c72071d3db", @@ -9,6 +11,8 @@ "CSAPublicKey": "csa_dbae6965bad0b0fa95ecc34a602eee1c0c570ddc29b56502e400d18574b8c3df" }, { + "AptosBundleID": "9bebfa953e7a7522746f72b4023308de36db626f3e0bcb9033407b8a183e8bfb", + "AptosOnchainPublicKey": "ea551e503b93a1c9ae26262b4db8f66db4cbe5ddcb6039e29d2665a634d48e4b", "EthAddress": "0x8B60FDcc9CAC8ea476b31d17011CB204471431d9", "P2PPeerID": "12D3KooWFUjV73ZYkAMhS2cVwte3kXDWD8Ybyx3u9CEDHNoeEhBH", "OCR2BundleID": "b3df4d8748b67731a1112e8b45a764941974f5590c93672eebbc4f3504dd10ed", @@ -18,6 +22,8 @@ "CSAPublicKey": "csa_c5cc655a9c19b69626519c4a72c44a94a3675daeba9c16cc23e010a7a6dac1be" }, { + "AptosBundleID": "9bebfa953e7a7522746f72b4023308de36db626f3e0bcb9033407b8a183e8bfc", + "AptosOnchainPublicKey": "ea551e503b93a1c9ae26262b4db8f66db4cbe5ddcb6039e29d2665a634d48e4c", "EthAddress": "0x6620F516F29979B214e2451498a057FDd3a0A85d", "P2PPeerID": "12D3KooWRTtH2WWrztD87Do1kXePSmGjyU4r7mZVWThmqTGgdbUC", "OCR2BundleID": "38459ae37f29f2c1fde0f25972a973322be8cada82acf43f464756836725be97", @@ -27,6 +33,8 @@ "CSAPublicKey": "csa_7407fc90c70895c0fb2bdf385e2e4918364bec1f7a74bad7fdf696bffafbcab8" }, { + "AptosBundleID": "9bebfa953e7a7522746f72b4023308de36db626f3e0bcb9033407b8a183e8bfd", + "AptosOnchainPublicKey": "ea551e503b93a1c9ae26262b4db8f66db4cbe5ddcb6039e29d2665a634d48e4d", "EthAddress": "0xFeB61E22FCf4F9740c9D96b05199F195bd61A7c2", "P2PPeerID": "12D3KooWMTZnZtcVK4EJsjkKsV9qXNoNRSjT62CZi3tKkXGaCsGh", "OCR2BundleID": "b5dbc4c9da983cddde2e3226b85807eb7beaf818694a22576af4d80f352702ed", @@ -36,6 +44,8 @@ "CSAPublicKey": "csa_ef55caf17eefc2a9d547b5a3978d396bd237c73af99cd849a4758701122e3cba" }, { + "AptosBundleID": "9bebfa953e7a7522746f72b4023308de36db626f3e0bcb9033407b8a183e8bfe", + "AptosOnchainPublicKey": "ea551e503b93a1c9ae26262b4db8f66db4cbe5ddcb6039e29d2665a634d48e4e", "EthAddress": "0x882Fd04D78A7e7D386Dd5b550f19479E5494B0B2", "P2PPeerID": "12D3KooWRsM9yordRQDhLgbErH8WMMGz1bC1J4hR5gAGvMWu8goN", "OCR2BundleID": "260d5c1a618cdf5324509d7db95f5a117511864ebb9e1f709e8969339eb225af", diff --git a/core/scripts/keystone/templates/bootstrap.toml b/core/scripts/keystone/templates/bootstrap.toml index 1baa43101b6..cdd9065caba 100644 --- a/core/scripts/keystone/templates/bootstrap.toml +++ b/core/scripts/keystone/templates/bootstrap.toml @@ -6,3 +6,4 @@ relay = "evm" [relayConfig] chainID = "{{ chain_id }}" +providerType = "ocr3-capability" diff --git a/core/scripts/keystone/templates/oracle.toml b/core/scripts/keystone/templates/oracle.toml index f2ff87de923..053baa2223b 100644 --- a/core/scripts/keystone/templates/oracle.toml +++ b/core/scripts/keystone/templates/oracle.toml @@ -17,10 +17,11 @@ chainID = "{{ chain_id }}" command = "chainlink-ocr3-capability" ocrVersion = 3 pluginName = "ocr-capability" -providerType = "plugin" +providerType = "ocr3-capability" telemetryType = "plugin" [onchainSigningStrategy] -strategyName = 'single-chain' +strategyName = 'multi-chain' [onchainSigningStrategy.config] -publicKey = '8fa807463ad73f9ee855cfd60ba406dcf98a2855b3dd8af613107b0f6890a707' +evm = "{{ ocr_key_bundle_id }}" +aptos = "{{ aptos_key_bundle_id }}" diff --git a/core/scripts/vrfv2plus/testnet/main.go b/core/scripts/vrfv2plus/testnet/main.go index a37a5391021..f5220f62dd2 100644 --- a/core/scripts/vrfv2plus/testnet/main.go +++ b/core/scripts/vrfv2plus/testnet/main.go @@ -213,7 +213,7 @@ func main() { for i := range preSeedSlice { ps, err := proof.BigToSeed(preSeedSlice[i]) helpers.PanicErr(err) - extraArgs, err := extraargs.ExtraArgsV1(*nativePayment) + extraArgs, err := extraargs.EncodeV1(*nativePayment) helpers.PanicErr(err) preSeedData := proof.PreSeedDataV2Plus{ PreSeed: ps, @@ -308,7 +308,7 @@ func main() { helpers.PanicErr(err) parsedSubID := parseUInt256String(*subID) - extraArgs, err := extraargs.ExtraArgsV1(*nativePayment) + extraArgs, err := extraargs.EncodeV1(*nativePayment) helpers.PanicErr(err) preSeedData := proof.PreSeedDataV2Plus{ PreSeed: ps, diff --git a/core/scripts/vrfv2plus/testnet/proofs.go b/core/scripts/vrfv2plus/testnet/proofs.go index 23ddc8ecfd6..8f1cef0ca6c 100644 --- a/core/scripts/vrfv2plus/testnet/proofs.go +++ b/core/scripts/vrfv2plus/testnet/proofs.go @@ -54,7 +54,7 @@ var rcTemplate = `{ ` func generateProofForV2Plus(e helpers.Environment) { - deployCmd := flag.NewFlagSet("generate-proof", flag.ExitOnError) + deployCmd := flag.NewFlagSet("generate-proof-v2-plus", flag.ExitOnError) keyHashString := deployCmd.String("key-hash", "", "key hash for VRF request") preSeedString := deployCmd.String("pre-seed", "", "pre-seed for VRF request") @@ -105,7 +105,7 @@ func generateProofForV2Plus(e helpers.Environment) { if !ok { helpers.PanicErr(fmt.Errorf("unable to parse subID: %s %w", *subId, err)) } - extraArgs, err := extraargs.ExtraArgsV1(*nativePayment) + extraArgs, err := extraargs.EncodeV1(*nativePayment) helpers.PanicErr(err) preSeedData := proof.PreSeedDataV2Plus{ PreSeed: preSeed, diff --git a/core/services/blockhashstore/common.go b/core/services/blockhashstore/common.go index 30208296a4f..037802becf9 100644 --- a/core/services/blockhashstore/common.go +++ b/core/services/blockhashstore/common.go @@ -33,8 +33,6 @@ type Event struct { } // BHS defines an interface for interacting with a BlockhashStore contract. -// -//go:generate mockery --quiet --name BHS --output ./mocks/ --case=underscore type BHS interface { // Store the hash associated with blockNum. Store(ctx context.Context, blockNum uint64) error diff --git a/core/services/blockhashstore/feeder.go b/core/services/blockhashstore/feeder.go index 8cc607db9b3..e5367cba697 100644 --- a/core/services/blockhashstore/feeder.go +++ b/core/services/blockhashstore/feeder.go @@ -72,7 +72,6 @@ type Feeder struct { errsLock sync.Mutex } -//go:generate mockery --quiet --name Timer --output ./mocks/ --case=underscore type Timer interface { After(d time.Duration) <-chan time.Time } diff --git a/core/services/blockhashstore/feeder_test.go b/core/services/blockhashstore/feeder_test.go index 945359dd81f..9f7a64500fd 100644 --- a/core/services/blockhashstore/feeder_test.go +++ b/core/services/blockhashstore/feeder_test.go @@ -27,7 +27,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_coordinator_v2plus_interface" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/logger" - loggermocks "github.com/smartcontractkit/chainlink/v2/core/logger/mocks" ) const ( @@ -230,7 +229,7 @@ func TestStartHeartbeats(t *testing.T) { t.Run("bhs_heartbeat_happy_path", func(t *testing.T) { expectedDuration := 600 * time.Second mockBHS := bhsmocks.NewBHS(t) - mockLogger := loggermocks.NewLogger(t) + mockLogger := logger.NewMockLogger(t) feeder := NewFeeder( mockLogger, &TestCoordinator{}, // Not used for this test @@ -275,7 +274,7 @@ func TestStartHeartbeats(t *testing.T) { expectedDuration := 600 * time.Second expectedError := fmt.Errorf("insufficient gas") mockBHS := bhsmocks.NewBHS(t) - mockLogger := loggermocks.NewLogger(t) + mockLogger := logger.NewMockLogger(t) feeder := NewFeeder( mockLogger, &TestCoordinator{}, // Not used for this test @@ -322,7 +321,7 @@ func TestStartHeartbeats(t *testing.T) { t.Run("bhs_heartbeat_sad_path_heartbeat_0", func(t *testing.T) { expectedDuration := 0 * time.Second mockBHS := bhsmocks.NewBHS(t) - mockLogger := loggermocks.NewLogger(t) + mockLogger := logger.NewMockLogger(t) feeder := NewFeeder( mockLogger, &TestCoordinator{}, // Not used for this test diff --git a/core/services/blockhashstore/mocks/bhs.go b/core/services/blockhashstore/mocks/bhs.go index 40b73aba0db..eff827d0597 100644 --- a/core/services/blockhashstore/mocks/bhs.go +++ b/core/services/blockhashstore/mocks/bhs.go @@ -15,6 +15,14 @@ type BHS struct { mock.Mock } +type BHS_Expecter struct { + mock *mock.Mock +} + +func (_m *BHS) EXPECT() *BHS_Expecter { + return &BHS_Expecter{mock: &_m.Mock} +} + // IsStored provides a mock function with given fields: ctx, blockNum func (_m *BHS) IsStored(ctx context.Context, blockNum uint64) (bool, error) { ret := _m.Called(ctx, blockNum) @@ -43,6 +51,35 @@ func (_m *BHS) IsStored(ctx context.Context, blockNum uint64) (bool, error) { return r0, r1 } +// BHS_IsStored_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsStored' +type BHS_IsStored_Call struct { + *mock.Call +} + +// IsStored is a helper method to define mock.On call +// - ctx context.Context +// - blockNum uint64 +func (_e *BHS_Expecter) IsStored(ctx interface{}, blockNum interface{}) *BHS_IsStored_Call { + return &BHS_IsStored_Call{Call: _e.mock.On("IsStored", ctx, blockNum)} +} + +func (_c *BHS_IsStored_Call) Run(run func(ctx context.Context, blockNum uint64)) *BHS_IsStored_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(uint64)) + }) + return _c +} + +func (_c *BHS_IsStored_Call) Return(_a0 bool, _a1 error) *BHS_IsStored_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *BHS_IsStored_Call) RunAndReturn(run func(context.Context, uint64) (bool, error)) *BHS_IsStored_Call { + _c.Call.Return(run) + return _c +} + // IsTrusted provides a mock function with given fields: func (_m *BHS) IsTrusted() bool { ret := _m.Called() @@ -61,6 +98,33 @@ func (_m *BHS) IsTrusted() bool { return r0 } +// BHS_IsTrusted_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsTrusted' +type BHS_IsTrusted_Call struct { + *mock.Call +} + +// IsTrusted is a helper method to define mock.On call +func (_e *BHS_Expecter) IsTrusted() *BHS_IsTrusted_Call { + return &BHS_IsTrusted_Call{Call: _e.mock.On("IsTrusted")} +} + +func (_c *BHS_IsTrusted_Call) Run(run func()) *BHS_IsTrusted_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *BHS_IsTrusted_Call) Return(_a0 bool) *BHS_IsTrusted_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *BHS_IsTrusted_Call) RunAndReturn(run func() bool) *BHS_IsTrusted_Call { + _c.Call.Return(run) + return _c +} + // Store provides a mock function with given fields: ctx, blockNum func (_m *BHS) Store(ctx context.Context, blockNum uint64) error { ret := _m.Called(ctx, blockNum) @@ -79,6 +143,35 @@ func (_m *BHS) Store(ctx context.Context, blockNum uint64) error { return r0 } +// BHS_Store_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Store' +type BHS_Store_Call struct { + *mock.Call +} + +// Store is a helper method to define mock.On call +// - ctx context.Context +// - blockNum uint64 +func (_e *BHS_Expecter) Store(ctx interface{}, blockNum interface{}) *BHS_Store_Call { + return &BHS_Store_Call{Call: _e.mock.On("Store", ctx, blockNum)} +} + +func (_c *BHS_Store_Call) Run(run func(ctx context.Context, blockNum uint64)) *BHS_Store_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(uint64)) + }) + return _c +} + +func (_c *BHS_Store_Call) Return(_a0 error) *BHS_Store_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *BHS_Store_Call) RunAndReturn(run func(context.Context, uint64) error) *BHS_Store_Call { + _c.Call.Return(run) + return _c +} + // StoreEarliest provides a mock function with given fields: ctx func (_m *BHS) StoreEarliest(ctx context.Context) error { ret := _m.Called(ctx) @@ -97,6 +190,34 @@ func (_m *BHS) StoreEarliest(ctx context.Context) error { return r0 } +// BHS_StoreEarliest_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StoreEarliest' +type BHS_StoreEarliest_Call struct { + *mock.Call +} + +// StoreEarliest is a helper method to define mock.On call +// - ctx context.Context +func (_e *BHS_Expecter) StoreEarliest(ctx interface{}) *BHS_StoreEarliest_Call { + return &BHS_StoreEarliest_Call{Call: _e.mock.On("StoreEarliest", ctx)} +} + +func (_c *BHS_StoreEarliest_Call) Run(run func(ctx context.Context)) *BHS_StoreEarliest_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *BHS_StoreEarliest_Call) Return(_a0 error) *BHS_StoreEarliest_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *BHS_StoreEarliest_Call) RunAndReturn(run func(context.Context) error) *BHS_StoreEarliest_Call { + _c.Call.Return(run) + return _c +} + // StoreTrusted provides a mock function with given fields: ctx, blockNums, blockhashes, recentBlock, recentBlockhash func (_m *BHS) StoreTrusted(ctx context.Context, blockNums []uint64, blockhashes []common.Hash, recentBlock uint64, recentBlockhash common.Hash) error { ret := _m.Called(ctx, blockNums, blockhashes, recentBlock, recentBlockhash) @@ -115,6 +236,38 @@ func (_m *BHS) StoreTrusted(ctx context.Context, blockNums []uint64, blockhashes return r0 } +// BHS_StoreTrusted_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StoreTrusted' +type BHS_StoreTrusted_Call struct { + *mock.Call +} + +// StoreTrusted is a helper method to define mock.On call +// - ctx context.Context +// - blockNums []uint64 +// - blockhashes []common.Hash +// - recentBlock uint64 +// - recentBlockhash common.Hash +func (_e *BHS_Expecter) StoreTrusted(ctx interface{}, blockNums interface{}, blockhashes interface{}, recentBlock interface{}, recentBlockhash interface{}) *BHS_StoreTrusted_Call { + return &BHS_StoreTrusted_Call{Call: _e.mock.On("StoreTrusted", ctx, blockNums, blockhashes, recentBlock, recentBlockhash)} +} + +func (_c *BHS_StoreTrusted_Call) Run(run func(ctx context.Context, blockNums []uint64, blockhashes []common.Hash, recentBlock uint64, recentBlockhash common.Hash)) *BHS_StoreTrusted_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].([]uint64), args[2].([]common.Hash), args[3].(uint64), args[4].(common.Hash)) + }) + return _c +} + +func (_c *BHS_StoreTrusted_Call) Return(_a0 error) *BHS_StoreTrusted_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *BHS_StoreTrusted_Call) RunAndReturn(run func(context.Context, []uint64, []common.Hash, uint64, common.Hash) error) *BHS_StoreTrusted_Call { + _c.Call.Return(run) + return _c +} + // NewBHS creates a new instance of BHS. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewBHS(t interface { diff --git a/core/services/blockhashstore/mocks/timer.go b/core/services/blockhashstore/mocks/timer.go index bf593f76912..d0bc27edab7 100644 --- a/core/services/blockhashstore/mocks/timer.go +++ b/core/services/blockhashstore/mocks/timer.go @@ -13,6 +13,14 @@ type Timer struct { mock.Mock } +type Timer_Expecter struct { + mock *mock.Mock +} + +func (_m *Timer) EXPECT() *Timer_Expecter { + return &Timer_Expecter{mock: &_m.Mock} +} + // After provides a mock function with given fields: d func (_m *Timer) After(d time.Duration) <-chan time.Time { ret := _m.Called(d) @@ -33,6 +41,34 @@ func (_m *Timer) After(d time.Duration) <-chan time.Time { return r0 } +// Timer_After_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'After' +type Timer_After_Call struct { + *mock.Call +} + +// After is a helper method to define mock.On call +// - d time.Duration +func (_e *Timer_Expecter) After(d interface{}) *Timer_After_Call { + return &Timer_After_Call{Call: _e.mock.On("After", d)} +} + +func (_c *Timer_After_Call) Run(run func(d time.Duration)) *Timer_After_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(time.Duration)) + }) + return _c +} + +func (_c *Timer_After_Call) Return(_a0 <-chan time.Time) *Timer_After_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Timer_After_Call) RunAndReturn(run func(time.Duration) <-chan time.Time) *Timer_After_Call { + _c.Call.Return(run) + return _c +} + // NewTimer creates a new instance of Timer. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewTimer(t interface { diff --git a/core/services/ccip/mocks/orm.go b/core/services/ccip/mocks/orm.go index d3d7f89ba38..0c9086def7e 100644 --- a/core/services/ccip/mocks/orm.go +++ b/core/services/ccip/mocks/orm.go @@ -8,6 +8,8 @@ import ( ccip "github.com/smartcontractkit/chainlink/v2/core/services/ccip" mock "github.com/stretchr/testify/mock" + + time "time" ) // ORM is an autogenerated mock type for the ORM type @@ -15,40 +17,12 @@ type ORM struct { mock.Mock } -// ClearGasPricesByDestChain provides a mock function with given fields: ctx, destChainSelector, expireSec -func (_m *ORM) ClearGasPricesByDestChain(ctx context.Context, destChainSelector uint64, expireSec int) error { - ret := _m.Called(ctx, destChainSelector, expireSec) - - if len(ret) == 0 { - panic("no return value specified for ClearGasPricesByDestChain") - } - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, uint64, int) error); ok { - r0 = rf(ctx, destChainSelector, expireSec) - } else { - r0 = ret.Error(0) - } - - return r0 +type ORM_Expecter struct { + mock *mock.Mock } -// ClearTokenPricesByDestChain provides a mock function with given fields: ctx, destChainSelector, expireSec -func (_m *ORM) ClearTokenPricesByDestChain(ctx context.Context, destChainSelector uint64, expireSec int) error { - ret := _m.Called(ctx, destChainSelector, expireSec) - - if len(ret) == 0 { - panic("no return value specified for ClearTokenPricesByDestChain") - } - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, uint64, int) error); ok { - r0 = rf(ctx, destChainSelector, expireSec) - } else { - r0 = ret.Error(0) - } - - return r0 +func (_m *ORM) EXPECT() *ORM_Expecter { + return &ORM_Expecter{mock: &_m.Mock} } // GetGasPricesByDestChain provides a mock function with given fields: ctx, destChainSelector @@ -81,6 +55,35 @@ func (_m *ORM) GetGasPricesByDestChain(ctx context.Context, destChainSelector ui return r0, r1 } +// ORM_GetGasPricesByDestChain_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetGasPricesByDestChain' +type ORM_GetGasPricesByDestChain_Call struct { + *mock.Call +} + +// GetGasPricesByDestChain is a helper method to define mock.On call +// - ctx context.Context +// - destChainSelector uint64 +func (_e *ORM_Expecter) GetGasPricesByDestChain(ctx interface{}, destChainSelector interface{}) *ORM_GetGasPricesByDestChain_Call { + return &ORM_GetGasPricesByDestChain_Call{Call: _e.mock.On("GetGasPricesByDestChain", ctx, destChainSelector)} +} + +func (_c *ORM_GetGasPricesByDestChain_Call) Run(run func(ctx context.Context, destChainSelector uint64)) *ORM_GetGasPricesByDestChain_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(uint64)) + }) + return _c +} + +func (_c *ORM_GetGasPricesByDestChain_Call) Return(_a0 []ccip.GasPrice, _a1 error) *ORM_GetGasPricesByDestChain_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ORM_GetGasPricesByDestChain_Call) RunAndReturn(run func(context.Context, uint64) ([]ccip.GasPrice, error)) *ORM_GetGasPricesByDestChain_Call { + _c.Call.Return(run) + return _c +} + // GetTokenPricesByDestChain provides a mock function with given fields: ctx, destChainSelector func (_m *ORM) GetTokenPricesByDestChain(ctx context.Context, destChainSelector uint64) ([]ccip.TokenPrice, error) { ret := _m.Called(ctx, destChainSelector) @@ -111,40 +114,150 @@ func (_m *ORM) GetTokenPricesByDestChain(ctx context.Context, destChainSelector return r0, r1 } -// InsertGasPricesForDestChain provides a mock function with given fields: ctx, destChainSelector, jobId, gasPrices -func (_m *ORM) InsertGasPricesForDestChain(ctx context.Context, destChainSelector uint64, jobId int32, gasPrices []ccip.GasPriceUpdate) error { - ret := _m.Called(ctx, destChainSelector, jobId, gasPrices) +// ORM_GetTokenPricesByDestChain_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetTokenPricesByDestChain' +type ORM_GetTokenPricesByDestChain_Call struct { + *mock.Call +} + +// GetTokenPricesByDestChain is a helper method to define mock.On call +// - ctx context.Context +// - destChainSelector uint64 +func (_e *ORM_Expecter) GetTokenPricesByDestChain(ctx interface{}, destChainSelector interface{}) *ORM_GetTokenPricesByDestChain_Call { + return &ORM_GetTokenPricesByDestChain_Call{Call: _e.mock.On("GetTokenPricesByDestChain", ctx, destChainSelector)} +} + +func (_c *ORM_GetTokenPricesByDestChain_Call) Run(run func(ctx context.Context, destChainSelector uint64)) *ORM_GetTokenPricesByDestChain_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(uint64)) + }) + return _c +} + +func (_c *ORM_GetTokenPricesByDestChain_Call) Return(_a0 []ccip.TokenPrice, _a1 error) *ORM_GetTokenPricesByDestChain_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ORM_GetTokenPricesByDestChain_Call) RunAndReturn(run func(context.Context, uint64) ([]ccip.TokenPrice, error)) *ORM_GetTokenPricesByDestChain_Call { + _c.Call.Return(run) + return _c +} + +// UpsertGasPricesForDestChain provides a mock function with given fields: ctx, destChainSelector, gasPrices +func (_m *ORM) UpsertGasPricesForDestChain(ctx context.Context, destChainSelector uint64, gasPrices []ccip.GasPrice) (int64, error) { + ret := _m.Called(ctx, destChainSelector, gasPrices) if len(ret) == 0 { - panic("no return value specified for InsertGasPricesForDestChain") + panic("no return value specified for UpsertGasPricesForDestChain") } - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, uint64, int32, []ccip.GasPriceUpdate) error); ok { - r0 = rf(ctx, destChainSelector, jobId, gasPrices) + var r0 int64 + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, uint64, []ccip.GasPrice) (int64, error)); ok { + return rf(ctx, destChainSelector, gasPrices) + } + if rf, ok := ret.Get(0).(func(context.Context, uint64, []ccip.GasPrice) int64); ok { + r0 = rf(ctx, destChainSelector, gasPrices) } else { - r0 = ret.Error(0) + r0 = ret.Get(0).(int64) } - return r0 + if rf, ok := ret.Get(1).(func(context.Context, uint64, []ccip.GasPrice) error); ok { + r1 = rf(ctx, destChainSelector, gasPrices) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ORM_UpsertGasPricesForDestChain_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpsertGasPricesForDestChain' +type ORM_UpsertGasPricesForDestChain_Call struct { + *mock.Call +} + +// UpsertGasPricesForDestChain is a helper method to define mock.On call +// - ctx context.Context +// - destChainSelector uint64 +// - gasPrices []ccip.GasPrice +func (_e *ORM_Expecter) UpsertGasPricesForDestChain(ctx interface{}, destChainSelector interface{}, gasPrices interface{}) *ORM_UpsertGasPricesForDestChain_Call { + return &ORM_UpsertGasPricesForDestChain_Call{Call: _e.mock.On("UpsertGasPricesForDestChain", ctx, destChainSelector, gasPrices)} +} + +func (_c *ORM_UpsertGasPricesForDestChain_Call) Run(run func(ctx context.Context, destChainSelector uint64, gasPrices []ccip.GasPrice)) *ORM_UpsertGasPricesForDestChain_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(uint64), args[2].([]ccip.GasPrice)) + }) + return _c +} + +func (_c *ORM_UpsertGasPricesForDestChain_Call) Return(_a0 int64, _a1 error) *ORM_UpsertGasPricesForDestChain_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ORM_UpsertGasPricesForDestChain_Call) RunAndReturn(run func(context.Context, uint64, []ccip.GasPrice) (int64, error)) *ORM_UpsertGasPricesForDestChain_Call { + _c.Call.Return(run) + return _c } -// InsertTokenPricesForDestChain provides a mock function with given fields: ctx, destChainSelector, jobId, tokenPrices -func (_m *ORM) InsertTokenPricesForDestChain(ctx context.Context, destChainSelector uint64, jobId int32, tokenPrices []ccip.TokenPriceUpdate) error { - ret := _m.Called(ctx, destChainSelector, jobId, tokenPrices) +// UpsertTokenPricesForDestChain provides a mock function with given fields: ctx, destChainSelector, tokenPrices, interval +func (_m *ORM) UpsertTokenPricesForDestChain(ctx context.Context, destChainSelector uint64, tokenPrices []ccip.TokenPrice, interval time.Duration) (int64, error) { + ret := _m.Called(ctx, destChainSelector, tokenPrices, interval) if len(ret) == 0 { - panic("no return value specified for InsertTokenPricesForDestChain") + panic("no return value specified for UpsertTokenPricesForDestChain") } - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, uint64, int32, []ccip.TokenPriceUpdate) error); ok { - r0 = rf(ctx, destChainSelector, jobId, tokenPrices) + var r0 int64 + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, uint64, []ccip.TokenPrice, time.Duration) (int64, error)); ok { + return rf(ctx, destChainSelector, tokenPrices, interval) + } + if rf, ok := ret.Get(0).(func(context.Context, uint64, []ccip.TokenPrice, time.Duration) int64); ok { + r0 = rf(ctx, destChainSelector, tokenPrices, interval) } else { - r0 = ret.Error(0) + r0 = ret.Get(0).(int64) } - return r0 + if rf, ok := ret.Get(1).(func(context.Context, uint64, []ccip.TokenPrice, time.Duration) error); ok { + r1 = rf(ctx, destChainSelector, tokenPrices, interval) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ORM_UpsertTokenPricesForDestChain_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpsertTokenPricesForDestChain' +type ORM_UpsertTokenPricesForDestChain_Call struct { + *mock.Call +} + +// UpsertTokenPricesForDestChain is a helper method to define mock.On call +// - ctx context.Context +// - destChainSelector uint64 +// - tokenPrices []ccip.TokenPrice +// - interval time.Duration +func (_e *ORM_Expecter) UpsertTokenPricesForDestChain(ctx interface{}, destChainSelector interface{}, tokenPrices interface{}, interval interface{}) *ORM_UpsertTokenPricesForDestChain_Call { + return &ORM_UpsertTokenPricesForDestChain_Call{Call: _e.mock.On("UpsertTokenPricesForDestChain", ctx, destChainSelector, tokenPrices, interval)} +} + +func (_c *ORM_UpsertTokenPricesForDestChain_Call) Run(run func(ctx context.Context, destChainSelector uint64, tokenPrices []ccip.TokenPrice, interval time.Duration)) *ORM_UpsertTokenPricesForDestChain_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(uint64), args[2].([]ccip.TokenPrice), args[3].(time.Duration)) + }) + return _c +} + +func (_c *ORM_UpsertTokenPricesForDestChain_Call) Return(_a0 int64, _a1 error) *ORM_UpsertTokenPricesForDestChain_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ORM_UpsertTokenPricesForDestChain_Call) RunAndReturn(run func(context.Context, uint64, []ccip.TokenPrice, time.Duration) (int64, error)) *ORM_UpsertTokenPricesForDestChain_Call { + _c.Call.Return(run) + return _c } // NewORM creates a new instance of ORM. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. diff --git a/core/services/ccip/observability.go b/core/services/ccip/observability.go new file mode 100644 index 00000000000..8a061893ce6 --- /dev/null +++ b/core/services/ccip/observability.go @@ -0,0 +1,115 @@ +package ccip + +import ( + "context" + "strconv" + "time" + + "github.com/smartcontractkit/chainlink-common/pkg/sqlutil" + + "github.com/prometheus/client_golang/prometheus" + "github.com/prometheus/client_golang/prometheus/promauto" + + "github.com/smartcontractkit/chainlink/v2/core/logger" +) + +var ( + sqlLatencyBuckets = []float64{ + float64(10 * time.Millisecond), + float64(20 * time.Millisecond), + float64(30 * time.Millisecond), + float64(40 * time.Millisecond), + float64(50 * time.Millisecond), + float64(70 * time.Millisecond), + float64(90 * time.Millisecond), + float64(100 * time.Millisecond), + float64(200 * time.Millisecond), + float64(300 * time.Millisecond), + float64(400 * time.Millisecond), + float64(500 * time.Millisecond), + float64(750 * time.Millisecond), + float64(1 * time.Second), + } + ccipQueryDuration = promauto.NewHistogramVec(prometheus.HistogramOpts{ + Name: "ccip_orm_query_duration", + Buckets: sqlLatencyBuckets, + }, []string{"query", "destChainSelector"}) + ccipQueryDatasets = promauto.NewGaugeVec(prometheus.GaugeOpts{ + Name: "ccip_orm_dataset_size", + }, []string{"query", "destChainSelector"}) +) + +type observedORM struct { + ORM + queryDuration *prometheus.HistogramVec + datasetSize *prometheus.GaugeVec +} + +var _ ORM = (*observedORM)(nil) + +func NewObservedORM(ds sqlutil.DataSource, lggr logger.Logger) (*observedORM, error) { + delegate, err := NewORM(ds, lggr) + if err != nil { + return nil, err + } + + return &observedORM{ + ORM: delegate, + queryDuration: ccipQueryDuration, + datasetSize: ccipQueryDatasets, + }, nil +} + +func (o *observedORM) GetGasPricesByDestChain(ctx context.Context, destChainSelector uint64) ([]GasPrice, error) { + return withObservedQueryAndResults(o, "GetGasPricesByDestChain", destChainSelector, func() ([]GasPrice, error) { + return o.ORM.GetGasPricesByDestChain(ctx, destChainSelector) + }) +} + +func (o *observedORM) GetTokenPricesByDestChain(ctx context.Context, destChainSelector uint64) ([]TokenPrice, error) { + return withObservedQueryAndResults(o, "GetTokenPricesByDestChain", destChainSelector, func() ([]TokenPrice, error) { + return o.ORM.GetTokenPricesByDestChain(ctx, destChainSelector) + }) +} + +func (o *observedORM) UpsertGasPricesForDestChain(ctx context.Context, destChainSelector uint64, gasPrices []GasPrice) (int64, error) { + return withObservedQueryAndRowsAffected(o, "UpsertGasPricesForDestChain", destChainSelector, func() (int64, error) { + return o.ORM.UpsertGasPricesForDestChain(ctx, destChainSelector, gasPrices) + }) +} + +func (o *observedORM) UpsertTokenPricesForDestChain(ctx context.Context, destChainSelector uint64, tokenPrices []TokenPrice, interval time.Duration) (int64, error) { + return withObservedQueryAndRowsAffected(o, "UpsertTokenPricesForDestChain", destChainSelector, func() (int64, error) { + return o.ORM.UpsertTokenPricesForDestChain(ctx, destChainSelector, tokenPrices, interval) + }) +} + +func withObservedQueryAndRowsAffected(o *observedORM, queryName string, chainSelector uint64, query func() (int64, error)) (int64, error) { + rowsAffected, err := withObservedQuery(o, queryName, chainSelector, query) + if err == nil { + o.datasetSize. + WithLabelValues(queryName, strconv.FormatUint(chainSelector, 10)). + Set(float64(rowsAffected)) + } + return rowsAffected, err +} + +func withObservedQueryAndResults[T any](o *observedORM, queryName string, chainSelector uint64, query func() ([]T, error)) ([]T, error) { + results, err := withObservedQuery(o, queryName, chainSelector, query) + if err == nil { + o.datasetSize. + WithLabelValues(queryName, strconv.FormatUint(chainSelector, 10)). + Set(float64(len(results))) + } + return results, err +} + +func withObservedQuery[T any](o *observedORM, queryName string, chainSelector uint64, query func() (T, error)) (T, error) { + queryStarted := time.Now() + defer func() { + o.queryDuration. + WithLabelValues(queryName, strconv.FormatUint(chainSelector, 10)). + Observe(float64(time.Since(queryStarted))) + }() + return query() +} diff --git a/core/services/ccip/observability_test.go b/core/services/ccip/observability_test.go new file mode 100644 index 00000000000..24bfb4a9ec1 --- /dev/null +++ b/core/services/ccip/observability_test.go @@ -0,0 +1,94 @@ +package ccip + +import ( + "math/big" + "testing" + "time" + + "github.com/prometheus/client_golang/prometheus" + "github.com/prometheus/client_golang/prometheus/testutil" + io_prometheus_client "github.com/prometheus/client_model/go" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/pgtest" + "github.com/smartcontractkit/chainlink/v2/core/logger" +) + +func Test_MetricsAreTrackedForAllMethods(t *testing.T) { + ctx := testutils.Context(t) + db := pgtest.NewSqlxDB(t) + ccipORM, err := NewObservedORM(db, logger.TestLogger(t)) + require.NoError(t, err) + + tokenPrices := []TokenPrice{ + { + TokenAddr: "0xA", + TokenPrice: assets.NewWei(big.NewInt(1e18)), + }, + { + TokenAddr: "0xB", + TokenPrice: assets.NewWei(big.NewInt(1e18)), + }, + } + tokensUpserted, err := ccipORM.UpsertTokenPricesForDestChain(ctx, 100, tokenPrices, time.Second) + require.NoError(t, err) + assert.Equal(t, len(tokenPrices), int(tokensUpserted)) + assert.Equal(t, len(tokenPrices), counterFromGaugeByLabels(ccipORM.datasetSize, "UpsertTokenPricesForDestChain", "100")) + assert.Equal(t, 0, counterFromGaugeByLabels(ccipORM.datasetSize, "UpsertTokenPricesForDestChain", "200")) + + tokens, err := ccipORM.GetTokenPricesByDestChain(ctx, 100) + require.NoError(t, err) + assert.Equal(t, len(tokenPrices), len(tokens)) + assert.Equal(t, len(tokenPrices), counterFromGaugeByLabels(ccipORM.datasetSize, "GetTokenPricesByDestChain", "100")) + assert.Equal(t, 1, counterFromHistogramByLabels(t, ccipORM.queryDuration, "GetTokenPricesByDestChain", "100")) + + gasPrices := []GasPrice{ + { + SourceChainSelector: 200, + GasPrice: assets.NewWei(big.NewInt(1e18)), + }, + { + SourceChainSelector: 201, + GasPrice: assets.NewWei(big.NewInt(1e18)), + }, + { + SourceChainSelector: 202, + GasPrice: assets.NewWei(big.NewInt(1e18)), + }, + } + gasUpserted, err := ccipORM.UpsertGasPricesForDestChain(ctx, 100, gasPrices) + require.NoError(t, err) + assert.Equal(t, len(gasPrices), int(gasUpserted)) + assert.Equal(t, len(gasPrices), counterFromGaugeByLabels(ccipORM.datasetSize, "UpsertGasPricesForDestChain", "100")) + assert.Equal(t, 0, counterFromGaugeByLabels(ccipORM.datasetSize, "UpsertGasPricesForDestChain", "200")) + + gas, err := ccipORM.GetGasPricesByDestChain(ctx, 100) + require.NoError(t, err) + assert.Equal(t, len(gasPrices), len(gas)) + assert.Equal(t, len(gasPrices), counterFromGaugeByLabels(ccipORM.datasetSize, "GetGasPricesByDestChain", "100")) + assert.Equal(t, 1, counterFromHistogramByLabels(t, ccipORM.queryDuration, "GetGasPricesByDestChain", "100")) +} + +func counterFromHistogramByLabels(t *testing.T, histogramVec *prometheus.HistogramVec, labels ...string) int { + observer, err := histogramVec.GetMetricWithLabelValues(labels...) + require.NoError(t, err) + + metricCh := make(chan prometheus.Metric, 1) + observer.(prometheus.Histogram).Collect(metricCh) + close(metricCh) + + metric := <-metricCh + pb := &io_prometheus_client.Metric{} + err = metric.Write(pb) + require.NoError(t, err) + + return int(pb.GetHistogram().GetSampleCount()) +} + +func counterFromGaugeByLabels(gaugeVec *prometheus.GaugeVec, labels ...string) int { + value := testutil.ToFloat64(gaugeVec.WithLabelValues(labels...)) + return int(value) +} diff --git a/core/services/ccip/orm.go b/core/services/ccip/orm.go index 6c21520d435..1942c68fef9 100644 --- a/core/services/ccip/orm.go +++ b/core/services/ccip/orm.go @@ -8,66 +8,51 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/sqlutil" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" + "github.com/smartcontractkit/chainlink/v2/core/logger" ) type GasPrice struct { SourceChainSelector uint64 GasPrice *assets.Wei - CreatedAt time.Time -} - -type GasPriceUpdate struct { - SourceChainSelector uint64 - GasPrice *assets.Wei } type TokenPrice struct { TokenAddr string TokenPrice *assets.Wei - CreatedAt time.Time -} - -type TokenPriceUpdate struct { - TokenAddr string - TokenPrice *assets.Wei } -//go:generate mockery --quiet --name ORM --output ./mocks/ --case=underscore type ORM interface { GetGasPricesByDestChain(ctx context.Context, destChainSelector uint64) ([]GasPrice, error) GetTokenPricesByDestChain(ctx context.Context, destChainSelector uint64) ([]TokenPrice, error) - InsertGasPricesForDestChain(ctx context.Context, destChainSelector uint64, jobId int32, gasPrices []GasPriceUpdate) error - InsertTokenPricesForDestChain(ctx context.Context, destChainSelector uint64, jobId int32, tokenPrices []TokenPriceUpdate) error - - ClearGasPricesByDestChain(ctx context.Context, destChainSelector uint64, expireSec int) error - ClearTokenPricesByDestChain(ctx context.Context, destChainSelector uint64, expireSec int) error + UpsertGasPricesForDestChain(ctx context.Context, destChainSelector uint64, gasPrices []GasPrice) (int64, error) + UpsertTokenPricesForDestChain(ctx context.Context, destChainSelector uint64, tokenPrices []TokenPrice, interval time.Duration) (int64, error) } type orm struct { - ds sqlutil.DataSource + ds sqlutil.DataSource + lggr logger.Logger } var _ ORM = (*orm)(nil) -func NewORM(ds sqlutil.DataSource) (ORM, error) { +func NewORM(ds sqlutil.DataSource, lggr logger.Logger) (ORM, error) { if ds == nil { return nil, fmt.Errorf("datasource to CCIP NewORM cannot be nil") } return &orm{ - ds: ds, + ds: ds, + lggr: lggr, }, nil } func (o *orm) GetGasPricesByDestChain(ctx context.Context, destChainSelector uint64) ([]GasPrice, error) { var gasPrices []GasPrice stmt := ` - SELECT DISTINCT ON (source_chain_selector) - source_chain_selector, gas_price, created_at + SELECT source_chain_selector, gas_price FROM ccip.observed_gas_prices - WHERE chain_selector = $1 - ORDER BY source_chain_selector, created_at DESC; + WHERE chain_selector = $1; ` err := o.ds.SelectContext(ctx, &gasPrices, stmt, destChainSelector) if err != nil { @@ -80,82 +65,147 @@ func (o *orm) GetGasPricesByDestChain(ctx context.Context, destChainSelector uin func (o *orm) GetTokenPricesByDestChain(ctx context.Context, destChainSelector uint64) ([]TokenPrice, error) { var tokenPrices []TokenPrice stmt := ` - SELECT DISTINCT ON (token_addr) - token_addr, token_price, created_at + SELECT token_addr, token_price FROM ccip.observed_token_prices - WHERE chain_selector = $1 - ORDER BY token_addr, created_at DESC; + WHERE chain_selector = $1; ` err := o.ds.SelectContext(ctx, &tokenPrices, stmt, destChainSelector) if err != nil { return nil, err } - return tokenPrices, nil } -func (o *orm) InsertGasPricesForDestChain(ctx context.Context, destChainSelector uint64, jobId int32, gasPrices []GasPriceUpdate) error { +func (o *orm) UpsertGasPricesForDestChain(ctx context.Context, destChainSelector uint64, gasPrices []GasPrice) (int64, error) { if len(gasPrices) == 0 { - return nil + return 0, nil + } + + uniqueGasUpdates := make(map[string]GasPrice) + for _, gasPrice := range gasPrices { + key := fmt.Sprintf("%d-%d", gasPrice.SourceChainSelector, destChainSelector) + uniqueGasUpdates[key] = gasPrice } - insertData := make([]map[string]interface{}, 0, len(gasPrices)) - for _, price := range gasPrices { + insertData := make([]map[string]interface{}, 0, len(uniqueGasUpdates)) + for _, price := range uniqueGasUpdates { insertData = append(insertData, map[string]interface{}{ "chain_selector": destChainSelector, - "job_id": jobId, "source_chain_selector": price.SourceChainSelector, "gas_price": price.GasPrice, }) } - // using statement_timestamp() to make testing easier - stmt := `INSERT INTO ccip.observed_gas_prices (chain_selector, job_id, source_chain_selector, gas_price, created_at) - VALUES (:chain_selector, :job_id, :source_chain_selector, :gas_price, statement_timestamp());` - _, err := o.ds.NamedExecContext(ctx, stmt, insertData) + stmt := `INSERT INTO ccip.observed_gas_prices (chain_selector, source_chain_selector, gas_price, updated_at) + VALUES (:chain_selector, :source_chain_selector, :gas_price, statement_timestamp()) + ON CONFLICT (source_chain_selector, chain_selector) + DO UPDATE SET gas_price = EXCLUDED.gas_price, updated_at = EXCLUDED.updated_at;` + + result, err := o.ds.NamedExecContext(ctx, stmt, insertData) if err != nil { - err = fmt.Errorf("error inserting gas prices for job %d: %w", jobId, err) + return 0, fmt.Errorf("error inserting gas prices %w", err) } - - return err + return result.RowsAffected() } -func (o *orm) InsertTokenPricesForDestChain(ctx context.Context, destChainSelector uint64, jobId int32, tokenPrices []TokenPriceUpdate) error { +// UpsertTokenPricesForDestChain inserts or updates only relevant token prices. +// In order to reduce locking an unnecessary writes to the table, we start with fetching current prices. +// If price for a token doesn't change or was updated recently we don't include that token to the upsert query. +// We don't run in TX intentionally, because we don't want to lock the table and conflicts are resolved on the insert level +func (o *orm) UpsertTokenPricesForDestChain(ctx context.Context, destChainSelector uint64, tokenPrices []TokenPrice, interval time.Duration) (int64, error) { if len(tokenPrices) == 0 { - return nil + return 0, nil } - insertData := make([]map[string]interface{}, 0, len(tokenPrices)) - for _, price := range tokenPrices { + tokensToUpdate, err := o.pickOnlyRelevantTokensForUpdate(ctx, destChainSelector, tokenPrices, interval) + if err != nil || len(tokensToUpdate) == 0 { + return 0, err + } + + insertData := make([]map[string]interface{}, 0, len(tokensToUpdate)) + for _, price := range tokensToUpdate { insertData = append(insertData, map[string]interface{}{ "chain_selector": destChainSelector, - "job_id": jobId, "token_addr": price.TokenAddr, "token_price": price.TokenPrice, }) } - // using statement_timestamp() to make testing easier - stmt := `INSERT INTO ccip.observed_token_prices (chain_selector, job_id, token_addr, token_price, created_at) - VALUES (:chain_selector, :job_id, :token_addr, :token_price, statement_timestamp());` - _, err := o.ds.NamedExecContext(ctx, stmt, insertData) + stmt := `INSERT INTO ccip.observed_token_prices (chain_selector, token_addr, token_price, updated_at) + VALUES (:chain_selector, :token_addr, :token_price, statement_timestamp()) + ON CONFLICT (token_addr, chain_selector) + DO UPDATE SET token_price = EXCLUDED.token_price, updated_at = EXCLUDED.updated_at;` + result, err := o.ds.NamedExecContext(ctx, stmt, insertData) if err != nil { - err = fmt.Errorf("error inserting token prices for job %d: %w", jobId, err) + return 0, fmt.Errorf("error inserting token prices %w", err) } - - return err + return result.RowsAffected() } -func (o *orm) ClearGasPricesByDestChain(ctx context.Context, destChainSelector uint64, expireSec int) error { - stmt := `DELETE FROM ccip.observed_gas_prices WHERE chain_selector = $1 AND created_at < (statement_timestamp() - $2 * interval '1 second')` +// pickOnlyRelevantTokensForUpdate returns only tokens that need to be updated. Multiple jobs can be updating the same tokens, +// in order to reduce table locking and redundant upserts we start with reading the table and checking which tokens are eligible for update. +// A token is eligible for update when time since last update is greater than the interval. +func (o *orm) pickOnlyRelevantTokensForUpdate( + ctx context.Context, + destChainSelector uint64, + tokenPrices []TokenPrice, + interval time.Duration, +) ([]TokenPrice, error) { + tokenPricesByAddress := toTokensByAddress(tokenPrices) + + // Picks only tokens which were recently updated and can be ignored, + // we will filter out these tokens from the upsert query. + stmt := ` + SELECT + token_addr + FROM ccip.observed_token_prices + WHERE + chain_selector = $1 + and token_addr = any($2) + and updated_at >= statement_timestamp() - $3::interval + ` + + pgInterval := fmt.Sprintf("%d milliseconds", interval.Milliseconds()) + args := []interface{}{destChainSelector, tokenAddrsToBytes(tokenPricesByAddress), pgInterval} + var dbTokensToIgnore []string + if err := o.ds.SelectContext(ctx, &dbTokensToIgnore, stmt, args...); err != nil { + return nil, err + } + + tokensToIgnore := make(map[string]struct{}, len(dbTokensToIgnore)) + for _, tk := range dbTokensToIgnore { + tokensToIgnore[tk] = struct{}{} + } - _, err := o.ds.ExecContext(ctx, stmt, destChainSelector, expireSec) - return err + tokenPricesToUpdate := make([]TokenPrice, 0, len(tokenPrices)) + for tokenAddr, tokenPrice := range tokenPricesByAddress { + eligibleForUpdate := false + if _, ok := tokensToIgnore[tokenAddr]; !ok { + eligibleForUpdate = true + tokenPricesToUpdate = append(tokenPricesToUpdate, TokenPrice{TokenAddr: tokenAddr, TokenPrice: tokenPrice}) + } + o.lggr.Debugw( + "Token price eligibility for database update", + "eligibleForUpdate", eligibleForUpdate, + "token", tokenAddr, + "price", tokenPrice, + ) + } + return tokenPricesToUpdate, nil } -func (o *orm) ClearTokenPricesByDestChain(ctx context.Context, destChainSelector uint64, expireSec int) error { - stmt := `DELETE FROM ccip.observed_token_prices WHERE chain_selector = $1 AND created_at < (statement_timestamp() - $2 * interval '1 second')` +func toTokensByAddress(tokens []TokenPrice) map[string]*assets.Wei { + tokensByAddr := make(map[string]*assets.Wei, len(tokens)) + for _, tk := range tokens { + tokensByAddr[tk.TokenAddr] = tk.TokenPrice + } + return tokensByAddr +} - _, err := o.ds.ExecContext(ctx, stmt, destChainSelector, expireSec) - return err +func tokenAddrsToBytes(tokens map[string]*assets.Wei) [][]byte { + addrs := make([][]byte, 0, len(tokens)) + for tkAddr := range tokens { + addrs = append(addrs, []byte(tkAddr)) + } + return addrs } diff --git a/core/services/ccip/orm_test.go b/core/services/ccip/orm_test.go index 7b7b8d82710..e778ddf6ce3 100644 --- a/core/services/ccip/orm_test.go +++ b/core/services/ccip/orm_test.go @@ -15,13 +15,18 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/pgtest" + "github.com/smartcontractkit/chainlink/v2/core/logger" +) + +var ( + r = rand.New(rand.NewSource(time.Now().UnixNano())) ) func setupORM(t *testing.T) (ORM, sqlutil.DataSource) { t.Helper() db := pgtest.NewSqlxDB(t) - orm, err := NewORM(db) + orm, err := NewORM(db, logger.TestLogger(t)) require.NoError(t, err) @@ -37,12 +42,12 @@ func generateChainSelectors(n int) []uint64 { return selectors } -func generateGasPriceUpdates(chainSelector uint64, n int) []GasPriceUpdate { - updates := make([]GasPriceUpdate, n) +func generateGasPrices(chainSelector uint64, n int) []GasPrice { + updates := make([]GasPrice, n) for i := 0; i < n; i++ { // gas prices can take up whole range of uint256 uint256Max := new(big.Int).Sub(new(big.Int).Exp(big.NewInt(2), big.NewInt(256), nil), big.NewInt(1)) - row := GasPriceUpdate{ + row := GasPrice{ SourceChainSelector: chainSelector, GasPrice: assets.NewWei(new(big.Int).Sub(uint256Max, big.NewInt(int64(i)))), } @@ -61,10 +66,21 @@ func generateTokenAddresses(n int) []string { return addrs } -func generateTokenPriceUpdates(tokenAddr string, n int) []TokenPriceUpdate { - updates := make([]TokenPriceUpdate, n) +func generateRandomTokenPrices(tokenAddrs []string) []TokenPrice { + updates := make([]TokenPrice, 0, len(tokenAddrs)) + for _, addr := range tokenAddrs { + updates = append(updates, TokenPrice{ + TokenAddr: addr, + TokenPrice: assets.NewWei(new(big.Int).Rand(r, big.NewInt(1e18))), + }) + } + return updates +} + +func generateTokenPrices(tokenAddr string, n int) []TokenPrice { + updates := make([]TokenPrice, n) for i := 0; i < n; i++ { - row := TokenPriceUpdate{ + row := TokenPrice{ TokenAddr: tokenAddr, TokenPrice: assets.NewWei(new(big.Int).Mul(big.NewInt(1e18), big.NewInt(int64(i)))), } @@ -134,20 +150,20 @@ func TestORM_InsertAndGetGasPrices(t *testing.T) { sourceSelectors := generateChainSelectors(numSourceChainSelectors) - updates := make(map[uint64][]GasPriceUpdate) + updates := make(map[uint64][]GasPrice) for _, selector := range sourceSelectors { - updates[selector] = generateGasPriceUpdates(selector, numUpdatesPerSourceSelector) + updates[selector] = generateGasPrices(selector, numUpdatesPerSourceSelector) } // 5 jobs, each inserting prices for 10 chains, with 20 updates per chain. - expectedPrices := make(map[uint64]GasPriceUpdate) + expectedPrices := make(map[uint64]GasPrice) for i := 0; i < numJobs; i++ { for selector, updatesPerSelector := range updates { lastIndex := len(updatesPerSelector) - 1 - err := orm.InsertGasPricesForDestChain(ctx, destSelector, int32(i), updatesPerSelector[:lastIndex]) + _, err := orm.UpsertGasPricesForDestChain(ctx, destSelector, updatesPerSelector[:lastIndex]) assert.NoError(t, err) - err = orm.InsertGasPricesForDestChain(ctx, destSelector, int32(i), updatesPerSelector[lastIndex:]) + _, err = orm.UpsertGasPricesForDestChain(ctx, destSelector, updatesPerSelector[lastIndex:]) assert.NoError(t, err) expectedPrices[selector] = updatesPerSelector[lastIndex] @@ -156,7 +172,7 @@ func TestORM_InsertAndGetGasPrices(t *testing.T) { // verify number of rows inserted numRows := getGasTableRowCount(t, db) - assert.Equal(t, numJobs*numSourceChainSelectors*numUpdatesPerSourceSelector, numRows) + assert.Equal(t, numSourceChainSelectors, numRows) prices, err := orm.GetGasPricesByDestChain(ctx, destSelector) assert.NoError(t, err) @@ -170,15 +186,15 @@ func TestORM_InsertAndGetGasPrices(t *testing.T) { } // after the initial inserts, insert new round of prices, 1 price per selector this time - var combinedUpdates []GasPriceUpdate + var combinedUpdates []GasPrice for selector, updatesPerSelector := range updates { combinedUpdates = append(combinedUpdates, updatesPerSelector[0]) expectedPrices[selector] = updatesPerSelector[0] } - err = orm.InsertGasPricesForDestChain(ctx, destSelector, 1, combinedUpdates) + _, err = orm.UpsertGasPricesForDestChain(ctx, destSelector, combinedUpdates) assert.NoError(t, err) - assert.Equal(t, numJobs*numSourceChainSelectors*numUpdatesPerSourceSelector+numSourceChainSelectors, getGasTableRowCount(t, db)) + assert.Equal(t, numSourceChainSelectors, getGasTableRowCount(t, db)) prices, err = orm.GetGasPricesByDestChain(ctx, destSelector) assert.NoError(t, err) @@ -190,7 +206,7 @@ func TestORM_InsertAndGetGasPrices(t *testing.T) { } } -func TestORM_InsertAndDeleteGasPrices(t *testing.T) { +func TestORM_UpsertGasPrices(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -202,13 +218,13 @@ func TestORM_InsertAndDeleteGasPrices(t *testing.T) { sourceSelectors := generateChainSelectors(numSourceChainSelectors) - updates := make(map[uint64][]GasPriceUpdate) + updates := make(map[uint64][]GasPrice) for _, selector := range sourceSelectors { - updates[selector] = generateGasPriceUpdates(selector, numUpdatesPerSourceSelector) + updates[selector] = generateGasPrices(selector, numUpdatesPerSourceSelector) } for _, updatesPerSelector := range updates { - err := orm.InsertGasPricesForDestChain(ctx, destSelector, 1, updatesPerSelector) + _, err := orm.UpsertGasPricesForDestChain(ctx, destSelector, updatesPerSelector) assert.NoError(t, err) } @@ -217,21 +233,11 @@ func TestORM_InsertAndDeleteGasPrices(t *testing.T) { // insert for the 2nd time after interimTimeStamp for _, updatesPerSelector := range updates { - err := orm.InsertGasPricesForDestChain(ctx, destSelector, 1, updatesPerSelector) + _, err := orm.UpsertGasPricesForDestChain(ctx, destSelector, updatesPerSelector) assert.NoError(t, err) } - assert.Equal(t, 2*numSourceChainSelectors*numUpdatesPerSourceSelector, getGasTableRowCount(t, db)) - - // clear by sleepSec should delete rows inserted before it - err := orm.ClearGasPricesByDestChain(ctx, destSelector, sleepSec) - assert.NoError(t, err) - assert.Equal(t, numSourceChainSelectors*numUpdatesPerSourceSelector, getGasTableRowCount(t, db)) - - // clear by 0 expiration seconds should delete all rows - err = orm.ClearGasPricesByDestChain(ctx, destSelector, 0) - assert.NoError(t, err) - assert.Equal(t, 0, getGasTableRowCount(t, db)) + assert.Equal(t, numSourceChainSelectors, getGasTableRowCount(t, db)) } func TestORM_InsertAndGetTokenPrices(t *testing.T) { @@ -247,20 +253,20 @@ func TestORM_InsertAndGetTokenPrices(t *testing.T) { addrs := generateTokenAddresses(numAddresses) - updates := make(map[string][]TokenPriceUpdate) + updates := make(map[string][]TokenPrice) for _, addr := range addrs { - updates[addr] = generateTokenPriceUpdates(addr, numUpdatesPerAddress) + updates[addr] = generateTokenPrices(addr, numUpdatesPerAddress) } // 5 jobs, each inserting prices for 10 chains, with 20 updates per chain. - expectedPrices := make(map[string]TokenPriceUpdate) + expectedPrices := make(map[string]TokenPrice) for i := 0; i < numJobs; i++ { for addr, updatesPerAddr := range updates { lastIndex := len(updatesPerAddr) - 1 - err := orm.InsertTokenPricesForDestChain(ctx, destSelector, int32(i), updatesPerAddr[:lastIndex]) + _, err := orm.UpsertTokenPricesForDestChain(ctx, destSelector, updatesPerAddr[:lastIndex], 0) assert.NoError(t, err) - err = orm.InsertTokenPricesForDestChain(ctx, destSelector, int32(i), updatesPerAddr[lastIndex:]) + _, err = orm.UpsertTokenPricesForDestChain(ctx, destSelector, updatesPerAddr[lastIndex:], 0) assert.NoError(t, err) expectedPrices[addr] = updatesPerAddr[lastIndex] @@ -269,7 +275,7 @@ func TestORM_InsertAndGetTokenPrices(t *testing.T) { // verify number of rows inserted numRows := getTokenTableRowCount(t, db) - assert.Equal(t, numJobs*numAddresses*numUpdatesPerAddress, numRows) + assert.Equal(t, numAddresses, numRows) prices, err := orm.GetTokenPricesByDestChain(ctx, destSelector) assert.NoError(t, err) @@ -283,15 +289,15 @@ func TestORM_InsertAndGetTokenPrices(t *testing.T) { } // after the initial inserts, insert new round of prices, 1 price per selector this time - var combinedUpdates []TokenPriceUpdate + var combinedUpdates []TokenPrice for addr, updatesPerAddr := range updates { combinedUpdates = append(combinedUpdates, updatesPerAddr[0]) expectedPrices[addr] = updatesPerAddr[0] } - err = orm.InsertTokenPricesForDestChain(ctx, destSelector, 1, combinedUpdates) + _, err = orm.UpsertTokenPricesForDestChain(ctx, destSelector, combinedUpdates, 0) assert.NoError(t, err) - assert.Equal(t, numJobs*numAddresses*numUpdatesPerAddress+numAddresses, getTokenTableRowCount(t, db)) + assert.Equal(t, numAddresses, getTokenTableRowCount(t, db)) prices, err = orm.GetTokenPricesByDestChain(ctx, destSelector) assert.NoError(t, err) @@ -303,46 +309,68 @@ func TestORM_InsertAndGetTokenPrices(t *testing.T) { } } -func TestORM_InsertAndDeleteTokenPrices(t *testing.T) { +func TestORM_InsertTokenPricesWhenExpired(t *testing.T) { t.Parallel() ctx := testutils.Context(t) - - orm, db := setupORM(t) + orm, _ := setupORM(t) numAddresses := 10 - numUpdatesPerAddress := 20 - destSelector := uint64(1) - + destSelector := rand.Uint64() addrs := generateTokenAddresses(numAddresses) + initTokenUpdates := generateRandomTokenPrices(addrs) - updates := make(map[string][]TokenPriceUpdate) - for _, addr := range addrs { - updates[addr] = generateTokenPriceUpdates(addr, numUpdatesPerAddress) - } + // Insert the first time, table is initialized + rowsUpdated, err := orm.UpsertTokenPricesForDestChain(ctx, destSelector, initTokenUpdates, time.Minute) + require.NoError(t, err) + assert.Equal(t, int64(numAddresses), rowsUpdated) - for _, updatesPerAddr := range updates { - err := orm.InsertTokenPricesForDestChain(ctx, destSelector, 1, updatesPerAddr) - assert.NoError(t, err) - } + //time.Sleep(100 * time.Millisecond) - sleepSec := 2 - time.Sleep(time.Duration(sleepSec) * time.Second) + // Insert the second time, no updates, because prices haven't changed + rowsUpdated, err = orm.UpsertTokenPricesForDestChain(ctx, destSelector, initTokenUpdates, time.Minute) + require.NoError(t, err) + assert.Equal(t, int64(0), rowsUpdated) - // insert for the 2nd time after interimTimeStamp - for _, updatesPerAddr := range updates { - err := orm.InsertTokenPricesForDestChain(ctx, destSelector, 1, updatesPerAddr) - assert.NoError(t, err) + // There are new prices, but we still haven't reached interval + newPrices := generateRandomTokenPrices(addrs) + rowsUpdated, err = orm.UpsertTokenPricesForDestChain(ctx, destSelector, newPrices, time.Minute) + require.NoError(t, err) + assert.Equal(t, int64(0), rowsUpdated) + + time.Sleep(100 * time.Millisecond) + + // Again with the same new prices, but this time interval is reached + rowsUpdated, err = orm.UpsertTokenPricesForDestChain(ctx, destSelector, newPrices, time.Millisecond) + require.NoError(t, err) + assert.Equal(t, int64(numAddresses), rowsUpdated) + + dbTokenPrices, err := orm.GetTokenPricesByDestChain(ctx, destSelector) + require.NoError(t, err) + assert.Len(t, dbTokenPrices, numAddresses) + + dbTokenPricesByAddr := toTokensByAddress(dbTokenPrices) + for _, tkPrice := range newPrices { + dbToken, ok := dbTokenPricesByAddr[tkPrice.TokenAddr] + assert.True(t, ok) + assert.Equal(t, dbToken, tkPrice.TokenPrice) } +} - assert.Equal(t, 2*numAddresses*numUpdatesPerAddress, getTokenTableRowCount(t, db)) +func Benchmark_UpsertsTheSameTokenPrices(b *testing.B) { + db := pgtest.NewSqlxDB(b) + orm, err := NewORM(db, logger.NullLogger) + require.NoError(b, err) - // clear by sleepSec should delete rows inserted before it - err := orm.ClearTokenPricesByDestChain(ctx, destSelector, sleepSec) - assert.NoError(t, err) - assert.Equal(t, numAddresses*numUpdatesPerAddress, getTokenTableRowCount(t, db)) + ctx := testutils.Context(b) + numAddresses := 50 + destSelector := rand.Uint64() + addrs := generateTokenAddresses(numAddresses) + tokenUpdates := generateRandomTokenPrices(addrs) - // clear by 0 expiration seconds should delete all rows - err = orm.ClearTokenPricesByDestChain(ctx, destSelector, 0) - assert.NoError(t, err) - assert.Equal(t, 0, getTokenTableRowCount(t, db)) + b.ResetTimer() + + for i := 0; i < b.N; i++ { + _, err1 := orm.UpsertTokenPricesForDestChain(ctx, destSelector, tokenUpdates, time.Second) + require.NoError(b, err1) + } } diff --git a/core/services/chainlink/application.go b/core/services/chainlink/application.go index 9a2d08d000c..873f5080c6a 100644 --- a/core/services/chainlink/application.go +++ b/core/services/chainlink/application.go @@ -14,25 +14,27 @@ import ( "github.com/grafana/pyroscope-go" "github.com/jonboulle/clockwork" "github.com/pkg/errors" + "go.opentelemetry.io/otel" + "go.opentelemetry.io/otel/attribute" + "go.opentelemetry.io/otel/trace" "go.uber.org/multierr" "go.uber.org/zap/zapcore" - pkgcapabilities "github.com/smartcontractkit/chainlink-common/pkg/capabilities" "github.com/smartcontractkit/chainlink-common/pkg/loop" commonservices "github.com/smartcontractkit/chainlink-common/pkg/services" "github.com/smartcontractkit/chainlink-common/pkg/sqlutil" - coretypes "github.com/smartcontractkit/chainlink-common/pkg/types/core" "github.com/smartcontractkit/chainlink-common/pkg/utils" "github.com/smartcontractkit/chainlink-common/pkg/utils/jsonserializable" "github.com/smartcontractkit/chainlink-common/pkg/utils/mailbox" - "github.com/smartcontractkit/chainlink/v2/core/capabilities" - "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" - "github.com/smartcontractkit/chainlink/v2/core/services/standardcapabilities" - "github.com/smartcontractkit/chainlink/v2/core/static" "github.com/smartcontractkit/chainlink/v2/core/bridges" "github.com/smartcontractkit/chainlink/v2/core/build" + "github.com/smartcontractkit/chainlink/v2/core/capabilities" + "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip" + gatewayconnector "github.com/smartcontractkit/chainlink/v2/core/capabilities/gateway_connector" "github.com/smartcontractkit/chainlink/v2/core/capabilities/remote" + remotetypes "github.com/smartcontractkit/chainlink/v2/core/capabilities/remote/types" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/txmgr" evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" evmutils "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils" @@ -47,6 +49,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/feeds" "github.com/smartcontractkit/chainlink/v2/core/services/fluxmonitorv2" "github.com/smartcontractkit/chainlink/v2/core/services/gateway" + "github.com/smartcontractkit/chainlink/v2/core/services/headreporter" "github.com/smartcontractkit/chainlink/v2/core/services/job" "github.com/smartcontractkit/chainlink/v2/core/services/keeper" "github.com/smartcontractkit/chainlink/v2/core/services/keystore" @@ -58,10 +61,10 @@ import ( externalp2p "github.com/smartcontractkit/chainlink/v2/core/services/p2p/wrapper" "github.com/smartcontractkit/chainlink/v2/core/services/periodicbackup" "github.com/smartcontractkit/chainlink/v2/core/services/pipeline" - "github.com/smartcontractkit/chainlink/v2/core/services/promreporter" "github.com/smartcontractkit/chainlink/v2/core/services/registrysyncer" "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury" "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury/wsrpc" + "github.com/smartcontractkit/chainlink/v2/core/services/standardcapabilities" "github.com/smartcontractkit/chainlink/v2/core/services/streams" "github.com/smartcontractkit/chainlink/v2/core/services/telemetry" "github.com/smartcontractkit/chainlink/v2/core/services/vrf" @@ -71,12 +74,11 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/sessions" "github.com/smartcontractkit/chainlink/v2/core/sessions/ldapauth" "github.com/smartcontractkit/chainlink/v2/core/sessions/localauth" + "github.com/smartcontractkit/chainlink/v2/core/static" "github.com/smartcontractkit/chainlink/v2/plugins" ) // Application implements the common functions used in the core node. -// -//go:generate mockery --quiet --name Application --output ../../internal/mocks/ --case=underscore type Application interface { Start(ctx context.Context) error Stop() error @@ -151,7 +153,6 @@ type ChainlinkApplication struct { shutdownOnce sync.Once srvcs []services.ServiceCtx HealthChecker services.Checker - Nurse *services.Nurse logger logger.SugaredLogger AuditLogger audit.AuditLogger closeLogger func() error @@ -182,7 +183,9 @@ type ApplicationOpts struct { LoopRegistry *plugins.LoopRegistry GRPCOpts loop.GRPCOpts MercuryPool wsrpc.Pool - CapabilitiesRegistry coretypes.CapabilitiesRegistry + CapabilitiesRegistry *capabilities.Registry + CapabilitiesDispatcher remotetypes.Dispatcher + CapabilitiesPeerWrapper p2ptypes.PeerWrapper } // NewApplication initializes a new store if one is not already @@ -202,47 +205,79 @@ func NewApplication(opts ApplicationOpts) (Application, error) { restrictedHTTPClient := opts.RestrictedHTTPClient unrestrictedHTTPClient := opts.UnrestrictedHTTPClient - if opts.CapabilitiesRegistry == nil { // for tests only, in prod Registry is always set at this point + if opts.CapabilitiesRegistry == nil { + // for tests only, in prod Registry should always be set at this point opts.CapabilitiesRegistry = capabilities.NewRegistry(globalLogger) } var externalPeerWrapper p2ptypes.PeerWrapper - var getLocalNode func(ctx context.Context) (pkgcapabilities.Node, error) if cfg.Capabilities().Peering().Enabled() { - externalPeer := externalp2p.NewExternalPeerWrapper(keyStore.P2P(), cfg.Capabilities().Peering(), opts.DS, globalLogger) - signer := externalPeer - externalPeerWrapper = externalPeer + var dispatcher remotetypes.Dispatcher + if opts.CapabilitiesDispatcher == nil { + externalPeer := externalp2p.NewExternalPeerWrapper(keyStore.P2P(), cfg.Capabilities().Peering(), opts.DS, globalLogger) + signer := externalPeer + externalPeerWrapper = externalPeer + remoteDispatcher, err := remote.NewDispatcher(cfg.Capabilities().Dispatcher(), externalPeerWrapper, signer, opts.CapabilitiesRegistry, globalLogger) + if err != nil { + return nil, fmt.Errorf("could not create dispatcher: %w", err) + } + dispatcher = remoteDispatcher + } else { + dispatcher = opts.CapabilitiesDispatcher + externalPeerWrapper = opts.CapabilitiesPeerWrapper + } - srvcs = append(srvcs, externalPeerWrapper) + srvcs = append(srvcs, externalPeerWrapper, dispatcher) - dispatcher := remote.NewDispatcher(externalPeerWrapper, signer, opts.CapabilitiesRegistry, globalLogger) + if cfg.Capabilities().ExternalRegistry().Address() != "" { + rid := cfg.Capabilities().ExternalRegistry().RelayID() + registryAddress := cfg.Capabilities().ExternalRegistry().Address() + relayer, err := relayerChainInterops.Get(rid) + if err != nil { + return nil, fmt.Errorf("could not fetch relayer %s configured for capabilities registry: %w", rid, err) + } + registrySyncer, err := registrysyncer.New( + globalLogger, + func() (p2ptypes.PeerID, error) { + p := externalPeerWrapper.GetPeer() + if p == nil { + return p2ptypes.PeerID{}, errors.New("could not get peer") + } - rid := cfg.Capabilities().ExternalRegistry().RelayID() - registryAddress := cfg.Capabilities().ExternalRegistry().Address() - relayer, err := relayerChainInterops.Get(rid) - if err != nil { - return nil, fmt.Errorf("could not fetch relayer %s configured for capabilities registry: %w", rid, err) - } + return p.ID(), nil + }, + relayer, + registryAddress, + registrysyncer.NewORM(opts.DS, globalLogger), + ) + if err != nil { + return nil, fmt.Errorf("could not configure syncer: %w", err) + } - registrySyncer, err := registrysyncer.New( - globalLogger, - relayer, - registryAddress, - ) - if err != nil { - return nil, fmt.Errorf("could not configure syncer: %w", err) - } + wfLauncher := capabilities.NewLauncher( + globalLogger, + externalPeerWrapper, + dispatcher, + opts.CapabilitiesRegistry, + ) + registrySyncer.AddLauncher(wfLauncher) - wfLauncher := capabilities.NewLauncher( - globalLogger, - externalPeerWrapper, - dispatcher, - opts.CapabilitiesRegistry, - ) - registrySyncer.AddLauncher(wfLauncher) + srvcs = append(srvcs, wfLauncher, registrySyncer) + } + } else { + globalLogger.Debug("External registry not configured, skipping registry syncer and starting with an empty registry") + opts.CapabilitiesRegistry.SetLocalRegistry(&capabilities.TestMetadataRegistry{}) + } - getLocalNode = wfLauncher.LocalNode - srvcs = append(srvcs, dispatcher, wfLauncher, registrySyncer) + var gatewayConnectorWrapper *gatewayconnector.ServiceWrapper + if cfg.Capabilities().GatewayConnector().DonID() != "" { + globalLogger.Debugw("Creating GatewayConnector wrapper", "donID", cfg.Capabilities().GatewayConnector().DonID()) + gatewayConnectorWrapper = gatewayconnector.NewGatewayConnectorServiceWrapper( + cfg.Capabilities().GatewayConnector(), + keyStore.Eth(), + clockwork.NewRealClock(), + globalLogger) + srvcs = append(srvcs, gatewayConnectorWrapper) } // LOOPs can be created as options, in the case of LOOP relayers, or @@ -251,7 +286,7 @@ func NewApplication(opts ApplicationOpts) (Application, error) { // we need to initialize in case we serve OCR2 LOOPs loopRegistry := opts.LoopRegistry if loopRegistry == nil { - loopRegistry = plugins.NewLoopRegistry(globalLogger, opts.Config.Tracing()) + loopRegistry = plugins.NewLoopRegistry(globalLogger, opts.Config.Tracing(), opts.Config.Telemetry()) } // If the audit logger is enabled @@ -272,14 +307,9 @@ func NewApplication(opts ApplicationOpts) (Application, error) { } ap := cfg.AutoPprof() - var nurse *services.Nurse if ap.Enabled() { globalLogger.Info("Nurse service (automatic pprof profiling) is enabled") - nurse = services.NewNurse(ap, globalLogger) - err := nurse.Start() - if err != nil { - return nil, err - } + srvcs = append(srvcs, services.NewNurse(ap, globalLogger)) } else { globalLogger.Info("Nurse service (automatic pprof profiling) is disabled") } @@ -315,8 +345,6 @@ func NewApplication(opts ApplicationOpts) (Application, error) { srvcs = append(srvcs, mailMon) srvcs = append(srvcs, relayerChainInterops.Services()...) - promReporter := promreporter.NewPromReporter(opts.DS, legacyEVMChains, globalLogger) - srvcs = append(srvcs, promReporter) // Initialize Local Users ORM and Authentication Provider specified in config // BasicAdminUsersORM is initialized and required regardless of separate Authentication Provider @@ -356,8 +384,16 @@ func NewApplication(opts ApplicationOpts) (Application, error) { workflowORM = workflowstore.NewDBStore(opts.DS, globalLogger, clockwork.NewRealClock()) ) + promReporter := headreporter.NewPrometheusReporter(opts.DS, legacyEVMChains) + chainIDs := make([]*big.Int, legacyEVMChains.Len()) + for i, chain := range legacyEVMChains.Slice() { + chainIDs[i] = chain.ID() + } + telemReporter := headreporter.NewTelemetryReporter(telemetryManager, globalLogger, chainIDs...) + headReporter := headreporter.NewHeadReporterService(opts.DS, globalLogger, promReporter, telemReporter) + srvcs = append(srvcs, headReporter) for _, chain := range legacyEVMChains.Slice() { - chain.HeadBroadcaster().Subscribe(promReporter) + chain.HeadBroadcaster().Subscribe(headReporter) chain.TxManager().RegisterResumeCallback(pipelineRunner.ResumeRun) } @@ -424,7 +460,8 @@ func NewApplication(opts ApplicationOpts) (Application, error) { loopRegistrarConfig, telemetryManager, pipelineRunner, - opts.RelayerChainInteroperators), + opts.RelayerChainInteroperators, + gatewayConnectorWrapper), } webhookJobRunner = delegates[job.Webhook].(*webhook.Delegate).WebhookJobRunner() ) @@ -433,7 +470,6 @@ func NewApplication(opts ApplicationOpts) (Application, error) { globalLogger, opts.CapabilitiesRegistry, workflowORM, - getLocalNode, ) // Flux monitor requires ethereum just to boot, silence errors with a null delegate @@ -514,6 +550,18 @@ func NewApplication(opts ApplicationOpts) (Application, error) { cfg.Insecure(), opts.RelayerChainInteroperators, ) + delegates[job.CCIP] = ccip.NewDelegate( + globalLogger, + loopRegistrarConfig, + pipelineRunner, + opts.RelayerChainInteroperators.LegacyEVMChains(), + relayerChainInterops, + opts.KeyStore, + opts.DS, + peerWrapper, + telemetryManager, + cfg.Capabilities(), + ) } else { globalLogger.Debug("Off-chain reporting v2 disabled") } @@ -545,6 +593,7 @@ func NewApplication(opts ApplicationOpts) (Application, error) { jobSpawner, keyStore, cfg, + cfg.Feature(), cfg.Insecure(), cfg.JobPipeline(), cfg.OCR(), @@ -584,7 +633,6 @@ func NewApplication(opts ApplicationOpts) (Application, error) { SessionReaper: sessionReaper, ExternalInitiatorManager: externalInitiatorManager, HealthChecker: healthChecker, - Nurse: nurse, logger: globalLogger, AuditLogger: auditLogger, closeLogger: opts.CloseLogger, @@ -617,6 +665,14 @@ func (app *ChainlinkApplication) Start(ctx context.Context) error { panic("application is already started") } + var span trace.Span + ctx, span = otel.Tracer("").Start(ctx, "Start", trace.WithAttributes( + attribute.String("app-id", app.ID().String()), + attribute.String("version", static.Version), + attribute.String("commit", static.Sha), + )) + defer span.End() + if app.FeedsService != nil { if err := app.FeedsService.Start(ctx); err != nil { app.logger.Errorf("[Feeds Service] Failed to start %v", err) @@ -704,10 +760,6 @@ func (app *ChainlinkApplication) stop() (err error) { err = multierr.Append(err, app.FeedsService.Close()) } - if app.Nurse != nil { - err = multierr.Append(err, app.Nurse.Close()) - } - if app.profiler != nil { err = multierr.Append(err, app.profiler.Stop()) } @@ -867,7 +919,7 @@ func (app *ChainlinkApplication) RunJobV2( }, } } - runID, _, err = app.pipelineRunner.ExecuteAndInsertFinishedRun(ctx, *jb.PipelineSpec, pipeline.NewVarsFrom(vars), app.logger, saveTasks) + runID, _, err = app.pipelineRunner.ExecuteAndInsertFinishedRun(ctx, *jb.PipelineSpec, pipeline.NewVarsFrom(vars), saveTasks) } return runID, err } diff --git a/core/services/chainlink/cfgtest/cfgtest.go b/core/services/chainlink/cfgtest/cfgtest.go index 3bf95452650..1dfba71d469 100644 --- a/core/services/chainlink/cfgtest/cfgtest.go +++ b/core/services/chainlink/cfgtest/cfgtest.go @@ -76,7 +76,7 @@ func assertValNotNil(t *testing.T, key string, val reflect.Value) error { t.Helper() k := val.Kind() switch k { //nolint:exhaustive - case reflect.Ptr, reflect.Map: + case reflect.Ptr: if val.IsNil() { return fmt.Errorf("%s: nil", key) } @@ -94,6 +94,9 @@ func assertValNotNil(t *testing.T, key string, val reflect.Value) error { } return assertFieldsNotNil(t, key, val) case reflect.Map: + if val.IsNil() { + return nil // not actually a problem + } return assertValuesNotNil(t, key, val) case reflect.Slice: if val.IsNil() { diff --git a/core/services/chainlink/config.go b/core/services/chainlink/config.go index dc301c0967f..476e758ccbb 100644 --- a/core/services/chainlink/config.go +++ b/core/services/chainlink/config.go @@ -55,8 +55,13 @@ type RawConfig map[string]any // ValidateConfig returns an error if the Config is not valid for use, as-is. func (c *RawConfig) ValidateConfig() (err error) { if v, ok := (*c)["Enabled"]; ok { - if _, ok := v.(*bool); !ok { - err = multierr.Append(err, commonconfig.ErrInvalid{Name: "Enabled", Value: v, Msg: "expected *bool"}) + if _, ok := v.(bool); !ok { + err = multierr.Append(err, commonconfig.ErrInvalid{Name: "Enabled", Value: v, Msg: "expected bool"}) + } + } + if v, ok := (*c)["ChainID"]; ok { + if _, ok := v.(string); !ok { + err = multierr.Append(err, commonconfig.ErrInvalid{Name: "ChainID", Value: v, Msg: "expected string"}) } } return err @@ -67,7 +72,17 @@ func (c *RawConfig) IsEnabled() bool { return false } - return (*c)["Enabled"] == nil || *(*c)["Enabled"].(*bool) + enabled, ok := (*c)["Enabled"].(bool) + return ok && enabled +} + +func (c *RawConfig) ChainID() string { + if c == nil { + return "" + } + + chainID, _ := (*c)["ChainID"].(string) + return chainID } // TOMLString returns a TOML encoded string. @@ -170,6 +185,9 @@ func (c *Config) SetFrom(f *Config) (err error) { err = multierr.Append(err, commonconfig.NamedMultiErrorList(err4, "Starknet")) } + // the plugin should handle it's own defaults and merging + c.Aptos = f.Aptos + _, err = commonconfig.MultiErrorList(err) return err diff --git a/core/services/chainlink/config_capabilities.go b/core/services/chainlink/config_capabilities.go index c438ca249dd..032eec58bea 100644 --- a/core/services/chainlink/config_capabilities.go +++ b/core/services/chainlink/config_capabilities.go @@ -1,10 +1,9 @@ package chainlink import ( + "github.com/smartcontractkit/chainlink-common/pkg/types" "github.com/smartcontractkit/chainlink/v2/core/config" "github.com/smartcontractkit/chainlink/v2/core/config/toml" - - "github.com/smartcontractkit/chainlink-common/pkg/types" ) var _ config.Capabilities = (*capabilitiesConfig)(nil) @@ -23,6 +22,52 @@ func (c *capabilitiesConfig) ExternalRegistry() config.CapabilitiesExternalRegis } } +func (c *capabilitiesConfig) Dispatcher() config.Dispatcher { + return &dispatcher{d: c.c.Dispatcher} +} + +type dispatcher struct { + d toml.Dispatcher +} + +func (d *dispatcher) SupportedVersion() int { + return *d.d.SupportedVersion +} + +func (d *dispatcher) ReceiverBufferSize() int { + return *d.d.ReceiverBufferSize +} + +func (d *dispatcher) RateLimit() config.DispatcherRateLimit { + return &dispatcherRateLimit{r: d.d.RateLimit} +} + +type dispatcherRateLimit struct { + r toml.DispatcherRateLimit +} + +func (r *dispatcherRateLimit) GlobalRPS() float64 { + return *r.r.GlobalRPS +} + +func (r *dispatcherRateLimit) GlobalBurst() int { + return *r.r.GlobalBurst +} + +func (r *dispatcherRateLimit) PerSenderRPS() float64 { + return *r.r.PerSenderRPS +} + +func (r *dispatcherRateLimit) PerSenderBurst() int { + return *r.r.PerSenderBurst +} + +func (c *capabilitiesConfig) GatewayConnector() config.GatewayConnector { + return &gatewayConnector{ + c: c.c.GatewayConnector, + } +} + type capabilitiesExternalRegistry struct { c toml.ExternalRegistry } @@ -42,3 +87,50 @@ func (c *capabilitiesExternalRegistry) ChainID() string { func (c *capabilitiesExternalRegistry) Address() string { return *c.c.Address } + +type gatewayConnector struct { + c toml.GatewayConnector +} + +func (c *gatewayConnector) ChainIDForNodeKey() string { + return *c.c.ChainIDForNodeKey +} +func (c *gatewayConnector) NodeAddress() string { + return *c.c.NodeAddress +} + +func (c *gatewayConnector) DonID() string { + return *c.c.DonID +} + +func (c *gatewayConnector) Gateways() []config.ConnectorGateway { + t := make([]config.ConnectorGateway, len(c.c.Gateways)) + for index, element := range c.c.Gateways { + t[index] = &connectorGateway{element} + } + return t +} + +func (c *gatewayConnector) WSHandshakeTimeoutMillis() uint32 { + return *c.c.WSHandshakeTimeoutMillis +} + +func (c *gatewayConnector) AuthMinChallengeLen() int { + return *c.c.AuthMinChallengeLen +} + +func (c *gatewayConnector) AuthTimestampToleranceSec() uint32 { + return *c.c.AuthTimestampToleranceSec +} + +type connectorGateway struct { + c toml.ConnectorGateway +} + +func (c *connectorGateway) ID() string { + return *c.c.ID +} + +func (c *connectorGateway) URL() string { + return *c.c.URL +} diff --git a/core/services/chainlink/config_feature.go b/core/services/chainlink/config_feature.go index 2e968df052d..f5cc8786411 100644 --- a/core/services/chainlink/config_feature.go +++ b/core/services/chainlink/config_feature.go @@ -17,3 +17,7 @@ func (f *featureConfig) LogPoller() bool { func (f *featureConfig) UICSAKeys() bool { return *f.c.UICSAKeys } + +func (f *featureConfig) MultiFeedsManagers() bool { + return *f.c.MultiFeedsManagers +} diff --git a/core/services/chainlink/config_feature_test.go b/core/services/chainlink/config_feature_test.go index bc0418c157b..8fa5884450a 100644 --- a/core/services/chainlink/config_feature_test.go +++ b/core/services/chainlink/config_feature_test.go @@ -18,4 +18,5 @@ func TestFeatureConfig(t *testing.T) { assert.True(t, f.LogPoller()) assert.True(t, f.FeedsManager()) assert.True(t, f.UICSAKeys()) + assert.True(t, f.MultiFeedsManagers()) } diff --git a/core/services/chainlink/config_general.go b/core/services/chainlink/config_general.go index 5b6b839fb5e..dd0dc87b59a 100644 --- a/core/services/chainlink/config_general.go +++ b/core/services/chainlink/config_general.go @@ -209,6 +209,10 @@ func (g *generalConfig) StarknetConfigs() starknet.TOMLConfigs { return g.c.Starknet } +func (g *generalConfig) AptosConfigs() RawConfigs { + return g.c.Aptos +} + func (g *generalConfig) Validate() error { return g.validate(g.secrets.Validate) } @@ -520,5 +524,8 @@ func (g *generalConfig) Threshold() coreconfig.Threshold { func (g *generalConfig) Tracing() coreconfig.Tracing { return &tracingConfig{s: g.c.Tracing} } +func (g *generalConfig) Telemetry() coreconfig.Telemetry { + return &telemetryConfig{s: g.c.Telemetry} +} var zeroSha256Hash = models.Sha256Hash{} diff --git a/core/services/chainlink/config_telemetry.go b/core/services/chainlink/config_telemetry.go new file mode 100644 index 00000000000..790f2a19953 --- /dev/null +++ b/core/services/chainlink/config_telemetry.go @@ -0,0 +1,43 @@ +package chainlink + +import ( + "github.com/smartcontractkit/chainlink/v2/core/config/toml" +) + +type telemetryConfig struct { + s toml.Telemetry +} + +func (b *telemetryConfig) Enabled() bool { return *b.s.Enabled } + +func (b *telemetryConfig) InsecureConnection() bool { + if b.s.InsecureConnection == nil { + return false + } + return *b.s.InsecureConnection +} + +func (b *telemetryConfig) CACertFile() string { + if b.s.CACertFile == nil { + return "" + } + return *b.s.CACertFile +} + +func (b *telemetryConfig) OtelExporterGRPCEndpoint() string { + if b.s.Endpoint == nil { + return "" + } + return *b.s.Endpoint +} + +func (b *telemetryConfig) ResourceAttributes() map[string]string { + return b.s.ResourceAttributes +} + +func (b *telemetryConfig) TraceSampleRatio() float64 { + if b.s.TraceSampleRatio == nil { + return 0.0 + } + return *b.s.TraceSampleRatio +} diff --git a/core/services/chainlink/config_telemetry_ingress_test.go b/core/services/chainlink/config_telemetry_ingress_test.go index c371b465a2b..64e85b5493e 100644 --- a/core/services/chainlink/config_telemetry_ingress_test.go +++ b/core/services/chainlink/config_telemetry_ingress_test.go @@ -17,7 +17,7 @@ func TestTelemetryIngressConfig(t *testing.T) { ticfg := cfg.TelemetryIngress() assert.True(t, ticfg.Logging()) - assert.True(t, ticfg.UniConn()) + assert.False(t, ticfg.UniConn()) assert.Equal(t, uint(1234), ticfg.BufferSize()) assert.Equal(t, uint(4321), ticfg.MaxBatchSize()) assert.Equal(t, time.Minute, ticfg.SendInterval()) diff --git a/core/services/chainlink/config_test.go b/core/services/chainlink/config_test.go index c8cd5ec4790..375884d8fea 100644 --- a/core/services/chainlink/config_test.go +++ b/core/services/chainlink/config_test.go @@ -102,7 +102,7 @@ var ( ChainID: ubig.NewI(1), Chain: evmcfg.Chain{ FinalityDepth: ptr[uint32](26), - FinalityTagEnabled: ptr[bool](false), + FinalityTagEnabled: ptr[bool](true), FinalizedBlockOffset: ptr[uint32](12), }, Nodes: []*evmcfg.Node{ @@ -258,9 +258,11 @@ func TestConfig_Marshal(t *testing.T) { } full.Feature = toml.Feature{ - FeedsManager: ptr(true), - LogPoller: ptr(true), - UICSAKeys: ptr(true), + FeedsManager: ptr(true), + LogPoller: ptr(true), + UICSAKeys: ptr(true), + CCIP: ptr(true), + MultiFeedsManagers: ptr(true), } full.Database = toml.Database{ DefaultIdleInTxSessionTimeout: commoncfg.MustNewDuration(time.Minute), @@ -288,7 +290,7 @@ func TestConfig_Marshal(t *testing.T) { }, } full.TelemetryIngress = toml.TelemetryIngress{ - UniConn: ptr(true), + UniConn: ptr(false), Logging: ptr(true), BufferSize: ptr[uint16](1234), MaxBatchSize: ptr[uint16](4321), @@ -450,6 +452,27 @@ func TestConfig_Marshal(t *testing.T) { ChainID: ptr("1"), NetworkID: ptr("evm"), }, + Dispatcher: toml.Dispatcher{ + SupportedVersion: ptr(1), + ReceiverBufferSize: ptr(10000), + RateLimit: toml.DispatcherRateLimit{ + GlobalRPS: ptr(800.0), + GlobalBurst: ptr(1000), + PerSenderRPS: ptr(10.0), + PerSenderBurst: ptr(50), + }, + }, + GatewayConnector: toml.GatewayConnector{ + ChainIDForNodeKey: ptr("11155111"), + NodeAddress: ptr("0x68902d681c28119f9b2531473a417088bf008e59"), + DonID: ptr("example_don"), + WSHandshakeTimeoutMillis: ptr[uint32](100), + AuthMinChallengeLen: ptr[int](10), + AuthTimestampToleranceSec: ptr[uint32](10), + Gateways: []toml.ConnectorGateway{ + {ID: ptr("example_gateway"), URL: ptr("wss://localhost:8081/node")}, + }, + }, } full.Keeper = toml.Keeper{ DefaultTransactionQueueDepth: ptr[uint32](17), @@ -490,6 +513,14 @@ func TestConfig_Marshal(t *testing.T) { Environment: ptr("dev"), Release: ptr("v1.2.3"), } + full.Telemetry = toml.Telemetry{ + Enabled: ptr(true), + CACertFile: ptr("cert-file"), + Endpoint: ptr("example.com/collector"), + InsecureConnection: ptr(true), + ResourceAttributes: map[string]string{"Baz": "test", "Foo": "bar"}, + TraceSampleRatio: ptr(0.01), + } full.EVM = []*evmcfg.EVMConfig{ { ChainID: ubig.NewI(1), @@ -501,9 +532,9 @@ func TestConfig_Marshal(t *testing.T) { }, BlockBackfillDepth: ptr[uint32](100), BlockBackfillSkip: ptr(true), - ChainType: chaintype.NewChainTypeConfig("Optimism"), + ChainType: chaintype.NewConfig("Optimism"), FinalityDepth: ptr[uint32](42), - FinalityTagEnabled: ptr[bool](false), + FinalityTagEnabled: ptr[bool](true), FlagsContractAddress: mustAddress("0xae4E781a6218A8031764928E88d457937A954fC3"), FinalizedBlockOffset: ptr[uint32](16), @@ -519,6 +550,7 @@ func TestConfig_Marshal(t *testing.T) { LimitMax: ptr[uint64](17), LimitMultiplier: mustDecimal("1.234"), LimitTransfer: ptr[uint64](100), + EstimateLimit: ptr(false), TipCapDefault: assets.NewWeiI(2), TipCapMin: assets.NewWeiI(1), PriceDefault: assets.NewWeiI(math.MaxInt64), @@ -542,6 +574,9 @@ func TestConfig_Marshal(t *testing.T) { EIP1559FeeCapBufferBlocks: ptr[uint16](13), TransactionPercentile: ptr[uint16](15), }, + FeeHistory: evmcfg.FeeHistoryEstimator{ + CacheTimeout: &second, + }, }, KeySpecific: []evmcfg.KeySpecific{ @@ -553,19 +588,21 @@ func TestConfig_Marshal(t *testing.T) { }, }, - LinkContractAddress: mustAddress("0x538aAaB4ea120b2bC2fe5D296852D948F07D849e"), - LogBackfillBatchSize: ptr[uint32](17), - LogPollInterval: &minute, - LogKeepBlocksDepth: ptr[uint32](100000), - LogPrunePageSize: ptr[uint32](0), - BackupLogPollerBlockDelay: ptr[uint64](532), - MinContractPayment: commonassets.NewLinkFromJuels(math.MaxInt64), - MinIncomingConfirmations: ptr[uint32](13), - NonceAutoSync: ptr(true), - NoNewHeadsThreshold: &minute, - OperatorFactoryAddress: mustAddress("0xa5B85635Be42F21f94F28034B7DA440EeFF0F418"), - RPCDefaultBatchSize: ptr[uint32](17), - RPCBlockQueryDelay: ptr[uint16](10), + LinkContractAddress: mustAddress("0x538aAaB4ea120b2bC2fe5D296852D948F07D849e"), + LogBackfillBatchSize: ptr[uint32](17), + LogPollInterval: &minute, + LogKeepBlocksDepth: ptr[uint32](100000), + LogPrunePageSize: ptr[uint32](0), + BackupLogPollerBlockDelay: ptr[uint64](532), + MinContractPayment: commonassets.NewLinkFromJuels(math.MaxInt64), + MinIncomingConfirmations: ptr[uint32](13), + NonceAutoSync: ptr(true), + NoNewHeadsThreshold: &minute, + OperatorFactoryAddress: mustAddress("0xa5B85635Be42F21f94F28034B7DA440EeFF0F418"), + LogBroadcasterEnabled: ptr(true), + RPCDefaultBatchSize: ptr[uint32](17), + RPCBlockQueryDelay: ptr[uint16](10), + NoNewFinalizedHeadsThreshold: &hour, Transactions: evmcfg.Transactions{ MaxInFlight: ptr[uint32](19), @@ -585,6 +622,7 @@ func TestConfig_Marshal(t *testing.T) { SamplingInterval: &hour, FinalityTagBypass: ptr[bool](false), MaxAllowedFinalityDepth: ptr[uint32](1500), + PersistenceEnabled: ptr(false), }, NodePool: evmcfg.NodePool{ @@ -597,6 +635,7 @@ func TestConfig_Marshal(t *testing.T) { FinalizedBlockPollInterval: &second, EnforceRepeatableRead: ptr(true), DeathDeclarationDelay: &minute, + NewHeadsPollInterval: &zeroSeconds, Errors: evmcfg.ClientErrors{ NonceTooLow: ptr[string]("(: |^)nonce too low"), NonceTooHigh: ptr[string]("(: |^)nonce too high"), @@ -612,6 +651,7 @@ func TestConfig_Marshal(t *testing.T) { TransactionAlreadyMined: ptr[string]("(: |^)transaction already mined"), Fatal: ptr[string]("(: |^)fatal"), ServiceUnavailable: ptr[string]("(: |^)service unavailable"), + TooManyResults: ptr[string]("(: |^)too many results"), }, }, OCR: evmcfg.OCR{ @@ -627,6 +667,9 @@ func TestConfig_Marshal(t *testing.T) { GasLimit: ptr[uint32](540), }, }, + Workflow: evmcfg.Workflow{ + GasLimitDefault: ptr[uint64](400000), + }, }, Nodes: []*evmcfg.Node{ { @@ -667,11 +710,12 @@ func TestConfig_Marshal(t *testing.T) { ComputeUnitPriceDefault: ptr[uint64](100), FeeBumpPeriod: commoncfg.MustNewDuration(time.Minute), BlockHistoryPollPeriod: commoncfg.MustNewDuration(time.Minute), + ComputeUnitLimitDefault: ptr[uint32](100_000), }, Nodes: []*solcfg.Node{ {Name: ptr("primary"), URL: commoncfg.MustParseURL("http://solana.web")}, - {Name: ptr("foo"), URL: commoncfg.MustParseURL("http://solana.foo")}, - {Name: ptr("bar"), URL: commoncfg.MustParseURL("http://solana.bar")}, + {Name: ptr("foo"), URL: commoncfg.MustParseURL("http://solana.foo"), SendOnly: true}, + {Name: ptr("bar"), URL: commoncfg.MustParseURL("http://solana.bar"), SendOnly: true}, }, }, } @@ -770,6 +814,8 @@ Headers = ['Authorization: token', 'X-SomeOther-Header: value with spaces | and FeedsManager = true LogPoller = true UICSAKeys = true +CCIP = true +MultiFeedsManagers = true `}, {"Database", Config{Core: toml.Core{Database: full.Database}}, `[Database] DefaultIdleInTxSessionTimeout = '1m0s' @@ -797,7 +843,7 @@ LeaseDuration = '1m0s' LeaseRefreshInterval = '1s' `}, {"TelemetryIngress", Config{Core: toml.Core{TelemetryIngress: full.TelemetryIngress}}, `[TelemetryIngress] -UniConn = true +UniConn = false Logging = true BufferSize = 1234 MaxBatchSize = 4321 @@ -980,7 +1026,7 @@ BlockBackfillDepth = 100 BlockBackfillSkip = true ChainType = 'Optimism' FinalityDepth = 42 -FinalityTagEnabled = false +FinalityTagEnabled = true FlagsContractAddress = '0xae4E781a6218A8031764928E88d457937A954fC3' LinkContractAddress = '0x538aAaB4ea120b2bC2fe5D296852D948F07D849e' LogBackfillBatchSize = 17 @@ -993,9 +1039,11 @@ MinContractPayment = '9.223372036854775807 link' NonceAutoSync = true NoNewHeadsThreshold = '1m0s' OperatorFactoryAddress = '0xa5B85635Be42F21f94F28034B7DA440EeFF0F418' +LogBroadcasterEnabled = true RPCDefaultBatchSize = 17 RPCBlockQueryDelay = 10 FinalizedBlockOffset = 16 +NoNewFinalizedHeadsThreshold = '1h0m0s' [EVM.Transactions] ForwardersEnabled = true @@ -1020,6 +1068,7 @@ LimitDefault = 12 LimitMax = 17 LimitMultiplier = '1.234' LimitTransfer = 100 +EstimateLimit = false BumpMin = '100 wei' BumpPercent = 10 BumpThreshold = 6 @@ -1045,12 +1094,16 @@ CheckInclusionPercentile = 19 EIP1559FeeCapBufferBlocks = 13 TransactionPercentile = 15 +[EVM.GasEstimator.FeeHistory] +CacheTimeout = '1s' + [EVM.HeadTracker] HistoryDepth = 15 MaxBufferSize = 17 SamplingInterval = '1h0m0s' MaxAllowedFinalityDepth = 1500 FinalityTagBypass = false +PersistenceEnabled = false [[EVM.KeySpecific]] Key = '0x2a3e23c6f242F5345320814aC8a1b4E58707D292' @@ -1068,6 +1121,7 @@ NodeIsSyncingEnabled = true FinalizedBlockPollInterval = '1s' EnforceRepeatableRead = true DeathDeclarationDelay = '1m0s' +NewHeadsPollInterval = '0s' [EVM.NodePool.Errors] NonceTooLow = '(: |^)nonce too low' @@ -1084,6 +1138,7 @@ L2Full = '(: |^)l2 full' TransactionAlreadyMined = '(: |^)transaction already mined' Fatal = '(: |^)fatal' ServiceUnavailable = '(: |^)service unavailable' +TooManyResults = '(: |^)too many results' [EVM.OCR] ContractConfirmations = 11 @@ -1097,6 +1152,9 @@ ObservationGracePeriod = '1s' [EVM.OCR2.Automation] GasLimit = 540 +[EVM.Workflow] +GasLimitDefault = 400000 + [[EVM.Nodes]] Name = 'foo' WSURL = 'wss://web.socket/test/foo' @@ -1158,18 +1216,22 @@ ComputeUnitPriceMin = 10 ComputeUnitPriceDefault = 100 FeeBumpPeriod = '1m0s' BlockHistoryPollPeriod = '1m0s' +ComputeUnitLimitDefault = 100000 [[Solana.Nodes]] Name = 'primary' URL = 'http://solana.web' +SendOnly = false [[Solana.Nodes]] Name = 'foo' URL = 'http://solana.foo' +SendOnly = true [[Solana.Nodes]] Name = 'bar' URL = 'http://solana.bar' +SendOnly = true `}, {"Starknet", Config{Starknet: full.Starknet}, `[[Starknet]] ChainID = 'foobar' @@ -1233,6 +1295,9 @@ func TestConfig_full(t *testing.T) { if got.EVM[c].Workflow.ForwarderAddress == nil { got.EVM[c].Workflow.ForwarderAddress = &addr } + if got.EVM[c].Workflow.GasLimitDefault == nil { + got.EVM[c].Workflow.GasLimitDefault = ptr(uint64(400000)) + } for n := range got.EVM[c].Nodes { if got.EVM[c].Nodes[n].WSURL == nil { got.EVM[c].Nodes[n].WSURL = new(commoncfg.URL) @@ -1300,7 +1365,7 @@ func TestConfig_Validate(t *testing.T) { - 1: 10 errors: - ChainType: invalid value (Foo): must not be set with this chain id - Nodes: missing: must have at least one node - - ChainType: invalid value (Foo): must be one of arbitrum, celo, gnosis, kroma, metis, optimismBedrock, scroll, wemix, xlayer, zkevm, zksync or omitted + - ChainType: invalid value (Foo): must be one of arbitrum, astar, celo, gnosis, hedera, kroma, mantle, metis, optimismBedrock, scroll, wemix, xlayer, zkevm, zksync or omitted - HeadTracker.HistoryDepth: invalid value (30): must be greater than or equal to FinalizedBlockOffset - GasEstimator.BumpThreshold: invalid value (0): cannot be 0 if auto-purge feature is enabled for Foo - Transactions.AutoPurge.Threshold: missing: needs to be set if auto-purge feature is enabled for Foo @@ -1313,7 +1378,7 @@ func TestConfig_Validate(t *testing.T) { - 2: 5 errors: - ChainType: invalid value (Arbitrum): only "optimismBedrock" can be used with this chain id - Nodes: missing: must have at least one node - - ChainType: invalid value (Arbitrum): must be one of arbitrum, celo, gnosis, kroma, metis, optimismBedrock, scroll, wemix, xlayer, zkevm, zksync or omitted + - ChainType: invalid value (Arbitrum): must be one of arbitrum, astar, celo, gnosis, hedera, kroma, mantle, metis, optimismBedrock, scroll, wemix, xlayer, zkevm, zksync or omitted - FinalityDepth: invalid value (0): must be greater than or equal to 1 - MinIncomingConfirmations: invalid value (0): must be greater than or equal to 1 - 3.Nodes: 5 errors: @@ -1361,7 +1426,7 @@ func TestConfig_Validate(t *testing.T) { - 1: 2 errors: - ChainID: missing: required for all chains - Nodes: missing: must have at least one node - - Aptos.0.Enabled: invalid value (1): expected *bool`}, + - Aptos.0.Enabled: invalid value (1): expected bool`}, } { t.Run(tt.name, func(t *testing.T) { var c Config diff --git a/core/services/chainlink/mocks/general_config.go b/core/services/chainlink/mocks/general_config.go index 6c11a1fe3a0..63a846c6edb 100644 --- a/core/services/chainlink/mocks/general_config.go +++ b/core/services/chainlink/mocks/general_config.go @@ -4,6 +4,8 @@ package mocks import ( chainlinkconfig "github.com/smartcontractkit/chainlink-starknet/relayer/pkg/chainlink/config" + chainlink "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" + config "github.com/smartcontractkit/chainlink/v2/core/config" cosmosconfig "github.com/smartcontractkit/chainlink-cosmos/pkg/cosmos/config" @@ -26,6 +28,14 @@ type GeneralConfig struct { mock.Mock } +type GeneralConfig_Expecter struct { + mock *mock.Mock +} + +func (_m *GeneralConfig) EXPECT() *GeneralConfig_Expecter { + return &GeneralConfig_Expecter{mock: &_m.Mock} +} + // AppID provides a mock function with given fields: func (_m *GeneralConfig) AppID() uuid.UUID { ret := _m.Called() @@ -46,6 +56,80 @@ func (_m *GeneralConfig) AppID() uuid.UUID { return r0 } +// GeneralConfig_AppID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AppID' +type GeneralConfig_AppID_Call struct { + *mock.Call +} + +// AppID is a helper method to define mock.On call +func (_e *GeneralConfig_Expecter) AppID() *GeneralConfig_AppID_Call { + return &GeneralConfig_AppID_Call{Call: _e.mock.On("AppID")} +} + +func (_c *GeneralConfig_AppID_Call) Run(run func()) *GeneralConfig_AppID_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *GeneralConfig_AppID_Call) Return(_a0 uuid.UUID) *GeneralConfig_AppID_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *GeneralConfig_AppID_Call) RunAndReturn(run func() uuid.UUID) *GeneralConfig_AppID_Call { + _c.Call.Return(run) + return _c +} + +// AptosConfigs provides a mock function with given fields: +func (_m *GeneralConfig) AptosConfigs() chainlink.RawConfigs { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for AptosConfigs") + } + + var r0 chainlink.RawConfigs + if rf, ok := ret.Get(0).(func() chainlink.RawConfigs); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(chainlink.RawConfigs) + } + } + + return r0 +} + +// GeneralConfig_AptosConfigs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AptosConfigs' +type GeneralConfig_AptosConfigs_Call struct { + *mock.Call +} + +// AptosConfigs is a helper method to define mock.On call +func (_e *GeneralConfig_Expecter) AptosConfigs() *GeneralConfig_AptosConfigs_Call { + return &GeneralConfig_AptosConfigs_Call{Call: _e.mock.On("AptosConfigs")} +} + +func (_c *GeneralConfig_AptosConfigs_Call) Run(run func()) *GeneralConfig_AptosConfigs_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *GeneralConfig_AptosConfigs_Call) Return(_a0 chainlink.RawConfigs) *GeneralConfig_AptosConfigs_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *GeneralConfig_AptosConfigs_Call) RunAndReturn(run func() chainlink.RawConfigs) *GeneralConfig_AptosConfigs_Call { + _c.Call.Return(run) + return _c +} + // AptosEnabled provides a mock function with given fields: func (_m *GeneralConfig) AptosEnabled() bool { ret := _m.Called() @@ -64,6 +148,33 @@ func (_m *GeneralConfig) AptosEnabled() bool { return r0 } +// GeneralConfig_AptosEnabled_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AptosEnabled' +type GeneralConfig_AptosEnabled_Call struct { + *mock.Call +} + +// AptosEnabled is a helper method to define mock.On call +func (_e *GeneralConfig_Expecter) AptosEnabled() *GeneralConfig_AptosEnabled_Call { + return &GeneralConfig_AptosEnabled_Call{Call: _e.mock.On("AptosEnabled")} +} + +func (_c *GeneralConfig_AptosEnabled_Call) Run(run func()) *GeneralConfig_AptosEnabled_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *GeneralConfig_AptosEnabled_Call) Return(_a0 bool) *GeneralConfig_AptosEnabled_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *GeneralConfig_AptosEnabled_Call) RunAndReturn(run func() bool) *GeneralConfig_AptosEnabled_Call { + _c.Call.Return(run) + return _c +} + // AuditLogger provides a mock function with given fields: func (_m *GeneralConfig) AuditLogger() config.AuditLogger { ret := _m.Called() @@ -84,6 +195,33 @@ func (_m *GeneralConfig) AuditLogger() config.AuditLogger { return r0 } +// GeneralConfig_AuditLogger_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AuditLogger' +type GeneralConfig_AuditLogger_Call struct { + *mock.Call +} + +// AuditLogger is a helper method to define mock.On call +func (_e *GeneralConfig_Expecter) AuditLogger() *GeneralConfig_AuditLogger_Call { + return &GeneralConfig_AuditLogger_Call{Call: _e.mock.On("AuditLogger")} +} + +func (_c *GeneralConfig_AuditLogger_Call) Run(run func()) *GeneralConfig_AuditLogger_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *GeneralConfig_AuditLogger_Call) Return(_a0 config.AuditLogger) *GeneralConfig_AuditLogger_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *GeneralConfig_AuditLogger_Call) RunAndReturn(run func() config.AuditLogger) *GeneralConfig_AuditLogger_Call { + _c.Call.Return(run) + return _c +} + // AutoPprof provides a mock function with given fields: func (_m *GeneralConfig) AutoPprof() config.AutoPprof { ret := _m.Called() @@ -104,6 +242,33 @@ func (_m *GeneralConfig) AutoPprof() config.AutoPprof { return r0 } +// GeneralConfig_AutoPprof_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AutoPprof' +type GeneralConfig_AutoPprof_Call struct { + *mock.Call +} + +// AutoPprof is a helper method to define mock.On call +func (_e *GeneralConfig_Expecter) AutoPprof() *GeneralConfig_AutoPprof_Call { + return &GeneralConfig_AutoPprof_Call{Call: _e.mock.On("AutoPprof")} +} + +func (_c *GeneralConfig_AutoPprof_Call) Run(run func()) *GeneralConfig_AutoPprof_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *GeneralConfig_AutoPprof_Call) Return(_a0 config.AutoPprof) *GeneralConfig_AutoPprof_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *GeneralConfig_AutoPprof_Call) RunAndReturn(run func() config.AutoPprof) *GeneralConfig_AutoPprof_Call { + _c.Call.Return(run) + return _c +} + // Capabilities provides a mock function with given fields: func (_m *GeneralConfig) Capabilities() config.Capabilities { ret := _m.Called() @@ -124,6 +289,33 @@ func (_m *GeneralConfig) Capabilities() config.Capabilities { return r0 } +// GeneralConfig_Capabilities_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Capabilities' +type GeneralConfig_Capabilities_Call struct { + *mock.Call +} + +// Capabilities is a helper method to define mock.On call +func (_e *GeneralConfig_Expecter) Capabilities() *GeneralConfig_Capabilities_Call { + return &GeneralConfig_Capabilities_Call{Call: _e.mock.On("Capabilities")} +} + +func (_c *GeneralConfig_Capabilities_Call) Run(run func()) *GeneralConfig_Capabilities_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *GeneralConfig_Capabilities_Call) Return(_a0 config.Capabilities) *GeneralConfig_Capabilities_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *GeneralConfig_Capabilities_Call) RunAndReturn(run func() config.Capabilities) *GeneralConfig_Capabilities_Call { + _c.Call.Return(run) + return _c +} + // ConfigTOML provides a mock function with given fields: func (_m *GeneralConfig) ConfigTOML() (string, string) { ret := _m.Called() @@ -152,6 +344,33 @@ func (_m *GeneralConfig) ConfigTOML() (string, string) { return r0, r1 } +// GeneralConfig_ConfigTOML_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ConfigTOML' +type GeneralConfig_ConfigTOML_Call struct { + *mock.Call +} + +// ConfigTOML is a helper method to define mock.On call +func (_e *GeneralConfig_Expecter) ConfigTOML() *GeneralConfig_ConfigTOML_Call { + return &GeneralConfig_ConfigTOML_Call{Call: _e.mock.On("ConfigTOML")} +} + +func (_c *GeneralConfig_ConfigTOML_Call) Run(run func()) *GeneralConfig_ConfigTOML_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *GeneralConfig_ConfigTOML_Call) Return(user string, effective string) *GeneralConfig_ConfigTOML_Call { + _c.Call.Return(user, effective) + return _c +} + +func (_c *GeneralConfig_ConfigTOML_Call) RunAndReturn(run func() (string, string)) *GeneralConfig_ConfigTOML_Call { + _c.Call.Return(run) + return _c +} + // CosmosConfigs provides a mock function with given fields: func (_m *GeneralConfig) CosmosConfigs() cosmosconfig.TOMLConfigs { ret := _m.Called() @@ -172,6 +391,33 @@ func (_m *GeneralConfig) CosmosConfigs() cosmosconfig.TOMLConfigs { return r0 } +// GeneralConfig_CosmosConfigs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CosmosConfigs' +type GeneralConfig_CosmosConfigs_Call struct { + *mock.Call +} + +// CosmosConfigs is a helper method to define mock.On call +func (_e *GeneralConfig_Expecter) CosmosConfigs() *GeneralConfig_CosmosConfigs_Call { + return &GeneralConfig_CosmosConfigs_Call{Call: _e.mock.On("CosmosConfigs")} +} + +func (_c *GeneralConfig_CosmosConfigs_Call) Run(run func()) *GeneralConfig_CosmosConfigs_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *GeneralConfig_CosmosConfigs_Call) Return(_a0 cosmosconfig.TOMLConfigs) *GeneralConfig_CosmosConfigs_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *GeneralConfig_CosmosConfigs_Call) RunAndReturn(run func() cosmosconfig.TOMLConfigs) *GeneralConfig_CosmosConfigs_Call { + _c.Call.Return(run) + return _c +} + // CosmosEnabled provides a mock function with given fields: func (_m *GeneralConfig) CosmosEnabled() bool { ret := _m.Called() @@ -190,6 +436,33 @@ func (_m *GeneralConfig) CosmosEnabled() bool { return r0 } +// GeneralConfig_CosmosEnabled_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CosmosEnabled' +type GeneralConfig_CosmosEnabled_Call struct { + *mock.Call +} + +// CosmosEnabled is a helper method to define mock.On call +func (_e *GeneralConfig_Expecter) CosmosEnabled() *GeneralConfig_CosmosEnabled_Call { + return &GeneralConfig_CosmosEnabled_Call{Call: _e.mock.On("CosmosEnabled")} +} + +func (_c *GeneralConfig_CosmosEnabled_Call) Run(run func()) *GeneralConfig_CosmosEnabled_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *GeneralConfig_CosmosEnabled_Call) Return(_a0 bool) *GeneralConfig_CosmosEnabled_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *GeneralConfig_CosmosEnabled_Call) RunAndReturn(run func() bool) *GeneralConfig_CosmosEnabled_Call { + _c.Call.Return(run) + return _c +} + // Database provides a mock function with given fields: func (_m *GeneralConfig) Database() config.Database { ret := _m.Called() @@ -210,6 +483,33 @@ func (_m *GeneralConfig) Database() config.Database { return r0 } +// GeneralConfig_Database_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Database' +type GeneralConfig_Database_Call struct { + *mock.Call +} + +// Database is a helper method to define mock.On call +func (_e *GeneralConfig_Expecter) Database() *GeneralConfig_Database_Call { + return &GeneralConfig_Database_Call{Call: _e.mock.On("Database")} +} + +func (_c *GeneralConfig_Database_Call) Run(run func()) *GeneralConfig_Database_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *GeneralConfig_Database_Call) Return(_a0 config.Database) *GeneralConfig_Database_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *GeneralConfig_Database_Call) RunAndReturn(run func() config.Database) *GeneralConfig_Database_Call { + _c.Call.Return(run) + return _c +} + // EVMConfigs provides a mock function with given fields: func (_m *GeneralConfig) EVMConfigs() toml.EVMConfigs { ret := _m.Called() @@ -230,6 +530,33 @@ func (_m *GeneralConfig) EVMConfigs() toml.EVMConfigs { return r0 } +// GeneralConfig_EVMConfigs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EVMConfigs' +type GeneralConfig_EVMConfigs_Call struct { + *mock.Call +} + +// EVMConfigs is a helper method to define mock.On call +func (_e *GeneralConfig_Expecter) EVMConfigs() *GeneralConfig_EVMConfigs_Call { + return &GeneralConfig_EVMConfigs_Call{Call: _e.mock.On("EVMConfigs")} +} + +func (_c *GeneralConfig_EVMConfigs_Call) Run(run func()) *GeneralConfig_EVMConfigs_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *GeneralConfig_EVMConfigs_Call) Return(_a0 toml.EVMConfigs) *GeneralConfig_EVMConfigs_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *GeneralConfig_EVMConfigs_Call) RunAndReturn(run func() toml.EVMConfigs) *GeneralConfig_EVMConfigs_Call { + _c.Call.Return(run) + return _c +} + // EVMEnabled provides a mock function with given fields: func (_m *GeneralConfig) EVMEnabled() bool { ret := _m.Called() @@ -248,6 +575,33 @@ func (_m *GeneralConfig) EVMEnabled() bool { return r0 } +// GeneralConfig_EVMEnabled_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EVMEnabled' +type GeneralConfig_EVMEnabled_Call struct { + *mock.Call +} + +// EVMEnabled is a helper method to define mock.On call +func (_e *GeneralConfig_Expecter) EVMEnabled() *GeneralConfig_EVMEnabled_Call { + return &GeneralConfig_EVMEnabled_Call{Call: _e.mock.On("EVMEnabled")} +} + +func (_c *GeneralConfig_EVMEnabled_Call) Run(run func()) *GeneralConfig_EVMEnabled_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *GeneralConfig_EVMEnabled_Call) Return(_a0 bool) *GeneralConfig_EVMEnabled_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *GeneralConfig_EVMEnabled_Call) RunAndReturn(run func() bool) *GeneralConfig_EVMEnabled_Call { + _c.Call.Return(run) + return _c +} + // EVMRPCEnabled provides a mock function with given fields: func (_m *GeneralConfig) EVMRPCEnabled() bool { ret := _m.Called() @@ -266,6 +620,33 @@ func (_m *GeneralConfig) EVMRPCEnabled() bool { return r0 } +// GeneralConfig_EVMRPCEnabled_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EVMRPCEnabled' +type GeneralConfig_EVMRPCEnabled_Call struct { + *mock.Call +} + +// EVMRPCEnabled is a helper method to define mock.On call +func (_e *GeneralConfig_Expecter) EVMRPCEnabled() *GeneralConfig_EVMRPCEnabled_Call { + return &GeneralConfig_EVMRPCEnabled_Call{Call: _e.mock.On("EVMRPCEnabled")} +} + +func (_c *GeneralConfig_EVMRPCEnabled_Call) Run(run func()) *GeneralConfig_EVMRPCEnabled_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *GeneralConfig_EVMRPCEnabled_Call) Return(_a0 bool) *GeneralConfig_EVMRPCEnabled_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *GeneralConfig_EVMRPCEnabled_Call) RunAndReturn(run func() bool) *GeneralConfig_EVMRPCEnabled_Call { + _c.Call.Return(run) + return _c +} + // Feature provides a mock function with given fields: func (_m *GeneralConfig) Feature() config.Feature { ret := _m.Called() @@ -286,6 +667,33 @@ func (_m *GeneralConfig) Feature() config.Feature { return r0 } +// GeneralConfig_Feature_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Feature' +type GeneralConfig_Feature_Call struct { + *mock.Call +} + +// Feature is a helper method to define mock.On call +func (_e *GeneralConfig_Expecter) Feature() *GeneralConfig_Feature_Call { + return &GeneralConfig_Feature_Call{Call: _e.mock.On("Feature")} +} + +func (_c *GeneralConfig_Feature_Call) Run(run func()) *GeneralConfig_Feature_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *GeneralConfig_Feature_Call) Return(_a0 config.Feature) *GeneralConfig_Feature_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *GeneralConfig_Feature_Call) RunAndReturn(run func() config.Feature) *GeneralConfig_Feature_Call { + _c.Call.Return(run) + return _c +} + // FluxMonitor provides a mock function with given fields: func (_m *GeneralConfig) FluxMonitor() config.FluxMonitor { ret := _m.Called() @@ -306,6 +714,33 @@ func (_m *GeneralConfig) FluxMonitor() config.FluxMonitor { return r0 } +// GeneralConfig_FluxMonitor_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FluxMonitor' +type GeneralConfig_FluxMonitor_Call struct { + *mock.Call +} + +// FluxMonitor is a helper method to define mock.On call +func (_e *GeneralConfig_Expecter) FluxMonitor() *GeneralConfig_FluxMonitor_Call { + return &GeneralConfig_FluxMonitor_Call{Call: _e.mock.On("FluxMonitor")} +} + +func (_c *GeneralConfig_FluxMonitor_Call) Run(run func()) *GeneralConfig_FluxMonitor_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *GeneralConfig_FluxMonitor_Call) Return(_a0 config.FluxMonitor) *GeneralConfig_FluxMonitor_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *GeneralConfig_FluxMonitor_Call) RunAndReturn(run func() config.FluxMonitor) *GeneralConfig_FluxMonitor_Call { + _c.Call.Return(run) + return _c +} + // Insecure provides a mock function with given fields: func (_m *GeneralConfig) Insecure() config.Insecure { ret := _m.Called() @@ -326,6 +761,33 @@ func (_m *GeneralConfig) Insecure() config.Insecure { return r0 } +// GeneralConfig_Insecure_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Insecure' +type GeneralConfig_Insecure_Call struct { + *mock.Call +} + +// Insecure is a helper method to define mock.On call +func (_e *GeneralConfig_Expecter) Insecure() *GeneralConfig_Insecure_Call { + return &GeneralConfig_Insecure_Call{Call: _e.mock.On("Insecure")} +} + +func (_c *GeneralConfig_Insecure_Call) Run(run func()) *GeneralConfig_Insecure_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *GeneralConfig_Insecure_Call) Return(_a0 config.Insecure) *GeneralConfig_Insecure_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *GeneralConfig_Insecure_Call) RunAndReturn(run func() config.Insecure) *GeneralConfig_Insecure_Call { + _c.Call.Return(run) + return _c +} + // InsecureFastScrypt provides a mock function with given fields: func (_m *GeneralConfig) InsecureFastScrypt() bool { ret := _m.Called() @@ -344,6 +806,33 @@ func (_m *GeneralConfig) InsecureFastScrypt() bool { return r0 } +// GeneralConfig_InsecureFastScrypt_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'InsecureFastScrypt' +type GeneralConfig_InsecureFastScrypt_Call struct { + *mock.Call +} + +// InsecureFastScrypt is a helper method to define mock.On call +func (_e *GeneralConfig_Expecter) InsecureFastScrypt() *GeneralConfig_InsecureFastScrypt_Call { + return &GeneralConfig_InsecureFastScrypt_Call{Call: _e.mock.On("InsecureFastScrypt")} +} + +func (_c *GeneralConfig_InsecureFastScrypt_Call) Run(run func()) *GeneralConfig_InsecureFastScrypt_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *GeneralConfig_InsecureFastScrypt_Call) Return(_a0 bool) *GeneralConfig_InsecureFastScrypt_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *GeneralConfig_InsecureFastScrypt_Call) RunAndReturn(run func() bool) *GeneralConfig_InsecureFastScrypt_Call { + _c.Call.Return(run) + return _c +} + // JobPipeline provides a mock function with given fields: func (_m *GeneralConfig) JobPipeline() config.JobPipeline { ret := _m.Called() @@ -364,6 +853,33 @@ func (_m *GeneralConfig) JobPipeline() config.JobPipeline { return r0 } +// GeneralConfig_JobPipeline_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'JobPipeline' +type GeneralConfig_JobPipeline_Call struct { + *mock.Call +} + +// JobPipeline is a helper method to define mock.On call +func (_e *GeneralConfig_Expecter) JobPipeline() *GeneralConfig_JobPipeline_Call { + return &GeneralConfig_JobPipeline_Call{Call: _e.mock.On("JobPipeline")} +} + +func (_c *GeneralConfig_JobPipeline_Call) Run(run func()) *GeneralConfig_JobPipeline_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *GeneralConfig_JobPipeline_Call) Return(_a0 config.JobPipeline) *GeneralConfig_JobPipeline_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *GeneralConfig_JobPipeline_Call) RunAndReturn(run func() config.JobPipeline) *GeneralConfig_JobPipeline_Call { + _c.Call.Return(run) + return _c +} + // Keeper provides a mock function with given fields: func (_m *GeneralConfig) Keeper() config.Keeper { ret := _m.Called() @@ -384,6 +900,33 @@ func (_m *GeneralConfig) Keeper() config.Keeper { return r0 } +// GeneralConfig_Keeper_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Keeper' +type GeneralConfig_Keeper_Call struct { + *mock.Call +} + +// Keeper is a helper method to define mock.On call +func (_e *GeneralConfig_Expecter) Keeper() *GeneralConfig_Keeper_Call { + return &GeneralConfig_Keeper_Call{Call: _e.mock.On("Keeper")} +} + +func (_c *GeneralConfig_Keeper_Call) Run(run func()) *GeneralConfig_Keeper_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *GeneralConfig_Keeper_Call) Return(_a0 config.Keeper) *GeneralConfig_Keeper_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *GeneralConfig_Keeper_Call) RunAndReturn(run func() config.Keeper) *GeneralConfig_Keeper_Call { + _c.Call.Return(run) + return _c +} + // Log provides a mock function with given fields: func (_m *GeneralConfig) Log() config.Log { ret := _m.Called() @@ -404,11 +947,67 @@ func (_m *GeneralConfig) Log() config.Log { return r0 } +// GeneralConfig_Log_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Log' +type GeneralConfig_Log_Call struct { + *mock.Call +} + +// Log is a helper method to define mock.On call +func (_e *GeneralConfig_Expecter) Log() *GeneralConfig_Log_Call { + return &GeneralConfig_Log_Call{Call: _e.mock.On("Log")} +} + +func (_c *GeneralConfig_Log_Call) Run(run func()) *GeneralConfig_Log_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *GeneralConfig_Log_Call) Return(_a0 config.Log) *GeneralConfig_Log_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *GeneralConfig_Log_Call) RunAndReturn(run func() config.Log) *GeneralConfig_Log_Call { + _c.Call.Return(run) + return _c +} + // LogConfiguration provides a mock function with given fields: log, warn func (_m *GeneralConfig) LogConfiguration(log config.LogfFn, warn config.LogfFn) { _m.Called(log, warn) } +// GeneralConfig_LogConfiguration_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LogConfiguration' +type GeneralConfig_LogConfiguration_Call struct { + *mock.Call +} + +// LogConfiguration is a helper method to define mock.On call +// - log config.LogfFn +// - warn config.LogfFn +func (_e *GeneralConfig_Expecter) LogConfiguration(log interface{}, warn interface{}) *GeneralConfig_LogConfiguration_Call { + return &GeneralConfig_LogConfiguration_Call{Call: _e.mock.On("LogConfiguration", log, warn)} +} + +func (_c *GeneralConfig_LogConfiguration_Call) Run(run func(log config.LogfFn, warn config.LogfFn)) *GeneralConfig_LogConfiguration_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(config.LogfFn), args[1].(config.LogfFn)) + }) + return _c +} + +func (_c *GeneralConfig_LogConfiguration_Call) Return() *GeneralConfig_LogConfiguration_Call { + _c.Call.Return() + return _c +} + +func (_c *GeneralConfig_LogConfiguration_Call) RunAndReturn(run func(config.LogfFn, config.LogfFn)) *GeneralConfig_LogConfiguration_Call { + _c.Call.Return(run) + return _c +} + // Mercury provides a mock function with given fields: func (_m *GeneralConfig) Mercury() config.Mercury { ret := _m.Called() @@ -429,6 +1028,33 @@ func (_m *GeneralConfig) Mercury() config.Mercury { return r0 } +// GeneralConfig_Mercury_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Mercury' +type GeneralConfig_Mercury_Call struct { + *mock.Call +} + +// Mercury is a helper method to define mock.On call +func (_e *GeneralConfig_Expecter) Mercury() *GeneralConfig_Mercury_Call { + return &GeneralConfig_Mercury_Call{Call: _e.mock.On("Mercury")} +} + +func (_c *GeneralConfig_Mercury_Call) Run(run func()) *GeneralConfig_Mercury_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *GeneralConfig_Mercury_Call) Return(_a0 config.Mercury) *GeneralConfig_Mercury_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *GeneralConfig_Mercury_Call) RunAndReturn(run func() config.Mercury) *GeneralConfig_Mercury_Call { + _c.Call.Return(run) + return _c +} + // OCR provides a mock function with given fields: func (_m *GeneralConfig) OCR() config.OCR { ret := _m.Called() @@ -449,6 +1075,33 @@ func (_m *GeneralConfig) OCR() config.OCR { return r0 } +// GeneralConfig_OCR_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OCR' +type GeneralConfig_OCR_Call struct { + *mock.Call +} + +// OCR is a helper method to define mock.On call +func (_e *GeneralConfig_Expecter) OCR() *GeneralConfig_OCR_Call { + return &GeneralConfig_OCR_Call{Call: _e.mock.On("OCR")} +} + +func (_c *GeneralConfig_OCR_Call) Run(run func()) *GeneralConfig_OCR_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *GeneralConfig_OCR_Call) Return(_a0 config.OCR) *GeneralConfig_OCR_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *GeneralConfig_OCR_Call) RunAndReturn(run func() config.OCR) *GeneralConfig_OCR_Call { + _c.Call.Return(run) + return _c +} + // OCR2 provides a mock function with given fields: func (_m *GeneralConfig) OCR2() config.OCR2 { ret := _m.Called() @@ -469,6 +1122,33 @@ func (_m *GeneralConfig) OCR2() config.OCR2 { return r0 } +// GeneralConfig_OCR2_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OCR2' +type GeneralConfig_OCR2_Call struct { + *mock.Call +} + +// OCR2 is a helper method to define mock.On call +func (_e *GeneralConfig_Expecter) OCR2() *GeneralConfig_OCR2_Call { + return &GeneralConfig_OCR2_Call{Call: _e.mock.On("OCR2")} +} + +func (_c *GeneralConfig_OCR2_Call) Run(run func()) *GeneralConfig_OCR2_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *GeneralConfig_OCR2_Call) Return(_a0 config.OCR2) *GeneralConfig_OCR2_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *GeneralConfig_OCR2_Call) RunAndReturn(run func() config.OCR2) *GeneralConfig_OCR2_Call { + _c.Call.Return(run) + return _c +} + // P2P provides a mock function with given fields: func (_m *GeneralConfig) P2P() config.P2P { ret := _m.Called() @@ -489,6 +1169,33 @@ func (_m *GeneralConfig) P2P() config.P2P { return r0 } +// GeneralConfig_P2P_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'P2P' +type GeneralConfig_P2P_Call struct { + *mock.Call +} + +// P2P is a helper method to define mock.On call +func (_e *GeneralConfig_Expecter) P2P() *GeneralConfig_P2P_Call { + return &GeneralConfig_P2P_Call{Call: _e.mock.On("P2P")} +} + +func (_c *GeneralConfig_P2P_Call) Run(run func()) *GeneralConfig_P2P_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *GeneralConfig_P2P_Call) Return(_a0 config.P2P) *GeneralConfig_P2P_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *GeneralConfig_P2P_Call) RunAndReturn(run func() config.P2P) *GeneralConfig_P2P_Call { + _c.Call.Return(run) + return _c +} + // Password provides a mock function with given fields: func (_m *GeneralConfig) Password() config.Password { ret := _m.Called() @@ -509,6 +1216,33 @@ func (_m *GeneralConfig) Password() config.Password { return r0 } +// GeneralConfig_Password_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Password' +type GeneralConfig_Password_Call struct { + *mock.Call +} + +// Password is a helper method to define mock.On call +func (_e *GeneralConfig_Expecter) Password() *GeneralConfig_Password_Call { + return &GeneralConfig_Password_Call{Call: _e.mock.On("Password")} +} + +func (_c *GeneralConfig_Password_Call) Run(run func()) *GeneralConfig_Password_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *GeneralConfig_Password_Call) Return(_a0 config.Password) *GeneralConfig_Password_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *GeneralConfig_Password_Call) RunAndReturn(run func() config.Password) *GeneralConfig_Password_Call { + _c.Call.Return(run) + return _c +} + // Prometheus provides a mock function with given fields: func (_m *GeneralConfig) Prometheus() config.Prometheus { ret := _m.Called() @@ -529,6 +1263,33 @@ func (_m *GeneralConfig) Prometheus() config.Prometheus { return r0 } +// GeneralConfig_Prometheus_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Prometheus' +type GeneralConfig_Prometheus_Call struct { + *mock.Call +} + +// Prometheus is a helper method to define mock.On call +func (_e *GeneralConfig_Expecter) Prometheus() *GeneralConfig_Prometheus_Call { + return &GeneralConfig_Prometheus_Call{Call: _e.mock.On("Prometheus")} +} + +func (_c *GeneralConfig_Prometheus_Call) Run(run func()) *GeneralConfig_Prometheus_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *GeneralConfig_Prometheus_Call) Return(_a0 config.Prometheus) *GeneralConfig_Prometheus_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *GeneralConfig_Prometheus_Call) RunAndReturn(run func() config.Prometheus) *GeneralConfig_Prometheus_Call { + _c.Call.Return(run) + return _c +} + // Pyroscope provides a mock function with given fields: func (_m *GeneralConfig) Pyroscope() config.Pyroscope { ret := _m.Called() @@ -549,6 +1310,33 @@ func (_m *GeneralConfig) Pyroscope() config.Pyroscope { return r0 } +// GeneralConfig_Pyroscope_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Pyroscope' +type GeneralConfig_Pyroscope_Call struct { + *mock.Call +} + +// Pyroscope is a helper method to define mock.On call +func (_e *GeneralConfig_Expecter) Pyroscope() *GeneralConfig_Pyroscope_Call { + return &GeneralConfig_Pyroscope_Call{Call: _e.mock.On("Pyroscope")} +} + +func (_c *GeneralConfig_Pyroscope_Call) Run(run func()) *GeneralConfig_Pyroscope_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *GeneralConfig_Pyroscope_Call) Return(_a0 config.Pyroscope) *GeneralConfig_Pyroscope_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *GeneralConfig_Pyroscope_Call) RunAndReturn(run func() config.Pyroscope) *GeneralConfig_Pyroscope_Call { + _c.Call.Return(run) + return _c +} + // RootDir provides a mock function with given fields: func (_m *GeneralConfig) RootDir() string { ret := _m.Called() @@ -567,6 +1355,33 @@ func (_m *GeneralConfig) RootDir() string { return r0 } +// GeneralConfig_RootDir_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RootDir' +type GeneralConfig_RootDir_Call struct { + *mock.Call +} + +// RootDir is a helper method to define mock.On call +func (_e *GeneralConfig_Expecter) RootDir() *GeneralConfig_RootDir_Call { + return &GeneralConfig_RootDir_Call{Call: _e.mock.On("RootDir")} +} + +func (_c *GeneralConfig_RootDir_Call) Run(run func()) *GeneralConfig_RootDir_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *GeneralConfig_RootDir_Call) Return(_a0 string) *GeneralConfig_RootDir_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *GeneralConfig_RootDir_Call) RunAndReturn(run func() string) *GeneralConfig_RootDir_Call { + _c.Call.Return(run) + return _c +} + // Sentry provides a mock function with given fields: func (_m *GeneralConfig) Sentry() config.Sentry { ret := _m.Called() @@ -587,6 +1402,33 @@ func (_m *GeneralConfig) Sentry() config.Sentry { return r0 } +// GeneralConfig_Sentry_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Sentry' +type GeneralConfig_Sentry_Call struct { + *mock.Call +} + +// Sentry is a helper method to define mock.On call +func (_e *GeneralConfig_Expecter) Sentry() *GeneralConfig_Sentry_Call { + return &GeneralConfig_Sentry_Call{Call: _e.mock.On("Sentry")} +} + +func (_c *GeneralConfig_Sentry_Call) Run(run func()) *GeneralConfig_Sentry_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *GeneralConfig_Sentry_Call) Return(_a0 config.Sentry) *GeneralConfig_Sentry_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *GeneralConfig_Sentry_Call) RunAndReturn(run func() config.Sentry) *GeneralConfig_Sentry_Call { + _c.Call.Return(run) + return _c +} + // SetLogLevel provides a mock function with given fields: lvl func (_m *GeneralConfig) SetLogLevel(lvl zapcore.Level) error { ret := _m.Called(lvl) @@ -605,16 +1447,101 @@ func (_m *GeneralConfig) SetLogLevel(lvl zapcore.Level) error { return r0 } +// GeneralConfig_SetLogLevel_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetLogLevel' +type GeneralConfig_SetLogLevel_Call struct { + *mock.Call +} + +// SetLogLevel is a helper method to define mock.On call +// - lvl zapcore.Level +func (_e *GeneralConfig_Expecter) SetLogLevel(lvl interface{}) *GeneralConfig_SetLogLevel_Call { + return &GeneralConfig_SetLogLevel_Call{Call: _e.mock.On("SetLogLevel", lvl)} +} + +func (_c *GeneralConfig_SetLogLevel_Call) Run(run func(lvl zapcore.Level)) *GeneralConfig_SetLogLevel_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(zapcore.Level)) + }) + return _c +} + +func (_c *GeneralConfig_SetLogLevel_Call) Return(_a0 error) *GeneralConfig_SetLogLevel_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *GeneralConfig_SetLogLevel_Call) RunAndReturn(run func(zapcore.Level) error) *GeneralConfig_SetLogLevel_Call { + _c.Call.Return(run) + return _c +} + // SetLogSQL provides a mock function with given fields: logSQL func (_m *GeneralConfig) SetLogSQL(logSQL bool) { _m.Called(logSQL) } +// GeneralConfig_SetLogSQL_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetLogSQL' +type GeneralConfig_SetLogSQL_Call struct { + *mock.Call +} + +// SetLogSQL is a helper method to define mock.On call +// - logSQL bool +func (_e *GeneralConfig_Expecter) SetLogSQL(logSQL interface{}) *GeneralConfig_SetLogSQL_Call { + return &GeneralConfig_SetLogSQL_Call{Call: _e.mock.On("SetLogSQL", logSQL)} +} + +func (_c *GeneralConfig_SetLogSQL_Call) Run(run func(logSQL bool)) *GeneralConfig_SetLogSQL_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(bool)) + }) + return _c +} + +func (_c *GeneralConfig_SetLogSQL_Call) Return() *GeneralConfig_SetLogSQL_Call { + _c.Call.Return() + return _c +} + +func (_c *GeneralConfig_SetLogSQL_Call) RunAndReturn(run func(bool)) *GeneralConfig_SetLogSQL_Call { + _c.Call.Return(run) + return _c +} + // SetPasswords provides a mock function with given fields: keystore, vrf func (_m *GeneralConfig) SetPasswords(keystore *string, vrf *string) { _m.Called(keystore, vrf) } +// GeneralConfig_SetPasswords_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetPasswords' +type GeneralConfig_SetPasswords_Call struct { + *mock.Call +} + +// SetPasswords is a helper method to define mock.On call +// - keystore *string +// - vrf *string +func (_e *GeneralConfig_Expecter) SetPasswords(keystore interface{}, vrf interface{}) *GeneralConfig_SetPasswords_Call { + return &GeneralConfig_SetPasswords_Call{Call: _e.mock.On("SetPasswords", keystore, vrf)} +} + +func (_c *GeneralConfig_SetPasswords_Call) Run(run func(keystore *string, vrf *string)) *GeneralConfig_SetPasswords_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*string), args[1].(*string)) + }) + return _c +} + +func (_c *GeneralConfig_SetPasswords_Call) Return() *GeneralConfig_SetPasswords_Call { + _c.Call.Return() + return _c +} + +func (_c *GeneralConfig_SetPasswords_Call) RunAndReturn(run func(*string, *string)) *GeneralConfig_SetPasswords_Call { + _c.Call.Return(run) + return _c +} + // ShutdownGracePeriod provides a mock function with given fields: func (_m *GeneralConfig) ShutdownGracePeriod() time.Duration { ret := _m.Called() @@ -633,6 +1560,33 @@ func (_m *GeneralConfig) ShutdownGracePeriod() time.Duration { return r0 } +// GeneralConfig_ShutdownGracePeriod_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ShutdownGracePeriod' +type GeneralConfig_ShutdownGracePeriod_Call struct { + *mock.Call +} + +// ShutdownGracePeriod is a helper method to define mock.On call +func (_e *GeneralConfig_Expecter) ShutdownGracePeriod() *GeneralConfig_ShutdownGracePeriod_Call { + return &GeneralConfig_ShutdownGracePeriod_Call{Call: _e.mock.On("ShutdownGracePeriod")} +} + +func (_c *GeneralConfig_ShutdownGracePeriod_Call) Run(run func()) *GeneralConfig_ShutdownGracePeriod_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *GeneralConfig_ShutdownGracePeriod_Call) Return(_a0 time.Duration) *GeneralConfig_ShutdownGracePeriod_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *GeneralConfig_ShutdownGracePeriod_Call) RunAndReturn(run func() time.Duration) *GeneralConfig_ShutdownGracePeriod_Call { + _c.Call.Return(run) + return _c +} + // SolanaConfigs provides a mock function with given fields: func (_m *GeneralConfig) SolanaConfigs() solanaconfig.TOMLConfigs { ret := _m.Called() @@ -653,6 +1607,33 @@ func (_m *GeneralConfig) SolanaConfigs() solanaconfig.TOMLConfigs { return r0 } +// GeneralConfig_SolanaConfigs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SolanaConfigs' +type GeneralConfig_SolanaConfigs_Call struct { + *mock.Call +} + +// SolanaConfigs is a helper method to define mock.On call +func (_e *GeneralConfig_Expecter) SolanaConfigs() *GeneralConfig_SolanaConfigs_Call { + return &GeneralConfig_SolanaConfigs_Call{Call: _e.mock.On("SolanaConfigs")} +} + +func (_c *GeneralConfig_SolanaConfigs_Call) Run(run func()) *GeneralConfig_SolanaConfigs_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *GeneralConfig_SolanaConfigs_Call) Return(_a0 solanaconfig.TOMLConfigs) *GeneralConfig_SolanaConfigs_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *GeneralConfig_SolanaConfigs_Call) RunAndReturn(run func() solanaconfig.TOMLConfigs) *GeneralConfig_SolanaConfigs_Call { + _c.Call.Return(run) + return _c +} + // SolanaEnabled provides a mock function with given fields: func (_m *GeneralConfig) SolanaEnabled() bool { ret := _m.Called() @@ -671,6 +1652,33 @@ func (_m *GeneralConfig) SolanaEnabled() bool { return r0 } +// GeneralConfig_SolanaEnabled_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SolanaEnabled' +type GeneralConfig_SolanaEnabled_Call struct { + *mock.Call +} + +// SolanaEnabled is a helper method to define mock.On call +func (_e *GeneralConfig_Expecter) SolanaEnabled() *GeneralConfig_SolanaEnabled_Call { + return &GeneralConfig_SolanaEnabled_Call{Call: _e.mock.On("SolanaEnabled")} +} + +func (_c *GeneralConfig_SolanaEnabled_Call) Run(run func()) *GeneralConfig_SolanaEnabled_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *GeneralConfig_SolanaEnabled_Call) Return(_a0 bool) *GeneralConfig_SolanaEnabled_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *GeneralConfig_SolanaEnabled_Call) RunAndReturn(run func() bool) *GeneralConfig_SolanaEnabled_Call { + _c.Call.Return(run) + return _c +} + // StarkNetEnabled provides a mock function with given fields: func (_m *GeneralConfig) StarkNetEnabled() bool { ret := _m.Called() @@ -689,6 +1697,33 @@ func (_m *GeneralConfig) StarkNetEnabled() bool { return r0 } +// GeneralConfig_StarkNetEnabled_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StarkNetEnabled' +type GeneralConfig_StarkNetEnabled_Call struct { + *mock.Call +} + +// StarkNetEnabled is a helper method to define mock.On call +func (_e *GeneralConfig_Expecter) StarkNetEnabled() *GeneralConfig_StarkNetEnabled_Call { + return &GeneralConfig_StarkNetEnabled_Call{Call: _e.mock.On("StarkNetEnabled")} +} + +func (_c *GeneralConfig_StarkNetEnabled_Call) Run(run func()) *GeneralConfig_StarkNetEnabled_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *GeneralConfig_StarkNetEnabled_Call) Return(_a0 bool) *GeneralConfig_StarkNetEnabled_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *GeneralConfig_StarkNetEnabled_Call) RunAndReturn(run func() bool) *GeneralConfig_StarkNetEnabled_Call { + _c.Call.Return(run) + return _c +} + // StarknetConfigs provides a mock function with given fields: func (_m *GeneralConfig) StarknetConfigs() chainlinkconfig.TOMLConfigs { ret := _m.Called() @@ -709,6 +1744,80 @@ func (_m *GeneralConfig) StarknetConfigs() chainlinkconfig.TOMLConfigs { return r0 } +// GeneralConfig_StarknetConfigs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StarknetConfigs' +type GeneralConfig_StarknetConfigs_Call struct { + *mock.Call +} + +// StarknetConfigs is a helper method to define mock.On call +func (_e *GeneralConfig_Expecter) StarknetConfigs() *GeneralConfig_StarknetConfigs_Call { + return &GeneralConfig_StarknetConfigs_Call{Call: _e.mock.On("StarknetConfigs")} +} + +func (_c *GeneralConfig_StarknetConfigs_Call) Run(run func()) *GeneralConfig_StarknetConfigs_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *GeneralConfig_StarknetConfigs_Call) Return(_a0 chainlinkconfig.TOMLConfigs) *GeneralConfig_StarknetConfigs_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *GeneralConfig_StarknetConfigs_Call) RunAndReturn(run func() chainlinkconfig.TOMLConfigs) *GeneralConfig_StarknetConfigs_Call { + _c.Call.Return(run) + return _c +} + +// Telemetry provides a mock function with given fields: +func (_m *GeneralConfig) Telemetry() config.Telemetry { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Telemetry") + } + + var r0 config.Telemetry + if rf, ok := ret.Get(0).(func() config.Telemetry); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(config.Telemetry) + } + } + + return r0 +} + +// GeneralConfig_Telemetry_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Telemetry' +type GeneralConfig_Telemetry_Call struct { + *mock.Call +} + +// Telemetry is a helper method to define mock.On call +func (_e *GeneralConfig_Expecter) Telemetry() *GeneralConfig_Telemetry_Call { + return &GeneralConfig_Telemetry_Call{Call: _e.mock.On("Telemetry")} +} + +func (_c *GeneralConfig_Telemetry_Call) Run(run func()) *GeneralConfig_Telemetry_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *GeneralConfig_Telemetry_Call) Return(_a0 config.Telemetry) *GeneralConfig_Telemetry_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *GeneralConfig_Telemetry_Call) RunAndReturn(run func() config.Telemetry) *GeneralConfig_Telemetry_Call { + _c.Call.Return(run) + return _c +} + // TelemetryIngress provides a mock function with given fields: func (_m *GeneralConfig) TelemetryIngress() config.TelemetryIngress { ret := _m.Called() @@ -729,6 +1838,33 @@ func (_m *GeneralConfig) TelemetryIngress() config.TelemetryIngress { return r0 } +// GeneralConfig_TelemetryIngress_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TelemetryIngress' +type GeneralConfig_TelemetryIngress_Call struct { + *mock.Call +} + +// TelemetryIngress is a helper method to define mock.On call +func (_e *GeneralConfig_Expecter) TelemetryIngress() *GeneralConfig_TelemetryIngress_Call { + return &GeneralConfig_TelemetryIngress_Call{Call: _e.mock.On("TelemetryIngress")} +} + +func (_c *GeneralConfig_TelemetryIngress_Call) Run(run func()) *GeneralConfig_TelemetryIngress_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *GeneralConfig_TelemetryIngress_Call) Return(_a0 config.TelemetryIngress) *GeneralConfig_TelemetryIngress_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *GeneralConfig_TelemetryIngress_Call) RunAndReturn(run func() config.TelemetryIngress) *GeneralConfig_TelemetryIngress_Call { + _c.Call.Return(run) + return _c +} + // Threshold provides a mock function with given fields: func (_m *GeneralConfig) Threshold() config.Threshold { ret := _m.Called() @@ -749,6 +1885,33 @@ func (_m *GeneralConfig) Threshold() config.Threshold { return r0 } +// GeneralConfig_Threshold_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Threshold' +type GeneralConfig_Threshold_Call struct { + *mock.Call +} + +// Threshold is a helper method to define mock.On call +func (_e *GeneralConfig_Expecter) Threshold() *GeneralConfig_Threshold_Call { + return &GeneralConfig_Threshold_Call{Call: _e.mock.On("Threshold")} +} + +func (_c *GeneralConfig_Threshold_Call) Run(run func()) *GeneralConfig_Threshold_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *GeneralConfig_Threshold_Call) Return(_a0 config.Threshold) *GeneralConfig_Threshold_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *GeneralConfig_Threshold_Call) RunAndReturn(run func() config.Threshold) *GeneralConfig_Threshold_Call { + _c.Call.Return(run) + return _c +} + // Tracing provides a mock function with given fields: func (_m *GeneralConfig) Tracing() config.Tracing { ret := _m.Called() @@ -769,6 +1932,33 @@ func (_m *GeneralConfig) Tracing() config.Tracing { return r0 } +// GeneralConfig_Tracing_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Tracing' +type GeneralConfig_Tracing_Call struct { + *mock.Call +} + +// Tracing is a helper method to define mock.On call +func (_e *GeneralConfig_Expecter) Tracing() *GeneralConfig_Tracing_Call { + return &GeneralConfig_Tracing_Call{Call: _e.mock.On("Tracing")} +} + +func (_c *GeneralConfig_Tracing_Call) Run(run func()) *GeneralConfig_Tracing_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *GeneralConfig_Tracing_Call) Return(_a0 config.Tracing) *GeneralConfig_Tracing_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *GeneralConfig_Tracing_Call) RunAndReturn(run func() config.Tracing) *GeneralConfig_Tracing_Call { + _c.Call.Return(run) + return _c +} + // Validate provides a mock function with given fields: func (_m *GeneralConfig) Validate() error { ret := _m.Called() @@ -787,6 +1977,33 @@ func (_m *GeneralConfig) Validate() error { return r0 } +// GeneralConfig_Validate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Validate' +type GeneralConfig_Validate_Call struct { + *mock.Call +} + +// Validate is a helper method to define mock.On call +func (_e *GeneralConfig_Expecter) Validate() *GeneralConfig_Validate_Call { + return &GeneralConfig_Validate_Call{Call: _e.mock.On("Validate")} +} + +func (_c *GeneralConfig_Validate_Call) Run(run func()) *GeneralConfig_Validate_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *GeneralConfig_Validate_Call) Return(_a0 error) *GeneralConfig_Validate_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *GeneralConfig_Validate_Call) RunAndReturn(run func() error) *GeneralConfig_Validate_Call { + _c.Call.Return(run) + return _c +} + // ValidateDB provides a mock function with given fields: func (_m *GeneralConfig) ValidateDB() error { ret := _m.Called() @@ -805,6 +2022,33 @@ func (_m *GeneralConfig) ValidateDB() error { return r0 } +// GeneralConfig_ValidateDB_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ValidateDB' +type GeneralConfig_ValidateDB_Call struct { + *mock.Call +} + +// ValidateDB is a helper method to define mock.On call +func (_e *GeneralConfig_Expecter) ValidateDB() *GeneralConfig_ValidateDB_Call { + return &GeneralConfig_ValidateDB_Call{Call: _e.mock.On("ValidateDB")} +} + +func (_c *GeneralConfig_ValidateDB_Call) Run(run func()) *GeneralConfig_ValidateDB_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *GeneralConfig_ValidateDB_Call) Return(_a0 error) *GeneralConfig_ValidateDB_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *GeneralConfig_ValidateDB_Call) RunAndReturn(run func() error) *GeneralConfig_ValidateDB_Call { + _c.Call.Return(run) + return _c +} + // WebServer provides a mock function with given fields: func (_m *GeneralConfig) WebServer() config.WebServer { ret := _m.Called() @@ -825,6 +2069,33 @@ func (_m *GeneralConfig) WebServer() config.WebServer { return r0 } +// GeneralConfig_WebServer_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WebServer' +type GeneralConfig_WebServer_Call struct { + *mock.Call +} + +// WebServer is a helper method to define mock.On call +func (_e *GeneralConfig_Expecter) WebServer() *GeneralConfig_WebServer_Call { + return &GeneralConfig_WebServer_Call{Call: _e.mock.On("WebServer")} +} + +func (_c *GeneralConfig_WebServer_Call) Run(run func()) *GeneralConfig_WebServer_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *GeneralConfig_WebServer_Call) Return(_a0 config.WebServer) *GeneralConfig_WebServer_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *GeneralConfig_WebServer_Call) RunAndReturn(run func() config.WebServer) *GeneralConfig_WebServer_Call { + _c.Call.Return(run) + return _c +} + // NewGeneralConfig creates a new instance of GeneralConfig. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewGeneralConfig(t interface { diff --git a/core/services/chainlink/relayer_chain_interoperators.go b/core/services/chainlink/relayer_chain_interoperators.go index 60381c0d479..582dd61677c 100644 --- a/core/services/chainlink/relayer_chain_interoperators.go +++ b/core/services/chainlink/relayer_chain_interoperators.go @@ -8,7 +8,7 @@ import ( "sync" "github.com/smartcontractkit/chainlink-common/pkg/loop" - relay "github.com/smartcontractkit/chainlink-common/pkg/loop/adapters/relay" + "github.com/smartcontractkit/chainlink-common/pkg/loop/adapters/relay" "github.com/smartcontractkit/chainlink-common/pkg/types" "github.com/smartcontractkit/chainlink-cosmos/pkg/cosmos" "github.com/smartcontractkit/chainlink-cosmos/pkg/cosmos/adapters" @@ -186,6 +186,23 @@ func InitStarknet(ctx context.Context, factory RelayerFactory, config StarkNetFa } } +// InitAptos is a option for instantiating Aptos relayers +func InitAptos(ctx context.Context, factory RelayerFactory, config AptosFactoryConfig) CoreRelayerChainInitFunc { + return func(op *CoreRelayerChainInteroperators) (err error) { + relayers, err := factory.NewAptos(config.Keystore, config.TOMLConfigs) + if err != nil { + return fmt.Errorf("failed to setup aptos relayer: %w", err) + } + + for id, relayer := range relayers { + op.srvs = append(op.srvs, relayer) + op.loopRelayers[id] = relayer + } + + return nil + } +} + // Get a [loop.Relayer] by id func (rs *CoreRelayerChainInteroperators) Get(id types.RelayID) (loop.Relayer, error) { rs.mu.Lock() diff --git a/core/services/chainlink/relayer_chain_interoperators_test.go b/core/services/chainlink/relayer_chain_interoperators_test.go index aaf458c76c8..e83c2881c93 100644 --- a/core/services/chainlink/relayer_chain_interoperators_test.go +++ b/core/services/chainlink/relayer_chain_interoperators_test.go @@ -13,6 +13,7 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/loop" "github.com/smartcontractkit/chainlink-common/pkg/types" "github.com/smartcontractkit/chainlink-common/pkg/utils/mailbox" + "github.com/smartcontractkit/chainlink/v2/core/capabilities" coscfg "github.com/smartcontractkit/chainlink-cosmos/pkg/cosmos/config" solcfg "github.com/smartcontractkit/chainlink-solana/pkg/solana/config" @@ -174,9 +175,10 @@ func TestCoreRelayerChainInteroperators(t *testing.T) { lggr := logger.TestLogger(t) factory := chainlink.RelayerFactory{ - Logger: lggr, - LoopRegistry: plugins.NewLoopRegistry(lggr, nil), - GRPCOpts: loop.GRPCOpts{}, + Logger: lggr, + LoopRegistry: plugins.NewLoopRegistry(lggr, nil, nil), + GRPCOpts: loop.GRPCOpts{}, + CapabilitiesRegistry: capabilities.NewRegistry(lggr), } testctx := testutils.Context(t) diff --git a/core/services/chainlink/relayer_factory.go b/core/services/chainlink/relayer_factory.go index ae222f56c61..11e477a54f6 100644 --- a/core/services/chainlink/relayer_factory.go +++ b/core/services/chainlink/relayer_factory.go @@ -4,6 +4,7 @@ import ( "context" "errors" "fmt" + "net/http" "github.com/pelletier/go-toml/v2" @@ -11,15 +12,14 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/loop/adapters/relay" "github.com/smartcontractkit/chainlink-common/pkg/sqlutil" "github.com/smartcontractkit/chainlink-common/pkg/types" + coretypes "github.com/smartcontractkit/chainlink-common/pkg/types/core" "github.com/smartcontractkit/chainlink-cosmos/pkg/cosmos" coscfg "github.com/smartcontractkit/chainlink-cosmos/pkg/cosmos/config" "github.com/smartcontractkit/chainlink-solana/pkg/solana" solcfg "github.com/smartcontractkit/chainlink-solana/pkg/solana/config" pkgstarknet "github.com/smartcontractkit/chainlink-starknet/relayer/pkg/chainlink" starkchain "github.com/smartcontractkit/chainlink-starknet/relayer/pkg/chainlink/chain" - "github.com/smartcontractkit/chainlink-starknet/relayer/pkg/chainlink/config" - - "github.com/smartcontractkit/chainlink/v2/core/capabilities" + starkcfg "github.com/smartcontractkit/chainlink-starknet/relayer/pkg/chainlink/config" "github.com/smartcontractkit/chainlink/v2/core/chains/legacyevm" coreconfig "github.com/smartcontractkit/chainlink/v2/core/config" "github.com/smartcontractkit/chainlink/v2/core/config/env" @@ -37,7 +37,8 @@ type RelayerFactory struct { *plugins.LoopRegistry loop.GRPCOpts MercuryPool wsrpc.Pool - CapabilitiesRegistry *capabilities.Registry + CapabilitiesRegistry coretypes.CapabilitiesRegistry + HTTPClient *http.Client } type DummyFactoryConfig struct { @@ -86,6 +87,7 @@ func (r *RelayerFactory) NewEVM(ctx context.Context, config EVMFactoryConfig) (m MercuryPool: r.MercuryPool, TransmitterConfig: config.MercuryTransmitter, CapabilitiesRegistry: r.CapabilitiesRegistry, + HTTPClient: r.HTTPClient, } relayer, err2 := evmrelay.NewRelayer(lggr.Named(relayID.ChainID), chain, relayerOpts) if err2 != nil { @@ -172,12 +174,12 @@ func (r *RelayerFactory) NewSolana(ks keystore.Solana, chainCfgs solcfg.TOMLConf type StarkNetFactoryConfig struct { Keystore keystore.StarkNet - config.TOMLConfigs + starkcfg.TOMLConfigs } // TODO BCF-2606 consider consolidating the driving logic with that of NewSolana above via generics // perhaps when we implement a Cosmos LOOP -func (r *RelayerFactory) NewStarkNet(ks keystore.StarkNet, chainCfgs config.TOMLConfigs) (map[types.RelayID]loop.Relayer, error) { +func (r *RelayerFactory) NewStarkNet(ks keystore.StarkNet, chainCfgs starkcfg.TOMLConfigs) (map[types.RelayID]loop.Relayer, error) { starknetRelayers := make(map[types.RelayID]loop.Relayer) var ( @@ -206,7 +208,7 @@ func (r *RelayerFactory) NewStarkNet(ks keystore.StarkNet, chainCfgs config.TOML if cmdName := env.StarknetPlugin.Cmd.Get(); cmdName != "" { // setup the starknet relayer to be a LOOP cfgTOML, err := toml.Marshal(struct { - Starknet config.TOMLConfig + Starknet starkcfg.TOMLConfig }{Starknet: *chainCfg}) if err != nil { return nil, fmt.Errorf("failed to marshal StarkNet configs: %w", err) @@ -302,3 +304,65 @@ func (r *RelayerFactory) NewCosmos(config CosmosFactoryConfig) (map[types.RelayI } return relayers, nil } + +type AptosFactoryConfig struct { + Keystore keystore.Aptos + TOMLConfigs RawConfigs +} + +func (r *RelayerFactory) NewAptos(ks keystore.Aptos, chainCfgs RawConfigs) (map[types.RelayID]loop.Relayer, error) { + plugin := env.NewPlugin("aptos") + loopKs := &keystore.AptosLooppSigner{Aptos: ks} + return r.NewLOOPRelayer("Aptos", corerelay.NetworkAptos, plugin, loopKs, chainCfgs) +} + +func (r *RelayerFactory) NewLOOPRelayer(name string, network string, plugin env.Plugin, ks coretypes.Keystore, chainCfgs RawConfigs) (map[types.RelayID]loop.Relayer, error) { + relayers := make(map[types.RelayID]loop.Relayer) + lggr := r.Logger.Named(name) + + unique := make(map[string]struct{}) + // create one relayer per chain id + for _, chainCfg := range chainCfgs { + relayID := types.RelayID{Network: network, ChainID: chainCfg.ChainID()} + if _, alreadyExists := unique[relayID.Name()]; alreadyExists { + return nil, fmt.Errorf("duplicate chain definitions for %s", relayID.Name()) + } + unique[relayID.Name()] = struct{}{} + + // skip disabled chains from further processing + if !chainCfg.IsEnabled() { + lggr.Warnw("Skipping disabled chain", "id", relayID.ChainID) + continue + } + + lggr2 := lggr.Named(relayID.ChainID) + + cmdName := plugin.Cmd.Get() + if cmdName == "" { + return nil, fmt.Errorf("plugin not defined: %s", "") + } + + // setup the relayer as a LOOP + cfgTOML, err := toml.Marshal(chainCfg) + if err != nil { + return nil, fmt.Errorf("failed to marshal configs: %w", err) + } + + envVars, err := plugins.ParseEnvFile(plugin.Env.Get()) + if err != nil { + return nil, fmt.Errorf("failed to parse env file: %w", err) + } + cmdFn, err := plugins.NewCmdFactory(r.Register, plugins.CmdConfig{ + ID: relayID.Name(), + Cmd: cmdName, + Env: envVars, + }) + if err != nil { + return nil, fmt.Errorf("failed to create LOOP command: %w", err) + } + // the relayer service has a delicate keystore dependency. the value that is passed to NewRelayerService must + // be compatible with instantiating a starknet transaction manager KeystoreAdapter within the LOOPp executable. + relayers[relayID] = loop.NewRelayerService(lggr2, r.GRPCOpts, cmdFn, string(cfgTOML), ks, r.CapabilitiesRegistry) + } + return relayers, nil +} diff --git a/core/services/chainlink/testdata/config-empty-effective.toml b/core/services/chainlink/testdata/config-empty-effective.toml index 1bad3fd91c6..4cfe5e2086c 100644 --- a/core/services/chainlink/testdata/config-empty-effective.toml +++ b/core/services/chainlink/testdata/config-empty-effective.toml @@ -6,6 +6,8 @@ ShutdownGracePeriod = '5s' FeedsManager = true LogPoller = false UICSAKeys = false +CCIP = true +MultiFeedsManagers = false [Database] DefaultIdleInTxSessionTimeout = '1h0m0s' @@ -33,7 +35,7 @@ LeaseDuration = '10s' LeaseRefreshInterval = '1s' [TelemetryIngress] -UniConn = true +UniConn = false Logging = false BufferSize = 100 MaxBatchSize = 50 @@ -251,7 +253,36 @@ DeltaDial = '15s' DeltaReconcile = '1m0s' ListenAddresses = [] +[Capabilities.Dispatcher] +SupportedVersion = 1 +ReceiverBufferSize = 10000 + +[Capabilities.Dispatcher.RateLimit] +GlobalRPS = 800.0 +GlobalBurst = 1000 +PerSenderRPS = 10.0 +PerSenderBurst = 50 + [Capabilities.ExternalRegistry] Address = '' NetworkID = 'evm' ChainID = '1' + +[Capabilities.GatewayConnector] +ChainIDForNodeKey = '' +NodeAddress = '' +DonID = '' +WSHandshakeTimeoutMillis = 0 +AuthMinChallengeLen = 0 +AuthTimestampToleranceSec = 0 + +[[Capabilities.GatewayConnector.Gateways]] +ID = '' +URL = '' + +[Telemetry] +Enabled = false +CACertFile = '' +Endpoint = '' +InsecureConnection = false +TraceSampleRatio = 0.01 diff --git a/core/services/chainlink/testdata/config-full.toml b/core/services/chainlink/testdata/config-full.toml index 78f52805dfe..2cd36c34ff8 100644 --- a/core/services/chainlink/testdata/config-full.toml +++ b/core/services/chainlink/testdata/config-full.toml @@ -6,6 +6,8 @@ ShutdownGracePeriod = '10s' FeedsManager = true LogPoller = true UICSAKeys = true +CCIP = true +MultiFeedsManagers = true [Database] DefaultIdleInTxSessionTimeout = '1m0s' @@ -33,7 +35,7 @@ LeaseDuration = '1m0s' LeaseRefreshInterval = '1s' [TelemetryIngress] -UniConn = true +UniConn = false Logging = true BufferSize = 1234 MaxBatchSize = 4321 @@ -261,11 +263,44 @@ DeltaDial = '1m0s' DeltaReconcile = '2s' ListenAddresses = ['foo', 'bar'] +[Capabilities.Dispatcher] +SupportedVersion = 1 +ReceiverBufferSize = 10000 + +[Capabilities.Dispatcher.RateLimit] +GlobalRPS = 800.0 +GlobalBurst = 1000 +PerSenderRPS = 10.0 +PerSenderBurst = 50 + [Capabilities.ExternalRegistry] Address = '' NetworkID = 'evm' ChainID = '1' +[Capabilities.GatewayConnector] +ChainIDForNodeKey = '11155111' +NodeAddress = '0x68902d681c28119f9b2531473a417088bf008e59' +DonID = 'example_don' +WSHandshakeTimeoutMillis = 100 +AuthMinChallengeLen = 10 +AuthTimestampToleranceSec = 10 + +[[Capabilities.GatewayConnector.Gateways]] +ID = 'example_gateway' +URL = 'wss://localhost:8081/node' + +[Telemetry] +Enabled = true +CACertFile = 'cert-file' +Endpoint = 'example.com/collector' +InsecureConnection = true +TraceSampleRatio = 0.01 + +[Telemetry.ResourceAttributes] +Baz = 'test' +Foo = 'bar' + [[EVM]] ChainID = '1' Enabled = false @@ -274,7 +309,7 @@ BlockBackfillDepth = 100 BlockBackfillSkip = true ChainType = 'Optimism' FinalityDepth = 42 -FinalityTagEnabled = false +FinalityTagEnabled = true FlagsContractAddress = '0xae4E781a6218A8031764928E88d457937A954fC3' LinkContractAddress = '0x538aAaB4ea120b2bC2fe5D296852D948F07D849e' LogBackfillBatchSize = 17 @@ -287,9 +322,11 @@ MinContractPayment = '9.223372036854775807 link' NonceAutoSync = true NoNewHeadsThreshold = '1m0s' OperatorFactoryAddress = '0xa5B85635Be42F21f94F28034B7DA440EeFF0F418' +LogBroadcasterEnabled = true RPCDefaultBatchSize = 17 RPCBlockQueryDelay = 10 FinalizedBlockOffset = 16 +NoNewFinalizedHeadsThreshold = '1h0m0s' [EVM.Transactions] ForwardersEnabled = true @@ -314,6 +351,7 @@ LimitDefault = 12 LimitMax = 17 LimitMultiplier = '1.234' LimitTransfer = 100 +EstimateLimit = false BumpMin = '100 wei' BumpPercent = 10 BumpThreshold = 6 @@ -339,12 +377,16 @@ CheckInclusionPercentile = 19 EIP1559FeeCapBufferBlocks = 13 TransactionPercentile = 15 +[EVM.GasEstimator.FeeHistory] +CacheTimeout = '1s' + [EVM.HeadTracker] HistoryDepth = 15 MaxBufferSize = 17 SamplingInterval = '1h0m0s' MaxAllowedFinalityDepth = 1500 FinalityTagBypass = false +PersistenceEnabled = false [[EVM.KeySpecific]] Key = '0x2a3e23c6f242F5345320814aC8a1b4E58707D292' @@ -362,6 +404,7 @@ NodeIsSyncingEnabled = true FinalizedBlockPollInterval = '1s' EnforceRepeatableRead = true DeathDeclarationDelay = '1m0s' +NewHeadsPollInterval = '0s' [EVM.NodePool.Errors] NonceTooLow = '(: |^)nonce too low' @@ -378,6 +421,7 @@ L2Full = '(: |^)l2 full' TransactionAlreadyMined = '(: |^)transaction already mined' Fatal = '(: |^)fatal' ServiceUnavailable = '(: |^)service unavailable' +TooManyResults = '(: |^)too many results' [EVM.OCR] ContractConfirmations = 11 @@ -391,6 +435,9 @@ ObservationGracePeriod = '1s' [EVM.OCR2.Automation] GasLimit = 540 +[EVM.Workflow] +GasLimitDefault = 400000 + [[EVM.Nodes]] Name = 'foo' WSURL = 'wss://web.socket/test/foo' @@ -452,18 +499,22 @@ ComputeUnitPriceMin = 10 ComputeUnitPriceDefault = 100 FeeBumpPeriod = '1m0s' BlockHistoryPollPeriod = '1m0s' +ComputeUnitLimitDefault = 100000 [[Solana.Nodes]] Name = 'primary' URL = 'http://solana.web' +SendOnly = false [[Solana.Nodes]] Name = 'foo' URL = 'http://solana.foo' +SendOnly = true [[Solana.Nodes]] Name = 'bar' URL = 'http://solana.bar' +SendOnly = true [[Starknet]] ChainID = 'foobar' diff --git a/core/services/chainlink/testdata/config-multi-chain-effective.toml b/core/services/chainlink/testdata/config-multi-chain-effective.toml index 61c5e3fa266..b4cb107cdef 100644 --- a/core/services/chainlink/testdata/config-multi-chain-effective.toml +++ b/core/services/chainlink/testdata/config-multi-chain-effective.toml @@ -6,6 +6,8 @@ ShutdownGracePeriod = '5s' FeedsManager = true LogPoller = false UICSAKeys = false +CCIP = true +MultiFeedsManagers = false [Database] DefaultIdleInTxSessionTimeout = '1h0m0s' @@ -33,7 +35,7 @@ LeaseDuration = '10s' LeaseRefreshInterval = '1s' [TelemetryIngress] -UniConn = true +UniConn = false Logging = false BufferSize = 100 MaxBatchSize = 50 @@ -251,18 +253,47 @@ DeltaDial = '15s' DeltaReconcile = '1m0s' ListenAddresses = [] +[Capabilities.Dispatcher] +SupportedVersion = 1 +ReceiverBufferSize = 10000 + +[Capabilities.Dispatcher.RateLimit] +GlobalRPS = 800.0 +GlobalBurst = 1000 +PerSenderRPS = 10.0 +PerSenderBurst = 50 + [Capabilities.ExternalRegistry] Address = '' NetworkID = 'evm' ChainID = '1' +[Capabilities.GatewayConnector] +ChainIDForNodeKey = '' +NodeAddress = '' +DonID = '' +WSHandshakeTimeoutMillis = 0 +AuthMinChallengeLen = 0 +AuthTimestampToleranceSec = 0 + +[[Capabilities.GatewayConnector.Gateways]] +ID = '' +URL = '' + +[Telemetry] +Enabled = false +CACertFile = '' +Endpoint = '' +InsecureConnection = false +TraceSampleRatio = 0.01 + [[EVM]] ChainID = '1' AutoCreateKey = true BlockBackfillDepth = 10 BlockBackfillSkip = false FinalityDepth = 26 -FinalityTagEnabled = false +FinalityTagEnabled = true LinkContractAddress = '0x514910771AF9Ca656af840dff83E8264EcF986CA' LogBackfillBatchSize = 1000 LogPollInterval = '15s' @@ -274,9 +305,11 @@ MinContractPayment = '0.1 link' NonceAutoSync = true NoNewHeadsThreshold = '3m0s' OperatorFactoryAddress = '0x3E64Cd889482443324F91bFA9c84fE72A511f48A' +LogBroadcasterEnabled = true RPCDefaultBatchSize = 250 RPCBlockQueryDelay = 1 FinalizedBlockOffset = 12 +NoNewFinalizedHeadsThreshold = '9m0s' [EVM.Transactions] ForwardersEnabled = false @@ -301,6 +334,7 @@ LimitDefault = 500000 LimitMax = 500000 LimitMultiplier = '1' LimitTransfer = 21000 +EstimateLimit = false BumpMin = '5 gwei' BumpPercent = 20 BumpThreshold = 3 @@ -316,12 +350,16 @@ CheckInclusionBlocks = 12 CheckInclusionPercentile = 90 TransactionPercentile = 50 +[EVM.GasEstimator.FeeHistory] +CacheTimeout = '10s' + [EVM.HeadTracker] HistoryDepth = 100 MaxBufferSize = 3 SamplingInterval = '1s' MaxAllowedFinalityDepth = 10000 FinalityTagBypass = true +PersistenceEnabled = true [EVM.NodePool] PollFailureThreshold = 5 @@ -333,6 +371,7 @@ NodeIsSyncingEnabled = false FinalizedBlockPollInterval = '5s' EnforceRepeatableRead = false DeathDeclarationDelay = '10s' +NewHeadsPollInterval = '0s' [EVM.OCR] ContractConfirmations = 4 @@ -346,6 +385,9 @@ ObservationGracePeriod = '1s' [EVM.OCR2.Automation] GasLimit = 10500000 +[EVM.Workflow] +GasLimitDefault = 400000 + [[EVM.Nodes]] Name = 'primary' WSURL = 'wss://web.socket/mainnet' @@ -373,9 +415,11 @@ MinContractPayment = '0.1 link' NonceAutoSync = true NoNewHeadsThreshold = '3m0s' OperatorFactoryAddress = '0x8007e24251b1D2Fc518Eb843A701d9cD21fe0aA3' +LogBroadcasterEnabled = true RPCDefaultBatchSize = 250 RPCBlockQueryDelay = 1 FinalizedBlockOffset = 0 +NoNewFinalizedHeadsThreshold = '0s' [EVM.Transactions] ForwardersEnabled = false @@ -400,6 +444,7 @@ LimitDefault = 500000 LimitMax = 500000 LimitMultiplier = '1' LimitTransfer = 21000 +EstimateLimit = false BumpMin = '5 gwei' BumpPercent = 20 BumpThreshold = 3 @@ -415,12 +460,16 @@ CheckInclusionBlocks = 12 CheckInclusionPercentile = 90 TransactionPercentile = 50 +[EVM.GasEstimator.FeeHistory] +CacheTimeout = '10s' + [EVM.HeadTracker] HistoryDepth = 100 MaxBufferSize = 3 SamplingInterval = '1s' MaxAllowedFinalityDepth = 10000 FinalityTagBypass = true +PersistenceEnabled = true [EVM.NodePool] PollFailureThreshold = 5 @@ -432,6 +481,7 @@ NodeIsSyncingEnabled = false FinalizedBlockPollInterval = '5s' EnforceRepeatableRead = false DeathDeclarationDelay = '10s' +NewHeadsPollInterval = '0s' [EVM.OCR] ContractConfirmations = 4 @@ -445,6 +495,9 @@ ObservationGracePeriod = '1s' [EVM.OCR2.Automation] GasLimit = 5400000 +[EVM.Workflow] +GasLimitDefault = 400000 + [[EVM.Nodes]] Name = 'foo' WSURL = 'wss://web.socket/test/foo' @@ -455,7 +508,7 @@ AutoCreateKey = true BlockBackfillDepth = 10 BlockBackfillSkip = false FinalityDepth = 500 -FinalityTagEnabled = false +FinalityTagEnabled = true LinkContractAddress = '0xb0897686c545045aFc77CF20eC7A532E3120E0F1' LogBackfillBatchSize = 1000 LogPollInterval = '1s' @@ -466,9 +519,11 @@ MinIncomingConfirmations = 5 MinContractPayment = '0.00001 link' NonceAutoSync = true NoNewHeadsThreshold = '30s' +LogBroadcasterEnabled = true RPCDefaultBatchSize = 100 RPCBlockQueryDelay = 10 FinalizedBlockOffset = 0 +NoNewFinalizedHeadsThreshold = '6m0s' [EVM.Transactions] ForwardersEnabled = false @@ -493,6 +548,7 @@ LimitDefault = 500000 LimitMax = 500000 LimitMultiplier = '1' LimitTransfer = 21000 +EstimateLimit = false BumpMin = '20 gwei' BumpPercent = 20 BumpThreshold = 5 @@ -508,12 +564,16 @@ CheckInclusionBlocks = 12 CheckInclusionPercentile = 90 TransactionPercentile = 60 +[EVM.GasEstimator.FeeHistory] +CacheTimeout = '10s' + [EVM.HeadTracker] HistoryDepth = 2000 MaxBufferSize = 3 SamplingInterval = '1s' MaxAllowedFinalityDepth = 10000 FinalityTagBypass = true +PersistenceEnabled = true [EVM.NodePool] PollFailureThreshold = 5 @@ -525,6 +585,7 @@ NodeIsSyncingEnabled = false FinalizedBlockPollInterval = '5s' EnforceRepeatableRead = false DeathDeclarationDelay = '10s' +NewHeadsPollInterval = '0s' [EVM.OCR] ContractConfirmations = 4 @@ -538,6 +599,9 @@ ObservationGracePeriod = '1s' [EVM.OCR2.Automation] GasLimit = 5400000 +[EVM.Workflow] +GasLimitDefault = 400000 + [[EVM.Nodes]] Name = 'bar' WSURL = 'wss://web.socket/test/bar' @@ -596,10 +660,12 @@ ComputeUnitPriceMin = 0 ComputeUnitPriceDefault = 0 FeeBumpPeriod = '3s' BlockHistoryPollPeriod = '5s' +ComputeUnitLimitDefault = 200000 [[Solana.Nodes]] Name = 'primary' URL = 'http://mainnet.solana.com' +SendOnly = false [[Solana]] ChainID = 'testnet' @@ -619,10 +685,12 @@ ComputeUnitPriceMin = 0 ComputeUnitPriceDefault = 0 FeeBumpPeriod = '3s' BlockHistoryPollPeriod = '5s' +ComputeUnitLimitDefault = 200000 [[Solana.Nodes]] Name = 'secondary' URL = 'http://testnet.solana.com' +SendOnly = false [[Starknet]] ChainID = 'foobar' diff --git a/core/services/chainlink/testdata/config-multi-chain.toml b/core/services/chainlink/testdata/config-multi-chain.toml index 5373e0e62d3..45a6de47a98 100644 --- a/core/services/chainlink/testdata/config-multi-chain.toml +++ b/core/services/chainlink/testdata/config-multi-chain.toml @@ -38,7 +38,7 @@ CPUProfileRate = 7 [[EVM]] ChainID = '1' FinalityDepth = 26 -FinalityTagEnabled = false +FinalityTagEnabled = true FinalizedBlockOffset = 12 [[EVM.Nodes]] @@ -93,6 +93,7 @@ MaxRetries = 12 [[Solana.Nodes]] Name = 'primary' URL = 'http://mainnet.solana.com' +SendOnly = false [[Solana]] ChainID = 'testnet' @@ -101,6 +102,7 @@ OCR2CachePollPeriod = '1m0s' [[Solana.Nodes]] Name = 'secondary' URL = 'http://testnet.solana.com' +SendOnly = false [[Starknet]] ChainID = 'foobar' diff --git a/core/services/chainlink/types.go b/core/services/chainlink/types.go index 4c7550142a2..74ffc5dc66d 100644 --- a/core/services/chainlink/types.go +++ b/core/services/chainlink/types.go @@ -9,14 +9,13 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/config" ) -//go:generate mockery --quiet --name GeneralConfig --output ./mocks/ --case=underscore - type GeneralConfig interface { config.AppConfig toml.HasEVMConfigs CosmosConfigs() coscfg.TOMLConfigs SolanaConfigs() solcfg.TOMLConfigs StarknetConfigs() stkcfg.TOMLConfigs + AptosConfigs() RawConfigs // ConfigTOML returns both the user provided and effective configuration as TOML. ConfigTOML() (user, effective string) } diff --git a/core/services/cron/cron.go b/core/services/cron/cron.go index aa4d1d782f1..9f9d2efbce8 100644 --- a/core/services/cron/cron.go +++ b/core/services/cron/cron.go @@ -88,7 +88,7 @@ func (cr *Cron) runPipeline() { run := pipeline.NewRun(*cr.jobSpec.PipelineSpec, vars) - _, err := cr.pipelineRunner.Run(ctx, run, cr.logger, false, nil) + _, err := cr.pipelineRunner.Run(ctx, run, false, nil) if err != nil { cr.logger.Errorf("Error executing new run for jobSpec ID %v", cr.jobSpec.ID) } diff --git a/core/services/directrequest/delegate.go b/core/services/directrequest/delegate.go index 26f2c5f9c84..844bd0a12c9 100644 --- a/core/services/directrequest/delegate.go +++ b/core/services/directrequest/delegate.go @@ -375,7 +375,7 @@ func (l *listener) handleOracleRequest(ctx context.Context, request *operator_wr }, }) run := pipeline.NewRun(*l.job.PipelineSpec, vars) - _, err := l.pipelineRunner.Run(ctx, run, l.logger, true, func(tx sqlutil.DataSource) error { + _, err := l.pipelineRunner.Run(ctx, run, true, func(tx sqlutil.DataSource) error { l.markLogConsumed(ctx, tx, lb) return nil }) diff --git a/core/services/directrequest/delegate_test.go b/core/services/directrequest/delegate_test.go index e754713b010..0876031fb9a 100644 --- a/core/services/directrequest/delegate_test.go +++ b/core/services/directrequest/delegate_test.go @@ -163,11 +163,11 @@ func TestDelegate_ServicesListenerHandleLog(t *testing.T) { uni.logBroadcaster.On("MarkConsumed", mock.Anything, mock.Anything, mock.Anything).Return(nil) runBeganAwaiter := cltest.NewAwaiter() - uni.runner.On("Run", mock.Anything, mock.AnythingOfType("*pipeline.Run"), mock.Anything, mock.Anything, mock.Anything). + uni.runner.On("Run", mock.Anything, mock.AnythingOfType("*pipeline.Run"), mock.Anything, mock.Anything). Return(false, nil). Run(func(args mock.Arguments) { runBeganAwaiter.ItHappened() - fn := args.Get(4).(func(source sqlutil.DataSource) error) + fn := args.Get(3).(func(source sqlutil.DataSource) error) require.NoError(t, fn(nil)) }).Once() @@ -227,7 +227,7 @@ func TestDelegate_ServicesListenerHandleLog(t *testing.T) { uni.runner.On("Run", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything). Run(func(args mock.Arguments) { runBeganAwaiter.ItHappened() - fn := args.Get(4).(func(sqlutil.DataSource) error) + fn := args.Get(3).(func(sqlutil.DataSource) error) require.NoError(t, fn(nil)) }).Once().Return(false, nil) @@ -393,9 +393,9 @@ func TestDelegate_ServicesListenerHandleLog(t *testing.T) { uni.logBroadcaster.On("MarkConsumed", mock.Anything, mock.Anything, mock.Anything).Return(nil) runBeganAwaiter := cltest.NewAwaiter() - uni.runner.On("Run", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything).Run(func(args mock.Arguments) { + uni.runner.On("Run", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Run(func(args mock.Arguments) { runBeganAwaiter.ItHappened() - fn := args.Get(4).(func(sqlutil.DataSource) error) + fn := args.Get(3).(func(sqlutil.DataSource) error) require.NoError(t, fn(nil)) }).Once().Return(false, nil) @@ -492,9 +492,9 @@ func TestDelegate_ServicesListenerHandleLog(t *testing.T) { }).Return(nil) runBeganAwaiter := cltest.NewAwaiter() - uni.runner.On("Run", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything).Run(func(args mock.Arguments) { + uni.runner.On("Run", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Run(func(args mock.Arguments) { runBeganAwaiter.ItHappened() - fn := args.Get(4).(func(sqlutil.DataSource) error) + fn := args.Get(3).(func(sqlutil.DataSource) error) require.NoError(t, fn(nil)) }).Once().Return(false, nil) diff --git a/core/services/feeds/config.go b/core/services/feeds/config.go index e2ec889b23b..626dc862e94 100644 --- a/core/services/feeds/config.go +++ b/core/services/feeds/config.go @@ -12,6 +12,10 @@ type GeneralConfig interface { Insecure() coreconfig.Insecure } +type FeatureConfig interface { + MultiFeedsManagers() bool +} + type JobConfig interface { DefaultHTTPTimeout() commonconfig.Duration } diff --git a/core/services/feeds/connection_manager.go b/core/services/feeds/connection_manager.go index d388bc0899f..aadfc41bd5e 100644 --- a/core/services/feeds/connection_manager.go +++ b/core/services/feeds/connection_manager.go @@ -5,9 +5,9 @@ import ( "sync" "github.com/pkg/errors" + "google.golang.org/grpc/connectivity" "github.com/smartcontractkit/wsrpc" - "github.com/smartcontractkit/wsrpc/connectivity" "github.com/smartcontractkit/chainlink-common/pkg/services" "github.com/smartcontractkit/chainlink/v2/core/logger" @@ -15,8 +15,6 @@ import ( pb "github.com/smartcontractkit/chainlink/v2/core/services/feeds/proto" ) -//go:generate mockery --quiet --name ConnectionsManager --output ./mocks/ --case=underscore - type ConnectionsManager interface { Connect(opts ConnectOpts) Disconnect(id int64) error @@ -112,7 +110,12 @@ func (mgr *connectionsManager) Connect(opts ConnectOpts) { return } - defer clientConn.Close() + defer func() { + cerr := clientConn.Close() + if cerr != nil { + mgr.lggr.Warnf("Error closing wsrpc client connection: %v", cerr) + } + }() mgr.lggr.Infow("Connected to Feeds Manager", "feedsManagerID", opts.FeedsManagerID) diff --git a/core/services/feeds/mocks/connections_manager.go b/core/services/feeds/mocks/connections_manager.go index daeb06f6922..c35c2be6550 100644 --- a/core/services/feeds/mocks/connections_manager.go +++ b/core/services/feeds/mocks/connections_manager.go @@ -14,16 +14,79 @@ type ConnectionsManager struct { mock.Mock } +type ConnectionsManager_Expecter struct { + mock *mock.Mock +} + +func (_m *ConnectionsManager) EXPECT() *ConnectionsManager_Expecter { + return &ConnectionsManager_Expecter{mock: &_m.Mock} +} + // Close provides a mock function with given fields: func (_m *ConnectionsManager) Close() { _m.Called() } +// ConnectionsManager_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close' +type ConnectionsManager_Close_Call struct { + *mock.Call +} + +// Close is a helper method to define mock.On call +func (_e *ConnectionsManager_Expecter) Close() *ConnectionsManager_Close_Call { + return &ConnectionsManager_Close_Call{Call: _e.mock.On("Close")} +} + +func (_c *ConnectionsManager_Close_Call) Run(run func()) *ConnectionsManager_Close_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ConnectionsManager_Close_Call) Return() *ConnectionsManager_Close_Call { + _c.Call.Return() + return _c +} + +func (_c *ConnectionsManager_Close_Call) RunAndReturn(run func()) *ConnectionsManager_Close_Call { + _c.Call.Return(run) + return _c +} + // Connect provides a mock function with given fields: opts func (_m *ConnectionsManager) Connect(opts feeds.ConnectOpts) { _m.Called(opts) } +// ConnectionsManager_Connect_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Connect' +type ConnectionsManager_Connect_Call struct { + *mock.Call +} + +// Connect is a helper method to define mock.On call +// - opts feeds.ConnectOpts +func (_e *ConnectionsManager_Expecter) Connect(opts interface{}) *ConnectionsManager_Connect_Call { + return &ConnectionsManager_Connect_Call{Call: _e.mock.On("Connect", opts)} +} + +func (_c *ConnectionsManager_Connect_Call) Run(run func(opts feeds.ConnectOpts)) *ConnectionsManager_Connect_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(feeds.ConnectOpts)) + }) + return _c +} + +func (_c *ConnectionsManager_Connect_Call) Return() *ConnectionsManager_Connect_Call { + _c.Call.Return() + return _c +} + +func (_c *ConnectionsManager_Connect_Call) RunAndReturn(run func(feeds.ConnectOpts)) *ConnectionsManager_Connect_Call { + _c.Call.Return(run) + return _c +} + // Disconnect provides a mock function with given fields: id func (_m *ConnectionsManager) Disconnect(id int64) error { ret := _m.Called(id) @@ -42,6 +105,34 @@ func (_m *ConnectionsManager) Disconnect(id int64) error { return r0 } +// ConnectionsManager_Disconnect_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Disconnect' +type ConnectionsManager_Disconnect_Call struct { + *mock.Call +} + +// Disconnect is a helper method to define mock.On call +// - id int64 +func (_e *ConnectionsManager_Expecter) Disconnect(id interface{}) *ConnectionsManager_Disconnect_Call { + return &ConnectionsManager_Disconnect_Call{Call: _e.mock.On("Disconnect", id)} +} + +func (_c *ConnectionsManager_Disconnect_Call) Run(run func(id int64)) *ConnectionsManager_Disconnect_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(int64)) + }) + return _c +} + +func (_c *ConnectionsManager_Disconnect_Call) Return(_a0 error) *ConnectionsManager_Disconnect_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ConnectionsManager_Disconnect_Call) RunAndReturn(run func(int64) error) *ConnectionsManager_Disconnect_Call { + _c.Call.Return(run) + return _c +} + // GetClient provides a mock function with given fields: id func (_m *ConnectionsManager) GetClient(id int64) (proto.FeedsManagerClient, error) { ret := _m.Called(id) @@ -72,6 +163,34 @@ func (_m *ConnectionsManager) GetClient(id int64) (proto.FeedsManagerClient, err return r0, r1 } +// ConnectionsManager_GetClient_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetClient' +type ConnectionsManager_GetClient_Call struct { + *mock.Call +} + +// GetClient is a helper method to define mock.On call +// - id int64 +func (_e *ConnectionsManager_Expecter) GetClient(id interface{}) *ConnectionsManager_GetClient_Call { + return &ConnectionsManager_GetClient_Call{Call: _e.mock.On("GetClient", id)} +} + +func (_c *ConnectionsManager_GetClient_Call) Run(run func(id int64)) *ConnectionsManager_GetClient_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(int64)) + }) + return _c +} + +func (_c *ConnectionsManager_GetClient_Call) Return(_a0 proto.FeedsManagerClient, _a1 error) *ConnectionsManager_GetClient_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ConnectionsManager_GetClient_Call) RunAndReturn(run func(int64) (proto.FeedsManagerClient, error)) *ConnectionsManager_GetClient_Call { + _c.Call.Return(run) + return _c +} + // IsConnected provides a mock function with given fields: id func (_m *ConnectionsManager) IsConnected(id int64) bool { ret := _m.Called(id) @@ -90,6 +209,34 @@ func (_m *ConnectionsManager) IsConnected(id int64) bool { return r0 } +// ConnectionsManager_IsConnected_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsConnected' +type ConnectionsManager_IsConnected_Call struct { + *mock.Call +} + +// IsConnected is a helper method to define mock.On call +// - id int64 +func (_e *ConnectionsManager_Expecter) IsConnected(id interface{}) *ConnectionsManager_IsConnected_Call { + return &ConnectionsManager_IsConnected_Call{Call: _e.mock.On("IsConnected", id)} +} + +func (_c *ConnectionsManager_IsConnected_Call) Run(run func(id int64)) *ConnectionsManager_IsConnected_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(int64)) + }) + return _c +} + +func (_c *ConnectionsManager_IsConnected_Call) Return(_a0 bool) *ConnectionsManager_IsConnected_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ConnectionsManager_IsConnected_Call) RunAndReturn(run func(int64) bool) *ConnectionsManager_IsConnected_Call { + _c.Call.Return(run) + return _c +} + // NewConnectionsManager creates a new instance of ConnectionsManager. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewConnectionsManager(t interface { diff --git a/core/services/feeds/mocks/feeds_manager_client.go b/core/services/feeds/mocks/feeds_manager_client.go index e2b92c28a85..e140cf59bee 100644 --- a/core/services/feeds/mocks/feeds_manager_client.go +++ b/core/services/feeds/mocks/feeds_manager_client.go @@ -14,6 +14,14 @@ type FeedsManagerClient struct { mock.Mock } +type FeedsManagerClient_Expecter struct { + mock *mock.Mock +} + +func (_m *FeedsManagerClient) EXPECT() *FeedsManagerClient_Expecter { + return &FeedsManagerClient_Expecter{mock: &_m.Mock} +} + // ApprovedJob provides a mock function with given fields: ctx, in func (_m *FeedsManagerClient) ApprovedJob(ctx context.Context, in *proto.ApprovedJobRequest) (*proto.ApprovedJobResponse, error) { ret := _m.Called(ctx, in) @@ -44,6 +52,35 @@ func (_m *FeedsManagerClient) ApprovedJob(ctx context.Context, in *proto.Approve return r0, r1 } +// FeedsManagerClient_ApprovedJob_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ApprovedJob' +type FeedsManagerClient_ApprovedJob_Call struct { + *mock.Call +} + +// ApprovedJob is a helper method to define mock.On call +// - ctx context.Context +// - in *proto.ApprovedJobRequest +func (_e *FeedsManagerClient_Expecter) ApprovedJob(ctx interface{}, in interface{}) *FeedsManagerClient_ApprovedJob_Call { + return &FeedsManagerClient_ApprovedJob_Call{Call: _e.mock.On("ApprovedJob", ctx, in)} +} + +func (_c *FeedsManagerClient_ApprovedJob_Call) Run(run func(ctx context.Context, in *proto.ApprovedJobRequest)) *FeedsManagerClient_ApprovedJob_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*proto.ApprovedJobRequest)) + }) + return _c +} + +func (_c *FeedsManagerClient_ApprovedJob_Call) Return(_a0 *proto.ApprovedJobResponse, _a1 error) *FeedsManagerClient_ApprovedJob_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FeedsManagerClient_ApprovedJob_Call) RunAndReturn(run func(context.Context, *proto.ApprovedJobRequest) (*proto.ApprovedJobResponse, error)) *FeedsManagerClient_ApprovedJob_Call { + _c.Call.Return(run) + return _c +} + // CancelledJob provides a mock function with given fields: ctx, in func (_m *FeedsManagerClient) CancelledJob(ctx context.Context, in *proto.CancelledJobRequest) (*proto.CancelledJobResponse, error) { ret := _m.Called(ctx, in) @@ -74,6 +111,35 @@ func (_m *FeedsManagerClient) CancelledJob(ctx context.Context, in *proto.Cancel return r0, r1 } +// FeedsManagerClient_CancelledJob_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CancelledJob' +type FeedsManagerClient_CancelledJob_Call struct { + *mock.Call +} + +// CancelledJob is a helper method to define mock.On call +// - ctx context.Context +// - in *proto.CancelledJobRequest +func (_e *FeedsManagerClient_Expecter) CancelledJob(ctx interface{}, in interface{}) *FeedsManagerClient_CancelledJob_Call { + return &FeedsManagerClient_CancelledJob_Call{Call: _e.mock.On("CancelledJob", ctx, in)} +} + +func (_c *FeedsManagerClient_CancelledJob_Call) Run(run func(ctx context.Context, in *proto.CancelledJobRequest)) *FeedsManagerClient_CancelledJob_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*proto.CancelledJobRequest)) + }) + return _c +} + +func (_c *FeedsManagerClient_CancelledJob_Call) Return(_a0 *proto.CancelledJobResponse, _a1 error) *FeedsManagerClient_CancelledJob_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FeedsManagerClient_CancelledJob_Call) RunAndReturn(run func(context.Context, *proto.CancelledJobRequest) (*proto.CancelledJobResponse, error)) *FeedsManagerClient_CancelledJob_Call { + _c.Call.Return(run) + return _c +} + // Healthcheck provides a mock function with given fields: ctx, in func (_m *FeedsManagerClient) Healthcheck(ctx context.Context, in *proto.HealthcheckRequest) (*proto.HealthcheckResponse, error) { ret := _m.Called(ctx, in) @@ -104,6 +170,35 @@ func (_m *FeedsManagerClient) Healthcheck(ctx context.Context, in *proto.Healthc return r0, r1 } +// FeedsManagerClient_Healthcheck_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Healthcheck' +type FeedsManagerClient_Healthcheck_Call struct { + *mock.Call +} + +// Healthcheck is a helper method to define mock.On call +// - ctx context.Context +// - in *proto.HealthcheckRequest +func (_e *FeedsManagerClient_Expecter) Healthcheck(ctx interface{}, in interface{}) *FeedsManagerClient_Healthcheck_Call { + return &FeedsManagerClient_Healthcheck_Call{Call: _e.mock.On("Healthcheck", ctx, in)} +} + +func (_c *FeedsManagerClient_Healthcheck_Call) Run(run func(ctx context.Context, in *proto.HealthcheckRequest)) *FeedsManagerClient_Healthcheck_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*proto.HealthcheckRequest)) + }) + return _c +} + +func (_c *FeedsManagerClient_Healthcheck_Call) Return(_a0 *proto.HealthcheckResponse, _a1 error) *FeedsManagerClient_Healthcheck_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FeedsManagerClient_Healthcheck_Call) RunAndReturn(run func(context.Context, *proto.HealthcheckRequest) (*proto.HealthcheckResponse, error)) *FeedsManagerClient_Healthcheck_Call { + _c.Call.Return(run) + return _c +} + // RejectedJob provides a mock function with given fields: ctx, in func (_m *FeedsManagerClient) RejectedJob(ctx context.Context, in *proto.RejectedJobRequest) (*proto.RejectedJobResponse, error) { ret := _m.Called(ctx, in) @@ -134,6 +229,35 @@ func (_m *FeedsManagerClient) RejectedJob(ctx context.Context, in *proto.Rejecte return r0, r1 } +// FeedsManagerClient_RejectedJob_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RejectedJob' +type FeedsManagerClient_RejectedJob_Call struct { + *mock.Call +} + +// RejectedJob is a helper method to define mock.On call +// - ctx context.Context +// - in *proto.RejectedJobRequest +func (_e *FeedsManagerClient_Expecter) RejectedJob(ctx interface{}, in interface{}) *FeedsManagerClient_RejectedJob_Call { + return &FeedsManagerClient_RejectedJob_Call{Call: _e.mock.On("RejectedJob", ctx, in)} +} + +func (_c *FeedsManagerClient_RejectedJob_Call) Run(run func(ctx context.Context, in *proto.RejectedJobRequest)) *FeedsManagerClient_RejectedJob_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*proto.RejectedJobRequest)) + }) + return _c +} + +func (_c *FeedsManagerClient_RejectedJob_Call) Return(_a0 *proto.RejectedJobResponse, _a1 error) *FeedsManagerClient_RejectedJob_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FeedsManagerClient_RejectedJob_Call) RunAndReturn(run func(context.Context, *proto.RejectedJobRequest) (*proto.RejectedJobResponse, error)) *FeedsManagerClient_RejectedJob_Call { + _c.Call.Return(run) + return _c +} + // UpdateNode provides a mock function with given fields: ctx, in func (_m *FeedsManagerClient) UpdateNode(ctx context.Context, in *proto.UpdateNodeRequest) (*proto.UpdateNodeResponse, error) { ret := _m.Called(ctx, in) @@ -164,6 +288,35 @@ func (_m *FeedsManagerClient) UpdateNode(ctx context.Context, in *proto.UpdateNo return r0, r1 } +// FeedsManagerClient_UpdateNode_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateNode' +type FeedsManagerClient_UpdateNode_Call struct { + *mock.Call +} + +// UpdateNode is a helper method to define mock.On call +// - ctx context.Context +// - in *proto.UpdateNodeRequest +func (_e *FeedsManagerClient_Expecter) UpdateNode(ctx interface{}, in interface{}) *FeedsManagerClient_UpdateNode_Call { + return &FeedsManagerClient_UpdateNode_Call{Call: _e.mock.On("UpdateNode", ctx, in)} +} + +func (_c *FeedsManagerClient_UpdateNode_Call) Run(run func(ctx context.Context, in *proto.UpdateNodeRequest)) *FeedsManagerClient_UpdateNode_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*proto.UpdateNodeRequest)) + }) + return _c +} + +func (_c *FeedsManagerClient_UpdateNode_Call) Return(_a0 *proto.UpdateNodeResponse, _a1 error) *FeedsManagerClient_UpdateNode_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FeedsManagerClient_UpdateNode_Call) RunAndReturn(run func(context.Context, *proto.UpdateNodeRequest) (*proto.UpdateNodeResponse, error)) *FeedsManagerClient_UpdateNode_Call { + _c.Call.Return(run) + return _c +} + // NewFeedsManagerClient creates a new instance of FeedsManagerClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewFeedsManagerClient(t interface { diff --git a/core/services/feeds/mocks/orm.go b/core/services/feeds/mocks/orm.go index 3fce89eb60a..d6cae81dc6c 100644 --- a/core/services/feeds/mocks/orm.go +++ b/core/services/feeds/mocks/orm.go @@ -6,6 +6,8 @@ import ( context "context" feeds "github.com/smartcontractkit/chainlink/v2/core/services/feeds" + crypto "github.com/smartcontractkit/chainlink/v2/core/utils/crypto" + mock "github.com/stretchr/testify/mock" sqlutil "github.com/smartcontractkit/chainlink-common/pkg/sqlutil" @@ -1269,64 +1271,6 @@ func (_c *ORM_ListChainConfigsByManagerIDs_Call) RunAndReturn(run func(context.C return _c } -// ListJobProposals provides a mock function with given fields: ctx -func (_m *ORM) ListJobProposals(ctx context.Context) ([]feeds.JobProposal, error) { - ret := _m.Called(ctx) - - if len(ret) == 0 { - panic("no return value specified for ListJobProposals") - } - - var r0 []feeds.JobProposal - var r1 error - if rf, ok := ret.Get(0).(func(context.Context) ([]feeds.JobProposal, error)); ok { - return rf(ctx) - } - if rf, ok := ret.Get(0).(func(context.Context) []feeds.JobProposal); ok { - r0 = rf(ctx) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]feeds.JobProposal) - } - } - - if rf, ok := ret.Get(1).(func(context.Context) error); ok { - r1 = rf(ctx) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ORM_ListJobProposals_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListJobProposals' -type ORM_ListJobProposals_Call struct { - *mock.Call -} - -// ListJobProposals is a helper method to define mock.On call -// - ctx context.Context -func (_e *ORM_Expecter) ListJobProposals(ctx interface{}) *ORM_ListJobProposals_Call { - return &ORM_ListJobProposals_Call{Call: _e.mock.On("ListJobProposals", ctx)} -} - -func (_c *ORM_ListJobProposals_Call) Run(run func(ctx context.Context)) *ORM_ListJobProposals_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context)) - }) - return _c -} - -func (_c *ORM_ListJobProposals_Call) Return(jps []feeds.JobProposal, err error) *ORM_ListJobProposals_Call { - _c.Call.Return(jps, err) - return _c -} - -func (_c *ORM_ListJobProposals_Call) RunAndReturn(run func(context.Context) ([]feeds.JobProposal, error)) *ORM_ListJobProposals_Call { - _c.Call.Return(run) - return _c -} - // ListJobProposalsByManagersIDs provides a mock function with given fields: ctx, ids func (_m *ORM) ListJobProposalsByManagersIDs(ctx context.Context, ids []int64) ([]feeds.JobProposal, error) { ret := _m.Called(ctx, ids) @@ -1562,6 +1506,63 @@ func (_c *ORM_ListSpecsByJobProposalIDs_Call) RunAndReturn(run func(context.Cont return _c } +// ManagerExists provides a mock function with given fields: ctx, publicKey +func (_m *ORM) ManagerExists(ctx context.Context, publicKey crypto.PublicKey) (bool, error) { + ret := _m.Called(ctx, publicKey) + + if len(ret) == 0 { + panic("no return value specified for ManagerExists") + } + + var r0 bool + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, crypto.PublicKey) (bool, error)); ok { + return rf(ctx, publicKey) + } + if rf, ok := ret.Get(0).(func(context.Context, crypto.PublicKey) bool); ok { + r0 = rf(ctx, publicKey) + } else { + r0 = ret.Get(0).(bool) + } + + if rf, ok := ret.Get(1).(func(context.Context, crypto.PublicKey) error); ok { + r1 = rf(ctx, publicKey) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ORM_ManagerExists_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ManagerExists' +type ORM_ManagerExists_Call struct { + *mock.Call +} + +// ManagerExists is a helper method to define mock.On call +// - ctx context.Context +// - publicKey crypto.PublicKey +func (_e *ORM_Expecter) ManagerExists(ctx interface{}, publicKey interface{}) *ORM_ManagerExists_Call { + return &ORM_ManagerExists_Call{Call: _e.mock.On("ManagerExists", ctx, publicKey)} +} + +func (_c *ORM_ManagerExists_Call) Run(run func(ctx context.Context, publicKey crypto.PublicKey)) *ORM_ManagerExists_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(crypto.PublicKey)) + }) + return _c +} + +func (_c *ORM_ManagerExists_Call) Return(_a0 bool, _a1 error) *ORM_ManagerExists_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ORM_ManagerExists_Call) RunAndReturn(run func(context.Context, crypto.PublicKey) (bool, error)) *ORM_ManagerExists_Call { + _c.Call.Return(run) + return _c +} + // RejectSpec provides a mock function with given fields: ctx, id func (_m *ORM) RejectSpec(ctx context.Context, id int64) error { ret := _m.Called(ctx, id) diff --git a/core/services/feeds/mocks/service.go b/core/services/feeds/mocks/service.go index de5779374a9..d84879bb700 100644 --- a/core/services/feeds/mocks/service.go +++ b/core/services/feeds/mocks/service.go @@ -14,6 +14,14 @@ type Service struct { mock.Mock } +type Service_Expecter struct { + mock *mock.Mock +} + +func (_m *Service) EXPECT() *Service_Expecter { + return &Service_Expecter{mock: &_m.Mock} +} + // ApproveSpec provides a mock function with given fields: ctx, id, force func (_m *Service) ApproveSpec(ctx context.Context, id int64, force bool) error { ret := _m.Called(ctx, id, force) @@ -32,6 +40,36 @@ func (_m *Service) ApproveSpec(ctx context.Context, id int64, force bool) error return r0 } +// Service_ApproveSpec_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ApproveSpec' +type Service_ApproveSpec_Call struct { + *mock.Call +} + +// ApproveSpec is a helper method to define mock.On call +// - ctx context.Context +// - id int64 +// - force bool +func (_e *Service_Expecter) ApproveSpec(ctx interface{}, id interface{}, force interface{}) *Service_ApproveSpec_Call { + return &Service_ApproveSpec_Call{Call: _e.mock.On("ApproveSpec", ctx, id, force)} +} + +func (_c *Service_ApproveSpec_Call) Run(run func(ctx context.Context, id int64, force bool)) *Service_ApproveSpec_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(int64), args[2].(bool)) + }) + return _c +} + +func (_c *Service_ApproveSpec_Call) Return(_a0 error) *Service_ApproveSpec_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Service_ApproveSpec_Call) RunAndReturn(run func(context.Context, int64, bool) error) *Service_ApproveSpec_Call { + _c.Call.Return(run) + return _c +} + // CancelSpec provides a mock function with given fields: ctx, id func (_m *Service) CancelSpec(ctx context.Context, id int64) error { ret := _m.Called(ctx, id) @@ -50,6 +88,35 @@ func (_m *Service) CancelSpec(ctx context.Context, id int64) error { return r0 } +// Service_CancelSpec_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CancelSpec' +type Service_CancelSpec_Call struct { + *mock.Call +} + +// CancelSpec is a helper method to define mock.On call +// - ctx context.Context +// - id int64 +func (_e *Service_Expecter) CancelSpec(ctx interface{}, id interface{}) *Service_CancelSpec_Call { + return &Service_CancelSpec_Call{Call: _e.mock.On("CancelSpec", ctx, id)} +} + +func (_c *Service_CancelSpec_Call) Run(run func(ctx context.Context, id int64)) *Service_CancelSpec_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(int64)) + }) + return _c +} + +func (_c *Service_CancelSpec_Call) Return(_a0 error) *Service_CancelSpec_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Service_CancelSpec_Call) RunAndReturn(run func(context.Context, int64) error) *Service_CancelSpec_Call { + _c.Call.Return(run) + return _c +} + // Close provides a mock function with given fields: func (_m *Service) Close() error { ret := _m.Called() @@ -68,6 +135,33 @@ func (_m *Service) Close() error { return r0 } +// Service_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close' +type Service_Close_Call struct { + *mock.Call +} + +// Close is a helper method to define mock.On call +func (_e *Service_Expecter) Close() *Service_Close_Call { + return &Service_Close_Call{Call: _e.mock.On("Close")} +} + +func (_c *Service_Close_Call) Run(run func()) *Service_Close_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Service_Close_Call) Return(_a0 error) *Service_Close_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Service_Close_Call) RunAndReturn(run func() error) *Service_Close_Call { + _c.Call.Return(run) + return _c +} + // CountJobProposalsByStatus provides a mock function with given fields: ctx func (_m *Service) CountJobProposalsByStatus(ctx context.Context) (*feeds.JobProposalCounts, error) { ret := _m.Called(ctx) @@ -98,32 +192,32 @@ func (_m *Service) CountJobProposalsByStatus(ctx context.Context) (*feeds.JobPro return r0, r1 } -// CountManagers provides a mock function with given fields: ctx -func (_m *Service) CountManagers(ctx context.Context) (int64, error) { - ret := _m.Called(ctx) +// Service_CountJobProposalsByStatus_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CountJobProposalsByStatus' +type Service_CountJobProposalsByStatus_Call struct { + *mock.Call +} - if len(ret) == 0 { - panic("no return value specified for CountManagers") - } +// CountJobProposalsByStatus is a helper method to define mock.On call +// - ctx context.Context +func (_e *Service_Expecter) CountJobProposalsByStatus(ctx interface{}) *Service_CountJobProposalsByStatus_Call { + return &Service_CountJobProposalsByStatus_Call{Call: _e.mock.On("CountJobProposalsByStatus", ctx)} +} - var r0 int64 - var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (int64, error)); ok { - return rf(ctx) - } - if rf, ok := ret.Get(0).(func(context.Context) int64); ok { - r0 = rf(ctx) - } else { - r0 = ret.Get(0).(int64) - } +func (_c *Service_CountJobProposalsByStatus_Call) Run(run func(ctx context.Context)) *Service_CountJobProposalsByStatus_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} - if rf, ok := ret.Get(1).(func(context.Context) error); ok { - r1 = rf(ctx) - } else { - r1 = ret.Error(1) - } +func (_c *Service_CountJobProposalsByStatus_Call) Return(_a0 *feeds.JobProposalCounts, _a1 error) *Service_CountJobProposalsByStatus_Call { + _c.Call.Return(_a0, _a1) + return _c +} - return r0, r1 +func (_c *Service_CountJobProposalsByStatus_Call) RunAndReturn(run func(context.Context) (*feeds.JobProposalCounts, error)) *Service_CountJobProposalsByStatus_Call { + _c.Call.Return(run) + return _c } // CreateChainConfig provides a mock function with given fields: ctx, cfg @@ -154,6 +248,35 @@ func (_m *Service) CreateChainConfig(ctx context.Context, cfg feeds.ChainConfig) return r0, r1 } +// Service_CreateChainConfig_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateChainConfig' +type Service_CreateChainConfig_Call struct { + *mock.Call +} + +// CreateChainConfig is a helper method to define mock.On call +// - ctx context.Context +// - cfg feeds.ChainConfig +func (_e *Service_Expecter) CreateChainConfig(ctx interface{}, cfg interface{}) *Service_CreateChainConfig_Call { + return &Service_CreateChainConfig_Call{Call: _e.mock.On("CreateChainConfig", ctx, cfg)} +} + +func (_c *Service_CreateChainConfig_Call) Run(run func(ctx context.Context, cfg feeds.ChainConfig)) *Service_CreateChainConfig_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(feeds.ChainConfig)) + }) + return _c +} + +func (_c *Service_CreateChainConfig_Call) Return(_a0 int64, _a1 error) *Service_CreateChainConfig_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Service_CreateChainConfig_Call) RunAndReturn(run func(context.Context, feeds.ChainConfig) (int64, error)) *Service_CreateChainConfig_Call { + _c.Call.Return(run) + return _c +} + // DeleteChainConfig provides a mock function with given fields: ctx, id func (_m *Service) DeleteChainConfig(ctx context.Context, id int64) (int64, error) { ret := _m.Called(ctx, id) @@ -182,6 +305,35 @@ func (_m *Service) DeleteChainConfig(ctx context.Context, id int64) (int64, erro return r0, r1 } +// Service_DeleteChainConfig_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteChainConfig' +type Service_DeleteChainConfig_Call struct { + *mock.Call +} + +// DeleteChainConfig is a helper method to define mock.On call +// - ctx context.Context +// - id int64 +func (_e *Service_Expecter) DeleteChainConfig(ctx interface{}, id interface{}) *Service_DeleteChainConfig_Call { + return &Service_DeleteChainConfig_Call{Call: _e.mock.On("DeleteChainConfig", ctx, id)} +} + +func (_c *Service_DeleteChainConfig_Call) Run(run func(ctx context.Context, id int64)) *Service_DeleteChainConfig_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(int64)) + }) + return _c +} + +func (_c *Service_DeleteChainConfig_Call) Return(_a0 int64, _a1 error) *Service_DeleteChainConfig_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Service_DeleteChainConfig_Call) RunAndReturn(run func(context.Context, int64) (int64, error)) *Service_DeleteChainConfig_Call { + _c.Call.Return(run) + return _c +} + // DeleteJob provides a mock function with given fields: ctx, args func (_m *Service) DeleteJob(ctx context.Context, args *feeds.DeleteJobArgs) (int64, error) { ret := _m.Called(ctx, args) @@ -210,6 +362,35 @@ func (_m *Service) DeleteJob(ctx context.Context, args *feeds.DeleteJobArgs) (in return r0, r1 } +// Service_DeleteJob_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteJob' +type Service_DeleteJob_Call struct { + *mock.Call +} + +// DeleteJob is a helper method to define mock.On call +// - ctx context.Context +// - args *feeds.DeleteJobArgs +func (_e *Service_Expecter) DeleteJob(ctx interface{}, args interface{}) *Service_DeleteJob_Call { + return &Service_DeleteJob_Call{Call: _e.mock.On("DeleteJob", ctx, args)} +} + +func (_c *Service_DeleteJob_Call) Run(run func(ctx context.Context, args *feeds.DeleteJobArgs)) *Service_DeleteJob_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*feeds.DeleteJobArgs)) + }) + return _c +} + +func (_c *Service_DeleteJob_Call) Return(_a0 int64, _a1 error) *Service_DeleteJob_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Service_DeleteJob_Call) RunAndReturn(run func(context.Context, *feeds.DeleteJobArgs) (int64, error)) *Service_DeleteJob_Call { + _c.Call.Return(run) + return _c +} + // GetChainConfig provides a mock function with given fields: ctx, id func (_m *Service) GetChainConfig(ctx context.Context, id int64) (*feeds.ChainConfig, error) { ret := _m.Called(ctx, id) @@ -240,6 +421,35 @@ func (_m *Service) GetChainConfig(ctx context.Context, id int64) (*feeds.ChainCo return r0, r1 } +// Service_GetChainConfig_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetChainConfig' +type Service_GetChainConfig_Call struct { + *mock.Call +} + +// GetChainConfig is a helper method to define mock.On call +// - ctx context.Context +// - id int64 +func (_e *Service_Expecter) GetChainConfig(ctx interface{}, id interface{}) *Service_GetChainConfig_Call { + return &Service_GetChainConfig_Call{Call: _e.mock.On("GetChainConfig", ctx, id)} +} + +func (_c *Service_GetChainConfig_Call) Run(run func(ctx context.Context, id int64)) *Service_GetChainConfig_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(int64)) + }) + return _c +} + +func (_c *Service_GetChainConfig_Call) Return(_a0 *feeds.ChainConfig, _a1 error) *Service_GetChainConfig_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Service_GetChainConfig_Call) RunAndReturn(run func(context.Context, int64) (*feeds.ChainConfig, error)) *Service_GetChainConfig_Call { + _c.Call.Return(run) + return _c +} + // GetJobProposal provides a mock function with given fields: ctx, id func (_m *Service) GetJobProposal(ctx context.Context, id int64) (*feeds.JobProposal, error) { ret := _m.Called(ctx, id) @@ -270,6 +480,35 @@ func (_m *Service) GetJobProposal(ctx context.Context, id int64) (*feeds.JobProp return r0, r1 } +// Service_GetJobProposal_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetJobProposal' +type Service_GetJobProposal_Call struct { + *mock.Call +} + +// GetJobProposal is a helper method to define mock.On call +// - ctx context.Context +// - id int64 +func (_e *Service_Expecter) GetJobProposal(ctx interface{}, id interface{}) *Service_GetJobProposal_Call { + return &Service_GetJobProposal_Call{Call: _e.mock.On("GetJobProposal", ctx, id)} +} + +func (_c *Service_GetJobProposal_Call) Run(run func(ctx context.Context, id int64)) *Service_GetJobProposal_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(int64)) + }) + return _c +} + +func (_c *Service_GetJobProposal_Call) Return(_a0 *feeds.JobProposal, _a1 error) *Service_GetJobProposal_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Service_GetJobProposal_Call) RunAndReturn(run func(context.Context, int64) (*feeds.JobProposal, error)) *Service_GetJobProposal_Call { + _c.Call.Return(run) + return _c +} + // GetManager provides a mock function with given fields: ctx, id func (_m *Service) GetManager(ctx context.Context, id int64) (*feeds.FeedsManager, error) { ret := _m.Called(ctx, id) @@ -300,6 +539,35 @@ func (_m *Service) GetManager(ctx context.Context, id int64) (*feeds.FeedsManage return r0, r1 } +// Service_GetManager_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetManager' +type Service_GetManager_Call struct { + *mock.Call +} + +// GetManager is a helper method to define mock.On call +// - ctx context.Context +// - id int64 +func (_e *Service_Expecter) GetManager(ctx interface{}, id interface{}) *Service_GetManager_Call { + return &Service_GetManager_Call{Call: _e.mock.On("GetManager", ctx, id)} +} + +func (_c *Service_GetManager_Call) Run(run func(ctx context.Context, id int64)) *Service_GetManager_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(int64)) + }) + return _c +} + +func (_c *Service_GetManager_Call) Return(_a0 *feeds.FeedsManager, _a1 error) *Service_GetManager_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Service_GetManager_Call) RunAndReturn(run func(context.Context, int64) (*feeds.FeedsManager, error)) *Service_GetManager_Call { + _c.Call.Return(run) + return _c +} + // GetSpec provides a mock function with given fields: ctx, id func (_m *Service) GetSpec(ctx context.Context, id int64) (*feeds.JobProposalSpec, error) { ret := _m.Called(ctx, id) @@ -330,6 +598,35 @@ func (_m *Service) GetSpec(ctx context.Context, id int64) (*feeds.JobProposalSpe return r0, r1 } +// Service_GetSpec_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSpec' +type Service_GetSpec_Call struct { + *mock.Call +} + +// GetSpec is a helper method to define mock.On call +// - ctx context.Context +// - id int64 +func (_e *Service_Expecter) GetSpec(ctx interface{}, id interface{}) *Service_GetSpec_Call { + return &Service_GetSpec_Call{Call: _e.mock.On("GetSpec", ctx, id)} +} + +func (_c *Service_GetSpec_Call) Run(run func(ctx context.Context, id int64)) *Service_GetSpec_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(int64)) + }) + return _c +} + +func (_c *Service_GetSpec_Call) Return(_a0 *feeds.JobProposalSpec, _a1 error) *Service_GetSpec_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Service_GetSpec_Call) RunAndReturn(run func(context.Context, int64) (*feeds.JobProposalSpec, error)) *Service_GetSpec_Call { + _c.Call.Return(run) + return _c +} + // IsJobManaged provides a mock function with given fields: ctx, jobID func (_m *Service) IsJobManaged(ctx context.Context, jobID int64) (bool, error) { ret := _m.Called(ctx, jobID) @@ -358,6 +655,35 @@ func (_m *Service) IsJobManaged(ctx context.Context, jobID int64) (bool, error) return r0, r1 } +// Service_IsJobManaged_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsJobManaged' +type Service_IsJobManaged_Call struct { + *mock.Call +} + +// IsJobManaged is a helper method to define mock.On call +// - ctx context.Context +// - jobID int64 +func (_e *Service_Expecter) IsJobManaged(ctx interface{}, jobID interface{}) *Service_IsJobManaged_Call { + return &Service_IsJobManaged_Call{Call: _e.mock.On("IsJobManaged", ctx, jobID)} +} + +func (_c *Service_IsJobManaged_Call) Run(run func(ctx context.Context, jobID int64)) *Service_IsJobManaged_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(int64)) + }) + return _c +} + +func (_c *Service_IsJobManaged_Call) Return(_a0 bool, _a1 error) *Service_IsJobManaged_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Service_IsJobManaged_Call) RunAndReturn(run func(context.Context, int64) (bool, error)) *Service_IsJobManaged_Call { + _c.Call.Return(run) + return _c +} + // ListChainConfigsByManagerIDs provides a mock function with given fields: ctx, mgrIDs func (_m *Service) ListChainConfigsByManagerIDs(ctx context.Context, mgrIDs []int64) ([]feeds.ChainConfig, error) { ret := _m.Called(ctx, mgrIDs) @@ -388,34 +714,33 @@ func (_m *Service) ListChainConfigsByManagerIDs(ctx context.Context, mgrIDs []in return r0, r1 } -// ListJobProposals provides a mock function with given fields: ctx -func (_m *Service) ListJobProposals(ctx context.Context) ([]feeds.JobProposal, error) { - ret := _m.Called(ctx) +// Service_ListChainConfigsByManagerIDs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListChainConfigsByManagerIDs' +type Service_ListChainConfigsByManagerIDs_Call struct { + *mock.Call +} - if len(ret) == 0 { - panic("no return value specified for ListJobProposals") - } +// ListChainConfigsByManagerIDs is a helper method to define mock.On call +// - ctx context.Context +// - mgrIDs []int64 +func (_e *Service_Expecter) ListChainConfigsByManagerIDs(ctx interface{}, mgrIDs interface{}) *Service_ListChainConfigsByManagerIDs_Call { + return &Service_ListChainConfigsByManagerIDs_Call{Call: _e.mock.On("ListChainConfigsByManagerIDs", ctx, mgrIDs)} +} - var r0 []feeds.JobProposal - var r1 error - if rf, ok := ret.Get(0).(func(context.Context) ([]feeds.JobProposal, error)); ok { - return rf(ctx) - } - if rf, ok := ret.Get(0).(func(context.Context) []feeds.JobProposal); ok { - r0 = rf(ctx) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]feeds.JobProposal) - } - } +func (_c *Service_ListChainConfigsByManagerIDs_Call) Run(run func(ctx context.Context, mgrIDs []int64)) *Service_ListChainConfigsByManagerIDs_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].([]int64)) + }) + return _c +} - if rf, ok := ret.Get(1).(func(context.Context) error); ok { - r1 = rf(ctx) - } else { - r1 = ret.Error(1) - } +func (_c *Service_ListChainConfigsByManagerIDs_Call) Return(_a0 []feeds.ChainConfig, _a1 error) *Service_ListChainConfigsByManagerIDs_Call { + _c.Call.Return(_a0, _a1) + return _c +} - return r0, r1 +func (_c *Service_ListChainConfigsByManagerIDs_Call) RunAndReturn(run func(context.Context, []int64) ([]feeds.ChainConfig, error)) *Service_ListChainConfigsByManagerIDs_Call { + _c.Call.Return(run) + return _c } // ListJobProposalsByManagersIDs provides a mock function with given fields: ctx, ids @@ -448,6 +773,35 @@ func (_m *Service) ListJobProposalsByManagersIDs(ctx context.Context, ids []int6 return r0, r1 } +// Service_ListJobProposalsByManagersIDs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListJobProposalsByManagersIDs' +type Service_ListJobProposalsByManagersIDs_Call struct { + *mock.Call +} + +// ListJobProposalsByManagersIDs is a helper method to define mock.On call +// - ctx context.Context +// - ids []int64 +func (_e *Service_Expecter) ListJobProposalsByManagersIDs(ctx interface{}, ids interface{}) *Service_ListJobProposalsByManagersIDs_Call { + return &Service_ListJobProposalsByManagersIDs_Call{Call: _e.mock.On("ListJobProposalsByManagersIDs", ctx, ids)} +} + +func (_c *Service_ListJobProposalsByManagersIDs_Call) Run(run func(ctx context.Context, ids []int64)) *Service_ListJobProposalsByManagersIDs_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].([]int64)) + }) + return _c +} + +func (_c *Service_ListJobProposalsByManagersIDs_Call) Return(_a0 []feeds.JobProposal, _a1 error) *Service_ListJobProposalsByManagersIDs_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Service_ListJobProposalsByManagersIDs_Call) RunAndReturn(run func(context.Context, []int64) ([]feeds.JobProposal, error)) *Service_ListJobProposalsByManagersIDs_Call { + _c.Call.Return(run) + return _c +} + // ListManagers provides a mock function with given fields: ctx func (_m *Service) ListManagers(ctx context.Context) ([]feeds.FeedsManager, error) { ret := _m.Called(ctx) @@ -478,6 +832,34 @@ func (_m *Service) ListManagers(ctx context.Context) ([]feeds.FeedsManager, erro return r0, r1 } +// Service_ListManagers_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListManagers' +type Service_ListManagers_Call struct { + *mock.Call +} + +// ListManagers is a helper method to define mock.On call +// - ctx context.Context +func (_e *Service_Expecter) ListManagers(ctx interface{}) *Service_ListManagers_Call { + return &Service_ListManagers_Call{Call: _e.mock.On("ListManagers", ctx)} +} + +func (_c *Service_ListManagers_Call) Run(run func(ctx context.Context)) *Service_ListManagers_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *Service_ListManagers_Call) Return(_a0 []feeds.FeedsManager, _a1 error) *Service_ListManagers_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Service_ListManagers_Call) RunAndReturn(run func(context.Context) ([]feeds.FeedsManager, error)) *Service_ListManagers_Call { + _c.Call.Return(run) + return _c +} + // ListManagersByIDs provides a mock function with given fields: ctx, ids func (_m *Service) ListManagersByIDs(ctx context.Context, ids []int64) ([]feeds.FeedsManager, error) { ret := _m.Called(ctx, ids) @@ -508,6 +890,35 @@ func (_m *Service) ListManagersByIDs(ctx context.Context, ids []int64) ([]feeds. return r0, r1 } +// Service_ListManagersByIDs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListManagersByIDs' +type Service_ListManagersByIDs_Call struct { + *mock.Call +} + +// ListManagersByIDs is a helper method to define mock.On call +// - ctx context.Context +// - ids []int64 +func (_e *Service_Expecter) ListManagersByIDs(ctx interface{}, ids interface{}) *Service_ListManagersByIDs_Call { + return &Service_ListManagersByIDs_Call{Call: _e.mock.On("ListManagersByIDs", ctx, ids)} +} + +func (_c *Service_ListManagersByIDs_Call) Run(run func(ctx context.Context, ids []int64)) *Service_ListManagersByIDs_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].([]int64)) + }) + return _c +} + +func (_c *Service_ListManagersByIDs_Call) Return(_a0 []feeds.FeedsManager, _a1 error) *Service_ListManagersByIDs_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Service_ListManagersByIDs_Call) RunAndReturn(run func(context.Context, []int64) ([]feeds.FeedsManager, error)) *Service_ListManagersByIDs_Call { + _c.Call.Return(run) + return _c +} + // ListSpecsByJobProposalIDs provides a mock function with given fields: ctx, ids func (_m *Service) ListSpecsByJobProposalIDs(ctx context.Context, ids []int64) ([]feeds.JobProposalSpec, error) { ret := _m.Called(ctx, ids) @@ -538,6 +949,35 @@ func (_m *Service) ListSpecsByJobProposalIDs(ctx context.Context, ids []int64) ( return r0, r1 } +// Service_ListSpecsByJobProposalIDs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListSpecsByJobProposalIDs' +type Service_ListSpecsByJobProposalIDs_Call struct { + *mock.Call +} + +// ListSpecsByJobProposalIDs is a helper method to define mock.On call +// - ctx context.Context +// - ids []int64 +func (_e *Service_Expecter) ListSpecsByJobProposalIDs(ctx interface{}, ids interface{}) *Service_ListSpecsByJobProposalIDs_Call { + return &Service_ListSpecsByJobProposalIDs_Call{Call: _e.mock.On("ListSpecsByJobProposalIDs", ctx, ids)} +} + +func (_c *Service_ListSpecsByJobProposalIDs_Call) Run(run func(ctx context.Context, ids []int64)) *Service_ListSpecsByJobProposalIDs_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].([]int64)) + }) + return _c +} + +func (_c *Service_ListSpecsByJobProposalIDs_Call) Return(_a0 []feeds.JobProposalSpec, _a1 error) *Service_ListSpecsByJobProposalIDs_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Service_ListSpecsByJobProposalIDs_Call) RunAndReturn(run func(context.Context, []int64) ([]feeds.JobProposalSpec, error)) *Service_ListSpecsByJobProposalIDs_Call { + _c.Call.Return(run) + return _c +} + // ProposeJob provides a mock function with given fields: ctx, args func (_m *Service) ProposeJob(ctx context.Context, args *feeds.ProposeJobArgs) (int64, error) { ret := _m.Called(ctx, args) @@ -566,6 +1006,35 @@ func (_m *Service) ProposeJob(ctx context.Context, args *feeds.ProposeJobArgs) ( return r0, r1 } +// Service_ProposeJob_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ProposeJob' +type Service_ProposeJob_Call struct { + *mock.Call +} + +// ProposeJob is a helper method to define mock.On call +// - ctx context.Context +// - args *feeds.ProposeJobArgs +func (_e *Service_Expecter) ProposeJob(ctx interface{}, args interface{}) *Service_ProposeJob_Call { + return &Service_ProposeJob_Call{Call: _e.mock.On("ProposeJob", ctx, args)} +} + +func (_c *Service_ProposeJob_Call) Run(run func(ctx context.Context, args *feeds.ProposeJobArgs)) *Service_ProposeJob_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*feeds.ProposeJobArgs)) + }) + return _c +} + +func (_c *Service_ProposeJob_Call) Return(_a0 int64, _a1 error) *Service_ProposeJob_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Service_ProposeJob_Call) RunAndReturn(run func(context.Context, *feeds.ProposeJobArgs) (int64, error)) *Service_ProposeJob_Call { + _c.Call.Return(run) + return _c +} + // RegisterManager provides a mock function with given fields: ctx, params func (_m *Service) RegisterManager(ctx context.Context, params feeds.RegisterManagerParams) (int64, error) { ret := _m.Called(ctx, params) @@ -594,6 +1063,35 @@ func (_m *Service) RegisterManager(ctx context.Context, params feeds.RegisterMan return r0, r1 } +// Service_RegisterManager_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RegisterManager' +type Service_RegisterManager_Call struct { + *mock.Call +} + +// RegisterManager is a helper method to define mock.On call +// - ctx context.Context +// - params feeds.RegisterManagerParams +func (_e *Service_Expecter) RegisterManager(ctx interface{}, params interface{}) *Service_RegisterManager_Call { + return &Service_RegisterManager_Call{Call: _e.mock.On("RegisterManager", ctx, params)} +} + +func (_c *Service_RegisterManager_Call) Run(run func(ctx context.Context, params feeds.RegisterManagerParams)) *Service_RegisterManager_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(feeds.RegisterManagerParams)) + }) + return _c +} + +func (_c *Service_RegisterManager_Call) Return(_a0 int64, _a1 error) *Service_RegisterManager_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Service_RegisterManager_Call) RunAndReturn(run func(context.Context, feeds.RegisterManagerParams) (int64, error)) *Service_RegisterManager_Call { + _c.Call.Return(run) + return _c +} + // RejectSpec provides a mock function with given fields: ctx, id func (_m *Service) RejectSpec(ctx context.Context, id int64) error { ret := _m.Called(ctx, id) @@ -612,6 +1110,35 @@ func (_m *Service) RejectSpec(ctx context.Context, id int64) error { return r0 } +// Service_RejectSpec_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RejectSpec' +type Service_RejectSpec_Call struct { + *mock.Call +} + +// RejectSpec is a helper method to define mock.On call +// - ctx context.Context +// - id int64 +func (_e *Service_Expecter) RejectSpec(ctx interface{}, id interface{}) *Service_RejectSpec_Call { + return &Service_RejectSpec_Call{Call: _e.mock.On("RejectSpec", ctx, id)} +} + +func (_c *Service_RejectSpec_Call) Run(run func(ctx context.Context, id int64)) *Service_RejectSpec_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(int64)) + }) + return _c +} + +func (_c *Service_RejectSpec_Call) Return(_a0 error) *Service_RejectSpec_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Service_RejectSpec_Call) RunAndReturn(run func(context.Context, int64) error) *Service_RejectSpec_Call { + _c.Call.Return(run) + return _c +} + // RevokeJob provides a mock function with given fields: ctx, args func (_m *Service) RevokeJob(ctx context.Context, args *feeds.RevokeJobArgs) (int64, error) { ret := _m.Called(ctx, args) @@ -640,6 +1167,35 @@ func (_m *Service) RevokeJob(ctx context.Context, args *feeds.RevokeJobArgs) (in return r0, r1 } +// Service_RevokeJob_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RevokeJob' +type Service_RevokeJob_Call struct { + *mock.Call +} + +// RevokeJob is a helper method to define mock.On call +// - ctx context.Context +// - args *feeds.RevokeJobArgs +func (_e *Service_Expecter) RevokeJob(ctx interface{}, args interface{}) *Service_RevokeJob_Call { + return &Service_RevokeJob_Call{Call: _e.mock.On("RevokeJob", ctx, args)} +} + +func (_c *Service_RevokeJob_Call) Run(run func(ctx context.Context, args *feeds.RevokeJobArgs)) *Service_RevokeJob_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*feeds.RevokeJobArgs)) + }) + return _c +} + +func (_c *Service_RevokeJob_Call) Return(_a0 int64, _a1 error) *Service_RevokeJob_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Service_RevokeJob_Call) RunAndReturn(run func(context.Context, *feeds.RevokeJobArgs) (int64, error)) *Service_RevokeJob_Call { + _c.Call.Return(run) + return _c +} + // Start provides a mock function with given fields: ctx func (_m *Service) Start(ctx context.Context) error { ret := _m.Called(ctx) @@ -658,6 +1214,34 @@ func (_m *Service) Start(ctx context.Context) error { return r0 } +// Service_Start_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Start' +type Service_Start_Call struct { + *mock.Call +} + +// Start is a helper method to define mock.On call +// - ctx context.Context +func (_e *Service_Expecter) Start(ctx interface{}) *Service_Start_Call { + return &Service_Start_Call{Call: _e.mock.On("Start", ctx)} +} + +func (_c *Service_Start_Call) Run(run func(ctx context.Context)) *Service_Start_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *Service_Start_Call) Return(_a0 error) *Service_Start_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Service_Start_Call) RunAndReturn(run func(context.Context) error) *Service_Start_Call { + _c.Call.Return(run) + return _c +} + // SyncNodeInfo provides a mock function with given fields: ctx, id func (_m *Service) SyncNodeInfo(ctx context.Context, id int64) error { ret := _m.Called(ctx, id) @@ -676,6 +1260,68 @@ func (_m *Service) SyncNodeInfo(ctx context.Context, id int64) error { return r0 } +// Service_SyncNodeInfo_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SyncNodeInfo' +type Service_SyncNodeInfo_Call struct { + *mock.Call +} + +// SyncNodeInfo is a helper method to define mock.On call +// - ctx context.Context +// - id int64 +func (_e *Service_Expecter) SyncNodeInfo(ctx interface{}, id interface{}) *Service_SyncNodeInfo_Call { + return &Service_SyncNodeInfo_Call{Call: _e.mock.On("SyncNodeInfo", ctx, id)} +} + +func (_c *Service_SyncNodeInfo_Call) Run(run func(ctx context.Context, id int64)) *Service_SyncNodeInfo_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(int64)) + }) + return _c +} + +func (_c *Service_SyncNodeInfo_Call) Return(_a0 error) *Service_SyncNodeInfo_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Service_SyncNodeInfo_Call) RunAndReturn(run func(context.Context, int64) error) *Service_SyncNodeInfo_Call { + _c.Call.Return(run) + return _c +} + +// Unsafe_SetConnectionsManager provides a mock function with given fields: _a0 +func (_m *Service) Unsafe_SetConnectionsManager(_a0 feeds.ConnectionsManager) { + _m.Called(_a0) +} + +// Service_Unsafe_SetConnectionsManager_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Unsafe_SetConnectionsManager' +type Service_Unsafe_SetConnectionsManager_Call struct { + *mock.Call +} + +// Unsafe_SetConnectionsManager is a helper method to define mock.On call +// - _a0 feeds.ConnectionsManager +func (_e *Service_Expecter) Unsafe_SetConnectionsManager(_a0 interface{}) *Service_Unsafe_SetConnectionsManager_Call { + return &Service_Unsafe_SetConnectionsManager_Call{Call: _e.mock.On("Unsafe_SetConnectionsManager", _a0)} +} + +func (_c *Service_Unsafe_SetConnectionsManager_Call) Run(run func(_a0 feeds.ConnectionsManager)) *Service_Unsafe_SetConnectionsManager_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(feeds.ConnectionsManager)) + }) + return _c +} + +func (_c *Service_Unsafe_SetConnectionsManager_Call) Return() *Service_Unsafe_SetConnectionsManager_Call { + _c.Call.Return() + return _c +} + +func (_c *Service_Unsafe_SetConnectionsManager_Call) RunAndReturn(run func(feeds.ConnectionsManager)) *Service_Unsafe_SetConnectionsManager_Call { + _c.Call.Return(run) + return _c +} + // UpdateChainConfig provides a mock function with given fields: ctx, cfg func (_m *Service) UpdateChainConfig(ctx context.Context, cfg feeds.ChainConfig) (int64, error) { ret := _m.Called(ctx, cfg) @@ -704,6 +1350,35 @@ func (_m *Service) UpdateChainConfig(ctx context.Context, cfg feeds.ChainConfig) return r0, r1 } +// Service_UpdateChainConfig_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateChainConfig' +type Service_UpdateChainConfig_Call struct { + *mock.Call +} + +// UpdateChainConfig is a helper method to define mock.On call +// - ctx context.Context +// - cfg feeds.ChainConfig +func (_e *Service_Expecter) UpdateChainConfig(ctx interface{}, cfg interface{}) *Service_UpdateChainConfig_Call { + return &Service_UpdateChainConfig_Call{Call: _e.mock.On("UpdateChainConfig", ctx, cfg)} +} + +func (_c *Service_UpdateChainConfig_Call) Run(run func(ctx context.Context, cfg feeds.ChainConfig)) *Service_UpdateChainConfig_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(feeds.ChainConfig)) + }) + return _c +} + +func (_c *Service_UpdateChainConfig_Call) Return(_a0 int64, _a1 error) *Service_UpdateChainConfig_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Service_UpdateChainConfig_Call) RunAndReturn(run func(context.Context, feeds.ChainConfig) (int64, error)) *Service_UpdateChainConfig_Call { + _c.Call.Return(run) + return _c +} + // UpdateManager provides a mock function with given fields: ctx, mgr func (_m *Service) UpdateManager(ctx context.Context, mgr feeds.FeedsManager) error { ret := _m.Called(ctx, mgr) @@ -722,6 +1397,35 @@ func (_m *Service) UpdateManager(ctx context.Context, mgr feeds.FeedsManager) er return r0 } +// Service_UpdateManager_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateManager' +type Service_UpdateManager_Call struct { + *mock.Call +} + +// UpdateManager is a helper method to define mock.On call +// - ctx context.Context +// - mgr feeds.FeedsManager +func (_e *Service_Expecter) UpdateManager(ctx interface{}, mgr interface{}) *Service_UpdateManager_Call { + return &Service_UpdateManager_Call{Call: _e.mock.On("UpdateManager", ctx, mgr)} +} + +func (_c *Service_UpdateManager_Call) Run(run func(ctx context.Context, mgr feeds.FeedsManager)) *Service_UpdateManager_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(feeds.FeedsManager)) + }) + return _c +} + +func (_c *Service_UpdateManager_Call) Return(_a0 error) *Service_UpdateManager_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Service_UpdateManager_Call) RunAndReturn(run func(context.Context, feeds.FeedsManager) error) *Service_UpdateManager_Call { + _c.Call.Return(run) + return _c +} + // UpdateSpecDefinition provides a mock function with given fields: ctx, id, spec func (_m *Service) UpdateSpecDefinition(ctx context.Context, id int64, spec string) error { ret := _m.Called(ctx, id, spec) @@ -740,6 +1444,36 @@ func (_m *Service) UpdateSpecDefinition(ctx context.Context, id int64, spec stri return r0 } +// Service_UpdateSpecDefinition_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateSpecDefinition' +type Service_UpdateSpecDefinition_Call struct { + *mock.Call +} + +// UpdateSpecDefinition is a helper method to define mock.On call +// - ctx context.Context +// - id int64 +// - spec string +func (_e *Service_Expecter) UpdateSpecDefinition(ctx interface{}, id interface{}, spec interface{}) *Service_UpdateSpecDefinition_Call { + return &Service_UpdateSpecDefinition_Call{Call: _e.mock.On("UpdateSpecDefinition", ctx, id, spec)} +} + +func (_c *Service_UpdateSpecDefinition_Call) Run(run func(ctx context.Context, id int64, spec string)) *Service_UpdateSpecDefinition_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(int64), args[2].(string)) + }) + return _c +} + +func (_c *Service_UpdateSpecDefinition_Call) Return(_a0 error) *Service_UpdateSpecDefinition_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Service_UpdateSpecDefinition_Call) RunAndReturn(run func(context.Context, int64, string) error) *Service_UpdateSpecDefinition_Call { + _c.Call.Return(run) + return _c +} + // NewService creates a new instance of Service. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewService(t interface { diff --git a/core/services/feeds/orm.go b/core/services/feeds/orm.go index 23d7044879e..82d1114a23d 100644 --- a/core/services/feeds/orm.go +++ b/core/services/feeds/orm.go @@ -11,11 +11,12 @@ import ( "github.com/pkg/errors" "github.com/smartcontractkit/chainlink-common/pkg/sqlutil" -) -//go:generate mockery --with-expecter=true --quiet --name ORM --output ./mocks/ --case=underscore + "github.com/smartcontractkit/chainlink/v2/core/utils/crypto" +) type ORM interface { + ManagerExists(ctx context.Context, publicKey crypto.PublicKey) (bool, error) CountManagers(ctx context.Context) (int64, error) CreateManager(ctx context.Context, ms *FeedsManager) (int64, error) GetManager(ctx context.Context, id int64) (*FeedsManager, error) @@ -36,7 +37,6 @@ type ORM interface { DeleteProposal(ctx context.Context, id int64) error GetJobProposal(ctx context.Context, id int64) (*JobProposal, error) GetJobProposalByRemoteUUID(ctx context.Context, uuid uuid.UUID) (*JobProposal, error) - ListJobProposals(ctx context.Context) (jps []JobProposal, err error) ListJobProposalsByManagersIDs(ctx context.Context, ids []int64) ([]JobProposal, error) UpdateJobProposalStatus(ctx context.Context, id int64, status JobProposalStatus) error // NEEDED? UpsertJobProposal(ctx context.Context, jp *JobProposal) (int64, error) @@ -76,6 +76,7 @@ func (o *orm) Transact(ctx context.Context, fn func(ORM) error) error { func (o *orm) WithDataSource(ds sqlutil.DataSource) ORM { return &orm{ds} } // Count counts the number of feeds manager records. +// TODO: delete once multiple feeds managers support is released func (o *orm) CountManagers(ctx context.Context) (count int64, err error) { stmt := ` SELECT COUNT(*) @@ -86,6 +87,21 @@ FROM feeds_managers return count, errors.Wrap(err, "CountManagers failed") } +// ManagerExists checks if a feeds manager exists by public key. +func (o *orm) ManagerExists(ctx context.Context, publicKey crypto.PublicKey) (bool, error) { + stmt := ` +SELECT EXISTS ( + SELECT 1 + FROM feeds_managers + WHERE public_key = $1 +); + ` + + var exists bool + err := o.ds.GetContext(ctx, &exists, stmt, publicKey) + return exists, errors.Wrap(err, "ManagerExists failed") +} + // CreateManager creates a feeds manager. func (o *orm) CreateManager(ctx context.Context, ms *FeedsManager) (id int64, err error) { stmt := ` @@ -266,7 +282,8 @@ WHERE id = $1 func (o *orm) ListManagers(ctx context.Context) (mgrs []FeedsManager, err error) { stmt := ` SELECT id, name, uri, public_key, created_at, updated_at -FROM feeds_managers; +FROM feeds_managers +ORDER BY created_at; ` err = o.ds.SelectContext(ctx, &mgrs, stmt) @@ -375,17 +392,6 @@ AND status <> $2; return jp, errors.Wrap(err, "GetJobProposalByRemoteUUID failed") } -// ListJobProposals lists all job proposals. -func (o *orm) ListJobProposals(ctx context.Context) (jps []JobProposal, err error) { - stmt := ` -SELECT * -FROM job_proposals; -` - - err = o.ds.SelectContext(ctx, &jps, stmt) - return jps, errors.Wrap(err, "ListJobProposals failed") -} - // ListJobProposalsByManagersIDs gets job proposals by feeds managers IDs. func (o *orm) ListJobProposalsByManagersIDs(ctx context.Context, ids []int64) ([]JobProposal, error) { stmt := ` @@ -821,6 +827,7 @@ SELECT exists ( FROM job_proposals INNER JOIN jobs ON job_proposals.external_job_id = jobs.external_job_id WHERE jobs.id = $1 + AND job_proposals.status <> 'deleted' ); ` diff --git a/core/services/feeds/orm_test.go b/core/services/feeds/orm_test.go index c4c9ced2ce3..976465f37f0 100644 --- a/core/services/feeds/orm_test.go +++ b/core/services/feeds/orm_test.go @@ -53,7 +53,7 @@ func setupORM(t *testing.T) *TestORM { // Managers -func Test_ORM_CreateManager(t *testing.T) { +func Test_ORM_CreateManager_CountManagers(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -80,6 +80,33 @@ func Test_ORM_CreateManager(t *testing.T) { assert.NotZero(t, id) } +func Test_ORM_CreateManager(t *testing.T) { + t.Parallel() + ctx := testutils.Context(t) + + var ( + orm = setupORM(t) + mgr = &feeds.FeedsManager{ + URI: uri, + Name: name, + PublicKey: publicKey, + } + ) + + exists, err := orm.ManagerExists(ctx, publicKey) + require.NoError(t, err) + require.Equal(t, false, exists) + + id, err := orm.CreateManager(ctx, mgr) + require.NoError(t, err) + + exists, err = orm.ManagerExists(ctx, publicKey) + require.NoError(t, err) + require.Equal(t, true, exists) + + assert.NotZero(t, id) +} + func Test_ORM_GetManager(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -555,39 +582,6 @@ func Test_ORM_GetJobProposal(t *testing.T) { }) } -func Test_ORM_ListJobProposals(t *testing.T) { - t.Parallel() - ctx := testutils.Context(t) - - orm := setupORM(t) - fmID := createFeedsManager(t, orm) - uuid := uuid.New() - name := null.StringFrom("jp1") - - jp := &feeds.JobProposal{ - Name: name, - RemoteUUID: uuid, - Status: feeds.JobProposalStatusPending, - FeedsManagerID: fmID, - } - - id, err := orm.CreateJobProposal(ctx, jp) - require.NoError(t, err) - - jps, err := orm.ListJobProposals(ctx) - require.NoError(t, err) - require.Len(t, jps, 1) - - actual := jps[0] - assert.Equal(t, id, actual.ID) - assert.Equal(t, name, actual.Name) - assert.Equal(t, uuid, actual.RemoteUUID) - assert.Equal(t, jp.Status, actual.Status) - assert.False(t, actual.ExternalJobID.Valid) - assert.False(t, actual.PendingUpdate) - assert.Equal(t, jp.FeedsManagerID, actual.FeedsManagerID) -} - func Test_ORM_CountJobProposalsByStatus(t *testing.T) { t.Parallel() @@ -1659,6 +1653,14 @@ func Test_ORM_IsJobManaged(t *testing.T) { isManaged, err = orm.IsJobManaged(ctx, int64(j.ID)) require.NoError(t, err) assert.True(t, isManaged) + + // delete the proposal + err = orm.DeleteProposal(ctx, jpID) + require.NoError(t, err) + + isManaged, err = orm.IsJobManaged(ctx, int64(j.ID)) + require.NoError(t, err) + assert.False(t, isManaged) } // Helpers diff --git a/core/services/feeds/proto/feeds_manager.pb.go b/core/services/feeds/proto/feeds_manager.pb.go index 89f351a4270..010ee44ae83 100644 --- a/core/services/feeds/proto/feeds_manager.pb.go +++ b/core/services/feeds/proto/feeds_manager.pb.go @@ -7,10 +7,11 @@ package proto import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" ) const ( @@ -79,8 +80,7 @@ const ( ChainType_CHAIN_TYPE_UNSPECIFIED ChainType = 0 ChainType_CHAIN_TYPE_EVM ChainType = 1 ChainType_CHAIN_TYPE_SOLANA ChainType = 2 - ChainType_CHAIN_TYPE_ZKSYNC ChainType = 3 - ChainType_CHAIN_TYPE_STARKNET ChainType = 4 + ChainType_CHAIN_TYPE_STARKNET ChainType = 3 ) // Enum value maps for ChainType. @@ -89,15 +89,13 @@ var ( 0: "CHAIN_TYPE_UNSPECIFIED", 1: "CHAIN_TYPE_EVM", 2: "CHAIN_TYPE_SOLANA", - 3: "CHAIN_TYPE_ZKSYNC", - 4: "CHAIN_TYPE_STARKNET", + 3: "CHAIN_TYPE_STARKNET", } ChainType_value = map[string]int32{ "CHAIN_TYPE_UNSPECIFIED": 0, "CHAIN_TYPE_EVM": 1, "CHAIN_TYPE_SOLANA": 2, - "CHAIN_TYPE_ZKSYNC": 3, - "CHAIN_TYPE_STARKNET": 4, + "CHAIN_TYPE_STARKNET": 3, } ) @@ -476,13 +474,17 @@ type ChainConfig struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Chain *Chain `protobuf:"bytes,1,opt,name=chain,proto3" json:"chain,omitempty"` - AccountAddress string `protobuf:"bytes,2,opt,name=account_address,json=accountAddress,proto3" json:"account_address,omitempty"` - AdminAddress string `protobuf:"bytes,3,opt,name=admin_address,json=adminAddress,proto3" json:"admin_address,omitempty"` - FluxMonitorConfig *FluxMonitorConfig `protobuf:"bytes,4,opt,name=flux_monitor_config,json=fluxMonitorConfig,proto3" json:"flux_monitor_config,omitempty"` - Ocr1Config *OCR1Config `protobuf:"bytes,5,opt,name=ocr1_config,json=ocr1Config,proto3" json:"ocr1_config,omitempty"` - Ocr2Config *OCR2Config `protobuf:"bytes,6,opt,name=ocr2_config,json=ocr2Config,proto3" json:"ocr2_config,omitempty"` - AccountAddressPublicKey *string `protobuf:"bytes,7,opt,name=account_address_public_key,json=accountAddressPublicKey,proto3,oneof" json:"account_address_public_key,omitempty"` + Chain *Chain `protobuf:"bytes,1,opt,name=chain,proto3" json:"chain,omitempty"` + AccountAddress string `protobuf:"bytes,2,opt,name=account_address,json=accountAddress,proto3" json:"account_address,omitempty"` + AdminAddress string `protobuf:"bytes,3,opt,name=admin_address,json=adminAddress,proto3" json:"admin_address,omitempty"` + FluxMonitorConfig *FluxMonitorConfig `protobuf:"bytes,4,opt,name=flux_monitor_config,json=fluxMonitorConfig,proto3" json:"flux_monitor_config,omitempty"` + Ocr1Config *OCR1Config `protobuf:"bytes,5,opt,name=ocr1_config,json=ocr1Config,proto3" json:"ocr1_config,omitempty"` + Ocr2Config *OCR2Config `protobuf:"bytes,6,opt,name=ocr2_config,json=ocr2Config,proto3" json:"ocr2_config,omitempty"` + // For EVM chains, we do not need this value and it is kept in the node's + // keystore. For starknet, because the wallet address needs to be deployed + // using this value and this pub key needs to be passed into the starknet + // relayer, we request the node to send this directly to CLO. + AccountAddressPublicKey *string `protobuf:"bytes,7,opt,name=account_address_public_key,json=accountAddressPublicKey,proto3,oneof" json:"account_address_public_key,omitempty"` } func (x *ChainConfig) Reset() { @@ -1912,53 +1914,52 @@ var file_pkg_noderpc_proto_feeds_manager_proto_rawDesc = []byte{ 0x5f, 0x4d, 0x4f, 0x4e, 0x49, 0x54, 0x4f, 0x52, 0x10, 0x01, 0x12, 0x10, 0x0a, 0x0c, 0x4a, 0x4f, 0x42, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4f, 0x43, 0x52, 0x10, 0x02, 0x12, 0x11, 0x0a, 0x0d, 0x4a, 0x4f, 0x42, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4f, 0x43, 0x52, 0x32, 0x10, 0x03, 0x2a, - 0x82, 0x01, 0x0a, 0x09, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, - 0x16, 0x43, 0x48, 0x41, 0x49, 0x4e, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, - 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x12, 0x0a, 0x0e, 0x43, 0x48, 0x41, - 0x49, 0x4e, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x45, 0x56, 0x4d, 0x10, 0x01, 0x12, 0x15, 0x0a, - 0x11, 0x43, 0x48, 0x41, 0x49, 0x4e, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x53, 0x4f, 0x4c, 0x41, - 0x4e, 0x41, 0x10, 0x02, 0x12, 0x15, 0x0a, 0x11, 0x43, 0x48, 0x41, 0x49, 0x4e, 0x5f, 0x54, 0x59, - 0x50, 0x45, 0x5f, 0x5a, 0x4b, 0x53, 0x59, 0x4e, 0x43, 0x10, 0x03, 0x12, 0x17, 0x0a, 0x13, 0x43, - 0x48, 0x41, 0x49, 0x4e, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x53, 0x54, 0x41, 0x52, 0x4b, 0x4e, - 0x45, 0x54, 0x10, 0x04, 0x32, 0xd8, 0x02, 0x0a, 0x0c, 0x46, 0x65, 0x65, 0x64, 0x73, 0x4d, 0x61, - 0x6e, 0x61, 0x67, 0x65, 0x72, 0x12, 0x40, 0x0a, 0x0b, 0x41, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, - 0x64, 0x4a, 0x6f, 0x62, 0x12, 0x17, 0x2e, 0x63, 0x66, 0x6d, 0x2e, 0x41, 0x70, 0x70, 0x72, 0x6f, - 0x76, 0x65, 0x64, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, - 0x63, 0x66, 0x6d, 0x2e, 0x41, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x64, 0x4a, 0x6f, 0x62, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, 0x0b, 0x48, 0x65, 0x61, 0x6c, 0x74, - 0x68, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x12, 0x17, 0x2e, 0x63, 0x66, 0x6d, 0x2e, 0x48, 0x65, 0x61, - 0x6c, 0x74, 0x68, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x18, 0x2e, 0x63, 0x66, 0x6d, 0x2e, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x63, 0x68, 0x65, 0x63, - 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3d, 0x0a, 0x0a, 0x55, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x12, 0x16, 0x2e, 0x63, 0x66, 0x6d, 0x2e, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x17, 0x2e, 0x63, 0x66, 0x6d, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, 0x0b, 0x52, 0x65, 0x6a, 0x65, - 0x63, 0x74, 0x65, 0x64, 0x4a, 0x6f, 0x62, 0x12, 0x17, 0x2e, 0x63, 0x66, 0x6d, 0x2e, 0x52, 0x65, - 0x6a, 0x65, 0x63, 0x74, 0x65, 0x64, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x18, 0x2e, 0x63, 0x66, 0x6d, 0x2e, 0x52, 0x65, 0x6a, 0x65, 0x63, 0x74, 0x65, 0x64, 0x4a, - 0x6f, 0x62, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x43, 0x0a, 0x0c, 0x43, 0x61, - 0x6e, 0x63, 0x65, 0x6c, 0x6c, 0x65, 0x64, 0x4a, 0x6f, 0x62, 0x12, 0x18, 0x2e, 0x63, 0x66, 0x6d, - 0x2e, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x6c, 0x65, 0x64, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x63, 0x66, 0x6d, 0x2e, 0x43, 0x61, 0x6e, 0x63, 0x65, - 0x6c, 0x6c, 0x65, 0x64, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, - 0xc4, 0x01, 0x0a, 0x0b, 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, - 0x3d, 0x0a, 0x0a, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x4a, 0x6f, 0x62, 0x12, 0x16, 0x2e, + 0x6b, 0x0a, 0x09, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, 0x16, + 0x43, 0x48, 0x41, 0x49, 0x4e, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, + 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x12, 0x0a, 0x0e, 0x43, 0x48, 0x41, 0x49, + 0x4e, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x45, 0x56, 0x4d, 0x10, 0x01, 0x12, 0x15, 0x0a, 0x11, + 0x43, 0x48, 0x41, 0x49, 0x4e, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x53, 0x4f, 0x4c, 0x41, 0x4e, + 0x41, 0x10, 0x02, 0x12, 0x17, 0x0a, 0x13, 0x43, 0x48, 0x41, 0x49, 0x4e, 0x5f, 0x54, 0x59, 0x50, + 0x45, 0x5f, 0x53, 0x54, 0x41, 0x52, 0x4b, 0x4e, 0x45, 0x54, 0x10, 0x03, 0x32, 0xd8, 0x02, 0x0a, + 0x0c, 0x46, 0x65, 0x65, 0x64, 0x73, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x12, 0x40, 0x0a, + 0x0b, 0x41, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x64, 0x4a, 0x6f, 0x62, 0x12, 0x17, 0x2e, 0x63, + 0x66, 0x6d, 0x2e, 0x41, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x64, 0x4a, 0x6f, 0x62, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x63, 0x66, 0x6d, 0x2e, 0x41, 0x70, 0x70, 0x72, + 0x6f, 0x76, 0x65, 0x64, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x40, 0x0a, 0x0b, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x12, 0x17, + 0x2e, 0x63, 0x66, 0x6d, 0x2e, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x63, 0x68, 0x65, 0x63, 0x6b, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x63, 0x66, 0x6d, 0x2e, 0x48, 0x65, + 0x61, 0x6c, 0x74, 0x68, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x3d, 0x0a, 0x0a, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x12, + 0x16, 0x2e, 0x63, 0x66, 0x6d, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x63, 0x66, 0x6d, 0x2e, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x40, 0x0a, 0x0b, 0x52, 0x65, 0x6a, 0x65, 0x63, 0x74, 0x65, 0x64, 0x4a, 0x6f, 0x62, 0x12, + 0x17, 0x2e, 0x63, 0x66, 0x6d, 0x2e, 0x52, 0x65, 0x6a, 0x65, 0x63, 0x74, 0x65, 0x64, 0x4a, 0x6f, + 0x62, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x63, 0x66, 0x6d, 0x2e, 0x52, + 0x65, 0x6a, 0x65, 0x63, 0x74, 0x65, 0x64, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x43, 0x0a, 0x0c, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x6c, 0x65, 0x64, 0x4a, + 0x6f, 0x62, 0x12, 0x18, 0x2e, 0x63, 0x66, 0x6d, 0x2e, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x6c, + 0x65, 0x64, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x63, + 0x66, 0x6d, 0x2e, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x6c, 0x65, 0x64, 0x4a, 0x6f, 0x62, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xc4, 0x01, 0x0a, 0x0b, 0x4e, 0x6f, 0x64, 0x65, + 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x3d, 0x0a, 0x0a, 0x50, 0x72, 0x6f, 0x70, 0x6f, + 0x73, 0x65, 0x4a, 0x6f, 0x62, 0x12, 0x16, 0x2e, 0x63, 0x66, 0x6d, 0x2e, 0x50, 0x72, 0x6f, 0x70, + 0x6f, 0x73, 0x65, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x63, 0x66, 0x6d, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x4a, 0x6f, 0x62, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x63, 0x66, 0x6d, 0x2e, 0x50, 0x72, 0x6f, 0x70, - 0x6f, 0x73, 0x65, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3a, - 0x0a, 0x09, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4a, 0x6f, 0x62, 0x12, 0x15, 0x2e, 0x63, 0x66, - 0x6d, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x63, 0x66, 0x6d, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4a, - 0x6f, 0x62, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3a, 0x0a, 0x09, 0x52, 0x65, - 0x76, 0x6f, 0x6b, 0x65, 0x4a, 0x6f, 0x62, 0x12, 0x15, 0x2e, 0x63, 0x66, 0x6d, 0x2e, 0x52, 0x65, - 0x76, 0x6f, 0x6b, 0x65, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, - 0x2e, 0x63, 0x66, 0x6d, 0x2e, 0x52, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x4a, 0x6f, 0x62, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x3d, 0x5a, 0x3b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, - 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x6d, 0x61, 0x72, 0x74, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, - 0x63, 0x74, 0x6b, 0x69, 0x74, 0x2f, 0x66, 0x65, 0x65, 0x64, 0x73, 0x2d, 0x6d, 0x61, 0x6e, 0x61, - 0x67, 0x65, 0x72, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x6e, 0x6f, 0x64, 0x65, 0x72, 0x70, 0x63, 0x2f, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3a, 0x0a, 0x09, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, + 0x4a, 0x6f, 0x62, 0x12, 0x15, 0x2e, 0x63, 0x66, 0x6d, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, + 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x63, 0x66, 0x6d, + 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x3a, 0x0a, 0x09, 0x52, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x4a, 0x6f, 0x62, 0x12, + 0x15, 0x2e, 0x63, 0x66, 0x6d, 0x2e, 0x52, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x4a, 0x6f, 0x62, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x63, 0x66, 0x6d, 0x2e, 0x52, 0x65, 0x76, + 0x6f, 0x6b, 0x65, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x3d, + 0x5a, 0x3b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x6d, 0x61, + 0x72, 0x74, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x6b, 0x69, 0x74, 0x2f, 0x66, 0x65, + 0x65, 0x64, 0x73, 0x2d, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2f, 0x70, 0x6b, 0x67, 0x2f, + 0x6e, 0x6f, 0x64, 0x65, 0x72, 0x70, 0x63, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/core/services/feeds/proto/feeds_manager_wsrpc.pb.go b/core/services/feeds/proto/feeds_manager_wsrpc.pb.go index a002257e5cb..85476b11881 100644 --- a/core/services/feeds/proto/feeds_manager_wsrpc.pb.go +++ b/core/services/feeds/proto/feeds_manager_wsrpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-wsrpc. DO NOT EDIT. // versions: // - protoc-gen-go-wsrpc v0.0.1 -// - protoc v3.21.7 +// - protoc v4.25.3 package proto diff --git a/core/services/feeds/service.go b/core/services/feeds/service.go index a58137eb11b..d5c8c1ba22e 100644 --- a/core/services/feeds/service.go +++ b/core/services/feeds/service.go @@ -17,6 +17,8 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/services" "github.com/smartcontractkit/chainlink-common/pkg/sqlutil" + + ccip "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/validate" "github.com/smartcontractkit/chainlink/v2/plugins" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" @@ -36,15 +38,14 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/utils/crypto" ) -//go:generate mockery --quiet --name Service --output ./mocks/ --case=underscore -//go:generate mockery --quiet --dir ./proto --name FeedsManagerClient --output ./mocks/ --case=underscore - var ( - ErrOCR2Disabled = errors.New("ocr2 is disabled") - ErrOCRDisabled = errors.New("ocr is disabled") - ErrSingleFeedsManager = errors.New("only a single feeds manager is supported") - ErrJobAlreadyExists = errors.New("a job for this contract address already exists - please use the 'force' option to replace it") - ErrFeedsManagerDisabled = errors.New("feeds manager is disabled") + ErrOCR2Disabled = errors.New("ocr2 is disabled") + ErrOCRDisabled = errors.New("ocr is disabled") + // TODO: delete once multiple feeds managers support is released + ErrSingleFeedsManager = errors.New("only a single feeds manager is supported") + ErrDuplicateFeedsManager = errors.New("manager was previously registered using the same public key") + ErrJobAlreadyExists = errors.New("a job for this contract address already exists - please use the 'force' option to replace it") + ErrFeedsManagerDisabled = errors.New("feeds manager is disabled") promJobProposalRequest = promauto.NewCounter(prometheus.CounterOpts{ Name: "feeds_job_proposal_requests", @@ -80,7 +81,6 @@ type Service interface { Start(ctx context.Context) error Close() error - CountManagers(ctx context.Context) (int64, error) GetManager(ctx context.Context, id int64) (*FeedsManager, error) ListManagers(ctx context.Context) ([]FeedsManager, error) ListManagersByIDs(ctx context.Context, ids []int64) ([]FeedsManager, error) @@ -101,7 +101,6 @@ type Service interface { CountJobProposalsByStatus(ctx context.Context) (*JobProposalCounts, error) GetJobProposal(ctx context.Context, id int64) (*JobProposal, error) - ListJobProposals(ctx context.Context) ([]JobProposal, error) ListJobProposalsByManagersIDs(ctx context.Context, ids []int64) ([]JobProposal, error) ApproveSpec(ctx context.Context, id int64, force bool) error @@ -110,6 +109,9 @@ type Service interface { ListSpecsByJobProposalIDs(ctx context.Context, ids []int64) ([]JobProposalSpec, error) RejectSpec(ctx context.Context, id int64) error UpdateSpecDefinition(ctx context.Context, id int64, spec string) error + + // Unsafe_SetConnectionsManager Only for testing + Unsafe_SetConnectionsManager(ConnectionsManager) } type service struct { @@ -124,6 +126,7 @@ type service struct { ocr2KeyStore keystore.OCR2 jobSpawner job.Spawner gCfg GeneralConfig + featCfg FeatureConfig insecureCfg InsecureConfig jobCfg JobConfig ocrCfg OCRConfig @@ -143,6 +146,7 @@ func NewService( jobSpawner job.Spawner, keyStore keystore.Master, gCfg GeneralConfig, + fCfg FeatureConfig, insecureCfg InsecureConfig, jobCfg JobConfig, ocrCfg OCRConfig, @@ -163,6 +167,7 @@ func NewService( ocr1KeyStore: keyStore.OCR(), ocr2KeyStore: keyStore.OCR2(), gCfg: gCfg, + featCfg: fCfg, insecureCfg: insecureCfg, jobCfg: jobCfg, ocrCfg: ocrCfg, @@ -186,15 +191,23 @@ type RegisterManagerParams struct { // RegisterManager registers a new ManagerService and attempts to establish a // connection. -// -// Only a single feeds manager is currently supported. func (s *service) RegisterManager(ctx context.Context, params RegisterManagerParams) (int64, error) { - count, err := s.CountManagers(ctx) - if err != nil { - return 0, err - } - if count >= 1 { - return 0, ErrSingleFeedsManager + if s.featCfg.MultiFeedsManagers() { + exists, err := s.orm.ManagerExists(ctx, params.PublicKey) + if err != nil { + return 0, err + } + if exists { + return 0, ErrDuplicateFeedsManager + } + } else { + count, err := s.CountManagers(ctx) + if err != nil { + return 0, err + } + if count >= 1 { + return 0, ErrSingleFeedsManager + } } mgr := FeedsManager{ @@ -205,11 +218,11 @@ func (s *service) RegisterManager(ctx context.Context, params RegisterManagerPar var id int64 - err = s.orm.Transact(ctx, func(tx ORM) error { + err := s.orm.Transact(ctx, func(tx ORM) error { var txerr error id, txerr = tx.CreateManager(ctx, &mgr) - if err != nil { + if txerr != nil { return txerr } @@ -219,6 +232,9 @@ func (s *service) RegisterManager(ctx context.Context, params RegisterManagerPar return nil }) + if err != nil { + return 0, err + } privkey, err := s.getCSAPrivateKey() if err != nil { @@ -322,6 +338,7 @@ func (s *service) ListManagersByIDs(ctx context.Context, ids []int64) ([]FeedsMa } // CountManagers gets the total number of manager services +// TODO: delete once multiple feeds managers support is released func (s *service) CountManagers(ctx context.Context) (int64, error) { return s.orm.CountManagers(ctx) } @@ -418,14 +435,6 @@ func (s *service) UpdateChainConfig(ctx context.Context, cfg ChainConfig) (int64 return id, nil } -// Lists all JobProposals -// -// When we support multiple feed managers, we will need to change this to filter -// by feeds manager -func (s *service) ListJobProposals(ctx context.Context) ([]JobProposal, error) { - return s.orm.ListJobProposals(ctx) -} - // ListJobProposalsByManagersIDs gets job proposals by feeds managers IDs func (s *service) ListJobProposalsByManagersIDs(ctx context.Context, ids []int64) ([]JobProposal, error) { return s.orm.ListJobProposalsByManagersIDs(ctx, ids) @@ -811,6 +820,13 @@ func (s *service) ApproveSpec(ctx context.Context, id int64, force bool) error { return fmt.Errorf("failed while checking for existing workflow job: %w", txerr) } } + case job.CCIP: + existingJobID, txerr = tx.jobORM.FindJobIDByCapabilityNameAndVersion(ctx, *j.CCIPSpec) + // Return an error if the repository errors. If there is a not found + // error we want to continue with approving the job. + if txerr != nil && !errors.Is(txerr, sql.ErrNoRows) { + return fmt.Errorf("failed while checking for existing ccip job: %w", txerr) + } default: return errors.Errorf("unsupported job type when approving job proposal specs: %s", j.Type) } @@ -1020,7 +1036,6 @@ func (s *service) Start(ctx context.Context) error { return err } - // We only support a single feeds manager right now mgrs, err := s.ListManagers(ctx) if err != nil { return err @@ -1031,8 +1046,14 @@ func (s *service) Start(ctx context.Context) error { return nil } - mgr := mgrs[0] - s.connectFeedManager(ctx, mgr, privkey) + if s.featCfg.MultiFeedsManagers() { + s.lggr.Infof("starting connection to %d feeds managers", len(mgrs)) + for _, mgr := range mgrs { + s.connectFeedManager(ctx, mgr, privkey) + } + } else { + s.connectFeedManager(ctx, mgrs[0], privkey) + } if err = s.observeJobProposalCounts(ctx); err != nil { s.lggr.Error("failed to observe job proposal count when starting service", err) @@ -1108,6 +1129,16 @@ func (s *service) observeJobProposalCounts(ctx context.Context) error { return nil } +// Unsafe_SetConnectionsManager sets the ConnectionsManager on the service. +// +// We need to be able to inject a mock for the client to facilitate integration +// tests. +// +// ONLY TO BE USED FOR TESTING. +func (s *service) Unsafe_SetConnectionsManager(connMgr ConnectionsManager) { + s.connMgr = connMgr +} + // findExistingJobForOCR2 looks for existing job for OCR2 func findExistingJobForOCR2(ctx context.Context, j *job.Job, tx job.ORM) (int32, error) { var contractID string @@ -1179,7 +1210,9 @@ func (s *service) generateJob(ctx context.Context, spec string) (*job.Job, error case job.FluxMonitor: js, err = fluxmonitorv2.ValidatedFluxMonitorSpec(s.jobCfg, spec) case job.Workflow: - js, err = workflows.ValidatedWorkflowJobSpec(spec) + js, err = workflows.ValidatedWorkflowJobSpec(ctx, spec) + case job.CCIP: + js, err = ccip.ValidatedCCIPSpec(spec) default: return nil, errors.Errorf("unknown job type: %s", jobType) } @@ -1437,7 +1470,6 @@ func (ns NullService) Close() error { return nil } func (ns NullService) ApproveSpec(ctx context.Context, id int64, force bool) error { return ErrFeedsManagerDisabled } -func (ns NullService) CountManagers(ctx context.Context) (int64, error) { return 0, nil } func (ns NullService) CountJobProposalsByStatus(ctx context.Context) (*JobProposalCounts, error) { return nil, ErrFeedsManagerDisabled } @@ -1504,5 +1536,6 @@ func (ns NullService) IsJobManaged(ctx context.Context, jobID int64) (bool, erro func (ns NullService) UpdateSpecDefinition(ctx context.Context, id int64, spec string) error { return ErrFeedsManagerDisabled } +func (ns NullService) Unsafe_SetConnectionsManager(_ ConnectionsManager) {} //revive:enable diff --git a/core/services/feeds/service_test.go b/core/services/feeds/service_test.go index 3ee7adc0d70..9098d439eb2 100644 --- a/core/services/feeds/service_test.go +++ b/core/services/feeds/service_test.go @@ -194,7 +194,7 @@ func setupTestServiceCfg(t *testing.T, overrideCfg func(c *chainlink.Config, s * keyStore.On("P2P").Return(p2pKeystore) keyStore.On("OCR").Return(ocr1Keystore) keyStore.On("OCR2").Return(ocr2Keystore) - svc := feeds.NewService(orm, jobORM, db, spawner, keyStore, gcfg, gcfg.Insecure(), gcfg.JobPipeline(), gcfg.OCR(), gcfg.OCR2(), legacyChains, lggr, "1.0.0", nil) + svc := feeds.NewService(orm, jobORM, db, spawner, keyStore, gcfg, gcfg.Feature(), gcfg.Insecure(), gcfg.JobPipeline(), gcfg.OCR(), gcfg.OCR2(), legacyChains, lggr, "1.0.0", nil) svc.SetConnectionsManager(connMgr) return &TestService{ @@ -265,6 +265,149 @@ func Test_Service_RegisterManager(t *testing.T) { assert.Equal(t, actual, id) } +func Test_Service_RegisterManager_MultiFeedsManager(t *testing.T) { + t.Parallel() + + key := cltest.DefaultCSAKey + + var ( + id = int64(1) + pubKeyHex = "0f17c3bf72de8beef6e2d17a14c0a972f5d7e0e66e70722373f12b88382d40f9" + ) + + var pubKey crypto.PublicKey + _, err := hex.Decode([]byte(pubKeyHex), pubKey) + require.NoError(t, err) + + var ( + mgr = feeds.FeedsManager{ + Name: "FMS", + URI: "localhost:8080", + PublicKey: pubKey, + } + params = feeds.RegisterManagerParams{ + Name: "FMS", + URI: "localhost:8080", + PublicKey: pubKey, + } + ) + + svc := setupTestServiceCfg(t, func(c *chainlink.Config, s *chainlink.Secrets) { + var multiFeedsManagers = true + c.Feature.MultiFeedsManagers = &multiFeedsManagers + }) + ctx := testutils.Context(t) + + svc.orm.On("ManagerExists", ctx, params.PublicKey).Return(false, nil) + svc.orm.On("CreateManager", mock.Anything, &mgr, mock.Anything). + Return(id, nil) + svc.orm.On("CreateBatchChainConfig", mock.Anything, params.ChainConfigs, mock.Anything). + Return([]int64{}, nil) + svc.csaKeystore.On("GetAll").Return([]csakey.KeyV2{key}, nil) + // ListManagers runs in a goroutine so it might be called. + svc.orm.On("ListManagers", ctx).Return([]feeds.FeedsManager{mgr}, nil).Maybe() + transactCall := svc.orm.On("Transact", mock.Anything, mock.Anything) + transactCall.Run(func(args mock.Arguments) { + fn := args[1].(func(orm feeds.ORM) error) + transactCall.ReturnArguments = mock.Arguments{fn(svc.orm)} + }) + svc.connMgr.On("Connect", mock.IsType(feeds.ConnectOpts{})) + + actual, err := svc.RegisterManager(ctx, params) + // We need to stop the service because the manager will attempt to make a + // connection + svc.Close() + require.NoError(t, err) + + assert.Equal(t, actual, id) +} + +func Test_Service_RegisterManager_InvalidCreateManager(t *testing.T) { + t.Parallel() + + var ( + id = int64(1) + pubKeyHex = "0f17c3bf72de8beef6e2d17a14c0a972f5d7e0e66e70722373f12b88382d40f9" + ) + + var pubKey crypto.PublicKey + _, err := hex.Decode([]byte(pubKeyHex), pubKey) + require.NoError(t, err) + + var ( + mgr = feeds.FeedsManager{ + Name: "FMS", + URI: "localhost:8080", + PublicKey: pubKey, + } + params = feeds.RegisterManagerParams{ + Name: "FMS", + URI: "localhost:8080", + PublicKey: pubKey, + } + ) + + svc := setupTestService(t) + + svc.orm.On("CountManagers", mock.Anything).Return(int64(0), nil) + svc.orm.On("CreateManager", mock.Anything, &mgr, mock.Anything). + Return(id, errors.New("orm error")) + // ListManagers runs in a goroutine so it might be called. + svc.orm.On("ListManagers", testutils.Context(t)).Return([]feeds.FeedsManager{mgr}, nil).Maybe() + + transactCall := svc.orm.On("Transact", mock.Anything, mock.Anything) + transactCall.Run(func(args mock.Arguments) { + fn := args[1].(func(orm feeds.ORM) error) + transactCall.ReturnArguments = mock.Arguments{fn(svc.orm)} + }) + _, err = svc.RegisterManager(testutils.Context(t), params) + // We need to stop the service because the manager will attempt to make a + // connection + svc.Close() + require.Error(t, err) + assert.Equal(t, "orm error", err.Error()) +} + +func Test_Service_RegisterManager_DuplicateFeedsManager(t *testing.T) { + t.Parallel() + + var pubKeyHex = "0f17c3bf72de8beef6e2d17a14c0a972f5d7e0e66e70722373f12b88382d40f9" + var pubKey crypto.PublicKey + _, err := hex.Decode([]byte(pubKeyHex), pubKey) + require.NoError(t, err) + + var ( + mgr = feeds.FeedsManager{ + Name: "FMS", + URI: "localhost:8080", + PublicKey: pubKey, + } + params = feeds.RegisterManagerParams{ + Name: "FMS", + URI: "localhost:8080", + PublicKey: pubKey, + } + ) + + svc := setupTestServiceCfg(t, func(c *chainlink.Config, s *chainlink.Secrets) { + var multiFeedsManagers = true + c.Feature.MultiFeedsManagers = &multiFeedsManagers + }) + ctx := testutils.Context(t) + + svc.orm.On("ManagerExists", ctx, params.PublicKey).Return(true, nil) + // ListManagers runs in a goroutine so it might be called. + svc.orm.On("ListManagers", ctx).Return([]feeds.FeedsManager{mgr}, nil).Maybe() + + _, err = svc.RegisterManager(ctx, params) + // We need to stop the service because the manager will attempt to make a + // connection + svc.Close() + require.Error(t, err) + + assert.Equal(t, "manager was previously registered using the same public key", err.Error()) +} + func Test_Service_ListManagers(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -342,24 +485,6 @@ func Test_Service_ListManagersByIDs(t *testing.T) { assert.Equal(t, mgrs, actual) } -func Test_Service_CountManagers(t *testing.T) { - t.Parallel() - ctx := testutils.Context(t) - - var ( - count = int64(1) - ) - svc := setupTestService(t) - - svc.orm.On("CountManagers", mock.Anything). - Return(count, nil) - - actual, err := svc.CountManagers(ctx) - require.NoError(t, err) - - assert.Equal(t, count, actual) -} - func Test_Service_CreateChainConfig(t *testing.T) { var ( mgr = feeds.FeedsManager{ID: 1} @@ -1481,25 +1606,6 @@ func Test_Service_IsJobManaged(t *testing.T) { assert.True(t, isManaged) } -func Test_Service_ListJobProposals(t *testing.T) { - t.Parallel() - ctx := testutils.Context(t) - - var ( - jp = feeds.JobProposal{} - jps = []feeds.JobProposal{jp} - ) - svc := setupTestService(t) - - svc.orm.On("ListJobProposals", mock.Anything). - Return(jps, nil) - - actual, err := svc.ListJobProposals(ctx) - require.NoError(t, err) - - assert.Equal(t, actual, jps) -} - func Test_Service_ListJobProposalsByManagersIDs(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -3805,6 +3911,10 @@ func Test_Service_StartStop(t *testing.T) { ID: 1, URI: "localhost:2000", } + mgr2 = feeds.FeedsManager{ + ID: 2, + URI: "localhost:2001", + } pubKeyHex = "0f17c3bf72de8beef6e2d17a14c0a972f5d7e0e66e70722373f12b88382d40f9" ) @@ -3813,8 +3923,9 @@ func Test_Service_StartStop(t *testing.T) { require.NoError(t, err) tests := []struct { - name string - beforeFunc func(svc *TestService) + name string + enableMultiFeedsManagers bool + beforeFunc func(svc *TestService) }{ { name: "success with a feeds manager connection", @@ -3827,6 +3938,19 @@ func Test_Service_StartStop(t *testing.T) { svc.orm.On("CountJobProposalsByStatus", mock.Anything).Return(&feeds.JobProposalCounts{}, nil) }, }, + { + name: "success with multiple feeds managers connection", + enableMultiFeedsManagers: true, + beforeFunc: func(svc *TestService) { + svc.csaKeystore.On("GetAll").Return([]csakey.KeyV2{key}, nil) + svc.orm.On("ListManagers", mock.Anything).Return([]feeds.FeedsManager{mgr, mgr2}, nil) + svc.connMgr.On("IsConnected", mgr.ID).Return(false) + svc.connMgr.On("IsConnected", mgr2.ID).Return(false) + svc.connMgr.On("Connect", mock.IsType(feeds.ConnectOpts{})).Twice() + svc.connMgr.On("Close") + svc.orm.On("CountJobProposalsByStatus", mock.Anything).Return(&feeds.JobProposalCounts{}, nil) + }, + }, { name: "success with no registered managers", beforeFunc: func(svc *TestService) { @@ -3843,7 +3967,9 @@ func Test_Service_StartStop(t *testing.T) { t.Run(tt.name, func(t *testing.T) { t.Parallel() - svc := setupTestService(t) + svc := setupTestServiceCfg(t, func(c *chainlink.Config, s *chainlink.Secrets) { + c.Feature.MultiFeedsManagers = &tt.enableMultiFeedsManagers + }) if tt.beforeFunc != nil { tt.beforeFunc(svc) diff --git a/core/services/fluxmonitorv2/contract_submitter.go b/core/services/fluxmonitorv2/contract_submitter.go index c8d98a1a2f2..bd7aad005db 100644 --- a/core/services/fluxmonitorv2/contract_submitter.go +++ b/core/services/fluxmonitorv2/contract_submitter.go @@ -10,8 +10,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/flux_aggregator_wrapper" ) -//go:generate mockery --quiet --name ContractSubmitter --output ./mocks/ --case=underscore - // FluxAggregatorABI initializes the Flux Aggregator ABI var FluxAggregatorABI = evmtypes.MustGetABI(flux_aggregator_wrapper.FluxAggregatorABI) diff --git a/core/services/fluxmonitorv2/deviation_checker.go b/core/services/fluxmonitorv2/deviation_checker.go index 51e85de371e..9dc399b09f9 100644 --- a/core/services/fluxmonitorv2/deviation_checker.go +++ b/core/services/fluxmonitorv2/deviation_checker.go @@ -3,7 +3,7 @@ package fluxmonitorv2 import ( "github.com/shopspring/decimal" - "github.com/smartcontractkit/chainlink/v2/core/logger" + "github.com/smartcontractkit/chainlink-common/pkg/logger" ) // DeviationThresholds carries parameters used by the threshold-trigger logic @@ -26,7 +26,7 @@ func NewDeviationChecker(rel, abs float64, lggr logger.Logger) *DeviationChecker Rel: rel, Abs: abs, }, - lggr: lggr.Named("DeviationChecker").With("threshold", rel, "absoluteThreshold", abs), + lggr: logger.Sugared(lggr).Named("DeviationChecker").With("threshold", rel, "absoluteThreshold", abs), } } diff --git a/core/services/fluxmonitorv2/flags.go b/core/services/fluxmonitorv2/flags.go index c50a767ae1c..a02b818674a 100644 --- a/core/services/fluxmonitorv2/flags.go +++ b/core/services/fluxmonitorv2/flags.go @@ -12,8 +12,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/flags_wrapper" ) -//go:generate mockery --quiet --name Flags --output ./mocks/ --case=underscore --structname Flags --filename flags.go - type Flags interface { ContractExists() bool IsLowered(contractAddr common.Address) (bool, error) diff --git a/core/services/fluxmonitorv2/flux_monitor.go b/core/services/fluxmonitorv2/flux_monitor.go index 31db95f2626..b8154ab6797 100644 --- a/core/services/fluxmonitorv2/flux_monitor.go +++ b/core/services/fluxmonitorv2/flux_monitor.go @@ -13,6 +13,7 @@ import ( "github.com/pkg/errors" "github.com/shopspring/decimal" + "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink-common/pkg/services" "github.com/smartcontractkit/chainlink-common/pkg/sqlutil" @@ -22,7 +23,6 @@ import ( evmutils "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/flags_wrapper" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/flux_aggregator_wrapper" - "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/recovery" "github.com/smartcontractkit/chainlink/v2/core/services/fluxmonitorv2/promfm" "github.com/smartcontractkit/chainlink/v2/core/services/job" @@ -56,7 +56,10 @@ const DefaultHibernationPollPeriod = 24 * time.Hour // FluxMonitor polls external price adapters via HTTP to check for price swings. type FluxMonitor struct { - services.StateMachine + services.Service + eng *services.Engine + logger logger.SugaredLogger + contractAddress common.Address oracleAddress common.Address jobSpec job.Job @@ -77,13 +80,8 @@ type FluxMonitor struct { logBroadcaster log.Broadcaster chainID *big.Int - logger logger.SugaredLogger - backlog *utils.BoundedPriorityQueue[log.Broadcast] chProcessLogs chan struct{} - - chStop services.StopChan - waitOnStop chan struct{} } // NewFluxMonitor returns a new instance of PollingDeviationChecker. @@ -105,7 +103,7 @@ func NewFluxMonitor( flags Flags, fluxAggregator flux_aggregator_wrapper.FluxAggregatorInterface, logBroadcaster log.Broadcaster, - fmLogger logger.Logger, + lggr logger.Logger, chainID *big.Int, ) (*FluxMonitor, error) { fm := &FluxMonitor{ @@ -126,7 +124,6 @@ func NewFluxMonitor( flags: flags, logBroadcaster: logBroadcaster, fluxAggregator: fluxAggregator, - logger: logger.Sugared(fmLogger), chainID: chainID, backlog: utils.NewBoundedPriorityQueue[log.Broadcast](map[uint]int{ // We want reconnecting nodes to be able to submit to a round @@ -136,9 +133,13 @@ func NewFluxMonitor( PriorityFlagChangedLog: 2, }), chProcessLogs: make(chan struct{}, 1), - chStop: make(services.StopChan), - waitOnStop: make(chan struct{}), } + fm.Service, fm.eng = services.Config{ + Name: "FluxMonitor", + Start: fm.start, + Close: fm.close, + }.NewServiceEngine(lggr) + fm.logger = logger.Sugared(fm.eng) return fm, nil } @@ -220,7 +221,7 @@ func NewFromJobSpec( return nil, err } - fmLogger := lggr.With( + fmLogger := logger.With(lggr, "jobID", jobSpec.ID, "contract", fmSpec.ContractAddress.Hex(), ) @@ -279,14 +280,9 @@ const ( // Start implements the job.Service interface. It begins the CSP consumer in a // single goroutine to poll the price adapters and listen to NewRound events. -func (fm *FluxMonitor) Start(context.Context) error { - return fm.StartOnce("FluxMonitor", func() error { - fm.logger.Debug("Starting Flux Monitor for job") - - go fm.consume() - - return nil - }) +func (fm *FluxMonitor) start(context.Context) error { + fm.eng.Go(fm.consume) + return nil } func (fm *FluxMonitor) IsHibernating() bool { @@ -304,16 +300,12 @@ func (fm *FluxMonitor) IsHibernating() bool { return !isFlagLowered } -// Close implements the job.Service interface. It stops this instance from +// close stops this instance from // polling, cleaning up resources. -func (fm *FluxMonitor) Close() error { - return fm.StopOnce("FluxMonitor", func() error { - fm.pollManager.Stop() - close(fm.chStop) - <-fm.waitOnStop +func (fm *FluxMonitor) close() error { + fm.pollManager.Stop() - return nil - }) + return nil } // JobID implements the listener.Listener interface. @@ -354,10 +346,8 @@ func (fm *FluxMonitor) HandleLog(ctx context.Context, broadcast log.Broadcast) { } } -func (fm *FluxMonitor) consume() { - defer close(fm.waitOnStop) - - if err := fm.SetOracleAddress(); err != nil { +func (fm *FluxMonitor) consume(ctx context.Context) { + if err := fm.SetOracleAddress(ctx); err != nil { fm.logger.Warnw( "unable to set oracle address, this flux monitor job may not work correctly", "err", err, @@ -398,46 +388,46 @@ func (fm *FluxMonitor) consume() { for { select { - case <-fm.chStop: + case <-ctx.Done(): return case <-fm.chProcessLogs: - recovery.WrapRecover(fm.logger, fm.processLogs) + recovery.WrapRecover(fm.logger, func() { fm.processLogs(ctx) }) case at := <-fm.pollManager.PollTickerTicks(): tickLogger.Debugf("Poll ticker fired on %v", formatTime(at)) recovery.WrapRecover(fm.logger, func() { - fm.pollIfEligible(PollRequestTypePoll, fm.deviationChecker, nil) + fm.pollIfEligible(ctx, PollRequestTypePoll, fm.deviationChecker, nil) }) case at := <-fm.pollManager.IdleTimerTicks(): tickLogger.Debugf("Idle timer fired on %v", formatTime(at)) recovery.WrapRecover(fm.logger, func() { - fm.pollIfEligible(PollRequestTypeIdle, NewZeroDeviationChecker(fm.logger), nil) + fm.pollIfEligible(ctx, PollRequestTypeIdle, NewZeroDeviationChecker(fm.logger), nil) }) case at := <-fm.pollManager.RoundTimerTicks(): tickLogger.Debugf("Round timer fired on %v", formatTime(at)) recovery.WrapRecover(fm.logger, func() { - fm.pollIfEligible(PollRequestTypeRound, fm.deviationChecker, nil) + fm.pollIfEligible(ctx, PollRequestTypeRound, fm.deviationChecker, nil) }) case at := <-fm.pollManager.HibernationTimerTicks(): tickLogger.Debugf("Hibernation timer fired on %v", formatTime(at)) recovery.WrapRecover(fm.logger, func() { - fm.pollIfEligible(PollRequestTypeHibernation, NewZeroDeviationChecker(fm.logger), nil) + fm.pollIfEligible(ctx, PollRequestTypeHibernation, NewZeroDeviationChecker(fm.logger), nil) }) case at := <-fm.pollManager.RetryTickerTicks(): tickLogger.Debugf("Retry ticker fired on %v", formatTime(at)) recovery.WrapRecover(fm.logger, func() { - fm.pollIfEligible(PollRequestTypeRetry, NewZeroDeviationChecker(fm.logger), nil) + fm.pollIfEligible(ctx, PollRequestTypeRetry, NewZeroDeviationChecker(fm.logger), nil) }) case at := <-fm.pollManager.DrumbeatTicks(): tickLogger.Debugf("Drumbeat ticker fired on %v", formatTime(at)) recovery.WrapRecover(fm.logger, func() { - fm.pollIfEligible(PollRequestTypeDrumbeat, NewZeroDeviationChecker(fm.logger), nil) + fm.pollIfEligible(ctx, PollRequestTypeDrumbeat, NewZeroDeviationChecker(fm.logger), nil) }) case request := <-fm.pollManager.Poll(): @@ -446,7 +436,7 @@ func (fm *FluxMonitor) consume() { break default: recovery.WrapRecover(fm.logger, func() { - fm.pollIfEligible(request.Type, fm.deviationChecker, nil) + fm.pollIfEligible(ctx, request.Type, fm.deviationChecker, nil) }) } } @@ -460,11 +450,7 @@ func formatTime(at time.Time) string { // SetOracleAddress sets the oracle address which matches the node's keys. // If none match, it uses the first available key -func (fm *FluxMonitor) SetOracleAddress() error { - // fm on deprecation path, using dangling context - ctx, cancel := fm.chStop.NewCtx() - defer cancel() - +func (fm *FluxMonitor) SetOracleAddress(ctx context.Context) error { oracleAddrs, err := fm.fluxAggregator.GetOracles(nil) if err != nil { fm.logger.Error("failed to get list of oracles from FluxAggregator contract") @@ -502,10 +488,7 @@ func (fm *FluxMonitor) SetOracleAddress() error { return errors.New("No keys found") } -func (fm *FluxMonitor) processLogs() { - ctx, cancel := fm.chStop.NewCtx() - defer cancel() - +func (fm *FluxMonitor) processLogs(ctx context.Context) { for ctx.Err() == nil && !fm.backlog.Empty() { broadcast := fm.backlog.Take() fm.processBroadcast(ctx, broadcast) @@ -529,7 +512,7 @@ func (fm *FluxMonitor) processBroadcast(ctx context.Context, broadcast log.Broad decodedLog := broadcast.DecodedLog() switch log := decodedLog.(type) { case *flux_aggregator_wrapper.FluxAggregatorNewRound: - fm.respondToNewRoundLog(*log, broadcast) + fm.respondToNewRoundLog(ctx, *log, broadcast) case *flux_aggregator_wrapper.FluxAggregatorAnswerUpdated: fm.respondToAnswerUpdatedLog(*log) fm.markLogAsConsumed(ctx, broadcast, decodedLog, started) @@ -540,7 +523,7 @@ func (fm *FluxMonitor) processBroadcast(ctx context.Context, broadcast log.Broad // Only reactivate if it is hibernating if fm.pollManager.isHibernating.Load() { fm.pollManager.Awaken(fm.initialRoundState()) - fm.pollIfEligible(PollRequestTypeAwaken, NewZeroDeviationChecker(fm.logger), broadcast) + fm.pollIfEligible(ctx, PollRequestTypeAwaken, NewZeroDeviationChecker(fm.logger), broadcast) } default: fm.logger.Errorf("unknown log %v of type %T", log, log) @@ -589,10 +572,8 @@ func (fm *FluxMonitor) respondToAnswerUpdatedLog(log flux_aggregator_wrapper.Flu // The NewRound log tells us that an oracle has initiated a new round. This tells us that we // need to poll and submit an answer to the contract regardless of the deviation. -func (fm *FluxMonitor) respondToNewRoundLog(log flux_aggregator_wrapper.FluxAggregatorNewRound, lb log.Broadcast) { +func (fm *FluxMonitor) respondToNewRoundLog(ctx context.Context, log flux_aggregator_wrapper.FluxAggregatorNewRound, lb log.Broadcast) { started := time.Now() - ctx, cancel := fm.chStop.NewCtx() - defer cancel() newRoundLogger := fm.logger.With( "round", log.RoundId, @@ -749,12 +730,12 @@ func (fm *FluxMonitor) respondToNewRoundLog(log flux_aggregator_wrapper.FluxAggr }) // Call the v2 pipeline to execute a new job run - run, results, err := fm.runner.ExecuteRun(ctx, fm.spec, vars, fm.logger) + run, results, err := fm.runner.ExecuteRun(ctx, fm.spec, vars) if err != nil { newRoundLogger.Errorw(fmt.Sprintf("error executing new run for job ID %v name %v", fm.spec.JobID, fm.spec.JobName), "err", err) return } - result, err := results.FinalResult(newRoundLogger).SingularResult() + result, err := results.FinalResult().SingularResult() if err != nil || result.Error != nil { newRoundLogger.Errorw("can't fetch answer", "err", err, "result", result) fm.jobORM.TryRecordError(ctx, fm.spec.JobID, "Error polling") @@ -819,10 +800,8 @@ func (fm *FluxMonitor) checkEligibilityAndAggregatorFunding(roundState flux_aggr return nil } -func (fm *FluxMonitor) pollIfEligible(pollReq PollRequestType, deviationChecker *DeviationChecker, broadcast log.Broadcast) { +func (fm *FluxMonitor) pollIfEligible(ctx context.Context, pollReq PollRequestType, deviationChecker *DeviationChecker, broadcast log.Broadcast) { started := time.Now() - ctx, cancel := fm.chStop.NewCtx() - defer cancel() l := fm.logger.With( "threshold", deviationChecker.Thresholds.Rel, @@ -956,13 +935,13 @@ func (fm *FluxMonitor) pollIfEligible(pollReq PollRequestType, deviationChecker }, }) - run, results, err := fm.runner.ExecuteRun(ctx, fm.spec, vars, fm.logger) + run, results, err := fm.runner.ExecuteRun(ctx, fm.spec, vars) if err != nil { l.Errorw("can't fetch answer", "err", err) fm.jobORM.TryRecordError(ctx, fm.spec.JobID, "Error polling") return } - result, err := results.FinalResult(l).SingularResult() + result, err := results.FinalResult().SingularResult() if err != nil || result.Error != nil { l.Errorw("can't fetch answer", "err", err, "result", result) fm.jobORM.TryRecordError(ctx, fm.spec.JobID, "Error polling") diff --git a/core/services/fluxmonitorv2/flux_monitor_test.go b/core/services/fluxmonitorv2/flux_monitor_test.go index b3a5bcee6b9..098b1f4a47c 100644 --- a/core/services/fluxmonitorv2/flux_monitor_test.go +++ b/core/services/fluxmonitorv2/flux_monitor_test.go @@ -10,6 +10,7 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/google/uuid" + "github.com/jmoiron/sqlx" "github.com/onsi/gomega" "github.com/pkg/errors" "github.com/shopspring/decimal" @@ -18,18 +19,17 @@ import ( "github.com/stretchr/testify/require" "gopkg.in/guregu/null.v4" - "github.com/jmoiron/sqlx" - "github.com/smartcontractkit/chainlink-common/pkg/assets" "github.com/smartcontractkit/chainlink-common/pkg/services/servicetest" "github.com/smartcontractkit/chainlink-common/pkg/sqlutil" + "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" + txmgrcommon "github.com/smartcontractkit/chainlink/v2/common/txmgr" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/log" logmocks "github.com/smartcontractkit/chainlink/v2/core/chains/evm/log/mocks" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/txmgr" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/flux_aggregator_wrapper" "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" - "github.com/smartcontractkit/chainlink/v2/core/internal/cltest/heavyweight" "github.com/smartcontractkit/chainlink/v2/core/internal/mocks" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/pgtest" @@ -42,6 +42,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ethkey" "github.com/smartcontractkit/chainlink/v2/core/services/pipeline" pipelinemocks "github.com/smartcontractkit/chainlink/v2/core/services/pipeline/mocks" + "github.com/smartcontractkit/chainlink/v2/core/utils/testutils/heavyweight" ) const oracleCount uint8 = 17 @@ -491,7 +492,7 @@ func TestFluxMonitor_PollIfEligible(t *testing.T) { oracles := []common.Address{nodeAddr, testutils.NewAddress()} tm.fluxAggregator.On("GetOracles", nilOpts).Return(oracles, nil) - require.NoError(t, fm.SetOracleAddress()) + require.NoError(t, fm.SetOracleAddress(tests.Context(t))) fm.ExportedPollIfEligible(thresholds.rel, thresholds.abs) }) } @@ -526,7 +527,7 @@ func TestFluxMonitor_PollIfEligible_Creates_JobErr(t *testing.T) { Once() tm.fluxAggregator.On("GetOracles", nilOpts).Return(oracles, nil) - require.NoError(t, fm.SetOracleAddress()) + require.NoError(t, fm.SetOracleAddress(tests.Context(t))) fm.ExportedPollIfEligible(1, 1) } @@ -1171,7 +1172,7 @@ func TestFluxMonitor_RoundTimeoutCausesPoll_timesOutAtZero(t *testing.T) { tm.fluxAggregator.On("Address").Return(common.Address{}) tm.fluxAggregator.On("GetOracles", nilOpts).Return(oracles, nil) - require.NoError(t, fm.SetOracleAddress()) + require.NoError(t, fm.SetOracleAddress(tests.Context(t))) fm.ExportedRoundState(t) servicetest.Run(t, fm) @@ -1506,7 +1507,7 @@ func TestFluxMonitor_DoesNotDoubleSubmit(t *testing.T) { Return(nil) tm.fluxAggregator.On("GetOracles", nilOpts).Return(oracles, nil) - require.NoError(t, fm.SetOracleAddress()) + require.NoError(t, fm.SetOracleAddress(tests.Context(t))) tm.fluxAggregator.On("LatestRoundData", nilOpts).Return(flux_aggregator_wrapper.LatestRoundData{ Answer: big.NewInt(10), @@ -1635,7 +1636,7 @@ func TestFluxMonitor_DoesNotDoubleSubmit(t *testing.T) { Once() tm.fluxAggregator.On("GetOracles", nilOpts).Return(oracles, nil) - require.NoError(t, fm.SetOracleAddress()) + require.NoError(t, fm.SetOracleAddress(tests.Context(t))) fm.ExportedPollIfEligible(0, 0) // Now fire off the NewRound log and ensure it does not respond this time @@ -1732,7 +1733,7 @@ func TestFluxMonitor_DoesNotDoubleSubmit(t *testing.T) { Once() tm.fluxAggregator.On("GetOracles", nilOpts).Return(oracles, nil) - require.NoError(t, fm.SetOracleAddress()) + require.NoError(t, fm.SetOracleAddress(tests.Context(t))) fm.ExportedPollIfEligible(0, 0) // Now fire off the NewRound log and ensure it does not respond this time diff --git a/core/services/fluxmonitorv2/helpers_test.go b/core/services/fluxmonitorv2/helpers_test.go index d321ddc35c3..80db82351c7 100644 --- a/core/services/fluxmonitorv2/helpers_test.go +++ b/core/services/fluxmonitorv2/helpers_test.go @@ -19,11 +19,15 @@ func (fm *FluxMonitor) Format(f fmt.State, verb rune) { } func (fm *FluxMonitor) ExportedPollIfEligible(threshold, absoluteThreshold float64) { - fm.pollIfEligible(PollRequestTypePoll, NewDeviationChecker(threshold, absoluteThreshold, fm.logger), nil) + ctx, cancel := fm.eng.NewCtx() + defer cancel() + fm.pollIfEligible(ctx, PollRequestTypePoll, NewDeviationChecker(threshold, absoluteThreshold, fm.logger), nil) } func (fm *FluxMonitor) ExportedProcessLogs() { - fm.processLogs() + ctx, cancel := fm.eng.NewCtx() + defer cancel() + fm.processLogs(ctx) } func (fm *FluxMonitor) ExportedBacklog() *utils.BoundedPriorityQueue[log.Broadcast] { @@ -36,7 +40,9 @@ func (fm *FluxMonitor) ExportedRoundState(t *testing.T) { } func (fm *FluxMonitor) ExportedRespondToNewRoundLog(log *flux_aggregator_wrapper.FluxAggregatorNewRound, broadcast log.Broadcast) { - fm.respondToNewRoundLog(*log, broadcast) + ctx, cancel := fm.eng.NewCtx() + defer cancel() + fm.respondToNewRoundLog(ctx, *log, broadcast) } func (fm *FluxMonitor) ExportedRespondToFlagsRaisedLog() { diff --git a/core/services/fluxmonitorv2/integrations_test.go b/core/services/fluxmonitorv2/integrations_test.go index 2dacac54281..40bdf71743d 100644 --- a/core/services/fluxmonitorv2/integrations_test.go +++ b/core/services/fluxmonitorv2/integrations_test.go @@ -26,6 +26,7 @@ import ( commonconfig "github.com/smartcontractkit/chainlink-common/pkg/config" "github.com/smartcontractkit/chainlink-common/pkg/sqlutil" + "github.com/smartcontractkit/chainlink/v2/core/bridges" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/log" @@ -35,7 +36,6 @@ import ( faw "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/flux_aggregator_wrapper" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/link_token_interface" "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" - "github.com/smartcontractkit/chainlink/v2/core/internal/cltest/heavyweight" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/evmtest" "github.com/smartcontractkit/chainlink/v2/core/logger" @@ -45,6 +45,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/pipeline" "github.com/smartcontractkit/chainlink/v2/core/store/models" "github.com/smartcontractkit/chainlink/v2/core/utils" + "github.com/smartcontractkit/chainlink/v2/core/utils/testutils/heavyweight" "github.com/smartcontractkit/chainlink/v2/core/web" ) diff --git a/core/services/fluxmonitorv2/key_store.go b/core/services/fluxmonitorv2/key_store.go index 070d392a922..da91024b204 100644 --- a/core/services/fluxmonitorv2/key_store.go +++ b/core/services/fluxmonitorv2/key_store.go @@ -10,8 +10,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ethkey" ) -//go:generate mockery --quiet --name KeyStoreInterface --output ./mocks/ --case=underscore - // KeyStoreInterface defines an interface to interact with the keystore type KeyStoreInterface interface { EnabledKeysForChain(ctx context.Context, chainID *big.Int) ([]ethkey.KeyV2, error) diff --git a/core/services/fluxmonitorv2/mocks/contract_submitter.go b/core/services/fluxmonitorv2/mocks/contract_submitter.go index 0e969294b90..ac9ad599f03 100644 --- a/core/services/fluxmonitorv2/mocks/contract_submitter.go +++ b/core/services/fluxmonitorv2/mocks/contract_submitter.go @@ -14,6 +14,14 @@ type ContractSubmitter struct { mock.Mock } +type ContractSubmitter_Expecter struct { + mock *mock.Mock +} + +func (_m *ContractSubmitter) EXPECT() *ContractSubmitter_Expecter { + return &ContractSubmitter_Expecter{mock: &_m.Mock} +} + // Submit provides a mock function with given fields: ctx, roundID, submission, idempotencyKey func (_m *ContractSubmitter) Submit(ctx context.Context, roundID *big.Int, submission *big.Int, idempotencyKey *string) error { ret := _m.Called(ctx, roundID, submission, idempotencyKey) @@ -32,6 +40,37 @@ func (_m *ContractSubmitter) Submit(ctx context.Context, roundID *big.Int, submi return r0 } +// ContractSubmitter_Submit_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Submit' +type ContractSubmitter_Submit_Call struct { + *mock.Call +} + +// Submit is a helper method to define mock.On call +// - ctx context.Context +// - roundID *big.Int +// - submission *big.Int +// - idempotencyKey *string +func (_e *ContractSubmitter_Expecter) Submit(ctx interface{}, roundID interface{}, submission interface{}, idempotencyKey interface{}) *ContractSubmitter_Submit_Call { + return &ContractSubmitter_Submit_Call{Call: _e.mock.On("Submit", ctx, roundID, submission, idempotencyKey)} +} + +func (_c *ContractSubmitter_Submit_Call) Run(run func(ctx context.Context, roundID *big.Int, submission *big.Int, idempotencyKey *string)) *ContractSubmitter_Submit_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*big.Int), args[2].(*big.Int), args[3].(*string)) + }) + return _c +} + +func (_c *ContractSubmitter_Submit_Call) Return(_a0 error) *ContractSubmitter_Submit_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ContractSubmitter_Submit_Call) RunAndReturn(run func(context.Context, *big.Int, *big.Int, *string) error) *ContractSubmitter_Submit_Call { + _c.Call.Return(run) + return _c +} + // NewContractSubmitter creates a new instance of ContractSubmitter. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewContractSubmitter(t interface { diff --git a/core/services/fluxmonitorv2/mocks/flags.go b/core/services/fluxmonitorv2/mocks/flags.go index 7b5e0330c8b..89e00d65304 100644 --- a/core/services/fluxmonitorv2/mocks/flags.go +++ b/core/services/fluxmonitorv2/mocks/flags.go @@ -17,6 +17,14 @@ type Flags struct { mock.Mock } +type Flags_Expecter struct { + mock *mock.Mock +} + +func (_m *Flags) EXPECT() *Flags_Expecter { + return &Flags_Expecter{mock: &_m.Mock} +} + // Address provides a mock function with given fields: func (_m *Flags) Address() common.Address { ret := _m.Called() @@ -37,6 +45,33 @@ func (_m *Flags) Address() common.Address { return r0 } +// Flags_Address_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Address' +type Flags_Address_Call struct { + *mock.Call +} + +// Address is a helper method to define mock.On call +func (_e *Flags_Expecter) Address() *Flags_Address_Call { + return &Flags_Address_Call{Call: _e.mock.On("Address")} +} + +func (_c *Flags_Address_Call) Run(run func()) *Flags_Address_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Flags_Address_Call) Return(_a0 common.Address) *Flags_Address_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Flags_Address_Call) RunAndReturn(run func() common.Address) *Flags_Address_Call { + _c.Call.Return(run) + return _c +} + // ContractExists provides a mock function with given fields: func (_m *Flags) ContractExists() bool { ret := _m.Called() @@ -55,6 +90,33 @@ func (_m *Flags) ContractExists() bool { return r0 } +// Flags_ContractExists_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ContractExists' +type Flags_ContractExists_Call struct { + *mock.Call +} + +// ContractExists is a helper method to define mock.On call +func (_e *Flags_Expecter) ContractExists() *Flags_ContractExists_Call { + return &Flags_ContractExists_Call{Call: _e.mock.On("ContractExists")} +} + +func (_c *Flags_ContractExists_Call) Run(run func()) *Flags_ContractExists_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Flags_ContractExists_Call) Return(_a0 bool) *Flags_ContractExists_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Flags_ContractExists_Call) RunAndReturn(run func() bool) *Flags_ContractExists_Call { + _c.Call.Return(run) + return _c +} + // IsLowered provides a mock function with given fields: contractAddr func (_m *Flags) IsLowered(contractAddr common.Address) (bool, error) { ret := _m.Called(contractAddr) @@ -83,6 +145,34 @@ func (_m *Flags) IsLowered(contractAddr common.Address) (bool, error) { return r0, r1 } +// Flags_IsLowered_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsLowered' +type Flags_IsLowered_Call struct { + *mock.Call +} + +// IsLowered is a helper method to define mock.On call +// - contractAddr common.Address +func (_e *Flags_Expecter) IsLowered(contractAddr interface{}) *Flags_IsLowered_Call { + return &Flags_IsLowered_Call{Call: _e.mock.On("IsLowered", contractAddr)} +} + +func (_c *Flags_IsLowered_Call) Run(run func(contractAddr common.Address)) *Flags_IsLowered_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(common.Address)) + }) + return _c +} + +func (_c *Flags_IsLowered_Call) Return(_a0 bool, _a1 error) *Flags_IsLowered_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Flags_IsLowered_Call) RunAndReturn(run func(common.Address) (bool, error)) *Flags_IsLowered_Call { + _c.Call.Return(run) + return _c +} + // ParseLog provides a mock function with given fields: log func (_m *Flags) ParseLog(log types.Log) (generated.AbigenLog, error) { ret := _m.Called(log) @@ -113,6 +203,34 @@ func (_m *Flags) ParseLog(log types.Log) (generated.AbigenLog, error) { return r0, r1 } +// Flags_ParseLog_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseLog' +type Flags_ParseLog_Call struct { + *mock.Call +} + +// ParseLog is a helper method to define mock.On call +// - log types.Log +func (_e *Flags_Expecter) ParseLog(log interface{}) *Flags_ParseLog_Call { + return &Flags_ParseLog_Call{Call: _e.mock.On("ParseLog", log)} +} + +func (_c *Flags_ParseLog_Call) Run(run func(log types.Log)) *Flags_ParseLog_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *Flags_ParseLog_Call) Return(_a0 generated.AbigenLog, _a1 error) *Flags_ParseLog_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Flags_ParseLog_Call) RunAndReturn(run func(types.Log) (generated.AbigenLog, error)) *Flags_ParseLog_Call { + _c.Call.Return(run) + return _c +} + // NewFlags creates a new instance of Flags. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewFlags(t interface { diff --git a/core/services/fluxmonitorv2/mocks/key_store_interface.go b/core/services/fluxmonitorv2/mocks/key_store_interface.go index 4c99cea1af0..8850d88842f 100644 --- a/core/services/fluxmonitorv2/mocks/key_store_interface.go +++ b/core/services/fluxmonitorv2/mocks/key_store_interface.go @@ -18,6 +18,14 @@ type KeyStoreInterface struct { mock.Mock } +type KeyStoreInterface_Expecter struct { + mock *mock.Mock +} + +func (_m *KeyStoreInterface) EXPECT() *KeyStoreInterface_Expecter { + return &KeyStoreInterface_Expecter{mock: &_m.Mock} +} + // EnabledKeysForChain provides a mock function with given fields: ctx, chainID func (_m *KeyStoreInterface) EnabledKeysForChain(ctx context.Context, chainID *big.Int) ([]ethkey.KeyV2, error) { ret := _m.Called(ctx, chainID) @@ -48,6 +56,35 @@ func (_m *KeyStoreInterface) EnabledKeysForChain(ctx context.Context, chainID *b return r0, r1 } +// KeyStoreInterface_EnabledKeysForChain_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EnabledKeysForChain' +type KeyStoreInterface_EnabledKeysForChain_Call struct { + *mock.Call +} + +// EnabledKeysForChain is a helper method to define mock.On call +// - ctx context.Context +// - chainID *big.Int +func (_e *KeyStoreInterface_Expecter) EnabledKeysForChain(ctx interface{}, chainID interface{}) *KeyStoreInterface_EnabledKeysForChain_Call { + return &KeyStoreInterface_EnabledKeysForChain_Call{Call: _e.mock.On("EnabledKeysForChain", ctx, chainID)} +} + +func (_c *KeyStoreInterface_EnabledKeysForChain_Call) Run(run func(ctx context.Context, chainID *big.Int)) *KeyStoreInterface_EnabledKeysForChain_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*big.Int)) + }) + return _c +} + +func (_c *KeyStoreInterface_EnabledKeysForChain_Call) Return(_a0 []ethkey.KeyV2, _a1 error) *KeyStoreInterface_EnabledKeysForChain_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *KeyStoreInterface_EnabledKeysForChain_Call) RunAndReturn(run func(context.Context, *big.Int) ([]ethkey.KeyV2, error)) *KeyStoreInterface_EnabledKeysForChain_Call { + _c.Call.Return(run) + return _c +} + // GetRoundRobinAddress provides a mock function with given fields: ctx, chainID, addrs func (_m *KeyStoreInterface) GetRoundRobinAddress(ctx context.Context, chainID *big.Int, addrs ...common.Address) (common.Address, error) { _va := make([]interface{}, len(addrs)) @@ -85,6 +122,43 @@ func (_m *KeyStoreInterface) GetRoundRobinAddress(ctx context.Context, chainID * return r0, r1 } +// KeyStoreInterface_GetRoundRobinAddress_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetRoundRobinAddress' +type KeyStoreInterface_GetRoundRobinAddress_Call struct { + *mock.Call +} + +// GetRoundRobinAddress is a helper method to define mock.On call +// - ctx context.Context +// - chainID *big.Int +// - addrs ...common.Address +func (_e *KeyStoreInterface_Expecter) GetRoundRobinAddress(ctx interface{}, chainID interface{}, addrs ...interface{}) *KeyStoreInterface_GetRoundRobinAddress_Call { + return &KeyStoreInterface_GetRoundRobinAddress_Call{Call: _e.mock.On("GetRoundRobinAddress", + append([]interface{}{ctx, chainID}, addrs...)...)} +} + +func (_c *KeyStoreInterface_GetRoundRobinAddress_Call) Run(run func(ctx context.Context, chainID *big.Int, addrs ...common.Address)) *KeyStoreInterface_GetRoundRobinAddress_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]common.Address, len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(common.Address) + } + } + run(args[0].(context.Context), args[1].(*big.Int), variadicArgs...) + }) + return _c +} + +func (_c *KeyStoreInterface_GetRoundRobinAddress_Call) Return(_a0 common.Address, _a1 error) *KeyStoreInterface_GetRoundRobinAddress_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *KeyStoreInterface_GetRoundRobinAddress_Call) RunAndReturn(run func(context.Context, *big.Int, ...common.Address) (common.Address, error)) *KeyStoreInterface_GetRoundRobinAddress_Call { + _c.Call.Return(run) + return _c +} + // NewKeyStoreInterface creates a new instance of KeyStoreInterface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewKeyStoreInterface(t interface { diff --git a/core/services/fluxmonitorv2/mocks/orm.go b/core/services/fluxmonitorv2/mocks/orm.go index d43a9ea16e6..7a351f3708a 100644 --- a/core/services/fluxmonitorv2/mocks/orm.go +++ b/core/services/fluxmonitorv2/mocks/orm.go @@ -19,6 +19,14 @@ type ORM struct { mock.Mock } +type ORM_Expecter struct { + mock *mock.Mock +} + +func (_m *ORM) EXPECT() *ORM_Expecter { + return &ORM_Expecter{mock: &_m.Mock} +} + // CountFluxMonitorRoundStats provides a mock function with given fields: ctx func (_m *ORM) CountFluxMonitorRoundStats(ctx context.Context) (int, error) { ret := _m.Called(ctx) @@ -47,6 +55,34 @@ func (_m *ORM) CountFluxMonitorRoundStats(ctx context.Context) (int, error) { return r0, r1 } +// ORM_CountFluxMonitorRoundStats_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CountFluxMonitorRoundStats' +type ORM_CountFluxMonitorRoundStats_Call struct { + *mock.Call +} + +// CountFluxMonitorRoundStats is a helper method to define mock.On call +// - ctx context.Context +func (_e *ORM_Expecter) CountFluxMonitorRoundStats(ctx interface{}) *ORM_CountFluxMonitorRoundStats_Call { + return &ORM_CountFluxMonitorRoundStats_Call{Call: _e.mock.On("CountFluxMonitorRoundStats", ctx)} +} + +func (_c *ORM_CountFluxMonitorRoundStats_Call) Run(run func(ctx context.Context)) *ORM_CountFluxMonitorRoundStats_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *ORM_CountFluxMonitorRoundStats_Call) Return(count int, err error) *ORM_CountFluxMonitorRoundStats_Call { + _c.Call.Return(count, err) + return _c +} + +func (_c *ORM_CountFluxMonitorRoundStats_Call) RunAndReturn(run func(context.Context) (int, error)) *ORM_CountFluxMonitorRoundStats_Call { + _c.Call.Return(run) + return _c +} + // CreateEthTransaction provides a mock function with given fields: ctx, fromAddress, toAddress, payload, gasLimit, idempotencyKey func (_m *ORM) CreateEthTransaction(ctx context.Context, fromAddress common.Address, toAddress common.Address, payload []byte, gasLimit uint64, idempotencyKey *string) error { ret := _m.Called(ctx, fromAddress, toAddress, payload, gasLimit, idempotencyKey) @@ -65,6 +101,39 @@ func (_m *ORM) CreateEthTransaction(ctx context.Context, fromAddress common.Addr return r0 } +// ORM_CreateEthTransaction_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateEthTransaction' +type ORM_CreateEthTransaction_Call struct { + *mock.Call +} + +// CreateEthTransaction is a helper method to define mock.On call +// - ctx context.Context +// - fromAddress common.Address +// - toAddress common.Address +// - payload []byte +// - gasLimit uint64 +// - idempotencyKey *string +func (_e *ORM_Expecter) CreateEthTransaction(ctx interface{}, fromAddress interface{}, toAddress interface{}, payload interface{}, gasLimit interface{}, idempotencyKey interface{}) *ORM_CreateEthTransaction_Call { + return &ORM_CreateEthTransaction_Call{Call: _e.mock.On("CreateEthTransaction", ctx, fromAddress, toAddress, payload, gasLimit, idempotencyKey)} +} + +func (_c *ORM_CreateEthTransaction_Call) Run(run func(ctx context.Context, fromAddress common.Address, toAddress common.Address, payload []byte, gasLimit uint64, idempotencyKey *string)) *ORM_CreateEthTransaction_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(common.Address), args[2].(common.Address), args[3].([]byte), args[4].(uint64), args[5].(*string)) + }) + return _c +} + +func (_c *ORM_CreateEthTransaction_Call) Return(_a0 error) *ORM_CreateEthTransaction_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ORM_CreateEthTransaction_Call) RunAndReturn(run func(context.Context, common.Address, common.Address, []byte, uint64, *string) error) *ORM_CreateEthTransaction_Call { + _c.Call.Return(run) + return _c +} + // DeleteFluxMonitorRoundsBackThrough provides a mock function with given fields: ctx, aggregator, roundID func (_m *ORM) DeleteFluxMonitorRoundsBackThrough(ctx context.Context, aggregator common.Address, roundID uint32) error { ret := _m.Called(ctx, aggregator, roundID) @@ -83,6 +152,36 @@ func (_m *ORM) DeleteFluxMonitorRoundsBackThrough(ctx context.Context, aggregato return r0 } +// ORM_DeleteFluxMonitorRoundsBackThrough_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteFluxMonitorRoundsBackThrough' +type ORM_DeleteFluxMonitorRoundsBackThrough_Call struct { + *mock.Call +} + +// DeleteFluxMonitorRoundsBackThrough is a helper method to define mock.On call +// - ctx context.Context +// - aggregator common.Address +// - roundID uint32 +func (_e *ORM_Expecter) DeleteFluxMonitorRoundsBackThrough(ctx interface{}, aggregator interface{}, roundID interface{}) *ORM_DeleteFluxMonitorRoundsBackThrough_Call { + return &ORM_DeleteFluxMonitorRoundsBackThrough_Call{Call: _e.mock.On("DeleteFluxMonitorRoundsBackThrough", ctx, aggregator, roundID)} +} + +func (_c *ORM_DeleteFluxMonitorRoundsBackThrough_Call) Run(run func(ctx context.Context, aggregator common.Address, roundID uint32)) *ORM_DeleteFluxMonitorRoundsBackThrough_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(common.Address), args[2].(uint32)) + }) + return _c +} + +func (_c *ORM_DeleteFluxMonitorRoundsBackThrough_Call) Return(_a0 error) *ORM_DeleteFluxMonitorRoundsBackThrough_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ORM_DeleteFluxMonitorRoundsBackThrough_Call) RunAndReturn(run func(context.Context, common.Address, uint32) error) *ORM_DeleteFluxMonitorRoundsBackThrough_Call { + _c.Call.Return(run) + return _c +} + // FindOrCreateFluxMonitorRoundStats provides a mock function with given fields: ctx, aggregator, roundID, newRoundLogs func (_m *ORM) FindOrCreateFluxMonitorRoundStats(ctx context.Context, aggregator common.Address, roundID uint32, newRoundLogs uint) (fluxmonitorv2.FluxMonitorRoundStatsV2, error) { ret := _m.Called(ctx, aggregator, roundID, newRoundLogs) @@ -111,6 +210,37 @@ func (_m *ORM) FindOrCreateFluxMonitorRoundStats(ctx context.Context, aggregator return r0, r1 } +// ORM_FindOrCreateFluxMonitorRoundStats_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindOrCreateFluxMonitorRoundStats' +type ORM_FindOrCreateFluxMonitorRoundStats_Call struct { + *mock.Call +} + +// FindOrCreateFluxMonitorRoundStats is a helper method to define mock.On call +// - ctx context.Context +// - aggregator common.Address +// - roundID uint32 +// - newRoundLogs uint +func (_e *ORM_Expecter) FindOrCreateFluxMonitorRoundStats(ctx interface{}, aggregator interface{}, roundID interface{}, newRoundLogs interface{}) *ORM_FindOrCreateFluxMonitorRoundStats_Call { + return &ORM_FindOrCreateFluxMonitorRoundStats_Call{Call: _e.mock.On("FindOrCreateFluxMonitorRoundStats", ctx, aggregator, roundID, newRoundLogs)} +} + +func (_c *ORM_FindOrCreateFluxMonitorRoundStats_Call) Run(run func(ctx context.Context, aggregator common.Address, roundID uint32, newRoundLogs uint)) *ORM_FindOrCreateFluxMonitorRoundStats_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(common.Address), args[2].(uint32), args[3].(uint)) + }) + return _c +} + +func (_c *ORM_FindOrCreateFluxMonitorRoundStats_Call) Return(_a0 fluxmonitorv2.FluxMonitorRoundStatsV2, _a1 error) *ORM_FindOrCreateFluxMonitorRoundStats_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ORM_FindOrCreateFluxMonitorRoundStats_Call) RunAndReturn(run func(context.Context, common.Address, uint32, uint) (fluxmonitorv2.FluxMonitorRoundStatsV2, error)) *ORM_FindOrCreateFluxMonitorRoundStats_Call { + _c.Call.Return(run) + return _c +} + // MostRecentFluxMonitorRoundID provides a mock function with given fields: ctx, aggregator func (_m *ORM) MostRecentFluxMonitorRoundID(ctx context.Context, aggregator common.Address) (uint32, error) { ret := _m.Called(ctx, aggregator) @@ -139,6 +269,35 @@ func (_m *ORM) MostRecentFluxMonitorRoundID(ctx context.Context, aggregator comm return r0, r1 } +// ORM_MostRecentFluxMonitorRoundID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MostRecentFluxMonitorRoundID' +type ORM_MostRecentFluxMonitorRoundID_Call struct { + *mock.Call +} + +// MostRecentFluxMonitorRoundID is a helper method to define mock.On call +// - ctx context.Context +// - aggregator common.Address +func (_e *ORM_Expecter) MostRecentFluxMonitorRoundID(ctx interface{}, aggregator interface{}) *ORM_MostRecentFluxMonitorRoundID_Call { + return &ORM_MostRecentFluxMonitorRoundID_Call{Call: _e.mock.On("MostRecentFluxMonitorRoundID", ctx, aggregator)} +} + +func (_c *ORM_MostRecentFluxMonitorRoundID_Call) Run(run func(ctx context.Context, aggregator common.Address)) *ORM_MostRecentFluxMonitorRoundID_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(common.Address)) + }) + return _c +} + +func (_c *ORM_MostRecentFluxMonitorRoundID_Call) Return(_a0 uint32, _a1 error) *ORM_MostRecentFluxMonitorRoundID_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ORM_MostRecentFluxMonitorRoundID_Call) RunAndReturn(run func(context.Context, common.Address) (uint32, error)) *ORM_MostRecentFluxMonitorRoundID_Call { + _c.Call.Return(run) + return _c +} + // UpdateFluxMonitorRoundStats provides a mock function with given fields: ctx, aggregator, roundID, runID, newRoundLogsAddition func (_m *ORM) UpdateFluxMonitorRoundStats(ctx context.Context, aggregator common.Address, roundID uint32, runID int64, newRoundLogsAddition uint) error { ret := _m.Called(ctx, aggregator, roundID, runID, newRoundLogsAddition) @@ -157,6 +316,38 @@ func (_m *ORM) UpdateFluxMonitorRoundStats(ctx context.Context, aggregator commo return r0 } +// ORM_UpdateFluxMonitorRoundStats_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateFluxMonitorRoundStats' +type ORM_UpdateFluxMonitorRoundStats_Call struct { + *mock.Call +} + +// UpdateFluxMonitorRoundStats is a helper method to define mock.On call +// - ctx context.Context +// - aggregator common.Address +// - roundID uint32 +// - runID int64 +// - newRoundLogsAddition uint +func (_e *ORM_Expecter) UpdateFluxMonitorRoundStats(ctx interface{}, aggregator interface{}, roundID interface{}, runID interface{}, newRoundLogsAddition interface{}) *ORM_UpdateFluxMonitorRoundStats_Call { + return &ORM_UpdateFluxMonitorRoundStats_Call{Call: _e.mock.On("UpdateFluxMonitorRoundStats", ctx, aggregator, roundID, runID, newRoundLogsAddition)} +} + +func (_c *ORM_UpdateFluxMonitorRoundStats_Call) Run(run func(ctx context.Context, aggregator common.Address, roundID uint32, runID int64, newRoundLogsAddition uint)) *ORM_UpdateFluxMonitorRoundStats_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(common.Address), args[2].(uint32), args[3].(int64), args[4].(uint)) + }) + return _c +} + +func (_c *ORM_UpdateFluxMonitorRoundStats_Call) Return(_a0 error) *ORM_UpdateFluxMonitorRoundStats_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ORM_UpdateFluxMonitorRoundStats_Call) RunAndReturn(run func(context.Context, common.Address, uint32, int64, uint) error) *ORM_UpdateFluxMonitorRoundStats_Call { + _c.Call.Return(run) + return _c +} + // WithDataSource provides a mock function with given fields: _a0 func (_m *ORM) WithDataSource(_a0 sqlutil.DataSource) fluxmonitorv2.ORM { ret := _m.Called(_a0) @@ -177,6 +368,34 @@ func (_m *ORM) WithDataSource(_a0 sqlutil.DataSource) fluxmonitorv2.ORM { return r0 } +// ORM_WithDataSource_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WithDataSource' +type ORM_WithDataSource_Call struct { + *mock.Call +} + +// WithDataSource is a helper method to define mock.On call +// - _a0 sqlutil.DataSource +func (_e *ORM_Expecter) WithDataSource(_a0 interface{}) *ORM_WithDataSource_Call { + return &ORM_WithDataSource_Call{Call: _e.mock.On("WithDataSource", _a0)} +} + +func (_c *ORM_WithDataSource_Call) Run(run func(_a0 sqlutil.DataSource)) *ORM_WithDataSource_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(sqlutil.DataSource)) + }) + return _c +} + +func (_c *ORM_WithDataSource_Call) Return(_a0 fluxmonitorv2.ORM) *ORM_WithDataSource_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ORM_WithDataSource_Call) RunAndReturn(run func(sqlutil.DataSource) fluxmonitorv2.ORM) *ORM_WithDataSource_Call { + _c.Call.Return(run) + return _c +} + // NewORM creates a new instance of ORM. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewORM(t interface { diff --git a/core/services/fluxmonitorv2/orm.go b/core/services/fluxmonitorv2/orm.go index 2f7411d1190..9e3bc67f80c 100644 --- a/core/services/fluxmonitorv2/orm.go +++ b/core/services/fluxmonitorv2/orm.go @@ -17,8 +17,6 @@ type transmitter interface { CreateTransaction(ctx context.Context, txRequest txmgr.TxRequest) (tx txmgr.Tx, err error) } -//go:generate mockery --quiet --name ORM --output ./mocks/ --case=underscore - // ORM defines an interface for database commands related to Flux Monitor v2 type ORM interface { MostRecentFluxMonitorRoundID(ctx context.Context, aggregator common.Address) (uint32, error) diff --git a/core/services/fluxmonitorv2/poll_manager.go b/core/services/fluxmonitorv2/poll_manager.go index 78b99aec4d5..aca6c75a311 100644 --- a/core/services/fluxmonitorv2/poll_manager.go +++ b/core/services/fluxmonitorv2/poll_manager.go @@ -5,8 +5,8 @@ import ( "sync/atomic" "time" + "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/flux_aggregator_wrapper" - "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/utils" ) @@ -64,7 +64,7 @@ type PollManager struct { } // NewPollManager initializes a new PollManager -func NewPollManager(cfg PollManagerConfig, logger logger.Logger) (*PollManager, error) { +func NewPollManager(cfg PollManagerConfig, lggr logger.Logger) (*PollManager, error) { minBackoffDuration := cfg.MinRetryBackoffDuration if cfg.IdleTimerPeriod < minBackoffDuration { minBackoffDuration = cfg.IdleTimerPeriod @@ -82,7 +82,7 @@ func NewPollManager(cfg PollManagerConfig, logger logger.Logger) (*PollManager, p := &PollManager{ cfg: cfg, - logger: logger.Named("PollManager"), + logger: logger.Named(lggr, "PollManager"), hibernationTimer: utils.NewResettableTimer(), pollTicker: utils.NewPausableTicker(cfg.PollTickerInterval), @@ -277,7 +277,7 @@ func (pm *PollManager) startIdleTimer(roundStartedAtUTC uint64) { deadline := startedAt.Add(pm.cfg.IdleTimerPeriod) deadlineDuration := time.Until(deadline) - log := pm.logger.With( + log := logger.With(pm.logger, "pollFrequency", pm.cfg.PollTickerInterval, "idleDuration", pm.cfg.IdleTimerPeriod, "startedAt", roundStartedAtUTC, @@ -300,7 +300,7 @@ func (pm *PollManager) startIdleTimer(roundStartedAtUTC uint64) { // startRoundTimer starts the round timer func (pm *PollManager) startRoundTimer(roundTimesOutAt uint64) { - log := pm.logger.With( + log := logger.With(pm.logger, "pollFrequency", pm.cfg.PollTickerInterval, "idleDuration", pm.cfg.IdleTimerPeriod, "timesOutAt", roundTimesOutAt, diff --git a/core/services/functions/connector_handler_test.go b/core/services/functions/connector_handler_test.go index 7e1f3ced34f..a24139da58e 100644 --- a/core/services/functions/connector_handler_test.go +++ b/core/services/functions/connector_handler_test.go @@ -269,7 +269,10 @@ func TestFunctionsConnectorHandler(t *testing.T) { // first call to trigger the request var response functions.HeartbeatResponse allowlist.On("Allow", addr).Return(true).Once() - listener.On("HandleOffchainRequest", mock.Anything, mock.Anything).Return(nil).Once() + handlerCalled := make(chan struct{}) + listener.On("HandleOffchainRequest", mock.Anything, mock.Anything).Run(func(args mock.Arguments) { + handlerCalled <- struct{}{} + }).Return(nil).Once() connector.On("SendToGateway", mock.Anything, "gw1", mock.Anything).Run(func(args mock.Arguments) { respMsg, ok := args[2].(*api.Message) require.True(t, ok) @@ -277,6 +280,7 @@ func TestFunctionsConnectorHandler(t *testing.T) { require.Equal(t, functions.RequestStatePending, response.Status) }).Return(nil).Once() handler.HandleGatewayMessage(ctx, "gw1", msg) + <-handlerCalled // async response computation reportCh <- &functions.OffchainResponse{ @@ -304,9 +308,13 @@ func TestFunctionsConnectorHandler(t *testing.T) { // first call to trigger the request var response functions.HeartbeatResponse allowlist.On("Allow", addr).Return(true).Once() - listener.On("HandleOffchainRequest", mock.Anything, mock.Anything).Return(errors.New("boom")).Once() + handlerCalled := make(chan struct{}) + listener.On("HandleOffchainRequest", mock.Anything, mock.Anything).Run(func(args mock.Arguments) { + handlerCalled <- struct{}{} + }).Return(errors.New("boom")).Once() connector.On("SendToGateway", mock.Anything, "gw1", mock.Anything).Return(nil).Once() handler.HandleGatewayMessage(ctx, "gw1", msg) + <-handlerCalled // collect the response - should eventually result in an internal error gomega.NewGomegaWithT(t).Eventually(func() bool { diff --git a/core/services/functions/external_adapter_client.go b/core/services/functions/external_adapter_client.go index 09ce8defdca..08118f2f381 100644 --- a/core/services/functions/external_adapter_client.go +++ b/core/services/functions/external_adapter_client.go @@ -25,8 +25,6 @@ import ( // // Both endpoints share the same response format. // All methods are thread-safe. -// -//go:generate mockery --quiet --name ExternalAdapterClient --output ./mocks/ --case=underscore type ExternalAdapterClient interface { RunComputation( ctx context.Context, @@ -51,7 +49,6 @@ type externalAdapterClient struct { var _ ExternalAdapterClient = (*externalAdapterClient)(nil) -//go:generate mockery --quiet --name BridgeAccessor --output ./mocks/ --case=underscore type BridgeAccessor interface { NewExternalAdapterClient(context.Context) (ExternalAdapterClient, error) } diff --git a/core/services/functions/listener.go b/core/services/functions/listener.go index bfcbf10f692..64c05a34c8d 100644 --- a/core/services/functions/listener.go +++ b/core/services/functions/listener.go @@ -116,7 +116,6 @@ const ( FlagSecretsMaxSize uint32 = 2 ) -//go:generate mockery --quiet --name FunctionsListener --output ./mocks/ --case=underscore type FunctionsListener interface { job.ServiceCtx diff --git a/core/services/functions/mocks/bridge_accessor.go b/core/services/functions/mocks/bridge_accessor.go index 3641e7dfa1a..0627ddd5990 100644 --- a/core/services/functions/mocks/bridge_accessor.go +++ b/core/services/functions/mocks/bridge_accessor.go @@ -14,6 +14,14 @@ type BridgeAccessor struct { mock.Mock } +type BridgeAccessor_Expecter struct { + mock *mock.Mock +} + +func (_m *BridgeAccessor) EXPECT() *BridgeAccessor_Expecter { + return &BridgeAccessor_Expecter{mock: &_m.Mock} +} + // NewExternalAdapterClient provides a mock function with given fields: _a0 func (_m *BridgeAccessor) NewExternalAdapterClient(_a0 context.Context) (functions.ExternalAdapterClient, error) { ret := _m.Called(_a0) @@ -44,6 +52,34 @@ func (_m *BridgeAccessor) NewExternalAdapterClient(_a0 context.Context) (functio return r0, r1 } +// BridgeAccessor_NewExternalAdapterClient_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NewExternalAdapterClient' +type BridgeAccessor_NewExternalAdapterClient_Call struct { + *mock.Call +} + +// NewExternalAdapterClient is a helper method to define mock.On call +// - _a0 context.Context +func (_e *BridgeAccessor_Expecter) NewExternalAdapterClient(_a0 interface{}) *BridgeAccessor_NewExternalAdapterClient_Call { + return &BridgeAccessor_NewExternalAdapterClient_Call{Call: _e.mock.On("NewExternalAdapterClient", _a0)} +} + +func (_c *BridgeAccessor_NewExternalAdapterClient_Call) Run(run func(_a0 context.Context)) *BridgeAccessor_NewExternalAdapterClient_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *BridgeAccessor_NewExternalAdapterClient_Call) Return(_a0 functions.ExternalAdapterClient, _a1 error) *BridgeAccessor_NewExternalAdapterClient_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *BridgeAccessor_NewExternalAdapterClient_Call) RunAndReturn(run func(context.Context) (functions.ExternalAdapterClient, error)) *BridgeAccessor_NewExternalAdapterClient_Call { + _c.Call.Return(run) + return _c +} + // NewBridgeAccessor creates a new instance of BridgeAccessor. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewBridgeAccessor(t interface { diff --git a/core/services/functions/mocks/external_adapter_client.go b/core/services/functions/mocks/external_adapter_client.go index e7f7053a0b3..cdd67bcc419 100644 --- a/core/services/functions/mocks/external_adapter_client.go +++ b/core/services/functions/mocks/external_adapter_client.go @@ -14,6 +14,14 @@ type ExternalAdapterClient struct { mock.Mock } +type ExternalAdapterClient_Expecter struct { + mock *mock.Mock +} + +func (_m *ExternalAdapterClient) EXPECT() *ExternalAdapterClient_Expecter { + return &ExternalAdapterClient_Expecter{mock: &_m.Mock} +} + // FetchEncryptedSecrets provides a mock function with given fields: ctx, encryptedSecretsUrls, requestId, jobName func (_m *ExternalAdapterClient) FetchEncryptedSecrets(ctx context.Context, encryptedSecretsUrls []byte, requestId string, jobName string) ([]byte, []byte, error) { ret := _m.Called(ctx, encryptedSecretsUrls, requestId, jobName) @@ -53,6 +61,37 @@ func (_m *ExternalAdapterClient) FetchEncryptedSecrets(ctx context.Context, encr return r0, r1, r2 } +// ExternalAdapterClient_FetchEncryptedSecrets_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FetchEncryptedSecrets' +type ExternalAdapterClient_FetchEncryptedSecrets_Call struct { + *mock.Call +} + +// FetchEncryptedSecrets is a helper method to define mock.On call +// - ctx context.Context +// - encryptedSecretsUrls []byte +// - requestId string +// - jobName string +func (_e *ExternalAdapterClient_Expecter) FetchEncryptedSecrets(ctx interface{}, encryptedSecretsUrls interface{}, requestId interface{}, jobName interface{}) *ExternalAdapterClient_FetchEncryptedSecrets_Call { + return &ExternalAdapterClient_FetchEncryptedSecrets_Call{Call: _e.mock.On("FetchEncryptedSecrets", ctx, encryptedSecretsUrls, requestId, jobName)} +} + +func (_c *ExternalAdapterClient_FetchEncryptedSecrets_Call) Run(run func(ctx context.Context, encryptedSecretsUrls []byte, requestId string, jobName string)) *ExternalAdapterClient_FetchEncryptedSecrets_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].([]byte), args[2].(string), args[3].(string)) + }) + return _c +} + +func (_c *ExternalAdapterClient_FetchEncryptedSecrets_Call) Return(encryptedSecrets []byte, userError []byte, err error) *ExternalAdapterClient_FetchEncryptedSecrets_Call { + _c.Call.Return(encryptedSecrets, userError, err) + return _c +} + +func (_c *ExternalAdapterClient_FetchEncryptedSecrets_Call) RunAndReturn(run func(context.Context, []byte, string, string) ([]byte, []byte, error)) *ExternalAdapterClient_FetchEncryptedSecrets_Call { + _c.Call.Return(run) + return _c +} + // RunComputation provides a mock function with given fields: ctx, requestId, jobName, subscriptionOwner, subscriptionId, flags, nodeProvidedSecrets, requestData func (_m *ExternalAdapterClient) RunComputation(ctx context.Context, requestId string, jobName string, subscriptionOwner string, subscriptionId uint64, flags functions.RequestFlags, nodeProvidedSecrets string, requestData *functions.RequestData) ([]byte, []byte, []string, error) { ret := _m.Called(ctx, requestId, jobName, subscriptionOwner, subscriptionId, flags, nodeProvidedSecrets, requestData) @@ -101,6 +140,41 @@ func (_m *ExternalAdapterClient) RunComputation(ctx context.Context, requestId s return r0, r1, r2, r3 } +// ExternalAdapterClient_RunComputation_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RunComputation' +type ExternalAdapterClient_RunComputation_Call struct { + *mock.Call +} + +// RunComputation is a helper method to define mock.On call +// - ctx context.Context +// - requestId string +// - jobName string +// - subscriptionOwner string +// - subscriptionId uint64 +// - flags functions.RequestFlags +// - nodeProvidedSecrets string +// - requestData *functions.RequestData +func (_e *ExternalAdapterClient_Expecter) RunComputation(ctx interface{}, requestId interface{}, jobName interface{}, subscriptionOwner interface{}, subscriptionId interface{}, flags interface{}, nodeProvidedSecrets interface{}, requestData interface{}) *ExternalAdapterClient_RunComputation_Call { + return &ExternalAdapterClient_RunComputation_Call{Call: _e.mock.On("RunComputation", ctx, requestId, jobName, subscriptionOwner, subscriptionId, flags, nodeProvidedSecrets, requestData)} +} + +func (_c *ExternalAdapterClient_RunComputation_Call) Run(run func(ctx context.Context, requestId string, jobName string, subscriptionOwner string, subscriptionId uint64, flags functions.RequestFlags, nodeProvidedSecrets string, requestData *functions.RequestData)) *ExternalAdapterClient_RunComputation_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string), args[3].(string), args[4].(uint64), args[5].(functions.RequestFlags), args[6].(string), args[7].(*functions.RequestData)) + }) + return _c +} + +func (_c *ExternalAdapterClient_RunComputation_Call) Return(userResult []byte, userError []byte, domains []string, err error) *ExternalAdapterClient_RunComputation_Call { + _c.Call.Return(userResult, userError, domains, err) + return _c +} + +func (_c *ExternalAdapterClient_RunComputation_Call) RunAndReturn(run func(context.Context, string, string, string, uint64, functions.RequestFlags, string, *functions.RequestData) ([]byte, []byte, []string, error)) *ExternalAdapterClient_RunComputation_Call { + _c.Call.Return(run) + return _c +} + // NewExternalAdapterClient creates a new instance of ExternalAdapterClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewExternalAdapterClient(t interface { diff --git a/core/services/functions/mocks/functions_listener.go b/core/services/functions/mocks/functions_listener.go index ed0d269c6f5..b990568b0c2 100644 --- a/core/services/functions/mocks/functions_listener.go +++ b/core/services/functions/mocks/functions_listener.go @@ -14,6 +14,14 @@ type FunctionsListener struct { mock.Mock } +type FunctionsListener_Expecter struct { + mock *mock.Mock +} + +func (_m *FunctionsListener) EXPECT() *FunctionsListener_Expecter { + return &FunctionsListener_Expecter{mock: &_m.Mock} +} + // Close provides a mock function with given fields: func (_m *FunctionsListener) Close() error { ret := _m.Called() @@ -32,6 +40,33 @@ func (_m *FunctionsListener) Close() error { return r0 } +// FunctionsListener_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close' +type FunctionsListener_Close_Call struct { + *mock.Call +} + +// Close is a helper method to define mock.On call +func (_e *FunctionsListener_Expecter) Close() *FunctionsListener_Close_Call { + return &FunctionsListener_Close_Call{Call: _e.mock.On("Close")} +} + +func (_c *FunctionsListener_Close_Call) Run(run func()) *FunctionsListener_Close_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *FunctionsListener_Close_Call) Return(_a0 error) *FunctionsListener_Close_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *FunctionsListener_Close_Call) RunAndReturn(run func() error) *FunctionsListener_Close_Call { + _c.Call.Return(run) + return _c +} + // HandleOffchainRequest provides a mock function with given fields: ctx, request func (_m *FunctionsListener) HandleOffchainRequest(ctx context.Context, request *functions.OffchainRequest) error { ret := _m.Called(ctx, request) @@ -50,6 +85,35 @@ func (_m *FunctionsListener) HandleOffchainRequest(ctx context.Context, request return r0 } +// FunctionsListener_HandleOffchainRequest_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HandleOffchainRequest' +type FunctionsListener_HandleOffchainRequest_Call struct { + *mock.Call +} + +// HandleOffchainRequest is a helper method to define mock.On call +// - ctx context.Context +// - request *functions.OffchainRequest +func (_e *FunctionsListener_Expecter) HandleOffchainRequest(ctx interface{}, request interface{}) *FunctionsListener_HandleOffchainRequest_Call { + return &FunctionsListener_HandleOffchainRequest_Call{Call: _e.mock.On("HandleOffchainRequest", ctx, request)} +} + +func (_c *FunctionsListener_HandleOffchainRequest_Call) Run(run func(ctx context.Context, request *functions.OffchainRequest)) *FunctionsListener_HandleOffchainRequest_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*functions.OffchainRequest)) + }) + return _c +} + +func (_c *FunctionsListener_HandleOffchainRequest_Call) Return(_a0 error) *FunctionsListener_HandleOffchainRequest_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *FunctionsListener_HandleOffchainRequest_Call) RunAndReturn(run func(context.Context, *functions.OffchainRequest) error) *FunctionsListener_HandleOffchainRequest_Call { + _c.Call.Return(run) + return _c +} + // Start provides a mock function with given fields: _a0 func (_m *FunctionsListener) Start(_a0 context.Context) error { ret := _m.Called(_a0) @@ -68,6 +132,34 @@ func (_m *FunctionsListener) Start(_a0 context.Context) error { return r0 } +// FunctionsListener_Start_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Start' +type FunctionsListener_Start_Call struct { + *mock.Call +} + +// Start is a helper method to define mock.On call +// - _a0 context.Context +func (_e *FunctionsListener_Expecter) Start(_a0 interface{}) *FunctionsListener_Start_Call { + return &FunctionsListener_Start_Call{Call: _e.mock.On("Start", _a0)} +} + +func (_c *FunctionsListener_Start_Call) Run(run func(_a0 context.Context)) *FunctionsListener_Start_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *FunctionsListener_Start_Call) Return(_a0 error) *FunctionsListener_Start_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *FunctionsListener_Start_Call) RunAndReturn(run func(context.Context) error) *FunctionsListener_Start_Call { + _c.Call.Return(run) + return _c +} + // NewFunctionsListener creates a new instance of FunctionsListener. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewFunctionsListener(t interface { diff --git a/core/services/functions/mocks/offchain_transmitter.go b/core/services/functions/mocks/offchain_transmitter.go index b718222d091..77154f1c020 100644 --- a/core/services/functions/mocks/offchain_transmitter.go +++ b/core/services/functions/mocks/offchain_transmitter.go @@ -14,6 +14,14 @@ type OffchainTransmitter struct { mock.Mock } +type OffchainTransmitter_Expecter struct { + mock *mock.Mock +} + +func (_m *OffchainTransmitter) EXPECT() *OffchainTransmitter_Expecter { + return &OffchainTransmitter_Expecter{mock: &_m.Mock} +} + // ReportChannel provides a mock function with given fields: func (_m *OffchainTransmitter) ReportChannel() chan *functions.OffchainResponse { ret := _m.Called() @@ -34,6 +42,33 @@ func (_m *OffchainTransmitter) ReportChannel() chan *functions.OffchainResponse return r0 } +// OffchainTransmitter_ReportChannel_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ReportChannel' +type OffchainTransmitter_ReportChannel_Call struct { + *mock.Call +} + +// ReportChannel is a helper method to define mock.On call +func (_e *OffchainTransmitter_Expecter) ReportChannel() *OffchainTransmitter_ReportChannel_Call { + return &OffchainTransmitter_ReportChannel_Call{Call: _e.mock.On("ReportChannel")} +} + +func (_c *OffchainTransmitter_ReportChannel_Call) Run(run func()) *OffchainTransmitter_ReportChannel_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *OffchainTransmitter_ReportChannel_Call) Return(_a0 chan *functions.OffchainResponse) *OffchainTransmitter_ReportChannel_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *OffchainTransmitter_ReportChannel_Call) RunAndReturn(run func() chan *functions.OffchainResponse) *OffchainTransmitter_ReportChannel_Call { + _c.Call.Return(run) + return _c +} + // TransmitReport provides a mock function with given fields: ctx, report func (_m *OffchainTransmitter) TransmitReport(ctx context.Context, report *functions.OffchainResponse) error { ret := _m.Called(ctx, report) @@ -52,6 +87,35 @@ func (_m *OffchainTransmitter) TransmitReport(ctx context.Context, report *funct return r0 } +// OffchainTransmitter_TransmitReport_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TransmitReport' +type OffchainTransmitter_TransmitReport_Call struct { + *mock.Call +} + +// TransmitReport is a helper method to define mock.On call +// - ctx context.Context +// - report *functions.OffchainResponse +func (_e *OffchainTransmitter_Expecter) TransmitReport(ctx interface{}, report interface{}) *OffchainTransmitter_TransmitReport_Call { + return &OffchainTransmitter_TransmitReport_Call{Call: _e.mock.On("TransmitReport", ctx, report)} +} + +func (_c *OffchainTransmitter_TransmitReport_Call) Run(run func(ctx context.Context, report *functions.OffchainResponse)) *OffchainTransmitter_TransmitReport_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*functions.OffchainResponse)) + }) + return _c +} + +func (_c *OffchainTransmitter_TransmitReport_Call) Return(_a0 error) *OffchainTransmitter_TransmitReport_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *OffchainTransmitter_TransmitReport_Call) RunAndReturn(run func(context.Context, *functions.OffchainResponse) error) *OffchainTransmitter_TransmitReport_Call { + _c.Call.Return(run) + return _c +} + // NewOffchainTransmitter creates a new instance of OffchainTransmitter. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewOffchainTransmitter(t interface { diff --git a/core/services/functions/mocks/orm.go b/core/services/functions/mocks/orm.go index 813abed7e23..8affdc0aa26 100644 --- a/core/services/functions/mocks/orm.go +++ b/core/services/functions/mocks/orm.go @@ -16,6 +16,14 @@ type ORM struct { mock.Mock } +type ORM_Expecter struct { + mock *mock.Mock +} + +func (_m *ORM) EXPECT() *ORM_Expecter { + return &ORM_Expecter{mock: &_m.Mock} +} + // CreateRequest provides a mock function with given fields: ctx, request func (_m *ORM) CreateRequest(ctx context.Context, request *functions.Request) error { ret := _m.Called(ctx, request) @@ -34,6 +42,35 @@ func (_m *ORM) CreateRequest(ctx context.Context, request *functions.Request) er return r0 } +// ORM_CreateRequest_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateRequest' +type ORM_CreateRequest_Call struct { + *mock.Call +} + +// CreateRequest is a helper method to define mock.On call +// - ctx context.Context +// - request *functions.Request +func (_e *ORM_Expecter) CreateRequest(ctx interface{}, request interface{}) *ORM_CreateRequest_Call { + return &ORM_CreateRequest_Call{Call: _e.mock.On("CreateRequest", ctx, request)} +} + +func (_c *ORM_CreateRequest_Call) Run(run func(ctx context.Context, request *functions.Request)) *ORM_CreateRequest_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*functions.Request)) + }) + return _c +} + +func (_c *ORM_CreateRequest_Call) Return(_a0 error) *ORM_CreateRequest_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ORM_CreateRequest_Call) RunAndReturn(run func(context.Context, *functions.Request) error) *ORM_CreateRequest_Call { + _c.Call.Return(run) + return _c +} + // FindById provides a mock function with given fields: ctx, requestID func (_m *ORM) FindById(ctx context.Context, requestID functions.RequestID) (*functions.Request, error) { ret := _m.Called(ctx, requestID) @@ -64,6 +101,35 @@ func (_m *ORM) FindById(ctx context.Context, requestID functions.RequestID) (*fu return r0, r1 } +// ORM_FindById_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindById' +type ORM_FindById_Call struct { + *mock.Call +} + +// FindById is a helper method to define mock.On call +// - ctx context.Context +// - requestID functions.RequestID +func (_e *ORM_Expecter) FindById(ctx interface{}, requestID interface{}) *ORM_FindById_Call { + return &ORM_FindById_Call{Call: _e.mock.On("FindById", ctx, requestID)} +} + +func (_c *ORM_FindById_Call) Run(run func(ctx context.Context, requestID functions.RequestID)) *ORM_FindById_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(functions.RequestID)) + }) + return _c +} + +func (_c *ORM_FindById_Call) Return(_a0 *functions.Request, _a1 error) *ORM_FindById_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ORM_FindById_Call) RunAndReturn(run func(context.Context, functions.RequestID) (*functions.Request, error)) *ORM_FindById_Call { + _c.Call.Return(run) + return _c +} + // FindOldestEntriesByState provides a mock function with given fields: ctx, state, limit func (_m *ORM) FindOldestEntriesByState(ctx context.Context, state functions.RequestState, limit uint32) ([]functions.Request, error) { ret := _m.Called(ctx, state, limit) @@ -94,6 +160,36 @@ func (_m *ORM) FindOldestEntriesByState(ctx context.Context, state functions.Req return r0, r1 } +// ORM_FindOldestEntriesByState_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindOldestEntriesByState' +type ORM_FindOldestEntriesByState_Call struct { + *mock.Call +} + +// FindOldestEntriesByState is a helper method to define mock.On call +// - ctx context.Context +// - state functions.RequestState +// - limit uint32 +func (_e *ORM_Expecter) FindOldestEntriesByState(ctx interface{}, state interface{}, limit interface{}) *ORM_FindOldestEntriesByState_Call { + return &ORM_FindOldestEntriesByState_Call{Call: _e.mock.On("FindOldestEntriesByState", ctx, state, limit)} +} + +func (_c *ORM_FindOldestEntriesByState_Call) Run(run func(ctx context.Context, state functions.RequestState, limit uint32)) *ORM_FindOldestEntriesByState_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(functions.RequestState), args[2].(uint32)) + }) + return _c +} + +func (_c *ORM_FindOldestEntriesByState_Call) Return(_a0 []functions.Request, _a1 error) *ORM_FindOldestEntriesByState_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ORM_FindOldestEntriesByState_Call) RunAndReturn(run func(context.Context, functions.RequestState, uint32) ([]functions.Request, error)) *ORM_FindOldestEntriesByState_Call { + _c.Call.Return(run) + return _c +} + // PruneOldestRequests provides a mock function with given fields: ctx, maxRequestsInDB, batchSize func (_m *ORM) PruneOldestRequests(ctx context.Context, maxRequestsInDB uint32, batchSize uint32) (uint32, uint32, error) { ret := _m.Called(ctx, maxRequestsInDB, batchSize) @@ -129,6 +225,36 @@ func (_m *ORM) PruneOldestRequests(ctx context.Context, maxRequestsInDB uint32, return r0, r1, r2 } +// ORM_PruneOldestRequests_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PruneOldestRequests' +type ORM_PruneOldestRequests_Call struct { + *mock.Call +} + +// PruneOldestRequests is a helper method to define mock.On call +// - ctx context.Context +// - maxRequestsInDB uint32 +// - batchSize uint32 +func (_e *ORM_Expecter) PruneOldestRequests(ctx interface{}, maxRequestsInDB interface{}, batchSize interface{}) *ORM_PruneOldestRequests_Call { + return &ORM_PruneOldestRequests_Call{Call: _e.mock.On("PruneOldestRequests", ctx, maxRequestsInDB, batchSize)} +} + +func (_c *ORM_PruneOldestRequests_Call) Run(run func(ctx context.Context, maxRequestsInDB uint32, batchSize uint32)) *ORM_PruneOldestRequests_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(uint32), args[2].(uint32)) + }) + return _c +} + +func (_c *ORM_PruneOldestRequests_Call) Return(total uint32, pruned uint32, err error) *ORM_PruneOldestRequests_Call { + _c.Call.Return(total, pruned, err) + return _c +} + +func (_c *ORM_PruneOldestRequests_Call) RunAndReturn(run func(context.Context, uint32, uint32) (uint32, uint32, error)) *ORM_PruneOldestRequests_Call { + _c.Call.Return(run) + return _c +} + // SetConfirmed provides a mock function with given fields: ctx, requestID func (_m *ORM) SetConfirmed(ctx context.Context, requestID functions.RequestID) error { ret := _m.Called(ctx, requestID) @@ -147,6 +273,35 @@ func (_m *ORM) SetConfirmed(ctx context.Context, requestID functions.RequestID) return r0 } +// ORM_SetConfirmed_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetConfirmed' +type ORM_SetConfirmed_Call struct { + *mock.Call +} + +// SetConfirmed is a helper method to define mock.On call +// - ctx context.Context +// - requestID functions.RequestID +func (_e *ORM_Expecter) SetConfirmed(ctx interface{}, requestID interface{}) *ORM_SetConfirmed_Call { + return &ORM_SetConfirmed_Call{Call: _e.mock.On("SetConfirmed", ctx, requestID)} +} + +func (_c *ORM_SetConfirmed_Call) Run(run func(ctx context.Context, requestID functions.RequestID)) *ORM_SetConfirmed_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(functions.RequestID)) + }) + return _c +} + +func (_c *ORM_SetConfirmed_Call) Return(_a0 error) *ORM_SetConfirmed_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ORM_SetConfirmed_Call) RunAndReturn(run func(context.Context, functions.RequestID) error) *ORM_SetConfirmed_Call { + _c.Call.Return(run) + return _c +} + // SetError provides a mock function with given fields: ctx, requestID, errorType, computationError, readyAt, readyForProcessing func (_m *ORM) SetError(ctx context.Context, requestID functions.RequestID, errorType functions.ErrType, computationError []byte, readyAt time.Time, readyForProcessing bool) error { ret := _m.Called(ctx, requestID, errorType, computationError, readyAt, readyForProcessing) @@ -165,6 +320,39 @@ func (_m *ORM) SetError(ctx context.Context, requestID functions.RequestID, erro return r0 } +// ORM_SetError_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetError' +type ORM_SetError_Call struct { + *mock.Call +} + +// SetError is a helper method to define mock.On call +// - ctx context.Context +// - requestID functions.RequestID +// - errorType functions.ErrType +// - computationError []byte +// - readyAt time.Time +// - readyForProcessing bool +func (_e *ORM_Expecter) SetError(ctx interface{}, requestID interface{}, errorType interface{}, computationError interface{}, readyAt interface{}, readyForProcessing interface{}) *ORM_SetError_Call { + return &ORM_SetError_Call{Call: _e.mock.On("SetError", ctx, requestID, errorType, computationError, readyAt, readyForProcessing)} +} + +func (_c *ORM_SetError_Call) Run(run func(ctx context.Context, requestID functions.RequestID, errorType functions.ErrType, computationError []byte, readyAt time.Time, readyForProcessing bool)) *ORM_SetError_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(functions.RequestID), args[2].(functions.ErrType), args[3].([]byte), args[4].(time.Time), args[5].(bool)) + }) + return _c +} + +func (_c *ORM_SetError_Call) Return(_a0 error) *ORM_SetError_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ORM_SetError_Call) RunAndReturn(run func(context.Context, functions.RequestID, functions.ErrType, []byte, time.Time, bool) error) *ORM_SetError_Call { + _c.Call.Return(run) + return _c +} + // SetFinalized provides a mock function with given fields: ctx, requestID, reportedResult, reportedError func (_m *ORM) SetFinalized(ctx context.Context, requestID functions.RequestID, reportedResult []byte, reportedError []byte) error { ret := _m.Called(ctx, requestID, reportedResult, reportedError) @@ -183,6 +371,37 @@ func (_m *ORM) SetFinalized(ctx context.Context, requestID functions.RequestID, return r0 } +// ORM_SetFinalized_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetFinalized' +type ORM_SetFinalized_Call struct { + *mock.Call +} + +// SetFinalized is a helper method to define mock.On call +// - ctx context.Context +// - requestID functions.RequestID +// - reportedResult []byte +// - reportedError []byte +func (_e *ORM_Expecter) SetFinalized(ctx interface{}, requestID interface{}, reportedResult interface{}, reportedError interface{}) *ORM_SetFinalized_Call { + return &ORM_SetFinalized_Call{Call: _e.mock.On("SetFinalized", ctx, requestID, reportedResult, reportedError)} +} + +func (_c *ORM_SetFinalized_Call) Run(run func(ctx context.Context, requestID functions.RequestID, reportedResult []byte, reportedError []byte)) *ORM_SetFinalized_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(functions.RequestID), args[2].([]byte), args[3].([]byte)) + }) + return _c +} + +func (_c *ORM_SetFinalized_Call) Return(_a0 error) *ORM_SetFinalized_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ORM_SetFinalized_Call) RunAndReturn(run func(context.Context, functions.RequestID, []byte, []byte) error) *ORM_SetFinalized_Call { + _c.Call.Return(run) + return _c +} + // SetResult provides a mock function with given fields: ctx, requestID, computationResult, readyAt func (_m *ORM) SetResult(ctx context.Context, requestID functions.RequestID, computationResult []byte, readyAt time.Time) error { ret := _m.Called(ctx, requestID, computationResult, readyAt) @@ -201,6 +420,37 @@ func (_m *ORM) SetResult(ctx context.Context, requestID functions.RequestID, com return r0 } +// ORM_SetResult_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetResult' +type ORM_SetResult_Call struct { + *mock.Call +} + +// SetResult is a helper method to define mock.On call +// - ctx context.Context +// - requestID functions.RequestID +// - computationResult []byte +// - readyAt time.Time +func (_e *ORM_Expecter) SetResult(ctx interface{}, requestID interface{}, computationResult interface{}, readyAt interface{}) *ORM_SetResult_Call { + return &ORM_SetResult_Call{Call: _e.mock.On("SetResult", ctx, requestID, computationResult, readyAt)} +} + +func (_c *ORM_SetResult_Call) Run(run func(ctx context.Context, requestID functions.RequestID, computationResult []byte, readyAt time.Time)) *ORM_SetResult_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(functions.RequestID), args[2].([]byte), args[3].(time.Time)) + }) + return _c +} + +func (_c *ORM_SetResult_Call) Return(_a0 error) *ORM_SetResult_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ORM_SetResult_Call) RunAndReturn(run func(context.Context, functions.RequestID, []byte, time.Time) error) *ORM_SetResult_Call { + _c.Call.Return(run) + return _c +} + // TimeoutExpiredResults provides a mock function with given fields: ctx, cutoff, limit func (_m *ORM) TimeoutExpiredResults(ctx context.Context, cutoff time.Time, limit uint32) ([]functions.RequestID, error) { ret := _m.Called(ctx, cutoff, limit) @@ -231,6 +481,36 @@ func (_m *ORM) TimeoutExpiredResults(ctx context.Context, cutoff time.Time, limi return r0, r1 } +// ORM_TimeoutExpiredResults_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TimeoutExpiredResults' +type ORM_TimeoutExpiredResults_Call struct { + *mock.Call +} + +// TimeoutExpiredResults is a helper method to define mock.On call +// - ctx context.Context +// - cutoff time.Time +// - limit uint32 +func (_e *ORM_Expecter) TimeoutExpiredResults(ctx interface{}, cutoff interface{}, limit interface{}) *ORM_TimeoutExpiredResults_Call { + return &ORM_TimeoutExpiredResults_Call{Call: _e.mock.On("TimeoutExpiredResults", ctx, cutoff, limit)} +} + +func (_c *ORM_TimeoutExpiredResults_Call) Run(run func(ctx context.Context, cutoff time.Time, limit uint32)) *ORM_TimeoutExpiredResults_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(time.Time), args[2].(uint32)) + }) + return _c +} + +func (_c *ORM_TimeoutExpiredResults_Call) Return(_a0 []functions.RequestID, _a1 error) *ORM_TimeoutExpiredResults_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ORM_TimeoutExpiredResults_Call) RunAndReturn(run func(context.Context, time.Time, uint32) ([]functions.RequestID, error)) *ORM_TimeoutExpiredResults_Call { + _c.Call.Return(run) + return _c +} + // NewORM creates a new instance of ORM. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewORM(t interface { diff --git a/core/services/functions/offchain_transmitter.go b/core/services/functions/offchain_transmitter.go index 63527937f92..b35a0985d66 100644 --- a/core/services/functions/offchain_transmitter.go +++ b/core/services/functions/offchain_transmitter.go @@ -8,8 +8,6 @@ import ( // Simple wrapper around a channel to transmit offchain reports between // OCR plugin and Gateway connector -// -//go:generate mockery --quiet --name OffchainTransmitter --output ./mocks/ --case=underscore type OffchainTransmitter interface { TransmitReport(ctx context.Context, report *OffchainResponse) error ReportChannel() chan *OffchainResponse diff --git a/core/services/functions/orm.go b/core/services/functions/orm.go index f45effa9354..7e8cc6fbc8f 100644 --- a/core/services/functions/orm.go +++ b/core/services/functions/orm.go @@ -12,8 +12,6 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/sqlutil" ) -//go:generate mockery --quiet --name ORM --output ./mocks/ --case=underscore - type ORM interface { CreateRequest(ctx context.Context, request *Request) error diff --git a/core/services/gateway/api/message.go b/core/services/gateway/api/message.go index 5e6c8e49247..86813c26b35 100644 --- a/core/services/gateway/api/message.go +++ b/core/services/gateway/api/message.go @@ -93,7 +93,7 @@ func (m *Message) Sign(privateKey *ecdsa.PrivateKey) error { if m == nil { return errors.New("nil message") } - rawData := getRawMessageBody(&m.Body) + rawData := GetRawMessageBody(&m.Body) signature, err := gw_common.SignData(privateKey, rawData...) if err != nil { return err @@ -107,7 +107,7 @@ func (m *Message) ExtractSigner() (signerAddress []byte, err error) { if m == nil { return nil, errors.New("nil message") } - rawData := getRawMessageBody(&m.Body) + rawData := GetRawMessageBody(&m.Body) signatureBytes, err := hex.DecodeString(m.Signature) if err != nil { return nil, err @@ -115,7 +115,7 @@ func (m *Message) ExtractSigner() (signerAddress []byte, err error) { return gw_common.ExtractSigner(signatureBytes, rawData...) } -func getRawMessageBody(msgBody *MessageBody) [][]byte { +func GetRawMessageBody(msgBody *MessageBody) [][]byte { alignedMessageId := make([]byte, MessageIdMaxLen) copy(alignedMessageId, msgBody.MessageId) alignedMethod := make([]byte, MessageMethodMaxLen) diff --git a/core/services/gateway/connector/connector.go b/core/services/gateway/connector/connector.go index 4e9de2df40e..7d964494e0a 100644 --- a/core/services/gateway/connector/connector.go +++ b/core/services/gateway/connector/connector.go @@ -21,16 +21,20 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/utils" ) -//go:generate mockery --quiet --name GatewayConnector --output ./mocks/ --case=underscore -//go:generate mockery --quiet --name Signer --output ./mocks/ --case=underscore -//go:generate mockery --quiet --name GatewayConnectorHandler --output ./mocks/ --case=underscore - // GatewayConnector is a component run by Nodes to connect to a set of Gateways. type GatewayConnector interface { job.ServiceCtx network.ConnectionInitiator + AddHandler(methods []string, handler GatewayConnectorHandler) error + // SendToGateway takes a signed message as argument and sends it to the specified gateway SendToGateway(ctx context.Context, gatewayId string, msg *api.Message) error + // SignAndSendToGateway signs the message and sends the message to the specified gateway + SignAndSendToGateway(ctx context.Context, gatewayID string, msg *api.MessageBody) error + // GatewayIDs returns the list of Gateway IDs + GatewayIDs() []string + // DonID returns the DON ID + DonID() string } // Signer implementation needs to be provided by a GatewayConnector user (node) @@ -55,7 +59,7 @@ type gatewayConnector struct { clock clockwork.Clock nodeAddress []byte signer Signer - handler GatewayConnectorHandler + handlers map[string]GatewayConnectorHandler gateways map[string]*gatewayState urlToId map[string]string closeWait sync.WaitGroup @@ -80,8 +84,8 @@ type gatewayState struct { wsClient network.WebSocketClient } -func NewGatewayConnector(config *ConnectorConfig, signer Signer, handler GatewayConnectorHandler, clock clockwork.Clock, lggr logger.Logger) (GatewayConnector, error) { - if config == nil || signer == nil || handler == nil || clock == nil || lggr == nil { +func NewGatewayConnector(config *ConnectorConfig, signer Signer, clock clockwork.Clock, lggr logger.Logger) (GatewayConnector, error) { + if config == nil || signer == nil || clock == nil || lggr == nil { return nil, errors.New("nil dependency") } if len(config.DonId) == 0 || len(config.DonId) > network.HandshakeDonIdLen { @@ -97,7 +101,7 @@ func NewGatewayConnector(config *ConnectorConfig, signer Signer, handler Gateway clock: clock, nodeAddress: addressBytes, signer: signer, - handler: handler, + handlers: make(map[string]GatewayConnectorHandler), shutdownCh: make(chan struct{}), lggr: lggr.Named("GatewayConnector"), } @@ -115,8 +119,9 @@ func NewGatewayConnector(config *ConnectorConfig, signer Signer, handler Gateway if err != nil { return nil, err } + l := lggr.With("URL", parsedURL) gateway := &gatewayState{ - conn: network.NewWSConnectionWrapper(lggr), + conn: network.NewWSConnectionWrapper(l), config: gw, url: parsedURL, wsClient: network.NewWebSocketClient(config.WsClientConfig, connector, lggr), @@ -129,6 +134,22 @@ func NewGatewayConnector(config *ConnectorConfig, signer Signer, handler Gateway return connector, nil } +func (c *gatewayConnector) AddHandler(methods []string, handler GatewayConnectorHandler) error { + if handler == nil { + return errors.New("cannot add a nil handler") + } + for _, method := range methods { + if _, exists := c.handlers[method]; exists { + return fmt.Errorf("handler for method %s already exists", method) + } + } + // add all or nothing + for _, method := range methods { + c.handlers[method] = handler + } + return nil +} + func (c *gatewayConnector) SendToGateway(ctx context.Context, gatewayId string, msg *api.Message) error { data, err := c.codec.EncodeResponse(msg) if err != nil { @@ -144,6 +165,41 @@ func (c *gatewayConnector) SendToGateway(ctx context.Context, gatewayId string, return gateway.conn.Write(ctx, websocket.BinaryMessage, data) } +func (c *gatewayConnector) SignAndSendToGateway(ctx context.Context, gatewayID string, body *api.MessageBody) error { + signature, err := c.signer.Sign(api.GetRawMessageBody(body)...) + if err != nil { + return err + } + msg := &api.Message{ + Body: api.MessageBody{ + MessageId: body.MessageId, + DonId: body.DonId, + Method: body.Method, + Payload: body.Payload, + Sender: utils.StringToHex(string(c.nodeAddress)), + }, + Signature: utils.StringToHex(string(signature)), + } + + err = c.SendToGateway(ctx, gatewayID, msg) + if err != nil { + return fmt.Errorf("failed to send message to gateway %s: %v", gatewayID, err) + } + return nil +} + +func (c *gatewayConnector) GatewayIDs() []string { + var gids []string + for gid := range c.gateways { + gids = append(gids, gid) + } + return gids +} + +func (c *gatewayConnector) DonID() string { + return c.config.DonId +} + func (c *gatewayConnector) readLoop(gatewayState *gatewayState) { ctx, cancel := c.shutdownCh.NewCtx() defer cancel() @@ -163,7 +219,12 @@ func (c *gatewayConnector) readLoop(gatewayState *gatewayState) { c.lggr.Errorw("failed to validate message signature", "id", gatewayState.config.Id, "err", err) break } - c.handler.HandleGatewayMessage(ctx, gatewayState.config.Id, msg) + handler, exists := c.handlers[msg.Body.Method] + if !exists { + c.lggr.Errorw("no handler for method", "id", gatewayState.config.Id, "method", msg.Body.Method) + break + } + handler.HandleGatewayMessage(ctx, gatewayState.config.Id, msg) } } } @@ -198,9 +259,6 @@ func (c *gatewayConnector) reconnectLoop(gatewayState *gatewayState) { func (c *gatewayConnector) Start(ctx context.Context) error { return c.StartOnce("GatewayConnector", func() error { c.lggr.Info("starting gateway connector") - if err := c.handler.Start(ctx); err != nil { - return err - } for _, gatewayState := range c.gateways { gatewayState := gatewayState if err := gatewayState.conn.Start(ctx); err != nil { @@ -218,11 +276,12 @@ func (c *gatewayConnector) Close() error { return c.StopOnce("GatewayConnector", func() (err error) { c.lggr.Info("closing gateway connector") close(c.shutdownCh) + var errs error for _, gatewayState := range c.gateways { - gatewayState.conn.Close() + errs = errors.Join(errs, gatewayState.conn.Close()) } c.closeWait.Wait() - return c.handler.Close() + return errs }) } diff --git a/core/services/gateway/connector/connector_test.go b/core/services/gateway/connector/connector_test.go index 3dd782c626a..16520a42f41 100644 --- a/core/services/gateway/connector/connector_test.go +++ b/core/services/gateway/connector/connector_test.go @@ -18,7 +18,8 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/gateway/network" ) -const defaultConfig = ` +const ( + defaultConfig = ` NodeAddress = "0x68902d681c28119f9b2531473a417088bf008e59" DonId = "example_don" AuthMinChallengeLen = 10 @@ -32,6 +33,9 @@ URL = "ws://localhost:8081/node" Id = "another_one" URL = "wss://example.com:8090/node_endpoint" ` + testMethod1 = "test_method_1" + testMethod2 = "test_method_2" +) func parseTOMLConfig(t *testing.T, tomlConfig string) *connector.ConnectorConfig { var cfg connector.ConnectorConfig @@ -40,12 +44,13 @@ func parseTOMLConfig(t *testing.T, tomlConfig string) *connector.ConnectorConfig return &cfg } -func newTestConnector(t *testing.T, config *connector.ConnectorConfig, now time.Time) (connector.GatewayConnector, *mocks.Signer, *mocks.GatewayConnectorHandler) { +func newTestConnector(t *testing.T, config *connector.ConnectorConfig) (connector.GatewayConnector, *mocks.Signer, *mocks.GatewayConnectorHandler) { signer := mocks.NewSigner(t) handler := mocks.NewGatewayConnectorHandler(t) clock := clockwork.NewFakeClock() - connector, err := connector.NewGatewayConnector(config, signer, handler, clock, logger.TestLogger(t)) + connector, err := connector.NewGatewayConnector(config, signer, clock, logger.TestLogger(t)) require.NoError(t, err) + require.NoError(t, connector.AddHandler([]string{testMethod1}, handler)) return connector, signer, handler } @@ -61,7 +66,7 @@ Id = "example_gateway" URL = "ws://localhost:8081/node" `) - newTestConnector(t, tomlConfig, time.Now()) + newTestConnector(t, tomlConfig) } func TestGatewayConnector_NewGatewayConnector_InvalidConfig(t *testing.T) { @@ -103,12 +108,11 @@ URL = "ws://localhost:8081/node" } signer := mocks.NewSigner(t) - handler := mocks.NewGatewayConnectorHandler(t) clock := clockwork.NewFakeClock() for name, config := range invalidCases { config := config t.Run(name, func(t *testing.T) { - _, err := connector.NewGatewayConnector(parseTOMLConfig(t, config), signer, handler, clock, logger.TestLogger(t)) + _, err := connector.NewGatewayConnector(parseTOMLConfig(t, config), signer, clock, logger.TestLogger(t)) require.Error(t, err) }) } @@ -117,9 +121,7 @@ URL = "ws://localhost:8081/node" func TestGatewayConnector_CleanStartAndClose(t *testing.T) { t.Parallel() - connector, signer, handler := newTestConnector(t, parseTOMLConfig(t, defaultConfig), time.Now()) - handler.On("Start", mock.Anything).Return(nil) - handler.On("Close").Return(nil) + connector, signer, _ := newTestConnector(t, parseTOMLConfig(t, defaultConfig)) signer.On("Sign", mock.Anything).Return(nil, errors.New("cannot sign")) servicetest.Run(t, connector) } @@ -127,7 +129,7 @@ func TestGatewayConnector_CleanStartAndClose(t *testing.T) { func TestGatewayConnector_NewAuthHeader_SignerError(t *testing.T) { t.Parallel() - connector, signer, _ := newTestConnector(t, parseTOMLConfig(t, defaultConfig), time.Now()) + connector, signer, _ := newTestConnector(t, parseTOMLConfig(t, defaultConfig)) signer.On("Sign", mock.Anything).Return(nil, errors.New("cannot sign")) url, err := url.Parse("ws://localhost:8081/node") @@ -141,7 +143,7 @@ func TestGatewayConnector_NewAuthHeader_Success(t *testing.T) { testSignature := make([]byte, network.HandshakeSignatureLen) testSignature[1] = 0xfa - connector, signer, _ := newTestConnector(t, parseTOMLConfig(t, defaultConfig), time.Now()) + connector, signer, _ := newTestConnector(t, parseTOMLConfig(t, defaultConfig)) signer.On("Sign", mock.Anything).Return(testSignature, nil) url, err := url.Parse("ws://localhost:8081/node") require.NoError(t, err) @@ -157,7 +159,7 @@ func TestGatewayConnector_ChallengeResponse(t *testing.T) { testSignature := make([]byte, network.HandshakeSignatureLen) testSignature[1] = 0xfa now := time.Now() - connector, signer, _ := newTestConnector(t, parseTOMLConfig(t, defaultConfig), now) + connector, signer, _ := newTestConnector(t, parseTOMLConfig(t, defaultConfig)) signer.On("Sign", mock.Anything).Return(testSignature, nil) url, err := url.Parse("ws://localhost:8081/node") require.NoError(t, err) @@ -191,3 +193,12 @@ func TestGatewayConnector_ChallengeResponse(t *testing.T) { _, err = connector.ChallengeResponse(url, network.PackChallenge(&badChallenge)) require.Equal(t, network.ErrAuthInvalidGateway, err) } + +func TestGatewayConnector_AddHandler(t *testing.T) { + t.Parallel() + + connector, _, _ := newTestConnector(t, parseTOMLConfig(t, defaultConfig)) + // testMethod1 already exists + require.Error(t, connector.AddHandler([]string{testMethod1}, mocks.NewGatewayConnectorHandler(t))) + require.NoError(t, connector.AddHandler([]string{testMethod2}, mocks.NewGatewayConnectorHandler(t))) +} diff --git a/core/services/gateway/connector/mocks/gateway_connector.go b/core/services/gateway/connector/mocks/gateway_connector.go index 41e3148d05a..9cb5632b313 100644 --- a/core/services/gateway/connector/mocks/gateway_connector.go +++ b/core/services/gateway/connector/mocks/gateway_connector.go @@ -4,6 +4,7 @@ package mocks import ( api "github.com/smartcontractkit/chainlink/v2/core/services/gateway/api" + connector "github.com/smartcontractkit/chainlink/v2/core/services/gateway/connector" context "context" @@ -17,6 +18,61 @@ type GatewayConnector struct { mock.Mock } +type GatewayConnector_Expecter struct { + mock *mock.Mock +} + +func (_m *GatewayConnector) EXPECT() *GatewayConnector_Expecter { + return &GatewayConnector_Expecter{mock: &_m.Mock} +} + +// AddHandler provides a mock function with given fields: methods, handler +func (_m *GatewayConnector) AddHandler(methods []string, handler connector.GatewayConnectorHandler) error { + ret := _m.Called(methods, handler) + + if len(ret) == 0 { + panic("no return value specified for AddHandler") + } + + var r0 error + if rf, ok := ret.Get(0).(func([]string, connector.GatewayConnectorHandler) error); ok { + r0 = rf(methods, handler) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// GatewayConnector_AddHandler_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddHandler' +type GatewayConnector_AddHandler_Call struct { + *mock.Call +} + +// AddHandler is a helper method to define mock.On call +// - methods []string +// - handler connector.GatewayConnectorHandler +func (_e *GatewayConnector_Expecter) AddHandler(methods interface{}, handler interface{}) *GatewayConnector_AddHandler_Call { + return &GatewayConnector_AddHandler_Call{Call: _e.mock.On("AddHandler", methods, handler)} +} + +func (_c *GatewayConnector_AddHandler_Call) Run(run func(methods []string, handler connector.GatewayConnectorHandler)) *GatewayConnector_AddHandler_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].([]string), args[1].(connector.GatewayConnectorHandler)) + }) + return _c +} + +func (_c *GatewayConnector_AddHandler_Call) Return(_a0 error) *GatewayConnector_AddHandler_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *GatewayConnector_AddHandler_Call) RunAndReturn(run func([]string, connector.GatewayConnectorHandler) error) *GatewayConnector_AddHandler_Call { + _c.Call.Return(run) + return _c +} + // ChallengeResponse provides a mock function with given fields: _a0, challenge func (_m *GatewayConnector) ChallengeResponse(_a0 *url.URL, challenge []byte) ([]byte, error) { ret := _m.Called(_a0, challenge) @@ -47,6 +103,35 @@ func (_m *GatewayConnector) ChallengeResponse(_a0 *url.URL, challenge []byte) ([ return r0, r1 } +// GatewayConnector_ChallengeResponse_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ChallengeResponse' +type GatewayConnector_ChallengeResponse_Call struct { + *mock.Call +} + +// ChallengeResponse is a helper method to define mock.On call +// - _a0 *url.URL +// - challenge []byte +func (_e *GatewayConnector_Expecter) ChallengeResponse(_a0 interface{}, challenge interface{}) *GatewayConnector_ChallengeResponse_Call { + return &GatewayConnector_ChallengeResponse_Call{Call: _e.mock.On("ChallengeResponse", _a0, challenge)} +} + +func (_c *GatewayConnector_ChallengeResponse_Call) Run(run func(_a0 *url.URL, challenge []byte)) *GatewayConnector_ChallengeResponse_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*url.URL), args[1].([]byte)) + }) + return _c +} + +func (_c *GatewayConnector_ChallengeResponse_Call) Return(_a0 []byte, _a1 error) *GatewayConnector_ChallengeResponse_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *GatewayConnector_ChallengeResponse_Call) RunAndReturn(run func(*url.URL, []byte) ([]byte, error)) *GatewayConnector_ChallengeResponse_Call { + _c.Call.Return(run) + return _c +} + // Close provides a mock function with given fields: func (_m *GatewayConnector) Close() error { ret := _m.Called() @@ -65,6 +150,125 @@ func (_m *GatewayConnector) Close() error { return r0 } +// GatewayConnector_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close' +type GatewayConnector_Close_Call struct { + *mock.Call +} + +// Close is a helper method to define mock.On call +func (_e *GatewayConnector_Expecter) Close() *GatewayConnector_Close_Call { + return &GatewayConnector_Close_Call{Call: _e.mock.On("Close")} +} + +func (_c *GatewayConnector_Close_Call) Run(run func()) *GatewayConnector_Close_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *GatewayConnector_Close_Call) Return(_a0 error) *GatewayConnector_Close_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *GatewayConnector_Close_Call) RunAndReturn(run func() error) *GatewayConnector_Close_Call { + _c.Call.Return(run) + return _c +} + +// DonID provides a mock function with given fields: +func (_m *GatewayConnector) DonID() string { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for DonID") + } + + var r0 string + if rf, ok := ret.Get(0).(func() string); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// GatewayConnector_DonID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DonID' +type GatewayConnector_DonID_Call struct { + *mock.Call +} + +// DonID is a helper method to define mock.On call +func (_e *GatewayConnector_Expecter) DonID() *GatewayConnector_DonID_Call { + return &GatewayConnector_DonID_Call{Call: _e.mock.On("DonID")} +} + +func (_c *GatewayConnector_DonID_Call) Run(run func()) *GatewayConnector_DonID_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *GatewayConnector_DonID_Call) Return(_a0 string) *GatewayConnector_DonID_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *GatewayConnector_DonID_Call) RunAndReturn(run func() string) *GatewayConnector_DonID_Call { + _c.Call.Return(run) + return _c +} + +// GatewayIDs provides a mock function with given fields: +func (_m *GatewayConnector) GatewayIDs() []string { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GatewayIDs") + } + + var r0 []string + if rf, ok := ret.Get(0).(func() []string); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]string) + } + } + + return r0 +} + +// GatewayConnector_GatewayIDs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GatewayIDs' +type GatewayConnector_GatewayIDs_Call struct { + *mock.Call +} + +// GatewayIDs is a helper method to define mock.On call +func (_e *GatewayConnector_Expecter) GatewayIDs() *GatewayConnector_GatewayIDs_Call { + return &GatewayConnector_GatewayIDs_Call{Call: _e.mock.On("GatewayIDs")} +} + +func (_c *GatewayConnector_GatewayIDs_Call) Run(run func()) *GatewayConnector_GatewayIDs_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *GatewayConnector_GatewayIDs_Call) Return(_a0 []string) *GatewayConnector_GatewayIDs_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *GatewayConnector_GatewayIDs_Call) RunAndReturn(run func() []string) *GatewayConnector_GatewayIDs_Call { + _c.Call.Return(run) + return _c +} + // NewAuthHeader provides a mock function with given fields: _a0 func (_m *GatewayConnector) NewAuthHeader(_a0 *url.URL) ([]byte, error) { ret := _m.Called(_a0) @@ -95,6 +299,34 @@ func (_m *GatewayConnector) NewAuthHeader(_a0 *url.URL) ([]byte, error) { return r0, r1 } +// GatewayConnector_NewAuthHeader_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NewAuthHeader' +type GatewayConnector_NewAuthHeader_Call struct { + *mock.Call +} + +// NewAuthHeader is a helper method to define mock.On call +// - _a0 *url.URL +func (_e *GatewayConnector_Expecter) NewAuthHeader(_a0 interface{}) *GatewayConnector_NewAuthHeader_Call { + return &GatewayConnector_NewAuthHeader_Call{Call: _e.mock.On("NewAuthHeader", _a0)} +} + +func (_c *GatewayConnector_NewAuthHeader_Call) Run(run func(_a0 *url.URL)) *GatewayConnector_NewAuthHeader_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*url.URL)) + }) + return _c +} + +func (_c *GatewayConnector_NewAuthHeader_Call) Return(_a0 []byte, _a1 error) *GatewayConnector_NewAuthHeader_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *GatewayConnector_NewAuthHeader_Call) RunAndReturn(run func(*url.URL) ([]byte, error)) *GatewayConnector_NewAuthHeader_Call { + _c.Call.Return(run) + return _c +} + // SendToGateway provides a mock function with given fields: ctx, gatewayId, msg func (_m *GatewayConnector) SendToGateway(ctx context.Context, gatewayId string, msg *api.Message) error { ret := _m.Called(ctx, gatewayId, msg) @@ -113,6 +345,84 @@ func (_m *GatewayConnector) SendToGateway(ctx context.Context, gatewayId string, return r0 } +// GatewayConnector_SendToGateway_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SendToGateway' +type GatewayConnector_SendToGateway_Call struct { + *mock.Call +} + +// SendToGateway is a helper method to define mock.On call +// - ctx context.Context +// - gatewayId string +// - msg *api.Message +func (_e *GatewayConnector_Expecter) SendToGateway(ctx interface{}, gatewayId interface{}, msg interface{}) *GatewayConnector_SendToGateway_Call { + return &GatewayConnector_SendToGateway_Call{Call: _e.mock.On("SendToGateway", ctx, gatewayId, msg)} +} + +func (_c *GatewayConnector_SendToGateway_Call) Run(run func(ctx context.Context, gatewayId string, msg *api.Message)) *GatewayConnector_SendToGateway_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(*api.Message)) + }) + return _c +} + +func (_c *GatewayConnector_SendToGateway_Call) Return(_a0 error) *GatewayConnector_SendToGateway_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *GatewayConnector_SendToGateway_Call) RunAndReturn(run func(context.Context, string, *api.Message) error) *GatewayConnector_SendToGateway_Call { + _c.Call.Return(run) + return _c +} + +// SignAndSendToGateway provides a mock function with given fields: ctx, gatewayID, msg +func (_m *GatewayConnector) SignAndSendToGateway(ctx context.Context, gatewayID string, msg *api.MessageBody) error { + ret := _m.Called(ctx, gatewayID, msg) + + if len(ret) == 0 { + panic("no return value specified for SignAndSendToGateway") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, string, *api.MessageBody) error); ok { + r0 = rf(ctx, gatewayID, msg) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// GatewayConnector_SignAndSendToGateway_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SignAndSendToGateway' +type GatewayConnector_SignAndSendToGateway_Call struct { + *mock.Call +} + +// SignAndSendToGateway is a helper method to define mock.On call +// - ctx context.Context +// - gatewayID string +// - msg *api.MessageBody +func (_e *GatewayConnector_Expecter) SignAndSendToGateway(ctx interface{}, gatewayID interface{}, msg interface{}) *GatewayConnector_SignAndSendToGateway_Call { + return &GatewayConnector_SignAndSendToGateway_Call{Call: _e.mock.On("SignAndSendToGateway", ctx, gatewayID, msg)} +} + +func (_c *GatewayConnector_SignAndSendToGateway_Call) Run(run func(ctx context.Context, gatewayID string, msg *api.MessageBody)) *GatewayConnector_SignAndSendToGateway_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(*api.MessageBody)) + }) + return _c +} + +func (_c *GatewayConnector_SignAndSendToGateway_Call) Return(_a0 error) *GatewayConnector_SignAndSendToGateway_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *GatewayConnector_SignAndSendToGateway_Call) RunAndReturn(run func(context.Context, string, *api.MessageBody) error) *GatewayConnector_SignAndSendToGateway_Call { + _c.Call.Return(run) + return _c +} + // Start provides a mock function with given fields: _a0 func (_m *GatewayConnector) Start(_a0 context.Context) error { ret := _m.Called(_a0) @@ -131,6 +441,34 @@ func (_m *GatewayConnector) Start(_a0 context.Context) error { return r0 } +// GatewayConnector_Start_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Start' +type GatewayConnector_Start_Call struct { + *mock.Call +} + +// Start is a helper method to define mock.On call +// - _a0 context.Context +func (_e *GatewayConnector_Expecter) Start(_a0 interface{}) *GatewayConnector_Start_Call { + return &GatewayConnector_Start_Call{Call: _e.mock.On("Start", _a0)} +} + +func (_c *GatewayConnector_Start_Call) Run(run func(_a0 context.Context)) *GatewayConnector_Start_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *GatewayConnector_Start_Call) Return(_a0 error) *GatewayConnector_Start_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *GatewayConnector_Start_Call) RunAndReturn(run func(context.Context) error) *GatewayConnector_Start_Call { + _c.Call.Return(run) + return _c +} + // NewGatewayConnector creates a new instance of GatewayConnector. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewGatewayConnector(t interface { diff --git a/core/services/gateway/connector/mocks/gateway_connector_handler.go b/core/services/gateway/connector/mocks/gateway_connector_handler.go index a79a2d32fed..7b988a4e66a 100644 --- a/core/services/gateway/connector/mocks/gateway_connector_handler.go +++ b/core/services/gateway/connector/mocks/gateway_connector_handler.go @@ -15,6 +15,14 @@ type GatewayConnectorHandler struct { mock.Mock } +type GatewayConnectorHandler_Expecter struct { + mock *mock.Mock +} + +func (_m *GatewayConnectorHandler) EXPECT() *GatewayConnectorHandler_Expecter { + return &GatewayConnectorHandler_Expecter{mock: &_m.Mock} +} + // Close provides a mock function with given fields: func (_m *GatewayConnectorHandler) Close() error { ret := _m.Called() @@ -33,11 +41,68 @@ func (_m *GatewayConnectorHandler) Close() error { return r0 } +// GatewayConnectorHandler_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close' +type GatewayConnectorHandler_Close_Call struct { + *mock.Call +} + +// Close is a helper method to define mock.On call +func (_e *GatewayConnectorHandler_Expecter) Close() *GatewayConnectorHandler_Close_Call { + return &GatewayConnectorHandler_Close_Call{Call: _e.mock.On("Close")} +} + +func (_c *GatewayConnectorHandler_Close_Call) Run(run func()) *GatewayConnectorHandler_Close_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *GatewayConnectorHandler_Close_Call) Return(_a0 error) *GatewayConnectorHandler_Close_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *GatewayConnectorHandler_Close_Call) RunAndReturn(run func() error) *GatewayConnectorHandler_Close_Call { + _c.Call.Return(run) + return _c +} + // HandleGatewayMessage provides a mock function with given fields: ctx, gatewayId, msg func (_m *GatewayConnectorHandler) HandleGatewayMessage(ctx context.Context, gatewayId string, msg *api.Message) { _m.Called(ctx, gatewayId, msg) } +// GatewayConnectorHandler_HandleGatewayMessage_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HandleGatewayMessage' +type GatewayConnectorHandler_HandleGatewayMessage_Call struct { + *mock.Call +} + +// HandleGatewayMessage is a helper method to define mock.On call +// - ctx context.Context +// - gatewayId string +// - msg *api.Message +func (_e *GatewayConnectorHandler_Expecter) HandleGatewayMessage(ctx interface{}, gatewayId interface{}, msg interface{}) *GatewayConnectorHandler_HandleGatewayMessage_Call { + return &GatewayConnectorHandler_HandleGatewayMessage_Call{Call: _e.mock.On("HandleGatewayMessage", ctx, gatewayId, msg)} +} + +func (_c *GatewayConnectorHandler_HandleGatewayMessage_Call) Run(run func(ctx context.Context, gatewayId string, msg *api.Message)) *GatewayConnectorHandler_HandleGatewayMessage_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(*api.Message)) + }) + return _c +} + +func (_c *GatewayConnectorHandler_HandleGatewayMessage_Call) Return() *GatewayConnectorHandler_HandleGatewayMessage_Call { + _c.Call.Return() + return _c +} + +func (_c *GatewayConnectorHandler_HandleGatewayMessage_Call) RunAndReturn(run func(context.Context, string, *api.Message)) *GatewayConnectorHandler_HandleGatewayMessage_Call { + _c.Call.Return(run) + return _c +} + // Start provides a mock function with given fields: _a0 func (_m *GatewayConnectorHandler) Start(_a0 context.Context) error { ret := _m.Called(_a0) @@ -56,6 +121,34 @@ func (_m *GatewayConnectorHandler) Start(_a0 context.Context) error { return r0 } +// GatewayConnectorHandler_Start_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Start' +type GatewayConnectorHandler_Start_Call struct { + *mock.Call +} + +// Start is a helper method to define mock.On call +// - _a0 context.Context +func (_e *GatewayConnectorHandler_Expecter) Start(_a0 interface{}) *GatewayConnectorHandler_Start_Call { + return &GatewayConnectorHandler_Start_Call{Call: _e.mock.On("Start", _a0)} +} + +func (_c *GatewayConnectorHandler_Start_Call) Run(run func(_a0 context.Context)) *GatewayConnectorHandler_Start_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *GatewayConnectorHandler_Start_Call) Return(_a0 error) *GatewayConnectorHandler_Start_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *GatewayConnectorHandler_Start_Call) RunAndReturn(run func(context.Context) error) *GatewayConnectorHandler_Start_Call { + _c.Call.Return(run) + return _c +} + // NewGatewayConnectorHandler creates a new instance of GatewayConnectorHandler. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewGatewayConnectorHandler(t interface { diff --git a/core/services/gateway/connector/mocks/signer.go b/core/services/gateway/connector/mocks/signer.go index c60bd9d4360..85d0d87a8a0 100644 --- a/core/services/gateway/connector/mocks/signer.go +++ b/core/services/gateway/connector/mocks/signer.go @@ -9,6 +9,14 @@ type Signer struct { mock.Mock } +type Signer_Expecter struct { + mock *mock.Mock +} + +func (_m *Signer) EXPECT() *Signer_Expecter { + return &Signer_Expecter{mock: &_m.Mock} +} + // Sign provides a mock function with given fields: data func (_m *Signer) Sign(data ...[]byte) ([]byte, error) { _va := make([]interface{}, len(data)) @@ -45,6 +53,41 @@ func (_m *Signer) Sign(data ...[]byte) ([]byte, error) { return r0, r1 } +// Signer_Sign_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Sign' +type Signer_Sign_Call struct { + *mock.Call +} + +// Sign is a helper method to define mock.On call +// - data ...[]byte +func (_e *Signer_Expecter) Sign(data ...interface{}) *Signer_Sign_Call { + return &Signer_Sign_Call{Call: _e.mock.On("Sign", + append([]interface{}{}, data...)...)} +} + +func (_c *Signer_Sign_Call) Run(run func(data ...[]byte)) *Signer_Sign_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([][]byte, len(args)-0) + for i, a := range args[0:] { + if a != nil { + variadicArgs[i] = a.([]byte) + } + } + run(variadicArgs...) + }) + return _c +} + +func (_c *Signer_Sign_Call) Return(_a0 []byte, _a1 error) *Signer_Sign_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Signer_Sign_Call) RunAndReturn(run func(...[]byte) ([]byte, error)) *Signer_Sign_Call { + _c.Call.Return(run) + return _c +} + // NewSigner creates a new instance of Signer. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewSigner(t interface { diff --git a/core/services/gateway/handler_factory.go b/core/services/gateway/handler_factory.go index ca6b98e55aa..6793350f317 100644 --- a/core/services/gateway/handler_factory.go +++ b/core/services/gateway/handler_factory.go @@ -13,8 +13,9 @@ import ( ) const ( - FunctionsHandlerType HandlerType = "functions" - DummyHandlerType HandlerType = "dummy" + FunctionsHandlerType HandlerType = "functions" + DummyHandlerType HandlerType = "dummy" + WebAPICapabilitiesType HandlerType = "web-api-capabilities" ) type handlerFactory struct { @@ -26,7 +27,11 @@ type handlerFactory struct { var _ HandlerFactory = (*handlerFactory)(nil) func NewHandlerFactory(legacyChains legacyevm.LegacyChainContainer, ds sqlutil.DataSource, lggr logger.Logger) HandlerFactory { - return &handlerFactory{legacyChains, ds, lggr} + return &handlerFactory{ + legacyChains, + ds, + lggr, + } } func (hf *handlerFactory) NewHandler(handlerType HandlerType, handlerConfig json.RawMessage, donConfig *config.DONConfig, don handlers.DON) (handlers.Handler, error) { diff --git a/core/services/gateway/handlers/functions/allowlist/allowlist.go b/core/services/gateway/handlers/functions/allowlist/allowlist.go index d180195865d..605d5df3772 100644 --- a/core/services/gateway/handlers/functions/allowlist/allowlist.go +++ b/core/services/gateway/handlers/functions/allowlist/allowlist.go @@ -49,8 +49,6 @@ type OnchainAllowlistConfig struct { // Use UpdateFromContract() for a one-time update or set OnchainAllowlistConfig.UpdateFrequencySec // for repeated updates. // All methods are thread-safe. -// -//go:generate mockery --quiet --name OnchainAllowlist --output ./mocks/ --case=underscore type OnchainAllowlist interface { job.ServiceCtx diff --git a/core/services/gateway/handlers/functions/allowlist/allowlist_test.go b/core/services/gateway/handlers/functions/allowlist/allowlist_test.go index 500985acc31..b8735bbf8af 100644 --- a/core/services/gateway/handlers/functions/allowlist/allowlist_test.go +++ b/core/services/gateway/handlers/functions/allowlist/allowlist_test.go @@ -21,7 +21,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/gateway/handlers/functions/allowlist" amocks "github.com/smartcontractkit/chainlink/v2/core/services/gateway/handlers/functions/allowlist/mocks" - "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm" + "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/codec" "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/types" ) @@ -376,7 +376,7 @@ func encodeTypeAndVersionResponse(typeAndVersion string) ([]byte, error) { codecConfig := types.CodecConfig{Configs: map[string]types.ChainCodecConfig{ codecName: {TypeABI: evmEncoderConfig}, }} - encoder, err := evm.NewCodec(codecConfig) + encoder, err := codec.NewCodec(codecConfig) if err != nil { return nil, err } diff --git a/core/services/gateway/handlers/functions/allowlist/mocks/onchain_allowlist.go b/core/services/gateway/handlers/functions/allowlist/mocks/onchain_allowlist.go index 6d7c6a25357..389880370fa 100644 --- a/core/services/gateway/handlers/functions/allowlist/mocks/onchain_allowlist.go +++ b/core/services/gateway/handlers/functions/allowlist/mocks/onchain_allowlist.go @@ -15,6 +15,14 @@ type OnchainAllowlist struct { mock.Mock } +type OnchainAllowlist_Expecter struct { + mock *mock.Mock +} + +func (_m *OnchainAllowlist) EXPECT() *OnchainAllowlist_Expecter { + return &OnchainAllowlist_Expecter{mock: &_m.Mock} +} + // Allow provides a mock function with given fields: _a0 func (_m *OnchainAllowlist) Allow(_a0 common.Address) bool { ret := _m.Called(_a0) @@ -33,6 +41,34 @@ func (_m *OnchainAllowlist) Allow(_a0 common.Address) bool { return r0 } +// OnchainAllowlist_Allow_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Allow' +type OnchainAllowlist_Allow_Call struct { + *mock.Call +} + +// Allow is a helper method to define mock.On call +// - _a0 common.Address +func (_e *OnchainAllowlist_Expecter) Allow(_a0 interface{}) *OnchainAllowlist_Allow_Call { + return &OnchainAllowlist_Allow_Call{Call: _e.mock.On("Allow", _a0)} +} + +func (_c *OnchainAllowlist_Allow_Call) Run(run func(_a0 common.Address)) *OnchainAllowlist_Allow_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(common.Address)) + }) + return _c +} + +func (_c *OnchainAllowlist_Allow_Call) Return(_a0 bool) *OnchainAllowlist_Allow_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *OnchainAllowlist_Allow_Call) RunAndReturn(run func(common.Address) bool) *OnchainAllowlist_Allow_Call { + _c.Call.Return(run) + return _c +} + // Close provides a mock function with given fields: func (_m *OnchainAllowlist) Close() error { ret := _m.Called() @@ -51,6 +87,33 @@ func (_m *OnchainAllowlist) Close() error { return r0 } +// OnchainAllowlist_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close' +type OnchainAllowlist_Close_Call struct { + *mock.Call +} + +// Close is a helper method to define mock.On call +func (_e *OnchainAllowlist_Expecter) Close() *OnchainAllowlist_Close_Call { + return &OnchainAllowlist_Close_Call{Call: _e.mock.On("Close")} +} + +func (_c *OnchainAllowlist_Close_Call) Run(run func()) *OnchainAllowlist_Close_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *OnchainAllowlist_Close_Call) Return(_a0 error) *OnchainAllowlist_Close_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *OnchainAllowlist_Close_Call) RunAndReturn(run func() error) *OnchainAllowlist_Close_Call { + _c.Call.Return(run) + return _c +} + // Start provides a mock function with given fields: _a0 func (_m *OnchainAllowlist) Start(_a0 context.Context) error { ret := _m.Called(_a0) @@ -69,6 +132,34 @@ func (_m *OnchainAllowlist) Start(_a0 context.Context) error { return r0 } +// OnchainAllowlist_Start_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Start' +type OnchainAllowlist_Start_Call struct { + *mock.Call +} + +// Start is a helper method to define mock.On call +// - _a0 context.Context +func (_e *OnchainAllowlist_Expecter) Start(_a0 interface{}) *OnchainAllowlist_Start_Call { + return &OnchainAllowlist_Start_Call{Call: _e.mock.On("Start", _a0)} +} + +func (_c *OnchainAllowlist_Start_Call) Run(run func(_a0 context.Context)) *OnchainAllowlist_Start_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *OnchainAllowlist_Start_Call) Return(_a0 error) *OnchainAllowlist_Start_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *OnchainAllowlist_Start_Call) RunAndReturn(run func(context.Context) error) *OnchainAllowlist_Start_Call { + _c.Call.Return(run) + return _c +} + // UpdateFromContract provides a mock function with given fields: ctx func (_m *OnchainAllowlist) UpdateFromContract(ctx context.Context) error { ret := _m.Called(ctx) @@ -87,6 +178,34 @@ func (_m *OnchainAllowlist) UpdateFromContract(ctx context.Context) error { return r0 } +// OnchainAllowlist_UpdateFromContract_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateFromContract' +type OnchainAllowlist_UpdateFromContract_Call struct { + *mock.Call +} + +// UpdateFromContract is a helper method to define mock.On call +// - ctx context.Context +func (_e *OnchainAllowlist_Expecter) UpdateFromContract(ctx interface{}) *OnchainAllowlist_UpdateFromContract_Call { + return &OnchainAllowlist_UpdateFromContract_Call{Call: _e.mock.On("UpdateFromContract", ctx)} +} + +func (_c *OnchainAllowlist_UpdateFromContract_Call) Run(run func(ctx context.Context)) *OnchainAllowlist_UpdateFromContract_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *OnchainAllowlist_UpdateFromContract_Call) Return(_a0 error) *OnchainAllowlist_UpdateFromContract_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *OnchainAllowlist_UpdateFromContract_Call) RunAndReturn(run func(context.Context) error) *OnchainAllowlist_UpdateFromContract_Call { + _c.Call.Return(run) + return _c +} + // NewOnchainAllowlist creates a new instance of OnchainAllowlist. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewOnchainAllowlist(t interface { diff --git a/core/services/gateway/handlers/functions/allowlist/mocks/orm.go b/core/services/gateway/handlers/functions/allowlist/mocks/orm.go index 9c293fb2f4a..919dcb389a6 100644 --- a/core/services/gateway/handlers/functions/allowlist/mocks/orm.go +++ b/core/services/gateway/handlers/functions/allowlist/mocks/orm.go @@ -15,6 +15,14 @@ type ORM struct { mock.Mock } +type ORM_Expecter struct { + mock *mock.Mock +} + +func (_m *ORM) EXPECT() *ORM_Expecter { + return &ORM_Expecter{mock: &_m.Mock} +} + // CreateAllowedSenders provides a mock function with given fields: ctx, allowedSenders func (_m *ORM) CreateAllowedSenders(ctx context.Context, allowedSenders []common.Address) error { ret := _m.Called(ctx, allowedSenders) @@ -33,6 +41,35 @@ func (_m *ORM) CreateAllowedSenders(ctx context.Context, allowedSenders []common return r0 } +// ORM_CreateAllowedSenders_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateAllowedSenders' +type ORM_CreateAllowedSenders_Call struct { + *mock.Call +} + +// CreateAllowedSenders is a helper method to define mock.On call +// - ctx context.Context +// - allowedSenders []common.Address +func (_e *ORM_Expecter) CreateAllowedSenders(ctx interface{}, allowedSenders interface{}) *ORM_CreateAllowedSenders_Call { + return &ORM_CreateAllowedSenders_Call{Call: _e.mock.On("CreateAllowedSenders", ctx, allowedSenders)} +} + +func (_c *ORM_CreateAllowedSenders_Call) Run(run func(ctx context.Context, allowedSenders []common.Address)) *ORM_CreateAllowedSenders_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].([]common.Address)) + }) + return _c +} + +func (_c *ORM_CreateAllowedSenders_Call) Return(_a0 error) *ORM_CreateAllowedSenders_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ORM_CreateAllowedSenders_Call) RunAndReturn(run func(context.Context, []common.Address) error) *ORM_CreateAllowedSenders_Call { + _c.Call.Return(run) + return _c +} + // DeleteAllowedSenders provides a mock function with given fields: ctx, blockedSenders func (_m *ORM) DeleteAllowedSenders(ctx context.Context, blockedSenders []common.Address) error { ret := _m.Called(ctx, blockedSenders) @@ -51,6 +88,35 @@ func (_m *ORM) DeleteAllowedSenders(ctx context.Context, blockedSenders []common return r0 } +// ORM_DeleteAllowedSenders_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteAllowedSenders' +type ORM_DeleteAllowedSenders_Call struct { + *mock.Call +} + +// DeleteAllowedSenders is a helper method to define mock.On call +// - ctx context.Context +// - blockedSenders []common.Address +func (_e *ORM_Expecter) DeleteAllowedSenders(ctx interface{}, blockedSenders interface{}) *ORM_DeleteAllowedSenders_Call { + return &ORM_DeleteAllowedSenders_Call{Call: _e.mock.On("DeleteAllowedSenders", ctx, blockedSenders)} +} + +func (_c *ORM_DeleteAllowedSenders_Call) Run(run func(ctx context.Context, blockedSenders []common.Address)) *ORM_DeleteAllowedSenders_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].([]common.Address)) + }) + return _c +} + +func (_c *ORM_DeleteAllowedSenders_Call) Return(_a0 error) *ORM_DeleteAllowedSenders_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ORM_DeleteAllowedSenders_Call) RunAndReturn(run func(context.Context, []common.Address) error) *ORM_DeleteAllowedSenders_Call { + _c.Call.Return(run) + return _c +} + // GetAllowedSenders provides a mock function with given fields: ctx, offset, limit func (_m *ORM) GetAllowedSenders(ctx context.Context, offset uint, limit uint) ([]common.Address, error) { ret := _m.Called(ctx, offset, limit) @@ -81,6 +147,36 @@ func (_m *ORM) GetAllowedSenders(ctx context.Context, offset uint, limit uint) ( return r0, r1 } +// ORM_GetAllowedSenders_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAllowedSenders' +type ORM_GetAllowedSenders_Call struct { + *mock.Call +} + +// GetAllowedSenders is a helper method to define mock.On call +// - ctx context.Context +// - offset uint +// - limit uint +func (_e *ORM_Expecter) GetAllowedSenders(ctx interface{}, offset interface{}, limit interface{}) *ORM_GetAllowedSenders_Call { + return &ORM_GetAllowedSenders_Call{Call: _e.mock.On("GetAllowedSenders", ctx, offset, limit)} +} + +func (_c *ORM_GetAllowedSenders_Call) Run(run func(ctx context.Context, offset uint, limit uint)) *ORM_GetAllowedSenders_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(uint), args[2].(uint)) + }) + return _c +} + +func (_c *ORM_GetAllowedSenders_Call) Return(_a0 []common.Address, _a1 error) *ORM_GetAllowedSenders_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ORM_GetAllowedSenders_Call) RunAndReturn(run func(context.Context, uint, uint) ([]common.Address, error)) *ORM_GetAllowedSenders_Call { + _c.Call.Return(run) + return _c +} + // PurgeAllowedSenders provides a mock function with given fields: ctx func (_m *ORM) PurgeAllowedSenders(ctx context.Context) error { ret := _m.Called(ctx) @@ -99,6 +195,34 @@ func (_m *ORM) PurgeAllowedSenders(ctx context.Context) error { return r0 } +// ORM_PurgeAllowedSenders_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PurgeAllowedSenders' +type ORM_PurgeAllowedSenders_Call struct { + *mock.Call +} + +// PurgeAllowedSenders is a helper method to define mock.On call +// - ctx context.Context +func (_e *ORM_Expecter) PurgeAllowedSenders(ctx interface{}) *ORM_PurgeAllowedSenders_Call { + return &ORM_PurgeAllowedSenders_Call{Call: _e.mock.On("PurgeAllowedSenders", ctx)} +} + +func (_c *ORM_PurgeAllowedSenders_Call) Run(run func(ctx context.Context)) *ORM_PurgeAllowedSenders_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *ORM_PurgeAllowedSenders_Call) Return(_a0 error) *ORM_PurgeAllowedSenders_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ORM_PurgeAllowedSenders_Call) RunAndReturn(run func(context.Context) error) *ORM_PurgeAllowedSenders_Call { + _c.Call.Return(run) + return _c +} + // NewORM creates a new instance of ORM. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewORM(t interface { diff --git a/core/services/gateway/handlers/functions/allowlist/orm.go b/core/services/gateway/handlers/functions/allowlist/orm.go index 20a8ed15252..060ba163b03 100644 --- a/core/services/gateway/handlers/functions/allowlist/orm.go +++ b/core/services/gateway/handlers/functions/allowlist/orm.go @@ -12,7 +12,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/logger" ) -//go:generate mockery --quiet --name ORM --output ./mocks/ --case=underscore type ORM interface { GetAllowedSenders(ctx context.Context, offset, limit uint) ([]common.Address, error) CreateAllowedSenders(ctx context.Context, allowedSenders []common.Address) error diff --git a/core/services/gateway/handlers/functions/subscriptions/mocks/onchain_subscriptions.go b/core/services/gateway/handlers/functions/subscriptions/mocks/onchain_subscriptions.go index 9bc8fc3ccb4..0d82332547c 100644 --- a/core/services/gateway/handlers/functions/subscriptions/mocks/onchain_subscriptions.go +++ b/core/services/gateway/handlers/functions/subscriptions/mocks/onchain_subscriptions.go @@ -16,6 +16,14 @@ type OnchainSubscriptions struct { mock.Mock } +type OnchainSubscriptions_Expecter struct { + mock *mock.Mock +} + +func (_m *OnchainSubscriptions) EXPECT() *OnchainSubscriptions_Expecter { + return &OnchainSubscriptions_Expecter{mock: &_m.Mock} +} + // Close provides a mock function with given fields: func (_m *OnchainSubscriptions) Close() error { ret := _m.Called() @@ -34,6 +42,33 @@ func (_m *OnchainSubscriptions) Close() error { return r0 } +// OnchainSubscriptions_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close' +type OnchainSubscriptions_Close_Call struct { + *mock.Call +} + +// Close is a helper method to define mock.On call +func (_e *OnchainSubscriptions_Expecter) Close() *OnchainSubscriptions_Close_Call { + return &OnchainSubscriptions_Close_Call{Call: _e.mock.On("Close")} +} + +func (_c *OnchainSubscriptions_Close_Call) Run(run func()) *OnchainSubscriptions_Close_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *OnchainSubscriptions_Close_Call) Return(_a0 error) *OnchainSubscriptions_Close_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *OnchainSubscriptions_Close_Call) RunAndReturn(run func() error) *OnchainSubscriptions_Close_Call { + _c.Call.Return(run) + return _c +} + // GetMaxUserBalance provides a mock function with given fields: _a0 func (_m *OnchainSubscriptions) GetMaxUserBalance(_a0 common.Address) (*big.Int, error) { ret := _m.Called(_a0) @@ -64,6 +99,34 @@ func (_m *OnchainSubscriptions) GetMaxUserBalance(_a0 common.Address) (*big.Int, return r0, r1 } +// OnchainSubscriptions_GetMaxUserBalance_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetMaxUserBalance' +type OnchainSubscriptions_GetMaxUserBalance_Call struct { + *mock.Call +} + +// GetMaxUserBalance is a helper method to define mock.On call +// - _a0 common.Address +func (_e *OnchainSubscriptions_Expecter) GetMaxUserBalance(_a0 interface{}) *OnchainSubscriptions_GetMaxUserBalance_Call { + return &OnchainSubscriptions_GetMaxUserBalance_Call{Call: _e.mock.On("GetMaxUserBalance", _a0)} +} + +func (_c *OnchainSubscriptions_GetMaxUserBalance_Call) Run(run func(_a0 common.Address)) *OnchainSubscriptions_GetMaxUserBalance_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(common.Address)) + }) + return _c +} + +func (_c *OnchainSubscriptions_GetMaxUserBalance_Call) Return(_a0 *big.Int, _a1 error) *OnchainSubscriptions_GetMaxUserBalance_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *OnchainSubscriptions_GetMaxUserBalance_Call) RunAndReturn(run func(common.Address) (*big.Int, error)) *OnchainSubscriptions_GetMaxUserBalance_Call { + _c.Call.Return(run) + return _c +} + // Start provides a mock function with given fields: _a0 func (_m *OnchainSubscriptions) Start(_a0 context.Context) error { ret := _m.Called(_a0) @@ -82,6 +145,34 @@ func (_m *OnchainSubscriptions) Start(_a0 context.Context) error { return r0 } +// OnchainSubscriptions_Start_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Start' +type OnchainSubscriptions_Start_Call struct { + *mock.Call +} + +// Start is a helper method to define mock.On call +// - _a0 context.Context +func (_e *OnchainSubscriptions_Expecter) Start(_a0 interface{}) *OnchainSubscriptions_Start_Call { + return &OnchainSubscriptions_Start_Call{Call: _e.mock.On("Start", _a0)} +} + +func (_c *OnchainSubscriptions_Start_Call) Run(run func(_a0 context.Context)) *OnchainSubscriptions_Start_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *OnchainSubscriptions_Start_Call) Return(_a0 error) *OnchainSubscriptions_Start_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *OnchainSubscriptions_Start_Call) RunAndReturn(run func(context.Context) error) *OnchainSubscriptions_Start_Call { + _c.Call.Return(run) + return _c +} + // NewOnchainSubscriptions creates a new instance of OnchainSubscriptions. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewOnchainSubscriptions(t interface { diff --git a/core/services/gateway/handlers/functions/subscriptions/mocks/orm.go b/core/services/gateway/handlers/functions/subscriptions/mocks/orm.go index 759cf03c5df..56a0e00673c 100644 --- a/core/services/gateway/handlers/functions/subscriptions/mocks/orm.go +++ b/core/services/gateway/handlers/functions/subscriptions/mocks/orm.go @@ -14,6 +14,14 @@ type ORM struct { mock.Mock } +type ORM_Expecter struct { + mock *mock.Mock +} + +func (_m *ORM) EXPECT() *ORM_Expecter { + return &ORM_Expecter{mock: &_m.Mock} +} + // GetSubscriptions provides a mock function with given fields: ctx, offset, limit func (_m *ORM) GetSubscriptions(ctx context.Context, offset uint, limit uint) ([]subscriptions.StoredSubscription, error) { ret := _m.Called(ctx, offset, limit) @@ -44,6 +52,36 @@ func (_m *ORM) GetSubscriptions(ctx context.Context, offset uint, limit uint) ([ return r0, r1 } +// ORM_GetSubscriptions_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSubscriptions' +type ORM_GetSubscriptions_Call struct { + *mock.Call +} + +// GetSubscriptions is a helper method to define mock.On call +// - ctx context.Context +// - offset uint +// - limit uint +func (_e *ORM_Expecter) GetSubscriptions(ctx interface{}, offset interface{}, limit interface{}) *ORM_GetSubscriptions_Call { + return &ORM_GetSubscriptions_Call{Call: _e.mock.On("GetSubscriptions", ctx, offset, limit)} +} + +func (_c *ORM_GetSubscriptions_Call) Run(run func(ctx context.Context, offset uint, limit uint)) *ORM_GetSubscriptions_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(uint), args[2].(uint)) + }) + return _c +} + +func (_c *ORM_GetSubscriptions_Call) Return(_a0 []subscriptions.StoredSubscription, _a1 error) *ORM_GetSubscriptions_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ORM_GetSubscriptions_Call) RunAndReturn(run func(context.Context, uint, uint) ([]subscriptions.StoredSubscription, error)) *ORM_GetSubscriptions_Call { + _c.Call.Return(run) + return _c +} + // UpsertSubscription provides a mock function with given fields: ctx, subscription func (_m *ORM) UpsertSubscription(ctx context.Context, subscription subscriptions.StoredSubscription) error { ret := _m.Called(ctx, subscription) @@ -62,6 +100,35 @@ func (_m *ORM) UpsertSubscription(ctx context.Context, subscription subscription return r0 } +// ORM_UpsertSubscription_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpsertSubscription' +type ORM_UpsertSubscription_Call struct { + *mock.Call +} + +// UpsertSubscription is a helper method to define mock.On call +// - ctx context.Context +// - subscription subscriptions.StoredSubscription +func (_e *ORM_Expecter) UpsertSubscription(ctx interface{}, subscription interface{}) *ORM_UpsertSubscription_Call { + return &ORM_UpsertSubscription_Call{Call: _e.mock.On("UpsertSubscription", ctx, subscription)} +} + +func (_c *ORM_UpsertSubscription_Call) Run(run func(ctx context.Context, subscription subscriptions.StoredSubscription)) *ORM_UpsertSubscription_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(subscriptions.StoredSubscription)) + }) + return _c +} + +func (_c *ORM_UpsertSubscription_Call) Return(_a0 error) *ORM_UpsertSubscription_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ORM_UpsertSubscription_Call) RunAndReturn(run func(context.Context, subscriptions.StoredSubscription) error) *ORM_UpsertSubscription_Call { + _c.Call.Return(run) + return _c +} + // NewORM creates a new instance of ORM. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewORM(t interface { diff --git a/core/services/gateway/handlers/functions/subscriptions/orm.go b/core/services/gateway/handlers/functions/subscriptions/orm.go index d97437a39dc..51fd6fd62cc 100644 --- a/core/services/gateway/handlers/functions/subscriptions/orm.go +++ b/core/services/gateway/handlers/functions/subscriptions/orm.go @@ -14,7 +14,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/logger" ) -//go:generate mockery --quiet --name ORM --output ./mocks/ --case=underscore type ORM interface { GetSubscriptions(ctx context.Context, offset, limit uint) ([]StoredSubscription, error) UpsertSubscription(ctx context.Context, subscription StoredSubscription) error diff --git a/core/services/gateway/handlers/functions/subscriptions/subscriptions.go b/core/services/gateway/handlers/functions/subscriptions/subscriptions.go index c2b2835099f..5e067269fc2 100644 --- a/core/services/gateway/handlers/functions/subscriptions/subscriptions.go +++ b/core/services/gateway/handlers/functions/subscriptions/subscriptions.go @@ -32,8 +32,6 @@ type OnchainSubscriptionsConfig struct { // OnchainSubscriptions maintains a mirror of all subscriptions fetched from the blockchain (EVM-only). // All methods are thread-safe. -// -//go:generate mockery --quiet --name OnchainSubscriptions --output ./mocks/ --case=underscore type OnchainSubscriptions interface { job.ServiceCtx diff --git a/core/services/gateway/handlers/handler.go b/core/services/gateway/handlers/handler.go index 9b2d1bb9012..6994488707f 100644 --- a/core/services/gateway/handlers/handler.go +++ b/core/services/gateway/handlers/handler.go @@ -7,9 +7,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/job" ) -//go:generate mockery --quiet --name Handler --output ./mocks/ --case=underscore -//go:generate mockery --quiet --name DON --output ./mocks/ --case=underscore - // UserCallbackPayload is a response to user request sent to HandleUserMessage(). // Each message needs to receive at most one response on the provided channel. type UserCallbackPayload struct { diff --git a/core/services/gateway/handlers/mocks/don.go b/core/services/gateway/handlers/mocks/don.go index ceaa81eea15..465aebc67fe 100644 --- a/core/services/gateway/handlers/mocks/don.go +++ b/core/services/gateway/handlers/mocks/don.go @@ -15,6 +15,14 @@ type DON struct { mock.Mock } +type DON_Expecter struct { + mock *mock.Mock +} + +func (_m *DON) EXPECT() *DON_Expecter { + return &DON_Expecter{mock: &_m.Mock} +} + // SendToNode provides a mock function with given fields: ctx, nodeAddress, msg func (_m *DON) SendToNode(ctx context.Context, nodeAddress string, msg *api.Message) error { ret := _m.Called(ctx, nodeAddress, msg) @@ -33,6 +41,36 @@ func (_m *DON) SendToNode(ctx context.Context, nodeAddress string, msg *api.Mess return r0 } +// DON_SendToNode_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SendToNode' +type DON_SendToNode_Call struct { + *mock.Call +} + +// SendToNode is a helper method to define mock.On call +// - ctx context.Context +// - nodeAddress string +// - msg *api.Message +func (_e *DON_Expecter) SendToNode(ctx interface{}, nodeAddress interface{}, msg interface{}) *DON_SendToNode_Call { + return &DON_SendToNode_Call{Call: _e.mock.On("SendToNode", ctx, nodeAddress, msg)} +} + +func (_c *DON_SendToNode_Call) Run(run func(ctx context.Context, nodeAddress string, msg *api.Message)) *DON_SendToNode_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(*api.Message)) + }) + return _c +} + +func (_c *DON_SendToNode_Call) Return(_a0 error) *DON_SendToNode_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *DON_SendToNode_Call) RunAndReturn(run func(context.Context, string, *api.Message) error) *DON_SendToNode_Call { + _c.Call.Return(run) + return _c +} + // NewDON creates a new instance of DON. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewDON(t interface { diff --git a/core/services/gateway/handlers/mocks/handler.go b/core/services/gateway/handlers/mocks/handler.go index e0bfe28f630..aa069adbeae 100644 --- a/core/services/gateway/handlers/mocks/handler.go +++ b/core/services/gateway/handlers/mocks/handler.go @@ -17,6 +17,14 @@ type Handler struct { mock.Mock } +type Handler_Expecter struct { + mock *mock.Mock +} + +func (_m *Handler) EXPECT() *Handler_Expecter { + return &Handler_Expecter{mock: &_m.Mock} +} + // Close provides a mock function with given fields: func (_m *Handler) Close() error { ret := _m.Called() @@ -35,6 +43,33 @@ func (_m *Handler) Close() error { return r0 } +// Handler_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close' +type Handler_Close_Call struct { + *mock.Call +} + +// Close is a helper method to define mock.On call +func (_e *Handler_Expecter) Close() *Handler_Close_Call { + return &Handler_Close_Call{Call: _e.mock.On("Close")} +} + +func (_c *Handler_Close_Call) Run(run func()) *Handler_Close_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Handler_Close_Call) Return(_a0 error) *Handler_Close_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Handler_Close_Call) RunAndReturn(run func() error) *Handler_Close_Call { + _c.Call.Return(run) + return _c +} + // HandleNodeMessage provides a mock function with given fields: ctx, msg, nodeAddr func (_m *Handler) HandleNodeMessage(ctx context.Context, msg *api.Message, nodeAddr string) error { ret := _m.Called(ctx, msg, nodeAddr) @@ -53,6 +88,36 @@ func (_m *Handler) HandleNodeMessage(ctx context.Context, msg *api.Message, node return r0 } +// Handler_HandleNodeMessage_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HandleNodeMessage' +type Handler_HandleNodeMessage_Call struct { + *mock.Call +} + +// HandleNodeMessage is a helper method to define mock.On call +// - ctx context.Context +// - msg *api.Message +// - nodeAddr string +func (_e *Handler_Expecter) HandleNodeMessage(ctx interface{}, msg interface{}, nodeAddr interface{}) *Handler_HandleNodeMessage_Call { + return &Handler_HandleNodeMessage_Call{Call: _e.mock.On("HandleNodeMessage", ctx, msg, nodeAddr)} +} + +func (_c *Handler_HandleNodeMessage_Call) Run(run func(ctx context.Context, msg *api.Message, nodeAddr string)) *Handler_HandleNodeMessage_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*api.Message), args[2].(string)) + }) + return _c +} + +func (_c *Handler_HandleNodeMessage_Call) Return(_a0 error) *Handler_HandleNodeMessage_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Handler_HandleNodeMessage_Call) RunAndReturn(run func(context.Context, *api.Message, string) error) *Handler_HandleNodeMessage_Call { + _c.Call.Return(run) + return _c +} + // HandleUserMessage provides a mock function with given fields: ctx, msg, callbackCh func (_m *Handler) HandleUserMessage(ctx context.Context, msg *api.Message, callbackCh chan<- handlers.UserCallbackPayload) error { ret := _m.Called(ctx, msg, callbackCh) @@ -71,6 +136,36 @@ func (_m *Handler) HandleUserMessage(ctx context.Context, msg *api.Message, call return r0 } +// Handler_HandleUserMessage_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HandleUserMessage' +type Handler_HandleUserMessage_Call struct { + *mock.Call +} + +// HandleUserMessage is a helper method to define mock.On call +// - ctx context.Context +// - msg *api.Message +// - callbackCh chan<- handlers.UserCallbackPayload +func (_e *Handler_Expecter) HandleUserMessage(ctx interface{}, msg interface{}, callbackCh interface{}) *Handler_HandleUserMessage_Call { + return &Handler_HandleUserMessage_Call{Call: _e.mock.On("HandleUserMessage", ctx, msg, callbackCh)} +} + +func (_c *Handler_HandleUserMessage_Call) Run(run func(ctx context.Context, msg *api.Message, callbackCh chan<- handlers.UserCallbackPayload)) *Handler_HandleUserMessage_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*api.Message), args[2].(chan<- handlers.UserCallbackPayload)) + }) + return _c +} + +func (_c *Handler_HandleUserMessage_Call) Return(_a0 error) *Handler_HandleUserMessage_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Handler_HandleUserMessage_Call) RunAndReturn(run func(context.Context, *api.Message, chan<- handlers.UserCallbackPayload) error) *Handler_HandleUserMessage_Call { + _c.Call.Return(run) + return _c +} + // Start provides a mock function with given fields: _a0 func (_m *Handler) Start(_a0 context.Context) error { ret := _m.Called(_a0) @@ -89,6 +184,34 @@ func (_m *Handler) Start(_a0 context.Context) error { return r0 } +// Handler_Start_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Start' +type Handler_Start_Call struct { + *mock.Call +} + +// Start is a helper method to define mock.On call +// - _a0 context.Context +func (_e *Handler_Expecter) Start(_a0 interface{}) *Handler_Start_Call { + return &Handler_Start_Call{Call: _e.mock.On("Start", _a0)} +} + +func (_c *Handler_Start_Call) Run(run func(_a0 context.Context)) *Handler_Start_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *Handler_Start_Call) Return(_a0 error) *Handler_Start_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Handler_Start_Call) RunAndReturn(run func(context.Context) error) *Handler_Start_Call { + _c.Call.Return(run) + return _c +} + // NewHandler creates a new instance of Handler. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewHandler(t interface { diff --git a/core/services/gateway/handlers/webapicapabilities/handler.go b/core/services/gateway/handlers/webapicapabilities/handler.go new file mode 100644 index 00000000000..a38651d40fc --- /dev/null +++ b/core/services/gateway/handlers/webapicapabilities/handler.go @@ -0,0 +1,6 @@ +package webapicapabilities + +const ( + // NOTE: more methods will go here. HTTP trigger/action/target; etc. + MethodWebAPITarget = "web_api_target" +) diff --git a/core/services/gateway/handlers/webapicapabilities/webapi.go b/core/services/gateway/handlers/webapicapabilities/webapi.go new file mode 100644 index 00000000000..e300b61d85b --- /dev/null +++ b/core/services/gateway/handlers/webapicapabilities/webapi.go @@ -0,0 +1,17 @@ +package webapicapabilities + +type TargetRequestPayload struct { + URL string `json:"url"` // URL to query, only http and https protocols are supported. + Method string `json:"method,omitempty"` // HTTP verb, defaults to GET. + Headers map[string]string `json:"headers,omitempty"` // HTTP headers, defaults to empty. + Body []byte `json:"body,omitempty"` // HTTP request body + TimeoutMs uint32 `json:"timeoutMs,omitempty"` // Timeout in milliseconds +} + +type TargetResponsePayload struct { + Success bool `json:"success"` // true if HTTP request was successful + ErrorMessage string `json:"error_message,omitempty"` // error message in case of failure + StatusCode uint8 `json:"statusCode"` // HTTP status code + Headers map[string]string `json:"headers,omitempty"` // HTTP headers + Body []byte `json:"body,omitempty"` // HTTP response body +} diff --git a/core/services/gateway/integration_tests/gateway_integration_test.go b/core/services/gateway/integration_tests/gateway_integration_test.go index 38a6b6ebbca..59418819b61 100644 --- a/core/services/gateway/integration_tests/gateway_integration_test.go +++ b/core/services/gateway/integration_tests/gateway_integration_test.go @@ -152,8 +152,10 @@ func TestIntegration_Gateway_NoFullNodes_BasicConnectionAndMessage(t *testing.T) // Launch Connector client := &client{privateKey: nodeKeys.PrivateKey} - connector, err := connector.NewGatewayConnector(parseConnectorConfig(t, nodeConfigTemplate, nodeKeys.Address, nodeUrl), client, client, clockwork.NewRealClock(), lggr) + // client acts as a signer here + connector, err := connector.NewGatewayConnector(parseConnectorConfig(t, nodeConfigTemplate, nodeKeys.Address, nodeUrl), client, clockwork.NewRealClock(), lggr) require.NoError(t, err) + require.NoError(t, connector.AddHandler([]string{"test"}, client)) client.connector = connector servicetest.Run(t, connector) diff --git a/core/services/gateway/network/handshake.go b/core/services/gateway/network/handshake.go index 253ce369115..77575b287fe 100644 --- a/core/services/gateway/network/handshake.go +++ b/core/services/gateway/network/handshake.go @@ -21,8 +21,6 @@ import ( // ChallengeResponse() // ---------response---------> // FinalizeHandshake() -// -//go:generate mockery --quiet --name ConnectionInitiator --output ./mocks/ --case=underscore type ConnectionInitiator interface { // Generate authentication header value specific to node and gateway NewAuthHeader(url *url.URL) ([]byte, error) @@ -31,7 +29,6 @@ type ConnectionInitiator interface { ChallengeResponse(url *url.URL, challenge []byte) ([]byte, error) } -//go:generate mockery --quiet --name ConnectionAcceptor --output ./mocks/ --case=underscore type ConnectionAcceptor interface { // Verify auth header, save state of the attempt and generate a challenge for the node. StartHandshake(authHeader []byte) (attemptId string, challenge []byte, err error) diff --git a/core/services/gateway/network/httpserver.go b/core/services/gateway/network/httpserver.go index d4340a92e98..e7b622fc33c 100644 --- a/core/services/gateway/network/httpserver.go +++ b/core/services/gateway/network/httpserver.go @@ -13,7 +13,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/job" ) -//go:generate mockery --quiet --name HttpServer --output ./mocks/ --case=underscore type HttpServer interface { job.ServiceCtx @@ -24,7 +23,6 @@ type HttpServer interface { GetPort() int } -//go:generate mockery --quiet --name HTTPRequestHandler --output ./mocks/ --case=underscore type HTTPRequestHandler interface { ProcessRequest(ctx context.Context, rawRequest []byte) (rawResponse []byte, httpStatusCode int) } diff --git a/core/services/gateway/network/mocks/connection_acceptor.go b/core/services/gateway/network/mocks/connection_acceptor.go index 1af874b4334..427c41fe047 100644 --- a/core/services/gateway/network/mocks/connection_acceptor.go +++ b/core/services/gateway/network/mocks/connection_acceptor.go @@ -13,11 +13,47 @@ type ConnectionAcceptor struct { mock.Mock } +type ConnectionAcceptor_Expecter struct { + mock *mock.Mock +} + +func (_m *ConnectionAcceptor) EXPECT() *ConnectionAcceptor_Expecter { + return &ConnectionAcceptor_Expecter{mock: &_m.Mock} +} + // AbortHandshake provides a mock function with given fields: attemptId func (_m *ConnectionAcceptor) AbortHandshake(attemptId string) { _m.Called(attemptId) } +// ConnectionAcceptor_AbortHandshake_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AbortHandshake' +type ConnectionAcceptor_AbortHandshake_Call struct { + *mock.Call +} + +// AbortHandshake is a helper method to define mock.On call +// - attemptId string +func (_e *ConnectionAcceptor_Expecter) AbortHandshake(attemptId interface{}) *ConnectionAcceptor_AbortHandshake_Call { + return &ConnectionAcceptor_AbortHandshake_Call{Call: _e.mock.On("AbortHandshake", attemptId)} +} + +func (_c *ConnectionAcceptor_AbortHandshake_Call) Run(run func(attemptId string)) *ConnectionAcceptor_AbortHandshake_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *ConnectionAcceptor_AbortHandshake_Call) Return() *ConnectionAcceptor_AbortHandshake_Call { + _c.Call.Return() + return _c +} + +func (_c *ConnectionAcceptor_AbortHandshake_Call) RunAndReturn(run func(string)) *ConnectionAcceptor_AbortHandshake_Call { + _c.Call.Return(run) + return _c +} + // FinalizeHandshake provides a mock function with given fields: attemptId, response, conn func (_m *ConnectionAcceptor) FinalizeHandshake(attemptId string, response []byte, conn *websocket.Conn) error { ret := _m.Called(attemptId, response, conn) @@ -36,6 +72,36 @@ func (_m *ConnectionAcceptor) FinalizeHandshake(attemptId string, response []byt return r0 } +// ConnectionAcceptor_FinalizeHandshake_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FinalizeHandshake' +type ConnectionAcceptor_FinalizeHandshake_Call struct { + *mock.Call +} + +// FinalizeHandshake is a helper method to define mock.On call +// - attemptId string +// - response []byte +// - conn *websocket.Conn +func (_e *ConnectionAcceptor_Expecter) FinalizeHandshake(attemptId interface{}, response interface{}, conn interface{}) *ConnectionAcceptor_FinalizeHandshake_Call { + return &ConnectionAcceptor_FinalizeHandshake_Call{Call: _e.mock.On("FinalizeHandshake", attemptId, response, conn)} +} + +func (_c *ConnectionAcceptor_FinalizeHandshake_Call) Run(run func(attemptId string, response []byte, conn *websocket.Conn)) *ConnectionAcceptor_FinalizeHandshake_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].([]byte), args[2].(*websocket.Conn)) + }) + return _c +} + +func (_c *ConnectionAcceptor_FinalizeHandshake_Call) Return(_a0 error) *ConnectionAcceptor_FinalizeHandshake_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ConnectionAcceptor_FinalizeHandshake_Call) RunAndReturn(run func(string, []byte, *websocket.Conn) error) *ConnectionAcceptor_FinalizeHandshake_Call { + _c.Call.Return(run) + return _c +} + // StartHandshake provides a mock function with given fields: authHeader func (_m *ConnectionAcceptor) StartHandshake(authHeader []byte) (string, []byte, error) { ret := _m.Called(authHeader) @@ -73,6 +139,34 @@ func (_m *ConnectionAcceptor) StartHandshake(authHeader []byte) (string, []byte, return r0, r1, r2 } +// ConnectionAcceptor_StartHandshake_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StartHandshake' +type ConnectionAcceptor_StartHandshake_Call struct { + *mock.Call +} + +// StartHandshake is a helper method to define mock.On call +// - authHeader []byte +func (_e *ConnectionAcceptor_Expecter) StartHandshake(authHeader interface{}) *ConnectionAcceptor_StartHandshake_Call { + return &ConnectionAcceptor_StartHandshake_Call{Call: _e.mock.On("StartHandshake", authHeader)} +} + +func (_c *ConnectionAcceptor_StartHandshake_Call) Run(run func(authHeader []byte)) *ConnectionAcceptor_StartHandshake_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].([]byte)) + }) + return _c +} + +func (_c *ConnectionAcceptor_StartHandshake_Call) Return(attemptId string, challenge []byte, err error) *ConnectionAcceptor_StartHandshake_Call { + _c.Call.Return(attemptId, challenge, err) + return _c +} + +func (_c *ConnectionAcceptor_StartHandshake_Call) RunAndReturn(run func([]byte) (string, []byte, error)) *ConnectionAcceptor_StartHandshake_Call { + _c.Call.Return(run) + return _c +} + // NewConnectionAcceptor creates a new instance of ConnectionAcceptor. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewConnectionAcceptor(t interface { diff --git a/core/services/gateway/network/mocks/connection_initiator.go b/core/services/gateway/network/mocks/connection_initiator.go index 0b63edf1826..db13b166d52 100644 --- a/core/services/gateway/network/mocks/connection_initiator.go +++ b/core/services/gateway/network/mocks/connection_initiator.go @@ -13,6 +13,14 @@ type ConnectionInitiator struct { mock.Mock } +type ConnectionInitiator_Expecter struct { + mock *mock.Mock +} + +func (_m *ConnectionInitiator) EXPECT() *ConnectionInitiator_Expecter { + return &ConnectionInitiator_Expecter{mock: &_m.Mock} +} + // ChallengeResponse provides a mock function with given fields: _a0, challenge func (_m *ConnectionInitiator) ChallengeResponse(_a0 *url.URL, challenge []byte) ([]byte, error) { ret := _m.Called(_a0, challenge) @@ -43,6 +51,35 @@ func (_m *ConnectionInitiator) ChallengeResponse(_a0 *url.URL, challenge []byte) return r0, r1 } +// ConnectionInitiator_ChallengeResponse_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ChallengeResponse' +type ConnectionInitiator_ChallengeResponse_Call struct { + *mock.Call +} + +// ChallengeResponse is a helper method to define mock.On call +// - _a0 *url.URL +// - challenge []byte +func (_e *ConnectionInitiator_Expecter) ChallengeResponse(_a0 interface{}, challenge interface{}) *ConnectionInitiator_ChallengeResponse_Call { + return &ConnectionInitiator_ChallengeResponse_Call{Call: _e.mock.On("ChallengeResponse", _a0, challenge)} +} + +func (_c *ConnectionInitiator_ChallengeResponse_Call) Run(run func(_a0 *url.URL, challenge []byte)) *ConnectionInitiator_ChallengeResponse_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*url.URL), args[1].([]byte)) + }) + return _c +} + +func (_c *ConnectionInitiator_ChallengeResponse_Call) Return(_a0 []byte, _a1 error) *ConnectionInitiator_ChallengeResponse_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ConnectionInitiator_ChallengeResponse_Call) RunAndReturn(run func(*url.URL, []byte) ([]byte, error)) *ConnectionInitiator_ChallengeResponse_Call { + _c.Call.Return(run) + return _c +} + // NewAuthHeader provides a mock function with given fields: _a0 func (_m *ConnectionInitiator) NewAuthHeader(_a0 *url.URL) ([]byte, error) { ret := _m.Called(_a0) @@ -73,6 +110,34 @@ func (_m *ConnectionInitiator) NewAuthHeader(_a0 *url.URL) ([]byte, error) { return r0, r1 } +// ConnectionInitiator_NewAuthHeader_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NewAuthHeader' +type ConnectionInitiator_NewAuthHeader_Call struct { + *mock.Call +} + +// NewAuthHeader is a helper method to define mock.On call +// - _a0 *url.URL +func (_e *ConnectionInitiator_Expecter) NewAuthHeader(_a0 interface{}) *ConnectionInitiator_NewAuthHeader_Call { + return &ConnectionInitiator_NewAuthHeader_Call{Call: _e.mock.On("NewAuthHeader", _a0)} +} + +func (_c *ConnectionInitiator_NewAuthHeader_Call) Run(run func(_a0 *url.URL)) *ConnectionInitiator_NewAuthHeader_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*url.URL)) + }) + return _c +} + +func (_c *ConnectionInitiator_NewAuthHeader_Call) Return(_a0 []byte, _a1 error) *ConnectionInitiator_NewAuthHeader_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ConnectionInitiator_NewAuthHeader_Call) RunAndReturn(run func(*url.URL) ([]byte, error)) *ConnectionInitiator_NewAuthHeader_Call { + _c.Call.Return(run) + return _c +} + // NewConnectionInitiator creates a new instance of ConnectionInitiator. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewConnectionInitiator(t interface { diff --git a/core/services/gateway/network/mocks/http_request_handler.go b/core/services/gateway/network/mocks/http_request_handler.go index d2bba61f2f9..b2601203c22 100644 --- a/core/services/gateway/network/mocks/http_request_handler.go +++ b/core/services/gateway/network/mocks/http_request_handler.go @@ -13,6 +13,14 @@ type HTTPRequestHandler struct { mock.Mock } +type HTTPRequestHandler_Expecter struct { + mock *mock.Mock +} + +func (_m *HTTPRequestHandler) EXPECT() *HTTPRequestHandler_Expecter { + return &HTTPRequestHandler_Expecter{mock: &_m.Mock} +} + // ProcessRequest provides a mock function with given fields: ctx, rawRequest func (_m *HTTPRequestHandler) ProcessRequest(ctx context.Context, rawRequest []byte) ([]byte, int) { ret := _m.Called(ctx, rawRequest) @@ -43,6 +51,35 @@ func (_m *HTTPRequestHandler) ProcessRequest(ctx context.Context, rawRequest []b return r0, r1 } +// HTTPRequestHandler_ProcessRequest_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ProcessRequest' +type HTTPRequestHandler_ProcessRequest_Call struct { + *mock.Call +} + +// ProcessRequest is a helper method to define mock.On call +// - ctx context.Context +// - rawRequest []byte +func (_e *HTTPRequestHandler_Expecter) ProcessRequest(ctx interface{}, rawRequest interface{}) *HTTPRequestHandler_ProcessRequest_Call { + return &HTTPRequestHandler_ProcessRequest_Call{Call: _e.mock.On("ProcessRequest", ctx, rawRequest)} +} + +func (_c *HTTPRequestHandler_ProcessRequest_Call) Run(run func(ctx context.Context, rawRequest []byte)) *HTTPRequestHandler_ProcessRequest_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].([]byte)) + }) + return _c +} + +func (_c *HTTPRequestHandler_ProcessRequest_Call) Return(rawResponse []byte, httpStatusCode int) *HTTPRequestHandler_ProcessRequest_Call { + _c.Call.Return(rawResponse, httpStatusCode) + return _c +} + +func (_c *HTTPRequestHandler_ProcessRequest_Call) RunAndReturn(run func(context.Context, []byte) ([]byte, int)) *HTTPRequestHandler_ProcessRequest_Call { + _c.Call.Return(run) + return _c +} + // NewHTTPRequestHandler creates a new instance of HTTPRequestHandler. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewHTTPRequestHandler(t interface { diff --git a/core/services/gateway/network/mocks/http_server.go b/core/services/gateway/network/mocks/http_server.go index 8609803eaff..d5570ddd2e7 100644 --- a/core/services/gateway/network/mocks/http_server.go +++ b/core/services/gateway/network/mocks/http_server.go @@ -14,6 +14,14 @@ type HttpServer struct { mock.Mock } +type HttpServer_Expecter struct { + mock *mock.Mock +} + +func (_m *HttpServer) EXPECT() *HttpServer_Expecter { + return &HttpServer_Expecter{mock: &_m.Mock} +} + // Close provides a mock function with given fields: func (_m *HttpServer) Close() error { ret := _m.Called() @@ -32,6 +40,33 @@ func (_m *HttpServer) Close() error { return r0 } +// HttpServer_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close' +type HttpServer_Close_Call struct { + *mock.Call +} + +// Close is a helper method to define mock.On call +func (_e *HttpServer_Expecter) Close() *HttpServer_Close_Call { + return &HttpServer_Close_Call{Call: _e.mock.On("Close")} +} + +func (_c *HttpServer_Close_Call) Run(run func()) *HttpServer_Close_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *HttpServer_Close_Call) Return(_a0 error) *HttpServer_Close_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *HttpServer_Close_Call) RunAndReturn(run func() error) *HttpServer_Close_Call { + _c.Call.Return(run) + return _c +} + // GetPort provides a mock function with given fields: func (_m *HttpServer) GetPort() int { ret := _m.Called() @@ -50,11 +85,66 @@ func (_m *HttpServer) GetPort() int { return r0 } +// HttpServer_GetPort_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPort' +type HttpServer_GetPort_Call struct { + *mock.Call +} + +// GetPort is a helper method to define mock.On call +func (_e *HttpServer_Expecter) GetPort() *HttpServer_GetPort_Call { + return &HttpServer_GetPort_Call{Call: _e.mock.On("GetPort")} +} + +func (_c *HttpServer_GetPort_Call) Run(run func()) *HttpServer_GetPort_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *HttpServer_GetPort_Call) Return(_a0 int) *HttpServer_GetPort_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *HttpServer_GetPort_Call) RunAndReturn(run func() int) *HttpServer_GetPort_Call { + _c.Call.Return(run) + return _c +} + // SetHTTPRequestHandler provides a mock function with given fields: handler func (_m *HttpServer) SetHTTPRequestHandler(handler network.HTTPRequestHandler) { _m.Called(handler) } +// HttpServer_SetHTTPRequestHandler_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetHTTPRequestHandler' +type HttpServer_SetHTTPRequestHandler_Call struct { + *mock.Call +} + +// SetHTTPRequestHandler is a helper method to define mock.On call +// - handler network.HTTPRequestHandler +func (_e *HttpServer_Expecter) SetHTTPRequestHandler(handler interface{}) *HttpServer_SetHTTPRequestHandler_Call { + return &HttpServer_SetHTTPRequestHandler_Call{Call: _e.mock.On("SetHTTPRequestHandler", handler)} +} + +func (_c *HttpServer_SetHTTPRequestHandler_Call) Run(run func(handler network.HTTPRequestHandler)) *HttpServer_SetHTTPRequestHandler_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(network.HTTPRequestHandler)) + }) + return _c +} + +func (_c *HttpServer_SetHTTPRequestHandler_Call) Return() *HttpServer_SetHTTPRequestHandler_Call { + _c.Call.Return() + return _c +} + +func (_c *HttpServer_SetHTTPRequestHandler_Call) RunAndReturn(run func(network.HTTPRequestHandler)) *HttpServer_SetHTTPRequestHandler_Call { + _c.Call.Return(run) + return _c +} + // Start provides a mock function with given fields: _a0 func (_m *HttpServer) Start(_a0 context.Context) error { ret := _m.Called(_a0) @@ -73,6 +163,34 @@ func (_m *HttpServer) Start(_a0 context.Context) error { return r0 } +// HttpServer_Start_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Start' +type HttpServer_Start_Call struct { + *mock.Call +} + +// Start is a helper method to define mock.On call +// - _a0 context.Context +func (_e *HttpServer_Expecter) Start(_a0 interface{}) *HttpServer_Start_Call { + return &HttpServer_Start_Call{Call: _e.mock.On("Start", _a0)} +} + +func (_c *HttpServer_Start_Call) Run(run func(_a0 context.Context)) *HttpServer_Start_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *HttpServer_Start_Call) Return(_a0 error) *HttpServer_Start_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *HttpServer_Start_Call) RunAndReturn(run func(context.Context) error) *HttpServer_Start_Call { + _c.Call.Return(run) + return _c +} + // NewHttpServer creates a new instance of HttpServer. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewHttpServer(t interface { diff --git a/core/services/gateway/network/mocks/web_socket_server.go b/core/services/gateway/network/mocks/web_socket_server.go index 32483fe4025..0f5eff08379 100644 --- a/core/services/gateway/network/mocks/web_socket_server.go +++ b/core/services/gateway/network/mocks/web_socket_server.go @@ -13,6 +13,14 @@ type WebSocketServer struct { mock.Mock } +type WebSocketServer_Expecter struct { + mock *mock.Mock +} + +func (_m *WebSocketServer) EXPECT() *WebSocketServer_Expecter { + return &WebSocketServer_Expecter{mock: &_m.Mock} +} + // Close provides a mock function with given fields: func (_m *WebSocketServer) Close() error { ret := _m.Called() @@ -31,6 +39,33 @@ func (_m *WebSocketServer) Close() error { return r0 } +// WebSocketServer_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close' +type WebSocketServer_Close_Call struct { + *mock.Call +} + +// Close is a helper method to define mock.On call +func (_e *WebSocketServer_Expecter) Close() *WebSocketServer_Close_Call { + return &WebSocketServer_Close_Call{Call: _e.mock.On("Close")} +} + +func (_c *WebSocketServer_Close_Call) Run(run func()) *WebSocketServer_Close_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *WebSocketServer_Close_Call) Return(_a0 error) *WebSocketServer_Close_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *WebSocketServer_Close_Call) RunAndReturn(run func() error) *WebSocketServer_Close_Call { + _c.Call.Return(run) + return _c +} + // GetPort provides a mock function with given fields: func (_m *WebSocketServer) GetPort() int { ret := _m.Called() @@ -49,6 +84,33 @@ func (_m *WebSocketServer) GetPort() int { return r0 } +// WebSocketServer_GetPort_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPort' +type WebSocketServer_GetPort_Call struct { + *mock.Call +} + +// GetPort is a helper method to define mock.On call +func (_e *WebSocketServer_Expecter) GetPort() *WebSocketServer_GetPort_Call { + return &WebSocketServer_GetPort_Call{Call: _e.mock.On("GetPort")} +} + +func (_c *WebSocketServer_GetPort_Call) Run(run func()) *WebSocketServer_GetPort_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *WebSocketServer_GetPort_Call) Return(_a0 int) *WebSocketServer_GetPort_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *WebSocketServer_GetPort_Call) RunAndReturn(run func() int) *WebSocketServer_GetPort_Call { + _c.Call.Return(run) + return _c +} + // Start provides a mock function with given fields: _a0 func (_m *WebSocketServer) Start(_a0 context.Context) error { ret := _m.Called(_a0) @@ -67,6 +129,34 @@ func (_m *WebSocketServer) Start(_a0 context.Context) error { return r0 } +// WebSocketServer_Start_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Start' +type WebSocketServer_Start_Call struct { + *mock.Call +} + +// Start is a helper method to define mock.On call +// - _a0 context.Context +func (_e *WebSocketServer_Expecter) Start(_a0 interface{}) *WebSocketServer_Start_Call { + return &WebSocketServer_Start_Call{Call: _e.mock.On("Start", _a0)} +} + +func (_c *WebSocketServer_Start_Call) Run(run func(_a0 context.Context)) *WebSocketServer_Start_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *WebSocketServer_Start_Call) Return(_a0 error) *WebSocketServer_Start_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *WebSocketServer_Start_Call) RunAndReturn(run func(context.Context) error) *WebSocketServer_Start_Call { + _c.Call.Return(run) + return _c +} + // NewWebSocketServer creates a new instance of WebSocketServer. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewWebSocketServer(t interface { diff --git a/core/services/gateway/network/wsserver.go b/core/services/gateway/network/wsserver.go index 58b2dfe663c..361fe5c0fd6 100644 --- a/core/services/gateway/network/wsserver.go +++ b/core/services/gateway/network/wsserver.go @@ -15,7 +15,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/job" ) -//go:generate mockery --quiet --name WebSocketServer --output ./mocks/ --case=underscore type WebSocketServer interface { job.ServiceCtx diff --git a/core/services/headreporter/head_reporter.go b/core/services/headreporter/head_reporter.go new file mode 100644 index 00000000000..94de8ae2be9 --- /dev/null +++ b/core/services/headreporter/head_reporter.go @@ -0,0 +1,111 @@ +package headreporter + +import ( + "context" + "sync" + "time" + + "github.com/smartcontractkit/chainlink-common/pkg/services" + "github.com/smartcontractkit/chainlink-common/pkg/sqlutil" + "github.com/smartcontractkit/chainlink-common/pkg/utils/mailbox" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/headtracker/types" + evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" + "github.com/smartcontractkit/chainlink/v2/core/logger" +) + +type ( + HeadReporter interface { + ReportNewHead(ctx context.Context, head *evmtypes.Head) error + ReportPeriodic(ctx context.Context) error + } + + HeadReporterService struct { + services.StateMachine + ds sqlutil.DataSource + lggr logger.Logger + newHeads *mailbox.Mailbox[*evmtypes.Head] + chStop services.StopChan + wgDone sync.WaitGroup + reportPeriod time.Duration + reporters []HeadReporter + unsubscribeFns []func() + } +) + +func NewHeadReporterService(ds sqlutil.DataSource, lggr logger.Logger, reporters ...HeadReporter) *HeadReporterService { + return &HeadReporterService{ + ds: ds, + lggr: lggr.Named("HeadReporter"), + newHeads: mailbox.NewSingle[*evmtypes.Head](), + chStop: make(chan struct{}), + reporters: reporters, + reportPeriod: 15 * time.Second, + } +} + +func (hrd *HeadReporterService) Subscribe(subFn func(types.HeadTrackable) (evmtypes.Head, func())) { + _, unsubscribe := subFn(hrd) + hrd.unsubscribeFns = append(hrd.unsubscribeFns, unsubscribe) +} + +func (hrd *HeadReporterService) Start(context.Context) error { + return hrd.StartOnce(hrd.Name(), func() error { + hrd.wgDone.Add(1) + go hrd.eventLoop() + return nil + }) +} + +func (hrd *HeadReporterService) Close() error { + return hrd.StopOnce(hrd.Name(), func() error { + close(hrd.chStop) + hrd.wgDone.Wait() + return nil + }) +} + +func (hrd *HeadReporterService) Name() string { + return hrd.lggr.Name() +} + +func (hrd *HeadReporterService) HealthReport() map[string]error { + return map[string]error{hrd.Name(): hrd.Healthy()} +} + +func (hrd *HeadReporterService) OnNewLongestChain(ctx context.Context, head *evmtypes.Head) { + hrd.newHeads.Deliver(head) +} + +func (hrd *HeadReporterService) eventLoop() { + hrd.lggr.Debug("Starting event loop") + defer hrd.wgDone.Done() + ctx, cancel := hrd.chStop.NewCtx() + defer cancel() + after := time.After(hrd.reportPeriod) + for { + select { + case <-hrd.newHeads.Notify(): + head, exists := hrd.newHeads.Retrieve() + if !exists { + continue + } + for _, reporter := range hrd.reporters { + err := reporter.ReportNewHead(ctx, head) + if err != nil && ctx.Err() == nil { + hrd.lggr.Errorw("Error reporting new head", "err", err) + } + } + case <-after: + for _, reporter := range hrd.reporters { + err := reporter.ReportPeriodic(ctx) + if err != nil && ctx.Err() == nil { + hrd.lggr.Errorw("Error in periodic report", "err", err) + } + } + after = time.After(hrd.reportPeriod) + case <-hrd.chStop: + return + } + } +} diff --git a/core/services/headreporter/head_reporter_mock.go b/core/services/headreporter/head_reporter_mock.go new file mode 100644 index 00000000000..21978abb86a --- /dev/null +++ b/core/services/headreporter/head_reporter_mock.go @@ -0,0 +1,130 @@ +// Code generated by mockery v2.43.2. DO NOT EDIT. + +package headreporter + +import ( + context "context" + + types "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" + mock "github.com/stretchr/testify/mock" +) + +// MockHeadReporter is an autogenerated mock type for the HeadReporter type +type MockHeadReporter struct { + mock.Mock +} + +type MockHeadReporter_Expecter struct { + mock *mock.Mock +} + +func (_m *MockHeadReporter) EXPECT() *MockHeadReporter_Expecter { + return &MockHeadReporter_Expecter{mock: &_m.Mock} +} + +// ReportNewHead provides a mock function with given fields: ctx, head +func (_m *MockHeadReporter) ReportNewHead(ctx context.Context, head *types.Head) error { + ret := _m.Called(ctx, head) + + if len(ret) == 0 { + panic("no return value specified for ReportNewHead") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, *types.Head) error); ok { + r0 = rf(ctx, head) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockHeadReporter_ReportNewHead_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ReportNewHead' +type MockHeadReporter_ReportNewHead_Call struct { + *mock.Call +} + +// ReportNewHead is a helper method to define mock.On call +// - ctx context.Context +// - head *types.Head +func (_e *MockHeadReporter_Expecter) ReportNewHead(ctx interface{}, head interface{}) *MockHeadReporter_ReportNewHead_Call { + return &MockHeadReporter_ReportNewHead_Call{Call: _e.mock.On("ReportNewHead", ctx, head)} +} + +func (_c *MockHeadReporter_ReportNewHead_Call) Run(run func(ctx context.Context, head *types.Head)) *MockHeadReporter_ReportNewHead_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*types.Head)) + }) + return _c +} + +func (_c *MockHeadReporter_ReportNewHead_Call) Return(_a0 error) *MockHeadReporter_ReportNewHead_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockHeadReporter_ReportNewHead_Call) RunAndReturn(run func(context.Context, *types.Head) error) *MockHeadReporter_ReportNewHead_Call { + _c.Call.Return(run) + return _c +} + +// ReportPeriodic provides a mock function with given fields: ctx +func (_m *MockHeadReporter) ReportPeriodic(ctx context.Context) error { + ret := _m.Called(ctx) + + if len(ret) == 0 { + panic("no return value specified for ReportPeriodic") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context) error); ok { + r0 = rf(ctx) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockHeadReporter_ReportPeriodic_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ReportPeriodic' +type MockHeadReporter_ReportPeriodic_Call struct { + *mock.Call +} + +// ReportPeriodic is a helper method to define mock.On call +// - ctx context.Context +func (_e *MockHeadReporter_Expecter) ReportPeriodic(ctx interface{}) *MockHeadReporter_ReportPeriodic_Call { + return &MockHeadReporter_ReportPeriodic_Call{Call: _e.mock.On("ReportPeriodic", ctx)} +} + +func (_c *MockHeadReporter_ReportPeriodic_Call) Run(run func(ctx context.Context)) *MockHeadReporter_ReportPeriodic_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *MockHeadReporter_ReportPeriodic_Call) Return(_a0 error) *MockHeadReporter_ReportPeriodic_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockHeadReporter_ReportPeriodic_Call) RunAndReturn(run func(context.Context) error) *MockHeadReporter_ReportPeriodic_Call { + _c.Call.Return(run) + return _c +} + +// NewMockHeadReporter creates a new instance of MockHeadReporter. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewMockHeadReporter(t interface { + mock.TestingT + Cleanup(func()) +}) *MockHeadReporter { + mock := &MockHeadReporter{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/core/services/headreporter/head_reporter_test.go b/core/services/headreporter/head_reporter_test.go new file mode 100644 index 00000000000..304dd59a478 --- /dev/null +++ b/core/services/headreporter/head_reporter_test.go @@ -0,0 +1,51 @@ +package headreporter + +import ( + "sync/atomic" + "testing" + "time" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + "github.com/stretchr/testify/require" + + evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" + ubig "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils/big" + + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/pgtest" + "github.com/smartcontractkit/chainlink/v2/core/logger" +) + +func NewHead() evmtypes.Head { + return evmtypes.Head{Number: 42, EVMChainID: ubig.NewI(0)} +} + +func Test_HeadReporterService(t *testing.T) { + t.Run("report everything", func(t *testing.T) { + db := pgtest.NewSqlxDB(t) + + headReporter := NewMockHeadReporter(t) + service := NewHeadReporterService(db, logger.TestLogger(t), headReporter) + service.reportPeriod = time.Second + err := service.Start(testutils.Context(t)) + require.NoError(t, err) + + var reportCalls atomic.Int32 + head := NewHead() + headReporter.On("ReportNewHead", mock.Anything, &head).Run(func(args mock.Arguments) { + reportCalls.Add(1) + }).Return(nil) + headReporter.On("ReportPeriodic", mock.Anything).Run(func(args mock.Arguments) { + reportCalls.Add(1) + }).Return(nil) + service.OnNewLongestChain(testutils.Context(t), &head) + + require.Eventually(t, func() bool { return reportCalls.Load() == 2 }, 5*time.Second, 100*time.Millisecond) + }) + + t.Run("has default report period", func(t *testing.T) { + service := NewHeadReporterService(pgtest.NewSqlxDB(t), logger.TestLogger(t), NewMockHeadReporter(t)) + assert.Equal(t, service.reportPeriod, 15*time.Second) + }) +} diff --git a/core/services/headreporter/helper_test.go b/core/services/headreporter/helper_test.go new file mode 100644 index 00000000000..fa05182a851 --- /dev/null +++ b/core/services/headreporter/helper_test.go @@ -0,0 +1,5 @@ +package headreporter + +func (p *prometheusReporter) SetBackend(b PrometheusBackend) { + p.backend = b +} diff --git a/core/services/headreporter/prometheus_backend_mock.go b/core/services/headreporter/prometheus_backend_mock.go new file mode 100644 index 00000000000..ca83f6c4fbb --- /dev/null +++ b/core/services/headreporter/prometheus_backend_mock.go @@ -0,0 +1,204 @@ +// Code generated by mockery v2.43.2. DO NOT EDIT. + +package headreporter + +import ( + big "math/big" + + mock "github.com/stretchr/testify/mock" +) + +// MockPrometheusBackend is an autogenerated mock type for the PrometheusBackend type +type MockPrometheusBackend struct { + mock.Mock +} + +type MockPrometheusBackend_Expecter struct { + mock *mock.Mock +} + +func (_m *MockPrometheusBackend) EXPECT() *MockPrometheusBackend_Expecter { + return &MockPrometheusBackend_Expecter{mock: &_m.Mock} +} + +// SetMaxUnconfirmedAge provides a mock function with given fields: _a0, _a1 +func (_m *MockPrometheusBackend) SetMaxUnconfirmedAge(_a0 *big.Int, _a1 float64) { + _m.Called(_a0, _a1) +} + +// MockPrometheusBackend_SetMaxUnconfirmedAge_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetMaxUnconfirmedAge' +type MockPrometheusBackend_SetMaxUnconfirmedAge_Call struct { + *mock.Call +} + +// SetMaxUnconfirmedAge is a helper method to define mock.On call +// - _a0 *big.Int +// - _a1 float64 +func (_e *MockPrometheusBackend_Expecter) SetMaxUnconfirmedAge(_a0 interface{}, _a1 interface{}) *MockPrometheusBackend_SetMaxUnconfirmedAge_Call { + return &MockPrometheusBackend_SetMaxUnconfirmedAge_Call{Call: _e.mock.On("SetMaxUnconfirmedAge", _a0, _a1)} +} + +func (_c *MockPrometheusBackend_SetMaxUnconfirmedAge_Call) Run(run func(_a0 *big.Int, _a1 float64)) *MockPrometheusBackend_SetMaxUnconfirmedAge_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*big.Int), args[1].(float64)) + }) + return _c +} + +func (_c *MockPrometheusBackend_SetMaxUnconfirmedAge_Call) Return() *MockPrometheusBackend_SetMaxUnconfirmedAge_Call { + _c.Call.Return() + return _c +} + +func (_c *MockPrometheusBackend_SetMaxUnconfirmedAge_Call) RunAndReturn(run func(*big.Int, float64)) *MockPrometheusBackend_SetMaxUnconfirmedAge_Call { + _c.Call.Return(run) + return _c +} + +// SetMaxUnconfirmedBlocks provides a mock function with given fields: _a0, _a1 +func (_m *MockPrometheusBackend) SetMaxUnconfirmedBlocks(_a0 *big.Int, _a1 int64) { + _m.Called(_a0, _a1) +} + +// MockPrometheusBackend_SetMaxUnconfirmedBlocks_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetMaxUnconfirmedBlocks' +type MockPrometheusBackend_SetMaxUnconfirmedBlocks_Call struct { + *mock.Call +} + +// SetMaxUnconfirmedBlocks is a helper method to define mock.On call +// - _a0 *big.Int +// - _a1 int64 +func (_e *MockPrometheusBackend_Expecter) SetMaxUnconfirmedBlocks(_a0 interface{}, _a1 interface{}) *MockPrometheusBackend_SetMaxUnconfirmedBlocks_Call { + return &MockPrometheusBackend_SetMaxUnconfirmedBlocks_Call{Call: _e.mock.On("SetMaxUnconfirmedBlocks", _a0, _a1)} +} + +func (_c *MockPrometheusBackend_SetMaxUnconfirmedBlocks_Call) Run(run func(_a0 *big.Int, _a1 int64)) *MockPrometheusBackend_SetMaxUnconfirmedBlocks_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*big.Int), args[1].(int64)) + }) + return _c +} + +func (_c *MockPrometheusBackend_SetMaxUnconfirmedBlocks_Call) Return() *MockPrometheusBackend_SetMaxUnconfirmedBlocks_Call { + _c.Call.Return() + return _c +} + +func (_c *MockPrometheusBackend_SetMaxUnconfirmedBlocks_Call) RunAndReturn(run func(*big.Int, int64)) *MockPrometheusBackend_SetMaxUnconfirmedBlocks_Call { + _c.Call.Return(run) + return _c +} + +// SetPipelineRunsQueued provides a mock function with given fields: n +func (_m *MockPrometheusBackend) SetPipelineRunsQueued(n int) { + _m.Called(n) +} + +// MockPrometheusBackend_SetPipelineRunsQueued_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetPipelineRunsQueued' +type MockPrometheusBackend_SetPipelineRunsQueued_Call struct { + *mock.Call +} + +// SetPipelineRunsQueued is a helper method to define mock.On call +// - n int +func (_e *MockPrometheusBackend_Expecter) SetPipelineRunsQueued(n interface{}) *MockPrometheusBackend_SetPipelineRunsQueued_Call { + return &MockPrometheusBackend_SetPipelineRunsQueued_Call{Call: _e.mock.On("SetPipelineRunsQueued", n)} +} + +func (_c *MockPrometheusBackend_SetPipelineRunsQueued_Call) Run(run func(n int)) *MockPrometheusBackend_SetPipelineRunsQueued_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(int)) + }) + return _c +} + +func (_c *MockPrometheusBackend_SetPipelineRunsQueued_Call) Return() *MockPrometheusBackend_SetPipelineRunsQueued_Call { + _c.Call.Return() + return _c +} + +func (_c *MockPrometheusBackend_SetPipelineRunsQueued_Call) RunAndReturn(run func(int)) *MockPrometheusBackend_SetPipelineRunsQueued_Call { + _c.Call.Return(run) + return _c +} + +// SetPipelineTaskRunsQueued provides a mock function with given fields: n +func (_m *MockPrometheusBackend) SetPipelineTaskRunsQueued(n int) { + _m.Called(n) +} + +// MockPrometheusBackend_SetPipelineTaskRunsQueued_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetPipelineTaskRunsQueued' +type MockPrometheusBackend_SetPipelineTaskRunsQueued_Call struct { + *mock.Call +} + +// SetPipelineTaskRunsQueued is a helper method to define mock.On call +// - n int +func (_e *MockPrometheusBackend_Expecter) SetPipelineTaskRunsQueued(n interface{}) *MockPrometheusBackend_SetPipelineTaskRunsQueued_Call { + return &MockPrometheusBackend_SetPipelineTaskRunsQueued_Call{Call: _e.mock.On("SetPipelineTaskRunsQueued", n)} +} + +func (_c *MockPrometheusBackend_SetPipelineTaskRunsQueued_Call) Run(run func(n int)) *MockPrometheusBackend_SetPipelineTaskRunsQueued_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(int)) + }) + return _c +} + +func (_c *MockPrometheusBackend_SetPipelineTaskRunsQueued_Call) Return() *MockPrometheusBackend_SetPipelineTaskRunsQueued_Call { + _c.Call.Return() + return _c +} + +func (_c *MockPrometheusBackend_SetPipelineTaskRunsQueued_Call) RunAndReturn(run func(int)) *MockPrometheusBackend_SetPipelineTaskRunsQueued_Call { + _c.Call.Return(run) + return _c +} + +// SetUnconfirmedTransactions provides a mock function with given fields: _a0, _a1 +func (_m *MockPrometheusBackend) SetUnconfirmedTransactions(_a0 *big.Int, _a1 int64) { + _m.Called(_a0, _a1) +} + +// MockPrometheusBackend_SetUnconfirmedTransactions_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetUnconfirmedTransactions' +type MockPrometheusBackend_SetUnconfirmedTransactions_Call struct { + *mock.Call +} + +// SetUnconfirmedTransactions is a helper method to define mock.On call +// - _a0 *big.Int +// - _a1 int64 +func (_e *MockPrometheusBackend_Expecter) SetUnconfirmedTransactions(_a0 interface{}, _a1 interface{}) *MockPrometheusBackend_SetUnconfirmedTransactions_Call { + return &MockPrometheusBackend_SetUnconfirmedTransactions_Call{Call: _e.mock.On("SetUnconfirmedTransactions", _a0, _a1)} +} + +func (_c *MockPrometheusBackend_SetUnconfirmedTransactions_Call) Run(run func(_a0 *big.Int, _a1 int64)) *MockPrometheusBackend_SetUnconfirmedTransactions_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*big.Int), args[1].(int64)) + }) + return _c +} + +func (_c *MockPrometheusBackend_SetUnconfirmedTransactions_Call) Return() *MockPrometheusBackend_SetUnconfirmedTransactions_Call { + _c.Call.Return() + return _c +} + +func (_c *MockPrometheusBackend_SetUnconfirmedTransactions_Call) RunAndReturn(run func(*big.Int, int64)) *MockPrometheusBackend_SetUnconfirmedTransactions_Call { + _c.Call.Return(run) + return _c +} + +// NewMockPrometheusBackend creates a new instance of MockPrometheusBackend. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewMockPrometheusBackend(t interface { + mock.TestingT + Cleanup(func()) +}) *MockPrometheusBackend { + mock := &MockPrometheusBackend{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/core/services/headreporter/prometheus_reporter.go b/core/services/headreporter/prometheus_reporter.go new file mode 100644 index 00000000000..3e39c7aca45 --- /dev/null +++ b/core/services/headreporter/prometheus_reporter.go @@ -0,0 +1,193 @@ +package headreporter + +import ( + "context" + "fmt" + "math/big" + "time" + + "github.com/pkg/errors" + "github.com/prometheus/client_golang/prometheus" + "github.com/prometheus/client_golang/prometheus/promauto" + "go.uber.org/multierr" + + "github.com/smartcontractkit/chainlink-common/pkg/sqlutil" + txmgrcommon "github.com/smartcontractkit/chainlink/v2/common/txmgr" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/txmgr" + evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" + "github.com/smartcontractkit/chainlink/v2/core/chains/legacyevm" +) + +type ( + prometheusReporter struct { + ds sqlutil.DataSource + chains legacyevm.LegacyChainContainer + backend PrometheusBackend + } + + PrometheusBackend interface { + SetUnconfirmedTransactions(*big.Int, int64) + SetMaxUnconfirmedAge(*big.Int, float64) + SetMaxUnconfirmedBlocks(*big.Int, int64) + SetPipelineRunsQueued(n int) + SetPipelineTaskRunsQueued(n int) + } + + defaultBackend struct{} +) + +var ( + promUnconfirmedTransactions = promauto.NewGaugeVec(prometheus.GaugeOpts{ + Name: "unconfirmed_transactions", + Help: "Number of currently unconfirmed transactions", + }, []string{"evmChainID"}) + promMaxUnconfirmedAge = promauto.NewGaugeVec(prometheus.GaugeOpts{ + Name: "max_unconfirmed_tx_age", + Help: "The length of time the oldest unconfirmed transaction has been in that state (in seconds). Will be 0 if there are no unconfirmed transactions.", + }, []string{"evmChainID"}) + promMaxUnconfirmedBlocks = promauto.NewGaugeVec(prometheus.GaugeOpts{ + Name: "max_unconfirmed_blocks", + Help: "The max number of blocks any currently unconfirmed transaction has been unconfirmed for", + }, []string{"evmChainID"}) + promPipelineRunsQueued = promauto.NewGauge(prometheus.GaugeOpts{ + Name: "pipeline_runs_queued", + Help: "The total number of pipeline runs that are awaiting execution", + }) + promPipelineTaskRunsQueued = promauto.NewGauge(prometheus.GaugeOpts{ + Name: "pipeline_task_runs_queued", + Help: "The total number of pipeline task runs that are awaiting execution", + }) +) + +func NewPrometheusReporter(ds sqlutil.DataSource, chainContainer legacyevm.LegacyChainContainer) *prometheusReporter { + return &prometheusReporter{ + ds: ds, + chains: chainContainer, + backend: defaultBackend{}, + } +} + +func (pr *prometheusReporter) getTxm(evmChainID *big.Int) (txmgr.TxManager, error) { + chain, err := pr.chains.Get(evmChainID.String()) + if err != nil { + return nil, fmt.Errorf("failed to get chain: %w", err) + } + return chain.TxManager(), nil +} + +func (pr *prometheusReporter) ReportNewHead(ctx context.Context, head *evmtypes.Head) error { + evmChainID := head.EVMChainID.ToInt() + return multierr.Combine( + errors.Wrap(pr.reportPendingEthTxes(ctx, evmChainID), "reportPendingEthTxes failed"), + errors.Wrap(pr.reportMaxUnconfirmedAge(ctx, evmChainID), "reportMaxUnconfirmedAge failed"), + errors.Wrap(pr.reportMaxUnconfirmedBlocks(ctx, head), "reportMaxUnconfirmedBlocks failed"), + ) +} + +func (pr *prometheusReporter) reportPendingEthTxes(ctx context.Context, evmChainID *big.Int) (err error) { + txm, err := pr.getTxm(evmChainID) + if err != nil { + return fmt.Errorf("failed to get txm: %w", err) + } + + unconfirmed, err := txm.CountTransactionsByState(ctx, txmgrcommon.TxUnconfirmed) + if err != nil { + return fmt.Errorf("failed to query for unconfirmed eth_tx count: %w", err) + } + pr.backend.SetUnconfirmedTransactions(evmChainID, int64(unconfirmed)) + return nil +} + +func (pr *prometheusReporter) reportMaxUnconfirmedAge(ctx context.Context, evmChainID *big.Int) (err error) { + txm, err := pr.getTxm(evmChainID) + if err != nil { + return fmt.Errorf("failed to get txm: %w", err) + } + + broadcastAt, err := txm.FindEarliestUnconfirmedBroadcastTime(ctx) + if err != nil { + return fmt.Errorf("failed to query for min broadcast time: %w", err) + } + + var seconds float64 + if broadcastAt.Valid { + seconds = time.Since(broadcastAt.ValueOrZero()).Seconds() + } + pr.backend.SetMaxUnconfirmedAge(evmChainID, seconds) + return nil +} + +func (pr *prometheusReporter) reportMaxUnconfirmedBlocks(ctx context.Context, head *evmtypes.Head) (err error) { + txm, err := pr.getTxm(head.EVMChainID.ToInt()) + if err != nil { + return fmt.Errorf("failed to get txm: %w", err) + } + + earliestUnconfirmedTxBlock, err := txm.FindEarliestUnconfirmedTxAttemptBlock(ctx) + if err != nil { + return fmt.Errorf("failed to query for earliest unconfirmed tx block: %w", err) + } + + var blocksUnconfirmed int64 + if !earliestUnconfirmedTxBlock.IsZero() { + blocksUnconfirmed = head.Number - earliestUnconfirmedTxBlock.ValueOrZero() + } + pr.backend.SetMaxUnconfirmedBlocks(head.EVMChainID.ToInt(), blocksUnconfirmed) + return nil +} + +func (pr *prometheusReporter) ReportPeriodic(ctx context.Context) error { + return errors.Wrap(pr.reportPipelineRunStats(ctx), "reportPipelineRunStats failed") +} + +func (pr *prometheusReporter) reportPipelineRunStats(ctx context.Context) (err error) { + rows, err := pr.ds.QueryContext(ctx, ` +SELECT pipeline_run_id FROM pipeline_task_runs WHERE finished_at IS NULL +`) + if err != nil { + return errors.Wrap(err, "failed to query for pipeline_run_id") + } + defer func() { + err = multierr.Combine(err, rows.Close()) + }() + + pipelineTaskRunsQueued := 0 + pipelineRunsQueuedSet := make(map[int32]struct{}) + for rows.Next() { + var pipelineRunID int32 + if err = rows.Scan(&pipelineRunID); err != nil { + return errors.Wrap(err, "unexpected error scanning row") + } + pipelineTaskRunsQueued++ + pipelineRunsQueuedSet[pipelineRunID] = struct{}{} + } + if err = rows.Err(); err != nil { + return err + } + pipelineRunsQueued := len(pipelineRunsQueuedSet) + + pr.backend.SetPipelineTaskRunsQueued(pipelineTaskRunsQueued) + pr.backend.SetPipelineRunsQueued(pipelineRunsQueued) + + return nil +} + +func (defaultBackend) SetUnconfirmedTransactions(evmChainID *big.Int, n int64) { + promUnconfirmedTransactions.WithLabelValues(evmChainID.String()).Set(float64(n)) +} + +func (defaultBackend) SetMaxUnconfirmedAge(evmChainID *big.Int, s float64) { + promMaxUnconfirmedAge.WithLabelValues(evmChainID.String()).Set(s) +} + +func (defaultBackend) SetMaxUnconfirmedBlocks(evmChainID *big.Int, n int64) { + promMaxUnconfirmedBlocks.WithLabelValues(evmChainID.String()).Set(float64(n)) +} + +func (defaultBackend) SetPipelineRunsQueued(n int) { + promPipelineTaskRunsQueued.Set(float64(n)) +} + +func (defaultBackend) SetPipelineTaskRunsQueued(n int) { + promPipelineRunsQueued.Set(float64(n)) +} diff --git a/core/services/headreporter/prometheus_reporter_test.go b/core/services/headreporter/prometheus_reporter_test.go new file mode 100644 index 00000000000..d96e617fd79 --- /dev/null +++ b/core/services/headreporter/prometheus_reporter_test.go @@ -0,0 +1,143 @@ +package headreporter_test + +import ( + "math/big" + "testing" + "time" + + "github.com/jmoiron/sqlx" + "github.com/stretchr/testify/mock" + "github.com/stretchr/testify/require" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/gas" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/headtracker" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/txmgr" + "github.com/smartcontractkit/chainlink/v2/core/chains/legacyevm" + "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/configtest" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/evmtest" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/pgtest" + "github.com/smartcontractkit/chainlink/v2/core/logger" + "github.com/smartcontractkit/chainlink/v2/core/services/headreporter" +) + +func Test_PrometheusReporter(t *testing.T) { + t.Run("with nothing in the database", func(t *testing.T) { + db := pgtest.NewSqlxDB(t) + + backend := headreporter.NewMockPrometheusBackend(t) + backend.On("SetUnconfirmedTransactions", big.NewInt(0), int64(0)).Return() + backend.On("SetMaxUnconfirmedAge", big.NewInt(0), float64(0)).Return() + backend.On("SetMaxUnconfirmedBlocks", big.NewInt(0), int64(0)).Return() + + reporter := headreporter.NewPrometheusReporter(db, newLegacyChainContainer(t, db)) + reporter.SetBackend(backend) + + head := headreporter.NewHead() + err := reporter.ReportNewHead(testutils.Context(t), &head) + require.NoError(t, err) + + backend.On("SetPipelineTaskRunsQueued", 0).Return() + backend.On("SetPipelineRunsQueued", 0).Return() + err = reporter.ReportPeriodic(testutils.Context(t)) + require.NoError(t, err) + }) + + t.Run("with unconfirmed evm.txes", func(t *testing.T) { + db := pgtest.NewSqlxDB(t) + txStore := cltest.NewTestTxStore(t, db) + ethKeyStore := cltest.NewKeyStore(t, db).Eth() + _, fromAddress := cltest.MustInsertRandomKey(t, ethKeyStore) + + etx := cltest.MustInsertUnconfirmedEthTxWithBroadcastLegacyAttempt(t, txStore, 0, fromAddress) + cltest.MustInsertUnconfirmedEthTxWithBroadcastLegacyAttempt(t, txStore, 1, fromAddress) + cltest.MustInsertUnconfirmedEthTxWithBroadcastLegacyAttempt(t, txStore, 2, fromAddress) + require.NoError(t, txStore.UpdateTxAttemptBroadcastBeforeBlockNum(testutils.Context(t), etx.ID, 7)) + + backend := headreporter.NewMockPrometheusBackend(t) + backend.On("SetUnconfirmedTransactions", big.NewInt(0), int64(3)).Return() + backend.On("SetMaxUnconfirmedAge", big.NewInt(0), mock.MatchedBy(func(s float64) bool { + return s > 0 + })).Return() + backend.On("SetMaxUnconfirmedBlocks", big.NewInt(0), int64(35)).Return() + + reporter := headreporter.NewPrometheusReporter(db, newLegacyChainContainer(t, db)) + reporter.SetBackend(backend) + + head := headreporter.NewHead() + err := reporter.ReportNewHead(testutils.Context(t), &head) + require.NoError(t, err) + + backend.On("SetPipelineTaskRunsQueued", 0).Return() + backend.On("SetPipelineRunsQueued", 0).Return() + + err = reporter.ReportPeriodic(testutils.Context(t)) + require.NoError(t, err) + }) + + t.Run("with unfinished pipeline task runs", func(t *testing.T) { + db := pgtest.NewSqlxDB(t) + pgtest.MustExec(t, db, `SET CONSTRAINTS pipeline_task_runs_pipeline_run_id_fkey DEFERRED`) + + cltest.MustInsertUnfinishedPipelineTaskRun(t, db, 1) + cltest.MustInsertUnfinishedPipelineTaskRun(t, db, 1) + cltest.MustInsertUnfinishedPipelineTaskRun(t, db, 2) + + backend := headreporter.NewMockPrometheusBackend(t) + backend.On("SetUnconfirmedTransactions", big.NewInt(0), int64(0)).Return() + backend.On("SetMaxUnconfirmedAge", big.NewInt(0), float64(0)).Return() + backend.On("SetMaxUnconfirmedBlocks", big.NewInt(0), int64(0)).Return() + + reporter := headreporter.NewPrometheusReporter(db, newLegacyChainContainer(t, db)) + reporter.SetBackend(backend) + + head := headreporter.NewHead() + err := reporter.ReportNewHead(testutils.Context(t), &head) + require.NoError(t, err) + + backend.On("SetPipelineTaskRunsQueued", 3).Return() + backend.On("SetPipelineRunsQueued", 2).Return() + + err = reporter.ReportPeriodic(testutils.Context(t)) + require.NoError(t, err) + }) +} + +func newLegacyChainContainer(t *testing.T, db *sqlx.DB) legacyevm.LegacyChainContainer { + config, dbConfig, evmConfig := txmgr.MakeTestConfigs(t) + keyStore := cltest.NewKeyStore(t, db).Eth() + ethClient := evmtest.NewEthClientMockWithDefaultChain(t) + estimator, err := gas.NewEstimator(logger.TestLogger(t), ethClient, config, evmConfig.GasEstimator()) + require.NoError(t, err) + lggr := logger.TestLogger(t) + lpOpts := logpoller.Opts{ + PollPeriod: 100 * time.Millisecond, + FinalityDepth: 2, + BackfillBatchSize: 3, + RpcBatchSize: 2, + KeepFinalizedBlocksDepth: 1000, + } + ht := headtracker.NewSimulatedHeadTracker(ethClient, lpOpts.UseFinalityTag, lpOpts.FinalityDepth) + lp := logpoller.NewLogPoller(logpoller.NewORM(testutils.FixtureChainID, db, lggr), ethClient, lggr, ht, lpOpts) + + txm, err := txmgr.NewTxm( + db, + evmConfig, + evmConfig.GasEstimator(), + evmConfig.Transactions(), + nil, + dbConfig, + dbConfig.Listener(), + ethClient, + lggr, + lp, + keyStore, + estimator, + ht) + require.NoError(t, err) + + cfg := configtest.NewGeneralConfig(t, nil) + return cltest.NewLegacyChainsWithMockChainAndTxManager(t, ethClient, cfg, txm) +} diff --git a/core/services/headreporter/telemetry_reporter.go b/core/services/headreporter/telemetry_reporter.go new file mode 100644 index 00000000000..0d93ca59a41 --- /dev/null +++ b/core/services/headreporter/telemetry_reporter.go @@ -0,0 +1,69 @@ +package headreporter + +import ( + "context" + "math/big" + + "github.com/pkg/errors" + + "github.com/smartcontractkit/libocr/commontypes" + "google.golang.org/protobuf/proto" + + evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" + "github.com/smartcontractkit/chainlink/v2/core/logger" + "github.com/smartcontractkit/chainlink/v2/core/services/synchronization" + "github.com/smartcontractkit/chainlink/v2/core/services/synchronization/telem" + "github.com/smartcontractkit/chainlink/v2/core/services/telemetry" +) + +type telemetryReporter struct { + lggr logger.Logger + endpoints map[uint64]commontypes.MonitoringEndpoint +} + +func NewTelemetryReporter(monitoringEndpointGen telemetry.MonitoringEndpointGenerator, lggr logger.Logger, chainIDs ...*big.Int) HeadReporter { + endpoints := make(map[uint64]commontypes.MonitoringEndpoint) + for _, chainID := range chainIDs { + endpoints[chainID.Uint64()] = monitoringEndpointGen.GenMonitoringEndpoint("EVM", chainID.String(), "", synchronization.HeadReport) + } + return &telemetryReporter{lggr: lggr.Named("TelemetryReporter"), endpoints: endpoints} +} + +func (t *telemetryReporter) ReportNewHead(ctx context.Context, head *evmtypes.Head) error { + monitoringEndpoint := t.endpoints[head.EVMChainID.ToInt().Uint64()] + if monitoringEndpoint == nil { + return errors.Errorf("No monitoring endpoint provided chain_id=%d", head.EVMChainID.Int64()) + } + var finalized *telem.Block + latestFinalizedHead := head.LatestFinalizedHead() + if latestFinalizedHead != nil { + finalized = &telem.Block{ + Timestamp: uint64(latestFinalizedHead.GetTimestamp().UTC().Unix()), + Number: uint64(latestFinalizedHead.BlockNumber()), + Hash: latestFinalizedHead.BlockHash().Hex(), + } + } + request := &telem.HeadReportRequest{ + ChainID: head.EVMChainID.String(), + Latest: &telem.Block{ + Timestamp: uint64(head.Timestamp.UTC().Unix()), + Number: uint64(head.Number), + Hash: head.Hash.Hex(), + }, + Finalized: finalized, + } + bytes, err := proto.Marshal(request) + if err != nil { + return errors.WithMessage(err, "telem.HeadReportRequest marshal error") + } + monitoringEndpoint.SendLog(bytes) + if finalized == nil { + t.lggr.Infow("No finalized block was found", "chainID", head.EVMChainID.Int64(), + "head.number", head.Number, "chainLength", head.ChainLength()) + } + return nil +} + +func (t *telemetryReporter) ReportPeriodic(ctx context.Context) error { + return nil +} diff --git a/core/services/headreporter/telemetry_reporter_test.go b/core/services/headreporter/telemetry_reporter_test.go new file mode 100644 index 00000000000..6d7f4e3ddef --- /dev/null +++ b/core/services/headreporter/telemetry_reporter_test.go @@ -0,0 +1,107 @@ +package headreporter_test + +import ( + "math/big" + "testing" + "time" + + "github.com/ethereum/go-ethereum/common" + "github.com/stretchr/testify/assert" + "google.golang.org/protobuf/proto" + + mocks2 "github.com/smartcontractkit/chainlink/v2/common/types/mocks" + evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" + ubig "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils/big" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" + "github.com/smartcontractkit/chainlink/v2/core/logger" + "github.com/smartcontractkit/chainlink/v2/core/services/headreporter" + "github.com/smartcontractkit/chainlink/v2/core/services/synchronization" + "github.com/smartcontractkit/chainlink/v2/core/services/synchronization/telem" + "github.com/smartcontractkit/chainlink/v2/core/services/telemetry" +) + +func Test_TelemetryReporter_NewHead(t *testing.T) { + head := evmtypes.Head{ + Number: 42, + EVMChainID: ubig.NewI(100), + Hash: common.HexToHash("0x1010"), + Timestamp: time.UnixMilli(1000), + } + h41 := &evmtypes.Head{ + Number: 41, + Hash: common.HexToHash("0x1009"), + Timestamp: time.UnixMilli(999), + } + h41.IsFinalized.Store(true) + head.Parent.Store(h41) + requestBytes, err := proto.Marshal(&telem.HeadReportRequest{ + ChainID: "100", + Latest: &telem.Block{ + Timestamp: uint64(head.Timestamp.UTC().Unix()), + Number: 42, + Hash: head.Hash.Hex(), + }, + Finalized: &telem.Block{ + Timestamp: uint64(head.Parent.Load().Timestamp.UTC().Unix()), + Number: 41, + Hash: head.Parent.Load().Hash.Hex(), + }, + }) + assert.NoError(t, err) + + monitoringEndpoint := mocks2.NewMonitoringEndpoint(t) + monitoringEndpoint.On("SendLog", requestBytes).Return() + + monitoringEndpointGen := telemetry.NewMockMonitoringEndpointGenerator(t) + monitoringEndpointGen. + On("GenMonitoringEndpoint", "EVM", "100", "", synchronization.HeadReport). + Return(monitoringEndpoint) + reporter := headreporter.NewTelemetryReporter(monitoringEndpointGen, logger.TestLogger(t), big.NewInt(100)) + + err = reporter.ReportNewHead(testutils.Context(t), &head) + assert.NoError(t, err) +} + +func Test_TelemetryReporter_NewHeadMissingFinalized(t *testing.T) { + head := evmtypes.Head{ + Number: 42, + EVMChainID: ubig.NewI(100), + Hash: common.HexToHash("0x1010"), + Timestamp: time.UnixMilli(1000), + } + requestBytes, err := proto.Marshal(&telem.HeadReportRequest{ + ChainID: "100", + Latest: &telem.Block{ + Timestamp: uint64(head.Timestamp.UTC().Unix()), + Number: 42, + Hash: head.Hash.Hex(), + }, + }) + assert.NoError(t, err) + + monitoringEndpoint := mocks2.NewMonitoringEndpoint(t) + monitoringEndpoint.On("SendLog", requestBytes).Return() + + monitoringEndpointGen := telemetry.NewMockMonitoringEndpointGenerator(t) + monitoringEndpointGen. + On("GenMonitoringEndpoint", "EVM", "100", "", synchronization.HeadReport). + Return(monitoringEndpoint) + reporter := headreporter.NewTelemetryReporter(monitoringEndpointGen, logger.TestLogger(t), big.NewInt(100)) + + err = reporter.ReportNewHead(testutils.Context(t), &head) + assert.NoError(t, err) +} + +func Test_TelemetryReporter_NewHead_MissingEndpoint(t *testing.T) { + monitoringEndpointGen := telemetry.NewMockMonitoringEndpointGenerator(t) + monitoringEndpointGen. + On("GenMonitoringEndpoint", "EVM", "100", "", synchronization.HeadReport). + Return(nil) + + reporter := headreporter.NewTelemetryReporter(monitoringEndpointGen, logger.TestLogger(t), big.NewInt(100)) + + head := evmtypes.Head{Number: 42, EVMChainID: ubig.NewI(100)} + + err := reporter.ReportNewHead(testutils.Context(t), &head) + assert.Errorf(t, err, "No monitoring endpoint provided chain_id=100") +} diff --git a/core/services/health.go b/core/services/health.go index 32e97fd8db3..907187eb143 100644 --- a/core/services/health.go +++ b/core/services/health.go @@ -16,8 +16,6 @@ import ( var _ Checker = (*services.HealthChecker)(nil) // Checker provides a service which can be probed for system health. -// -//go:generate mockery --quiet --name Checker --output ./mocks/ --case=underscore type Checker interface { // Register a service for health checks. Register(service services.HealthReporter) error @@ -34,37 +32,40 @@ type Checker interface { Close() error } -type InBackupHealthReport struct { +type StartUpHealthReport struct { server http.Server lggr logger.Logger + mux *http.ServeMux } -func (i *InBackupHealthReport) Stop() { +func (i *StartUpHealthReport) Stop() { shutdownCtx, shutdownRelease := context.WithTimeout(context.Background(), time.Second) defer shutdownRelease() if err := i.server.Shutdown(shutdownCtx); err != nil { - i.lggr.Errorf("InBackupHealthReport shutdown error: %v", err) + i.lggr.Errorf("StartUpHealthReport shutdown error: %v", err) } - i.lggr.Info("InBackupHealthReport shutdown complete") + i.lggr.Info("StartUpHealthReport shutdown complete") } -func (i *InBackupHealthReport) Start() { +func (i *StartUpHealthReport) Start() { go func() { - http.HandleFunc("/health", func(w http.ResponseWriter, r *http.Request) { + i.mux.HandleFunc("/health", func(w http.ResponseWriter, r *http.Request) { w.WriteHeader(http.StatusNoContent) }) - i.lggr.Info("Starting InBackupHealthReport") + i.lggr.Info("Starting StartUpHealthReport") if err := i.server.ListenAndServe(); !errors.Is(err, http.ErrServerClosed) { - i.lggr.Errorf("InBackupHealthReport server error: %v", err) + i.lggr.Errorf("StartUpHealthReport server error: %v", err) } }() } -// NewInBackupHealthReport creates a new InBackupHealthReport that will serve the /health endpoint, useful for -// preventing shutdowns due to health-checks when running long backup tasks -func NewInBackupHealthReport(port uint16, lggr logger.Logger) *InBackupHealthReport { - return &InBackupHealthReport{ - server: http.Server{Addr: fmt.Sprintf(":%d", port), ReadHeaderTimeout: time.Second * 5}, +// NewStartUpHealthReport creates a new StartUpHealthReport that will serve the /health endpoint, useful for +// preventing shutdowns due to health-checks when running long backup tasks or migrations +func NewStartUpHealthReport(port uint16, lggr logger.Logger) *StartUpHealthReport { + mux := http.NewServeMux() + return &StartUpHealthReport{ lggr: lggr, + mux: mux, + server: http.Server{Addr: fmt.Sprintf(":%d", port), ReadHeaderTimeout: time.Second * 5, Handler: mux}, } } diff --git a/core/services/health_test.go b/core/services/health_test.go index b95b266ca19..3e5b6d9a2df 100644 --- a/core/services/health_test.go +++ b/core/services/health_test.go @@ -13,13 +13,13 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services" ) -func TestNewInBackupHealthReport(t *testing.T) { +func TestNewStartUpHealthReport(t *testing.T) { lggr, observed := logger.TestLoggerObserved(t, zapcore.InfoLevel) - ibhr := services.NewInBackupHealthReport(1234, lggr) + ibhr := services.NewStartUpHealthReport(1234, lggr) ibhr.Start() require.Eventually(t, func() bool { return observed.Len() >= 1 }, time.Second*5, time.Millisecond*100) - require.Equal(t, "Starting InBackupHealthReport", observed.TakeAll()[0].Message) + require.Equal(t, "Starting StartUpHealthReport", observed.TakeAll()[0].Message) req, err := http.NewRequestWithContext(tests.Context(t), "GET", "http://localhost:1234/health", nil) require.NoError(t, err) @@ -29,5 +29,5 @@ func TestNewInBackupHealthReport(t *testing.T) { ibhr.Stop() require.Eventually(t, func() bool { return observed.Len() >= 1 }, time.Second*5, time.Millisecond*100) - require.Equal(t, "InBackupHealthReport shutdown complete", observed.TakeAll()[0].Message) + require.Equal(t, "StartUpHealthReport shutdown complete", observed.TakeAll()[0].Message) } diff --git a/core/services/job/common.go b/core/services/job/common.go index 055195440b0..92978dd74e2 100644 --- a/core/services/job/common.go +++ b/core/services/job/common.go @@ -5,8 +5,6 @@ import ( "net/url" ) -//go:generate mockery --quiet --name ServiceCtx --output ./mocks/ --case=underscore - type Service interface { Start() error Close() error diff --git a/core/services/job/helpers_test.go b/core/services/job/helpers_test.go index d69056ae819..6f9bee66a0c 100644 --- a/core/services/job/helpers_test.go +++ b/core/services/job/helpers_test.go @@ -71,7 +71,6 @@ maxServiceWorkers = 100 cacheEvictionInterval = "1s" mercuryCredentialName = "%s" contractVersion = "v2.1" -useBufferV1 = %v ` voterTurnoutDataSourceTemplate = ` // data source 1 @@ -277,7 +276,7 @@ func makeOCR2Keeper21JobSpec(t testing.TB, ks keystore.Master, transmitter commo _, registry := cltest.MustInsertRandomKey(t, ks.Eth()) ocr2Keeper21Job := fmt.Sprintf(ocr2Keeper21JobSpecTemplate, registry.String(), kb.ID(), transmitter, - fmt.Sprintf("%s127.0.0.1:%d", bootstrapPeerID, bootstrapNodePort), chainID, "mercury cred", false) + fmt.Sprintf("%s127.0.0.1:%d", bootstrapPeerID, bootstrapNodePort), chainID, "mercury cred") jobSpec := makeOCR2JobSpecFromToml(t, ocr2Keeper21Job) diff --git a/core/services/job/job_orm_test.go b/core/services/job/job_orm_test.go index 6defdeeb614..e65e7fa5e12 100644 --- a/core/services/job/job_orm_test.go +++ b/core/services/job/job_orm_test.go @@ -26,7 +26,6 @@ import ( evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils/big" "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" - "github.com/smartcontractkit/chainlink/v2/core/internal/cltest/heavyweight" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/configtest" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/evmtest" @@ -48,6 +47,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/vrf/vrfcommon" "github.com/smartcontractkit/chainlink/v2/core/services/webhook" "github.com/smartcontractkit/chainlink/v2/core/testdata/testspecs" + "github.com/smartcontractkit/chainlink/v2/core/utils/testutils/heavyweight" ) const mercuryOracleTOML = `name = 'LINK / ETH | 0x0000000000000000000000000000000000000000000000000000000000000001 | verifier_proxy 0x0000000000000000000000000000000000000001' @@ -1861,6 +1861,7 @@ func Test_ORM_FindJobByWorkflow(t *testing.T) { spec: &job.WorkflowSpec{ ID: 1, Workflow: pkgworkflows.WFYamlSpec(t, "workflow01", addr1), + SpecType: job.YamlSpec, }, before: mustInsertWFJob, }, @@ -1881,6 +1882,7 @@ func Test_ORM_FindJobByWorkflow(t *testing.T) { var c job.WorkflowSpec c.ID = s.ID c.Workflow = pkgworkflows.WFYamlSpec(t, "workflow99", addr1) // insert with mismatched name + c.SpecType = job.YamlSpec return mustInsertWFJob(t, o, &c) }, }, @@ -1948,18 +1950,21 @@ func Test_ORM_FindJobByWorkflow_Multiple(t *testing.T) { wfYaml1 := pkgworkflows.WFYamlSpec(t, "workflow00", addr1) s1 := job.WorkflowSpec{ Workflow: wfYaml1, + SpecType: job.YamlSpec, } wantJobID1 := mustInsertWFJob(t, o, &s1) wfYaml2 := pkgworkflows.WFYamlSpec(t, "workflow01", addr1) s2 := job.WorkflowSpec{ Workflow: wfYaml2, + SpecType: job.YamlSpec, } wantJobID2 := mustInsertWFJob(t, o, &s2) wfYaml3 := pkgworkflows.WFYamlSpec(t, "workflow00", addr2) s3 := job.WorkflowSpec{ Workflow: wfYaml3, + SpecType: job.YamlSpec, } wantJobID3 := mustInsertWFJob(t, o, &s3) @@ -1976,13 +1981,14 @@ func Test_ORM_FindJobByWorkflow_Multiple(t *testing.T) { assert.EqualValues(t, j.WorkflowSpec.WorkflowID, s.WorkflowID) assert.EqualValues(t, j.WorkflowSpec.WorkflowOwner, s.WorkflowOwner) assert.EqualValues(t, j.WorkflowSpec.WorkflowName, s.WorkflowName) + assert.Equal(t, j.WorkflowSpec.SpecType, job.YamlSpec) } }) } func mustInsertWFJob(t *testing.T, orm job.ORM, s *job.WorkflowSpec) int32 { t.Helper() - err := s.Validate() + err := s.Validate(testutils.Context(t)) require.NoError(t, err, "failed to validate spec %v", s) ctx := testutils.Context(t) _, err = toml.Marshal(s.Workflow) diff --git a/core/services/job/job_pipeline_orm_integration_test.go b/core/services/job/job_pipeline_orm_integration_test.go index f8a43bca34d..ca6cc6f832e 100644 --- a/core/services/job/job_pipeline_orm_integration_test.go +++ b/core/services/job/job_pipeline_orm_integration_test.go @@ -175,7 +175,7 @@ func TestPipelineORM_Integration(t *testing.T) { pipelineSpecID := pipelineSpecs[0].ID // Create the run - runID, _, err := runner.ExecuteAndInsertFinishedRun(testutils.Context(t), pipelineSpecs[0], pipeline.NewVarsFrom(nil), lggr, true) + runID, _, err := runner.ExecuteAndInsertFinishedRun(testutils.Context(t), pipelineSpecs[0], pipeline.NewVarsFrom(nil), true) require.NoError(t, err) // Check the DB for the pipeline.Run diff --git a/core/services/job/kv_orm.go b/core/services/job/kv_orm.go index ba2b8d5f9ab..4f9955b48eb 100644 --- a/core/services/job/kv_orm.go +++ b/core/services/job/kv_orm.go @@ -10,8 +10,6 @@ import ( ) // KVStore is a simple KV store that can store and retrieve serializable data. -// -//go:generate mockery --quiet --name KVStore --output ./mocks/ --case=underscore type KVStore interface { Store(ctx context.Context, key string, val []byte) error Get(ctx context.Context, key string) ([]byte, error) diff --git a/core/services/job/mocks/kv_store.go b/core/services/job/mocks/kv_store.go index dba287da5e7..58fb68b4d9c 100644 --- a/core/services/job/mocks/kv_store.go +++ b/core/services/job/mocks/kv_store.go @@ -13,6 +13,14 @@ type KVStore struct { mock.Mock } +type KVStore_Expecter struct { + mock *mock.Mock +} + +func (_m *KVStore) EXPECT() *KVStore_Expecter { + return &KVStore_Expecter{mock: &_m.Mock} +} + // Get provides a mock function with given fields: ctx, key func (_m *KVStore) Get(ctx context.Context, key string) ([]byte, error) { ret := _m.Called(ctx, key) @@ -43,6 +51,35 @@ func (_m *KVStore) Get(ctx context.Context, key string) ([]byte, error) { return r0, r1 } +// KVStore_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' +type KVStore_Get_Call struct { + *mock.Call +} + +// Get is a helper method to define mock.On call +// - ctx context.Context +// - key string +func (_e *KVStore_Expecter) Get(ctx interface{}, key interface{}) *KVStore_Get_Call { + return &KVStore_Get_Call{Call: _e.mock.On("Get", ctx, key)} +} + +func (_c *KVStore_Get_Call) Run(run func(ctx context.Context, key string)) *KVStore_Get_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *KVStore_Get_Call) Return(_a0 []byte, _a1 error) *KVStore_Get_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *KVStore_Get_Call) RunAndReturn(run func(context.Context, string) ([]byte, error)) *KVStore_Get_Call { + _c.Call.Return(run) + return _c +} + // Store provides a mock function with given fields: ctx, key, val func (_m *KVStore) Store(ctx context.Context, key string, val []byte) error { ret := _m.Called(ctx, key, val) @@ -61,6 +98,36 @@ func (_m *KVStore) Store(ctx context.Context, key string, val []byte) error { return r0 } +// KVStore_Store_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Store' +type KVStore_Store_Call struct { + *mock.Call +} + +// Store is a helper method to define mock.On call +// - ctx context.Context +// - key string +// - val []byte +func (_e *KVStore_Expecter) Store(ctx interface{}, key interface{}, val interface{}) *KVStore_Store_Call { + return &KVStore_Store_Call{Call: _e.mock.On("Store", ctx, key, val)} +} + +func (_c *KVStore_Store_Call) Run(run func(ctx context.Context, key string, val []byte)) *KVStore_Store_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].([]byte)) + }) + return _c +} + +func (_c *KVStore_Store_Call) Return(_a0 error) *KVStore_Store_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *KVStore_Store_Call) RunAndReturn(run func(context.Context, string, []byte) error) *KVStore_Store_Call { + _c.Call.Return(run) + return _c +} + // NewKVStore creates a new instance of KVStore. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewKVStore(t interface { diff --git a/core/services/job/mocks/orm.go b/core/services/job/mocks/orm.go index 1d2615b519c..7d3e3de7711 100644 --- a/core/services/job/mocks/orm.go +++ b/core/services/job/mocks/orm.go @@ -26,6 +26,14 @@ type ORM struct { mock.Mock } +type ORM_Expecter struct { + mock *mock.Mock +} + +func (_m *ORM) EXPECT() *ORM_Expecter { + return &ORM_Expecter{mock: &_m.Mock} +} + // AssertBridgesExist provides a mock function with given fields: ctx, p func (_m *ORM) AssertBridgesExist(ctx context.Context, p pipeline.Pipeline) error { ret := _m.Called(ctx, p) @@ -44,6 +52,35 @@ func (_m *ORM) AssertBridgesExist(ctx context.Context, p pipeline.Pipeline) erro return r0 } +// ORM_AssertBridgesExist_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AssertBridgesExist' +type ORM_AssertBridgesExist_Call struct { + *mock.Call +} + +// AssertBridgesExist is a helper method to define mock.On call +// - ctx context.Context +// - p pipeline.Pipeline +func (_e *ORM_Expecter) AssertBridgesExist(ctx interface{}, p interface{}) *ORM_AssertBridgesExist_Call { + return &ORM_AssertBridgesExist_Call{Call: _e.mock.On("AssertBridgesExist", ctx, p)} +} + +func (_c *ORM_AssertBridgesExist_Call) Run(run func(ctx context.Context, p pipeline.Pipeline)) *ORM_AssertBridgesExist_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(pipeline.Pipeline)) + }) + return _c +} + +func (_c *ORM_AssertBridgesExist_Call) Return(_a0 error) *ORM_AssertBridgesExist_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ORM_AssertBridgesExist_Call) RunAndReturn(run func(context.Context, pipeline.Pipeline) error) *ORM_AssertBridgesExist_Call { + _c.Call.Return(run) + return _c +} + // Close provides a mock function with given fields: func (_m *ORM) Close() error { ret := _m.Called() @@ -62,6 +99,33 @@ func (_m *ORM) Close() error { return r0 } +// ORM_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close' +type ORM_Close_Call struct { + *mock.Call +} + +// Close is a helper method to define mock.On call +func (_e *ORM_Expecter) Close() *ORM_Close_Call { + return &ORM_Close_Call{Call: _e.mock.On("Close")} +} + +func (_c *ORM_Close_Call) Run(run func()) *ORM_Close_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ORM_Close_Call) Return(_a0 error) *ORM_Close_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ORM_Close_Call) RunAndReturn(run func() error) *ORM_Close_Call { + _c.Call.Return(run) + return _c +} + // CountPipelineRunsByJobID provides a mock function with given fields: ctx, jobID func (_m *ORM) CountPipelineRunsByJobID(ctx context.Context, jobID int32) (int32, error) { ret := _m.Called(ctx, jobID) @@ -90,6 +154,35 @@ func (_m *ORM) CountPipelineRunsByJobID(ctx context.Context, jobID int32) (int32 return r0, r1 } +// ORM_CountPipelineRunsByJobID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CountPipelineRunsByJobID' +type ORM_CountPipelineRunsByJobID_Call struct { + *mock.Call +} + +// CountPipelineRunsByJobID is a helper method to define mock.On call +// - ctx context.Context +// - jobID int32 +func (_e *ORM_Expecter) CountPipelineRunsByJobID(ctx interface{}, jobID interface{}) *ORM_CountPipelineRunsByJobID_Call { + return &ORM_CountPipelineRunsByJobID_Call{Call: _e.mock.On("CountPipelineRunsByJobID", ctx, jobID)} +} + +func (_c *ORM_CountPipelineRunsByJobID_Call) Run(run func(ctx context.Context, jobID int32)) *ORM_CountPipelineRunsByJobID_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(int32)) + }) + return _c +} + +func (_c *ORM_CountPipelineRunsByJobID_Call) Return(count int32, err error) *ORM_CountPipelineRunsByJobID_Call { + _c.Call.Return(count, err) + return _c +} + +func (_c *ORM_CountPipelineRunsByJobID_Call) RunAndReturn(run func(context.Context, int32) (int32, error)) *ORM_CountPipelineRunsByJobID_Call { + _c.Call.Return(run) + return _c +} + // CreateJob provides a mock function with given fields: ctx, jb func (_m *ORM) CreateJob(ctx context.Context, jb *job.Job) error { ret := _m.Called(ctx, jb) @@ -108,6 +201,35 @@ func (_m *ORM) CreateJob(ctx context.Context, jb *job.Job) error { return r0 } +// ORM_CreateJob_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateJob' +type ORM_CreateJob_Call struct { + *mock.Call +} + +// CreateJob is a helper method to define mock.On call +// - ctx context.Context +// - jb *job.Job +func (_e *ORM_Expecter) CreateJob(ctx interface{}, jb interface{}) *ORM_CreateJob_Call { + return &ORM_CreateJob_Call{Call: _e.mock.On("CreateJob", ctx, jb)} +} + +func (_c *ORM_CreateJob_Call) Run(run func(ctx context.Context, jb *job.Job)) *ORM_CreateJob_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*job.Job)) + }) + return _c +} + +func (_c *ORM_CreateJob_Call) Return(_a0 error) *ORM_CreateJob_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ORM_CreateJob_Call) RunAndReturn(run func(context.Context, *job.Job) error) *ORM_CreateJob_Call { + _c.Call.Return(run) + return _c +} + // DataSource provides a mock function with given fields: func (_m *ORM) DataSource() sqlutil.DataSource { ret := _m.Called() @@ -128,6 +250,33 @@ func (_m *ORM) DataSource() sqlutil.DataSource { return r0 } +// ORM_DataSource_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DataSource' +type ORM_DataSource_Call struct { + *mock.Call +} + +// DataSource is a helper method to define mock.On call +func (_e *ORM_Expecter) DataSource() *ORM_DataSource_Call { + return &ORM_DataSource_Call{Call: _e.mock.On("DataSource")} +} + +func (_c *ORM_DataSource_Call) Run(run func()) *ORM_DataSource_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ORM_DataSource_Call) Return(_a0 sqlutil.DataSource) *ORM_DataSource_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ORM_DataSource_Call) RunAndReturn(run func() sqlutil.DataSource) *ORM_DataSource_Call { + _c.Call.Return(run) + return _c +} + // DeleteJob provides a mock function with given fields: ctx, id func (_m *ORM) DeleteJob(ctx context.Context, id int32) error { ret := _m.Called(ctx, id) @@ -146,6 +295,35 @@ func (_m *ORM) DeleteJob(ctx context.Context, id int32) error { return r0 } +// ORM_DeleteJob_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteJob' +type ORM_DeleteJob_Call struct { + *mock.Call +} + +// DeleteJob is a helper method to define mock.On call +// - ctx context.Context +// - id int32 +func (_e *ORM_Expecter) DeleteJob(ctx interface{}, id interface{}) *ORM_DeleteJob_Call { + return &ORM_DeleteJob_Call{Call: _e.mock.On("DeleteJob", ctx, id)} +} + +func (_c *ORM_DeleteJob_Call) Run(run func(ctx context.Context, id int32)) *ORM_DeleteJob_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(int32)) + }) + return _c +} + +func (_c *ORM_DeleteJob_Call) Return(_a0 error) *ORM_DeleteJob_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ORM_DeleteJob_Call) RunAndReturn(run func(context.Context, int32) error) *ORM_DeleteJob_Call { + _c.Call.Return(run) + return _c +} + // DismissError provides a mock function with given fields: ctx, errorID func (_m *ORM) DismissError(ctx context.Context, errorID int64) error { ret := _m.Called(ctx, errorID) @@ -164,6 +342,35 @@ func (_m *ORM) DismissError(ctx context.Context, errorID int64) error { return r0 } +// ORM_DismissError_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DismissError' +type ORM_DismissError_Call struct { + *mock.Call +} + +// DismissError is a helper method to define mock.On call +// - ctx context.Context +// - errorID int64 +func (_e *ORM_Expecter) DismissError(ctx interface{}, errorID interface{}) *ORM_DismissError_Call { + return &ORM_DismissError_Call{Call: _e.mock.On("DismissError", ctx, errorID)} +} + +func (_c *ORM_DismissError_Call) Run(run func(ctx context.Context, errorID int64)) *ORM_DismissError_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(int64)) + }) + return _c +} + +func (_c *ORM_DismissError_Call) Return(_a0 error) *ORM_DismissError_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ORM_DismissError_Call) RunAndReturn(run func(context.Context, int64) error) *ORM_DismissError_Call { + _c.Call.Return(run) + return _c +} + // FindJob provides a mock function with given fields: ctx, id func (_m *ORM) FindJob(ctx context.Context, id int32) (job.Job, error) { ret := _m.Called(ctx, id) @@ -192,6 +399,35 @@ func (_m *ORM) FindJob(ctx context.Context, id int32) (job.Job, error) { return r0, r1 } +// ORM_FindJob_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindJob' +type ORM_FindJob_Call struct { + *mock.Call +} + +// FindJob is a helper method to define mock.On call +// - ctx context.Context +// - id int32 +func (_e *ORM_Expecter) FindJob(ctx interface{}, id interface{}) *ORM_FindJob_Call { + return &ORM_FindJob_Call{Call: _e.mock.On("FindJob", ctx, id)} +} + +func (_c *ORM_FindJob_Call) Run(run func(ctx context.Context, id int32)) *ORM_FindJob_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(int32)) + }) + return _c +} + +func (_c *ORM_FindJob_Call) Return(_a0 job.Job, _a1 error) *ORM_FindJob_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ORM_FindJob_Call) RunAndReturn(run func(context.Context, int32) (job.Job, error)) *ORM_FindJob_Call { + _c.Call.Return(run) + return _c +} + // FindJobByExternalJobID provides a mock function with given fields: ctx, _a1 func (_m *ORM) FindJobByExternalJobID(ctx context.Context, _a1 uuid.UUID) (job.Job, error) { ret := _m.Called(ctx, _a1) @@ -220,6 +456,35 @@ func (_m *ORM) FindJobByExternalJobID(ctx context.Context, _a1 uuid.UUID) (job.J return r0, r1 } +// ORM_FindJobByExternalJobID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindJobByExternalJobID' +type ORM_FindJobByExternalJobID_Call struct { + *mock.Call +} + +// FindJobByExternalJobID is a helper method to define mock.On call +// - ctx context.Context +// - _a1 uuid.UUID +func (_e *ORM_Expecter) FindJobByExternalJobID(ctx interface{}, _a1 interface{}) *ORM_FindJobByExternalJobID_Call { + return &ORM_FindJobByExternalJobID_Call{Call: _e.mock.On("FindJobByExternalJobID", ctx, _a1)} +} + +func (_c *ORM_FindJobByExternalJobID_Call) Run(run func(ctx context.Context, _a1 uuid.UUID)) *ORM_FindJobByExternalJobID_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(uuid.UUID)) + }) + return _c +} + +func (_c *ORM_FindJobByExternalJobID_Call) Return(_a0 job.Job, _a1 error) *ORM_FindJobByExternalJobID_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ORM_FindJobByExternalJobID_Call) RunAndReturn(run func(context.Context, uuid.UUID) (job.Job, error)) *ORM_FindJobByExternalJobID_Call { + _c.Call.Return(run) + return _c +} + // FindJobIDByAddress provides a mock function with given fields: ctx, address, evmChainID func (_m *ORM) FindJobIDByAddress(ctx context.Context, address types.EIP55Address, evmChainID *big.Big) (int32, error) { ret := _m.Called(ctx, address, evmChainID) @@ -248,6 +513,93 @@ func (_m *ORM) FindJobIDByAddress(ctx context.Context, address types.EIP55Addres return r0, r1 } +// ORM_FindJobIDByAddress_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindJobIDByAddress' +type ORM_FindJobIDByAddress_Call struct { + *mock.Call +} + +// FindJobIDByAddress is a helper method to define mock.On call +// - ctx context.Context +// - address types.EIP55Address +// - evmChainID *big.Big +func (_e *ORM_Expecter) FindJobIDByAddress(ctx interface{}, address interface{}, evmChainID interface{}) *ORM_FindJobIDByAddress_Call { + return &ORM_FindJobIDByAddress_Call{Call: _e.mock.On("FindJobIDByAddress", ctx, address, evmChainID)} +} + +func (_c *ORM_FindJobIDByAddress_Call) Run(run func(ctx context.Context, address types.EIP55Address, evmChainID *big.Big)) *ORM_FindJobIDByAddress_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(types.EIP55Address), args[2].(*big.Big)) + }) + return _c +} + +func (_c *ORM_FindJobIDByAddress_Call) Return(_a0 int32, _a1 error) *ORM_FindJobIDByAddress_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ORM_FindJobIDByAddress_Call) RunAndReturn(run func(context.Context, types.EIP55Address, *big.Big) (int32, error)) *ORM_FindJobIDByAddress_Call { + _c.Call.Return(run) + return _c +} + +// FindJobIDByCapabilityNameAndVersion provides a mock function with given fields: ctx, spec +func (_m *ORM) FindJobIDByCapabilityNameAndVersion(ctx context.Context, spec job.CCIPSpec) (int32, error) { + ret := _m.Called(ctx, spec) + + if len(ret) == 0 { + panic("no return value specified for FindJobIDByCapabilityNameAndVersion") + } + + var r0 int32 + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, job.CCIPSpec) (int32, error)); ok { + return rf(ctx, spec) + } + if rf, ok := ret.Get(0).(func(context.Context, job.CCIPSpec) int32); ok { + r0 = rf(ctx, spec) + } else { + r0 = ret.Get(0).(int32) + } + + if rf, ok := ret.Get(1).(func(context.Context, job.CCIPSpec) error); ok { + r1 = rf(ctx, spec) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ORM_FindJobIDByCapabilityNameAndVersion_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindJobIDByCapabilityNameAndVersion' +type ORM_FindJobIDByCapabilityNameAndVersion_Call struct { + *mock.Call +} + +// FindJobIDByCapabilityNameAndVersion is a helper method to define mock.On call +// - ctx context.Context +// - spec job.CCIPSpec +func (_e *ORM_Expecter) FindJobIDByCapabilityNameAndVersion(ctx interface{}, spec interface{}) *ORM_FindJobIDByCapabilityNameAndVersion_Call { + return &ORM_FindJobIDByCapabilityNameAndVersion_Call{Call: _e.mock.On("FindJobIDByCapabilityNameAndVersion", ctx, spec)} +} + +func (_c *ORM_FindJobIDByCapabilityNameAndVersion_Call) Run(run func(ctx context.Context, spec job.CCIPSpec)) *ORM_FindJobIDByCapabilityNameAndVersion_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(job.CCIPSpec)) + }) + return _c +} + +func (_c *ORM_FindJobIDByCapabilityNameAndVersion_Call) Return(_a0 int32, _a1 error) *ORM_FindJobIDByCapabilityNameAndVersion_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ORM_FindJobIDByCapabilityNameAndVersion_Call) RunAndReturn(run func(context.Context, job.CCIPSpec) (int32, error)) *ORM_FindJobIDByCapabilityNameAndVersion_Call { + _c.Call.Return(run) + return _c +} + // FindJobIDByWorkflow provides a mock function with given fields: ctx, spec func (_m *ORM) FindJobIDByWorkflow(ctx context.Context, spec job.WorkflowSpec) (int32, error) { ret := _m.Called(ctx, spec) @@ -276,6 +628,35 @@ func (_m *ORM) FindJobIDByWorkflow(ctx context.Context, spec job.WorkflowSpec) ( return r0, r1 } +// ORM_FindJobIDByWorkflow_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindJobIDByWorkflow' +type ORM_FindJobIDByWorkflow_Call struct { + *mock.Call +} + +// FindJobIDByWorkflow is a helper method to define mock.On call +// - ctx context.Context +// - spec job.WorkflowSpec +func (_e *ORM_Expecter) FindJobIDByWorkflow(ctx interface{}, spec interface{}) *ORM_FindJobIDByWorkflow_Call { + return &ORM_FindJobIDByWorkflow_Call{Call: _e.mock.On("FindJobIDByWorkflow", ctx, spec)} +} + +func (_c *ORM_FindJobIDByWorkflow_Call) Run(run func(ctx context.Context, spec job.WorkflowSpec)) *ORM_FindJobIDByWorkflow_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(job.WorkflowSpec)) + }) + return _c +} + +func (_c *ORM_FindJobIDByWorkflow_Call) Return(_a0 int32, _a1 error) *ORM_FindJobIDByWorkflow_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ORM_FindJobIDByWorkflow_Call) RunAndReturn(run func(context.Context, job.WorkflowSpec) (int32, error)) *ORM_FindJobIDByWorkflow_Call { + _c.Call.Return(run) + return _c +} + // FindJobIDsWithBridge provides a mock function with given fields: ctx, name func (_m *ORM) FindJobIDsWithBridge(ctx context.Context, name string) ([]int32, error) { ret := _m.Called(ctx, name) @@ -306,6 +687,35 @@ func (_m *ORM) FindJobIDsWithBridge(ctx context.Context, name string) ([]int32, return r0, r1 } +// ORM_FindJobIDsWithBridge_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindJobIDsWithBridge' +type ORM_FindJobIDsWithBridge_Call struct { + *mock.Call +} + +// FindJobIDsWithBridge is a helper method to define mock.On call +// - ctx context.Context +// - name string +func (_e *ORM_Expecter) FindJobIDsWithBridge(ctx interface{}, name interface{}) *ORM_FindJobIDsWithBridge_Call { + return &ORM_FindJobIDsWithBridge_Call{Call: _e.mock.On("FindJobIDsWithBridge", ctx, name)} +} + +func (_c *ORM_FindJobIDsWithBridge_Call) Run(run func(ctx context.Context, name string)) *ORM_FindJobIDsWithBridge_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *ORM_FindJobIDsWithBridge_Call) Return(_a0 []int32, _a1 error) *ORM_FindJobIDsWithBridge_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ORM_FindJobIDsWithBridge_Call) RunAndReturn(run func(context.Context, string) ([]int32, error)) *ORM_FindJobIDsWithBridge_Call { + _c.Call.Return(run) + return _c +} + // FindJobTx provides a mock function with given fields: ctx, id func (_m *ORM) FindJobTx(ctx context.Context, id int32) (job.Job, error) { ret := _m.Called(ctx, id) @@ -334,6 +744,35 @@ func (_m *ORM) FindJobTx(ctx context.Context, id int32) (job.Job, error) { return r0, r1 } +// ORM_FindJobTx_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindJobTx' +type ORM_FindJobTx_Call struct { + *mock.Call +} + +// FindJobTx is a helper method to define mock.On call +// - ctx context.Context +// - id int32 +func (_e *ORM_Expecter) FindJobTx(ctx interface{}, id interface{}) *ORM_FindJobTx_Call { + return &ORM_FindJobTx_Call{Call: _e.mock.On("FindJobTx", ctx, id)} +} + +func (_c *ORM_FindJobTx_Call) Run(run func(ctx context.Context, id int32)) *ORM_FindJobTx_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(int32)) + }) + return _c +} + +func (_c *ORM_FindJobTx_Call) Return(_a0 job.Job, _a1 error) *ORM_FindJobTx_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ORM_FindJobTx_Call) RunAndReturn(run func(context.Context, int32) (job.Job, error)) *ORM_FindJobTx_Call { + _c.Call.Return(run) + return _c +} + // FindJobWithoutSpecErrors provides a mock function with given fields: ctx, id func (_m *ORM) FindJobWithoutSpecErrors(ctx context.Context, id int32) (job.Job, error) { ret := _m.Called(ctx, id) @@ -362,6 +801,35 @@ func (_m *ORM) FindJobWithoutSpecErrors(ctx context.Context, id int32) (job.Job, return r0, r1 } +// ORM_FindJobWithoutSpecErrors_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindJobWithoutSpecErrors' +type ORM_FindJobWithoutSpecErrors_Call struct { + *mock.Call +} + +// FindJobWithoutSpecErrors is a helper method to define mock.On call +// - ctx context.Context +// - id int32 +func (_e *ORM_Expecter) FindJobWithoutSpecErrors(ctx interface{}, id interface{}) *ORM_FindJobWithoutSpecErrors_Call { + return &ORM_FindJobWithoutSpecErrors_Call{Call: _e.mock.On("FindJobWithoutSpecErrors", ctx, id)} +} + +func (_c *ORM_FindJobWithoutSpecErrors_Call) Run(run func(ctx context.Context, id int32)) *ORM_FindJobWithoutSpecErrors_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(int32)) + }) + return _c +} + +func (_c *ORM_FindJobWithoutSpecErrors_Call) Return(jb job.Job, err error) *ORM_FindJobWithoutSpecErrors_Call { + _c.Call.Return(jb, err) + return _c +} + +func (_c *ORM_FindJobWithoutSpecErrors_Call) RunAndReturn(run func(context.Context, int32) (job.Job, error)) *ORM_FindJobWithoutSpecErrors_Call { + _c.Call.Return(run) + return _c +} + // FindJobs provides a mock function with given fields: ctx, offset, limit func (_m *ORM) FindJobs(ctx context.Context, offset int, limit int) ([]job.Job, int, error) { ret := _m.Called(ctx, offset, limit) @@ -399,6 +867,36 @@ func (_m *ORM) FindJobs(ctx context.Context, offset int, limit int) ([]job.Job, return r0, r1, r2 } +// ORM_FindJobs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindJobs' +type ORM_FindJobs_Call struct { + *mock.Call +} + +// FindJobs is a helper method to define mock.On call +// - ctx context.Context +// - offset int +// - limit int +func (_e *ORM_Expecter) FindJobs(ctx interface{}, offset interface{}, limit interface{}) *ORM_FindJobs_Call { + return &ORM_FindJobs_Call{Call: _e.mock.On("FindJobs", ctx, offset, limit)} +} + +func (_c *ORM_FindJobs_Call) Run(run func(ctx context.Context, offset int, limit int)) *ORM_FindJobs_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(int), args[2].(int)) + }) + return _c +} + +func (_c *ORM_FindJobs_Call) Return(_a0 []job.Job, _a1 int, _a2 error) *ORM_FindJobs_Call { + _c.Call.Return(_a0, _a1, _a2) + return _c +} + +func (_c *ORM_FindJobs_Call) RunAndReturn(run func(context.Context, int, int) ([]job.Job, int, error)) *ORM_FindJobs_Call { + _c.Call.Return(run) + return _c +} + // FindJobsByPipelineSpecIDs provides a mock function with given fields: ctx, ids func (_m *ORM) FindJobsByPipelineSpecIDs(ctx context.Context, ids []int32) ([]job.Job, error) { ret := _m.Called(ctx, ids) @@ -429,6 +927,35 @@ func (_m *ORM) FindJobsByPipelineSpecIDs(ctx context.Context, ids []int32) ([]jo return r0, r1 } +// ORM_FindJobsByPipelineSpecIDs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindJobsByPipelineSpecIDs' +type ORM_FindJobsByPipelineSpecIDs_Call struct { + *mock.Call +} + +// FindJobsByPipelineSpecIDs is a helper method to define mock.On call +// - ctx context.Context +// - ids []int32 +func (_e *ORM_Expecter) FindJobsByPipelineSpecIDs(ctx interface{}, ids interface{}) *ORM_FindJobsByPipelineSpecIDs_Call { + return &ORM_FindJobsByPipelineSpecIDs_Call{Call: _e.mock.On("FindJobsByPipelineSpecIDs", ctx, ids)} +} + +func (_c *ORM_FindJobsByPipelineSpecIDs_Call) Run(run func(ctx context.Context, ids []int32)) *ORM_FindJobsByPipelineSpecIDs_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].([]int32)) + }) + return _c +} + +func (_c *ORM_FindJobsByPipelineSpecIDs_Call) Return(_a0 []job.Job, _a1 error) *ORM_FindJobsByPipelineSpecIDs_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ORM_FindJobsByPipelineSpecIDs_Call) RunAndReturn(run func(context.Context, []int32) ([]job.Job, error)) *ORM_FindJobsByPipelineSpecIDs_Call { + _c.Call.Return(run) + return _c +} + // FindOCR2JobIDByAddress provides a mock function with given fields: ctx, contractID, feedID func (_m *ORM) FindOCR2JobIDByAddress(ctx context.Context, contractID string, feedID *common.Hash) (int32, error) { ret := _m.Called(ctx, contractID, feedID) @@ -457,6 +984,36 @@ func (_m *ORM) FindOCR2JobIDByAddress(ctx context.Context, contractID string, fe return r0, r1 } +// ORM_FindOCR2JobIDByAddress_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindOCR2JobIDByAddress' +type ORM_FindOCR2JobIDByAddress_Call struct { + *mock.Call +} + +// FindOCR2JobIDByAddress is a helper method to define mock.On call +// - ctx context.Context +// - contractID string +// - feedID *common.Hash +func (_e *ORM_Expecter) FindOCR2JobIDByAddress(ctx interface{}, contractID interface{}, feedID interface{}) *ORM_FindOCR2JobIDByAddress_Call { + return &ORM_FindOCR2JobIDByAddress_Call{Call: _e.mock.On("FindOCR2JobIDByAddress", ctx, contractID, feedID)} +} + +func (_c *ORM_FindOCR2JobIDByAddress_Call) Run(run func(ctx context.Context, contractID string, feedID *common.Hash)) *ORM_FindOCR2JobIDByAddress_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(*common.Hash)) + }) + return _c +} + +func (_c *ORM_FindOCR2JobIDByAddress_Call) Return(_a0 int32, _a1 error) *ORM_FindOCR2JobIDByAddress_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ORM_FindOCR2JobIDByAddress_Call) RunAndReturn(run func(context.Context, string, *common.Hash) (int32, error)) *ORM_FindOCR2JobIDByAddress_Call { + _c.Call.Return(run) + return _c +} + // FindPipelineRunByID provides a mock function with given fields: ctx, id func (_m *ORM) FindPipelineRunByID(ctx context.Context, id int64) (pipeline.Run, error) { ret := _m.Called(ctx, id) @@ -485,6 +1042,35 @@ func (_m *ORM) FindPipelineRunByID(ctx context.Context, id int64) (pipeline.Run, return r0, r1 } +// ORM_FindPipelineRunByID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindPipelineRunByID' +type ORM_FindPipelineRunByID_Call struct { + *mock.Call +} + +// FindPipelineRunByID is a helper method to define mock.On call +// - ctx context.Context +// - id int64 +func (_e *ORM_Expecter) FindPipelineRunByID(ctx interface{}, id interface{}) *ORM_FindPipelineRunByID_Call { + return &ORM_FindPipelineRunByID_Call{Call: _e.mock.On("FindPipelineRunByID", ctx, id)} +} + +func (_c *ORM_FindPipelineRunByID_Call) Run(run func(ctx context.Context, id int64)) *ORM_FindPipelineRunByID_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(int64)) + }) + return _c +} + +func (_c *ORM_FindPipelineRunByID_Call) Return(_a0 pipeline.Run, _a1 error) *ORM_FindPipelineRunByID_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ORM_FindPipelineRunByID_Call) RunAndReturn(run func(context.Context, int64) (pipeline.Run, error)) *ORM_FindPipelineRunByID_Call { + _c.Call.Return(run) + return _c +} + // FindPipelineRunIDsByJobID provides a mock function with given fields: ctx, jobID, offset, limit func (_m *ORM) FindPipelineRunIDsByJobID(ctx context.Context, jobID int32, offset int, limit int) ([]int64, error) { ret := _m.Called(ctx, jobID, offset, limit) @@ -515,6 +1101,37 @@ func (_m *ORM) FindPipelineRunIDsByJobID(ctx context.Context, jobID int32, offse return r0, r1 } +// ORM_FindPipelineRunIDsByJobID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindPipelineRunIDsByJobID' +type ORM_FindPipelineRunIDsByJobID_Call struct { + *mock.Call +} + +// FindPipelineRunIDsByJobID is a helper method to define mock.On call +// - ctx context.Context +// - jobID int32 +// - offset int +// - limit int +func (_e *ORM_Expecter) FindPipelineRunIDsByJobID(ctx interface{}, jobID interface{}, offset interface{}, limit interface{}) *ORM_FindPipelineRunIDsByJobID_Call { + return &ORM_FindPipelineRunIDsByJobID_Call{Call: _e.mock.On("FindPipelineRunIDsByJobID", ctx, jobID, offset, limit)} +} + +func (_c *ORM_FindPipelineRunIDsByJobID_Call) Run(run func(ctx context.Context, jobID int32, offset int, limit int)) *ORM_FindPipelineRunIDsByJobID_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(int32), args[2].(int), args[3].(int)) + }) + return _c +} + +func (_c *ORM_FindPipelineRunIDsByJobID_Call) Return(ids []int64, err error) *ORM_FindPipelineRunIDsByJobID_Call { + _c.Call.Return(ids, err) + return _c +} + +func (_c *ORM_FindPipelineRunIDsByJobID_Call) RunAndReturn(run func(context.Context, int32, int, int) ([]int64, error)) *ORM_FindPipelineRunIDsByJobID_Call { + _c.Call.Return(run) + return _c +} + // FindPipelineRunsByIDs provides a mock function with given fields: ctx, ids func (_m *ORM) FindPipelineRunsByIDs(ctx context.Context, ids []int64) ([]pipeline.Run, error) { ret := _m.Called(ctx, ids) @@ -545,6 +1162,35 @@ func (_m *ORM) FindPipelineRunsByIDs(ctx context.Context, ids []int64) ([]pipeli return r0, r1 } +// ORM_FindPipelineRunsByIDs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindPipelineRunsByIDs' +type ORM_FindPipelineRunsByIDs_Call struct { + *mock.Call +} + +// FindPipelineRunsByIDs is a helper method to define mock.On call +// - ctx context.Context +// - ids []int64 +func (_e *ORM_Expecter) FindPipelineRunsByIDs(ctx interface{}, ids interface{}) *ORM_FindPipelineRunsByIDs_Call { + return &ORM_FindPipelineRunsByIDs_Call{Call: _e.mock.On("FindPipelineRunsByIDs", ctx, ids)} +} + +func (_c *ORM_FindPipelineRunsByIDs_Call) Run(run func(ctx context.Context, ids []int64)) *ORM_FindPipelineRunsByIDs_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].([]int64)) + }) + return _c +} + +func (_c *ORM_FindPipelineRunsByIDs_Call) Return(runs []pipeline.Run, err error) *ORM_FindPipelineRunsByIDs_Call { + _c.Call.Return(runs, err) + return _c +} + +func (_c *ORM_FindPipelineRunsByIDs_Call) RunAndReturn(run func(context.Context, []int64) ([]pipeline.Run, error)) *ORM_FindPipelineRunsByIDs_Call { + _c.Call.Return(run) + return _c +} + // FindSpecError provides a mock function with given fields: ctx, id func (_m *ORM) FindSpecError(ctx context.Context, id int64) (job.SpecError, error) { ret := _m.Called(ctx, id) @@ -573,6 +1219,35 @@ func (_m *ORM) FindSpecError(ctx context.Context, id int64) (job.SpecError, erro return r0, r1 } +// ORM_FindSpecError_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindSpecError' +type ORM_FindSpecError_Call struct { + *mock.Call +} + +// FindSpecError is a helper method to define mock.On call +// - ctx context.Context +// - id int64 +func (_e *ORM_Expecter) FindSpecError(ctx interface{}, id interface{}) *ORM_FindSpecError_Call { + return &ORM_FindSpecError_Call{Call: _e.mock.On("FindSpecError", ctx, id)} +} + +func (_c *ORM_FindSpecError_Call) Run(run func(ctx context.Context, id int64)) *ORM_FindSpecError_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(int64)) + }) + return _c +} + +func (_c *ORM_FindSpecError_Call) Return(_a0 job.SpecError, _a1 error) *ORM_FindSpecError_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ORM_FindSpecError_Call) RunAndReturn(run func(context.Context, int64) (job.SpecError, error)) *ORM_FindSpecError_Call { + _c.Call.Return(run) + return _c +} + // FindSpecErrorsByJobIDs provides a mock function with given fields: ctx, ids func (_m *ORM) FindSpecErrorsByJobIDs(ctx context.Context, ids []int32) ([]job.SpecError, error) { ret := _m.Called(ctx, ids) @@ -603,6 +1278,35 @@ func (_m *ORM) FindSpecErrorsByJobIDs(ctx context.Context, ids []int32) ([]job.S return r0, r1 } +// ORM_FindSpecErrorsByJobIDs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindSpecErrorsByJobIDs' +type ORM_FindSpecErrorsByJobIDs_Call struct { + *mock.Call +} + +// FindSpecErrorsByJobIDs is a helper method to define mock.On call +// - ctx context.Context +// - ids []int32 +func (_e *ORM_Expecter) FindSpecErrorsByJobIDs(ctx interface{}, ids interface{}) *ORM_FindSpecErrorsByJobIDs_Call { + return &ORM_FindSpecErrorsByJobIDs_Call{Call: _e.mock.On("FindSpecErrorsByJobIDs", ctx, ids)} +} + +func (_c *ORM_FindSpecErrorsByJobIDs_Call) Run(run func(ctx context.Context, ids []int32)) *ORM_FindSpecErrorsByJobIDs_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].([]int32)) + }) + return _c +} + +func (_c *ORM_FindSpecErrorsByJobIDs_Call) Return(_a0 []job.SpecError, _a1 error) *ORM_FindSpecErrorsByJobIDs_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ORM_FindSpecErrorsByJobIDs_Call) RunAndReturn(run func(context.Context, []int32) ([]job.SpecError, error)) *ORM_FindSpecErrorsByJobIDs_Call { + _c.Call.Return(run) + return _c +} + // FindTaskResultByRunIDAndTaskName provides a mock function with given fields: ctx, runID, taskName func (_m *ORM) FindTaskResultByRunIDAndTaskName(ctx context.Context, runID int64, taskName string) ([]byte, error) { ret := _m.Called(ctx, runID, taskName) @@ -633,6 +1337,36 @@ func (_m *ORM) FindTaskResultByRunIDAndTaskName(ctx context.Context, runID int64 return r0, r1 } +// ORM_FindTaskResultByRunIDAndTaskName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindTaskResultByRunIDAndTaskName' +type ORM_FindTaskResultByRunIDAndTaskName_Call struct { + *mock.Call +} + +// FindTaskResultByRunIDAndTaskName is a helper method to define mock.On call +// - ctx context.Context +// - runID int64 +// - taskName string +func (_e *ORM_Expecter) FindTaskResultByRunIDAndTaskName(ctx interface{}, runID interface{}, taskName interface{}) *ORM_FindTaskResultByRunIDAndTaskName_Call { + return &ORM_FindTaskResultByRunIDAndTaskName_Call{Call: _e.mock.On("FindTaskResultByRunIDAndTaskName", ctx, runID, taskName)} +} + +func (_c *ORM_FindTaskResultByRunIDAndTaskName_Call) Run(run func(ctx context.Context, runID int64, taskName string)) *ORM_FindTaskResultByRunIDAndTaskName_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(int64), args[2].(string)) + }) + return _c +} + +func (_c *ORM_FindTaskResultByRunIDAndTaskName_Call) Return(_a0 []byte, _a1 error) *ORM_FindTaskResultByRunIDAndTaskName_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ORM_FindTaskResultByRunIDAndTaskName_Call) RunAndReturn(run func(context.Context, int64, string) ([]byte, error)) *ORM_FindTaskResultByRunIDAndTaskName_Call { + _c.Call.Return(run) + return _c +} + // InsertJob provides a mock function with given fields: ctx, _a1 func (_m *ORM) InsertJob(ctx context.Context, _a1 *job.Job) error { ret := _m.Called(ctx, _a1) @@ -651,6 +1385,35 @@ func (_m *ORM) InsertJob(ctx context.Context, _a1 *job.Job) error { return r0 } +// ORM_InsertJob_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'InsertJob' +type ORM_InsertJob_Call struct { + *mock.Call +} + +// InsertJob is a helper method to define mock.On call +// - ctx context.Context +// - _a1 *job.Job +func (_e *ORM_Expecter) InsertJob(ctx interface{}, _a1 interface{}) *ORM_InsertJob_Call { + return &ORM_InsertJob_Call{Call: _e.mock.On("InsertJob", ctx, _a1)} +} + +func (_c *ORM_InsertJob_Call) Run(run func(ctx context.Context, _a1 *job.Job)) *ORM_InsertJob_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*job.Job)) + }) + return _c +} + +func (_c *ORM_InsertJob_Call) Return(_a0 error) *ORM_InsertJob_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ORM_InsertJob_Call) RunAndReturn(run func(context.Context, *job.Job) error) *ORM_InsertJob_Call { + _c.Call.Return(run) + return _c +} + // InsertWebhookSpec provides a mock function with given fields: ctx, webhookSpec func (_m *ORM) InsertWebhookSpec(ctx context.Context, webhookSpec *job.WebhookSpec) error { ret := _m.Called(ctx, webhookSpec) @@ -669,6 +1432,35 @@ func (_m *ORM) InsertWebhookSpec(ctx context.Context, webhookSpec *job.WebhookSp return r0 } +// ORM_InsertWebhookSpec_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'InsertWebhookSpec' +type ORM_InsertWebhookSpec_Call struct { + *mock.Call +} + +// InsertWebhookSpec is a helper method to define mock.On call +// - ctx context.Context +// - webhookSpec *job.WebhookSpec +func (_e *ORM_Expecter) InsertWebhookSpec(ctx interface{}, webhookSpec interface{}) *ORM_InsertWebhookSpec_Call { + return &ORM_InsertWebhookSpec_Call{Call: _e.mock.On("InsertWebhookSpec", ctx, webhookSpec)} +} + +func (_c *ORM_InsertWebhookSpec_Call) Run(run func(ctx context.Context, webhookSpec *job.WebhookSpec)) *ORM_InsertWebhookSpec_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*job.WebhookSpec)) + }) + return _c +} + +func (_c *ORM_InsertWebhookSpec_Call) Return(_a0 error) *ORM_InsertWebhookSpec_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ORM_InsertWebhookSpec_Call) RunAndReturn(run func(context.Context, *job.WebhookSpec) error) *ORM_InsertWebhookSpec_Call { + _c.Call.Return(run) + return _c +} + // PipelineRuns provides a mock function with given fields: ctx, jobID, offset, size func (_m *ORM) PipelineRuns(ctx context.Context, jobID *int32, offset int, size int) ([]pipeline.Run, int, error) { ret := _m.Called(ctx, jobID, offset, size) @@ -706,6 +1498,37 @@ func (_m *ORM) PipelineRuns(ctx context.Context, jobID *int32, offset int, size return r0, r1, r2 } +// ORM_PipelineRuns_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PipelineRuns' +type ORM_PipelineRuns_Call struct { + *mock.Call +} + +// PipelineRuns is a helper method to define mock.On call +// - ctx context.Context +// - jobID *int32 +// - offset int +// - size int +func (_e *ORM_Expecter) PipelineRuns(ctx interface{}, jobID interface{}, offset interface{}, size interface{}) *ORM_PipelineRuns_Call { + return &ORM_PipelineRuns_Call{Call: _e.mock.On("PipelineRuns", ctx, jobID, offset, size)} +} + +func (_c *ORM_PipelineRuns_Call) Run(run func(ctx context.Context, jobID *int32, offset int, size int)) *ORM_PipelineRuns_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*int32), args[2].(int), args[3].(int)) + }) + return _c +} + +func (_c *ORM_PipelineRuns_Call) Return(_a0 []pipeline.Run, _a1 int, _a2 error) *ORM_PipelineRuns_Call { + _c.Call.Return(_a0, _a1, _a2) + return _c +} + +func (_c *ORM_PipelineRuns_Call) RunAndReturn(run func(context.Context, *int32, int, int) ([]pipeline.Run, int, error)) *ORM_PipelineRuns_Call { + _c.Call.Return(run) + return _c +} + // RecordError provides a mock function with given fields: ctx, jobID, description func (_m *ORM) RecordError(ctx context.Context, jobID int32, description string) error { ret := _m.Called(ctx, jobID, description) @@ -724,11 +1547,71 @@ func (_m *ORM) RecordError(ctx context.Context, jobID int32, description string) return r0 } +// ORM_RecordError_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RecordError' +type ORM_RecordError_Call struct { + *mock.Call +} + +// RecordError is a helper method to define mock.On call +// - ctx context.Context +// - jobID int32 +// - description string +func (_e *ORM_Expecter) RecordError(ctx interface{}, jobID interface{}, description interface{}) *ORM_RecordError_Call { + return &ORM_RecordError_Call{Call: _e.mock.On("RecordError", ctx, jobID, description)} +} + +func (_c *ORM_RecordError_Call) Run(run func(ctx context.Context, jobID int32, description string)) *ORM_RecordError_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(int32), args[2].(string)) + }) + return _c +} + +func (_c *ORM_RecordError_Call) Return(_a0 error) *ORM_RecordError_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ORM_RecordError_Call) RunAndReturn(run func(context.Context, int32, string) error) *ORM_RecordError_Call { + _c.Call.Return(run) + return _c +} + // TryRecordError provides a mock function with given fields: ctx, jobID, description func (_m *ORM) TryRecordError(ctx context.Context, jobID int32, description string) { _m.Called(ctx, jobID, description) } +// ORM_TryRecordError_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TryRecordError' +type ORM_TryRecordError_Call struct { + *mock.Call +} + +// TryRecordError is a helper method to define mock.On call +// - ctx context.Context +// - jobID int32 +// - description string +func (_e *ORM_Expecter) TryRecordError(ctx interface{}, jobID interface{}, description interface{}) *ORM_TryRecordError_Call { + return &ORM_TryRecordError_Call{Call: _e.mock.On("TryRecordError", ctx, jobID, description)} +} + +func (_c *ORM_TryRecordError_Call) Run(run func(ctx context.Context, jobID int32, description string)) *ORM_TryRecordError_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(int32), args[2].(string)) + }) + return _c +} + +func (_c *ORM_TryRecordError_Call) Return() *ORM_TryRecordError_Call { + _c.Call.Return() + return _c +} + +func (_c *ORM_TryRecordError_Call) RunAndReturn(run func(context.Context, int32, string)) *ORM_TryRecordError_Call { + _c.Call.Return(run) + return _c +} + // WithDataSource provides a mock function with given fields: source func (_m *ORM) WithDataSource(source sqlutil.DataSource) job.ORM { ret := _m.Called(source) @@ -749,6 +1632,34 @@ func (_m *ORM) WithDataSource(source sqlutil.DataSource) job.ORM { return r0 } +// ORM_WithDataSource_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WithDataSource' +type ORM_WithDataSource_Call struct { + *mock.Call +} + +// WithDataSource is a helper method to define mock.On call +// - source sqlutil.DataSource +func (_e *ORM_Expecter) WithDataSource(source interface{}) *ORM_WithDataSource_Call { + return &ORM_WithDataSource_Call{Call: _e.mock.On("WithDataSource", source)} +} + +func (_c *ORM_WithDataSource_Call) Run(run func(source sqlutil.DataSource)) *ORM_WithDataSource_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(sqlutil.DataSource)) + }) + return _c +} + +func (_c *ORM_WithDataSource_Call) Return(_a0 job.ORM) *ORM_WithDataSource_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ORM_WithDataSource_Call) RunAndReturn(run func(sqlutil.DataSource) job.ORM) *ORM_WithDataSource_Call { + _c.Call.Return(run) + return _c +} + // NewORM creates a new instance of ORM. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewORM(t interface { diff --git a/core/services/job/mocks/service_ctx.go b/core/services/job/mocks/service_ctx.go index 2871f7fcf07..1bacc42c1aa 100644 --- a/core/services/job/mocks/service_ctx.go +++ b/core/services/job/mocks/service_ctx.go @@ -13,6 +13,14 @@ type ServiceCtx struct { mock.Mock } +type ServiceCtx_Expecter struct { + mock *mock.Mock +} + +func (_m *ServiceCtx) EXPECT() *ServiceCtx_Expecter { + return &ServiceCtx_Expecter{mock: &_m.Mock} +} + // Close provides a mock function with given fields: func (_m *ServiceCtx) Close() error { ret := _m.Called() @@ -31,6 +39,33 @@ func (_m *ServiceCtx) Close() error { return r0 } +// ServiceCtx_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close' +type ServiceCtx_Close_Call struct { + *mock.Call +} + +// Close is a helper method to define mock.On call +func (_e *ServiceCtx_Expecter) Close() *ServiceCtx_Close_Call { + return &ServiceCtx_Close_Call{Call: _e.mock.On("Close")} +} + +func (_c *ServiceCtx_Close_Call) Run(run func()) *ServiceCtx_Close_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ServiceCtx_Close_Call) Return(_a0 error) *ServiceCtx_Close_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ServiceCtx_Close_Call) RunAndReturn(run func() error) *ServiceCtx_Close_Call { + _c.Call.Return(run) + return _c +} + // Start provides a mock function with given fields: _a0 func (_m *ServiceCtx) Start(_a0 context.Context) error { ret := _m.Called(_a0) @@ -49,6 +84,34 @@ func (_m *ServiceCtx) Start(_a0 context.Context) error { return r0 } +// ServiceCtx_Start_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Start' +type ServiceCtx_Start_Call struct { + *mock.Call +} + +// Start is a helper method to define mock.On call +// - _a0 context.Context +func (_e *ServiceCtx_Expecter) Start(_a0 interface{}) *ServiceCtx_Start_Call { + return &ServiceCtx_Start_Call{Call: _e.mock.On("Start", _a0)} +} + +func (_c *ServiceCtx_Start_Call) Run(run func(_a0 context.Context)) *ServiceCtx_Start_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *ServiceCtx_Start_Call) Return(_a0 error) *ServiceCtx_Start_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ServiceCtx_Start_Call) RunAndReturn(run func(context.Context) error) *ServiceCtx_Start_Call { + _c.Call.Return(run) + return _c +} + // NewServiceCtx creates a new instance of ServiceCtx. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewServiceCtx(t interface { diff --git a/core/services/job/mocks/spawner.go b/core/services/job/mocks/spawner.go index 24bfa36bec0..d44d9bda179 100644 --- a/core/services/job/mocks/spawner.go +++ b/core/services/job/mocks/spawner.go @@ -16,6 +16,14 @@ type Spawner struct { mock.Mock } +type Spawner_Expecter struct { + mock *mock.Mock +} + +func (_m *Spawner) EXPECT() *Spawner_Expecter { + return &Spawner_Expecter{mock: &_m.Mock} +} + // ActiveJobs provides a mock function with given fields: func (_m *Spawner) ActiveJobs() map[int32]job.Job { ret := _m.Called() @@ -36,6 +44,33 @@ func (_m *Spawner) ActiveJobs() map[int32]job.Job { return r0 } +// Spawner_ActiveJobs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ActiveJobs' +type Spawner_ActiveJobs_Call struct { + *mock.Call +} + +// ActiveJobs is a helper method to define mock.On call +func (_e *Spawner_Expecter) ActiveJobs() *Spawner_ActiveJobs_Call { + return &Spawner_ActiveJobs_Call{Call: _e.mock.On("ActiveJobs")} +} + +func (_c *Spawner_ActiveJobs_Call) Run(run func()) *Spawner_ActiveJobs_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Spawner_ActiveJobs_Call) Return(_a0 map[int32]job.Job) *Spawner_ActiveJobs_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Spawner_ActiveJobs_Call) RunAndReturn(run func() map[int32]job.Job) *Spawner_ActiveJobs_Call { + _c.Call.Return(run) + return _c +} + // Close provides a mock function with given fields: func (_m *Spawner) Close() error { ret := _m.Called() @@ -54,6 +89,33 @@ func (_m *Spawner) Close() error { return r0 } +// Spawner_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close' +type Spawner_Close_Call struct { + *mock.Call +} + +// Close is a helper method to define mock.On call +func (_e *Spawner_Expecter) Close() *Spawner_Close_Call { + return &Spawner_Close_Call{Call: _e.mock.On("Close")} +} + +func (_c *Spawner_Close_Call) Run(run func()) *Spawner_Close_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Spawner_Close_Call) Return(_a0 error) *Spawner_Close_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Spawner_Close_Call) RunAndReturn(run func() error) *Spawner_Close_Call { + _c.Call.Return(run) + return _c +} + // CreateJob provides a mock function with given fields: ctx, ds, jb func (_m *Spawner) CreateJob(ctx context.Context, ds sqlutil.DataSource, jb *job.Job) error { ret := _m.Called(ctx, ds, jb) @@ -72,6 +134,36 @@ func (_m *Spawner) CreateJob(ctx context.Context, ds sqlutil.DataSource, jb *job return r0 } +// Spawner_CreateJob_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateJob' +type Spawner_CreateJob_Call struct { + *mock.Call +} + +// CreateJob is a helper method to define mock.On call +// - ctx context.Context +// - ds sqlutil.DataSource +// - jb *job.Job +func (_e *Spawner_Expecter) CreateJob(ctx interface{}, ds interface{}, jb interface{}) *Spawner_CreateJob_Call { + return &Spawner_CreateJob_Call{Call: _e.mock.On("CreateJob", ctx, ds, jb)} +} + +func (_c *Spawner_CreateJob_Call) Run(run func(ctx context.Context, ds sqlutil.DataSource, jb *job.Job)) *Spawner_CreateJob_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(sqlutil.DataSource), args[2].(*job.Job)) + }) + return _c +} + +func (_c *Spawner_CreateJob_Call) Return(err error) *Spawner_CreateJob_Call { + _c.Call.Return(err) + return _c +} + +func (_c *Spawner_CreateJob_Call) RunAndReturn(run func(context.Context, sqlutil.DataSource, *job.Job) error) *Spawner_CreateJob_Call { + _c.Call.Return(run) + return _c +} + // DeleteJob provides a mock function with given fields: ctx, ds, jobID func (_m *Spawner) DeleteJob(ctx context.Context, ds sqlutil.DataSource, jobID int32) error { ret := _m.Called(ctx, ds, jobID) @@ -90,6 +182,36 @@ func (_m *Spawner) DeleteJob(ctx context.Context, ds sqlutil.DataSource, jobID i return r0 } +// Spawner_DeleteJob_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteJob' +type Spawner_DeleteJob_Call struct { + *mock.Call +} + +// DeleteJob is a helper method to define mock.On call +// - ctx context.Context +// - ds sqlutil.DataSource +// - jobID int32 +func (_e *Spawner_Expecter) DeleteJob(ctx interface{}, ds interface{}, jobID interface{}) *Spawner_DeleteJob_Call { + return &Spawner_DeleteJob_Call{Call: _e.mock.On("DeleteJob", ctx, ds, jobID)} +} + +func (_c *Spawner_DeleteJob_Call) Run(run func(ctx context.Context, ds sqlutil.DataSource, jobID int32)) *Spawner_DeleteJob_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(sqlutil.DataSource), args[2].(int32)) + }) + return _c +} + +func (_c *Spawner_DeleteJob_Call) Return(_a0 error) *Spawner_DeleteJob_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Spawner_DeleteJob_Call) RunAndReturn(run func(context.Context, sqlutil.DataSource, int32) error) *Spawner_DeleteJob_Call { + _c.Call.Return(run) + return _c +} + // HealthReport provides a mock function with given fields: func (_m *Spawner) HealthReport() map[string]error { ret := _m.Called() @@ -110,6 +232,33 @@ func (_m *Spawner) HealthReport() map[string]error { return r0 } +// Spawner_HealthReport_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HealthReport' +type Spawner_HealthReport_Call struct { + *mock.Call +} + +// HealthReport is a helper method to define mock.On call +func (_e *Spawner_Expecter) HealthReport() *Spawner_HealthReport_Call { + return &Spawner_HealthReport_Call{Call: _e.mock.On("HealthReport")} +} + +func (_c *Spawner_HealthReport_Call) Run(run func()) *Spawner_HealthReport_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Spawner_HealthReport_Call) Return(_a0 map[string]error) *Spawner_HealthReport_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Spawner_HealthReport_Call) RunAndReturn(run func() map[string]error) *Spawner_HealthReport_Call { + _c.Call.Return(run) + return _c +} + // Name provides a mock function with given fields: func (_m *Spawner) Name() string { ret := _m.Called() @@ -128,6 +277,33 @@ func (_m *Spawner) Name() string { return r0 } +// Spawner_Name_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Name' +type Spawner_Name_Call struct { + *mock.Call +} + +// Name is a helper method to define mock.On call +func (_e *Spawner_Expecter) Name() *Spawner_Name_Call { + return &Spawner_Name_Call{Call: _e.mock.On("Name")} +} + +func (_c *Spawner_Name_Call) Run(run func()) *Spawner_Name_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Spawner_Name_Call) Return(_a0 string) *Spawner_Name_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Spawner_Name_Call) RunAndReturn(run func() string) *Spawner_Name_Call { + _c.Call.Return(run) + return _c +} + // Ready provides a mock function with given fields: func (_m *Spawner) Ready() error { ret := _m.Called() @@ -146,6 +322,33 @@ func (_m *Spawner) Ready() error { return r0 } +// Spawner_Ready_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Ready' +type Spawner_Ready_Call struct { + *mock.Call +} + +// Ready is a helper method to define mock.On call +func (_e *Spawner_Expecter) Ready() *Spawner_Ready_Call { + return &Spawner_Ready_Call{Call: _e.mock.On("Ready")} +} + +func (_c *Spawner_Ready_Call) Run(run func()) *Spawner_Ready_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Spawner_Ready_Call) Return(_a0 error) *Spawner_Ready_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Spawner_Ready_Call) RunAndReturn(run func() error) *Spawner_Ready_Call { + _c.Call.Return(run) + return _c +} + // Start provides a mock function with given fields: _a0 func (_m *Spawner) Start(_a0 context.Context) error { ret := _m.Called(_a0) @@ -164,6 +367,34 @@ func (_m *Spawner) Start(_a0 context.Context) error { return r0 } +// Spawner_Start_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Start' +type Spawner_Start_Call struct { + *mock.Call +} + +// Start is a helper method to define mock.On call +// - _a0 context.Context +func (_e *Spawner_Expecter) Start(_a0 interface{}) *Spawner_Start_Call { + return &Spawner_Start_Call{Call: _e.mock.On("Start", _a0)} +} + +func (_c *Spawner_Start_Call) Run(run func(_a0 context.Context)) *Spawner_Start_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *Spawner_Start_Call) Return(_a0 error) *Spawner_Start_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Spawner_Start_Call) RunAndReturn(run func(context.Context) error) *Spawner_Start_Call { + _c.Call.Return(run) + return _c +} + // StartService provides a mock function with given fields: ctx, spec func (_m *Spawner) StartService(ctx context.Context, spec job.Job) error { ret := _m.Called(ctx, spec) @@ -182,6 +413,35 @@ func (_m *Spawner) StartService(ctx context.Context, spec job.Job) error { return r0 } +// Spawner_StartService_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StartService' +type Spawner_StartService_Call struct { + *mock.Call +} + +// StartService is a helper method to define mock.On call +// - ctx context.Context +// - spec job.Job +func (_e *Spawner_Expecter) StartService(ctx interface{}, spec interface{}) *Spawner_StartService_Call { + return &Spawner_StartService_Call{Call: _e.mock.On("StartService", ctx, spec)} +} + +func (_c *Spawner_StartService_Call) Run(run func(ctx context.Context, spec job.Job)) *Spawner_StartService_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(job.Job)) + }) + return _c +} + +func (_c *Spawner_StartService_Call) Return(_a0 error) *Spawner_StartService_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Spawner_StartService_Call) RunAndReturn(run func(context.Context, job.Job) error) *Spawner_StartService_Call { + _c.Call.Return(run) + return _c +} + // NewSpawner creates a new instance of Spawner. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewSpawner(t interface { diff --git a/core/services/job/models.go b/core/services/job/models.go index a21a43d12dc..b9ec8e726f4 100644 --- a/core/services/job/models.go +++ b/core/services/job/models.go @@ -1,6 +1,7 @@ package job import ( + "context" "database/sql/driver" "encoding/json" "fmt" @@ -14,9 +15,12 @@ import ( "github.com/pkg/errors" "gopkg.in/guregu/null.v4" + "github.com/smartcontractkit/chainlink-common/pkg/workflows/sdk" + commonassets "github.com/smartcontractkit/chainlink-common/pkg/assets" "github.com/smartcontractkit/chainlink-common/pkg/types" pkgworkflows "github.com/smartcontractkit/chainlink-common/pkg/workflows" + "github.com/smartcontractkit/chainlink/v2/core/services/relay" "github.com/smartcontractkit/chainlink/v2/core/bridges" @@ -38,6 +42,7 @@ const ( BlockhashStore Type = (Type)(pipeline.BlockhashStoreJobType) Bootstrap Type = (Type)(pipeline.BootstrapJobType) Cron Type = (Type)(pipeline.CronJobType) + CCIP Type = (Type)(pipeline.CCIPJobType) DirectRequest Type = (Type)(pipeline.DirectRequestJobType) FluxMonitor Type = (Type)(pipeline.FluxMonitorJobType) Gateway Type = (Type)(pipeline.GatewayJobType) @@ -78,6 +83,7 @@ var ( BlockhashStore: false, Bootstrap: false, Cron: true, + CCIP: false, DirectRequest: true, FluxMonitor: true, Gateway: false, @@ -97,6 +103,7 @@ var ( BlockhashStore: false, Bootstrap: false, Cron: true, + CCIP: false, DirectRequest: true, FluxMonitor: false, Gateway: false, @@ -116,6 +123,7 @@ var ( BlockhashStore: 1, Bootstrap: 1, Cron: 1, + CCIP: 1, DirectRequest: 1, FluxMonitor: 1, Gateway: 1, @@ -156,6 +164,7 @@ type Job struct { BlockhashStoreSpec *BlockhashStoreSpec BlockHeaderFeederSpecID *int32 BlockHeaderFeederSpec *BlockHeaderFeederSpec + BALSpecID *int32 LegacyGasStationServerSpecID *int32 LegacyGasStationServerSpec *LegacyGasStationServerSpec LegacyGasStationSidecarSpecID *int32 @@ -175,6 +184,7 @@ type Job struct { StandardCapabilitiesSpecID *int32 StandardCapabilitiesSpec *StandardCapabilitiesSpec CCIPSpecID *int32 + CCIPSpec *CCIPSpec CCIPBootstrapSpecID *int32 JobSpecErrors []SpecError Type Type `toml:"type"` @@ -851,16 +861,26 @@ type LiquidityBalancerSpec struct { LiquidityBalancerConfig string `toml:"liquidityBalancerConfig" db:"liquidity_balancer_config"` } +type WorkflowSpecType string + +const ( + YamlSpec WorkflowSpecType = "yaml" + DefaultSpecType = YamlSpec +) + type WorkflowSpec struct { ID int32 `toml:"-"` - Workflow string `toml:"workflow"` // the yaml representation of the workflow + Workflow string `toml:"workflow"` // the raw representation of the workflow + Config string `toml:"config"` // the raw representation of the config // fields derived from the yaml spec, used for indexing the database // note: i tried to make these private, but translating them to the database seems to require them to be public - WorkflowID string `toml:"-" db:"workflow_id"` // Derived. Do not modify. the CID of the workflow. - WorkflowOwner string `toml:"-" db:"workflow_owner"` // Derived. Do not modify. the owner of the workflow. - WorkflowName string `toml:"-" db:"workflow_name"` // Derived. Do not modify. the name of the workflow. - CreatedAt time.Time `toml:"-"` - UpdatedAt time.Time `toml:"-"` + WorkflowID string `toml:"-" db:"workflow_id"` // Derived. Do not modify. the CID of the workflow. + WorkflowOwner string `toml:"-" db:"workflow_owner"` // Derived. Do not modify. the owner of the workflow. + WorkflowName string `toml:"-" db:"workflow_name"` // Derived. Do not modify. the name of the workflow. + CreatedAt time.Time `toml:"-"` + UpdatedAt time.Time `toml:"-"` + SpecType WorkflowSpecType `db:"spec_type"` + sdkWorkflow *sdk.WorkflowSpec } var ( @@ -873,14 +893,18 @@ const ( ) // Validate checks the workflow spec for correctness -func (w *WorkflowSpec) Validate() error { +func (w *WorkflowSpec) Validate(ctx context.Context) error { s, err := pkgworkflows.ParseWorkflowSpecYaml(w.Workflow) if err != nil { return fmt.Errorf("%w: failed to parse workflow spec %s: %w", ErrInvalidWorkflowYAMLSpec, w.Workflow, err) } + + if _, err = w.SDKSpec(ctx); err != nil { + return err + } + w.WorkflowOwner = strings.TrimPrefix(s.Owner, "0x") // the json schema validation ensures it is a hex string with 0x prefix, but the database does not store the prefix w.WorkflowName = s.Name - w.WorkflowID = s.CID() if len(w.WorkflowID) != workflowIDLen { return fmt.Errorf("%w: incorrect length for id %s: expected %d, got %d", ErrInvalidWorkflowID, w.WorkflowID, workflowIDLen, len(w.WorkflowID)) @@ -889,6 +913,20 @@ func (w *WorkflowSpec) Validate() error { return nil } +func (w *WorkflowSpec) SDKSpec(ctx context.Context) (sdk.WorkflowSpec, error) { + if w.sdkWorkflow != nil { + return *w.sdkWorkflow, nil + } + + spec, cid, err := workflowSpecFactory.Spec(ctx, w.Workflow, []byte(w.Config), w.SpecType) + if err != nil { + return sdk.WorkflowSpec{}, err + } + w.sdkWorkflow = &spec + w.WorkflowID = cid + return spec, nil +} + type StandardCapabilitiesSpec struct { ID int32 CreatedAt time.Time `toml:"-"` @@ -909,3 +947,48 @@ func (w *StandardCapabilitiesSpec) SetID(value string) error { w.ID = int32(ID) return nil } + +type CCIPSpec struct { + ID int32 + CreatedAt time.Time `toml:"-"` + UpdatedAt time.Time `toml:"-"` + + // P2PV2Bootstrappers is a list of "peer_id@ip_address:port" strings that are used to + // identify the bootstrap nodes of the P2P network. + // These bootstrappers will be used to bootstrap all CCIP DONs. + P2PV2Bootstrappers pq.StringArray `toml:"p2pV2Bootstrappers" db:"p2pv2_bootstrappers"` + + // CapabilityVersion is the semantic version of the CCIP capability. + // This capability version must exist in the onchain capability registry. + CapabilityVersion string `toml:"capabilityVersion" db:"capability_version"` + + // CapabilityLabelledName is the labelled name of the CCIP capability. + // Corresponds to the labelled name of the capability in the onchain capability registry. + CapabilityLabelledName string `toml:"capabilityLabelledName" db:"capability_labelled_name"` + + // OCRKeyBundleIDs is a mapping from chain type to OCR key bundle ID. + // These are explicitly specified here so that we don't run into strange errors auto-detecting + // the valid bundle, since nops can create as many bundles as they want. + // This will most likely never change for a particular CCIP capability version, + // since new chain families will likely require a new capability version. + // {"evm": "evm_key_bundle_id", "solana": "solana_key_bundle_id", ... } + OCRKeyBundleIDs JSONConfig `toml:"ocrKeyBundleIDs" db:"ocr_key_bundle_ids"` + + // RelayConfigs consists of relay specific configuration. + // Chain reader configurations are stored here, and are defined on a chain family basis, e.g + // we will have one chain reader config for EVM, one for solana, starknet, etc. + // Chain writer configurations are also stored here, and are also defined on a chain family basis, + // e.g we will have one chain writer config for EVM, one for solana, starknet, etc. + // See tests for examples of relay configs in TOML. + // { "evm": {"chainReader": {...}, "chainWriter": {...}}, "solana": {...}, ... } + // see core/services/relay/evm/types/types.go for EVM configs. + RelayConfigs JSONConfig `toml:"relayConfigs" db:"relay_configs"` + + // P2PKeyID is the ID of the P2P key of the node. + // This must be present in the capability registry otherwise the job will not start correctly. + P2PKeyID string `toml:"p2pKeyID" db:"p2p_key_id"` + + // PluginConfig contains plugin-specific config, like token price pipelines + // and RMN network info for offchain blessing. + PluginConfig JSONConfig `toml:"pluginConfig"` +} diff --git a/core/services/job/models_test.go b/core/services/job/models_test.go index 1f88bb6d38f..49bd29c9959 100644 --- a/core/services/job/models_test.go +++ b/core/services/job/models_test.go @@ -11,6 +11,8 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/codec" "github.com/smartcontractkit/chainlink-common/pkg/types" pkgworkflows "github.com/smartcontractkit/chainlink-common/pkg/workflows" + + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/services/relay" "github.com/stretchr/testify/assert" @@ -322,7 +324,7 @@ func TestWorkflowSpec_Validate(t *testing.T) { w := &WorkflowSpec{ Workflow: tt.fields.Workflow, } - err := w.Validate() + err := w.Validate(testutils.Context(t)) require.Equal(t, tt.wantError, err != nil) if !tt.wantError { assert.NotEmpty(t, w.WorkflowID) diff --git a/core/services/job/orm.go b/core/services/job/orm.go index 3f2d5c237d7..d02e0b29200 100644 --- a/core/services/job/orm.go +++ b/core/services/job/orm.go @@ -42,8 +42,6 @@ var ( ErrNoSuchPublicKey = errors.New("no such public key exists") ) -//go:generate mockery --quiet --name ORM --output ./mocks/ --case=underscore - type ORM interface { InsertWebhookSpec(ctx context.Context, webhookSpec *WebhookSpec) error InsertJob(ctx context.Context, job *Job) error @@ -81,6 +79,7 @@ type ORM interface { WithDataSource(source sqlutil.DataSource) ORM FindJobIDByWorkflow(ctx context.Context, spec WorkflowSpec) (int32, error) + FindJobIDByCapabilityNameAndVersion(ctx context.Context, spec CCIPSpec) (int32, error) } type ORMConfig interface { @@ -410,8 +409,8 @@ func (o *orm) CreateJob(ctx context.Context, jb *Job) error { case Stream: // 'stream' type has no associated spec, nothing to do here case Workflow: - sql := `INSERT INTO workflow_specs (workflow, workflow_id, workflow_owner, workflow_name, created_at, updated_at) - VALUES (:workflow, :workflow_id, :workflow_owner, :workflow_name, NOW(), NOW()) + sql := `INSERT INTO workflow_specs (workflow, workflow_id, workflow_owner, workflow_name, created_at, updated_at, spec_type) + VALUES (:workflow, :workflow_id, :workflow_owner, :workflow_name, NOW(), NOW(), :spec_type) RETURNING id;` specID, err := tx.prepareQuerySpecID(ctx, sql, jb.WorkflowSpec) if err != nil { @@ -427,7 +426,34 @@ func (o *orm) CreateJob(ctx context.Context, jb *Job) error { return errors.Wrap(err, "failed to create StandardCapabilities for jobSpec") } jb.StandardCapabilitiesSpecID = &specID - + case CCIP: + sql := `INSERT INTO ccip_specs ( + capability_version, + capability_labelled_name, + ocr_key_bundle_ids, + p2p_key_id, + p2pv2_bootstrappers, + relay_configs, + plugin_config, + created_at, + updated_at + ) VALUES ( + :capability_version, + :capability_labelled_name, + :ocr_key_bundle_ids, + :p2p_key_id, + :p2pv2_bootstrappers, + :relay_configs, + :plugin_config, + NOW(), + NOW() + ) + RETURNING id;` + specID, err := tx.prepareQuerySpecID(ctx, sql, jb.CCIPSpec) + if err != nil { + return errors.Wrap(err, "failed to create CCIPSpec for jobSpec") + } + jb.CCIPSpecID = &specID default: o.lggr.Panicf("Unsupported jb.Type: %v", jb.Type) } @@ -645,19 +671,19 @@ func (o *orm) InsertJob(ctx context.Context, job *Job) error { // if job has id, emplace otherwise insert with a new id. if job.ID == 0 { query = `INSERT INTO jobs (name, stream_id, schema_version, type, max_task_duration, ocr_oracle_spec_id, ocr2_oracle_spec_id, direct_request_spec_id, flux_monitor_spec_id, - keeper_spec_id, cron_spec_id, vrf_spec_id, webhook_spec_id, blockhash_store_spec_id, bootstrap_spec_id, block_header_feeder_spec_id, gateway_spec_id, - legacy_gas_station_server_spec_id, legacy_gas_station_sidecar_spec_id, workflow_spec_id, standard_capabilities_spec_id, external_job_id, gas_limit, forwarding_allowed, created_at) + keeper_spec_id, cron_spec_id, vrf_spec_id, webhook_spec_id, blockhash_store_spec_id, bootstrap_spec_id, block_header_feeder_spec_id, gateway_spec_id, + legacy_gas_station_server_spec_id, legacy_gas_station_sidecar_spec_id, workflow_spec_id, standard_capabilities_spec_id, ccip_spec_id, external_job_id, gas_limit, forwarding_allowed, created_at) VALUES (:name, :stream_id, :schema_version, :type, :max_task_duration, :ocr_oracle_spec_id, :ocr2_oracle_spec_id, :direct_request_spec_id, :flux_monitor_spec_id, - :keeper_spec_id, :cron_spec_id, :vrf_spec_id, :webhook_spec_id, :blockhash_store_spec_id, :bootstrap_spec_id, :block_header_feeder_spec_id, :gateway_spec_id, - :legacy_gas_station_server_spec_id, :legacy_gas_station_sidecar_spec_id, :workflow_spec_id, :standard_capabilities_spec_id, :external_job_id, :gas_limit, :forwarding_allowed, NOW()) + :keeper_spec_id, :cron_spec_id, :vrf_spec_id, :webhook_spec_id, :blockhash_store_spec_id, :bootstrap_spec_id, :block_header_feeder_spec_id, :gateway_spec_id, + :legacy_gas_station_server_spec_id, :legacy_gas_station_sidecar_spec_id, :workflow_spec_id, :standard_capabilities_spec_id, :ccip_spec_id, :external_job_id, :gas_limit, :forwarding_allowed, NOW()) RETURNING *;` } else { query = `INSERT INTO jobs (id, name, stream_id, schema_version, type, max_task_duration, ocr_oracle_spec_id, ocr2_oracle_spec_id, direct_request_spec_id, flux_monitor_spec_id, - keeper_spec_id, cron_spec_id, vrf_spec_id, webhook_spec_id, blockhash_store_spec_id, bootstrap_spec_id, block_header_feeder_spec_id, gateway_spec_id, - legacy_gas_station_server_spec_id, legacy_gas_station_sidecar_spec_id, workflow_spec_id, standard_capabilities_spec_id, external_job_id, gas_limit, forwarding_allowed, created_at) + keeper_spec_id, cron_spec_id, vrf_spec_id, webhook_spec_id, blockhash_store_spec_id, bootstrap_spec_id, block_header_feeder_spec_id, gateway_spec_id, + legacy_gas_station_server_spec_id, legacy_gas_station_sidecar_spec_id, workflow_spec_id, standard_capabilities_spec_id, ccip_spec_id, external_job_id, gas_limit, forwarding_allowed, created_at) VALUES (:id, :name, :stream_id, :schema_version, :type, :max_task_duration, :ocr_oracle_spec_id, :ocr2_oracle_spec_id, :direct_request_spec_id, :flux_monitor_spec_id, - :keeper_spec_id, :cron_spec_id, :vrf_spec_id, :webhook_spec_id, :blockhash_store_spec_id, :bootstrap_spec_id, :block_header_feeder_spec_id, :gateway_spec_id, - :legacy_gas_station_server_spec_id, :legacy_gas_station_sidecar_spec_id, :workflow_spec_id, :standard_capabilities_spec_id, :external_job_id, :gas_limit, :forwarding_allowed, NOW()) + :keeper_spec_id, :cron_spec_id, :vrf_spec_id, :webhook_spec_id, :blockhash_store_spec_id, :bootstrap_spec_id, :block_header_feeder_spec_id, :gateway_spec_id, + :legacy_gas_station_server_spec_id, :legacy_gas_station_sidecar_spec_id, :workflow_spec_id, :standard_capabilities_spec_id, :ccip_spec_id, :external_job_id, :gas_limit, :forwarding_allowed, NOW()) RETURNING *;` } query, args, err := tx.ds.BindNamed(query, job) @@ -701,7 +727,8 @@ func (o *orm) DeleteJob(ctx context.Context, id int32) error { block_header_feeder_spec_id, gateway_spec_id, workflow_spec_id, - standard_capabilities_spec_id + standard_capabilities_spec_id, + ccip_spec_id ), deleted_oracle_specs AS ( DELETE FROM ocr_oracle_specs WHERE id IN (SELECT ocr_oracle_spec_id FROM deleted_jobs) @@ -744,7 +771,10 @@ func (o *orm) DeleteJob(ctx context.Context, id int32) error { ), deleted_standardcapabilities_specs AS ( DELETE FROM standardcapabilities_specs WHERE id in (SELECT standard_capabilities_spec_id FROM deleted_jobs) - ), + ), + deleted_ccip_specs AS ( + DELETE FROM ccip_specs WHERE id in (SELECT ccip_spec_id FROM deleted_jobs) + ), deleted_job_pipeline_specs AS ( DELETE FROM job_pipeline_specs WHERE job_id IN (SELECT id FROM deleted_jobs) RETURNING pipeline_spec_id ) @@ -818,7 +848,7 @@ func (o *orm) FindJobs(ctx context.Context, offset, limit int) (jobs []Job, coun return fmt.Errorf("failed to query jobs count: %w", err) } - sql = `SELECT jobs.*, job_pipeline_specs.pipeline_spec_id as pipeline_spec_id + sql = `SELECT jobs.*, job_pipeline_specs.pipeline_spec_id as pipeline_spec_id FROM jobs JOIN job_pipeline_specs ON (jobs.id = job_pipeline_specs.job_id) ORDER BY jobs.created_at DESC, jobs.id DESC OFFSET $1 LIMIT $2;` @@ -931,7 +961,7 @@ func (o *orm) FindJob(ctx context.Context, id int32) (jb Job, err error) { return } -// FindJobWithoutSpecErrors returns a job by ID, without loading Spec Errors preloaded +// FindJobWithoutSpecErrors returns a job by ID, without loading SpecVal Errors preloaded func (o *orm) FindJobWithoutSpecErrors(ctx context.Context, id int32) (jb Job, err error) { err = o.transact(ctx, true, func(tx *orm) error { stmt := "SELECT jobs.*, job_pipeline_specs.pipeline_spec_id as pipeline_spec_id FROM jobs JOIN job_pipeline_specs ON (jobs.id = job_pipeline_specs.job_id) WHERE jobs.id = $1 LIMIT 1" @@ -1032,8 +1062,8 @@ func (o *orm) findJob(ctx context.Context, jb *Job, col string, arg interface{}) } func (o *orm) FindJobIDsWithBridge(ctx context.Context, name string) (jids []int32, err error) { - query := `SELECT - jobs.id, pipeline_specs.dot_dag_source + query := `SELECT + jobs.id, pipeline_specs.dot_dag_source FROM jobs JOIN job_pipeline_specs ON job_pipeline_specs.job_id = jobs.id JOIN pipeline_specs ON pipeline_specs.id = job_pipeline_specs.pipeline_spec_id @@ -1080,7 +1110,7 @@ func (o *orm) FindJobIDsWithBridge(ctx context.Context, name string) (jids []int func (o *orm) FindJobIDByWorkflow(ctx context.Context, spec WorkflowSpec) (jobID int32, err error) { stmt := ` SELECT jobs.id FROM jobs -INNER JOIN workflow_specs ws on jobs.workflow_spec_id = ws.id AND ws.workflow_owner = $1 AND ws.workflow_name = $2 +INNER JOIN workflow_specs ws on jobs.workflow_spec_id = ws.id AND ws.workflow_owner = $1 AND ws.workflow_name = $2 ` err = o.ds.GetContext(ctx, &jobID, stmt, spec.WorkflowOwner, spec.WorkflowName) if err != nil { @@ -1094,6 +1124,18 @@ INNER JOIN workflow_specs ws on jobs.workflow_spec_id = ws.id AND ws.workflow_ow return } +func (o *orm) FindJobIDByCapabilityNameAndVersion(ctx context.Context, spec CCIPSpec) (jobID int32, err error) { + stmt := ` +SELECT jobs.id FROM jobs +INNER JOIN ccip_specs ccip on jobs.ccip_spec_id = ccip.id AND ccip.capability_labelled_name = $1 AND ccip.capability_version = $2 +` + err = o.ds.GetContext(ctx, &jobID, stmt, spec.CapabilityLabelledName, spec.CapabilityVersion) + if err != nil && !errors.Is(err, sql.ErrNoRows) { + err = fmt.Errorf("error searching for job for CCIP (capabilityName,capabilityVersion) ('%s','%s'): %w", spec.CapabilityLabelledName, spec.CapabilityVersion, err) + } + return +} + // PipelineRunsByJobsIDs returns pipeline runs for multiple jobs, not preloading data func (o *orm) PipelineRunsByJobsIDs(ctx context.Context, ids []int32) (runs []pipeline.Run, err error) { err = o.transact(ctx, false, func(tx *orm) error { @@ -1393,6 +1435,7 @@ func (o *orm) loadAllJobTypes(ctx context.Context, job *Job) error { o.loadJobType(ctx, job, "GatewaySpec", "gateway_specs", job.GatewaySpecID), o.loadJobType(ctx, job, "WorkflowSpec", "workflow_specs", job.WorkflowSpecID), o.loadJobType(ctx, job, "StandardCapabilitiesSpec", "standardcapabilities_specs", job.StandardCapabilitiesSpecID), + o.loadJobType(ctx, job, "CCIPSpec", "ccip_specs", job.CCIPSpecID), ) } @@ -1430,7 +1473,7 @@ func (o *orm) loadJobPipelineSpec(ctx context.Context, job *Job, id *int32) erro ctx, pipelineSpecRow, `SELECT pipeline_specs.*, job_pipeline_specs.job_id as job_id - FROM pipeline_specs + FROM pipeline_specs JOIN job_pipeline_specs ON(pipeline_specs.id = job_pipeline_specs.pipeline_spec_id) WHERE job_pipeline_specs.job_id = $1 AND job_pipeline_specs.pipeline_spec_id = $2`, job.ID, *id, diff --git a/core/services/job/runner_integration_test.go b/core/services/job/runner_integration_test.go index 0232fbadd9f..0b55b14250e 100644 --- a/core/services/job/runner_integration_test.go +++ b/core/services/job/runner_integration_test.go @@ -127,10 +127,10 @@ func TestRunner(t *testing.T) { m, err := bridges.MarshalBridgeMetaData(big.NewInt(10), big.NewInt(100)) require.NoError(t, err) - runID, taskResults, err := runner.ExecuteAndInsertFinishedRun(testutils.Context(t), *jb.PipelineSpec, pipeline.NewVarsFrom(map[string]interface{}{"jobRun": map[string]interface{}{"meta": m}}), logger.TestLogger(t), true) + runID, taskResults, err := runner.ExecuteAndInsertFinishedRun(testutils.Context(t), *jb.PipelineSpec, pipeline.NewVarsFrom(map[string]interface{}{"jobRun": map[string]interface{}{"meta": m}}), true) require.NoError(t, err) - results := taskResults.FinalResult(logger.TestLogger(t)) + results := taskResults.FinalResult() require.Len(t, results.Values, 2) require.GreaterOrEqual(t, len(results.FatalErrors), 2) assert.Nil(t, results.FatalErrors[0]) @@ -318,10 +318,10 @@ answer1 [type=median index=0]; err := jobORM.CreateJob(ctx, jb) require.NoError(t, err) - runID, taskResults, err := runner.ExecuteAndInsertFinishedRun(testutils.Context(t), *jb.PipelineSpec, pipeline.NewVarsFrom(nil), logger.TestLogger(t), true) + runID, taskResults, err := runner.ExecuteAndInsertFinishedRun(testutils.Context(t), *jb.PipelineSpec, pipeline.NewVarsFrom(nil), true) require.NoError(t, err) - results := taskResults.FinalResult(logger.TestLogger(t)) + results := taskResults.FinalResult() assert.Len(t, results.FatalErrors, 1) assert.Len(t, results.Values, 1) assert.Contains(t, results.FatalErrors[0].Error(), "type cannot be converted to decimal.Decimal") @@ -364,10 +364,10 @@ answer1 [type=median index=0]; err := jobORM.CreateJob(testutils.Context(t), jb) require.NoError(t, err) - runID, taskResults, err := runner.ExecuteAndInsertFinishedRun(testutils.Context(t), *jb.PipelineSpec, pipeline.NewVarsFrom(nil), logger.TestLogger(t), true) + runID, taskResults, err := runner.ExecuteAndInsertFinishedRun(testutils.Context(t), *jb.PipelineSpec, pipeline.NewVarsFrom(nil), true) require.NoError(t, err) - results := taskResults.FinalResult(logger.TestLogger(t)) + results := taskResults.FinalResult() assert.Len(t, results.Values, 1) assert.Len(t, results.FatalErrors, 1) assert.Contains(t, results.FatalErrors[0].Error(), pipeline.ErrTooManyErrors.Error()) @@ -409,10 +409,10 @@ answer1 [type=median index=0]; err := jobORM.CreateJob(testutils.Context(t), jb) require.NoError(t, err) - runID, taskResults, err := runner.ExecuteAndInsertFinishedRun(testutils.Context(t), *jb.PipelineSpec, pipeline.NewVarsFrom(nil), logger.TestLogger(t), true) + runID, taskResults, err := runner.ExecuteAndInsertFinishedRun(testutils.Context(t), *jb.PipelineSpec, pipeline.NewVarsFrom(nil), true) require.NoError(t, err) - results := taskResults.FinalResult(logger.TestLogger(t)) + results := taskResults.FinalResult() assert.Len(t, results.Values, 1) assert.Contains(t, results.FatalErrors[0].Error(), "type cannot be converted to decimal.Decimal") assert.Nil(t, results.Values[0]) @@ -697,9 +697,9 @@ answer1 [type=median index=0]; err := jobORM.CreateJob(ctx, jb) require.NoError(t, err) - _, taskResults, err := runner.ExecuteAndInsertFinishedRun(testutils.Context(t), *jb.PipelineSpec, pipeline.NewVarsFrom(nil), logger.TestLogger(t), true) + _, taskResults, err := runner.ExecuteAndInsertFinishedRun(testutils.Context(t), *jb.PipelineSpec, pipeline.NewVarsFrom(nil), true) require.NoError(t, err) - results := taskResults.FinalResult(logger.TestLogger(t)) + results := taskResults.FinalResult() assert.Nil(t, results.Values[0]) // No task timeout should succeed. @@ -707,9 +707,9 @@ answer1 [type=median index=0]; jb.Name = null.NewString("a job 2", true) err = jobORM.CreateJob(ctx, jb) require.NoError(t, err) - _, taskResults, err = runner.ExecuteAndInsertFinishedRun(testutils.Context(t), *jb.PipelineSpec, pipeline.NewVarsFrom(nil), logger.TestLogger(t), true) + _, taskResults, err = runner.ExecuteAndInsertFinishedRun(testutils.Context(t), *jb.PipelineSpec, pipeline.NewVarsFrom(nil), true) require.NoError(t, err) - results = taskResults.FinalResult(logger.TestLogger(t)) + results = taskResults.FinalResult() assert.Equal(t, 10.1, results.Values[0]) assert.Nil(t, results.FatalErrors[0]) @@ -720,9 +720,9 @@ answer1 [type=median index=0]; err = jobORM.CreateJob(ctx, jb) require.NoError(t, err) - _, taskResults, err = runner.ExecuteAndInsertFinishedRun(testutils.Context(t), *jb.PipelineSpec, pipeline.NewVarsFrom(nil), logger.TestLogger(t), true) + _, taskResults, err = runner.ExecuteAndInsertFinishedRun(testutils.Context(t), *jb.PipelineSpec, pipeline.NewVarsFrom(nil), true) require.NoError(t, err) - resultsNoFatalErrs := taskResults.FinalResult(logger.TestLogger(t)) + resultsNoFatalErrs := taskResults.FinalResult() assert.NotNil(t, resultsNoFatalErrs.FatalErrors[0]) }) @@ -740,9 +740,9 @@ answer1 [type=median index=0]; err := jobORM.CreateJob(ctx, jb) require.NoError(t, err) - _, taskResults, err := runner.ExecuteAndInsertFinishedRun(testutils.Context(t), *jb.PipelineSpec, pipeline.NewVarsFrom(nil), logger.TestLogger(t), true) + _, taskResults, err := runner.ExecuteAndInsertFinishedRun(testutils.Context(t), *jb.PipelineSpec, pipeline.NewVarsFrom(nil), true) require.NoError(t, err) - results := taskResults.FinalResult(logger.TestLogger(t)) + results := taskResults.FinalResult() assert.Len(t, results.Values, 1) assert.Nil(t, results.FatalErrors[0]) assert.Equal(t, "4242", results.Values[0].(decimal.Decimal).String()) @@ -752,7 +752,7 @@ answer1 [type=median index=0]; require.NoError(t, err) // Create another run, it should fail - _, _, err = runner.ExecuteAndInsertFinishedRun(testutils.Context(t), *jb.PipelineSpec, pipeline.NewVarsFrom(nil), logger.TestLogger(t), true) + _, _, err = runner.ExecuteAndInsertFinishedRun(testutils.Context(t), *jb.PipelineSpec, pipeline.NewVarsFrom(nil), true) require.Error(t, err) }) } diff --git a/core/services/job/spawner.go b/core/services/job/spawner.go index f7cd5e2bcb3..16889cbe10b 100644 --- a/core/services/job/spawner.go +++ b/core/services/job/spawner.go @@ -16,8 +16,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/logger" ) -//go:generate mockery --quiet --name Spawner --output ./mocks/ --case=underscore - type ( // Spawner manages the spinning up and down of the long-running // services that perform the work described by job specs. Each active job spec diff --git a/core/services/job/validate.go b/core/services/job/validate.go index 92a08823fcf..7cd93b91f00 100644 --- a/core/services/job/validate.go +++ b/core/services/job/validate.go @@ -29,6 +29,7 @@ var ( Webhook: {}, Workflow: {}, StandardCapabilities: {}, + CCIP: {}, } ) diff --git a/core/services/job/validate_test.go b/core/services/job/validate_test.go old mode 100644 new mode 100755 diff --git a/core/services/job/workflow_spec_factory.go b/core/services/job/workflow_spec_factory.go new file mode 100644 index 00000000000..565e6a9fce1 --- /dev/null +++ b/core/services/job/workflow_spec_factory.go @@ -0,0 +1,51 @@ +package job + +import ( + "context" + "crypto/sha256" + "errors" + "fmt" + + "github.com/smartcontractkit/chainlink-common/pkg/workflows/sdk" +) + +var ErrInvalidWorkflowType = errors.New("invalid workflow type") + +type SDKWorkflowSpecFactory interface { + Spec(ctx context.Context, rawSpec, config []byte) (sdk.WorkflowSpec, error) + RawSpec(ctx context.Context, wf string) ([]byte, error) +} + +type WorkflowSpecFactory map[WorkflowSpecType]SDKWorkflowSpecFactory + +func (wsf WorkflowSpecFactory) Spec( + ctx context.Context, workflow string, config []byte, tpe WorkflowSpecType) (sdk.WorkflowSpec, string, error) { + if tpe == "" { + tpe = DefaultSpecType + } + + factory, ok := wsf[tpe] + if !ok { + return sdk.WorkflowSpec{}, "", ErrInvalidWorkflowType + } + + rawSpec, err := factory.RawSpec(ctx, workflow) + if err != nil { + return sdk.WorkflowSpec{}, "", err + } + + spec, err := factory.Spec(ctx, rawSpec, config) + if err != nil { + return sdk.WorkflowSpec{}, "", err + } + + sum := sha256.New() + sum.Write(rawSpec) + sum.Write(config) + + return spec, fmt.Sprintf("%x", sum.Sum(nil)), nil +} + +var workflowSpecFactory = WorkflowSpecFactory{ + YamlSpec: YAMLSpecFactory{}, +} diff --git a/core/services/job/workflow_spec_factory_test.go b/core/services/job/workflow_spec_factory_test.go new file mode 100644 index 00000000000..dc2ff3bac9b --- /dev/null +++ b/core/services/job/workflow_spec_factory_test.go @@ -0,0 +1,106 @@ +package job_test + +import ( + "context" + "crypto/sha256" + "errors" + "fmt" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + "github.com/smartcontractkit/chainlink-common/pkg/workflows/sdk" + + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" + "github.com/smartcontractkit/chainlink/v2/core/services/job" +) + +func TestWorkflowSpecFactory_ToSpec(t *testing.T) { + t.Parallel() + + anyData := "any data" + anyConfig := []byte("any config") + anySpec := sdk.WorkflowSpec{Name: "name", Owner: "owner"} + + t.Run("delegates to factory and calculates CID", func(t *testing.T) { + runYamlSpecTest(t, anySpec, anyData, anyConfig, job.YamlSpec) + }) + + t.Run("delegates default", func(t *testing.T) { + runYamlSpecTest(t, anySpec, anyData, anyConfig, "") + }) + + t.Run("CID without config matches", func(t *testing.T) { + factory := job.WorkflowSpecFactory{ + job.YamlSpec: mockSdkSpecFactory{t: t, noConfig: true, SpecVal: anySpec}, + } + results, cid, err := factory.Spec(testutils.Context(t), anyData, nil, job.YamlSpec) + require.NoError(t, err) + + assert.Equal(t, anySpec, results) + + sha256Hash := sha256.New() + sha256Hash.Write([]byte(anyData)) + expectedCid := fmt.Sprintf("%x", sha256Hash.Sum(nil)) + assert.Equal(t, expectedCid, cid) + }) + + t.Run("returns errors from sdk factory", func(t *testing.T) { + anyErr := errors.New("nope") + factory := job.WorkflowSpecFactory{ + job.YamlSpec: mockSdkSpecFactory{t: t, Err: anyErr}, + } + + _, _, err := factory.Spec(testutils.Context(t), anyData, anyConfig, job.YamlSpec) + assert.Equal(t, anyErr, err) + }) + + t.Run("returns an error if the type is not supported", func(t *testing.T) { + factory := job.WorkflowSpecFactory{ + job.YamlSpec: mockSdkSpecFactory{t: t, SpecVal: anySpec}, + } + + _, _, err := factory.Spec(testutils.Context(t), anyData, anyConfig, "unsupported") + assert.Error(t, err) + }) +} + +func runYamlSpecTest(t *testing.T, anySpec sdk.WorkflowSpec, anyData string, anyConfig []byte, specType job.WorkflowSpecType) { + factory := job.WorkflowSpecFactory{ + job.YamlSpec: mockSdkSpecFactory{t: t, SpecVal: anySpec}, + } + + results, cid, err := factory.Spec(testutils.Context(t), anyData, anyConfig, specType) + + require.NoError(t, err) + assert.Equal(t, anySpec, results) + + sha256Hash := sha256.New() + sha256Hash.Write([]byte(anyData)) + sha256Hash.Write(anyConfig) + expectedCid := fmt.Sprintf("%x", sha256Hash.Sum(nil)) + assert.Equal(t, expectedCid, cid) +} + +type mockSdkSpecFactory struct { + t *testing.T + noConfig bool + SpecVal sdk.WorkflowSpec + Err error +} + +func (f mockSdkSpecFactory) RawSpec(_ context.Context, wf string) ([]byte, error) { + return []byte(wf), nil +} + +func (f mockSdkSpecFactory) Spec(_ context.Context, rawSpec, config []byte) (sdk.WorkflowSpec, error) { + assert.ElementsMatch(f.t, rawSpec, []byte("any data")) + if f.noConfig { + assert.Nil(f.t, config) + } else { + assert.ElementsMatch(f.t, config, []byte("any config")) + } + + return f.SpecVal, f.Err +} diff --git a/core/services/job/yaml_spec_factory.go b/core/services/job/yaml_spec_factory.go new file mode 100644 index 00000000000..ea344a3ffc4 --- /dev/null +++ b/core/services/job/yaml_spec_factory.go @@ -0,0 +1,20 @@ +package job + +import ( + "context" + + "github.com/smartcontractkit/chainlink-common/pkg/workflows" + "github.com/smartcontractkit/chainlink-common/pkg/workflows/sdk" +) + +type YAMLSpecFactory struct{} + +var _ SDKWorkflowSpecFactory = (*YAMLSpecFactory)(nil) + +func (y YAMLSpecFactory) Spec(_ context.Context, rawSpec, _ []byte) (sdk.WorkflowSpec, error) { + return workflows.ParseWorkflowSpecYaml(string(rawSpec)) +} + +func (y YAMLSpecFactory) RawSpec(_ context.Context, wf string) ([]byte, error) { + return []byte(wf), nil +} diff --git a/core/services/job/yaml_spec_factory_test.go b/core/services/job/yaml_spec_factory_test.go new file mode 100644 index 00000000000..4d075fe6e20 --- /dev/null +++ b/core/services/job/yaml_spec_factory_test.go @@ -0,0 +1,82 @@ +package job_test + +import ( + "testing" + + "github.com/stretchr/testify/require" + + commonworkflows "github.com/smartcontractkit/chainlink-common/pkg/workflows" + + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" + "github.com/smartcontractkit/chainlink/v2/core/services/job" +) + +const anyYamlSpec = ` +name: "wf-name" +owner: "0x00000000000000000000000000000000000000aa" +triggers: + - id: "mercury-trigger@1.0.0" + config: + feedIds: + - "0x1111111111111111111100000000000000000000000000000000000000000000" + - "0x2222222222222222222200000000000000000000000000000000000000000000" + - "0x3333333333333333333300000000000000000000000000000000000000000000" + +consensus: + - id: "offchain_reporting@2.0.0" + ref: "evm_median" + inputs: + observations: + - "$(trigger.outputs)" + config: + aggregation_method: "data_feeds_2_0" + aggregation_config: + "0x1111111111111111111100000000000000000000000000000000000000000000": + deviation: "0.001" + heartbeat: 3600 + "0x2222222222222222222200000000000000000000000000000000000000000000": + deviation: "0.001" + heartbeat: 3600 + "0x3333333333333333333300000000000000000000000000000000000000000000": + deviation: "0.001" + heartbeat: 3600 + encoder: "EVM" + encoder_config: + abi: "mercury_reports bytes[]" + +targets: + - id: "write_polygon-testnet-mumbai@3.0.0" + inputs: + report: "$(evm_median.outputs.report)" + config: + address: "0x3F3554832c636721F1fD1822Ccca0354576741Ef" + params: ["$(report)"] + abi: "receive(report bytes)" + - id: "write_ethereum-testnet-sepolia@4.0.0" + inputs: + report: "$(evm_median.outputs.report)" + config: + address: "0x54e220867af6683aE6DcBF535B4f952cB5116510" + params: ["$(report)"] + abi: "receive(report bytes)" +` + +func TestYamlSpecFactory_GetSpec(t *testing.T) { + t.Parallel() + + actual, err := job.YAMLSpecFactory{}.Spec(testutils.Context(t), []byte(anyYamlSpec), []byte{}) + require.NoError(t, err) + + expected, err := commonworkflows.ParseWorkflowSpecYaml(anyYamlSpec) + require.NoError(t, err) + + require.Equal(t, expected, actual) +} + +func TestYamlSpecFactory_GetRawSpec(t *testing.T) { + t.Parallel() + + actual, err := job.YAMLSpecFactory{}.RawSpec(testutils.Context(t), anyYamlSpec) + require.NoError(t, err) + require.Equal(t, []byte(anyYamlSpec), actual) +} diff --git a/core/services/keeper/integration_test.go b/core/services/keeper/integration_test.go index cbbe89b3f21..494e0a16155 100644 --- a/core/services/keeper/integration_test.go +++ b/core/services/keeper/integration_test.go @@ -17,6 +17,7 @@ import ( "github.com/stretchr/testify/require" commonconfig "github.com/smartcontractkit/chainlink-common/pkg/config" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/forwarders" @@ -30,12 +31,12 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/keeper_registry_wrapper1_3" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/mock_v3_aggregator_contract" "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" - "github.com/smartcontractkit/chainlink/v2/core/internal/cltest/heavyweight" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" "github.com/smartcontractkit/chainlink/v2/core/services/job" "github.com/smartcontractkit/chainlink/v2/core/services/keeper" + "github.com/smartcontractkit/chainlink/v2/core/utils/testutils/heavyweight" webpresenters "github.com/smartcontractkit/chainlink/v2/core/web/presenters" ) diff --git a/core/services/keeper/upkeep_executer.go b/core/services/keeper/upkeep_executer.go index c66f2d31c5a..170546287e5 100644 --- a/core/services/keeper/upkeep_executer.go +++ b/core/services/keeper/upkeep_executer.go @@ -227,7 +227,7 @@ func (ex *UpkeepExecuter) execute(upkeep UpkeepRegistration, head *evmtypes.Head ex.job.PipelineSpec.DotDagSource = pipeline.KeepersObservationSource run := pipeline.NewRun(*ex.job.PipelineSpec, vars) - if _, err := ex.pr.Run(ctxService, run, svcLogger, true, nil); err != nil { + if _, err := ex.pr.Run(ctxService, run, true, nil); err != nil { svcLogger.Error(errors.Wrap(err, "failed executing run")) return } diff --git a/core/services/keeper/upkeep_executer_test.go b/core/services/keeper/upkeep_executer_test.go index c70a92c725c..55926242a2a 100644 --- a/core/services/keeper/upkeep_executer_test.go +++ b/core/services/keeper/upkeep_executer_test.go @@ -48,7 +48,7 @@ func mockEstimator(t *testing.T) gas.EvmFeeEstimator { // note: estimator will only return 1 of legacy or dynamic fees (not both) // assumed to call legacy estimator only estimator := gasmocks.NewEvmFeeEstimator(t) - estimator.On("GetFee", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Maybe().Return(gas.EvmFee{ + estimator.On("GetFee", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything).Maybe().Return(gas.EvmFee{ Legacy: assets.GWei(60), }, uint32(60), nil) return estimator diff --git a/core/services/keystore/aptos.go b/core/services/keystore/aptos.go index 4a40033ae0d..c93e7107fe1 100644 --- a/core/services/keystore/aptos.go +++ b/core/services/keystore/aptos.go @@ -10,8 +10,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/aptoskey" ) -//go:generate mockery --quiet --name Aptos --output ./mocks/ --case=underscore --filename aptos.go - type Aptos interface { Get(id string) (aptoskey.Key, error) GetAll() ([]aptoskey.Key, error) diff --git a/core/services/keystore/chaintype/chaintype.go b/core/services/keystore/chaintype/chaintype.go index 8a12322ebfe..419dfa2d073 100644 --- a/core/services/keystore/chaintype/chaintype.go +++ b/core/services/keystore/chaintype/chaintype.go @@ -36,6 +36,40 @@ func (c ChainTypes) String() (out string) { return sb.String() } +func NewChainType(typ uint8) (ChainType, error) { + switch typ { + case 1: + return EVM, nil + case 2: + return Solana, nil + case 3: + return Cosmos, nil + case 4: + return StarkNet, nil + case 5: + return Aptos, nil + default: + return "", fmt.Errorf("unexpected chaintype.ChainType: %#v", typ) + } +} + +func (c ChainType) Type() (uint8, error) { + switch c { + case EVM: + return 1, nil + case Solana: + return 2, nil + case Cosmos: + return 3, nil + case StarkNet: + return 4, nil + case Aptos: + return 5, nil + default: + return 0, fmt.Errorf("unexpected chaintype.ChainType: %#v", c) + } +} + // SupportedChainTypes contain all chains that are supported var SupportedChainTypes = ChainTypes{EVM, Cosmos, Solana, StarkNet, Aptos} diff --git a/core/services/keystore/cosmos.go b/core/services/keystore/cosmos.go index 76fc5f39816..43370daab45 100644 --- a/core/services/keystore/cosmos.go +++ b/core/services/keystore/cosmos.go @@ -10,8 +10,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/cosmoskey" ) -//go:generate mockery --quiet --name Cosmos --output ./mocks/ --case=underscore --filename cosmos.go - type Cosmos interface { Get(id string) (cosmoskey.Key, error) GetAll() ([]cosmoskey.Key, error) diff --git a/core/services/keystore/csa.go b/core/services/keystore/csa.go index 21b530c0650..004ec2bf373 100644 --- a/core/services/keystore/csa.go +++ b/core/services/keystore/csa.go @@ -9,8 +9,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/csakey" ) -//go:generate mockery --quiet --name CSA --output mocks/ --case=underscore - // ErrCSAKeyExists describes the error when the CSA key already exists var ErrCSAKeyExists = errors.New("can only have 1 CSA key") diff --git a/core/services/keystore/eth.go b/core/services/keystore/eth.go index a4365eb9092..ee1c4f23a91 100644 --- a/core/services/keystore/eth.go +++ b/core/services/keystore/eth.go @@ -19,8 +19,6 @@ import ( ) // Eth is the external interface for EthKeyStore -// -//go:generate mockery --quiet --name Eth --output mocks/ --case=underscore type Eth interface { Get(ctx context.Context, id string) (ethkey.KeyV2, error) GetAll(ctx context.Context) ([]ethkey.KeyV2, error) diff --git a/core/services/keystore/keys/aptoskey/account.go b/core/services/keystore/keys/aptoskey/account.go deleted file mode 100644 index 89f62d33011..00000000000 --- a/core/services/keystore/keys/aptoskey/account.go +++ /dev/null @@ -1,72 +0,0 @@ -package aptoskey - -import ( - "encoding/hex" - "errors" - "fmt" - "strings" -) - -// AccountAddress is a 32 byte address on the Aptos blockchain -// It can represent an Object, an Account, and much more. -// -// AccountAddress is copied from the aptos sdk because: -// 1. There are still breaking changes in sdk and we don't want the dependency. -// 2. AccountAddress is just a wrapper and can be easily extracted out. -// -// https://github.com/aptos-labs/aptos-go-sdk/blob/main/internal/types/account.go -type AccountAddress [32]byte - -// IsSpecial Returns whether the address is a "special" address. Addresses are considered -// special if the first 63 characters of the hex string are zero. In other words, -// an address is special if the first 31 bytes are zero and the last byte is -// smaller than `0b10000` (16). In other words, special is defined as an address -// that matches the following regex: `^0x0{63}[0-9a-f]$`. In short form this means -// the addresses in the range from `0x0` to `0xf` (inclusive) are special. -// For more details see the v1 address standard defined as part of AIP-40: -// https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-40.md -func (aa *AccountAddress) IsSpecial() bool { - for _, b := range aa[:31] { - if b != 0 { - return false - } - } - return aa[31] < 0x10 -} - -// String Returns the canonical string representation of the AccountAddress -func (aa *AccountAddress) String() string { - if aa.IsSpecial() { - return fmt.Sprintf("0x%x", aa[31]) - } - return BytesToHex(aa[:]) -} - -// ParseStringRelaxed parses a string into an AccountAddress -func (aa *AccountAddress) ParseStringRelaxed(x string) error { - x = strings.TrimPrefix(x, "0x") - if len(x) < 1 { - return ErrAddressTooShort - } - if len(x) > 64 { - return ErrAddressTooLong - } - if len(x)%2 != 0 { - x = "0" + x - } - bytes, err := hex.DecodeString(x) - if err != nil { - return err - } - // zero-prefix/right-align what bytes we got - copy((*aa)[32-len(bytes):], bytes) - - return nil -} - -var ErrAddressTooShort = errors.New("AccountAddress too short") -var ErrAddressTooLong = errors.New("AccountAddress too long") - -func BytesToHex(bytes []byte) string { - return "0x" + hex.EncodeToString(bytes) -} diff --git a/core/services/keystore/keys/aptoskey/account_test.go b/core/services/keystore/keys/aptoskey/account_test.go deleted file mode 100644 index b9ed4ea04a5..00000000000 --- a/core/services/keystore/keys/aptoskey/account_test.go +++ /dev/null @@ -1,141 +0,0 @@ -package aptoskey - -import ( - "testing" - - "github.com/stretchr/testify/assert" -) - -// Tests extracted from -// https://github.com/aptos-labs/aptos-go-sdk/blob/5ee5ac308e5881b508c0a5124f5e0b8df27a4d40/internal/types/account_test.go - -func TestStringOutput(t *testing.T) { - inputs := [][]byte{ - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01}, - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F}, - {0x12, 0x34, 0x12, 0x34, 0x12, 0x34, 0x12, 0x34, 0x12, 0x34, 0x12, 0x34, 0x12, 0x34, 0x12, 0x34, 0x12, 0x34, 0x12, 0x34, 0x12, 0x34, 0x12, 0x34, 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef}, - {0x02, 0x34, 0x12, 0x34, 0x12, 0x34, 0x12, 0x34, 0x12, 0x34, 0x12, 0x34, 0x12, 0x34, 0x12, 0x34, 0x12, 0x34, 0x12, 0x34, 0x12, 0x34, 0x12, 0x34, 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef}, - {0x00, 0x34, 0x12, 0x34, 0x12, 0x34, 0x12, 0x34, 0x12, 0x34, 0x12, 0x34, 0x12, 0x34, 0x12, 0x34, 0x12, 0x34, 0x12, 0x34, 0x12, 0x34, 0x12, 0x34, 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef}, - {0x00, 0x04, 0x12, 0x34, 0x12, 0x34, 0x12, 0x34, 0x12, 0x34, 0x12, 0x34, 0x12, 0x34, 0x12, 0x34, 0x12, 0x34, 0x12, 0x34, 0x12, 0x34, 0x12, 0x34, 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef}, - {0x00, 0x00, 0x12, 0x34, 0x12, 0x34, 0x12, 0x34, 0x12, 0x34, 0x12, 0x34, 0x12, 0x34, 0x12, 0x34, 0x12, 0x34, 0x12, 0x34, 0x12, 0x34, 0x12, 0x34, 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef}, - } - expected := []string{ - "0x0", - "0x1", - "0xf", - "0x1234123412341234123412341234123412341234123412340123456789abcdef", - "0x0234123412341234123412341234123412341234123412340123456789abcdef", - "0x0034123412341234123412341234123412341234123412340123456789abcdef", - "0x0004123412341234123412341234123412341234123412340123456789abcdef", - "0x0000123412341234123412341234123412341234123412340123456789abcdef", - } - - for i := 0; i < len(inputs); i++ { - addr := AccountAddress(inputs[i]) - assert.Equal(t, expected[i], addr.String()) - } -} - -func TestAccountAddress_ParseStringRelaxed_Error(t *testing.T) { - var owner AccountAddress - err := owner.ParseStringRelaxed("0x") - assert.Error(t, err) - err = owner.ParseStringRelaxed("0xF1234567812345678123456781234567812345678123456781234567812345678") - assert.Error(t, err) - err = owner.ParseStringRelaxed("NotHex") - assert.Error(t, err) -} - -func TestAccountAddress_String(t *testing.T) { - testCases := []struct { - name string - address AccountAddress - expected string - }{ - { - name: "Special address", - address: AccountAddress{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01}, - expected: "0x1", - }, - { - name: "Non-special address", - address: AccountAddress{0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0, 0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0, 0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0, 0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0}, - expected: "0x123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0", - }, - } - - for _, tc := range testCases { - t.Run(tc.name, func(t *testing.T) { - assert.Equal(t, tc.expected, tc.address.String()) - }) - } -} - -func TestAccountAddress_IsSpecial(t *testing.T) { - testCases := []struct { - name string - address AccountAddress - expected bool - }{ - { - name: "Special address", - address: AccountAddress{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01}, - expected: true, - }, - { - name: "Non-special address", - address: AccountAddress{0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0, 0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0, 0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0, 0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0}, - expected: false, - }, - } - - for _, tc := range testCases { - t.Run(tc.name, func(t *testing.T) { - assert.Equal(t, tc.expected, tc.address.IsSpecial()) - }) - } -} - -func TestBytesToHex(t *testing.T) { - testCases := []struct { - name string - bytes []byte - expected string - }{ - { - name: "Empty bytes", - bytes: []byte{}, - expected: "0x", - }, - { - name: "Non-empty bytes", - bytes: []byte{0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0}, - expected: "0x123456789abcdef0", - }, - } - - for _, tc := range testCases { - t.Run(tc.name, func(t *testing.T) { - assert.Equal(t, tc.expected, BytesToHex(tc.bytes)) - }) - } -} - -func TestAccountSpecialString(t *testing.T) { - var aa AccountAddress - aa[31] = 3 - aas := aa.String() - if aas != "0x3" { - t.Errorf("wanted 0x3 got %s", aas) - } - - var aa2 AccountAddress - err := aa2.ParseStringRelaxed("0x3") - if err != nil { - t.Errorf("unexpected err %s", err) - } - if aa2 != aa { - t.Errorf("aa2 != aa") - } -} diff --git a/core/services/keystore/keys/aptoskey/key.go b/core/services/keystore/keys/aptoskey/key.go index ec9b27a3596..fa8925454e4 100644 --- a/core/services/keystore/keys/aptoskey/key.go +++ b/core/services/keystore/keys/aptoskey/key.go @@ -7,7 +7,7 @@ import ( "fmt" "io" - "github.com/mr-tron/base58" + "golang.org/x/crypto/sha3" ) // Raw represents the Aptos private key @@ -37,6 +37,7 @@ var _ fmt.GoStringer = &Key{} // Key represents Aptos key type Key struct { + // TODO: store initial Account() derivation to support key rotation privkey ed25519.PrivateKey pubKey ed25519.PublicKey } @@ -72,14 +73,20 @@ func (key Key) ID() string { return key.PublicKeyStr() } +// https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-40.md#long +func (key Key) Account() string { + authKey := sha3.Sum256(append([]byte(key.pubKey), 0x00)) + return fmt.Sprintf("%064x", authKey) +} + // GetPublic get Key's public key func (key Key) GetPublic() ed25519.PublicKey { return key.pubKey } -// PublicKeyStr return base58 encoded public key +// PublicKeyStr returns hex encoded public key func (key Key) PublicKeyStr() string { - return base58.Encode(key.pubKey) + return fmt.Sprintf("%064x", key.pubKey) } // Raw returns the seed from private key diff --git a/core/services/keystore/keys/aptoskey/key_test.go b/core/services/keystore/keys/aptoskey/key_test.go new file mode 100644 index 00000000000..277a30eb9f3 --- /dev/null +++ b/core/services/keystore/keys/aptoskey/key_test.go @@ -0,0 +1,17 @@ +package aptoskey + +import ( + "encoding/hex" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func TestAptosKey(t *testing.T) { + bytes, err := hex.DecodeString("f0d07ab448018b2754475f9a3b580218b0675a1456aad96ad607c7bbd7d9237b") + require.NoError(t, err) + k := Raw(bytes).Key() + assert.Equal(t, k.PublicKeyStr(), "2acd605efc181e2af8a0b8c0686a5e12578efa1253d15a235fa5e5ad970c4b29") + assert.Equal(t, k.Account(), "69d8b07f5945185873c622ea66873b0e1fb921de7b94d904d3ef9be80770682e") +} diff --git a/core/services/keystore/keys/cosmoskey/key.go b/core/services/keystore/keys/cosmoskey/key.go index 3e516a21ab5..b5ea255f23f 100644 --- a/core/services/keystore/keys/cosmoskey/key.go +++ b/core/services/keystore/keys/cosmoskey/key.go @@ -59,9 +59,6 @@ func newFrom(reader io.Reader) Key { panic(err) } privKey := secpSigningAlgo.Generate()(rawKey.D.Bytes()) - if err != nil { - panic(err) - } return Key{ d: rawKey.D, diff --git a/core/services/keystore/keys/ocr2key/aptos_keyring.go b/core/services/keystore/keys/ocr2key/aptos_keyring.go index 51e6c3a9c8f..cdc5afa792f 100644 --- a/core/services/keystore/keys/ocr2key/aptos_keyring.go +++ b/core/services/keystore/keys/ocr2key/aptos_keyring.go @@ -2,12 +2,11 @@ package ocr2key import ( "crypto/ed25519" - "encoding/binary" "io" "github.com/hdevalence/ed25519consensus" "github.com/pkg/errors" - "golang.org/x/crypto/blake2s" + "golang.org/x/crypto/blake2b" "github.com/smartcontractkit/chainlink/v2/core/utils" @@ -37,17 +36,15 @@ func (akr *aptosKeyring) PublicKey() ocrtypes.OnchainPublicKey { func (akr *aptosKeyring) reportToSigData(reportCtx ocrtypes.ReportContext, report ocrtypes.Report) ([]byte, error) { rawReportContext := evmutil.RawReportContext(reportCtx) - h, err := blake2s.New256(nil) + h, err := blake2b.New256(nil) if err != nil { return nil, err } - reportLen := make([]byte, 4) - binary.BigEndian.PutUint32(reportLen[0:], uint32(len(report))) - h.Write(reportLen[:]) - h.Write(report) + // blake2b_256(report_context | report) h.Write(rawReportContext[0][:]) h.Write(rawReportContext[1][:]) h.Write(rawReportContext[2][:]) + h.Write(report) return h.Sum(nil), nil } diff --git a/core/services/keystore/master.go b/core/services/keystore/master.go index 4076fee6a2a..47136f1f2ec 100644 --- a/core/services/keystore/master.go +++ b/core/services/keystore/master.go @@ -34,8 +34,6 @@ var ( // necessary because it is lazily evaluated type DefaultEVMChainIDFunc func() (defaultEVMChainID *big.Int, err error) -//go:generate mockery --quiet --name Master --output ./mocks/ --case=underscore - type Master interface { CSA() CSA Eth() Eth diff --git a/core/services/keystore/mocks/aptos.go b/core/services/keystore/mocks/aptos.go index 476112149bf..775f5d275e9 100644 --- a/core/services/keystore/mocks/aptos.go +++ b/core/services/keystore/mocks/aptos.go @@ -15,6 +15,14 @@ type Aptos struct { mock.Mock } +type Aptos_Expecter struct { + mock *mock.Mock +} + +func (_m *Aptos) EXPECT() *Aptos_Expecter { + return &Aptos_Expecter{mock: &_m.Mock} +} + // Add provides a mock function with given fields: ctx, key func (_m *Aptos) Add(ctx context.Context, key aptoskey.Key) error { ret := _m.Called(ctx, key) @@ -33,6 +41,35 @@ func (_m *Aptos) Add(ctx context.Context, key aptoskey.Key) error { return r0 } +// Aptos_Add_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Add' +type Aptos_Add_Call struct { + *mock.Call +} + +// Add is a helper method to define mock.On call +// - ctx context.Context +// - key aptoskey.Key +func (_e *Aptos_Expecter) Add(ctx interface{}, key interface{}) *Aptos_Add_Call { + return &Aptos_Add_Call{Call: _e.mock.On("Add", ctx, key)} +} + +func (_c *Aptos_Add_Call) Run(run func(ctx context.Context, key aptoskey.Key)) *Aptos_Add_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(aptoskey.Key)) + }) + return _c +} + +func (_c *Aptos_Add_Call) Return(_a0 error) *Aptos_Add_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Aptos_Add_Call) RunAndReturn(run func(context.Context, aptoskey.Key) error) *Aptos_Add_Call { + _c.Call.Return(run) + return _c +} + // Create provides a mock function with given fields: ctx func (_m *Aptos) Create(ctx context.Context) (aptoskey.Key, error) { ret := _m.Called(ctx) @@ -61,6 +98,34 @@ func (_m *Aptos) Create(ctx context.Context) (aptoskey.Key, error) { return r0, r1 } +// Aptos_Create_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Create' +type Aptos_Create_Call struct { + *mock.Call +} + +// Create is a helper method to define mock.On call +// - ctx context.Context +func (_e *Aptos_Expecter) Create(ctx interface{}) *Aptos_Create_Call { + return &Aptos_Create_Call{Call: _e.mock.On("Create", ctx)} +} + +func (_c *Aptos_Create_Call) Run(run func(ctx context.Context)) *Aptos_Create_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *Aptos_Create_Call) Return(_a0 aptoskey.Key, _a1 error) *Aptos_Create_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Aptos_Create_Call) RunAndReturn(run func(context.Context) (aptoskey.Key, error)) *Aptos_Create_Call { + _c.Call.Return(run) + return _c +} + // Delete provides a mock function with given fields: ctx, id func (_m *Aptos) Delete(ctx context.Context, id string) (aptoskey.Key, error) { ret := _m.Called(ctx, id) @@ -89,6 +154,35 @@ func (_m *Aptos) Delete(ctx context.Context, id string) (aptoskey.Key, error) { return r0, r1 } +// Aptos_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete' +type Aptos_Delete_Call struct { + *mock.Call +} + +// Delete is a helper method to define mock.On call +// - ctx context.Context +// - id string +func (_e *Aptos_Expecter) Delete(ctx interface{}, id interface{}) *Aptos_Delete_Call { + return &Aptos_Delete_Call{Call: _e.mock.On("Delete", ctx, id)} +} + +func (_c *Aptos_Delete_Call) Run(run func(ctx context.Context, id string)) *Aptos_Delete_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *Aptos_Delete_Call) Return(_a0 aptoskey.Key, _a1 error) *Aptos_Delete_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Aptos_Delete_Call) RunAndReturn(run func(context.Context, string) (aptoskey.Key, error)) *Aptos_Delete_Call { + _c.Call.Return(run) + return _c +} + // EnsureKey provides a mock function with given fields: ctx func (_m *Aptos) EnsureKey(ctx context.Context) error { ret := _m.Called(ctx) @@ -107,6 +201,34 @@ func (_m *Aptos) EnsureKey(ctx context.Context) error { return r0 } +// Aptos_EnsureKey_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EnsureKey' +type Aptos_EnsureKey_Call struct { + *mock.Call +} + +// EnsureKey is a helper method to define mock.On call +// - ctx context.Context +func (_e *Aptos_Expecter) EnsureKey(ctx interface{}) *Aptos_EnsureKey_Call { + return &Aptos_EnsureKey_Call{Call: _e.mock.On("EnsureKey", ctx)} +} + +func (_c *Aptos_EnsureKey_Call) Run(run func(ctx context.Context)) *Aptos_EnsureKey_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *Aptos_EnsureKey_Call) Return(_a0 error) *Aptos_EnsureKey_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Aptos_EnsureKey_Call) RunAndReturn(run func(context.Context) error) *Aptos_EnsureKey_Call { + _c.Call.Return(run) + return _c +} + // Export provides a mock function with given fields: id, password func (_m *Aptos) Export(id string, password string) ([]byte, error) { ret := _m.Called(id, password) @@ -137,6 +259,35 @@ func (_m *Aptos) Export(id string, password string) ([]byte, error) { return r0, r1 } +// Aptos_Export_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Export' +type Aptos_Export_Call struct { + *mock.Call +} + +// Export is a helper method to define mock.On call +// - id string +// - password string +func (_e *Aptos_Expecter) Export(id interface{}, password interface{}) *Aptos_Export_Call { + return &Aptos_Export_Call{Call: _e.mock.On("Export", id, password)} +} + +func (_c *Aptos_Export_Call) Run(run func(id string, password string)) *Aptos_Export_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(string)) + }) + return _c +} + +func (_c *Aptos_Export_Call) Return(_a0 []byte, _a1 error) *Aptos_Export_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Aptos_Export_Call) RunAndReturn(run func(string, string) ([]byte, error)) *Aptos_Export_Call { + _c.Call.Return(run) + return _c +} + // Get provides a mock function with given fields: id func (_m *Aptos) Get(id string) (aptoskey.Key, error) { ret := _m.Called(id) @@ -165,6 +316,34 @@ func (_m *Aptos) Get(id string) (aptoskey.Key, error) { return r0, r1 } +// Aptos_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' +type Aptos_Get_Call struct { + *mock.Call +} + +// Get is a helper method to define mock.On call +// - id string +func (_e *Aptos_Expecter) Get(id interface{}) *Aptos_Get_Call { + return &Aptos_Get_Call{Call: _e.mock.On("Get", id)} +} + +func (_c *Aptos_Get_Call) Run(run func(id string)) *Aptos_Get_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Aptos_Get_Call) Return(_a0 aptoskey.Key, _a1 error) *Aptos_Get_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Aptos_Get_Call) RunAndReturn(run func(string) (aptoskey.Key, error)) *Aptos_Get_Call { + _c.Call.Return(run) + return _c +} + // GetAll provides a mock function with given fields: func (_m *Aptos) GetAll() ([]aptoskey.Key, error) { ret := _m.Called() @@ -195,6 +374,33 @@ func (_m *Aptos) GetAll() ([]aptoskey.Key, error) { return r0, r1 } +// Aptos_GetAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAll' +type Aptos_GetAll_Call struct { + *mock.Call +} + +// GetAll is a helper method to define mock.On call +func (_e *Aptos_Expecter) GetAll() *Aptos_GetAll_Call { + return &Aptos_GetAll_Call{Call: _e.mock.On("GetAll")} +} + +func (_c *Aptos_GetAll_Call) Run(run func()) *Aptos_GetAll_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Aptos_GetAll_Call) Return(_a0 []aptoskey.Key, _a1 error) *Aptos_GetAll_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Aptos_GetAll_Call) RunAndReturn(run func() ([]aptoskey.Key, error)) *Aptos_GetAll_Call { + _c.Call.Return(run) + return _c +} + // Import provides a mock function with given fields: ctx, keyJSON, password func (_m *Aptos) Import(ctx context.Context, keyJSON []byte, password string) (aptoskey.Key, error) { ret := _m.Called(ctx, keyJSON, password) @@ -223,6 +429,36 @@ func (_m *Aptos) Import(ctx context.Context, keyJSON []byte, password string) (a return r0, r1 } +// Aptos_Import_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Import' +type Aptos_Import_Call struct { + *mock.Call +} + +// Import is a helper method to define mock.On call +// - ctx context.Context +// - keyJSON []byte +// - password string +func (_e *Aptos_Expecter) Import(ctx interface{}, keyJSON interface{}, password interface{}) *Aptos_Import_Call { + return &Aptos_Import_Call{Call: _e.mock.On("Import", ctx, keyJSON, password)} +} + +func (_c *Aptos_Import_Call) Run(run func(ctx context.Context, keyJSON []byte, password string)) *Aptos_Import_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].([]byte), args[2].(string)) + }) + return _c +} + +func (_c *Aptos_Import_Call) Return(_a0 aptoskey.Key, _a1 error) *Aptos_Import_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Aptos_Import_Call) RunAndReturn(run func(context.Context, []byte, string) (aptoskey.Key, error)) *Aptos_Import_Call { + _c.Call.Return(run) + return _c +} + // Sign provides a mock function with given fields: ctx, id, msg func (_m *Aptos) Sign(ctx context.Context, id string, msg []byte) ([]byte, error) { ret := _m.Called(ctx, id, msg) @@ -253,6 +489,36 @@ func (_m *Aptos) Sign(ctx context.Context, id string, msg []byte) ([]byte, error return r0, r1 } +// Aptos_Sign_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Sign' +type Aptos_Sign_Call struct { + *mock.Call +} + +// Sign is a helper method to define mock.On call +// - ctx context.Context +// - id string +// - msg []byte +func (_e *Aptos_Expecter) Sign(ctx interface{}, id interface{}, msg interface{}) *Aptos_Sign_Call { + return &Aptos_Sign_Call{Call: _e.mock.On("Sign", ctx, id, msg)} +} + +func (_c *Aptos_Sign_Call) Run(run func(ctx context.Context, id string, msg []byte)) *Aptos_Sign_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].([]byte)) + }) + return _c +} + +func (_c *Aptos_Sign_Call) Return(signature []byte, err error) *Aptos_Sign_Call { + _c.Call.Return(signature, err) + return _c +} + +func (_c *Aptos_Sign_Call) RunAndReturn(run func(context.Context, string, []byte) ([]byte, error)) *Aptos_Sign_Call { + _c.Call.Return(run) + return _c +} + // NewAptos creates a new instance of Aptos. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewAptos(t interface { diff --git a/core/services/keystore/mocks/cosmos.go b/core/services/keystore/mocks/cosmos.go index db143e6e345..59e1de542e8 100644 --- a/core/services/keystore/mocks/cosmos.go +++ b/core/services/keystore/mocks/cosmos.go @@ -15,6 +15,14 @@ type Cosmos struct { mock.Mock } +type Cosmos_Expecter struct { + mock *mock.Mock +} + +func (_m *Cosmos) EXPECT() *Cosmos_Expecter { + return &Cosmos_Expecter{mock: &_m.Mock} +} + // Add provides a mock function with given fields: ctx, key func (_m *Cosmos) Add(ctx context.Context, key cosmoskey.Key) error { ret := _m.Called(ctx, key) @@ -33,6 +41,35 @@ func (_m *Cosmos) Add(ctx context.Context, key cosmoskey.Key) error { return r0 } +// Cosmos_Add_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Add' +type Cosmos_Add_Call struct { + *mock.Call +} + +// Add is a helper method to define mock.On call +// - ctx context.Context +// - key cosmoskey.Key +func (_e *Cosmos_Expecter) Add(ctx interface{}, key interface{}) *Cosmos_Add_Call { + return &Cosmos_Add_Call{Call: _e.mock.On("Add", ctx, key)} +} + +func (_c *Cosmos_Add_Call) Run(run func(ctx context.Context, key cosmoskey.Key)) *Cosmos_Add_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(cosmoskey.Key)) + }) + return _c +} + +func (_c *Cosmos_Add_Call) Return(_a0 error) *Cosmos_Add_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Cosmos_Add_Call) RunAndReturn(run func(context.Context, cosmoskey.Key) error) *Cosmos_Add_Call { + _c.Call.Return(run) + return _c +} + // Create provides a mock function with given fields: ctx func (_m *Cosmos) Create(ctx context.Context) (cosmoskey.Key, error) { ret := _m.Called(ctx) @@ -61,6 +98,34 @@ func (_m *Cosmos) Create(ctx context.Context) (cosmoskey.Key, error) { return r0, r1 } +// Cosmos_Create_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Create' +type Cosmos_Create_Call struct { + *mock.Call +} + +// Create is a helper method to define mock.On call +// - ctx context.Context +func (_e *Cosmos_Expecter) Create(ctx interface{}) *Cosmos_Create_Call { + return &Cosmos_Create_Call{Call: _e.mock.On("Create", ctx)} +} + +func (_c *Cosmos_Create_Call) Run(run func(ctx context.Context)) *Cosmos_Create_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *Cosmos_Create_Call) Return(_a0 cosmoskey.Key, _a1 error) *Cosmos_Create_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Cosmos_Create_Call) RunAndReturn(run func(context.Context) (cosmoskey.Key, error)) *Cosmos_Create_Call { + _c.Call.Return(run) + return _c +} + // Delete provides a mock function with given fields: ctx, id func (_m *Cosmos) Delete(ctx context.Context, id string) (cosmoskey.Key, error) { ret := _m.Called(ctx, id) @@ -89,6 +154,35 @@ func (_m *Cosmos) Delete(ctx context.Context, id string) (cosmoskey.Key, error) return r0, r1 } +// Cosmos_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete' +type Cosmos_Delete_Call struct { + *mock.Call +} + +// Delete is a helper method to define mock.On call +// - ctx context.Context +// - id string +func (_e *Cosmos_Expecter) Delete(ctx interface{}, id interface{}) *Cosmos_Delete_Call { + return &Cosmos_Delete_Call{Call: _e.mock.On("Delete", ctx, id)} +} + +func (_c *Cosmos_Delete_Call) Run(run func(ctx context.Context, id string)) *Cosmos_Delete_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *Cosmos_Delete_Call) Return(_a0 cosmoskey.Key, _a1 error) *Cosmos_Delete_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Cosmos_Delete_Call) RunAndReturn(run func(context.Context, string) (cosmoskey.Key, error)) *Cosmos_Delete_Call { + _c.Call.Return(run) + return _c +} + // EnsureKey provides a mock function with given fields: ctx func (_m *Cosmos) EnsureKey(ctx context.Context) error { ret := _m.Called(ctx) @@ -107,6 +201,34 @@ func (_m *Cosmos) EnsureKey(ctx context.Context) error { return r0 } +// Cosmos_EnsureKey_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EnsureKey' +type Cosmos_EnsureKey_Call struct { + *mock.Call +} + +// EnsureKey is a helper method to define mock.On call +// - ctx context.Context +func (_e *Cosmos_Expecter) EnsureKey(ctx interface{}) *Cosmos_EnsureKey_Call { + return &Cosmos_EnsureKey_Call{Call: _e.mock.On("EnsureKey", ctx)} +} + +func (_c *Cosmos_EnsureKey_Call) Run(run func(ctx context.Context)) *Cosmos_EnsureKey_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *Cosmos_EnsureKey_Call) Return(_a0 error) *Cosmos_EnsureKey_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Cosmos_EnsureKey_Call) RunAndReturn(run func(context.Context) error) *Cosmos_EnsureKey_Call { + _c.Call.Return(run) + return _c +} + // Export provides a mock function with given fields: id, password func (_m *Cosmos) Export(id string, password string) ([]byte, error) { ret := _m.Called(id, password) @@ -137,6 +259,35 @@ func (_m *Cosmos) Export(id string, password string) ([]byte, error) { return r0, r1 } +// Cosmos_Export_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Export' +type Cosmos_Export_Call struct { + *mock.Call +} + +// Export is a helper method to define mock.On call +// - id string +// - password string +func (_e *Cosmos_Expecter) Export(id interface{}, password interface{}) *Cosmos_Export_Call { + return &Cosmos_Export_Call{Call: _e.mock.On("Export", id, password)} +} + +func (_c *Cosmos_Export_Call) Run(run func(id string, password string)) *Cosmos_Export_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(string)) + }) + return _c +} + +func (_c *Cosmos_Export_Call) Return(_a0 []byte, _a1 error) *Cosmos_Export_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Cosmos_Export_Call) RunAndReturn(run func(string, string) ([]byte, error)) *Cosmos_Export_Call { + _c.Call.Return(run) + return _c +} + // Get provides a mock function with given fields: id func (_m *Cosmos) Get(id string) (cosmoskey.Key, error) { ret := _m.Called(id) @@ -165,6 +316,34 @@ func (_m *Cosmos) Get(id string) (cosmoskey.Key, error) { return r0, r1 } +// Cosmos_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' +type Cosmos_Get_Call struct { + *mock.Call +} + +// Get is a helper method to define mock.On call +// - id string +func (_e *Cosmos_Expecter) Get(id interface{}) *Cosmos_Get_Call { + return &Cosmos_Get_Call{Call: _e.mock.On("Get", id)} +} + +func (_c *Cosmos_Get_Call) Run(run func(id string)) *Cosmos_Get_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Cosmos_Get_Call) Return(_a0 cosmoskey.Key, _a1 error) *Cosmos_Get_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Cosmos_Get_Call) RunAndReturn(run func(string) (cosmoskey.Key, error)) *Cosmos_Get_Call { + _c.Call.Return(run) + return _c +} + // GetAll provides a mock function with given fields: func (_m *Cosmos) GetAll() ([]cosmoskey.Key, error) { ret := _m.Called() @@ -195,6 +374,33 @@ func (_m *Cosmos) GetAll() ([]cosmoskey.Key, error) { return r0, r1 } +// Cosmos_GetAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAll' +type Cosmos_GetAll_Call struct { + *mock.Call +} + +// GetAll is a helper method to define mock.On call +func (_e *Cosmos_Expecter) GetAll() *Cosmos_GetAll_Call { + return &Cosmos_GetAll_Call{Call: _e.mock.On("GetAll")} +} + +func (_c *Cosmos_GetAll_Call) Run(run func()) *Cosmos_GetAll_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Cosmos_GetAll_Call) Return(_a0 []cosmoskey.Key, _a1 error) *Cosmos_GetAll_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Cosmos_GetAll_Call) RunAndReturn(run func() ([]cosmoskey.Key, error)) *Cosmos_GetAll_Call { + _c.Call.Return(run) + return _c +} + // Import provides a mock function with given fields: ctx, keyJSON, password func (_m *Cosmos) Import(ctx context.Context, keyJSON []byte, password string) (cosmoskey.Key, error) { ret := _m.Called(ctx, keyJSON, password) @@ -223,6 +429,36 @@ func (_m *Cosmos) Import(ctx context.Context, keyJSON []byte, password string) ( return r0, r1 } +// Cosmos_Import_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Import' +type Cosmos_Import_Call struct { + *mock.Call +} + +// Import is a helper method to define mock.On call +// - ctx context.Context +// - keyJSON []byte +// - password string +func (_e *Cosmos_Expecter) Import(ctx interface{}, keyJSON interface{}, password interface{}) *Cosmos_Import_Call { + return &Cosmos_Import_Call{Call: _e.mock.On("Import", ctx, keyJSON, password)} +} + +func (_c *Cosmos_Import_Call) Run(run func(ctx context.Context, keyJSON []byte, password string)) *Cosmos_Import_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].([]byte), args[2].(string)) + }) + return _c +} + +func (_c *Cosmos_Import_Call) Return(_a0 cosmoskey.Key, _a1 error) *Cosmos_Import_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Cosmos_Import_Call) RunAndReturn(run func(context.Context, []byte, string) (cosmoskey.Key, error)) *Cosmos_Import_Call { + _c.Call.Return(run) + return _c +} + // NewCosmos creates a new instance of Cosmos. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewCosmos(t interface { diff --git a/core/services/keystore/mocks/csa.go b/core/services/keystore/mocks/csa.go index c3e76f9f690..56ca7d9dab2 100644 --- a/core/services/keystore/mocks/csa.go +++ b/core/services/keystore/mocks/csa.go @@ -15,6 +15,14 @@ type CSA struct { mock.Mock } +type CSA_Expecter struct { + mock *mock.Mock +} + +func (_m *CSA) EXPECT() *CSA_Expecter { + return &CSA_Expecter{mock: &_m.Mock} +} + // Add provides a mock function with given fields: ctx, key func (_m *CSA) Add(ctx context.Context, key csakey.KeyV2) error { ret := _m.Called(ctx, key) @@ -33,6 +41,35 @@ func (_m *CSA) Add(ctx context.Context, key csakey.KeyV2) error { return r0 } +// CSA_Add_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Add' +type CSA_Add_Call struct { + *mock.Call +} + +// Add is a helper method to define mock.On call +// - ctx context.Context +// - key csakey.KeyV2 +func (_e *CSA_Expecter) Add(ctx interface{}, key interface{}) *CSA_Add_Call { + return &CSA_Add_Call{Call: _e.mock.On("Add", ctx, key)} +} + +func (_c *CSA_Add_Call) Run(run func(ctx context.Context, key csakey.KeyV2)) *CSA_Add_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(csakey.KeyV2)) + }) + return _c +} + +func (_c *CSA_Add_Call) Return(_a0 error) *CSA_Add_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *CSA_Add_Call) RunAndReturn(run func(context.Context, csakey.KeyV2) error) *CSA_Add_Call { + _c.Call.Return(run) + return _c +} + // Create provides a mock function with given fields: ctx func (_m *CSA) Create(ctx context.Context) (csakey.KeyV2, error) { ret := _m.Called(ctx) @@ -61,6 +98,34 @@ func (_m *CSA) Create(ctx context.Context) (csakey.KeyV2, error) { return r0, r1 } +// CSA_Create_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Create' +type CSA_Create_Call struct { + *mock.Call +} + +// Create is a helper method to define mock.On call +// - ctx context.Context +func (_e *CSA_Expecter) Create(ctx interface{}) *CSA_Create_Call { + return &CSA_Create_Call{Call: _e.mock.On("Create", ctx)} +} + +func (_c *CSA_Create_Call) Run(run func(ctx context.Context)) *CSA_Create_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *CSA_Create_Call) Return(_a0 csakey.KeyV2, _a1 error) *CSA_Create_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *CSA_Create_Call) RunAndReturn(run func(context.Context) (csakey.KeyV2, error)) *CSA_Create_Call { + _c.Call.Return(run) + return _c +} + // Delete provides a mock function with given fields: ctx, id func (_m *CSA) Delete(ctx context.Context, id string) (csakey.KeyV2, error) { ret := _m.Called(ctx, id) @@ -89,6 +154,35 @@ func (_m *CSA) Delete(ctx context.Context, id string) (csakey.KeyV2, error) { return r0, r1 } +// CSA_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete' +type CSA_Delete_Call struct { + *mock.Call +} + +// Delete is a helper method to define mock.On call +// - ctx context.Context +// - id string +func (_e *CSA_Expecter) Delete(ctx interface{}, id interface{}) *CSA_Delete_Call { + return &CSA_Delete_Call{Call: _e.mock.On("Delete", ctx, id)} +} + +func (_c *CSA_Delete_Call) Run(run func(ctx context.Context, id string)) *CSA_Delete_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *CSA_Delete_Call) Return(_a0 csakey.KeyV2, _a1 error) *CSA_Delete_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *CSA_Delete_Call) RunAndReturn(run func(context.Context, string) (csakey.KeyV2, error)) *CSA_Delete_Call { + _c.Call.Return(run) + return _c +} + // EnsureKey provides a mock function with given fields: ctx func (_m *CSA) EnsureKey(ctx context.Context) error { ret := _m.Called(ctx) @@ -107,6 +201,34 @@ func (_m *CSA) EnsureKey(ctx context.Context) error { return r0 } +// CSA_EnsureKey_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EnsureKey' +type CSA_EnsureKey_Call struct { + *mock.Call +} + +// EnsureKey is a helper method to define mock.On call +// - ctx context.Context +func (_e *CSA_Expecter) EnsureKey(ctx interface{}) *CSA_EnsureKey_Call { + return &CSA_EnsureKey_Call{Call: _e.mock.On("EnsureKey", ctx)} +} + +func (_c *CSA_EnsureKey_Call) Run(run func(ctx context.Context)) *CSA_EnsureKey_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *CSA_EnsureKey_Call) Return(_a0 error) *CSA_EnsureKey_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *CSA_EnsureKey_Call) RunAndReturn(run func(context.Context) error) *CSA_EnsureKey_Call { + _c.Call.Return(run) + return _c +} + // Export provides a mock function with given fields: id, password func (_m *CSA) Export(id string, password string) ([]byte, error) { ret := _m.Called(id, password) @@ -137,6 +259,35 @@ func (_m *CSA) Export(id string, password string) ([]byte, error) { return r0, r1 } +// CSA_Export_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Export' +type CSA_Export_Call struct { + *mock.Call +} + +// Export is a helper method to define mock.On call +// - id string +// - password string +func (_e *CSA_Expecter) Export(id interface{}, password interface{}) *CSA_Export_Call { + return &CSA_Export_Call{Call: _e.mock.On("Export", id, password)} +} + +func (_c *CSA_Export_Call) Run(run func(id string, password string)) *CSA_Export_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(string)) + }) + return _c +} + +func (_c *CSA_Export_Call) Return(_a0 []byte, _a1 error) *CSA_Export_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *CSA_Export_Call) RunAndReturn(run func(string, string) ([]byte, error)) *CSA_Export_Call { + _c.Call.Return(run) + return _c +} + // Get provides a mock function with given fields: id func (_m *CSA) Get(id string) (csakey.KeyV2, error) { ret := _m.Called(id) @@ -165,6 +316,34 @@ func (_m *CSA) Get(id string) (csakey.KeyV2, error) { return r0, r1 } +// CSA_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' +type CSA_Get_Call struct { + *mock.Call +} + +// Get is a helper method to define mock.On call +// - id string +func (_e *CSA_Expecter) Get(id interface{}) *CSA_Get_Call { + return &CSA_Get_Call{Call: _e.mock.On("Get", id)} +} + +func (_c *CSA_Get_Call) Run(run func(id string)) *CSA_Get_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *CSA_Get_Call) Return(_a0 csakey.KeyV2, _a1 error) *CSA_Get_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *CSA_Get_Call) RunAndReturn(run func(string) (csakey.KeyV2, error)) *CSA_Get_Call { + _c.Call.Return(run) + return _c +} + // GetAll provides a mock function with given fields: func (_m *CSA) GetAll() ([]csakey.KeyV2, error) { ret := _m.Called() @@ -195,6 +374,33 @@ func (_m *CSA) GetAll() ([]csakey.KeyV2, error) { return r0, r1 } +// CSA_GetAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAll' +type CSA_GetAll_Call struct { + *mock.Call +} + +// GetAll is a helper method to define mock.On call +func (_e *CSA_Expecter) GetAll() *CSA_GetAll_Call { + return &CSA_GetAll_Call{Call: _e.mock.On("GetAll")} +} + +func (_c *CSA_GetAll_Call) Run(run func()) *CSA_GetAll_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *CSA_GetAll_Call) Return(_a0 []csakey.KeyV2, _a1 error) *CSA_GetAll_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *CSA_GetAll_Call) RunAndReturn(run func() ([]csakey.KeyV2, error)) *CSA_GetAll_Call { + _c.Call.Return(run) + return _c +} + // Import provides a mock function with given fields: ctx, keyJSON, password func (_m *CSA) Import(ctx context.Context, keyJSON []byte, password string) (csakey.KeyV2, error) { ret := _m.Called(ctx, keyJSON, password) @@ -223,6 +429,36 @@ func (_m *CSA) Import(ctx context.Context, keyJSON []byte, password string) (csa return r0, r1 } +// CSA_Import_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Import' +type CSA_Import_Call struct { + *mock.Call +} + +// Import is a helper method to define mock.On call +// - ctx context.Context +// - keyJSON []byte +// - password string +func (_e *CSA_Expecter) Import(ctx interface{}, keyJSON interface{}, password interface{}) *CSA_Import_Call { + return &CSA_Import_Call{Call: _e.mock.On("Import", ctx, keyJSON, password)} +} + +func (_c *CSA_Import_Call) Run(run func(ctx context.Context, keyJSON []byte, password string)) *CSA_Import_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].([]byte), args[2].(string)) + }) + return _c +} + +func (_c *CSA_Import_Call) Return(_a0 csakey.KeyV2, _a1 error) *CSA_Import_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *CSA_Import_Call) RunAndReturn(run func(context.Context, []byte, string) (csakey.KeyV2, error)) *CSA_Import_Call { + _c.Call.Return(run) + return _c +} + // NewCSA creates a new instance of CSA. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewCSA(t interface { diff --git a/core/services/keystore/mocks/eth.go b/core/services/keystore/mocks/eth.go index 352605efcd3..4a9dd68fbc2 100644 --- a/core/services/keystore/mocks/eth.go +++ b/core/services/keystore/mocks/eth.go @@ -20,6 +20,14 @@ type Eth struct { mock.Mock } +type Eth_Expecter struct { + mock *mock.Mock +} + +func (_m *Eth) EXPECT() *Eth_Expecter { + return &Eth_Expecter{mock: &_m.Mock} +} + // Add provides a mock function with given fields: ctx, address, chainID func (_m *Eth) Add(ctx context.Context, address common.Address, chainID *big.Int) error { ret := _m.Called(ctx, address, chainID) @@ -38,6 +46,36 @@ func (_m *Eth) Add(ctx context.Context, address common.Address, chainID *big.Int return r0 } +// Eth_Add_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Add' +type Eth_Add_Call struct { + *mock.Call +} + +// Add is a helper method to define mock.On call +// - ctx context.Context +// - address common.Address +// - chainID *big.Int +func (_e *Eth_Expecter) Add(ctx interface{}, address interface{}, chainID interface{}) *Eth_Add_Call { + return &Eth_Add_Call{Call: _e.mock.On("Add", ctx, address, chainID)} +} + +func (_c *Eth_Add_Call) Run(run func(ctx context.Context, address common.Address, chainID *big.Int)) *Eth_Add_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(common.Address), args[2].(*big.Int)) + }) + return _c +} + +func (_c *Eth_Add_Call) Return(_a0 error) *Eth_Add_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Eth_Add_Call) RunAndReturn(run func(context.Context, common.Address, *big.Int) error) *Eth_Add_Call { + _c.Call.Return(run) + return _c +} + // CheckEnabled provides a mock function with given fields: ctx, address, chainID func (_m *Eth) CheckEnabled(ctx context.Context, address common.Address, chainID *big.Int) error { ret := _m.Called(ctx, address, chainID) @@ -56,6 +94,36 @@ func (_m *Eth) CheckEnabled(ctx context.Context, address common.Address, chainID return r0 } +// Eth_CheckEnabled_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CheckEnabled' +type Eth_CheckEnabled_Call struct { + *mock.Call +} + +// CheckEnabled is a helper method to define mock.On call +// - ctx context.Context +// - address common.Address +// - chainID *big.Int +func (_e *Eth_Expecter) CheckEnabled(ctx interface{}, address interface{}, chainID interface{}) *Eth_CheckEnabled_Call { + return &Eth_CheckEnabled_Call{Call: _e.mock.On("CheckEnabled", ctx, address, chainID)} +} + +func (_c *Eth_CheckEnabled_Call) Run(run func(ctx context.Context, address common.Address, chainID *big.Int)) *Eth_CheckEnabled_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(common.Address), args[2].(*big.Int)) + }) + return _c +} + +func (_c *Eth_CheckEnabled_Call) Return(_a0 error) *Eth_CheckEnabled_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Eth_CheckEnabled_Call) RunAndReturn(run func(context.Context, common.Address, *big.Int) error) *Eth_CheckEnabled_Call { + _c.Call.Return(run) + return _c +} + // Create provides a mock function with given fields: ctx, chainIDs func (_m *Eth) Create(ctx context.Context, chainIDs ...*big.Int) (ethkey.KeyV2, error) { _va := make([]interface{}, len(chainIDs)) @@ -91,6 +159,42 @@ func (_m *Eth) Create(ctx context.Context, chainIDs ...*big.Int) (ethkey.KeyV2, return r0, r1 } +// Eth_Create_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Create' +type Eth_Create_Call struct { + *mock.Call +} + +// Create is a helper method to define mock.On call +// - ctx context.Context +// - chainIDs ...*big.Int +func (_e *Eth_Expecter) Create(ctx interface{}, chainIDs ...interface{}) *Eth_Create_Call { + return &Eth_Create_Call{Call: _e.mock.On("Create", + append([]interface{}{ctx}, chainIDs...)...)} +} + +func (_c *Eth_Create_Call) Run(run func(ctx context.Context, chainIDs ...*big.Int)) *Eth_Create_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]*big.Int, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(*big.Int) + } + } + run(args[0].(context.Context), variadicArgs...) + }) + return _c +} + +func (_c *Eth_Create_Call) Return(_a0 ethkey.KeyV2, _a1 error) *Eth_Create_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Eth_Create_Call) RunAndReturn(run func(context.Context, ...*big.Int) (ethkey.KeyV2, error)) *Eth_Create_Call { + _c.Call.Return(run) + return _c +} + // Delete provides a mock function with given fields: ctx, id func (_m *Eth) Delete(ctx context.Context, id string) (ethkey.KeyV2, error) { ret := _m.Called(ctx, id) @@ -119,6 +223,35 @@ func (_m *Eth) Delete(ctx context.Context, id string) (ethkey.KeyV2, error) { return r0, r1 } +// Eth_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete' +type Eth_Delete_Call struct { + *mock.Call +} + +// Delete is a helper method to define mock.On call +// - ctx context.Context +// - id string +func (_e *Eth_Expecter) Delete(ctx interface{}, id interface{}) *Eth_Delete_Call { + return &Eth_Delete_Call{Call: _e.mock.On("Delete", ctx, id)} +} + +func (_c *Eth_Delete_Call) Run(run func(ctx context.Context, id string)) *Eth_Delete_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *Eth_Delete_Call) Return(_a0 ethkey.KeyV2, _a1 error) *Eth_Delete_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Eth_Delete_Call) RunAndReturn(run func(context.Context, string) (ethkey.KeyV2, error)) *Eth_Delete_Call { + _c.Call.Return(run) + return _c +} + // Disable provides a mock function with given fields: ctx, address, chainID func (_m *Eth) Disable(ctx context.Context, address common.Address, chainID *big.Int) error { ret := _m.Called(ctx, address, chainID) @@ -137,6 +270,36 @@ func (_m *Eth) Disable(ctx context.Context, address common.Address, chainID *big return r0 } +// Eth_Disable_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Disable' +type Eth_Disable_Call struct { + *mock.Call +} + +// Disable is a helper method to define mock.On call +// - ctx context.Context +// - address common.Address +// - chainID *big.Int +func (_e *Eth_Expecter) Disable(ctx interface{}, address interface{}, chainID interface{}) *Eth_Disable_Call { + return &Eth_Disable_Call{Call: _e.mock.On("Disable", ctx, address, chainID)} +} + +func (_c *Eth_Disable_Call) Run(run func(ctx context.Context, address common.Address, chainID *big.Int)) *Eth_Disable_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(common.Address), args[2].(*big.Int)) + }) + return _c +} + +func (_c *Eth_Disable_Call) Return(_a0 error) *Eth_Disable_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Eth_Disable_Call) RunAndReturn(run func(context.Context, common.Address, *big.Int) error) *Eth_Disable_Call { + _c.Call.Return(run) + return _c +} + // Enable provides a mock function with given fields: ctx, address, chainID func (_m *Eth) Enable(ctx context.Context, address common.Address, chainID *big.Int) error { ret := _m.Called(ctx, address, chainID) @@ -155,6 +318,36 @@ func (_m *Eth) Enable(ctx context.Context, address common.Address, chainID *big. return r0 } +// Eth_Enable_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Enable' +type Eth_Enable_Call struct { + *mock.Call +} + +// Enable is a helper method to define mock.On call +// - ctx context.Context +// - address common.Address +// - chainID *big.Int +func (_e *Eth_Expecter) Enable(ctx interface{}, address interface{}, chainID interface{}) *Eth_Enable_Call { + return &Eth_Enable_Call{Call: _e.mock.On("Enable", ctx, address, chainID)} +} + +func (_c *Eth_Enable_Call) Run(run func(ctx context.Context, address common.Address, chainID *big.Int)) *Eth_Enable_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(common.Address), args[2].(*big.Int)) + }) + return _c +} + +func (_c *Eth_Enable_Call) Return(_a0 error) *Eth_Enable_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Eth_Enable_Call) RunAndReturn(run func(context.Context, common.Address, *big.Int) error) *Eth_Enable_Call { + _c.Call.Return(run) + return _c +} + // EnabledAddressesForChain provides a mock function with given fields: ctx, chainID func (_m *Eth) EnabledAddressesForChain(ctx context.Context, chainID *big.Int) ([]common.Address, error) { ret := _m.Called(ctx, chainID) @@ -185,6 +378,35 @@ func (_m *Eth) EnabledAddressesForChain(ctx context.Context, chainID *big.Int) ( return r0, r1 } +// Eth_EnabledAddressesForChain_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EnabledAddressesForChain' +type Eth_EnabledAddressesForChain_Call struct { + *mock.Call +} + +// EnabledAddressesForChain is a helper method to define mock.On call +// - ctx context.Context +// - chainID *big.Int +func (_e *Eth_Expecter) EnabledAddressesForChain(ctx interface{}, chainID interface{}) *Eth_EnabledAddressesForChain_Call { + return &Eth_EnabledAddressesForChain_Call{Call: _e.mock.On("EnabledAddressesForChain", ctx, chainID)} +} + +func (_c *Eth_EnabledAddressesForChain_Call) Run(run func(ctx context.Context, chainID *big.Int)) *Eth_EnabledAddressesForChain_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*big.Int)) + }) + return _c +} + +func (_c *Eth_EnabledAddressesForChain_Call) Return(addresses []common.Address, err error) *Eth_EnabledAddressesForChain_Call { + _c.Call.Return(addresses, err) + return _c +} + +func (_c *Eth_EnabledAddressesForChain_Call) RunAndReturn(run func(context.Context, *big.Int) ([]common.Address, error)) *Eth_EnabledAddressesForChain_Call { + _c.Call.Return(run) + return _c +} + // EnabledKeysForChain provides a mock function with given fields: ctx, chainID func (_m *Eth) EnabledKeysForChain(ctx context.Context, chainID *big.Int) ([]ethkey.KeyV2, error) { ret := _m.Called(ctx, chainID) @@ -215,6 +437,35 @@ func (_m *Eth) EnabledKeysForChain(ctx context.Context, chainID *big.Int) ([]eth return r0, r1 } +// Eth_EnabledKeysForChain_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EnabledKeysForChain' +type Eth_EnabledKeysForChain_Call struct { + *mock.Call +} + +// EnabledKeysForChain is a helper method to define mock.On call +// - ctx context.Context +// - chainID *big.Int +func (_e *Eth_Expecter) EnabledKeysForChain(ctx interface{}, chainID interface{}) *Eth_EnabledKeysForChain_Call { + return &Eth_EnabledKeysForChain_Call{Call: _e.mock.On("EnabledKeysForChain", ctx, chainID)} +} + +func (_c *Eth_EnabledKeysForChain_Call) Run(run func(ctx context.Context, chainID *big.Int)) *Eth_EnabledKeysForChain_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*big.Int)) + }) + return _c +} + +func (_c *Eth_EnabledKeysForChain_Call) Return(keys []ethkey.KeyV2, err error) *Eth_EnabledKeysForChain_Call { + _c.Call.Return(keys, err) + return _c +} + +func (_c *Eth_EnabledKeysForChain_Call) RunAndReturn(run func(context.Context, *big.Int) ([]ethkey.KeyV2, error)) *Eth_EnabledKeysForChain_Call { + _c.Call.Return(run) + return _c +} + // EnsureKeys provides a mock function with given fields: ctx, chainIDs func (_m *Eth) EnsureKeys(ctx context.Context, chainIDs ...*big.Int) error { _va := make([]interface{}, len(chainIDs)) @@ -240,6 +491,42 @@ func (_m *Eth) EnsureKeys(ctx context.Context, chainIDs ...*big.Int) error { return r0 } +// Eth_EnsureKeys_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EnsureKeys' +type Eth_EnsureKeys_Call struct { + *mock.Call +} + +// EnsureKeys is a helper method to define mock.On call +// - ctx context.Context +// - chainIDs ...*big.Int +func (_e *Eth_Expecter) EnsureKeys(ctx interface{}, chainIDs ...interface{}) *Eth_EnsureKeys_Call { + return &Eth_EnsureKeys_Call{Call: _e.mock.On("EnsureKeys", + append([]interface{}{ctx}, chainIDs...)...)} +} + +func (_c *Eth_EnsureKeys_Call) Run(run func(ctx context.Context, chainIDs ...*big.Int)) *Eth_EnsureKeys_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]*big.Int, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(*big.Int) + } + } + run(args[0].(context.Context), variadicArgs...) + }) + return _c +} + +func (_c *Eth_EnsureKeys_Call) Return(_a0 error) *Eth_EnsureKeys_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Eth_EnsureKeys_Call) RunAndReturn(run func(context.Context, ...*big.Int) error) *Eth_EnsureKeys_Call { + _c.Call.Return(run) + return _c +} + // Export provides a mock function with given fields: ctx, id, password func (_m *Eth) Export(ctx context.Context, id string, password string) ([]byte, error) { ret := _m.Called(ctx, id, password) @@ -270,6 +557,36 @@ func (_m *Eth) Export(ctx context.Context, id string, password string) ([]byte, return r0, r1 } +// Eth_Export_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Export' +type Eth_Export_Call struct { + *mock.Call +} + +// Export is a helper method to define mock.On call +// - ctx context.Context +// - id string +// - password string +func (_e *Eth_Expecter) Export(ctx interface{}, id interface{}, password interface{}) *Eth_Export_Call { + return &Eth_Export_Call{Call: _e.mock.On("Export", ctx, id, password)} +} + +func (_c *Eth_Export_Call) Run(run func(ctx context.Context, id string, password string)) *Eth_Export_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string)) + }) + return _c +} + +func (_c *Eth_Export_Call) Return(_a0 []byte, _a1 error) *Eth_Export_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Eth_Export_Call) RunAndReturn(run func(context.Context, string, string) ([]byte, error)) *Eth_Export_Call { + _c.Call.Return(run) + return _c +} + // Get provides a mock function with given fields: ctx, id func (_m *Eth) Get(ctx context.Context, id string) (ethkey.KeyV2, error) { ret := _m.Called(ctx, id) @@ -298,6 +615,35 @@ func (_m *Eth) Get(ctx context.Context, id string) (ethkey.KeyV2, error) { return r0, r1 } +// Eth_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' +type Eth_Get_Call struct { + *mock.Call +} + +// Get is a helper method to define mock.On call +// - ctx context.Context +// - id string +func (_e *Eth_Expecter) Get(ctx interface{}, id interface{}) *Eth_Get_Call { + return &Eth_Get_Call{Call: _e.mock.On("Get", ctx, id)} +} + +func (_c *Eth_Get_Call) Run(run func(ctx context.Context, id string)) *Eth_Get_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *Eth_Get_Call) Return(_a0 ethkey.KeyV2, _a1 error) *Eth_Get_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Eth_Get_Call) RunAndReturn(run func(context.Context, string) (ethkey.KeyV2, error)) *Eth_Get_Call { + _c.Call.Return(run) + return _c +} + // GetAll provides a mock function with given fields: ctx func (_m *Eth) GetAll(ctx context.Context) ([]ethkey.KeyV2, error) { ret := _m.Called(ctx) @@ -328,6 +674,34 @@ func (_m *Eth) GetAll(ctx context.Context) ([]ethkey.KeyV2, error) { return r0, r1 } +// Eth_GetAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAll' +type Eth_GetAll_Call struct { + *mock.Call +} + +// GetAll is a helper method to define mock.On call +// - ctx context.Context +func (_e *Eth_Expecter) GetAll(ctx interface{}) *Eth_GetAll_Call { + return &Eth_GetAll_Call{Call: _e.mock.On("GetAll", ctx)} +} + +func (_c *Eth_GetAll_Call) Run(run func(ctx context.Context)) *Eth_GetAll_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *Eth_GetAll_Call) Return(_a0 []ethkey.KeyV2, _a1 error) *Eth_GetAll_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Eth_GetAll_Call) RunAndReturn(run func(context.Context) ([]ethkey.KeyV2, error)) *Eth_GetAll_Call { + _c.Call.Return(run) + return _c +} + // GetRoundRobinAddress provides a mock function with given fields: ctx, chainID, addresses func (_m *Eth) GetRoundRobinAddress(ctx context.Context, chainID *big.Int, addresses ...common.Address) (common.Address, error) { _va := make([]interface{}, len(addresses)) @@ -365,6 +739,43 @@ func (_m *Eth) GetRoundRobinAddress(ctx context.Context, chainID *big.Int, addre return r0, r1 } +// Eth_GetRoundRobinAddress_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetRoundRobinAddress' +type Eth_GetRoundRobinAddress_Call struct { + *mock.Call +} + +// GetRoundRobinAddress is a helper method to define mock.On call +// - ctx context.Context +// - chainID *big.Int +// - addresses ...common.Address +func (_e *Eth_Expecter) GetRoundRobinAddress(ctx interface{}, chainID interface{}, addresses ...interface{}) *Eth_GetRoundRobinAddress_Call { + return &Eth_GetRoundRobinAddress_Call{Call: _e.mock.On("GetRoundRobinAddress", + append([]interface{}{ctx, chainID}, addresses...)...)} +} + +func (_c *Eth_GetRoundRobinAddress_Call) Run(run func(ctx context.Context, chainID *big.Int, addresses ...common.Address)) *Eth_GetRoundRobinAddress_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]common.Address, len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(common.Address) + } + } + run(args[0].(context.Context), args[1].(*big.Int), variadicArgs...) + }) + return _c +} + +func (_c *Eth_GetRoundRobinAddress_Call) Return(address common.Address, err error) *Eth_GetRoundRobinAddress_Call { + _c.Call.Return(address, err) + return _c +} + +func (_c *Eth_GetRoundRobinAddress_Call) RunAndReturn(run func(context.Context, *big.Int, ...common.Address) (common.Address, error)) *Eth_GetRoundRobinAddress_Call { + _c.Call.Return(run) + return _c +} + // GetState provides a mock function with given fields: ctx, id, chainID func (_m *Eth) GetState(ctx context.Context, id string, chainID *big.Int) (ethkey.State, error) { ret := _m.Called(ctx, id, chainID) @@ -393,6 +804,36 @@ func (_m *Eth) GetState(ctx context.Context, id string, chainID *big.Int) (ethke return r0, r1 } +// Eth_GetState_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetState' +type Eth_GetState_Call struct { + *mock.Call +} + +// GetState is a helper method to define mock.On call +// - ctx context.Context +// - id string +// - chainID *big.Int +func (_e *Eth_Expecter) GetState(ctx interface{}, id interface{}, chainID interface{}) *Eth_GetState_Call { + return &Eth_GetState_Call{Call: _e.mock.On("GetState", ctx, id, chainID)} +} + +func (_c *Eth_GetState_Call) Run(run func(ctx context.Context, id string, chainID *big.Int)) *Eth_GetState_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(*big.Int)) + }) + return _c +} + +func (_c *Eth_GetState_Call) Return(_a0 ethkey.State, _a1 error) *Eth_GetState_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Eth_GetState_Call) RunAndReturn(run func(context.Context, string, *big.Int) (ethkey.State, error)) *Eth_GetState_Call { + _c.Call.Return(run) + return _c +} + // GetStateForKey provides a mock function with given fields: ctx, key func (_m *Eth) GetStateForKey(ctx context.Context, key ethkey.KeyV2) (ethkey.State, error) { ret := _m.Called(ctx, key) @@ -421,6 +862,35 @@ func (_m *Eth) GetStateForKey(ctx context.Context, key ethkey.KeyV2) (ethkey.Sta return r0, r1 } +// Eth_GetStateForKey_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetStateForKey' +type Eth_GetStateForKey_Call struct { + *mock.Call +} + +// GetStateForKey is a helper method to define mock.On call +// - ctx context.Context +// - key ethkey.KeyV2 +func (_e *Eth_Expecter) GetStateForKey(ctx interface{}, key interface{}) *Eth_GetStateForKey_Call { + return &Eth_GetStateForKey_Call{Call: _e.mock.On("GetStateForKey", ctx, key)} +} + +func (_c *Eth_GetStateForKey_Call) Run(run func(ctx context.Context, key ethkey.KeyV2)) *Eth_GetStateForKey_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(ethkey.KeyV2)) + }) + return _c +} + +func (_c *Eth_GetStateForKey_Call) Return(_a0 ethkey.State, _a1 error) *Eth_GetStateForKey_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Eth_GetStateForKey_Call) RunAndReturn(run func(context.Context, ethkey.KeyV2) (ethkey.State, error)) *Eth_GetStateForKey_Call { + _c.Call.Return(run) + return _c +} + // GetStatesForChain provides a mock function with given fields: ctx, chainID func (_m *Eth) GetStatesForChain(ctx context.Context, chainID *big.Int) ([]ethkey.State, error) { ret := _m.Called(ctx, chainID) @@ -451,6 +921,35 @@ func (_m *Eth) GetStatesForChain(ctx context.Context, chainID *big.Int) ([]ethke return r0, r1 } +// Eth_GetStatesForChain_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetStatesForChain' +type Eth_GetStatesForChain_Call struct { + *mock.Call +} + +// GetStatesForChain is a helper method to define mock.On call +// - ctx context.Context +// - chainID *big.Int +func (_e *Eth_Expecter) GetStatesForChain(ctx interface{}, chainID interface{}) *Eth_GetStatesForChain_Call { + return &Eth_GetStatesForChain_Call{Call: _e.mock.On("GetStatesForChain", ctx, chainID)} +} + +func (_c *Eth_GetStatesForChain_Call) Run(run func(ctx context.Context, chainID *big.Int)) *Eth_GetStatesForChain_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*big.Int)) + }) + return _c +} + +func (_c *Eth_GetStatesForChain_Call) Return(_a0 []ethkey.State, _a1 error) *Eth_GetStatesForChain_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Eth_GetStatesForChain_Call) RunAndReturn(run func(context.Context, *big.Int) ([]ethkey.State, error)) *Eth_GetStatesForChain_Call { + _c.Call.Return(run) + return _c +} + // GetStatesForKeys provides a mock function with given fields: ctx, keys func (_m *Eth) GetStatesForKeys(ctx context.Context, keys []ethkey.KeyV2) ([]ethkey.State, error) { ret := _m.Called(ctx, keys) @@ -481,6 +980,35 @@ func (_m *Eth) GetStatesForKeys(ctx context.Context, keys []ethkey.KeyV2) ([]eth return r0, r1 } +// Eth_GetStatesForKeys_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetStatesForKeys' +type Eth_GetStatesForKeys_Call struct { + *mock.Call +} + +// GetStatesForKeys is a helper method to define mock.On call +// - ctx context.Context +// - keys []ethkey.KeyV2 +func (_e *Eth_Expecter) GetStatesForKeys(ctx interface{}, keys interface{}) *Eth_GetStatesForKeys_Call { + return &Eth_GetStatesForKeys_Call{Call: _e.mock.On("GetStatesForKeys", ctx, keys)} +} + +func (_c *Eth_GetStatesForKeys_Call) Run(run func(ctx context.Context, keys []ethkey.KeyV2)) *Eth_GetStatesForKeys_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].([]ethkey.KeyV2)) + }) + return _c +} + +func (_c *Eth_GetStatesForKeys_Call) Return(_a0 []ethkey.State, _a1 error) *Eth_GetStatesForKeys_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Eth_GetStatesForKeys_Call) RunAndReturn(run func(context.Context, []ethkey.KeyV2) ([]ethkey.State, error)) *Eth_GetStatesForKeys_Call { + _c.Call.Return(run) + return _c +} + // Import provides a mock function with given fields: ctx, keyJSON, password, chainIDs func (_m *Eth) Import(ctx context.Context, keyJSON []byte, password string, chainIDs ...*big.Int) (ethkey.KeyV2, error) { _va := make([]interface{}, len(chainIDs)) @@ -516,6 +1044,44 @@ func (_m *Eth) Import(ctx context.Context, keyJSON []byte, password string, chai return r0, r1 } +// Eth_Import_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Import' +type Eth_Import_Call struct { + *mock.Call +} + +// Import is a helper method to define mock.On call +// - ctx context.Context +// - keyJSON []byte +// - password string +// - chainIDs ...*big.Int +func (_e *Eth_Expecter) Import(ctx interface{}, keyJSON interface{}, password interface{}, chainIDs ...interface{}) *Eth_Import_Call { + return &Eth_Import_Call{Call: _e.mock.On("Import", + append([]interface{}{ctx, keyJSON, password}, chainIDs...)...)} +} + +func (_c *Eth_Import_Call) Run(run func(ctx context.Context, keyJSON []byte, password string, chainIDs ...*big.Int)) *Eth_Import_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]*big.Int, len(args)-3) + for i, a := range args[3:] { + if a != nil { + variadicArgs[i] = a.(*big.Int) + } + } + run(args[0].(context.Context), args[1].([]byte), args[2].(string), variadicArgs...) + }) + return _c +} + +func (_c *Eth_Import_Call) Return(_a0 ethkey.KeyV2, _a1 error) *Eth_Import_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Eth_Import_Call) RunAndReturn(run func(context.Context, []byte, string, ...*big.Int) (ethkey.KeyV2, error)) *Eth_Import_Call { + _c.Call.Return(run) + return _c +} + // SignTx provides a mock function with given fields: ctx, fromAddress, tx, chainID func (_m *Eth) SignTx(ctx context.Context, fromAddress common.Address, tx *types.Transaction, chainID *big.Int) (*types.Transaction, error) { ret := _m.Called(ctx, fromAddress, tx, chainID) @@ -546,6 +1112,37 @@ func (_m *Eth) SignTx(ctx context.Context, fromAddress common.Address, tx *types return r0, r1 } +// Eth_SignTx_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SignTx' +type Eth_SignTx_Call struct { + *mock.Call +} + +// SignTx is a helper method to define mock.On call +// - ctx context.Context +// - fromAddress common.Address +// - tx *types.Transaction +// - chainID *big.Int +func (_e *Eth_Expecter) SignTx(ctx interface{}, fromAddress interface{}, tx interface{}, chainID interface{}) *Eth_SignTx_Call { + return &Eth_SignTx_Call{Call: _e.mock.On("SignTx", ctx, fromAddress, tx, chainID)} +} + +func (_c *Eth_SignTx_Call) Run(run func(ctx context.Context, fromAddress common.Address, tx *types.Transaction, chainID *big.Int)) *Eth_SignTx_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(common.Address), args[2].(*types.Transaction), args[3].(*big.Int)) + }) + return _c +} + +func (_c *Eth_SignTx_Call) Return(_a0 *types.Transaction, _a1 error) *Eth_SignTx_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Eth_SignTx_Call) RunAndReturn(run func(context.Context, common.Address, *types.Transaction, *big.Int) (*types.Transaction, error)) *Eth_SignTx_Call { + _c.Call.Return(run) + return _c +} + // SubscribeToKeyChanges provides a mock function with given fields: ctx func (_m *Eth) SubscribeToKeyChanges(ctx context.Context) (chan struct{}, func()) { ret := _m.Called(ctx) @@ -578,16 +1175,102 @@ func (_m *Eth) SubscribeToKeyChanges(ctx context.Context) (chan struct{}, func() return r0, r1 } +// Eth_SubscribeToKeyChanges_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SubscribeToKeyChanges' +type Eth_SubscribeToKeyChanges_Call struct { + *mock.Call +} + +// SubscribeToKeyChanges is a helper method to define mock.On call +// - ctx context.Context +func (_e *Eth_Expecter) SubscribeToKeyChanges(ctx interface{}) *Eth_SubscribeToKeyChanges_Call { + return &Eth_SubscribeToKeyChanges_Call{Call: _e.mock.On("SubscribeToKeyChanges", ctx)} +} + +func (_c *Eth_SubscribeToKeyChanges_Call) Run(run func(ctx context.Context)) *Eth_SubscribeToKeyChanges_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *Eth_SubscribeToKeyChanges_Call) Return(ch chan struct{}, unsub func()) *Eth_SubscribeToKeyChanges_Call { + _c.Call.Return(ch, unsub) + return _c +} + +func (_c *Eth_SubscribeToKeyChanges_Call) RunAndReturn(run func(context.Context) (chan struct{}, func())) *Eth_SubscribeToKeyChanges_Call { + _c.Call.Return(run) + return _c +} + // XXXTestingOnlyAdd provides a mock function with given fields: ctx, key func (_m *Eth) XXXTestingOnlyAdd(ctx context.Context, key ethkey.KeyV2) { _m.Called(ctx, key) } +// Eth_XXXTestingOnlyAdd_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'XXXTestingOnlyAdd' +type Eth_XXXTestingOnlyAdd_Call struct { + *mock.Call +} + +// XXXTestingOnlyAdd is a helper method to define mock.On call +// - ctx context.Context +// - key ethkey.KeyV2 +func (_e *Eth_Expecter) XXXTestingOnlyAdd(ctx interface{}, key interface{}) *Eth_XXXTestingOnlyAdd_Call { + return &Eth_XXXTestingOnlyAdd_Call{Call: _e.mock.On("XXXTestingOnlyAdd", ctx, key)} +} + +func (_c *Eth_XXXTestingOnlyAdd_Call) Run(run func(ctx context.Context, key ethkey.KeyV2)) *Eth_XXXTestingOnlyAdd_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(ethkey.KeyV2)) + }) + return _c +} + +func (_c *Eth_XXXTestingOnlyAdd_Call) Return() *Eth_XXXTestingOnlyAdd_Call { + _c.Call.Return() + return _c +} + +func (_c *Eth_XXXTestingOnlyAdd_Call) RunAndReturn(run func(context.Context, ethkey.KeyV2)) *Eth_XXXTestingOnlyAdd_Call { + _c.Call.Return(run) + return _c +} + // XXXTestingOnlySetState provides a mock function with given fields: ctx, keyState func (_m *Eth) XXXTestingOnlySetState(ctx context.Context, keyState ethkey.State) { _m.Called(ctx, keyState) } +// Eth_XXXTestingOnlySetState_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'XXXTestingOnlySetState' +type Eth_XXXTestingOnlySetState_Call struct { + *mock.Call +} + +// XXXTestingOnlySetState is a helper method to define mock.On call +// - ctx context.Context +// - keyState ethkey.State +func (_e *Eth_Expecter) XXXTestingOnlySetState(ctx interface{}, keyState interface{}) *Eth_XXXTestingOnlySetState_Call { + return &Eth_XXXTestingOnlySetState_Call{Call: _e.mock.On("XXXTestingOnlySetState", ctx, keyState)} +} + +func (_c *Eth_XXXTestingOnlySetState_Call) Run(run func(ctx context.Context, keyState ethkey.State)) *Eth_XXXTestingOnlySetState_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(ethkey.State)) + }) + return _c +} + +func (_c *Eth_XXXTestingOnlySetState_Call) Return() *Eth_XXXTestingOnlySetState_Call { + _c.Call.Return() + return _c +} + +func (_c *Eth_XXXTestingOnlySetState_Call) RunAndReturn(run func(context.Context, ethkey.State)) *Eth_XXXTestingOnlySetState_Call { + _c.Call.Return(run) + return _c +} + // NewEth creates a new instance of Eth. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewEth(t interface { diff --git a/core/services/keystore/mocks/master.go b/core/services/keystore/mocks/master.go index d6c089f2a8a..c027a9c2105 100644 --- a/core/services/keystore/mocks/master.go +++ b/core/services/keystore/mocks/master.go @@ -14,6 +14,14 @@ type Master struct { mock.Mock } +type Master_Expecter struct { + mock *mock.Mock +} + +func (_m *Master) EXPECT() *Master_Expecter { + return &Master_Expecter{mock: &_m.Mock} +} + // Aptos provides a mock function with given fields: func (_m *Master) Aptos() keystore.Aptos { ret := _m.Called() @@ -34,6 +42,33 @@ func (_m *Master) Aptos() keystore.Aptos { return r0 } +// Master_Aptos_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Aptos' +type Master_Aptos_Call struct { + *mock.Call +} + +// Aptos is a helper method to define mock.On call +func (_e *Master_Expecter) Aptos() *Master_Aptos_Call { + return &Master_Aptos_Call{Call: _e.mock.On("Aptos")} +} + +func (_c *Master_Aptos_Call) Run(run func()) *Master_Aptos_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Master_Aptos_Call) Return(_a0 keystore.Aptos) *Master_Aptos_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Master_Aptos_Call) RunAndReturn(run func() keystore.Aptos) *Master_Aptos_Call { + _c.Call.Return(run) + return _c +} + // CSA provides a mock function with given fields: func (_m *Master) CSA() keystore.CSA { ret := _m.Called() @@ -54,6 +89,33 @@ func (_m *Master) CSA() keystore.CSA { return r0 } +// Master_CSA_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CSA' +type Master_CSA_Call struct { + *mock.Call +} + +// CSA is a helper method to define mock.On call +func (_e *Master_Expecter) CSA() *Master_CSA_Call { + return &Master_CSA_Call{Call: _e.mock.On("CSA")} +} + +func (_c *Master_CSA_Call) Run(run func()) *Master_CSA_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Master_CSA_Call) Return(_a0 keystore.CSA) *Master_CSA_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Master_CSA_Call) RunAndReturn(run func() keystore.CSA) *Master_CSA_Call { + _c.Call.Return(run) + return _c +} + // Cosmos provides a mock function with given fields: func (_m *Master) Cosmos() keystore.Cosmos { ret := _m.Called() @@ -74,6 +136,33 @@ func (_m *Master) Cosmos() keystore.Cosmos { return r0 } +// Master_Cosmos_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Cosmos' +type Master_Cosmos_Call struct { + *mock.Call +} + +// Cosmos is a helper method to define mock.On call +func (_e *Master_Expecter) Cosmos() *Master_Cosmos_Call { + return &Master_Cosmos_Call{Call: _e.mock.On("Cosmos")} +} + +func (_c *Master_Cosmos_Call) Run(run func()) *Master_Cosmos_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Master_Cosmos_Call) Return(_a0 keystore.Cosmos) *Master_Cosmos_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Master_Cosmos_Call) RunAndReturn(run func() keystore.Cosmos) *Master_Cosmos_Call { + _c.Call.Return(run) + return _c +} + // Eth provides a mock function with given fields: func (_m *Master) Eth() keystore.Eth { ret := _m.Called() @@ -94,6 +183,33 @@ func (_m *Master) Eth() keystore.Eth { return r0 } +// Master_Eth_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Eth' +type Master_Eth_Call struct { + *mock.Call +} + +// Eth is a helper method to define mock.On call +func (_e *Master_Expecter) Eth() *Master_Eth_Call { + return &Master_Eth_Call{Call: _e.mock.On("Eth")} +} + +func (_c *Master_Eth_Call) Run(run func()) *Master_Eth_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Master_Eth_Call) Return(_a0 keystore.Eth) *Master_Eth_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Master_Eth_Call) RunAndReturn(run func() keystore.Eth) *Master_Eth_Call { + _c.Call.Return(run) + return _c +} + // IsEmpty provides a mock function with given fields: ctx func (_m *Master) IsEmpty(ctx context.Context) (bool, error) { ret := _m.Called(ctx) @@ -122,6 +238,34 @@ func (_m *Master) IsEmpty(ctx context.Context) (bool, error) { return r0, r1 } +// Master_IsEmpty_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsEmpty' +type Master_IsEmpty_Call struct { + *mock.Call +} + +// IsEmpty is a helper method to define mock.On call +// - ctx context.Context +func (_e *Master_Expecter) IsEmpty(ctx interface{}) *Master_IsEmpty_Call { + return &Master_IsEmpty_Call{Call: _e.mock.On("IsEmpty", ctx)} +} + +func (_c *Master_IsEmpty_Call) Run(run func(ctx context.Context)) *Master_IsEmpty_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *Master_IsEmpty_Call) Return(_a0 bool, _a1 error) *Master_IsEmpty_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Master_IsEmpty_Call) RunAndReturn(run func(context.Context) (bool, error)) *Master_IsEmpty_Call { + _c.Call.Return(run) + return _c +} + // OCR provides a mock function with given fields: func (_m *Master) OCR() keystore.OCR { ret := _m.Called() @@ -142,6 +286,33 @@ func (_m *Master) OCR() keystore.OCR { return r0 } +// Master_OCR_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OCR' +type Master_OCR_Call struct { + *mock.Call +} + +// OCR is a helper method to define mock.On call +func (_e *Master_Expecter) OCR() *Master_OCR_Call { + return &Master_OCR_Call{Call: _e.mock.On("OCR")} +} + +func (_c *Master_OCR_Call) Run(run func()) *Master_OCR_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Master_OCR_Call) Return(_a0 keystore.OCR) *Master_OCR_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Master_OCR_Call) RunAndReturn(run func() keystore.OCR) *Master_OCR_Call { + _c.Call.Return(run) + return _c +} + // OCR2 provides a mock function with given fields: func (_m *Master) OCR2() keystore.OCR2 { ret := _m.Called() @@ -162,6 +333,33 @@ func (_m *Master) OCR2() keystore.OCR2 { return r0 } +// Master_OCR2_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OCR2' +type Master_OCR2_Call struct { + *mock.Call +} + +// OCR2 is a helper method to define mock.On call +func (_e *Master_Expecter) OCR2() *Master_OCR2_Call { + return &Master_OCR2_Call{Call: _e.mock.On("OCR2")} +} + +func (_c *Master_OCR2_Call) Run(run func()) *Master_OCR2_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Master_OCR2_Call) Return(_a0 keystore.OCR2) *Master_OCR2_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Master_OCR2_Call) RunAndReturn(run func() keystore.OCR2) *Master_OCR2_Call { + _c.Call.Return(run) + return _c +} + // P2P provides a mock function with given fields: func (_m *Master) P2P() keystore.P2P { ret := _m.Called() @@ -182,6 +380,33 @@ func (_m *Master) P2P() keystore.P2P { return r0 } +// Master_P2P_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'P2P' +type Master_P2P_Call struct { + *mock.Call +} + +// P2P is a helper method to define mock.On call +func (_e *Master_Expecter) P2P() *Master_P2P_Call { + return &Master_P2P_Call{Call: _e.mock.On("P2P")} +} + +func (_c *Master_P2P_Call) Run(run func()) *Master_P2P_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Master_P2P_Call) Return(_a0 keystore.P2P) *Master_P2P_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Master_P2P_Call) RunAndReturn(run func() keystore.P2P) *Master_P2P_Call { + _c.Call.Return(run) + return _c +} + // Solana provides a mock function with given fields: func (_m *Master) Solana() keystore.Solana { ret := _m.Called() @@ -202,6 +427,33 @@ func (_m *Master) Solana() keystore.Solana { return r0 } +// Master_Solana_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Solana' +type Master_Solana_Call struct { + *mock.Call +} + +// Solana is a helper method to define mock.On call +func (_e *Master_Expecter) Solana() *Master_Solana_Call { + return &Master_Solana_Call{Call: _e.mock.On("Solana")} +} + +func (_c *Master_Solana_Call) Run(run func()) *Master_Solana_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Master_Solana_Call) Return(_a0 keystore.Solana) *Master_Solana_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Master_Solana_Call) RunAndReturn(run func() keystore.Solana) *Master_Solana_Call { + _c.Call.Return(run) + return _c +} + // StarkNet provides a mock function with given fields: func (_m *Master) StarkNet() keystore.StarkNet { ret := _m.Called() @@ -222,6 +474,33 @@ func (_m *Master) StarkNet() keystore.StarkNet { return r0 } +// Master_StarkNet_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StarkNet' +type Master_StarkNet_Call struct { + *mock.Call +} + +// StarkNet is a helper method to define mock.On call +func (_e *Master_Expecter) StarkNet() *Master_StarkNet_Call { + return &Master_StarkNet_Call{Call: _e.mock.On("StarkNet")} +} + +func (_c *Master_StarkNet_Call) Run(run func()) *Master_StarkNet_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Master_StarkNet_Call) Return(_a0 keystore.StarkNet) *Master_StarkNet_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Master_StarkNet_Call) RunAndReturn(run func() keystore.StarkNet) *Master_StarkNet_Call { + _c.Call.Return(run) + return _c +} + // Unlock provides a mock function with given fields: ctx, password func (_m *Master) Unlock(ctx context.Context, password string) error { ret := _m.Called(ctx, password) @@ -240,6 +519,35 @@ func (_m *Master) Unlock(ctx context.Context, password string) error { return r0 } +// Master_Unlock_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Unlock' +type Master_Unlock_Call struct { + *mock.Call +} + +// Unlock is a helper method to define mock.On call +// - ctx context.Context +// - password string +func (_e *Master_Expecter) Unlock(ctx interface{}, password interface{}) *Master_Unlock_Call { + return &Master_Unlock_Call{Call: _e.mock.On("Unlock", ctx, password)} +} + +func (_c *Master_Unlock_Call) Run(run func(ctx context.Context, password string)) *Master_Unlock_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *Master_Unlock_Call) Return(_a0 error) *Master_Unlock_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Master_Unlock_Call) RunAndReturn(run func(context.Context, string) error) *Master_Unlock_Call { + _c.Call.Return(run) + return _c +} + // VRF provides a mock function with given fields: func (_m *Master) VRF() keystore.VRF { ret := _m.Called() @@ -260,6 +568,33 @@ func (_m *Master) VRF() keystore.VRF { return r0 } +// Master_VRF_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'VRF' +type Master_VRF_Call struct { + *mock.Call +} + +// VRF is a helper method to define mock.On call +func (_e *Master_Expecter) VRF() *Master_VRF_Call { + return &Master_VRF_Call{Call: _e.mock.On("VRF")} +} + +func (_c *Master_VRF_Call) Run(run func()) *Master_VRF_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Master_VRF_Call) Return(_a0 keystore.VRF) *Master_VRF_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Master_VRF_Call) RunAndReturn(run func() keystore.VRF) *Master_VRF_Call { + _c.Call.Return(run) + return _c +} + // NewMaster creates a new instance of Master. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMaster(t interface { diff --git a/core/services/keystore/mocks/ocr.go b/core/services/keystore/mocks/ocr.go index 7582295ee15..255167dff66 100644 --- a/core/services/keystore/mocks/ocr.go +++ b/core/services/keystore/mocks/ocr.go @@ -15,6 +15,14 @@ type OCR struct { mock.Mock } +type OCR_Expecter struct { + mock *mock.Mock +} + +func (_m *OCR) EXPECT() *OCR_Expecter { + return &OCR_Expecter{mock: &_m.Mock} +} + // Add provides a mock function with given fields: ctx, key func (_m *OCR) Add(ctx context.Context, key ocrkey.KeyV2) error { ret := _m.Called(ctx, key) @@ -33,6 +41,35 @@ func (_m *OCR) Add(ctx context.Context, key ocrkey.KeyV2) error { return r0 } +// OCR_Add_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Add' +type OCR_Add_Call struct { + *mock.Call +} + +// Add is a helper method to define mock.On call +// - ctx context.Context +// - key ocrkey.KeyV2 +func (_e *OCR_Expecter) Add(ctx interface{}, key interface{}) *OCR_Add_Call { + return &OCR_Add_Call{Call: _e.mock.On("Add", ctx, key)} +} + +func (_c *OCR_Add_Call) Run(run func(ctx context.Context, key ocrkey.KeyV2)) *OCR_Add_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(ocrkey.KeyV2)) + }) + return _c +} + +func (_c *OCR_Add_Call) Return(_a0 error) *OCR_Add_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *OCR_Add_Call) RunAndReturn(run func(context.Context, ocrkey.KeyV2) error) *OCR_Add_Call { + _c.Call.Return(run) + return _c +} + // Create provides a mock function with given fields: ctx func (_m *OCR) Create(ctx context.Context) (ocrkey.KeyV2, error) { ret := _m.Called(ctx) @@ -61,6 +98,34 @@ func (_m *OCR) Create(ctx context.Context) (ocrkey.KeyV2, error) { return r0, r1 } +// OCR_Create_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Create' +type OCR_Create_Call struct { + *mock.Call +} + +// Create is a helper method to define mock.On call +// - ctx context.Context +func (_e *OCR_Expecter) Create(ctx interface{}) *OCR_Create_Call { + return &OCR_Create_Call{Call: _e.mock.On("Create", ctx)} +} + +func (_c *OCR_Create_Call) Run(run func(ctx context.Context)) *OCR_Create_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *OCR_Create_Call) Return(_a0 ocrkey.KeyV2, _a1 error) *OCR_Create_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *OCR_Create_Call) RunAndReturn(run func(context.Context) (ocrkey.KeyV2, error)) *OCR_Create_Call { + _c.Call.Return(run) + return _c +} + // Delete provides a mock function with given fields: ctx, id func (_m *OCR) Delete(ctx context.Context, id string) (ocrkey.KeyV2, error) { ret := _m.Called(ctx, id) @@ -89,6 +154,35 @@ func (_m *OCR) Delete(ctx context.Context, id string) (ocrkey.KeyV2, error) { return r0, r1 } +// OCR_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete' +type OCR_Delete_Call struct { + *mock.Call +} + +// Delete is a helper method to define mock.On call +// - ctx context.Context +// - id string +func (_e *OCR_Expecter) Delete(ctx interface{}, id interface{}) *OCR_Delete_Call { + return &OCR_Delete_Call{Call: _e.mock.On("Delete", ctx, id)} +} + +func (_c *OCR_Delete_Call) Run(run func(ctx context.Context, id string)) *OCR_Delete_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *OCR_Delete_Call) Return(_a0 ocrkey.KeyV2, _a1 error) *OCR_Delete_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *OCR_Delete_Call) RunAndReturn(run func(context.Context, string) (ocrkey.KeyV2, error)) *OCR_Delete_Call { + _c.Call.Return(run) + return _c +} + // EnsureKey provides a mock function with given fields: ctx func (_m *OCR) EnsureKey(ctx context.Context) error { ret := _m.Called(ctx) @@ -107,6 +201,34 @@ func (_m *OCR) EnsureKey(ctx context.Context) error { return r0 } +// OCR_EnsureKey_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EnsureKey' +type OCR_EnsureKey_Call struct { + *mock.Call +} + +// EnsureKey is a helper method to define mock.On call +// - ctx context.Context +func (_e *OCR_Expecter) EnsureKey(ctx interface{}) *OCR_EnsureKey_Call { + return &OCR_EnsureKey_Call{Call: _e.mock.On("EnsureKey", ctx)} +} + +func (_c *OCR_EnsureKey_Call) Run(run func(ctx context.Context)) *OCR_EnsureKey_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *OCR_EnsureKey_Call) Return(_a0 error) *OCR_EnsureKey_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *OCR_EnsureKey_Call) RunAndReturn(run func(context.Context) error) *OCR_EnsureKey_Call { + _c.Call.Return(run) + return _c +} + // Export provides a mock function with given fields: id, password func (_m *OCR) Export(id string, password string) ([]byte, error) { ret := _m.Called(id, password) @@ -137,6 +259,35 @@ func (_m *OCR) Export(id string, password string) ([]byte, error) { return r0, r1 } +// OCR_Export_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Export' +type OCR_Export_Call struct { + *mock.Call +} + +// Export is a helper method to define mock.On call +// - id string +// - password string +func (_e *OCR_Expecter) Export(id interface{}, password interface{}) *OCR_Export_Call { + return &OCR_Export_Call{Call: _e.mock.On("Export", id, password)} +} + +func (_c *OCR_Export_Call) Run(run func(id string, password string)) *OCR_Export_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(string)) + }) + return _c +} + +func (_c *OCR_Export_Call) Return(_a0 []byte, _a1 error) *OCR_Export_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *OCR_Export_Call) RunAndReturn(run func(string, string) ([]byte, error)) *OCR_Export_Call { + _c.Call.Return(run) + return _c +} + // Get provides a mock function with given fields: id func (_m *OCR) Get(id string) (ocrkey.KeyV2, error) { ret := _m.Called(id) @@ -165,6 +316,34 @@ func (_m *OCR) Get(id string) (ocrkey.KeyV2, error) { return r0, r1 } +// OCR_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' +type OCR_Get_Call struct { + *mock.Call +} + +// Get is a helper method to define mock.On call +// - id string +func (_e *OCR_Expecter) Get(id interface{}) *OCR_Get_Call { + return &OCR_Get_Call{Call: _e.mock.On("Get", id)} +} + +func (_c *OCR_Get_Call) Run(run func(id string)) *OCR_Get_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *OCR_Get_Call) Return(_a0 ocrkey.KeyV2, _a1 error) *OCR_Get_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *OCR_Get_Call) RunAndReturn(run func(string) (ocrkey.KeyV2, error)) *OCR_Get_Call { + _c.Call.Return(run) + return _c +} + // GetAll provides a mock function with given fields: func (_m *OCR) GetAll() ([]ocrkey.KeyV2, error) { ret := _m.Called() @@ -195,6 +374,33 @@ func (_m *OCR) GetAll() ([]ocrkey.KeyV2, error) { return r0, r1 } +// OCR_GetAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAll' +type OCR_GetAll_Call struct { + *mock.Call +} + +// GetAll is a helper method to define mock.On call +func (_e *OCR_Expecter) GetAll() *OCR_GetAll_Call { + return &OCR_GetAll_Call{Call: _e.mock.On("GetAll")} +} + +func (_c *OCR_GetAll_Call) Run(run func()) *OCR_GetAll_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *OCR_GetAll_Call) Return(_a0 []ocrkey.KeyV2, _a1 error) *OCR_GetAll_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *OCR_GetAll_Call) RunAndReturn(run func() ([]ocrkey.KeyV2, error)) *OCR_GetAll_Call { + _c.Call.Return(run) + return _c +} + // Import provides a mock function with given fields: ctx, keyJSON, password func (_m *OCR) Import(ctx context.Context, keyJSON []byte, password string) (ocrkey.KeyV2, error) { ret := _m.Called(ctx, keyJSON, password) @@ -223,6 +429,36 @@ func (_m *OCR) Import(ctx context.Context, keyJSON []byte, password string) (ocr return r0, r1 } +// OCR_Import_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Import' +type OCR_Import_Call struct { + *mock.Call +} + +// Import is a helper method to define mock.On call +// - ctx context.Context +// - keyJSON []byte +// - password string +func (_e *OCR_Expecter) Import(ctx interface{}, keyJSON interface{}, password interface{}) *OCR_Import_Call { + return &OCR_Import_Call{Call: _e.mock.On("Import", ctx, keyJSON, password)} +} + +func (_c *OCR_Import_Call) Run(run func(ctx context.Context, keyJSON []byte, password string)) *OCR_Import_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].([]byte), args[2].(string)) + }) + return _c +} + +func (_c *OCR_Import_Call) Return(_a0 ocrkey.KeyV2, _a1 error) *OCR_Import_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *OCR_Import_Call) RunAndReturn(run func(context.Context, []byte, string) (ocrkey.KeyV2, error)) *OCR_Import_Call { + _c.Call.Return(run) + return _c +} + // NewOCR creates a new instance of OCR. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewOCR(t interface { diff --git a/core/services/keystore/mocks/ocr2.go b/core/services/keystore/mocks/ocr2.go index 0771f460db5..d1312a7a5e1 100644 --- a/core/services/keystore/mocks/ocr2.go +++ b/core/services/keystore/mocks/ocr2.go @@ -17,6 +17,14 @@ type OCR2 struct { mock.Mock } +type OCR2_Expecter struct { + mock *mock.Mock +} + +func (_m *OCR2) EXPECT() *OCR2_Expecter { + return &OCR2_Expecter{mock: &_m.Mock} +} + // Add provides a mock function with given fields: ctx, key func (_m *OCR2) Add(ctx context.Context, key ocr2key.KeyBundle) error { ret := _m.Called(ctx, key) @@ -35,6 +43,35 @@ func (_m *OCR2) Add(ctx context.Context, key ocr2key.KeyBundle) error { return r0 } +// OCR2_Add_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Add' +type OCR2_Add_Call struct { + *mock.Call +} + +// Add is a helper method to define mock.On call +// - ctx context.Context +// - key ocr2key.KeyBundle +func (_e *OCR2_Expecter) Add(ctx interface{}, key interface{}) *OCR2_Add_Call { + return &OCR2_Add_Call{Call: _e.mock.On("Add", ctx, key)} +} + +func (_c *OCR2_Add_Call) Run(run func(ctx context.Context, key ocr2key.KeyBundle)) *OCR2_Add_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(ocr2key.KeyBundle)) + }) + return _c +} + +func (_c *OCR2_Add_Call) Return(_a0 error) *OCR2_Add_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *OCR2_Add_Call) RunAndReturn(run func(context.Context, ocr2key.KeyBundle) error) *OCR2_Add_Call { + _c.Call.Return(run) + return _c +} + // Create provides a mock function with given fields: _a0, _a1 func (_m *OCR2) Create(_a0 context.Context, _a1 chaintype.ChainType) (ocr2key.KeyBundle, error) { ret := _m.Called(_a0, _a1) @@ -65,6 +102,35 @@ func (_m *OCR2) Create(_a0 context.Context, _a1 chaintype.ChainType) (ocr2key.Ke return r0, r1 } +// OCR2_Create_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Create' +type OCR2_Create_Call struct { + *mock.Call +} + +// Create is a helper method to define mock.On call +// - _a0 context.Context +// - _a1 chaintype.ChainType +func (_e *OCR2_Expecter) Create(_a0 interface{}, _a1 interface{}) *OCR2_Create_Call { + return &OCR2_Create_Call{Call: _e.mock.On("Create", _a0, _a1)} +} + +func (_c *OCR2_Create_Call) Run(run func(_a0 context.Context, _a1 chaintype.ChainType)) *OCR2_Create_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(chaintype.ChainType)) + }) + return _c +} + +func (_c *OCR2_Create_Call) Return(_a0 ocr2key.KeyBundle, _a1 error) *OCR2_Create_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *OCR2_Create_Call) RunAndReturn(run func(context.Context, chaintype.ChainType) (ocr2key.KeyBundle, error)) *OCR2_Create_Call { + _c.Call.Return(run) + return _c +} + // Delete provides a mock function with given fields: ctx, id func (_m *OCR2) Delete(ctx context.Context, id string) error { ret := _m.Called(ctx, id) @@ -83,6 +149,35 @@ func (_m *OCR2) Delete(ctx context.Context, id string) error { return r0 } +// OCR2_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete' +type OCR2_Delete_Call struct { + *mock.Call +} + +// Delete is a helper method to define mock.On call +// - ctx context.Context +// - id string +func (_e *OCR2_Expecter) Delete(ctx interface{}, id interface{}) *OCR2_Delete_Call { + return &OCR2_Delete_Call{Call: _e.mock.On("Delete", ctx, id)} +} + +func (_c *OCR2_Delete_Call) Run(run func(ctx context.Context, id string)) *OCR2_Delete_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *OCR2_Delete_Call) Return(_a0 error) *OCR2_Delete_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *OCR2_Delete_Call) RunAndReturn(run func(context.Context, string) error) *OCR2_Delete_Call { + _c.Call.Return(run) + return _c +} + // EnsureKeys provides a mock function with given fields: ctx, enabledChains func (_m *OCR2) EnsureKeys(ctx context.Context, enabledChains ...chaintype.ChainType) error { _va := make([]interface{}, len(enabledChains)) @@ -108,6 +203,42 @@ func (_m *OCR2) EnsureKeys(ctx context.Context, enabledChains ...chaintype.Chain return r0 } +// OCR2_EnsureKeys_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EnsureKeys' +type OCR2_EnsureKeys_Call struct { + *mock.Call +} + +// EnsureKeys is a helper method to define mock.On call +// - ctx context.Context +// - enabledChains ...chaintype.ChainType +func (_e *OCR2_Expecter) EnsureKeys(ctx interface{}, enabledChains ...interface{}) *OCR2_EnsureKeys_Call { + return &OCR2_EnsureKeys_Call{Call: _e.mock.On("EnsureKeys", + append([]interface{}{ctx}, enabledChains...)...)} +} + +func (_c *OCR2_EnsureKeys_Call) Run(run func(ctx context.Context, enabledChains ...chaintype.ChainType)) *OCR2_EnsureKeys_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]chaintype.ChainType, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(chaintype.ChainType) + } + } + run(args[0].(context.Context), variadicArgs...) + }) + return _c +} + +func (_c *OCR2_EnsureKeys_Call) Return(_a0 error) *OCR2_EnsureKeys_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *OCR2_EnsureKeys_Call) RunAndReturn(run func(context.Context, ...chaintype.ChainType) error) *OCR2_EnsureKeys_Call { + _c.Call.Return(run) + return _c +} + // Export provides a mock function with given fields: id, password func (_m *OCR2) Export(id string, password string) ([]byte, error) { ret := _m.Called(id, password) @@ -138,6 +269,35 @@ func (_m *OCR2) Export(id string, password string) ([]byte, error) { return r0, r1 } +// OCR2_Export_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Export' +type OCR2_Export_Call struct { + *mock.Call +} + +// Export is a helper method to define mock.On call +// - id string +// - password string +func (_e *OCR2_Expecter) Export(id interface{}, password interface{}) *OCR2_Export_Call { + return &OCR2_Export_Call{Call: _e.mock.On("Export", id, password)} +} + +func (_c *OCR2_Export_Call) Run(run func(id string, password string)) *OCR2_Export_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(string)) + }) + return _c +} + +func (_c *OCR2_Export_Call) Return(_a0 []byte, _a1 error) *OCR2_Export_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *OCR2_Export_Call) RunAndReturn(run func(string, string) ([]byte, error)) *OCR2_Export_Call { + _c.Call.Return(run) + return _c +} + // Get provides a mock function with given fields: id func (_m *OCR2) Get(id string) (ocr2key.KeyBundle, error) { ret := _m.Called(id) @@ -168,6 +328,34 @@ func (_m *OCR2) Get(id string) (ocr2key.KeyBundle, error) { return r0, r1 } +// OCR2_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' +type OCR2_Get_Call struct { + *mock.Call +} + +// Get is a helper method to define mock.On call +// - id string +func (_e *OCR2_Expecter) Get(id interface{}) *OCR2_Get_Call { + return &OCR2_Get_Call{Call: _e.mock.On("Get", id)} +} + +func (_c *OCR2_Get_Call) Run(run func(id string)) *OCR2_Get_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *OCR2_Get_Call) Return(_a0 ocr2key.KeyBundle, _a1 error) *OCR2_Get_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *OCR2_Get_Call) RunAndReturn(run func(string) (ocr2key.KeyBundle, error)) *OCR2_Get_Call { + _c.Call.Return(run) + return _c +} + // GetAll provides a mock function with given fields: func (_m *OCR2) GetAll() ([]ocr2key.KeyBundle, error) { ret := _m.Called() @@ -198,6 +386,33 @@ func (_m *OCR2) GetAll() ([]ocr2key.KeyBundle, error) { return r0, r1 } +// OCR2_GetAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAll' +type OCR2_GetAll_Call struct { + *mock.Call +} + +// GetAll is a helper method to define mock.On call +func (_e *OCR2_Expecter) GetAll() *OCR2_GetAll_Call { + return &OCR2_GetAll_Call{Call: _e.mock.On("GetAll")} +} + +func (_c *OCR2_GetAll_Call) Run(run func()) *OCR2_GetAll_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *OCR2_GetAll_Call) Return(_a0 []ocr2key.KeyBundle, _a1 error) *OCR2_GetAll_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *OCR2_GetAll_Call) RunAndReturn(run func() ([]ocr2key.KeyBundle, error)) *OCR2_GetAll_Call { + _c.Call.Return(run) + return _c +} + // GetAllOfType provides a mock function with given fields: _a0 func (_m *OCR2) GetAllOfType(_a0 chaintype.ChainType) ([]ocr2key.KeyBundle, error) { ret := _m.Called(_a0) @@ -228,6 +443,34 @@ func (_m *OCR2) GetAllOfType(_a0 chaintype.ChainType) ([]ocr2key.KeyBundle, erro return r0, r1 } +// OCR2_GetAllOfType_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAllOfType' +type OCR2_GetAllOfType_Call struct { + *mock.Call +} + +// GetAllOfType is a helper method to define mock.On call +// - _a0 chaintype.ChainType +func (_e *OCR2_Expecter) GetAllOfType(_a0 interface{}) *OCR2_GetAllOfType_Call { + return &OCR2_GetAllOfType_Call{Call: _e.mock.On("GetAllOfType", _a0)} +} + +func (_c *OCR2_GetAllOfType_Call) Run(run func(_a0 chaintype.ChainType)) *OCR2_GetAllOfType_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(chaintype.ChainType)) + }) + return _c +} + +func (_c *OCR2_GetAllOfType_Call) Return(_a0 []ocr2key.KeyBundle, _a1 error) *OCR2_GetAllOfType_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *OCR2_GetAllOfType_Call) RunAndReturn(run func(chaintype.ChainType) ([]ocr2key.KeyBundle, error)) *OCR2_GetAllOfType_Call { + _c.Call.Return(run) + return _c +} + // Import provides a mock function with given fields: ctx, keyJSON, password func (_m *OCR2) Import(ctx context.Context, keyJSON []byte, password string) (ocr2key.KeyBundle, error) { ret := _m.Called(ctx, keyJSON, password) @@ -258,6 +501,36 @@ func (_m *OCR2) Import(ctx context.Context, keyJSON []byte, password string) (oc return r0, r1 } +// OCR2_Import_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Import' +type OCR2_Import_Call struct { + *mock.Call +} + +// Import is a helper method to define mock.On call +// - ctx context.Context +// - keyJSON []byte +// - password string +func (_e *OCR2_Expecter) Import(ctx interface{}, keyJSON interface{}, password interface{}) *OCR2_Import_Call { + return &OCR2_Import_Call{Call: _e.mock.On("Import", ctx, keyJSON, password)} +} + +func (_c *OCR2_Import_Call) Run(run func(ctx context.Context, keyJSON []byte, password string)) *OCR2_Import_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].([]byte), args[2].(string)) + }) + return _c +} + +func (_c *OCR2_Import_Call) Return(_a0 ocr2key.KeyBundle, _a1 error) *OCR2_Import_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *OCR2_Import_Call) RunAndReturn(run func(context.Context, []byte, string) (ocr2key.KeyBundle, error)) *OCR2_Import_Call { + _c.Call.Return(run) + return _c +} + // NewOCR2 creates a new instance of OCR2. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewOCR2(t interface { diff --git a/core/services/keystore/mocks/p2p.go b/core/services/keystore/mocks/p2p.go index 973fc81c950..5b9c7037938 100644 --- a/core/services/keystore/mocks/p2p.go +++ b/core/services/keystore/mocks/p2p.go @@ -15,6 +15,14 @@ type P2P struct { mock.Mock } +type P2P_Expecter struct { + mock *mock.Mock +} + +func (_m *P2P) EXPECT() *P2P_Expecter { + return &P2P_Expecter{mock: &_m.Mock} +} + // Add provides a mock function with given fields: ctx, key func (_m *P2P) Add(ctx context.Context, key p2pkey.KeyV2) error { ret := _m.Called(ctx, key) @@ -33,6 +41,35 @@ func (_m *P2P) Add(ctx context.Context, key p2pkey.KeyV2) error { return r0 } +// P2P_Add_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Add' +type P2P_Add_Call struct { + *mock.Call +} + +// Add is a helper method to define mock.On call +// - ctx context.Context +// - key p2pkey.KeyV2 +func (_e *P2P_Expecter) Add(ctx interface{}, key interface{}) *P2P_Add_Call { + return &P2P_Add_Call{Call: _e.mock.On("Add", ctx, key)} +} + +func (_c *P2P_Add_Call) Run(run func(ctx context.Context, key p2pkey.KeyV2)) *P2P_Add_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(p2pkey.KeyV2)) + }) + return _c +} + +func (_c *P2P_Add_Call) Return(_a0 error) *P2P_Add_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *P2P_Add_Call) RunAndReturn(run func(context.Context, p2pkey.KeyV2) error) *P2P_Add_Call { + _c.Call.Return(run) + return _c +} + // Create provides a mock function with given fields: ctx func (_m *P2P) Create(ctx context.Context) (p2pkey.KeyV2, error) { ret := _m.Called(ctx) @@ -61,6 +98,34 @@ func (_m *P2P) Create(ctx context.Context) (p2pkey.KeyV2, error) { return r0, r1 } +// P2P_Create_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Create' +type P2P_Create_Call struct { + *mock.Call +} + +// Create is a helper method to define mock.On call +// - ctx context.Context +func (_e *P2P_Expecter) Create(ctx interface{}) *P2P_Create_Call { + return &P2P_Create_Call{Call: _e.mock.On("Create", ctx)} +} + +func (_c *P2P_Create_Call) Run(run func(ctx context.Context)) *P2P_Create_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *P2P_Create_Call) Return(_a0 p2pkey.KeyV2, _a1 error) *P2P_Create_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *P2P_Create_Call) RunAndReturn(run func(context.Context) (p2pkey.KeyV2, error)) *P2P_Create_Call { + _c.Call.Return(run) + return _c +} + // Delete provides a mock function with given fields: ctx, id func (_m *P2P) Delete(ctx context.Context, id p2pkey.PeerID) (p2pkey.KeyV2, error) { ret := _m.Called(ctx, id) @@ -89,6 +154,35 @@ func (_m *P2P) Delete(ctx context.Context, id p2pkey.PeerID) (p2pkey.KeyV2, erro return r0, r1 } +// P2P_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete' +type P2P_Delete_Call struct { + *mock.Call +} + +// Delete is a helper method to define mock.On call +// - ctx context.Context +// - id p2pkey.PeerID +func (_e *P2P_Expecter) Delete(ctx interface{}, id interface{}) *P2P_Delete_Call { + return &P2P_Delete_Call{Call: _e.mock.On("Delete", ctx, id)} +} + +func (_c *P2P_Delete_Call) Run(run func(ctx context.Context, id p2pkey.PeerID)) *P2P_Delete_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(p2pkey.PeerID)) + }) + return _c +} + +func (_c *P2P_Delete_Call) Return(_a0 p2pkey.KeyV2, _a1 error) *P2P_Delete_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *P2P_Delete_Call) RunAndReturn(run func(context.Context, p2pkey.PeerID) (p2pkey.KeyV2, error)) *P2P_Delete_Call { + _c.Call.Return(run) + return _c +} + // EnsureKey provides a mock function with given fields: ctx func (_m *P2P) EnsureKey(ctx context.Context) error { ret := _m.Called(ctx) @@ -107,6 +201,34 @@ func (_m *P2P) EnsureKey(ctx context.Context) error { return r0 } +// P2P_EnsureKey_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EnsureKey' +type P2P_EnsureKey_Call struct { + *mock.Call +} + +// EnsureKey is a helper method to define mock.On call +// - ctx context.Context +func (_e *P2P_Expecter) EnsureKey(ctx interface{}) *P2P_EnsureKey_Call { + return &P2P_EnsureKey_Call{Call: _e.mock.On("EnsureKey", ctx)} +} + +func (_c *P2P_EnsureKey_Call) Run(run func(ctx context.Context)) *P2P_EnsureKey_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *P2P_EnsureKey_Call) Return(_a0 error) *P2P_EnsureKey_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *P2P_EnsureKey_Call) RunAndReturn(run func(context.Context) error) *P2P_EnsureKey_Call { + _c.Call.Return(run) + return _c +} + // Export provides a mock function with given fields: id, password func (_m *P2P) Export(id p2pkey.PeerID, password string) ([]byte, error) { ret := _m.Called(id, password) @@ -137,6 +259,35 @@ func (_m *P2P) Export(id p2pkey.PeerID, password string) ([]byte, error) { return r0, r1 } +// P2P_Export_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Export' +type P2P_Export_Call struct { + *mock.Call +} + +// Export is a helper method to define mock.On call +// - id p2pkey.PeerID +// - password string +func (_e *P2P_Expecter) Export(id interface{}, password interface{}) *P2P_Export_Call { + return &P2P_Export_Call{Call: _e.mock.On("Export", id, password)} +} + +func (_c *P2P_Export_Call) Run(run func(id p2pkey.PeerID, password string)) *P2P_Export_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(p2pkey.PeerID), args[1].(string)) + }) + return _c +} + +func (_c *P2P_Export_Call) Return(_a0 []byte, _a1 error) *P2P_Export_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *P2P_Export_Call) RunAndReturn(run func(p2pkey.PeerID, string) ([]byte, error)) *P2P_Export_Call { + _c.Call.Return(run) + return _c +} + // Get provides a mock function with given fields: id func (_m *P2P) Get(id p2pkey.PeerID) (p2pkey.KeyV2, error) { ret := _m.Called(id) @@ -165,6 +316,34 @@ func (_m *P2P) Get(id p2pkey.PeerID) (p2pkey.KeyV2, error) { return r0, r1 } +// P2P_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' +type P2P_Get_Call struct { + *mock.Call +} + +// Get is a helper method to define mock.On call +// - id p2pkey.PeerID +func (_e *P2P_Expecter) Get(id interface{}) *P2P_Get_Call { + return &P2P_Get_Call{Call: _e.mock.On("Get", id)} +} + +func (_c *P2P_Get_Call) Run(run func(id p2pkey.PeerID)) *P2P_Get_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(p2pkey.PeerID)) + }) + return _c +} + +func (_c *P2P_Get_Call) Return(_a0 p2pkey.KeyV2, _a1 error) *P2P_Get_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *P2P_Get_Call) RunAndReturn(run func(p2pkey.PeerID) (p2pkey.KeyV2, error)) *P2P_Get_Call { + _c.Call.Return(run) + return _c +} + // GetAll provides a mock function with given fields: func (_m *P2P) GetAll() ([]p2pkey.KeyV2, error) { ret := _m.Called() @@ -195,6 +374,33 @@ func (_m *P2P) GetAll() ([]p2pkey.KeyV2, error) { return r0, r1 } +// P2P_GetAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAll' +type P2P_GetAll_Call struct { + *mock.Call +} + +// GetAll is a helper method to define mock.On call +func (_e *P2P_Expecter) GetAll() *P2P_GetAll_Call { + return &P2P_GetAll_Call{Call: _e.mock.On("GetAll")} +} + +func (_c *P2P_GetAll_Call) Run(run func()) *P2P_GetAll_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *P2P_GetAll_Call) Return(_a0 []p2pkey.KeyV2, _a1 error) *P2P_GetAll_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *P2P_GetAll_Call) RunAndReturn(run func() ([]p2pkey.KeyV2, error)) *P2P_GetAll_Call { + _c.Call.Return(run) + return _c +} + // GetOrFirst provides a mock function with given fields: id func (_m *P2P) GetOrFirst(id p2pkey.PeerID) (p2pkey.KeyV2, error) { ret := _m.Called(id) @@ -223,6 +429,34 @@ func (_m *P2P) GetOrFirst(id p2pkey.PeerID) (p2pkey.KeyV2, error) { return r0, r1 } +// P2P_GetOrFirst_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetOrFirst' +type P2P_GetOrFirst_Call struct { + *mock.Call +} + +// GetOrFirst is a helper method to define mock.On call +// - id p2pkey.PeerID +func (_e *P2P_Expecter) GetOrFirst(id interface{}) *P2P_GetOrFirst_Call { + return &P2P_GetOrFirst_Call{Call: _e.mock.On("GetOrFirst", id)} +} + +func (_c *P2P_GetOrFirst_Call) Run(run func(id p2pkey.PeerID)) *P2P_GetOrFirst_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(p2pkey.PeerID)) + }) + return _c +} + +func (_c *P2P_GetOrFirst_Call) Return(_a0 p2pkey.KeyV2, _a1 error) *P2P_GetOrFirst_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *P2P_GetOrFirst_Call) RunAndReturn(run func(p2pkey.PeerID) (p2pkey.KeyV2, error)) *P2P_GetOrFirst_Call { + _c.Call.Return(run) + return _c +} + // Import provides a mock function with given fields: ctx, keyJSON, password func (_m *P2P) Import(ctx context.Context, keyJSON []byte, password string) (p2pkey.KeyV2, error) { ret := _m.Called(ctx, keyJSON, password) @@ -251,6 +485,36 @@ func (_m *P2P) Import(ctx context.Context, keyJSON []byte, password string) (p2p return r0, r1 } +// P2P_Import_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Import' +type P2P_Import_Call struct { + *mock.Call +} + +// Import is a helper method to define mock.On call +// - ctx context.Context +// - keyJSON []byte +// - password string +func (_e *P2P_Expecter) Import(ctx interface{}, keyJSON interface{}, password interface{}) *P2P_Import_Call { + return &P2P_Import_Call{Call: _e.mock.On("Import", ctx, keyJSON, password)} +} + +func (_c *P2P_Import_Call) Run(run func(ctx context.Context, keyJSON []byte, password string)) *P2P_Import_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].([]byte), args[2].(string)) + }) + return _c +} + +func (_c *P2P_Import_Call) Return(_a0 p2pkey.KeyV2, _a1 error) *P2P_Import_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *P2P_Import_Call) RunAndReturn(run func(context.Context, []byte, string) (p2pkey.KeyV2, error)) *P2P_Import_Call { + _c.Call.Return(run) + return _c +} + // NewP2P creates a new instance of P2P. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewP2P(t interface { diff --git a/core/services/keystore/mocks/solana.go b/core/services/keystore/mocks/solana.go index 4fde08fc264..561daef439a 100644 --- a/core/services/keystore/mocks/solana.go +++ b/core/services/keystore/mocks/solana.go @@ -15,6 +15,14 @@ type Solana struct { mock.Mock } +type Solana_Expecter struct { + mock *mock.Mock +} + +func (_m *Solana) EXPECT() *Solana_Expecter { + return &Solana_Expecter{mock: &_m.Mock} +} + // Add provides a mock function with given fields: ctx, key func (_m *Solana) Add(ctx context.Context, key solkey.Key) error { ret := _m.Called(ctx, key) @@ -33,6 +41,35 @@ func (_m *Solana) Add(ctx context.Context, key solkey.Key) error { return r0 } +// Solana_Add_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Add' +type Solana_Add_Call struct { + *mock.Call +} + +// Add is a helper method to define mock.On call +// - ctx context.Context +// - key solkey.Key +func (_e *Solana_Expecter) Add(ctx interface{}, key interface{}) *Solana_Add_Call { + return &Solana_Add_Call{Call: _e.mock.On("Add", ctx, key)} +} + +func (_c *Solana_Add_Call) Run(run func(ctx context.Context, key solkey.Key)) *Solana_Add_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(solkey.Key)) + }) + return _c +} + +func (_c *Solana_Add_Call) Return(_a0 error) *Solana_Add_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Solana_Add_Call) RunAndReturn(run func(context.Context, solkey.Key) error) *Solana_Add_Call { + _c.Call.Return(run) + return _c +} + // Create provides a mock function with given fields: ctx func (_m *Solana) Create(ctx context.Context) (solkey.Key, error) { ret := _m.Called(ctx) @@ -61,6 +98,34 @@ func (_m *Solana) Create(ctx context.Context) (solkey.Key, error) { return r0, r1 } +// Solana_Create_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Create' +type Solana_Create_Call struct { + *mock.Call +} + +// Create is a helper method to define mock.On call +// - ctx context.Context +func (_e *Solana_Expecter) Create(ctx interface{}) *Solana_Create_Call { + return &Solana_Create_Call{Call: _e.mock.On("Create", ctx)} +} + +func (_c *Solana_Create_Call) Run(run func(ctx context.Context)) *Solana_Create_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *Solana_Create_Call) Return(_a0 solkey.Key, _a1 error) *Solana_Create_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Solana_Create_Call) RunAndReturn(run func(context.Context) (solkey.Key, error)) *Solana_Create_Call { + _c.Call.Return(run) + return _c +} + // Delete provides a mock function with given fields: ctx, id func (_m *Solana) Delete(ctx context.Context, id string) (solkey.Key, error) { ret := _m.Called(ctx, id) @@ -89,6 +154,35 @@ func (_m *Solana) Delete(ctx context.Context, id string) (solkey.Key, error) { return r0, r1 } +// Solana_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete' +type Solana_Delete_Call struct { + *mock.Call +} + +// Delete is a helper method to define mock.On call +// - ctx context.Context +// - id string +func (_e *Solana_Expecter) Delete(ctx interface{}, id interface{}) *Solana_Delete_Call { + return &Solana_Delete_Call{Call: _e.mock.On("Delete", ctx, id)} +} + +func (_c *Solana_Delete_Call) Run(run func(ctx context.Context, id string)) *Solana_Delete_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *Solana_Delete_Call) Return(_a0 solkey.Key, _a1 error) *Solana_Delete_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Solana_Delete_Call) RunAndReturn(run func(context.Context, string) (solkey.Key, error)) *Solana_Delete_Call { + _c.Call.Return(run) + return _c +} + // EnsureKey provides a mock function with given fields: ctx func (_m *Solana) EnsureKey(ctx context.Context) error { ret := _m.Called(ctx) @@ -107,6 +201,34 @@ func (_m *Solana) EnsureKey(ctx context.Context) error { return r0 } +// Solana_EnsureKey_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EnsureKey' +type Solana_EnsureKey_Call struct { + *mock.Call +} + +// EnsureKey is a helper method to define mock.On call +// - ctx context.Context +func (_e *Solana_Expecter) EnsureKey(ctx interface{}) *Solana_EnsureKey_Call { + return &Solana_EnsureKey_Call{Call: _e.mock.On("EnsureKey", ctx)} +} + +func (_c *Solana_EnsureKey_Call) Run(run func(ctx context.Context)) *Solana_EnsureKey_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *Solana_EnsureKey_Call) Return(_a0 error) *Solana_EnsureKey_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Solana_EnsureKey_Call) RunAndReturn(run func(context.Context) error) *Solana_EnsureKey_Call { + _c.Call.Return(run) + return _c +} + // Export provides a mock function with given fields: id, password func (_m *Solana) Export(id string, password string) ([]byte, error) { ret := _m.Called(id, password) @@ -137,6 +259,35 @@ func (_m *Solana) Export(id string, password string) ([]byte, error) { return r0, r1 } +// Solana_Export_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Export' +type Solana_Export_Call struct { + *mock.Call +} + +// Export is a helper method to define mock.On call +// - id string +// - password string +func (_e *Solana_Expecter) Export(id interface{}, password interface{}) *Solana_Export_Call { + return &Solana_Export_Call{Call: _e.mock.On("Export", id, password)} +} + +func (_c *Solana_Export_Call) Run(run func(id string, password string)) *Solana_Export_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(string)) + }) + return _c +} + +func (_c *Solana_Export_Call) Return(_a0 []byte, _a1 error) *Solana_Export_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Solana_Export_Call) RunAndReturn(run func(string, string) ([]byte, error)) *Solana_Export_Call { + _c.Call.Return(run) + return _c +} + // Get provides a mock function with given fields: id func (_m *Solana) Get(id string) (solkey.Key, error) { ret := _m.Called(id) @@ -165,6 +316,34 @@ func (_m *Solana) Get(id string) (solkey.Key, error) { return r0, r1 } +// Solana_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' +type Solana_Get_Call struct { + *mock.Call +} + +// Get is a helper method to define mock.On call +// - id string +func (_e *Solana_Expecter) Get(id interface{}) *Solana_Get_Call { + return &Solana_Get_Call{Call: _e.mock.On("Get", id)} +} + +func (_c *Solana_Get_Call) Run(run func(id string)) *Solana_Get_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Solana_Get_Call) Return(_a0 solkey.Key, _a1 error) *Solana_Get_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Solana_Get_Call) RunAndReturn(run func(string) (solkey.Key, error)) *Solana_Get_Call { + _c.Call.Return(run) + return _c +} + // GetAll provides a mock function with given fields: func (_m *Solana) GetAll() ([]solkey.Key, error) { ret := _m.Called() @@ -195,6 +374,33 @@ func (_m *Solana) GetAll() ([]solkey.Key, error) { return r0, r1 } +// Solana_GetAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAll' +type Solana_GetAll_Call struct { + *mock.Call +} + +// GetAll is a helper method to define mock.On call +func (_e *Solana_Expecter) GetAll() *Solana_GetAll_Call { + return &Solana_GetAll_Call{Call: _e.mock.On("GetAll")} +} + +func (_c *Solana_GetAll_Call) Run(run func()) *Solana_GetAll_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Solana_GetAll_Call) Return(_a0 []solkey.Key, _a1 error) *Solana_GetAll_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Solana_GetAll_Call) RunAndReturn(run func() ([]solkey.Key, error)) *Solana_GetAll_Call { + _c.Call.Return(run) + return _c +} + // Import provides a mock function with given fields: ctx, keyJSON, password func (_m *Solana) Import(ctx context.Context, keyJSON []byte, password string) (solkey.Key, error) { ret := _m.Called(ctx, keyJSON, password) @@ -223,6 +429,36 @@ func (_m *Solana) Import(ctx context.Context, keyJSON []byte, password string) ( return r0, r1 } +// Solana_Import_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Import' +type Solana_Import_Call struct { + *mock.Call +} + +// Import is a helper method to define mock.On call +// - ctx context.Context +// - keyJSON []byte +// - password string +func (_e *Solana_Expecter) Import(ctx interface{}, keyJSON interface{}, password interface{}) *Solana_Import_Call { + return &Solana_Import_Call{Call: _e.mock.On("Import", ctx, keyJSON, password)} +} + +func (_c *Solana_Import_Call) Run(run func(ctx context.Context, keyJSON []byte, password string)) *Solana_Import_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].([]byte), args[2].(string)) + }) + return _c +} + +func (_c *Solana_Import_Call) Return(_a0 solkey.Key, _a1 error) *Solana_Import_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Solana_Import_Call) RunAndReturn(run func(context.Context, []byte, string) (solkey.Key, error)) *Solana_Import_Call { + _c.Call.Return(run) + return _c +} + // Sign provides a mock function with given fields: ctx, id, msg func (_m *Solana) Sign(ctx context.Context, id string, msg []byte) ([]byte, error) { ret := _m.Called(ctx, id, msg) @@ -253,6 +489,36 @@ func (_m *Solana) Sign(ctx context.Context, id string, msg []byte) ([]byte, erro return r0, r1 } +// Solana_Sign_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Sign' +type Solana_Sign_Call struct { + *mock.Call +} + +// Sign is a helper method to define mock.On call +// - ctx context.Context +// - id string +// - msg []byte +func (_e *Solana_Expecter) Sign(ctx interface{}, id interface{}, msg interface{}) *Solana_Sign_Call { + return &Solana_Sign_Call{Call: _e.mock.On("Sign", ctx, id, msg)} +} + +func (_c *Solana_Sign_Call) Run(run func(ctx context.Context, id string, msg []byte)) *Solana_Sign_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].([]byte)) + }) + return _c +} + +func (_c *Solana_Sign_Call) Return(signature []byte, err error) *Solana_Sign_Call { + _c.Call.Return(signature, err) + return _c +} + +func (_c *Solana_Sign_Call) RunAndReturn(run func(context.Context, string, []byte) ([]byte, error)) *Solana_Sign_Call { + _c.Call.Return(run) + return _c +} + // NewSolana creates a new instance of Solana. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewSolana(t interface { diff --git a/core/services/keystore/mocks/starknet.go b/core/services/keystore/mocks/starknet.go index d12a8e9b8fa..512e417e76e 100644 --- a/core/services/keystore/mocks/starknet.go +++ b/core/services/keystore/mocks/starknet.go @@ -15,6 +15,14 @@ type StarkNet struct { mock.Mock } +type StarkNet_Expecter struct { + mock *mock.Mock +} + +func (_m *StarkNet) EXPECT() *StarkNet_Expecter { + return &StarkNet_Expecter{mock: &_m.Mock} +} + // Add provides a mock function with given fields: ctx, key func (_m *StarkNet) Add(ctx context.Context, key starkkey.Key) error { ret := _m.Called(ctx, key) @@ -33,6 +41,35 @@ func (_m *StarkNet) Add(ctx context.Context, key starkkey.Key) error { return r0 } +// StarkNet_Add_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Add' +type StarkNet_Add_Call struct { + *mock.Call +} + +// Add is a helper method to define mock.On call +// - ctx context.Context +// - key starkkey.Key +func (_e *StarkNet_Expecter) Add(ctx interface{}, key interface{}) *StarkNet_Add_Call { + return &StarkNet_Add_Call{Call: _e.mock.On("Add", ctx, key)} +} + +func (_c *StarkNet_Add_Call) Run(run func(ctx context.Context, key starkkey.Key)) *StarkNet_Add_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(starkkey.Key)) + }) + return _c +} + +func (_c *StarkNet_Add_Call) Return(_a0 error) *StarkNet_Add_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *StarkNet_Add_Call) RunAndReturn(run func(context.Context, starkkey.Key) error) *StarkNet_Add_Call { + _c.Call.Return(run) + return _c +} + // Create provides a mock function with given fields: ctx func (_m *StarkNet) Create(ctx context.Context) (starkkey.Key, error) { ret := _m.Called(ctx) @@ -61,6 +98,34 @@ func (_m *StarkNet) Create(ctx context.Context) (starkkey.Key, error) { return r0, r1 } +// StarkNet_Create_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Create' +type StarkNet_Create_Call struct { + *mock.Call +} + +// Create is a helper method to define mock.On call +// - ctx context.Context +func (_e *StarkNet_Expecter) Create(ctx interface{}) *StarkNet_Create_Call { + return &StarkNet_Create_Call{Call: _e.mock.On("Create", ctx)} +} + +func (_c *StarkNet_Create_Call) Run(run func(ctx context.Context)) *StarkNet_Create_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *StarkNet_Create_Call) Return(_a0 starkkey.Key, _a1 error) *StarkNet_Create_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *StarkNet_Create_Call) RunAndReturn(run func(context.Context) (starkkey.Key, error)) *StarkNet_Create_Call { + _c.Call.Return(run) + return _c +} + // Delete provides a mock function with given fields: ctx, id func (_m *StarkNet) Delete(ctx context.Context, id string) (starkkey.Key, error) { ret := _m.Called(ctx, id) @@ -89,6 +154,35 @@ func (_m *StarkNet) Delete(ctx context.Context, id string) (starkkey.Key, error) return r0, r1 } +// StarkNet_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete' +type StarkNet_Delete_Call struct { + *mock.Call +} + +// Delete is a helper method to define mock.On call +// - ctx context.Context +// - id string +func (_e *StarkNet_Expecter) Delete(ctx interface{}, id interface{}) *StarkNet_Delete_Call { + return &StarkNet_Delete_Call{Call: _e.mock.On("Delete", ctx, id)} +} + +func (_c *StarkNet_Delete_Call) Run(run func(ctx context.Context, id string)) *StarkNet_Delete_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *StarkNet_Delete_Call) Return(_a0 starkkey.Key, _a1 error) *StarkNet_Delete_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *StarkNet_Delete_Call) RunAndReturn(run func(context.Context, string) (starkkey.Key, error)) *StarkNet_Delete_Call { + _c.Call.Return(run) + return _c +} + // EnsureKey provides a mock function with given fields: ctx func (_m *StarkNet) EnsureKey(ctx context.Context) error { ret := _m.Called(ctx) @@ -107,6 +201,34 @@ func (_m *StarkNet) EnsureKey(ctx context.Context) error { return r0 } +// StarkNet_EnsureKey_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EnsureKey' +type StarkNet_EnsureKey_Call struct { + *mock.Call +} + +// EnsureKey is a helper method to define mock.On call +// - ctx context.Context +func (_e *StarkNet_Expecter) EnsureKey(ctx interface{}) *StarkNet_EnsureKey_Call { + return &StarkNet_EnsureKey_Call{Call: _e.mock.On("EnsureKey", ctx)} +} + +func (_c *StarkNet_EnsureKey_Call) Run(run func(ctx context.Context)) *StarkNet_EnsureKey_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *StarkNet_EnsureKey_Call) Return(_a0 error) *StarkNet_EnsureKey_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *StarkNet_EnsureKey_Call) RunAndReturn(run func(context.Context) error) *StarkNet_EnsureKey_Call { + _c.Call.Return(run) + return _c +} + // Export provides a mock function with given fields: id, password func (_m *StarkNet) Export(id string, password string) ([]byte, error) { ret := _m.Called(id, password) @@ -137,6 +259,35 @@ func (_m *StarkNet) Export(id string, password string) ([]byte, error) { return r0, r1 } +// StarkNet_Export_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Export' +type StarkNet_Export_Call struct { + *mock.Call +} + +// Export is a helper method to define mock.On call +// - id string +// - password string +func (_e *StarkNet_Expecter) Export(id interface{}, password interface{}) *StarkNet_Export_Call { + return &StarkNet_Export_Call{Call: _e.mock.On("Export", id, password)} +} + +func (_c *StarkNet_Export_Call) Run(run func(id string, password string)) *StarkNet_Export_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(string)) + }) + return _c +} + +func (_c *StarkNet_Export_Call) Return(_a0 []byte, _a1 error) *StarkNet_Export_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *StarkNet_Export_Call) RunAndReturn(run func(string, string) ([]byte, error)) *StarkNet_Export_Call { + _c.Call.Return(run) + return _c +} + // Get provides a mock function with given fields: id func (_m *StarkNet) Get(id string) (starkkey.Key, error) { ret := _m.Called(id) @@ -165,6 +316,34 @@ func (_m *StarkNet) Get(id string) (starkkey.Key, error) { return r0, r1 } +// StarkNet_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' +type StarkNet_Get_Call struct { + *mock.Call +} + +// Get is a helper method to define mock.On call +// - id string +func (_e *StarkNet_Expecter) Get(id interface{}) *StarkNet_Get_Call { + return &StarkNet_Get_Call{Call: _e.mock.On("Get", id)} +} + +func (_c *StarkNet_Get_Call) Run(run func(id string)) *StarkNet_Get_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *StarkNet_Get_Call) Return(_a0 starkkey.Key, _a1 error) *StarkNet_Get_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *StarkNet_Get_Call) RunAndReturn(run func(string) (starkkey.Key, error)) *StarkNet_Get_Call { + _c.Call.Return(run) + return _c +} + // GetAll provides a mock function with given fields: func (_m *StarkNet) GetAll() ([]starkkey.Key, error) { ret := _m.Called() @@ -195,6 +374,33 @@ func (_m *StarkNet) GetAll() ([]starkkey.Key, error) { return r0, r1 } +// StarkNet_GetAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAll' +type StarkNet_GetAll_Call struct { + *mock.Call +} + +// GetAll is a helper method to define mock.On call +func (_e *StarkNet_Expecter) GetAll() *StarkNet_GetAll_Call { + return &StarkNet_GetAll_Call{Call: _e.mock.On("GetAll")} +} + +func (_c *StarkNet_GetAll_Call) Run(run func()) *StarkNet_GetAll_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *StarkNet_GetAll_Call) Return(_a0 []starkkey.Key, _a1 error) *StarkNet_GetAll_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *StarkNet_GetAll_Call) RunAndReturn(run func() ([]starkkey.Key, error)) *StarkNet_GetAll_Call { + _c.Call.Return(run) + return _c +} + // Import provides a mock function with given fields: ctx, keyJSON, password func (_m *StarkNet) Import(ctx context.Context, keyJSON []byte, password string) (starkkey.Key, error) { ret := _m.Called(ctx, keyJSON, password) @@ -223,6 +429,36 @@ func (_m *StarkNet) Import(ctx context.Context, keyJSON []byte, password string) return r0, r1 } +// StarkNet_Import_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Import' +type StarkNet_Import_Call struct { + *mock.Call +} + +// Import is a helper method to define mock.On call +// - ctx context.Context +// - keyJSON []byte +// - password string +func (_e *StarkNet_Expecter) Import(ctx interface{}, keyJSON interface{}, password interface{}) *StarkNet_Import_Call { + return &StarkNet_Import_Call{Call: _e.mock.On("Import", ctx, keyJSON, password)} +} + +func (_c *StarkNet_Import_Call) Run(run func(ctx context.Context, keyJSON []byte, password string)) *StarkNet_Import_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].([]byte), args[2].(string)) + }) + return _c +} + +func (_c *StarkNet_Import_Call) Return(_a0 starkkey.Key, _a1 error) *StarkNet_Import_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *StarkNet_Import_Call) RunAndReturn(run func(context.Context, []byte, string) (starkkey.Key, error)) *StarkNet_Import_Call { + _c.Call.Return(run) + return _c +} + // NewStarkNet creates a new instance of StarkNet. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewStarkNet(t interface { diff --git a/core/services/keystore/mocks/vrf.go b/core/services/keystore/mocks/vrf.go index bc88f045234..36be39f539e 100644 --- a/core/services/keystore/mocks/vrf.go +++ b/core/services/keystore/mocks/vrf.go @@ -16,6 +16,14 @@ type VRF struct { mock.Mock } +type VRF_Expecter struct { + mock *mock.Mock +} + +func (_m *VRF) EXPECT() *VRF_Expecter { + return &VRF_Expecter{mock: &_m.Mock} +} + // Add provides a mock function with given fields: ctx, key func (_m *VRF) Add(ctx context.Context, key vrfkey.KeyV2) error { ret := _m.Called(ctx, key) @@ -34,6 +42,35 @@ func (_m *VRF) Add(ctx context.Context, key vrfkey.KeyV2) error { return r0 } +// VRF_Add_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Add' +type VRF_Add_Call struct { + *mock.Call +} + +// Add is a helper method to define mock.On call +// - ctx context.Context +// - key vrfkey.KeyV2 +func (_e *VRF_Expecter) Add(ctx interface{}, key interface{}) *VRF_Add_Call { + return &VRF_Add_Call{Call: _e.mock.On("Add", ctx, key)} +} + +func (_c *VRF_Add_Call) Run(run func(ctx context.Context, key vrfkey.KeyV2)) *VRF_Add_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(vrfkey.KeyV2)) + }) + return _c +} + +func (_c *VRF_Add_Call) Return(_a0 error) *VRF_Add_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *VRF_Add_Call) RunAndReturn(run func(context.Context, vrfkey.KeyV2) error) *VRF_Add_Call { + _c.Call.Return(run) + return _c +} + // Create provides a mock function with given fields: ctx func (_m *VRF) Create(ctx context.Context) (vrfkey.KeyV2, error) { ret := _m.Called(ctx) @@ -62,6 +99,34 @@ func (_m *VRF) Create(ctx context.Context) (vrfkey.KeyV2, error) { return r0, r1 } +// VRF_Create_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Create' +type VRF_Create_Call struct { + *mock.Call +} + +// Create is a helper method to define mock.On call +// - ctx context.Context +func (_e *VRF_Expecter) Create(ctx interface{}) *VRF_Create_Call { + return &VRF_Create_Call{Call: _e.mock.On("Create", ctx)} +} + +func (_c *VRF_Create_Call) Run(run func(ctx context.Context)) *VRF_Create_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *VRF_Create_Call) Return(_a0 vrfkey.KeyV2, _a1 error) *VRF_Create_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *VRF_Create_Call) RunAndReturn(run func(context.Context) (vrfkey.KeyV2, error)) *VRF_Create_Call { + _c.Call.Return(run) + return _c +} + // Delete provides a mock function with given fields: ctx, id func (_m *VRF) Delete(ctx context.Context, id string) (vrfkey.KeyV2, error) { ret := _m.Called(ctx, id) @@ -90,6 +155,35 @@ func (_m *VRF) Delete(ctx context.Context, id string) (vrfkey.KeyV2, error) { return r0, r1 } +// VRF_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete' +type VRF_Delete_Call struct { + *mock.Call +} + +// Delete is a helper method to define mock.On call +// - ctx context.Context +// - id string +func (_e *VRF_Expecter) Delete(ctx interface{}, id interface{}) *VRF_Delete_Call { + return &VRF_Delete_Call{Call: _e.mock.On("Delete", ctx, id)} +} + +func (_c *VRF_Delete_Call) Run(run func(ctx context.Context, id string)) *VRF_Delete_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *VRF_Delete_Call) Return(_a0 vrfkey.KeyV2, _a1 error) *VRF_Delete_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *VRF_Delete_Call) RunAndReturn(run func(context.Context, string) (vrfkey.KeyV2, error)) *VRF_Delete_Call { + _c.Call.Return(run) + return _c +} + // Export provides a mock function with given fields: id, password func (_m *VRF) Export(id string, password string) ([]byte, error) { ret := _m.Called(id, password) @@ -120,6 +214,35 @@ func (_m *VRF) Export(id string, password string) ([]byte, error) { return r0, r1 } +// VRF_Export_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Export' +type VRF_Export_Call struct { + *mock.Call +} + +// Export is a helper method to define mock.On call +// - id string +// - password string +func (_e *VRF_Expecter) Export(id interface{}, password interface{}) *VRF_Export_Call { + return &VRF_Export_Call{Call: _e.mock.On("Export", id, password)} +} + +func (_c *VRF_Export_Call) Run(run func(id string, password string)) *VRF_Export_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(string)) + }) + return _c +} + +func (_c *VRF_Export_Call) Return(_a0 []byte, _a1 error) *VRF_Export_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *VRF_Export_Call) RunAndReturn(run func(string, string) ([]byte, error)) *VRF_Export_Call { + _c.Call.Return(run) + return _c +} + // GenerateProof provides a mock function with given fields: id, seed func (_m *VRF) GenerateProof(id string, seed *big.Int) (vrfkey.Proof, error) { ret := _m.Called(id, seed) @@ -148,6 +271,35 @@ func (_m *VRF) GenerateProof(id string, seed *big.Int) (vrfkey.Proof, error) { return r0, r1 } +// VRF_GenerateProof_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GenerateProof' +type VRF_GenerateProof_Call struct { + *mock.Call +} + +// GenerateProof is a helper method to define mock.On call +// - id string +// - seed *big.Int +func (_e *VRF_Expecter) GenerateProof(id interface{}, seed interface{}) *VRF_GenerateProof_Call { + return &VRF_GenerateProof_Call{Call: _e.mock.On("GenerateProof", id, seed)} +} + +func (_c *VRF_GenerateProof_Call) Run(run func(id string, seed *big.Int)) *VRF_GenerateProof_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(*big.Int)) + }) + return _c +} + +func (_c *VRF_GenerateProof_Call) Return(_a0 vrfkey.Proof, _a1 error) *VRF_GenerateProof_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *VRF_GenerateProof_Call) RunAndReturn(run func(string, *big.Int) (vrfkey.Proof, error)) *VRF_GenerateProof_Call { + _c.Call.Return(run) + return _c +} + // Get provides a mock function with given fields: id func (_m *VRF) Get(id string) (vrfkey.KeyV2, error) { ret := _m.Called(id) @@ -176,6 +328,34 @@ func (_m *VRF) Get(id string) (vrfkey.KeyV2, error) { return r0, r1 } +// VRF_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' +type VRF_Get_Call struct { + *mock.Call +} + +// Get is a helper method to define mock.On call +// - id string +func (_e *VRF_Expecter) Get(id interface{}) *VRF_Get_Call { + return &VRF_Get_Call{Call: _e.mock.On("Get", id)} +} + +func (_c *VRF_Get_Call) Run(run func(id string)) *VRF_Get_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *VRF_Get_Call) Return(_a0 vrfkey.KeyV2, _a1 error) *VRF_Get_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *VRF_Get_Call) RunAndReturn(run func(string) (vrfkey.KeyV2, error)) *VRF_Get_Call { + _c.Call.Return(run) + return _c +} + // GetAll provides a mock function with given fields: func (_m *VRF) GetAll() ([]vrfkey.KeyV2, error) { ret := _m.Called() @@ -206,6 +386,33 @@ func (_m *VRF) GetAll() ([]vrfkey.KeyV2, error) { return r0, r1 } +// VRF_GetAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAll' +type VRF_GetAll_Call struct { + *mock.Call +} + +// GetAll is a helper method to define mock.On call +func (_e *VRF_Expecter) GetAll() *VRF_GetAll_Call { + return &VRF_GetAll_Call{Call: _e.mock.On("GetAll")} +} + +func (_c *VRF_GetAll_Call) Run(run func()) *VRF_GetAll_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *VRF_GetAll_Call) Return(_a0 []vrfkey.KeyV2, _a1 error) *VRF_GetAll_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *VRF_GetAll_Call) RunAndReturn(run func() ([]vrfkey.KeyV2, error)) *VRF_GetAll_Call { + _c.Call.Return(run) + return _c +} + // Import provides a mock function with given fields: ctx, keyJSON, password func (_m *VRF) Import(ctx context.Context, keyJSON []byte, password string) (vrfkey.KeyV2, error) { ret := _m.Called(ctx, keyJSON, password) @@ -234,6 +441,36 @@ func (_m *VRF) Import(ctx context.Context, keyJSON []byte, password string) (vrf return r0, r1 } +// VRF_Import_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Import' +type VRF_Import_Call struct { + *mock.Call +} + +// Import is a helper method to define mock.On call +// - ctx context.Context +// - keyJSON []byte +// - password string +func (_e *VRF_Expecter) Import(ctx interface{}, keyJSON interface{}, password interface{}) *VRF_Import_Call { + return &VRF_Import_Call{Call: _e.mock.On("Import", ctx, keyJSON, password)} +} + +func (_c *VRF_Import_Call) Run(run func(ctx context.Context, keyJSON []byte, password string)) *VRF_Import_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].([]byte), args[2].(string)) + }) + return _c +} + +func (_c *VRF_Import_Call) Return(_a0 vrfkey.KeyV2, _a1 error) *VRF_Import_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *VRF_Import_Call) RunAndReturn(run func(context.Context, []byte, string) (vrfkey.KeyV2, error)) *VRF_Import_Call { + _c.Call.Return(run) + return _c +} + // NewVRF creates a new instance of VRF. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewVRF(t interface { diff --git a/core/services/keystore/ocr.go b/core/services/keystore/ocr.go index 7cacbbfff97..6ef9bd2d637 100644 --- a/core/services/keystore/ocr.go +++ b/core/services/keystore/ocr.go @@ -9,8 +9,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ocrkey" ) -//go:generate mockery --quiet --name OCR --output ./mocks/ --case=underscore - type OCR interface { Get(id string) (ocrkey.KeyV2, error) GetAll() ([]ocrkey.KeyV2, error) diff --git a/core/services/keystore/ocr2.go b/core/services/keystore/ocr2.go index 4edbe2ba741..bc95852a309 100644 --- a/core/services/keystore/ocr2.go +++ b/core/services/keystore/ocr2.go @@ -10,8 +10,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ocr2key" ) -//go:generate mockery --quiet --name OCR2 --output mocks/ --case=underscore - type OCR2 interface { Get(id string) (ocr2key.KeyBundle, error) GetAll() ([]ocr2key.KeyBundle, error) diff --git a/core/services/keystore/p2p.go b/core/services/keystore/p2p.go index ee5bc647b5d..e4dc7b0ff39 100644 --- a/core/services/keystore/p2p.go +++ b/core/services/keystore/p2p.go @@ -11,8 +11,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" ) -//go:generate mockery --quiet --name P2P --output ./mocks/ --case=underscore --filename p2p.go - type P2P interface { Get(id p2pkey.PeerID) (p2pkey.KeyV2, error) GetAll() ([]p2pkey.KeyV2, error) diff --git a/core/services/keystore/solana.go b/core/services/keystore/solana.go index ba4031b64cc..5391ef6d2e7 100644 --- a/core/services/keystore/solana.go +++ b/core/services/keystore/solana.go @@ -10,8 +10,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/solkey" ) -//go:generate mockery --quiet --name Solana --output ./mocks/ --case=underscore --filename solana.go - type Solana interface { Get(id string) (solkey.Key, error) GetAll() ([]solkey.Key, error) diff --git a/core/services/keystore/starknet.go b/core/services/keystore/starknet.go index 19f8ccb7b3f..1aa213b86e9 100644 --- a/core/services/keystore/starknet.go +++ b/core/services/keystore/starknet.go @@ -14,7 +14,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/starkkey" ) -//go:generate mockery --quiet --name StarkNet --output ./mocks/ --case=underscore --filename starknet.go type StarkNet interface { Get(id string) (starkkey.Key, error) GetAll() ([]starkkey.Key, error) diff --git a/core/services/keystore/vrf.go b/core/services/keystore/vrf.go index 7b222e193d1..bb8a56aec2a 100644 --- a/core/services/keystore/vrf.go +++ b/core/services/keystore/vrf.go @@ -10,8 +10,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey" ) -//go:generate mockery --quiet --name VRF --output ./mocks/ --case=underscore --filename vrf.go - type VRF interface { Get(id string) (vrfkey.KeyV2, error) GetAll() ([]vrfkey.KeyV2, error) diff --git a/core/services/llo/bm/dummy_transmitter.go b/core/services/llo/bm/dummy_transmitter.go index a0adf5e477a..06fd0915b3b 100644 --- a/core/services/llo/bm/dummy_transmitter.go +++ b/core/services/llo/bm/dummy_transmitter.go @@ -2,6 +2,7 @@ package bm import ( "context" + "fmt" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promauto" @@ -10,12 +11,13 @@ import ( "github.com/smartcontractkit/libocr/offchainreporting2plus/types" ocr2types "github.com/smartcontractkit/libocr/offchainreporting2plus/types" + "github.com/smartcontractkit/chainlink/v2/core/services/llo/evm" + "github.com/smartcontractkit/chainlink-data-streams/llo" + "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink-common/pkg/services" llotypes "github.com/smartcontractkit/chainlink-common/pkg/types/llo" - - "github.com/smartcontractkit/chainlink/v2/core/logger" ) // A dummy transmitter useful for benchmarking and testing @@ -39,7 +41,7 @@ type transmitter struct { func NewTransmitter(lggr logger.Logger, fromAccount string) Transmitter { return &transmitter{ - lggr.Named("DummyTransmitter"), + logger.Named(lggr, "DummyTransmitter"), fromAccount, } } @@ -60,22 +62,44 @@ func (t *transmitter) Transmit( sigs []types.AttributedOnchainSignature, ) error { lggr := t.lggr - switch report.Info.ReportFormat { - case llotypes.ReportFormatJSON: - r, err := (llo.JSONReportCodec{}).Decode(report.Report) - if err != nil { - lggr.Debugw("Failed to decode JSON report", "err", err) + { + switch report.Info.ReportFormat { + case llotypes.ReportFormatJSON: + r, err := (llo.JSONReportCodec{}).Decode(report.Report) + if err != nil { + lggr.Debugw(fmt.Sprintf("Failed to decode report with type %s", report.Info.ReportFormat), "err", err) + } else if r.SeqNr > 0 { + lggr = logger.With(lggr, + "report.Report.ConfigDigest", r.ConfigDigest, + "report.Report.SeqNr", r.SeqNr, + "report.Report.ChannelID", r.ChannelID, + "report.Report.ValidAfterSeconds", r.ValidAfterSeconds, + "report.Report.ObservationTimestampSeconds", r.ObservationTimestampSeconds, + "report.Report.Values", r.Values, + "report.Report.Specimen", r.Specimen, + ) + } + case llotypes.ReportFormatEVMPremiumLegacy: + r, err := (evm.ReportCodecPremiumLegacy{}).Decode(report.Report) + if err != nil { + lggr.Debugw(fmt.Sprintf("Failed to decode report with type %s", report.Info.ReportFormat), "err", err) + } else if r.ObservationsTimestamp > 0 { + lggr = logger.With(lggr, + "report.Report.FeedId", r.FeedId, + "report.Report.ObservationsTimestamp", r.ObservationsTimestamp, + "report.Report.BenchmarkPrice", r.BenchmarkPrice, + "report.Report.Bid", r.Bid, + "report.Report.Ask", r.Ask, + "report.Report.ValidFromTimestamp", r.ValidFromTimestamp, + "report.Report.ExpiresAt", r.ExpiresAt, + "report.Report.LinkFee", r.LinkFee, + "report.Report.NativeFee", r.NativeFee, + ) + } + default: + err := fmt.Errorf("unhandled report format: %s", report.Info.ReportFormat) + lggr.Debugw(fmt.Sprintf("Failed to decode report with type %s", report.Info.ReportFormat), "err", err) } - lggr = lggr.With( - "report.Report.ConfigDigest", r.ConfigDigest, - "report.Report.ChainSelector", r.ChainSelector, - "report.Report.SeqNr", r.SeqNr, - "report.Report.ChannelID", r.ChannelID, - "report.Report.ValidAfterSeconds", r.ValidAfterSeconds, - "report.Report.ValidUntilSeconds", r.ValidUntilSeconds, - "report.Report.Values", r.Values, - "report.Report.Specimen", r.Specimen, - ) } transmitSuccessCount.Inc() lggr.Infow("Transmit (dummy)", "digest", digest, "seqNr", seqNr, "report.Report", report.Report, "report.Info", report.Info, "sigs", sigs) diff --git a/core/services/llo/channel_definition_cache_factory.go b/core/services/llo/channel_definition_cache_factory.go index 51906e0ff1b..0cc2543cdf1 100644 --- a/core/services/llo/channel_definition_cache_factory.go +++ b/core/services/llo/channel_definition_cache_factory.go @@ -2,14 +2,15 @@ package llo import ( "fmt" + "net/http" "sync" "github.com/ethereum/go-ethereum/common" + "github.com/smartcontractkit/chainlink-common/pkg/logger" llotypes "github.com/smartcontractkit/chainlink-common/pkg/types/llo" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" - "github.com/smartcontractkit/chainlink/v2/core/logger" lloconfig "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/llo/config" ) @@ -19,25 +20,29 @@ type ChannelDefinitionCacheFactory interface { var _ ChannelDefinitionCacheFactory = &channelDefinitionCacheFactory{} -func NewChannelDefinitionCacheFactory(lggr logger.Logger, orm ChannelDefinitionCacheORM, lp logpoller.LogPoller) ChannelDefinitionCacheFactory { +func NewChannelDefinitionCacheFactory(lggr logger.Logger, orm ChannelDefinitionCacheORM, lp logpoller.LogPoller, client *http.Client) ChannelDefinitionCacheFactory { return &channelDefinitionCacheFactory{ lggr, orm, lp, - make(map[common.Address]struct{}), + client, + make(map[common.Address]map[uint32]struct{}), sync.Mutex{}, } } type channelDefinitionCacheFactory struct { - lggr logger.Logger - orm ChannelDefinitionCacheORM - lp logpoller.LogPoller + lggr logger.Logger + orm ChannelDefinitionCacheORM + lp logpoller.LogPoller + client *http.Client - caches map[common.Address]struct{} + caches map[common.Address]map[uint32]struct{} mu sync.Mutex } +// TODO: Test this +// MERC-3653 func (f *channelDefinitionCacheFactory) NewCache(cfg lloconfig.PluginConfig) (llotypes.ChannelDefinitionCache, error) { if cfg.ChannelDefinitions != "" { return NewStaticChannelDefinitionCache(f.lggr, cfg.ChannelDefinitions) @@ -45,14 +50,18 @@ func (f *channelDefinitionCacheFactory) NewCache(cfg lloconfig.PluginConfig) (ll addr := cfg.ChannelDefinitionsContractAddress fromBlock := cfg.ChannelDefinitionsContractFromBlock + donID := cfg.DonID f.mu.Lock() defer f.mu.Unlock() - if _, exists := f.caches[addr]; exists { + if _, exists := f.caches[addr][donID]; exists { // This shouldn't really happen and isn't supported - return nil, fmt.Errorf("cache already exists for contract address %s", addr.Hex()) + return nil, fmt.Errorf("cache already exists for contract address %s and don ID %d", addr.Hex(), donID) } - f.caches[addr] = struct{}{} - return NewChannelDefinitionCache(f.lggr, f.orm, f.lp, addr, fromBlock), nil + if _, exists := f.caches[addr]; !exists { + f.caches[addr] = make(map[uint32]struct{}) + } + f.caches[addr][donID] = struct{}{} + return NewChannelDefinitionCache(f.lggr, f.orm, f.client, f.lp, addr, donID, fromBlock), nil } diff --git a/core/services/llo/cleanup.go b/core/services/llo/cleanup.go new file mode 100644 index 00000000000..892e925f372 --- /dev/null +++ b/core/services/llo/cleanup.go @@ -0,0 +1,28 @@ +package llo + +import ( + "context" + "fmt" + + "github.com/ethereum/go-ethereum/common" + + "github.com/smartcontractkit/chainlink-common/pkg/sqlutil" + "github.com/smartcontractkit/chainlink/v2/core/services/llo/mercurytransmitter" +) + +func Cleanup(ctx context.Context, lp LogPoller, addr common.Address, donID uint32, ds sqlutil.DataSource, chainSelector uint64) error { + if (addr != common.Address{} && donID > 0) { + if err := lp.UnregisterFilter(ctx, filterName(addr, donID)); err != nil { + return fmt.Errorf("failed to unregister filter: %w", err) + } + orm := NewORM(ds, chainSelector) + if err := orm.CleanupChannelDefinitions(ctx, addr, donID); err != nil { + return fmt.Errorf("failed to cleanup channel definitions: %w", err) + } + } + torm := mercurytransmitter.NewORM(ds, donID) + if err := torm.Cleanup(ctx); err != nil { + return fmt.Errorf("failed to cleanup transmitter: %w", err) + } + return nil +} diff --git a/core/services/llo/cleanup_test.go b/core/services/llo/cleanup_test.go new file mode 100644 index 00000000000..7c7f13e02f9 --- /dev/null +++ b/core/services/llo/cleanup_test.go @@ -0,0 +1,102 @@ +package llo + +import ( + "testing" + + "github.com/ethereum/go-ethereum/common" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + "github.com/smartcontractkit/libocr/offchainreporting2plus/ocr3types" + "github.com/smartcontractkit/libocr/offchainreporting2plus/types" + ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" + + llotypes "github.com/smartcontractkit/chainlink-common/pkg/types/llo" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/pgtest" + "github.com/smartcontractkit/chainlink/v2/core/services/llo/mercurytransmitter" +) + +func makeSampleTransmission(seqNr uint64, sURL string) *mercurytransmitter.Transmission { + return &mercurytransmitter.Transmission{ + ServerURL: sURL, + ConfigDigest: types.ConfigDigest{0x0, 0x9, 0x57, 0xdd, 0x2f, 0x63, 0x56, 0x69, 0x34, 0xfd, 0xc2, 0xe1, 0xcd, 0xc1, 0xe, 0x3e, 0x25, 0xb9, 0x26, 0x5a, 0x16, 0x23, 0x91, 0xa6, 0x53, 0x16, 0x66, 0x59, 0x51, 0x0, 0x28, 0x7c}, + SeqNr: seqNr, + Report: ocr3types.ReportWithInfo[llotypes.ReportInfo]{ + Report: ocrtypes.Report{0x0, 0x3, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x66, 0xde, 0xf5, 0xba, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x66, 0xde, 0xf5, 0xba, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1e, 0x8e, 0x95, 0xcf, 0xb5, 0xd8, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1a, 0xd0, 0x1c, 0x67, 0xa9, 0xcf, 0xb3, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x66, 0xdf, 0x3, 0xca, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1b, 0x1c, 0x93, 0x6d, 0xa4, 0xf2, 0x17, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1b, 0x14, 0x8d, 0x9a, 0xc1, 0xd9, 0x6f, 0xc0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1b, 0x40, 0x5c, 0xcf, 0xa1, 0xbc, 0x63, 0xc0, 0x0}, + Info: llotypes.ReportInfo{ + LifeCycleStage: llotypes.LifeCycleStage("production"), + ReportFormat: llotypes.ReportFormatEVMPremiumLegacy, + }, + }, + Sigs: []types.AttributedOnchainSignature{types.AttributedOnchainSignature{Signature: []uint8{0x9d, 0xab, 0x8f, 0xa7, 0xca, 0x7, 0x62, 0x57, 0xf7, 0x11, 0x2c, 0xb7, 0xf3, 0x49, 0x37, 0x12, 0xbd, 0xe, 0x14, 0x27, 0xfc, 0x32, 0x5c, 0xec, 0xa6, 0xb9, 0x7f, 0xf9, 0xd7, 0x7b, 0xa6, 0x36, 0x30, 0x9d, 0x84, 0x29, 0xbf, 0xd4, 0xeb, 0xc5, 0xc9, 0x29, 0xef, 0xdd, 0xd3, 0x2f, 0xa6, 0x25, 0x63, 0xda, 0xd9, 0x2c, 0xa1, 0x4a, 0xba, 0x75, 0xb2, 0x85, 0x25, 0x8f, 0x2b, 0x84, 0xcd, 0x99, 0x1}, Signer: 0x1}, types.AttributedOnchainSignature{Signature: []uint8{0x9a, 0x47, 0x4a, 0x3, 0x1a, 0x95, 0xcf, 0x46, 0x10, 0xaf, 0xcc, 0x90, 0x49, 0xb2, 0xce, 0xbf, 0x63, 0xaa, 0xc7, 0x25, 0x4d, 0x2a, 0x8, 0x36, 0xda, 0xd5, 0x9f, 0x9d, 0x63, 0x69, 0x22, 0xb3, 0x36, 0xd9, 0x6e, 0xf, 0xae, 0x7b, 0xd1, 0x61, 0x59, 0xf, 0x36, 0x4a, 0x22, 0xec, 0xde, 0x45, 0x32, 0xe0, 0x5b, 0x5c, 0xe3, 0x14, 0x29, 0x4, 0x60, 0x7b, 0xce, 0xa3, 0x89, 0x6b, 0xbb, 0xe0, 0x0}, Signer: 0x3}}, + } +} + +func Test_Cleanup(t *testing.T) { + ctx := testutils.Context(t) + + lp := &mockLogPoller{} + ds := pgtest.NewSqlxDB(t) + + addr1 := common.Address{1, 2, 3} + addr2 := common.Address{4, 5, 6} + donID1 := uint32(1) + donID2 := uint32(2) + chainSelector := uint64(3) + + // add some channel definitions + cdcorm := NewORM(ds, chainSelector) + { + err := cdcorm.StoreChannelDefinitions(ctx, addr1, donID1, 1, llotypes.ChannelDefinitions{}, 1) + require.NoError(t, err) + err = cdcorm.StoreChannelDefinitions(ctx, addr2, donID2, 1, llotypes.ChannelDefinitions{}, 1) + require.NoError(t, err) + } + + // add some transmissions + + torm1 := mercurytransmitter.NewORM(ds, donID1) + srvURL1 := "http://example.com/foo" + srvURL2 := "http://example.test/bar" + { + err := torm1.Insert(ctx, []*mercurytransmitter.Transmission{makeSampleTransmission(1, srvURL1), makeSampleTransmission(1, srvURL2)}) + require.NoError(t, err) + } + + torm2 := mercurytransmitter.NewORM(ds, donID2) + { + err := torm2.Insert(ctx, []*mercurytransmitter.Transmission{makeSampleTransmission(2, srvURL1), makeSampleTransmission(2, srvURL2)}) + require.NoError(t, err) + } + + err := Cleanup(ctx, lp, addr1, donID1, ds, chainSelector) + require.NoError(t, err) + + t.Run("unregisters filter", func(t *testing.T) { + assert.Equal(t, []string{"OCR3 LLO ChannelDefinitionCachePoller - 0x0102030000000000000000000000000000000000:1"}, lp.unregisteredFilterNames) + }) + t.Run("removes channel definitions", func(t *testing.T) { + pd, err := cdcorm.LoadChannelDefinitions(ctx, addr1, donID1) + require.NoError(t, err) + assert.Nil(t, pd) + pd, err = cdcorm.LoadChannelDefinitions(ctx, addr2, donID2) + require.NoError(t, err) + assert.NotNil(t, pd) + }) + t.Run("removes transmissions", func(t *testing.T) { + trs, err := torm1.Get(ctx, srvURL1) + require.NoError(t, err) + assert.Len(t, trs, 0) + trs, err = torm1.Get(ctx, srvURL2) + require.NoError(t, err) + assert.Len(t, trs, 0) + + trs, err = torm2.Get(ctx, srvURL1) + require.NoError(t, err) + assert.Len(t, trs, 1) + trs, err = torm2.Get(ctx, srvURL2) + require.NoError(t, err) + assert.Len(t, trs, 1) + }) +} diff --git a/core/services/llo/codecs.go b/core/services/llo/codecs.go new file mode 100644 index 00000000000..a67b30d2f21 --- /dev/null +++ b/core/services/llo/codecs.go @@ -0,0 +1,18 @@ +package llo + +import ( + llotypes "github.com/smartcontractkit/chainlink-common/pkg/types/llo" + "github.com/smartcontractkit/chainlink-data-streams/llo" + + "github.com/smartcontractkit/chainlink/v2/core/services/llo/evm" +) + +// NOTE: All supported codecs must be specified here +func NewCodecs() map[llotypes.ReportFormat]llo.ReportCodec { + codecs := make(map[llotypes.ReportFormat]llo.ReportCodec) + + codecs[llotypes.ReportFormatJSON] = llo.JSONReportCodec{} + codecs[llotypes.ReportFormatEVMPremiumLegacy] = evm.ReportCodecPremiumLegacy{} + + return codecs +} diff --git a/core/services/llo/codecs_test.go b/core/services/llo/codecs_test.go new file mode 100644 index 00000000000..d26b72dd35c --- /dev/null +++ b/core/services/llo/codecs_test.go @@ -0,0 +1,16 @@ +package llo + +import ( + "testing" + + "github.com/stretchr/testify/assert" + + llotypes "github.com/smartcontractkit/chainlink-common/pkg/types/llo" +) + +func Test_NewCodecs(t *testing.T) { + c := NewCodecs() + + assert.Contains(t, c, llotypes.ReportFormatJSON, "expected JSON to be supported") + assert.Contains(t, c, llotypes.ReportFormatEVMPremiumLegacy, "expected EVMPremiumLegacy to be supported") +} diff --git a/core/services/llo/data_source.go b/core/services/llo/data_source.go index 596f3a884a9..bad1bf0896a 100644 --- a/core/services/llo/data_source.go +++ b/core/services/llo/data_source.go @@ -3,12 +3,12 @@ package llo import ( "context" "fmt" - "math/big" "sort" "sync" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promauto" + "github.com/shopspring/decimal" "golang.org/x/exp/maps" llotypes "github.com/smartcontractkit/chainlink-common/pkg/types/llo" @@ -17,6 +17,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/pipeline" "github.com/smartcontractkit/chainlink/v2/core/services/streams" + "github.com/smartcontractkit/chainlink/v2/core/utils" ) var ( @@ -70,10 +71,16 @@ var _ llo.DataSource = &dataSource{} type dataSource struct { lggr logger.Logger registry Registry + + t Telemeter +} + +func NewDataSource(lggr logger.Logger, registry Registry, t Telemeter) llo.DataSource { + return newDataSource(lggr, registry, t) } -func newDataSource(lggr logger.Logger, registry Registry) llo.DataSource { - return &dataSource{lggr.Named("DataSource"), registry} +func newDataSource(lggr logger.Logger, registry Registry, t Telemeter) *dataSource { + return &dataSource{lggr.Named("DataSource"), registry, t} } // Observe looks up all streams in the registry and populates a map of stream ID => value @@ -81,7 +88,7 @@ func (d *dataSource) Observe(ctx context.Context, streamValues llo.StreamValues, var wg sync.WaitGroup wg.Add(len(streamValues)) var svmu sync.Mutex - var errors []ErrObservationFailed + var errs []ErrObservationFailed var errmu sync.Mutex if opts.VerboseLogging() { @@ -90,19 +97,19 @@ func (d *dataSource) Observe(ctx context.Context, streamValues llo.StreamValues, streamIDs = append(streamIDs, streamID) } sort.Slice(streamIDs, func(i, j int) bool { return streamIDs[i] < streamIDs[j] }) - d.lggr.Debugw("Observing streams", "streamIDs", streamIDs, "seqNr", opts.SeqNr()) + d.lggr.Debugw("Observing streams", "streamIDs", streamIDs, "configDigest", opts.ConfigDigest(), "seqNr", opts.OutCtx().SeqNr) } for _, streamID := range maps.Keys(streamValues) { go func(streamID llotypes.StreamID) { defer wg.Done() - var val *big.Int + var val llo.StreamValue stream, exists := d.registry.Get(streamID) if !exists { errmu.Lock() - errors = append(errors, ErrObservationFailed{streamID: streamID, reason: fmt.Sprintf("missing stream: %d", streamID)}) + errs = append(errs, ErrObservationFailed{streamID: streamID, reason: fmt.Sprintf("missing stream: %d", streamID)}) errmu.Unlock() promMissingStreamCount.WithLabelValues(fmt.Sprintf("%d", streamID)).Inc() return @@ -110,21 +117,26 @@ func (d *dataSource) Observe(ctx context.Context, streamValues llo.StreamValues, run, trrs, err := stream.Run(ctx) if err != nil { errmu.Lock() - errors = append(errors, ErrObservationFailed{inner: err, run: run, streamID: streamID, reason: "pipeline run failed"}) + errs = append(errs, ErrObservationFailed{inner: err, run: run, streamID: streamID, reason: "pipeline run failed"}) errmu.Unlock() promObservationErrorCount.WithLabelValues(fmt.Sprintf("%d", streamID)).Inc() + // TODO: Consolidate/reduce telemetry. We should send all observation results in a single packet + // https://smartcontract-it.atlassian.net/browse/MERC-6290 + d.t.EnqueueV3PremiumLegacy(run, trrs, streamID, opts, nil, err) return } - // TODO: support types other than *big.Int - // https://smartcontract-it.atlassian.net/browse/MERC-3525 - val, err = streams.ExtractBigInt(trrs) + // TODO: Consolidate/reduce telemetry. We should send all observation results in a single packet + // https://smartcontract-it.atlassian.net/browse/MERC-6290 + val, err = ExtractStreamValue(trrs) if err != nil { errmu.Lock() - errors = append(errors, ErrObservationFailed{inner: err, run: run, streamID: streamID, reason: "failed to extract big.Int"}) + errs = append(errs, ErrObservationFailed{inner: err, run: run, streamID: streamID, reason: "failed to extract big.Int"}) errmu.Unlock() return } + d.t.EnqueueV3PremiumLegacy(run, trrs, streamID, opts, val, nil) + if val != nil { svmu.Lock() defer svmu.Unlock() @@ -137,25 +149,79 @@ func (d *dataSource) Observe(ctx context.Context, streamValues llo.StreamValues, // Failed observations are always logged at warn level var failedStreamIDs []streams.StreamID - if len(errors) > 0 { - sort.Slice(errors, func(i, j int) bool { return errors[i].streamID < errors[j].streamID }) - failedStreamIDs = make([]streams.StreamID, len(errors)) - for i, e := range errors { + if len(errs) > 0 { + sort.Slice(errs, func(i, j int) bool { return errs[i].streamID < errs[j].streamID }) + failedStreamIDs = make([]streams.StreamID, len(errs)) + errStrs := make([]string, len(errs)) + for i, e := range errs { + errStrs[i] = e.String() failedStreamIDs[i] = e.streamID } - d.lggr.Warnw("Observation failed for streams", "failedStreamIDs", failedStreamIDs, "errors", errors, "seqNr", opts.SeqNr()) + d.lggr.Warnw("Observation failed for streams", "failedStreamIDs", failedStreamIDs, "errs", errStrs, "configDigest", opts.ConfigDigest(), "seqNr", opts.OutCtx().SeqNr) } if opts.VerboseLogging() { successes := make([]streams.StreamID, 0, len(streamValues)) - for strmID, res := range streamValues { - if res != nil { - successes = append(successes, strmID) - } + for strmID := range streamValues { + successes = append(successes, strmID) } sort.Slice(successes, func(i, j int) bool { return successes[i] < successes[j] }) - d.lggr.Debugw("Observation complete", "successfulStreamIDs", successes, "failedStreamIDs", failedStreamIDs, "values", streamValues, "seqNr", opts.SeqNr()) + d.lggr.Debugw("Observation complete", "successfulStreamIDs", successes, "failedStreamIDs", failedStreamIDs, "configDigest", opts.ConfigDigest(), "values", streamValues, "seqNr", opts.OutCtx().SeqNr) } return nil } + +// ExtractStreamValue extracts a StreamValue from a TaskRunResults +func ExtractStreamValue(trrs pipeline.TaskRunResults) (llo.StreamValue, error) { + // pipeline.TaskRunResults comes ordered asc by index, this is guaranteed + // by the pipeline executor + finaltrrs := trrs.Terminals() + + // TODO: Special handling for missing native/link streams? + // https://smartcontract-it.atlassian.net/browse/MERC-5949 + + // HACK: Right now we rely on the number of outputs to determine whether + // its a Decimal or a Quote. + // This isn't very robust or future-proof but is sufficient to support v0.3 + // compat. + // There are a number of different possible ways to solve this in future. + // See: https://smartcontract-it.atlassian.net/browse/MERC-5934 + switch len(finaltrrs) { + case 1: + res := finaltrrs[0].Result + if res.Error != nil { + return nil, res.Error + } + val, err := toDecimal(res.Value) + if err != nil { + return nil, fmt.Errorf("failed to parse BenchmarkPrice: %w", err) + } + return llo.ToDecimal(val), nil + case 3: + // Expect ordering of Benchmark, Bid, Ask + results := make([]decimal.Decimal, 3) + for i, trr := range finaltrrs { + res := trr.Result + if res.Error != nil { + return nil, fmt.Errorf("failed to parse stream output into Quote (task index: %d): %w", i, res.Error) + } + val, err := toDecimal(res.Value) + if err != nil { + return nil, fmt.Errorf("failed to parse decimal: %w", err) + } + results[i] = val + } + return &llo.Quote{ + Benchmark: results[0], + Bid: results[1], + Ask: results[2], + }, nil + default: + return nil, fmt.Errorf("invalid number of results, expected: 1 or 3, got: %d", len(finaltrrs)) + } +} + +func toDecimal(val interface{}) (decimal.Decimal, error) { + return utils.ToDecimal(val) +} diff --git a/core/services/llo/data_source_test.go b/core/services/llo/data_source_test.go index a975468c933..932c4c0c73a 100644 --- a/core/services/llo/data_source_test.go +++ b/core/services/llo/data_source_test.go @@ -4,9 +4,15 @@ import ( "context" "errors" "math/big" + "sync" "testing" + "github.com/shopspring/decimal" "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + "github.com/smartcontractkit/libocr/offchainreporting2plus/ocr3types" + ocr2types "github.com/smartcontractkit/libocr/offchainreporting2plus/types" "github.com/smartcontractkit/chainlink-data-streams/llo" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" @@ -34,8 +40,9 @@ func (m *mockRegistry) Get(streamID streams.StreamID) (strm streams.Stream, exis return } -func makeStreamWithSingleResult[T any](res T, err error) *mockStream { +func makeStreamWithSingleResult[T any](runID int64, res T, err error) *mockStream { return &mockStream{ + run: &pipeline.Run{ID: runID}, trrs: []pipeline.TaskRunResult{pipeline.TaskRunResult{Task: &pipeline.MemoTask{}, Result: pipeline.Result{Value: res}}}, err: err, } @@ -51,52 +58,113 @@ func makeStreamValues() llo.StreamValues { type mockOpts struct{} -func (m mockOpts) VerboseLogging() bool { return true } -func (m mockOpts) SeqNr() uint64 { return 42 } +func (m *mockOpts) VerboseLogging() bool { return true } +func (m *mockOpts) SeqNr() uint64 { return 1042 } +func (m *mockOpts) OutCtx() ocr3types.OutcomeContext { + return ocr3types.OutcomeContext{SeqNr: 1042, PreviousOutcome: ocr3types.Outcome([]byte("foo"))} +} +func (m *mockOpts) ConfigDigest() ocr2types.ConfigDigest { + return ocr2types.ConfigDigest{6, 5, 4} +} + +type mockTelemeter struct { + mu sync.Mutex + v3PremiumLegacyPackets []v3PremiumLegacyPacket +} + +type v3PremiumLegacyPacket struct { + run *pipeline.Run + trrs pipeline.TaskRunResults + streamID uint32 + opts llo.DSOpts + val llo.StreamValue + err error +} + +var _ Telemeter = &mockTelemeter{} + +func (m *mockTelemeter) EnqueueV3PremiumLegacy(run *pipeline.Run, trrs pipeline.TaskRunResults, streamID uint32, opts llo.DSOpts, val llo.StreamValue, err error) { + m.mu.Lock() + defer m.mu.Unlock() + m.v3PremiumLegacyPackets = append(m.v3PremiumLegacyPackets, v3PremiumLegacyPacket{run, trrs, streamID, opts, val, err}) +} func Test_DataSource(t *testing.T) { lggr := logger.TestLogger(t) reg := &mockRegistry{make(map[streams.StreamID]*mockStream)} - ds := newDataSource(lggr, reg) + ds := newDataSource(lggr, reg, NullTelemeter) ctx := testutils.Context(t) + opts := &mockOpts{} t.Run("Observe", func(t *testing.T) { t.Run("doesn't set any values if no streams are defined", func(t *testing.T) { vals := makeStreamValues() - err := ds.Observe(ctx, vals, mockOpts{}) + err := ds.Observe(ctx, vals, opts) assert.NoError(t, err) assert.Equal(t, makeStreamValues(), vals) }) t.Run("observes each stream with success and returns values matching map argument", func(t *testing.T) { - reg.streams[1] = makeStreamWithSingleResult[*big.Int](big.NewInt(2181), nil) - reg.streams[2] = makeStreamWithSingleResult[*big.Int](big.NewInt(40602), nil) - reg.streams[3] = makeStreamWithSingleResult[*big.Int](big.NewInt(15), nil) + reg.streams[1] = makeStreamWithSingleResult[*big.Int](1, big.NewInt(2181), nil) + reg.streams[2] = makeStreamWithSingleResult[*big.Int](2, big.NewInt(40602), nil) + reg.streams[3] = makeStreamWithSingleResult[*big.Int](3, big.NewInt(15), nil) vals := makeStreamValues() - err := ds.Observe(ctx, vals, mockOpts{}) + err := ds.Observe(ctx, vals, opts) assert.NoError(t, err) assert.Equal(t, llo.StreamValues{ - 2: big.NewInt(40602), - 1: big.NewInt(2181), - 3: big.NewInt(15), + 2: llo.ToDecimal(decimal.NewFromInt(40602)), + 1: llo.ToDecimal(decimal.NewFromInt(2181)), + 3: llo.ToDecimal(decimal.NewFromInt(15)), }, vals) }) t.Run("observes each stream and returns success/errors", func(t *testing.T) { - reg.streams[1] = makeStreamWithSingleResult[*big.Int](big.NewInt(2181), errors.New("something exploded")) - reg.streams[2] = makeStreamWithSingleResult[*big.Int](big.NewInt(40602), nil) - reg.streams[3] = makeStreamWithSingleResult[*big.Int](nil, errors.New("something exploded 2")) + reg.streams[1] = makeStreamWithSingleResult[*big.Int](1, big.NewInt(2181), errors.New("something exploded")) + reg.streams[2] = makeStreamWithSingleResult[*big.Int](2, big.NewInt(40602), nil) + reg.streams[3] = makeStreamWithSingleResult[*big.Int](3, nil, errors.New("something exploded 2")) vals := makeStreamValues() - err := ds.Observe(ctx, vals, mockOpts{}) + err := ds.Observe(ctx, vals, opts) assert.NoError(t, err) assert.Equal(t, llo.StreamValues{ - 2: big.NewInt(40602), + 2: llo.ToDecimal(decimal.NewFromInt(40602)), 1: nil, 3: nil, }, vals) }) + + t.Run("records telemetry", func(t *testing.T) { + tm := &mockTelemeter{} + ds.t = tm + + reg.streams[1] = makeStreamWithSingleResult[*big.Int](100, big.NewInt(2181), nil) + reg.streams[2] = makeStreamWithSingleResult[*big.Int](101, big.NewInt(40602), nil) + reg.streams[3] = makeStreamWithSingleResult[*big.Int](102, big.NewInt(15), nil) + + vals := makeStreamValues() + err := ds.Observe(ctx, vals, opts) + assert.NoError(t, err) + + assert.Equal(t, llo.StreamValues{ + 2: llo.ToDecimal(decimal.NewFromInt(40602)), + 1: llo.ToDecimal(decimal.NewFromInt(2181)), + 3: llo.ToDecimal(decimal.NewFromInt(15)), + }, vals) + + require.Len(t, tm.v3PremiumLegacyPackets, 3) + m := make(map[int]v3PremiumLegacyPacket) + for _, pkt := range tm.v3PremiumLegacyPackets { + m[int(pkt.run.ID)] = pkt + } + pkt := m[100] + assert.Equal(t, 100, int(pkt.run.ID)) + assert.Len(t, pkt.trrs, 1) + assert.Equal(t, 1, int(pkt.streamID)) + assert.Equal(t, opts, pkt.opts) + assert.Equal(t, "2181", pkt.val.(*llo.Decimal).String()) + assert.Nil(t, pkt.err) + }) }) } diff --git a/core/services/llo/delegate.go b/core/services/llo/delegate.go index fcb379d1fbc..ab55c6b2a95 100644 --- a/core/services/llo/delegate.go +++ b/core/services/llo/delegate.go @@ -19,7 +19,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/job" - "github.com/smartcontractkit/chainlink/v2/core/services/llo/evm" "github.com/smartcontractkit/chainlink/v2/core/services/streams" ) @@ -38,16 +37,18 @@ type delegate struct { prrc llo.PredecessorRetirementReportCache src llo.ShouldRetireCache ds llo.DataSource + t services.Service oracle Closer } type DelegateConfig struct { - Logger logger.Logger - DataSource sqlutil.DataSource - Runner streams.Runner - Registry Registry - JobName null.String + Logger logger.Logger + DataSource sqlutil.DataSource + Runner streams.Runner + Registry Registry + JobName null.String + CaptureEATelemetry bool // LLO ChannelDefinitionCache llotypes.ChannelDefinitionCache @@ -68,6 +69,7 @@ type DelegateConfig struct { } func NewDelegate(cfg DelegateConfig) (job.ServiceCtx, error) { + lggr := cfg.Logger.With("jobName", cfg.JobName.ValueOrZero()) if cfg.DataSource == nil { return nil, errors.New("DataSource must not be nil") } @@ -77,19 +79,21 @@ func NewDelegate(cfg DelegateConfig) (job.ServiceCtx, error) { if cfg.Registry == nil { return nil, errors.New("Registry must not be nil") } - codecs := make(map[llotypes.ReportFormat]llo.ReportCodec) - - // NOTE: All codecs must be specified here - codecs[llotypes.ReportFormatJSON] = llo.JSONReportCodec{} - codecs[llotypes.ReportFormatEVM] = evm.ReportCodec{} + codecs := NewCodecs() // TODO: Do these services need starting? // https://smartcontract-it.atlassian.net/browse/MERC-3386 prrc := llo.NewPredecessorRetirementReportCache() src := llo.NewShouldRetireCache() - ds := newDataSource(cfg.Logger.Named("DataSource"), cfg.Registry) + var t TelemeterService + if cfg.CaptureEATelemetry { + t = NewTelemeterService(lggr, cfg.MonitoringEndpoint) + } else { + t = NullTelemeter + } + ds := newDataSource(lggr.Named("DataSource"), cfg.Registry, t) - return &delegate{services.StateMachine{}, cfg, codecs, prrc, src, ds, nil}, nil + return &delegate{services.StateMachine{}, cfg, codecs, prrc, src, ds, t, nil}, nil } func (d *delegate) Start(ctx context.Context) error { diff --git a/core/services/llo/evm/fees.go b/core/services/llo/evm/fees.go new file mode 100644 index 00000000000..b74d68b08d2 --- /dev/null +++ b/core/services/llo/evm/fees.go @@ -0,0 +1,31 @@ +package evm + +import ( + "math/big" + + "github.com/shopspring/decimal" +) + +// FeeScalingFactor indicates the multiplier applied to fees. +// e.g. for a 1e18 multiplier, a LINK fee of 7.42 will be represented as 7.42e18 +// This is what will be baked into the report for use on-chain. +var FeeScalingFactor = decimal.NewFromInt(1e18) + +// NOTE: Inexact divisions will have this degree of precision +const Precision int32 = 18 + +// CalculateFee outputs a fee in wei according to the formula: baseUSDFee / tokenPriceInUSD +func CalculateFee(tokenPriceInUSD decimal.Decimal, baseUSDFee decimal.Decimal) *big.Int { + if tokenPriceInUSD.IsZero() || baseUSDFee.IsZero() { + // zero fee if token price or base fee is zero + return big.NewInt(0) + } + + // fee denominated in token + fee := baseUSDFee.DivRound(tokenPriceInUSD, Precision) + + // fee scaled up + fee = fee.Mul(FeeScalingFactor) + + return fee.BigInt() +} diff --git a/core/services/llo/evm/fees_test.go b/core/services/llo/evm/fees_test.go new file mode 100644 index 00000000000..16ee98db7df --- /dev/null +++ b/core/services/llo/evm/fees_test.go @@ -0,0 +1,45 @@ +package evm + +import ( + "math/big" + "testing" + + "github.com/shopspring/decimal" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func Test_Fees(t *testing.T) { + BaseUSDFee, err := decimal.NewFromString("0.70") + require.NoError(t, err) + t.Run("with token price > 1", func(t *testing.T) { + tokenPriceInUSD := decimal.NewFromInt32(1630) + fee := CalculateFee(tokenPriceInUSD, BaseUSDFee) + expectedFee := big.NewInt(429447852760736) + if fee.Cmp(expectedFee) != 0 { + t.Errorf("Expected fee to be %v, got %v", expectedFee, fee) + } + }) + + t.Run("with token price < 1", func(t *testing.T) { + tokenPriceInUSD := decimal.NewFromFloat32(0.4) + fee := CalculateFee(tokenPriceInUSD, BaseUSDFee) + expectedFee := big.NewInt(1750000000000000000) + if fee.Cmp(expectedFee) != 0 { + t.Errorf("Expected fee to be %v, got %v", expectedFee, fee) + } + }) + + t.Run("with token price == 0", func(t *testing.T) { + tokenPriceInUSD := decimal.NewFromInt32(0) + fee := CalculateFee(tokenPriceInUSD, BaseUSDFee) + assert.Equal(t, big.NewInt(0), fee) + }) + + t.Run("with base fee == 0", func(t *testing.T) { + tokenPriceInUSD := decimal.NewFromInt32(123) + BaseUSDFee = decimal.NewFromInt32(0) + fee := CalculateFee(tokenPriceInUSD, BaseUSDFee) + assert.Equal(t, big.NewInt(0), fee) + }) +} diff --git a/core/services/llo/evm/report_codec.go b/core/services/llo/evm/report_codec.go index 23ae02e1064..b5e13065843 100644 --- a/core/services/llo/evm/report_codec.go +++ b/core/services/llo/evm/report_codec.go @@ -1,14 +1,11 @@ package evm import ( + "errors" "fmt" - "math/big" "github.com/ethereum/go-ethereum/accounts/abi" - chainselectors "github.com/smartcontractkit/chain-selectors" - "github.com/smartcontractkit/libocr/offchainreporting2plus/types" - llotypes "github.com/smartcontractkit/chainlink-common/pkg/types/llo" "github.com/smartcontractkit/chainlink-data-streams/llo" @@ -51,47 +48,6 @@ func NewReportCodec() ReportCodec { return ReportCodec{} } -func (ReportCodec) Encode(report llo.Report) ([]byte, error) { - chainID, err := chainselectors.ChainIdFromSelector(report.ChainSelector) - if err != nil { - return nil, fmt.Errorf("failed to get chain ID for selector %d; %w", report.ChainSelector, err) - } - - b, err := Schema.Pack(report.ConfigDigest, chainID, report.SeqNr, report.ChannelID, report.ValidAfterSeconds, report.ValidUntilSeconds, report.Values, report.Specimen) - if err != nil { - return nil, fmt.Errorf("failed to encode report: %w", err) - } - return b, nil -} - -func (ReportCodec) Decode(encoded []byte) (llo.Report, error) { - type decode struct { - ConfigDigest types.ConfigDigest - ChainId uint64 - SeqNr uint64 - ChannelId llotypes.ChannelID - ValidAfterSeconds uint32 - ValidUntilSeconds uint32 - Values []*big.Int - Specimen bool - } - values, err := Schema.Unpack(encoded) - if err != nil { - return llo.Report{}, fmt.Errorf("failed to decode report: %w", err) - } - decoded := new(decode) - if err = Schema.Copy(decoded, values); err != nil { - return llo.Report{}, fmt.Errorf("failed to copy report values to struct: %w", err) - } - chainSelector, err := chainselectors.SelectorFromChainId(decoded.ChainId) - return llo.Report{ - ConfigDigest: decoded.ConfigDigest, - ChainSelector: chainSelector, - SeqNr: decoded.SeqNr, - ChannelID: decoded.ChannelId, - ValidAfterSeconds: decoded.ValidAfterSeconds, - ValidUntilSeconds: decoded.ValidUntilSeconds, - Values: decoded.Values, - Specimen: decoded.Specimen, - }, err +func (ReportCodec) Encode(report llo.Report, cd llotypes.ChannelDefinition) ([]byte, error) { + return nil, errors.New("not implemented") } diff --git a/core/services/llo/evm/report_codec_premium_legacy.go b/core/services/llo/evm/report_codec_premium_legacy.go new file mode 100644 index 00000000000..f8d72619ea1 --- /dev/null +++ b/core/services/llo/evm/report_codec_premium_legacy.go @@ -0,0 +1,175 @@ +package evm + +import ( + "encoding/json" + "errors" + "fmt" + + "github.com/ethereum/go-ethereum/common" + "github.com/shopspring/decimal" + + "github.com/smartcontractkit/libocr/offchainreporting2/chains/evmutil" + "github.com/smartcontractkit/libocr/offchainreporting2/types" + ocr2types "github.com/smartcontractkit/libocr/offchainreporting2plus/types" + + llotypes "github.com/smartcontractkit/chainlink-common/pkg/types/llo" + v3 "github.com/smartcontractkit/chainlink-common/pkg/types/mercury/v3" + "github.com/smartcontractkit/chainlink-data-streams/llo" + ubig "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils/big" + "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury" + reporttypes "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury/v3/types" + + "github.com/smartcontractkit/chainlink/v2/core/logger" + reportcodecv3 "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury/v3/reportcodec" +) + +var ( + _ llo.ReportCodec = ReportCodecPremiumLegacy{} +) + +type ReportCodecPremiumLegacy struct{ logger.Logger } + +func NewReportCodecPremiumLegacy(lggr logger.Logger) llo.ReportCodec { + return ReportCodecPremiumLegacy{lggr.Named("ReportCodecPremiumLegacy")} +} + +type ReportFormatEVMPremiumLegacyOpts struct { + // BaseUSDFee is the cost on-chain of verifying a report + BaseUSDFee decimal.Decimal `json:"baseUSDFee"` + // Expiration window is the length of time in seconds the report is valid + // for, from the observation timestamp + ExpirationWindow uint32 `json:"expirationWindow"` + // FeedID is for compatibility with existing on-chain verifiers + FeedID common.Hash `json:"feedID"` + // Multiplier is used to scale the bid, benchmark and ask values in the + // report. If not specified, or zero is used, a multiplier of 1 is assumed. + Multiplier *ubig.Big `json:"multiplier"` +} + +func (r *ReportFormatEVMPremiumLegacyOpts) Decode(opts []byte) error { + if len(opts) == 0 { + // special case if opts are unspecified, just use the zero options rather than erroring + return nil + } + return json.Unmarshal(opts, r) +} + +func (r ReportCodecPremiumLegacy) Encode(report llo.Report, cd llotypes.ChannelDefinition) ([]byte, error) { + if report.Specimen { + return nil, errors.New("ReportCodecPremiumLegacy does not support encoding specimen reports") + } + nativePrice, linkPrice, quote, err := ExtractReportValues(report) + if err != nil { + return nil, fmt.Errorf("ReportCodecPremiumLegacy cannot encode; got unusable report; %w", err) + } + + // NOTE: It seems suboptimal to have to parse the opts on every encode but + // not sure how to avoid it. Should be negligible performance hit as long + // as Opts is small. + opts := ReportFormatEVMPremiumLegacyOpts{} + if err := (&opts).Decode(cd.Opts); err != nil { + return nil, fmt.Errorf("failed to decode opts; got: '%s'; %w", cd.Opts, err) + } + var multiplier decimal.Decimal + if opts.Multiplier == nil { + multiplier = decimal.NewFromInt(1) + } else if opts.Multiplier.IsZero() { + return nil, errors.New("multiplier, if specified in channel opts, must be non-zero") + } else { + multiplier = decimal.NewFromBigInt(opts.Multiplier.ToInt(), 0) + } + + codec := reportcodecv3.NewReportCodec(opts.FeedID, r.Logger) + + rf := v3.ReportFields{ + ValidFromTimestamp: report.ValidAfterSeconds + 1, + Timestamp: report.ObservationTimestampSeconds, + NativeFee: CalculateFee(nativePrice.Decimal(), opts.BaseUSDFee), + LinkFee: CalculateFee(linkPrice.Decimal(), opts.BaseUSDFee), + ExpiresAt: report.ObservationTimestampSeconds + opts.ExpirationWindow, + BenchmarkPrice: quote.Benchmark.Mul(multiplier).BigInt(), + Bid: quote.Bid.Mul(multiplier).BigInt(), + Ask: quote.Ask.Mul(multiplier).BigInt(), + } + return codec.BuildReport(rf) +} + +func (r ReportCodecPremiumLegacy) Decode(b []byte) (*reporttypes.Report, error) { + codec := reportcodecv3.NewReportCodec([32]byte{}, r.Logger) + return codec.Decode(b) +} + +// Pack assembles the report values into a payload for verifying on-chain +func (r ReportCodecPremiumLegacy) Pack(digest types.ConfigDigest, seqNr uint64, report ocr2types.Report, sigs []types.AttributedOnchainSignature) ([]byte, error) { + var rs [][32]byte + var ss [][32]byte + var vs [32]byte + for i, as := range sigs { + r, s, v, err := evmutil.SplitSignature(as.Signature) + if err != nil { + return nil, fmt.Errorf("eventTransmit(ev): error in SplitSignature: %w", err) + } + rs = append(rs, r) + ss = append(ss, s) + vs[i] = v + } + reportCtx := LegacyReportContext(digest, seqNr) + rawReportCtx := evmutil.RawReportContext(reportCtx) + + payload, err := mercury.PayloadTypes.Pack(rawReportCtx, []byte(report), rs, ss, vs) + if err != nil { + return nil, fmt.Errorf("abi.Pack failed; %w", err) + } + return payload, nil +} + +// TODO: Test this +// MERC-3524 +func ExtractReportValues(report llo.Report) (nativePrice, linkPrice *llo.Decimal, quote *llo.Quote, err error) { + if len(report.Values) != 3 { + return nil, nil, nil, fmt.Errorf("ReportCodecPremiumLegacy requires exactly 3 values (NativePrice, LinkPrice, Quote{Bid, Mid, Ask}); got report.Values: %#v", report.Values) + } + var is bool + nativePrice, is = report.Values[0].(*llo.Decimal) + if nativePrice == nil { + // Missing price median will cause a zero fee + nativePrice = llo.ToDecimal(decimal.Zero) + } else if !is { + return nil, nil, nil, fmt.Errorf("ReportCodecPremiumLegacy expects first value to be of type *Decimal; got: %T", report.Values[0]) + } + linkPrice, is = report.Values[1].(*llo.Decimal) + if linkPrice == nil { + // Missing price median will cause a zero fee + linkPrice = llo.ToDecimal(decimal.Zero) + } else if !is { + return nil, nil, nil, fmt.Errorf("ReportCodecPremiumLegacy expects second value to be of type *Decimal; got: %T", report.Values[1]) + } + quote, is = report.Values[2].(*llo.Quote) + if !is { + return nil, nil, nil, fmt.Errorf("ReportCodecPremiumLegacy expects third value to be of type *Quote; got: %T", report.Values[2]) + } + return nativePrice, linkPrice, quote, nil +} + +// TODO: Consider embedding the DON ID here? +// MERC-3524 +var LLOExtraHash = common.HexToHash("0x0000000000000000000000000000000000000000000000000000000000000001") + +func SeqNrToEpochAndRound(seqNr uint64) (epoch uint32, round uint8) { + // Simulate 256 rounds/epoch + epoch = uint32(seqNr / 256) // nolint + round = uint8(seqNr % 256) // nolint + return +} + +func LegacyReportContext(cd ocr2types.ConfigDigest, seqNr uint64) ocr2types.ReportContext { + epoch, round := SeqNrToEpochAndRound(seqNr) + return ocr2types.ReportContext{ + ReportTimestamp: ocr2types.ReportTimestamp{ + ConfigDigest: cd, + Epoch: uint32(epoch), + Round: uint8(round), + }, + ExtraHash: LLOExtraHash, // ExtraHash is always zero for mercury, we use LLOExtraHash here to differentiate from the legacy plugin + } +} diff --git a/core/services/llo/evm/report_codec_premium_legacy_test.go b/core/services/llo/evm/report_codec_premium_legacy_test.go new file mode 100644 index 00000000000..dab2a8cf3fd --- /dev/null +++ b/core/services/llo/evm/report_codec_premium_legacy_test.go @@ -0,0 +1,130 @@ +package evm + +import ( + "fmt" + "math/big" + "testing" + + "github.com/shopspring/decimal" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + "github.com/smartcontractkit/libocr/offchainreporting2plus/types" + + reporttypes "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury/v3/types" + + llotypes "github.com/smartcontractkit/chainlink-common/pkg/types/llo" + + "github.com/smartcontractkit/chainlink-data-streams/llo" +) + +func newValidPremiumLegacyReport() llo.Report { + return llo.Report{ + ConfigDigest: types.ConfigDigest{1, 2, 3}, + SeqNr: 32, + ChannelID: llotypes.ChannelID(31), + ValidAfterSeconds: 28, + ObservationTimestampSeconds: 34, + Values: []llo.StreamValue{llo.ToDecimal(decimal.NewFromInt(35)), llo.ToDecimal(decimal.NewFromInt(36)), &llo.Quote{Bid: decimal.NewFromInt(37), Benchmark: decimal.NewFromInt(38), Ask: decimal.NewFromInt(39)}}, + Specimen: false, + } +} + +func Test_ReportCodecPremiumLegacy(t *testing.T) { + rc := ReportCodecPremiumLegacy{} + + feedID := [32]uint8{0x1, 0x2, 0x3, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0} + cd := llotypes.ChannelDefinition{Opts: llotypes.ChannelOpts(fmt.Sprintf(`{"baseUSDFee":"10.50","expirationWindow":60,"feedId":"0x%x","multiplier":10}`, feedID))} + + t.Run("Encode errors if no values", func(t *testing.T) { + _, err := rc.Encode(llo.Report{}, cd) + require.Error(t, err) + + assert.Contains(t, err.Error(), "ReportCodecPremiumLegacy cannot encode; got unusable report; ReportCodecPremiumLegacy requires exactly 3 values (NativePrice, LinkPrice, Quote{Bid, Mid, Ask}); got report.Values: []llo.StreamValue(nil)") + }) + + t.Run("does not encode specimen reports", func(t *testing.T) { + report := newValidPremiumLegacyReport() + report.Specimen = true + + _, err := rc.Encode(report, cd) + require.Error(t, err) + assert.EqualError(t, err, "ReportCodecPremiumLegacy does not support encoding specimen reports") + }) + + t.Run("Encode constructs a report from observations", func(t *testing.T) { + report := newValidPremiumLegacyReport() + + encoded, err := rc.Encode(report, cd) + require.NoError(t, err) + + assert.Len(t, encoded, 288) + assert.Equal(t, []byte{0x1, 0x2, 0x3, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1d, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x22, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x4, 0x29, 0xd0, 0x69, 0x18, 0x9e, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x4, 0xc, 0x35, 0x49, 0xbb, 0x7d, 0x2a, 0xab, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x5e, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x7c, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x72, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x86}, encoded) + + decoded, err := reporttypes.Decode(encoded) + require.NoError(t, err) + assert.Equal(t, feedID, decoded.FeedId) + assert.Equal(t, uint32(34), decoded.ObservationsTimestamp) + assert.Equal(t, big.NewInt(380), decoded.BenchmarkPrice) + assert.Equal(t, big.NewInt(370), decoded.Bid) + assert.Equal(t, big.NewInt(390), decoded.Ask) + assert.Equal(t, uint32(29), decoded.ValidFromTimestamp) + assert.Equal(t, uint32(94), decoded.ExpiresAt) + assert.Equal(t, big.NewInt(291666666666666667), decoded.LinkFee) + assert.Equal(t, big.NewInt(300000000000000000), decoded.NativeFee) + + t.Run("Decode decodes the report", func(t *testing.T) { + decoded, err := rc.Decode(encoded) + require.NoError(t, err) + + assert.Equal(t, &reporttypes.Report{ + FeedId: [32]uint8{0x1, 0x2, 0x3, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, + ObservationsTimestamp: 0x22, + BenchmarkPrice: big.NewInt(380), + Bid: big.NewInt(370), + Ask: big.NewInt(390), + ValidFromTimestamp: 0x1d, + ExpiresAt: uint32(94), + LinkFee: big.NewInt(291666666666666667), + NativeFee: big.NewInt(300000000000000000), + }, decoded) + }) + }) + + t.Run("uses zero values if fees are missing", func(t *testing.T) { + report := llo.Report{ + Values: []llo.StreamValue{nil, nil, &llo.Quote{Bid: decimal.NewFromInt(37), Benchmark: decimal.NewFromInt(38), Ask: decimal.NewFromInt(39)}}, + } + + encoded, err := rc.Encode(report, cd) + require.NoError(t, err) + + assert.Len(t, encoded, 288) + assert.Equal(t, []byte{0x1, 0x2, 0x3, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3c, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x7c, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x72, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x86}, encoded) + + decoded, err := rc.Decode(encoded) + require.NoError(t, err) + + assert.Equal(t, feedID, decoded.FeedId) + assert.Equal(t, uint32(0), decoded.ObservationsTimestamp) + assert.Equal(t, big.NewInt(380).String(), decoded.BenchmarkPrice.String()) + assert.Equal(t, big.NewInt(370).String(), decoded.Bid.String()) + assert.Equal(t, big.NewInt(390).String(), decoded.Ask.String()) + assert.Equal(t, uint32(1), decoded.ValidFromTimestamp) + assert.Equal(t, uint32(60), decoded.ExpiresAt) + assert.Equal(t, big.NewInt(0).String(), decoded.LinkFee.String()) + assert.Equal(t, big.NewInt(0).String(), decoded.NativeFee.String()) + }) + + t.Run("Decode errors on invalid report", func(t *testing.T) { + _, err := rc.Decode([]byte{1, 2, 3}) + assert.EqualError(t, err, "failed to decode report: abi: cannot marshal in to go type: length insufficient 3 require 32") + + longBad := make([]byte, 64) + for i := 0; i < len(longBad); i++ { + longBad[i] = byte(i) + } + _, err = rc.Decode(longBad) + assert.EqualError(t, err, "failed to decode report: abi: improperly encoded uint32 value") + }) +} diff --git a/core/services/llo/evm/report_codec_test.go b/core/services/llo/evm/report_codec_test.go deleted file mode 100644 index e00314306ae..00000000000 --- a/core/services/llo/evm/report_codec_test.go +++ /dev/null @@ -1,90 +0,0 @@ -package evm - -import ( - "math/big" - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - - "github.com/smartcontractkit/libocr/offchainreporting2plus/types" - - llotypes "github.com/smartcontractkit/chainlink-common/pkg/types/llo" - - "github.com/smartcontractkit/chainlink-data-streams/llo" -) - -const ethMainnetChainSelector uint64 = 5009297550715157269 - -func newValidReport() llo.Report { - return llo.Report{ - ConfigDigest: types.ConfigDigest{1, 2, 3}, - ChainSelector: ethMainnetChainSelector, // - SeqNr: 32, - ChannelID: llotypes.ChannelID(31), - ValidAfterSeconds: 33, - ValidUntilSeconds: 34, - Values: []*big.Int{big.NewInt(35), big.NewInt(36)}, - Specimen: true, - } -} - -func Test_ReportCodec(t *testing.T) { - rc := ReportCodec{} - - t.Run("Encode errors on zero fields", func(t *testing.T) { - _, err := rc.Encode(llo.Report{}) - require.Error(t, err) - - assert.Contains(t, err.Error(), "failed to get chain ID for selector 0; chain not found for chain selector 0") - }) - - t.Run("Encode constructs a report from observations", func(t *testing.T) { - report := newValidReport() - - encoded, err := rc.Encode(report) - require.NoError(t, err) - - reportElems := make(map[string]interface{}) - err = Schema.UnpackIntoMap(reportElems, encoded) - require.NoError(t, err) - - assert.Equal(t, [32]uint8{0x1, 0x2, 0x3, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, reportElems["configDigest"]) - assert.Equal(t, uint64(1), reportElems["chainId"]) - assert.Equal(t, uint64(32), reportElems["seqNr"]) - assert.Equal(t, uint32(31), reportElems["channelId"]) - assert.Equal(t, uint32(33), reportElems["validAfterSeconds"]) - assert.Equal(t, uint32(34), reportElems["validUntilSeconds"]) - assert.Equal(t, []*big.Int{big.NewInt(35), big.NewInt(36)}, reportElems["values"]) - assert.Equal(t, true, reportElems["specimen"]) - - assert.Len(t, encoded, 352) - assert.Equal(t, []byte{0x1, 0x2, 0x3, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x20, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1f, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x21, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x22, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x23, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x24}, encoded) - - t.Run("Decode decodes the report", func(t *testing.T) { - decoded, err := rc.Decode(encoded) - require.NoError(t, err) - - assert.Equal(t, report.ConfigDigest, decoded.ConfigDigest) - assert.Equal(t, report.ChainSelector, decoded.ChainSelector) - assert.Equal(t, report.SeqNr, decoded.SeqNr) - assert.Equal(t, report.ChannelID, decoded.ChannelID) - assert.Equal(t, report.ValidAfterSeconds, decoded.ValidAfterSeconds) - assert.Equal(t, report.ValidUntilSeconds, decoded.ValidUntilSeconds) - assert.Equal(t, report.Values, decoded.Values) - assert.Equal(t, report.Specimen, decoded.Specimen) - }) - }) - - t.Run("Decode errors on invalid report", func(t *testing.T) { - _, err := rc.Decode([]byte{1, 2, 3}) - assert.EqualError(t, err, "failed to decode report: abi: cannot marshal in to go type: length insufficient 3 require 32") - - longBad := make([]byte, 64) - for i := 0; i < len(longBad); i++ { - longBad[i] = byte(i) - } - _, err = rc.Decode(longBad) - assert.EqualError(t, err, "failed to decode report: abi: improperly encoded uint64 value") - }) -} diff --git a/core/services/llo/keyring.go b/core/services/llo/keyring.go index 1d6eaebad38..8137a5ac3da 100644 --- a/core/services/llo/keyring.go +++ b/core/services/llo/keyring.go @@ -1,15 +1,19 @@ package llo import ( + "bytes" "fmt" + "sort" "github.com/smartcontractkit/libocr/offchainreporting2plus/ocr3types" "github.com/smartcontractkit/libocr/offchainreporting2plus/types" ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" + "golang.org/x/exp/maps" llotypes "github.com/smartcontractkit/chainlink-common/pkg/types/llo" "github.com/smartcontractkit/chainlink/v2/core/logger" + "github.com/smartcontractkit/chainlink/v2/core/services/llo/evm" ) type LLOOnchainKeyring ocr3types.OnchainKeyring[llotypes.ReportInfo] @@ -17,6 +21,11 @@ type LLOOnchainKeyring ocr3types.OnchainKeyring[llotypes.ReportInfo] var _ LLOOnchainKeyring = &onchainKeyring{} type Key interface { + // Legacy Sign/Verify methods needed for v0.3 report compatibility + // New keys can leave these stubbed + Sign(reportCtx ocrtypes.ReportContext, report ocrtypes.Report) ([]byte, error) + Verify(publicKey ocrtypes.OnchainPublicKey, reportCtx ocrtypes.ReportContext, report ocrtypes.Report, signature []byte) bool + Sign3(digest ocrtypes.ConfigDigest, seqNr uint64, r ocrtypes.Report) (signature []byte, err error) Verify3(publicKey ocrtypes.OnchainPublicKey, cd ocrtypes.ConfigDigest, seqNr uint64, r ocrtypes.Report, signature []byte) bool PublicKey() ocrtypes.OnchainPublicKey @@ -35,12 +44,29 @@ func NewOnchainKeyring(lggr logger.Logger, keys map[llotypes.ReportFormat]Key) L } func (okr *onchainKeyring) PublicKey() types.OnchainPublicKey { - // All public keys combined - var pk []byte - for _, k := range okr.keys { - pk = append(pk, k.PublicKey()...) + // All unique public keys sorted in ascending order and combined into one + // byte string + onchainPublicKey := []byte{} + + keys := maps.Values(okr.keys) + if len(keys) == 0 { + return onchainPublicKey + } + sort.Slice(keys, func(i, j int) bool { + return bytes.Compare(keys[i].PublicKey(), keys[j].PublicKey()) < 0 + }) + + onchainPublicKey = append(onchainPublicKey, keys[0].PublicKey()...) + if len(keys) == 1 { + return onchainPublicKey } - return pk + for i := 1; i < len(keys); i++ { + if keys[i] != keys[i-1] { + onchainPublicKey = append(onchainPublicKey, keys[i].PublicKey()...) + } + } + + return onchainPublicKey } func (okr *onchainKeyring) MaxSignatureLength() (n int) { @@ -52,27 +78,37 @@ func (okr *onchainKeyring) MaxSignatureLength() (n int) { } func (okr *onchainKeyring) Sign(digest types.ConfigDigest, seqNr uint64, r ocr3types.ReportWithInfo[llotypes.ReportInfo]) (signature []byte, err error) { - rf := r.Info.ReportFormat - // HACK: sign/verify JSON payloads with EVM keys for now, this makes - // debugging and testing easier - if rf == llotypes.ReportFormatJSON { - rf = llotypes.ReportFormatEVM - } - if key, exists := okr.keys[rf]; exists { - return key.Sign3(digest, seqNr, r.Report) + switch r.Info.ReportFormat { + case llotypes.ReportFormatEVMPremiumLegacy: + rf := r.Info.ReportFormat + if key, exists := okr.keys[rf]; exists { + // NOTE: Must use legacy Sign method for compatibility with v0.3 report verification + rc := evm.LegacyReportContext(digest, seqNr) + return key.Sign(rc, r.Report) + } + default: + rf := r.Info.ReportFormat + if key, exists := okr.keys[rf]; exists { + return key.Sign3(digest, seqNr, r.Report) + } } return nil, fmt.Errorf("Sign failed; unsupported report format: %q", r.Info.ReportFormat) } func (okr *onchainKeyring) Verify(key types.OnchainPublicKey, digest types.ConfigDigest, seqNr uint64, r ocr3types.ReportWithInfo[llotypes.ReportInfo], signature []byte) bool { - rf := r.Info.ReportFormat - // HACK: sign/verify JSON payloads with EVM keys for now, this makes - // debugging and testing easier - if rf == llotypes.ReportFormatJSON { - rf = llotypes.ReportFormatEVM - } - if verifier, exists := okr.keys[rf]; exists { - return verifier.Verify3(key, digest, seqNr, r.Report, signature) + switch r.Info.ReportFormat { + case llotypes.ReportFormatEVMPremiumLegacy: + rf := r.Info.ReportFormat + if verifier, exists := okr.keys[rf]; exists { + // NOTE: Must use legacy Verify method for compatibility with v0.3 report verification + rc := evm.LegacyReportContext(digest, seqNr) + return verifier.Verify(key, rc, r.Report, signature) + } + default: + rf := r.Info.ReportFormat + if verifier, exists := okr.keys[rf]; exists { + return verifier.Verify3(key, digest, seqNr, r.Report, signature) + } } okr.lggr.Errorf("Verify failed; unsupported report format: %q", r.Info.ReportFormat) return false diff --git a/core/services/llo/keyring_test.go b/core/services/llo/keyring_test.go index bf728813801..44371e14967 100644 --- a/core/services/llo/keyring_test.go +++ b/core/services/llo/keyring_test.go @@ -24,10 +24,19 @@ type mockKey struct { format llotypes.ReportFormat verify bool maxSignatureLen int + sig []byte +} + +func (m *mockKey) Sign(reportCtx ocrtypes.ReportContext, report ocrtypes.Report) ([]byte, error) { + return m.sig, nil +} + +func (m *mockKey) Verify(publicKey ocrtypes.OnchainPublicKey, reportCtx ocrtypes.ReportContext, report ocrtypes.Report, signature []byte) bool { + return m.verify } func (m *mockKey) Sign3(digest ocrtypes.ConfigDigest, seqNr uint64, r ocrtypes.Report) (signature []byte, err error) { - return []byte(fmt.Sprintf("sig-%d", m.format)), nil + return m.sig, nil } func (m *mockKey) Verify3(publicKey ocrtypes.OnchainPublicKey, cd ocrtypes.ConfigDigest, seqNr uint64, r ocrtypes.Report, signature []byte) bool { @@ -55,10 +64,8 @@ func Test_Keyring(t *testing.T) { lggr := logger.TestLogger(t) ks := map[llotypes.ReportFormat]Key{ - llotypes.ReportFormatEVM: &mockKey{format: llotypes.ReportFormatEVM, maxSignatureLen: 1}, - llotypes.ReportFormatSolana: &mockKey{format: llotypes.ReportFormatSolana, maxSignatureLen: 2}, - llotypes.ReportFormatCosmos: &mockKey{format: llotypes.ReportFormatCosmos, maxSignatureLen: 4}, - llotypes.ReportFormatStarknet: &mockKey{format: llotypes.ReportFormatStarknet, maxSignatureLen: 8}, + llotypes.ReportFormatEVMPremiumLegacy: &mockKey{format: llotypes.ReportFormatEVMPremiumLegacy, maxSignatureLen: 1, sig: []byte("sig-1")}, + llotypes.ReportFormatJSON: &mockKey{format: llotypes.ReportFormatJSON, maxSignatureLen: 2, sig: []byte("sig-2")}, } kr := NewOnchainKeyring(lggr, ks) @@ -67,16 +74,10 @@ func Test_Keyring(t *testing.T) { format llotypes.ReportFormat }{ { - llotypes.ReportFormatEVM, + llotypes.ReportFormatEVMPremiumLegacy, }, { - llotypes.ReportFormatSolana, - }, - { - llotypes.ReportFormatCosmos, - }, - { - llotypes.ReportFormatStarknet, + llotypes.ReportFormatJSON, }, } @@ -97,24 +98,15 @@ func Test_Keyring(t *testing.T) { assert.False(t, kr.Verify(nil, cd, seqNr, ocr3types.ReportWithInfo[llotypes.ReportInfo]{Info: llotypes.ReportInfo{ReportFormat: tc.format}}, sig)) k.(*mockKey).verify = true - - for _, tc2 := range cases { - verified := kr.Verify(nil, cd, seqNr, ocr3types.ReportWithInfo[llotypes.ReportInfo]{Info: llotypes.ReportInfo{ReportFormat: tc2.format}}, sig) - if tc.format == tc2.format { - assert.True(t, verified, "expected true for %s", tc2.format) - } else { - assert.False(t, verified, "expected false for %s", tc2.format) - } - } }) } }) t.Run("MaxSignatureLength", func(t *testing.T) { - assert.Equal(t, 8+4+2+1, kr.MaxSignatureLength()) + assert.Equal(t, 2+1, kr.MaxSignatureLength()) }) t.Run("PublicKey", func(t *testing.T) { - b := make([]byte, 8+4+2+1) + b := make([]byte, 2+1) for i := 0; i < len(b); i++ { b[i] = byte(255) } diff --git a/core/services/llo/mercurytransmitter/helpers_test.go b/core/services/llo/mercurytransmitter/helpers_test.go new file mode 100644 index 00000000000..060c07bef45 --- /dev/null +++ b/core/services/llo/mercurytransmitter/helpers_test.go @@ -0,0 +1,47 @@ +package mercurytransmitter + +import ( + "github.com/smartcontractkit/libocr/offchainreporting2plus/ocr3types" + "github.com/smartcontractkit/libocr/offchainreporting2plus/types" + ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" + + llotypes "github.com/smartcontractkit/chainlink-common/pkg/types/llo" +) + +func makeSampleReport() ocr3types.ReportWithInfo[llotypes.ReportInfo] { + return ocr3types.ReportWithInfo[llotypes.ReportInfo]{ + Report: ocrtypes.Report{1, 2, 3}, + Info: llotypes.ReportInfo{ + LifeCycleStage: llotypes.LifeCycleStage("production"), + ReportFormat: llotypes.ReportFormatEVMPremiumLegacy, + }, + } +} + +func makeSampleConfigDigest() ocrtypes.ConfigDigest { + return ocrtypes.ConfigDigest{1, 2, 3, 4, 5, 6} +} +func makeSampleTransmission(seqNr uint64) *Transmission { + // valid with seqnr of 3 + return &Transmission{ + ServerURL: "wss://example.com/mercury", + ConfigDigest: types.ConfigDigest{0x0, 0x9, 0x57, 0xdd, 0x2f, 0x63, 0x56, 0x69, 0x34, 0xfd, 0xc2, 0xe1, 0xcd, 0xc1, 0xe, 0x3e, 0x25, 0xb9, 0x26, 0x5a, 0x16, 0x23, 0x91, 0xa6, 0x53, 0x16, 0x66, 0x59, 0x51, 0x0, 0x28, 0x7c}, + SeqNr: seqNr, + Report: ocr3types.ReportWithInfo[llotypes.ReportInfo]{ + Report: ocrtypes.Report{0x0, 0x3, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x66, 0xde, 0xf5, 0xba, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x66, 0xde, 0xf5, 0xba, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1e, 0x8e, 0x95, 0xcf, 0xb5, 0xd8, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1a, 0xd0, 0x1c, 0x67, 0xa9, 0xcf, 0xb3, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x66, 0xdf, 0x3, 0xca, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1b, 0x1c, 0x93, 0x6d, 0xa4, 0xf2, 0x17, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1b, 0x14, 0x8d, 0x9a, 0xc1, 0xd9, 0x6f, 0xc0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1b, 0x40, 0x5c, 0xcf, 0xa1, 0xbc, 0x63, 0xc0, 0x0}, + Info: llotypes.ReportInfo{ + LifeCycleStage: llotypes.LifeCycleStage("production"), + ReportFormat: llotypes.ReportFormatEVMPremiumLegacy, + }, + }, + Sigs: []types.AttributedOnchainSignature{types.AttributedOnchainSignature{Signature: []uint8{0x9d, 0xab, 0x8f, 0xa7, 0xca, 0x7, 0x62, 0x57, 0xf7, 0x11, 0x2c, 0xb7, 0xf3, 0x49, 0x37, 0x12, 0xbd, 0xe, 0x14, 0x27, 0xfc, 0x32, 0x5c, 0xec, 0xa6, 0xb9, 0x7f, 0xf9, 0xd7, 0x7b, 0xa6, 0x36, 0x30, 0x9d, 0x84, 0x29, 0xbf, 0xd4, 0xeb, 0xc5, 0xc9, 0x29, 0xef, 0xdd, 0xd3, 0x2f, 0xa6, 0x25, 0x63, 0xda, 0xd9, 0x2c, 0xa1, 0x4a, 0xba, 0x75, 0xb2, 0x85, 0x25, 0x8f, 0x2b, 0x84, 0xcd, 0x99, 0x1}, Signer: 0x1}, types.AttributedOnchainSignature{Signature: []uint8{0x9a, 0x47, 0x4a, 0x3, 0x1a, 0x95, 0xcf, 0x46, 0x10, 0xaf, 0xcc, 0x90, 0x49, 0xb2, 0xce, 0xbf, 0x63, 0xaa, 0xc7, 0x25, 0x4d, 0x2a, 0x8, 0x36, 0xda, 0xd5, 0x9f, 0x9d, 0x63, 0x69, 0x22, 0xb3, 0x36, 0xd9, 0x6e, 0xf, 0xae, 0x7b, 0xd1, 0x61, 0x59, 0xf, 0x36, 0x4a, 0x22, 0xec, 0xde, 0x45, 0x32, 0xe0, 0x5b, 0x5c, 0xe3, 0x14, 0x29, 0x4, 0x60, 0x7b, 0xce, 0xa3, 0x89, 0x6b, 0xbb, 0xe0, 0x0}, Signer: 0x3}}, + } +} + +func makeSampleTransmissions() []*Transmission { + return []*Transmission{ + makeSampleTransmission(1001), + makeSampleTransmission(1002), + makeSampleTransmission(1003), + } +} diff --git a/core/services/llo/mercurytransmitter/orm.go b/core/services/llo/mercurytransmitter/orm.go new file mode 100644 index 00000000000..ed8c8843f4c --- /dev/null +++ b/core/services/llo/mercurytransmitter/orm.go @@ -0,0 +1,205 @@ +package mercurytransmitter + +import ( + "context" + "errors" + "fmt" + "math" + + "github.com/lib/pq" + + "github.com/smartcontractkit/libocr/commontypes" + ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" + + "github.com/smartcontractkit/chainlink-common/pkg/sqlutil" +) + +// ORM is scoped to a single DON ID +type ORM interface { + DonID() uint32 + Insert(ctx context.Context, transmissions []*Transmission) error + Delete(ctx context.Context, hashes [][32]byte) error + Get(ctx context.Context, serverURL string) ([]*Transmission, error) + Prune(ctx context.Context, serverURL string, maxSize int) error + Cleanup(ctx context.Context) error +} + +type orm struct { + ds sqlutil.DataSource + donID uint32 +} + +func NewORM(ds sqlutil.DataSource, donID uint32) ORM { + return &orm{ds: ds, donID: donID} +} + +func (o *orm) DonID() uint32 { + return o.donID +} + +// Insert inserts the transmissions, ignoring duplicates +func (o *orm) Insert(ctx context.Context, transmissions []*Transmission) error { + if len(transmissions) == 0 { + return nil + } + + type transmission struct { + DonID uint32 `db:"don_id"` + ServerURL string `db:"server_url"` + ConfigDigest ocrtypes.ConfigDigest `db:"config_digest"` + SeqNr int64 `db:"seq_nr"` + Report []byte `db:"report"` + LifecycleStage string `db:"lifecycle_stage"` + ReportFormat uint32 `db:"report_format"` + Signatures [][]byte `db:"signatures"` + Signers []uint8 `db:"signers"` + TransmissionHash []byte `db:"transmission_hash"` + } + records := make([]transmission, len(transmissions)) + for i, t := range transmissions { + signatures := make([][]byte, len(t.Sigs)) + signers := make([]uint8, len(t.Sigs)) + for j, sig := range t.Sigs { + signatures[j] = sig.Signature + signers[j] = uint8(sig.Signer) + } + h := t.Hash() + if t.SeqNr > math.MaxInt64 { + // this is to appease the linter but shouldn't ever happen + return fmt.Errorf("seqNr is too large (got: %d, max: %d)", t.SeqNr, math.MaxInt64) + } + records[i] = transmission{ + DonID: o.donID, + ServerURL: t.ServerURL, + ConfigDigest: t.ConfigDigest, + SeqNr: int64(t.SeqNr), //nolint + Report: t.Report.Report, + LifecycleStage: string(t.Report.Info.LifeCycleStage), + ReportFormat: uint32(t.Report.Info.ReportFormat), + Signatures: signatures, + Signers: signers, + TransmissionHash: h[:], + } + } + + _, err := o.ds.NamedExecContext(ctx, ` + INSERT INTO llo_mercury_transmit_queue (don_id, server_url, config_digest, seq_nr, report, lifecycle_stage, report_format, signatures, signers, transmission_hash) + VALUES (:don_id, :server_url, :config_digest, :seq_nr, :report, :lifecycle_stage, :report_format, :signatures, :signers, :transmission_hash) + ON CONFLICT (transmission_hash) DO NOTHING + `, records) + + if err != nil { + return fmt.Errorf("llo orm: failed to insert transmissions: %w", err) + } + return nil +} + +// Delete deletes the given transmissions +func (o *orm) Delete(ctx context.Context, hashes [][32]byte) error { + if len(hashes) == 0 { + return nil + } + + var pqHashes pq.ByteaArray + for _, hash := range hashes { + pqHashes = append(pqHashes, hash[:]) + } + + _, err := o.ds.ExecContext(ctx, ` + DELETE FROM llo_mercury_transmit_queue + WHERE transmission_hash = ANY($1) + `, pqHashes) + if err != nil { + return fmt.Errorf("llo orm: failed to delete transmissions: %w", err) + } + return nil +} + +// Get returns all transmissions in chronologically descending order +func (o *orm) Get(ctx context.Context, serverURL string) ([]*Transmission, error) { + // The priority queue uses seqnr to sort transmissions so order by + // the same fields here for optimal insertion into the pq. + rows, err := o.ds.QueryContext(ctx, ` + SELECT config_digest, seq_nr, report, lifecycle_stage, report_format, signatures, signers + FROM llo_mercury_transmit_queue + WHERE don_id = $1 AND server_url = $2 + ORDER BY seq_nr DESC, transmission_hash DESC + `, o.donID, serverURL) + if err != nil { + return nil, fmt.Errorf("llo orm: failed to get transmissions: %w", err) + } + defer rows.Close() + + var transmissions []*Transmission + for rows.Next() { + transmission := Transmission{ + ServerURL: serverURL, + } + var digest []byte + var signatures pq.ByteaArray + var signers pq.Int32Array + + err := rows.Scan( + &digest, + &transmission.SeqNr, + &transmission.Report.Report, + &transmission.Report.Info.LifeCycleStage, + &transmission.Report.Info.ReportFormat, + &signatures, + &signers, + ) + if err != nil { + return nil, fmt.Errorf("llo orm: failed to scan transmission: %w", err) + } + transmission.ConfigDigest = ocrtypes.ConfigDigest(digest) + if len(signatures) != len(signers) { + return nil, errors.New("signatures and signers must have the same length") + } + for i, sig := range signatures { + if signers[i] > math.MaxUint8 { + // this is to appease the linter but shouldn't ever happen + return nil, fmt.Errorf("signer is too large (got: %d, max: %d)", signers[i], math.MaxUint8) + } + transmission.Sigs = append(transmission.Sigs, ocrtypes.AttributedOnchainSignature{ + Signature: sig, + Signer: commontypes.OracleID(signers[i]), //nolint + }) + } + + transmissions = append(transmissions, &transmission) + } + if err := rows.Err(); err != nil { + return nil, fmt.Errorf("llo orm: failed to scan transmissions: %w", err) + } + + return transmissions, nil +} + +// Prune keeps at most maxSize rows for the given job ID, +// deleting the oldest transactions. +func (o *orm) Prune(ctx context.Context, serverURL string, maxSize int) error { + // Prune the oldest requests by epoch and round. + _, err := o.ds.ExecContext(ctx, ` + DELETE FROM llo_mercury_transmit_queue + WHERE don_id = $1 AND server_url = $2 AND + transmission_hash NOT IN ( + SELECT transmission_hash + FROM llo_mercury_transmit_queue + WHERE don_id = $1 AND server_url = $2 + ORDER BY seq_nr DESC, transmission_hash DESC + LIMIT $3 + ) + `, o.donID, serverURL, maxSize) + if err != nil { + return fmt.Errorf("llo orm: failed to prune transmissions: %w", err) + } + return nil +} + +func (o *orm) Cleanup(ctx context.Context) error { + _, err := o.ds.ExecContext(ctx, `DELETE FROM llo_mercury_transmit_queue WHERE don_id = $1`, o.donID) + if err != nil { + return fmt.Errorf("llo orm: failed to cleanup transmissions: %w", err) + } + return nil +} diff --git a/core/services/llo/mercurytransmitter/orm_test.go b/core/services/llo/mercurytransmitter/orm_test.go new file mode 100644 index 00000000000..73d5760a9a3 --- /dev/null +++ b/core/services/llo/mercurytransmitter/orm_test.go @@ -0,0 +1,89 @@ +package mercurytransmitter + +import ( + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/pgtest" +) + +var ( + sURL = "wss://example.com/mercury" + sURL2 = "wss://mercuryserver.test" + sURL3 = "wss://mercuryserver.example/foo" +) + +func TestORM(t *testing.T) { + ctx := testutils.Context(t) + db := pgtest.NewSqlxDB(t) + + donID := uint32(654321) + orm := NewORM(db, donID) + + t.Run("DonID", func(t *testing.T) { + assert.Equal(t, donID, orm.DonID()) + }) + + transmissions := makeSampleTransmissions()[:2] + + t.Run("Insert", func(t *testing.T) { + err := orm.Insert(ctx, transmissions) + require.NoError(t, err) + }) + t.Run("Get", func(t *testing.T) { + result, err := orm.Get(ctx, sURL) + require.NoError(t, err) + + assert.ElementsMatch(t, transmissions, result) + + result, err = orm.Get(ctx, "other server url") + require.NoError(t, err) + + assert.Empty(t, result) + }) + t.Run("Delete", func(t *testing.T) { + err := orm.Delete(ctx, [][32]byte{transmissions[0].Hash()}) + require.NoError(t, err) + + result, err := orm.Get(ctx, sURL) + require.NoError(t, err) + + require.Len(t, result, 1) + assert.Equal(t, transmissions[1], result[0]) + + err = orm.Delete(ctx, [][32]byte{transmissions[1].Hash()}) + require.NoError(t, err) + + result, err = orm.Get(ctx, sURL) + require.NoError(t, err) + require.Len(t, result, 0) + }) + t.Run("Prune", func(t *testing.T) { + err := orm.Insert(ctx, transmissions) + require.NoError(t, err) + + err = orm.Prune(ctx, sURL, 1) + require.NoError(t, err) + + result, err := orm.Get(ctx, sURL) + require.NoError(t, err) + require.Len(t, result, 1) + assert.Equal(t, transmissions[1], result[0]) + + err = orm.Prune(ctx, sURL, 1) + require.NoError(t, err) + result, err = orm.Get(ctx, sURL) + require.NoError(t, err) + require.Len(t, result, 1) + assert.Equal(t, transmissions[1], result[0]) + + err = orm.Prune(ctx, sURL, 0) + require.NoError(t, err) + result, err = orm.Get(ctx, sURL) + require.NoError(t, err) + require.Len(t, result, 0) + }) +} diff --git a/core/services/llo/mercurytransmitter/persistence_manager.go b/core/services/llo/mercurytransmitter/persistence_manager.go new file mode 100644 index 00000000000..eb36a7d1b80 --- /dev/null +++ b/core/services/llo/mercurytransmitter/persistence_manager.go @@ -0,0 +1,143 @@ +package mercurytransmitter + +import ( + "context" + "sync" + "time" + + "github.com/smartcontractkit/chainlink-common/pkg/logger" + "github.com/smartcontractkit/chainlink-common/pkg/services" + "github.com/smartcontractkit/chainlink-common/pkg/sqlutil" +) + +var ( + flushDeletesFrequency = time.Second + pruneFrequency = time.Hour +) + +// persistenceManager scopes an ORM to a single serverURL and handles cleanup +// and asynchronous deletion +type persistenceManager struct { + lggr logger.Logger + orm ORM + serverURL string + + once services.StateMachine + stopCh services.StopChan + wg sync.WaitGroup + + deleteMu sync.Mutex + deleteQueue [][32]byte + + maxTransmitQueueSize int + flushDeletesFrequency time.Duration + pruneFrequency time.Duration +} + +func NewPersistenceManager(lggr logger.Logger, orm ORM, serverURL string, maxTransmitQueueSize int, flushDeletesFrequency, pruneFrequency time.Duration) *persistenceManager { + return &persistenceManager{ + orm: orm, + lggr: logger.Sugared(lggr).Named("LLOPersistenceManager").With("serverURL", serverURL), + serverURL: serverURL, + stopCh: make(services.StopChan), + maxTransmitQueueSize: maxTransmitQueueSize, + flushDeletesFrequency: flushDeletesFrequency, + pruneFrequency: pruneFrequency, + } +} + +func (pm *persistenceManager) Start(ctx context.Context) error { + return pm.once.StartOnce("LLOMercuryPersistenceManager", func() error { + pm.wg.Add(2) + go pm.runFlushDeletesLoop() + go pm.runPruneLoop() + return nil + }) +} + +func (pm *persistenceManager) Close() error { + return pm.once.StopOnce("LLOMercuryPersistenceManager", func() error { + close(pm.stopCh) + pm.wg.Wait() + return nil + }) +} + +func (pm *persistenceManager) DonID() uint32 { + return pm.orm.DonID() +} + +func (pm *persistenceManager) AsyncDelete(hash [32]byte) { + pm.addToDeleteQueue(hash) +} + +func (pm *persistenceManager) Load(ctx context.Context) ([]*Transmission, error) { + return pm.orm.Get(ctx, pm.serverURL) +} + +func (pm *persistenceManager) runFlushDeletesLoop() { + defer pm.wg.Done() + + ctx, cancel := pm.stopCh.Ctx(context.Background()) + defer cancel() + + ticker := services.NewTicker(pm.flushDeletesFrequency) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + queuedTransmissionHashes := pm.resetDeleteQueue() + if len(queuedTransmissionHashes) == 0 { + continue + } + if err := pm.orm.Delete(ctx, queuedTransmissionHashes); err != nil { + pm.lggr.Errorw("Failed to delete queued transmit requests", "err", err) + pm.addToDeleteQueue(queuedTransmissionHashes...) + } else { + pm.lggr.Debugw("Deleted queued transmit requests") + } + } + } +} + +func (pm *persistenceManager) runPruneLoop() { + defer pm.wg.Done() + + ctx, cancel := pm.stopCh.NewCtx() + defer cancel() + + ticker := services.NewTicker(pm.pruneFrequency) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + func(ctx context.Context) { + ctx, cancelPrune := context.WithTimeout(sqlutil.WithoutDefaultTimeout(ctx), time.Minute) + defer cancelPrune() + if err := pm.orm.Prune(ctx, pm.serverURL, pm.maxTransmitQueueSize); err != nil { + pm.lggr.Errorw("Failed to prune transmit requests table", "err", err) + } else { + pm.lggr.Debugw("Pruned transmit requests table") + } + }(ctx) + } + } +} + +func (pm *persistenceManager) addToDeleteQueue(hashes ...[32]byte) { + pm.deleteMu.Lock() + defer pm.deleteMu.Unlock() + pm.deleteQueue = append(pm.deleteQueue, hashes...) +} + +func (pm *persistenceManager) resetDeleteQueue() [][32]byte { + pm.deleteMu.Lock() + defer pm.deleteMu.Unlock() + queue := pm.deleteQueue + pm.deleteQueue = nil + return queue +} diff --git a/core/services/llo/mercurytransmitter/persistence_manager_test.go b/core/services/llo/mercurytransmitter/persistence_manager_test.go new file mode 100644 index 00000000000..b05de429ade --- /dev/null +++ b/core/services/llo/mercurytransmitter/persistence_manager_test.go @@ -0,0 +1,127 @@ +package mercurytransmitter + +import ( + "testing" + "time" + + "github.com/jmoiron/sqlx" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "go.uber.org/zap/zapcore" + "go.uber.org/zap/zaptest/observer" + + "github.com/smartcontractkit/chainlink-common/pkg/services/servicetest" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/pgtest" + "github.com/smartcontractkit/chainlink/v2/core/logger" +) + +func bootstrapPersistenceManager(t *testing.T, donID uint32, db *sqlx.DB) (*persistenceManager, *observer.ObservedLogs) { + t.Helper() + lggr, observedLogs := logger.TestLoggerObserved(t, zapcore.DebugLevel) + orm := NewORM(db, donID) + return NewPersistenceManager(lggr, orm, "wss://example.com/mercury", 2, 5*time.Millisecond, 5*time.Millisecond), observedLogs +} + +func TestPersistenceManager(t *testing.T) { + donID1 := uint32(1234) + donID2 := uint32(2345) + + ctx := testutils.Context(t) + db := pgtest.NewSqlxDB(t) + pm, _ := bootstrapPersistenceManager(t, donID1, db) + + transmissions := makeSampleTransmissions() + err := pm.orm.Insert(ctx, transmissions) + require.NoError(t, err) + + result, err := pm.Load(ctx) + require.NoError(t, err) + assert.ElementsMatch(t, transmissions, result) + + err = pm.orm.Delete(ctx, [][32]byte{transmissions[0].Hash()}) + require.NoError(t, err) + + t.Run("scopes load to only transmissions with matching don ID", func(t *testing.T) { + pm2, _ := bootstrapPersistenceManager(t, donID2, db) + result, err = pm2.Load(ctx) + require.NoError(t, err) + + assert.Len(t, result, 0) + }) +} + +func TestPersistenceManagerAsyncDelete(t *testing.T) { + ctx := testutils.Context(t) + donID := uint32(1234) + db := pgtest.NewSqlxDB(t) + pm, observedLogs := bootstrapPersistenceManager(t, donID, db) + + transmissions := makeSampleTransmissions() + err := pm.orm.Insert(ctx, transmissions) + require.NoError(t, err) + + servicetest.Run(t, pm) + + pm.AsyncDelete(transmissions[0].Hash()) + + // Wait for next poll. + observedLogs.TakeAll() + testutils.WaitForLogMessage(t, observedLogs, "Deleted queued transmit requests") + + result, err := pm.Load(ctx) + require.NoError(t, err) + require.Len(t, result, 2) + assert.ElementsMatch(t, transmissions[1:], result) +} + +func TestPersistenceManagerPrune(t *testing.T) { + donID1 := uint32(123456) + donID2 := uint32(654321) + db := pgtest.NewSqlxDB(t) + + ctx := testutils.Context(t) + + transmissions := make([]*Transmission, 45) + for i := uint64(0); i < 45; i++ { + transmissions[i] = makeSampleTransmission(i) + } + + pm, _ := bootstrapPersistenceManager(t, donID1, db) + err := pm.orm.Insert(ctx, transmissions[:25]) + require.NoError(t, err) + + pm2, _ := bootstrapPersistenceManager(t, donID2, db) + err = pm2.orm.Insert(ctx, transmissions[25:]) + require.NoError(t, err) + + pm, observedLogs := bootstrapPersistenceManager(t, donID1, db) + + err = pm.Start(ctx) + require.NoError(t, err) + + // Wait for next poll. + observedLogs.TakeAll() + testutils.WaitForLogMessage(t, observedLogs, "Pruned transmit requests table") + + result, err := pm.Load(ctx) + require.NoError(t, err) + require.ElementsMatch(t, transmissions[23:25], result) + + // Test pruning stops after Close. + err = pm.Close() + require.NoError(t, err) + + err = pm.orm.Insert(ctx, transmissions) + require.NoError(t, err) + + result, err = pm.Load(ctx) + require.NoError(t, err) + require.Len(t, result, 25) + + t.Run("prune was scoped to don ID", func(t *testing.T) { + result, err = pm2.Load(ctx) + require.NoError(t, err) + assert.Len(t, result, 20) + }) +} diff --git a/core/services/llo/mercurytransmitter/queue.go b/core/services/llo/mercurytransmitter/queue.go new file mode 100644 index 00000000000..a5a606c5b32 --- /dev/null +++ b/core/services/llo/mercurytransmitter/queue.go @@ -0,0 +1,250 @@ +package mercurytransmitter + +import ( + "context" + "errors" + "fmt" + "sync" + "time" + + heap "github.com/esote/minmaxheap" + "github.com/prometheus/client_golang/prometheus" + "github.com/prometheus/client_golang/prometheus/promauto" + + "github.com/smartcontractkit/chainlink-common/pkg/logger" + "github.com/smartcontractkit/chainlink-common/pkg/services" +) + +type asyncDeleter interface { + AsyncDelete(hash [32]byte) + DonID() uint32 +} + +var _ services.Service = (*transmitQueue)(nil) + +var transmitQueueLoad = promauto.NewGaugeVec(prometheus.GaugeOpts{ + Name: "llo_transmit_queue_load", + Help: "Current count of items in the transmit queue", +}, + []string{"donID", "serverURL", "capacity"}, +) + +// Prometheus' default interval is 15s, set this to under 7.5s to avoid +// aliasing (see: https://en.wikipedia.org/wiki/Nyquist_frequency) +const promInterval = 6500 * time.Millisecond + +// TransmitQueue is the high-level package that everything outside of this file should be using +// It stores pending transmissions, yielding the latest (highest priority) first to the caller +type transmitQueue struct { + services.StateMachine + + cond sync.Cond + lggr logger.SugaredLogger + asyncDeleter asyncDeleter + mu *sync.RWMutex + + pq *priorityQueue + maxlen int + closed bool + + // monitor loop + stopMonitor func() + transmitQueueLoad prometheus.Gauge +} + +type TransmitQueue interface { + services.Service + + BlockingPop() (t *Transmission) + Push(t *Transmission) (ok bool) + Init(ts []*Transmission) + IsEmpty() bool +} + +// maxlen controls how many items will be stored in the queue +// 0 means unlimited - be careful, this can cause memory leaks +func NewTransmitQueue(lggr logger.Logger, serverURL string, maxlen int, asyncDeleter asyncDeleter) TransmitQueue { + mu := new(sync.RWMutex) + return &transmitQueue{ + services.StateMachine{}, + sync.Cond{L: mu}, + logger.Sugared(lggr).Named("TransmitQueue"), + asyncDeleter, + mu, + nil, // pq needs to be initialized by calling tq.Init before use + maxlen, + false, + nil, + transmitQueueLoad.WithLabelValues(fmt.Sprintf("%d", asyncDeleter.DonID()), serverURL, fmt.Sprintf("%d", maxlen)), + } +} + +func (tq *transmitQueue) Init(ts []*Transmission) { + pq := priorityQueue(ts) + heap.Init(&pq) // ensure the heap is ordered + tq.pq = &pq +} + +func (tq *transmitQueue) Push(t *Transmission) (ok bool) { + tq.cond.L.Lock() + defer tq.cond.L.Unlock() + + if tq.closed { + return false + } + + if tq.maxlen != 0 && tq.pq.Len() == tq.maxlen { + // evict oldest entry to make room + tq.lggr.Criticalf("Transmit queue is full; dropping oldest transmission (reached max length of %d)", tq.maxlen) + removed := heap.PopMax(tq.pq) + if removed, ok := removed.(*Transmission); ok { + tq.asyncDeleter.AsyncDelete(removed.Hash()) + } + } + + heap.Push(tq.pq, t) + tq.cond.Signal() + + return true +} + +// BlockingPop will block until at least one item is in the heap, and then return it +// If the queue is closed, it will immediately return nil +func (tq *transmitQueue) BlockingPop() (t *Transmission) { + tq.cond.L.Lock() + defer tq.cond.L.Unlock() + if tq.closed { + return nil + } + for t = tq.pop(); t == nil; t = tq.pop() { + tq.cond.Wait() + if tq.closed { + return nil + } + } + return t +} + +func (tq *transmitQueue) IsEmpty() bool { + tq.mu.RLock() + defer tq.mu.RUnlock() + return tq.pq.Len() == 0 +} + +func (tq *transmitQueue) Start(context.Context) error { + return tq.StartOnce("TransmitQueue", func() error { + t := services.NewTicker(promInterval) + wg := new(sync.WaitGroup) + chStop := make(chan struct{}) + tq.stopMonitor = func() { + t.Stop() + close(chStop) + wg.Wait() + } + wg.Add(1) + go tq.monitorLoop(t.C, chStop, wg) + return nil + }) +} + +func (tq *transmitQueue) Close() error { + return tq.StopOnce("TransmitQueue", func() error { + tq.cond.L.Lock() + tq.closed = true + tq.cond.L.Unlock() + tq.cond.Broadcast() + tq.stopMonitor() + return nil + }) +} + +func (tq *transmitQueue) monitorLoop(c <-chan time.Time, chStop <-chan struct{}, wg *sync.WaitGroup) { + defer wg.Done() + + for { + select { + case <-c: + tq.report() + case <-chStop: + return + } + } +} + +func (tq *transmitQueue) report() { + tq.mu.RLock() + length := tq.pq.Len() + tq.mu.RUnlock() + tq.transmitQueueLoad.Set(float64(length)) +} + +func (tq *transmitQueue) Ready() error { + return nil +} +func (tq *transmitQueue) Name() string { return tq.lggr.Name() } +func (tq *transmitQueue) HealthReport() map[string]error { + report := map[string]error{tq.Name(): errors.Join( + tq.status(), + )} + return report +} + +func (tq *transmitQueue) status() (merr error) { + tq.mu.RLock() + length := tq.pq.Len() + closed := tq.closed + tq.mu.RUnlock() + if tq.maxlen != 0 && length > (tq.maxlen/2) { + merr = errors.Join(merr, fmt.Errorf("transmit priority queue is greater than 50%% full (%d/%d)", length, tq.maxlen)) + } + if closed { + merr = errors.New("transmit queue is closed") + } + return merr +} + +// pop latest Transmission from the heap +// Not thread-safe +func (tq *transmitQueue) pop() *Transmission { + if tq.pq.Len() == 0 { + return nil + } + return heap.Pop(tq.pq).(*Transmission) +} + +// HEAP +// Adapted from https://pkg.go.dev/container/heap#example-package-PriorityQueue + +// WARNING: None of these methods are thread-safe, caller must synchronize + +var _ heap.Interface = &priorityQueue{} + +type priorityQueue []*Transmission + +func (pq priorityQueue) Len() int { return len(pq) } + +func (pq priorityQueue) Less(i, j int) bool { + // We want Pop to give us the latest round, so we use greater than here + // i.e. a later seqNr is "less" than an earlier one + return pq[i].SeqNr > pq[j].SeqNr +} + +func (pq priorityQueue) Swap(i, j int) { + pq[i], pq[j] = pq[j], pq[i] +} + +func (pq *priorityQueue) Pop() any { + n := len(*pq) + if n == 0 { + return nil + } + old := *pq + item := old[n-1] + old[n-1] = nil // avoid memory leak + *pq = old[0 : n-1] + return item +} + +func (pq *priorityQueue) Push(x any) { + *pq = append(*pq, x.(*Transmission)) +} diff --git a/core/services/llo/mercurytransmitter/queue_test.go b/core/services/llo/mercurytransmitter/queue_test.go new file mode 100644 index 00000000000..d19d140d6be --- /dev/null +++ b/core/services/llo/mercurytransmitter/queue_test.go @@ -0,0 +1,105 @@ +package mercurytransmitter + +import ( + "sync" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "go.uber.org/zap/zapcore" + + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" + "github.com/smartcontractkit/chainlink/v2/core/logger" +) + +var _ asyncDeleter = &mockAsyncDeleter{} + +type mockAsyncDeleter struct { + donID uint32 + hashes [][32]byte +} + +func (m *mockAsyncDeleter) AsyncDelete(hash [32]byte) { + m.hashes = append(m.hashes, hash) +} +func (m *mockAsyncDeleter) DonID() uint32 { + return m.donID +} + +func Test_Queue(t *testing.T) { + t.Parallel() + lggr, observedLogs := logger.TestLoggerObserved(t, zapcore.ErrorLevel) + testTransmissions := makeSampleTransmissions() + deleter := &mockAsyncDeleter{} + transmitQueue := NewTransmitQueue(lggr, sURL, 7, deleter) + transmitQueue.Init([]*Transmission{}) + + t.Run("successfully add transmissions to transmit queue", func(t *testing.T) { + for _, tt := range testTransmissions { + ok := transmitQueue.Push(tt) + require.True(t, ok) + } + report := transmitQueue.HealthReport() + assert.Nil(t, report[transmitQueue.Name()]) + }) + + t.Run("transmit queue is more than 50% full", func(t *testing.T) { + transmitQueue.Push(testTransmissions[2]) + report := transmitQueue.HealthReport() + assert.Equal(t, report[transmitQueue.Name()].Error(), "transmit priority queue is greater than 50% full (4/7)") + }) + + t.Run("transmit queue pops the highest priority transmission", func(t *testing.T) { + tr := transmitQueue.BlockingPop() + assert.Equal(t, testTransmissions[2], tr) + }) + + t.Run("transmit queue is full and evicts the oldest transmission", func(t *testing.T) { + // add 5 more transmissions to overflow the queue by 1 + for i := 0; i < 5; i++ { + transmitQueue.Push(testTransmissions[1]) + } + + // expecting testTransmissions[0] to get evicted and not present in the queue anymore + testutils.WaitForLogMessage(t, observedLogs, "Transmit queue is full; dropping oldest transmission (reached max length of 7)") + var transmissions []*Transmission + for i := 0; i < 7; i++ { + tr := transmitQueue.BlockingPop() + transmissions = append(transmissions, tr) + } + + assert.NotContains(t, transmissions, testTransmissions[0]) + require.Len(t, deleter.hashes, 1) + assert.Equal(t, testTransmissions[0].Hash(), deleter.hashes[0]) + }) + + t.Run("transmit queue blocks when empty and resumes when tranmission available", func(t *testing.T) { + assert.True(t, transmitQueue.IsEmpty()) + + var wg sync.WaitGroup + wg.Add(2) + go func() { + defer wg.Done() + tr := transmitQueue.BlockingPop() + assert.Equal(t, tr, testTransmissions[0]) + }() + go func() { + defer wg.Done() + transmitQueue.Push(testTransmissions[0]) + }() + wg.Wait() + }) + + t.Run("initializes transmissions", func(t *testing.T) { + expected := makeSampleTransmission(1) + transmissions := []*Transmission{ + expected, + } + transmitQueue := NewTransmitQueue(lggr, sURL, 7, deleter) + transmitQueue.Init(transmissions) + + transmission := transmitQueue.BlockingPop() + assert.Equal(t, expected, transmission) + assert.True(t, transmitQueue.IsEmpty()) + }) +} diff --git a/core/services/llo/mercurytransmitter/server.go b/core/services/llo/mercurytransmitter/server.go new file mode 100644 index 00000000000..d025e65efa6 --- /dev/null +++ b/core/services/llo/mercurytransmitter/server.go @@ -0,0 +1,240 @@ +package mercurytransmitter + +import ( + "context" + "fmt" + "sync" + "time" + + "github.com/jpillora/backoff" + "github.com/prometheus/client_golang/prometheus" + "github.com/prometheus/client_golang/prometheus/promauto" + + commonconfig "github.com/smartcontractkit/chainlink-common/pkg/config" + "github.com/smartcontractkit/chainlink-common/pkg/logger" + "github.com/smartcontractkit/chainlink-common/pkg/services" + llotypes "github.com/smartcontractkit/chainlink-common/pkg/types/llo" + + "github.com/smartcontractkit/chainlink/v2/core/services/llo/evm" + "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury/wsrpc" + "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury/wsrpc/pb" + "github.com/smartcontractkit/chainlink/v2/core/utils" +) + +var ( + transmitQueueDeleteErrorCount = promauto.NewCounterVec(prometheus.CounterOpts{ + Name: "llo_mercury_transmit_queue_delete_error_count", + Help: "Running count of DB errors when trying to delete an item from the queue DB", + }, + []string{"donID", "serverURL"}, + ) + transmitQueueInsertErrorCount = promauto.NewCounterVec(prometheus.CounterOpts{ + Name: "llo_mercury_transmit_queue_insert_error_count", + Help: "Running count of DB errors when trying to insert an item into the queue DB", + }, + []string{"donID", "serverURL"}, + ) + transmitQueuePushErrorCount = promauto.NewCounterVec(prometheus.CounterOpts{ + Name: "llo_mercury_transmit_queue_push_error_count", + Help: "Running count of DB errors when trying to push an item onto the queue", + }, + []string{"donID", "serverURL"}, + ) + transmitServerErrorCount = promauto.NewCounterVec(prometheus.CounterOpts{ + Name: "llo_mercury_transmit_server_error_count", + Help: "Number of errored transmissions that failed due to an error returned by the mercury server", + }, + []string{"donID", "serverURL", "code"}, + ) +) + +// A server handles the queue for a given mercury server + +type server struct { + lggr logger.SugaredLogger + + transmitTimeout time.Duration + + c wsrpc.Client + pm *persistenceManager + q TransmitQueue + + deleteQueue chan [32]byte + + url string + + transmitSuccessCount prometheus.Counter + transmitDuplicateCount prometheus.Counter + transmitConnectionErrorCount prometheus.Counter + transmitQueueDeleteErrorCount prometheus.Counter + transmitQueueInsertErrorCount prometheus.Counter + transmitQueuePushErrorCount prometheus.Counter +} + +type QueueConfig interface { + TransmitQueueMaxSize() uint32 + TransmitTimeout() commonconfig.Duration +} + +func newServer(lggr logger.Logger, cfg QueueConfig, client wsrpc.Client, orm ORM, serverURL string) *server { + pm := NewPersistenceManager(lggr, orm, serverURL, int(cfg.TransmitQueueMaxSize()), flushDeletesFrequency, pruneFrequency) + donIDStr := fmt.Sprintf("%d", pm.DonID()) + return &server{ + logger.Sugared(lggr), + cfg.TransmitTimeout().Duration(), + client, + pm, + NewTransmitQueue(lggr, serverURL, int(cfg.TransmitQueueMaxSize()), pm), + make(chan [32]byte, int(cfg.TransmitQueueMaxSize())), + serverURL, + transmitSuccessCount.WithLabelValues(donIDStr, serverURL), + transmitDuplicateCount.WithLabelValues(donIDStr, serverURL), + transmitConnectionErrorCount.WithLabelValues(donIDStr, serverURL), + transmitQueueDeleteErrorCount.WithLabelValues(donIDStr, serverURL), + transmitQueueInsertErrorCount.WithLabelValues(donIDStr, serverURL), + transmitQueuePushErrorCount.WithLabelValues(donIDStr, serverURL), + } +} + +func (s *server) HealthReport() map[string]error { + report := map[string]error{} + services.CopyHealth(report, s.c.HealthReport()) + services.CopyHealth(report, s.q.HealthReport()) + return report +} + +func (s *server) runDeleteQueueLoop(stopCh services.StopChan, wg *sync.WaitGroup) { + defer wg.Done() + runloopCtx, cancel := stopCh.Ctx(context.Background()) + defer cancel() + + // Exponential backoff for very rarely occurring errors (DB disconnect etc) + b := backoff.Backoff{ + Min: 1 * time.Second, + Max: 120 * time.Second, + Factor: 2, + Jitter: true, + } + + for { + select { + case hash := <-s.deleteQueue: + for { + if err := s.pm.orm.Delete(runloopCtx, [][32]byte{hash}); err != nil { + s.lggr.Errorw("Failed to delete transmission record", "err", err, "transmissionHash", hash) + s.transmitQueueDeleteErrorCount.Inc() + select { + case <-time.After(b.Duration()): + // Wait a backoff duration before trying to delete again + continue + case <-stopCh: + // abort and return immediately on stop even if items remain in queue + return + } + } + break + } + // success + b.Reset() + case <-stopCh: + // abort and return immediately on stop even if items remain in queue + return + } + } +} + +func (s *server) runQueueLoop(stopCh services.StopChan, wg *sync.WaitGroup, donIDStr string) { + defer wg.Done() + // Exponential backoff with very short retry interval (since latency is a priority) + // 5ms, 10ms, 20ms, 40ms etc + b := backoff.Backoff{ + Min: 5 * time.Millisecond, + Max: 1 * time.Second, + Factor: 2, + Jitter: true, + } + runloopCtx, cancel := stopCh.Ctx(context.Background()) + defer cancel() + for { + t := s.q.BlockingPop() + if t == nil { + // queue was closed + return + } + ctx, cancel := context.WithTimeout(runloopCtx, utils.WithJitter(s.transmitTimeout)) + res, err := s.transmit(ctx, t) + cancel() + if runloopCtx.Err() != nil { + // runloop context is only canceled on transmitter close so we can + // exit the runloop here + return + } else if err != nil { + s.transmitConnectionErrorCount.Inc() + s.lggr.Errorw("Transmit report failed", "err", err, "transmission", t) + if ok := s.q.Push(t); !ok { + s.lggr.Error("Failed to push report to transmit queue; queue is closed") + return + } + // Wait a backoff duration before pulling the most recent transmission + // the heap + select { + case <-time.After(b.Duration()): + continue + case <-stopCh: + return + } + } + + b.Reset() + if res.Error == "" { + s.transmitSuccessCount.Inc() + s.lggr.Debugw("Transmit report success", "transmission", t, "response", res) + } else { + // We don't need to retry here because the mercury server + // has confirmed it received the report. We only need to retry + // on networking/unknown errors + switch res.Code { + case DuplicateReport: + s.transmitSuccessCount.Inc() + s.transmitDuplicateCount.Inc() + s.lggr.Debugw("Transmit report success; duplicate report", "transmission", t, "response", res) + default: + transmitServerErrorCount.WithLabelValues(donIDStr, s.url, fmt.Sprintf("%d", res.Code)).Inc() + s.lggr.Errorw("Transmit report failed; mercury server returned error", "response", res, "transmission", t, "err", res.Error, "code", res.Code) + } + } + + select { + case s.deleteQueue <- t.Hash(): + default: + s.lggr.Criticalw("Delete queue is full", "transmission", t) + } + } +} + +func (s *server) transmit(ctx context.Context, t *Transmission) (*pb.TransmitResponse, error) { + var payload []byte + var err error + + switch t.Report.Info.ReportFormat { + case llotypes.ReportFormatJSON: + // TODO: exactly how to handle JSON here? + // https://smartcontract-it.atlassian.net/browse/MERC-3659 + fallthrough + case llotypes.ReportFormatEVMPremiumLegacy: + payload, err = evm.ReportCodecPremiumLegacy{}.Pack(t.ConfigDigest, t.SeqNr, t.Report.Report, t.Sigs) + default: + return nil, fmt.Errorf("Transmit failed; unsupported report format: %q", t.Report.Info.ReportFormat) + } + + if err != nil { + return nil, fmt.Errorf("Transmit: encode failed; %w", err) + } + + req := &pb.TransmitRequest{ + Payload: payload, + ReportFormat: uint32(t.Report.Info.ReportFormat), + } + + return s.c.Transmit(ctx, req) +} diff --git a/core/services/llo/mercurytransmitter/transmitter.go b/core/services/llo/mercurytransmitter/transmitter.go new file mode 100644 index 00000000000..dc032a054dc --- /dev/null +++ b/core/services/llo/mercurytransmitter/transmitter.go @@ -0,0 +1,254 @@ +package mercurytransmitter + +import ( + "context" + "crypto/ed25519" + "crypto/sha256" + "encoding/binary" + "errors" + "fmt" + "io" + "sync" + + "github.com/prometheus/client_golang/prometheus" + "github.com/prometheus/client_golang/prometheus/promauto" + "golang.org/x/sync/errgroup" + + "github.com/smartcontractkit/libocr/offchainreporting2plus/ocr3types" + "github.com/smartcontractkit/libocr/offchainreporting2plus/types" + ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" + + commonconfig "github.com/smartcontractkit/chainlink-common/pkg/config" + "github.com/smartcontractkit/chainlink-common/pkg/logger" + "github.com/smartcontractkit/chainlink-common/pkg/services" + llotypes "github.com/smartcontractkit/chainlink-common/pkg/types/llo" + + "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury/wsrpc" +) + +const ( + // Mercury server error codes + DuplicateReport = 2 +) + +var ( + transmitSuccessCount = promauto.NewCounterVec(prometheus.CounterOpts{ + Name: "llo_mercury_transmit_success_count", + Help: "Number of successful transmissions (duplicates are counted as success)", + }, + []string{"donID", "serverURL"}, + ) + transmitDuplicateCount = promauto.NewCounterVec(prometheus.CounterOpts{ + Name: "llo_mercury_transmit_duplicate_count", + Help: "Number of transmissions where the server told us it was a duplicate", + }, + []string{"donID", "serverURL"}, + ) + transmitConnectionErrorCount = promauto.NewCounterVec(prometheus.CounterOpts{ + Name: "llo_mercury_transmit_connection_error_count", + Help: "Number of errored transmissions that failed due to problem with the connection", + }, + []string{"donID", "serverURL"}, + ) +) + +type Transmission struct { + ServerURL string + ConfigDigest types.ConfigDigest + SeqNr uint64 + Report ocr3types.ReportWithInfo[llotypes.ReportInfo] + Sigs []types.AttributedOnchainSignature +} + +// Hash takes sha256 hash of all fields +func (t Transmission) Hash() [32]byte { + h := sha256.New() + h.Write([]byte(t.ServerURL)) + h.Write(t.ConfigDigest[:]) + if err := binary.Write(h, binary.BigEndian, t.SeqNr); err != nil { + // This should never happen + panic(err) + } + h.Write(t.Report.Report) + h.Write([]byte(t.Report.Info.LifeCycleStage)) + if err := binary.Write(h, binary.BigEndian, t.Report.Info.ReportFormat); err != nil { + // This should never happen + panic(err) + } + for _, sig := range t.Sigs { + h.Write(sig.Signature) + if err := binary.Write(h, binary.BigEndian, sig.Signer); err != nil { + // This should never happen + panic(err) + } + } + var result [32]byte + h.Sum(result[:0]) + return result +} + +type Transmitter interface { + llotypes.Transmitter + services.Service +} + +var _ Transmitter = (*transmitter)(nil) + +type Config interface { + TransmitQueueMaxSize() uint32 + TransmitTimeout() commonconfig.Duration +} + +type transmitter struct { + services.StateMachine + lggr logger.SugaredLogger + cfg Config + + orm ORM + servers map[string]*server + + donID uint32 + fromAccount string + + stopCh services.StopChan + wg *sync.WaitGroup +} + +type Opts struct { + Lggr logger.Logger + Cfg Config + Clients map[string]wsrpc.Client + FromAccount ed25519.PublicKey + DonID uint32 + ORM ORM +} + +func New(opts Opts) Transmitter { + return newTransmitter(opts) +} + +func newTransmitter(opts Opts) *transmitter { + sugared := logger.Sugared(opts.Lggr).Named("LLOMercuryTransmitter") + servers := make(map[string]*server, len(opts.Clients)) + for serverURL, client := range opts.Clients { + sLggr := sugared.Named(serverURL).With("serverURL", serverURL) + servers[serverURL] = newServer(sLggr, opts.Cfg, client, opts.ORM, serverURL) + } + return &transmitter{ + services.StateMachine{}, + sugared.Named("LLOMercuryTransmitter").With("donID", opts.ORM.DonID()), + opts.Cfg, + opts.ORM, + servers, + opts.DonID, + fmt.Sprintf("%x", opts.FromAccount), + make(services.StopChan), + &sync.WaitGroup{}, + } +} + +func (mt *transmitter) Start(ctx context.Context) (err error) { + return mt.StartOnce("LLOMercuryTransmitter", func() error { + mt.lggr.Debugw("Loading transmit requests from database") + + { + var startClosers []services.StartClose + for _, s := range mt.servers { + transmissions, err := s.pm.Load(ctx) + if err != nil { + return err + } + s.q.Init(transmissions) + // starting pm after loading from it is fine because it simply spawns some garbage collection/prune goroutines + startClosers = append(startClosers, s.c, s.q, s.pm) + + mt.wg.Add(2) + go s.runDeleteQueueLoop(mt.stopCh, mt.wg) + go s.runQueueLoop(mt.stopCh, mt.wg, fmt.Sprintf("%d", mt.donID)) + } + if err := (&services.MultiStart{}).Start(ctx, startClosers...); err != nil { + return err + } + } + + return nil + }) +} + +func (mt *transmitter) Close() error { + return mt.StopOnce("LLOMercuryTransmitter", func() error { + // Drain all the queues first + var qs []io.Closer + for _, s := range mt.servers { + qs = append(qs, s.q) + } + if err := services.CloseAll(qs...); err != nil { + return err + } + + close(mt.stopCh) + mt.wg.Wait() + + // Close all the persistence managers + // Close all the clients + var closers []io.Closer + for _, s := range mt.servers { + closers = append(closers, s.pm) + closers = append(closers, s.c) + } + return services.CloseAll(closers...) + }) +} + +func (mt *transmitter) Name() string { return mt.lggr.Name() } + +func (mt *transmitter) HealthReport() map[string]error { + report := map[string]error{mt.Name(): mt.Healthy()} + for _, s := range mt.servers { + services.CopyHealth(report, s.HealthReport()) + } + return report +} + +// Transmit enqueues the report for transmission to the Mercury servers +func (mt *transmitter) Transmit( + ctx context.Context, + digest types.ConfigDigest, + seqNr uint64, + report ocr3types.ReportWithInfo[llotypes.ReportInfo], + sigs []types.AttributedOnchainSignature) error { + transmissions := make([]*Transmission, 0, len(mt.servers)) + for serverURL := range mt.servers { + transmissions = append(transmissions, &Transmission{ + ServerURL: serverURL, + ConfigDigest: digest, + SeqNr: seqNr, + Report: report, + Sigs: sigs, + }) + } + if err := mt.orm.Insert(ctx, transmissions); err != nil { + return err + } + + g := new(errgroup.Group) + for i := range transmissions { + t := transmissions[i] + mt.lggr.Debugw("LLOMercuryTransmit", "digest", digest.Hex(), "seqNr", seqNr, "reportFormat", report.Info.ReportFormat, "reportLifeCycleStage", report.Info.LifeCycleStage, "transmissionHash", t.Hash()) + g.Go(func() error { + s := mt.servers[t.ServerURL] + if ok := s.q.Push(t); !ok { + s.transmitQueuePushErrorCount.Inc() + return errors.New("transmit queue is closed") + } + return nil + }) + } + + return g.Wait() +} + +// FromAccount returns the stringified (hex) CSA public key +func (mt *transmitter) FromAccount() (ocrtypes.Account, error) { + return ocrtypes.Account(mt.fromAccount), nil +} diff --git a/core/services/llo/mercurytransmitter/transmitter_test.go b/core/services/llo/mercurytransmitter/transmitter_test.go new file mode 100644 index 00000000000..db3d0d2e584 --- /dev/null +++ b/core/services/llo/mercurytransmitter/transmitter_test.go @@ -0,0 +1,258 @@ +package mercurytransmitter + +import ( + "context" + "crypto/ed25519" + "sync" + "testing" + "time" + + "github.com/pkg/errors" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + "github.com/smartcontractkit/libocr/commontypes" + "github.com/smartcontractkit/libocr/offchainreporting2plus/types" + + commonconfig "github.com/smartcontractkit/chainlink-common/pkg/config" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/pgtest" + "github.com/smartcontractkit/chainlink/v2/core/logger" + "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury/wsrpc" + "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury/wsrpc/mocks" + "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury/wsrpc/pb" +) + +type mockCfg struct{} + +func (m mockCfg) TransmitQueueMaxSize() uint32 { + return 10_000 +} + +func (m mockCfg) TransmitTimeout() commonconfig.Duration { + return *commonconfig.MustNewDuration(1 * time.Hour) +} + +func Test_Transmitter_Transmit(t *testing.T) { + lggr := logger.TestLogger(t) + db := pgtest.NewSqlxDB(t) + donID := uint32(123456) + orm := NewORM(db, donID) + clients := map[string]wsrpc.Client{} + + t.Run("with multiple mercury servers", func(t *testing.T) { + t.Run("transmission successfully enqueued", func(t *testing.T) { + c := &mocks.MockWSRPCClient{} + clients[sURL] = c + clients[sURL2] = c + clients[sURL3] = c + + mt := newTransmitter(Opts{ + Lggr: lggr, + Cfg: mockCfg{}, + Clients: clients, + FromAccount: ed25519.PublicKey{}, + DonID: donID, + ORM: orm, + }) + // init the queue since we skipped starting transmitter + mt.servers[sURL].q.Init([]*Transmission{}) + mt.servers[sURL2].q.Init([]*Transmission{}) + mt.servers[sURL3].q.Init([]*Transmission{}) + + seqNr := uint64(55) + report := makeSampleReport() + digest := makeSampleConfigDigest() + sigs := []types.AttributedOnchainSignature{{ + Signature: []byte{22}, + Signer: commontypes.OracleID(43), + }} + err := mt.Transmit(testutils.Context(t), digest, seqNr, report, sigs) + require.NoError(t, err) + + // ensure it was added to the queue + require.Equal(t, mt.servers[sURL].q.(*transmitQueue).pq.Len(), 1) + assert.Equal(t, &Transmission{ + ServerURL: sURL, + ConfigDigest: digest, + SeqNr: seqNr, + Report: report, + Sigs: sigs, + }, mt.servers[sURL].q.(*transmitQueue).pq.Pop().(*Transmission)) + require.Equal(t, mt.servers[sURL2].q.(*transmitQueue).pq.Len(), 1) + assert.Equal(t, &Transmission{ + ServerURL: sURL2, + ConfigDigest: digest, + SeqNr: seqNr, + Report: report, + Sigs: sigs, + }, mt.servers[sURL2].q.(*transmitQueue).pq.Pop().(*Transmission)) + require.Equal(t, mt.servers[sURL3].q.(*transmitQueue).pq.Len(), 1) + assert.Equal(t, &Transmission{ + ServerURL: sURL3, + ConfigDigest: digest, + SeqNr: seqNr, + Report: report, + Sigs: sigs, + }, mt.servers[sURL3].q.(*transmitQueue).pq.Pop().(*Transmission)) + }) + }) +} + +type mockQ struct { + ch chan *Transmission +} + +func newMockQ() *mockQ { + return &mockQ{make(chan *Transmission, 100)} +} + +func (m *mockQ) Start(context.Context) error { return nil } +func (m *mockQ) Close() error { + m.ch <- nil + return nil +} +func (m *mockQ) Ready() error { return nil } +func (m *mockQ) HealthReport() map[string]error { return nil } +func (m *mockQ) Name() string { return "" } +func (m *mockQ) BlockingPop() (t *Transmission) { + val := <-m.ch + return val +} +func (m *mockQ) Push(t *Transmission) (ok bool) { + m.ch <- t + return true +} +func (m *mockQ) Init(transmissions []*Transmission) {} +func (m *mockQ) IsEmpty() bool { return false } + +func Test_Transmitter_runQueueLoop(t *testing.T) { + donIDStr := "555" + lggr := logger.TestLogger(t) + c := &mocks.MockWSRPCClient{} + db := pgtest.NewSqlxDB(t) + donID := uint32(123456) + orm := NewORM(db, donID) + cfg := mockCfg{} + + s := newServer(lggr, cfg, c, orm, sURL) + + t.Run("pulls from queue and transmits successfully", func(t *testing.T) { + transmit := make(chan *pb.TransmitRequest, 1) + c.TransmitF = func(ctx context.Context, in *pb.TransmitRequest) (*pb.TransmitResponse, error) { + transmit <- in + return &pb.TransmitResponse{Code: 0, Error: ""}, nil + } + q := newMockQ() + s.q = q + wg := &sync.WaitGroup{} + wg.Add(1) + + go s.runQueueLoop(nil, wg, donIDStr) + + transmission := makeSampleTransmission(1) + q.Push(transmission) + + select { + case tr := <-transmit: + assert.Equal(t, []byte{0x0, 0x9, 0x57, 0xdd, 0x2f, 0x63, 0x56, 0x69, 0x34, 0xfd, 0xc2, 0xe1, 0xcd, 0xc1, 0xe, 0x3e, 0x25, 0xb9, 0x26, 0x5a, 0x16, 0x23, 0x91, 0xa6, 0x53, 0x16, 0x66, 0x59, 0x51, 0x0, 0x28, 0x7c, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xe0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2, 0x20, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2, 0x80, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x20, 0x0, 0x3, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x66, 0xde, 0xf5, 0xba, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x66, 0xde, 0xf5, 0xba, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1e, 0x8e, 0x95, 0xcf, 0xb5, 0xd8, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1a, 0xd0, 0x1c, 0x67, 0xa9, 0xcf, 0xb3, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x66, 0xdf, 0x3, 0xca, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1b, 0x1c, 0x93, 0x6d, 0xa4, 0xf2, 0x17, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1b, 0x14, 0x8d, 0x9a, 0xc1, 0xd9, 0x6f, 0xc0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1b, 0x40, 0x5c, 0xcf, 0xa1, 0xbc, 0x63, 0xc0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2, 0x9d, 0xab, 0x8f, 0xa7, 0xca, 0x7, 0x62, 0x57, 0xf7, 0x11, 0x2c, 0xb7, 0xf3, 0x49, 0x37, 0x12, 0xbd, 0xe, 0x14, 0x27, 0xfc, 0x32, 0x5c, 0xec, 0xa6, 0xb9, 0x7f, 0xf9, 0xd7, 0x7b, 0xa6, 0x36, 0x9a, 0x47, 0x4a, 0x3, 0x1a, 0x95, 0xcf, 0x46, 0x10, 0xaf, 0xcc, 0x90, 0x49, 0xb2, 0xce, 0xbf, 0x63, 0xaa, 0xc7, 0x25, 0x4d, 0x2a, 0x8, 0x36, 0xda, 0xd5, 0x9f, 0x9d, 0x63, 0x69, 0x22, 0xb3, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2, 0x30, 0x9d, 0x84, 0x29, 0xbf, 0xd4, 0xeb, 0xc5, 0xc9, 0x29, 0xef, 0xdd, 0xd3, 0x2f, 0xa6, 0x25, 0x63, 0xda, 0xd9, 0x2c, 0xa1, 0x4a, 0xba, 0x75, 0xb2, 0x85, 0x25, 0x8f, 0x2b, 0x84, 0xcd, 0x99, 0x36, 0xd9, 0x6e, 0xf, 0xae, 0x7b, 0xd1, 0x61, 0x59, 0xf, 0x36, 0x4a, 0x22, 0xec, 0xde, 0x45, 0x32, 0xe0, 0x5b, 0x5c, 0xe3, 0x14, 0x29, 0x4, 0x60, 0x7b, 0xce, 0xa3, 0x89, 0x6b, 0xbb, 0xe0}, tr.Payload) + assert.Equal(t, int(transmission.Report.Info.ReportFormat), int(tr.ReportFormat)) + case <-time.After(testutils.WaitTimeout(t)): + t.Fatal("expected a transmit request to be sent") + } + + q.Close() + wg.Wait() + }) + + t.Run("on duplicate, success", func(t *testing.T) { + transmit := make(chan *pb.TransmitRequest, 1) + c.TransmitF = func(ctx context.Context, in *pb.TransmitRequest) (*pb.TransmitResponse, error) { + transmit <- in + return &pb.TransmitResponse{Code: DuplicateReport, Error: ""}, nil + } + q := newMockQ() + s.q = q + wg := &sync.WaitGroup{} + wg.Add(1) + + go s.runQueueLoop(nil, wg, donIDStr) + + transmission := makeSampleTransmission(1) + q.Push(transmission) + + select { + case tr := <-transmit: + assert.Equal(t, []byte{0x0, 0x9, 0x57, 0xdd, 0x2f, 0x63, 0x56, 0x69, 0x34, 0xfd, 0xc2, 0xe1, 0xcd, 0xc1, 0xe, 0x3e, 0x25, 0xb9, 0x26, 0x5a, 0x16, 0x23, 0x91, 0xa6, 0x53, 0x16, 0x66, 0x59, 0x51, 0x0, 0x28, 0x7c, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xe0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2, 0x20, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2, 0x80, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x20, 0x0, 0x3, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x66, 0xde, 0xf5, 0xba, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x66, 0xde, 0xf5, 0xba, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1e, 0x8e, 0x95, 0xcf, 0xb5, 0xd8, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1a, 0xd0, 0x1c, 0x67, 0xa9, 0xcf, 0xb3, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x66, 0xdf, 0x3, 0xca, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1b, 0x1c, 0x93, 0x6d, 0xa4, 0xf2, 0x17, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1b, 0x14, 0x8d, 0x9a, 0xc1, 0xd9, 0x6f, 0xc0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1b, 0x40, 0x5c, 0xcf, 0xa1, 0xbc, 0x63, 0xc0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2, 0x9d, 0xab, 0x8f, 0xa7, 0xca, 0x7, 0x62, 0x57, 0xf7, 0x11, 0x2c, 0xb7, 0xf3, 0x49, 0x37, 0x12, 0xbd, 0xe, 0x14, 0x27, 0xfc, 0x32, 0x5c, 0xec, 0xa6, 0xb9, 0x7f, 0xf9, 0xd7, 0x7b, 0xa6, 0x36, 0x9a, 0x47, 0x4a, 0x3, 0x1a, 0x95, 0xcf, 0x46, 0x10, 0xaf, 0xcc, 0x90, 0x49, 0xb2, 0xce, 0xbf, 0x63, 0xaa, 0xc7, 0x25, 0x4d, 0x2a, 0x8, 0x36, 0xda, 0xd5, 0x9f, 0x9d, 0x63, 0x69, 0x22, 0xb3, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2, 0x30, 0x9d, 0x84, 0x29, 0xbf, 0xd4, 0xeb, 0xc5, 0xc9, 0x29, 0xef, 0xdd, 0xd3, 0x2f, 0xa6, 0x25, 0x63, 0xda, 0xd9, 0x2c, 0xa1, 0x4a, 0xba, 0x75, 0xb2, 0x85, 0x25, 0x8f, 0x2b, 0x84, 0xcd, 0x99, 0x36, 0xd9, 0x6e, 0xf, 0xae, 0x7b, 0xd1, 0x61, 0x59, 0xf, 0x36, 0x4a, 0x22, 0xec, 0xde, 0x45, 0x32, 0xe0, 0x5b, 0x5c, 0xe3, 0x14, 0x29, 0x4, 0x60, 0x7b, 0xce, 0xa3, 0x89, 0x6b, 0xbb, 0xe0}, tr.Payload) + assert.Equal(t, int(transmission.Report.Info.ReportFormat), int(tr.ReportFormat)) + case <-time.After(testutils.WaitTimeout(t)): + t.Fatal("expected a transmit request to be sent") + } + + q.Close() + wg.Wait() + }) + t.Run("on server-side error, does not retry", func(t *testing.T) { + transmit := make(chan *pb.TransmitRequest, 1) + c.TransmitF = func(ctx context.Context, in *pb.TransmitRequest) (*pb.TransmitResponse, error) { + transmit <- in + return &pb.TransmitResponse{Code: DuplicateReport, Error: ""}, nil + } + q := newMockQ() + s.q = q + wg := &sync.WaitGroup{} + wg.Add(1) + + go s.runQueueLoop(nil, wg, donIDStr) + + transmission := makeSampleTransmission(1) + q.Push(transmission) + + select { + case tr := <-transmit: + assert.Equal(t, []byte{0x0, 0x9, 0x57, 0xdd, 0x2f, 0x63, 0x56, 0x69, 0x34, 0xfd, 0xc2, 0xe1, 0xcd, 0xc1, 0xe, 0x3e, 0x25, 0xb9, 0x26, 0x5a, 0x16, 0x23, 0x91, 0xa6, 0x53, 0x16, 0x66, 0x59, 0x51, 0x0, 0x28, 0x7c, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xe0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2, 0x20, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2, 0x80, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x20, 0x0, 0x3, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x66, 0xde, 0xf5, 0xba, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x66, 0xde, 0xf5, 0xba, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1e, 0x8e, 0x95, 0xcf, 0xb5, 0xd8, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1a, 0xd0, 0x1c, 0x67, 0xa9, 0xcf, 0xb3, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x66, 0xdf, 0x3, 0xca, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1b, 0x1c, 0x93, 0x6d, 0xa4, 0xf2, 0x17, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1b, 0x14, 0x8d, 0x9a, 0xc1, 0xd9, 0x6f, 0xc0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1b, 0x40, 0x5c, 0xcf, 0xa1, 0xbc, 0x63, 0xc0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2, 0x9d, 0xab, 0x8f, 0xa7, 0xca, 0x7, 0x62, 0x57, 0xf7, 0x11, 0x2c, 0xb7, 0xf3, 0x49, 0x37, 0x12, 0xbd, 0xe, 0x14, 0x27, 0xfc, 0x32, 0x5c, 0xec, 0xa6, 0xb9, 0x7f, 0xf9, 0xd7, 0x7b, 0xa6, 0x36, 0x9a, 0x47, 0x4a, 0x3, 0x1a, 0x95, 0xcf, 0x46, 0x10, 0xaf, 0xcc, 0x90, 0x49, 0xb2, 0xce, 0xbf, 0x63, 0xaa, 0xc7, 0x25, 0x4d, 0x2a, 0x8, 0x36, 0xda, 0xd5, 0x9f, 0x9d, 0x63, 0x69, 0x22, 0xb3, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2, 0x30, 0x9d, 0x84, 0x29, 0xbf, 0xd4, 0xeb, 0xc5, 0xc9, 0x29, 0xef, 0xdd, 0xd3, 0x2f, 0xa6, 0x25, 0x63, 0xda, 0xd9, 0x2c, 0xa1, 0x4a, 0xba, 0x75, 0xb2, 0x85, 0x25, 0x8f, 0x2b, 0x84, 0xcd, 0x99, 0x36, 0xd9, 0x6e, 0xf, 0xae, 0x7b, 0xd1, 0x61, 0x59, 0xf, 0x36, 0x4a, 0x22, 0xec, 0xde, 0x45, 0x32, 0xe0, 0x5b, 0x5c, 0xe3, 0x14, 0x29, 0x4, 0x60, 0x7b, 0xce, 0xa3, 0x89, 0x6b, 0xbb, 0xe0}, tr.Payload) + assert.Equal(t, int(transmission.Report.Info.ReportFormat), int(tr.ReportFormat)) + case <-time.After(testutils.WaitTimeout(t)): + t.Fatal("expected a transmit request to be sent") + } + + q.Close() + wg.Wait() + }) + t.Run("on transmit error, retries", func(t *testing.T) { + transmit := make(chan *pb.TransmitRequest, 1) + c.TransmitF = func(ctx context.Context, in *pb.TransmitRequest) (*pb.TransmitResponse, error) { + transmit <- in + return &pb.TransmitResponse{}, errors.New("transmission error") + } + q := newMockQ() + s.q = q + wg := &sync.WaitGroup{} + wg.Add(1) + stopCh := make(chan struct{}, 1) + + go s.runQueueLoop(stopCh, wg, donIDStr) + + transmission := makeSampleTransmission(1) + q.Push(transmission) + + cnt := 0 + Loop: + for { + select { + case tr := <-transmit: + assert.Equal(t, []byte{0x0, 0x9, 0x57, 0xdd, 0x2f, 0x63, 0x56, 0x69, 0x34, 0xfd, 0xc2, 0xe1, 0xcd, 0xc1, 0xe, 0x3e, 0x25, 0xb9, 0x26, 0x5a, 0x16, 0x23, 0x91, 0xa6, 0x53, 0x16, 0x66, 0x59, 0x51, 0x0, 0x28, 0x7c, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xe0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2, 0x20, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2, 0x80, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x20, 0x0, 0x3, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x66, 0xde, 0xf5, 0xba, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x66, 0xde, 0xf5, 0xba, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1e, 0x8e, 0x95, 0xcf, 0xb5, 0xd8, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1a, 0xd0, 0x1c, 0x67, 0xa9, 0xcf, 0xb3, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x66, 0xdf, 0x3, 0xca, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1b, 0x1c, 0x93, 0x6d, 0xa4, 0xf2, 0x17, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1b, 0x14, 0x8d, 0x9a, 0xc1, 0xd9, 0x6f, 0xc0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1b, 0x40, 0x5c, 0xcf, 0xa1, 0xbc, 0x63, 0xc0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2, 0x9d, 0xab, 0x8f, 0xa7, 0xca, 0x7, 0x62, 0x57, 0xf7, 0x11, 0x2c, 0xb7, 0xf3, 0x49, 0x37, 0x12, 0xbd, 0xe, 0x14, 0x27, 0xfc, 0x32, 0x5c, 0xec, 0xa6, 0xb9, 0x7f, 0xf9, 0xd7, 0x7b, 0xa6, 0x36, 0x9a, 0x47, 0x4a, 0x3, 0x1a, 0x95, 0xcf, 0x46, 0x10, 0xaf, 0xcc, 0x90, 0x49, 0xb2, 0xce, 0xbf, 0x63, 0xaa, 0xc7, 0x25, 0x4d, 0x2a, 0x8, 0x36, 0xda, 0xd5, 0x9f, 0x9d, 0x63, 0x69, 0x22, 0xb3, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2, 0x30, 0x9d, 0x84, 0x29, 0xbf, 0xd4, 0xeb, 0xc5, 0xc9, 0x29, 0xef, 0xdd, 0xd3, 0x2f, 0xa6, 0x25, 0x63, 0xda, 0xd9, 0x2c, 0xa1, 0x4a, 0xba, 0x75, 0xb2, 0x85, 0x25, 0x8f, 0x2b, 0x84, 0xcd, 0x99, 0x36, 0xd9, 0x6e, 0xf, 0xae, 0x7b, 0xd1, 0x61, 0x59, 0xf, 0x36, 0x4a, 0x22, 0xec, 0xde, 0x45, 0x32, 0xe0, 0x5b, 0x5c, 0xe3, 0x14, 0x29, 0x4, 0x60, 0x7b, 0xce, 0xa3, 0x89, 0x6b, 0xbb, 0xe0}, tr.Payload) + assert.Equal(t, int(transmission.Report.Info.ReportFormat), int(tr.ReportFormat)) + if cnt > 2 { + break Loop + } + cnt++ + case <-time.After(testutils.WaitTimeout(t)): + t.Fatal("expected 3 transmit requests to be sent") + } + } + + close(stopCh) + wg.Wait() + }) +} diff --git a/core/services/llo/offchain_config_digester.go b/core/services/llo/offchain_config_digester.go deleted file mode 100644 index cd4d9afa3a0..00000000000 --- a/core/services/llo/offchain_config_digester.go +++ /dev/null @@ -1,123 +0,0 @@ -package llo - -import ( - "crypto/ed25519" - "encoding/binary" - "encoding/hex" - "fmt" - "math/big" - "strings" - - "github.com/ethereum/go-ethereum/accounts/abi" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/crypto" - "github.com/pkg/errors" - - "github.com/smartcontractkit/libocr/offchainreporting2plus/types" - ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" - "github.com/smartcontractkit/wsrpc/credentials" - - "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/llo-feeds/generated/exposed_channel_verifier" -) - -// Originally sourced from: https://github.com/smartcontractkit/offchain-reporting/blob/991ebe1462fd56826a1ddfb34287d542acb2baee/lib/offchainreporting2/chains/evmutil/offchain_config_digester.go - -var _ ocrtypes.OffchainConfigDigester = OffchainConfigDigester{} - -func NewOffchainConfigDigester(chainID *big.Int, contractAddress common.Address) OffchainConfigDigester { - return OffchainConfigDigester{chainID, contractAddress} -} - -type OffchainConfigDigester struct { - ChainID *big.Int - ContractAddress common.Address -} - -func (d OffchainConfigDigester) ConfigDigest(cc ocrtypes.ContractConfig) (ocrtypes.ConfigDigest, error) { - signers := []common.Address{} - for i, signer := range cc.Signers { - if len(signer) != 20 { - return ocrtypes.ConfigDigest{}, errors.Errorf("%v-th evm signer should be a 20 byte address, but got %x", i, signer) - } - a := common.BytesToAddress(signer) - signers = append(signers, a) - } - transmitters := []credentials.StaticSizedPublicKey{} - for i, transmitter := range cc.Transmitters { - if len(transmitter) != 2*ed25519.PublicKeySize { - return ocrtypes.ConfigDigest{}, errors.Errorf("%v-th evm transmitter should be a 64 character hex-encoded ed25519 public key, but got '%v' (%d chars)", i, transmitter, len(transmitter)) - } - var t credentials.StaticSizedPublicKey - b, err := hex.DecodeString(string(transmitter)) - if err != nil { - return ocrtypes.ConfigDigest{}, errors.Wrapf(err, "%v-th evm transmitter is not valid hex, got: %q", i, transmitter) - } - copy(t[:], b) - - transmitters = append(transmitters, t) - } - - return configDigest( - d.ChainID, - d.ContractAddress, - cc.ConfigCount, - signers, - transmitters, - cc.F, - cc.OnchainConfig, - cc.OffchainConfigVersion, - cc.OffchainConfig, - ) -} - -func (d OffchainConfigDigester) ConfigDigestPrefix() (ocrtypes.ConfigDigestPrefix, error) { - return ocrtypes.ConfigDigestPrefixLLO, nil -} - -func makeConfigDigestArgs() abi.Arguments { - abi, err := abi.JSON(strings.NewReader(exposed_channel_verifier.ExposedChannelVerifierABI)) - if err != nil { - // assertion - panic(fmt.Sprintf("could not parse aggregator ABI: %s", err.Error())) - } - return abi.Methods["exposedConfigDigestFromConfigData"].Inputs -} - -var configDigestArgs = makeConfigDigestArgs() - -func configDigest( - chainID *big.Int, - contractAddress common.Address, - configCount uint64, - oracles []common.Address, - transmitters []credentials.StaticSizedPublicKey, - f uint8, - onchainConfig []byte, - offchainConfigVersion uint64, - offchainConfig []byte, -) (types.ConfigDigest, error) { - msg, err := configDigestArgs.Pack( - chainID, - contractAddress, - configCount, - oracles, - transmitters, - f, - onchainConfig, - offchainConfigVersion, - offchainConfig, - ) - if err != nil { - return types.ConfigDigest{}, fmt.Errorf("could not pack config digest args: %v", err) - } - rawHash := crypto.Keccak256(msg) - configDigest := types.ConfigDigest{} - if n := copy(configDigest[:], rawHash); n != len(configDigest) { - return types.ConfigDigest{}, fmt.Errorf("copied too little data: %d/%d", n, len(configDigest)) - } - binary.BigEndian.PutUint16(configDigest[:2], uint16(ocrtypes.ConfigDigestPrefixLLO)) - if !(configDigest[0] == 0 && configDigest[1] == 9) { - return types.ConfigDigest{}, fmt.Errorf("wrong ConfigDigestPrefix; got: %x, expected: %d", configDigest[:2], ocrtypes.ConfigDigestPrefixLLO) - } - return configDigest, nil -} diff --git a/core/services/llo/offchain_config_digester_test.go b/core/services/llo/offchain_config_digester_test.go deleted file mode 100644 index 0de9117e391..00000000000 --- a/core/services/llo/offchain_config_digester_test.go +++ /dev/null @@ -1,55 +0,0 @@ -package llo - -import ( - "math/big" - "testing" - - "github.com/ethereum/go-ethereum/common" - "github.com/smartcontractkit/libocr/offchainreporting2plus/types" - "github.com/stretchr/testify/require" -) - -func Test_OffchainConfigDigester_ConfigDigest(t *testing.T) { - // ChainID and ContractAddress are taken into account for computation - cd1, err := OffchainConfigDigester{ChainID: big.NewInt(0)}.ConfigDigest(types.ContractConfig{}) - require.NoError(t, err) - cd2, err := OffchainConfigDigester{ChainID: big.NewInt(0)}.ConfigDigest(types.ContractConfig{}) - require.NoError(t, err) - cd3, err := OffchainConfigDigester{ChainID: big.NewInt(1)}.ConfigDigest(types.ContractConfig{}) - require.NoError(t, err) - cd4, err := OffchainConfigDigester{ChainID: big.NewInt(1), ContractAddress: common.Address{1}}.ConfigDigest(types.ContractConfig{}) - require.NoError(t, err) - - require.Equal(t, cd1, cd2) - require.NotEqual(t, cd2, cd3) - require.NotEqual(t, cd2, cd4) - require.NotEqual(t, cd3, cd4) - - // malformed signers - _, err = OffchainConfigDigester{}.ConfigDigest(types.ContractConfig{ - Signers: []types.OnchainPublicKey{{1, 2}}, - }) - require.Error(t, err) - - // malformed transmitters - _, err = OffchainConfigDigester{}.ConfigDigest(types.ContractConfig{ - Transmitters: []types.Account{"0x"}, - }) - require.Error(t, err) - - _, err = OffchainConfigDigester{}.ConfigDigest(types.ContractConfig{ - Transmitters: []types.Account{"7343581f55146951b0f678dc6cfa8fd360e2f353"}, - }) - require.Error(t, err) - - _, err = OffchainConfigDigester{}.ConfigDigest(types.ContractConfig{ - Transmitters: []types.Account{"7343581f55146951b0f678dc6cfa8fd360e2f353aabbccddeeffaaccddeeffaz"}, - }) - require.Error(t, err) - - // well-formed transmitters - _, err = OffchainConfigDigester{ChainID: big.NewInt(0)}.ConfigDigest(types.ContractConfig{ - Transmitters: []types.Account{"7343581f55146951b0f678dc6cfa8fd360e2f353aabbccddeeffaaccddeeffaa"}, - }) - require.NoError(t, err) -} diff --git a/core/services/llo/onchain_channel_definition_cache.go b/core/services/llo/onchain_channel_definition_cache.go index 5c89561481a..6ff2058fb77 100644 --- a/core/services/llo/onchain_channel_definition_cache.go +++ b/core/services/llo/onchain_channel_definition_cache.go @@ -1,34 +1,53 @@ package llo import ( + "bytes" "context" "database/sql" + "encoding/json" "errors" "fmt" + "io" "maps" + "math/big" + "net/http" "strings" "sync" "time" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/common" + "golang.org/x/crypto/sha3" + "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink-common/pkg/services" llotypes "github.com/smartcontractkit/chainlink-common/pkg/types/llo" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/llo-feeds/generated/channel_config_store" - "github.com/smartcontractkit/chainlink/v2/core/logger" + "github.com/smartcontractkit/chainlink/v2/core/utils" + clhttp "github.com/smartcontractkit/chainlink/v2/core/utils/http" ) -type ChannelDefinitionCacheORM interface { - // TODO: What about delete/cleanup? - // https://smartcontract-it.atlassian.net/browse/MERC-3653 - LoadChannelDefinitions(ctx context.Context, addr common.Address) (dfns llotypes.ChannelDefinitions, blockNum int64, err error) - StoreChannelDefinitions(ctx context.Context, addr common.Address, dfns llotypes.ChannelDefinitions, blockNum int64) (err error) -} +const ( + // MaxChannelDefinitionsFileSize is a sanity limit to avoid OOM for a + // maliciously large file. It should be much larger than any real expected + // channel definitions file. + MaxChannelDefinitionsFileSize = 25 * 1024 * 1024 // 25MB + // How often we query logpoller for new logs + defaultLogPollInterval = 1 * time.Second + // How often we check for failed persistence and attempt to save again + dbPersistLoopInterval = 1 * time.Second + + newChannelDefinitionEventName = "NewChannelDefinition" +) -var channelConfigStoreABI abi.ABI +var ( + channelConfigStoreABI abi.ABI + topicNewChannelDefinition = (channel_config_store.ChannelConfigStoreNewChannelDefinition{}).Topic() + + allTopics = []common.Hash{topicNewChannelDefinition} +) func init() { var err error @@ -38,82 +57,130 @@ func init() { } } +type ChannelDefinitionCacheORM interface { + LoadChannelDefinitions(ctx context.Context, addr common.Address, donID uint32) (pd *PersistedDefinitions, err error) + StoreChannelDefinitions(ctx context.Context, addr common.Address, donID, version uint32, dfns llotypes.ChannelDefinitions, blockNum int64) (err error) + CleanupChannelDefinitions(ctx context.Context, addr common.Address, donID uint32) error +} + var _ llotypes.ChannelDefinitionCache = &channelDefinitionCache{} +type LogPoller interface { + UnregisterFilter(ctx context.Context, filterName string) error + RegisterFilter(ctx context.Context, filter logpoller.Filter) error + LatestBlock(ctx context.Context) (logpoller.LogPollerBlock, error) + LogsWithSigs(ctx context.Context, start, end int64, eventSigs []common.Hash, address common.Address) ([]logpoller.Log, error) +} + +type Option func(*channelDefinitionCache) + +func WithLogPollInterval(d time.Duration) Option { + return func(c *channelDefinitionCache) { + c.logPollInterval = d + } +} + type channelDefinitionCache struct { services.StateMachine - orm ChannelDefinitionCacheORM + orm ChannelDefinitionCacheORM + client HTTPClient + httpLimit int64 - filterName string - lp logpoller.LogPoller - fromBlock int64 - addr common.Address - lggr logger.Logger + filterName string + lp LogPoller + logPollInterval time.Duration + addr common.Address + donID uint32 + lggr logger.SugaredLogger + initialBlockNum int64 + + newLogMu sync.RWMutex + newLog *channel_config_store.ChannelConfigStoreNewChannelDefinition + newLogCh chan *channel_config_store.ChannelConfigStoreNewChannelDefinition definitionsMu sync.RWMutex definitions llotypes.ChannelDefinitions + definitionsVersion uint32 definitionsBlockNum int64 + persistMu sync.RWMutex + persistedVersion uint32 + wg sync.WaitGroup chStop chan struct{} } -var ( - topicNewChannelDefinition = (channel_config_store.ChannelConfigStoreNewChannelDefinition{}).Topic() - topicChannelDefinitionRemoved = (channel_config_store.ChannelConfigStoreChannelDefinitionRemoved{}).Topic() +type HTTPClient interface { + Do(req *http.Request) (*http.Response, error) +} - allTopics = []common.Hash{topicNewChannelDefinition, topicChannelDefinitionRemoved} -) +func filterName(addr common.Address, donID uint32) string { + return logpoller.FilterName("OCR3 LLO ChannelDefinitionCachePoller", addr.String(), fmt.Sprintf("%d", donID)) +} -func NewChannelDefinitionCache(lggr logger.Logger, orm ChannelDefinitionCacheORM, lp logpoller.LogPoller, addr common.Address, fromBlock int64) llotypes.ChannelDefinitionCache { - filterName := logpoller.FilterName("OCR3 LLO ChannelDefinitionCachePoller", addr.String()) - return &channelDefinitionCache{ - services.StateMachine{}, - orm, - filterName, - lp, - 0, - addr, - lggr.Named("ChannelDefinitionCache").With("addr", addr, "fromBlock", fromBlock), - sync.RWMutex{}, - nil, - fromBlock, - sync.WaitGroup{}, - make(chan struct{}), +func NewChannelDefinitionCache(lggr logger.Logger, orm ChannelDefinitionCacheORM, client HTTPClient, lp logpoller.LogPoller, addr common.Address, donID uint32, fromBlock int64, options ...Option) llotypes.ChannelDefinitionCache { + filterName := logpoller.FilterName("OCR3 LLO ChannelDefinitionCachePoller", addr.String(), donID) + cdc := &channelDefinitionCache{ + orm: orm, + client: client, + httpLimit: MaxChannelDefinitionsFileSize, + filterName: filterName, + lp: lp, + logPollInterval: defaultLogPollInterval, + addr: addr, + donID: donID, + lggr: logger.Sugared(lggr).Named("ChannelDefinitionCache").With("addr", addr, "fromBlock", fromBlock), + newLogCh: make(chan *channel_config_store.ChannelConfigStoreNewChannelDefinition, 1), + initialBlockNum: fromBlock, + chStop: make(chan struct{}), } + for _, option := range options { + option(cdc) + } + return cdc } func (c *channelDefinitionCache) Start(ctx context.Context) error { // Initial load from DB, then async poll from chain thereafter return c.StartOnce("ChannelDefinitionCache", func() (err error) { - err = c.lp.RegisterFilter(ctx, logpoller.Filter{Name: c.filterName, EventSigs: allTopics, Addresses: []common.Address{c.addr}}) + donIDTopic := common.BigToHash(big.NewInt(int64(c.donID))) + err = c.lp.RegisterFilter(ctx, logpoller.Filter{Name: c.filterName, EventSigs: allTopics, Topic2: []common.Hash{donIDTopic}, Addresses: []common.Address{c.addr}}) if err != nil { return err } - if definitions, definitionsBlockNum, err := c.orm.LoadChannelDefinitions(ctx, c.addr); err != nil { + if pd, err := c.orm.LoadChannelDefinitions(ctx, c.addr, c.donID); err != nil { return err - } else if definitions != nil { - c.definitions = definitions - c.definitionsBlockNum = definitionsBlockNum + } else if pd != nil { + c.definitions = pd.Definitions + c.initialBlockNum = pd.BlockNum + 1 + c.definitionsVersion = uint32(pd.Version) } else { // ensure non-nil map ready for assignment later c.definitions = make(llotypes.ChannelDefinitions) - // leave c.definitionsBlockNum as provided fromBlock argument + // leave c.initialBlockNum as provided fromBlock argument } - c.wg.Add(1) - go c.poll() + c.wg.Add(3) + // We have three concurrent loops + // 1. Poll chain for new logs + // 2. Fetch latest definitions from URL and verify SHA, according to latest log + // 3. Retry persisting records to DB, if it failed + go c.pollChainLoop() + go c.fetchLatestLoop() + go c.failedPersistLoop() return nil }) } -// TODO: make this configurable? -const pollInterval = 1 * time.Second +//////////////////////////////////////////////////////////////////// +// Log Polling +//////////////////////////////////////////////////////////////////// -func (c *channelDefinitionCache) poll() { +// pollChainLoop periodically checks logpoller for new logs +func (c *channelDefinitionCache) pollChainLoop() { defer c.wg.Done() - pollT := services.NewTicker(pollInterval) + pollT := services.NewTicker(c.logPollInterval) defer pollT.Stop() for { @@ -121,116 +188,303 @@ func (c *channelDefinitionCache) poll() { case <-c.chStop: return case <-pollT.C: - if n, err := c.fetchFromChain(); err != nil { - // TODO: retry with backoff? - // https://smartcontract-it.atlassian.net/browse/MERC-3653 + // failures will be tried again on the next tick + if err := c.readLogs(); err != nil { c.lggr.Errorw("Failed to fetch channel definitions from chain", "err", err) continue - } else { - if n > 0 { - c.lggr.Infow("Updated channel definitions", "nLogs", n, "definitionsBlockNum", c.definitionsBlockNum) - } else { - c.lggr.Debugw("No new channel definitions", "nLogs", 0, "definitionsBlockNum", c.definitionsBlockNum) - } } } } } -func (c *channelDefinitionCache) fetchFromChain() (nLogs int, err error) { - // TODO: Pass context +func (c *channelDefinitionCache) readLogs() (err error) { ctx, cancel := services.StopChan(c.chStop).NewCtx() defer cancel() - // https://smartcontract-it.atlassian.net/browse/MERC-3653 - latest, err := c.lp.LatestBlock(ctx) + latestBlock, err := c.lp.LatestBlock(ctx) if errors.Is(err, sql.ErrNoRows) { c.lggr.Debug("Logpoller has no logs yet, skipping poll") - return 0, nil + return nil } else if err != nil { - return 0, err + return err } - toBlock := latest.BlockNumber + toBlock := latestBlock.BlockNumber - fromBlock := c.definitionsBlockNum + fromBlock := c.scanFromBlockNum() if toBlock <= fromBlock { - return 0, nil + return nil } - // NOTE: We assume that log poller returns logs in ascending order chronologically + // NOTE: We assume that log poller returns logs in order of block_num, log_index ASC logs, err := c.lp.LogsWithSigs(ctx, fromBlock, toBlock, allTopics, c.addr) if err != nil { - // TODO: retry? - // https://smartcontract-it.atlassian.net/browse/MERC-3653 - return 0, err + return err } + for _, log := range logs { - if err = c.applyLog(log); err != nil { - return 0, err + switch log.EventSig { + case topicNewChannelDefinition: + unpacked := new(channel_config_store.ChannelConfigStoreNewChannelDefinition) + + err := channelConfigStoreABI.UnpackIntoInterface(unpacked, newChannelDefinitionEventName, log.Data) + if err != nil { + return fmt.Errorf("failed to unpack log data: %w", err) + } + if len(log.Topics) < 2 { + // should never happen but must guard against unexpected panics + c.lggr.Warnw("Log missing expected topics", "log", log) + continue + } + unpacked.DonId = new(big.Int).SetBytes(log.Topics[1]) + + if unpacked.DonId.Cmp(big.NewInt(int64(c.donID))) != 0 { + c.lggr.Warnw("Got log for unexpected donID", "donID", unpacked.DonId.String(), "expectedDonID", c.donID) + // ignore logs for other donIDs + // NOTE: shouldn't happen anyway since log poller filters on + // donID + continue + } + + c.newLogMu.Lock() + if c.newLog == nil || unpacked.Version > c.newLog.Version { + // assume that donID is correct due to log poller filtering + c.lggr.Infow("Got new channel definitions from chain", "version", unpacked.Version, "blockNumber", log.BlockNumber, "sha", fmt.Sprintf("%x", unpacked.Sha), "url", unpacked.Url) + c.newLog = unpacked + c.newLogCh <- unpacked + } + c.newLogMu.Unlock() + + default: + // ignore unrecognized logs + continue } } - // Use context.Background() here because we want to try to save even if we - // are closing - if err = c.orm.StoreChannelDefinitions(context.Background(), c.addr, c.Definitions(), toBlock); err != nil { - return 0, err + return nil +} + +func (c *channelDefinitionCache) scanFromBlockNum() int64 { + c.newLogMu.RLock() + defer c.newLogMu.RUnlock() + if c.newLog != nil { + return int64(c.newLog.Raw.BlockNumber) + 1 } + return c.initialBlockNum +} + +//////////////////////////////////////////////////////////////////// +// Fetch channel definitions from URL based on latest log +//////////////////////////////////////////////////////////////////// + +// fetchLatestLoop waits for new logs and tries on a loop to fetch the channel definitions from the specified url +func (c *channelDefinitionCache) fetchLatestLoop() { + defer c.wg.Done() + + var fetchCh chan struct{} + + for { + select { + case latest := <-c.newLogCh: + // kill the old retry loop if any + if fetchCh != nil { + close(fetchCh) + } + + fetchCh = make(chan struct{}) - c.definitionsBlockNum = toBlock + c.wg.Add(1) + go c.fetchLoop(fetchCh, latest) - return len(logs), nil + case <-c.chStop: + return + } + } } -func (c *channelDefinitionCache) applyLog(log logpoller.Log) error { - switch log.EventSig { - case topicNewChannelDefinition: - unpacked := new(channel_config_store.ChannelConfigStoreNewChannelDefinition) +func (c *channelDefinitionCache) fetchLoop(closeCh chan struct{}, log *channel_config_store.ChannelConfigStoreNewChannelDefinition) { + defer c.wg.Done() + b := utils.NewHTTPFetchBackoff() + var attemptCnt int - err := channelConfigStoreABI.UnpackIntoInterface(unpacked, "NewChannelDefinition", log.Data) - if err != nil { - return fmt.Errorf("failed to unpack log data: %w", err) + ctx, cancel := services.StopChan(c.chStop).NewCtx() + defer cancel() + + err := c.fetchAndSetChannelDefinitions(ctx, log) + if err == nil { + c.lggr.Debugw("Set new channel definitions", "donID", c.donID, "version", log.Version, "url", log.Url, "sha", fmt.Sprintf("%x", log.Sha)) + return + } + c.lggr.Warnw("Error while fetching channel definitions", "donID", c.donID, "version", log.Version, "url", log.Url, "sha", fmt.Sprintf("%x", log.Sha), "err", err, "attempt", attemptCnt) + + for { + select { + case <-closeCh: + return + case <-time.After(b.Duration()): + attemptCnt++ + err := c.fetchAndSetChannelDefinitions(ctx, log) + if err != nil { + c.lggr.Warnw("Error while fetching channel definitions", "version", log.Version, "url", log.Url, "sha", fmt.Sprintf("%x", log.Sha), "err", err, "attempt", attemptCnt) + continue + } + c.lggr.Debugw("Set new channel definitions", "donID", c.donID, "version", log.Version, "url", log.Url, "sha", fmt.Sprintf("%x", log.Sha)) + return } + } +} - c.applyNewChannelDefinition(unpacked) - case topicChannelDefinitionRemoved: - unpacked := new(channel_config_store.ChannelConfigStoreChannelDefinitionRemoved) +func (c *channelDefinitionCache) fetchAndSetChannelDefinitions(ctx context.Context, log *channel_config_store.ChannelConfigStoreNewChannelDefinition) error { + c.definitionsMu.RLock() + if log.Version <= c.definitionsVersion { + c.definitionsMu.RUnlock() + return nil + } + c.definitionsMu.RUnlock() - err := channelConfigStoreABI.UnpackIntoInterface(unpacked, "ChannelDefinitionRemoved", log.Data) + cd, err := c.fetchChannelDefinitions(ctx, log.Url, log.Sha) + if err != nil { + return err + } + c.definitionsMu.Lock() + if log.Version <= c.definitionsVersion { + c.definitionsMu.Unlock() + return nil + } + c.definitions = cd + c.definitionsBlockNum = int64(log.Raw.BlockNumber) + c.definitionsVersion = log.Version + c.definitionsMu.Unlock() + + if memoryVersion, persistedVersion, err := c.persist(context.Background()); err != nil { + // If this fails, the failedPersistLoop will try again + c.lggr.Warnw("Failed to persist channel definitions", "err", err, "memoryVersion", memoryVersion, "persistedVersion", persistedVersion) + } + + return nil +} + +func (c *channelDefinitionCache) fetchChannelDefinitions(ctx context.Context, url string, expectedSha [32]byte) (llotypes.ChannelDefinitions, error) { + request, err := http.NewRequestWithContext(ctx, "GET", url, nil) + if err != nil { + return nil, fmt.Errorf("failed to create http.Request; %w", err) + } + request.Header.Set("Content-Type", "application/json") + + httpRequest := clhttp.HTTPRequest{ + Client: c.client, + Request: request, + Config: clhttp.HTTPRequestConfig{SizeLimit: c.httpLimit}, + Logger: c.lggr.Named("HTTPRequest").With("url", url, "expectedSHA", fmt.Sprintf("%x", expectedSha)), + } + + reader, statusCode, _, err := httpRequest.SendRequestReader() + if err != nil { + return nil, fmt.Errorf("error making http request: %w", err) + } + defer reader.Close() + + if statusCode >= 400 { + // NOTE: Truncate the returned body here as we don't want to spam the + // logs with potentially huge messages + body := http.MaxBytesReader(nil, reader, 1024) + defer body.Close() + bodyBytes, err := io.ReadAll(body) if err != nil { - return fmt.Errorf("failed to unpack log data: %w", err) + return nil, fmt.Errorf("got error from %s: (status code: %d, error reading response body: %w, response body: %s)", url, statusCode, err, bodyBytes) } + return nil, fmt.Errorf("got error from %s: (status code: %d, response body: %s)", url, statusCode, string(bodyBytes)) + } + + var buf bytes.Buffer + // Use a teeReader to avoid excessive copying + teeReader := io.TeeReader(reader, &buf) - c.applyChannelDefinitionRemoved(unpacked) - default: - // don't return error here, we want to ignore unrecognized logs and - // continue rather than interrupting the loop - c.lggr.Errorw("Unexpected log topic", "topic", log.EventSig.Hex()) + hash := sha3.New256() + // Stream the data directly into the hash and copy to buf as we go + if _, err := io.Copy(hash, teeReader); err != nil { + return nil, fmt.Errorf("failed to read from body: %w", err) } - return nil + + actualSha := hash.Sum(nil) + if !bytes.Equal(expectedSha[:], actualSha) { + return nil, fmt.Errorf("SHA3 mismatch: expected %x, got %x", expectedSha, actualSha) + } + + var cd llotypes.ChannelDefinitions + decoder := json.NewDecoder(&buf) + if err := decoder.Decode(&cd); err != nil { + return nil, fmt.Errorf("failed to decode JSON: %w", err) + } + + return cd, nil } -func (c *channelDefinitionCache) applyNewChannelDefinition(log *channel_config_store.ChannelConfigStoreNewChannelDefinition) { - streamIDs := make([]llotypes.StreamID, len(log.ChannelDefinition.StreamIDs)) - copy(streamIDs, log.ChannelDefinition.StreamIDs) - c.definitionsMu.Lock() - defer c.definitionsMu.Unlock() - c.definitions[log.ChannelId] = llotypes.ChannelDefinition{ - ReportFormat: llotypes.ReportFormat(log.ChannelDefinition.ReportFormat), - ChainSelector: log.ChannelDefinition.ChainSelector, - StreamIDs: streamIDs, +//////////////////////////////////////////////////////////////////// +// Persistence +//////////////////////////////////////////////////////////////////// + +func (c *channelDefinitionCache) persist(ctx context.Context) (memoryVersion, persistedVersion uint32, err error) { + c.persistMu.RLock() + persistedVersion = c.persistedVersion + c.persistMu.RUnlock() + + c.definitionsMu.RLock() + memoryVersion = c.definitionsVersion + dfns := c.definitions + blockNum := c.definitionsBlockNum + c.definitionsMu.RUnlock() + + if memoryVersion <= persistedVersion { + return + } + + if err = c.orm.StoreChannelDefinitions(ctx, c.addr, c.donID, memoryVersion, dfns, blockNum); err != nil { + return } + + c.persistMu.Lock() + defer c.persistMu.Unlock() + if memoryVersion > c.persistedVersion { + persistedVersion = memoryVersion + c.persistedVersion = persistedVersion + } + + // TODO: we could delete the old logs from logpoller here actually + // https://smartcontract-it.atlassian.net/browse/MERC-3653 + return } -func (c *channelDefinitionCache) applyChannelDefinitionRemoved(log *channel_config_store.ChannelConfigStoreChannelDefinitionRemoved) { - c.definitionsMu.Lock() - defer c.definitionsMu.Unlock() - delete(c.definitions, log.ChannelId) +// Checks persisted version and tries to save if necessary on a periodic timer +// Simple backup in case database persistence fails +func (c *channelDefinitionCache) failedPersistLoop() { + defer c.wg.Done() + + ctx, cancel := services.StopChan(c.chStop).NewCtx() + defer cancel() + + for { + select { + case <-time.After(dbPersistLoopInterval): + if memoryVersion, persistedVersion, err := c.persist(ctx); err != nil { + c.lggr.Warnw("Failed to persist channel definitions", "err", err, "memoryVersion", memoryVersion, "persistedVersion", persistedVersion) + } + case <-c.chStop: + // Try one final persist with a short-ish timeout, then return + ctx, cancel = context.WithTimeout(context.Background(), 1*time.Second) + defer cancel() + if memoryVersion, persistedVersion, err := c.persist(ctx); err != nil { + c.lggr.Errorw("Failed to persist channel definitions on shutdown", "err", err, "memoryVersion", memoryVersion, "persistedVersion", persistedVersion) + } + return + } + } } func (c *channelDefinitionCache) Close() error { // TODO: unregister filter (on job delete)? // https://smartcontract-it.atlassian.net/browse/MERC-3653 return c.StopOnce("ChannelDefinitionCache", func() error { + // Cancel all contexts but try one final persist before closing close(c.chStop) c.wg.Wait() return nil diff --git a/core/services/llo/onchain_channel_definition_cache_test.go b/core/services/llo/onchain_channel_definition_cache_test.go index 28e89a9c987..78bbcef4283 100644 --- a/core/services/llo/onchain_channel_definition_cache_test.go +++ b/core/services/llo/onchain_channel_definition_cache_test.go @@ -1,21 +1,119 @@ package llo import ( + "bytes" + "context" + "database/sql" + "errors" + "fmt" + "io" + "math/big" + "math/rand" + "net/http" "testing" + "github.com/ethereum/go-ethereum/common" "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "github.com/smartcontractkit/chainlink-common/pkg/logger" llotypes "github.com/smartcontractkit/chainlink-common/pkg/types/llo" + "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/llo-feeds/generated/channel_config_store" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" ) +type mockLogPoller struct { + latestBlock logpoller.LogPollerBlock + latestBlockErr error + logsWithSigs []logpoller.Log + logsWithSigsErr error + + unregisteredFilterNames []string +} + +func (m *mockLogPoller) RegisterFilter(ctx context.Context, filter logpoller.Filter) error { + return nil +} +func (m *mockLogPoller) LatestBlock(ctx context.Context) (logpoller.LogPollerBlock, error) { + return m.latestBlock, m.latestBlockErr +} +func (m *mockLogPoller) LogsWithSigs(ctx context.Context, start, end int64, eventSigs []common.Hash, address common.Address) ([]logpoller.Log, error) { + return m.logsWithSigs, m.logsWithSigsErr +} +func (m *mockLogPoller) UnregisterFilter(ctx context.Context, name string) error { + m.unregisteredFilterNames = append(m.unregisteredFilterNames, name) + return nil +} + +var _ HTTPClient = &mockHTTPClient{} + +type mockHTTPClient struct { + resp *http.Response + err error +} + +func (m *mockHTTPClient) Do(req *http.Request) (*http.Response, error) { + return m.resp, m.err +} + +var _ ChannelDefinitionCacheORM = &mockORM{} + +type mockORM struct { + err error + + lastPersistedAddr common.Address + lastPersistedDonID uint32 + lastPersistedVersion uint32 + lastPersistedDfns llotypes.ChannelDefinitions + lastPersistedBlockNum int64 +} + +func (m *mockORM) LoadChannelDefinitions(ctx context.Context, addr common.Address, donID uint32) (pd *PersistedDefinitions, err error) { + panic("not implemented") +} +func (m *mockORM) StoreChannelDefinitions(ctx context.Context, addr common.Address, donID, version uint32, dfns llotypes.ChannelDefinitions, blockNum int64) (err error) { + m.lastPersistedAddr = addr + m.lastPersistedDonID = donID + m.lastPersistedVersion = version + m.lastPersistedDfns = dfns + m.lastPersistedBlockNum = blockNum + return m.err +} + +func (m *mockORM) CleanupChannelDefinitions(ctx context.Context, addr common.Address, donID uint32) (err error) { + panic("not implemented") +} + +func makeLog(t *testing.T, donID, version uint32, url string, sha [32]byte) logpoller.Log { + data := makeLogData(t, donID, version, url, sha) + return logpoller.Log{EventSig: topicNewChannelDefinition, Topics: [][]byte{topicNewChannelDefinition[:], makeDonIDTopic(donID)}, Data: data} +} + +func makeLogData(t *testing.T, donID, version uint32, url string, sha [32]byte) []byte { + event := channelConfigStoreABI.Events[newChannelDefinitionEventName] + // donID is indexed + // version, url, sha + data, err := event.Inputs.NonIndexed().Pack(version, url, sha) + require.NoError(t, err) + return data +} + +func makeDonIDTopic(donID uint32) []byte { + return common.BigToHash(big.NewInt(int64(donID))).Bytes() +} + func Test_ChannelDefinitionCache(t *testing.T) { + donID := rand.Uint32() + t.Run("Definitions", func(t *testing.T) { // NOTE: this is covered more thoroughly in the integration tests dfns := llotypes.ChannelDefinitions(map[llotypes.ChannelID]llotypes.ChannelDefinition{ 1: { - ReportFormat: llotypes.ReportFormat(43), - ChainSelector: 42, - StreamIDs: []llotypes.StreamID{1, 2, 3}, + ReportFormat: llotypes.ReportFormat(43), + Streams: []llotypes.Stream{{StreamID: 1, Aggregator: llotypes.AggregatorMedian}, {StreamID: 2, Aggregator: llotypes.AggregatorMode}, {StreamID: 3, Aggregator: llotypes.AggregatorQuote}}, + Opts: llotypes.ChannelOpts{1, 2, 3}, }, }) @@ -23,4 +121,333 @@ func Test_ChannelDefinitionCache(t *testing.T) { assert.Equal(t, dfns, cdc.Definitions()) }) + + t.Run("readLogs", func(t *testing.T) { + lp := &mockLogPoller{latestBlockErr: sql.ErrNoRows} + newLogCh := make(chan *channel_config_store.ChannelConfigStoreNewChannelDefinition, 100) + cdc := &channelDefinitionCache{donID: donID, lp: lp, lggr: logger.TestSugared(t), newLogCh: newLogCh} + + t.Run("skips if logpoller has no blocks", func(t *testing.T) { + err := cdc.readLogs() + assert.NoError(t, err) + assert.Nil(t, cdc.newLog) + }) + t.Run("returns error on LatestBlock failure", func(t *testing.T) { + lp.latestBlockErr = errors.New("test error") + + err := cdc.readLogs() + assert.EqualError(t, err, "test error") + assert.Nil(t, cdc.newLog) + }) + t.Run("does nothing if LatestBlock older or the same as current channel definitions block", func(t *testing.T) { + lp.latestBlockErr = nil + lp.latestBlock = logpoller.LogPollerBlock{BlockNumber: 42} + cdc.definitionsBlockNum = 43 + + err := cdc.readLogs() + assert.NoError(t, err) + assert.Nil(t, cdc.newLog) + }) + t.Run("returns error if LogsWithSigs fails", func(t *testing.T) { + cdc.definitionsBlockNum = 0 + lp.logsWithSigsErr = errors.New("test error 2") + + err := cdc.readLogs() + assert.EqualError(t, err, "test error 2") + assert.Nil(t, cdc.newLog) + }) + t.Run("ignores logs with different topic", func(t *testing.T) { + lp.logsWithSigsErr = nil + lp.logsWithSigs = []logpoller.Log{{EventSig: common.Hash{1, 2, 3, 4}}} + + err := cdc.readLogs() + assert.NoError(t, err) + assert.Nil(t, cdc.newLog) + }) + t.Run("returns error if log is malformed", func(t *testing.T) { + lp.logsWithSigsErr = nil + lp.logsWithSigs = []logpoller.Log{{EventSig: topicNewChannelDefinition}} + + err := cdc.readLogs() + assert.EqualError(t, err, "failed to unpack log data: abi: attempting to unmarshal an empty string while arguments are expected") + assert.Nil(t, cdc.newLog) + }) + t.Run("sets definitions and sends on channel if LogsWithSigs returns new event with a later version", func(t *testing.T) { + lp.logsWithSigsErr = nil + lp.logsWithSigs = []logpoller.Log{makeLog(t, donID, uint32(43), "http://example.com/xxx.json", [32]byte{1, 2, 3, 4})} + + err := cdc.readLogs() + require.NoError(t, err) + require.NotNil(t, cdc.newLog) + assert.Equal(t, uint32(43), cdc.newLog.Version) + assert.Equal(t, "http://example.com/xxx.json", cdc.newLog.Url) + assert.Equal(t, [32]byte{1, 2, 3, 4}, cdc.newLog.Sha) + assert.Equal(t, int64(donID), cdc.newLog.DonId.Int64()) + + func() { + for { + select { + case log := <-newLogCh: + assert.Equal(t, cdc.newLog, log) + default: + return + } + } + }() + }) + t.Run("does nothing if version older or the same as the one currently set", func(t *testing.T) { + lp.logsWithSigsErr = nil + lp.logsWithSigs = []logpoller.Log{ + makeLog(t, donID, uint32(42), "http://example.com/xxx.json", [32]byte{1, 2, 3, 4}), + makeLog(t, donID, uint32(43), "http://example.com/xxx.json", [32]byte{1, 2, 3, 4}), + } + + err := cdc.readLogs() + require.NoError(t, err) + assert.Equal(t, uint32(43), cdc.newLog.Version) + }) + t.Run("in case of multiple logs, takes the latest", func(t *testing.T) { + lp.logsWithSigsErr = nil + lp.logsWithSigs = []logpoller.Log{ + makeLog(t, donID, uint32(42), "http://example.com/xxx.json", [32]byte{1, 2, 3, 4}), + makeLog(t, donID, uint32(45), "http://example.com/xxx2.json", [32]byte{2, 2, 3, 4}), + makeLog(t, donID, uint32(44), "http://example.com/xxx3.json", [32]byte{3, 2, 3, 4}), + makeLog(t, donID, uint32(43), "http://example.com/xxx4.json", [32]byte{4, 2, 3, 4}), + } + + err := cdc.readLogs() + require.NoError(t, err) + assert.Equal(t, uint32(45), cdc.newLog.Version) + assert.Equal(t, "http://example.com/xxx2.json", cdc.newLog.Url) + assert.Equal(t, [32]byte{2, 2, 3, 4}, cdc.newLog.Sha) + assert.Equal(t, int64(donID), cdc.newLog.DonId.Int64()) + + func() { + for { + select { + case log := <-newLogCh: + assert.Equal(t, cdc.newLog, log) + default: + return + } + } + }() + }) + t.Run("ignores logs with incorrect don ID", func(t *testing.T) { + lp.logsWithSigsErr = nil + lp.logsWithSigs = []logpoller.Log{ + makeLog(t, donID+1, uint32(42), "http://example.com/xxx.json", [32]byte{1, 2, 3, 4}), + } + + err := cdc.readLogs() + require.NoError(t, err) + assert.Equal(t, uint32(45), cdc.newLog.Version) + + func() { + for { + select { + case log := <-newLogCh: + t.Fatal("did not expect log with wrong donID, got: ", log) + default: + return + } + } + }() + }) + t.Run("ignores logs with wrong number of topics", func(t *testing.T) { + lp.logsWithSigsErr = nil + lg := makeLog(t, donID, uint32(42), "http://example.com/xxx.json", [32]byte{1, 2, 3, 4}) + lg.Topics = lg.Topics[:1] + lp.logsWithSigs = []logpoller.Log{lg} + + err := cdc.readLogs() + require.NoError(t, err) + assert.Equal(t, uint32(45), cdc.newLog.Version) + + func() { + for { + select { + case log := <-newLogCh: + t.Fatal("did not expect log with missing topics, got: ", log) + default: + return + } + } + }() + }) + }) + + t.Run("fetchChannelDefinitions", func(t *testing.T) { + c := &mockHTTPClient{} + cdc := &channelDefinitionCache{ + lggr: logger.TestSugared(t), + client: c, + httpLimit: 2048, + } + + t.Run("nil ctx returns error", func(t *testing.T) { + _, err := cdc.fetchChannelDefinitions(nil, "notvalid://foos", [32]byte{}) //nolint + assert.EqualError(t, err, "failed to create http.Request; net/http: nil Context") + }) + + t.Run("networking error while making request returns error", func(t *testing.T) { + ctx := tests.Context(t) + c.resp = nil + c.err = errors.New("http request failed") + + _, err := cdc.fetchChannelDefinitions(ctx, "http://example.com/definitions.json", [32]byte{}) + assert.EqualError(t, err, "error making http request: http request failed") + }) + + t.Run("server returns 500 returns error", func(t *testing.T) { + ctx := tests.Context(t) + c.err = nil + c.resp = &http.Response{StatusCode: 500, Body: io.NopCloser(bytes.NewReader([]byte{1, 2, 3}))} + + _, err := cdc.fetchChannelDefinitions(ctx, "http://example.com/definitions.json", [32]byte{}) + assert.EqualError(t, err, "got error from http://example.com/definitions.json: (status code: 500, response body: \x01\x02\x03)") + }) + + var largeBody = make([]byte, 2048) + for i := range largeBody { + largeBody[i] = 'a' + } + + t.Run("server returns 404 returns error (and does not log entirety of huge response body)", func(t *testing.T) { + ctx := tests.Context(t) + c.err = nil + c.resp = &http.Response{StatusCode: 404, Body: io.NopCloser(bytes.NewReader(largeBody))} + + _, err := cdc.fetchChannelDefinitions(ctx, "http://example.com/definitions.json", [32]byte{}) + assert.EqualError(t, err, "got error from http://example.com/definitions.json: (status code: 404, error reading response body: http: request body too large, response body: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)") + }) + + var hugeBody = make([]byte, 8096) + c.resp.Body = io.NopCloser(bytes.NewReader(hugeBody)) + + t.Run("server returns body that is too large", func(t *testing.T) { + ctx := tests.Context(t) + c.err = nil + c.resp = &http.Response{StatusCode: 200, Body: io.NopCloser(bytes.NewReader(hugeBody))} + + _, err := cdc.fetchChannelDefinitions(ctx, "http://example.com/definitions.json", [32]byte{}) + assert.EqualError(t, err, "failed to read from body: http: request body too large") + }) + + t.Run("server returns invalid JSON returns error", func(t *testing.T) { + ctx := tests.Context(t) + c.err = nil + c.resp = &http.Response{StatusCode: 200, Body: io.NopCloser(bytes.NewReader([]byte{1, 2, 3}))} + + _, err := cdc.fetchChannelDefinitions(ctx, "http://example.com/definitions.json", common.HexToHash("0xfd1780a6fc9ee0dab26ceb4b3941ab03e66ccd970d1db91612c66df4515b0a0a")) + assert.EqualError(t, err, "failed to decode JSON: invalid character '\\x01' looking for beginning of value") + }) + + t.Run("SHA mismatch returns error", func(t *testing.T) { + ctx := tests.Context(t) + c.err = nil + c.resp = &http.Response{StatusCode: 200, Body: io.NopCloser(bytes.NewReader([]byte(`{"foo":"bar"}`)))} + + _, err := cdc.fetchChannelDefinitions(ctx, "http://example.com/definitions.json", [32]byte{}) + assert.EqualError(t, err, "SHA3 mismatch: expected 0000000000000000000000000000000000000000000000000000000000000000, got 4d3304d0d87c27a031cbb6bdf95da79b7b4552c3d0bef2e5a94f50810121e1e0") + }) + + t.Run("valid JSON matching SHA returns channel definitions", func(t *testing.T) { + ctx := tests.Context(t) + chainSelector := 4949039107694359620 // arbitrum mainnet + feedID := [32]byte{00, 03, 107, 74, 167, 229, 124, 167, 182, 138, 225, 191, 69, 101, 63, 86, 182, 86, 253, 58, 163, 53, 239, 127, 174, 105, 107, 102, 63, 27, 132, 114} + expirationWindow := 3600 + multiplier := big.NewInt(1e18) + baseUSDFee := 10 + valid := fmt.Sprintf(` +{ + "42": { + "reportFormat": %d, + "chainSelector": %d, + "streams": [{"streamId": 52, "aggregator": %d}, {"streamId": 53, "aggregator": %d}, {"streamId": 55, "aggregator": %d}], + "opts": { + "feedId": "0x%x", + "expirationWindow": %d, + "multiplier": "%s", + "baseUSDFee": "%d" + } + } +}`, llotypes.ReportFormatEVMPremiumLegacy, chainSelector, llotypes.AggregatorMedian, llotypes.AggregatorMedian, llotypes.AggregatorQuote, feedID, expirationWindow, multiplier.String(), baseUSDFee) + + c.err = nil + c.resp = &http.Response{StatusCode: 200, Body: io.NopCloser(bytes.NewReader([]byte(valid)))} + + cd, err := cdc.fetchChannelDefinitions(ctx, "http://example.com/definitions.json", common.HexToHash("0x367bbc75f7b6c9fc66a98ea99f837ea7ac4a3c2d6a9ee284de018bd02c41b52d")) + assert.NoError(t, err) + assert.Equal(t, llotypes.ChannelDefinitions{0x2a: llotypes.ChannelDefinition{ReportFormat: 0x1, Streams: []llotypes.Stream{llotypes.Stream{StreamID: 0x34, Aggregator: 0x1}, llotypes.Stream{StreamID: 0x35, Aggregator: 0x1}, llotypes.Stream{StreamID: 0x37, Aggregator: 0x3}}, Opts: llotypes.ChannelOpts{0x7b, 0x22, 0x62, 0x61, 0x73, 0x65, 0x55, 0x53, 0x44, 0x46, 0x65, 0x65, 0x22, 0x3a, 0x22, 0x31, 0x30, 0x22, 0x2c, 0x22, 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x57, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x22, 0x3a, 0x33, 0x36, 0x30, 0x30, 0x2c, 0x22, 0x66, 0x65, 0x65, 0x64, 0x49, 0x64, 0x22, 0x3a, 0x22, 0x30, 0x78, 0x30, 0x30, 0x30, 0x33, 0x36, 0x62, 0x34, 0x61, 0x61, 0x37, 0x65, 0x35, 0x37, 0x63, 0x61, 0x37, 0x62, 0x36, 0x38, 0x61, 0x65, 0x31, 0x62, 0x66, 0x34, 0x35, 0x36, 0x35, 0x33, 0x66, 0x35, 0x36, 0x62, 0x36, 0x35, 0x36, 0x66, 0x64, 0x33, 0x61, 0x61, 0x33, 0x33, 0x35, 0x65, 0x66, 0x37, 0x66, 0x61, 0x65, 0x36, 0x39, 0x36, 0x62, 0x36, 0x36, 0x33, 0x66, 0x31, 0x62, 0x38, 0x34, 0x37, 0x32, 0x22, 0x2c, 0x22, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x22, 0x3a, 0x22, 0x31, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x22, 0x7d}}}, cd) + }) + }) + + t.Run("persist", func(t *testing.T) { + cdc := &channelDefinitionCache{ + lggr: logger.TestSugared(t), + orm: nil, + addr: testutils.NewAddress(), + donID: donID, + definitions: llotypes.ChannelDefinitions{ + 1: { + ReportFormat: llotypes.ReportFormat(43), + Streams: []llotypes.Stream{{StreamID: 1, Aggregator: llotypes.AggregatorMedian}, {StreamID: 2, Aggregator: llotypes.AggregatorMode}, {StreamID: 3, Aggregator: llotypes.AggregatorQuote}}, + Opts: llotypes.ChannelOpts{1, 2, 3}, + }, + }, + definitionsBlockNum: 142, + } + + t.Run("does nothing if persisted version is up-to-date", func(t *testing.T) { + ctx := tests.Context(t) + cdc.definitionsVersion = 42 + cdc.persistedVersion = 42 + + memoryVersion, persistedVersion, err := cdc.persist(ctx) + assert.NoError(t, err) + assert.Equal(t, uint32(42), memoryVersion) + assert.Equal(t, uint32(42), persistedVersion) + assert.Equal(t, uint32(42), cdc.persistedVersion) + }) + + orm := &mockORM{} + cdc.orm = orm + + t.Run("returns error on db failure and does not update persisted version", func(t *testing.T) { + ctx := tests.Context(t) + cdc.persistedVersion = 42 + cdc.definitionsVersion = 43 + orm.err = errors.New("test error") + + memoryVersion, persistedVersion, err := cdc.persist(ctx) + assert.EqualError(t, err, "test error") + assert.Equal(t, uint32(43), memoryVersion) + assert.Equal(t, uint32(42), persistedVersion) + assert.Equal(t, uint32(42), cdc.persistedVersion) + }) + + t.Run("updates persisted version on success", func(t *testing.T) { + ctx := tests.Context(t) + cdc.definitionsVersion = 43 + orm.err = nil + + memoryVersion, persistedVersion, err := cdc.persist(ctx) + assert.NoError(t, err) + assert.Equal(t, uint32(43), memoryVersion) + assert.Equal(t, uint32(43), persistedVersion) + assert.Equal(t, uint32(43), cdc.persistedVersion) + + assert.Equal(t, cdc.addr, orm.lastPersistedAddr) + assert.Equal(t, cdc.donID, orm.lastPersistedDonID) + assert.Equal(t, cdc.persistedVersion, orm.lastPersistedVersion) + assert.Equal(t, cdc.definitions, orm.lastPersistedDfns) + assert.Equal(t, cdc.definitionsBlockNum, orm.lastPersistedBlockNum) + }) + }) +} + +func Test_filterName(t *testing.T) { + s := filterName(common.Address{1, 2, 3}, 654) + assert.Equal(t, "OCR3 LLO ChannelDefinitionCachePoller - 0x0102030000000000000000000000000000000000:654", s) } diff --git a/core/services/llo/onchain_config.go b/core/services/llo/onchain_config.go deleted file mode 100644 index 7b5cfffaa9f..00000000000 --- a/core/services/llo/onchain_config.go +++ /dev/null @@ -1,21 +0,0 @@ -package llo - -type OnchainConfig struct{} - -type OnchainConfigCodec interface { - Encode(OnchainConfig) ([]byte, error) - Decode([]byte) (OnchainConfig, error) -} - -var _ OnchainConfigCodec = &JSONOnchainConfigCodec{} - -// TODO: Replace this with protobuf, if it is actually used for something -type JSONOnchainConfigCodec struct{} - -func (c *JSONOnchainConfigCodec) Encode(OnchainConfig) ([]byte, error) { - return nil, nil -} - -func (c *JSONOnchainConfigCodec) Decode([]byte) (OnchainConfig, error) { - return OnchainConfig{}, nil -} diff --git a/core/services/llo/orm.go b/core/services/llo/orm.go index 6b14e543268..5b132e6537b 100644 --- a/core/services/llo/orm.go +++ b/core/services/llo/orm.go @@ -3,10 +3,9 @@ package llo import ( "context" "database/sql" - "encoding/json" "errors" "fmt" - "math/big" + "time" "github.com/ethereum/go-ethereum/common" @@ -18,48 +17,60 @@ type ORM interface { ChannelDefinitionCacheORM } +type PersistedDefinitions struct { + ChainSelector uint64 `db:"chain_selector"` + Address common.Address `db:"addr"` + Definitions llotypes.ChannelDefinitions `db:"definitions"` + // The block number in which the log for this definitions was emitted + BlockNum int64 `db:"block_num"` + DonID uint32 `db:"don_id"` + Version uint32 `db:"version"` + UpdatedAt time.Time `db:"updated_at"` +} + var _ ORM = &orm{} type orm struct { - ds sqlutil.DataSource - evmChainID *big.Int + ds sqlutil.DataSource + chainSelector uint64 } -func NewORM(ds sqlutil.DataSource, evmChainID *big.Int) ORM { - return &orm{ds, evmChainID} +func NewORM(ds sqlutil.DataSource, chainSelector uint64) ORM { + return &orm{ds, chainSelector} } -func (o *orm) LoadChannelDefinitions(ctx context.Context, addr common.Address) (dfns llotypes.ChannelDefinitions, blockNum int64, err error) { - type scd struct { - Definitions []byte `db:"definitions"` - BlockNum int64 `db:"block_num"` - } - var scanned scd - err = o.ds.GetContext(ctx, &scanned, "SELECT definitions, block_num FROM channel_definitions WHERE evm_chain_id = $1 AND addr = $2", o.evmChainID.String(), addr) +func (o *orm) LoadChannelDefinitions(ctx context.Context, addr common.Address, donID uint32) (pd *PersistedDefinitions, err error) { + pd = new(PersistedDefinitions) + err = o.ds.GetContext(ctx, pd, "SELECT * FROM channel_definitions WHERE chain_selector = $1 AND addr = $2 AND don_id = $3", o.chainSelector, addr, donID) if errors.Is(err, sql.ErrNoRows) { - return dfns, blockNum, nil + return nil, nil } else if err != nil { - return nil, 0, fmt.Errorf("failed to LoadChannelDefinitions; %w", err) - } - - if err = json.Unmarshal(scanned.Definitions, &dfns); err != nil { - return nil, 0, fmt.Errorf("failed to LoadChannelDefinitions; JSON Unmarshal failure; %w", err) + return nil, fmt.Errorf("failed to LoadChannelDefinitions; %w", err) } - return dfns, scanned.BlockNum, nil + return pd, nil } -// TODO: Test this method -// https://smartcontract-it.atlassian.net/jira/software/c/projects/MERC/issues/MERC-3653 -func (o *orm) StoreChannelDefinitions(ctx context.Context, addr common.Address, dfns llotypes.ChannelDefinitions, blockNum int64) error { +// StoreChannelDefinitions will store a ChannelDefinitions list for a given chain_selector, addr, don_id +// It only updates if the new version is greater than the existing record +func (o *orm) StoreChannelDefinitions(ctx context.Context, addr common.Address, donID, version uint32, dfns llotypes.ChannelDefinitions, blockNum int64) error { _, err := o.ds.ExecContext(ctx, ` -INSERT INTO channel_definitions (evm_chain_id, addr, definitions, block_num, updated_at) -VALUES ($1, $2, $3, $4, NOW()) -ON CONFLICT (evm_chain_id, addr) DO UPDATE -SET definitions = $3, block_num = $4, updated_at = NOW() -`, o.evmChainID.String(), addr, dfns, blockNum) +INSERT INTO channel_definitions (chain_selector, addr, don_id, definitions, block_num, version, updated_at) +VALUES ($1, $2, $3, $4, $5, $6, NOW()) +ON CONFLICT (chain_selector, addr, don_id) DO UPDATE +SET definitions = $4, block_num = $5, version = $6, updated_at = NOW() +WHERE EXCLUDED.version > channel_definitions.version +`, o.chainSelector, addr, donID, dfns, blockNum, version) if err != nil { return fmt.Errorf("StoreChannelDefinitions failed: %w", err) } return nil } + +func (o *orm) CleanupChannelDefinitions(ctx context.Context, addr common.Address, donID uint32) error { + _, err := o.ds.ExecContext(ctx, "DELETE FROM channel_definitions WHERE chain_selector = $1 AND addr = $2 AND don_id = $3", o.chainSelector, addr, donID) + if err != nil { + return fmt.Errorf("failed to CleanupChannelDefinitions; %w", err) + } + return nil +} diff --git a/core/services/llo/orm_test.go b/core/services/llo/orm_test.go index a25a1bdea2f..ec3c06e6e64 100644 --- a/core/services/llo/orm_test.go +++ b/core/services/llo/orm_test.go @@ -15,23 +15,27 @@ import ( ) func Test_ORM(t *testing.T) { + const ETHMainnetChainSelector uint64 = 5009297550715157269 + const OtherChainSelector uint64 = 1234567890 + db := pgtest.NewSqlxDB(t) - orm := NewORM(db, testutils.FixtureChainID) + orm := NewORM(db, ETHMainnetChainSelector) ctx := testutils.Context(t) addr1 := testutils.NewAddress() addr2 := testutils.NewAddress() addr3 := testutils.NewAddress() + donID1 := uint32(1) + donID2 := uint32(2) + t.Run("LoadChannelDefinitions", func(t *testing.T) { t.Run("returns zero values if nothing in database", func(t *testing.T) { - cd, blockNum, err := orm.LoadChannelDefinitions(ctx, addr1) - require.NoError(t, err) - - assert.Zero(t, cd) - assert.Zero(t, blockNum) + pd, err := orm.LoadChannelDefinitions(ctx, addr1, donID1) + assert.NoError(t, err) + assert.Nil(t, pd) }) - t.Run("loads channel definitions from database", func(t *testing.T) { + t.Run("loads channel definitions from database for the given don ID", func(t *testing.T) { expectedBlockNum := rand.Int63() expectedBlockNum2 := rand.Int63() cid1 := rand.Uint32() @@ -42,59 +46,111 @@ func Test_ORM(t *testing.T) { "%d": { "reportFormat": 42, "chainSelector": 142, - "streamIds": [1, 2] + "streams": [{"streamId": 1, "aggregator": "median"}, {"streamId": 2, "aggregator": "mode"}], + "opts": {"foo":"bar"} }, "%d": { - "reportFormat": 42, + "reportFormat": 43, "chainSelector": 142, - "streamIds": [1, 3] + "streams": [{"streamId": 1, "aggregator": "median"}, {"streamId": 3, "aggregator": "quote"}] } } `, cid1, cid2) pgtest.MustExec(t, db, ` - INSERT INTO channel_definitions(addr, evm_chain_id, definitions, block_num, updated_at) - VALUES ( $1, $2, $3, $4, NOW()) - `, addr1, testutils.FixtureChainID.String(), channelDefsJSON, expectedBlockNum) + INSERT INTO channel_definitions(addr, chain_selector, don_id, definitions, block_num, version, updated_at) + VALUES ($1, $2, $3, $4, $5, $6, NOW()) + `, addr1, ETHMainnetChainSelector, 1, channelDefsJSON, expectedBlockNum, 1) pgtest.MustExec(t, db, ` - INSERT INTO channel_definitions(addr, evm_chain_id, definitions, block_num, updated_at) - VALUES ( $1, $2, $3, $4, NOW()) - `, addr2, testutils.FixtureChainID.String(), `{}`, expectedBlockNum2) + INSERT INTO channel_definitions(addr, chain_selector, don_id, definitions, block_num, version, updated_at) + VALUES ($1, $2, $3, $4, $5, $6, NOW()) + `, addr2, ETHMainnetChainSelector, 1, `{}`, expectedBlockNum2, 1) { - // alternative chain ID; we expect these ones to be ignored + // alternative chain selector; we expect these ones to be ignored pgtest.MustExec(t, db, ` - INSERT INTO channel_definitions(addr, evm_chain_id, definitions, block_num, updated_at) - VALUES ( $1, $2, $3, $4, NOW()) - `, addr1, testutils.SimulatedChainID.String(), channelDefsJSON, expectedBlockNum) + INSERT INTO channel_definitions(addr, chain_selector, don_id, definitions, block_num, version, updated_at) + VALUES ($1, $2, $3, $4, $5, $6, NOW()) + `, addr1, OtherChainSelector, 1, channelDefsJSON, expectedBlockNum, 1) pgtest.MustExec(t, db, ` - INSERT INTO channel_definitions(addr, evm_chain_id, definitions, block_num, updated_at) - VALUES ( $1, $2, $3, $4, NOW()) - `, addr3, testutils.SimulatedChainID.String(), channelDefsJSON, expectedBlockNum) + INSERT INTO channel_definitions(addr, chain_selector, don_id, definitions, block_num, version, updated_at) + VALUES ($1, $2, $3, $4, $5, $6, NOW()) + `, addr3, OtherChainSelector, 1, channelDefsJSON, expectedBlockNum, 1) } - cd, blockNum, err := orm.LoadChannelDefinitions(ctx, addr1) + pd, err := orm.LoadChannelDefinitions(ctx, addr1, donID1) require.NoError(t, err) + assert.Equal(t, ETHMainnetChainSelector, pd.ChainSelector) + assert.Equal(t, addr1, pd.Address) + assert.Equal(t, expectedBlockNum, pd.BlockNum) + assert.Equal(t, donID1, pd.DonID) + assert.Equal(t, uint32(1), pd.Version) assert.Equal(t, llotypes.ChannelDefinitions{ cid1: llotypes.ChannelDefinition{ - ReportFormat: 42, - ChainSelector: 142, - StreamIDs: []llotypes.StreamID{1, 2}, + ReportFormat: 42, + Streams: []llotypes.Stream{{StreamID: 1, Aggregator: llotypes.AggregatorMedian}, {StreamID: 2, Aggregator: llotypes.AggregatorMode}}, + Opts: []byte(`{"foo":"bar"}`), }, cid2: llotypes.ChannelDefinition{ - ReportFormat: 42, - ChainSelector: 142, - StreamIDs: []llotypes.StreamID{1, 3}, + ReportFormat: 43, + Streams: []llotypes.Stream{{StreamID: 1, Aggregator: llotypes.AggregatorMedian}, {StreamID: 3, Aggregator: llotypes.AggregatorQuote}}, }, - }, cd) - assert.Equal(t, expectedBlockNum, blockNum) + }, pd.Definitions) - cd, blockNum, err = orm.LoadChannelDefinitions(ctx, addr2) + // does not load erroneously for a different address + pd, err = orm.LoadChannelDefinitions(ctx, addr2, donID1) require.NoError(t, err) - assert.Equal(t, llotypes.ChannelDefinitions{}, cd) - assert.Equal(t, expectedBlockNum2, blockNum) + assert.Equal(t, llotypes.ChannelDefinitions{}, pd.Definitions) + assert.Equal(t, expectedBlockNum2, pd.BlockNum) + + // does not load erroneously for a different don ID + pd, err = orm.LoadChannelDefinitions(ctx, addr1, donID2) + require.NoError(t, err) + + assert.Equal(t, (*PersistedDefinitions)(nil), pd) + }) + }) + + t.Run("StoreChannelDefinitions", func(t *testing.T) { + expectedBlockNum := rand.Int63() + cid1 := rand.Uint32() + cid2 := rand.Uint32() + defs := llotypes.ChannelDefinitions{ + cid1: llotypes.ChannelDefinition{ + ReportFormat: llotypes.ReportFormatJSON, + Streams: []llotypes.Stream{{StreamID: 1, Aggregator: llotypes.AggregatorMedian}, {StreamID: 2, Aggregator: llotypes.AggregatorMode}}, + Opts: []byte(`{"foo":"bar"}`), + }, + cid2: llotypes.ChannelDefinition{ + ReportFormat: llotypes.ReportFormatEVMPremiumLegacy, + Streams: []llotypes.Stream{{StreamID: 1, Aggregator: llotypes.AggregatorMedian}, {StreamID: 3, Aggregator: llotypes.AggregatorQuote}}, + }, + } + + t.Run("stores channel definitions in the database", func(t *testing.T) { + err := orm.StoreChannelDefinitions(ctx, addr1, donID1, 42, defs, expectedBlockNum) + require.NoError(t, err) + + pd, err := orm.LoadChannelDefinitions(ctx, addr1, donID1) + require.NoError(t, err) + assert.Equal(t, ETHMainnetChainSelector, pd.ChainSelector) + assert.Equal(t, addr1, pd.Address) + assert.Equal(t, expectedBlockNum, pd.BlockNum) + assert.Equal(t, donID1, pd.DonID) + assert.Equal(t, uint32(42), pd.Version) + assert.Equal(t, defs, pd.Definitions) + }) + t.Run("does not update if version is older than the database persisted version", func(t *testing.T) { + // try to update with an older version + err := orm.StoreChannelDefinitions(ctx, addr1, donID1, 41, llotypes.ChannelDefinitions{}, expectedBlockNum) + require.NoError(t, err) + + pd, err := orm.LoadChannelDefinitions(ctx, addr1, donID1) + require.NoError(t, err) + assert.Equal(t, uint32(42), pd.Version) + assert.Equal(t, defs, pd.Definitions) }) }) } diff --git a/core/services/llo/static_channel_definitions_cache.go b/core/services/llo/static_channel_definitions_cache.go index 98ef3642cb7..980625bd599 100644 --- a/core/services/llo/static_channel_definitions_cache.go +++ b/core/services/llo/static_channel_definitions_cache.go @@ -7,7 +7,7 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/services" llotypes "github.com/smartcontractkit/chainlink-common/pkg/types/llo" - "github.com/smartcontractkit/chainlink/v2/core/logger" + "github.com/smartcontractkit/chainlink-common/pkg/logger" ) // A CDC that loads a static JSON of channel definitions; useful for @@ -27,7 +27,7 @@ func NewStaticChannelDefinitionCache(lggr logger.Logger, dfnstr string) (llotype if err := json.Unmarshal([]byte(dfnstr), &definitions); err != nil { return nil, err } - return &staticCDC{services.StateMachine{}, lggr.Named("StaticChannelDefinitionCache"), definitions}, nil + return &staticCDC{services.StateMachine{}, logger.Named(lggr, "StaticChannelDefinitionCache"), definitions}, nil } func (s *staticCDC) Start(context.Context) error { diff --git a/core/services/llo/telemetry.go b/core/services/llo/telemetry.go new file mode 100644 index 00000000000..62b586f5cc8 --- /dev/null +++ b/core/services/llo/telemetry.go @@ -0,0 +1,184 @@ +package llo + +import ( + "context" + "errors" + "fmt" + + "github.com/smartcontractkit/libocr/commontypes" + "google.golang.org/protobuf/proto" + + "github.com/smartcontractkit/chainlink-common/pkg/logger" + "github.com/smartcontractkit/chainlink-common/pkg/services" + "github.com/smartcontractkit/chainlink-data-streams/llo" + + "github.com/smartcontractkit/chainlink/v2/core/services/llo/evm" + "github.com/smartcontractkit/chainlink/v2/core/services/ocrcommon" + "github.com/smartcontractkit/chainlink/v2/core/services/pipeline" + "github.com/smartcontractkit/chainlink/v2/core/services/pipeline/eautils" + mercuryutils "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury/utils" + "github.com/smartcontractkit/chainlink/v2/core/services/synchronization/telem" +) + +const adapterLWBAErrorName = "AdapterLWBAError" + +type Telemeter interface { + EnqueueV3PremiumLegacy(run *pipeline.Run, trrs pipeline.TaskRunResults, streamID uint32, opts llo.DSOpts, val llo.StreamValue, err error) +} + +type TelemeterService interface { + Telemeter + services.Service +} + +func NewTelemeterService(lggr logger.Logger, monitoringEndpoint commontypes.MonitoringEndpoint) TelemeterService { + if monitoringEndpoint == nil { + return NullTelemeter + } + return newTelemeter(lggr, monitoringEndpoint) +} + +func newTelemeter(lggr logger.Logger, monitoringEndpoint commontypes.MonitoringEndpoint) *telemeter { + chTelemetryObservation := make(chan TelemetryObservation, 100) + t := &telemeter{ + chTelemetryObservation: chTelemetryObservation, + monitoringEndpoint: monitoringEndpoint, + } + t.Service, t.eng = services.Config{ + Name: "LLOTelemeterService", + Start: t.start, + }.NewServiceEngine(lggr) + + return t +} + +type telemeter struct { + services.Service + eng *services.Engine + + monitoringEndpoint commontypes.MonitoringEndpoint + chTelemetryObservation chan TelemetryObservation +} + +func (t *telemeter) EnqueueV3PremiumLegacy(run *pipeline.Run, trrs pipeline.TaskRunResults, streamID uint32, opts llo.DSOpts, val llo.StreamValue, err error) { + var adapterError *eautils.AdapterError + var dpInvariantViolationDetected bool + if errors.As(err, &adapterError) && adapterError.Name == adapterLWBAErrorName { + dpInvariantViolationDetected = true + } else if err != nil { + // ignore errors + return + } + tObs := TelemetryObservation{run, trrs, streamID, opts, val, dpInvariantViolationDetected} + select { + case t.chTelemetryObservation <- tObs: + default: + } +} + +func (t *telemeter) start(_ context.Context) error { + t.eng.Go(func(ctx context.Context) { + for { + select { + case tObs := <-t.chTelemetryObservation: + t.collectV3PremiumLegacyTelemetry(tObs) + case <-ctx.Done(): + return + } + } + }) + return nil +} + +func (t *telemeter) collectV3PremiumLegacyTelemetry(d TelemetryObservation) { + eaTelemetryValues := ocrcommon.ParseMercuryEATelemetry(t.eng.SugaredLogger, d.trrs, mercuryutils.REPORT_V3) + for _, eaTelem := range eaTelemetryValues { + var benchmarkPrice, bidPrice, askPrice int64 + var bp, bid, ask string + switch v := d.val.(type) { + case *llo.Decimal: + benchmarkPrice = v.Decimal().IntPart() + bp = v.Decimal().String() + case *llo.Quote: + benchmarkPrice = v.Benchmark.IntPart() + bp = v.Benchmark.String() + bidPrice = v.Bid.IntPart() + bid = v.Bid.String() + askPrice = v.Ask.IntPart() + ask = v.Ask.String() + } + epoch, round := evm.SeqNrToEpochAndRound(d.opts.OutCtx().SeqNr) + tea := &telem.EnhancedEAMercury{ + DataSource: eaTelem.DataSource, + DpBenchmarkPrice: eaTelem.DpBenchmarkPrice, + DpBid: eaTelem.DpBid, + DpAsk: eaTelem.DpAsk, + DpInvariantViolationDetected: d.dpInvariantViolationDetected, + BridgeTaskRunStartedTimestamp: eaTelem.BridgeTaskRunStartedTimestamp, + BridgeTaskRunEndedTimestamp: eaTelem.BridgeTaskRunEndedTimestamp, + ProviderRequestedTimestamp: eaTelem.ProviderRequestedTimestamp, + ProviderReceivedTimestamp: eaTelem.ProviderReceivedTimestamp, + ProviderDataStreamEstablished: eaTelem.ProviderDataStreamEstablished, + ProviderIndicatedTime: eaTelem.ProviderIndicatedTime, + Feed: fmt.Sprintf("streamID:%d", d.streamID), + ObservationBenchmarkPrice: benchmarkPrice, + ObservationBid: bidPrice, + ObservationAsk: askPrice, + ObservationBenchmarkPriceString: bp, + ObservationBidString: bid, + ObservationAskString: ask, + IsLinkFeed: false, + IsNativeFeed: false, + ConfigDigest: d.opts.ConfigDigest().Hex(), + Round: int64(round), + Epoch: int64(epoch), + AssetSymbol: eaTelem.AssetSymbol, + Version: uint32(1000 + mercuryutils.REPORT_V3), // add 1000 to distinguish between legacy feeds, this can be changed if necessary + } + + bytes, err := proto.Marshal(tea) + if err != nil { + t.eng.SugaredLogger.Warnf("protobuf marshal failed %v", err.Error()) + continue + } + + t.monitoringEndpoint.SendLog(bytes) + } +} + +type TelemetryObservation struct { + run *pipeline.Run + trrs pipeline.TaskRunResults + streamID uint32 + opts llo.DSOpts + val llo.StreamValue + dpInvariantViolationDetected bool +} + +var NullTelemeter TelemeterService = &nullTelemeter{} + +type nullTelemeter struct{} + +func (t *nullTelemeter) EnqueueV3PremiumLegacy(run *pipeline.Run, trrs pipeline.TaskRunResults, streamID uint32, opts llo.DSOpts, val llo.StreamValue, err error) { +} +func (t *nullTelemeter) Start(context.Context) error { + return nil +} +func (t *nullTelemeter) Close() error { + return nil +} +func (t *nullTelemeter) Healthy() error { + return nil +} +func (t *nullTelemeter) Unhealthy() error { + return nil +} +func (t *nullTelemeter) HealthReport() map[string]error { + return nil +} +func (t *nullTelemeter) Name() string { + return "NullTelemeter" +} +func (t *nullTelemeter) Ready() error { + return nil +} diff --git a/core/services/llo/telemetry_test.go b/core/services/llo/telemetry_test.go new file mode 100644 index 00000000000..ec77e959d24 --- /dev/null +++ b/core/services/llo/telemetry_test.go @@ -0,0 +1,216 @@ +package llo + +import ( + "errors" + "testing" + "time" + + "github.com/shopspring/decimal" + "github.com/smartcontractkit/libocr/commontypes" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" + "gopkg.in/guregu/null.v4" + + "github.com/smartcontractkit/chainlink-data-streams/llo" + "github.com/smartcontractkit/chainlink/v2/core/services/pipeline" + "github.com/smartcontractkit/chainlink/v2/core/services/pipeline/eautils" + "github.com/smartcontractkit/chainlink/v2/core/services/synchronization/telem" + + "github.com/smartcontractkit/chainlink-common/pkg/logger" + "github.com/smartcontractkit/chainlink-common/pkg/services/servicetest" +) + +var _ commontypes.MonitoringEndpoint = &mockMonitoringEndpoint{} + +type mockMonitoringEndpoint struct { + chLogs chan []byte +} + +func (m *mockMonitoringEndpoint) SendLog(log []byte) { + m.chLogs <- log +} + +const bridgeResponse = `{ + "meta":{ + "adapterName":"data-source-name" + }, + "timestamps":{ + "providerDataRequestedUnixMs":92233720368547760, + "providerDataReceivedUnixMs":-92233720368547760, + "providerDataStreamEstablishedUnixMs":1, + "providerIndicatedTimeUnixMs":-123456789 + } + }` + +var trrs = pipeline.TaskRunResults{ + pipeline.TaskRunResult{ + Task: &pipeline.BridgeTask{ + Name: "test-bridge-1", + BaseTask: pipeline.NewBaseTask(0, "ds1", nil, nil, 0), + RequestData: `{"data":{"from":"eth", "to":"usd"}}`, + }, + Result: pipeline.Result{ + Value: bridgeResponse, + }, + CreatedAt: time.Unix(0, 0), + FinishedAt: null.TimeFrom(time.Unix(0, 0)), + }, + pipeline.TaskRunResult{ + Task: &pipeline.JSONParseTask{ + BaseTask: pipeline.NewBaseTask(1, "ds1_parse", nil, nil, 1), + }, + Result: pipeline.Result{ + Value: "123456.123456789", + }, + }, + pipeline.TaskRunResult{ + Task: &pipeline.BridgeTask{ + Name: "test-bridge-2", + BaseTask: pipeline.NewBaseTask(0, "ds2", nil, nil, 0), + RequestData: `{"data":{"from":"eth", "to":"usd"}}`, + }, + Result: pipeline.Result{ + Value: bridgeResponse, + }, + CreatedAt: time.Unix(1, 0), + FinishedAt: null.TimeFrom(time.Unix(10, 0)), + }, + pipeline.TaskRunResult{ + Task: &pipeline.JSONParseTask{ + BaseTask: pipeline.NewBaseTask(1, "ds2_parse", nil, nil, 1), + }, + Result: pipeline.Result{ + Value: "12345678", + }, + }, + pipeline.TaskRunResult{ + Task: &pipeline.BridgeTask{ + Name: "test-bridge-3", + BaseTask: pipeline.NewBaseTask(0, "ds3", nil, nil, 0), + RequestData: `{"data":{"from":"eth", "to":"usd"}}`, + }, + Result: pipeline.Result{ + Value: bridgeResponse, + }, + CreatedAt: time.Unix(2, 0), + FinishedAt: null.TimeFrom(time.Unix(20, 0)), + }, + pipeline.TaskRunResult{ + Task: &pipeline.JSONParseTask{ + BaseTask: pipeline.NewBaseTask(1, "ds3_parse", nil, nil, 1), + }, + Result: pipeline.Result{ + Value: "1234567890", + }, + }, +} + +func Test_Telemeter(t *testing.T) { + lggr := logger.Test(t) + m := &mockMonitoringEndpoint{} + + run := &pipeline.Run{ID: 42} + streamID := uint32(135) + opts := &mockOpts{} + + t.Run("with error", func(t *testing.T) { + tm := newTelemeter(lggr, m) + servicetest.Run(t, tm) + + t.Run("if error is some random failure returns immediately", func(t *testing.T) { + // should return immediately and not even send on the channel + m.chLogs = nil + tm.EnqueueV3PremiumLegacy(run, trrs, streamID, opts, nil, errors.New("test error")) + }) + t.Run("if error is dp invariant violation, sets this flag", func(t *testing.T) { + m.chLogs = make(chan []byte, 100) + adapterError := new(eautils.AdapterError) + adapterError.Name = adapterLWBAErrorName + tm.EnqueueV3PremiumLegacy(run, trrs, streamID, opts, nil, adapterError) + + var i int + for log := range m.chLogs { + decoded := &telem.EnhancedEAMercury{} + require.NoError(t, proto.Unmarshal(log, decoded)) + assert.True(t, decoded.DpInvariantViolationDetected) + if i == 2 { + return + } + i++ + } + }) + }) + t.Run("with decimal value, sets all values correctly", func(t *testing.T) { + tm := newTelemeter(lggr, m) + val := llo.ToDecimal(decimal.NewFromFloat32(102.12)) + servicetest.Run(t, tm) + tm.EnqueueV3PremiumLegacy(run, trrs, streamID, opts, val, nil) + + var i int + for log := range m.chLogs { + decoded := &telem.EnhancedEAMercury{} + require.NoError(t, proto.Unmarshal(log, decoded)) + assert.Equal(t, int(1003), int(decoded.Version)) + assert.Equal(t, float64(123456.123456789), decoded.DpBenchmarkPrice) + assert.Zero(t, decoded.DpBid) + assert.Zero(t, decoded.DpAsk) + assert.False(t, decoded.DpInvariantViolationDetected) + assert.Zero(t, decoded.CurrentBlockNumber) + assert.Zero(t, decoded.CurrentBlockHash) + assert.Zero(t, decoded.CurrentBlockTimestamp) + assert.Zero(t, decoded.FetchMaxFinalizedTimestamp) + assert.Zero(t, decoded.MaxFinalizedTimestamp) + assert.Zero(t, decoded.ObservationTimestamp) + assert.False(t, decoded.IsLinkFeed) + assert.Zero(t, decoded.LinkPrice) + assert.False(t, decoded.IsNativeFeed) + assert.Zero(t, decoded.NativePrice) + assert.Equal(t, int64(i*1000), decoded.BridgeTaskRunStartedTimestamp) + assert.Equal(t, int64(i*10000), decoded.BridgeTaskRunEndedTimestamp) + assert.Equal(t, int64(92233720368547760), decoded.ProviderRequestedTimestamp) + assert.Equal(t, int64(-92233720368547760), decoded.ProviderReceivedTimestamp) + assert.Equal(t, int64(1), decoded.ProviderDataStreamEstablished) + assert.Equal(t, int64(-123456789), decoded.ProviderIndicatedTime) + assert.Equal(t, "streamID:135", decoded.Feed) + assert.Equal(t, int64(102), decoded.ObservationBenchmarkPrice) + assert.Equal(t, "102.12", decoded.ObservationBenchmarkPriceString) + assert.Zero(t, decoded.ObservationBid) + assert.Zero(t, decoded.ObservationBidString) + assert.Zero(t, decoded.ObservationAsk) + assert.Zero(t, decoded.ObservationAskString) + assert.Zero(t, decoded.ObservationMarketStatus) + assert.Equal(t, "0605040000000000000000000000000000000000000000000000000000000000", decoded.ConfigDigest) + assert.Equal(t, int64(18), decoded.Round) + assert.Equal(t, int64(4), decoded.Epoch) + assert.Equal(t, "eth/usd", decoded.AssetSymbol) + if i == 2 { + return + } + i++ + } + }) + t.Run("with quote value", func(t *testing.T) { + tm := newTelemeter(lggr, m) + val := &llo.Quote{Bid: decimal.NewFromFloat32(102.12), Benchmark: decimal.NewFromFloat32(103.32), Ask: decimal.NewFromFloat32(104.25)} + servicetest.Run(t, tm) + tm.EnqueueV3PremiumLegacy(run, trrs, streamID, opts, val, nil) + + var i int + for log := range m.chLogs { + decoded := &telem.EnhancedEAMercury{} + require.NoError(t, proto.Unmarshal(log, decoded)) + assert.Equal(t, int64(103), decoded.ObservationBenchmarkPrice) + assert.Equal(t, "103.32", decoded.ObservationBenchmarkPriceString) + assert.Equal(t, int64(102), decoded.ObservationBid) + assert.Equal(t, "102.12", decoded.ObservationBidString) + assert.Equal(t, int64(104), decoded.ObservationAsk) + assert.Equal(t, "104.25", decoded.ObservationAskString) + assert.Zero(t, decoded.ObservationMarketStatus) + if i == 2 { + return + } + i++ + } + }) +} diff --git a/core/services/llo/transmitter.go b/core/services/llo/transmitter.go index eef211ab5d5..3b7ef66e6a5 100644 --- a/core/services/llo/transmitter.go +++ b/core/services/llo/transmitter.go @@ -2,26 +2,24 @@ package llo import ( "context" - "crypto/ed25519" - "fmt" - "github.com/ethereum/go-ethereum/accounts/abi" - "github.com/smartcontractkit/libocr/offchainreporting2/chains/evmutil" "github.com/smartcontractkit/libocr/offchainreporting2plus/ocr3types" "github.com/smartcontractkit/libocr/offchainreporting2plus/types" ocr2types "github.com/smartcontractkit/libocr/offchainreporting2plus/types" + "golang.org/x/sync/errgroup" + "github.com/smartcontractkit/chainlink/v2/core/services/llo/mercurytransmitter" + + "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink-common/pkg/services" llotypes "github.com/smartcontractkit/chainlink-common/pkg/types/llo" - - "github.com/smartcontractkit/chainlink/v2/core/logger" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ocr2key" - "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury/wsrpc" - "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury/wsrpc/pb" ) // LLO Transmitter implementation, based on // core/services/relay/evm/mercury/transmitter.go +// +// If you need to "fan-out" transmits and send reports to a new destination, +// add a new subTransmitter // TODO: prom metrics (common with mercury/transmitter.go?) // https://smartcontract-it.atlassian.net/browse/MERC-3659 @@ -36,25 +34,6 @@ const ( // transmitTimeout = 5 * time.Second ) -var PayloadTypes = getPayloadTypes() - -func getPayloadTypes() abi.Arguments { - mustNewType := func(t string) abi.Type { - result, err := abi.NewType(t, "", []abi.ArgumentMarshaling{}) - if err != nil { - panic(fmt.Sprintf("Unexpected error during abi.NewType: %s", err)) - } - return result - } - return abi.Arguments([]abi.Argument{ - {Name: "reportContext", Type: mustNewType("bytes32[2]")}, - {Name: "report", Type: mustNewType("bytes")}, - {Name: "rawRs", Type: mustNewType("bytes32[]")}, - {Name: "rawSs", Type: mustNewType("bytes32[]")}, - {Name: "rawVs", Type: mustNewType("bytes32")}, - }) -} - type Transmitter interface { llotypes.Transmitter services.Service @@ -63,30 +42,57 @@ type Transmitter interface { type transmitter struct { services.StateMachine lggr logger.Logger - rpcClient wsrpc.Client fromAccount string + + subTransmitters []Transmitter +} + +type TransmitterOpts struct { + Lggr logger.Logger + FromAccount string + MercuryTransmitterOpts mercurytransmitter.Opts } -func NewTransmitter(lggr logger.Logger, rpcClient wsrpc.Client, fromAccount ed25519.PublicKey) Transmitter { +// The transmitter will handle starting and stopping the subtransmitters +func NewTransmitter(opts TransmitterOpts) Transmitter { + subTransmitters := []Transmitter{ + mercurytransmitter.New(opts.MercuryTransmitterOpts), + } return &transmitter{ services.StateMachine{}, - lggr, - rpcClient, - fmt.Sprintf("%x", fromAccount), + opts.Lggr, + opts.FromAccount, + subTransmitters, } } func (t *transmitter) Start(ctx context.Context) error { - return nil + return t.StartOnce("llo.Transmitter", func() error { + for _, st := range t.subTransmitters { + if err := st.Start(ctx); err != nil { + return err + } + } + return nil + }) } func (t *transmitter) Close() error { - return nil + return t.StopOnce("llo.Transmitter", func() error { + for _, st := range t.subTransmitters { + if err := st.Close(); err != nil { + return err + } + } + return nil + }) } func (t *transmitter) HealthReport() map[string]error { report := map[string]error{t.Name(): t.Healthy()} - services.CopyHealth(report, t.rpcClient.HealthReport()) + for _, st := range t.subTransmitters { + services.CopyHealth(report, st.HealthReport()) + } return report } @@ -99,52 +105,14 @@ func (t *transmitter) Transmit( report ocr3types.ReportWithInfo[llotypes.ReportInfo], sigs []types.AttributedOnchainSignature, ) (err error) { - var payload []byte - - switch report.Info.ReportFormat { - case llotypes.ReportFormatJSON: - fallthrough - case llotypes.ReportFormatEVM: - payload, err = encodeEVM(digest, seqNr, report.Report, sigs) - default: - return fmt.Errorf("Transmit failed; unsupported report format: %q", report.Info.ReportFormat) - } - - if err != nil { - return fmt.Errorf("Transmit: encode failed; %w", err) - } - - req := &pb.TransmitRequest{ - Payload: payload, - ReportFormat: uint32(report.Info.ReportFormat), - } - - // TODO: persistenceManager and queueing, error handling, retry etc - // https://smartcontract-it.atlassian.net/browse/MERC-3659 - _, err = t.rpcClient.Transmit(ctx, req) - return err -} - -func encodeEVM(digest types.ConfigDigest, seqNr uint64, report ocr2types.Report, sigs []types.AttributedOnchainSignature) ([]byte, error) { - var rs [][32]byte - var ss [][32]byte - var vs [32]byte - for i, as := range sigs { - r, s, v, err := evmutil.SplitSignature(as.Signature) - if err != nil { - return nil, fmt.Errorf("eventTransmit(ev): error in SplitSignature: %w", err) - } - rs = append(rs, r) - ss = append(ss, s) - vs[i] = v - } - rawReportCtx := ocr2key.RawReportContext3(digest, seqNr) - - payload, err := PayloadTypes.Pack(rawReportCtx, []byte(report), rs, ss, vs) - if err != nil { - return nil, fmt.Errorf("abi.Pack failed; %w", err) + g := new(errgroup.Group) + for _, st := range t.subTransmitters { + st := st + g.Go(func() error { + return st.Transmit(ctx, digest, seqNr, report, sigs) + }) } - return payload, nil + return g.Wait() } // FromAccount returns the stringified (hex) CSA public key diff --git a/core/services/llo/transmitter_test.go b/core/services/llo/transmitter_test.go deleted file mode 100644 index eb231494c0b..00000000000 --- a/core/services/llo/transmitter_test.go +++ /dev/null @@ -1,7 +0,0 @@ -package llo - -import "testing" - -func Test_Transmitter(t *testing.T) { - // TODO: https://smartcontract-it.atlassian.net/browse/MERC-3659 -} diff --git a/core/services/mocks/checker.go b/core/services/mocks/checker.go index 71b5f301a50..55ff97f764c 100644 --- a/core/services/mocks/checker.go +++ b/core/services/mocks/checker.go @@ -12,6 +12,14 @@ type Checker struct { mock.Mock } +type Checker_Expecter struct { + mock *mock.Mock +} + +func (_m *Checker) EXPECT() *Checker_Expecter { + return &Checker_Expecter{mock: &_m.Mock} +} + // Close provides a mock function with given fields: func (_m *Checker) Close() error { ret := _m.Called() @@ -30,6 +38,33 @@ func (_m *Checker) Close() error { return r0 } +// Checker_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close' +type Checker_Close_Call struct { + *mock.Call +} + +// Close is a helper method to define mock.On call +func (_e *Checker_Expecter) Close() *Checker_Close_Call { + return &Checker_Close_Call{Call: _e.mock.On("Close")} +} + +func (_c *Checker_Close_Call) Run(run func()) *Checker_Close_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Checker_Close_Call) Return(_a0 error) *Checker_Close_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Checker_Close_Call) RunAndReturn(run func() error) *Checker_Close_Call { + _c.Call.Return(run) + return _c +} + // IsHealthy provides a mock function with given fields: func (_m *Checker) IsHealthy() (bool, map[string]error) { ret := _m.Called() @@ -60,6 +95,33 @@ func (_m *Checker) IsHealthy() (bool, map[string]error) { return r0, r1 } +// Checker_IsHealthy_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsHealthy' +type Checker_IsHealthy_Call struct { + *mock.Call +} + +// IsHealthy is a helper method to define mock.On call +func (_e *Checker_Expecter) IsHealthy() *Checker_IsHealthy_Call { + return &Checker_IsHealthy_Call{Call: _e.mock.On("IsHealthy")} +} + +func (_c *Checker_IsHealthy_Call) Run(run func()) *Checker_IsHealthy_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Checker_IsHealthy_Call) Return(healthy bool, errors map[string]error) *Checker_IsHealthy_Call { + _c.Call.Return(healthy, errors) + return _c +} + +func (_c *Checker_IsHealthy_Call) RunAndReturn(run func() (bool, map[string]error)) *Checker_IsHealthy_Call { + _c.Call.Return(run) + return _c +} + // IsReady provides a mock function with given fields: func (_m *Checker) IsReady() (bool, map[string]error) { ret := _m.Called() @@ -90,6 +152,33 @@ func (_m *Checker) IsReady() (bool, map[string]error) { return r0, r1 } +// Checker_IsReady_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsReady' +type Checker_IsReady_Call struct { + *mock.Call +} + +// IsReady is a helper method to define mock.On call +func (_e *Checker_Expecter) IsReady() *Checker_IsReady_Call { + return &Checker_IsReady_Call{Call: _e.mock.On("IsReady")} +} + +func (_c *Checker_IsReady_Call) Run(run func()) *Checker_IsReady_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Checker_IsReady_Call) Return(ready bool, errors map[string]error) *Checker_IsReady_Call { + _c.Call.Return(ready, errors) + return _c +} + +func (_c *Checker_IsReady_Call) RunAndReturn(run func() (bool, map[string]error)) *Checker_IsReady_Call { + _c.Call.Return(run) + return _c +} + // Register provides a mock function with given fields: service func (_m *Checker) Register(service pkgservices.HealthReporter) error { ret := _m.Called(service) @@ -108,6 +197,34 @@ func (_m *Checker) Register(service pkgservices.HealthReporter) error { return r0 } +// Checker_Register_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Register' +type Checker_Register_Call struct { + *mock.Call +} + +// Register is a helper method to define mock.On call +// - service pkgservices.HealthReporter +func (_e *Checker_Expecter) Register(service interface{}) *Checker_Register_Call { + return &Checker_Register_Call{Call: _e.mock.On("Register", service)} +} + +func (_c *Checker_Register_Call) Run(run func(service pkgservices.HealthReporter)) *Checker_Register_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(pkgservices.HealthReporter)) + }) + return _c +} + +func (_c *Checker_Register_Call) Return(_a0 error) *Checker_Register_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Checker_Register_Call) RunAndReturn(run func(pkgservices.HealthReporter) error) *Checker_Register_Call { + _c.Call.Return(run) + return _c +} + // Start provides a mock function with given fields: func (_m *Checker) Start() error { ret := _m.Called() @@ -126,6 +243,33 @@ func (_m *Checker) Start() error { return r0 } +// Checker_Start_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Start' +type Checker_Start_Call struct { + *mock.Call +} + +// Start is a helper method to define mock.On call +func (_e *Checker_Expecter) Start() *Checker_Start_Call { + return &Checker_Start_Call{Call: _e.mock.On("Start")} +} + +func (_c *Checker_Start_Call) Run(run func()) *Checker_Start_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Checker_Start_Call) Return(_a0 error) *Checker_Start_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Checker_Start_Call) RunAndReturn(run func() error) *Checker_Start_Call { + _c.Call.Return(run) + return _c +} + // Unregister provides a mock function with given fields: name func (_m *Checker) Unregister(name string) error { ret := _m.Called(name) @@ -144,6 +288,34 @@ func (_m *Checker) Unregister(name string) error { return r0 } +// Checker_Unregister_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Unregister' +type Checker_Unregister_Call struct { + *mock.Call +} + +// Unregister is a helper method to define mock.On call +// - name string +func (_e *Checker_Expecter) Unregister(name interface{}) *Checker_Unregister_Call { + return &Checker_Unregister_Call{Call: _e.mock.On("Unregister", name)} +} + +func (_c *Checker_Unregister_Call) Run(run func(name string)) *Checker_Unregister_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Checker_Unregister_Call) Return(_a0 error) *Checker_Unregister_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Checker_Unregister_Call) RunAndReturn(run func(string) error) *Checker_Unregister_Call { + _c.Call.Return(run) + return _c +} + // NewChecker creates a new instance of Checker. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewChecker(t interface { diff --git a/core/services/nurse.go b/core/services/nurse.go index a9069b5181d..7f3cad13e71 100644 --- a/core/services/nurse.go +++ b/core/services/nurse.go @@ -3,6 +3,7 @@ package services import ( "bytes" "compress/gzip" + "context" "fmt" "io/fs" "os" @@ -19,22 +20,21 @@ import ( commonconfig "github.com/smartcontractkit/chainlink-common/pkg/config" "github.com/smartcontractkit/chainlink-common/pkg/services" + "github.com/smartcontractkit/chainlink-common/pkg/timeutil" "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/utils" ) type Nurse struct { - services.StateMachine + services.Service + eng *services.Engine cfg Config - log logger.Logger checks map[string]CheckFunc checksMu sync.RWMutex chGather chan gatherRequest - chStop chan struct{} - wgDone sync.WaitGroup } type Config interface { @@ -66,85 +66,63 @@ const ( ) func NewNurse(cfg Config, log logger.Logger) *Nurse { - return &Nurse{ + n := &Nurse{ cfg: cfg, - log: log.Named("Nurse"), checks: make(map[string]CheckFunc), chGather: make(chan gatherRequest, 1), - chStop: make(chan struct{}), } + n.Service, n.eng = services.Config{ + Name: "Nurse", + Start: n.start, + }.NewServiceEngine(log) + + return n } -func (n *Nurse) Start() error { - return n.StartOnce("Nurse", func() error { - // This must be set *once*, and it must occur as early as possible - if n.cfg.MemProfileRate() != runtime.MemProfileRate { - runtime.MemProfileRate = n.cfg.BlockProfileRate() - } +func (n *Nurse) start(_ context.Context) error { + // This must be set *once*, and it must occur as early as possible + if n.cfg.MemProfileRate() != runtime.MemProfileRate { + runtime.MemProfileRate = n.cfg.BlockProfileRate() + } - n.log.Debugf("Starting nurse with config %+v", n.cfg) - runtime.SetCPUProfileRate(n.cfg.CPUProfileRate()) - runtime.SetBlockProfileRate(n.cfg.BlockProfileRate()) - runtime.SetMutexProfileFraction(n.cfg.MutexProfileFraction()) + n.eng.Debugf("Starting nurse with config %+v", n.cfg) + runtime.SetCPUProfileRate(n.cfg.CPUProfileRate()) + runtime.SetBlockProfileRate(n.cfg.BlockProfileRate()) + runtime.SetMutexProfileFraction(n.cfg.MutexProfileFraction()) - err := utils.EnsureDirAndMaxPerms(n.cfg.ProfileRoot(), 0744) - if err != nil { - return err - } + err := utils.EnsureDirAndMaxPerms(n.cfg.ProfileRoot(), 0744) + if err != nil { + return err + } - n.AddCheck("mem", n.checkMem) - n.AddCheck("goroutines", n.checkGoroutines) - - n.wgDone.Add(1) - // Checker - go func() { - defer n.wgDone.Done() - for { - select { - case <-n.chStop: - return - case <-time.After(n.cfg.PollInterval().Duration()): - } - - func() { - n.checksMu.RLock() - defer n.checksMu.RUnlock() - for reason, checkFunc := range n.checks { - if unwell, meta := checkFunc(); unwell { - n.GatherVitals(reason, meta) - break - } - } - }() - } - }() - - n.wgDone.Add(1) - // Responder - go func() { - defer n.wgDone.Done() - for { - select { - case <-n.chStop: - return - case req := <-n.chGather: - n.gatherVitals(req.reason, req.meta) - } - } - }() + n.AddCheck("mem", n.checkMem) + n.AddCheck("goroutines", n.checkGoroutines) - return nil + // Checker + n.eng.GoTick(timeutil.NewTicker(n.cfg.PollInterval().Duration), func(ctx context.Context) { + n.checksMu.RLock() + defer n.checksMu.RUnlock() + for reason, checkFunc := range n.checks { + if unwell, meta := checkFunc(); unwell { + n.GatherVitals(ctx, reason, meta) + break + } + } }) -} -func (n *Nurse) Close() error { - return n.StopOnce("Nurse", func() error { - n.log.Debug("Nurse closing...") - defer n.log.Debug("Nurse closed") - close(n.chStop) - n.wgDone.Wait() - return nil + // Responder + n.eng.Go(func(ctx context.Context) { + for { + select { + case <-ctx.Done(): + return + case req := <-n.chGather: + n.gatherVitals(req.reason, req.meta) + } + } }) + + return nil } func (n *Nurse) AddCheck(reason string, checkFunc CheckFunc) { @@ -153,9 +131,9 @@ func (n *Nurse) AddCheck(reason string, checkFunc CheckFunc) { n.checks[reason] = checkFunc } -func (n *Nurse) GatherVitals(reason string, meta Meta) { +func (n *Nurse) GatherVitals(ctx context.Context, reason string, meta Meta) { select { - case <-n.chStop: + case <-ctx.Done(): case n.chGather <- gatherRequest{reason, meta}: default: } @@ -189,14 +167,14 @@ func (n *Nurse) checkGoroutines() (bool, Meta) { func (n *Nurse) gatherVitals(reason string, meta Meta) { loggerFields := (logger.Fields{"reason": reason}).Merge(logger.Fields(meta)) - n.log.Debugw("Nurse is gathering vitals", loggerFields.Slice()...) + n.eng.Debugw("Nurse is gathering vitals", loggerFields.Slice()...) size, err := n.totalProfileBytes() if err != nil { - n.log.Errorw("could not fetch total profile bytes", loggerFields.With("err", err).Slice()...) + n.eng.Errorw("could not fetch total profile bytes", loggerFields.With("err", err).Slice()...) return } else if size >= uint64(n.cfg.MaxProfileSize()) { - n.log.Warnw("cannot write pprof profile, total profile size exceeds configured PPROF_MAX_PROFILE_SIZE", + n.eng.Warnw("cannot write pprof profile, total profile size exceeds configured PPROF_MAX_PROFILE_SIZE", loggerFields.With("total", size, "max", n.cfg.MaxProfileSize()).Slice()..., ) return @@ -206,7 +184,7 @@ func (n *Nurse) gatherVitals(reason string, meta Meta) { err = n.appendLog(now, reason, meta) if err != nil { - n.log.Warnw("cannot write pprof profile", loggerFields.With("err", err).Slice()...) + n.eng.Warnw("cannot write pprof profile", loggerFields.With("err", err).Slice()...) return } var wg sync.WaitGroup @@ -227,7 +205,7 @@ func (n *Nurse) gatherVitals(reason string, meta Meta) { wg.Add(1) go n.gather("heap", now, &wg) } else { - n.log.Info("skipping heap collection because runtime.MemProfileRate = 0") + n.eng.Info("skipping heap collection because runtime.MemProfileRate = 0") } wg.Add(1) @@ -236,15 +214,13 @@ func (n *Nurse) gatherVitals(reason string, meta Meta) { go n.gather("threadcreate", now, &wg) ch := make(chan struct{}) - n.wgDone.Add(1) - go func() { - defer n.wgDone.Done() + n.eng.Go(func(ctx context.Context) { defer close(ch) wg.Wait() - }() + }) select { - case <-n.chStop: + case <-n.eng.StopChan: case <-ch: } } @@ -252,7 +228,7 @@ func (n *Nurse) gatherVitals(reason string, meta Meta) { func (n *Nurse) appendLog(now time.Time, reason string, meta Meta) error { filename := filepath.Join(n.cfg.ProfileRoot(), "nurse.log") - n.log.Debugf("creating nurse log %s", filename) + n.eng.Debugf("creating nurse log %s", filename) file, err := os.Create(filename) if err != nil { @@ -288,34 +264,34 @@ func (n *Nurse) appendLog(now time.Time, reason string, meta Meta) error { func (n *Nurse) gatherCPU(now time.Time, wg *sync.WaitGroup) { defer wg.Done() - n.log.Debugf("gather cpu %d ...", now.UnixMicro()) - defer n.log.Debugf("gather cpu %d done", now.UnixMicro()) + n.eng.Debugf("gather cpu %d ...", now.UnixMicro()) + defer n.eng.Debugf("gather cpu %d done", now.UnixMicro()) wc, err := n.createFile(now, cpuProfName, false) if err != nil { - n.log.Errorw("could not write cpu profile", "err", err) + n.eng.Errorw("could not write cpu profile", "err", err) return } defer wc.Close() err = pprof.StartCPUProfile(wc) if err != nil { - n.log.Errorw("could not start cpu profile", "err", err) + n.eng.Errorw("could not start cpu profile", "err", err) return } select { - case <-n.chStop: - n.log.Debug("gather cpu received stop") + case <-n.eng.StopChan: + n.eng.Debug("gather cpu received stop") case <-time.After(n.cfg.GatherDuration().Duration()): - n.log.Debugf("gather cpu duration elapsed %s. stoping profiling.", n.cfg.GatherDuration().Duration().String()) + n.eng.Debugf("gather cpu duration elapsed %s. stoping profiling.", n.cfg.GatherDuration().Duration().String()) } pprof.StopCPUProfile() err = wc.Close() if err != nil { - n.log.Errorw("could not close cpu profile", "err", err) + n.eng.Errorw("could not close cpu profile", "err", err) return } } @@ -323,23 +299,23 @@ func (n *Nurse) gatherCPU(now time.Time, wg *sync.WaitGroup) { func (n *Nurse) gatherTrace(now time.Time, wg *sync.WaitGroup) { defer wg.Done() - n.log.Debugf("gather trace %d ...", now.UnixMicro()) - defer n.log.Debugf("gather trace %d done", now.UnixMicro()) + n.eng.Debugf("gather trace %d ...", now.UnixMicro()) + defer n.eng.Debugf("gather trace %d done", now.UnixMicro()) wc, err := n.createFile(now, traceProfName, true) if err != nil { - n.log.Errorw("could not write trace profile", "err", err) + n.eng.Errorw("could not write trace profile", "err", err) return } defer wc.Close() err = trace.Start(wc) if err != nil { - n.log.Errorw("could not start trace profile", "err", err) + n.eng.Errorw("could not start trace profile", "err", err) return } select { - case <-n.chStop: + case <-n.eng.StopChan: case <-time.After(n.cfg.GatherTraceDuration().Duration()): } @@ -347,7 +323,7 @@ func (n *Nurse) gatherTrace(now time.Time, wg *sync.WaitGroup) { err = wc.Close() if err != nil { - n.log.Errorw("could not close trace profile", "err", err) + n.eng.Errorw("could not close trace profile", "err", err) return } } @@ -355,18 +331,18 @@ func (n *Nurse) gatherTrace(now time.Time, wg *sync.WaitGroup) { func (n *Nurse) gather(typ string, now time.Time, wg *sync.WaitGroup) { defer wg.Done() - n.log.Debugf("gather %s %d ...", typ, now.UnixMicro()) - n.log.Debugf("gather %s %d done", typ, now.UnixMicro()) + n.eng.Debugf("gather %s %d ...", typ, now.UnixMicro()) + n.eng.Debugf("gather %s %d done", typ, now.UnixMicro()) p := pprof.Lookup(typ) if p == nil { - n.log.Errorf("Invariant violation: pprof type '%v' does not exist", typ) + n.eng.Errorf("Invariant violation: pprof type '%v' does not exist", typ) return } p0, err := collectProfile(p) if err != nil { - n.log.Errorw(fmt.Sprintf("could not collect %v profile", typ), "err", err) + n.eng.Errorw(fmt.Sprintf("could not collect %v profile", typ), "err", err) return } @@ -374,14 +350,14 @@ func (n *Nurse) gather(typ string, now time.Time, wg *sync.WaitGroup) { defer t.Stop() select { - case <-n.chStop: + case <-n.eng.StopChan: return case <-t.C: } p1, err := collectProfile(p) if err != nil { - n.log.Errorw(fmt.Sprintf("could not collect %v profile", typ), "err", err) + n.eng.Errorw(fmt.Sprintf("could not collect %v profile", typ), "err", err) return } ts := p1.TimeNanos @@ -391,7 +367,7 @@ func (n *Nurse) gather(typ string, now time.Time, wg *sync.WaitGroup) { p1, err = profile.Merge([]*profile.Profile{p0, p1}) if err != nil { - n.log.Errorw(fmt.Sprintf("could not compute delta for %v profile", typ), "err", err) + n.eng.Errorw(fmt.Sprintf("could not compute delta for %v profile", typ), "err", err) return } @@ -400,19 +376,19 @@ func (n *Nurse) gather(typ string, now time.Time, wg *sync.WaitGroup) { wc, err := n.createFile(now, typ, false) if err != nil { - n.log.Errorw(fmt.Sprintf("could not write %v profile", typ), "err", err) + n.eng.Errorw(fmt.Sprintf("could not write %v profile", typ), "err", err) return } defer wc.Close() err = p1.Write(wc) if err != nil { - n.log.Errorw(fmt.Sprintf("could not write %v profile", typ), "err", err) + n.eng.Errorw(fmt.Sprintf("could not write %v profile", typ), "err", err) return } err = wc.Close() if err != nil { - n.log.Errorw(fmt.Sprintf("could not close file for %v profile", typ), "err", err) + n.eng.Errorw(fmt.Sprintf("could not close file for %v profile", typ), "err", err) return } } @@ -437,7 +413,7 @@ func (n *Nurse) createFile(now time.Time, typ string, shouldGzip bool) (*utils.D filename += ".gz" } fullpath := filepath.Join(n.cfg.ProfileRoot(), filename) - n.log.Debugf("creating file %s", fullpath) + n.eng.Debugf("creating file %s", fullpath) file, err := os.Create(fullpath) if err != nil { diff --git a/core/services/nurse_test.go b/core/services/nurse_test.go index 4597eeb456b..ed6f6872dc9 100644 --- a/core/services/nurse_test.go +++ b/core/services/nurse_test.go @@ -10,6 +10,7 @@ import ( "github.com/stretchr/testify/require" commonconfig "github.com/smartcontractkit/chainlink-common/pkg/config" + "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/utils" @@ -102,7 +103,7 @@ func TestNurse(t *testing.T) { nrse := NewNurse(newMockConfig(t), l) nrse.AddCheck("test", func() (bool, Meta) { return true, Meta{} }) - require.NoError(t, nrse.Start()) + require.NoError(t, nrse.Start(tests.Context(t))) defer func() { require.NoError(t, nrse.Close()) }() require.NoError(t, nrse.appendLog(time.Now(), "test", Meta{})) diff --git a/core/services/ocr/contract_tracker.go b/core/services/ocr/contract_tracker.go index 8da17908d11..d7199874a9f 100644 --- a/core/services/ocr/contract_tracker.go +++ b/core/services/ocr/contract_tracker.go @@ -47,7 +47,6 @@ var ( OCRContractLatestRoundRequested = getEventTopic("RoundRequested") ) -//go:generate mockery --quiet --name OCRContractTrackerDB --output ./mocks/ --case=underscore type ( // OCRContractTracker complies with ContractConfigTracker interface and // handles log events related to the contract more generally @@ -400,7 +399,7 @@ func (t *OCRContractTracker) LatestBlockHeight(ctx context.Context) (blockheight // care about the block height; we have no way of getting the L1 block // height anyway return 0, nil - case "", chaintype.ChainArbitrum, chaintype.ChainCelo, chaintype.ChainGnosis, chaintype.ChainKroma, chaintype.ChainOptimismBedrock, chaintype.ChainScroll, chaintype.ChainWeMix, chaintype.ChainXLayer, chaintype.ChainZkEvm, chaintype.ChainZkSync: + case "", chaintype.ChainArbitrum, chaintype.ChainAstar, chaintype.ChainCelo, chaintype.ChainGnosis, chaintype.ChainHedera, chaintype.ChainKroma, chaintype.ChainOptimismBedrock, chaintype.ChainScroll, chaintype.ChainWeMix, chaintype.ChainXLayer, chaintype.ChainZkEvm, chaintype.ChainZkSync: // continue } latestBlockHeight := t.getLatestBlockHeight() diff --git a/core/services/ocr/mocks/ocr_contract_tracker_db.go b/core/services/ocr/mocks/ocr_contract_tracker_db.go index 8abfbba7f69..6fd94a8e59a 100644 --- a/core/services/ocr/mocks/ocr_contract_tracker_db.go +++ b/core/services/ocr/mocks/ocr_contract_tracker_db.go @@ -18,6 +18,14 @@ type OCRContractTrackerDB struct { mock.Mock } +type OCRContractTrackerDB_Expecter struct { + mock *mock.Mock +} + +func (_m *OCRContractTrackerDB) EXPECT() *OCRContractTrackerDB_Expecter { + return &OCRContractTrackerDB_Expecter{mock: &_m.Mock} +} + // LoadLatestRoundRequested provides a mock function with given fields: ctx func (_m *OCRContractTrackerDB) LoadLatestRoundRequested(ctx context.Context) (offchainaggregator.OffchainAggregatorRoundRequested, error) { ret := _m.Called(ctx) @@ -46,6 +54,34 @@ func (_m *OCRContractTrackerDB) LoadLatestRoundRequested(ctx context.Context) (o return r0, r1 } +// OCRContractTrackerDB_LoadLatestRoundRequested_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LoadLatestRoundRequested' +type OCRContractTrackerDB_LoadLatestRoundRequested_Call struct { + *mock.Call +} + +// LoadLatestRoundRequested is a helper method to define mock.On call +// - ctx context.Context +func (_e *OCRContractTrackerDB_Expecter) LoadLatestRoundRequested(ctx interface{}) *OCRContractTrackerDB_LoadLatestRoundRequested_Call { + return &OCRContractTrackerDB_LoadLatestRoundRequested_Call{Call: _e.mock.On("LoadLatestRoundRequested", ctx)} +} + +func (_c *OCRContractTrackerDB_LoadLatestRoundRequested_Call) Run(run func(ctx context.Context)) *OCRContractTrackerDB_LoadLatestRoundRequested_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *OCRContractTrackerDB_LoadLatestRoundRequested_Call) Return(rr offchainaggregator.OffchainAggregatorRoundRequested, err error) *OCRContractTrackerDB_LoadLatestRoundRequested_Call { + _c.Call.Return(rr, err) + return _c +} + +func (_c *OCRContractTrackerDB_LoadLatestRoundRequested_Call) RunAndReturn(run func(context.Context) (offchainaggregator.OffchainAggregatorRoundRequested, error)) *OCRContractTrackerDB_LoadLatestRoundRequested_Call { + _c.Call.Return(run) + return _c +} + // SaveLatestRoundRequested provides a mock function with given fields: ctx, rr func (_m *OCRContractTrackerDB) SaveLatestRoundRequested(ctx context.Context, rr offchainaggregator.OffchainAggregatorRoundRequested) error { ret := _m.Called(ctx, rr) @@ -64,6 +100,35 @@ func (_m *OCRContractTrackerDB) SaveLatestRoundRequested(ctx context.Context, rr return r0 } +// OCRContractTrackerDB_SaveLatestRoundRequested_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SaveLatestRoundRequested' +type OCRContractTrackerDB_SaveLatestRoundRequested_Call struct { + *mock.Call +} + +// SaveLatestRoundRequested is a helper method to define mock.On call +// - ctx context.Context +// - rr offchainaggregator.OffchainAggregatorRoundRequested +func (_e *OCRContractTrackerDB_Expecter) SaveLatestRoundRequested(ctx interface{}, rr interface{}) *OCRContractTrackerDB_SaveLatestRoundRequested_Call { + return &OCRContractTrackerDB_SaveLatestRoundRequested_Call{Call: _e.mock.On("SaveLatestRoundRequested", ctx, rr)} +} + +func (_c *OCRContractTrackerDB_SaveLatestRoundRequested_Call) Run(run func(ctx context.Context, rr offchainaggregator.OffchainAggregatorRoundRequested)) *OCRContractTrackerDB_SaveLatestRoundRequested_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(offchainaggregator.OffchainAggregatorRoundRequested)) + }) + return _c +} + +func (_c *OCRContractTrackerDB_SaveLatestRoundRequested_Call) Return(_a0 error) *OCRContractTrackerDB_SaveLatestRoundRequested_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *OCRContractTrackerDB_SaveLatestRoundRequested_Call) RunAndReturn(run func(context.Context, offchainaggregator.OffchainAggregatorRoundRequested) error) *OCRContractTrackerDB_SaveLatestRoundRequested_Call { + _c.Call.Return(run) + return _c +} + // WithDataSource provides a mock function with given fields: _a0 func (_m *OCRContractTrackerDB) WithDataSource(_a0 sqlutil.DataSource) ocr.OCRContractTrackerDB { ret := _m.Called(_a0) @@ -84,6 +149,34 @@ func (_m *OCRContractTrackerDB) WithDataSource(_a0 sqlutil.DataSource) ocr.OCRCo return r0 } +// OCRContractTrackerDB_WithDataSource_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WithDataSource' +type OCRContractTrackerDB_WithDataSource_Call struct { + *mock.Call +} + +// WithDataSource is a helper method to define mock.On call +// - _a0 sqlutil.DataSource +func (_e *OCRContractTrackerDB_Expecter) WithDataSource(_a0 interface{}) *OCRContractTrackerDB_WithDataSource_Call { + return &OCRContractTrackerDB_WithDataSource_Call{Call: _e.mock.On("WithDataSource", _a0)} +} + +func (_c *OCRContractTrackerDB_WithDataSource_Call) Run(run func(_a0 sqlutil.DataSource)) *OCRContractTrackerDB_WithDataSource_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(sqlutil.DataSource)) + }) + return _c +} + +func (_c *OCRContractTrackerDB_WithDataSource_Call) Return(_a0 ocr.OCRContractTrackerDB) *OCRContractTrackerDB_WithDataSource_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *OCRContractTrackerDB_WithDataSource_Call) RunAndReturn(run func(sqlutil.DataSource) ocr.OCRContractTrackerDB) *OCRContractTrackerDB_WithDataSource_Call { + _c.Call.Return(run) + return _c +} + // NewOCRContractTrackerDB creates a new instance of OCRContractTrackerDB. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewOCRContractTrackerDB(t interface { diff --git a/core/services/ocr2/delegate.go b/core/services/ocr2/delegate.go index a6843401aa7..b51765f06f7 100644 --- a/core/services/ocr2/delegate.go +++ b/core/services/ocr2/delegate.go @@ -6,18 +6,25 @@ import ( "encoding/json" "fmt" "log" + "strconv" "time" + "gopkg.in/guregu/null.v4" + + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + "github.com/smartcontractkit/chainlink-common/pkg/types/core" + + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/config" + "github.com/ethereum/go-ethereum/common" "github.com/pkg/errors" "github.com/prometheus/client_golang/prometheus" - "google.golang.org/grpc" - "gopkg.in/guregu/null.v4" - + chainselectors "github.com/smartcontractkit/chain-selectors" "github.com/smartcontractkit/libocr/commontypes" libocr2 "github.com/smartcontractkit/libocr/offchainreporting2plus" "github.com/smartcontractkit/libocr/offchainreporting2plus/ocr3types" ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" + "google.golang.org/grpc" ocr2keepers20 "github.com/smartcontractkit/chainlink-automation/pkg/v2" ocr2keepers20config "github.com/smartcontractkit/chainlink-automation/pkg/v2/config" @@ -26,13 +33,11 @@ import ( ocr2keepers20runner "github.com/smartcontractkit/chainlink-automation/pkg/v2/runner" ocr2keepers21config "github.com/smartcontractkit/chainlink-automation/pkg/v3/config" ocr2keepers21 "github.com/smartcontractkit/chainlink-automation/pkg/v3/plugin" - "github.com/smartcontractkit/chainlink-common/pkg/loop" "github.com/smartcontractkit/chainlink-common/pkg/loop/reportingplugins" "github.com/smartcontractkit/chainlink-common/pkg/loop/reportingplugins/ocr3" "github.com/smartcontractkit/chainlink-common/pkg/sqlutil" "github.com/smartcontractkit/chainlink-common/pkg/types" - "github.com/smartcontractkit/chainlink-common/pkg/types/core" llotypes "github.com/smartcontractkit/chainlink-common/pkg/types/llo" "github.com/smartcontractkit/chainlink-common/pkg/utils/mailbox" datastreamsllo "github.com/smartcontractkit/chainlink-data-streams/llo" @@ -44,18 +49,19 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/job" "github.com/smartcontractkit/chainlink/v2/core/services/keystore" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/chaintype" "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ocr2key" "github.com/smartcontractkit/chainlink/v2/core/services/llo" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/ccipcommit" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/ccipexec" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/functions" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/generic" lloconfig "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/llo/config" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/median" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/mercury" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ocr2keeper" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/autotelemetry21" ocr2keeper21core "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/core" - "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/logprovider" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/validate" "github.com/smartcontractkit/chainlink/v2/core/services/ocrcommon" "github.com/smartcontractkit/chainlink/v2/core/services/pipeline" @@ -69,6 +75,8 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/synchronization" "github.com/smartcontractkit/chainlink/v2/core/services/telemetry" "github.com/smartcontractkit/chainlink/v2/plugins" + + ccipconfig "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/config" ) type ErrJobSpecNoRelayer struct { @@ -285,6 +293,7 @@ func (d *Delegate) cleanupEVM(ctx context.Context, jb job.Job, relayID types.Rel // an inconsistent state. This assumes UnregisterFilter will return nil if the filter wasn't found // at all (no rows deleted). spec := jb.OCR2OracleSpec + transmitterID := spec.TransmitterID.String chain, err := d.legacyChains.Get(relayID.ChainID) if err != nil { d.lggr.Errorw("cleanupEVM: failed to get chain id", "chainId", relayID.ChainID, "err", err) @@ -306,6 +315,63 @@ func (d *Delegate) cleanupEVM(ctx context.Context, jb job.Job, relayID types.Rel d.lggr.Errorw("failed to derive ocr2keeper filter names from spec", "err", err, "spec", spec) } filters = append(filters, filters21...) + case types.CCIPCommit: + // Write PluginConfig bytes to send source/dest relayer provider + info outside of top level rargs/pargs over the wire + var pluginJobSpecConfig ccipconfig.CommitPluginJobSpecConfig + err = json.Unmarshal(spec.PluginConfig.Bytes(), &pluginJobSpecConfig) + if err != nil { + return err + } + + dstProvider, err2 := d.ccipCommitGetDstProvider(ctx, jb, pluginJobSpecConfig, transmitterID) + if err2 != nil { + return err + } + + srcProvider, _, err2 := d.ccipCommitGetSrcProvider(ctx, jb, pluginJobSpecConfig, transmitterID, dstProvider) + if err2 != nil { + return err + } + err2 = ccipcommit.UnregisterCommitPluginLpFilters(srcProvider, dstProvider) + if err2 != nil { + d.lggr.Errorw("failed to unregister ccip commit plugin filters", "err", err2, "spec", spec) + } + return nil + case types.CCIPExecution: + // PROVIDER BASED ARG CONSTRUCTION + // Write PluginConfig bytes to send source/dest relayer provider + info outside of top level rargs/pargs over the wire + var pluginJobSpecConfig ccipconfig.ExecPluginJobSpecConfig + err = json.Unmarshal(spec.PluginConfig.Bytes(), &pluginJobSpecConfig) + if err != nil { + return err + } + + dstProvider, err2 := d.ccipExecGetDstProvider(ctx, jb, pluginJobSpecConfig, transmitterID) + if err2 != nil { + return err + } + + srcProvider, _, err2 := d.ccipExecGetSrcProvider(ctx, jb, pluginJobSpecConfig, transmitterID, dstProvider) + if err2 != nil { + return err + } + err2 = ccipexec.UnregisterExecPluginLpFilters(srcProvider, dstProvider) + if err2 != nil { + d.lggr.Errorw("failed to unregister ccip exec plugin filters", "err", err2, "spec", spec) + } + return nil + case types.LLO: + var pluginCfg lloconfig.PluginConfig + err = json.Unmarshal(spec.PluginConfig.Bytes(), &pluginCfg) + if err != nil { + return err + } + var chainSelector uint64 + chainSelector, err = chainselectors.SelectorFromChainId(chain.ID().Uint64()) + if err != nil { + return err + } + return llo.Cleanup(ctx, lp, pluginCfg.ChannelDefinitionsContractAddress, pluginCfg.DonID, d.ds, chainSelector) default: return nil } @@ -449,6 +515,10 @@ func (d *Delegate) ServicesForSpec(ctx context.Context, jb job.Job) ([]job.Servi return d.newServicesGenericPlugin(ctx, lggr, jb, bootstrapPeers, kb, ocrDB, lc, d.capabilitiesRegistry, kvStore) + case types.CCIPCommit: + return d.newServicesCCIPCommit(ctx, lggr, jb, bootstrapPeers, kb, ocrDB, lc, transmitterID) + case types.CCIPExecution: + return d.newServicesCCIPExecution(ctx, lggr, jb, bootstrapPeers, kb, ocrDB, lc, transmitterID) default: return nil, errors.Errorf("plugin type %s not supported", spec.PluginType) } @@ -812,6 +882,21 @@ func (d *Delegate) newServicesMercury( lggr.ErrorIf(d.jobORM.RecordError(ctx, jb.ID, msg), "unable to record error") }) + var relayConfig evmrelaytypes.RelayConfig + err = json.Unmarshal(jb.OCR2OracleSpec.RelayConfig.Bytes(), &relayConfig) + if err != nil { + return nil, fmt.Errorf("error while unmarshalling relay config: %w", err) + } + + var telemetryType synchronization.TelemetryType + if relayConfig.EnableTriggerCapability && len(jb.OCR2OracleSpec.PluginConfig) == 0 { + telemetryType = synchronization.OCR3DataFeeds + // First use case for TriggerCapability transmission is Data Feeds, so telemetry should be routed accordingly. + // This is only true if TriggerCapability is the *only* transmission method (PluginConfig is empty). + } else { + telemetryType = synchronization.OCR3Mercury + } + oracleArgsNoPlugin := libocr2.MercuryOracleArgs{ BinaryNetworkEndpointFactory: d.peerWrapper.Peer2, V2Bootstrappers: bootstrapPeers, @@ -820,7 +905,7 @@ func (d *Delegate) newServicesMercury( Database: ocrDB, LocalConfig: lc, Logger: ocrLogger, - MonitoringEndpoint: d.monitoringEndpointGen.GenMonitoringEndpoint(rid.Network, rid.ChainID, spec.FeedID.String(), synchronization.OCR3Mercury), + MonitoringEndpoint: d.monitoringEndpointGen.GenMonitoringEndpoint(rid.Network, rid.ChainID, spec.FeedID.String(), telemetryType), OffchainConfigDigester: mercuryProvider.OffchainConfigDigester(), OffchainKeyring: kb, OnchainKeyring: kb, @@ -831,7 +916,7 @@ func (d *Delegate) newServicesMercury( mCfg := mercury.NewMercuryConfig(d.cfg.JobPipeline().MaxSuccessfulRuns(), d.cfg.JobPipeline().ResultWriteQueueDepth(), d.cfg) - mercuryServices, err2 := mercury.NewServices(jb, mercuryProvider, d.pipelineRunner, lggr, oracleArgsNoPlugin, mCfg, chEnhancedTelem, d.mercuryORM, (mercuryutils.FeedID)(*spec.FeedID)) + mercuryServices, err2 := mercury.NewServices(jb, mercuryProvider, d.pipelineRunner, lggr, oracleArgsNoPlugin, mCfg, chEnhancedTelem, d.mercuryORM, (mercuryutils.FeedID)(*spec.FeedID), relayConfig.EnableTriggerCapability) if ocrcommon.ShouldCollectEnhancedTelemetryMercury(jb) { enhancedTelemService := ocrcommon.NewEnhancedTelemetryService(&jb, chEnhancedTelem, make(chan struct{}), d.monitoringEndpointGen.GenMonitoringEndpoint(rid.Network, rid.ChainID, spec.FeedID.String(), synchronization.EnhancedEAMercury), lggr.Named("EnhancedTelemetryMercury")) @@ -894,6 +979,7 @@ func (d *Delegate) newServicesLLO( return nil, err } + // Handle key bundle IDs explicitly specified in job spec kbm := make(map[llotypes.ReportFormat]llo.Key) for rfStr, kbid := range pluginCfg.KeyBundleIDs { k, err3 := d.ks.Get(kbid) @@ -906,26 +992,19 @@ func (d *Delegate) newServicesLLO( } kbm[rf] = k } - // NOTE: This is a bit messy because we assume chain type matches report - // format, and it may not in all cases. We don't yet know what report - // formats we need or how they correspond to chain types, so assume it's - // 1:1 for now but will change in future - // + + // Use the default key bundle if not specified + // NOTE: Only JSON and EVMPremiumLegacy supported for now // https://smartcontract-it.atlassian.net/browse/MERC-3722 - for _, s := range chaintype.SupportedChainTypes { - rf, err3 := llotypes.ReportFormatFromString(string(s)) - if err3 != nil { - return nil, fmt.Errorf("job %d (%s) has a chain type with no matching report format %s: %w", jb.ID, jb.Name.ValueOrZero(), s, err3) - } + for _, rf := range []llotypes.ReportFormat{llotypes.ReportFormatJSON, llotypes.ReportFormatEVMPremiumLegacy} { if _, exists := kbm[rf]; !exists { // Use the first if unspecified - kbs, err4 := d.ks.GetAllOfType(s) - if err4 != nil { - return nil, err4 + kbs, err3 := d.ks.GetAllOfType("evm") + if err3 != nil { + return nil, err3 } if len(kbs) == 0 { - // unsupported key type - continue + return nil, fmt.Errorf("no on-chain signing keys found for report format %s", "evm") } else if len(kbs) > 1 { lggr.Debugf("Multiple on-chain signing keys found for report format %s, using the first", rf.String()) } @@ -951,7 +1030,8 @@ func (d *Delegate) newServicesLLO( Runner: d.pipelineRunner, Registry: d.streamRegistry, - JobName: jb.Name, + JobName: jb.Name, + CaptureEATelemetry: jb.OCR2OracleSpec.CaptureEATelemetry, ChannelDefinitionCache: provider.ChannelDefinitionCache(), @@ -961,13 +1041,11 @@ func (d *Delegate) newServicesLLO( ContractConfigTracker: provider.ContractConfigTracker(), Database: ocrDB, LocalConfig: lc, - // TODO: Telemetry for llo - // https://smartcontract-it.atlassian.net/browse/MERC-3603 - MonitoringEndpoint: nil, - OffchainConfigDigester: provider.OffchainConfigDigester(), - OffchainKeyring: kb, - OnchainKeyring: kr, - OCRLogger: ocrLogger, + MonitoringEndpoint: d.monitoringEndpointGen.GenMonitoringEndpoint(rid.Network, rid.ChainID, fmt.Sprintf("%d", pluginCfg.DonID), synchronization.EnhancedEAMercury), + OffchainConfigDigester: provider.OffchainConfigDigester(), + OffchainKeyring: kb, + OnchainKeyring: kr, + OCRLogger: ocrLogger, // Enable verbose logging if either Mercury.VerboseLogging is on or OCR2.TraceLogging is on ReportingPluginConfig: datastreamsllo.Config{VerboseLogging: d.cfg.Mercury().VerboseLogging() || d.cfg.OCR2().TraceLogging()}, @@ -1123,14 +1201,6 @@ func (d *Delegate) newServicesOCR2Keepers21( return nil, errors.New("could not coerce PluginProvider to AutomationProvider") } - // TODO: (AUTO-9355) remove once we remove v0 - if useBufferV1 := cfg.UseBufferV1 != nil && *cfg.UseBufferV1; useBufferV1 { - logProviderFeatures, ok := keeperProvider.LogEventProvider().(logprovider.LogEventProviderFeatures) - if ok { - logProviderFeatures.WithBufferVersion("v1") - } - } - services, err := ocr2keeper.EVMDependencies21(kb) if err != nil { return nil, errors.Wrap(err, "could not build dependencies for ocr2 keepers") @@ -1507,6 +1577,337 @@ func (d *Delegate) newServicesOCR2Functions( return append([]job.ServiceCtx{functionsProvider, thresholdProvider, s4Provider, ocrLogger}, functionsServices...), nil } +func (d *Delegate) newServicesCCIPCommit(ctx context.Context, lggr logger.SugaredLogger, jb job.Job, bootstrapPeers []commontypes.BootstrapperLocator, kb ocr2key.KeyBundle, ocrDB *db, lc ocrtypes.LocalConfig, transmitterID string) ([]job.ServiceCtx, error) { + spec := jb.OCR2OracleSpec + if spec.Relay != relay.NetworkEVM { + return nil, fmt.Errorf("non evm chains are not supported for CCIP commit") + } + dstRid, err := spec.RelayID() + if err != nil { + return nil, ErrJobSpecNoRelayer{Err: err, PluginName: string(spec.PluginType)} + } + + logError := func(msg string) { + lggr.ErrorIf(d.jobORM.RecordError(context.Background(), jb.ID, msg), "unable to record error") + } + + // Write PluginConfig bytes to send source/dest relayer provider + info outside of top level rargs/pargs over the wire + var pluginJobSpecConfig ccipconfig.CommitPluginJobSpecConfig + err = json.Unmarshal(spec.PluginConfig.Bytes(), &pluginJobSpecConfig) + if err != nil { + return nil, err + } + + dstChainID, err := strconv.ParseInt(dstRid.ChainID, 10, 64) + if err != nil { + return nil, err + } + + dstProvider, err := d.ccipCommitGetDstProvider(ctx, jb, pluginJobSpecConfig, transmitterID) + if err != nil { + return nil, err + } + + srcProvider, srcChainID, err := d.ccipCommitGetSrcProvider(ctx, jb, pluginJobSpecConfig, transmitterID, dstProvider) + if err != nil { + return nil, err + } + + oracleArgsNoPlugin := libocr2.OCR2OracleArgs{ + BinaryNetworkEndpointFactory: d.peerWrapper.Peer2, + V2Bootstrappers: bootstrapPeers, + ContractTransmitter: dstProvider.ContractTransmitter(), + ContractConfigTracker: dstProvider.ContractConfigTracker(), + Database: ocrDB, + LocalConfig: lc, + MonitoringEndpoint: d.monitoringEndpointGen.GenMonitoringEndpoint( + dstRid.Network, + dstRid.ChainID, + spec.ContractID, + synchronization.OCR2CCIPCommit, + ), + OffchainConfigDigester: dstProvider.OffchainConfigDigester(), + OffchainKeyring: kb, + OnchainKeyring: kb, + MetricsRegisterer: prometheus.WrapRegistererWith(map[string]string{"job_name": jb.Name.ValueOrZero()}, prometheus.DefaultRegisterer), + } + + return ccipcommit.NewCommitServices(ctx, d.ds, srcProvider, dstProvider, d.legacyChains, jb, lggr, d.pipelineRunner, oracleArgsNoPlugin, d.isNewlyCreatedJob, int64(srcChainID), dstChainID, logError) +} + +func newCCIPCommitPluginBytes(isSourceProvider bool, sourceStartBlock uint64, destStartBlock uint64) config.CommitPluginConfig { + return config.CommitPluginConfig{ + IsSourceProvider: isSourceProvider, + SourceStartBlock: sourceStartBlock, + DestStartBlock: destStartBlock, + } +} + +func (d *Delegate) ccipCommitGetDstProvider(ctx context.Context, jb job.Job, pluginJobSpecConfig ccipconfig.CommitPluginJobSpecConfig, transmitterID string) (types.CCIPCommitProvider, error) { + spec := jb.OCR2OracleSpec + if spec.Relay != relay.NetworkEVM { + return nil, fmt.Errorf("non evm chains are not supported for CCIP commit") + } + + dstRid, err := spec.RelayID() + if err != nil { + return nil, ErrJobSpecNoRelayer{Err: err, PluginName: string(spec.PluginType)} + } + + // Write PluginConfig bytes to send source/dest relayer provider + info outside of top level rargs/pargs over the wire + dstConfigBytes, err := newCCIPCommitPluginBytes(false, pluginJobSpecConfig.SourceStartBlock, pluginJobSpecConfig.DestStartBlock).Encode() + if err != nil { + return nil, err + } + + // Get provider from dest chain + dstRelayer, err := d.RelayGetter.Get(dstRid) + if err != nil { + return nil, err + } + + provider, err := dstRelayer.NewPluginProvider(ctx, + types.RelayArgs{ + ContractID: spec.ContractID, + RelayConfig: spec.RelayConfig.Bytes(), + ProviderType: string(types.CCIPCommit), + }, + types.PluginArgs{ + TransmitterID: transmitterID, + PluginConfig: dstConfigBytes, + }) + if err != nil { + return nil, fmt.Errorf("unable to create ccip commit provider: %w", err) + } + dstProvider, ok := provider.(types.CCIPCommitProvider) + if !ok { + return nil, fmt.Errorf("could not coerce PluginProvider to CCIPCommitProvider") + } + + return dstProvider, nil +} + +func (d *Delegate) ccipCommitGetSrcProvider(ctx context.Context, jb job.Job, pluginJobSpecConfig ccipconfig.CommitPluginJobSpecConfig, transmitterID string, dstProvider types.CCIPCommitProvider) (srcProvider types.CCIPCommitProvider, srcChainID uint64, err error) { + spec := jb.OCR2OracleSpec + srcConfigBytes, err := newCCIPCommitPluginBytes(true, pluginJobSpecConfig.SourceStartBlock, pluginJobSpecConfig.DestStartBlock).Encode() + if err != nil { + return nil, 0, err + } + // Use OffRampReader to get src chain ID and fetch the src relayer + + var pluginConfig ccipconfig.CommitPluginJobSpecConfig + err = json.Unmarshal(spec.PluginConfig.Bytes(), &pluginConfig) + if err != nil { + return nil, 0, err + } + offRampAddress := pluginConfig.OffRamp + offRampReader, err := dstProvider.NewOffRampReader(ctx, offRampAddress) + if err != nil { + return nil, 0, fmt.Errorf("create offRampReader: %w", err) + } + + offRampConfig, err := offRampReader.GetStaticConfig(ctx) + if err != nil { + return nil, 0, fmt.Errorf("get offRamp static config: %w", err) + } + + srcChainID, err = chainselectors.ChainIdFromSelector(offRampConfig.SourceChainSelector) + if err != nil { + return nil, 0, err + } + srcChainIDstr := strconv.FormatUint(srcChainID, 10) + + // Get provider from source chain + srcRelayer, err := d.RelayGetter.Get(types.RelayID{Network: spec.Relay, ChainID: srcChainIDstr}) + if err != nil { + return nil, 0, err + } + provider, err := srcRelayer.NewPluginProvider(ctx, + types.RelayArgs{ + ContractID: "", // Contract address only valid for dst chain + RelayConfig: spec.RelayConfig.Bytes(), + ProviderType: string(types.CCIPCommit), + }, + types.PluginArgs{ + TransmitterID: transmitterID, + PluginConfig: srcConfigBytes, + }) + if err != nil { + return nil, 0, fmt.Errorf("srcRelayer.NewPluginProvider: %w", err) + } + srcProvider, ok := provider.(types.CCIPCommitProvider) + if !ok { + return nil, 0, fmt.Errorf("could not coerce PluginProvider to CCIPCommitProvider") + } + + return +} + +func (d *Delegate) newServicesCCIPExecution(ctx context.Context, lggr logger.SugaredLogger, jb job.Job, bootstrapPeers []commontypes.BootstrapperLocator, kb ocr2key.KeyBundle, ocrDB *db, lc ocrtypes.LocalConfig, transmitterID string) ([]job.ServiceCtx, error) { + spec := jb.OCR2OracleSpec + if spec.Relay != relay.NetworkEVM { + return nil, fmt.Errorf("non evm chains are not supported for CCIP execution") + } + dstRid, err := spec.RelayID() + + if err != nil { + return nil, ErrJobSpecNoRelayer{Err: err, PluginName: string(spec.PluginType)} + } + + logError := func(msg string) { + lggr.ErrorIf(d.jobORM.RecordError(context.Background(), jb.ID, msg), "unable to record error") + } + + // PROVIDER BASED ARG CONSTRUCTION + // Write PluginConfig bytes to send source/dest relayer provider + info outside of top level rargs/pargs over the wire + var pluginJobSpecConfig ccipconfig.ExecPluginJobSpecConfig + err = json.Unmarshal(spec.PluginConfig.Bytes(), &pluginJobSpecConfig) + if err != nil { + return nil, err + } + + dstChainID, err := strconv.ParseInt(dstRid.ChainID, 10, 64) + if err != nil { + return nil, err + } + + dstProvider, err := d.ccipExecGetDstProvider(ctx, jb, pluginJobSpecConfig, transmitterID) + if err != nil { + return nil, err + } + + srcProvider, srcChainID, err := d.ccipExecGetSrcProvider(ctx, jb, pluginJobSpecConfig, transmitterID, dstProvider) + if err != nil { + return nil, err + } + + oracleArgsNoPlugin2 := libocr2.OCR2OracleArgs{ + BinaryNetworkEndpointFactory: d.peerWrapper.Peer2, + V2Bootstrappers: bootstrapPeers, + ContractTransmitter: dstProvider.ContractTransmitter(), + ContractConfigTracker: dstProvider.ContractConfigTracker(), + Database: ocrDB, + LocalConfig: lc, + MonitoringEndpoint: d.monitoringEndpointGen.GenMonitoringEndpoint( + dstRid.Network, + dstRid.ChainID, + spec.ContractID, + synchronization.OCR2CCIPExec, + ), + OffchainConfigDigester: dstProvider.OffchainConfigDigester(), + OffchainKeyring: kb, + OnchainKeyring: kb, + MetricsRegisterer: prometheus.WrapRegistererWith(map[string]string{"job_name": jb.Name.ValueOrZero()}, prometheus.DefaultRegisterer), + } + + return ccipexec.NewExecServices(ctx, lggr, jb, srcProvider, dstProvider, int64(srcChainID), dstChainID, d.isNewlyCreatedJob, oracleArgsNoPlugin2, logError) +} + +func (d *Delegate) ccipExecGetDstProvider(ctx context.Context, jb job.Job, pluginJobSpecConfig ccipconfig.ExecPluginJobSpecConfig, transmitterID string) (types.CCIPExecProvider, error) { + spec := jb.OCR2OracleSpec + if spec.Relay != relay.NetworkEVM { + return nil, fmt.Errorf("non evm chains are not supported for CCIP execution") + } + dstRid, err := spec.RelayID() + + if err != nil { + return nil, ErrJobSpecNoRelayer{Err: err, PluginName: string(spec.PluginType)} + } + + // PROVIDER BASED ARG CONSTRUCTION + // Write PluginConfig bytes to send source/dest relayer provider + info outside of top level rargs/pargs over the wire + dstConfigBytes, err := newExecPluginConfig(false, pluginJobSpecConfig.SourceStartBlock, pluginJobSpecConfig.DestStartBlock, pluginJobSpecConfig.USDCConfig, string(jb.ID)).Encode() + if err != nil { + return nil, err + } + + // Get provider from dest chain + dstRelayer, err := d.RelayGetter.Get(dstRid) + if err != nil { + return nil, err + } + provider, err := dstRelayer.NewPluginProvider(ctx, + types.RelayArgs{ + ContractID: spec.ContractID, + RelayConfig: spec.RelayConfig.Bytes(), + ProviderType: string(types.CCIPExecution), + }, + types.PluginArgs{ + TransmitterID: transmitterID, + PluginConfig: dstConfigBytes, + }) + if err != nil { + return nil, fmt.Errorf("NewPluginProvider failed on dstRelayer: %w", err) + } + dstProvider, ok := provider.(types.CCIPExecProvider) + if !ok { + return nil, fmt.Errorf("could not coerce PluginProvider to CCIPExecProvider") + } + + return dstProvider, nil +} + +func (d *Delegate) ccipExecGetSrcProvider(ctx context.Context, jb job.Job, pluginJobSpecConfig ccipconfig.ExecPluginJobSpecConfig, transmitterID string, dstProvider types.CCIPExecProvider) (srcProvider types.CCIPExecProvider, srcChainID uint64, err error) { + spec := jb.OCR2OracleSpec + srcConfigBytes, err := newExecPluginConfig(true, pluginJobSpecConfig.SourceStartBlock, pluginJobSpecConfig.DestStartBlock, pluginJobSpecConfig.USDCConfig, string(jb.ID)).Encode() + if err != nil { + return nil, 0, err + } + + // Use OffRampReader to get src chain ID and fetch the src relayer + offRampAddress := cciptypes.Address(common.HexToAddress(spec.ContractID).String()) + offRampReader, err := dstProvider.NewOffRampReader(ctx, offRampAddress) + if err != nil { + return nil, 0, fmt.Errorf("create offRampReader: %w", err) + } + + offRampConfig, err := offRampReader.GetStaticConfig(ctx) + if err != nil { + return nil, 0, fmt.Errorf("get offRamp static config: %w", err) + } + + srcChainID, err = chainselectors.ChainIdFromSelector(offRampConfig.SourceChainSelector) + if err != nil { + return nil, 0, err + } + srcChainIDstr := strconv.FormatUint(srcChainID, 10) + + // Get provider from source chain + srcRelayer, err := d.RelayGetter.Get(types.RelayID{Network: spec.Relay, ChainID: srcChainIDstr}) + if err != nil { + return nil, 0, fmt.Errorf("failed to get relayer: %w", err) + } + provider, err := srcRelayer.NewPluginProvider(ctx, + types.RelayArgs{ + ContractID: "", + RelayConfig: spec.RelayConfig.Bytes(), + ProviderType: string(types.CCIPExecution), + }, + types.PluginArgs{ + TransmitterID: transmitterID, + PluginConfig: srcConfigBytes, + }) + if err != nil { + return nil, 0, err + } + srcProvider, ok := provider.(types.CCIPExecProvider) + if !ok { + return nil, 0, fmt.Errorf("could not coerce PluginProvider to CCIPExecProvider: %w", err) + } + + return +} + +func newExecPluginConfig(isSourceProvider bool, srcStartBlock uint64, dstStartBlock uint64, usdcConfig ccipconfig.USDCConfig, jobID string) config.ExecPluginConfig { + return config.ExecPluginConfig{ + IsSourceProvider: isSourceProvider, + SourceStartBlock: srcStartBlock, + DestStartBlock: dstStartBlock, + USDCConfig: usdcConfig, + JobID: jobID, + } +} + // errorLog implements [loop.ErrorLog] type errorLog struct { jobID int32 diff --git a/core/services/ocr2/plugins/ccip/LICENSE.md b/core/services/ocr2/plugins/ccip/LICENSE.md new file mode 100644 index 00000000000..96fdb2b1392 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/LICENSE.md @@ -0,0 +1,55 @@ +Business Source License 1.1 + +License text copyright (c) 2017 MariaDB Corporation Ab, All Rights Reserved. +"Business Source License" is a trademark of MariaDB Corporation Ab. + +----------------------------------------------------------------------------- + +Parameters + +Licensor: SmartContract Chainlink Limited SEZC + +Licensed Work: Cross-Chain Interoperability Protocol v1.5 +The Licensed Work is (c) 2023 SmartContract Chainlink Limited SEZC + +Additional Use Grant: Any uses listed and defined at [v1.5-CCIP-License-grants](../../../../../contracts/src/v0.8/ccip/v1.5-CCIP-License-grants.md) + +Change Date: Aug 16, 2028 + +Change License: MIT + +----------------------------------------------------------------------------- + +Terms + +The Licensor hereby grants you the right to copy, modify, create derivative works, redistribute, and make non-production use of the Licensed Work. The Licensor may make an Additional Use Grant, above, permitting limited production use. + +Effective on the Change Date, or the fourth anniversary of the first publicly available distribution of a specific version of the Licensed Work under this License, whichever comes first, the Licensor hereby grants you rights under the terms of the Change License, and the rights granted in the paragraph above terminate. + +If your use of the Licensed Work does not comply with the requirements currently in effect as described in this License, you must purchase a commercial license from the Licensor, its affiliated entities, or authorized resellers, or you must refrain from using the Licensed Work. + +All copies of the original and modified Licensed Work, and derivative works of the Licensed Work, are subject to this License. This License applies separately for each version of the Licensed Work and the Change Date may vary for each version of the Licensed Work released by Licensor. + +You must conspicuously display this License on each original or modified copy of the Licensed Work. If you receive the Licensed Work in original or modified form from a third party, the terms and conditions set forth in this License apply to your use of that work. + +Any use of the Licensed Work in violation of this License will automatically terminate your rights under this License for the current and all other versions of the Licensed Work. + +This License does not grant you any right in any trademark or logo of Licensor or its affiliates (provided that you may use a trademark or logo of Licensor as expressly required by this License). + +TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON AN "AS IS" BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS, EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND TITLE. + +MariaDB hereby grants you permission to use this License’s text to license your works, and to refer to it using the trademark "Business Source License", as long as you comply with the Covenants of Licensor below. + +----------------------------------------------------------------------------- + +Covenants of Licensor + +In consideration of the right to use this License’s text and the "Business Source License" name and trademark, Licensor covenants to MariaDB, and to all other recipients of the licensed work to be provided by Licensor: + +1. To specify as the Change License the GPL Version 2.0 or any later version, or a license that is compatible with GPL Version 2.0 or a later version, where "compatible" means that software provided under the Change License can be included in a program with software provided under GPL Version 2.0 or a later version. Licensor may specify additional Change Licenses without limitation. + +2. To either: (a) specify an additional grant of rights to use that does not impose any additional restriction on the right granted in this License, as the Additional Use Grant; or (b) insert the text "None". + +3. To specify a Change Date. + +4. Not to modify this License in any other way. \ No newline at end of file diff --git a/core/services/ocr2/plugins/ccip/abihelpers/abi_helpers.go b/core/services/ocr2/plugins/ccip/abihelpers/abi_helpers.go new file mode 100644 index 00000000000..d0ad5642d94 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/abihelpers/abi_helpers.go @@ -0,0 +1,187 @@ +package abihelpers + +import ( + "encoding/binary" + "fmt" + "math/big" + "strings" + "sync" + + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/common" + "github.com/pkg/errors" + "github.com/smartcontractkit/libocr/gethwrappers2/ocr2aggregator" +) + +func MustGetEventID(name string, abi2 abi.ABI) common.Hash { + event, ok := abi2.Events[name] + if !ok { + panic(fmt.Sprintf("missing event %s", name)) + } + return event.ID +} + +func MustGetEventInputs(name string, abi2 abi.ABI) abi.Arguments { + m, ok := abi2.Events[name] + if !ok { + panic(fmt.Sprintf("missing event %s", name)) + } + return m.Inputs +} + +func MustGetMethodInputs(name string, abi2 abi.ABI) abi.Arguments { + m, ok := abi2.Methods[name] + if !ok { + panic(fmt.Sprintf("missing method %s", name)) + } + return m.Inputs +} + +func MustParseABI(abiStr string) abi.ABI { + abiParsed, err := abi.JSON(strings.NewReader(abiStr)) + if err != nil { + panic(err) + } + return abiParsed +} + +// ProofFlagsToBits transforms a list of boolean proof flags to a *big.Int +// encoded number. +func ProofFlagsToBits(proofFlags []bool) *big.Int { + encodedFlags := big.NewInt(0) + for i := 0; i < len(proofFlags); i++ { + if proofFlags[i] { + encodedFlags.SetBit(encodedFlags, i, 1) + } + } + return encodedFlags +} + +type AbiDefined interface { + AbiString() string +} + +type AbiDefinedValid interface { + AbiDefined + Validate() error +} + +func ABIEncode(abiStr string, values ...interface{}) ([]byte, error) { + inAbi, err := getABI(abiStr, ENCODE) + if err != nil { + return nil, err + } + res, err := inAbi.Pack("method", values...) + if err != nil { + return nil, err + } + return res[4:], nil +} + +func ABIDecode(abiStr string, data []byte) ([]interface{}, error) { + inAbi, err := getABI(abiStr, DECODE) + if err != nil { + return nil, err + } + return inAbi.Unpack("method", data) +} + +func EncodeAbiStruct[T AbiDefined](decoded T) ([]byte, error) { + return ABIEncode(decoded.AbiString(), decoded) +} + +func EncodeAddress(address common.Address) ([]byte, error) { + return ABIEncode(`[{"type":"address"}]`, address) +} + +func DecodeAbiStruct[T AbiDefinedValid](encoded []byte) (T, error) { + var empty T + + decoded, err := ABIDecode(empty.AbiString(), encoded) + if err != nil { + return empty, err + } + + converted := abi.ConvertType(decoded[0], &empty) + if casted, ok := converted.(*T); ok { + return *casted, (*casted).Validate() + } + return empty, fmt.Errorf("can't cast from %T to %T", converted, empty) +} + +func EvmWord(i uint64) common.Hash { + b := make([]byte, 8) + binary.BigEndian.PutUint64(b, i) + return common.BigToHash(big.NewInt(0).SetBytes(b)) +} + +func DecodeOCR2Config(encoded []byte) (*ocr2aggregator.OCR2AggregatorConfigSet, error) { + unpacked := new(ocr2aggregator.OCR2AggregatorConfigSet) + abiPointer, err := ocr2aggregator.OCR2AggregatorMetaData.GetAbi() + if err != nil { + return unpacked, err + } + defaultABI := *abiPointer + err = defaultABI.UnpackIntoInterface(unpacked, "ConfigSet", encoded) + if err != nil { + return unpacked, errors.Wrap(err, "failed to unpack log data") + } + return unpacked, nil +} + +// create const encode and decode +const ( + ENCODE = iota + DECODE +) + +type abiCache struct { + cache map[string]*abi.ABI + mu *sync.RWMutex +} + +func newAbiCache() *abiCache { + return &abiCache{ + cache: make(map[string]*abi.ABI), + mu: &sync.RWMutex{}, + } +} + +// Global cache for ABIs to avoid parsing the same ABI multiple times +// As the module is already a helper module and not a service, we can keep the cache global +// It's private to the package and can't be accessed from outside +var myAbiCache = newAbiCache() + +// This Function is used to get the ABI from the cache or create a new one and cache it for later use +// operationType is used to differentiate between encoding and decoding +// encoding uses a definition with `inputs` and decoding uses a definition with `outputs` (check inDef) +func getABI(abiStr string, operationType uint8) (*abi.ABI, error) { + var operationStr string + switch operationType { + case ENCODE: + operationStr = "inputs" + case DECODE: + operationStr = "outputs" + default: + return nil, fmt.Errorf("invalid operation type") + } + + inDef := fmt.Sprintf(`[{ "name" : "method", "type": "function", "%s": %s}]`, operationStr, abiStr) + + myAbiCache.mu.RLock() + if cachedAbi, found := myAbiCache.cache[inDef]; found { + myAbiCache.mu.RUnlock() // unlocking before returning + return cachedAbi, nil + } + myAbiCache.mu.RUnlock() + + res, err := abi.JSON(strings.NewReader(inDef)) + if err != nil { + return nil, err + } + + myAbiCache.mu.Lock() + defer myAbiCache.mu.Unlock() + myAbiCache.cache[inDef] = &res + return &res, nil +} diff --git a/core/services/ocr2/plugins/ccip/abihelpers/abi_helpers_test.go b/core/services/ocr2/plugins/ccip/abihelpers/abi_helpers_test.go new file mode 100644 index 00000000000..4890aeb1188 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/abihelpers/abi_helpers_test.go @@ -0,0 +1,147 @@ +package abihelpers + +import ( + "bytes" + "fmt" + "math" + "math/big" + "testing" + + "github.com/ethereum/go-ethereum/common" + "github.com/stretchr/testify/assert" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils" +) + +func TestProofFlagToBits(t *testing.T) { + genFlags := func(indexesSet []int, size int) []bool { + bools := make([]bool, size) + for _, indexSet := range indexesSet { + bools[indexSet] = true + } + return bools + } + tt := []struct { + flags []bool + expected *big.Int + }{ + { + []bool{true, false, true}, + big.NewInt(5), + }, + { + []bool{true, true, false}, // Note the bits are reversed, slightly easier to implement. + big.NewInt(3), + }, + { + []bool{false, true, true}, + big.NewInt(6), + }, + { + []bool{false, false, false}, + big.NewInt(0), + }, + { + []bool{true, true, true}, + big.NewInt(7), + }, + { + genFlags([]int{266}, 300), + big.NewInt(0).SetBit(big.NewInt(0), 266, 1), + }, + } + for _, tc := range tt { + tc := tc + a := ProofFlagsToBits(tc.flags) + assert.Equal(t, tc.expected.String(), a.String()) + } +} + +func TestEvmWord(t *testing.T) { + testCases := []struct { + inp uint64 + exp common.Hash + }{ + {inp: 1, exp: common.HexToHash("0x0000000000000000000000000000000000000000000000000000000000000001")}, + {inp: math.MaxUint64, exp: common.HexToHash("0x000000000000000000000000000000000000000000000000ffffffffffffffff")}, + } + + for _, tc := range testCases { + t.Run(fmt.Sprintf("test %d", tc.inp), func(t *testing.T) { + h := EvmWord(tc.inp) + assert.Equal(t, tc.exp, h) + }) + } +} + +func TestABIEncodeDecode(t *testing.T) { + abiStr := `[{"components": [{"name":"int1","type":"int256"},{"name":"int2","type":"int256"}], "type":"tuple"}]` + values := []interface{}{struct { + Int1 *big.Int `json:"int1"` + Int2 *big.Int `json:"int2"` + }{big.NewInt(10), big.NewInt(12)}} + + // First encoding, should call the underlying utils.ABIEncode + encoded, err := ABIEncode(abiStr, values...) + assert.NoError(t, err) + assert.NotNil(t, encoded) + + // Second encoding, should retrieve from cache + // we're just testing here that it returns same result + encodedAgain, err := ABIEncode(abiStr, values...) + + assert.NoError(t, err) + assert.True(t, bytes.Equal(encoded, encodedAgain)) + + // Should be able to decode it back to the original values + decoded, err := ABIDecode(abiStr, encoded) + assert.NoError(t, err) + assert.Equal(t, decoded, values) +} + +func BenchmarkComparisonEncode(b *testing.B) { + abiStr := `[{"components": [{"name":"int1","type":"int256"},{"name":"int2","type":"int256"}], "type":"tuple"}]` + values := []interface{}{struct { + Int1 *big.Int `json:"int1"` + Int2 *big.Int `json:"int2"` + }{big.NewInt(10), big.NewInt(12)}} + + b.Run("WithoutCache", func(b *testing.B) { + for i := 0; i < b.N; i++ { + _, _ = utils.ABIEncode(abiStr, values...) + } + }) + + // Warm up the cache + _, _ = ABIEncode(abiStr, values...) + + b.Run("WithCache", func(b *testing.B) { + for i := 0; i < b.N; i++ { + _, _ = ABIEncode(abiStr, values...) + } + }) +} + +func BenchmarkComparisonDecode(b *testing.B) { + abiStr := `[{"components": [{"name":"int1","type":"int256"},{"name":"int2","type":"int256"}], "type":"tuple"}]` + values := []interface{}{struct { + Int1 *big.Int `json:"int1"` + Int2 *big.Int `json:"int2"` + }{big.NewInt(10), big.NewInt(12)}} + data, _ := utils.ABIEncode(abiStr, values...) + + b.Run("WithoutCache", func(b *testing.B) { + for i := 0; i < b.N; i++ { + _, _ = utils.ABIDecode(abiStr, data) + } + }) + + // Warm up the cache + _, _ = ABIDecode(abiStr, data) + + b.Run("WithCache", func(b *testing.B) { + for i := 0; i < b.N; i++ { + _, _ = ABIDecode(abiStr, data) + } + }) +} diff --git a/core/services/ocr2/plugins/ccip/ccipcommit/factory.go b/core/services/ocr2/plugins/ccip/ccipcommit/factory.go new file mode 100644 index 00000000000..648f62a23a2 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/ccipcommit/factory.go @@ -0,0 +1,150 @@ +package ccipcommit + +import ( + "context" + "fmt" + "sync" + + "github.com/ethereum/go-ethereum/common" + "github.com/smartcontractkit/libocr/offchainreporting2plus/types" + + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipcommon" + + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipcalc" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata" +) + +type CommitReportingPluginFactory struct { + // Configuration derived from the job spec which does not change + // between plugin instances (ie between SetConfigs onchain) + config CommitPluginStaticConfig + + // Dynamic readers + readersMu *sync.Mutex + destPriceRegReader ccipdata.PriceRegistryReader + destPriceRegAddr common.Address +} + +// NewCommitReportingPluginFactory return a new CommitReportingPluginFactory. +func NewCommitReportingPluginFactory(config CommitPluginStaticConfig) *CommitReportingPluginFactory { + return &CommitReportingPluginFactory{ + config: config, + readersMu: &sync.Mutex{}, + + // the fields below are initially empty and populated on demand + destPriceRegReader: nil, + destPriceRegAddr: common.Address{}, + } +} + +func (rf *CommitReportingPluginFactory) UpdateDynamicReaders(ctx context.Context, newPriceRegAddr common.Address) error { + rf.readersMu.Lock() + defer rf.readersMu.Unlock() + // TODO: Investigate use of Close() to cleanup. + // TODO: a true price registry upgrade on an existing lane may want some kind of start block in its config? Right now we + // essentially assume that plugins don't care about historical price reg logs. + if rf.destPriceRegAddr == newPriceRegAddr { + // No-op + return nil + } + // Close old reader if present and open new reader if address changed + if rf.destPriceRegReader != nil { + if err := rf.destPriceRegReader.Close(); err != nil { + return err + } + } + + destPriceRegistryReader, err := rf.config.priceRegistryProvider.NewPriceRegistryReader(context.Background(), cciptypes.Address(newPriceRegAddr.String())) + if err != nil { + return fmt.Errorf("init dynamic price registry: %w", err) + } + rf.destPriceRegReader = destPriceRegistryReader + rf.destPriceRegAddr = newPriceRegAddr + return nil +} + +type reportingPluginAndInfo struct { + plugin types.ReportingPlugin + pluginInfo types.ReportingPluginInfo +} + +// NewReportingPlugin registers a new ReportingPlugin +func (rf *CommitReportingPluginFactory) NewReportingPlugin(config types.ReportingPluginConfig) (types.ReportingPlugin, types.ReportingPluginInfo, error) { + initialRetryDelay := rf.config.newReportingPluginRetryConfig.InitialDelay + maxDelay := rf.config.newReportingPluginRetryConfig.MaxDelay + + pluginAndInfo, err := ccipcommon.RetryUntilSuccess(rf.NewReportingPluginFn(config), initialRetryDelay, maxDelay) + if err != nil { + return nil, types.ReportingPluginInfo{}, err + } + return pluginAndInfo.plugin, pluginAndInfo.pluginInfo, err +} + +// NewReportingPluginFn implements the NewReportingPlugin logic. It is defined as a function so that it can easily be +// retried via RetryUntilSuccess. NewReportingPlugin must return successfully in order for the Commit plugin to +// function, hence why we can only keep retrying it until it succeeds. +func (rf *CommitReportingPluginFactory) NewReportingPluginFn(config types.ReportingPluginConfig) func() (reportingPluginAndInfo, error) { + return func() (reportingPluginAndInfo, error) { + ctx := context.Background() // todo: consider adding some timeout + + destPriceReg, err := rf.config.commitStore.ChangeConfig(ctx, config.OnchainConfig, config.OffchainConfig) + if err != nil { + return reportingPluginAndInfo{}, err + } + + priceRegEvmAddr, err := ccipcalc.GenericAddrToEvm(destPriceReg) + if err != nil { + return reportingPluginAndInfo{}, err + } + if err = rf.UpdateDynamicReaders(ctx, priceRegEvmAddr); err != nil { + return reportingPluginAndInfo{}, err + } + + pluginOffChainConfig, err := rf.config.commitStore.OffchainConfig(ctx) + if err != nil { + return reportingPluginAndInfo{}, err + } + + gasPriceEstimator, err := rf.config.commitStore.GasPriceEstimator(ctx) + if err != nil { + return reportingPluginAndInfo{}, err + } + + err = rf.config.priceService.UpdateDynamicConfig(ctx, gasPriceEstimator, rf.destPriceRegReader) + if err != nil { + return reportingPluginAndInfo{}, err + } + + lggr := rf.config.lggr.Named("CommitReportingPlugin") + plugin := &CommitReportingPlugin{ + sourceChainSelector: rf.config.sourceChainSelector, + sourceNative: rf.config.sourceNative, + onRampReader: rf.config.onRampReader, + destChainSelector: rf.config.destChainSelector, + commitStoreReader: rf.config.commitStore, + F: config.F, + lggr: lggr, + destPriceRegistryReader: rf.destPriceRegReader, + offRampReader: rf.config.offRamp, + gasPriceEstimator: gasPriceEstimator, + offchainConfig: pluginOffChainConfig, + metricsCollector: rf.config.metricsCollector, + chainHealthcheck: rf.config.chainHealthcheck, + priceService: rf.config.priceService, + } + + pluginInfo := types.ReportingPluginInfo{ + Name: "CCIPCommit", + UniqueReports: false, // See comment in CommitStore constructor. + Limits: types.ReportingPluginLimits{ + MaxQueryLength: ccip.MaxQueryLength, + MaxObservationLength: ccip.MaxObservationLength, + MaxReportLength: MaxCommitReportLength, + }, + } + + return reportingPluginAndInfo{plugin, pluginInfo}, nil + } +} diff --git a/core/services/ocr2/plugins/ccip/ccipcommit/factory_test.go b/core/services/ocr2/plugins/ccip/ccipcommit/factory_test.go new file mode 100644 index 00000000000..825026bd17e --- /dev/null +++ b/core/services/ocr2/plugins/ccip/ccipcommit/factory_test.go @@ -0,0 +1,100 @@ +package ccipcommit + +import ( + "errors" + "testing" + "time" + + "github.com/smartcontractkit/libocr/offchainreporting2plus/types" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + + "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + "github.com/smartcontractkit/chainlink/v2/core/logger" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata" + ccipdataprovidermocks "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/ccipdataprovider/mocks" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/mocks" + dbMocks "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdb/mocks" +) + +// Assert that NewReportingPlugin keeps retrying until it succeeds. +// +// NewReportingPlugin makes several calls (e.g. CommitStoreReader.ChangeConfig) that can fail. We use mocks to cause the +// first call to each of these functions to fail, then all subsequent calls succeed. We assert that NewReportingPlugin +// retries a sufficient number of times to get through the transient errors and eventually succeed. +func TestNewReportingPluginRetriesUntilSuccess(t *testing.T) { + commitConfig := CommitPluginStaticConfig{} + + // For this unit test, ensure that there is no delay between retries + commitConfig.newReportingPluginRetryConfig = ccipdata.RetryConfig{ + InitialDelay: 0 * time.Nanosecond, + MaxDelay: 0 * time.Nanosecond, + } + + // Set up the OffRampReader mock + mockCommitStore := new(mocks.CommitStoreReader) + + // The first call is set to return an error, the following calls return a nil error + mockCommitStore. + On("ChangeConfig", mock.Anything, mock.Anything, mock.Anything). + Return(ccip.Address(""), errors.New("")). + Once() + mockCommitStore. + On("ChangeConfig", mock.Anything, mock.Anything, mock.Anything). + Return(ccip.Address("0x7c6e4F0BDe29f83BC394B75a7f313B7E5DbD2d77"), nil). + Times(5) + + mockCommitStore. + On("OffchainConfig", mock.Anything). + Return(ccip.CommitOffchainConfig{}, errors.New("")). + Once() + mockCommitStore. + On("OffchainConfig", mock.Anything). + Return(ccip.CommitOffchainConfig{}, nil). + Times(3) + + mockCommitStore. + On("GasPriceEstimator", mock.Anything). + Return(nil, errors.New("")). + Once() + mockCommitStore. + On("GasPriceEstimator", mock.Anything). + Return(nil, nil). + Times(2) + + commitConfig.commitStore = mockCommitStore + + mockPriceService := new(dbMocks.PriceService) + + mockPriceService. + On("UpdateDynamicConfig", mock.Anything, mock.Anything, mock.Anything). + Return(errors.New("")). + Once() + mockPriceService. + On("UpdateDynamicConfig", mock.Anything, mock.Anything, mock.Anything). + Return(nil) + + commitConfig.priceService = mockPriceService + + priceRegistryProvider := new(ccipdataprovidermocks.PriceRegistry) + priceRegistryProvider. + On("NewPriceRegistryReader", mock.Anything, mock.Anything). + Return(nil, errors.New("")). + Once() + priceRegistryProvider. + On("NewPriceRegistryReader", mock.Anything, mock.Anything). + Return(nil, nil). + Once() + commitConfig.priceRegistryProvider = priceRegistryProvider + + commitConfig.lggr, _ = logger.NewLogger() + + factory := NewCommitReportingPluginFactory(commitConfig) + reportingConfig := types.ReportingPluginConfig{} + reportingConfig.OnchainConfig = []byte{1, 2, 3} + reportingConfig.OffchainConfig = []byte{1, 2, 3} + + // Assert that NewReportingPlugin succeeds despite many transient internal failures (mocked out above) + _, _, err := factory.NewReportingPlugin(reportingConfig) + assert.Equal(t, nil, err) +} diff --git a/core/services/ocr2/plugins/ccip/ccipcommit/initializers.go b/core/services/ocr2/plugins/ccip/ccipcommit/initializers.go new file mode 100644 index 00000000000..771fdd322f3 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/ccipcommit/initializers.go @@ -0,0 +1,241 @@ +package ccipcommit + +import ( + "context" + "encoding/json" + "fmt" + "math/big" + "strings" + "time" + + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/pricegetter" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/rpclib" + + "github.com/Masterminds/semver/v3" + "github.com/ethereum/go-ethereum/common" + libocr2 "github.com/smartcontractkit/libocr/offchainreporting2plus" + "go.uber.org/multierr" + + "github.com/smartcontractkit/chainlink-common/pkg/sqlutil" + + commonlogger "github.com/smartcontractkit/chainlink-common/pkg/logger" + commontypes "github.com/smartcontractkit/chainlink-common/pkg/types" + + cciporm "github.com/smartcontractkit/chainlink/v2/core/services/ccip" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/cache" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipcalc" + db "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdb" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/txmgr" + "github.com/smartcontractkit/chainlink/v2/core/chains/legacyevm" + "github.com/smartcontractkit/chainlink/v2/core/logger" + "github.com/smartcontractkit/chainlink/v2/core/services/job" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip" + ccipconfig "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/config" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/factory" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/observability" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/oraclelib" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/promwrapper" + "github.com/smartcontractkit/chainlink/v2/core/services/pipeline" +) + +var defaultNewReportingPluginRetryConfig = ccipdata.RetryConfig{InitialDelay: time.Second, MaxDelay: 5 * time.Minute} + +func NewCommitServices(ctx context.Context, ds sqlutil.DataSource, srcProvider commontypes.CCIPCommitProvider, dstProvider commontypes.CCIPCommitProvider, chainSet legacyevm.LegacyChainContainer, jb job.Job, lggr logger.Logger, pr pipeline.Runner, argsNoPlugin libocr2.OCR2OracleArgs, new bool, sourceChainID int64, destChainID int64, logError func(string)) ([]job.ServiceCtx, error) { + spec := jb.OCR2OracleSpec + + var pluginConfig ccipconfig.CommitPluginJobSpecConfig + err := json.Unmarshal(spec.PluginConfig.Bytes(), &pluginConfig) + if err != nil { + return nil, err + } + + commitStoreAddress := common.HexToAddress(spec.ContractID) + + // commit store contract doesn't exist on the source chain, but we have an implementation of it + // to get access to a gas estimator on the source chain + srcCommitStore, err := srcProvider.NewCommitStoreReader(ctx, ccipcalc.EvmAddrToGeneric(commitStoreAddress)) + if err != nil { + return nil, err + } + + dstCommitStore, err := dstProvider.NewCommitStoreReader(ctx, ccipcalc.EvmAddrToGeneric(commitStoreAddress)) + if err != nil { + return nil, err + } + + var commitStoreReader ccipdata.CommitStoreReader + commitStoreReader = ccip.NewProviderProxyCommitStoreReader(srcCommitStore, dstCommitStore) + commitLggr := lggr.Named("CCIPCommit").With("sourceChain", sourceChainID, "destChain", destChainID) + + var priceGetter pricegetter.AllTokensPriceGetter + withPipeline := strings.Trim(pluginConfig.TokenPricesUSDPipeline, "\n\t ") != "" + if withPipeline { + priceGetter, err = pricegetter.NewPipelineGetter(pluginConfig.TokenPricesUSDPipeline, pr, jb.ID, jb.ExternalJobID, jb.Name.ValueOrZero(), lggr) + if err != nil { + return nil, fmt.Errorf("creating pipeline price getter: %w", err) + } + } else { + // Use dynamic price getter. + if pluginConfig.PriceGetterConfig == nil { + return nil, fmt.Errorf("priceGetterConfig is nil") + } + + // Build price getter clients for all chains specified in the aggregator configurations. + // Some lanes (e.g. Wemix/Kroma) requires other clients than source and destination, since they use feeds from other chains. + priceGetterClients := map[uint64]pricegetter.DynamicPriceGetterClient{} + for _, aggCfg := range pluginConfig.PriceGetterConfig.AggregatorPrices { + chainID := aggCfg.ChainID + // Retrieve the chain. + chain, _, err2 := ccipconfig.GetChainByChainID(chainSet, chainID) + if err2 != nil { + return nil, fmt.Errorf("retrieving chain for chainID %d: %w", chainID, err2) + } + caller := rpclib.NewDynamicLimitedBatchCaller( + lggr, + chain.Client(), + rpclib.DefaultRpcBatchSizeLimit, + rpclib.DefaultRpcBatchBackOffMultiplier, + rpclib.DefaultMaxParallelRpcCalls, + ) + priceGetterClients[chainID] = pricegetter.NewDynamicPriceGetterClient(caller) + } + + priceGetter, err = pricegetter.NewDynamicPriceGetter(*pluginConfig.PriceGetterConfig, priceGetterClients) + if err != nil { + return nil, fmt.Errorf("creating dynamic price getter: %w", err) + } + } + + offRampReader, err := dstProvider.NewOffRampReader(ctx, pluginConfig.OffRamp) + if err != nil { + return nil, err + } + + staticConfig, err := commitStoreReader.GetCommitStoreStaticConfig(ctx) + if err != nil { + return nil, err + } + onRampAddress := staticConfig.OnRamp + + onRampReader, err := srcProvider.NewOnRampReader(ctx, onRampAddress, staticConfig.SourceChainSelector, staticConfig.ChainSelector) + if err != nil { + return nil, err + } + + onRampRouterAddr, err := onRampReader.RouterAddress(ctx) + if err != nil { + return nil, err + } + sourceNative, err := srcProvider.SourceNativeToken(ctx, onRampRouterAddr) + if err != nil { + return nil, err + } + // Prom wrappers + onRampReader = observability.NewObservedOnRampReader(onRampReader, sourceChainID, ccip.CommitPluginLabel) + commitStoreReader = observability.NewObservedCommitStoreReader(commitStoreReader, destChainID, ccip.CommitPluginLabel) + offRampReader = observability.NewObservedOffRampReader(offRampReader, destChainID, ccip.CommitPluginLabel) + metricsCollector := ccip.NewPluginMetricsCollector(ccip.CommitPluginLabel, sourceChainID, destChainID) + + chainHealthCheck := cache.NewObservedChainHealthCheck( + cache.NewChainHealthcheck( + // Adding more details to Logger to make healthcheck logs more informative + // It's safe because healthcheck logs only in case of unhealthy state + lggr.With( + "onramp", onRampAddress, + "commitStore", commitStoreAddress, + "offramp", pluginConfig.OffRamp, + ), + onRampReader, + commitStoreReader, + ), + ccip.CommitPluginLabel, + sourceChainID, // assuming this is the chain id? + destChainID, + onRampAddress, + ) + + orm, err := cciporm.NewObservedORM(ds, lggr) + if err != nil { + return nil, err + } + + priceService := db.NewPriceService( + lggr, + orm, + jb.ID, + staticConfig.ChainSelector, + staticConfig.SourceChainSelector, + sourceNative, + priceGetter, + offRampReader, + ) + + wrappedPluginFactory := NewCommitReportingPluginFactory(CommitPluginStaticConfig{ + lggr: lggr, + newReportingPluginRetryConfig: defaultNewReportingPluginRetryConfig, + onRampReader: onRampReader, + sourceChainSelector: staticConfig.SourceChainSelector, + sourceNative: sourceNative, + offRamp: offRampReader, + commitStore: commitStoreReader, + destChainSelector: staticConfig.ChainSelector, + priceRegistryProvider: ccip.NewChainAgnosticPriceRegistry(dstProvider), + metricsCollector: metricsCollector, + chainHealthcheck: chainHealthCheck, + priceService: priceService, + }) + argsNoPlugin.ReportingPluginFactory = promwrapper.NewPromFactory(wrappedPluginFactory, "CCIPCommit", jb.OCR2OracleSpec.Relay, big.NewInt(0).SetInt64(destChainID)) + argsNoPlugin.Logger = commonlogger.NewOCRWrapper(commitLggr, true, logError) + oracle, err := libocr2.NewOracle(argsNoPlugin) + if err != nil { + return nil, err + } + // If this is a brand-new job, then we make use of the start blocks. If not then we're rebooting and log poller will pick up where we left off. + if new { + return []job.ServiceCtx{ + oraclelib.NewChainAgnosticBackFilledOracle( + lggr, + srcProvider, + dstProvider, + job.NewServiceAdapter(oracle), + ), + chainHealthCheck, + priceService, + }, nil + } + return []job.ServiceCtx{ + job.NewServiceAdapter(oracle), + chainHealthCheck, + priceService, + }, nil +} + +func CommitReportToEthTxMeta(typ ccipconfig.ContractType, ver semver.Version) (func(report []byte) (*txmgr.TxMeta, error), error) { + return factory.CommitReportToEthTxMeta(typ, ver) +} + +// UnregisterCommitPluginLpFilters unregisters all the registered filters for both source and dest chains. +// NOTE: The transaction MUST be used here for CLO's monster tx to function as expected +// https://github.com/smartcontractkit/ccip/blob/68e2197472fb017dd4e5630d21e7878d58bc2a44/core/services/feeds/service.go#L716 +// TODO once that transaction is broken up, we should be able to simply rely on oracle.Close() to cleanup the filters. +// Until then we have to deterministically reload the readers from the spec (and thus their filters) and close them. +func UnregisterCommitPluginLpFilters(srcProvider commontypes.CCIPCommitProvider, dstProvider commontypes.CCIPCommitProvider) error { + unregisterFuncs := []func() error{ + func() error { + return srcProvider.Close() + }, + func() error { + return dstProvider.Close() + }, + } + + var multiErr error + for _, fn := range unregisterFuncs { + if err := fn(); err != nil { + multiErr = multierr.Append(multiErr, err) + } + } + return multiErr +} diff --git a/core/services/ocr2/plugins/ccip/ccipcommit/ocr2.go b/core/services/ocr2/plugins/ccip/ccipcommit/ocr2.go new file mode 100644 index 00000000000..2f0fc4e7956 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/ccipcommit/ocr2.go @@ -0,0 +1,753 @@ +package ccipcommit + +import ( + "context" + "encoding/hex" + "fmt" + "math/big" + "sort" + "time" + + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/pkg/errors" + + "github.com/smartcontractkit/chainlink-common/pkg/hashutil" + "github.com/smartcontractkit/chainlink-common/pkg/merklemulti" + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + + "github.com/smartcontractkit/libocr/offchainreporting2plus/types" + + "github.com/smartcontractkit/chainlink/v2/core/logger" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/cache" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipcalc" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/ccipdataprovider" + db "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdb" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/prices" +) + +const ( + // only dynamic field in CommitReport is tokens PriceUpdates, and we don't expect to need to update thousands of tokens in a single tx + MaxCommitReportLength = 10_000 + // Maximum inflight seq number range before we consider reports to be failing to get included entirely + // and restart from the chain's minSeqNum. Want to set it high to allow for large throughput, + // but low enough to minimize wasted revert cost. + MaxInflightSeqNumGap = 500 + // OnRampMessagesScanLimit is used to limit number of onramp messages scanned in each Observation. + // Single CommitRoot can contain up to merklemulti.MaxNumberTreeLeaves, so we scan twice that to be safe and still don't hurt DB performance. + OnRampMessagesScanLimit = merklemulti.MaxNumberTreeLeaves * 2 +) + +var ( + _ types.ReportingPluginFactory = &CommitReportingPluginFactory{} + _ types.ReportingPlugin = &CommitReportingPlugin{} +) + +type update struct { + timestamp time.Time + value *big.Int +} + +type CommitPluginStaticConfig struct { + lggr logger.Logger + newReportingPluginRetryConfig ccipdata.RetryConfig + // Source + onRampReader ccipdata.OnRampReader + sourceChainSelector uint64 + sourceNative cciptypes.Address + // Dest + offRamp ccipdata.OffRampReader + commitStore ccipdata.CommitStoreReader + destChainSelector uint64 + priceRegistryProvider ccipdataprovider.PriceRegistry + // Offchain + metricsCollector ccip.PluginMetricsCollector + chainHealthcheck cache.ChainHealthcheck + priceService db.PriceService +} + +type CommitReportingPlugin struct { + lggr logger.Logger + // Source + onRampReader ccipdata.OnRampReader + sourceChainSelector uint64 + sourceNative cciptypes.Address + gasPriceEstimator prices.GasPriceEstimatorCommit + // Dest + destChainSelector uint64 + commitStoreReader ccipdata.CommitStoreReader + destPriceRegistryReader ccipdata.PriceRegistryReader + offchainConfig cciptypes.CommitOffchainConfig + offRampReader ccipdata.OffRampReader + F int + // Offchain + metricsCollector ccip.PluginMetricsCollector + // State + chainHealthcheck cache.ChainHealthcheck + // DB + priceService db.PriceService +} + +// Query is not used by the CCIP Commit plugin. +func (r *CommitReportingPlugin) Query(context.Context, types.ReportTimestamp) (types.Query, error) { + return types.Query{}, nil +} + +// Observation calculates the sequence number interval ready to be committed and +// the token and gas price updates required. A valid report could contain a merkle +// root and price updates. Price updates should never contain nil values, otherwise +// the observation will be considered invalid and rejected. +func (r *CommitReportingPlugin) Observation(ctx context.Context, epochAndRound types.ReportTimestamp, _ types.Query) (types.Observation, error) { + lggr := r.lggr.Named("CommitObservation") + if healthy, err := r.chainHealthcheck.IsHealthy(ctx); err != nil { + return nil, err + } else if !healthy { + return nil, ccip.ErrChainIsNotHealthy + } + + // Will return 0,0 if no messages are found. This is a valid case as the report could + // still contain fee updates. + minSeqNr, maxSeqNr, messageIDs, err := r.calculateMinMaxSequenceNumbers(ctx, lggr) + if err != nil { + return nil, err + } + + // Fetches multi-lane gasPricesUSD and tokenPricesUSD for the same dest chain + gasPricesUSD, sourceGasPriceUSD, tokenPricesUSD, err := r.observePriceUpdates(ctx) + if err != nil { + return nil, err + } + + lggr.Infow("Observation", + "minSeqNr", minSeqNr, + "maxSeqNr", maxSeqNr, + "gasPricesUSD", gasPricesUSD, + "tokenPricesUSD", tokenPricesUSD, + "epochAndRound", epochAndRound, + "messageIDs", messageIDs, + ) + r.metricsCollector.NumberOfMessagesBasedOnInterval(ccip.Observation, minSeqNr, maxSeqNr) + + // Even if all values are empty we still want to communicate our observation + // with the other nodes, therefore, we always return the observed values. + return ccip.CommitObservation{ + Interval: cciptypes.CommitStoreInterval{ + Min: minSeqNr, + Max: maxSeqNr, + }, + TokenPricesUSD: tokenPricesUSD, + SourceGasPriceUSD: sourceGasPriceUSD, + SourceGasPriceUSDPerChain: gasPricesUSD, + }.Marshal() +} + +// observePriceUpdates fetches latest gas and token prices from DB as long as price reporting is not disabled. +// The prices are aggregated for all lanes for the same destination chain. +func (r *CommitReportingPlugin) observePriceUpdates( + ctx context.Context, +) (gasPricesUSD map[uint64]*big.Int, sourceGasPriceUSD *big.Int, tokenPricesUSD map[cciptypes.Address]*big.Int, err error) { + // Do not observe prices if price reporting is disabled. Price reporting will be disabled for lanes that are not leader lanes. + if r.offchainConfig.PriceReportingDisabled { + r.lggr.Infow("Price reporting disabled, skipping gas and token price reads") + return map[uint64]*big.Int{}, nil, map[cciptypes.Address]*big.Int{}, nil + } + + // Fetches multi-lane gas prices and token prices, for the given dest chain + gasPricesUSD, tokenPricesUSD, err = r.priceService.GetGasAndTokenPrices(ctx, r.destChainSelector) + if err != nil { + return nil, nil, nil, fmt.Errorf("failed to get prices from PriceService: %w", err) + } + + // Set prices to empty maps if nil to be friendlier to JSON encoding + if gasPricesUSD == nil { + gasPricesUSD = map[uint64]*big.Int{} + } + if tokenPricesUSD == nil { + tokenPricesUSD = map[cciptypes.Address]*big.Int{} + } + + // For backwards compatibility with the older release during phased rollout, set the default gas price on this lane + sourceGasPriceUSD = gasPricesUSD[r.sourceChainSelector] + + return gasPricesUSD, sourceGasPriceUSD, tokenPricesUSD, nil +} + +func (r *CommitReportingPlugin) calculateMinMaxSequenceNumbers(ctx context.Context, lggr logger.Logger) (uint64, uint64, []cciptypes.Hash, error) { + nextSeqNum, err := r.commitStoreReader.GetExpectedNextSequenceNumber(ctx) + if err != nil { + return 0, 0, []cciptypes.Hash{}, err + } + + msgRequests, err := r.onRampReader.GetSendRequestsBetweenSeqNums(ctx, nextSeqNum, nextSeqNum+OnRampMessagesScanLimit, true) + if err != nil { + return 0, 0, []cciptypes.Hash{}, err + } + if len(msgRequests) == 0 { + lggr.Infow("No new requests", "nextSeqNum", nextSeqNum) + return 0, 0, []cciptypes.Hash{}, nil + } + + messageIDs := make([]cciptypes.Hash, 0, len(msgRequests)) + seqNrs := make([]uint64, 0, len(msgRequests)) + for _, msgReq := range msgRequests { + seqNrs = append(seqNrs, msgReq.SequenceNumber) + messageIDs = append(messageIDs, msgReq.MessageID) + } + + minSeqNr := seqNrs[0] + maxSeqNr := seqNrs[len(seqNrs)-1] + if minSeqNr != nextSeqNum { + // Still report the observation as even partial reports have value e.g. all nodes are + // missing a single, different log each, they would still be able to produce a valid report. + lggr.Warnf("Missing sequence number range [%d-%d]", nextSeqNum, minSeqNr) + } + if !ccipcalc.ContiguousReqs(lggr, minSeqNr, maxSeqNr, seqNrs) { + return 0, 0, []cciptypes.Hash{}, errors.New("unexpected gap in seq nums") + } + return minSeqNr, maxSeqNr, messageIDs, nil +} + +// Gets the latest token price updates based on logs within the heartbeat +// The updates returned by this function are guaranteed to not contain nil values. +func (r *CommitReportingPlugin) getLatestTokenPriceUpdates(ctx context.Context, now time.Time) (map[cciptypes.Address]update, error) { + tokenPriceUpdates, err := r.destPriceRegistryReader.GetTokenPriceUpdatesCreatedAfter( + ctx, + now.Add(-r.offchainConfig.TokenPriceHeartBeat), + 0, + ) + if err != nil { + return nil, err + } + + latestUpdates := make(map[cciptypes.Address]update) + for _, tokenUpdate := range tokenPriceUpdates { + priceUpdate := tokenUpdate.TokenPriceUpdate + // Ordered by ascending timestamps + timestamp := time.Unix(priceUpdate.TimestampUnixSec.Int64(), 0) + if priceUpdate.Value != nil && !timestamp.Before(latestUpdates[priceUpdate.Token].timestamp) { + latestUpdates[priceUpdate.Token] = update{ + timestamp: timestamp, + value: priceUpdate.Value, + } + } + } + + return latestUpdates, nil +} + +// getLatestGasPriceUpdate returns the latest gas price updates based on logs within the heartbeat. +// If an update is found, it is not expected to contain a nil value. +func (r *CommitReportingPlugin) getLatestGasPriceUpdate(ctx context.Context, now time.Time) (map[uint64]update, error) { + gasPriceUpdates, err := r.destPriceRegistryReader.GetAllGasPriceUpdatesCreatedAfter( + ctx, + now.Add(-r.offchainConfig.GasPriceHeartBeat), + 0, + ) + + if err != nil { + return nil, err + } + + latestUpdates := make(map[uint64]update) + for _, gasUpdate := range gasPriceUpdates { + priceUpdate := gasUpdate.GasPriceUpdate + // Ordered by ascending timestamps + timestamp := time.Unix(priceUpdate.TimestampUnixSec.Int64(), 0) + if priceUpdate.Value != nil && !timestamp.Before(latestUpdates[priceUpdate.DestChainSelector].timestamp) { + latestUpdates[priceUpdate.DestChainSelector] = update{ + timestamp: timestamp, + value: priceUpdate.Value, + } + } + } + + r.lggr.Infow("Latest gas price from log poller", "latestUpdates", latestUpdates) + return latestUpdates, nil +} + +func (r *CommitReportingPlugin) Report(ctx context.Context, epochAndRound types.ReportTimestamp, _ types.Query, observations []types.AttributedObservation) (bool, types.Report, error) { + now := time.Now() + lggr := r.lggr.Named("CommitReport") + if healthy, err := r.chainHealthcheck.IsHealthy(ctx); err != nil { + return false, nil, err + } else if !healthy { + return false, nil, ccip.ErrChainIsNotHealthy + } + + parsableObservations := ccip.GetParsableObservations[ccip.CommitObservation](lggr, observations) + + intervals, gasPriceObs, tokenPriceObs, err := extractObservationData(lggr, r.F, r.sourceChainSelector, parsableObservations) + if err != nil { + return false, nil, err + } + + agreedInterval, err := calculateIntervalConsensus(intervals, r.F, merklemulti.MaxNumberTreeLeaves) + if err != nil { + return false, nil, err + } + + gasPrices, tokenPrices, err := r.selectPriceUpdates(ctx, now, gasPriceObs, tokenPriceObs) + if err != nil { + return false, nil, err + } + // If there are no fee updates and the interval is zero there is no report to produce. + if agreedInterval.Max == 0 && len(gasPrices) == 0 && len(tokenPrices) == 0 { + lggr.Infow("Empty report, skipping") + return false, nil, nil + } + + report, err := r.buildReport(ctx, lggr, agreedInterval, gasPrices, tokenPrices) + if err != nil { + return false, nil, err + } + encodedReport, err := r.commitStoreReader.EncodeCommitReport(ctx, report) + if err != nil { + return false, nil, err + } + r.metricsCollector.SequenceNumber(ccip.Report, report.Interval.Max) + r.metricsCollector.NumberOfMessagesBasedOnInterval(ccip.Report, report.Interval.Min, report.Interval.Max) + lggr.Infow("Report", + "merkleRoot", hex.EncodeToString(report.MerkleRoot[:]), + "minSeqNr", report.Interval.Min, + "maxSeqNr", report.Interval.Max, + "gasPriceUpdates", report.GasPrices, + "tokenPriceUpdates", report.TokenPrices, + "epochAndRound", epochAndRound, + ) + return true, encodedReport, nil +} + +// calculateIntervalConsensus compresses a set of intervals into one interval +// taking into account f which is the maximum number of faults across the whole DON. +// OCR itself won't call Report unless there are 2*f+1 observations +// https://github.com/smartcontractkit/libocr/blob/master/offchainreporting2/internal/protocol/report_generation_follower.go#L415 +// and f of those observations may be either unparseable or adversarially set values. That means +// we'll either have f+1 parsed honest values here, 2f+1 parsed values with f adversarial values or somewhere +// in between. +// rangeLimit is the maximum range of the interval. If the interval is larger than this, it will be truncated. Zero means no limit. +func calculateIntervalConsensus(intervals []cciptypes.CommitStoreInterval, f int, rangeLimit uint64) (cciptypes.CommitStoreInterval, error) { + // To understand min/max selection here, we need to consider an adversary that controls f values + // and is intentionally trying to stall the protocol or influence the value returned. For simplicity + // consider f=1 and n=4 nodes. In that case adversary may try to bias the min or max high/low. + // We could end up (2f+1=3) with sorted_mins=[1,1,1e9] or [-1e9,1,1] as examples. Selecting + // sorted_mins[f] ensures: + // - At least one honest node has seen this value, so adversary cannot bias the value lower which + // would cause reverts + // - If an honest oracle reports sorted_min[f] which happens to be stale i.e. that oracle + // has a delayed view of the chain, then the report will revert onchain but still succeed upon retry + // - We minimize the risk of naturally hitting the error condition minSeqNum > maxSeqNum due to oracles + // delayed views of the chain (would be an issue with taking sorted_mins[-f]) + sort.Slice(intervals, func(i, j int) bool { + return intervals[i].Min < intervals[j].Min + }) + minSeqNum := intervals[f].Min + + // The only way a report could have a minSeqNum of 0 is when there are no messages to report + // and the report is potentially still valid for gas fee updates. + if minSeqNum == 0 { + return cciptypes.CommitStoreInterval{Min: 0, Max: 0}, nil + } + // Consider a similar example to the sorted_mins one above except where they are maxes. + // We choose the more "conservative" sorted_maxes[f] so: + // - We are ensured that at least one honest oracle has seen the max, so adversary cannot set it lower and + // cause the maxSeqNum < minSeqNum errors + // - If an honest oracle reports sorted_max[f] which happens to be stale i.e. that oracle + // has a delayed view of the source chain, then we simply lose a little bit of throughput. + // - If we were to pick sorted_max[-f] i.e. the maximum honest node view (a more "aggressive" setting in terms of throughput), + // then an adversary can continually send high values e.g. imagine we have observations from all 4 nodes + // [honest 1, honest 1, honest 2, malicious 2], in this case we pick 2, but it's not enough to be able + // to build a report since the first 2 honest nodes are unaware of message 2. + sort.Slice(intervals, func(i, j int) bool { + return intervals[i].Max < intervals[j].Max + }) + maxSeqNum := intervals[f].Max + if maxSeqNum < minSeqNum { + // If the consensus report is invalid for onchain acceptance, we do not vote for it as + // an early termination step. + return cciptypes.CommitStoreInterval{}, errors.New("max seq num smaller than min") + } + + // If the range is too large, truncate it. + if rangeLimit > 0 && maxSeqNum-minSeqNum+1 > rangeLimit { + maxSeqNum = minSeqNum + rangeLimit - 1 + } + + return cciptypes.CommitStoreInterval{ + Min: minSeqNum, + Max: maxSeqNum, + }, nil +} + +// extractObservationData extracts observation fields into their own slices +// and filters out observation data that are invalid +func extractObservationData(lggr logger.Logger, f int, sourceChainSelector uint64, observations []ccip.CommitObservation) (intervals []cciptypes.CommitStoreInterval, gasPrices map[uint64][]*big.Int, tokenPrices map[cciptypes.Address][]*big.Int, err error) { + // We require at least f+1 observations to reach consensus. Checking to ensure there are at least f+1 parsed observations. + if len(observations) <= f { + return nil, nil, nil, fmt.Errorf("not enough observations to form consensus: #obs=%d, f=%d", len(observations), f) + } + + gasPriceObservations := make(map[uint64][]*big.Int) + tokenPriceObservations := make(map[cciptypes.Address][]*big.Int) + for _, obs := range observations { + intervals = append(intervals, obs.Interval) + + for selector, price := range obs.SourceGasPriceUSDPerChain { + if price != nil { + gasPriceObservations[selector] = append(gasPriceObservations[selector], price) + } + } + // During phased rollout, NOPs running old release only report SourceGasPriceUSD. + // An empty `SourceGasPriceUSDPerChain` with a non-nil `SourceGasPriceUSD` can only happen with old release. + if len(obs.SourceGasPriceUSDPerChain) == 0 && obs.SourceGasPriceUSD != nil { + gasPriceObservations[sourceChainSelector] = append(gasPriceObservations[sourceChainSelector], obs.SourceGasPriceUSD) + } + + for token, price := range obs.TokenPricesUSD { + if price != nil { + tokenPriceObservations[token] = append(tokenPriceObservations[token], price) + } + } + } + + // Price is dropped if there are not enough valid observations. With a threshold of 2*(f-1) + 1, we achieve a balance between safety and liveness. + // During phased-rollout where some honest nodes may not have started observing the token yet, it requires 5 malicious node with 1 being the leader to successfully alter price. + // During regular operation, it requires 3 malicious nodes with 1 being the leader to temporarily delay price update for the token. + priceReportingThreshold := 2*(f-1) + 1 + + gasPrices = make(map[uint64][]*big.Int) + for selector, perChainPriceObservations := range gasPriceObservations { + if len(perChainPriceObservations) < priceReportingThreshold { + lggr.Warnf("Skipping chain with selector %d due to not enough valid observations: #obs=%d, f=%d, threshold=%d", selector, len(perChainPriceObservations), f, priceReportingThreshold) + continue + } + gasPrices[selector] = perChainPriceObservations + } + + tokenPrices = make(map[cciptypes.Address][]*big.Int) + for token, perTokenPriceObservations := range tokenPriceObservations { + if len(perTokenPriceObservations) < priceReportingThreshold { + lggr.Warnf("Skipping token %s due to not enough valid observations: #obs=%d, f=%d, threshold=%d", string(token), len(perTokenPriceObservations), f, priceReportingThreshold) + continue + } + tokenPrices[token] = perTokenPriceObservations + } + + return intervals, gasPrices, tokenPrices, nil +} + +// selectPriceUpdates filters out gas and token price updates that are already inflight +func (r *CommitReportingPlugin) selectPriceUpdates(ctx context.Context, now time.Time, gasPriceObs map[uint64][]*big.Int, tokenPriceObs map[cciptypes.Address][]*big.Int) ([]cciptypes.GasPrice, []cciptypes.TokenPrice, error) { + // If price reporting is disabled, there is no need to select price updates. + if r.offchainConfig.PriceReportingDisabled { + return nil, nil, nil + } + + latestGasPrice, err := r.getLatestGasPriceUpdate(ctx, now) + if err != nil { + return nil, nil, err + } + + latestTokenPrices, err := r.getLatestTokenPriceUpdates(ctx, now) + if err != nil { + return nil, nil, err + } + + return r.calculatePriceUpdates(gasPriceObs, tokenPriceObs, latestGasPrice, latestTokenPrices) +} + +// Note priceUpdates must be deterministic. +// The provided gasPriceObs and tokenPriceObs should not contain nil values. +// The returned latestGasPrice and latestTokenPrices should not contain nil values. +func (r *CommitReportingPlugin) calculatePriceUpdates(gasPriceObs map[uint64][]*big.Int, tokenPriceObs map[cciptypes.Address][]*big.Int, latestGasPrice map[uint64]update, latestTokenPrices map[cciptypes.Address]update) ([]cciptypes.GasPrice, []cciptypes.TokenPrice, error) { + var tokenPriceUpdates []cciptypes.TokenPrice + for token, tokenPriceObservations := range tokenPriceObs { + medianPrice := ccipcalc.BigIntSortedMiddle(tokenPriceObservations) + + latestTokenPrice, exists := latestTokenPrices[token] + if exists { + tokenPriceUpdatedRecently := time.Since(latestTokenPrice.timestamp) < r.offchainConfig.TokenPriceHeartBeat + tokenPriceNotChanged := !ccipcalc.Deviates(medianPrice, latestTokenPrice.value, int64(r.offchainConfig.TokenPriceDeviationPPB)) + if tokenPriceUpdatedRecently && tokenPriceNotChanged { + r.lggr.Debugw("token price was updated recently, skipping the update", + "token", token, "newPrice", medianPrice, "existingPrice", latestTokenPrice.value) + continue // skip the update if we recently had a price update close to the new value + } + } + + tokenPriceUpdates = append(tokenPriceUpdates, cciptypes.TokenPrice{ + Token: token, + Value: medianPrice, + }) + } + + // Determinism required. + sort.Slice(tokenPriceUpdates, func(i, j int) bool { + return tokenPriceUpdates[i].Token < tokenPriceUpdates[j].Token + }) + + var gasPriceUpdate []cciptypes.GasPrice + for chainSelector, gasPriceObservations := range gasPriceObs { + newGasPrice, err := r.gasPriceEstimator.Median(gasPriceObservations) // Compute the median price + if err != nil { + return nil, nil, fmt.Errorf("failed to calculate median gas price for chain selector %d: %w", chainSelector, err) + } + + // Default to updating so that we update if there are no prior updates. + latestGasPrice, exists := latestGasPrice[chainSelector] + if exists && latestGasPrice.value != nil { + gasPriceUpdatedRecently := time.Since(latestGasPrice.timestamp) < r.offchainConfig.GasPriceHeartBeat + gasPriceDeviated, err := r.gasPriceEstimator.Deviates(newGasPrice, latestGasPrice.value) + if err != nil { + return nil, nil, err + } + if gasPriceUpdatedRecently && !gasPriceDeviated { + r.lggr.Debugw("gas price was updated recently and not deviated sufficiently, skipping the update", + "chainSelector", chainSelector, "newPrice", newGasPrice, "existingPrice", latestGasPrice.value) + continue + } + } + + gasPriceUpdate = append(gasPriceUpdate, cciptypes.GasPrice{ + DestChainSelector: chainSelector, + Value: newGasPrice, + }) + } + + sort.Slice(gasPriceUpdate, func(i, j int) bool { + return gasPriceUpdate[i].DestChainSelector < gasPriceUpdate[j].DestChainSelector + }) + + return gasPriceUpdate, tokenPriceUpdates, nil +} + +// buildReport assumes there is at least one message in reqs. +func (r *CommitReportingPlugin) buildReport(ctx context.Context, lggr logger.Logger, interval cciptypes.CommitStoreInterval, gasPrices []cciptypes.GasPrice, tokenPrices []cciptypes.TokenPrice) (cciptypes.CommitStoreReport, error) { + // If no messages are needed only include fee updates + if interval.Min == 0 { + return cciptypes.CommitStoreReport{ + TokenPrices: tokenPrices, + GasPrices: gasPrices, + MerkleRoot: [32]byte{}, + Interval: interval, + }, nil + } + + // Logs are guaranteed to be in order of seq num, since these are finalized logs only + // and the contract's seq num is auto-incrementing. + sendRequests, err := r.onRampReader.GetSendRequestsBetweenSeqNums(ctx, interval.Min, interval.Max, true) + if err != nil { + return cciptypes.CommitStoreReport{}, err + } + if len(sendRequests) == 0 { + lggr.Warn("No messages found in interval", + "minSeqNr", interval.Min, + "maxSeqNr", interval.Max) + return cciptypes.CommitStoreReport{}, fmt.Errorf("tried building a tree without leaves") + } + + leaves := make([][32]byte, 0, len(sendRequests)) + var seqNrs []uint64 + for _, req := range sendRequests { + leaves = append(leaves, req.Hash) + seqNrs = append(seqNrs, req.SequenceNumber) + } + if !ccipcalc.ContiguousReqs(lggr, interval.Min, interval.Max, seqNrs) { + return cciptypes.CommitStoreReport{}, errors.Errorf("do not have full range [%v, %v] have %v", interval.Min, interval.Max, seqNrs) + } + tree, err := merklemulti.NewTree(hashutil.NewKeccak(), leaves) + if err != nil { + return cciptypes.CommitStoreReport{}, err + } + + return cciptypes.CommitStoreReport{ + GasPrices: gasPrices, + TokenPrices: tokenPrices, + MerkleRoot: tree.Root(), + Interval: interval, + }, nil +} + +func (r *CommitReportingPlugin) ShouldAcceptFinalizedReport(ctx context.Context, reportTimestamp types.ReportTimestamp, report types.Report) (bool, error) { + parsedReport, err := r.commitStoreReader.DecodeCommitReport(ctx, report) + if err != nil { + return false, err + } + lggr := r.lggr.Named("CommitShouldAcceptFinalizedReport").With( + "merkleRoot", parsedReport.MerkleRoot, + "minSeqNum", parsedReport.Interval.Min, + "maxSeqNum", parsedReport.Interval.Max, + "gasPriceUpdates", parsedReport.GasPrices, + "tokenPriceUpdates", parsedReport.TokenPrices, + "reportTimestamp", reportTimestamp, + ) + // Empty report, should not be put on chain + if parsedReport.MerkleRoot == [32]byte{} && len(parsedReport.GasPrices) == 0 && len(parsedReport.TokenPrices) == 0 { + lggr.Warn("Empty report, should not be put on chain") + return false, nil + } + + if healthy, err1 := r.chainHealthcheck.IsHealthy(ctx); err1 != nil { + return false, err1 + } else if !healthy { + return false, ccip.ErrChainIsNotHealthy + } + + if r.isStaleReport(ctx, lggr, parsedReport, reportTimestamp) { + lggr.Infow("Rejecting stale report") + return false, nil + } + + r.metricsCollector.SequenceNumber(ccip.ShouldAccept, parsedReport.Interval.Max) + lggr.Infow("Accepting finalized report", "merkleRoot", hexutil.Encode(parsedReport.MerkleRoot[:])) + return true, nil +} + +// ShouldTransmitAcceptedReport checks if the report is stale, if it is it should not be transmitted. +func (r *CommitReportingPlugin) ShouldTransmitAcceptedReport(ctx context.Context, reportTimestamp types.ReportTimestamp, report types.Report) (bool, error) { + lggr := r.lggr.Named("CommitShouldTransmitAcceptedReport") + parsedReport, err := r.commitStoreReader.DecodeCommitReport(ctx, report) + if err != nil { + return false, err + } + if healthy, err1 := r.chainHealthcheck.IsHealthy(ctx); err1 != nil { + return false, err1 + } else if !healthy { + return false, ccip.ErrChainIsNotHealthy + } + // If report is not stale we transmit. + // When the commitTransmitter enqueues the tx for tx manager, + // we mark it as fulfilled, effectively removing it from the set of inflight messages. + shouldTransmit := !r.isStaleReport(ctx, lggr, parsedReport, reportTimestamp) + + lggr.Infow("ShouldTransmitAcceptedReport", + "shouldTransmit", shouldTransmit, + "reportTimestamp", reportTimestamp) + return shouldTransmit, nil +} + +// isStaleReport checks a report to see if the contents have become stale. +// It does so in four ways: +// 1. if there is a merkle root, check if the sequence numbers match up with onchain data +// 2. if there is no merkle root, check if current price's epoch and round is after onchain epoch and round +// 3. if there is a gas price update check to see if the value is different from the last +// reported value +// 4. if there are token prices check to see if the values are different from the last +// reported values. +// +// If there is a merkle root present, staleness is only measured based on the merkle root +// If there is no merkle root but there is a gas update, only this gas update is used for staleness checks. +// If only price updates are included, the price updates are used to check for staleness +// If nothing is included the report is always considered stale. +func (r *CommitReportingPlugin) isStaleReport(ctx context.Context, lggr logger.Logger, report cciptypes.CommitStoreReport, reportTimestamp types.ReportTimestamp) bool { + // If there is a merkle root, ignore all other staleness checks and only check for sequence number staleness + if report.MerkleRoot != [32]byte{} { + return r.isStaleMerkleRoot(ctx, lggr, report.Interval) + } + + hasGasPriceUpdate := len(report.GasPrices) > 0 + hasTokenPriceUpdates := len(report.TokenPrices) > 0 + + // If there is no merkle root, no gas price update and no token price update + // we don't want to write anything on-chain, so we consider this report stale. + if !hasGasPriceUpdate && !hasTokenPriceUpdates { + return true + } + + // We consider a price update as stale when, there isn't an update or there is an update that is stale. + gasPriceStale := !hasGasPriceUpdate || r.isStaleGasPrice(ctx, lggr, report.GasPrices) + tokenPricesStale := !hasTokenPriceUpdates || r.isStaleTokenPrices(ctx, lggr, report.TokenPrices) + + if gasPriceStale && tokenPricesStale { + return true + } + + // If report only has price update, check if its epoch and round lags behind the latest onchain + lastPriceEpochAndRound, err := r.commitStoreReader.GetLatestPriceEpochAndRound(ctx) + if err != nil { + // Assume it's a transient issue getting the last report and try again on the next round + return true + } + + thisEpochAndRound := ccipcalc.MergeEpochAndRound(reportTimestamp.Epoch, reportTimestamp.Round) + return lastPriceEpochAndRound >= thisEpochAndRound +} + +func (r *CommitReportingPlugin) isStaleMerkleRoot(ctx context.Context, lggr logger.Logger, reportInterval cciptypes.CommitStoreInterval) bool { + nextSeqNum, err := r.commitStoreReader.GetExpectedNextSequenceNumber(ctx) + if err != nil { + // Assume it's a transient issue getting the last report and try again on the next round + return true + } + + // The report is not stale and correct only if nextSeqNum == reportInterval.Min. + // Mark it stale if the condition isn't met. + if nextSeqNum != reportInterval.Min { + lggr.Infow("The report is stale because of sequence number mismatch with the commit store interval min value", + "nextSeqNum", nextSeqNum, "reportIntervalMin", reportInterval.Min) + return true + } + + lggr.Infow("Report root is not stale", "nextSeqNum", nextSeqNum, "reportIntervalMin", reportInterval.Min) + + // If a report has root and valid sequence number, the report should be submitted, regardless of price staleness + return false +} + +func (r *CommitReportingPlugin) isStaleGasPrice(ctx context.Context, lggr logger.Logger, gasPriceUpdates []cciptypes.GasPrice) bool { + latestGasPrice, err := r.getLatestGasPriceUpdate(ctx, time.Now()) + if err != nil { + lggr.Errorw("Gas price is stale because getLatestGasPriceUpdate failed", "err", err) + return true + } + + for _, gasPriceUpdate := range gasPriceUpdates { + latestUpdate, exists := latestGasPrice[gasPriceUpdate.DestChainSelector] + if !exists || latestUpdate.value == nil { + lggr.Infow("Found non-stale gas price", "chainSelector", gasPriceUpdate.DestChainSelector, "gasPriceUSd", gasPriceUpdate.Value) + return false + } + + gasPriceDeviated, err := r.gasPriceEstimator.Deviates(gasPriceUpdate.Value, latestUpdate.value) + if err != nil { + lggr.Errorw("Gas price is stale because deviation check failed", "err", err) + return true + } + + if gasPriceDeviated { + lggr.Infow("Found non-stale gas price", "chainSelector", gasPriceUpdate.DestChainSelector, "gasPriceUSd", gasPriceUpdate.Value, "latestUpdate", latestUpdate.value) + return false + } + lggr.Infow("Gas price is stale", "chainSelector", gasPriceUpdate.DestChainSelector, "gasPriceUSd", gasPriceUpdate.Value, "latestGasPrice", latestUpdate.value) + } + + lggr.Infow("All gas prices are stale") + return true +} + +func (r *CommitReportingPlugin) isStaleTokenPrices(ctx context.Context, lggr logger.Logger, priceUpdates []cciptypes.TokenPrice) bool { + // getting the last price updates without including inflight is like querying + // current prices onchain, but uses logpoller's data to save on the RPC requests + latestTokenPriceUpdates, err := r.getLatestTokenPriceUpdates(ctx, time.Now()) + if err != nil { + return true + } + + for _, tokenUpdate := range priceUpdates { + latestUpdate, ok := latestTokenPriceUpdates[tokenUpdate.Token] + priceEqual := ok && !ccipcalc.Deviates(tokenUpdate.Value, latestUpdate.value, int64(r.offchainConfig.TokenPriceDeviationPPB)) + + if !priceEqual { + lggr.Infow("Found non-stale token price", "token", tokenUpdate.Token, "usdPerToken", tokenUpdate.Value, "latestUpdate", latestUpdate.value) + return false + } + lggr.Infow("Token price is stale", "latestTokenPrice", latestUpdate.value, "usdPerToken", tokenUpdate.Value, "token", tokenUpdate.Token) + } + + lggr.Infow("All token prices are stale") + return true +} + +func (r *CommitReportingPlugin) Close() error { + return nil +} diff --git a/core/services/ocr2/plugins/ccip/ccipcommit/ocr2_test.go b/core/services/ocr2/plugins/ccip/ccipcommit/ocr2_test.go new file mode 100644 index 00000000000..6cf7e4bec72 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/ccipcommit/ocr2_test.go @@ -0,0 +1,1861 @@ +package ccipcommit + +import ( + "context" + "encoding/json" + "fmt" + "math/big" + "math/rand" + "slices" + "sort" + "testing" + "time" + + "github.com/Masterminds/semver/v3" + "github.com/leanovate/gopter" + "github.com/leanovate/gopter/gen" + "github.com/leanovate/gopter/prop" + "github.com/pkg/errors" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + "github.com/stretchr/testify/require" + + "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" + + "github.com/smartcontractkit/libocr/offchainreporting2plus/types" + + "github.com/smartcontractkit/chainlink-common/pkg/config" + "github.com/smartcontractkit/chainlink-common/pkg/hashutil" + "github.com/smartcontractkit/chainlink-common/pkg/merklemulti" + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/gas/mocks" + mocks2 "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller/mocks" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/commit_store" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" + "github.com/smartcontractkit/chainlink/v2/core/logger" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/abihelpers" + ccipconfig "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/config" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/cache" + ccipcachemocks "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/cache/mocks" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipcalc" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/factory" + ccipdatamocks "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/mocks" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_0_0" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0" + + ccipdbmocks "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdb/mocks" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/prices" +) + +func TestCommitReportingPlugin_Observation(t *testing.T) { + sourceNativeTokenAddr := ccipcalc.HexToAddress("1000") + destChainSelector := uint64(1) + sourceChainSelector := uint64(2) + + bridgedTokens := []cciptypes.Address{ + ccipcalc.HexToAddress("2000"), + ccipcalc.HexToAddress("3000"), + } + + // Token price of 1e18 token amount in 1e18 USD precision + expectedTokenPrice := map[cciptypes.Address]*big.Int{ + bridgedTokens[0]: big.NewInt(1e10), + bridgedTokens[1]: big.NewInt(2e18), + } + + testCases := []struct { + name string + epochAndRound types.ReportTimestamp + commitStorePaused bool + sourceChainCursed bool + commitStoreSeqNum uint64 + gasPrices map[uint64]*big.Int + tokenPrices map[cciptypes.Address]*big.Int + sendReqs []cciptypes.EVM2EVMMessageWithTxMeta + priceReportingDisabled bool + + expErr bool + expObs ccip.CommitObservation + }{ + { + name: "base report", + commitStoreSeqNum: 54, + gasPrices: map[uint64]*big.Int{ + sourceChainSelector: big.NewInt(2e18), + }, + tokenPrices: expectedTokenPrice, + sendReqs: []cciptypes.EVM2EVMMessageWithTxMeta{ + {EVM2EVMMessage: cciptypes.EVM2EVMMessage{SequenceNumber: 54}}, + {EVM2EVMMessage: cciptypes.EVM2EVMMessage{SequenceNumber: 55}}, + }, + expObs: ccip.CommitObservation{ + TokenPricesUSD: expectedTokenPrice, + SourceGasPriceUSD: big.NewInt(2e18), + SourceGasPriceUSDPerChain: map[uint64]*big.Int{ + sourceChainSelector: big.NewInt(2e18), + }, + Interval: cciptypes.CommitStoreInterval{ + Min: 54, + Max: 55, + }, + }, + }, + { + name: "base report with multi-chain gas prices", + commitStoreSeqNum: 54, + gasPrices: map[uint64]*big.Int{ + sourceChainSelector + 1: big.NewInt(2e18), + sourceChainSelector + 2: big.NewInt(3e18), + }, + tokenPrices: expectedTokenPrice, + sendReqs: []cciptypes.EVM2EVMMessageWithTxMeta{ + {EVM2EVMMessage: cciptypes.EVM2EVMMessage{SequenceNumber: 54}}, + {EVM2EVMMessage: cciptypes.EVM2EVMMessage{SequenceNumber: 55}}, + }, + expObs: ccip.CommitObservation{ + TokenPricesUSD: expectedTokenPrice, + SourceGasPriceUSD: nil, + SourceGasPriceUSDPerChain: map[uint64]*big.Int{ + sourceChainSelector + 1: big.NewInt(2e18), + sourceChainSelector + 2: big.NewInt(3e18), + }, + Interval: cciptypes.CommitStoreInterval{ + Min: 54, + Max: 55, + }, + }, + }, + { + name: "base report with price reporting disabled", + commitStoreSeqNum: 54, + gasPrices: map[uint64]*big.Int{ + sourceChainSelector: big.NewInt(2e18), + }, + tokenPrices: expectedTokenPrice, + sendReqs: []cciptypes.EVM2EVMMessageWithTxMeta{ + {EVM2EVMMessage: cciptypes.EVM2EVMMessage{SequenceNumber: 54}}, + {EVM2EVMMessage: cciptypes.EVM2EVMMessage{SequenceNumber: 55}}, + }, + priceReportingDisabled: true, + expObs: ccip.CommitObservation{ + TokenPricesUSD: map[cciptypes.Address]*big.Int{}, + SourceGasPriceUSD: nil, + SourceGasPriceUSDPerChain: map[uint64]*big.Int{}, + Interval: cciptypes.CommitStoreInterval{ + Min: 54, + Max: 55, + }, + }, + }, + { + name: "commit store is down", + commitStorePaused: true, + sourceChainCursed: false, + expErr: true, + }, + { + name: "source chain is cursed", + commitStorePaused: false, + sourceChainCursed: true, + expErr: true, + }, + } + + ctx := testutils.Context(t) + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + commitStoreReader := ccipdatamocks.NewCommitStoreReader(t) + commitStoreReader.On("IsDown", ctx).Return(tc.commitStorePaused, nil) + commitStoreReader.On("IsDestChainHealthy", ctx).Return(true, nil) + if !tc.commitStorePaused && !tc.sourceChainCursed { + commitStoreReader.On("GetExpectedNextSequenceNumber", ctx).Return(tc.commitStoreSeqNum, nil) + } + + onRampReader := ccipdatamocks.NewOnRampReader(t) + onRampReader.On("IsSourceChainHealthy", ctx).Return(true, nil) + onRampReader.On("IsSourceCursed", ctx).Return(tc.sourceChainCursed, nil) + if len(tc.sendReqs) > 0 { + onRampReader.On("GetSendRequestsBetweenSeqNums", ctx, tc.commitStoreSeqNum, tc.commitStoreSeqNum+OnRampMessagesScanLimit, true). + Return(tc.sendReqs, nil) + } + + mockPriceService := ccipdbmocks.NewPriceService(t) + mockPriceService.On("GetGasAndTokenPrices", ctx, destChainSelector).Return( + tc.gasPrices, + tc.tokenPrices, + nil, + ).Maybe() + + p := &CommitReportingPlugin{} + p.lggr = logger.TestLogger(t) + p.commitStoreReader = commitStoreReader + p.onRampReader = onRampReader + p.sourceNative = sourceNativeTokenAddr + p.metricsCollector = ccip.NoopMetricsCollector + p.chainHealthcheck = cache.NewChainHealthcheck(p.lggr, onRampReader, commitStoreReader) + p.priceService = mockPriceService + p.destChainSelector = destChainSelector + p.sourceChainSelector = sourceChainSelector + p.offchainConfig = cciptypes.CommitOffchainConfig{ + PriceReportingDisabled: tc.priceReportingDisabled, + } + + obs, err := p.Observation(ctx, tc.epochAndRound, types.Query{}) + + if tc.expErr { + assert.Error(t, err) + return + } + assert.NoError(t, err) + + if tc.expObs.TokenPricesUSD != nil { + // field ordering in mapping is not guaranteed, if TokenPricesUSD exists, unmarshal to compare mapping + var obsStuct ccip.CommitObservation + err = json.Unmarshal(obs, &obsStuct) + assert.NoError(t, err) + + assert.Equal(t, tc.expObs, obsStuct) + } else { + // if TokenPricesUSD is nil, compare the bytes directly, marshal then unmarshal turns nil map to empty + expObsBytes, err := tc.expObs.Marshal() + assert.NoError(t, err) + assert.Equal(t, expObsBytes, []byte(obs)) + } + }) + } +} + +func TestCommitReportingPlugin_Report(t *testing.T) { + ctx := testutils.Context(t) + sourceChainSelector := uint64(rand.Int()) + var gasPrice = big.NewInt(1) + var gasPrice2 = big.NewInt(2) + gasPriceHeartBeat := *config.MustNewDuration(time.Hour) + + t.Run("not enough observations", func(t *testing.T) { + p := &CommitReportingPlugin{} + p.lggr = logger.TestLogger(t) + p.F = 1 + + chainHealthcheck := ccipcachemocks.NewChainHealthcheck(t) + chainHealthcheck.On("IsHealthy", ctx).Return(true, nil).Maybe() + p.chainHealthcheck = chainHealthcheck + + o := ccip.CommitObservation{Interval: cciptypes.CommitStoreInterval{Min: 1, Max: 1}, SourceGasPriceUSD: big.NewInt(0)} + obs, err := o.Marshal() + assert.NoError(t, err) + + aos := []types.AttributedObservation{{Observation: obs}} + + gotSomeReport, gotReport, err := p.Report(ctx, types.ReportTimestamp{}, types.Query{}, aos) + assert.False(t, gotSomeReport) + assert.Nil(t, gotReport) + assert.Error(t, err) + }) + + testCases := []struct { + name string + observations []ccip.CommitObservation + f int + gasPriceUpdates []cciptypes.GasPriceUpdateWithTxMeta + tokenDecimals map[cciptypes.Address]uint8 + tokenPriceUpdates []cciptypes.TokenPriceUpdateWithTxMeta + sendRequests []cciptypes.EVM2EVMMessageWithTxMeta + expCommitReport *cciptypes.CommitStoreReport + expSeqNumRange cciptypes.CommitStoreInterval + expErr bool + }{ + { + name: "base", + observations: []ccip.CommitObservation{ + {Interval: cciptypes.CommitStoreInterval{Min: 1, Max: 1}, SourceGasPriceUSDPerChain: map[uint64]*big.Int{sourceChainSelector: gasPrice}}, + {Interval: cciptypes.CommitStoreInterval{Min: 1, Max: 1}, SourceGasPriceUSDPerChain: map[uint64]*big.Int{sourceChainSelector: gasPrice}}, + }, + f: 1, + sendRequests: []cciptypes.EVM2EVMMessageWithTxMeta{ + { + EVM2EVMMessage: cciptypes.EVM2EVMMessage{ + SequenceNumber: 1, + }, + }, + }, + gasPriceUpdates: []cciptypes.GasPriceUpdateWithTxMeta{ + { + GasPriceUpdate: cciptypes.GasPriceUpdate{ + GasPrice: cciptypes.GasPrice{ + DestChainSelector: sourceChainSelector, + Value: big.NewInt(1), + }, + TimestampUnixSec: big.NewInt(time.Now().Add(-2 * gasPriceHeartBeat.Duration()).Unix()), + }, + }, + }, + expSeqNumRange: cciptypes.CommitStoreInterval{Min: 1, Max: 1}, + expCommitReport: &cciptypes.CommitStoreReport{ + MerkleRoot: [32]byte{}, + Interval: cciptypes.CommitStoreInterval{Min: 1, Max: 1}, + TokenPrices: nil, + GasPrices: []cciptypes.GasPrice{{DestChainSelector: sourceChainSelector, Value: gasPrice}}, + }, + expErr: false, + }, + { + name: "observations with mix gas price formats", + observations: []ccip.CommitObservation{ + { + Interval: cciptypes.CommitStoreInterval{Min: 1, Max: 1}, + SourceGasPriceUSDPerChain: map[uint64]*big.Int{ + sourceChainSelector: gasPrice, + sourceChainSelector + 1: gasPrice2, + sourceChainSelector + 2: gasPrice2, + }, + }, + { + Interval: cciptypes.CommitStoreInterval{Min: 1, Max: 1}, + SourceGasPriceUSDPerChain: map[uint64]*big.Int{ + sourceChainSelector: gasPrice, + sourceChainSelector + 1: gasPrice2, + sourceChainSelector + 2: gasPrice2, + }, + }, + { + Interval: cciptypes.CommitStoreInterval{Min: 1, Max: 1}, + SourceGasPriceUSDPerChain: map[uint64]*big.Int{ + sourceChainSelector: gasPrice, + sourceChainSelector + 1: gasPrice2, + }, + }, + { + Interval: cciptypes.CommitStoreInterval{Min: 1, Max: 1}, + SourceGasPriceUSD: gasPrice, + }, + }, + f: 2, + sendRequests: []cciptypes.EVM2EVMMessageWithTxMeta{ + { + EVM2EVMMessage: cciptypes.EVM2EVMMessage{ + SequenceNumber: 1, + }, + }, + }, + gasPriceUpdates: []cciptypes.GasPriceUpdateWithTxMeta{ + { + GasPriceUpdate: cciptypes.GasPriceUpdate{ + GasPrice: cciptypes.GasPrice{ + DestChainSelector: sourceChainSelector, + Value: big.NewInt(1), + }, + TimestampUnixSec: big.NewInt(time.Now().Add(-2 * gasPriceHeartBeat.Duration()).Unix()), + }, + }, + }, + expSeqNumRange: cciptypes.CommitStoreInterval{Min: 1, Max: 1}, + expCommitReport: &cciptypes.CommitStoreReport{ + MerkleRoot: [32]byte{}, + Interval: cciptypes.CommitStoreInterval{Min: 1, Max: 1}, + TokenPrices: nil, + GasPrices: []cciptypes.GasPrice{ + {DestChainSelector: sourceChainSelector, Value: gasPrice}, + {DestChainSelector: sourceChainSelector + 1, Value: gasPrice2}, + }, + }, + expErr: false, + }, + { + name: "empty", + observations: []ccip.CommitObservation{ + {Interval: cciptypes.CommitStoreInterval{Min: 0, Max: 0}, SourceGasPriceUSD: big.NewInt(0)}, + {Interval: cciptypes.CommitStoreInterval{Min: 0, Max: 0}, SourceGasPriceUSD: big.NewInt(0)}, + }, + gasPriceUpdates: []cciptypes.GasPriceUpdateWithTxMeta{ + { + GasPriceUpdate: cciptypes.GasPriceUpdate{ + GasPrice: cciptypes.GasPrice{ + DestChainSelector: sourceChainSelector, + Value: big.NewInt(0), + }, + TimestampUnixSec: big.NewInt(time.Now().Add(-gasPriceHeartBeat.Duration() / 2).Unix()), + }, + }, + }, + f: 1, + expErr: false, + }, + { + name: "no leaves", + observations: []ccip.CommitObservation{ + {Interval: cciptypes.CommitStoreInterval{Min: 2, Max: 2}, SourceGasPriceUSD: big.NewInt(0)}, + {Interval: cciptypes.CommitStoreInterval{Min: 2, Max: 2}, SourceGasPriceUSD: big.NewInt(0)}, + }, + f: 1, + sendRequests: []cciptypes.EVM2EVMMessageWithTxMeta{{}}, + expSeqNumRange: cciptypes.CommitStoreInterval{Min: 2, Max: 2}, + expErr: true, + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + destPriceRegistryReader := ccipdatamocks.NewPriceRegistryReader(t) + destPriceRegistryReader.On("GetAllGasPriceUpdatesCreatedAfter", ctx, mock.Anything, 0).Return(tc.gasPriceUpdates, nil) + destPriceRegistryReader.On("GetTokenPriceUpdatesCreatedAfter", ctx, mock.Anything, 0).Return(tc.tokenPriceUpdates, nil) + + onRampReader := ccipdatamocks.NewOnRampReader(t) + if len(tc.sendRequests) > 0 { + onRampReader.On("GetSendRequestsBetweenSeqNums", ctx, tc.expSeqNumRange.Min, tc.expSeqNumRange.Max, true).Return(tc.sendRequests, nil) + } + + evmEstimator := mocks.NewEvmFeeEstimator(t) + evmEstimator.On("L1Oracle").Return(nil) + gasPriceEstimator := prices.NewDAGasPriceEstimator(evmEstimator, nil, 2e9, 2e9) // 200% deviation + + var destTokens []cciptypes.Address + for tk := range tc.tokenDecimals { + destTokens = append(destTokens, tk) + } + sort.Slice(destTokens, func(i, j int) bool { + return destTokens[i] < destTokens[j] + }) + var destDecimals []uint8 + for _, token := range destTokens { + destDecimals = append(destDecimals, tc.tokenDecimals[token]) + } + + destPriceRegistryReader.On("GetTokensDecimals", ctx, mock.MatchedBy(func(tokens []cciptypes.Address) bool { + for _, token := range tokens { + if !slices.Contains(destTokens, token) { + return false + } + } + return true + })).Return(destDecimals, nil).Maybe() + + lp := mocks2.NewLogPoller(t) + commitStoreReader, err := v1_2_0.NewCommitStore(logger.TestLogger(t), utils.RandomAddress(), nil, lp) + assert.NoError(t, err) + + healthCheck := ccipcachemocks.NewChainHealthcheck(t) + healthCheck.On("IsHealthy", ctx).Return(true, nil) + + p := &CommitReportingPlugin{} + p.lggr = logger.TestLogger(t) + p.destPriceRegistryReader = destPriceRegistryReader + p.onRampReader = onRampReader + p.sourceChainSelector = sourceChainSelector + p.gasPriceEstimator = gasPriceEstimator + p.offchainConfig.GasPriceHeartBeat = gasPriceHeartBeat.Duration() + p.commitStoreReader = commitStoreReader + p.F = tc.f + p.metricsCollector = ccip.NoopMetricsCollector + p.chainHealthcheck = healthCheck + + aos := make([]types.AttributedObservation, 0, len(tc.observations)) + for _, o := range tc.observations { + obs, err2 := o.Marshal() + assert.NoError(t, err2) + aos = append(aos, types.AttributedObservation{Observation: obs}) + } + + gotSomeReport, gotReport, err := p.Report(ctx, types.ReportTimestamp{}, types.Query{}, aos) + if tc.expErr { + assert.Error(t, err) + return + } + + assert.NoError(t, err) + + if tc.expCommitReport != nil { + assert.True(t, gotSomeReport) + encodedExpectedReport, err := encodeCommitReport(*tc.expCommitReport) + assert.NoError(t, err) + assert.Equal(t, types.Report(encodedExpectedReport), gotReport) + } + }) + } +} + +func TestCommitReportingPlugin_ShouldAcceptFinalizedReport(t *testing.T) { + ctx := testutils.Context(t) + + newPlugin := func() *CommitReportingPlugin { + p := &CommitReportingPlugin{} + p.lggr = logger.TestLogger(t) + p.metricsCollector = ccip.NoopMetricsCollector + return p + } + + t.Run("report cannot be decoded leads to error", func(t *testing.T) { + p := newPlugin() + + encodedReport := []byte("whatever") + + commitStoreReader := ccipdatamocks.NewCommitStoreReader(t) + p.commitStoreReader = commitStoreReader + commitStoreReader.On("DecodeCommitReport", mock.Anything, encodedReport). + Return(cciptypes.CommitStoreReport{}, errors.New("unable to decode report")) + + _, err := p.ShouldAcceptFinalizedReport(ctx, types.ReportTimestamp{}, encodedReport) + assert.Error(t, err) + }) + + t.Run("empty report should not be accepted", func(t *testing.T) { + p := newPlugin() + + report := cciptypes.CommitStoreReport{} + + commitStoreReader := ccipdatamocks.NewCommitStoreReader(t) + p.commitStoreReader = commitStoreReader + commitStoreReader.On("DecodeCommitReport", mock.Anything, mock.Anything).Return(report, nil) + + chainHealthCheck := ccipcachemocks.NewChainHealthcheck(t) + chainHealthCheck.On("IsHealthy", ctx).Return(true, nil).Maybe() + p.chainHealthcheck = chainHealthCheck + + encodedReport, err := encodeCommitReport(report) + assert.NoError(t, err) + shouldAccept, err := p.ShouldAcceptFinalizedReport(ctx, types.ReportTimestamp{}, encodedReport) + assert.NoError(t, err) + assert.False(t, shouldAccept) + }) + + t.Run("stale report should not be accepted", func(t *testing.T) { + onChainSeqNum := uint64(100) + + commitStoreReader := ccipdatamocks.NewCommitStoreReader(t) + p := newPlugin() + + p.commitStoreReader = commitStoreReader + + report := cciptypes.CommitStoreReport{ + GasPrices: []cciptypes.GasPrice{{Value: big.NewInt(int64(rand.Int()))}}, + MerkleRoot: [32]byte{123}, // this report is considered non-empty since it has a merkle root + } + + commitStoreReader.On("DecodeCommitReport", mock.Anything, mock.Anything).Return(report, nil) + commitStoreReader.On("GetExpectedNextSequenceNumber", mock.Anything).Return(onChainSeqNum, nil) + + chainHealthCheck := ccipcachemocks.NewChainHealthcheck(t) + chainHealthCheck.On("IsHealthy", ctx).Return(true, nil) + p.chainHealthcheck = chainHealthCheck + + // stale since report interval is behind on chain seq num + report.Interval = cciptypes.CommitStoreInterval{Min: onChainSeqNum - 2, Max: onChainSeqNum + 10} + encodedReport, err := encodeCommitReport(report) + assert.NoError(t, err) + + shouldAccept, err := p.ShouldAcceptFinalizedReport(ctx, types.ReportTimestamp{}, encodedReport) + assert.NoError(t, err) + assert.False(t, shouldAccept) + }) + + t.Run("non-stale report should be accepted", func(t *testing.T) { + onChainSeqNum := uint64(100) + + p := newPlugin() + + priceRegistryReader := ccipdatamocks.NewPriceRegistryReader(t) + p.destPriceRegistryReader = priceRegistryReader + + p.lggr = logger.TestLogger(t) + commitStoreReader := ccipdatamocks.NewCommitStoreReader(t) + p.commitStoreReader = commitStoreReader + + report := cciptypes.CommitStoreReport{ + Interval: cciptypes.CommitStoreInterval{ + Min: onChainSeqNum, + Max: onChainSeqNum + 10, + }, + TokenPrices: []cciptypes.TokenPrice{ + { + Token: cciptypes.Address(utils.RandomAddress().String()), + Value: big.NewInt(int64(rand.Int())), + }, + }, + GasPrices: []cciptypes.GasPrice{ + { + DestChainSelector: rand.Uint64(), + Value: big.NewInt(int64(rand.Int())), + }, + }, + MerkleRoot: [32]byte{123}, + } + commitStoreReader.On("DecodeCommitReport", mock.Anything, mock.Anything).Return(report, nil) + commitStoreReader.On("GetExpectedNextSequenceNumber", mock.Anything).Return(onChainSeqNum, nil) + + // non-stale since report interval is not behind on-chain seq num + report.Interval = cciptypes.CommitStoreInterval{Min: onChainSeqNum, Max: onChainSeqNum + 10} + encodedReport, err := encodeCommitReport(report) + assert.NoError(t, err) + + chainHealthCheck := ccipcachemocks.NewChainHealthcheck(t) + chainHealthCheck.On("IsHealthy", ctx).Return(true, nil) + p.chainHealthcheck = chainHealthCheck + + shouldAccept, err := p.ShouldAcceptFinalizedReport(ctx, types.ReportTimestamp{}, encodedReport) + assert.NoError(t, err) + assert.True(t, shouldAccept) + }) +} + +func TestCommitReportingPlugin_ShouldTransmitAcceptedReport(t *testing.T) { + report := cciptypes.CommitStoreReport{ + TokenPrices: []cciptypes.TokenPrice{ + {Token: cciptypes.Address(utils.RandomAddress().String()), Value: big.NewInt(9e18)}, + }, + GasPrices: []cciptypes.GasPrice{ + { + + DestChainSelector: rand.Uint64(), + Value: big.NewInt(2000e9), + }, + }, + MerkleRoot: [32]byte{123}, + } + + ctx := testutils.Context(t) + p := &CommitReportingPlugin{} + commitStoreReader := ccipdatamocks.NewCommitStoreReader(t) + onChainSeqNum := uint64(100) + commitStoreReader.On("GetExpectedNextSequenceNumber", mock.Anything).Return(onChainSeqNum, nil) + p.commitStoreReader = commitStoreReader + p.lggr = logger.TestLogger(t) + + chainHealthCheck := ccipcachemocks.NewChainHealthcheck(t) + chainHealthCheck.On("IsHealthy", ctx).Return(true, nil).Maybe() + p.chainHealthcheck = chainHealthCheck + + t.Run("should transmit when report is not stale", func(t *testing.T) { + // not-stale since report interval is not behind on chain seq num + report.Interval = cciptypes.CommitStoreInterval{Min: onChainSeqNum, Max: onChainSeqNum + 10} + encodedReport, err := encodeCommitReport(report) + assert.NoError(t, err) + commitStoreReader.On("DecodeCommitReport", mock.Anything, encodedReport).Return(report, nil).Once() + shouldTransmit, err := p.ShouldTransmitAcceptedReport(ctx, types.ReportTimestamp{}, encodedReport) + assert.NoError(t, err) + assert.True(t, shouldTransmit) + }) + + t.Run("should not transmit when report is stale", func(t *testing.T) { + // stale since report interval is behind on chain seq num + report.Interval = cciptypes.CommitStoreInterval{Min: onChainSeqNum - 2, Max: onChainSeqNum + 10} + encodedReport, err := encodeCommitReport(report) + assert.NoError(t, err) + commitStoreReader.On("DecodeCommitReport", mock.Anything, encodedReport).Return(report, nil).Once() + shouldTransmit, err := p.ShouldTransmitAcceptedReport(ctx, types.ReportTimestamp{}, encodedReport) + assert.NoError(t, err) + assert.False(t, shouldTransmit) + }) + + t.Run("error when report cannot be decoded", func(t *testing.T) { + reportBytes := []byte("whatever") + commitStoreReader.On("DecodeCommitReport", mock.Anything, reportBytes). + Return(cciptypes.CommitStoreReport{}, errors.New("decode error")).Once() + _, err := p.ShouldTransmitAcceptedReport(ctx, types.ReportTimestamp{}, reportBytes) + assert.Error(t, err) + }) +} + +func TestCommitReportingPlugin_observePriceUpdates(t *testing.T) { + destChainSelector := uint64(12345) + sourceChainSelector := uint64(67890) + + token1 := ccipcalc.HexToAddress("0x123") + token2 := ccipcalc.HexToAddress("0x234") + + gasPrices := map[uint64]*big.Int{ + sourceChainSelector: big.NewInt(1e18), + } + tokenPrices := map[cciptypes.Address]*big.Int{ + token1: big.NewInt(2e18), + token2: big.NewInt(3e18), + } + + testCases := []struct { + name string + psGasPricesResult map[uint64]*big.Int + psTokenPricesResult map[cciptypes.Address]*big.Int + PriceReportingDisabled bool + + expectedGasPrice map[uint64]*big.Int + expectedTokenPrices map[cciptypes.Address]*big.Int + + psError bool + expectedErr bool + }{ + { + name: "ORM called successfully", + psGasPricesResult: gasPrices, + psTokenPricesResult: tokenPrices, + expectedGasPrice: gasPrices, + expectedTokenPrices: tokenPrices, + }, + { + name: "price reporting disabled", + psGasPricesResult: gasPrices, + psTokenPricesResult: tokenPrices, + PriceReportingDisabled: true, + expectedGasPrice: map[uint64]*big.Int{}, + expectedTokenPrices: map[cciptypes.Address]*big.Int{}, + psError: false, + expectedErr: false, + }, + { + name: "price service error", + psGasPricesResult: map[uint64]*big.Int{}, + psTokenPricesResult: map[cciptypes.Address]*big.Int{}, + expectedGasPrice: nil, + expectedTokenPrices: nil, + psError: true, + expectedErr: true, + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + ctx := tests.Context(t) + + mockPriceService := ccipdbmocks.NewPriceService(t) + var psError error + if tc.psError { + psError = fmt.Errorf("price service error") + } + mockPriceService.On("GetGasAndTokenPrices", ctx, destChainSelector).Return( + tc.psGasPricesResult, + tc.psTokenPricesResult, + psError, + ).Maybe() + + p := &CommitReportingPlugin{ + lggr: logger.TestLogger(t), + destChainSelector: destChainSelector, + sourceChainSelector: sourceChainSelector, + priceService: mockPriceService, + offchainConfig: cciptypes.CommitOffchainConfig{ + PriceReportingDisabled: tc.PriceReportingDisabled, + }, + } + gasPricesUSD, sourceGasPriceUSD, tokenPricesUSD, err := p.observePriceUpdates(ctx) + if tc.expectedErr { + assert.Error(t, err) + } else { + assert.NoError(t, err) + assert.Equal(t, tc.expectedGasPrice, gasPricesUSD) + assert.Equal(t, tc.expectedTokenPrices, tokenPricesUSD) + if tc.expectedGasPrice != nil { + assert.Equal(t, tc.expectedGasPrice[sourceChainSelector], sourceGasPriceUSD) + } + } + }) + } +} + +type CommitObservationLegacy struct { + Interval cciptypes.CommitStoreInterval `json:"interval"` + TokenPricesUSD map[cciptypes.Address]*big.Int `json:"tokensPerFeeCoin"` + SourceGasPriceUSD *big.Int `json:"sourceGasPrice"` +} + +func TestCommitReportingPlugin_extractObservationData(t *testing.T) { + token1 := ccipcalc.HexToAddress("0xa") + token2 := ccipcalc.HexToAddress("0xb") + token1Price := big.NewInt(1) + token2Price := big.NewInt(2) + unsupportedToken := ccipcalc.HexToAddress("0xc") + gasPrice1 := big.NewInt(100) + gasPrice2 := big.NewInt(100) + var sourceChainSelector1 uint64 = 10 + var sourceChainSelector2 uint64 = 20 + + tokenDecimals := make(map[cciptypes.Address]uint8) + tokenDecimals[token1] = 18 + tokenDecimals[token2] = 18 + + validInterval := cciptypes.CommitStoreInterval{Min: 1, Max: 2} + zeroInterval := cciptypes.CommitStoreInterval{Min: 0, Max: 0} + + // mix legacy commit observations with new commit observations to ensure they can work together + legacyObsRaw := CommitObservationLegacy{ + Interval: validInterval, + TokenPricesUSD: map[cciptypes.Address]*big.Int{ + token1: token1Price, + token2: token2Price, + }, + SourceGasPriceUSD: gasPrice1, + } + legacyObsBytes, err := json.Marshal(&legacyObsRaw) + assert.NoError(t, err) + + newObsRaw := ccip.CommitObservation{ + Interval: validInterval, + TokenPricesUSD: map[cciptypes.Address]*big.Int{ + token1: token1Price, + token2: token2Price, + }, + SourceGasPriceUSD: gasPrice1, + SourceGasPriceUSDPerChain: map[uint64]*big.Int{ + sourceChainSelector1: gasPrice1, + sourceChainSelector2: gasPrice2, + }, + } + newObsBytes, err := newObsRaw.Marshal() + assert.NoError(t, err) + + lggr := logger.TestLogger(t) + observations := ccip.GetParsableObservations[ccip.CommitObservation](lggr, []types.AttributedObservation{ + {Observation: legacyObsBytes}, + {Observation: newObsBytes}, + }) + assert.Len(t, observations, 2) + legacyObs := observations[0] + newObs := observations[1] + + obWithNilGasPrice := ccip.CommitObservation{ + Interval: zeroInterval, + TokenPricesUSD: map[cciptypes.Address]*big.Int{ + token1: token1Price, + token2: token2Price, + }, + SourceGasPriceUSD: nil, + SourceGasPriceUSDPerChain: map[uint64]*big.Int{}, + } + obWithNilTokenPrice := ccip.CommitObservation{ + Interval: zeroInterval, + TokenPricesUSD: map[cciptypes.Address]*big.Int{ + token1: token1Price, + token2: nil, + }, + SourceGasPriceUSD: gasPrice1, + SourceGasPriceUSDPerChain: map[uint64]*big.Int{ + sourceChainSelector1: gasPrice1, + sourceChainSelector2: gasPrice2, + }, + } + obMissingTokenPrices := ccip.CommitObservation{ + Interval: zeroInterval, + TokenPricesUSD: map[cciptypes.Address]*big.Int{}, + SourceGasPriceUSD: gasPrice1, + SourceGasPriceUSDPerChain: map[uint64]*big.Int{ + sourceChainSelector1: gasPrice1, + sourceChainSelector2: gasPrice2, + }, + } + obWithUnsupportedToken := ccip.CommitObservation{ + Interval: zeroInterval, + TokenPricesUSD: map[cciptypes.Address]*big.Int{ + token1: token1Price, + token2: token2Price, + unsupportedToken: token2Price, + }, + SourceGasPriceUSD: gasPrice1, + SourceGasPriceUSDPerChain: map[uint64]*big.Int{ + sourceChainSelector1: gasPrice1, + sourceChainSelector2: gasPrice2, + }, + } + obEmpty := ccip.CommitObservation{ + Interval: zeroInterval, + TokenPricesUSD: nil, + SourceGasPriceUSD: nil, + SourceGasPriceUSDPerChain: nil, + } + + testCases := []struct { + name string + commitObservations []ccip.CommitObservation + f int + expIntervals []cciptypes.CommitStoreInterval + expGasPriceObs map[uint64][]*big.Int + expTokenPriceObs map[cciptypes.Address][]*big.Int + expError bool + }{ + { + name: "base", + commitObservations: []ccip.CommitObservation{newObs, newObs, newObs}, + f: 2, + expIntervals: []cciptypes.CommitStoreInterval{validInterval, validInterval, validInterval}, + expGasPriceObs: map[uint64][]*big.Int{ + sourceChainSelector1: {gasPrice1, gasPrice1, gasPrice1}, + sourceChainSelector2: {gasPrice2, gasPrice2, gasPrice2}, + }, + expTokenPriceObs: map[cciptypes.Address][]*big.Int{ + token1: {token1Price, token1Price, token1Price}, + token2: {token2Price, token2Price, token2Price}, + }, + expError: false, + }, + { + name: "pass with f=2 and mixed observations", + commitObservations: []ccip.CommitObservation{legacyObs, newObs, legacyObs, newObs, newObs, obWithNilGasPrice}, + f: 2, + expIntervals: []cciptypes.CommitStoreInterval{validInterval, validInterval, validInterval, validInterval, validInterval, zeroInterval}, + expGasPriceObs: map[uint64][]*big.Int{ + sourceChainSelector1: {gasPrice1, gasPrice1, gasPrice1, gasPrice1, gasPrice1}, + sourceChainSelector2: {gasPrice2, gasPrice2, gasPrice2}, + }, + expTokenPriceObs: map[cciptypes.Address][]*big.Int{ + token1: {token1Price, token1Price, token1Price, token1Price, token1Price, token1Price}, + token2: {token2Price, token2Price, token2Price, token2Price, token2Price, token2Price}, + }, + expError: false, + }, + { + name: "pass with f=2 and mixed observations with mostly legacy observations", + commitObservations: []ccip.CommitObservation{legacyObs, legacyObs, legacyObs, legacyObs, newObs}, + f: 2, + expIntervals: []cciptypes.CommitStoreInterval{validInterval, validInterval, validInterval, validInterval, validInterval}, + expGasPriceObs: map[uint64][]*big.Int{ + sourceChainSelector1: {gasPrice1, gasPrice1, gasPrice1, gasPrice1, gasPrice1}, + }, + expTokenPriceObs: map[cciptypes.Address][]*big.Int{ + token1: {token1Price, token1Price, token1Price, token1Price, token1Price}, + token2: {token2Price, token2Price, token2Price, token2Price, token2Price}, + }, + expError: false, + }, + { + name: "tolerate 1 faulty obs with f=2", + commitObservations: []ccip.CommitObservation{legacyObs, newObs, legacyObs, obWithNilGasPrice}, + f: 2, + expIntervals: []cciptypes.CommitStoreInterval{validInterval, validInterval, validInterval, zeroInterval}, + expGasPriceObs: map[uint64][]*big.Int{ + sourceChainSelector1: {gasPrice1, gasPrice1, gasPrice1}, + }, + expTokenPriceObs: map[cciptypes.Address][]*big.Int{ + token1: {token1Price, token1Price, token1Price, token1Price}, + token2: {token2Price, token2Price, token2Price, token2Price}, + }, + expError: false, + }, + { + name: "tolerate 1 nil token price with f=1", + commitObservations: []ccip.CommitObservation{legacyObs, newObs, obWithNilTokenPrice}, + f: 1, + expIntervals: []cciptypes.CommitStoreInterval{validInterval, validInterval, zeroInterval}, + expGasPriceObs: map[uint64][]*big.Int{ + sourceChainSelector1: {gasPrice1, gasPrice1, gasPrice1}, + sourceChainSelector2: {gasPrice2, gasPrice2}, + }, + expTokenPriceObs: map[cciptypes.Address][]*big.Int{ + token1: {token1Price, token1Price, token1Price}, + token2: {token2Price, token2Price}, + }, + expError: false, + }, + { + name: "tolerate 1 missing token prices with f=1", + commitObservations: []ccip.CommitObservation{legacyObs, newObs, obMissingTokenPrices}, + f: 1, + expIntervals: []cciptypes.CommitStoreInterval{validInterval, validInterval, zeroInterval}, + expGasPriceObs: map[uint64][]*big.Int{ + sourceChainSelector1: {gasPrice1, gasPrice1, gasPrice1}, + sourceChainSelector2: {gasPrice2, gasPrice2}, + }, + expTokenPriceObs: map[cciptypes.Address][]*big.Int{ + token1: {token1Price, token1Price}, + token2: {token2Price, token2Price}, + }, + expError: false, + }, + { + name: "tolerate 1 unsupported token with f=2", + commitObservations: []ccip.CommitObservation{legacyObs, newObs, obWithUnsupportedToken}, + f: 2, + expIntervals: []cciptypes.CommitStoreInterval{validInterval, validInterval, zeroInterval}, + expGasPriceObs: map[uint64][]*big.Int{ + sourceChainSelector1: {gasPrice1, gasPrice1, gasPrice1}, + }, + expTokenPriceObs: map[cciptypes.Address][]*big.Int{ + token1: {token1Price, token1Price, token1Price}, + token2: {token2Price, token2Price, token2Price}, + }, + expError: false, + }, + { + name: "tolerate mis-matched token observations with f=2", + commitObservations: []ccip.CommitObservation{legacyObs, newObs, obWithNilTokenPrice, obMissingTokenPrices}, + f: 2, + expIntervals: []cciptypes.CommitStoreInterval{validInterval, validInterval, zeroInterval, zeroInterval}, + expGasPriceObs: map[uint64][]*big.Int{ + sourceChainSelector1: {gasPrice1, gasPrice1, gasPrice1, gasPrice1}, + sourceChainSelector2: {gasPrice2, gasPrice2, gasPrice2}, + }, + expTokenPriceObs: map[cciptypes.Address][]*big.Int{ + token1: {token1Price, token1Price, token1Price}, + }, + expError: false, + }, + { + name: "tolerate all tokens filtered out with f=2", + commitObservations: []ccip.CommitObservation{newObs, obMissingTokenPrices, obMissingTokenPrices}, + f: 2, + expIntervals: []cciptypes.CommitStoreInterval{validInterval, zeroInterval, zeroInterval}, + expGasPriceObs: map[uint64][]*big.Int{ + sourceChainSelector1: {gasPrice1, gasPrice1, gasPrice1}, + sourceChainSelector2: {gasPrice2, gasPrice2, gasPrice2}, + }, + expTokenPriceObs: map[cciptypes.Address][]*big.Int{}, + expError: false, + }, + { + name: "not enough observations", + commitObservations: []ccip.CommitObservation{legacyObs, newObs}, + f: 2, + expError: true, + }, + { + name: "too many empty observations", + commitObservations: []ccip.CommitObservation{obWithNilGasPrice, obWithNilTokenPrice, obEmpty, obEmpty, obEmpty}, + f: 2, + expIntervals: []cciptypes.CommitStoreInterval{zeroInterval, zeroInterval, zeroInterval, zeroInterval, zeroInterval}, + expGasPriceObs: map[uint64][]*big.Int{}, + expTokenPriceObs: map[cciptypes.Address][]*big.Int{}, + expError: false, + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + intervals, gasPriceOps, tokenPriceOps, err := extractObservationData(logger.TestLogger(t), tc.f, sourceChainSelector1, tc.commitObservations) + + if tc.expError { + assert.Error(t, err) + return + } + assert.Equal(t, tc.expIntervals, intervals) + assert.Equal(t, tc.expGasPriceObs, gasPriceOps) + assert.Equal(t, tc.expTokenPriceObs, tokenPriceOps) + assert.NoError(t, err) + }) + } +} + +func TestCommitReportingPlugin_calculatePriceUpdates(t *testing.T) { + const defaultSourceChainSelector = 10 // we reuse this value across all test cases + feeToken1 := ccipcalc.HexToAddress("0xa") + feeToken2 := ccipcalc.HexToAddress("0xb") + + val1e18 := func(val int64) *big.Int { return new(big.Int).Mul(big.NewInt(1e18), big.NewInt(val)) } + + testCases := []struct { + name string + commitObservations []ccip.CommitObservation + f int + latestGasPrice map[uint64]update + latestTokenPrices map[cciptypes.Address]update + gasPriceHeartBeat config.Duration + daGasPriceDeviationPPB int64 + execGasPriceDeviationPPB int64 + tokenPriceHeartBeat config.Duration + tokenPriceDeviationPPB uint32 + expTokenUpdates []cciptypes.TokenPrice + expGasUpdates []cciptypes.GasPrice + }{ + { + name: "median", + commitObservations: []ccip.CommitObservation{ + {SourceGasPriceUSDPerChain: map[uint64]*big.Int{defaultSourceChainSelector: big.NewInt(1)}}, + {SourceGasPriceUSDPerChain: map[uint64]*big.Int{defaultSourceChainSelector: big.NewInt(2)}}, + {SourceGasPriceUSDPerChain: map[uint64]*big.Int{defaultSourceChainSelector: big.NewInt(3)}}, + {SourceGasPriceUSDPerChain: map[uint64]*big.Int{defaultSourceChainSelector: big.NewInt(4)}}, + }, + latestGasPrice: map[uint64]update{ + defaultSourceChainSelector: { + timestamp: time.Now().Add(-30 * time.Minute), // recent + value: val1e18(9), // median deviates + }, + }, + f: 2, + expGasUpdates: []cciptypes.GasPrice{{DestChainSelector: defaultSourceChainSelector, Value: big.NewInt(3)}}, + }, + { + name: "gas price update skipped because the latest is similar and was updated recently", + commitObservations: []ccip.CommitObservation{ + {SourceGasPriceUSDPerChain: map[uint64]*big.Int{defaultSourceChainSelector: val1e18(11)}}, + {SourceGasPriceUSDPerChain: map[uint64]*big.Int{defaultSourceChainSelector: val1e18(12)}}, + }, + gasPriceHeartBeat: *config.MustNewDuration(time.Hour), + daGasPriceDeviationPPB: 20e7, + execGasPriceDeviationPPB: 20e7, + tokenPriceHeartBeat: *config.MustNewDuration(time.Hour), + tokenPriceDeviationPPB: 20e7, + latestGasPrice: map[uint64]update{ + defaultSourceChainSelector: { + timestamp: time.Now().Add(-30 * time.Minute), // recent + value: val1e18(10), // median deviates + }, + }, + f: 1, + expGasUpdates: nil, + }, + { + name: "gas price update included, the latest is similar but was not updated recently", + commitObservations: []ccip.CommitObservation{ + {SourceGasPriceUSDPerChain: map[uint64]*big.Int{defaultSourceChainSelector: val1e18(10)}}, + {SourceGasPriceUSDPerChain: map[uint64]*big.Int{defaultSourceChainSelector: val1e18(11)}}, + }, + gasPriceHeartBeat: *config.MustNewDuration(time.Hour), + daGasPriceDeviationPPB: 20e7, + execGasPriceDeviationPPB: 20e7, + tokenPriceHeartBeat: *config.MustNewDuration(time.Hour), + tokenPriceDeviationPPB: 20e7, + latestGasPrice: map[uint64]update{ + defaultSourceChainSelector: { + timestamp: time.Now().Add(-90 * time.Minute), // stale + value: val1e18(9), // median deviates + }, + }, + f: 1, + expGasUpdates: []cciptypes.GasPrice{{DestChainSelector: defaultSourceChainSelector, Value: val1e18(11)}}, + }, + { + name: "gas price update deviates from latest", + commitObservations: []ccip.CommitObservation{ + {SourceGasPriceUSDPerChain: map[uint64]*big.Int{defaultSourceChainSelector: val1e18(10)}}, + {SourceGasPriceUSDPerChain: map[uint64]*big.Int{defaultSourceChainSelector: val1e18(20)}}, + {SourceGasPriceUSDPerChain: map[uint64]*big.Int{defaultSourceChainSelector: val1e18(20)}}, + }, + gasPriceHeartBeat: *config.MustNewDuration(time.Hour), + daGasPriceDeviationPPB: 20e7, + execGasPriceDeviationPPB: 20e7, + tokenPriceHeartBeat: *config.MustNewDuration(time.Hour), + tokenPriceDeviationPPB: 20e7, + latestGasPrice: map[uint64]update{ + defaultSourceChainSelector: { + timestamp: time.Now().Add(-30 * time.Minute), // recent + value: val1e18(11), // latest value close to the update + }, + }, + f: 2, + expGasUpdates: []cciptypes.GasPrice{{DestChainSelector: defaultSourceChainSelector, Value: val1e18(20)}}, + }, + { + name: "multichain gas prices", + commitObservations: []ccip.CommitObservation{ + {SourceGasPriceUSDPerChain: map[uint64]*big.Int{defaultSourceChainSelector: val1e18(1)}}, + {SourceGasPriceUSDPerChain: map[uint64]*big.Int{defaultSourceChainSelector + 1: val1e18(11)}}, + {SourceGasPriceUSDPerChain: map[uint64]*big.Int{defaultSourceChainSelector + 2: val1e18(111)}}, + {SourceGasPriceUSDPerChain: map[uint64]*big.Int{defaultSourceChainSelector: val1e18(2)}}, + {SourceGasPriceUSDPerChain: map[uint64]*big.Int{defaultSourceChainSelector + 1: val1e18(22)}}, + {SourceGasPriceUSDPerChain: map[uint64]*big.Int{defaultSourceChainSelector + 2: val1e18(222)}}, + {SourceGasPriceUSDPerChain: map[uint64]*big.Int{defaultSourceChainSelector: val1e18(3)}}, + {SourceGasPriceUSDPerChain: map[uint64]*big.Int{defaultSourceChainSelector + 1: val1e18(33)}}, + {SourceGasPriceUSDPerChain: map[uint64]*big.Int{defaultSourceChainSelector + 2: val1e18(333)}}, + }, + gasPriceHeartBeat: *config.MustNewDuration(time.Hour), + daGasPriceDeviationPPB: 20e7, + execGasPriceDeviationPPB: 20e7, + tokenPriceHeartBeat: *config.MustNewDuration(time.Hour), + tokenPriceDeviationPPB: 20e7, + latestGasPrice: map[uint64]update{ + defaultSourceChainSelector: { + timestamp: time.Now().Add(-90 * time.Minute), // stale + value: val1e18(9), // median deviates + }, + defaultSourceChainSelector + 1: { + timestamp: time.Now().Add(-30 * time.Minute), // recent + value: val1e18(20), // median does not deviate + }, + }, + f: 1, + expGasUpdates: []cciptypes.GasPrice{ + {DestChainSelector: defaultSourceChainSelector, Value: val1e18(2)}, + {DestChainSelector: defaultSourceChainSelector + 2, Value: val1e18(222)}, + }, + }, + { + name: "median one token", + commitObservations: []ccip.CommitObservation{ + { + TokenPricesUSD: map[cciptypes.Address]*big.Int{feeToken1: big.NewInt(10)}, + SourceGasPriceUSDPerChain: map[uint64]*big.Int{defaultSourceChainSelector: val1e18(0)}, + }, + { + TokenPricesUSD: map[cciptypes.Address]*big.Int{feeToken1: big.NewInt(12)}, + SourceGasPriceUSDPerChain: map[uint64]*big.Int{defaultSourceChainSelector: val1e18(0)}, + }, + }, + f: 1, + expTokenUpdates: []cciptypes.TokenPrice{ + {Token: feeToken1, Value: big.NewInt(12)}, + }, + // We expect a gas update because no latest + expGasUpdates: []cciptypes.GasPrice{{DestChainSelector: defaultSourceChainSelector, Value: big.NewInt(0)}}, + }, + { + name: "median two tokens", + commitObservations: []ccip.CommitObservation{ + { + TokenPricesUSD: map[cciptypes.Address]*big.Int{feeToken1: big.NewInt(10), feeToken2: big.NewInt(13)}, + SourceGasPriceUSDPerChain: map[uint64]*big.Int{defaultSourceChainSelector: val1e18(0)}, + }, + { + TokenPricesUSD: map[cciptypes.Address]*big.Int{feeToken1: big.NewInt(12), feeToken2: big.NewInt(7)}, + SourceGasPriceUSDPerChain: map[uint64]*big.Int{defaultSourceChainSelector: val1e18(0)}, + }, + }, + f: 1, + expTokenUpdates: []cciptypes.TokenPrice{ + {Token: feeToken1, Value: big.NewInt(12)}, + {Token: feeToken2, Value: big.NewInt(13)}, + }, + // We expect a gas update because no latest + expGasUpdates: []cciptypes.GasPrice{{DestChainSelector: defaultSourceChainSelector, Value: big.NewInt(0)}}, + }, + { + name: "token price update skipped because it is close to the latest", + commitObservations: []ccip.CommitObservation{ + { + TokenPricesUSD: map[cciptypes.Address]*big.Int{feeToken1: val1e18(11)}, + SourceGasPriceUSDPerChain: map[uint64]*big.Int{defaultSourceChainSelector: val1e18(0)}, + }, + { + TokenPricesUSD: map[cciptypes.Address]*big.Int{feeToken1: val1e18(12)}, + SourceGasPriceUSDPerChain: map[uint64]*big.Int{defaultSourceChainSelector: val1e18(0)}, + }, + }, + f: 1, + gasPriceHeartBeat: *config.MustNewDuration(time.Hour), + daGasPriceDeviationPPB: 20e7, + execGasPriceDeviationPPB: 20e7, + tokenPriceHeartBeat: *config.MustNewDuration(time.Hour), + tokenPriceDeviationPPB: 20e7, + latestTokenPrices: map[cciptypes.Address]update{ + feeToken1: { + timestamp: time.Now().Add(-30 * time.Minute), + value: val1e18(10), + }, + }, + // We expect a gas update because no latest + expGasUpdates: []cciptypes.GasPrice{{DestChainSelector: defaultSourceChainSelector, Value: big.NewInt(0)}}, + }, + { + name: "gas price and token price both included because they are not close to the latest", + commitObservations: []ccip.CommitObservation{ + { + TokenPricesUSD: map[cciptypes.Address]*big.Int{feeToken1: val1e18(20)}, + SourceGasPriceUSDPerChain: map[uint64]*big.Int{ + defaultSourceChainSelector: val1e18(10), + defaultSourceChainSelector + 1: val1e18(20), + }, + }, + { + TokenPricesUSD: map[cciptypes.Address]*big.Int{feeToken1: val1e18(21)}, + SourceGasPriceUSDPerChain: map[uint64]*big.Int{ + defaultSourceChainSelector: val1e18(11), + defaultSourceChainSelector + 1: val1e18(21), + }, + }, + }, + f: 1, + gasPriceHeartBeat: *config.MustNewDuration(time.Hour), + daGasPriceDeviationPPB: 10e7, + execGasPriceDeviationPPB: 10e7, + tokenPriceHeartBeat: *config.MustNewDuration(time.Hour), + tokenPriceDeviationPPB: 20e7, + latestGasPrice: map[uint64]update{ + defaultSourceChainSelector: { + timestamp: time.Now().Add(-30 * time.Minute), + value: val1e18(9), + }, + defaultSourceChainSelector + 1: { + timestamp: time.Now().Add(-30 * time.Minute), + value: val1e18(9), + }, + }, + latestTokenPrices: map[cciptypes.Address]update{ + feeToken1: { + timestamp: time.Now().Add(-30 * time.Minute), + value: val1e18(9), + }, + }, + expTokenUpdates: []cciptypes.TokenPrice{ + {Token: feeToken1, Value: val1e18(21)}, + }, + expGasUpdates: []cciptypes.GasPrice{ + {DestChainSelector: defaultSourceChainSelector, Value: val1e18(11)}, + {DestChainSelector: defaultSourceChainSelector + 1, Value: val1e18(21)}, + }, + }, + { + name: "gas price and token price both included because they not been updated recently", + commitObservations: []ccip.CommitObservation{ + { + TokenPricesUSD: map[cciptypes.Address]*big.Int{feeToken1: val1e18(20)}, + SourceGasPriceUSDPerChain: map[uint64]*big.Int{ + defaultSourceChainSelector: val1e18(10), + defaultSourceChainSelector + 1: val1e18(20), + }, + }, + { + TokenPricesUSD: map[cciptypes.Address]*big.Int{feeToken1: val1e18(21)}, + SourceGasPriceUSDPerChain: map[uint64]*big.Int{ + defaultSourceChainSelector: val1e18(11), + defaultSourceChainSelector + 1: val1e18(21), + }, + }, + }, + f: 1, + gasPriceHeartBeat: *config.MustNewDuration(time.Hour), + daGasPriceDeviationPPB: 10e7, + execGasPriceDeviationPPB: 10e7, + tokenPriceHeartBeat: *config.MustNewDuration(2 * time.Hour), + tokenPriceDeviationPPB: 20e7, + latestGasPrice: map[uint64]update{ + defaultSourceChainSelector: { + timestamp: time.Now().Add(-90 * time.Minute), + value: val1e18(11), + }, + defaultSourceChainSelector + 1: { + timestamp: time.Now().Add(-90 * time.Minute), + value: val1e18(21), + }, + }, + latestTokenPrices: map[cciptypes.Address]update{ + feeToken1: { + timestamp: time.Now().Add(-4 * time.Hour), + value: val1e18(21), + }, + }, + expTokenUpdates: []cciptypes.TokenPrice{ + {Token: feeToken1, Value: val1e18(21)}, + }, + expGasUpdates: []cciptypes.GasPrice{ + {DestChainSelector: defaultSourceChainSelector, Value: val1e18(11)}, + {DestChainSelector: defaultSourceChainSelector + 1, Value: val1e18(21)}, + }, + }, + { + name: "gas price included because it deviates from latest and token price skipped because it does not deviate", + commitObservations: []ccip.CommitObservation{ + { + TokenPricesUSD: map[cciptypes.Address]*big.Int{feeToken1: val1e18(20)}, + SourceGasPriceUSDPerChain: map[uint64]*big.Int{defaultSourceChainSelector: val1e18(10)}, + }, + { + TokenPricesUSD: map[cciptypes.Address]*big.Int{feeToken1: val1e18(21)}, + SourceGasPriceUSDPerChain: map[uint64]*big.Int{defaultSourceChainSelector: val1e18(11)}, + }, + }, + f: 1, + gasPriceHeartBeat: *config.MustNewDuration(time.Hour), + daGasPriceDeviationPPB: 10e7, + execGasPriceDeviationPPB: 10e7, + tokenPriceHeartBeat: *config.MustNewDuration(2 * time.Hour), + tokenPriceDeviationPPB: 200e7, + latestGasPrice: map[uint64]update{ + defaultSourceChainSelector: { + timestamp: time.Now().Add(-90 * time.Minute), + value: val1e18(9), + }, + }, + latestTokenPrices: map[cciptypes.Address]update{ + feeToken1: { + timestamp: time.Now().Add(-30 * time.Minute), + value: val1e18(9), + }, + }, + expGasUpdates: []cciptypes.GasPrice{{DestChainSelector: defaultSourceChainSelector, Value: val1e18(11)}}, + }, + { + name: "gas price skipped because it does not deviate and token price included because it has not been updated recently", + commitObservations: []ccip.CommitObservation{ + { + TokenPricesUSD: map[cciptypes.Address]*big.Int{feeToken1: val1e18(20)}, + SourceGasPriceUSDPerChain: map[uint64]*big.Int{defaultSourceChainSelector: val1e18(10)}, + }, + { + TokenPricesUSD: map[cciptypes.Address]*big.Int{feeToken1: val1e18(21)}, + SourceGasPriceUSDPerChain: map[uint64]*big.Int{defaultSourceChainSelector: val1e18(11)}, + }, + }, + f: 1, + gasPriceHeartBeat: *config.MustNewDuration(time.Hour), + daGasPriceDeviationPPB: 10e7, + execGasPriceDeviationPPB: 10e7, + tokenPriceHeartBeat: *config.MustNewDuration(2 * time.Hour), + tokenPriceDeviationPPB: 20e7, + latestGasPrice: map[uint64]update{ + defaultSourceChainSelector: { + timestamp: time.Now().Add(-30 * time.Minute), + value: val1e18(11), + }, + }, + latestTokenPrices: map[cciptypes.Address]update{ + feeToken1: { + timestamp: time.Now().Add(-4 * time.Hour), + value: val1e18(21), + }, + }, + expTokenUpdates: []cciptypes.TokenPrice{ + {Token: feeToken1, Value: val1e18(21)}, + }, + expGasUpdates: nil, + }, + } + + evmEstimator := mocks.NewEvmFeeEstimator(t) + evmEstimator.On("L1Oracle").Return(nil) + estimatorCSVer, _ := semver.NewVersion("1.2.0") + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + estimator, _ := prices.NewGasPriceEstimatorForCommitPlugin( + *estimatorCSVer, + evmEstimator, + nil, + tc.daGasPriceDeviationPPB, + tc.execGasPriceDeviationPPB, + ) + + r := &CommitReportingPlugin{ + lggr: logger.TestLogger(t), + sourceChainSelector: defaultSourceChainSelector, + offchainConfig: cciptypes.CommitOffchainConfig{ + GasPriceHeartBeat: tc.gasPriceHeartBeat.Duration(), + TokenPriceHeartBeat: tc.tokenPriceHeartBeat.Duration(), + TokenPriceDeviationPPB: tc.tokenPriceDeviationPPB, + }, + gasPriceEstimator: estimator, + F: tc.f, + } + + gasPriceObs := make(map[uint64][]*big.Int) + tokenPriceObs := make(map[cciptypes.Address][]*big.Int) + for _, obs := range tc.commitObservations { + for selector, price := range obs.SourceGasPriceUSDPerChain { + gasPriceObs[selector] = append(gasPriceObs[selector], price) + } + for token, price := range obs.TokenPricesUSD { + tokenPriceObs[token] = append(tokenPriceObs[token], price) + } + } + + gotGas, gotTokens, err := r.calculatePriceUpdates(gasPriceObs, tokenPriceObs, tc.latestGasPrice, tc.latestTokenPrices) + + assert.Equal(t, tc.expGasUpdates, gotGas) + assert.Equal(t, tc.expTokenUpdates, gotTokens) + assert.NoError(t, err) + }) + } +} + +func TestCommitReportingPlugin_isStaleReport(t *testing.T) { + ctx := context.Background() + lggr := logger.TestLogger(t) + merkleRoot1 := utils.Keccak256Fixed([]byte("some merkle root 1")) + + t.Run("empty report", func(t *testing.T) { + commitStoreReader := ccipdatamocks.NewCommitStoreReader(t) + r := &CommitReportingPlugin{commitStoreReader: commitStoreReader} + isStale := r.isStaleReport(ctx, lggr, cciptypes.CommitStoreReport{}, types.ReportTimestamp{}) + assert.True(t, isStale) + }) + + t.Run("merkle root", func(t *testing.T) { + const expNextSeqNum = uint64(9) + commitStoreReader := ccipdatamocks.NewCommitStoreReader(t) + commitStoreReader.On("GetExpectedNextSequenceNumber", mock.Anything).Return(expNextSeqNum, nil) + + r := &CommitReportingPlugin{ + commitStoreReader: commitStoreReader, + } + + testCases := map[string]struct { + interval cciptypes.CommitStoreInterval + result bool + }{ + "The nextSeqNumber is equal to the commit store interval Min value": { + interval: cciptypes.CommitStoreInterval{Min: expNextSeqNum, Max: expNextSeqNum + 10}, + result: false, + }, + "The nextSeqNumber is less than the commit store interval Min value": { + interval: cciptypes.CommitStoreInterval{Min: expNextSeqNum + 1, Max: expNextSeqNum + 10}, + result: true, + }, + "The nextSeqNumber is greater than the commit store interval Min value": { + interval: cciptypes.CommitStoreInterval{Min: expNextSeqNum - 1, Max: expNextSeqNum + 10}, + result: true, + }, + "Empty interval": { + interval: cciptypes.CommitStoreInterval{}, + result: true, + }, + } + + for tcName, tc := range testCases { + t.Run(tcName, func(t *testing.T) { + assert.Equal(t, tc.result, r.isStaleReport(ctx, lggr, cciptypes.CommitStoreReport{ + MerkleRoot: merkleRoot1, + Interval: tc.interval, + }, types.ReportTimestamp{})) + }) + } + }) +} + +func TestCommitReportingPlugin_calculateMinMaxSequenceNumbers(t *testing.T) { + testCases := []struct { + name string + commitStoreSeqNum uint64 + msgSeqNums []uint64 + + expQueryMin uint64 // starting seq num that is used in the query to get messages + expMin uint64 + expMax uint64 + expErr bool + }{ + { + name: "happy flow", + commitStoreSeqNum: 9, + msgSeqNums: []uint64{11, 12, 13, 14}, + expQueryMin: 9, + expMin: 11, + expMax: 14, + expErr: false, + }, + { + name: "happy flow 2", + commitStoreSeqNum: 9, + msgSeqNums: []uint64{11, 12, 13, 14}, + expQueryMin: 9, // from commit store + expMin: 11, + expMax: 14, + expErr: false, + }, + { + name: "gap in msg seq nums", + commitStoreSeqNum: 10, + expQueryMin: 10, + msgSeqNums: []uint64{11, 12, 14}, + expErr: true, + }, + { + name: "no new messages", + commitStoreSeqNum: 9, + msgSeqNums: []uint64{}, + expQueryMin: 9, + expMin: 0, + expMax: 0, + expErr: false, + }, + { + name: "unordered seq nums", + commitStoreSeqNum: 9, + msgSeqNums: []uint64{11, 13, 14, 10}, + expQueryMin: 9, + expErr: true, + }, + } + + ctx := testutils.Context(t) + lggr := logger.TestLogger(t) + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + p := &CommitReportingPlugin{} + commitStoreReader := ccipdatamocks.NewCommitStoreReader(t) + commitStoreReader.On("GetExpectedNextSequenceNumber", mock.Anything).Return(tc.commitStoreSeqNum, nil) + p.commitStoreReader = commitStoreReader + + onRampReader := ccipdatamocks.NewOnRampReader(t) + var sendReqs []cciptypes.EVM2EVMMessageWithTxMeta + for _, seqNum := range tc.msgSeqNums { + sendReqs = append(sendReqs, cciptypes.EVM2EVMMessageWithTxMeta{ + EVM2EVMMessage: cciptypes.EVM2EVMMessage{ + SequenceNumber: seqNum, + }, + }) + } + onRampReader.On("GetSendRequestsBetweenSeqNums", ctx, tc.expQueryMin, tc.expQueryMin+OnRampMessagesScanLimit, true).Return(sendReqs, nil) + p.onRampReader = onRampReader + + minSeqNum, maxSeqNum, _, err := p.calculateMinMaxSequenceNumbers(ctx, lggr) + if tc.expErr { + assert.Error(t, err) + return + } + + assert.Equal(t, tc.expMin, minSeqNum) + assert.Equal(t, tc.expMax, maxSeqNum) + }) + } +} + +func TestCommitReportingPlugin_getLatestGasPriceUpdate(t *testing.T) { + now := time.Now() + chainSelector1 := uint64(1234) + chainSelector2 := uint64(5678) + + chain1Value := big.NewInt(1000) + chain2Value := big.NewInt(2000) + + testCases := []struct { + name string + priceRegistryUpdates []cciptypes.GasPriceUpdate + expUpdates map[uint64]update + expErr bool + }{ + { + name: "happy path", + priceRegistryUpdates: []cciptypes.GasPriceUpdate{ + { + GasPrice: cciptypes.GasPrice{DestChainSelector: chainSelector1, Value: chain1Value}, + TimestampUnixSec: big.NewInt(now.Unix()), + }, + }, + expUpdates: map[uint64]update{chainSelector1: {timestamp: now, value: chain1Value}}, + expErr: false, + }, + { + name: "happy path multiple updates", + priceRegistryUpdates: []cciptypes.GasPriceUpdate{ + { + GasPrice: cciptypes.GasPrice{DestChainSelector: chainSelector1, Value: big.NewInt(1)}, + TimestampUnixSec: big.NewInt(now.Unix()), + }, + { + GasPrice: cciptypes.GasPrice{DestChainSelector: chainSelector2, Value: big.NewInt(1)}, + TimestampUnixSec: big.NewInt(now.Add(1 * time.Minute).Unix()), + }, + { + GasPrice: cciptypes.GasPrice{DestChainSelector: chainSelector2, Value: chain2Value}, + TimestampUnixSec: big.NewInt(now.Add(2 * time.Minute).Unix()), + }, + { + GasPrice: cciptypes.GasPrice{DestChainSelector: chainSelector1, Value: chain1Value}, + TimestampUnixSec: big.NewInt(now.Add(3 * time.Minute).Unix()), + }, + }, + expUpdates: map[uint64]update{ + chainSelector1: {timestamp: now.Add(3 * time.Minute), value: chain1Value}, + chainSelector2: {timestamp: now.Add(2 * time.Minute), value: chain2Value}, + }, + expErr: false, + }, + } + + ctx := testutils.Context(t) + lggr := logger.TestLogger(t) + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + p := &CommitReportingPlugin{} + p.lggr = lggr + priceReg := ccipdatamocks.NewPriceRegistryReader(t) + p.destPriceRegistryReader = priceReg + + var events []cciptypes.GasPriceUpdateWithTxMeta + for _, update := range tc.priceRegistryUpdates { + events = append(events, cciptypes.GasPriceUpdateWithTxMeta{ + GasPriceUpdate: update, + }) + } + + priceReg.On("GetAllGasPriceUpdatesCreatedAfter", ctx, mock.Anything, 0).Return(events, nil) + + gotUpdates, err := p.getLatestGasPriceUpdate(ctx, now) + if tc.expErr { + assert.Error(t, err) + return + } + assert.NoError(t, err) + assert.Equal(t, len(tc.expUpdates), len(gotUpdates)) + for selector, gotUpdate := range gotUpdates { + assert.Equal(t, tc.expUpdates[selector].timestamp.Truncate(time.Second), gotUpdate.timestamp.Truncate(time.Second)) + assert.Equal(t, tc.expUpdates[selector].value.Uint64(), gotUpdate.value.Uint64()) + } + }) + } +} + +func TestCommitReportingPlugin_getLatestTokenPriceUpdates(t *testing.T) { + now := time.Now() + tk1 := cciptypes.Address(utils.RandomAddress().String()) + tk2 := cciptypes.Address(utils.RandomAddress().String()) + + testCases := []struct { + name string + priceRegistryUpdates []cciptypes.TokenPriceUpdate + expUpdates map[cciptypes.Address]update + expErr bool + }{ + { + name: "happy path", + priceRegistryUpdates: []cciptypes.TokenPriceUpdate{ + { + TokenPrice: cciptypes.TokenPrice{ + Token: tk1, + Value: big.NewInt(1000), + }, + TimestampUnixSec: big.NewInt(now.Add(1 * time.Minute).Unix()), + }, + { + TokenPrice: cciptypes.TokenPrice{ + Token: tk2, + Value: big.NewInt(2000), + }, + TimestampUnixSec: big.NewInt(now.Add(2 * time.Minute).Unix()), + }, + }, + expUpdates: map[cciptypes.Address]update{ + tk1: {timestamp: now.Add(1 * time.Minute), value: big.NewInt(1000)}, + tk2: {timestamp: now.Add(2 * time.Minute), value: big.NewInt(2000)}, + }, + expErr: false, + }, + } + + ctx := testutils.Context(t) + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + p := &CommitReportingPlugin{} + + priceReg := ccipdatamocks.NewPriceRegistryReader(t) + p.destPriceRegistryReader = priceReg + + var events []cciptypes.TokenPriceUpdateWithTxMeta + for _, up := range tc.priceRegistryUpdates { + events = append(events, cciptypes.TokenPriceUpdateWithTxMeta{ + TokenPriceUpdate: up, + }) + } + + priceReg.On("GetTokenPriceUpdatesCreatedAfter", ctx, mock.Anything, 0).Return(events, nil) + + updates, err := p.getLatestTokenPriceUpdates(ctx, now) + if tc.expErr { + assert.Error(t, err) + return + } + assert.NoError(t, err) + assert.Equal(t, len(tc.expUpdates), len(updates)) + for k, v := range updates { + assert.Equal(t, tc.expUpdates[k].timestamp.Truncate(time.Second), v.timestamp.Truncate(time.Second)) + assert.Equal(t, tc.expUpdates[k].value.Uint64(), v.value.Uint64()) + } + }) + } +} + +func Test_commitReportSize(t *testing.T) { + testParams := gopter.DefaultTestParameters() + testParams.MinSuccessfulTests = 100 + p := gopter.NewProperties(testParams) + p.Property("bounded commit report size", prop.ForAll(func(root []byte, min, max uint64) bool { + var root32 [32]byte + copy(root32[:], root) + rep, err := encodeCommitReport(cciptypes.CommitStoreReport{ + MerkleRoot: root32, + Interval: cciptypes.CommitStoreInterval{Min: min, Max: max}, + TokenPrices: []cciptypes.TokenPrice{}, + GasPrices: []cciptypes.GasPrice{ + { + DestChainSelector: 1337, + Value: big.NewInt(2000e9), // $2000 per eth * 1gwei = 2000e9 + }, + }, + }) + require.NoError(t, err) + return len(rep) <= MaxCommitReportLength + }, gen.SliceOfN(32, gen.UInt8()), gen.UInt64(), gen.UInt64())) + p.TestingRun(t) +} + +func Test_calculateIntervalConsensus(t *testing.T) { + tests := []struct { + name string + intervals []cciptypes.CommitStoreInterval + rangeLimit uint64 + f int + wantMin uint64 + wantMax uint64 + wantErr bool + }{ + {"no obs", []cciptypes.CommitStoreInterval{{Min: 0, Max: 0}}, 0, 0, 0, 0, false}, + {"basic", []cciptypes.CommitStoreInterval{ + {Min: 9, Max: 14}, + {Min: 10, Max: 12}, + {Min: 10, Max: 14}, + }, 0, 1, 10, 14, false}, + {"min > max", []cciptypes.CommitStoreInterval{ + {Min: 9, Max: 4}, + {Min: 10, Max: 4}, + {Min: 10, Max: 6}, + }, 0, 1, 0, 0, true}, + { + "range limit", []cciptypes.CommitStoreInterval{ + {Min: 10, Max: 100}, + {Min: 1, Max: 1000}, + }, 256, 1, 10, 265, false, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + got, err := calculateIntervalConsensus(tt.intervals, tt.f, tt.rangeLimit) + if tt.wantErr { + require.Error(t, err) + } else { + require.NoError(t, err) + } + assert.Equal(t, tt.wantMin, got.Min) + assert.Equal(t, tt.wantMax, got.Max) + }) + } +} + +func TestCommitReportToEthTxMeta(t *testing.T) { + mctx := hashutil.NewKeccak() + tree, err := merklemulti.NewTree(mctx, [][32]byte{mctx.Hash([]byte{0xaa})}) + require.NoError(t, err) + + tests := []struct { + name string + min, max uint64 + expectedRange []uint64 + }{ + { + "happy flow", + 1, 10, + []uint64{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}, + }, + { + "same sequence", + 1, 1, + []uint64{1}, + }, + } + + for _, tc := range tests { + t.Run(tc.name, func(t *testing.T) { + report := cciptypes.CommitStoreReport{ + TokenPrices: []cciptypes.TokenPrice{}, + GasPrices: []cciptypes.GasPrice{ + { + DestChainSelector: uint64(1337), + Value: big.NewInt(2000e9), // $2000 per eth * 1gwei = 2000e9 + }, + }, + MerkleRoot: tree.Root(), + Interval: cciptypes.CommitStoreInterval{Min: tc.min, Max: tc.max}, + } + out, err := encodeCommitReport(report) + require.NoError(t, err) + + fn, err := factory.CommitReportToEthTxMeta(ccipconfig.CommitStore, *semver.MustParse("1.0.0")) + require.NoError(t, err) + txMeta, err := fn(out) + require.NoError(t, err) + require.NotNil(t, txMeta) + require.EqualValues(t, tc.expectedRange, txMeta.SeqNumbers) + }) + } +} + +// TODO should be removed, tests need to be updated to use the Reader interface. +// encodeCommitReport is only used in tests +func encodeCommitReport(report cciptypes.CommitStoreReport) ([]byte, error) { + commitStoreABI := abihelpers.MustParseABI(commit_store.CommitStoreABI) + return v1_2_0.EncodeCommitReport(abihelpers.MustGetEventInputs(v1_0_0.ReportAccepted, commitStoreABI), report) +} diff --git a/core/services/ocr2/plugins/ccip/ccipexec/batching.go b/core/services/ocr2/plugins/ccip/ccipexec/batching.go new file mode 100644 index 00000000000..b457dd986d4 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/ccipexec/batching.go @@ -0,0 +1,540 @@ +package ccipexec + +import ( + "context" + "fmt" + "math/big" + "time" + + mapset "github.com/deckarep/golang-set/v2" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/pkg/errors" + + "github.com/smartcontractkit/chainlink-common/pkg/hashutil" + "github.com/smartcontractkit/chainlink-common/pkg/merklemulti" + "github.com/smartcontractkit/chainlink-common/pkg/types" + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + + "github.com/smartcontractkit/chainlink/v2/core/logger" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/abihelpers" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/prices" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/tokendata" + "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/statuschecker" +) + +type BatchContext struct { + report commitReportWithSendRequests + inflight []InflightInternalExecutionReport + inflightAggregateValue *big.Int + lggr logger.Logger + availableDataLen int + availableGas uint64 + expectedNonces map[cciptypes.Address]uint64 + sendersNonce map[cciptypes.Address]uint64 + sourceTokenPricesUSD map[cciptypes.Address]*big.Int + destTokenPricesUSD map[cciptypes.Address]*big.Int + gasPrice *big.Int + sourceToDestToken map[cciptypes.Address]cciptypes.Address + aggregateTokenLimit *big.Int + tokenDataRemainingDuration time.Duration + tokenDataWorker tokendata.Worker + gasPriceEstimator prices.GasPriceEstimatorExec + destWrappedNative cciptypes.Address + offchainConfig cciptypes.ExecOffchainConfig +} + +type BatchingStrategy interface { + BuildBatch(ctx context.Context, batchCtx *BatchContext) ([]ccip.ObservedMessage, []messageExecStatus) +} + +type BestEffortBatchingStrategy struct{} + +type ZKOverflowBatchingStrategy struct { + statuschecker statuschecker.CCIPTransactionStatusChecker +} + +func NewBatchingStrategy(batchingStrategyID uint32, statusChecker statuschecker.CCIPTransactionStatusChecker) (BatchingStrategy, error) { + var batchingStrategy BatchingStrategy + switch batchingStrategyID { + case 0: + batchingStrategy = &BestEffortBatchingStrategy{} + case 1: + batchingStrategy = &ZKOverflowBatchingStrategy{ + statuschecker: statusChecker, + } + default: + return nil, errors.Errorf("unknown batching strategy ID %d", batchingStrategyID) + } + return batchingStrategy, nil +} + +// BestEffortBatchingStrategy is a batching strategy that tries to batch as many messages as possible (up to certain limits). +func (s *BestEffortBatchingStrategy) BuildBatch( + ctx context.Context, + batchCtx *BatchContext, +) ([]ccip.ObservedMessage, []messageExecStatus) { + batchBuilder := newBatchBuildContainer(len(batchCtx.report.sendRequestsWithMeta)) + for _, msg := range batchCtx.report.sendRequestsWithMeta { + msgLggr := batchCtx.lggr.With("messageID", hexutil.Encode(msg.MessageID[:]), "seqNr", msg.SequenceNumber) + status, messageMaxGas, tokenData, msgValue, err := performCommonChecks(ctx, batchCtx, msg, msgLggr) + + if err != nil { + return []ccip.ObservedMessage{}, []messageExecStatus{} + } + + if status.shouldBeSkipped() { + batchBuilder.skip(msg, status) + continue + } + + updateBatchContext(batchCtx, msg, messageMaxGas, msgValue, msgLggr) + batchBuilder.addToBatch(msg, tokenData) + } + return batchBuilder.batch, batchBuilder.statuses +} + +// ZKOverflowBatchingStrategy is a batching strategy for ZK chains overflowing under certain conditions. +// It is a simple batching strategy that only allows one message to be added to the batch. +// TXM is used to perform the ZK check: if the message failed the check, it will be skipped. +func (bs ZKOverflowBatchingStrategy) BuildBatch( + ctx context.Context, + batchCtx *BatchContext, +) ([]ccip.ObservedMessage, []messageExecStatus) { + batchBuilder := newBatchBuildContainer(len(batchCtx.report.sendRequestsWithMeta)) + inflightSeqNums := getInflightSeqNums(batchCtx.inflight) + + for _, msg := range batchCtx.report.sendRequestsWithMeta { + msgId := hexutil.Encode(msg.MessageID[:]) + msgLggr := batchCtx.lggr.With("messageID", msgId, "seqNr", msg.SequenceNumber) + + // Check if msg is inflight + if exists := inflightSeqNums.Contains(msg.SequenceNumber); exists { + // Message is inflight, skip it + msgLggr.Infow("Skipping message - already inflight", "message", msgId) + batchBuilder.skip(msg, SkippedInflight) + continue + } + // Message is not inflight, continue with checks + // Check if the messsage is overflown using TXM + statuses, count, err := bs.statuschecker.CheckMessageStatus(ctx, msgId) + if err != nil { + batchBuilder.skip(msg, TXMCheckError) + continue + } + + msgLggr.Infow("TXM check result", "statuses", statuses, "count", count) + + if len(statuses) == 0 { + // No status found for message = first time we see it + msgLggr.Infow("No status found for message - proceeding with checks", "message", msgId) + } else { + // Status(es) found for message = check if any of them is final to decide if we should add it to the batch + hasFatalStatus := false + for _, s := range statuses { + if s == types.Fatal { + msgLggr.Infow("Skipping message - found a fatal TXM status", "message", msgId) + batchBuilder.skip(msg, TXMFatalStatus) + hasFatalStatus = true + break + } + } + if hasFatalStatus { + continue + } + msgLggr.Infow("No fatal status found for message - proceeding with checks", "message", msgId) + } + + status, messageMaxGas, tokenData, msgValue, err := performCommonChecks(ctx, batchCtx, msg, msgLggr) + + if err != nil { + return []ccip.ObservedMessage{}, []messageExecStatus{} + } + + if status.shouldBeSkipped() { + batchBuilder.skip(msg, status) + continue + } + + updateBatchContext(batchCtx, msg, messageMaxGas, msgValue, msgLggr) + msgLggr.Infow("Adding message to batch", "message", msgId) + batchBuilder.addToBatch(msg, tokenData) + + // Batch size is limited to 1 for ZK Overflow chains + break + } + return batchBuilder.batch, batchBuilder.statuses +} + +func performCommonChecks( + ctx context.Context, + batchCtx *BatchContext, + msg cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta, + msgLggr logger.Logger, +) (messageStatus, uint64, [][]byte, *big.Int, error) { + if msg.Executed { + msgLggr.Infow("Skipping message - already executed") + return AlreadyExecuted, 0, nil, nil, nil + } + + if len(msg.Data) > batchCtx.availableDataLen { + msgLggr.Infow("Skipping message - insufficient remaining batch data length", "msgDataLen", len(msg.Data), "availableBatchDataLen", batchCtx.availableDataLen) + return InsufficientRemainingBatchDataLength, 0, nil, nil, nil + } + + messageMaxGas, err1 := calculateMessageMaxGas( + msg.GasLimit, + len(batchCtx.report.sendRequestsWithMeta), + len(msg.Data), + len(msg.TokenAmounts), + ) + if err1 != nil { + msgLggr.Errorw("Skipping message - message max gas calculation error", "err", err1) + return MessageMaxGasCalcError, 0, nil, nil, nil + } + + // Check sufficient gas in batch + if batchCtx.availableGas < messageMaxGas { + msgLggr.Infow("Skipping message - insufficient remaining batch gas limit", "availableGas", batchCtx.availableGas, "messageMaxGas", messageMaxGas) + return InsufficientRemainingBatchGas, 0, nil, nil, nil + } + + if _, ok := batchCtx.expectedNonces[msg.Sender]; !ok { + nonce, ok1 := batchCtx.sendersNonce[msg.Sender] + if !ok1 { + msgLggr.Errorw("Skipping message - missing nonce", "sender", msg.Sender) + return MissingNonce, 0, nil, nil, nil + } + batchCtx.expectedNonces[msg.Sender] = nonce + 1 + } + + // Check expected nonce is valid for sequenced messages. + // Sequenced messages have non-zero nonces. + if msg.Nonce > 0 && msg.Nonce != batchCtx.expectedNonces[msg.Sender] { + msgLggr.Warnw("Skipping message - invalid nonce", "have", msg.Nonce, "want", batchCtx.expectedNonces[msg.Sender]) + return InvalidNonce, 0, nil, nil, nil + } + + msgValue, err1 := aggregateTokenValue(batchCtx.lggr, batchCtx.destTokenPricesUSD, batchCtx.sourceToDestToken, msg.TokenAmounts) + if err1 != nil { + msgLggr.Errorw("Skipping message - aggregate token value compute error", "err", err1) + return AggregateTokenValueComputeError, 0, nil, nil, nil + } + + // if token limit is smaller than message value skip message + if tokensLeft, hasCapacity := hasEnoughTokens(batchCtx.aggregateTokenLimit, msgValue, batchCtx.inflightAggregateValue); !hasCapacity { + msgLggr.Warnw("Skipping message - aggregate token limit exceeded", "aggregateTokenLimit", tokensLeft.String(), "msgValue", msgValue.String()) + return AggregateTokenLimitExceeded, 0, nil, nil, nil + } + + tokenData, elapsed, err1 := getTokenDataWithTimeout(ctx, msg, batchCtx.tokenDataRemainingDuration, batchCtx.tokenDataWorker) + batchCtx.tokenDataRemainingDuration -= elapsed + if err1 != nil { + if errors.Is(err1, tokendata.ErrNotReady) { + msgLggr.Warnw("Skipping message - token data not ready", "err", err1) + return TokenDataNotReady, 0, nil, nil, nil + } + msgLggr.Errorw("Skipping message - token data fetch error", "err", err1) + return TokenDataFetchError, 0, nil, nil, nil + } + + dstWrappedNativePrice, exists := batchCtx.destTokenPricesUSD[batchCtx.destWrappedNative] + if !exists { + msgLggr.Errorw("Skipping message - token not in destination token prices", "token", batchCtx.destWrappedNative) + return TokenNotInDestTokenPrices, 0, nil, nil, nil + } + + // calculating the source chain fee, dividing by 1e18 for denomination. + // For example: + // FeeToken=link; FeeTokenAmount=1e17 i.e. 0.1 link, price is 6e18 USD/link (1 USD = 1e18), + // availableFee is 1e17*6e18/1e18 = 6e17 = 0.6 USD + sourceFeeTokenPrice, exists := batchCtx.sourceTokenPricesUSD[msg.FeeToken] + if !exists { + msgLggr.Errorw("Skipping message - token not in source token prices", "token", msg.FeeToken) + return TokenNotInSrcTokenPrices, 0, nil, nil, nil + } + + // Fee boosting + execCostUsd, err1 := batchCtx.gasPriceEstimator.EstimateMsgCostUSD(batchCtx.gasPrice, dstWrappedNativePrice, msg) + if err1 != nil { + msgLggr.Errorw("Failed to estimate message cost USD", "err", err1) + return "", 0, nil, nil, errors.New("failed to estimate message cost USD") + } + + availableFee := big.NewInt(0).Mul(msg.FeeTokenAmount, sourceFeeTokenPrice) + availableFee = availableFee.Div(availableFee, big.NewInt(1e18)) + availableFeeUsd := waitBoostedFee(time.Since(msg.BlockTimestamp), availableFee, batchCtx.offchainConfig.RelativeBoostPerWaitHour) + if availableFeeUsd.Cmp(execCostUsd) < 0 { + msgLggr.Infow( + "Skipping message - insufficient remaining fee", + "availableFeeUsd", availableFeeUsd, + "execCostUsd", execCostUsd, + "sourceBlockTimestamp", msg.BlockTimestamp, + "waitTime", time.Since(msg.BlockTimestamp), + "boost", batchCtx.offchainConfig.RelativeBoostPerWaitHour, + ) + return InsufficientRemainingFee, 0, nil, nil, nil + } + + return SuccesfullyValidated, messageMaxGas, tokenData, msgValue, nil +} + +// getTokenDataWithCappedLatency gets the token data for the provided message. +// Stops and returns an error if more than allowedWaitingTime is passed. +func getTokenDataWithTimeout( + ctx context.Context, + msg cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta, + timeout time.Duration, + tokenDataWorker tokendata.Worker, +) ([][]byte, time.Duration, error) { + if len(msg.TokenAmounts) == 0 { + return nil, 0, nil + } + + ctxTimeout, cf := context.WithTimeout(ctx, timeout) + defer cf() + tStart := time.Now() + tokenData, err := tokenDataWorker.GetMsgTokenData(ctxTimeout, msg) + tDur := time.Since(tStart) + return tokenData, tDur, err +} + +func getProofData( + ctx context.Context, + sourceReader ccipdata.OnRampReader, + interval cciptypes.CommitStoreInterval, +) (sendReqsInRoot []cciptypes.EVM2EVMMessageWithTxMeta, leaves [][32]byte, tree *merklemulti.Tree[[32]byte], err error) { + // We don't need to double-check if logs are finalized because we already checked that in the Commit phase. + sendReqs, err := sourceReader.GetSendRequestsBetweenSeqNums(ctx, interval.Min, interval.Max, false) + if err != nil { + return nil, nil, nil, err + } + + if err1 := validateSendRequests(sendReqs, interval); err1 != nil { + return nil, nil, nil, err1 + } + + leaves = make([][32]byte, 0, len(sendReqs)) + for _, req := range sendReqs { + leaves = append(leaves, req.Hash) + } + tree, err = merklemulti.NewTree(hashutil.NewKeccak(), leaves) + if err != nil { + return nil, nil, nil, err + } + return sendReqs, leaves, tree, nil +} + +func validateSendRequests(sendReqs []cciptypes.EVM2EVMMessageWithTxMeta, interval cciptypes.CommitStoreInterval) error { + if len(sendReqs) == 0 { + return fmt.Errorf("could not find any requests in the provided interval %v", interval) + } + + gotInterval := cciptypes.CommitStoreInterval{ + Min: sendReqs[0].SequenceNumber, + Max: sendReqs[0].SequenceNumber, + } + + for _, req := range sendReqs[1:] { + if req.SequenceNumber < gotInterval.Min { + gotInterval.Min = req.SequenceNumber + } + if req.SequenceNumber > gotInterval.Max { + gotInterval.Max = req.SequenceNumber + } + } + + if (gotInterval.Min != interval.Min) || (gotInterval.Max != interval.Max) { + return fmt.Errorf("interval %v is not the expected %v", gotInterval, interval) + } + return nil +} + +func getInflightSeqNums(inflight []InflightInternalExecutionReport) mapset.Set[uint64] { + seqNums := mapset.NewSet[uint64]() + for _, report := range inflight { + for _, msg := range report.messages { + seqNums.Add(msg.SequenceNumber) + } + } + return seqNums +} + +func aggregateTokenValue(lggr logger.Logger, destTokenPricesUSD map[cciptypes.Address]*big.Int, sourceToDest map[cciptypes.Address]cciptypes.Address, tokensAndAmount []cciptypes.TokenAmount) (*big.Int, error) { + sum := big.NewInt(0) + for i := 0; i < len(tokensAndAmount); i++ { + price, ok := destTokenPricesUSD[sourceToDest[tokensAndAmount[i].Token]] + if !ok { + // If we don't have a price for the token, we will assume it's worth 0. + lggr.Infof("No price for token %s, assuming 0", tokensAndAmount[i].Token) + continue + } + sum.Add(sum, new(big.Int).Quo(new(big.Int).Mul(price, tokensAndAmount[i].Amount), big.NewInt(1e18))) + } + return sum, nil +} + +func updateBatchContext( + batchCtx *BatchContext, + msg cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta, + messageMaxGas uint64, + msgValue *big.Int, + msgLggr logger.Logger) { + batchCtx.availableGas -= messageMaxGas + batchCtx.availableDataLen -= len(msg.Data) + batchCtx.aggregateTokenLimit.Sub(batchCtx.aggregateTokenLimit, msgValue) + if msg.Nonce > 0 { + batchCtx.expectedNonces[msg.Sender] = msg.Nonce + 1 + } + + msgLggr.Infow( + "Message successfully added to execution batch", + "nonce", msg.Nonce, + "sender", msg.Sender, + "value", msgValue, + "availableAggrTokenLimit", batchCtx.aggregateTokenLimit, + "availableGas", batchCtx.availableGas, + "availableDataLen", batchCtx.availableDataLen, + ) +} + +func hasEnoughTokens(tokenLimit *big.Int, msgValue *big.Int, inflightValue *big.Int) (*big.Int, bool) { + tokensLeft := big.NewInt(0).Sub(tokenLimit, inflightValue) + return tokensLeft, tokensLeft.Cmp(msgValue) >= 0 +} + +func buildExecutionReportForMessages( + msgsInRoot []cciptypes.EVM2EVMMessageWithTxMeta, + tree *merklemulti.Tree[[32]byte], + commitInterval cciptypes.CommitStoreInterval, + observedMessages []ccip.ObservedMessage, +) (cciptypes.ExecReport, error) { + innerIdxs := make([]int, 0, len(observedMessages)) + var messages []cciptypes.EVM2EVMMessage + var offchainTokenData [][][]byte + for _, observedMessage := range observedMessages { + if observedMessage.SeqNr < commitInterval.Min || observedMessage.SeqNr > commitInterval.Max { + // We only return messages from a single root (the root of the first message). + continue + } + innerIdx := int(observedMessage.SeqNr - commitInterval.Min) + if innerIdx >= len(msgsInRoot) || innerIdx < 0 { + return cciptypes.ExecReport{}, fmt.Errorf("invalid inneridx SeqNr=%d IntervalMin=%d msgsInRoot=%d", + observedMessage.SeqNr, commitInterval.Min, len(msgsInRoot)) + } + messages = append(messages, msgsInRoot[innerIdx].EVM2EVMMessage) + offchainTokenData = append(offchainTokenData, observedMessage.TokenData) + innerIdxs = append(innerIdxs, innerIdx) + } + + merkleProof, err := tree.Prove(innerIdxs) + if err != nil { + return cciptypes.ExecReport{}, err + } + + // any capped proof will have length <= this one, so we reuse it to avoid proving inside loop, and update later if changed + return cciptypes.ExecReport{ + Messages: messages, + Proofs: merkleProof.Hashes, + ProofFlagBits: abihelpers.ProofFlagsToBits(merkleProof.SourceFlags), + OffchainTokenData: offchainTokenData, + }, nil +} + +// Validates the given message observations do not exceed the committed sequence numbers +// in the commitStoreReader. +func validateSeqNumbers(serviceCtx context.Context, commitStore ccipdata.CommitStoreReader, observedMessages []ccip.ObservedMessage) error { + nextMin, err := commitStore.GetExpectedNextSequenceNumber(serviceCtx) + if err != nil { + return err + } + // observedMessages are always sorted by SeqNr and never empty, so it's safe to take last element + maxSeqNumInBatch := observedMessages[len(observedMessages)-1].SeqNr + + if maxSeqNumInBatch >= nextMin { + return errors.Errorf("Cannot execute uncommitted seq num. nextMin %v, seqNums %v", nextMin, observedMessages) + } + return nil +} + +// Gets the commit report from the saved logs for a given sequence number. +func getCommitReportForSeqNum(ctx context.Context, commitStoreReader ccipdata.CommitStoreReader, seqNum uint64) (cciptypes.CommitStoreReport, error) { + acceptedReports, err := commitStoreReader.GetCommitReportMatchingSeqNum(ctx, seqNum, 0) + if err != nil { + return cciptypes.CommitStoreReport{}, err + } + + if len(acceptedReports) == 0 { + return cciptypes.CommitStoreReport{}, errors.Errorf("seq number not committed") + } + + return acceptedReports[0].CommitStoreReport, nil +} + +type messageStatus string + +const ( + SuccesfullyValidated messageStatus = "successfully_validated" + AlreadyExecuted messageStatus = "already_executed" + SenderAlreadySkipped messageStatus = "sender_already_skipped" + MessageMaxGasCalcError messageStatus = "message_max_gas_calc_error" + InsufficientRemainingBatchDataLength messageStatus = "insufficient_remaining_batch_data_length" + InsufficientRemainingBatchGas messageStatus = "insufficient_remaining_batch_gas" + MissingNonce messageStatus = "missing_nonce" + InvalidNonce messageStatus = "invalid_nonce" + AggregateTokenValueComputeError messageStatus = "aggregate_token_value_compute_error" + AggregateTokenLimitExceeded messageStatus = "aggregate_token_limit_exceeded" + TokenDataNotReady messageStatus = "token_data_not_ready" + TokenDataFetchError messageStatus = "token_data_fetch_error" + TokenNotInDestTokenPrices messageStatus = "token_not_in_dest_token_prices" + TokenNotInSrcTokenPrices messageStatus = "token_not_in_src_token_prices" + InsufficientRemainingFee messageStatus = "insufficient_remaining_fee" + AddedToBatch messageStatus = "added_to_batch" + TXMCheckError messageStatus = "txm_check_error" + TXMFatalStatus messageStatus = "txm_fatal_status" + SkippedInflight messageStatus = "skipped_inflight" +) + +func (m messageStatus) shouldBeSkipped() bool { + return m != SuccesfullyValidated +} + +type messageExecStatus struct { + SeqNr uint64 + MessageId string + Status messageStatus +} + +func newMessageExecState(seqNr uint64, messageId cciptypes.Hash, status messageStatus) messageExecStatus { + return messageExecStatus{ + SeqNr: seqNr, + MessageId: hexutil.Encode(messageId[:]), + Status: status, + } +} + +type batchBuildContainer struct { + batch []ccip.ObservedMessage + statuses []messageExecStatus +} + +func newBatchBuildContainer(capacity int) *batchBuildContainer { + return &batchBuildContainer{ + batch: make([]ccip.ObservedMessage, 0, capacity), + statuses: make([]messageExecStatus, 0, capacity), + } +} + +func (m *batchBuildContainer) skip(msg cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta, status messageStatus) { + m.addState(msg, status) +} + +func (m *batchBuildContainer) addToBatch(msg cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta, tokenData [][]byte) { + m.addState(msg, AddedToBatch) + m.batch = append(m.batch, ccip.NewObservedMessage(msg.SequenceNumber, tokenData)) +} + +func (m *batchBuildContainer) addState(msg cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta, state messageStatus) { + m.statuses = append(m.statuses, newMessageExecState(msg.SequenceNumber, msg.MessageID, state)) +} diff --git a/core/services/ocr2/plugins/ccip/ccipexec/batching_test.go b/core/services/ocr2/plugins/ccip/ccipexec/batching_test.go new file mode 100644 index 00000000000..3647556a6d5 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/ccipexec/batching_test.go @@ -0,0 +1,910 @@ +package ccipexec + +import ( + "bytes" + "context" + "encoding/binary" + "math" + "math/big" + "reflect" + "testing" + "time" + + "github.com/pkg/errors" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + + "github.com/smartcontractkit/chainlink-common/pkg/types" + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" + "github.com/smartcontractkit/chainlink/v2/core/logger" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipcalc" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/prices" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/tokendata" + mockstatuschecker "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/statuschecker/mocks" +) + +type testCase struct { + name string + reqs []cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta + inflight []InflightInternalExecutionReport + tokenLimit, destGasPrice, inflightAggregateValue *big.Int + srcPrices, dstPrices map[cciptypes.Address]*big.Int + offRampNoncesBySender map[cciptypes.Address]uint64 + srcToDestTokens map[cciptypes.Address]cciptypes.Address + expectedSeqNrs []ccip.ObservedMessage + expectedStates []messageExecStatus + statuschecker func(m *mockstatuschecker.CCIPTransactionStatusChecker) + skipGasPriceEstimator bool +} + +func Test_NewBatchingStrategy(t *testing.T) { + t.Parallel() + + mockStatusChecker := mockstatuschecker.NewCCIPTransactionStatusChecker(t) + + testCases := []int{0, 1, 2} + + for _, batchingStrategyId := range testCases { + factory, err := NewBatchingStrategy(uint32(batchingStrategyId), mockStatusChecker) + if batchingStrategyId == 2 { + assert.Error(t, err) + } else { + assert.NotNil(t, factory) + assert.NoError(t, err) + } + } +} + +func Test_validateSendRequests(t *testing.T) { + testCases := []struct { + name string + seqNums []uint64 + providedInterval cciptypes.CommitStoreInterval + expErr bool + }{ + { + name: "zero interval no seq nums", + seqNums: nil, + providedInterval: cciptypes.CommitStoreInterval{Min: 0, Max: 0}, + expErr: true, + }, + { + name: "exp 1 seq num got none", + seqNums: nil, + providedInterval: cciptypes.CommitStoreInterval{Min: 1, Max: 1}, + expErr: true, + }, + { + name: "exp 10 seq num got none", + seqNums: nil, + providedInterval: cciptypes.CommitStoreInterval{Min: 1, Max: 10}, + expErr: true, + }, + { + name: "got 1 seq num as expected", + seqNums: []uint64{1}, + providedInterval: cciptypes.CommitStoreInterval{Min: 1, Max: 1}, + expErr: false, + }, + { + name: "got 5 seq num as expected", + seqNums: []uint64{11, 12, 13, 14, 15}, + providedInterval: cciptypes.CommitStoreInterval{Min: 11, Max: 15}, + expErr: false, + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + sendReqs := make([]cciptypes.EVM2EVMMessageWithTxMeta, 0, len(tc.seqNums)) + for _, seqNum := range tc.seqNums { + sendReqs = append(sendReqs, cciptypes.EVM2EVMMessageWithTxMeta{ + EVM2EVMMessage: cciptypes.EVM2EVMMessage{SequenceNumber: seqNum}, + }) + } + err := validateSendRequests(sendReqs, tc.providedInterval) + if tc.expErr { + assert.Error(t, err) + return + } + assert.NoError(t, err) + }) + } +} + +type delayedTokenDataWorker struct { + delay time.Duration + tokendata.Worker +} + +func (m delayedTokenDataWorker) GetMsgTokenData(ctx context.Context, msg cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta) ([][]byte, error) { + time.Sleep(m.delay) + return nil, ctx.Err() +} + +func TestExecutionReportingPlugin_getTokenDataWithCappedLatency(t *testing.T) { + testCases := []struct { + name string + allowedWaitingTime time.Duration + workerLatency time.Duration + expErr bool + }{ + { + name: "happy flow", + allowedWaitingTime: 10 * time.Millisecond, + workerLatency: time.Nanosecond, + expErr: false, + }, + { + name: "worker takes long to reply", + allowedWaitingTime: 10 * time.Millisecond, + workerLatency: 20 * time.Millisecond, + expErr: true, + }, + } + + ctx := testutils.Context(t) + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + tokenDataWorker := delayedTokenDataWorker{delay: tc.workerLatency} + + msg := cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta{ + EVM2EVMMessage: cciptypes.EVM2EVMMessage{TokenAmounts: make([]cciptypes.TokenAmount, 1)}, + } + + _, _, err := getTokenDataWithTimeout(ctx, msg, tc.allowedWaitingTime, tokenDataWorker) + if tc.expErr { + assert.Error(t, err) + return + } + assert.NoError(t, err) + }) + } +} + +func TestBatchingStrategies(t *testing.T) { + sender1 := ccipcalc.HexToAddress("0xa") + destNative := ccipcalc.HexToAddress("0xb") + srcNative := ccipcalc.HexToAddress("0xc") + + msg1 := createTestMessage(1, sender1, 1, srcNative, big.NewInt(1e9), false, nil) + + msg2 := msg1 + msg2.Executed = true + + msg3 := msg1 + msg3.Executed = true + msg3.Finalized = true + + msg4 := msg1 + msg4.TokenAmounts = []cciptypes.TokenAmount{ + {Token: srcNative, Amount: big.NewInt(100)}, + } + + msg5 := msg4 + msg5.SequenceNumber = msg5.SequenceNumber + 1 + msg5.Nonce = msg5.Nonce + 1 + + zkMsg1 := createTestMessage(1, sender1, 0, srcNative, big.NewInt(1e9), false, nil) + zkMsg2 := createTestMessage(2, sender1, 0, srcNative, big.NewInt(1e9), false, nil) + zkMsg3 := createTestMessage(3, sender1, 0, srcNative, big.NewInt(1e9), false, nil) + zkMsg4 := createTestMessage(4, sender1, 0, srcNative, big.NewInt(1e9), false, nil) + + testCases := []testCase{ + { + name: "single message no tokens", + reqs: []cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta{msg1}, + inflight: []InflightInternalExecutionReport{}, + inflightAggregateValue: big.NewInt(0), + tokenLimit: big.NewInt(0), + destGasPrice: big.NewInt(10), + srcPrices: map[cciptypes.Address]*big.Int{srcNative: big.NewInt(1)}, + dstPrices: map[cciptypes.Address]*big.Int{destNative: big.NewInt(1)}, + offRampNoncesBySender: map[cciptypes.Address]uint64{sender1: 0}, + expectedSeqNrs: []ccip.ObservedMessage{{SeqNr: uint64(1)}}, + expectedStates: []messageExecStatus{newMessageExecState(msg1.SequenceNumber, msg1.MessageID, AddedToBatch)}, + }, + { + name: "gasPriceEstimator returns error", + reqs: []cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta{msg1}, + inflight: []InflightInternalExecutionReport{}, + inflightAggregateValue: big.NewInt(0), + tokenLimit: big.NewInt(0), + destGasPrice: big.NewInt(10), + srcPrices: map[cciptypes.Address]*big.Int{srcNative: big.NewInt(1)}, + dstPrices: map[cciptypes.Address]*big.Int{destNative: big.NewInt(1)}, + offRampNoncesBySender: map[cciptypes.Address]uint64{sender1: 0}, + }, + { + name: "executed non finalized messages should be skipped", + reqs: []cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta{msg2}, + inflight: []InflightInternalExecutionReport{}, + inflightAggregateValue: big.NewInt(0), + tokenLimit: big.NewInt(0), + destGasPrice: big.NewInt(10), + srcPrices: map[cciptypes.Address]*big.Int{srcNative: big.NewInt(1)}, + dstPrices: map[cciptypes.Address]*big.Int{destNative: big.NewInt(1)}, + offRampNoncesBySender: map[cciptypes.Address]uint64{sender1: 0}, + expectedStates: []messageExecStatus{newMessageExecState(msg2.SequenceNumber, msg2.MessageID, AlreadyExecuted)}, + skipGasPriceEstimator: true, + }, + { + name: "finalized executed log", + reqs: []cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta{msg3}, + inflight: []InflightInternalExecutionReport{}, + inflightAggregateValue: big.NewInt(0), + tokenLimit: big.NewInt(0), + destGasPrice: big.NewInt(10), + srcPrices: map[cciptypes.Address]*big.Int{srcNative: big.NewInt(1)}, + dstPrices: map[cciptypes.Address]*big.Int{destNative: big.NewInt(1)}, + offRampNoncesBySender: map[cciptypes.Address]uint64{sender1: 0}, + expectedStates: []messageExecStatus{newMessageExecState(msg3.SequenceNumber, msg3.MessageID, AlreadyExecuted)}, + skipGasPriceEstimator: true, + }, + { + name: "dst token price does not exist", + reqs: []cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta{msg1}, + inflight: []InflightInternalExecutionReport{}, + inflightAggregateValue: big.NewInt(0), + tokenLimit: big.NewInt(0), + destGasPrice: big.NewInt(10), + srcPrices: map[cciptypes.Address]*big.Int{srcNative: big.NewInt(1)}, + dstPrices: map[cciptypes.Address]*big.Int{}, + offRampNoncesBySender: map[cciptypes.Address]uint64{sender1: 0}, + expectedStates: []messageExecStatus{newMessageExecState(msg1.SequenceNumber, msg1.MessageID, TokenNotInDestTokenPrices)}, + skipGasPriceEstimator: true, + }, + { + name: "src token price does not exist", + reqs: []cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta{msg1}, + inflight: []InflightInternalExecutionReport{}, + inflightAggregateValue: big.NewInt(0), + tokenLimit: big.NewInt(0), + destGasPrice: big.NewInt(10), + srcPrices: map[cciptypes.Address]*big.Int{}, + dstPrices: map[cciptypes.Address]*big.Int{destNative: big.NewInt(1)}, + offRampNoncesBySender: map[cciptypes.Address]uint64{sender1: 0}, + expectedStates: []messageExecStatus{newMessageExecState(msg1.SequenceNumber, msg1.MessageID, TokenNotInSrcTokenPrices)}, + skipGasPriceEstimator: true, + }, + { + name: "message with tokens is not executed if limit is reached", + reqs: []cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta{msg4}, + inflight: []InflightInternalExecutionReport{}, + inflightAggregateValue: big.NewInt(0), + tokenLimit: big.NewInt(99), + destGasPrice: big.NewInt(1), + srcPrices: map[cciptypes.Address]*big.Int{srcNative: big.NewInt(1e18)}, + dstPrices: map[cciptypes.Address]*big.Int{destNative: big.NewInt(1e18)}, + srcToDestTokens: map[cciptypes.Address]cciptypes.Address{ + srcNative: destNative, + }, + offRampNoncesBySender: map[cciptypes.Address]uint64{sender1: 0}, + expectedStates: []messageExecStatus{newMessageExecState(msg4.SequenceNumber, msg4.MessageID, AggregateTokenLimitExceeded)}, + skipGasPriceEstimator: true, + }, + { + name: "message with tokens is not executed if limit is reached when inflight is full", + reqs: []cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta{msg5}, + inflight: []InflightInternalExecutionReport{{createdAt: time.Now(), messages: []cciptypes.EVM2EVMMessage{msg4.EVM2EVMMessage}}}, + inflightAggregateValue: big.NewInt(100), + tokenLimit: big.NewInt(50), + destGasPrice: big.NewInt(10), + srcPrices: map[cciptypes.Address]*big.Int{srcNative: big.NewInt(1e18)}, + dstPrices: map[cciptypes.Address]*big.Int{destNative: big.NewInt(1e18)}, + srcToDestTokens: map[cciptypes.Address]cciptypes.Address{ + srcNative: destNative, + }, + offRampNoncesBySender: map[cciptypes.Address]uint64{sender1: 1}, + expectedStates: []messageExecStatus{newMessageExecState(msg5.SequenceNumber, msg5.MessageID, AggregateTokenLimitExceeded)}, + skipGasPriceEstimator: true, + }, + { + name: "skip when nonce doesn't match chain value", + reqs: []cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta{msg1}, + inflight: []InflightInternalExecutionReport{}, + inflightAggregateValue: big.NewInt(0), + tokenLimit: big.NewInt(0), + destGasPrice: big.NewInt(10), + srcPrices: map[cciptypes.Address]*big.Int{srcNative: big.NewInt(1)}, + dstPrices: map[cciptypes.Address]*big.Int{destNative: big.NewInt(1)}, + offRampNoncesBySender: map[cciptypes.Address]uint64{sender1: 123}, + expectedStates: []messageExecStatus{newMessageExecState(msg1.SequenceNumber, msg1.MessageID, InvalidNonce)}, + skipGasPriceEstimator: true, + }, + { + name: "skip when nonce not found", + reqs: []cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta{msg1}, + inflight: []InflightInternalExecutionReport{}, + inflightAggregateValue: big.NewInt(0), + tokenLimit: big.NewInt(0), + destGasPrice: big.NewInt(10), + srcPrices: map[cciptypes.Address]*big.Int{srcNative: big.NewInt(1)}, + dstPrices: map[cciptypes.Address]*big.Int{destNative: big.NewInt(1)}, + offRampNoncesBySender: map[cciptypes.Address]uint64{}, + expectedStates: []messageExecStatus{newMessageExecState(msg1.SequenceNumber, msg1.MessageID, MissingNonce)}, + skipGasPriceEstimator: true, + }, + { + name: "unordered messages", + reqs: []cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta{ + { + EVM2EVMMessage: cciptypes.EVM2EVMMessage{ + SequenceNumber: 10, + FeeTokenAmount: big.NewInt(1e9), + Sender: sender1, + Nonce: 0, + GasLimit: big.NewInt(1), + Data: bytes.Repeat([]byte{'a'}, 1000), + FeeToken: srcNative, + MessageID: [32]byte{}, + }, + BlockTimestamp: time.Date(2010, 1, 1, 12, 12, 12, 0, time.UTC), + }, + }, + inflight: []InflightInternalExecutionReport{}, + inflightAggregateValue: big.NewInt(0), + tokenLimit: big.NewInt(0), + destGasPrice: big.NewInt(10), + srcPrices: map[cciptypes.Address]*big.Int{srcNative: big.NewInt(1)}, + dstPrices: map[cciptypes.Address]*big.Int{destNative: big.NewInt(1)}, + offRampNoncesBySender: map[cciptypes.Address]uint64{sender1: 0}, + expectedSeqNrs: []ccip.ObservedMessage{{SeqNr: uint64(10)}}, + expectedStates: []messageExecStatus{ + newMessageExecState(10, [32]byte{}, AddedToBatch), + }, + }, + { + name: "unordered messages not blocked by nonce", + reqs: []cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta{ + { + EVM2EVMMessage: cciptypes.EVM2EVMMessage{ + SequenceNumber: 9, + FeeTokenAmount: big.NewInt(1e9), + Sender: sender1, + Nonce: 5, + GasLimit: big.NewInt(1), + Data: bytes.Repeat([]byte{'a'}, 1000), + FeeToken: srcNative, + MessageID: [32]byte{}, + }, + BlockTimestamp: time.Date(2010, 1, 1, 12, 12, 12, 0, time.UTC), + }, + { + EVM2EVMMessage: cciptypes.EVM2EVMMessage{ + SequenceNumber: 10, + FeeTokenAmount: big.NewInt(1e9), + Sender: sender1, + Nonce: 0, + GasLimit: big.NewInt(1), + Data: bytes.Repeat([]byte{'a'}, 1000), + FeeToken: srcNative, + MessageID: [32]byte{}, + }, + BlockTimestamp: time.Date(2010, 1, 1, 12, 12, 12, 0, time.UTC), + }, + }, + inflight: []InflightInternalExecutionReport{}, + inflightAggregateValue: big.NewInt(0), + tokenLimit: big.NewInt(0), + destGasPrice: big.NewInt(10), + srcPrices: map[cciptypes.Address]*big.Int{srcNative: big.NewInt(1)}, + dstPrices: map[cciptypes.Address]*big.Int{destNative: big.NewInt(1)}, + offRampNoncesBySender: map[cciptypes.Address]uint64{sender1: 3}, + expectedSeqNrs: []ccip.ObservedMessage{{SeqNr: uint64(10)}}, + expectedStates: []messageExecStatus{ + newMessageExecState(9, [32]byte{}, InvalidNonce), + newMessageExecState(10, [32]byte{}, AddedToBatch), + }, + }, + } + + bestEffortTestCases := []testCase{ + { + name: "skip when batch gas limit is reached", + reqs: []cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta{ + { + EVM2EVMMessage: cciptypes.EVM2EVMMessage{ + SequenceNumber: 10, + FeeTokenAmount: big.NewInt(1e9), + Sender: sender1, + Nonce: 1, + GasLimit: big.NewInt(1), + Data: bytes.Repeat([]byte{'a'}, 1000), + FeeToken: srcNative, + MessageID: [32]byte{}, + }, + BlockTimestamp: time.Date(2010, 1, 1, 12, 12, 12, 0, time.UTC), + }, + { + EVM2EVMMessage: cciptypes.EVM2EVMMessage{ + SequenceNumber: 11, + FeeTokenAmount: big.NewInt(1e9), + Sender: sender1, + Nonce: 2, + GasLimit: big.NewInt(math.MaxInt64), + Data: bytes.Repeat([]byte{'a'}, 1000), + FeeToken: srcNative, + MessageID: [32]byte{}, + }, + BlockTimestamp: time.Date(2010, 1, 1, 12, 12, 12, 0, time.UTC), + }, + { + EVM2EVMMessage: cciptypes.EVM2EVMMessage{ + SequenceNumber: 12, + FeeTokenAmount: big.NewInt(1e9), + Sender: sender1, + Nonce: 3, + GasLimit: big.NewInt(1), + Data: bytes.Repeat([]byte{'a'}, 1000), + FeeToken: srcNative, + MessageID: [32]byte{}, + }, + BlockTimestamp: time.Date(2010, 1, 1, 12, 12, 12, 0, time.UTC), + }, + }, + inflight: []InflightInternalExecutionReport{}, + inflightAggregateValue: big.NewInt(0), + tokenLimit: big.NewInt(0), + destGasPrice: big.NewInt(10), + srcPrices: map[cciptypes.Address]*big.Int{srcNative: big.NewInt(1)}, + dstPrices: map[cciptypes.Address]*big.Int{destNative: big.NewInt(1)}, + offRampNoncesBySender: map[cciptypes.Address]uint64{sender1: 0}, + expectedSeqNrs: []ccip.ObservedMessage{{SeqNr: uint64(10)}}, + expectedStates: []messageExecStatus{ + newMessageExecState(10, [32]byte{}, AddedToBatch), + newMessageExecState(11, [32]byte{}, InsufficientRemainingBatchGas), + newMessageExecState(12, [32]byte{}, InvalidNonce), + }, + }, + { + name: "some messages skipped after hitting max batch data len", + reqs: []cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta{ + { + EVM2EVMMessage: cciptypes.EVM2EVMMessage{ + SequenceNumber: 10, + FeeTokenAmount: big.NewInt(1e9), + Sender: sender1, + Nonce: 1, + GasLimit: big.NewInt(1), + Data: bytes.Repeat([]byte{'a'}, 1000), + FeeToken: srcNative, + MessageID: [32]byte{}, + }, + BlockTimestamp: time.Date(2010, 1, 1, 12, 12, 12, 0, time.UTC), + }, + { + EVM2EVMMessage: cciptypes.EVM2EVMMessage{ + SequenceNumber: 11, + FeeTokenAmount: big.NewInt(1e9), + Sender: sender1, + Nonce: 2, + GasLimit: big.NewInt(1), + Data: bytes.Repeat([]byte{'a'}, MaxDataLenPerBatch-500), // skipped from batch + FeeToken: srcNative, + MessageID: [32]byte{}, + }, + BlockTimestamp: time.Date(2010, 1, 1, 12, 12, 12, 0, time.UTC), + }, + { + EVM2EVMMessage: cciptypes.EVM2EVMMessage{ + SequenceNumber: 12, + FeeTokenAmount: big.NewInt(1e9), + Sender: sender1, + Nonce: 3, + GasLimit: big.NewInt(1), + Data: bytes.Repeat([]byte{'a'}, 1000), + FeeToken: srcNative, + MessageID: [32]byte{}, + }, + BlockTimestamp: time.Date(2010, 1, 1, 12, 12, 12, 0, time.UTC), + }, + }, + inflight: []InflightInternalExecutionReport{}, + inflightAggregateValue: big.NewInt(0), + tokenLimit: big.NewInt(0), + destGasPrice: big.NewInt(10), + srcPrices: map[cciptypes.Address]*big.Int{srcNative: big.NewInt(1)}, + dstPrices: map[cciptypes.Address]*big.Int{destNative: big.NewInt(1)}, + offRampNoncesBySender: map[cciptypes.Address]uint64{sender1: 0}, + expectedSeqNrs: []ccip.ObservedMessage{{SeqNr: uint64(10)}}, + expectedStates: []messageExecStatus{ + newMessageExecState(10, [32]byte{}, AddedToBatch), + newMessageExecState(11, [32]byte{}, InsufficientRemainingBatchDataLength), + newMessageExecState(12, [32]byte{}, InvalidNonce), + }, + }, + { + name: "unordered messages then ordered messages", + reqs: []cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta{ + { + EVM2EVMMessage: cciptypes.EVM2EVMMessage{ + SequenceNumber: 9, + FeeTokenAmount: big.NewInt(1e9), + Sender: sender1, + Nonce: 0, + GasLimit: big.NewInt(1), + Data: bytes.Repeat([]byte{'a'}, 1000), + FeeToken: srcNative, + MessageID: [32]byte{}, + }, + BlockTimestamp: time.Date(2010, 1, 1, 12, 12, 12, 0, time.UTC), + }, + { + EVM2EVMMessage: cciptypes.EVM2EVMMessage{ + SequenceNumber: 10, + FeeTokenAmount: big.NewInt(1e9), + Sender: sender1, + Nonce: 5, + GasLimit: big.NewInt(1), + Data: bytes.Repeat([]byte{'a'}, 1000), + FeeToken: srcNative, + MessageID: [32]byte{}, + }, + BlockTimestamp: time.Date(2010, 1, 1, 12, 12, 12, 0, time.UTC), + }, + }, + inflight: []InflightInternalExecutionReport{}, + inflightAggregateValue: big.NewInt(0), + tokenLimit: big.NewInt(0), + destGasPrice: big.NewInt(10), + srcPrices: map[cciptypes.Address]*big.Int{srcNative: big.NewInt(1)}, + dstPrices: map[cciptypes.Address]*big.Int{destNative: big.NewInt(1)}, + offRampNoncesBySender: map[cciptypes.Address]uint64{sender1: 4}, + expectedSeqNrs: []ccip.ObservedMessage{{SeqNr: uint64(9)}, {SeqNr: uint64(10)}}, + expectedStates: []messageExecStatus{ + newMessageExecState(9, [32]byte{}, AddedToBatch), + newMessageExecState(10, [32]byte{}, AddedToBatch), + }, + }, + } + + specificZkOverflowTestCases := []testCase{ + { + name: "batch size is 1", + reqs: []cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta{zkMsg1, zkMsg2, zkMsg3}, + inflight: []InflightInternalExecutionReport{}, + inflightAggregateValue: big.NewInt(0), + tokenLimit: big.NewInt(0), + destGasPrice: big.NewInt(10), + srcPrices: map[cciptypes.Address]*big.Int{srcNative: big.NewInt(1)}, + dstPrices: map[cciptypes.Address]*big.Int{destNative: big.NewInt(1)}, + offRampNoncesBySender: map[cciptypes.Address]uint64{sender1: 0}, + expectedSeqNrs: []ccip.ObservedMessage{{SeqNr: zkMsg1.SequenceNumber}}, + expectedStates: []messageExecStatus{ + newMessageExecState(zkMsg1.SequenceNumber, zkMsg1.MessageID, AddedToBatch), + }, + statuschecker: func(m *mockstatuschecker.CCIPTransactionStatusChecker) { + m.Mock = mock.Mock{} // reset mock + m.On("CheckMessageStatus", mock.Anything, mock.Anything).Return([]types.TransactionStatus{}, -1, nil) + }, + }, + { + name: "snooze fatal message and return empty batch", + reqs: []cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta{zkMsg1}, + inflight: []InflightInternalExecutionReport{}, + inflightAggregateValue: big.NewInt(0), + tokenLimit: big.NewInt(0), + destGasPrice: big.NewInt(10), + srcPrices: map[cciptypes.Address]*big.Int{srcNative: big.NewInt(1)}, + dstPrices: map[cciptypes.Address]*big.Int{destNative: big.NewInt(1)}, + offRampNoncesBySender: map[cciptypes.Address]uint64{sender1: 0}, + expectedStates: []messageExecStatus{ + newMessageExecState(zkMsg1.SequenceNumber, zkMsg1.MessageID, TXMFatalStatus), + }, + statuschecker: func(m *mockstatuschecker.CCIPTransactionStatusChecker) { + m.Mock = mock.Mock{} // reset mock + m.On("CheckMessageStatus", mock.Anything, zkMsg1.MessageID.String()).Return([]types.TransactionStatus{types.Fatal}, 0, nil) + }, + skipGasPriceEstimator: true, + }, + { + name: "snooze fatal message and add next message to batch", + reqs: []cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta{zkMsg1, zkMsg2}, + inflight: []InflightInternalExecutionReport{}, + inflightAggregateValue: big.NewInt(0), + tokenLimit: big.NewInt(0), + destGasPrice: big.NewInt(10), + srcPrices: map[cciptypes.Address]*big.Int{srcNative: big.NewInt(1)}, + dstPrices: map[cciptypes.Address]*big.Int{destNative: big.NewInt(1)}, + offRampNoncesBySender: map[cciptypes.Address]uint64{sender1: 0}, + expectedSeqNrs: []ccip.ObservedMessage{{SeqNr: zkMsg2.SequenceNumber}}, + expectedStates: []messageExecStatus{ + newMessageExecState(zkMsg1.SequenceNumber, zkMsg1.MessageID, TXMFatalStatus), + newMessageExecState(zkMsg2.SequenceNumber, zkMsg2.MessageID, AddedToBatch), + }, + statuschecker: func(m *mockstatuschecker.CCIPTransactionStatusChecker) { + m.Mock = mock.Mock{} // reset mock + m.On("CheckMessageStatus", mock.Anything, zkMsg1.MessageID.String()).Return([]types.TransactionStatus{types.Fatal}, 0, nil) + m.On("CheckMessageStatus", mock.Anything, zkMsg2.MessageID.String()).Return([]types.TransactionStatus{}, -1, nil) + }, + }, + { + name: "all messages are fatal and batch is empty", + reqs: []cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta{zkMsg1, zkMsg2}, + inflight: []InflightInternalExecutionReport{}, + inflightAggregateValue: big.NewInt(0), + tokenLimit: big.NewInt(0), + destGasPrice: big.NewInt(10), + srcPrices: map[cciptypes.Address]*big.Int{srcNative: big.NewInt(1)}, + dstPrices: map[cciptypes.Address]*big.Int{destNative: big.NewInt(1)}, + offRampNoncesBySender: map[cciptypes.Address]uint64{sender1: 0}, + expectedStates: []messageExecStatus{ + newMessageExecState(zkMsg1.SequenceNumber, zkMsg1.MessageID, TXMFatalStatus), + newMessageExecState(zkMsg2.SequenceNumber, zkMsg2.MessageID, TXMFatalStatus), + }, + statuschecker: func(m *mockstatuschecker.CCIPTransactionStatusChecker) { + m.Mock = mock.Mock{} // reset mock + m.On("CheckMessageStatus", mock.Anything, zkMsg1.MessageID.String()).Return([]types.TransactionStatus{types.Fatal}, 0, nil) + m.On("CheckMessageStatus", mock.Anything, zkMsg2.MessageID.String()).Return([]types.TransactionStatus{types.Fatal}, 0, nil) + }, + skipGasPriceEstimator: true, + }, + { + name: "message batched when unconfirmed or failed", + reqs: []cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta{zkMsg1, zkMsg2}, + inflight: []InflightInternalExecutionReport{}, + inflightAggregateValue: big.NewInt(0), + tokenLimit: big.NewInt(0), + destGasPrice: big.NewInt(10), + srcPrices: map[cciptypes.Address]*big.Int{srcNative: big.NewInt(1)}, + dstPrices: map[cciptypes.Address]*big.Int{destNative: big.NewInt(1)}, + offRampNoncesBySender: map[cciptypes.Address]uint64{sender1: 0}, + expectedSeqNrs: []ccip.ObservedMessage{{SeqNr: zkMsg1.SequenceNumber}}, + expectedStates: []messageExecStatus{ + newMessageExecState(zkMsg1.SequenceNumber, zkMsg1.MessageID, AddedToBatch), + }, + statuschecker: func(m *mockstatuschecker.CCIPTransactionStatusChecker) { + m.Mock = mock.Mock{} // reset mock + m.On("CheckMessageStatus", mock.Anything, zkMsg1.MessageID.String()).Return([]types.TransactionStatus{types.Unconfirmed, types.Failed}, 1, nil) + }, + }, + { + name: "message snoozed when multiple statuses with fatal", + reqs: []cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta{zkMsg1, zkMsg2}, + inflight: []InflightInternalExecutionReport{}, + inflightAggregateValue: big.NewInt(0), + tokenLimit: big.NewInt(0), + destGasPrice: big.NewInt(10), + srcPrices: map[cciptypes.Address]*big.Int{srcNative: big.NewInt(1)}, + dstPrices: map[cciptypes.Address]*big.Int{destNative: big.NewInt(1)}, + offRampNoncesBySender: map[cciptypes.Address]uint64{sender1: 0}, + expectedSeqNrs: []ccip.ObservedMessage{{SeqNr: zkMsg2.SequenceNumber}}, + expectedStates: []messageExecStatus{ + newMessageExecState(zkMsg1.SequenceNumber, zkMsg1.MessageID, TXMFatalStatus), + newMessageExecState(zkMsg2.SequenceNumber, zkMsg2.MessageID, AddedToBatch), + }, + statuschecker: func(m *mockstatuschecker.CCIPTransactionStatusChecker) { + m.Mock = mock.Mock{} // reset mock + m.On("CheckMessageStatus", mock.Anything, zkMsg1.MessageID.String()).Return([]types.TransactionStatus{types.Unconfirmed, types.Failed, types.Fatal}, 2, nil) + m.On("CheckMessageStatus", mock.Anything, zkMsg2.MessageID.String()).Return([]types.TransactionStatus{}, -1, nil) + }, + }, + { + name: "txm return error for message", + reqs: []cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta{zkMsg1, zkMsg2}, + inflight: []InflightInternalExecutionReport{}, + inflightAggregateValue: big.NewInt(0), + tokenLimit: big.NewInt(0), + destGasPrice: big.NewInt(10), + srcPrices: map[cciptypes.Address]*big.Int{srcNative: big.NewInt(1)}, + dstPrices: map[cciptypes.Address]*big.Int{destNative: big.NewInt(1)}, + offRampNoncesBySender: map[cciptypes.Address]uint64{sender1: 0}, + expectedSeqNrs: []ccip.ObservedMessage{{SeqNr: zkMsg2.SequenceNumber}}, + expectedStates: []messageExecStatus{ + newMessageExecState(zkMsg1.SequenceNumber, zkMsg1.MessageID, TXMCheckError), + newMessageExecState(zkMsg2.SequenceNumber, zkMsg2.MessageID, AddedToBatch), + }, + statuschecker: func(m *mockstatuschecker.CCIPTransactionStatusChecker) { + m.Mock = mock.Mock{} // reset mock + m.On("CheckMessageStatus", mock.Anything, zkMsg1.MessageID.String()).Return([]types.TransactionStatus{}, -1, errors.New("dummy txm error")) + m.On("CheckMessageStatus", mock.Anything, zkMsg2.MessageID.String()).Return([]types.TransactionStatus{}, -1, nil) + }, + }, + { + name: "snooze message when inflight", + reqs: []cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta{zkMsg1}, + inflight: createInflight(zkMsg1), + inflightAggregateValue: zkMsg1.FeeTokenAmount, + tokenLimit: big.NewInt(0), + destGasPrice: big.NewInt(10), + srcPrices: map[cciptypes.Address]*big.Int{srcNative: big.NewInt(1)}, + dstPrices: map[cciptypes.Address]*big.Int{destNative: big.NewInt(1)}, + offRampNoncesBySender: map[cciptypes.Address]uint64{sender1: 0}, + expectedStates: []messageExecStatus{ + newMessageExecState(zkMsg1.SequenceNumber, zkMsg1.MessageID, SkippedInflight), + }, + skipGasPriceEstimator: true, + }, + { + name: "snooze when not inflight but txm returns error", + reqs: []cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta{zkMsg1}, + inflight: []InflightInternalExecutionReport{}, + inflightAggregateValue: big.NewInt(0), + tokenLimit: big.NewInt(0), + destGasPrice: big.NewInt(10), + srcPrices: map[cciptypes.Address]*big.Int{srcNative: big.NewInt(1)}, + dstPrices: map[cciptypes.Address]*big.Int{destNative: big.NewInt(1)}, + offRampNoncesBySender: map[cciptypes.Address]uint64{sender1: 0}, + expectedStates: []messageExecStatus{ + newMessageExecState(zkMsg1.SequenceNumber, zkMsg1.MessageID, TXMCheckError), + }, + statuschecker: func(m *mockstatuschecker.CCIPTransactionStatusChecker) { + m.Mock = mock.Mock{} // reset mock + m.On("CheckMessageStatus", mock.Anything, zkMsg1.MessageID.String()).Return([]types.TransactionStatus{}, -1, errors.New("dummy txm error")) + }, + skipGasPriceEstimator: true, + }, + { + name: "snooze when not inflight but txm returns fatal status", + reqs: []cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta{zkMsg1}, + inflight: []InflightInternalExecutionReport{}, + inflightAggregateValue: big.NewInt(0), + tokenLimit: big.NewInt(0), + destGasPrice: big.NewInt(10), + srcPrices: map[cciptypes.Address]*big.Int{srcNative: big.NewInt(1)}, + dstPrices: map[cciptypes.Address]*big.Int{destNative: big.NewInt(1)}, + offRampNoncesBySender: map[cciptypes.Address]uint64{sender1: 0}, + expectedStates: []messageExecStatus{ + newMessageExecState(zkMsg1.SequenceNumber, zkMsg1.MessageID, TXMFatalStatus), + }, + statuschecker: func(m *mockstatuschecker.CCIPTransactionStatusChecker) { + m.Mock = mock.Mock{} // reset mock + m.On("CheckMessageStatus", mock.Anything, zkMsg1.MessageID.String()).Return([]types.TransactionStatus{types.Unconfirmed, types.Failed, types.Fatal}, 2, nil) + }, + skipGasPriceEstimator: true, + }, + { + name: "snooze messages when inflight but batch valid messages", + reqs: []cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta{zkMsg1, zkMsg2, zkMsg3, zkMsg4}, + inflight: createInflight(zkMsg1, zkMsg2), + inflightAggregateValue: big.NewInt(0), + tokenLimit: big.NewInt(0), + destGasPrice: big.NewInt(10), + srcPrices: map[cciptypes.Address]*big.Int{srcNative: big.NewInt(1)}, + dstPrices: map[cciptypes.Address]*big.Int{destNative: big.NewInt(1)}, + offRampNoncesBySender: map[cciptypes.Address]uint64{sender1: 0}, + expectedSeqNrs: []ccip.ObservedMessage{{SeqNr: zkMsg3.SequenceNumber}}, + expectedStates: []messageExecStatus{ + newMessageExecState(zkMsg1.SequenceNumber, zkMsg1.MessageID, SkippedInflight), + newMessageExecState(zkMsg2.SequenceNumber, zkMsg2.MessageID, SkippedInflight), + newMessageExecState(zkMsg3.SequenceNumber, zkMsg3.MessageID, AddedToBatch), + }, + statuschecker: func(m *mockstatuschecker.CCIPTransactionStatusChecker) { + m.Mock = mock.Mock{} // reset mock + m.On("CheckMessageStatus", mock.Anything, zkMsg3.MessageID.String()).Return([]types.TransactionStatus{}, -1, nil) + }, + skipGasPriceEstimator: false, + }, + } + + t.Run("BestEffortBatchingStrategy", func(t *testing.T) { + strategy := &BestEffortBatchingStrategy{} + runBatchingStrategyTests(t, strategy, 1_000_000, append(testCases, bestEffortTestCases...)) + }) + + t.Run("ZKOverflowBatchingStrategy", func(t *testing.T) { + mockedStatusChecker := mockstatuschecker.NewCCIPTransactionStatusChecker(t) + strategy := &ZKOverflowBatchingStrategy{ + statuschecker: mockedStatusChecker, + } + runBatchingStrategyTests(t, strategy, 1_000_000, append(testCases, specificZkOverflowTestCases...)) + }) +} + +// Function to set up and run tests for a given batching strategy +func runBatchingStrategyTests(t *testing.T, strategy BatchingStrategy, availableGas uint64, testCases []testCase) { + destNative := ccipcalc.HexToAddress("0xb") + + for _, tc := range testCases { + tc := tc + t.Run(tc.name, func(t *testing.T) { + lggr := logger.TestLogger(t) + + gasPriceEstimator := prices.NewMockGasPriceEstimatorExec(t) + if !tc.skipGasPriceEstimator { + if tc.expectedSeqNrs != nil { + gasPriceEstimator.On("EstimateMsgCostUSD", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(big.NewInt(0), nil) + } else { + gasPriceEstimator.On("EstimateMsgCostUSD", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(big.NewInt(0), errors.New("error")) + } + } + + // default case for ZKOverflowBatchingStrategy + if strategyType := reflect.TypeOf(strategy); tc.statuschecker == nil && strategyType == reflect.TypeOf(&ZKOverflowBatchingStrategy{}) { + strategy.(*ZKOverflowBatchingStrategy).statuschecker.(*mockstatuschecker.CCIPTransactionStatusChecker).On("CheckMessageStatus", mock.Anything, mock.Anything).Return([]types.TransactionStatus{}, -1, nil) + } + + // Mock calls to TXM + if tc.statuschecker != nil { + tc.statuschecker(strategy.(*ZKOverflowBatchingStrategy).statuschecker.(*mockstatuschecker.CCIPTransactionStatusChecker)) + } + + batchContext := &BatchContext{ + report: commitReportWithSendRequests{sendRequestsWithMeta: tc.reqs}, + inflight: tc.inflight, + inflightAggregateValue: tc.inflightAggregateValue, + lggr: lggr, + availableDataLen: MaxDataLenPerBatch, + availableGas: availableGas, + expectedNonces: make(map[cciptypes.Address]uint64), + sendersNonce: tc.offRampNoncesBySender, + sourceTokenPricesUSD: tc.srcPrices, + destTokenPricesUSD: tc.dstPrices, + gasPrice: tc.destGasPrice, + sourceToDestToken: tc.srcToDestTokens, + aggregateTokenLimit: tc.tokenLimit, + tokenDataRemainingDuration: 5 * time.Second, + tokenDataWorker: tokendata.NewBackgroundWorker(map[cciptypes.Address]tokendata.Reader{}, 10, 5*time.Second, time.Hour), + gasPriceEstimator: gasPriceEstimator, + destWrappedNative: destNative, + offchainConfig: cciptypes.ExecOffchainConfig{ + DestOptimisticConfirmations: 1, + BatchGasLimit: 300_000, + RelativeBoostPerWaitHour: 1, + }, + } + + seqNrs, execStates := strategy.BuildBatch(context.Background(), batchContext) + + runAssertions(t, tc, seqNrs, execStates) + }) + } +} + +// Utility function to run common assertions +func runAssertions(t *testing.T, tc testCase, seqNrs []ccip.ObservedMessage, execStates []messageExecStatus) { + if tc.expectedSeqNrs == nil { + assert.Len(t, seqNrs, 0) + } else { + assert.Equal(t, tc.expectedSeqNrs, seqNrs) + } + + if tc.expectedStates == nil { + assert.Len(t, execStates, 0) + } else { + assert.Equal(t, tc.expectedStates, execStates) + } +} + +func createTestMessage(seqNr uint64, sender cciptypes.Address, nonce uint64, feeToken cciptypes.Address, feeAmount *big.Int, executed bool, data []byte) cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta { + return cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta{ + EVM2EVMMessage: cciptypes.EVM2EVMMessage{ + SequenceNumber: seqNr, + FeeTokenAmount: feeAmount, + Sender: sender, + Nonce: nonce, + GasLimit: big.NewInt(1), + Strict: false, + Receiver: "", + Data: data, + TokenAmounts: nil, + FeeToken: feeToken, + MessageID: generateMessageIDFromInt(seqNr), + }, + BlockTimestamp: time.Date(2010, 1, 1, 12, 12, 12, 0, time.UTC), + Executed: executed, + } +} + +func generateMessageIDFromInt(input uint64) [32]byte { + var messageID [32]byte + binary.LittleEndian.PutUint32(messageID[:], uint32(input)) + return messageID +} + +func createInflight(msgs ...cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta) []InflightInternalExecutionReport { + reports := make([]InflightInternalExecutionReport, len(msgs)) + + for i, msg := range msgs { + reports[i] = InflightInternalExecutionReport{ + messages: []cciptypes.EVM2EVMMessage{msg.EVM2EVMMessage}, + createdAt: msg.BlockTimestamp, + } + } + + return reports +} diff --git a/core/services/ocr2/plugins/ccip/ccipexec/factory.go b/core/services/ocr2/plugins/ccip/ccipexec/factory.go new file mode 100644 index 00000000000..97caf2e719c --- /dev/null +++ b/core/services/ocr2/plugins/ccip/ccipexec/factory.go @@ -0,0 +1,164 @@ +package ccipexec + +import ( + "context" + "fmt" + "sync" + + "github.com/smartcontractkit/libocr/offchainreporting2plus/types" + + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipcommon" + + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/cache" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata" +) + +type ExecutionReportingPluginFactory struct { + // Config derived from job specs and does not change between instances. + config ExecutionPluginStaticConfig + + destPriceRegReader ccipdata.PriceRegistryReader + destPriceRegAddr cciptypes.Address + readersMu *sync.Mutex +} + +func NewExecutionReportingPluginFactory(config ExecutionPluginStaticConfig) *ExecutionReportingPluginFactory { + return &ExecutionReportingPluginFactory{ + config: config, + readersMu: &sync.Mutex{}, + + // the fields below are initially empty and populated on demand + destPriceRegReader: nil, + destPriceRegAddr: "", + } +} + +func (rf *ExecutionReportingPluginFactory) UpdateDynamicReaders(ctx context.Context, newPriceRegAddr cciptypes.Address) error { + rf.readersMu.Lock() + defer rf.readersMu.Unlock() + // TODO: Investigate use of Close() to cleanup. + // TODO: a true price registry upgrade on an existing lane may want some kind of start block in its config? Right now we + // essentially assume that plugins don't care about historical price reg logs. + if rf.destPriceRegAddr == newPriceRegAddr { + // No-op + return nil + } + // Close old reader (if present) and open new reader if address changed. + if rf.destPriceRegReader != nil { + if err := rf.destPriceRegReader.Close(); err != nil { + return err + } + } + + destPriceRegistryReader, err := rf.config.priceRegistryProvider.NewPriceRegistryReader(context.Background(), newPriceRegAddr) + if err != nil { + return err + } + rf.destPriceRegReader = destPriceRegistryReader + rf.destPriceRegAddr = newPriceRegAddr + return nil +} + +type reportingPluginAndInfo struct { + plugin types.ReportingPlugin + pluginInfo types.ReportingPluginInfo +} + +// NewReportingPlugin registers a new ReportingPlugin +func (rf *ExecutionReportingPluginFactory) NewReportingPlugin(config types.ReportingPluginConfig) (types.ReportingPlugin, types.ReportingPluginInfo, error) { + initialRetryDelay := rf.config.newReportingPluginRetryConfig.InitialDelay + maxDelay := rf.config.newReportingPluginRetryConfig.MaxDelay + + pluginAndInfo, err := ccipcommon.RetryUntilSuccess(rf.NewReportingPluginFn(config), initialRetryDelay, maxDelay) + if err != nil { + return nil, types.ReportingPluginInfo{}, err + } + return pluginAndInfo.plugin, pluginAndInfo.pluginInfo, err +} + +// NewReportingPluginFn implements the NewReportingPlugin logic. It is defined as a function so that it can easily be +// retried via RetryUntilSuccess. NewReportingPlugin must return successfully in order for the Exec plugin to function, +// hence why we can only keep retrying it until it succeeds. +func (rf *ExecutionReportingPluginFactory) NewReportingPluginFn(config types.ReportingPluginConfig) func() (reportingPluginAndInfo, error) { + return func() (reportingPluginAndInfo, error) { + ctx := context.Background() // todo: consider setting a timeout + + destPriceRegistry, destWrappedNative, err := rf.config.offRampReader.ChangeConfig(ctx, config.OnchainConfig, config.OffchainConfig) + if err != nil { + return reportingPluginAndInfo{}, err + } + + // Open dynamic readers + err = rf.UpdateDynamicReaders(ctx, destPriceRegistry) + if err != nil { + return reportingPluginAndInfo{}, err + } + + offchainConfig, err := rf.config.offRampReader.OffchainConfig(ctx) + if err != nil { + return reportingPluginAndInfo{}, fmt.Errorf("get offchain config from offramp: %w", err) + } + + gasPriceEstimator, err := rf.config.offRampReader.GasPriceEstimator(ctx) + if err != nil { + return reportingPluginAndInfo{}, fmt.Errorf("get gas price estimator from offramp: %w", err) + } + + onchainConfig, err := rf.config.offRampReader.OnchainConfig(ctx) + if err != nil { + return reportingPluginAndInfo{}, fmt.Errorf("get onchain config from offramp: %w", err) + } + + batchingStrategy, err := NewBatchingStrategy(offchainConfig.BatchingStrategyID, rf.config.txmStatusChecker) + if err != nil { + return reportingPluginAndInfo{}, fmt.Errorf("get batching strategy: %w", err) + } + + msgVisibilityInterval := offchainConfig.MessageVisibilityInterval.Duration() + if msgVisibilityInterval.Seconds() == 0 { + rf.config.lggr.Info("MessageVisibilityInterval not set, falling back to PermissionLessExecutionThreshold") + msgVisibilityInterval = onchainConfig.PermissionLessExecutionThresholdSeconds + } + rf.config.lggr.Infof("MessageVisibilityInterval set to: %s", msgVisibilityInterval) + + lggr := rf.config.lggr.Named("ExecutionReportingPlugin") + plugin := &ExecutionReportingPlugin{ + F: config.F, + lggr: lggr, + offchainConfig: offchainConfig, + tokenDataWorker: rf.config.tokenDataWorker, + gasPriceEstimator: gasPriceEstimator, + sourcePriceRegistryProvider: rf.config.sourcePriceRegistryProvider, + sourcePriceRegistryLock: sync.RWMutex{}, + sourceWrappedNativeToken: rf.config.sourceWrappedNativeToken, + onRampReader: rf.config.onRampReader, + commitStoreReader: rf.config.commitStoreReader, + destPriceRegistry: rf.destPriceRegReader, + destWrappedNative: destWrappedNative, + onchainConfig: onchainConfig, + offRampReader: rf.config.offRampReader, + tokenPoolBatchedReader: rf.config.tokenPoolBatchedReader, + inflightReports: newInflightExecReportsContainer(offchainConfig.InflightCacheExpiry.Duration()), + commitRootsCache: cache.NewCommitRootsCache(lggr, rf.config.commitStoreReader, msgVisibilityInterval, offchainConfig.RootSnoozeTime.Duration()), + metricsCollector: rf.config.metricsCollector, + chainHealthcheck: rf.config.chainHealthcheck, + batchingStrategy: batchingStrategy, + } + + pluginInfo := types.ReportingPluginInfo{ + Name: "CCIPExecution", + // Setting this to false saves on calldata since OffRamp doesn't require agreement between NOPs + // (OffRamp is only able to execute committed messages). + UniqueReports: false, + Limits: types.ReportingPluginLimits{ + MaxObservationLength: ccip.MaxObservationLength, + MaxReportLength: MaxExecutionReportLength, + }, + } + + return reportingPluginAndInfo{plugin, pluginInfo}, nil + } +} diff --git a/core/services/ocr2/plugins/ccip/ccipexec/factory_test.go b/core/services/ocr2/plugins/ccip/ccipexec/factory_test.go new file mode 100644 index 00000000000..7bbb9be0c69 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/ccipexec/factory_test.go @@ -0,0 +1,67 @@ +package ccipexec + +import ( + "errors" + "testing" + "time" + + "github.com/smartcontractkit/libocr/offchainreporting2plus/types" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + + "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + "github.com/smartcontractkit/chainlink/v2/core/logger" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata" + ccipdataprovidermocks "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/ccipdataprovider/mocks" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/mocks" +) + +// Assert that NewReportingPlugin keeps retrying until it succeeds. +// +// NewReportingPlugin makes several calls (e.g. OffRampReader.ChangeConfig()) that can fail. We use mocks to cause the +// first call to each of these functions to fail, then all subsequent calls succeed. We assert that NewReportingPlugin +// retries a sufficient number of times to get through the transient errors and eventually succeed. +func TestNewReportingPluginRetriesUntilSuccess(t *testing.T) { + execConfig := ExecutionPluginStaticConfig{} + + // For this unit test, ensure that there is no delay between retries + execConfig.newReportingPluginRetryConfig = ccipdata.RetryConfig{ + InitialDelay: 0 * time.Nanosecond, + MaxDelay: 0 * time.Nanosecond, + } + + // Set up the OffRampReader mock + mockOffRampReader := new(mocks.OffRampReader) + + // The first call is set to return an error, the following calls return a nil error + mockOffRampReader.On("ChangeConfig", mock.Anything, mock.Anything, mock.Anything).Return(ccip.Address(""), ccip.Address(""), errors.New("")).Once() + mockOffRampReader.On("ChangeConfig", mock.Anything, mock.Anything, mock.Anything).Return(ccip.Address("addr1"), ccip.Address("addr2"), nil).Times(5) + + mockOffRampReader.On("OffchainConfig", mock.Anything).Return(ccip.ExecOffchainConfig{}, errors.New("")).Once() + mockOffRampReader.On("OffchainConfig", mock.Anything).Return(ccip.ExecOffchainConfig{}, nil).Times(3) + + mockOffRampReader.On("GasPriceEstimator", mock.Anything).Return(nil, errors.New("")).Once() + mockOffRampReader.On("GasPriceEstimator", mock.Anything).Return(nil, nil).Times(2) + + mockOffRampReader.On("OnchainConfig", mock.Anything).Return(ccip.ExecOnchainConfig{}, errors.New("")).Once() + mockOffRampReader.On("OnchainConfig", mock.Anything).Return(ccip.ExecOnchainConfig{}, nil).Times(1) + + execConfig.offRampReader = mockOffRampReader + + // Set up the PriceRegistry mock + priceRegistryProvider := new(ccipdataprovidermocks.PriceRegistry) + priceRegistryProvider.On("NewPriceRegistryReader", mock.Anything, mock.Anything).Return(nil, errors.New("")).Once() + priceRegistryProvider.On("NewPriceRegistryReader", mock.Anything, mock.Anything).Return(nil, nil).Once() + execConfig.priceRegistryProvider = priceRegistryProvider + + execConfig.lggr, _ = logger.NewLogger() + + factory := NewExecutionReportingPluginFactory(execConfig) + reportingConfig := types.ReportingPluginConfig{} + reportingConfig.OnchainConfig = []byte{1, 2, 3} + reportingConfig.OffchainConfig = []byte{1, 2, 3} + + // Assert that NewReportingPlugin succeeds despite many transient internal failures (mocked out above) + _, _, err := factory.NewReportingPlugin(reportingConfig) + assert.Equal(t, nil, err) +} diff --git a/core/services/ocr2/plugins/ccip/ccipexec/gashelpers.go b/core/services/ocr2/plugins/ccip/ccipexec/gashelpers.go new file mode 100644 index 00000000000..7e208296c53 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/ccipexec/gashelpers.go @@ -0,0 +1,83 @@ +package ccipexec + +import ( + "math" + "math/big" + "time" +) + +const ( + EvmAddressLengthBytes = 20 + EvmWordBytes = 32 + CalldataGasPerByte = 16 + TokenAdminRegistryWarmupCost = 2_500 + TokenAdminRegistryPoolLookupGas = 100 + // WARM_ACCESS_COST TokenAdminRegistry + 700 + // CALL cost for TokenAdminRegistry + 2_100 // COLD_SLOAD_COST loading the pool address + SupportsInterfaceCheck = 2600 + // because the receiver will be untouched initially + 30_000*3 // supportsInterface of ERC165Checker library performs 3 static-calls of 30k gas each + PerTokenOverheadGas = TokenAdminRegistryPoolLookupGas + + SupportsInterfaceCheck + + 200_000 + // releaseOrMint using callWithExactGas + 50_000 // transfer using callWithExactGas + RateLimiterOverheadGas = 2_100 + // COLD_SLOAD_COST for accessing token bucket + 5_000 // SSTORE_RESET_GAS for updating & decreasing token bucket + ConstantMessagePartBytes = 10 * 32 // A message consists of 10 abi encoded fields 32B each (after encoding) + ExecutionStateProcessingOverheadGas = 2_100 + // COLD_SLOAD_COST for first reading the state + 20_000 + // SSTORE_SET_GAS for writing from 0 (untouched) to non-zero (in-progress) + 100 //# SLOAD_GAS = WARM_STORAGE_READ_COST for rewriting from non-zero (in-progress) to non-zero (success/failure) +) + +// return the size of bytes for msg tokens +func bytesForMsgTokens(numTokens int) int { + // token address (address) + token amount (uint256) + return (EvmAddressLengthBytes + EvmWordBytes) * numTokens +} + +// Offchain: we compute the max overhead gas to determine msg executability. +func overheadGas(dataLength, numTokens int) uint64 { + messageBytes := ConstantMessagePartBytes + + bytesForMsgTokens(numTokens) + + dataLength + + messageCallDataGas := uint64(messageBytes * CalldataGasPerByte) + + // Rate limiter only limits value in tokens. It's not called if there are no + // tokens in the message. The same goes for the admin registry, it's only loaded + // if there are tokens, and it's only loaded once. + rateLimiterOverhead := uint64(0) + adminRegistryOverhead := uint64(0) + if numTokens >= 1 { + rateLimiterOverhead = RateLimiterOverheadGas + adminRegistryOverhead = TokenAdminRegistryWarmupCost + } + + return messageCallDataGas + + ExecutionStateProcessingOverheadGas + + SupportsInterfaceCheck + + adminRegistryOverhead + + rateLimiterOverhead + + PerTokenOverheadGas*uint64(numTokens) +} + +func maxGasOverHeadGas(numMsgs, dataLength, numTokens int) uint64 { + merkleProofBytes := (math.Ceil(math.Log2(float64(numMsgs))))*32 + (1+2)*32 // only ever one outer root hash + merkleGasShare := uint64(merkleProofBytes * CalldataGasPerByte) + + return overheadGas(dataLength, numTokens) + merkleGasShare +} + +// waitBoostedFee boosts the given fee according to the time passed since the msg was sent. +// RelativeBoostPerWaitHour is used to normalize the time diff, +// it makes our loss taking "smooth" and gives us time to react without a hard deadline. +// At the same time, messages that are slightly underpaid will start going through after waiting for a little bit. +// +// wait_boosted_fee(m) = (1 + (now - m.send_time).hours * RELATIVE_BOOST_PER_WAIT_HOUR) * fee(m) +func waitBoostedFee(waitTime time.Duration, fee *big.Int, relativeBoostPerWaitHour float64) *big.Int { + k := 1.0 + waitTime.Hours()*relativeBoostPerWaitHour + + boostedFee := big.NewFloat(0).Mul(big.NewFloat(k), new(big.Float).SetInt(fee)) + res, _ := boostedFee.Int(nil) + + return res +} diff --git a/core/services/ocr2/plugins/ccip/ccipexec/gashelpers_test.go b/core/services/ocr2/plugins/ccip/ccipexec/gashelpers_test.go new file mode 100644 index 00000000000..15607cc310e --- /dev/null +++ b/core/services/ocr2/plugins/ccip/ccipexec/gashelpers_test.go @@ -0,0 +1,179 @@ +package ccipexec + +import ( + "math/big" + "reflect" + "testing" + "time" + + "github.com/stretchr/testify/assert" +) + +func TestOverheadGas(t *testing.T) { + // Only Data and TokenAmounts are used from the messages + // And only the length is used so the contents doesn't matter. + tests := []struct { + dataLength int + numberOfTokens int + want uint64 + }{ + { + dataLength: 0, + numberOfTokens: 0, + want: 119920, + }, + { + dataLength: len([]byte{0x0, 0x0, 0x0, 0x0, 0x0, 0x0}), + numberOfTokens: 1, + want: 475948, + }, + } + + for _, tc := range tests { + got := overheadGas(tc.dataLength, tc.numberOfTokens) + if !reflect.DeepEqual(tc.want, got) { + t.Fatalf("expected: %v, got: %v", tc.want, got) + } + } +} + +func TestMaxGasOverHeadGas(t *testing.T) { + // Only Data and TokenAmounts are used from the messages + // And only the length is used so the contents doesn't matter. + tests := []struct { + numMsgs int + dataLength int + numberOfTokens int + want uint64 + }{ + { + numMsgs: 6, + dataLength: 0, + numberOfTokens: 0, + want: 122992, + }, + { + numMsgs: 3, + dataLength: len([]byte{0x0, 0x0, 0x0, 0x0, 0x0, 0x0}), + numberOfTokens: 1, + want: 478508, + }, + } + + for _, tc := range tests { + got := maxGasOverHeadGas(tc.numMsgs, tc.dataLength, tc.numberOfTokens) + if !reflect.DeepEqual(tc.want, got) { + t.Fatalf("expected: %v, got: %v", tc.want, got) + } + } +} + +func TestWaitBoostedFee(t *testing.T) { + tests := []struct { + name string + sendTimeDiff time.Duration + fee *big.Int + diff *big.Int + relativeBoostPerWaitHour float64 + }{ + { + "wait 10s", + time.Second * 10, + big.NewInt(6e18), // Fee: 6 LINK + + big.NewInt(1166666666665984), // Boost: 0.01 LINK + 0.07, + }, + { + "wait 5m", + time.Minute * 5, + big.NewInt(6e18), // Fee: 6 LINK + big.NewInt(35e15), // Boost: 0.35 LINK + 0.07, + }, + { + "wait 7m", + time.Minute * 7, + big.NewInt(6e18), // Fee: 6 LINK + big.NewInt(49e15), // Boost: 0.49 LINK + 0.07, + }, + { + "wait 12m", + time.Minute * 12, + big.NewInt(6e18), // Fee: 6 LINK + big.NewInt(84e15), // Boost: 0.84 LINK + 0.07, + }, + { + "wait 25m", + time.Minute * 25, + big.NewInt(6e18), // Fee: 6 LINK + big.NewInt(174999999999998976), // Boost: 1.75 LINK + 0.07, + }, + { + "wait 1h", + time.Hour * 1, + big.NewInt(6e18), // Fee: 6 LINK + big.NewInt(420e15), // Boost: 4.2 LINK + 0.07, + }, + { + "wait 5h", + time.Hour * 5, + big.NewInt(6e18), // Fee: 6 LINK + big.NewInt(2100000000000001024), // Boost: 21LINK + 0.07, + }, + { + "wait 24h", + time.Hour * 24, + big.NewInt(6e18), // Fee: 6 LINK + big.NewInt(0).Mul(big.NewInt(10), big.NewInt(1008e15)), // Boost: 100LINK + 0.07, + }, + { + "high boost wait 10s", + time.Second * 10, + big.NewInt(5e18), + big.NewInt(9722222222222336), // 1e16 + 0.7, + }, + { + "high boost wait 5m", + time.Minute * 5, + big.NewInt(5e18), + big.NewInt(291666666666667008), // 1e18 + 0.7, + }, + { + "high boost wait 25m", + time.Minute * 25, + big.NewInt(5e18), + big.NewInt(1458333333333334016), // 1e19 + 0.7, + }, + { + "high boost wait 5h", + time.Hour * 5, + big.NewInt(5e18), + big.NewInt(0).Mul(big.NewInt(10), big.NewInt(175e16)), // 1e20 + 0.7, + }, + } + + for _, tc := range tests { + t.Run(tc.name, func(t *testing.T) { + boosted := waitBoostedFee(tc.sendTimeDiff, tc.fee, tc.relativeBoostPerWaitHour) + diff := big.NewInt(0).Sub(boosted, tc.fee) + assert.Equal(t, diff, tc.diff) + // we check that the actual diff is approximately equals to expected diff, + // as we might get slightly different results locally vs. CI therefore normal Equal() would be unstable + //diffUpperLimit := big.NewInt(0).Add(tc.diff, big.NewInt(1e9)) + //diffLowerLimit := big.NewInt(0).Add(tc.diff, big.NewInt(-1e9)) + //require.Equalf(t, -1, diff.Cmp(diffUpperLimit), "actual diff (%s) is larger than expected (%s)", diff.String(), diffUpperLimit.String()) + //require.Equal(t, 1, diff.Cmp(diffLowerLimit), "actual diff (%s) is smaller than expected (%s)", diff.String(), diffLowerLimit.String()) + }) + } +} diff --git a/core/services/ocr2/plugins/ccip/ccipexec/helpers.go b/core/services/ocr2/plugins/ccip/ccipexec/helpers.go new file mode 100644 index 00000000000..46df7d793ba --- /dev/null +++ b/core/services/ocr2/plugins/ccip/ccipexec/helpers.go @@ -0,0 +1,53 @@ +package ccipexec + +import ( + mapset "github.com/deckarep/golang-set/v2" + "github.com/pkg/errors" + + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" +) + +// helper struct to hold the commitReport and the related send requests +type commitReportWithSendRequests struct { + commitReport cciptypes.CommitStoreReport + sendRequestsWithMeta []cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta +} + +func (r *commitReportWithSendRequests) validate() error { + // make sure that number of messages is the expected + if exp := int(r.commitReport.Interval.Max - r.commitReport.Interval.Min + 1); len(r.sendRequestsWithMeta) != exp { + return errors.Errorf( + "unexpected missing sendRequestsWithMeta in committed root %x have %d want %d", r.commitReport.MerkleRoot, len(r.sendRequestsWithMeta), exp) + } + + return nil +} + +// uniqueSenders returns slice of unique senders based on the send requests. Order is preserved based on the order of the send requests (by sequence number). +func (r *commitReportWithSendRequests) uniqueSenders() []cciptypes.Address { + orderedUniqueSenders := make([]cciptypes.Address, 0, len(r.sendRequestsWithMeta)) + visitedSenders := mapset.NewSet[cciptypes.Address]() + + for _, req := range r.sendRequestsWithMeta { + if !visitedSenders.Contains(req.Sender) { + orderedUniqueSenders = append(orderedUniqueSenders, req.Sender) + visitedSenders.Add(req.Sender) + } + } + return orderedUniqueSenders +} + +func (r *commitReportWithSendRequests) allRequestsAreExecutedAndFinalized() bool { + for _, req := range r.sendRequestsWithMeta { + if !req.Executed || !req.Finalized { + return false + } + } + return true +} + +// checks if the send request fits the commit report interval +func (r *commitReportWithSendRequests) sendReqFits(sendReq cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta) bool { + return sendReq.SequenceNumber >= r.commitReport.Interval.Min && + sendReq.SequenceNumber <= r.commitReport.Interval.Max +} diff --git a/core/services/ocr2/plugins/ccip/ccipexec/helpers_test.go b/core/services/ocr2/plugins/ccip/ccipexec/helpers_test.go new file mode 100644 index 00000000000..daa54fd2428 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/ccipexec/helpers_test.go @@ -0,0 +1,96 @@ +package ccipexec + +import ( + "testing" + + "github.com/stretchr/testify/assert" + + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils" +) + +func Test_CommitReportWithSendRequests_uniqueSenders(t *testing.T) { + messageFn := func(address cciptypes.Address) cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta { + return cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta{EVM2EVMMessage: cciptypes.EVM2EVMMessage{Sender: address}} + } + + tests := []struct { + name string + sendRequests []cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta + expUniqueSenders int + expSendersOrder []cciptypes.Address + }{ + { + name: "all unique senders", + sendRequests: []cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta{ + messageFn(cciptypes.Address(utils.RandomAddress().String())), + messageFn(cciptypes.Address(utils.RandomAddress().String())), + messageFn(cciptypes.Address(utils.RandomAddress().String())), + }, + expUniqueSenders: 3, + }, + { + name: "some senders are the same", + sendRequests: []cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta{ + messageFn("0x1"), + messageFn("0x2"), + messageFn("0x1"), + messageFn("0x2"), + messageFn("0x3"), + }, + expUniqueSenders: 3, + expSendersOrder: []cciptypes.Address{ + cciptypes.Address("0x1"), + cciptypes.Address("0x2"), + cciptypes.Address("0x3"), + }, + }, + { + name: "all senders are the same", + sendRequests: []cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta{ + messageFn("0x1"), + messageFn("0x1"), + messageFn("0x1"), + }, + expUniqueSenders: 1, + expSendersOrder: []cciptypes.Address{ + cciptypes.Address("0x1"), + }, + }, + { + name: "order is preserved", + sendRequests: []cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta{ + messageFn("0x3"), + messageFn("0x1"), + messageFn("0x3"), + messageFn("0x2"), + messageFn("0x2"), + messageFn("0x1"), + }, + expUniqueSenders: 3, + expSendersOrder: []cciptypes.Address{ + cciptypes.Address("0x3"), + cciptypes.Address("0x1"), + cciptypes.Address("0x2"), + }, + }, + { + name: "no senders", + sendRequests: []cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta{}, + expUniqueSenders: 0, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + rep := commitReportWithSendRequests{sendRequestsWithMeta: tt.sendRequests} + uniqueSenders := rep.uniqueSenders() + + assert.Len(t, uniqueSenders, tt.expUniqueSenders) + if tt.expSendersOrder != nil { + assert.Equal(t, tt.expSendersOrder, uniqueSenders) + } + }) + } +} diff --git a/core/services/ocr2/plugins/ccip/ccipexec/inflight.go b/core/services/ocr2/plugins/ccip/ccipexec/inflight.go new file mode 100644 index 00000000000..c76bfdf7780 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/ccipexec/inflight.go @@ -0,0 +1,82 @@ +package ccipexec + +import ( + "sync" + "time" + + "github.com/pkg/errors" + + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + "github.com/smartcontractkit/chainlink/v2/core/logger" +) + +// InflightInternalExecutionReport serves the same purpose as InflightCommitReport +// see the comment on that struct for context. +type InflightInternalExecutionReport struct { + createdAt time.Time + messages []cciptypes.EVM2EVMMessage +} + +// inflightExecReportsContainer holds existing inflight reports. +// it provides a thread-safe access as it is called from multiple goroutines, +// e.g. reporting and transmission protocols. +type inflightExecReportsContainer struct { + locker sync.RWMutex + reports []InflightInternalExecutionReport + + cacheExpiry time.Duration +} + +func newInflightExecReportsContainer(inflightCacheExpiry time.Duration) *inflightExecReportsContainer { + return &inflightExecReportsContainer{ + locker: sync.RWMutex{}, + reports: make([]InflightInternalExecutionReport, 0), + cacheExpiry: inflightCacheExpiry, + } +} + +func (container *inflightExecReportsContainer) getAll() []InflightInternalExecutionReport { + container.locker.RLock() + defer container.locker.RUnlock() + + reports := make([]InflightInternalExecutionReport, len(container.reports)) + copy(reports[:], container.reports[:]) + + return reports +} + +func (container *inflightExecReportsContainer) expire(lggr logger.Logger) { + container.locker.Lock() + defer container.locker.Unlock() + // Reap old inflight txs and check if any messages in the report are inflight. + var stillInFlight []InflightInternalExecutionReport + for _, report := range container.reports { + if time.Since(report.createdAt) > container.cacheExpiry { + // Happy path: inflight report was successfully transmitted onchain, we remove it from inflight and onchain state reflects inflight. + // Sad path: inflight report reverts onchain, we remove it from inflight, onchain state does not reflect the change so we retry. + lggr.Infow("Inflight report expired", "messages", report.messages) + } else { + stillInFlight = append(stillInFlight, report) + } + } + container.reports = stillInFlight +} + +func (container *inflightExecReportsContainer) add(lggr logger.Logger, messages []cciptypes.EVM2EVMMessage) error { + container.locker.Lock() + defer container.locker.Unlock() + + for _, report := range container.reports { + if (len(report.messages) > 0) && (report.messages[0].SequenceNumber == messages[0].SequenceNumber) { + return errors.Errorf("report is already in flight") + } + } + + // Otherwise not already in flight, add it. + lggr.Info("Inflight report added") + container.reports = append(container.reports, InflightInternalExecutionReport{ + createdAt: time.Now(), + messages: messages, + }) + return nil +} diff --git a/core/services/ocr2/plugins/ccip/ccipexec/inflight_test.go b/core/services/ocr2/plugins/ccip/ccipexec/inflight_test.go new file mode 100644 index 00000000000..2a91457ef4f --- /dev/null +++ b/core/services/ocr2/plugins/ccip/ccipexec/inflight_test.go @@ -0,0 +1,42 @@ +package ccipexec + +import ( + "testing" + "time" + + "github.com/stretchr/testify/require" + + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + "github.com/smartcontractkit/chainlink/v2/core/logger" +) + +func TestInflightReportsContainer_add(t *testing.T) { + lggr := logger.TestLogger(t) + container := newInflightExecReportsContainer(time.Second) + + err := container.add(lggr, []cciptypes.EVM2EVMMessage{ + {SequenceNumber: 1}, {SequenceNumber: 2}, {SequenceNumber: 3}, + }) + require.NoError(t, err) + err = container.add(lggr, []cciptypes.EVM2EVMMessage{ + {SequenceNumber: 1}, + }) + require.Error(t, err) + require.Equal(t, "report is already in flight", err.Error()) + require.Equal(t, 1, len(container.getAll())) +} + +func TestInflightReportsContainer_expire(t *testing.T) { + lggr := logger.TestLogger(t) + container := newInflightExecReportsContainer(time.Second) + + err := container.add(lggr, []cciptypes.EVM2EVMMessage{ + {SequenceNumber: 1}, {SequenceNumber: 2}, {SequenceNumber: 3}, + }) + require.NoError(t, err) + container.reports[0].createdAt = time.Now().Add(-time.Second * 5) + require.Equal(t, 1, len(container.getAll())) + + container.expire(lggr) + require.Equal(t, 0, len(container.getAll())) +} diff --git a/core/services/ocr2/plugins/ccip/ccipexec/initializers.go b/core/services/ocr2/plugins/ccip/ccipexec/initializers.go new file mode 100644 index 00000000000..7826f6058fe --- /dev/null +++ b/core/services/ocr2/plugins/ccip/ccipexec/initializers.go @@ -0,0 +1,228 @@ +package ccipexec + +import ( + "context" + "encoding/json" + "fmt" + "math/big" + "time" + + "github.com/smartcontractkit/chainlink-common/pkg/types" + + "github.com/Masterminds/semver/v3" + "go.uber.org/multierr" + + libocr2 "github.com/smartcontractkit/libocr/offchainreporting2plus" + + commonlogger "github.com/smartcontractkit/chainlink-common/pkg/logger" + + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/cache" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipcalc" + "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/statuschecker" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/txmgr" + "github.com/smartcontractkit/chainlink/v2/core/logger" + "github.com/smartcontractkit/chainlink/v2/core/services/job" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip" + ccipconfig "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/config" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/factory" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/observability" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/oraclelib" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/tokendata" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/promwrapper" +) + +var ( + // tokenDataWorkerTimeout defines 1) The timeout while waiting for a bg call to the token data 3P provider. + // 2) When a client requests token data and does not specify a timeout this value is used as a default. + // 5 seconds is a reasonable value for a timeout. + // At this moment, minimum OCR Delta Round is set to 30s and deltaGrace to 5s. Based on this configuration + // 5s for token data worker timeout is a reasonable default. + tokenDataWorkerTimeout = 5 * time.Second + // tokenDataWorkerNumWorkers is the number of workers that will be processing token data in parallel. + tokenDataWorkerNumWorkers = 5 +) + +var defaultNewReportingPluginRetryConfig = ccipdata.RetryConfig{InitialDelay: time.Second, MaxDelay: 5 * time.Minute} + +func NewExecServices(ctx context.Context, lggr logger.Logger, jb job.Job, srcProvider types.CCIPExecProvider, dstProvider types.CCIPExecProvider, srcChainID int64, dstChainID int64, new bool, argsNoPlugin libocr2.OCR2OracleArgs, logError func(string)) ([]job.ServiceCtx, error) { + if jb.OCR2OracleSpec == nil { + return nil, fmt.Errorf("spec is nil") + } + spec := jb.OCR2OracleSpec + var pluginConfig ccipconfig.ExecPluginJobSpecConfig + err := json.Unmarshal(spec.PluginConfig.Bytes(), &pluginConfig) + if err != nil { + return nil, err + } + + offRampAddress := ccipcalc.HexToAddress(spec.ContractID) + offRampReader, err := dstProvider.NewOffRampReader(ctx, offRampAddress) + if err != nil { + return nil, fmt.Errorf("create offRampReader: %w", err) + } + + offRampConfig, err := offRampReader.GetStaticConfig(ctx) + if err != nil { + return nil, fmt.Errorf("get offRamp static config: %w", err) + } + + srcChainSelector := offRampConfig.SourceChainSelector + dstChainSelector := offRampConfig.ChainSelector + onRampReader, err := srcProvider.NewOnRampReader(ctx, offRampConfig.OnRamp, srcChainSelector, dstChainSelector) + if err != nil { + return nil, fmt.Errorf("create onRampReader: %w", err) + } + + dynamicOnRampConfig, err := onRampReader.GetDynamicConfig(ctx) + if err != nil { + return nil, fmt.Errorf("get onramp dynamic config: %w", err) + } + + sourceWrappedNative, err := srcProvider.SourceNativeToken(ctx, dynamicOnRampConfig.Router) + if err != nil { + return nil, fmt.Errorf("get source wrapped native token: %w", err) + } + + srcCommitStore, err := srcProvider.NewCommitStoreReader(ctx, offRampConfig.CommitStore) + if err != nil { + return nil, fmt.Errorf("could not create src commitStoreReader reader: %w", err) + } + + dstCommitStore, err := dstProvider.NewCommitStoreReader(ctx, offRampConfig.CommitStore) + if err != nil { + return nil, fmt.Errorf("could not create dst commitStoreReader reader: %w", err) + } + + var commitStoreReader ccipdata.CommitStoreReader + commitStoreReader = ccip.NewProviderProxyCommitStoreReader(srcCommitStore, dstCommitStore) + + tokenDataProviders := make(map[cciptypes.Address]tokendata.Reader) + // init usdc token data provider + if pluginConfig.USDCConfig.AttestationAPI != "" { + lggr.Infof("USDC token data provider enabled") + err2 := pluginConfig.USDCConfig.ValidateUSDCConfig() + if err2 != nil { + return nil, err2 + } + + usdcReader, err2 := srcProvider.NewTokenDataReader(ctx, ccip.EvmAddrToGeneric(pluginConfig.USDCConfig.SourceTokenAddress)) + if err2 != nil { + return nil, fmt.Errorf("new usdc reader: %w", err2) + } + tokenDataProviders[cciptypes.Address(pluginConfig.USDCConfig.SourceTokenAddress.String())] = usdcReader + } + + // Prom wrappers + onRampReader = observability.NewObservedOnRampReader(onRampReader, srcChainID, ccip.ExecPluginLabel) + commitStoreReader = observability.NewObservedCommitStoreReader(commitStoreReader, dstChainID, ccip.ExecPluginLabel) + offRampReader = observability.NewObservedOffRampReader(offRampReader, dstChainID, ccip.ExecPluginLabel) + metricsCollector := ccip.NewPluginMetricsCollector(ccip.ExecPluginLabel, srcChainID, dstChainID) + + tokenPoolBatchedReader, err := dstProvider.NewTokenPoolBatchedReader(ctx, offRampAddress, srcChainSelector) + if err != nil { + return nil, fmt.Errorf("new token pool batched reader: %w", err) + } + + chainHealthcheck := cache.NewObservedChainHealthCheck( + cache.NewChainHealthcheck( + // Adding more details to Logger to make healthcheck logs more informative + // It's safe because healthcheck logs only in case of unhealthy state + lggr.With( + "onramp", offRampConfig.OnRamp, + "commitStore", offRampConfig.CommitStore, + "offramp", offRampAddress, + ), + onRampReader, + commitStoreReader, + ), + ccip.ExecPluginLabel, + srcChainID, + dstChainID, + offRampConfig.OnRamp, + ) + + tokenBackgroundWorker := tokendata.NewBackgroundWorker( + tokenDataProviders, + tokenDataWorkerNumWorkers, + tokenDataWorkerTimeout, + 2*tokenDataWorkerTimeout, + ) + + wrappedPluginFactory := NewExecutionReportingPluginFactory(ExecutionPluginStaticConfig{ + lggr: lggr, + onRampReader: onRampReader, + commitStoreReader: commitStoreReader, + offRampReader: offRampReader, + sourcePriceRegistryProvider: ccip.NewChainAgnosticPriceRegistry(srcProvider), + sourceWrappedNativeToken: sourceWrappedNative, + destChainSelector: dstChainSelector, + priceRegistryProvider: ccip.NewChainAgnosticPriceRegistry(dstProvider), + tokenPoolBatchedReader: tokenPoolBatchedReader, + tokenDataWorker: tokenBackgroundWorker, + metricsCollector: metricsCollector, + chainHealthcheck: chainHealthcheck, + newReportingPluginRetryConfig: defaultNewReportingPluginRetryConfig, + txmStatusChecker: statuschecker.NewTxmStatusChecker(dstProvider.GetTransactionStatus), + }) + + argsNoPlugin.ReportingPluginFactory = promwrapper.NewPromFactory(wrappedPluginFactory, "CCIPExecution", jb.OCR2OracleSpec.Relay, big.NewInt(0).SetInt64(dstChainID)) + argsNoPlugin.Logger = commonlogger.NewOCRWrapper(lggr, true, logError) + oracle, err := libocr2.NewOracle(argsNoPlugin) + if err != nil { + return nil, err + } + // If this is a brand-new job, then we make use of the start blocks. If not then we're rebooting and log poller will pick up where we left off. + if new { + return []job.ServiceCtx{ + oraclelib.NewChainAgnosticBackFilledOracle( + lggr, + srcProvider, + dstProvider, + job.NewServiceAdapter(oracle), + ), + chainHealthcheck, + tokenBackgroundWorker, + }, nil + } + return []job.ServiceCtx{ + job.NewServiceAdapter(oracle), + chainHealthcheck, + tokenBackgroundWorker, + }, nil +} + +// UnregisterExecPluginLpFilters unregisters all the registered filters for both source and dest chains. +// See comment in UnregisterCommitPluginLpFilters +// It MUST mirror the filters registered in NewExecServices. +// This currently works because the filters registered by the created custom providers when the job is first added +// are stored in the db. Those same filters are unregistered (i.e. deleted from the db) by the newly created providers +// that are passed in from cleanupEVM, as while the providers have no knowledge of each other, they are created +// on the same source and dest relayer. +func UnregisterExecPluginLpFilters(srcProvider types.CCIPExecProvider, dstProvider types.CCIPExecProvider) error { + unregisterFuncs := []func() error{ + func() error { + return srcProvider.Close() + }, + func() error { + return dstProvider.Close() + }, + } + + var multiErr error + for _, fn := range unregisterFuncs { + if err := fn(); err != nil { + multiErr = multierr.Append(multiErr, err) + } + } + return multiErr +} + +// ExecReportToEthTxMeta generates a txmgr.EthTxMeta from the given report. +// Only MessageIDs will be populated in the TxMeta. +func ExecReportToEthTxMeta(ctx context.Context, typ ccipconfig.ContractType, ver semver.Version) (func(report []byte) (*txmgr.TxMeta, error), error) { + return factory.ExecReportToEthTxMeta(ctx, typ, ver) +} diff --git a/core/services/ocr2/plugins/ccip/ccipexec/ocr2.go b/core/services/ocr2/plugins/ccip/ccipexec/ocr2.go new file mode 100644 index 00000000000..4a09cf37b45 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/ccipexec/ocr2.go @@ -0,0 +1,845 @@ +package ccipexec + +import ( + "context" + "encoding/hex" + "fmt" + "math/big" + "sort" + "sync" + "time" + + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/pkg/errors" + "golang.org/x/sync/errgroup" + + "github.com/smartcontractkit/libocr/offchainreporting2plus/types" + + "github.com/smartcontractkit/chainlink-common/pkg/hashutil" + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + "github.com/smartcontractkit/chainlink/v2/core/logger" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/cache" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipcommon" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/batchreader" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/ccipdataprovider" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/prices" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/tokendata" + "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/statuschecker" +) + +const ( + // exec Report should make sure to cap returned payload to this limit + MaxExecutionReportLength = 250_000 + + // MaxDataLenPerBatch limits the total length of msg data that can be in a batch. + MaxDataLenPerBatch = 60_000 + + // MaximumAllowedTokenDataWaitTimePerBatch defines the maximum time that is allowed + // for the plugin to wait for token data to be fetched from external providers per batch. + MaximumAllowedTokenDataWaitTimePerBatch = 2 * time.Second + + // MessagesIterationStep limits number of messages fetched to memory at once when iterating through unexpired CommitRoots + MessagesIterationStep = 1024 +) + +var ( + _ types.ReportingPluginFactory = &ExecutionReportingPluginFactory{} + _ types.ReportingPlugin = &ExecutionReportingPlugin{} +) + +type ExecutionPluginStaticConfig struct { + lggr logger.Logger + onRampReader ccipdata.OnRampReader + offRampReader ccipdata.OffRampReader + commitStoreReader ccipdata.CommitStoreReader + sourcePriceRegistryProvider ccipdataprovider.PriceRegistry + sourceWrappedNativeToken cciptypes.Address + tokenDataWorker tokendata.Worker + destChainSelector uint64 + priceRegistryProvider ccipdataprovider.PriceRegistry // destination price registry provider. + tokenPoolBatchedReader batchreader.TokenPoolBatchedReader + metricsCollector ccip.PluginMetricsCollector + chainHealthcheck cache.ChainHealthcheck + newReportingPluginRetryConfig ccipdata.RetryConfig + txmStatusChecker statuschecker.CCIPTransactionStatusChecker +} + +type ExecutionReportingPlugin struct { + // Misc + F int + lggr logger.Logger + offchainConfig cciptypes.ExecOffchainConfig + tokenDataWorker tokendata.Worker + metricsCollector ccip.PluginMetricsCollector + batchingStrategy BatchingStrategy + + // Source + gasPriceEstimator prices.GasPriceEstimatorExec + sourcePriceRegistry ccipdata.PriceRegistryReader + sourcePriceRegistryProvider ccipdataprovider.PriceRegistry + sourcePriceRegistryLock sync.RWMutex + sourceWrappedNativeToken cciptypes.Address + onRampReader ccipdata.OnRampReader + + // Dest + commitStoreReader ccipdata.CommitStoreReader + destPriceRegistry ccipdata.PriceRegistryReader + destWrappedNative cciptypes.Address + onchainConfig cciptypes.ExecOnchainConfig + offRampReader ccipdata.OffRampReader + tokenPoolBatchedReader batchreader.TokenPoolBatchedReader + + // State + inflightReports *inflightExecReportsContainer + commitRootsCache cache.CommitsRootsCache + chainHealthcheck cache.ChainHealthcheck +} + +func (r *ExecutionReportingPlugin) Query(context.Context, types.ReportTimestamp) (types.Query, error) { + return types.Query{}, nil +} + +func (r *ExecutionReportingPlugin) Observation(ctx context.Context, timestamp types.ReportTimestamp, query types.Query) (types.Observation, error) { + lggr := r.lggr.Named("ExecutionObservation") + if healthy, err := r.chainHealthcheck.IsHealthy(ctx); err != nil { + return nil, err + } else if !healthy { + return nil, ccip.ErrChainIsNotHealthy + } + + // Ensure that the source price registry is synchronized with the onRamp. + if err := r.ensurePriceRegistrySynchronization(ctx); err != nil { + return nil, fmt.Errorf("ensuring price registry synchronization: %w", err) + } + + // Expire any inflight reports. + r.inflightReports.expire(lggr) + inFlight := r.inflightReports.getAll() + + executableObservations, err := r.getExecutableObservations(ctx, lggr, inFlight) + if err != nil { + return nil, err + } + // cap observations which fits MaxObservationLength (after serialized) + capped := sort.Search(len(executableObservations), func(i int) bool { + var encoded []byte + encoded, err = ccip.NewExecutionObservation(executableObservations[:i+1]).Marshal() + if err != nil { + // false makes Search keep looking to the right, always including any "erroring" ObservedMessage and allowing us to detect in the bottom + return false + } + return len(encoded) > ccip.MaxObservationLength + }) + if err != nil { + return nil, err + } + executableObservations = executableObservations[:capped] + r.metricsCollector.NumberOfMessagesProcessed(ccip.Observation, len(executableObservations)) + lggr.Infow("Observation", "executableMessages", executableObservations) + // Note can be empty + return ccip.NewExecutionObservation(executableObservations).Marshal() +} + +func (r *ExecutionReportingPlugin) getExecutableObservations(ctx context.Context, lggr logger.Logger, inflight []InflightInternalExecutionReport) ([]ccip.ObservedMessage, error) { + unexpiredReports, err := r.commitRootsCache.RootsEligibleForExecution(ctx) + if err != nil { + return nil, err + } + r.metricsCollector.UnexpiredCommitRoots(len(unexpiredReports)) + + if len(unexpiredReports) == 0 { + return []ccip.ObservedMessage{}, nil + } + + getExecTokenData := cache.LazyFunction[execTokenData](func() (execTokenData, error) { + return r.prepareTokenExecData(ctx) + }) + + for j := 0; j < len(unexpiredReports); { + unexpiredReportsPart, step := selectReportsToFillBatch(unexpiredReports[j:], MessagesIterationStep) + j += step + + unexpiredReportsWithSendReqs, err := r.getReportsWithSendRequests(ctx, unexpiredReportsPart) + if err != nil { + return nil, err + } + + for _, unexpiredReport := range unexpiredReportsWithSendReqs { + r.tokenDataWorker.AddJobsFromMsgs(ctx, unexpiredReport.sendRequestsWithMeta) + } + + for _, rep := range unexpiredReportsWithSendReqs { + if ctx.Err() != nil { + lggr.Warn("Processing of roots killed by context") + break + } + + merkleRoot := rep.commitReport.MerkleRoot + + rootLggr := lggr.With("root", hexutil.Encode(merkleRoot[:]), + "minSeqNr", rep.commitReport.Interval.Min, + "maxSeqNr", rep.commitReport.Interval.Max, + ) + + if err := rep.validate(); err != nil { + rootLggr.Errorw("Skipping invalid report", "err", err) + continue + } + + // If all messages are already executed and finalized, snooze the root for + // config.PermissionLessExecutionThresholdSeconds so it will never be considered again. + if allMsgsExecutedAndFinalized := rep.allRequestsAreExecutedAndFinalized(); allMsgsExecutedAndFinalized { + rootLggr.Infow("Snoozing root forever since there are no executable txs anymore", "root", hex.EncodeToString(merkleRoot[:])) + r.commitRootsCache.MarkAsExecuted(merkleRoot) + continue + } + + blessed, err := r.commitStoreReader.IsBlessed(ctx, merkleRoot) + if err != nil { + return nil, err + } + if !blessed { + rootLggr.Infow("Report is accepted but not blessed") + continue + } + + tokenExecData, err := getExecTokenData() + if err != nil { + return nil, err + } + + batch, msgExecStates := r.buildBatch( + ctx, + inflight, + rootLggr, + rep, + tokenExecData.rateLimiterTokenBucket.Tokens, + tokenExecData.sourceTokenPrices, + tokenExecData.destTokenPrices, + tokenExecData.gasPrice, + tokenExecData.sourceToDestTokens) + if len(batch) != 0 { + lggr.Infow("Execution batch created", "batchSize", len(batch), "messageStates", msgExecStates) + return batch, nil + } + r.commitRootsCache.Snooze(merkleRoot) + } + } + return []ccip.ObservedMessage{}, nil +} + +// Calculates a map that indicates whether a sequence number has already been executed. +// It doesn't matter if the execution succeeded, since we don't retry previous +// attempts even if they failed. Value in the map indicates whether the log is finalized or not. +func (r *ExecutionReportingPlugin) getExecutedSeqNrsInRange(ctx context.Context, min, max uint64) (map[uint64]bool, error) { + stateChanges, err := r.offRampReader.GetExecutionStateChangesBetweenSeqNums( + ctx, + min, + max, + int(r.offchainConfig.DestOptimisticConfirmations), + ) + if err != nil { + return nil, err + } + executedMp := make(map[uint64]bool, len(stateChanges)) + for _, stateChange := range stateChanges { + executedMp[stateChange.SequenceNumber] = stateChange.TxMeta.IsFinalized() + } + return executedMp, nil +} + +// Builds a batch of transactions that can be executed, takes into account +// the available gas, rate limiting, execution state, nonce state, and +// profitability of execution. +func (r *ExecutionReportingPlugin) buildBatch( + ctx context.Context, + inflight []InflightInternalExecutionReport, + lggr logger.Logger, + report commitReportWithSendRequests, + aggregateTokenLimit *big.Int, + sourceTokenPricesUSD map[cciptypes.Address]*big.Int, + destTokenPricesUSD map[cciptypes.Address]*big.Int, + gasPrice *big.Int, + sourceToDestToken map[cciptypes.Address]cciptypes.Address, +) ([]ccip.ObservedMessage, []messageExecStatus) { + // We assume that next observation will start after previous epoch transmission so nonces should be already updated onchain. + // Worst case scenario we will try to process the same message again, and it will be skipped but protocol would progress anyway. + // We don't use inflightCache here to avoid cases in which inflight cache keeps progressing but due to transmission failures + // previous reports are not included onchain. That can lead to issues with IncorrectNonce skips, + // because we enforce sequential processing per sender (per sender's nonce ordering is enforced by Offramp contract) + sendersNonce, err := r.offRampReader.ListSenderNonces(ctx, report.uniqueSenders()) + if err != nil { + lggr.Errorw("Fetching senders nonce", "err", err) + return []ccip.ObservedMessage{}, []messageExecStatus{} + } + + inflightAggregateValue, err := getInflightAggregateRateLimit(lggr, inflight, destTokenPricesUSD, sourceToDestToken) + if err != nil { + lggr.Errorw("Unexpected error computing inflight values", "err", err) + return []ccip.ObservedMessage{}, nil + } + + batchCtx := &BatchContext{ + report, + inflight, + inflightAggregateValue, + lggr, + MaxDataLenPerBatch, + uint64(r.offchainConfig.BatchGasLimit), + make(map[cciptypes.Address]uint64), + sendersNonce, + sourceTokenPricesUSD, + destTokenPricesUSD, + gasPrice, + sourceToDestToken, + aggregateTokenLimit, + MaximumAllowedTokenDataWaitTimePerBatch, + r.tokenDataWorker, + r.gasPriceEstimator, + r.destWrappedNative, + r.offchainConfig, + } + + return r.batchingStrategy.BuildBatch(ctx, batchCtx) +} + +func calculateMessageMaxGas(gasLimit *big.Int, numRequests, dataLen, numTokens int) (uint64, error) { + if !gasLimit.IsUint64() { + return 0, fmt.Errorf("gas limit %s cannot be casted to uint64", gasLimit) + } + + gasLimitU64 := gasLimit.Uint64() + gasOverHeadGas := maxGasOverHeadGas(numRequests, dataLen, numTokens) + messageMaxGas := gasLimitU64 + gasOverHeadGas + + if messageMaxGas < gasLimitU64 || messageMaxGas < gasOverHeadGas { + return 0, fmt.Errorf("message max gas overflow, gasLimit=%d gasOverHeadGas=%d", gasLimitU64, gasOverHeadGas) + } + + return messageMaxGas, nil +} + +// getReportsWithSendRequests returns the target reports with populated send requests. +func (r *ExecutionReportingPlugin) getReportsWithSendRequests( + ctx context.Context, + reports []cciptypes.CommitStoreReport, +) ([]commitReportWithSendRequests, error) { + if len(reports) == 0 { + return nil, nil + } + + // find interval from all the reports + intervalMin := reports[0].Interval.Min + intervalMax := reports[0].Interval.Max + for _, report := range reports[1:] { + if report.Interval.Max > intervalMax { + intervalMax = report.Interval.Max + } + if report.Interval.Min < intervalMin { + intervalMin = report.Interval.Min + } + } + + // use errgroup to fetch send request logs and executed sequence numbers in parallel + eg := &errgroup.Group{} + + var sendRequests []cciptypes.EVM2EVMMessageWithTxMeta + eg.Go(func() error { + // We don't need to double-check if logs are finalized because we already checked that in the Commit phase. + sendReqs, err := r.onRampReader.GetSendRequestsBetweenSeqNums(ctx, intervalMin, intervalMax, false) + if err != nil { + return err + } + sendRequests = sendReqs + return nil + }) + + var executedSeqNums map[uint64]bool + eg.Go(func() error { + // get executed sequence numbers + executedMp, err := r.getExecutedSeqNrsInRange(ctx, intervalMin, intervalMax) + if err != nil { + return err + } + executedSeqNums = executedMp + return nil + }) + + if err := eg.Wait(); err != nil { + return nil, err + } + + reportsWithSendReqs := make([]commitReportWithSendRequests, len(reports)) + for i, report := range reports { + reportsWithSendReqs[i] = commitReportWithSendRequests{ + commitReport: report, + sendRequestsWithMeta: make([]cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta, 0, report.Interval.Max-report.Interval.Min+1), + } + } + + for _, sendReq := range sendRequests { + // if value exists in the map then it's executed + // if value exists, and it's true then it's considered finalized + finalized, executed := executedSeqNums[sendReq.SequenceNumber] + + reqWithMeta := cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta{ + EVM2EVMMessage: sendReq.EVM2EVMMessage, + BlockTimestamp: time.UnixMilli(sendReq.BlockTimestampUnixMilli), + Executed: executed, + Finalized: finalized, + LogIndex: uint(sendReq.LogIndex), + TxHash: sendReq.TxHash, + } + + // attach the msg to the appropriate reports + for i := range reportsWithSendReqs { + if reportsWithSendReqs[i].sendReqFits(reqWithMeta) { + reportsWithSendReqs[i].sendRequestsWithMeta = append(reportsWithSendReqs[i].sendRequestsWithMeta, reqWithMeta) + } + } + } + + return reportsWithSendReqs, nil +} + +// Assumes non-empty report. Messages to execute can span more than one report, but are assumed to be in order of increasing +// sequence number. +func (r *ExecutionReportingPlugin) buildReport(ctx context.Context, lggr logger.Logger, observedMessages []ccip.ObservedMessage) ([]byte, error) { + if err := validateSeqNumbers(ctx, r.commitStoreReader, observedMessages); err != nil { + return nil, err + } + commitReport, err := getCommitReportForSeqNum(ctx, r.commitStoreReader, observedMessages[0].SeqNr) + if err != nil { + return nil, err + } + lggr.Infow("Building execution report", "observations", observedMessages, "merkleRoot", hexutil.Encode(commitReport.MerkleRoot[:]), "report", commitReport) + + sendReqsInRoot, _, tree, err := getProofData(ctx, r.onRampReader, commitReport.Interval) + if err != nil { + return nil, err + } + + // cap messages which fits MaxExecutionReportLength (after serialized) + capped := sort.Search(len(observedMessages), func(i int) bool { + report, err2 := buildExecutionReportForMessages(sendReqsInRoot, tree, commitReport.Interval, observedMessages[:i+1]) + if err2 != nil { + r.lggr.Errorw("build execution report", "err", err2) + return false + } + + encoded, err2 := r.offRampReader.EncodeExecutionReport(ctx, report) + if err2 != nil { + // false makes Search keep looking to the right, always including any "erroring" ObservedMessage and allowing us to detect in the bottom + return false + } + return len(encoded) > MaxExecutionReportLength + }) + + execReport, err := buildExecutionReportForMessages(sendReqsInRoot, tree, commitReport.Interval, observedMessages[:capped]) + if err != nil { + return nil, err + } + + encodedReport, err := r.offRampReader.EncodeExecutionReport(ctx, execReport) + if err != nil { + return nil, err + } + + if capped < len(observedMessages) { + lggr.Warnf( + "Capping report to fit MaxExecutionReportLength: msgsCount %d -> %d, bytes %d, bytesLimit %d", + len(observedMessages), capped, len(encodedReport), MaxExecutionReportLength, + ) + } + // Double check this verifies before sending. + valid, err := r.commitStoreReader.VerifyExecutionReport(ctx, execReport) + if err != nil { + return nil, errors.Wrap(err, "unable to verify") + } + if !valid { + return nil, errors.New("root does not verify") + } + if len(execReport.Messages) > 0 { + r.metricsCollector.NumberOfMessagesProcessed(ccip.Report, len(execReport.Messages)) + r.metricsCollector.SequenceNumber(ccip.Report, execReport.Messages[len(execReport.Messages)-1].SequenceNumber) + } + return encodedReport, nil +} + +func (r *ExecutionReportingPlugin) Report(ctx context.Context, timestamp types.ReportTimestamp, query types.Query, observations []types.AttributedObservation) (bool, types.Report, error) { + lggr := r.lggr.Named("ExecutionReport") + if healthy, err := r.chainHealthcheck.IsHealthy(ctx); err != nil { + return false, nil, err + } else if !healthy { + return false, nil, ccip.ErrChainIsNotHealthy + } + parsableObservations := ccip.GetParsableObservations[ccip.ExecutionObservation](lggr, observations) + // Need at least F+1 observations + if len(parsableObservations) <= r.F { + lggr.Warn("Non-empty observations <= F, need at least F+1 to continue") + return false, nil, nil + } + + observedMessages, err := calculateObservedMessagesConsensus(parsableObservations, r.F) + if err != nil { + return false, nil, err + } + if len(observedMessages) == 0 { + return false, nil, nil + } + + report, err := r.buildReport(ctx, lggr, observedMessages) + if err != nil { + return false, nil, err + } + lggr.Infow("Report", "executableObservations", observedMessages) + return true, report, nil +} + +type tallyKey struct { + seqNr uint64 + tokenDataHash [32]byte +} + +type tallyVal struct { + tally int + tokenData [][]byte +} + +func calculateObservedMessagesConsensus(observations []ccip.ExecutionObservation, f int) ([]ccip.ObservedMessage, error) { + tally := make(map[tallyKey]tallyVal) + for _, obs := range observations { + for seqNr, msgData := range obs.Messages { + tokenDataHash, err := hashutil.BytesOfBytesKeccak(msgData.TokenData) + if err != nil { + return nil, fmt.Errorf("bytes of bytes keccak: %w", err) + } + + key := tallyKey{seqNr: seqNr, tokenDataHash: tokenDataHash} + if val, ok := tally[key]; ok { + tally[key] = tallyVal{tally: val.tally + 1, tokenData: msgData.TokenData} + } else { + tally[key] = tallyVal{tally: 1, tokenData: msgData.TokenData} + } + } + } + + // We might have different token data for the same sequence number. + // For that purpose we want to keep the token data with the most occurrences. + seqNumTally := make(map[uint64]tallyVal) + + // order tally keys to make looping over the entries deterministic + tallyKeys := make([]tallyKey, 0, len(tally)) + for key := range tally { + tallyKeys = append(tallyKeys, key) + } + sort.Slice(tallyKeys, func(i, j int) bool { + return hex.EncodeToString(tallyKeys[i].tokenDataHash[:]) < hex.EncodeToString(tallyKeys[j].tokenDataHash[:]) + }) + + for _, key := range tallyKeys { + tallyInfo := tally[key] + existingTally, exists := seqNumTally[key.seqNr] + if tallyInfo.tally > f && (!exists || tallyInfo.tally > existingTally.tally) { + seqNumTally[key.seqNr] = tallyInfo + } + } + + finalSequenceNumbers := make([]ccip.ObservedMessage, 0, len(seqNumTally)) + for seqNr, tallyInfo := range seqNumTally { + finalSequenceNumbers = append(finalSequenceNumbers, ccip.NewObservedMessage(seqNr, tallyInfo.tokenData)) + } + // buildReport expects sorted sequence numbers (tally map is non-deterministic). + sort.Slice(finalSequenceNumbers, func(i, j int) bool { + return finalSequenceNumbers[i].SeqNr < finalSequenceNumbers[j].SeqNr + }) + return finalSequenceNumbers, nil +} + +func (r *ExecutionReportingPlugin) ShouldAcceptFinalizedReport(ctx context.Context, timestamp types.ReportTimestamp, report types.Report) (bool, error) { + lggr := r.lggr.Named("ShouldAcceptFinalizedReport") + execReport, err := r.offRampReader.DecodeExecutionReport(ctx, report) + if err != nil { + lggr.Errorw("Unable to decode report", "err", err) + return false, err + } + lggr = lggr.With("messageIDs", ccipcommon.GetMessageIDsAsHexString(execReport.Messages)) + + if healthy, err1 := r.chainHealthcheck.IsHealthy(ctx); err1 != nil { + return false, err1 + } else if !healthy { + return false, ccip.ErrChainIsNotHealthy + } + // If the first message is executed already, this execution report is stale, and we do not accept it. + stale, err := r.isStaleReport(ctx, execReport.Messages) + if err != nil { + return false, err + } + if stale { + lggr.Info("Execution report is stale") + return false, nil + } + // Else just assume in flight + if err = r.inflightReports.add(lggr, execReport.Messages); err != nil { + return false, err + } + if len(execReport.Messages) > 0 { + r.metricsCollector.SequenceNumber(ccip.ShouldAccept, execReport.Messages[len(execReport.Messages)-1].SequenceNumber) + } + lggr.Info("Accepting finalized report") + return true, nil +} + +func (r *ExecutionReportingPlugin) ShouldTransmitAcceptedReport(ctx context.Context, timestamp types.ReportTimestamp, report types.Report) (bool, error) { + lggr := r.lggr.Named("ShouldTransmitAcceptedReport") + execReport, err := r.offRampReader.DecodeExecutionReport(ctx, report) + if err != nil { + lggr.Errorw("Unable to decode report", "err", err) + return false, nil + } + lggr = lggr.With("messageIDs", ccipcommon.GetMessageIDsAsHexString(execReport.Messages)) + + if healthy, err1 := r.chainHealthcheck.IsHealthy(ctx); err1 != nil { + return false, err1 + } else if !healthy { + return false, ccip.ErrChainIsNotHealthy + } + // If report is not stale we transmit. + // When the executeTransmitter enqueues the tx for tx manager, + // we mark it as execution_sent, removing it from the set of inflight messages. + stale, err := r.isStaleReport(ctx, execReport.Messages) + if err != nil { + return false, err + } + if stale { + lggr.Info("Execution report is stale") + return false, nil + } + + lggr.Info("Transmitting finalized report") + return true, err +} + +func (r *ExecutionReportingPlugin) isStaleReport(ctx context.Context, messages []cciptypes.EVM2EVMMessage) (bool, error) { + if len(messages) == 0 { + return true, fmt.Errorf("messages are empty") + } + + // If the first message is executed already, this execution report is stale. + // Note the default execution state, including for arbitrary seq number not yet committed + // is ExecutionStateUntouched. + msgState, err := r.offRampReader.GetExecutionState(ctx, messages[0].SequenceNumber) + if err != nil { + return true, err + } + if state := cciptypes.MessageExecutionState(msgState); state == cciptypes.ExecutionStateFailure || state == cciptypes.ExecutionStateSuccess { + return true, nil + } + + return false, nil +} + +func (r *ExecutionReportingPlugin) Close() error { + return nil +} + +func getInflightAggregateRateLimit( + lggr logger.Logger, + inflight []InflightInternalExecutionReport, + destTokenPrices map[cciptypes.Address]*big.Int, + sourceToDest map[cciptypes.Address]cciptypes.Address, +) (*big.Int, error) { + inflightAggregateValue := big.NewInt(0) + + for _, rep := range inflight { + for _, message := range rep.messages { + msgValue, err := aggregateTokenValue(lggr, destTokenPrices, sourceToDest, message.TokenAmounts) + if err != nil { + return nil, err + } + inflightAggregateValue.Add(inflightAggregateValue, msgValue) + } + } + return inflightAggregateValue, nil +} + +// getTokensPrices returns token prices of the given price registry, +// price values are USD per 1e18 of smallest token denomination, in base units 1e18 (e.g. 5$ = 5e18 USD per 1e18 units). +// this function is used for price registry of both source and destination chains. +func getTokensPrices(ctx context.Context, priceRegistry ccipdata.PriceRegistryReader, tokens []cciptypes.Address) (map[cciptypes.Address]*big.Int, error) { + tokenPrices := make(map[cciptypes.Address]*big.Int) + + fetchedPrices, err := priceRegistry.GetTokenPrices(ctx, tokens) + if err != nil { + return nil, errors.Wrapf(err, "could not get token prices of %v", tokens) + } + + // price registry should always return a price per token ordered by input tokens + if len(fetchedPrices) != len(tokens) { + return nil, fmt.Errorf("token prices length exp=%d actual=%d", len(tokens), len(fetchedPrices)) + } + + for i, token := range tokens { + // price of a token can never be zero + if fetchedPrices[i].Value.BitLen() == 0 { + priceRegistryAddress, err := priceRegistry.Address(ctx) + if err != nil { + return nil, fmt.Errorf("get price registry address: %w", err) + } + return nil, fmt.Errorf("price of token %s is zero (price registry=%s)", token, priceRegistryAddress) + } + + // price registry should not report different price for the same token + price, exists := tokenPrices[token] + if exists && fetchedPrices[i].Value.Cmp(price) != 0 { + return nil, fmt.Errorf("price registry reported different prices (%s and %s) for the same token %s", + fetchedPrices[i].Value, price, token) + } + + tokenPrices[token] = fetchedPrices[i].Value + } + + return tokenPrices, nil +} + +type execTokenData struct { + rateLimiterTokenBucket cciptypes.TokenBucketRateLimit + sourceTokenPrices map[cciptypes.Address]*big.Int + destTokenPrices map[cciptypes.Address]*big.Int + sourceToDestTokens map[cciptypes.Address]cciptypes.Address + gasPrice *big.Int +} + +// prepareTokenExecData gather all the pre-execution data needed for token execution into a single lazy call. +// This is done to avoid fetching the data multiple times for each message. Additionally, most of the RPC calls +// within that function is cached, so it should be relatively fast and not require any RPC batching. +func (r *ExecutionReportingPlugin) prepareTokenExecData(ctx context.Context) (execTokenData, error) { + // This could result in slightly different values on each call as + // the function returns the allowed amount at the time of the last block. + // Since this will only increase over time, the highest observed value will + // always be the lower bound of what would be available on chain + // since we already account for inflight txs. + rateLimiterTokenBucket, err := r.offRampReader.CurrentRateLimiterState(ctx) + if err != nil { + return execTokenData{}, err + } + + sourceFeeTokens, err := r.sourcePriceRegistry.GetFeeTokens(ctx) + if err != nil { + return execTokenData{}, fmt.Errorf("get source fee tokens: %w", err) + } + sourceTokensPrices, err := getTokensPrices( + ctx, + r.sourcePriceRegistry, + ccipcommon.FlattenUniqueSlice( + sourceFeeTokens, + []cciptypes.Address{r.sourceWrappedNativeToken}, + ), + ) + if err != nil { + return execTokenData{}, err + } + + destFeeTokens, destBridgedTokens, err := ccipcommon.GetDestinationTokens(ctx, r.offRampReader, r.destPriceRegistry) + if err != nil { + return execTokenData{}, fmt.Errorf("get destination tokens: %w", err) + } + destTokenPrices, err := getTokensPrices( + ctx, + r.destPriceRegistry, + ccipcommon.FlattenUniqueSlice( + destFeeTokens, + destBridgedTokens, + []cciptypes.Address{r.destWrappedNative}, + ), + ) + if err != nil { + return execTokenData{}, err + } + + sourceToDestTokens, err := r.offRampReader.GetSourceToDestTokensMapping(ctx) + if err != nil { + return execTokenData{}, err + } + + gasPrice, err := r.gasPriceEstimator.GetGasPrice(ctx) + if err != nil { + return execTokenData{}, err + } + + return execTokenData{ + rateLimiterTokenBucket: rateLimiterTokenBucket, + sourceTokenPrices: sourceTokensPrices, + sourceToDestTokens: sourceToDestTokens, + destTokenPrices: destTokenPrices, + gasPrice: gasPrice, + }, nil +} + +// ensurePriceRegistrySynchronization ensures that the source price registry points to the same as the one configured on the onRamp. +// This is required since the price registry address on the onRamp can change over time. +func (r *ExecutionReportingPlugin) ensurePriceRegistrySynchronization(ctx context.Context) error { + needPriceRegistryUpdate := false + r.sourcePriceRegistryLock.RLock() + priceRegistryAddress, err := r.onRampReader.SourcePriceRegistryAddress(ctx) + if err != nil { + r.sourcePriceRegistryLock.RUnlock() + return fmt.Errorf("getting price registry from onramp: %w", err) + } + + currentPriceRegistryAddress := cciptypes.Address("") + if r.sourcePriceRegistry != nil { + currentPriceRegistryAddress, err = r.sourcePriceRegistry.Address(ctx) + if err != nil { + return fmt.Errorf("get current priceregistry address: %w", err) + } + } + + needPriceRegistryUpdate = r.sourcePriceRegistry == nil || priceRegistryAddress != currentPriceRegistryAddress + r.sourcePriceRegistryLock.RUnlock() + if !needPriceRegistryUpdate { + return nil + } + + // Update the price registry if required. + r.sourcePriceRegistryLock.Lock() + defer r.sourcePriceRegistryLock.Unlock() + + // Price registry address changed or not initialized yet, updating source price registry. + sourcePriceRegistry, err := r.sourcePriceRegistryProvider.NewPriceRegistryReader(ctx, priceRegistryAddress) + if err != nil { + return err + } + oldPriceRegistry := r.sourcePriceRegistry + r.sourcePriceRegistry = sourcePriceRegistry + // Close the old price registry + if oldPriceRegistry != nil { + if err1 := oldPriceRegistry.Close(); err1 != nil { + r.lggr.Warnw("failed to close old price registry", "err", err1) + } + } + return nil +} + +// selectReportsToFillBatch returns the reports to fill the message limit. Single Commit Root contains exactly (Interval.Max - Interval.Min + 1) messages. +// We keep adding reports until we reach the message limit. Please see the tests for more examples and edge cases. +// unexpiredReports have to be sorted by Interval.Min. Otherwise, the batching logic will not be efficient, +// because it picks messages and execution states based on the report[0].Interval.Min - report[len-1].Interval.Max range. +// Having unexpiredReports not sorted properly will lead to fetching more messages and execution states to the memory than the messagesLimit provided. +// However, logs from LogPoller are returned ordered by (block_number, log_index), so it should preserve the order of Interval.Min. +// Single CommitRoot can have up to 256 messages, with current MessagesIterationStep of 1024, it means processing 4 CommitRoots at once. +func selectReportsToFillBatch(unexpiredReports []cciptypes.CommitStoreReport, messagesLimit uint64) ([]cciptypes.CommitStoreReport, int) { + currentNumberOfMessages := uint64(0) + nbReports := 0 + for _, report := range unexpiredReports { + reportMsgCount := report.Interval.Max - report.Interval.Min + 1 + if currentNumberOfMessages+reportMsgCount > messagesLimit { + break + } + currentNumberOfMessages += reportMsgCount + nbReports++ + } + return unexpiredReports[:nbReports], nbReports +} diff --git a/core/services/ocr2/plugins/ccip/ccipexec/ocr2_test.go b/core/services/ocr2/plugins/ccip/ccipexec/ocr2_test.go new file mode 100644 index 00000000000..84cb73c6643 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/ccipexec/ocr2_test.go @@ -0,0 +1,1421 @@ +package ccipexec + +import ( + "bytes" + "context" + "encoding/json" + "math" + "math/big" + "reflect" + "sort" + "sync" + "testing" + "time" + + "github.com/cometbft/cometbft/libs/rand" + mapset "github.com/deckarep/golang-set/v2" + "github.com/ethereum/go-ethereum/common" + "github.com/pkg/errors" + "github.com/smartcontractkit/libocr/commontypes" + "github.com/smartcontractkit/libocr/offchainreporting2/types" + ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + "github.com/stretchr/testify/require" + + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + + lpMocks "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller/mocks" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils" + "github.com/smartcontractkit/chainlink/v2/core/logger" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/cache" + ccipcachemocks "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/cache/mocks" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipcalc" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/batchreader" + ccipdataprovidermocks "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/ccipdataprovider/mocks" + ccipdatamocks "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/mocks" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_0_0" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/prices" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/testhelpers" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/tokendata" + + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" +) + +func TestExecutionReportingPlugin_Observation(t *testing.T) { + testCases := []struct { + name string + commitStorePaused bool + sourceChainCursed bool + inflightReports []InflightInternalExecutionReport + unexpiredReports []cciptypes.CommitStoreReportWithTxMeta + sendRequests []cciptypes.EVM2EVMMessageWithTxMeta + executedSeqNums []uint64 + tokenPoolsMapping map[common.Address]common.Address + blessedRoots map[[32]byte]bool + senderNonce uint64 + rateLimiterState cciptypes.TokenBucketRateLimit + expErr bool + sourceChainHealthy bool + destChainHealthy bool + }{ + { + name: "commit store is down", + commitStorePaused: true, + sourceChainCursed: false, + sourceChainHealthy: true, + destChainHealthy: true, + expErr: true, + }, + { + name: "source chain is cursed", + commitStorePaused: false, + sourceChainCursed: true, + sourceChainHealthy: true, + destChainHealthy: true, + expErr: true, + }, + { + name: "source chain not healthy", + commitStorePaused: false, + sourceChainCursed: false, + sourceChainHealthy: false, + destChainHealthy: true, + expErr: true, + }, + { + name: "dest chain not healthy", + commitStorePaused: false, + sourceChainCursed: false, + sourceChainHealthy: true, + destChainHealthy: false, + expErr: true, + }, + { + name: "happy flow", + commitStorePaused: false, + sourceChainCursed: false, + sourceChainHealthy: true, + destChainHealthy: true, + inflightReports: []InflightInternalExecutionReport{}, + unexpiredReports: []cciptypes.CommitStoreReportWithTxMeta{ + { + CommitStoreReport: cciptypes.CommitStoreReport{ + Interval: cciptypes.CommitStoreInterval{Min: 10, Max: 12}, + MerkleRoot: [32]byte{123}, + }, + }, + }, + blessedRoots: map[[32]byte]bool{ + {123}: true, + }, + rateLimiterState: cciptypes.TokenBucketRateLimit{ + IsEnabled: false, + }, + tokenPoolsMapping: map[common.Address]common.Address{}, + senderNonce: 9, + sendRequests: []cciptypes.EVM2EVMMessageWithTxMeta{ + { + EVM2EVMMessage: cciptypes.EVM2EVMMessage{SequenceNumber: 10, GasLimit: big.NewInt(0)}, + }, + { + EVM2EVMMessage: cciptypes.EVM2EVMMessage{SequenceNumber: 11, GasLimit: big.NewInt(0)}, + }, + { + EVM2EVMMessage: cciptypes.EVM2EVMMessage{SequenceNumber: 12, GasLimit: big.NewInt(0)}, + }, + }, + }, + } + + ctx := testutils.Context(t) + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + p := &ExecutionReportingPlugin{} + p.inflightReports = newInflightExecReportsContainer(time.Minute) + p.inflightReports.reports = tc.inflightReports + p.lggr = logger.TestLogger(t) + p.tokenDataWorker = tokendata.NewBackgroundWorker( + make(map[cciptypes.Address]tokendata.Reader), 10, 5*time.Second, time.Hour) + p.metricsCollector = ccip.NoopMetricsCollector + + commitStoreReader := ccipdatamocks.NewCommitStoreReader(t) + commitStoreReader.On("IsDown", mock.Anything).Return(tc.commitStorePaused, nil).Maybe() + commitStoreReader.On("IsDestChainHealthy", mock.Anything).Return(tc.destChainHealthy, nil).Maybe() + // Blessed roots return true + for root, blessed := range tc.blessedRoots { + commitStoreReader.On("IsBlessed", mock.Anything, root).Return(blessed, nil).Maybe() + } + commitStoreReader.On("GetAcceptedCommitReportsGteTimestamp", ctx, mock.Anything, 0). + Return(tc.unexpiredReports, nil).Maybe() + p.commitStoreReader = commitStoreReader + + var executionEvents []cciptypes.ExecutionStateChangedWithTxMeta + for _, seqNum := range tc.executedSeqNums { + executionEvents = append(executionEvents, cciptypes.ExecutionStateChangedWithTxMeta{ + ExecutionStateChanged: cciptypes.ExecutionStateChanged{SequenceNumber: seqNum}, + }) + } + + offRamp, _ := testhelpers.NewFakeOffRamp(t) + offRamp.SetRateLimiterState(tc.rateLimiterState) + + tokenPoolBatchedReader, err := batchreader.NewEVMTokenPoolBatchedReader(p.lggr, 0, ccipcalc.EvmAddrToGeneric(offRamp.Address()), nil) + assert.NoError(t, err) + p.tokenPoolBatchedReader = tokenPoolBatchedReader + + mockOffRampReader := ccipdatamocks.NewOffRampReader(t) + mockOffRampReader.On("GetExecutionStateChangesBetweenSeqNums", ctx, mock.Anything, mock.Anything, 0). + Return(executionEvents, nil).Maybe() + mockOffRampReader.On("CurrentRateLimiterState", mock.Anything).Return(tc.rateLimiterState, nil).Maybe() + mockOffRampReader.On("Address", ctx).Return(cciptypes.Address(offRamp.Address().String()), nil).Maybe() + senderNonces := map[cciptypes.Address]uint64{ + cciptypes.Address(utils.RandomAddress().String()): tc.senderNonce, + } + mockOffRampReader.On("ListSenderNonces", mock.Anything, mock.Anything).Return(senderNonces, nil).Maybe() + mockOffRampReader.On("GetTokenPoolsRateLimits", ctx, []ccipdata.TokenPoolReader{}). + Return([]cciptypes.TokenBucketRateLimit{}, nil).Maybe() + + mockOffRampReader.On("GetSourceToDestTokensMapping", ctx).Return(nil, nil).Maybe() + mockOffRampReader.On("GetTokens", ctx).Return(cciptypes.OffRampTokens{ + DestinationTokens: []cciptypes.Address{}, + SourceTokens: []cciptypes.Address{}, + }, nil).Maybe() + p.offRampReader = mockOffRampReader + + mockOnRampReader := ccipdatamocks.NewOnRampReader(t) + mockOnRampReader.On("IsSourceCursed", ctx).Return(tc.sourceChainCursed, nil).Maybe() + mockOnRampReader.On("IsSourceChainHealthy", ctx).Return(tc.sourceChainHealthy, nil).Maybe() + mockOnRampReader.On("GetSendRequestsBetweenSeqNums", ctx, mock.Anything, mock.Anything, false). + Return(tc.sendRequests, nil).Maybe() + sourcePriceRegistryAddress := cciptypes.Address(utils.RandomAddress().String()) + mockOnRampReader.On("SourcePriceRegistryAddress", ctx).Return(sourcePriceRegistryAddress, nil).Maybe() + p.onRampReader = mockOnRampReader + + mockGasPriceEstimator := prices.NewMockGasPriceEstimatorExec(t) + mockGasPriceEstimator.On("GetGasPrice", ctx).Return(big.NewInt(1), nil).Maybe() + p.gasPriceEstimator = mockGasPriceEstimator + + destPriceRegReader := ccipdatamocks.NewPriceRegistryReader(t) + destPriceRegReader.On("GetTokenPrices", ctx, mock.Anything).Return( + []cciptypes.TokenPriceUpdate{{TokenPrice: cciptypes.TokenPrice{Token: ccipcalc.HexToAddress("0x1"), Value: big.NewInt(123)}, TimestampUnixSec: big.NewInt(time.Now().Unix())}}, nil).Maybe() + destPriceRegReader.On("Address", ctx).Return(cciptypes.Address(utils.RandomAddress().String()), nil).Maybe() + destPriceRegReader.On("GetFeeTokens", ctx).Return([]cciptypes.Address{}, nil).Maybe() + sourcePriceRegReader := ccipdatamocks.NewPriceRegistryReader(t) + sourcePriceRegReader.On("Address", ctx).Return(sourcePriceRegistryAddress, nil).Maybe() + sourcePriceRegReader.On("GetFeeTokens", ctx).Return([]cciptypes.Address{}, nil).Maybe() + sourcePriceRegReader.On("GetTokenPrices", ctx, mock.Anything).Return( + []cciptypes.TokenPriceUpdate{{TokenPrice: cciptypes.TokenPrice{Token: ccipcalc.HexToAddress("0x1"), Value: big.NewInt(123)}, TimestampUnixSec: big.NewInt(time.Now().Unix())}}, nil).Maybe() + p.destPriceRegistry = destPriceRegReader + + mockOnRampPriceRegistryProvider := ccipdataprovidermocks.NewPriceRegistry(t) + mockOnRampPriceRegistryProvider.On("NewPriceRegistryReader", ctx, sourcePriceRegistryAddress).Return(sourcePriceRegReader, nil).Maybe() + p.sourcePriceRegistryProvider = mockOnRampPriceRegistryProvider + + p.commitRootsCache = cache.NewCommitRootsCache(logger.TestLogger(t), commitStoreReader, time.Minute, time.Minute) + p.chainHealthcheck = cache.NewChainHealthcheck(p.lggr, mockOnRampReader, commitStoreReader) + + bs := &BestEffortBatchingStrategy{} + p.batchingStrategy = bs + + _, err = p.Observation(ctx, types.ReportTimestamp{}, types.Query{}) + if tc.expErr { + assert.Error(t, err) + return + } + assert.NoError(t, err) + }) + } +} + +func TestExecutionReportingPlugin_Report(t *testing.T) { + testCases := []struct { + name string + f int + committedSeqNum uint64 + observations []ccip.ExecutionObservation + + expectingSomeReport bool + expectedReport cciptypes.ExecReport + expectingSomeErr bool + }{ + { + name: "not enough observations to form consensus", + f: 5, + committedSeqNum: 5, + observations: []ccip.ExecutionObservation{ + {Messages: map[uint64]ccip.MsgData{3: {}, 4: {}}}, + {Messages: map[uint64]ccip.MsgData{3: {}, 4: {}}}, + }, + expectingSomeErr: false, + expectingSomeReport: false, + }, + { + name: "zero observations", + f: 0, + committedSeqNum: 5, + observations: []ccip.ExecutionObservation{}, + expectingSomeErr: false, + expectingSomeReport: false, + }, + } + + ctx := testutils.Context(t) + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + p := ExecutionReportingPlugin{} + p.lggr = logger.TestLogger(t) + p.F = tc.f + + p.commitStoreReader = ccipdatamocks.NewCommitStoreReader(t) + chainHealthcheck := ccipcachemocks.NewChainHealthcheck(t) + chainHealthcheck.On("IsHealthy", ctx).Return(true, nil) + p.chainHealthcheck = chainHealthcheck + + observations := make([]types.AttributedObservation, len(tc.observations)) + for i := range observations { + b, err := json.Marshal(tc.observations[i]) + assert.NoError(t, err) + observations[i] = types.AttributedObservation{Observation: b, Observer: commontypes.OracleID(i + 1)} + } + + _, _, err := p.Report(ctx, types.ReportTimestamp{}, types.Query{}, observations) + if tc.expectingSomeErr { + assert.Error(t, err) + return + } + assert.NoError(t, err) + }) + } +} + +func TestExecutionReportingPlugin_ShouldAcceptFinalizedReport(t *testing.T) { + msg := cciptypes.EVM2EVMMessage{ + SequenceNumber: 12, + FeeTokenAmount: big.NewInt(1e9), + Sender: cciptypes.Address(utils.RandomAddress().String()), + Nonce: 1, + GasLimit: big.NewInt(1), + Strict: false, + Receiver: cciptypes.Address(utils.RandomAddress().String()), + Data: nil, + TokenAmounts: nil, + FeeToken: cciptypes.Address(utils.RandomAddress().String()), + MessageID: [32]byte{}, + } + report := cciptypes.ExecReport{ + Messages: []cciptypes.EVM2EVMMessage{msg}, + OffchainTokenData: [][][]byte{{}}, + Proofs: [][32]byte{{}}, + ProofFlagBits: big.NewInt(1), + } + + encodedReport := encodeExecutionReport(t, report) + mockOffRampReader := ccipdatamocks.NewOffRampReader(t) + mockOffRampReader.On("DecodeExecutionReport", mock.Anything, encodedReport).Return(report, nil) + + chainHealthcheck := ccipcachemocks.NewChainHealthcheck(t) + chainHealthcheck.On("IsHealthy", mock.Anything).Return(true, nil) + + plugin := ExecutionReportingPlugin{ + offRampReader: mockOffRampReader, + lggr: logger.TestLogger(t), + inflightReports: newInflightExecReportsContainer(1 * time.Hour), + chainHealthcheck: chainHealthcheck, + metricsCollector: ccip.NoopMetricsCollector, + } + + mockedExecState := mockOffRampReader.On("GetExecutionState", mock.Anything, uint64(12)).Return(uint8(cciptypes.ExecutionStateUntouched), nil).Once() + + should, err := plugin.ShouldAcceptFinalizedReport(testutils.Context(t), ocrtypes.ReportTimestamp{}, encodedReport) + require.NoError(t, err) + assert.Equal(t, true, should) + + mockedExecState.Return(uint8(cciptypes.ExecutionStateSuccess), nil).Once() + + should, err = plugin.ShouldAcceptFinalizedReport(testutils.Context(t), ocrtypes.ReportTimestamp{}, encodedReport) + require.NoError(t, err) + assert.Equal(t, false, should) +} + +func TestExecutionReportingPlugin_ShouldTransmitAcceptedReport(t *testing.T) { + msg := cciptypes.EVM2EVMMessage{ + SequenceNumber: 12, + FeeTokenAmount: big.NewInt(1e9), + Sender: cciptypes.Address(utils.RandomAddress().String()), + Nonce: 1, + GasLimit: big.NewInt(1), + Strict: false, + Receiver: cciptypes.Address(utils.RandomAddress().String()), + Data: nil, + TokenAmounts: nil, + FeeToken: cciptypes.Address(utils.RandomAddress().String()), + MessageID: [32]byte{}, + } + report := cciptypes.ExecReport{ + Messages: []cciptypes.EVM2EVMMessage{msg}, + OffchainTokenData: [][][]byte{{}}, + Proofs: [][32]byte{{}}, + ProofFlagBits: big.NewInt(1), + } + encodedReport := encodeExecutionReport(t, report) + + mockCommitStoreReader := ccipdatamocks.NewCommitStoreReader(t) + mockOffRampReader := ccipdatamocks.NewOffRampReader(t) + mockOffRampReader.On("DecodeExecutionReport", mock.Anything, encodedReport).Return(report, nil) + mockedExecState := mockOffRampReader.On("GetExecutionState", mock.Anything, uint64(12)).Return(uint8(cciptypes.ExecutionStateUntouched), nil).Once() + + chainHealthcheck := ccipcachemocks.NewChainHealthcheck(t) + chainHealthcheck.On("IsHealthy", mock.Anything).Return(true, nil) + + plugin := ExecutionReportingPlugin{ + commitStoreReader: mockCommitStoreReader, + offRampReader: mockOffRampReader, + lggr: logger.TestLogger(t), + inflightReports: newInflightExecReportsContainer(1 * time.Hour), + chainHealthcheck: chainHealthcheck, + } + + should, err := plugin.ShouldTransmitAcceptedReport(testutils.Context(t), ocrtypes.ReportTimestamp{}, encodedReport) + require.NoError(t, err) + assert.Equal(t, true, should) + + mockedExecState.Return(uint8(cciptypes.ExecutionStateFailure), nil).Once() + should, err = plugin.ShouldTransmitAcceptedReport(testutils.Context(t), ocrtypes.ReportTimestamp{}, encodedReport) + require.NoError(t, err) + assert.Equal(t, false, should) +} + +func TestExecutionReportingPlugin_buildReport(t *testing.T) { + ctx := testutils.Context(t) + + const numMessages = 100 + const tokensPerMessage = 20 + const bytesPerMessage = 1000 + + executionReport := generateExecutionReport(t, numMessages, tokensPerMessage, bytesPerMessage) + encodedReport := encodeExecutionReport(t, executionReport) + // ensure "naive" full report would be bigger than limit + assert.Greater(t, len(encodedReport), MaxExecutionReportLength, "full execution report length") + + observations := make([]ccip.ObservedMessage, len(executionReport.Messages)) + for i, msg := range executionReport.Messages { + observations[i] = ccip.NewObservedMessage(msg.SequenceNumber, executionReport.OffchainTokenData[i]) + } + + // ensure that buildReport should cap the built report to fit in MaxExecutionReportLength + p := &ExecutionReportingPlugin{} + p.lggr = logger.TestLogger(t) + + commitStore := ccipdatamocks.NewCommitStoreReader(t) + commitStore.On("VerifyExecutionReport", mock.Anything, mock.Anything, mock.Anything).Return(true, nil) + commitStore.On("GetExpectedNextSequenceNumber", mock.Anything). + Return(executionReport.Messages[len(executionReport.Messages)-1].SequenceNumber+1, nil) + commitStore.On("GetCommitReportMatchingSeqNum", ctx, observations[0].SeqNr, 0). + Return([]cciptypes.CommitStoreReportWithTxMeta{ + { + CommitStoreReport: cciptypes.CommitStoreReport{ + Interval: cciptypes.CommitStoreInterval{ + Min: observations[0].SeqNr, + Max: observations[len(observations)-1].SeqNr, + }, + }, + }, + }, nil) + p.metricsCollector = ccip.NoopMetricsCollector + p.commitStoreReader = commitStore + + lp := lpMocks.NewLogPoller(t) + offRampReader, err := v1_0_0.NewOffRamp(logger.TestLogger(t), utils.RandomAddress(), nil, lp, nil, nil) + assert.NoError(t, err) + p.offRampReader = offRampReader + + sendReqs := make([]cciptypes.EVM2EVMMessageWithTxMeta, len(observations)) + sourceReader := ccipdatamocks.NewOnRampReader(t) + for i := range observations { + msg := cciptypes.EVM2EVMMessage{ + SourceChainSelector: math.MaxUint64, + SequenceNumber: uint64(i + 1), + FeeTokenAmount: big.NewInt(math.MaxInt64), + Sender: cciptypes.Address(utils.RandomAddress().String()), + Nonce: math.MaxUint64, + GasLimit: big.NewInt(math.MaxInt64), + Strict: false, + Receiver: cciptypes.Address(utils.RandomAddress().String()), + Data: bytes.Repeat([]byte{0}, bytesPerMessage), + TokenAmounts: nil, + FeeToken: cciptypes.Address(utils.RandomAddress().String()), + MessageID: [32]byte{12}, + } + sendReqs[i] = cciptypes.EVM2EVMMessageWithTxMeta{EVM2EVMMessage: msg} + } + sourceReader.On("GetSendRequestsBetweenSeqNums", + ctx, observations[0].SeqNr, observations[len(observations)-1].SeqNr, false).Return(sendReqs, nil) + p.onRampReader = sourceReader + + execReport, err := p.buildReport(ctx, p.lggr, observations) + assert.NoError(t, err) + assert.LessOrEqual(t, len(execReport), MaxExecutionReportLength, "built execution report length") +} + +func TestExecutionReportingPlugin_getReportsWithSendRequests(t *testing.T) { + testCases := []struct { + name string + reports []cciptypes.CommitStoreReport + expQueryMin uint64 // expected min/max used in the query to get ccipevents + expQueryMax uint64 + onchainEvents []cciptypes.EVM2EVMMessageWithTxMeta + destExecutedSeqNums []uint64 + + expReports []commitReportWithSendRequests + expErr bool + }{ + { + name: "no reports", + reports: nil, + expReports: nil, + expErr: false, + }, + { + name: "two reports happy flow", + reports: []cciptypes.CommitStoreReport{ + { + Interval: cciptypes.CommitStoreInterval{Min: 1, Max: 2}, + MerkleRoot: [32]byte{100}, + }, + { + Interval: cciptypes.CommitStoreInterval{Min: 3, Max: 3}, + MerkleRoot: [32]byte{200}, + }, + }, + expQueryMin: 1, + expQueryMax: 3, + onchainEvents: []cciptypes.EVM2EVMMessageWithTxMeta{ + {EVM2EVMMessage: cciptypes.EVM2EVMMessage{SequenceNumber: 1}}, + {EVM2EVMMessage: cciptypes.EVM2EVMMessage{SequenceNumber: 2}}, + {EVM2EVMMessage: cciptypes.EVM2EVMMessage{SequenceNumber: 3}}, + }, + destExecutedSeqNums: []uint64{1}, + expReports: []commitReportWithSendRequests{ + { + commitReport: cciptypes.CommitStoreReport{ + Interval: cciptypes.CommitStoreInterval{Min: 1, Max: 2}, + MerkleRoot: [32]byte{100}, + }, + sendRequestsWithMeta: []cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta{ + { + EVM2EVMMessage: cciptypes.EVM2EVMMessage{SequenceNumber: 1}, + Executed: true, + Finalized: true, + }, + { + EVM2EVMMessage: cciptypes.EVM2EVMMessage{SequenceNumber: 2}, + Executed: false, + Finalized: false, + }, + }, + }, + { + commitReport: cciptypes.CommitStoreReport{ + Interval: cciptypes.CommitStoreInterval{Min: 3, Max: 3}, + MerkleRoot: [32]byte{200}, + }, + sendRequestsWithMeta: []cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta{ + { + EVM2EVMMessage: cciptypes.EVM2EVMMessage{SequenceNumber: 3}, + Executed: false, + Finalized: false, + }, + }, + }, + }, + expErr: false, + }, + } + + ctx := testutils.Context(t) + lggr := logger.TestLogger(t) + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + p := &ExecutionReportingPlugin{} + p.lggr = lggr + + offRampReader := ccipdatamocks.NewOffRampReader(t) + p.offRampReader = offRampReader + + sourceReader := ccipdatamocks.NewOnRampReader(t) + sourceReader.On("GetSendRequestsBetweenSeqNums", ctx, tc.expQueryMin, tc.expQueryMax, false). + Return(tc.onchainEvents, nil).Maybe() + p.onRampReader = sourceReader + + finalized := make(map[uint64]cciptypes.FinalizedStatus) + for _, r := range tc.expReports { + for _, s := range r.sendRequestsWithMeta { + finalized[s.SequenceNumber] = cciptypes.FinalizedStatusNotFinalized + if s.Finalized { + finalized[s.SequenceNumber] = cciptypes.FinalizedStatusFinalized + } + } + } + + var executedEvents []cciptypes.ExecutionStateChangedWithTxMeta + for _, executedSeqNum := range tc.destExecutedSeqNums { + executedEvents = append(executedEvents, cciptypes.ExecutionStateChangedWithTxMeta{ + ExecutionStateChanged: cciptypes.ExecutionStateChanged{ + SequenceNumber: executedSeqNum, + }, + TxMeta: cciptypes.TxMeta{ + Finalized: finalized[executedSeqNum], + }, + }) + } + offRampReader.On("GetExecutionStateChangesBetweenSeqNums", ctx, tc.expQueryMin, tc.expQueryMax, 0).Return(executedEvents, nil).Maybe() + + populatedReports, err := p.getReportsWithSendRequests(ctx, tc.reports) + if tc.expErr { + assert.Error(t, err) + return + } + assert.NoError(t, err) + assert.Equal(t, len(tc.expReports), len(populatedReports)) + for i, expReport := range tc.expReports { + assert.Equal(t, len(expReport.sendRequestsWithMeta), len(populatedReports[i].sendRequestsWithMeta)) + for j, expReq := range expReport.sendRequestsWithMeta { + assert.Equal(t, expReq.Executed, populatedReports[i].sendRequestsWithMeta[j].Executed) + assert.Equal(t, expReq.Finalized, populatedReports[i].sendRequestsWithMeta[j].Finalized) + assert.Equal(t, expReq.SequenceNumber, populatedReports[i].sendRequestsWithMeta[j].SequenceNumber) + } + } + }) + } +} + +func Test_calculateObservedMessagesConsensus(t *testing.T) { + type args struct { + observations []ccip.ExecutionObservation + f int + } + tests := []struct { + name string + args args + want []ccip.ObservedMessage + }{ + { + name: "no observations", + args: args{ + observations: nil, + f: 0, + }, + want: []ccip.ObservedMessage{}, + }, + { + name: "common path", + args: args{ + observations: []ccip.ExecutionObservation{ + { + Messages: map[uint64]ccip.MsgData{ + 1: {TokenData: [][]byte{{0x1}, {0x1}, {0x1}}}, + 2: {TokenData: [][]byte{{0x2}, {0x2}, {0x2}}}, + }, + }, + { + Messages: map[uint64]ccip.MsgData{ + 1: {TokenData: [][]byte{{0x1}, {0x1}, {0xff}}}, // different token data - should not be picked + 2: {TokenData: [][]byte{{0x2}, {0x2}, {0x2}}}, + 3: {TokenData: [][]byte{{0x3}, {0x3}, {0x3}}}, + }, + }, + { + Messages: map[uint64]ccip.MsgData{ + 1: {TokenData: [][]byte{{0x1}, {0x1}, {0x1}}}, + 2: {TokenData: [][]byte{{0x2}, {0x2}, {0x2}}}, + }, + }, + }, + f: 1, + }, + want: []ccip.ObservedMessage{ + {SeqNr: 1, MsgData: ccip.MsgData{TokenData: [][]byte{{0x1}, {0x1}, {0x1}}}}, + {SeqNr: 2, MsgData: ccip.MsgData{TokenData: [][]byte{{0x2}, {0x2}, {0x2}}}}, + }, + }, + { + name: "similar token data", + args: args{ + observations: []ccip.ExecutionObservation{ + { + Messages: map[uint64]ccip.MsgData{ + 1: {TokenData: [][]byte{{0x1}, {0x1}, {0x1}}}, + }, + }, + { + Messages: map[uint64]ccip.MsgData{ + 1: {TokenData: [][]byte{{0x1}, {0x1, 0x1}}}, + }, + }, + { + Messages: map[uint64]ccip.MsgData{ + 1: {TokenData: [][]byte{{0x1}, {0x1, 0x1}}}, + }, + }, + }, + f: 1, + }, + want: []ccip.ObservedMessage{ + {SeqNr: 1, MsgData: ccip.MsgData{TokenData: [][]byte{{0x1}, {0x1, 0x1}}}}, + }, + }, + { + name: "results should be deterministic", + args: args{ + observations: []ccip.ExecutionObservation{ + {Messages: map[uint64]ccip.MsgData{1: {TokenData: [][]byte{{0x2}}}}}, + {Messages: map[uint64]ccip.MsgData{1: {TokenData: [][]byte{{0x2}}}}}, + {Messages: map[uint64]ccip.MsgData{1: {TokenData: [][]byte{{0x1}}}}}, + {Messages: map[uint64]ccip.MsgData{1: {TokenData: [][]byte{{0x3}}}}}, + {Messages: map[uint64]ccip.MsgData{1: {TokenData: [][]byte{{0x3}}}}}, + {Messages: map[uint64]ccip.MsgData{1: {TokenData: [][]byte{{0x1}}}}}, + }, + f: 1, + }, + want: []ccip.ObservedMessage{ + {SeqNr: 1, MsgData: ccip.MsgData{TokenData: [][]byte{{0x3}}}}, + }, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + res, err := calculateObservedMessagesConsensus( + tt.args.observations, + tt.args.f, + ) + assert.NoError(t, err) + sort.Slice(res, func(i, j int) bool { + return res[i].SeqNr < res[j].SeqNr + }) + assert.Equalf(t, tt.want, res, "calculateObservedMessagesConsensus(%v, %v)", tt.args.observations, tt.args.f) + }) + } +} + +func Test_getTokensPrices(t *testing.T) { + tk1 := ccipcalc.HexToAddress("1") + tk2 := ccipcalc.HexToAddress("2") + tk3 := ccipcalc.HexToAddress("3") + + testCases := []struct { + name string + feeTokens []cciptypes.Address + tokens []cciptypes.Address + retPrices []cciptypes.TokenPriceUpdate + expPrices map[cciptypes.Address]*big.Int + expErr bool + }{ + { + name: "base", + feeTokens: []cciptypes.Address{tk1, tk2}, + tokens: []cciptypes.Address{tk3}, + retPrices: []cciptypes.TokenPriceUpdate{ + {TokenPrice: cciptypes.TokenPrice{Value: big.NewInt(10)}}, + {TokenPrice: cciptypes.TokenPrice{Value: big.NewInt(20)}}, + {TokenPrice: cciptypes.TokenPrice{Value: big.NewInt(30)}}, + }, + expPrices: map[cciptypes.Address]*big.Int{ + tk1: big.NewInt(10), + tk2: big.NewInt(20), + tk3: big.NewInt(30), + }, + expErr: false, + }, + { + name: "token is both fee token and normal token", + feeTokens: []cciptypes.Address{tk1, tk2}, + tokens: []cciptypes.Address{tk3, tk1}, + retPrices: []cciptypes.TokenPriceUpdate{ + {TokenPrice: cciptypes.TokenPrice{Value: big.NewInt(10)}}, + {TokenPrice: cciptypes.TokenPrice{Value: big.NewInt(20)}}, + {TokenPrice: cciptypes.TokenPrice{Value: big.NewInt(30)}}, + {TokenPrice: cciptypes.TokenPrice{Value: big.NewInt(10)}}, + }, + expPrices: map[cciptypes.Address]*big.Int{ + tk1: big.NewInt(10), + tk2: big.NewInt(20), + tk3: big.NewInt(30), + }, + expErr: false, + }, + { + name: "token is both fee token and normal token and price registry gave different price", + feeTokens: []cciptypes.Address{tk1, tk2}, + tokens: []cciptypes.Address{tk3, tk1}, + retPrices: []cciptypes.TokenPriceUpdate{ + {TokenPrice: cciptypes.TokenPrice{Value: big.NewInt(10)}}, + {TokenPrice: cciptypes.TokenPrice{Value: big.NewInt(20)}}, + {TokenPrice: cciptypes.TokenPrice{Value: big.NewInt(30)}}, + {TokenPrice: cciptypes.TokenPrice{Value: big.NewInt(1000)}}, + }, + expErr: true, + }, + { + name: "contract returns less prices than requested", + feeTokens: []cciptypes.Address{tk1, tk2}, + tokens: []cciptypes.Address{tk3}, + retPrices: []cciptypes.TokenPriceUpdate{ + {TokenPrice: cciptypes.TokenPrice{Value: big.NewInt(10)}}, + {TokenPrice: cciptypes.TokenPrice{Value: big.NewInt(20)}}, + }, + expErr: true, + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + priceReg := ccipdatamocks.NewPriceRegistryReader(t) + priceReg.On("GetTokenPrices", mock.Anything, mock.Anything).Return(tc.retPrices, nil) + priceReg.On("Address", mock.Anything).Return(cciptypes.Address(utils.RandomAddress().String()), nil).Maybe() + + tokenPrices, err := getTokensPrices(context.Background(), priceReg, append(tc.feeTokens, tc.tokens...)) + if tc.expErr { + assert.Error(t, err) + return + } + + assert.NoError(t, err) + for tk, price := range tc.expPrices { + assert.Equal(t, price, tokenPrices[tk]) + } + }) + } +} + +func Test_calculateMessageMaxGas(t *testing.T) { + type args struct { + gasLimit *big.Int + numRequests int + dataLen int + numTokens int + } + tests := []struct { + name string + args args + want uint64 + wantErr bool + }{ + { + name: "base", + args: args{gasLimit: big.NewInt(1000), numRequests: 5, dataLen: 5, numTokens: 2}, + want: 826_336, + wantErr: false, + }, + { + name: "large", + args: args{gasLimit: big.NewInt(1000), numRequests: 1000, dataLen: 1000, numTokens: 1000}, + want: 346_485_176, + wantErr: false, + }, + { + name: "gas limit overflow", + args: args{gasLimit: big.NewInt(0).Mul(big.NewInt(math.MaxInt64), big.NewInt(math.MaxInt64))}, + want: 36_391_540, + wantErr: true, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + got, err := calculateMessageMaxGas(tt.args.gasLimit, tt.args.numRequests, tt.args.dataLen, tt.args.numTokens) + if tt.wantErr { + assert.Error(t, err) + return + } + assert.NoError(t, err) + assert.Equalf(t, tt.want, got, "calculateMessageMaxGas(%v, %v, %v, %v)", tt.args.gasLimit, tt.args.numRequests, tt.args.dataLen, tt.args.numTokens) + }) + } +} + +func Test_inflightAggregates(t *testing.T) { + const n = 10 + addrs := make([]cciptypes.Address, n) + tokenAddrs := make([]cciptypes.Address, n) + for i := range addrs { + addrs[i] = cciptypes.Address(utils.RandomAddress().String()) + tokenAddrs[i] = cciptypes.Address(utils.RandomAddress().String()) + } + lggr := logger.TestLogger(t) + + testCases := []struct { + name string + inflight []InflightInternalExecutionReport + destTokenPrices map[cciptypes.Address]*big.Int + sourceToDest map[cciptypes.Address]cciptypes.Address + + expInflightSeqNrs mapset.Set[uint64] + expInflightAggrVal *big.Int + expMaxInflightSenderNonces map[cciptypes.Address]uint64 + expInflightTokenAmounts map[cciptypes.Address]*big.Int + expErr bool + }{ + { + name: "base", + inflight: []InflightInternalExecutionReport{ + { + messages: []cciptypes.EVM2EVMMessage{ + { + Sender: addrs[0], + SequenceNumber: 100, + Nonce: 2, + TokenAmounts: []cciptypes.TokenAmount{ + {Token: tokenAddrs[0], Amount: big.NewInt(1e18)}, + {Token: tokenAddrs[0], Amount: big.NewInt(2e18)}, + }, + }, + { + Sender: addrs[0], + SequenceNumber: 106, + Nonce: 4, + TokenAmounts: []cciptypes.TokenAmount{ + {Token: tokenAddrs[0], Amount: big.NewInt(1e18)}, + {Token: tokenAddrs[0], Amount: big.NewInt(5e18)}, + {Token: tokenAddrs[2], Amount: big.NewInt(5e18)}, + }, + }, + }, + }, + }, + destTokenPrices: map[cciptypes.Address]*big.Int{ + tokenAddrs[1]: big.NewInt(1000), + tokenAddrs[3]: big.NewInt(500), + }, + sourceToDest: map[cciptypes.Address]cciptypes.Address{ + tokenAddrs[0]: tokenAddrs[1], + tokenAddrs[2]: tokenAddrs[3], + }, + expInflightSeqNrs: mapset.NewSet[uint64](100, 106), + expInflightAggrVal: big.NewInt(9*1000 + 5*500), + expMaxInflightSenderNonces: map[cciptypes.Address]uint64{ + addrs[0]: 4, + }, + expInflightTokenAmounts: map[cciptypes.Address]*big.Int{ + tokenAddrs[0]: big.NewInt(9e18), + tokenAddrs[2]: big.NewInt(5e18), + }, + expErr: false, + }, + { + name: "missing price should be 0", + inflight: []InflightInternalExecutionReport{ + { + messages: []cciptypes.EVM2EVMMessage{ + { + Sender: addrs[0], + SequenceNumber: 100, + Nonce: 2, + TokenAmounts: []cciptypes.TokenAmount{ + {Token: tokenAddrs[0], Amount: big.NewInt(1e18)}, + }, + }, + }, + }, + }, + destTokenPrices: map[cciptypes.Address]*big.Int{ + tokenAddrs[3]: big.NewInt(500), + }, + sourceToDest: map[cciptypes.Address]cciptypes.Address{ + tokenAddrs[2]: tokenAddrs[3], + }, + expInflightAggrVal: big.NewInt(0), + expErr: false, + }, + { + name: "nothing inflight", + inflight: []InflightInternalExecutionReport{}, + expInflightSeqNrs: mapset.NewSet[uint64](), + expInflightAggrVal: big.NewInt(0), + expMaxInflightSenderNonces: map[cciptypes.Address]uint64{}, + expInflightTokenAmounts: map[cciptypes.Address]*big.Int{}, + expErr: false, + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + inflightAggrVal, err := getInflightAggregateRateLimit( + lggr, + tc.inflight, + tc.destTokenPrices, + tc.sourceToDest, + ) + + if tc.expErr { + assert.Error(t, err) + return + } + assert.NoError(t, err) + assert.True(t, reflect.DeepEqual(tc.expInflightAggrVal, inflightAggrVal)) + }) + } +} + +func Test_commitReportWithSendRequests_validate(t *testing.T) { + testCases := []struct { + name string + reportInterval cciptypes.CommitStoreInterval + numReqs int + expValid bool + }{ + { + name: "valid report", + reportInterval: cciptypes.CommitStoreInterval{Min: 10, Max: 20}, + numReqs: 11, + expValid: true, + }, + { + name: "report with one request", + reportInterval: cciptypes.CommitStoreInterval{Min: 1234, Max: 1234}, + numReqs: 1, + expValid: true, + }, + { + name: "request is missing", + reportInterval: cciptypes.CommitStoreInterval{Min: 1234, Max: 1234}, + numReqs: 0, + expValid: false, + }, + { + name: "requests are missing", + reportInterval: cciptypes.CommitStoreInterval{Min: 1, Max: 10}, + numReqs: 5, + expValid: false, + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + rep := commitReportWithSendRequests{ + commitReport: cciptypes.CommitStoreReport{ + Interval: tc.reportInterval, + }, + sendRequestsWithMeta: make([]cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta, tc.numReqs), + } + err := rep.validate() + isValid := err == nil + assert.Equal(t, tc.expValid, isValid) + }) + } +} + +func Test_commitReportWithSendRequests_allRequestsAreExecutedAndFinalized(t *testing.T) { + testCases := []struct { + name string + reqs []cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta + expRes bool + }{ + { + name: "all requests executed and finalized", + reqs: []cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta{ + {Executed: true, Finalized: true}, + {Executed: true, Finalized: true}, + {Executed: true, Finalized: true}, + }, + expRes: true, + }, + { + name: "true when there are zero requests", + reqs: []cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta{}, + expRes: true, + }, + { + name: "some request not executed", + reqs: []cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta{ + {Executed: true, Finalized: true}, + {Executed: true, Finalized: true}, + {Executed: false, Finalized: true}, + }, + expRes: false, + }, + { + name: "some request not finalized", + reqs: []cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta{ + {Executed: true, Finalized: true}, + {Executed: true, Finalized: true}, + {Executed: true, Finalized: false}, + }, + expRes: false, + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + rep := commitReportWithSendRequests{sendRequestsWithMeta: tc.reqs} + res := rep.allRequestsAreExecutedAndFinalized() + assert.Equal(t, tc.expRes, res) + }) + } +} + +func Test_commitReportWithSendRequests_sendReqFits(t *testing.T) { + testCases := []struct { + name string + req cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta + report cciptypes.CommitStoreReport + expRes bool + }{ + { + name: "all requests executed and finalized", + req: cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta{ + EVM2EVMMessage: cciptypes.EVM2EVMMessage{SequenceNumber: 1}, + }, + report: cciptypes.CommitStoreReport{ + Interval: cciptypes.CommitStoreInterval{Min: 1, Max: 10}, + }, + expRes: true, + }, + { + name: "all requests executed and finalized", + req: cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta{ + EVM2EVMMessage: cciptypes.EVM2EVMMessage{SequenceNumber: 10}, + }, + report: cciptypes.CommitStoreReport{ + Interval: cciptypes.CommitStoreInterval{Min: 1, Max: 10}, + }, + expRes: true, + }, + { + name: "all requests executed and finalized", + req: cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta{ + EVM2EVMMessage: cciptypes.EVM2EVMMessage{SequenceNumber: 11}, + }, + report: cciptypes.CommitStoreReport{ + Interval: cciptypes.CommitStoreInterval{Min: 1, Max: 10}, + }, + expRes: false, + }, + { + name: "all requests executed and finalized", + req: cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta{ + EVM2EVMMessage: cciptypes.EVM2EVMMessage{SequenceNumber: 10}, + }, + report: cciptypes.CommitStoreReport{ + Interval: cciptypes.CommitStoreInterval{Min: 10, Max: 10}, + }, + expRes: true, + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + r := &commitReportWithSendRequests{commitReport: tc.report} + assert.Equal(t, tc.expRes, r.sendReqFits(tc.req)) + }) + } +} + +// generateExecutionReport generates an execution report that can be used in tests +func generateExecutionReport(t *testing.T, numMsgs, tokensPerMsg, bytesPerMsg int) cciptypes.ExecReport { + messages := make([]cciptypes.EVM2EVMMessage, numMsgs) + + randAddr := func() cciptypes.Address { + return cciptypes.Address(utils.RandomAddress().String()) + } + + offChainTokenData := make([][][]byte, numMsgs) + for i := range messages { + tokenAmounts := make([]cciptypes.TokenAmount, tokensPerMsg) + for j := range tokenAmounts { + tokenAmounts[j] = cciptypes.TokenAmount{ + Token: randAddr(), + Amount: big.NewInt(math.MaxInt64), + } + } + + messages[i] = cciptypes.EVM2EVMMessage{ + SourceChainSelector: rand.Uint64(), + SequenceNumber: uint64(i + 1), + FeeTokenAmount: big.NewInt(rand.Int64()), + Sender: randAddr(), + Nonce: rand.Uint64(), + GasLimit: big.NewInt(rand.Int64()), + Strict: false, + Receiver: randAddr(), + Data: bytes.Repeat([]byte{1}, bytesPerMsg), + TokenAmounts: tokenAmounts, + FeeToken: randAddr(), + MessageID: utils.RandomBytes32(), + } + + data := []byte(`{"foo": "bar"}`) + offChainTokenData[i] = [][]byte{data, data, data} + } + + return cciptypes.ExecReport{ + Messages: messages, + OffchainTokenData: offChainTokenData, + Proofs: make([][32]byte, numMsgs), + ProofFlagBits: big.NewInt(rand.Int64()), + } +} + +func Test_selectReportsToFillBatch(t *testing.T) { + tests := []struct { + name string + messagesLimit uint64 // maximum number of messages that can be included in a batch. + expectedBatches int // expected number of batches. + expectedReports int // expected number of selected reports. + }{ + { + name: "pick all at once when messages limit is high", + messagesLimit: 5000, + expectedBatches: 1, + expectedReports: 10, + }, + { + name: "pick none when messages limit is below commit report size", + messagesLimit: 199, + expectedBatches: 0, + expectedReports: 0, + }, + { + name: "pick exactly the number in each report", + messagesLimit: 200, + expectedBatches: 10, + expectedReports: 10, + }, + { + name: "messages limit larger than individual reports", + messagesLimit: 300, + expectedBatches: 10, + expectedReports: 10, + }, + { + name: "messages limit larger than several reports", + messagesLimit: 650, + expectedBatches: 4, + expectedReports: 10, + }, + { + name: "default limit", + messagesLimit: 1024, + expectedBatches: 2, + expectedReports: 10, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + nbCommitStoreReports := 10 + nbMsgPerRoot := 200 + + var reports []cciptypes.CommitStoreReport + for i := 0; i < nbCommitStoreReports; i++ { + reports = append(reports, cciptypes.CommitStoreReport{Interval: cciptypes.CommitStoreInterval{Min: uint64(i * nbMsgPerRoot), Max: uint64((i+1)*nbMsgPerRoot - 1)}}) + } + + var unexpiredReportsBatches [][]cciptypes.CommitStoreReport + for i := 0; i < len(reports); { + unexpiredReports, step := selectReportsToFillBatch(reports[i:], tt.messagesLimit) + if step == 0 { + break + } + unexpiredReportsBatches = append(unexpiredReportsBatches, unexpiredReports) + i += step + } + assert.Len(t, unexpiredReportsBatches, tt.expectedBatches) + + var flatten []cciptypes.CommitStoreReport + for _, r := range unexpiredReportsBatches { + flatten = append(flatten, r...) + } + assert.Equal(t, tt.expectedReports, len(flatten)) + if tt.expectedBatches > 0 { + assert.Equal(t, reports, flatten) + } else { + assert.Empty(t, flatten) + } + }) + } +} + +func Test_prepareTokenExecData(t *testing.T) { + ctx := testutils.Context(t) + + weth := cciptypes.Address(utils.RandomAddress().String()) + wavax := cciptypes.Address(utils.RandomAddress().String()) + link := cciptypes.Address(utils.RandomAddress().String()) + usdc := cciptypes.Address(utils.RandomAddress().String()) + + wethPriceUpdate := cciptypes.TokenPriceUpdate{TokenPrice: cciptypes.TokenPrice{Token: weth, Value: big.NewInt(2e18)}} + wavaxPriceUpdate := cciptypes.TokenPriceUpdate{TokenPrice: cciptypes.TokenPrice{Token: wavax, Value: big.NewInt(3e18)}} + linkPriceUpdate := cciptypes.TokenPriceUpdate{TokenPrice: cciptypes.TokenPrice{Token: link, Value: big.NewInt(4e18)}} + usdcPriceUpdate := cciptypes.TokenPriceUpdate{TokenPrice: cciptypes.TokenPrice{Token: usdc, Value: big.NewInt(5e18)}} + + tokenPrices := map[cciptypes.Address]cciptypes.TokenPriceUpdate{weth: wethPriceUpdate, wavax: wavaxPriceUpdate, link: linkPriceUpdate, usdc: usdcPriceUpdate} + + tests := []struct { + name string + sourceFeeTokens []cciptypes.Address + sourceFeeTokensErr error + destTokens []cciptypes.Address + destTokensErr error + destFeeTokens []cciptypes.Address + destFeeTokensErr error + sourcePrices []cciptypes.TokenPriceUpdate + destPrices []cciptypes.TokenPriceUpdate + }{ + { + name: "only native token", + sourcePrices: []cciptypes.TokenPriceUpdate{wethPriceUpdate}, + destPrices: []cciptypes.TokenPriceUpdate{wavaxPriceUpdate}, + }, + { + name: "additional dest fee token", + destFeeTokens: []cciptypes.Address{link}, + sourcePrices: []cciptypes.TokenPriceUpdate{wethPriceUpdate}, + destPrices: []cciptypes.TokenPriceUpdate{linkPriceUpdate, wavaxPriceUpdate}, + }, + { + name: "dest tokens", + destTokens: []cciptypes.Address{link, usdc}, + sourcePrices: []cciptypes.TokenPriceUpdate{wethPriceUpdate}, + destPrices: []cciptypes.TokenPriceUpdate{linkPriceUpdate, usdcPriceUpdate, wavaxPriceUpdate}, + }, + { + name: "source fee tokens", + sourceFeeTokens: []cciptypes.Address{usdc}, + sourcePrices: []cciptypes.TokenPriceUpdate{usdcPriceUpdate, wethPriceUpdate}, + destPrices: []cciptypes.TokenPriceUpdate{wavaxPriceUpdate}, + }, + { + name: "source, dest and fee tokens", + sourceFeeTokens: []cciptypes.Address{usdc}, + destTokens: []cciptypes.Address{link}, + destFeeTokens: []cciptypes.Address{usdc}, + sourcePrices: []cciptypes.TokenPriceUpdate{usdcPriceUpdate, wethPriceUpdate}, + destPrices: []cciptypes.TokenPriceUpdate{usdcPriceUpdate, linkPriceUpdate, wavaxPriceUpdate}, + }, + { + name: "source, dest and fee tokens with duplicates", + sourceFeeTokens: []cciptypes.Address{link, weth}, + destTokens: []cciptypes.Address{link, wavax}, + destFeeTokens: []cciptypes.Address{link, wavax}, + sourcePrices: []cciptypes.TokenPriceUpdate{linkPriceUpdate, wethPriceUpdate}, + destPrices: []cciptypes.TokenPriceUpdate{linkPriceUpdate, wavaxPriceUpdate}, + }, + { + name: "everything fails when source fails", + sourceFeeTokensErr: errors.New("source error"), + }, + { + name: "everything fails when dest fee fails", + destFeeTokensErr: errors.New("dest fee error"), + }, + { + name: "everything fails when dest fails", + destTokensErr: errors.New("dest error"), + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + onrampReader := ccipdatamocks.NewOnRampReader(t) + offrampReader := ccipdatamocks.NewOffRampReader(t) + sourcePriceRegistry := ccipdatamocks.NewPriceRegistryReader(t) + destPriceRegistry := ccipdatamocks.NewPriceRegistryReader(t) + gasPriceEstimator := prices.NewMockGasPriceEstimatorExec(t) + sourcePriceRegistryProvider := ccipdataprovidermocks.NewPriceRegistry(t) + + sourcePriceRegistryAddress := cciptypes.Address(utils.RandomAddress().String()) + onrampReader.On("SourcePriceRegistryAddress", ctx).Return(sourcePriceRegistryAddress, nil).Maybe() + offrampReader.On("CurrentRateLimiterState", ctx).Return(cciptypes.TokenBucketRateLimit{}, nil).Maybe() + offrampReader.On("GetSourceToDestTokensMapping", ctx).Return(map[cciptypes.Address]cciptypes.Address{}, nil).Maybe() + gasPriceEstimator.On("GetGasPrice", ctx).Return(big.NewInt(1e9), nil).Maybe() + + offrampReader.On("GetTokens", ctx).Return(cciptypes.OffRampTokens{DestinationTokens: tt.destTokens}, tt.destTokensErr).Maybe() + sourcePriceRegistry.On("Address", mock.Anything).Return(sourcePriceRegistryAddress, nil).Maybe() + sourcePriceRegistry.On("GetFeeTokens", ctx).Return(tt.sourceFeeTokens, tt.sourceFeeTokensErr).Maybe() + sourcePriceRegistry.On("GetTokenPrices", ctx, mock.Anything).Return(tt.sourcePrices, nil).Maybe() + destPriceRegistry.On("GetFeeTokens", ctx).Return(tt.destFeeTokens, tt.destFeeTokensErr).Maybe() + destPriceRegistry.On("GetTokenPrices", ctx, mock.Anything).Return(tt.destPrices, nil).Maybe() + + sourcePriceRegistryProvider.On("NewPriceRegistryReader", ctx, sourcePriceRegistryAddress).Return(sourcePriceRegistry, nil).Maybe() + + reportingPlugin := ExecutionReportingPlugin{ + onRampReader: onrampReader, + offRampReader: offrampReader, + sourcePriceRegistry: sourcePriceRegistry, + sourcePriceRegistryProvider: sourcePriceRegistryProvider, + destPriceRegistry: destPriceRegistry, + gasPriceEstimator: gasPriceEstimator, + sourceWrappedNativeToken: weth, + destWrappedNative: wavax, + } + + tokenData, err := reportingPlugin.prepareTokenExecData(ctx) + if tt.destFeeTokensErr != nil || tt.sourceFeeTokensErr != nil || tt.destTokensErr != nil { + require.Error(t, err) + return + } + + require.NoError(t, err) + assert.Len(t, tokenData.sourceTokenPrices, len(tt.sourcePrices)) + assert.Len(t, tokenData.destTokenPrices, len(tt.destPrices)) + + for token, price := range tokenData.sourceTokenPrices { + assert.Equal(t, tokenPrices[token].Value, price) + } + + for token, price := range tokenData.destTokenPrices { + assert.Equal(t, tokenPrices[token].Value, price) + } + }) + } +} + +func encodeExecutionReport(t *testing.T, report cciptypes.ExecReport) []byte { + reader, err := v1_2_0.NewOffRamp(logger.TestLogger(t), utils.RandomAddress(), nil, nil, nil, nil) + require.NoError(t, err) + ctx := testutils.Context(t) + encodedReport, err := reader.EncodeExecutionReport(ctx, report) + require.NoError(t, err) + return encodedReport +} + +// Verify the price registry update mechanism in case of configuration change on the source onRamp. +func TestExecutionReportingPlugin_ensurePriceRegistrySynchronization(t *testing.T) { + p := &ExecutionReportingPlugin{} + p.lggr = logger.TestLogger(t) + p.sourcePriceRegistryLock = sync.RWMutex{} + + sourcePriceRegistryAddress1 := cciptypes.Address(utils.RandomAddress().String()) + sourcePriceRegistryAddress2 := cciptypes.Address(utils.RandomAddress().String()) + + mockPriceRegistryReader1 := ccipdatamocks.NewPriceRegistryReader(t) + mockPriceRegistryReader2 := ccipdatamocks.NewPriceRegistryReader(t) + mockPriceRegistryReader1.On("Address", mock.Anything).Return(sourcePriceRegistryAddress1, nil) + mockPriceRegistryReader2.On("Address", mock.Anything).Return(sourcePriceRegistryAddress2, nil).Maybe() + mockPriceRegistryReader1.On("Close", mock.Anything).Return(nil) + mockPriceRegistryReader2.On("Close", mock.Anything).Return(nil).Maybe() + + mockSourcePriceRegistryProvider := ccipdataprovidermocks.NewPriceRegistry(t) + mockSourcePriceRegistryProvider.On("NewPriceRegistryReader", mock.Anything, sourcePriceRegistryAddress1).Return(mockPriceRegistryReader1, nil) + mockSourcePriceRegistryProvider.On("NewPriceRegistryReader", mock.Anything, sourcePriceRegistryAddress2).Return(mockPriceRegistryReader2, nil) + p.sourcePriceRegistryProvider = mockSourcePriceRegistryProvider + + mockOnRampReader := ccipdatamocks.NewOnRampReader(t) + p.onRampReader = mockOnRampReader + + mockOnRampReader.On("SourcePriceRegistryAddress", mock.Anything).Return(sourcePriceRegistryAddress1, nil).Once() + require.Equal(t, nil, p.sourcePriceRegistry) + err := p.ensurePriceRegistrySynchronization(context.Background()) + require.NoError(t, err) + require.Equal(t, mockPriceRegistryReader1, p.sourcePriceRegistry) + + mockOnRampReader.On("SourcePriceRegistryAddress", mock.Anything).Return(sourcePriceRegistryAddress2, nil).Once() + err = p.ensurePriceRegistrySynchronization(context.Background()) + require.NoError(t, err) + require.Equal(t, mockPriceRegistryReader2, p.sourcePriceRegistry) +} diff --git a/core/services/ocr2/plugins/ccip/clo_ccip_integration_test.go b/core/services/ocr2/plugins/ccip/clo_ccip_integration_test.go new file mode 100644 index 00000000000..0a7594324bd --- /dev/null +++ b/core/services/ocr2/plugins/ccip/clo_ccip_integration_test.go @@ -0,0 +1,155 @@ +package ccip_test + +import ( + "context" + "encoding/json" + "math/big" + "testing" + + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip" + + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/router" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/mock_v3_aggregator_contract" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/config" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/testhelpers" + integrationtesthelpers "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/testhelpers/integration" +) + +func Test_CLOSpecApprovalFlow_pipeline(t *testing.T) { + ccipTH := integrationtesthelpers.SetupCCIPIntegrationTH( + t, + testhelpers.SourceChainID, + testhelpers.SourceChainSelector, + testhelpers.DestChainID, + testhelpers.DestChainSelector, + ccip.DefaultSourceFinalityDepth, + ccip.DefaultDestFinalityDepth, + ) + + tokenPricesUSDPipeline, linkUSD, ethUSD := ccipTH.CreatePricesPipeline(t) + defer linkUSD.Close() + defer ethUSD.Close() + + test_CLOSpecApprovalFlow(t, ccipTH, tokenPricesUSDPipeline, "") +} + +func Test_CLOSpecApprovalFlow_dynamicPriceGetter(t *testing.T) { + ccipTH := integrationtesthelpers.SetupCCIPIntegrationTH( + t, + testhelpers.SourceChainID, + testhelpers.SourceChainSelector, + testhelpers.DestChainID, + testhelpers.DestChainSelector, + ccip.DefaultSourceFinalityDepth, + ccip.DefaultDestFinalityDepth, + ) + + //Set up the aggregators here to avoid modifying ccipTH. + dstLinkAddr := ccipTH.Dest.LinkToken.Address() + srcNativeAddr, err := ccipTH.Source.Router.GetWrappedNative(nil) + require.NoError(t, err) + aggDstNativeAddr := ccipTH.Dest.WrappedNative.Address() + + aggSrcNatAddr, _, aggSrcNat, err := mock_v3_aggregator_contract.DeployMockV3AggregatorContract(ccipTH.Source.User, ccipTH.Source.Chain, 18, big.NewInt(2e18)) + require.NoError(t, err) + _, err = aggSrcNat.UpdateRoundData(ccipTH.Source.User, big.NewInt(50), big.NewInt(17000000), big.NewInt(1000), big.NewInt(1000)) + require.NoError(t, err) + ccipTH.Source.Chain.Commit() + + aggDstLnkAddr, _, aggDstLnk, err := mock_v3_aggregator_contract.DeployMockV3AggregatorContract(ccipTH.Dest.User, ccipTH.Dest.Chain, 18, big.NewInt(3e18)) + require.NoError(t, err) + ccipTH.Dest.Chain.Commit() + _, err = aggDstLnk.UpdateRoundData(ccipTH.Dest.User, big.NewInt(50), big.NewInt(8000000), big.NewInt(1000), big.NewInt(1000)) + require.NoError(t, err) + ccipTH.Dest.Chain.Commit() + + // Check content is ok on aggregator. + tmp, err := aggDstLnk.LatestRoundData(&bind.CallOpts{}) + require.NoError(t, err) + require.Equal(t, big.NewInt(50), tmp.RoundId) + require.Equal(t, big.NewInt(8000000), tmp.Answer) + + // deploy dest wrapped native aggregator + aggDstNativeAggrAddr, _, aggDstNativeAggr, err := mock_v3_aggregator_contract.DeployMockV3AggregatorContract(ccipTH.Dest.User, ccipTH.Dest.Chain, 18, big.NewInt(3e18)) + require.NoError(t, err) + ccipTH.Dest.Chain.Commit() + _, err = aggDstNativeAggr.UpdateRoundData(ccipTH.Dest.User, big.NewInt(50), big.NewInt(500000), big.NewInt(1000), big.NewInt(1000)) + require.NoError(t, err) + ccipTH.Dest.Chain.Commit() + + priceGetterConfig := config.DynamicPriceGetterConfig{ + AggregatorPrices: map[common.Address]config.AggregatorPriceConfig{ + srcNativeAddr: { + ChainID: ccipTH.Source.ChainID, + AggregatorContractAddress: aggSrcNatAddr, + }, + dstLinkAddr: { + ChainID: ccipTH.Dest.ChainID, + AggregatorContractAddress: aggDstLnkAddr, + }, + aggDstNativeAddr: { + ChainID: ccipTH.Dest.ChainID, + AggregatorContractAddress: aggDstNativeAggrAddr, + }, + }, + StaticPrices: map[common.Address]config.StaticPriceConfig{}, + } + priceGetterConfigBytes, err := json.MarshalIndent(priceGetterConfig, "", " ") + require.NoError(t, err) + priceGetterConfigJson := string(priceGetterConfigBytes) + + test_CLOSpecApprovalFlow(t, ccipTH, "", priceGetterConfigJson) +} + +func test_CLOSpecApprovalFlow(t *testing.T, ccipTH integrationtesthelpers.CCIPIntegrationTestHarness, tokenPricesUSDPipeline string, priceGetterConfiguration string) { + jobParams := ccipTH.SetUpNodesAndJobs(t, tokenPricesUSDPipeline, priceGetterConfiguration, "http://blah.com") + ccipTH.SetupFeedsManager(t) + + // Propose and approve new specs + ccipTH.ApproveJobSpecs(t, jobParams) + + // Sanity check that CCIP works after CLO flow + currentSeqNum := 1 + + extraArgs, err := testhelpers.GetEVMExtraArgsV1(big.NewInt(200_003), false) + require.NoError(t, err) + + msg := router.ClientEVM2AnyMessage{ + Receiver: testhelpers.MustEncodeAddress(t, ccipTH.Dest.Receivers[0].Receiver.Address()), + Data: utils.RandomAddress().Bytes(), + TokenAmounts: []router.ClientEVMTokenAmount{}, + FeeToken: ccipTH.Source.LinkToken.Address(), + ExtraArgs: extraArgs, + } + fee, err := ccipTH.Source.Router.GetFee(nil, testhelpers.DestChainSelector, msg) + require.NoError(t, err) + + _, err = ccipTH.Source.LinkToken.Approve(ccipTH.Source.User, ccipTH.Source.Router.Address(), new(big.Int).Set(fee)) + require.NoError(t, err) + blockHash := ccipTH.Dest.Chain.Commit() + // get the block number + block, err := ccipTH.Dest.Chain.BlockByHash(context.Background(), blockHash) + require.NoError(t, err) + blockNumber := block.Number().Uint64() + 1 // +1 as a block will be mined for the request from EventuallyReportCommitted + + ccipTH.SendRequest(t, msg) + ccipTH.AllNodesHaveReqSeqNum(t, currentSeqNum) + ccipTH.EventuallyReportCommitted(t, currentSeqNum) + ccipTH.EventuallyPriceRegistryUpdated( + t, + blockNumber, + ccipTH.Source.ChainSelector, + []common.Address{ccipTH.Dest.LinkToken.Address(), ccipTH.Dest.WrappedNative.Address()}, + ccipTH.Source.WrappedNative.Address(), + ) + + executionLogs := ccipTH.AllNodesHaveExecutedSeqNums(t, currentSeqNum, currentSeqNum) + assert.Len(t, executionLogs, 1) + ccipTH.AssertExecState(t, executionLogs[0], testhelpers.ExecutionStateSuccess) +} diff --git a/core/services/ocr2/plugins/ccip/config/chain_config.go b/core/services/ocr2/plugins/ccip/config/chain_config.go new file mode 100644 index 00000000000..ff82def6066 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/config/chain_config.go @@ -0,0 +1,48 @@ +package config + +import ( + "strconv" + + "github.com/pkg/errors" + chainselectors "github.com/smartcontractkit/chain-selectors" + + "github.com/smartcontractkit/chainlink/v2/core/chains/legacyevm" + "github.com/smartcontractkit/chainlink/v2/core/services/job" +) + +func GetChainFromSpec(spec *job.OCR2OracleSpec, chainSet legacyevm.LegacyChainContainer) (legacyevm.Chain, int64, error) { + chainIDInterface, ok := spec.RelayConfig["chainID"] + if !ok { + return nil, 0, errors.New("chainID must be provided in relay config") + } + destChainID := uint64(chainIDInterface.(float64)) + return GetChainByChainID(chainSet, destChainID) +} + +func GetChainByChainSelector(chainSet legacyevm.LegacyChainContainer, chainSelector uint64) (legacyevm.Chain, int64, error) { + chainID, err := chainselectors.ChainIdFromSelector(chainSelector) + if err != nil { + return nil, 0, err + } + return GetChainByChainID(chainSet, chainID) +} + +func GetChainByChainID(chainSet legacyevm.LegacyChainContainer, chainID uint64) (legacyevm.Chain, int64, error) { + chain, err := chainSet.Get(strconv.FormatUint(chainID, 10)) + if err != nil { + return nil, 0, errors.Wrap(err, "chain not found in chainset") + } + return chain, chain.ID().Int64(), nil +} + +func ResolveChainNames(sourceChainId int64, destChainId int64) (string, string, error) { + sourceChainName, err := chainselectors.NameFromChainId(uint64(sourceChainId)) + if err != nil { + return "", "", err + } + destChainName, err := chainselectors.NameFromChainId(uint64(destChainId)) + if err != nil { + return "", "", err + } + return sourceChainName, destChainName, nil +} diff --git a/core/services/ocr2/plugins/ccip/config/chain_config_test.go b/core/services/ocr2/plugins/ccip/config/chain_config_test.go new file mode 100644 index 00000000000..df2351a5ea4 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/config/chain_config_test.go @@ -0,0 +1,135 @@ +package config + +import ( + "math/big" + "strconv" + "testing" + + "github.com/pkg/errors" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + "github.com/smartcontractkit/chainlink/v2/core/chains/legacyevm/mocks" + "github.com/smartcontractkit/chainlink/v2/core/services/job" +) + +func TestGetChainFromSpec(t *testing.T) { + testChainID := int64(1337) + + tests := []struct { + name string + spec *job.OCR2OracleSpec + expectedErr bool + expectedErrMsg string + }{ + { + name: "success", + spec: &job.OCR2OracleSpec{ + RelayConfig: job.JSONConfig{ + "chainID": float64(testChainID), + }, + }, + expectedErr: false, + }, + { + name: "missing_chain_ID", + spec: &job.OCR2OracleSpec{}, + expectedErr: true, + expectedErrMsg: "chainID must be provided in relay config", + }, + } + + mockChain := mocks.NewChain(t) + mockChain.On("ID").Return(big.NewInt(testChainID)).Maybe() + + mockChainSet := mocks.NewLegacyChainContainer(t) + mockChainSet.On("Get", strconv.FormatInt(testChainID, 10)).Return(mockChain, nil).Maybe() + + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + chain, chainID, err := GetChainFromSpec(test.spec, mockChainSet) + if test.expectedErr { + require.Error(t, err) + require.Contains(t, err.Error(), test.expectedErrMsg) + } else { + require.NoError(t, err) + require.Equal(t, mockChain, chain) + require.Equal(t, testChainID, chainID) + } + }) + } +} + +func TestGetChainByChainSelector_success(t *testing.T) { + mockChain := mocks.NewChain(t) + mockChain.On("ID").Return(big.NewInt(11155111)) + + mockChainSet := mocks.NewLegacyChainContainer(t) + mockChainSet.On("Get", "11155111").Return(mockChain, nil) + + // Ethereum Sepolia chain selector. + chain, chainID, err := GetChainByChainSelector(mockChainSet, uint64(16015286601757825753)) + require.NoError(t, err) + require.Equal(t, mockChain, chain) + require.Equal(t, int64(11155111), chainID) +} + +func TestGetChainByChainSelector_selectorNotFound(t *testing.T) { + mockChainSet := mocks.NewLegacyChainContainer(t) + + _, _, err := GetChainByChainSelector(mockChainSet, uint64(444000444)) + require.Error(t, err) +} + +func TestGetChainById_notFound(t *testing.T) { + mockChainSet := mocks.NewLegacyChainContainer(t) + mockChainSet.On("Get", "444").Return(nil, errors.New("test")).Maybe() + + _, _, err := GetChainByChainID(mockChainSet, uint64(444)) + require.Error(t, err) + require.Contains(t, err.Error(), "chain not found in chainset") +} + +func TestResolveChainNames(t *testing.T) { + tests := []struct { + name string + sourceChainId int64 + destChainId int64 + expectedSourceChainName string + expectedDestChainName string + expectedErr bool + }{ + { + name: "success", + sourceChainId: 1, + destChainId: 10, + expectedSourceChainName: "ethereum-mainnet", + expectedDestChainName: "ethereum-mainnet-optimism-1", + }, + { + name: "source chain not found", + sourceChainId: 901278309182, + destChainId: 10, + expectedErr: true, + }, + { + name: "dest chain not found", + sourceChainId: 1, + destChainId: 901278309182, + expectedErr: true, + }, + } + + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + sourceChainName, destChainName, err := ResolveChainNames(test.sourceChainId, test.destChainId) + if test.expectedErr { + require.Error(t, err) + } else { + require.NoError(t, err) + assert.Equal(t, test.expectedSourceChainName, sourceChainName) + assert.Equal(t, test.expectedDestChainName, destChainName) + } + }) + } +} diff --git a/core/services/ocr2/plugins/ccip/config/config.go b/core/services/ocr2/plugins/ccip/config/config.go new file mode 100644 index 00000000000..a24a6edfd13 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/config/config.go @@ -0,0 +1,152 @@ +package config + +import ( + "encoding/json" + "fmt" + "math/big" + "strings" + + "github.com/ethereum/go-ethereum/common" + "github.com/pkg/errors" + + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + "github.com/smartcontractkit/chainlink-common/pkg/utils/bytes" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils" +) + +// CommitPluginJobSpecConfig contains the plugin specific variables for the ccip.CCIPCommit plugin. +type CommitPluginJobSpecConfig struct { + SourceStartBlock, DestStartBlock uint64 // Only for first time job add. + OffRamp cciptypes.Address `json:"offRamp"` + // TokenPricesUSDPipeline should contain a token price pipeline for the following tokens: + // The SOURCE chain wrapped native + // The DESTINATION supported tokens (including fee tokens) as defined in destination OffRamp and PriceRegistry. + TokenPricesUSDPipeline string `json:"tokenPricesUSDPipeline,omitempty"` + // PriceGetterConfig defines where to get the token prices from (i.e. static or aggregator source). + PriceGetterConfig *DynamicPriceGetterConfig `json:"priceGetterConfig,omitempty"` +} + +type CommitPluginConfig struct { + IsSourceProvider bool + SourceStartBlock, DestStartBlock uint64 +} + +func (c CommitPluginConfig) Encode() ([]byte, error) { + bytes, err := json.Marshal(c) + if err != nil { + return nil, err + } + return bytes, nil +} + +// DynamicPriceGetterConfig specifies which configuration to use for getting the price of tokens (map keys). +type DynamicPriceGetterConfig struct { + AggregatorPrices map[common.Address]AggregatorPriceConfig `json:"aggregatorPrices"` + StaticPrices map[common.Address]StaticPriceConfig `json:"staticPrices"` +} + +// AggregatorPriceConfig specifies a price retrieved from an aggregator contract. +type AggregatorPriceConfig struct { + ChainID uint64 `json:"chainID,string"` + AggregatorContractAddress common.Address `json:"contractAddress"` +} + +// StaticPriceConfig specifies a price defined statically. +type StaticPriceConfig struct { + ChainID uint64 `json:"chainID,string"` + Price *big.Int `json:"price"` +} + +// UnmarshalJSON provides a custom un-marshaller to handle JSON embedded in Toml content. +func (c *DynamicPriceGetterConfig) UnmarshalJSON(data []byte) error { + type Alias DynamicPriceGetterConfig + if bytes.HasQuotes(data) { + trimmed := string(bytes.TrimQuotes(data)) + trimmed = strings.ReplaceAll(trimmed, "\\n", "") + trimmed = strings.ReplaceAll(trimmed, "\\t", "") + trimmed = strings.ReplaceAll(trimmed, "\\", "") + return json.Unmarshal([]byte(trimmed), (*Alias)(c)) + } + return json.Unmarshal(data, (*Alias)(c)) +} + +func (c *DynamicPriceGetterConfig) Validate() error { + for addr, v := range c.AggregatorPrices { + if addr == utils.ZeroAddress { + return fmt.Errorf("token address is zero") + } + if v.AggregatorContractAddress == utils.ZeroAddress { + return fmt.Errorf("aggregator contract address is zero") + } + if v.ChainID == 0 { + return fmt.Errorf("chain id is zero") + } + } + + for addr, v := range c.StaticPrices { + if addr == utils.ZeroAddress { + return fmt.Errorf("token address is zero") + } + if v.ChainID == 0 { + return fmt.Errorf("chain id is zero") + } + } + + // Ensure no duplication in token price resolution rules. + if c.AggregatorPrices != nil && c.StaticPrices != nil { + for tk := range c.AggregatorPrices { + if _, exists := c.StaticPrices[tk]; exists { + return fmt.Errorf("token %s defined in both aggregator and static price rules", tk) + } + } + } + return nil +} + +// ExecPluginJobSpecConfig contains the plugin specific variables for the ccip.CCIPExecution plugin. +type ExecPluginJobSpecConfig struct { + SourceStartBlock, DestStartBlock uint64 // Only for first time job add. + USDCConfig USDCConfig +} + +type USDCConfig struct { + SourceTokenAddress common.Address + SourceMessageTransmitterAddress common.Address + AttestationAPI string + AttestationAPITimeoutSeconds uint + // AttestationAPIIntervalMilliseconds can be set to -1 to disable or 0 to use a default interval. + AttestationAPIIntervalMilliseconds int +} + +type ExecPluginConfig struct { + SourceStartBlock, DestStartBlock uint64 // Only for first time job add. + IsSourceProvider bool + USDCConfig USDCConfig + JobID string +} + +func (e ExecPluginConfig) Encode() ([]byte, error) { + bytes, err := json.Marshal(e) + if err != nil { + return nil, err + } + return bytes, nil +} + +func (uc *USDCConfig) ValidateUSDCConfig() error { + if uc.AttestationAPI == "" { + return errors.New("AttestationAPI is required") + } + if uc.AttestationAPIIntervalMilliseconds < -1 { + return errors.New("AttestationAPIIntervalMilliseconds must be -1 to disable, 0 for default or greater to define the exact interval") + } + if uc.SourceTokenAddress == utils.ZeroAddress { + return errors.New("SourceTokenAddress is required") + } + if uc.SourceMessageTransmitterAddress == utils.ZeroAddress { + return errors.New("SourceMessageTransmitterAddress is required") + } + + return nil +} diff --git a/core/services/ocr2/plugins/ccip/config/config_test.go b/core/services/ocr2/plugins/ccip/config/config_test.go new file mode 100644 index 00000000000..e6207aa2231 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/config/config_test.go @@ -0,0 +1,234 @@ +package config + +import ( + "encoding/json" + "fmt" + "math/big" + "testing" + + "github.com/ethereum/go-ethereum/common" + "github.com/stretchr/testify/require" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipcalc" +) + +func TestCommitConfig(t *testing.T) { + tests := []struct { + name string + cfg CommitPluginJobSpecConfig + expectedValidationError error + }{ + { + name: "valid config", + cfg: CommitPluginJobSpecConfig{ + SourceStartBlock: 222, + DestStartBlock: 333, + OffRamp: ccipcalc.HexToAddress("0x123"), + TokenPricesUSDPipeline: `merge [type=merge left="{}" right="{\"0xC79b96044906550A5652BCf20a6EA02f139B9Ae5\":\"1000000000000000000\"}"];`, + PriceGetterConfig: &DynamicPriceGetterConfig{ + AggregatorPrices: map[common.Address]AggregatorPriceConfig{ + common.HexToAddress("0x0820c05e1fba1244763a494a52272170c321cad3"): { + ChainID: 1000, + AggregatorContractAddress: common.HexToAddress("0xb8dabd288955d302d05ca6b011bb46dfa3ea7acf"), + }, + common.HexToAddress("0x4a98bb4d65347016a7ab6f85bea24b129c9a1272"): { + ChainID: 1337, + AggregatorContractAddress: common.HexToAddress("0xb80244cc8b0bb18db071c150b36e9bcb8310b236"), + }, + }, + StaticPrices: map[common.Address]StaticPriceConfig{ + common.HexToAddress("0xec8c353470ccaa4f43067fcde40558e084a12927"): { + ChainID: 1057, + Price: big.NewInt(1000000000000000000), + }, + }, + }, + }, + expectedValidationError: nil, + }, + { + name: "missing dynamic aggregator contract address", + cfg: CommitPluginJobSpecConfig{ + SourceStartBlock: 222, + DestStartBlock: 333, + OffRamp: ccipcalc.HexToAddress("0x123"), + TokenPricesUSDPipeline: `merge [type=merge left="{}" right="{\"0xC79b96044906550A5652BCf20a6EA02f139B9Ae5\":\"1000000000000000000\"}"];`, + PriceGetterConfig: &DynamicPriceGetterConfig{ + AggregatorPrices: map[common.Address]AggregatorPriceConfig{ + common.HexToAddress("0x0820c05e1fba1244763a494a52272170c321cad3"): { + ChainID: 1000, + AggregatorContractAddress: common.HexToAddress("0xb8dabd288955d302d05ca6b011bb46dfa3ea7acf"), + }, + common.HexToAddress("0x4a98bb4d65347016a7ab6f85bea24b129c9a1272"): { + ChainID: 1337, + AggregatorContractAddress: common.HexToAddress(""), + }, + }, + StaticPrices: map[common.Address]StaticPriceConfig{ + common.HexToAddress("0xec8c353470ccaa4f43067fcde40558e084a12927"): { + ChainID: 1057, + Price: big.NewInt(1000000000000000000), + }, + }, + }, + }, + expectedValidationError: fmt.Errorf("aggregator contract address is zero"), + }, + { + name: "missing chain ID", + cfg: CommitPluginJobSpecConfig{ + SourceStartBlock: 222, + DestStartBlock: 333, + OffRamp: ccipcalc.HexToAddress("0x123"), + TokenPricesUSDPipeline: `merge [type=merge left="{}" right="{\"0xC79b96044906550A5652BCf20a6EA02f139B9Ae5\":\"1000000000000000000\"}"];`, + PriceGetterConfig: &DynamicPriceGetterConfig{ + AggregatorPrices: map[common.Address]AggregatorPriceConfig{ + common.HexToAddress("0x0820c05e1fba1244763a494a52272170c321cad3"): { + ChainID: 1000, + AggregatorContractAddress: common.HexToAddress("0xb8dabd288955d302d05ca6b011bb46dfa3ea7acf"), + }, + common.HexToAddress("0x4a98bb4d65347016a7ab6f85bea24b129c9a1272"): { + ChainID: 1337, + AggregatorContractAddress: common.HexToAddress("0xb80244cc8b0bb18db071c150b36e9bcb8310b236"), + }, + }, + StaticPrices: map[common.Address]StaticPriceConfig{ + common.HexToAddress("0xec8c353470ccaa4f43067fcde40558e084a12927"): { + ChainID: 0, + Price: big.NewInt(1000000000000000000), + }, + }, + }, + }, + expectedValidationError: fmt.Errorf("chain id is zero"), + }, + } + + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + // Verify proper marshall/unmarshalling of the config. + bts, err := json.Marshal(test.cfg) + require.NoError(t, err) + parsedConfig := CommitPluginJobSpecConfig{} + require.NoError(t, json.Unmarshal(bts, &parsedConfig)) + require.Equal(t, test.cfg, parsedConfig) + + // Ensure correctness of price getter configuration. + pgc := test.cfg.PriceGetterConfig + err = pgc.Validate() + if test.expectedValidationError != nil { + require.ErrorContains(t, err, test.expectedValidationError.Error()) + } else { + require.NoError(t, err) + require.Equal(t, uint64(1000), pgc.AggregatorPrices[common.HexToAddress("0x0820c05e1fba1244763a494a52272170c321cad3")].ChainID) + require.Equal(t, uint64(1337), pgc.AggregatorPrices[common.HexToAddress("0x4a98bb4d65347016a7ab6f85bea24b129c9a1272")].ChainID) + require.Equal(t, uint64(1057), pgc.StaticPrices[common.HexToAddress("0xec8c353470ccaa4f43067fcde40558e084a12927")].ChainID) + } + }) + } +} + +func TestExecutionConfig(t *testing.T) { + exampleConfig := ExecPluginJobSpecConfig{ + SourceStartBlock: 222, + DestStartBlock: 333, + } + + bts, err := json.Marshal(exampleConfig) + require.NoError(t, err) + + parsedConfig := ExecPluginJobSpecConfig{} + require.NoError(t, json.Unmarshal(bts, &parsedConfig)) + + require.Equal(t, exampleConfig, parsedConfig) +} + +func TestUSDCValidate(t *testing.T) { + testcases := []struct { + config USDCConfig + err string + }{ + { + config: USDCConfig{}, + err: "AttestationAPI is required", + }, + { + config: USDCConfig{ + AttestationAPI: "api", + }, + err: "SourceTokenAddress is required", + }, + { + config: USDCConfig{ + AttestationAPI: "api", + SourceTokenAddress: utils.ZeroAddress, + }, + err: "SourceTokenAddress is required", + }, + { + config: USDCConfig{ + AttestationAPI: "api", + SourceTokenAddress: utils.RandomAddress(), + }, + err: "SourceMessageTransmitterAddress is required", + }, + { + config: USDCConfig{ + AttestationAPI: "api", + SourceTokenAddress: utils.RandomAddress(), + SourceMessageTransmitterAddress: utils.ZeroAddress, + }, + err: "SourceMessageTransmitterAddress is required", + }, + { + config: USDCConfig{ + AttestationAPI: "api", + SourceTokenAddress: utils.RandomAddress(), + SourceMessageTransmitterAddress: utils.RandomAddress(), + }, + err: "", + }, + } + + for _, tc := range testcases { + tc := tc + t.Run(fmt.Sprintf("error = %s", tc.err), func(t *testing.T) { + t.Parallel() + err := tc.config.ValidateUSDCConfig() + if tc.err != "" { + require.ErrorContains(t, err, tc.err) + } else { + require.NoError(t, err) + } + }) + } +} + +func TestUnmarshallDynamicPriceConfig(t *testing.T) { + jsonCfg := ` +{ + "aggregatorPrices": { + "0x0820c05e1fba1244763a494a52272170c321cad3": { + "chainID": "1000", + "contractAddress": "0xb8dabd288955d302d05ca6b011bb46dfa3ea7acf" + }, + "0x4a98bb4d65347016a7ab6f85bea24b129c9a1272": { + "chainID": "1337", + "contractAddress": "0xb80244cc8b0bb18db071c150b36e9bcb8310b236" + } + }, + "staticPrices": { + "0xec8c353470ccaa4f43067fcde40558e084a12927": { + "chainID": "1057", + "price": 1000000000000000000 + } + } +} +` + var cfg DynamicPriceGetterConfig + err := json.Unmarshal([]byte(jsonCfg), &cfg) + require.NoError(t, err) + err = cfg.Validate() + require.NoError(t, err) +} diff --git a/core/services/ocr2/plugins/ccip/config/offchain_config.go b/core/services/ocr2/plugins/ccip/config/offchain_config.go new file mode 100644 index 00000000000..f8fba3f1bcb --- /dev/null +++ b/core/services/ocr2/plugins/ccip/config/offchain_config.go @@ -0,0 +1,26 @@ +package config + +import ( + "encoding/json" +) + +type OffchainConfig interface { + Validate() error +} + +func DecodeOffchainConfig[T OffchainConfig](encodedConfig []byte) (T, error) { + var result T + err := json.Unmarshal(encodedConfig, &result) + if err != nil { + return result, err + } + err = result.Validate() + if err != nil { + return result, err + } + return result, nil +} + +func EncodeOffchainConfig[T OffchainConfig](occ T) ([]byte, error) { + return json.Marshal(occ) +} diff --git a/core/services/ocr2/plugins/ccip/config/type_and_version.go b/core/services/ocr2/plugins/ccip/config/type_and_version.go new file mode 100644 index 00000000000..fdfd892b087 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/config/type_and_version.go @@ -0,0 +1,73 @@ +package config + +import ( + "fmt" + "strings" + + "github.com/Masterminds/semver/v3" + mapset "github.com/deckarep/golang-set/v2" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + + type_and_version "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/type_and_version_interface_wrapper" +) + +type ContractType string + +var ( + EVM2EVMOnRamp ContractType = "EVM2EVMOnRamp" + EVM2EVMOffRamp ContractType = "EVM2EVMOffRamp" + CommitStore ContractType = "CommitStore" + PriceRegistry ContractType = "PriceRegistry" + ContractTypes = mapset.NewSet[ContractType]( + EVM2EVMOffRamp, + EVM2EVMOnRamp, + CommitStore, + PriceRegistry, + ) +) + +func VerifyTypeAndVersion(addr common.Address, client bind.ContractBackend, expectedType ContractType) (semver.Version, error) { + contractType, version, err := TypeAndVersion(addr, client) + if err != nil { + return semver.Version{}, fmt.Errorf("failed getting type and version %w", err) + } + if contractType != expectedType { + return semver.Version{}, fmt.Errorf("wrong contract type %s", contractType) + } + return version, nil +} + +func TypeAndVersion(addr common.Address, client bind.ContractBackend) (ContractType, semver.Version, error) { + tv, err := type_and_version.NewTypeAndVersionInterface(addr, client) + if err != nil { + return "", semver.Version{}, err + } + tvStr, err := tv.TypeAndVersion(nil) + if err != nil { + return "", semver.Version{}, fmt.Errorf("error calling typeAndVersion on addr: %s %w", addr.String(), err) + } + + contractType, versionStr, err := ParseTypeAndVersion(tvStr) + if err != nil { + return "", semver.Version{}, err + } + v, err := semver.NewVersion(versionStr) + if err != nil { + return "", semver.Version{}, fmt.Errorf("failed parsing version %s: %w", versionStr, err) + } + + if !ContractTypes.Contains(ContractType(contractType)) { + return "", semver.Version{}, fmt.Errorf("unrecognized contract type %v", contractType) + } + return ContractType(contractType), *v, nil +} + +func ParseTypeAndVersion(tvStr string) (string, string, error) { + typeAndVersionValues := strings.Split(tvStr, " ") + + if len(typeAndVersionValues) < 2 { + return "", "", fmt.Errorf("invalid type and version %s", tvStr) + } + return typeAndVersionValues[0], typeAndVersionValues[1], nil +} diff --git a/core/services/ocr2/plugins/ccip/exportinternal.go b/core/services/ocr2/plugins/ccip/exportinternal.go new file mode 100644 index 00000000000..aecf1a0b163 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/exportinternal.go @@ -0,0 +1,136 @@ +package ccip + +import ( + "context" + "math/big" + "time" + + "github.com/ethereum/go-ethereum/common" + + "github.com/smartcontractkit/chainlink-common/pkg/logger" + "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/gas" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/config" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipcalc" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/batchreader" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/ccipdataprovider" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/factory" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/pricegetter" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/rpclib" +) + +func GenericAddrToEvm(addr ccip.Address) (common.Address, error) { + return ccipcalc.GenericAddrToEvm(addr) +} + +func EvmAddrToGeneric(addr common.Address) ccip.Address { + return ccipcalc.EvmAddrToGeneric(addr) +} + +func NewEvmPriceRegistry(lp logpoller.LogPoller, ec client.Client, lggr logger.Logger, pluginLabel string) *ccipdataprovider.EvmPriceRegistry { + return ccipdataprovider.NewEvmPriceRegistry(lp, ec, lggr, pluginLabel) +} + +type VersionFinder = factory.VersionFinder + +func NewCommitStoreReader(lggr logger.Logger, versionFinder VersionFinder, address ccip.Address, ec client.Client, lp logpoller.LogPoller) (ccipdata.CommitStoreReader, error) { + return factory.NewCommitStoreReader(lggr, versionFinder, address, ec, lp) +} + +func CloseCommitStoreReader(lggr logger.Logger, versionFinder VersionFinder, address ccip.Address, ec client.Client, lp logpoller.LogPoller) error { + return factory.CloseCommitStoreReader(lggr, versionFinder, address, ec, lp) +} + +func NewOffRampReader(lggr logger.Logger, versionFinder VersionFinder, addr ccip.Address, destClient client.Client, lp logpoller.LogPoller, estimator gas.EvmFeeEstimator, destMaxGasPrice *big.Int, registerFilters bool) (ccipdata.OffRampReader, error) { + return factory.NewOffRampReader(lggr, versionFinder, addr, destClient, lp, estimator, destMaxGasPrice, registerFilters) +} + +func CloseOffRampReader(lggr logger.Logger, versionFinder VersionFinder, addr ccip.Address, destClient client.Client, lp logpoller.LogPoller, estimator gas.EvmFeeEstimator, destMaxGasPrice *big.Int) error { + return factory.CloseOffRampReader(lggr, versionFinder, addr, destClient, lp, estimator, destMaxGasPrice) +} + +func NewEvmVersionFinder() factory.EvmVersionFinder { + return factory.NewEvmVersionFinder() +} + +func NewOnRampReader(lggr logger.Logger, versionFinder VersionFinder, sourceSelector, destSelector uint64, onRampAddress ccip.Address, sourceLP logpoller.LogPoller, source client.Client) (ccipdata.OnRampReader, error) { + return factory.NewOnRampReader(lggr, versionFinder, sourceSelector, destSelector, onRampAddress, sourceLP, source) +} + +func CloseOnRampReader(lggr logger.Logger, versionFinder VersionFinder, sourceSelector, destSelector uint64, onRampAddress ccip.Address, sourceLP logpoller.LogPoller, source client.Client) error { + return factory.CloseOnRampReader(lggr, versionFinder, sourceSelector, destSelector, onRampAddress, sourceLP, source) +} + +type OffRampReader = ccipdata.OffRampReader + +type DynamicPriceGetterClient = pricegetter.DynamicPriceGetterClient + +type DynamicPriceGetter = pricegetter.DynamicPriceGetter + +func NewDynamicPriceGetterClient(batchCaller rpclib.EvmBatchCaller) DynamicPriceGetterClient { + return pricegetter.NewDynamicPriceGetterClient(batchCaller) +} + +func NewDynamicPriceGetter(cfg config.DynamicPriceGetterConfig, evmClients map[uint64]DynamicPriceGetterClient) (*DynamicPriceGetter, error) { + return pricegetter.NewDynamicPriceGetter(cfg, evmClients) +} + +func NewDynamicLimitedBatchCaller( + lggr logger.Logger, batchSender rpclib.BatchSender, batchSizeLimit, backOffMultiplier, parallelRpcCallsLimit uint, +) *rpclib.DynamicLimitedBatchCaller { + return rpclib.NewDynamicLimitedBatchCaller(lggr, batchSender, batchSizeLimit, backOffMultiplier, parallelRpcCallsLimit) +} + +func NewUSDCReader(lggr logger.Logger, jobID string, transmitter common.Address, lp logpoller.LogPoller, registerFilters bool) (*ccipdata.USDCReaderImpl, error) { + return ccipdata.NewUSDCReader(lggr, jobID, transmitter, lp, registerFilters) +} + +func CloseUSDCReader(lggr logger.Logger, jobID string, transmitter common.Address, lp logpoller.LogPoller) error { + return ccipdata.CloseUSDCReader(lggr, jobID, transmitter, lp) +} + +type USDCReaderImpl = ccipdata.USDCReaderImpl + +var DefaultRpcBatchSizeLimit = rpclib.DefaultRpcBatchSizeLimit +var DefaultRpcBatchBackOffMultiplier = rpclib.DefaultRpcBatchBackOffMultiplier +var DefaultMaxParallelRpcCalls = rpclib.DefaultMaxParallelRpcCalls + +func NewEVMTokenPoolBatchedReader(lggr logger.Logger, remoteChainSelector uint64, offRampAddress ccip.Address, evmBatchCaller rpclib.EvmBatchCaller) (*batchreader.EVMTokenPoolBatchedReader, error) { + return batchreader.NewEVMTokenPoolBatchedReader(lggr, remoteChainSelector, offRampAddress, evmBatchCaller) +} + +type ChainAgnosticPriceRegistry struct { + p ChainAgnosticPriceRegistryFactory +} + +// [ChainAgnosticPriceRegistryFactory] is satisfied by [commontypes.CCIPCommitProvider] and [commontypes.CCIPExecProvider] +type ChainAgnosticPriceRegistryFactory interface { + NewPriceRegistryReader(ctx context.Context, addr ccip.Address) (ccip.PriceRegistryReader, error) +} + +func (c *ChainAgnosticPriceRegistry) NewPriceRegistryReader(ctx context.Context, addr ccip.Address) (ccip.PriceRegistryReader, error) { + return c.p.NewPriceRegistryReader(ctx, addr) +} + +func NewChainAgnosticPriceRegistry(provider ChainAgnosticPriceRegistryFactory) *ChainAgnosticPriceRegistry { + return &ChainAgnosticPriceRegistry{provider} +} + +type JSONCommitOffchainConfigV1_2_0 = v1_2_0.JSONCommitOffchainConfig +type CommitOnchainConfig = ccipdata.CommitOnchainConfig + +func NewCommitOffchainConfig( + gasPriceDeviationPPB uint32, + gasPriceHeartBeat time.Duration, + tokenPriceDeviationPPB uint32, + tokenPriceHeartBeat time.Duration, + inflightCacheExpiry time.Duration, + priceReportingDisabled bool, +) ccip.CommitOffchainConfig { + return ccipdata.NewCommitOffchainConfig(gasPriceDeviationPPB, gasPriceHeartBeat, tokenPriceDeviationPPB, tokenPriceHeartBeat, inflightCacheExpiry, priceReportingDisabled) +} diff --git a/core/services/ocr2/plugins/ccip/integration_legacy_test.go b/core/services/ocr2/plugins/ccip/integration_legacy_test.go new file mode 100644 index 00000000000..d89c50b4070 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/integration_legacy_test.go @@ -0,0 +1,588 @@ +package ccip_test + +import ( + "context" + "encoding/json" + "fmt" + "math/big" + "sync" + "testing" + "time" + + "github.com/ethereum/go-ethereum/common" + gethtypes "github.com/ethereum/go-ethereum/core/types" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + evm_2_evm_onramp "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/evm_2_evm_onramp_1_2_0" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/router" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/mock_v3_aggregator_contract" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/config" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0" + testhelpers_new "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/testhelpers" + testhelpers "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/testhelpers/testhelpers_1_4_0" +) + +func TestIntegration_legacy_CCIP(t *testing.T) { + // Run the batches of tests for both pipeline and dynamic price getter setups. + // We will remove the pipeline batch once the feature is deleted from the code. + tests := []struct { + name string + withPipeline bool + }{ + { + name: "with pipeline", + withPipeline: true, + }, + { + name: "with dynamic price getter", + withPipeline: false, + }, + } + + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + ccipTH := testhelpers.SetupCCIPIntegrationTH(t, testhelpers.SourceChainID, testhelpers.SourceChainSelector, testhelpers.DestChainID, testhelpers.DestChainSelector) + + tokenPricesUSDPipeline := "" + priceGetterConfigJson := "" + + if test.withPipeline { + // Set up a test pipeline. + testPricePipeline, linkUSD, ethUSD := ccipTH.CreatePricesPipeline(t) + defer linkUSD.Close() + defer ethUSD.Close() + tokenPricesUSDPipeline = testPricePipeline + } else { + // Set up a test price getter. + // Set up the aggregators here to avoid modifying ccipTH. + aggSrcNatAddr, _, aggSrcNat, err := mock_v3_aggregator_contract.DeployMockV3AggregatorContract(ccipTH.Source.User, ccipTH.Source.Chain, 18, big.NewInt(2e18)) + require.NoError(t, err) + _, err = aggSrcNat.UpdateRoundData(ccipTH.Source.User, big.NewInt(50), big.NewInt(17000000), big.NewInt(1000), big.NewInt(1000)) + require.NoError(t, err) + ccipTH.Source.Chain.Commit() + + aggDstLnkAddr, _, aggDstLnk, err := mock_v3_aggregator_contract.DeployMockV3AggregatorContract(ccipTH.Dest.User, ccipTH.Dest.Chain, 18, big.NewInt(3e18)) + require.NoError(t, err) + ccipTH.Dest.Chain.Commit() + _, err = aggDstLnk.UpdateRoundData(ccipTH.Dest.User, big.NewInt(50), big.NewInt(8000000), big.NewInt(1000), big.NewInt(1000)) + require.NoError(t, err) + ccipTH.Dest.Chain.Commit() + + priceGetterConfig := config.DynamicPriceGetterConfig{ + AggregatorPrices: map[common.Address]config.AggregatorPriceConfig{ + ccipTH.Source.WrappedNative.Address(): { + ChainID: ccipTH.Source.ChainID, + AggregatorContractAddress: aggSrcNatAddr, + }, + ccipTH.Dest.LinkToken.Address(): { + ChainID: ccipTH.Dest.ChainID, + AggregatorContractAddress: aggDstLnkAddr, + }, + ccipTH.Dest.WrappedNative.Address(): { + ChainID: ccipTH.Dest.ChainID, + AggregatorContractAddress: aggDstLnkAddr, + }, + }, + StaticPrices: map[common.Address]config.StaticPriceConfig{}, + } + priceGetterConfigBytes, err := json.MarshalIndent(priceGetterConfig, "", " ") + require.NoError(t, err) + priceGetterConfigJson = string(priceGetterConfigBytes) + } + + jobParams := ccipTH.SetUpNodesAndJobs(t, tokenPricesUSDPipeline, priceGetterConfigJson, "") + + currentSeqNum := 1 + + t.Run("single", func(t *testing.T) { + tokenAmount := big.NewInt(500000003) // prime number + gasLimit := big.NewInt(200_003) // prime number + + extraArgs, err2 := testhelpers.GetEVMExtraArgsV1(gasLimit, false) + require.NoError(t, err2) + + sourceBalances, err2 := testhelpers.GetBalances(t, []testhelpers.BalanceReq{ + {Name: testhelpers.SourcePool, Addr: ccipTH.Source.LinkTokenPool.Address(), Getter: ccipTH.GetSourceLinkBalance}, + {Name: testhelpers.OnRamp, Addr: ccipTH.Source.OnRamp.Address(), Getter: ccipTH.GetSourceLinkBalance}, + {Name: testhelpers.SourceRouter, Addr: ccipTH.Source.Router.Address(), Getter: ccipTH.GetSourceLinkBalance}, + {Name: testhelpers.SourcePriceRegistry, Addr: ccipTH.Source.PriceRegistry.Address(), Getter: ccipTH.GetSourceLinkBalance}, + }) + require.NoError(t, err2) + destBalances, err2 := testhelpers.GetBalances(t, []testhelpers.BalanceReq{ + {Name: testhelpers.Receiver, Addr: ccipTH.Dest.Receivers[0].Receiver.Address(), Getter: ccipTH.GetDestLinkBalance}, + {Name: testhelpers.DestPool, Addr: ccipTH.Dest.LinkTokenPool.Address(), Getter: ccipTH.GetDestLinkBalance}, + {Name: testhelpers.OffRamp, Addr: ccipTH.Dest.OffRamp.Address(), Getter: ccipTH.GetDestLinkBalance}, + }) + require.NoError(t, err2) + + ccipTH.Source.User.Value = tokenAmount + _, err2 = ccipTH.Source.WrappedNative.Deposit(ccipTH.Source.User) + require.NoError(t, err2) + ccipTH.Source.Chain.Commit() + ccipTH.Source.User.Value = nil + + msg := router.ClientEVM2AnyMessage{ + Receiver: testhelpers.MustEncodeAddress(t, ccipTH.Dest.Receivers[0].Receiver.Address()), + Data: []byte("hello"), + TokenAmounts: []router.ClientEVMTokenAmount{ + { + Token: ccipTH.Source.LinkToken.Address(), + Amount: tokenAmount, + }, + { + Token: ccipTH.Source.WrappedNative.Address(), + Amount: tokenAmount, + }, + }, + FeeToken: ccipTH.Source.LinkToken.Address(), + ExtraArgs: extraArgs, + } + fee, err2 := ccipTH.Source.Router.GetFee(nil, testhelpers.DestChainSelector, msg) + require.NoError(t, err2) + // Currently no overhead and 10gwei dest gas price. So fee is simply (gasLimit * gasPrice)* link/native + // require.Equal(t, new(big.Int).Mul(gasLimit, gasPrice).String(), fee.String()) + // Approve the fee amount + the token amount + _, err2 = ccipTH.Source.LinkToken.Approve(ccipTH.Source.User, ccipTH.Source.Router.Address(), new(big.Int).Add(fee, tokenAmount)) + require.NoError(t, err2) + ccipTH.Source.Chain.Commit() + _, err2 = ccipTH.Source.WrappedNative.Approve(ccipTH.Source.User, ccipTH.Source.Router.Address(), tokenAmount) + require.NoError(t, err2) + ccipTH.Source.Chain.Commit() + + ccipTH.SendRequest(t, msg) + // Should eventually see this executed. + ccipTH.AllNodesHaveReqSeqNum(t, currentSeqNum) + ccipTH.EventuallyReportCommitted(t, currentSeqNum) + + executionLogs := ccipTH.AllNodesHaveExecutedSeqNums(t, currentSeqNum, currentSeqNum) + assert.Len(t, executionLogs, 1) + ccipTH.AssertExecState(t, executionLogs[0], testhelpers.ExecutionStateSuccess) + + // Asserts + // 1) The total pool input == total pool output + // 2) Pool flow equals tokens sent + // 3) Sent tokens arrive at the receiver + ccipTH.AssertBalances(t, []testhelpers.BalanceAssertion{ + { + Name: testhelpers.SourcePool, + Address: ccipTH.Source.LinkTokenPool.Address(), + Expected: testhelpers.MustAddBigInt(sourceBalances[testhelpers.SourcePool], tokenAmount.String()).String(), + Getter: ccipTH.GetSourceLinkBalance, + }, + { + Name: testhelpers.SourcePriceRegistry, + Address: ccipTH.Source.PriceRegistry.Address(), + Expected: sourceBalances[testhelpers.SourcePriceRegistry].String(), + Getter: ccipTH.GetSourceLinkBalance, + }, + { + // Fees end up in the onramp. + Name: testhelpers.OnRamp, + Address: ccipTH.Source.OnRamp.Address(), + Expected: testhelpers.MustAddBigInt(sourceBalances[testhelpers.SourcePriceRegistry], fee.String()).String(), + Getter: ccipTH.GetSourceLinkBalance, + }, + { + Name: testhelpers.SourceRouter, + Address: ccipTH.Source.Router.Address(), + Expected: sourceBalances[testhelpers.SourceRouter].String(), + Getter: ccipTH.GetSourceLinkBalance, + }, + { + Name: testhelpers.Receiver, + Address: ccipTH.Dest.Receivers[0].Receiver.Address(), + Expected: testhelpers.MustAddBigInt(destBalances[testhelpers.Receiver], tokenAmount.String()).String(), + Getter: ccipTH.GetDestLinkBalance, + }, + { + Name: testhelpers.DestPool, + Address: ccipTH.Dest.LinkTokenPool.Address(), + Expected: testhelpers.MustSubBigInt(destBalances[testhelpers.DestPool], tokenAmount.String()).String(), + Getter: ccipTH.GetDestLinkBalance, + }, + { + Name: testhelpers.OffRamp, + Address: ccipTH.Dest.OffRamp.Address(), + Expected: destBalances[testhelpers.OffRamp].String(), + Getter: ccipTH.GetDestLinkBalance, + }, + }) + currentSeqNum++ + }) + + t.Run("multiple batches", func(t *testing.T) { + tokenAmount := big.NewInt(500000003) + gasLimit := big.NewInt(250_000) + + var txs []*gethtypes.Transaction + // Enough to require batched executions as gasLimit per tx is 250k -> 500k -> 750k .... + // The actual gas usage of executing 15 messages is higher than the gas limit for + // a single tx. This means that when batching is turned off, and we simply include + // all txs without checking gas, this also fails. + n := 15 + for i := 0; i < n; i++ { + txGasLimit := new(big.Int).Mul(gasLimit, big.NewInt(int64(i+1))) + extraArgs, err2 := testhelpers.GetEVMExtraArgsV1(txGasLimit, false) + require.NoError(t, err2) + msg := router.ClientEVM2AnyMessage{ + Receiver: testhelpers.MustEncodeAddress(t, ccipTH.Dest.Receivers[0].Receiver.Address()), + Data: []byte("hello"), + TokenAmounts: []router.ClientEVMTokenAmount{ + { + Token: ccipTH.Source.LinkToken.Address(), + Amount: tokenAmount, + }, + }, + FeeToken: ccipTH.Source.LinkToken.Address(), + ExtraArgs: extraArgs, + } + fee, err2 := ccipTH.Source.Router.GetFee(nil, testhelpers.DestChainSelector, msg) + require.NoError(t, err2) + // Currently no overhead and 1gwei dest gas price. So fee is simply gasLimit * gasPrice. + // require.Equal(t, new(big.Int).Mul(txGasLimit, gasPrice).String(), fee.String()) + // Approve the fee amount + the token amount + _, err2 = ccipTH.Source.LinkToken.Approve(ccipTH.Source.User, ccipTH.Source.Router.Address(), new(big.Int).Add(fee, tokenAmount)) + require.NoError(t, err2) + tx, err2 := ccipTH.Source.Router.CcipSend(ccipTH.Source.User, ccipTH.Dest.ChainSelector, msg) + require.NoError(t, err2) + txs = append(txs, tx) + } + + // Send a batch of requests in a single block + testhelpers_new.ConfirmTxs(t, txs, ccipTH.Source.Chain) + for i := 0; i < n; i++ { + ccipTH.AllNodesHaveReqSeqNum(t, currentSeqNum+i) + } + // Should see a report with the full range + ccipTH.EventuallyReportCommitted(t, currentSeqNum+n-1) + // Should all be executed + executionLogs := ccipTH.AllNodesHaveExecutedSeqNums(t, currentSeqNum, currentSeqNum+n-1) + for _, execLog := range executionLogs { + ccipTH.AssertExecState(t, execLog, testhelpers.ExecutionStateSuccess) + } + + currentSeqNum += n + }) + + // Deploy new on ramp,Commit store,off ramp + // Delete v1 jobs + // Send a number of requests + // Upgrade the router with new contracts + // create new jobs + // Verify all pending requests are sent after the contracts are upgraded + t.Run("upgrade contracts and verify requests can be sent with upgraded contract", func(t *testing.T) { + gasLimit := big.NewInt(200_003) // prime number + tokenAmount := big.NewInt(100) + commitStoreV1 := ccipTH.Dest.CommitStore + offRampV1 := ccipTH.Dest.OffRamp + onRampV1 := ccipTH.Source.OnRamp + // deploy v2 contracts + ccipTH.DeployNewOnRamp(t) + ccipTH.DeployNewCommitStore(t) + ccipTH.DeployNewOffRamp(t) + + // send a request as the v2 contracts are not enabled in router it should route through the v1 contracts + t.Logf("sending request for seqnum %d", currentSeqNum) + ccipTH.SendMessage(t, gasLimit, tokenAmount, ccipTH.Dest.Receivers[0].Receiver.Address()) + ccipTH.Source.Chain.Commit() + ccipTH.Dest.Chain.Commit() + t.Logf("verifying seqnum %d on previous onRamp %s", currentSeqNum, onRampV1.Address().Hex()) + ccipTH.AllNodesHaveReqSeqNum(t, currentSeqNum, onRampV1.Address()) + ccipTH.EventuallyReportCommitted(t, currentSeqNum, commitStoreV1.Address()) + executionLog := ccipTH.AllNodesHaveExecutedSeqNums(t, currentSeqNum, currentSeqNum, offRampV1.Address()) + ccipTH.AssertExecState(t, executionLog[0], testhelpers.ExecutionStateSuccess, offRampV1.Address()) + + nonceAtOnRampV1, err := onRampV1.GetSenderNonce(nil, ccipTH.Source.User.From) + require.NoError(t, err, "getting nonce from onRamp") + require.Equal(t, currentSeqNum, int(nonceAtOnRampV1)) + nonceAtOffRampV1, err := offRampV1.GetSenderNonce(nil, ccipTH.Source.User.From) + require.NoError(t, err, "getting nonce from offRamp") + require.Equal(t, currentSeqNum, int(nonceAtOffRampV1)) + + // enable the newly deployed contracts + newConfigBlock := ccipTH.Dest.Chain.Blockchain().CurrentBlock().Number.Int64() + ccipTH.EnableOnRamp(t) + ccipTH.EnableCommitStore(t) + ccipTH.EnableOffRamp(t) + srcStartBlock := ccipTH.Source.Chain.Blockchain().CurrentBlock().Number.Uint64() + + // send a number of requests, the requests should not be delivered yet as the previous contracts are not configured + // with the router anymore + startSeq := 1 + noOfRequests := 5 + endSeqNum := startSeq + noOfRequests + for i := startSeq; i <= endSeqNum; i++ { + t.Logf("sending request for seqnum %d", i) + ccipTH.SendMessage(t, gasLimit, tokenAmount, ccipTH.Dest.Receivers[0].Receiver.Address()) + ccipTH.Source.Chain.Commit() + ccipTH.Dest.Chain.Commit() + ccipTH.EventuallySendRequested(t, uint64(i)) + } + + // delete v1 jobs + for _, node := range ccipTH.Nodes { + id := node.FindJobIDForContract(t, commitStoreV1.Address()) + require.Greater(t, id, int32(0)) + t.Logf("deleting job %d", id) + err = node.App.DeleteJob(context.Background(), id) + require.NoError(t, err) + id = node.FindJobIDForContract(t, offRampV1.Address()) + require.Greater(t, id, int32(0)) + t.Logf("deleting job %d", id) + err = node.App.DeleteJob(context.Background(), id) + require.NoError(t, err) + } + + // Commit on both chains to reach Finality + ccipTH.Source.Chain.Commit() + ccipTH.Dest.Chain.Commit() + + // create new jobs + jobParams = ccipTH.NewCCIPJobSpecParams(tokenPricesUSDPipeline, priceGetterConfigJson, newConfigBlock, "") + jobParams.Version = "v2" + jobParams.SourceStartBlock = srcStartBlock + ccipTH.AddAllJobs(t, jobParams) + committedSeqNum := uint64(0) + // Now the requests should be delivered + for i := startSeq; i <= endSeqNum; i++ { + t.Logf("verifying seqnum %d", i) + ccipTH.AllNodesHaveReqSeqNum(t, i) + if committedSeqNum < uint64(i+1) { + committedSeqNum = ccipTH.EventuallyReportCommitted(t, i) + } + ccipTH.EventuallyExecutionStateChangedToSuccess(t, []uint64{uint64(i)}, uint64(newConfigBlock)) + } + + // nonces should be correctly synced from v1 contracts for the sender + nonceAtOnRampV2, err := ccipTH.Source.OnRamp.GetSenderNonce(nil, ccipTH.Source.User.From) + require.NoError(t, err, "getting nonce from onRamp") + nonceAtOffRampV2, err := ccipTH.Dest.OffRamp.GetSenderNonce(nil, ccipTH.Source.User.From) + require.NoError(t, err, "getting nonce from offRamp") + require.Equal(t, nonceAtOnRampV1+uint64(noOfRequests)+1, nonceAtOnRampV2, "nonce should be synced from v1 onRamps") + require.Equal(t, nonceAtOffRampV1+uint64(noOfRequests)+1, nonceAtOffRampV2, "nonce should be synced from v1 offRamps") + currentSeqNum = endSeqNum + 1 + }) + + t.Run("pay nops", func(t *testing.T) { + linkToTransferToOnRamp := big.NewInt(1e18) + + // transfer some link to onramp to pay the nops + _, err := ccipTH.Source.LinkToken.Transfer(ccipTH.Source.User, ccipTH.Source.OnRamp.Address(), linkToTransferToOnRamp) + require.NoError(t, err) + ccipTH.Source.Chain.Commit() + + srcBalReq := []testhelpers.BalanceReq{ + { + Name: testhelpers.Sender, + Addr: ccipTH.Source.User.From, + Getter: ccipTH.GetSourceWrappedTokenBalance, + }, + { + Name: testhelpers.OnRampNative, + Addr: ccipTH.Source.OnRamp.Address(), + Getter: ccipTH.GetSourceWrappedTokenBalance, + }, + { + Name: testhelpers.OnRamp, + Addr: ccipTH.Source.OnRamp.Address(), + Getter: ccipTH.GetSourceLinkBalance, + }, + { + Name: testhelpers.SourceRouter, + Addr: ccipTH.Source.Router.Address(), + Getter: ccipTH.GetSourceWrappedTokenBalance, + }, + } + + var nopsAndWeights []evm_2_evm_onramp.EVM2EVMOnRampNopAndWeight + var totalWeight uint16 + nodes := ccipTH.Nodes + for i := range nodes { + // For now set the transmitter addresses to be the same as the payee addresses + nodes[i].PaymentReceiver = nodes[i].Transmitter + nopsAndWeights = append(nopsAndWeights, evm_2_evm_onramp.EVM2EVMOnRampNopAndWeight{ + Nop: nodes[i].PaymentReceiver, + Weight: 5, + }) + totalWeight += 5 + srcBalReq = append(srcBalReq, testhelpers.BalanceReq{ + Name: fmt.Sprintf("node %d", i), + Addr: nodes[i].PaymentReceiver, + Getter: ccipTH.GetSourceLinkBalance, + }) + } + srcBalances, err := testhelpers.GetBalances(t, srcBalReq) + require.NoError(t, err) + + // set nops on the onramp + ccipTH.SetNopsOnRamp(t, nopsAndWeights) + + // send a message + extraArgs, err := testhelpers.GetEVMExtraArgsV1(big.NewInt(200_000), true) + require.NoError(t, err) + + // FeeToken is empty, indicating it should use native token + msg := router.ClientEVM2AnyMessage{ + Receiver: testhelpers.MustEncodeAddress(t, ccipTH.Dest.Receivers[1].Receiver.Address()), + Data: []byte("hello"), + TokenAmounts: []router.ClientEVMTokenAmount{}, + ExtraArgs: extraArgs, + FeeToken: common.Address{}, + } + fee, err := ccipTH.Source.Router.GetFee(nil, testhelpers.DestChainSelector, msg) + require.NoError(t, err) + + // verify message is sent + ccipTH.Source.User.Value = fee + ccipTH.SendRequest(t, msg) + ccipTH.Source.User.Value = nil + ccipTH.AllNodesHaveReqSeqNum(t, currentSeqNum) + ccipTH.EventuallyReportCommitted(t, currentSeqNum) + + executionLogs := ccipTH.AllNodesHaveExecutedSeqNums(t, currentSeqNum, currentSeqNum) + assert.Len(t, executionLogs, 1) + ccipTH.AssertExecState(t, executionLogs[0], testhelpers.ExecutionStateSuccess) + currentSeqNum++ + + // get the nop fee + nopFee, err := ccipTH.Source.OnRamp.GetNopFeesJuels(nil) + require.NoError(t, err) + t.Log("nopFee", nopFee) + + // withdraw fees and verify there is still fund left for nop payment + _, err = ccipTH.Source.OnRamp.WithdrawNonLinkFees( + ccipTH.Source.User, + ccipTH.Source.WrappedNative.Address(), + ccipTH.Source.User.From, + ) + require.NoError(t, err) + ccipTH.Source.Chain.Commit() + + // pay nops + _, err = ccipTH.Source.OnRamp.PayNops(ccipTH.Source.User) + require.NoError(t, err) + ccipTH.Source.Chain.Commit() + + srcBalanceAssertions := []testhelpers.BalanceAssertion{ + { + // Onramp should not have any balance left in wrapped native + Name: testhelpers.OnRampNative, + Address: ccipTH.Source.OnRamp.Address(), + Expected: big.NewInt(0).String(), + Getter: ccipTH.GetSourceWrappedTokenBalance, + }, + { + // Onramp should have the remaining link after paying nops + Name: testhelpers.OnRamp, + Address: ccipTH.Source.OnRamp.Address(), + Expected: new(big.Int).Sub(srcBalances[testhelpers.OnRamp], nopFee).String(), + Getter: ccipTH.GetSourceLinkBalance, + }, + { + Name: testhelpers.SourceRouter, + Address: ccipTH.Source.Router.Address(), + Expected: srcBalances[testhelpers.SourceRouter].String(), + Getter: ccipTH.GetSourceWrappedTokenBalance, + }, + // onRamp's balance (of previously sent fee during message sending) should have been transferred to + // the owner as a result of WithdrawNonLinkFees + { + Name: testhelpers.Sender, + Address: ccipTH.Source.User.From, + Expected: fee.String(), + Getter: ccipTH.GetSourceWrappedTokenBalance, + }, + } + + // the nodes should be paid according to the weights assigned + for i, node := range nodes { + paymentWeight := float64(nopsAndWeights[i].Weight) / float64(totalWeight) + paidInFloat := paymentWeight * float64(nopFee.Int64()) + paid, _ := new(big.Float).SetFloat64(paidInFloat).Int64() + bal := new(big.Int).Add( + new(big.Int).SetInt64(paid), + srcBalances[fmt.Sprintf("node %d", i)]).String() + srcBalanceAssertions = append(srcBalanceAssertions, testhelpers.BalanceAssertion{ + Name: fmt.Sprintf("node %d", i), + Address: node.PaymentReceiver, + Expected: bal, + Getter: ccipTH.GetSourceLinkBalance, + }) + } + ccipTH.AssertBalances(t, srcBalanceAssertions) + }) + + // Keep on sending a bunch of messages + // In the meantime update onchainConfig with new price registry address + // Verify if the jobs can pick up updated config + // Verify if all the messages are sent + t.Run("config change or price registry update while requests are inflight", func(t *testing.T) { + gasLimit := big.NewInt(200_003) // prime number + tokenAmount := big.NewInt(100) + msgWg := &sync.WaitGroup{} + msgWg.Add(1) + ticker := time.NewTicker(100 * time.Millisecond) + defer ticker.Stop() + startSeq := currentSeqNum + endSeq := currentSeqNum + 20 + + // send message with the old configs + ccipTH.SendMessage(t, gasLimit, tokenAmount, ccipTH.Dest.Receivers[0].Receiver.Address()) + ccipTH.Source.Chain.Commit() + + go func(ccipContracts testhelpers.CCIPContracts, currentSeqNum int) { + seqNumber := currentSeqNum + 1 + defer msgWg.Done() + for { + <-ticker.C // wait for ticker + t.Logf("sending request for seqnum %d", seqNumber) + ccipContracts.SendMessage(t, gasLimit, tokenAmount, ccipTH.Dest.Receivers[0].Receiver.Address()) + ccipContracts.Source.Chain.Commit() + seqNumber++ + if seqNumber == endSeq { + return + } + } + }(ccipTH.CCIPContracts, currentSeqNum) + + ccipTH.DeployNewPriceRegistry(t) + commitOnchainConfig := ccipTH.CreateDefaultCommitOnchainConfig(t) + commitOffchainConfig := ccipTH.CreateDefaultCommitOffchainConfig(t) + execOnchainConfig := ccipTH.CreateDefaultExecOnchainConfig(t) + execOffchainConfig := ccipTH.CreateDefaultExecOffchainConfig(t) + + ccipTH.SetupOnchainConfig(t, commitOnchainConfig, commitOffchainConfig, execOnchainConfig, execOffchainConfig) + + // wait for all requests to be complete + msgWg.Wait() + for i := startSeq; i < endSeq; i++ { + ccipTH.AllNodesHaveReqSeqNum(t, i) + ccipTH.EventuallyReportCommitted(t, i) + + executionLogs := ccipTH.AllNodesHaveExecutedSeqNums(t, i, i) + assert.Len(t, executionLogs, 1) + ccipTH.AssertExecState(t, executionLogs[0], testhelpers.ExecutionStateSuccess) + } + + for i, node := range ccipTH.Nodes { + t.Logf("verifying node %d", i) + node.EventuallyNodeUsesNewCommitConfig(t, ccipTH, ccipdata.CommitOnchainConfig{ + PriceRegistry: ccipTH.Dest.PriceRegistry.Address(), + }) + node.EventuallyNodeUsesNewExecConfig(t, ccipTH, v1_2_0.ExecOnchainConfig{ + PermissionLessExecutionThresholdSeconds: testhelpers.PermissionLessExecutionThresholdSeconds, + Router: ccipTH.Dest.Router.Address(), + PriceRegistry: ccipTH.Dest.PriceRegistry.Address(), + MaxDataBytes: 1e5, + MaxNumberOfTokensPerMsg: 5, + MaxPoolReleaseOrMintGas: 200_000, + }) + node.EventuallyNodeUsesUpdatedPriceRegistry(t, ccipTH) + } + currentSeqNum = endSeq + }) + }) + } +} diff --git a/core/services/ocr2/plugins/ccip/integration_test.go b/core/services/ocr2/plugins/ccip/integration_test.go new file mode 100644 index 00000000000..d14de4e0ab1 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/integration_test.go @@ -0,0 +1,710 @@ +package ccip_test + +import ( + "context" + "encoding/json" + "fmt" + "math/big" + "sync" + "testing" + "time" + + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip" + + "github.com/ethereum/go-ethereum/common" + gethtypes "github.com/ethereum/go-ethereum/core/types" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/evm_2_evm_onramp" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/router" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/mock_v3_aggregator_contract" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/config" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_5_0" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/testhelpers" + integrationtesthelpers "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/testhelpers/integration" +) + +func TestIntegration_CCIP(t *testing.T) { + // Run the batches of tests for both pipeline and dynamic price getter setups. + // We will remove the pipeline batch once the feature is deleted from the code. + tests := []struct { + name string + withPipeline bool + allowOutOfOrderExecution bool + }{ + { + name: "with pipeline allowOutOfOrderExecution true", + withPipeline: true, + allowOutOfOrderExecution: true, + }, + { + name: "with dynamic price getter allowOutOfOrderExecution false", + withPipeline: false, + allowOutOfOrderExecution: false, + }, + } + + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + ccipTH := integrationtesthelpers.SetupCCIPIntegrationTH( + t, + testhelpers.SourceChainID, + testhelpers.SourceChainSelector, + testhelpers.DestChainID, + testhelpers.DestChainSelector, + ccip.DefaultSourceFinalityDepth, + ccip.DefaultDestFinalityDepth, + ) + + tokenPricesUSDPipeline := "" + priceGetterConfigJson := "" + + if test.withPipeline { + // Set up a test pipeline. + testPricePipeline, linkUSD, ethUSD := ccipTH.CreatePricesPipeline(t) + defer linkUSD.Close() + defer ethUSD.Close() + tokenPricesUSDPipeline = testPricePipeline + } else { + // Set up a test price getter. + // Set up the aggregators here to avoid modifying ccipTH. + aggSrcNatAddr, _, aggSrcNat, err := mock_v3_aggregator_contract.DeployMockV3AggregatorContract(ccipTH.Source.User, ccipTH.Source.Chain, 18, big.NewInt(2e18)) + require.NoError(t, err) + _, err = aggSrcNat.UpdateRoundData(ccipTH.Source.User, big.NewInt(50), big.NewInt(17000000), big.NewInt(1000), big.NewInt(1000)) + require.NoError(t, err) + ccipTH.Source.Chain.Commit() + + aggDstLnkAddr, _, aggDstLnk, err := mock_v3_aggregator_contract.DeployMockV3AggregatorContract(ccipTH.Dest.User, ccipTH.Dest.Chain, 18, big.NewInt(3e18)) + require.NoError(t, err) + ccipTH.Dest.Chain.Commit() + _, err = aggDstLnk.UpdateRoundData(ccipTH.Dest.User, big.NewInt(50), big.NewInt(8000000), big.NewInt(1000), big.NewInt(1000)) + require.NoError(t, err) + ccipTH.Dest.Chain.Commit() + + priceGetterConfig := config.DynamicPriceGetterConfig{ + AggregatorPrices: map[common.Address]config.AggregatorPriceConfig{ + ccipTH.Source.WrappedNative.Address(): { + ChainID: ccipTH.Source.ChainID, + AggregatorContractAddress: aggSrcNatAddr, + }, + ccipTH.Dest.LinkToken.Address(): { + ChainID: ccipTH.Dest.ChainID, + AggregatorContractAddress: aggDstLnkAddr, + }, + ccipTH.Dest.WrappedNative.Address(): { + ChainID: ccipTH.Dest.ChainID, + AggregatorContractAddress: aggDstLnkAddr, + }, + }, + StaticPrices: map[common.Address]config.StaticPriceConfig{}, + } + priceGetterConfigBytes, err := json.MarshalIndent(priceGetterConfig, "", " ") + require.NoError(t, err) + priceGetterConfigJson = string(priceGetterConfigBytes) + } + + jobParams := ccipTH.SetUpNodesAndJobs(t, tokenPricesUSDPipeline, priceGetterConfigJson, "") + + // track sequence number and nonce separately since nonce doesn't bump for messages with allowOutOfOrderExecution == true, + // but sequence number always bumps. + // for this test, when test.outOfOrder == false, sequence number and nonce are equal. + // when test.outOfOrder == true, nonce is not bumped at all, so sequence number and nonce are NOT equal. + currentSeqNum := 1 + currentNonce := uint64(1) + + t.Run("single", func(t *testing.T) { + tokenAmount := big.NewInt(500000003) // prime number + gasLimit := big.NewInt(200_003) // prime number + + extraArgs, err2 := testhelpers.GetEVMExtraArgsV2(gasLimit, test.allowOutOfOrderExecution) + require.NoError(t, err2) + + sourceBalances, err2 := testhelpers.GetBalances(t, []testhelpers.BalanceReq{ + {Name: testhelpers.SourcePool, Addr: ccipTH.Source.LinkTokenPool.Address(), Getter: ccipTH.GetSourceLinkBalance}, + {Name: testhelpers.OnRamp, Addr: ccipTH.Source.OnRamp.Address(), Getter: ccipTH.GetSourceLinkBalance}, + {Name: testhelpers.SourceRouter, Addr: ccipTH.Source.Router.Address(), Getter: ccipTH.GetSourceLinkBalance}, + {Name: testhelpers.SourcePriceRegistry, Addr: ccipTH.Source.PriceRegistry.Address(), Getter: ccipTH.GetSourceLinkBalance}, + }) + require.NoError(t, err2) + destBalances, err2 := testhelpers.GetBalances(t, []testhelpers.BalanceReq{ + {Name: testhelpers.Receiver, Addr: ccipTH.Dest.Receivers[0].Receiver.Address(), Getter: ccipTH.GetDestLinkBalance}, + {Name: testhelpers.DestPool, Addr: ccipTH.Dest.LinkTokenPool.Address(), Getter: ccipTH.GetDestLinkBalance}, + {Name: testhelpers.OffRamp, Addr: ccipTH.Dest.OffRamp.Address(), Getter: ccipTH.GetDestLinkBalance}, + }) + require.NoError(t, err2) + + ccipTH.Source.User.Value = tokenAmount + _, err2 = ccipTH.Source.WrappedNative.Deposit(ccipTH.Source.User) + require.NoError(t, err2) + ccipTH.Source.Chain.Commit() + ccipTH.Source.User.Value = nil + + msg := router.ClientEVM2AnyMessage{ + Receiver: testhelpers.MustEncodeAddress(t, ccipTH.Dest.Receivers[0].Receiver.Address()), + Data: []byte("hello"), + TokenAmounts: []router.ClientEVMTokenAmount{ + { + Token: ccipTH.Source.LinkToken.Address(), + Amount: tokenAmount, + }, + { + Token: ccipTH.Source.WrappedNative.Address(), + Amount: tokenAmount, + }, + }, + FeeToken: ccipTH.Source.LinkToken.Address(), + ExtraArgs: extraArgs, + } + fee, err2 := ccipTH.Source.Router.GetFee(nil, testhelpers.DestChainSelector, msg) + require.NoError(t, err2) + // Currently no overhead and 10gwei dest gas price. So fee is simply (gasLimit * gasPrice)* link/native + // require.Equal(t, new(big.Int).Mul(gasLimit, gasPrice).String(), fee.String()) + // Approve the fee amount + the token amount + _, err2 = ccipTH.Source.LinkToken.Approve(ccipTH.Source.User, ccipTH.Source.Router.Address(), new(big.Int).Add(fee, tokenAmount)) + require.NoError(t, err2) + ccipTH.Source.Chain.Commit() + _, err2 = ccipTH.Source.WrappedNative.Approve(ccipTH.Source.User, ccipTH.Source.Router.Address(), tokenAmount) + require.NoError(t, err2) + ccipTH.Source.Chain.Commit() + + beforeNonce, err := ccipTH.Source.OnRamp.GetSenderNonce(nil, ccipTH.Source.User.From) + require.NoError(t, err) + ccipTH.SendRequest(t, msg) + // TODO: can this be moved into SendRequest? + if test.allowOutOfOrderExecution { + // the nonce for that sender must not be bumped for allowOutOfOrderExecution == true messages. + nonce, err2 := ccipTH.Source.OnRamp.GetSenderNonce(nil, ccipTH.Source.User.From) + require.NoError(t, err2) + require.Equal(t, beforeNonce, nonce, "nonce must not be bumped for allowOutOfOrderExecution == true requests") + } else { + // the nonce for that sender must be bumped for allowOutOfOrderExecution == false messages. + nonce, err2 := ccipTH.Source.OnRamp.GetSenderNonce(nil, ccipTH.Source.User.From) + require.NoError(t, err2) + require.Equal(t, beforeNonce+1, nonce, "nonce must be bumped for allowOutOfOrderExecution == false requests") + } + + // Should eventually see this executed. + ccipTH.AllNodesHaveReqSeqNum(t, currentSeqNum) + ccipTH.EventuallyReportCommitted(t, currentSeqNum) + + executionLogs := ccipTH.AllNodesHaveExecutedSeqNums(t, currentSeqNum, currentSeqNum) + assert.Len(t, executionLogs, 1) + ccipTH.AssertExecState(t, executionLogs[0], testhelpers.ExecutionStateSuccess) + + // Asserts + // 1) The total pool input == total pool output + // 2) Pool flow equals tokens sent + // 3) Sent tokens arrive at the receiver + ccipTH.AssertBalances(t, []testhelpers.BalanceAssertion{ + { + Name: testhelpers.SourcePool, + Address: ccipTH.Source.LinkTokenPool.Address(), + Expected: testhelpers.MustAddBigInt(sourceBalances[testhelpers.SourcePool], tokenAmount.String()).String(), + Getter: ccipTH.GetSourceLinkBalance, + }, + { + Name: testhelpers.SourcePriceRegistry, + Address: ccipTH.Source.PriceRegistry.Address(), + Expected: sourceBalances[testhelpers.SourcePriceRegistry].String(), + Getter: ccipTH.GetSourceLinkBalance, + }, + { + // Fees end up in the onramp. + Name: testhelpers.OnRamp, + Address: ccipTH.Source.OnRamp.Address(), + Expected: testhelpers.MustAddBigInt(sourceBalances[testhelpers.SourcePriceRegistry], fee.String()).String(), + Getter: ccipTH.GetSourceLinkBalance, + }, + { + Name: testhelpers.SourceRouter, + Address: ccipTH.Source.Router.Address(), + Expected: sourceBalances[testhelpers.SourceRouter].String(), + Getter: ccipTH.GetSourceLinkBalance, + }, + { + Name: testhelpers.Receiver, + Address: ccipTH.Dest.Receivers[0].Receiver.Address(), + Expected: testhelpers.MustAddBigInt(destBalances[testhelpers.Receiver], tokenAmount.String()).String(), + Getter: ccipTH.GetDestLinkBalance, + }, + { + Name: testhelpers.DestPool, + Address: ccipTH.Dest.LinkTokenPool.Address(), + Expected: testhelpers.MustSubBigInt(destBalances[testhelpers.DestPool], tokenAmount.String()).String(), + Getter: ccipTH.GetDestLinkBalance, + }, + { + Name: testhelpers.OffRamp, + Address: ccipTH.Dest.OffRamp.Address(), + Expected: destBalances[testhelpers.OffRamp].String(), + Getter: ccipTH.GetDestLinkBalance, + }, + }) + currentSeqNum++ + if !test.allowOutOfOrderExecution { + currentNonce = uint64(currentSeqNum) + } + }) + + t.Run("multiple batches", func(t *testing.T) { + tokenAmount := big.NewInt(500000003) + gasLimit := big.NewInt(250_000) + + var txs []*gethtypes.Transaction + // Enough to require batched executions as gasLimit per tx is 250k -> 500k -> 750k .... + // The actual gas usage of executing 15 messages is higher than the gas limit for + // a single tx. This means that when batching is turned off, and we simply include + // all txs without checking gas, this also fails. + n := 15 + for i := 0; i < n; i++ { + txGasLimit := new(big.Int).Mul(gasLimit, big.NewInt(int64(i+1))) + + // interleave ordered and non-ordered messages. + allowOutOfOrderExecution := false + if i%2 == 0 { + allowOutOfOrderExecution = true + } + extraArgs, err2 := testhelpers.GetEVMExtraArgsV2(txGasLimit, allowOutOfOrderExecution) + require.NoError(t, err2) + msg := router.ClientEVM2AnyMessage{ + Receiver: testhelpers.MustEncodeAddress(t, ccipTH.Dest.Receivers[0].Receiver.Address()), + Data: []byte("hello"), + TokenAmounts: []router.ClientEVMTokenAmount{ + { + Token: ccipTH.Source.LinkToken.Address(), + Amount: tokenAmount, + }, + }, + FeeToken: ccipTH.Source.LinkToken.Address(), + ExtraArgs: extraArgs, + } + fee, err2 := ccipTH.Source.Router.GetFee(nil, testhelpers.DestChainSelector, msg) + require.NoError(t, err2) + // Currently no overhead and 1gwei dest gas price. So fee is simply gasLimit * gasPrice. + // require.Equal(t, new(big.Int).Mul(txGasLimit, gasPrice).String(), fee.String()) + // Approve the fee amount + the token amount + _, err2 = ccipTH.Source.LinkToken.Approve(ccipTH.Source.User, ccipTH.Source.Router.Address(), new(big.Int).Add(fee, tokenAmount)) + require.NoError(t, err2) + tx, err2 := ccipTH.Source.Router.CcipSend(ccipTH.Source.User, ccipTH.Dest.ChainSelector, msg) + require.NoError(t, err2) + txs = append(txs, tx) + if !allowOutOfOrderExecution { + currentNonce++ + } + } + + // Send a batch of requests in a single block + testhelpers.ConfirmTxs(t, txs, ccipTH.Source.Chain) + for i := 0; i < n; i++ { + ccipTH.AllNodesHaveReqSeqNum(t, currentSeqNum+i) + } + // Should see a report with the full range + ccipTH.EventuallyReportCommitted(t, currentSeqNum+n-1) + // Should all be executed + executionLogs := ccipTH.AllNodesHaveExecutedSeqNums(t, currentSeqNum, currentSeqNum+n-1) + for _, execLog := range executionLogs { + ccipTH.AssertExecState(t, execLog, testhelpers.ExecutionStateSuccess) + } + + currentSeqNum += n + }) + + // Deploy new on ramp,Commit store,off ramp + // Delete v1 jobs + // Send a number of requests + // Upgrade the router with new contracts + // create new jobs + // Verify all pending requests are sent after the contracts are upgraded + t.Run("upgrade contracts and verify requests can be sent with upgraded contract", func(t *testing.T) { + gasLimit := big.NewInt(200_003) // prime number + tokenAmount := big.NewInt(100) + commitStoreV1 := ccipTH.Dest.CommitStore + offRampV1 := ccipTH.Dest.OffRamp + onRampV1 := ccipTH.Source.OnRamp + // deploy v2 contracts + ccipTH.DeployNewOnRamp(t) + ccipTH.DeployNewCommitStore(t) + ccipTH.DeployNewOffRamp(t) + + // send a request as the v2 contracts are not enabled in router it should route through the v1 contracts + t.Logf("sending request for seqnum %d", currentSeqNum) + ccipTH.SendMessage(t, gasLimit, tokenAmount, ccipTH.Dest.Receivers[0].Receiver.Address()) + ccipTH.Source.Chain.Commit() + ccipTH.Dest.Chain.Commit() + t.Logf("verifying seqnum %d on previous onRamp %s", currentSeqNum, onRampV1.Address().Hex()) + ccipTH.AllNodesHaveReqSeqNum(t, currentSeqNum, onRampV1.Address()) + ccipTH.EventuallyReportCommitted(t, currentSeqNum, commitStoreV1.Address()) + executionLog := ccipTH.AllNodesHaveExecutedSeqNums(t, currentSeqNum, currentSeqNum, offRampV1.Address()) + ccipTH.AssertExecState(t, executionLog[0], testhelpers.ExecutionStateSuccess, offRampV1.Address()) + + nonceAtOnRampV1, err := onRampV1.GetSenderNonce(nil, ccipTH.Source.User.From) + require.NoError(t, err, "getting nonce from onRamp") + require.Equal(t, currentNonce, nonceAtOnRampV1, "nonce should be synced from v1 onRamp") + nonceAtOffRampV1, err := offRampV1.GetSenderNonce(nil, ccipTH.Source.User.From) + require.NoError(t, err, "getting nonce from offRamp") + require.Equal(t, currentNonce, nonceAtOffRampV1, "nonce should be synced from v1 offRamp") + + // enable the newly deployed contracts + newConfigBlock := ccipTH.Dest.Chain.Blockchain().CurrentBlock().Number.Int64() + ccipTH.EnableOnRamp(t) + ccipTH.EnableCommitStore(t) + ccipTH.EnableOffRamp(t) + srcStartBlock := ccipTH.Source.Chain.Blockchain().CurrentBlock().Number.Uint64() + + // send a number of requests, the requests should not be delivered yet as the previous contracts are not configured + // with the router anymore + startSeq := 1 + noOfRequests := 5 + endSeqNum := startSeq + noOfRequests + for i := startSeq; i <= endSeqNum; i++ { + t.Logf("sending request for seqnum %d", i) + ccipTH.SendMessage(t, gasLimit, tokenAmount, ccipTH.Dest.Receivers[0].Receiver.Address()) + ccipTH.Source.Chain.Commit() + ccipTH.Dest.Chain.Commit() + ccipTH.EventuallySendRequested(t, uint64(i)) + } + + // delete v1 jobs + for _, node := range ccipTH.Nodes { + id := node.FindJobIDForContract(t, commitStoreV1.Address()) + require.Greater(t, id, int32(0)) + t.Logf("deleting job %d", id) + err = node.App.DeleteJob(context.Background(), id) + require.NoError(t, err) + id = node.FindJobIDForContract(t, offRampV1.Address()) + require.Greater(t, id, int32(0)) + t.Logf("deleting job %d", id) + err = node.App.DeleteJob(context.Background(), id) + require.NoError(t, err) + } + + // Commit on both chains to reach Finality + ccipTH.Source.Chain.Commit() + ccipTH.Dest.Chain.Commit() + + // create new jobs + jobParams = ccipTH.NewCCIPJobSpecParams(tokenPricesUSDPipeline, priceGetterConfigJson, newConfigBlock, "") + jobParams.Version = "v2" + jobParams.SourceStartBlock = srcStartBlock + ccipTH.AddAllJobs(t, jobParams) + committedSeqNum := uint64(0) + // Now the requests should be delivered + for i := startSeq; i <= endSeqNum; i++ { + t.Logf("verifying seqnum %d", i) + ccipTH.AllNodesHaveReqSeqNum(t, i) + if committedSeqNum < uint64(i+1) { + committedSeqNum = ccipTH.EventuallyReportCommitted(t, i) + } + ccipTH.EventuallyExecutionStateChangedToSuccess(t, []uint64{uint64(i)}, uint64(newConfigBlock)) + } + + // nonces should be correctly synced from v1 contracts for the sender + nonceAtOnRampV2, err := ccipTH.Source.OnRamp.GetSenderNonce(nil, ccipTH.Source.User.From) + require.NoError(t, err, "getting nonce from onRamp") + nonceAtOffRampV2, err := ccipTH.Dest.OffRamp.GetSenderNonce(nil, ccipTH.Source.User.From) + require.NoError(t, err, "getting nonce from offRamp") + require.Equal(t, nonceAtOnRampV1+uint64(noOfRequests)+1, nonceAtOnRampV2, "nonce should be synced from v1 onRamps") + require.Equal(t, nonceAtOffRampV1+uint64(noOfRequests)+1, nonceAtOffRampV2, "nonce should be synced from v1 offRamps") + currentSeqNum = endSeqNum + 1 + if !test.allowOutOfOrderExecution { + currentNonce = uint64(currentSeqNum) + } + }) + + t.Run("pay nops", func(t *testing.T) { + linkToTransferToOnRamp := big.NewInt(1e18) + + // transfer some link to onramp to pay the nops + _, err := ccipTH.Source.LinkToken.Transfer(ccipTH.Source.User, ccipTH.Source.OnRamp.Address(), linkToTransferToOnRamp) + require.NoError(t, err) + ccipTH.Source.Chain.Commit() + + srcBalReq := []testhelpers.BalanceReq{ + { + Name: testhelpers.Sender, + Addr: ccipTH.Source.User.From, + Getter: ccipTH.GetSourceWrappedTokenBalance, + }, + { + Name: testhelpers.OnRampNative, + Addr: ccipTH.Source.OnRamp.Address(), + Getter: ccipTH.GetSourceWrappedTokenBalance, + }, + { + Name: testhelpers.OnRamp, + Addr: ccipTH.Source.OnRamp.Address(), + Getter: ccipTH.GetSourceLinkBalance, + }, + { + Name: testhelpers.SourceRouter, + Addr: ccipTH.Source.Router.Address(), + Getter: ccipTH.GetSourceWrappedTokenBalance, + }, + } + + var nopsAndWeights []evm_2_evm_onramp.EVM2EVMOnRampNopAndWeight + var totalWeight uint16 + nodes := ccipTH.Nodes + for i := range nodes { + // For now set the transmitter addresses to be the same as the payee addresses + nodes[i].PaymentReceiver = nodes[i].Transmitter + nopsAndWeights = append(nopsAndWeights, evm_2_evm_onramp.EVM2EVMOnRampNopAndWeight{ + Nop: nodes[i].PaymentReceiver, + Weight: 5, + }) + totalWeight += 5 + srcBalReq = append(srcBalReq, testhelpers.BalanceReq{ + Name: fmt.Sprintf("node %d", i), + Addr: nodes[i].PaymentReceiver, + Getter: ccipTH.GetSourceLinkBalance, + }) + } + srcBalances, err := testhelpers.GetBalances(t, srcBalReq) + require.NoError(t, err) + + // set nops on the onramp + ccipTH.SetNopsOnRamp(t, nopsAndWeights) + + // send a message + extraArgs, err := testhelpers.GetEVMExtraArgsV2(big.NewInt(200_000), test.allowOutOfOrderExecution) + require.NoError(t, err) + + // FeeToken is empty, indicating it should use native token + msg := router.ClientEVM2AnyMessage{ + Receiver: testhelpers.MustEncodeAddress(t, ccipTH.Dest.Receivers[1].Receiver.Address()), + Data: []byte("hello"), + TokenAmounts: []router.ClientEVMTokenAmount{}, + ExtraArgs: extraArgs, + FeeToken: common.Address{}, + } + fee, err := ccipTH.Source.Router.GetFee(nil, testhelpers.DestChainSelector, msg) + require.NoError(t, err) + + // verify message is sent + ccipTH.Source.User.Value = fee + ccipTH.SendRequest(t, msg) + ccipTH.Source.User.Value = nil + ccipTH.AllNodesHaveReqSeqNum(t, currentSeqNum) + ccipTH.EventuallyReportCommitted(t, currentSeqNum) + + executionLogs := ccipTH.AllNodesHaveExecutedSeqNums(t, currentSeqNum, currentSeqNum) + assert.Len(t, executionLogs, 1) + ccipTH.AssertExecState(t, executionLogs[0], testhelpers.ExecutionStateSuccess) + currentSeqNum++ + if test.allowOutOfOrderExecution { + currentNonce = uint64(currentSeqNum) + } + + // get the nop fee + nopFee, err := ccipTH.Source.OnRamp.GetNopFeesJuels(nil) + require.NoError(t, err) + t.Log("nopFee", nopFee) + + // withdraw fees and verify there is still fund left for nop payment + _, err = ccipTH.Source.OnRamp.WithdrawNonLinkFees( + ccipTH.Source.User, + ccipTH.Source.WrappedNative.Address(), + ccipTH.Source.User.From, + ) + require.NoError(t, err) + ccipTH.Source.Chain.Commit() + + // pay nops + _, err = ccipTH.Source.OnRamp.PayNops(ccipTH.Source.User) + require.NoError(t, err) + ccipTH.Source.Chain.Commit() + + srcBalanceAssertions := []testhelpers.BalanceAssertion{ + { + // Onramp should not have any balance left in wrapped native + Name: testhelpers.OnRampNative, + Address: ccipTH.Source.OnRamp.Address(), + Expected: big.NewInt(0).String(), + Getter: ccipTH.GetSourceWrappedTokenBalance, + }, + { + // Onramp should have the remaining link after paying nops + Name: testhelpers.OnRamp, + Address: ccipTH.Source.OnRamp.Address(), + Expected: new(big.Int).Sub(srcBalances[testhelpers.OnRamp], nopFee).String(), + Getter: ccipTH.GetSourceLinkBalance, + }, + { + Name: testhelpers.SourceRouter, + Address: ccipTH.Source.Router.Address(), + Expected: srcBalances[testhelpers.SourceRouter].String(), + Getter: ccipTH.GetSourceWrappedTokenBalance, + }, + // onRamp's balance (of previously sent fee during message sending) should have been transferred to + // the owner as a result of WithdrawNonLinkFees + { + Name: testhelpers.Sender, + Address: ccipTH.Source.User.From, + Expected: fee.String(), + Getter: ccipTH.GetSourceWrappedTokenBalance, + }, + } + + // the nodes should be paid according to the weights assigned + for i, node := range nodes { + paymentWeight := float64(nopsAndWeights[i].Weight) / float64(totalWeight) + paidInFloat := paymentWeight * float64(nopFee.Int64()) + paid, _ := new(big.Float).SetFloat64(paidInFloat).Int64() + bal := new(big.Int).Add( + new(big.Int).SetInt64(paid), + srcBalances[fmt.Sprintf("node %d", i)]).String() + srcBalanceAssertions = append(srcBalanceAssertions, testhelpers.BalanceAssertion{ + Name: fmt.Sprintf("node %d", i), + Address: node.PaymentReceiver, + Expected: bal, + Getter: ccipTH.GetSourceLinkBalance, + }) + } + ccipTH.AssertBalances(t, srcBalanceAssertions) + }) + + // Keep on sending a bunch of messages + // In the meantime update onchainConfig with new price registry address + // Verify if the jobs can pick up updated config + // Verify if all the messages are sent + t.Run("config change or price registry update while requests are inflight", func(t *testing.T) { + gasLimit := big.NewInt(200_003) // prime number + tokenAmount := big.NewInt(100) + msgWg := &sync.WaitGroup{} + msgWg.Add(1) + ticker := time.NewTicker(100 * time.Millisecond) + defer ticker.Stop() + startSeq := currentSeqNum + endSeq := currentSeqNum + 20 + + // send message with the old configs + ccipTH.SendMessage(t, gasLimit, tokenAmount, ccipTH.Dest.Receivers[0].Receiver.Address()) + ccipTH.Source.Chain.Commit() + + go func(ccipContracts testhelpers.CCIPContracts, currentSeqNum int) { + seqNumber := currentSeqNum + 1 + defer msgWg.Done() + for { + <-ticker.C // wait for ticker + t.Logf("sending request for seqnum %d", seqNumber) + ccipContracts.SendMessage(t, gasLimit, tokenAmount, ccipTH.Dest.Receivers[0].Receiver.Address()) + ccipContracts.Source.Chain.Commit() + seqNumber++ + if seqNumber == endSeq { + return + } + } + }(ccipTH.CCIPContracts, currentSeqNum) + + ccipTH.DeployNewPriceRegistry(t) + commitOnchainConfig := ccipTH.CreateDefaultCommitOnchainConfig(t) + commitOffchainConfig := ccipTH.CreateDefaultCommitOffchainConfig(t) + execOnchainConfig := ccipTH.CreateDefaultExecOnchainConfig(t) + execOffchainConfig := ccipTH.CreateDefaultExecOffchainConfig(t) + + ccipTH.SetupOnchainConfig(t, commitOnchainConfig, commitOffchainConfig, execOnchainConfig, execOffchainConfig) + + // wait for all requests to be complete + msgWg.Wait() + for i := startSeq; i < endSeq; i++ { + ccipTH.AllNodesHaveReqSeqNum(t, i) + ccipTH.EventuallyReportCommitted(t, i) + + executionLogs := ccipTH.AllNodesHaveExecutedSeqNums(t, i, i) + assert.Len(t, executionLogs, 1) + ccipTH.AssertExecState(t, executionLogs[0], testhelpers.ExecutionStateSuccess) + } + + for i, node := range ccipTH.Nodes { + t.Logf("verifying node %d", i) + node.EventuallyNodeUsesNewCommitConfig(t, ccipTH, ccipdata.CommitOnchainConfig{ + PriceRegistry: ccipTH.Dest.PriceRegistry.Address(), + }) + node.EventuallyNodeUsesNewExecConfig(t, ccipTH, v1_5_0.ExecOnchainConfig{ + PermissionLessExecutionThresholdSeconds: testhelpers.PermissionLessExecutionThresholdSeconds, + Router: ccipTH.Dest.Router.Address(), + PriceRegistry: ccipTH.Dest.PriceRegistry.Address(), + MaxDataBytes: 1e5, + MaxNumberOfTokensPerMsg: 5, + }) + node.EventuallyNodeUsesUpdatedPriceRegistry(t, ccipTH) + } + currentSeqNum = endSeq + if test.allowOutOfOrderExecution { + currentNonce = uint64(currentSeqNum) + } + }) + }) + } +} + +// TestReorg ensures that CCIP works even when a below finality depth reorg happens +func TestReorg(t *testing.T) { + // We need higher finality depth on the destination to perform reorg deep enough to revert commit and execution reports + destinationFinalityDepth := uint32(50) + ccipTH := integrationtesthelpers.SetupCCIPIntegrationTH( + t, + testhelpers.SourceChainID, + testhelpers.SourceChainSelector, + testhelpers.DestChainID, + testhelpers.DestChainSelector, + ccip.DefaultSourceFinalityDepth, + destinationFinalityDepth, + ) + testPricePipeline, linkUSD, ethUSD := ccipTH.CreatePricesPipeline(t) + defer linkUSD.Close() + defer ethUSD.Close() + ccipTH.SetUpNodesAndJobs(t, testPricePipeline, "", "") + + gasLimit := big.NewInt(200_00) + tokenAmount := big.NewInt(1) + + forkBlock, err := ccipTH.Dest.Chain.BlockByNumber(context.Background(), nil) + require.NoError(t, err, "Error while fetching the destination chain current block number") + + // Adjust time to start next blocks with timestamps two hours after the fork block. + // This is critical to have two forks with different block_timestamps. + err = ccipTH.Dest.Chain.AdjustTime(2 * time.Hour) + require.NoError(t, err, "Error while adjusting the destination chain time") + ccipTH.Dest.Chain.Commit() + + // Send request for the first time and make sure it's executed on the destination + ccipTH.SendMessage(t, gasLimit, tokenAmount, ccipTH.Dest.Receivers[0].Receiver.Address()) + ccipTH.Dest.User.GasLimit = 100000 + ccipTH.EventuallySendRequested(t, uint64(1)) + ccipTH.EventuallyReportCommitted(t, 1) + executionLog := ccipTH.AllNodesHaveExecutedSeqNums(t, 1, 1) + ccipTH.AssertExecState(t, executionLog[0], testhelpers.ExecutionStateSuccess) + + currentBlock, err := ccipTH.Dest.Chain.BlockByNumber(context.Background(), nil) + require.NoError(t, err, "Error while fetching the current block number of destination chain") + + // Reorg back to the `forkBlock`. Next blocks in the fork will have block_timestamps right after the fork, + // but before the 2 hours interval defined above for the canonical chain + require.NoError(t, ccipTH.Dest.Chain.Fork(testutils.Context(t), forkBlock.Hash()), + "Error while forking the chain") + // Make sure that fork is longer than the canonical chain to enforce switch + noOfBlocks := uint(currentBlock.NumberU64() - forkBlock.NumberU64()) + for i := uint(0); i < noOfBlocks+1; i++ { + ccipTH.Dest.Chain.Commit() + } + + // State of the chain (block_timestamps) after reorg: + // / --> block1 (02:01) --> block2 (02:02) --> commit report (02:03) --> ... + // forkBlock (00:00) --> block1' (00:01) --> block2' (00:02) --> commit report' (00:03) --> ... + + // CCIP should commit and executed messages that was reorged away + ccipTH.EventuallyReportCommitted(t, 1) + executionLog = ccipTH.AllNodesHaveExecutedSeqNums(t, 1, 1) + ccipTH.AssertExecState(t, executionLog[0], testhelpers.ExecutionStateSuccess) + + // Sending another message and make sure it's executed on the destination + ccipTH.SendMessage(t, gasLimit, tokenAmount, ccipTH.Dest.Receivers[0].Receiver.Address()) + ccipTH.EventuallySendRequested(t, uint64(2)) + ccipTH.EventuallyReportCommitted(t, 2) + executionLog = ccipTH.AllNodesHaveExecutedSeqNums(t, 1, 2) + ccipTH.AssertExecState(t, executionLog[0], testhelpers.ExecutionStateSuccess) +} diff --git a/core/services/ocr2/plugins/ccip/internal/cache/autosync.go b/core/services/ocr2/plugins/ccip/internal/cache/autosync.go new file mode 100644 index 00000000000..690b4dd05b9 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/cache/autosync.go @@ -0,0 +1,141 @@ +package cache + +import ( + "context" + "database/sql" + "fmt" + "sync" + + "github.com/ethereum/go-ethereum/common" + "github.com/pkg/errors" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" + evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" +) + +type AutoSync[T any] interface { + Get(ctx context.Context, syncFunc func(ctx context.Context) (T, error)) (T, error) +} + +// LogpollerEventsBased IMPORTANT: Cache refresh relies on the events that are finalized. +// This introduces some delay between the event onchain occurrence and cache refreshing. +// This is intentional, because we want to prevent handling reorgs within the cache. +type LogpollerEventsBased[T any] struct { + logPoller logpoller.LogPoller + observedEvents []common.Hash + address common.Address + + lock *sync.RWMutex + value T + lastChangeBlock int64 +} + +func NewLogpollerEventsBased[T any]( + lp logpoller.LogPoller, + observedEvents []common.Hash, + contractAddress common.Address, +) *LogpollerEventsBased[T] { + var emptyValue T + return &LogpollerEventsBased[T]{ + logPoller: lp, + observedEvents: observedEvents, + address: contractAddress, + + lock: &sync.RWMutex{}, + value: emptyValue, + lastChangeBlock: 0, + } +} + +func (c *LogpollerEventsBased[T]) Get(ctx context.Context, syncFunc func(ctx context.Context) (T, error)) (T, error) { + var empty T + + hasExpired, newEventBlockNum, err := c.hasExpired(ctx) + if err != nil { + return empty, fmt.Errorf("check cache expiration: %w", err) + } + + if hasExpired { + var latestValue T + latestValue, err = syncFunc(ctx) + if err != nil { + return empty, fmt.Errorf("sync func: %w", err) + } + + c.set(latestValue, newEventBlockNum) + return latestValue, nil + } + + cachedValue := c.get() + if err != nil { + return empty, fmt.Errorf("get cached value: %w", err) + } + + c.lock.Lock() + if newEventBlockNum > c.lastChangeBlock { + // update the most recent block number + // that way the scanning window is shorter in the next run + c.lastChangeBlock = newEventBlockNum + } + c.lock.Unlock() + + return cachedValue, nil +} + +func (c *LogpollerEventsBased[T]) hasExpired(ctx context.Context) (expired bool, blockOfLatestEvent int64, err error) { + c.lock.RLock() + blockOfCurrentValue := c.lastChangeBlock + c.lock.RUnlock() + + // NOTE: latest block should be fetched before LatestBlockByEventSigsAddrsWithConfs + // Otherwise there might be new events between LatestBlockByEventSigsAddrsWithConfs and + // latestBlock which will be missed. + latestBlock, err := c.logPoller.LatestBlock(ctx) + latestFinalizedBlock := int64(0) + if err != nil && !errors.Is(err, sql.ErrNoRows) { + return false, 0, fmt.Errorf("get latest log poller block: %w", err) + } else if err == nil { + // Since we know that we have all the events till latestBlock.FinalizedBlockNumber + // we want to return the block number instead of the block of the latest event + // for reducing the scan window on the next call. + latestFinalizedBlock = latestBlock.FinalizedBlockNumber + } + + if blockOfCurrentValue == 0 { + return true, latestFinalizedBlock, nil + } + + blockOfLatestEvent, err = c.logPoller.LatestBlockByEventSigsAddrsWithConfs( + ctx, + blockOfCurrentValue, + c.observedEvents, + []common.Address{c.address}, + evmtypes.Finalized, + ) + if err != nil { + return false, 0, fmt.Errorf("get latest events form lp: %w", err) + } + + if blockOfLatestEvent > latestFinalizedBlock { + latestFinalizedBlock = blockOfLatestEvent + } + return blockOfLatestEvent > blockOfCurrentValue, latestFinalizedBlock, nil +} + +func (c *LogpollerEventsBased[T]) set(value T, blockNum int64) { + c.lock.Lock() + defer c.lock.Unlock() + + if c.lastChangeBlock > blockNum { + return + } + + c.value = value + c.lastChangeBlock = blockNum +} + +func (c *LogpollerEventsBased[T]) get() T { + c.lock.RLock() + defer c.lock.RUnlock() + return c.value +} diff --git a/core/services/ocr2/plugins/ccip/internal/cache/autosync_test.go b/core/services/ocr2/plugins/ccip/internal/cache/autosync_test.go new file mode 100644 index 00000000000..0babfeb421d --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/cache/autosync_test.go @@ -0,0 +1,128 @@ +package cache_test + +import ( + "context" + "testing" + + "github.com/ethereum/go-ethereum/common" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" + lpmocks "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller/mocks" + evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/cache" +) + +func TestLogpollerEventsBased(t *testing.T) { + ctx := testutils.Context(t) + lp := lpmocks.NewLogPoller(t) + observedEvents := []common.Hash{ + utils.Bytes32FromString("event a"), + utils.Bytes32FromString("event b"), + } + contractAddress := utils.RandomAddress() + c := cache.NewLogpollerEventsBased[[]int](lp, observedEvents, contractAddress) + + testRounds := []struct { + logPollerLatestBlock int64 // latest block that logpoller parsed + latestEventBlock int64 // latest block that an event was seen + stateLatestBlock int64 // block of the current cached value (before run) + shouldSync bool // whether we expect sync to happen in this round + syncData []int // data returned after sync + expData []int // expected data that cache will return + }{ + { + // this is the first 'Get' call to our cache, an event was seen at block 800 + // and now log poller has reached block 1000. + logPollerLatestBlock: 1000, + latestEventBlock: 800, + stateLatestBlock: 0, + shouldSync: true, + syncData: []int{1, 2, 3}, + expData: []int{1, 2, 3}, + }, + { + // log poller moved a few blocks and there weren't any new events + logPollerLatestBlock: 1010, + latestEventBlock: 800, + stateLatestBlock: 1000, + shouldSync: false, + expData: []int{1, 2, 3}, + }, + { + // log poller moved a few blocks and there was a new event + logPollerLatestBlock: 1020, + latestEventBlock: 1020, + stateLatestBlock: 1010, + shouldSync: true, + syncData: []int{111}, + expData: []int{111}, + }, + { + // log poller moved a few more blocks and there was another new event + logPollerLatestBlock: 1050, + latestEventBlock: 1040, + stateLatestBlock: 1020, + shouldSync: true, + syncData: []int{222}, + expData: []int{222}, + }, + { + // log poller moved a few more blocks and there wasn't any new event + logPollerLatestBlock: 1100, + latestEventBlock: 1040, + stateLatestBlock: 1050, + shouldSync: false, + expData: []int{222}, + }, + { + // log poller moved a few more blocks and there wasn't any new event + logPollerLatestBlock: 1300, + latestEventBlock: 1040, + stateLatestBlock: 1100, + shouldSync: false, + expData: []int{222}, + }, + { + // log poller moved a few more blocks and there was a new event + // more recent than latest block (for whatever internal reason) + logPollerLatestBlock: 1300, + latestEventBlock: 1305, + stateLatestBlock: 1300, + shouldSync: true, + syncData: []int{666}, + expData: []int{666}, + }, + { + // log poller moved a few more blocks and there wasn't any new event + logPollerLatestBlock: 1300, + latestEventBlock: 1305, + stateLatestBlock: 1305, // <-- that's what we are testing in this round + shouldSync: false, + expData: []int{666}, + }, + } + + for _, round := range testRounds { + lp.On("LatestBlock", mock.Anything). + Return(logpoller.LogPollerBlock{FinalizedBlockNumber: round.logPollerLatestBlock}, nil).Once() + + if round.stateLatestBlock > 0 { + lp.On( + "LatestBlockByEventSigsAddrsWithConfs", + mock.Anything, + round.stateLatestBlock, + observedEvents, + []common.Address{contractAddress}, + evmtypes.Finalized, + ).Return(round.latestEventBlock, nil).Once() + } + + data, err := c.Get(ctx, func(ctx context.Context) ([]int, error) { return round.syncData, nil }) + assert.NoError(t, err) + assert.Equal(t, round.expData, data) + } +} diff --git a/core/services/ocr2/plugins/ccip/internal/cache/chain_health.go b/core/services/ocr2/plugins/ccip/internal/cache/chain_health.go new file mode 100644 index 00000000000..00f90615eb2 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/cache/chain_health.go @@ -0,0 +1,273 @@ +package cache + +import ( + "context" + "sync" + "time" + + "github.com/patrickmn/go-cache" + "github.com/pkg/errors" + "golang.org/x/sync/errgroup" + + "github.com/smartcontractkit/chainlink-common/pkg/services" + + "github.com/smartcontractkit/chainlink/v2/core/logger" + "github.com/smartcontractkit/chainlink/v2/core/services/job" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata" +) + +// ChainHealthcheck checks the health of the both source and destination chain. +// Based on the values returned, CCIP can make a decision to stop or continue processing messages. +// There are four things verified here: +// 1. Source chain is healthy (this is verified by checking if source LogPoller saw finality violation) +// 2. Dest chain is healthy (this is verified by checking if destination LogPoller saw finality violation) +// 3. CommitStore is down (this is verified by checking if CommitStore is down and destination RMN is not cursed) +// 4. Source chain is cursed (this is verified by checking if source RMN is not cursed) +// +// Whenever any of the above checks fail, the chain is considered unhealthy and the CCIP should stop +// processing messages. Additionally, when the chain is unhealthy, this information is considered "sticky" +// and is cached for a certain period of time based on defaultGlobalStatusExpirationDuration. +// This may lead to some false-positives, but in this case we want to be extra cautious and avoid executing any reorged messages. +// +// Additionally, to reduce the number of calls to the RPC, we refresh RMN state in the background based on defaultRMNStateRefreshInterval +type ChainHealthcheck interface { + job.ServiceCtx + IsHealthy(ctx context.Context) (bool, error) +} + +const ( + // RMN curse state is refreshed every 10 seconds + defaultRMNStateRefreshInterval = 10 * time.Second + // Whenever we mark the chain as unhealthy, we cache this information for 30 minutes + defaultGlobalStatusExpirationDuration = 30 * time.Minute + + globalStatusKey = "globalStatus" + rmnStatusKey = "rmnCurseCheck" +) + +type chainHealthcheck struct { + cache *cache.Cache + globalStatusKey string + rmnStatusKey string + globalStatusExpiration time.Duration + rmnStatusRefreshInterval time.Duration + + lggr logger.Logger + onRamp ccipdata.OnRampReader + commitStore ccipdata.CommitStoreReader + + services.StateMachine + wg *sync.WaitGroup + backgroundCtx context.Context //nolint:containedctx + backgroundCancel context.CancelFunc +} + +func NewChainHealthcheck(lggr logger.Logger, onRamp ccipdata.OnRampReader, commitStore ccipdata.CommitStoreReader) *chainHealthcheck { + ctx, cancel := context.WithCancel(context.Background()) + + ch := &chainHealthcheck{ + // Different keys use different expiration times, so we don't need to worry about the default value + cache: cache.New(cache.NoExpiration, 0), + rmnStatusKey: rmnStatusKey, + globalStatusKey: globalStatusKey, + globalStatusExpiration: defaultGlobalStatusExpirationDuration, + rmnStatusRefreshInterval: defaultRMNStateRefreshInterval, + + lggr: lggr, + onRamp: onRamp, + commitStore: commitStore, + + wg: new(sync.WaitGroup), + backgroundCtx: ctx, + backgroundCancel: cancel, + } + return ch +} + +// newChainHealthcheckWithCustomEviction is used for testing purposes only. It doesn't start background worker +func newChainHealthcheckWithCustomEviction(lggr logger.Logger, onRamp ccipdata.OnRampReader, commitStore ccipdata.CommitStoreReader, globalStatusDuration time.Duration, rmnStatusRefreshInterval time.Duration) *chainHealthcheck { + ctx, cancel := context.WithCancel(context.Background()) + + return &chainHealthcheck{ + cache: cache.New(rmnStatusRefreshInterval, 0), + rmnStatusKey: rmnStatusKey, + globalStatusKey: globalStatusKey, + globalStatusExpiration: globalStatusDuration, + rmnStatusRefreshInterval: rmnStatusRefreshInterval, + + lggr: lggr, + onRamp: onRamp, + commitStore: commitStore, + + wg: new(sync.WaitGroup), + backgroundCtx: ctx, + backgroundCancel: cancel, + } +} + +type rmnResponse struct { + healthy bool + err error +} + +func (c *chainHealthcheck) IsHealthy(ctx context.Context) (bool, error) { + // Verify if flag is raised to indicate that the chain is not healthy + // If set to false then immediately return false without checking the chain + if cachedValue, found := c.cache.Get(c.globalStatusKey); found { + healthy, ok := cachedValue.(bool) + // If cached value is properly casted to bool and not healthy it means the sticky flag is raised + // and should be returned immediately + if !ok { + c.lggr.Criticalw("Failed to cast cached value to sticky healthcheck", "value", cachedValue) + } else if ok && !healthy { + return false, nil + } + } + + // These checks are cheap and don't require any communication with the database or RPC + if healthy, err := c.checkIfReadersAreHealthy(ctx); err != nil { + return false, err + } else if !healthy { + c.markStickyStatusUnhealthy() + return healthy, nil + } + + // First call might initialize cache if it's not initialized yet. Otherwise, it will use the cached value + if healthy, err := c.checkIfRMNsAreHealthy(ctx); err != nil { + return false, err + } else if !healthy { + c.markStickyStatusUnhealthy() + return healthy, nil + } + return true, nil +} + +func (c *chainHealthcheck) Start(context.Context) error { + return c.StateMachine.StartOnce("ChainHealthcheck", func() error { + c.lggr.Info("Starting ChainHealthcheck") + c.wg.Add(1) + c.run() + return nil + }) +} + +func (c *chainHealthcheck) Close() error { + return c.StateMachine.StopOnce("ChainHealthcheck", func() error { + c.lggr.Info("Closing ChainHealthcheck") + c.backgroundCancel() + c.wg.Wait() + return nil + }) +} + +func (c *chainHealthcheck) run() { + ticker := time.NewTicker(c.rmnStatusRefreshInterval) + go func() { + defer c.wg.Done() + // Refresh the RMN state immediately after starting the background refresher + _, _ = c.refresh(c.backgroundCtx) + + for { + select { + case <-c.backgroundCtx.Done(): + return + case <-ticker.C: + _, err := c.refresh(c.backgroundCtx) + if err != nil { + c.lggr.Errorw("Failed to refresh RMN state in the background", "err", err) + } + } + } + }() +} + +func (c *chainHealthcheck) refresh(ctx context.Context) (bool, error) { + healthy, err := c.fetchRMNCurseState(ctx) + c.cache.Set( + c.rmnStatusKey, + rmnResponse{healthy, err}, + // Cache the value for 3 refresh intervals, this is just a defensive approach + // that will enforce the RMN state to be refreshed in case of bg worker hiccup (it should never happen) + 3*c.rmnStatusRefreshInterval, + ) + return healthy, err +} + +// checkIfReadersAreHealthy checks if the source and destination chains are healthy by calling underlying LogPoller +// These calls are cheap because they don't require any communication with the database or RPC, so we don't have +// to cache the result of these calls. +func (c *chainHealthcheck) checkIfReadersAreHealthy(ctx context.Context) (bool, error) { + sourceChainHealthy, err := c.onRamp.IsSourceChainHealthy(ctx) + if err != nil { + return false, errors.Wrap(err, "onRamp IsSourceChainHealthy errored") + } + + destChainHealthy, err := c.commitStore.IsDestChainHealthy(ctx) + if err != nil { + return false, errors.Wrap(err, "commitStore IsDestChainHealthy errored") + } + + if !sourceChainHealthy || !destChainHealthy { + c.lggr.Criticalw( + "Lane processing is stopped because source or destination chain is reported unhealthy", + "sourceChainHealthy", sourceChainHealthy, + "destChainHealthy", destChainHealthy, + ) + } + return sourceChainHealthy && destChainHealthy, nil +} + +func (c *chainHealthcheck) checkIfRMNsAreHealthy(ctx context.Context) (bool, error) { + if cachedValue, found := c.cache.Get(c.rmnStatusKey); found { + rmn := cachedValue.(rmnResponse) + return rmn.healthy, rmn.err + } + + // If the value is not found in the cache, fetch the RMN curse state in a sync manner for the first time + c.lggr.Info("Refreshing RMN state from the plugin routine, this should happen only once per lane during boot") + return c.refresh(ctx) +} + +func (c *chainHealthcheck) markStickyStatusUnhealthy() { + c.cache.Set(c.globalStatusKey, false, c.globalStatusExpiration) +} + +func (c *chainHealthcheck) fetchRMNCurseState(ctx context.Context) (bool, error) { + var ( + eg = new(errgroup.Group) + isCommitStoreDown bool + isSourceCursed bool + ) + + eg.Go(func() error { + var err error + isCommitStoreDown, err = c.commitStore.IsDown(ctx) + if err != nil { + return errors.Wrap(err, "commitStore isDown check errored") + } + return nil + }) + + eg.Go(func() error { + var err error + isSourceCursed, err = c.onRamp.IsSourceCursed(ctx) + if err != nil { + return errors.Wrap(err, "onRamp isSourceCursed errored") + } + return nil + }) + + if err := eg.Wait(); err != nil { + return false, err + } + + if isCommitStoreDown || isSourceCursed { + c.lggr.Criticalw( + "Lane processing is stopped because source chain is cursed or CommitStore is down", + "isCommitStoreDown", isCommitStoreDown, + "isSourceCursed", isSourceCursed, + ) + return false, nil + } + return true, nil +} diff --git a/core/services/ocr2/plugins/ccip/internal/cache/chain_health_test.go b/core/services/ocr2/plugins/ccip/internal/cache/chain_health_test.go new file mode 100644 index 00000000000..ccdc7c4b22f --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/cache/chain_health_test.go @@ -0,0 +1,303 @@ +package cache + +import ( + "context" + "errors" + "fmt" + "sync" + "testing" + "time" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + "github.com/stretchr/testify/require" + + "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" + + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" + "github.com/smartcontractkit/chainlink/v2/core/logger" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/mocks" +) + +func Test_RMNStateCaching(t *testing.T) { + ctx := tests.Context(t) + lggr := logger.TestLogger(t) + mockCommitStore := mocks.NewCommitStoreReader(t) + mockOnRamp := mocks.NewOnRampReader(t) + + chainState := newChainHealthcheckWithCustomEviction(lggr, mockOnRamp, mockCommitStore, 10*time.Hour, 10*time.Hour) + + // Chain is not cursed and healthy + mockCommitStore.On("IsDown", ctx).Return(false, nil).Once() + mockCommitStore.On("IsDestChainHealthy", ctx).Return(true, nil).Maybe() + mockOnRamp.On("IsSourceCursed", ctx).Return(false, nil).Once() + mockOnRamp.On("IsSourceChainHealthy", ctx).Return(true, nil).Maybe() + healthy, err := chainState.IsHealthy(ctx) + assert.NoError(t, err) + assert.True(t, healthy) + + // Chain is cursed, but cache is stale + mockCommitStore.On("IsDown", ctx).Return(true, nil).Once() + mockOnRamp.On("IsSourceCursed", ctx).Return(true, nil).Once() + healthy, err = chainState.IsHealthy(ctx) + assert.NoError(t, err) + assert.True(t, healthy) + + // Enforce cache refresh + _, err = chainState.refresh(ctx) + assert.NoError(t, err) + + healthy, err = chainState.IsHealthy(ctx) + assert.Nil(t, err) + assert.False(t, healthy) + + // Chain is not cursed, but previous curse should be "sticky" even when force refreshing + mockCommitStore.On("IsDown", ctx).Return(false, nil).Maybe() + mockOnRamp.On("IsSourceCursed", ctx).Return(false, nil).Maybe() + // Enforce cache refresh + _, err = chainState.refresh(ctx) + assert.NoError(t, err) + + healthy, err = chainState.IsHealthy(ctx) + assert.Nil(t, err) + assert.False(t, healthy) +} + +func Test_ChainStateIsCached(t *testing.T) { + ctx := tests.Context(t) + lggr := logger.TestLogger(t) + mockCommitStore := mocks.NewCommitStoreReader(t) + mockOnRamp := mocks.NewOnRampReader(t) + + chainState := newChainHealthcheckWithCustomEviction(lggr, mockOnRamp, mockCommitStore, 10*time.Hour, 10*time.Hour) + + // Chain is not cursed and healthy + mockCommitStore.On("IsDown", ctx).Return(false, nil).Maybe() + mockCommitStore.On("IsDestChainHealthy", ctx).Return(true, nil).Once() + mockOnRamp.On("IsSourceCursed", ctx).Return(false, nil).Maybe() + mockOnRamp.On("IsSourceChainHealthy", ctx).Return(true, nil).Once() + + _, err := chainState.refresh(ctx) + assert.NoError(t, err) + + healthy, err := chainState.IsHealthy(ctx) + assert.NoError(t, err) + assert.True(t, healthy) + + // Chain is not healthy + mockCommitStore.On("IsDestChainHealthy", ctx).Return(false, nil).Once() + mockOnRamp.On("IsSourceChainHealthy", ctx).Return(false, nil).Once() + _, err = chainState.refresh(ctx) + assert.NoError(t, err) + + healthy, err = chainState.IsHealthy(ctx) + assert.NoError(t, err) + assert.False(t, healthy) + + // Previous value is returned + mockCommitStore.On("IsDestChainHealthy", ctx).Return(true, nil).Maybe() + mockOnRamp.On("IsSourceChainHealthy", ctx).Return(true, nil).Maybe() + + _, err = chainState.refresh(ctx) + assert.NoError(t, err) + + healthy, err = chainState.IsHealthy(ctx) + assert.NoError(t, err) + assert.False(t, healthy) +} + +func Test_ChainStateIsHealthy(t *testing.T) { + testCases := []struct { + name string + commitStoreDown bool + commitStoreErr error + onRampCursed bool + onRampErr error + sourceChainUnhealthy bool + sourceChainErr error + destChainUnhealthy bool + destChainErr error + + expectedState bool + expectedErr bool + }{ + { + name: "all components healthy", + expectedState: true, + }, + { + name: "CommitStore is down", + commitStoreDown: true, + expectedState: false, + }, + { + name: "CommitStore error", + commitStoreErr: errors.New("commit store error"), + expectedErr: true, + }, + { + name: "OnRamp is cursed", + onRampCursed: true, + expectedState: false, + }, + { + name: "OnRamp error", + onRampErr: errors.New("onramp error"), + expectedErr: true, + }, + { + name: "Source chain is unhealthy", + sourceChainUnhealthy: true, + expectedState: false, + }, + { + name: "Source chain error", + sourceChainErr: errors.New("source chain error"), + expectedErr: true, + }, + { + name: "Destination chain is unhealthy", + destChainUnhealthy: true, + expectedState: false, + }, + { + name: "Destination chain error", + destChainErr: errors.New("destination chain error"), + expectedErr: true, + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + ctx := tests.Context(t) + mockCommitStore := mocks.NewCommitStoreReader(t) + mockOnRamp := mocks.NewOnRampReader(t) + + mockCommitStore.On("IsDown", ctx).Return(tc.commitStoreDown, tc.commitStoreErr).Maybe() + mockCommitStore.On("IsDestChainHealthy", ctx).Return(!tc.destChainUnhealthy, tc.destChainErr).Maybe() + mockOnRamp.On("IsSourceCursed", ctx).Return(tc.onRampCursed, tc.onRampErr).Maybe() + mockOnRamp.On("IsSourceChainHealthy", ctx).Return(!tc.sourceChainUnhealthy, tc.sourceChainErr).Maybe() + + chainState := newChainHealthcheckWithCustomEviction(logger.TestLogger(t), mockOnRamp, mockCommitStore, 10*time.Hour, 10*time.Hour) + + healthy, err := chainState.IsHealthy(ctx) + + if tc.expectedErr { + assert.Error(t, err) + } else { + assert.NoError(t, err) + assert.Equal(t, tc.expectedState, healthy) + } + }) + } +} + +func Test_RefreshingInBackground(t *testing.T) { + mockCommitStore := newCommitStoreWrapper(t, true, nil) + mockCommitStore.CommitStoreReader.On("IsDestChainHealthy", mock.Anything).Return(true, nil).Maybe() + + mockOnRamp := newOnRampWrapper(t, true, nil) + mockOnRamp.OnRampReader.On("IsSourceChainHealthy", mock.Anything).Return(true, nil).Maybe() + + chainState := newChainHealthcheckWithCustomEviction( + logger.TestLogger(t), + mockOnRamp, + mockCommitStore, + 10*time.Microsecond, + 10*time.Microsecond, + ) + require.NoError(t, chainState.Start(tests.Context(t))) + + // All healthy + assertHealthy(t, chainState, true) + + // Commit store not healthy + mockCommitStore.set(false, nil) + assertHealthy(t, chainState, false) + + // Commit store error + mockCommitStore.set(false, fmt.Errorf("commit store error")) + assertError(t, chainState) + + // Commit store is back + mockCommitStore.set(true, nil) + assertHealthy(t, chainState, true) + + // OnRamp not healthy + mockOnRamp.set(false, nil) + assertHealthy(t, chainState, false) + + // OnRamp error + mockOnRamp.set(false, fmt.Errorf("onramp error")) + assertError(t, chainState) + + // All back in healthy state + mockOnRamp.set(true, nil) + assertHealthy(t, chainState, true) + + require.NoError(t, chainState.Close()) +} + +func assertHealthy(t *testing.T, ch *chainHealthcheck, expected bool) { + assert.Eventually(t, func() bool { + healthy, err := ch.IsHealthy(testutils.Context(t)) + return err == nil && healthy == expected + }, testutils.WaitTimeout(t), testutils.TestInterval) +} + +func assertError(t *testing.T, ch *chainHealthcheck) { + assert.Eventually(t, func() bool { + _, err := ch.IsHealthy(testutils.Context(t)) + return err != nil + }, testutils.WaitTimeout(t), testutils.TestInterval) +} + +type fakeStatusWrapper struct { + *mocks.CommitStoreReader + *mocks.OnRampReader + + healthy bool + err error + mu *sync.Mutex +} + +func newCommitStoreWrapper(t *testing.T, healthy bool, err error) *fakeStatusWrapper { + return &fakeStatusWrapper{ + CommitStoreReader: mocks.NewCommitStoreReader(t), + healthy: healthy, + err: err, + mu: new(sync.Mutex), + } +} + +func newOnRampWrapper(t *testing.T, healthy bool, err error) *fakeStatusWrapper { + return &fakeStatusWrapper{ + OnRampReader: mocks.NewOnRampReader(t), + healthy: healthy, + err: err, + mu: new(sync.Mutex), + } +} + +func (f *fakeStatusWrapper) IsDown(context.Context) (bool, error) { + f.mu.Lock() + defer f.mu.Unlock() + return !f.healthy, f.err +} + +func (f *fakeStatusWrapper) IsSourceCursed(context.Context) (bool, error) { + f.mu.Lock() + defer f.mu.Unlock() + return !f.healthy, f.err +} + +func (f *fakeStatusWrapper) Close() error { + return nil +} + +func (f *fakeStatusWrapper) set(healthy bool, err error) { + f.mu.Lock() + defer f.mu.Unlock() + f.healthy = healthy + f.err = err +} diff --git a/core/services/ocr2/plugins/ccip/internal/cache/commit_roots.go b/core/services/ocr2/plugins/ccip/internal/cache/commit_roots.go new file mode 100644 index 00000000000..5f8bd5edc56 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/cache/commit_roots.go @@ -0,0 +1,243 @@ +package cache + +import ( + "context" + "slices" + "sync" + "time" + + "github.com/patrickmn/go-cache" + orderedmap "github.com/wk8/go-ordered-map/v2" + + "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + + "github.com/smartcontractkit/chainlink/v2/core/logger" +) + +const ( + // EvictionGracePeriod defines how long after the messageVisibilityInterval a root is still kept in the cache + EvictionGracePeriod = 1 * time.Hour + // CleanupInterval defines how often roots cache is scanned to evict stale roots + CleanupInterval = 30 * time.Minute +) + +type CommitsRootsCache interface { + RootsEligibleForExecution(ctx context.Context) ([]ccip.CommitStoreReport, error) + MarkAsExecuted(merkleRoot [32]byte) + Snooze(merkleRoot [32]byte) +} + +func NewCommitRootsCache( + lggr logger.Logger, + reader ccip.CommitStoreReader, + messageVisibilityInterval time.Duration, + rootSnoozeTime time.Duration, +) CommitsRootsCache { + return newCommitRootsCache( + lggr, + reader, + messageVisibilityInterval, + rootSnoozeTime, + CleanupInterval, + EvictionGracePeriod, + ) +} + +func newCommitRootsCache( + lggr logger.Logger, + reader ccip.CommitStoreReader, + messageVisibilityInterval time.Duration, + rootSnoozeTime time.Duration, + cleanupInterval time.Duration, + evictionGracePeriod time.Duration, +) *commitRootsCache { + snoozedRoots := cache.New(rootSnoozeTime, cleanupInterval) + executedRoots := cache.New(messageVisibilityInterval+evictionGracePeriod, cleanupInterval) + + return &commitRootsCache{ + lggr: lggr, + reader: reader, + rootSnoozeTime: rootSnoozeTime, + finalizedRoots: orderedmap.New[string, ccip.CommitStoreReportWithTxMeta](), + executedRoots: executedRoots, + snoozedRoots: snoozedRoots, + messageVisibilityInterval: messageVisibilityInterval, + latestFinalizedCommitRootTs: time.Now().Add(-messageVisibilityInterval), + cacheMu: sync.RWMutex{}, + } +} + +type commitRootsCache struct { + lggr logger.Logger + reader ccip.CommitStoreReader + messageVisibilityInterval time.Duration + rootSnoozeTime time.Duration + + // Mutable state. finalizedRoots is thread-safe by default, but updating latestFinalizedCommitRootTs and finalizedRoots requires locking. + cacheMu sync.RWMutex + // finalizedRoots is a map of merkleRoot -> CommitStoreReportWithTxMeta. It stores all the CommitReports that are + // marked as finalized by LogPoller, but not executed yet. Keeping only finalized reports doesn't require any state sync between LP and the cache. + // In order to keep this map size under control, we evict stale items every time we fetch new logs from the database. + // Also, ccip.CommitStoreReportWithTxMeta is a very tiny entity with almost fixed size, so it's not a big deal to keep it in memory. + // In case of high memory footprint caused by storing roots, we can make these even more lightweight by removing token/gas price updates. + // Whenever the root is executed (all messages executed and ExecutionStateChange events are finalized), we remove the root from the map. + finalizedRoots *orderedmap.OrderedMap[string, ccip.CommitStoreReportWithTxMeta] + // snoozedRoots used only for temporary snoozing roots. It's a cache with TTL (usually around 5 minutes, but this configuration is set up on chain using rootSnoozeTime) + snoozedRoots *cache.Cache + // executedRoots is a cache with TTL (usually around 8 hours, but this configuration is set up on chain using messageVisibilityInterval). + // We keep executed roots there to make sure we don't accidentally try to reprocess already executed CommitReport + executedRoots *cache.Cache + // latestFinalizedCommitRootTs is the timestamp of the latest finalized commit root (youngest in terms of timestamp). + // It's used get only the logs that were considered as unfinalized in a previous run. + // This way we limit database scans to the minimum and keep polling "unfinalized" part of the ReportAccepted events queue. + latestFinalizedCommitRootTs time.Time +} + +func (r *commitRootsCache) RootsEligibleForExecution(ctx context.Context) ([]ccip.CommitStoreReport, error) { + // 1. Fetch all the logs from the database after the latest finalized commit root timestamp. + // If this is a first run, it will fetch all the logs based on the messageVisibilityInterval. + // Worst case scenario, it will fetch around 480 reports (OCR Commit 60 seconds (fast chains default) * messageVisibilityInterval set to 8 hours (mainnet default)) + // Even with the larger messageVisibilityInterval window (e.g. 24 hours) it should be acceptable (around 1500 logs). + // Keep in mind that this potentially heavy operation happens only once during the plugin boot and it's no different from the previous implementation. + logs, err := r.fetchLogsFromCommitStore(ctx) + if err != nil { + return nil, err + } + + // 2. Iterate over the logs and check if the root is finalized or not. Return finalized and unfinalized reports + // It promotes finalized roots to the finalizedRoots map and evicts stale roots. + finalizedReports, unfinalizedReports := r.updateFinalizedRoots(logs) + + // 3. Join finalized commit reports with unfinalized reports and outfilter snoozed roots. + // Return only the reports that are not snoozed. + return r.pickReadyToExecute(finalizedReports, unfinalizedReports), nil +} + +// MarkAsExecuted marks the root as executed. It means that all the messages from the root were executed and the ExecutionStateChange event was finalized. +// Executed roots are removed from the cache. +func (r *commitRootsCache) MarkAsExecuted(merkleRoot [32]byte) { + prettyMerkleRoot := merkleRootToString(merkleRoot) + r.lggr.Infow("Marking root as executed and removing entirely from cache", "merkleRoot", prettyMerkleRoot) + + r.cacheMu.Lock() + defer r.cacheMu.Unlock() + r.finalizedRoots.Delete(prettyMerkleRoot) + r.executedRoots.SetDefault(prettyMerkleRoot, struct{}{}) +} + +// Snooze temporarily snoozes the root. It means that the root is not eligible for execution for a certain period of time. +// Snoozed roots are skipped when calling RootsEligibleForExecution +func (r *commitRootsCache) Snooze(merkleRoot [32]byte) { + prettyMerkleRoot := merkleRootToString(merkleRoot) + r.lggr.Infow("Snoozing root temporarily", "merkleRoot", prettyMerkleRoot, "rootSnoozeTime", r.rootSnoozeTime) + r.snoozedRoots.SetDefault(prettyMerkleRoot, struct{}{}) +} + +func (r *commitRootsCache) isSnoozed(merkleRoot [32]byte) bool { + _, snoozed := r.snoozedRoots.Get(merkleRootToString(merkleRoot)) + return snoozed +} + +func (r *commitRootsCache) isExecuted(merkleRoot [32]byte) bool { + _, executed := r.executedRoots.Get(merkleRootToString(merkleRoot)) + return executed +} + +func (r *commitRootsCache) fetchLogsFromCommitStore(ctx context.Context) ([]ccip.CommitStoreReportWithTxMeta, error) { + r.cacheMu.Lock() + messageVisibilityWindow := time.Now().Add(-r.messageVisibilityInterval) + if r.latestFinalizedCommitRootTs.Before(messageVisibilityWindow) { + r.latestFinalizedCommitRootTs = messageVisibilityWindow + } + commitRootsFilterTimestamp := r.latestFinalizedCommitRootTs + r.cacheMu.Unlock() + + // IO operation, release lock before! + r.lggr.Infow("Fetching Commit Reports with timestamp greater than or equal to", "blockTimestamp", commitRootsFilterTimestamp) + return r.reader.GetAcceptedCommitReportsGteTimestamp(ctx, commitRootsFilterTimestamp, 0) +} + +func (r *commitRootsCache) updateFinalizedRoots(logs []ccip.CommitStoreReportWithTxMeta) ([]ccip.CommitStoreReportWithTxMeta, []ccip.CommitStoreReportWithTxMeta) { + r.cacheMu.Lock() + defer r.cacheMu.Unlock() + + // Assuming logs are properly ordered by block_timestamp, log_index + var unfinalizedReports []ccip.CommitStoreReportWithTxMeta + for _, log := range logs { + prettyMerkleRoot := merkleRootToString(log.MerkleRoot) + // Defensive check, if something is marked as executed, never allow it to come back to the cache + if r.isExecuted(log.MerkleRoot) { + r.lggr.Debugw("Ignoring root marked as executed", "merkleRoot", prettyMerkleRoot, "blockTimestamp", log.BlockTimestampUnixMilli) + continue + } + + if log.IsFinalized() { + r.lggr.Debugw("Adding finalized root to cache", "merkleRoot", prettyMerkleRoot, "blockTimestamp", log.BlockTimestampUnixMilli) + r.finalizedRoots.Store(prettyMerkleRoot, log) + } else { + r.lggr.Debugw("Bypassing unfinalized root", "merkleRoot", prettyMerkleRoot, "blockTimestamp", log.BlockTimestampUnixMilli) + unfinalizedReports = append(unfinalizedReports, log) + } + } + + if newest := r.finalizedRoots.Newest(); newest != nil { + r.latestFinalizedCommitRootTs = time.UnixMilli(newest.Value.BlockTimestampUnixMilli) + } + + var finalizedRoots []ccip.CommitStoreReportWithTxMeta + var rootsToDelete []string + + messageVisibilityWindow := time.Now().Add(-r.messageVisibilityInterval) + for pair := r.finalizedRoots.Oldest(); pair != nil; pair = pair.Next() { + // Mark items as stale if they are older than the messageVisibilityInterval + // SortedMap doesn't allow to iterate and delete, so we mark roots for deletion and remove them in a separate loop + if time.UnixMilli(pair.Value.BlockTimestampUnixMilli).Before(messageVisibilityWindow) { + rootsToDelete = append(rootsToDelete, pair.Key) + continue + } + finalizedRoots = append(finalizedRoots, pair.Value) + } + + // Remove stale items + for _, root := range rootsToDelete { + r.finalizedRoots.Delete(root) + } + + return finalizedRoots, unfinalizedReports +} + +func (r *commitRootsCache) pickReadyToExecute(r1 []ccip.CommitStoreReportWithTxMeta, r2 []ccip.CommitStoreReportWithTxMeta) []ccip.CommitStoreReport { + allReports := append(r1, r2...) + eligibleReports := make([]ccip.CommitStoreReport, 0, len(allReports)) + for _, report := range allReports { + if r.isSnoozed(report.MerkleRoot) { + r.lggr.Debugw("Skipping snoozed root", + "minSeqNr", report.Interval.Min, + "maxSeqNr", report.Interval.Max, + "merkleRoot", merkleRootToString(report.MerkleRoot)) + continue + } + eligibleReports = append(eligibleReports, report.CommitStoreReport) + } + // safety check, probably not needed + slices.SortFunc(eligibleReports, func(i, j ccip.CommitStoreReport) int { + return int(i.Interval.Min - j.Interval.Min) + }) + return eligibleReports +} + +// internal use only for testing +func (r *commitRootsCache) finalizedCachedLogs() []ccip.CommitStoreReport { + r.cacheMu.RLock() + defer r.cacheMu.RUnlock() + + var finalizedRoots []ccip.CommitStoreReport + for pair := r.finalizedRoots.Oldest(); pair != nil; pair = pair.Next() { + finalizedRoots = append(finalizedRoots, pair.Value.CommitStoreReport) + } + return finalizedRoots +} + +func merkleRootToString(merkleRoot ccip.Hash) string { + return merkleRoot.String() +} diff --git a/core/services/ocr2/plugins/ccip/internal/cache/commit_roots_test.go b/core/services/ocr2/plugins/ccip/internal/cache/commit_roots_test.go new file mode 100644 index 00000000000..dc0a8443497 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/cache/commit_roots_test.go @@ -0,0 +1,297 @@ +package cache_test + +import ( + "math/big" + "testing" + "time" + + "github.com/ethereum/go-ethereum/common" + "github.com/stretchr/testify/require" + + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils" + ubig "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils/big" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/commit_store_1_2_0" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/pgtest" + "github.com/smartcontractkit/chainlink/v2/core/logger" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/cache" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0" +) + +func Test_RootsEligibleForExecution(t *testing.T) { + ctx := testutils.Context(t) + chainID := testutils.NewRandomEVMChainID() + orm := logpoller.NewORM(chainID, pgtest.NewSqlxDB(t), logger.TestLogger(t)) + lpOpts := logpoller.Opts{ + PollPeriod: time.Hour, + FinalityDepth: 2, + BackfillBatchSize: 20, + RpcBatchSize: 10, + KeepFinalizedBlocksDepth: 1000, + } + lp := logpoller.NewLogPoller(orm, nil, logger.TestLogger(t), nil, lpOpts) + + commitStoreAddr := utils.RandomAddress() + + block2 := time.Now().Add(-8 * time.Hour) + block3 := time.Now().Add(-5 * time.Hour) + block4 := time.Now().Add(-1 * time.Hour) + newBlock4 := time.Now().Add(-2 * time.Hour) + block5 := time.Now() + + root1 := utils.RandomBytes32() + root2 := utils.RandomBytes32() + root3 := utils.RandomBytes32() + root4 := utils.RandomBytes32() + root5 := utils.RandomBytes32() + + inputLogs := []logpoller.Log{ + createReportAcceptedLog(t, chainID, commitStoreAddr, 2, 1, root1, block2), + createReportAcceptedLog(t, chainID, commitStoreAddr, 2, 2, root2, block2), + } + require.NoError(t, orm.InsertLogsWithBlock(ctx, inputLogs, logpoller.NewLogPollerBlock(utils.RandomBytes32(), 2, time.Now(), 1))) + + commitStore, err := v1_2_0.NewCommitStore(logger.TestLogger(t), commitStoreAddr, nil, lp) + require.NoError(t, err) + + rootsCache := cache.NewCommitRootsCache(logger.TestLogger(t), commitStore, 10*time.Hour, time.Second) + + roots, err := rootsCache.RootsEligibleForExecution(ctx) + require.NoError(t, err) + assertRoots(t, roots, root1, root2) + + rootsCache.Snooze(root1) + rootsCache.Snooze(root2) + + // Roots are snoozed + roots, err = rootsCache.RootsEligibleForExecution(ctx) + require.NoError(t, err) + assertRoots(t, roots) + + // Roots are unsnoozed + require.Eventually(t, func() bool { + roots, err = rootsCache.RootsEligibleForExecution(ctx) + require.NoError(t, err) + return len(roots) == 2 + }, 5*time.Second, 1*time.Second) + + // Marking root as executed doesn't ignore other roots from the same block + rootsCache.MarkAsExecuted(root1) + roots, err = rootsCache.RootsEligibleForExecution(ctx) + require.NoError(t, err) + assertRoots(t, roots, root2) + + // Finality progress, mark all roots as finalized + require.NoError(t, orm.InsertBlock(ctx, utils.RandomBytes32(), 3, time.Now(), 3)) + roots, err = rootsCache.RootsEligibleForExecution(ctx) + require.NoError(t, err) + assertRoots(t, roots, root2) + + inputLogs = []logpoller.Log{ + createReportAcceptedLog(t, chainID, commitStoreAddr, 3, 1, root3, block3), + createReportAcceptedLog(t, chainID, commitStoreAddr, 4, 1, root4, block4), + createReportAcceptedLog(t, chainID, commitStoreAddr, 5, 1, root5, block5), + } + require.NoError(t, orm.InsertLogsWithBlock(ctx, inputLogs, logpoller.NewLogPollerBlock(utils.RandomBytes32(), 5, time.Now(), 3))) + roots, err = rootsCache.RootsEligibleForExecution(ctx) + require.NoError(t, err) + assertRoots(t, roots, root2, root3, root4, root5) + + // Mark root in the middle as executed but keep the oldest one still waiting + rootsCache.MarkAsExecuted(root3) + roots, err = rootsCache.RootsEligibleForExecution(ctx) + require.NoError(t, err) + assertRoots(t, roots, root2, root4, root5) + + // Simulate reorg by removing all unfinalized blocks + require.NoError(t, orm.DeleteLogsAndBlocksAfter(ctx, 4)) + roots, err = rootsCache.RootsEligibleForExecution(ctx) + require.NoError(t, err) + assertRoots(t, roots, root2) + + // Root4 comes back but with the different block_timestamp (before the reorged block) + inputLogs = []logpoller.Log{ + createReportAcceptedLog(t, chainID, commitStoreAddr, 4, 1, root4, newBlock4), + } + require.NoError(t, orm.InsertLogsWithBlock(ctx, inputLogs, logpoller.NewLogPollerBlock(utils.RandomBytes32(), 5, time.Now(), 3))) + roots, err = rootsCache.RootsEligibleForExecution(ctx) + require.NoError(t, err) + assertRoots(t, roots, root2, root4) + + // Mark everything as executed + rootsCache.MarkAsExecuted(root2) + rootsCache.MarkAsExecuted(root4) + roots, err = rootsCache.RootsEligibleForExecution(ctx) + require.NoError(t, err) + assertRoots(t, roots) +} + +func Test_RootsEligibleForExecutionWithReorgs(t *testing.T) { + ctx := testutils.Context(t) + chainID := testutils.NewRandomEVMChainID() + orm := logpoller.NewORM(chainID, pgtest.NewSqlxDB(t), logger.TestLogger(t)) + lpOpts := logpoller.Opts{ + PollPeriod: time.Hour, + FinalityDepth: 2, + BackfillBatchSize: 20, + RpcBatchSize: 10, + KeepFinalizedBlocksDepth: 1000, + } + lp := logpoller.NewLogPoller(orm, nil, logger.TestLogger(t), nil, lpOpts) + + commitStoreAddr := utils.RandomAddress() + + block1 := time.Now().Add(-8 * time.Hour) + block2 := time.Now().Add(-5 * time.Hour) + block3 := time.Now().Add(-2 * time.Hour) + block4 := time.Now().Add(-1 * time.Hour) + + root1 := utils.RandomBytes32() + root2 := utils.RandomBytes32() + root3 := utils.RandomBytes32() + + // Genesis block + require.NoError(t, orm.InsertBlock(ctx, utils.RandomBytes32(), 1, block1, 1)) + inputLogs := []logpoller.Log{ + createReportAcceptedLog(t, chainID, commitStoreAddr, 2, 1, root1, block2), + createReportAcceptedLog(t, chainID, commitStoreAddr, 2, 2, root2, block2), + createReportAcceptedLog(t, chainID, commitStoreAddr, 3, 1, root3, block3), + } + require.NoError(t, orm.InsertLogsWithBlock(ctx, inputLogs, logpoller.NewLogPollerBlock(utils.RandomBytes32(), 3, time.Now(), 1))) + + commitStore, err := v1_2_0.NewCommitStore(logger.TestLogger(t), commitStoreAddr, nil, lp) + require.NoError(t, err) + + rootsCache := cache.NewCommitRootsCache(logger.TestLogger(t), commitStore, 10*time.Hour, time.Second) + + // Get all including finalized and unfinalized + roots, err := rootsCache.RootsEligibleForExecution(ctx) + require.NoError(t, err) + assertRoots(t, roots, root1, root2, root3) + + // Reorg everything away + require.NoError(t, orm.DeleteLogsAndBlocksAfter(ctx, 2)) + roots, err = rootsCache.RootsEligibleForExecution(ctx) + require.NoError(t, err) + assertRoots(t, roots) + + // Reinsert the logs, mark first one as finalized + inputLogs = []logpoller.Log{ + createReportAcceptedLog(t, chainID, commitStoreAddr, 3, 1, root1, block3), + createReportAcceptedLog(t, chainID, commitStoreAddr, 4, 1, root2, block4), + createReportAcceptedLog(t, chainID, commitStoreAddr, 4, 2, root3, block4), + } + require.NoError(t, orm.InsertLogsWithBlock(ctx, inputLogs, logpoller.NewLogPollerBlock(utils.RandomBytes32(), 5, time.Now(), 3))) + roots, err = rootsCache.RootsEligibleForExecution(ctx) + require.NoError(t, err) + assertRoots(t, roots, root1, root2, root3) + + // Reorg away everything except the finalized one + require.NoError(t, orm.DeleteLogsAndBlocksAfter(ctx, 4)) + roots, err = rootsCache.RootsEligibleForExecution(ctx) + require.NoError(t, err) + assertRoots(t, roots, root1) +} + +// Not very likely, but let's be more defensive here and verify if cache works properly and can deal with duplicates +func Test_BlocksWithTheSameTimestamps(t *testing.T) { + ctx := testutils.Context(t) + chainID := testutils.NewRandomEVMChainID() + orm := logpoller.NewORM(chainID, pgtest.NewSqlxDB(t), logger.TestLogger(t)) + lpOpts := logpoller.Opts{ + PollPeriod: time.Hour, + FinalityDepth: 2, + BackfillBatchSize: 20, + RpcBatchSize: 10, + KeepFinalizedBlocksDepth: 1000, + } + lp := logpoller.NewLogPoller(orm, nil, logger.TestLogger(t), nil, lpOpts) + + commitStoreAddr := utils.RandomAddress() + + block := time.Now().Add(-1 * time.Hour).Truncate(time.Second) + root1 := utils.RandomBytes32() + root2 := utils.RandomBytes32() + + inputLogs := []logpoller.Log{ + createReportAcceptedLog(t, chainID, commitStoreAddr, 2, 1, root1, block), + } + require.NoError(t, orm.InsertLogsWithBlock(ctx, inputLogs, logpoller.NewLogPollerBlock(utils.RandomBytes32(), 2, time.Now(), 2))) + + commitStore, err := v1_2_0.NewCommitStore(logger.TestLogger(t), commitStoreAddr, nil, lp) + require.NoError(t, err) + + rootsCache := cache.NewCommitRootsCache(logger.TestLogger(t), commitStore, 10*time.Hour, time.Second) + roots, err := rootsCache.RootsEligibleForExecution(ctx) + require.NoError(t, err) + assertRoots(t, roots, root1) + + inputLogs = []logpoller.Log{ + createReportAcceptedLog(t, chainID, commitStoreAddr, 3, 1, root2, block), + } + require.NoError(t, orm.InsertLogsWithBlock(ctx, inputLogs, logpoller.NewLogPollerBlock(utils.RandomBytes32(), 3, time.Now(), 3))) + + roots, err = rootsCache.RootsEligibleForExecution(ctx) + require.NoError(t, err) + assertRoots(t, roots, root1, root2) +} + +func assertRoots(t *testing.T, roots []cciptypes.CommitStoreReport, root ...[32]byte) { + require.Len(t, roots, len(root)) + for i, r := range root { + require.Equal(t, r, roots[i].MerkleRoot) + } +} + +func createReportAcceptedLog(t testing.TB, chainID *big.Int, address common.Address, blockNumber int64, logIndex int64, merkleRoot common.Hash, blockTimestamp time.Time) logpoller.Log { + tAbi, err := commit_store_1_2_0.CommitStoreMetaData.GetAbi() + require.NoError(t, err) + eseEvent, ok := tAbi.Events["ReportAccepted"] + require.True(t, ok) + + gasPriceUpdates := make([]commit_store_1_2_0.InternalGasPriceUpdate, 100) + tokenPriceUpdates := make([]commit_store_1_2_0.InternalTokenPriceUpdate, 100) + + for i := 0; i < 100; i++ { + gasPriceUpdates[i] = commit_store_1_2_0.InternalGasPriceUpdate{ + DestChainSelector: uint64(i), + UsdPerUnitGas: big.NewInt(int64(i)), + } + tokenPriceUpdates[i] = commit_store_1_2_0.InternalTokenPriceUpdate{ + SourceToken: utils.RandomAddress(), + UsdPerToken: big.NewInt(int64(i)), + } + } + + message := commit_store_1_2_0.CommitStoreCommitReport{ + PriceUpdates: commit_store_1_2_0.InternalPriceUpdates{ + TokenPriceUpdates: tokenPriceUpdates, + GasPriceUpdates: gasPriceUpdates, + }, + Interval: commit_store_1_2_0.CommitStoreInterval{Min: 1, Max: 10}, + MerkleRoot: merkleRoot, + } + + logData, err := eseEvent.Inputs.Pack(message) + require.NoError(t, err) + + topic0 := commit_store_1_2_0.CommitStoreReportAccepted{}.Topic() + + return logpoller.Log{ + Topics: [][]byte{ + topic0[:], + }, + Data: logData, + LogIndex: logIndex, + BlockHash: utils.RandomBytes32(), + BlockNumber: blockNumber, + BlockTimestamp: blockTimestamp.Truncate(time.Millisecond), + EventSig: topic0, + Address: address, + TxHash: utils.RandomBytes32(), + EvmChainId: ubig.New(chainID), + } +} diff --git a/core/services/ocr2/plugins/ccip/internal/cache/commit_roots_unit_test.go b/core/services/ocr2/plugins/ccip/internal/cache/commit_roots_unit_test.go new file mode 100644 index 00000000000..34a470ef907 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/cache/commit_roots_unit_test.go @@ -0,0 +1,212 @@ +package cache + +import ( + "testing" + "time" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + "github.com/stretchr/testify/require" + + "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils" + "github.com/smartcontractkit/chainlink/v2/core/logger" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/mocks" +) + +func Test_CacheIsInitializedWithFirstCall(t *testing.T) { + commitStoreReader := mocks.NewCommitStoreReader(t) + cache := newCommitRootsCache(logger.TestLogger(t), commitStoreReader, time.Hour, time.Hour, time.Hour, time.Hour) + commitStoreReader.On("GetAcceptedCommitReportsGteTimestamp", mock.Anything, mock.Anything, mock.Anything).Return([]ccip.CommitStoreReportWithTxMeta{}, nil) + + roots, err := cache.RootsEligibleForExecution(tests.Context(t)) + require.NoError(t, err) + assertRoots(t, roots) +} + +func Test_CacheExpiration(t *testing.T) { + ts1 := time.Now().Add(-5 * time.Millisecond).Truncate(time.Millisecond) + ts2 := time.Now().Add(-3 * time.Millisecond).Truncate(time.Millisecond) + ts3 := time.Now().Add(-1 * time.Millisecond).Truncate(time.Millisecond) + + root1 := utils.RandomBytes32() + root2 := utils.RandomBytes32() + root3 := utils.RandomBytes32() + + commitStoreReader := mocks.NewCommitStoreReader(t) + cache := newCommitRootsCache(logger.TestLogger(t), commitStoreReader, time.Second, time.Hour, time.Hour, time.Hour) + mockCommitStoreReader(commitStoreReader, time.Time{}, []ccip.CommitStoreReportWithTxMeta{ + createCommitStoreEntry(root1, ts1, true), + createCommitStoreEntry(root2, ts2, true), + createCommitStoreEntry(root3, ts3, false), + }) + roots, err := cache.RootsEligibleForExecution(tests.Context(t)) + require.NoError(t, err) + assertRoots(t, roots, root1, root2, root3) + + require.Eventually(t, func() bool { + mockCommitStoreReader(commitStoreReader, time.Time{}, []ccip.CommitStoreReportWithTxMeta{ + createCommitStoreEntry(root3, ts3, false), + }) + roots, err = cache.RootsEligibleForExecution(tests.Context(t)) + require.NoError(t, err) + return len(roots) == 1 && roots[0].MerkleRoot == root3 + }, 5*time.Second, 1*time.Second) +} + +func Test_CacheFullEviction(t *testing.T) { + commitStoreReader := mocks.NewCommitStoreReader(t) + cache := newCommitRootsCache(logger.TestLogger(t), commitStoreReader, 2*time.Second, 1*time.Second, time.Second, time.Second) + + maxElements := 10000 + commitRoots := make([]ccip.CommitStoreReportWithTxMeta, maxElements) + for i := 0; i < maxElements; i++ { + finalized := i >= maxElements/2 + commitRoots[i] = createCommitStoreEntry(utils.RandomBytes32(), time.Now(), finalized) + } + mockCommitStoreReader(commitStoreReader, time.Time{}, commitRoots) + + roots, err := cache.RootsEligibleForExecution(tests.Context(t)) + require.NoError(t, err) + require.Len(t, roots, maxElements) + + // Marks some of them as exeucted and some of them as snoozed + for i := 0; i < maxElements; i++ { + if i%3 == 0 { + cache.MarkAsExecuted(commitRoots[i].MerkleRoot) + } + if i%3 == 1 { + cache.Snooze(commitRoots[i].MerkleRoot) + } + } + // Eventually everything should be entirely removed from cache. We need that check to verify if cache doesn't grow indefinitely + require.Eventually(t, func() bool { + mockCommitStoreReader(commitStoreReader, time.Time{}, []ccip.CommitStoreReportWithTxMeta{}) + roots1, err1 := cache.RootsEligibleForExecution(tests.Context(t)) + require.NoError(t, err1) + + return len(roots1) == 0 && + cache.finalizedRoots.Len() == 0 && + len(cache.snoozedRoots.Items()) == 0 && + len(cache.executedRoots.Items()) == 0 + }, 10*time.Second, time.Second) +} + +func Test_CacheProgression_Internal(t *testing.T) { + ts1 := time.Now().Add(-5 * time.Hour).Truncate(time.Millisecond) + ts2 := time.Now().Add(-3 * time.Hour).Truncate(time.Millisecond) + ts3 := time.Now().Add(-1 * time.Hour).Truncate(time.Millisecond) + + root1 := utils.RandomBytes32() + root2 := utils.RandomBytes32() + root3 := utils.RandomBytes32() + + commitStoreReader := mocks.NewCommitStoreReader(t) + + cache := newCommitRootsCache(logger.TestLogger(t), commitStoreReader, 10*time.Hour, time.Hour, time.Hour, time.Hour) + + // Empty cache, no results from the reader + mockCommitStoreReader(commitStoreReader, time.Time{}, []ccip.CommitStoreReportWithTxMeta{}) + roots, err := cache.RootsEligibleForExecution(tests.Context(t)) + require.NoError(t, err) + assertRoots(t, roots) + assertRoots(t, cache.finalizedCachedLogs()) + + // Single unfinalized root returned + mockCommitStoreReader(commitStoreReader, time.Time{}, []ccip.CommitStoreReportWithTxMeta{createCommitStoreEntry(root1, ts1, false)}) + roots, err = cache.RootsEligibleForExecution(tests.Context(t)) + require.NoError(t, err) + assertRoots(t, roots, root1) + assertRoots(t, cache.finalizedCachedLogs()) + + // Finalized and unfinalized roots returned + mockCommitStoreReader(commitStoreReader, time.Time{}, []ccip.CommitStoreReportWithTxMeta{ + createCommitStoreEntry(root1, ts1, true), + createCommitStoreEntry(root2, ts2, false), + }) + roots, err = cache.RootsEligibleForExecution(tests.Context(t)) + require.NoError(t, err) + assertRoots(t, roots, root1, root2) + assertRoots(t, cache.finalizedCachedLogs(), root1) + + // Returning the same data should not impact cache state (no duplicates) + mockCommitStoreReader(commitStoreReader, ts1, []ccip.CommitStoreReportWithTxMeta{ + createCommitStoreEntry(root1, ts1, true), + createCommitStoreEntry(root2, ts2, false), + }) + roots, err = cache.RootsEligibleForExecution(tests.Context(t)) + require.NoError(t, err) + assertRoots(t, roots, root1, root2) + assertRoots(t, cache.finalizedCachedLogs(), root1) + + // Snoozing oldest root + cache.Snooze(root1) + mockCommitStoreReader(commitStoreReader, ts1, []ccip.CommitStoreReportWithTxMeta{ + createCommitStoreEntry(root2, ts2, false), + createCommitStoreEntry(root3, ts3, false), + }) + roots, err = cache.RootsEligibleForExecution(tests.Context(t)) + require.NoError(t, err) + assertRoots(t, roots, root2, root3) + assertRoots(t, cache.finalizedCachedLogs(), root1) + + // Snoozing everything + cache.Snooze(root2) + cache.Snooze(root3) + mockCommitStoreReader(commitStoreReader, ts1, []ccip.CommitStoreReportWithTxMeta{ + createCommitStoreEntry(root2, ts2, true), + createCommitStoreEntry(root3, ts3, true), + }) + roots, err = cache.RootsEligibleForExecution(tests.Context(t)) + require.NoError(t, err) + assertRoots(t, roots) + assertRoots(t, cache.finalizedCachedLogs(), root1, root2, root3) + + // Marking everything as executed removes it entirely, even if root is returned from the CommitStore + cache.MarkAsExecuted(root1) + cache.MarkAsExecuted(root2) + cache.MarkAsExecuted(root3) + mockCommitStoreReader(commitStoreReader, ts3, []ccip.CommitStoreReportWithTxMeta{ + createCommitStoreEntry(root2, ts2, true), + createCommitStoreEntry(root3, ts3, true), + }) + roots, err = cache.RootsEligibleForExecution(tests.Context(t)) + require.NoError(t, err) + assertRoots(t, roots) + assertRoots(t, cache.finalizedCachedLogs()) +} + +func assertRoots(t *testing.T, reports []ccip.CommitStoreReport, expectedRoots ...[32]byte) { + require.Len(t, reports, len(expectedRoots)) + for i, report := range reports { + assert.Equal(t, expectedRoots[i], report.MerkleRoot) + } +} + +func mockCommitStoreReader(reader *mocks.CommitStoreReader, blockTimestamp time.Time, roots []ccip.CommitStoreReportWithTxMeta) { + if blockTimestamp.IsZero() { + reader.On("GetAcceptedCommitReportsGteTimestamp", mock.Anything, mock.Anything, mock.Anything). + Return(roots, nil).Once() + } else { + reader.On("GetAcceptedCommitReportsGteTimestamp", mock.Anything, blockTimestamp, mock.Anything). + Return(roots, nil).Once() + } +} + +func createCommitStoreEntry(root [32]byte, ts time.Time, finalized bool) ccip.CommitStoreReportWithTxMeta { + status := ccip.FinalizedStatusNotFinalized + if finalized { + status = ccip.FinalizedStatusFinalized + } + return ccip.CommitStoreReportWithTxMeta{ + CommitStoreReport: ccip.CommitStoreReport{ + MerkleRoot: root, + }, + TxMeta: ccip.TxMeta{ + BlockTimestampUnixMilli: ts.UnixMilli(), + Finalized: status, + }, + } +} diff --git a/core/services/ocr2/plugins/ccip/internal/cache/lazy.go b/core/services/ocr2/plugins/ccip/internal/cache/lazy.go new file mode 100644 index 00000000000..7b15abe271b --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/cache/lazy.go @@ -0,0 +1,20 @@ +package cache + +import "sync" + +type LazyFunction[T any] func() (T, error) + +// LazyFetch caches the results during the first call and then returns the cached value +// on each consecutive call. +func LazyFetch[T any](fun LazyFunction[T]) LazyFunction[T] { + var result T + var err error + var once sync.Once + + return func() (T, error) { + once.Do(func() { + result, err = fun() + }) + return result, err + } +} diff --git a/core/services/ocr2/plugins/ccip/internal/cache/lazy_test.go b/core/services/ocr2/plugins/ccip/internal/cache/lazy_test.go new file mode 100644 index 00000000000..2777a6c2e0b --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/cache/lazy_test.go @@ -0,0 +1,71 @@ +package cache + +import ( + "fmt" + "sync" + "testing" + + "github.com/stretchr/testify/require" +) + +func TestLazyFetchPass(t *testing.T) { + counterFunction := createPassingCounter() + + counter, _ := counterFunction() + require.Equal(t, 1, counter) + + lazyCounter := LazyFetch(counterFunction) + counter, _ = lazyCounter() + require.Equal(t, 2, counter) + + counter, _ = lazyCounter() + require.Equal(t, 2, counter) +} + +func TestLazyFetchFail(t *testing.T) { + counterFunction := createFailingCounter() + + _, err := counterFunction() + require.Equal(t, "counter 1 failed", err.Error()) + + lazyCounter := LazyFetch(counterFunction) + _, err = lazyCounter() + require.Equal(t, "counter 2 failed", err.Error()) + + _, err = lazyCounter() + require.Equal(t, "counter 2 failed", err.Error()) +} + +func TestLazyFetchMultipleRoutines(t *testing.T) { + routines := 100 + counterFunction := LazyFetch(createPassingCounter()) + + var wg sync.WaitGroup + wg.Add(routines) + + for i := 0; i < routines; i++ { + go func() { + counter, _ := counterFunction() + require.Equal(t, 1, counter) + wg.Done() + }() + } + + wg.Wait() +} + +func createFailingCounter() func() (int, error) { + counter := 0 + return func() (int, error) { + counter++ + return 0, fmt.Errorf("counter %d failed", counter) + } +} + +func createPassingCounter() func() (int, error) { + counter := 0 + return func() (int, error) { + counter++ + return counter, nil + } +} diff --git a/core/services/ocr2/plugins/ccip/internal/cache/mocks/chain_health_mock.go b/core/services/ocr2/plugins/ccip/internal/cache/mocks/chain_health_mock.go new file mode 100644 index 00000000000..595b15774af --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/cache/mocks/chain_health_mock.go @@ -0,0 +1,183 @@ +// Code generated by mockery v2.43.2. DO NOT EDIT. + +package mocks + +import ( + context "context" + + mock "github.com/stretchr/testify/mock" +) + +// ChainHealthcheck is an autogenerated mock type for the ChainHealthcheck type +type ChainHealthcheck struct { + mock.Mock +} + +type ChainHealthcheck_Expecter struct { + mock *mock.Mock +} + +func (_m *ChainHealthcheck) EXPECT() *ChainHealthcheck_Expecter { + return &ChainHealthcheck_Expecter{mock: &_m.Mock} +} + +// Close provides a mock function with given fields: +func (_m *ChainHealthcheck) Close() error { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Close") + } + + var r0 error + if rf, ok := ret.Get(0).(func() error); ok { + r0 = rf() + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// ChainHealthcheck_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close' +type ChainHealthcheck_Close_Call struct { + *mock.Call +} + +// Close is a helper method to define mock.On call +func (_e *ChainHealthcheck_Expecter) Close() *ChainHealthcheck_Close_Call { + return &ChainHealthcheck_Close_Call{Call: _e.mock.On("Close")} +} + +func (_c *ChainHealthcheck_Close_Call) Run(run func()) *ChainHealthcheck_Close_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ChainHealthcheck_Close_Call) Return(_a0 error) *ChainHealthcheck_Close_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ChainHealthcheck_Close_Call) RunAndReturn(run func() error) *ChainHealthcheck_Close_Call { + _c.Call.Return(run) + return _c +} + +// IsHealthy provides a mock function with given fields: ctx +func (_m *ChainHealthcheck) IsHealthy(ctx context.Context) (bool, error) { + ret := _m.Called(ctx) + + if len(ret) == 0 { + panic("no return value specified for IsHealthy") + } + + var r0 bool + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (bool, error)); ok { + return rf(ctx) + } + if rf, ok := ret.Get(0).(func(context.Context) bool); ok { + r0 = rf(ctx) + } else { + r0 = ret.Get(0).(bool) + } + + if rf, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = rf(ctx) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ChainHealthcheck_IsHealthy_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsHealthy' +type ChainHealthcheck_IsHealthy_Call struct { + *mock.Call +} + +// IsHealthy is a helper method to define mock.On call +// - ctx context.Context +func (_e *ChainHealthcheck_Expecter) IsHealthy(ctx interface{}) *ChainHealthcheck_IsHealthy_Call { + return &ChainHealthcheck_IsHealthy_Call{Call: _e.mock.On("IsHealthy", ctx)} +} + +func (_c *ChainHealthcheck_IsHealthy_Call) Run(run func(ctx context.Context)) *ChainHealthcheck_IsHealthy_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *ChainHealthcheck_IsHealthy_Call) Return(_a0 bool, _a1 error) *ChainHealthcheck_IsHealthy_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ChainHealthcheck_IsHealthy_Call) RunAndReturn(run func(context.Context) (bool, error)) *ChainHealthcheck_IsHealthy_Call { + _c.Call.Return(run) + return _c +} + +// Start provides a mock function with given fields: _a0 +func (_m *ChainHealthcheck) Start(_a0 context.Context) error { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for Start") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context) error); ok { + r0 = rf(_a0) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// ChainHealthcheck_Start_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Start' +type ChainHealthcheck_Start_Call struct { + *mock.Call +} + +// Start is a helper method to define mock.On call +// - _a0 context.Context +func (_e *ChainHealthcheck_Expecter) Start(_a0 interface{}) *ChainHealthcheck_Start_Call { + return &ChainHealthcheck_Start_Call{Call: _e.mock.On("Start", _a0)} +} + +func (_c *ChainHealthcheck_Start_Call) Run(run func(_a0 context.Context)) *ChainHealthcheck_Start_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *ChainHealthcheck_Start_Call) Return(_a0 error) *ChainHealthcheck_Start_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ChainHealthcheck_Start_Call) RunAndReturn(run func(context.Context) error) *ChainHealthcheck_Start_Call { + _c.Call.Return(run) + return _c +} + +// NewChainHealthcheck creates a new instance of ChainHealthcheck. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewChainHealthcheck(t interface { + mock.TestingT + Cleanup(func()) +}) *ChainHealthcheck { + mock := &ChainHealthcheck{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/core/services/ocr2/plugins/ccip/internal/cache/observed_chain_health.go b/core/services/ocr2/plugins/ccip/internal/cache/observed_chain_health.go new file mode 100644 index 00000000000..941162448af --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/cache/observed_chain_health.go @@ -0,0 +1,70 @@ +package cache + +import ( + "context" + "strconv" + + "github.com/prometheus/client_golang/prometheus" + "github.com/prometheus/client_golang/prometheus/promauto" + + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" +) + +var ( + laneHealthStatus = promauto.NewGaugeVec(prometheus.GaugeOpts{ + Name: "ccip_lane_healthcheck_status", + Help: "Keep track of the chain healthcheck calls for each lane and plugin", + }, []string{"plugin", "source", "dest", "onramp"}) +) + +type ObservedChainHealthcheck struct { + ChainHealthcheck + + sourceChain string + destChain string + plugin string + // onrampAddress is used to distinguish between 1.0/2.0 lanes or blue/green lanes during deployment + // This changes very rarely, so it's not a performance concern for Prometheus + onrampAddress string + laneHealthStatus *prometheus.GaugeVec +} + +func NewObservedChainHealthCheck( + chainHealthcheck ChainHealthcheck, + plugin string, + sourceChain int64, + destChain int64, + onrampAddress cciptypes.Address, +) *ObservedChainHealthcheck { + return &ObservedChainHealthcheck{ + ChainHealthcheck: chainHealthcheck, + sourceChain: strconv.FormatInt(sourceChain, 10), + destChain: strconv.FormatInt(destChain, 10), + plugin: plugin, + laneHealthStatus: laneHealthStatus, + onrampAddress: string(onrampAddress), + } +} + +func (o *ObservedChainHealthcheck) IsHealthy(ctx context.Context) (bool, error) { + healthy, err := o.ChainHealthcheck.IsHealthy(ctx) + o.trackState(healthy, err) + return healthy, err +} + +func (o *ObservedChainHealthcheck) trackState(healthy bool, err error) { + if err != nil { + // Don't report errors as unhealthy, as they are not necessarily indicative of the chain's health + // Could be RPC issues, etc. + return + } + + status := 0 + if healthy { + status = 1 + } + + o.laneHealthStatus. + WithLabelValues(o.plugin, o.sourceChain, o.destChain, o.onrampAddress). + Set(float64(status)) +} diff --git a/core/services/ocr2/plugins/ccip/internal/cache/observed_chain_health_test.go b/core/services/ocr2/plugins/ccip/internal/cache/observed_chain_health_test.go new file mode 100644 index 00000000000..19583a37c70 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/cache/observed_chain_health_test.go @@ -0,0 +1,62 @@ +package cache + +import ( + "fmt" + "testing" + + "github.com/ethereum/go-ethereum/common" + "github.com/prometheus/client_golang/prometheus/testutil" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + "github.com/stretchr/testify/require" + + "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" + + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/cache/mocks" +) + +var address = cciptypes.Address(common.HexToAddress("0x1234567890123456789012345678901234567890").String()) + +func Test_ObservedChainStateSkipErrors(t *testing.T) { + mockedHealthcheck := mocks.NewChainHealthcheck(t) + mockedHealthcheck.On("IsHealthy", mock.Anything).Return(false, fmt.Errorf("error")) + + observedChainState := NewObservedChainHealthCheck( + mockedHealthcheck, + "plugin", + 10, + 20, + address, + ) + + _, err := observedChainState.IsHealthy(tests.Context(t)) + assert.Error(t, err) + assert.Equal(t, float64(0), testutil.ToFloat64(laneHealthStatus.WithLabelValues("plugin", "10", "20", "0x1234567890123456789012345678901234567890"))) +} + +func Test_ObservedChainStateReportsStatus(t *testing.T) { + mockedHealthcheck := mocks.NewChainHealthcheck(t) + mockedHealthcheck.On("IsHealthy", mock.Anything).Return(true, nil).Once() + + observedChainState := NewObservedChainHealthCheck( + mockedHealthcheck, + "plugin", + 10, + 20, + address, + ) + + health, err := observedChainState.IsHealthy(tests.Context(t)) + require.NoError(t, err) + assert.True(t, health) + assert.Equal(t, float64(1), testutil.ToFloat64(laneHealthStatus.WithLabelValues("plugin", "10", "20", "0x1234567890123456789012345678901234567890"))) + + // Mark as unhealthy + mockedHealthcheck.On("IsHealthy", mock.Anything).Return(false, nil).Once() + + health, err = observedChainState.IsHealthy(tests.Context(t)) + require.NoError(t, err) + assert.False(t, health) + assert.Equal(t, float64(0), testutil.ToFloat64(laneHealthStatus.WithLabelValues("plugin", "10", "20", "0x1234567890123456789012345678901234567890"))) +} diff --git a/core/services/ocr2/plugins/ccip/internal/cache/once.go b/core/services/ocr2/plugins/ccip/internal/cache/once.go new file mode 100644 index 00000000000..713501a03e1 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/cache/once.go @@ -0,0 +1,38 @@ +package cache + +import ( + "context" + "sync" +) + +type OnceCtxFunction[T any] func(ctx context.Context) (T, error) + +// CallOnceOnNoError returns a new function that wraps the given function f with caching capabilities. +// If f returns an error, the result is not cached, allowing f to be retried on subsequent calls. +// Use case for that is to avoid caching an error forever in case of transient errors (e.g. flaky RPC) +func CallOnceOnNoError[T any](f OnceCtxFunction[T]) OnceCtxFunction[T] { + var ( + mu sync.Mutex + value T + err error + called bool + ) + + return func(ctx context.Context) (T, error) { + mu.Lock() + defer mu.Unlock() + + // If the function has been called successfully before, return the cached result. + if called && err == nil { + return value, nil + } + + // Call the function and cache the result only if there is no error. + value, err = f(ctx) + if err == nil { + called = true + } + + return value, err + } +} diff --git a/core/services/ocr2/plugins/ccip/internal/cache/once_test.go b/core/services/ocr2/plugins/ccip/internal/cache/once_test.go new file mode 100644 index 00000000000..6ba2fbddd53 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/cache/once_test.go @@ -0,0 +1,83 @@ +package cache + +import ( + "context" + "errors" + "sync" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" +) + +// TestCallOnceOnNoErrorCachingSuccess tests caching behavior when the function succeeds. +func TestCallOnceOnNoErrorCachingSuccess(t *testing.T) { + callCount := 0 + testFunc := func(ctx context.Context) (string, error) { + callCount++ + return "test result", nil + } + + cachedFunc := CallOnceOnNoError(testFunc) + + // Call the function twice. + _, err := cachedFunc(tests.Context(t)) + assert.NoError(t, err, "Expected no error on the first call") + + _, err = cachedFunc(tests.Context(t)) + assert.NoError(t, err, "Expected no error on the second call") + + assert.Equal(t, 1, callCount, "Function should be called exactly once") +} + +// TestCallOnceOnNoErrorCachingError tests that the function is retried after an error. +func TestCallOnceOnNoErrorCachingError(t *testing.T) { + callCount := 0 + testFunc := func(ctx context.Context) (string, error) { + callCount++ + if callCount == 1 { + return "", errors.New("test error") + } + return "test result", nil + } + + cachedFunc := CallOnceOnNoError(testFunc) + + // First call should fail. + _, err := cachedFunc(tests.Context(t)) + require.Error(t, err, "Expected an error on the first call") + + // Second call should succeed. + r, err := cachedFunc(tests.Context(t)) + assert.NoError(t, err, "Expected no error on the second call") + assert.Equal(t, "test result", r) + assert.Equal(t, 2, callCount, "Function should be called exactly twice") +} + +// TestCallOnceOnNoErrorCachingConcurrency tests that the function works correctly under concurrent access. +func TestCallOnceOnNoErrorCachingConcurrency(t *testing.T) { + var wg sync.WaitGroup + callCount := 0 + testFunc := func(ctx context.Context) (string, error) { + callCount++ + return "test result", nil + } + + cachedFunc := CallOnceOnNoError(testFunc) + + // Simulate concurrent calls. + for i := 0; i < 10; i++ { + wg.Add(1) + go func() { + defer wg.Done() + _, err := cachedFunc(tests.Context(t)) + assert.NoError(t, err, "Expected no error in concurrent execution") + }() + } + + wg.Wait() + + assert.Equal(t, 1, callCount, "Function should be called exactly once despite concurrent calls") +} diff --git a/core/services/ocr2/plugins/ccip/internal/ccipcalc/addr.go b/core/services/ocr2/plugins/ccip/internal/ccipcalc/addr.go new file mode 100644 index 00000000000..40cdab6df9d --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/ccipcalc/addr.go @@ -0,0 +1,44 @@ +package ccipcalc + +import ( + "fmt" + + "github.com/ethereum/go-ethereum/common" + + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" +) + +func EvmAddrsToGeneric(evmAddrs ...common.Address) []cciptypes.Address { + res := make([]cciptypes.Address, 0, len(evmAddrs)) + for _, addr := range evmAddrs { + res = append(res, cciptypes.Address(addr.String())) + } + return res +} + +func EvmAddrToGeneric(evmAddr common.Address) cciptypes.Address { + return cciptypes.Address(evmAddr.String()) +} + +func GenericAddrsToEvm(genericAddrs ...cciptypes.Address) ([]common.Address, error) { + evmAddrs := make([]common.Address, 0, len(genericAddrs)) + for _, addr := range genericAddrs { + if !common.IsHexAddress(string(addr)) { + return nil, fmt.Errorf("%s not an evm address", addr) + } + evmAddrs = append(evmAddrs, common.HexToAddress(string(addr))) + } + return evmAddrs, nil +} + +func GenericAddrToEvm(genAddr cciptypes.Address) (common.Address, error) { + evmAddrs, err := GenericAddrsToEvm(genAddr) + if err != nil { + return common.Address{}, err + } + return evmAddrs[0], nil +} + +func HexToAddress(h string) cciptypes.Address { + return cciptypes.Address(common.HexToAddress(h).String()) +} diff --git a/core/services/ocr2/plugins/ccip/internal/ccipcalc/calc.go b/core/services/ocr2/plugins/ccip/internal/ccipcalc/calc.go new file mode 100644 index 00000000000..8ba57e77ed2 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/ccipcalc/calc.go @@ -0,0 +1,69 @@ +package ccipcalc + +import ( + "math/big" + "sort" + + "github.com/smartcontractkit/chainlink/v2/core/logger" +) + +// ContiguousReqs checks if seqNrs contains all numbers from min to max. +func ContiguousReqs(lggr logger.Logger, min, max uint64, seqNrs []uint64) bool { + if int(max-min+1) != len(seqNrs) { + return false + } + + for i, j := min, 0; i <= max && j < len(seqNrs); i, j = i+1, j+1 { + if seqNrs[j] != i { + lggr.Errorw("unexpected gap in seq nums", "seqNr", i, "minSeqNr", min, "maxSeqNr", max) + return false + } + } + return true +} + +// CalculateUsdPerUnitGas returns: (sourceGasPrice * usdPerFeeCoin) / 1e18 +func CalculateUsdPerUnitGas(sourceGasPrice *big.Int, usdPerFeeCoin *big.Int) *big.Int { + // (wei / gas) * (usd / eth) * (1 eth / 1e18 wei) = usd/gas + tmp := new(big.Int).Mul(sourceGasPrice, usdPerFeeCoin) + return tmp.Div(tmp, big.NewInt(1e18)) +} + +// BigIntSortedMiddle returns the middle number after sorting the provided numbers. nil is returned if the provided slice is empty. +// If length of the provided slice is even, the right-hand-side value of the middle 2 numbers is returned. +// The objective of this function is to always pick within the range of values reported by honest nodes when we have 2f+1 values. +func BigIntSortedMiddle(vals []*big.Int) *big.Int { + if len(vals) == 0 { + return nil + } + + valsCopy := make([]*big.Int, len(vals)) + copy(valsCopy[:], vals[:]) + sort.Slice(valsCopy, func(i, j int) bool { + return valsCopy[i].Cmp(valsCopy[j]) == -1 + }) + return valsCopy[len(valsCopy)/2] +} + +// Deviates checks if x1 and x2 deviates based on the provided ppb (parts per billion) +// ppb is calculated based on the smaller value of the two +// e.g, if x1 > x2, deviation_parts_per_billion = ((x1 - x2) / x2) * 1e9 +func Deviates(x1, x2 *big.Int, ppb int64) bool { + // if x1 == 0 or x2 == 0, deviates if x2 != x1, to avoid the relative division by 0 error + if x1.BitLen() == 0 || x2.BitLen() == 0 { + return x1.Cmp(x2) != 0 + } + diff := big.NewInt(0).Sub(x1, x2) // diff = x1-x2 + diff.Mul(diff, big.NewInt(1e9)) // diff = diff * 1e9 + // dividing by the smaller value gives consistent ppb regardless of input order, and supports >100% deviation. + if x1.Cmp(x2) > 0 { + diff.Div(diff, x2) + } else { + diff.Div(diff, x1) + } + return diff.CmpAbs(big.NewInt(ppb)) > 0 // abs(diff) > ppb +} + +func MergeEpochAndRound(epoch uint32, round uint8) uint64 { + return uint64(epoch)<<8 + uint64(round) +} diff --git a/core/services/ocr2/plugins/ccip/internal/ccipcalc/calc_test.go b/core/services/ocr2/plugins/ccip/internal/ccipcalc/calc_test.go new file mode 100644 index 00000000000..83384eca481 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/ccipcalc/calc_test.go @@ -0,0 +1,220 @@ +package ccipcalc + +import ( + "math" + "math/big" + "testing" + + "github.com/stretchr/testify/assert" + + "github.com/smartcontractkit/chainlink/v2/core/logger" +) + +func TestMergeEpochAndRound(t *testing.T) { + type args struct { + epoch uint32 + round uint8 + } + tests := []struct { + name string + args args + want uint64 + }{ + { + name: "zero round and epoch", + args: args{epoch: 0, round: 0}, + want: 0, + }, + { + name: "avg case", + args: args{ + epoch: 243, + round: 15, + }, + want: 62223, + }, + { + name: "largest epoch and round", + args: args{ + epoch: math.MaxUint32, + round: math.MaxUint8, + }, + want: 1099511627775, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + assert.Equalf(t, tt.want, + MergeEpochAndRound(tt.args.epoch, tt.args.round), + "mergeEpochAndRound(%v, %v)", tt.args.epoch, tt.args.round) + }) + } +} + +func TestContiguousReqs(t *testing.T) { + testCases := []struct { + min uint64 + max uint64 + seqNrs []uint64 + exp bool + }{ + {min: 5, max: 10, seqNrs: []uint64{5, 6, 7, 8, 9, 10}, exp: true}, + {min: 5, max: 10, seqNrs: []uint64{5, 7, 8, 9, 10}, exp: false}, + {min: 5, max: 10, seqNrs: []uint64{5, 6, 7, 8, 9, 10, 11}, exp: false}, + {min: 5, max: 10, seqNrs: []uint64{}, exp: false}, + {min: 1, max: 1, seqNrs: []uint64{1}, exp: true}, + {min: 6, max: 10, seqNrs: []uint64{5, 7, 8, 9, 10}, exp: false}, + } + + for _, tc := range testCases { + res := ContiguousReqs(logger.NullLogger, tc.min, tc.max, tc.seqNrs) + assert.Equal(t, tc.exp, res) + } +} + +func TestCalculateUsdPerUnitGas(t *testing.T) { + testCases := []struct { + name string + sourceGasPrice *big.Int + usdPerFeeCoin *big.Int + exp *big.Int + }{ + { + name: "base case", + sourceGasPrice: big.NewInt(2e18), + usdPerFeeCoin: big.NewInt(3e18), + exp: big.NewInt(6e18), + }, + { + name: "small numbers", + sourceGasPrice: big.NewInt(1000), + usdPerFeeCoin: big.NewInt(2000), + exp: big.NewInt(0), + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + res := CalculateUsdPerUnitGas(tc.sourceGasPrice, tc.usdPerFeeCoin) + assert.Zero(t, tc.exp.Cmp(res)) + }) + } +} + +func TestBigIntSortedMiddle(t *testing.T) { + tests := []struct { + name string + vals []*big.Int + want *big.Int + }{ + { + name: "base case", + vals: []*big.Int{big.NewInt(1), big.NewInt(2), big.NewInt(4), big.NewInt(5)}, + want: big.NewInt(4), + }, + { + name: "not sorted", + vals: []*big.Int{big.NewInt(100), big.NewInt(50), big.NewInt(30), big.NewInt(110)}, + want: big.NewInt(100), + }, + { + name: "empty slice", + vals: []*big.Int{}, + want: nil, + }, + { + name: "one item", + vals: []*big.Int{big.NewInt(123)}, + want: big.NewInt(123), + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + assert.Equalf(t, tt.want, BigIntSortedMiddle(tt.vals), "BigIntSortedMiddle(%v)", tt.vals) + }) + } +} + +func TestDeviates(t *testing.T) { + type args struct { + x1 *big.Int + x2 *big.Int + ppb int64 + } + tests := []struct { + name string + args args + want bool + }{ + { + name: "base case", + args: args{x1: big.NewInt(1e9), x2: big.NewInt(2e9), ppb: 1}, + want: true, + }, + { + name: "x1 is zero and x1 neq x2", + args: args{x1: big.NewInt(0), x2: big.NewInt(1), ppb: 999}, + want: true, + }, + { + name: "x2 is zero and x1 neq x2", + args: args{x1: big.NewInt(1), x2: big.NewInt(0), ppb: 999}, + want: true, + }, + { + name: "x1 and x2 are both zero", + args: args{x1: big.NewInt(0), x2: big.NewInt(0), ppb: 999}, + want: false, + }, + { + name: "deviates when ppb is 0", + args: args{x1: big.NewInt(0), x2: big.NewInt(1), ppb: 0}, + want: true, + }, + { + name: "does not deviate when x1 eq x2", + args: args{x1: big.NewInt(5), x2: big.NewInt(5), ppb: 1}, + want: false, + }, + { + name: "does not deviate with high ppb when x2 is greater", + args: args{x1: big.NewInt(5), x2: big.NewInt(10), ppb: 2e9}, + want: false, + }, + { + name: "does not deviate with high ppb when x1 is greater", + args: args{x1: big.NewInt(10), x2: big.NewInt(5), ppb: 2e9}, + want: false, + }, + { + name: "deviates with low ppb when x2 is greater", + args: args{x1: big.NewInt(5), x2: big.NewInt(10), ppb: 9e8}, + want: true, + }, + { + name: "deviates with low ppb when x1 is greater", + args: args{x1: big.NewInt(10), x2: big.NewInt(5), ppb: 9e8}, + want: true, + }, + { + name: "near deviation limit but deviates", + args: args{x1: big.NewInt(10), x2: big.NewInt(5), ppb: 1e9 - 1}, + want: true, + }, + { + name: "at deviation limit but does not deviate", + args: args{x1: big.NewInt(10), x2: big.NewInt(5), ppb: 1e9}, + want: false, + }, + { + name: "near deviation limit but does not deviate", + args: args{x1: big.NewInt(10), x2: big.NewInt(5), ppb: 1e9 + 1}, + want: false, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + assert.Equalf(t, tt.want, Deviates(tt.args.x1, tt.args.x2, tt.args.ppb), "Deviates(%v, %v, %v)", tt.args.x1, tt.args.x2, tt.args.ppb) + }) + } +} diff --git a/core/services/ocr2/plugins/ccip/internal/ccipcommon/shortcuts.go b/core/services/ocr2/plugins/ccip/internal/ccipcommon/shortcuts.go new file mode 100644 index 00000000000..8372ae47486 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/ccipcommon/shortcuts.go @@ -0,0 +1,123 @@ +package ccipcommon + +import ( + "context" + "encoding/binary" + "encoding/hex" + "fmt" + "sort" + "strings" + "time" + + "github.com/avast/retry-go/v4" + + "golang.org/x/sync/errgroup" + + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata" +) + +func GetMessageIDsAsHexString(messages []cciptypes.EVM2EVMMessage) []string { + messageIDs := make([]string, 0, len(messages)) + for _, m := range messages { + messageIDs = append(messageIDs, "0x"+hex.EncodeToString(m.MessageID[:])) + } + return messageIDs +} + +type BackfillArgs struct { + SourceLP, DestLP logpoller.LogPoller + SourceStartBlock, DestStartBlock uint64 +} + +func FlattenedAndSortedTokens(slices ...[]cciptypes.Address) (tokens []cciptypes.Address) { + // fee token can overlap with bridgeable tokens, we need to dedup them to arrive at lane token set + tokens = FlattenUniqueSlice(slices...) + + // return the tokens in deterministic order to aid with testing and debugging + sort.Slice(tokens, func(i, j int) bool { + return tokens[i] < tokens[j] + }) + + return tokens +} + +// GetDestinationTokens returns the destination chain fee tokens from the provided price registry +// and the bridgeable tokens from the offramp. +func GetDestinationTokens(ctx context.Context, offRamp ccipdata.OffRampReader, priceRegistry cciptypes.PriceRegistryReader) (fee, bridged []cciptypes.Address, err error) { + eg := new(errgroup.Group) + + var destFeeTokens []cciptypes.Address + var destBridgeableTokens []cciptypes.Address + + eg.Go(func() error { + tokens, err := priceRegistry.GetFeeTokens(ctx) + if err != nil { + return fmt.Errorf("get dest fee tokens: %w", err) + } + destFeeTokens = tokens + return nil + }) + + eg.Go(func() error { + tokens, err := offRamp.GetTokens(ctx) + if err != nil { + return fmt.Errorf("get dest bridgeable tokens: %w", err) + } + destBridgeableTokens = tokens.DestinationTokens + return nil + }) + + if err := eg.Wait(); err != nil { + return nil, nil, err + } + + return destFeeTokens, destBridgeableTokens, nil +} + +// FlattenUniqueSlice returns a flattened slice that contains unique elements by preserving their order. +func FlattenUniqueSlice[T comparable](slices ...[]T) []T { + seen := make(map[T]struct{}) + flattened := make([]T, 0) + + for _, sl := range slices { + for _, el := range sl { + if _, exists := seen[el]; !exists { + flattened = append(flattened, el) + seen[el] = struct{}{} + } + } + } + return flattened +} + +func IsTxRevertError(err error) bool { + if err == nil { + return false + } + + // Geth eth_call reverts with "execution reverted" + // Nethermind, Parity, OpenEthereum eth_call reverts with "VM execution error" + // See: https://github.com/ethereum/go-ethereum/issues/21886 + return strings.Contains(err.Error(), "execution reverted") || strings.Contains(err.Error(), "VM execution error") +} + +func SelectorToBytes(chainSelector uint64) [16]byte { + var b [16]byte + binary.BigEndian.PutUint64(b[:], chainSelector) + return b +} + +// RetryUntilSuccess repeatedly calls fn until it returns a nil error. After each failed call there is an exponential +// backoff applied, between initialDelay and maxDelay. +func RetryUntilSuccess[T any](fn func() (T, error), initialDelay time.Duration, maxDelay time.Duration) (T, error) { + return retry.DoWithData( + fn, + retry.Delay(initialDelay), + retry.MaxDelay(maxDelay), + retry.DelayType(retry.BackOffDelay), + retry.UntilSucceeded(), + ) +} diff --git a/core/services/ocr2/plugins/ccip/internal/ccipcommon/shortcuts_test.go b/core/services/ocr2/plugins/ccip/internal/ccipcommon/shortcuts_test.go new file mode 100644 index 00000000000..6f1cdb4a6af --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/ccipcommon/shortcuts_test.go @@ -0,0 +1,158 @@ +package ccipcommon + +import ( + "fmt" + "math/rand" + "strconv" + "testing" + "time" + + "github.com/ethereum/go-ethereum/common" + "github.com/stretchr/testify/assert" + + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" +) + +func TestGetMessageIDsAsHexString(t *testing.T) { + t.Run("base", func(t *testing.T) { + hashes := make([]cciptypes.Hash, 10) + for i := range hashes { + hashes[i] = cciptypes.Hash(common.HexToHash(strconv.Itoa(rand.Intn(100000)))) + } + + msgs := make([]cciptypes.EVM2EVMMessage, len(hashes)) + for i := range msgs { + msgs[i] = cciptypes.EVM2EVMMessage{MessageID: hashes[i]} + } + + messageIDs := GetMessageIDsAsHexString(msgs) + for i := range messageIDs { + assert.Equal(t, hashes[i].String(), messageIDs[i]) + } + }) + + t.Run("empty", func(t *testing.T) { + messageIDs := GetMessageIDsAsHexString(nil) + assert.Empty(t, messageIDs) + }) +} + +func TestFlattenUniqueSlice(t *testing.T) { + testCases := []struct { + name string + inputSlices [][]int + expectedOutput []int + }{ + {name: "empty", inputSlices: nil, expectedOutput: []int{}}, + {name: "empty 2", inputSlices: [][]int{}, expectedOutput: []int{}}, + {name: "single", inputSlices: [][]int{{1, 2, 3, 3, 3, 4}}, expectedOutput: []int{1, 2, 3, 4}}, + {name: "simple", inputSlices: [][]int{{1, 2, 3}, {2, 3, 4}}, expectedOutput: []int{1, 2, 3, 4}}, + { + name: "more complex case", + inputSlices: [][]int{{1, 3}, {2, 4, 3}, {5, 2, -1, 7, 10}}, + expectedOutput: []int{1, 3, 2, 4, 5, -1, 7, 10}, + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + res := FlattenUniqueSlice(tc.inputSlices...) + assert.Equal(t, tc.expectedOutput, res) + }) + } +} + +func TestFlattenedAndSortedTokens(t *testing.T) { + testCases := []struct { + name string + inputSlices [][]cciptypes.Address + expectedOutput []cciptypes.Address + }{ + {name: "empty", inputSlices: nil, expectedOutput: []cciptypes.Address{}}, + {name: "empty 2", inputSlices: [][]cciptypes.Address{}, expectedOutput: []cciptypes.Address{}}, + { + name: "single", + inputSlices: [][]cciptypes.Address{{"0x1", "0x2", "0x3"}}, + expectedOutput: []cciptypes.Address{"0x1", "0x2", "0x3"}, + }, + { + name: "simple", + inputSlices: [][]cciptypes.Address{{"0x1", "0x2", "0x3"}, {"0x2", "0x3", "0x4"}}, + expectedOutput: []cciptypes.Address{"0x1", "0x2", "0x3", "0x4"}, + }, + { + name: "more complex case", + inputSlices: [][]cciptypes.Address{ + {"0x1", "0x3"}, + {"0x2", "0x4", "0x3"}, + {"0x5", "0x2", "0x7", "0xa"}, + }, + expectedOutput: []cciptypes.Address{ + "0x1", + "0x2", + "0x3", + "0x4", + "0x5", + "0x7", + "0xa", + }, + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + res := FlattenedAndSortedTokens(tc.inputSlices...) + assert.Equal(t, tc.expectedOutput, res) + }) + } +} + +func TestIsTxRevertError(t *testing.T) { + testCases := []struct { + name string + inputError error + expectedOutput bool + }{ + {name: "empty", inputError: nil, expectedOutput: false}, + {name: "non-revert error", inputError: fmt.Errorf("nothing"), expectedOutput: false}, + {name: "geth error", inputError: fmt.Errorf("execution reverted"), expectedOutput: true}, + {name: "nethermind error", inputError: fmt.Errorf("VM execution error"), expectedOutput: true}, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + assert.Equal(t, tc.expectedOutput, IsTxRevertError(tc.inputError)) + }) + } +} + +func TestRetryUntilSuccess(t *testing.T) { + // Set delays to 0 for tests + initialDelay := 0 * time.Nanosecond + maxDelay := 0 * time.Nanosecond + + numAttempts := 5 + numCalls := 0 + // A function that returns success only after numAttempts calls. RetryUntilSuccess will repeatedly call this + // function until it succeeds. + fn := func() (int, error) { + numCalls++ + numAttempts-- + if numAttempts > 0 { + return numCalls, fmt.Errorf("") + } + return numCalls, nil + } + + // Assert that RetryUntilSuccess returns the expected value when fn returns success on the 5th attempt + numCalls, err := RetryUntilSuccess(fn, initialDelay, maxDelay) + assert.Nil(t, err) + assert.Equal(t, 5, numCalls) + + // Assert that RetryUntilSuccess returns the expected value when fn returns success on the 8th attempt + numAttempts = 8 + numCalls = 0 + numCalls, err = RetryUntilSuccess(fn, initialDelay, maxDelay) + assert.Nil(t, err) + assert.Equal(t, 8, numCalls) +} diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/batchreader/mocks/token_pool_batched_reader_mock.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/batchreader/mocks/token_pool_batched_reader_mock.go new file mode 100644 index 00000000000..551cd7c6a68 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/batchreader/mocks/token_pool_batched_reader_mock.go @@ -0,0 +1,142 @@ +// Code generated by mockery v2.43.2. DO NOT EDIT. + +package mocks + +import ( + context "context" + + ccip "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + + mock "github.com/stretchr/testify/mock" +) + +// TokenPoolBatchedReader is an autogenerated mock type for the TokenPoolBatchedReader type +type TokenPoolBatchedReader struct { + mock.Mock +} + +type TokenPoolBatchedReader_Expecter struct { + mock *mock.Mock +} + +func (_m *TokenPoolBatchedReader) EXPECT() *TokenPoolBatchedReader_Expecter { + return &TokenPoolBatchedReader_Expecter{mock: &_m.Mock} +} + +// Close provides a mock function with given fields: +func (_m *TokenPoolBatchedReader) Close() error { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Close") + } + + var r0 error + if rf, ok := ret.Get(0).(func() error); ok { + r0 = rf() + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// TokenPoolBatchedReader_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close' +type TokenPoolBatchedReader_Close_Call struct { + *mock.Call +} + +// Close is a helper method to define mock.On call +func (_e *TokenPoolBatchedReader_Expecter) Close() *TokenPoolBatchedReader_Close_Call { + return &TokenPoolBatchedReader_Close_Call{Call: _e.mock.On("Close")} +} + +func (_c *TokenPoolBatchedReader_Close_Call) Run(run func()) *TokenPoolBatchedReader_Close_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *TokenPoolBatchedReader_Close_Call) Return(_a0 error) *TokenPoolBatchedReader_Close_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *TokenPoolBatchedReader_Close_Call) RunAndReturn(run func() error) *TokenPoolBatchedReader_Close_Call { + _c.Call.Return(run) + return _c +} + +// GetInboundTokenPoolRateLimits provides a mock function with given fields: ctx, tokenPoolReaders +func (_m *TokenPoolBatchedReader) GetInboundTokenPoolRateLimits(ctx context.Context, tokenPoolReaders []ccip.Address) ([]ccip.TokenBucketRateLimit, error) { + ret := _m.Called(ctx, tokenPoolReaders) + + if len(ret) == 0 { + panic("no return value specified for GetInboundTokenPoolRateLimits") + } + + var r0 []ccip.TokenBucketRateLimit + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, []ccip.Address) ([]ccip.TokenBucketRateLimit, error)); ok { + return rf(ctx, tokenPoolReaders) + } + if rf, ok := ret.Get(0).(func(context.Context, []ccip.Address) []ccip.TokenBucketRateLimit); ok { + r0 = rf(ctx, tokenPoolReaders) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]ccip.TokenBucketRateLimit) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, []ccip.Address) error); ok { + r1 = rf(ctx, tokenPoolReaders) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// TokenPoolBatchedReader_GetInboundTokenPoolRateLimits_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetInboundTokenPoolRateLimits' +type TokenPoolBatchedReader_GetInboundTokenPoolRateLimits_Call struct { + *mock.Call +} + +// GetInboundTokenPoolRateLimits is a helper method to define mock.On call +// - ctx context.Context +// - tokenPoolReaders []ccip.Address +func (_e *TokenPoolBatchedReader_Expecter) GetInboundTokenPoolRateLimits(ctx interface{}, tokenPoolReaders interface{}) *TokenPoolBatchedReader_GetInboundTokenPoolRateLimits_Call { + return &TokenPoolBatchedReader_GetInboundTokenPoolRateLimits_Call{Call: _e.mock.On("GetInboundTokenPoolRateLimits", ctx, tokenPoolReaders)} +} + +func (_c *TokenPoolBatchedReader_GetInboundTokenPoolRateLimits_Call) Run(run func(ctx context.Context, tokenPoolReaders []ccip.Address)) *TokenPoolBatchedReader_GetInboundTokenPoolRateLimits_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].([]ccip.Address)) + }) + return _c +} + +func (_c *TokenPoolBatchedReader_GetInboundTokenPoolRateLimits_Call) Return(_a0 []ccip.TokenBucketRateLimit, _a1 error) *TokenPoolBatchedReader_GetInboundTokenPoolRateLimits_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *TokenPoolBatchedReader_GetInboundTokenPoolRateLimits_Call) RunAndReturn(run func(context.Context, []ccip.Address) ([]ccip.TokenBucketRateLimit, error)) *TokenPoolBatchedReader_GetInboundTokenPoolRateLimits_Call { + _c.Call.Return(run) + return _c +} + +// NewTokenPoolBatchedReader creates a new instance of TokenPoolBatchedReader. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewTokenPoolBatchedReader(t interface { + mock.TestingT + Cleanup(func()) +}) *TokenPoolBatchedReader { + mock := &TokenPoolBatchedReader{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/batchreader/token_pool_batch_reader.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/batchreader/token_pool_batch_reader.go new file mode 100644 index 00000000000..32ec1b24ac9 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/batchreader/token_pool_batch_reader.go @@ -0,0 +1,192 @@ +package batchreader + +import ( + "context" + "errors" + "fmt" + "sync" + + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/rpclib" + + "github.com/ethereum/go-ethereum/common" + + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + + "github.com/smartcontractkit/chainlink-common/pkg/logger" + type_and_version "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/type_and_version_interface_wrapper" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/abihelpers" + ccipconfig "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/config" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipcalc" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipcommon" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_4_0" +) + +var ( + typeAndVersionABI = abihelpers.MustParseABI(type_and_version.TypeAndVersionInterfaceABI) +) + +type EVMTokenPoolBatchedReader struct { + lggr logger.Logger + remoteChainSelector uint64 + offRampAddress common.Address + evmBatchCaller rpclib.EvmBatchCaller + + tokenPoolReaders map[cciptypes.Address]ccipdata.TokenPoolReader + tokenPoolReaderMu sync.RWMutex +} + +type TokenPoolBatchedReader interface { + cciptypes.TokenPoolBatchedReader +} + +var _ TokenPoolBatchedReader = (*EVMTokenPoolBatchedReader)(nil) + +func NewEVMTokenPoolBatchedReader(lggr logger.Logger, remoteChainSelector uint64, offRampAddress cciptypes.Address, evmBatchCaller rpclib.EvmBatchCaller) (*EVMTokenPoolBatchedReader, error) { + offRampAddrEvm, err := ccipcalc.GenericAddrToEvm(offRampAddress) + if err != nil { + return nil, err + } + + return &EVMTokenPoolBatchedReader{ + lggr: lggr, + remoteChainSelector: remoteChainSelector, + offRampAddress: offRampAddrEvm, + evmBatchCaller: evmBatchCaller, + tokenPoolReaders: make(map[cciptypes.Address]ccipdata.TokenPoolReader), + }, nil +} + +func (br *EVMTokenPoolBatchedReader) GetInboundTokenPoolRateLimits(ctx context.Context, tokenPools []cciptypes.Address) ([]cciptypes.TokenBucketRateLimit, error) { + if len(tokenPools) == 0 { + return []cciptypes.TokenBucketRateLimit{}, nil + } + + err := br.loadTokenPoolReaders(ctx, tokenPools) + if err != nil { + return nil, err + } + + tokenPoolReaders := make([]ccipdata.TokenPoolReader, 0, len(tokenPools)) + for _, poolAddress := range tokenPools { + br.tokenPoolReaderMu.RLock() + tokenPoolReader, exists := br.tokenPoolReaders[poolAddress] + br.tokenPoolReaderMu.RUnlock() + if !exists { + return nil, fmt.Errorf("token pool %s not found", poolAddress) + } + tokenPoolReaders = append(tokenPoolReaders, tokenPoolReader) + } + + evmCalls := make([]rpclib.EvmCall, 0, len(tokenPoolReaders)) + for _, poolReader := range tokenPoolReaders { + switch v := poolReader.(type) { + case *v1_2_0.TokenPool: + evmCalls = append(evmCalls, v1_2_0.GetInboundTokenPoolRateLimitCall(v.Address(), v.OffRampAddress)) + case *v1_4_0.TokenPool: + evmCalls = append(evmCalls, v1_4_0.GetInboundTokenPoolRateLimitCall(v.Address(), v.RemoteChainSelector)) + default: + return nil, fmt.Errorf("unsupported token pool version %T", v) + } + } + + results, err := br.evmBatchCaller.BatchCall(ctx, 0, evmCalls) + if err != nil { + return nil, fmt.Errorf("batch call limit: %w", err) + } + + resultsParsed, err := rpclib.ParseOutputs[cciptypes.TokenBucketRateLimit](results, func(d rpclib.DataAndErr) (cciptypes.TokenBucketRateLimit, error) { + return rpclib.ParseOutput[cciptypes.TokenBucketRateLimit](d, 0) + }) + if err != nil { + return nil, fmt.Errorf("parse outputs: %w", err) + } + return resultsParsed, nil +} + +// loadTokenPoolReaders loads the token pools into the factory's cache +func (br *EVMTokenPoolBatchedReader) loadTokenPoolReaders(ctx context.Context, tokenPoolAddresses []cciptypes.Address) error { + var missingTokens []common.Address + + br.tokenPoolReaderMu.RLock() + for _, poolAddress := range tokenPoolAddresses { + if _, exists := br.tokenPoolReaders[poolAddress]; !exists { + evmPoolAddr, err := ccipcalc.GenericAddrToEvm(poolAddress) + if err != nil { + return err + } + missingTokens = append(missingTokens, evmPoolAddr) + } + } + br.tokenPoolReaderMu.RUnlock() + + // Only continue if there are missing tokens + if len(missingTokens) == 0 { + return nil + } + + typeAndVersions, err := getBatchedTypeAndVersion(ctx, br.evmBatchCaller, missingTokens) + if err != nil { + return err + } + + br.tokenPoolReaderMu.Lock() + defer br.tokenPoolReaderMu.Unlock() + for i, tokenPoolAddress := range missingTokens { + typeAndVersion := typeAndVersions[i] + poolType, version, err := ccipconfig.ParseTypeAndVersion(typeAndVersion) + if err != nil { + return err + } + switch version { + case ccipdata.V1_0_0, ccipdata.V1_1_0, ccipdata.V1_2_0: + br.tokenPoolReaders[ccipcalc.EvmAddrToGeneric(tokenPoolAddress)] = v1_2_0.NewTokenPool(poolType, tokenPoolAddress, br.offRampAddress) + case ccipdata.V1_4_0: + br.tokenPoolReaders[ccipcalc.EvmAddrToGeneric(tokenPoolAddress)] = v1_4_0.NewTokenPool(poolType, tokenPoolAddress, br.remoteChainSelector) + default: + return fmt.Errorf("unsupported token pool version %v", version) + } + } + return nil +} + +func getBatchedTypeAndVersion(ctx context.Context, evmBatchCaller rpclib.EvmBatchCaller, poolAddresses []common.Address) ([]string, error) { + var evmCalls []rpclib.EvmCall + + for _, poolAddress := range poolAddresses { + // Add the typeAndVersion call to the batch + evmCalls = append(evmCalls, rpclib.NewEvmCall( + typeAndVersionABI, + "typeAndVersion", + poolAddress, + )) + } + + results, err := evmBatchCaller.BatchCall(ctx, 0, evmCalls) + if err != nil { + return nil, fmt.Errorf("batch call limit: %w", err) + } + + result, err := rpclib.ParseOutputs[string](results, func(d rpclib.DataAndErr) (string, error) { + tAndV, err1 := rpclib.ParseOutput[string](d, 0) + if err1 != nil { + // typeAndVersion method do not exist for 1.0 pools. We are going to get an ErrEmptyOutput in that case. + // Some chains, like the simulated chains, will simply revert with "execution reverted" + if errors.Is(err1, rpclib.ErrEmptyOutput) || ccipcommon.IsTxRevertError(err1) { + return "LegacyPool " + ccipdata.V1_0_0, nil + } + return "", err1 + } + + return tAndV, nil + }) + if err != nil { + return nil, fmt.Errorf("parse outputs: %w", err) + } + return result, nil +} + +func (br *EVMTokenPoolBatchedReader) Close() error { + return nil +} diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/batchreader/token_pool_batch_reader_test.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/batchreader/token_pool_batch_reader_test.go new file mode 100644 index 00000000000..ceafdf22721 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/batchreader/token_pool_batch_reader_test.go @@ -0,0 +1,86 @@ +package batchreader + +import ( + "context" + "fmt" + "math/big" + "testing" + + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/rpclib" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/rpclib/rpclibmocks" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + "github.com/stretchr/testify/require" + + "github.com/smartcontractkit/chainlink-common/pkg/logger" + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipcalc" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata" +) + +func TestTokenPoolFactory(t *testing.T) { + lggr := logger.Test(t) + offRamp := utils.RandomAddress() + ctx := context.Background() + remoteChainSelector := uint64(2000) + batchCallerMock := rpclibmocks.NewEvmBatchCaller(t) + + tokenPoolBatchReader, err := NewEVMTokenPoolBatchedReader(lggr, remoteChainSelector, ccipcalc.EvmAddrToGeneric(offRamp), batchCallerMock) + assert.NoError(t, err) + + poolTypes := []string{"BurnMint", "LockRelease"} + + rateLimits := cciptypes.TokenBucketRateLimit{ + Tokens: big.NewInt(333333), + LastUpdated: 33, + IsEnabled: true, + Capacity: big.NewInt(666666), + Rate: big.NewInt(444444), + } + + for _, versionStr := range []string{ccipdata.V1_0_0, ccipdata.V1_1_0, ccipdata.V1_2_0, ccipdata.V1_4_0} { + gotRateLimits, err := tokenPoolBatchReader.GetInboundTokenPoolRateLimits(ctx, []cciptypes.Address{}) + require.NoError(t, err) + assert.Empty(t, gotRateLimits) + + var batchCallResult []rpclib.DataAndErr + for _, poolType := range poolTypes { + if versionStr == ccipdata.V1_0_0 { + // simulating the behaviour for 1.0.0 pools where typeAndVersion method does not exist + batchCallResult = append(batchCallResult, rpclib.DataAndErr{ + Err: fmt.Errorf("unpack result: %w", rpclib.ErrEmptyOutput), + }) + } else { + batchCallResult = append(batchCallResult, rpclib.DataAndErr{ + Outputs: []any{poolType + " " + versionStr}, + Err: nil, + }) + } + } + + batchCallerMock.On("BatchCall", ctx, uint64(0), mock.Anything).Return(batchCallResult, nil).Once() + batchCallerMock.On("BatchCall", ctx, uint64(0), mock.Anything).Return([]rpclib.DataAndErr{{ + Outputs: []any{rateLimits}, + Err: nil, + }, { + Outputs: []any{rateLimits}, + Err: nil, + }}, nil).Once() + + var poolAddresses []cciptypes.Address + + for i := 0; i < len(poolTypes); i++ { + poolAddresses = append(poolAddresses, ccipcalc.EvmAddrToGeneric(utils.RandomAddress())) + } + + gotRateLimits, err = tokenPoolBatchReader.GetInboundTokenPoolRateLimits(ctx, poolAddresses) + require.NoError(t, err) + assert.Len(t, gotRateLimits, len(poolTypes)) + + for _, gotRateLimit := range gotRateLimits { + assert.Equal(t, rateLimits, gotRateLimit) + } + } +} diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/ccipdataprovider/mocks/price_registry_mock.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/ccipdataprovider/mocks/price_registry_mock.go new file mode 100644 index 00000000000..59588a25d17 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/ccipdataprovider/mocks/price_registry_mock.go @@ -0,0 +1,97 @@ +// Code generated by mockery v2.43.2. DO NOT EDIT. + +package mocks + +import ( + ccip "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + + context "context" + + mock "github.com/stretchr/testify/mock" +) + +// PriceRegistry is an autogenerated mock type for the PriceRegistry type +type PriceRegistry struct { + mock.Mock +} + +type PriceRegistry_Expecter struct { + mock *mock.Mock +} + +func (_m *PriceRegistry) EXPECT() *PriceRegistry_Expecter { + return &PriceRegistry_Expecter{mock: &_m.Mock} +} + +// NewPriceRegistryReader provides a mock function with given fields: ctx, addr +func (_m *PriceRegistry) NewPriceRegistryReader(ctx context.Context, addr ccip.Address) (ccip.PriceRegistryReader, error) { + ret := _m.Called(ctx, addr) + + if len(ret) == 0 { + panic("no return value specified for NewPriceRegistryReader") + } + + var r0 ccip.PriceRegistryReader + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, ccip.Address) (ccip.PriceRegistryReader, error)); ok { + return rf(ctx, addr) + } + if rf, ok := ret.Get(0).(func(context.Context, ccip.Address) ccip.PriceRegistryReader); ok { + r0 = rf(ctx, addr) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(ccip.PriceRegistryReader) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, ccip.Address) error); ok { + r1 = rf(ctx, addr) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// PriceRegistry_NewPriceRegistryReader_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NewPriceRegistryReader' +type PriceRegistry_NewPriceRegistryReader_Call struct { + *mock.Call +} + +// NewPriceRegistryReader is a helper method to define mock.On call +// - ctx context.Context +// - addr ccip.Address +func (_e *PriceRegistry_Expecter) NewPriceRegistryReader(ctx interface{}, addr interface{}) *PriceRegistry_NewPriceRegistryReader_Call { + return &PriceRegistry_NewPriceRegistryReader_Call{Call: _e.mock.On("NewPriceRegistryReader", ctx, addr)} +} + +func (_c *PriceRegistry_NewPriceRegistryReader_Call) Run(run func(ctx context.Context, addr ccip.Address)) *PriceRegistry_NewPriceRegistryReader_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(ccip.Address)) + }) + return _c +} + +func (_c *PriceRegistry_NewPriceRegistryReader_Call) Return(_a0 ccip.PriceRegistryReader, _a1 error) *PriceRegistry_NewPriceRegistryReader_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *PriceRegistry_NewPriceRegistryReader_Call) RunAndReturn(run func(context.Context, ccip.Address) (ccip.PriceRegistryReader, error)) *PriceRegistry_NewPriceRegistryReader_Call { + _c.Call.Return(run) + return _c +} + +// NewPriceRegistry creates a new instance of PriceRegistry. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewPriceRegistry(t interface { + mock.TestingT + Cleanup(func()) +}) *PriceRegistry { + mock := &PriceRegistry{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/ccipdataprovider/provider.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/ccipdataprovider/provider.go new file mode 100644 index 00000000000..971b507e828 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/ccipdataprovider/provider.go @@ -0,0 +1,41 @@ +package ccipdataprovider + +import ( + "context" + + "github.com/smartcontractkit/chainlink-common/pkg/logger" + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/factory" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/observability" +) + +type PriceRegistry interface { + NewPriceRegistryReader(ctx context.Context, addr cciptypes.Address) (cciptypes.PriceRegistryReader, error) +} + +type EvmPriceRegistry struct { + lp logpoller.LogPoller + ec client.Client + lggr logger.Logger + pluginLabel string +} + +func NewEvmPriceRegistry(lp logpoller.LogPoller, ec client.Client, lggr logger.Logger, pluginLabel string) *EvmPriceRegistry { + return &EvmPriceRegistry{ + lp: lp, + ec: ec, + lggr: lggr, + pluginLabel: pluginLabel, + } +} + +func (p *EvmPriceRegistry) NewPriceRegistryReader(ctx context.Context, addr cciptypes.Address) (cciptypes.PriceRegistryReader, error) { + destPriceRegistryReader, err := factory.NewPriceRegistryReader(ctx, p.lggr, factory.NewEvmVersionFinder(), addr, p.lp, p.ec) + if err != nil { + return nil, err + } + return observability.NewPriceRegistryReader(destPriceRegistryReader, p.ec.ConfiguredChainID().Int64(), p.pluginLabel), nil +} diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/commit_store_reader.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/commit_store_reader.go new file mode 100644 index 00000000000..2b144b765ed --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/commit_store_reader.go @@ -0,0 +1,81 @@ +package ccipdata + +import ( + "context" + "math/big" + "time" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/gas" + + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/pkg/errors" + + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/commit_store" + ccipconfig "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/config" +) + +// Common to all versions +type CommitOnchainConfig commit_store.CommitStoreDynamicConfig + +func (d CommitOnchainConfig) AbiString() string { + return ` + [ + { + "components": [ + {"name": "priceRegistry", "type": "address"} + ], + "type": "tuple" + } + ]` +} + +func (d CommitOnchainConfig) Validate() error { + if d.PriceRegistry == (common.Address{}) { + return errors.New("must set Price Registry address") + } + return nil +} + +func NewCommitOffchainConfig( + gasPriceDeviationPPB uint32, + gasPriceHeartBeat time.Duration, + tokenPriceDeviationPPB uint32, + tokenPriceHeartBeat time.Duration, + inflightCacheExpiry time.Duration, + priceReportingDisabled bool, +) cciptypes.CommitOffchainConfig { + return cciptypes.CommitOffchainConfig{ + GasPriceDeviationPPB: gasPriceDeviationPPB, + GasPriceHeartBeat: gasPriceHeartBeat, + TokenPriceDeviationPPB: tokenPriceDeviationPPB, + TokenPriceHeartBeat: tokenPriceHeartBeat, + InflightCacheExpiry: inflightCacheExpiry, + PriceReportingDisabled: priceReportingDisabled, + } +} + +type CommitStoreReader interface { + cciptypes.CommitStoreReader + SetGasEstimator(ctx context.Context, gpe gas.EvmFeeEstimator) error + SetSourceMaxGasPrice(ctx context.Context, sourceMaxGasPrice *big.Int) error +} + +// FetchCommitStoreStaticConfig provides access to a commitStore's static config, which is required to access the source chain ID. +func FetchCommitStoreStaticConfig(address common.Address, ec client.Client) (commit_store.CommitStoreStaticConfig, error) { + commitStore, err := loadCommitStore(address, ec) + if err != nil { + return commit_store.CommitStoreStaticConfig{}, err + } + return commitStore.GetStaticConfig(&bind.CallOpts{}) +} + +func loadCommitStore(commitStoreAddress common.Address, client client.Client) (commit_store.CommitStoreInterface, error) { + _, err := ccipconfig.VerifyTypeAndVersion(commitStoreAddress, client, ccipconfig.CommitStore) + if err != nil { + return nil, errors.Wrap(err, "Invalid commitStore contract") + } + return commit_store.NewCommitStore(commitStoreAddress, client) +} diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/commit_store_reader_test.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/commit_store_reader_test.go new file mode 100644 index 00000000000..0cf876b0fe5 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/commit_store_reader_test.go @@ -0,0 +1,422 @@ +package ccipdata_test + +import ( + "context" + "math/big" + "reflect" + "testing" + "time" + + "github.com/ethereum/go-ethereum/common" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + "github.com/stretchr/testify/require" + + "github.com/smartcontractkit/chainlink-common/pkg/config" + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + + "github.com/smartcontractkit/chainlink-common/pkg/logger" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" + evmclientmocks "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client/mocks" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/gas" + gasmocks "github.com/smartcontractkit/chainlink/v2/core/chains/evm/gas/mocks" + rollupMocks "github.com/smartcontractkit/chainlink/v2/core/chains/evm/gas/rollups/mocks" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/headtracker" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" + lpmocks "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller/mocks" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/commit_store_helper_1_0_0" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/commit_store_helper_1_2_0" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/mock_rmn_contract" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/price_registry_1_0_0" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/price_registry_1_2_0" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/pgtest" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/abihelpers" + ccipconfig "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/config" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipcalc" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/factory" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_0_0" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0" +) + +func TestCommitOffchainConfig_Encoding(t *testing.T) { + tests := map[string]struct { + want v1_2_0.JSONCommitOffchainConfig + expectErr bool + }{ + "encodes and decodes config with all fields set": { + want: v1_2_0.JSONCommitOffchainConfig{ + SourceFinalityDepth: 3, + DestFinalityDepth: 3, + GasPriceHeartBeat: *config.MustNewDuration(1 * time.Hour), + DAGasPriceDeviationPPB: 5e7, + ExecGasPriceDeviationPPB: 5e7, + TokenPriceHeartBeat: *config.MustNewDuration(1 * time.Hour), + TokenPriceDeviationPPB: 5e7, + InflightCacheExpiry: *config.MustNewDuration(23456 * time.Second), + }, + }, + "fails decoding when all fields present but with 0 values": { + want: v1_2_0.JSONCommitOffchainConfig{ + SourceFinalityDepth: 0, + DestFinalityDepth: 0, + GasPriceHeartBeat: *config.MustNewDuration(0), + DAGasPriceDeviationPPB: 0, + ExecGasPriceDeviationPPB: 0, + TokenPriceHeartBeat: *config.MustNewDuration(0), + TokenPriceDeviationPPB: 0, + InflightCacheExpiry: *config.MustNewDuration(0), + }, + expectErr: true, + }, + "fails decoding when all fields are missing": { + want: v1_2_0.JSONCommitOffchainConfig{}, + expectErr: true, + }, + "fails decoding when some fields are missing": { + want: v1_2_0.JSONCommitOffchainConfig{ + SourceFinalityDepth: 3, + GasPriceHeartBeat: *config.MustNewDuration(1 * time.Hour), + DAGasPriceDeviationPPB: 5e7, + ExecGasPriceDeviationPPB: 5e7, + TokenPriceHeartBeat: *config.MustNewDuration(1 * time.Hour), + TokenPriceDeviationPPB: 5e7, + }, + expectErr: true, + }, + } + for name, tc := range tests { + t.Run(name, func(t *testing.T) { + encode, err := ccipconfig.EncodeOffchainConfig(tc.want) + require.NoError(t, err) + got, err := ccipconfig.DecodeOffchainConfig[v1_2_0.JSONCommitOffchainConfig](encode) + + if tc.expectErr { + require.ErrorContains(t, err, "must set") + } else { + require.NoError(t, err) + require.Equal(t, tc.want, got) + } + }) + } +} + +func TestCommitOnchainConfig(t *testing.T) { + tests := []struct { + name string + want ccipdata.CommitOnchainConfig + expectErr bool + }{ + { + name: "encodes and decodes config with all fields set", + want: ccipdata.CommitOnchainConfig{ + PriceRegistry: utils.RandomAddress(), + }, + expectErr: false, + }, + { + name: "encodes and fails decoding config with missing fields", + want: ccipdata.CommitOnchainConfig{}, + expectErr: true, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + encoded, err := abihelpers.EncodeAbiStruct(tt.want) + require.NoError(t, err) + + decoded, err := abihelpers.DecodeAbiStruct[ccipdata.CommitOnchainConfig](encoded) + if tt.expectErr { + require.ErrorContains(t, err, "must set") + } else { + require.NoError(t, err) + require.Equal(t, tt.want, decoded) + } + }) + } +} + +func TestCommitStoreReaders(t *testing.T) { + user, ec := newSim(t) + ctx := testutils.Context(t) + lggr := logger.Test(t) + lpOpts := logpoller.Opts{ + PollPeriod: 100 * time.Millisecond, + FinalityDepth: 2, + BackfillBatchSize: 3, + RpcBatchSize: 2, + KeepFinalizedBlocksDepth: 1000, + } + headTracker := headtracker.NewSimulatedHeadTracker(ec, lpOpts.UseFinalityTag, lpOpts.FinalityDepth) + if lpOpts.PollPeriod == 0 { + lpOpts.PollPeriod = 1 * time.Hour + } + lp := logpoller.NewLogPoller(logpoller.NewORM(testutils.SimulatedChainID, pgtest.NewSqlxDB(t), lggr), ec, lggr, headTracker, lpOpts) + + // Deploy 2 commit store versions + onramp1 := utils.RandomAddress() + onramp2 := utils.RandomAddress() + // Report + rep := cciptypes.CommitStoreReport{ + TokenPrices: []cciptypes.TokenPrice{{Token: ccipcalc.EvmAddrToGeneric(utils.RandomAddress()), Value: big.NewInt(1)}}, + GasPrices: []cciptypes.GasPrice{{DestChainSelector: 1, Value: big.NewInt(1)}}, + Interval: cciptypes.CommitStoreInterval{Min: 1, Max: 10}, + MerkleRoot: common.HexToHash("0x1"), + } + er := big.NewInt(1) + armAddr, _, arm, err := mock_rmn_contract.DeployMockRMNContract(user, ec) + require.NoError(t, err) + addr, _, ch, err := commit_store_helper_1_0_0.DeployCommitStoreHelper(user, ec, commit_store_helper_1_0_0.CommitStoreStaticConfig{ + ChainSelector: testutils.SimulatedChainID.Uint64(), + SourceChainSelector: testutils.SimulatedChainID.Uint64(), + OnRamp: onramp1, + ArmProxy: armAddr, + }) + require.NoError(t, err) + addr2, _, ch2, err := commit_store_helper_1_2_0.DeployCommitStoreHelper(user, ec, commit_store_helper_1_2_0.CommitStoreStaticConfig{ + ChainSelector: testutils.SimulatedChainID.Uint64(), + SourceChainSelector: testutils.SimulatedChainID.Uint64(), + OnRamp: onramp2, + ArmProxy: armAddr, + }) + require.NoError(t, err) + commitAndGetBlockTs(ec) // Deploy these + pr, _, _, err := price_registry_1_0_0.DeployPriceRegistry(user, ec, []common.Address{addr}, nil, 1e6) + require.NoError(t, err) + pr2, _, _, err := price_registry_1_2_0.DeployPriceRegistry(user, ec, []common.Address{addr2}, nil, 1e6) + require.NoError(t, err) + commitAndGetBlockTs(ec) // Deploy these + ge := new(gasmocks.EvmFeeEstimator) + lm := new(rollupMocks.L1Oracle) + ge.On("L1Oracle").Return(lm) + + maxGasPrice := big.NewInt(1e8) + c10r, err := factory.NewCommitStoreReader(lggr, factory.NewEvmVersionFinder(), ccipcalc.EvmAddrToGeneric(addr), ec, lp) // ge, maxGasPrice + require.NoError(t, err) + err = c10r.SetGasEstimator(ctx, ge) + require.NoError(t, err) + err = c10r.SetSourceMaxGasPrice(ctx, maxGasPrice) + require.NoError(t, err) + assert.Equal(t, reflect.TypeOf(c10r).String(), reflect.TypeOf(&v1_0_0.CommitStore{}).String()) + c12r, err := factory.NewCommitStoreReader(lggr, factory.NewEvmVersionFinder(), ccipcalc.EvmAddrToGeneric(addr2), ec, lp) + require.NoError(t, err) + err = c12r.SetGasEstimator(ctx, ge) + require.NoError(t, err) + err = c12r.SetSourceMaxGasPrice(ctx, maxGasPrice) + require.NoError(t, err) + assert.Equal(t, reflect.TypeOf(c12r).String(), reflect.TypeOf(&v1_2_0.CommitStore{}).String()) + + // Apply config + signers := []common.Address{utils.RandomAddress(), utils.RandomAddress(), utils.RandomAddress(), utils.RandomAddress()} + transmitters := []common.Address{utils.RandomAddress(), utils.RandomAddress(), utils.RandomAddress(), utils.RandomAddress()} + onchainConfig, err := abihelpers.EncodeAbiStruct[ccipdata.CommitOnchainConfig](ccipdata.CommitOnchainConfig{ + PriceRegistry: pr, + }) + require.NoError(t, err) + + sourceFinalityDepth := uint32(1) + destFinalityDepth := uint32(2) + commonOffchain := cciptypes.CommitOffchainConfig{ + GasPriceDeviationPPB: 1e6, + GasPriceHeartBeat: 1 * time.Hour, + TokenPriceDeviationPPB: 1e6, + TokenPriceHeartBeat: 1 * time.Hour, + InflightCacheExpiry: 3 * time.Hour, + PriceReportingDisabled: false, + } + offchainConfig, err := ccipconfig.EncodeOffchainConfig[v1_0_0.CommitOffchainConfig](v1_0_0.CommitOffchainConfig{ + SourceFinalityDepth: sourceFinalityDepth, + DestFinalityDepth: destFinalityDepth, + FeeUpdateHeartBeat: *config.MustNewDuration(commonOffchain.GasPriceHeartBeat), + FeeUpdateDeviationPPB: commonOffchain.GasPriceDeviationPPB, + InflightCacheExpiry: *config.MustNewDuration(commonOffchain.InflightCacheExpiry), + }) + require.NoError(t, err) + _, err = ch.SetOCR2Config(user, signers, transmitters, 1, onchainConfig, 1, []byte{}) + require.NoError(t, err) + onchainConfig2, err := abihelpers.EncodeAbiStruct[ccipdata.CommitOnchainConfig](ccipdata.CommitOnchainConfig{ + PriceRegistry: pr2, + }) + require.NoError(t, err) + offchainConfig2, err := ccipconfig.EncodeOffchainConfig[v1_2_0.JSONCommitOffchainConfig](v1_2_0.JSONCommitOffchainConfig{ + SourceFinalityDepth: sourceFinalityDepth, + DestFinalityDepth: destFinalityDepth, + GasPriceHeartBeat: *config.MustNewDuration(commonOffchain.GasPriceHeartBeat), + DAGasPriceDeviationPPB: 1e7, + ExecGasPriceDeviationPPB: commonOffchain.GasPriceDeviationPPB, + TokenPriceDeviationPPB: commonOffchain.TokenPriceDeviationPPB, + TokenPriceHeartBeat: *config.MustNewDuration(commonOffchain.TokenPriceHeartBeat), + InflightCacheExpiry: *config.MustNewDuration(commonOffchain.InflightCacheExpiry), + }) + require.NoError(t, err) + _, err = ch2.SetOCR2Config(user, signers, transmitters, 1, onchainConfig2, 1, []byte{}) + require.NoError(t, err) + commitAndGetBlockTs(ec) + + // Apply report + b, err := c10r.EncodeCommitReport(ctx, rep) + require.NoError(t, err) + _, err = ch.Report(user, b, er) + require.NoError(t, err) + b, err = c12r.EncodeCommitReport(ctx, rep) + require.NoError(t, err) + _, err = ch2.Report(user, b, er) + require.NoError(t, err) + commitAndGetBlockTs(ec) + + // Capture all logs. + lp.PollAndSaveLogs(context.Background(), 1) + + configs := map[string][][]byte{ + ccipdata.V1_0_0: {onchainConfig, offchainConfig}, + ccipdata.V1_2_0: {onchainConfig2, offchainConfig2}, + } + crs := map[string]ccipdata.CommitStoreReader{ + ccipdata.V1_0_0: c10r, + ccipdata.V1_2_0: c12r, + } + prs := map[string]common.Address{ + ccipdata.V1_0_0: pr, + ccipdata.V1_2_0: pr2, + } + gasPrice := big.NewInt(10) + daPrice := big.NewInt(20) + ge.On("GetFee", mock.Anything, mock.Anything, mock.Anything, assets.NewWei(maxGasPrice), (*common.Address)(nil), (*common.Address)(nil)).Return(gas.EvmFee{Legacy: assets.NewWei(gasPrice)}, uint64(0), nil) + lm.On("GasPrice", mock.Anything).Return(assets.NewWei(daPrice), nil) + + for v, cr := range crs { + cr := cr + t.Run("CommitStoreReader "+v, func(t *testing.T) { + // Static config. + cfg, err := cr.GetCommitStoreStaticConfig(context.Background()) + require.NoError(t, err) + require.NotNil(t, cfg) + + // Assert encoding + b, err := cr.EncodeCommitReport(ctx, rep) + require.NoError(t, err) + d, err := cr.DecodeCommitReport(ctx, b) + require.NoError(t, err) + assert.Equal(t, d, rep) + + // Assert reading + latest, err := cr.GetLatestPriceEpochAndRound(context.Background()) + require.NoError(t, err) + assert.Equal(t, er.Uint64(), latest) + + // Assert cursing + down, err := cr.IsDown(context.Background()) + require.NoError(t, err) + assert.False(t, down) + _, err = arm.VoteToCurse(user, [32]byte{}) + require.NoError(t, err) + ec.Commit() + down, err = cr.IsDown(context.Background()) + require.NoError(t, err) + assert.True(t, down) + _, err = arm.OwnerUnvoteToCurse0(user, nil) + require.NoError(t, err) + ec.Commit() + + seqNr, err := cr.GetExpectedNextSequenceNumber(context.Background()) + require.NoError(t, err) + assert.Equal(t, rep.Interval.Max+1, seqNr) + + reps, err := cr.GetCommitReportMatchingSeqNum(context.Background(), rep.Interval.Max+1, 0) + require.NoError(t, err) + assert.Len(t, reps, 0) + + reps, err = cr.GetCommitReportMatchingSeqNum(context.Background(), rep.Interval.Max, 0) + require.NoError(t, err) + require.Len(t, reps, 1) + assert.Equal(t, reps[0].Interval, rep.Interval) + assert.Equal(t, reps[0].MerkleRoot, rep.MerkleRoot) + assert.Equal(t, reps[0].GasPrices, rep.GasPrices) + assert.Equal(t, reps[0].TokenPrices, rep.TokenPrices) + + reps, err = cr.GetCommitReportMatchingSeqNum(context.Background(), rep.Interval.Min, 0) + require.NoError(t, err) + require.Len(t, reps, 1) + assert.Equal(t, reps[0].Interval, rep.Interval) + assert.Equal(t, reps[0].MerkleRoot, rep.MerkleRoot) + assert.Equal(t, reps[0].GasPrices, rep.GasPrices) + assert.Equal(t, reps[0].TokenPrices, rep.TokenPrices) + + reps, err = cr.GetCommitReportMatchingSeqNum(context.Background(), rep.Interval.Min-1, 0) + require.NoError(t, err) + require.Len(t, reps, 0) + + // Sanity + reps, err = cr.GetAcceptedCommitReportsGteTimestamp(context.Background(), time.Unix(0, 0), 0) + require.NoError(t, err) + require.Len(t, reps, 1) + assert.Equal(t, reps[0].Interval, rep.Interval) + assert.Equal(t, reps[0].MerkleRoot, rep.MerkleRoot) + assert.Equal(t, reps[0].GasPrices, rep.GasPrices) + assert.Equal(t, reps[0].TokenPrices, rep.TokenPrices) + + // Until we detect the config, we'll have empty offchain config + c1, err := cr.OffchainConfig(ctx) + require.NoError(t, err) + assert.Equal(t, c1, cciptypes.CommitOffchainConfig{}) + newPr, err := cr.ChangeConfig(ctx, configs[v][0], configs[v][1]) + require.NoError(t, err) + assert.Equal(t, ccipcalc.EvmAddrToGeneric(prs[v]), newPr) + + c2, err := cr.OffchainConfig(ctx) + require.NoError(t, err) + assert.Equal(t, commonOffchain, c2) + // We should be able to query for gas prices now. + gpe, err := cr.GasPriceEstimator(ctx) + require.NoError(t, err) + gp, err := gpe.GetGasPrice(context.Background()) + require.NoError(t, err) + assert.True(t, gp.Cmp(big.NewInt(0)) > 0) + }) + } +} + +func TestNewCommitStoreReader(t *testing.T) { + var tt = []struct { + typeAndVersion string + expectedErr string + }{ + { + typeAndVersion: "blah", + expectedErr: "unable to read type and version: invalid type and version blah", + }, + { + typeAndVersion: "EVM2EVMOffRamp 1.0.0", + expectedErr: "expected CommitStore got EVM2EVMOffRamp", + }, + { + typeAndVersion: "CommitStore 1.2.0", + expectedErr: "", + }, + { + typeAndVersion: "CommitStore 2.0.0", + expectedErr: "unsupported commit store version 2.0.0", + }, + } + for _, tc := range tt { + t.Run(tc.typeAndVersion, func(t *testing.T) { + b, err := utils.ABIEncode(`[{"type":"string"}]`, tc.typeAndVersion) + require.NoError(t, err) + c := evmclientmocks.NewClient(t) + c.On("CallContract", mock.Anything, mock.Anything, mock.Anything).Return(b, nil) + addr := ccipcalc.EvmAddrToGeneric(utils.RandomAddress()) + lp := lpmocks.NewLogPoller(t) + if tc.expectedErr == "" { + lp.On("RegisterFilter", mock.Anything, mock.Anything).Return(nil) + } + _, err = factory.NewCommitStoreReader(logger.Test(t), factory.NewEvmVersionFinder(), addr, c, lp) + if tc.expectedErr != "" { + require.EqualError(t, err, tc.expectedErr) + } else { + require.NoError(t, err) + } + }) + } +} diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/factory/commit_store.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/factory/commit_store.go new file mode 100644 index 00000000000..6ab9b52fc58 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/factory/commit_store.go @@ -0,0 +1,121 @@ +package factory + +import ( + "github.com/Masterminds/semver/v3" + "github.com/pkg/errors" + + "github.com/smartcontractkit/chainlink-common/pkg/logger" + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/txmgr" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/commit_store" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/commit_store_1_0_0" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/abihelpers" + ccipconfig "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/config" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipcalc" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_0_0" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_5_0" +) + +func NewCommitStoreReader(lggr logger.Logger, versionFinder VersionFinder, address cciptypes.Address, ec client.Client, lp logpoller.LogPoller) (ccipdata.CommitStoreReader, error) { + return initOrCloseCommitStoreReader(lggr, versionFinder, address, ec, lp, false) +} + +func CloseCommitStoreReader(lggr logger.Logger, versionFinder VersionFinder, address cciptypes.Address, ec client.Client, lp logpoller.LogPoller) error { + _, err := initOrCloseCommitStoreReader(lggr, versionFinder, address, ec, lp, true) + return err +} + +func initOrCloseCommitStoreReader(lggr logger.Logger, versionFinder VersionFinder, address cciptypes.Address, ec client.Client, lp logpoller.LogPoller, closeReader bool) (ccipdata.CommitStoreReader, error) { + contractType, version, err := versionFinder.TypeAndVersion(address, ec) + if err != nil { + return nil, errors.Wrapf(err, "unable to read type and version") + } + if contractType != ccipconfig.CommitStore { + return nil, errors.Errorf("expected %v got %v", ccipconfig.CommitStore, contractType) + } + + evmAddr, err := ccipcalc.GenericAddrToEvm(address) + if err != nil { + return nil, err + } + + lggr.Infow("Initializing CommitStore Reader", "version", version.String()) + + switch version.String() { + case ccipdata.V1_0_0, ccipdata.V1_1_0: // Versions are identical + cs, err := v1_0_0.NewCommitStore(lggr, evmAddr, ec, lp) + if err != nil { + return nil, err + } + if closeReader { + return nil, cs.Close() + } + return cs, cs.RegisterFilters() + case ccipdata.V1_2_0: + cs, err := v1_2_0.NewCommitStore(lggr, evmAddr, ec, lp) + if err != nil { + return nil, err + } + if closeReader { + return nil, cs.Close() + } + return cs, cs.RegisterFilters() + case ccipdata.V1_5_0: + cs, err := v1_5_0.NewCommitStore(lggr, evmAddr, ec, lp) + if err != nil { + return nil, err + } + if closeReader { + return nil, cs.Close() + } + return cs, cs.RegisterFilters() + default: + return nil, errors.Errorf("unsupported commit store version %v", version.String()) + } +} + +func CommitReportToEthTxMeta(typ ccipconfig.ContractType, ver semver.Version) (func(report []byte) (*txmgr.TxMeta, error), error) { + if typ != ccipconfig.CommitStore { + return nil, errors.Errorf("expected %v got %v", ccipconfig.CommitStore, typ) + } + switch ver.String() { + case ccipdata.V1_0_0, ccipdata.V1_1_0: + commitStoreABI := abihelpers.MustParseABI(commit_store_1_0_0.CommitStoreABI) + return func(report []byte) (*txmgr.TxMeta, error) { + commitReport, err := v1_0_0.DecodeCommitReport(abihelpers.MustGetEventInputs(v1_0_0.ReportAccepted, commitStoreABI), report) + if err != nil { + return nil, err + } + return commitReportToEthTxMeta(commitReport) + }, nil + case ccipdata.V1_2_0, ccipdata.V1_5_0: + commitStoreABI := abihelpers.MustParseABI(commit_store.CommitStoreABI) + return func(report []byte) (*txmgr.TxMeta, error) { + commitReport, err := v1_2_0.DecodeCommitReport(abihelpers.MustGetEventInputs(v1_0_0.ReportAccepted, commitStoreABI), report) + if err != nil { + return nil, err + } + return commitReportToEthTxMeta(commitReport) + }, nil + default: + return nil, errors.Errorf("got unexpected version %v", ver.String()) + } +} + +// CommitReportToEthTxMeta generates a txmgr.EthTxMeta from the given commit report. +// sequence numbers of the committed messages will be added to tx metadata +func commitReportToEthTxMeta(commitReport cciptypes.CommitStoreReport) (*txmgr.TxMeta, error) { + n := (commitReport.Interval.Max - commitReport.Interval.Min) + 1 + seqRange := make([]uint64, n) + for i := uint64(0); i < n; i++ { + seqRange[i] = i + commitReport.Interval.Min + } + return &txmgr.TxMeta{ + SeqNumbers: seqRange, + }, nil +} diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/factory/commit_store_test.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/factory/commit_store_test.go new file mode 100644 index 00000000000..ae6b9977944 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/factory/commit_store_test.go @@ -0,0 +1,37 @@ +package factory + +import ( + "testing" + + "github.com/Masterminds/semver/v3" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + + "github.com/smartcontractkit/chainlink-common/pkg/logger" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" + mocks2 "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller/mocks" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils" + ccipconfig "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/config" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_0_0" +) + +func TestCommitStore(t *testing.T) { + for _, versionStr := range []string{ccipdata.V1_0_0, ccipdata.V1_2_0} { + lggr := logger.Test(t) + addr := cciptypes.Address(utils.RandomAddress().String()) + lp := mocks2.NewLogPoller(t) + + lp.On("RegisterFilter", mock.Anything, mock.Anything).Return(nil) + versionFinder := newMockVersionFinder(ccipconfig.CommitStore, *semver.MustParse(versionStr), nil) + _, err := NewCommitStoreReader(lggr, versionFinder, addr, nil, lp) + assert.NoError(t, err) + + expFilterName := logpoller.FilterName(v1_0_0.EXEC_REPORT_ACCEPTS, addr) + lp.On("UnregisterFilter", mock.Anything, expFilterName).Return(nil) + err = CloseCommitStoreReader(lggr, versionFinder, addr, nil, lp) + assert.NoError(t, err) + } +} diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/factory/offramp.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/factory/offramp.go new file mode 100644 index 00000000000..3c8d7182d42 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/factory/offramp.go @@ -0,0 +1,125 @@ +package factory + +import ( + "context" + "math/big" + + "github.com/Masterminds/semver/v3" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/pkg/errors" + + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + + "github.com/smartcontractkit/chainlink-common/pkg/logger" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/gas" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/txmgr" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/evm_2_evm_offramp" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/evm_2_evm_offramp_1_0_0" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/abihelpers" + ccipconfig "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/config" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipcalc" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_0_0" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_5_0" +) + +func NewOffRampReader(lggr logger.Logger, versionFinder VersionFinder, addr cciptypes.Address, destClient client.Client, lp logpoller.LogPoller, estimator gas.EvmFeeEstimator, destMaxGasPrice *big.Int, registerFilters bool) (ccipdata.OffRampReader, error) { + return initOrCloseOffRampReader(lggr, versionFinder, addr, destClient, lp, estimator, destMaxGasPrice, false, registerFilters) +} + +func CloseOffRampReader(lggr logger.Logger, versionFinder VersionFinder, addr cciptypes.Address, destClient client.Client, lp logpoller.LogPoller, estimator gas.EvmFeeEstimator, destMaxGasPrice *big.Int) error { + _, err := initOrCloseOffRampReader(lggr, versionFinder, addr, destClient, lp, estimator, destMaxGasPrice, true, false) + return err +} + +func initOrCloseOffRampReader(lggr logger.Logger, versionFinder VersionFinder, addr cciptypes.Address, destClient client.Client, lp logpoller.LogPoller, estimator gas.EvmFeeEstimator, destMaxGasPrice *big.Int, closeReader bool, registerFilters bool) (ccipdata.OffRampReader, error) { + contractType, version, err := versionFinder.TypeAndVersion(addr, destClient) + if err != nil { + return nil, errors.Wrapf(err, "unable to read type and version") + } + if contractType != ccipconfig.EVM2EVMOffRamp { + return nil, errors.Errorf("expected %v got %v", ccipconfig.EVM2EVMOffRamp, contractType) + } + + evmAddr, err := ccipcalc.GenericAddrToEvm(addr) + if err != nil { + return nil, err + } + + lggr.Infow("Initializing OffRamp Reader", "version", version.String(), "destMaxGasPrice", destMaxGasPrice.String()) + + switch version.String() { + case ccipdata.V1_0_0, ccipdata.V1_1_0: + offRamp, err := v1_0_0.NewOffRamp(lggr, evmAddr, destClient, lp, estimator, destMaxGasPrice) + if err != nil { + return nil, err + } + if closeReader { + return nil, offRamp.Close() + } + return offRamp, offRamp.RegisterFilters() + case ccipdata.V1_2_0: + offRamp, err := v1_2_0.NewOffRamp(lggr, evmAddr, destClient, lp, estimator, destMaxGasPrice) + if err != nil { + return nil, err + } + if closeReader { + return nil, offRamp.Close() + } + return offRamp, offRamp.RegisterFilters() + case ccipdata.V1_5_0: + offRamp, err := v1_5_0.NewOffRamp(lggr, evmAddr, destClient, lp, estimator, destMaxGasPrice) + if err != nil { + return nil, err + } + if closeReader { + return nil, offRamp.Close() + } + return offRamp, offRamp.RegisterFilters() + default: + return nil, errors.Errorf("unsupported offramp version %v", version.String()) + } + // TODO can validate it pointing to the correct version +} + +func ExecReportToEthTxMeta(ctx context.Context, typ ccipconfig.ContractType, ver semver.Version) (func(report []byte) (*txmgr.TxMeta, error), error) { + if typ != ccipconfig.EVM2EVMOffRamp { + return nil, errors.Errorf("expected %v got %v", ccipconfig.EVM2EVMOffRamp, typ) + } + switch ver.String() { + case ccipdata.V1_0_0, ccipdata.V1_1_0: + offRampABI := abihelpers.MustParseABI(evm_2_evm_offramp_1_0_0.EVM2EVMOffRampABI) + return func(report []byte) (*txmgr.TxMeta, error) { + execReport, err := v1_0_0.DecodeExecReport(ctx, abihelpers.MustGetMethodInputs(ccipdata.ManuallyExecute, offRampABI)[:1], report) + if err != nil { + return nil, err + } + return execReportToEthTxMeta(execReport) + }, nil + case ccipdata.V1_2_0, ccipdata.V1_5_0: + offRampABI := abihelpers.MustParseABI(evm_2_evm_offramp.EVM2EVMOffRampABI) + return func(report []byte) (*txmgr.TxMeta, error) { + execReport, err := v1_2_0.DecodeExecReport(ctx, abihelpers.MustGetMethodInputs(ccipdata.ManuallyExecute, offRampABI)[:1], report) + if err != nil { + return nil, err + } + return execReportToEthTxMeta(execReport) + }, nil + default: + return nil, errors.Errorf("got unexpected version %v", ver.String()) + } +} + +func execReportToEthTxMeta(execReport cciptypes.ExecReport) (*txmgr.TxMeta, error) { + msgIDs := make([]string, len(execReport.Messages)) + for i, msg := range execReport.Messages { + msgIDs[i] = hexutil.Encode(msg.MessageID[:]) + } + + return &txmgr.TxMeta{ + MessageIDs: msgIDs, + }, nil +} diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/factory/offramp_test.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/factory/offramp_test.go new file mode 100644 index 00000000000..145d00bc134 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/factory/offramp_test.go @@ -0,0 +1,44 @@ +package factory + +import ( + "testing" + + "github.com/Masterminds/semver/v3" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + + "github.com/smartcontractkit/chainlink-common/pkg/logger" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" + mocks2 "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller/mocks" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils" + ccipconfig "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/config" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_0_0" +) + +func TestOffRamp(t *testing.T) { + for _, versionStr := range []string{ccipdata.V1_0_0, ccipdata.V1_2_0} { + lggr := logger.Test(t) + addr := cciptypes.Address(utils.RandomAddress().String()) + lp := mocks2.NewLogPoller(t) + + expFilterNames := []string{ + logpoller.FilterName(v1_0_0.EXEC_EXECUTION_STATE_CHANGES, addr), + logpoller.FilterName(v1_0_0.EXEC_TOKEN_POOL_ADDED, addr), + logpoller.FilterName(v1_0_0.EXEC_TOKEN_POOL_REMOVED, addr), + } + versionFinder := newMockVersionFinder(ccipconfig.EVM2EVMOffRamp, *semver.MustParse(versionStr), nil) + + lp.On("RegisterFilter", mock.Anything, mock.Anything).Return(nil).Times(len(expFilterNames)) + _, err := NewOffRampReader(lggr, versionFinder, addr, nil, lp, nil, nil, true) + assert.NoError(t, err) + + for _, f := range expFilterNames { + lp.On("UnregisterFilter", mock.Anything, f).Return(nil) + } + err = CloseOffRampReader(lggr, versionFinder, addr, nil, lp, nil, nil) + assert.NoError(t, err) + } +} diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/factory/onramp.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/factory/onramp.go new file mode 100644 index 00000000000..682b070491f --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/factory/onramp.go @@ -0,0 +1,89 @@ +package factory + +import ( + "github.com/pkg/errors" + + "github.com/smartcontractkit/chainlink-common/pkg/logger" + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" + + ccipconfig "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/config" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipcalc" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_0_0" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_1_0" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_5_0" +) + +// NewOnRampReader determines the appropriate version of the onramp and returns a reader for it +func NewOnRampReader(lggr logger.Logger, versionFinder VersionFinder, sourceSelector, destSelector uint64, onRampAddress cciptypes.Address, sourceLP logpoller.LogPoller, source client.Client) (ccipdata.OnRampReader, error) { + return initOrCloseOnRampReader(lggr, versionFinder, sourceSelector, destSelector, onRampAddress, sourceLP, source, false) +} + +func CloseOnRampReader(lggr logger.Logger, versionFinder VersionFinder, sourceSelector, destSelector uint64, onRampAddress cciptypes.Address, sourceLP logpoller.LogPoller, source client.Client) error { + _, err := initOrCloseOnRampReader(lggr, versionFinder, sourceSelector, destSelector, onRampAddress, sourceLP, source, true) + return err +} + +func initOrCloseOnRampReader(lggr logger.Logger, versionFinder VersionFinder, sourceSelector, destSelector uint64, onRampAddress cciptypes.Address, sourceLP logpoller.LogPoller, source client.Client, closeReader bool) (ccipdata.OnRampReader, error) { + contractType, version, err := versionFinder.TypeAndVersion(onRampAddress, source) + if err != nil { + return nil, errors.Wrapf(err, "unable to read type and version") + } + if contractType != ccipconfig.EVM2EVMOnRamp { + return nil, errors.Errorf("expected %v got %v", ccipconfig.EVM2EVMOnRamp, contractType) + } + + onRampAddrEvm, err := ccipcalc.GenericAddrToEvm(onRampAddress) + if err != nil { + return nil, err + } + + lggr.Infof("Initializing onRamp for version %v", version.String()) + + switch version.String() { + case ccipdata.V1_0_0: + onRamp, err := v1_0_0.NewOnRamp(lggr, sourceSelector, destSelector, onRampAddrEvm, sourceLP, source) + if err != nil { + return nil, err + } + if closeReader { + return nil, onRamp.Close() + } + return onRamp, onRamp.RegisterFilters() + case ccipdata.V1_1_0: + onRamp, err := v1_1_0.NewOnRamp(lggr, sourceSelector, destSelector, onRampAddrEvm, sourceLP, source) + if err != nil { + return nil, err + } + if closeReader { + return nil, onRamp.Close() + } + return onRamp, onRamp.RegisterFilters() + case ccipdata.V1_2_0: + onRamp, err := v1_2_0.NewOnRamp(lggr, sourceSelector, destSelector, onRampAddrEvm, sourceLP, source) + if err != nil { + return nil, err + } + if closeReader { + return nil, onRamp.Close() + } + return onRamp, onRamp.RegisterFilters() + case ccipdata.V1_5_0: + onRamp, err := v1_5_0.NewOnRamp(lggr, sourceSelector, destSelector, onRampAddrEvm, sourceLP, source) + if err != nil { + return nil, err + } + if closeReader { + return nil, onRamp.Close() + } + return onRamp, onRamp.RegisterFilters() + // Adding a new version? + // Please update the public factory function in leafer.go if the new version updates the leaf hash function. + default: + return nil, errors.Errorf("unsupported onramp version %v", version.String()) + } +} diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/factory/onramp_test.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/factory/onramp_test.go new file mode 100644 index 00000000000..e3013e36298 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/factory/onramp_test.go @@ -0,0 +1,45 @@ +package factory + +import ( + "testing" + + "github.com/Masterminds/semver/v3" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + + "github.com/smartcontractkit/chainlink-common/pkg/logger" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" + mocks2 "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller/mocks" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils" + ccipconfig "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/config" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata" +) + +func TestOnRamp(t *testing.T) { + for _, versionStr := range []string{ccipdata.V1_0_0, ccipdata.V1_1_0, ccipdata.V1_2_0, ccipdata.V1_5_0} { + lggr := logger.Test(t) + addr := cciptypes.Address(utils.RandomAddress().String()) + lp := mocks2.NewLogPoller(t) + + sourceSelector := uint64(1000) + destSelector := uint64(2000) + + expFilterNames := []string{ + logpoller.FilterName(ccipdata.COMMIT_CCIP_SENDS, addr), + logpoller.FilterName(ccipdata.CONFIG_CHANGED, addr), + } + versionFinder := newMockVersionFinder(ccipconfig.EVM2EVMOnRamp, *semver.MustParse(versionStr), nil) + + lp.On("RegisterFilter", mock.Anything, mock.Anything).Return(nil).Times(len(expFilterNames)) + _, err := NewOnRampReader(lggr, versionFinder, sourceSelector, destSelector, addr, lp, nil) + assert.NoError(t, err) + + for _, f := range expFilterNames { + lp.On("UnregisterFilter", mock.Anything, f).Return(nil) + } + err = CloseOnRampReader(lggr, versionFinder, sourceSelector, destSelector, addr, lp, nil) + assert.NoError(t, err) + } +} diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/factory/price_registry.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/factory/price_registry.go new file mode 100644 index 00000000000..7f08b04d486 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/factory/price_registry.go @@ -0,0 +1,82 @@ +package factory + +import ( + "context" + + "github.com/pkg/errors" + + "github.com/smartcontractkit/chainlink-common/pkg/logger" + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" + ccipconfig "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/config" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipcalc" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipcommon" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_0_0" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0" +) + +// NewPriceRegistryReader determines the appropriate version of the price registry and returns a reader for it. +func NewPriceRegistryReader(ctx context.Context, lggr logger.Logger, versionFinder VersionFinder, priceRegistryAddress cciptypes.Address, lp logpoller.LogPoller, cl client.Client) (ccipdata.PriceRegistryReader, error) { + return initOrClosePriceRegistryReader(ctx, lggr, versionFinder, priceRegistryAddress, lp, cl, false) +} + +func ClosePriceRegistryReader(ctx context.Context, lggr logger.Logger, versionFinder VersionFinder, priceRegistryAddress cciptypes.Address, lp logpoller.LogPoller, cl client.Client) error { + _, err := initOrClosePriceRegistryReader(ctx, lggr, versionFinder, priceRegistryAddress, lp, cl, true) + return err +} + +func initOrClosePriceRegistryReader(ctx context.Context, lggr logger.Logger, versionFinder VersionFinder, priceRegistryAddress cciptypes.Address, lp logpoller.LogPoller, cl client.Client, closeReader bool) (ccipdata.PriceRegistryReader, error) { + registerFilters := !closeReader + + priceRegistryEvmAddr, err := ccipcalc.GenericAddrToEvm(priceRegistryAddress) + if err != nil { + return nil, err + } + + contractType, version, err := versionFinder.TypeAndVersion(priceRegistryAddress, cl) + isV1_0_0 := ccipcommon.IsTxRevertError(err) || (contractType == ccipconfig.PriceRegistry && version.String() == ccipdata.V1_0_0) + if isV1_0_0 { + lggr.Infof("Assuming %v is 1.0.0 price registry, got %v", priceRegistryEvmAddr, err) + // Unfortunately the v1 price registry doesn't have a method to get the version so assume if it reverts its v1. + pr, err2 := v1_0_0.NewPriceRegistry(lggr, priceRegistryEvmAddr, lp, cl, registerFilters) + if err2 != nil { + return nil, err2 + } + if closeReader { + return nil, pr.Close() + } + return pr, nil + } + if err != nil { + return nil, errors.Wrapf(err, "unable to read type and version") + } + + if contractType != ccipconfig.PriceRegistry { + return nil, errors.Errorf("expected %v got %v", ccipconfig.PriceRegistry, contractType) + } + switch version.String() { + case ccipdata.V1_2_0: + pr, err := v1_2_0.NewPriceRegistry(lggr, priceRegistryEvmAddr, lp, cl, registerFilters) + if err != nil { + return nil, err + } + if closeReader { + return nil, pr.Close() + } + return pr, nil + case ccipdata.V1_6_0: + pr, err := v1_2_0.NewPriceRegistry(lggr, priceRegistryEvmAddr, lp, cl, registerFilters) + if err != nil { + return nil, err + } + if closeReader { + return nil, pr.Close() + } + return pr, nil + default: + return nil, errors.Errorf("unsupported price registry version %v", version.String()) + } +} diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/factory/price_registry_test.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/factory/price_registry_test.go new file mode 100644 index 00000000000..f388c5cb9a3 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/factory/price_registry_test.go @@ -0,0 +1,46 @@ +package factory + +import ( + "testing" + + "github.com/Masterminds/semver/v3" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + + "github.com/smartcontractkit/chainlink-common/pkg/logger" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" + mocks2 "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller/mocks" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" + ccipconfig "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/config" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata" +) + +func TestPriceRegistry(t *testing.T) { + ctx := testutils.Context(t) + + for _, versionStr := range []string{ccipdata.V1_0_0, ccipdata.V1_2_0} { + lggr := logger.Test(t) + addr := cciptypes.Address(utils.RandomAddress().String()) + lp := mocks2.NewLogPoller(t) + + expFilterNames := []string{ + logpoller.FilterName(ccipdata.COMMIT_PRICE_UPDATES, addr), + logpoller.FilterName(ccipdata.FEE_TOKEN_ADDED, addr), + logpoller.FilterName(ccipdata.FEE_TOKEN_REMOVED, addr), + } + versionFinder := newMockVersionFinder(ccipconfig.PriceRegistry, *semver.MustParse(versionStr), nil) + + lp.On("RegisterFilter", mock.Anything, mock.Anything).Return(nil).Times(len(expFilterNames)) + _, err := NewPriceRegistryReader(ctx, lggr, versionFinder, addr, lp, nil) + assert.NoError(t, err) + + for _, f := range expFilterNames { + lp.On("UnregisterFilter", mock.Anything, f).Return(nil) + } + err = ClosePriceRegistryReader(ctx, lggr, versionFinder, addr, lp, nil) + assert.NoError(t, err) + } +} diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/factory/versionfinder.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/factory/versionfinder.go new file mode 100644 index 00000000000..ac16fc4df2f --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/factory/versionfinder.go @@ -0,0 +1,44 @@ +package factory + +import ( + "github.com/Masterminds/semver/v3" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/config" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipcalc" +) + +// VersionFinder accepts a contract address and a client and performs an on-chain call to +// determine the contract type. +type VersionFinder interface { + TypeAndVersion(addr cciptypes.Address, client bind.ContractBackend) (config.ContractType, semver.Version, error) +} + +type EvmVersionFinder struct{} + +func NewEvmVersionFinder() EvmVersionFinder { + return EvmVersionFinder{} +} + +func (e EvmVersionFinder) TypeAndVersion(addr cciptypes.Address, client bind.ContractBackend) (config.ContractType, semver.Version, error) { + evmAddr, err := ccipcalc.GenericAddrToEvm(addr) + if err != nil { + return "", semver.Version{}, err + } + return config.TypeAndVersion(evmAddr, client) +} + +type mockVersionFinder struct { + typ config.ContractType + version semver.Version + err error +} + +func newMockVersionFinder(typ config.ContractType, version semver.Version, err error) *mockVersionFinder { + return &mockVersionFinder{typ: typ, version: version, err: err} +} + +func (m mockVersionFinder) TypeAndVersion(addr cciptypes.Address, client bind.ContractBackend) (config.ContractType, semver.Version, error) { + return m.typ, m.version, m.err +} diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/mocks/commit_store_reader_mock.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/mocks/commit_store_reader_mock.go new file mode 100644 index 00000000000..f383a87a8a9 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/mocks/commit_store_reader_mock.go @@ -0,0 +1,985 @@ +// Code generated by mockery v2.43.2. DO NOT EDIT. + +package mocks + +import ( + big "math/big" + + ccip "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + + context "context" + + gas "github.com/smartcontractkit/chainlink/v2/core/chains/evm/gas" + + mock "github.com/stretchr/testify/mock" + + time "time" +) + +// CommitStoreReader is an autogenerated mock type for the CommitStoreReader type +type CommitStoreReader struct { + mock.Mock +} + +type CommitStoreReader_Expecter struct { + mock *mock.Mock +} + +func (_m *CommitStoreReader) EXPECT() *CommitStoreReader_Expecter { + return &CommitStoreReader_Expecter{mock: &_m.Mock} +} + +// ChangeConfig provides a mock function with given fields: ctx, onchainConfig, offchainConfig +func (_m *CommitStoreReader) ChangeConfig(ctx context.Context, onchainConfig []byte, offchainConfig []byte) (ccip.Address, error) { + ret := _m.Called(ctx, onchainConfig, offchainConfig) + + if len(ret) == 0 { + panic("no return value specified for ChangeConfig") + } + + var r0 ccip.Address + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, []byte, []byte) (ccip.Address, error)); ok { + return rf(ctx, onchainConfig, offchainConfig) + } + if rf, ok := ret.Get(0).(func(context.Context, []byte, []byte) ccip.Address); ok { + r0 = rf(ctx, onchainConfig, offchainConfig) + } else { + r0 = ret.Get(0).(ccip.Address) + } + + if rf, ok := ret.Get(1).(func(context.Context, []byte, []byte) error); ok { + r1 = rf(ctx, onchainConfig, offchainConfig) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// CommitStoreReader_ChangeConfig_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ChangeConfig' +type CommitStoreReader_ChangeConfig_Call struct { + *mock.Call +} + +// ChangeConfig is a helper method to define mock.On call +// - ctx context.Context +// - onchainConfig []byte +// - offchainConfig []byte +func (_e *CommitStoreReader_Expecter) ChangeConfig(ctx interface{}, onchainConfig interface{}, offchainConfig interface{}) *CommitStoreReader_ChangeConfig_Call { + return &CommitStoreReader_ChangeConfig_Call{Call: _e.mock.On("ChangeConfig", ctx, onchainConfig, offchainConfig)} +} + +func (_c *CommitStoreReader_ChangeConfig_Call) Run(run func(ctx context.Context, onchainConfig []byte, offchainConfig []byte)) *CommitStoreReader_ChangeConfig_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].([]byte), args[2].([]byte)) + }) + return _c +} + +func (_c *CommitStoreReader_ChangeConfig_Call) Return(_a0 ccip.Address, _a1 error) *CommitStoreReader_ChangeConfig_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *CommitStoreReader_ChangeConfig_Call) RunAndReturn(run func(context.Context, []byte, []byte) (ccip.Address, error)) *CommitStoreReader_ChangeConfig_Call { + _c.Call.Return(run) + return _c +} + +// Close provides a mock function with given fields: +func (_m *CommitStoreReader) Close() error { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Close") + } + + var r0 error + if rf, ok := ret.Get(0).(func() error); ok { + r0 = rf() + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// CommitStoreReader_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close' +type CommitStoreReader_Close_Call struct { + *mock.Call +} + +// Close is a helper method to define mock.On call +func (_e *CommitStoreReader_Expecter) Close() *CommitStoreReader_Close_Call { + return &CommitStoreReader_Close_Call{Call: _e.mock.On("Close")} +} + +func (_c *CommitStoreReader_Close_Call) Run(run func()) *CommitStoreReader_Close_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *CommitStoreReader_Close_Call) Return(_a0 error) *CommitStoreReader_Close_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *CommitStoreReader_Close_Call) RunAndReturn(run func() error) *CommitStoreReader_Close_Call { + _c.Call.Return(run) + return _c +} + +// DecodeCommitReport provides a mock function with given fields: ctx, report +func (_m *CommitStoreReader) DecodeCommitReport(ctx context.Context, report []byte) (ccip.CommitStoreReport, error) { + ret := _m.Called(ctx, report) + + if len(ret) == 0 { + panic("no return value specified for DecodeCommitReport") + } + + var r0 ccip.CommitStoreReport + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, []byte) (ccip.CommitStoreReport, error)); ok { + return rf(ctx, report) + } + if rf, ok := ret.Get(0).(func(context.Context, []byte) ccip.CommitStoreReport); ok { + r0 = rf(ctx, report) + } else { + r0 = ret.Get(0).(ccip.CommitStoreReport) + } + + if rf, ok := ret.Get(1).(func(context.Context, []byte) error); ok { + r1 = rf(ctx, report) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// CommitStoreReader_DecodeCommitReport_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DecodeCommitReport' +type CommitStoreReader_DecodeCommitReport_Call struct { + *mock.Call +} + +// DecodeCommitReport is a helper method to define mock.On call +// - ctx context.Context +// - report []byte +func (_e *CommitStoreReader_Expecter) DecodeCommitReport(ctx interface{}, report interface{}) *CommitStoreReader_DecodeCommitReport_Call { + return &CommitStoreReader_DecodeCommitReport_Call{Call: _e.mock.On("DecodeCommitReport", ctx, report)} +} + +func (_c *CommitStoreReader_DecodeCommitReport_Call) Run(run func(ctx context.Context, report []byte)) *CommitStoreReader_DecodeCommitReport_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].([]byte)) + }) + return _c +} + +func (_c *CommitStoreReader_DecodeCommitReport_Call) Return(_a0 ccip.CommitStoreReport, _a1 error) *CommitStoreReader_DecodeCommitReport_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *CommitStoreReader_DecodeCommitReport_Call) RunAndReturn(run func(context.Context, []byte) (ccip.CommitStoreReport, error)) *CommitStoreReader_DecodeCommitReport_Call { + _c.Call.Return(run) + return _c +} + +// EncodeCommitReport provides a mock function with given fields: ctx, report +func (_m *CommitStoreReader) EncodeCommitReport(ctx context.Context, report ccip.CommitStoreReport) ([]byte, error) { + ret := _m.Called(ctx, report) + + if len(ret) == 0 { + panic("no return value specified for EncodeCommitReport") + } + + var r0 []byte + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, ccip.CommitStoreReport) ([]byte, error)); ok { + return rf(ctx, report) + } + if rf, ok := ret.Get(0).(func(context.Context, ccip.CommitStoreReport) []byte); ok { + r0 = rf(ctx, report) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]byte) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, ccip.CommitStoreReport) error); ok { + r1 = rf(ctx, report) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// CommitStoreReader_EncodeCommitReport_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EncodeCommitReport' +type CommitStoreReader_EncodeCommitReport_Call struct { + *mock.Call +} + +// EncodeCommitReport is a helper method to define mock.On call +// - ctx context.Context +// - report ccip.CommitStoreReport +func (_e *CommitStoreReader_Expecter) EncodeCommitReport(ctx interface{}, report interface{}) *CommitStoreReader_EncodeCommitReport_Call { + return &CommitStoreReader_EncodeCommitReport_Call{Call: _e.mock.On("EncodeCommitReport", ctx, report)} +} + +func (_c *CommitStoreReader_EncodeCommitReport_Call) Run(run func(ctx context.Context, report ccip.CommitStoreReport)) *CommitStoreReader_EncodeCommitReport_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(ccip.CommitStoreReport)) + }) + return _c +} + +func (_c *CommitStoreReader_EncodeCommitReport_Call) Return(_a0 []byte, _a1 error) *CommitStoreReader_EncodeCommitReport_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *CommitStoreReader_EncodeCommitReport_Call) RunAndReturn(run func(context.Context, ccip.CommitStoreReport) ([]byte, error)) *CommitStoreReader_EncodeCommitReport_Call { + _c.Call.Return(run) + return _c +} + +// GasPriceEstimator provides a mock function with given fields: ctx +func (_m *CommitStoreReader) GasPriceEstimator(ctx context.Context) (ccip.GasPriceEstimatorCommit, error) { + ret := _m.Called(ctx) + + if len(ret) == 0 { + panic("no return value specified for GasPriceEstimator") + } + + var r0 ccip.GasPriceEstimatorCommit + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (ccip.GasPriceEstimatorCommit, error)); ok { + return rf(ctx) + } + if rf, ok := ret.Get(0).(func(context.Context) ccip.GasPriceEstimatorCommit); ok { + r0 = rf(ctx) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(ccip.GasPriceEstimatorCommit) + } + } + + if rf, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = rf(ctx) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// CommitStoreReader_GasPriceEstimator_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GasPriceEstimator' +type CommitStoreReader_GasPriceEstimator_Call struct { + *mock.Call +} + +// GasPriceEstimator is a helper method to define mock.On call +// - ctx context.Context +func (_e *CommitStoreReader_Expecter) GasPriceEstimator(ctx interface{}) *CommitStoreReader_GasPriceEstimator_Call { + return &CommitStoreReader_GasPriceEstimator_Call{Call: _e.mock.On("GasPriceEstimator", ctx)} +} + +func (_c *CommitStoreReader_GasPriceEstimator_Call) Run(run func(ctx context.Context)) *CommitStoreReader_GasPriceEstimator_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *CommitStoreReader_GasPriceEstimator_Call) Return(_a0 ccip.GasPriceEstimatorCommit, _a1 error) *CommitStoreReader_GasPriceEstimator_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *CommitStoreReader_GasPriceEstimator_Call) RunAndReturn(run func(context.Context) (ccip.GasPriceEstimatorCommit, error)) *CommitStoreReader_GasPriceEstimator_Call { + _c.Call.Return(run) + return _c +} + +// GetAcceptedCommitReportsGteTimestamp provides a mock function with given fields: ctx, ts, confirmations +func (_m *CommitStoreReader) GetAcceptedCommitReportsGteTimestamp(ctx context.Context, ts time.Time, confirmations int) ([]ccip.CommitStoreReportWithTxMeta, error) { + ret := _m.Called(ctx, ts, confirmations) + + if len(ret) == 0 { + panic("no return value specified for GetAcceptedCommitReportsGteTimestamp") + } + + var r0 []ccip.CommitStoreReportWithTxMeta + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, time.Time, int) ([]ccip.CommitStoreReportWithTxMeta, error)); ok { + return rf(ctx, ts, confirmations) + } + if rf, ok := ret.Get(0).(func(context.Context, time.Time, int) []ccip.CommitStoreReportWithTxMeta); ok { + r0 = rf(ctx, ts, confirmations) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]ccip.CommitStoreReportWithTxMeta) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, time.Time, int) error); ok { + r1 = rf(ctx, ts, confirmations) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// CommitStoreReader_GetAcceptedCommitReportsGteTimestamp_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAcceptedCommitReportsGteTimestamp' +type CommitStoreReader_GetAcceptedCommitReportsGteTimestamp_Call struct { + *mock.Call +} + +// GetAcceptedCommitReportsGteTimestamp is a helper method to define mock.On call +// - ctx context.Context +// - ts time.Time +// - confirmations int +func (_e *CommitStoreReader_Expecter) GetAcceptedCommitReportsGteTimestamp(ctx interface{}, ts interface{}, confirmations interface{}) *CommitStoreReader_GetAcceptedCommitReportsGteTimestamp_Call { + return &CommitStoreReader_GetAcceptedCommitReportsGteTimestamp_Call{Call: _e.mock.On("GetAcceptedCommitReportsGteTimestamp", ctx, ts, confirmations)} +} + +func (_c *CommitStoreReader_GetAcceptedCommitReportsGteTimestamp_Call) Run(run func(ctx context.Context, ts time.Time, confirmations int)) *CommitStoreReader_GetAcceptedCommitReportsGteTimestamp_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(time.Time), args[2].(int)) + }) + return _c +} + +func (_c *CommitStoreReader_GetAcceptedCommitReportsGteTimestamp_Call) Return(_a0 []ccip.CommitStoreReportWithTxMeta, _a1 error) *CommitStoreReader_GetAcceptedCommitReportsGteTimestamp_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *CommitStoreReader_GetAcceptedCommitReportsGteTimestamp_Call) RunAndReturn(run func(context.Context, time.Time, int) ([]ccip.CommitStoreReportWithTxMeta, error)) *CommitStoreReader_GetAcceptedCommitReportsGteTimestamp_Call { + _c.Call.Return(run) + return _c +} + +// GetCommitReportMatchingSeqNum provides a mock function with given fields: ctx, seqNum, confirmations +func (_m *CommitStoreReader) GetCommitReportMatchingSeqNum(ctx context.Context, seqNum uint64, confirmations int) ([]ccip.CommitStoreReportWithTxMeta, error) { + ret := _m.Called(ctx, seqNum, confirmations) + + if len(ret) == 0 { + panic("no return value specified for GetCommitReportMatchingSeqNum") + } + + var r0 []ccip.CommitStoreReportWithTxMeta + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, uint64, int) ([]ccip.CommitStoreReportWithTxMeta, error)); ok { + return rf(ctx, seqNum, confirmations) + } + if rf, ok := ret.Get(0).(func(context.Context, uint64, int) []ccip.CommitStoreReportWithTxMeta); ok { + r0 = rf(ctx, seqNum, confirmations) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]ccip.CommitStoreReportWithTxMeta) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, uint64, int) error); ok { + r1 = rf(ctx, seqNum, confirmations) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// CommitStoreReader_GetCommitReportMatchingSeqNum_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetCommitReportMatchingSeqNum' +type CommitStoreReader_GetCommitReportMatchingSeqNum_Call struct { + *mock.Call +} + +// GetCommitReportMatchingSeqNum is a helper method to define mock.On call +// - ctx context.Context +// - seqNum uint64 +// - confirmations int +func (_e *CommitStoreReader_Expecter) GetCommitReportMatchingSeqNum(ctx interface{}, seqNum interface{}, confirmations interface{}) *CommitStoreReader_GetCommitReportMatchingSeqNum_Call { + return &CommitStoreReader_GetCommitReportMatchingSeqNum_Call{Call: _e.mock.On("GetCommitReportMatchingSeqNum", ctx, seqNum, confirmations)} +} + +func (_c *CommitStoreReader_GetCommitReportMatchingSeqNum_Call) Run(run func(ctx context.Context, seqNum uint64, confirmations int)) *CommitStoreReader_GetCommitReportMatchingSeqNum_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(uint64), args[2].(int)) + }) + return _c +} + +func (_c *CommitStoreReader_GetCommitReportMatchingSeqNum_Call) Return(_a0 []ccip.CommitStoreReportWithTxMeta, _a1 error) *CommitStoreReader_GetCommitReportMatchingSeqNum_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *CommitStoreReader_GetCommitReportMatchingSeqNum_Call) RunAndReturn(run func(context.Context, uint64, int) ([]ccip.CommitStoreReportWithTxMeta, error)) *CommitStoreReader_GetCommitReportMatchingSeqNum_Call { + _c.Call.Return(run) + return _c +} + +// GetCommitStoreStaticConfig provides a mock function with given fields: ctx +func (_m *CommitStoreReader) GetCommitStoreStaticConfig(ctx context.Context) (ccip.CommitStoreStaticConfig, error) { + ret := _m.Called(ctx) + + if len(ret) == 0 { + panic("no return value specified for GetCommitStoreStaticConfig") + } + + var r0 ccip.CommitStoreStaticConfig + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (ccip.CommitStoreStaticConfig, error)); ok { + return rf(ctx) + } + if rf, ok := ret.Get(0).(func(context.Context) ccip.CommitStoreStaticConfig); ok { + r0 = rf(ctx) + } else { + r0 = ret.Get(0).(ccip.CommitStoreStaticConfig) + } + + if rf, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = rf(ctx) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// CommitStoreReader_GetCommitStoreStaticConfig_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetCommitStoreStaticConfig' +type CommitStoreReader_GetCommitStoreStaticConfig_Call struct { + *mock.Call +} + +// GetCommitStoreStaticConfig is a helper method to define mock.On call +// - ctx context.Context +func (_e *CommitStoreReader_Expecter) GetCommitStoreStaticConfig(ctx interface{}) *CommitStoreReader_GetCommitStoreStaticConfig_Call { + return &CommitStoreReader_GetCommitStoreStaticConfig_Call{Call: _e.mock.On("GetCommitStoreStaticConfig", ctx)} +} + +func (_c *CommitStoreReader_GetCommitStoreStaticConfig_Call) Run(run func(ctx context.Context)) *CommitStoreReader_GetCommitStoreStaticConfig_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *CommitStoreReader_GetCommitStoreStaticConfig_Call) Return(_a0 ccip.CommitStoreStaticConfig, _a1 error) *CommitStoreReader_GetCommitStoreStaticConfig_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *CommitStoreReader_GetCommitStoreStaticConfig_Call) RunAndReturn(run func(context.Context) (ccip.CommitStoreStaticConfig, error)) *CommitStoreReader_GetCommitStoreStaticConfig_Call { + _c.Call.Return(run) + return _c +} + +// GetExpectedNextSequenceNumber provides a mock function with given fields: ctx +func (_m *CommitStoreReader) GetExpectedNextSequenceNumber(ctx context.Context) (uint64, error) { + ret := _m.Called(ctx) + + if len(ret) == 0 { + panic("no return value specified for GetExpectedNextSequenceNumber") + } + + var r0 uint64 + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (uint64, error)); ok { + return rf(ctx) + } + if rf, ok := ret.Get(0).(func(context.Context) uint64); ok { + r0 = rf(ctx) + } else { + r0 = ret.Get(0).(uint64) + } + + if rf, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = rf(ctx) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// CommitStoreReader_GetExpectedNextSequenceNumber_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetExpectedNextSequenceNumber' +type CommitStoreReader_GetExpectedNextSequenceNumber_Call struct { + *mock.Call +} + +// GetExpectedNextSequenceNumber is a helper method to define mock.On call +// - ctx context.Context +func (_e *CommitStoreReader_Expecter) GetExpectedNextSequenceNumber(ctx interface{}) *CommitStoreReader_GetExpectedNextSequenceNumber_Call { + return &CommitStoreReader_GetExpectedNextSequenceNumber_Call{Call: _e.mock.On("GetExpectedNextSequenceNumber", ctx)} +} + +func (_c *CommitStoreReader_GetExpectedNextSequenceNumber_Call) Run(run func(ctx context.Context)) *CommitStoreReader_GetExpectedNextSequenceNumber_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *CommitStoreReader_GetExpectedNextSequenceNumber_Call) Return(_a0 uint64, _a1 error) *CommitStoreReader_GetExpectedNextSequenceNumber_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *CommitStoreReader_GetExpectedNextSequenceNumber_Call) RunAndReturn(run func(context.Context) (uint64, error)) *CommitStoreReader_GetExpectedNextSequenceNumber_Call { + _c.Call.Return(run) + return _c +} + +// GetLatestPriceEpochAndRound provides a mock function with given fields: ctx +func (_m *CommitStoreReader) GetLatestPriceEpochAndRound(ctx context.Context) (uint64, error) { + ret := _m.Called(ctx) + + if len(ret) == 0 { + panic("no return value specified for GetLatestPriceEpochAndRound") + } + + var r0 uint64 + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (uint64, error)); ok { + return rf(ctx) + } + if rf, ok := ret.Get(0).(func(context.Context) uint64); ok { + r0 = rf(ctx) + } else { + r0 = ret.Get(0).(uint64) + } + + if rf, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = rf(ctx) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// CommitStoreReader_GetLatestPriceEpochAndRound_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetLatestPriceEpochAndRound' +type CommitStoreReader_GetLatestPriceEpochAndRound_Call struct { + *mock.Call +} + +// GetLatestPriceEpochAndRound is a helper method to define mock.On call +// - ctx context.Context +func (_e *CommitStoreReader_Expecter) GetLatestPriceEpochAndRound(ctx interface{}) *CommitStoreReader_GetLatestPriceEpochAndRound_Call { + return &CommitStoreReader_GetLatestPriceEpochAndRound_Call{Call: _e.mock.On("GetLatestPriceEpochAndRound", ctx)} +} + +func (_c *CommitStoreReader_GetLatestPriceEpochAndRound_Call) Run(run func(ctx context.Context)) *CommitStoreReader_GetLatestPriceEpochAndRound_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *CommitStoreReader_GetLatestPriceEpochAndRound_Call) Return(_a0 uint64, _a1 error) *CommitStoreReader_GetLatestPriceEpochAndRound_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *CommitStoreReader_GetLatestPriceEpochAndRound_Call) RunAndReturn(run func(context.Context) (uint64, error)) *CommitStoreReader_GetLatestPriceEpochAndRound_Call { + _c.Call.Return(run) + return _c +} + +// IsBlessed provides a mock function with given fields: ctx, root +func (_m *CommitStoreReader) IsBlessed(ctx context.Context, root [32]byte) (bool, error) { + ret := _m.Called(ctx, root) + + if len(ret) == 0 { + panic("no return value specified for IsBlessed") + } + + var r0 bool + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, [32]byte) (bool, error)); ok { + return rf(ctx, root) + } + if rf, ok := ret.Get(0).(func(context.Context, [32]byte) bool); ok { + r0 = rf(ctx, root) + } else { + r0 = ret.Get(0).(bool) + } + + if rf, ok := ret.Get(1).(func(context.Context, [32]byte) error); ok { + r1 = rf(ctx, root) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// CommitStoreReader_IsBlessed_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsBlessed' +type CommitStoreReader_IsBlessed_Call struct { + *mock.Call +} + +// IsBlessed is a helper method to define mock.On call +// - ctx context.Context +// - root [32]byte +func (_e *CommitStoreReader_Expecter) IsBlessed(ctx interface{}, root interface{}) *CommitStoreReader_IsBlessed_Call { + return &CommitStoreReader_IsBlessed_Call{Call: _e.mock.On("IsBlessed", ctx, root)} +} + +func (_c *CommitStoreReader_IsBlessed_Call) Run(run func(ctx context.Context, root [32]byte)) *CommitStoreReader_IsBlessed_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].([32]byte)) + }) + return _c +} + +func (_c *CommitStoreReader_IsBlessed_Call) Return(_a0 bool, _a1 error) *CommitStoreReader_IsBlessed_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *CommitStoreReader_IsBlessed_Call) RunAndReturn(run func(context.Context, [32]byte) (bool, error)) *CommitStoreReader_IsBlessed_Call { + _c.Call.Return(run) + return _c +} + +// IsDestChainHealthy provides a mock function with given fields: ctx +func (_m *CommitStoreReader) IsDestChainHealthy(ctx context.Context) (bool, error) { + ret := _m.Called(ctx) + + if len(ret) == 0 { + panic("no return value specified for IsDestChainHealthy") + } + + var r0 bool + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (bool, error)); ok { + return rf(ctx) + } + if rf, ok := ret.Get(0).(func(context.Context) bool); ok { + r0 = rf(ctx) + } else { + r0 = ret.Get(0).(bool) + } + + if rf, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = rf(ctx) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// CommitStoreReader_IsDestChainHealthy_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsDestChainHealthy' +type CommitStoreReader_IsDestChainHealthy_Call struct { + *mock.Call +} + +// IsDestChainHealthy is a helper method to define mock.On call +// - ctx context.Context +func (_e *CommitStoreReader_Expecter) IsDestChainHealthy(ctx interface{}) *CommitStoreReader_IsDestChainHealthy_Call { + return &CommitStoreReader_IsDestChainHealthy_Call{Call: _e.mock.On("IsDestChainHealthy", ctx)} +} + +func (_c *CommitStoreReader_IsDestChainHealthy_Call) Run(run func(ctx context.Context)) *CommitStoreReader_IsDestChainHealthy_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *CommitStoreReader_IsDestChainHealthy_Call) Return(_a0 bool, _a1 error) *CommitStoreReader_IsDestChainHealthy_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *CommitStoreReader_IsDestChainHealthy_Call) RunAndReturn(run func(context.Context) (bool, error)) *CommitStoreReader_IsDestChainHealthy_Call { + _c.Call.Return(run) + return _c +} + +// IsDown provides a mock function with given fields: ctx +func (_m *CommitStoreReader) IsDown(ctx context.Context) (bool, error) { + ret := _m.Called(ctx) + + if len(ret) == 0 { + panic("no return value specified for IsDown") + } + + var r0 bool + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (bool, error)); ok { + return rf(ctx) + } + if rf, ok := ret.Get(0).(func(context.Context) bool); ok { + r0 = rf(ctx) + } else { + r0 = ret.Get(0).(bool) + } + + if rf, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = rf(ctx) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// CommitStoreReader_IsDown_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsDown' +type CommitStoreReader_IsDown_Call struct { + *mock.Call +} + +// IsDown is a helper method to define mock.On call +// - ctx context.Context +func (_e *CommitStoreReader_Expecter) IsDown(ctx interface{}) *CommitStoreReader_IsDown_Call { + return &CommitStoreReader_IsDown_Call{Call: _e.mock.On("IsDown", ctx)} +} + +func (_c *CommitStoreReader_IsDown_Call) Run(run func(ctx context.Context)) *CommitStoreReader_IsDown_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *CommitStoreReader_IsDown_Call) Return(_a0 bool, _a1 error) *CommitStoreReader_IsDown_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *CommitStoreReader_IsDown_Call) RunAndReturn(run func(context.Context) (bool, error)) *CommitStoreReader_IsDown_Call { + _c.Call.Return(run) + return _c +} + +// OffchainConfig provides a mock function with given fields: ctx +func (_m *CommitStoreReader) OffchainConfig(ctx context.Context) (ccip.CommitOffchainConfig, error) { + ret := _m.Called(ctx) + + if len(ret) == 0 { + panic("no return value specified for OffchainConfig") + } + + var r0 ccip.CommitOffchainConfig + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (ccip.CommitOffchainConfig, error)); ok { + return rf(ctx) + } + if rf, ok := ret.Get(0).(func(context.Context) ccip.CommitOffchainConfig); ok { + r0 = rf(ctx) + } else { + r0 = ret.Get(0).(ccip.CommitOffchainConfig) + } + + if rf, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = rf(ctx) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// CommitStoreReader_OffchainConfig_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OffchainConfig' +type CommitStoreReader_OffchainConfig_Call struct { + *mock.Call +} + +// OffchainConfig is a helper method to define mock.On call +// - ctx context.Context +func (_e *CommitStoreReader_Expecter) OffchainConfig(ctx interface{}) *CommitStoreReader_OffchainConfig_Call { + return &CommitStoreReader_OffchainConfig_Call{Call: _e.mock.On("OffchainConfig", ctx)} +} + +func (_c *CommitStoreReader_OffchainConfig_Call) Run(run func(ctx context.Context)) *CommitStoreReader_OffchainConfig_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *CommitStoreReader_OffchainConfig_Call) Return(_a0 ccip.CommitOffchainConfig, _a1 error) *CommitStoreReader_OffchainConfig_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *CommitStoreReader_OffchainConfig_Call) RunAndReturn(run func(context.Context) (ccip.CommitOffchainConfig, error)) *CommitStoreReader_OffchainConfig_Call { + _c.Call.Return(run) + return _c +} + +// SetGasEstimator provides a mock function with given fields: ctx, gpe +func (_m *CommitStoreReader) SetGasEstimator(ctx context.Context, gpe gas.EvmFeeEstimator) error { + ret := _m.Called(ctx, gpe) + + if len(ret) == 0 { + panic("no return value specified for SetGasEstimator") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, gas.EvmFeeEstimator) error); ok { + r0 = rf(ctx, gpe) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// CommitStoreReader_SetGasEstimator_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetGasEstimator' +type CommitStoreReader_SetGasEstimator_Call struct { + *mock.Call +} + +// SetGasEstimator is a helper method to define mock.On call +// - ctx context.Context +// - gpe gas.EvmFeeEstimator +func (_e *CommitStoreReader_Expecter) SetGasEstimator(ctx interface{}, gpe interface{}) *CommitStoreReader_SetGasEstimator_Call { + return &CommitStoreReader_SetGasEstimator_Call{Call: _e.mock.On("SetGasEstimator", ctx, gpe)} +} + +func (_c *CommitStoreReader_SetGasEstimator_Call) Run(run func(ctx context.Context, gpe gas.EvmFeeEstimator)) *CommitStoreReader_SetGasEstimator_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(gas.EvmFeeEstimator)) + }) + return _c +} + +func (_c *CommitStoreReader_SetGasEstimator_Call) Return(_a0 error) *CommitStoreReader_SetGasEstimator_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *CommitStoreReader_SetGasEstimator_Call) RunAndReturn(run func(context.Context, gas.EvmFeeEstimator) error) *CommitStoreReader_SetGasEstimator_Call { + _c.Call.Return(run) + return _c +} + +// SetSourceMaxGasPrice provides a mock function with given fields: ctx, sourceMaxGasPrice +func (_m *CommitStoreReader) SetSourceMaxGasPrice(ctx context.Context, sourceMaxGasPrice *big.Int) error { + ret := _m.Called(ctx, sourceMaxGasPrice) + + if len(ret) == 0 { + panic("no return value specified for SetSourceMaxGasPrice") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, *big.Int) error); ok { + r0 = rf(ctx, sourceMaxGasPrice) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// CommitStoreReader_SetSourceMaxGasPrice_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetSourceMaxGasPrice' +type CommitStoreReader_SetSourceMaxGasPrice_Call struct { + *mock.Call +} + +// SetSourceMaxGasPrice is a helper method to define mock.On call +// - ctx context.Context +// - sourceMaxGasPrice *big.Int +func (_e *CommitStoreReader_Expecter) SetSourceMaxGasPrice(ctx interface{}, sourceMaxGasPrice interface{}) *CommitStoreReader_SetSourceMaxGasPrice_Call { + return &CommitStoreReader_SetSourceMaxGasPrice_Call{Call: _e.mock.On("SetSourceMaxGasPrice", ctx, sourceMaxGasPrice)} +} + +func (_c *CommitStoreReader_SetSourceMaxGasPrice_Call) Run(run func(ctx context.Context, sourceMaxGasPrice *big.Int)) *CommitStoreReader_SetSourceMaxGasPrice_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*big.Int)) + }) + return _c +} + +func (_c *CommitStoreReader_SetSourceMaxGasPrice_Call) Return(_a0 error) *CommitStoreReader_SetSourceMaxGasPrice_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *CommitStoreReader_SetSourceMaxGasPrice_Call) RunAndReturn(run func(context.Context, *big.Int) error) *CommitStoreReader_SetSourceMaxGasPrice_Call { + _c.Call.Return(run) + return _c +} + +// VerifyExecutionReport provides a mock function with given fields: ctx, report +func (_m *CommitStoreReader) VerifyExecutionReport(ctx context.Context, report ccip.ExecReport) (bool, error) { + ret := _m.Called(ctx, report) + + if len(ret) == 0 { + panic("no return value specified for VerifyExecutionReport") + } + + var r0 bool + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, ccip.ExecReport) (bool, error)); ok { + return rf(ctx, report) + } + if rf, ok := ret.Get(0).(func(context.Context, ccip.ExecReport) bool); ok { + r0 = rf(ctx, report) + } else { + r0 = ret.Get(0).(bool) + } + + if rf, ok := ret.Get(1).(func(context.Context, ccip.ExecReport) error); ok { + r1 = rf(ctx, report) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// CommitStoreReader_VerifyExecutionReport_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'VerifyExecutionReport' +type CommitStoreReader_VerifyExecutionReport_Call struct { + *mock.Call +} + +// VerifyExecutionReport is a helper method to define mock.On call +// - ctx context.Context +// - report ccip.ExecReport +func (_e *CommitStoreReader_Expecter) VerifyExecutionReport(ctx interface{}, report interface{}) *CommitStoreReader_VerifyExecutionReport_Call { + return &CommitStoreReader_VerifyExecutionReport_Call{Call: _e.mock.On("VerifyExecutionReport", ctx, report)} +} + +func (_c *CommitStoreReader_VerifyExecutionReport_Call) Run(run func(ctx context.Context, report ccip.ExecReport)) *CommitStoreReader_VerifyExecutionReport_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(ccip.ExecReport)) + }) + return _c +} + +func (_c *CommitStoreReader_VerifyExecutionReport_Call) Return(_a0 bool, _a1 error) *CommitStoreReader_VerifyExecutionReport_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *CommitStoreReader_VerifyExecutionReport_Call) RunAndReturn(run func(context.Context, ccip.ExecReport) (bool, error)) *CommitStoreReader_VerifyExecutionReport_Call { + _c.Call.Return(run) + return _c +} + +// NewCommitStoreReader creates a new instance of CommitStoreReader. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewCommitStoreReader(t interface { + mock.TestingT + Cleanup(func()) +}) *CommitStoreReader { + mock := &CommitStoreReader{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/mocks/offramp_reader_mock.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/mocks/offramp_reader_mock.go new file mode 100644 index 00000000000..f383ccdc0ba --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/mocks/offramp_reader_mock.go @@ -0,0 +1,949 @@ +// Code generated by mockery v2.43.2. DO NOT EDIT. + +package mocks + +import ( + ccip "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + + context "context" + + mock "github.com/stretchr/testify/mock" +) + +// OffRampReader is an autogenerated mock type for the OffRampReader type +type OffRampReader struct { + mock.Mock +} + +type OffRampReader_Expecter struct { + mock *mock.Mock +} + +func (_m *OffRampReader) EXPECT() *OffRampReader_Expecter { + return &OffRampReader_Expecter{mock: &_m.Mock} +} + +// Address provides a mock function with given fields: ctx +func (_m *OffRampReader) Address(ctx context.Context) (ccip.Address, error) { + ret := _m.Called(ctx) + + if len(ret) == 0 { + panic("no return value specified for Address") + } + + var r0 ccip.Address + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (ccip.Address, error)); ok { + return rf(ctx) + } + if rf, ok := ret.Get(0).(func(context.Context) ccip.Address); ok { + r0 = rf(ctx) + } else { + r0 = ret.Get(0).(ccip.Address) + } + + if rf, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = rf(ctx) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// OffRampReader_Address_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Address' +type OffRampReader_Address_Call struct { + *mock.Call +} + +// Address is a helper method to define mock.On call +// - ctx context.Context +func (_e *OffRampReader_Expecter) Address(ctx interface{}) *OffRampReader_Address_Call { + return &OffRampReader_Address_Call{Call: _e.mock.On("Address", ctx)} +} + +func (_c *OffRampReader_Address_Call) Run(run func(ctx context.Context)) *OffRampReader_Address_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *OffRampReader_Address_Call) Return(_a0 ccip.Address, _a1 error) *OffRampReader_Address_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *OffRampReader_Address_Call) RunAndReturn(run func(context.Context) (ccip.Address, error)) *OffRampReader_Address_Call { + _c.Call.Return(run) + return _c +} + +// ChangeConfig provides a mock function with given fields: ctx, onchainConfig, offchainConfig +func (_m *OffRampReader) ChangeConfig(ctx context.Context, onchainConfig []byte, offchainConfig []byte) (ccip.Address, ccip.Address, error) { + ret := _m.Called(ctx, onchainConfig, offchainConfig) + + if len(ret) == 0 { + panic("no return value specified for ChangeConfig") + } + + var r0 ccip.Address + var r1 ccip.Address + var r2 error + if rf, ok := ret.Get(0).(func(context.Context, []byte, []byte) (ccip.Address, ccip.Address, error)); ok { + return rf(ctx, onchainConfig, offchainConfig) + } + if rf, ok := ret.Get(0).(func(context.Context, []byte, []byte) ccip.Address); ok { + r0 = rf(ctx, onchainConfig, offchainConfig) + } else { + r0 = ret.Get(0).(ccip.Address) + } + + if rf, ok := ret.Get(1).(func(context.Context, []byte, []byte) ccip.Address); ok { + r1 = rf(ctx, onchainConfig, offchainConfig) + } else { + r1 = ret.Get(1).(ccip.Address) + } + + if rf, ok := ret.Get(2).(func(context.Context, []byte, []byte) error); ok { + r2 = rf(ctx, onchainConfig, offchainConfig) + } else { + r2 = ret.Error(2) + } + + return r0, r1, r2 +} + +// OffRampReader_ChangeConfig_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ChangeConfig' +type OffRampReader_ChangeConfig_Call struct { + *mock.Call +} + +// ChangeConfig is a helper method to define mock.On call +// - ctx context.Context +// - onchainConfig []byte +// - offchainConfig []byte +func (_e *OffRampReader_Expecter) ChangeConfig(ctx interface{}, onchainConfig interface{}, offchainConfig interface{}) *OffRampReader_ChangeConfig_Call { + return &OffRampReader_ChangeConfig_Call{Call: _e.mock.On("ChangeConfig", ctx, onchainConfig, offchainConfig)} +} + +func (_c *OffRampReader_ChangeConfig_Call) Run(run func(ctx context.Context, onchainConfig []byte, offchainConfig []byte)) *OffRampReader_ChangeConfig_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].([]byte), args[2].([]byte)) + }) + return _c +} + +func (_c *OffRampReader_ChangeConfig_Call) Return(_a0 ccip.Address, _a1 ccip.Address, _a2 error) *OffRampReader_ChangeConfig_Call { + _c.Call.Return(_a0, _a1, _a2) + return _c +} + +func (_c *OffRampReader_ChangeConfig_Call) RunAndReturn(run func(context.Context, []byte, []byte) (ccip.Address, ccip.Address, error)) *OffRampReader_ChangeConfig_Call { + _c.Call.Return(run) + return _c +} + +// Close provides a mock function with given fields: +func (_m *OffRampReader) Close() error { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Close") + } + + var r0 error + if rf, ok := ret.Get(0).(func() error); ok { + r0 = rf() + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// OffRampReader_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close' +type OffRampReader_Close_Call struct { + *mock.Call +} + +// Close is a helper method to define mock.On call +func (_e *OffRampReader_Expecter) Close() *OffRampReader_Close_Call { + return &OffRampReader_Close_Call{Call: _e.mock.On("Close")} +} + +func (_c *OffRampReader_Close_Call) Run(run func()) *OffRampReader_Close_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *OffRampReader_Close_Call) Return(_a0 error) *OffRampReader_Close_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *OffRampReader_Close_Call) RunAndReturn(run func() error) *OffRampReader_Close_Call { + _c.Call.Return(run) + return _c +} + +// CurrentRateLimiterState provides a mock function with given fields: ctx +func (_m *OffRampReader) CurrentRateLimiterState(ctx context.Context) (ccip.TokenBucketRateLimit, error) { + ret := _m.Called(ctx) + + if len(ret) == 0 { + panic("no return value specified for CurrentRateLimiterState") + } + + var r0 ccip.TokenBucketRateLimit + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (ccip.TokenBucketRateLimit, error)); ok { + return rf(ctx) + } + if rf, ok := ret.Get(0).(func(context.Context) ccip.TokenBucketRateLimit); ok { + r0 = rf(ctx) + } else { + r0 = ret.Get(0).(ccip.TokenBucketRateLimit) + } + + if rf, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = rf(ctx) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// OffRampReader_CurrentRateLimiterState_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CurrentRateLimiterState' +type OffRampReader_CurrentRateLimiterState_Call struct { + *mock.Call +} + +// CurrentRateLimiterState is a helper method to define mock.On call +// - ctx context.Context +func (_e *OffRampReader_Expecter) CurrentRateLimiterState(ctx interface{}) *OffRampReader_CurrentRateLimiterState_Call { + return &OffRampReader_CurrentRateLimiterState_Call{Call: _e.mock.On("CurrentRateLimiterState", ctx)} +} + +func (_c *OffRampReader_CurrentRateLimiterState_Call) Run(run func(ctx context.Context)) *OffRampReader_CurrentRateLimiterState_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *OffRampReader_CurrentRateLimiterState_Call) Return(_a0 ccip.TokenBucketRateLimit, _a1 error) *OffRampReader_CurrentRateLimiterState_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *OffRampReader_CurrentRateLimiterState_Call) RunAndReturn(run func(context.Context) (ccip.TokenBucketRateLimit, error)) *OffRampReader_CurrentRateLimiterState_Call { + _c.Call.Return(run) + return _c +} + +// DecodeExecutionReport provides a mock function with given fields: ctx, report +func (_m *OffRampReader) DecodeExecutionReport(ctx context.Context, report []byte) (ccip.ExecReport, error) { + ret := _m.Called(ctx, report) + + if len(ret) == 0 { + panic("no return value specified for DecodeExecutionReport") + } + + var r0 ccip.ExecReport + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, []byte) (ccip.ExecReport, error)); ok { + return rf(ctx, report) + } + if rf, ok := ret.Get(0).(func(context.Context, []byte) ccip.ExecReport); ok { + r0 = rf(ctx, report) + } else { + r0 = ret.Get(0).(ccip.ExecReport) + } + + if rf, ok := ret.Get(1).(func(context.Context, []byte) error); ok { + r1 = rf(ctx, report) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// OffRampReader_DecodeExecutionReport_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DecodeExecutionReport' +type OffRampReader_DecodeExecutionReport_Call struct { + *mock.Call +} + +// DecodeExecutionReport is a helper method to define mock.On call +// - ctx context.Context +// - report []byte +func (_e *OffRampReader_Expecter) DecodeExecutionReport(ctx interface{}, report interface{}) *OffRampReader_DecodeExecutionReport_Call { + return &OffRampReader_DecodeExecutionReport_Call{Call: _e.mock.On("DecodeExecutionReport", ctx, report)} +} + +func (_c *OffRampReader_DecodeExecutionReport_Call) Run(run func(ctx context.Context, report []byte)) *OffRampReader_DecodeExecutionReport_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].([]byte)) + }) + return _c +} + +func (_c *OffRampReader_DecodeExecutionReport_Call) Return(_a0 ccip.ExecReport, _a1 error) *OffRampReader_DecodeExecutionReport_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *OffRampReader_DecodeExecutionReport_Call) RunAndReturn(run func(context.Context, []byte) (ccip.ExecReport, error)) *OffRampReader_DecodeExecutionReport_Call { + _c.Call.Return(run) + return _c +} + +// EncodeExecutionReport provides a mock function with given fields: ctx, report +func (_m *OffRampReader) EncodeExecutionReport(ctx context.Context, report ccip.ExecReport) ([]byte, error) { + ret := _m.Called(ctx, report) + + if len(ret) == 0 { + panic("no return value specified for EncodeExecutionReport") + } + + var r0 []byte + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, ccip.ExecReport) ([]byte, error)); ok { + return rf(ctx, report) + } + if rf, ok := ret.Get(0).(func(context.Context, ccip.ExecReport) []byte); ok { + r0 = rf(ctx, report) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]byte) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, ccip.ExecReport) error); ok { + r1 = rf(ctx, report) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// OffRampReader_EncodeExecutionReport_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EncodeExecutionReport' +type OffRampReader_EncodeExecutionReport_Call struct { + *mock.Call +} + +// EncodeExecutionReport is a helper method to define mock.On call +// - ctx context.Context +// - report ccip.ExecReport +func (_e *OffRampReader_Expecter) EncodeExecutionReport(ctx interface{}, report interface{}) *OffRampReader_EncodeExecutionReport_Call { + return &OffRampReader_EncodeExecutionReport_Call{Call: _e.mock.On("EncodeExecutionReport", ctx, report)} +} + +func (_c *OffRampReader_EncodeExecutionReport_Call) Run(run func(ctx context.Context, report ccip.ExecReport)) *OffRampReader_EncodeExecutionReport_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(ccip.ExecReport)) + }) + return _c +} + +func (_c *OffRampReader_EncodeExecutionReport_Call) Return(_a0 []byte, _a1 error) *OffRampReader_EncodeExecutionReport_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *OffRampReader_EncodeExecutionReport_Call) RunAndReturn(run func(context.Context, ccip.ExecReport) ([]byte, error)) *OffRampReader_EncodeExecutionReport_Call { + _c.Call.Return(run) + return _c +} + +// GasPriceEstimator provides a mock function with given fields: ctx +func (_m *OffRampReader) GasPriceEstimator(ctx context.Context) (ccip.GasPriceEstimatorExec, error) { + ret := _m.Called(ctx) + + if len(ret) == 0 { + panic("no return value specified for GasPriceEstimator") + } + + var r0 ccip.GasPriceEstimatorExec + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (ccip.GasPriceEstimatorExec, error)); ok { + return rf(ctx) + } + if rf, ok := ret.Get(0).(func(context.Context) ccip.GasPriceEstimatorExec); ok { + r0 = rf(ctx) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(ccip.GasPriceEstimatorExec) + } + } + + if rf, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = rf(ctx) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// OffRampReader_GasPriceEstimator_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GasPriceEstimator' +type OffRampReader_GasPriceEstimator_Call struct { + *mock.Call +} + +// GasPriceEstimator is a helper method to define mock.On call +// - ctx context.Context +func (_e *OffRampReader_Expecter) GasPriceEstimator(ctx interface{}) *OffRampReader_GasPriceEstimator_Call { + return &OffRampReader_GasPriceEstimator_Call{Call: _e.mock.On("GasPriceEstimator", ctx)} +} + +func (_c *OffRampReader_GasPriceEstimator_Call) Run(run func(ctx context.Context)) *OffRampReader_GasPriceEstimator_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *OffRampReader_GasPriceEstimator_Call) Return(_a0 ccip.GasPriceEstimatorExec, _a1 error) *OffRampReader_GasPriceEstimator_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *OffRampReader_GasPriceEstimator_Call) RunAndReturn(run func(context.Context) (ccip.GasPriceEstimatorExec, error)) *OffRampReader_GasPriceEstimator_Call { + _c.Call.Return(run) + return _c +} + +// GetExecutionState provides a mock function with given fields: ctx, sequenceNumber +func (_m *OffRampReader) GetExecutionState(ctx context.Context, sequenceNumber uint64) (uint8, error) { + ret := _m.Called(ctx, sequenceNumber) + + if len(ret) == 0 { + panic("no return value specified for GetExecutionState") + } + + var r0 uint8 + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, uint64) (uint8, error)); ok { + return rf(ctx, sequenceNumber) + } + if rf, ok := ret.Get(0).(func(context.Context, uint64) uint8); ok { + r0 = rf(ctx, sequenceNumber) + } else { + r0 = ret.Get(0).(uint8) + } + + if rf, ok := ret.Get(1).(func(context.Context, uint64) error); ok { + r1 = rf(ctx, sequenceNumber) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// OffRampReader_GetExecutionState_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetExecutionState' +type OffRampReader_GetExecutionState_Call struct { + *mock.Call +} + +// GetExecutionState is a helper method to define mock.On call +// - ctx context.Context +// - sequenceNumber uint64 +func (_e *OffRampReader_Expecter) GetExecutionState(ctx interface{}, sequenceNumber interface{}) *OffRampReader_GetExecutionState_Call { + return &OffRampReader_GetExecutionState_Call{Call: _e.mock.On("GetExecutionState", ctx, sequenceNumber)} +} + +func (_c *OffRampReader_GetExecutionState_Call) Run(run func(ctx context.Context, sequenceNumber uint64)) *OffRampReader_GetExecutionState_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(uint64)) + }) + return _c +} + +func (_c *OffRampReader_GetExecutionState_Call) Return(_a0 uint8, _a1 error) *OffRampReader_GetExecutionState_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *OffRampReader_GetExecutionState_Call) RunAndReturn(run func(context.Context, uint64) (uint8, error)) *OffRampReader_GetExecutionState_Call { + _c.Call.Return(run) + return _c +} + +// GetExecutionStateChangesBetweenSeqNums provides a mock function with given fields: ctx, seqNumMin, seqNumMax, confirmations +func (_m *OffRampReader) GetExecutionStateChangesBetweenSeqNums(ctx context.Context, seqNumMin uint64, seqNumMax uint64, confirmations int) ([]ccip.ExecutionStateChangedWithTxMeta, error) { + ret := _m.Called(ctx, seqNumMin, seqNumMax, confirmations) + + if len(ret) == 0 { + panic("no return value specified for GetExecutionStateChangesBetweenSeqNums") + } + + var r0 []ccip.ExecutionStateChangedWithTxMeta + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, uint64, uint64, int) ([]ccip.ExecutionStateChangedWithTxMeta, error)); ok { + return rf(ctx, seqNumMin, seqNumMax, confirmations) + } + if rf, ok := ret.Get(0).(func(context.Context, uint64, uint64, int) []ccip.ExecutionStateChangedWithTxMeta); ok { + r0 = rf(ctx, seqNumMin, seqNumMax, confirmations) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]ccip.ExecutionStateChangedWithTxMeta) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, uint64, uint64, int) error); ok { + r1 = rf(ctx, seqNumMin, seqNumMax, confirmations) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// OffRampReader_GetExecutionStateChangesBetweenSeqNums_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetExecutionStateChangesBetweenSeqNums' +type OffRampReader_GetExecutionStateChangesBetweenSeqNums_Call struct { + *mock.Call +} + +// GetExecutionStateChangesBetweenSeqNums is a helper method to define mock.On call +// - ctx context.Context +// - seqNumMin uint64 +// - seqNumMax uint64 +// - confirmations int +func (_e *OffRampReader_Expecter) GetExecutionStateChangesBetweenSeqNums(ctx interface{}, seqNumMin interface{}, seqNumMax interface{}, confirmations interface{}) *OffRampReader_GetExecutionStateChangesBetweenSeqNums_Call { + return &OffRampReader_GetExecutionStateChangesBetweenSeqNums_Call{Call: _e.mock.On("GetExecutionStateChangesBetweenSeqNums", ctx, seqNumMin, seqNumMax, confirmations)} +} + +func (_c *OffRampReader_GetExecutionStateChangesBetweenSeqNums_Call) Run(run func(ctx context.Context, seqNumMin uint64, seqNumMax uint64, confirmations int)) *OffRampReader_GetExecutionStateChangesBetweenSeqNums_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(uint64), args[2].(uint64), args[3].(int)) + }) + return _c +} + +func (_c *OffRampReader_GetExecutionStateChangesBetweenSeqNums_Call) Return(_a0 []ccip.ExecutionStateChangedWithTxMeta, _a1 error) *OffRampReader_GetExecutionStateChangesBetweenSeqNums_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *OffRampReader_GetExecutionStateChangesBetweenSeqNums_Call) RunAndReturn(run func(context.Context, uint64, uint64, int) ([]ccip.ExecutionStateChangedWithTxMeta, error)) *OffRampReader_GetExecutionStateChangesBetweenSeqNums_Call { + _c.Call.Return(run) + return _c +} + +// GetRouter provides a mock function with given fields: ctx +func (_m *OffRampReader) GetRouter(ctx context.Context) (ccip.Address, error) { + ret := _m.Called(ctx) + + if len(ret) == 0 { + panic("no return value specified for GetRouter") + } + + var r0 ccip.Address + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (ccip.Address, error)); ok { + return rf(ctx) + } + if rf, ok := ret.Get(0).(func(context.Context) ccip.Address); ok { + r0 = rf(ctx) + } else { + r0 = ret.Get(0).(ccip.Address) + } + + if rf, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = rf(ctx) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// OffRampReader_GetRouter_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetRouter' +type OffRampReader_GetRouter_Call struct { + *mock.Call +} + +// GetRouter is a helper method to define mock.On call +// - ctx context.Context +func (_e *OffRampReader_Expecter) GetRouter(ctx interface{}) *OffRampReader_GetRouter_Call { + return &OffRampReader_GetRouter_Call{Call: _e.mock.On("GetRouter", ctx)} +} + +func (_c *OffRampReader_GetRouter_Call) Run(run func(ctx context.Context)) *OffRampReader_GetRouter_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *OffRampReader_GetRouter_Call) Return(_a0 ccip.Address, _a1 error) *OffRampReader_GetRouter_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *OffRampReader_GetRouter_Call) RunAndReturn(run func(context.Context) (ccip.Address, error)) *OffRampReader_GetRouter_Call { + _c.Call.Return(run) + return _c +} + +// GetSourceToDestTokensMapping provides a mock function with given fields: ctx +func (_m *OffRampReader) GetSourceToDestTokensMapping(ctx context.Context) (map[ccip.Address]ccip.Address, error) { + ret := _m.Called(ctx) + + if len(ret) == 0 { + panic("no return value specified for GetSourceToDestTokensMapping") + } + + var r0 map[ccip.Address]ccip.Address + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (map[ccip.Address]ccip.Address, error)); ok { + return rf(ctx) + } + if rf, ok := ret.Get(0).(func(context.Context) map[ccip.Address]ccip.Address); ok { + r0 = rf(ctx) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(map[ccip.Address]ccip.Address) + } + } + + if rf, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = rf(ctx) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// OffRampReader_GetSourceToDestTokensMapping_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSourceToDestTokensMapping' +type OffRampReader_GetSourceToDestTokensMapping_Call struct { + *mock.Call +} + +// GetSourceToDestTokensMapping is a helper method to define mock.On call +// - ctx context.Context +func (_e *OffRampReader_Expecter) GetSourceToDestTokensMapping(ctx interface{}) *OffRampReader_GetSourceToDestTokensMapping_Call { + return &OffRampReader_GetSourceToDestTokensMapping_Call{Call: _e.mock.On("GetSourceToDestTokensMapping", ctx)} +} + +func (_c *OffRampReader_GetSourceToDestTokensMapping_Call) Run(run func(ctx context.Context)) *OffRampReader_GetSourceToDestTokensMapping_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *OffRampReader_GetSourceToDestTokensMapping_Call) Return(_a0 map[ccip.Address]ccip.Address, _a1 error) *OffRampReader_GetSourceToDestTokensMapping_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *OffRampReader_GetSourceToDestTokensMapping_Call) RunAndReturn(run func(context.Context) (map[ccip.Address]ccip.Address, error)) *OffRampReader_GetSourceToDestTokensMapping_Call { + _c.Call.Return(run) + return _c +} + +// GetStaticConfig provides a mock function with given fields: ctx +func (_m *OffRampReader) GetStaticConfig(ctx context.Context) (ccip.OffRampStaticConfig, error) { + ret := _m.Called(ctx) + + if len(ret) == 0 { + panic("no return value specified for GetStaticConfig") + } + + var r0 ccip.OffRampStaticConfig + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (ccip.OffRampStaticConfig, error)); ok { + return rf(ctx) + } + if rf, ok := ret.Get(0).(func(context.Context) ccip.OffRampStaticConfig); ok { + r0 = rf(ctx) + } else { + r0 = ret.Get(0).(ccip.OffRampStaticConfig) + } + + if rf, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = rf(ctx) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// OffRampReader_GetStaticConfig_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetStaticConfig' +type OffRampReader_GetStaticConfig_Call struct { + *mock.Call +} + +// GetStaticConfig is a helper method to define mock.On call +// - ctx context.Context +func (_e *OffRampReader_Expecter) GetStaticConfig(ctx interface{}) *OffRampReader_GetStaticConfig_Call { + return &OffRampReader_GetStaticConfig_Call{Call: _e.mock.On("GetStaticConfig", ctx)} +} + +func (_c *OffRampReader_GetStaticConfig_Call) Run(run func(ctx context.Context)) *OffRampReader_GetStaticConfig_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *OffRampReader_GetStaticConfig_Call) Return(_a0 ccip.OffRampStaticConfig, _a1 error) *OffRampReader_GetStaticConfig_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *OffRampReader_GetStaticConfig_Call) RunAndReturn(run func(context.Context) (ccip.OffRampStaticConfig, error)) *OffRampReader_GetStaticConfig_Call { + _c.Call.Return(run) + return _c +} + +// GetTokens provides a mock function with given fields: ctx +func (_m *OffRampReader) GetTokens(ctx context.Context) (ccip.OffRampTokens, error) { + ret := _m.Called(ctx) + + if len(ret) == 0 { + panic("no return value specified for GetTokens") + } + + var r0 ccip.OffRampTokens + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (ccip.OffRampTokens, error)); ok { + return rf(ctx) + } + if rf, ok := ret.Get(0).(func(context.Context) ccip.OffRampTokens); ok { + r0 = rf(ctx) + } else { + r0 = ret.Get(0).(ccip.OffRampTokens) + } + + if rf, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = rf(ctx) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// OffRampReader_GetTokens_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetTokens' +type OffRampReader_GetTokens_Call struct { + *mock.Call +} + +// GetTokens is a helper method to define mock.On call +// - ctx context.Context +func (_e *OffRampReader_Expecter) GetTokens(ctx interface{}) *OffRampReader_GetTokens_Call { + return &OffRampReader_GetTokens_Call{Call: _e.mock.On("GetTokens", ctx)} +} + +func (_c *OffRampReader_GetTokens_Call) Run(run func(ctx context.Context)) *OffRampReader_GetTokens_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *OffRampReader_GetTokens_Call) Return(_a0 ccip.OffRampTokens, _a1 error) *OffRampReader_GetTokens_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *OffRampReader_GetTokens_Call) RunAndReturn(run func(context.Context) (ccip.OffRampTokens, error)) *OffRampReader_GetTokens_Call { + _c.Call.Return(run) + return _c +} + +// ListSenderNonces provides a mock function with given fields: ctx, senders +func (_m *OffRampReader) ListSenderNonces(ctx context.Context, senders []ccip.Address) (map[ccip.Address]uint64, error) { + ret := _m.Called(ctx, senders) + + if len(ret) == 0 { + panic("no return value specified for ListSenderNonces") + } + + var r0 map[ccip.Address]uint64 + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, []ccip.Address) (map[ccip.Address]uint64, error)); ok { + return rf(ctx, senders) + } + if rf, ok := ret.Get(0).(func(context.Context, []ccip.Address) map[ccip.Address]uint64); ok { + r0 = rf(ctx, senders) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(map[ccip.Address]uint64) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, []ccip.Address) error); ok { + r1 = rf(ctx, senders) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// OffRampReader_ListSenderNonces_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListSenderNonces' +type OffRampReader_ListSenderNonces_Call struct { + *mock.Call +} + +// ListSenderNonces is a helper method to define mock.On call +// - ctx context.Context +// - senders []ccip.Address +func (_e *OffRampReader_Expecter) ListSenderNonces(ctx interface{}, senders interface{}) *OffRampReader_ListSenderNonces_Call { + return &OffRampReader_ListSenderNonces_Call{Call: _e.mock.On("ListSenderNonces", ctx, senders)} +} + +func (_c *OffRampReader_ListSenderNonces_Call) Run(run func(ctx context.Context, senders []ccip.Address)) *OffRampReader_ListSenderNonces_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].([]ccip.Address)) + }) + return _c +} + +func (_c *OffRampReader_ListSenderNonces_Call) Return(_a0 map[ccip.Address]uint64, _a1 error) *OffRampReader_ListSenderNonces_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *OffRampReader_ListSenderNonces_Call) RunAndReturn(run func(context.Context, []ccip.Address) (map[ccip.Address]uint64, error)) *OffRampReader_ListSenderNonces_Call { + _c.Call.Return(run) + return _c +} + +// OffchainConfig provides a mock function with given fields: ctx +func (_m *OffRampReader) OffchainConfig(ctx context.Context) (ccip.ExecOffchainConfig, error) { + ret := _m.Called(ctx) + + if len(ret) == 0 { + panic("no return value specified for OffchainConfig") + } + + var r0 ccip.ExecOffchainConfig + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (ccip.ExecOffchainConfig, error)); ok { + return rf(ctx) + } + if rf, ok := ret.Get(0).(func(context.Context) ccip.ExecOffchainConfig); ok { + r0 = rf(ctx) + } else { + r0 = ret.Get(0).(ccip.ExecOffchainConfig) + } + + if rf, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = rf(ctx) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// OffRampReader_OffchainConfig_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OffchainConfig' +type OffRampReader_OffchainConfig_Call struct { + *mock.Call +} + +// OffchainConfig is a helper method to define mock.On call +// - ctx context.Context +func (_e *OffRampReader_Expecter) OffchainConfig(ctx interface{}) *OffRampReader_OffchainConfig_Call { + return &OffRampReader_OffchainConfig_Call{Call: _e.mock.On("OffchainConfig", ctx)} +} + +func (_c *OffRampReader_OffchainConfig_Call) Run(run func(ctx context.Context)) *OffRampReader_OffchainConfig_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *OffRampReader_OffchainConfig_Call) Return(_a0 ccip.ExecOffchainConfig, _a1 error) *OffRampReader_OffchainConfig_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *OffRampReader_OffchainConfig_Call) RunAndReturn(run func(context.Context) (ccip.ExecOffchainConfig, error)) *OffRampReader_OffchainConfig_Call { + _c.Call.Return(run) + return _c +} + +// OnchainConfig provides a mock function with given fields: ctx +func (_m *OffRampReader) OnchainConfig(ctx context.Context) (ccip.ExecOnchainConfig, error) { + ret := _m.Called(ctx) + + if len(ret) == 0 { + panic("no return value specified for OnchainConfig") + } + + var r0 ccip.ExecOnchainConfig + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (ccip.ExecOnchainConfig, error)); ok { + return rf(ctx) + } + if rf, ok := ret.Get(0).(func(context.Context) ccip.ExecOnchainConfig); ok { + r0 = rf(ctx) + } else { + r0 = ret.Get(0).(ccip.ExecOnchainConfig) + } + + if rf, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = rf(ctx) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// OffRampReader_OnchainConfig_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OnchainConfig' +type OffRampReader_OnchainConfig_Call struct { + *mock.Call +} + +// OnchainConfig is a helper method to define mock.On call +// - ctx context.Context +func (_e *OffRampReader_Expecter) OnchainConfig(ctx interface{}) *OffRampReader_OnchainConfig_Call { + return &OffRampReader_OnchainConfig_Call{Call: _e.mock.On("OnchainConfig", ctx)} +} + +func (_c *OffRampReader_OnchainConfig_Call) Run(run func(ctx context.Context)) *OffRampReader_OnchainConfig_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *OffRampReader_OnchainConfig_Call) Return(_a0 ccip.ExecOnchainConfig, _a1 error) *OffRampReader_OnchainConfig_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *OffRampReader_OnchainConfig_Call) RunAndReturn(run func(context.Context) (ccip.ExecOnchainConfig, error)) *OffRampReader_OnchainConfig_Call { + _c.Call.Return(run) + return _c +} + +// NewOffRampReader creates a new instance of OffRampReader. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewOffRampReader(t interface { + mock.TestingT + Cleanup(func()) +}) *OffRampReader { + mock := &OffRampReader{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/mocks/onramp_reader_mock.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/mocks/onramp_reader_mock.go new file mode 100644 index 00000000000..ccf5bd78463 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/mocks/onramp_reader_mock.go @@ -0,0 +1,480 @@ +// Code generated by mockery v2.43.2. DO NOT EDIT. + +package mocks + +import ( + ccip "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + + context "context" + + mock "github.com/stretchr/testify/mock" +) + +// OnRampReader is an autogenerated mock type for the OnRampReader type +type OnRampReader struct { + mock.Mock +} + +type OnRampReader_Expecter struct { + mock *mock.Mock +} + +func (_m *OnRampReader) EXPECT() *OnRampReader_Expecter { + return &OnRampReader_Expecter{mock: &_m.Mock} +} + +// Address provides a mock function with given fields: ctx +func (_m *OnRampReader) Address(ctx context.Context) (ccip.Address, error) { + ret := _m.Called(ctx) + + if len(ret) == 0 { + panic("no return value specified for Address") + } + + var r0 ccip.Address + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (ccip.Address, error)); ok { + return rf(ctx) + } + if rf, ok := ret.Get(0).(func(context.Context) ccip.Address); ok { + r0 = rf(ctx) + } else { + r0 = ret.Get(0).(ccip.Address) + } + + if rf, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = rf(ctx) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// OnRampReader_Address_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Address' +type OnRampReader_Address_Call struct { + *mock.Call +} + +// Address is a helper method to define mock.On call +// - ctx context.Context +func (_e *OnRampReader_Expecter) Address(ctx interface{}) *OnRampReader_Address_Call { + return &OnRampReader_Address_Call{Call: _e.mock.On("Address", ctx)} +} + +func (_c *OnRampReader_Address_Call) Run(run func(ctx context.Context)) *OnRampReader_Address_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *OnRampReader_Address_Call) Return(_a0 ccip.Address, _a1 error) *OnRampReader_Address_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *OnRampReader_Address_Call) RunAndReturn(run func(context.Context) (ccip.Address, error)) *OnRampReader_Address_Call { + _c.Call.Return(run) + return _c +} + +// Close provides a mock function with given fields: +func (_m *OnRampReader) Close() error { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Close") + } + + var r0 error + if rf, ok := ret.Get(0).(func() error); ok { + r0 = rf() + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// OnRampReader_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close' +type OnRampReader_Close_Call struct { + *mock.Call +} + +// Close is a helper method to define mock.On call +func (_e *OnRampReader_Expecter) Close() *OnRampReader_Close_Call { + return &OnRampReader_Close_Call{Call: _e.mock.On("Close")} +} + +func (_c *OnRampReader_Close_Call) Run(run func()) *OnRampReader_Close_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *OnRampReader_Close_Call) Return(_a0 error) *OnRampReader_Close_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *OnRampReader_Close_Call) RunAndReturn(run func() error) *OnRampReader_Close_Call { + _c.Call.Return(run) + return _c +} + +// GetDynamicConfig provides a mock function with given fields: ctx +func (_m *OnRampReader) GetDynamicConfig(ctx context.Context) (ccip.OnRampDynamicConfig, error) { + ret := _m.Called(ctx) + + if len(ret) == 0 { + panic("no return value specified for GetDynamicConfig") + } + + var r0 ccip.OnRampDynamicConfig + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (ccip.OnRampDynamicConfig, error)); ok { + return rf(ctx) + } + if rf, ok := ret.Get(0).(func(context.Context) ccip.OnRampDynamicConfig); ok { + r0 = rf(ctx) + } else { + r0 = ret.Get(0).(ccip.OnRampDynamicConfig) + } + + if rf, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = rf(ctx) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// OnRampReader_GetDynamicConfig_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetDynamicConfig' +type OnRampReader_GetDynamicConfig_Call struct { + *mock.Call +} + +// GetDynamicConfig is a helper method to define mock.On call +// - ctx context.Context +func (_e *OnRampReader_Expecter) GetDynamicConfig(ctx interface{}) *OnRampReader_GetDynamicConfig_Call { + return &OnRampReader_GetDynamicConfig_Call{Call: _e.mock.On("GetDynamicConfig", ctx)} +} + +func (_c *OnRampReader_GetDynamicConfig_Call) Run(run func(ctx context.Context)) *OnRampReader_GetDynamicConfig_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *OnRampReader_GetDynamicConfig_Call) Return(_a0 ccip.OnRampDynamicConfig, _a1 error) *OnRampReader_GetDynamicConfig_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *OnRampReader_GetDynamicConfig_Call) RunAndReturn(run func(context.Context) (ccip.OnRampDynamicConfig, error)) *OnRampReader_GetDynamicConfig_Call { + _c.Call.Return(run) + return _c +} + +// GetSendRequestsBetweenSeqNums provides a mock function with given fields: ctx, seqNumMin, seqNumMax, finalized +func (_m *OnRampReader) GetSendRequestsBetweenSeqNums(ctx context.Context, seqNumMin uint64, seqNumMax uint64, finalized bool) ([]ccip.EVM2EVMMessageWithTxMeta, error) { + ret := _m.Called(ctx, seqNumMin, seqNumMax, finalized) + + if len(ret) == 0 { + panic("no return value specified for GetSendRequestsBetweenSeqNums") + } + + var r0 []ccip.EVM2EVMMessageWithTxMeta + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, uint64, uint64, bool) ([]ccip.EVM2EVMMessageWithTxMeta, error)); ok { + return rf(ctx, seqNumMin, seqNumMax, finalized) + } + if rf, ok := ret.Get(0).(func(context.Context, uint64, uint64, bool) []ccip.EVM2EVMMessageWithTxMeta); ok { + r0 = rf(ctx, seqNumMin, seqNumMax, finalized) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]ccip.EVM2EVMMessageWithTxMeta) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, uint64, uint64, bool) error); ok { + r1 = rf(ctx, seqNumMin, seqNumMax, finalized) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// OnRampReader_GetSendRequestsBetweenSeqNums_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSendRequestsBetweenSeqNums' +type OnRampReader_GetSendRequestsBetweenSeqNums_Call struct { + *mock.Call +} + +// GetSendRequestsBetweenSeqNums is a helper method to define mock.On call +// - ctx context.Context +// - seqNumMin uint64 +// - seqNumMax uint64 +// - finalized bool +func (_e *OnRampReader_Expecter) GetSendRequestsBetweenSeqNums(ctx interface{}, seqNumMin interface{}, seqNumMax interface{}, finalized interface{}) *OnRampReader_GetSendRequestsBetweenSeqNums_Call { + return &OnRampReader_GetSendRequestsBetweenSeqNums_Call{Call: _e.mock.On("GetSendRequestsBetweenSeqNums", ctx, seqNumMin, seqNumMax, finalized)} +} + +func (_c *OnRampReader_GetSendRequestsBetweenSeqNums_Call) Run(run func(ctx context.Context, seqNumMin uint64, seqNumMax uint64, finalized bool)) *OnRampReader_GetSendRequestsBetweenSeqNums_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(uint64), args[2].(uint64), args[3].(bool)) + }) + return _c +} + +func (_c *OnRampReader_GetSendRequestsBetweenSeqNums_Call) Return(_a0 []ccip.EVM2EVMMessageWithTxMeta, _a1 error) *OnRampReader_GetSendRequestsBetweenSeqNums_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *OnRampReader_GetSendRequestsBetweenSeqNums_Call) RunAndReturn(run func(context.Context, uint64, uint64, bool) ([]ccip.EVM2EVMMessageWithTxMeta, error)) *OnRampReader_GetSendRequestsBetweenSeqNums_Call { + _c.Call.Return(run) + return _c +} + +// IsSourceChainHealthy provides a mock function with given fields: ctx +func (_m *OnRampReader) IsSourceChainHealthy(ctx context.Context) (bool, error) { + ret := _m.Called(ctx) + + if len(ret) == 0 { + panic("no return value specified for IsSourceChainHealthy") + } + + var r0 bool + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (bool, error)); ok { + return rf(ctx) + } + if rf, ok := ret.Get(0).(func(context.Context) bool); ok { + r0 = rf(ctx) + } else { + r0 = ret.Get(0).(bool) + } + + if rf, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = rf(ctx) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// OnRampReader_IsSourceChainHealthy_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsSourceChainHealthy' +type OnRampReader_IsSourceChainHealthy_Call struct { + *mock.Call +} + +// IsSourceChainHealthy is a helper method to define mock.On call +// - ctx context.Context +func (_e *OnRampReader_Expecter) IsSourceChainHealthy(ctx interface{}) *OnRampReader_IsSourceChainHealthy_Call { + return &OnRampReader_IsSourceChainHealthy_Call{Call: _e.mock.On("IsSourceChainHealthy", ctx)} +} + +func (_c *OnRampReader_IsSourceChainHealthy_Call) Run(run func(ctx context.Context)) *OnRampReader_IsSourceChainHealthy_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *OnRampReader_IsSourceChainHealthy_Call) Return(_a0 bool, _a1 error) *OnRampReader_IsSourceChainHealthy_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *OnRampReader_IsSourceChainHealthy_Call) RunAndReturn(run func(context.Context) (bool, error)) *OnRampReader_IsSourceChainHealthy_Call { + _c.Call.Return(run) + return _c +} + +// IsSourceCursed provides a mock function with given fields: ctx +func (_m *OnRampReader) IsSourceCursed(ctx context.Context) (bool, error) { + ret := _m.Called(ctx) + + if len(ret) == 0 { + panic("no return value specified for IsSourceCursed") + } + + var r0 bool + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (bool, error)); ok { + return rf(ctx) + } + if rf, ok := ret.Get(0).(func(context.Context) bool); ok { + r0 = rf(ctx) + } else { + r0 = ret.Get(0).(bool) + } + + if rf, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = rf(ctx) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// OnRampReader_IsSourceCursed_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsSourceCursed' +type OnRampReader_IsSourceCursed_Call struct { + *mock.Call +} + +// IsSourceCursed is a helper method to define mock.On call +// - ctx context.Context +func (_e *OnRampReader_Expecter) IsSourceCursed(ctx interface{}) *OnRampReader_IsSourceCursed_Call { + return &OnRampReader_IsSourceCursed_Call{Call: _e.mock.On("IsSourceCursed", ctx)} +} + +func (_c *OnRampReader_IsSourceCursed_Call) Run(run func(ctx context.Context)) *OnRampReader_IsSourceCursed_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *OnRampReader_IsSourceCursed_Call) Return(_a0 bool, _a1 error) *OnRampReader_IsSourceCursed_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *OnRampReader_IsSourceCursed_Call) RunAndReturn(run func(context.Context) (bool, error)) *OnRampReader_IsSourceCursed_Call { + _c.Call.Return(run) + return _c +} + +// RouterAddress provides a mock function with given fields: _a0 +func (_m *OnRampReader) RouterAddress(_a0 context.Context) (ccip.Address, error) { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for RouterAddress") + } + + var r0 ccip.Address + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (ccip.Address, error)); ok { + return rf(_a0) + } + if rf, ok := ret.Get(0).(func(context.Context) ccip.Address); ok { + r0 = rf(_a0) + } else { + r0 = ret.Get(0).(ccip.Address) + } + + if rf, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = rf(_a0) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// OnRampReader_RouterAddress_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RouterAddress' +type OnRampReader_RouterAddress_Call struct { + *mock.Call +} + +// RouterAddress is a helper method to define mock.On call +// - _a0 context.Context +func (_e *OnRampReader_Expecter) RouterAddress(_a0 interface{}) *OnRampReader_RouterAddress_Call { + return &OnRampReader_RouterAddress_Call{Call: _e.mock.On("RouterAddress", _a0)} +} + +func (_c *OnRampReader_RouterAddress_Call) Run(run func(_a0 context.Context)) *OnRampReader_RouterAddress_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *OnRampReader_RouterAddress_Call) Return(_a0 ccip.Address, _a1 error) *OnRampReader_RouterAddress_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *OnRampReader_RouterAddress_Call) RunAndReturn(run func(context.Context) (ccip.Address, error)) *OnRampReader_RouterAddress_Call { + _c.Call.Return(run) + return _c +} + +// SourcePriceRegistryAddress provides a mock function with given fields: ctx +func (_m *OnRampReader) SourcePriceRegistryAddress(ctx context.Context) (ccip.Address, error) { + ret := _m.Called(ctx) + + if len(ret) == 0 { + panic("no return value specified for SourcePriceRegistryAddress") + } + + var r0 ccip.Address + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (ccip.Address, error)); ok { + return rf(ctx) + } + if rf, ok := ret.Get(0).(func(context.Context) ccip.Address); ok { + r0 = rf(ctx) + } else { + r0 = ret.Get(0).(ccip.Address) + } + + if rf, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = rf(ctx) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// OnRampReader_SourcePriceRegistryAddress_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SourcePriceRegistryAddress' +type OnRampReader_SourcePriceRegistryAddress_Call struct { + *mock.Call +} + +// SourcePriceRegistryAddress is a helper method to define mock.On call +// - ctx context.Context +func (_e *OnRampReader_Expecter) SourcePriceRegistryAddress(ctx interface{}) *OnRampReader_SourcePriceRegistryAddress_Call { + return &OnRampReader_SourcePriceRegistryAddress_Call{Call: _e.mock.On("SourcePriceRegistryAddress", ctx)} +} + +func (_c *OnRampReader_SourcePriceRegistryAddress_Call) Run(run func(ctx context.Context)) *OnRampReader_SourcePriceRegistryAddress_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *OnRampReader_SourcePriceRegistryAddress_Call) Return(_a0 ccip.Address, _a1 error) *OnRampReader_SourcePriceRegistryAddress_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *OnRampReader_SourcePriceRegistryAddress_Call) RunAndReturn(run func(context.Context) (ccip.Address, error)) *OnRampReader_SourcePriceRegistryAddress_Call { + _c.Call.Return(run) + return _c +} + +// NewOnRampReader creates a new instance of OnRampReader. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewOnRampReader(t interface { + mock.TestingT + Cleanup(func()) +}) *OnRampReader { + mock := &OnRampReader{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/mocks/price_registry_reader_mock.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/mocks/price_registry_reader_mock.go new file mode 100644 index 00000000000..94e354acb25 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/mocks/price_registry_reader_mock.go @@ -0,0 +1,498 @@ +// Code generated by mockery v2.43.2. DO NOT EDIT. + +package mocks + +import ( + ccip "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + + context "context" + + mock "github.com/stretchr/testify/mock" + + time "time" +) + +// PriceRegistryReader is an autogenerated mock type for the PriceRegistryReader type +type PriceRegistryReader struct { + mock.Mock +} + +type PriceRegistryReader_Expecter struct { + mock *mock.Mock +} + +func (_m *PriceRegistryReader) EXPECT() *PriceRegistryReader_Expecter { + return &PriceRegistryReader_Expecter{mock: &_m.Mock} +} + +// Address provides a mock function with given fields: ctx +func (_m *PriceRegistryReader) Address(ctx context.Context) (ccip.Address, error) { + ret := _m.Called(ctx) + + if len(ret) == 0 { + panic("no return value specified for Address") + } + + var r0 ccip.Address + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (ccip.Address, error)); ok { + return rf(ctx) + } + if rf, ok := ret.Get(0).(func(context.Context) ccip.Address); ok { + r0 = rf(ctx) + } else { + r0 = ret.Get(0).(ccip.Address) + } + + if rf, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = rf(ctx) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// PriceRegistryReader_Address_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Address' +type PriceRegistryReader_Address_Call struct { + *mock.Call +} + +// Address is a helper method to define mock.On call +// - ctx context.Context +func (_e *PriceRegistryReader_Expecter) Address(ctx interface{}) *PriceRegistryReader_Address_Call { + return &PriceRegistryReader_Address_Call{Call: _e.mock.On("Address", ctx)} +} + +func (_c *PriceRegistryReader_Address_Call) Run(run func(ctx context.Context)) *PriceRegistryReader_Address_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *PriceRegistryReader_Address_Call) Return(_a0 ccip.Address, _a1 error) *PriceRegistryReader_Address_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *PriceRegistryReader_Address_Call) RunAndReturn(run func(context.Context) (ccip.Address, error)) *PriceRegistryReader_Address_Call { + _c.Call.Return(run) + return _c +} + +// Close provides a mock function with given fields: +func (_m *PriceRegistryReader) Close() error { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Close") + } + + var r0 error + if rf, ok := ret.Get(0).(func() error); ok { + r0 = rf() + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// PriceRegistryReader_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close' +type PriceRegistryReader_Close_Call struct { + *mock.Call +} + +// Close is a helper method to define mock.On call +func (_e *PriceRegistryReader_Expecter) Close() *PriceRegistryReader_Close_Call { + return &PriceRegistryReader_Close_Call{Call: _e.mock.On("Close")} +} + +func (_c *PriceRegistryReader_Close_Call) Run(run func()) *PriceRegistryReader_Close_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *PriceRegistryReader_Close_Call) Return(_a0 error) *PriceRegistryReader_Close_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *PriceRegistryReader_Close_Call) RunAndReturn(run func() error) *PriceRegistryReader_Close_Call { + _c.Call.Return(run) + return _c +} + +// GetAllGasPriceUpdatesCreatedAfter provides a mock function with given fields: ctx, ts, confirmations +func (_m *PriceRegistryReader) GetAllGasPriceUpdatesCreatedAfter(ctx context.Context, ts time.Time, confirmations int) ([]ccip.GasPriceUpdateWithTxMeta, error) { + ret := _m.Called(ctx, ts, confirmations) + + if len(ret) == 0 { + panic("no return value specified for GetAllGasPriceUpdatesCreatedAfter") + } + + var r0 []ccip.GasPriceUpdateWithTxMeta + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, time.Time, int) ([]ccip.GasPriceUpdateWithTxMeta, error)); ok { + return rf(ctx, ts, confirmations) + } + if rf, ok := ret.Get(0).(func(context.Context, time.Time, int) []ccip.GasPriceUpdateWithTxMeta); ok { + r0 = rf(ctx, ts, confirmations) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]ccip.GasPriceUpdateWithTxMeta) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, time.Time, int) error); ok { + r1 = rf(ctx, ts, confirmations) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// PriceRegistryReader_GetAllGasPriceUpdatesCreatedAfter_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAllGasPriceUpdatesCreatedAfter' +type PriceRegistryReader_GetAllGasPriceUpdatesCreatedAfter_Call struct { + *mock.Call +} + +// GetAllGasPriceUpdatesCreatedAfter is a helper method to define mock.On call +// - ctx context.Context +// - ts time.Time +// - confirmations int +func (_e *PriceRegistryReader_Expecter) GetAllGasPriceUpdatesCreatedAfter(ctx interface{}, ts interface{}, confirmations interface{}) *PriceRegistryReader_GetAllGasPriceUpdatesCreatedAfter_Call { + return &PriceRegistryReader_GetAllGasPriceUpdatesCreatedAfter_Call{Call: _e.mock.On("GetAllGasPriceUpdatesCreatedAfter", ctx, ts, confirmations)} +} + +func (_c *PriceRegistryReader_GetAllGasPriceUpdatesCreatedAfter_Call) Run(run func(ctx context.Context, ts time.Time, confirmations int)) *PriceRegistryReader_GetAllGasPriceUpdatesCreatedAfter_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(time.Time), args[2].(int)) + }) + return _c +} + +func (_c *PriceRegistryReader_GetAllGasPriceUpdatesCreatedAfter_Call) Return(_a0 []ccip.GasPriceUpdateWithTxMeta, _a1 error) *PriceRegistryReader_GetAllGasPriceUpdatesCreatedAfter_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *PriceRegistryReader_GetAllGasPriceUpdatesCreatedAfter_Call) RunAndReturn(run func(context.Context, time.Time, int) ([]ccip.GasPriceUpdateWithTxMeta, error)) *PriceRegistryReader_GetAllGasPriceUpdatesCreatedAfter_Call { + _c.Call.Return(run) + return _c +} + +// GetFeeTokens provides a mock function with given fields: ctx +func (_m *PriceRegistryReader) GetFeeTokens(ctx context.Context) ([]ccip.Address, error) { + ret := _m.Called(ctx) + + if len(ret) == 0 { + panic("no return value specified for GetFeeTokens") + } + + var r0 []ccip.Address + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) ([]ccip.Address, error)); ok { + return rf(ctx) + } + if rf, ok := ret.Get(0).(func(context.Context) []ccip.Address); ok { + r0 = rf(ctx) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]ccip.Address) + } + } + + if rf, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = rf(ctx) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// PriceRegistryReader_GetFeeTokens_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetFeeTokens' +type PriceRegistryReader_GetFeeTokens_Call struct { + *mock.Call +} + +// GetFeeTokens is a helper method to define mock.On call +// - ctx context.Context +func (_e *PriceRegistryReader_Expecter) GetFeeTokens(ctx interface{}) *PriceRegistryReader_GetFeeTokens_Call { + return &PriceRegistryReader_GetFeeTokens_Call{Call: _e.mock.On("GetFeeTokens", ctx)} +} + +func (_c *PriceRegistryReader_GetFeeTokens_Call) Run(run func(ctx context.Context)) *PriceRegistryReader_GetFeeTokens_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *PriceRegistryReader_GetFeeTokens_Call) Return(_a0 []ccip.Address, _a1 error) *PriceRegistryReader_GetFeeTokens_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *PriceRegistryReader_GetFeeTokens_Call) RunAndReturn(run func(context.Context) ([]ccip.Address, error)) *PriceRegistryReader_GetFeeTokens_Call { + _c.Call.Return(run) + return _c +} + +// GetGasPriceUpdatesCreatedAfter provides a mock function with given fields: ctx, chainSelector, ts, confirmations +func (_m *PriceRegistryReader) GetGasPriceUpdatesCreatedAfter(ctx context.Context, chainSelector uint64, ts time.Time, confirmations int) ([]ccip.GasPriceUpdateWithTxMeta, error) { + ret := _m.Called(ctx, chainSelector, ts, confirmations) + + if len(ret) == 0 { + panic("no return value specified for GetGasPriceUpdatesCreatedAfter") + } + + var r0 []ccip.GasPriceUpdateWithTxMeta + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, uint64, time.Time, int) ([]ccip.GasPriceUpdateWithTxMeta, error)); ok { + return rf(ctx, chainSelector, ts, confirmations) + } + if rf, ok := ret.Get(0).(func(context.Context, uint64, time.Time, int) []ccip.GasPriceUpdateWithTxMeta); ok { + r0 = rf(ctx, chainSelector, ts, confirmations) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]ccip.GasPriceUpdateWithTxMeta) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, uint64, time.Time, int) error); ok { + r1 = rf(ctx, chainSelector, ts, confirmations) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// PriceRegistryReader_GetGasPriceUpdatesCreatedAfter_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetGasPriceUpdatesCreatedAfter' +type PriceRegistryReader_GetGasPriceUpdatesCreatedAfter_Call struct { + *mock.Call +} + +// GetGasPriceUpdatesCreatedAfter is a helper method to define mock.On call +// - ctx context.Context +// - chainSelector uint64 +// - ts time.Time +// - confirmations int +func (_e *PriceRegistryReader_Expecter) GetGasPriceUpdatesCreatedAfter(ctx interface{}, chainSelector interface{}, ts interface{}, confirmations interface{}) *PriceRegistryReader_GetGasPriceUpdatesCreatedAfter_Call { + return &PriceRegistryReader_GetGasPriceUpdatesCreatedAfter_Call{Call: _e.mock.On("GetGasPriceUpdatesCreatedAfter", ctx, chainSelector, ts, confirmations)} +} + +func (_c *PriceRegistryReader_GetGasPriceUpdatesCreatedAfter_Call) Run(run func(ctx context.Context, chainSelector uint64, ts time.Time, confirmations int)) *PriceRegistryReader_GetGasPriceUpdatesCreatedAfter_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(uint64), args[2].(time.Time), args[3].(int)) + }) + return _c +} + +func (_c *PriceRegistryReader_GetGasPriceUpdatesCreatedAfter_Call) Return(_a0 []ccip.GasPriceUpdateWithTxMeta, _a1 error) *PriceRegistryReader_GetGasPriceUpdatesCreatedAfter_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *PriceRegistryReader_GetGasPriceUpdatesCreatedAfter_Call) RunAndReturn(run func(context.Context, uint64, time.Time, int) ([]ccip.GasPriceUpdateWithTxMeta, error)) *PriceRegistryReader_GetGasPriceUpdatesCreatedAfter_Call { + _c.Call.Return(run) + return _c +} + +// GetTokenPriceUpdatesCreatedAfter provides a mock function with given fields: ctx, ts, confirmations +func (_m *PriceRegistryReader) GetTokenPriceUpdatesCreatedAfter(ctx context.Context, ts time.Time, confirmations int) ([]ccip.TokenPriceUpdateWithTxMeta, error) { + ret := _m.Called(ctx, ts, confirmations) + + if len(ret) == 0 { + panic("no return value specified for GetTokenPriceUpdatesCreatedAfter") + } + + var r0 []ccip.TokenPriceUpdateWithTxMeta + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, time.Time, int) ([]ccip.TokenPriceUpdateWithTxMeta, error)); ok { + return rf(ctx, ts, confirmations) + } + if rf, ok := ret.Get(0).(func(context.Context, time.Time, int) []ccip.TokenPriceUpdateWithTxMeta); ok { + r0 = rf(ctx, ts, confirmations) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]ccip.TokenPriceUpdateWithTxMeta) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, time.Time, int) error); ok { + r1 = rf(ctx, ts, confirmations) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// PriceRegistryReader_GetTokenPriceUpdatesCreatedAfter_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetTokenPriceUpdatesCreatedAfter' +type PriceRegistryReader_GetTokenPriceUpdatesCreatedAfter_Call struct { + *mock.Call +} + +// GetTokenPriceUpdatesCreatedAfter is a helper method to define mock.On call +// - ctx context.Context +// - ts time.Time +// - confirmations int +func (_e *PriceRegistryReader_Expecter) GetTokenPriceUpdatesCreatedAfter(ctx interface{}, ts interface{}, confirmations interface{}) *PriceRegistryReader_GetTokenPriceUpdatesCreatedAfter_Call { + return &PriceRegistryReader_GetTokenPriceUpdatesCreatedAfter_Call{Call: _e.mock.On("GetTokenPriceUpdatesCreatedAfter", ctx, ts, confirmations)} +} + +func (_c *PriceRegistryReader_GetTokenPriceUpdatesCreatedAfter_Call) Run(run func(ctx context.Context, ts time.Time, confirmations int)) *PriceRegistryReader_GetTokenPriceUpdatesCreatedAfter_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(time.Time), args[2].(int)) + }) + return _c +} + +func (_c *PriceRegistryReader_GetTokenPriceUpdatesCreatedAfter_Call) Return(_a0 []ccip.TokenPriceUpdateWithTxMeta, _a1 error) *PriceRegistryReader_GetTokenPriceUpdatesCreatedAfter_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *PriceRegistryReader_GetTokenPriceUpdatesCreatedAfter_Call) RunAndReturn(run func(context.Context, time.Time, int) ([]ccip.TokenPriceUpdateWithTxMeta, error)) *PriceRegistryReader_GetTokenPriceUpdatesCreatedAfter_Call { + _c.Call.Return(run) + return _c +} + +// GetTokenPrices provides a mock function with given fields: ctx, wantedTokens +func (_m *PriceRegistryReader) GetTokenPrices(ctx context.Context, wantedTokens []ccip.Address) ([]ccip.TokenPriceUpdate, error) { + ret := _m.Called(ctx, wantedTokens) + + if len(ret) == 0 { + panic("no return value specified for GetTokenPrices") + } + + var r0 []ccip.TokenPriceUpdate + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, []ccip.Address) ([]ccip.TokenPriceUpdate, error)); ok { + return rf(ctx, wantedTokens) + } + if rf, ok := ret.Get(0).(func(context.Context, []ccip.Address) []ccip.TokenPriceUpdate); ok { + r0 = rf(ctx, wantedTokens) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]ccip.TokenPriceUpdate) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, []ccip.Address) error); ok { + r1 = rf(ctx, wantedTokens) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// PriceRegistryReader_GetTokenPrices_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetTokenPrices' +type PriceRegistryReader_GetTokenPrices_Call struct { + *mock.Call +} + +// GetTokenPrices is a helper method to define mock.On call +// - ctx context.Context +// - wantedTokens []ccip.Address +func (_e *PriceRegistryReader_Expecter) GetTokenPrices(ctx interface{}, wantedTokens interface{}) *PriceRegistryReader_GetTokenPrices_Call { + return &PriceRegistryReader_GetTokenPrices_Call{Call: _e.mock.On("GetTokenPrices", ctx, wantedTokens)} +} + +func (_c *PriceRegistryReader_GetTokenPrices_Call) Run(run func(ctx context.Context, wantedTokens []ccip.Address)) *PriceRegistryReader_GetTokenPrices_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].([]ccip.Address)) + }) + return _c +} + +func (_c *PriceRegistryReader_GetTokenPrices_Call) Return(_a0 []ccip.TokenPriceUpdate, _a1 error) *PriceRegistryReader_GetTokenPrices_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *PriceRegistryReader_GetTokenPrices_Call) RunAndReturn(run func(context.Context, []ccip.Address) ([]ccip.TokenPriceUpdate, error)) *PriceRegistryReader_GetTokenPrices_Call { + _c.Call.Return(run) + return _c +} + +// GetTokensDecimals provides a mock function with given fields: ctx, tokenAddresses +func (_m *PriceRegistryReader) GetTokensDecimals(ctx context.Context, tokenAddresses []ccip.Address) ([]uint8, error) { + ret := _m.Called(ctx, tokenAddresses) + + if len(ret) == 0 { + panic("no return value specified for GetTokensDecimals") + } + + var r0 []uint8 + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, []ccip.Address) ([]uint8, error)); ok { + return rf(ctx, tokenAddresses) + } + if rf, ok := ret.Get(0).(func(context.Context, []ccip.Address) []uint8); ok { + r0 = rf(ctx, tokenAddresses) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]uint8) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, []ccip.Address) error); ok { + r1 = rf(ctx, tokenAddresses) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// PriceRegistryReader_GetTokensDecimals_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetTokensDecimals' +type PriceRegistryReader_GetTokensDecimals_Call struct { + *mock.Call +} + +// GetTokensDecimals is a helper method to define mock.On call +// - ctx context.Context +// - tokenAddresses []ccip.Address +func (_e *PriceRegistryReader_Expecter) GetTokensDecimals(ctx interface{}, tokenAddresses interface{}) *PriceRegistryReader_GetTokensDecimals_Call { + return &PriceRegistryReader_GetTokensDecimals_Call{Call: _e.mock.On("GetTokensDecimals", ctx, tokenAddresses)} +} + +func (_c *PriceRegistryReader_GetTokensDecimals_Call) Run(run func(ctx context.Context, tokenAddresses []ccip.Address)) *PriceRegistryReader_GetTokensDecimals_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].([]ccip.Address)) + }) + return _c +} + +func (_c *PriceRegistryReader_GetTokensDecimals_Call) Return(_a0 []uint8, _a1 error) *PriceRegistryReader_GetTokensDecimals_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *PriceRegistryReader_GetTokensDecimals_Call) RunAndReturn(run func(context.Context, []ccip.Address) ([]uint8, error)) *PriceRegistryReader_GetTokensDecimals_Call { + _c.Call.Return(run) + return _c +} + +// NewPriceRegistryReader creates a new instance of PriceRegistryReader. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewPriceRegistryReader(t interface { + mock.TestingT + Cleanup(func()) +}) *PriceRegistryReader { + mock := &PriceRegistryReader{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/mocks/token_pool_reader_mock.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/mocks/token_pool_reader_mock.go new file mode 100644 index 00000000000..0bb23b9cc23 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/mocks/token_pool_reader_mock.go @@ -0,0 +1,127 @@ +// Code generated by mockery v2.43.2. DO NOT EDIT. + +package mocks + +import ( + common "github.com/ethereum/go-ethereum/common" + mock "github.com/stretchr/testify/mock" +) + +// TokenPoolReader is an autogenerated mock type for the TokenPoolReader type +type TokenPoolReader struct { + mock.Mock +} + +type TokenPoolReader_Expecter struct { + mock *mock.Mock +} + +func (_m *TokenPoolReader) EXPECT() *TokenPoolReader_Expecter { + return &TokenPoolReader_Expecter{mock: &_m.Mock} +} + +// Address provides a mock function with given fields: +func (_m *TokenPoolReader) Address() common.Address { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Address") + } + + var r0 common.Address + if rf, ok := ret.Get(0).(func() common.Address); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Address) + } + } + + return r0 +} + +// TokenPoolReader_Address_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Address' +type TokenPoolReader_Address_Call struct { + *mock.Call +} + +// Address is a helper method to define mock.On call +func (_e *TokenPoolReader_Expecter) Address() *TokenPoolReader_Address_Call { + return &TokenPoolReader_Address_Call{Call: _e.mock.On("Address")} +} + +func (_c *TokenPoolReader_Address_Call) Run(run func()) *TokenPoolReader_Address_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *TokenPoolReader_Address_Call) Return(_a0 common.Address) *TokenPoolReader_Address_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *TokenPoolReader_Address_Call) RunAndReturn(run func() common.Address) *TokenPoolReader_Address_Call { + _c.Call.Return(run) + return _c +} + +// Type provides a mock function with given fields: +func (_m *TokenPoolReader) Type() string { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Type") + } + + var r0 string + if rf, ok := ret.Get(0).(func() string); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// TokenPoolReader_Type_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Type' +type TokenPoolReader_Type_Call struct { + *mock.Call +} + +// Type is a helper method to define mock.On call +func (_e *TokenPoolReader_Expecter) Type() *TokenPoolReader_Type_Call { + return &TokenPoolReader_Type_Call{Call: _e.mock.On("Type")} +} + +func (_c *TokenPoolReader_Type_Call) Run(run func()) *TokenPoolReader_Type_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *TokenPoolReader_Type_Call) Return(_a0 string) *TokenPoolReader_Type_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *TokenPoolReader_Type_Call) RunAndReturn(run func() string) *TokenPoolReader_Type_Call { + _c.Call.Return(run) + return _c +} + +// NewTokenPoolReader creates a new instance of TokenPoolReader. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewTokenPoolReader(t interface { + mock.TestingT + Cleanup(func()) +}) *TokenPoolReader { + mock := &TokenPoolReader{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/mocks/usdc_reader_mock.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/mocks/usdc_reader_mock.go new file mode 100644 index 00000000000..ac72d599923 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/mocks/usdc_reader_mock.go @@ -0,0 +1,97 @@ +// Code generated by mockery v2.43.2. DO NOT EDIT. + +package mocks + +import ( + context "context" + + mock "github.com/stretchr/testify/mock" +) + +// USDCReader is an autogenerated mock type for the USDCReader type +type USDCReader struct { + mock.Mock +} + +type USDCReader_Expecter struct { + mock *mock.Mock +} + +func (_m *USDCReader) EXPECT() *USDCReader_Expecter { + return &USDCReader_Expecter{mock: &_m.Mock} +} + +// GetUSDCMessagePriorToLogIndexInTx provides a mock function with given fields: ctx, logIndex, usdcTokenIndexOffset, txHash +func (_m *USDCReader) GetUSDCMessagePriorToLogIndexInTx(ctx context.Context, logIndex int64, usdcTokenIndexOffset int, txHash string) ([]byte, error) { + ret := _m.Called(ctx, logIndex, usdcTokenIndexOffset, txHash) + + if len(ret) == 0 { + panic("no return value specified for GetUSDCMessagePriorToLogIndexInTx") + } + + var r0 []byte + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, int64, int, string) ([]byte, error)); ok { + return rf(ctx, logIndex, usdcTokenIndexOffset, txHash) + } + if rf, ok := ret.Get(0).(func(context.Context, int64, int, string) []byte); ok { + r0 = rf(ctx, logIndex, usdcTokenIndexOffset, txHash) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]byte) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, int64, int, string) error); ok { + r1 = rf(ctx, logIndex, usdcTokenIndexOffset, txHash) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// USDCReader_GetUSDCMessagePriorToLogIndexInTx_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetUSDCMessagePriorToLogIndexInTx' +type USDCReader_GetUSDCMessagePriorToLogIndexInTx_Call struct { + *mock.Call +} + +// GetUSDCMessagePriorToLogIndexInTx is a helper method to define mock.On call +// - ctx context.Context +// - logIndex int64 +// - usdcTokenIndexOffset int +// - txHash string +func (_e *USDCReader_Expecter) GetUSDCMessagePriorToLogIndexInTx(ctx interface{}, logIndex interface{}, usdcTokenIndexOffset interface{}, txHash interface{}) *USDCReader_GetUSDCMessagePriorToLogIndexInTx_Call { + return &USDCReader_GetUSDCMessagePriorToLogIndexInTx_Call{Call: _e.mock.On("GetUSDCMessagePriorToLogIndexInTx", ctx, logIndex, usdcTokenIndexOffset, txHash)} +} + +func (_c *USDCReader_GetUSDCMessagePriorToLogIndexInTx_Call) Run(run func(ctx context.Context, logIndex int64, usdcTokenIndexOffset int, txHash string)) *USDCReader_GetUSDCMessagePriorToLogIndexInTx_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(int64), args[2].(int), args[3].(string)) + }) + return _c +} + +func (_c *USDCReader_GetUSDCMessagePriorToLogIndexInTx_Call) Return(_a0 []byte, _a1 error) *USDCReader_GetUSDCMessagePriorToLogIndexInTx_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *USDCReader_GetUSDCMessagePriorToLogIndexInTx_Call) RunAndReturn(run func(context.Context, int64, int, string) ([]byte, error)) *USDCReader_GetUSDCMessagePriorToLogIndexInTx_Call { + _c.Call.Return(run) + return _c +} + +// NewUSDCReader creates a new instance of USDCReader. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewUSDCReader(t interface { + mock.TestingT + Cleanup(func()) +}) *USDCReader { + mock := &USDCReader{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/offramp_reader.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/offramp_reader.go new file mode 100644 index 00000000000..c3bad6235b3 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/offramp_reader.go @@ -0,0 +1,13 @@ +package ccipdata + +import ( + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" +) + +const ( + ManuallyExecute = "manuallyExecute" +) + +type OffRampReader interface { + cciptypes.OffRampReader +} diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/offramp_reader_test.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/offramp_reader_test.go new file mode 100644 index 00000000000..f1310393207 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/offramp_reader_test.go @@ -0,0 +1,416 @@ +package ccipdata_test + +import ( + "math/big" + "math/rand" + "testing" + "time" + + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + "github.com/stretchr/testify/require" + + "github.com/smartcontractkit/chainlink-common/pkg/logger" + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" + evmclientmocks "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client/mocks" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/headtracker" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" + lpmocks "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller/mocks" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/commit_store_helper" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/evm_2_evm_offramp" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/evm_2_evm_offramp_1_0_0" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/evm_2_evm_offramp_1_2_0" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/mock_rmn_contract" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/pgtest" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/abihelpers" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipcalc" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/factory" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_0_0" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0" +) + +type offRampReaderTH struct { + user *bind.TransactOpts + reader ccipdata.OffRampReader +} + +func TestExecOnchainConfig100(t *testing.T) { + tests := []struct { + name string + want v1_0_0.ExecOnchainConfig + expectErr bool + }{ + { + name: "encodes and decodes config with all fields set", + want: v1_0_0.ExecOnchainConfig{ + PermissionLessExecutionThresholdSeconds: rand.Uint32(), + Router: utils.RandomAddress(), + PriceRegistry: utils.RandomAddress(), + MaxTokensLength: uint16(rand.Uint32()), + MaxDataSize: rand.Uint32(), + }, + }, + { + name: "encodes and fails decoding config with missing fields", + want: v1_0_0.ExecOnchainConfig{ + PermissionLessExecutionThresholdSeconds: rand.Uint32(), + MaxDataSize: rand.Uint32(), + }, + expectErr: true, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + encoded, err := abihelpers.EncodeAbiStruct(tt.want) + require.NoError(t, err) + + decoded, err := abihelpers.DecodeAbiStruct[v1_0_0.ExecOnchainConfig](encoded) + if tt.expectErr { + require.ErrorContains(t, err, "must set") + } else { + require.NoError(t, err) + require.Equal(t, tt.want, decoded) + } + }) + } +} + +func TestExecOnchainConfig120(t *testing.T) { + tests := []struct { + name string + want v1_2_0.ExecOnchainConfig + expectErr bool + }{ + { + name: "encodes and decodes config with all fields set", + want: v1_2_0.ExecOnchainConfig{ + PermissionLessExecutionThresholdSeconds: rand.Uint32(), + Router: utils.RandomAddress(), + PriceRegistry: utils.RandomAddress(), + MaxNumberOfTokensPerMsg: uint16(rand.Uint32()), + MaxDataBytes: rand.Uint32(), + MaxPoolReleaseOrMintGas: rand.Uint32(), + }, + }, + { + name: "encodes and fails decoding config with missing fields", + want: v1_2_0.ExecOnchainConfig{ + PermissionLessExecutionThresholdSeconds: rand.Uint32(), + MaxDataBytes: rand.Uint32(), + }, + expectErr: true, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + encoded, err := abihelpers.EncodeAbiStruct(tt.want) + require.NoError(t, err) + + decoded, err := abihelpers.DecodeAbiStruct[v1_2_0.ExecOnchainConfig](encoded) + if tt.expectErr { + require.ErrorContains(t, err, "must set") + } else { + require.NoError(t, err) + require.Equal(t, tt.want, decoded) + } + }) + } +} + +func TestOffRampReaderInit(t *testing.T) { + tests := []struct { + name string + version string + }{ + { + name: "OffRampReader_V1_0_0", + version: ccipdata.V1_0_0, + }, + { + name: "OffRampReader_V1_1_0", + version: ccipdata.V1_1_0, + }, + { + name: "OffRampReader_V1_2_0", + version: ccipdata.V1_2_0, + }, + { + name: "OffRampReader_V1_5_0", + version: ccipdata.V1_5_0, + }, + } + + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + th := setupOffRampReaderTH(t, test.version) + testOffRampReader(t, th) + }) + } +} + +func setupOffRampReaderTH(t *testing.T, version string) offRampReaderTH { + ctx := testutils.Context(t) + user, bc := ccipdata.NewSimulation(t) + log := logger.Test(t) + orm := logpoller.NewORM(testutils.SimulatedChainID, pgtest.NewSqlxDB(t), log) + lpOpts := logpoller.Opts{ + PollPeriod: 100 * time.Millisecond, + FinalityDepth: 2, + BackfillBatchSize: 3, + RpcBatchSize: 2, + KeepFinalizedBlocksDepth: 1000, + } + headTracker := headtracker.NewSimulatedHeadTracker(bc, lpOpts.UseFinalityTag, lpOpts.FinalityDepth) + if lpOpts.PollPeriod == 0 { + lpOpts.PollPeriod = 1 * time.Hour + } + lp := logpoller.NewLogPoller( + orm, + bc, + log, + headTracker, + lpOpts) + assert.NoError(t, orm.InsertBlock(ctx, common.Hash{}, 1, time.Now(), 1)) + // Setup offRamp. + var offRampAddress common.Address + switch version { + case ccipdata.V1_0_0: + offRampAddress = setupOffRampV1_0_0(t, user, bc) + case ccipdata.V1_1_0: + // Version 1.1.0 uses the same contracts as 1.0.0. + offRampAddress = setupOffRampV1_0_0(t, user, bc) + case ccipdata.V1_2_0: + offRampAddress = setupOffRampV1_2_0(t, user, bc) + case ccipdata.V1_5_0: + offRampAddress = setupOffRampV1_5_0(t, user, bc) + default: + require.Fail(t, "Unknown version: ", version) + } + + // Create the version-specific reader. + reader, err := factory.NewOffRampReader(log, factory.NewEvmVersionFinder(), ccipcalc.EvmAddrToGeneric(offRampAddress), bc, lp, nil, nil, true) + require.NoError(t, err) + addr, err := reader.Address(ctx) + require.NoError(t, err) + require.Equal(t, ccipcalc.EvmAddrToGeneric(offRampAddress), addr) + + return offRampReaderTH{ + user: user, + reader: reader, + } +} + +func setupOffRampV1_0_0(t *testing.T, user *bind.TransactOpts, bc *client.SimulatedBackendClient) common.Address { + onRampAddr := utils.RandomAddress() + armAddr := deployMockArm(t, user, bc) + csAddr := deployCommitStore(t, user, bc, onRampAddr, armAddr) + + // Deploy the OffRamp. + staticConfig := evm_2_evm_offramp_1_0_0.EVM2EVMOffRampStaticConfig{ + CommitStore: csAddr, + ChainSelector: testutils.SimulatedChainID.Uint64(), + SourceChainSelector: testutils.SimulatedChainID.Uint64(), + OnRamp: onRampAddr, + PrevOffRamp: common.Address{}, + ArmProxy: armAddr, + } + sourceTokens := []common.Address{} + pools := []common.Address{} + rateLimiterConfig := evm_2_evm_offramp_1_0_0.RateLimiterConfig{ + IsEnabled: false, + Capacity: big.NewInt(0), + Rate: big.NewInt(0), + } + + offRampAddr, tx, offRamp, err := evm_2_evm_offramp_1_0_0.DeployEVM2EVMOffRamp(user, bc, staticConfig, sourceTokens, pools, rateLimiterConfig) + bc.Commit() + require.NoError(t, err) + ccipdata.AssertNonRevert(t, tx, bc, user) + + // Verify the deployed OffRamp. + tav, err := offRamp.TypeAndVersion(&bind.CallOpts{ + Context: testutils.Context(t), + }) + require.NoError(t, err) + require.Equal(t, "EVM2EVMOffRamp 1.0.0", tav) + return offRampAddr +} + +func setupOffRampV1_2_0(t *testing.T, user *bind.TransactOpts, bc *client.SimulatedBackendClient) common.Address { + onRampAddr := utils.RandomAddress() + armAddr := deployMockArm(t, user, bc) + csAddr := deployCommitStore(t, user, bc, onRampAddr, armAddr) + + // Deploy the OffRamp. + staticConfig := evm_2_evm_offramp_1_2_0.EVM2EVMOffRampStaticConfig{ + CommitStore: csAddr, + ChainSelector: testutils.SimulatedChainID.Uint64(), + SourceChainSelector: testutils.SimulatedChainID.Uint64(), + OnRamp: onRampAddr, + PrevOffRamp: common.Address{}, + ArmProxy: armAddr, + } + sourceTokens := []common.Address{} + pools := []common.Address{} + rateLimiterConfig := evm_2_evm_offramp_1_2_0.RateLimiterConfig{ + IsEnabled: false, + Capacity: big.NewInt(0), + Rate: big.NewInt(0), + } + + offRampAddr, tx, offRamp, err := evm_2_evm_offramp_1_2_0.DeployEVM2EVMOffRamp(user, bc, staticConfig, sourceTokens, pools, rateLimiterConfig) + bc.Commit() + require.NoError(t, err) + ccipdata.AssertNonRevert(t, tx, bc, user) + + // Verify the deployed OffRamp. + tav, err := offRamp.TypeAndVersion(&bind.CallOpts{ + Context: testutils.Context(t), + }) + require.NoError(t, err) + require.Equal(t, "EVM2EVMOffRamp 1.2.0", tav) + return offRampAddr +} + +func setupOffRampV1_5_0(t *testing.T, user *bind.TransactOpts, bc *client.SimulatedBackendClient) common.Address { + onRampAddr := utils.RandomAddress() + tokenAdminRegAddr := utils.RandomAddress() + rmnAddr := deployMockArm(t, user, bc) + csAddr := deployCommitStore(t, user, bc, onRampAddr, rmnAddr) + + // Deploy the OffRamp. + staticConfig := evm_2_evm_offramp.EVM2EVMOffRampStaticConfig{ + CommitStore: csAddr, + ChainSelector: testutils.SimulatedChainID.Uint64(), + SourceChainSelector: testutils.SimulatedChainID.Uint64(), + OnRamp: onRampAddr, + PrevOffRamp: common.Address{}, + RmnProxy: rmnAddr, + TokenAdminRegistry: tokenAdminRegAddr, + } + rateLimiterConfig := evm_2_evm_offramp.RateLimiterConfig{ + IsEnabled: false, + Capacity: big.NewInt(0), + Rate: big.NewInt(0), + } + + offRampAddr, tx, offRamp, err := evm_2_evm_offramp.DeployEVM2EVMOffRamp(user, bc, staticConfig, rateLimiterConfig) + bc.Commit() + require.NoError(t, err) + ccipdata.AssertNonRevert(t, tx, bc, user) + + // Verify the deployed OffRamp. + tav, err := offRamp.TypeAndVersion(&bind.CallOpts{ + Context: testutils.Context(t), + }) + require.NoError(t, err) + require.Equal(t, "EVM2EVMOffRamp 1.5.0", tav) + return offRampAddr +} + +func deployMockArm( + t *testing.T, + user *bind.TransactOpts, + bc *client.SimulatedBackendClient, +) common.Address { + armAddr, tx, _, err := mock_rmn_contract.DeployMockRMNContract(user, bc) + require.NoError(t, err) + bc.Commit() + ccipdata.AssertNonRevert(t, tx, bc, user) + require.NotEqual(t, common.Address{}, armAddr) + return armAddr +} + +// Deploy the CommitStore. We use the same CommitStore version for all versions of OffRamp tested. +func deployCommitStore( + t *testing.T, + user *bind.TransactOpts, + bc *client.SimulatedBackendClient, + onRampAddress common.Address, + armAddress common.Address, +) common.Address { + // Deploy the CommitStore using the helper. + csAddr, tx, cs, err := commit_store_helper.DeployCommitStoreHelper(user, bc, commit_store_helper.CommitStoreStaticConfig{ + ChainSelector: testutils.SimulatedChainID.Uint64(), + SourceChainSelector: testutils.SimulatedChainID.Uint64(), + OnRamp: onRampAddress, + RmnProxy: armAddress, + }) + require.NoError(t, err) + bc.Commit() + ccipdata.AssertNonRevert(t, tx, bc, user) + + // Test the deployed CommitStore. + callOpts := &bind.CallOpts{ + Context: testutils.Context(t), + } + tav, err := cs.TypeAndVersion(callOpts) + require.NoError(t, err) + require.Equal(t, "CommitStore 1.5.0", tav) + return csAddr +} + +func testOffRampReader(t *testing.T, th offRampReaderTH) { + ctx := th.user.Context + tokens, err := th.reader.GetTokens(ctx) + require.NoError(t, err) + require.Equal(t, []cciptypes.Address{}, tokens.DestinationTokens) + + events, err := th.reader.GetExecutionStateChangesBetweenSeqNums(ctx, 0, 10, 0) + require.NoError(t, err) + require.Equal(t, []cciptypes.ExecutionStateChangedWithTxMeta{}, events) + + sourceToDestTokens, err := th.reader.GetSourceToDestTokensMapping(ctx) + require.NoError(t, err) + require.Empty(t, sourceToDestTokens) + + require.NoError(t, err) +} + +func TestNewOffRampReader(t *testing.T) { + var tt = []struct { + typeAndVersion string + expectedErr string + }{ + { + typeAndVersion: "blah", + expectedErr: "unable to read type and version: invalid type and version blah", + }, + { + typeAndVersion: "CommitStore 1.0.0", + expectedErr: "expected EVM2EVMOffRamp got CommitStore", + }, + { + typeAndVersion: "EVM2EVMOffRamp 1.2.0", + expectedErr: "", + }, + { + typeAndVersion: "EVM2EVMOffRamp 2.0.0", + expectedErr: "unsupported offramp version 2.0.0", + }, + } + for _, tc := range tt { + t.Run(tc.typeAndVersion, func(t *testing.T) { + b, err := utils.ABIEncode(`[{"type":"string"}]`, tc.typeAndVersion) + require.NoError(t, err) + c := evmclientmocks.NewClient(t) + c.On("CallContract", mock.Anything, mock.Anything, mock.Anything).Return(b, nil) + addr := ccipcalc.EvmAddrToGeneric(utils.RandomAddress()) + lp := lpmocks.NewLogPoller(t) + lp.On("RegisterFilter", mock.Anything, mock.Anything).Return(nil).Maybe() + _, err = factory.NewOffRampReader(logger.Test(t), factory.NewEvmVersionFinder(), addr, c, lp, nil, nil, true) + if tc.expectedErr != "" { + assert.EqualError(t, err, tc.expectedErr) + } else { + assert.NoError(t, err) + } + }) + } +} diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/onramp_reader.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/onramp_reader.go new file mode 100644 index 00000000000..e2571de57f6 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/onramp_reader.go @@ -0,0 +1,21 @@ +package ccipdata + +import ( + "github.com/ethereum/go-ethereum/core/types" + + "github.com/smartcontractkit/chainlink-common/pkg/hashutil" + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" +) + +type LeafHasherInterface[H hashutil.Hash] interface { + HashLeaf(log types.Log) (H, error) +} + +const ( + COMMIT_CCIP_SENDS = "Commit ccip sends" + CONFIG_CHANGED = "Dynamic config changed" +) + +type OnRampReader interface { + cciptypes.OnRampReader +} diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/onramp_reader_test.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/onramp_reader_test.go new file mode 100644 index 00000000000..85aea6ab995 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/onramp_reader_test.go @@ -0,0 +1,478 @@ +package ccipdata_test + +import ( + "fmt" + "math/big" + "testing" + "time" + + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + "github.com/stretchr/testify/require" + + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + + "github.com/smartcontractkit/chainlink-common/pkg/logger" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" + evmclientmocks "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client/mocks" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/headtracker" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" + lpmocks "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller/mocks" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/evm_2_evm_onramp" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/evm_2_evm_onramp_1_0_0" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/evm_2_evm_onramp_1_1_0" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/evm_2_evm_onramp_1_2_0" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/pgtest" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipcalc" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/factory" +) + +type onRampReaderTH struct { + user *bind.TransactOpts + reader ccipdata.OnRampReader +} + +func TestNewOnRampReader_noContractAtAddress(t *testing.T) { + _, bc := ccipdata.NewSimulation(t) + addr := ccipcalc.EvmAddrToGeneric(utils.RandomAddress()) + _, err := factory.NewOnRampReader(logger.Test(t), factory.NewEvmVersionFinder(), testutils.SimulatedChainID.Uint64(), testutils.SimulatedChainID.Uint64(), addr, lpmocks.NewLogPoller(t), bc) + assert.EqualError(t, err, fmt.Sprintf("unable to read type and version: error calling typeAndVersion on addr: %s no contract code at given address", addr)) +} + +func TestOnRampReaderInit(t *testing.T) { + tests := []struct { + name string + version string + }{ + { + name: "OnRampReader_V1_0_0", + version: ccipdata.V1_0_0, + }, + { + name: "OnRampReader_V1_1_0", + version: ccipdata.V1_1_0, + }, + { + name: "OnRampReader_V1_2_0", + version: ccipdata.V1_2_0, + }, + { + name: "OnRampReader_V1_5_0", + version: ccipdata.V1_5_0, + }, + } + + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + th := setupOnRampReaderTH(t, test.version) + testVersionSpecificOnRampReader(t, th, test.version) + }) + } +} + +func setupOnRampReaderTH(t *testing.T, version string) onRampReaderTH { + user, bc := ccipdata.NewSimulation(t) + log := logger.Test(t) + orm := logpoller.NewORM(testutils.SimulatedChainID, pgtest.NewSqlxDB(t), log) + lpOpts := logpoller.Opts{ + PollPeriod: 100 * time.Millisecond, + FinalityDepth: 2, + BackfillBatchSize: 3, + RpcBatchSize: 2, + KeepFinalizedBlocksDepth: 1000, + } + headTracker := headtracker.NewSimulatedHeadTracker(bc, lpOpts.UseFinalityTag, lpOpts.FinalityDepth) + if lpOpts.PollPeriod == 0 { + lpOpts.PollPeriod = 1 * time.Hour + } + lp := logpoller.NewLogPoller( + orm, + bc, + log, + headTracker, + lpOpts) + + // Setup onRamp. + var onRampAddress common.Address + switch version { + case ccipdata.V1_0_0: + onRampAddress = setupOnRampV1_0_0(t, user, bc) + case ccipdata.V1_1_0: + onRampAddress = setupOnRampV1_1_0(t, user, bc) + case ccipdata.V1_2_0: + onRampAddress = setupOnRampV1_2_0(t, user, bc) + case ccipdata.V1_5_0: + onRampAddress = setupOnRampV1_5_0(t, user, bc) + default: + require.Fail(t, "Unknown version: ", version) + } + + // Create the version-specific reader. + reader, err := factory.NewOnRampReader(log, factory.NewEvmVersionFinder(), testutils.SimulatedChainID.Uint64(), testutils.SimulatedChainID.Uint64(), ccipcalc.EvmAddrToGeneric(onRampAddress), lp, bc) + require.NoError(t, err) + + return onRampReaderTH{ + user: user, + reader: reader, + } +} + +func setupOnRampV1_0_0(t *testing.T, user *bind.TransactOpts, bc *client.SimulatedBackendClient) common.Address { + linkTokenAddress := common.HexToAddress("0x000011") + staticConfig := evm_2_evm_onramp_1_0_0.EVM2EVMOnRampStaticConfig{ + LinkToken: linkTokenAddress, + ChainSelector: testutils.SimulatedChainID.Uint64(), + DestChainSelector: testutils.SimulatedChainID.Uint64(), + DefaultTxGasLimit: 30000, + MaxNopFeesJuels: big.NewInt(1000000), + PrevOnRamp: common.Address{}, + ArmProxy: utils.RandomAddress(), + } + dynamicConfig := evm_2_evm_onramp_1_0_0.EVM2EVMOnRampDynamicConfig{ + Router: common.HexToAddress("0x000100"), + MaxTokensLength: 4, + PriceRegistry: utils.RandomAddress(), + MaxDataSize: 100000, + MaxGasLimit: 100000, + } + rateLimiterConfig := evm_2_evm_onramp_1_0_0.RateLimiterConfig{ + IsEnabled: false, + Capacity: big.NewInt(5), + Rate: big.NewInt(5), + } + allowList := []common.Address{user.From} + feeTokenConfigs := []evm_2_evm_onramp_1_0_0.EVM2EVMOnRampFeeTokenConfigArgs{ + { + Token: linkTokenAddress, + GasMultiplier: 1, + NetworkFeeAmountUSD: big.NewInt(0), + DestGasOverhead: 50, + DestGasPerPayloadByte: 60, + Enabled: false, + }, + } + tokenTransferConfigArgs := []evm_2_evm_onramp_1_0_0.EVM2EVMOnRampTokenTransferFeeConfigArgs{ + { + Token: utils.RandomAddress(), + MinFee: 10, + MaxFee: 1000, + Ratio: 1, + }, + } + nopsAndWeights := []evm_2_evm_onramp_1_0_0.EVM2EVMOnRampNopAndWeight{ + { + Nop: utils.RandomAddress(), + Weight: 1, + }, + } + tokenAndPool := []evm_2_evm_onramp_1_0_0.InternalPoolUpdate{} + onRampAddress, transaction, _, err := evm_2_evm_onramp_1_0_0.DeployEVM2EVMOnRamp( + user, + bc, + staticConfig, + dynamicConfig, + tokenAndPool, + allowList, + rateLimiterConfig, + feeTokenConfigs, + tokenTransferConfigArgs, + nopsAndWeights, + ) + bc.Commit() + require.NoError(t, err) + ccipdata.AssertNonRevert(t, transaction, bc, user) + return onRampAddress +} + +func setupOnRampV1_1_0(t *testing.T, user *bind.TransactOpts, bc *client.SimulatedBackendClient) common.Address { + linkTokenAddress := common.HexToAddress("0x000011") + staticConfig := evm_2_evm_onramp_1_1_0.EVM2EVMOnRampStaticConfig{ + LinkToken: linkTokenAddress, + ChainSelector: testutils.SimulatedChainID.Uint64(), + DestChainSelector: testutils.SimulatedChainID.Uint64(), + DefaultTxGasLimit: 30000, + MaxNopFeesJuels: big.NewInt(1000000), + PrevOnRamp: common.Address{}, + ArmProxy: utils.RandomAddress(), + } + dynamicConfig := evm_2_evm_onramp_1_1_0.EVM2EVMOnRampDynamicConfig{ + Router: common.HexToAddress("0x000110"), + MaxTokensLength: 4, + PriceRegistry: common.HexToAddress("0x000066"), + MaxDataSize: 100000, + MaxGasLimit: 100000, + } + rateLimiterConfig := evm_2_evm_onramp_1_1_0.RateLimiterConfig{ + IsEnabled: false, + Capacity: big.NewInt(5), + Rate: big.NewInt(5), + } + allowList := []common.Address{user.From} + feeTokenConfigs := []evm_2_evm_onramp_1_1_0.EVM2EVMOnRampFeeTokenConfigArgs{ + { + Token: linkTokenAddress, + NetworkFeeUSD: 0, + MinTokenTransferFeeUSD: 0, + MaxTokenTransferFeeUSD: 0, + GasMultiplier: 0, + PremiumMultiplier: 0, + Enabled: false, + }, + } + tokenTransferConfigArgs := []evm_2_evm_onramp_1_1_0.EVM2EVMOnRampTokenTransferFeeConfigArgs{ + { + Token: linkTokenAddress, + Ratio: 0, + DestGasOverhead: 0, + }, + } + nopsAndWeights := []evm_2_evm_onramp_1_1_0.EVM2EVMOnRampNopAndWeight{ + { + Nop: common.HexToAddress("0x222222222"), + Weight: 1, + }, + } + tokenAndPool := []evm_2_evm_onramp_1_1_0.InternalPoolUpdate{} + onRampAddress, transaction, _, err := evm_2_evm_onramp_1_1_0.DeployEVM2EVMOnRamp( + user, + bc, + staticConfig, + dynamicConfig, + tokenAndPool, + allowList, + rateLimiterConfig, + feeTokenConfigs, + tokenTransferConfigArgs, + nopsAndWeights, + ) + bc.Commit() + require.NoError(t, err) + ccipdata.AssertNonRevert(t, transaction, bc, user) + return onRampAddress +} + +func setupOnRampV1_2_0(t *testing.T, user *bind.TransactOpts, bc *client.SimulatedBackendClient) common.Address { + linkTokenAddress := common.HexToAddress("0x000011") + staticConfig := evm_2_evm_onramp_1_2_0.EVM2EVMOnRampStaticConfig{ + LinkToken: linkTokenAddress, + ChainSelector: testutils.SimulatedChainID.Uint64(), + DestChainSelector: testutils.SimulatedChainID.Uint64(), + DefaultTxGasLimit: 30000, + MaxNopFeesJuels: big.NewInt(1000000), + PrevOnRamp: common.Address{}, + ArmProxy: utils.RandomAddress(), + } + dynamicConfig := evm_2_evm_onramp_1_2_0.EVM2EVMOnRampDynamicConfig{ + Router: common.HexToAddress("0x0000000000000000000000000000000000000120"), + MaxNumberOfTokensPerMsg: 0, + DestGasOverhead: 0, + DestGasPerPayloadByte: 0, + DestDataAvailabilityOverheadGas: 0, + DestGasPerDataAvailabilityByte: 0, + DestDataAvailabilityMultiplierBps: 0, + PriceRegistry: utils.RandomAddress(), + MaxDataBytes: 0, + MaxPerMsgGasLimit: 0, + } + rateLimiterConfig := evm_2_evm_onramp_1_2_0.RateLimiterConfig{ + IsEnabled: false, + Capacity: big.NewInt(5), + Rate: big.NewInt(5), + } + feeTokenConfigs := []evm_2_evm_onramp_1_2_0.EVM2EVMOnRampFeeTokenConfigArgs{ + { + Token: linkTokenAddress, + NetworkFeeUSDCents: 0, + GasMultiplierWeiPerEth: 0, + PremiumMultiplierWeiPerEth: 0, + Enabled: false, + }, + } + tokenTransferConfigArgs := []evm_2_evm_onramp_1_2_0.EVM2EVMOnRampTokenTransferFeeConfigArgs{ + { + Token: linkTokenAddress, + MinFeeUSDCents: 0, + MaxFeeUSDCents: 0, + DeciBps: 0, + DestGasOverhead: 0, + DestBytesOverhead: 0, + }, + } + nopsAndWeights := []evm_2_evm_onramp_1_2_0.EVM2EVMOnRampNopAndWeight{ + { + Nop: utils.RandomAddress(), + Weight: 1, + }, + } + tokenAndPool := []evm_2_evm_onramp_1_2_0.InternalPoolUpdate{} + onRampAddress, transaction, _, err := evm_2_evm_onramp_1_2_0.DeployEVM2EVMOnRamp( + user, + bc, + staticConfig, + dynamicConfig, + tokenAndPool, + rateLimiterConfig, + feeTokenConfigs, + tokenTransferConfigArgs, + nopsAndWeights, + ) + bc.Commit() + require.NoError(t, err) + ccipdata.AssertNonRevert(t, transaction, bc, user) + return onRampAddress +} + +func setupOnRampV1_5_0(t *testing.T, user *bind.TransactOpts, bc *client.SimulatedBackendClient) common.Address { + linkTokenAddress := common.HexToAddress("0x000011") + staticConfig := evm_2_evm_onramp.EVM2EVMOnRampStaticConfig{ + LinkToken: linkTokenAddress, + ChainSelector: testutils.SimulatedChainID.Uint64(), + DestChainSelector: testutils.SimulatedChainID.Uint64(), + DefaultTxGasLimit: 30000, + MaxNopFeesJuels: big.NewInt(1000000), + PrevOnRamp: common.Address{}, + RmnProxy: utils.RandomAddress(), + TokenAdminRegistry: utils.RandomAddress(), + } + dynamicConfig := evm_2_evm_onramp.EVM2EVMOnRampDynamicConfig{ + Router: common.HexToAddress("0x0000000000000000000000000000000000000150"), + MaxNumberOfTokensPerMsg: 0, + DestGasOverhead: 0, + DestGasPerPayloadByte: 0, + DestDataAvailabilityOverheadGas: 0, + DestGasPerDataAvailabilityByte: 0, + DestDataAvailabilityMultiplierBps: 0, + PriceRegistry: utils.RandomAddress(), + MaxDataBytes: 0, + MaxPerMsgGasLimit: 0, + DefaultTokenFeeUSDCents: 50, + DefaultTokenDestGasOverhead: 125_000, + } + rateLimiterConfig := evm_2_evm_onramp.RateLimiterConfig{ + IsEnabled: false, + Capacity: big.NewInt(5), + Rate: big.NewInt(5), + } + feeTokenConfigs := []evm_2_evm_onramp.EVM2EVMOnRampFeeTokenConfigArgs{ + { + Token: linkTokenAddress, + NetworkFeeUSDCents: 0, + GasMultiplierWeiPerEth: 0, + PremiumMultiplierWeiPerEth: 0, + Enabled: false, + }, + } + tokenTransferConfigArgs := []evm_2_evm_onramp.EVM2EVMOnRampTokenTransferFeeConfigArgs{ + { + Token: linkTokenAddress, + MinFeeUSDCents: 0, + MaxFeeUSDCents: 0, + DeciBps: 0, + DestGasOverhead: 0, + DestBytesOverhead: 64, + AggregateRateLimitEnabled: true, + }, + } + nopsAndWeights := []evm_2_evm_onramp.EVM2EVMOnRampNopAndWeight{ + { + Nop: utils.RandomAddress(), + Weight: 1, + }, + } + onRampAddress, transaction, _, err := evm_2_evm_onramp.DeployEVM2EVMOnRamp( + user, + bc, + staticConfig, + dynamicConfig, + rateLimiterConfig, + feeTokenConfigs, + tokenTransferConfigArgs, + nopsAndWeights, + ) + bc.Commit() + require.NoError(t, err) + ccipdata.AssertNonRevert(t, transaction, bc, user) + return onRampAddress +} + +func testVersionSpecificOnRampReader(t *testing.T, th onRampReaderTH, version string) { + switch version { + case ccipdata.V1_0_0: + testOnRampReader(t, th, common.HexToAddress("0x0000000000000000000000000000000000000100")) + case ccipdata.V1_1_0: + testOnRampReader(t, th, common.HexToAddress("0x0000000000000000000000000000000000000110")) + case ccipdata.V1_2_0: + testOnRampReader(t, th, common.HexToAddress("0x0000000000000000000000000000000000000120")) + case ccipdata.V1_5_0: + testOnRampReader(t, th, common.HexToAddress("0x0000000000000000000000000000000000000150")) + default: + require.Fail(t, "Unknown version: ", version) + } +} + +func testOnRampReader(t *testing.T, th onRampReaderTH, expectedRouterAddress common.Address) { + ctx := th.user.Context + res, err := th.reader.RouterAddress(ctx) + require.NoError(t, err) + require.Equal(t, ccipcalc.EvmAddrToGeneric(expectedRouterAddress), res) + + msg, err := th.reader.GetSendRequestsBetweenSeqNums(ctx, 0, 10, true) + require.NoError(t, err) + require.NotNil(t, msg) + require.Equal(t, []cciptypes.EVM2EVMMessageWithTxMeta{}, msg) + + address, err := th.reader.Address(ctx) + require.NoError(t, err) + require.NotNil(t, address) + + cfg, err := th.reader.GetDynamicConfig(ctx) + require.NoError(t, err) + require.NotNil(t, cfg) + require.Equal(t, ccipcalc.EvmAddrToGeneric(expectedRouterAddress), cfg.Router) +} + +func TestNewOnRampReader(t *testing.T) { + var tt = []struct { + typeAndVersion string + expectedErr string + }{ + { + typeAndVersion: "blah", + expectedErr: "unable to read type and version: invalid type and version blah", + }, + { + typeAndVersion: "EVM2EVMOffRamp 1.0.0", + expectedErr: "expected EVM2EVMOnRamp got EVM2EVMOffRamp", + }, + { + typeAndVersion: "EVM2EVMOnRamp 1.2.0", + expectedErr: "", + }, + { + typeAndVersion: "EVM2EVMOnRamp 2.0.0", + expectedErr: "unsupported onramp version 2.0.0", + }, + } + for _, tc := range tt { + t.Run(tc.typeAndVersion, func(t *testing.T) { + b, err := utils.ABIEncode(`[{"type":"string"}]`, tc.typeAndVersion) + require.NoError(t, err) + c := evmclientmocks.NewClient(t) + c.On("CallContract", mock.Anything, mock.Anything, mock.Anything).Return(b, nil) + addr := ccipcalc.EvmAddrToGeneric(utils.RandomAddress()) + lp := lpmocks.NewLogPoller(t) + lp.On("RegisterFilter", mock.Anything, mock.Anything).Return(nil).Maybe() + _, err = factory.NewOnRampReader(logger.Test(t), factory.NewEvmVersionFinder(), 1, 2, addr, lp, c) + if tc.expectedErr != "" { + require.EqualError(t, err, tc.expectedErr) + } else { + require.NoError(t, err) + } + }) + } +} diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/price_registry_reader.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/price_registry_reader.go new file mode 100644 index 00000000000..02aef5e9efc --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/price_registry_reader.go @@ -0,0 +1,14 @@ +package ccipdata + +import cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + +const ( + COMMIT_PRICE_UPDATES = "Commit price updates" + FEE_TOKEN_ADDED = "Fee token added" + FEE_TOKEN_REMOVED = "Fee token removed" + ExecPluginLabel = "exec" +) + +type PriceRegistryReader interface { + cciptypes.PriceRegistryReader +} diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/price_registry_reader_test.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/price_registry_reader_test.go new file mode 100644 index 00000000000..9ace6ea4819 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/price_registry_reader_test.go @@ -0,0 +1,296 @@ +package ccipdata_test + +import ( + "context" + "math/big" + "reflect" + "testing" + "time" + + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/accounts/abi/bind/backends" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + "github.com/stretchr/testify/require" + + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + + "github.com/smartcontractkit/chainlink-common/pkg/logger" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" + evmclientmocks "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client/mocks" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/headtracker" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" + lpmocks "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller/mocks" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/price_registry_1_0_0" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/price_registry_1_2_0" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/pgtest" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipcalc" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/factory" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_0_0" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0" +) + +type priceRegReaderTH struct { + lp logpoller.LogPollerTest + ec client.Client + lggr logger.Logger + user *bind.TransactOpts + readers map[string]ccipdata.PriceRegistryReader + + // Expected state + blockTs []uint64 + expectedFeeTokens []common.Address + expectedGasUpdates map[uint64][]cciptypes.GasPrice + expectedTokenUpdates map[uint64][]cciptypes.TokenPrice + destSelectors []uint64 +} + +func commitAndGetBlockTs(ec *client.SimulatedBackendClient) uint64 { + h := ec.Commit() + b, _ := ec.BlockByHash(context.Background(), h) + return b.Time() +} + +func newSim(t *testing.T) (*bind.TransactOpts, *client.SimulatedBackendClient) { + user := testutils.MustNewSimTransactor(t) + sim := backends.NewSimulatedBackend(map[common.Address]core.GenesisAccount{ + user.From: { + Balance: big.NewInt(0).Mul(big.NewInt(10), big.NewInt(1e18)), + }, + }, 10e6) + ec := client.NewSimulatedBackendClient(t, sim, testutils.SimulatedChainID) + return user, ec +} + +// setupPriceRegistryReaderTH instantiates all versions of the price registry reader +// with a snapshot of data so reader tests can do multi-version assertions. +func setupPriceRegistryReaderTH(t *testing.T) priceRegReaderTH { + user, ec := newSim(t) + lggr := logger.Test(t) + lpOpts := logpoller.Opts{ + PollPeriod: 100 * time.Millisecond, + FinalityDepth: 2, + BackfillBatchSize: 3, + RpcBatchSize: 2, + KeepFinalizedBlocksDepth: 1000, + } + headTracker := headtracker.NewSimulatedHeadTracker(ec, lpOpts.UseFinalityTag, lpOpts.FinalityDepth) + if lpOpts.PollPeriod == 0 { + lpOpts.PollPeriod = 1 * time.Hour + } + // TODO: We should be able to use an in memory log poller ORM here to speed up the tests. + lp := logpoller.NewLogPoller(logpoller.NewORM(testutils.SimulatedChainID, pgtest.NewSqlxDB(t), lggr), ec, lggr, headTracker, lpOpts) + + feeTokens := []common.Address{utils.RandomAddress(), utils.RandomAddress()} + dest1 := uint64(10) + dest2 := uint64(11) + gasPriceUpdatesBlock1 := []cciptypes.GasPrice{ + { + DestChainSelector: dest1, + Value: big.NewInt(11), + }, + } + gasPriceUpdatesBlock2 := []cciptypes.GasPrice{ + { + DestChainSelector: dest1, // Reset same gas price + Value: big.NewInt(12), // Intentionally different from block1 + }, + { + DestChainSelector: dest2, // Set gas price for different chain + Value: big.NewInt(12), + }, + } + token1 := ccipcalc.EvmAddrToGeneric(utils.RandomAddress()) + token2 := ccipcalc.EvmAddrToGeneric(utils.RandomAddress()) + tokenPriceUpdatesBlock1 := []cciptypes.TokenPrice{ + { + Token: token1, + Value: big.NewInt(12), + }, + } + tokenPriceUpdatesBlock2 := []cciptypes.TokenPrice{ + { + Token: token1, + Value: big.NewInt(13), // Intentionally change token1 value + }, + { + Token: token2, + Value: big.NewInt(12), // Intentionally set a same value different token + }, + } + ctx := testutils.Context(t) + addr, _, _, err := price_registry_1_0_0.DeployPriceRegistry(user, ec, nil, feeTokens, 1000) + require.NoError(t, err) + addr2, _, _, err := price_registry_1_2_0.DeployPriceRegistry(user, ec, nil, feeTokens, 1000) + require.NoError(t, err) + commitAndGetBlockTs(ec) // Deploy these + pr10r, err := factory.NewPriceRegistryReader(ctx, lggr, factory.NewEvmVersionFinder(), ccipcalc.EvmAddrToGeneric(addr), lp, ec) + require.NoError(t, err) + assert.Equal(t, reflect.TypeOf(pr10r).String(), reflect.TypeOf(&v1_0_0.PriceRegistry{}).String()) + pr12r, err := factory.NewPriceRegistryReader(ctx, lggr, factory.NewEvmVersionFinder(), ccipcalc.EvmAddrToGeneric(addr2), lp, ec) + require.NoError(t, err) + assert.Equal(t, reflect.TypeOf(pr12r).String(), reflect.TypeOf(&v1_2_0.PriceRegistry{}).String()) + // Apply block1. + v1_0_0.ApplyPriceRegistryUpdate(t, user, addr, ec, gasPriceUpdatesBlock1, tokenPriceUpdatesBlock1) + v1_2_0.ApplyPriceRegistryUpdate(t, user, addr2, ec, gasPriceUpdatesBlock1, tokenPriceUpdatesBlock1) + b1 := commitAndGetBlockTs(ec) + // Apply block2 + v1_0_0.ApplyPriceRegistryUpdate(t, user, addr, ec, gasPriceUpdatesBlock2, tokenPriceUpdatesBlock2) + v1_2_0.ApplyPriceRegistryUpdate(t, user, addr2, ec, gasPriceUpdatesBlock2, tokenPriceUpdatesBlock2) + b2 := commitAndGetBlockTs(ec) + + // Capture all lp data. + lp.PollAndSaveLogs(context.Background(), 1) + + return priceRegReaderTH{ + lp: lp, + ec: ec, + lggr: lggr, + user: user, + readers: map[string]ccipdata.PriceRegistryReader{ + ccipdata.V1_0_0: pr10r, ccipdata.V1_2_0: pr12r, + }, + expectedFeeTokens: feeTokens, + expectedGasUpdates: map[uint64][]cciptypes.GasPrice{ + b1: gasPriceUpdatesBlock1, + b2: gasPriceUpdatesBlock2, + }, + expectedTokenUpdates: map[uint64][]cciptypes.TokenPrice{ + b1: tokenPriceUpdatesBlock1, + b2: tokenPriceUpdatesBlock2, + }, + blockTs: []uint64{b1, b2}, + destSelectors: []uint64{dest1, dest2}, + } +} + +func testPriceRegistryReader(t *testing.T, th priceRegReaderTH, pr ccipdata.PriceRegistryReader) { + // Assert have expected fee tokens. + gotFeeTokens, err := pr.GetFeeTokens(context.Background()) + require.NoError(t, err) + evmAddrs, err := ccipcalc.GenericAddrsToEvm(gotFeeTokens...) + require.NoError(t, err) + assert.Equal(t, th.expectedFeeTokens, evmAddrs) + + // Note unsupported chain selector simply returns an empty set not an error + gasUpdates, err := pr.GetGasPriceUpdatesCreatedAfter(context.Background(), 1e6, time.Unix(0, 0), 0) + require.NoError(t, err) + assert.Len(t, gasUpdates, 0) + + for i, ts := range th.blockTs { + // Should see all updates >= ts. + var expectedGas []cciptypes.GasPrice + var expectedDest0Gas []cciptypes.GasPrice + var expectedToken []cciptypes.TokenPrice + for j := i; j < len(th.blockTs); j++ { + expectedGas = append(expectedGas, th.expectedGasUpdates[th.blockTs[j]]...) + for _, g := range th.expectedGasUpdates[th.blockTs[j]] { + if g.DestChainSelector == th.destSelectors[0] { + expectedDest0Gas = append(expectedDest0Gas, g) + } + } + expectedToken = append(expectedToken, th.expectedTokenUpdates[th.blockTs[j]]...) + } + gasUpdates, err = pr.GetAllGasPriceUpdatesCreatedAfter(context.Background(), time.Unix(int64(ts-1), 0), 0) + require.NoError(t, err) + assert.Len(t, gasUpdates, len(expectedGas)) + + gasUpdates, err = pr.GetGasPriceUpdatesCreatedAfter(context.Background(), th.destSelectors[0], time.Unix(int64(ts-1), 0), 0) + require.NoError(t, err) + assert.Len(t, gasUpdates, len(expectedDest0Gas)) + + tokenUpdates, err2 := pr.GetTokenPriceUpdatesCreatedAfter(context.Background(), time.Unix(int64(ts-1), 0), 0) + require.NoError(t, err2) + assert.Len(t, tokenUpdates, len(expectedToken)) + } + + // Empty token set should return empty set no error. + gotEmpty, err := pr.GetTokenPrices(context.Background(), []cciptypes.Address{}) + require.NoError(t, err) + assert.Len(t, gotEmpty, 0) + + // We expect latest token prices to apply + allTokenUpdates, err := pr.GetTokenPriceUpdatesCreatedAfter(context.Background(), time.Unix(0, 0), 0) + require.NoError(t, err) + // Build latest map + latest := make(map[cciptypes.Address]*big.Int) + // Comes back in ascending order (oldest first) + var allTokens []cciptypes.Address + for i := len(allTokenUpdates) - 1; i >= 0; i-- { + assert.NoError(t, err) + _, have := latest[allTokenUpdates[i].Token] + if have { + continue + } + latest[allTokenUpdates[i].Token] = allTokenUpdates[i].Value + allTokens = append(allTokens, allTokenUpdates[i].Token) + } + tokenPrices, err := pr.GetTokenPrices(context.Background(), allTokens) + require.NoError(t, err) + require.Len(t, tokenPrices, len(allTokens)) + for _, p := range tokenPrices { + assert.Equal(t, p.Value, latest[p.Token]) + } +} + +func TestPriceRegistryReader(t *testing.T) { + th := setupPriceRegistryReaderTH(t) + // Assert all readers produce the same expected results. + for version, pr := range th.readers { + pr := pr + t.Run("PriceRegistryReader"+version, func(t *testing.T) { + testPriceRegistryReader(t, th, pr) + }) + } +} + +func TestNewPriceRegistryReader(t *testing.T) { + var tt = []struct { + typeAndVersion string + expectedErr string + }{ + { + typeAndVersion: "blah", + expectedErr: "unable to read type and version: invalid type and version blah", + }, + { + typeAndVersion: "EVM2EVMOffRamp 1.0.0", + expectedErr: "expected PriceRegistry got EVM2EVMOffRamp", + }, + { + typeAndVersion: "PriceRegistry 1.2.0", + expectedErr: "", + }, + { + typeAndVersion: "PriceRegistry 1.6.0-dev", + expectedErr: "", + }, + { + typeAndVersion: "PriceRegistry 2.0.0", + expectedErr: "unsupported price registry version 2.0.0", + }, + } + ctx := testutils.Context(t) + for _, tc := range tt { + t.Run(tc.typeAndVersion, func(t *testing.T) { + b, err := utils.ABIEncode(`[{"type":"string"}]`, tc.typeAndVersion) + require.NoError(t, err) + c := evmclientmocks.NewClient(t) + c.On("CallContract", mock.Anything, mock.Anything, mock.Anything).Return(b, nil) + addr := ccipcalc.EvmAddrToGeneric(utils.RandomAddress()) + lp := lpmocks.NewLogPoller(t) + lp.On("RegisterFilter", mock.Anything, mock.Anything).Return(nil).Maybe() + _, err = factory.NewPriceRegistryReader(ctx, logger.Test(t), factory.NewEvmVersionFinder(), addr, lp, c) + if tc.expectedErr != "" { + require.EqualError(t, err, tc.expectedErr) + } else { + require.NoError(t, err) + } + }) + } +} diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/reader.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/reader.go new file mode 100644 index 00000000000..3c82948b892 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/reader.go @@ -0,0 +1,79 @@ +package ccipdata + +import ( + "fmt" + "time" + + "github.com/ethereum/go-ethereum/core/types" + + "github.com/smartcontractkit/chainlink-common/pkg/logger" + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" + evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" +) + +const ( + V1_0_0 = "1.0.0" + V1_1_0 = "1.1.0" + V1_2_0 = "1.2.0" + V1_4_0 = "1.4.0" + V1_5_0 = "1.5.0" + V1_6_0 = "1.6.0-dev" +) + +const ( + // CommitExecLogsRetention defines the duration for which logs critical for Commit/Exec plugins processing are retained. + // Although Exec relies on permissionlessExecThreshold which is lower than 24hours for picking eligible CommitRoots, + // Commit still can reach to older logs because it filters them by sequence numbers. For instance, in case of RMN curse on chain, + // we might have logs waiting in OnRamp to be committed first. When outage takes days we still would + // be able to bring back processing without replaying any logs from chain. You can read that param as + // "how long CCIP can be down and still be able to process all the messages after getting back to life". + // Breaching this threshold would require replaying chain using LogPoller from the beginning of the outage. + CommitExecLogsRetention = 30 * 24 * time.Hour // 30 days + // CacheEvictionLogsRetention defines the duration for which logs used for caching on-chain data are kept. + // Restarting node clears the cache entirely and rebuilds it from scratch by fetching data from chain, + // so we don't need to keep these logs for very long. All events relying on cache.NewLogpollerEventsBased should use this retention. + CacheEvictionLogsRetention = 7 * 24 * time.Hour // 7 days + // PriceUpdatesLogsRetention defines the duration for which logs with price updates are kept. + // These logs are emitted whenever the token price or gas price is updated and Commit scans very small time windows (e.g. 2 hours) + PriceUpdatesLogsRetention = 1 * 24 * time.Hour // 1 day +) + +type Event[T any] struct { + Data T + cciptypes.TxMeta +} + +func LogsConfirmations(finalized bool) evmtypes.Confirmations { + if finalized { + return evmtypes.Finalized + } + return evmtypes.Unconfirmed +} + +func ParseLogs[T any](logs []logpoller.Log, lggr logger.Logger, parseFunc func(log types.Log) (*T, error)) ([]Event[T], error) { + reqs := make([]Event[T], 0, len(logs)) + + for _, log := range logs { + data, err := parseFunc(log.ToGethLog()) + if err != nil { + lggr.Errorw("Unable to parse log", "err", err) + continue + } + reqs = append(reqs, Event[T]{ + Data: *data, + TxMeta: cciptypes.TxMeta{ + BlockTimestampUnixMilli: log.BlockTimestamp.UnixMilli(), + BlockNumber: uint64(log.BlockNumber), + TxHash: log.TxHash.String(), + LogIndex: uint64(log.LogIndex), + }, + }) + } + + if len(logs) != len(reqs) { + return nil, fmt.Errorf("%d logs were not parsed", len(logs)-len(reqs)) + } + return reqs, nil +} diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/reader_test.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/reader_test.go new file mode 100644 index 00000000000..0df76873915 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/reader_test.go @@ -0,0 +1,73 @@ +package ccipdata + +import ( + "fmt" + "testing" + "time" + + "github.com/ethereum/go-ethereum/core/types" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "go.uber.org/zap/zapcore" + + "github.com/smartcontractkit/chainlink-common/pkg/logger" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" +) + +func Test_parseLogs(t *testing.T) { + // generate 100 logs + logs := make([]logpoller.Log, 100) + for i := range logs { + logs[i].LogIndex = int64(i + 1) + logs[i].BlockNumber = int64(i) * 1000 + logs[i].BlockTimestamp = time.Now() + } + + parseFn := func(log types.Log) (*uint, error) { + return &log.Index, nil + } + + parsedEvents, err := ParseLogs[uint](logs, logger.Test(t), parseFn) + require.NoError(t, err) + assert.Len(t, parsedEvents, 100) + + // Make sure everything is parsed according to the parse func + for i, ev := range parsedEvents { + assert.Equal(t, i+1, int(ev.Data)) + assert.Equal(t, i*1000, int(ev.BlockNumber)) + assert.Greater(t, ev.BlockTimestampUnixMilli, time.Now().Add(-time.Minute).UnixMilli()) + } +} + +func Test_parseLogs_withErrors(t *testing.T) { + // generate 50 valid logs and 50 errors + actualErrorCount := 50 + logs := make([]logpoller.Log, actualErrorCount*2) + for i := range logs { + logs[i].LogIndex = int64(i + 1) + } + + // return an error for half of the logs. + parseFn := func(log types.Log) (*uint, error) { + if log.Index%2 == 0 { + return nil, fmt.Errorf("cannot parse %d", log.Index) + } + return &log.Index, nil + } + + log, observed := logger.TestObserved(t, zapcore.DebugLevel) + parsedEvents, err := ParseLogs[uint](logs, log, parseFn) + assert.ErrorContains(t, err, fmt.Sprintf("%d logs were not parsed", len(logs)/2)) + assert.Nil(t, parsedEvents, "No events are returned if there was an error.") + + // logs are written for errors. + require.Equal(t, actualErrorCount, observed.Len(), "Expect 51 warnings: one for each error and a summary.") + for i, entry := range observed.All() { + assert.Equal(t, zapcore.ErrorLevel, entry.Level) + assert.Contains(t, entry.Message, "Unable to parse log") + contextMap := entry.ContextMap() + require.Contains(t, contextMap, "err") + assert.Contains(t, contextMap["err"], fmt.Sprintf("cannot parse %d", (i+1)*2), "each error should be logged as a warning") + } +} diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/retry_config.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/retry_config.go new file mode 100644 index 00000000000..41161ee9388 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/retry_config.go @@ -0,0 +1,9 @@ +package ccipdata + +import "time" + +// RetryConfig configures an initial delay between retries and a max delay between retries +type RetryConfig struct { + InitialDelay time.Duration + MaxDelay time.Duration +} diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/test_utils.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/test_utils.go new file mode 100644 index 00000000000..6dc51b888ed --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/test_utils.go @@ -0,0 +1,36 @@ +package ccipdata + +import ( + "math/big" + "testing" + + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/accounts/abi/bind/backends" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/core/types" + "github.com/stretchr/testify/require" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" +) + +// NewSimulation returns a client and a simulated backend. +func NewSimulation(t testing.TB) (*bind.TransactOpts, *client.SimulatedBackendClient) { + user := testutils.MustNewSimTransactor(t) + simulatedBackend := backends.NewSimulatedBackend(map[common.Address]core.GenesisAccount{ + user.From: { + Balance: big.NewInt(0).Mul(big.NewInt(3), big.NewInt(1e18)), + }, + }, 10e6) + simulatedBackendClient := client.NewSimulatedBackendClient(t, simulatedBackend, testutils.SimulatedChainID) + return user, simulatedBackendClient +} + +// AssertNonRevert Verify that a transaction was not reverted. +func AssertNonRevert(t testing.TB, tx *types.Transaction, bc *client.SimulatedBackendClient, user *bind.TransactOpts) { + require.NotNil(t, tx, "Transaction should not be nil") + receipt, err := bc.TransactionReceipt(user.Context, tx.Hash()) + require.NoError(t, err) + require.NotEqual(t, uint64(0), receipt.Status, "Transaction should not have reverted") +} diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/token_pool_reader.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/token_pool_reader.go new file mode 100644 index 00000000000..999061f4913 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/token_pool_reader.go @@ -0,0 +1,10 @@ +package ccipdata + +import ( + "github.com/ethereum/go-ethereum/common" +) + +type TokenPoolReader interface { + Address() common.Address + Type() string +} diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/usdc_reader.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/usdc_reader.go new file mode 100644 index 00000000000..cd8fd3150ae --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/usdc_reader.go @@ -0,0 +1,170 @@ +package ccipdata + +import ( + "context" + "fmt" + "time" + + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/patrickmn/go-cache" + "github.com/pkg/errors" + + "github.com/smartcontractkit/chainlink-common/pkg/logger" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/abihelpers" +) + +var ( + // shortLivedInMemLogsCacheExpiration is used for the short-lived in meme logs cache. + // Value should usually be set to just a few seconds, a larger duration will not increase performance and might + // cause performance issues on re-orged logs. + shortLivedInMemLogsCacheExpiration = 20 * time.Second +) + +const ( + MESSAGE_SENT_FILTER_NAME = "USDC message sent" +) + +var _ USDCReader = &USDCReaderImpl{} + +type USDCReader interface { + // GetUSDCMessagePriorToLogIndexInTx returns the specified USDC message data. + // e.g. if msg contains 3 tokens: [usdc1, wETH, usdc2] ignoring non-usdc tokens + // if usdcTokenIndexOffset is 0 we select usdc2 + // if usdcTokenIndexOffset is 1 we select usdc1 + // The message logs are found using the provided transaction hash. + GetUSDCMessagePriorToLogIndexInTx(ctx context.Context, logIndex int64, usdcTokenIndexOffset int, txHash string) ([]byte, error) +} + +type USDCReaderImpl struct { + usdcMessageSent common.Hash + lp logpoller.LogPoller + filter logpoller.Filter + lggr logger.Logger + transmitterAddress common.Address + + // shortLivedInMemLogs is a short-lived cache (items expire every few seconds) + // used to prevent frequent log fetching from the log poller + shortLivedInMemLogs *cache.Cache +} + +func (u *USDCReaderImpl) Close() error { + // FIXME Dim pgOpts removed from LogPoller + return u.lp.UnregisterFilter(context.Background(), u.filter.Name) +} + +func (u *USDCReaderImpl) RegisterFilters() error { + // FIXME Dim pgOpts removed from LogPoller + return u.lp.RegisterFilter(context.Background(), u.filter) +} + +// usdcPayload has to match the onchain event emitted by the USDC message transmitter +type usdcPayload []byte + +func (d usdcPayload) AbiString() string { + return `[{"type": "bytes"}]` +} + +func (d usdcPayload) Validate() error { + if len(d) == 0 { + return errors.New("must be non-empty") + } + return nil +} + +func parseUSDCMessageSent(logData []byte) ([]byte, error) { + decodeAbiStruct, err := abihelpers.DecodeAbiStruct[usdcPayload](logData) + if err != nil { + return nil, err + } + return decodeAbiStruct, nil +} + +func (u *USDCReaderImpl) GetUSDCMessagePriorToLogIndexInTx(ctx context.Context, logIndex int64, usdcTokenIndexOffset int, txHash string) ([]byte, error) { + var lpLogs []logpoller.Log + + // fetch all the usdc logs for the provided tx hash + k := fmt.Sprintf("usdc-%s", txHash) // custom prefix to avoid key collision if someone re-uses the cache + if rawLogs, foundInMem := u.shortLivedInMemLogs.Get(k); foundInMem { + inMemLogs, ok := rawLogs.([]logpoller.Log) + if !ok { + return nil, errors.Errorf("unexpected in-mem logs type %T", rawLogs) + } + u.lggr.Debugw("found logs in memory", "k", k, "len", len(inMemLogs)) + lpLogs = inMemLogs + } + + if len(lpLogs) == 0 { + u.lggr.Debugw("fetching logs from lp", "k", k) + logs, err := u.lp.IndexedLogsByTxHash( + ctx, + u.usdcMessageSent, + u.transmitterAddress, + common.HexToHash(txHash), + ) + if err != nil { + return nil, err + } + lpLogs = logs + u.shortLivedInMemLogs.Set(k, logs, cache.DefaultExpiration) + u.lggr.Debugw("fetched logs from lp", "logs", len(lpLogs)) + } + + // collect the logs with log index less than the provided log index + allUsdcTokensData := make([][]byte, 0) + for _, current := range lpLogs { + if current.LogIndex < logIndex { + u.lggr.Infow("Found USDC message", "logIndex", current.LogIndex, "txHash", current.TxHash.Hex(), "data", hexutil.Encode(current.Data)) + allUsdcTokensData = append(allUsdcTokensData, current.Data) + } + } + + usdcTokenIndex := (len(allUsdcTokensData) - 1) - usdcTokenIndexOffset + + if usdcTokenIndex < 0 || usdcTokenIndex >= len(allUsdcTokensData) { + u.lggr.Errorw("usdc message not found", + "logIndex", logIndex, + "allUsdcTokenData", len(allUsdcTokensData), + "txHash", txHash, + "usdcTokenIndex", usdcTokenIndex, + ) + return nil, errors.Errorf("usdc token index %d is not valid", usdcTokenIndex) + } + return parseUSDCMessageSent(allUsdcTokensData[usdcTokenIndex]) +} + +func NewUSDCReader(lggr logger.Logger, jobID string, transmitter common.Address, lp logpoller.LogPoller, registerFilters bool) (*USDCReaderImpl, error) { + eventSig := utils.Keccak256Fixed([]byte("MessageSent(bytes)")) + + r := &USDCReaderImpl{ + lggr: lggr, + lp: lp, + usdcMessageSent: eventSig, + filter: logpoller.Filter{ + Name: logpoller.FilterName(MESSAGE_SENT_FILTER_NAME, jobID, transmitter.Hex()), + EventSigs: []common.Hash{eventSig}, + Addresses: []common.Address{transmitter}, + Retention: CommitExecLogsRetention, + }, + transmitterAddress: transmitter, + shortLivedInMemLogs: cache.New(shortLivedInMemLogsCacheExpiration, 2*shortLivedInMemLogsCacheExpiration), + } + + if registerFilters { + if err := r.RegisterFilters(); err != nil { + return nil, fmt.Errorf("register filters: %w", err) + } + } + return r, nil +} + +func CloseUSDCReader(lggr logger.Logger, jobID string, transmitter common.Address, lp logpoller.LogPoller) error { + r, err := NewUSDCReader(lggr, jobID, transmitter, lp, false) + if err != nil { + return err + } + return r.Close() +} diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/usdc_reader_internal_test.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/usdc_reader_internal_test.go new file mode 100644 index 00000000000..953da52713b --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/usdc_reader_internal_test.go @@ -0,0 +1,179 @@ +package ccipdata + +import ( + "context" + "fmt" + "testing" + "time" + + "github.com/ethereum/go-ethereum/accounts/abi/bind/backends" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/core" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + "github.com/stretchr/testify/require" + + "github.com/smartcontractkit/chainlink-common/pkg/logger" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/headtracker" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" + lpmocks "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller/mocks" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/pgtest" +) + +func TestLogPollerClient_GetUSDCMessagePriorToLogIndexInTx(t *testing.T) { + addr := utils.RandomAddress() + txHash := common.BytesToHash(addr[:]) + ccipLogIndex := int64(100) + + expectedData := "0x000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000f80000000000000001000000020000000000048d71000000000000000000000000eb08f243e5d3fcff26a9e38ae5520a669f4019d000000000000000000000000023a04d5935ed8bc8e3eb78db3541f0abfb001c6e0000000000000000000000006cb3ed9b441eb674b58495c8b3324b59faff5243000000000000000000000000000000005425890298aed601595a70ab815c96711a31bc65000000000000000000000000ab4f961939bfe6a93567cc57c59eed7084ce2131000000000000000000000000000000000000000000000000000000000000271000000000000000000000000035e08285cfed1ef159236728f843286c55fc08610000000000000000" + expectedPostParse := "0x0000000000000001000000020000000000048d71000000000000000000000000eb08f243e5d3fcff26a9e38ae5520a669f4019d000000000000000000000000023a04d5935ed8bc8e3eb78db3541f0abfb001c6e0000000000000000000000006cb3ed9b441eb674b58495c8b3324b59faff5243000000000000000000000000000000005425890298aed601595a70ab815c96711a31bc65000000000000000000000000ab4f961939bfe6a93567cc57c59eed7084ce2131000000000000000000000000000000000000000000000000000000000000271000000000000000000000000035e08285cfed1ef159236728f843286c55fc0861" + lggr := logger.Test(t) + + t.Run("multiple found - selected last", func(t *testing.T) { + lp := lpmocks.NewLogPoller(t) + u, _ := NewUSDCReader(lggr, "job_123", utils.RandomAddress(), lp, false) + + lp.On("IndexedLogsByTxHash", + mock.Anything, + u.usdcMessageSent, + u.transmitterAddress, + txHash, + ).Return([]logpoller.Log{ + {LogIndex: ccipLogIndex - 2, Data: []byte("-2")}, + {LogIndex: ccipLogIndex - 1, Data: hexutil.MustDecode(expectedData)}, + {LogIndex: ccipLogIndex, Data: []byte("0")}, + {LogIndex: ccipLogIndex + 1, Data: []byte("1")}, + }, nil) + usdcMessageData, err := u.GetUSDCMessagePriorToLogIndexInTx(context.Background(), ccipLogIndex, 0, txHash.String()) + assert.NoError(t, err) + assert.Equal(t, expectedPostParse, hexutil.Encode(usdcMessageData)) + lp.AssertExpectations(t) + }) + + t.Run("multiple found - selected first", func(t *testing.T) { + lp := lpmocks.NewLogPoller(t) + u, _ := NewUSDCReader(lggr, "job_123", utils.RandomAddress(), lp, false) + + lp.On("IndexedLogsByTxHash", + mock.Anything, + u.usdcMessageSent, + u.transmitterAddress, + txHash, + ).Return([]logpoller.Log{ + {LogIndex: ccipLogIndex - 2, Data: hexutil.MustDecode(expectedData)}, + {LogIndex: ccipLogIndex - 1, Data: []byte("-2")}, + {LogIndex: ccipLogIndex, Data: []byte("0")}, + {LogIndex: ccipLogIndex + 1, Data: []byte("1")}, + }, nil) + usdcMessageData, err := u.GetUSDCMessagePriorToLogIndexInTx(context.Background(), ccipLogIndex, 1, txHash.String()) + assert.NoError(t, err) + assert.Equal(t, expectedPostParse, hexutil.Encode(usdcMessageData)) + lp.AssertExpectations(t) + }) + + t.Run("logs fetched from memory in subsequent calls", func(t *testing.T) { + lp := lpmocks.NewLogPoller(t) + u, _ := NewUSDCReader(lggr, "job_123", utils.RandomAddress(), lp, false) + + lp.On("IndexedLogsByTxHash", + mock.Anything, + u.usdcMessageSent, + u.transmitterAddress, + txHash, + ).Return([]logpoller.Log{ + {LogIndex: ccipLogIndex - 2, Data: hexutil.MustDecode(expectedData)}, + {LogIndex: ccipLogIndex - 1, Data: []byte("-2")}, + {LogIndex: ccipLogIndex, Data: []byte("0")}, + {LogIndex: ccipLogIndex + 1, Data: []byte("1")}, + }, nil).Once() + + // first call logs must be fetched from lp + usdcMessageData, err := u.GetUSDCMessagePriorToLogIndexInTx(context.Background(), ccipLogIndex, 1, txHash.String()) + assert.NoError(t, err) + assert.Equal(t, expectedPostParse, hexutil.Encode(usdcMessageData)) + + // subsequent call, logs must be fetched from memory + usdcMessageData, err = u.GetUSDCMessagePriorToLogIndexInTx(context.Background(), ccipLogIndex, 1, txHash.String()) + assert.NoError(t, err) + assert.Equal(t, expectedPostParse, hexutil.Encode(usdcMessageData)) + + lp.AssertExpectations(t) + }) + + t.Run("none found", func(t *testing.T) { + lp := lpmocks.NewLogPoller(t) + u, _ := NewUSDCReader(lggr, "job_123", utils.RandomAddress(), lp, false) + lp.On("IndexedLogsByTxHash", + mock.Anything, + u.usdcMessageSent, + u.transmitterAddress, + txHash, + ).Return([]logpoller.Log{}, nil) + + usdcMessageData, err := u.GetUSDCMessagePriorToLogIndexInTx(context.Background(), ccipLogIndex, 0, txHash.String()) + assert.Errorf(t, err, fmt.Sprintf("no USDC message found prior to log index %d in tx %s", ccipLogIndex, txHash.Hex())) + assert.Nil(t, usdcMessageData) + + lp.AssertExpectations(t) + }) +} + +func TestParse(t *testing.T) { + expectedBody, err := hexutil.Decode("0x000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000f80000000000000001000000020000000000048d71000000000000000000000000eb08f243e5d3fcff26a9e38ae5520a669f4019d000000000000000000000000023a04d5935ed8bc8e3eb78db3541f0abfb001c6e0000000000000000000000006cb3ed9b441eb674b58495c8b3324b59faff5243000000000000000000000000000000005425890298aed601595a70ab815c96711a31bc65000000000000000000000000ab4f961939bfe6a93567cc57c59eed7084ce2131000000000000000000000000000000000000000000000000000000000000271000000000000000000000000035e08285cfed1ef159236728f843286c55fc08610000000000000000") + require.NoError(t, err) + + parsedBody, err := parseUSDCMessageSent(expectedBody) + require.NoError(t, err) + + expectedPostParse := "0x0000000000000001000000020000000000048d71000000000000000000000000eb08f243e5d3fcff26a9e38ae5520a669f4019d000000000000000000000000023a04d5935ed8bc8e3eb78db3541f0abfb001c6e0000000000000000000000006cb3ed9b441eb674b58495c8b3324b59faff5243000000000000000000000000000000005425890298aed601595a70ab815c96711a31bc65000000000000000000000000ab4f961939bfe6a93567cc57c59eed7084ce2131000000000000000000000000000000000000000000000000000000000000271000000000000000000000000035e08285cfed1ef159236728f843286c55fc0861" + + require.Equal(t, expectedPostParse, hexutil.Encode(parsedBody)) +} + +func TestFilters(t *testing.T) { + t.Run("filters of different jobs should be distinct", func(t *testing.T) { + lggr := logger.Test(t) + chainID := testutils.NewRandomEVMChainID() + db := pgtest.NewSqlxDB(t) + o := logpoller.NewORM(chainID, db, lggr) + ec := backends.NewSimulatedBackend(map[common.Address]core.GenesisAccount{}, 10e6) + esc := client.NewSimulatedBackendClient(t, ec, chainID) + lpOpts := logpoller.Opts{ + PollPeriod: 1 * time.Hour, + FinalityDepth: 1, + BackfillBatchSize: 1, + RpcBatchSize: 1, + KeepFinalizedBlocksDepth: 100, + } + headTracker := headtracker.NewSimulatedHeadTracker(esc, lpOpts.UseFinalityTag, lpOpts.FinalityDepth) + if lpOpts.PollPeriod == 0 { + lpOpts.PollPeriod = 1 * time.Hour + } + lp := logpoller.NewLogPoller(o, esc, lggr, headTracker, lpOpts) + + jobID1 := "job-1" + jobID2 := "job-2" + transmitter := utils.RandomAddress() + + f1 := logpoller.FilterName("USDC message sent", jobID1, transmitter.Hex()) + f2 := logpoller.FilterName("USDC message sent", jobID2, transmitter.Hex()) + + _, err := NewUSDCReader(lggr, jobID1, transmitter, lp, true) + assert.NoError(t, err) + assert.True(t, lp.HasFilter(f1)) + + _, err = NewUSDCReader(lggr, jobID2, transmitter, lp, true) + assert.NoError(t, err) + assert.True(t, lp.HasFilter(f2)) + + err = CloseUSDCReader(lggr, jobID2, transmitter, lp) + assert.NoError(t, err) + assert.True(t, lp.HasFilter(f1)) + assert.False(t, lp.HasFilter(f2)) + }) +} diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_0_0/commit_store.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_0_0/commit_store.go new file mode 100644 index 00000000000..f53e44a2894 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_0_0/commit_store.go @@ -0,0 +1,456 @@ +package v1_0_0 + +import ( + "context" + "errors" + "fmt" + "math/big" + "sync" + "time" + + "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" + "golang.org/x/exp/maps" + + "github.com/smartcontractkit/chainlink-common/pkg/config" + "github.com/smartcontractkit/chainlink-common/pkg/logger" + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + "github.com/smartcontractkit/chainlink-common/pkg/types/query" + "github.com/smartcontractkit/chainlink-common/pkg/types/query/primitives" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/gas" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" + evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/commit_store_1_0_0" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/abihelpers" + ccipconfig "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/config" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipcalc" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/logpollerutil" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/prices" +) + +const ( + EXEC_REPORT_ACCEPTS = "Exec report accepts" + ReportAccepted = "ReportAccepted" +) + +var _ ccipdata.CommitStoreReader = &CommitStore{} + +type CommitStore struct { + // Static config + commitStore *commit_store_1_0_0.CommitStore + lggr logger.Logger + lp logpoller.LogPoller + address common.Address + estimator *gas.EvmFeeEstimator + sourceMaxGasPrice *big.Int + filters []logpoller.Filter + reportAcceptedSig common.Hash + reportAcceptedMaxSeqIndex int + commitReportArgs abi.Arguments + + // Dynamic config + configMu sync.RWMutex + gasPriceEstimator prices.ExecGasPriceEstimator + offchainConfig cciptypes.CommitOffchainConfig +} + +func (c *CommitStore) GetCommitStoreStaticConfig(ctx context.Context) (cciptypes.CommitStoreStaticConfig, error) { + legacyConfig, err := c.commitStore.GetStaticConfig(&bind.CallOpts{Context: ctx}) + if err != nil { + return cciptypes.CommitStoreStaticConfig{}, errors.New("Could not get commitStore static config") + } + return cciptypes.CommitStoreStaticConfig{ + ChainSelector: legacyConfig.ChainSelector, + SourceChainSelector: legacyConfig.SourceChainSelector, + OnRamp: ccipcalc.EvmAddrToGeneric(legacyConfig.OnRamp), + ArmProxy: ccipcalc.EvmAddrToGeneric(legacyConfig.ArmProxy), + }, nil +} + +func (c *CommitStore) EncodeCommitReport(_ context.Context, report cciptypes.CommitStoreReport) ([]byte, error) { + return encodeCommitReport(c.commitReportArgs, report) +} + +func encodeCommitReport(commitReportArgs abi.Arguments, report cciptypes.CommitStoreReport) ([]byte, error) { + var tokenPriceUpdates []commit_store_1_0_0.InternalTokenPriceUpdate + for _, tokenPriceUpdate := range report.TokenPrices { + sourceTokenEvmAddr, err := ccipcalc.GenericAddrToEvm(tokenPriceUpdate.Token) + if err != nil { + return nil, err + } + tokenPriceUpdates = append(tokenPriceUpdates, commit_store_1_0_0.InternalTokenPriceUpdate{ + SourceToken: sourceTokenEvmAddr, + UsdPerToken: tokenPriceUpdate.Value, + }) + } + var usdPerUnitGas = big.NewInt(0) + var destChainSelector = uint64(0) + if len(report.GasPrices) > 1 { + return []byte{}, fmt.Errorf("CommitStore V1_0_0 can only accept 1 gas price, received: %d", len(report.GasPrices)) + } + if len(report.GasPrices) > 0 { + usdPerUnitGas = report.GasPrices[0].Value + destChainSelector = report.GasPrices[0].DestChainSelector + } + rep := commit_store_1_0_0.CommitStoreCommitReport{ + PriceUpdates: commit_store_1_0_0.InternalPriceUpdates{ + TokenPriceUpdates: tokenPriceUpdates, + UsdPerUnitGas: usdPerUnitGas, + DestChainSelector: destChainSelector, + }, + Interval: commit_store_1_0_0.CommitStoreInterval{Min: report.Interval.Min, Max: report.Interval.Max}, + MerkleRoot: report.MerkleRoot, + } + return commitReportArgs.PackValues([]interface{}{rep}) +} + +func DecodeCommitReport(commitReportArgs abi.Arguments, report []byte) (cciptypes.CommitStoreReport, error) { + unpacked, err := commitReportArgs.Unpack(report) + if err != nil { + return cciptypes.CommitStoreReport{}, err + } + if len(unpacked) != 1 { + return cciptypes.CommitStoreReport{}, errors.New("expected single struct value") + } + + commitReport, ok := unpacked[0].(struct { + PriceUpdates struct { + TokenPriceUpdates []struct { + SourceToken common.Address `json:"sourceToken"` + UsdPerToken *big.Int `json:"usdPerToken"` + } `json:"tokenPriceUpdates"` + DestChainSelector uint64 `json:"destChainSelector"` + UsdPerUnitGas *big.Int `json:"usdPerUnitGas"` + } `json:"priceUpdates"` + Interval struct { + Min uint64 `json:"min"` + Max uint64 `json:"max"` + } `json:"interval"` + MerkleRoot [32]byte `json:"merkleRoot"` + }) + if !ok { + return cciptypes.CommitStoreReport{}, fmt.Errorf("invalid commit report got %T", unpacked[0]) + } + + var tokenPriceUpdates []cciptypes.TokenPrice + for _, u := range commitReport.PriceUpdates.TokenPriceUpdates { + tokenPriceUpdates = append(tokenPriceUpdates, cciptypes.TokenPrice{ + Token: cciptypes.Address(u.SourceToken.String()), + Value: u.UsdPerToken, + }) + } + + var gasPrices []cciptypes.GasPrice + if commitReport.PriceUpdates.DestChainSelector != 0 { + // No gas price update { + gasPrices = append(gasPrices, cciptypes.GasPrice{ + DestChainSelector: commitReport.PriceUpdates.DestChainSelector, + Value: commitReport.PriceUpdates.UsdPerUnitGas, + }) + } + + return cciptypes.CommitStoreReport{ + TokenPrices: tokenPriceUpdates, + GasPrices: gasPrices, + Interval: cciptypes.CommitStoreInterval{ + Min: commitReport.Interval.Min, + Max: commitReport.Interval.Max, + }, + MerkleRoot: commitReport.MerkleRoot, + }, nil +} + +func (c *CommitStore) DecodeCommitReport(_ context.Context, report []byte) (cciptypes.CommitStoreReport, error) { + return DecodeCommitReport(c.commitReportArgs, report) +} + +func (c *CommitStore) IsBlessed(ctx context.Context, root [32]byte) (bool, error) { + return c.commitStore.IsBlessed(&bind.CallOpts{Context: ctx}, root) +} + +func (c *CommitStore) OffchainConfig(context.Context) (cciptypes.CommitOffchainConfig, error) { + c.configMu.RLock() + defer c.configMu.RUnlock() + return c.offchainConfig, nil +} + +func (c *CommitStore) GasPriceEstimator(context.Context) (cciptypes.GasPriceEstimatorCommit, error) { + c.configMu.RLock() + defer c.configMu.RUnlock() + return c.gasPriceEstimator, nil +} + +func (c *CommitStore) SetGasEstimator(ctx context.Context, gpe gas.EvmFeeEstimator) error { + c.configMu.RLock() + defer c.configMu.RUnlock() + c.estimator = &gpe + return nil +} + +func (c *CommitStore) SetSourceMaxGasPrice(ctx context.Context, sourceMaxGasPrice *big.Int) error { + c.configMu.RLock() + defer c.configMu.RUnlock() + c.sourceMaxGasPrice = sourceMaxGasPrice + return nil +} + +// CommitOffchainConfig is a legacy version of CommitOffchainConfig, used for CommitStore version 1.0.0 and 1.1.0 +type CommitOffchainConfig struct { + SourceFinalityDepth uint32 + DestFinalityDepth uint32 + FeeUpdateHeartBeat config.Duration + FeeUpdateDeviationPPB uint32 + InflightCacheExpiry config.Duration + PriceReportingDisabled bool +} + +func (c CommitOffchainConfig) Validate() error { + if c.SourceFinalityDepth == 0 { + return errors.New("must set SourceFinalityDepth") + } + if c.DestFinalityDepth == 0 { + return errors.New("must set DestFinalityDepth") + } + if c.FeeUpdateHeartBeat.Duration() == 0 { + return errors.New("must set FeeUpdateHeartBeat") + } + if c.FeeUpdateDeviationPPB == 0 { + return errors.New("must set FeeUpdateDeviationPPB") + } + if c.InflightCacheExpiry.Duration() == 0 { + return errors.New("must set InflightCacheExpiry") + } + + return nil +} + +func (c *CommitStore) ChangeConfig(_ context.Context, onchainConfig []byte, offchainConfig []byte) (cciptypes.Address, error) { + onchainConfigParsed, err := abihelpers.DecodeAbiStruct[ccipdata.CommitOnchainConfig](onchainConfig) + if err != nil { + return "", err + } + + offchainConfigV1, err := ccipconfig.DecodeOffchainConfig[CommitOffchainConfig](offchainConfig) + if err != nil { + return "", err + } + c.configMu.Lock() + defer c.configMu.Unlock() + + if c.estimator == nil { + return "", fmt.Errorf("this CommitStore estimator is nil. SetGasEstimator should be called before ChangeConfig") + } + + if c.sourceMaxGasPrice == nil { + return "", fmt.Errorf("this CommitStore sourceMaxGasPrice is nil. SetSourceMaxGasPrice should be called before ChangeConfig") + } + + c.gasPriceEstimator = prices.NewExecGasPriceEstimator( + *c.estimator, + c.sourceMaxGasPrice, + int64(offchainConfigV1.FeeUpdateDeviationPPB)) + c.offchainConfig = ccipdata.NewCommitOffchainConfig( + offchainConfigV1.FeeUpdateDeviationPPB, + offchainConfigV1.FeeUpdateHeartBeat.Duration(), + offchainConfigV1.FeeUpdateDeviationPPB, + offchainConfigV1.FeeUpdateHeartBeat.Duration(), + offchainConfigV1.InflightCacheExpiry.Duration(), + offchainConfigV1.PriceReportingDisabled) + c.lggr.Infow("ChangeConfig", + "offchainConfig", offchainConfigV1, + "onchainConfig", onchainConfigParsed, + ) + return cciptypes.Address(onchainConfigParsed.PriceRegistry.String()), nil +} + +func (c *CommitStore) Close() error { + return logpollerutil.UnregisterLpFilters(c.lp, c.filters) +} + +func (c *CommitStore) parseReport(log types.Log) (*cciptypes.CommitStoreReport, error) { + repAccepted, err := c.commitStore.ParseReportAccepted(log) + if err != nil { + return nil, err + } + // Translate to common struct. + var tokenPrices []cciptypes.TokenPrice + for _, tpu := range repAccepted.Report.PriceUpdates.TokenPriceUpdates { + tokenPrices = append(tokenPrices, cciptypes.TokenPrice{ + Token: cciptypes.Address(tpu.SourceToken.String()), + Value: tpu.UsdPerToken, + }) + } + return &cciptypes.CommitStoreReport{ + TokenPrices: tokenPrices, + GasPrices: []cciptypes.GasPrice{{DestChainSelector: repAccepted.Report.PriceUpdates.DestChainSelector, Value: repAccepted.Report.PriceUpdates.UsdPerUnitGas}}, + MerkleRoot: repAccepted.Report.MerkleRoot, + Interval: cciptypes.CommitStoreInterval{Min: repAccepted.Report.Interval.Min, Max: repAccepted.Report.Interval.Max}, + }, nil +} + +func (c *CommitStore) GetCommitReportMatchingSeqNum(ctx context.Context, seqNr uint64, confs int) ([]cciptypes.CommitStoreReportWithTxMeta, error) { + logs, err := c.lp.LogsDataWordBetween( + ctx, + c.reportAcceptedSig, + c.address, + c.reportAcceptedMaxSeqIndex-1, + c.reportAcceptedMaxSeqIndex, + logpoller.EvmWord(seqNr), + evmtypes.Confirmations(confs), + ) + if err != nil { + return nil, err + } + + parsedLogs, err := ccipdata.ParseLogs[cciptypes.CommitStoreReport]( + logs, + c.lggr, + c.parseReport, + ) + if err != nil { + return nil, err + } + + res := make([]cciptypes.CommitStoreReportWithTxMeta, 0, len(parsedLogs)) + for _, log := range parsedLogs { + res = append(res, cciptypes.CommitStoreReportWithTxMeta{ + TxMeta: log.TxMeta, + CommitStoreReport: log.Data, + }) + } + + if len(res) > 1 { + c.lggr.Errorw("More than one report found for seqNr", "seqNr", seqNr, "commitReports", parsedLogs) + return res[:1], nil + } + return res, nil +} + +func (c *CommitStore) GetAcceptedCommitReportsGteTimestamp(ctx context.Context, ts time.Time, confs int) ([]cciptypes.CommitStoreReportWithTxMeta, error) { + latestBlock, err := c.lp.LatestBlock(ctx) + if err != nil { + return nil, err + } + + reportsQuery, err := logpoller.Where( + logpoller.NewAddressFilter(c.address), + logpoller.NewEventSigFilter(c.reportAcceptedSig), + query.Timestamp(uint64(ts.Unix()), primitives.Gte), + logpoller.NewConfirmationsFilter(evmtypes.Confirmations(confs)), + ) + if err != nil { + return nil, err + } + + logs, err := c.lp.FilteredLogs( + ctx, + reportsQuery, + query.NewLimitAndSort(query.Limit{}, query.NewSortBySequence(query.Asc)), + "GetAcceptedCommitReportsGteTimestamp", + ) + if err != nil { + return nil, err + } + + parsedLogs, err := ccipdata.ParseLogs[cciptypes.CommitStoreReport](logs, c.lggr, c.parseReport) + if err != nil { + return nil, fmt.Errorf("parse logs: %w", err) + } + + parsedReports := make([]cciptypes.CommitStoreReportWithTxMeta, 0, len(parsedLogs)) + for _, log := range parsedLogs { + parsedReports = append(parsedReports, cciptypes.CommitStoreReportWithTxMeta{ + TxMeta: log.TxMeta.WithFinalityStatus(uint64(latestBlock.FinalizedBlockNumber)), + CommitStoreReport: log.Data, + }) + } + + return parsedReports, nil +} + +func (c *CommitStore) GetExpectedNextSequenceNumber(ctx context.Context) (uint64, error) { + return c.commitStore.GetExpectedNextSequenceNumber(&bind.CallOpts{Context: ctx}) +} + +func (c *CommitStore) GetLatestPriceEpochAndRound(ctx context.Context) (uint64, error) { + return c.commitStore.GetLatestPriceEpochAndRound(&bind.CallOpts{Context: ctx}) +} + +func (c *CommitStore) IsDestChainHealthy(context.Context) (bool, error) { + if err := errors.Join(maps.Values(c.lp.HealthReport())...); err != nil { + return false, nil + } + return true, nil +} + +func (c *CommitStore) IsDown(ctx context.Context) (bool, error) { + unPausedAndHealthy, err := c.commitStore.IsUnpausedAndARMHealthy(&bind.CallOpts{Context: ctx}) + if err != nil { + return true, err + } + return !unPausedAndHealthy, nil +} + +func (c *CommitStore) VerifyExecutionReport(ctx context.Context, report cciptypes.ExecReport) (bool, error) { + var hashes [][32]byte + for _, msg := range report.Messages { + hashes = append(hashes, msg.Hash) + } + res, err := c.commitStore.Verify(&bind.CallOpts{Context: ctx}, hashes, report.Proofs, report.ProofFlagBits) + if err != nil { + c.lggr.Errorw("Unable to call verify", "messages", report.Messages, "err", err) + return false, nil + } + // No timestamp, means failed to verify root. + if res.Cmp(big.NewInt(0)) == 0 { + c.lggr.Errorw("Root does not verify", "messages", report.Messages) + return false, nil + } + return true, nil +} + +func (c *CommitStore) RegisterFilters() error { + return logpollerutil.RegisterLpFilters(c.lp, c.filters) +} + +func NewCommitStore(lggr logger.Logger, addr common.Address, ec client.Client, lp logpoller.LogPoller) (*CommitStore, error) { + commitStore, err := commit_store_1_0_0.NewCommitStore(addr, ec) + if err != nil { + return nil, err + } + commitStoreABI := abihelpers.MustParseABI(commit_store_1_0_0.CommitStoreABI) + eventSig := abihelpers.MustGetEventID(ReportAccepted, commitStoreABI) + commitReportArgs := abihelpers.MustGetEventInputs(ReportAccepted, commitStoreABI) + filters := []logpoller.Filter{ + { + Name: logpoller.FilterName(EXEC_REPORT_ACCEPTS, addr.String()), + EventSigs: []common.Hash{eventSig}, + Addresses: []common.Address{addr}, + Retention: ccipdata.CommitExecLogsRetention, + }, + } + return &CommitStore{ + commitStore: commitStore, + address: addr, + lggr: lggr, + lp: lp, + + // Note that sourceMaxGasPrice and estimator now have explicit setters (CCIP-2493) + + filters: filters, + commitReportArgs: commitReportArgs, + reportAcceptedSig: eventSig, + // offset || priceUpdatesOffset || minSeqNum || maxSeqNum || merkleRoot + reportAcceptedMaxSeqIndex: 3, + configMu: sync.RWMutex{}, + + // The fields below are initially empty and set on ChangeConfig method + offchainConfig: cciptypes.CommitOffchainConfig{}, + gasPriceEstimator: prices.ExecGasPriceEstimator{}, + }, nil +} diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_0_0/commit_store_test.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_0_0/commit_store_test.go new file mode 100644 index 00000000000..b10e3ec8893 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_0_0/commit_store_test.go @@ -0,0 +1,49 @@ +package v1_0_0 + +import ( + "math/big" + "math/rand" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + "github.com/smartcontractkit/chainlink-common/pkg/logger" + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller/mocks" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" +) + +func TestCommitReportEncoding(t *testing.T) { + ctx := testutils.Context(t) + report := cciptypes.CommitStoreReport{ + TokenPrices: []cciptypes.TokenPrice{ + { + Token: cciptypes.Address(utils.RandomAddress().String()), + Value: big.NewInt(9e18), + }, + }, + GasPrices: []cciptypes.GasPrice{ + { + DestChainSelector: rand.Uint64(), + Value: big.NewInt(2000e9), + }, + }, + MerkleRoot: [32]byte{123}, + Interval: cciptypes.CommitStoreInterval{Min: 1, Max: 10}, + } + + c, err := NewCommitStore(logger.Test(t), utils.RandomAddress(), nil, mocks.NewLogPoller(t)) + assert.NoError(t, err) + + encodedReport, err := c.EncodeCommitReport(ctx, report) + require.NoError(t, err) + assert.Greater(t, len(encodedReport), 0) + + decodedReport, err := c.DecodeCommitReport(ctx, encodedReport) + require.NoError(t, err) + require.Equal(t, report.TokenPrices, decodedReport.TokenPrices) + require.Equal(t, report, decodedReport) +} diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_0_0/hasher.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_0_0/hasher.go new file mode 100644 index 00000000000..0d1b7f736f6 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_0_0/hasher.go @@ -0,0 +1,85 @@ +package v1_0_0 + +import ( + "math/big" + + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/math" + "github.com/ethereum/go-ethereum/core/types" + + "github.com/smartcontractkit/chainlink-common/pkg/hashutil" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/evm_2_evm_onramp_1_0_0" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/abihelpers" +) + +const ( + MetaDataHashPrefix = "EVM2EVMMessageEvent" +) + +var LeafDomainSeparator = [1]byte{0x00} + +type LeafHasher struct { + metaDataHash [32]byte + ctx hashutil.Hasher[[32]byte] + onRamp *evm_2_evm_onramp_1_0_0.EVM2EVMOnRamp +} + +func GetMetaDataHash[H hashutil.Hash](ctx hashutil.Hasher[H], prefix [32]byte, sourceChainSelector uint64, onRampId common.Address, destChainSelector uint64) H { + paddedOnRamp := common.BytesToHash(onRampId[:]) + return ctx.Hash(utils.ConcatBytes(prefix[:], math.U256Bytes(big.NewInt(0).SetUint64(sourceChainSelector)), math.U256Bytes(big.NewInt(0).SetUint64(destChainSelector)), paddedOnRamp[:])) +} + +func NewLeafHasher(sourceChainSelector uint64, destChainSelector uint64, onRampId common.Address, ctx hashutil.Hasher[[32]byte], onRamp *evm_2_evm_onramp_1_0_0.EVM2EVMOnRamp) *LeafHasher { + return &LeafHasher{ + metaDataHash: GetMetaDataHash(ctx, ctx.Hash([]byte(MetaDataHashPrefix)), sourceChainSelector, onRampId, destChainSelector), + ctx: ctx, + onRamp: onRamp, + } +} + +func (t *LeafHasher) HashLeaf(log types.Log) ([32]byte, error) { + message, err := t.onRamp.ParseCCIPSendRequested(log) + if err != nil { + return [32]byte{}, err + } + encodedTokens, err := abihelpers.ABIEncode( + `[ +{"components": [{"name":"token","type":"address"},{"name":"amount","type":"uint256"}], "type":"tuple[]"}]`, message.Message.TokenAmounts) + if err != nil { + return [32]byte{}, err + } + + packedValues, err := abihelpers.ABIEncode( + `[ +{"name": "leafDomainSeparator","type":"bytes1"}, +{"name": "metadataHash", "type":"bytes32"}, +{"name": "sequenceNumber", "type":"uint64"}, +{"name": "nonce", "type":"uint64"}, +{"name": "sender", "type":"address"}, +{"name": "receiver", "type":"address"}, +{"name": "dataHash", "type":"bytes32"}, +{"name": "tokenAmountsHash", "type":"bytes32"}, +{"name": "gasLimit", "type":"uint256"}, +{"name": "strict", "type":"bool"}, +{"name": "feeToken","type": "address"}, +{"name": "feeTokenAmount","type": "uint256"} +]`, + LeafDomainSeparator, + t.metaDataHash, + message.Message.SequenceNumber, + message.Message.Nonce, + message.Message.Sender, + message.Message.Receiver, + t.ctx.Hash(message.Message.Data), + t.ctx.Hash(encodedTokens), + message.Message.GasLimit, + message.Message.Strict, + message.Message.FeeToken, + message.Message.FeeTokenAmount, + ) + if err != nil { + return [32]byte{}, err + } + return t.ctx.Hash(packedValues), nil +} diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_0_0/hasher_test.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_0_0/hasher_test.go new file mode 100644 index 00000000000..b1219a27dfa --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_0_0/hasher_test.go @@ -0,0 +1,84 @@ +package v1_0_0 + +import ( + "encoding/hex" + "math/big" + "testing" + + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/stretchr/testify/require" + + "github.com/smartcontractkit/chainlink-common/pkg/hashutil" + + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/evm_2_evm_onramp_1_0_0" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/abihelpers" +) + +func TestHasherV1_0_0(t *testing.T) { + sourceChainSelector, destChainSelector := uint64(1), uint64(4) + onRampAddress := common.HexToAddress("0x5550000000000000000000000000000000000001") + onRampABI := abihelpers.MustParseABI(evm_2_evm_onramp_1_0_0.EVM2EVMOnRampABI) + + ramp, err := evm_2_evm_onramp_1_0_0.NewEVM2EVMOnRamp(onRampAddress, nil) + require.NoError(t, err) + hashingCtx := hashutil.NewKeccak() + hasher := NewLeafHasher(sourceChainSelector, destChainSelector, onRampAddress, hashingCtx, ramp) + + message := evm_2_evm_onramp_1_0_0.InternalEVM2EVMMessage{ + SourceChainSelector: sourceChainSelector, + Sender: common.HexToAddress("0x1110000000000000000000000000000000000001"), + Receiver: common.HexToAddress("0x2220000000000000000000000000000000000001"), + SequenceNumber: 1337, + GasLimit: big.NewInt(100), + Strict: false, + Nonce: 1337, + FeeToken: common.Address{}, + FeeTokenAmount: big.NewInt(1), + Data: []byte{}, + TokenAmounts: []evm_2_evm_onramp_1_0_0.ClientEVMTokenAmount{{Token: common.HexToAddress("0x4440000000000000000000000000000000000001"), Amount: big.NewInt(12345678900)}}, + MessageId: [32]byte{}, + } + + data, err := onRampABI.Events[CCIPSendRequestedEventName].Inputs.Pack(message) + require.NoError(t, err) + hash, err := hasher.HashLeaf(types.Log{Topics: []common.Hash{abihelpers.MustGetEventID("CCIPSendRequested", onRampABI)}, Data: data}) + require.NoError(t, err) + + // NOTE: Must match spec + require.Equal(t, "26f282c6ac8231933b1799648d01ff6cec792a33fb37408b4d135968f9168ace", hex.EncodeToString(hash[:])) + + message = evm_2_evm_onramp_1_0_0.InternalEVM2EVMMessage{ + SourceChainSelector: sourceChainSelector, + Sender: common.HexToAddress("0x1110000000000000000000000000000000000001"), + Receiver: common.HexToAddress("0x2220000000000000000000000000000000000001"), + SequenceNumber: 1337, + GasLimit: big.NewInt(100), + Strict: false, + Nonce: 1337, + FeeToken: common.Address{}, + FeeTokenAmount: big.NewInt(1e12), + Data: []byte("foo bar baz"), + TokenAmounts: []evm_2_evm_onramp_1_0_0.ClientEVMTokenAmount{ + {Token: common.HexToAddress("0x4440000000000000000000000000000000000001"), Amount: big.NewInt(12345678900)}, + {Token: common.HexToAddress("0x6660000000000000000000000000000000000001"), Amount: big.NewInt(4204242)}, + }, + MessageId: [32]byte{}, + } + + data, err = onRampABI.Events[CCIPSendRequestedEventName].Inputs.Pack(message) + require.NoError(t, err) + hash, err = hasher.HashLeaf(types.Log{Topics: []common.Hash{abihelpers.MustGetEventID("CCIPSendRequested", onRampABI)}, Data: data}) + require.NoError(t, err) + + // NOTE: Must match spec + require.Equal(t, "05cee92e7cb86a37b6536554828a5b21ff20ac3d4ef821ec47056f1d963313de", hex.EncodeToString(hash[:])) +} + +func TestMetaDataHash(t *testing.T) { + sourceChainSelector, destChainSelector := uint64(1), uint64(4) + onRampAddress := common.HexToAddress("0x5550000000000000000000000000000000000001") + ctx := hashutil.NewKeccak() + hash := GetMetaDataHash(ctx, ctx.Hash([]byte(MetaDataHashPrefix)), sourceChainSelector, onRampAddress, destChainSelector) + require.Equal(t, "1409948abde219f43870c3d6d1c16beabd8878eb5039a3fa765eb56e4b8ded9e", hex.EncodeToString(hash[:])) +} diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_0_0/offramp.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_0_0/offramp.go new file mode 100644 index 00000000000..c8b7c504ff2 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_0_0/offramp.go @@ -0,0 +1,686 @@ +package v1_0_0 + +import ( + "context" + "fmt" + "math/big" + "sync" + "time" + + mapset "github.com/deckarep/golang-set/v2" + "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/pkg/errors" + + "github.com/smartcontractkit/chainlink-common/pkg/config" + "github.com/smartcontractkit/chainlink-common/pkg/logger" + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/gas" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" + evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/evm_2_evm_offramp_1_0_0" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/router" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/abihelpers" + ccipconfig "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/config" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/cache" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipcalc" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/logpollerutil" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/rpclib" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/prices" +) + +const ( + EXEC_EXECUTION_STATE_CHANGES = "Exec execution state changes" + EXEC_TOKEN_POOL_ADDED = "Token pool added" + EXEC_TOKEN_POOL_REMOVED = "Token pool removed" +) + +var ( + abiOffRamp = abihelpers.MustParseABI(evm_2_evm_offramp_1_0_0.EVM2EVMOffRampABI) + _ ccipdata.OffRampReader = &OffRamp{} + ExecutionStateChangedEvent = abihelpers.MustGetEventID("ExecutionStateChanged", abiOffRamp) + PoolAddedEvent = abihelpers.MustGetEventID("PoolAdded", abiOffRamp) + PoolRemovedEvent = abihelpers.MustGetEventID("PoolRemoved", abiOffRamp) + ExecutionStateChangedSeqNrIndex = 1 +) + +var offRamp_poolAddedPoolRemovedEvents = []common.Hash{PoolAddedEvent, PoolRemovedEvent} + +type ExecOnchainConfig evm_2_evm_offramp_1_0_0.EVM2EVMOffRampDynamicConfig + +func (d ExecOnchainConfig) AbiString() string { + return ` + [ + { + "components": [ + {"name": "permissionLessExecutionThresholdSeconds", "type": "uint32"}, + {"name": "router", "type": "address"}, + {"name": "priceRegistry", "type": "address"}, + {"name": "maxTokensLength", "type": "uint16"}, + {"name": "maxDataSize", "type": "uint32"} + ], + "type": "tuple" + } + ]` +} + +func (d ExecOnchainConfig) Validate() error { + if d.PermissionLessExecutionThresholdSeconds == 0 { + return errors.New("must set PermissionLessExecutionThresholdSeconds") + } + if d.Router == (common.Address{}) { + return errors.New("must set Router address") + } + if d.PriceRegistry == (common.Address{}) { + return errors.New("must set PriceRegistry address") + } + if d.MaxTokensLength == 0 { + return errors.New("must set MaxTokensLength") + } + if d.MaxDataSize == 0 { + return errors.New("must set MaxDataSize") + } + return nil +} + +// ExecOffchainConfig is the configuration for nodes executing committed CCIP messages (v1.0–v1.2). +// It comes from the OffchainConfig field of the corresponding OCR2 plugin configuration. +// NOTE: do not change the JSON format of this struct without consulting with the RDD people first. +type ExecOffchainConfig struct { + // SourceFinalityDepth indicates how many confirmations a transaction should get on the source chain event before we consider it finalized. + SourceFinalityDepth uint32 + // See [ccipdata.ExecOffchainConfig.DestOptimisticConfirmations] + DestOptimisticConfirmations uint32 + // DestFinalityDepth indicates how many confirmations a transaction should get on the destination chain event before we consider it finalized. + DestFinalityDepth uint32 + // See [ccipdata.ExecOffchainConfig.BatchGasLimit] + BatchGasLimit uint32 + // See [ccipdata.ExecOffchainConfig.RelativeBoostPerWaitHour] + RelativeBoostPerWaitHour float64 + // See [ccipdata.ExecOffchainConfig.InflightCacheExpiry] + InflightCacheExpiry config.Duration + // See [ccipdata.ExecOffchainConfig.RootSnoozeTime] + RootSnoozeTime config.Duration + // See [ccipdata.ExecOffchainConfig.BatchingStrategyID] + BatchingStrategyID uint32 + // See [ccipdata.ExecOffchainConfig.MessageVisibilityInterval] + MessageVisibilityInterval config.Duration +} + +func (c ExecOffchainConfig) Validate() error { + if c.SourceFinalityDepth == 0 { + return errors.New("must set SourceFinalityDepth") + } + if c.DestFinalityDepth == 0 { + return errors.New("must set DestFinalityDepth") + } + if c.DestOptimisticConfirmations == 0 { + return errors.New("must set DestOptimisticConfirmations") + } + if c.BatchGasLimit == 0 { + return errors.New("must set BatchGasLimit") + } + if c.RelativeBoostPerWaitHour == 0 { + return errors.New("must set RelativeBoostPerWaitHour") + } + if c.InflightCacheExpiry.Duration() == 0 { + return errors.New("must set InflightCacheExpiry") + } + if c.RootSnoozeTime.Duration() == 0 { + return errors.New("must set RootSnoozeTime") + } + + return nil +} + +type OffRamp struct { + offRampV100 evm_2_evm_offramp_1_0_0.EVM2EVMOffRampInterface + addr common.Address + lp logpoller.LogPoller + Logger logger.Logger + Client client.Client + evmBatchCaller rpclib.EvmBatchCaller + filters []logpoller.Filter + Estimator gas.EvmFeeEstimator + DestMaxGasPrice *big.Int + ExecutionReportArgs abi.Arguments + eventIndex int + eventSig common.Hash + cachedOffRampTokens cache.AutoSync[cciptypes.OffRampTokens] + sourceToDestTokensCache sync.Map + + // Dynamic config + // configMu guards all the dynamic config fields. + configMu sync.RWMutex + gasPriceEstimator prices.GasPriceEstimatorExec + offchainConfig cciptypes.ExecOffchainConfig + onchainConfig cciptypes.ExecOnchainConfig +} + +func (o *OffRamp) GetStaticConfig(ctx context.Context) (cciptypes.OffRampStaticConfig, error) { + if o.offRampV100 == nil { + return cciptypes.OffRampStaticConfig{}, fmt.Errorf("offramp not initialized") + } + c, err := o.offRampV100.GetStaticConfig(&bind.CallOpts{Context: ctx}) + if err != nil { + return cciptypes.OffRampStaticConfig{}, fmt.Errorf("error while retrieving offramp config: %w", err) + } + return cciptypes.OffRampStaticConfig{ + CommitStore: cciptypes.Address(c.CommitStore.String()), + ChainSelector: c.ChainSelector, + SourceChainSelector: c.SourceChainSelector, + OnRamp: cciptypes.Address(c.OnRamp.String()), + PrevOffRamp: cciptypes.Address(c.PrevOffRamp.String()), + ArmProxy: cciptypes.Address(c.ArmProxy.String()), + }, nil +} + +func (o *OffRamp) GetExecutionState(ctx context.Context, sequenceNumber uint64) (uint8, error) { + return o.offRampV100.GetExecutionState(&bind.CallOpts{Context: ctx}, sequenceNumber) +} + +func (o *OffRamp) GetSenderNonce(ctx context.Context, sender cciptypes.Address) (uint64, error) { + evmAddr, err := ccipcalc.GenericAddrToEvm(sender) + if err != nil { + return 0, err + } + return o.offRampV100.GetSenderNonce(&bind.CallOpts{Context: ctx}, evmAddr) +} + +func (o *OffRamp) ListSenderNonces(ctx context.Context, senders []cciptypes.Address) (map[cciptypes.Address]uint64, error) { + if len(senders) == 0 { + return make(map[cciptypes.Address]uint64), nil + } + + evmSenders, err := ccipcalc.GenericAddrsToEvm(senders...) + if err != nil { + return nil, errors.Wrap(err, "failed to convert generic addresses to evm addresses") + } + + evmCalls := make([]rpclib.EvmCall, 0, len(evmSenders)) + for _, evmAddr := range evmSenders { + evmCalls = append(evmCalls, rpclib.NewEvmCall( + abiOffRamp, + "getSenderNonce", + o.addr, + evmAddr, + )) + } + + results, err := o.evmBatchCaller.BatchCall(ctx, 0, evmCalls) + if err != nil { + o.Logger.Errorw("error while batch fetching sender nonces", "err", err, "senders", evmSenders) + return nil, err + } + + nonces, err := rpclib.ParseOutputs[uint64](results, func(d rpclib.DataAndErr) (uint64, error) { + return rpclib.ParseOutput[uint64](d, 0) + }) + if err != nil { + o.Logger.Errorw("error while parsing sender nonces", "err", err, "senders", evmSenders) + return nil, err + } + + if len(senders) != len(nonces) { + o.Logger.Errorw("unexpected number of nonces returned", "senders", evmSenders, "nonces", nonces) + return nil, errors.New("unexpected number of nonces returned") + } + + senderNonce := make(map[cciptypes.Address]uint64, len(senders)) + for i, sender := range senders { + senderNonce[sender] = nonces[i] + } + return senderNonce, nil +} + +func (o *OffRamp) CurrentRateLimiterState(ctx context.Context) (cciptypes.TokenBucketRateLimit, error) { + state, err := o.offRampV100.CurrentRateLimiterState(&bind.CallOpts{Context: ctx}) + if err != nil { + return cciptypes.TokenBucketRateLimit{}, err + } + return cciptypes.TokenBucketRateLimit{ + Tokens: state.Tokens, + LastUpdated: state.LastUpdated, + IsEnabled: state.IsEnabled, + Capacity: state.Capacity, + Rate: state.Rate, + }, nil +} + +func (o *OffRamp) getDestinationTokensFromSourceTokens(ctx context.Context, tokenAddresses []cciptypes.Address) ([]cciptypes.Address, error) { + destTokens := make([]cciptypes.Address, len(tokenAddresses)) + found := make(map[cciptypes.Address]bool) + + for i, tokenAddress := range tokenAddresses { + if v, exists := o.sourceToDestTokensCache.Load(tokenAddress); exists { + if destToken, isAddr := v.(cciptypes.Address); isAddr { + destTokens[i] = destToken + found[tokenAddress] = true + } else { + o.Logger.Errorf("source to dest cache contains invalid type %T", v) + } + } + } + + if len(found) == len(tokenAddresses) { + return destTokens, nil + } + + evmAddrs, err := ccipcalc.GenericAddrsToEvm(tokenAddresses...) + if err != nil { + return nil, err + } + + evmCalls := make([]rpclib.EvmCall, 0, len(tokenAddresses)) + for i, sourceTk := range tokenAddresses { + if !found[sourceTk] { + evmCalls = append(evmCalls, rpclib.NewEvmCall(abiOffRamp, "getDestinationToken", o.addr, evmAddrs[i])) + } + } + + results, err := o.evmBatchCaller.BatchCall(ctx, 0, evmCalls) + if err != nil { + return nil, fmt.Errorf("batch call limit: %w", err) + } + + destTokensFromRpc, err := rpclib.ParseOutputs[common.Address](results, func(d rpclib.DataAndErr) (common.Address, error) { + return rpclib.ParseOutput[common.Address](d, 0) + }) + if err != nil { + return nil, fmt.Errorf("parse outputs: %w", err) + } + + j := 0 + for i, sourceToken := range tokenAddresses { + if !found[sourceToken] { + destTokens[i] = cciptypes.Address(destTokensFromRpc[j].String()) + o.sourceToDestTokensCache.Store(sourceToken, destTokens[i]) + j++ + } + } + + seenDestTokens := mapset.NewSet[cciptypes.Address]() + for _, destToken := range destTokens { + if seenDestTokens.Contains(destToken) { + return nil, fmt.Errorf("offRamp misconfig, destination token %s already exists", destToken) + } + seenDestTokens.Add(destToken) + } + + return destTokens, nil +} + +func (o *OffRamp) GetSourceToDestTokensMapping(ctx context.Context) (map[cciptypes.Address]cciptypes.Address, error) { + tokens, err := o.GetTokens(ctx) + if err != nil { + return nil, err + } + + destTokens, err := o.getDestinationTokensFromSourceTokens(ctx, tokens.SourceTokens) + if err != nil { + return nil, fmt.Errorf("get destination tokens from source tokens: %w", err) + } + + srcToDstTokenMapping := make(map[cciptypes.Address]cciptypes.Address, len(tokens.SourceTokens)) + for i, sourceToken := range tokens.SourceTokens { + srcToDstTokenMapping[sourceToken] = destTokens[i] + } + return srcToDstTokenMapping, nil +} + +func (o *OffRamp) GetTokens(ctx context.Context) (cciptypes.OffRampTokens, error) { + return o.cachedOffRampTokens.Get(ctx, func(ctx context.Context) (cciptypes.OffRampTokens, error) { + destTokens, err := o.offRampV100.GetDestinationTokens(&bind.CallOpts{Context: ctx}) + if err != nil { + return cciptypes.OffRampTokens{}, fmt.Errorf("get destination tokens: %w", err) + } + sourceTokens, err := o.offRampV100.GetSupportedTokens(&bind.CallOpts{Context: ctx}) + if err != nil { + return cciptypes.OffRampTokens{}, err + } + + return cciptypes.OffRampTokens{ + DestinationTokens: ccipcalc.EvmAddrsToGeneric(destTokens...), + SourceTokens: ccipcalc.EvmAddrsToGeneric(sourceTokens...), + }, nil + }) +} + +func (o *OffRamp) GetRouter(ctx context.Context) (cciptypes.Address, error) { + dynamicConfig, err := o.offRampV100.GetDynamicConfig(&bind.CallOpts{Context: ctx}) + if err != nil { + return "", err + } + return ccipcalc.EvmAddrToGeneric(dynamicConfig.Router), nil +} + +func (o *OffRamp) OffchainConfig(ctx context.Context) (cciptypes.ExecOffchainConfig, error) { + o.configMu.RLock() + defer o.configMu.RUnlock() + return o.offchainConfig, nil +} + +func (o *OffRamp) OnchainConfig(ctx context.Context) (cciptypes.ExecOnchainConfig, error) { + o.configMu.RLock() + defer o.configMu.RUnlock() + return o.onchainConfig, nil +} + +func (o *OffRamp) GasPriceEstimator(ctx context.Context) (cciptypes.GasPriceEstimatorExec, error) { + o.configMu.RLock() + defer o.configMu.RUnlock() + return o.gasPriceEstimator, nil +} + +func (o *OffRamp) Address(ctx context.Context) (cciptypes.Address, error) { + return cciptypes.Address(o.addr.String()), nil +} + +func (o *OffRamp) UpdateDynamicConfig(onchainConfig cciptypes.ExecOnchainConfig, offchainConfig cciptypes.ExecOffchainConfig, gasPriceEstimator prices.GasPriceEstimatorExec) { + o.configMu.Lock() + o.onchainConfig = onchainConfig + o.offchainConfig = offchainConfig + o.gasPriceEstimator = gasPriceEstimator + o.configMu.Unlock() +} + +func (o *OffRamp) ChangeConfig(ctx context.Context, onchainConfigBytes []byte, offchainConfigBytes []byte) (cciptypes.Address, cciptypes.Address, error) { + onchainConfigParsed, err := abihelpers.DecodeAbiStruct[ExecOnchainConfig](onchainConfigBytes) + if err != nil { + return "", "", err + } + + offchainConfigParsed, err := ccipconfig.DecodeOffchainConfig[ExecOffchainConfig](offchainConfigBytes) + if err != nil { + return "", "", err + } + destRouter, err := router.NewRouter(onchainConfigParsed.Router, o.Client) + if err != nil { + return "", "", err + } + destWrappedNative, err := destRouter.GetWrappedNative(nil) + if err != nil { + return "", "", err + } + + offchainConfig := cciptypes.ExecOffchainConfig{ + DestOptimisticConfirmations: offchainConfigParsed.DestOptimisticConfirmations, + BatchGasLimit: offchainConfigParsed.BatchGasLimit, + RelativeBoostPerWaitHour: offchainConfigParsed.RelativeBoostPerWaitHour, + InflightCacheExpiry: offchainConfigParsed.InflightCacheExpiry, + RootSnoozeTime: offchainConfigParsed.RootSnoozeTime, + MessageVisibilityInterval: offchainConfigParsed.MessageVisibilityInterval, + BatchingStrategyID: offchainConfigParsed.BatchingStrategyID, + } + onchainConfig := cciptypes.ExecOnchainConfig{ + PermissionLessExecutionThresholdSeconds: time.Second * time.Duration(onchainConfigParsed.PermissionLessExecutionThresholdSeconds), + Router: cciptypes.Address(onchainConfigParsed.Router.String()), + } + gasPriceEstimator := prices.NewExecGasPriceEstimator(o.Estimator, o.DestMaxGasPrice, 0) + + o.UpdateDynamicConfig(onchainConfig, offchainConfig, gasPriceEstimator) + + o.Logger.Infow("Starting exec plugin", + "offchainConfig", onchainConfigParsed, + "onchainConfig", offchainConfigParsed) + return cciptypes.Address(onchainConfigParsed.PriceRegistry.String()), + cciptypes.Address(destWrappedNative.String()), nil +} + +func (o *OffRamp) Close() error { + return logpollerutil.UnregisterLpFilters(o.lp, o.filters) +} + +func (o *OffRamp) GetExecutionStateChangesBetweenSeqNums(ctx context.Context, seqNumMin, seqNumMax uint64, confs int) ([]cciptypes.ExecutionStateChangedWithTxMeta, error) { + latestBlock, err := o.lp.LatestBlock(ctx) + if err != nil { + return nil, fmt.Errorf("get lp latest block: %w", err) + } + + logs, err := o.lp.IndexedLogsTopicRange( + ctx, + o.eventSig, + o.addr, + o.eventIndex, + logpoller.EvmWord(seqNumMin), + logpoller.EvmWord(seqNumMax), + evmtypes.Confirmations(confs), + ) + if err != nil { + return nil, err + } + + parsedLogs, err := ccipdata.ParseLogs[cciptypes.ExecutionStateChanged]( + logs, + o.Logger, + func(log types.Log) (*cciptypes.ExecutionStateChanged, error) { + sc, err1 := o.offRampV100.ParseExecutionStateChanged(log) + if err1 != nil { + return nil, err1 + } + + return &cciptypes.ExecutionStateChanged{ + SequenceNumber: sc.SequenceNumber, + }, nil + }, + ) + if err != nil { + return nil, fmt.Errorf("parse logs: %w", err) + } + + res := make([]cciptypes.ExecutionStateChangedWithTxMeta, 0, len(parsedLogs)) + for _, log := range parsedLogs { + res = append(res, cciptypes.ExecutionStateChangedWithTxMeta{ + TxMeta: log.TxMeta.WithFinalityStatus(uint64(latestBlock.FinalizedBlockNumber)), + ExecutionStateChanged: log.Data, + }) + } + return res, nil +} + +func encodeExecutionReport(args abi.Arguments, report cciptypes.ExecReport) ([]byte, error) { + var msgs []evm_2_evm_offramp_1_0_0.InternalEVM2EVMMessage + for _, msg := range report.Messages { + var ta []evm_2_evm_offramp_1_0_0.ClientEVMTokenAmount + for _, tokenAndAmount := range msg.TokenAmounts { + evmTokenAddr, err := ccipcalc.GenericAddrToEvm(tokenAndAmount.Token) + if err != nil { + return nil, err + } + + ta = append(ta, evm_2_evm_offramp_1_0_0.ClientEVMTokenAmount{ + Token: evmTokenAddr, + Amount: tokenAndAmount.Amount, + }) + } + + senderEvmAddr, err := ccipcalc.GenericAddrToEvm(msg.Sender) + if err != nil { + return nil, fmt.Errorf("msg sender is not evm addr: %w", err) + } + + receiverEvmAddr, err := ccipcalc.GenericAddrToEvm(msg.Receiver) + if err != nil { + return nil, fmt.Errorf("msg receiver is not evm addr: %w", err) + } + + feeTokenEvmAddr, err := ccipcalc.GenericAddrToEvm(msg.FeeToken) + if err != nil { + return nil, fmt.Errorf("fee token is not evm addr: %w", err) + } + + msgs = append(msgs, evm_2_evm_offramp_1_0_0.InternalEVM2EVMMessage{ + SourceChainSelector: msg.SourceChainSelector, + Sender: senderEvmAddr, + Receiver: receiverEvmAddr, + SequenceNumber: msg.SequenceNumber, + GasLimit: msg.GasLimit, + Strict: msg.Strict, + Nonce: msg.Nonce, + FeeToken: feeTokenEvmAddr, + FeeTokenAmount: msg.FeeTokenAmount, + Data: msg.Data, + TokenAmounts: ta, + MessageId: msg.MessageID, + }) + } + + rep := evm_2_evm_offramp_1_0_0.InternalExecutionReport{ + Messages: msgs, + OffchainTokenData: report.OffchainTokenData, + Proofs: report.Proofs, + ProofFlagBits: report.ProofFlagBits, + } + return args.PackValues([]interface{}{&rep}) +} + +func (o *OffRamp) EncodeExecutionReport(ctx context.Context, report cciptypes.ExecReport) ([]byte, error) { + return encodeExecutionReport(o.ExecutionReportArgs, report) +} + +func DecodeExecReport(ctx context.Context, args abi.Arguments, report []byte) (cciptypes.ExecReport, error) { + unpacked, err := args.Unpack(report) + if err != nil { + return cciptypes.ExecReport{}, err + } + if len(unpacked) == 0 { + return cciptypes.ExecReport{}, errors.New("assumptionViolation: expected at least one element") + } + + erStruct, ok := unpacked[0].(struct { + Messages []struct { + SourceChainSelector uint64 `json:"sourceChainSelector"` + SequenceNumber uint64 `json:"sequenceNumber"` + FeeTokenAmount *big.Int `json:"feeTokenAmount"` + Sender common.Address `json:"sender"` + Nonce uint64 `json:"nonce"` + GasLimit *big.Int `json:"gasLimit"` + Strict bool `json:"strict"` + Receiver common.Address `json:"receiver"` + Data []uint8 `json:"data"` + TokenAmounts []struct { + Token common.Address `json:"token"` + Amount *big.Int `json:"amount"` + } `json:"tokenAmounts"` + FeeToken common.Address `json:"feeToken"` + MessageId [32]uint8 `json:"messageId"` + } `json:"messages"` + OffchainTokenData [][][]uint8 `json:"offchainTokenData"` + Proofs [][32]uint8 `json:"proofs"` + ProofFlagBits *big.Int `json:"proofFlagBits"` + }) + + if !ok { + return cciptypes.ExecReport{}, fmt.Errorf("got %T", unpacked[0]) + } + messages := make([]cciptypes.EVM2EVMMessage, 0, len(erStruct.Messages)) + for _, msg := range erStruct.Messages { + var tokensAndAmounts []cciptypes.TokenAmount + for _, tokenAndAmount := range msg.TokenAmounts { + tokensAndAmounts = append(tokensAndAmounts, cciptypes.TokenAmount{ + Token: cciptypes.Address(tokenAndAmount.Token.String()), + Amount: tokenAndAmount.Amount, + }) + } + messages = append(messages, cciptypes.EVM2EVMMessage{ + SequenceNumber: msg.SequenceNumber, + GasLimit: msg.GasLimit, + Nonce: msg.Nonce, + MessageID: msg.MessageId, + SourceChainSelector: msg.SourceChainSelector, + Sender: cciptypes.Address(msg.Sender.String()), + Receiver: cciptypes.Address(msg.Receiver.String()), + Strict: msg.Strict, + FeeToken: cciptypes.Address(msg.FeeToken.String()), + FeeTokenAmount: msg.FeeTokenAmount, + Data: msg.Data, + TokenAmounts: tokensAndAmounts, + // TODO: Not needed for plugins, but should be recomputed for consistency. + // Requires the offramp knowing about onramp version + Hash: [32]byte{}, + }) + } + + // Unpack will populate with big.Int{false, } for 0 values, + // which is different from the expected big.NewInt(0). Rebuild to the expected value for this case. + return cciptypes.ExecReport{ + Messages: messages, + OffchainTokenData: erStruct.OffchainTokenData, + Proofs: erStruct.Proofs, + ProofFlagBits: new(big.Int).SetBytes(erStruct.ProofFlagBits.Bytes()), + }, nil +} + +func (o *OffRamp) DecodeExecutionReport(ctx context.Context, report []byte) (cciptypes.ExecReport, error) { + return DecodeExecReport(ctx, o.ExecutionReportArgs, report) +} + +func (o *OffRamp) RegisterFilters() error { + return logpollerutil.RegisterLpFilters(o.lp, o.filters) +} + +func NewOffRamp(lggr logger.Logger, addr common.Address, ec client.Client, lp logpoller.LogPoller, estimator gas.EvmFeeEstimator, destMaxGasPrice *big.Int) (*OffRamp, error) { + offRamp, err := evm_2_evm_offramp_1_0_0.NewEVM2EVMOffRamp(addr, ec) + if err != nil { + return nil, err + } + + executionStateChangedSequenceNumberIndex := 1 + executionReportArgs := abihelpers.MustGetMethodInputs("manuallyExecute", abiOffRamp)[:1] + filters := []logpoller.Filter{ + { + Name: logpoller.FilterName(EXEC_EXECUTION_STATE_CHANGES, addr.String()), + EventSigs: []common.Hash{ExecutionStateChangedEvent}, + Addresses: []common.Address{addr}, + Retention: ccipdata.CommitExecLogsRetention, + }, + { + Name: logpoller.FilterName(EXEC_TOKEN_POOL_ADDED, addr.String()), + EventSigs: []common.Hash{PoolAddedEvent}, + Addresses: []common.Address{addr}, + Retention: ccipdata.CacheEvictionLogsRetention, + }, + { + Name: logpoller.FilterName(EXEC_TOKEN_POOL_REMOVED, addr.String()), + EventSigs: []common.Hash{PoolRemovedEvent}, + Addresses: []common.Address{addr}, + Retention: ccipdata.CacheEvictionLogsRetention, + }, + } + + return &OffRamp{ + offRampV100: offRamp, + Client: ec, + addr: addr, + Logger: lggr, + lp: lp, + filters: filters, + Estimator: estimator, + DestMaxGasPrice: destMaxGasPrice, + ExecutionReportArgs: executionReportArgs, + eventSig: ExecutionStateChangedEvent, + eventIndex: executionStateChangedSequenceNumberIndex, + configMu: sync.RWMutex{}, + evmBatchCaller: rpclib.NewDynamicLimitedBatchCaller( + lggr, + ec, + rpclib.DefaultRpcBatchSizeLimit, + rpclib.DefaultRpcBatchBackOffMultiplier, + rpclib.DefaultMaxParallelRpcCalls, + ), + cachedOffRampTokens: cache.NewLogpollerEventsBased[cciptypes.OffRampTokens]( + lp, + offRamp_poolAddedPoolRemovedEvents, + offRamp.Address(), + ), + // values set on the fly after ChangeConfig is called + gasPriceEstimator: prices.ExecGasPriceEstimator{}, + offchainConfig: cciptypes.ExecOffchainConfig{}, + onchainConfig: cciptypes.ExecOnchainConfig{}, + }, nil +} diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_0_0/offramp_reader_test.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_0_0/offramp_reader_test.go new file mode 100644 index 00000000000..67d40df2bf4 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_0_0/offramp_reader_test.go @@ -0,0 +1,39 @@ +package v1_0_0_test + +import ( + "math/big" + "testing" + + "github.com/stretchr/testify/require" + + "github.com/smartcontractkit/chainlink-common/pkg/logger" + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + + lpmocks "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller/mocks" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_0_0" +) + +func TestExecutionReportEncodingV100(t *testing.T) { + // Note could consider some fancier testing here (fuzz/property) + // but I think that would essentially be testing geth's abi library + // as our encode/decode is a thin wrapper around that. + report := cciptypes.ExecReport{ + Messages: []cciptypes.EVM2EVMMessage{}, + OffchainTokenData: [][][]byte{{}}, + Proofs: [][32]byte{testutils.Random32Byte()}, + ProofFlagBits: big.NewInt(133), + } + + offRamp, err := v1_0_0.NewOffRamp(logger.Test(t), utils.RandomAddress(), nil, lpmocks.NewLogPoller(t), nil, nil) + require.NoError(t, err) + + ctx := testutils.Context(t) + encodeExecutionReport, err := offRamp.EncodeExecutionReport(ctx, report) + require.NoError(t, err) + decodeCommitReport, err := offRamp.DecodeExecutionReport(ctx, encodeExecutionReport) + require.NoError(t, err) + require.Equal(t, report.Proofs, decodeCommitReport.Proofs) + require.Equal(t, report, decodeCommitReport) +} diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_0_0/offramp_reader_unit_test.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_0_0/offramp_reader_unit_test.go new file mode 100644 index 00000000000..f1cd2a4f841 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_0_0/offramp_reader_unit_test.go @@ -0,0 +1,230 @@ +package v1_0_0 + +import ( + "fmt" + "math/rand" + "slices" + "testing" + + "github.com/ethereum/go-ethereum/common" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + "github.com/stretchr/testify/require" + + "github.com/smartcontractkit/chainlink-common/pkg/logger" + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + + evmclimocks "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client/mocks" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller/mocks" + evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/evm_2_evm_offramp_1_0_0" + mock_contracts "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/mocks/v1_0_0" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/cache" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipcalc" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/rpclib" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/rpclib/rpclibmocks" +) + +func TestOffRampGetDestinationTokensFromSourceTokens(t *testing.T) { + ctx := testutils.Context(t) + const numSrcTokens = 20 + + testCases := []struct { + name string + outputChangeFn func(outputs []rpclib.DataAndErr) []rpclib.DataAndErr + expErr bool + }{ + { + name: "happy path", + outputChangeFn: func(outputs []rpclib.DataAndErr) []rpclib.DataAndErr { return outputs }, + expErr: false, + }, + { + name: "rpc error", + outputChangeFn: func(outputs []rpclib.DataAndErr) []rpclib.DataAndErr { + outputs[2].Err = fmt.Errorf("some error") + return outputs + }, + expErr: true, + }, + { + name: "unexpected outputs length should be fine if the type is correct", + outputChangeFn: func(outputs []rpclib.DataAndErr) []rpclib.DataAndErr { + outputs[0].Outputs = append(outputs[0].Outputs, "unexpected", 123) + return outputs + }, + expErr: false, + }, + { + name: "different compatible type", + outputChangeFn: func(outputs []rpclib.DataAndErr) []rpclib.DataAndErr { + outputs[0].Outputs = []any{outputs[0].Outputs[0].(common.Address)} + return outputs + }, + expErr: false, + }, + { + name: "different incompatible type", + outputChangeFn: func(outputs []rpclib.DataAndErr) []rpclib.DataAndErr { + outputs[0].Outputs = []any{outputs[0].Outputs[0].(common.Address).Bytes()} + return outputs + }, + expErr: true, + }, + } + + lp := mocks.NewLogPoller(t) + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + batchCaller := rpclibmocks.NewEvmBatchCaller(t) + o := &OffRamp{evmBatchCaller: batchCaller, lp: lp} + srcTks, dstTks, outputs := generateTokensAndOutputs(numSrcTokens) + outputs = tc.outputChangeFn(outputs) + batchCaller.On("BatchCall", mock.Anything, mock.Anything, mock.Anything).Return(outputs, nil) + genericAddrs := ccipcalc.EvmAddrsToGeneric(srcTks...) + actualDstTokens, err := o.getDestinationTokensFromSourceTokens(ctx, genericAddrs) + + if tc.expErr { + assert.Error(t, err) + return + } + + assert.NoError(t, err) + assert.Equal(t, ccipcalc.EvmAddrsToGeneric(dstTks...), actualDstTokens) + }) + } +} + +func TestCachedOffRampTokens(t *testing.T) { + // Test data. + srcTks, dstTks, _ := generateTokensAndOutputs(3) + + // Mock contract wrapper. + mockOffRamp := mock_contracts.NewEVM2EVMOffRampInterface(t) + mockOffRamp.On("GetDestinationTokens", mock.Anything).Return(dstTks, nil) + mockOffRamp.On("GetSupportedTokens", mock.Anything).Return(srcTks, nil) + mockOffRamp.On("Address").Return(utils.RandomAddress()) + + lp := mocks.NewLogPoller(t) + lp.On("LatestBlock", mock.Anything).Return(logpoller.LogPollerBlock{BlockNumber: rand.Int63()}, nil) + + offRamp := OffRamp{ + offRampV100: mockOffRamp, + lp: lp, + Logger: logger.Test(t), + Client: evmclimocks.NewClient(t), + evmBatchCaller: rpclibmocks.NewEvmBatchCaller(t), + cachedOffRampTokens: cache.NewLogpollerEventsBased[cciptypes.OffRampTokens]( + lp, + offRamp_poolAddedPoolRemovedEvents, + mockOffRamp.Address(), + ), + } + + ctx := testutils.Context(t) + tokens, err := offRamp.GetTokens(ctx) + require.NoError(t, err) + + // Verify data is properly loaded in the cache. + expectedPools := make(map[cciptypes.Address]cciptypes.Address) + for i := range dstTks { + expectedPools[cciptypes.Address(dstTks[i].String())] = cciptypes.Address(dstTks[i].String()) + } + require.Equal(t, cciptypes.OffRampTokens{ + DestinationTokens: ccipcalc.EvmAddrsToGeneric(dstTks...), + SourceTokens: ccipcalc.EvmAddrsToGeneric(srcTks...), + }, tokens) +} + +func generateTokensAndOutputs(nbTokens uint) ([]common.Address, []common.Address, []rpclib.DataAndErr) { + srcTks := make([]common.Address, nbTokens) + dstTks := make([]common.Address, nbTokens) + outputs := make([]rpclib.DataAndErr, nbTokens) + for i := range srcTks { + srcTks[i] = utils.RandomAddress() + dstTks[i] = utils.RandomAddress() + outputs[i] = rpclib.DataAndErr{ + Outputs: []any{dstTks[i]}, Err: nil, + } + } + return srcTks, dstTks, outputs +} + +func Test_LogsAreProperlyMarkedAsFinalized(t *testing.T) { + minSeqNr := uint64(10) + maxSeqNr := uint64(14) + inputLogs := []logpoller.Log{ + CreateExecutionStateChangeEventLog(t, 10, 2, utils.RandomBytes32()), + CreateExecutionStateChangeEventLog(t, 11, 3, utils.RandomBytes32()), + CreateExecutionStateChangeEventLog(t, 12, 5, utils.RandomBytes32()), + CreateExecutionStateChangeEventLog(t, 14, 7, utils.RandomBytes32()), + } + + tests := []struct { + name string + lastFinalizedBlock uint64 + expectedFinalizedSequenceNr []uint64 + }{ + { + "all logs are finalized", + 10, + []uint64{10, 11, 12, 14}, + }, + { + "some logs are finalized", + 5, + []uint64{10, 11, 12}, + }, + { + "no logs are finalized", + 1, + []uint64{}, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + offrampAddress := utils.RandomAddress() + + lp := mocks.NewLogPoller(t) + lp.On("LatestBlock", mock.Anything). + Return(logpoller.LogPollerBlock{FinalizedBlockNumber: int64(tt.lastFinalizedBlock)}, nil) + lp.On("IndexedLogsTopicRange", mock.Anything, ExecutionStateChangedEvent, offrampAddress, 1, logpoller.EvmWord(minSeqNr), logpoller.EvmWord(maxSeqNr), evmtypes.Confirmations(0)). + Return(inputLogs, nil) + + offRamp, err := NewOffRamp(logger.Test(t), offrampAddress, evmclimocks.NewClient(t), lp, nil, nil) + require.NoError(t, err) + logs, err := offRamp.GetExecutionStateChangesBetweenSeqNums(testutils.Context(t), minSeqNr, maxSeqNr, 0) + require.NoError(t, err) + assert.Len(t, logs, len(inputLogs)) + + for _, log := range logs { + assert.Equal(t, slices.Contains(tt.expectedFinalizedSequenceNr, log.SequenceNumber), log.IsFinalized()) + } + }) + } +} + +func TestGetRouter(t *testing.T) { + routerAddr := utils.RandomAddress() + + mockOffRamp := mock_contracts.NewEVM2EVMOffRampInterface(t) + mockOffRamp.On("GetDynamicConfig", mock.Anything).Return(evm_2_evm_offramp_1_0_0.EVM2EVMOffRampDynamicConfig{ + Router: routerAddr, + }, nil) + + offRamp := OffRamp{ + offRampV100: mockOffRamp, + } + + ctx := testutils.Context(t) + gotRouterAddr, err := offRamp.GetRouter(ctx) + require.NoError(t, err) + + gotRouterEvmAddr, err := ccipcalc.GenericAddrToEvm(gotRouterAddr) + require.NoError(t, err) + assert.Equal(t, routerAddr, gotRouterEvmAddr) +} diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_0_0/offramp_test.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_0_0/offramp_test.go new file mode 100644 index 00000000000..234490a72c4 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_0_0/offramp_test.go @@ -0,0 +1,231 @@ +package v1_0_0 + +import ( + "encoding/json" + "testing" + "time" + + "github.com/pkg/errors" + "github.com/stretchr/testify/mock" + "github.com/stretchr/testify/require" + + "github.com/smartcontractkit/chainlink-common/pkg/config" + "github.com/smartcontractkit/chainlink-common/pkg/logger" + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" + ccipconfig "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/config" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/rpclib" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/rpclib/rpclibmocks" +) + +func TestExecOffchainConfig100_Encoding(t *testing.T) { + tests := []struct { + name string + want ExecOffchainConfig + expectErr bool + }{ + { + name: "encodes and decodes config with all fields set", + want: ExecOffchainConfig{ + SourceFinalityDepth: 3, + DestOptimisticConfirmations: 6, + DestFinalityDepth: 3, + BatchGasLimit: 5_000_000, + RelativeBoostPerWaitHour: 0.07, + InflightCacheExpiry: *config.MustNewDuration(64 * time.Second), + RootSnoozeTime: *config.MustNewDuration(128 * time.Minute), + MessageVisibilityInterval: *config.MustNewDuration(6 * time.Hour), + }, + }, + { + name: "fails decoding when all fields present but with 0 values", + want: ExecOffchainConfig{ + SourceFinalityDepth: 0, + DestFinalityDepth: 0, + DestOptimisticConfirmations: 0, + BatchGasLimit: 0, + RelativeBoostPerWaitHour: 0, + InflightCacheExpiry: *config.MustNewDuration(0), + RootSnoozeTime: *config.MustNewDuration(0), + MessageVisibilityInterval: *config.MustNewDuration(0), + }, + expectErr: true, + }, + { + name: "fails decoding when all fields are missing", + want: ExecOffchainConfig{}, + expectErr: true, + }, + { + name: "fails decoding when some fields are missing", + want: ExecOffchainConfig{ + SourceFinalityDepth: 99999999, + InflightCacheExpiry: *config.MustNewDuration(64 * time.Second), + }, + expectErr: true, + }, + } + for _, tc := range tests { + t.Run(tc.name, func(t *testing.T) { + exp := tc.want + encode, err := ccipconfig.EncodeOffchainConfig(&exp) + require.NoError(t, err) + got, err := ccipconfig.DecodeOffchainConfig[ExecOffchainConfig](encode) + + if tc.expectErr { + require.ErrorContains(t, err, "must set") + } else { + require.NoError(t, err) + require.Equal(t, tc.want, got) + } + }) + } +} + +func TestExecOffchainConfig100_AllFieldsRequired(t *testing.T) { + cfg := ExecOffchainConfig{ + SourceFinalityDepth: 3, + DestOptimisticConfirmations: 6, + DestFinalityDepth: 3, + BatchGasLimit: 5_000_000, + RelativeBoostPerWaitHour: 0.07, + InflightCacheExpiry: *config.MustNewDuration(64 * time.Second), + RootSnoozeTime: *config.MustNewDuration(128 * time.Minute), + BatchingStrategyID: 0, + } + encoded, err := ccipconfig.EncodeOffchainConfig(&cfg) + require.NoError(t, err) + + var configAsMap map[string]any + err = json.Unmarshal(encoded, &configAsMap) + require.NoError(t, err) + for keyToDelete := range configAsMap { + if keyToDelete == "MessageVisibilityInterval" { + continue // this field is optional + } + + partialConfig := make(map[string]any) + for k, v := range configAsMap { + if k != keyToDelete { + partialConfig[k] = v + } + } + encodedPartialConfig, err := json.Marshal(partialConfig) + require.NoError(t, err) + _, err = ccipconfig.DecodeOffchainConfig[ExecOffchainConfig](encodedPartialConfig) + if keyToDelete == "BatchingStrategyID" { + require.NoError(t, err) + } else { + require.ErrorContains(t, err, keyToDelete) + } + } +} + +func Test_GetSendersNonce(t *testing.T) { + sender1 := cciptypes.Address(utils.RandomAddress().String()) + sender2 := cciptypes.Address(utils.RandomAddress().String()) + + tests := []struct { + name string + addresses []cciptypes.Address + batchCaller *rpclibmocks.EvmBatchCaller + expectedResult map[cciptypes.Address]uint64 + expectedError bool + }{ + { + name: "return empty map when input is empty", + addresses: []cciptypes.Address{}, + batchCaller: rpclibmocks.NewEvmBatchCaller(t), + expectedResult: map[cciptypes.Address]uint64{}, + }, + { + name: "return error when batch call fails", + addresses: []cciptypes.Address{sender1}, + batchCaller: func() *rpclibmocks.EvmBatchCaller { + mockBatchCaller := rpclibmocks.NewEvmBatchCaller(t) + mockBatchCaller.On("BatchCall", mock.Anything, mock.Anything, mock.Anything). + Return(nil, errors.New("batch call error")) + return mockBatchCaller + }(), + expectedError: true, + }, + { + name: "return error when nonces dont match senders", + addresses: []cciptypes.Address{sender1, sender2}, + batchCaller: func() *rpclibmocks.EvmBatchCaller { + mockBatchCaller := rpclibmocks.NewEvmBatchCaller(t) + results := []rpclib.DataAndErr{ + { + Outputs: []any{uint64(1)}, + Err: nil, + }, + } + mockBatchCaller.On("BatchCall", mock.Anything, mock.Anything, mock.Anything). + Return(results, nil) + return mockBatchCaller + }(), + expectedError: true, + }, + { + name: "return error when single request from batch fails", + addresses: []cciptypes.Address{sender1, sender2}, + batchCaller: func() *rpclibmocks.EvmBatchCaller { + mockBatchCaller := rpclibmocks.NewEvmBatchCaller(t) + results := []rpclib.DataAndErr{ + { + Outputs: []any{uint64(1)}, + Err: nil, + }, + { + Outputs: []any{}, + Err: errors.New("request failed"), + }, + } + mockBatchCaller.On("BatchCall", mock.Anything, mock.Anything, mock.Anything). + Return(results, nil) + return mockBatchCaller + }(), + expectedError: true, + }, + { + name: "return map of nonce per sender", + addresses: []cciptypes.Address{sender1, sender2}, + batchCaller: func() *rpclibmocks.EvmBatchCaller { + mockBatchCaller := rpclibmocks.NewEvmBatchCaller(t) + results := []rpclib.DataAndErr{ + { + Outputs: []any{uint64(1)}, + Err: nil, + }, + { + Outputs: []any{uint64(2)}, + Err: nil, + }, + } + mockBatchCaller.On("BatchCall", mock.Anything, mock.Anything, mock.Anything). + Return(results, nil) + return mockBatchCaller + }(), + expectedResult: map[cciptypes.Address]uint64{ + sender1: uint64(1), + sender2: uint64(2), + }, + }, + } + + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + offramp := OffRamp{evmBatchCaller: test.batchCaller, Logger: logger.Test(t)} + nonce, err := offramp.ListSenderNonces(testutils.Context(t), test.addresses) + + if test.expectedError { + require.Error(t, err) + } else { + require.NoError(t, err) + require.Equal(t, test.expectedResult, nonce) + } + }) + } +} diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_0_0/onramp.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_0_0/onramp.go new file mode 100644 index 00000000000..2190d7ad491 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_0_0/onramp.go @@ -0,0 +1,241 @@ +package v1_0_0 + +import ( + "context" + "errors" + "fmt" + + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + + "github.com/smartcontractkit/chainlink-common/pkg/hashutil" + "github.com/smartcontractkit/chainlink-common/pkg/logger" + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/evm_2_evm_onramp_1_0_0" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/rmn_contract" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/abihelpers" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/cache" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/logpollerutil" +) + +const ( + CCIPSendRequestedEventName = "CCIPSendRequested" + ConfigSetEventName = "ConfigSet" +) + +var _ ccipdata.OnRampReader = &OnRamp{} + +type OnRamp struct { + address common.Address + onRamp *evm_2_evm_onramp_1_0_0.EVM2EVMOnRamp + lp logpoller.LogPoller + lggr logger.Logger + client client.Client + leafHasher ccipdata.LeafHasherInterface[[32]byte] + sendRequestedEventSig common.Hash + sendRequestedSeqNumberWord int + filters []logpoller.Filter + cachedSourcePriceRegistryAddress cache.AutoSync[cciptypes.Address] + // Static config can be cached, because it's never expected to change. + // The only way to change that is through the contract's constructor (redeployment) + cachedStaticConfig cache.OnceCtxFunction[evm_2_evm_onramp_1_0_0.EVM2EVMOnRampStaticConfig] + cachedRmnContract cache.OnceCtxFunction[*rmn_contract.RMNContract] +} + +func NewOnRamp(lggr logger.Logger, sourceSelector, destSelector uint64, onRampAddress common.Address, sourceLP logpoller.LogPoller, source client.Client) (*OnRamp, error) { + onRamp, err := evm_2_evm_onramp_1_0_0.NewEVM2EVMOnRamp(onRampAddress, source) + if err != nil { + return nil, err + } + onRampABI := abihelpers.MustParseABI(evm_2_evm_onramp_1_0_0.EVM2EVMOnRampABI) + eventSig := abihelpers.MustGetEventID(CCIPSendRequestedEventName, onRampABI) + configSetEventSig := abihelpers.MustGetEventID(ConfigSetEventName, onRampABI) + filters := []logpoller.Filter{ + { + Name: logpoller.FilterName(ccipdata.COMMIT_CCIP_SENDS, onRampAddress), + EventSigs: []common.Hash{eventSig}, + Addresses: []common.Address{onRampAddress}, + Retention: ccipdata.CommitExecLogsRetention, + }, + { + Name: logpoller.FilterName(ccipdata.CONFIG_CHANGED, onRampAddress), + EventSigs: []common.Hash{configSetEventSig}, + Addresses: []common.Address{onRampAddress}, + Retention: ccipdata.CacheEvictionLogsRetention, + }, + } + cachedStaticConfig := cache.OnceCtxFunction[evm_2_evm_onramp_1_0_0.EVM2EVMOnRampStaticConfig](func(ctx context.Context) (evm_2_evm_onramp_1_0_0.EVM2EVMOnRampStaticConfig, error) { + return onRamp.GetStaticConfig(&bind.CallOpts{Context: ctx}) + }) + cachedRmnContract := cache.OnceCtxFunction[*rmn_contract.RMNContract](func(ctx context.Context) (*rmn_contract.RMNContract, error) { + staticConfig, err := cachedStaticConfig(ctx) + if err != nil { + return nil, err + } + + return rmn_contract.NewRMNContract(staticConfig.ArmProxy, source) + }) + return &OnRamp{ + lggr: lggr, + address: onRampAddress, + onRamp: onRamp, + client: source, + filters: filters, + lp: sourceLP, + leafHasher: NewLeafHasher(sourceSelector, destSelector, onRampAddress, hashutil.NewKeccak(), onRamp), + // offset || sourceChainID || seqNum || ... + sendRequestedSeqNumberWord: 2, + sendRequestedEventSig: eventSig, + cachedSourcePriceRegistryAddress: cache.NewLogpollerEventsBased[cciptypes.Address]( + sourceLP, + []common.Hash{configSetEventSig}, + onRampAddress, + ), + cachedStaticConfig: cache.CallOnceOnNoError(cachedStaticConfig), + cachedRmnContract: cache.CallOnceOnNoError(cachedRmnContract), + }, nil +} + +func (o *OnRamp) Address(context.Context) (cciptypes.Address, error) { + return cciptypes.Address(o.onRamp.Address().String()), nil +} + +func (o *OnRamp) GetDynamicConfig(context.Context) (cciptypes.OnRampDynamicConfig, error) { + if o.onRamp == nil { + return cciptypes.OnRampDynamicConfig{}, fmt.Errorf("onramp not initialized") + } + legacyDynamicConfig, err := o.onRamp.GetDynamicConfig(nil) + if err != nil { + return cciptypes.OnRampDynamicConfig{}, err + } + return cciptypes.OnRampDynamicConfig{ + Router: cciptypes.Address(legacyDynamicConfig.Router.String()), + MaxNumberOfTokensPerMsg: legacyDynamicConfig.MaxTokensLength, + DestGasOverhead: 0, + DestGasPerPayloadByte: 0, + DestDataAvailabilityOverheadGas: 0, + DestGasPerDataAvailabilityByte: 0, + DestDataAvailabilityMultiplierBps: 0, + PriceRegistry: cciptypes.Address(legacyDynamicConfig.PriceRegistry.String()), + MaxDataBytes: legacyDynamicConfig.MaxDataSize, + MaxPerMsgGasLimit: uint32(legacyDynamicConfig.MaxGasLimit), + }, nil +} + +func (o *OnRamp) SourcePriceRegistryAddress(ctx context.Context) (cciptypes.Address, error) { + return o.cachedSourcePriceRegistryAddress.Get(ctx, func(ctx context.Context) (cciptypes.Address, error) { + c, err := o.GetDynamicConfig(ctx) + if err != nil { + return "", err + } + return c.PriceRegistry, nil + }) +} + +func (o *OnRamp) GetSendRequestsBetweenSeqNums(ctx context.Context, seqNumMin, seqNumMax uint64, finalized bool) ([]cciptypes.EVM2EVMMessageWithTxMeta, error) { + logs, err := o.lp.LogsDataWordRange( + ctx, + o.sendRequestedEventSig, + o.address, + o.sendRequestedSeqNumberWord, + logpoller.EvmWord(seqNumMin), + logpoller.EvmWord(seqNumMax), + ccipdata.LogsConfirmations(finalized), + ) + if err != nil { + return nil, err + } + + parsedLogs, err := ccipdata.ParseLogs[cciptypes.EVM2EVMMessage](logs, o.lggr, o.logToMessage) + if err != nil { + return nil, err + } + + res := make([]cciptypes.EVM2EVMMessageWithTxMeta, 0, len(parsedLogs)) + for _, log := range parsedLogs { + res = append(res, cciptypes.EVM2EVMMessageWithTxMeta{ + TxMeta: log.TxMeta, + EVM2EVMMessage: log.Data, + }) + } + return res, nil +} + +func (o *OnRamp) RouterAddress(context.Context) (cciptypes.Address, error) { + config, err := o.onRamp.GetDynamicConfig(nil) + if err != nil { + return "", err + } + return cciptypes.Address(config.Router.String()), nil +} + +func (o *OnRamp) IsSourceChainHealthy(context.Context) (bool, error) { + if err := o.lp.Healthy(); err != nil { + return false, nil + } + return true, nil +} + +func (o *OnRamp) IsSourceCursed(ctx context.Context) (bool, error) { + arm, err := o.cachedRmnContract(ctx) + if err != nil { + return false, fmt.Errorf("intializing Arm contract through the ArmProxy: %w", err) + } + + cursed, err := arm.IsCursed0(&bind.CallOpts{Context: ctx}) + if err != nil { + return false, fmt.Errorf("checking if source Arm is cursed: %w", err) + } + return cursed, nil +} + +func (o *OnRamp) GetUSDCMessagePriorToLogIndexInTx(ctx context.Context, logIndex, offsetFromFinal int64, txHash common.Hash) ([]byte, error) { + return nil, errors.New("USDC not supported in < 1.2.0") +} + +func (o *OnRamp) Close() error { + return logpollerutil.UnregisterLpFilters(o.lp, o.filters) +} + +func (o *OnRamp) RegisterFilters() error { + return logpollerutil.RegisterLpFilters(o.lp, o.filters) +} + +func (o *OnRamp) logToMessage(log types.Log) (*cciptypes.EVM2EVMMessage, error) { + msg, err := o.onRamp.ParseCCIPSendRequested(log) + if err != nil { + return nil, err + } + h, err := o.leafHasher.HashLeaf(log) + if err != nil { + return nil, err + } + tokensAndAmounts := make([]cciptypes.TokenAmount, len(msg.Message.TokenAmounts)) + for i, tokenAndAmount := range msg.Message.TokenAmounts { + tokensAndAmounts[i] = cciptypes.TokenAmount{ + Token: cciptypes.Address(tokenAndAmount.Token.String()), + Amount: tokenAndAmount.Amount, + } + } + return &cciptypes.EVM2EVMMessage{ + SequenceNumber: msg.Message.SequenceNumber, + GasLimit: msg.Message.GasLimit, + Nonce: msg.Message.Nonce, + MessageID: msg.Message.MessageId, + SourceChainSelector: msg.Message.SourceChainSelector, + Sender: cciptypes.Address(msg.Message.Sender.String()), + Receiver: cciptypes.Address(msg.Message.Receiver.String()), + Strict: msg.Message.Strict, + FeeToken: cciptypes.Address(msg.Message.FeeToken.String()), + FeeTokenAmount: msg.Message.FeeTokenAmount, + Data: msg.Message.Data, + TokenAmounts: tokensAndAmounts, + SourceTokenData: make([][]byte, len(msg.Message.TokenAmounts)), // Always empty in 1.0 + Hash: h, + }, nil +} diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_0_0/price_registry.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_0_0/price_registry.go new file mode 100644 index 00000000000..2ed9015a989 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_0_0/price_registry.go @@ -0,0 +1,309 @@ +package v1_0_0 + +import ( + "context" + "fmt" + "math/big" + "sync" + "time" + + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + + "github.com/smartcontractkit/chainlink-common/pkg/logger" + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" + evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/price_registry_1_0_0" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/shared/generated/erc20" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/abihelpers" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/cache" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipcalc" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/logpollerutil" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/rpclib" +) + +var ( + abiERC20 = abihelpers.MustParseABI(erc20.ERC20ABI) + _ ccipdata.PriceRegistryReader = &PriceRegistry{} + // Exposed only for backwards compatibility with tests. + UsdPerUnitGasUpdated = abihelpers.MustGetEventID("UsdPerUnitGasUpdated", abihelpers.MustParseABI(price_registry_1_0_0.PriceRegistryABI)) +) + +type PriceRegistry struct { + priceRegistry price_registry_1_0_0.PriceRegistryInterface + address common.Address + lp logpoller.LogPoller + evmBatchCaller rpclib.EvmBatchCaller + lggr logger.Logger + filters []logpoller.Filter + tokenUpdated common.Hash + gasUpdated common.Hash + feeTokenAdded common.Hash + feeTokenRemoved common.Hash + + feeTokensCache cache.AutoSync[[]common.Address] + tokenDecimalsCache sync.Map +} + +func NewPriceRegistry(lggr logger.Logger, priceRegistryAddr common.Address, lp logpoller.LogPoller, ec client.Client, registerFilters bool) (*PriceRegistry, error) { + priceRegistry, err := price_registry_1_0_0.NewPriceRegistry(priceRegistryAddr, ec) + if err != nil { + return nil, err + } + priceRegABI := abihelpers.MustParseABI(price_registry_1_0_0.PriceRegistryABI) + usdPerTokenUpdated := abihelpers.MustGetEventID("UsdPerTokenUpdated", priceRegABI) + feeTokenRemoved := abihelpers.MustGetEventID("FeeTokenRemoved", priceRegABI) + feeTokenAdded := abihelpers.MustGetEventID("FeeTokenAdded", priceRegABI) + var filters = []logpoller.Filter{ + { + Name: logpoller.FilterName(ccipdata.COMMIT_PRICE_UPDATES, priceRegistryAddr.String()), + EventSigs: []common.Hash{UsdPerUnitGasUpdated, usdPerTokenUpdated}, + Addresses: []common.Address{priceRegistryAddr}, + Retention: ccipdata.PriceUpdatesLogsRetention, + }, + { + Name: logpoller.FilterName(ccipdata.FEE_TOKEN_ADDED, priceRegistryAddr.String()), + EventSigs: []common.Hash{feeTokenAdded}, + Addresses: []common.Address{priceRegistryAddr}, + Retention: ccipdata.CacheEvictionLogsRetention, + }, + { + Name: logpoller.FilterName(ccipdata.FEE_TOKEN_REMOVED, priceRegistryAddr.String()), + EventSigs: []common.Hash{feeTokenRemoved}, + Addresses: []common.Address{priceRegistryAddr}, + Retention: ccipdata.CacheEvictionLogsRetention, + }} + if registerFilters { + err = logpollerutil.RegisterLpFilters(lp, filters) + if err != nil { + return nil, err + } + } + return &PriceRegistry{ + priceRegistry: priceRegistry, + address: priceRegistryAddr, + lp: lp, + evmBatchCaller: rpclib.NewDynamicLimitedBatchCaller( + lggr, + ec, + rpclib.DefaultRpcBatchSizeLimit, + rpclib.DefaultRpcBatchBackOffMultiplier, + rpclib.DefaultMaxParallelRpcCalls, + ), + lggr: lggr, + gasUpdated: UsdPerUnitGasUpdated, + tokenUpdated: usdPerTokenUpdated, + feeTokenRemoved: feeTokenRemoved, + feeTokenAdded: feeTokenAdded, + filters: filters, + feeTokensCache: cache.NewLogpollerEventsBased[[]common.Address]( + lp, + []common.Hash{feeTokenAdded, feeTokenRemoved}, + priceRegistryAddr, + ), + }, nil +} + +func (p *PriceRegistry) GetTokenPrices(ctx context.Context, wantedTokens []cciptypes.Address) ([]cciptypes.TokenPriceUpdate, error) { + evmAddrs, err := ccipcalc.GenericAddrsToEvm(wantedTokens...) + if err != nil { + return nil, err + } + + tps, err := p.priceRegistry.GetTokenPrices(&bind.CallOpts{Context: ctx}, evmAddrs) + if err != nil { + return nil, err + } + var tpu []cciptypes.TokenPriceUpdate + for i, tp := range tps { + tpu = append(tpu, cciptypes.TokenPriceUpdate{ + TokenPrice: cciptypes.TokenPrice{ + Token: cciptypes.Address(evmAddrs[i].String()), + Value: tp.Value, + }, + TimestampUnixSec: big.NewInt(int64(tp.Timestamp)), + }) + } + return tpu, nil +} + +func (p *PriceRegistry) Address(ctx context.Context) (cciptypes.Address, error) { + return cciptypes.Address(p.address.String()), nil +} + +func (p *PriceRegistry) GetFeeTokens(ctx context.Context) ([]cciptypes.Address, error) { + feeTokens, err := p.feeTokensCache.Get(ctx, func(ctx context.Context) ([]common.Address, error) { + return p.priceRegistry.GetFeeTokens(&bind.CallOpts{Context: ctx}) + }) + if err != nil { + return nil, fmt.Errorf("get fee tokens: %w", err) + } + + return ccipcalc.EvmAddrsToGeneric(feeTokens...), nil +} + +func (p *PriceRegistry) Close() error { + return logpollerutil.UnregisterLpFilters(p.lp, p.filters) +} + +func (p *PriceRegistry) GetTokenPriceUpdatesCreatedAfter(ctx context.Context, ts time.Time, confs int) ([]cciptypes.TokenPriceUpdateWithTxMeta, error) { + logs, err := p.lp.LogsCreatedAfter( + ctx, + p.tokenUpdated, + p.address, + ts, + evmtypes.Confirmations(confs), + ) + if err != nil { + return nil, err + } + + parsedLogs, err := ccipdata.ParseLogs[cciptypes.TokenPriceUpdate]( + logs, + p.lggr, + func(log types.Log) (*cciptypes.TokenPriceUpdate, error) { + tp, err1 := p.priceRegistry.ParseUsdPerTokenUpdated(log) + if err1 != nil { + return nil, err1 + } + return &cciptypes.TokenPriceUpdate{ + TokenPrice: cciptypes.TokenPrice{ + Token: cciptypes.Address(tp.Token.String()), + Value: tp.Value, + }, + TimestampUnixSec: tp.Timestamp, + }, nil + }, + ) + if err != nil { + return nil, err + } + + res := make([]cciptypes.TokenPriceUpdateWithTxMeta, 0, len(parsedLogs)) + for _, log := range parsedLogs { + res = append(res, cciptypes.TokenPriceUpdateWithTxMeta{ + TxMeta: log.TxMeta, + TokenPriceUpdate: log.Data, + }) + } + return res, nil +} + +func (p *PriceRegistry) GetGasPriceUpdatesCreatedAfter(ctx context.Context, chainSelector uint64, ts time.Time, confs int) ([]cciptypes.GasPriceUpdateWithTxMeta, error) { + logs, err := p.lp.IndexedLogsCreatedAfter( + ctx, + p.gasUpdated, + p.address, + 1, + []common.Hash{abihelpers.EvmWord(chainSelector)}, + ts, + evmtypes.Confirmations(confs), + ) + if err != nil { + return nil, err + } + return p.parseGasPriceUpdatesLogs(logs) +} + +func (p *PriceRegistry) GetAllGasPriceUpdatesCreatedAfter(ctx context.Context, ts time.Time, confs int) ([]cciptypes.GasPriceUpdateWithTxMeta, error) { + logs, err := p.lp.LogsCreatedAfter( + ctx, + p.gasUpdated, + p.address, + ts, + evmtypes.Confirmations(confs), + ) + if err != nil { + return nil, err + } + return p.parseGasPriceUpdatesLogs(logs) +} + +func (p *PriceRegistry) parseGasPriceUpdatesLogs(logs []logpoller.Log) ([]cciptypes.GasPriceUpdateWithTxMeta, error) { + parsedLogs, err := ccipdata.ParseLogs[cciptypes.GasPriceUpdate]( + logs, + p.lggr, + func(log types.Log) (*cciptypes.GasPriceUpdate, error) { + p, err1 := p.priceRegistry.ParseUsdPerUnitGasUpdated(log) + if err1 != nil { + return nil, err1 + } + return &cciptypes.GasPriceUpdate{ + GasPrice: cciptypes.GasPrice{ + DestChainSelector: p.DestChain, + Value: p.Value, + }, + TimestampUnixSec: p.Timestamp, + }, nil + }, + ) + if err != nil { + return nil, err + } + + res := make([]cciptypes.GasPriceUpdateWithTxMeta, 0, len(parsedLogs)) + for _, log := range parsedLogs { + res = append(res, cciptypes.GasPriceUpdateWithTxMeta{ + TxMeta: log.TxMeta, + GasPriceUpdate: log.Data, + }) + } + return res, nil +} + +func (p *PriceRegistry) GetTokensDecimals(ctx context.Context, tokenAddresses []cciptypes.Address) ([]uint8, error) { + evmAddrs, err := ccipcalc.GenericAddrsToEvm(tokenAddresses...) + if err != nil { + return nil, err + } + + found := make(map[common.Address]bool) + tokenDecimals := make([]uint8, len(evmAddrs)) + for i, tokenAddress := range evmAddrs { + if v, ok := p.tokenDecimalsCache.Load(tokenAddress); ok { + if decimals, isUint8 := v.(uint8); isUint8 { + tokenDecimals[i] = decimals + found[tokenAddress] = true + } else { + p.lggr.Errorf("token decimals cache contains invalid type %T", v) + } + } + } + if len(found) == len(evmAddrs) { + return tokenDecimals, nil + } + + evmCalls := make([]rpclib.EvmCall, 0, len(evmAddrs)) + for _, tokenAddress := range evmAddrs { + if !found[tokenAddress] { + evmCalls = append(evmCalls, rpclib.NewEvmCall(abiERC20, "decimals", tokenAddress)) + } + } + + results, err := p.evmBatchCaller.BatchCall(ctx, 0, evmCalls) + if err != nil { + return nil, fmt.Errorf("batch call limit: %w", err) + } + + decimals, err := rpclib.ParseOutputs[uint8](results, func(d rpclib.DataAndErr) (uint8, error) { + return rpclib.ParseOutput[uint8](d, 0) + }) + if err != nil { + return nil, fmt.Errorf("parse outputs: %w", err) + } + + j := 0 + for i, tokenAddress := range evmAddrs { + if !found[tokenAddress] { + tokenDecimals[i] = decimals[j] + p.tokenDecimalsCache.Store(tokenAddress, tokenDecimals[i]) + j++ + } + } + return tokenDecimals, nil +} diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_0_0/test_helpers.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_0_0/test_helpers.go new file mode 100644 index 00000000000..34f832e17fc --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_0_0/test_helpers.go @@ -0,0 +1,90 @@ +package v1_0_0 + +import ( + "encoding/binary" + "math/big" + "testing" + + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/evm_2_evm_offramp" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/price_registry_1_0_0" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipcalc" +) + +// ApplyPriceRegistryUpdate is a helper function used in tests only. +func ApplyPriceRegistryUpdate(t *testing.T, user *bind.TransactOpts, addr common.Address, ec client.Client, gasPrice []cciptypes.GasPrice, tokenPrices []cciptypes.TokenPrice) { + require.True(t, len(gasPrice) <= 2) + pr, err := price_registry_1_0_0.NewPriceRegistry(addr, ec) + require.NoError(t, err) + var tps []price_registry_1_0_0.InternalTokenPriceUpdate + for _, tp := range tokenPrices { + evmAddrs, err1 := ccipcalc.GenericAddrsToEvm(tp.Token) + assert.NoError(t, err1) + tps = append(tps, price_registry_1_0_0.InternalTokenPriceUpdate{ + SourceToken: evmAddrs[0], + UsdPerToken: tp.Value, + }) + } + dest := uint64(0) + gas := big.NewInt(0) + if len(gasPrice) >= 1 { + dest = gasPrice[0].DestChainSelector + gas = gasPrice[0].Value + } + _, err = pr.UpdatePrices(user, price_registry_1_0_0.InternalPriceUpdates{ + TokenPriceUpdates: tps, + DestChainSelector: dest, + UsdPerUnitGas: gas, + }) + require.NoError(t, err) + + for i := 1; i < len(gasPrice); i++ { + dest = gasPrice[i].DestChainSelector + gas = gasPrice[i].Value + _, err = pr.UpdatePrices(user, price_registry_1_0_0.InternalPriceUpdates{ + TokenPriceUpdates: []price_registry_1_0_0.InternalTokenPriceUpdate{}, + DestChainSelector: dest, + UsdPerUnitGas: gas, + }) + require.NoError(t, err) + } +} + +func CreateExecutionStateChangeEventLog(t *testing.T, seqNr uint64, blockNumber int64, messageID common.Hash) logpoller.Log { + tAbi, err := evm_2_evm_offramp.EVM2EVMOffRampMetaData.GetAbi() + require.NoError(t, err) + eseEvent, ok := tAbi.Events["ExecutionStateChanged"] + require.True(t, ok) + + logData, err := eseEvent.Inputs.NonIndexed().Pack(uint8(1), []byte("some return data")) + require.NoError(t, err) + seqNrBytes := make([]byte, 8) + binary.BigEndian.PutUint64(seqNrBytes, seqNr) + seqNrTopic := common.BytesToHash(seqNrBytes) + topic0 := evm_2_evm_offramp.EVM2EVMOffRampExecutionStateChanged{}.Topic() + + return logpoller.Log{ + Topics: [][]byte{ + topic0[:], + seqNrTopic[:], + messageID[:], + }, + Data: logData, + LogIndex: 1, + BlockHash: utils.RandomBytes32(), + BlockNumber: blockNumber, + EventSig: topic0, + Address: testutils.NewAddress(), + TxHash: utils.RandomBytes32(), + } +} diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_1_0/onramp.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_1_0/onramp.go new file mode 100644 index 00000000000..52d7985f7e3 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_1_0/onramp.go @@ -0,0 +1,70 @@ +package v1_1_0 + +import ( + "context" + "fmt" + + "github.com/ethereum/go-ethereum/common" + + "github.com/smartcontractkit/chainlink-common/pkg/logger" + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/evm_2_evm_onramp_1_1_0" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_0_0" +) + +var _ ccipdata.OnRampReader = &OnRamp{} + +// OnRamp The only difference that the plugins care about in 1.1 is that the dynamic config struct has changed. +type OnRamp struct { + *v1_0_0.OnRamp + onRamp *evm_2_evm_onramp_1_1_0.EVM2EVMOnRamp +} + +func NewOnRamp(lggr logger.Logger, sourceSelector, destSelector uint64, onRampAddress common.Address, sourceLP logpoller.LogPoller, source client.Client) (*OnRamp, error) { + onRamp, err := evm_2_evm_onramp_1_1_0.NewEVM2EVMOnRamp(onRampAddress, source) + if err != nil { + return nil, err + } + onRamp100, err := v1_0_0.NewOnRamp(lggr, sourceSelector, destSelector, onRampAddress, sourceLP, source) + if err != nil { + return nil, err + } + return &OnRamp{ + OnRamp: onRamp100, + onRamp: onRamp, + }, nil +} + +func (o *OnRamp) RouterAddress(context.Context) (cciptypes.Address, error) { + config, err := o.onRamp.GetDynamicConfig(nil) + if err != nil { + return "", err + } + return cciptypes.Address(config.Router.String()), nil +} + +func (o *OnRamp) GetDynamicConfig(context.Context) (cciptypes.OnRampDynamicConfig, error) { + if o.onRamp == nil { + return cciptypes.OnRampDynamicConfig{}, fmt.Errorf("onramp not initialized") + } + legacyDynamicConfig, err := o.onRamp.GetDynamicConfig(nil) + if err != nil { + return cciptypes.OnRampDynamicConfig{}, err + } + return cciptypes.OnRampDynamicConfig{ + Router: cciptypes.Address(legacyDynamicConfig.Router.String()), + MaxNumberOfTokensPerMsg: legacyDynamicConfig.MaxTokensLength, + DestGasOverhead: legacyDynamicConfig.DestGasOverhead, + DestGasPerPayloadByte: legacyDynamicConfig.DestGasPerPayloadByte, + DestDataAvailabilityOverheadGas: 0, + DestGasPerDataAvailabilityByte: 0, + DestDataAvailabilityMultiplierBps: 0, + PriceRegistry: cciptypes.Address(legacyDynamicConfig.PriceRegistry.String()), + MaxDataBytes: legacyDynamicConfig.MaxDataSize, + MaxPerMsgGasLimit: uint32(legacyDynamicConfig.MaxGasLimit), + }, nil +} diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/commit_store.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/commit_store.go new file mode 100644 index 00000000000..d330cab3a5d --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/commit_store.go @@ -0,0 +1,468 @@ +package v1_2_0 + +import ( + "context" + "fmt" + "math/big" + "sync" + "time" + + "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/pkg/errors" + + "github.com/smartcontractkit/chainlink-common/pkg/config" + "github.com/smartcontractkit/chainlink-common/pkg/logger" + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + "github.com/smartcontractkit/chainlink-common/pkg/types/query" + "github.com/smartcontractkit/chainlink-common/pkg/types/query/primitives" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/gas" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" + evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/commit_store_1_2_0" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/abihelpers" + ccipconfig "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/config" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipcalc" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_0_0" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/logpollerutil" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/prices" +) + +var _ ccipdata.CommitStoreReader = &CommitStore{} + +type CommitStore struct { + // Static config + commitStore *commit_store_1_2_0.CommitStore + lggr logger.Logger + lp logpoller.LogPoller + address common.Address + estimator *gas.EvmFeeEstimator + sourceMaxGasPrice *big.Int + filters []logpoller.Filter + reportAcceptedSig common.Hash + reportAcceptedMaxSeqIndex int + commitReportArgs abi.Arguments + + // Dynamic config + configMu sync.RWMutex + gasPriceEstimator *prices.DAGasPriceEstimator + offchainConfig cciptypes.CommitOffchainConfig +} + +func (c *CommitStore) GetCommitStoreStaticConfig(ctx context.Context) (cciptypes.CommitStoreStaticConfig, error) { + staticConfig, err := c.commitStore.GetStaticConfig(&bind.CallOpts{Context: ctx}) + if err != nil { + return cciptypes.CommitStoreStaticConfig{}, err + } + return cciptypes.CommitStoreStaticConfig{ + ChainSelector: staticConfig.ChainSelector, + SourceChainSelector: staticConfig.SourceChainSelector, + OnRamp: cciptypes.Address(staticConfig.OnRamp.String()), + ArmProxy: cciptypes.Address(staticConfig.ArmProxy.String()), + }, nil +} + +func (c *CommitStore) EncodeCommitReport(_ context.Context, report cciptypes.CommitStoreReport) ([]byte, error) { + return EncodeCommitReport(c.commitReportArgs, report) +} + +func EncodeCommitReport(commitReportArgs abi.Arguments, report cciptypes.CommitStoreReport) ([]byte, error) { + var tokenPriceUpdates []commit_store_1_2_0.InternalTokenPriceUpdate + for _, tokenPriceUpdate := range report.TokenPrices { + tokenAddressEvm, err := ccipcalc.GenericAddrToEvm(tokenPriceUpdate.Token) + if err != nil { + return nil, fmt.Errorf("token price update address to evm: %w", err) + } + + tokenPriceUpdates = append(tokenPriceUpdates, commit_store_1_2_0.InternalTokenPriceUpdate{ + SourceToken: tokenAddressEvm, + UsdPerToken: tokenPriceUpdate.Value, + }) + } + + var gasPriceUpdates []commit_store_1_2_0.InternalGasPriceUpdate + for _, gasPriceUpdate := range report.GasPrices { + gasPriceUpdates = append(gasPriceUpdates, commit_store_1_2_0.InternalGasPriceUpdate{ + DestChainSelector: gasPriceUpdate.DestChainSelector, + UsdPerUnitGas: gasPriceUpdate.Value, + }) + } + + rep := commit_store_1_2_0.CommitStoreCommitReport{ + PriceUpdates: commit_store_1_2_0.InternalPriceUpdates{ + TokenPriceUpdates: tokenPriceUpdates, + GasPriceUpdates: gasPriceUpdates, + }, + Interval: commit_store_1_2_0.CommitStoreInterval{Min: report.Interval.Min, Max: report.Interval.Max}, + MerkleRoot: report.MerkleRoot, + } + return commitReportArgs.PackValues([]interface{}{rep}) +} + +func DecodeCommitReport(commitReportArgs abi.Arguments, report []byte) (cciptypes.CommitStoreReport, error) { + unpacked, err := commitReportArgs.Unpack(report) + if err != nil { + return cciptypes.CommitStoreReport{}, err + } + if len(unpacked) != 1 { + return cciptypes.CommitStoreReport{}, errors.New("expected single struct value") + } + + commitReport, ok := unpacked[0].(struct { + PriceUpdates struct { + TokenPriceUpdates []struct { + SourceToken common.Address `json:"sourceToken"` + UsdPerToken *big.Int `json:"usdPerToken"` + } `json:"tokenPriceUpdates"` + GasPriceUpdates []struct { + DestChainSelector uint64 `json:"destChainSelector"` + UsdPerUnitGas *big.Int `json:"usdPerUnitGas"` + } `json:"gasPriceUpdates"` + } `json:"priceUpdates"` + Interval struct { + Min uint64 `json:"min"` + Max uint64 `json:"max"` + } `json:"interval"` + MerkleRoot [32]byte `json:"merkleRoot"` + }) + if !ok { + return cciptypes.CommitStoreReport{}, errors.Errorf("invalid commit report got %T", unpacked[0]) + } + + var tokenPriceUpdates []cciptypes.TokenPrice + for _, u := range commitReport.PriceUpdates.TokenPriceUpdates { + tokenPriceUpdates = append(tokenPriceUpdates, cciptypes.TokenPrice{ + Token: cciptypes.Address(u.SourceToken.String()), + Value: u.UsdPerToken, + }) + } + + var gasPrices []cciptypes.GasPrice + for _, u := range commitReport.PriceUpdates.GasPriceUpdates { + gasPrices = append(gasPrices, cciptypes.GasPrice{ + DestChainSelector: u.DestChainSelector, + Value: u.UsdPerUnitGas, + }) + } + + return cciptypes.CommitStoreReport{ + TokenPrices: tokenPriceUpdates, + GasPrices: gasPrices, + Interval: cciptypes.CommitStoreInterval{ + Min: commitReport.Interval.Min, + Max: commitReport.Interval.Max, + }, + MerkleRoot: commitReport.MerkleRoot, + }, nil +} + +func (c *CommitStore) DecodeCommitReport(_ context.Context, report []byte) (cciptypes.CommitStoreReport, error) { + return DecodeCommitReport(c.commitReportArgs, report) +} + +func (c *CommitStore) IsBlessed(ctx context.Context, root [32]byte) (bool, error) { + return c.commitStore.IsBlessed(&bind.CallOpts{Context: ctx}, root) +} + +func (c *CommitStore) OffchainConfig(context.Context) (cciptypes.CommitOffchainConfig, error) { + c.configMu.RLock() + defer c.configMu.RUnlock() + return c.offchainConfig, nil +} + +func (c *CommitStore) GasPriceEstimator(context.Context) (cciptypes.GasPriceEstimatorCommit, error) { + c.configMu.RLock() + defer c.configMu.RUnlock() + return c.gasPriceEstimator, nil +} + +func (c *CommitStore) SetGasEstimator(ctx context.Context, gpe gas.EvmFeeEstimator) error { + c.configMu.RLock() + defer c.configMu.RUnlock() + c.estimator = &gpe + return nil +} + +func (c *CommitStore) SetSourceMaxGasPrice(ctx context.Context, sourceMaxGasPrice *big.Int) error { + c.configMu.RLock() + defer c.configMu.RUnlock() + c.sourceMaxGasPrice = sourceMaxGasPrice + return nil +} + +// Do not change the JSON format of this struct without consulting with the RDD people first. +type JSONCommitOffchainConfig struct { + SourceFinalityDepth uint32 + DestFinalityDepth uint32 + GasPriceHeartBeat config.Duration + DAGasPriceDeviationPPB uint32 + ExecGasPriceDeviationPPB uint32 + TokenPriceHeartBeat config.Duration + TokenPriceDeviationPPB uint32 + InflightCacheExpiry config.Duration + PriceReportingDisabled bool +} + +func (c JSONCommitOffchainConfig) Validate() error { + if c.GasPriceHeartBeat.Duration() == 0 { + return errors.New("must set GasPriceHeartBeat") + } + if c.ExecGasPriceDeviationPPB == 0 { + return errors.New("must set ExecGasPriceDeviationPPB") + } + if c.TokenPriceHeartBeat.Duration() == 0 { + return errors.New("must set TokenPriceHeartBeat") + } + if c.TokenPriceDeviationPPB == 0 { + return errors.New("must set TokenPriceDeviationPPB") + } + if c.InflightCacheExpiry.Duration() == 0 { + return errors.New("must set InflightCacheExpiry") + } + // DAGasPriceDeviationPPB is not validated because it can be 0 on non-rollups + + return nil +} + +func (c *CommitStore) ChangeConfig(_ context.Context, onchainConfig []byte, offchainConfig []byte) (cciptypes.Address, error) { + onchainConfigParsed, err := abihelpers.DecodeAbiStruct[ccipdata.CommitOnchainConfig](onchainConfig) + if err != nil { + return "", err + } + + offchainConfigParsed, err := ccipconfig.DecodeOffchainConfig[JSONCommitOffchainConfig](offchainConfig) + if err != nil { + return "", err + } + c.configMu.Lock() + defer c.configMu.Unlock() + + if c.estimator == nil { + return "", fmt.Errorf("this CommitStore estimator is nil. SetGasEstimator should be called before ChangeConfig") + } + + if c.sourceMaxGasPrice == nil { + return "", fmt.Errorf("this CommitStore sourceMaxGasPrice is nil. SetSourceMaxGasPrice should be called before ChangeConfig") + } + + c.gasPriceEstimator = prices.NewDAGasPriceEstimator( + *c.estimator, + c.sourceMaxGasPrice, + int64(offchainConfigParsed.ExecGasPriceDeviationPPB), + int64(offchainConfigParsed.DAGasPriceDeviationPPB), + ) + c.offchainConfig = ccipdata.NewCommitOffchainConfig( + offchainConfigParsed.ExecGasPriceDeviationPPB, + offchainConfigParsed.GasPriceHeartBeat.Duration(), + offchainConfigParsed.TokenPriceDeviationPPB, + offchainConfigParsed.TokenPriceHeartBeat.Duration(), + offchainConfigParsed.InflightCacheExpiry.Duration(), + offchainConfigParsed.PriceReportingDisabled, + ) + + c.lggr.Infow("ChangeConfig", + "offchainConfig", offchainConfigParsed, + "onchainConfig", onchainConfigParsed, + ) + return cciptypes.Address(onchainConfigParsed.PriceRegistry.String()), nil +} + +func (c *CommitStore) Close() error { + return logpollerutil.UnregisterLpFilters(c.lp, c.filters) +} + +func (c *CommitStore) parseReport(log types.Log) (*cciptypes.CommitStoreReport, error) { + repAccepted, err := c.commitStore.ParseReportAccepted(log) + if err != nil { + return nil, err + } + // Translate to common struct. + var tokenPrices []cciptypes.TokenPrice + for _, tpu := range repAccepted.Report.PriceUpdates.TokenPriceUpdates { + tokenPrices = append(tokenPrices, cciptypes.TokenPrice{ + Token: cciptypes.Address(tpu.SourceToken.String()), + Value: tpu.UsdPerToken, + }) + } + var gasPrices []cciptypes.GasPrice + for _, tpu := range repAccepted.Report.PriceUpdates.GasPriceUpdates { + gasPrices = append(gasPrices, cciptypes.GasPrice{ + DestChainSelector: tpu.DestChainSelector, + Value: tpu.UsdPerUnitGas, + }) + } + + return &cciptypes.CommitStoreReport{ + TokenPrices: tokenPrices, + GasPrices: gasPrices, + MerkleRoot: repAccepted.Report.MerkleRoot, + Interval: cciptypes.CommitStoreInterval{Min: repAccepted.Report.Interval.Min, Max: repAccepted.Report.Interval.Max}, + }, nil +} + +func (c *CommitStore) GetCommitReportMatchingSeqNum(ctx context.Context, seqNr uint64, confs int) ([]cciptypes.CommitStoreReportWithTxMeta, error) { + logs, err := c.lp.LogsDataWordBetween( + ctx, + c.reportAcceptedSig, + c.address, + c.reportAcceptedMaxSeqIndex-1, + c.reportAcceptedMaxSeqIndex, + logpoller.EvmWord(seqNr), + evmtypes.Confirmations(confs), + ) + if err != nil { + return nil, err + } + + parsedLogs, err := ccipdata.ParseLogs[cciptypes.CommitStoreReport]( + logs, + c.lggr, + c.parseReport, + ) + if err != nil { + return nil, err + } + + res := make([]cciptypes.CommitStoreReportWithTxMeta, 0, len(parsedLogs)) + for _, log := range parsedLogs { + res = append(res, cciptypes.CommitStoreReportWithTxMeta{ + TxMeta: log.TxMeta, + CommitStoreReport: log.Data, + }) + } + + if len(res) > 1 { + c.lggr.Errorw("More than one report found for seqNr", "seqNr", seqNr, "commitReports", parsedLogs) + return res[:1], nil + } + return res, nil +} + +func (c *CommitStore) GetAcceptedCommitReportsGteTimestamp(ctx context.Context, ts time.Time, confs int) ([]cciptypes.CommitStoreReportWithTxMeta, error) { + latestBlock, err := c.lp.LatestBlock(ctx) + if err != nil { + return nil, err + } + + reportsQuery, err := logpoller.Where( + logpoller.NewAddressFilter(c.address), + logpoller.NewEventSigFilter(c.reportAcceptedSig), + query.Timestamp(uint64(ts.Unix()), primitives.Gte), + logpoller.NewConfirmationsFilter(evmtypes.Confirmations(confs)), + ) + if err != nil { + return nil, err + } + + logs, err := c.lp.FilteredLogs( + ctx, + reportsQuery, + query.NewLimitAndSort(query.Limit{}, query.NewSortBySequence(query.Asc)), + "GetAcceptedCommitReportsGteTimestamp", + ) + if err != nil { + return nil, err + } + + parsedLogs, err := ccipdata.ParseLogs[cciptypes.CommitStoreReport](logs, c.lggr, c.parseReport) + if err != nil { + return nil, fmt.Errorf("parse logs: %w", err) + } + + res := make([]cciptypes.CommitStoreReportWithTxMeta, 0, len(parsedLogs)) + for _, log := range parsedLogs { + res = append(res, cciptypes.CommitStoreReportWithTxMeta{ + TxMeta: log.TxMeta.WithFinalityStatus(uint64(latestBlock.FinalizedBlockNumber)), + CommitStoreReport: log.Data, + }) + } + return res, nil +} + +func (c *CommitStore) GetExpectedNextSequenceNumber(ctx context.Context) (uint64, error) { + return c.commitStore.GetExpectedNextSequenceNumber(&bind.CallOpts{Context: ctx}) +} + +func (c *CommitStore) GetLatestPriceEpochAndRound(ctx context.Context) (uint64, error) { + return c.commitStore.GetLatestPriceEpochAndRound(&bind.CallOpts{Context: ctx}) +} + +func (c *CommitStore) IsDestChainHealthy(context.Context) (bool, error) { + if err := c.lp.Healthy(); err != nil { + return false, nil + } + return true, nil +} + +func (c *CommitStore) IsDown(ctx context.Context) (bool, error) { + unPausedAndHealthy, err := c.commitStore.IsUnpausedAndARMHealthy(&bind.CallOpts{Context: ctx}) + if err != nil { + return true, err + } + return !unPausedAndHealthy, nil +} + +func (c *CommitStore) VerifyExecutionReport(ctx context.Context, report cciptypes.ExecReport) (bool, error) { + var hashes [][32]byte + for _, msg := range report.Messages { + hashes = append(hashes, msg.Hash) + } + res, err := c.commitStore.Verify(&bind.CallOpts{Context: ctx}, hashes, report.Proofs, report.ProofFlagBits) + if err != nil { + c.lggr.Errorw("Unable to call verify", "messages", report.Messages, "err", err) + return false, nil + } + // No timestamp, means failed to verify root. + if res.Cmp(big.NewInt(0)) == 0 { + c.lggr.Errorw("Root does not verify", "messages", report.Messages) + return false, nil + } + return true, nil +} + +func (c *CommitStore) RegisterFilters() error { + return logpollerutil.RegisterLpFilters(c.lp, c.filters) +} + +func NewCommitStore(lggr logger.Logger, addr common.Address, ec client.Client, lp logpoller.LogPoller) (*CommitStore, error) { + commitStore, err := commit_store_1_2_0.NewCommitStore(addr, ec) + if err != nil { + return nil, err + } + commitStoreABI := abihelpers.MustParseABI(commit_store_1_2_0.CommitStoreABI) + eventSig := abihelpers.MustGetEventID(v1_0_0.ReportAccepted, commitStoreABI) + commitReportArgs := abihelpers.MustGetEventInputs(v1_0_0.ReportAccepted, commitStoreABI) + filters := []logpoller.Filter{ + { + Name: logpoller.FilterName(v1_0_0.EXEC_REPORT_ACCEPTS, addr.String()), + EventSigs: []common.Hash{eventSig}, + Addresses: []common.Address{addr}, + Retention: ccipdata.CommitExecLogsRetention, + }, + } + + return &CommitStore{ + commitStore: commitStore, + address: addr, + lggr: lggr, + lp: lp, + + // Note that sourceMaxGasPrice and estimator now have explicit setters (CCIP-2493) + + filters: filters, + commitReportArgs: commitReportArgs, + reportAcceptedSig: eventSig, + // offset || priceUpdatesOffset || minSeqNum || maxSeqNum || merkleRoot + reportAcceptedMaxSeqIndex: 3, + configMu: sync.RWMutex{}, + + // The fields below are initially empty and set on ChangeConfig method + offchainConfig: cciptypes.CommitOffchainConfig{}, + gasPriceEstimator: nil, + }, nil +} diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/commit_store_test.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/commit_store_test.go new file mode 100644 index 00000000000..e0771f33cb9 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/commit_store_test.go @@ -0,0 +1,223 @@ +package v1_2_0 + +import ( + "math/big" + "math/rand" + "testing" + "time" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + "github.com/smartcontractkit/chainlink-common/pkg/config" + "github.com/smartcontractkit/chainlink-common/pkg/logger" + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller/mocks" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" + ccipconfig "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/config" +) + +func TestCommitReportEncoding(t *testing.T) { + t.Parallel() + ctx := testutils.Context(t) + report := cciptypes.CommitStoreReport{ + TokenPrices: []cciptypes.TokenPrice{ + { + Token: cciptypes.Address(utils.RandomAddress().String()), + Value: big.NewInt(9e18), + }, + { + Token: cciptypes.Address(utils.RandomAddress().String()), + Value: big.NewInt(1e18), + }, + }, + GasPrices: []cciptypes.GasPrice{ + { + DestChainSelector: rand.Uint64(), + Value: big.NewInt(2000e9), + }, + { + DestChainSelector: rand.Uint64(), + Value: big.NewInt(3000e9), + }, + }, + MerkleRoot: [32]byte{123}, + Interval: cciptypes.CommitStoreInterval{Min: 1, Max: 10}, + } + + c, err := NewCommitStore(logger.Test(t), utils.RandomAddress(), nil, mocks.NewLogPoller(t)) + assert.NoError(t, err) + + encodedReport, err := c.EncodeCommitReport(ctx, report) + require.NoError(t, err) + assert.Greater(t, len(encodedReport), 0) + + decodedReport, err := c.DecodeCommitReport(ctx, encodedReport) + require.NoError(t, err) + require.Equal(t, report, decodedReport) +} + +func TestCommitStoreV120ffchainConfigEncoding(t *testing.T) { + t.Parallel() + validConfig := JSONCommitOffchainConfig{ + SourceFinalityDepth: 3, + DestFinalityDepth: 4, + GasPriceHeartBeat: *config.MustNewDuration(1 * time.Minute), + DAGasPriceDeviationPPB: 10, + ExecGasPriceDeviationPPB: 11, + TokenPriceHeartBeat: *config.MustNewDuration(2 * time.Minute), + TokenPriceDeviationPPB: 12, + InflightCacheExpiry: *config.MustNewDuration(3 * time.Minute), + } + + require.NoError(t, validConfig.Validate()) + + tests := []struct { + name string + want JSONCommitOffchainConfig + errPattern string + }{ + { + name: "legacy offchain config format parses", + want: validConfig, + }, + { + name: "can omit finality depth", + want: modifyCopy(validConfig, func(c *JSONCommitOffchainConfig) { + c.SourceFinalityDepth = 0 + c.DestFinalityDepth = 0 + }), + }, + { + name: "can set PriceReportingDisabled", + want: modifyCopy(validConfig, func(c *JSONCommitOffchainConfig) { + c.PriceReportingDisabled = true + }), + }, + { + name: "must set GasPriceHeartBeat", + want: modifyCopy(validConfig, func(c *JSONCommitOffchainConfig) { + c.GasPriceHeartBeat = *config.MustNewDuration(0) + }), + errPattern: "GasPriceHeartBeat", + }, + { + name: "must set ExecGasPriceDeviationPPB", + want: modifyCopy(validConfig, func(c *JSONCommitOffchainConfig) { + c.ExecGasPriceDeviationPPB = 0 + }), + errPattern: "ExecGasPriceDeviationPPB", + }, + { + name: "must set TokenPriceHeartBeat", + want: modifyCopy(validConfig, func(c *JSONCommitOffchainConfig) { + c.TokenPriceHeartBeat = *config.MustNewDuration(0) + }), + errPattern: "TokenPriceHeartBeat", + }, + { + name: "must set TokenPriceDeviationPPB", + want: modifyCopy(validConfig, func(c *JSONCommitOffchainConfig) { + c.TokenPriceDeviationPPB = 0 + }), + errPattern: "TokenPriceDeviationPPB", + }, + { + name: "must set InflightCacheExpiry", + want: modifyCopy(validConfig, func(c *JSONCommitOffchainConfig) { + c.InflightCacheExpiry = *config.MustNewDuration(0) + }), + errPattern: "InflightCacheExpiry", + }, + } + for _, tc := range tests { + t.Run(tc.name, func(t *testing.T) { + exp := tc.want + encode, err := ccipconfig.EncodeOffchainConfig(&exp) + require.NoError(t, err) + got, err := ccipconfig.DecodeOffchainConfig[JSONCommitOffchainConfig](encode) + + if tc.errPattern != "" { + require.ErrorContains(t, err, tc.errPattern) + } else { + require.NoError(t, err) + require.Equal(t, tc.want, got) + } + }) + } +} + +func TestCommitStoreV120ffchainConfigDecodingCompatibility(t *testing.T) { + t.Parallel() + + tests := []struct { + name string + config []byte + priceReportingDisabled bool + }{ + { + name: "with MaxGasPrice", + config: []byte(`{ + "SourceFinalityDepth": 3, + "DestFinalityDepth": 4, + "GasPriceHeartBeat": "60s", + "DAGasPriceDeviationPPB": 10, + "ExecGasPriceDeviationPPB": 11, + "TokenPriceHeartBeat": "120s", + "TokenPriceDeviationPPB": 12, + "MaxGasPrice": 100000000, + "SourceMaxGasPrice": 100000000, + "InflightCacheExpiry": "180s" + }`), + priceReportingDisabled: false, + }, + { + name: "without MaxGasPrice", + config: []byte(`{ + "SourceFinalityDepth": 3, + "DestFinalityDepth": 4, + "GasPriceHeartBeat": "60s", + "DAGasPriceDeviationPPB": 10, + "ExecGasPriceDeviationPPB": 11, + "TokenPriceHeartBeat": "120s", + "TokenPriceDeviationPPB": 12, + "InflightCacheExpiry": "180s" + }`), + priceReportingDisabled: false, + }, + { + name: "with PriceReportingDisabled", + config: []byte(`{ + "SourceFinalityDepth": 3, + "DestFinalityDepth": 4, + "GasPriceHeartBeat": "60s", + "DAGasPriceDeviationPPB": 10, + "ExecGasPriceDeviationPPB": 11, + "TokenPriceHeartBeat": "120s", + "TokenPriceDeviationPPB": 12, + "InflightCacheExpiry": "180s", + "PriceReportingDisabled": true + }`), + priceReportingDisabled: true, + }, + } + for _, tc := range tests { + t.Run(tc.name, func(t *testing.T) { + decoded, err := ccipconfig.DecodeOffchainConfig[JSONCommitOffchainConfig](tc.config) + require.NoError(t, err) + require.Equal(t, JSONCommitOffchainConfig{ + SourceFinalityDepth: 3, + DestFinalityDepth: 4, + GasPriceHeartBeat: *config.MustNewDuration(1 * time.Minute), + DAGasPriceDeviationPPB: 10, + ExecGasPriceDeviationPPB: 11, + TokenPriceHeartBeat: *config.MustNewDuration(2 * time.Minute), + TokenPriceDeviationPPB: 12, + InflightCacheExpiry: *config.MustNewDuration(3 * time.Minute), + PriceReportingDisabled: tc.priceReportingDisabled, + }, decoded) + }) + } +} diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/hasher.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/hasher.go new file mode 100644 index 00000000000..4739c946c36 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/hasher.go @@ -0,0 +1,101 @@ +package v1_2_0 + +import ( + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + + "github.com/smartcontractkit/chainlink-common/pkg/hashutil" + + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/evm_2_evm_onramp_1_2_0" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/abihelpers" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_0_0" +) + +const ( + MetaDataHashPrefix = "EVM2EVMMessageHashV2" +) + +type LeafHasher struct { + metaDataHash [32]byte + ctx hashutil.Hasher[[32]byte] + onRamp *evm_2_evm_onramp_1_2_0.EVM2EVMOnRamp +} + +func NewLeafHasher(sourceChainSelector uint64, destChainSelector uint64, onRampId common.Address, ctx hashutil.Hasher[[32]byte], onRamp *evm_2_evm_onramp_1_2_0.EVM2EVMOnRamp) *LeafHasher { + return &LeafHasher{ + metaDataHash: v1_0_0.GetMetaDataHash(ctx, ctx.Hash([]byte(MetaDataHashPrefix)), sourceChainSelector, onRampId, destChainSelector), + ctx: ctx, + onRamp: onRamp, + } +} + +func (t *LeafHasher) HashLeaf(log types.Log) ([32]byte, error) { + msg, err := t.onRamp.ParseCCIPSendRequested(log) + if err != nil { + return [32]byte{}, err + } + message := msg.Message + encodedTokens, err := abihelpers.ABIEncode( + `[ +{"components": [{"name":"token","type":"address"},{"name":"amount","type":"uint256"}], "type":"tuple[]"}]`, message.TokenAmounts) + if err != nil { + return [32]byte{}, err + } + + bytesArray, err := abi.NewType("bytes[]", "bytes[]", nil) + if err != nil { + return [32]byte{}, err + } + + encodedSourceTokenData, err := abi.Arguments{abi.Argument{Type: bytesArray}}.PackValues([]interface{}{message.SourceTokenData}) + if err != nil { + return [32]byte{}, err + } + + packedFixedSizeValues, err := abihelpers.ABIEncode( + `[ +{"name": "sender", "type":"address"}, +{"name": "receiver", "type":"address"}, +{"name": "sequenceNumber", "type":"uint64"}, +{"name": "gasLimit", "type":"uint256"}, +{"name": "strict", "type":"bool"}, +{"name": "nonce", "type":"uint64"}, +{"name": "feeToken","type": "address"}, +{"name": "feeTokenAmount","type": "uint256"} +]`, + message.Sender, + message.Receiver, + message.SequenceNumber, + message.GasLimit, + message.Strict, + message.Nonce, + message.FeeToken, + message.FeeTokenAmount, + ) + if err != nil { + return [32]byte{}, err + } + fixedSizeValuesHash := t.ctx.Hash(packedFixedSizeValues) + + packedValues, err := abihelpers.ABIEncode( + `[ +{"name": "leafDomainSeparator","type":"bytes1"}, +{"name": "metadataHash", "type":"bytes32"}, +{"name": "fixedSizeValuesHash", "type":"bytes32"}, +{"name": "dataHash", "type":"bytes32"}, +{"name": "tokenAmountsHash", "type":"bytes32"}, +{"name": "sourceTokenDataHash", "type":"bytes32"} +]`, + v1_0_0.LeafDomainSeparator, + t.metaDataHash, + fixedSizeValuesHash, + t.ctx.Hash(message.Data), + t.ctx.Hash(encodedTokens), + t.ctx.Hash(encodedSourceTokenData), + ) + if err != nil { + return [32]byte{}, err + } + return t.ctx.Hash(packedValues), nil +} diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/hasher_test.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/hasher_test.go new file mode 100644 index 00000000000..4bfbf7295e6 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/hasher_test.go @@ -0,0 +1,78 @@ +package v1_2_0 + +import ( + "encoding/hex" + "math/big" + "testing" + + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/stretchr/testify/require" + + "github.com/smartcontractkit/chainlink-common/pkg/hashutil" + + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/evm_2_evm_onramp_1_2_0" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/abihelpers" +) + +func TestHasherV1_2_0(t *testing.T) { + sourceChainSelector, destChainSelector := uint64(1), uint64(4) + onRampAddress := common.HexToAddress("0x5550000000000000000000000000000000000001") + onRampABI := abihelpers.MustParseABI(evm_2_evm_onramp_1_2_0.EVM2EVMOnRampABI) + + hashingCtx := hashutil.NewKeccak() + ramp, err := evm_2_evm_onramp_1_2_0.NewEVM2EVMOnRamp(onRampAddress, nil) + require.NoError(t, err) + hasher := NewLeafHasher(sourceChainSelector, destChainSelector, onRampAddress, hashingCtx, ramp) + + message := evm_2_evm_onramp_1_2_0.InternalEVM2EVMMessage{ + SourceChainSelector: sourceChainSelector, + Sender: common.HexToAddress("0x1110000000000000000000000000000000000001"), + Receiver: common.HexToAddress("0x2220000000000000000000000000000000000001"), + SequenceNumber: 1337, + GasLimit: big.NewInt(100), + Strict: false, + Nonce: 1337, + FeeToken: common.Address{}, + FeeTokenAmount: big.NewInt(1), + Data: []byte{}, + TokenAmounts: []evm_2_evm_onramp_1_2_0.ClientEVMTokenAmount{{Token: common.HexToAddress("0x4440000000000000000000000000000000000001"), Amount: big.NewInt(12345678900)}}, + SourceTokenData: [][]byte{}, + MessageId: [32]byte{}, + } + + data, err := onRampABI.Events[CCIPSendRequestedEventName].Inputs.Pack(message) + require.NoError(t, err) + hash, err := hasher.HashLeaf(types.Log{Topics: []common.Hash{CCIPSendRequestEventSig}, Data: data}) + require.NoError(t, err) + + // NOTE: Must match spec + require.Equal(t, "46ad031bfb052db2e4a2514fed8dc480b98e5ce4acb55d5640d91407e0d8a3e9", hex.EncodeToString(hash[:])) + + message = evm_2_evm_onramp_1_2_0.InternalEVM2EVMMessage{ + SourceChainSelector: sourceChainSelector, + Sender: common.HexToAddress("0x1110000000000000000000000000000000000001"), + Receiver: common.HexToAddress("0x2220000000000000000000000000000000000001"), + SequenceNumber: 1337, + GasLimit: big.NewInt(100), + Strict: false, + Nonce: 1337, + FeeToken: common.Address{}, + FeeTokenAmount: big.NewInt(1e12), + Data: []byte("foo bar baz"), + TokenAmounts: []evm_2_evm_onramp_1_2_0.ClientEVMTokenAmount{ + {Token: common.HexToAddress("0x4440000000000000000000000000000000000001"), Amount: big.NewInt(12345678900)}, + {Token: common.HexToAddress("0x6660000000000000000000000000000000000001"), Amount: big.NewInt(4204242)}, + }, + SourceTokenData: [][]byte{{0x2, 0x1}}, + MessageId: [32]byte{}, + } + + data, err = onRampABI.Events[CCIPSendRequestedEventName].Inputs.Pack(message) + require.NoError(t, err) + hash, err = hasher.HashLeaf(types.Log{Topics: []common.Hash{CCIPSendRequestEventSig}, Data: data}) + require.NoError(t, err) + + // NOTE: Must match spec + require.Equal(t, "4362a13a42e52ff5ce4324e7184dc7aa41704c3146bc842d35d95b94b32a78b6", hex.EncodeToString(hash[:])) +} diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/offramp.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/offramp.go new file mode 100644 index 00000000000..1f404397430 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/offramp.go @@ -0,0 +1,339 @@ +package v1_2_0 + +import ( + "context" + "fmt" + "math/big" + "time" + + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/pkg/errors" + + "github.com/smartcontractkit/chainlink-common/pkg/config" + "github.com/smartcontractkit/chainlink-common/pkg/logger" + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/gas" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/evm_2_evm_offramp_1_2_0" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/router" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/abihelpers" + ccipconfig "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/config" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipcalc" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_0_0" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/prices" +) + +var ( + abiOffRamp = abihelpers.MustParseABI(evm_2_evm_offramp_1_2_0.EVM2EVMOffRampABI) + _ ccipdata.OffRampReader = &OffRamp{} +) + +type ExecOnchainConfig evm_2_evm_offramp_1_2_0.EVM2EVMOffRampDynamicConfig + +func (d ExecOnchainConfig) AbiString() string { + return ` + [ + { + "components": [ + {"name": "permissionLessExecutionThresholdSeconds", "type": "uint32"}, + {"name": "router", "type": "address"}, + {"name": "priceRegistry", "type": "address"}, + {"name": "maxNumberOfTokensPerMsg", "type": "uint16"}, + {"name": "maxDataBytes", "type": "uint32"}, + {"name": "maxPoolReleaseOrMintGas", "type": "uint32"} + ], + "type": "tuple" + } + ]` +} + +func (d ExecOnchainConfig) Validate() error { + if d.PermissionLessExecutionThresholdSeconds == 0 { + return errors.New("must set PermissionLessExecutionThresholdSeconds") + } + if d.Router == (common.Address{}) { + return errors.New("must set Router address") + } + if d.PriceRegistry == (common.Address{}) { + return errors.New("must set PriceRegistry address") + } + if d.MaxNumberOfTokensPerMsg == 0 { + return errors.New("must set MaxNumberOfTokensPerMsg") + } + if d.MaxPoolReleaseOrMintGas == 0 { + return errors.New("must set MaxPoolReleaseOrMintGas") + } + return nil +} + +// JSONExecOffchainConfig is the configuration for nodes executing committed CCIP messages (v1.2). +// It comes from the OffchainConfig field of the corresponding OCR2 plugin configuration. +// NOTE: do not change the JSON format of this struct without consulting with the RDD people first. +type JSONExecOffchainConfig struct { + // SourceFinalityDepth indicates how many confirmations a transaction should get on the source chain event before we consider it finalized. + // + // Deprecated: we now use the source chain finality instead. + SourceFinalityDepth uint32 + // See [ccipdata.ExecOffchainConfig.DestOptimisticConfirmations] + DestOptimisticConfirmations uint32 + // DestFinalityDepth indicates how many confirmations a transaction should get on the destination chain event before we consider it finalized. + // + // Deprecated: we now use the destination chain finality instead. + DestFinalityDepth uint32 + // See [ccipdata.ExecOffchainConfig.BatchGasLimit] + BatchGasLimit uint32 + // See [ccipdata.ExecOffchainConfig.RelativeBoostPerWaitHour] + RelativeBoostPerWaitHour float64 + // See [ccipdata.ExecOffchainConfig.InflightCacheExpiry] + InflightCacheExpiry config.Duration + // See [ccipdata.ExecOffchainConfig.RootSnoozeTime] + RootSnoozeTime config.Duration + // See [ccipdata.ExecOffchainConfig.BatchingStrategyID] + BatchingStrategyID uint32 + // See [ccipdata.ExecOffchainConfig.MessageVisibilityInterval] + MessageVisibilityInterval config.Duration +} + +func (c JSONExecOffchainConfig) Validate() error { + if c.DestOptimisticConfirmations == 0 { + return errors.New("must set DestOptimisticConfirmations") + } + if c.BatchGasLimit == 0 { + return errors.New("must set BatchGasLimit") + } + if c.RelativeBoostPerWaitHour == 0 { + return errors.New("must set RelativeBoostPerWaitHour") + } + if c.InflightCacheExpiry.Duration() == 0 { + return errors.New("must set InflightCacheExpiry") + } + if c.RootSnoozeTime.Duration() == 0 { + return errors.New("must set RootSnoozeTime") + } + + return nil +} + +// OffRamp In 1.2 we have a different estimator impl +type OffRamp struct { + *v1_0_0.OffRamp + offRampV120 evm_2_evm_offramp_1_2_0.EVM2EVMOffRampInterface +} + +func (o *OffRamp) CurrentRateLimiterState(ctx context.Context) (cciptypes.TokenBucketRateLimit, error) { + bucket, err := o.offRampV120.CurrentRateLimiterState(&bind.CallOpts{Context: ctx}) + if err != nil { + return cciptypes.TokenBucketRateLimit{}, err + } + return cciptypes.TokenBucketRateLimit{ + Tokens: bucket.Tokens, + LastUpdated: bucket.LastUpdated, + IsEnabled: bucket.IsEnabled, + Capacity: bucket.Capacity, + Rate: bucket.Rate, + }, nil +} + +func (o *OffRamp) GetRouter(ctx context.Context) (cciptypes.Address, error) { + dynamicConfig, err := o.offRampV120.GetDynamicConfig(&bind.CallOpts{Context: ctx}) + if err != nil { + return "", err + } + return ccipcalc.EvmAddrToGeneric(dynamicConfig.Router), nil +} + +func (o *OffRamp) ChangeConfig(ctx context.Context, onchainConfigBytes []byte, offchainConfigBytes []byte) (cciptypes.Address, cciptypes.Address, error) { + // Same as the v1.0.0 method, except for the ExecOnchainConfig type. + onchainConfigParsed, err := abihelpers.DecodeAbiStruct[ExecOnchainConfig](onchainConfigBytes) + if err != nil { + return "", "", err + } + + offchainConfigParsed, err := ccipconfig.DecodeOffchainConfig[JSONExecOffchainConfig](offchainConfigBytes) + if err != nil { + return "", "", err + } + destRouter, err := router.NewRouter(onchainConfigParsed.Router, o.Client) + if err != nil { + return "", "", err + } + destWrappedNative, err := destRouter.GetWrappedNative(nil) + if err != nil { + return "", "", err + } + offchainConfig := cciptypes.ExecOffchainConfig{ + DestOptimisticConfirmations: offchainConfigParsed.DestOptimisticConfirmations, + BatchGasLimit: offchainConfigParsed.BatchGasLimit, + RelativeBoostPerWaitHour: offchainConfigParsed.RelativeBoostPerWaitHour, + InflightCacheExpiry: offchainConfigParsed.InflightCacheExpiry, + RootSnoozeTime: offchainConfigParsed.RootSnoozeTime, + MessageVisibilityInterval: offchainConfigParsed.MessageVisibilityInterval, + BatchingStrategyID: offchainConfigParsed.BatchingStrategyID, + } + onchainConfig := cciptypes.ExecOnchainConfig{ + PermissionLessExecutionThresholdSeconds: time.Second * time.Duration(onchainConfigParsed.PermissionLessExecutionThresholdSeconds), + Router: cciptypes.Address(onchainConfigParsed.Router.String()), + } + priceEstimator := prices.NewDAGasPriceEstimator(o.Estimator, o.DestMaxGasPrice, 0, 0) + + o.UpdateDynamicConfig(onchainConfig, offchainConfig, priceEstimator) + + o.Logger.Infow("Starting exec plugin", + "offchainConfig", onchainConfigParsed, + "onchainConfig", offchainConfigParsed) + return cciptypes.Address(onchainConfigParsed.PriceRegistry.String()), + cciptypes.Address(destWrappedNative.String()), nil +} + +func EncodeExecutionReport(ctx context.Context, args abi.Arguments, report cciptypes.ExecReport) ([]byte, error) { + var msgs []evm_2_evm_offramp_1_2_0.InternalEVM2EVMMessage + for _, msg := range report.Messages { + var ta []evm_2_evm_offramp_1_2_0.ClientEVMTokenAmount + for _, tokenAndAmount := range msg.TokenAmounts { + evmAddrs, err := ccipcalc.GenericAddrsToEvm(tokenAndAmount.Token) + if err != nil { + return nil, err + } + ta = append(ta, evm_2_evm_offramp_1_2_0.ClientEVMTokenAmount{ + Token: evmAddrs[0], + Amount: tokenAndAmount.Amount, + }) + } + + evmAddrs, err := ccipcalc.GenericAddrsToEvm(msg.Sender, msg.Receiver, msg.FeeToken) + if err != nil { + return nil, err + } + + msgs = append(msgs, evm_2_evm_offramp_1_2_0.InternalEVM2EVMMessage{ + SourceChainSelector: msg.SourceChainSelector, + Sender: evmAddrs[0], + Receiver: evmAddrs[1], + SequenceNumber: msg.SequenceNumber, + GasLimit: msg.GasLimit, + Strict: msg.Strict, + Nonce: msg.Nonce, + FeeToken: evmAddrs[2], + FeeTokenAmount: msg.FeeTokenAmount, + Data: msg.Data, + TokenAmounts: ta, + MessageId: msg.MessageID, + // NOTE: this field is new in v1.2. + SourceTokenData: msg.SourceTokenData, + }) + } + + rep := evm_2_evm_offramp_1_2_0.InternalExecutionReport{ + Messages: msgs, + OffchainTokenData: report.OffchainTokenData, + Proofs: report.Proofs, + ProofFlagBits: report.ProofFlagBits, + } + return args.PackValues([]interface{}{&rep}) +} + +func (o *OffRamp) EncodeExecutionReport(ctx context.Context, report cciptypes.ExecReport) ([]byte, error) { + return EncodeExecutionReport(ctx, o.ExecutionReportArgs, report) +} + +func DecodeExecReport(ctx context.Context, args abi.Arguments, report []byte) (cciptypes.ExecReport, error) { + unpacked, err := args.Unpack(report) + if err != nil { + return cciptypes.ExecReport{}, err + } + if len(unpacked) == 0 { + return cciptypes.ExecReport{}, errors.New("assumptionViolation: expected at least one element") + } + // Must be anonymous struct here + erStruct, ok := unpacked[0].(struct { + Messages []struct { + SourceChainSelector uint64 `json:"sourceChainSelector"` + Sender common.Address `json:"sender"` + Receiver common.Address `json:"receiver"` + SequenceNumber uint64 `json:"sequenceNumber"` + GasLimit *big.Int `json:"gasLimit"` + Strict bool `json:"strict"` + Nonce uint64 `json:"nonce"` + FeeToken common.Address `json:"feeToken"` + FeeTokenAmount *big.Int `json:"feeTokenAmount"` + Data []uint8 `json:"data"` + TokenAmounts []struct { + Token common.Address `json:"token"` + Amount *big.Int `json:"amount"` + } `json:"tokenAmounts"` + SourceTokenData [][]uint8 `json:"sourceTokenData"` + MessageId [32]uint8 `json:"messageId"` + } `json:"messages"` + OffchainTokenData [][][]uint8 `json:"offchainTokenData"` + Proofs [][32]uint8 `json:"proofs"` + ProofFlagBits *big.Int `json:"proofFlagBits"` + }) + if !ok { + return cciptypes.ExecReport{}, fmt.Errorf("got %T", unpacked[0]) + } + messages := make([]cciptypes.EVM2EVMMessage, 0, len(erStruct.Messages)) + for _, msg := range erStruct.Messages { + var tokensAndAmounts []cciptypes.TokenAmount + for _, tokenAndAmount := range msg.TokenAmounts { + tokensAndAmounts = append(tokensAndAmounts, cciptypes.TokenAmount{ + Token: cciptypes.Address(tokenAndAmount.Token.String()), + Amount: tokenAndAmount.Amount, + }) + } + messages = append(messages, cciptypes.EVM2EVMMessage{ + SequenceNumber: msg.SequenceNumber, + GasLimit: msg.GasLimit, + Nonce: msg.Nonce, + MessageID: msg.MessageId, + SourceChainSelector: msg.SourceChainSelector, + Sender: cciptypes.Address(msg.Sender.String()), + Receiver: cciptypes.Address(msg.Receiver.String()), + Strict: msg.Strict, + FeeToken: cciptypes.Address(msg.FeeToken.String()), + FeeTokenAmount: msg.FeeTokenAmount, + Data: msg.Data, + TokenAmounts: tokensAndAmounts, + SourceTokenData: msg.SourceTokenData, + // TODO: Not needed for plugins, but should be recomputed for consistency. + // Requires the offramp knowing about onramp version + Hash: [32]byte{}, + }) + } + + // Unpack will populate with big.Int{false, } for 0 values, + // which is different from the expected big.NewInt(0). Rebuild to the expected value for this case. + return cciptypes.ExecReport{ + Messages: messages, + OffchainTokenData: erStruct.OffchainTokenData, + Proofs: erStruct.Proofs, + ProofFlagBits: new(big.Int).SetBytes(erStruct.ProofFlagBits.Bytes()), + }, nil +} + +func (o *OffRamp) DecodeExecutionReport(ctx context.Context, report []byte) (cciptypes.ExecReport, error) { + return DecodeExecReport(ctx, o.ExecutionReportArgs, report) +} + +func NewOffRamp(lggr logger.Logger, addr common.Address, ec client.Client, lp logpoller.LogPoller, estimator gas.EvmFeeEstimator, destMaxGasPrice *big.Int) (*OffRamp, error) { + v100, err := v1_0_0.NewOffRamp(lggr, addr, ec, lp, estimator, destMaxGasPrice) + if err != nil { + return nil, err + } + + offRamp, err := evm_2_evm_offramp_1_2_0.NewEVM2EVMOffRamp(addr, ec) + if err != nil { + return nil, err + } + + v100.ExecutionReportArgs = abihelpers.MustGetMethodInputs("manuallyExecute", abiOffRamp)[:1] + + return &OffRamp{ + OffRamp: v100, + offRampV120: offRamp, + }, nil +} diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/offramp_reader_test.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/offramp_reader_test.go new file mode 100644 index 00000000000..630b92f67fc --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/offramp_reader_test.go @@ -0,0 +1,39 @@ +package v1_2_0_test + +import ( + "math/big" + "testing" + + "github.com/stretchr/testify/require" + + "github.com/smartcontractkit/chainlink-common/pkg/logger" + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + + lpmocks "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller/mocks" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0" +) + +func TestExecutionReportEncodingV120(t *testing.T) { + // Note could consider some fancier testing here (fuzz/property) + // but I think that would essentially be testing geth's abi library + // as our encode/decode is a thin wrapper around that. + report := cciptypes.ExecReport{ + Messages: []cciptypes.EVM2EVMMessage{}, + OffchainTokenData: [][][]byte{{}}, + Proofs: [][32]byte{testutils.Random32Byte()}, + ProofFlagBits: big.NewInt(133), + } + + offRamp, err := v1_2_0.NewOffRamp(logger.Test(t), utils.RandomAddress(), nil, lpmocks.NewLogPoller(t), nil, nil) + require.NoError(t, err) + + ctx := testutils.Context(t) + encodeExecutionReport, err := offRamp.EncodeExecutionReport(ctx, report) + require.NoError(t, err) + decodeCommitReport, err := offRamp.DecodeExecutionReport(ctx, encodeExecutionReport) + require.NoError(t, err) + require.Equal(t, report.Proofs, decodeCommitReport.Proofs) + require.Equal(t, report, decodeCommitReport) +} diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/offramp_reader_unit_test.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/offramp_reader_unit_test.go new file mode 100644 index 00000000000..98454ce59b2 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/offramp_reader_unit_test.go @@ -0,0 +1,36 @@ +package v1_2_0 + +import ( + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + "github.com/stretchr/testify/require" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/evm_2_evm_offramp_1_2_0" + mock_contracts "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/mocks/v1_2_0" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipcalc" +) + +func TestGetRouter(t *testing.T) { + routerAddr := utils.RandomAddress() + + mockOffRamp := mock_contracts.NewEVM2EVMOffRampInterface(t) + mockOffRamp.On("GetDynamicConfig", mock.Anything).Return(evm_2_evm_offramp_1_2_0.EVM2EVMOffRampDynamicConfig{ + Router: routerAddr, + }, nil) + + offRamp := OffRamp{ + offRampV120: mockOffRamp, + } + + ctx := testutils.Context(t) + gotRouterAddr, err := offRamp.GetRouter(ctx) + require.NoError(t, err) + + gotRouterEvmAddr, err := ccipcalc.GenericAddrToEvm(gotRouterAddr) + require.NoError(t, err) + assert.Equal(t, routerAddr, gotRouterEvmAddr) +} diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/offramp_test.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/offramp_test.go new file mode 100644 index 00000000000..7d174d5db71 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/offramp_test.go @@ -0,0 +1,173 @@ +package v1_2_0 + +import ( + "testing" + "time" + + "github.com/stretchr/testify/require" + + "github.com/smartcontractkit/chainlink-common/pkg/config" + + ccipconfig "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/config" +) + +func modifyCopy[T any](c T, f func(c *T)) T { + f(&c) + return c +} + +func TestExecOffchainConfig120_Encoding(t *testing.T) { + t.Parallel() + validConfig := JSONExecOffchainConfig{ + SourceFinalityDepth: 3, + DestOptimisticConfirmations: 6, + DestFinalityDepth: 3, + BatchGasLimit: 5_000_000, + RelativeBoostPerWaitHour: 0.07, + InflightCacheExpiry: *config.MustNewDuration(64 * time.Second), + RootSnoozeTime: *config.MustNewDuration(128 * time.Minute), + BatchingStrategyID: 0, + } + + tests := []struct { + name string + want JSONExecOffchainConfig + errPattern string + }{ + { + name: "legacy offchain config format parses", + want: validConfig, + }, + { + name: "can omit finality depth", + want: modifyCopy(validConfig, func(c *JSONExecOffchainConfig) { + c.SourceFinalityDepth = 0 + c.DestFinalityDepth = 0 + }), + }, + { + name: "must set BatchGasLimit", + want: modifyCopy(validConfig, func(c *JSONExecOffchainConfig) { + c.BatchGasLimit = 0 + }), + errPattern: "BatchGasLimit", + }, + { + name: "must set DestOptimisticConfirmations", + want: modifyCopy(validConfig, func(c *JSONExecOffchainConfig) { + c.DestOptimisticConfirmations = 0 + }), + errPattern: "DestOptimisticConfirmations", + }, + { + name: "must set RelativeBoostPerWaitHour", + want: modifyCopy(validConfig, func(c *JSONExecOffchainConfig) { + c.RelativeBoostPerWaitHour = 0 + }), + errPattern: "RelativeBoostPerWaitHour", + }, + { + name: "must set InflightCacheExpiry", + want: modifyCopy(validConfig, func(c *JSONExecOffchainConfig) { + c.InflightCacheExpiry = *config.MustNewDuration(0) + }), + errPattern: "InflightCacheExpiry", + }, + { + name: "must set RootSnoozeTime", + want: modifyCopy(validConfig, func(c *JSONExecOffchainConfig) { + c.RootSnoozeTime = *config.MustNewDuration(0) + }), + errPattern: "RootSnoozeTime", + }, + { + name: "must set BatchingStrategyId", + want: modifyCopy(validConfig, func(c *JSONExecOffchainConfig) { + c.BatchingStrategyID = 1 + }), + }, + } + for _, tc := range tests { + t.Run(tc.name, func(t *testing.T) { + exp := tc.want + encode, err := ccipconfig.EncodeOffchainConfig(&exp) + require.NoError(t, err) + got, err := ccipconfig.DecodeOffchainConfig[JSONExecOffchainConfig](encode) + + if tc.errPattern != "" { + require.ErrorContains(t, err, tc.errPattern) + } else { + require.NoError(t, err) + require.Equal(t, tc.want, got) + } + }) + } +} + +func TestExecOffchainConfig120_ParseRawJson(t *testing.T) { + t.Parallel() + + tests := []struct { + name string + config []byte + }{ + { + name: "with MaxGasPrice", + config: []byte(`{ + "DestOptimisticConfirmations": 6, + "BatchGasLimit": 5000000, + "RelativeBoostPerWaitHour": 0.07, + "MaxGasPrice": 200000000000, + "InflightCacheExpiry": "64s", + "RootSnoozeTime": "128m" + }`), + }, + { + name: "without MaxGasPrice", + config: []byte(`{ + "DestOptimisticConfirmations": 6, + "BatchGasLimit": 5000000, + "RelativeBoostPerWaitHour": 0.07, + "InflightCacheExpiry": "64s", + "RootSnoozeTime": "128m" + }`), + }, + { + name: "with BatchingStrategyId", + config: []byte(`{ + "DestOptimisticConfirmations": 6, + "BatchGasLimit": 5000000, + "RelativeBoostPerWaitHour": 0.07, + "InflightCacheExpiry": "64s", + "RootSnoozeTime": "128m", + "BatchingStrategyId": 1 + }`), + }, + } + for _, tc := range tests { + t.Run(tc.name, func(t *testing.T) { + decoded, err := ccipconfig.DecodeOffchainConfig[JSONExecOffchainConfig](tc.config) + require.NoError(t, err) + + if tc.name == "with BatchingStrategyId" { + require.Equal(t, JSONExecOffchainConfig{ + DestOptimisticConfirmations: 6, + BatchGasLimit: 5_000_000, + RelativeBoostPerWaitHour: 0.07, + InflightCacheExpiry: *config.MustNewDuration(64 * time.Second), + RootSnoozeTime: *config.MustNewDuration(128 * time.Minute), + BatchingStrategyID: 1, // Actual value + }, decoded) + } else { + require.Equal(t, JSONExecOffchainConfig{ + DestOptimisticConfirmations: 6, + BatchGasLimit: 5_000_000, + RelativeBoostPerWaitHour: 0.07, + InflightCacheExpiry: *config.MustNewDuration(64 * time.Second), + RootSnoozeTime: *config.MustNewDuration(128 * time.Minute), + BatchingStrategyID: 0, // Default + }, decoded) + } + }) + } +} diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/onramp.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/onramp.go new file mode 100644 index 00000000000..071e8a8e03e --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/onramp.go @@ -0,0 +1,256 @@ +package v1_2_0 + +import ( + "context" + "fmt" + "strings" + + "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/smartcontractkit/chainlink-common/pkg/hashutil" + "github.com/smartcontractkit/chainlink-common/pkg/logger" + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/evm_2_evm_onramp_1_2_0" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/rmn_contract" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/abihelpers" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/cache" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/logpollerutil" +) + +var ( + // Backwards compat for integration tests + CCIPSendRequestEventSig common.Hash + ConfigSetEventSig common.Hash +) + +const ( + CCIPSendRequestSeqNumIndex = 4 + CCIPSendRequestedEventName = "CCIPSendRequested" + ConfigSetEventName = "ConfigSet" +) + +func init() { + onRampABI, err := abi.JSON(strings.NewReader(evm_2_evm_onramp_1_2_0.EVM2EVMOnRampABI)) + if err != nil { + panic(err) + } + CCIPSendRequestEventSig = abihelpers.MustGetEventID(CCIPSendRequestedEventName, onRampABI) + ConfigSetEventSig = abihelpers.MustGetEventID(ConfigSetEventName, onRampABI) +} + +var _ ccipdata.OnRampReader = &OnRamp{} + +// Significant change in 1.2: +// - CCIPSendRequested event signature has changed +type OnRamp struct { + onRamp *evm_2_evm_onramp_1_2_0.EVM2EVMOnRamp + address common.Address + lggr logger.Logger + lp logpoller.LogPoller + leafHasher ccipdata.LeafHasherInterface[[32]byte] + client client.Client + sendRequestedEventSig common.Hash + sendRequestedSeqNumberWord int + filters []logpoller.Filter + cachedSourcePriceRegistryAddress cache.AutoSync[cciptypes.Address] + // Static config can be cached, because it's never expected to change. + // The only way to change that is through the contract's constructor (redeployment) + cachedStaticConfig cache.OnceCtxFunction[evm_2_evm_onramp_1_2_0.EVM2EVMOnRampStaticConfig] + cachedRmnContract cache.OnceCtxFunction[*rmn_contract.RMNContract] +} + +func NewOnRamp(lggr logger.Logger, sourceSelector, destSelector uint64, onRampAddress common.Address, sourceLP logpoller.LogPoller, source client.Client) (*OnRamp, error) { + onRamp, err := evm_2_evm_onramp_1_2_0.NewEVM2EVMOnRamp(onRampAddress, source) + if err != nil { + return nil, err + } + // Subscribe to the relevant logs + // Note we can keep the same prefix across 1.0/1.1 and 1.2 because the onramp addresses will be different + filters := []logpoller.Filter{ + { + Name: logpoller.FilterName(ccipdata.COMMIT_CCIP_SENDS, onRampAddress), + EventSigs: []common.Hash{CCIPSendRequestEventSig}, + Addresses: []common.Address{onRampAddress}, + Retention: ccipdata.CommitExecLogsRetention, + }, + { + Name: logpoller.FilterName(ccipdata.CONFIG_CHANGED, onRampAddress), + EventSigs: []common.Hash{ConfigSetEventSig}, + Addresses: []common.Address{onRampAddress}, + Retention: ccipdata.CacheEvictionLogsRetention, + }, + } + cachedStaticConfig := cache.OnceCtxFunction[evm_2_evm_onramp_1_2_0.EVM2EVMOnRampStaticConfig](func(ctx context.Context) (evm_2_evm_onramp_1_2_0.EVM2EVMOnRampStaticConfig, error) { + return onRamp.GetStaticConfig(&bind.CallOpts{Context: ctx}) + }) + cachedRmnContract := cache.OnceCtxFunction[*rmn_contract.RMNContract](func(ctx context.Context) (*rmn_contract.RMNContract, error) { + staticConfig, err := cachedStaticConfig(ctx) + if err != nil { + return nil, err + } + + return rmn_contract.NewRMNContract(staticConfig.ArmProxy, source) + }) + return &OnRamp{ + lggr: lggr, + client: source, + lp: sourceLP, + leafHasher: NewLeafHasher(sourceSelector, destSelector, onRampAddress, hashutil.NewKeccak(), onRamp), + onRamp: onRamp, + filters: filters, + address: onRampAddress, + sendRequestedSeqNumberWord: CCIPSendRequestSeqNumIndex, + sendRequestedEventSig: CCIPSendRequestEventSig, + cachedSourcePriceRegistryAddress: cache.NewLogpollerEventsBased[cciptypes.Address]( + sourceLP, + []common.Hash{ConfigSetEventSig}, + onRampAddress, + ), + cachedStaticConfig: cache.CallOnceOnNoError(cachedStaticConfig), + cachedRmnContract: cache.CallOnceOnNoError(cachedRmnContract), + }, nil +} + +func (o *OnRamp) Address(context.Context) (cciptypes.Address, error) { + return cciptypes.Address(o.onRamp.Address().String()), nil +} + +func (o *OnRamp) GetDynamicConfig(context.Context) (cciptypes.OnRampDynamicConfig, error) { + if o.onRamp == nil { + return cciptypes.OnRampDynamicConfig{}, fmt.Errorf("onramp not initialized") + } + config, err := o.onRamp.GetDynamicConfig(&bind.CallOpts{}) + if err != nil { + return cciptypes.OnRampDynamicConfig{}, fmt.Errorf("get dynamic config v1.2: %w", err) + } + return cciptypes.OnRampDynamicConfig{ + Router: cciptypes.Address(config.Router.String()), + MaxNumberOfTokensPerMsg: config.MaxNumberOfTokensPerMsg, + DestGasOverhead: config.DestGasOverhead, + DestGasPerPayloadByte: config.DestGasPerPayloadByte, + DestDataAvailabilityOverheadGas: config.DestDataAvailabilityOverheadGas, + DestGasPerDataAvailabilityByte: config.DestGasPerDataAvailabilityByte, + DestDataAvailabilityMultiplierBps: config.DestDataAvailabilityMultiplierBps, + PriceRegistry: cciptypes.Address(config.PriceRegistry.String()), + MaxDataBytes: config.MaxDataBytes, + MaxPerMsgGasLimit: config.MaxPerMsgGasLimit, + }, nil +} + +func (o *OnRamp) SourcePriceRegistryAddress(ctx context.Context) (cciptypes.Address, error) { + return o.cachedSourcePriceRegistryAddress.Get(ctx, func(ctx context.Context) (cciptypes.Address, error) { + c, err := o.GetDynamicConfig(ctx) + if err != nil { + return "", err + } + return c.PriceRegistry, nil + }) +} + +func (o *OnRamp) GetSendRequestsBetweenSeqNums(ctx context.Context, seqNumMin, seqNumMax uint64, finalized bool) ([]cciptypes.EVM2EVMMessageWithTxMeta, error) { + logs, err := o.lp.LogsDataWordRange( + ctx, + o.sendRequestedEventSig, + o.address, + o.sendRequestedSeqNumberWord, + logpoller.EvmWord(seqNumMin), + logpoller.EvmWord(seqNumMax), + ccipdata.LogsConfirmations(finalized), + ) + if err != nil { + return nil, err + } + + parsedLogs, err := ccipdata.ParseLogs[cciptypes.EVM2EVMMessage](logs, o.lggr, o.logToMessage) + if err != nil { + return nil, err + } + + res := make([]cciptypes.EVM2EVMMessageWithTxMeta, 0, len(logs)) + for _, log := range parsedLogs { + res = append(res, cciptypes.EVM2EVMMessageWithTxMeta{ + TxMeta: log.TxMeta, + EVM2EVMMessage: log.Data, + }) + } + + return res, nil +} + +func (o *OnRamp) RouterAddress(context.Context) (cciptypes.Address, error) { + config, err := o.onRamp.GetDynamicConfig(nil) + if err != nil { + return "", err + } + return cciptypes.Address(config.Router.String()), nil +} + +func (o *OnRamp) IsSourceChainHealthy(context.Context) (bool, error) { + if err := o.lp.Healthy(); err != nil { + return false, nil + } + return true, nil +} + +func (o *OnRamp) IsSourceCursed(ctx context.Context) (bool, error) { + arm, err := o.cachedRmnContract(ctx) + if err != nil { + return false, fmt.Errorf("intializing Arm contract through the ArmProxy: %w", err) + } + + cursed, err := arm.IsCursed0(&bind.CallOpts{Context: ctx}) + if err != nil { + return false, fmt.Errorf("checking if source Arm is cursed: %w", err) + } + return cursed, nil +} + +func (o *OnRamp) Close() error { + return logpollerutil.UnregisterLpFilters(o.lp, o.filters) +} + +func (o *OnRamp) RegisterFilters() error { + return logpollerutil.RegisterLpFilters(o.lp, o.filters) +} + +func (o *OnRamp) logToMessage(log types.Log) (*cciptypes.EVM2EVMMessage, error) { + msg, err := o.onRamp.ParseCCIPSendRequested(log) + if err != nil { + return nil, err + } + h, err := o.leafHasher.HashLeaf(log) + if err != nil { + return nil, err + } + tokensAndAmounts := make([]cciptypes.TokenAmount, len(msg.Message.TokenAmounts)) + for i, tokenAndAmount := range msg.Message.TokenAmounts { + tokensAndAmounts[i] = cciptypes.TokenAmount{ + Token: cciptypes.Address(tokenAndAmount.Token.String()), + Amount: tokenAndAmount.Amount, + } + } + + return &cciptypes.EVM2EVMMessage{ + SequenceNumber: msg.Message.SequenceNumber, + GasLimit: msg.Message.GasLimit, + Nonce: msg.Message.Nonce, + MessageID: msg.Message.MessageId, + SourceChainSelector: msg.Message.SourceChainSelector, + Sender: cciptypes.Address(msg.Message.Sender.String()), + Receiver: cciptypes.Address(msg.Message.Receiver.String()), + Strict: msg.Message.Strict, + FeeToken: cciptypes.Address(msg.Message.FeeToken.String()), + FeeTokenAmount: msg.Message.FeeTokenAmount, + Data: msg.Message.Data, + TokenAmounts: tokensAndAmounts, + SourceTokenData: msg.Message.SourceTokenData, // Breaking change 1.2 + Hash: h, + }, nil +} diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/onramp_test.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/onramp_test.go new file mode 100644 index 00000000000..bbdf52e23a4 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/onramp_test.go @@ -0,0 +1,58 @@ +package v1_2_0 + +import ( + "context" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + "github.com/stretchr/testify/require" + + "github.com/smartcontractkit/chainlink-common/pkg/logger" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller/mocks" + evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/abihelpers" +) + +func TestLogPollerClient_GetSendRequestsBetweenSeqNumsV1_2_0(t *testing.T) { + onRampAddr := utils.RandomAddress() + seqNum := uint64(100) + limit := uint64(10) + lggr := logger.Test(t) + + tests := []struct { + name string + finalized bool + confirmations evmtypes.Confirmations + }{ + {"finalized", true, evmtypes.Finalized}, + {"unfinalized", false, evmtypes.Confirmations(0)}, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + lp := mocks.NewLogPoller(t) + onRampV2, err := NewOnRamp(lggr, 1, 1, onRampAddr, lp, nil) + require.NoError(t, err) + + lp.On("LogsDataWordRange", + mock.Anything, + onRampV2.sendRequestedEventSig, + onRampAddr, + onRampV2.sendRequestedSeqNumberWord, + abihelpers.EvmWord(seqNum), + abihelpers.EvmWord(seqNum+limit), + tt.confirmations, + ).Once().Return([]logpoller.Log{}, nil) + + events, err1 := onRampV2.GetSendRequestsBetweenSeqNums(context.Background(), seqNum, seqNum+limit, tt.finalized) + assert.NoError(t, err1) + assert.Empty(t, events) + + lp.AssertExpectations(t) + }) + } +} diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/price_registry.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/price_registry.go new file mode 100644 index 00000000000..df958233779 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/price_registry.go @@ -0,0 +1,69 @@ +package v1_2_0 + +import ( + "context" + "math/big" + + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + + "github.com/smartcontractkit/chainlink-common/pkg/logger" + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/price_registry_1_2_0" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipcalc" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_0_0" +) + +var ( + _ ccipdata.PriceRegistryReader = &PriceRegistry{} +) + +type PriceRegistry struct { + *v1_0_0.PriceRegistry + pr *price_registry_1_2_0.PriceRegistry +} + +func NewPriceRegistry(lggr logger.Logger, priceRegistryAddr common.Address, lp logpoller.LogPoller, ec client.Client, registerFilters bool) (*PriceRegistry, error) { + v100, err := v1_0_0.NewPriceRegistry(lggr, priceRegistryAddr, lp, ec, registerFilters) + if err != nil { + return nil, err + } + priceRegistry, err := price_registry_1_2_0.NewPriceRegistry(priceRegistryAddr, ec) + if err != nil { + return nil, err + } + return &PriceRegistry{ + PriceRegistry: v100, + pr: priceRegistry, + }, nil +} + +// GetTokenPrices must be overridden to use the 1.2 ABI (return parameter changed from uint192 to uint224) +// See https://github.com/smartcontractkit/ccip/blob/ccip-develop/contracts/src/v0.8/ccip/PriceRegistry.sol#L141 +func (p *PriceRegistry) GetTokenPrices(ctx context.Context, wantedTokens []cciptypes.Address) ([]cciptypes.TokenPriceUpdate, error) { + evmAddrs, err := ccipcalc.GenericAddrsToEvm(wantedTokens...) + if err != nil { + return nil, err + } + + // Make call using 224 ABI. + tps, err := p.pr.GetTokenPrices(&bind.CallOpts{Context: ctx}, evmAddrs) + if err != nil { + return nil, err + } + var tpu []cciptypes.TokenPriceUpdate + for i, tp := range tps { + tpu = append(tpu, cciptypes.TokenPriceUpdate{ + TokenPrice: cciptypes.TokenPrice{ + Token: wantedTokens[i], + Value: tp.Value, + }, + TimestampUnixSec: big.NewInt(int64(tp.Timestamp)), + }) + } + return tpu, nil +} diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/test_helpers.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/test_helpers.go new file mode 100644 index 00000000000..fb991be59da --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/test_helpers.go @@ -0,0 +1,48 @@ +package v1_2_0 + +import ( + "testing" + + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/fee_quoter" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipcalc" +) + +// ApplyPriceRegistryUpdate is a helper function used in tests only. +func ApplyPriceRegistryUpdate(t *testing.T, user *bind.TransactOpts, addr common.Address, ec client.Client, gasPrices []cciptypes.GasPrice, tokenPrices []cciptypes.TokenPrice) common.Hash { + require.True(t, len(gasPrices) <= 2) + pr, err := fee_quoter.NewFeeQuoter(addr, ec) + require.NoError(t, err) + o, err := pr.Owner(nil) + require.NoError(t, err) + require.Equal(t, user.From, o) + var tps []fee_quoter.InternalTokenPriceUpdate + for _, tp := range tokenPrices { + evmAddrs, err1 := ccipcalc.GenericAddrsToEvm(tp.Token) + assert.NoError(t, err1) + tps = append(tps, fee_quoter.InternalTokenPriceUpdate{ + SourceToken: evmAddrs[0], + UsdPerToken: tp.Value, + }) + } + var gps []fee_quoter.InternalGasPriceUpdate + for _, gp := range gasPrices { + gps = append(gps, fee_quoter.InternalGasPriceUpdate{ + DestChainSelector: gp.DestChainSelector, + UsdPerUnitGas: gp.Value, + }) + } + tx, err := pr.UpdatePrices(user, fee_quoter.InternalPriceUpdates{ + TokenPriceUpdates: tps, + GasPriceUpdates: gps, + }) + require.NoError(t, err) + return tx.Hash() +} diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/token_pool.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/token_pool.go new file mode 100644 index 00000000000..a0850ebb2e9 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/token_pool.go @@ -0,0 +1,48 @@ +package v1_2_0 + +import ( + "github.com/ethereum/go-ethereum/common" + + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/rpclib" + + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/burn_mint_token_pool_1_2_0" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/abihelpers" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata" +) + +var ( + poolABI = abihelpers.MustParseABI(burn_mint_token_pool_1_2_0.BurnMintTokenPoolABI) +) + +var _ ccipdata.TokenPoolReader = &TokenPool{} + +type TokenPool struct { + addr common.Address + OffRampAddress common.Address + poolType string +} + +func NewTokenPool(poolType string, addr common.Address, offRampAddress common.Address) *TokenPool { + return &TokenPool{ + addr: addr, + OffRampAddress: offRampAddress, + poolType: poolType, + } +} + +func (p *TokenPool) Address() common.Address { + return p.addr +} + +func (p *TokenPool) Type() string { + return p.poolType +} + +func GetInboundTokenPoolRateLimitCall(tokenPoolAddress common.Address, offRampAddress common.Address) rpclib.EvmCall { + return rpclib.NewEvmCall( + poolABI, + "currentOffRampRateLimiterState", + tokenPoolAddress, + offRampAddress, + ) +} diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/token_pool_test.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/token_pool_test.go new file mode 100644 index 00000000000..3308ab05cec --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/token_pool_test.go @@ -0,0 +1,24 @@ +package v1_2_0 + +import ( + "testing" + + "github.com/stretchr/testify/assert" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils" +) + +func TestTokenPool(t *testing.T) { + addr := utils.RandomAddress() + offRamp := utils.RandomAddress() + poolType := "BurnMint" + + tokenPool := NewTokenPool(poolType, addr, offRamp) + + assert.Equal(t, addr, tokenPool.Address()) + assert.Equal(t, poolType, tokenPool.Type()) + + inboundRateLimitCall := GetInboundTokenPoolRateLimitCall(addr, offRamp) + + assert.Equal(t, "currentOffRampRateLimiterState", inboundRateLimitCall.MethodName()) +} diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_4_0/token_pool.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_4_0/token_pool.go new file mode 100644 index 00000000000..caf652b9e4e --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_4_0/token_pool.go @@ -0,0 +1,48 @@ +package v1_4_0 + +import ( + "github.com/ethereum/go-ethereum/common" + + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/rpclib" + + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/burn_mint_token_pool_1_4_0" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/abihelpers" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata" +) + +var ( + poolABI = abihelpers.MustParseABI(burn_mint_token_pool_1_4_0.BurnMintTokenPoolABI) +) + +var _ ccipdata.TokenPoolReader = &TokenPool{} + +type TokenPool struct { + addr common.Address + RemoteChainSelector uint64 + poolType string +} + +func NewTokenPool(poolType string, addr common.Address, remoteChainSelector uint64) *TokenPool { + return &TokenPool{ + addr: addr, + RemoteChainSelector: remoteChainSelector, + poolType: poolType, + } +} + +func (p *TokenPool) Address() common.Address { + return p.addr +} + +func (p *TokenPool) Type() string { + return p.poolType +} + +func GetInboundTokenPoolRateLimitCall(tokenPoolAddress common.Address, remoteChainSelector uint64) rpclib.EvmCall { + return rpclib.NewEvmCall( + poolABI, + "getCurrentInboundRateLimiterState", + tokenPoolAddress, + remoteChainSelector, + ) +} diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_4_0/token_pool_test.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_4_0/token_pool_test.go new file mode 100644 index 00000000000..8aaddc3312e --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_4_0/token_pool_test.go @@ -0,0 +1,24 @@ +package v1_4_0 + +import ( + "testing" + + "github.com/stretchr/testify/assert" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils" +) + +func TestTokenPool(t *testing.T) { + addr := utils.RandomAddress() + chainSelector := uint64(2000) + poolType := "BurnMint" + + tokenPool := NewTokenPool(poolType, addr, chainSelector) + + assert.Equal(t, addr, tokenPool.Address()) + assert.Equal(t, poolType, tokenPool.Type()) + + inboundRateLimitCall := GetInboundTokenPoolRateLimitCall(addr, chainSelector) + + assert.Equal(t, "getCurrentInboundRateLimiterState", inboundRateLimitCall.MethodName()) +} diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_5_0/commit_store.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_5_0/commit_store.go new file mode 100644 index 00000000000..fd768d4235c --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_5_0/commit_store.go @@ -0,0 +1,59 @@ +package v1_5_0 + +import ( + "context" + + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + + "github.com/smartcontractkit/chainlink-common/pkg/logger" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/commit_store" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0" +) + +type CommitStore struct { + *v1_2_0.CommitStore + commitStore *commit_store.CommitStore +} + +func (c *CommitStore) GetCommitStoreStaticConfig(ctx context.Context) (cciptypes.CommitStoreStaticConfig, error) { + staticConfig, err := c.commitStore.GetStaticConfig(&bind.CallOpts{Context: ctx}) + if err != nil { + return cciptypes.CommitStoreStaticConfig{}, err + } + return cciptypes.CommitStoreStaticConfig{ + ChainSelector: staticConfig.ChainSelector, + SourceChainSelector: staticConfig.SourceChainSelector, + OnRamp: cciptypes.Address(staticConfig.OnRamp.String()), + ArmProxy: cciptypes.Address(staticConfig.RmnProxy.String()), + }, nil +} + +func (c *CommitStore) IsDown(ctx context.Context) (bool, error) { + unPausedAndNotCursed, err := c.commitStore.IsUnpausedAndNotCursed(&bind.CallOpts{Context: ctx}) + if err != nil { + return true, err + } + return !unPausedAndNotCursed, nil +} + +func NewCommitStore(lggr logger.Logger, addr common.Address, ec client.Client, lp logpoller.LogPoller) (*CommitStore, error) { + v120, err := v1_2_0.NewCommitStore(lggr, addr, ec, lp) + if err != nil { + return nil, err + } + + commitStore, err := commit_store.NewCommitStore(addr, ec) + if err != nil { + return nil, err + } + + return &CommitStore{ + commitStore: commitStore, + CommitStore: v120, + }, nil +} diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_5_0/hasher.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_5_0/hasher.go new file mode 100644 index 00000000000..a00ec376cdb --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_5_0/hasher.go @@ -0,0 +1,101 @@ +package v1_5_0 + +import ( + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + + "github.com/smartcontractkit/chainlink-common/pkg/hashutil" + + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/evm_2_evm_onramp" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/abihelpers" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_0_0" +) + +const ( + MetaDataHashPrefix = "EVM2EVMMessageHashV2" +) + +type LeafHasher struct { + metaDataHash [32]byte + ctx hashutil.Hasher[[32]byte] + onRamp *evm_2_evm_onramp.EVM2EVMOnRamp +} + +func NewLeafHasher(sourceChainSelector uint64, destChainSelector uint64, onRampId common.Address, ctx hashutil.Hasher[[32]byte], onRamp *evm_2_evm_onramp.EVM2EVMOnRamp) *LeafHasher { + return &LeafHasher{ + metaDataHash: v1_0_0.GetMetaDataHash(ctx, ctx.Hash([]byte(MetaDataHashPrefix)), sourceChainSelector, onRampId, destChainSelector), + ctx: ctx, + onRamp: onRamp, + } +} + +func (t *LeafHasher) HashLeaf(log types.Log) ([32]byte, error) { + msg, err := t.onRamp.ParseCCIPSendRequested(log) + if err != nil { + return [32]byte{}, err + } + message := msg.Message + encodedTokens, err := abihelpers.ABIEncode( + `[ +{"components": [{"name":"token","type":"address"},{"name":"amount","type":"uint256"}], "type":"tuple[]"}]`, message.TokenAmounts) + if err != nil { + return [32]byte{}, err + } + + bytesArray, err := abi.NewType("bytes[]", "bytes[]", nil) + if err != nil { + return [32]byte{}, err + } + + encodedSourceTokenData, err := abi.Arguments{abi.Argument{Type: bytesArray}}.PackValues([]interface{}{message.SourceTokenData}) + if err != nil { + return [32]byte{}, err + } + + packedFixedSizeValues, err := abihelpers.ABIEncode( + `[ +{"name": "sender", "type":"address"}, +{"name": "receiver", "type":"address"}, +{"name": "sequenceNumber", "type":"uint64"}, +{"name": "gasLimit", "type":"uint256"}, +{"name": "strict", "type":"bool"}, +{"name": "nonce", "type":"uint64"}, +{"name": "feeToken","type": "address"}, +{"name": "feeTokenAmount","type": "uint256"} +]`, + message.Sender, + message.Receiver, + message.SequenceNumber, + message.GasLimit, + message.Strict, + message.Nonce, + message.FeeToken, + message.FeeTokenAmount, + ) + if err != nil { + return [32]byte{}, err + } + fixedSizeValuesHash := t.ctx.Hash(packedFixedSizeValues) + + packedValues, err := abihelpers.ABIEncode( + `[ +{"name": "leafDomainSeparator","type":"bytes1"}, +{"name": "metadataHash", "type":"bytes32"}, +{"name": "fixedSizeValuesHash", "type":"bytes32"}, +{"name": "dataHash", "type":"bytes32"}, +{"name": "tokenAmountsHash", "type":"bytes32"}, +{"name": "sourceTokenDataHash", "type":"bytes32"} +]`, + v1_0_0.LeafDomainSeparator, + t.metaDataHash, + fixedSizeValuesHash, + t.ctx.Hash(message.Data), + t.ctx.Hash(encodedTokens), + t.ctx.Hash(encodedSourceTokenData), + ) + if err != nil { + return [32]byte{}, err + } + return t.ctx.Hash(packedValues), nil +} diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_5_0/hasher_test.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_5_0/hasher_test.go new file mode 100644 index 00000000000..2a585f7bd1e --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_5_0/hasher_test.go @@ -0,0 +1,78 @@ +package v1_5_0 + +import ( + "encoding/hex" + "math/big" + "testing" + + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/stretchr/testify/require" + + "github.com/smartcontractkit/chainlink-common/pkg/hashutil" + + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/evm_2_evm_onramp" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/abihelpers" +) + +func TestHasherV1_4_0(t *testing.T) { + sourceChainSelector, destChainSelector := uint64(1), uint64(4) + onRampAddress := common.HexToAddress("0x5550000000000000000000000000000000000001") + onRampABI := abihelpers.MustParseABI(evm_2_evm_onramp.EVM2EVMOnRampABI) + + hashingCtx := hashutil.NewKeccak() + ramp, err := evm_2_evm_onramp.NewEVM2EVMOnRamp(onRampAddress, nil) + require.NoError(t, err) + hasher := NewLeafHasher(sourceChainSelector, destChainSelector, onRampAddress, hashingCtx, ramp) + + message := evm_2_evm_onramp.InternalEVM2EVMMessage{ + SourceChainSelector: sourceChainSelector, + Sender: common.HexToAddress("0x1110000000000000000000000000000000000001"), + Receiver: common.HexToAddress("0x2220000000000000000000000000000000000001"), + SequenceNumber: 1337, + GasLimit: big.NewInt(100), + Strict: false, + Nonce: 1337, + FeeToken: common.Address{}, + FeeTokenAmount: big.NewInt(1), + Data: []byte{}, + TokenAmounts: []evm_2_evm_onramp.ClientEVMTokenAmount{{Token: common.HexToAddress("0x4440000000000000000000000000000000000001"), Amount: big.NewInt(12345678900)}}, + SourceTokenData: [][]byte{}, + MessageId: [32]byte{}, + } + + data, err := onRampABI.Events[CCIPSendRequestedEventName].Inputs.Pack(message) + require.NoError(t, err) + hash, err := hasher.HashLeaf(types.Log{Topics: []common.Hash{CCIPSendRequestEventSig}, Data: data}) + require.NoError(t, err) + + // NOTE: Must match spec + require.Equal(t, "46ad031bfb052db2e4a2514fed8dc480b98e5ce4acb55d5640d91407e0d8a3e9", hex.EncodeToString(hash[:])) + + message = evm_2_evm_onramp.InternalEVM2EVMMessage{ + SourceChainSelector: sourceChainSelector, + Sender: common.HexToAddress("0x1110000000000000000000000000000000000001"), + Receiver: common.HexToAddress("0x2220000000000000000000000000000000000001"), + SequenceNumber: 1337, + GasLimit: big.NewInt(100), + Strict: false, + Nonce: 1337, + FeeToken: common.Address{}, + FeeTokenAmount: big.NewInt(1e12), + Data: []byte("foo bar baz"), + TokenAmounts: []evm_2_evm_onramp.ClientEVMTokenAmount{ + {Token: common.HexToAddress("0x4440000000000000000000000000000000000001"), Amount: big.NewInt(12345678900)}, + {Token: common.HexToAddress("0x6660000000000000000000000000000000000001"), Amount: big.NewInt(4204242)}, + }, + SourceTokenData: [][]byte{{0x2, 0x1}}, + MessageId: [32]byte{}, + } + + data, err = onRampABI.Events[CCIPSendRequestedEventName].Inputs.Pack(message) + require.NoError(t, err) + hash, err = hasher.HashLeaf(types.Log{Topics: []common.Hash{CCIPSendRequestEventSig}, Data: data}) + require.NoError(t, err) + + // NOTE: Must match spec + require.Equal(t, "4362a13a42e52ff5ce4324e7184dc7aa41704c3146bc842d35d95b94b32a78b6", hex.EncodeToString(hash[:])) +} diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_5_0/offramp.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_5_0/offramp.go new file mode 100644 index 00000000000..0c45f0d6eac --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_5_0/offramp.go @@ -0,0 +1,191 @@ +package v1_5_0 + +import ( + "context" + "math/big" + "time" + + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/pkg/errors" + + "github.com/smartcontractkit/chainlink-common/pkg/logger" + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/gas" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/evm_2_evm_offramp" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/router" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/abihelpers" + ccipconfig "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/config" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/cache" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipcalc" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/prices" +) + +var ( + abiOffRamp = abihelpers.MustParseABI(evm_2_evm_offramp.EVM2EVMOffRampABI) + _ ccipdata.OffRampReader = &OffRamp{} + RateLimitTokenAddedEvent = abihelpers.MustGetEventID("TokenAggregateRateLimitAdded", abiOffRamp) + RateLimitTokenRemovedEvent = abihelpers.MustGetEventID("TokenAggregateRateLimitRemoved", abiOffRamp) +) + +type ExecOnchainConfig evm_2_evm_offramp.EVM2EVMOffRampDynamicConfig + +func (d ExecOnchainConfig) AbiString() string { + return ` + [ + { + "components": [ + {"name": "permissionLessExecutionThresholdSeconds", "type": "uint32"}, + {"name": "maxDataBytes", "type": "uint32"}, + {"name": "maxNumberOfTokensPerMsg", "type": "uint16"}, + {"name": "router", "type": "address"}, + {"name": "priceRegistry", "type": "address"} + ], + "type": "tuple" + } + ]` +} + +func (d ExecOnchainConfig) Validate() error { + if d.PermissionLessExecutionThresholdSeconds == 0 { + return errors.New("must set PermissionLessExecutionThresholdSeconds") + } + if d.Router == (common.Address{}) { + return errors.New("must set Router address") + } + if d.PriceRegistry == (common.Address{}) { + return errors.New("must set PriceRegistry address") + } + if d.MaxNumberOfTokensPerMsg == 0 { + return errors.New("must set MaxNumberOfTokensPerMsg") + } + return nil +} + +type OffRamp struct { + *v1_2_0.OffRamp + offRampV150 evm_2_evm_offramp.EVM2EVMOffRampInterface + cachedRateLimitTokens cache.AutoSync[cciptypes.OffRampTokens] +} + +// GetTokens Returns no data as the offRamps no longer have this information. +func (o *OffRamp) GetTokens(ctx context.Context) (cciptypes.OffRampTokens, error) { + sourceTokens, destTokens, err := o.GetSourceAndDestRateLimitTokens(ctx) + if err != nil { + return cciptypes.OffRampTokens{}, err + } + return cciptypes.OffRampTokens{ + SourceTokens: sourceTokens, + DestinationTokens: destTokens, + }, nil +} + +func (o *OffRamp) GetSourceAndDestRateLimitTokens(ctx context.Context) (sourceTokens []cciptypes.Address, destTokens []cciptypes.Address, err error) { + cachedTokens, err := o.cachedRateLimitTokens.Get(ctx, func(ctx context.Context) (cciptypes.OffRampTokens, error) { + tokens, err2 := o.offRampV150.GetAllRateLimitTokens(&bind.CallOpts{Context: ctx}) + if err2 != nil { + return cciptypes.OffRampTokens{}, err2 + } + + if len(tokens.SourceTokens) != len(tokens.DestTokens) { + return cciptypes.OffRampTokens{}, errors.New("source and destination tokens are not the same length") + } + + return cciptypes.OffRampTokens{ + DestinationTokens: ccipcalc.EvmAddrsToGeneric(tokens.DestTokens...), + SourceTokens: ccipcalc.EvmAddrsToGeneric(tokens.SourceTokens...), + }, nil + }) + if err != nil { + return nil, nil, errors.Wrap(err, "failed to get rate limit tokens, if token set is large (~400k) batching may be needed") + } + return cachedTokens.SourceTokens, cachedTokens.DestinationTokens, nil +} + +func (o *OffRamp) GetSourceToDestTokensMapping(ctx context.Context) (map[cciptypes.Address]cciptypes.Address, error) { + sourceTokens, destTokens, err := o.GetSourceAndDestRateLimitTokens(ctx) + if err != nil { + return nil, errors.Wrap(err, "failed to get rate limit tokens, if token set is large (~400k) batching may be needed") + } + + if sourceTokens == nil || destTokens == nil { + return nil, errors.New("source or destination tokens are nil") + } + + mapping := make(map[cciptypes.Address]cciptypes.Address) + for i, sourceToken := range sourceTokens { + mapping[sourceToken] = destTokens[i] + } + return mapping, nil +} + +func (o *OffRamp) ChangeConfig(ctx context.Context, onchainConfigBytes []byte, offchainConfigBytes []byte) (cciptypes.Address, cciptypes.Address, error) { + // Same as the v1.2.0 method, except for the ExecOnchainConfig type. + onchainConfigParsed, err := abihelpers.DecodeAbiStruct[ExecOnchainConfig](onchainConfigBytes) + if err != nil { + return "", "", err + } + + offchainConfigParsed, err := ccipconfig.DecodeOffchainConfig[v1_2_0.JSONExecOffchainConfig](offchainConfigBytes) + if err != nil { + return "", "", err + } + destRouter, err := router.NewRouter(onchainConfigParsed.Router, o.Client) + if err != nil { + return "", "", err + } + destWrappedNative, err := destRouter.GetWrappedNative(nil) + if err != nil { + return "", "", err + } + offchainConfig := cciptypes.ExecOffchainConfig{ + DestOptimisticConfirmations: offchainConfigParsed.DestOptimisticConfirmations, + BatchGasLimit: offchainConfigParsed.BatchGasLimit, + RelativeBoostPerWaitHour: offchainConfigParsed.RelativeBoostPerWaitHour, + InflightCacheExpiry: offchainConfigParsed.InflightCacheExpiry, + RootSnoozeTime: offchainConfigParsed.RootSnoozeTime, + MessageVisibilityInterval: offchainConfigParsed.MessageVisibilityInterval, + BatchingStrategyID: offchainConfigParsed.BatchingStrategyID, + } + onchainConfig := cciptypes.ExecOnchainConfig{ + PermissionLessExecutionThresholdSeconds: time.Second * time.Duration(onchainConfigParsed.PermissionLessExecutionThresholdSeconds), + Router: cciptypes.Address(onchainConfigParsed.Router.String()), + } + priceEstimator := prices.NewDAGasPriceEstimator(o.Estimator, o.DestMaxGasPrice, 0, 0) + + o.UpdateDynamicConfig(onchainConfig, offchainConfig, priceEstimator) + + o.Logger.Infow("Starting exec plugin", + "offchainConfig", onchainConfigParsed, + "onchainConfig", offchainConfigParsed) + return cciptypes.Address(onchainConfigParsed.PriceRegistry.String()), + cciptypes.Address(destWrappedNative.String()), nil +} + +func NewOffRamp(lggr logger.Logger, addr common.Address, ec client.Client, lp logpoller.LogPoller, estimator gas.EvmFeeEstimator, destMaxGasPrice *big.Int) (*OffRamp, error) { + v120, err := v1_2_0.NewOffRamp(lggr, addr, ec, lp, estimator, destMaxGasPrice) + if err != nil { + return nil, err + } + + offRamp, err := evm_2_evm_offramp.NewEVM2EVMOffRamp(addr, ec) + if err != nil { + return nil, err + } + + v120.ExecutionReportArgs = abihelpers.MustGetMethodInputs("manuallyExecute", abiOffRamp)[:1] + + return &OffRamp{ + OffRamp: v120, + offRampV150: offRamp, + cachedRateLimitTokens: cache.NewLogpollerEventsBased[cciptypes.OffRampTokens]( + lp, + []common.Hash{RateLimitTokenAddedEvent, RateLimitTokenRemovedEvent}, + offRamp.Address(), + ), + }, nil +} diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_5_0/offramp_test.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_5_0/offramp_test.go new file mode 100644 index 00000000000..a95445ec028 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_5_0/offramp_test.go @@ -0,0 +1 @@ +package v1_5_0 diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_5_0/onramp.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_5_0/onramp.go new file mode 100644 index 00000000000..ad540ffd648 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_5_0/onramp.go @@ -0,0 +1,259 @@ +package v1_5_0 + +import ( + "context" + "fmt" + "strings" + + "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/smartcontractkit/chainlink-common/pkg/hashutil" + "github.com/smartcontractkit/chainlink-common/pkg/logger" + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/evm_2_evm_onramp" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/rmn_contract" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/abihelpers" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/cache" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipcalc" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipcommon" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/logpollerutil" +) + +var ( + // Backwards compat for integration tests + CCIPSendRequestEventSig common.Hash + ConfigSetEventSig common.Hash +) + +const ( + CCIPSendRequestSeqNumIndex = 4 + CCIPSendRequestedEventName = "CCIPSendRequested" + ConfigSetEventName = "ConfigSet" +) + +func init() { + onRampABI, err := abi.JSON(strings.NewReader(evm_2_evm_onramp.EVM2EVMOnRampABI)) + if err != nil { + panic(err) + } + CCIPSendRequestEventSig = abihelpers.MustGetEventID(CCIPSendRequestedEventName, onRampABI) + ConfigSetEventSig = abihelpers.MustGetEventID(ConfigSetEventName, onRampABI) +} + +var _ ccipdata.OnRampReader = &OnRamp{} + +type OnRamp struct { + onRamp *evm_2_evm_onramp.EVM2EVMOnRamp + address common.Address + destChainSelectorBytes [16]byte + lggr logger.Logger + lp logpoller.LogPoller + leafHasher ccipdata.LeafHasherInterface[[32]byte] + client client.Client + sendRequestedEventSig common.Hash + sendRequestedSeqNumberWord int + filters []logpoller.Filter + cachedSourcePriceRegistryAddress cache.AutoSync[cciptypes.Address] + // Static config can be cached, because it's never expected to change. + // The only way to change that is through the contract's constructor (redeployment) + cachedStaticConfig cache.OnceCtxFunction[evm_2_evm_onramp.EVM2EVMOnRampStaticConfig] + cachedRmnContract cache.OnceCtxFunction[*rmn_contract.RMNContract] +} + +func NewOnRamp(lggr logger.Logger, sourceSelector, destSelector uint64, onRampAddress common.Address, sourceLP logpoller.LogPoller, source client.Client) (*OnRamp, error) { + onRamp, err := evm_2_evm_onramp.NewEVM2EVMOnRamp(onRampAddress, source) + if err != nil { + return nil, err + } + + // Subscribe to the relevant logs + // Note we can keep the same prefix across 1.0/1.1 and 1.2 because the onramp addresses will be different + filters := []logpoller.Filter{ + { + Name: logpoller.FilterName(ccipdata.COMMIT_CCIP_SENDS, onRampAddress), + EventSigs: []common.Hash{CCIPSendRequestEventSig}, + Addresses: []common.Address{onRampAddress}, + Retention: ccipdata.CommitExecLogsRetention, + }, + { + Name: logpoller.FilterName(ccipdata.CONFIG_CHANGED, onRampAddress), + EventSigs: []common.Hash{ConfigSetEventSig}, + Addresses: []common.Address{onRampAddress}, + Retention: ccipdata.CacheEvictionLogsRetention, + }, + } + cachedStaticConfig := cache.OnceCtxFunction[evm_2_evm_onramp.EVM2EVMOnRampStaticConfig](func(ctx context.Context) (evm_2_evm_onramp.EVM2EVMOnRampStaticConfig, error) { + return onRamp.GetStaticConfig(&bind.CallOpts{Context: ctx}) + }) + cachedRmnContract := cache.OnceCtxFunction[*rmn_contract.RMNContract](func(ctx context.Context) (*rmn_contract.RMNContract, error) { + staticConfig, err := cachedStaticConfig(ctx) + if err != nil { + return nil, err + } + + return rmn_contract.NewRMNContract(staticConfig.RmnProxy, source) + }) + + return &OnRamp{ + lggr: lggr, + client: source, + destChainSelectorBytes: ccipcommon.SelectorToBytes(destSelector), + lp: sourceLP, + leafHasher: NewLeafHasher(sourceSelector, destSelector, onRampAddress, hashutil.NewKeccak(), onRamp), + onRamp: onRamp, + filters: filters, + address: onRampAddress, + sendRequestedSeqNumberWord: CCIPSendRequestSeqNumIndex, + sendRequestedEventSig: CCIPSendRequestEventSig, + cachedSourcePriceRegistryAddress: cache.NewLogpollerEventsBased[cciptypes.Address]( + sourceLP, + []common.Hash{ConfigSetEventSig}, + onRampAddress, + ), + cachedStaticConfig: cache.CallOnceOnNoError(cachedStaticConfig), + cachedRmnContract: cache.CallOnceOnNoError(cachedRmnContract), + }, nil +} + +func (o *OnRamp) Address(context.Context) (cciptypes.Address, error) { + return ccipcalc.EvmAddrToGeneric(o.onRamp.Address()), nil +} + +func (o *OnRamp) GetDynamicConfig(context.Context) (cciptypes.OnRampDynamicConfig, error) { + if o.onRamp == nil { + return cciptypes.OnRampDynamicConfig{}, fmt.Errorf("onramp not initialized") + } + config, err := o.onRamp.GetDynamicConfig(&bind.CallOpts{}) + if err != nil { + return cciptypes.OnRampDynamicConfig{}, fmt.Errorf("get dynamic config v1.5: %w", err) + } + return cciptypes.OnRampDynamicConfig{ + Router: ccipcalc.EvmAddrToGeneric(config.Router), + MaxNumberOfTokensPerMsg: config.MaxNumberOfTokensPerMsg, + DestGasOverhead: config.DestGasOverhead, + DestGasPerPayloadByte: config.DestGasPerPayloadByte, + DestDataAvailabilityOverheadGas: config.DestDataAvailabilityOverheadGas, + DestGasPerDataAvailabilityByte: config.DestGasPerDataAvailabilityByte, + DestDataAvailabilityMultiplierBps: config.DestDataAvailabilityMultiplierBps, + PriceRegistry: ccipcalc.EvmAddrToGeneric(config.PriceRegistry), + MaxDataBytes: config.MaxDataBytes, + MaxPerMsgGasLimit: config.MaxPerMsgGasLimit, + }, nil +} + +func (o *OnRamp) SourcePriceRegistryAddress(ctx context.Context) (cciptypes.Address, error) { + return o.cachedSourcePriceRegistryAddress.Get(ctx, func(ctx context.Context) (cciptypes.Address, error) { + c, err := o.GetDynamicConfig(ctx) + if err != nil { + return "", err + } + return c.PriceRegistry, nil + }) +} + +func (o *OnRamp) GetSendRequestsBetweenSeqNums(ctx context.Context, seqNumMin, seqNumMax uint64, finalized bool) ([]cciptypes.EVM2EVMMessageWithTxMeta, error) { + logs, err := o.lp.LogsDataWordRange( + ctx, + o.sendRequestedEventSig, + o.address, + o.sendRequestedSeqNumberWord, + logpoller.EvmWord(seqNumMin), + logpoller.EvmWord(seqNumMax), + ccipdata.LogsConfirmations(finalized), + ) + if err != nil { + return nil, err + } + + parsedLogs, err := ccipdata.ParseLogs[cciptypes.EVM2EVMMessage](logs, o.lggr, o.logToMessage) + if err != nil { + return nil, err + } + + res := make([]cciptypes.EVM2EVMMessageWithTxMeta, 0, len(logs)) + for _, log := range parsedLogs { + res = append(res, cciptypes.EVM2EVMMessageWithTxMeta{ + TxMeta: log.TxMeta, + EVM2EVMMessage: log.Data, + }) + } + return res, nil +} + +func (o *OnRamp) RouterAddress(context.Context) (cciptypes.Address, error) { + config, err := o.onRamp.GetDynamicConfig(nil) + if err != nil { + return "", err + } + return ccipcalc.EvmAddrToGeneric(config.Router), nil +} + +func (o *OnRamp) IsSourceChainHealthy(context.Context) (bool, error) { + if err := o.lp.Healthy(); err != nil { + return false, nil + } + return true, nil +} + +func (o *OnRamp) IsSourceCursed(ctx context.Context) (bool, error) { + arm, err := o.cachedRmnContract(ctx) + if err != nil { + return false, fmt.Errorf("initializing RMN contract through the RmnProxy: %w", err) + } + + cursed, err := arm.IsCursed(&bind.CallOpts{Context: ctx}, o.destChainSelectorBytes) + if err != nil { + return false, fmt.Errorf("checking if source is cursed by RMN: %w", err) + } + return cursed, nil +} + +func (o *OnRamp) Close() error { + return logpollerutil.UnregisterLpFilters(o.lp, o.filters) +} + +func (o *OnRamp) RegisterFilters() error { + return logpollerutil.RegisterLpFilters(o.lp, o.filters) +} + +func (o *OnRamp) logToMessage(log types.Log) (*cciptypes.EVM2EVMMessage, error) { + msg, err := o.onRamp.ParseCCIPSendRequested(log) + if err != nil { + return nil, err + } + h, err := o.leafHasher.HashLeaf(log) + if err != nil { + return nil, err + } + tokensAndAmounts := make([]cciptypes.TokenAmount, len(msg.Message.TokenAmounts)) + for i, tokenAndAmount := range msg.Message.TokenAmounts { + tokensAndAmounts[i] = cciptypes.TokenAmount{ + Token: ccipcalc.EvmAddrToGeneric(tokenAndAmount.Token), + Amount: tokenAndAmount.Amount, + } + } + + return &cciptypes.EVM2EVMMessage{ + SequenceNumber: msg.Message.SequenceNumber, + GasLimit: msg.Message.GasLimit, + Nonce: msg.Message.Nonce, + MessageID: msg.Message.MessageId, + SourceChainSelector: msg.Message.SourceChainSelector, + Sender: ccipcalc.EvmAddrToGeneric(msg.Message.Sender), + Receiver: ccipcalc.EvmAddrToGeneric(msg.Message.Receiver), + Strict: msg.Message.Strict, + FeeToken: ccipcalc.EvmAddrToGeneric(msg.Message.FeeToken), + FeeTokenAmount: msg.Message.FeeTokenAmount, + Data: msg.Message.Data, + TokenAmounts: tokensAndAmounts, + SourceTokenData: msg.Message.SourceTokenData, // Breaking change 1.2 + Hash: h, + }, nil +} diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_5_0/onramp_test.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_5_0/onramp_test.go new file mode 100644 index 00000000000..277b8fd9003 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_5_0/onramp_test.go @@ -0,0 +1,209 @@ +package v1_5_0 + +import ( + "context" + "math/big" + "testing" + + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + "github.com/stretchr/testify/require" + + "github.com/smartcontractkit/chainlink-common/pkg/logger" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller/mocks" + evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/evm_2_evm_onramp" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/mock_rmn_contract" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/abihelpers" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipcommon" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata" +) + +func TestLogPollerClient_GetSendRequestsBetweenSeqNums1_4_0(t *testing.T) { + onRampAddr := utils.RandomAddress() + seqNum := uint64(100) + limit := uint64(10) + lggr := logger.Test(t) + + tests := []struct { + name string + finalized bool + confirmations evmtypes.Confirmations + }{ + {"finalized", true, evmtypes.Finalized}, + {"unfinalized", false, evmtypes.Confirmations(0)}, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + lp := mocks.NewLogPoller(t) + onRampV2, err := NewOnRamp(lggr, 1, 1, onRampAddr, lp, nil) + require.NoError(t, err) + + lp.On("LogsDataWordRange", + mock.Anything, + onRampV2.sendRequestedEventSig, + onRampAddr, + onRampV2.sendRequestedSeqNumberWord, + abihelpers.EvmWord(seqNum), + abihelpers.EvmWord(seqNum+limit), + tt.confirmations, + ).Once().Return([]logpoller.Log{}, nil) + + events, err1 := onRampV2.GetSendRequestsBetweenSeqNums(context.Background(), seqNum, seqNum+limit, tt.finalized) + assert.NoError(t, err1) + assert.Empty(t, events) + + lp.AssertExpectations(t) + }) + } +} + +func Test_ProperlyRecognizesPerLaneCurses(t *testing.T) { + user, bc := ccipdata.NewSimulation(t) + ctx := testutils.Context(t) + destChainSelector := uint64(100) + sourceChainSelector := uint64(200) + onRampAddress, mockRMN, mockRMNAddress := setupOnRampV1_5_0(t, user, bc) + + onRamp, err := NewOnRamp(logger.Test(t), 1, destChainSelector, onRampAddress, mocks.NewLogPoller(t), bc) + require.NoError(t, err) + + onRamp.cachedStaticConfig = func(ctx context.Context) (evm_2_evm_onramp.EVM2EVMOnRampStaticConfig, error) { + return evm_2_evm_onramp.EVM2EVMOnRampStaticConfig{ + RmnProxy: mockRMNAddress, + }, nil + } + + // Lane is not cursed right after deployment + isCursed, err := onRamp.IsSourceCursed(ctx) + require.NoError(t, err) + assert.False(t, isCursed) + + // Cursing different chain selector + _, err = mockRMN.VoteToCurse0(user, [32]byte{}, ccipcommon.SelectorToBytes(sourceChainSelector)) + require.NoError(t, err) + bc.Commit() + + isCursed, err = onRamp.IsSourceCursed(ctx) + require.NoError(t, err) + assert.False(t, isCursed) + + // Cursing the correct chain selector + _, err = mockRMN.VoteToCurse0(user, [32]byte{}, ccipcommon.SelectorToBytes(destChainSelector)) + require.NoError(t, err) + bc.Commit() + + isCursed, err = onRamp.IsSourceCursed(ctx) + require.NoError(t, err) + assert.True(t, isCursed) + + // Uncursing the chain selector + _, err = mockRMN.OwnerUnvoteToCurse(user, []mock_rmn_contract.RMNUnvoteToCurseRecord{}, ccipcommon.SelectorToBytes(destChainSelector)) + require.NoError(t, err) + bc.Commit() + + isCursed, err = onRamp.IsSourceCursed(ctx) + require.NoError(t, err) + assert.False(t, isCursed) +} + +// This is written to benchmark before and after the caching of StaticConfig and RMNContract +func BenchmarkIsSourceCursedWithCache(b *testing.B) { + user, bc := ccipdata.NewSimulation(b) + ctx := testutils.Context(b) + destChainSelector := uint64(100) + onRampAddress, _, _ := setupOnRampV1_5_0(b, user, bc) + + onRamp, err := NewOnRamp(logger.Test(b), 1, destChainSelector, onRampAddress, mocks.NewLogPoller(b), bc) + require.NoError(b, err) + + for i := 0; i < b.N; i++ { + _, _ = onRamp.IsSourceCursed(ctx) + } +} + +func setupOnRampV1_5_0(t testing.TB, user *bind.TransactOpts, bc *client.SimulatedBackendClient) (common.Address, *mock_rmn_contract.MockRMNContract, common.Address) { + rmnAddress, transaction, rmnContract, err := mock_rmn_contract.DeployMockRMNContract(user, bc) + bc.Commit() + require.NoError(t, err) + ccipdata.AssertNonRevert(t, transaction, bc, user) + + linkTokenAddress := common.HexToAddress("0x000011") + staticConfig := evm_2_evm_onramp.EVM2EVMOnRampStaticConfig{ + LinkToken: linkTokenAddress, + ChainSelector: testutils.SimulatedChainID.Uint64(), + DestChainSelector: testutils.SimulatedChainID.Uint64(), + DefaultTxGasLimit: 30000, + MaxNopFeesJuels: big.NewInt(1000000), + PrevOnRamp: common.Address{}, + RmnProxy: rmnAddress, + TokenAdminRegistry: utils.RandomAddress(), + } + dynamicConfig := evm_2_evm_onramp.EVM2EVMOnRampDynamicConfig{ + Router: common.HexToAddress("0x0000000000000000000000000000000000000150"), + MaxNumberOfTokensPerMsg: 0, + DestGasOverhead: 0, + DestGasPerPayloadByte: 0, + DestDataAvailabilityOverheadGas: 0, + DestGasPerDataAvailabilityByte: 0, + DestDataAvailabilityMultiplierBps: 0, + PriceRegistry: utils.RandomAddress(), + MaxDataBytes: 0, + MaxPerMsgGasLimit: 0, + DefaultTokenFeeUSDCents: 50, + DefaultTokenDestGasOverhead: 125_000, + } + rateLimiterConfig := evm_2_evm_onramp.RateLimiterConfig{ + IsEnabled: false, + Capacity: big.NewInt(5), + Rate: big.NewInt(5), + } + feeTokenConfigs := []evm_2_evm_onramp.EVM2EVMOnRampFeeTokenConfigArgs{ + { + Token: linkTokenAddress, + NetworkFeeUSDCents: 0, + GasMultiplierWeiPerEth: 0, + PremiumMultiplierWeiPerEth: 0, + Enabled: false, + }, + } + tokenTransferConfigArgs := []evm_2_evm_onramp.EVM2EVMOnRampTokenTransferFeeConfigArgs{ + { + Token: linkTokenAddress, + MinFeeUSDCents: 0, + MaxFeeUSDCents: 0, + DeciBps: 0, + DestGasOverhead: 0, + DestBytesOverhead: 32, + AggregateRateLimitEnabled: true, + }, + } + nopsAndWeights := []evm_2_evm_onramp.EVM2EVMOnRampNopAndWeight{ + { + Nop: utils.RandomAddress(), + Weight: 1, + }, + } + onRampAddress, transaction, _, err := evm_2_evm_onramp.DeployEVM2EVMOnRamp( + user, + bc, + staticConfig, + dynamicConfig, + rateLimiterConfig, + feeTokenConfigs, + tokenTransferConfigArgs, + nopsAndWeights, + ) + bc.Commit() + require.NoError(t, err) + ccipdata.AssertNonRevert(t, transaction, bc, user) + + return onRampAddress, rmnContract, rmnAddress +} diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdb/mocks/price_service_mock.go b/core/services/ocr2/plugins/ccip/internal/ccipdb/mocks/price_service_mock.go new file mode 100644 index 00000000000..39ba632aff9 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/ccipdb/mocks/price_service_mock.go @@ -0,0 +1,250 @@ +// Code generated by mockery v2.43.2. DO NOT EDIT. + +package mocks + +import ( + big "math/big" + + ccip "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + ccipdata "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata" + + context "context" + + mock "github.com/stretchr/testify/mock" + + prices "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/prices" +) + +// PriceService is an autogenerated mock type for the PriceService type +type PriceService struct { + mock.Mock +} + +type PriceService_Expecter struct { + mock *mock.Mock +} + +func (_m *PriceService) EXPECT() *PriceService_Expecter { + return &PriceService_Expecter{mock: &_m.Mock} +} + +// Close provides a mock function with given fields: +func (_m *PriceService) Close() error { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Close") + } + + var r0 error + if rf, ok := ret.Get(0).(func() error); ok { + r0 = rf() + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// PriceService_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close' +type PriceService_Close_Call struct { + *mock.Call +} + +// Close is a helper method to define mock.On call +func (_e *PriceService_Expecter) Close() *PriceService_Close_Call { + return &PriceService_Close_Call{Call: _e.mock.On("Close")} +} + +func (_c *PriceService_Close_Call) Run(run func()) *PriceService_Close_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *PriceService_Close_Call) Return(_a0 error) *PriceService_Close_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *PriceService_Close_Call) RunAndReturn(run func() error) *PriceService_Close_Call { + _c.Call.Return(run) + return _c +} + +// GetGasAndTokenPrices provides a mock function with given fields: ctx, destChainSelector +func (_m *PriceService) GetGasAndTokenPrices(ctx context.Context, destChainSelector uint64) (map[uint64]*big.Int, map[ccip.Address]*big.Int, error) { + ret := _m.Called(ctx, destChainSelector) + + if len(ret) == 0 { + panic("no return value specified for GetGasAndTokenPrices") + } + + var r0 map[uint64]*big.Int + var r1 map[ccip.Address]*big.Int + var r2 error + if rf, ok := ret.Get(0).(func(context.Context, uint64) (map[uint64]*big.Int, map[ccip.Address]*big.Int, error)); ok { + return rf(ctx, destChainSelector) + } + if rf, ok := ret.Get(0).(func(context.Context, uint64) map[uint64]*big.Int); ok { + r0 = rf(ctx, destChainSelector) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(map[uint64]*big.Int) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, uint64) map[ccip.Address]*big.Int); ok { + r1 = rf(ctx, destChainSelector) + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).(map[ccip.Address]*big.Int) + } + } + + if rf, ok := ret.Get(2).(func(context.Context, uint64) error); ok { + r2 = rf(ctx, destChainSelector) + } else { + r2 = ret.Error(2) + } + + return r0, r1, r2 +} + +// PriceService_GetGasAndTokenPrices_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetGasAndTokenPrices' +type PriceService_GetGasAndTokenPrices_Call struct { + *mock.Call +} + +// GetGasAndTokenPrices is a helper method to define mock.On call +// - ctx context.Context +// - destChainSelector uint64 +func (_e *PriceService_Expecter) GetGasAndTokenPrices(ctx interface{}, destChainSelector interface{}) *PriceService_GetGasAndTokenPrices_Call { + return &PriceService_GetGasAndTokenPrices_Call{Call: _e.mock.On("GetGasAndTokenPrices", ctx, destChainSelector)} +} + +func (_c *PriceService_GetGasAndTokenPrices_Call) Run(run func(ctx context.Context, destChainSelector uint64)) *PriceService_GetGasAndTokenPrices_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(uint64)) + }) + return _c +} + +func (_c *PriceService_GetGasAndTokenPrices_Call) Return(_a0 map[uint64]*big.Int, _a1 map[ccip.Address]*big.Int, _a2 error) *PriceService_GetGasAndTokenPrices_Call { + _c.Call.Return(_a0, _a1, _a2) + return _c +} + +func (_c *PriceService_GetGasAndTokenPrices_Call) RunAndReturn(run func(context.Context, uint64) (map[uint64]*big.Int, map[ccip.Address]*big.Int, error)) *PriceService_GetGasAndTokenPrices_Call { + _c.Call.Return(run) + return _c +} + +// Start provides a mock function with given fields: _a0 +func (_m *PriceService) Start(_a0 context.Context) error { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for Start") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context) error); ok { + r0 = rf(_a0) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// PriceService_Start_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Start' +type PriceService_Start_Call struct { + *mock.Call +} + +// Start is a helper method to define mock.On call +// - _a0 context.Context +func (_e *PriceService_Expecter) Start(_a0 interface{}) *PriceService_Start_Call { + return &PriceService_Start_Call{Call: _e.mock.On("Start", _a0)} +} + +func (_c *PriceService_Start_Call) Run(run func(_a0 context.Context)) *PriceService_Start_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *PriceService_Start_Call) Return(_a0 error) *PriceService_Start_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *PriceService_Start_Call) RunAndReturn(run func(context.Context) error) *PriceService_Start_Call { + _c.Call.Return(run) + return _c +} + +// UpdateDynamicConfig provides a mock function with given fields: ctx, gasPriceEstimator, destPriceRegistryReader +func (_m *PriceService) UpdateDynamicConfig(ctx context.Context, gasPriceEstimator prices.GasPriceEstimatorCommit, destPriceRegistryReader ccipdata.PriceRegistryReader) error { + ret := _m.Called(ctx, gasPriceEstimator, destPriceRegistryReader) + + if len(ret) == 0 { + panic("no return value specified for UpdateDynamicConfig") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, prices.GasPriceEstimatorCommit, ccipdata.PriceRegistryReader) error); ok { + r0 = rf(ctx, gasPriceEstimator, destPriceRegistryReader) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// PriceService_UpdateDynamicConfig_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateDynamicConfig' +type PriceService_UpdateDynamicConfig_Call struct { + *mock.Call +} + +// UpdateDynamicConfig is a helper method to define mock.On call +// - ctx context.Context +// - gasPriceEstimator prices.GasPriceEstimatorCommit +// - destPriceRegistryReader ccipdata.PriceRegistryReader +func (_e *PriceService_Expecter) UpdateDynamicConfig(ctx interface{}, gasPriceEstimator interface{}, destPriceRegistryReader interface{}) *PriceService_UpdateDynamicConfig_Call { + return &PriceService_UpdateDynamicConfig_Call{Call: _e.mock.On("UpdateDynamicConfig", ctx, gasPriceEstimator, destPriceRegistryReader)} +} + +func (_c *PriceService_UpdateDynamicConfig_Call) Run(run func(ctx context.Context, gasPriceEstimator prices.GasPriceEstimatorCommit, destPriceRegistryReader ccipdata.PriceRegistryReader)) *PriceService_UpdateDynamicConfig_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(prices.GasPriceEstimatorCommit), args[2].(ccipdata.PriceRegistryReader)) + }) + return _c +} + +func (_c *PriceService_UpdateDynamicConfig_Call) Return(_a0 error) *PriceService_UpdateDynamicConfig_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *PriceService_UpdateDynamicConfig_Call) RunAndReturn(run func(context.Context, prices.GasPriceEstimatorCommit, ccipdata.PriceRegistryReader) error) *PriceService_UpdateDynamicConfig_Call { + _c.Call.Return(run) + return _c +} + +// NewPriceService creates a new instance of PriceService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewPriceService(t interface { + mock.TestingT + Cleanup(func()) +}) *PriceService { + mock := &PriceService{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdb/price_service.go b/core/services/ocr2/plugins/ccip/internal/ccipdb/price_service.go new file mode 100644 index 00000000000..2806c26e220 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/ccipdb/price_service.go @@ -0,0 +1,449 @@ +package db + +import ( + "context" + "fmt" + "math/big" + "slices" + "sort" + "sync" + "time" + + "golang.org/x/sync/errgroup" + + "github.com/smartcontractkit/chainlink-common/pkg/logger" + "github.com/smartcontractkit/chainlink-common/pkg/services" + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" + cciporm "github.com/smartcontractkit/chainlink/v2/core/services/ccip" + "github.com/smartcontractkit/chainlink/v2/core/services/job" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipcalc" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipcommon" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/pricegetter" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/prices" + "github.com/smartcontractkit/chainlink/v2/core/utils" +) + +// PriceService manages DB access for gas and token price data. +// In the background, PriceService periodically inserts latest gas and token prices into the DB. +// During `Observation` phase, Commit plugin calls PriceService to fetch the latest prices from DB. +// This enables all lanes connected to a chain to feed price data to the leader lane's Commit plugin for that chain. +type PriceService interface { + job.ServiceCtx + + // UpdateDynamicConfig updates gasPriceEstimator and destPriceRegistryReader during Commit plugin dynamic config change. + UpdateDynamicConfig(ctx context.Context, gasPriceEstimator prices.GasPriceEstimatorCommit, destPriceRegistryReader ccipdata.PriceRegistryReader) error + + // GetGasAndTokenPrices fetches source chain gas prices and relevant token prices from all lanes that touch the given dest chain. + // The prices have been written into the DB by each lane's PriceService in the background. The prices are denoted in USD. + GetGasAndTokenPrices(ctx context.Context, destChainSelector uint64) (map[uint64]*big.Int, map[cciptypes.Address]*big.Int, error) +} + +var _ PriceService = (*priceService)(nil) + +const ( + // Gas prices are refreshed every 1 minute, they are sufficiently accurate, and consistent with Commit OCR round time. + gasPriceUpdateInterval = 1 * time.Minute + // Token prices are refreshed every 10 minutes, we only report prices for blue chip tokens, DS&A simulation show + // their prices are stable, 10-minute resolution is accurate enough. + tokenPriceUpdateInterval = 10 * time.Minute +) + +type priceService struct { + gasUpdateInterval time.Duration + tokenUpdateInterval time.Duration + + lggr logger.Logger + orm cciporm.ORM + jobId int32 + destChainSelector uint64 + + sourceChainSelector uint64 + sourceNative cciptypes.Address + priceGetter pricegetter.AllTokensPriceGetter + offRampReader ccipdata.OffRampReader + gasPriceEstimator prices.GasPriceEstimatorCommit + destPriceRegistryReader ccipdata.PriceRegistryReader + + services.StateMachine + wg *sync.WaitGroup + backgroundCtx context.Context //nolint:containedctx + backgroundCancel context.CancelFunc + dynamicConfigMu *sync.RWMutex +} + +func NewPriceService( + lggr logger.Logger, + orm cciporm.ORM, + jobId int32, + destChainSelector uint64, + sourceChainSelector uint64, + + sourceNative cciptypes.Address, + priceGetter pricegetter.AllTokensPriceGetter, + offRampReader ccipdata.OffRampReader, +) PriceService { + ctx, cancel := context.WithCancel(context.Background()) + + pw := &priceService{ + gasUpdateInterval: gasPriceUpdateInterval, + tokenUpdateInterval: tokenPriceUpdateInterval, + + lggr: lggr, + orm: orm, + jobId: jobId, + destChainSelector: destChainSelector, + + sourceChainSelector: sourceChainSelector, + sourceNative: sourceNative, + priceGetter: priceGetter, + offRampReader: offRampReader, + + wg: new(sync.WaitGroup), + backgroundCtx: ctx, + backgroundCancel: cancel, + dynamicConfigMu: &sync.RWMutex{}, + } + return pw +} + +func (p *priceService) Start(context.Context) error { + return p.StateMachine.StartOnce("PriceService", func() error { + p.lggr.Info("Starting PriceService") + p.wg.Add(1) + p.run() + return nil + }) +} + +func (p *priceService) Close() error { + return p.StateMachine.StopOnce("PriceService", func() error { + p.lggr.Info("Closing PriceService") + p.backgroundCancel() + p.wg.Wait() + return nil + }) +} + +func (p *priceService) run() { + gasUpdateTicker := time.NewTicker(utils.WithJitter(p.gasUpdateInterval)) + tokenUpdateTicker := time.NewTicker(utils.WithJitter(p.tokenUpdateInterval)) + + go func() { + defer p.wg.Done() + defer gasUpdateTicker.Stop() + defer tokenUpdateTicker.Stop() + + for { + select { + case <-p.backgroundCtx.Done(): + return + case <-gasUpdateTicker.C: + err := p.runGasPriceUpdate(p.backgroundCtx) + if err != nil { + p.lggr.Errorw("Error when updating gas prices in the background", "err", err) + } + case <-tokenUpdateTicker.C: + err := p.runTokenPriceUpdate(p.backgroundCtx) + if err != nil { + p.lggr.Errorw("Error when updating token prices in the background", "err", err) + } + } + } + }() +} + +func (p *priceService) UpdateDynamicConfig(ctx context.Context, gasPriceEstimator prices.GasPriceEstimatorCommit, destPriceRegistryReader ccipdata.PriceRegistryReader) error { + p.dynamicConfigMu.Lock() + p.gasPriceEstimator = gasPriceEstimator + p.destPriceRegistryReader = destPriceRegistryReader + p.dynamicConfigMu.Unlock() + + // Config update may substantially change the prices, refresh the prices immediately, this also makes testing easier + // for not having to wait to the full update interval. + if err := p.runGasPriceUpdate(ctx); err != nil { + p.lggr.Errorw("Error when updating gas prices after dynamic config update", "err", err) + } + if err := p.runTokenPriceUpdate(ctx); err != nil { + p.lggr.Errorw("Error when updating token prices after dynamic config update", "err", err) + } + + return nil +} + +func (p *priceService) GetGasAndTokenPrices(ctx context.Context, destChainSelector uint64) (map[uint64]*big.Int, map[cciptypes.Address]*big.Int, error) { + eg := new(errgroup.Group) + + var gasPricesInDB []cciporm.GasPrice + var tokenPricesInDB []cciporm.TokenPrice + + eg.Go(func() error { + gasPrices, err := p.orm.GetGasPricesByDestChain(ctx, destChainSelector) + if err != nil { + return fmt.Errorf("failed to get gas prices from db: %w", err) + } + gasPricesInDB = gasPrices + return nil + }) + + eg.Go(func() error { + tokenPrices, err := p.orm.GetTokenPricesByDestChain(ctx, destChainSelector) + if err != nil { + return fmt.Errorf("failed to get token prices from db: %w", err) + } + tokenPricesInDB = tokenPrices + return nil + }) + + if err := eg.Wait(); err != nil { + return nil, nil, err + } + + gasPrices := make(map[uint64]*big.Int, len(gasPricesInDB)) + tokenPrices := make(map[cciptypes.Address]*big.Int, len(tokenPricesInDB)) + + for _, gasPrice := range gasPricesInDB { + if gasPrice.GasPrice != nil { + gasPrices[gasPrice.SourceChainSelector] = gasPrice.GasPrice.ToInt() + } + } + + for _, tokenPrice := range tokenPricesInDB { + if tokenPrice.TokenPrice != nil { + tokenPrices[cciptypes.Address(tokenPrice.TokenAddr)] = tokenPrice.TokenPrice.ToInt() + } + } + + return gasPrices, tokenPrices, nil +} + +func (p *priceService) runGasPriceUpdate(ctx context.Context) error { + // Protect against concurrent updates of `gasPriceEstimator` and `destPriceRegistryReader` + // Price updates happen infrequently - once every `gasPriceUpdateInterval` seconds. + // It does not happen on any code path that is performance sensitive. + // We can afford to have non-performant unlocks here that is simple and safe. + p.dynamicConfigMu.RLock() + defer p.dynamicConfigMu.RUnlock() + + // There may be a period of time between service is started and dynamic config is updated + if p.gasPriceEstimator == nil { + p.lggr.Info("Skipping gas price update due to gasPriceEstimator not ready") + return nil + } + + sourceGasPriceUSD, err := p.observeGasPriceUpdates(ctx, p.lggr) + if err != nil { + return fmt.Errorf("failed to observe gas price updates: %w", err) + } + + err = p.writeGasPricesToDB(ctx, sourceGasPriceUSD) + if err != nil { + return fmt.Errorf("failed to write gas prices to db: %w", err) + } + + return nil +} + +func (p *priceService) runTokenPriceUpdate(ctx context.Context) error { + // Protect against concurrent updates of `tokenPriceEstimator` and `destPriceRegistryReader` + // Price updates happen infrequently - once every `tokenPriceUpdateInterval` seconds. + p.dynamicConfigMu.RLock() + defer p.dynamicConfigMu.RUnlock() + + // There may be a period of time between service is started and dynamic config is updated + if p.destPriceRegistryReader == nil { + p.lggr.Info("Skipping token price update due to destPriceRegistry not ready") + return nil + } + + tokenPricesUSD, err := p.observeTokenPriceUpdates(ctx, p.lggr) + if err != nil { + return fmt.Errorf("failed to observe token price updates: %w", err) + } + + err = p.writeTokenPricesToDB(ctx, tokenPricesUSD) + if err != nil { + return fmt.Errorf("failed to write token prices to db: %w", err) + } + + return nil +} + +func (p *priceService) observeGasPriceUpdates( + ctx context.Context, + lggr logger.Logger, +) (sourceGasPriceUSD *big.Int, err error) { + if p.gasPriceEstimator == nil { + return nil, fmt.Errorf("gasPriceEstimator is not set yet") + } + + // Include wrapped native to identify the source native USD price, notice USD is in 1e18 scale, i.e. $1 = 1e18 + rawTokenPricesUSD, err := p.priceGetter.TokenPricesUSD(ctx, []cciptypes.Address{p.sourceNative}) + + if err != nil { + return nil, fmt.Errorf("failed to fetch source native price (%s): %w", p.sourceNative, err) + } + + sourceNativePriceUSD, exists := rawTokenPricesUSD[p.sourceNative] + if !exists { + return nil, fmt.Errorf("missing source native (%s) price", p.sourceNative) + } + + sourceGasPrice, err := p.gasPriceEstimator.GetGasPrice(ctx) + if err != nil { + return nil, err + } + if sourceGasPrice == nil { + return nil, fmt.Errorf("missing gas price") + } + sourceGasPriceUSD, err = p.gasPriceEstimator.DenoteInUSD(sourceGasPrice, sourceNativePriceUSD) + if err != nil { + return nil, err + } + + lggr.Infow("PriceService observed latest gas price", + "sourceChainSelector", p.sourceChainSelector, + "destChainSelector", p.destChainSelector, + "sourceNative", p.sourceNative, + "gasPriceWei", sourceGasPrice, + "sourceNativePriceUSD", sourceNativePriceUSD, + "sourceGasPriceUSD", sourceGasPriceUSD, + ) + return sourceGasPriceUSD, nil +} + +// All prices are USD ($1=1e18) denominated. All prices must be not nil. +// Jobspec should have the destination tokens (Aggregate Rate Limit, Bps) and 1 source token (source native). +// Not respecting this will error out as we need to fetch the token decimals for all tokens expect sourceNative. +// destTokens is only used to check if sourceNative has the same address as one of the dest tokens. +// Return token prices should contain the exact same tokens as in tokenDecimals. +func (p *priceService) observeTokenPriceUpdates( + ctx context.Context, + lggr logger.Logger, +) (tokenPricesUSD map[cciptypes.Address]*big.Int, err error) { + if p.destPriceRegistryReader == nil { + return nil, fmt.Errorf("destPriceRegistry is not set yet") + } + rawTokenPricesUSD, err := p.priceGetter.GetJobSpecTokenPricesUSD(ctx) + if err != nil { + return nil, fmt.Errorf("failed to fetch token prices: %w", err) + } + + // Verify no price returned by price getter is nil + for token, price := range rawTokenPricesUSD { + if price == nil { + return nil, fmt.Errorf("Token price is nil for token %s", token) + } + } + + lggr.Infow("Raw token prices", "rawTokenPrices", rawTokenPricesUSD) + + sourceNativeEvmAddr, err := ccipcalc.GenericAddrToEvm(p.sourceNative) + if err != nil { + return nil, fmt.Errorf("failed to convert source native to EVM address: %w", err) + } + + // Filter out source native token only if source native not in dest tokens + var finalDestTokens []cciptypes.Address + for token := range rawTokenPricesUSD { + tokenEvmAddr, err2 := ccipcalc.GenericAddrToEvm(token) + if err2 != nil { + return nil, fmt.Errorf("failed to convert token to EVM address: %w", err) + } + + if tokenEvmAddr != sourceNativeEvmAddr { + finalDestTokens = append(finalDestTokens, token) + } + } + + fee, bridged, err := ccipcommon.GetDestinationTokens(ctx, p.offRampReader, p.destPriceRegistryReader) + if err != nil { + return nil, fmt.Errorf("get destination tokens: %w", err) + } + onchainDestTokens := ccipcommon.FlattenedAndSortedTokens(fee, bridged) + lggr.Debugw("Destination tokens", "destTokens", onchainDestTokens) + + onchainTokensEvmAddr, err := ccipcalc.GenericAddrsToEvm(onchainDestTokens...) + if err != nil { + return nil, fmt.Errorf("failed to convert sorted lane tokens to EVM addresses: %w", err) + } + // Check for case where sourceNative has same address as one of the dest tokens (example: WETH in Base and Optimism) + hasSameDestAddress := slices.Contains(onchainTokensEvmAddr, sourceNativeEvmAddr) + + if hasSameDestAddress { + finalDestTokens = append(finalDestTokens, p.sourceNative) + } + + // Sort tokens to make the order deterministic, easier for testing and debugging + sort.Slice(finalDestTokens, func(i, j int) bool { + return finalDestTokens[i] < finalDestTokens[j] + }) + + destTokensDecimals, err := p.destPriceRegistryReader.GetTokensDecimals(ctx, finalDestTokens) + if err != nil { + return nil, fmt.Errorf("get tokens decimals: %w", err) + } + + if len(destTokensDecimals) != len(finalDestTokens) { + return nil, fmt.Errorf("mismatched token decimals and tokens") + } + + tokenPricesUSD = make(map[cciptypes.Address]*big.Int, len(rawTokenPricesUSD)) + for i, token := range finalDestTokens { + tokenPricesUSD[token] = calculateUsdPer1e18TokenAmount(rawTokenPricesUSD[token], destTokensDecimals[i]) + } + + lggr.Infow("PriceService observed latest token prices", + "sourceChainSelector", p.sourceChainSelector, + "destChainSelector", p.destChainSelector, + "tokenPricesUSD", tokenPricesUSD, + ) + return tokenPricesUSD, nil +} + +func (p *priceService) writeGasPricesToDB(ctx context.Context, sourceGasPriceUSD *big.Int) error { + if sourceGasPriceUSD == nil { + return nil + } + + _, err := p.orm.UpsertGasPricesForDestChain(ctx, p.destChainSelector, []cciporm.GasPrice{ + { + SourceChainSelector: p.sourceChainSelector, + GasPrice: assets.NewWei(sourceGasPriceUSD), + }, + }) + return err +} + +func (p *priceService) writeTokenPricesToDB(ctx context.Context, tokenPricesUSD map[cciptypes.Address]*big.Int) error { + if tokenPricesUSD == nil { + return nil + } + + var tokenPrices []cciporm.TokenPrice + + for token, price := range tokenPricesUSD { + tokenPrices = append(tokenPrices, cciporm.TokenPrice{ + TokenAddr: string(token), + TokenPrice: assets.NewWei(price), + }) + } + + // Sort token by addr to make price updates ordering deterministic, easier for testing and debugging + sort.Slice(tokenPrices, func(i, j int) bool { + return tokenPrices[i].TokenAddr < tokenPrices[j].TokenAddr + }) + + _, err := p.orm.UpsertTokenPricesForDestChain(ctx, p.destChainSelector, tokenPrices, p.tokenUpdateInterval) + return err +} + +// Input price is USD per full token, with 18 decimal precision +// Result price is USD per 1e18 of smallest token denomination, with 18 decimal precision +// Example: 1 USDC = 1.00 USD per full token, each full token is 6 decimals -> 1 * 1e18 * 1e18 / 1e6 = 1e30 +func calculateUsdPer1e18TokenAmount(price *big.Int, decimals uint8) *big.Int { + tmp := big.NewInt(0).Mul(price, big.NewInt(1e18)) + return tmp.Div(tmp, big.NewInt(0).Exp(big.NewInt(10), big.NewInt(int64(decimals)), nil)) +} diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdb/price_service_test.go b/core/services/ocr2/plugins/ccip/internal/ccipdb/price_service_test.go new file mode 100644 index 00000000000..a25c5d3c47e --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/ccipdb/price_service_test.go @@ -0,0 +1,842 @@ +package db + +import ( + "context" + "fmt" + "math/big" + "reflect" + "slices" + "sort" + "testing" + "time" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + "github.com/stretchr/testify/require" + + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/pgtest" + "github.com/smartcontractkit/chainlink/v2/core/logger" + cciporm "github.com/smartcontractkit/chainlink/v2/core/services/ccip" + ccipmocks "github.com/smartcontractkit/chainlink/v2/core/services/ccip/mocks" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipcalc" + ccipdatamocks "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/mocks" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/pricegetter" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/prices" +) + +func TestPriceService_writeGasPrices(t *testing.T) { + lggr := logger.TestLogger(t) + jobId := int32(1) + destChainSelector := uint64(12345) + sourceChainSelector := uint64(67890) + + gasPrice := big.NewInt(1e18) + + expectedGasPriceUpdate := []cciporm.GasPrice{ + { + SourceChainSelector: sourceChainSelector, + GasPrice: assets.NewWei(gasPrice), + }, + } + + testCases := []struct { + name string + gasPriceError bool + expectedErr bool + }{ + { + name: "ORM called successfully", + gasPriceError: false, + expectedErr: false, + }, + { + name: "gasPrice clear failed", + gasPriceError: true, + expectedErr: true, + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + ctx := tests.Context(t) + + var gasPricesError error + if tc.gasPriceError { + gasPricesError = fmt.Errorf("gas prices error") + } + + mockOrm := ccipmocks.NewORM(t) + mockOrm.On("UpsertGasPricesForDestChain", ctx, destChainSelector, expectedGasPriceUpdate).Return(int64(0), gasPricesError).Once() + + priceService := NewPriceService( + lggr, + mockOrm, + jobId, + destChainSelector, + sourceChainSelector, + "", + nil, + nil, + ).(*priceService) + err := priceService.writeGasPricesToDB(ctx, gasPrice) + if tc.expectedErr { + assert.Error(t, err) + } else { + assert.NoError(t, err) + } + }) + } +} + +func TestPriceService_writeTokenPrices(t *testing.T) { + lggr := logger.TestLogger(t) + jobId := int32(1) + destChainSelector := uint64(12345) + sourceChainSelector := uint64(67890) + + tokenPrices := map[cciptypes.Address]*big.Int{ + "0x123": big.NewInt(2e18), + "0x234": big.NewInt(3e18), + } + + expectedTokenPriceUpdate := []cciporm.TokenPrice{ + { + TokenAddr: "0x123", + TokenPrice: assets.NewWei(big.NewInt(2e18)), + }, + { + TokenAddr: "0x234", + TokenPrice: assets.NewWei(big.NewInt(3e18)), + }, + } + + testCases := []struct { + name string + tokenPriceError bool + expectedErr bool + }{ + { + name: "ORM called successfully", + tokenPriceError: false, + expectedErr: false, + }, + { + name: "tokenPrice clear failed", + tokenPriceError: true, + expectedErr: true, + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + ctx := tests.Context(t) + + var tokenPricesError error + if tc.tokenPriceError { + tokenPricesError = fmt.Errorf("token prices error") + } + + mockOrm := ccipmocks.NewORM(t) + mockOrm.On("UpsertTokenPricesForDestChain", ctx, destChainSelector, expectedTokenPriceUpdate, tokenPriceUpdateInterval). + Return(int64(len(expectedTokenPriceUpdate)), tokenPricesError).Once() + + priceService := NewPriceService( + lggr, + mockOrm, + jobId, + destChainSelector, + sourceChainSelector, + "", + nil, + nil, + ).(*priceService) + err := priceService.writeTokenPricesToDB(ctx, tokenPrices) + if tc.expectedErr { + assert.Error(t, err) + } else { + assert.NoError(t, err) + } + }) + } +} + +func TestPriceService_observeGasPriceUpdates(t *testing.T) { + lggr := logger.TestLogger(t) + jobId := int32(1) + destChainSelector := uint64(12345) + sourceChainSelector := uint64(67890) + sourceNativeToken := cciptypes.Address(utils.RandomAddress().String()) + + testCases := []struct { + name string + sourceNativeToken cciptypes.Address + priceGetterRespData map[cciptypes.Address]*big.Int + priceGetterRespErr error + feeEstimatorRespFee *big.Int + feeEstimatorRespErr error + maxGasPrice uint64 + expSourceGasPriceUSD *big.Int + expErr bool + }{ + { + name: "base", + sourceNativeToken: sourceNativeToken, + priceGetterRespData: map[cciptypes.Address]*big.Int{ + sourceNativeToken: val1e18(100), + }, + priceGetterRespErr: nil, + feeEstimatorRespFee: big.NewInt(10), + feeEstimatorRespErr: nil, + maxGasPrice: 1e18, + expSourceGasPriceUSD: big.NewInt(1000), + expErr: false, + }, + { + name: "price getter returned an error", + sourceNativeToken: sourceNativeToken, + priceGetterRespData: nil, + priceGetterRespErr: fmt.Errorf("some random network error"), + expErr: true, + }, + { + name: "price getter did not return source native gas price", + sourceNativeToken: sourceNativeToken, + priceGetterRespData: map[cciptypes.Address]*big.Int{ + "0x1": val1e18(100), + }, + priceGetterRespErr: nil, + expErr: true, + }, + { + name: "dynamic fee cap overrides legacy", + sourceNativeToken: sourceNativeToken, + priceGetterRespData: map[cciptypes.Address]*big.Int{ + sourceNativeToken: val1e18(100), + }, + priceGetterRespErr: nil, + feeEstimatorRespFee: big.NewInt(20), + feeEstimatorRespErr: nil, + maxGasPrice: 1e18, + expSourceGasPriceUSD: big.NewInt(2000), + expErr: false, + }, + { + name: "nil gas price", + sourceNativeToken: sourceNativeToken, + priceGetterRespData: map[cciptypes.Address]*big.Int{ + sourceNativeToken: val1e18(100), + }, + feeEstimatorRespFee: nil, + maxGasPrice: 1e18, + expErr: true, + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + priceGetter := pricegetter.NewMockAllTokensPriceGetter(t) + defer priceGetter.AssertExpectations(t) + + gasPriceEstimator := prices.NewMockGasPriceEstimatorCommit(t) + defer gasPriceEstimator.AssertExpectations(t) + + priceGetter.On("TokenPricesUSD", mock.Anything, []cciptypes.Address{tc.sourceNativeToken}).Return(tc.priceGetterRespData, tc.priceGetterRespErr) + + if tc.maxGasPrice > 0 { + gasPriceEstimator.On("GetGasPrice", mock.Anything).Return(tc.feeEstimatorRespFee, tc.feeEstimatorRespErr) + if tc.feeEstimatorRespFee != nil { + pUSD := ccipcalc.CalculateUsdPerUnitGas(tc.feeEstimatorRespFee, tc.priceGetterRespData[tc.sourceNativeToken]) + gasPriceEstimator.On("DenoteInUSD", mock.Anything, mock.Anything).Return(pUSD, nil) + } + } + + priceService := NewPriceService( + lggr, + nil, + jobId, + destChainSelector, + sourceChainSelector, + tc.sourceNativeToken, + priceGetter, + nil, + ).(*priceService) + priceService.gasPriceEstimator = gasPriceEstimator + + sourceGasPriceUSD, err := priceService.observeGasPriceUpdates(context.Background(), lggr) + if tc.expErr { + assert.Error(t, err) + return + } + assert.NoError(t, err) + assert.True(t, tc.expSourceGasPriceUSD.Cmp(sourceGasPriceUSD) == 0) + }) + } +} + +func TestPriceService_observeTokenPriceUpdates(t *testing.T) { + lggr := logger.TestLogger(t) + jobId := int32(1) + destChainSelector := uint64(12345) + sourceChainSelector := uint64(67890) + sourceNativeToken := cciptypes.Address(utils.RandomAddress().String()) + + const nTokens = 10 + tokens := make([]cciptypes.Address, nTokens) + for i := range tokens { + tokens[i] = cciptypes.Address(utils.RandomAddress().String()) + } + sort.Slice(tokens, func(i, j int) bool { return tokens[i] < tokens[j] }) + + testCases := []struct { + name string + destTokens []cciptypes.Address + tokenDecimals map[cciptypes.Address]uint8 + sourceNativeToken cciptypes.Address + filterOutTokens []cciptypes.Address + priceGetterRespData map[cciptypes.Address]*big.Int + priceGetterRespErr error + expTokenPricesUSD map[cciptypes.Address]*big.Int + expErr bool + expDecimalErr bool + }{ + { + name: "base case with src native token not equals to dest token", + tokenDecimals: map[cciptypes.Address]uint8{ // only destination tokens + tokens[1]: 18, + tokens[2]: 12, + }, + sourceNativeToken: sourceNativeToken, + priceGetterRespData: map[cciptypes.Address]*big.Int{ // should return all tokens (including source native token) + sourceNativeToken: val1e18(100), + tokens[1]: val1e18(200), + tokens[2]: val1e18(300), + }, + priceGetterRespErr: nil, + expTokenPricesUSD: map[cciptypes.Address]*big.Int{ // should only return the tokens in destination chain + tokens[1]: val1e18(200), + tokens[2]: val1e18(300 * 1e6), + }, + expErr: false, + }, + { + name: "base case with src native token equals to dest token", + tokenDecimals: map[cciptypes.Address]uint8{ + sourceNativeToken: 18, + tokens[1]: 12, + }, + sourceNativeToken: sourceNativeToken, + priceGetterRespData: map[cciptypes.Address]*big.Int{ + sourceNativeToken: val1e18(100), + tokens[1]: val1e18(200), + }, + priceGetterRespErr: nil, + expTokenPricesUSD: map[cciptypes.Address]*big.Int{ + sourceNativeToken: val1e18(100), + tokens[1]: val1e18(200 * 1e6), + }, + expErr: false, + }, + { + name: "price getter returned an error", + tokenDecimals: map[cciptypes.Address]uint8{ + tokens[0]: 18, + tokens[1]: 18, + }, + sourceNativeToken: tokens[0], + priceGetterRespData: nil, + priceGetterRespErr: fmt.Errorf("some random network error"), + expErr: true, + }, + { + name: "price getter returns more prices than destTokens", + destTokens: []cciptypes.Address{tokens[1]}, + tokenDecimals: map[cciptypes.Address]uint8{ + tokens[1]: 18, + tokens[2]: 12, + tokens[3]: 18, + }, + sourceNativeToken: sourceNativeToken, + priceGetterRespData: map[cciptypes.Address]*big.Int{ + sourceNativeToken: val1e18(100), + tokens[1]: val1e18(200), + tokens[2]: val1e18(300), + tokens[3]: val1e18(400), + }, + expTokenPricesUSD: map[cciptypes.Address]*big.Int{ + tokens[1]: val1e18(200), + tokens[2]: val1e18(300 * 1e6), + tokens[3]: val1e18(400), + }, + }, + { + name: "price getter returns more prices with missing decimals", + tokenDecimals: map[cciptypes.Address]uint8{ + tokens[1]: 18, + tokens[2]: 12, + }, + sourceNativeToken: sourceNativeToken, + priceGetterRespData: map[cciptypes.Address]*big.Int{ + sourceNativeToken: val1e18(100), + tokens[1]: val1e18(200), + tokens[2]: val1e18(300), + tokens[3]: val1e18(400), + }, + priceGetterRespErr: nil, + expErr: true, + expDecimalErr: true, + }, + { + name: "price getter skipped a requested price", + tokenDecimals: map[cciptypes.Address]uint8{ + tokens[0]: 18, + }, + sourceNativeToken: tokens[0], + priceGetterRespData: map[cciptypes.Address]*big.Int{ + tokens[0]: val1e18(100), + }, + priceGetterRespErr: nil, + expTokenPricesUSD: map[cciptypes.Address]*big.Int{ + tokens[0]: val1e18(100), + }, + expErr: false, + }, + { + name: "nil token price", + tokenDecimals: map[cciptypes.Address]uint8{ + tokens[0]: 18, + tokens[1]: 18, + tokens[2]: 18, + }, + sourceNativeToken: tokens[0], + filterOutTokens: []cciptypes.Address{tokens[2]}, + priceGetterRespData: map[cciptypes.Address]*big.Int{ + tokens[0]: nil, + tokens[1]: val1e18(200), + tokens[2]: val1e18(300), + }, + expErr: true, + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + priceGetter := pricegetter.NewMockAllTokensPriceGetter(t) + defer priceGetter.AssertExpectations(t) + + var destTokens []cciptypes.Address + if len(tc.destTokens) == 0 { + for tk := range tc.tokenDecimals { + destTokens = append(destTokens, tk) + } + } else { + destTokens = tc.destTokens + } + + finalDestTokens := make([]cciptypes.Address, 0, len(destTokens)) + for addr := range tc.priceGetterRespData { + if (tc.sourceNativeToken != addr) || (slices.Contains(destTokens, addr)) { + finalDestTokens = append(finalDestTokens, addr) + } + } + sort.Slice(finalDestTokens, func(i, j int) bool { + return finalDestTokens[i] < finalDestTokens[j] + }) + + var destDecimals []uint8 + for _, token := range finalDestTokens { + destDecimals = append(destDecimals, tc.tokenDecimals[token]) + } + + priceGetter.On("GetJobSpecTokenPricesUSD", mock.Anything).Return(tc.priceGetterRespData, tc.priceGetterRespErr) + + offRampReader := ccipdatamocks.NewOffRampReader(t) + offRampReader.On("GetTokens", mock.Anything).Return(cciptypes.OffRampTokens{ + DestinationTokens: destTokens, + }, nil).Maybe() + + destPriceReg := ccipdatamocks.NewPriceRegistryReader(t) + if tc.expDecimalErr { + destPriceReg.On("GetTokensDecimals", mock.Anything, finalDestTokens).Return([]uint8{}, fmt.Errorf("Token not found")).Maybe() + } else { + destPriceReg.On("GetTokensDecimals", mock.Anything, finalDestTokens).Return(destDecimals, nil).Maybe() + } + destPriceReg.On("GetFeeTokens", mock.Anything).Return([]cciptypes.Address{destTokens[0]}, nil).Maybe() + + priceService := NewPriceService( + lggr, + nil, + jobId, + destChainSelector, + sourceChainSelector, + tc.sourceNativeToken, + priceGetter, + offRampReader, + ).(*priceService) + priceService.destPriceRegistryReader = destPriceReg + + tokenPricesUSD, err := priceService.observeTokenPriceUpdates(context.Background(), lggr) + if tc.expErr { + assert.Error(t, err) + return + } + assert.NoError(t, err) + assert.True(t, reflect.DeepEqual(tc.expTokenPricesUSD, tokenPricesUSD)) + }) + } +} + +func TestPriceService_calculateUsdPer1e18TokenAmount(t *testing.T) { + testCases := []struct { + name string + price *big.Int + decimal uint8 + wantResult *big.Int + }{ + { + name: "18-decimal token, $6.5 per token", + price: big.NewInt(65e17), + decimal: 18, + wantResult: big.NewInt(65e17), + }, + { + name: "6-decimal token, $1 per token", + price: big.NewInt(1e18), + decimal: 6, + wantResult: new(big.Int).Mul(big.NewInt(1e18), big.NewInt(1e12)), // 1e30 + }, + { + name: "0-decimal token, $1 per token", + price: big.NewInt(1e18), + decimal: 0, + wantResult: new(big.Int).Mul(big.NewInt(1e18), big.NewInt(1e18)), // 1e36 + }, + { + name: "36-decimal token, $1 per token", + price: big.NewInt(1e18), + decimal: 36, + wantResult: big.NewInt(1), + }, + } + for _, tt := range testCases { + t.Run(tt.name, func(t *testing.T) { + got := calculateUsdPer1e18TokenAmount(tt.price, tt.decimal) + assert.Equal(t, tt.wantResult, got) + }) + } +} + +func TestPriceService_GetGasAndTokenPrices(t *testing.T) { + lggr := logger.TestLogger(t) + jobId := int32(1) + destChainSelector := uint64(12345) + sourceChainSelector := uint64(67890) + + token1 := ccipcalc.HexToAddress("0x123") + token2 := ccipcalc.HexToAddress("0x234") + + gasPrice := big.NewInt(1e18) + tokenPrices := map[cciptypes.Address]*big.Int{ + token1: big.NewInt(2e18), + token2: big.NewInt(3e18), + } + + testCases := []struct { + name string + ormGasPricesResult []cciporm.GasPrice + ormTokenPricesResult []cciporm.TokenPrice + + expectedGasPrices map[uint64]*big.Int + expectedTokenPrices map[cciptypes.Address]*big.Int + + gasPriceError bool + tokenPriceError bool + expectedErr bool + }{ + { + name: "ORM called successfully", + ormGasPricesResult: []cciporm.GasPrice{ + { + SourceChainSelector: sourceChainSelector, + GasPrice: assets.NewWei(gasPrice), + }, + }, + ormTokenPricesResult: []cciporm.TokenPrice{ + { + TokenAddr: string(token1), + TokenPrice: assets.NewWei(tokenPrices[token1]), + }, + { + TokenAddr: string(token2), + TokenPrice: assets.NewWei(tokenPrices[token2]), + }, + }, + expectedGasPrices: map[uint64]*big.Int{ + sourceChainSelector: gasPrice, + }, + expectedTokenPrices: tokenPrices, + gasPriceError: false, + tokenPriceError: false, + expectedErr: false, + }, + { + name: "multiple gas prices with nil token price", + ormGasPricesResult: []cciporm.GasPrice{ + { + SourceChainSelector: sourceChainSelector, + GasPrice: assets.NewWei(gasPrice), + }, + { + SourceChainSelector: sourceChainSelector + 1, + GasPrice: assets.NewWei(big.NewInt(200)), + }, + { + SourceChainSelector: sourceChainSelector + 2, + GasPrice: assets.NewWei(big.NewInt(300)), + }, + }, + ormTokenPricesResult: nil, + expectedGasPrices: map[uint64]*big.Int{ + sourceChainSelector: gasPrice, + sourceChainSelector + 1: big.NewInt(200), + sourceChainSelector + 2: big.NewInt(300), + }, + expectedTokenPrices: map[cciptypes.Address]*big.Int{}, + gasPriceError: false, + tokenPriceError: false, + expectedErr: false, + }, + { + name: "multiple token prices with nil gas price", + ormGasPricesResult: nil, + ormTokenPricesResult: []cciporm.TokenPrice{ + { + TokenAddr: string(token1), + TokenPrice: assets.NewWei(tokenPrices[token1]), + }, + { + TokenAddr: string(token2), + TokenPrice: assets.NewWei(tokenPrices[token2]), + }, + }, + expectedGasPrices: map[uint64]*big.Int{}, + expectedTokenPrices: tokenPrices, + gasPriceError: false, + tokenPriceError: false, + expectedErr: false, + }, + { + name: "nil prices filtered out", + ormGasPricesResult: []cciporm.GasPrice{ + { + SourceChainSelector: sourceChainSelector, + GasPrice: nil, + }, + { + SourceChainSelector: sourceChainSelector + 1, + GasPrice: assets.NewWei(gasPrice), + }, + }, + ormTokenPricesResult: []cciporm.TokenPrice{ + { + TokenAddr: string(token1), + TokenPrice: assets.NewWei(tokenPrices[token1]), + }, + { + TokenAddr: string(token2), + TokenPrice: nil, + }, + }, + expectedGasPrices: map[uint64]*big.Int{ + sourceChainSelector + 1: gasPrice, + }, + expectedTokenPrices: map[cciptypes.Address]*big.Int{ + token1: tokenPrices[token1], + }, + gasPriceError: false, + tokenPriceError: false, + expectedErr: false, + }, + { + name: "gasPrice clear failed", + gasPriceError: true, + tokenPriceError: false, + expectedErr: true, + }, + { + name: "tokenPrice clear failed", + gasPriceError: false, + tokenPriceError: true, + expectedErr: true, + }, + { + name: "both ORM calls failed", + gasPriceError: true, + tokenPriceError: true, + expectedErr: true, + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + ctx := tests.Context(t) + + mockOrm := ccipmocks.NewORM(t) + if tc.gasPriceError { + mockOrm.On("GetGasPricesByDestChain", ctx, destChainSelector).Return(nil, fmt.Errorf("gas prices error")).Once() + } else { + mockOrm.On("GetGasPricesByDestChain", ctx, destChainSelector).Return(tc.ormGasPricesResult, nil).Once() + } + if tc.tokenPriceError { + mockOrm.On("GetTokenPricesByDestChain", ctx, destChainSelector).Return(nil, fmt.Errorf("token prices error")).Once() + } else { + mockOrm.On("GetTokenPricesByDestChain", ctx, destChainSelector).Return(tc.ormTokenPricesResult, nil).Once() + } + + priceService := NewPriceService( + lggr, + mockOrm, + jobId, + destChainSelector, + sourceChainSelector, + "", + nil, + nil, + ).(*priceService) + gasPricesResult, tokenPricesResult, err := priceService.GetGasAndTokenPrices(ctx, destChainSelector) + if tc.expectedErr { + assert.Error(t, err) + } else { + assert.NoError(t, err) + assert.Equal(t, tc.expectedGasPrices, gasPricesResult) + assert.Equal(t, tc.expectedTokenPrices, tokenPricesResult) + } + }) + } +} + +func val1e18(val int64) *big.Int { + return new(big.Int).Mul(big.NewInt(1e18), big.NewInt(val)) +} + +func setupORM(t *testing.T) cciporm.ORM { + t.Helper() + + db := pgtest.NewSqlxDB(t) + orm, err := cciporm.NewORM(db, logger.TestLogger(t)) + + require.NoError(t, err) + + return orm +} + +func checkResultLen(t *testing.T, priceService PriceService, destChainSelector uint64, gasCount int, tokenCount int) error { + ctx := tests.Context(t) + dbGasResult, dbTokenResult, err := priceService.GetGasAndTokenPrices(ctx, destChainSelector) + if err != nil { + return nil + } + if len(dbGasResult) != gasCount { + return fmt.Errorf("expected %d gas prices, got %d", gasCount, len(dbGasResult)) + } + if len(dbTokenResult) != tokenCount { + return fmt.Errorf("expected %d token prices, got %d", tokenCount, len(dbTokenResult)) + } + return nil +} + +func TestPriceService_priceWriteInBackground(t *testing.T) { + lggr := logger.TestLogger(t) + jobId := int32(1) + destChainSelector := uint64(12345) + sourceChainSelector := uint64(67890) + ctx := tests.Context(t) + + sourceNative := cciptypes.Address(utils.RandomAddress().String()) + feeToken := cciptypes.Address(utils.RandomAddress().String()) + destToken1 := cciptypes.Address(utils.RandomAddress().String()) + destToken2 := cciptypes.Address(utils.RandomAddress().String()) + + feeTokens := []cciptypes.Address{feeToken} + rampTokens := []cciptypes.Address{destToken1, destToken2} + + laneTokens := []cciptypes.Address{sourceNative, feeToken, destToken1, destToken2} + // sort laneTokens + sort.Slice(laneTokens, func(i, j int) bool { + return laneTokens[i] < laneTokens[j] + }) + laneTokenDecimals := []uint8{18, 18, 18, 18} + + tokens := []cciptypes.Address{sourceNative, feeToken, destToken1, destToken2} + tokenPrices := []int64{2, 3, 4, 5} + gasPrice := big.NewInt(10) + + orm := setupORM(t) + + priceGetter := pricegetter.NewMockAllTokensPriceGetter(t) + defer priceGetter.AssertExpectations(t) + + gasPriceEstimator := prices.NewMockGasPriceEstimatorCommit(t) + defer gasPriceEstimator.AssertExpectations(t) + + priceGetter.On("TokenPricesUSD", mock.Anything, []cciptypes.Address{sourceNative}).Return(map[cciptypes.Address]*big.Int{ + tokens[0]: val1e18(tokenPrices[0]), + }, nil) + + priceGetter.On("GetJobSpecTokenPricesUSD", mock.Anything).Return(map[cciptypes.Address]*big.Int{ + tokens[0]: val1e18(tokenPrices[0]), + tokens[1]: val1e18(tokenPrices[1]), + tokens[2]: val1e18(tokenPrices[2]), + tokens[3]: val1e18(tokenPrices[3]), + }, nil) + + destTokens := append(rampTokens, sourceNative) + offRampReader := ccipdatamocks.NewOffRampReader(t) + offRampReader.On("GetTokens", mock.Anything).Return(cciptypes.OffRampTokens{ + DestinationTokens: destTokens, + }, nil).Maybe() + + gasPriceEstimator.On("GetGasPrice", mock.Anything).Return(gasPrice, nil) + pUSD := ccipcalc.CalculateUsdPerUnitGas(gasPrice, val1e18(tokenPrices[0])) + gasPriceEstimator.On("DenoteInUSD", mock.Anything, mock.Anything).Return(pUSD, nil) + + destPriceReg := ccipdatamocks.NewPriceRegistryReader(t) + destPriceReg.On("GetTokensDecimals", mock.Anything, laneTokens).Return(laneTokenDecimals, nil).Maybe() + destPriceReg.On("GetFeeTokens", mock.Anything).Return(feeTokens, nil).Maybe() + + priceService := NewPriceService( + lggr, + orm, + jobId, + destChainSelector, + sourceChainSelector, + tokens[0], + priceGetter, + offRampReader, + ).(*priceService) + + gasUpdateInterval := 2000 * time.Millisecond + tokenUpdateInterval := 5000 * time.Millisecond + + // run gas price task every 2 second + priceService.gasUpdateInterval = gasUpdateInterval + // run token price task every 5 second + priceService.tokenUpdateInterval = tokenUpdateInterval + + // initially, db is empty + assert.NoError(t, checkResultLen(t, priceService, destChainSelector, 0, 0)) + + // starts PriceService in the background + assert.NoError(t, priceService.Start(ctx)) + + // setting dynamicConfig triggers initial price update + err := priceService.UpdateDynamicConfig(ctx, gasPriceEstimator, destPriceReg) + assert.NoError(t, err) + assert.NoError(t, checkResultLen(t, priceService, destChainSelector, 1, len(laneTokens))) + + assert.NoError(t, priceService.Close()) +} diff --git a/core/services/ocr2/plugins/ccip/internal/logpollerutil/filters.go b/core/services/ocr2/plugins/ccip/internal/logpollerutil/filters.go new file mode 100644 index 00000000000..e42dd8c154d --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/logpollerutil/filters.go @@ -0,0 +1,73 @@ +package logpollerutil + +import ( + "context" + + "github.com/ethereum/go-ethereum/common" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils" +) + +func RegisterLpFilters(lp logpoller.LogPoller, filters []logpoller.Filter) error { + for _, lpFilter := range filters { + if filterContainsZeroAddress(lpFilter.Addresses) { + continue + } + // FIXME Dim pgOpts removed from LogPoller + if err := lp.RegisterFilter(context.Background(), lpFilter); err != nil { + return err + } + } + return nil +} + +func UnregisterLpFilters(lp logpoller.LogPoller, filters []logpoller.Filter) error { + for _, lpFilter := range filters { + if filterContainsZeroAddress(lpFilter.Addresses) { + continue + } + // FIXME Dim pgOpts removed from LogPoller + if err := lp.UnregisterFilter(context.Background(), lpFilter.Name); err != nil { + return err + } + } + return nil +} + +func FiltersDiff(filtersBefore, filtersNow []logpoller.Filter) (created, deleted []logpoller.Filter) { + created = make([]logpoller.Filter, 0, len(filtersNow)) + deleted = make([]logpoller.Filter, 0, len(filtersBefore)) + + for _, f := range filtersNow { + if !containsFilter(filtersBefore, f) { + created = append(created, f) + } + } + + for _, f := range filtersBefore { + if !containsFilter(filtersNow, f) { + deleted = append(deleted, f) + } + } + + return created, deleted +} + +func containsFilter(filters []logpoller.Filter, f logpoller.Filter) bool { + for _, existing := range filters { + if existing.Name == f.Name { + return true + } + } + return false +} + +func filterContainsZeroAddress(addrs []common.Address) bool { + for _, addr := range addrs { + if addr == utils.ZeroAddress { + return true + } + } + return false +} diff --git a/core/services/ocr2/plugins/ccip/internal/logpollerutil/filters_test.go b/core/services/ocr2/plugins/ccip/internal/logpollerutil/filters_test.go new file mode 100644 index 00000000000..9ea08ec1421 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/logpollerutil/filters_test.go @@ -0,0 +1,156 @@ +package logpollerutil + +import ( + "testing" + "time" + + "github.com/ethereum/go-ethereum/common" + "github.com/stretchr/testify/assert" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" +) + +func Test_FiltersDiff(t *testing.T) { + type args struct { + filtersBefore []logpoller.Filter + filtersNow []logpoller.Filter + } + tests := []struct { + name string + args args + wantCreated []logpoller.Filter + wantDeleted []logpoller.Filter + }{ + { + name: "no diff, both empty", + args: args{ + filtersBefore: []logpoller.Filter{}, + filtersNow: []logpoller.Filter{}, + }, + wantCreated: []logpoller.Filter{}, + wantDeleted: []logpoller.Filter{}, + }, + { + name: "no diff, both non-empty", + args: args{ + filtersBefore: []logpoller.Filter{{Name: "a"}}, + filtersNow: []logpoller.Filter{{Name: "a"}}, + }, + wantCreated: []logpoller.Filter{}, + wantDeleted: []logpoller.Filter{}, + }, + { + name: "no diff, only name matters", + args: args{ + filtersBefore: []logpoller.Filter{{Name: "a", Retention: time.Minute}}, + filtersNow: []logpoller.Filter{{Name: "a", Retention: time.Second}}, + }, + wantCreated: []logpoller.Filter{}, + wantDeleted: []logpoller.Filter{}, + }, + { + name: "diff for both created and deleted", + args: args{ + filtersBefore: []logpoller.Filter{{Name: "e"}, {Name: "a"}, {Name: "b"}}, + filtersNow: []logpoller.Filter{{Name: "a"}, {Name: "c"}, {Name: "d"}}, + }, + wantCreated: []logpoller.Filter{{Name: "c"}, {Name: "d"}}, + wantDeleted: []logpoller.Filter{{Name: "e"}, {Name: "b"}}, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + gotCreated, gotDeleted := FiltersDiff(tt.args.filtersBefore, tt.args.filtersNow) + assert.Equalf(t, tt.wantCreated, gotCreated, "filtersDiff(%v, %v)", tt.args.filtersBefore, tt.args.filtersNow) + assert.Equalf(t, tt.wantDeleted, gotDeleted, "filtersDiff(%v, %v)", tt.args.filtersBefore, tt.args.filtersNow) + }) + } +} + +func Test_filterContainsZeroAddress(t *testing.T) { + type args struct { + addrs []common.Address + } + tests := []struct { + name string + args args + want bool + }{ + { + name: "non-zero addrs", + args: args{ + addrs: []common.Address{ + common.HexToAddress("1"), + common.HexToAddress("2"), + common.HexToAddress("3"), + }, + }, + want: false, + }, + { + name: "empty", + args: args{addrs: []common.Address{}}, + want: false, + }, + { + name: "zero addr", + args: args{ + addrs: []common.Address{ + common.HexToAddress("1"), + common.HexToAddress("0"), + common.HexToAddress("2"), + common.HexToAddress("3"), + }, + }, + want: true, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + assert.Equalf(t, tt.want, filterContainsZeroAddress(tt.args.addrs), "filterContainsZeroAddress(%v)", tt.args.addrs) + }) + } +} + +func Test_containsFilter(t *testing.T) { + type args struct { + filters []logpoller.Filter + f logpoller.Filter + } + tests := []struct { + name string + args args + want bool + }{ + { + name: "empty", + args: args{ + filters: []logpoller.Filter{}, + f: logpoller.Filter{}, + }, + want: false, + }, + { + name: "contains", + args: args{ + filters: []logpoller.Filter{{Name: "a"}, {Name: "b"}}, + f: logpoller.Filter{Name: "b"}, + }, + want: true, + }, + { + name: "does not contain", + args: args{ + filters: []logpoller.Filter{{Name: "a"}, {Name: "b"}}, + f: logpoller.Filter{Name: "c"}, + }, + want: false, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + assert.Equalf(t, tt.want, + containsFilter(tt.args.filters, tt.args.f), "containsFilter(%v, %v)", tt.args.filters, tt.args.f) + }) + } +} diff --git a/core/services/ocr2/plugins/ccip/internal/observability/commit_store.go b/core/services/ocr2/plugins/ccip/internal/observability/commit_store.go new file mode 100644 index 00000000000..6a1fb48f498 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/observability/commit_store.go @@ -0,0 +1,75 @@ +package observability + +import ( + "context" + "time" + + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata" +) + +type ObservedCommitStoreReader struct { + ccipdata.CommitStoreReader + metric metricDetails +} + +func NewObservedCommitStoreReader(origin ccipdata.CommitStoreReader, chainID int64, pluginName string) *ObservedCommitStoreReader { + return &ObservedCommitStoreReader{ + CommitStoreReader: origin, + metric: metricDetails{ + interactionDuration: readerHistogram, + resultSetSize: readerDatasetSize, + pluginName: pluginName, + readerName: "CommitStoreReader", + chainId: chainID, + }, + } +} + +func (o *ObservedCommitStoreReader) GetExpectedNextSequenceNumber(context context.Context) (uint64, error) { + return withObservedInteraction(o.metric, "GetExpectedNextSequenceNumber", func() (uint64, error) { + return o.CommitStoreReader.GetExpectedNextSequenceNumber(context) + }) +} + +func (o *ObservedCommitStoreReader) GetLatestPriceEpochAndRound(context context.Context) (uint64, error) { + return withObservedInteraction(o.metric, "GetLatestPriceEpochAndRound", func() (uint64, error) { + return o.CommitStoreReader.GetLatestPriceEpochAndRound(context) + }) +} + +func (o *ObservedCommitStoreReader) GetCommitReportMatchingSeqNum(ctx context.Context, seqNum uint64, confs int) ([]cciptypes.CommitStoreReportWithTxMeta, error) { + return withObservedInteractionAndResults(o.metric, "GetCommitReportMatchingSeqNum", func() ([]cciptypes.CommitStoreReportWithTxMeta, error) { + return o.CommitStoreReader.GetCommitReportMatchingSeqNum(ctx, seqNum, confs) + }) +} + +func (o *ObservedCommitStoreReader) GetAcceptedCommitReportsGteTimestamp(ctx context.Context, ts time.Time, confs int) ([]cciptypes.CommitStoreReportWithTxMeta, error) { + return withObservedInteractionAndResults(o.metric, "GetAcceptedCommitReportsGteTimestamp", func() ([]cciptypes.CommitStoreReportWithTxMeta, error) { + return o.CommitStoreReader.GetAcceptedCommitReportsGteTimestamp(ctx, ts, confs) + }) +} + +func (o *ObservedCommitStoreReader) IsDown(ctx context.Context) (bool, error) { + return withObservedInteraction(o.metric, "IsDown", func() (bool, error) { + return o.CommitStoreReader.IsDown(ctx) + }) +} + +func (o *ObservedCommitStoreReader) IsBlessed(ctx context.Context, root [32]byte) (bool, error) { + return withObservedInteraction(o.metric, "IsBlessed", func() (bool, error) { + return o.CommitStoreReader.IsBlessed(ctx, root) + }) +} + +func (o *ObservedCommitStoreReader) VerifyExecutionReport(ctx context.Context, report cciptypes.ExecReport) (bool, error) { + return withObservedInteraction(o.metric, "VerifyExecutionReport", func() (bool, error) { + return o.CommitStoreReader.VerifyExecutionReport(ctx, report) + }) +} + +func (o *ObservedCommitStoreReader) GetCommitStoreStaticConfig(ctx context.Context) (cciptypes.CommitStoreStaticConfig, error) { + return withObservedInteraction(o.metric, "GetCommitStoreStaticConfig", func() (cciptypes.CommitStoreStaticConfig, error) { + return o.CommitStoreReader.GetCommitStoreStaticConfig(ctx) + }) +} diff --git a/core/services/ocr2/plugins/ccip/internal/observability/metrics.go b/core/services/ocr2/plugins/ccip/internal/observability/metrics.go new file mode 100644 index 00000000000..9e161fdd9ae --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/observability/metrics.go @@ -0,0 +1,75 @@ +package observability + +import ( + "strconv" + "time" + + "github.com/prometheus/client_golang/prometheus" + "github.com/prometheus/client_golang/prometheus/promauto" +) + +var ( + latencyBuckets = []float64{ + float64(10 * time.Millisecond), + float64(25 * time.Millisecond), + float64(50 * time.Millisecond), + float64(75 * time.Millisecond), + float64(100 * time.Millisecond), + float64(200 * time.Millisecond), + float64(300 * time.Millisecond), + float64(400 * time.Millisecond), + float64(500 * time.Millisecond), + float64(750 * time.Millisecond), + float64(1 * time.Second), + float64(2 * time.Second), + float64(3 * time.Second), + float64(4 * time.Second), + } + labels = []string{"evmChainID", "plugin", "reader", "function", "success"} + readerHistogram = promauto.NewHistogramVec(prometheus.HistogramOpts{ + Name: "ccip_reader_duration", + Help: "Duration of calls to Reader instance", + Buckets: latencyBuckets, + }, labels) + readerDatasetSize = promauto.NewGaugeVec(prometheus.GaugeOpts{ + Name: "ccip_reader_dataset_size", + Help: "Size of the dataset returned from the Reader instance", + }, labels) +) + +type metricDetails struct { + interactionDuration *prometheus.HistogramVec + resultSetSize *prometheus.GaugeVec + pluginName string + readerName string + chainId int64 +} + +func withObservedInteraction[T any](metric metricDetails, function string, f func() (T, error)) (T, error) { + contractExecutionStarted := time.Now() + value, err := f() + metric.interactionDuration. + WithLabelValues( + strconv.FormatInt(metric.chainId, 10), + metric.pluginName, + metric.readerName, + function, + strconv.FormatBool(err == nil), + ). + Observe(float64(time.Since(contractExecutionStarted))) + return value, err +} + +func withObservedInteractionAndResults[T any](metric metricDetails, function string, f func() ([]T, error)) ([]T, error) { + results, err := withObservedInteraction(metric, function, f) + if err == nil { + metric.resultSetSize.WithLabelValues( + strconv.FormatInt(metric.chainId, 10), + metric.pluginName, + metric.readerName, + function, + strconv.FormatBool(err == nil), + ).Set(float64(len(results))) + } + return results, err +} diff --git a/core/services/ocr2/plugins/ccip/internal/observability/metrics_test.go b/core/services/ocr2/plugins/ccip/internal/observability/metrics_test.go new file mode 100644 index 00000000000..3d84acf9616 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/observability/metrics_test.go @@ -0,0 +1,87 @@ +package observability + +import ( + "fmt" + "testing" + + "github.com/prometheus/client_golang/prometheus" + io_prometheus_client "github.com/prometheus/client_model/go" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" + ccipdatamocks "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/mocks" +) + +func TestProperLabelsArePassed(t *testing.T) { + histogram := readerHistogram + successCounter := 10 + failedCounter := 5 + + details := metricDetails{ + interactionDuration: histogram, + pluginName: "plugin", + readerName: "reader", + chainId: 123, + } + + for i := 0; i < successCounter; i++ { + _, err := withObservedInteraction[string](details, "successFun", successfulContract) + require.NoError(t, err) + } + + for i := 0; i < failedCounter; i++ { + _, err := withObservedInteraction[string](details, "failedFun", failedContract) + require.Error(t, err) + } + + assert.Equal(t, successCounter, counterFromHistogramByLabels(t, histogram, "123", "plugin", "reader", "successFun", "true")) + assert.Equal(t, failedCounter, counterFromHistogramByLabels(t, histogram, "123", "plugin", "reader", "failedFun", "false")) + + assert.Equal(t, 0, counterFromHistogramByLabels(t, histogram, "123", "plugin", "reader", "failedFun", "true")) + assert.Equal(t, 0, counterFromHistogramByLabels(t, histogram, "123", "plugin", "reader", "successFun", "false")) +} + +func TestMetricsSendFromContractDirectly(t *testing.T) { + expectedCounter := 4 + ctx := testutils.Context(t) + chainId := int64(420) + + mockedOfframp := ccipdatamocks.NewOffRampReader(t) + mockedOfframp.On("GetTokens", ctx).Return(cciptypes.OffRampTokens{}, fmt.Errorf("execution error")) + + observedOfframp := NewObservedOffRampReader(mockedOfframp, chainId, "plugin") + + for i := 0; i < expectedCounter; i++ { + _, _ = observedOfframp.GetTokens(ctx) + } + + assert.Equal(t, expectedCounter, counterFromHistogramByLabels(t, observedOfframp.metric.interactionDuration, "420", "plugin", "OffRampReader", "GetTokens", "false")) + assert.Equal(t, 0, counterFromHistogramByLabels(t, observedOfframp.metric.interactionDuration, "420", "plugin", "OffRampReader", "GetPoolByDestToken", "false")) + assert.Equal(t, 0, counterFromHistogramByLabels(t, observedOfframp.metric.interactionDuration, "420", "plugin", "OffRampReader", "GetPoolByDestToken", "true")) +} + +func counterFromHistogramByLabels(t *testing.T, histogramVec *prometheus.HistogramVec, labels ...string) int { + observer, err := histogramVec.GetMetricWithLabelValues(labels...) + require.NoError(t, err) + + metricCh := make(chan prometheus.Metric, 1) + observer.(prometheus.Histogram).Collect(metricCh) + close(metricCh) + + metric := <-metricCh + pb := &io_prometheus_client.Metric{} + err = metric.Write(pb) + require.NoError(t, err) + + return int(pb.GetHistogram().GetSampleCount()) +} + +func successfulContract() (string, error) { + return "success", nil +} + +func failedContract() (string, error) { + return "", fmt.Errorf("just error") +} diff --git a/core/services/ocr2/plugins/ccip/internal/observability/offramp.go b/core/services/ocr2/plugins/ccip/internal/observability/offramp.go new file mode 100644 index 00000000000..b426bc8c91d --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/observability/offramp.go @@ -0,0 +1,69 @@ +package observability + +import ( + "context" + + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata" +) + +type ObservedOffRampReader struct { + ccipdata.OffRampReader + metric metricDetails +} + +func NewObservedOffRampReader(origin ccipdata.OffRampReader, chainID int64, pluginName string) *ObservedOffRampReader { + return &ObservedOffRampReader{ + OffRampReader: origin, + metric: metricDetails{ + interactionDuration: readerHistogram, + resultSetSize: readerDatasetSize, + pluginName: pluginName, + readerName: "OffRampReader", + chainId: chainID, + }, + } +} + +func (o *ObservedOffRampReader) GetExecutionStateChangesBetweenSeqNums(ctx context.Context, seqNumMin, seqNumMax uint64, confs int) ([]cciptypes.ExecutionStateChangedWithTxMeta, error) { + return withObservedInteraction(o.metric, "GetExecutionStateChangesBetweenSeqNums", func() ([]cciptypes.ExecutionStateChangedWithTxMeta, error) { + return o.OffRampReader.GetExecutionStateChangesBetweenSeqNums(ctx, seqNumMin, seqNumMax, confs) + }) +} + +func (o *ObservedOffRampReader) CurrentRateLimiterState(ctx context.Context) (cciptypes.TokenBucketRateLimit, error) { + return withObservedInteraction(o.metric, "CurrentRateLimiterState", func() (cciptypes.TokenBucketRateLimit, error) { + return o.OffRampReader.CurrentRateLimiterState(ctx) + }) +} + +func (o *ObservedOffRampReader) GetExecutionState(ctx context.Context, sequenceNumber uint64) (uint8, error) { + return withObservedInteraction(o.metric, "GetExecutionState", func() (uint8, error) { + return o.OffRampReader.GetExecutionState(ctx, sequenceNumber) + }) +} + +func (o *ObservedOffRampReader) GetStaticConfig(ctx context.Context) (cciptypes.OffRampStaticConfig, error) { + return withObservedInteraction(o.metric, "GetStaticConfig", func() (cciptypes.OffRampStaticConfig, error) { + return o.OffRampReader.GetStaticConfig(ctx) + }) +} + +func (o *ObservedOffRampReader) GetSourceToDestTokensMapping(ctx context.Context) (map[cciptypes.Address]cciptypes.Address, error) { + return withObservedInteraction(o.metric, "GetSourceToDestTokensMapping", func() (map[cciptypes.Address]cciptypes.Address, error) { + return o.OffRampReader.GetSourceToDestTokensMapping(ctx) + }) +} + +func (o *ObservedOffRampReader) GetTokens(ctx context.Context) (cciptypes.OffRampTokens, error) { + return withObservedInteraction(o.metric, "GetTokens", func() (cciptypes.OffRampTokens, error) { + return o.OffRampReader.GetTokens(ctx) + }) +} + +func (o *ObservedOffRampReader) GetSendersNonce(ctx context.Context, senders []cciptypes.Address) (map[cciptypes.Address]uint64, error) { + return withObservedInteraction(o.metric, "ListSenderNonces", func() (map[cciptypes.Address]uint64, error) { + return o.OffRampReader.ListSenderNonces(ctx, senders) + }) +} diff --git a/core/services/ocr2/plugins/ccip/internal/observability/onramp.go b/core/services/ocr2/plugins/ccip/internal/observability/onramp.go new file mode 100644 index 00000000000..b167bd57b06 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/observability/onramp.go @@ -0,0 +1,63 @@ +package observability + +import ( + "context" + + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata" +) + +type ObservedOnRampReader struct { + ccipdata.OnRampReader + metric metricDetails +} + +func NewObservedOnRampReader(origin ccipdata.OnRampReader, chainID int64, pluginName string) *ObservedOnRampReader { + return &ObservedOnRampReader{ + OnRampReader: origin, + metric: metricDetails{ + interactionDuration: readerHistogram, + resultSetSize: readerDatasetSize, + pluginName: pluginName, + readerName: "OnRampReader", + chainId: chainID, + }, + } +} + +func (o ObservedOnRampReader) GetSendRequestsBetweenSeqNums(ctx context.Context, seqNumMin, seqNumMax uint64, finalized bool) ([]cciptypes.EVM2EVMMessageWithTxMeta, error) { + return withObservedInteractionAndResults(o.metric, "GetSendRequestsBetweenSeqNums", func() ([]cciptypes.EVM2EVMMessageWithTxMeta, error) { + return o.OnRampReader.GetSendRequestsBetweenSeqNums(ctx, seqNumMin, seqNumMax, finalized) + }) +} + +func (o ObservedOnRampReader) RouterAddress(ctx context.Context) (cciptypes.Address, error) { + return withObservedInteraction(o.metric, "RouterAddress", func() (cciptypes.Address, error) { + return o.OnRampReader.RouterAddress(ctx) + }) +} + +func (o ObservedOnRampReader) GetDynamicConfig(ctx context.Context) (cciptypes.OnRampDynamicConfig, error) { + return withObservedInteraction(o.metric, "GetDynamicConfig", func() (cciptypes.OnRampDynamicConfig, error) { + return o.OnRampReader.GetDynamicConfig(ctx) + }) +} + +func (o ObservedOnRampReader) IsSourceCursed(ctx context.Context) (bool, error) { + return withObservedInteraction(o.metric, "IsSourceCursed", func() (bool, error) { + return o.OnRampReader.IsSourceCursed(ctx) + }) +} + +func (o ObservedOnRampReader) IsSourceChainHealthy(ctx context.Context) (bool, error) { + return withObservedInteraction(o.metric, "IsSourceChainHealthy", func() (bool, error) { + return o.OnRampReader.IsSourceChainHealthy(ctx) + }) +} + +func (o ObservedOnRampReader) SourcePriceRegistryAddress(ctx context.Context) (cciptypes.Address, error) { + return withObservedInteraction(o.metric, "SourcePriceRegistryAddress", func() (cciptypes.Address, error) { + return o.OnRampReader.SourcePriceRegistryAddress(ctx) + }) +} diff --git a/core/services/ocr2/plugins/ccip/internal/observability/onramp_observed_test.go b/core/services/ocr2/plugins/ccip/internal/observability/onramp_observed_test.go new file mode 100644 index 00000000000..1918f632b94 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/observability/onramp_observed_test.go @@ -0,0 +1,155 @@ +package observability + +import ( + "fmt" + "reflect" + "runtime" + "strings" + "testing" + + "github.com/prometheus/client_golang/prometheus" + "github.com/prometheus/client_golang/prometheus/promauto" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/mocks" +) + +type MethodCall struct { + MethodName string + Arguments []interface{} + Returns []interface{} +} + +// The class expected to override the observed methods. +const expectedWrapper = "core/services/ocr2/plugins/ccip/internal/observability.ObservedOnRampReader" + +// TestOnRampObservedMethods tests that all methods of OnRampReader are observed by a wrapper. +// It uses the runtime to detect if the call stack contains the wrapper class. +func TestOnRampObservedMethods(t *testing.T) { + // Methods not expected to be observed. + // Add a method name here to exclude it from the test. + excludedMethods := []string{ + "Address", + "Close", + } + + // Defines the overridden method calls to test. + // Not defining a non-excluded method here will cause the test to fail with an explicit error. + methodCalls := make(map[string]MethodCall) + methodCalls["GetDynamicConfig"] = MethodCall{ + MethodName: "GetDynamicConfig", + Arguments: []interface{}{testutils.Context(t)}, + Returns: []interface{}{cciptypes.OnRampDynamicConfig{}, nil}, + } + methodCalls["GetSendRequestsBetweenSeqNums"] = MethodCall{ + MethodName: "GetSendRequestsBetweenSeqNums", + Arguments: []interface{}{testutils.Context(t), uint64(0), uint64(100), true}, + Returns: []interface{}{nil, nil}, + } + methodCalls["IsSourceChainHealthy"] = MethodCall{ + MethodName: "IsSourceChainHealthy", + Arguments: []interface{}{testutils.Context(t)}, + Returns: []interface{}{false, nil}, + } + methodCalls["IsSourceCursed"] = MethodCall{ + MethodName: "IsSourceCursed", + Arguments: []interface{}{testutils.Context(t)}, + Returns: []interface{}{false, nil}, + } + methodCalls["RouterAddress"] = MethodCall{ + MethodName: "RouterAddress", + Arguments: []interface{}{testutils.Context(t)}, + Returns: []interface{}{cciptypes.Address("0x0"), nil}, + } + methodCalls["SourcePriceRegistryAddress"] = MethodCall{ + MethodName: "SourcePriceRegistryAddress", + Arguments: []interface{}{testutils.Context(t)}, + Returns: []interface{}{cciptypes.Address("0x0"), nil}, + } + + // Test each method defined in the embedded type. + observed, reader := buildReader(t) + observedType := reflect.TypeOf(observed) + for i := 0; i < observedType.NumMethod(); i++ { + method := observedType.Method(i) + testMethod(t, method, methodCalls, excludedMethods, reader, observed) + } +} + +func testMethod(t *testing.T, method reflect.Method, methodCalls map[string]MethodCall, excludedMethods []string, reader *mocks.OnRampReader, observed ObservedOnRampReader) { + t.Run(fmt.Sprintf("observability_wrapper_%s", method.Name), func(t *testing.T) { + // Skip excluded methods. + for _, em := range excludedMethods { + if method.Name == em { + // Skipping ignore method (not an error). + return + } + } + + // Retrieve method call from definition (fail if not present). + mc := methodCalls[method.Name] + if mc.MethodName == "" { + assert.Fail(t, fmt.Sprintf("method %s not defined in methodCalls, please define it or exclude it.", method.Name)) + return + } + + assertCallByWrapper(t, reader, mc) + + // Perform call on observed object. + callParams := buildCallParams(mc) + methodc := reflect.ValueOf(&observed).MethodByName(mc.MethodName) + methodc.Call(callParams) + }) +} + +// Set the mock to fail if not called by the wrapper. +func assertCallByWrapper(t *testing.T, reader *mocks.OnRampReader, mc MethodCall) { + reader.On(mc.MethodName, mc.Arguments...).Maybe().Return(mc.Returns...).Run(func(args mock.Arguments) { + var i = 0 + var pc uintptr + var ok = true + for ok { + pc, _, _, ok = runtime.Caller(i) + f := runtime.FuncForPC(pc) + if strings.Contains(f.Name(), expectedWrapper) { + // Found the expected wrapper in the call stack. + return + } + i++ + } + assert.Fail(t, fmt.Sprintf("method %s not observed by wrapper. Please implement the method or add it to the excluded list.", mc.MethodName)) + }) +} + +func buildCallParams(mc MethodCall) []reflect.Value { + callParams := make([]reflect.Value, len(mc.Arguments)) + for i, arg := range mc.Arguments { + callParams[i] = reflect.ValueOf(arg) + } + return callParams +} + +// Build a mock reader and an observed wrapper to be used in the tests. +func buildReader(t *testing.T) (ObservedOnRampReader, *mocks.OnRampReader) { + labels = []string{"evmChainID", "plugin", "reader", "function", "success"} + ph := promauto.NewHistogramVec(prometheus.HistogramOpts{ + Name: "test_histogram", + }, labels) + pg := promauto.NewGaugeVec(prometheus.GaugeOpts{ + Name: "test_gauge", + }, labels) + metric := metricDetails{ + interactionDuration: ph, + resultSetSize: pg, + pluginName: "test plugin", + readerName: "test reader", + chainId: 1337, + } + reader := mocks.NewOnRampReader(t) + observed := ObservedOnRampReader{reader, metric} + return observed, reader +} diff --git a/core/services/ocr2/plugins/ccip/internal/observability/price_registry.go b/core/services/ocr2/plugins/ccip/internal/observability/price_registry.go new file mode 100644 index 00000000000..f5b87686d35 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/observability/price_registry.go @@ -0,0 +1,64 @@ +package observability + +import ( + "context" + "time" + + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata" +) + +type ObservedPriceRegistryReader struct { + ccipdata.PriceRegistryReader + metric metricDetails +} + +func NewPriceRegistryReader(origin ccipdata.PriceRegistryReader, chainID int64, pluginName string) *ObservedPriceRegistryReader { + return &ObservedPriceRegistryReader{ + PriceRegistryReader: origin, + metric: metricDetails{ + interactionDuration: readerHistogram, + resultSetSize: readerDatasetSize, + pluginName: pluginName, + readerName: "PriceRegistryReader", + chainId: chainID, + }, + } +} + +func (o *ObservedPriceRegistryReader) GetTokenPriceUpdatesCreatedAfter(ctx context.Context, ts time.Time, confs int) ([]cciptypes.TokenPriceUpdateWithTxMeta, error) { + return withObservedInteractionAndResults(o.metric, "GetTokenPriceUpdatesCreatedAfter", func() ([]cciptypes.TokenPriceUpdateWithTxMeta, error) { + return o.PriceRegistryReader.GetTokenPriceUpdatesCreatedAfter(ctx, ts, confs) + }) +} + +func (o *ObservedPriceRegistryReader) GetGasPriceUpdatesCreatedAfter(ctx context.Context, chainSelector uint64, ts time.Time, confs int) ([]cciptypes.GasPriceUpdateWithTxMeta, error) { + return withObservedInteractionAndResults(o.metric, "GetGasPriceUpdatesCreatedAfter", func() ([]cciptypes.GasPriceUpdateWithTxMeta, error) { + return o.PriceRegistryReader.GetGasPriceUpdatesCreatedAfter(ctx, chainSelector, ts, confs) + }) +} + +func (o *ObservedPriceRegistryReader) GetAllGasPriceUpdatesCreatedAfter(ctx context.Context, ts time.Time, confs int) ([]cciptypes.GasPriceUpdateWithTxMeta, error) { + return withObservedInteractionAndResults(o.metric, "GetAllGasPriceUpdatesCreatedAfter", func() ([]cciptypes.GasPriceUpdateWithTxMeta, error) { + return o.PriceRegistryReader.GetAllGasPriceUpdatesCreatedAfter(ctx, ts, confs) + }) +} + +func (o *ObservedPriceRegistryReader) GetFeeTokens(ctx context.Context) ([]cciptypes.Address, error) { + return withObservedInteraction(o.metric, "GetFeeTokens", func() ([]cciptypes.Address, error) { + return o.PriceRegistryReader.GetFeeTokens(ctx) + }) +} + +func (o *ObservedPriceRegistryReader) GetTokenPrices(ctx context.Context, wantedTokens []cciptypes.Address) ([]cciptypes.TokenPriceUpdate, error) { + return withObservedInteractionAndResults(o.metric, "GetTokenPrices", func() ([]cciptypes.TokenPriceUpdate, error) { + return o.PriceRegistryReader.GetTokenPrices(ctx, wantedTokens) + }) +} + +func (o *ObservedPriceRegistryReader) GetTokensDecimals(ctx context.Context, tokenAddresses []cciptypes.Address) ([]uint8, error) { + return withObservedInteractionAndResults(o.metric, "GetTokensDecimals", func() ([]uint8, error) { + return o.PriceRegistryReader.GetTokensDecimals(ctx, tokenAddresses) + }) +} diff --git a/core/services/ocr2/plugins/ccip/internal/oraclelib/backfilled_oracle.go b/core/services/ocr2/plugins/ccip/internal/oraclelib/backfilled_oracle.go new file mode 100644 index 00000000000..d2851e3a079 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/oraclelib/backfilled_oracle.go @@ -0,0 +1,218 @@ +package oraclelib + +import ( + "context" + "sync" + "sync/atomic" + "time" + + "github.com/smartcontractkit/chainlink/v2/core/services" + + "go.uber.org/multierr" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" + "github.com/smartcontractkit/chainlink/v2/core/logger" + "github.com/smartcontractkit/chainlink/v2/core/services/job" +) + +type BackfilledOracle struct { + srcStartBlock, dstStartBlock uint64 + oracleStarted atomic.Bool + cancelFn context.CancelFunc + src, dst logpoller.LogPoller + oracle job.ServiceCtx + lggr logger.Logger +} + +func NewBackfilledOracle(lggr logger.Logger, src, dst logpoller.LogPoller, srcStartBlock, dstStartBlock uint64, oracle job.ServiceCtx) *BackfilledOracle { + return &BackfilledOracle{ + srcStartBlock: srcStartBlock, + dstStartBlock: dstStartBlock, + oracleStarted: atomic.Bool{}, + cancelFn: nil, + src: src, + dst: dst, + oracle: oracle, + lggr: lggr, + } +} + +func (r *BackfilledOracle) Start(_ context.Context) error { + go r.Run() + return nil +} + +func (r *BackfilledOracle) IsRunning() bool { + return r.oracleStarted.Load() +} + +func (r *BackfilledOracle) Run() { + ctx, cancelFn := context.WithCancel(context.Background()) + r.cancelFn = cancelFn + var err error + var errMu sync.Mutex + var wg sync.WaitGroup + // Replay in parallel if both requested. + if r.srcStartBlock != 0 { + wg.Add(1) + go func() { + defer wg.Done() + s := time.Now() + r.lggr.Infow("start replaying src chain", "fromBlock", r.srcStartBlock) + srcReplayErr := r.src.Replay(ctx, int64(r.srcStartBlock)) + errMu.Lock() + err = multierr.Combine(err, srcReplayErr) + errMu.Unlock() + r.lggr.Infow("finished replaying src chain", "time", time.Since(s)) + }() + } + if r.dstStartBlock != 0 { + wg.Add(1) + go func() { + defer wg.Done() + s := time.Now() + r.lggr.Infow("start replaying dst chain", "fromBlock", r.dstStartBlock) + dstReplayErr := r.dst.Replay(ctx, int64(r.dstStartBlock)) + errMu.Lock() + err = multierr.Combine(err, dstReplayErr) + errMu.Unlock() + r.lggr.Infow("finished replaying dst chain", "time", time.Since(s)) + }() + } + wg.Wait() + if err != nil { + r.lggr.Criticalw("unexpected error replaying, continuing plugin boot without all the logs backfilled", "err", err) + } + if err := ctx.Err(); err != nil { + r.lggr.Errorw("context already cancelled", "err", err) + return + } + // Start oracle with all logs present from dstStartBlock on dst and + // all logs from srcStartBlock on src. + if err := r.oracle.Start(ctx); err != nil { + // Should never happen. + r.lggr.Errorw("unexpected error starting oracle", "err", err) + } else { + r.oracleStarted.Store(true) + } +} + +func (r *BackfilledOracle) Close() error { + if r.oracleStarted.Load() { + // If the oracle is running, it must be Closed/stopped + if err := r.oracle.Close(); err != nil { + r.lggr.Errorw("unexpected error stopping oracle", "err", err) + return err + } + // Flag the oracle as closed with our internal variable that keeps track + // of its state. This will allow to re-start the process + r.oracleStarted.Store(false) + } + if r.cancelFn != nil { + // This is useful to step the previous tasks that are spawned in + // parallel before starting the Oracle. This will use the context to + // signal them to exit immediately. + // + // It can be possible this is the only way to stop the Start() async + // flow, specially when the previusly task are running (the replays) and + // `oracleStarted` would be false in that example. Calling `cancelFn()` + // will stop the replays and will prevent the oracle to start + r.cancelFn() + } + return nil +} + +func NewChainAgnosticBackFilledOracle(lggr logger.Logger, srcProvider services.ServiceCtx, dstProvider services.ServiceCtx, oracle job.ServiceCtx) *ChainAgnosticBackFilledOracle { + return &ChainAgnosticBackFilledOracle{ + srcProvider: srcProvider, + dstProvider: dstProvider, + oracle: oracle, + lggr: lggr, + } +} + +type ChainAgnosticBackFilledOracle struct { + srcProvider services.ServiceCtx + dstProvider services.ServiceCtx + oracle job.ServiceCtx + lggr logger.Logger + oracleStarted atomic.Bool + cancelFn context.CancelFunc +} + +func (r *ChainAgnosticBackFilledOracle) Start(_ context.Context) error { + go r.run() + return nil +} + +func (r *ChainAgnosticBackFilledOracle) run() { + ctx, cancelFn := context.WithCancel(context.Background()) + r.cancelFn = cancelFn + var err error + var errMu sync.Mutex + var wg sync.WaitGroup + // Replay in parallel if both requested. + wg.Add(1) + go func() { + defer wg.Done() + s := time.Now() + srcReplayErr := r.srcProvider.Start(ctx) + errMu.Lock() + err = multierr.Combine(err, srcReplayErr) + errMu.Unlock() + r.lggr.Infow("finished replaying src chain", "time", time.Since(s)) + }() + + wg.Add(1) + go func() { + defer wg.Done() + s := time.Now() + dstReplayErr := r.dstProvider.Start(ctx) + errMu.Lock() + err = multierr.Combine(err, dstReplayErr) + errMu.Unlock() + r.lggr.Infow("finished replaying dst chain", "time", time.Since(s)) + }() + + wg.Wait() + if err != nil { + r.lggr.Criticalw("unexpected error replaying, continuing plugin boot without all the logs backfilled", "err", err) + } + if err := ctx.Err(); err != nil { + r.lggr.Errorw("context already cancelled", "err", err) + } + // Start oracle with all logs present from dstStartBlock on dst and + // all logs from srcStartBlock on src. + if err := r.oracle.Start(ctx); err != nil { + // Should never happen. + r.lggr.Errorw("unexpected error starting oracle", "err", err) + } else { + r.oracleStarted.Store(true) + } +} + +func (r *ChainAgnosticBackFilledOracle) Close() error { + if r.oracleStarted.Load() { + // If the oracle is running, it must be Closed/stopped + // TODO: Close should be safe to call in either case? + if err := r.oracle.Close(); err != nil { + r.lggr.Errorw("unexpected error stopping oracle", "err", err) + return err + } + // Flag the oracle as closed with our internal variable that keeps track + // of its state. This will allow to re-start the process + r.oracleStarted.Store(false) + } + if r.cancelFn != nil { + // This is useful to step the previous tasks that are spawned in + // parallel before starting the Oracle. This will use the context to + // signal them to exit immediately. + // + // It can be possible this is the only way to stop the Start() async + // flow, specially when the previusly task are running (the replays) and + // `oracleStarted` would be false in that example. Calling `cancelFn()` + // will stop the replays and will prevent the oracle to start + r.cancelFn() + } + return nil +} diff --git a/core/services/ocr2/plugins/ccip/internal/oraclelib/backfilled_oracle_test.go b/core/services/ocr2/plugins/ccip/internal/oraclelib/backfilled_oracle_test.go new file mode 100644 index 00000000000..6db1ebbadd9 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/oraclelib/backfilled_oracle_test.go @@ -0,0 +1,56 @@ +package oraclelib + +import ( + "testing" + + "github.com/pkg/errors" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + + lpmocks "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller/mocks" + "github.com/smartcontractkit/chainlink/v2/core/logger" + jobmocks "github.com/smartcontractkit/chainlink/v2/core/services/job/mocks" +) + +func TestBackfilledOracle(t *testing.T) { + // First scenario: Start() fails, check that all Replay are being called. + lp1 := lpmocks.NewLogPoller(t) + lp2 := lpmocks.NewLogPoller(t) + lp1.On("Replay", mock.Anything, int64(1)).Return(nil) + lp2.On("Replay", mock.Anything, int64(2)).Return(nil) + oracle1 := jobmocks.NewServiceCtx(t) + oracle1.On("Start", mock.Anything).Return(errors.New("Failed to start")).Twice() + job := NewBackfilledOracle(logger.TestLogger(t), lp1, lp2, 1, 2, oracle1) + + job.Run() + assert.False(t, job.IsRunning()) + job.Run() + assert.False(t, job.IsRunning()) + + /// Start -> Stop -> Start + oracle2 := jobmocks.NewServiceCtx(t) + oracle2.On("Start", mock.Anything).Return(nil).Twice() + oracle2.On("Close").Return(nil).Once() + + job2 := NewBackfilledOracle(logger.TestLogger(t), lp1, lp2, 1, 2, oracle2) + job2.Run() + assert.True(t, job2.IsRunning()) + assert.Nil(t, job2.Close()) + assert.False(t, job2.IsRunning()) + assert.Nil(t, job2.Close()) + assert.False(t, job2.IsRunning()) + job2.Run() + assert.True(t, job2.IsRunning()) + + /// Replay fails, but it starts anyway + lp11 := lpmocks.NewLogPoller(t) + lp12 := lpmocks.NewLogPoller(t) + lp11.On("Replay", mock.Anything, int64(1)).Return(errors.New("Replay failed")).Once() + lp12.On("Replay", mock.Anything, int64(2)).Return(errors.New("Replay failed")).Once() + + oracle := jobmocks.NewServiceCtx(t) + oracle.On("Start", mock.Anything).Return(nil).Once() + job3 := NewBackfilledOracle(logger.NullLogger, lp11, lp12, 1, 2, oracle) + job3.Run() + assert.True(t, job3.IsRunning()) +} diff --git a/core/services/ocr2/plugins/ccip/internal/parseutil/bigint.go b/core/services/ocr2/plugins/ccip/internal/parseutil/bigint.go new file mode 100644 index 00000000000..48d0d261653 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/parseutil/bigint.go @@ -0,0 +1,44 @@ +package parseutil + +import ( + "math/big" + + "github.com/pkg/errors" + "github.com/shopspring/decimal" +) + +func ParseBigIntFromAny(val any) (*big.Int, error) { + if val == nil { + return nil, errors.Errorf("nil value passed") + } + + switch v := val.(type) { + case decimal.Decimal: + return ParseBigIntFromString(v.String()) + case *decimal.Decimal: + return ParseBigIntFromString(v.String()) + case *big.Int: + return v, nil + case string: + return ParseBigIntFromString(v) + case int: + return big.NewInt(int64(v)), nil + case int64: + return big.NewInt(v), nil + case float64: + i := new(big.Int) + big.NewFloat(v).Int(i) + return i, nil + default: + return nil, errors.Errorf("unsupported big int type %T", val) + } +} + +func ParseBigIntFromString(v string) (*big.Int, error) { + valBigInt, success := new(big.Int).SetString(v, 10) + if !success { + return nil, errors.Errorf("unable to convert to integer %s", v) + } + + return valBigInt, nil +} diff --git a/core/services/ocr2/plugins/ccip/internal/parseutil/bigint_test.go b/core/services/ocr2/plugins/ccip/internal/parseutil/bigint_test.go new file mode 100644 index 00000000000..cea2f8cc19c --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/parseutil/bigint_test.go @@ -0,0 +1,42 @@ +package parseutil + +import ( + "math/big" + "testing" + + "github.com/shopspring/decimal" + "github.com/stretchr/testify/assert" +) + +func TestParseBigIntFromAny(t *testing.T) { + decimalVal := decimal.New(123, 0) + + testCases := []struct { + name string + val any + res *big.Int + expErr bool + }{ + {name: "nil", val: nil, expErr: true}, + {name: "string", val: "123", res: big.NewInt(123)}, + {name: "decimal", val: decimal.New(123, 0), res: big.NewInt(123)}, + {name: "decimal pointer", val: &decimalVal, res: big.NewInt(123)}, + {name: "int64", val: int64(123), res: big.NewInt(123)}, + {name: "int", val: 123, res: big.NewInt(123)}, + {name: "float", val: 123.12, res: big.NewInt(123)}, + {name: "uint8", val: uint8(12), expErr: true}, + {name: "struct", val: struct{ name string }{name: "asd"}, expErr: true}, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + res, err := ParseBigIntFromAny(tc.val) + if tc.expErr { + assert.Error(t, err) + return + } + assert.NoError(t, err) + assert.Equal(t, tc.res, res) + }) + } +} diff --git a/core/services/ocr2/plugins/ccip/internal/pricegetter/all_price_getter_mock.go b/core/services/ocr2/plugins/ccip/internal/pricegetter/all_price_getter_mock.go new file mode 100644 index 00000000000..010c955c766 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/pricegetter/all_price_getter_mock.go @@ -0,0 +1,269 @@ +// Code generated by mockery v2.43.2. DO NOT EDIT. + +package pricegetter + +import ( + context "context" + big "math/big" + + ccip "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + + mock "github.com/stretchr/testify/mock" +) + +// MockAllTokensPriceGetter is an autogenerated mock type for the AllTokensPriceGetter type +type MockAllTokensPriceGetter struct { + mock.Mock +} + +type MockAllTokensPriceGetter_Expecter struct { + mock *mock.Mock +} + +func (_m *MockAllTokensPriceGetter) EXPECT() *MockAllTokensPriceGetter_Expecter { + return &MockAllTokensPriceGetter_Expecter{mock: &_m.Mock} +} + +// Close provides a mock function with given fields: +func (_m *MockAllTokensPriceGetter) Close() error { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Close") + } + + var r0 error + if rf, ok := ret.Get(0).(func() error); ok { + r0 = rf() + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockAllTokensPriceGetter_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close' +type MockAllTokensPriceGetter_Close_Call struct { + *mock.Call +} + +// Close is a helper method to define mock.On call +func (_e *MockAllTokensPriceGetter_Expecter) Close() *MockAllTokensPriceGetter_Close_Call { + return &MockAllTokensPriceGetter_Close_Call{Call: _e.mock.On("Close")} +} + +func (_c *MockAllTokensPriceGetter_Close_Call) Run(run func()) *MockAllTokensPriceGetter_Close_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockAllTokensPriceGetter_Close_Call) Return(_a0 error) *MockAllTokensPriceGetter_Close_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockAllTokensPriceGetter_Close_Call) RunAndReturn(run func() error) *MockAllTokensPriceGetter_Close_Call { + _c.Call.Return(run) + return _c +} + +// FilterConfiguredTokens provides a mock function with given fields: ctx, tokens +func (_m *MockAllTokensPriceGetter) FilterConfiguredTokens(ctx context.Context, tokens []ccip.Address) ([]ccip.Address, []ccip.Address, error) { + ret := _m.Called(ctx, tokens) + + if len(ret) == 0 { + panic("no return value specified for FilterConfiguredTokens") + } + + var r0 []ccip.Address + var r1 []ccip.Address + var r2 error + if rf, ok := ret.Get(0).(func(context.Context, []ccip.Address) ([]ccip.Address, []ccip.Address, error)); ok { + return rf(ctx, tokens) + } + if rf, ok := ret.Get(0).(func(context.Context, []ccip.Address) []ccip.Address); ok { + r0 = rf(ctx, tokens) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]ccip.Address) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, []ccip.Address) []ccip.Address); ok { + r1 = rf(ctx, tokens) + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).([]ccip.Address) + } + } + + if rf, ok := ret.Get(2).(func(context.Context, []ccip.Address) error); ok { + r2 = rf(ctx, tokens) + } else { + r2 = ret.Error(2) + } + + return r0, r1, r2 +} + +// MockAllTokensPriceGetter_FilterConfiguredTokens_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterConfiguredTokens' +type MockAllTokensPriceGetter_FilterConfiguredTokens_Call struct { + *mock.Call +} + +// FilterConfiguredTokens is a helper method to define mock.On call +// - ctx context.Context +// - tokens []ccip.Address +func (_e *MockAllTokensPriceGetter_Expecter) FilterConfiguredTokens(ctx interface{}, tokens interface{}) *MockAllTokensPriceGetter_FilterConfiguredTokens_Call { + return &MockAllTokensPriceGetter_FilterConfiguredTokens_Call{Call: _e.mock.On("FilterConfiguredTokens", ctx, tokens)} +} + +func (_c *MockAllTokensPriceGetter_FilterConfiguredTokens_Call) Run(run func(ctx context.Context, tokens []ccip.Address)) *MockAllTokensPriceGetter_FilterConfiguredTokens_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].([]ccip.Address)) + }) + return _c +} + +func (_c *MockAllTokensPriceGetter_FilterConfiguredTokens_Call) Return(configured []ccip.Address, unconfigured []ccip.Address, err error) *MockAllTokensPriceGetter_FilterConfiguredTokens_Call { + _c.Call.Return(configured, unconfigured, err) + return _c +} + +func (_c *MockAllTokensPriceGetter_FilterConfiguredTokens_Call) RunAndReturn(run func(context.Context, []ccip.Address) ([]ccip.Address, []ccip.Address, error)) *MockAllTokensPriceGetter_FilterConfiguredTokens_Call { + _c.Call.Return(run) + return _c +} + +// GetJobSpecTokenPricesUSD provides a mock function with given fields: ctx +func (_m *MockAllTokensPriceGetter) GetJobSpecTokenPricesUSD(ctx context.Context) (map[ccip.Address]*big.Int, error) { + ret := _m.Called(ctx) + + if len(ret) == 0 { + panic("no return value specified for GetJobSpecTokenPricesUSD") + } + + var r0 map[ccip.Address]*big.Int + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (map[ccip.Address]*big.Int, error)); ok { + return rf(ctx) + } + if rf, ok := ret.Get(0).(func(context.Context) map[ccip.Address]*big.Int); ok { + r0 = rf(ctx) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(map[ccip.Address]*big.Int) + } + } + + if rf, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = rf(ctx) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockAllTokensPriceGetter_GetJobSpecTokenPricesUSD_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetJobSpecTokenPricesUSD' +type MockAllTokensPriceGetter_GetJobSpecTokenPricesUSD_Call struct { + *mock.Call +} + +// GetJobSpecTokenPricesUSD is a helper method to define mock.On call +// - ctx context.Context +func (_e *MockAllTokensPriceGetter_Expecter) GetJobSpecTokenPricesUSD(ctx interface{}) *MockAllTokensPriceGetter_GetJobSpecTokenPricesUSD_Call { + return &MockAllTokensPriceGetter_GetJobSpecTokenPricesUSD_Call{Call: _e.mock.On("GetJobSpecTokenPricesUSD", ctx)} +} + +func (_c *MockAllTokensPriceGetter_GetJobSpecTokenPricesUSD_Call) Run(run func(ctx context.Context)) *MockAllTokensPriceGetter_GetJobSpecTokenPricesUSD_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *MockAllTokensPriceGetter_GetJobSpecTokenPricesUSD_Call) Return(_a0 map[ccip.Address]*big.Int, _a1 error) *MockAllTokensPriceGetter_GetJobSpecTokenPricesUSD_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockAllTokensPriceGetter_GetJobSpecTokenPricesUSD_Call) RunAndReturn(run func(context.Context) (map[ccip.Address]*big.Int, error)) *MockAllTokensPriceGetter_GetJobSpecTokenPricesUSD_Call { + _c.Call.Return(run) + return _c +} + +// TokenPricesUSD provides a mock function with given fields: ctx, tokens +func (_m *MockAllTokensPriceGetter) TokenPricesUSD(ctx context.Context, tokens []ccip.Address) (map[ccip.Address]*big.Int, error) { + ret := _m.Called(ctx, tokens) + + if len(ret) == 0 { + panic("no return value specified for TokenPricesUSD") + } + + var r0 map[ccip.Address]*big.Int + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, []ccip.Address) (map[ccip.Address]*big.Int, error)); ok { + return rf(ctx, tokens) + } + if rf, ok := ret.Get(0).(func(context.Context, []ccip.Address) map[ccip.Address]*big.Int); ok { + r0 = rf(ctx, tokens) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(map[ccip.Address]*big.Int) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, []ccip.Address) error); ok { + r1 = rf(ctx, tokens) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockAllTokensPriceGetter_TokenPricesUSD_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TokenPricesUSD' +type MockAllTokensPriceGetter_TokenPricesUSD_Call struct { + *mock.Call +} + +// TokenPricesUSD is a helper method to define mock.On call +// - ctx context.Context +// - tokens []ccip.Address +func (_e *MockAllTokensPriceGetter_Expecter) TokenPricesUSD(ctx interface{}, tokens interface{}) *MockAllTokensPriceGetter_TokenPricesUSD_Call { + return &MockAllTokensPriceGetter_TokenPricesUSD_Call{Call: _e.mock.On("TokenPricesUSD", ctx, tokens)} +} + +func (_c *MockAllTokensPriceGetter_TokenPricesUSD_Call) Run(run func(ctx context.Context, tokens []ccip.Address)) *MockAllTokensPriceGetter_TokenPricesUSD_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].([]ccip.Address)) + }) + return _c +} + +func (_c *MockAllTokensPriceGetter_TokenPricesUSD_Call) Return(_a0 map[ccip.Address]*big.Int, _a1 error) *MockAllTokensPriceGetter_TokenPricesUSD_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockAllTokensPriceGetter_TokenPricesUSD_Call) RunAndReturn(run func(context.Context, []ccip.Address) (map[ccip.Address]*big.Int, error)) *MockAllTokensPriceGetter_TokenPricesUSD_Call { + _c.Call.Return(run) + return _c +} + +// NewMockAllTokensPriceGetter creates a new instance of MockAllTokensPriceGetter. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewMockAllTokensPriceGetter(t interface { + mock.TestingT + Cleanup(func()) +}) *MockAllTokensPriceGetter { + mock := &MockAllTokensPriceGetter{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/core/services/ocr2/plugins/ccip/internal/pricegetter/evm.go b/core/services/ocr2/plugins/ccip/internal/pricegetter/evm.go new file mode 100644 index 00000000000..ac4002f53fb --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/pricegetter/evm.go @@ -0,0 +1,256 @@ +package pricegetter + +import ( + "context" + "encoding/json" + "fmt" + "math/big" + "strings" + + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/rpclib" + + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/common" + + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + + "github.com/smartcontractkit/chainlink/v2/core/internal/gethwrappers2/generated/offchainaggregator" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/config" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipcalc" +) + +const decimalsMethodName = "decimals" +const latestRoundDataMethodName = "latestRoundData" + +func init() { + // Ensure existence of latestRoundData method on the Aggregator contract. + aggregatorABI, err := abi.JSON(strings.NewReader(offchainaggregator.OffchainAggregatorABI)) + if err != nil { + panic(err) + } + ensureMethodOnContract(aggregatorABI, decimalsMethodName) + ensureMethodOnContract(aggregatorABI, latestRoundDataMethodName) +} + +func ensureMethodOnContract(abi abi.ABI, methodName string) { + if _, ok := abi.Methods[methodName]; !ok { + panic(fmt.Errorf("method %s not found on ABI: %+v", methodName, abi.Methods)) + } +} + +type DynamicPriceGetterClient struct { + BatchCaller rpclib.EvmBatchCaller +} + +func NewDynamicPriceGetterClient(batchCaller rpclib.EvmBatchCaller) DynamicPriceGetterClient { + return DynamicPriceGetterClient{ + BatchCaller: batchCaller, + } +} + +type DynamicPriceGetter struct { + cfg config.DynamicPriceGetterConfig + evmClients map[uint64]DynamicPriceGetterClient + aggregatorAbi abi.ABI +} + +func NewDynamicPriceGetterConfig(configJson string) (config.DynamicPriceGetterConfig, error) { + priceGetterConfig := config.DynamicPriceGetterConfig{} + err := json.Unmarshal([]byte(configJson), &priceGetterConfig) + if err != nil { + return config.DynamicPriceGetterConfig{}, fmt.Errorf("parsing dynamic price getter config: %w", err) + } + err = priceGetterConfig.Validate() + if err != nil { + return config.DynamicPriceGetterConfig{}, fmt.Errorf("validating price getter config: %w", err) + } + return priceGetterConfig, nil +} + +// NewDynamicPriceGetter build a DynamicPriceGetter from a configuration and a map of chain ID to batch callers. +// A batch caller should be provided for all retrieved prices. +func NewDynamicPriceGetter(cfg config.DynamicPriceGetterConfig, evmClients map[uint64]DynamicPriceGetterClient) (*DynamicPriceGetter, error) { + if err := cfg.Validate(); err != nil { + return nil, fmt.Errorf("validating dynamic price getter config: %w", err) + } + aggregatorAbi, err := abi.JSON(strings.NewReader(offchainaggregator.OffchainAggregatorABI)) + if err != nil { + return nil, fmt.Errorf("parsing offchainaggregator abi: %w", err) + } + priceGetter := DynamicPriceGetter{cfg, evmClients, aggregatorAbi} + return &priceGetter, nil +} + +// FilterConfiguredTokens implements the PriceGetter interface. +// It filters a list of token addresses for only those that have a price resolution rule configured on the PriceGetterConfig +func (d *DynamicPriceGetter) FilterConfiguredTokens(ctx context.Context, tokens []cciptypes.Address) (configured []cciptypes.Address, unconfigured []cciptypes.Address, err error) { + configured = []cciptypes.Address{} + unconfigured = []cciptypes.Address{} + for _, tk := range tokens { + evmAddr, err := ccipcalc.GenericAddrToEvm(tk) + if err != nil { + return nil, nil, err + } + + if _, isAgg := d.cfg.AggregatorPrices[evmAddr]; isAgg { + configured = append(configured, tk) + } else if _, isStatic := d.cfg.StaticPrices[evmAddr]; isStatic { + configured = append(configured, tk) + } else { + unconfigured = append(unconfigured, tk) + } + } + return configured, unconfigured, nil +} + +// It returns the prices of all tokens defined in the price getter. +func (d *DynamicPriceGetter) GetJobSpecTokenPricesUSD(ctx context.Context) (map[cciptypes.Address]*big.Int, error) { + return d.TokenPricesUSD(ctx, d.getAllTokensDefined()) +} + +// TokenPricesUSD implements the PriceGetter interface. +// It returns static prices stored in the price getter, and batch calls aggregators (one per chain) to retrieve aggregator-based prices. +func (d *DynamicPriceGetter) TokenPricesUSD(ctx context.Context, tokens []cciptypes.Address) (map[cciptypes.Address]*big.Int, error) { + prices, batchCallsPerChain, err := d.preparePricesAndBatchCallsPerChain(tokens) + if err != nil { + return nil, err + } + if err = d.performBatchCalls(ctx, batchCallsPerChain, prices); err != nil { + return nil, err + } + return prices, nil +} + +func (d *DynamicPriceGetter) getAllTokensDefined() []cciptypes.Address { + tokens := make([]cciptypes.Address, 0) + + for addr := range d.cfg.AggregatorPrices { + tokens = append(tokens, ccipcalc.EvmAddrToGeneric(addr)) + } + for addr := range d.cfg.StaticPrices { + tokens = append(tokens, ccipcalc.EvmAddrToGeneric(addr)) + } + return tokens +} + +// performBatchCalls performs batch calls on all chains to retrieve token prices. +func (d *DynamicPriceGetter) performBatchCalls(ctx context.Context, batchCallsPerChain map[uint64]*batchCallsForChain, prices map[cciptypes.Address]*big.Int) error { + for chainID, batchCalls := range batchCallsPerChain { + if err := d.performBatchCall(ctx, chainID, batchCalls, prices); err != nil { + return err + } + } + return nil +} + +// performBatchCall performs a batch call on a given chain to retrieve token prices. +func (d *DynamicPriceGetter) performBatchCall(ctx context.Context, chainID uint64, batchCalls *batchCallsForChain, prices map[cciptypes.Address]*big.Int) error { + // Retrieve the EVM caller for the chain. + client, exists := d.evmClients[chainID] + if !exists { + return fmt.Errorf("evm caller for chain %d not found", chainID) + } + evmCaller := client.BatchCaller + + nbDecimalCalls := len(batchCalls.decimalCalls) + nbLatestRoundDataCalls := len(batchCalls.decimalCalls) + + // Perform batched call (all decimals calls followed by latest round data calls). + calls := make([]rpclib.EvmCall, 0, nbDecimalCalls+nbLatestRoundDataCalls) + calls = append(calls, batchCalls.decimalCalls...) + calls = append(calls, batchCalls.latestRoundDataCalls...) + + results, err := evmCaller.BatchCall(ctx, 0, calls) + if err != nil { + return fmt.Errorf("batch call on chain %d failed: %w", chainID, err) + } + + // Extract results. + decimals := make([]uint8, 0, nbDecimalCalls) + latestRounds := make([]*big.Int, 0, nbLatestRoundDataCalls) + + for i, res := range results[0:nbDecimalCalls] { + v, err1 := rpclib.ParseOutput[uint8](res, 0) + if err1 != nil { + callSignature := batchCalls.decimalCalls[i].String() + return fmt.Errorf("parse contract output while calling %v on chain %d: %w", callSignature, chainID, err1) + } + decimals = append(decimals, v) + } + + for i, res := range results[nbDecimalCalls : nbDecimalCalls+nbLatestRoundDataCalls] { + // latestRoundData function has multiple outputs (roundId,answer,startedAt,updatedAt,answeredInRound). + // we want the second one (answer, at idx=1). + v, err1 := rpclib.ParseOutput[*big.Int](res, 1) + if err1 != nil { + callSignature := batchCalls.latestRoundDataCalls[i].String() + return fmt.Errorf("parse contract output while calling %v on chain %d: %w", callSignature, chainID, err1) + } + latestRounds = append(latestRounds, v) + } + + // Normalize and store prices. + for i := range batchCalls.tokenOrder { + // Normalize to 1e18. + if decimals[i] < 18 { + latestRounds[i].Mul(latestRounds[i], big.NewInt(0).Exp(big.NewInt(10), big.NewInt(18-int64(decimals[i])), nil)) + } else if decimals[i] > 18 { + latestRounds[i].Div(latestRounds[i], big.NewInt(0).Exp(big.NewInt(10), big.NewInt(int64(decimals[i])-18), nil)) + } + prices[ccipcalc.EvmAddrToGeneric(batchCalls.tokenOrder[i])] = latestRounds[i] + } + return nil +} + +// preparePricesAndBatchCallsPerChain uses this price getter to prepare for a list of tokens: +// - the map of token address to their prices (static prices) +// - the map of and batch calls per chain for the given tokens (dynamic prices) +func (d *DynamicPriceGetter) preparePricesAndBatchCallsPerChain(tokens []cciptypes.Address) (map[cciptypes.Address]*big.Int, map[uint64]*batchCallsForChain, error) { + prices := make(map[cciptypes.Address]*big.Int, len(tokens)) + batchCallsPerChain := make(map[uint64]*batchCallsForChain) + evmAddrs, err := ccipcalc.GenericAddrsToEvm(tokens...) + if err != nil { + return nil, nil, err + } + for _, tk := range evmAddrs { + if aggCfg, isAgg := d.cfg.AggregatorPrices[tk]; isAgg { + // Batch calls for aggregator-based token prices (one per chain). + if _, exists := batchCallsPerChain[aggCfg.ChainID]; !exists { + batchCallsPerChain[aggCfg.ChainID] = &batchCallsForChain{ + decimalCalls: []rpclib.EvmCall{}, + latestRoundDataCalls: []rpclib.EvmCall{}, + tokenOrder: []common.Address{}, + } + } + chainCalls := batchCallsPerChain[aggCfg.ChainID] + chainCalls.decimalCalls = append(chainCalls.decimalCalls, rpclib.NewEvmCall( + d.aggregatorAbi, + decimalsMethodName, + aggCfg.AggregatorContractAddress, + )) + chainCalls.latestRoundDataCalls = append(chainCalls.latestRoundDataCalls, rpclib.NewEvmCall( + d.aggregatorAbi, + latestRoundDataMethodName, + aggCfg.AggregatorContractAddress, + )) + chainCalls.tokenOrder = append(chainCalls.tokenOrder, tk) + } else if staticCfg, isStatic := d.cfg.StaticPrices[tk]; isStatic { + // Fill static prices. + prices[ccipcalc.EvmAddrToGeneric(tk)] = staticCfg.Price + } else { + return nil, nil, fmt.Errorf("no price resolution rule for token %s", tk.Hex()) + } + } + return prices, batchCallsPerChain, nil +} + +// batchCallsForChain Defines the batch calls to perform on a given chain. +type batchCallsForChain struct { + decimalCalls []rpclib.EvmCall + latestRoundDataCalls []rpclib.EvmCall + tokenOrder []common.Address // required to maintain the order of the batched rpc calls for mapping the results. +} + +func (d *DynamicPriceGetter) Close() error { + return nil +} diff --git a/core/services/ocr2/plugins/ccip/internal/pricegetter/evm_test.go b/core/services/ocr2/plugins/ccip/internal/pricegetter/evm_test.go new file mode 100644 index 00000000000..78de2699688 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/pricegetter/evm_test.go @@ -0,0 +1,772 @@ +package pricegetter + +import ( + "math/big" + "testing" + + "github.com/ethereum/go-ethereum/common" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + "github.com/stretchr/testify/require" + + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/aggregator_v3_interface" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/config" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipcalc" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/rpclib" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/rpclib/rpclibmocks" +) + +type testParameters struct { + cfg config.DynamicPriceGetterConfig + evmClients map[uint64]DynamicPriceGetterClient + tokens []common.Address + expectedTokenPrices map[common.Address]big.Int + expectedTokenPricesForAll map[common.Address]big.Int + evmCallErr bool + invalidConfigErrorExpected bool + priceResolutionErrorExpected bool +} + +var ( + TK1 common.Address + TK2 common.Address + TK3 common.Address + TK4 common.Address +) + +func init() { + TK1 = utils.RandomAddress() + TK2 = utils.RandomAddress() + TK3 = utils.RandomAddress() + TK4 = utils.RandomAddress() +} + +func TestDynamicPriceGetterWithEmptyInput(t *testing.T) { + tests := []struct { + name string + param testParameters + }{ + { + name: "aggregator_only_valid", + param: testParamAggregatorOnly(t), + }, + { + name: "aggregator_only_valid_multi", + param: testParamAggregatorOnlyMulti(t), + }, + { + name: "static_only_valid", + param: testParamStaticOnly(), + }, + { + name: "aggregator_and_static_valid", + param: testParamAggregatorAndStaticValid(t), + }, + { + name: "aggregator_and_static_token_collision", + param: testParamAggregatorAndStaticTokenCollision(t), + }, + { + name: "no_aggregator_for_token", + param: testParamNoAggregatorForToken(t), + }, + { + name: "batchCall_returns_err", + param: testParamBatchCallReturnsErr(t), + }, + { + name: "less_inputs_than_defined_prices", + param: testLessInputsThanDefinedPrices(t), + }, + { + name: "get_all_tokens_aggregator_and_static", + param: testGetAllTokensAggregatorAndStatic(t), + }, + { + name: "get_all_tokens_aggregator_only", + param: testGetAllTokensAggregatorOnly(t), + }, + { + name: "get_all_tokens_static_only", + param: testGetAllTokensStaticOnly(), + }, + } + + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + pg, err := NewDynamicPriceGetter(test.param.cfg, test.param.evmClients) + if test.param.invalidConfigErrorExpected { + require.Error(t, err) + return + } + require.NoError(t, err) + ctx := testutils.Context(t) + + var prices map[cciptypes.Address]*big.Int + var expectedTokens map[common.Address]big.Int + if len(test.param.expectedTokenPricesForAll) == 0 { + prices, err = pg.TokenPricesUSD(ctx, ccipcalc.EvmAddrsToGeneric(test.param.tokens...)) + if test.param.evmCallErr { + require.Error(t, err) + return + } + + if test.param.priceResolutionErrorExpected { + require.Error(t, err) + return + } + expectedTokens = test.param.expectedTokenPrices + } else { + prices, err = pg.GetJobSpecTokenPricesUSD(ctx) + expectedTokens = test.param.expectedTokenPricesForAll + } + + require.NoError(t, err) + // Ensure all expected prices are present. + assert.True(t, len(prices) == len(expectedTokens)) + // Check prices are matching expected result. + for tk, expectedPrice := range expectedTokens { + if prices[cciptypes.Address(tk.String())] == nil { + assert.Fail(t, "Token price not found") + } + assert.Equal(t, 0, expectedPrice.Cmp(prices[cciptypes.Address(tk.String())]), + "Token price mismatch: expected price %v, got %v", expectedPrice, *prices[cciptypes.Address(tk.String())]) + } + }) + } +} + +func testParamAggregatorOnly(t *testing.T) testParameters { + cfg := config.DynamicPriceGetterConfig{ + AggregatorPrices: map[common.Address]config.AggregatorPriceConfig{ + TK1: { + ChainID: 101, + AggregatorContractAddress: utils.RandomAddress(), + }, + TK2: { + ChainID: 102, + AggregatorContractAddress: utils.RandomAddress(), + }, + TK3: { + ChainID: 103, + AggregatorContractAddress: utils.RandomAddress(), + }, + TK4: { + ChainID: 104, + AggregatorContractAddress: utils.RandomAddress(), + }, + }, + StaticPrices: map[common.Address]config.StaticPriceConfig{}, + } + // Real LINK/USD example from OP. + round1 := aggregator_v3_interface.LatestRoundData{ + RoundId: big.NewInt(1000), + Answer: big.NewInt(1396818990), + StartedAt: big.NewInt(1704896575), + UpdatedAt: big.NewInt(1704896575), + AnsweredInRound: big.NewInt(1000), + } + // Real ETH/USD example from OP. + round2 := aggregator_v3_interface.LatestRoundData{ + RoundId: big.NewInt(2000), + Answer: big.NewInt(238879815123), + StartedAt: big.NewInt(1704897197), + UpdatedAt: big.NewInt(1704897197), + AnsweredInRound: big.NewInt(2000), + } + // Real LINK/ETH example from OP. + round3 := aggregator_v3_interface.LatestRoundData{ + RoundId: big.NewInt(3000), + Answer: big.NewInt(4468862777874802), + StartedAt: big.NewInt(1715743907), + UpdatedAt: big.NewInt(1715743907), + AnsweredInRound: big.NewInt(3000), + } + // Fake data for a token with more than 18 decimals. + round4 := aggregator_v3_interface.LatestRoundData{ + RoundId: big.NewInt(4000), + Answer: multExp(big.NewInt(1234567890), 10), // 20 digits. + StartedAt: big.NewInt(1715753907), + UpdatedAt: big.NewInt(1715753907), + AnsweredInRound: big.NewInt(4000), + } + evmClients := map[uint64]DynamicPriceGetterClient{ + uint64(101): mockClient(t, []uint8{8}, []aggregator_v3_interface.LatestRoundData{round1}), + uint64(102): mockClient(t, []uint8{8}, []aggregator_v3_interface.LatestRoundData{round2}), + uint64(103): mockClient(t, []uint8{18}, []aggregator_v3_interface.LatestRoundData{round3}), + uint64(104): mockClient(t, []uint8{20}, []aggregator_v3_interface.LatestRoundData{round4}), + } + expectedTokenPrices := map[common.Address]big.Int{ + TK1: *multExp(round1.Answer, 10), // expected in 1e18 format. + TK2: *multExp(round2.Answer, 10), // expected in 1e18 format. + TK3: *round3.Answer, // already in 1e18 format (contract decimals==18). + TK4: *multExp(big.NewInt(1234567890), 8), // expected in 1e18 format. + } + return testParameters{ + cfg: cfg, + evmClients: evmClients, + tokens: []common.Address{TK1, TK2, TK3, TK4}, + expectedTokenPrices: expectedTokenPrices, + invalidConfigErrorExpected: false, + } +} + +// testParamAggregatorOnlyMulti test with several tokens on chain 102. +func testParamAggregatorOnlyMulti(t *testing.T) testParameters { + cfg := config.DynamicPriceGetterConfig{ + AggregatorPrices: map[common.Address]config.AggregatorPriceConfig{ + TK1: { + ChainID: 101, + AggregatorContractAddress: utils.RandomAddress(), + }, + TK2: { + ChainID: 102, + AggregatorContractAddress: utils.RandomAddress(), + }, + TK3: { + ChainID: 102, + AggregatorContractAddress: utils.RandomAddress(), + }, + }, + StaticPrices: map[common.Address]config.StaticPriceConfig{}, + } + // Real LINK/USD example from OP. + round1 := aggregator_v3_interface.LatestRoundData{ + RoundId: big.NewInt(1000), + Answer: big.NewInt(1396818990), + StartedAt: big.NewInt(1704896575), + UpdatedAt: big.NewInt(1704896575), + AnsweredInRound: big.NewInt(1000), + } + // Real ETH/USD example from OP. + round2 := aggregator_v3_interface.LatestRoundData{ + RoundId: big.NewInt(2000), + Answer: big.NewInt(238879815123), + StartedAt: big.NewInt(1704897197), + UpdatedAt: big.NewInt(1704897197), + AnsweredInRound: big.NewInt(2000), + } + round3 := aggregator_v3_interface.LatestRoundData{ + RoundId: big.NewInt(3000), + Answer: big.NewInt(238879815125), + StartedAt: big.NewInt(1704897198), + UpdatedAt: big.NewInt(1704897198), + AnsweredInRound: big.NewInt(3000), + } + evmClients := map[uint64]DynamicPriceGetterClient{ + uint64(101): mockClient(t, []uint8{8}, []aggregator_v3_interface.LatestRoundData{round1}), + uint64(102): mockClient(t, []uint8{8, 8}, []aggregator_v3_interface.LatestRoundData{round2, round3}), + } + expectedTokenPrices := map[common.Address]big.Int{ + TK1: *multExp(round1.Answer, 10), + TK2: *multExp(round2.Answer, 10), + TK3: *multExp(round3.Answer, 10), + } + return testParameters{ + cfg: cfg, + evmClients: evmClients, + invalidConfigErrorExpected: false, + tokens: []common.Address{TK1, TK2, TK3}, + expectedTokenPrices: expectedTokenPrices, + } +} + +func testParamStaticOnly() testParameters { + cfg := config.DynamicPriceGetterConfig{ + AggregatorPrices: map[common.Address]config.AggregatorPriceConfig{}, + StaticPrices: map[common.Address]config.StaticPriceConfig{ + TK1: { + ChainID: 101, + Price: big.NewInt(1_234_000), + }, + TK2: { + ChainID: 102, + Price: big.NewInt(2_234_000), + }, + TK3: { + ChainID: 103, + Price: big.NewInt(3_234_000), + }, + }, + } + // Real LINK/USD example from OP. + evmClients := map[uint64]DynamicPriceGetterClient{} + expectedTokenPrices := map[common.Address]big.Int{ + TK1: *cfg.StaticPrices[TK1].Price, + TK2: *cfg.StaticPrices[TK2].Price, + TK3: *cfg.StaticPrices[TK3].Price, + } + return testParameters{ + cfg: cfg, + evmClients: evmClients, + tokens: []common.Address{TK1, TK2, TK3}, + expectedTokenPrices: expectedTokenPrices, + } +} + +func testParamNoAggregatorForToken(t *testing.T) testParameters { + cfg := config.DynamicPriceGetterConfig{ + AggregatorPrices: map[common.Address]config.AggregatorPriceConfig{ + TK1: { + ChainID: 101, + AggregatorContractAddress: utils.RandomAddress(), + }, + TK2: { + ChainID: 102, + AggregatorContractAddress: utils.RandomAddress(), + }, + }, + StaticPrices: map[common.Address]config.StaticPriceConfig{ + TK3: { + ChainID: 103, + Price: big.NewInt(1_234_000), + }, + }, + } + // Real LINK/USD example from OP. + round1 := aggregator_v3_interface.LatestRoundData{ + RoundId: big.NewInt(1000), + Answer: big.NewInt(1396818990), + StartedAt: big.NewInt(1704896575), + UpdatedAt: big.NewInt(1704896575), + AnsweredInRound: big.NewInt(1000), + } + // Real ETH/USD example from OP. + round2 := aggregator_v3_interface.LatestRoundData{ + RoundId: big.NewInt(2000), + Answer: big.NewInt(238879815123), + StartedAt: big.NewInt(1704897197), + UpdatedAt: big.NewInt(1704897197), + AnsweredInRound: big.NewInt(2000), + } + evmClients := map[uint64]DynamicPriceGetterClient{ + uint64(101): mockClient(t, []uint8{8}, []aggregator_v3_interface.LatestRoundData{round1}), + uint64(102): mockClient(t, []uint8{8}, []aggregator_v3_interface.LatestRoundData{round2}), + } + expectedTokenPrices := map[common.Address]big.Int{ + TK1: *round1.Answer, + TK2: *round2.Answer, + TK3: *cfg.StaticPrices[TK3].Price, + TK4: *big.NewInt(0), + } + return testParameters{ + cfg: cfg, + evmClients: evmClients, + tokens: []common.Address{TK1, TK2, TK3, TK4}, + expectedTokenPrices: expectedTokenPrices, + priceResolutionErrorExpected: true, + } +} + +func testParamAggregatorAndStaticValid(t *testing.T) testParameters { + cfg := config.DynamicPriceGetterConfig{ + AggregatorPrices: map[common.Address]config.AggregatorPriceConfig{ + TK1: { + ChainID: 101, + AggregatorContractAddress: utils.RandomAddress(), + }, + TK2: { + ChainID: 102, + AggregatorContractAddress: utils.RandomAddress(), + }, + }, + StaticPrices: map[common.Address]config.StaticPriceConfig{ + TK3: { + ChainID: 103, + Price: big.NewInt(1_234_000), + }, + }, + } + // Real LINK/USD example from OP. + round1 := aggregator_v3_interface.LatestRoundData{ + RoundId: big.NewInt(1000), + Answer: big.NewInt(1396818990), + StartedAt: big.NewInt(1704896575), + UpdatedAt: big.NewInt(1704896575), + AnsweredInRound: big.NewInt(1000), + } + // Real ETH/USD example from OP. + round2 := aggregator_v3_interface.LatestRoundData{ + RoundId: big.NewInt(2000), + Answer: big.NewInt(238879815123), + StartedAt: big.NewInt(1704897197), + UpdatedAt: big.NewInt(1704897197), + AnsweredInRound: big.NewInt(2000), + } + evmClients := map[uint64]DynamicPriceGetterClient{ + uint64(101): mockClient(t, []uint8{8}, []aggregator_v3_interface.LatestRoundData{round1}), + uint64(102): mockClient(t, []uint8{8}, []aggregator_v3_interface.LatestRoundData{round2}), + } + expectedTokenPrices := map[common.Address]big.Int{ + TK1: *multExp(round1.Answer, 10), + TK2: *multExp(round2.Answer, 10), + TK3: *cfg.StaticPrices[TK3].Price, + } + return testParameters{ + cfg: cfg, + evmClients: evmClients, + tokens: []common.Address{TK1, TK2, TK3}, + expectedTokenPrices: expectedTokenPrices, + } +} + +func testParamAggregatorAndStaticTokenCollision(t *testing.T) testParameters { + cfg := config.DynamicPriceGetterConfig{ + AggregatorPrices: map[common.Address]config.AggregatorPriceConfig{ + TK1: { + ChainID: 101, + AggregatorContractAddress: utils.RandomAddress(), + }, + TK2: { + ChainID: 102, + AggregatorContractAddress: utils.RandomAddress(), + }, + TK3: { + ChainID: 103, + AggregatorContractAddress: utils.RandomAddress(), + }, + }, + StaticPrices: map[common.Address]config.StaticPriceConfig{ + TK3: { + ChainID: 103, + Price: big.NewInt(1_234_000), + }, + }, + } + // Real LINK/USD example from OP. + round1 := aggregator_v3_interface.LatestRoundData{ + RoundId: big.NewInt(1000), + Answer: big.NewInt(1396818990), + StartedAt: big.NewInt(1704896575), + UpdatedAt: big.NewInt(1704896575), + AnsweredInRound: big.NewInt(1000), + } + // Real ETH/USD example from OP. + round2 := aggregator_v3_interface.LatestRoundData{ + RoundId: big.NewInt(2000), + Answer: big.NewInt(238879815123), + StartedAt: big.NewInt(1704897197), + UpdatedAt: big.NewInt(1704897197), + AnsweredInRound: big.NewInt(2000), + } + round3 := aggregator_v3_interface.LatestRoundData{ + RoundId: big.NewInt(3000), + Answer: big.NewInt(238879815124), + StartedAt: big.NewInt(1704897198), + UpdatedAt: big.NewInt(1704897198), + AnsweredInRound: big.NewInt(3000), + } + evmClients := map[uint64]DynamicPriceGetterClient{ + uint64(101): mockClient(t, []uint8{8}, []aggregator_v3_interface.LatestRoundData{round1}), + uint64(102): mockClient(t, []uint8{8}, []aggregator_v3_interface.LatestRoundData{round2}), + uint64(103): mockClient(t, []uint8{8}, []aggregator_v3_interface.LatestRoundData{round3}), + } + return testParameters{ + cfg: cfg, + evmClients: evmClients, + tokens: []common.Address{TK1, TK2, TK3}, + invalidConfigErrorExpected: true, + } +} + +func testParamBatchCallReturnsErr(t *testing.T) testParameters { + cfg := config.DynamicPriceGetterConfig{ + AggregatorPrices: map[common.Address]config.AggregatorPriceConfig{ + TK1: { + ChainID: 101, + AggregatorContractAddress: utils.RandomAddress(), + }, + TK2: { + ChainID: 102, + AggregatorContractAddress: utils.RandomAddress(), + }, + }, + StaticPrices: map[common.Address]config.StaticPriceConfig{ + TK3: { + ChainID: 103, + Price: big.NewInt(1_234_000), + }, + }, + } + // Real LINK/USD example from OP. + round1 := aggregator_v3_interface.LatestRoundData{ + RoundId: big.NewInt(1000), + Answer: big.NewInt(1396818990), + StartedAt: big.NewInt(1704896575), + UpdatedAt: big.NewInt(1704896575), + AnsweredInRound: big.NewInt(1000), + } + evmClients := map[uint64]DynamicPriceGetterClient{ + uint64(101): mockClient(t, []uint8{8}, []aggregator_v3_interface.LatestRoundData{round1}), + uint64(102): { + BatchCaller: mockErrCaller(t), + }, + } + return testParameters{ + cfg: cfg, + evmClients: evmClients, + tokens: []common.Address{TK1, TK2, TK3}, + evmCallErr: true, + } +} + +func testLessInputsThanDefinedPrices(t *testing.T) testParameters { + cfg := config.DynamicPriceGetterConfig{ + AggregatorPrices: map[common.Address]config.AggregatorPriceConfig{ + TK1: { + ChainID: 101, + AggregatorContractAddress: utils.RandomAddress(), + }, + TK2: { + ChainID: 102, + AggregatorContractAddress: utils.RandomAddress(), + }, + TK3: { + ChainID: 103, + AggregatorContractAddress: utils.RandomAddress(), + }, + }, + StaticPrices: map[common.Address]config.StaticPriceConfig{ + TK4: { + ChainID: 104, + Price: big.NewInt(1_234_000), + }, + }, + } + // Real LINK/USD example from OP. + round1 := aggregator_v3_interface.LatestRoundData{ + RoundId: big.NewInt(1000), + Answer: big.NewInt(3749350456), + StartedAt: big.NewInt(1704896575), + UpdatedAt: big.NewInt(1704896575), + AnsweredInRound: big.NewInt(1000), + } + // Real ETH/USD example from OP. + round2 := aggregator_v3_interface.LatestRoundData{ + RoundId: big.NewInt(2000), + Answer: big.NewInt(238879815123), + StartedAt: big.NewInt(1704897197), + UpdatedAt: big.NewInt(1704897197), + AnsweredInRound: big.NewInt(2000), + } + // Real LINK/ETH example from OP. + round3 := aggregator_v3_interface.LatestRoundData{ + RoundId: big.NewInt(3000), + Answer: big.NewInt(4468862777874802), + StartedAt: big.NewInt(1715743907), + UpdatedAt: big.NewInt(1715743907), + AnsweredInRound: big.NewInt(3000), + } + evmClients := map[uint64]DynamicPriceGetterClient{ + uint64(101): mockClient(t, []uint8{8}, []aggregator_v3_interface.LatestRoundData{round1}), + uint64(102): mockClient(t, []uint8{8}, []aggregator_v3_interface.LatestRoundData{round2}), + uint64(103): mockClient(t, []uint8{8}, []aggregator_v3_interface.LatestRoundData{round3}), + } + expectedTokenPrices := map[common.Address]big.Int{ + TK1: *multExp(round1.Answer, 10), + TK2: *multExp(round2.Answer, 10), + TK3: *multExp(round3.Answer, 10), + } + return testParameters{ + cfg: cfg, + evmClients: evmClients, + tokens: []common.Address{TK1, TK2, TK3}, + expectedTokenPrices: expectedTokenPrices, + } +} + +func testGetAllTokensAggregatorAndStatic(t *testing.T) testParameters { + cfg := config.DynamicPriceGetterConfig{ + AggregatorPrices: map[common.Address]config.AggregatorPriceConfig{ + TK1: { + ChainID: 101, + AggregatorContractAddress: utils.RandomAddress(), + }, + TK2: { + ChainID: 102, + AggregatorContractAddress: utils.RandomAddress(), + }, + TK3: { + ChainID: 103, + AggregatorContractAddress: utils.RandomAddress(), + }, + }, + StaticPrices: map[common.Address]config.StaticPriceConfig{ + TK4: { + ChainID: 104, + Price: big.NewInt(1_234_000), + }, + }, + } + // Real LINK/USD example from OP. + round1 := aggregator_v3_interface.LatestRoundData{ + RoundId: big.NewInt(1000), + Answer: big.NewInt(3749350456), + StartedAt: big.NewInt(1704896575), + UpdatedAt: big.NewInt(1704896575), + AnsweredInRound: big.NewInt(1000), + } + // Real ETH/USD example from OP. + round2 := aggregator_v3_interface.LatestRoundData{ + RoundId: big.NewInt(2000), + Answer: big.NewInt(238879815123), + StartedAt: big.NewInt(1704897197), + UpdatedAt: big.NewInt(1704897197), + AnsweredInRound: big.NewInt(2000), + } + // Real LINK/ETH example from OP. + round3 := aggregator_v3_interface.LatestRoundData{ + RoundId: big.NewInt(3000), + Answer: big.NewInt(4468862777874802), + StartedAt: big.NewInt(1715743907), + UpdatedAt: big.NewInt(1715743907), + AnsweredInRound: big.NewInt(3000), + } + evmClients := map[uint64]DynamicPriceGetterClient{ + uint64(101): mockClient(t, []uint8{8}, []aggregator_v3_interface.LatestRoundData{round1}), + uint64(102): mockClient(t, []uint8{8}, []aggregator_v3_interface.LatestRoundData{round2}), + uint64(103): mockClient(t, []uint8{8}, []aggregator_v3_interface.LatestRoundData{round3}), + } + expectedTokenPricesForAll := map[common.Address]big.Int{ + TK1: *multExp(round1.Answer, 10), + TK2: *multExp(round2.Answer, 10), + TK3: *multExp(round3.Answer, 10), + TK4: *cfg.StaticPrices[TK4].Price, + } + return testParameters{ + cfg: cfg, + evmClients: evmClients, + expectedTokenPricesForAll: expectedTokenPricesForAll, + } +} + +func testGetAllTokensAggregatorOnly(t *testing.T) testParameters { + cfg := config.DynamicPriceGetterConfig{ + AggregatorPrices: map[common.Address]config.AggregatorPriceConfig{ + TK1: { + ChainID: 101, + AggregatorContractAddress: utils.RandomAddress(), + }, + TK2: { + ChainID: 102, + AggregatorContractAddress: utils.RandomAddress(), + }, + TK3: { + ChainID: 103, + AggregatorContractAddress: utils.RandomAddress(), + }, + }, + StaticPrices: map[common.Address]config.StaticPriceConfig{}, + } + // Real LINK/USD example from OP. + round1 := aggregator_v3_interface.LatestRoundData{ + RoundId: big.NewInt(1000), + Answer: big.NewInt(3749350456), + StartedAt: big.NewInt(1704896575), + UpdatedAt: big.NewInt(1704896575), + AnsweredInRound: big.NewInt(1000), + } + // Real ETH/USD example from OP. + round2 := aggregator_v3_interface.LatestRoundData{ + RoundId: big.NewInt(2000), + Answer: big.NewInt(238879815123), + StartedAt: big.NewInt(1704897197), + UpdatedAt: big.NewInt(1704897197), + AnsweredInRound: big.NewInt(2000), + } + // Real LINK/ETH example from OP. + round3 := aggregator_v3_interface.LatestRoundData{ + RoundId: big.NewInt(3000), + Answer: big.NewInt(4468862777874802), + StartedAt: big.NewInt(1715743907), + UpdatedAt: big.NewInt(1715743907), + AnsweredInRound: big.NewInt(3000), + } + evmClients := map[uint64]DynamicPriceGetterClient{ + uint64(101): mockClient(t, []uint8{8}, []aggregator_v3_interface.LatestRoundData{round1}), + uint64(102): mockClient(t, []uint8{8}, []aggregator_v3_interface.LatestRoundData{round2}), + uint64(103): mockClient(t, []uint8{8}, []aggregator_v3_interface.LatestRoundData{round3}), + } + expectedTokenPricesForAll := map[common.Address]big.Int{ + TK1: *multExp(round1.Answer, 10), + TK2: *multExp(round2.Answer, 10), + TK3: *multExp(round3.Answer, 10), + } + return testParameters{ + cfg: cfg, + evmClients: evmClients, + expectedTokenPricesForAll: expectedTokenPricesForAll, + } +} + +func testGetAllTokensStaticOnly() testParameters { + cfg := config.DynamicPriceGetterConfig{ + AggregatorPrices: map[common.Address]config.AggregatorPriceConfig{}, + StaticPrices: map[common.Address]config.StaticPriceConfig{ + TK1: { + ChainID: 101, + Price: big.NewInt(1_234_000), + }, + TK2: { + ChainID: 102, + Price: big.NewInt(2_234_000), + }, + TK3: { + ChainID: 103, + Price: big.NewInt(3_234_000), + }, + }, + } + + evmClients := map[uint64]DynamicPriceGetterClient{} + expectedTokenPricesForAll := map[common.Address]big.Int{ + TK1: *cfg.StaticPrices[TK1].Price, + TK2: *cfg.StaticPrices[TK2].Price, + TK3: *cfg.StaticPrices[TK3].Price, + } + return testParameters{ + cfg: cfg, + evmClients: evmClients, + expectedTokenPricesForAll: expectedTokenPricesForAll, + } +} + +func mockClient(t *testing.T, decimals []uint8, rounds []aggregator_v3_interface.LatestRoundData) DynamicPriceGetterClient { + return DynamicPriceGetterClient{ + BatchCaller: mockCaller(t, decimals, rounds), + } +} + +func mockCaller(t *testing.T, decimals []uint8, rounds []aggregator_v3_interface.LatestRoundData) *rpclibmocks.EvmBatchCaller { + caller := rpclibmocks.NewEvmBatchCaller(t) + + // Mock batch calls per chain: all decimals calls then all latestRoundData calls. + dataAndErrs := make([]rpclib.DataAndErr, 0, len(decimals)+len(rounds)) + for _, d := range decimals { + dataAndErrs = append(dataAndErrs, rpclib.DataAndErr{ + Outputs: []any{d}, + }) + } + for _, round := range rounds { + dataAndErrs = append(dataAndErrs, rpclib.DataAndErr{ + Outputs: []any{round.RoundId, round.Answer, round.StartedAt, round.UpdatedAt, round.AnsweredInRound}, + }) + } + caller.On("BatchCall", mock.Anything, uint64(0), mock.Anything).Return(dataAndErrs, nil).Maybe() + return caller +} + +func mockErrCaller(t *testing.T) *rpclibmocks.EvmBatchCaller { + caller := rpclibmocks.NewEvmBatchCaller(t) + caller.On("BatchCall", mock.Anything, uint64(0), mock.Anything).Return(nil, assert.AnError).Maybe() + return caller +} + +// multExp returns the result of multiplying x by 10^e. +func multExp(x *big.Int, e int64) *big.Int { + return big.NewInt(0).Mul(x, big.NewInt(0).Exp(big.NewInt(10), big.NewInt(e), nil)) +} diff --git a/core/services/ocr2/plugins/ccip/internal/pricegetter/mock.go b/core/services/ocr2/plugins/ccip/internal/pricegetter/mock.go new file mode 100644 index 00000000000..195649685b2 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/pricegetter/mock.go @@ -0,0 +1,211 @@ +// Code generated by mockery v2.43.2. DO NOT EDIT. + +package pricegetter + +import ( + context "context" + big "math/big" + + ccip "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + + mock "github.com/stretchr/testify/mock" +) + +// MockPriceGetter is an autogenerated mock type for the PriceGetter type +type MockPriceGetter struct { + mock.Mock +} + +type MockPriceGetter_Expecter struct { + mock *mock.Mock +} + +func (_m *MockPriceGetter) EXPECT() *MockPriceGetter_Expecter { + return &MockPriceGetter_Expecter{mock: &_m.Mock} +} + +// Close provides a mock function with given fields: +func (_m *MockPriceGetter) Close() error { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Close") + } + + var r0 error + if rf, ok := ret.Get(0).(func() error); ok { + r0 = rf() + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockPriceGetter_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close' +type MockPriceGetter_Close_Call struct { + *mock.Call +} + +// Close is a helper method to define mock.On call +func (_e *MockPriceGetter_Expecter) Close() *MockPriceGetter_Close_Call { + return &MockPriceGetter_Close_Call{Call: _e.mock.On("Close")} +} + +func (_c *MockPriceGetter_Close_Call) Run(run func()) *MockPriceGetter_Close_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockPriceGetter_Close_Call) Return(_a0 error) *MockPriceGetter_Close_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockPriceGetter_Close_Call) RunAndReturn(run func() error) *MockPriceGetter_Close_Call { + _c.Call.Return(run) + return _c +} + +// FilterConfiguredTokens provides a mock function with given fields: ctx, tokens +func (_m *MockPriceGetter) FilterConfiguredTokens(ctx context.Context, tokens []ccip.Address) ([]ccip.Address, []ccip.Address, error) { + ret := _m.Called(ctx, tokens) + + if len(ret) == 0 { + panic("no return value specified for FilterConfiguredTokens") + } + + var r0 []ccip.Address + var r1 []ccip.Address + var r2 error + if rf, ok := ret.Get(0).(func(context.Context, []ccip.Address) ([]ccip.Address, []ccip.Address, error)); ok { + return rf(ctx, tokens) + } + if rf, ok := ret.Get(0).(func(context.Context, []ccip.Address) []ccip.Address); ok { + r0 = rf(ctx, tokens) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]ccip.Address) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, []ccip.Address) []ccip.Address); ok { + r1 = rf(ctx, tokens) + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).([]ccip.Address) + } + } + + if rf, ok := ret.Get(2).(func(context.Context, []ccip.Address) error); ok { + r2 = rf(ctx, tokens) + } else { + r2 = ret.Error(2) + } + + return r0, r1, r2 +} + +// MockPriceGetter_FilterConfiguredTokens_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterConfiguredTokens' +type MockPriceGetter_FilterConfiguredTokens_Call struct { + *mock.Call +} + +// FilterConfiguredTokens is a helper method to define mock.On call +// - ctx context.Context +// - tokens []ccip.Address +func (_e *MockPriceGetter_Expecter) FilterConfiguredTokens(ctx interface{}, tokens interface{}) *MockPriceGetter_FilterConfiguredTokens_Call { + return &MockPriceGetter_FilterConfiguredTokens_Call{Call: _e.mock.On("FilterConfiguredTokens", ctx, tokens)} +} + +func (_c *MockPriceGetter_FilterConfiguredTokens_Call) Run(run func(ctx context.Context, tokens []ccip.Address)) *MockPriceGetter_FilterConfiguredTokens_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].([]ccip.Address)) + }) + return _c +} + +func (_c *MockPriceGetter_FilterConfiguredTokens_Call) Return(configured []ccip.Address, unconfigured []ccip.Address, err error) *MockPriceGetter_FilterConfiguredTokens_Call { + _c.Call.Return(configured, unconfigured, err) + return _c +} + +func (_c *MockPriceGetter_FilterConfiguredTokens_Call) RunAndReturn(run func(context.Context, []ccip.Address) ([]ccip.Address, []ccip.Address, error)) *MockPriceGetter_FilterConfiguredTokens_Call { + _c.Call.Return(run) + return _c +} + +// TokenPricesUSD provides a mock function with given fields: ctx, tokens +func (_m *MockPriceGetter) TokenPricesUSD(ctx context.Context, tokens []ccip.Address) (map[ccip.Address]*big.Int, error) { + ret := _m.Called(ctx, tokens) + + if len(ret) == 0 { + panic("no return value specified for TokenPricesUSD") + } + + var r0 map[ccip.Address]*big.Int + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, []ccip.Address) (map[ccip.Address]*big.Int, error)); ok { + return rf(ctx, tokens) + } + if rf, ok := ret.Get(0).(func(context.Context, []ccip.Address) map[ccip.Address]*big.Int); ok { + r0 = rf(ctx, tokens) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(map[ccip.Address]*big.Int) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, []ccip.Address) error); ok { + r1 = rf(ctx, tokens) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockPriceGetter_TokenPricesUSD_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TokenPricesUSD' +type MockPriceGetter_TokenPricesUSD_Call struct { + *mock.Call +} + +// TokenPricesUSD is a helper method to define mock.On call +// - ctx context.Context +// - tokens []ccip.Address +func (_e *MockPriceGetter_Expecter) TokenPricesUSD(ctx interface{}, tokens interface{}) *MockPriceGetter_TokenPricesUSD_Call { + return &MockPriceGetter_TokenPricesUSD_Call{Call: _e.mock.On("TokenPricesUSD", ctx, tokens)} +} + +func (_c *MockPriceGetter_TokenPricesUSD_Call) Run(run func(ctx context.Context, tokens []ccip.Address)) *MockPriceGetter_TokenPricesUSD_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].([]ccip.Address)) + }) + return _c +} + +func (_c *MockPriceGetter_TokenPricesUSD_Call) Return(_a0 map[ccip.Address]*big.Int, _a1 error) *MockPriceGetter_TokenPricesUSD_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockPriceGetter_TokenPricesUSD_Call) RunAndReturn(run func(context.Context, []ccip.Address) (map[ccip.Address]*big.Int, error)) *MockPriceGetter_TokenPricesUSD_Call { + _c.Call.Return(run) + return _c +} + +// NewMockPriceGetter creates a new instance of MockPriceGetter. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewMockPriceGetter(t interface { + mock.TestingT + Cleanup(func()) +}) *MockPriceGetter { + mock := &MockPriceGetter{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/core/services/ocr2/plugins/ccip/internal/pricegetter/pipeline.go b/core/services/ocr2/plugins/ccip/internal/pricegetter/pipeline.go new file mode 100644 index 00000000000..34977eda9f1 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/pricegetter/pipeline.go @@ -0,0 +1,142 @@ +package pricegetter + +import ( + "context" + "math/big" + "strings" + "time" + + mapset "github.com/deckarep/golang-set/v2" + "github.com/google/uuid" + "github.com/pkg/errors" + + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + "github.com/smartcontractkit/chainlink/v2/core/logger" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipcalc" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/parseutil" + "github.com/smartcontractkit/chainlink/v2/core/services/pipeline" +) + +var _ PriceGetter = &PipelineGetter{} + +type PipelineGetter struct { + source string + runner pipeline.Runner + jobID int32 + externalJobID uuid.UUID + name string + lggr logger.Logger +} + +func NewPipelineGetter(source string, runner pipeline.Runner, jobID int32, externalJobID uuid.UUID, name string, lggr logger.Logger) (*PipelineGetter, error) { + _, err := pipeline.Parse(source) + if err != nil { + return nil, err + } + + return &PipelineGetter{ + source: source, + runner: runner, + jobID: jobID, + externalJobID: externalJobID, + name: name, + lggr: lggr, + }, nil +} + +// FilterForConfiguredTokens implements the PriceGetter interface. +// It filters a list of token addresses for only those that have a pipeline job configured on the TokenPricesUSDPipeline +func (d *PipelineGetter) FilterConfiguredTokens(ctx context.Context, tokens []cciptypes.Address) (configured []cciptypes.Address, unconfigured []cciptypes.Address, err error) { + lcSource := strings.ToLower(d.source) + for _, tk := range tokens { + lcToken := strings.ToLower(string(tk)) + if strings.Contains(lcSource, lcToken) { + configured = append(configured, tk) + } else { + unconfigured = append(unconfigured, tk) + } + } + return configured, unconfigured, nil +} + +func (d *PipelineGetter) GetJobSpecTokenPricesUSD(ctx context.Context) (map[cciptypes.Address]*big.Int, error) { + prices, err := d.getPricesFromRunner(ctx) + if err != nil { + return nil, err + } + + tokenPrices := make(map[cciptypes.Address]*big.Int) + for tokenAddressStr, rawPrice := range prices { + tokenAddressStr := ccipcalc.HexToAddress(tokenAddressStr) + castedPrice, err := parseutil.ParseBigIntFromAny(rawPrice) + if err != nil { + return nil, err + } + + tokenPrices[tokenAddressStr] = castedPrice + } + + return tokenPrices, nil +} + +func (d *PipelineGetter) TokenPricesUSD(ctx context.Context, tokens []cciptypes.Address) (map[cciptypes.Address]*big.Int, error) { + prices, err := d.getPricesFromRunner(ctx) + if err != nil { + return nil, err + } + + providedTokensSet := mapset.NewSet(tokens...) + tokenPrices := make(map[cciptypes.Address]*big.Int) + for tokenAddressStr, rawPrice := range prices { + tokenAddressStr := ccipcalc.HexToAddress(tokenAddressStr) + castedPrice, err := parseutil.ParseBigIntFromAny(rawPrice) + if err != nil { + return nil, err + } + + if providedTokensSet.Contains(tokenAddressStr) { + tokenPrices[tokenAddressStr] = castedPrice + } + } + + // The mapping of token address to source of token price has to live offchain. + // Best we can do is sanity check that the token price spec covers all our desired execution token prices. + for _, token := range tokens { + if _, ok := tokenPrices[token]; !ok { + return nil, errors.Errorf("missing token %s from tokensForFeeCoin spec, got %v", token, prices) + } + } + + return tokenPrices, nil +} + +func (d *PipelineGetter) getPricesFromRunner(ctx context.Context) (map[string]interface{}, error) { + _, trrs, err := d.runner.ExecuteRun(ctx, pipeline.Spec{ + ID: d.jobID, + DotDagSource: d.source, + CreatedAt: time.Now(), + JobID: d.jobID, + JobName: d.name, + JobType: "", + }, pipeline.NewVarsFrom(map[string]interface{}{})) + if err != nil { + return nil, err + } + finalResult := trrs.FinalResult() + if finalResult.HasErrors() { + return nil, errors.Errorf("error getting prices %v", finalResult.AllErrors) + } + if len(finalResult.Values) != 1 { + return nil, errors.Errorf("invalid number of price results, expected 1 got %v", len(finalResult.Values)) + } + prices, ok := finalResult.Values[0].(map[string]interface{}) + if !ok { + return nil, errors.Errorf("expected map output of price pipeline, got %T", finalResult.Values[0]) + } + + return prices, nil +} + +func (d *PipelineGetter) Close() error { + return d.runner.Close() +} diff --git a/core/services/ocr2/plugins/ccip/internal/pricegetter/pipeline_test.go b/core/services/ocr2/plugins/ccip/internal/pricegetter/pipeline_test.go new file mode 100644 index 00000000000..8aeeff96b57 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/pricegetter/pipeline_test.go @@ -0,0 +1,180 @@ +package pricegetter_test + +import ( + "context" + "fmt" + "math/big" + "net/http" + "net/http/httptest" + "strings" + "testing" + "time" + + "github.com/ethereum/go-ethereum/common" + "github.com/google/uuid" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + config2 "github.com/smartcontractkit/chainlink-common/pkg/config" + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + + "github.com/smartcontractkit/chainlink/v2/core/bridges" + "github.com/smartcontractkit/chainlink/v2/core/logger" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipcalc" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/pricegetter" + "github.com/smartcontractkit/chainlink/v2/core/services/pipeline" + + pipelinemocks "github.com/smartcontractkit/chainlink/v2/core/services/pipeline/mocks" + + config "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/configtest" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/pgtest" +) + +func TestDataSource(t *testing.T) { + linkEth := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) { + _, err := w.Write([]byte(`{"JuelsPerETH": "200000000000000000000"}`)) + require.NoError(t, err) + })) + defer linkEth.Close() + usdcEth := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) { + _, err := w.Write([]byte(`{"USDCWeiPerETH": "1000000000000000000000"}`)) // 1000 USDC / ETH + require.NoError(t, err) + })) + defer usdcEth.Close() + linkTokenAddress := ccipcalc.HexToAddress("0x1591690b8638f5fb2dbec82ac741805ac5da8b45dc5263f4875b0496fdce4e05") + usdcTokenAddress := ccipcalc.HexToAddress("0x1591690b8638f5fb2dbec82ac741805ac5da8b45dc5263f4875b0496fdce4e10") + source := fmt.Sprintf(` + // Price 1 + link [type=http method=GET url="%s"]; + link_parse [type=jsonparse path="JuelsPerETH"]; + link->link_parse; + // Price 2 + usdc [type=http method=GET url="%s"]; + usdc_parse [type=jsonparse path="USDCWeiPerETH"]; + usdc->usdc_parse; + merge [type=merge left="{}" right="{\"%s\":$(link_parse), \"%s\":$(usdc_parse)}"]; +`, linkEth.URL, usdcEth.URL, linkTokenAddress, usdcTokenAddress) + + priceGetter := newTestPipelineGetter(t, source) + + // Ask for all prices present in spec. + prices, err := priceGetter.GetJobSpecTokenPricesUSD(context.Background()) + require.NoError(t, err) + assert.Equal(t, prices, map[cciptypes.Address]*big.Int{ + linkTokenAddress: big.NewInt(0).Mul(big.NewInt(200), big.NewInt(1000000000000000000)), + usdcTokenAddress: big.NewInt(0).Mul(big.NewInt(1000), big.NewInt(1000000000000000000)), + }) + + // Specifically ask for all prices + pricesWithInput, errWithInput := priceGetter.TokenPricesUSD(context.Background(), []cciptypes.Address{ + linkTokenAddress, + usdcTokenAddress, + }) + require.NoError(t, errWithInput) + assert.Equal(t, pricesWithInput, map[cciptypes.Address]*big.Int{ + linkTokenAddress: big.NewInt(0).Mul(big.NewInt(200), big.NewInt(1000000000000000000)), + usdcTokenAddress: big.NewInt(0).Mul(big.NewInt(1000), big.NewInt(1000000000000000000)), + }) + + // Ask a non-existent price. + _, err = priceGetter.TokenPricesUSD(context.Background(), []cciptypes.Address{ + ccipcalc.HexToAddress("0x1591690b8638f5fb2dbec82ac741805ac5da8b45dc5263f4875b0496fdce4e11"), + }) + require.Error(t, err) + + // Ask only one price + prices, err = priceGetter.TokenPricesUSD(context.Background(), []cciptypes.Address{linkTokenAddress}) + require.NoError(t, err) + assert.Equal(t, prices, map[cciptypes.Address]*big.Int{ + linkTokenAddress: big.NewInt(0).Mul(big.NewInt(200), big.NewInt(1000000000000000000)), + }) +} + +func TestParsingDifferentFormats(t *testing.T) { + tests := []struct { + name string + inputValue string + expectedValue *big.Int + expectedError bool + }{ + { + name: "number as string", + inputValue: "\"200000000000000000000\"", + expectedValue: new(big.Int).Mul(big.NewInt(200), big.NewInt(1e18)), + }, + { + name: "number as big number", + inputValue: "500000000000000000000", + expectedValue: new(big.Int).Mul(big.NewInt(500), big.NewInt(1e18)), + }, + { + name: "number as int64", + inputValue: "150", + expectedValue: big.NewInt(150), + }, + { + name: "number in scientific notation", + inputValue: "3e22", + expectedValue: new(big.Int).Mul(big.NewInt(30000), big.NewInt(1e18)), + }, + { + name: "number as string in scientific notation returns error", + inputValue: "\"3e22\"", + expectedError: true, + }, + { + name: "invalid value should return error", + inputValue: "\"NaN\"", + expectedError: true, + }, + { + name: "null should return error", + inputValue: "null", + expectedError: true, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + token := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) { + _, err := fmt.Fprintf(w, `{"MyCoin": %s}`, tt.inputValue) + require.NoError(t, err) + })) + defer token.Close() + + address := common.HexToAddress("0x94025780a1aB58868D9B2dBBB775f44b32e8E6e5") + source := fmt.Sprintf(` + // Price 1 + coin [type=http method=GET url="%s"]; + coin_parse [type=jsonparse path="MyCoin"]; + coin->coin_parse; + merge [type=merge left="{}" right="{\"%s\":$(coin_parse)}"]; + `, token.URL, strings.ToLower(address.String())) + + prices, err := newTestPipelineGetter(t, source). + TokenPricesUSD(context.Background(), []cciptypes.Address{ccipcalc.EvmAddrToGeneric(address)}) + + if tt.expectedError { + require.Error(t, err) + } else { + require.NoError(t, err) + require.Equal(t, prices[ccipcalc.EvmAddrToGeneric(address)], tt.expectedValue) + } + }) + } +} + +func newTestPipelineGetter(t *testing.T, source string) *pricegetter.PipelineGetter { + lggr, _ := logger.NewLogger() + cfg := pipelinemocks.NewConfig(t) + cfg.On("MaxRunDuration").Return(time.Second) + cfg.On("DefaultHTTPTimeout").Return(*config2.MustNewDuration(time.Second)) + cfg.On("DefaultHTTPLimit").Return(int64(1024 * 10)) + cfg.On("VerboseLogging").Return(true) + db := pgtest.NewSqlxDB(t) + bridgeORM := bridges.NewORM(db) + runner := pipeline.NewRunner(pipeline.NewORM(db, lggr, config.NewTestGeneralConfig(t).JobPipeline().MaxSuccessfulRuns()), + bridgeORM, cfg, nil, nil, nil, nil, lggr, &http.Client{}, &http.Client{}) + ds, err := pricegetter.NewPipelineGetter(source, runner, 1, uuid.New(), "test", lggr) + require.NoError(t, err) + return ds +} diff --git a/core/services/ocr2/plugins/ccip/internal/pricegetter/pricegetter.go b/core/services/ocr2/plugins/ccip/internal/pricegetter/pricegetter.go new file mode 100644 index 00000000000..d4bcfc57b6e --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/pricegetter/pricegetter.go @@ -0,0 +1,18 @@ +package pricegetter + +import ( + "context" + "math/big" + + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" +) + +type PriceGetter interface { + cciptypes.PriceGetter +} + +type AllTokensPriceGetter interface { + PriceGetter + // GetJobSpecTokenPricesUSD returns all token prices defined in the jobspec. + GetJobSpecTokenPricesUSD(ctx context.Context) (map[cciptypes.Address]*big.Int, error) +} diff --git a/core/services/ocr2/plugins/ccip/internal/rpclib/evm.go b/core/services/ocr2/plugins/ccip/internal/rpclib/evm.go new file mode 100644 index 00000000000..6c4aabb4355 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/rpclib/evm.go @@ -0,0 +1,337 @@ +package rpclib + +import ( + "context" + "encoding/json" + "fmt" + "math/big" + "reflect" + + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/rpc" + "github.com/pkg/errors" + "golang.org/x/sync/errgroup" + + "github.com/smartcontractkit/chainlink-common/pkg/logger" +) + +var ErrEmptyOutput = errors.New("rpc call output is empty (make sure that the contract method exists and rpc is healthy)") + +type EvmBatchCaller interface { + // BatchCall executes all the provided EvmCall and returns the results in the same order + // of the calls. Pass blockNumber=0 to use the latest block. + BatchCall(ctx context.Context, blockNumber uint64, calls []EvmCall) ([]DataAndErr, error) +} + +type BatchSender interface { + BatchCallContext(ctx context.Context, calls []rpc.BatchElem) error +} + +const ( + // DefaultRpcBatchSizeLimit defines the maximum number of rpc requests to be included in a batch. + DefaultRpcBatchSizeLimit = 100 + + // DefaultRpcBatchBackOffMultiplier defines the rate of reducing the batch size limit for retried calls. + // For example if limit is 20 and multiplier is 4: + // 1. 20 + // 2. 20/4 = 5 + // 3. 5/4 = 1 + DefaultRpcBatchBackOffMultiplier = 5 + + // DefaultMaxParallelRpcCalls defines the default maximum number of individual in-parallel rpc calls. + DefaultMaxParallelRpcCalls = 10 +) + +// DynamicLimitedBatchCaller makes batched rpc calls and perform retries by reducing the batch size on each retry. +type DynamicLimitedBatchCaller struct { + bc *defaultEvmBatchCaller +} + +func NewDynamicLimitedBatchCaller( + lggr logger.Logger, batchSender BatchSender, batchSizeLimit, backOffMultiplier, parallelRpcCallsLimit uint, +) *DynamicLimitedBatchCaller { + return &DynamicLimitedBatchCaller{ + bc: newDefaultEvmBatchCaller(lggr, batchSender, batchSizeLimit, backOffMultiplier, parallelRpcCallsLimit), + } +} + +func (c *DynamicLimitedBatchCaller) BatchCall(ctx context.Context, blockNumber uint64, calls []EvmCall) ([]DataAndErr, error) { + return c.bc.batchCallDynamicLimitRetries(ctx, blockNumber, calls) +} + +type defaultEvmBatchCaller struct { + lggr logger.Logger + batchSender BatchSender + batchSizeLimit uint + parallelRpcCallsLimit uint + backOffMultiplier uint +} + +// NewDefaultEvmBatchCaller returns a new batch caller instance. +// batchCallLimit defines the maximum number of calls for BatchCallLimit method, pass 0 to keep the default. +// backOffMultiplier defines the back-off strategy for retries on BatchCallDynamicLimitRetries method, pass 0 to keep the default. +func newDefaultEvmBatchCaller( + lggr logger.Logger, batchSender BatchSender, batchSizeLimit, backOffMultiplier, parallelRpcCallsLimit uint, +) *defaultEvmBatchCaller { + batchSize := uint(DefaultRpcBatchSizeLimit) + if batchSizeLimit > 0 { + batchSize = batchSizeLimit + } + + multiplier := uint(DefaultRpcBatchBackOffMultiplier) + if backOffMultiplier > 0 { + multiplier = backOffMultiplier + } + + parallelRpcCalls := uint(DefaultMaxParallelRpcCalls) + if parallelRpcCallsLimit > 0 { + parallelRpcCalls = parallelRpcCallsLimit + } + + return &defaultEvmBatchCaller{ + lggr: lggr, + batchSender: batchSender, + batchSizeLimit: batchSize, + parallelRpcCallsLimit: parallelRpcCalls, + backOffMultiplier: multiplier, + } +} + +func (c *defaultEvmBatchCaller) batchCall(ctx context.Context, blockNumber uint64, calls []EvmCall) ([]DataAndErr, error) { + if len(calls) == 0 { + return nil, nil + } + + packedOutputs := make([]string, len(calls)) + rpcBatchCalls := make([]rpc.BatchElem, len(calls)) + + for i, call := range calls { + packedInputs, err := call.abi.Pack(call.methodName, call.args...) + if err != nil { + return nil, fmt.Errorf("pack %s(%+v): %w", call.methodName, call.args, err) + } + + blockNumStr := "latest" + if blockNumber > 0 { + blockNumStr = hexutil.EncodeBig(big.NewInt(0).SetUint64(blockNumber)) + } + + rpcBatchCalls[i] = rpc.BatchElem{ + Method: "eth_call", + Args: []any{ + map[string]interface{}{ + "from": common.Address{}, + "to": call.contractAddress, + "data": hexutil.Bytes(packedInputs), + }, + blockNumStr, + }, + Result: &packedOutputs[i], + } + } + + err := c.batchSender.BatchCallContext(ctx, rpcBatchCalls) + if err != nil { + return nil, fmt.Errorf("batch call context: %w", err) + } + + results := make([]DataAndErr, len(calls)) + for i, call := range calls { + if rpcBatchCalls[i].Error != nil { + results[i].Err = rpcBatchCalls[i].Error + continue + } + + if packedOutputs[i] == "" { + // Some RPCs instead of returning "0x" are returning an empty string. + // We are overriding this behaviour for consistent handling of this scenario. + packedOutputs[i] = "0x" + } + + b, err := hexutil.Decode(packedOutputs[i]) + if err != nil { + return nil, fmt.Errorf("decode result %s: packedOutputs %s: %w", call, packedOutputs[i], err) + } + + unpackedOutputs, err := call.abi.Unpack(call.methodName, b) + if err != nil { + if len(b) == 0 { + results[i].Err = fmt.Errorf("unpack result %s: %s: %w", call, err.Error(), ErrEmptyOutput) + } else { + results[i].Err = fmt.Errorf("unpack result %s: %w", call, err) + } + continue + } + + results[i].Outputs = unpackedOutputs + } + + return results, nil +} + +func (c *defaultEvmBatchCaller) batchCallDynamicLimitRetries(ctx context.Context, blockNumber uint64, calls []EvmCall) ([]DataAndErr, error) { + lim := c.batchSizeLimit + // Limit the batch size to the number of calls + if uint(len(calls)) < lim { + lim = uint(len(calls)) + } + for { + results, err := c.batchCallLimit(ctx, blockNumber, calls, lim) + if err == nil { + return results, nil + } + + if lim <= 1 { + return nil, errors.Wrapf(err, "calls %+v", EVMCallsToString(calls)) + } + + newLim := lim / c.backOffMultiplier + if newLim == 0 || newLim == lim { + newLim = 1 + } + lim = newLim + c.lggr.Errorf("retrying batch call with %d calls and %d limit that failed with error=%s", + len(calls), lim, err) + } +} + +func (c *defaultEvmBatchCaller) batchCallLimit(ctx context.Context, blockNumber uint64, calls []EvmCall, batchSizeLimit uint) ([]DataAndErr, error) { + if batchSizeLimit <= 0 { + return c.batchCall(ctx, blockNumber, calls) + } + + type job struct { + blockNumber uint64 + calls []EvmCall + results []DataAndErr + } + + jobs := make([]job, 0) + for i := 0; i < len(calls); i += int(batchSizeLimit) { + idxFrom := i + idxTo := idxFrom + int(batchSizeLimit) + if idxTo > len(calls) { + idxTo = len(calls) + } + jobs = append(jobs, job{blockNumber: blockNumber, calls: calls[idxFrom:idxTo], results: nil}) + } + + if c.parallelRpcCallsLimit > 1 { + eg := new(errgroup.Group) + eg.SetLimit(int(c.parallelRpcCallsLimit)) + for jobIdx := range jobs { + jobIdx := jobIdx + eg.Go(func() error { + res, err := c.batchCall(ctx, jobs[jobIdx].blockNumber, jobs[jobIdx].calls) + if err != nil { + return err + } + jobs[jobIdx].results = res + return nil + }) + } + if err := eg.Wait(); err != nil { + return nil, err + } + } else { + var err error + for jobIdx := range jobs { + jobs[jobIdx].results, err = c.batchCall(ctx, jobs[jobIdx].blockNumber, jobs[jobIdx].calls) + if err != nil { + return nil, err + } + } + } + + results := make([]DataAndErr, 0) + for _, jb := range jobs { + results = append(results, jb.results...) + } + return results, nil +} + +type AbiPackerUnpacker interface { + Pack(name string, args ...interface{}) ([]byte, error) + Unpack(name string, data []byte) ([]interface{}, error) +} + +type EvmCall struct { + abi AbiPackerUnpacker + methodName string + contractAddress common.Address + args []any +} + +func NewEvmCall(abi AbiPackerUnpacker, methodName string, contractAddress common.Address, args ...any) EvmCall { + return EvmCall{ + abi: abi, + methodName: methodName, + contractAddress: contractAddress, + args: args, + } +} + +func (c EvmCall) MethodName() string { + return c.methodName +} + +func (c EvmCall) String() string { + return fmt.Sprintf("%s: %s(%+v)", c.contractAddress.String(), c.methodName, c.args) +} + +func EVMCallsToString(calls []EvmCall) string { + callString := "" + for _, call := range calls { + callString += fmt.Sprintf("%s\n", call.String()) + } + return callString +} + +type DataAndErr struct { + Outputs []any + Err error +} + +func ParseOutputs[T any](results []DataAndErr, parseFunc func(d DataAndErr) (T, error)) ([]T, error) { + parsed := make([]T, 0, len(results)) + + for _, res := range results { + v, err := parseFunc(res) + if err != nil { + return nil, fmt.Errorf("parse contract output: %w", err) + } + parsed = append(parsed, v) + } + + return parsed, nil +} + +func ParseOutput[T any](dataAndErr DataAndErr, idx int) (T, error) { + var parsed T + + if dataAndErr.Err != nil { + return parsed, fmt.Errorf("rpc call error: %w", dataAndErr.Err) + } + + if idx < 0 || idx >= len(dataAndErr.Outputs) { + return parsed, fmt.Errorf("idx %d is out of bounds for %d outputs", idx, len(dataAndErr.Outputs)) + } + + res, is := dataAndErr.Outputs[idx].(T) + if !is { + // some rpc types are not strictly defined + // for that reason we try to manually map the fields using json encoding + b, err := json.Marshal(dataAndErr.Outputs[idx]) + if err == nil { + var empty T + if err := json.Unmarshal(b, &parsed); err == nil && !reflect.DeepEqual(parsed, empty) { + return parsed, nil + } + } + + return parsed, fmt.Errorf("the result type is: %T, expected: %T", dataAndErr.Outputs[idx], parsed) + } + + return res, nil +} diff --git a/core/services/ocr2/plugins/ccip/internal/rpclib/evm_test.go b/core/services/ocr2/plugins/ccip/internal/rpclib/evm_test.go new file mode 100644 index 00000000000..1a3d7baf0fc --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/rpclib/evm_test.go @@ -0,0 +1,223 @@ +package rpclib_test + +import ( + "fmt" + "strconv" + "testing" + + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/rpclib" + + "github.com/cometbft/cometbft/libs/rand" + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/rpc" + "github.com/pkg/errors" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client/mocks" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" + "github.com/smartcontractkit/chainlink/v2/core/logger" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/abihelpers" +) + +func TestDefaultEvmBatchCaller_BatchCallDynamicLimit(t *testing.T) { + testCases := []struct { + name string + maxBatchSize uint + backOffMultiplier uint + numCalls int + expectedBatchSizesOnEachRetry []int + }{ + { + name: "defaults", + maxBatchSize: rpclib.DefaultRpcBatchSizeLimit, + backOffMultiplier: rpclib.DefaultRpcBatchBackOffMultiplier, + numCalls: 200, + expectedBatchSizesOnEachRetry: []int{100, 20, 4, 1}, + }, + { + name: "base simple scenario", + maxBatchSize: 20, + backOffMultiplier: 2, + numCalls: 100, + expectedBatchSizesOnEachRetry: []int{20, 10, 5, 2, 1}, + }, + { + name: "remainder", + maxBatchSize: 99, + backOffMultiplier: 5, + numCalls: 100, + expectedBatchSizesOnEachRetry: []int{99, 19, 3, 1}, + }, + { + name: "large back off multiplier", + maxBatchSize: 20, + backOffMultiplier: 18, + numCalls: 100, + expectedBatchSizesOnEachRetry: []int{20, 1}, + }, + { + name: "back off equal to batch size", + maxBatchSize: 20, + backOffMultiplier: 20, + numCalls: 100, + expectedBatchSizesOnEachRetry: []int{20, 1}, + }, + { + name: "back off larger than batch size", + maxBatchSize: 20, + backOffMultiplier: 220, + numCalls: 100, + expectedBatchSizesOnEachRetry: []int{20, 1}, + }, + { + name: "back off 1", + maxBatchSize: 20, + backOffMultiplier: 1, + numCalls: 100, + expectedBatchSizesOnEachRetry: []int{20, 1}, + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + batchSizes := make([]int, 0) + + ec := mocks.NewClient(t) + bc := rpclib.NewDynamicLimitedBatchCaller(logger.TestLogger(t), ec, tc.maxBatchSize, tc.backOffMultiplier, 1) + ctx := testutils.Context(t) + calls := make([]rpclib.EvmCall, tc.numCalls) + emptyAbi := abihelpers.MustParseABI("[]") + for i := range calls { + calls[i] = rpclib.NewEvmCall(emptyAbi, "", common.Address{}) + } + ec.On("BatchCallContext", mock.Anything, mock.Anything).Run(func(args mock.Arguments) { + evmCalls := args.Get(1).([]rpc.BatchElem) + batchSizes = append(batchSizes, len(evmCalls)) + }).Return(errors.New("some error")) + _, _ = bc.BatchCall(ctx, 123, calls) + + assert.Equal(t, tc.expectedBatchSizesOnEachRetry, batchSizes) + }) + } +} + +func TestDefaultEvmBatchCaller_batchCallLimit(t *testing.T) { + ctx := testutils.Context(t) + + testCases := []struct { + numCalls uint + batchSize uint + parallelRpcCallsLimit uint + }{ + {numCalls: 100, batchSize: 10, parallelRpcCallsLimit: 5}, + {numCalls: 10, batchSize: 100, parallelRpcCallsLimit: 10}, + {numCalls: 1, batchSize: 100, parallelRpcCallsLimit: 10}, + {numCalls: 1000, batchSize: 10, parallelRpcCallsLimit: 2}, + {numCalls: rand.Uint() % 1000, batchSize: rand.Uint() % 500, parallelRpcCallsLimit: rand.Uint() % 500}, + } + + for _, tc := range testCases { + t.Run(fmt.Sprintf("%v", tc), func(t *testing.T) { + ec := mocks.NewClient(t) + bc := rpclib.NewDynamicLimitedBatchCaller(logger.TestLogger(t), ec, tc.batchSize, 99999, tc.parallelRpcCallsLimit) + + // generate the abi and the rpc calls + intTyp, err := abi.NewType("uint64", "uint64", nil) + assert.NoError(t, err) + calls := make([]rpclib.EvmCall, tc.numCalls) + mockAbi := abihelpers.MustParseABI("[]") + for i := range calls { + name := fmt.Sprintf("method_%d", i) + meth := abi.NewMethod(name, name, abi.Function, "nonpayable", true, false, abi.Arguments{abi.Argument{Name: "a", Type: intTyp}}, abi.Arguments{abi.Argument{Name: "b", Type: intTyp}}) + mockAbi.Methods[name] = meth + calls[i] = rpclib.NewEvmCall(mockAbi, name, common.Address{}, uint64(i)) + } + + // mock the rpc call to batch call context + // for simplicity we just set an error + ec.On("BatchCallContext", mock.Anything, mock.Anything). + Run(func(args mock.Arguments) { + evmCalls := args.Get(1).([]rpc.BatchElem) + for i := range evmCalls { + arg := evmCalls[i].Args[0].(map[string]interface{})["data"].(hexutil.Bytes) + arg = arg[len(arg)-10:] + evmCalls[i].Error = fmt.Errorf("%s", arg) + } + }).Return(nil) + + // make the call and make sure the results are received in order + results, _ := bc.BatchCall(ctx, 0, calls) + assert.Len(t, results, len(calls)) + for i, res := range results { + resNum, err := strconv.ParseInt(res.Err.Error()[2:], 16, 64) + assert.NoError(t, err) + assert.Equal(t, int64(i), resNum) + } + }) + } +} + +func TestParseOutput(t *testing.T) { + type testCase[T any] struct { + name string + dataAndErr rpclib.DataAndErr + outputIdx int + expRes T + expErr bool + } + + testCases := []testCase[string]{ + { + name: "success", + dataAndErr: rpclib.DataAndErr{Outputs: []any{"abc"}, Err: nil}, + outputIdx: 0, + expRes: "abc", + expErr: false, + }, + { + name: "index error on empty list", + dataAndErr: rpclib.DataAndErr{Outputs: []any{}, Err: nil}, + outputIdx: 0, + expErr: true, + }, + { + name: "index error on non-empty list", + dataAndErr: rpclib.DataAndErr{Outputs: []any{"a", "b"}, Err: nil}, + outputIdx: 2, + expErr: true, + }, + { + name: "negative index", + dataAndErr: rpclib.DataAndErr{Outputs: []any{"a", "b"}, Err: nil}, + outputIdx: -1, + expErr: true, + }, + { + name: "wrong type", + dataAndErr: rpclib.DataAndErr{Outputs: []any{1234}, Err: nil}, + outputIdx: 0, + expErr: true, + }, + { + name: "has err", + dataAndErr: rpclib.DataAndErr{Outputs: []any{"abc"}, Err: fmt.Errorf("some err")}, + outputIdx: 0, + expErr: true, + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + res, err := rpclib.ParseOutput[string](tc.dataAndErr, tc.outputIdx) + if tc.expErr { + assert.Error(t, err) + return + } + assert.NoError(t, err) + assert.Equal(t, tc.expRes, res) + }) + } +} diff --git a/core/services/ocr2/plugins/ccip/internal/rpclib/rpclibmocks/evm_mock.go b/core/services/ocr2/plugins/ccip/internal/rpclib/rpclibmocks/evm_mock.go new file mode 100644 index 00000000000..aa42814186e --- /dev/null +++ b/core/services/ocr2/plugins/ccip/internal/rpclib/rpclibmocks/evm_mock.go @@ -0,0 +1,97 @@ +// Code generated by mockery v2.43.2. DO NOT EDIT. + +package rpclibmocks + +import ( + context "context" + + rpclib "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/rpclib" + mock "github.com/stretchr/testify/mock" +) + +// EvmBatchCaller is an autogenerated mock type for the EvmBatchCaller type +type EvmBatchCaller struct { + mock.Mock +} + +type EvmBatchCaller_Expecter struct { + mock *mock.Mock +} + +func (_m *EvmBatchCaller) EXPECT() *EvmBatchCaller_Expecter { + return &EvmBatchCaller_Expecter{mock: &_m.Mock} +} + +// BatchCall provides a mock function with given fields: ctx, blockNumber, calls +func (_m *EvmBatchCaller) BatchCall(ctx context.Context, blockNumber uint64, calls []rpclib.EvmCall) ([]rpclib.DataAndErr, error) { + ret := _m.Called(ctx, blockNumber, calls) + + if len(ret) == 0 { + panic("no return value specified for BatchCall") + } + + var r0 []rpclib.DataAndErr + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, uint64, []rpclib.EvmCall) ([]rpclib.DataAndErr, error)); ok { + return rf(ctx, blockNumber, calls) + } + if rf, ok := ret.Get(0).(func(context.Context, uint64, []rpclib.EvmCall) []rpclib.DataAndErr); ok { + r0 = rf(ctx, blockNumber, calls) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]rpclib.DataAndErr) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, uint64, []rpclib.EvmCall) error); ok { + r1 = rf(ctx, blockNumber, calls) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EvmBatchCaller_BatchCall_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BatchCall' +type EvmBatchCaller_BatchCall_Call struct { + *mock.Call +} + +// BatchCall is a helper method to define mock.On call +// - ctx context.Context +// - blockNumber uint64 +// - calls []rpclib.EvmCall +func (_e *EvmBatchCaller_Expecter) BatchCall(ctx interface{}, blockNumber interface{}, calls interface{}) *EvmBatchCaller_BatchCall_Call { + return &EvmBatchCaller_BatchCall_Call{Call: _e.mock.On("BatchCall", ctx, blockNumber, calls)} +} + +func (_c *EvmBatchCaller_BatchCall_Call) Run(run func(ctx context.Context, blockNumber uint64, calls []rpclib.EvmCall)) *EvmBatchCaller_BatchCall_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(uint64), args[2].([]rpclib.EvmCall)) + }) + return _c +} + +func (_c *EvmBatchCaller_BatchCall_Call) Return(_a0 []rpclib.DataAndErr, _a1 error) *EvmBatchCaller_BatchCall_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EvmBatchCaller_BatchCall_Call) RunAndReturn(run func(context.Context, uint64, []rpclib.EvmCall) ([]rpclib.DataAndErr, error)) *EvmBatchCaller_BatchCall_Call { + _c.Call.Return(run) + return _c +} + +// NewEvmBatchCaller creates a new instance of EvmBatchCaller. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewEvmBatchCaller(t interface { + mock.TestingT + Cleanup(func()) +}) *EvmBatchCaller { + mock := &EvmBatchCaller{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/core/services/ocr2/plugins/ccip/metrics.go b/core/services/ocr2/plugins/ccip/metrics.go new file mode 100644 index 00000000000..f481b5d447d --- /dev/null +++ b/core/services/ocr2/plugins/ccip/metrics.go @@ -0,0 +1,99 @@ +package ccip + +import ( + "strconv" + + "github.com/prometheus/client_golang/prometheus" + "github.com/prometheus/client_golang/prometheus/promauto" +) + +var ( + unexpiredCommitRoots = promauto.NewGaugeVec(prometheus.GaugeOpts{ + Name: "ccip_unexpired_commit_roots", + Help: "Number of unexpired commit roots processed by the plugin", + }, []string{"plugin", "source", "dest"}) + messagesProcessed = promauto.NewGaugeVec(prometheus.GaugeOpts{ + Name: "ccip_number_of_messages_processed", + Help: "Number of messages processed by the plugin during different OCR phases", + }, []string{"plugin", "source", "dest", "ocrPhase"}) + sequenceNumberCounter = promauto.NewGaugeVec(prometheus.GaugeOpts{ + Name: "ccip_sequence_number_counter", + Help: "Sequence number of the last message processed by the plugin", + }, []string{"plugin", "source", "dest", "ocrPhase"}) +) + +type ocrPhase string + +const ( + Observation ocrPhase = "observation" + Report ocrPhase = "report" + ShouldAccept ocrPhase = "shouldAccept" +) + +type PluginMetricsCollector interface { + NumberOfMessagesProcessed(phase ocrPhase, count int) + NumberOfMessagesBasedOnInterval(phase ocrPhase, seqNrMin, seqNrMax uint64) + UnexpiredCommitRoots(count int) + SequenceNumber(phase ocrPhase, seqNr uint64) +} + +type pluginMetricsCollector struct { + pluginName string + source, dest string +} + +func NewPluginMetricsCollector(pluginLabel string, sourceChainId, destChainId int64) *pluginMetricsCollector { + return &pluginMetricsCollector{ + pluginName: pluginLabel, + source: strconv.FormatInt(sourceChainId, 10), + dest: strconv.FormatInt(destChainId, 10), + } +} + +func (p *pluginMetricsCollector) NumberOfMessagesProcessed(phase ocrPhase, count int) { + messagesProcessed. + WithLabelValues(p.pluginName, p.source, p.dest, string(phase)). + Set(float64(count)) +} + +func (p *pluginMetricsCollector) NumberOfMessagesBasedOnInterval(phase ocrPhase, seqNrMin, seqNrMax uint64) { + messagesProcessed. + WithLabelValues(p.pluginName, p.source, p.dest, string(phase)). + Set(float64(seqNrMax - seqNrMin + 1)) +} + +func (p *pluginMetricsCollector) UnexpiredCommitRoots(count int) { + unexpiredCommitRoots. + WithLabelValues(p.pluginName, p.source, p.dest). + Set(float64(count)) +} + +func (p *pluginMetricsCollector) SequenceNumber(phase ocrPhase, seqNr uint64) { + // Don't publish price reports + if seqNr == 0 { + return + } + + sequenceNumberCounter. + WithLabelValues(p.pluginName, p.source, p.dest, string(phase)). + Set(float64(seqNr)) +} + +var ( + // NoopMetricsCollector is a no-op implementation of PluginMetricsCollector + NoopMetricsCollector PluginMetricsCollector = noop{} +) + +type noop struct{} + +func (d noop) NumberOfMessagesProcessed(ocrPhase, int) { +} + +func (d noop) NumberOfMessagesBasedOnInterval(ocrPhase, uint64, uint64) { +} + +func (d noop) UnexpiredCommitRoots(int) { +} + +func (d noop) SequenceNumber(ocrPhase, uint64) { +} diff --git a/core/services/ocr2/plugins/ccip/metrics_test.go b/core/services/ocr2/plugins/ccip/metrics_test.go new file mode 100644 index 00000000000..eec67db7dd0 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/metrics_test.go @@ -0,0 +1,47 @@ +package ccip + +import ( + "testing" + + "github.com/prometheus/client_golang/prometheus/testutil" + "github.com/stretchr/testify/assert" +) + +const ( + sourceChainId = 1337 + destChainId = 2337 +) + +func Test_SequenceNumbers(t *testing.T) { + collector := NewPluginMetricsCollector("test", sourceChainId, destChainId) + + collector.SequenceNumber(Report, 10) + assert.Equal(t, float64(10), testutil.ToFloat64(sequenceNumberCounter.WithLabelValues("test", "1337", "2337", "report"))) + + collector.SequenceNumber(Report, 0) + assert.Equal(t, float64(10), testutil.ToFloat64(sequenceNumberCounter.WithLabelValues("test", "1337", "2337", "report"))) +} + +func Test_NumberOfMessages(t *testing.T) { + collector := NewPluginMetricsCollector("test", sourceChainId, destChainId) + collector2 := NewPluginMetricsCollector("test2", destChainId, sourceChainId) + + collector.NumberOfMessagesBasedOnInterval(Observation, 1, 10) + assert.Equal(t, float64(10), testutil.ToFloat64(messagesProcessed.WithLabelValues("test", "1337", "2337", "observation"))) + + collector.NumberOfMessagesBasedOnInterval(Report, 5, 30) + assert.Equal(t, float64(26), testutil.ToFloat64(messagesProcessed.WithLabelValues("test", "1337", "2337", "report"))) + + collector2.NumberOfMessagesProcessed(Report, 15) + assert.Equal(t, float64(15), testutil.ToFloat64(messagesProcessed.WithLabelValues("test2", "2337", "1337", "report"))) +} + +func Test_UnexpiredCommitRoots(t *testing.T) { + collector := NewPluginMetricsCollector("test", sourceChainId, destChainId) + + collector.UnexpiredCommitRoots(10) + assert.Equal(t, float64(10), testutil.ToFloat64(unexpiredCommitRoots.WithLabelValues("test", "1337", "2337"))) + + collector.UnexpiredCommitRoots(5) + assert.Equal(t, float64(5), testutil.ToFloat64(unexpiredCommitRoots.WithLabelValues("test", "1337", "2337"))) +} diff --git a/core/services/ocr2/plugins/ccip/observations.go b/core/services/ocr2/plugins/ccip/observations.go new file mode 100644 index 00000000000..f79d667a550 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/observations.go @@ -0,0 +1,149 @@ +package ccip + +import ( + "encoding/json" + "fmt" + "math/big" + "strings" + + "github.com/smartcontractkit/libocr/commontypes" + + "github.com/smartcontractkit/libocr/offchainreporting2plus/types" + + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + + "github.com/smartcontractkit/chainlink/v2/core/logger" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipcalc" +) + +// Note if a breaking change is introduced to this struct nodes running different versions +// will not be able to unmarshal each other's observations. Do not modify unless you +// know what you are doing. +type CommitObservation struct { + Interval cciptypes.CommitStoreInterval `json:"interval"` + TokenPricesUSD map[cciptypes.Address]*big.Int `json:"tokensPerFeeCoin"` + SourceGasPriceUSD *big.Int `json:"sourceGasPrice"` // Deprecated + SourceGasPriceUSDPerChain map[uint64]*big.Int `json:"sourceGasPriceUSDPerChain"` +} + +// Marshal MUST be used instead of raw json.Marshal(o) since it contains backwards compatibility related changes. +func (o CommitObservation) Marshal() ([]byte, error) { + obsCopy := o + + // Similar to: commitObservationJSONBackComp but for commit observation marshaling. + tokenPricesUSD := make(map[cciptypes.Address]*big.Int, len(obsCopy.TokenPricesUSD)) + for k, v := range obsCopy.TokenPricesUSD { + tokenPricesUSD[cciptypes.Address(strings.ToLower(string(k)))] = v + } + obsCopy.TokenPricesUSD = tokenPricesUSD + + return json.Marshal(&obsCopy) +} + +// ExecutionObservation stores messages as a map pointing from a sequence number (uint) to the message payload (MsgData) +// Having it structured this way is critical because: +// * it prevents having duplicated sequence numbers within a single ExecutionObservation (compared to the list representation) +// * prevents malicious actors from passing multiple messages with the same sequence number +// Note if a breaking change is introduced to this struct nodes running different versions +// will not be able to unmarshal each other's observations. Do not modify unless you +// know what you are doing. +type ExecutionObservation struct { + Messages map[uint64]MsgData `json:"messages"` +} + +type MsgData struct { + TokenData [][]byte `json:"tokenData"` +} + +// ObservedMessage is a transient struct used for processing convenience within the plugin. It's easier to process observed messages +// when all properties are flattened into a single structure. +// It should not be serialized and returned from types.ReportingPlugin functions, please serialize/deserialize to/from ExecutionObservation instead using NewObservedMessage +type ObservedMessage struct { + SeqNr uint64 + MsgData +} + +func NewExecutionObservation(observations []ObservedMessage) ExecutionObservation { + denormalized := make(map[uint64]MsgData, len(observations)) + for _, o := range observations { + denormalized[o.SeqNr] = MsgData{TokenData: o.TokenData} + } + return ExecutionObservation{Messages: denormalized} +} + +func NewObservedMessage(seqNr uint64, tokenData [][]byte) ObservedMessage { + return ObservedMessage{ + SeqNr: seqNr, + MsgData: MsgData{TokenData: tokenData}, + } +} + +func (o ExecutionObservation) Marshal() ([]byte, error) { + return json.Marshal(&o) +} + +// GetParsableObservations checks the given observations for formatting and value errors. +// It returns all valid observations, potentially being an empty list. It will log +// malformed observations but never error. +// +// GetParsableObservations MUST be used instead of raw json.Unmarshal(o) since it contains backwards compatibility changes. +func GetParsableObservations[O CommitObservation | ExecutionObservation](l logger.Logger, observations []types.AttributedObservation) []O { + var parseableObservations []O + var observers []commontypes.OracleID + for _, ao := range observations { + if len(ao.Observation) == 0 { + // Empty observation + l.Infow("Discarded empty observation", "observer", ao.Observer) + continue + } + var ob O + var err error + obsJSON := ao.Observation + + switch any(ob).(type) { + case CommitObservation: + commitObservation, err1 := commitObservationJSONBackComp(ao.Observation) + if err1 != nil { + l.Errorw("commit observation json backwards compatibility format failed", "err", err, + "observation", string(ao.Observation), "observer", ao.Observer) + continue + } + ob = any(commitObservation).(O) + default: + err = json.Unmarshal(obsJSON, &ob) + if err != nil { + l.Errorw("Received unmarshallable observation", "err", err, "observation", string(ao.Observation), "observer", ao.Observer) + continue + } + } + + parseableObservations = append(parseableObservations, ob) + observers = append(observers, ao.Observer) + } + l.Infow( + "Parsed observations", + "observers", observers, + "observersLength", len(observers), + "observationsLength", len(parseableObservations), + "rawObservationLength", len(observations), + ) + return parseableObservations +} + +// For backwards compatibility, converts token prices to eip55. +// Prior to cciptypes.Address we were using go-ethereum common.Address type which is +// marshalled to lower-case while the string representation we used was eip55. +// Nodes that run different ccip version should generate the same observations. +func commitObservationJSONBackComp(obsJson []byte) (CommitObservation, error) { + var obs CommitObservation + err := json.Unmarshal(obsJson, &obs) + if err != nil { + return CommitObservation{}, fmt.Errorf("unmarshal observation: %w", err) + } + tokenPricesUSD := make(map[cciptypes.Address]*big.Int, len(obs.TokenPricesUSD)) + for k, v := range obs.TokenPricesUSD { + tokenPricesUSD[ccipcalc.HexToAddress(string(k))] = v + } + obs.TokenPricesUSD = tokenPricesUSD + return obs, nil +} diff --git a/core/services/ocr2/plugins/ccip/observations_test.go b/core/services/ocr2/plugins/ccip/observations_test.go new file mode 100644 index 00000000000..a3143f157d7 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/observations_test.go @@ -0,0 +1,305 @@ +package ccip + +import ( + "encoding/json" + "math/big" + "strings" + "testing" + + "github.com/leanovate/gopter" + "github.com/leanovate/gopter/gen" + "github.com/leanovate/gopter/prop" + "github.com/smartcontractkit/libocr/offchainreporting2plus/types" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + + "github.com/smartcontractkit/chainlink/v2/core/logger" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/config" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipcalc" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/testhelpers" +) + +func TestObservationFilter(t *testing.T) { + lggr := logger.TestLogger(t) + obs1 := CommitObservation{Interval: cciptypes.CommitStoreInterval{Min: 1, Max: 10}} + b1, err := obs1.Marshal() + require.NoError(t, err) + nonEmpty := GetParsableObservations[CommitObservation](lggr, []types.AttributedObservation{{Observation: b1}, {Observation: []byte{}}}) + require.Equal(t, 1, len(nonEmpty)) + assert.Equal(t, nonEmpty[0].Interval, obs1.Interval) +} + +// This is the observation format up to 1.4.16 release +type CommitObservationLegacy struct { + Interval cciptypes.CommitStoreInterval `json:"interval"` + TokenPricesUSD map[cciptypes.Address]*big.Int `json:"tokensPerFeeCoin"` + SourceGasPriceUSD *big.Int `json:"sourceGasPrice"` +} + +func TestObservationCompat_MultiChainGas(t *testing.T) { + obsLegacy := CommitObservationLegacy{ + Interval: cciptypes.CommitStoreInterval{ + Min: 1, + Max: 12, + }, + TokenPricesUSD: map[cciptypes.Address]*big.Int{ccipcalc.HexToAddress("0x1"): big.NewInt(1)}, + SourceGasPriceUSD: big.NewInt(3)} + bL, err := json.Marshal(obsLegacy) + require.NoError(t, err) + obsNew := CommitObservation{ + Interval: cciptypes.CommitStoreInterval{ + Min: 1, + Max: 12, + }, + TokenPricesUSD: map[cciptypes.Address]*big.Int{ccipcalc.HexToAddress("0x1"): big.NewInt(1)}, + SourceGasPriceUSD: big.NewInt(3), + } + bN, err := json.Marshal(obsNew) + require.NoError(t, err) + + observations := GetParsableObservations[CommitObservation](logger.TestLogger(t), []types.AttributedObservation{{Observation: bL}, {Observation: bN}}) + + assert.Equal(t, 2, len(observations)) + assert.Equal(t, observations[0], observations[1]) +} + +func TestCommitObservationJsonDeserialization(t *testing.T) { + expectedObservation := CommitObservation{ + Interval: cciptypes.CommitStoreInterval{ + Min: 1, + Max: 12, + }, + TokenPricesUSD: map[cciptypes.Address]*big.Int{ + ccipcalc.HexToAddress("0x1"): big.NewInt(1)}, + SourceGasPriceUSD: big.NewInt(3), + } + + json := `{ + "interval": { + "Min":1, + "Max":12 + }, + "tokensPerFeeCoin": { + "0x0000000000000000000000000000000000000001": 1 + }, + "sourceGasPrice": 3 + }` + + observations := GetParsableObservations[CommitObservation](logger.TestLogger(t), []types.AttributedObservation{{Observation: []byte(json)}}) + assert.Equal(t, 1, len(observations)) + assert.Equal(t, expectedObservation, observations[0]) +} + +func TestCommitObservationMarshal(t *testing.T) { + obs := CommitObservation{ + Interval: cciptypes.CommitStoreInterval{ + Min: 1, + Max: 12, + }, + TokenPricesUSD: map[cciptypes.Address]*big.Int{"0xAaAaAa": big.NewInt(1)}, + SourceGasPriceUSD: big.NewInt(3), + SourceGasPriceUSDPerChain: map[uint64]*big.Int{123: big.NewInt(3)}, + } + + b, err := obs.Marshal() + require.NoError(t, err) + assert.Equal(t, `{"interval":{"Min":1,"Max":12},"tokensPerFeeCoin":{"0xaaaaaa":1},"sourceGasPrice":3,"sourceGasPriceUSDPerChain":{"123":3}}`, string(b)) + + // Make sure that the call to Marshal did not alter the original observation object. + assert.Len(t, obs.TokenPricesUSD, 1) + _, exists := obs.TokenPricesUSD["0xAaAaAa"] + assert.True(t, exists) + _, exists = obs.TokenPricesUSD["0xaaaaaa"] + assert.False(t, exists) + + assert.Len(t, obs.SourceGasPriceUSDPerChain, 1) + _, exists = obs.SourceGasPriceUSDPerChain[123] + assert.True(t, exists) +} + +func TestExecutionObservationJsonDeserialization(t *testing.T) { + expectedObservation := ExecutionObservation{Messages: map[uint64]MsgData{ + 2: {TokenData: tokenData("c")}, + 1: {TokenData: tokenData("c")}, + }} + + // ["YQ=="] is "a" + // ["Yw=="] is "c" + json := `{ + "messages": { + "2":{"tokenData":["YQ=="]}, + "1":{"tokenData":["Yw=="]}, + "2":{"tokenData":["Yw=="]} + } + }` + + observations := GetParsableObservations[ExecutionObservation](logger.TestLogger(t), []types.AttributedObservation{{Observation: []byte(json)}}) + assert.Equal(t, 1, len(observations)) + assert.Equal(t, 2, len(observations[0].Messages)) + assert.Equal(t, expectedObservation, observations[0]) +} + +func TestObservationSize(t *testing.T) { + testParams := gopter.DefaultTestParameters() + testParams.MinSuccessfulTests = 100 + p := gopter.NewProperties(testParams) + p.Property("bounded observation size", prop.ForAll(func(min, max uint64) bool { + o := NewExecutionObservation( + []ObservedMessage{ + { + SeqNr: min, + MsgData: MsgData{}, + }, + { + SeqNr: max, + MsgData: MsgData{}, + }, + }, + ) + b, err := o.Marshal() + require.NoError(t, err) + return len(b) <= MaxObservationLength + }, gen.UInt64(), gen.UInt64())) + p.TestingRun(t) +} + +func TestNewExecutionObservation(t *testing.T) { + tests := []struct { + name string + observations []ObservedMessage + want ExecutionObservation + }{ + { + name: "nil observations", + observations: nil, + want: ExecutionObservation{Messages: map[uint64]MsgData{}}, + }, + { + name: "empty observations", + observations: []ObservedMessage{}, + want: ExecutionObservation{Messages: map[uint64]MsgData{}}, + }, + { + name: "observations with different sequence numbers", + observations: []ObservedMessage{ + NewObservedMessage(1, tokenData("a")), + NewObservedMessage(2, tokenData("b")), + NewObservedMessage(3, tokenData("c")), + }, + want: ExecutionObservation{ + Messages: map[uint64]MsgData{ + 1: {TokenData: tokenData("a")}, + 2: {TokenData: tokenData("b")}, + 3: {TokenData: tokenData("c")}, + }, + }, + }, + { + name: "last one wins in case of duplicates", + observations: []ObservedMessage{ + NewObservedMessage(1, tokenData("a")), + NewObservedMessage(1, tokenData("b")), + NewObservedMessage(1, tokenData("c")), + }, + want: ExecutionObservation{ + Messages: map[uint64]MsgData{ + 1: {TokenData: tokenData("c")}, + }, + }, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + assert.Equalf(t, tt.want, NewExecutionObservation(tt.observations), "NewExecutionObservation(%v)", tt.observations) + }) + } +} + +func tokenData(value string) [][]byte { + return [][]byte{[]byte(value)} +} + +func TestCommitObservationJsonSerializationDeserialization(t *testing.T) { + jsonEncoded := `{ + "interval": { + "Min":1, + "Max":12 + }, + "tokensPerFeeCoin": { + "0x0000000000000000000000000000000000000001": 1, + "0x507877C2E26f1387432D067D2DaAfa7d0420d90a": 2, + "0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa": 3 + }, + "sourceGasPrice": 3, + "sourceGasPriceUSDPerChain": { + "123":3 + } + }` + + expectedObservation := CommitObservation{ + Interval: cciptypes.CommitStoreInterval{ + Min: 1, + Max: 12, + }, + TokenPricesUSD: map[cciptypes.Address]*big.Int{ + cciptypes.Address("0x0000000000000000000000000000000000000001"): big.NewInt(1), + cciptypes.Address("0x507877C2E26f1387432D067D2DaAfa7d0420d90a"): big.NewInt(2), // json eip55->eip55 parsed + cciptypes.Address("0xaAaAaAaaAaAaAaaAaAAAAAAAAaaaAaAaAaaAaaAa"): big.NewInt(3), // json lower->eip55 parsed + }, + SourceGasPriceUSD: big.NewInt(3), + SourceGasPriceUSDPerChain: map[uint64]*big.Int{ + 123: big.NewInt(3), + }, + } + + observations := GetParsableObservations[CommitObservation](logger.TestLogger(t), []types.AttributedObservation{ + {Observation: []byte(jsonEncoded)}, + }) + assert.Equal(t, 1, len(observations)) + assert.Equal(t, expectedObservation, observations[0]) + + backToJson, err := expectedObservation.Marshal() + // we expect the json encoded addresses to be lower-case + exp := strings.ReplaceAll( + jsonEncoded, "0x507877C2E26f1387432D067D2DaAfa7d0420d90a", strings.ToLower("0x507877C2E26f1387432D067D2DaAfa7d0420d90a")) + assert.NoError(t, err) + assert.JSONEq(t, exp, string(backToJson)) + + // and we expect to get the same results after we parse the lower-case addresses + observations = GetParsableObservations[CommitObservation](logger.TestLogger(t), []types.AttributedObservation{ + {Observation: []byte(jsonEncoded)}, + }) + assert.Equal(t, 1, len(observations)) + assert.Equal(t, expectedObservation, observations[0]) +} + +func TestAddressEncodingBackwardsCompatibility(t *testing.T) { + // The intention of this test is to remind including proper formatting of addresses after config is updated. + // + // The following tests will fail when a new cciptypes.Address field is added or removed. + // If you notice that the test is failing, make sure to apply proper address formatting + // after the struct is marshalled/unmarshalled and then include your new field in the expected fields slice to + // make this test pass or if you removed a field, remove it from the expected fields slice. + + t.Run("job spec config", func(t *testing.T) { + exp := []string{"ccip.Address OffRamp"} + + fields := testhelpers.FindStructFieldsOfCertainType( + "ccip.Address", + config.CommitPluginJobSpecConfig{PriceGetterConfig: &config.DynamicPriceGetterConfig{}}, + ) + assert.Equal(t, exp, fields) + }) + + t.Run("commit observation", func(t *testing.T) { + exp := []string{"map[ccip.Address]*big.Int TokenPricesUSD"} + + fields := testhelpers.FindStructFieldsOfCertainType( + "ccip.Address", + CommitObservation{SourceGasPriceUSD: big.NewInt(0)}, + ) + assert.Equal(t, exp, fields) + }) +} diff --git a/core/services/ocr2/plugins/ccip/pkg/leafer/leafer.go b/core/services/ocr2/plugins/ccip/pkg/leafer/leafer.go new file mode 100644 index 00000000000..c334f159fd2 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/pkg/leafer/leafer.go @@ -0,0 +1,61 @@ +package leafer + +import ( + "fmt" + + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + + "github.com/smartcontractkit/chainlink-common/pkg/hashutil" + + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/evm_2_evm_onramp" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/evm_2_evm_onramp_1_0_0" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/evm_2_evm_onramp_1_2_0" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_0_0" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_5_0" +) + +// LeafHasher converts a CCIPSendRequested event into something that can be hashed and hashes it. +type LeafHasher interface { + HashLeaf(log types.Log) ([32]byte, error) +} + +// Version is the contract to use. +type Version string + +const ( + V1_0_0 Version = "v1_0_0" + V1_2_0 Version = "v1_2_0" + V1_5_0 Version = "v1_5_0" +) + +// MakeLeafHasher is a factory function to construct the onramp implementing the HashLeaf function for a given version. +func MakeLeafHasher(ver Version, cl bind.ContractBackend, sourceChainSelector uint64, destChainSelector uint64, onRampId common.Address, ctx hashutil.Hasher[[32]byte]) (LeafHasher, error) { + switch ver { + case V1_0_0: + or, err := evm_2_evm_onramp_1_0_0.NewEVM2EVMOnRamp(onRampId, cl) + if err != nil { + return nil, err + } + h := v1_0_0.NewLeafHasher(sourceChainSelector, destChainSelector, onRampId, ctx, or) + return h, nil + case V1_2_0: + or, err := evm_2_evm_onramp_1_2_0.NewEVM2EVMOnRamp(onRampId, cl) + if err != nil { + return nil, err + } + h := v1_2_0.NewLeafHasher(sourceChainSelector, destChainSelector, onRampId, ctx, or) + return h, nil + case V1_5_0: + or, err := evm_2_evm_onramp.NewEVM2EVMOnRamp(onRampId, cl) + if err != nil { + return nil, err + } + h := v1_5_0.NewLeafHasher(sourceChainSelector, destChainSelector, onRampId, ctx, or) + return h, nil + default: + return nil, fmt.Errorf("unknown version %q", ver) + } +} diff --git a/core/services/ocr2/plugins/ccip/prices/da_price_estimator.go b/core/services/ocr2/plugins/ccip/prices/da_price_estimator.go new file mode 100644 index 00000000000..7c75b9bdd99 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/prices/da_price_estimator.go @@ -0,0 +1,176 @@ +package prices + +import ( + "context" + "fmt" + "math/big" + + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/gas" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/gas/rollups" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipcalc" +) + +type DAGasPriceEstimator struct { + execEstimator GasPriceEstimator + l1Oracle rollups.L1Oracle + priceEncodingLength uint + daDeviationPPB int64 + daOverheadGas int64 + gasPerDAByte int64 + daMultiplier int64 +} + +func NewDAGasPriceEstimator( + estimator gas.EvmFeeEstimator, + maxGasPrice *big.Int, + deviationPPB int64, + daDeviationPPB int64, +) *DAGasPriceEstimator { + return &DAGasPriceEstimator{ + execEstimator: NewExecGasPriceEstimator(estimator, maxGasPrice, deviationPPB), + l1Oracle: estimator.L1Oracle(), + priceEncodingLength: daGasPriceEncodingLength, + daDeviationPPB: daDeviationPPB, + } +} + +func (g DAGasPriceEstimator) GetGasPrice(ctx context.Context) (*big.Int, error) { + execGasPrice, err := g.execEstimator.GetGasPrice(ctx) + if err != nil { + return nil, err + } + var gasPrice *big.Int = execGasPrice + if gasPrice.BitLen() > int(g.priceEncodingLength) { + return nil, fmt.Errorf("native gas price exceeded max range %+v", gasPrice) + } + + if g.l1Oracle == nil { + return gasPrice, nil + } + + daGasPriceWei, err := g.l1Oracle.GasPrice(ctx) + if err != nil { + return nil, err + } + + if daGasPrice := daGasPriceWei.ToInt(); daGasPrice.Cmp(big.NewInt(0)) > 0 { + if daGasPrice.BitLen() > int(g.priceEncodingLength) { + return nil, fmt.Errorf("data availability gas price exceeded max range %+v", daGasPrice) + } + + daGasPrice = new(big.Int).Lsh(daGasPrice, g.priceEncodingLength) + gasPrice = new(big.Int).Add(gasPrice, daGasPrice) + } + + return gasPrice, nil +} + +func (g DAGasPriceEstimator) DenoteInUSD(p *big.Int, wrappedNativePrice *big.Int) (*big.Int, error) { + daGasPrice, execGasPrice, err := g.parseEncodedGasPrice(p) + if err != nil { + return nil, err + } + + // This assumes l1GasPrice is priced using the same native token as l2 native + daUSD := ccipcalc.CalculateUsdPerUnitGas(daGasPrice, wrappedNativePrice) + if daUSD.BitLen() > int(g.priceEncodingLength) { + return nil, fmt.Errorf("data availability gas price USD exceeded max range %+v", daUSD) + } + execUSD := ccipcalc.CalculateUsdPerUnitGas(execGasPrice, wrappedNativePrice) + if execUSD.BitLen() > int(g.priceEncodingLength) { + return nil, fmt.Errorf("exec gas price USD exceeded max range %+v", execUSD) + } + + daUSD = new(big.Int).Lsh(daUSD, g.priceEncodingLength) + return new(big.Int).Add(daUSD, execUSD), nil +} + +func (g DAGasPriceEstimator) Median(gasPrices []*big.Int) (*big.Int, error) { + daPrices := make([]*big.Int, len(gasPrices)) + execPrices := make([]*big.Int, len(gasPrices)) + + for i := range gasPrices { + daGasPrice, execGasPrice, err := g.parseEncodedGasPrice(gasPrices[i]) + if err != nil { + return nil, err + } + + daPrices[i] = daGasPrice + execPrices[i] = execGasPrice + } + + daMedian := ccipcalc.BigIntSortedMiddle(daPrices) + execMedian := ccipcalc.BigIntSortedMiddle(execPrices) + + daMedian = new(big.Int).Lsh(daMedian, g.priceEncodingLength) + return new(big.Int).Add(daMedian, execMedian), nil +} + +func (g DAGasPriceEstimator) Deviates(p1, p2 *big.Int) (bool, error) { + p1DAGasPrice, p1ExecGasPrice, err := g.parseEncodedGasPrice(p1) + if err != nil { + return false, err + } + p2DAGasPrice, p2ExecGasPrice, err := g.parseEncodedGasPrice(p2) + if err != nil { + return false, err + } + + execDeviates, err := g.execEstimator.Deviates(p1ExecGasPrice, p2ExecGasPrice) + if err != nil { + return false, err + } + if execDeviates { + return execDeviates, nil + } + + return ccipcalc.Deviates(p1DAGasPrice, p2DAGasPrice, g.daDeviationPPB), nil +} + +func (g DAGasPriceEstimator) EstimateMsgCostUSD(p *big.Int, wrappedNativePrice *big.Int, msg cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta) (*big.Int, error) { + daGasPrice, execGasPrice, err := g.parseEncodedGasPrice(p) + if err != nil { + return nil, err + } + + execCostUSD, err := g.execEstimator.EstimateMsgCostUSD(execGasPrice, wrappedNativePrice, msg) + if err != nil { + return nil, err + } + + // If there is data availability price component, then include data availability cost in fee estimation + if daGasPrice.Cmp(big.NewInt(0)) > 0 { + daGasCostUSD := g.estimateDACostUSD(daGasPrice, wrappedNativePrice, msg) + execCostUSD = new(big.Int).Add(daGasCostUSD, execCostUSD) + } + return execCostUSD, nil +} + +func (g DAGasPriceEstimator) parseEncodedGasPrice(p *big.Int) (*big.Int, *big.Int, error) { + if p.BitLen() > int(g.priceEncodingLength*2) { + return nil, nil, fmt.Errorf("encoded gas price exceeded max range %+v", p) + } + + daGasPrice := new(big.Int).Rsh(p, g.priceEncodingLength) + + daStart := new(big.Int).Lsh(big.NewInt(1), g.priceEncodingLength) + execGasPrice := new(big.Int).Mod(p, daStart) + + return daGasPrice, execGasPrice, nil +} + +func (g DAGasPriceEstimator) estimateDACostUSD(daGasPrice *big.Int, wrappedNativePrice *big.Int, msg cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta) *big.Int { + var sourceTokenDataLen int + for _, tokenData := range msg.SourceTokenData { + sourceTokenDataLen += len(tokenData) + } + + dataLen := evmMessageFixedBytes + len(msg.Data) + len(msg.TokenAmounts)*evmMessageBytesPerToken + sourceTokenDataLen + dataGas := big.NewInt(int64(dataLen)*g.gasPerDAByte + g.daOverheadGas) + + dataGasEstimate := new(big.Int).Mul(dataGas, daGasPrice) + dataGasEstimate = new(big.Int).Div(new(big.Int).Mul(dataGasEstimate, big.NewInt(g.daMultiplier)), big.NewInt(daMultiplierBase)) + + return ccipcalc.CalculateUsdPerUnitGas(dataGasEstimate, wrappedNativePrice) +} diff --git a/core/services/ocr2/plugins/ccip/prices/da_price_estimator_test.go b/core/services/ocr2/plugins/ccip/prices/da_price_estimator_test.go new file mode 100644 index 00000000000..2f8616a8669 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/prices/da_price_estimator_test.go @@ -0,0 +1,440 @@ +package prices + +import ( + "context" + "math/big" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/gas/rollups/mocks" +) + +func encodeGasPrice(daPrice, execPrice *big.Int) *big.Int { + return new(big.Int).Add(new(big.Int).Lsh(daPrice, daGasPriceEncodingLength), execPrice) +} + +func TestDAPriceEstimator_GetGasPrice(t *testing.T) { + ctx := context.Background() + + testCases := []struct { + name string + daGasPrice *big.Int + execGasPrice *big.Int + expPrice *big.Int + expErr bool + }{ + { + name: "base", + daGasPrice: big.NewInt(1), + execGasPrice: big.NewInt(0), + expPrice: encodeGasPrice(big.NewInt(1), big.NewInt(0)), + expErr: false, + }, + { + name: "large values", + daGasPrice: big.NewInt(1e9), // 1 gwei + execGasPrice: big.NewInt(200e9), // 200 gwei + expPrice: encodeGasPrice(big.NewInt(1e9), big.NewInt(200e9)), + expErr: false, + }, + { + name: "zero DA price", + daGasPrice: big.NewInt(0), + execGasPrice: big.NewInt(200e9), + expPrice: encodeGasPrice(big.NewInt(0), big.NewInt(200e9)), + expErr: false, + }, + { + name: "zero exec price", + daGasPrice: big.NewInt(1e9), + execGasPrice: big.NewInt(0), + expPrice: encodeGasPrice(big.NewInt(1e9), big.NewInt(0)), + expErr: false, + }, + { + name: "price out of bounds", + daGasPrice: new(big.Int).Lsh(big.NewInt(1), daGasPriceEncodingLength), + execGasPrice: big.NewInt(1), + expPrice: nil, + expErr: true, + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + execEstimator := NewMockGasPriceEstimator(t) + execEstimator.On("GetGasPrice", ctx).Return(tc.execGasPrice, nil) + + l1Oracle := mocks.NewL1Oracle(t) + l1Oracle.On("GasPrice", ctx).Return(assets.NewWei(tc.daGasPrice), nil) + + g := DAGasPriceEstimator{ + execEstimator: execEstimator, + l1Oracle: l1Oracle, + priceEncodingLength: daGasPriceEncodingLength, + } + + gasPrice, err := g.GetGasPrice(ctx) + if tc.expErr { + assert.Error(t, err) + return + } + assert.NoError(t, err) + assert.Equal(t, tc.expPrice, gasPrice) + }) + } + + t.Run("nil L1 oracle", func(t *testing.T) { + expPrice := big.NewInt(1) + + execEstimator := NewMockGasPriceEstimator(t) + execEstimator.On("GetGasPrice", ctx).Return(expPrice, nil) + + g := DAGasPriceEstimator{ + execEstimator: execEstimator, + l1Oracle: nil, + priceEncodingLength: daGasPriceEncodingLength, + } + + gasPrice, err := g.GetGasPrice(ctx) + assert.NoError(t, err) + assert.Equal(t, expPrice, gasPrice) + }) +} + +func TestDAPriceEstimator_DenoteInUSD(t *testing.T) { + val1e18 := func(val int64) *big.Int { return new(big.Int).Mul(big.NewInt(1e18), big.NewInt(val)) } + + testCases := []struct { + name string + gasPrice *big.Int + nativePrice *big.Int + expPrice *big.Int + }{ + { + name: "base", + gasPrice: encodeGasPrice(big.NewInt(1e9), big.NewInt(10e9)), + nativePrice: val1e18(2_000), + expPrice: encodeGasPrice(big.NewInt(2000e9), big.NewInt(20000e9)), + }, + { + name: "low price truncates to 0", + gasPrice: encodeGasPrice(big.NewInt(1e9), big.NewInt(10e9)), + nativePrice: big.NewInt(1), + expPrice: big.NewInt(0), + }, + { + name: "high price", + gasPrice: encodeGasPrice(val1e18(1), val1e18(10)), + nativePrice: val1e18(2000), + expPrice: encodeGasPrice(val1e18(2_000), val1e18(20_000)), + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + g := DAGasPriceEstimator{ + priceEncodingLength: daGasPriceEncodingLength, + } + + gasPrice, err := g.DenoteInUSD(tc.gasPrice, tc.nativePrice) + assert.NoError(t, err) + assert.True(t, tc.expPrice.Cmp(gasPrice) == 0) + }) + } +} + +func TestDAPriceEstimator_Median(t *testing.T) { + val1e18 := func(val int64) *big.Int { return new(big.Int).Mul(big.NewInt(1e18), big.NewInt(val)) } + + testCases := []struct { + name string + gasPrices []*big.Int + expMedian *big.Int + }{ + { + name: "base", + gasPrices: []*big.Int{ + encodeGasPrice(big.NewInt(1), big.NewInt(1)), + encodeGasPrice(big.NewInt(2), big.NewInt(2)), + encodeGasPrice(big.NewInt(3), big.NewInt(3)), + }, + expMedian: encodeGasPrice(big.NewInt(2), big.NewInt(2)), + }, + { + name: "median 2", + gasPrices: []*big.Int{ + encodeGasPrice(big.NewInt(1), big.NewInt(1)), + encodeGasPrice(big.NewInt(2), big.NewInt(2)), + }, + expMedian: encodeGasPrice(big.NewInt(2), big.NewInt(2)), + }, + { + name: "large values", + gasPrices: []*big.Int{ + encodeGasPrice(val1e18(5), val1e18(5)), + encodeGasPrice(val1e18(4), val1e18(4)), + encodeGasPrice(val1e18(3), val1e18(3)), + encodeGasPrice(val1e18(2), val1e18(2)), + encodeGasPrice(val1e18(1), val1e18(1)), + }, + expMedian: encodeGasPrice(val1e18(3), val1e18(3)), + }, + { + name: "zeros", + gasPrices: []*big.Int{big.NewInt(0), big.NewInt(0), big.NewInt(0)}, + expMedian: big.NewInt(0), + }, + { + name: "picks median of each price component individually", + gasPrices: []*big.Int{ + encodeGasPrice(val1e18(1), val1e18(3)), + encodeGasPrice(val1e18(2), val1e18(2)), + encodeGasPrice(val1e18(3), val1e18(1)), + }, + expMedian: encodeGasPrice(val1e18(2), val1e18(2)), + }, + { + name: "unsorted even number of price components", + gasPrices: []*big.Int{ + encodeGasPrice(val1e18(1), val1e18(22)), + encodeGasPrice(val1e18(4), val1e18(33)), + encodeGasPrice(val1e18(2), val1e18(44)), + encodeGasPrice(val1e18(3), val1e18(11)), + }, + expMedian: encodeGasPrice(val1e18(3), val1e18(33)), + }, + { + name: "equal DA price components", + gasPrices: []*big.Int{ + encodeGasPrice(val1e18(2), val1e18(22)), + encodeGasPrice(val1e18(2), val1e18(33)), + encodeGasPrice(val1e18(2), val1e18(44)), + encodeGasPrice(val1e18(2), val1e18(11)), + }, + expMedian: encodeGasPrice(val1e18(2), val1e18(33)), + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + g := DAGasPriceEstimator{ + priceEncodingLength: daGasPriceEncodingLength, + } + + gasPrice, err := g.Median(tc.gasPrices) + assert.NoError(t, err) + assert.True(t, tc.expMedian.Cmp(gasPrice) == 0) + }) + } +} + +func TestDAPriceEstimator_Deviates(t *testing.T) { + testCases := []struct { + name string + gasPrice1 *big.Int + gasPrice2 *big.Int + daDeviationPPB int64 + execDeviationPPB int64 + expDeviates bool + }{ + { + name: "base", + gasPrice1: encodeGasPrice(big.NewInt(100e8), big.NewInt(100e8)), + gasPrice2: encodeGasPrice(big.NewInt(79e8), big.NewInt(79e8)), + daDeviationPPB: 2e8, + execDeviationPPB: 2e8, + expDeviates: true, + }, + { + name: "negative difference also deviates", + gasPrice1: encodeGasPrice(big.NewInt(100e8), big.NewInt(100e8)), + gasPrice2: encodeGasPrice(big.NewInt(121e8), big.NewInt(121e8)), + daDeviationPPB: 2e8, + execDeviationPPB: 2e8, + expDeviates: true, + }, + { + name: "only DA component deviates", + gasPrice1: encodeGasPrice(big.NewInt(100e8), big.NewInt(100e8)), + gasPrice2: encodeGasPrice(big.NewInt(150e8), big.NewInt(110e8)), + daDeviationPPB: 2e8, + execDeviationPPB: 2e8, + expDeviates: true, + }, + { + name: "only exec component deviates", + gasPrice1: encodeGasPrice(big.NewInt(100e8), big.NewInt(100e8)), + gasPrice2: encodeGasPrice(big.NewInt(110e8), big.NewInt(150e8)), + daDeviationPPB: 2e8, + execDeviationPPB: 2e8, + expDeviates: true, + }, + { + name: "both do not deviate", + gasPrice1: encodeGasPrice(big.NewInt(100e8), big.NewInt(100e8)), + gasPrice2: encodeGasPrice(big.NewInt(110e8), big.NewInt(110e8)), + daDeviationPPB: 2e8, + execDeviationPPB: 2e8, + expDeviates: false, + }, + { + name: "zero DA price and exec deviates", + gasPrice1: encodeGasPrice(big.NewInt(0), big.NewInt(100e8)), + gasPrice2: encodeGasPrice(big.NewInt(0), big.NewInt(121e8)), + daDeviationPPB: 2e8, + execDeviationPPB: 2e8, + expDeviates: true, + }, + { + name: "zero DA price and exec does not deviate", + gasPrice1: encodeGasPrice(big.NewInt(0), big.NewInt(100e8)), + gasPrice2: encodeGasPrice(big.NewInt(0), big.NewInt(110e8)), + daDeviationPPB: 2e8, + execDeviationPPB: 2e8, + expDeviates: false, + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + g := DAGasPriceEstimator{ + execEstimator: ExecGasPriceEstimator{ + deviationPPB: tc.execDeviationPPB, + }, + daDeviationPPB: tc.daDeviationPPB, + priceEncodingLength: daGasPriceEncodingLength, + } + + deviated, err := g.Deviates(tc.gasPrice1, tc.gasPrice2) + assert.NoError(t, err) + if tc.expDeviates { + assert.True(t, deviated) + } else { + assert.False(t, deviated) + } + }) + } +} + +func TestDAPriceEstimator_EstimateMsgCostUSD(t *testing.T) { + execCostUSD := big.NewInt(100_000) + + testCases := []struct { + name string + gasPrice *big.Int + wrappedNativePrice *big.Int + msg cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta + daOverheadGas int64 + gasPerDAByte int64 + daMultiplier int64 + expUSD *big.Int + }{ + { + name: "only DA overhead", + gasPrice: encodeGasPrice(big.NewInt(1e9), big.NewInt(0)), // 1 gwei DA price, 0 exec price + wrappedNativePrice: big.NewInt(1e18), // $1 + msg: cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta{ + EVM2EVMMessage: cciptypes.EVM2EVMMessage{ + Data: []byte{}, + TokenAmounts: []cciptypes.TokenAmount{}, + SourceTokenData: [][]byte{}, + }, + }, + daOverheadGas: 100_000, + gasPerDAByte: 0, + daMultiplier: 10_000, // 1x multiplier + expUSD: new(big.Int).Add(execCostUSD, big.NewInt(100_000e9)), + }, + { + name: "include message data gas", + gasPrice: encodeGasPrice(big.NewInt(1e9), big.NewInt(0)), // 1 gwei DA price, 0 exec price + wrappedNativePrice: big.NewInt(1e18), // $1 + msg: cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta{ + EVM2EVMMessage: cciptypes.EVM2EVMMessage{ + Data: make([]byte, 1_000), + TokenAmounts: make([]cciptypes.TokenAmount, 5), + SourceTokenData: [][]byte{ + make([]byte, 10), make([]byte, 10), make([]byte, 10), make([]byte, 10), make([]byte, 10), + }, + }, + }, + daOverheadGas: 100_000, + gasPerDAByte: 16, + daMultiplier: 10_000, // 1x multiplier + expUSD: new(big.Int).Add(execCostUSD, big.NewInt(134_208e9)), + }, + { + name: "zero DA price", + gasPrice: big.NewInt(0), // 1 gwei DA price, 0 exec price + wrappedNativePrice: big.NewInt(1e18), // $1 + msg: cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta{ + EVM2EVMMessage: cciptypes.EVM2EVMMessage{ + Data: []byte{}, + TokenAmounts: []cciptypes.TokenAmount{}, + SourceTokenData: [][]byte{}, + }, + }, + daOverheadGas: 100_000, + gasPerDAByte: 16, + daMultiplier: 10_000, // 1x multiplier + expUSD: execCostUSD, + }, + { + name: "double native price", + gasPrice: encodeGasPrice(big.NewInt(1e9), big.NewInt(0)), // 1 gwei DA price, 0 exec price + wrappedNativePrice: big.NewInt(2e18), // $1 + msg: cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta{ + EVM2EVMMessage: cciptypes.EVM2EVMMessage{ + Data: []byte{}, + TokenAmounts: []cciptypes.TokenAmount{}, + SourceTokenData: [][]byte{}, + }, + }, + daOverheadGas: 100_000, + gasPerDAByte: 0, + daMultiplier: 10_000, // 1x multiplier + expUSD: new(big.Int).Add(execCostUSD, big.NewInt(200_000e9)), + }, + { + name: "half multiplier", + gasPrice: encodeGasPrice(big.NewInt(1e9), big.NewInt(0)), // 1 gwei DA price, 0 exec price + wrappedNativePrice: big.NewInt(1e18), // $1 + msg: cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta{ + EVM2EVMMessage: cciptypes.EVM2EVMMessage{ + Data: []byte{}, + TokenAmounts: []cciptypes.TokenAmount{}, + SourceTokenData: [][]byte{}, + }, + }, + daOverheadGas: 100_000, + gasPerDAByte: 0, + daMultiplier: 5_000, // 0.5x multiplier + expUSD: new(big.Int).Add(execCostUSD, big.NewInt(50_000e9)), + }, + } + + for _, tc := range testCases { + execEstimator := NewMockGasPriceEstimator(t) + execEstimator.On("EstimateMsgCostUSD", mock.Anything, tc.wrappedNativePrice, tc.msg).Return(execCostUSD, nil) + + t.Run(tc.name, func(t *testing.T) { + g := DAGasPriceEstimator{ + execEstimator: execEstimator, + l1Oracle: nil, + priceEncodingLength: daGasPriceEncodingLength, + daOverheadGas: tc.daOverheadGas, + gasPerDAByte: tc.gasPerDAByte, + daMultiplier: tc.daMultiplier, + } + + costUSD, err := g.EstimateMsgCostUSD(tc.gasPrice, tc.wrappedNativePrice, tc.msg) + assert.NoError(t, err) + assert.Equal(t, tc.expUSD, costUSD) + }) + } +} diff --git a/core/services/ocr2/plugins/ccip/prices/exec_price_estimator.go b/core/services/ocr2/plugins/ccip/prices/exec_price_estimator.go new file mode 100644 index 00000000000..84a6014bef3 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/prices/exec_price_estimator.go @@ -0,0 +1,65 @@ +package prices + +import ( + "context" + "fmt" + "math/big" + + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/gas" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipcalc" +) + +type ExecGasPriceEstimator struct { + estimator gas.EvmFeeEstimator + maxGasPrice *big.Int + deviationPPB int64 +} + +func NewExecGasPriceEstimator(estimator gas.EvmFeeEstimator, maxGasPrice *big.Int, deviationPPB int64) ExecGasPriceEstimator { + return ExecGasPriceEstimator{ + estimator: estimator, + maxGasPrice: maxGasPrice, + deviationPPB: deviationPPB, + } +} + +func (g ExecGasPriceEstimator) GetGasPrice(ctx context.Context) (*big.Int, error) { + gasPriceWei, _, err := g.estimator.GetFee(ctx, nil, 0, assets.NewWei(g.maxGasPrice), nil, nil) + if err != nil { + return nil, err + } + // Use legacy if no dynamic is available. + gasPrice := gasPriceWei.Legacy.ToInt() + if gasPriceWei.DynamicFeeCap != nil { + gasPrice = gasPriceWei.DynamicFeeCap.ToInt() + } + if gasPrice == nil { + return nil, fmt.Errorf("missing gas price %+v", gasPriceWei) + } + + return gasPrice, nil +} + +func (g ExecGasPriceEstimator) DenoteInUSD(p *big.Int, wrappedNativePrice *big.Int) (*big.Int, error) { + return ccipcalc.CalculateUsdPerUnitGas(p, wrappedNativePrice), nil +} + +func (g ExecGasPriceEstimator) Median(gasPrices []*big.Int) (*big.Int, error) { + return ccipcalc.BigIntSortedMiddle(gasPrices), nil +} + +func (g ExecGasPriceEstimator) Deviates(p1 *big.Int, p2 *big.Int) (bool, error) { + return ccipcalc.Deviates(p1, p2, g.deviationPPB), nil +} + +func (g ExecGasPriceEstimator) EstimateMsgCostUSD(p *big.Int, wrappedNativePrice *big.Int, msg cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta) (*big.Int, error) { + execGasAmount := new(big.Int).Add(big.NewInt(feeBoostingOverheadGas), msg.GasLimit) + execGasAmount = new(big.Int).Add(execGasAmount, new(big.Int).Mul(big.NewInt(int64(len(msg.Data))), big.NewInt(execGasPerPayloadByte))) + execGasAmount = new(big.Int).Add(execGasAmount, new(big.Int).Mul(big.NewInt(int64(len(msg.TokenAmounts))), big.NewInt(execGasPerToken))) + + execGasCost := new(big.Int).Mul(execGasAmount, p) + + return ccipcalc.CalculateUsdPerUnitGas(execGasCost, wrappedNativePrice), nil +} diff --git a/core/services/ocr2/plugins/ccip/prices/exec_price_estimator_test.go b/core/services/ocr2/plugins/ccip/prices/exec_price_estimator_test.go new file mode 100644 index 00000000000..f9ba1523e52 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/prices/exec_price_estimator_test.go @@ -0,0 +1,352 @@ +package prices + +import ( + "context" + "math/big" + "testing" + + "github.com/ethereum/go-ethereum/common" + "github.com/pkg/errors" + "github.com/stretchr/testify/assert" + + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/gas" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/gas/mocks" +) + +func TestExecPriceEstimator_GetGasPrice(t *testing.T) { + ctx := context.Background() + + testCases := []struct { + name string + sourceFeeEstimatorRespFee gas.EvmFee + sourceFeeEstimatorRespErr error + maxGasPrice *big.Int + expPrice *big.Int + expErr bool + }{ + { + name: "gets legacy gas price", + sourceFeeEstimatorRespFee: gas.EvmFee{ + Legacy: assets.NewWei(big.NewInt(10)), + DynamicFeeCap: nil, + }, + sourceFeeEstimatorRespErr: nil, + maxGasPrice: big.NewInt(1), + expPrice: big.NewInt(10), + expErr: false, + }, + { + name: "gets dynamic gas price", + sourceFeeEstimatorRespFee: gas.EvmFee{ + Legacy: nil, + DynamicFeeCap: assets.NewWei(big.NewInt(20)), + }, + sourceFeeEstimatorRespErr: nil, + maxGasPrice: big.NewInt(1), + expPrice: big.NewInt(20), + expErr: false, + }, + { + name: "gets dynamic gas price over legacy gas price", + sourceFeeEstimatorRespFee: gas.EvmFee{ + Legacy: assets.NewWei(big.NewInt(10)), + DynamicFeeCap: assets.NewWei(big.NewInt(20)), + }, + sourceFeeEstimatorRespErr: nil, + maxGasPrice: big.NewInt(1), + expPrice: big.NewInt(20), + expErr: false, + }, + { + name: "fee estimator error", + sourceFeeEstimatorRespFee: gas.EvmFee{ + Legacy: assets.NewWei(big.NewInt(10)), + DynamicFeeCap: nil, + }, + sourceFeeEstimatorRespErr: errors.New("fee estimator error"), + maxGasPrice: big.NewInt(1), + expPrice: nil, + expErr: true, + }, + { + name: "nil gas price error", + sourceFeeEstimatorRespFee: gas.EvmFee{ + Legacy: nil, + DynamicFeeCap: nil, + }, + sourceFeeEstimatorRespErr: nil, + maxGasPrice: big.NewInt(1), + expPrice: nil, + expErr: true, + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + sourceFeeEstimator := mocks.NewEvmFeeEstimator(t) + sourceFeeEstimator.On("GetFee", ctx, []byte(nil), uint64(0), assets.NewWei(tc.maxGasPrice), (*common.Address)(nil), (*common.Address)(nil)).Return( + tc.sourceFeeEstimatorRespFee, uint64(0), tc.sourceFeeEstimatorRespErr) + + g := ExecGasPriceEstimator{ + estimator: sourceFeeEstimator, + maxGasPrice: tc.maxGasPrice, + } + + gasPrice, err := g.GetGasPrice(ctx) + if tc.expErr { + assert.Nil(t, gasPrice) + assert.Error(t, err) + return + } + assert.NoError(t, err) + assert.Equal(t, tc.expPrice, gasPrice) + }) + } +} + +func TestExecPriceEstimator_DenoteInUSD(t *testing.T) { + val1e18 := func(val int64) *big.Int { return new(big.Int).Mul(big.NewInt(1e18), big.NewInt(val)) } + + testCases := []struct { + name string + gasPrice *big.Int + nativePrice *big.Int + expPrice *big.Int + }{ + { + name: "base", + gasPrice: big.NewInt(1e9), + nativePrice: val1e18(2_000), + expPrice: big.NewInt(2_000e9), + }, + { + name: "low price truncates to 0", + gasPrice: big.NewInt(1e9), + nativePrice: big.NewInt(1), + expPrice: big.NewInt(0), + }, + { + name: "high price", + gasPrice: val1e18(1), + nativePrice: val1e18(2_000), + expPrice: val1e18(2_000), + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + g := ExecGasPriceEstimator{} + + gasPrice, err := g.DenoteInUSD(tc.gasPrice, tc.nativePrice) + assert.NoError(t, err) + assert.True(t, tc.expPrice.Cmp(gasPrice) == 0) + }) + } +} + +func TestExecPriceEstimator_Median(t *testing.T) { + val1e18 := func(val int64) *big.Int { return new(big.Int).Mul(big.NewInt(1e18), big.NewInt(val)) } + + testCases := []struct { + name string + gasPrices []*big.Int + expMedian *big.Int + }{ + { + name: "base", + gasPrices: []*big.Int{big.NewInt(1), big.NewInt(2), big.NewInt(3)}, + expMedian: big.NewInt(2), + }, + { + name: "median 1", + gasPrices: []*big.Int{big.NewInt(1)}, + expMedian: big.NewInt(1), + }, + { + name: "median 2", + gasPrices: []*big.Int{big.NewInt(1), big.NewInt(2)}, + expMedian: big.NewInt(2), + }, + { + name: "large values", + gasPrices: []*big.Int{val1e18(5), val1e18(4), val1e18(3), val1e18(2), val1e18(1)}, + expMedian: val1e18(3), + }, + { + name: "zeros", + gasPrices: []*big.Int{big.NewInt(0), big.NewInt(0), big.NewInt(0)}, + expMedian: big.NewInt(0), + }, + { + name: "unsorted even number of prices", + gasPrices: []*big.Int{big.NewInt(4), big.NewInt(2), big.NewInt(3), big.NewInt(1)}, + expMedian: big.NewInt(3), + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + g := ExecGasPriceEstimator{} + + gasPrice, err := g.Median(tc.gasPrices) + assert.NoError(t, err) + assert.True(t, tc.expMedian.Cmp(gasPrice) == 0) + }) + } +} + +func TestExecPriceEstimator_Deviates(t *testing.T) { + testCases := []struct { + name string + gasPrice1 *big.Int + gasPrice2 *big.Int + deviationPPB int64 + expDeviates bool + }{ + { + name: "base", + gasPrice1: big.NewInt(100e8), + gasPrice2: big.NewInt(79e8), + deviationPPB: 2e8, + expDeviates: true, + }, + { + name: "negative difference also deviates", + gasPrice1: big.NewInt(100e8), + gasPrice2: big.NewInt(121e8), + deviationPPB: 2e8, + expDeviates: true, + }, + { + name: "larger difference deviates", + gasPrice1: big.NewInt(100e8), + gasPrice2: big.NewInt(70e8), + deviationPPB: 2e8, + expDeviates: true, + }, + { + name: "smaller difference does not deviate", + gasPrice1: big.NewInt(100e8), + gasPrice2: big.NewInt(90e8), + deviationPPB: 2e8, + expDeviates: false, + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + g := ExecGasPriceEstimator{ + deviationPPB: tc.deviationPPB, + } + + deviated, err := g.Deviates(tc.gasPrice1, tc.gasPrice2) + assert.NoError(t, err) + if tc.expDeviates { + assert.True(t, deviated) + } else { + assert.False(t, deviated) + } + }) + } +} + +func TestExecPriceEstimator_EstimateMsgCostUSD(t *testing.T) { + testCases := []struct { + name string + gasPrice *big.Int + wrappedNativePrice *big.Int + msg cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta + expUSD *big.Int + }{ + { + name: "base", + gasPrice: big.NewInt(1e9), // 1 gwei + wrappedNativePrice: big.NewInt(1e18), // $1 + msg: cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta{ + EVM2EVMMessage: cciptypes.EVM2EVMMessage{ + GasLimit: big.NewInt(100_000), + Data: []byte{}, + TokenAmounts: []cciptypes.TokenAmount{}, + }, + }, + expUSD: big.NewInt(300_000e9), + }, + { + name: "base with data", + gasPrice: big.NewInt(1e9), // 1 gwei + wrappedNativePrice: big.NewInt(1e18), // $1 + msg: cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta{ + EVM2EVMMessage: cciptypes.EVM2EVMMessage{ + GasLimit: big.NewInt(100_000), + Data: make([]byte, 1_000), + TokenAmounts: []cciptypes.TokenAmount{}, + }, + }, + expUSD: big.NewInt(316_000e9), + }, + { + name: "base with data and tokens", + gasPrice: big.NewInt(1e9), // 1 gwei + wrappedNativePrice: big.NewInt(1e18), // $1 + msg: cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta{ + EVM2EVMMessage: cciptypes.EVM2EVMMessage{ + GasLimit: big.NewInt(100_000), + Data: make([]byte, 1_000), + TokenAmounts: make([]cciptypes.TokenAmount, 5), + }, + }, + expUSD: big.NewInt(366_000e9), + }, + { + name: "empty msg", + gasPrice: big.NewInt(1e9), // 1 gwei + wrappedNativePrice: big.NewInt(1e18), // $1 + msg: cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta{ + EVM2EVMMessage: cciptypes.EVM2EVMMessage{ + GasLimit: big.NewInt(0), + Data: []byte{}, + TokenAmounts: []cciptypes.TokenAmount{}, + }, + }, + expUSD: big.NewInt(200_000e9), + }, + { + name: "double native price", + gasPrice: big.NewInt(1e9), // 1 gwei + wrappedNativePrice: big.NewInt(2e18), // $1 + msg: cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta{ + EVM2EVMMessage: cciptypes.EVM2EVMMessage{ + GasLimit: big.NewInt(0), + Data: []byte{}, + TokenAmounts: []cciptypes.TokenAmount{}, + }, + }, + expUSD: big.NewInt(400_000e9), + }, + { + name: "zero gas price", + gasPrice: big.NewInt(0), // 1 gwei + wrappedNativePrice: big.NewInt(1e18), // $1 + msg: cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta{ + EVM2EVMMessage: cciptypes.EVM2EVMMessage{ + GasLimit: big.NewInt(0), + Data: []byte{}, + TokenAmounts: []cciptypes.TokenAmount{}, + }, + }, + expUSD: big.NewInt(0), + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + g := ExecGasPriceEstimator{} + + costUSD, err := g.EstimateMsgCostUSD(tc.gasPrice, tc.wrappedNativePrice, tc.msg) + assert.NoError(t, err) + assert.Equal(t, tc.expUSD, costUSD) + }) + } +} diff --git a/core/services/ocr2/plugins/ccip/prices/gas_price_estimator.go b/core/services/ocr2/plugins/ccip/prices/gas_price_estimator.go new file mode 100644 index 00000000000..49a6fbcc4ad --- /dev/null +++ b/core/services/ocr2/plugins/ccip/prices/gas_price_estimator.go @@ -0,0 +1,59 @@ +package prices + +import ( + "math/big" + + "github.com/Masterminds/semver/v3" + "github.com/pkg/errors" + + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/gas" +) + +const ( + feeBoostingOverheadGas = 200_000 + // execGasPerToken is lower-bound estimation of ERC20 releaseOrMint gas cost (Mint with static minter). + // Use this in per-token gas cost calc as heuristic to simplify estimation logic. + execGasPerToken = 10_000 + // execGasPerPayloadByte is gas charged for passing each byte of `data` payload to CCIP receiver, ignores 4 gas per 0-byte rule. + // This can be a constant as it is part of EVM spec. Changes should be rare. + execGasPerPayloadByte = 16 + // evmMessageFixedBytes is byte size of fixed-size fields in EVM2EVMMessage + // Updating EVM2EVMMessage involves an offchain upgrade, safe to keep this as constant in code. + evmMessageFixedBytes = 448 + evmMessageBytesPerToken = 128 // Byte size of each token transfer, consisting of 1 EVMTokenAmount and 1 bytes, excl length of bytes + daMultiplierBase = int64(10000) // DA multiplier is in multiples of 0.0001, i.e. 1/daMultiplierBase + daGasPriceEncodingLength = 112 // Each gas price takes up at most GasPriceEncodingLength number of bits +) + +// GasPriceEstimatorCommit provides gasPriceEstimatorCommon + features needed in commit plugin, e.g. price deviation check. +type GasPriceEstimatorCommit interface { + cciptypes.GasPriceEstimatorCommit +} + +// GasPriceEstimatorExec provides gasPriceEstimatorCommon + features needed in exec plugin, e.g. message cost estimation. +type GasPriceEstimatorExec interface { + cciptypes.GasPriceEstimatorExec +} + +// GasPriceEstimator provides complete gas price estimator functions. +type GasPriceEstimator interface { + cciptypes.GasPriceEstimator +} + +func NewGasPriceEstimatorForCommitPlugin( + commitStoreVersion semver.Version, + estimator gas.EvmFeeEstimator, + maxExecGasPrice *big.Int, + daDeviationPPB int64, + execDeviationPPB int64, +) (GasPriceEstimatorCommit, error) { + switch commitStoreVersion.String() { + case "1.0.0", "1.1.0": + return NewExecGasPriceEstimator(estimator, maxExecGasPrice, execDeviationPPB), nil + case "1.2.0": + return NewDAGasPriceEstimator(estimator, maxExecGasPrice, execDeviationPPB, daDeviationPPB), nil + default: + return nil, errors.Errorf("Invalid commitStore version: %s", commitStoreVersion) + } +} diff --git a/core/services/ocr2/plugins/ccip/prices/gas_price_estimator_commit_mock.go b/core/services/ocr2/plugins/ccip/prices/gas_price_estimator_commit_mock.go new file mode 100644 index 00000000000..0a366a66ac2 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/prices/gas_price_estimator_commit_mock.go @@ -0,0 +1,269 @@ +// Code generated by mockery v2.43.2. DO NOT EDIT. + +package prices + +import ( + context "context" + big "math/big" + + mock "github.com/stretchr/testify/mock" +) + +// MockGasPriceEstimatorCommit is an autogenerated mock type for the GasPriceEstimatorCommit type +type MockGasPriceEstimatorCommit struct { + mock.Mock +} + +type MockGasPriceEstimatorCommit_Expecter struct { + mock *mock.Mock +} + +func (_m *MockGasPriceEstimatorCommit) EXPECT() *MockGasPriceEstimatorCommit_Expecter { + return &MockGasPriceEstimatorCommit_Expecter{mock: &_m.Mock} +} + +// DenoteInUSD provides a mock function with given fields: p, wrappedNativePrice +func (_m *MockGasPriceEstimatorCommit) DenoteInUSD(p *big.Int, wrappedNativePrice *big.Int) (*big.Int, error) { + ret := _m.Called(p, wrappedNativePrice) + + if len(ret) == 0 { + panic("no return value specified for DenoteInUSD") + } + + var r0 *big.Int + var r1 error + if rf, ok := ret.Get(0).(func(*big.Int, *big.Int) (*big.Int, error)); ok { + return rf(p, wrappedNativePrice) + } + if rf, ok := ret.Get(0).(func(*big.Int, *big.Int) *big.Int); ok { + r0 = rf(p, wrappedNativePrice) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*big.Int) + } + } + + if rf, ok := ret.Get(1).(func(*big.Int, *big.Int) error); ok { + r1 = rf(p, wrappedNativePrice) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockGasPriceEstimatorCommit_DenoteInUSD_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DenoteInUSD' +type MockGasPriceEstimatorCommit_DenoteInUSD_Call struct { + *mock.Call +} + +// DenoteInUSD is a helper method to define mock.On call +// - p *big.Int +// - wrappedNativePrice *big.Int +func (_e *MockGasPriceEstimatorCommit_Expecter) DenoteInUSD(p interface{}, wrappedNativePrice interface{}) *MockGasPriceEstimatorCommit_DenoteInUSD_Call { + return &MockGasPriceEstimatorCommit_DenoteInUSD_Call{Call: _e.mock.On("DenoteInUSD", p, wrappedNativePrice)} +} + +func (_c *MockGasPriceEstimatorCommit_DenoteInUSD_Call) Run(run func(p *big.Int, wrappedNativePrice *big.Int)) *MockGasPriceEstimatorCommit_DenoteInUSD_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*big.Int), args[1].(*big.Int)) + }) + return _c +} + +func (_c *MockGasPriceEstimatorCommit_DenoteInUSD_Call) Return(_a0 *big.Int, _a1 error) *MockGasPriceEstimatorCommit_DenoteInUSD_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockGasPriceEstimatorCommit_DenoteInUSD_Call) RunAndReturn(run func(*big.Int, *big.Int) (*big.Int, error)) *MockGasPriceEstimatorCommit_DenoteInUSD_Call { + _c.Call.Return(run) + return _c +} + +// Deviates provides a mock function with given fields: p1, p2 +func (_m *MockGasPriceEstimatorCommit) Deviates(p1 *big.Int, p2 *big.Int) (bool, error) { + ret := _m.Called(p1, p2) + + if len(ret) == 0 { + panic("no return value specified for Deviates") + } + + var r0 bool + var r1 error + if rf, ok := ret.Get(0).(func(*big.Int, *big.Int) (bool, error)); ok { + return rf(p1, p2) + } + if rf, ok := ret.Get(0).(func(*big.Int, *big.Int) bool); ok { + r0 = rf(p1, p2) + } else { + r0 = ret.Get(0).(bool) + } + + if rf, ok := ret.Get(1).(func(*big.Int, *big.Int) error); ok { + r1 = rf(p1, p2) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockGasPriceEstimatorCommit_Deviates_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Deviates' +type MockGasPriceEstimatorCommit_Deviates_Call struct { + *mock.Call +} + +// Deviates is a helper method to define mock.On call +// - p1 *big.Int +// - p2 *big.Int +func (_e *MockGasPriceEstimatorCommit_Expecter) Deviates(p1 interface{}, p2 interface{}) *MockGasPriceEstimatorCommit_Deviates_Call { + return &MockGasPriceEstimatorCommit_Deviates_Call{Call: _e.mock.On("Deviates", p1, p2)} +} + +func (_c *MockGasPriceEstimatorCommit_Deviates_Call) Run(run func(p1 *big.Int, p2 *big.Int)) *MockGasPriceEstimatorCommit_Deviates_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*big.Int), args[1].(*big.Int)) + }) + return _c +} + +func (_c *MockGasPriceEstimatorCommit_Deviates_Call) Return(_a0 bool, _a1 error) *MockGasPriceEstimatorCommit_Deviates_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockGasPriceEstimatorCommit_Deviates_Call) RunAndReturn(run func(*big.Int, *big.Int) (bool, error)) *MockGasPriceEstimatorCommit_Deviates_Call { + _c.Call.Return(run) + return _c +} + +// GetGasPrice provides a mock function with given fields: ctx +func (_m *MockGasPriceEstimatorCommit) GetGasPrice(ctx context.Context) (*big.Int, error) { + ret := _m.Called(ctx) + + if len(ret) == 0 { + panic("no return value specified for GetGasPrice") + } + + var r0 *big.Int + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (*big.Int, error)); ok { + return rf(ctx) + } + if rf, ok := ret.Get(0).(func(context.Context) *big.Int); ok { + r0 = rf(ctx) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*big.Int) + } + } + + if rf, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = rf(ctx) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockGasPriceEstimatorCommit_GetGasPrice_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetGasPrice' +type MockGasPriceEstimatorCommit_GetGasPrice_Call struct { + *mock.Call +} + +// GetGasPrice is a helper method to define mock.On call +// - ctx context.Context +func (_e *MockGasPriceEstimatorCommit_Expecter) GetGasPrice(ctx interface{}) *MockGasPriceEstimatorCommit_GetGasPrice_Call { + return &MockGasPriceEstimatorCommit_GetGasPrice_Call{Call: _e.mock.On("GetGasPrice", ctx)} +} + +func (_c *MockGasPriceEstimatorCommit_GetGasPrice_Call) Run(run func(ctx context.Context)) *MockGasPriceEstimatorCommit_GetGasPrice_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *MockGasPriceEstimatorCommit_GetGasPrice_Call) Return(_a0 *big.Int, _a1 error) *MockGasPriceEstimatorCommit_GetGasPrice_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockGasPriceEstimatorCommit_GetGasPrice_Call) RunAndReturn(run func(context.Context) (*big.Int, error)) *MockGasPriceEstimatorCommit_GetGasPrice_Call { + _c.Call.Return(run) + return _c +} + +// Median provides a mock function with given fields: gasPrices +func (_m *MockGasPriceEstimatorCommit) Median(gasPrices []*big.Int) (*big.Int, error) { + ret := _m.Called(gasPrices) + + if len(ret) == 0 { + panic("no return value specified for Median") + } + + var r0 *big.Int + var r1 error + if rf, ok := ret.Get(0).(func([]*big.Int) (*big.Int, error)); ok { + return rf(gasPrices) + } + if rf, ok := ret.Get(0).(func([]*big.Int) *big.Int); ok { + r0 = rf(gasPrices) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*big.Int) + } + } + + if rf, ok := ret.Get(1).(func([]*big.Int) error); ok { + r1 = rf(gasPrices) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockGasPriceEstimatorCommit_Median_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Median' +type MockGasPriceEstimatorCommit_Median_Call struct { + *mock.Call +} + +// Median is a helper method to define mock.On call +// - gasPrices []*big.Int +func (_e *MockGasPriceEstimatorCommit_Expecter) Median(gasPrices interface{}) *MockGasPriceEstimatorCommit_Median_Call { + return &MockGasPriceEstimatorCommit_Median_Call{Call: _e.mock.On("Median", gasPrices)} +} + +func (_c *MockGasPriceEstimatorCommit_Median_Call) Run(run func(gasPrices []*big.Int)) *MockGasPriceEstimatorCommit_Median_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].([]*big.Int)) + }) + return _c +} + +func (_c *MockGasPriceEstimatorCommit_Median_Call) Return(_a0 *big.Int, _a1 error) *MockGasPriceEstimatorCommit_Median_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockGasPriceEstimatorCommit_Median_Call) RunAndReturn(run func([]*big.Int) (*big.Int, error)) *MockGasPriceEstimatorCommit_Median_Call { + _c.Call.Return(run) + return _c +} + +// NewMockGasPriceEstimatorCommit creates a new instance of MockGasPriceEstimatorCommit. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewMockGasPriceEstimatorCommit(t interface { + mock.TestingT + Cleanup(func()) +}) *MockGasPriceEstimatorCommit { + mock := &MockGasPriceEstimatorCommit{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/core/services/ocr2/plugins/ccip/prices/gas_price_estimator_exec_mock.go b/core/services/ocr2/plugins/ccip/prices/gas_price_estimator_exec_mock.go new file mode 100644 index 00000000000..8f778555b17 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/prices/gas_price_estimator_exec_mock.go @@ -0,0 +1,274 @@ +// Code generated by mockery v2.43.2. DO NOT EDIT. + +package prices + +import ( + context "context" + big "math/big" + + ccip "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + + mock "github.com/stretchr/testify/mock" +) + +// MockGasPriceEstimatorExec is an autogenerated mock type for the GasPriceEstimatorExec type +type MockGasPriceEstimatorExec struct { + mock.Mock +} + +type MockGasPriceEstimatorExec_Expecter struct { + mock *mock.Mock +} + +func (_m *MockGasPriceEstimatorExec) EXPECT() *MockGasPriceEstimatorExec_Expecter { + return &MockGasPriceEstimatorExec_Expecter{mock: &_m.Mock} +} + +// DenoteInUSD provides a mock function with given fields: p, wrappedNativePrice +func (_m *MockGasPriceEstimatorExec) DenoteInUSD(p *big.Int, wrappedNativePrice *big.Int) (*big.Int, error) { + ret := _m.Called(p, wrappedNativePrice) + + if len(ret) == 0 { + panic("no return value specified for DenoteInUSD") + } + + var r0 *big.Int + var r1 error + if rf, ok := ret.Get(0).(func(*big.Int, *big.Int) (*big.Int, error)); ok { + return rf(p, wrappedNativePrice) + } + if rf, ok := ret.Get(0).(func(*big.Int, *big.Int) *big.Int); ok { + r0 = rf(p, wrappedNativePrice) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*big.Int) + } + } + + if rf, ok := ret.Get(1).(func(*big.Int, *big.Int) error); ok { + r1 = rf(p, wrappedNativePrice) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockGasPriceEstimatorExec_DenoteInUSD_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DenoteInUSD' +type MockGasPriceEstimatorExec_DenoteInUSD_Call struct { + *mock.Call +} + +// DenoteInUSD is a helper method to define mock.On call +// - p *big.Int +// - wrappedNativePrice *big.Int +func (_e *MockGasPriceEstimatorExec_Expecter) DenoteInUSD(p interface{}, wrappedNativePrice interface{}) *MockGasPriceEstimatorExec_DenoteInUSD_Call { + return &MockGasPriceEstimatorExec_DenoteInUSD_Call{Call: _e.mock.On("DenoteInUSD", p, wrappedNativePrice)} +} + +func (_c *MockGasPriceEstimatorExec_DenoteInUSD_Call) Run(run func(p *big.Int, wrappedNativePrice *big.Int)) *MockGasPriceEstimatorExec_DenoteInUSD_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*big.Int), args[1].(*big.Int)) + }) + return _c +} + +func (_c *MockGasPriceEstimatorExec_DenoteInUSD_Call) Return(_a0 *big.Int, _a1 error) *MockGasPriceEstimatorExec_DenoteInUSD_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockGasPriceEstimatorExec_DenoteInUSD_Call) RunAndReturn(run func(*big.Int, *big.Int) (*big.Int, error)) *MockGasPriceEstimatorExec_DenoteInUSD_Call { + _c.Call.Return(run) + return _c +} + +// EstimateMsgCostUSD provides a mock function with given fields: p, wrappedNativePrice, msg +func (_m *MockGasPriceEstimatorExec) EstimateMsgCostUSD(p *big.Int, wrappedNativePrice *big.Int, msg ccip.EVM2EVMOnRampCCIPSendRequestedWithMeta) (*big.Int, error) { + ret := _m.Called(p, wrappedNativePrice, msg) + + if len(ret) == 0 { + panic("no return value specified for EstimateMsgCostUSD") + } + + var r0 *big.Int + var r1 error + if rf, ok := ret.Get(0).(func(*big.Int, *big.Int, ccip.EVM2EVMOnRampCCIPSendRequestedWithMeta) (*big.Int, error)); ok { + return rf(p, wrappedNativePrice, msg) + } + if rf, ok := ret.Get(0).(func(*big.Int, *big.Int, ccip.EVM2EVMOnRampCCIPSendRequestedWithMeta) *big.Int); ok { + r0 = rf(p, wrappedNativePrice, msg) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*big.Int) + } + } + + if rf, ok := ret.Get(1).(func(*big.Int, *big.Int, ccip.EVM2EVMOnRampCCIPSendRequestedWithMeta) error); ok { + r1 = rf(p, wrappedNativePrice, msg) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockGasPriceEstimatorExec_EstimateMsgCostUSD_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EstimateMsgCostUSD' +type MockGasPriceEstimatorExec_EstimateMsgCostUSD_Call struct { + *mock.Call +} + +// EstimateMsgCostUSD is a helper method to define mock.On call +// - p *big.Int +// - wrappedNativePrice *big.Int +// - msg ccip.EVM2EVMOnRampCCIPSendRequestedWithMeta +func (_e *MockGasPriceEstimatorExec_Expecter) EstimateMsgCostUSD(p interface{}, wrappedNativePrice interface{}, msg interface{}) *MockGasPriceEstimatorExec_EstimateMsgCostUSD_Call { + return &MockGasPriceEstimatorExec_EstimateMsgCostUSD_Call{Call: _e.mock.On("EstimateMsgCostUSD", p, wrappedNativePrice, msg)} +} + +func (_c *MockGasPriceEstimatorExec_EstimateMsgCostUSD_Call) Run(run func(p *big.Int, wrappedNativePrice *big.Int, msg ccip.EVM2EVMOnRampCCIPSendRequestedWithMeta)) *MockGasPriceEstimatorExec_EstimateMsgCostUSD_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*big.Int), args[1].(*big.Int), args[2].(ccip.EVM2EVMOnRampCCIPSendRequestedWithMeta)) + }) + return _c +} + +func (_c *MockGasPriceEstimatorExec_EstimateMsgCostUSD_Call) Return(_a0 *big.Int, _a1 error) *MockGasPriceEstimatorExec_EstimateMsgCostUSD_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockGasPriceEstimatorExec_EstimateMsgCostUSD_Call) RunAndReturn(run func(*big.Int, *big.Int, ccip.EVM2EVMOnRampCCIPSendRequestedWithMeta) (*big.Int, error)) *MockGasPriceEstimatorExec_EstimateMsgCostUSD_Call { + _c.Call.Return(run) + return _c +} + +// GetGasPrice provides a mock function with given fields: ctx +func (_m *MockGasPriceEstimatorExec) GetGasPrice(ctx context.Context) (*big.Int, error) { + ret := _m.Called(ctx) + + if len(ret) == 0 { + panic("no return value specified for GetGasPrice") + } + + var r0 *big.Int + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (*big.Int, error)); ok { + return rf(ctx) + } + if rf, ok := ret.Get(0).(func(context.Context) *big.Int); ok { + r0 = rf(ctx) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*big.Int) + } + } + + if rf, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = rf(ctx) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockGasPriceEstimatorExec_GetGasPrice_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetGasPrice' +type MockGasPriceEstimatorExec_GetGasPrice_Call struct { + *mock.Call +} + +// GetGasPrice is a helper method to define mock.On call +// - ctx context.Context +func (_e *MockGasPriceEstimatorExec_Expecter) GetGasPrice(ctx interface{}) *MockGasPriceEstimatorExec_GetGasPrice_Call { + return &MockGasPriceEstimatorExec_GetGasPrice_Call{Call: _e.mock.On("GetGasPrice", ctx)} +} + +func (_c *MockGasPriceEstimatorExec_GetGasPrice_Call) Run(run func(ctx context.Context)) *MockGasPriceEstimatorExec_GetGasPrice_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *MockGasPriceEstimatorExec_GetGasPrice_Call) Return(_a0 *big.Int, _a1 error) *MockGasPriceEstimatorExec_GetGasPrice_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockGasPriceEstimatorExec_GetGasPrice_Call) RunAndReturn(run func(context.Context) (*big.Int, error)) *MockGasPriceEstimatorExec_GetGasPrice_Call { + _c.Call.Return(run) + return _c +} + +// Median provides a mock function with given fields: gasPrices +func (_m *MockGasPriceEstimatorExec) Median(gasPrices []*big.Int) (*big.Int, error) { + ret := _m.Called(gasPrices) + + if len(ret) == 0 { + panic("no return value specified for Median") + } + + var r0 *big.Int + var r1 error + if rf, ok := ret.Get(0).(func([]*big.Int) (*big.Int, error)); ok { + return rf(gasPrices) + } + if rf, ok := ret.Get(0).(func([]*big.Int) *big.Int); ok { + r0 = rf(gasPrices) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*big.Int) + } + } + + if rf, ok := ret.Get(1).(func([]*big.Int) error); ok { + r1 = rf(gasPrices) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockGasPriceEstimatorExec_Median_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Median' +type MockGasPriceEstimatorExec_Median_Call struct { + *mock.Call +} + +// Median is a helper method to define mock.On call +// - gasPrices []*big.Int +func (_e *MockGasPriceEstimatorExec_Expecter) Median(gasPrices interface{}) *MockGasPriceEstimatorExec_Median_Call { + return &MockGasPriceEstimatorExec_Median_Call{Call: _e.mock.On("Median", gasPrices)} +} + +func (_c *MockGasPriceEstimatorExec_Median_Call) Run(run func(gasPrices []*big.Int)) *MockGasPriceEstimatorExec_Median_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].([]*big.Int)) + }) + return _c +} + +func (_c *MockGasPriceEstimatorExec_Median_Call) Return(_a0 *big.Int, _a1 error) *MockGasPriceEstimatorExec_Median_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockGasPriceEstimatorExec_Median_Call) RunAndReturn(run func([]*big.Int) (*big.Int, error)) *MockGasPriceEstimatorExec_Median_Call { + _c.Call.Return(run) + return _c +} + +// NewMockGasPriceEstimatorExec creates a new instance of MockGasPriceEstimatorExec. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewMockGasPriceEstimatorExec(t interface { + mock.TestingT + Cleanup(func()) +}) *MockGasPriceEstimatorExec { + mock := &MockGasPriceEstimatorExec{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/core/services/ocr2/plugins/ccip/prices/gas_price_estimator_mock.go b/core/services/ocr2/plugins/ccip/prices/gas_price_estimator_mock.go new file mode 100644 index 00000000000..a513083319d --- /dev/null +++ b/core/services/ocr2/plugins/ccip/prices/gas_price_estimator_mock.go @@ -0,0 +1,331 @@ +// Code generated by mockery v2.43.2. DO NOT EDIT. + +package prices + +import ( + context "context" + big "math/big" + + ccip "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + + mock "github.com/stretchr/testify/mock" +) + +// MockGasPriceEstimator is an autogenerated mock type for the GasPriceEstimator type +type MockGasPriceEstimator struct { + mock.Mock +} + +type MockGasPriceEstimator_Expecter struct { + mock *mock.Mock +} + +func (_m *MockGasPriceEstimator) EXPECT() *MockGasPriceEstimator_Expecter { + return &MockGasPriceEstimator_Expecter{mock: &_m.Mock} +} + +// DenoteInUSD provides a mock function with given fields: p, wrappedNativePrice +func (_m *MockGasPriceEstimator) DenoteInUSD(p *big.Int, wrappedNativePrice *big.Int) (*big.Int, error) { + ret := _m.Called(p, wrappedNativePrice) + + if len(ret) == 0 { + panic("no return value specified for DenoteInUSD") + } + + var r0 *big.Int + var r1 error + if rf, ok := ret.Get(0).(func(*big.Int, *big.Int) (*big.Int, error)); ok { + return rf(p, wrappedNativePrice) + } + if rf, ok := ret.Get(0).(func(*big.Int, *big.Int) *big.Int); ok { + r0 = rf(p, wrappedNativePrice) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*big.Int) + } + } + + if rf, ok := ret.Get(1).(func(*big.Int, *big.Int) error); ok { + r1 = rf(p, wrappedNativePrice) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockGasPriceEstimator_DenoteInUSD_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DenoteInUSD' +type MockGasPriceEstimator_DenoteInUSD_Call struct { + *mock.Call +} + +// DenoteInUSD is a helper method to define mock.On call +// - p *big.Int +// - wrappedNativePrice *big.Int +func (_e *MockGasPriceEstimator_Expecter) DenoteInUSD(p interface{}, wrappedNativePrice interface{}) *MockGasPriceEstimator_DenoteInUSD_Call { + return &MockGasPriceEstimator_DenoteInUSD_Call{Call: _e.mock.On("DenoteInUSD", p, wrappedNativePrice)} +} + +func (_c *MockGasPriceEstimator_DenoteInUSD_Call) Run(run func(p *big.Int, wrappedNativePrice *big.Int)) *MockGasPriceEstimator_DenoteInUSD_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*big.Int), args[1].(*big.Int)) + }) + return _c +} + +func (_c *MockGasPriceEstimator_DenoteInUSD_Call) Return(_a0 *big.Int, _a1 error) *MockGasPriceEstimator_DenoteInUSD_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockGasPriceEstimator_DenoteInUSD_Call) RunAndReturn(run func(*big.Int, *big.Int) (*big.Int, error)) *MockGasPriceEstimator_DenoteInUSD_Call { + _c.Call.Return(run) + return _c +} + +// Deviates provides a mock function with given fields: p1, p2 +func (_m *MockGasPriceEstimator) Deviates(p1 *big.Int, p2 *big.Int) (bool, error) { + ret := _m.Called(p1, p2) + + if len(ret) == 0 { + panic("no return value specified for Deviates") + } + + var r0 bool + var r1 error + if rf, ok := ret.Get(0).(func(*big.Int, *big.Int) (bool, error)); ok { + return rf(p1, p2) + } + if rf, ok := ret.Get(0).(func(*big.Int, *big.Int) bool); ok { + r0 = rf(p1, p2) + } else { + r0 = ret.Get(0).(bool) + } + + if rf, ok := ret.Get(1).(func(*big.Int, *big.Int) error); ok { + r1 = rf(p1, p2) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockGasPriceEstimator_Deviates_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Deviates' +type MockGasPriceEstimator_Deviates_Call struct { + *mock.Call +} + +// Deviates is a helper method to define mock.On call +// - p1 *big.Int +// - p2 *big.Int +func (_e *MockGasPriceEstimator_Expecter) Deviates(p1 interface{}, p2 interface{}) *MockGasPriceEstimator_Deviates_Call { + return &MockGasPriceEstimator_Deviates_Call{Call: _e.mock.On("Deviates", p1, p2)} +} + +func (_c *MockGasPriceEstimator_Deviates_Call) Run(run func(p1 *big.Int, p2 *big.Int)) *MockGasPriceEstimator_Deviates_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*big.Int), args[1].(*big.Int)) + }) + return _c +} + +func (_c *MockGasPriceEstimator_Deviates_Call) Return(_a0 bool, _a1 error) *MockGasPriceEstimator_Deviates_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockGasPriceEstimator_Deviates_Call) RunAndReturn(run func(*big.Int, *big.Int) (bool, error)) *MockGasPriceEstimator_Deviates_Call { + _c.Call.Return(run) + return _c +} + +// EstimateMsgCostUSD provides a mock function with given fields: p, wrappedNativePrice, msg +func (_m *MockGasPriceEstimator) EstimateMsgCostUSD(p *big.Int, wrappedNativePrice *big.Int, msg ccip.EVM2EVMOnRampCCIPSendRequestedWithMeta) (*big.Int, error) { + ret := _m.Called(p, wrappedNativePrice, msg) + + if len(ret) == 0 { + panic("no return value specified for EstimateMsgCostUSD") + } + + var r0 *big.Int + var r1 error + if rf, ok := ret.Get(0).(func(*big.Int, *big.Int, ccip.EVM2EVMOnRampCCIPSendRequestedWithMeta) (*big.Int, error)); ok { + return rf(p, wrappedNativePrice, msg) + } + if rf, ok := ret.Get(0).(func(*big.Int, *big.Int, ccip.EVM2EVMOnRampCCIPSendRequestedWithMeta) *big.Int); ok { + r0 = rf(p, wrappedNativePrice, msg) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*big.Int) + } + } + + if rf, ok := ret.Get(1).(func(*big.Int, *big.Int, ccip.EVM2EVMOnRampCCIPSendRequestedWithMeta) error); ok { + r1 = rf(p, wrappedNativePrice, msg) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockGasPriceEstimator_EstimateMsgCostUSD_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EstimateMsgCostUSD' +type MockGasPriceEstimator_EstimateMsgCostUSD_Call struct { + *mock.Call +} + +// EstimateMsgCostUSD is a helper method to define mock.On call +// - p *big.Int +// - wrappedNativePrice *big.Int +// - msg ccip.EVM2EVMOnRampCCIPSendRequestedWithMeta +func (_e *MockGasPriceEstimator_Expecter) EstimateMsgCostUSD(p interface{}, wrappedNativePrice interface{}, msg interface{}) *MockGasPriceEstimator_EstimateMsgCostUSD_Call { + return &MockGasPriceEstimator_EstimateMsgCostUSD_Call{Call: _e.mock.On("EstimateMsgCostUSD", p, wrappedNativePrice, msg)} +} + +func (_c *MockGasPriceEstimator_EstimateMsgCostUSD_Call) Run(run func(p *big.Int, wrappedNativePrice *big.Int, msg ccip.EVM2EVMOnRampCCIPSendRequestedWithMeta)) *MockGasPriceEstimator_EstimateMsgCostUSD_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*big.Int), args[1].(*big.Int), args[2].(ccip.EVM2EVMOnRampCCIPSendRequestedWithMeta)) + }) + return _c +} + +func (_c *MockGasPriceEstimator_EstimateMsgCostUSD_Call) Return(_a0 *big.Int, _a1 error) *MockGasPriceEstimator_EstimateMsgCostUSD_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockGasPriceEstimator_EstimateMsgCostUSD_Call) RunAndReturn(run func(*big.Int, *big.Int, ccip.EVM2EVMOnRampCCIPSendRequestedWithMeta) (*big.Int, error)) *MockGasPriceEstimator_EstimateMsgCostUSD_Call { + _c.Call.Return(run) + return _c +} + +// GetGasPrice provides a mock function with given fields: ctx +func (_m *MockGasPriceEstimator) GetGasPrice(ctx context.Context) (*big.Int, error) { + ret := _m.Called(ctx) + + if len(ret) == 0 { + panic("no return value specified for GetGasPrice") + } + + var r0 *big.Int + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (*big.Int, error)); ok { + return rf(ctx) + } + if rf, ok := ret.Get(0).(func(context.Context) *big.Int); ok { + r0 = rf(ctx) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*big.Int) + } + } + + if rf, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = rf(ctx) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockGasPriceEstimator_GetGasPrice_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetGasPrice' +type MockGasPriceEstimator_GetGasPrice_Call struct { + *mock.Call +} + +// GetGasPrice is a helper method to define mock.On call +// - ctx context.Context +func (_e *MockGasPriceEstimator_Expecter) GetGasPrice(ctx interface{}) *MockGasPriceEstimator_GetGasPrice_Call { + return &MockGasPriceEstimator_GetGasPrice_Call{Call: _e.mock.On("GetGasPrice", ctx)} +} + +func (_c *MockGasPriceEstimator_GetGasPrice_Call) Run(run func(ctx context.Context)) *MockGasPriceEstimator_GetGasPrice_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *MockGasPriceEstimator_GetGasPrice_Call) Return(_a0 *big.Int, _a1 error) *MockGasPriceEstimator_GetGasPrice_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockGasPriceEstimator_GetGasPrice_Call) RunAndReturn(run func(context.Context) (*big.Int, error)) *MockGasPriceEstimator_GetGasPrice_Call { + _c.Call.Return(run) + return _c +} + +// Median provides a mock function with given fields: gasPrices +func (_m *MockGasPriceEstimator) Median(gasPrices []*big.Int) (*big.Int, error) { + ret := _m.Called(gasPrices) + + if len(ret) == 0 { + panic("no return value specified for Median") + } + + var r0 *big.Int + var r1 error + if rf, ok := ret.Get(0).(func([]*big.Int) (*big.Int, error)); ok { + return rf(gasPrices) + } + if rf, ok := ret.Get(0).(func([]*big.Int) *big.Int); ok { + r0 = rf(gasPrices) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*big.Int) + } + } + + if rf, ok := ret.Get(1).(func([]*big.Int) error); ok { + r1 = rf(gasPrices) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockGasPriceEstimator_Median_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Median' +type MockGasPriceEstimator_Median_Call struct { + *mock.Call +} + +// Median is a helper method to define mock.On call +// - gasPrices []*big.Int +func (_e *MockGasPriceEstimator_Expecter) Median(gasPrices interface{}) *MockGasPriceEstimator_Median_Call { + return &MockGasPriceEstimator_Median_Call{Call: _e.mock.On("Median", gasPrices)} +} + +func (_c *MockGasPriceEstimator_Median_Call) Run(run func(gasPrices []*big.Int)) *MockGasPriceEstimator_Median_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].([]*big.Int)) + }) + return _c +} + +func (_c *MockGasPriceEstimator_Median_Call) Return(_a0 *big.Int, _a1 error) *MockGasPriceEstimator_Median_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockGasPriceEstimator_Median_Call) RunAndReturn(run func([]*big.Int) (*big.Int, error)) *MockGasPriceEstimator_Median_Call { + _c.Call.Return(run) + return _c +} + +// NewMockGasPriceEstimator creates a new instance of MockGasPriceEstimator. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewMockGasPriceEstimator(t interface { + mock.TestingT + Cleanup(func()) +}) *MockGasPriceEstimator { + mock := &MockGasPriceEstimator{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/core/services/ocr2/plugins/ccip/proxycommitstore.go b/core/services/ocr2/plugins/ccip/proxycommitstore.go new file mode 100644 index 00000000000..b06f957bd58 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/proxycommitstore.go @@ -0,0 +1,135 @@ +package ccip + +import ( + "context" + "fmt" + "io" + "math/big" + "time" + + "go.uber.org/multierr" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/gas" + + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" +) + +// The disjunct methods in IncompleteSourceCommitStoreReader and IncompleteDestCommitStoreReader satisfy the full +// CommitStoreReader iface in Union +var _ cciptypes.CommitStoreReader = (*ProviderProxyCommitStoreReader)(nil) + +// ProviderProxyCommitStoreReader is a CommitStoreReader that proxies to two custom provider grpc backed implementations +// of a CommitStoreReader. +// [ProviderProxyCommitStoreReader] lives in the memory space of the reporting plugin factory and reporting plugin, and should have no chain-specific details. +// Why? Historical implementations of a commit store consumed in reporting plugins mixed usage of a gas estimator from +// the source relayer and contract read and write abilities to a dest relayer. This is not valid in LOOP world. +type ProviderProxyCommitStoreReader struct { + srcCommitStoreReader IncompleteSourceCommitStoreReader + dstCommitStoreReader IncompleteDestCommitStoreReader +} + +// IncompleteSourceCommitStoreReader contains only the methods of CommitStoreReader that are serviced by the source chain/relayer. +type IncompleteSourceCommitStoreReader interface { + ChangeConfig(ctx context.Context, onchainConfig []byte, offchainConfig []byte) (cciptypes.Address, error) + GasPriceEstimator(ctx context.Context) (cciptypes.GasPriceEstimatorCommit, error) + OffchainConfig(ctx context.Context) (cciptypes.CommitOffchainConfig, error) + io.Closer +} + +// IncompleteDestCommitStoreReader contains only the methods of CommitStoreReader that are serviced by the dest chain/relayer. +type IncompleteDestCommitStoreReader interface { + DecodeCommitReport(ctx context.Context, report []byte) (cciptypes.CommitStoreReport, error) + EncodeCommitReport(ctx context.Context, report cciptypes.CommitStoreReport) ([]byte, error) + GetAcceptedCommitReportsGteTimestamp(ctx context.Context, ts time.Time, confirmations int) ([]cciptypes.CommitStoreReportWithTxMeta, error) + GetCommitReportMatchingSeqNum(ctx context.Context, seqNum uint64, confirmations int) ([]cciptypes.CommitStoreReportWithTxMeta, error) + GetCommitStoreStaticConfig(ctx context.Context) (cciptypes.CommitStoreStaticConfig, error) + GetExpectedNextSequenceNumber(ctx context.Context) (uint64, error) + GetLatestPriceEpochAndRound(ctx context.Context) (uint64, error) + IsBlessed(ctx context.Context, root [32]byte) (bool, error) + IsDestChainHealthy(ctx context.Context) (bool, error) + IsDown(ctx context.Context) (bool, error) + VerifyExecutionReport(ctx context.Context, report cciptypes.ExecReport) (bool, error) + io.Closer +} + +func NewProviderProxyCommitStoreReader(srcReader cciptypes.CommitStoreReader, dstReader cciptypes.CommitStoreReader) *ProviderProxyCommitStoreReader { + return &ProviderProxyCommitStoreReader{ + srcCommitStoreReader: srcReader, + dstCommitStoreReader: dstReader, + } +} + +// ChangeConfig updates the offchainConfig values for the source relayer gas estimator by calling ChangeConfig +// on the source relayer. Once this is called, GasPriceEstimator and OffchainConfig can be called. +func (p *ProviderProxyCommitStoreReader) ChangeConfig(ctx context.Context, onchainConfig []byte, offchainConfig []byte) (cciptypes.Address, error) { + return p.srcCommitStoreReader.ChangeConfig(ctx, onchainConfig, offchainConfig) +} + +func (p *ProviderProxyCommitStoreReader) DecodeCommitReport(ctx context.Context, report []byte) (cciptypes.CommitStoreReport, error) { + return p.dstCommitStoreReader.DecodeCommitReport(ctx, report) +} + +func (p *ProviderProxyCommitStoreReader) EncodeCommitReport(ctx context.Context, report cciptypes.CommitStoreReport) ([]byte, error) { + return p.dstCommitStoreReader.EncodeCommitReport(ctx, report) +} + +// GasPriceEstimator constructs a gas price estimator on the source relayer +func (p *ProviderProxyCommitStoreReader) GasPriceEstimator(ctx context.Context) (cciptypes.GasPriceEstimatorCommit, error) { + return p.srcCommitStoreReader.GasPriceEstimator(ctx) +} + +func (p *ProviderProxyCommitStoreReader) GetAcceptedCommitReportsGteTimestamp(ctx context.Context, ts time.Time, confirmations int) ([]cciptypes.CommitStoreReportWithTxMeta, error) { + return p.dstCommitStoreReader.GetAcceptedCommitReportsGteTimestamp(ctx, ts, confirmations) +} + +func (p *ProviderProxyCommitStoreReader) GetCommitReportMatchingSeqNum(ctx context.Context, seqNum uint64, confirmations int) ([]cciptypes.CommitStoreReportWithTxMeta, error) { + return p.dstCommitStoreReader.GetCommitReportMatchingSeqNum(ctx, seqNum, confirmations) +} + +func (p *ProviderProxyCommitStoreReader) GetCommitStoreStaticConfig(ctx context.Context) (cciptypes.CommitStoreStaticConfig, error) { + return p.dstCommitStoreReader.GetCommitStoreStaticConfig(ctx) +} + +func (p *ProviderProxyCommitStoreReader) GetExpectedNextSequenceNumber(ctx context.Context) (uint64, error) { + return p.dstCommitStoreReader.GetExpectedNextSequenceNumber(ctx) +} + +func (p *ProviderProxyCommitStoreReader) GetLatestPriceEpochAndRound(ctx context.Context) (uint64, error) { + return p.dstCommitStoreReader.GetLatestPriceEpochAndRound(ctx) +} + +func (p *ProviderProxyCommitStoreReader) IsBlessed(ctx context.Context, root [32]byte) (bool, error) { + return p.dstCommitStoreReader.IsBlessed(ctx, root) +} + +func (p *ProviderProxyCommitStoreReader) IsDestChainHealthy(ctx context.Context) (bool, error) { + return p.dstCommitStoreReader.IsDestChainHealthy(ctx) +} + +func (p *ProviderProxyCommitStoreReader) IsDown(ctx context.Context) (bool, error) { + return p.dstCommitStoreReader.IsDown(ctx) +} + +func (p *ProviderProxyCommitStoreReader) OffchainConfig(ctx context.Context) (cciptypes.CommitOffchainConfig, error) { + return p.srcCommitStoreReader.OffchainConfig(ctx) +} + +func (p *ProviderProxyCommitStoreReader) VerifyExecutionReport(ctx context.Context, report cciptypes.ExecReport) (bool, error) { + return p.dstCommitStoreReader.VerifyExecutionReport(ctx, report) +} + +// SetGasEstimator is invalid on ProviderProxyCommitStoreReader. The provider based impl's do not have SetGasEstimator +// defined, so this serves no purpose other than satisfying an interface. +func (p *ProviderProxyCommitStoreReader) SetGasEstimator(ctx context.Context, gpe gas.EvmFeeEstimator) error { + return fmt.Errorf("invalid usage of ProviderProxyCommitStoreReader") +} + +// SetSourceMaxGasPrice is invalid on ProviderProxyCommitStoreReader. The provider based impl's do not have SetSourceMaxGasPrice +// defined, so this serves no purpose other than satisfying an interface. +func (p *ProviderProxyCommitStoreReader) SetSourceMaxGasPrice(ctx context.Context, sourceMaxGasPrice *big.Int) error { + return fmt.Errorf("invalid usage of ProviderProxyCommitStoreReader") +} + +func (p *ProviderProxyCommitStoreReader) Close() error { + return multierr.Append(p.srcCommitStoreReader.Close(), p.dstCommitStoreReader.Close()) +} diff --git a/core/services/ocr2/plugins/ccip/testhelpers/ccip_contracts.go b/core/services/ocr2/plugins/ccip/testhelpers/ccip_contracts.go new file mode 100644 index 00000000000..08020282c39 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/testhelpers/ccip_contracts.go @@ -0,0 +1,1607 @@ +package testhelpers + +import ( + "context" + "fmt" + "math" + "math/big" + "testing" + "time" + + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/accounts/abi/bind/backends" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/core/types" + "github.com/pkg/errors" + "github.com/rs/zerolog/log" + "github.com/stretchr/testify/require" + + "github.com/smartcontractkit/libocr/offchainreporting2/confighelper" + ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2/types" + ocr2types "github.com/smartcontractkit/libocr/offchainreporting2plus/types" + + "github.com/smartcontractkit/chainlink-common/pkg/config" + + "github.com/smartcontractkit/chainlink-common/pkg/hashutil" + "github.com/smartcontractkit/chainlink-common/pkg/merklemulti" + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/commit_store" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/commit_store_helper" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/commit_store_helper_1_2_0" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/evm_2_evm_offramp" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/evm_2_evm_onramp" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/evm_2_evm_onramp_1_2_0" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/lock_release_token_pool" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/maybe_revert_message_receiver" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/mock_rmn_contract" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/price_registry_1_2_0" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/rmn_proxy_contract" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/router" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/token_admin_registry" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/weth9" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/link_token_interface" + "github.com/smartcontractkit/chainlink/v2/core/logger" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/abihelpers" + ccipconfig "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/config" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_5_0" +) + +var ( + // Source + SourcePool = "source Link pool" + SourcePriceRegistry = "source PriceRegistry" + OnRamp = "onramp" + OnRampNative = "onramp-native" + SourceRouter = "source router" + + // Dest + OffRamp = "offramp" + DestPool = "dest Link pool" + + Receiver = "receiver" + Sender = "sender" + Link = func(amount int64) *big.Int { return new(big.Int).Mul(big.NewInt(1e18), big.NewInt(amount)) } + HundredLink = Link(100) + LinkUSDValue = func(amount int64) *big.Int { return new(big.Int).Mul(big.NewInt(1e18), big.NewInt(amount)) } + SourceChainID = uint64(1000) + SourceChainSelector = uint64(11787463284727550157) + DestChainID = uint64(1337) + DestChainSelector = uint64(3379446385462418246) +) + +// Backwards compat, in principle these statuses are version dependent +// TODO: Adjust integration tests to be version agnostic using readers +var ( + ExecutionStateSuccess = MessageExecutionState(cciptypes.ExecutionStateSuccess) + ExecutionStateFailure = MessageExecutionState(cciptypes.ExecutionStateFailure) +) + +type MessageExecutionState cciptypes.MessageExecutionState +type CommitOffchainConfig struct { + v1_2_0.JSONCommitOffchainConfig +} + +func (c CommitOffchainConfig) Encode() ([]byte, error) { + return ccipconfig.EncodeOffchainConfig(c.JSONCommitOffchainConfig) +} + +func NewCommitOffchainConfig( + GasPriceHeartBeat config.Duration, + DAGasPriceDeviationPPB uint32, + ExecGasPriceDeviationPPB uint32, + TokenPriceHeartBeat config.Duration, + TokenPriceDeviationPPB uint32, + InflightCacheExpiry config.Duration, + priceReportingDisabled bool) CommitOffchainConfig { + return CommitOffchainConfig{v1_2_0.JSONCommitOffchainConfig{ + GasPriceHeartBeat: GasPriceHeartBeat, + DAGasPriceDeviationPPB: DAGasPriceDeviationPPB, + ExecGasPriceDeviationPPB: ExecGasPriceDeviationPPB, + TokenPriceHeartBeat: TokenPriceHeartBeat, + TokenPriceDeviationPPB: TokenPriceDeviationPPB, + InflightCacheExpiry: InflightCacheExpiry, + PriceReportingDisabled: priceReportingDisabled, + }} +} + +type CommitOnchainConfig struct { + ccipdata.CommitOnchainConfig +} + +func NewCommitOnchainConfig( + PriceRegistry common.Address, +) CommitOnchainConfig { + return CommitOnchainConfig{ccipdata.CommitOnchainConfig{ + PriceRegistry: PriceRegistry, + }} +} + +type ExecOnchainConfig struct { + v1_5_0.ExecOnchainConfig +} + +func NewExecOnchainConfig(PermissionLessExecutionThresholdSeconds uint32, Router common.Address, PriceRegistry common.Address, MaxNumberOfTokensPerMsg uint16, MaxDataBytes uint32) ExecOnchainConfig { + return ExecOnchainConfig{v1_5_0.ExecOnchainConfig{ + PermissionLessExecutionThresholdSeconds: PermissionLessExecutionThresholdSeconds, + Router: Router, + PriceRegistry: PriceRegistry, + MaxNumberOfTokensPerMsg: MaxNumberOfTokensPerMsg, + MaxDataBytes: MaxDataBytes, + }} +} + +type ExecOffchainConfig struct { + v1_2_0.JSONExecOffchainConfig +} + +func (c ExecOffchainConfig) Encode() ([]byte, error) { + return ccipconfig.EncodeOffchainConfig(c.JSONExecOffchainConfig) +} + +func NewExecOffchainConfig( + DestOptimisticConfirmations uint32, + BatchGasLimit uint32, + RelativeBoostPerWaitHour float64, + InflightCacheExpiry config.Duration, + RootSnoozeTime config.Duration, + BatchingStrategyID uint32, +) ExecOffchainConfig { + return ExecOffchainConfig{v1_2_0.JSONExecOffchainConfig{ + DestOptimisticConfirmations: DestOptimisticConfirmations, + BatchGasLimit: BatchGasLimit, + RelativeBoostPerWaitHour: RelativeBoostPerWaitHour, + InflightCacheExpiry: InflightCacheExpiry, + RootSnoozeTime: RootSnoozeTime, + BatchingStrategyID: BatchingStrategyID, + }} +} + +type MaybeRevertReceiver struct { + Receiver *maybe_revert_message_receiver.MaybeRevertMessageReceiver + Strict bool +} + +type Common struct { + ChainID uint64 + ChainSelector uint64 + User *bind.TransactOpts + Chain *backends.SimulatedBackend + LinkToken *link_token_interface.LinkToken + LinkTokenPool *lock_release_token_pool.LockReleaseTokenPool + CustomToken *link_token_interface.LinkToken + WrappedNative *weth9.WETH9 + WrappedNativePool *lock_release_token_pool.LockReleaseTokenPool + ARM *mock_rmn_contract.MockRMNContract + ARMProxy *rmn_proxy_contract.RMNProxyContract + PriceRegistry *price_registry_1_2_0.PriceRegistry + TokenAdminRegistry *token_admin_registry.TokenAdminRegistry + FinalityDepth uint32 +} + +type SourceChain struct { + Common + Router *router.Router + OnRamp *evm_2_evm_onramp.EVM2EVMOnRamp +} + +type DestinationChain struct { + Common + + CommitStoreHelper *commit_store_helper.CommitStoreHelper + CommitStore *commit_store.CommitStore + Router *router.Router + OffRamp *evm_2_evm_offramp.EVM2EVMOffRamp + Receivers []MaybeRevertReceiver +} + +type OCR2Config struct { + Signers []common.Address + Transmitters []common.Address + F uint8 + OnchainConfig []byte + OffchainConfigVersion uint64 + OffchainConfig []byte +} + +type BalanceAssertion struct { + Name string + Address common.Address + Expected string + Getter func(t *testing.T, addr common.Address) *big.Int + Within string +} + +type BalanceReq struct { + Name string + Addr common.Address + Getter func(t *testing.T, addr common.Address) *big.Int +} + +type CCIPContracts struct { + Source SourceChain + Dest DestinationChain + Oracles []confighelper.OracleIdentityExtra + + commitOCRConfig, execOCRConfig *OCR2Config +} + +func (c *CCIPContracts) DeployNewOffRamp(t *testing.T) { + prevOffRamp := common.HexToAddress("") + if c.Dest.OffRamp != nil { + prevOffRamp = c.Dest.OffRamp.Address() + } + offRampAddress, _, _, err := evm_2_evm_offramp.DeployEVM2EVMOffRamp( + c.Dest.User, + c.Dest.Chain, + evm_2_evm_offramp.EVM2EVMOffRampStaticConfig{ + CommitStore: c.Dest.CommitStore.Address(), + ChainSelector: c.Dest.ChainSelector, + SourceChainSelector: c.Source.ChainSelector, + OnRamp: c.Source.OnRamp.Address(), + PrevOffRamp: prevOffRamp, + RmnProxy: c.Dest.ARMProxy.Address(), // RMN formerly ARM + TokenAdminRegistry: c.Dest.TokenAdminRegistry.Address(), + }, + evm_2_evm_offramp.RateLimiterConfig{ + IsEnabled: true, + Capacity: LinkUSDValue(100), + Rate: LinkUSDValue(1), + }, + ) + require.NoError(t, err) + c.Dest.Chain.Commit() + + c.Dest.OffRamp, err = evm_2_evm_offramp.NewEVM2EVMOffRamp(offRampAddress, c.Dest.Chain) + require.NoError(t, err) + + c.Dest.Chain.Commit() + c.Source.Chain.Commit() +} + +func (c *CCIPContracts) EnableOffRamp(t *testing.T) { + _, err := c.Dest.Router.ApplyRampUpdates(c.Dest.User, nil, nil, []router.RouterOffRamp{{SourceChainSelector: SourceChainSelector, OffRamp: c.Dest.OffRamp.Address()}}) + require.NoError(t, err) + c.Dest.Chain.Commit() + + onChainConfig := c.CreateDefaultExecOnchainConfig(t) + offChainConfig := c.CreateDefaultExecOffchainConfig(t) + + c.SetupExecOCR2Config(t, onChainConfig, offChainConfig) +} + +func (c *CCIPContracts) EnableCommitStore(t *testing.T) { + onChainConfig := c.CreateDefaultCommitOnchainConfig(t) + offChainConfig := c.CreateDefaultCommitOffchainConfig(t) + + c.SetupCommitOCR2Config(t, onChainConfig, offChainConfig) + + _, err := c.Dest.PriceRegistry.ApplyPriceUpdatersUpdates(c.Dest.User, []common.Address{c.Dest.CommitStore.Address()}, []common.Address{}) + require.NoError(t, err) + c.Dest.Chain.Commit() +} + +func (c *CCIPContracts) DeployNewOnRamp(t *testing.T) { + t.Log("Deploying new onRamp") + // find the last onRamp + prevOnRamp := common.HexToAddress("") + if c.Source.OnRamp != nil { + prevOnRamp = c.Source.OnRamp.Address() + } + onRampAddress, _, _, err := evm_2_evm_onramp.DeployEVM2EVMOnRamp( + c.Source.User, // user + c.Source.Chain, // client + evm_2_evm_onramp.EVM2EVMOnRampStaticConfig{ + LinkToken: c.Source.LinkToken.Address(), + ChainSelector: c.Source.ChainSelector, + DestChainSelector: c.Dest.ChainSelector, + DefaultTxGasLimit: 200_000, + MaxNopFeesJuels: big.NewInt(0).Mul(big.NewInt(100_000_000), big.NewInt(1e18)), + PrevOnRamp: prevOnRamp, + RmnProxy: c.Source.ARM.Address(), // RMN, formerly ARM + TokenAdminRegistry: c.Source.TokenAdminRegistry.Address(), + }, + evm_2_evm_onramp.EVM2EVMOnRampDynamicConfig{ + Router: c.Source.Router.Address(), + MaxNumberOfTokensPerMsg: 5, + DestGasOverhead: 350_000, + DestGasPerPayloadByte: 16, + DestDataAvailabilityOverheadGas: 33_596, + DestGasPerDataAvailabilityByte: 16, + DestDataAvailabilityMultiplierBps: 6840, // 0.684 + PriceRegistry: c.Source.PriceRegistry.Address(), + MaxDataBytes: 1e5, + MaxPerMsgGasLimit: 4_000_000, + DefaultTokenFeeUSDCents: 50, + DefaultTokenDestGasOverhead: DefaultTokenDestGasOverhead, + }, + evm_2_evm_onramp.RateLimiterConfig{ + IsEnabled: true, + Capacity: LinkUSDValue(100), + Rate: LinkUSDValue(1), + }, + []evm_2_evm_onramp.EVM2EVMOnRampFeeTokenConfigArgs{ + { + Token: c.Source.LinkToken.Address(), + NetworkFeeUSDCents: 1_00, + GasMultiplierWeiPerEth: 1e18, + PremiumMultiplierWeiPerEth: 9e17, + Enabled: true, + }, + { + Token: c.Source.WrappedNative.Address(), + NetworkFeeUSDCents: 1_00, + GasMultiplierWeiPerEth: 1e18, + PremiumMultiplierWeiPerEth: 1e18, + Enabled: true, + }, + }, + []evm_2_evm_onramp.EVM2EVMOnRampTokenTransferFeeConfigArgs{ + { + Token: c.Source.LinkToken.Address(), + MinFeeUSDCents: 50, // $0.5 + MaxFeeUSDCents: 1_000_000_00, // $ 1 million + DeciBps: 5_0, // 5 bps + DestGasOverhead: 110_000, + DestBytesOverhead: 32, + AggregateRateLimitEnabled: true, + }, + }, + []evm_2_evm_onramp.EVM2EVMOnRampNopAndWeight{}, + ) + + require.NoError(t, err) + c.Source.Chain.Commit() + c.Dest.Chain.Commit() + c.Source.OnRamp, err = evm_2_evm_onramp.NewEVM2EVMOnRamp(onRampAddress, c.Source.Chain) + require.NoError(t, err) + c.Source.Chain.Commit() + c.Dest.Chain.Commit() +} + +func (c *CCIPContracts) EnableOnRamp(t *testing.T) { + t.Log("Setting onRamp on source router") + _, err := c.Source.Router.ApplyRampUpdates(c.Source.User, []router.RouterOnRamp{{DestChainSelector: c.Dest.ChainSelector, OnRamp: c.Source.OnRamp.Address()}}, nil, nil) + require.NoError(t, err) + c.Source.Chain.Commit() + c.Dest.Chain.Commit() +} + +func (c *CCIPContracts) DeployNewCommitStore(t *testing.T) { + commitStoreAddress, _, _, err := commit_store_helper_1_2_0.DeployCommitStoreHelper( + c.Dest.User, // user + c.Dest.Chain, // client + commit_store_helper_1_2_0.CommitStoreStaticConfig{ + ChainSelector: c.Dest.ChainSelector, + SourceChainSelector: c.Source.ChainSelector, + OnRamp: c.Source.OnRamp.Address(), + ArmProxy: c.Dest.ARMProxy.Address(), + }, + ) + require.NoError(t, err) + c.Dest.Chain.Commit() + c.Dest.CommitStoreHelper, err = commit_store_helper.NewCommitStoreHelper(commitStoreAddress, c.Dest.Chain) + require.NoError(t, err) + // since CommitStoreHelper derives from CommitStore, it's safe to instantiate both on same address + c.Dest.CommitStore, err = commit_store.NewCommitStore(commitStoreAddress, c.Dest.Chain) + require.NoError(t, err) +} + +func (c *CCIPContracts) DeployNewPriceRegistry(t *testing.T) { + t.Log("Deploying new Price Registry") + destPricesAddress, _, _, err := price_registry_1_2_0.DeployPriceRegistry( + c.Dest.User, + c.Dest.Chain, + []common.Address{c.Dest.CommitStore.Address()}, + []common.Address{c.Dest.LinkToken.Address()}, + 60*60*24*14, // two weeks + ) + require.NoError(t, err) + c.Source.Chain.Commit() + c.Dest.Chain.Commit() + c.Dest.PriceRegistry, err = price_registry_1_2_0.NewPriceRegistry(destPricesAddress, c.Dest.Chain) + require.NoError(t, err) + + priceUpdates := price_registry_1_2_0.InternalPriceUpdates{ + TokenPriceUpdates: []price_registry_1_2_0.InternalTokenPriceUpdate{ + { + SourceToken: c.Dest.LinkToken.Address(), + UsdPerToken: big.NewInt(8e18), // 8usd + }, + { + SourceToken: c.Dest.WrappedNative.Address(), + UsdPerToken: big.NewInt(1e18), // 1usd + }, + }, + GasPriceUpdates: []price_registry_1_2_0.InternalGasPriceUpdate{ + { + DestChainSelector: c.Source.ChainSelector, + UsdPerUnitGas: big.NewInt(2000e9), // $2000 per eth * 1gwei = 2000e9 + }, + }, + } + _, err = c.Dest.PriceRegistry.UpdatePrices(c.Dest.User, priceUpdates) + require.NoError(t, err) + + c.Source.Chain.Commit() + c.Dest.Chain.Commit() + + t.Logf("New Price Registry deployed at %s", destPricesAddress.String()) +} + +func (c *CCIPContracts) SetNopsOnRamp(t *testing.T, nopsAndWeights []evm_2_evm_onramp.EVM2EVMOnRampNopAndWeight) { + tx, err := c.Source.OnRamp.SetNops(c.Source.User, nopsAndWeights) + require.NoError(t, err) + c.Source.Chain.Commit() + _, err = bind.WaitMined(context.Background(), c.Source.Chain, tx) + require.NoError(t, err) +} + +func (c *CCIPContracts) GetSourceLinkBalance(t *testing.T, addr common.Address) *big.Int { + return GetBalance(t, c.Source.Chain, c.Source.LinkToken.Address(), addr) +} + +func (c *CCIPContracts) GetDestLinkBalance(t *testing.T, addr common.Address) *big.Int { + return GetBalance(t, c.Dest.Chain, c.Dest.LinkToken.Address(), addr) +} + +func (c *CCIPContracts) GetSourceWrappedTokenBalance(t *testing.T, addr common.Address) *big.Int { + return GetBalance(t, c.Source.Chain, c.Source.WrappedNative.Address(), addr) +} + +func (c *CCIPContracts) GetDestWrappedTokenBalance(t *testing.T, addr common.Address) *big.Int { + return GetBalance(t, c.Dest.Chain, c.Dest.WrappedNative.Address(), addr) +} + +func (c *CCIPContracts) AssertBalances(t *testing.T, bas []BalanceAssertion) { + for _, b := range bas { + actual := b.Getter(t, b.Address) + t.Log("Checking balance for", b.Name, "at", b.Address.Hex(), "got", actual) + require.NotNil(t, actual, "%v getter return nil", b.Name) + if b.Within == "" { + require.Equal(t, b.Expected, actual.String(), "wrong balance for %s got %s want %s", b.Name, actual, b.Expected) + } else { + bi, _ := big.NewInt(0).SetString(b.Expected, 10) + withinI, _ := big.NewInt(0).SetString(b.Within, 10) + high := big.NewInt(0).Add(bi, withinI) + low := big.NewInt(0).Sub(bi, withinI) + require.Equal(t, -1, actual.Cmp(high), "wrong balance for %s got %s outside expected range [%s, %s]", b.Name, actual, low, high) + require.Equal(t, 1, actual.Cmp(low), "wrong balance for %s got %s outside expected range [%s, %s]", b.Name, actual, low, high) + } + } +} + +func AccountToAddress(accounts []ocr2types.Account) (addresses []common.Address, err error) { + for _, signer := range accounts { + bytes, err := hexutil.Decode(string(signer)) + if err != nil { + return []common.Address{}, errors.Wrap(err, fmt.Sprintf("given address is not valid %s", signer)) + } + if len(bytes) != 20 { + return []common.Address{}, errors.Errorf("address is not 20 bytes %s", signer) + } + addresses = append(addresses, common.BytesToAddress(bytes)) + } + return addresses, nil +} + +func OnchainPublicKeyToAddress(publicKeys []ocrtypes.OnchainPublicKey) (addresses []common.Address, err error) { + for _, signer := range publicKeys { + if len(signer) != 20 { + return []common.Address{}, errors.Errorf("address is not 20 bytes %s", signer) + } + addresses = append(addresses, common.BytesToAddress(signer)) + } + return addresses, nil +} + +func (c *CCIPContracts) DeriveOCR2Config(t *testing.T, oracles []confighelper.OracleIdentityExtra, rawOnchainConfig []byte, rawOffchainConfig []byte) *OCR2Config { + signers, transmitters, threshold, onchainConfig, offchainConfigVersion, offchainConfig, err := confighelper.ContractSetConfigArgsForTests( + 2*time.Second, // deltaProgress + 1*time.Second, // deltaResend + 1*time.Second, // deltaRound + 500*time.Millisecond, // deltaGrace + 2*time.Second, // deltaStage + 3, + []int{1, 1, 1, 1}, + oracles, + rawOffchainConfig, + 50*time.Millisecond, // Max duration query + 1*time.Second, // Max duration observation + 100*time.Millisecond, + 100*time.Millisecond, + 100*time.Millisecond, + 1, // faults + rawOnchainConfig, + ) + require.NoError(t, err) + lggr := logger.TestLogger(t) + lggr.Infow("Setting Config on Oracle Contract", + "signers", signers, + "transmitters", transmitters, + "threshold", threshold, + "onchainConfig", onchainConfig, + "encodedConfigVersion", offchainConfigVersion, + ) + signerAddresses, err := OnchainPublicKeyToAddress(signers) + require.NoError(t, err) + transmitterAddresses, err := AccountToAddress(transmitters) + require.NoError(t, err) + + return &OCR2Config{ + Signers: signerAddresses, + Transmitters: transmitterAddresses, + F: threshold, + OnchainConfig: onchainConfig, + OffchainConfigVersion: offchainConfigVersion, + OffchainConfig: offchainConfig, + } +} + +func (c *CCIPContracts) SetupCommitOCR2Config(t *testing.T, commitOnchainConfig, commitOffchainConfig []byte) { + c.commitOCRConfig = c.DeriveOCR2Config(t, c.Oracles, commitOnchainConfig, commitOffchainConfig) + // Set the DON on the commit store + _, err := c.Dest.CommitStore.SetOCR2Config( + c.Dest.User, + c.commitOCRConfig.Signers, + c.commitOCRConfig.Transmitters, + c.commitOCRConfig.F, + c.commitOCRConfig.OnchainConfig, + c.commitOCRConfig.OffchainConfigVersion, + c.commitOCRConfig.OffchainConfig, + ) + require.NoError(t, err) + c.Dest.Chain.Commit() +} + +func (c *CCIPContracts) SetupExecOCR2Config(t *testing.T, execOnchainConfig, execOffchainConfig []byte) { + c.execOCRConfig = c.DeriveOCR2Config(t, c.Oracles, execOnchainConfig, execOffchainConfig) + // Same DON on the offramp + _, err := c.Dest.OffRamp.SetOCR2Config( + c.Dest.User, + c.execOCRConfig.Signers, + c.execOCRConfig.Transmitters, + c.execOCRConfig.F, + c.execOCRConfig.OnchainConfig, + c.execOCRConfig.OffchainConfigVersion, + c.execOCRConfig.OffchainConfig, + ) + require.NoError(t, err) + c.Dest.Chain.Commit() +} + +func (c *CCIPContracts) SetupOnchainConfig(t *testing.T, commitOnchainConfig, commitOffchainConfig, execOnchainConfig, execOffchainConfig []byte) int64 { + // Note We do NOT set the payees, payment is done in the OCR2Base implementation + blockBeforeConfig, err := c.Dest.Chain.BlockByNumber(context.Background(), nil) + require.NoError(t, err) + + c.SetupCommitOCR2Config(t, commitOnchainConfig, commitOffchainConfig) + c.SetupExecOCR2Config(t, execOnchainConfig, execOffchainConfig) + + return blockBeforeConfig.Number().Int64() +} + +func (c *CCIPContracts) SendMessage(t *testing.T, gasLimit, tokenAmount *big.Int, receiverAddr common.Address) { + extraArgs, err := GetEVMExtraArgsV1(gasLimit, false) + require.NoError(t, err) + msg := router.ClientEVM2AnyMessage{ + Receiver: MustEncodeAddress(t, receiverAddr), + Data: []byte("hello"), + TokenAmounts: []router.ClientEVMTokenAmount{ + { + Token: c.Source.LinkToken.Address(), + Amount: tokenAmount, + }, + }, + FeeToken: c.Source.LinkToken.Address(), + ExtraArgs: extraArgs, + } + fee, err := c.Source.Router.GetFee(nil, c.Dest.ChainSelector, msg) + require.NoError(t, err) + // Currently no overhead and 1gwei dest gas price. So fee is simply gasLimit * gasPrice. + // require.Equal(t, new(big.Int).Mul(gasLimit, gasPrice).String(), fee.String()) + // Approve the fee amount + the token amount + _, err = c.Source.LinkToken.Approve(c.Source.User, c.Source.Router.Address(), new(big.Int).Add(fee, tokenAmount)) + require.NoError(t, err) + c.Source.Chain.Commit() + c.SendRequest(t, msg) +} + +func GetBalances(t *testing.T, brs []BalanceReq) (map[string]*big.Int, error) { + m := make(map[string]*big.Int) + for _, br := range brs { + m[br.Name] = br.Getter(t, br.Addr) + if m[br.Name] == nil { + return nil, fmt.Errorf("%v getter return nil", br.Name) + } + } + return m, nil +} + +func MustAddBigInt(a *big.Int, b string) *big.Int { + bi, _ := big.NewInt(0).SetString(b, 10) + return big.NewInt(0).Add(a, bi) +} + +func MustSubBigInt(a *big.Int, b string) *big.Int { + bi, _ := big.NewInt(0).SetString(b, 10) + return big.NewInt(0).Sub(a, bi) +} + +func MustEncodeAddress(t *testing.T, address common.Address) []byte { + bts, err := utils.ABIEncode(`[{"type":"address"}]`, address) + require.NoError(t, err) + return bts +} + +func SetAdminAndRegisterPool(t *testing.T, + chain *backends.SimulatedBackend, + user *bind.TransactOpts, + tokenAdminRegistry *token_admin_registry.TokenAdminRegistry, + tokenAddress common.Address, + poolAddress common.Address) { + _, err := tokenAdminRegistry.ProposeAdministrator(user, tokenAddress, user.From) + require.NoError(t, err) + _, err = tokenAdminRegistry.AcceptAdminRole(user, tokenAddress) + require.NoError(t, err) + _, err = tokenAdminRegistry.SetPool(user, tokenAddress, poolAddress) + require.NoError(t, err) + + chain.Commit() +} + +func SetupCCIPContracts(t *testing.T, sourceChainID, sourceChainSelector, destChainID, destChainSelector uint64, + sourceFinalityDepth, destFinalityDepth uint32) CCIPContracts { + sourceChain, sourceUser := SetupChain(t) + destChain, destUser := SetupChain(t) + + // ================================================================ + // │ Deploy RMN │ + // ================================================================ + + armSourceAddress, _, _, err := mock_rmn_contract.DeployMockRMNContract( + sourceUser, + sourceChain, + ) + require.NoError(t, err) + sourceARM, err := mock_rmn_contract.NewMockRMNContract(armSourceAddress, sourceChain) + require.NoError(t, err) + armProxySourceAddress, _, _, err := rmn_proxy_contract.DeployRMNProxyContract( + sourceUser, + sourceChain, + armSourceAddress, + ) + require.NoError(t, err) + sourceARMProxy, err := rmn_proxy_contract.NewRMNProxyContract(armProxySourceAddress, sourceChain) + require.NoError(t, err) + sourceChain.Commit() + + armDestAddress, _, _, err := mock_rmn_contract.DeployMockRMNContract( + destUser, + destChain, + ) + require.NoError(t, err) + armProxyDestAddress, _, _, err := rmn_proxy_contract.DeployRMNProxyContract( + destUser, + destChain, + armDestAddress, + ) + require.NoError(t, err) + destChain.Commit() + destARM, err := mock_rmn_contract.NewMockRMNContract(armDestAddress, destChain) + require.NoError(t, err) + destARMProxy, err := rmn_proxy_contract.NewRMNProxyContract(armProxyDestAddress, destChain) + require.NoError(t, err) + + // ================================================================ + // │ Deploy TokenAdminRegistry │ + // ================================================================ + + sourceTokenAdminRegistryAddress, _, _, err := token_admin_registry.DeployTokenAdminRegistry(sourceUser, sourceChain) + require.NoError(t, err) + sourceTokenAdminRegistry, err := token_admin_registry.NewTokenAdminRegistry(sourceTokenAdminRegistryAddress, sourceChain) + require.NoError(t, err) + sourceChain.Commit() + + destTokenAdminRegistryAddress, _, _, err := token_admin_registry.DeployTokenAdminRegistry(destUser, destChain) + require.NoError(t, err) + destTokenAdminRegistry, err := token_admin_registry.NewTokenAdminRegistry(destTokenAdminRegistryAddress, destChain) + require.NoError(t, err) + destChain.Commit() + + // ================================================================ + // │ Deploy Tokens │ + // ================================================================ + + // Deploy link token and pool on source chain + sourceLinkTokenAddress, _, _, err := link_token_interface.DeployLinkToken(sourceUser, sourceChain) + require.NoError(t, err) + sourceChain.Commit() + sourceLinkToken, err := link_token_interface.NewLinkToken(sourceLinkTokenAddress, sourceChain) + require.NoError(t, err) + t.Logf("Deloyed LINK token on source chain at %s", sourceLinkTokenAddress.String()) + + sourceWeth9addr, _, _, err := weth9.DeployWETH9(sourceUser, sourceChain) + require.NoError(t, err) + sourceWrapped, err := weth9.NewWETH9(sourceWeth9addr, sourceChain) + require.NoError(t, err) + t.Logf("Deloyed WETH9 token on source chain at %s", sourceWeth9addr.String()) + + sourceCustomTokenAddress, _, _, err := link_token_interface.DeployLinkToken(sourceUser, sourceChain) + require.NoError(t, err) + sourceCustomToken, err := link_token_interface.NewLinkToken(sourceCustomTokenAddress, sourceChain) + require.NoError(t, err) + destChain.Commit() + t.Logf("Deloyed custom token on source chain at %s", sourceCustomTokenAddress.String()) + + // Dest chain + + destLinkTokenAddress, _, _, err := link_token_interface.DeployLinkToken(destUser, destChain) + require.NoError(t, err) + destChain.Commit() + destLinkToken, err := link_token_interface.NewLinkToken(destLinkTokenAddress, destChain) + require.NoError(t, err) + t.Logf("Deloyed LINK token on dest chain at %s", destLinkTokenAddress.String()) + + destWeth9addr, _, _, err := weth9.DeployWETH9(destUser, destChain) + require.NoError(t, err) + destWrapped, err := weth9.NewWETH9(destWeth9addr, destChain) + require.NoError(t, err) + t.Logf("Deloyed WETH9 token on dest chain at %s", destWeth9addr.String()) + + destCustomTokenAddress, _, _, err := link_token_interface.DeployLinkToken(destUser, destChain) + require.NoError(t, err) + destCustomToken, err := link_token_interface.NewLinkToken(destCustomTokenAddress, destChain) + require.NoError(t, err) + destChain.Commit() + t.Logf("Deloyed custom token on dest chain at %s", destCustomTokenAddress.String()) + + // ================================================================ + // │ Deploy Routers │ + // ================================================================ + + sourceRouterAddress, _, _, err := router.DeployRouter(sourceUser, sourceChain, sourceWeth9addr, armProxySourceAddress) + require.NoError(t, err) + sourceRouter, err := router.NewRouter(sourceRouterAddress, sourceChain) + require.NoError(t, err) + sourceChain.Commit() + + destRouterAddress, _, _, err := router.DeployRouter(destUser, destChain, destWeth9addr, armProxyDestAddress) + require.NoError(t, err) + destRouter, err := router.NewRouter(destRouterAddress, destChain) + require.NoError(t, err) + destChain.Commit() + + // ================================================================ + // │ Deploy Pools │ + // ================================================================ + + sourcePoolLinkAddress, _, _, err := lock_release_token_pool.DeployLockReleaseTokenPool( + sourceUser, + sourceChain, + sourceLinkTokenAddress, + []common.Address{}, + armProxySourceAddress, + true, + sourceRouterAddress, + ) + require.NoError(t, err) + sourceChain.Commit() + SetAdminAndRegisterPool(t, sourceChain, sourceUser, sourceTokenAdminRegistry, sourceLinkTokenAddress, sourcePoolLinkAddress) + + sourceLinkPool, err := lock_release_token_pool.NewLockReleaseTokenPool(sourcePoolLinkAddress, sourceChain) + require.NoError(t, err) + + sourceWeth9PoolAddress, _, _, err := lock_release_token_pool.DeployLockReleaseTokenPool( + sourceUser, + sourceChain, + sourceWeth9addr, + []common.Address{}, + armProxySourceAddress, + true, + sourceRouterAddress, + ) + require.NoError(t, err) + sourceChain.Commit() + SetAdminAndRegisterPool(t, sourceChain, sourceUser, sourceTokenAdminRegistry, sourceWeth9addr, sourceWeth9PoolAddress) + + sourceWeth9Pool, err := lock_release_token_pool.NewLockReleaseTokenPool(sourceWeth9PoolAddress, sourceChain) + require.NoError(t, err) + + // dest + + destPoolLinkAddress, _, _, err := lock_release_token_pool.DeployLockReleaseTokenPool( + destUser, + destChain, + destLinkTokenAddress, + []common.Address{}, + armProxyDestAddress, + true, + destRouterAddress, + ) + require.NoError(t, err) + destChain.Commit() + SetAdminAndRegisterPool(t, destChain, destUser, destTokenAdminRegistry, destLinkTokenAddress, destPoolLinkAddress) + + destLinkPool, err := lock_release_token_pool.NewLockReleaseTokenPool(destPoolLinkAddress, destChain) + require.NoError(t, err) + destChain.Commit() + + // Float the offramp pool + o, err := destLinkPool.Owner(nil) + require.NoError(t, err) + require.Equal(t, destUser.From.String(), o.String()) + _, err = destLinkPool.SetRebalancer(destUser, destUser.From) + require.NoError(t, err) + _, err = destLinkToken.Approve(destUser, destPoolLinkAddress, Link(200)) + require.NoError(t, err) + _, err = destLinkPool.ProvideLiquidity(destUser, Link(200)) + require.NoError(t, err) + destChain.Commit() + + destWrappedPoolAddress, _, _, err := lock_release_token_pool.DeployLockReleaseTokenPool( + destUser, + destChain, + destWeth9addr, + []common.Address{}, + armProxyDestAddress, + true, + destRouterAddress, + ) + require.NoError(t, err) + destChain.Commit() + SetAdminAndRegisterPool(t, destChain, destUser, destTokenAdminRegistry, destWeth9addr, destWrappedPoolAddress) + + destWrappedPool, err := lock_release_token_pool.NewLockReleaseTokenPool(destWrappedPoolAddress, destChain) + require.NoError(t, err) + + poolFloatValue := big.NewInt(1e18) + + destUser.Value = poolFloatValue + _, err = destWrapped.Deposit(destUser) + require.NoError(t, err) + destChain.Commit() + destUser.Value = nil + + _, err = destWrapped.Transfer(destUser, destWrappedPool.Address(), poolFloatValue) + require.NoError(t, err) + destChain.Commit() + + // ================================================================ + // │ Configure token pools │ + // ================================================================ + + abiEncodedDestLinkPool, err := abihelpers.EncodeAddress(destLinkPool.Address()) + require.NoError(t, err) + abiEncodedDestLinkTokenAddress, err := abihelpers.EncodeAddress(destLinkToken.Address()) + require.NoError(t, err) + _, err = sourceLinkPool.ApplyChainUpdates( + sourceUser, + []lock_release_token_pool.TokenPoolChainUpdate{{ + RemoteChainSelector: DestChainSelector, + RemotePoolAddress: abiEncodedDestLinkPool, + RemoteTokenAddress: abiEncodedDestLinkTokenAddress, + Allowed: true, + OutboundRateLimiterConfig: lock_release_token_pool.RateLimiterConfig{ + IsEnabled: true, + Capacity: HundredLink, + Rate: big.NewInt(1e18), + }, + InboundRateLimiterConfig: lock_release_token_pool.RateLimiterConfig{ + IsEnabled: true, + Capacity: HundredLink, + Rate: big.NewInt(1e18), + }, + }}, + ) + require.NoError(t, err) + + abiEncodedDestWrappedPool, err := abihelpers.EncodeAddress(destWrappedPool.Address()) + require.NoError(t, err) + abiEncodedDestWrappedTokenAddr, err := abihelpers.EncodeAddress(destWeth9addr) + require.NoError(t, err) + _, err = sourceWeth9Pool.ApplyChainUpdates( + sourceUser, + []lock_release_token_pool.TokenPoolChainUpdate{{ + RemoteChainSelector: DestChainSelector, + RemotePoolAddress: abiEncodedDestWrappedPool, + RemoteTokenAddress: abiEncodedDestWrappedTokenAddr, + Allowed: true, + OutboundRateLimiterConfig: lock_release_token_pool.RateLimiterConfig{ + IsEnabled: true, + Capacity: HundredLink, + Rate: big.NewInt(1e18), + }, + InboundRateLimiterConfig: lock_release_token_pool.RateLimiterConfig{ + IsEnabled: true, + Capacity: HundredLink, + Rate: big.NewInt(1e18), + }, + }}, + ) + require.NoError(t, err) + sourceChain.Commit() + + abiEncodedSourceLinkPool, err := abihelpers.EncodeAddress(sourceLinkPool.Address()) + require.NoError(t, err) + abiEncodedSourceLinkTokenAddr, err := abihelpers.EncodeAddress(sourceLinkTokenAddress) + require.NoError(t, err) + _, err = destLinkPool.ApplyChainUpdates( + destUser, + []lock_release_token_pool.TokenPoolChainUpdate{{ + RemoteChainSelector: SourceChainSelector, + RemotePoolAddress: abiEncodedSourceLinkPool, + RemoteTokenAddress: abiEncodedSourceLinkTokenAddr, + Allowed: true, + OutboundRateLimiterConfig: lock_release_token_pool.RateLimiterConfig{ + IsEnabled: true, + Capacity: HundredLink, + Rate: big.NewInt(1e18), + }, + InboundRateLimiterConfig: lock_release_token_pool.RateLimiterConfig{ + IsEnabled: true, + Capacity: HundredLink, + Rate: big.NewInt(1e18), + }, + }}, + ) + require.NoError(t, err) + + abiEncodedSourceWrappedPool, err := abihelpers.EncodeAddress(sourceWeth9Pool.Address()) + require.NoError(t, err) + abiEncodedSourceWrappedTokenAddr, err := abihelpers.EncodeAddress(sourceWrapped.Address()) + require.NoError(t, err) + _, err = destWrappedPool.ApplyChainUpdates( + destUser, + []lock_release_token_pool.TokenPoolChainUpdate{{ + RemoteChainSelector: SourceChainSelector, + RemotePoolAddress: abiEncodedSourceWrappedPool, + RemoteTokenAddress: abiEncodedSourceWrappedTokenAddr, + Allowed: true, + OutboundRateLimiterConfig: lock_release_token_pool.RateLimiterConfig{ + IsEnabled: true, + Capacity: HundredLink, + Rate: big.NewInt(1e18), + }, + InboundRateLimiterConfig: lock_release_token_pool.RateLimiterConfig{ + IsEnabled: true, + Capacity: HundredLink, + Rate: big.NewInt(1e18), + }, + }}, + ) + require.NoError(t, err) + destChain.Commit() + + // ================================================================ + // │ Deploy Price Registry │ + // ================================================================ + + sourcePricesAddress, _, _, err := price_registry_1_2_0.DeployPriceRegistry( + sourceUser, + sourceChain, + nil, + []common.Address{sourceLinkTokenAddress, sourceWeth9addr}, + 60*60*24*14, // two weeks + ) + require.NoError(t, err) + + srcPriceRegistry, err := price_registry_1_2_0.NewPriceRegistry(sourcePricesAddress, sourceChain) + require.NoError(t, err) + + _, err = srcPriceRegistry.UpdatePrices(sourceUser, price_registry_1_2_0.InternalPriceUpdates{ + TokenPriceUpdates: []price_registry_1_2_0.InternalTokenPriceUpdate{ + { + SourceToken: sourceLinkTokenAddress, + UsdPerToken: new(big.Int).Mul(big.NewInt(1e18), big.NewInt(20)), + }, + { + SourceToken: sourceWeth9addr, + UsdPerToken: new(big.Int).Mul(big.NewInt(1e18), big.NewInt(2000)), + }, + }, + GasPriceUpdates: []price_registry_1_2_0.InternalGasPriceUpdate{ + { + DestChainSelector: destChainSelector, + UsdPerUnitGas: big.NewInt(20000e9), + }, + }, + }) + require.NoError(t, err) + + // ================================================================ + // │ Deploy Lane │ + // ================================================================ + + onRampAddress, _, _, err := evm_2_evm_onramp.DeployEVM2EVMOnRamp( + sourceUser, // user + sourceChain, // client + evm_2_evm_onramp.EVM2EVMOnRampStaticConfig{ + LinkToken: sourceLinkTokenAddress, + ChainSelector: sourceChainSelector, + DestChainSelector: destChainSelector, + DefaultTxGasLimit: 200_000, + MaxNopFeesJuels: big.NewInt(0).Mul(big.NewInt(100_000_000), big.NewInt(1e18)), + PrevOnRamp: common.HexToAddress(""), + RmnProxy: armProxySourceAddress, // RMN, formerly ARM + TokenAdminRegistry: sourceTokenAdminRegistry.Address(), + }, + evm_2_evm_onramp.EVM2EVMOnRampDynamicConfig{ + Router: sourceRouterAddress, + MaxNumberOfTokensPerMsg: 5, + DestGasOverhead: 350_000, + DestGasPerPayloadByte: 16, + DestDataAvailabilityOverheadGas: 33_596, + DestGasPerDataAvailabilityByte: 16, + DestDataAvailabilityMultiplierBps: 6840, // 0.684 + PriceRegistry: sourcePricesAddress, + MaxDataBytes: 1e5, + MaxPerMsgGasLimit: 4_000_000, + DefaultTokenFeeUSDCents: 50, + DefaultTokenDestGasOverhead: DefaultTokenDestGasOverhead, + }, + evm_2_evm_onramp.RateLimiterConfig{ + IsEnabled: true, + Capacity: LinkUSDValue(100), + Rate: LinkUSDValue(1), + }, + []evm_2_evm_onramp.EVM2EVMOnRampFeeTokenConfigArgs{ + { + Token: sourceLinkTokenAddress, + NetworkFeeUSDCents: 1_00, + GasMultiplierWeiPerEth: 1e18, + PremiumMultiplierWeiPerEth: 9e17, + Enabled: true, + }, + { + Token: sourceWeth9addr, + NetworkFeeUSDCents: 1_00, + GasMultiplierWeiPerEth: 1e18, + PremiumMultiplierWeiPerEth: 1e18, + Enabled: true, + }, + }, + []evm_2_evm_onramp.EVM2EVMOnRampTokenTransferFeeConfigArgs{ + { + Token: sourceLinkTokenAddress, + MinFeeUSDCents: 50, // $0.5 + MaxFeeUSDCents: 1_000_000_00, // $ 1 million + DeciBps: 5_0, // 5 bps + DestGasOverhead: 350_000, + DestBytesOverhead: 32, + AggregateRateLimitEnabled: true, + }, + }, + []evm_2_evm_onramp.EVM2EVMOnRampNopAndWeight{}, + ) + require.NoError(t, err) + onRamp, err := evm_2_evm_onramp.NewEVM2EVMOnRamp(onRampAddress, sourceChain) + require.NoError(t, err) + + _, err = sourceRouter.ApplyRampUpdates(sourceUser, []router.RouterOnRamp{{DestChainSelector: destChainSelector, OnRamp: onRampAddress}}, nil, nil) + require.NoError(t, err) + sourceChain.Commit() + + destPriceRegistryAddress, _, _, err := price_registry_1_2_0.DeployPriceRegistry( + destUser, + destChain, + nil, + []common.Address{destLinkTokenAddress, destWeth9addr}, + 60*60*24*14, // two weeks + ) + require.NoError(t, err) + destPriceRegistry, err := price_registry_1_2_0.NewPriceRegistry(destPriceRegistryAddress, destChain) + require.NoError(t, err) + + // Deploy commit store. + commitStoreAddress, _, _, err := commit_store_helper_1_2_0.DeployCommitStoreHelper( + destUser, // user + destChain, // client + commit_store_helper_1_2_0.CommitStoreStaticConfig{ + ChainSelector: destChainSelector, + SourceChainSelector: sourceChainSelector, + OnRamp: onRamp.Address(), + ArmProxy: destARMProxy.Address(), + }, + ) + require.NoError(t, err) + destChain.Commit() + commitStore, err := commit_store.NewCommitStore(commitStoreAddress, destChain) + require.NoError(t, err) + commitStoreHelper, err := commit_store_helper.NewCommitStoreHelper(commitStoreAddress, destChain) + require.NoError(t, err) + + offRampAddress, _, _, err := evm_2_evm_offramp.DeployEVM2EVMOffRamp( + destUser, + destChain, + evm_2_evm_offramp.EVM2EVMOffRampStaticConfig{ + CommitStore: commitStore.Address(), + ChainSelector: destChainSelector, + SourceChainSelector: sourceChainSelector, + OnRamp: onRampAddress, + PrevOffRamp: common.HexToAddress(""), + RmnProxy: armProxyDestAddress, // RMN, formerly ARM + TokenAdminRegistry: destTokenAdminRegistryAddress, + }, + evm_2_evm_offramp.RateLimiterConfig{ + IsEnabled: true, + Capacity: LinkUSDValue(100), + Rate: LinkUSDValue(1), + }, + ) + require.NoError(t, err) + offRamp, err := evm_2_evm_offramp.NewEVM2EVMOffRamp(offRampAddress, destChain) + require.NoError(t, err) + destChain.Commit() + + _, err = destPriceRegistry.ApplyPriceUpdatersUpdates(destUser, []common.Address{commitStoreAddress}, []common.Address{}) + require.NoError(t, err) + _, err = destRouter.ApplyRampUpdates( + destUser, + nil, + nil, + []router.RouterOffRamp{{SourceChainSelector: sourceChainSelector, OffRamp: offRampAddress}}, + ) + require.NoError(t, err) + + // Deploy 2 revertable (one SS one non-SS) + revertingMessageReceiver1Address, _, _, err := maybe_revert_message_receiver.DeployMaybeRevertMessageReceiver(destUser, destChain, false) + require.NoError(t, err) + revertingMessageReceiver1, _ := maybe_revert_message_receiver.NewMaybeRevertMessageReceiver(revertingMessageReceiver1Address, destChain) + revertingMessageReceiver2Address, _, _, err := maybe_revert_message_receiver.DeployMaybeRevertMessageReceiver(destUser, destChain, false) + require.NoError(t, err) + revertingMessageReceiver2, _ := maybe_revert_message_receiver.NewMaybeRevertMessageReceiver(revertingMessageReceiver2Address, destChain) + // Need to commit here, or we will hit the block gas limit when deploying the executor + sourceChain.Commit() + destChain.Commit() + + // Ensure we have at least finality blocks. + for i := 0; i < 50; i++ { + sourceChain.Commit() + destChain.Commit() + } + + source := SourceChain{ + Common: Common{ + ChainID: sourceChainID, + ChainSelector: sourceChainSelector, + User: sourceUser, + Chain: sourceChain, + LinkToken: sourceLinkToken, + LinkTokenPool: sourceLinkPool, + CustomToken: sourceCustomToken, + ARM: sourceARM, + ARMProxy: sourceARMProxy, + PriceRegistry: srcPriceRegistry, + WrappedNative: sourceWrapped, + WrappedNativePool: sourceWeth9Pool, + TokenAdminRegistry: sourceTokenAdminRegistry, + FinalityDepth: sourceFinalityDepth, + }, + Router: sourceRouter, + OnRamp: onRamp, + } + dest := DestinationChain{ + Common: Common{ + ChainID: destChainID, + ChainSelector: destChainSelector, + User: destUser, + Chain: destChain, + LinkToken: destLinkToken, + LinkTokenPool: destLinkPool, + CustomToken: destCustomToken, + ARM: destARM, + ARMProxy: destARMProxy, + PriceRegistry: destPriceRegistry, + WrappedNative: destWrapped, + WrappedNativePool: destWrappedPool, + TokenAdminRegistry: destTokenAdminRegistry, + FinalityDepth: destFinalityDepth, + }, + CommitStoreHelper: commitStoreHelper, + CommitStore: commitStore, + Router: destRouter, + OffRamp: offRamp, + Receivers: []MaybeRevertReceiver{{Receiver: revertingMessageReceiver1, Strict: false}, {Receiver: revertingMessageReceiver2, Strict: true}}, + } + + return CCIPContracts{ + Source: source, + Dest: dest, + } +} + +func (c *CCIPContracts) SendRequest(t *testing.T, msg router.ClientEVM2AnyMessage) *types.Transaction { + tx, err := c.Source.Router.CcipSend(c.Source.User, c.Dest.ChainSelector, msg) + require.NoError(t, err) + ConfirmTxs(t, []*types.Transaction{tx}, c.Source.Chain) + return tx +} + +func (c *CCIPContracts) AssertExecState(t *testing.T, log logpoller.Log, state MessageExecutionState, offRampOpts ...common.Address) { + var offRamp *evm_2_evm_offramp.EVM2EVMOffRamp + var err error + if len(offRampOpts) > 0 { + offRamp, err = evm_2_evm_offramp.NewEVM2EVMOffRamp(offRampOpts[0], c.Dest.Chain) + require.NoError(t, err) + } else { + require.NotNil(t, c.Dest.OffRamp, "no offRamp configured") + offRamp = c.Dest.OffRamp + } + executionStateChanged, err := offRamp.ParseExecutionStateChanged(log.ToGethLog()) + require.NoError(t, err) + if MessageExecutionState(executionStateChanged.State) != state { + t.Log("Execution failed", hexutil.Encode(executionStateChanged.ReturnData)) + t.Fail() + } +} + +func GetEVMExtraArgsV1(gasLimit *big.Int, strict bool) ([]byte, error) { + EVMV1Tag := []byte{0x97, 0xa6, 0x57, 0xc9} + + encodedArgs, err := utils.ABIEncode(`[{"type":"uint256"},{"type":"bool"}]`, gasLimit, strict) + if err != nil { + return nil, err + } + + return append(EVMV1Tag, encodedArgs...), nil +} + +func GetEVMExtraArgsV2(gasLimit *big.Int, allowOutOfOrder bool) ([]byte, error) { + // see Client.sol. + EVMV2Tag := hexutil.MustDecode("0x181dcf10") + + encodedArgs, err := utils.ABIEncode(`[{"type":"uint256"},{"type":"bool"}]`, gasLimit, allowOutOfOrder) + if err != nil { + return nil, err + } + + return append(EVMV2Tag, encodedArgs...), nil +} + +type ManualExecArgs struct { + SourceChainID, DestChainID uint64 + DestUser *bind.TransactOpts + SourceChain, DestChain bind.ContractBackend + SourceStartBlock *big.Int // the block in/after which failed ccip-send transaction was triggered + DestStartBlock uint64 // the start block for filtering ReportAccepted event (including the failed seq num) + // in destination chain. if not provided to be derived by ApproxDestStartBlock method + DestLatestBlockNum uint64 // current block number in destination + DestDeployedAt uint64 // destination block number for the initial destination contract deployment. + // Can be any number before the tx was reverted in destination chain. Preferably this needs to be set up with + // a value greater than zero to avoid performance issue in locating approximate destination block + SendReqLogIndex uint // log index of the CCIPSendRequested log in source chain + SendReqTxHash string // tx hash of the ccip-send transaction for which execution was reverted + CommitStore string + OnRamp string + OffRamp string + SeqNr uint64 + GasLimit *big.Int + TokenGasOverrides []uint32 +} + +// ApproxDestStartBlock attempts to locate a block in destination chain with timestamp closest to the timestamp of the block +// in source chain in which ccip-send transaction was included +// it uses binary search to locate the block with the closest timestamp +// if the block located has a timestamp greater than the timestamp of mentioned source block +// it just returns the first block found with lesser timestamp of the source block +// providing a value of args.DestDeployedAt ensures better performance by reducing the range of block numbers to be traversed +func (args *ManualExecArgs) ApproxDestStartBlock() error { + sourceBlockHdr, err := args.SourceChain.HeaderByNumber(context.Background(), args.SourceStartBlock) + if err != nil { + return err + } + sendTxTime := sourceBlockHdr.Time + maxBlockNum := args.DestLatestBlockNum + // setting this to an approx value of 1000 considering destination chain would have at least 1000 blocks before the transaction started + minBlockNum := args.DestDeployedAt + closestBlockNum := uint64(math.Floor((float64(maxBlockNum) + float64(minBlockNum)) / 2)) + var closestBlockHdr *types.Header + closestBlockHdr, err = args.DestChain.HeaderByNumber(context.Background(), big.NewInt(int64(closestBlockNum))) + if err != nil { + return err + } + // to reduce the number of RPC calls increase the value of blockOffset + blockOffset := uint64(10) + for { + blockNum := closestBlockHdr.Number.Uint64() + if minBlockNum > maxBlockNum { + break + } + timeDiff := math.Abs(float64(closestBlockHdr.Time - sendTxTime)) + // break if the difference in timestamp is lesser than 1 minute + if timeDiff < 60 { + break + } else if closestBlockHdr.Time > sendTxTime { + maxBlockNum = blockNum - 1 + } else { + minBlockNum = blockNum + 1 + } + closestBlockNum = uint64(math.Floor((float64(maxBlockNum) + float64(minBlockNum)) / 2)) + closestBlockHdr, err = args.DestChain.HeaderByNumber(context.Background(), big.NewInt(int64(closestBlockNum))) + if err != nil { + return err + } + } + + for closestBlockHdr.Time > sendTxTime { + closestBlockNum = closestBlockNum - blockOffset + if closestBlockNum <= 0 { + return fmt.Errorf("approx destination blocknumber not found") + } + closestBlockHdr, err = args.DestChain.HeaderByNumber(context.Background(), big.NewInt(int64(closestBlockNum))) + if err != nil { + return err + } + } + args.DestStartBlock = closestBlockHdr.Number.Uint64() + fmt.Println("using approx destination start block number", args.DestStartBlock) + return nil +} + +func (args *ManualExecArgs) FindSeqNrFromCCIPSendRequested() (uint64, error) { + var seqNr uint64 + onRampContract, err := evm_2_evm_onramp.NewEVM2EVMOnRamp(common.HexToAddress(args.OnRamp), args.SourceChain) + if err != nil { + return seqNr, err + } + iterator, err := onRampContract.FilterCCIPSendRequested(&bind.FilterOpts{ + Start: args.SourceStartBlock.Uint64(), + }) + if err != nil { + return seqNr, err + } + for iterator.Next() { + if iterator.Event.Raw.Index == args.SendReqLogIndex && + iterator.Event.Raw.TxHash.Hex() == args.SendReqTxHash { + seqNr = iterator.Event.Message.SequenceNumber + break + } + } + if seqNr == 0 { + return seqNr, + fmt.Errorf("no CCIPSendRequested logs found for logIndex %d starting from block number %d", args.SendReqLogIndex, args.SourceStartBlock) + } + return seqNr, nil +} + +func (args *ManualExecArgs) ExecuteManually() (*types.Transaction, error) { + if args.SourceChainID == 0 || + args.DestChainID == 0 || + args.DestUser == nil { + return nil, fmt.Errorf("chain ids and owners are mandatory for source and dest chain") + } + if !common.IsHexAddress(args.CommitStore) || + !common.IsHexAddress(args.OffRamp) || + !common.IsHexAddress(args.OnRamp) { + return nil, fmt.Errorf("contract addresses must be valid hex address") + } + if args.SendReqTxHash == "" { + return nil, fmt.Errorf("tx hash of ccip-send request are required") + } + if args.SourceStartBlock == nil { + return nil, fmt.Errorf("must provide the value of source block in/after which ccip-send tx was included") + } + if args.SeqNr == 0 { + if args.SendReqLogIndex == 0 { + return nil, fmt.Errorf("must provide the value of log index of ccip-send request") + } + // locate seq nr from CCIPSendRequested log + seqNr, err := args.FindSeqNrFromCCIPSendRequested() + if err != nil { + return nil, err + } + args.SeqNr = seqNr + } + commitStore, err := commit_store.NewCommitStore(common.HexToAddress(args.CommitStore), args.DestChain) + if err != nil { + return nil, err + } + if args.DestStartBlock < 1 { + err = args.ApproxDestStartBlock() + if err != nil { + return nil, err + } + } + iterator, err := commitStore.FilterReportAccepted(&bind.FilterOpts{Start: args.DestStartBlock}) + if err != nil { + return nil, err + } + + var commitReport *commit_store.CommitStoreCommitReport + for iterator.Next() { + if iterator.Event.Report.Interval.Min <= args.SeqNr && iterator.Event.Report.Interval.Max >= args.SeqNr { + commitReport = &iterator.Event.Report + fmt.Println("Found root") + break + } + } + if commitReport == nil { + return nil, fmt.Errorf("unable to find seq num %d in commit report", args.SeqNr) + } + + return args.execute(commitReport) +} + +func (args *ManualExecArgs) execute(report *commit_store.CommitStoreCommitReport) (*types.Transaction, error) { + log.Info().Msg("Executing request manually") + seqNr := args.SeqNr + // Build a merkle tree for the report + mctx := hashutil.NewKeccak() + onRampContract, err := evm_2_evm_onramp_1_2_0.NewEVM2EVMOnRamp(common.HexToAddress(args.OnRamp), args.SourceChain) + if err != nil { + return nil, err + } + leafHasher := v1_2_0.NewLeafHasher(args.SourceChainID, args.DestChainID, common.HexToAddress(args.OnRamp), mctx, onRampContract) + if leafHasher == nil { + return nil, fmt.Errorf("unable to create leaf hasher") + } + + var leaves [][32]byte + var curr, prove int + var msgs []evm_2_evm_offramp.InternalEVM2EVMMessage + + // CCIP-2950 TestHelper for CCIPContracts and initialisation of EVM2EVMOffRampGasLimitOverride + var manualExecGasLimits []*evm_2_evm_offramp.EVM2EVMOffRampGasLimitOverride + var tokenData [][][]byte + sendRequestedIterator, err := onRampContract.FilterCCIPSendRequested(&bind.FilterOpts{ + Start: args.SourceStartBlock.Uint64(), + }) + if err != nil { + return nil, err + } + for sendRequestedIterator.Next() { + if sendRequestedIterator.Event.Message.SequenceNumber <= report.Interval.Max && + sendRequestedIterator.Event.Message.SequenceNumber >= report.Interval.Min { + fmt.Println("Found seq num", sendRequestedIterator.Event.Message.SequenceNumber, report.Interval) + hash, err2 := leafHasher.HashLeaf(sendRequestedIterator.Event.Raw) + if err2 != nil { + return nil, err2 + } + leaves = append(leaves, hash) + if sendRequestedIterator.Event.Message.SequenceNumber == seqNr { + fmt.Printf("Found proving %d %+v\n", curr, sendRequestedIterator.Event.Message) + var tokensAndAmounts []evm_2_evm_offramp.ClientEVMTokenAmount + for _, tokenAndAmount := range sendRequestedIterator.Event.Message.TokenAmounts { + tokensAndAmounts = append(tokensAndAmounts, evm_2_evm_offramp.ClientEVMTokenAmount{ + Token: tokenAndAmount.Token, + Amount: tokenAndAmount.Amount, + }) + } + msg := evm_2_evm_offramp.InternalEVM2EVMMessage{ + SourceChainSelector: sendRequestedIterator.Event.Message.SourceChainSelector, + Sender: sendRequestedIterator.Event.Message.Sender, + Receiver: sendRequestedIterator.Event.Message.Receiver, + SequenceNumber: sendRequestedIterator.Event.Message.SequenceNumber, + GasLimit: sendRequestedIterator.Event.Message.GasLimit, + Strict: sendRequestedIterator.Event.Message.Strict, + Nonce: sendRequestedIterator.Event.Message.Nonce, + FeeToken: sendRequestedIterator.Event.Message.FeeToken, + FeeTokenAmount: sendRequestedIterator.Event.Message.FeeTokenAmount, + Data: sendRequestedIterator.Event.Message.Data, + TokenAmounts: tokensAndAmounts, + SourceTokenData: sendRequestedIterator.Event.Message.SourceTokenData, + MessageId: sendRequestedIterator.Event.Message.MessageId, + } + msgs = append(msgs, msg) + if args.GasLimit != nil { + msg.GasLimit = args.GasLimit + } + + tokenGasOverrides := make([]uint32, len(msg.TokenAmounts)) + + if args.TokenGasOverrides != nil && len(args.TokenGasOverrides) == len(msg.TokenAmounts) { + copy(tokenGasOverrides, args.TokenGasOverrides) + } else { + // Initialize each element in the slice to a new big.Int value in one line using a loop + for i := range tokenGasOverrides { + tokenGasOverrides[i] = 0 + } + } + + // CCIP-2950 create a new object for evm_2_evm_offramp.EVM2EVMOffRampGasLimitOverride + evm2evmOffRampGasLimitOverride := &evm_2_evm_offramp.EVM2EVMOffRampGasLimitOverride{ + ReceiverExecutionGasLimit: msg.GasLimit, + TokenGasOverrides: tokenGasOverrides, + } + + manualExecGasLimits = append(manualExecGasLimits, evm2evmOffRampGasLimitOverride) + + var msgTokenData [][]byte + for range sendRequestedIterator.Event.Message.TokenAmounts { + msgTokenData = append(msgTokenData, []byte{}) + } + + tokenData = append(tokenData, msgTokenData) + prove = curr + } + curr++ + } + } + sendRequestedIterator.Close() + if msgs == nil { + return nil, fmt.Errorf("unable to find msg with seqNr %d", seqNr) + } + tree, err := merklemulti.NewTree(mctx, leaves) + if err != nil { + return nil, err + } + if tree.Root() != report.MerkleRoot { + return nil, fmt.Errorf("root doesn't match") + } + + proof, err := tree.Prove([]int{prove}) + if err != nil { + return nil, err + } + + offRampProof := evm_2_evm_offramp.InternalExecutionReport{ + Messages: msgs, + OffchainTokenData: tokenData, + Proofs: proof.Hashes, + ProofFlagBits: abihelpers.ProofFlagsToBits(proof.SourceFlags), + } + offRamp, err := evm_2_evm_offramp.NewEVM2EVMOffRamp(common.HexToAddress(args.OffRamp), args.DestChain) + if err != nil { + return nil, err + } + + // Convert manualExecGasLimits to a slice of structs before calling ManuallyExecute + manualExecGasLimitOverrides := make([]evm_2_evm_offramp.EVM2EVMOffRampGasLimitOverride, len(manualExecGasLimits)) + for i, limitOverride := range manualExecGasLimits { + if limitOverride != nil { + manualExecGasLimitOverrides[i] = *limitOverride + } + } + + // Execute. + return offRamp.ManuallyExecute(args.DestUser, offRampProof, manualExecGasLimitOverrides) +} + +func (c *CCIPContracts) ExecuteMessage( + t *testing.T, + req logpoller.Log, + txHash common.Hash, + destStartBlock uint64, +) uint64 { + t.Log("Executing request manually") + sendReqReceipt, err := c.Source.Chain.TransactionReceipt(context.Background(), txHash) + require.NoError(t, err) + args := ManualExecArgs{ + SourceChainID: c.Source.ChainID, + DestChainID: c.Dest.ChainID, + DestUser: c.Dest.User, + SourceChain: c.Source.Chain, + DestChain: c.Dest.Chain, + SourceStartBlock: sendReqReceipt.BlockNumber, + DestStartBlock: destStartBlock, + DestLatestBlockNum: c.Dest.Chain.Blockchain().CurrentBlock().Number.Uint64(), + SendReqLogIndex: uint(req.LogIndex), + SendReqTxHash: txHash.String(), + CommitStore: c.Dest.CommitStore.Address().String(), + OnRamp: c.Source.OnRamp.Address().String(), + OffRamp: c.Dest.OffRamp.Address().String(), + } + tx, err := args.ExecuteManually() + require.NoError(t, err) + c.Dest.Chain.Commit() + c.Source.Chain.Commit() + rec, err := c.Dest.Chain.TransactionReceipt(context.Background(), tx.Hash()) + require.NoError(t, err) + require.Equal(t, uint64(1), rec.Status, "manual execution failed") + t.Logf("Manual Execution completed for seqNum %d", args.SeqNr) + return args.SeqNr +} + +func GetBalance(t *testing.T, chain bind.ContractBackend, tokenAddr common.Address, addr common.Address) *big.Int { + token, err := link_token_interface.NewLinkToken(tokenAddr, chain) + require.NoError(t, err) + bal, err := token.BalanceOf(nil, addr) + require.NoError(t, err) + return bal +} diff --git a/core/services/ocr2/plugins/ccip/testhelpers/config.go b/core/services/ocr2/plugins/ccip/testhelpers/config.go new file mode 100644 index 00000000000..4dcb627347f --- /dev/null +++ b/core/services/ocr2/plugins/ccip/testhelpers/config.go @@ -0,0 +1,77 @@ +// Package with set of configs that should be used only within tests suites + +package testhelpers + +import ( + "testing" + "time" + + "github.com/stretchr/testify/require" + + "github.com/smartcontractkit/chainlink-common/pkg/config" + + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/abihelpers" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_5_0" +) + +const ( + DefaultTokenDestGasOverhead = 125_000 +) + +var PermissionLessExecutionThresholdSeconds = uint32(FirstBlockAge.Seconds()) + +func (c *CCIPContracts) CreateDefaultCommitOnchainConfig(t *testing.T) []byte { + config, err := abihelpers.EncodeAbiStruct(ccipdata.CommitOnchainConfig{ + PriceRegistry: c.Dest.PriceRegistry.Address(), + }) + require.NoError(t, err) + return config +} + +func (c *CCIPContracts) CreateDefaultCommitOffchainConfig(t *testing.T) []byte { + return c.createCommitOffchainConfig(t, 10*time.Second, 5*time.Second) +} + +func (c *CCIPContracts) createCommitOffchainConfig(t *testing.T, feeUpdateHearBeat time.Duration, inflightCacheExpiry time.Duration) []byte { + config, err := NewCommitOffchainConfig( + *config.MustNewDuration(feeUpdateHearBeat), + 1, + 1, + *config.MustNewDuration(feeUpdateHearBeat), + 1, + *config.MustNewDuration(inflightCacheExpiry), + false, + ).Encode() + require.NoError(t, err) + return config +} + +func (c *CCIPContracts) CreateDefaultExecOnchainConfig(t *testing.T) []byte { + config, err := abihelpers.EncodeAbiStruct(v1_5_0.ExecOnchainConfig{ + PermissionLessExecutionThresholdSeconds: PermissionLessExecutionThresholdSeconds, + Router: c.Dest.Router.Address(), + PriceRegistry: c.Dest.PriceRegistry.Address(), + MaxDataBytes: 1e5, + MaxNumberOfTokensPerMsg: 5, + }) + require.NoError(t, err) + return config +} + +func (c *CCIPContracts) CreateDefaultExecOffchainConfig(t *testing.T) []byte { + return c.createExecOffchainConfig(t, 1*time.Minute, 1*time.Minute) +} + +func (c *CCIPContracts) createExecOffchainConfig(t *testing.T, inflightCacheExpiry time.Duration, rootSnoozeTime time.Duration) []byte { + config, err := NewExecOffchainConfig( + 1, + 5_000_000, + 0.07, + *config.MustNewDuration(inflightCacheExpiry), + *config.MustNewDuration(rootSnoozeTime), + uint32(0), + ).Encode() + require.NoError(t, err) + return config +} diff --git a/core/services/ocr2/plugins/ccip/testhelpers/integration/chainlink.go b/core/services/ocr2/plugins/ccip/testhelpers/integration/chainlink.go new file mode 100644 index 00000000000..d34241a2d08 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/testhelpers/integration/chainlink.go @@ -0,0 +1,1083 @@ +package integrationtesthelpers + +import ( + "context" + "encoding/hex" + "fmt" + "math/big" + "net/http" + "net/http/httptest" + "slices" + "strconv" + "strings" + "testing" + "time" + + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/accounts/abi/bind/backends" + "github.com/ethereum/go-ethereum/common" + types3 "github.com/ethereum/go-ethereum/core/types" + "github.com/google/uuid" + "github.com/hashicorp/consul/sdk/freeport" + "github.com/jmoiron/sqlx" + "github.com/onsi/gomega" + "github.com/pkg/errors" + + "github.com/stretchr/testify/mock" + "github.com/stretchr/testify/require" + "go.uber.org/zap" + "k8s.io/utils/pointer" //nolint:staticcheck + + "github.com/smartcontractkit/libocr/commontypes" + "github.com/smartcontractkit/libocr/offchainreporting2/confighelper" + types4 "github.com/smartcontractkit/libocr/offchainreporting2plus/types" + + "github.com/smartcontractkit/chainlink-common/pkg/config" + "github.com/smartcontractkit/chainlink-common/pkg/loop" + "github.com/smartcontractkit/chainlink-common/pkg/utils/mailbox" + + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + coretypes "github.com/smartcontractkit/chainlink-common/pkg/types/core/mocks" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" + v2 "github.com/smartcontractkit/chainlink/v2/core/chains/evm/config/toml" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils" + evmUtils "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils/big" + "github.com/smartcontractkit/chainlink/v2/core/chains/legacyevm" + configv2 "github.com/smartcontractkit/chainlink/v2/core/config/toml" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/commit_store" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/evm_2_evm_offramp" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/evm_2_evm_onramp" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/price_registry_1_2_0" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" + "github.com/smartcontractkit/chainlink/v2/core/logger" + "github.com/smartcontractkit/chainlink/v2/core/logger/audit" + "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" + feeds2 "github.com/smartcontractkit/chainlink/v2/core/services/feeds" + feedsMocks "github.com/smartcontractkit/chainlink/v2/core/services/feeds/mocks" + pb "github.com/smartcontractkit/chainlink/v2/core/services/feeds/proto" + "github.com/smartcontractkit/chainlink/v2/core/services/job" + "github.com/smartcontractkit/chainlink/v2/core/services/keystore" + "github.com/smartcontractkit/chainlink/v2/core/services/keystore/chaintype" + "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/csakey" + "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ocr2key" + ksMocks "github.com/smartcontractkit/chainlink/v2/core/services/keystore/mocks" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/abihelpers" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_0_0" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_5_0" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/testhelpers" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/validate" + "github.com/smartcontractkit/chainlink/v2/core/services/ocrbootstrap" + evmrelay "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm" + clutils "github.com/smartcontractkit/chainlink/v2/core/utils" + "github.com/smartcontractkit/chainlink/v2/core/utils/crypto" + "github.com/smartcontractkit/chainlink/v2/core/utils/testutils/heavyweight" + "github.com/smartcontractkit/chainlink/v2/plugins" +) + +const ( + execSpecTemplate = ` + type = "offchainreporting2" + schemaVersion = 1 + name = "ccip-exec-1" + externalJobID = "67ffad71-d90f-4fe3-b4e4-494924b707fb" + forwardingAllowed = false + maxTaskDuration = "0s" + contractID = "%s" + contractConfigConfirmations = 1 + contractConfigTrackerPollInterval = "20s" + ocrKeyBundleID = "%s" + relay = "evm" + pluginType = "ccip-execution" + transmitterID = "%s" + + [relayConfig] + chainID = 1_337 + + [pluginConfig] + destStartBlock = 50 + + [pluginConfig.USDCConfig] + AttestationAPI = "http://blah.com" + SourceMessageTransmitterAddress = "%s" + SourceTokenAddress = "%s" + AttestationAPITimeoutSeconds = 10 + ` + commitSpecTemplatePipeline = ` + type = "offchainreporting2" + schemaVersion = 1 + name = "ccip-commit-1" + externalJobID = "13c997cf-1a14-4ab7-9068-07ee6d2afa55" + forwardingAllowed = false + maxTaskDuration = "0s" + contractID = "%s" + contractConfigConfirmations = 1 + contractConfigTrackerPollInterval = "20s" + ocrKeyBundleID = "%s" + relay = "evm" + pluginType = "ccip-commit" + transmitterID = "%s" + + [relayConfig] + chainID = 1_337 + + [pluginConfig] + destStartBlock = 50 + offRamp = "%s" + tokenPricesUSDPipeline = """ + %s + """ + ` + commitSpecTemplateDynamicPriceGetter = ` + type = "offchainreporting2" + schemaVersion = 1 + name = "ccip-commit-1" + externalJobID = "13c997cf-1a14-4ab7-9068-07ee6d2afa55" + forwardingAllowed = false + maxTaskDuration = "0s" + contractID = "%s" + contractConfigConfirmations = 1 + contractConfigTrackerPollInterval = "20s" + ocrKeyBundleID = "%s" + relay = "evm" + pluginType = "ccip-commit" + transmitterID = "%s" + + [relayConfig] + chainID = 1_337 + + [pluginConfig] + destStartBlock = 50 + offRamp = "%s" + priceGetterConfig = """ + %s + """ + ` +) + +type Node struct { + App chainlink.Application + Transmitter common.Address + PaymentReceiver common.Address + KeyBundle ocr2key.KeyBundle +} + +func (node *Node) FindJobIDForContract(t *testing.T, addr common.Address) int32 { + jobs := node.App.JobSpawner().ActiveJobs() + for _, j := range jobs { + if j.Type == job.OffchainReporting2 && j.OCR2OracleSpec.ContractID == addr.Hex() { + return j.ID + } + } + t.Fatalf("Could not find job for contract %s", addr.Hex()) + return 0 +} + +func (node *Node) EventuallyNodeUsesUpdatedPriceRegistry(t *testing.T, ccipContracts CCIPIntegrationTestHarness) logpoller.Log { + c, err := node.App.GetRelayers().LegacyEVMChains().Get(strconv.FormatUint(ccipContracts.Dest.ChainID, 10)) + require.NoError(t, err) + var log logpoller.Log + gomega.NewGomegaWithT(t).Eventually(func() bool { + ccipContracts.Source.Chain.Commit() + ccipContracts.Dest.Chain.Commit() + log, err := c.LogPoller().LatestLogByEventSigWithConfs( + testutils.Context(t), + v1_0_0.UsdPerUnitGasUpdated, + ccipContracts.Dest.PriceRegistry.Address(), + 0, + ) + // err can be transient errors such as sql row set empty + if err != nil { + return false + } + return log != nil + }, testutils.WaitTimeout(t), 1*time.Second).Should(gomega.BeTrue(), "node is not using updated price registry %s", ccipContracts.Dest.PriceRegistry.Address().Hex()) + return log +} + +func (node *Node) EventuallyNodeUsesNewCommitConfig(t *testing.T, ccipContracts CCIPIntegrationTestHarness, commitCfg ccipdata.CommitOnchainConfig) logpoller.Log { + c, err := node.App.GetRelayers().LegacyEVMChains().Get(strconv.FormatUint(ccipContracts.Dest.ChainID, 10)) + require.NoError(t, err) + var log logpoller.Log + gomega.NewGomegaWithT(t).Eventually(func() bool { + ccipContracts.Source.Chain.Commit() + ccipContracts.Dest.Chain.Commit() + log, err := c.LogPoller().LatestLogByEventSigWithConfs( + testutils.Context(t), + evmrelay.OCR2AggregatorLogDecoder.EventSig(), + ccipContracts.Dest.CommitStore.Address(), + 0, + ) + require.NoError(t, err) + var latestCfg ccipdata.CommitOnchainConfig + if log != nil { + latestCfg, err = DecodeCommitOnChainConfig(log.Data) + require.NoError(t, err) + return latestCfg == commitCfg + } + return false + }, testutils.WaitTimeout(t), 1*time.Second).Should(gomega.BeTrue(), "node is using old cfg") + return log +} + +func (node *Node) EventuallyNodeUsesNewExecConfig(t *testing.T, ccipContracts CCIPIntegrationTestHarness, execCfg v1_5_0.ExecOnchainConfig) logpoller.Log { + c, err := node.App.GetRelayers().LegacyEVMChains().Get(strconv.FormatUint(ccipContracts.Dest.ChainID, 10)) + require.NoError(t, err) + var log logpoller.Log + gomega.NewGomegaWithT(t).Eventually(func() bool { + ccipContracts.Source.Chain.Commit() + ccipContracts.Dest.Chain.Commit() + log, err := c.LogPoller().LatestLogByEventSigWithConfs( + testutils.Context(t), + evmrelay.OCR2AggregatorLogDecoder.EventSig(), + ccipContracts.Dest.OffRamp.Address(), + 0, + ) + require.NoError(t, err) + var latestCfg v1_5_0.ExecOnchainConfig + if log != nil { + latestCfg, err = DecodeExecOnChainConfig(log.Data) + require.NoError(t, err) + return latestCfg == execCfg + } + return false + }, testutils.WaitTimeout(t), 1*time.Second).Should(gomega.BeTrue(), "node is using old cfg") + return log +} + +func (node *Node) EventuallyHasReqSeqNum(t *testing.T, ccipContracts *CCIPIntegrationTestHarness, onRamp common.Address, seqNum int) logpoller.Log { + c, err := node.App.GetRelayers().LegacyEVMChains().Get(strconv.FormatUint(ccipContracts.Source.ChainID, 10)) + require.NoError(t, err) + var log logpoller.Log + gomega.NewGomegaWithT(t).Eventually(func() bool { + ccipContracts.Source.Chain.Commit() + ccipContracts.Dest.Chain.Commit() + lgs, err := c.LogPoller().LogsDataWordRange( + testutils.Context(t), + v1_2_0.CCIPSendRequestEventSig, + onRamp, + v1_2_0.CCIPSendRequestSeqNumIndex, + abihelpers.EvmWord(uint64(seqNum)), + abihelpers.EvmWord(uint64(seqNum)), + 1, + ) + require.NoError(t, err) + t.Log("Send requested", len(lgs)) + if len(lgs) == 1 { + log = lgs[0] + return true + } + return false + }, testutils.WaitTimeout(t), 1*time.Second).Should(gomega.BeTrue(), "eventually has seq num") + return log +} + +func (node *Node) EventuallyHasExecutedSeqNums(t *testing.T, ccipContracts *CCIPIntegrationTestHarness, offRamp common.Address, minSeqNum int, maxSeqNum int) []logpoller.Log { + c, err := node.App.GetRelayers().LegacyEVMChains().Get(strconv.FormatUint(ccipContracts.Dest.ChainID, 10)) + require.NoError(t, err) + var logs []logpoller.Log + gomega.NewGomegaWithT(t).Eventually(func() bool { + ccipContracts.Source.Chain.Commit() + ccipContracts.Dest.Chain.Commit() + lgs, err := c.LogPoller().IndexedLogsTopicRange( + testutils.Context(t), + v1_0_0.ExecutionStateChangedEvent, + offRamp, + v1_0_0.ExecutionStateChangedSeqNrIndex, + abihelpers.EvmWord(uint64(minSeqNum)), + abihelpers.EvmWord(uint64(maxSeqNum)), + 1, + ) + require.NoError(t, err) + t.Logf("Have executed logs %d want %d", len(lgs), maxSeqNum-minSeqNum+1) + if len(lgs) == maxSeqNum-minSeqNum+1 { + logs = lgs + t.Logf("Seq Num %d-%d executed", minSeqNum, maxSeqNum) + return true + } + return false + }, testutils.WaitTimeout(t), 1*time.Second).Should(gomega.BeTrue(), "eventually has not executed seq num") + return logs +} + +func (node *Node) ConsistentlySeqNumHasNotBeenExecuted(t *testing.T, ccipContracts *CCIPIntegrationTestHarness, offRamp common.Address, seqNum int) logpoller.Log { + c, err := node.App.GetRelayers().LegacyEVMChains().Get(strconv.FormatUint(ccipContracts.Dest.ChainID, 10)) + require.NoError(t, err) + var log logpoller.Log + gomega.NewGomegaWithT(t).Consistently(func() bool { + ccipContracts.Source.Chain.Commit() + ccipContracts.Dest.Chain.Commit() + lgs, err := c.LogPoller().IndexedLogsTopicRange( + testutils.Context(t), + v1_0_0.ExecutionStateChangedEvent, + offRamp, + v1_0_0.ExecutionStateChangedSeqNrIndex, + abihelpers.EvmWord(uint64(seqNum)), + abihelpers.EvmWord(uint64(seqNum)), + 1, + ) + require.NoError(t, err) + t.Log("Executed logs", lgs) + if len(lgs) == 1 { + log = lgs[0] + return true + } + return false + }, 10*time.Second, 1*time.Second).Should(gomega.BeFalse(), "seq number got executed") + return log +} + +func (node *Node) AddJob(t *testing.T, spec *OCR2TaskJobSpec) { + specString, err := spec.String() + require.NoError(t, err) + ccipJob, err := validate.ValidatedOracleSpecToml( + testutils.Context(t), + node.App.GetConfig().OCR2(), + node.App.GetConfig().Insecure(), + specString, + // FIXME Ani + nil, + ) + require.NoError(t, err) + err = node.App.AddJobV2(context.Background(), &ccipJob) + require.NoError(t, err) +} + +func (node *Node) AddBootstrapJob(t *testing.T, spec *OCR2TaskJobSpec) { + specString, err := spec.String() + require.NoError(t, err) + ccipJob, err := ocrbootstrap.ValidatedBootstrapSpecToml(specString) + require.NoError(t, err) + err = node.App.AddJobV2(context.Background(), &ccipJob) + require.NoError(t, err) +} + +func (node *Node) AddJobsWithSpec(t *testing.T, jobSpec *OCR2TaskJobSpec) { + // set node specific values + jobSpec.OCR2OracleSpec.OCRKeyBundleID.SetValid(node.KeyBundle.ID()) + jobSpec.OCR2OracleSpec.TransmitterID.SetValid(node.Transmitter.Hex()) + node.AddJob(t, jobSpec) +} + +func setupNodeCCIP( + t *testing.T, + owner *bind.TransactOpts, + port int64, + dbName string, + sourceChain *backends.SimulatedBackend, destChain *backends.SimulatedBackend, + sourceChainID *big.Int, destChainID *big.Int, + bootstrapPeerID string, + bootstrapPort int64, + sourceFinalityDepth, destFinalityDepth uint32, +) (chainlink.Application, string, common.Address, ocr2key.KeyBundle) { + trueRef, falseRef := true, false + + // Do not want to load fixtures as they contain a dummy chainID. + loglevel := configv2.LogLevel(zap.DebugLevel) + config, db := heavyweight.FullTestDBNoFixturesV2(t, func(c *chainlink.Config, _ *chainlink.Secrets) { + p2pAddresses := []string{ + fmt.Sprintf("127.0.0.1:%d", port), + } + c.Log.Level = &loglevel + c.Feature.UICSAKeys = &trueRef + c.Feature.FeedsManager = &trueRef + c.OCR.Enabled = &falseRef + c.OCR.DefaultTransactionQueueDepth = pointer.Uint32(200) + c.OCR2.Enabled = &trueRef + c.Feature.LogPoller = &trueRef + c.P2P.V2.Enabled = &trueRef + + dur, err := config.NewDuration(500 * time.Millisecond) + if err != nil { + panic(err) + } + c.P2P.V2.DeltaDial = &dur + + dur2, err := config.NewDuration(5 * time.Second) + if err != nil { + panic(err) + } + + c.P2P.V2.DeltaReconcile = &dur2 + c.P2P.V2.ListenAddresses = &p2pAddresses + c.P2P.V2.AnnounceAddresses = &p2pAddresses + + c.EVM = []*v2.EVMConfig{createConfigV2Chain(sourceChainID, sourceFinalityDepth), createConfigV2Chain(destChainID, destFinalityDepth)} + + if bootstrapPeerID != "" { + // Supply the bootstrap IP and port as a V2 peer address + c.P2P.V2.DefaultBootstrappers = &[]commontypes.BootstrapperLocator{ + { + PeerID: bootstrapPeerID, Addrs: []string{ + fmt.Sprintf("127.0.0.1:%d", bootstrapPort), + }, + }, + } + } + }) + + lggr := logger.TestLogger(t) + ctx := testutils.Context(t) + + // The in-memory geth sim does not let you create a custom ChainID, it will always be 1337. + // In particular this means that if you sign an eip155 tx, the chainID used MUST be 1337 + // and the CHAINID op code will always emit 1337. To work around this to simulate a "multichain" + // test, we fake different chainIDs using the wrapped sim cltest.SimulatedBackend so the RPC + // appears to operate on different chainIDs and we use an EthKeyStoreSim wrapper which always + // signs 1337 see https://github.com/smartcontractkit/chainlink-ccip/blob/a24dd436810250a458d27d8bb3fb78096afeb79c/core/services/ocr2/plugins/ccip/testhelpers/simulated_backend.go#L35 + sourceClient := client.NewSimulatedBackendClient(t, sourceChain, sourceChainID) + destClient := client.NewSimulatedBackendClient(t, destChain, destChainID) + csaKeyStore := ksMocks.NewCSA(t) + + key, err := csakey.NewV2() + require.NoError(t, err) + csaKeyStore.On("GetAll").Return([]csakey.KeyV2{key}, nil) + keyStore := NewKsa(db, lggr, csaKeyStore) + + simEthKeyStore := testhelpers.EthKeyStoreSim{ + ETHKS: keyStore.Eth(), + CSAKS: keyStore.CSA(), + } + mailMon := mailbox.NewMonitor("CCIP", lggr.Named("Mailbox")) + evmOpts := chainlink.EVMFactoryConfig{ + ChainOpts: legacyevm.ChainOpts{ + AppConfig: config, + GenEthClient: func(chainID *big.Int) client.Client { + if chainID.String() == sourceChainID.String() { + return sourceClient + } else if chainID.String() == destChainID.String() { + return destClient + } + t.Fatalf("invalid chain ID %v", chainID.String()) + return nil + }, + MailMon: mailMon, + DS: db, + }, + CSAETHKeystore: simEthKeyStore, + } + loopRegistry := plugins.NewLoopRegistry(lggr.Named("LoopRegistry"), config.Tracing(), config.Telemetry()) + relayerFactory := chainlink.RelayerFactory{ + Logger: lggr, + LoopRegistry: loopRegistry, + GRPCOpts: loop.GRPCOpts{}, + CapabilitiesRegistry: coretypes.NewCapabilitiesRegistry(t), + } + testCtx := testutils.Context(t) + // evm alway enabled for backward compatibility + initOps := []chainlink.CoreRelayerChainInitFunc{ + chainlink.InitEVM(testCtx, relayerFactory, evmOpts), + } + + relayChainInterops, err := chainlink.NewCoreRelayerChainInteroperators(initOps...) + if err != nil { + t.Fatal(err) + } + + app, err := chainlink.NewApplication(chainlink.ApplicationOpts{ + Config: config, + DS: db, + KeyStore: keyStore, + RelayerChainInteroperators: relayChainInterops, + Logger: lggr, + ExternalInitiatorManager: nil, + CloseLogger: lggr.Sync, + UnrestrictedHTTPClient: &http.Client{}, + RestrictedHTTPClient: &http.Client{}, + AuditLogger: audit.NoopLogger, + MailMon: mailMon, + LoopRegistry: plugins.NewLoopRegistry(lggr, config.Tracing(), config.Telemetry()), + }) + require.NoError(t, err) + require.NoError(t, app.GetKeyStore().Unlock(ctx, "password")) + _, err = app.GetKeyStore().P2P().Create(ctx) + require.NoError(t, err) + + p2pIDs, err := app.GetKeyStore().P2P().GetAll() + require.NoError(t, err) + require.Len(t, p2pIDs, 1) + peerID := p2pIDs[0].PeerID() + + _, err = app.GetKeyStore().Eth().Create(testCtx, destChainID) + require.NoError(t, err) + sendingKeys, err := app.GetKeyStore().Eth().EnabledKeysForChain(testCtx, destChainID) + require.NoError(t, err) + require.Len(t, sendingKeys, 1) + transmitter := sendingKeys[0].Address + s, err := app.GetKeyStore().Eth().GetState(testCtx, sendingKeys[0].ID(), destChainID) + require.NoError(t, err) + lggr.Debug(fmt.Sprintf("Transmitter address %s chainID %s", transmitter, s.EVMChainID.String())) + + // Fund the commitTransmitter address with some ETH + n, err := destChain.NonceAt(context.Background(), owner.From, nil) + require.NoError(t, err) + + tx := types3.NewTransaction(n, transmitter, big.NewInt(1000000000000000000), 21000, big.NewInt(1000000000), nil) + signedTx, err := owner.Signer(owner.From, tx) + require.NoError(t, err) + err = destChain.SendTransaction(context.Background(), signedTx) + require.NoError(t, err) + destChain.Commit() + + kb, err := app.GetKeyStore().OCR2().Create(ctx, chaintype.EVM) + require.NoError(t, err) + return app, peerID.Raw(), transmitter, kb +} + +func createConfigV2Chain(chainID *big.Int, finalityDepth uint32) *v2.EVMConfig { + // NOTE: For the executor jobs, the default of 500k is insufficient for a 3 message batch + defaultGasLimit := uint64(5000000) + tr := true + + sourceC := v2.Defaults((*evmUtils.Big)(chainID)) + sourceC.GasEstimator.LimitDefault = &defaultGasLimit + fixedPrice := "FixedPrice" + sourceC.GasEstimator.Mode = &fixedPrice + d, _ := config.NewDuration(100 * time.Millisecond) + sourceC.LogPollInterval = &d + sourceC.FinalityDepth = &finalityDepth + return &v2.EVMConfig{ + ChainID: (*evmUtils.Big)(chainID), + Enabled: &tr, + Chain: sourceC, + Nodes: v2.EVMNodes{&v2.Node{}}, + } +} + +type CCIPIntegrationTestHarness struct { + testhelpers.CCIPContracts + Nodes []Node + Bootstrap Node +} + +func SetupCCIPIntegrationTH(t *testing.T, sourceChainID, sourceChainSelector, destChainID, destChainSelector uint64, + sourceFinalityDepth, destFinalityDepth uint32) CCIPIntegrationTestHarness { + return CCIPIntegrationTestHarness{ + CCIPContracts: testhelpers.SetupCCIPContracts(t, sourceChainID, sourceChainSelector, destChainID, + destChainSelector, sourceFinalityDepth, destFinalityDepth), + } +} + +func (c *CCIPIntegrationTestHarness) CreatePricesPipeline(t *testing.T) (string, *httptest.Server, *httptest.Server) { + linkUSD := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) { + _, err := w.Write([]byte(`{"UsdPerLink": "8000000000000000000"}`)) + require.NoError(t, err) + })) + t.Cleanup(linkUSD.Close) + + ethUSD := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) { + _, err := w.Write([]byte(`{"UsdPerETH": "1700000000000000000000"}`)) + require.NoError(t, err) + })) + t.Cleanup(ethUSD.Close) + + sourceWrappedNative, err := c.Source.Router.GetWrappedNative(nil) + require.NoError(t, err) + destWrappedNative, err := c.Dest.Router.GetWrappedNative(nil) + require.NoError(t, err) + tokenPricesUSDPipeline := fmt.Sprintf(` +// Price 1 +link [type=http method=GET url="%s"]; +link_parse [type=jsonparse path="UsdPerLink"]; +link->link_parse; +eth [type=http method=GET url="%s"]; +eth_parse [type=jsonparse path="UsdPerETH"]; +eth->eth_parse; +merge [type=merge left="{}" right="{\\\"%s\\\":$(link_parse), \\\"%s\\\":$(eth_parse), \\\"%s\\\":$(eth_parse)}"];`, + linkUSD.URL, ethUSD.URL, c.Dest.LinkToken.Address(), sourceWrappedNative, destWrappedNative) + + return tokenPricesUSDPipeline, linkUSD, ethUSD +} + +func (c *CCIPIntegrationTestHarness) AddAllJobs(t *testing.T, jobParams CCIPJobSpecParams) { + jobParams.OffRamp = c.Dest.OffRamp.Address() + + commitSpec, err := jobParams.CommitJobSpec() + require.NoError(t, err) + geExecutionSpec, err := jobParams.ExecutionJobSpec() + require.NoError(t, err) + nodes := c.Nodes + for _, node := range nodes { + node.AddJobsWithSpec(t, commitSpec) + node.AddJobsWithSpec(t, geExecutionSpec) + } +} + +func (c *CCIPIntegrationTestHarness) jobSpecProposal(t *testing.T, specTemplate string, f func() (*OCR2TaskJobSpec, error), feedsManagerId int64, version int32, opts ...any) feeds2.ProposeJobArgs { + spec, err := f() + require.NoError(t, err) + + args := []any{spec.OCR2OracleSpec.ContractID} + args = append(args, opts...) + + return feeds2.ProposeJobArgs{ + FeedsManagerID: feedsManagerId, + RemoteUUID: uuid.New(), + Multiaddrs: nil, + Version: version, + Spec: fmt.Sprintf(specTemplate, args...), + } +} + +func (c *CCIPIntegrationTestHarness) SetupFeedsManager(t *testing.T) { + ctx := testutils.Context(t) + for _, node := range c.Nodes { + f := node.App.GetFeedsService() + + managers, err := f.ListManagers(ctx) + require.NoError(t, err) + if len(managers) > 0 { + // Use at most one feeds manager, don't register if one already exists + continue + } + + secret := utils.RandomBytes32() + pkey, err := crypto.PublicKeyFromHex(hex.EncodeToString(secret[:])) + require.NoError(t, err) + + m := feeds2.RegisterManagerParams{ + Name: "CCIP", + URI: "http://localhost:8080", + PublicKey: *pkey, + } + + connManager := feedsMocks.NewConnectionsManager(t) + connManager.On("Connect", mock.Anything).Maybe() + connManager.On("GetClient", mock.Anything).Maybe().Return(NoopFeedsClient{}, nil) + connManager.On("Close").Maybe().Return() + connManager.On("IsConnected", mock.Anything).Maybe().Return(true) + f.Unsafe_SetConnectionsManager(connManager) + + _, err = f.RegisterManager(testutils.Context(t), m) + require.NoError(t, err) + } +} + +func (c *CCIPIntegrationTestHarness) ApproveJobSpecs(t *testing.T, jobParams CCIPJobSpecParams) { + ctx := testutils.Context(t) + + for _, node := range c.Nodes { + f := node.App.GetFeedsService() + managers, err := f.ListManagers(ctx) + require.NoError(t, err) + require.Len(t, managers, 1, "expected exactly one feeds manager") + + execSpec := c.jobSpecProposal( + t, + execSpecTemplate, + jobParams.ExecutionJobSpec, + managers[0].ID, + 1, + node.KeyBundle.ID(), + node.Transmitter.Hex(), + utils.RandomAddress().String(), + utils.RandomAddress().String(), + ) + execId, err := f.ProposeJob(ctx, &execSpec) + require.NoError(t, err) + + err = f.ApproveSpec(ctx, execId, true) + require.NoError(t, err) + + var commitSpec feeds2.ProposeJobArgs + if jobParams.TokenPricesUSDPipeline != "" { + commitSpec = c.jobSpecProposal( + t, + commitSpecTemplatePipeline, + jobParams.CommitJobSpec, + managers[0].ID, + 2, + node.KeyBundle.ID(), + node.Transmitter.Hex(), + jobParams.OffRamp.String(), + jobParams.TokenPricesUSDPipeline, + ) + } else { + commitSpec = c.jobSpecProposal( + t, + commitSpecTemplateDynamicPriceGetter, + jobParams.CommitJobSpec, + managers[0].ID, + 2, + node.KeyBundle.ID(), + node.Transmitter.Hex(), + jobParams.OffRamp.String(), + jobParams.PriceGetterConfig, + ) + } + + commitId, err := f.ProposeJob(ctx, &commitSpec) + require.NoError(t, err) + + err = f.ApproveSpec(ctx, commitId, true) + require.NoError(t, err) + } +} + +func (c *CCIPIntegrationTestHarness) AllNodesHaveReqSeqNum(t *testing.T, seqNum int, onRampOpts ...common.Address) logpoller.Log { + var log logpoller.Log + nodes := c.Nodes + var onRamp common.Address + if len(onRampOpts) > 0 { + onRamp = onRampOpts[0] + } else { + require.NotNil(t, c.Source.OnRamp, "no onramp configured") + onRamp = c.Source.OnRamp.Address() + } + for _, node := range nodes { + log = node.EventuallyHasReqSeqNum(t, c, onRamp, seqNum) + } + return log +} + +func (c *CCIPIntegrationTestHarness) AllNodesHaveExecutedSeqNums(t *testing.T, minSeqNum int, maxSeqNum int, offRampOpts ...common.Address) []logpoller.Log { + var logs []logpoller.Log + nodes := c.Nodes + var offRamp common.Address + + if len(offRampOpts) > 0 { + offRamp = offRampOpts[0] + } else { + require.NotNil(t, c.Dest.OffRamp, "no offramp configured") + offRamp = c.Dest.OffRamp.Address() + } + for _, node := range nodes { + logs = node.EventuallyHasExecutedSeqNums(t, c, offRamp, minSeqNum, maxSeqNum) + } + return logs +} + +func (c *CCIPIntegrationTestHarness) NoNodesHaveExecutedSeqNum(t *testing.T, seqNum int, offRampOpts ...common.Address) logpoller.Log { + var log logpoller.Log + nodes := c.Nodes + var offRamp common.Address + if len(offRampOpts) > 0 { + offRamp = offRampOpts[0] + } else { + require.NotNil(t, c.Dest.OffRamp, "no offramp configured") + offRamp = c.Dest.OffRamp.Address() + } + for _, node := range nodes { + log = node.ConsistentlySeqNumHasNotBeenExecuted(t, c, offRamp, seqNum) + } + return log +} + +func (c *CCIPIntegrationTestHarness) EventuallyPriceRegistryUpdated(t *testing.T, block uint64, srcSelector uint64, tokens []common.Address, sourceNative common.Address, priceRegistryOpts ...common.Address) { + var priceRegistry *price_registry_1_2_0.PriceRegistry + var err error + if len(priceRegistryOpts) > 0 { + priceRegistry, err = price_registry_1_2_0.NewPriceRegistry(priceRegistryOpts[0], c.Dest.Chain) + require.NoError(t, err) + } else { + require.NotNil(t, c.Dest.PriceRegistry, "no priceRegistry configured") + priceRegistry = c.Dest.PriceRegistry + } + + g := gomega.NewGomegaWithT(t) + g.Eventually(func() bool { + it, err := priceRegistry.FilterUsdPerTokenUpdated(&bind.FilterOpts{Start: block}, tokens) + g.Expect(err).NotTo(gomega.HaveOccurred(), "Error filtering UsdPerTokenUpdated event") + + tokensFetched := make([]common.Address, 0, len(tokens)) + for it.Next() { + tokenFetched := it.Event.Token + tokensFetched = append(tokensFetched, tokenFetched) + t.Log("Token price updated", tokenFetched.String(), it.Event.Value.String(), it.Event.Timestamp.String()) + } + + for _, token := range tokens { + if !slices.Contains(tokensFetched, token) { + return false + } + } + + return true + }, testutils.WaitTimeout(t), 10*time.Second).Should(gomega.BeTrue(), "Tokens prices has not been updated") + + g.Eventually(func() bool { + it, err := priceRegistry.FilterUsdPerUnitGasUpdated(&bind.FilterOpts{Start: block}, []uint64{srcSelector}) + g.Expect(err).NotTo(gomega.HaveOccurred(), "Error filtering UsdPerUnitGasUpdated event") + g.Expect(it.Next()).To(gomega.BeTrue(), "No UsdPerUnitGasUpdated event found") + + return true + }, testutils.WaitTimeout(t), 10*time.Second).Should(gomega.BeTrue(), "source gas price has not been updated") +} + +func (c *CCIPIntegrationTestHarness) EventuallyCommitReportAccepted(t *testing.T, currentBlock uint64, commitStoreOpts ...common.Address) commit_store.CommitStoreCommitReport { + var commitStore *commit_store.CommitStore + var err error + if len(commitStoreOpts) > 0 { + commitStore, err = commit_store.NewCommitStore(commitStoreOpts[0], c.Dest.Chain) + require.NoError(t, err) + } else { + require.NotNil(t, c.Dest.CommitStore, "no commitStore configured") + commitStore = c.Dest.CommitStore + } + g := gomega.NewGomegaWithT(t) + var report commit_store.CommitStoreCommitReport + g.Eventually(func() bool { + it, err := commitStore.FilterReportAccepted(&bind.FilterOpts{Start: currentBlock}) + g.Expect(err).NotTo(gomega.HaveOccurred(), "Error filtering ReportAccepted event") + g.Expect(it.Next()).To(gomega.BeTrue(), "No ReportAccepted event found") + report = it.Event.Report + if report.MerkleRoot != [32]byte{} { + t.Log("Report Accepted by commitStore") + return true + } + return false + }, testutils.WaitTimeout(t), 1*time.Second).Should(gomega.BeTrue(), "report has not been committed") + return report +} + +func (c *CCIPIntegrationTestHarness) EventuallyExecutionStateChangedToSuccess(t *testing.T, seqNum []uint64, blockNum uint64, offRampOpts ...common.Address) { + var offRamp *evm_2_evm_offramp.EVM2EVMOffRamp + var err error + if len(offRampOpts) > 0 { + offRamp, err = evm_2_evm_offramp.NewEVM2EVMOffRamp(offRampOpts[0], c.Dest.Chain) + require.NoError(t, err) + } else { + require.NotNil(t, c.Dest.OffRamp, "no offRamp configured") + offRamp = c.Dest.OffRamp + } + gomega.NewGomegaWithT(t).Eventually(func() bool { + it, err := offRamp.FilterExecutionStateChanged(&bind.FilterOpts{Start: blockNum}, seqNum, [][32]byte{}) + require.NoError(t, err) + for it.Next() { + if cciptypes.MessageExecutionState(it.Event.State) == cciptypes.ExecutionStateSuccess { + t.Logf("ExecutionStateChanged event found for seqNum %d", it.Event.SequenceNumber) + return true + } + } + c.Source.Chain.Commit() + c.Dest.Chain.Commit() + return false + }, testutils.WaitTimeout(t), time.Second). + Should(gomega.BeTrue(), "ExecutionStateChanged Event") +} + +func (c *CCIPIntegrationTestHarness) EventuallyReportCommitted(t *testing.T, max int, commitStoreOpts ...common.Address) uint64 { + var commitStore *commit_store.CommitStore + var err error + var committedSeqNum uint64 + if len(commitStoreOpts) > 0 { + commitStore, err = commit_store.NewCommitStore(commitStoreOpts[0], c.Dest.Chain) + require.NoError(t, err) + } else { + require.NotNil(t, c.Dest.CommitStore, "no commitStore configured") + commitStore = c.Dest.CommitStore + } + gomega.NewGomegaWithT(t).Eventually(func() bool { + minSeqNum, err := commitStore.GetExpectedNextSequenceNumber(nil) + require.NoError(t, err) + c.Source.Chain.Commit() + c.Dest.Chain.Commit() + t.Log("next expected seq num reported", minSeqNum) + committedSeqNum = minSeqNum + return minSeqNum > uint64(max) + }, testutils.WaitTimeout(t), time.Second).Should(gomega.BeTrue(), "report has not been committed") + return committedSeqNum +} + +func (c *CCIPIntegrationTestHarness) EventuallySendRequested(t *testing.T, seqNum uint64, onRampOpts ...common.Address) { + var onRamp *evm_2_evm_onramp.EVM2EVMOnRamp + var err error + if len(onRampOpts) > 0 { + onRamp, err = evm_2_evm_onramp.NewEVM2EVMOnRamp(onRampOpts[0], c.Source.Chain) + require.NoError(t, err) + } else { + require.NotNil(t, c.Source.OnRamp, "no onRamp configured") + onRamp = c.Source.OnRamp + } + gomega.NewGomegaWithT(t).Eventually(func() bool { + it, err := onRamp.FilterCCIPSendRequested(nil) + require.NoError(t, err) + for it.Next() { + if it.Event.Message.SequenceNumber == seqNum { + t.Log("sendRequested generated for", seqNum) + return true + } + } + c.Source.Chain.Commit() + c.Dest.Chain.Commit() + return false + }, testutils.WaitTimeout(t), time.Second).Should(gomega.BeTrue(), "sendRequested has not been generated") +} + +func (c *CCIPIntegrationTestHarness) ConsistentlyReportNotCommitted(t *testing.T, max int, commitStoreOpts ...common.Address) { + var commitStore *commit_store.CommitStore + var err error + if len(commitStoreOpts) > 0 { + commitStore, err = commit_store.NewCommitStore(commitStoreOpts[0], c.Dest.Chain) + require.NoError(t, err) + } else { + require.NotNil(t, c.Dest.CommitStore, "no commitStore configured") + commitStore = c.Dest.CommitStore + } + gomega.NewGomegaWithT(t).Consistently(func() bool { + minSeqNum, err := commitStore.GetExpectedNextSequenceNumber(nil) + require.NoError(t, err) + c.Source.Chain.Commit() + c.Dest.Chain.Commit() + t.Log("min seq num reported", minSeqNum) + return minSeqNum > uint64(max) + }, testutils.WaitTimeout(t), time.Second).Should(gomega.BeFalse(), "report has been committed") +} + +func (c *CCIPIntegrationTestHarness) SetupAndStartNodes(ctx context.Context, t *testing.T, bootstrapNodePort int64) (Node, []Node, int64) { + appBootstrap, bootstrapPeerID, bootstrapTransmitter, bootstrapKb := setupNodeCCIP(t, c.Dest.User, bootstrapNodePort, + "bootstrap_ccip", c.Source.Chain, c.Dest.Chain, big.NewInt(0).SetUint64(c.Source.ChainID), + big.NewInt(0).SetUint64(c.Dest.ChainID), "", 0, c.Source.FinalityDepth, + c.Dest.FinalityDepth) + var ( + oracles []confighelper.OracleIdentityExtra + nodes []Node + ) + err := appBootstrap.Start(ctx) + require.NoError(t, err) + t.Cleanup(func() { + require.NoError(t, appBootstrap.Stop()) + }) + bootstrapNode := Node{ + App: appBootstrap, + Transmitter: bootstrapTransmitter, + KeyBundle: bootstrapKb, + } + // Set up the minimum 4 oracles all funded with destination ETH + for i := int64(0); i < 4; i++ { + app, peerID, transmitter, kb := setupNodeCCIP( + t, + c.Dest.User, + int64(freeport.GetOne(t)), + fmt.Sprintf("oracle_ccip%d", i), + c.Source.Chain, + c.Dest.Chain, + big.NewInt(0).SetUint64(c.Source.ChainID), + big.NewInt(0).SetUint64(c.Dest.ChainID), + bootstrapPeerID, + bootstrapNodePort, + c.Source.FinalityDepth, + c.Dest.FinalityDepth, + ) + nodes = append(nodes, Node{ + App: app, + Transmitter: transmitter, + KeyBundle: kb, + }) + offchainPublicKey, _ := hex.DecodeString(strings.TrimPrefix(kb.OnChainPublicKey(), "0x")) + oracles = append(oracles, confighelper.OracleIdentityExtra{ + OracleIdentity: confighelper.OracleIdentity{ + OnchainPublicKey: offchainPublicKey, + TransmitAccount: types4.Account(transmitter.String()), + OffchainPublicKey: kb.OffchainPublicKey(), + PeerID: peerID, + }, + ConfigEncryptionPublicKey: kb.ConfigEncryptionPublicKey(), + }) + err = app.Start(ctx) + require.NoError(t, err) + t.Cleanup(func() { + require.NoError(t, app.Stop()) + }) + } + + c.Oracles = oracles + commitOnchainConfig := c.CreateDefaultCommitOnchainConfig(t) + commitOffchainConfig := c.CreateDefaultCommitOffchainConfig(t) + execOnchainConfig := c.CreateDefaultExecOnchainConfig(t) + execOffchainConfig := c.CreateDefaultExecOffchainConfig(t) + + configBlock := c.SetupOnchainConfig(t, commitOnchainConfig, commitOffchainConfig, execOnchainConfig, execOffchainConfig) + c.Nodes = nodes + c.Bootstrap = bootstrapNode + return bootstrapNode, nodes, configBlock +} + +func (c *CCIPIntegrationTestHarness) SetUpNodesAndJobs(t *testing.T, pricePipeline string, priceGetterConfig string, usdcAttestationAPI string) CCIPJobSpecParams { + // setup Jobs + ctx := context.Background() + // Starts nodes and configures them in the OCR contracts. + bootstrapNode, _, configBlock := c.SetupAndStartNodes(ctx, t, int64(freeport.GetOne(t))) + + jobParams := c.NewCCIPJobSpecParams(pricePipeline, priceGetterConfig, configBlock, usdcAttestationAPI) + + // Add the bootstrap job + c.Bootstrap.AddBootstrapJob(t, jobParams.BootstrapJob(c.Dest.CommitStore.Address().Hex())) + c.AddAllJobs(t, jobParams) + + // Replay for bootstrap. + bc, err := bootstrapNode.App.GetRelayers().LegacyEVMChains().Get(strconv.FormatUint(c.Dest.ChainID, 10)) + require.NoError(t, err) + require.NoError(t, bc.LogPoller().Replay(context.Background(), configBlock)) + c.Dest.Chain.Commit() + + return jobParams +} +func DecodeCommitOnChainConfig(encoded []byte) (ccipdata.CommitOnchainConfig, error) { + var onchainConfig ccipdata.CommitOnchainConfig + unpacked, err := abihelpers.DecodeOCR2Config(encoded) + if err != nil { + return onchainConfig, err + } + onChainCfg := unpacked.OnchainConfig + onchainConfig, err = abihelpers.DecodeAbiStruct[ccipdata.CommitOnchainConfig](onChainCfg) + if err != nil { + return onchainConfig, err + } + return onchainConfig, nil +} + +func DecodeExecOnChainConfig(encoded []byte) (v1_5_0.ExecOnchainConfig, error) { + var onchainConfig v1_5_0.ExecOnchainConfig + unpacked, err := abihelpers.DecodeOCR2Config(encoded) + if err != nil { + return onchainConfig, errors.Wrap(err, "failed to unpack log data") + } + onChainCfg := unpacked.OnchainConfig + onchainConfig, err = abihelpers.DecodeAbiStruct[v1_5_0.ExecOnchainConfig](onChainCfg) + if err != nil { + return onchainConfig, err + } + return onchainConfig, nil +} + +type ksa struct { + keystore.Master + csa keystore.CSA +} + +func (k *ksa) CSA() keystore.CSA { + return k.csa +} + +func NewKsa(db *sqlx.DB, lggr logger.Logger, csa keystore.CSA) *ksa { + return &ksa{ + Master: keystore.New(db, clutils.FastScryptParams, lggr), + csa: csa, + } +} + +type NoopFeedsClient struct{} + +func (n NoopFeedsClient) ApprovedJob(context.Context, *pb.ApprovedJobRequest) (*pb.ApprovedJobResponse, error) { + return &pb.ApprovedJobResponse{}, nil +} + +func (n NoopFeedsClient) Healthcheck(context.Context, *pb.HealthcheckRequest) (*pb.HealthcheckResponse, error) { + return &pb.HealthcheckResponse{}, nil +} + +func (n NoopFeedsClient) UpdateNode(context.Context, *pb.UpdateNodeRequest) (*pb.UpdateNodeResponse, error) { + return &pb.UpdateNodeResponse{}, nil +} + +func (n NoopFeedsClient) RejectedJob(context.Context, *pb.RejectedJobRequest) (*pb.RejectedJobResponse, error) { + return &pb.RejectedJobResponse{}, nil +} + +func (n NoopFeedsClient) CancelledJob(context.Context, *pb.CancelledJobRequest) (*pb.CancelledJobResponse, error) { + return &pb.CancelledJobResponse{}, nil +} diff --git a/core/services/ocr2/plugins/ccip/testhelpers/integration/jobspec.go b/core/services/ocr2/plugins/ccip/testhelpers/integration/jobspec.go new file mode 100644 index 00000000000..961e26d1cef --- /dev/null +++ b/core/services/ocr2/plugins/ccip/testhelpers/integration/jobspec.go @@ -0,0 +1,334 @@ +package integrationtesthelpers + +import ( + "bytes" + "fmt" + "text/template" + "time" + + "github.com/ethereum/go-ethereum/common" + "github.com/lib/pq" + + "github.com/smartcontractkit/chainlink-common/pkg/types" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils" + "github.com/smartcontractkit/chainlink/v2/core/services/job" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/config" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/pricegetter" + "github.com/smartcontractkit/chainlink/v2/core/services/relay" + "github.com/smartcontractkit/chainlink/v2/core/store/models" +) + +// OCR2TaskJobSpec represents an OCR2 job that is given to other nodes, meant to communicate with the bootstrap node, +// and provide their answers +type OCR2TaskJobSpec struct { + Name string `toml:"name"` + JobType string `toml:"type"` + MaxTaskDuration string `toml:"maxTaskDuration"` // Optional + ForwardingAllowed bool `toml:"forwardingAllowed"` + OCR2OracleSpec job.OCR2OracleSpec + ObservationSource string `toml:"observationSource"` // List of commands for the Chainlink node +} + +// Type returns the type of the job +func (o *OCR2TaskJobSpec) Type() string { return o.JobType } + +// String representation of the job +func (o *OCR2TaskJobSpec) String() (string, error) { + var feedID string + if o.OCR2OracleSpec.FeedID != nil { + feedID = o.OCR2OracleSpec.FeedID.Hex() + } + specWrap := struct { + Name string + JobType string + MaxTaskDuration string + ForwardingAllowed bool + ContractID string + FeedID string + Relay string + PluginType string + RelayConfig map[string]interface{} + PluginConfig map[string]interface{} + P2PV2Bootstrappers []string + OCRKeyBundleID string + MonitoringEndpoint string + TransmitterID string + BlockchainTimeout time.Duration + TrackerSubscribeInterval time.Duration + TrackerPollInterval time.Duration + ContractConfirmations uint16 + ObservationSource string + }{ + Name: o.Name, + JobType: o.JobType, + ForwardingAllowed: o.ForwardingAllowed, + MaxTaskDuration: o.MaxTaskDuration, + ContractID: o.OCR2OracleSpec.ContractID, + FeedID: feedID, + Relay: o.OCR2OracleSpec.Relay, + PluginType: string(o.OCR2OracleSpec.PluginType), + RelayConfig: o.OCR2OracleSpec.RelayConfig, + PluginConfig: o.OCR2OracleSpec.PluginConfig, + P2PV2Bootstrappers: o.OCR2OracleSpec.P2PV2Bootstrappers, + OCRKeyBundleID: o.OCR2OracleSpec.OCRKeyBundleID.String, + MonitoringEndpoint: o.OCR2OracleSpec.MonitoringEndpoint.String, + TransmitterID: o.OCR2OracleSpec.TransmitterID.String, + BlockchainTimeout: o.OCR2OracleSpec.BlockchainTimeout.Duration(), + ContractConfirmations: o.OCR2OracleSpec.ContractConfigConfirmations, + TrackerPollInterval: o.OCR2OracleSpec.ContractConfigTrackerPollInterval.Duration(), + ObservationSource: o.ObservationSource, + } + ocr2TemplateString := ` +type = "{{ .JobType }}" +name = "{{.Name}}" +forwardingAllowed = {{.ForwardingAllowed}} +{{if .MaxTaskDuration}} +maxTaskDuration = "{{ .MaxTaskDuration }}" {{end}} +{{if .PluginType}} +pluginType = "{{ .PluginType }}" {{end}} +relay = "{{.Relay}}" +schemaVersion = 1 +contractID = "{{.ContractID}}" +{{if .FeedID}} +feedID = "{{.FeedID}}" +{{end}} +{{if eq .JobType "offchainreporting2" }} +ocrKeyBundleID = "{{.OCRKeyBundleID}}" {{end}} +{{if eq .JobType "offchainreporting2" }} +transmitterID = "{{.TransmitterID}}" {{end}} +{{if .BlockchainTimeout}} +blockchainTimeout = "{{.BlockchainTimeout}}" +{{end}} +{{if .ContractConfirmations}} +contractConfigConfirmations = {{.ContractConfirmations}} +{{end}} +{{if .TrackerPollInterval}} +contractConfigTrackerPollInterval = "{{.TrackerPollInterval}}" +{{end}} +{{if .TrackerSubscribeInterval}} +contractConfigTrackerSubscribeInterval = "{{.TrackerSubscribeInterval}}" +{{end}} +{{if .P2PV2Bootstrappers}} +p2pv2Bootstrappers = [{{range .P2PV2Bootstrappers}}"{{.}}",{{end}}]{{end}} +{{if .MonitoringEndpoint}} +monitoringEndpoint = "{{.MonitoringEndpoint}}" {{end}} +{{if .ObservationSource}} +observationSource = """ +{{.ObservationSource}} +"""{{end}} +{{if eq .JobType "offchainreporting2" }} +[pluginConfig]{{range $key, $value := .PluginConfig}} +{{$key}} = {{$value}}{{end}} +{{end}} +[relayConfig]{{range $key, $value := .RelayConfig}} +{{$key}} = {{$value}}{{end}} +` + return MarshallTemplate(specWrap, "OCR2 Job", ocr2TemplateString) +} + +// MarshallTemplate Helper to marshall templates +func MarshallTemplate(jobSpec interface{}, name, templateString string) (string, error) { + var buf bytes.Buffer + tmpl, err := template.New(name).Parse(templateString) + if err != nil { + return "", err + } + err = tmpl.Execute(&buf, jobSpec) + if err != nil { + return "", err + } + return buf.String(), err +} + +type JobType string + +const ( + Commit JobType = "commit" + Execution JobType = "exec" + Boostrap JobType = "bootstrap" +) + +func JobName(jobType JobType, source string, destination, version string) string { + if version != "" { + return fmt.Sprintf("ccip-%s-%s-%s-%s", jobType, source, destination, version) + } + return fmt.Sprintf("ccip-%s-%s-%s", jobType, source, destination) +} + +type CCIPJobSpecParams struct { + Name string + Version string + OffRamp common.Address + CommitStore common.Address + SourceChainName string + DestChainName string + DestEvmChainId uint64 + TokenPricesUSDPipeline string + PriceGetterConfig string + SourceStartBlock uint64 + DestStartBlock uint64 + USDCAttestationAPI string + USDCConfig *config.USDCConfig + P2PV2Bootstrappers pq.StringArray +} + +func (params CCIPJobSpecParams) Validate() error { + if params.CommitStore == common.HexToAddress("0x0") { + return fmt.Errorf("must set commit store address") + } + return nil +} + +func (params CCIPJobSpecParams) ValidateCommitJobSpec() error { + commonErr := params.Validate() + if commonErr != nil { + return commonErr + } + if params.OffRamp == common.HexToAddress("0x0") { + return fmt.Errorf("OffRamp cannot be empty for execution job") + } + // Validate token prices config + // NB: only validate the dynamic price getter config if present since we could also be using the pipeline instead. + // NB: make this test mandatory once we switch to dynamic price getter only. + if params.PriceGetterConfig != "" { + if _, err := pricegetter.NewDynamicPriceGetterConfig(params.PriceGetterConfig); err != nil { + return fmt.Errorf("invalid price getter config: %w", err) + } + } + return nil +} + +func (params CCIPJobSpecParams) ValidateExecJobSpec() error { + commonErr := params.Validate() + if commonErr != nil { + return commonErr + } + if params.OffRamp == common.HexToAddress("0x0") { + return fmt.Errorf("OffRamp cannot be empty for execution job") + } + return nil +} + +// CommitJobSpec generates template for CCIP-relay job spec. +// OCRKeyBundleID,TransmitterID need to be set from the calling function +func (params CCIPJobSpecParams) CommitJobSpec() (*OCR2TaskJobSpec, error) { + err := params.ValidateCommitJobSpec() + if err != nil { + return nil, fmt.Errorf("invalid job spec params: %w", err) + } + + pluginConfig := map[string]interface{}{ + "offRamp": fmt.Sprintf(`"%s"`, params.OffRamp.Hex()), + } + if params.TokenPricesUSDPipeline != "" { + pluginConfig["tokenPricesUSDPipeline"] = fmt.Sprintf(`""" +%s +"""`, params.TokenPricesUSDPipeline) + } + if params.PriceGetterConfig != "" { + pluginConfig["priceGetterConfig"] = fmt.Sprintf(`""" +%s +"""`, params.PriceGetterConfig) + } + + ocrSpec := job.OCR2OracleSpec{ + Relay: relay.NetworkEVM, + PluginType: types.CCIPCommit, + ContractID: params.CommitStore.Hex(), + ContractConfigConfirmations: 1, + ContractConfigTrackerPollInterval: models.Interval(20 * time.Second), + P2PV2Bootstrappers: params.P2PV2Bootstrappers, + PluginConfig: pluginConfig, + RelayConfig: map[string]interface{}{ + "chainID": params.DestEvmChainId, + }, + } + if params.DestStartBlock > 0 { + ocrSpec.PluginConfig["destStartBlock"] = params.DestStartBlock + } + if params.SourceStartBlock > 0 { + ocrSpec.PluginConfig["sourceStartBlock"] = params.SourceStartBlock + } + return &OCR2TaskJobSpec{ + OCR2OracleSpec: ocrSpec, + JobType: "offchainreporting2", + Name: JobName(Commit, params.SourceChainName, params.DestChainName, params.Version), + }, nil +} + +// ExecutionJobSpec generates template for CCIP-execution job spec. +// OCRKeyBundleID,TransmitterID need to be set from the calling function +func (params CCIPJobSpecParams) ExecutionJobSpec() (*OCR2TaskJobSpec, error) { + err := params.ValidateExecJobSpec() + if err != nil { + return nil, err + } + ocrSpec := job.OCR2OracleSpec{ + Relay: relay.NetworkEVM, + PluginType: types.CCIPExecution, + ContractID: params.OffRamp.Hex(), + ContractConfigConfirmations: 1, + ContractConfigTrackerPollInterval: models.Interval(20 * time.Second), + + P2PV2Bootstrappers: params.P2PV2Bootstrappers, + PluginConfig: map[string]interface{}{}, + RelayConfig: map[string]interface{}{ + "chainID": params.DestEvmChainId, + }, + } + if params.DestStartBlock > 0 { + ocrSpec.PluginConfig["destStartBlock"] = params.DestStartBlock + } + if params.SourceStartBlock > 0 { + ocrSpec.PluginConfig["sourceStartBlock"] = params.SourceStartBlock + } + if params.USDCAttestationAPI != "" { + ocrSpec.PluginConfig["USDCConfig.AttestationAPI"] = fmt.Sprintf("\"%s\"", params.USDCAttestationAPI) + ocrSpec.PluginConfig["USDCConfig.SourceTokenAddress"] = fmt.Sprintf("\"%s\"", utils.RandomAddress().String()) + ocrSpec.PluginConfig["USDCConfig.SourceMessageTransmitterAddress"] = fmt.Sprintf("\"%s\"", utils.RandomAddress().String()) + ocrSpec.PluginConfig["USDCConfig.AttestationAPITimeoutSeconds"] = 5 + } + if params.USDCConfig != nil { + ocrSpec.PluginConfig["USDCConfig.AttestationAPI"] = fmt.Sprintf(`"%s"`, params.USDCConfig.AttestationAPI) + ocrSpec.PluginConfig["USDCConfig.SourceTokenAddress"] = fmt.Sprintf(`"%s"`, params.USDCConfig.SourceTokenAddress) + ocrSpec.PluginConfig["USDCConfig.SourceMessageTransmitterAddress"] = fmt.Sprintf(`"%s"`, params.USDCConfig.SourceMessageTransmitterAddress) + ocrSpec.PluginConfig["USDCConfig.AttestationAPITimeoutSeconds"] = params.USDCConfig.AttestationAPITimeoutSeconds + } + return &OCR2TaskJobSpec{ + OCR2OracleSpec: ocrSpec, + JobType: "offchainreporting2", + Name: JobName(Execution, params.SourceChainName, params.DestChainName, params.Version), + }, err +} + +func (params CCIPJobSpecParams) BootstrapJob(contractID string) *OCR2TaskJobSpec { + bootstrapSpec := job.OCR2OracleSpec{ + ContractID: contractID, + Relay: relay.NetworkEVM, + ContractConfigConfirmations: 1, + ContractConfigTrackerPollInterval: models.Interval(20 * time.Second), + RelayConfig: map[string]interface{}{ + "chainID": params.DestEvmChainId, + }, + } + return &OCR2TaskJobSpec{ + Name: fmt.Sprintf("%s-%s", Boostrap, params.DestChainName), + JobType: "bootstrap", + OCR2OracleSpec: bootstrapSpec, + } +} + +func (c *CCIPIntegrationTestHarness) NewCCIPJobSpecParams(tokenPricesUSDPipeline string, priceGetterConfig string, configBlock int64, usdcAttestationAPI string) CCIPJobSpecParams { + return CCIPJobSpecParams{ + CommitStore: c.Dest.CommitStore.Address(), + OffRamp: c.Dest.OffRamp.Address(), + DestEvmChainId: c.Dest.ChainID, + SourceChainName: "SimulatedSource", + DestChainName: "SimulatedDest", + TokenPricesUSDPipeline: tokenPricesUSDPipeline, + PriceGetterConfig: priceGetterConfig, + DestStartBlock: uint64(configBlock), + USDCAttestationAPI: usdcAttestationAPI, + } +} diff --git a/core/services/ocr2/plugins/ccip/testhelpers/offramp.go b/core/services/ocr2/plugins/ccip/testhelpers/offramp.go new file mode 100644 index 00000000000..d10e693325d --- /dev/null +++ b/core/services/ocr2/plugins/ccip/testhelpers/offramp.go @@ -0,0 +1,119 @@ +package testhelpers + +import ( + "sync" + "testing" + + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/pkg/errors" + + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/evm_2_evm_offramp" + mock_contracts "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/mocks" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipcalc" +) + +type FakeOffRamp struct { + *mock_contracts.EVM2EVMOffRampInterface + + rateLimiterState cciptypes.TokenBucketRateLimit + senderNonces map[common.Address]uint64 + tokenToPool map[common.Address]common.Address + dynamicConfig evm_2_evm_offramp.EVM2EVMOffRampDynamicConfig + sourceToDestTokens map[common.Address]common.Address + + mu sync.RWMutex +} + +func NewFakeOffRamp(t *testing.T) (*FakeOffRamp, common.Address) { + addr := utils.RandomAddress() + mockOffRamp := mock_contracts.NewEVM2EVMOffRampInterface(t) + mockOffRamp.On("Address").Return(addr).Maybe() + + offRamp := &FakeOffRamp{EVM2EVMOffRampInterface: mockOffRamp} + return offRamp, addr +} + +func (o *FakeOffRamp) CurrentRateLimiterState(opts *bind.CallOpts) (cciptypes.TokenBucketRateLimit, error) { + return getOffRampVal(o, func(o *FakeOffRamp) (cciptypes.TokenBucketRateLimit, error) { return o.rateLimiterState, nil }) +} + +func (o *FakeOffRamp) SetRateLimiterState(state cciptypes.TokenBucketRateLimit) { + setOffRampVal(o, func(o *FakeOffRamp) { o.rateLimiterState = state }) +} + +func (o *FakeOffRamp) GetSenderNonce(opts *bind.CallOpts, sender common.Address) (uint64, error) { + return getOffRampVal(o, func(o *FakeOffRamp) (uint64, error) { return o.senderNonces[sender], nil }) +} + +func (o *FakeOffRamp) SetSenderNonces(senderNonces map[cciptypes.Address]uint64) { + evmSenderNonces := make(map[common.Address]uint64) + for k, v := range senderNonces { + addrs, _ := ccipcalc.GenericAddrsToEvm(k) + evmSenderNonces[addrs[0]] = v + } + + setOffRampVal(o, func(o *FakeOffRamp) { o.senderNonces = evmSenderNonces }) +} + +func (o *FakeOffRamp) GetPoolByDestToken(opts *bind.CallOpts, destToken common.Address) (common.Address, error) { + return getOffRampVal(o, func(o *FakeOffRamp) (common.Address, error) { + addr, exists := o.tokenToPool[destToken] + if !exists { + return common.Address{}, errors.New("not found") + } + return addr, nil + }) +} + +func (o *FakeOffRamp) SetTokenPools(tokenToPool map[common.Address]common.Address) { + setOffRampVal(o, func(o *FakeOffRamp) { o.tokenToPool = tokenToPool }) +} + +func (o *FakeOffRamp) GetDynamicConfig(opts *bind.CallOpts) (evm_2_evm_offramp.EVM2EVMOffRampDynamicConfig, error) { + return getOffRampVal(o, func(o *FakeOffRamp) (evm_2_evm_offramp.EVM2EVMOffRampDynamicConfig, error) { + return o.dynamicConfig, nil + }) +} + +func (o *FakeOffRamp) SetDynamicConfig(cfg evm_2_evm_offramp.EVM2EVMOffRampDynamicConfig) { + setOffRampVal(o, func(o *FakeOffRamp) { o.dynamicConfig = cfg }) +} + +func (o *FakeOffRamp) SetSourceToDestTokens(m map[common.Address]common.Address) { + setOffRampVal(o, func(o *FakeOffRamp) { o.sourceToDestTokens = m }) +} + +func (o *FakeOffRamp) GetSupportedTokens(opts *bind.CallOpts) ([]common.Address, error) { + return getOffRampVal(o, func(o *FakeOffRamp) ([]common.Address, error) { + tks := make([]common.Address, 0, len(o.sourceToDestTokens)) + for tk := range o.sourceToDestTokens { + tks = append(tks, tk) + } + return tks, nil + }) +} + +func (o *FakeOffRamp) GetDestinationTokens(opts *bind.CallOpts) ([]common.Address, error) { + return getOffRampVal(o, func(o *FakeOffRamp) ([]common.Address, error) { + tokens := make([]common.Address, 0, len(o.sourceToDestTokens)) + for _, dst := range o.sourceToDestTokens { + tokens = append(tokens, dst) + } + return tokens, nil + }) +} + +func getOffRampVal[T any](o *FakeOffRamp, getter func(o *FakeOffRamp) (T, error)) (T, error) { + o.mu.RLock() + defer o.mu.RUnlock() + return getter(o) +} + +func setOffRampVal(o *FakeOffRamp, setter func(o *FakeOffRamp)) { + o.mu.Lock() + defer o.mu.Unlock() + setter(o) +} diff --git a/core/services/ocr2/plugins/ccip/testhelpers/simulated_backend.go b/core/services/ocr2/plugins/ccip/testhelpers/simulated_backend.go new file mode 100644 index 00000000000..ea91362aaae --- /dev/null +++ b/core/services/ocr2/plugins/ccip/testhelpers/simulated_backend.go @@ -0,0 +1,75 @@ +package testhelpers + +import ( + "context" + "math/big" + "testing" + "time" + + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/accounts/abi/bind/backends" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core" + ethtypes "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/eth/ethconfig" + "github.com/stretchr/testify/require" + + "github.com/smartcontractkit/chainlink/v2/core/services/keystore" +) + +// FirstBlockAge is used to compute first block's timestamp in SimulatedBackend (time.Now() - FirstBlockAge) +const FirstBlockAge = 24 * time.Hour + +func SetupChain(t *testing.T) (*backends.SimulatedBackend, *bind.TransactOpts) { + key, err := crypto.GenerateKey() + require.NoError(t, err) + user, err := bind.NewKeyedTransactorWithChainID(key, big.NewInt(1337)) + require.NoError(t, err) + chain := backends.NewSimulatedBackend(core.GenesisAlloc{ + user.From: {Balance: new(big.Int).Mul(big.NewInt(1000), big.NewInt(1e18))}}, + ethconfig.Defaults.Miner.GasCeil) + // CCIP relies on block timestamps, but SimulatedBackend uses by default clock starting from 1970-01-01 + // This trick is used to move the clock closer to the current time. We set first block to be X hours ago. + // Tests create plenty of transactions so this number can't be too low, every new block mined will tick the clock, + // if you mine more than "X hours" transactions, SimulatedBackend will panic because generated timestamps will be in the future. + // IMPORTANT: Any adjustments to FirstBlockAge will automatically update PermissionLessExecutionThresholdSeconds in tests + blockTime := time.UnixMilli(int64(chain.Blockchain().CurrentHeader().Time)) + err = chain.AdjustTime(time.Since(blockTime) - FirstBlockAge) + require.NoError(t, err) + chain.Commit() + return chain, user +} + +type EthKeyStoreSim struct { + ETHKS keystore.Eth + CSAKS keystore.CSA +} + +func (ks EthKeyStoreSim) CSA() keystore.CSA { + return ks.CSAKS +} + +func (ks EthKeyStoreSim) Eth() keystore.Eth { + return ks.ETHKS +} + +func (ks EthKeyStoreSim) SignTx(address common.Address, tx *ethtypes.Transaction, chainID *big.Int) (*ethtypes.Transaction, error) { + if chainID.String() == "1000" { + // A terrible hack, just for the multichain test. All simulation clients run on chainID 1337. + // We let the DestChainSelector actually use 1337 to make sure the offchainConfig digests are properly generated. + return ks.ETHKS.SignTx(context.Background(), address, tx, big.NewInt(1337)) + } + return ks.ETHKS.SignTx(context.Background(), address, tx, chainID) +} + +var _ keystore.Eth = EthKeyStoreSim{}.ETHKS + +func ConfirmTxs(t *testing.T, txs []*ethtypes.Transaction, chain *backends.SimulatedBackend) { + chain.Commit() + for _, tx := range txs { + rec, err := bind.WaitMined(context.Background(), chain, tx) + require.NoError(t, err) + require.Equal(t, uint64(1), rec.Status) + } +} diff --git a/core/services/ocr2/plugins/ccip/testhelpers/structfields.go b/core/services/ocr2/plugins/ccip/testhelpers/structfields.go new file mode 100644 index 00000000000..88e0fffa672 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/testhelpers/structfields.go @@ -0,0 +1,44 @@ +package testhelpers + +import ( + "fmt" + "reflect" + "strings" +) + +// FindStructFieldsOfCertainType recursively iterates over struct fields and returns all the fields of the provided type. +func FindStructFieldsOfCertainType(targetType string, v any) []string { + typesAndFields := TypesAndFields("", reflect.ValueOf(v)) + results := make([]string, 0) + for _, field := range typesAndFields { + if strings.Contains(field, targetType) { + results = append(results, field) + } + } + return results +} + +// TypesAndFields will find and return all the fields and their types of the provided value. +// NOTE: This is not intended for production use, it's a helper method for tests. +func TypesAndFields(prefix string, v reflect.Value) []string { + results := make([]string, 0) + + s := v + typeOfT := s.Type() + for i := 0; i < s.NumField(); i++ { + f := s.Field(i) + typeAndName := fmt.Sprintf("%s%s %v", prefix, f.Type(), typeOfT.Field(i).Name) + results = append(results, typeAndName) + + if f.Kind().String() == "ptr" { + results = append(results, TypesAndFields(typeOfT.Field(i).Name, f.Elem())...) + } + + if f.Kind().String() == "struct" { + x1 := reflect.ValueOf(f.Interface()) + results = append(results, TypesAndFields(typeOfT.Field(i).Name, x1)...) + } + } + + return results +} diff --git a/core/services/ocr2/plugins/ccip/testhelpers/testhelpers_1_4_0/ccip_contracts_1_4_0.go b/core/services/ocr2/plugins/ccip/testhelpers/testhelpers_1_4_0/ccip_contracts_1_4_0.go new file mode 100644 index 00000000000..9906a7b365a --- /dev/null +++ b/core/services/ocr2/plugins/ccip/testhelpers/testhelpers_1_4_0/ccip_contracts_1_4_0.go @@ -0,0 +1,1589 @@ +package testhelpers_1_4_0 + +import ( + "context" + "fmt" + "math" + "math/big" + "testing" + "time" + + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/accounts/abi/bind/backends" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/core/types" + "github.com/pkg/errors" + "github.com/rs/zerolog/log" + "github.com/stretchr/testify/require" + + "github.com/smartcontractkit/libocr/offchainreporting2/confighelper" + ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2/types" + ocr2types "github.com/smartcontractkit/libocr/offchainreporting2plus/types" + + "github.com/smartcontractkit/chainlink-common/pkg/config" + "github.com/smartcontractkit/chainlink-common/pkg/hashutil" + "github.com/smartcontractkit/chainlink-common/pkg/merklemulti" + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils" + burn_mint_token_pool "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/burn_mint_token_pool_1_4_0" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/commit_store_1_2_0" + evm_2_evm_offramp "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/evm_2_evm_offramp_1_2_0" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/evm_2_evm_onramp_1_2_0" + evm_2_evm_onramp "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/evm_2_evm_onramp_1_2_0" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/lock_release_token_pool_1_0_0" + lock_release_token_pool "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/lock_release_token_pool_1_4_0" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/maybe_revert_message_receiver" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/mock_rmn_contract" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/price_registry_1_2_0" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/rmn_proxy_contract" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/router" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/weth9" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/link_token_interface" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/shared/generated/burn_mint_erc677" + "github.com/smartcontractkit/chainlink/v2/core/logger" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/abihelpers" + ccipconfig "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/config" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/testhelpers" +) + +var ( + // Source + SourcePool = "source Link pool" + SourcePriceRegistry = "source PriceRegistry" + OnRamp = "onramp" + OnRampNative = "onramp-native" + SourceRouter = "source router" + + // Dest + OffRamp = "offramp" + DestPool = "dest Link pool" + + Receiver = "receiver" + Sender = "sender" + Link = func(amount int64) *big.Int { return new(big.Int).Mul(big.NewInt(1e18), big.NewInt(amount)) } + HundredLink = Link(100) + LinkUSDValue = func(amount int64) *big.Int { return new(big.Int).Mul(big.NewInt(1e18), big.NewInt(amount)) } + SourceChainID = uint64(1000) + SourceChainSelector = uint64(11787463284727550157) + DestChainID = uint64(1337) + DestChainSelector = uint64(3379446385462418246) +) + +// Backwards compat, in principle these statuses are version dependent +// TODO: Adjust integration tests to be version agnostic using readers +var ( + ExecutionStateSuccess = MessageExecutionState(cciptypes.ExecutionStateSuccess) + ExecutionStateFailure = MessageExecutionState(cciptypes.ExecutionStateFailure) +) + +type MessageExecutionState cciptypes.MessageExecutionState +type CommitOffchainConfig struct { + v1_2_0.JSONCommitOffchainConfig +} + +func (c CommitOffchainConfig) Encode() ([]byte, error) { + return ccipconfig.EncodeOffchainConfig(c.JSONCommitOffchainConfig) +} + +func NewCommitOffchainConfig( + GasPriceHeartBeat config.Duration, + DAGasPriceDeviationPPB uint32, + ExecGasPriceDeviationPPB uint32, + TokenPriceHeartBeat config.Duration, + TokenPriceDeviationPPB uint32, + InflightCacheExpiry config.Duration, + priceReportingDisabled bool) CommitOffchainConfig { + return CommitOffchainConfig{v1_2_0.JSONCommitOffchainConfig{ + GasPriceHeartBeat: GasPriceHeartBeat, + DAGasPriceDeviationPPB: DAGasPriceDeviationPPB, + ExecGasPriceDeviationPPB: ExecGasPriceDeviationPPB, + TokenPriceHeartBeat: TokenPriceHeartBeat, + TokenPriceDeviationPPB: TokenPriceDeviationPPB, + InflightCacheExpiry: InflightCacheExpiry, + PriceReportingDisabled: priceReportingDisabled, + }} +} + +type CommitOnchainConfig struct { + ccipdata.CommitOnchainConfig +} + +func NewCommitOnchainConfig( + PriceRegistry common.Address, +) CommitOnchainConfig { + return CommitOnchainConfig{ccipdata.CommitOnchainConfig{ + PriceRegistry: PriceRegistry, + }} +} + +type ExecOnchainConfig struct { + v1_2_0.ExecOnchainConfig +} + +func NewExecOnchainConfig( + PermissionLessExecutionThresholdSeconds uint32, + Router common.Address, + PriceRegistry common.Address, + MaxNumberOfTokensPerMsg uint16, + MaxDataBytes uint32, + MaxPoolReleaseOrMintGas uint32, +) ExecOnchainConfig { + return ExecOnchainConfig{v1_2_0.ExecOnchainConfig{ + PermissionLessExecutionThresholdSeconds: PermissionLessExecutionThresholdSeconds, + Router: Router, + PriceRegistry: PriceRegistry, + MaxNumberOfTokensPerMsg: MaxNumberOfTokensPerMsg, + MaxDataBytes: MaxDataBytes, + MaxPoolReleaseOrMintGas: MaxPoolReleaseOrMintGas, + }} +} + +type ExecOffchainConfig struct { + v1_2_0.JSONExecOffchainConfig +} + +func (c ExecOffchainConfig) Encode() ([]byte, error) { + return ccipconfig.EncodeOffchainConfig(c.JSONExecOffchainConfig) +} + +func NewExecOffchainConfig( + DestOptimisticConfirmations uint32, + BatchGasLimit uint32, + RelativeBoostPerWaitHour float64, + InflightCacheExpiry config.Duration, + RootSnoozeTime config.Duration, + BatchingStrategyID uint32, +) ExecOffchainConfig { + return ExecOffchainConfig{v1_2_0.JSONExecOffchainConfig{ + DestOptimisticConfirmations: DestOptimisticConfirmations, + BatchGasLimit: BatchGasLimit, + RelativeBoostPerWaitHour: RelativeBoostPerWaitHour, + InflightCacheExpiry: InflightCacheExpiry, + RootSnoozeTime: RootSnoozeTime, + BatchingStrategyID: BatchingStrategyID, + }} +} + +type MaybeRevertReceiver struct { + Receiver *maybe_revert_message_receiver.MaybeRevertMessageReceiver + Strict bool +} + +type Common struct { + ChainID uint64 + ChainSelector uint64 + User *bind.TransactOpts + Chain *backends.SimulatedBackend + LinkToken *link_token_interface.LinkToken + LinkTokenPool *lock_release_token_pool.LockReleaseTokenPool + CustomToken *link_token_interface.LinkToken + WrappedNative *weth9.WETH9 + WrappedNativePool *lock_release_token_pool_1_0_0.LockReleaseTokenPool + ARM *mock_rmn_contract.MockRMNContract + ARMProxy *rmn_proxy_contract.RMNProxyContract + PriceRegistry *price_registry_1_2_0.PriceRegistry +} + +type SourceChain struct { + Common + Router *router.Router + OnRamp *evm_2_evm_onramp.EVM2EVMOnRamp +} + +type DestinationChain struct { + Common + + CommitStore *commit_store_1_2_0.CommitStore + Router *router.Router + OffRamp *evm_2_evm_offramp.EVM2EVMOffRamp + Receivers []MaybeRevertReceiver +} + +type OCR2Config struct { + Signers []common.Address + Transmitters []common.Address + F uint8 + OnchainConfig []byte + OffchainConfigVersion uint64 + OffchainConfig []byte +} + +type BalanceAssertion struct { + Name string + Address common.Address + Expected string + Getter func(t *testing.T, addr common.Address) *big.Int + Within string +} + +type BalanceReq struct { + Name string + Addr common.Address + Getter func(t *testing.T, addr common.Address) *big.Int +} + +type CCIPContracts struct { + Source SourceChain + Dest DestinationChain + Oracles []confighelper.OracleIdentityExtra + + commitOCRConfig, execOCRConfig *OCR2Config +} + +func (c *CCIPContracts) DeployNewOffRamp(t *testing.T) { + prevOffRamp := common.HexToAddress("") + if c.Dest.OffRamp != nil { + prevOffRamp = c.Dest.OffRamp.Address() + } + offRampAddress, _, _, err := evm_2_evm_offramp.DeployEVM2EVMOffRamp( + c.Dest.User, + c.Dest.Chain, + evm_2_evm_offramp.EVM2EVMOffRampStaticConfig{ + CommitStore: c.Dest.CommitStore.Address(), + ChainSelector: c.Dest.ChainSelector, + SourceChainSelector: c.Source.ChainSelector, + OnRamp: c.Source.OnRamp.Address(), + PrevOffRamp: prevOffRamp, + ArmProxy: c.Dest.ARMProxy.Address(), + }, + []common.Address{c.Source.LinkToken.Address()}, // source tokens + []common.Address{c.Dest.LinkTokenPool.Address()}, // pools + evm_2_evm_offramp.RateLimiterConfig{ + IsEnabled: true, + Capacity: LinkUSDValue(100), + Rate: LinkUSDValue(1), + }, + ) + require.NoError(t, err) + c.Dest.Chain.Commit() + + c.Dest.OffRamp, err = evm_2_evm_offramp.NewEVM2EVMOffRamp(offRampAddress, c.Dest.Chain) + require.NoError(t, err) + + c.Dest.Chain.Commit() + c.Source.Chain.Commit() +} + +func (c *CCIPContracts) EnableOffRamp(t *testing.T) { + _, err := c.Dest.Router.ApplyRampUpdates(c.Dest.User, nil, nil, []router.RouterOffRamp{{SourceChainSelector: SourceChainSelector, OffRamp: c.Dest.OffRamp.Address()}}) + require.NoError(t, err) + c.Dest.Chain.Commit() + + onChainConfig := c.CreateDefaultExecOnchainConfig(t) + offChainConfig := c.CreateDefaultExecOffchainConfig(t) + + c.SetupExecOCR2Config(t, onChainConfig, offChainConfig) +} + +func (c *CCIPContracts) EnableCommitStore(t *testing.T) { + onChainConfig := c.CreateDefaultCommitOnchainConfig(t) + offChainConfig := c.CreateDefaultCommitOffchainConfig(t) + + c.SetupCommitOCR2Config(t, onChainConfig, offChainConfig) + + _, err := c.Dest.PriceRegistry.ApplyPriceUpdatersUpdates(c.Dest.User, []common.Address{c.Dest.CommitStore.Address()}, []common.Address{}) + require.NoError(t, err) + c.Dest.Chain.Commit() +} + +func (c *CCIPContracts) DeployNewOnRamp(t *testing.T) { + t.Log("Deploying new onRamp") + // find the last onRamp + prevOnRamp := common.HexToAddress("") + if c.Source.OnRamp != nil { + prevOnRamp = c.Source.OnRamp.Address() + } + onRampAddress, _, _, err := evm_2_evm_onramp.DeployEVM2EVMOnRamp( + c.Source.User, // user + c.Source.Chain, // client + evm_2_evm_onramp.EVM2EVMOnRampStaticConfig{ + LinkToken: c.Source.LinkToken.Address(), + ChainSelector: c.Source.ChainSelector, + DestChainSelector: c.Dest.ChainSelector, + DefaultTxGasLimit: 200_000, + MaxNopFeesJuels: big.NewInt(0).Mul(big.NewInt(100_000_000), big.NewInt(1e18)), + PrevOnRamp: prevOnRamp, + ArmProxy: c.Source.ARM.Address(), // ARM + }, + evm_2_evm_onramp.EVM2EVMOnRampDynamicConfig{ + Router: c.Source.Router.Address(), + MaxNumberOfTokensPerMsg: 5, + DestGasOverhead: 350_000, + DestGasPerPayloadByte: 16, + DestDataAvailabilityOverheadGas: 33_596, + DestGasPerDataAvailabilityByte: 16, + DestDataAvailabilityMultiplierBps: 6840, // 0.684 + PriceRegistry: c.Source.PriceRegistry.Address(), + MaxDataBytes: 1e5, + MaxPerMsgGasLimit: 4_000_000, + }, + []evm_2_evm_onramp.InternalPoolUpdate{ + { + Token: c.Source.LinkToken.Address(), + Pool: c.Source.LinkTokenPool.Address(), + }, + }, + evm_2_evm_onramp.RateLimiterConfig{ + IsEnabled: true, + Capacity: LinkUSDValue(100), + Rate: LinkUSDValue(1), + }, + []evm_2_evm_onramp.EVM2EVMOnRampFeeTokenConfigArgs{ + { + Token: c.Source.LinkToken.Address(), + NetworkFeeUSDCents: 1_00, + GasMultiplierWeiPerEth: 1e18, + PremiumMultiplierWeiPerEth: 9e17, + Enabled: true, + }, + { + Token: c.Source.WrappedNative.Address(), + NetworkFeeUSDCents: 1_00, + GasMultiplierWeiPerEth: 1e18, + PremiumMultiplierWeiPerEth: 1e18, + Enabled: true, + }, + }, + []evm_2_evm_onramp.EVM2EVMOnRampTokenTransferFeeConfigArgs{ + { + Token: c.Source.LinkToken.Address(), + MinFeeUSDCents: 50, // $0.5 + MaxFeeUSDCents: 1_000_000_00, // $ 1 million + DeciBps: 5_0, // 5 bps + DestGasOverhead: 34_000, + DestBytesOverhead: 32, + }, + }, + []evm_2_evm_onramp.EVM2EVMOnRampNopAndWeight{}, + ) + + require.NoError(t, err) + c.Source.Chain.Commit() + c.Dest.Chain.Commit() + c.Source.OnRamp, err = evm_2_evm_onramp.NewEVM2EVMOnRamp(onRampAddress, c.Source.Chain) + require.NoError(t, err) + c.Source.Chain.Commit() + c.Dest.Chain.Commit() +} + +func (c *CCIPContracts) EnableOnRamp(t *testing.T) { + t.Log("Setting onRamp on source router") + _, err := c.Source.Router.ApplyRampUpdates(c.Source.User, []router.RouterOnRamp{{DestChainSelector: c.Dest.ChainSelector, OnRamp: c.Source.OnRamp.Address()}}, nil, nil) + require.NoError(t, err) + c.Source.Chain.Commit() + c.Dest.Chain.Commit() +} + +func (c *CCIPContracts) DeployNewCommitStore(t *testing.T) { + commitStoreAddress, _, _, err := commit_store_1_2_0.DeployCommitStore( + c.Dest.User, // user + c.Dest.Chain, // client + commit_store_1_2_0.CommitStoreStaticConfig{ + ChainSelector: c.Dest.ChainSelector, + SourceChainSelector: c.Source.ChainSelector, + OnRamp: c.Source.OnRamp.Address(), + ArmProxy: c.Dest.ARMProxy.Address(), + }, + ) + require.NoError(t, err) + c.Dest.Chain.Commit() + // since CommitStoreHelper derives from CommitStore, it's safe to instantiate both on same address + c.Dest.CommitStore, err = commit_store_1_2_0.NewCommitStore(commitStoreAddress, c.Dest.Chain) + require.NoError(t, err) +} + +func (c *CCIPContracts) DeployNewPriceRegistry(t *testing.T) { + t.Log("Deploying new Price Registry") + destPricesAddress, _, _, err := price_registry_1_2_0.DeployPriceRegistry( + c.Dest.User, + c.Dest.Chain, + []common.Address{c.Dest.CommitStore.Address()}, + []common.Address{c.Dest.LinkToken.Address()}, + 60*60*24*14, // two weeks + ) + require.NoError(t, err) + c.Source.Chain.Commit() + c.Dest.Chain.Commit() + c.Dest.PriceRegistry, err = price_registry_1_2_0.NewPriceRegistry(destPricesAddress, c.Dest.Chain) + require.NoError(t, err) + + priceUpdates := price_registry_1_2_0.InternalPriceUpdates{ + TokenPriceUpdates: []price_registry_1_2_0.InternalTokenPriceUpdate{ + { + SourceToken: c.Dest.LinkToken.Address(), + UsdPerToken: big.NewInt(8e18), // 8usd + }, + { + SourceToken: c.Dest.WrappedNative.Address(), + UsdPerToken: big.NewInt(1e18), // 1usd + }, + }, + GasPriceUpdates: []price_registry_1_2_0.InternalGasPriceUpdate{ + { + DestChainSelector: c.Source.ChainSelector, + UsdPerUnitGas: big.NewInt(2000e9), // $2000 per eth * 1gwei = 2000e9 + }, + }, + } + _, err = c.Dest.PriceRegistry.UpdatePrices(c.Dest.User, priceUpdates) + require.NoError(t, err) + + c.Source.Chain.Commit() + c.Dest.Chain.Commit() + + t.Logf("New Price Registry deployed at %s", destPricesAddress.String()) +} + +func (c *CCIPContracts) SetNopsOnRamp(t *testing.T, nopsAndWeights []evm_2_evm_onramp.EVM2EVMOnRampNopAndWeight) { + tx, err := c.Source.OnRamp.SetNops(c.Source.User, nopsAndWeights) + require.NoError(t, err) + c.Source.Chain.Commit() + _, err = bind.WaitMined(context.Background(), c.Source.Chain, tx) + require.NoError(t, err) +} + +func (c *CCIPContracts) GetSourceLinkBalance(t *testing.T, addr common.Address) *big.Int { + return GetBalance(t, c.Source.Chain, c.Source.LinkToken.Address(), addr) +} + +func (c *CCIPContracts) GetDestLinkBalance(t *testing.T, addr common.Address) *big.Int { + return GetBalance(t, c.Dest.Chain, c.Dest.LinkToken.Address(), addr) +} + +func (c *CCIPContracts) GetSourceWrappedTokenBalance(t *testing.T, addr common.Address) *big.Int { + return GetBalance(t, c.Source.Chain, c.Source.WrappedNative.Address(), addr) +} + +func (c *CCIPContracts) GetDestWrappedTokenBalance(t *testing.T, addr common.Address) *big.Int { + return GetBalance(t, c.Dest.Chain, c.Dest.WrappedNative.Address(), addr) +} + +func (c *CCIPContracts) AssertBalances(t *testing.T, bas []BalanceAssertion) { + for _, b := range bas { + actual := b.Getter(t, b.Address) + t.Log("Checking balance for", b.Name, "at", b.Address.Hex(), "got", actual) + require.NotNil(t, actual, "%v getter return nil", b.Name) + if b.Within == "" { + require.Equal(t, b.Expected, actual.String(), "wrong balance for %s got %s want %s", b.Name, actual, b.Expected) + } else { + bi, _ := big.NewInt(0).SetString(b.Expected, 10) + withinI, _ := big.NewInt(0).SetString(b.Within, 10) + high := big.NewInt(0).Add(bi, withinI) + low := big.NewInt(0).Sub(bi, withinI) + require.Equal(t, -1, actual.Cmp(high), "wrong balance for %s got %s outside expected range [%s, %s]", b.Name, actual, low, high) + require.Equal(t, 1, actual.Cmp(low), "wrong balance for %s got %s outside expected range [%s, %s]", b.Name, actual, low, high) + } + } +} + +func AccountToAddress(accounts []ocr2types.Account) (addresses []common.Address, err error) { + for _, signer := range accounts { + bytes, err := hexutil.Decode(string(signer)) + if err != nil { + return []common.Address{}, errors.Wrap(err, fmt.Sprintf("given address is not valid %s", signer)) + } + if len(bytes) != 20 { + return []common.Address{}, errors.Errorf("address is not 20 bytes %s", signer) + } + addresses = append(addresses, common.BytesToAddress(bytes)) + } + return addresses, nil +} + +func OnchainPublicKeyToAddress(publicKeys []ocrtypes.OnchainPublicKey) (addresses []common.Address, err error) { + for _, signer := range publicKeys { + if len(signer) != 20 { + return []common.Address{}, errors.Errorf("address is not 20 bytes %s", signer) + } + addresses = append(addresses, common.BytesToAddress(signer)) + } + return addresses, nil +} + +func (c *CCIPContracts) DeriveOCR2Config(t *testing.T, oracles []confighelper.OracleIdentityExtra, rawOnchainConfig []byte, rawOffchainConfig []byte) *OCR2Config { + signers, transmitters, threshold, onchainConfig, offchainConfigVersion, offchainConfig, err := confighelper.ContractSetConfigArgsForTests( + 2*time.Second, // deltaProgress + 1*time.Second, // deltaResend + 1*time.Second, // deltaRound + 500*time.Millisecond, // deltaGrace + 2*time.Second, // deltaStage + 3, + []int{1, 1, 1, 1}, + oracles, + rawOffchainConfig, + 50*time.Millisecond, // Max duration query + 1*time.Second, // Max duration observation + 100*time.Millisecond, + 100*time.Millisecond, + 100*time.Millisecond, + 1, // faults + rawOnchainConfig, + ) + require.NoError(t, err) + lggr := logger.TestLogger(t) + lggr.Infow("Setting Config on Oracle Contract", + "signers", signers, + "transmitters", transmitters, + "threshold", threshold, + "onchainConfig", onchainConfig, + "encodedConfigVersion", offchainConfigVersion, + ) + signerAddresses, err := OnchainPublicKeyToAddress(signers) + require.NoError(t, err) + transmitterAddresses, err := AccountToAddress(transmitters) + require.NoError(t, err) + + return &OCR2Config{ + Signers: signerAddresses, + Transmitters: transmitterAddresses, + F: threshold, + OnchainConfig: onchainConfig, + OffchainConfigVersion: offchainConfigVersion, + OffchainConfig: offchainConfig, + } +} + +func (c *CCIPContracts) SetupCommitOCR2Config(t *testing.T, commitOnchainConfig, commitOffchainConfig []byte) { + c.commitOCRConfig = c.DeriveOCR2Config(t, c.Oracles, commitOnchainConfig, commitOffchainConfig) + // Set the DON on the commit store + _, err := c.Dest.CommitStore.SetOCR2Config( + c.Dest.User, + c.commitOCRConfig.Signers, + c.commitOCRConfig.Transmitters, + c.commitOCRConfig.F, + c.commitOCRConfig.OnchainConfig, + c.commitOCRConfig.OffchainConfigVersion, + c.commitOCRConfig.OffchainConfig, + ) + require.NoError(t, err) + c.Dest.Chain.Commit() +} + +func (c *CCIPContracts) SetupExecOCR2Config(t *testing.T, execOnchainConfig, execOffchainConfig []byte) { + c.execOCRConfig = c.DeriveOCR2Config(t, c.Oracles, execOnchainConfig, execOffchainConfig) + // Same DON on the offramp + _, err := c.Dest.OffRamp.SetOCR2Config( + c.Dest.User, + c.execOCRConfig.Signers, + c.execOCRConfig.Transmitters, + c.execOCRConfig.F, + c.execOCRConfig.OnchainConfig, + c.execOCRConfig.OffchainConfigVersion, + c.execOCRConfig.OffchainConfig, + ) + require.NoError(t, err) + c.Dest.Chain.Commit() +} + +func (c *CCIPContracts) SetupOnchainConfig(t *testing.T, commitOnchainConfig, commitOffchainConfig, execOnchainConfig, execOffchainConfig []byte) int64 { + // Note We do NOT set the payees, payment is done in the OCR2Base implementation + blockBeforeConfig, err := c.Dest.Chain.BlockByNumber(context.Background(), nil) + require.NoError(t, err) + + c.SetupCommitOCR2Config(t, commitOnchainConfig, commitOffchainConfig) + c.SetupExecOCR2Config(t, execOnchainConfig, execOffchainConfig) + + return blockBeforeConfig.Number().Int64() +} + +func (c *CCIPContracts) SetupLockAndMintTokenPool( + sourceTokenAddress common.Address, + wrappedTokenName, + wrappedTokenSymbol string) (common.Address, *burn_mint_erc677.BurnMintERC677, error) { + // Deploy dest token & pool + destTokenAddress, _, _, err := burn_mint_erc677.DeployBurnMintERC677(c.Dest.User, c.Dest.Chain, wrappedTokenName, wrappedTokenSymbol, 18, big.NewInt(0)) + if err != nil { + return [20]byte{}, nil, err + } + c.Dest.Chain.Commit() + + destToken, err := burn_mint_erc677.NewBurnMintERC677(destTokenAddress, c.Dest.Chain) + if err != nil { + return [20]byte{}, nil, err + } + + destPoolAddress, _, destPool, err := burn_mint_token_pool.DeployBurnMintTokenPool( + c.Dest.User, + c.Dest.Chain, + destTokenAddress, + []common.Address{}, // pool originalSender allowList + c.Dest.ARMProxy.Address(), + c.Dest.Router.Address(), + ) + if err != nil { + return [20]byte{}, nil, err + } + c.Dest.Chain.Commit() + + _, err = destToken.GrantMintAndBurnRoles(c.Dest.User, destPoolAddress) + if err != nil { + return [20]byte{}, nil, err + } + + _, err = destPool.ApplyChainUpdates(c.Dest.User, + []burn_mint_token_pool.TokenPoolChainUpdate{ + { + RemoteChainSelector: c.Source.ChainSelector, + Allowed: true, + OutboundRateLimiterConfig: burn_mint_token_pool.RateLimiterConfig{ + IsEnabled: true, + Capacity: HundredLink, + Rate: big.NewInt(1e18), + }, + InboundRateLimiterConfig: burn_mint_token_pool.RateLimiterConfig{ + IsEnabled: true, + Capacity: HundredLink, + Rate: big.NewInt(1e18), + }, + }, + }) + if err != nil { + return [20]byte{}, nil, err + } + c.Dest.Chain.Commit() + + sourcePoolAddress, _, sourcePool, err := lock_release_token_pool.DeployLockReleaseTokenPool( + c.Source.User, + c.Source.Chain, + sourceTokenAddress, + []common.Address{}, // empty allowList at deploy time indicates pool has no original sender restrictions + c.Source.ARMProxy.Address(), + true, + c.Source.Router.Address(), + ) + if err != nil { + return [20]byte{}, nil, err + } + c.Source.Chain.Commit() + + // set onRamp as valid caller for source pool + _, err = sourcePool.ApplyChainUpdates(c.Source.User, []lock_release_token_pool.TokenPoolChainUpdate{ + { + RemoteChainSelector: c.Dest.ChainSelector, + Allowed: true, + OutboundRateLimiterConfig: lock_release_token_pool.RateLimiterConfig{ + IsEnabled: true, + Capacity: HundredLink, + Rate: big.NewInt(1e18), + }, + InboundRateLimiterConfig: lock_release_token_pool.RateLimiterConfig{ + IsEnabled: true, + Capacity: HundredLink, + Rate: big.NewInt(1e18), + }, + }, + }) + if err != nil { + return [20]byte{}, nil, err + } + c.Source.Chain.Commit() + + wrappedNativeAddress, err := c.Source.Router.GetWrappedNative(nil) + if err != nil { + return [20]byte{}, nil, err + } + + //native token is used as fee token + _, err = c.Source.PriceRegistry.UpdatePrices(c.Source.User, price_registry_1_2_0.InternalPriceUpdates{ + TokenPriceUpdates: []price_registry_1_2_0.InternalTokenPriceUpdate{ + { + SourceToken: sourceTokenAddress, + UsdPerToken: big.NewInt(5), + }, + }, + GasPriceUpdates: []price_registry_1_2_0.InternalGasPriceUpdate{}, + }) + if err != nil { + return [20]byte{}, nil, err + } + c.Source.Chain.Commit() + + _, err = c.Source.PriceRegistry.ApplyFeeTokensUpdates(c.Source.User, []common.Address{wrappedNativeAddress}, nil) + if err != nil { + return [20]byte{}, nil, err + } + c.Source.Chain.Commit() + + // add new token pool created above + _, err = c.Source.OnRamp.ApplyPoolUpdates(c.Source.User, nil, []evm_2_evm_onramp.InternalPoolUpdate{ + { + Token: sourceTokenAddress, + Pool: sourcePoolAddress, + }, + }) + if err != nil { + return [20]byte{}, nil, err + } + + _, err = c.Dest.OffRamp.ApplyPoolUpdates(c.Dest.User, nil, []evm_2_evm_offramp.InternalPoolUpdate{ + { + Token: sourceTokenAddress, + Pool: destPoolAddress, + }, + }) + if err != nil { + return [20]byte{}, nil, err + } + c.Dest.Chain.Commit() + + return sourcePoolAddress, destToken, err +} + +func (c *CCIPContracts) SendMessage(t *testing.T, gasLimit, tokenAmount *big.Int, receiverAddr common.Address) { + extraArgs, err := GetEVMExtraArgsV1(gasLimit, false) + require.NoError(t, err) + msg := router.ClientEVM2AnyMessage{ + Receiver: MustEncodeAddress(t, receiverAddr), + Data: []byte("hello"), + TokenAmounts: []router.ClientEVMTokenAmount{ + { + Token: c.Source.LinkToken.Address(), + Amount: tokenAmount, + }, + }, + FeeToken: c.Source.LinkToken.Address(), + ExtraArgs: extraArgs, + } + fee, err := c.Source.Router.GetFee(nil, c.Dest.ChainSelector, msg) + require.NoError(t, err) + // Currently no overhead and 1gwei dest gas price. So fee is simply gasLimit * gasPrice. + // require.Equal(t, new(big.Int).Mul(gasLimit, gasPrice).String(), fee.String()) + // Approve the fee amount + the token amount + _, err = c.Source.LinkToken.Approve(c.Source.User, c.Source.Router.Address(), new(big.Int).Add(fee, tokenAmount)) + require.NoError(t, err) + c.Source.Chain.Commit() + c.SendRequest(t, msg) +} + +func GetBalances(t *testing.T, brs []BalanceReq) (map[string]*big.Int, error) { + m := make(map[string]*big.Int) + for _, br := range brs { + m[br.Name] = br.Getter(t, br.Addr) + if m[br.Name] == nil { + return nil, fmt.Errorf("%v getter return nil", br.Name) + } + } + return m, nil +} + +func MustAddBigInt(a *big.Int, b string) *big.Int { + bi, _ := big.NewInt(0).SetString(b, 10) + return big.NewInt(0).Add(a, bi) +} + +func MustSubBigInt(a *big.Int, b string) *big.Int { + bi, _ := big.NewInt(0).SetString(b, 10) + return big.NewInt(0).Sub(a, bi) +} + +func MustEncodeAddress(t *testing.T, address common.Address) []byte { + bts, err := utils.ABIEncode(`[{"type":"address"}]`, address) + require.NoError(t, err) + return bts +} + +func SetupCCIPContracts(t *testing.T, sourceChainID, sourceChainSelector, destChainID, destChainSelector uint64) CCIPContracts { + sourceChain, sourceUser := testhelpers.SetupChain(t) + destChain, destUser := testhelpers.SetupChain(t) + + armSourceAddress, _, _, err := mock_rmn_contract.DeployMockRMNContract( + sourceUser, + sourceChain, + ) + require.NoError(t, err) + sourceARM, err := mock_rmn_contract.NewMockRMNContract(armSourceAddress, sourceChain) + require.NoError(t, err) + armProxySourceAddress, _, _, err := rmn_proxy_contract.DeployRMNProxyContract( + sourceUser, + sourceChain, + armSourceAddress, + ) + require.NoError(t, err) + sourceARMProxy, err := rmn_proxy_contract.NewRMNProxyContract(armProxySourceAddress, sourceChain) + require.NoError(t, err) + sourceChain.Commit() + + armDestAddress, _, _, err := mock_rmn_contract.DeployMockRMNContract( + destUser, + destChain, + ) + require.NoError(t, err) + armProxyDestAddress, _, _, err := rmn_proxy_contract.DeployRMNProxyContract( + destUser, + destChain, + armDestAddress, + ) + require.NoError(t, err) + destChain.Commit() + destARM, err := mock_rmn_contract.NewMockRMNContract(armDestAddress, destChain) + require.NoError(t, err) + destARMProxy, err := rmn_proxy_contract.NewRMNProxyContract(armProxyDestAddress, destChain) + require.NoError(t, err) + + // Deploy link token and pool on source chain + sourceLinkTokenAddress, _, _, err := link_token_interface.DeployLinkToken(sourceUser, sourceChain) + require.NoError(t, err) + sourceChain.Commit() + sourceLinkToken, err := link_token_interface.NewLinkToken(sourceLinkTokenAddress, sourceChain) + require.NoError(t, err) + + // Create router + sourceWeth9addr, _, _, err := weth9.DeployWETH9(sourceUser, sourceChain) + require.NoError(t, err) + sourceWrapped, err := weth9.NewWETH9(sourceWeth9addr, sourceChain) + require.NoError(t, err) + + sourceRouterAddress, _, _, err := router.DeployRouter(sourceUser, sourceChain, sourceWeth9addr, armProxySourceAddress) + require.NoError(t, err) + sourceRouter, err := router.NewRouter(sourceRouterAddress, sourceChain) + require.NoError(t, err) + sourceChain.Commit() + + sourceWeth9PoolAddress, _, _, err := lock_release_token_pool_1_0_0.DeployLockReleaseTokenPool( + sourceUser, + sourceChain, + sourceWeth9addr, + []common.Address{}, + armProxySourceAddress, + ) + require.NoError(t, err) + sourceChain.Commit() + + sourceWeth9Pool, err := lock_release_token_pool_1_0_0.NewLockReleaseTokenPool(sourceWeth9PoolAddress, sourceChain) + require.NoError(t, err) + + sourcePoolAddress, _, _, err := lock_release_token_pool.DeployLockReleaseTokenPool( + sourceUser, + sourceChain, + sourceLinkTokenAddress, + []common.Address{}, + armProxySourceAddress, + true, + sourceRouterAddress, + ) + require.NoError(t, err) + sourceChain.Commit() + sourcePool, err := lock_release_token_pool.NewLockReleaseTokenPool(sourcePoolAddress, sourceChain) + require.NoError(t, err) + + // Deploy custom token pool source + sourceCustomTokenAddress, _, _, err := link_token_interface.DeployLinkToken(sourceUser, sourceChain) // Just re-use this, it's an ERC20. + require.NoError(t, err) + sourceCustomToken, err := link_token_interface.NewLinkToken(sourceCustomTokenAddress, sourceChain) + require.NoError(t, err) + destChain.Commit() + + // Deploy custom token pool dest + destCustomTokenAddress, _, _, err := link_token_interface.DeployLinkToken(destUser, destChain) // Just re-use this, it's an ERC20. + require.NoError(t, err) + destCustomToken, err := link_token_interface.NewLinkToken(destCustomTokenAddress, destChain) + require.NoError(t, err) + destChain.Commit() + + // Deploy and configure onramp + sourcePricesAddress, _, _, err := price_registry_1_2_0.DeployPriceRegistry( + sourceUser, + sourceChain, + nil, + []common.Address{sourceLinkTokenAddress, sourceWeth9addr}, + 60*60*24*14, // two weeks + ) + require.NoError(t, err) + + srcPriceRegistry, err := price_registry_1_2_0.NewPriceRegistry(sourcePricesAddress, sourceChain) + require.NoError(t, err) + + _, err = srcPriceRegistry.UpdatePrices(sourceUser, price_registry_1_2_0.InternalPriceUpdates{ + TokenPriceUpdates: []price_registry_1_2_0.InternalTokenPriceUpdate{ + { + SourceToken: sourceLinkTokenAddress, + UsdPerToken: new(big.Int).Mul(big.NewInt(1e18), big.NewInt(20)), + }, + { + SourceToken: sourceWeth9addr, + UsdPerToken: new(big.Int).Mul(big.NewInt(1e18), big.NewInt(2000)), + }, + }, + GasPriceUpdates: []price_registry_1_2_0.InternalGasPriceUpdate{ + { + DestChainSelector: destChainSelector, + UsdPerUnitGas: big.NewInt(20000e9), + }, + }, + }) + require.NoError(t, err) + + onRampAddress, _, _, err := evm_2_evm_onramp.DeployEVM2EVMOnRamp( + sourceUser, // user + sourceChain, // client + evm_2_evm_onramp.EVM2EVMOnRampStaticConfig{ + LinkToken: sourceLinkTokenAddress, + ChainSelector: sourceChainSelector, + DestChainSelector: destChainSelector, + DefaultTxGasLimit: 200_000, + MaxNopFeesJuels: big.NewInt(0).Mul(big.NewInt(100_000_000), big.NewInt(1e18)), + PrevOnRamp: common.HexToAddress(""), + ArmProxy: armProxySourceAddress, // ARM + }, + evm_2_evm_onramp.EVM2EVMOnRampDynamicConfig{ + Router: sourceRouterAddress, + MaxNumberOfTokensPerMsg: 5, + DestGasOverhead: 350_000, + DestGasPerPayloadByte: 16, + DestDataAvailabilityOverheadGas: 33_596, + DestGasPerDataAvailabilityByte: 16, + DestDataAvailabilityMultiplierBps: 6840, // 0.684 + PriceRegistry: sourcePricesAddress, + MaxDataBytes: 1e5, + MaxPerMsgGasLimit: 4_000_000, + }, + []evm_2_evm_onramp.InternalPoolUpdate{ + { + Token: sourceLinkTokenAddress, + Pool: sourcePoolAddress, + }, + { + Token: sourceWeth9addr, + Pool: sourceWeth9PoolAddress, + }, + }, + evm_2_evm_onramp.RateLimiterConfig{ + IsEnabled: true, + Capacity: LinkUSDValue(100), + Rate: LinkUSDValue(1), + }, + []evm_2_evm_onramp.EVM2EVMOnRampFeeTokenConfigArgs{ + { + Token: sourceLinkTokenAddress, + NetworkFeeUSDCents: 1_00, + GasMultiplierWeiPerEth: 1e18, + PremiumMultiplierWeiPerEth: 9e17, + Enabled: true, + }, + { + Token: sourceWeth9addr, + NetworkFeeUSDCents: 1_00, + GasMultiplierWeiPerEth: 1e18, + PremiumMultiplierWeiPerEth: 1e18, + Enabled: true, + }, + }, + []evm_2_evm_onramp.EVM2EVMOnRampTokenTransferFeeConfigArgs{ + { + Token: sourceLinkTokenAddress, + MinFeeUSDCents: 50, // $0.5 + MaxFeeUSDCents: 1_000_000_00, // $ 1 million + DeciBps: 5_0, // 5 bps + DestGasOverhead: 34_000, + DestBytesOverhead: 32, + }, + }, + []evm_2_evm_onramp.EVM2EVMOnRampNopAndWeight{}, + ) + require.NoError(t, err) + onRamp, err := evm_2_evm_onramp.NewEVM2EVMOnRamp(onRampAddress, sourceChain) + require.NoError(t, err) + _, err = sourcePool.ApplyChainUpdates( + sourceUser, + []lock_release_token_pool.TokenPoolChainUpdate{{ + RemoteChainSelector: DestChainSelector, + Allowed: true, + OutboundRateLimiterConfig: lock_release_token_pool.RateLimiterConfig{ + IsEnabled: true, + Capacity: HundredLink, + Rate: big.NewInt(1e18), + }, + InboundRateLimiterConfig: lock_release_token_pool.RateLimiterConfig{ + IsEnabled: true, + Capacity: HundredLink, + Rate: big.NewInt(1e18), + }, + }}, + ) + require.NoError(t, err) + _, err = sourceWeth9Pool.ApplyRampUpdates(sourceUser, + []lock_release_token_pool_1_0_0.TokenPoolRampUpdate{{Ramp: onRampAddress, Allowed: true, + RateLimiterConfig: lock_release_token_pool_1_0_0.RateLimiterConfig{ + IsEnabled: true, + Capacity: HundredLink, + Rate: big.NewInt(1e18), + }, + }}, + []lock_release_token_pool_1_0_0.TokenPoolRampUpdate{}, + ) + require.NoError(t, err) + sourceChain.Commit() + _, err = sourceRouter.ApplyRampUpdates(sourceUser, []router.RouterOnRamp{{DestChainSelector: destChainSelector, OnRamp: onRampAddress}}, nil, nil) + require.NoError(t, err) + sourceChain.Commit() + + destWethaddr, _, _, err := weth9.DeployWETH9(destUser, destChain) + require.NoError(t, err) + destWrapped, err := weth9.NewWETH9(destWethaddr, destChain) + require.NoError(t, err) + + // Create dest router + destRouterAddress, _, _, err := router.DeployRouter(destUser, destChain, destWethaddr, armProxyDestAddress) + require.NoError(t, err) + destChain.Commit() + destRouter, err := router.NewRouter(destRouterAddress, destChain) + require.NoError(t, err) + + // Deploy link token and pool on destination chain + destLinkTokenAddress, _, _, err := link_token_interface.DeployLinkToken(destUser, destChain) + require.NoError(t, err) + destChain.Commit() + destLinkToken, err := link_token_interface.NewLinkToken(destLinkTokenAddress, destChain) + require.NoError(t, err) + destPoolAddress, _, _, err := lock_release_token_pool.DeployLockReleaseTokenPool( + destUser, + destChain, + destLinkTokenAddress, + []common.Address{}, + armProxyDestAddress, + true, + destRouterAddress, + ) + require.NoError(t, err) + destChain.Commit() + destPool, err := lock_release_token_pool.NewLockReleaseTokenPool(destPoolAddress, destChain) + require.NoError(t, err) + destChain.Commit() + + // Float the offramp pool + o, err := destPool.Owner(nil) + require.NoError(t, err) + require.Equal(t, destUser.From.String(), o.String()) + _, err = destPool.SetRebalancer(destUser, destUser.From) + require.NoError(t, err) + _, err = destLinkToken.Approve(destUser, destPoolAddress, Link(200)) + require.NoError(t, err) + _, err = destPool.ProvideLiquidity(destUser, Link(200)) + require.NoError(t, err) + destChain.Commit() + + destWrappedPoolAddress, _, _, err := lock_release_token_pool_1_0_0.DeployLockReleaseTokenPool( + destUser, + destChain, + destWethaddr, + []common.Address{}, + armProxyDestAddress, + ) + require.NoError(t, err) + destWrappedPool, err := lock_release_token_pool_1_0_0.NewLockReleaseTokenPool(destWrappedPoolAddress, destChain) + require.NoError(t, err) + + poolFloatValue := big.NewInt(1e18) + + destUser.Value = poolFloatValue + _, err = destWrapped.Deposit(destUser) + require.NoError(t, err) + destChain.Commit() + destUser.Value = nil + + _, err = destWrapped.Transfer(destUser, destWrappedPool.Address(), poolFloatValue) + require.NoError(t, err) + destChain.Commit() + + // Deploy and configure ge offramp. + destPricesAddress, _, _, err := price_registry_1_2_0.DeployPriceRegistry( + destUser, + destChain, + nil, + []common.Address{destLinkTokenAddress}, + 60*60*24*14, // two weeks + ) + require.NoError(t, err) + destPriceRegistry, err := price_registry_1_2_0.NewPriceRegistry(destPricesAddress, destChain) + require.NoError(t, err) + + // Deploy commit store. + commitStoreAddress, _, _, err := commit_store_1_2_0.DeployCommitStore( + destUser, // user + destChain, // client + commit_store_1_2_0.CommitStoreStaticConfig{ + ChainSelector: destChainSelector, + SourceChainSelector: sourceChainSelector, + OnRamp: onRamp.Address(), + ArmProxy: destARMProxy.Address(), + }, + ) + require.NoError(t, err) + destChain.Commit() + commitStore, err := commit_store_1_2_0.NewCommitStore(commitStoreAddress, destChain) + require.NoError(t, err) + + offRampAddress, _, _, err := evm_2_evm_offramp.DeployEVM2EVMOffRamp( + destUser, + destChain, + evm_2_evm_offramp.EVM2EVMOffRampStaticConfig{ + CommitStore: commitStore.Address(), + ChainSelector: destChainSelector, + SourceChainSelector: sourceChainSelector, + OnRamp: onRampAddress, + PrevOffRamp: common.HexToAddress(""), + ArmProxy: armProxyDestAddress, + }, + []common.Address{sourceLinkTokenAddress, sourceWeth9addr}, + []common.Address{destPoolAddress, destWrappedPool.Address()}, + evm_2_evm_offramp.RateLimiterConfig{ + IsEnabled: true, + Capacity: LinkUSDValue(100), + Rate: LinkUSDValue(1), + }, + ) + require.NoError(t, err) + offRamp, err := evm_2_evm_offramp.NewEVM2EVMOffRamp(offRampAddress, destChain) + require.NoError(t, err) + _, err = destPool.ApplyChainUpdates(destUser, + []lock_release_token_pool.TokenPoolChainUpdate{{ + RemoteChainSelector: sourceChainSelector, + Allowed: true, + OutboundRateLimiterConfig: lock_release_token_pool.RateLimiterConfig{ + IsEnabled: true, + Capacity: HundredLink, + Rate: big.NewInt(1e18), + }, + InboundRateLimiterConfig: lock_release_token_pool.RateLimiterConfig{ + IsEnabled: true, + Capacity: HundredLink, + Rate: big.NewInt(1e18), + }, + }}, + ) + require.NoError(t, err) + + _, err = destWrappedPool.ApplyRampUpdates(destUser, + []lock_release_token_pool_1_0_0.TokenPoolRampUpdate{}, + []lock_release_token_pool_1_0_0.TokenPoolRampUpdate{{ + Ramp: offRampAddress, + Allowed: true, + RateLimiterConfig: lock_release_token_pool_1_0_0.RateLimiterConfig{ + IsEnabled: true, + Capacity: HundredLink, + Rate: big.NewInt(1e18), + }, + }}, + ) + require.NoError(t, err) + + destChain.Commit() + _, err = destPriceRegistry.ApplyPriceUpdatersUpdates(destUser, []common.Address{commitStoreAddress}, []common.Address{}) + require.NoError(t, err) + _, err = destRouter.ApplyRampUpdates(destUser, nil, + nil, []router.RouterOffRamp{{SourceChainSelector: sourceChainSelector, OffRamp: offRampAddress}}) + require.NoError(t, err) + + // Deploy 2 revertable (one SS one non-SS) + revertingMessageReceiver1Address, _, _, err := maybe_revert_message_receiver.DeployMaybeRevertMessageReceiver(destUser, destChain, false) + require.NoError(t, err) + revertingMessageReceiver1, _ := maybe_revert_message_receiver.NewMaybeRevertMessageReceiver(revertingMessageReceiver1Address, destChain) + revertingMessageReceiver2Address, _, _, err := maybe_revert_message_receiver.DeployMaybeRevertMessageReceiver(destUser, destChain, false) + require.NoError(t, err) + revertingMessageReceiver2, _ := maybe_revert_message_receiver.NewMaybeRevertMessageReceiver(revertingMessageReceiver2Address, destChain) + // Need to commit here, or we will hit the block gas limit when deploying the executor + sourceChain.Commit() + destChain.Commit() + + // Ensure we have at least finality blocks. + for i := 0; i < 50; i++ { + sourceChain.Commit() + destChain.Commit() + } + + source := SourceChain{ + Common: Common{ + ChainID: sourceChainID, + ChainSelector: sourceChainSelector, + User: sourceUser, + Chain: sourceChain, + LinkToken: sourceLinkToken, + LinkTokenPool: sourcePool, + CustomToken: sourceCustomToken, + ARM: sourceARM, + ARMProxy: sourceARMProxy, + PriceRegistry: srcPriceRegistry, + WrappedNative: sourceWrapped, + WrappedNativePool: sourceWeth9Pool, + }, + Router: sourceRouter, + OnRamp: onRamp, + } + dest := DestinationChain{ + Common: Common{ + ChainID: destChainID, + ChainSelector: destChainSelector, + User: destUser, + Chain: destChain, + LinkToken: destLinkToken, + LinkTokenPool: destPool, + CustomToken: destCustomToken, + ARM: destARM, + ARMProxy: destARMProxy, + PriceRegistry: destPriceRegistry, + WrappedNative: destWrapped, + WrappedNativePool: destWrappedPool, + }, + CommitStore: commitStore, + Router: destRouter, + OffRamp: offRamp, + Receivers: []MaybeRevertReceiver{{Receiver: revertingMessageReceiver1, Strict: false}, {Receiver: revertingMessageReceiver2, Strict: true}}, + } + + return CCIPContracts{ + Source: source, + Dest: dest, + } +} + +func (c *CCIPContracts) SendRequest(t *testing.T, msg router.ClientEVM2AnyMessage) *types.Transaction { + tx, err := c.Source.Router.CcipSend(c.Source.User, c.Dest.ChainSelector, msg) + require.NoError(t, err) + testhelpers.ConfirmTxs(t, []*types.Transaction{tx}, c.Source.Chain) + return tx +} + +func (c *CCIPContracts) AssertExecState(t *testing.T, log logpoller.Log, state MessageExecutionState, offRampOpts ...common.Address) { + var offRamp *evm_2_evm_offramp.EVM2EVMOffRamp + var err error + if len(offRampOpts) > 0 { + offRamp, err = evm_2_evm_offramp.NewEVM2EVMOffRamp(offRampOpts[0], c.Dest.Chain) + require.NoError(t, err) + } else { + require.NotNil(t, c.Dest.OffRamp, "no offRamp configured") + offRamp = c.Dest.OffRamp + } + executionStateChanged, err := offRamp.ParseExecutionStateChanged(log.ToGethLog()) + require.NoError(t, err) + if MessageExecutionState(executionStateChanged.State) != state { + t.Log("Execution failed", hexutil.Encode(executionStateChanged.ReturnData)) + t.Fail() + } +} + +func GetEVMExtraArgsV1(gasLimit *big.Int, strict bool) ([]byte, error) { + EVMV1Tag := []byte{0x97, 0xa6, 0x57, 0xc9} + + encodedArgs, err := utils.ABIEncode(`[{"type":"uint256"},{"type":"bool"}]`, gasLimit, strict) + if err != nil { + return nil, err + } + + return append(EVMV1Tag, encodedArgs...), nil +} + +type ManualExecArgs struct { + SourceChainID, DestChainID uint64 + DestUser *bind.TransactOpts + SourceChain, DestChain bind.ContractBackend + SourceStartBlock *big.Int // the block in/after which failed ccip-send transaction was triggered + DestStartBlock uint64 // the start block for filtering ReportAccepted event (including the failed seq num) + // in destination chain. if not provided to be derived by ApproxDestStartBlock method + DestLatestBlockNum uint64 // current block number in destination + DestDeployedAt uint64 // destination block number for the initial destination contract deployment. + // Can be any number before the tx was reverted in destination chain. Preferably this needs to be set up with + // a value greater than zero to avoid performance issue in locating approximate destination block + SendReqLogIndex uint // log index of the CCIPSendRequested log in source chain + SendReqTxHash string // tx hash of the ccip-send transaction for which execution was reverted + CommitStore string + OnRamp string + OffRamp string + SeqNr uint64 + GasLimit *big.Int +} + +// ApproxDestStartBlock attempts to locate a block in destination chain with timestamp closest to the timestamp of the block +// in source chain in which ccip-send transaction was included +// it uses binary search to locate the block with the closest timestamp +// if the block located has a timestamp greater than the timestamp of mentioned source block +// it just returns the first block found with lesser timestamp of the source block +// providing a value of args.DestDeployedAt ensures better performance by reducing the range of block numbers to be traversed +func (args *ManualExecArgs) ApproxDestStartBlock() error { + sourceBlockHdr, err := args.SourceChain.HeaderByNumber(context.Background(), args.SourceStartBlock) + if err != nil { + return err + } + sendTxTime := sourceBlockHdr.Time + maxBlockNum := args.DestLatestBlockNum + // setting this to an approx value of 1000 considering destination chain would have at least 1000 blocks before the transaction started + minBlockNum := args.DestDeployedAt + closestBlockNum := uint64(math.Floor((float64(maxBlockNum) + float64(minBlockNum)) / 2)) + var closestBlockHdr *types.Header + closestBlockHdr, err = args.DestChain.HeaderByNumber(context.Background(), big.NewInt(int64(closestBlockNum))) + if err != nil { + return err + } + // to reduce the number of RPC calls increase the value of blockOffset + blockOffset := uint64(10) + for { + blockNum := closestBlockHdr.Number.Uint64() + if minBlockNum > maxBlockNum { + break + } + timeDiff := math.Abs(float64(closestBlockHdr.Time - sendTxTime)) + // break if the difference in timestamp is lesser than 1 minute + if timeDiff < 60 { + break + } else if closestBlockHdr.Time > sendTxTime { + maxBlockNum = blockNum - 1 + } else { + minBlockNum = blockNum + 1 + } + closestBlockNum = uint64(math.Floor((float64(maxBlockNum) + float64(minBlockNum)) / 2)) + closestBlockHdr, err = args.DestChain.HeaderByNumber(context.Background(), big.NewInt(int64(closestBlockNum))) + if err != nil { + return err + } + } + + for closestBlockHdr.Time > sendTxTime { + closestBlockNum = closestBlockNum - blockOffset + if closestBlockNum <= 0 { + return fmt.Errorf("approx destination blocknumber not found") + } + closestBlockHdr, err = args.DestChain.HeaderByNumber(context.Background(), big.NewInt(int64(closestBlockNum))) + if err != nil { + return err + } + } + args.DestStartBlock = closestBlockHdr.Number.Uint64() + fmt.Println("using approx destination start block number", args.DestStartBlock) + return nil +} + +func (args *ManualExecArgs) FindSeqNrFromCCIPSendRequested() (uint64, error) { + var seqNr uint64 + onRampContract, err := evm_2_evm_onramp.NewEVM2EVMOnRamp(common.HexToAddress(args.OnRamp), args.SourceChain) + if err != nil { + return seqNr, err + } + iterator, err := onRampContract.FilterCCIPSendRequested(&bind.FilterOpts{ + Start: args.SourceStartBlock.Uint64(), + }) + if err != nil { + return seqNr, err + } + for iterator.Next() { + if iterator.Event.Raw.Index == args.SendReqLogIndex && + iterator.Event.Raw.TxHash.Hex() == args.SendReqTxHash { + seqNr = iterator.Event.Message.SequenceNumber + break + } + } + if seqNr == 0 { + return seqNr, + fmt.Errorf("no CCIPSendRequested logs found for logIndex %d starting from block number %d", args.SendReqLogIndex, args.SourceStartBlock) + } + return seqNr, nil +} + +func (args *ManualExecArgs) ExecuteManually() (*types.Transaction, error) { + if args.SourceChainID == 0 || + args.DestChainID == 0 || + args.DestUser == nil { + return nil, fmt.Errorf("chain ids and owners are mandatory for source and dest chain") + } + if !common.IsHexAddress(args.CommitStore) || + !common.IsHexAddress(args.OffRamp) || + !common.IsHexAddress(args.OnRamp) { + return nil, fmt.Errorf("contract addresses must be valid hex address") + } + if args.SendReqTxHash == "" { + return nil, fmt.Errorf("tx hash of ccip-send request are required") + } + if args.SourceStartBlock == nil { + return nil, fmt.Errorf("must provide the value of source block in/after which ccip-send tx was included") + } + if args.SeqNr == 0 { + if args.SendReqLogIndex == 0 { + return nil, fmt.Errorf("must provide the value of log index of ccip-send request") + } + // locate seq nr from CCIPSendRequested log + seqNr, err := args.FindSeqNrFromCCIPSendRequested() + if err != nil { + return nil, err + } + args.SeqNr = seqNr + } + commitStore, err := commit_store_1_2_0.NewCommitStore(common.HexToAddress(args.CommitStore), args.DestChain) + if err != nil { + return nil, err + } + if args.DestStartBlock < 1 { + err = args.ApproxDestStartBlock() + if err != nil { + return nil, err + } + } + iterator, err := commitStore.FilterReportAccepted(&bind.FilterOpts{Start: args.DestStartBlock}) + if err != nil { + return nil, err + } + + var commitReport *commit_store_1_2_0.CommitStoreCommitReport + for iterator.Next() { + if iterator.Event.Report.Interval.Min <= args.SeqNr && iterator.Event.Report.Interval.Max >= args.SeqNr { + commitReport = &iterator.Event.Report + fmt.Println("Found root") + break + } + } + if commitReport == nil { + return nil, fmt.Errorf("unable to find seq num %d in commit report", args.SeqNr) + } + + return args.execute(commitReport) +} + +func (args *ManualExecArgs) execute(report *commit_store_1_2_0.CommitStoreCommitReport) (*types.Transaction, error) { + log.Info().Msg("Executing request manually") + seqNr := args.SeqNr + // Build a merkle tree for the report + mctx := hashutil.NewKeccak() + onRampContract, err := evm_2_evm_onramp_1_2_0.NewEVM2EVMOnRamp(common.HexToAddress(args.OnRamp), args.SourceChain) + if err != nil { + return nil, err + } + leafHasher := v1_2_0.NewLeafHasher(args.SourceChainID, args.DestChainID, common.HexToAddress(args.OnRamp), mctx, onRampContract) + if leafHasher == nil { + return nil, fmt.Errorf("unable to create leaf hasher") + } + + var leaves [][32]byte + var curr, prove int + var msgs []evm_2_evm_offramp.InternalEVM2EVMMessage + var manualExecGasLimits []*big.Int + var tokenData [][][]byte + sendRequestedIterator, err := onRampContract.FilterCCIPSendRequested(&bind.FilterOpts{ + Start: args.SourceStartBlock.Uint64(), + }) + if err != nil { + return nil, err + } + for sendRequestedIterator.Next() { + if sendRequestedIterator.Event.Message.SequenceNumber <= report.Interval.Max && + sendRequestedIterator.Event.Message.SequenceNumber >= report.Interval.Min { + fmt.Println("Found seq num", sendRequestedIterator.Event.Message.SequenceNumber, report.Interval) + hash, err2 := leafHasher.HashLeaf(sendRequestedIterator.Event.Raw) + if err2 != nil { + return nil, err2 + } + leaves = append(leaves, hash) + if sendRequestedIterator.Event.Message.SequenceNumber == seqNr { + fmt.Printf("Found proving %d %+v\n", curr, sendRequestedIterator.Event.Message) + var tokensAndAmounts []evm_2_evm_offramp.ClientEVMTokenAmount + for _, tokenAndAmount := range sendRequestedIterator.Event.Message.TokenAmounts { + tokensAndAmounts = append(tokensAndAmounts, evm_2_evm_offramp.ClientEVMTokenAmount{ + Token: tokenAndAmount.Token, + Amount: tokenAndAmount.Amount, + }) + } + msg := evm_2_evm_offramp.InternalEVM2EVMMessage{ + SourceChainSelector: sendRequestedIterator.Event.Message.SourceChainSelector, + Sender: sendRequestedIterator.Event.Message.Sender, + Receiver: sendRequestedIterator.Event.Message.Receiver, + SequenceNumber: sendRequestedIterator.Event.Message.SequenceNumber, + GasLimit: sendRequestedIterator.Event.Message.GasLimit, + Strict: sendRequestedIterator.Event.Message.Strict, + Nonce: sendRequestedIterator.Event.Message.Nonce, + FeeToken: sendRequestedIterator.Event.Message.FeeToken, + FeeTokenAmount: sendRequestedIterator.Event.Message.FeeTokenAmount, + Data: sendRequestedIterator.Event.Message.Data, + TokenAmounts: tokensAndAmounts, + SourceTokenData: sendRequestedIterator.Event.Message.SourceTokenData, + MessageId: sendRequestedIterator.Event.Message.MessageId, + } + msgs = append(msgs, msg) + if args.GasLimit != nil { + msg.GasLimit = args.GasLimit + } + manualExecGasLimits = append(manualExecGasLimits, msg.GasLimit) + var msgTokenData [][]byte + for range sendRequestedIterator.Event.Message.TokenAmounts { + msgTokenData = append(msgTokenData, []byte{}) + } + + tokenData = append(tokenData, msgTokenData) + prove = curr + } + curr++ + } + } + sendRequestedIterator.Close() + if msgs == nil { + return nil, fmt.Errorf("unable to find msg with seqNr %d", seqNr) + } + tree, err := merklemulti.NewTree(mctx, leaves) + if err != nil { + return nil, err + } + if tree.Root() != report.MerkleRoot { + return nil, fmt.Errorf("root doesn't match") + } + + proof, err := tree.Prove([]int{prove}) + if err != nil { + return nil, err + } + + offRampProof := evm_2_evm_offramp.InternalExecutionReport{ + Messages: msgs, + OffchainTokenData: tokenData, + Proofs: proof.Hashes, + ProofFlagBits: abihelpers.ProofFlagsToBits(proof.SourceFlags), + } + offRamp, err := evm_2_evm_offramp.NewEVM2EVMOffRamp(common.HexToAddress(args.OffRamp), args.DestChain) + if err != nil { + return nil, err + } + // Execute. + return offRamp.ManuallyExecute(args.DestUser, offRampProof, manualExecGasLimits) +} + +func (c *CCIPContracts) ExecuteMessage( + t *testing.T, + req logpoller.Log, + txHash common.Hash, + destStartBlock uint64, +) uint64 { + t.Log("Executing request manually") + sendReqReceipt, err := c.Source.Chain.TransactionReceipt(context.Background(), txHash) + require.NoError(t, err) + args := ManualExecArgs{ + SourceChainID: c.Source.ChainID, + DestChainID: c.Dest.ChainID, + DestUser: c.Dest.User, + SourceChain: c.Source.Chain, + DestChain: c.Dest.Chain, + SourceStartBlock: sendReqReceipt.BlockNumber, + DestStartBlock: destStartBlock, + DestLatestBlockNum: c.Dest.Chain.Blockchain().CurrentBlock().Number.Uint64(), + SendReqLogIndex: uint(req.LogIndex), + SendReqTxHash: txHash.String(), + CommitStore: c.Dest.CommitStore.Address().String(), + OnRamp: c.Source.OnRamp.Address().String(), + OffRamp: c.Dest.OffRamp.Address().String(), + } + tx, err := args.ExecuteManually() + require.NoError(t, err) + c.Dest.Chain.Commit() + c.Source.Chain.Commit() + rec, err := c.Dest.Chain.TransactionReceipt(context.Background(), tx.Hash()) + require.NoError(t, err) + require.Equal(t, uint64(1), rec.Status, "manual execution failed") + t.Logf("Manual Execution completed for seqNum %d", args.SeqNr) + return args.SeqNr +} + +func GetBalance(t *testing.T, chain bind.ContractBackend, tokenAddr common.Address, addr common.Address) *big.Int { + token, err := link_token_interface.NewLinkToken(tokenAddr, chain) + require.NoError(t, err) + bal, err := token.BalanceOf(nil, addr) + require.NoError(t, err) + return bal +} diff --git a/core/services/ocr2/plugins/ccip/testhelpers/testhelpers_1_4_0/chainlink.go b/core/services/ocr2/plugins/ccip/testhelpers/testhelpers_1_4_0/chainlink.go new file mode 100644 index 00000000000..bff08e86385 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/testhelpers/testhelpers_1_4_0/chainlink.go @@ -0,0 +1,1045 @@ +package testhelpers_1_4_0 + +import ( + "context" + "encoding/hex" + "fmt" + "math/big" + "net/http" + "net/http/httptest" + "strconv" + "strings" + "testing" + "time" + + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/accounts/abi/bind/backends" + "github.com/ethereum/go-ethereum/common" + types3 "github.com/ethereum/go-ethereum/core/types" + "github.com/google/uuid" + "github.com/hashicorp/consul/sdk/freeport" + "github.com/jmoiron/sqlx" + "github.com/onsi/gomega" + "github.com/pkg/errors" + + "github.com/stretchr/testify/mock" + "github.com/stretchr/testify/require" + "go.uber.org/zap" + "k8s.io/utils/pointer" //nolint:staticcheck + + "github.com/smartcontractkit/libocr/commontypes" + "github.com/smartcontractkit/libocr/offchainreporting2/confighelper" + types4 "github.com/smartcontractkit/libocr/offchainreporting2plus/types" + + "github.com/smartcontractkit/chainlink-common/pkg/config" + "github.com/smartcontractkit/chainlink-common/pkg/loop" + "github.com/smartcontractkit/chainlink-common/pkg/utils/mailbox" + + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + coretypes "github.com/smartcontractkit/chainlink-common/pkg/types/core/mocks" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" + v2 "github.com/smartcontractkit/chainlink/v2/core/chains/evm/config/toml" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils" + evmUtils "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils/big" + "github.com/smartcontractkit/chainlink/v2/core/chains/legacyevm" + configv2 "github.com/smartcontractkit/chainlink/v2/core/config/toml" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/commit_store_1_2_0" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/evm_2_evm_offramp_1_2_0" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/evm_2_evm_onramp_1_2_0" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" + "github.com/smartcontractkit/chainlink/v2/core/logger" + "github.com/smartcontractkit/chainlink/v2/core/logger/audit" + "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" + feeds2 "github.com/smartcontractkit/chainlink/v2/core/services/feeds" + feedsMocks "github.com/smartcontractkit/chainlink/v2/core/services/feeds/mocks" + pb "github.com/smartcontractkit/chainlink/v2/core/services/feeds/proto" + "github.com/smartcontractkit/chainlink/v2/core/services/job" + "github.com/smartcontractkit/chainlink/v2/core/services/keystore" + "github.com/smartcontractkit/chainlink/v2/core/services/keystore/chaintype" + "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/csakey" + "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ocr2key" + ksMocks "github.com/smartcontractkit/chainlink/v2/core/services/keystore/mocks" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/abihelpers" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_0_0" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/testhelpers" + integrationtesthelpers "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/testhelpers/integration" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/validate" + "github.com/smartcontractkit/chainlink/v2/core/services/ocrbootstrap" + evmrelay "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm" + clutils "github.com/smartcontractkit/chainlink/v2/core/utils" + "github.com/smartcontractkit/chainlink/v2/core/utils/crypto" + "github.com/smartcontractkit/chainlink/v2/core/utils/testutils/heavyweight" + "github.com/smartcontractkit/chainlink/v2/plugins" +) + +const ( + execSpecTemplate = ` + type = "offchainreporting2" + schemaVersion = 1 + name = "ccip-exec-1" + externalJobID = "67ffad71-d90f-4fe3-b4e4-494924b707fb" + forwardingAllowed = false + maxTaskDuration = "0s" + contractID = "%s" + contractConfigConfirmations = 1 + contractConfigTrackerPollInterval = "20s" + ocrKeyBundleID = "%s" + relay = "evm" + pluginType = "ccip-execution" + transmitterID = "%s" + + [relayConfig] + chainID = 1_337 + + [pluginConfig] + destStartBlock = 50 + + [pluginConfig.USDCConfig] + AttestationAPI = "http://blah.com" + SourceMessageTransmitterAddress = "%s" + SourceTokenAddress = "%s" + AttestationAPITimeoutSeconds = 10 + ` + commitSpecTemplatePipeline = ` + type = "offchainreporting2" + schemaVersion = 1 + name = "ccip-commit-1" + externalJobID = "13c997cf-1a14-4ab7-9068-07ee6d2afa55" + forwardingAllowed = false + maxTaskDuration = "0s" + contractID = "%s" + contractConfigConfirmations = 1 + contractConfigTrackerPollInterval = "20s" + ocrKeyBundleID = "%s" + relay = "evm" + pluginType = "ccip-commit" + transmitterID = "%s" + + [relayConfig] + chainID = 1_337 + + [pluginConfig] + destStartBlock = 50 + offRamp = "%s" + tokenPricesUSDPipeline = """ + %s + """ + ` + commitSpecTemplateDynamicPriceGetter = ` + type = "offchainreporting2" + schemaVersion = 1 + name = "ccip-commit-1" + externalJobID = "13c997cf-1a14-4ab7-9068-07ee6d2afa55" + forwardingAllowed = false + maxTaskDuration = "0s" + contractID = "%s" + contractConfigConfirmations = 1 + contractConfigTrackerPollInterval = "20s" + ocrKeyBundleID = "%s" + relay = "evm" + pluginType = "ccip-commit" + transmitterID = "%s" + + [relayConfig] + chainID = 1_337 + + [pluginConfig] + destStartBlock = 50 + offRamp = "%s" + priceGetterConfig = """ + %s + """ + ` +) + +type Node struct { + App chainlink.Application + Transmitter common.Address + PaymentReceiver common.Address + KeyBundle ocr2key.KeyBundle +} + +func (node *Node) FindJobIDForContract(t *testing.T, addr common.Address) int32 { + jobs := node.App.JobSpawner().ActiveJobs() + for _, j := range jobs { + if j.Type == job.OffchainReporting2 && j.OCR2OracleSpec.ContractID == addr.Hex() { + return j.ID + } + } + t.Fatalf("Could not find job for contract %s", addr.Hex()) + return 0 +} + +func (node *Node) EventuallyNodeUsesUpdatedPriceRegistry(t *testing.T, ccipContracts CCIPIntegrationTestHarness) logpoller.Log { + c, err := node.App.GetRelayers().LegacyEVMChains().Get(strconv.FormatUint(ccipContracts.Dest.ChainID, 10)) + require.NoError(t, err) + var log logpoller.Log + gomega.NewGomegaWithT(t).Eventually(func() bool { + ccipContracts.Source.Chain.Commit() + ccipContracts.Dest.Chain.Commit() + log, err := c.LogPoller().LatestLogByEventSigWithConfs( + testutils.Context(t), + v1_0_0.UsdPerUnitGasUpdated, + ccipContracts.Dest.PriceRegistry.Address(), + 0, + ) + // err can be transient errors such as sql row set empty + if err != nil { + return false + } + return log != nil + }, testutils.WaitTimeout(t), 1*time.Second).Should(gomega.BeTrue(), "node is not using updated price registry %s", ccipContracts.Dest.PriceRegistry.Address().Hex()) + return log +} + +func (node *Node) EventuallyNodeUsesNewCommitConfig(t *testing.T, ccipContracts CCIPIntegrationTestHarness, commitCfg ccipdata.CommitOnchainConfig) logpoller.Log { + c, err := node.App.GetRelayers().LegacyEVMChains().Get(strconv.FormatUint(ccipContracts.Dest.ChainID, 10)) + require.NoError(t, err) + var log logpoller.Log + gomega.NewGomegaWithT(t).Eventually(func() bool { + ccipContracts.Source.Chain.Commit() + ccipContracts.Dest.Chain.Commit() + log, err := c.LogPoller().LatestLogByEventSigWithConfs( + testutils.Context(t), + evmrelay.OCR2AggregatorLogDecoder.EventSig(), + ccipContracts.Dest.CommitStore.Address(), + 0, + ) + require.NoError(t, err) + var latestCfg ccipdata.CommitOnchainConfig + if log != nil { + latestCfg, err = DecodeCommitOnChainConfig(log.Data) + require.NoError(t, err) + return latestCfg == commitCfg + } + return false + }, testutils.WaitTimeout(t), 1*time.Second).Should(gomega.BeTrue(), "node is using old cfg") + return log +} + +func (node *Node) EventuallyNodeUsesNewExecConfig(t *testing.T, ccipContracts CCIPIntegrationTestHarness, execCfg v1_2_0.ExecOnchainConfig) logpoller.Log { + c, err := node.App.GetRelayers().LegacyEVMChains().Get(strconv.FormatUint(ccipContracts.Dest.ChainID, 10)) + require.NoError(t, err) + var log logpoller.Log + gomega.NewGomegaWithT(t).Eventually(func() bool { + ccipContracts.Source.Chain.Commit() + ccipContracts.Dest.Chain.Commit() + log, err := c.LogPoller().LatestLogByEventSigWithConfs( + testutils.Context(t), + evmrelay.OCR2AggregatorLogDecoder.EventSig(), + ccipContracts.Dest.OffRamp.Address(), + 0, + ) + require.NoError(t, err) + var latestCfg v1_2_0.ExecOnchainConfig + if log != nil { + latestCfg, err = DecodeExecOnChainConfig(log.Data) + require.NoError(t, err) + return latestCfg == execCfg + } + return false + }, testutils.WaitTimeout(t), 1*time.Second).Should(gomega.BeTrue(), "node is using old cfg") + return log +} + +func (node *Node) EventuallyHasReqSeqNum(t *testing.T, ccipContracts *CCIPIntegrationTestHarness, onRamp common.Address, seqNum int) logpoller.Log { + c, err := node.App.GetRelayers().LegacyEVMChains().Get(strconv.FormatUint(ccipContracts.Source.ChainID, 10)) + require.NoError(t, err) + var log logpoller.Log + gomega.NewGomegaWithT(t).Eventually(func() bool { + ccipContracts.Source.Chain.Commit() + ccipContracts.Dest.Chain.Commit() + lgs, err := c.LogPoller().LogsDataWordRange( + testutils.Context(t), + v1_2_0.CCIPSendRequestEventSig, + onRamp, + v1_2_0.CCIPSendRequestSeqNumIndex, + abihelpers.EvmWord(uint64(seqNum)), + abihelpers.EvmWord(uint64(seqNum)), + 1, + ) + require.NoError(t, err) + t.Log("Send requested", len(lgs)) + if len(lgs) == 1 { + log = lgs[0] + return true + } + return false + }, testutils.WaitTimeout(t), 1*time.Second).Should(gomega.BeTrue(), "eventually has seq num") + return log +} + +func (node *Node) EventuallyHasExecutedSeqNums(t *testing.T, ccipContracts *CCIPIntegrationTestHarness, offRamp common.Address, minSeqNum int, maxSeqNum int) []logpoller.Log { + c, err := node.App.GetRelayers().LegacyEVMChains().Get(strconv.FormatUint(ccipContracts.Dest.ChainID, 10)) + require.NoError(t, err) + var logs []logpoller.Log + gomega.NewGomegaWithT(t).Eventually(func() bool { + ccipContracts.Source.Chain.Commit() + ccipContracts.Dest.Chain.Commit() + lgs, err := c.LogPoller().IndexedLogsTopicRange( + testutils.Context(t), + v1_0_0.ExecutionStateChangedEvent, + offRamp, + v1_0_0.ExecutionStateChangedSeqNrIndex, + abihelpers.EvmWord(uint64(minSeqNum)), + abihelpers.EvmWord(uint64(maxSeqNum)), + 1, + ) + require.NoError(t, err) + t.Logf("Have executed logs %d want %d", len(lgs), maxSeqNum-minSeqNum+1) + if len(lgs) == maxSeqNum-minSeqNum+1 { + logs = lgs + t.Logf("Seq Num %d-%d executed", minSeqNum, maxSeqNum) + return true + } + return false + }, testutils.WaitTimeout(t), 1*time.Second).Should(gomega.BeTrue(), "eventually has not executed seq num") + return logs +} + +func (node *Node) ConsistentlySeqNumHasNotBeenExecuted(t *testing.T, ccipContracts *CCIPIntegrationTestHarness, offRamp common.Address, seqNum int) logpoller.Log { + c, err := node.App.GetRelayers().LegacyEVMChains().Get(strconv.FormatUint(ccipContracts.Dest.ChainID, 10)) + require.NoError(t, err) + var log logpoller.Log + gomega.NewGomegaWithT(t).Consistently(func() bool { + ccipContracts.Source.Chain.Commit() + ccipContracts.Dest.Chain.Commit() + lgs, err := c.LogPoller().IndexedLogsTopicRange( + testutils.Context(t), + v1_0_0.ExecutionStateChangedEvent, + offRamp, + v1_0_0.ExecutionStateChangedSeqNrIndex, + abihelpers.EvmWord(uint64(seqNum)), + abihelpers.EvmWord(uint64(seqNum)), + 1, + ) + require.NoError(t, err) + t.Log("Executed logs", lgs) + if len(lgs) == 1 { + log = lgs[0] + return true + } + return false + }, 10*time.Second, 1*time.Second).Should(gomega.BeFalse(), "seq number got executed") + return log +} + +func (node *Node) AddJob(t *testing.T, spec *integrationtesthelpers.OCR2TaskJobSpec) { + specString, err := spec.String() + require.NoError(t, err) + ccipJob, err := validate.ValidatedOracleSpecToml( + testutils.Context(t), + node.App.GetConfig().OCR2(), + node.App.GetConfig().Insecure(), + specString, + // FIXME Ani + nil, + ) + require.NoError(t, err) + err = node.App.AddJobV2(context.Background(), &ccipJob) + require.NoError(t, err) +} + +func (node *Node) AddBootstrapJob(t *testing.T, spec *integrationtesthelpers.OCR2TaskJobSpec) { + specString, err := spec.String() + require.NoError(t, err) + ccipJob, err := ocrbootstrap.ValidatedBootstrapSpecToml(specString) + require.NoError(t, err) + err = node.App.AddJobV2(context.Background(), &ccipJob) + require.NoError(t, err) +} + +func (node *Node) AddJobsWithSpec(t *testing.T, jobSpec *integrationtesthelpers.OCR2TaskJobSpec) { + // set node specific values + jobSpec.OCR2OracleSpec.OCRKeyBundleID.SetValid(node.KeyBundle.ID()) + jobSpec.OCR2OracleSpec.TransmitterID.SetValid(node.Transmitter.Hex()) + node.AddJob(t, jobSpec) +} + +func setupNodeCCIP( + t *testing.T, + owner *bind.TransactOpts, + port int64, + dbName string, + sourceChain *backends.SimulatedBackend, destChain *backends.SimulatedBackend, + sourceChainID *big.Int, destChainID *big.Int, + bootstrapPeerID string, + bootstrapPort int64, +) (chainlink.Application, string, common.Address, ocr2key.KeyBundle) { + trueRef, falseRef := true, false + + // Do not want to load fixtures as they contain a dummy chainID. + loglevel := configv2.LogLevel(zap.DebugLevel) + config, db := heavyweight.FullTestDBNoFixturesV2(t, func(c *chainlink.Config, _ *chainlink.Secrets) { + p2pAddresses := []string{ + fmt.Sprintf("127.0.0.1:%d", port), + } + c.Log.Level = &loglevel + c.Feature.UICSAKeys = &trueRef + c.Feature.FeedsManager = &trueRef + c.OCR.Enabled = &falseRef + c.OCR.DefaultTransactionQueueDepth = pointer.Uint32(200) + c.OCR2.Enabled = &trueRef + c.Feature.LogPoller = &trueRef + c.P2P.V2.Enabled = &trueRef + + dur, err := config.NewDuration(500 * time.Millisecond) + if err != nil { + panic(err) + } + c.P2P.V2.DeltaDial = &dur + + dur2, err := config.NewDuration(5 * time.Second) + if err != nil { + panic(err) + } + + c.P2P.V2.DeltaReconcile = &dur2 + c.P2P.V2.ListenAddresses = &p2pAddresses + c.P2P.V2.AnnounceAddresses = &p2pAddresses + + c.EVM = []*v2.EVMConfig{createConfigV2Chain(sourceChainID), createConfigV2Chain(destChainID)} + + if bootstrapPeerID != "" { + // Supply the bootstrap IP and port as a V2 peer address + c.P2P.V2.DefaultBootstrappers = &[]commontypes.BootstrapperLocator{ + { + PeerID: bootstrapPeerID, Addrs: []string{ + fmt.Sprintf("127.0.0.1:%d", bootstrapPort), + }, + }, + } + } + }) + + lggr := logger.TestLogger(t) + + // The in-memory geth sim does not let you create a custom ChainID, it will always be 1337. + // In particular this means that if you sign an eip155 tx, the chainID used MUST be 1337 + // and the CHAINID op code will always emit 1337. To work around this to simulate a "multichain" + // test, we fake different chainIDs using the wrapped sim cltest.SimulatedBackend so the RPC + // appears to operate on different chainIDs and we use an EthKeyStoreSim wrapper which always + // signs 1337 see https://github.com/smartcontractkit/chainlink-ccip/blob/a24dd436810250a458d27d8bb3fb78096afeb79c/core/services/ocr2/plugins/ccip/testhelpers/simulated_backend.go#L35 + sourceClient := client.NewSimulatedBackendClient(t, sourceChain, sourceChainID) + destClient := client.NewSimulatedBackendClient(t, destChain, destChainID) + csaKeyStore := ksMocks.NewCSA(t) + + key, err := csakey.NewV2() + require.NoError(t, err) + csaKeyStore.On("GetAll").Return([]csakey.KeyV2{key}, nil) + keyStore := NewKsa(db, lggr, csaKeyStore) + + simEthKeyStore := testhelpers.EthKeyStoreSim{ + ETHKS: keyStore.Eth(), + CSAKS: keyStore.CSA(), + } + mailMon := mailbox.NewMonitor("CCIP", lggr.Named("Mailbox")) + evmOpts := chainlink.EVMFactoryConfig{ + ChainOpts: legacyevm.ChainOpts{ + AppConfig: config, + GenEthClient: func(chainID *big.Int) client.Client { + if chainID.String() == sourceChainID.String() { + return sourceClient + } else if chainID.String() == destChainID.String() { + return destClient + } + t.Fatalf("invalid chain ID %v", chainID.String()) + return nil + }, + MailMon: mailMon, + DS: db, + }, + CSAETHKeystore: simEthKeyStore, + } + loopRegistry := plugins.NewLoopRegistry(lggr.Named("LoopRegistry"), config.Tracing(), config.Telemetry()) + relayerFactory := chainlink.RelayerFactory{ + Logger: lggr, + LoopRegistry: loopRegistry, + GRPCOpts: loop.GRPCOpts{}, + CapabilitiesRegistry: coretypes.NewCapabilitiesRegistry(t), + } + testCtx := testutils.Context(t) + // evm alway enabled for backward compatibility + initOps := []chainlink.CoreRelayerChainInitFunc{ + chainlink.InitEVM(testCtx, relayerFactory, evmOpts), + } + + relayChainInterops, err := chainlink.NewCoreRelayerChainInteroperators(initOps...) + if err != nil { + t.Fatal(err) + } + + app, err := chainlink.NewApplication(chainlink.ApplicationOpts{ + Config: config, + DS: db, + KeyStore: keyStore, + RelayerChainInteroperators: relayChainInterops, + Logger: lggr, + ExternalInitiatorManager: nil, + CloseLogger: lggr.Sync, + UnrestrictedHTTPClient: &http.Client{}, + RestrictedHTTPClient: &http.Client{}, + AuditLogger: audit.NoopLogger, + MailMon: mailMon, + LoopRegistry: plugins.NewLoopRegistry(lggr, config.Tracing(), config.Telemetry()), + }) + ctx := testutils.Context(t) + require.NoError(t, err) + require.NoError(t, app.GetKeyStore().Unlock(ctx, "password")) + _, err = app.GetKeyStore().P2P().Create(ctx) + require.NoError(t, err) + + p2pIDs, err := app.GetKeyStore().P2P().GetAll() + require.NoError(t, err) + require.Len(t, p2pIDs, 1) + peerID := p2pIDs[0].PeerID() + + _, err = app.GetKeyStore().Eth().Create(testCtx, destChainID) + require.NoError(t, err) + sendingKeys, err := app.GetKeyStore().Eth().EnabledKeysForChain(testCtx, destChainID) + require.NoError(t, err) + require.Len(t, sendingKeys, 1) + transmitter := sendingKeys[0].Address + s, err := app.GetKeyStore().Eth().GetState(testCtx, sendingKeys[0].ID(), destChainID) + require.NoError(t, err) + lggr.Debug(fmt.Sprintf("Transmitter address %s chainID %s", transmitter, s.EVMChainID.String())) + + // Fund the commitTransmitter address with some ETH + n, err := destChain.NonceAt(context.Background(), owner.From, nil) + require.NoError(t, err) + + tx := types3.NewTransaction(n, transmitter, big.NewInt(1000000000000000000), 21000, big.NewInt(1000000000), nil) + signedTx, err := owner.Signer(owner.From, tx) + require.NoError(t, err) + err = destChain.SendTransaction(context.Background(), signedTx) + require.NoError(t, err) + destChain.Commit() + + kb, err := app.GetKeyStore().OCR2().Create(ctx, chaintype.EVM) + require.NoError(t, err) + return app, peerID.Raw(), transmitter, kb +} + +func createConfigV2Chain(chainId *big.Int) *v2.EVMConfig { + // NOTE: For the executor jobs, the default of 500k is insufficient for a 3 message batch + defaultGasLimit := uint64(5000000) + tr := true + + sourceC := v2.Defaults((*evmUtils.Big)(chainId)) + sourceC.GasEstimator.LimitDefault = &defaultGasLimit + fixedPrice := "FixedPrice" + sourceC.GasEstimator.Mode = &fixedPrice + d, _ := config.NewDuration(100 * time.Millisecond) + sourceC.LogPollInterval = &d + fd := uint32(2) + sourceC.FinalityDepth = &fd + return &v2.EVMConfig{ + ChainID: (*evmUtils.Big)(chainId), + Enabled: &tr, + Chain: sourceC, + Nodes: v2.EVMNodes{&v2.Node{}}, + } +} + +type CCIPIntegrationTestHarness struct { + CCIPContracts + Nodes []Node + Bootstrap Node +} + +func SetupCCIPIntegrationTH(t *testing.T, sourceChainID, sourceChainSelector, destChainId, destChainSelector uint64) CCIPIntegrationTestHarness { + return CCIPIntegrationTestHarness{ + CCIPContracts: SetupCCIPContracts(t, sourceChainID, sourceChainSelector, destChainId, destChainSelector), + } +} + +func (c *CCIPIntegrationTestHarness) CreatePricesPipeline(t *testing.T) (string, *httptest.Server, *httptest.Server) { + linkUSD := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) { + _, err := w.Write([]byte(`{"UsdPerLink": "8000000000000000000"}`)) + require.NoError(t, err) + })) + ethUSD := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) { + _, err := w.Write([]byte(`{"UsdPerETH": "1700000000000000000000"}`)) + require.NoError(t, err) + })) + sourceWrappedNative, err := c.Source.Router.GetWrappedNative(nil) + require.NoError(t, err) + destWrappedNative, err := c.Dest.Router.GetWrappedNative(nil) + require.NoError(t, err) + tokenPricesUSDPipeline := fmt.Sprintf(` +// Price 1 +link [type=http method=GET url="%s"]; +link_parse [type=jsonparse path="UsdPerLink"]; +link->link_parse; +eth [type=http method=GET url="%s"]; +eth_parse [type=jsonparse path="UsdPerETH"]; +eth->eth_parse; +merge [type=merge left="{}" right="{\\\"%s\\\":$(link_parse), \\\"%s\\\":$(eth_parse), \\\"%s\\\":$(eth_parse)}"];`, + linkUSD.URL, ethUSD.URL, c.Dest.LinkToken.Address(), sourceWrappedNative, destWrappedNative) + + return tokenPricesUSDPipeline, linkUSD, ethUSD +} + +func (c *CCIPIntegrationTestHarness) AddAllJobs(t *testing.T, jobParams integrationtesthelpers.CCIPJobSpecParams) { + jobParams.OffRamp = c.Dest.OffRamp.Address() + + commitSpec, err := jobParams.CommitJobSpec() + require.NoError(t, err) + geExecutionSpec, err := jobParams.ExecutionJobSpec() + require.NoError(t, err) + nodes := c.Nodes + for _, node := range nodes { + node.AddJobsWithSpec(t, commitSpec) + node.AddJobsWithSpec(t, geExecutionSpec) + } +} + +func (c *CCIPIntegrationTestHarness) jobSpecProposal(t *testing.T, specTemplate string, f func() (*integrationtesthelpers.OCR2TaskJobSpec, error), feedsManagerId int64, version int32, opts ...any) feeds2.ProposeJobArgs { + spec, err := f() + require.NoError(t, err) + + args := []any{spec.OCR2OracleSpec.ContractID} + args = append(args, opts...) + + return feeds2.ProposeJobArgs{ + FeedsManagerID: feedsManagerId, + RemoteUUID: uuid.New(), + Multiaddrs: nil, + Version: version, + Spec: fmt.Sprintf(specTemplate, args...), + } +} + +func (c *CCIPIntegrationTestHarness) SetupFeedsManager(t *testing.T) { + ctx := testutils.Context(t) + for _, node := range c.Nodes { + f := node.App.GetFeedsService() + + managers, err := f.ListManagers(ctx) + require.NoError(t, err) + if len(managers) > 0 { + // Use at most one feeds manager, don't register if one already exists + continue + } + + secret := utils.RandomBytes32() + pkey, err := crypto.PublicKeyFromHex(hex.EncodeToString(secret[:])) + require.NoError(t, err) + + m := feeds2.RegisterManagerParams{ + Name: "CCIP", + URI: "http://localhost:8080", + PublicKey: *pkey, + } + + _, err = f.RegisterManager(testutils.Context(t), m) + require.NoError(t, err) + + connManager := feedsMocks.NewConnectionsManager(t) + connManager.On("GetClient", mock.Anything).Maybe().Return(NoopFeedsClient{}, nil) + connManager.On("Close").Maybe().Return() + connManager.On("IsConnected", mock.Anything).Maybe().Return(true) + f.Unsafe_SetConnectionsManager(connManager) + } +} + +func (c *CCIPIntegrationTestHarness) ApproveJobSpecs(t *testing.T, jobParams integrationtesthelpers.CCIPJobSpecParams) { + ctx := testutils.Context(t) + + for _, node := range c.Nodes { + f := node.App.GetFeedsService() + managers, err := f.ListManagers(ctx) + require.NoError(t, err) + require.Len(t, managers, 1, "expected exactly one feeds manager") + + execSpec := c.jobSpecProposal( + t, + execSpecTemplate, + jobParams.ExecutionJobSpec, + managers[0].ID, + 1, + node.KeyBundle.ID(), + node.Transmitter.Hex(), + utils.RandomAddress().String(), + utils.RandomAddress().String(), + ) + execId, err := f.ProposeJob(ctx, &execSpec) + require.NoError(t, err) + + err = f.ApproveSpec(ctx, execId, true) + require.NoError(t, err) + + var commitSpec feeds2.ProposeJobArgs + if jobParams.TokenPricesUSDPipeline != "" { + commitSpec = c.jobSpecProposal( + t, + commitSpecTemplatePipeline, + jobParams.CommitJobSpec, + managers[0].ID, + 2, + node.KeyBundle.ID(), + node.Transmitter.Hex(), + jobParams.OffRamp.String(), + jobParams.TokenPricesUSDPipeline, + ) + } else { + commitSpec = c.jobSpecProposal( + t, + commitSpecTemplateDynamicPriceGetter, + jobParams.CommitJobSpec, + managers[0].ID, + 2, + node.KeyBundle.ID(), + node.Transmitter.Hex(), + jobParams.OffRamp.String(), + jobParams.PriceGetterConfig, + ) + } + + commitId, err := f.ProposeJob(ctx, &commitSpec) + require.NoError(t, err) + + err = f.ApproveSpec(ctx, commitId, true) + require.NoError(t, err) + } +} + +func (c *CCIPIntegrationTestHarness) AllNodesHaveReqSeqNum(t *testing.T, seqNum int, onRampOpts ...common.Address) logpoller.Log { + var log logpoller.Log + nodes := c.Nodes + var onRamp common.Address + if len(onRampOpts) > 0 { + onRamp = onRampOpts[0] + } else { + require.NotNil(t, c.Source.OnRamp, "no onramp configured") + onRamp = c.Source.OnRamp.Address() + } + for _, node := range nodes { + log = node.EventuallyHasReqSeqNum(t, c, onRamp, seqNum) + } + return log +} + +func (c *CCIPIntegrationTestHarness) AllNodesHaveExecutedSeqNums(t *testing.T, minSeqNum int, maxSeqNum int, offRampOpts ...common.Address) []logpoller.Log { + var logs []logpoller.Log + nodes := c.Nodes + var offRamp common.Address + + if len(offRampOpts) > 0 { + offRamp = offRampOpts[0] + } else { + require.NotNil(t, c.Dest.OffRamp, "no offramp configured") + offRamp = c.Dest.OffRamp.Address() + } + for _, node := range nodes { + logs = node.EventuallyHasExecutedSeqNums(t, c, offRamp, minSeqNum, maxSeqNum) + } + return logs +} + +func (c *CCIPIntegrationTestHarness) NoNodesHaveExecutedSeqNum(t *testing.T, seqNum int, offRampOpts ...common.Address) logpoller.Log { + var log logpoller.Log + nodes := c.Nodes + var offRamp common.Address + if len(offRampOpts) > 0 { + offRamp = offRampOpts[0] + } else { + require.NotNil(t, c.Dest.OffRamp, "no offramp configured") + offRamp = c.Dest.OffRamp.Address() + } + for _, node := range nodes { + log = node.ConsistentlySeqNumHasNotBeenExecuted(t, c, offRamp, seqNum) + } + return log +} + +func (c *CCIPIntegrationTestHarness) EventuallyCommitReportAccepted(t *testing.T, currentBlock uint64, commitStoreOpts ...common.Address) commit_store_1_2_0.CommitStoreCommitReport { + var commitStore *commit_store_1_2_0.CommitStore + var err error + if len(commitStoreOpts) > 0 { + commitStore, err = commit_store_1_2_0.NewCommitStore(commitStoreOpts[0], c.Dest.Chain) + require.NoError(t, err) + } else { + require.NotNil(t, c.Dest.CommitStore, "no commitStore configured") + commitStore = c.Dest.CommitStore + } + g := gomega.NewGomegaWithT(t) + var report commit_store_1_2_0.CommitStoreCommitReport + g.Eventually(func() bool { + it, err := commitStore.FilterReportAccepted(&bind.FilterOpts{Start: currentBlock}) + g.Expect(err).NotTo(gomega.HaveOccurred(), "Error filtering ReportAccepted event") + g.Expect(it.Next()).To(gomega.BeTrue(), "No ReportAccepted event found") + report = it.Event.Report + if report.MerkleRoot != [32]byte{} { + t.Log("Report Accepted by commitStore") + return true + } + return false + }, testutils.WaitTimeout(t), 1*time.Second).Should(gomega.BeTrue(), "report has not been committed") + return report +} + +func (c *CCIPIntegrationTestHarness) EventuallyExecutionStateChangedToSuccess(t *testing.T, seqNum []uint64, blockNum uint64, offRampOpts ...common.Address) { + var offRamp *evm_2_evm_offramp_1_2_0.EVM2EVMOffRamp + var err error + if len(offRampOpts) > 0 { + offRamp, err = evm_2_evm_offramp_1_2_0.NewEVM2EVMOffRamp(offRampOpts[0], c.Dest.Chain) + require.NoError(t, err) + } else { + require.NotNil(t, c.Dest.OffRamp, "no offRamp configured") + offRamp = c.Dest.OffRamp + } + gomega.NewGomegaWithT(t).Eventually(func() bool { + it, err := offRamp.FilterExecutionStateChanged(&bind.FilterOpts{Start: blockNum}, seqNum, [][32]byte{}) + require.NoError(t, err) + for it.Next() { + if cciptypes.MessageExecutionState(it.Event.State) == cciptypes.ExecutionStateSuccess { + t.Logf("ExecutionStateChanged event found for seqNum %d", it.Event.SequenceNumber) + return true + } + } + c.Source.Chain.Commit() + c.Dest.Chain.Commit() + return false + }, testutils.WaitTimeout(t), time.Second). + Should(gomega.BeTrue(), "ExecutionStateChanged Event") +} + +func (c *CCIPIntegrationTestHarness) EventuallyReportCommitted(t *testing.T, max int, commitStoreOpts ...common.Address) uint64 { + var commitStore *commit_store_1_2_0.CommitStore + var err error + var committedSeqNum uint64 + if len(commitStoreOpts) > 0 { + commitStore, err = commit_store_1_2_0.NewCommitStore(commitStoreOpts[0], c.Dest.Chain) + require.NoError(t, err) + } else { + require.NotNil(t, c.Dest.CommitStore, "no commitStore configured") + commitStore = c.Dest.CommitStore + } + gomega.NewGomegaWithT(t).Eventually(func() bool { + minSeqNum, err := commitStore.GetExpectedNextSequenceNumber(nil) + require.NoError(t, err) + c.Source.Chain.Commit() + c.Dest.Chain.Commit() + t.Log("next expected seq num reported", minSeqNum) + committedSeqNum = minSeqNum + return minSeqNum > uint64(max) + }, testutils.WaitTimeout(t), time.Second).Should(gomega.BeTrue(), "report has not been committed") + return committedSeqNum +} + +func (c *CCIPIntegrationTestHarness) EventuallySendRequested(t *testing.T, seqNum uint64, onRampOpts ...common.Address) { + var onRamp *evm_2_evm_onramp_1_2_0.EVM2EVMOnRamp + var err error + if len(onRampOpts) > 0 { + onRamp, err = evm_2_evm_onramp_1_2_0.NewEVM2EVMOnRamp(onRampOpts[0], c.Source.Chain) + require.NoError(t, err) + } else { + require.NotNil(t, c.Source.OnRamp, "no onRamp configured") + onRamp = c.Source.OnRamp + } + gomega.NewGomegaWithT(t).Eventually(func() bool { + it, err := onRamp.FilterCCIPSendRequested(nil) + require.NoError(t, err) + for it.Next() { + if it.Event.Message.SequenceNumber == seqNum { + t.Log("sendRequested generated for", seqNum) + return true + } + } + c.Source.Chain.Commit() + c.Dest.Chain.Commit() + return false + }, testutils.WaitTimeout(t), time.Second).Should(gomega.BeTrue(), "sendRequested has not been generated") +} + +func (c *CCIPIntegrationTestHarness) ConsistentlyReportNotCommitted(t *testing.T, max int, commitStoreOpts ...common.Address) { + var commitStore *commit_store_1_2_0.CommitStore + var err error + if len(commitStoreOpts) > 0 { + commitStore, err = commit_store_1_2_0.NewCommitStore(commitStoreOpts[0], c.Dest.Chain) + require.NoError(t, err) + } else { + require.NotNil(t, c.Dest.CommitStore, "no commitStore configured") + commitStore = c.Dest.CommitStore + } + gomega.NewGomegaWithT(t).Consistently(func() bool { + minSeqNum, err := commitStore.GetExpectedNextSequenceNumber(nil) + require.NoError(t, err) + c.Source.Chain.Commit() + c.Dest.Chain.Commit() + t.Log("min seq num reported", minSeqNum) + return minSeqNum > uint64(max) + }, testutils.WaitTimeout(t), time.Second).Should(gomega.BeFalse(), "report has been committed") +} + +func (c *CCIPIntegrationTestHarness) SetupAndStartNodes(ctx context.Context, t *testing.T, bootstrapNodePort int64) (Node, []Node, int64) { + appBootstrap, bootstrapPeerID, bootstrapTransmitter, bootstrapKb := setupNodeCCIP(t, c.Dest.User, bootstrapNodePort, + "bootstrap_ccip", c.Source.Chain, c.Dest.Chain, big.NewInt(0).SetUint64(c.Source.ChainID), + big.NewInt(0).SetUint64(c.Dest.ChainID), "", 0) + var ( + oracles []confighelper.OracleIdentityExtra + nodes []Node + ) + err := appBootstrap.Start(ctx) + require.NoError(t, err) + t.Cleanup(func() { + require.NoError(t, appBootstrap.Stop()) + }) + bootstrapNode := Node{ + App: appBootstrap, + Transmitter: bootstrapTransmitter, + KeyBundle: bootstrapKb, + } + // Set up the minimum 4 oracles all funded with destination ETH + for i := int64(0); i < 4; i++ { + app, peerID, transmitter, kb := setupNodeCCIP( + t, + c.Dest.User, + int64(freeport.GetOne(t)), + fmt.Sprintf("oracle_ccip%d", i), + c.Source.Chain, + c.Dest.Chain, + big.NewInt(0).SetUint64(c.Source.ChainID), + big.NewInt(0).SetUint64(c.Dest.ChainID), + bootstrapPeerID, + bootstrapNodePort, + ) + nodes = append(nodes, Node{ + App: app, + Transmitter: transmitter, + KeyBundle: kb, + }) + offchainPublicKey, _ := hex.DecodeString(strings.TrimPrefix(kb.OnChainPublicKey(), "0x")) + oracles = append(oracles, confighelper.OracleIdentityExtra{ + OracleIdentity: confighelper.OracleIdentity{ + OnchainPublicKey: offchainPublicKey, + TransmitAccount: types4.Account(transmitter.String()), + OffchainPublicKey: kb.OffchainPublicKey(), + PeerID: peerID, + }, + ConfigEncryptionPublicKey: kb.ConfigEncryptionPublicKey(), + }) + err = app.Start(ctx) + require.NoError(t, err) + t.Cleanup(func() { + require.NoError(t, app.Stop()) + }) + } + + c.Oracles = oracles + commitOnchainConfig := c.CreateDefaultCommitOnchainConfig(t) + commitOffchainConfig := c.CreateDefaultCommitOffchainConfig(t) + execOnchainConfig := c.CreateDefaultExecOnchainConfig(t) + execOffchainConfig := c.CreateDefaultExecOffchainConfig(t) + + configBlock := c.SetupOnchainConfig(t, commitOnchainConfig, commitOffchainConfig, execOnchainConfig, execOffchainConfig) + c.Nodes = nodes + c.Bootstrap = bootstrapNode + return bootstrapNode, nodes, configBlock +} + +func (c *CCIPIntegrationTestHarness) SetUpNodesAndJobs(t *testing.T, pricePipeline string, priceGetterConfig string, usdcAttestationAPI string) integrationtesthelpers.CCIPJobSpecParams { + // setup Jobs + ctx := context.Background() + // Starts nodes and configures them in the OCR contracts. + bootstrapNode, _, configBlock := c.SetupAndStartNodes(ctx, t, int64(freeport.GetOne(t))) + + jobParams := c.NewCCIPJobSpecParams(pricePipeline, priceGetterConfig, configBlock, usdcAttestationAPI) + + // Add the bootstrap job + c.Bootstrap.AddBootstrapJob(t, jobParams.BootstrapJob(c.Dest.CommitStore.Address().Hex())) + c.AddAllJobs(t, jobParams) + + // Replay for bootstrap. + bc, err := bootstrapNode.App.GetRelayers().LegacyEVMChains().Get(strconv.FormatUint(c.Dest.ChainID, 10)) + require.NoError(t, err) + require.NoError(t, bc.LogPoller().Replay(context.Background(), configBlock)) + c.Dest.Chain.Commit() + + return jobParams +} + +func (c *CCIPIntegrationTestHarness) NewCCIPJobSpecParams(tokenPricesUSDPipeline string, priceGetterConfig string, configBlock int64, usdcAttestationAPI string) integrationtesthelpers.CCIPJobSpecParams { + return integrationtesthelpers.CCIPJobSpecParams{ + CommitStore: c.Dest.CommitStore.Address(), + OffRamp: c.Dest.OffRamp.Address(), + DestEvmChainId: c.Dest.ChainID, + SourceChainName: "SimulatedSource", + DestChainName: "SimulatedDest", + TokenPricesUSDPipeline: tokenPricesUSDPipeline, + PriceGetterConfig: priceGetterConfig, + DestStartBlock: uint64(configBlock), + USDCAttestationAPI: usdcAttestationAPI, + } +} + +func DecodeCommitOnChainConfig(encoded []byte) (ccipdata.CommitOnchainConfig, error) { + var onchainConfig ccipdata.CommitOnchainConfig + unpacked, err := abihelpers.DecodeOCR2Config(encoded) + if err != nil { + return onchainConfig, err + } + onChainCfg := unpacked.OnchainConfig + onchainConfig, err = abihelpers.DecodeAbiStruct[ccipdata.CommitOnchainConfig](onChainCfg) + if err != nil { + return onchainConfig, err + } + return onchainConfig, nil +} + +func DecodeExecOnChainConfig(encoded []byte) (v1_2_0.ExecOnchainConfig, error) { + var onchainConfig v1_2_0.ExecOnchainConfig + unpacked, err := abihelpers.DecodeOCR2Config(encoded) + if err != nil { + return onchainConfig, errors.Wrap(err, "failed to unpack log data") + } + onChainCfg := unpacked.OnchainConfig + onchainConfig, err = abihelpers.DecodeAbiStruct[v1_2_0.ExecOnchainConfig](onChainCfg) + if err != nil { + return onchainConfig, err + } + return onchainConfig, nil +} + +type ksa struct { + keystore.Master + csa keystore.CSA +} + +func (k *ksa) CSA() keystore.CSA { + return k.csa +} + +func NewKsa(db *sqlx.DB, lggr logger.Logger, csa keystore.CSA) *ksa { + return &ksa{ + Master: keystore.New(db, clutils.FastScryptParams, lggr), + csa: csa, + } +} + +type NoopFeedsClient struct{} + +func (n NoopFeedsClient) ApprovedJob(context.Context, *pb.ApprovedJobRequest) (*pb.ApprovedJobResponse, error) { + return &pb.ApprovedJobResponse{}, nil +} + +func (n NoopFeedsClient) Healthcheck(context.Context, *pb.HealthcheckRequest) (*pb.HealthcheckResponse, error) { + return &pb.HealthcheckResponse{}, nil +} + +func (n NoopFeedsClient) UpdateNode(context.Context, *pb.UpdateNodeRequest) (*pb.UpdateNodeResponse, error) { + return &pb.UpdateNodeResponse{}, nil +} + +func (n NoopFeedsClient) RejectedJob(context.Context, *pb.RejectedJobRequest) (*pb.RejectedJobResponse, error) { + return &pb.RejectedJobResponse{}, nil +} + +func (n NoopFeedsClient) CancelledJob(context.Context, *pb.CancelledJobRequest) (*pb.CancelledJobResponse, error) { + return &pb.CancelledJobResponse{}, nil +} diff --git a/core/services/ocr2/plugins/ccip/testhelpers/testhelpers_1_4_0/config_1_4_0.go b/core/services/ocr2/plugins/ccip/testhelpers/testhelpers_1_4_0/config_1_4_0.go new file mode 100644 index 00000000000..087c21e9333 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/testhelpers/testhelpers_1_4_0/config_1_4_0.go @@ -0,0 +1,75 @@ +// Package with set of configs that should be used only within tests suites + +package testhelpers_1_4_0 + +import ( + "testing" + "time" + + "github.com/stretchr/testify/require" + + "github.com/smartcontractkit/chainlink-common/pkg/config" + + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/abihelpers" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/testhelpers" +) + +var PermissionLessExecutionThresholdSeconds = uint32(testhelpers.FirstBlockAge.Seconds()) + +func (c *CCIPContracts) CreateDefaultCommitOnchainConfig(t *testing.T) []byte { + config, err := abihelpers.EncodeAbiStruct(ccipdata.CommitOnchainConfig{ + PriceRegistry: c.Dest.PriceRegistry.Address(), + }) + require.NoError(t, err) + return config +} + +func (c *CCIPContracts) CreateDefaultCommitOffchainConfig(t *testing.T) []byte { + return c.createCommitOffchainConfig(t, 10*time.Second, 5*time.Second) +} + +func (c *CCIPContracts) createCommitOffchainConfig(t *testing.T, feeUpdateHearBeat time.Duration, inflightCacheExpiry time.Duration) []byte { + config, err := NewCommitOffchainConfig( + *config.MustNewDuration(feeUpdateHearBeat), + 1, + 1, + *config.MustNewDuration(feeUpdateHearBeat), + 1, + *config.MustNewDuration(inflightCacheExpiry), + false, + ).Encode() + require.NoError(t, err) + return config +} + +func (c *CCIPContracts) CreateDefaultExecOnchainConfig(t *testing.T) []byte { + config, err := abihelpers.EncodeAbiStruct(v1_2_0.ExecOnchainConfig{ + PermissionLessExecutionThresholdSeconds: PermissionLessExecutionThresholdSeconds, + Router: c.Dest.Router.Address(), + PriceRegistry: c.Dest.PriceRegistry.Address(), + MaxDataBytes: 1e5, + MaxNumberOfTokensPerMsg: 5, + MaxPoolReleaseOrMintGas: 200_000, + }) + require.NoError(t, err) + return config +} + +func (c *CCIPContracts) CreateDefaultExecOffchainConfig(t *testing.T) []byte { + return c.createExecOffchainConfig(t, 1*time.Minute, 1*time.Minute) +} + +func (c *CCIPContracts) createExecOffchainConfig(t *testing.T, inflightCacheExpiry time.Duration, rootSnoozeTime time.Duration) []byte { + config, err := NewExecOffchainConfig( + 1, + 5_000_000, + 0.07, + *config.MustNewDuration(inflightCacheExpiry), + *config.MustNewDuration(rootSnoozeTime), + uint32(0), + ).Encode() + require.NoError(t, err) + return config +} diff --git a/core/services/ocr2/plugins/ccip/tokendata/bgworker.go b/core/services/ocr2/plugins/ccip/tokendata/bgworker.go new file mode 100644 index 00000000000..1a74ab2305b --- /dev/null +++ b/core/services/ocr2/plugins/ccip/tokendata/bgworker.go @@ -0,0 +1,213 @@ +package tokendata + +import ( + "context" + "fmt" + "strconv" + "sync" + "time" + + "github.com/patrickmn/go-cache" + + "github.com/smartcontractkit/chainlink-common/pkg/services" + + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + "github.com/smartcontractkit/chainlink/v2/core/services/job" +) + +type msgResult struct { + TokenAmountIndex int + Err error + Data []byte +} + +type Worker interface { + job.ServiceCtx + // AddJobsFromMsgs will include the provided msgs for background processing. + AddJobsFromMsgs(ctx context.Context, msgs []cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta) + + // GetMsgTokenData returns the token data for the provided msg. If data are not ready it keeps waiting + // until they get ready. Important: Make sure to pass a proper context with timeout. + GetMsgTokenData(ctx context.Context, msg cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta) ([][]byte, error) + + GetReaders() map[cciptypes.Address]Reader +} + +type BackgroundWorker struct { + tokenDataReaders map[cciptypes.Address]Reader + numWorkers int + jobsChan chan cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta + resultsCache *cache.Cache + timeoutDur time.Duration + + services.StateMachine + wg *sync.WaitGroup + backgroundCtx context.Context //nolint:containedctx + backgroundCancel context.CancelFunc +} + +func NewBackgroundWorker( + tokenDataReaders map[cciptypes.Address]Reader, + numWorkers int, + timeoutDur time.Duration, + expirationDur time.Duration, +) *BackgroundWorker { + if expirationDur == 0 { + expirationDur = 24 * time.Hour + } + + ctx, cancel := context.WithCancel(context.Background()) + return &BackgroundWorker{ + tokenDataReaders: tokenDataReaders, + numWorkers: numWorkers, + jobsChan: make(chan cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta, numWorkers*100), + resultsCache: cache.New(expirationDur, expirationDur/2), + timeoutDur: timeoutDur, + + wg: new(sync.WaitGroup), + backgroundCtx: ctx, + backgroundCancel: cancel, + } +} + +func (w *BackgroundWorker) Start(context.Context) error { + return w.StateMachine.StartOnce("Token BackgroundWorker", func() error { + for i := 0; i < w.numWorkers; i++ { + w.wg.Add(1) + w.run() + } + return nil + }) +} + +func (w *BackgroundWorker) Close() error { + return w.StateMachine.StopOnce("Token BackgroundWorker", func() error { + w.backgroundCancel() + w.wg.Wait() + return nil + }) +} + +func (w *BackgroundWorker) AddJobsFromMsgs(ctx context.Context, msgs []cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta) { + w.wg.Add(1) + go func() { + defer w.wg.Done() + for _, msg := range msgs { + select { + case <-w.backgroundCtx.Done(): + return + case <-ctx.Done(): + return + default: + if len(msg.TokenAmounts) > 0 { + w.jobsChan <- msg + } + } + } + }() +} + +func (w *BackgroundWorker) GetReaders() map[cciptypes.Address]Reader { + return w.tokenDataReaders +} + +func (w *BackgroundWorker) GetMsgTokenData(ctx context.Context, msg cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta) ([][]byte, error) { + res, err := w.getMsgTokenData(ctx, msg.SequenceNumber) + if err != nil { + return nil, err + } + + tokenDatas := make([][]byte, len(msg.TokenAmounts)) + for _, r := range res { + if r.Err != nil { + return nil, r.Err + } + if r.TokenAmountIndex < 0 || r.TokenAmountIndex >= len(msg.TokenAmounts) { + return nil, fmt.Errorf("token data index inconsistency") + } + tokenDatas[r.TokenAmountIndex] = r.Data + } + + return tokenDatas, nil +} + +func (w *BackgroundWorker) run() { + go func() { + defer w.wg.Done() + for { + select { + case <-w.backgroundCtx.Done(): + return + case msg := <-w.jobsChan: + w.workOnMsg(w.backgroundCtx, msg) + } + } + }() +} + +func (w *BackgroundWorker) workOnMsg(ctx context.Context, msg cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta) { + results := make([]msgResult, 0, len(msg.TokenAmounts)) + + cachedTokenData := make(map[int]msgResult) // tokenAmount index -> token data + if cachedData, exists := w.getFromCache(msg.SequenceNumber); exists { + for _, r := range cachedData { + cachedTokenData[r.TokenAmountIndex] = r + } + } + + for i, token := range msg.TokenAmounts { + offchainTokenDataProvider, exists := w.tokenDataReaders[token.Token] + if !exists { + // No token data required + continue + } + + // if the result exists in the cache and there wasn't any error keep the existing result + if cachedResult, exists := cachedTokenData[i]; exists && cachedResult.Err == nil { + results = append(results, cachedResult) + continue + } + + // if there was any error or if the data do not exist in the cache make a call to the provider + timeoutCtx, cf := context.WithTimeout(ctx, w.timeoutDur) + tknData, err := offchainTokenDataProvider.ReadTokenData(timeoutCtx, msg, i) + cf() + results = append(results, msgResult{ + TokenAmountIndex: i, + Err: err, + Data: tknData, + }) + } + + w.resultsCache.Set(strconv.FormatUint(msg.SequenceNumber, 10), results, cache.DefaultExpiration) +} + +func (w *BackgroundWorker) getMsgTokenData(ctx context.Context, seqNum uint64) ([]msgResult, error) { + if msgTokenData, exists := w.getFromCache(seqNum); exists { + return msgTokenData, nil + } + + ctx, cf := context.WithTimeout(ctx, w.timeoutDur) + defer cf() + + // wait until the results are ready or until context timeout is reached + tick := time.NewTicker(100 * time.Millisecond) + for { + select { + case <-ctx.Done(): + return nil, context.DeadlineExceeded + case <-tick.C: + if msgTokenData, exists := w.getFromCache(seqNum); exists { + return msgTokenData, nil + } + } + } +} + +func (w *BackgroundWorker) getFromCache(seqNum uint64) ([]msgResult, bool) { + rawResult, found := w.resultsCache.Get(strconv.FormatUint(seqNum, 10)) + if !found { + return nil, false + } + return rawResult.([]msgResult), true +} diff --git a/core/services/ocr2/plugins/ccip/tokendata/bgworker_test.go b/core/services/ocr2/plugins/ccip/tokendata/bgworker_test.go new file mode 100644 index 00000000000..5d505363ac7 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/tokendata/bgworker_test.go @@ -0,0 +1,188 @@ +package tokendata_test + +import ( + "context" + "fmt" + "math/rand" + "testing" + "time" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + "github.com/stretchr/testify/require" + + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/tokendata" +) + +func TestBackgroundWorker(t *testing.T) { + ctx := testutils.Context(t) + + const numTokens = 100 + const numWorkers = 20 + const numMessages = 40 + const maxReaderLatencyMS = 200 + const percentOfTokensWithoutTokenData = 10 + + tokens := make([]cciptypes.Address, numTokens) + readers := make(map[cciptypes.Address]*tokendata.MockReader, numTokens) + tokenDataReaders := make(map[cciptypes.Address]tokendata.Reader, numTokens) + tokenData := make(map[cciptypes.Address][]byte) + delays := make(map[cciptypes.Address]time.Duration) + + for i := range tokens { + tokens[i] = cciptypes.Address(utils.RandomAddress().String()) + readers[tokens[i]] = tokendata.NewMockReader(t) + if rand.Intn(100) >= percentOfTokensWithoutTokenData { + tokenDataReaders[tokens[i]] = readers[tokens[i]] + tokenData[tokens[i]] = []byte(fmt.Sprintf("...token %x data...", tokens[i])) + } + + // specify a random latency for the reader implementation + readerLatency := rand.Intn(maxReaderLatencyMS) + delays[tokens[i]] = time.Duration(readerLatency) * time.Millisecond + } + w := tokendata.NewBackgroundWorker(tokenDataReaders, numWorkers, 5*time.Second, time.Hour) + require.NoError(t, w.Start(ctx)) + + msgs := make([]cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta, numMessages) + for i := range msgs { + tk := tokens[i%len(tokens)] + + msgs[i] = cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta{ + EVM2EVMMessage: cciptypes.EVM2EVMMessage{ + SequenceNumber: uint64(i + 1), + TokenAmounts: []cciptypes.TokenAmount{{Token: tk}}, + }, + } + + reader := readers[tk] + reader.On("ReadTokenData", mock.Anything, msgs[i], 0).Run(func(args mock.Arguments) { + time.Sleep(delays[tk]) + }).Return(tokenData[tk], nil).Maybe() + } + + w.AddJobsFromMsgs(ctx, msgs) + // processing of the messages should have started at this point + + tStart := time.Now() + for _, msg := range msgs { + b, err := w.GetMsgTokenData(ctx, msg) // fetched from provider + assert.NoError(t, err) + assert.Equal(t, tokenData[msg.TokenAmounts[0].Token], b[0]) + } + assert.True(t, time.Since(tStart) < 600*time.Millisecond) + assert.True(t, time.Since(tStart) > 200*time.Millisecond) + + tStart = time.Now() + for _, msg := range msgs { + b, err := w.GetMsgTokenData(ctx, msg) // fetched from cache + assert.NoError(t, err) + assert.Equal(t, tokenData[msg.TokenAmounts[0].Token], b[0]) + } + assert.True(t, time.Since(tStart) < 200*time.Millisecond) + + w.AddJobsFromMsgs(ctx, msgs) // same messages are added but they should already be in cache + tStart = time.Now() + for _, msg := range msgs { + b, err := w.GetMsgTokenData(ctx, msg) + assert.NoError(t, err) + assert.Equal(t, tokenData[msg.TokenAmounts[0].Token], b[0]) + } + assert.True(t, time.Since(tStart) < 200*time.Millisecond) + + require.NoError(t, w.Close()) +} + +func TestBackgroundWorker_RetryOnErrors(t *testing.T) { + ctx := testutils.Context(t) + + tk1 := cciptypes.Address(utils.RandomAddress().String()) + tk2 := cciptypes.Address(utils.RandomAddress().String()) + + rdr1 := tokendata.NewMockReader(t) + rdr2 := tokendata.NewMockReader(t) + + w := tokendata.NewBackgroundWorker(map[cciptypes.Address]tokendata.Reader{ + tk1: rdr1, + tk2: rdr2, + }, 10, 5*time.Second, time.Hour) + require.NoError(t, w.Start(ctx)) + + msgs := []cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta{ + {EVM2EVMMessage: cciptypes.EVM2EVMMessage{ + SequenceNumber: uint64(1), + TokenAmounts: []cciptypes.TokenAmount{{Token: tk1}}, + }}, + {EVM2EVMMessage: cciptypes.EVM2EVMMessage{ + SequenceNumber: uint64(2), + TokenAmounts: []cciptypes.TokenAmount{{Token: tk2}}, + }}, + } + + rdr1.On("ReadTokenData", mock.Anything, msgs[0], 0). + Return([]byte("some data"), nil).Once() + + // reader2 returns an error + rdr2.On("ReadTokenData", mock.Anything, msgs[1], 0). + Return(nil, fmt.Errorf("some err")).Once() + + w.AddJobsFromMsgs(ctx, msgs) + // processing of the messages should have started at this point + + tokenData, err := w.GetMsgTokenData(ctx, msgs[0]) + assert.NoError(t, err) + assert.Equal(t, []byte("some data"), tokenData[0]) + + _, err = w.GetMsgTokenData(ctx, msgs[1]) + assert.Error(t, err) + assert.Errorf(t, err, "some error") + + // we make the second reader to return data + rdr2.On("ReadTokenData", mock.Anything, msgs[1], 0). + Return([]byte("some other data"), nil).Once() + + // add the jobs again, at this point jobs that previously returned + // an error are removed from the cache + w.AddJobsFromMsgs(ctx, msgs) + + // since reader1 returned some data before, we expect to get the cached result + tokenData, err = w.GetMsgTokenData(ctx, msgs[0]) + assert.NoError(t, err) + assert.Equal(t, []byte("some data"), tokenData[0]) + + // wait some time for msg2 to be re-processed and error overwritten + time.Sleep(20 * time.Millisecond) // todo: improve the test + + // for reader2 that returned an error before we expect to get data now + tokenData, err = w.GetMsgTokenData(ctx, msgs[1]) + assert.NoError(t, err) + assert.Equal(t, []byte("some other data"), tokenData[0]) + + require.NoError(t, w.Close()) +} + +func TestBackgroundWorker_Timeout(t *testing.T) { + ctx := testutils.Context(t) + + tk1 := cciptypes.Address(utils.RandomAddress().String()) + tk2 := cciptypes.Address(utils.RandomAddress().String()) + + rdr1 := tokendata.NewMockReader(t) + rdr2 := tokendata.NewMockReader(t) + + w := tokendata.NewBackgroundWorker( + map[cciptypes.Address]tokendata.Reader{tk1: rdr1, tk2: rdr2}, 10, 5*time.Second, time.Hour) + require.NoError(t, w.Start(ctx)) + + ctx, cf := context.WithTimeout(ctx, 500*time.Millisecond) + defer cf() + + _, err := w.GetMsgTokenData(ctx, cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta{ + EVM2EVMMessage: cciptypes.EVM2EVMMessage{SequenceNumber: 1}}, + ) + assert.Error(t, err) + require.NoError(t, w.Close()) +} diff --git a/core/services/ocr2/plugins/ccip/tokendata/http/http_client.go b/core/services/ocr2/plugins/ccip/tokendata/http/http_client.go new file mode 100644 index 00000000000..79ec21b1b83 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/tokendata/http/http_client.go @@ -0,0 +1,48 @@ +package http + +import ( + "context" + "io" + "net/http" + "time" + + "github.com/pkg/errors" + + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/tokendata" +) + +type IHttpClient interface { + // Get issue a GET request to the given url and return the response body and status code. + Get(ctx context.Context, url string, timeout time.Duration) ([]byte, int, http.Header, error) +} + +type HttpClient struct { +} + +func (s *HttpClient) Get(ctx context.Context, url string, timeout time.Duration) ([]byte, int, http.Header, error) { + // Use a timeout to guard against attestation API hanging, causing observation timeout and failing to make any progress. + timeoutCtx, cancel := context.WithTimeoutCause(ctx, timeout, tokendata.ErrTimeout) + defer cancel() + req, err := http.NewRequestWithContext(timeoutCtx, http.MethodGet, url, nil) + if err != nil { + return nil, http.StatusBadRequest, nil, err + } + req.Header.Add("accept", "application/json") + res, err := http.DefaultClient.Do(req) + if err != nil { + if errors.Is(err, context.DeadlineExceeded) { + return nil, http.StatusRequestTimeout, nil, tokendata.ErrTimeout + } + // On error, res is nil in most cases, do not read res.StatusCode, return BadRequest + return nil, http.StatusBadRequest, nil, err + } + defer res.Body.Close() + + // Explicitly signal if the API is being rate limited + if res.StatusCode == http.StatusTooManyRequests { + return nil, res.StatusCode, res.Header, tokendata.ErrRateLimit + } + + body, err := io.ReadAll(res.Body) + return body, res.StatusCode, res.Header, err +} diff --git a/core/services/ocr2/plugins/ccip/tokendata/http/observed_http_client.go b/core/services/ocr2/plugins/ccip/tokendata/http/observed_http_client.go new file mode 100644 index 00000000000..d8fb9b1c576 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/tokendata/http/observed_http_client.go @@ -0,0 +1,69 @@ +package http + +import ( + "context" + "net/http" + "strconv" + "time" + + "github.com/prometheus/client_golang/prometheus" + "github.com/prometheus/client_golang/prometheus/promauto" +) + +var ( + usdcLatencyBuckets = []float64{ + float64(10 * time.Millisecond), + float64(25 * time.Millisecond), + float64(50 * time.Millisecond), + float64(75 * time.Millisecond), + float64(100 * time.Millisecond), + float64(250 * time.Millisecond), + float64(500 * time.Millisecond), + float64(750 * time.Millisecond), + float64(1 * time.Second), + float64(2 * time.Second), + float64(3 * time.Second), + float64(4 * time.Second), + float64(5 * time.Second), + } + usdcClientHistogram = promauto.NewHistogramVec(prometheus.HistogramOpts{ + Name: "ccip_usdc_client_request_total", + Help: "Latency of calls to the USDC client", + Buckets: usdcLatencyBuckets, + }, []string{"status", "success"}) +) + +type ObservedIHttpClient struct { + IHttpClient + histogram *prometheus.HistogramVec +} + +// NewObservedIHttpClient Create a new ObservedIHttpClient with the USDC client metric. +func NewObservedIHttpClient(origin IHttpClient) *ObservedIHttpClient { + return NewObservedIHttpClientWithMetric(origin, usdcClientHistogram) +} + +func NewObservedIHttpClientWithMetric(origin IHttpClient, histogram *prometheus.HistogramVec) *ObservedIHttpClient { + return &ObservedIHttpClient{ + IHttpClient: origin, + histogram: histogram, + } +} + +func (o *ObservedIHttpClient) Get(ctx context.Context, url string, timeout time.Duration) ([]byte, int, http.Header, error) { + return withObservedHttpClient(o.histogram, func() ([]byte, int, http.Header, error) { + return o.IHttpClient.Get(ctx, url, timeout) + }) +} + +func withObservedHttpClient[T any](histogram *prometheus.HistogramVec, contract func() (T, int, http.Header, error)) (T, int, http.Header, error) { + contractExecutionStarted := time.Now() + value, status, headers, err := contract() + histogram. + WithLabelValues( + strconv.FormatInt(int64(status), 10), + strconv.FormatBool(err == nil), + ). + Observe(float64(time.Since(contractExecutionStarted))) + return value, status, headers, err +} diff --git a/core/services/ocr2/plugins/ccip/tokendata/observability/usdc_client_test.go b/core/services/ocr2/plugins/ccip/tokendata/observability/usdc_client_test.go new file mode 100644 index 00000000000..0567b725a8b --- /dev/null +++ b/core/services/ocr2/plugins/ccip/tokendata/observability/usdc_client_test.go @@ -0,0 +1,151 @@ +package observability + +import ( + "context" + "encoding/json" + "math/big" + "math/rand" + "net/http" + "net/http/httptest" + "net/url" + "testing" + "time" + + "github.com/prometheus/client_golang/prometheus" + "github.com/prometheus/client_golang/prometheus/promauto" + io_prometheus_client "github.com/prometheus/client_model/go" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + "github.com/stretchr/testify/require" + + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils" + "github.com/smartcontractkit/chainlink/v2/core/logger" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipcalc" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/mocks" + http2 "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/tokendata/http" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/tokendata/usdc" +) + +type expected struct { + status string + result string + count int +} + +func TestUSDCClientMonitoring(t *testing.T) { + tests := []struct { + name string + server *httptest.Server + requests int + expected []expected + }{ + { + name: "success", + server: newSuccessServer(t), + requests: 5, + expected: []expected{ + {"200", "true", 5}, + {"429", "false", 0}, + }, + }, + { + name: "rate_limited", + server: newRateLimitedServer(), + requests: 26, + expected: []expected{ + {"200", "true", 0}, + {"429", "false", 1}, + }, + }, + } + + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + testMonitoring(t, test.name, test.server, test.requests, test.expected, logger.TestLogger(t)) + }) + } +} + +func testMonitoring(t *testing.T, name string, server *httptest.Server, requests int, expected []expected, log logger.Logger) { + server.Start() + defer server.Close() + attestationURI, err := url.ParseRequestURI(server.URL) + require.NoError(t, err) + + // Define test histogram (avoid side effects from other tests if using the real usdcHistogram). + histogram := promauto.NewHistogramVec(prometheus.HistogramOpts{ + Name: "test_client_histogram_" + name, + Help: "Latency of calls to the USDC mock client", + Buckets: []float64{float64(250 * time.Millisecond), float64(1 * time.Second), float64(5 * time.Second)}, + }, []string{"status", "success"}) + + // Mock USDC reader. + usdcReader := mocks.NewUSDCReader(t) + msgBody := []byte{0xb0, 0xd1} + usdcReader.On("GetUSDCMessagePriorToLogIndexInTx", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(msgBody, nil) + + // Service with monitored http client. + usdcTokenAddr := utils.RandomAddress() + observedHttpClient := http2.NewObservedIHttpClientWithMetric(&http2.HttpClient{}, histogram) + tokenDataReaderDefault := usdc.NewUSDCTokenDataReader(log, usdcReader, attestationURI, 0, usdcTokenAddr, usdc.APIIntervalRateLimitDisabled) + tokenDataReader := usdc.NewUSDCTokenDataReaderWithHttpClient(*tokenDataReaderDefault, observedHttpClient, usdcTokenAddr, usdc.APIIntervalRateLimitDisabled) + require.NotNil(t, tokenDataReader) + + for i := 0; i < requests; i++ { + _, _ = tokenDataReader.ReadTokenData(context.Background(), cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta{ + EVM2EVMMessage: cciptypes.EVM2EVMMessage{ + TokenAmounts: []cciptypes.TokenAmount{ + { + Token: ccipcalc.EvmAddrToGeneric(usdcTokenAddr), + Amount: big.NewInt(rand.Int63()), + }, + }, + }, + }, 0) + } + + // Check that the metrics are updated as expected. + for _, e := range expected { + assert.Equal(t, e.count, counterFromHistogramByLabels(t, histogram, e.status, e.result)) + } +} + +func counterFromHistogramByLabels(t *testing.T, histogramVec *prometheus.HistogramVec, labels ...string) int { + observer, err := histogramVec.GetMetricWithLabelValues(labels...) + require.NoError(t, err) + + metricCh := make(chan prometheus.Metric, 1) + observer.(prometheus.Histogram).Collect(metricCh) + close(metricCh) + + metric := <-metricCh + pb := &io_prometheus_client.Metric{} + err = metric.Write(pb) + require.NoError(t, err) + + return int(pb.GetHistogram().GetSampleCount()) +} + +func newSuccessServer(t *testing.T) *httptest.Server { + return httptest.NewUnstartedServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusOK) + response := struct { + Status string `json:"status"` + Attestation string `json:"attestation"` + }{ + Status: "complete", + Attestation: "720502893578a89a8a87982982ef781c18b193", + } + responseBytes, err := json.Marshal(response) + require.NoError(t, err) + _, err = w.Write(responseBytes) + require.NoError(t, err) + })) +} + +func newRateLimitedServer() *httptest.Server { + return httptest.NewUnstartedServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusTooManyRequests) + })) +} diff --git a/core/services/ocr2/plugins/ccip/tokendata/reader.go b/core/services/ocr2/plugins/ccip/tokendata/reader.go new file mode 100644 index 00000000000..16646bc7c5e --- /dev/null +++ b/core/services/ocr2/plugins/ccip/tokendata/reader.go @@ -0,0 +1,19 @@ +package tokendata + +import ( + "errors" + + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" +) + +var ( + ErrNotReady = errors.New("token data not ready") + ErrRateLimit = errors.New("token data API is being rate limited") + ErrTimeout = errors.New("token data API timed out") + ErrRequestsBlocked = errors.New("requests are currently blocked") +) + +// Reader is an interface for fetching offchain token data +type Reader interface { + cciptypes.TokenDataReader +} diff --git a/core/services/ocr2/plugins/ccip/tokendata/reader_mock.go b/core/services/ocr2/plugins/ccip/tokendata/reader_mock.go new file mode 100644 index 00000000000..39166d61590 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/tokendata/reader_mock.go @@ -0,0 +1,143 @@ +// Code generated by mockery v2.43.2. DO NOT EDIT. + +package tokendata + +import ( + context "context" + + ccip "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + + mock "github.com/stretchr/testify/mock" +) + +// MockReader is an autogenerated mock type for the Reader type +type MockReader struct { + mock.Mock +} + +type MockReader_Expecter struct { + mock *mock.Mock +} + +func (_m *MockReader) EXPECT() *MockReader_Expecter { + return &MockReader_Expecter{mock: &_m.Mock} +} + +// Close provides a mock function with given fields: +func (_m *MockReader) Close() error { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Close") + } + + var r0 error + if rf, ok := ret.Get(0).(func() error); ok { + r0 = rf() + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockReader_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close' +type MockReader_Close_Call struct { + *mock.Call +} + +// Close is a helper method to define mock.On call +func (_e *MockReader_Expecter) Close() *MockReader_Close_Call { + return &MockReader_Close_Call{Call: _e.mock.On("Close")} +} + +func (_c *MockReader_Close_Call) Run(run func()) *MockReader_Close_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockReader_Close_Call) Return(_a0 error) *MockReader_Close_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockReader_Close_Call) RunAndReturn(run func() error) *MockReader_Close_Call { + _c.Call.Return(run) + return _c +} + +// ReadTokenData provides a mock function with given fields: ctx, msg, tokenIndex +func (_m *MockReader) ReadTokenData(ctx context.Context, msg ccip.EVM2EVMOnRampCCIPSendRequestedWithMeta, tokenIndex int) ([]byte, error) { + ret := _m.Called(ctx, msg, tokenIndex) + + if len(ret) == 0 { + panic("no return value specified for ReadTokenData") + } + + var r0 []byte + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, ccip.EVM2EVMOnRampCCIPSendRequestedWithMeta, int) ([]byte, error)); ok { + return rf(ctx, msg, tokenIndex) + } + if rf, ok := ret.Get(0).(func(context.Context, ccip.EVM2EVMOnRampCCIPSendRequestedWithMeta, int) []byte); ok { + r0 = rf(ctx, msg, tokenIndex) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]byte) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, ccip.EVM2EVMOnRampCCIPSendRequestedWithMeta, int) error); ok { + r1 = rf(ctx, msg, tokenIndex) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockReader_ReadTokenData_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ReadTokenData' +type MockReader_ReadTokenData_Call struct { + *mock.Call +} + +// ReadTokenData is a helper method to define mock.On call +// - ctx context.Context +// - msg ccip.EVM2EVMOnRampCCIPSendRequestedWithMeta +// - tokenIndex int +func (_e *MockReader_Expecter) ReadTokenData(ctx interface{}, msg interface{}, tokenIndex interface{}) *MockReader_ReadTokenData_Call { + return &MockReader_ReadTokenData_Call{Call: _e.mock.On("ReadTokenData", ctx, msg, tokenIndex)} +} + +func (_c *MockReader_ReadTokenData_Call) Run(run func(ctx context.Context, msg ccip.EVM2EVMOnRampCCIPSendRequestedWithMeta, tokenIndex int)) *MockReader_ReadTokenData_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(ccip.EVM2EVMOnRampCCIPSendRequestedWithMeta), args[2].(int)) + }) + return _c +} + +func (_c *MockReader_ReadTokenData_Call) Return(tokenData []byte, err error) *MockReader_ReadTokenData_Call { + _c.Call.Return(tokenData, err) + return _c +} + +func (_c *MockReader_ReadTokenData_Call) RunAndReturn(run func(context.Context, ccip.EVM2EVMOnRampCCIPSendRequestedWithMeta, int) ([]byte, error)) *MockReader_ReadTokenData_Call { + _c.Call.Return(run) + return _c +} + +// NewMockReader creates a new instance of MockReader. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewMockReader(t interface { + mock.TestingT + Cleanup(func()) +}) *MockReader { + mock := &MockReader{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/core/services/ocr2/plugins/ccip/tokendata/usdc/usdc.go b/core/services/ocr2/plugins/ccip/tokendata/usdc/usdc.go new file mode 100644 index 00000000000..aaa6086fbc9 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/tokendata/usdc/usdc.go @@ -0,0 +1,339 @@ +package usdc + +import ( + "context" + "encoding/hex" + "encoding/json" + "fmt" + "net/url" + "strconv" + "strings" + "sync" + "time" + + "github.com/pkg/errors" + "golang.org/x/time/rate" + + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + + "github.com/smartcontractkit/chainlink-common/pkg/logger" + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/abihelpers" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipcalc" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/tokendata" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/tokendata/http" +) + +const ( + apiVersion = "v1" + attestationPath = "attestations" + defaultAttestationTimeout = 5 * time.Second + + // defaultCoolDownDurationSec defines the default time to wait after getting rate limited. + // this value is only used if the 429 response does not contain the Retry-After header + defaultCoolDownDuration = 5 * time.Minute + + // maxCoolDownDuration defines the maximum duration we can wait till firing the next request + maxCoolDownDuration = 10 * time.Minute + + // defaultRequestInterval defines the rate in requests per second that the attestation API can be called. + // this is set according to the APIs documentated 10 requests per second rate limit. + defaultRequestInterval = 100 * time.Millisecond + + // APIIntervalRateLimitDisabled is a special value to disable the rate limiting. + APIIntervalRateLimitDisabled = -1 + // APIIntervalRateLimitDefault is a special value to select the default rate limit interval. + APIIntervalRateLimitDefault = 0 +) + +type attestationStatus string + +const ( + attestationStatusSuccess attestationStatus = "complete" + attestationStatusPending attestationStatus = "pending_confirmations" +) + +var ( + ErrUnknownResponse = errors.New("unexpected response from attestation API") +) + +// messageAndAttestation has to match the onchain struct `MessageAndAttestation` in the +// USDC token pool. +type messageAndAttestation struct { + Message []byte + Attestation []byte +} + +func (m messageAndAttestation) AbiString() string { + return ` + [{ + "components": [ + {"name": "message", "type": "bytes"}, + {"name": "attestation", "type": "bytes"} + ], + "type": "tuple" + }]` +} + +func (m messageAndAttestation) Validate() error { + if len(m.Message) == 0 { + return errors.New("message must be non-empty") + } + if len(m.Attestation) == 0 { + return errors.New("attestation must be non-empty") + } + return nil +} + +type TokenDataReader struct { + lggr logger.Logger + usdcReader ccipdata.USDCReader + httpClient http.IHttpClient + attestationApi *url.URL + attestationApiTimeout time.Duration + usdcTokenAddress common.Address + rate *rate.Limiter + + // coolDownUntil defines whether requests are blocked or not. + coolDownUntil time.Time + coolDownMu *sync.RWMutex +} + +type attestationResponse struct { + Status attestationStatus `json:"status"` + Attestation string `json:"attestation"` + Error string `json:"error"` +} + +var _ tokendata.Reader = &TokenDataReader{} + +func NewUSDCTokenDataReader( + lggr logger.Logger, + usdcReader ccipdata.USDCReader, + usdcAttestationApi *url.URL, + usdcAttestationApiTimeoutSeconds int, + usdcTokenAddress common.Address, + requestInterval time.Duration, +) *TokenDataReader { + timeout := time.Duration(usdcAttestationApiTimeoutSeconds) * time.Second + if usdcAttestationApiTimeoutSeconds == 0 { + timeout = defaultAttestationTimeout + } + + if requestInterval == APIIntervalRateLimitDisabled { + requestInterval = 0 + } else if requestInterval == APIIntervalRateLimitDefault { + requestInterval = defaultRequestInterval + } + + return &TokenDataReader{ + lggr: lggr, + usdcReader: usdcReader, + httpClient: http.NewObservedIHttpClient(&http.HttpClient{}), + attestationApi: usdcAttestationApi, + attestationApiTimeout: timeout, + usdcTokenAddress: usdcTokenAddress, + coolDownMu: &sync.RWMutex{}, + rate: rate.NewLimiter(rate.Every(requestInterval), 1), + } +} + +func NewUSDCTokenDataReaderWithHttpClient( + origin TokenDataReader, + httpClient http.IHttpClient, + usdcTokenAddress common.Address, + requestInterval time.Duration, +) *TokenDataReader { + return &TokenDataReader{ + lggr: origin.lggr, + usdcReader: origin.usdcReader, + httpClient: httpClient, + attestationApi: origin.attestationApi, + attestationApiTimeout: origin.attestationApiTimeout, + coolDownMu: origin.coolDownMu, + usdcTokenAddress: usdcTokenAddress, + rate: rate.NewLimiter(rate.Every(requestInterval), 1), + } +} + +// ReadTokenData queries the USDC attestation API to construct a message and +// attestation response. When called back to back, or multiple times +// concurrently, responses are delayed according how the request interval is +// configured. +func (s *TokenDataReader) ReadTokenData(ctx context.Context, msg cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta, tokenIndex int) ([]byte, error) { + if tokenIndex < 0 || tokenIndex >= len(msg.TokenAmounts) { + return nil, fmt.Errorf("token index out of bounds") + } + + if s.inCoolDownPeriod() { + // rate limiting cool-down period, we prevent new requests from being sent + return nil, tokendata.ErrRequestsBlocked + } + + if s.rate != nil { + // Wait blocks until it the attestation API can be called or the + // context is Done. + if waitErr := s.rate.Wait(ctx); waitErr != nil { + return nil, fmt.Errorf("usdc rate limiting error: %w", waitErr) + } + } + + messageBody, err := s.getUSDCMessageBody(ctx, msg, tokenIndex) + if err != nil { + return []byte{}, errors.Wrap(err, "failed getting the USDC message body") + } + + msgID := hexutil.Encode(msg.MessageID[:]) + msgBody := hexutil.Encode(messageBody) + s.lggr.Infow("Calling attestation API", "messageBodyHash", msgBody, "messageID", msgID) + + // The attestation API expects the hash of the message body + attestationResp, err := s.callAttestationApi(ctx, utils.Keccak256Fixed(messageBody)) + if err != nil { + return []byte{}, errors.Wrap(err, "failed calling usdc attestation API ") + } + + s.lggr.Infow("Got response from attestation API", "messageID", msgID, + "attestationStatus", attestationResp.Status, "attestation", attestationResp.Attestation, + "attestationError", attestationResp.Error) + + switch attestationResp.Status { + case attestationStatusSuccess: + // The USDC pool needs a combination of the message body and the attestation + messageAndAttestation, err := encodeMessageAndAttestation(messageBody, attestationResp.Attestation) + if err != nil { + return nil, fmt.Errorf("failed to encode messageAndAttestation : %w", err) + } + return messageAndAttestation, nil + case attestationStatusPending: + return nil, tokendata.ErrNotReady + default: + s.lggr.Errorw("Unexpected response from attestation API", "attestationResp", attestationResp) + return nil, ErrUnknownResponse + } +} + +// encodeMessageAndAttestation encodes the message body and attestation into a single byte array +// that is readable onchain. +func encodeMessageAndAttestation(messageBody []byte, attestation string) ([]byte, error) { + attestationBytes, err := hex.DecodeString(strings.TrimPrefix(attestation, "0x")) + if err != nil { + return nil, fmt.Errorf("failed to decode response attestation: %w", err) + } + + return abihelpers.EncodeAbiStruct[messageAndAttestation](messageAndAttestation{ + Message: messageBody, + Attestation: attestationBytes, + }) +} + +func (s *TokenDataReader) getUSDCMessageBody( + ctx context.Context, + msg cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta, + tokenIndex int, +) ([]byte, error) { + usdcTokenEndOffset, err := s.getUsdcTokenEndOffset(msg, tokenIndex) + if err != nil { + return nil, fmt.Errorf("get usdc token %d end offset: %w", tokenIndex, err) + } + + parsedMsgBody, err := s.usdcReader.GetUSDCMessagePriorToLogIndexInTx(ctx, int64(msg.LogIndex), usdcTokenEndOffset, msg.TxHash) + if err != nil { + return []byte{}, err + } + + s.lggr.Infow("Got USDC message body", "messageBody", hexutil.Encode(parsedMsgBody), "messageID", hexutil.Encode(msg.MessageID[:])) + return parsedMsgBody, nil +} + +func (s *TokenDataReader) getUsdcTokenEndOffset(msg cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta, tokenIndex int) (int, error) { + if tokenIndex >= len(msg.TokenAmounts) || tokenIndex < 0 { + return 0, fmt.Errorf("invalid token index %d for msg with %d tokens", tokenIndex, len(msg.TokenAmounts)) + } + + if msg.TokenAmounts[tokenIndex].Token != ccipcalc.EvmAddrToGeneric(s.usdcTokenAddress) { + return 0, fmt.Errorf("the specified token index %d is not a usdc token", tokenIndex) + } + + usdcTokenEndOffset := 0 + for i := tokenIndex + 1; i < len(msg.TokenAmounts); i++ { + evmTokenAddr, err := ccipcalc.GenericAddrToEvm(msg.TokenAmounts[i].Token) + if err != nil { + continue + } + + if evmTokenAddr == s.usdcTokenAddress { + usdcTokenEndOffset++ + } + } + + return usdcTokenEndOffset, nil +} + +// callAttestationApi calls the USDC attestation API with the given USDC message hash. +// The attestation service rate limit is 10 requests per second. If you exceed 10 requests +// per second, the service blocks all API requests for the next 5 minutes and returns an +// HTTP 429 response. +// +// Documentation: +// +// https://developers.circle.com/stablecoins/reference/getattestation +// https://developers.circle.com/stablecoins/docs/transfer-usdc-on-testnet-from-ethereum-to-avalanche +func (s *TokenDataReader) callAttestationApi(ctx context.Context, usdcMessageHash [32]byte) (attestationResponse, error) { + body, _, headers, err := s.httpClient.Get( + ctx, + fmt.Sprintf("%s/%s/%s/0x%x", s.attestationApi, apiVersion, attestationPath, usdcMessageHash), + s.attestationApiTimeout, + ) + switch { + case errors.Is(err, tokendata.ErrRateLimit): + coolDownDuration := defaultCoolDownDuration + if retryAfterHeader, exists := headers["Retry-After"]; exists && len(retryAfterHeader) > 0 { + if retryAfterSec, errParseInt := strconv.ParseInt(retryAfterHeader[0], 10, 64); errParseInt == nil { + coolDownDuration = time.Duration(retryAfterSec) * time.Second + } + } + s.setCoolDownPeriod(coolDownDuration) + + // Explicitly signal if the API is being rate limited + return attestationResponse{}, tokendata.ErrRateLimit + case err != nil: + return attestationResponse{}, fmt.Errorf("request error: %w", err) + } + + var response attestationResponse + err = json.Unmarshal(body, &response) + if err != nil { + return attestationResponse{}, err + } + if response.Error != "" { + return attestationResponse{}, fmt.Errorf("attestation API error: %s", response.Error) + } + if response.Status == "" { + return attestationResponse{}, fmt.Errorf("invalid attestation response: %s", string(body)) + } + return response, nil +} + +func (s *TokenDataReader) setCoolDownPeriod(d time.Duration) { + s.coolDownMu.Lock() + if d > maxCoolDownDuration { + d = maxCoolDownDuration + } + s.coolDownUntil = time.Now().Add(d) + s.coolDownMu.Unlock() +} + +func (s *TokenDataReader) inCoolDownPeriod() bool { + s.coolDownMu.RLock() + defer s.coolDownMu.RUnlock() + return time.Now().Before(s.coolDownUntil) +} + +func (s *TokenDataReader) Close() error { + return nil +} diff --git a/core/services/ocr2/plugins/ccip/tokendata/usdc/usdc_blackbox_test.go b/core/services/ocr2/plugins/ccip/tokendata/usdc/usdc_blackbox_test.go new file mode 100644 index 00000000000..95b309ff74e --- /dev/null +++ b/core/services/ocr2/plugins/ccip/tokendata/usdc/usdc_blackbox_test.go @@ -0,0 +1,119 @@ +package usdc_test + +import ( + "context" + "encoding/hex" + "encoding/json" + "net/http" + "net/http/httptest" + "net/url" + "testing" + + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/stretchr/testify/mock" + "github.com/stretchr/testify/require" + + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils" + "github.com/smartcontractkit/chainlink/v2/core/logger" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipcalc" + ccipdatamocks "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/mocks" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/tokendata" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/tokendata/usdc" +) + +type attestationResponse struct { + Status string `json:"status"` + Attestation string `json:"attestation"` +} + +func TestUSDCReader_ReadTokenData(t *testing.T) { + tests := []struct { + name string + attestationResponse attestationResponse + expectedError error + }{ + { + name: "status complete", + attestationResponse: attestationResponse{ + Status: "complete", + Attestation: "0x9049623e91719ef2aa63c55f357be2529b0e7122ae552c18aff8db58b4633c4d3920ff03d3a6d1ddf11f06bf64d7fd60d45447ac81f527ba628877dc5ca759651b08ffae25a6d3b1411749765244f0a1c131cbfe04430d687a2e12fd9d2e6dc08e118ad95d94ad832332cf3c4f7a4f3da0baa803b7be024b02db81951c0f0714de1b", + }, + expectedError: nil, + }, + { + name: "status pending", + attestationResponse: attestationResponse{ + Status: "pending_confirmations", + Attestation: "720502893578a89a8a87982982ef781c18b193", + }, + expectedError: tokendata.ErrNotReady, + }, + { + name: "status invalid", + attestationResponse: attestationResponse{ + Status: "invalid", + Attestation: "720502893578a89a8a87982982ef781c18b193", + }, + expectedError: usdc.ErrUnknownResponse, + }, + } + for _, test := range tests { + test := test + t.Run(test.name, func(t *testing.T) { + // Message is the bytes itself from MessageSend(bytes message) + // i.e. ABI parsed. + message := "0x0000000000000001000000020000000000048d71000000000000000000000000eb08f243e5d3fcff26a9e38ae5520a669f4019d000000000000000000000000023a04d5935ed8bc8e3eb78db3541f0abfb001c6e0000000000000000000000006cb3ed9b441eb674b58495c8b3324b59faff5243000000000000000000000000000000005425890298aed601595a70ab815c96711a31bc65000000000000000000000000ab4f961939bfe6a93567cc57c59eed7084ce2131000000000000000000000000000000000000000000000000000000000000271000000000000000000000000035e08285cfed1ef159236728f843286c55fc0861" + expectedMessageAndAttestation := "0x00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000000f80000000000000001000000020000000000048d71000000000000000000000000eb08f243e5d3fcff26a9e38ae5520a669f4019d000000000000000000000000023a04d5935ed8bc8e3eb78db3541f0abfb001c6e0000000000000000000000006cb3ed9b441eb674b58495c8b3324b59faff5243000000000000000000000000000000005425890298aed601595a70ab815c96711a31bc65000000000000000000000000ab4f961939bfe6a93567cc57c59eed7084ce2131000000000000000000000000000000000000000000000000000000000000271000000000000000000000000035e08285cfed1ef159236728f843286c55fc0861000000000000000000000000000000000000000000000000000000000000000000000000000000829049623e91719ef2aa63c55f357be2529b0e7122ae552c18aff8db58b4633c4d3920ff03d3a6d1ddf11f06bf64d7fd60d45447ac81f527ba628877dc5ca759651b08ffae25a6d3b1411749765244f0a1c131cbfe04430d687a2e12fd9d2e6dc08e118ad95d94ad832332cf3c4f7a4f3da0baa803b7be024b02db81951c0f0714de1b000000000000000000000000000000000000000000000000000000000000" + lggr := logger.TestLogger(t) + + ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + messageHash := utils.Keccak256Fixed(hexutil.MustDecode(message)) + expectedUrl := "/v1/attestations/0x" + hex.EncodeToString(messageHash[:]) + require.Equal(t, expectedUrl, r.URL.Path) + + responseBytes, err2 := json.Marshal(test.attestationResponse) + require.NoError(t, err2) + + _, err2 = w.Write(responseBytes) + require.NoError(t, err2) + })) + + defer ts.Close() + + seqNum := uint64(23825) + txHash := utils.RandomBytes32() + logIndex := int64(4) + + usdcReader := ccipdatamocks.USDCReader{} + usdcReader.On("GetUSDCMessagePriorToLogIndexInTx", + mock.Anything, + logIndex, + 0, + common.Hash(txHash).String(), + ).Return(hexutil.MustDecode(message), nil) + attestationURI, err := url.ParseRequestURI(ts.URL) + require.NoError(t, err) + + addr := utils.RandomAddress() + usdcService := usdc.NewUSDCTokenDataReader(lggr, &usdcReader, attestationURI, 0, addr, usdc.APIIntervalRateLimitDisabled) + msgAndAttestation, err := usdcService.ReadTokenData(context.Background(), cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta{ + EVM2EVMMessage: cciptypes.EVM2EVMMessage{ + SequenceNumber: seqNum, + TokenAmounts: []cciptypes.TokenAmount{{Token: ccipcalc.EvmAddrToGeneric(addr), Amount: nil}}, + }, + TxHash: cciptypes.Hash(txHash).String(), + LogIndex: uint(logIndex), + }, 0) + if test.expectedError != nil { + require.Error(t, err) + require.Equal(t, test.expectedError, err) + return + } + require.NoError(t, err) + // Expected attestation for parsed body. + require.Equal(t, expectedMessageAndAttestation, hexutil.Encode(msgAndAttestation)) + }) + } +} diff --git a/core/services/ocr2/plugins/ccip/tokendata/usdc/usdc_test.go b/core/services/ocr2/plugins/ccip/tokendata/usdc/usdc_test.go new file mode 100644 index 00000000000..c4221b2dc0f --- /dev/null +++ b/core/services/ocr2/plugins/ccip/tokendata/usdc/usdc_test.go @@ -0,0 +1,423 @@ +package usdc + +import ( + "context" + "encoding/json" + "math/big" + "math/rand" + "net/http" + "net/http/httptest" + "net/url" + "strings" + "sync" + "testing" + "time" + + "github.com/ethereum/go-ethereum/common" + "github.com/pkg/errors" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + "github.com/stretchr/testify/require" + + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller/mocks" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils" + "github.com/smartcontractkit/chainlink/v2/core/logger" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipcalc" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata" + ccipdatamocks "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/mocks" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/tokendata" +) + +var ( + mockMsgTransmitter = utils.RandomAddress() +) + +func TestUSDCReader_callAttestationApi(t *testing.T) { + t.Skipf("Skipping test because it uses the real USDC attestation API") + usdcMessageHash := "912f22a13e9ccb979b621500f6952b2afd6e75be7eadaed93fc2625fe11c52a2" + attestationURI, err := url.ParseRequestURI("https://iris-api-sandbox.circle.com") + require.NoError(t, err) + lggr := logger.TestLogger(t) + usdcReader, _ := ccipdata.NewUSDCReader(lggr, "job_123", mockMsgTransmitter, nil, false) + usdcService := NewUSDCTokenDataReader(lggr, usdcReader, attestationURI, 0, common.Address{}, APIIntervalRateLimitDisabled) + + attestation, err := usdcService.callAttestationApi(context.Background(), [32]byte(common.FromHex(usdcMessageHash))) + require.NoError(t, err) + + require.Equal(t, attestationStatusPending, attestation.Status) + require.Equal(t, "PENDING", attestation.Attestation) +} + +func TestUSDCReader_callAttestationApiMock(t *testing.T) { + response := attestationResponse{ + Status: attestationStatusSuccess, + Attestation: "720502893578a89a8a87982982ef781c18b193", + } + + ts := getMockUSDCEndpoint(t, response) + defer ts.Close() + attestationURI, err := url.ParseRequestURI(ts.URL) + require.NoError(t, err) + + lggr := logger.TestLogger(t) + lp := mocks.NewLogPoller(t) + usdcReader, _ := ccipdata.NewUSDCReader(lggr, "job_123", mockMsgTransmitter, lp, false) + usdcService := NewUSDCTokenDataReader(lggr, usdcReader, attestationURI, 0, common.Address{}, APIIntervalRateLimitDisabled) + attestation, err := usdcService.callAttestationApi(context.Background(), utils.RandomBytes32()) + require.NoError(t, err) + + require.Equal(t, response.Status, attestation.Status) + require.Equal(t, response.Attestation, attestation.Attestation) +} + +func TestUSDCReader_callAttestationApiMockError(t *testing.T) { + t.Parallel() + + tests := []struct { + name string + getTs func() *httptest.Server + parentTimeoutSeconds int + customTimeoutSeconds int + expectedError error + }{ + { + name: "server error", + getTs: func() *httptest.Server { + return httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusInternalServerError) + })) + }, + parentTimeoutSeconds: 60, + expectedError: nil, + }, + { + name: "default timeout", + getTs: func() *httptest.Server { + response := attestationResponse{ + Status: attestationStatusSuccess, + Attestation: "720502893578a89a8a87982982ef781c18b193", + } + responseBytes, _ := json.Marshal(response) + + return httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + time.Sleep(defaultAttestationTimeout + time.Second) + _, err := w.Write(responseBytes) + require.NoError(t, err) + })) + }, + parentTimeoutSeconds: 60, + expectedError: tokendata.ErrTimeout, + }, + { + name: "custom timeout", + getTs: func() *httptest.Server { + response := attestationResponse{ + Status: attestationStatusSuccess, + Attestation: "720502893578a89a8a87982982ef781c18b193", + } + responseBytes, _ := json.Marshal(response) + + return httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + time.Sleep(2*time.Second + time.Second) + _, err := w.Write(responseBytes) + require.NoError(t, err) + })) + }, + parentTimeoutSeconds: 60, + customTimeoutSeconds: 2, + expectedError: tokendata.ErrTimeout, + }, + { + name: "error response", + getTs: func() *httptest.Server { + response := attestationResponse{ + Error: "some error", + } + responseBytes, _ := json.Marshal(response) + + return httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + _, err := w.Write(responseBytes) + require.NoError(t, err) + })) + }, + parentTimeoutSeconds: 60, + expectedError: nil, + }, + { + name: "invalid status", + getTs: func() *httptest.Server { + response := attestationResponse{ + Status: "", + Attestation: "720502893578a89a8a87982982ef781c18b193", + } + responseBytes, _ := json.Marshal(response) + + return httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + _, err := w.Write(responseBytes) + require.NoError(t, err) + })) + }, + parentTimeoutSeconds: 60, + expectedError: nil, + }, + { + name: "rate limit", + getTs: func() *httptest.Server { + return httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusTooManyRequests) + })) + }, + parentTimeoutSeconds: 60, + expectedError: tokendata.ErrRateLimit, + }, + { + name: "parent context timeout", + getTs: func() *httptest.Server { + return httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + time.Sleep(defaultAttestationTimeout + time.Second) + })) + }, + parentTimeoutSeconds: 1, + expectedError: nil, + }, + } + + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + ts := test.getTs() + defer ts.Close() + + attestationURI, err := url.ParseRequestURI(ts.URL) + require.NoError(t, err) + + lggr := logger.TestLogger(t) + lp := mocks.NewLogPoller(t) + usdcReader, _ := ccipdata.NewUSDCReader(lggr, "job_123", mockMsgTransmitter, lp, false) + usdcService := NewUSDCTokenDataReader(lggr, usdcReader, attestationURI, test.customTimeoutSeconds, common.Address{}, APIIntervalRateLimitDisabled) + lp.On("RegisterFilter", mock.Anything, mock.Anything).Return(nil) + require.NoError(t, usdcReader.RegisterFilters()) + + parentCtx, cancel := context.WithTimeout(context.Background(), time.Duration(test.parentTimeoutSeconds)*time.Second) + defer cancel() + + _, err = usdcService.callAttestationApi(parentCtx, utils.RandomBytes32()) + require.Error(t, err) + + if test.expectedError != nil { + require.True(t, errors.Is(err, test.expectedError)) + } + lp.On("UnregisterFilter", mock.Anything, mock.Anything).Return(nil) + require.NoError(t, usdcReader.Close()) + }) + } +} + +func getMockUSDCEndpoint(t *testing.T, response attestationResponse) *httptest.Server { + responseBytes, err := json.Marshal(response) + require.NoError(t, err) + + return httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + _, err := w.Write(responseBytes) + require.NoError(t, err) + })) +} + +func TestGetUSDCMessageBody(t *testing.T) { + expectedBody := []byte("0x0000000000000001000000020000000000048d71000000000000000000000000eb08f243e5d3fcff26a9e38ae5520a669f4019d000000000000000000000000023a04d5935ed8bc8e3eb78db3541f0abfb001c6e0000000000000000000000006cb3ed9b441eb674b58495c8b3324b59faff5243000000000000000000000000000000005425890298aed601595a70ab815c96711a31bc65000000000000000000000000ab4f961939bfe6a93567cc57c59eed7084ce2131000000000000000000000000000000000000000000000000000000000000271000000000000000000000000035e08285cfed1ef159236728f843286c55fc0861") + usdcReader := ccipdatamocks.USDCReader{} + usdcReader.On("GetUSDCMessagePriorToLogIndexInTx", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(expectedBody, nil) + + usdcTokenAddr := utils.RandomAddress() + lggr := logger.TestLogger(t) + usdcService := NewUSDCTokenDataReader(lggr, &usdcReader, nil, 0, usdcTokenAddr, APIIntervalRateLimitDisabled) + + // Make the first call and assert the underlying function is called + body, err := usdcService.getUSDCMessageBody(context.Background(), cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta{ + EVM2EVMMessage: cciptypes.EVM2EVMMessage{ + TokenAmounts: []cciptypes.TokenAmount{ + { + Token: ccipcalc.EvmAddrToGeneric(usdcTokenAddr), + Amount: big.NewInt(rand.Int63()), + }, + }, + }, + }, 0) + require.NoError(t, err) + require.Equal(t, body, expectedBody) + + usdcReader.AssertNumberOfCalls(t, "GetUSDCMessagePriorToLogIndexInTx", 1) +} + +func TestTokenDataReader_getUsdcTokenEndOffset(t *testing.T) { + usdcToken := utils.RandomAddress() + nonUsdcToken := utils.RandomAddress() + + multipleTokens := []common.Address{ + usdcToken, // 2 + nonUsdcToken, + nonUsdcToken, + usdcToken, // 1 + usdcToken, // 0 + nonUsdcToken, + } + + testCases := []struct { + name string + tokens []common.Address + tokenIndex int + expOffset int + expErr bool + }{ + {name: "one non usdc token", tokens: []common.Address{nonUsdcToken}, tokenIndex: 0, expOffset: 0, expErr: true}, + {name: "one usdc token", tokens: []common.Address{usdcToken}, tokenIndex: 0, expOffset: 0, expErr: false}, + {name: "one usdc token wrong index", tokens: []common.Address{usdcToken}, tokenIndex: 1, expOffset: 0, expErr: true}, + {name: "multiple tokens 1", tokens: multipleTokens, tokenIndex: 0, expOffset: 2}, + {name: "multiple tokens - non usdc selected", tokens: multipleTokens, tokenIndex: 2, expErr: true}, + {name: "multiple tokens 2", tokens: multipleTokens, tokenIndex: 3, expOffset: 1}, + {name: "multiple tokens 3", tokens: multipleTokens, tokenIndex: 4, expOffset: 0}, + {name: "multiple tokens not found", tokens: multipleTokens, tokenIndex: 5, expErr: true}, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + r := &TokenDataReader{usdcTokenAddress: usdcToken} + tokenAmounts := make([]cciptypes.TokenAmount, len(tc.tokens)) + for i := range tokenAmounts { + tokenAmounts[i] = cciptypes.TokenAmount{ + Token: ccipcalc.EvmAddrToGeneric(tc.tokens[i]), + Amount: big.NewInt(rand.Int63()), + } + } + msg := cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta{EVM2EVMMessage: cciptypes.EVM2EVMMessage{TokenAmounts: tokenAmounts}} + offset, err := r.getUsdcTokenEndOffset(msg, tc.tokenIndex) + if tc.expErr { + assert.Error(t, err) + return + } + assert.NoError(t, err) + assert.Equal(t, tc.expOffset, offset) + }) + } +} + +func TestUSDCReader_rateLimiting(t *testing.T) { + testCases := []struct { + name string + requests uint64 + rateConfig time.Duration + testDuration time.Duration + timeout time.Duration + err string + }{ + { + name: "no rate limit when disabled", + requests: 10, + rateConfig: APIIntervalRateLimitDisabled, + testDuration: 1 * time.Millisecond, + }, + { + name: "yes rate limited with default config", + requests: 5, + rateConfig: APIIntervalRateLimitDefault, + testDuration: 4 * defaultRequestInterval, + }, + { + name: "yes rate limited with config", + requests: 10, + rateConfig: 50 * time.Millisecond, + testDuration: 9 * 50 * time.Millisecond, + }, + { + name: "timeout after first request", + requests: 5, + rateConfig: 100 * time.Millisecond, + testDuration: 1 * time.Millisecond, + timeout: 1 * time.Millisecond, + err: "usdc rate limiting error:", + }, + { + name: "timeout after second request", + requests: 5, + rateConfig: 100 * time.Millisecond, + testDuration: 100 * time.Millisecond, + timeout: 150 * time.Millisecond, + err: "usdc rate limiting error:", + }, + } + + for _, tc := range testCases { + tc := tc + t.Run(tc.name, func(t *testing.T) { + t.Parallel() + + response := attestationResponse{ + Status: attestationStatusSuccess, + Attestation: "720502893578a89a8a87982982ef781c18b193", + } + + ts := getMockUSDCEndpoint(t, response) + defer ts.Close() + attestationURI, err := url.ParseRequestURI(ts.URL) + require.NoError(t, err) + + lggr := logger.TestLogger(t) + lp := mocks.NewLogPoller(t) + usdcReader, _ := ccipdata.NewUSDCReader(lggr, "job_123", mockMsgTransmitter, lp, false) + usdcService := NewUSDCTokenDataReader(lggr, usdcReader, attestationURI, 0, utils.RandomAddress(), tc.rateConfig) + + ctx := context.Background() + if tc.timeout > 0 { + var cf context.CancelFunc + ctx, cf = context.WithTimeout(ctx, tc.timeout) + defer cf() + } + + trigger := make(chan struct{}) + errorChan := make(chan error, tc.requests) + wg := sync.WaitGroup{} + for i := 0; i < int(tc.requests); i++ { + wg.Add(1) + go func() { + defer wg.Done() + + <-trigger + _, err := usdcService.ReadTokenData(ctx, cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta{ + EVM2EVMMessage: cciptypes.EVM2EVMMessage{ + TokenAmounts: []cciptypes.TokenAmount{{Token: ccipcalc.EvmAddrToGeneric(utils.ZeroAddress), Amount: nil}}, // trigger failure due to wrong address + }, + }, 0) + + errorChan <- err + }() + } + + // Start the test + start := time.Now() + close(trigger) + + // Wait for requests to complete + wg.Wait() + finish := time.Now() + close(errorChan) + + // Collect errors + errorFound := false + for err := range errorChan { + if tc.err != "" && strings.Contains(err.Error(), tc.err) { + errorFound = true + } else if err != nil && !strings.Contains(err.Error(), "get usdc token 0 end offset") { + // Ignore that one error, it's expected because of how mocking is used. + // Anything else is unexpected. + require.Fail(t, "unexpected error", err) + } + } + + if tc.err != "" { + assert.True(t, errorFound) + } + assert.WithinDuration(t, start.Add(tc.testDuration), finish, 50*time.Millisecond) + }) + } +} diff --git a/core/services/ocr2/plugins/ccip/transactions.rlp b/core/services/ocr2/plugins/ccip/transactions.rlp new file mode 100644 index 00000000000..96cfc2f4823 Binary files /dev/null and b/core/services/ocr2/plugins/ccip/transactions.rlp differ diff --git a/core/services/ocr2/plugins/ccip/transmitter/transmitter.go b/core/services/ocr2/plugins/ccip/transmitter/transmitter.go new file mode 100644 index 00000000000..3e2962b33a9 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/transmitter/transmitter.go @@ -0,0 +1,143 @@ +package transmitter + +import ( + "context" + "fmt" + "math/big" + + "github.com/ethereum/go-ethereum/common" + "github.com/pkg/errors" + + commontypes "github.com/smartcontractkit/chainlink-common/pkg/types" + "github.com/smartcontractkit/chainlink/v2/common/txmgr/types" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/txmgr" + statuschecker "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/statuschecker" +) + +type roundRobinKeystore interface { + GetRoundRobinAddress(ctx context.Context, chainID *big.Int, addresses ...common.Address) (address common.Address, err error) +} + +type txManager interface { + CreateTransaction(ctx context.Context, txRequest txmgr.TxRequest) (tx txmgr.Tx, err error) + GetTransactionStatus(ctx context.Context, transactionID string) (state commontypes.TransactionStatus, err error) +} + +type Transmitter interface { + CreateEthTransaction(ctx context.Context, toAddress common.Address, payload []byte, txMeta *txmgr.TxMeta) error + FromAddress() common.Address +} + +type transmitter struct { + txm txManager + fromAddresses []common.Address + gasLimit uint64 + effectiveTransmitterAddress common.Address + strategy types.TxStrategy + checker txmgr.TransmitCheckerSpec + chainID *big.Int + keystore roundRobinKeystore + statuschecker statuschecker.CCIPTransactionStatusChecker // Used for CCIP's idempotency key generation +} + +// NewTransmitter creates a new eth transmitter +func NewTransmitter( + txm txManager, + fromAddresses []common.Address, + gasLimit uint64, + effectiveTransmitterAddress common.Address, + strategy types.TxStrategy, + checker txmgr.TransmitCheckerSpec, + chainID *big.Int, + keystore roundRobinKeystore, +) (Transmitter, error) { + // Ensure that a keystore is provided. + if keystore == nil { + return nil, errors.New("nil keystore provided to transmitter") + } + + return &transmitter{ + txm: txm, + fromAddresses: fromAddresses, + gasLimit: gasLimit, + effectiveTransmitterAddress: effectiveTransmitterAddress, + strategy: strategy, + checker: checker, + chainID: chainID, + keystore: keystore, + }, nil +} + +func NewTransmitterWithStatusChecker( + txm txManager, + fromAddresses []common.Address, + gasLimit uint64, + effectiveTransmitterAddress common.Address, + strategy types.TxStrategy, + checker txmgr.TransmitCheckerSpec, + chainID *big.Int, + keystore roundRobinKeystore, +) (Transmitter, error) { + t, err := NewTransmitter(txm, fromAddresses, gasLimit, effectiveTransmitterAddress, strategy, checker, chainID, keystore) + + if err != nil { + return nil, err + } + + transmitter, ok := t.(*transmitter) + if !ok { + return nil, errors.New("failed to type assert Transmitter to *transmitter") + } + transmitter.statuschecker = statuschecker.NewTxmStatusChecker(txm.GetTransactionStatus) + + return transmitter, nil +} + +func (t *transmitter) CreateEthTransaction(ctx context.Context, toAddress common.Address, payload []byte, txMeta *txmgr.TxMeta) error { + roundRobinFromAddress, err := t.keystore.GetRoundRobinAddress(ctx, t.chainID, t.fromAddresses...) + if err != nil { + return fmt.Errorf("skipped OCR transmission, error getting round-robin address: %w", err) + } + + var idempotencyKey *string + + // Define idempotency key for CCIP Execution Plugin + if len(txMeta.MessageIDs) == 1 && t.statuschecker != nil { + messageId := txMeta.MessageIDs[0] + _, count, err1 := t.statuschecker.CheckMessageStatus(ctx, messageId) + + if err1 != nil { + return errors.Wrap(err, "skipped OCR transmission, error getting message status") + } + idempotencyKey = func() *string { + s := fmt.Sprintf("%s-%d", messageId, count+1) + return &s + }() + } + + _, err = t.txm.CreateTransaction(ctx, txmgr.TxRequest{ + IdempotencyKey: idempotencyKey, + FromAddress: roundRobinFromAddress, + ToAddress: toAddress, + EncodedPayload: payload, + FeeLimit: t.gasLimit, + ForwarderAddress: t.forwarderAddress(), + Strategy: t.strategy, + Checker: t.checker, + Meta: txMeta, + }) + return errors.Wrap(err, "skipped OCR transmission") +} + +func (t *transmitter) FromAddress() common.Address { + return t.effectiveTransmitterAddress +} + +func (t *transmitter) forwarderAddress() common.Address { + for _, a := range t.fromAddresses { + if a == t.effectiveTransmitterAddress { + return common.Address{} + } + } + return t.effectiveTransmitterAddress +} diff --git a/core/services/ocr2/plugins/ccip/transmitter/transmitter_test.go b/core/services/ocr2/plugins/ccip/transmitter/transmitter_test.go new file mode 100644 index 00000000000..d177f1baa5c --- /dev/null +++ b/core/services/ocr2/plugins/ccip/transmitter/transmitter_test.go @@ -0,0 +1,282 @@ +package transmitter + +import ( + "math/big" + "testing" + + "github.com/ethereum/go-ethereum/common" + "github.com/pkg/errors" + "github.com/stretchr/testify/mock" + "github.com/stretchr/testify/require" + + ubig "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils/big" + + "github.com/smartcontractkit/chainlink-common/pkg/sqlutil" + "github.com/smartcontractkit/chainlink-common/pkg/types" + commontxmmocks "github.com/smartcontractkit/chainlink/v2/common/txmgr/types/mocks" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/txmgr" + txmmocks "github.com/smartcontractkit/chainlink/v2/core/chains/evm/txmgr/mocks" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/pgtest" + "github.com/smartcontractkit/chainlink/v2/core/logger" + "github.com/smartcontractkit/chainlink/v2/core/services/keystore" + "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ethkey" + "github.com/smartcontractkit/chainlink/v2/core/services/ocrcommon" + + "github.com/smartcontractkit/chainlink/v2/core/utils" +) + +var ( + FixtureChainID = *testutils.FixtureChainID + Password = testutils.Password +) + +func newMockTxStrategy(t *testing.T) *commontxmmocks.TxStrategy { + return commontxmmocks.NewTxStrategy(t) +} + +func Test_DefaultTransmitter_CreateEthTransaction(t *testing.T) { + t.Parallel() + + db := pgtest.NewSqlxDB(t) + ethKeyStore := NewKeyStore(t, db).Eth() + + _, fromAddress := MustInsertRandomKey(t, ethKeyStore) + + gasLimit := uint64(1000) + chainID := big.NewInt(0) + effectiveTransmitterAddress := fromAddress + toAddress := testutils.NewAddress() + payload := []byte{1, 2, 3} + txm := txmmocks.NewMockEvmTxManager(t) + strategy := newMockTxStrategy(t) + + transmitter, err := ocrcommon.NewTransmitter( + txm, + []common.Address{fromAddress}, + gasLimit, + effectiveTransmitterAddress, + strategy, + txmgr.TransmitCheckerSpec{}, + chainID, + ethKeyStore, + ) + require.NoError(t, err) + + txm.On("CreateTransaction", mock.Anything, txmgr.TxRequest{ + FromAddress: fromAddress, + ToAddress: toAddress, + EncodedPayload: payload, + FeeLimit: gasLimit, + ForwarderAddress: common.Address{}, + Meta: nil, + Strategy: strategy, + }).Return(txmgr.Tx{}, nil).Once() + require.NoError(t, transmitter.CreateEthTransaction(testutils.Context(t), toAddress, payload, nil)) +} + +func Test_DefaultTransmitter_Forwarding_Enabled_CreateEthTransaction(t *testing.T) { + t.Parallel() + + db := pgtest.NewSqlxDB(t) + ethKeyStore := NewKeyStore(t, db).Eth() + + _, fromAddress := MustInsertRandomKey(t, ethKeyStore) + _, fromAddress2 := MustInsertRandomKey(t, ethKeyStore) + + gasLimit := uint64(1000) + chainID := big.NewInt(0) + effectiveTransmitterAddress := common.Address{} + toAddress := testutils.NewAddress() + payload := []byte{1, 2, 3} + txm := txmmocks.NewMockEvmTxManager(t) + strategy := newMockTxStrategy(t) + + transmitter, err := ocrcommon.NewTransmitter( + txm, + []common.Address{fromAddress, fromAddress2}, + gasLimit, + effectiveTransmitterAddress, + strategy, + txmgr.TransmitCheckerSpec{}, + chainID, + ethKeyStore, + ) + require.NoError(t, err) + + txm.On("CreateTransaction", mock.Anything, txmgr.TxRequest{ + FromAddress: fromAddress, + ToAddress: toAddress, + EncodedPayload: payload, + FeeLimit: gasLimit, + ForwarderAddress: common.Address{}, + Meta: nil, + Strategy: strategy, + }).Return(txmgr.Tx{}, nil).Once() + txm.On("CreateTransaction", mock.Anything, txmgr.TxRequest{ + FromAddress: fromAddress2, + ToAddress: toAddress, + EncodedPayload: payload, + FeeLimit: gasLimit, + ForwarderAddress: common.Address{}, + Meta: nil, + Strategy: strategy, + }).Return(txmgr.Tx{}, nil).Once() + require.NoError(t, transmitter.CreateEthTransaction(testutils.Context(t), toAddress, payload, nil)) + require.NoError(t, transmitter.CreateEthTransaction(testutils.Context(t), toAddress, payload, nil)) +} + +func Test_DefaultTransmitter_Forwarding_Enabled_CreateEthTransaction_Round_Robin_Error(t *testing.T) { + t.Parallel() + + db := pgtest.NewSqlxDB(t) + ethKeyStore := NewKeyStore(t, db).Eth() + + fromAddress := common.Address{} + + gasLimit := uint64(1000) + chainID := big.NewInt(0) + effectiveTransmitterAddress := common.Address{} + toAddress := testutils.NewAddress() + payload := []byte{1, 2, 3} + txm := txmmocks.NewMockEvmTxManager(t) + strategy := newMockTxStrategy(t) + + transmitter, err := ocrcommon.NewTransmitter( + txm, + []common.Address{fromAddress}, + gasLimit, + effectiveTransmitterAddress, + strategy, + txmgr.TransmitCheckerSpec{}, + chainID, + ethKeyStore, + ) + require.NoError(t, err) + require.Error(t, transmitter.CreateEthTransaction(testutils.Context(t), toAddress, payload, nil)) +} + +func Test_DefaultTransmitter_Forwarding_Enabled_CreateEthTransaction_No_Keystore_Error(t *testing.T) { + t.Parallel() + + db := pgtest.NewSqlxDB(t) + ethKeyStore := NewKeyStore(t, db).Eth() + + _, fromAddress := MustInsertRandomKey(t, ethKeyStore) + _, fromAddress2 := MustInsertRandomKey(t, ethKeyStore) + + gasLimit := uint64(1000) + chainID := big.NewInt(0) + effectiveTransmitterAddress := common.Address{} + txm := txmmocks.NewMockEvmTxManager(t) + strategy := newMockTxStrategy(t) + + _, err := ocrcommon.NewTransmitter( + txm, + []common.Address{fromAddress, fromAddress2}, + gasLimit, + effectiveTransmitterAddress, + strategy, + txmgr.TransmitCheckerSpec{}, + chainID, + nil, + ) + require.Error(t, err) +} + +func Test_Transmitter_With_StatusChecker_CreateEthTransaction(t *testing.T) { + t.Parallel() + + db := pgtest.NewSqlxDB(t) + ethKeyStore := NewKeyStore(t, db).Eth() + + _, fromAddress := MustInsertRandomKey(t, ethKeyStore) + + gasLimit := uint64(1000) + chainID := big.NewInt(0) + effectiveTransmitterAddress := fromAddress + txm := txmmocks.NewMockEvmTxManager(t) + strategy := newMockTxStrategy(t) + toAddress := testutils.NewAddress() + payload := []byte{1, 2, 3} + idempotencyKey := "1-0" + txMeta := &txmgr.TxMeta{MessageIDs: []string{"1"}} + + transmitter, err := NewTransmitterWithStatusChecker( + txm, + []common.Address{fromAddress}, + gasLimit, + effectiveTransmitterAddress, + strategy, + txmgr.TransmitCheckerSpec{}, + chainID, + ethKeyStore, + ) + require.NoError(t, err) + + // This case is for when the message ID was not found in the status checker + txm.On("GetTransactionStatus", mock.Anything, idempotencyKey).Return(types.Unknown, errors.New("dummy")).Once() + + txm.On("CreateTransaction", mock.Anything, txmgr.TxRequest{ + IdempotencyKey: &idempotencyKey, + FromAddress: fromAddress, + ToAddress: toAddress, + EncodedPayload: payload, + FeeLimit: gasLimit, + ForwarderAddress: common.Address{}, + Meta: txMeta, + Strategy: strategy, + }).Return(txmgr.Tx{}, nil).Once() + + require.NoError(t, transmitter.CreateEthTransaction(testutils.Context(t), toAddress, payload, txMeta)) + txm.AssertExpectations(t) +} + +func NewKeyStore(t testing.TB, ds sqlutil.DataSource) keystore.Master { + ctx := testutils.Context(t) + keystore := keystore.NewInMemory(ds, utils.FastScryptParams, logger.TestLogger(t)) + require.NoError(t, keystore.Unlock(ctx, Password)) + return keystore +} + +type RandomKey struct { + Nonce int64 + Disabled bool + + chainIDs []ubig.Big // nil: Fixture, set empty for none +} + +func (r RandomKey) MustInsert(t testing.TB, keystore keystore.Eth) (ethkey.KeyV2, common.Address) { + ctx := testutils.Context(t) + chainIDs := r.chainIDs + if chainIDs == nil { + chainIDs = []ubig.Big{*ubig.New(&FixtureChainID)} + } + + key := MustGenerateRandomKey(t) + keystore.XXXTestingOnlyAdd(ctx, key) + + for _, cid := range chainIDs { + require.NoError(t, keystore.Add(ctx, key.Address, cid.ToInt())) + require.NoError(t, keystore.Enable(ctx, key.Address, cid.ToInt())) + if r.Disabled { + require.NoError(t, keystore.Disable(ctx, key.Address, cid.ToInt())) + } + } + + return key, key.Address +} + +func MustInsertRandomKey(t testing.TB, keystore keystore.Eth, chainIDs ...ubig.Big) (ethkey.KeyV2, common.Address) { + r := RandomKey{} + if len(chainIDs) > 0 { + r.chainIDs = chainIDs + } + return r.MustInsert(t, keystore) +} + +func MustGenerateRandomKey(t testing.TB) ethkey.KeyV2 { + key, err := ethkey.NewV2() + require.NoError(t, err) + return key +} diff --git a/core/services/ocr2/plugins/ccip/vars.go b/core/services/ocr2/plugins/ccip/vars.go new file mode 100644 index 00000000000..82309ef7839 --- /dev/null +++ b/core/services/ocr2/plugins/ccip/vars.go @@ -0,0 +1,16 @@ +package ccip + +import ( + "github.com/pkg/errors" +) + +const ( + MaxQueryLength = 0 // empty for both plugins + MaxObservationLength = 250_000 // plugins's Observation should make sure to cap to this limit + CommitPluginLabel = "commit" + ExecPluginLabel = "exec" + DefaultSourceFinalityDepth = uint32(2) + DefaultDestFinalityDepth = uint32(2) +) + +var ErrChainIsNotHealthy = errors.New("lane processing is stopped because of healthcheck failure, please see crit logs") diff --git a/core/services/ocr2/plugins/functions/config/config_types.pb.go b/core/services/ocr2/plugins/functions/config/config_types.pb.go index b9debdcd466..2e749c95e38 100644 --- a/core/services/ocr2/plugins/functions/config/config_types.pb.go +++ b/core/services/ocr2/plugins/functions/config/config_types.pb.go @@ -7,10 +7,11 @@ package config import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" ) const ( diff --git a/core/services/ocr2/plugins/functions/encoding/ocr_types.pb.go b/core/services/ocr2/plugins/functions/encoding/ocr_types.pb.go index 4022076334b..ad60927c3f0 100644 --- a/core/services/ocr2/plugins/functions/encoding/ocr_types.pb.go +++ b/core/services/ocr2/plugins/functions/encoding/ocr_types.pb.go @@ -7,10 +7,11 @@ package encoding import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" ) const ( diff --git a/core/services/ocr2/plugins/functions/integration_tests/v1/internal/testutils.go b/core/services/ocr2/plugins/functions/integration_tests/v1/internal/testutils.go index 3f96b49cfe0..104e9f4da61 100644 --- a/core/services/ocr2/plugins/functions/integration_tests/v1/internal/testutils.go +++ b/core/services/ocr2/plugins/functions/integration_tests/v1/internal/testutils.go @@ -29,6 +29,7 @@ import ( ocrtypes2 "github.com/smartcontractkit/libocr/offchainreporting2plus/types" commonconfig "github.com/smartcontractkit/chainlink-common/pkg/config" + "github.com/smartcontractkit/chainlink/v2/core/bridges" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils" @@ -39,7 +40,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/link_token_interface" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/mock_v3_aggregator_contract" "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" - "github.com/smartcontractkit/chainlink/v2/core/internal/cltest/heavyweight" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" "github.com/smartcontractkit/chainlink/v2/core/services/functions" @@ -50,6 +50,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/validate" "github.com/smartcontractkit/chainlink/v2/core/services/ocrbootstrap" "github.com/smartcontractkit/chainlink/v2/core/store/models" + "github.com/smartcontractkit/chainlink/v2/core/utils/testutils/heavyweight" ) var nilOpts *bind.CallOpts @@ -217,7 +218,9 @@ func StartNewChainWithContracts(t *testing.T, nClients int) (*bind.TransactOpts, } var initialAllowedSenders []common.Address var initialBlockedSenders []common.Address - allowListAddress, _, allowListContract, err := functions_allow_list.DeployTermsOfServiceAllowList(owner, b, allowListConfig, initialAllowedSenders, initialBlockedSenders) + // The allowlist requires a pointer to the previous allowlist. If none exists, use the null address. + var nullPreviousAllowlist common.Address + allowListAddress, _, allowListContract, err := functions_allow_list.DeployTermsOfServiceAllowList(owner, b, allowListConfig, initialAllowedSenders, initialBlockedSenders, nullPreviousAllowlist) require.NoError(t, err) // Deploy Coordinator contract (matches updateConfig() in FunctionsBilling.sol) @@ -234,6 +237,7 @@ func StartNewChainWithContracts(t *testing.T, nClients int) (*bind.TransactOpts, OperationFeeCentsUsd: uint16(0), FallbackUsdPerUnitLink: uint64(1_400_000_000), FallbackUsdPerUnitLinkDecimals: uint8(8), + TransmitTxSizeBytes: uint16(1764), } require.NoError(t, err) coordinatorAddress, _, coordinatorContract, err := functions_coordinator.DeployFunctionsCoordinator(owner, b, routerAddress, coordinatorConfig, linkEthFeedAddr, linkUsdFeedAddr) diff --git a/core/services/ocr2/plugins/functions/plugin.go b/core/services/ocr2/plugins/functions/plugin.go index d6ffa1a3f06..b36d3e37dbc 100644 --- a/core/services/ocr2/plugins/functions/plugin.go +++ b/core/services/ocr2/plugins/functions/plugin.go @@ -23,6 +23,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/functions" "github.com/smartcontractkit/chainlink/v2/core/services/gateway/connector" hc "github.com/smartcontractkit/chainlink/v2/core/services/gateway/handlers/common" + hf "github.com/smartcontractkit/chainlink/v2/core/services/gateway/handlers/functions" gwAllowlist "github.com/smartcontractkit/chainlink/v2/core/services/gateway/handlers/functions/allowlist" gwSubscriptions "github.com/smartcontractkit/chainlink/v2/core/services/gateway/handlers/functions/subscriptions" "github.com/smartcontractkit/chainlink/v2/core/services/job" @@ -174,11 +175,12 @@ func NewFunctionsServices(ctx context.Context, functionsOracleArgs, thresholdOra return nil, errors.Wrap(err, "failed to create a OnchainSubscriptions") } connectorLogger := conf.Logger.Named("GatewayConnector").With("jobName", conf.Job.PipelineSpec.JobName) - connector, err2 := NewConnector(ctx, &pluginConfig, conf.EthKeystore, conf.Chain.ID(), s4Storage, allowlist, rateLimiter, subscriptions, functionsListener, offchainTransmitter, connectorLogger) + connector, handler, err2 := NewConnector(ctx, &pluginConfig, conf.EthKeystore, conf.Chain.ID(), s4Storage, allowlist, rateLimiter, subscriptions, functionsListener, offchainTransmitter, connectorLogger) if err2 != nil { return nil, errors.Wrap(err, "failed to create a GatewayConnector") } allServices = append(allServices, connector) + allServices = append(allServices, handler) } else { listenerLogger.Warn("Insufficient config, GatewayConnector will not be enabled") } @@ -201,29 +203,34 @@ func NewFunctionsServices(ctx context.Context, functionsOracleArgs, thresholdOra return allServices, nil } -func NewConnector(ctx context.Context, pluginConfig *config.PluginConfig, ethKeystore keystore.Eth, chainID *big.Int, s4Storage s4.Storage, allowlist gwAllowlist.OnchainAllowlist, rateLimiter *hc.RateLimiter, subscriptions gwSubscriptions.OnchainSubscriptions, listener functions.FunctionsListener, offchainTransmitter functions.OffchainTransmitter, lggr logger.Logger) (connector.GatewayConnector, error) { +func NewConnector(ctx context.Context, pluginConfig *config.PluginConfig, ethKeystore keystore.Eth, chainID *big.Int, s4Storage s4.Storage, allowlist gwAllowlist.OnchainAllowlist, rateLimiter *hc.RateLimiter, subscriptions gwSubscriptions.OnchainSubscriptions, listener functions.FunctionsListener, offchainTransmitter functions.OffchainTransmitter, lggr logger.Logger) (connector.GatewayConnector, connector.GatewayConnectorHandler, error) { enabledKeys, err := ethKeystore.EnabledKeysForChain(ctx, chainID) if err != nil { - return nil, err + return nil, nil, err } configuredNodeAddress := common.HexToAddress(pluginConfig.GatewayConnectorConfig.NodeAddress) idx := slices.IndexFunc(enabledKeys, func(key ethkey.KeyV2) bool { return key.Address == configuredNodeAddress }) if idx == -1 { - return nil, errors.New("key for configured node address not found") + return nil, nil, errors.New("key for configured node address not found") } signerKey := enabledKeys[idx].ToEcdsaPrivKey() if enabledKeys[idx].ID() != pluginConfig.GatewayConnectorConfig.NodeAddress { - return nil, errors.New("node address mismatch") + return nil, nil, errors.New("node address mismatch") } handler, err := functions.NewFunctionsConnectorHandler(pluginConfig, signerKey, s4Storage, allowlist, rateLimiter, subscriptions, listener, offchainTransmitter, lggr) if err != nil { - return nil, err + return nil, nil, err } - connector, err := connector.NewGatewayConnector(pluginConfig.GatewayConnectorConfig, handler, handler, clockwork.NewRealClock(), lggr) + // handler acts as a signer here + connector, err := connector.NewGatewayConnector(pluginConfig.GatewayConnectorConfig, handler, clockwork.NewRealClock(), lggr) if err != nil { - return nil, err + return nil, nil, err + } + err = connector.AddHandler([]string{hf.MethodSecretsSet, hf.MethodSecretsList, hf.MethodHeartbeat}, handler) + if err != nil { + return nil, nil, err } handler.SetConnector(connector) - return connector, nil + return connector, handler, nil } diff --git a/core/services/ocr2/plugins/functions/plugin_test.go b/core/services/ocr2/plugins/functions/plugin_test.go index fdd20b0a932..b3a120894d0 100644 --- a/core/services/ocr2/plugins/functions/plugin_test.go +++ b/core/services/ocr2/plugins/functions/plugin_test.go @@ -47,7 +47,7 @@ func TestNewConnector_Success(t *testing.T) { config := &config.PluginConfig{ GatewayConnectorConfig: gwcCfg, } - _, err = functions.NewConnector(ctx, config, ethKeystore, chainID, s4Storage, allowlist, rateLimiter, subscriptions, listener, offchainTransmitter, logger.TestLogger(t)) + _, _, err = functions.NewConnector(ctx, config, ethKeystore, chainID, s4Storage, allowlist, rateLimiter, subscriptions, listener, offchainTransmitter, logger.TestLogger(t)) require.NoError(t, err) } @@ -78,6 +78,6 @@ func TestNewConnector_NoKeyForConfiguredAddress(t *testing.T) { config := &config.PluginConfig{ GatewayConnectorConfig: gwcCfg, } - _, err = functions.NewConnector(ctx, config, ethKeystore, chainID, s4Storage, allowlist, rateLimiter, subscriptions, listener, offchainTransmitter, logger.TestLogger(t)) + _, _, err = functions.NewConnector(ctx, config, ethKeystore, chainID, s4Storage, allowlist, rateLimiter, subscriptions, listener, offchainTransmitter, logger.TestLogger(t)) require.Error(t, err) } diff --git a/core/services/ocr2/plugins/generic/pipeline_runner_adapter.go b/core/services/ocr2/plugins/generic/pipeline_runner_adapter.go index 22217b83660..994f043ebca 100644 --- a/core/services/ocr2/plugins/generic/pipeline_runner_adapter.go +++ b/core/services/ocr2/plugins/generic/pipeline_runner_adapter.go @@ -15,7 +15,7 @@ import ( var _ core.PipelineRunnerService = (*PipelineRunnerAdapter)(nil) type pipelineRunner interface { - ExecuteAndInsertFinishedRun(ctx context.Context, spec pipeline.Spec, vars pipeline.Vars, l logger.Logger, saveSuccessfulTaskRuns bool) (runID int64, results pipeline.TaskRunResults, err error) + ExecuteAndInsertFinishedRun(ctx context.Context, spec pipeline.Spec, vars pipeline.Vars, saveSuccessfulTaskRuns bool) (runID int64, results pipeline.TaskRunResults, err error) } type PipelineRunnerAdapter struct { @@ -45,7 +45,7 @@ func (p *PipelineRunnerAdapter) ExecuteRun(ctx context.Context, spec string, var merge(defaultVars, vars.Vars) finalVars := pipeline.NewVarsFrom(defaultVars) - _, trrs, err := p.runner.ExecuteAndInsertFinishedRun(ctx, s, finalVars, p.logger, true) + _, trrs, err := p.runner.ExecuteAndInsertFinishedRun(ctx, s, finalVars, true) if err != nil { return nil, err } diff --git a/core/services/ocr2/plugins/generic/pipeline_runner_adapter_test.go b/core/services/ocr2/plugins/generic/pipeline_runner_adapter_test.go index a33ab2a1bd2..f9c51cfb660 100644 --- a/core/services/ocr2/plugins/generic/pipeline_runner_adapter_test.go +++ b/core/services/ocr2/plugins/generic/pipeline_runner_adapter_test.go @@ -97,7 +97,7 @@ type mockPipelineRunner struct { vars pipeline.Vars } -func (m *mockPipelineRunner) ExecuteAndInsertFinishedRun(ctx context.Context, spec pipeline.Spec, vars pipeline.Vars, l logger.Logger, saveSuccessfulTaskRuns bool) (runID int64, results pipeline.TaskRunResults, err error) { +func (m *mockPipelineRunner) ExecuteAndInsertFinishedRun(ctx context.Context, spec pipeline.Spec, vars pipeline.Vars, saveSuccessfulTaskRuns bool) (runID int64, results pipeline.TaskRunResults, err error) { m.spec = spec m.vars = vars // We never attach a run to the mock, so we can't return a runID diff --git a/core/services/ocr2/plugins/generic/relayerset_test.go b/core/services/ocr2/plugins/generic/relayerset_test.go index b5eb16682de..44ed216520f 100644 --- a/core/services/ocr2/plugins/generic/relayerset_test.go +++ b/core/services/ocr2/plugins/generic/relayerset_test.go @@ -158,6 +158,10 @@ func (t *TestRelayer) NewContractReader(_ context.Context, _ []byte) (types.Cont panic("implement me") } +func (t *TestRelayer) LatestHead(_ context.Context) (types.Head, error) { + panic("implement me") +} + func (t *TestRelayer) GetChainStatus(ctx context.Context) (types.ChainStatus, error) { panic("implement me") } diff --git a/core/services/ocr2/plugins/llo/config/config.go b/core/services/ocr2/plugins/llo/config/config.go index 892229c46c8..7bd36b4ff8b 100644 --- a/core/services/ocr2/plugins/llo/config/config.go +++ b/core/services/ocr2/plugins/llo/config/config.go @@ -9,19 +9,18 @@ import ( "fmt" "net/url" "regexp" + "sort" "github.com/ethereum/go-ethereum/common" llotypes "github.com/smartcontractkit/chainlink-common/pkg/types/llo" "github.com/smartcontractkit/chainlink/v2/core/services/keystore/chaintype" + mercuryconfig "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/mercury/config" "github.com/smartcontractkit/chainlink/v2/core/utils" ) type PluginConfig struct { - RawServerURL string `json:"serverURL" toml:"serverURL"` - ServerPubKey utils.PlainHexBytes `json:"serverPubKey" toml:"serverPubKey"` - ChannelDefinitionsContractAddress common.Address `json:"channelDefinitionsContractAddress" toml:"channelDefinitionsContractAddress"` ChannelDefinitionsContractFromBlock int64 `json:"channelDefinitionsContractFromBlock" toml:"channelDefinitionsContractFromBlock"` @@ -39,27 +38,42 @@ type PluginConfig struct { // KeyBundleIDs maps supported keys to their respective bundle IDs // Key must match llo's ReportFormat KeyBundleIDs map[string]string `json:"keyBundleIDs" toml:"keyBundleIDs"` + + DonID uint32 `json:"donID" toml:"donID"` + + // Mercury servers + Servers map[string]utils.PlainHexBytes `json:"servers" toml:"servers"` } func (p *PluginConfig) Unmarshal(data []byte) error { return json.Unmarshal(data, p) } +func (p PluginConfig) GetServers() (servers []mercuryconfig.Server) { + for url, pubKey := range p.Servers { + servers = append(servers, mercuryconfig.Server{URL: wssRegexp.ReplaceAllString(url, ""), PubKey: pubKey}) + } + sort.Slice(servers, func(i, j int) bool { + return servers[i].URL < servers[j].URL + }) + return +} + func (p PluginConfig) Validate() (merr error) { - if p.RawServerURL == "" { - merr = errors.New("llo: ServerURL must be specified") + if p.DonID == 0 { + merr = errors.Join(merr, errors.New("llo: DonID must be specified and not zero")) + } + + if len(p.Servers) == 0 { + merr = errors.Join(merr, errors.New("llo: At least one Mercury server must be specified")) } else { - var normalizedURI string - if schemeRegexp.MatchString(p.RawServerURL) { - normalizedURI = p.RawServerURL - } else { - normalizedURI = fmt.Sprintf("wss://%s", p.RawServerURL) - } - uri, err := url.ParseRequestURI(normalizedURI) - if err != nil { - merr = fmt.Errorf("llo: invalid value for ServerURL: %w", err) - } else if uri.Scheme != "wss" { - merr = fmt.Errorf(`llo: invalid scheme specified for MercuryServer, got: %q (scheme: %q) but expected a websocket url e.g. "192.0.2.2:4242" or "wss://192.0.2.2:4242"`, p.RawServerURL, uri.Scheme) + for serverName, serverPubKey := range p.Servers { + if err := validateURL(serverName); err != nil { + merr = errors.Join(merr, fmt.Errorf("llo: invalid value for ServerURL: %w", err)) + } + if len(serverPubKey) != 32 { + merr = errors.Join(merr, errors.New("llo: ServerPubKey must be a 32-byte hex string")) + } } } @@ -74,21 +88,36 @@ func (p PluginConfig) Validate() (merr error) { if err := json.Unmarshal([]byte(p.ChannelDefinitions), &cd); err != nil { merr = errors.Join(merr, fmt.Errorf("channelDefinitions is invalid JSON: %w", err)) } + // TODO: Verify Opts format here? + // MERC-3524 } else { if p.ChannelDefinitionsContractAddress == (common.Address{}) { merr = errors.Join(merr, errors.New("llo: ChannelDefinitionsContractAddress is required if ChannelDefinitions is not specified")) } } - if len(p.ServerPubKey) != 32 { - merr = errors.Join(merr, errors.New("llo: ServerPubKey is required and must be a 32-byte hex string")) - } - merr = errors.Join(merr, validateKeyBundleIDs(p.KeyBundleIDs)) return merr } +func validateURL(rawServerURL string) error { + var normalizedURI string + if schemeRegexp.MatchString(rawServerURL) { + normalizedURI = rawServerURL + } else { + normalizedURI = fmt.Sprintf("wss://%s", rawServerURL) + } + uri, err := url.ParseRequestURI(normalizedURI) + if err != nil { + return fmt.Errorf(`llo: invalid value for ServerURL, got: %q`, rawServerURL) + } + if uri.Scheme != "wss" { + return fmt.Errorf(`llo: invalid scheme specified for MercuryServer, got: %q (scheme: %q) but expected a websocket url e.g. "192.0.2.2:4242" or "wss://192.0.2.2:4242"`, rawServerURL, uri.Scheme) + } + return nil +} + func validateKeyBundleIDs(keyBundleIDs map[string]string) error { for k, v := range keyBundleIDs { if k == "" { @@ -109,7 +138,3 @@ func validateKeyBundleIDs(keyBundleIDs map[string]string) error { var schemeRegexp = regexp.MustCompile(`^[a-zA-Z][a-zA-Z0-9+.-]*://`) var wssRegexp = regexp.MustCompile(`^wss://`) - -func (p PluginConfig) ServerURL() string { - return wssRegexp.ReplaceAllString(p.RawServerURL, "") -} diff --git a/core/services/ocr2/plugins/llo/config/config_test.go b/core/services/ocr2/plugins/llo/config/config_test.go index 136fac87a56..096543b2524 100644 --- a/core/services/ocr2/plugins/llo/config/config_test.go +++ b/core/services/ocr2/plugins/llo/config/config_test.go @@ -7,6 +7,8 @@ import ( "github.com/pelletier/go-toml/v2" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + + "github.com/smartcontractkit/chainlink/v2/core/utils" ) func Test_Config(t *testing.T) { @@ -31,8 +33,7 @@ func Test_Config(t *testing.T) { t.Run("with all possible values set", func(t *testing.T) { rawToml := fmt.Sprintf(` - ServerURL = "example.com:80" - ServerPubKey = "724ff6eae9e900270edfff233e16322a70ec06e1a6e62a81ef13921f398f6c93" + Servers = { "example.com:80" = "724ff6eae9e900270edfff233e16322a70ec06e1a6e62a81ef13921f398f6c93", "example2.invalid:1234" = "524ff6eae9e900270edfff233e16322a70ec06e1a6e62a81ef13921f398f6c93" } BenchmarkMode = true ChannelDefinitionsContractAddress = "0xdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef" ChannelDefinitionsContractFromBlock = 1234 @@ -44,8 +45,8 @@ func Test_Config(t *testing.T) { err := toml.Unmarshal([]byte(rawToml), &mc) require.NoError(t, err) - assert.Equal(t, "example.com:80", mc.RawServerURL) - assert.Equal(t, "724ff6eae9e900270edfff233e16322a70ec06e1a6e62a81ef13921f398f6c93", mc.ServerPubKey.String()) + assert.Len(t, mc.Servers, 2) + assert.Equal(t, map[string]utils.PlainHexBytes{"example.com:80": utils.PlainHexBytes{0x72, 0x4f, 0xf6, 0xea, 0xe9, 0xe9, 0x0, 0x27, 0xe, 0xdf, 0xff, 0x23, 0x3e, 0x16, 0x32, 0x2a, 0x70, 0xec, 0x6, 0xe1, 0xa6, 0xe6, 0x2a, 0x81, 0xef, 0x13, 0x92, 0x1f, 0x39, 0x8f, 0x6c, 0x93}, "example2.invalid:1234": utils.PlainHexBytes{0x52, 0x4f, 0xf6, 0xea, 0xe9, 0xe9, 0x0, 0x27, 0xe, 0xdf, 0xff, 0x23, 0x3e, 0x16, 0x32, 0x2a, 0x70, 0xec, 0x6, 0xe1, 0xa6, 0xe6, 0x2a, 0x81, 0xef, 0x13, 0x92, 0x1f, 0x39, 0x8f, 0x6c, 0x93}}, mc.Servers) assert.Equal(t, "0xDeaDbeefdEAdbeefdEadbEEFdeadbeEFdEaDbeeF", mc.ChannelDefinitionsContractAddress.Hex()) assert.Equal(t, int64(1234), mc.ChannelDefinitionsContractFromBlock) assert.JSONEq(t, cdjson, mc.ChannelDefinitions) @@ -60,8 +61,8 @@ func Test_Config(t *testing.T) { t.Run("with only channelDefinitions", func(t *testing.T) { rawToml := fmt.Sprintf(` - ServerURL = "example.com:80" - ServerPubKey = "724ff6eae9e900270edfff233e16322a70ec06e1a6e62a81ef13921f398f6c93" + Servers = { "example.com:80" = "724ff6eae9e900270edfff233e16322a70ec06e1a6e62a81ef13921f398f6c93" } + DonID = 12345 ChannelDefinitions = """ %s """`, cdjson) @@ -70,9 +71,9 @@ func Test_Config(t *testing.T) { err := toml.Unmarshal([]byte(rawToml), &mc) require.NoError(t, err) - assert.Equal(t, "example.com:80", mc.RawServerURL) - assert.Equal(t, "724ff6eae9e900270edfff233e16322a70ec06e1a6e62a81ef13921f398f6c93", mc.ServerPubKey.String()) + assert.Len(t, mc.Servers, 1) assert.JSONEq(t, cdjson, mc.ChannelDefinitions) + assert.Equal(t, uint32(12345), mc.DonID) assert.False(t, mc.BenchmarkMode) err = mc.Validate() @@ -80,17 +81,17 @@ func Test_Config(t *testing.T) { }) t.Run("with only channelDefinitions contract details", func(t *testing.T) { rawToml := ` - ServerURL = "example.com:80" - ServerPubKey = "724ff6eae9e900270edfff233e16322a70ec06e1a6e62a81ef13921f398f6c93" + Servers = { "example.com:80" = "724ff6eae9e900270edfff233e16322a70ec06e1a6e62a81ef13921f398f6c93" } + DonID = 12345 ChannelDefinitionsContractAddress = "0xdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef"` var mc PluginConfig err := toml.Unmarshal([]byte(rawToml), &mc) require.NoError(t, err) - assert.Equal(t, "example.com:80", mc.RawServerURL) - assert.Equal(t, "724ff6eae9e900270edfff233e16322a70ec06e1a6e62a81ef13921f398f6c93", mc.ServerPubKey.String()) + assert.Len(t, mc.Servers, 1) assert.Equal(t, "0xDeaDbeefdEAdbeefdEadbEEFdeadbeEFdEaDbeeF", mc.ChannelDefinitionsContractAddress.Hex()) + assert.Equal(t, uint32(12345), mc.DonID) assert.False(t, mc.BenchmarkMode) err = mc.Validate() @@ -98,15 +99,16 @@ func Test_Config(t *testing.T) { }) t.Run("with missing ChannelDefinitionsContractAddress", func(t *testing.T) { rawToml := ` - ServerURL = "example.com:80" - ServerPubKey = "724ff6eae9e900270edfff233e16322a70ec06e1a6e62a81ef13921f398f6c93"` + DonID = 12345 + Servers = { "example.com:80" = "724ff6eae9e900270edfff233e16322a70ec06e1a6e62a81ef13921f398f6c93" } + ` var mc PluginConfig err := toml.Unmarshal([]byte(rawToml), &mc) require.NoError(t, err) - assert.Equal(t, "example.com:80", mc.RawServerURL) - assert.Equal(t, "724ff6eae9e900270edfff233e16322a70ec06e1a6e62a81ef13921f398f6c93", mc.ServerPubKey.String()) + assert.Len(t, mc.Servers, 1) + assert.Equal(t, uint32(12345), mc.DonID) assert.False(t, mc.BenchmarkMode) err = mc.Validate() @@ -135,8 +137,39 @@ func Test_Config(t *testing.T) { err = mc.Validate() require.Error(t, err) - assert.Contains(t, err.Error(), `invalid scheme specified for MercuryServer, got: "http://example.com" (scheme: "http") but expected a websocket url e.g. "192.0.2.2:4242" or "wss://192.0.2.2:4242"`) - assert.Contains(t, err.Error(), `ServerPubKey is required and must be a 32-byte hex string`) + assert.Contains(t, err.Error(), `DonID must be specified and not zero`) + assert.Contains(t, err.Error(), `At least one Mercury server must be specified`) + assert.Contains(t, err.Error(), `ChannelDefinitionsContractAddress is required if ChannelDefinitions is not specified`) }) }) } + +func Test_PluginConfig_Validate(t *testing.T) { + t.Run("with invalid URLs or keys", func(t *testing.T) { + servers := map[string]utils.PlainHexBytes{ + "not a valid url": utils.PlainHexBytes([]byte{1, 2, 3}), + "mercuryserver.invalid:1234/foo": nil, + } + pc := PluginConfig{Servers: servers} + + err := pc.Validate() + assert.Contains(t, err.Error(), "ServerPubKey must be a 32-byte hex string") + assert.Contains(t, err.Error(), "invalid value for ServerURL: llo: invalid value for ServerURL, got: \"not a valid url\"") + }) +} + +func Test_PluginConfig_GetServers(t *testing.T) { + t.Run("with multiple servers", func(t *testing.T) { + servers := map[string]utils.PlainHexBytes{ + "example.com:80": utils.PlainHexBytes([]byte{1, 2, 3}), + "mercuryserver.invalid:1234/foo": utils.PlainHexBytes([]byte{4, 5, 6}), + } + pc := PluginConfig{Servers: servers} + + require.Len(t, pc.GetServers(), 2) + assert.Equal(t, "example.com:80", pc.GetServers()[0].URL) + assert.Equal(t, utils.PlainHexBytes{1, 2, 3}, pc.GetServers()[0].PubKey) + assert.Equal(t, "mercuryserver.invalid:1234/foo", pc.GetServers()[1].URL) + assert.Equal(t, utils.PlainHexBytes{4, 5, 6}, pc.GetServers()[1].PubKey) + }) +} diff --git a/core/services/ocr2/plugins/llo/helpers_test.go b/core/services/ocr2/plugins/llo/helpers_test.go index b993ec6dadc..bd73dcccfc8 100644 --- a/core/services/ocr2/plugins/llo/helpers_test.go +++ b/core/services/ocr2/plugins/llo/helpers_test.go @@ -26,15 +26,12 @@ import ( "github.com/smartcontractkit/wsrpc/credentials" "github.com/smartcontractkit/wsrpc/peer" - "github.com/smartcontractkit/libocr/offchainreporting2/chains/evmutil" ocr2types "github.com/smartcontractkit/libocr/offchainreporting2plus/types" - ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" commonconfig "github.com/smartcontractkit/chainlink-common/pkg/config" "github.com/smartcontractkit/chainlink/v2/core/bridges" "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" - "github.com/smartcontractkit/chainlink/v2/core/internal/cltest/heavyweight" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/keystest" "github.com/smartcontractkit/chainlink/v2/core/logger" @@ -45,10 +42,10 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/validate" "github.com/smartcontractkit/chainlink/v2/core/services/ocrbootstrap" - "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury" "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury/wsrpc/pb" "github.com/smartcontractkit/chainlink/v2/core/services/streams" "github.com/smartcontractkit/chainlink/v2/core/store/models" + "github.com/smartcontractkit/chainlink/v2/core/utils/testutils/heavyweight" ) var _ pb.MercuryServer = &mercuryServer{} @@ -63,14 +60,13 @@ func (r request) TransmitterID() ocr2types.Account { } type mercuryServer struct { - privKey ed25519.PrivateKey - reqsCh chan request - t *testing.T - buildReport func() []byte + privKey ed25519.PrivateKey + reqsCh chan request + t *testing.T } -func NewMercuryServer(t *testing.T, privKey ed25519.PrivateKey, reqsCh chan request, buildReport func() []byte) *mercuryServer { - return &mercuryServer{privKey, reqsCh, t, buildReport} +func NewMercuryServer(t *testing.T, privKey ed25519.PrivateKey, reqsCh chan request) *mercuryServer { + return &mercuryServer{privKey, reqsCh, t} } func (s *mercuryServer) Transmit(ctx context.Context, req *pb.TransmitRequest) (*pb.TransmitResponse, error) { @@ -88,23 +84,7 @@ func (s *mercuryServer) Transmit(ctx context.Context, req *pb.TransmitRequest) ( } func (s *mercuryServer) LatestReport(ctx context.Context, lrr *pb.LatestReportRequest) (*pb.LatestReportResponse, error) { - p, ok := peer.FromContext(ctx) - if !ok { - return nil, errors.New("could not extract public key") - } - s.t.Logf("mercury server got latest report from %x for feed id 0x%x", p.PublicKey, lrr.FeedId) - - out := new(pb.LatestReportResponse) - out.Report = new(pb.Report) - out.Report.FeedId = lrr.FeedId - - report := s.buildReport() - payload, err := mercury.PayloadTypes.Pack(evmutil.RawReportContext(ocrtypes.ReportContext{}), report, [][32]byte{}, [][32]byte{}, [32]byte{}) - if err != nil { - require.NoError(s.t, err) - } - out.Report.Payload = payload - return out, nil + panic("should not be called") } func startMercuryServer(t *testing.T, srv *mercuryServer, pubKeys []ed25519.PublicKey) (serverURL string) { @@ -114,7 +94,7 @@ func startMercuryServer(t *testing.T, srv *mercuryServer, pubKeys []ed25519.Publ t.Fatalf("[MAIN] failed to listen: %v", err) } serverURL = lis.Addr().String() - s := wsrpc.NewServer(wsrpc.Creds(srv.privKey, pubKeys)) + s := wsrpc.NewServer(wsrpc.WithCreds(srv.privKey, pubKeys)) // Register mercury implementation with the wsrpc server pb.RegisterMercuryServer(s, srv) @@ -133,11 +113,17 @@ type Node struct { ObservedLogs *observer.ObservedLogs } -func (node *Node) AddStreamJob(t *testing.T, spec string) { +func (node *Node) AddStreamJob(t *testing.T, spec string) (id int32) { job, err := streams.ValidatedStreamSpec(spec) require.NoError(t, err) err = node.App.AddJobV2(testutils.Context(t), &job) require.NoError(t, err) + return job.ID +} + +func (node *Node) DeleteJob(t *testing.T, id int32) { + err := node.App.DeleteJob(testutils.Context(t), id) + require.NoError(t, err) } func (node *Node) AddLLOJob(t *testing.T, spec string) { @@ -172,6 +158,7 @@ func setupNode( config, _ := heavyweight.FullTestDBV2(t, func(c *chainlink.Config, s *chainlink.Secrets) { // [JobPipeline] c.JobPipeline.MaxSuccessfulRuns = ptr(uint64(0)) + c.JobPipeline.VerboseLogging = ptr(true) // [Feature] c.Feature.UICSAKeys = ptr(true) @@ -183,7 +170,7 @@ func setupNode( // [OCR2] c.OCR2.Enabled = ptr(true) - c.OCR2.ContractPollInterval = commonconfig.MustNewDuration(1 * time.Second) + c.OCR2.ContractPollInterval = commonconfig.MustNewDuration(100 * time.Millisecond) // [P2P] c.P2P.PeerID = ptr(p2pKey.PeerID()) @@ -195,6 +182,9 @@ func setupNode( c.P2P.V2.ListenAddresses = &p2paddresses c.P2P.V2.DeltaDial = commonconfig.MustNewDuration(500 * time.Millisecond) c.P2P.V2.DeltaReconcile = commonconfig.MustNewDuration(5 * time.Second) + + // [Mercury] + c.Mercury.VerboseLogging = ptr(true) }) lggr, observedLogs := logger.TestLoggerObserved(t, zapcore.DebugLevel) @@ -215,13 +205,13 @@ func setupNode( func ptr[T any](t T) *T { return &t } -func addStreamJob( +func addSingleDecimalStreamJob( t *testing.T, node Node, streamID uint32, bridgeName string, -) { - node.AddStreamJob(t, fmt.Sprintf(` +) (id int32) { + return node.AddStreamJob(t, fmt.Sprintf(` type = "stream" schemaVersion = 1 name = "strm-spec-%d" @@ -230,9 +220,8 @@ observationSource = """ // Benchmark Price price1 [type=bridge name="%s" requestData="{\\"data\\":{\\"data\\":\\"foo\\"}}"]; price1_parse [type=jsonparse path="result"]; - price1_multiply [type=multiply times=100000000 index=0]; - price1 -> price1_parse -> price1_multiply; + price1 -> price1_parse; """ `, @@ -242,7 +231,48 @@ observationSource = """ )) } -func addBootstrapJob(t *testing.T, bootstrapNode Node, verifierAddress common.Address, name string, relayType, relayConfig string) { +func addQuoteStreamJob( + t *testing.T, + node Node, + streamID uint32, + benchmarkBridgeName string, + bidBridgeName string, + askBridgeName string, +) (id int32) { + return node.AddStreamJob(t, fmt.Sprintf(` +type = "stream" +schemaVersion = 1 +name = "strm-spec-%d" +streamID = %d +observationSource = """ + // Benchmark Price + price1 [type=bridge name="%s" requestData="{\\"data\\":{\\"data\\":\\"foo\\"}}"]; + price1_parse [type=jsonparse path="result" index=0]; + + price1 -> price1_parse; + + // Bid + price2 [type=bridge name="%s" requestData="{\\"data\\":{\\"data\\":\\"foo\\"}}"]; + price2_parse [type=jsonparse path="result" index=1]; + + price2 -> price2_parse; + + // Ask + price3 [type=bridge name="%s" requestData="{\\"data\\":{\\"data\\":\\"foo\\"}}"]; + price3_parse [type=jsonparse path="result" index=2]; + + price3 -> price3_parse; +""" + + `, + streamID, + streamID, + benchmarkBridgeName, + bidBridgeName, + askBridgeName, + )) +} +func addBootstrapJob(t *testing.T, bootstrapNode Node, configuratorAddress common.Address, name string, relayType, relayConfig string) { bootstrapNode.AddBootstrapJob(t, fmt.Sprintf(` type = "bootstrap" relay = "%s" @@ -253,13 +283,13 @@ contractConfigTrackerPollInterval = "1s" [relayConfig] %s -providerType = "llo"`, relayType, name, verifierAddress.Hex(), relayConfig)) +providerType = "llo"`, relayType, name, configuratorAddress.Hex(), relayConfig)) } func addLLOJob( t *testing.T, node Node, - verifierAddress common.Address, + configuratorAddr common.Address, bootstrapPeerID string, bootstrapNodePort int, clientPubKey ed25519.PublicKey, @@ -290,7 +320,7 @@ transmitterID = "%x" [relayConfig] %s`, jobName, - verifierAddress.Hex(), + configuratorAddr.Hex(), node.KeyBundle.ID(), fmt.Sprintf("%s@127.0.0.1:%d", bootstrapPeerID, bootstrapNodePort), relayType, @@ -300,12 +330,36 @@ transmitterID = "%x" )) } -func addOCRJobs( +func createBridge(t *testing.T, name string, i int, p decimal.Decimal, borm bridges.ORM) (bridgeName string) { + ctx := testutils.Context(t) + bridge := httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) { + b, err := io.ReadAll(req.Body) + require.NoError(t, err) + require.Equal(t, `{"data":{"data":"foo"}}`, string(b)) + + res.WriteHeader(http.StatusOK) + val := p.String() + resp := fmt.Sprintf(`{"result": %s}`, val) + _, err = res.Write([]byte(resp)) + require.NoError(t, err) + })) + t.Cleanup(bridge.Close) + u, _ := url.Parse(bridge.URL) + bridgeName = fmt.Sprintf("bridge-%s-%d", name, i) + require.NoError(t, borm.CreateBridgeType(ctx, &bridges.BridgeType{ + Name: bridges.BridgeName(bridgeName), + URL: models.WebURL(*u), + })) + + return bridgeName +} + +func addOCRJobsEVMPremiumLegacy( t *testing.T, streams []Stream, serverPubKey ed25519.PublicKey, serverURL string, - verifierAddress common.Address, + configuratorAddress common.Address, bootstrapPeerID string, bootstrapNodePort int, nodes []Node, @@ -313,46 +367,51 @@ func addOCRJobs( clientPubKeys []ed25519.PublicKey, pluginConfig, relayType, - relayConfig string) { - ctx := testutils.Context(t) - createBridge := func(name string, i int, p *big.Int, borm bridges.ORM) (bridgeName string) { - bridge := httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) { - b, err := io.ReadAll(req.Body) - require.NoError(t, err) - require.Equal(t, `{"data":{"data":"foo"}}`, string(b)) - - res.WriteHeader(http.StatusOK) - val := decimal.NewFromBigInt(p, 0).Div(decimal.NewFromInt(multiplier)).Add(decimal.NewFromInt(int64(i)).Div(decimal.NewFromInt(100))).String() - resp := fmt.Sprintf(`{"result": %s}`, val) - _, err = res.Write([]byte(resp)) - require.NoError(t, err) - })) - t.Cleanup(bridge.Close) - u, _ := url.Parse(bridge.URL) - bridgeName = fmt.Sprintf("bridge-%s-%d", name, i) - require.NoError(t, borm.CreateBridgeType(ctx, &bridges.BridgeType{ - Name: bridges.BridgeName(bridgeName), - URL: models.WebURL(*u), - })) - - return bridgeName - } - + relayConfig string) (jobIDs map[int]map[uint32]int32) { + // node idx => stream id => job id + jobIDs = make(map[int]map[uint32]int32) // Add OCR jobs - one per feed on each node for i, node := range nodes { + if jobIDs[i] == nil { + jobIDs[i] = make(map[uint32]int32) + } for j, strm := range streams { - bmBridge := createBridge(fmt.Sprintf("benchmarkprice-%d-%d", strm.id, j), i, strm.baseBenchmarkPrice, node.App.BridgeORM()) - addStreamJob( - t, - node, - strm.id, - bmBridge, - ) + // assume that streams are native, link and additionals are quote + if j < 2 { + var name string + if j == 0 { + name = "nativeprice" + } else { + name = "linkprice" + } + name = fmt.Sprintf("%s-%d-%d", name, strm.id, j) + bmBridge := createBridge(t, name, i, strm.baseBenchmarkPrice, node.App.BridgeORM()) + jobID := addSingleDecimalStreamJob( + t, + node, + strm.id, + bmBridge, + ) + jobIDs[i][strm.id] = jobID + } else { + bmBridge := createBridge(t, fmt.Sprintf("benchmarkprice-%d-%d", strm.id, j), i, strm.baseBenchmarkPrice, node.App.BridgeORM()) + bidBridge := createBridge(t, fmt.Sprintf("bid-%d-%d", strm.id, j), i, strm.baseBid, node.App.BridgeORM()) + askBridge := createBridge(t, fmt.Sprintf("ask-%d-%d", strm.id, j), i, strm.baseAsk, node.App.BridgeORM()) + jobID := addQuoteStreamJob( + t, + node, + strm.id, + bmBridge, + bidBridge, + askBridge, + ) + jobIDs[i][strm.id] = jobID + } } addLLOJob( t, node, - verifierAddress, + configuratorAddress, bootstrapPeerID, bootstrapNodePort, clientPubKeys[i], @@ -362,4 +421,5 @@ func addOCRJobs( relayConfig, ) } + return jobIDs } diff --git a/core/services/ocr2/plugins/llo/integration_test.go b/core/services/ocr2/plugins/llo/integration_test.go index 75cc7edc5d9..2e49e989462 100644 --- a/core/services/ocr2/plugins/llo/integration_test.go +++ b/core/services/ocr2/plugins/llo/integration_test.go @@ -6,268 +6,123 @@ import ( "encoding/json" "fmt" "math/big" - "math/rand" + "net/http" + "net/http/httptest" "strings" "testing" "time" + "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/accounts/abi/bind/backends" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core" "github.com/ethereum/go-ethereum/eth/ethconfig" "github.com/hashicorp/consul/sdk/freeport" + "github.com/shopspring/decimal" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "golang.org/x/crypto/sha3" - chainselectors "github.com/smartcontractkit/chain-selectors" "github.com/smartcontractkit/libocr/offchainreporting2/types" "github.com/smartcontractkit/libocr/offchainreporting2plus/confighelper" "github.com/smartcontractkit/libocr/offchainreporting2plus/ocr3confighelper" ocr2types "github.com/smartcontractkit/libocr/offchainreporting2plus/types" + "github.com/smartcontractkit/wsrpc/credentials" llotypes "github.com/smartcontractkit/chainlink-common/pkg/types/llo" - "github.com/smartcontractkit/chainlink-common/pkg/utils" datastreamsllo "github.com/smartcontractkit/chainlink-data-streams/llo" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/llo-feeds/generated/channel_config_store" - "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/llo-feeds/generated/channel_verifier" - "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/llo-feeds/generated/verifier_proxy" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/llo-feeds/generated/configurator" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/llo-feeds/generated/destination_verifier" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/llo-feeds/generated/destination_verifier_proxy" "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/csakey" - "github.com/smartcontractkit/chainlink/v2/core/services/llo" lloevm "github.com/smartcontractkit/chainlink/v2/core/services/llo/evm" "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm" + "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury" + reportcodecv3 "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury/v3/reportcodec" + mercuryverifier "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury/verifier" ) var ( - fNodes = uint8(1) - nNodes = 4 // number of nodes (not including bootstrap) - multiplier int64 = 100000000 + fNodes = uint8(1) + nNodes = 4 // number of nodes (not including bootstrap) ) -func setupBlockchain(t *testing.T) (*bind.TransactOpts, *backends.SimulatedBackend, *channel_verifier.ChannelVerifier, common.Address, *channel_config_store.ChannelConfigStore, common.Address) { +func setupBlockchain(t *testing.T) (*bind.TransactOpts, *backends.SimulatedBackend, *configurator.Configurator, common.Address, *destination_verifier.DestinationVerifier, common.Address, *destination_verifier_proxy.DestinationVerifierProxy, common.Address, *channel_config_store.ChannelConfigStore, common.Address) { steve := testutils.MustNewSimTransactor(t) // config contract deployer and owner genesisData := core.GenesisAlloc{steve.From: {Balance: assets.Ether(1000).ToInt()}} backend := cltest.NewSimulatedBackend(t, genesisData, uint32(ethconfig.Defaults.Miner.GasCeil)) backend.Commit() backend.Commit() // ensure starting block number at least 1 - // Deploy contracts - verifierProxyAddr, _, _, err := verifier_proxy.DeployVerifierProxy(steve, backend, common.Address{}) // zero address for access controller disables access control + // Configurator + configuratorAddress, _, configurator, err := configurator.DeployConfigurator(steve, backend) require.NoError(t, err) - verifierAddress, _, verifierContract, err := channel_verifier.DeployChannelVerifier(steve, backend, verifierProxyAddr) + // DestinationVerifierProxy + verifierProxyAddr, _, verifierProxy, err := destination_verifier_proxy.DeployDestinationVerifierProxy(steve, backend) require.NoError(t, err) - configStoreAddress, _, configStoreContract, err := channel_config_store.DeployChannelConfigStore(steve, backend) + // DestinationVerifier + verifierAddr, _, verifier, err := destination_verifier.DeployDestinationVerifier(steve, backend, verifierProxyAddr) + require.NoError(t, err) + // AddVerifier + _, err = verifierProxy.SetVerifier(steve, verifierAddr) + require.NoError(t, err) + + // ChannelConfigStore + configStoreAddress, _, configStore, err := channel_config_store.DeployChannelConfigStore(steve, backend) require.NoError(t, err) backend.Commit() - return steve, backend, verifierContract, verifierAddress, configStoreContract, configStoreAddress + return steve, backend, configurator, configuratorAddress, verifier, verifierAddr, verifierProxy, verifierProxyAddr, configStore, configStoreAddress } type Stream struct { id uint32 - baseBenchmarkPrice *big.Int + baseBenchmarkPrice decimal.Decimal + baseBid decimal.Decimal + baseAsk decimal.Decimal } +const ( + ethStreamID = 52 + linkStreamID = 53 + quoteStreamID1 = 55 + quoteStreamID2 = 56 +) + var ( - btcStream = Stream{ - id: 51, - baseBenchmarkPrice: big.NewInt(20_000 * multiplier), - } - ethStream = Stream{ + quoteStreamFeedID1 = common.HexToHash(`0x0003111111111111111111111111111111111111111111111111111111111111`) + quoteStreamFeedID2 = common.HexToHash(`0x0003222222222222222222222222222222222222222222222222222222222222`) + ethStream = Stream{ id: 52, - baseBenchmarkPrice: big.NewInt(1_568 * multiplier), + baseBenchmarkPrice: decimal.NewFromFloat32(2_976.39), } linkStream = Stream{ id: 53, - baseBenchmarkPrice: big.NewInt(7150 * multiplier / 1000), - } - dogeStream = Stream{ - id: 54, - baseBenchmarkPrice: big.NewInt(2_020 * multiplier), - } -) - -func TestIntegration_LLO(t *testing.T) { - testStartTimeStamp := uint32(time.Now().Unix()) - - const fromBlock = 1 // cannot use zero, start from block 1 - - // streams - streams := []Stream{btcStream, ethStream, linkStream, dogeStream} - streamMap := make(map[uint32]Stream) - for _, strm := range streams { - streamMap[strm.id] = strm - } - - reqs := make(chan request) - serverKey := csakey.MustNewV2XXXTestingOnly(big.NewInt(-1)) - serverPubKey := serverKey.PublicKey - srv := NewMercuryServer(t, ed25519.PrivateKey(serverKey.Raw()), reqs, nil) - - clientCSAKeys := make([]csakey.KeyV2, nNodes) - clientPubKeys := make([]ed25519.PublicKey, nNodes) - for i := 0; i < nNodes; i++ { - k := big.NewInt(int64(i)) - key := csakey.MustNewV2XXXTestingOnly(k) - clientCSAKeys[i] = key - clientPubKeys[i] = key.PublicKey + baseBenchmarkPrice: decimal.NewFromFloat32(13.25), } - serverURL := startMercuryServer(t, srv, clientPubKeys) - chainID := testutils.SimulatedChainID - - steve, backend, verifierContract, verifierAddress, configStoreContract, configStoreAddress := setupBlockchain(t) - - // Setup bootstrap - bootstrapCSAKey := csakey.MustNewV2XXXTestingOnly(big.NewInt(-1)) - bootstrapNodePort := freeport.GetOne(t) - appBootstrap, bootstrapPeerID, _, bootstrapKb, _ := setupNode(t, bootstrapNodePort, "bootstrap_mercury", backend, bootstrapCSAKey) - bootstrapNode := Node{App: appBootstrap, KeyBundle: bootstrapKb} - - // Setup oracle nodes - var ( - oracles []confighelper.OracleIdentityExtra - nodes []Node - ) - ports := freeport.GetN(t, nNodes) - for i := 0; i < nNodes; i++ { - app, peerID, transmitter, kb, observedLogs := setupNode(t, ports[i], fmt.Sprintf("oracle_streams_%d", i), backend, clientCSAKeys[i]) - - nodes = append(nodes, Node{ - app, transmitter, kb, observedLogs, - }) - offchainPublicKey, _ := hex.DecodeString(strings.TrimPrefix(kb.OnChainPublicKey(), "0x")) - oracles = append(oracles, confighelper.OracleIdentityExtra{ - OracleIdentity: confighelper.OracleIdentity{ - OnchainPublicKey: offchainPublicKey, - TransmitAccount: ocr2types.Account(fmt.Sprintf("%x", transmitter[:])), - OffchainPublicKey: kb.OffchainPublicKey(), - PeerID: peerID, - }, - ConfigEncryptionPublicKey: kb.ConfigEncryptionPublicKey(), - }) + quoteStream1 = Stream{ + id: 55, + baseBenchmarkPrice: decimal.NewFromFloat32(1000.1212), + baseBid: decimal.NewFromFloat32(998.5431), + baseAsk: decimal.NewFromFloat32(1001.6999), } - - // Commit blocks to finality depth to ensure LogPoller has finalized blocks to read from - ch, err := nodes[0].App.GetRelayers().LegacyEVMChains().Get(testutils.SimulatedChainID.String()) - require.NoError(t, err) - finalityDepth := ch.Config().EVM().FinalityDepth() - for i := 0; i < int(finalityDepth); i++ { - backend.Commit() + quoteStream2 = Stream{ + id: 56, + baseBenchmarkPrice: decimal.NewFromFloat32(500.1212), + baseBid: decimal.NewFromFloat32(499.5431), + baseAsk: decimal.NewFromFloat32(502.6999), } +) - configDigest := setConfig(t, steve, backend, verifierContract, verifierAddress, nodes, oracles) - channelDefinitions := setChannelDefinitions(t, steve, backend, configStoreContract, streams) - - relayType := "evm" - relayConfig := fmt.Sprintf(`chainID = %s -fromBlock = %d`, chainID.String(), fromBlock) - addBootstrapJob(t, bootstrapNode, verifierAddress, "job-1", relayType, relayConfig) - - pluginConfig := fmt.Sprintf(`serverURL = "%s" -serverPubKey = "%x" -channelDefinitionsContractFromBlock = %d -channelDefinitionsContractAddress = "%s"`, serverURL, serverPubKey, fromBlock, configStoreAddress.String()) - addOCRJobs(t, streams, serverPubKey, serverURL, verifierAddress, bootstrapPeerID, bootstrapNodePort, nodes, configStoreAddress, clientPubKeys, pluginConfig, relayType, relayConfig) - t.Run("receives at least one report per feed from each oracle when EAs are at 100% reliability", func(t *testing.T) { - // Expect at least one report per channel from each oracle (keyed by transmitter ID) - seen := make(map[ocr2types.Account]map[llotypes.ChannelID]struct{}) - - for channelID, defn := range channelDefinitions { - t.Logf("Expect report for channel ID %x (definition: %#v)", channelID, defn) - } - for _, o := range oracles { - t.Logf("Expect report from oracle %s", o.OracleIdentity.TransmitAccount) - seen[o.OracleIdentity.TransmitAccount] = make(map[llotypes.ChannelID]struct{}) - } - for req := range reqs { - if _, exists := seen[req.TransmitterID()]; !exists { - // oracle already reported on all channels; discard - // if this test timeouts, check for expected transmitter ID - continue - } - - v := make(map[string]interface{}) - err := llo.PayloadTypes.UnpackIntoMap(v, req.req.Payload) - require.NoError(t, err) - report, exists := v["report"] - if !exists { - t.Fatalf("FAIL: expected payload %#v to contain 'report'", v) - } - - t.Logf("Got report from oracle %s with format: %d", req.pk, req.req.ReportFormat) - - var r datastreamsllo.Report - - switch req.req.ReportFormat { - case uint32(llotypes.ReportFormatJSON): - t.Logf("Got report (JSON) from oracle %x: %s", req.pk, string(report.([]byte))) - var err error - r, err = (datastreamsllo.JSONReportCodec{}).Decode(report.([]byte)) - require.NoError(t, err, "expected valid JSON") - case uint32(llotypes.ReportFormatEVM): - t.Logf("Got report (EVM) from oracle %s: 0x%x", req.pk, report.([]byte)) - var err error - r, err = (lloevm.ReportCodec{}).Decode(report.([]byte)) - require.NoError(t, err, "expected valid EVM encoding") - default: - t.Fatalf("FAIL: unexpected report format: %q", req.req.ReportFormat) - } - - assert.Equal(t, configDigest, r.ConfigDigest) - assert.Equal(t, uint64(0x2ee634951ef71b46), r.ChainSelector) - assert.GreaterOrEqual(t, r.SeqNr, uint64(1)) - assert.GreaterOrEqual(t, r.ValidAfterSeconds, testStartTimeStamp) - assert.Equal(t, r.ValidAfterSeconds+1, r.ValidUntilSeconds) - - // values - defn, exists := channelDefinitions[r.ChannelID] - require.True(t, exists, "expected channel ID to be in channelDefinitions") - - require.Equal(t, len(defn.StreamIDs), len(r.Values)) - - for i, strmID := range defn.StreamIDs { - strm, exists := streamMap[strmID] - require.True(t, exists, "invariant violation: expected stream ID to be present") - assert.InDelta(t, strm.baseBenchmarkPrice.Int64(), r.Values[i].Int64(), 5000000) - } - - assert.False(t, r.Specimen) - - seen[req.TransmitterID()][r.ChannelID] = struct{}{} - t.Logf("Got report from oracle %s with channel: %x)", req.TransmitterID(), r.ChannelID) - - if _, exists := seen[req.TransmitterID()]; exists && len(seen[req.TransmitterID()]) == len(channelDefinitions) { - t.Logf("All channels reported for oracle with transmitterID %s", req.TransmitterID()) - delete(seen, req.TransmitterID()) - } - if len(seen) == 0 { - break // saw all oracles; success! - } - - // bit of a hack here but shouldn't hurt anything, we wanna dump - // `seen` before the test ends to aid in debugging test failures - if d, ok := t.Deadline(); ok { - select { - case <-time.After(time.Until(d.Add(-100 * time.Millisecond))): - if len(seen) > 0 { - t.Fatalf("FAILED: ERROR: missing expected reports: %#v\n", seen) - } - default: - } - } - } - }) - - // TODO: test verification -} - -func generateConfig(t *testing.T, nodes []Node, oracles []confighelper.OracleIdentityExtra) ( +func generateConfig(t *testing.T, oracles []confighelper.OracleIdentityExtra) ( signers []types.OnchainPublicKey, transmitters []types.Account, f uint8, @@ -275,11 +130,6 @@ func generateConfig(t *testing.T, nodes []Node, oracles []confighelper.OracleIde offchainConfigVersion uint64, offchainConfig []byte, ) { - // Setup config on contract - rawOnchainConfig := llo.OnchainConfig{} - onchainConfig, err := (&llo.JSONOnchainConfigCodec{}).Encode(rawOnchainConfig) - require.NoError(t, err) - rawReportingPluginConfig := datastreamsllo.OffchainConfig{} reportingPluginConfig, err := rawReportingPluginConfig.Encode() require.NoError(t, err) @@ -293,7 +143,7 @@ func generateConfig(t *testing.T, nodes []Node, oracles []confighelper.OracleIde 300*time.Millisecond, // DeltaCertifiedCommitRequest 1*time.Minute, // DeltaStage 100, // rMax - []int{len(nodes)}, // S + []int{len(oracles)}, // S oracles, reportingPluginConfig, // reportingPluginConfig []byte, 0, // maxDurationQuery @@ -301,7 +151,7 @@ func generateConfig(t *testing.T, nodes []Node, oracles []confighelper.OracleIde 0, // maxDurationShouldAcceptAttestedReport 0, // maxDurationShouldTransmitAcceptedReport int(fNodes), // f - onchainConfig, + onchainConfig, // encoded onchain config ) require.NoError(t, err) @@ -309,8 +159,8 @@ func generateConfig(t *testing.T, nodes []Node, oracles []confighelper.OracleIde return } -func setConfig(t *testing.T, steve *bind.TransactOpts, backend *backends.SimulatedBackend, verifierContract *channel_verifier.ChannelVerifier, verifierAddress common.Address, nodes []Node, oracles []confighelper.OracleIdentityExtra) ocr2types.ConfigDigest { - signers, _, _, _, offchainConfigVersion, offchainConfig := generateConfig(t, nodes, oracles) +func setConfig(t *testing.T, donID uint32, steve *bind.TransactOpts, backend *backends.SimulatedBackend, configurator *configurator.Configurator, configuratorAddress common.Address, nodes []Node, oracles []confighelper.OracleIdentityExtra) ocr2types.ConfigDigest { + signers, _, _, _, offchainConfigVersion, offchainConfig := generateConfig(t, oracles) signerAddresses, err := evm.OnchainPublicKeyToAddress(signers) require.NoError(t, err) @@ -318,84 +168,37 @@ func setConfig(t *testing.T, steve *bind.TransactOpts, backend *backends.Simulat for i := 0; i < nNodes; i++ { offchainTransmitters[i] = nodes[i].ClientPubKey } - _, err = verifierContract.SetConfig(steve, signerAddresses, offchainTransmitters, fNodes, offchainConfig, offchainConfigVersion, offchainConfig, nil) + donIDPadded := evm.DonIDToBytes32(donID) + _, err = configurator.SetConfig(steve, donIDPadded, signerAddresses, offchainTransmitters, fNodes, offchainConfig, offchainConfigVersion, offchainConfig) require.NoError(t, err) + // libocr requires a few confirmations to accept the config + backend.Commit() + backend.Commit() + backend.Commit() backend.Commit() - l, err := verifierContract.LatestConfigDigestAndEpoch(&bind.CallOpts{}) + logs, err := backend.FilterLogs(testutils.Context(t), ethereum.FilterQuery{Addresses: []common.Address{configuratorAddress}, Topics: [][]common.Hash{[]common.Hash{mercury.FeedScopedConfigSet, donIDPadded}}}) require.NoError(t, err) + require.Len(t, logs, 1) - return l.ConfigDigest -} - -func setChannelDefinitions(t *testing.T, steve *bind.TransactOpts, backend *backends.SimulatedBackend, configStoreContract *channel_config_store.ChannelConfigStore, streams []Stream) map[llotypes.ChannelID]channel_config_store.IChannelConfigStoreChannelDefinition { - channels := []llotypes.ChannelID{ - rand.Uint32(), - rand.Uint32(), - rand.Uint32(), - rand.Uint32(), - } - - chainSelector, err := chainselectors.SelectorFromChainId(testutils.SimulatedChainID.Uint64()) + cfg, err := mercury.ConfigFromLog(logs[0].Data) require.NoError(t, err) - streamIDs := make([]uint32, len(streams)) - for i := 0; i < len(streams); i++ { - streamIDs[i] = streams[i].id - } - - // First set contains [1,len(streams)] - channel0Def := channel_config_store.IChannelConfigStoreChannelDefinition{ - ReportFormat: uint32(llotypes.ReportFormatJSON), - ChainSelector: chainSelector, - StreamIDs: streamIDs[1:len(streams)], - } - channel1Def := channel_config_store.IChannelConfigStoreChannelDefinition{ - ReportFormat: uint32(llotypes.ReportFormatEVM), - ChainSelector: chainSelector, - StreamIDs: streamIDs[1:len(streams)], - } - - // Second set contains [0,len(streams)-1] - channel2Def := channel_config_store.IChannelConfigStoreChannelDefinition{ - ReportFormat: uint32(llotypes.ReportFormatJSON), - ChainSelector: chainSelector, - StreamIDs: streamIDs[0 : len(streams)-1], - } - channel3Def := channel_config_store.IChannelConfigStoreChannelDefinition{ - ReportFormat: uint32(llotypes.ReportFormatEVM), - ChainSelector: chainSelector, - StreamIDs: streamIDs[0 : len(streams)-1], - } - - require.NoError(t, utils.JustError(configStoreContract.AddChannel(steve, channels[0], channel0Def))) - require.NoError(t, utils.JustError(configStoreContract.AddChannel(steve, channels[1], channel1Def))) - require.NoError(t, utils.JustError(configStoreContract.AddChannel(steve, channels[2], channel2Def))) - require.NoError(t, utils.JustError(configStoreContract.AddChannel(steve, channels[3], channel3Def))) - - backend.Commit() - - channelDefinitions := make(map[llotypes.ChannelID]channel_config_store.IChannelConfigStoreChannelDefinition) - - channelDefinitions[channels[0]] = channel0Def - channelDefinitions[channels[1]] = channel1Def - channelDefinitions[channels[2]] = channel2Def - channelDefinitions[channels[3]] = channel3Def - - backend.Commit() - - return channelDefinitions + return cfg.ConfigDigest } -func TestIntegration_LLO_Dummy(t *testing.T) { +func TestIntegration_LLO(t *testing.T) { testStartTimeStamp := time.Now() + donID := uint32(995544) + multiplier, err := decimal.NewFromString("1e18") + require.NoError(t, err) + expirationWindow := time.Hour / time.Second - streams := []Stream{btcStream, ethStream, linkStream, dogeStream} - streamMap := make(map[uint32]Stream) - for _, strm := range streams { - streamMap[strm.id] = strm - } + reqs := make(chan request) + serverKey := csakey.MustNewV2XXXTestingOnly(big.NewInt(-1)) + serverPubKey := serverKey.PublicKey + srv := NewMercuryServer(t, ed25519.PrivateKey(serverKey.Raw()), reqs) clientCSAKeys := make([]csakey.KeyV2, nNodes) clientPubKeys := make([]ed25519.PublicKey, nNodes) @@ -405,14 +208,24 @@ func TestIntegration_LLO_Dummy(t *testing.T) { clientCSAKeys[i] = key clientPubKeys[i] = key.PublicKey } + serverURL := startMercuryServer(t, srv, clientPubKeys) + + steve, backend, configurator, configuratorAddress, verifier, _, verifierProxy, _, configStore, configStoreAddress := setupBlockchain(t) + fromBlock := 1 // Setup bootstrap bootstrapCSAKey := csakey.MustNewV2XXXTestingOnly(big.NewInt(-1)) bootstrapNodePort := freeport.GetOne(t) - appBootstrap, bootstrapPeerID, _, bootstrapKb, _ := setupNode(t, bootstrapNodePort, "bootstrap_mercury", nil, bootstrapCSAKey) + appBootstrap, bootstrapPeerID, _, bootstrapKb, _ := setupNode(t, bootstrapNodePort, "bootstrap_llo", backend, bootstrapCSAKey) bootstrapNode := Node{App: appBootstrap, KeyBundle: bootstrapKb} - t.Run("with at least one channel", func(t *testing.T) { + t.Run("produces reports in v0.3 format", func(t *testing.T) { + streams := []Stream{ethStream, linkStream, quoteStream1, quoteStream2} + streamMap := make(map[uint32]Stream) + for _, strm := range streams { + streamMap[strm.id] = strm + } + // Setup oracle nodes var ( oracles []confighelper.OracleIdentityExtra @@ -420,7 +233,7 @@ func TestIntegration_LLO_Dummy(t *testing.T) { ) ports := freeport.GetN(t, nNodes) for i := 0; i < nNodes; i++ { - app, peerID, transmitter, kb, observedLogs := setupNode(t, ports[i], fmt.Sprintf("oracle_streams_%d", i), nil, clientCSAKeys[i]) + app, peerID, transmitter, kb, observedLogs := setupNode(t, ports[i], fmt.Sprintf("oracle_streams_%d", i), backend, clientCSAKeys[i]) nodes = append(nodes, Node{ app, transmitter, kb, observedLogs, @@ -437,89 +250,185 @@ func TestIntegration_LLO_Dummy(t *testing.T) { }) } - verifierAddress := common.Address{} - chainID := "llo-dummy" - relayType := "dummy" - cd := "0x0102030405060708010203040506070801020304050607080102030405060708" - signers, transmitters, f, onchainConfig, offchainConfigVersion, offchainConfig := generateConfig(t, nodes, oracles) - var signersMarshalled, transmittersMarshalled []byte - { - var err error - signersHex := make([]string, len(signers)) - for i, signer := range signers { - signersHex[i] = fmt.Sprintf("0x%x", signer) - } - signersMarshalled, err = json.Marshal(signersHex) - require.NoError(t, err) + chainID := testutils.SimulatedChainID + relayType := "evm" + relayConfig := fmt.Sprintf(` +chainID = "%s" +fromBlock = %d +lloDonID = %d +`, chainID, fromBlock, donID) + addBootstrapJob(t, bootstrapNode, configuratorAddress, "job-2", relayType, relayConfig) + + // Channel definitions + channelDefinitions := llotypes.ChannelDefinitions{ + 1: { + ReportFormat: llotypes.ReportFormatEVMPremiumLegacy, + Streams: []llotypes.Stream{ + { + StreamID: ethStreamID, + Aggregator: llotypes.AggregatorMedian, + }, + { + StreamID: linkStreamID, + Aggregator: llotypes.AggregatorMedian, + }, + { + StreamID: quoteStreamID1, + Aggregator: llotypes.AggregatorQuote, + }, + }, + Opts: llotypes.ChannelOpts([]byte(fmt.Sprintf(`{"baseUSDFee":"0.1","expirationWindow":%d,"feedId":"0x%x","multiplier":"%s"}`, expirationWindow, quoteStreamFeedID1, multiplier.String()))), + }, + 2: { + ReportFormat: llotypes.ReportFormatEVMPremiumLegacy, + Streams: []llotypes.Stream{ + { + StreamID: ethStreamID, + Aggregator: llotypes.AggregatorMedian, + }, + { + StreamID: linkStreamID, + Aggregator: llotypes.AggregatorMedian, + }, + { + StreamID: quoteStreamID2, + Aggregator: llotypes.AggregatorQuote, + }, + }, + Opts: llotypes.ChannelOpts([]byte(fmt.Sprintf(`{"baseUSDFee":"0.1","expirationWindow":%d,"feedId":"0x%x","multiplier":"%s"}`, expirationWindow, quoteStreamFeedID2, multiplier.String()))), + }, + } - transmittersMarshalled, err = json.Marshal(transmitters) + channelDefinitionsJSON, err := json.MarshalIndent(channelDefinitions, "", " ") + require.NoError(t, err) + channelDefinitionsSHA := sha3.Sum256(channelDefinitionsJSON) + + // Set up channel definitions server + channelDefinitionsServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + assert.Equal(t, "/channel-definitions", r.URL.Path) + assert.Equal(t, "GET", r.Method) + assert.Equal(t, "application/json", r.Header.Get("Content-Type")) + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + _, err := w.Write(channelDefinitionsJSON) require.NoError(t, err) - } + })) + t.Cleanup(channelDefinitionsServer.Close) - relayConfig := fmt.Sprintf(`chainID = "%s" -configTracker = { - configDigest = "%s", - configCount = 0, - signers = %s, - transmitters = %s, - f = %d, - onchainConfig = "0x%x", - offchainConfigVersion = %d, - offchainConfig = "0x%x", - blockHeight = 10 -}`, chainID, cd, string(signersMarshalled), string(transmittersMarshalled), f, onchainConfig, offchainConfigVersion, offchainConfig) - addBootstrapJob(t, bootstrapNode, verifierAddress, "job-1", relayType, relayConfig) - - serverKey := csakey.MustNewV2XXXTestingOnly(big.NewInt(-1)) - serverPubKey := serverKey.PublicKey - serverURL := "foo" - configStoreAddress := common.Address{} - - // NOTE: Don't actually care about the chain ID, it just needs to be - // a valid chainSelector - chainSelector, err := chainselectors.SelectorFromChainId(testutils.SimulatedChainID.Uint64()) + // Set channel definitions + _, err = configStore.SetChannelDefinitions(steve, donID, channelDefinitionsServer.URL+"/channel-definitions", channelDefinitionsSHA) require.NoError(t, err) + backend.Commit() - channelDefinitions := fmt.Sprintf(`{ -"42": { - "reportFormat": %d, - "chainSelector": %d, - "streamIds": [51, 52] - } -}`, llotypes.ReportFormatJSON, chainSelector) + pluginConfig := fmt.Sprintf(`servers = { "%s" = "%x" } +donID = %d +channelDefinitionsContractAddress = "0x%x" +channelDefinitionsContractFromBlock = %d`, serverURL, serverPubKey, donID, configStoreAddress, fromBlock) + addOCRJobsEVMPremiumLegacy(t, streams, serverPubKey, serverURL, configuratorAddress, bootstrapPeerID, bootstrapNodePort, nodes, configStoreAddress, clientPubKeys, pluginConfig, relayType, relayConfig) - pluginConfig := fmt.Sprintf(`serverURL = "foo" -serverPubKey = "%x" -channelDefinitions = %q`, serverPubKey, channelDefinitions) - addOCRJobs(t, streams, serverPubKey, serverURL, verifierAddress, bootstrapPeerID, bootstrapNodePort, nodes, configStoreAddress, clientPubKeys, pluginConfig, relayType, relayConfig) + // Set config on configurator + setConfig( + t, donID, steve, backend, configurator, configuratorAddress, nodes, oracles, + ) - for _, node := range nodes { - le := testutils.WaitForLogMessage(t, node.ObservedLogs, "Transmit") - fields := le.ContextMap() - assert.Equal(t, cd[2:], fields["digest"]) - assert.Equal(t, llotypes.ReportInfo{LifeCycleStage: "production", ReportFormat: llotypes.ReportFormatJSON}, fields["report.Info"]) + // Set config on the destination verifier + signerAddresses := make([]common.Address, len(oracles)) + for i, oracle := range oracles { + signerAddresses[i] = common.BytesToAddress(oracle.OracleIdentity.OnchainPublicKey) + } + { + recipientAddressesAndWeights := []destination_verifier.CommonAddressAndWeight{} - if fields["report.Report"] == nil { - t.Fatal("FAIL: expected log fields to contain 'report.Report'") - } - binaryReport := fields["report.Report"].(types.Report) - report, err := (datastreamsllo.JSONReportCodec{}).Decode(binaryReport) + _, err := verifier.SetConfig(steve, signerAddresses, fNodes, recipientAddressesAndWeights) require.NoError(t, err) - assert.Equal(t, datastreamsllo.Report{ - ConfigDigest: types.ConfigDigest{0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8}, - ChainSelector: 0x2ee634951ef71b46, - SeqNr: fields["seqNr"].(uint64), - ChannelID: 0x2a, - ValidAfterSeconds: report.ValidAfterSeconds, // tested separately below - ValidUntilSeconds: report.ValidUntilSeconds, // tested separately below - Values: []*big.Int{big.NewInt(2000002000000), big.NewInt(156802000000)}, - Specimen: false, - }, report) - assert.GreaterOrEqual(t, report.ValidUntilSeconds, uint32(testStartTimeStamp.Unix())) - assert.GreaterOrEqual(t, report.ValidAfterSeconds, uint32(testStartTimeStamp.Unix())) - assert.GreaterOrEqual(t, report.ValidUntilSeconds, report.ValidAfterSeconds) - - assert.GreaterOrEqual(t, int(fields["seqNr"].(uint64)), 0) + backend.Commit() } + + t.Run("receives at least one report per channel from each oracle when EAs are at 100% reliability", func(t *testing.T) { + // Expect at least one report per feed from each oracle + seen := make(map[[32]byte]map[credentials.StaticSizedPublicKey]struct{}) + for _, cd := range channelDefinitions { + var opts lloevm.ReportFormatEVMPremiumLegacyOpts + err := json.Unmarshal(cd.Opts, &opts) + require.NoError(t, err) + // feedID will be deleted when all n oracles have reported + seen[opts.FeedID] = make(map[credentials.StaticSizedPublicKey]struct{}, nNodes) + } + for req := range reqs { + v := make(map[string]interface{}) + err := mercury.PayloadTypes.UnpackIntoMap(v, req.req.Payload) + require.NoError(t, err) + report, exists := v["report"] + if !exists { + t.Fatalf("expected payload %#v to contain 'report'", v) + } + reportElems := make(map[string]interface{}) + err = reportcodecv3.ReportTypes.UnpackIntoMap(reportElems, report.([]byte)) + require.NoError(t, err) + + feedID := reportElems["feedId"].([32]uint8) + + if _, exists := seen[feedID]; !exists { + continue // already saw all oracles for this feed + } + + var expectedBm, expectedBid, expectedAsk *big.Int + if feedID == quoteStreamFeedID1 { + expectedBm = quoteStream1.baseBenchmarkPrice.Mul(multiplier).BigInt() + expectedBid = quoteStream1.baseBid.Mul(multiplier).BigInt() + expectedAsk = quoteStream1.baseAsk.Mul(multiplier).BigInt() + } else if feedID == quoteStreamFeedID2 { + expectedBm = quoteStream2.baseBenchmarkPrice.Mul(multiplier).BigInt() + expectedBid = quoteStream2.baseBid.Mul(multiplier).BigInt() + expectedAsk = quoteStream2.baseAsk.Mul(multiplier).BigInt() + } else { + t.Fatalf("unrecognized feedID: 0x%x", feedID) + } + + assert.GreaterOrEqual(t, reportElems["validFromTimestamp"].(uint32), uint32(testStartTimeStamp.Unix())) + assert.GreaterOrEqual(t, int(reportElems["observationsTimestamp"].(uint32)), int(testStartTimeStamp.Unix())) + assert.Equal(t, "33597747607000", reportElems["nativeFee"].(*big.Int).String()) + assert.Equal(t, "7547169811320755", reportElems["linkFee"].(*big.Int).String()) + assert.Equal(t, reportElems["observationsTimestamp"].(uint32)+uint32(expirationWindow), reportElems["expiresAt"].(uint32)) + assert.Equal(t, expectedBm.String(), reportElems["benchmarkPrice"].(*big.Int).String()) + assert.Equal(t, expectedBid.String(), reportElems["bid"].(*big.Int).String()) + assert.Equal(t, expectedAsk.String(), reportElems["ask"].(*big.Int).String()) + + t.Run(fmt.Sprintf("emulate mercury server verifying report (local verification) - node %x", req.pk), func(t *testing.T) { + rv := mercuryverifier.NewVerifier() + + reportSigners, err := rv.Verify(mercuryverifier.SignedReport{ + RawRs: v["rawRs"].([][32]byte), + RawSs: v["rawSs"].([][32]byte), + RawVs: v["rawVs"].([32]byte), + ReportContext: v["reportContext"].([3][32]byte), + Report: v["report"].([]byte), + }, fNodes, signerAddresses) + require.NoError(t, err) + assert.GreaterOrEqual(t, len(reportSigners), int(fNodes+1)) + assert.Subset(t, signerAddresses, reportSigners) + }) + + t.Run(fmt.Sprintf("test on-chain verification - node %x", req.pk), func(t *testing.T) { + _, err = verifierProxy.Verify(steve, req.req.Payload, []byte{}) + require.NoError(t, err) + }) + + t.Logf("oracle %x reported for 0x%x", req.pk, feedID) + + seen[feedID][req.pk] = struct{}{} + if len(seen[feedID]) == nNodes { + t.Logf("all oracles reported for 0x%x", feedID) + delete(seen, feedID) + if len(seen) == 0 { + break // saw all oracles; success! + } + } + } + }) + + t.Run("deleting LLO jobs cleans up resources", func(t *testing.T) { + t.Skip("TODO - https://smartcontract-it.atlassian.net/browse/MERC-3653") + }) }) } diff --git a/core/services/ocr2/plugins/llo/onchain_channel_definition_cache_integration_test.go b/core/services/ocr2/plugins/llo/onchain_channel_definition_cache_integration_test.go index 8529ad89450..ec918e2375d 100644 --- a/core/services/ocr2/plugins/llo/onchain_channel_definition_cache_integration_test.go +++ b/core/services/ocr2/plugins/llo/onchain_channel_definition_cache_integration_test.go @@ -1,18 +1,23 @@ package llo_test import ( - "context" - "math/rand" + "bytes" + "encoding/json" + "errors" + "fmt" + "io" + "math/rand/v2" + "net/http" + "sync" "testing" "time" - "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core" "github.com/ethereum/go-ethereum/eth/ethconfig" - chainselectors "github.com/smartcontractkit/chain-selectors" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "go.uber.org/zap/zapcore" + "golang.org/x/crypto/sha3" "github.com/smartcontractkit/chainlink-common/pkg/services/servicetest" llotypes "github.com/smartcontractkit/chainlink-common/pkg/types/llo" @@ -30,11 +35,101 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/llo" ) +type mockHTTPClient struct { + resp *http.Response + err error + mu sync.Mutex +} + +func (h *mockHTTPClient) Do(req *http.Request) (*http.Response, error) { + h.mu.Lock() + defer h.mu.Unlock() + return h.resp, h.err +} + +func (h *mockHTTPClient) SetResponse(resp *http.Response, err error) { + h.mu.Lock() + defer h.mu.Unlock() + h.resp = resp + h.err = err +} + +type MockReadCloser struct { + data []byte + mu sync.Mutex + reader *bytes.Reader +} + +func NewMockReadCloser(data []byte) *MockReadCloser { + return &MockReadCloser{ + data: data, + reader: bytes.NewReader(data), + } +} + +// Read reads from the underlying data +func (m *MockReadCloser) Read(p []byte) (int, error) { + m.mu.Lock() + defer m.mu.Unlock() + return m.reader.Read(p) +} + +// Close resets the reader to the beginning of the data +func (m *MockReadCloser) Close() error { + m.mu.Lock() + defer m.mu.Unlock() + _, err := m.reader.Seek(0, io.SeekStart) + return err +} + func Test_ChannelDefinitionCache_Integration(t *testing.T) { - lggr, observedLogs := logger.TestLoggerObserved(t, zapcore.InfoLevel) + var ( + invalidDefinitions = []byte(`{{{`) + invalidDefinitionsSHA = sha3.Sum256(invalidDefinitions) + + sampleDefinitions = llotypes.ChannelDefinitions{ + 1: { + ReportFormat: llotypes.ReportFormatJSON, + Streams: []llotypes.Stream{ + { + StreamID: 1, + Aggregator: llotypes.AggregatorMedian, + }, + { + StreamID: 2, + Aggregator: llotypes.AggregatorMode, + }, + }, + }, + 2: { + ReportFormat: llotypes.ReportFormatEVMPremiumLegacy, + Streams: []llotypes.Stream{ + { + StreamID: 1, + Aggregator: llotypes.AggregatorMedian, + }, + { + StreamID: 2, + Aggregator: llotypes.AggregatorMedian, + }, + { + StreamID: 3, + Aggregator: llotypes.AggregatorQuote, + }, + }, + Opts: llotypes.ChannelOpts([]byte(`{"baseUSDFee":"0.1","expirationWindow":86400,"feedId":"0x0003aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","multiplier":"1000000000000000000"}`)), + }, + } + ) + + sampleDefinitionsJSON, err := json.MarshalIndent(sampleDefinitions, "", " ") + require.NoError(t, err) + sampleDefinitionsSHA := sha3.Sum256(sampleDefinitionsJSON) + + lggr, observedLogs := logger.TestLoggerObserved(t, zapcore.DebugLevel) db := pgtest.NewSqlxDB(t) - ctx := testutils.Context(t) - orm := llo.NewORM(db, testutils.SimulatedChainID) + const ETHMainnetChainSelector uint64 = 5009297550715157269 + orm := llo.NewORM(db, ETHMainnetChainSelector) steve := testutils.MustNewSimTransactor(t) // config contract deployer and owner genesisData := core.GenesisAlloc{steve.From: {Balance: assets.Ether(1000).ToInt()}} @@ -46,194 +141,228 @@ func Test_ChannelDefinitionCache_Integration(t *testing.T) { configStoreAddress, _, configStoreContract, err := channel_config_store.DeployChannelConfigStore(steve, backend) require.NoError(t, err) - channel1 := rand.Uint32() - channel2 := rand.Uint32() - channel3 := rand.Uint32() + lpOpts := logpoller.Opts{ + PollPeriod: 100 * time.Millisecond, + FinalityDepth: 1, + BackfillBatchSize: 3, + RpcBatchSize: 2, + KeepFinalizedBlocksDepth: 1000, + } + ht := headtracker.NewSimulatedHeadTracker(ethClient, lpOpts.UseFinalityTag, lpOpts.FinalityDepth) + lp := logpoller.NewLogPoller( + logpoller.NewORM(testutils.SimulatedChainID, db, lggr), ethClient, lggr, ht, lpOpts) + servicetest.Run(t, lp) - chainSelector, err := chainselectors.SelectorFromChainId(testutils.SimulatedChainID.Uint64()) - require.NoError(t, err) + client := &mockHTTPClient{} + donID := rand.Uint32() - streamIDs := []uint32{1, 2, 3} - channel1Def := channel_config_store.IChannelConfigStoreChannelDefinition{ - ReportFormat: uint32(llotypes.ReportFormatSolana), - ChainSelector: chainSelector, - StreamIDs: streamIDs, - } - channel2Def := channel_config_store.IChannelConfigStoreChannelDefinition{ - ReportFormat: uint32(llotypes.ReportFormatEVM), - ChainSelector: chainSelector, - StreamIDs: streamIDs, - } - channel3Def := channel_config_store.IChannelConfigStoreChannelDefinition{ - ReportFormat: uint32(llotypes.ReportFormatEVM), - ChainSelector: chainSelector, - StreamIDs: append(streamIDs, 4), + cdc := llo.NewChannelDefinitionCache(lggr, orm, client, lp, configStoreAddress, donID, 0, llo.WithLogPollInterval(100*time.Millisecond)) + servicetest.Run(t, cdc) + + t.Run("before any logs, returns empty Definitions", func(t *testing.T) { + assert.Empty(t, cdc.Definitions()) + }) + + { + rc := NewMockReadCloser(invalidDefinitions) + client.SetResponse(&http.Response{ + StatusCode: 200, + Body: rc, + }, nil) + + url := "http://example.com/foo" + require.NoError(t, utils.JustError(configStoreContract.SetChannelDefinitions(steve, donID, url, sampleDefinitionsSHA))) + + backend.Commit() } - require.NoError(t, utils.JustError(configStoreContract.AddChannel(steve, channel1, channel1Def))) - require.NoError(t, utils.JustError(configStoreContract.AddChannel(steve, channel2, channel2Def))) + t.Run("with sha mismatch, should not update", func(t *testing.T) { + // clear the log messages + t.Cleanup(func() { observedLogs.TakeAll() }) - h := backend.Commit() - channel2Block, err := backend.BlockByHash(ctx, h) - require.NoError(t, err) + testutils.WaitForLogMessage(t, observedLogs, "Got new channel definitions from chain") + le := testutils.WaitForLogMessage(t, observedLogs, "Error while fetching channel definitions") + fields := le.ContextMap() + assert.Contains(t, fields, "err") + assert.Equal(t, fmt.Sprintf("SHA3 mismatch: expected %x, got %x", sampleDefinitionsSHA, invalidDefinitionsSHA), fields["err"]) - t.Run("with zero fromblock", func(t *testing.T) { - lpOpts := logpoller.Opts{ - PollPeriod: 100 * time.Millisecond, - FinalityDepth: 1, - BackfillBatchSize: 3, - RpcBatchSize: 2, - KeepFinalizedBlocksDepth: 1000, - } - ht := headtracker.NewSimulatedHeadTracker(ethClient, lpOpts.UseFinalityTag, lpOpts.FinalityDepth) - lp := logpoller.NewLogPoller( - logpoller.NewORM(testutils.SimulatedChainID, db, lggr), ethClient, lggr, ht, lpOpts) - servicetest.Run(t, lp) - cdc := llo.NewChannelDefinitionCache(lggr, orm, lp, configStoreAddress, 0) - - servicetest.Run(t, cdc) - - testutils.WaitForLogMessage(t, observedLogs, "Updated channel definitions") - - dfns := cdc.Definitions() - - require.Len(t, dfns, 2) - require.Contains(t, dfns, channel1) - require.Contains(t, dfns, channel2) - assert.Equal(t, llotypes.ChannelDefinition{ - ReportFormat: llotypes.ReportFormatSolana, - ChainSelector: chainSelector, - StreamIDs: []uint32{1, 2, 3}, - }, dfns[channel1]) - assert.Equal(t, llotypes.ChannelDefinition{ - ReportFormat: llotypes.ReportFormatEVM, - ChainSelector: chainSelector, - StreamIDs: []uint32{1, 2, 3}, - }, dfns[channel2]) - - // remove solana - require.NoError(t, utils.JustError(configStoreContract.RemoveChannel(steve, channel1))) + assert.Empty(t, cdc.Definitions()) + }) + + { + rc := NewMockReadCloser(invalidDefinitions) + client.SetResponse(&http.Response{ + StatusCode: 200, + Body: rc, + }, nil) + + url := "http://example.com/foo" + require.NoError(t, utils.JustError(configStoreContract.SetChannelDefinitions(steve, donID, url, invalidDefinitionsSHA))) backend.Commit() - testutils.WaitForLogMessageCount(t, observedLogs, "Updated channel definitions", 2) - dfns = cdc.Definitions() + } + + t.Run("after correcting sha with new channel definitions set on-chain, but with invalid JSON at url, should not update", func(t *testing.T) { + // clear the log messages + t.Cleanup(func() { observedLogs.TakeAll() }) - require.Len(t, dfns, 1) - assert.NotContains(t, dfns, channel1) - require.Contains(t, dfns, channel2) + testutils.WaitForLogMessage(t, observedLogs, "Got new channel definitions from chain") + testutils.WaitForLogMessageWithField(t, observedLogs, "Error while fetching channel definitions", "err", "failed to decode JSON: invalid character '{' looking for beginning of object key string") + + assert.Empty(t, cdc.Definitions()) + }) - assert.Equal(t, llotypes.ChannelDefinition{ - ReportFormat: llotypes.ReportFormatEVM, - ChainSelector: chainSelector, - StreamIDs: []uint32{1, 2, 3}, - }, dfns[channel2]) + { + rc := NewMockReadCloser([]byte("not found")) + client.SetResponse(&http.Response{ + StatusCode: 404, + Body: rc, + }, nil) - // add channel3 with additional stream - require.NoError(t, utils.JustError(configStoreContract.AddChannel(steve, channel3, channel3Def))) + url := "http://example.com/foo3" + require.NoError(t, utils.JustError(configStoreContract.SetChannelDefinitions(steve, donID, url, sampleDefinitionsSHA))) backend.Commit() - testutils.WaitForLogMessageCount(t, observedLogs, "Updated channel definitions", 3) - dfns = cdc.Definitions() - - require.Len(t, dfns, 2) - require.Contains(t, dfns, channel2) - require.Contains(t, dfns, channel3) - - assert.Equal(t, llotypes.ChannelDefinition{ - ReportFormat: llotypes.ReportFormatEVM, - ChainSelector: chainSelector, - StreamIDs: []uint32{1, 2, 3}, - }, dfns[channel2]) - assert.Equal(t, llotypes.ChannelDefinition{ - ReportFormat: llotypes.ReportFormatEVM, - ChainSelector: chainSelector, - StreamIDs: []uint32{1, 2, 3, 4}, - }, dfns[channel3]) + } + + t.Run("if server returns 404, should not update", func(t *testing.T) { + // clear the log messages + t.Cleanup(func() { observedLogs.TakeAll() }) + + testutils.WaitForLogMessageWithField(t, observedLogs, "Error while fetching channel definitions", "err", "got error from http://example.com/foo3: (status code: 404, response body: not found)") }) - t.Run("loads from ORM", func(t *testing.T) { - // Override logpoller to always return no logs - lpOpts := logpoller.Opts{ - PollPeriod: 100 * time.Millisecond, - FinalityDepth: 1, - BackfillBatchSize: 3, - RpcBatchSize: 2, - KeepFinalizedBlocksDepth: 1000, - } - ht := headtracker.NewSimulatedHeadTracker(ethClient, lpOpts.UseFinalityTag, lpOpts.FinalityDepth) - lp := &mockLogPoller{ - LogPoller: logpoller.NewLogPoller(logpoller.NewORM(testutils.SimulatedChainID, db, lggr), ethClient, lggr, ht, lpOpts), - LatestBlockFn: func(ctx context.Context) (int64, error) { - return 0, nil - }, - LogsWithSigsFn: func(ctx context.Context, start, end int64, eventSigs []common.Hash, address common.Address) ([]logpoller.Log, error) { - return []logpoller.Log{}, nil - }, - } - cdc := llo.NewChannelDefinitionCache(lggr, orm, lp, configStoreAddress, 0) - - servicetest.Run(t, cdc) - - dfns := cdc.Definitions() - - require.Len(t, dfns, 2) - require.Contains(t, dfns, channel2) - require.Contains(t, dfns, channel3) - - assert.Equal(t, llotypes.ChannelDefinition{ - ReportFormat: llotypes.ReportFormatEVM, - ChainSelector: chainSelector, - StreamIDs: []uint32{1, 2, 3}, - }, dfns[channel2]) - assert.Equal(t, llotypes.ChannelDefinition{ - ReportFormat: llotypes.ReportFormatEVM, - ChainSelector: chainSelector, - StreamIDs: []uint32{1, 2, 3, 4}, - }, dfns[channel3]) + { + rc := NewMockReadCloser([]byte{}) + client.SetResponse(&http.Response{ + StatusCode: 200, + Body: rc, + }, nil) + } + + t.Run("if server starts returning empty body, still does not update", func(t *testing.T) { + // clear the log messages + t.Cleanup(func() { observedLogs.TakeAll() }) + + testutils.WaitForLogMessageWithField(t, observedLogs, "Error while fetching channel definitions", "err", fmt.Sprintf("SHA3 mismatch: expected %x, got %x", sampleDefinitionsSHA, sha3.Sum256([]byte{}))) }) - // clear out DB for next test - pgtest.MustExec(t, db, `DELETE FROM channel_definitions`) + { + rc := NewMockReadCloser(sampleDefinitionsJSON) + client.SetResponse(&http.Response{ + StatusCode: 200, + Body: rc, + }, nil) + } - t.Run("with non-zero fromBlock", func(t *testing.T) { - lpOpts := logpoller.Opts{ - PollPeriod: 100 * time.Millisecond, - FinalityDepth: 1, - BackfillBatchSize: 3, - RpcBatchSize: 2, - KeepFinalizedBlocksDepth: 1000, - } - ht := headtracker.NewSimulatedHeadTracker(ethClient, lpOpts.UseFinalityTag, lpOpts.FinalityDepth) - lp := logpoller.NewLogPoller(logpoller.NewORM(testutils.SimulatedChainID, db, lggr), ethClient, lggr, ht, lpOpts) - servicetest.Run(t, lp) - cdc := llo.NewChannelDefinitionCache(lggr, orm, lp, configStoreAddress, channel2Block.Number().Int64()+1) + t.Run("when URL starts returning valid JSON, updates even without needing new logs", func(t *testing.T) { + // clear the log messages + t.Cleanup(func() { observedLogs.TakeAll() }) + + le := testutils.WaitForLogMessage(t, observedLogs, "Set new channel definitions") + fields := le.ContextMap() + assert.Contains(t, fields, "version") + assert.Contains(t, fields, "url") + assert.Contains(t, fields, "sha") + assert.Contains(t, fields, "donID") + assert.NotContains(t, fields, "err") + + assert.Equal(t, uint32(3), fields["version"]) + assert.Equal(t, "http://example.com/foo3", fields["url"]) + assert.Equal(t, fmt.Sprintf("%x", sampleDefinitionsSHA), fields["sha"]) + assert.Equal(t, donID, fields["donID"]) + + assert.Equal(t, sampleDefinitions, cdc.Definitions()) + + t.Run("latest channel definitions are persisted", func(t *testing.T) { + pd, err := orm.LoadChannelDefinitions(testutils.Context(t), configStoreAddress, donID) + require.NoError(t, err) + assert.Equal(t, ETHMainnetChainSelector, pd.ChainSelector) + assert.Equal(t, configStoreAddress, pd.Address) + assert.Equal(t, sampleDefinitions, pd.Definitions) + assert.Equal(t, donID, pd.DonID) + assert.Equal(t, uint32(3), pd.Version) + }) + + t.Run("new cdc with same config should load from DB", func(t *testing.T) { + // fromBlock far in the future to ensure logs are not used + cdc2 := llo.NewChannelDefinitionCache(lggr, orm, client, lp, configStoreAddress, donID, 1000) + servicetest.Run(t, cdc2) + + assert.Equal(t, sampleDefinitions, cdc.Definitions()) + }) + }) - // should only detect events from AFTER channel 2 was added - servicetest.Run(t, cdc) + { + url := "not a real URL" + require.NoError(t, utils.JustError(configStoreContract.SetChannelDefinitions(steve, donID, url, sampleDefinitionsSHA))) - testutils.WaitForLogMessageCount(t, observedLogs, "Updated channel definitions", 4) + backend.Commit() - dfns := cdc.Definitions() + client.SetResponse(nil, errors.New("failed; not a real URL")) + } - require.Len(t, dfns, 1) - require.Contains(t, dfns, channel3) + t.Run("new log with invalid channel definitions URL does not affect old channel definitions", func(t *testing.T) { + // clear the log messages + t.Cleanup(func() { observedLogs.TakeAll() }) - assert.Equal(t, llotypes.ChannelDefinition{ - ReportFormat: llotypes.ReportFormatEVM, - ChainSelector: chainSelector, - StreamIDs: []uint32{1, 2, 3, 4}, - }, dfns[channel3]) + le := testutils.WaitForLogMessage(t, observedLogs, "Error while fetching channel definitions") + fields := le.ContextMap() + assert.Contains(t, fields, "err") + assert.Equal(t, "error making http request: failed; not a real URL", fields["err"]) }) -} -type mockLogPoller struct { - logpoller.LogPoller - LatestBlockFn func(ctx context.Context) (int64, error) - LogsWithSigsFn func(ctx context.Context, start, end int64, eventSigs []common.Hash, address common.Address) ([]logpoller.Log, error) -} + { + // add a new definition, it should get loaded + sampleDefinitions[3] = llotypes.ChannelDefinition{ + ReportFormat: llotypes.ReportFormatJSON, + Streams: []llotypes.Stream{ + { + StreamID: 6, + Aggregator: llotypes.AggregatorMedian, + }, + }, + } + var err error + sampleDefinitionsJSON, err = json.MarshalIndent(sampleDefinitions, "", " ") + require.NoError(t, err) + sampleDefinitionsSHA = sha3.Sum256(sampleDefinitionsJSON) + rc := NewMockReadCloser(sampleDefinitionsJSON) + client.SetResponse(&http.Response{ + StatusCode: 200, + Body: rc, + }, nil) + + url := "http://example.com/foo5" + require.NoError(t, utils.JustError(configStoreContract.SetChannelDefinitions(steve, donID, url, sampleDefinitionsSHA))) -func (p *mockLogPoller) LogsWithSigs(ctx context.Context, start, end int64, eventSigs []common.Hash, address common.Address) ([]logpoller.Log, error) { - return p.LogsWithSigsFn(ctx, start, end, eventSigs, address) -} -func (p *mockLogPoller) LatestBlock(ctx context.Context) (logpoller.LogPollerBlock, error) { - block, err := p.LatestBlockFn(ctx) - return logpoller.LogPollerBlock{BlockNumber: block}, err + backend.Commit() + } + + t.Run("successfully updates to new channel definitions with new log", func(t *testing.T) { + t.Cleanup(func() { observedLogs.TakeAll() }) + + le := testutils.WaitForLogMessage(t, observedLogs, "Set new channel definitions") + fields := le.ContextMap() + assert.Contains(t, fields, "version") + assert.Contains(t, fields, "url") + assert.Contains(t, fields, "sha") + assert.Contains(t, fields, "donID") + assert.NotContains(t, fields, "err") + + assert.Equal(t, uint32(5), fields["version"]) + assert.Equal(t, "http://example.com/foo5", fields["url"]) + assert.Equal(t, fmt.Sprintf("%x", sampleDefinitionsSHA), fields["sha"]) + assert.Equal(t, donID, fields["donID"]) + + assert.Equal(t, sampleDefinitions, cdc.Definitions()) + }) + + t.Run("latest channel definitions are persisted and overwrite previous value", func(t *testing.T) { + pd, err := orm.LoadChannelDefinitions(testutils.Context(t), configStoreAddress, donID) + require.NoError(t, err) + assert.Equal(t, ETHMainnetChainSelector, pd.ChainSelector) + assert.Equal(t, configStoreAddress, pd.Address) + assert.Equal(t, sampleDefinitions, pd.Definitions) + assert.Equal(t, donID, pd.DonID) + assert.Equal(t, uint32(5), pd.Version) + }) } diff --git a/core/services/ocr2/plugins/median/services.go b/core/services/ocr2/plugins/median/services.go index 897531b82fb..866044fcc92 100644 --- a/core/services/ocr2/plugins/median/services.go +++ b/core/services/ocr2/plugins/median/services.go @@ -167,11 +167,11 @@ func NewMedianServices(ctx context.Context, abort() return } - median := loop.NewMedianService(lggr, telem, cmdFn, medianProvider, dataSource, juelsPerFeeCoinSource, gasPriceSubunitsDataSource, errorLog) + median := loop.NewMedianService(lggr, telem, cmdFn, medianProvider, spec.ContractID, dataSource, juelsPerFeeCoinSource, gasPriceSubunitsDataSource, errorLog) argsNoPlugin.ReportingPluginFactory = median srvs = append(srvs, median) } else { - argsNoPlugin.ReportingPluginFactory, err = median.NewPlugin(lggr).NewMedianFactory(ctx, medianProvider, dataSource, juelsPerFeeCoinSource, gasPriceSubunitsDataSource, errorLog) + argsNoPlugin.ReportingPluginFactory, err = median.NewPlugin(lggr).NewMedianFactory(ctx, medianProvider, spec.ContractID, dataSource, juelsPerFeeCoinSource, gasPriceSubunitsDataSource, errorLog) if err != nil { err = fmt.Errorf("failed to create median factory: %w", err) abort() diff --git a/core/services/ocr2/plugins/mercury/config/config.go b/core/services/ocr2/plugins/mercury/config/config.go index 5763b883ac0..40854bd8c0a 100644 --- a/core/services/ocr2/plugins/mercury/config/config.go +++ b/core/services/ocr2/plugins/mercury/config/config.go @@ -108,7 +108,7 @@ func ValidatePluginConfig(config PluginConfig, feedID mercuryutils.FeedID) (merr if config.NativeFeedID != nil { merr = errors.Join(merr, errors.New("nativeFeedID may not be specified for v1 jobs")) } - case 2, 3: + case 2, 3, 4: if config.LinkFeedID == nil { merr = errors.Join(merr, fmt.Errorf("linkFeedID must be specified for v%d jobs", feedID.Version())) } @@ -119,7 +119,7 @@ func ValidatePluginConfig(config PluginConfig, feedID mercuryutils.FeedID) (merr merr = errors.Join(merr, fmt.Errorf("initialBlockNumber may not be specified for v%d jobs", feedID.Version())) } default: - merr = errors.Join(merr, fmt.Errorf("got unsupported schema version %d; supported versions are 1,2,3", feedID.Version())) + merr = errors.Join(merr, fmt.Errorf("got unsupported schema version %d; supported versions are 1,2,3,4", feedID.Version())) } return merr diff --git a/core/services/ocr2/plugins/mercury/helpers_test.go b/core/services/ocr2/plugins/mercury/helpers_test.go index 43d709453b7..48d320c8de1 100644 --- a/core/services/ocr2/plugins/mercury/helpers_test.go +++ b/core/services/ocr2/plugins/mercury/helpers_test.go @@ -27,9 +27,9 @@ import ( ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" commonconfig "github.com/smartcontractkit/chainlink-common/pkg/config" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils" "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" - "github.com/smartcontractkit/chainlink/v2/core/internal/cltest/heavyweight" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/keystest" "github.com/smartcontractkit/chainlink/v2/core/logger" @@ -42,6 +42,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/ocrbootstrap" "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury" "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury/wsrpc/pb" + "github.com/smartcontractkit/chainlink/v2/core/utils/testutils/heavyweight" ) var _ pb.MercuryServer = &mercuryServer{} @@ -103,7 +104,7 @@ func startMercuryServer(t *testing.T, srv *mercuryServer, pubKeys []ed25519.Publ t.Fatalf("[MAIN] failed to listen: %v", err) } serverURL = lis.Addr().String() - s := wsrpc.NewServer(wsrpc.Creds(srv.privKey, pubKeys)) + s := wsrpc.NewServer(wsrpc.WithCreds(srv.privKey, pubKeys)) // Register mercury implementation with the wsrpc server pb.RegisterMercuryServer(s, srv) @@ -121,6 +122,7 @@ type Feed struct { baseBenchmarkPrice *big.Int baseBid *big.Int baseAsk *big.Int + baseMarketStatus uint32 } func randomFeedID(version uint16) [32]byte { @@ -467,3 +469,79 @@ chainID = 1337 nativeFeedID, )) } + +func addV4MercuryJob( + t *testing.T, + node Node, + i int, + verifierAddress common.Address, + bootstrapPeerID string, + bootstrapNodePort int, + bmBridge, + marketStatusBridge string, + servers map[string]string, + clientPubKey ed25519.PublicKey, + feedName string, + feedID [32]byte, + linkFeedID [32]byte, + nativeFeedID [32]byte, +) { + srvs := make([]string, 0, len(servers)) + for u, k := range servers { + srvs = append(srvs, fmt.Sprintf("%q = %q", u, k)) + } + serversStr := fmt.Sprintf("{ %s }", strings.Join(srvs, ", ")) + + node.AddJob(t, fmt.Sprintf(` +type = "offchainreporting2" +schemaVersion = 1 +name = "mercury-%[1]d-%[9]s" +forwardingAllowed = false +maxTaskDuration = "1s" +contractID = "%[2]s" +feedID = "0x%[8]x" +contractConfigTrackerPollInterval = "1s" +ocrKeyBundleID = "%[3]s" +p2pv2Bootstrappers = [ + "%[4]s" +] +relay = "evm" +pluginType = "mercury" +transmitterID = "%[7]x" +observationSource = """ + // Benchmark Price + price1 [type=bridge name="%[5]s" timeout="50ms" requestData="{\\"data\\":{\\"from\\":\\"ETH\\",\\"to\\":\\"USD\\"}}"]; + price1_parse [type=jsonparse path="result"]; + price1_multiply [type=multiply times=100000000 index=0]; + + price1 -> price1_parse -> price1_multiply; + + // Market Status + marketstatus [type=bridge name="%[12]s" timeout="50ms" requestData="{\\"data\\":{\\"from\\":\\"ETH\\",\\"to\\":\\"USD\\"}}"]; + marketstatus_parse [type=jsonparse path="result" index=1]; + + marketstatus -> marketstatus_parse; +""" + +[pluginConfig] +servers = %[6]s +linkFeedID = "0x%[10]x" +nativeFeedID = "0x%[11]x" + +[relayConfig] +chainID = 1337 + `, + i, + verifierAddress, + node.KeyBundle.ID(), + fmt.Sprintf("%s@127.0.0.1:%d", bootstrapPeerID, bootstrapNodePort), + bmBridge, + serversStr, + clientPubKey, + feedID, + feedName, + linkFeedID, + nativeFeedID, + marketStatusBridge, + )) +} diff --git a/core/services/ocr2/plugins/mercury/integration_test.go b/core/services/ocr2/plugins/mercury/integration_test.go index 832a39237ee..a8d49150b8a 100644 --- a/core/services/ocr2/plugins/mercury/integration_test.go +++ b/core/services/ocr2/plugins/mercury/integration_test.go @@ -24,25 +24,24 @@ import ( "github.com/ethereum/go-ethereum/eth/ethconfig" "github.com/hashicorp/consul/sdk/freeport" "github.com/shopspring/decimal" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "go.uber.org/zap/zapcore" - "go.uber.org/zap/zaptest/observer" - "github.com/smartcontractkit/libocr/offchainreporting2plus/confighelper" "github.com/smartcontractkit/libocr/offchainreporting2plus/ocr3confighelper" ocr2types "github.com/smartcontractkit/libocr/offchainreporting2plus/types" "github.com/smartcontractkit/wsrpc/credentials" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "go.uber.org/zap/zapcore" + "go.uber.org/zap/zaptest/observer" mercurytypes "github.com/smartcontractkit/chainlink-common/pkg/types/mercury" v1 "github.com/smartcontractkit/chainlink-common/pkg/types/mercury/v1" v2 "github.com/smartcontractkit/chainlink-common/pkg/types/mercury/v2" v3 "github.com/smartcontractkit/chainlink-common/pkg/types/mercury/v3" + v4 "github.com/smartcontractkit/chainlink-common/pkg/types/mercury/v4" datastreamsmercury "github.com/smartcontractkit/chainlink-data-streams/mercury" - "github.com/smartcontractkit/chainlink/v2/core/bridges" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" - token "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/link_token_interface" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/link_token_interface" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/llo-feeds/generated/fee_manager" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/llo-feeds/generated/reward_manager" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/llo-feeds/generated/verifier" @@ -56,6 +55,7 @@ import ( reportcodecv1 "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury/v1/reportcodec" reportcodecv2 "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury/v2/reportcodec" reportcodecv3 "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury/v3/reportcodec" + reportcodecv4 "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury/v4/reportcodec" "github.com/smartcontractkit/chainlink/v2/core/store/models" ) @@ -98,11 +98,11 @@ func setupBlockchain(t *testing.T) (*bind.TransactOpts, *backends.SimulatedBacke t.Cleanup(stopMining) // Deploy contracts - linkTokenAddress, _, linkToken, err := token.DeployLinkToken(steve, backend) + linkTokenAddress, _, linkToken, err := link_token_interface.DeployLinkToken(steve, backend) require.NoError(t, err) _, err = linkToken.Transfer(steve, steve.From, big.NewInt(1000)) require.NoError(t, err) - nativeTokenAddress, _, nativeToken, err := token.DeployLinkToken(steve, backend) + nativeTokenAddress, _, nativeToken, err := link_token_interface.DeployLinkToken(steve, backend) require.NoError(t, err) _, err = nativeToken.Transfer(steve, steve.From, big.NewInt(1000)) require.NoError(t, err) @@ -146,9 +146,9 @@ func integration_MercuryV1(t *testing.T) { pError := atomic.Int64{} // feeds - btcFeed := Feed{"BTC/USD", randomFeedID(1), big.NewInt(20_000 * multiplier), big.NewInt(19_997 * multiplier), big.NewInt(20_004 * multiplier)} - ethFeed := Feed{"ETH/USD", randomFeedID(1), big.NewInt(1_568 * multiplier), big.NewInt(1_566 * multiplier), big.NewInt(1_569 * multiplier)} - linkFeed := Feed{"LINK/USD", randomFeedID(1), big.NewInt(7150 * multiplier / 1000), big.NewInt(7123 * multiplier / 1000), big.NewInt(7177 * multiplier / 1000)} + btcFeed := Feed{"BTC/USD", randomFeedID(1), big.NewInt(20_000 * multiplier), big.NewInt(19_997 * multiplier), big.NewInt(20_004 * multiplier), 0} + ethFeed := Feed{"ETH/USD", randomFeedID(1), big.NewInt(1_568 * multiplier), big.NewInt(1_566 * multiplier), big.NewInt(1_569 * multiplier), 0} + linkFeed := Feed{"LINK/USD", randomFeedID(1), big.NewInt(7150 * multiplier / 1000), big.NewInt(7123 * multiplier / 1000), big.NewInt(7177 * multiplier / 1000), 0} feeds := []Feed{btcFeed, ethFeed, linkFeed} feedM := make(map[[32]byte]Feed, len(feeds)) for i := range feeds { @@ -1036,3 +1036,302 @@ func integration_MercuryV3(t *testing.T) { } }) } + +func TestIntegration_MercuryV4(t *testing.T) { + t.Parallel() + + integration_MercuryV4(t) +} + +func integration_MercuryV4(t *testing.T) { + ctx := testutils.Context(t) + var logObservers []*observer.ObservedLogs + t.Cleanup(func() { + detectPanicLogs(t, logObservers) + }) + + testStartTimeStamp := uint32(time.Now().Unix()) + + // test vars + // pError is the probability that an EA will return an error instead of a result, as integer percentage + // pError = 0 means it will never return error + pError := atomic.Int64{} + + // feeds + btcFeed := Feed{ + name: "BTC/USD", + id: randomFeedID(4), + baseBenchmarkPrice: big.NewInt(20_000 * multiplier), + baseBid: big.NewInt(19_997 * multiplier), + baseAsk: big.NewInt(20_004 * multiplier), + baseMarketStatus: 1, + } + ethFeed := Feed{ + name: "ETH/USD", + id: randomFeedID(4), + baseBenchmarkPrice: big.NewInt(1_568 * multiplier), + baseBid: big.NewInt(1_566 * multiplier), + baseAsk: big.NewInt(1_569 * multiplier), + baseMarketStatus: 2, + } + linkFeed := Feed{ + name: "LINK/USD", + id: randomFeedID(4), + baseBenchmarkPrice: big.NewInt(7150 * multiplier / 1000), + baseBid: big.NewInt(7123 * multiplier / 1000), + baseAsk: big.NewInt(7177 * multiplier / 1000), + baseMarketStatus: 3, + } + feeds := []Feed{btcFeed, ethFeed, linkFeed} + feedM := make(map[[32]byte]Feed, len(feeds)) + for i := range feeds { + feedM[feeds[i].id] = feeds[i] + } + + clientCSAKeys := make([]csakey.KeyV2, n+1) + clientPubKeys := make([]ed25519.PublicKey, n+1) + for i := 0; i < n+1; i++ { + k := big.NewInt(int64(i)) + key := csakey.MustNewV2XXXTestingOnly(k) + clientCSAKeys[i] = key + clientPubKeys[i] = key.PublicKey + } + + // Test multi-send to three servers + const nSrvs = 3 + reqChs := make([]chan request, nSrvs) + servers := make(map[string]string) + for i := 0; i < nSrvs; i++ { + k := csakey.MustNewV2XXXTestingOnly(big.NewInt(int64(-(i + 1)))) + reqs := make(chan request, 100) + srv := NewMercuryServer(t, ed25519.PrivateKey(k.Raw()), reqs, func() []byte { + report, err := (&reportcodecv4.ReportCodec{}).BuildReport(v4.ReportFields{BenchmarkPrice: big.NewInt(234567), LinkFee: big.NewInt(1), NativeFee: big.NewInt(1), MarketStatus: 1}) + if err != nil { + panic(err) + } + return report + }) + serverURL := startMercuryServer(t, srv, clientPubKeys) + reqChs[i] = reqs + servers[serverURL] = fmt.Sprintf("%x", k.PublicKey) + } + chainID := testutils.SimulatedChainID + + steve, backend, verifier, verifierAddress := setupBlockchain(t) + + // Setup bootstrap + oracle nodes + bootstrapNodePort := freeport.GetOne(t) + appBootstrap, bootstrapPeerID, _, bootstrapKb, observedLogs := setupNode(t, bootstrapNodePort, "bootstrap_mercury", backend, clientCSAKeys[n]) + bootstrapNode := Node{App: appBootstrap, KeyBundle: bootstrapKb} + logObservers = append(logObservers, observedLogs) + + // Commit blocks to finality depth to ensure LogPoller has finalized blocks to read from + ch, err := bootstrapNode.App.GetRelayers().LegacyEVMChains().Get(testutils.SimulatedChainID.String()) + require.NoError(t, err) + finalityDepth := ch.Config().EVM().FinalityDepth() + for i := 0; i < int(finalityDepth); i++ { + backend.Commit() + } + + // Set up n oracles + var ( + oracles []confighelper.OracleIdentityExtra + nodes []Node + ) + ports := freeport.GetN(t, n) + for i := 0; i < n; i++ { + app, peerID, transmitter, kb, observedLogs := setupNode(t, ports[i], fmt.Sprintf("oracle_mercury%d", i), backend, clientCSAKeys[i]) + + nodes = append(nodes, Node{ + app, transmitter, kb, + }) + + offchainPublicKey, _ := hex.DecodeString(strings.TrimPrefix(kb.OnChainPublicKey(), "0x")) + oracles = append(oracles, confighelper.OracleIdentityExtra{ + OracleIdentity: confighelper.OracleIdentity{ + OnchainPublicKey: offchainPublicKey, + TransmitAccount: ocr2types.Account(fmt.Sprintf("%x", transmitter[:])), + OffchainPublicKey: kb.OffchainPublicKey(), + PeerID: peerID, + }, + ConfigEncryptionPublicKey: kb.ConfigEncryptionPublicKey(), + }) + logObservers = append(logObservers, observedLogs) + } + + for _, feed := range feeds { + addBootstrapJob(t, bootstrapNode, chainID, verifierAddress, feed.name, feed.id) + } + + createBridge := func(name string, i int, p *big.Int, marketStatus uint32, borm bridges.ORM) (bridgeName string) { + bridge := httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) { + b, herr := io.ReadAll(req.Body) + require.NoError(t, herr) + require.Equal(t, `{"data":{"from":"ETH","to":"USD"}}`, string(b)) + + r := rand.Int63n(101) + if r > pError.Load() { + res.WriteHeader(http.StatusOK) + + var val string + if p != nil { + val = decimal.NewFromBigInt(p, 0).Div(decimal.NewFromInt(multiplier)).Add(decimal.NewFromInt(int64(i)).Div(decimal.NewFromInt(100))).String() + } else { + val = fmt.Sprintf("%d", marketStatus) + } + + resp := fmt.Sprintf(`{"result": %s}`, val) + _, herr = res.Write([]byte(resp)) + require.NoError(t, herr) + } else { + res.WriteHeader(http.StatusInternalServerError) + resp := `{"error": "pError test error"}` + _, herr = res.Write([]byte(resp)) + require.NoError(t, herr) + } + })) + t.Cleanup(bridge.Close) + u, _ := url.Parse(bridge.URL) + bridgeName = fmt.Sprintf("bridge-%s-%d", name, i) + require.NoError(t, borm.CreateBridgeType(ctx, &bridges.BridgeType{ + Name: bridges.BridgeName(bridgeName), + URL: models.WebURL(*u), + })) + + return bridgeName + } + + // Add OCR jobs - one per feed on each node + for i, node := range nodes { + for j, feed := range feeds { + bmBridge := createBridge(fmt.Sprintf("benchmarkprice-%d", j), i, feed.baseBenchmarkPrice, 0, node.App.BridgeORM()) + marketStatusBridge := createBridge(fmt.Sprintf("marketstatus-%d", j), i, nil, feed.baseMarketStatus, node.App.BridgeORM()) + + addV4MercuryJob( + t, + node, + i, + verifierAddress, + bootstrapPeerID, + bootstrapNodePort, + bmBridge, + marketStatusBridge, + servers, + clientPubKeys[i], + feed.name, + feed.id, + randomFeedID(2), + randomFeedID(2), + ) + } + } + + // Setup config on contract + onchainConfig, err := (datastreamsmercury.StandardOnchainConfigCodec{}).Encode(rawOnchainConfig) + require.NoError(t, err) + + reportingPluginConfig, err := json.Marshal(rawReportingPluginConfig) + require.NoError(t, err) + + signers, _, _, onchainConfig, offchainConfigVersion, offchainConfig, err := ocr3confighelper.ContractSetConfigArgsForTestsMercuryV02( + 2*time.Second, // DeltaProgress + 20*time.Second, // DeltaResend + 400*time.Millisecond, // DeltaInitial + 100*time.Millisecond, // DeltaRound + 0, // DeltaGrace + 300*time.Millisecond, // DeltaCertifiedCommitRequest + 1*time.Minute, // DeltaStage + 100, // rMax + []int{len(nodes)}, // S + oracles, + reportingPluginConfig, // reportingPluginConfig []byte, + 250*time.Millisecond, // Max duration observation + int(f), // f + onchainConfig, + ) + + require.NoError(t, err) + signerAddresses, err := evm.OnchainPublicKeyToAddress(signers) + require.NoError(t, err) + + offchainTransmitters := make([][32]byte, n) + for i := 0; i < n; i++ { + offchainTransmitters[i] = nodes[i].ClientPubKey + } + + for _, feed := range feeds { + _, ferr := verifier.SetConfig( + steve, + feed.id, + signerAddresses, + offchainTransmitters, + f, + onchainConfig, + offchainConfigVersion, + offchainConfig, + nil, + ) + require.NoError(t, ferr) + backend.Commit() + } + + runTestSetup := func(reqs chan request) { + // Expect at least one report per feed from each oracle, per server + seen := make(map[[32]byte]map[credentials.StaticSizedPublicKey]struct{}) + for i := range feeds { + // feedID will be deleted when all n oracles have reported + seen[feeds[i].id] = make(map[credentials.StaticSizedPublicKey]struct{}, n) + } + + for req := range reqs { + v := make(map[string]interface{}) + err := mercury.PayloadTypes.UnpackIntoMap(v, req.req.Payload) + require.NoError(t, err) + report, exists := v["report"] + if !exists { + t.Fatalf("expected payload %#v to contain 'report'", v) + } + reportElems := make(map[string]interface{}) + err = reportcodecv4.ReportTypes.UnpackIntoMap(reportElems, report.([]byte)) + require.NoError(t, err) + + feedID := reportElems["feedId"].([32]uint8) + feed, exists := feedM[feedID] + require.True(t, exists) + + if _, exists := seen[feedID]; !exists { + continue // already saw all oracles for this feed + } + + expectedFee := datastreamsmercury.CalculateFee(big.NewInt(234567), rawReportingPluginConfig.BaseUSDFee) + expectedExpiresAt := reportElems["observationsTimestamp"].(uint32) + rawReportingPluginConfig.ExpirationWindow + + assert.GreaterOrEqual(t, int(reportElems["observationsTimestamp"].(uint32)), int(testStartTimeStamp)) + assert.InDelta(t, feed.baseBenchmarkPrice.Int64(), reportElems["benchmarkPrice"].(*big.Int).Int64(), 5000000) + assert.NotZero(t, reportElems["validFromTimestamp"].(uint32)) + assert.GreaterOrEqual(t, reportElems["observationsTimestamp"].(uint32), reportElems["validFromTimestamp"].(uint32)) + assert.Equal(t, expectedExpiresAt, reportElems["expiresAt"].(uint32)) + assert.Equal(t, expectedFee, reportElems["linkFee"].(*big.Int)) + assert.Equal(t, expectedFee, reportElems["nativeFee"].(*big.Int)) + assert.Equal(t, feed.baseMarketStatus, reportElems["marketStatus"].(uint32)) + + t.Logf("oracle %x reported for feed %s (0x%x)", req.pk, feed.name, feed.id) + + seen[feedID][req.pk] = struct{}{} + if len(seen[feedID]) == n { + t.Logf("all oracles reported for feed %s (0x%x)", feed.name, feed.id) + delete(seen, feedID) + if len(seen) == 0 { + break // saw all oracles; success! + } + } + } + } + + t.Run("receives at least one report per feed for every server from each oracle when EAs are at 100% reliability", func(t *testing.T) { + for i := 0; i < nSrvs; i++ { + reqs := reqChs[i] + runTestSetup(reqs) + } + }) +} diff --git a/core/services/ocr2/plugins/mercury/plugin.go b/core/services/ocr2/plugins/mercury/plugin.go index c5eba78b0d8..8a4101804dd 100644 --- a/core/services/ocr2/plugins/mercury/plugin.go +++ b/core/services/ocr2/plugins/mercury/plugin.go @@ -13,6 +13,7 @@ import ( relaymercuryv1 "github.com/smartcontractkit/chainlink-data-streams/mercury/v1" relaymercuryv2 "github.com/smartcontractkit/chainlink-data-streams/mercury/v2" relaymercuryv3 "github.com/smartcontractkit/chainlink-data-streams/mercury/v3" + relaymercuryv4 "github.com/smartcontractkit/chainlink-data-streams/mercury/v4" "github.com/smartcontractkit/chainlink-common/pkg/loop" commontypes "github.com/smartcontractkit/chainlink-common/pkg/types" @@ -29,6 +30,7 @@ import ( mercuryv1 "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury/v1" mercuryv2 "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury/v2" mercuryv3 "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury/v3" + mercuryv4 "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury/v4" "github.com/smartcontractkit/chainlink/v2/plugins" ) @@ -71,27 +73,36 @@ func NewServices( chEnhancedTelem chan ocrcommon.EnhancedTelemetryMercuryData, orm types.DataSourceORM, feedID utils.FeedID, + enableTriggerCapability bool, ) ([]job.ServiceCtx, error) { if jb.PipelineSpec == nil { return nil, errors.New("expected job to have a non-nil PipelineSpec") } + var err error var pluginConfig config.PluginConfig - err := json.Unmarshal(jb.OCR2OracleSpec.PluginConfig.Bytes(), &pluginConfig) - if err != nil { - return nil, errors.WithStack(err) - } - err = config.ValidatePluginConfig(pluginConfig, feedID) - if err != nil { - return nil, err + if len(jb.OCR2OracleSpec.PluginConfig) == 0 { + if !enableTriggerCapability { + return nil, fmt.Errorf("at least one transmission option must be configured") + } + } else { + err = json.Unmarshal(jb.OCR2OracleSpec.PluginConfig.Bytes(), &pluginConfig) + if err != nil { + return nil, errors.WithStack(err) + } + err = config.ValidatePluginConfig(pluginConfig, feedID) + if err != nil { + return nil, err + } } + lggr = lggr.Named("MercuryPlugin").With("jobID", jb.ID, "jobName", jb.Name.ValueOrZero()) // encapsulate all the subservices and ensure we close them all if any fail to start srvs := []job.ServiceCtx{ocr2Provider} abort := func() { - if cerr := services.MultiCloser(srvs).Close(); err != nil { - lggr.Errorw("Error closing unused services", "err", cerr) + if err = services.MultiCloser(srvs).Close(); err != nil { + lggr.Errorw("Error closing unused services", "err", err) } } saver := ocrcommon.NewResultRunSaver(pipelineRunner, lggr, cfg.MaxSuccessfulRuns(), cfg.ResultWriteQueueDepth()) @@ -136,6 +147,13 @@ func NewServices( return nil, fmt.Errorf("failed to create mercury v3 factory: %w", err) } srvs = append(srvs, factoryServices...) + case 4: + factory, factoryServices, err = newv4factory(fCfg) + if err != nil { + abort() + return nil, fmt.Errorf("failed to create mercury v4 factory: %w", err) + } + srvs = append(srvs, factoryServices...) default: return nil, errors.Errorf("unknown Mercury report schema version: %d", feedID.Version()) } @@ -162,10 +180,61 @@ type factoryCfg struct { feedID utils.FeedID } +func getPluginFeedIDs(pluginConfig config.PluginConfig) (linkFeedID utils.FeedID, nativeFeedID utils.FeedID) { + if pluginConfig.LinkFeedID != nil { + linkFeedID = *pluginConfig.LinkFeedID + } + if pluginConfig.NativeFeedID != nil { + nativeFeedID = *pluginConfig.NativeFeedID + } + return linkFeedID, nativeFeedID +} + +func newv4factory(factoryCfg factoryCfg) (ocr3types.MercuryPluginFactory, []job.ServiceCtx, error) { + var factory ocr3types.MercuryPluginFactory + srvs := make([]job.ServiceCtx, 0) + + linkFeedID, nativeFeedID := getPluginFeedIDs(factoryCfg.reportingPluginConfig) + + ds := mercuryv4.NewDataSource( + factoryCfg.orm, + factoryCfg.pipelineRunner, + factoryCfg.jb, + *factoryCfg.jb.PipelineSpec, + factoryCfg.feedID, + factoryCfg.lggr, + factoryCfg.saver, + factoryCfg.chEnhancedTelem, + factoryCfg.ocr2Provider.MercuryServerFetcher(), + linkFeedID, + nativeFeedID, + ) + + loopCmd := env.MercuryPlugin.Cmd.Get() + loopEnabled := loopCmd != "" + + if loopEnabled { + cmdFn, opts, mercuryLggr, err := initLoop(loopCmd, factoryCfg.cfg, factoryCfg.feedID, factoryCfg.lggr) + if err != nil { + return nil, nil, fmt.Errorf("failed to init loop for feed %s: %w", factoryCfg.feedID, err) + } + // in loop mode, the factory is grpc server, and we need to handle the server lifecycle + factoryServer := loop.NewMercuryV4Service(mercuryLggr, opts, cmdFn, factoryCfg.ocr2Provider, ds) + srvs = append(srvs, factoryServer) + // adapt the grpc server to the vanilla mercury plugin factory interface used by the oracle + factory = factoryServer + } else { + factory = relaymercuryv4.NewFactory(ds, factoryCfg.lggr, factoryCfg.ocr2Provider.OnchainConfigCodec(), factoryCfg.ocr2Provider.ReportCodecV4()) + } + return factory, srvs, nil +} + func newv3factory(factoryCfg factoryCfg) (ocr3types.MercuryPluginFactory, []job.ServiceCtx, error) { var factory ocr3types.MercuryPluginFactory srvs := make([]job.ServiceCtx, 0) + linkFeedID, nativeFeedID := getPluginFeedIDs(factoryCfg.reportingPluginConfig) + ds := mercuryv3.NewDataSource( factoryCfg.orm, factoryCfg.pipelineRunner, @@ -176,8 +245,8 @@ func newv3factory(factoryCfg factoryCfg) (ocr3types.MercuryPluginFactory, []job. factoryCfg.saver, factoryCfg.chEnhancedTelem, factoryCfg.ocr2Provider.MercuryServerFetcher(), - *factoryCfg.reportingPluginConfig.LinkFeedID, - *factoryCfg.reportingPluginConfig.NativeFeedID, + linkFeedID, + nativeFeedID, ) loopCmd := env.MercuryPlugin.Cmd.Get() @@ -203,6 +272,8 @@ func newv2factory(factoryCfg factoryCfg) (ocr3types.MercuryPluginFactory, []job. var factory ocr3types.MercuryPluginFactory srvs := make([]job.ServiceCtx, 0) + linkFeedID, nativeFeedID := getPluginFeedIDs(factoryCfg.reportingPluginConfig) + ds := mercuryv2.NewDataSource( factoryCfg.orm, factoryCfg.pipelineRunner, @@ -213,8 +284,8 @@ func newv2factory(factoryCfg factoryCfg) (ocr3types.MercuryPluginFactory, []job. factoryCfg.saver, factoryCfg.chEnhancedTelem, factoryCfg.ocr2Provider.MercuryServerFetcher(), - *factoryCfg.reportingPluginConfig.LinkFeedID, - *factoryCfg.reportingPluginConfig.NativeFeedID, + linkFeedID, + nativeFeedID, ) loopCmd := env.MercuryPlugin.Cmd.Get() diff --git a/core/services/ocr2/plugins/mercury/plugin_test.go b/core/services/ocr2/plugins/mercury/plugin_test.go index 95aaabec142..22aaf7522de 100644 --- a/core/services/ocr2/plugins/mercury/plugin_test.go +++ b/core/services/ocr2/plugins/mercury/plugin_test.go @@ -21,6 +21,7 @@ import ( v1 "github.com/smartcontractkit/chainlink-common/pkg/types/mercury/v1" v2 "github.com/smartcontractkit/chainlink-common/pkg/types/mercury/v2" v3 "github.com/smartcontractkit/chainlink-common/pkg/types/mercury/v3" + v4 "github.com/smartcontractkit/chainlink-common/pkg/types/mercury/v4" mercuryocr2 "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/mercury" @@ -37,6 +38,7 @@ var ( v1FeedId = [32]uint8{00, 01, 107, 74, 167, 229, 124, 167, 182, 138, 225, 191, 69, 101, 63, 86, 182, 86, 253, 58, 163, 53, 239, 127, 174, 105, 107, 102, 63, 27, 132, 114} v2FeedId = [32]uint8{00, 02, 107, 74, 167, 229, 124, 167, 182, 138, 225, 191, 69, 101, 63, 86, 182, 86, 253, 58, 163, 53, 239, 127, 174, 105, 107, 102, 63, 27, 132, 114} v3FeedId = [32]uint8{00, 03, 107, 74, 167, 229, 124, 167, 182, 138, 225, 191, 69, 101, 63, 86, 182, 86, 253, 58, 163, 53, 239, 127, 174, 105, 107, 102, 63, 27, 132, 114} + v4FeedId = [32]uint8{00, 04, 107, 74, 167, 229, 124, 167, 182, 138, 225, 191, 69, 101, 63, 86, 182, 86, 253, 58, 163, 53, 239, 127, 174, 105, 107, 102, 63, 27, 132, 114} testArgsNoPlugin = libocr2.MercuryOracleArgs{ LocalConfig: libocr2types.LocalConfig{ @@ -66,6 +68,13 @@ var ( "nativeFeedID": "0x00036b4aa7e57ca7b68ae1bf45653f56b656fd3aa335ef7fae696b663f1b8472", } + v4jsonCfg = job.JSONConfig{ + "serverURL": "example.com:80", + "serverPubKey": "724ff6eae9e900270edfff233e16322a70ec06e1a6e62a81ef13921f398f6c93", + "linkFeedID": "0x00026b4aa7e57ca7b68ae1bf45653f56b656fd3aa335ef7fae696b663f1b8472", + "nativeFeedID": "0x00036b4aa7e57ca7b68ae1bf45653f56b656fd3aa335ef7fae696b663f1b8472", + } + testJob = job.Job{ ID: 1, ExternalJobID: uuid.Must(uuid.NewRandom()), @@ -135,6 +144,15 @@ func TestNewServices(t *testing.T) { wantServiceCnt: expectedEmbeddedServiceCnt, wantErr: false, }, + { + name: "v4 legacy", + args: args{ + pluginConfig: v4jsonCfg, + feedID: v4FeedId, + }, + wantServiceCnt: expectedEmbeddedServiceCnt, + wantErr: false, + }, { name: "v1 loop", loopMode: true, @@ -168,6 +186,17 @@ func TestNewServices(t *testing.T) { wantErr: false, wantLoopFactory: &loop.MercuryV3Service{}, }, + { + name: "v4 loop", + loopMode: true, + args: args{ + pluginConfig: v4jsonCfg, + feedID: v4FeedId, + }, + wantServiceCnt: expectedLoopServiceCnt, + wantErr: false, + wantLoopFactory: &loop.MercuryV4Service{}, + }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { @@ -201,13 +230,13 @@ func newServicesTestWrapper(t *testing.T, pluginConfig job.JSONConfig, feedID ut t.Helper() jb := testJob jb.OCR2OracleSpec.PluginConfig = pluginConfig - return mercuryocr2.NewServices(jb, &testProvider{}, nil, logger.TestLogger(t), testArgsNoPlugin, testCfg, nil, &testDataSourceORM{}, feedID) + return mercuryocr2.NewServices(jb, &testProvider{}, nil, logger.TestLogger(t), testArgsNoPlugin, testCfg, nil, &testDataSourceORM{}, feedID, false) } type testProvider struct{} // ChainReader implements types.MercuryProvider. -func (*testProvider) ChainReader() commontypes.ContractReader { panic("unimplemented") } +func (*testProvider) ContractReader() commontypes.ContractReader { panic("unimplemented") } // Close implements types.MercuryProvider. func (*testProvider) Close() error { return nil } @@ -259,6 +288,9 @@ func (*testProvider) ReportCodecV2() v2.ReportCodec { return nil } // ReportCodecV3 implements types.MercuryProvider. func (*testProvider) ReportCodecV3() v3.ReportCodec { return nil } +// ReportCodecV4 implements types.MercuryProvider. +func (*testProvider) ReportCodecV4() v4.ReportCodec { return nil } + // Start implements types.MercuryProvider. func (*testProvider) Start(context.Context) error { panic("unimplemented") } diff --git a/core/services/ocr2/plugins/ocr2keeper/config.go b/core/services/ocr2/plugins/ocr2keeper/config.go index 4b41e5a0285..ec56f9c6993 100644 --- a/core/services/ocr2/plugins/ocr2keeper/config.go +++ b/core/services/ocr2/plugins/ocr2keeper/config.go @@ -60,9 +60,6 @@ type PluginConfig struct { ContractVersion string `json:"contractVersion"` // CaptureAutomationCustomTelemetry is a bool flag to toggle Custom Telemetry Service CaptureAutomationCustomTelemetry *bool `json:"captureAutomationCustomTelemetry,omitempty"` - // UseBufferV1 is a bool flag to toggle the new log buffer implementation - // TODO: (AUTO-9355) remove once we have a single version - UseBufferV1 *bool `json:"useBufferV1,omitempty"` } func ValidatePluginConfig(cfg PluginConfig) error { diff --git a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v20/mocks/registry.go b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v20/mocks/registry.go index ccc0feffae7..e8d9dd49ccb 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v20/mocks/registry.go +++ b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v20/mocks/registry.go @@ -21,6 +21,14 @@ type Registry struct { mock.Mock } +type Registry_Expecter struct { + mock *mock.Mock +} + +func (_m *Registry) EXPECT() *Registry_Expecter { + return &Registry_Expecter{mock: &_m.Mock} +} + // GetActiveUpkeepIDs provides a mock function with given fields: opts, startIndex, maxCount func (_m *Registry) GetActiveUpkeepIDs(opts *bind.CallOpts, startIndex *big.Int, maxCount *big.Int) ([]*big.Int, error) { ret := _m.Called(opts, startIndex, maxCount) @@ -51,6 +59,36 @@ func (_m *Registry) GetActiveUpkeepIDs(opts *bind.CallOpts, startIndex *big.Int, return r0, r1 } +// Registry_GetActiveUpkeepIDs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetActiveUpkeepIDs' +type Registry_GetActiveUpkeepIDs_Call struct { + *mock.Call +} + +// GetActiveUpkeepIDs is a helper method to define mock.On call +// - opts *bind.CallOpts +// - startIndex *big.Int +// - maxCount *big.Int +func (_e *Registry_Expecter) GetActiveUpkeepIDs(opts interface{}, startIndex interface{}, maxCount interface{}) *Registry_GetActiveUpkeepIDs_Call { + return &Registry_GetActiveUpkeepIDs_Call{Call: _e.mock.On("GetActiveUpkeepIDs", opts, startIndex, maxCount)} +} + +func (_c *Registry_GetActiveUpkeepIDs_Call) Run(run func(opts *bind.CallOpts, startIndex *big.Int, maxCount *big.Int)) *Registry_GetActiveUpkeepIDs_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts), args[1].(*big.Int), args[2].(*big.Int)) + }) + return _c +} + +func (_c *Registry_GetActiveUpkeepIDs_Call) Return(_a0 []*big.Int, _a1 error) *Registry_GetActiveUpkeepIDs_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Registry_GetActiveUpkeepIDs_Call) RunAndReturn(run func(*bind.CallOpts, *big.Int, *big.Int) ([]*big.Int, error)) *Registry_GetActiveUpkeepIDs_Call { + _c.Call.Return(run) + return _c +} + // GetState provides a mock function with given fields: opts func (_m *Registry) GetState(opts *bind.CallOpts) (keeper_registry_wrapper2_0.GetState, error) { ret := _m.Called(opts) @@ -79,6 +117,34 @@ func (_m *Registry) GetState(opts *bind.CallOpts) (keeper_registry_wrapper2_0.Ge return r0, r1 } +// Registry_GetState_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetState' +type Registry_GetState_Call struct { + *mock.Call +} + +// GetState is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *Registry_Expecter) GetState(opts interface{}) *Registry_GetState_Call { + return &Registry_GetState_Call{Call: _e.mock.On("GetState", opts)} +} + +func (_c *Registry_GetState_Call) Run(run func(opts *bind.CallOpts)) *Registry_GetState_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *Registry_GetState_Call) Return(_a0 keeper_registry_wrapper2_0.GetState, _a1 error) *Registry_GetState_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Registry_GetState_Call) RunAndReturn(run func(*bind.CallOpts) (keeper_registry_wrapper2_0.GetState, error)) *Registry_GetState_Call { + _c.Call.Return(run) + return _c +} + // GetUpkeep provides a mock function with given fields: opts, id func (_m *Registry) GetUpkeep(opts *bind.CallOpts, id *big.Int) (keeper_registry_wrapper2_0.UpkeepInfo, error) { ret := _m.Called(opts, id) @@ -107,6 +173,35 @@ func (_m *Registry) GetUpkeep(opts *bind.CallOpts, id *big.Int) (keeper_registry return r0, r1 } +// Registry_GetUpkeep_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetUpkeep' +type Registry_GetUpkeep_Call struct { + *mock.Call +} + +// GetUpkeep is a helper method to define mock.On call +// - opts *bind.CallOpts +// - id *big.Int +func (_e *Registry_Expecter) GetUpkeep(opts interface{}, id interface{}) *Registry_GetUpkeep_Call { + return &Registry_GetUpkeep_Call{Call: _e.mock.On("GetUpkeep", opts, id)} +} + +func (_c *Registry_GetUpkeep_Call) Run(run func(opts *bind.CallOpts, id *big.Int)) *Registry_GetUpkeep_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts), args[1].(*big.Int)) + }) + return _c +} + +func (_c *Registry_GetUpkeep_Call) Return(_a0 keeper_registry_wrapper2_0.UpkeepInfo, _a1 error) *Registry_GetUpkeep_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Registry_GetUpkeep_Call) RunAndReturn(run func(*bind.CallOpts, *big.Int) (keeper_registry_wrapper2_0.UpkeepInfo, error)) *Registry_GetUpkeep_Call { + _c.Call.Return(run) + return _c +} + // ParseLog provides a mock function with given fields: log func (_m *Registry) ParseLog(log types.Log) (generated.AbigenLog, error) { ret := _m.Called(log) @@ -137,6 +232,34 @@ func (_m *Registry) ParseLog(log types.Log) (generated.AbigenLog, error) { return r0, r1 } +// Registry_ParseLog_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseLog' +type Registry_ParseLog_Call struct { + *mock.Call +} + +// ParseLog is a helper method to define mock.On call +// - log types.Log +func (_e *Registry_Expecter) ParseLog(log interface{}) *Registry_ParseLog_Call { + return &Registry_ParseLog_Call{Call: _e.mock.On("ParseLog", log)} +} + +func (_c *Registry_ParseLog_Call) Run(run func(log types.Log)) *Registry_ParseLog_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *Registry_ParseLog_Call) Return(_a0 generated.AbigenLog, _a1 error) *Registry_ParseLog_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Registry_ParseLog_Call) RunAndReturn(run func(types.Log) (generated.AbigenLog, error)) *Registry_ParseLog_Call { + _c.Call.Return(run) + return _c +} + // NewRegistry creates a new instance of Registry. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewRegistry(t interface { diff --git a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v20/registry.go b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v20/registry.go index 0cddd434483..9e9ac23ffeb 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v20/registry.go +++ b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v20/registry.go @@ -59,7 +59,6 @@ var ( logEventLookback int64 = 250 ) -//go:generate mockery --quiet --name Registry --output ./mocks/ --case=underscore type Registry interface { GetUpkeep(opts *bind.CallOpts, id *big.Int) (keeper_registry_wrapper2_0.UpkeepInfo, error) GetState(opts *bind.CallOpts) (keeper_registry_wrapper2_0.GetState, error) diff --git a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/autotelemetry21/custom_telemetry.go b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/autotelemetry21/custom_telemetry.go index 53303553db7..2c997a2d385 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/autotelemetry21/custom_telemetry.go +++ b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/autotelemetry21/custom_telemetry.go @@ -3,6 +3,7 @@ package autotelemetry21 import ( "context" "encoding/hex" + "sync" "time" "google.golang.org/protobuf/proto" @@ -29,6 +30,7 @@ type AutomationCustomTelemetryService struct { lggr logger.Logger configDigest [32]byte contractConfigTracker types.ContractConfigTracker + mu sync.RWMutex } // NewAutomationCustomTelemetryService creates a telemetry service for new blocks and node version @@ -66,8 +68,15 @@ func (e *AutomationCustomTelemetryService) Start(ctx context.Context) error { if err != nil { e.lggr.Errorf("Error occurred while getting newestConfigDetails in configDigest loop %s", err) } + configChanged := false + e.mu.Lock() if newConfigDigest != e.configDigest { e.configDigest = newConfigDigest + configChanged = true + } + e.mu.Unlock() + + if configChanged { e.sendNodeVersionMsg() } case <-hourTicker.C: @@ -121,10 +130,14 @@ func (e *AutomationCustomTelemetryService) Close() error { } func (e *AutomationCustomTelemetryService) sendNodeVersionMsg() { + e.mu.RLock() + configDigest := e.configDigest + e.mu.RUnlock() + vMsg := &telem.NodeVersion{ Timestamp: uint64(time.Now().UTC().UnixMilli()), NodeVersion: static.Version, - ConfigDigest: e.configDigest[:], + ConfigDigest: configDigest[:], } wrappedVMsg := &telem.AutomationTelemWrapper{ Msg: &telem.AutomationTelemWrapper_NodeVersion{ @@ -141,11 +154,15 @@ func (e *AutomationCustomTelemetryService) sendNodeVersionMsg() { } func (e *AutomationCustomTelemetryService) sendBlockNumberMsg(blockKey ocr2keepers.BlockKey) { + e.mu.RLock() + configDigest := e.configDigest + e.mu.RUnlock() + blockNumMsg := &telem.BlockNumber{ Timestamp: uint64(time.Now().UTC().UnixMilli()), BlockNumber: uint64(blockKey.Number), BlockHash: hex.EncodeToString(blockKey.Hash[:]), - ConfigDigest: e.configDigest[:], + ConfigDigest: configDigest[:], } wrappedBlockNumMsg := &telem.AutomationTelemWrapper{ Msg: &telem.AutomationTelemWrapper_BlockNumber{ diff --git a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/block_subscriber.go b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/block_subscriber.go index d07af8a8de4..21adc12d30e 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/block_subscriber.go +++ b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/block_subscriber.go @@ -9,14 +9,13 @@ import ( "github.com/ethereum/go-ethereum/common" - ocr2keepers "github.com/smartcontractkit/chainlink-common/pkg/types/automation" - + "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink-common/pkg/services" + ocr2keepers "github.com/smartcontractkit/chainlink-common/pkg/types/automation" httypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/headtracker/types" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" - "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/utils" ) @@ -74,7 +73,7 @@ func NewBlockSubscriber(hb httypes.HeadBroadcaster, lp logpoller.LogPoller, fina blockSize: lookbackDepth, finalityDepth: finalityDepth, latestBlock: atomic.Pointer[ocr2keepers.BlockKey]{}, - lggr: lggr.Named("BlockSubscriber"), + lggr: logger.Named(lggr, "BlockSubscriber"), } } @@ -235,7 +234,7 @@ func (bs *BlockSubscriber) processHead(h *evmtypes.Head) { // head parent is a linked list with EVM finality depth // when re-org happens, new heads will have pointers to the new blocks i := int64(0) - for cp := h; cp != nil; cp = cp.Parent { + for cp := h; cp != nil; cp = cp.Parent.Load() { // we don't stop when a matching (block number/hash) entry is seen in the map because parent linked list may be // cut short during a re-org if head broadcaster backfill is not complete. This can cause some re-orged blocks // left in the map. for example, re-org happens for block 98, 99, 100. next head 101 from broadcaster has parent list diff --git a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/block_subscriber_test.go b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/block_subscriber_test.go index fefbda77cd7..bdcc37dc6bb 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/block_subscriber_test.go +++ b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/block_subscriber_test.go @@ -310,23 +310,22 @@ func TestBlockSubscriber_Start(t *testing.T) { h97 := evmtypes.Head{ Number: 97, Hash: common.HexToHash("0xda2f9d1359eadd7b93338703adc07d942021a78195564038321ef53f23f87333"), - Parent: nil, } h98 := evmtypes.Head{ Number: 98, Hash: common.HexToHash("0xc20c7b47466c081a44a3b168994e89affe85cb894547845d938f923b67c633c0"), - Parent: &h97, } + h98.Parent.Store(&h97) h99 := evmtypes.Head{ Number: 99, Hash: common.HexToHash("0x9bc2b51e147f9cad05f1614b7f1d8181cb24c544cbcf841f3155e54e752a3b44"), - Parent: &h98, } + h99.Parent.Store(&h98) h100 := evmtypes.Head{ Number: 100, Hash: common.HexToHash("0x5e7fadfc14e1cfa9c05a91128c16a20c6cbc3be38b4723c3d482d44bf9c0e07b"), - Parent: &h99, } + h100.Parent.Store(&h99) // no subscribers yet bs.headC <- &h100 @@ -353,8 +352,8 @@ func TestBlockSubscriber_Start(t *testing.T) { h101 := &evmtypes.Head{ Number: 101, Hash: common.HexToHash("0xc20c7b47466c081a44a3b168994e89affe85cb894547845d938f923b67c633c0"), - Parent: &h100, } + h101.Parent.Store(&h100) bs.headC <- h101 time.Sleep(100 * time.Millisecond) @@ -387,24 +386,24 @@ func TestBlockSubscriber_Start(t *testing.T) { new99 := &evmtypes.Head{ Number: 99, Hash: common.HexToHash("0x70c03acc4ddbfb253ba41a25dc13fb21b25da8b63bcd1aa7fb55713d33a36c71"), - Parent: &h98, } + new99.Parent.Store(&h98) new100 := &evmtypes.Head{ Number: 100, Hash: common.HexToHash("0x8a876b62d252e63e16cf3487db3486c0a7c0a8e06bc3792a3b116c5ca480503f"), - Parent: new99, } + new100.Parent.Store(new99) new101 := &evmtypes.Head{ Number: 101, Hash: common.HexToHash("0x41b5842b8847dcf834e39556d2ac51cc7d960a7de9471ec504673d0038fd6c8e"), - Parent: new100, } + new101.Parent.Store(new100) new102 := &evmtypes.Head{ Number: 102, Hash: common.HexToHash("0x9ac1ebc307554cf1bcfcc2a49462278e89d6878d613a33df38a64d0aeac971b5"), - Parent: new101, } + new102.Parent.Store(new101) bs.headC <- new102 diff --git a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/core/interfaces.go b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/core/interfaces.go index 4dd4d387a80..32d6a389f7d 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/core/interfaces.go +++ b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/core/interfaces.go @@ -7,8 +7,6 @@ import ( ) // UpkeepStateReader is the interface for reading the current state of upkeeps. -// -//go:generate mockery --quiet --name UpkeepStateReader --output ./mocks/ --case=underscore type UpkeepStateReader interface { SelectByWorkIDs(ctx context.Context, workIDs ...string) ([]ocr2keepers.UpkeepState, error) } diff --git a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/core/mocks/upkeep_state_reader.go b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/core/mocks/upkeep_state_reader.go index 89c1ec6fd1f..52ac4f1b0e9 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/core/mocks/upkeep_state_reader.go +++ b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/core/mocks/upkeep_state_reader.go @@ -15,6 +15,14 @@ type UpkeepStateReader struct { mock.Mock } +type UpkeepStateReader_Expecter struct { + mock *mock.Mock +} + +func (_m *UpkeepStateReader) EXPECT() *UpkeepStateReader_Expecter { + return &UpkeepStateReader_Expecter{mock: &_m.Mock} +} + // SelectByWorkIDs provides a mock function with given fields: ctx, workIDs func (_m *UpkeepStateReader) SelectByWorkIDs(ctx context.Context, workIDs ...string) ([]automation.UpkeepState, error) { _va := make([]interface{}, len(workIDs)) @@ -52,6 +60,42 @@ func (_m *UpkeepStateReader) SelectByWorkIDs(ctx context.Context, workIDs ...str return r0, r1 } +// UpkeepStateReader_SelectByWorkIDs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SelectByWorkIDs' +type UpkeepStateReader_SelectByWorkIDs_Call struct { + *mock.Call +} + +// SelectByWorkIDs is a helper method to define mock.On call +// - ctx context.Context +// - workIDs ...string +func (_e *UpkeepStateReader_Expecter) SelectByWorkIDs(ctx interface{}, workIDs ...interface{}) *UpkeepStateReader_SelectByWorkIDs_Call { + return &UpkeepStateReader_SelectByWorkIDs_Call{Call: _e.mock.On("SelectByWorkIDs", + append([]interface{}{ctx}, workIDs...)...)} +} + +func (_c *UpkeepStateReader_SelectByWorkIDs_Call) Run(run func(ctx context.Context, workIDs ...string)) *UpkeepStateReader_SelectByWorkIDs_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]string, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(string) + } + } + run(args[0].(context.Context), variadicArgs...) + }) + return _c +} + +func (_c *UpkeepStateReader_SelectByWorkIDs_Call) Return(_a0 []automation.UpkeepState, _a1 error) *UpkeepStateReader_SelectByWorkIDs_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *UpkeepStateReader_SelectByWorkIDs_Call) RunAndReturn(run func(context.Context, ...string) ([]automation.UpkeepState, error)) *UpkeepStateReader_SelectByWorkIDs_Call { + _c.Call.Return(run) + return _c +} + // NewUpkeepStateReader creates a new instance of UpkeepStateReader. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewUpkeepStateReader(t interface { diff --git a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/gasprice/gasprice.go b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/gasprice/gasprice.go index f84a48c1ff8..095972fbf5b 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/gasprice/gasprice.go +++ b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/gasprice/gasprice.go @@ -6,10 +6,11 @@ import ( "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/smartcontractkit/chainlink-common/pkg/logger" + "github.com/smartcontractkit/chainlink/v2/core/cbor" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/gas" - "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/encoding" ) @@ -45,7 +46,7 @@ func CheckGasPrice(ctx context.Context, upkeepId *big.Int, offchainConfigBytes [ } lggr.Debugf("successfully decode offchain config for %s, max gas price is %s", upkeepId.String(), offchainConfig.MaxGasPrice.String()) - fee, _, err := ge.GetFee(ctx, []byte{}, feeLimit, assets.NewWei(big.NewInt(maxFeePrice))) + fee, _, err := ge.GetFee(ctx, []byte{}, feeLimit, assets.NewWei(big.NewInt(maxFeePrice)), nil, nil) if err != nil { lggr.Errorw("failed to get fee, gas price check is disabled", "upkeepId", upkeepId.String(), "err", err) return encoding.UpkeepFailureReasonNone diff --git a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/gasprice/gasprice_test.go b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/gasprice/gasprice_test.go index 9b5640051df..7b5ef999f3d 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/gasprice/gasprice_test.go +++ b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/gasprice/gasprice_test.go @@ -86,13 +86,13 @@ func TestGasPrice_Check(t *testing.T) { ctx := testutils.Context(t) ge := gasMocks.NewEvmFeeEstimator(t) if test.FailedToGetFee { - ge.On("GetFee", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return( + ge.On("GetFee", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return( gas.EvmFee{}, feeLimit, errors.New("failed to retrieve gas price"), ) } else if test.CurrentLegacyGasPrice != nil { - ge.On("GetFee", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return( + ge.On("GetFee", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return( gas.EvmFee{ Legacy: assets.NewWei(test.CurrentLegacyGasPrice), }, @@ -100,7 +100,7 @@ func TestGasPrice_Check(t *testing.T) { nil, ) } else if test.CurrentDynamicGasPrice != nil { - ge.On("GetFee", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return( + ge.On("GetFee", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return( gas.EvmFee{ DynamicFeeCap: assets.NewWei(test.CurrentDynamicGasPrice), DynamicTipCap: assets.NewWei(big.NewInt(1_000_000_000)), diff --git a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/logprovider/buffer.go b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/logprovider/buffer.go deleted file mode 100644 index af934a08013..00000000000 --- a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/logprovider/buffer.go +++ /dev/null @@ -1,388 +0,0 @@ -package logprovider - -import ( - "encoding/hex" - "math/big" - "sort" - "sync" - "sync/atomic" - - "github.com/smartcontractkit/chainlink-automation/pkg/v3/random" - ocr2keepers "github.com/smartcontractkit/chainlink-common/pkg/types/automation" - - "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" - "github.com/smartcontractkit/chainlink/v2/core/logger" - "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/prommetrics" -) - -var ( - // defaultFastExecLogsHigh is the default upper bound / maximum number of logs that Automation is committed to process for each upkeep, - // based on available capacity, i.e. if there are no logs from other upkeeps. - // Used by Log buffer to limit the number of logs we are saving in memory for each upkeep in a block - defaultFastExecLogsHigh = 32 - // defaultNumOfLogUpkeeps is the default number of log upkeeps supported by the registry. - defaultNumOfLogUpkeeps = 50 -) - -// fetchedLog holds the log and the ID of the upkeep -type fetchedLog struct { - upkeepID *big.Int - log logpoller.Log - // cachedLogID is the cached log identifier, used for sorting. - // It is calculated lazily, and cached for performance. - cachedLogID string -} - -func (l *fetchedLog) getLogID() string { - if len(l.cachedLogID) == 0 { - ext := ocr2keepers.LogTriggerExtension{ - Index: uint32(l.log.LogIndex), - } - copy(ext.TxHash[:], l.log.TxHash[:]) - copy(ext.BlockHash[:], l.log.BlockHash[:]) - l.cachedLogID = hex.EncodeToString(ext.LogIdentifier()) - } - return l.cachedLogID -} - -// fetchedBlock holds the logs fetched for a block -type fetchedBlock struct { - blockNumber int64 - // logs is the logs fetched for the block and haven't been visited yet - logs []fetchedLog - // visited is the logs fetched for the block and have been visited. - // We keep them in order to avoid fetching them again. - visited []fetchedLog -} - -func (b *fetchedBlock) Append(lggr logger.Logger, fl fetchedLog, maxBlockLogs, maxUpkeepLogs int) (fetchedLog, bool) { - has, upkeepLogs := b.has(fl.upkeepID, fl.log) - if has { - // Skipping known logs - return fetchedLog{}, false - } - // lggr.Debugw("Adding log", "i", i, "blockBlock", currentBlock.blockNumber, "logBlock", log.BlockNumber, "id", id) - b.logs = append(b.logs, fl) - - // drop logs if we reached limits. - if upkeepLogs+1 > maxUpkeepLogs { - // in case we have logs overflow for a particular upkeep, we drop a log of that upkeep, - // based on shared, random (per block) order of the logs in the block. - b.Sort() - var dropped fetchedLog - currentLogs := make([]fetchedLog, 0, len(b.logs)-1) - for _, l := range b.logs { - if dropped.upkeepID == nil && l.upkeepID.Cmp(fl.upkeepID) == 0 { - dropped = l - continue - } - currentLogs = append(currentLogs, l) - } - b.logs = currentLogs - return dropped, true - } else if len(b.logs)+len(b.visited) > maxBlockLogs { - // in case we have logs overflow in the buffer level, we drop a log based on - // shared, random (per block) order of the logs in the block. - b.Sort() - dropped := b.logs[0] - b.logs = b.logs[1:] - return dropped, true - } - - return fetchedLog{}, true -} - -// Has returns true if the block has the log, -// and the number of logs for that upkeep in the block. -func (b fetchedBlock) has(id *big.Int, log logpoller.Log) (bool, int) { - allLogs := append(b.logs, b.visited...) - upkeepLogs := 0 - for _, l := range allLogs { - if l.upkeepID.Cmp(id) != 0 { - continue - } - upkeepLogs++ - if l.log.BlockHash == log.BlockHash && l.log.TxHash == log.TxHash && l.log.LogIndex == log.LogIndex { - return true, upkeepLogs - } - } - return false, upkeepLogs -} - -func (b fetchedBlock) Clone() fetchedBlock { - logs := make([]fetchedLog, len(b.logs)) - copy(logs, b.logs) - visited := make([]fetchedLog, len(b.visited)) - copy(visited, b.visited) - return fetchedBlock{ - blockNumber: b.blockNumber, - logs: logs, - visited: visited, - } -} - -// Sort by log identifiers, shuffled using a pseduorandom souce that is shared across all nodes -// for a given block. -func (b *fetchedBlock) Sort() { - randSeed := random.GetRandomKeySource(nil, uint64(b.blockNumber)) - - shuffledLogIDs := make(map[string]string, len(b.logs)) - for _, log := range b.logs { - logID := log.getLogID() - shuffledLogIDs[logID] = random.ShuffleString(logID, randSeed) - } - - sort.SliceStable(b.logs, func(i, j int) bool { - return shuffledLogIDs[b.logs[i].getLogID()] < shuffledLogIDs[b.logs[j].getLogID()] - }) -} - -// logEventBuffer is a circular/ring buffer of fetched logs. -// Each entry in the buffer represents a block, -// and holds the logs fetched for that block. -type logEventBuffer struct { - lggr logger.Logger - lock sync.RWMutex - // size is the number of blocks supported by the buffer - size int32 - - numOfLogUpkeeps, fastExecLogsHigh uint32 - // blocks is the circular buffer of fetched blocks - blocks []fetchedBlock - // latestBlock is the latest block number seen - latestBlock int64 -} - -func newLogEventBuffer(lggr logger.Logger, size, numOfLogUpkeeps, fastExecLogsHigh int) *logEventBuffer { - return &logEventBuffer{ - lggr: lggr.Named("KeepersRegistry.LogEventBuffer"), - size: int32(size), - blocks: make([]fetchedBlock, size), - numOfLogUpkeeps: uint32(numOfLogUpkeeps), - fastExecLogsHigh: uint32(fastExecLogsHigh), - } -} - -func (b *logEventBuffer) latestBlockSeen() int64 { - return atomic.LoadInt64(&b.latestBlock) -} - -func (b *logEventBuffer) bufferSize() int { - return int(atomic.LoadInt32(&b.size)) -} - -func (b *logEventBuffer) SetLimits(numOfLogUpkeeps, fastExecLogsHigh int) { - atomic.StoreUint32(&b.numOfLogUpkeeps, uint32(numOfLogUpkeeps)) - atomic.StoreUint32(&b.fastExecLogsHigh, uint32(fastExecLogsHigh)) -} - -// enqueue adds logs (if not exist) to the buffer, returning the number of logs added -// minus the number of logs dropped. -func (b *logEventBuffer) enqueue(id *big.Int, logs ...logpoller.Log) int { - b.lock.Lock() - defer b.lock.Unlock() - - lggr := b.lggr.With("id", id.String()) - - maxBlockLogs := int(atomic.LoadUint32(&b.fastExecLogsHigh) * atomic.LoadUint32(&b.numOfLogUpkeeps)) - maxUpkeepLogs := int(atomic.LoadUint32(&b.fastExecLogsHigh)) - - latestBlock := b.latestBlockSeen() - added, dropped := 0, 0 - - for _, log := range logs { - if log.BlockNumber == 0 { - // invalid log - continue - } - i := b.blockNumberIndex(log.BlockNumber) - currentBlock := b.blocks[i] - if currentBlock.blockNumber < log.BlockNumber { - lggr.Debugw("Got log on a new block", "prevBlock", currentBlock.blockNumber, "newBlock", log.BlockNumber) - currentBlock.blockNumber = log.BlockNumber - currentBlock.logs = nil - currentBlock.visited = nil - } else if currentBlock.blockNumber > log.BlockNumber { - // not expected to happen - lggr.Debugw("Skipping log from old block", "currentBlock", currentBlock.blockNumber, "newBlock", log.BlockNumber) - continue - } - droppedLog, ok := currentBlock.Append(lggr, fetchedLog{upkeepID: id, log: log}, maxBlockLogs, maxUpkeepLogs) - if !ok { - // Skipping known logs - continue - } - if droppedLog.upkeepID != nil { - dropped++ - lggr.Debugw("Reached log buffer limits, dropping log", "blockNumber", droppedLog.log.BlockNumber, - "blockHash", droppedLog.log.BlockHash, "txHash", droppedLog.log.TxHash, "logIndex", droppedLog.log.LogIndex, - "upkeepID", droppedLog.upkeepID.String()) - } - added++ - b.blocks[i] = currentBlock - - if log.BlockNumber > latestBlock { - latestBlock = log.BlockNumber - } - } - - if latestBlock > b.latestBlockSeen() { - atomic.StoreInt64(&b.latestBlock, latestBlock) - } - if added > 0 { - lggr.Debugw("Added logs to buffer", "addedLogs", added, "dropped", dropped, "latestBlock", latestBlock) - prommetrics.AutomationLogBufferFlow.WithLabelValues(prommetrics.LogBufferFlowDirectionIngress).Add(float64(added)) - prommetrics.AutomationLogBufferFlow.WithLabelValues(prommetrics.LogBufferFlowDirectionDropped).Add(float64(dropped)) - } - - return added - dropped -} - -// peek returns the logs in range [latestBlock-blocks, latestBlock] -func (b *logEventBuffer) peek(blocks int) []fetchedLog { - latestBlock := b.latestBlockSeen() - if latestBlock == 0 { - return nil - } - if blocks > int(latestBlock) { - blocks = int(latestBlock) - 1 - } - - return b.peekRange(latestBlock-int64(blocks), latestBlock) -} - -// peekRange returns the logs between start and end inclusive. -func (b *logEventBuffer) peekRange(start, end int64) []fetchedLog { - b.lock.RLock() - defer b.lock.RUnlock() - - blocksInRange := b.getBlocksInRange(int(start), int(end)) - - var results []fetchedLog - for _, block := range blocksInRange { - // double checking that we don't have any gaps in the range - if block.blockNumber < start || block.blockNumber > end { - continue - } - results = append(results, block.logs...) - } - - sort.SliceStable(results, func(i, j int) bool { - return results[i].log.BlockNumber < results[j].log.BlockNumber - }) - - b.lggr.Debugw("Peeked logs", "results", len(results), "start", start, "end", end) - - return results -} - -// dequeueRange returns the logs between start and end inclusive. -func (b *logEventBuffer) dequeueRange(start, end int64, upkeepLimit, totalLimit int) []fetchedLog { - b.lock.Lock() - defer b.lock.Unlock() - - blocksInRange := b.getBlocksInRange(int(start), int(end)) - fetchedBlocks := make([]fetchedBlock, 0, len(blocksInRange)) - for _, block := range blocksInRange { - // Create clone of the blocks as they get processed and update underlying b.blocks - fetchedBlocks = append(fetchedBlocks, block.Clone()) - } - - // Sort the blocks in reverse order of block number so that latest logs - // are preferred while dequeueing. - sort.SliceStable(fetchedBlocks, func(i, j int) bool { - return fetchedBlocks[i].blockNumber > fetchedBlocks[j].blockNumber - }) - - logsCount := map[string]int{} - totalCount := 0 - var results []fetchedLog - for _, block := range fetchedBlocks { - if block.blockNumber < start || block.blockNumber > end { - // double checking that we don't have any gaps in the range - continue - } - if totalCount >= totalLimit { - // reached total limit, no need to process more blocks - break - } - // Sort the logs in random order that is shared across all nodes. - // This ensures that nodes across the network will process the same logs. - block.Sort() - var remainingLogs, blockResults []fetchedLog - for _, log := range block.logs { - if totalCount >= totalLimit { - remainingLogs = append(remainingLogs, log) - continue - } - if logsCount[log.upkeepID.String()] >= upkeepLimit { - remainingLogs = append(remainingLogs, log) - continue - } - blockResults = append(blockResults, log) - logsCount[log.upkeepID.String()]++ - totalCount++ - } - if len(blockResults) == 0 { - continue - } - results = append(results, blockResults...) - block.visited = append(block.visited, blockResults...) - block.logs = remainingLogs - b.blocks[b.blockNumberIndex(block.blockNumber)] = block - } - - if len(results) > 0 { - b.lggr.Debugw("Dequeued logs", "results", len(results), "start", start, "end", end) - prommetrics.AutomationLogBufferFlow.WithLabelValues(prommetrics.LogBufferFlowDirectionEgress).Add(float64(len(results))) - } - - return results -} - -// getBlocksInRange returns the blocks between start and end. -// NOTE: this function should be called with the lock held -func (b *logEventBuffer) getBlocksInRange(start, end int) []fetchedBlock { - var blocksInRange []fetchedBlock - start, end = b.blockRangeToIndices(start, end) - if start == -1 || end == -1 { - // invalid range - return blocksInRange - } - if start <= end { - // Normal range, need to return indices from start to end(inclusive) - return b.blocks[start : end+1] - } - // in case we get circular range such as [0, 1, end, ... , start, ..., size-1] - // we need to return the blocks in two ranges: [0, end](inclusive) and [start, size-1] - blocksInRange = append(blocksInRange, b.blocks[start:]...) - blocksInRange = append(blocksInRange, b.blocks[:end+1]...) - - return blocksInRange -} - -// blockRangeToIndices returns the normalized range of start to end block range, -// to indices aligned with buffer size. Note ranges inclusive of start, end indices. -func (b *logEventBuffer) blockRangeToIndices(start, end int) (int, int) { - latest := b.latestBlockSeen() - if end > int(latest) { - // Limit end of range to latest block seen - end = int(latest) - } - if end < start || start == 0 || end == 0 { - // invalid range - return -1, -1 - } - size := b.bufferSize() - if end-start >= size { - // If range requires more than buffer size blocks, only to return - // last size blocks as that's the max the buffer stores. - start = (end - size) + 1 - } - return b.blockNumberIndex(int64(start)), b.blockNumberIndex(int64(end)) -} - -// blockNumberIndex returns the index of the block in the buffer -func (b *logEventBuffer) blockNumberIndex(bn int64) int { - return int(bn-1) % b.bufferSize() -} diff --git a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/logprovider/buffer_test.go b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/logprovider/buffer_test.go deleted file mode 100644 index dca43ca14ac..00000000000 --- a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/logprovider/buffer_test.go +++ /dev/null @@ -1,892 +0,0 @@ -package logprovider - -import ( - "encoding/hex" - "fmt" - "math/big" - "testing" - - "github.com/smartcontractkit/chainlink-automation/pkg/v3/types" - - "github.com/ethereum/go-ethereum/common" - "github.com/stretchr/testify/require" - - ocr2keepers "github.com/smartcontractkit/chainlink-common/pkg/types/automation" - - "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" - "github.com/smartcontractkit/chainlink/v2/core/logger" - "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/core" -) - -func TestLogEventBuffer_GetBlocksInRange(t *testing.T) { - size := 3 - maxSeenBlock := int64(4) - buf := newLogEventBuffer(logger.TestLogger(t), size, 10, 10) - - buf.enqueue(big.NewInt(1), - logpoller.Log{BlockNumber: 2, TxHash: common.HexToHash("0x2"), LogIndex: 0}, - logpoller.Log{BlockNumber: 3, TxHash: common.HexToHash("0x3"), LogIndex: 0}, - ) - - buf.enqueue(big.NewInt(2), - logpoller.Log{BlockNumber: 2, TxHash: common.HexToHash("0x2"), LogIndex: 2}, - logpoller.Log{BlockNumber: 3, TxHash: common.HexToHash("0x3"), LogIndex: 2}, - logpoller.Log{BlockNumber: 4, TxHash: common.HexToHash("0x1"), LogIndex: 0}, - logpoller.Log{BlockNumber: 4, TxHash: common.HexToHash("0x1"), LogIndex: 1}, - ) - - tests := []struct { - name string - from int64 - to int64 - want int - }{ - { - name: "all", - from: 2, - to: 4, - want: 3, - }, - { - name: "partial", - from: 2, - to: 3, - want: 2, - }, - { - name: "circular", - from: 3, - to: 4, - want: 2, - }, - { - name: "zero start", - from: 0, - to: 2, - }, - { - name: "invalid zero end", - from: 0, - to: 0, - }, - { - name: "invalid from larger than to", - from: 4, - to: 2, - }, - { - name: "outside max last seen", - from: 5, - to: 10, - }, - { - name: "limited by max last seen", - from: 2, - to: 5, - want: 3, - }, - } - - for _, tc := range tests { - t.Run(tc.name, func(t *testing.T) { - blocks := buf.getBlocksInRange(int(tc.from), int(tc.to)) - require.Equal(t, tc.want, len(blocks)) - if tc.want > 0 { - from := tc.from - require.Equal(t, from, blocks[0].blockNumber) - to := tc.to - if to >= maxSeenBlock { - to = maxSeenBlock - } - require.Equal(t, to, blocks[len(blocks)-1].blockNumber) - } - }) - } -} - -func TestLogEventBuffer_GetBlocksInRange_Circular(t *testing.T) { - size := 4 - buf := newLogEventBuffer(logger.TestLogger(t), size, 10, 10) - - require.Equal(t, buf.enqueue(big.NewInt(1), - logpoller.Log{BlockNumber: 1, TxHash: common.HexToHash("0x1"), LogIndex: 0}, - logpoller.Log{BlockNumber: 2, TxHash: common.HexToHash("0x2"), LogIndex: 0}, - logpoller.Log{BlockNumber: 3, TxHash: common.HexToHash("0x3"), LogIndex: 0}, - ), 3) - - require.Equal(t, buf.enqueue(big.NewInt(2), - logpoller.Log{BlockNumber: 2, TxHash: common.HexToHash("0x2"), LogIndex: 2}, - logpoller.Log{BlockNumber: 3, TxHash: common.HexToHash("0x3"), LogIndex: 2}, - logpoller.Log{BlockNumber: 4, TxHash: common.HexToHash("0x1"), LogIndex: 1}, - ), 3) - - require.Equal(t, buf.enqueue(big.NewInt(3), - logpoller.Log{BlockNumber: 4, TxHash: common.HexToHash("0x1"), LogIndex: 4}, - logpoller.Log{BlockNumber: 5, TxHash: common.HexToHash("0x3"), LogIndex: 2}, - logpoller.Log{BlockNumber: 5, TxHash: common.HexToHash("0x3"), LogIndex: 5}, - ), 3) - - tests := []struct { - name string - from int64 - to int64 - expectedBlocks []int64 - }{ - { - name: "happy flow", - from: 2, - to: 5, - expectedBlocks: []int64{2, 3, 4, 5}, - }, - { - name: "range overflow circular", - from: 1, - to: 6, - expectedBlocks: []int64{2, 3, 4, 5}, - }, - } - - for _, tc := range tests { - t.Run(tc.name, func(t *testing.T) { - blocks := buf.getBlocksInRange(int(tc.from), int(tc.to)) - require.Equal(t, len(tc.expectedBlocks), len(blocks)) - expectedBlockNumbers := map[int64]bool{} - for _, b := range tc.expectedBlocks { - expectedBlockNumbers[b] = false - } - for _, b := range blocks { - expectedBlockNumbers[b.blockNumber] = true - } - for k, v := range expectedBlockNumbers { - require.True(t, v, "missing block %d", k) - } - }) - } -} - -func TestLogEventBuffer_EnqueueDequeue(t *testing.T) { - t.Run("dequeue empty", func(t *testing.T) { - buf := newLogEventBuffer(logger.TestLogger(t), 3, 10, 10) - - results := buf.peekRange(int64(1), int64(2)) - require.Equal(t, 0, len(results)) - results = buf.peek(2) - require.Equal(t, 0, len(results)) - }) - - t.Run("enqueue", func(t *testing.T) { - buf := newLogEventBuffer(logger.TestLogger(t), 3, 10, 10) - - buf.enqueue(big.NewInt(1), - logpoller.Log{BlockNumber: 1, TxHash: common.HexToHash("0x1"), LogIndex: 0}, - logpoller.Log{BlockNumber: 1, TxHash: common.HexToHash("0x1"), LogIndex: 1}, - ) - buf.lock.Lock() - require.Equal(t, 2, len(buf.blocks[0].logs)) - buf.lock.Unlock() - }) - - t.Run("enqueue logs overflow", func(t *testing.T) { - buf := newLogEventBuffer(logger.TestLogger(t), 2, 2, 2) - - require.Equal(t, 2, buf.enqueue(big.NewInt(1), - logpoller.Log{BlockNumber: 1, TxHash: common.HexToHash("0x1"), LogIndex: 0}, - logpoller.Log{BlockNumber: 1, TxHash: common.HexToHash("0x1"), LogIndex: 1}, - logpoller.Log{BlockNumber: 1, TxHash: common.HexToHash("0x1"), LogIndex: 2}, - )) - buf.lock.Lock() - require.Equal(t, 2, len(buf.blocks[0].logs)) - buf.lock.Unlock() - }) - - t.Run("enqueue logs overflow with dynamic limits", func(t *testing.T) { - buf := newLogEventBuffer(logger.TestLogger(t), 2, 10, 2) - - require.Equal(t, 2, buf.enqueue(big.NewInt(1), - logpoller.Log{BlockNumber: 1, TxHash: common.HexToHash("0x1"), LogIndex: 0}, - logpoller.Log{BlockNumber: 1, TxHash: common.HexToHash("0x1"), LogIndex: 1}, - logpoller.Log{BlockNumber: 1, TxHash: common.HexToHash("0x1"), LogIndex: 2}, - )) - buf.SetLimits(10, 3) - require.Equal(t, 3, buf.enqueue(big.NewInt(1), - logpoller.Log{BlockNumber: 2, TxHash: common.HexToHash("0x21"), LogIndex: 0}, - logpoller.Log{BlockNumber: 2, TxHash: common.HexToHash("0x21"), LogIndex: 1}, - logpoller.Log{BlockNumber: 2, TxHash: common.HexToHash("0x21"), LogIndex: 2}, - logpoller.Log{BlockNumber: 2, TxHash: common.HexToHash("0x21"), LogIndex: 3}, - )) - - buf.lock.Lock() - defer buf.lock.Unlock() - require.Equal(t, 2, len(buf.blocks[0].logs)) - require.Equal(t, 3, len(buf.blocks[1].logs)) - }) - - t.Run("enqueue logs overflow with dynamic limits", func(t *testing.T) { - buf := newLogEventBuffer(logger.TestLogger(t), 2, 10, 2) - - require.Equal(t, 2, buf.enqueue(big.NewInt(1), - logpoller.Log{BlockNumber: 1, TxHash: common.HexToHash("0x1"), LogIndex: 0}, - logpoller.Log{BlockNumber: 1, TxHash: common.HexToHash("0x1"), LogIndex: 1}, - logpoller.Log{BlockNumber: 1, TxHash: common.HexToHash("0x1"), LogIndex: 2}, - logpoller.Log{BlockNumber: 1, TxHash: common.HexToHash("0x1"), LogIndex: 3}, - )) - buf.SetLimits(10, 3) - require.Equal(t, 3, buf.enqueue(big.NewInt(1), - logpoller.Log{BlockNumber: 2, TxHash: common.HexToHash("0x21"), LogIndex: 0}, - logpoller.Log{BlockNumber: 2, TxHash: common.HexToHash("0x21"), LogIndex: 1}, - logpoller.Log{BlockNumber: 2, TxHash: common.HexToHash("0x21"), LogIndex: 2}, - logpoller.Log{BlockNumber: 2, TxHash: common.HexToHash("0x21"), LogIndex: 3}, - )) - - buf.lock.Lock() - defer buf.lock.Unlock() - require.Equal(t, 2, len(buf.blocks[0].logs)) - }) - - t.Run("enqueue block overflow", func(t *testing.T) { - buf := newLogEventBuffer(logger.TestLogger(t), 3, 2, 10) - - require.Equal(t, 5, buf.enqueue(big.NewInt(1), - logpoller.Log{BlockNumber: 1, TxHash: common.HexToHash("0x1"), LogIndex: 0}, - logpoller.Log{BlockNumber: 2, TxHash: common.HexToHash("0x2"), LogIndex: 0}, - logpoller.Log{BlockNumber: 3, TxHash: common.HexToHash("0x3"), LogIndex: 0}, - logpoller.Log{BlockNumber: 4, TxHash: common.HexToHash("0x4"), LogIndex: 0}, - logpoller.Log{BlockNumber: 4, TxHash: common.HexToHash("0x4"), LogIndex: 1}, - )) - buf.lock.Lock() - require.Equal(t, 2, len(buf.blocks[0].logs)) - buf.lock.Unlock() - }) - - t.Run("enqueue upkeep block overflow", func(t *testing.T) { - buf := newLogEventBuffer(logger.TestLogger(t), 10, 10, 2) - - require.Equal(t, 2, buf.enqueue(big.NewInt(1), - logpoller.Log{BlockNumber: 1, TxHash: common.HexToHash("0x1"), LogIndex: 0}, - logpoller.Log{BlockNumber: 1, TxHash: common.HexToHash("0x1"), LogIndex: 1}, - logpoller.Log{BlockNumber: 1, TxHash: common.HexToHash("0x1"), LogIndex: 2}, - logpoller.Log{BlockNumber: 1, TxHash: common.HexToHash("0x1"), LogIndex: 3}, - )) - buf.lock.Lock() - require.Equal(t, 2, len(buf.blocks[0].logs)) - buf.lock.Unlock() - }) - - t.Run("peek range after dequeue", func(t *testing.T) { - buf := newLogEventBuffer(logger.TestLogger(t), 3, 10, 10) - - require.Equal(t, buf.enqueue(big.NewInt(10), - logpoller.Log{BlockNumber: 1, TxHash: common.HexToHash("0x1"), LogIndex: 10}, - logpoller.Log{BlockNumber: 3, TxHash: common.HexToHash("0x1"), LogIndex: 11}, - ), 2) - require.Equal(t, buf.enqueue(big.NewInt(1), - logpoller.Log{BlockNumber: 2, TxHash: common.HexToHash("0x1"), LogIndex: 0}, - logpoller.Log{BlockNumber: 3, TxHash: common.HexToHash("0x1"), LogIndex: 1}, - ), 2) - results := buf.peekRange(int64(1), int64(2)) - require.Equal(t, 2, len(results)) - verifyBlockNumbers(t, results, 1, 2) - removed := buf.dequeueRange(int64(1), int64(2), 2, 10) - require.Equal(t, 2, len(removed)) - results = buf.peekRange(int64(1), int64(2)) - require.Equal(t, 0, len(results)) - }) - - t.Run("enqueue peek and dequeue", func(t *testing.T) { - buf := newLogEventBuffer(logger.TestLogger(t), 4, 10, 10) - - require.Equal(t, buf.enqueue(big.NewInt(10), - logpoller.Log{BlockNumber: 1, TxHash: common.HexToHash("0x1"), LogIndex: 10}, - logpoller.Log{BlockNumber: 3, TxHash: common.HexToHash("0x1"), LogIndex: 11}, - ), 2) - require.Equal(t, buf.enqueue(big.NewInt(1), - logpoller.Log{BlockNumber: 2, TxHash: common.HexToHash("0x1"), LogIndex: 0}, - logpoller.Log{BlockNumber: 3, TxHash: common.HexToHash("0x1"), LogIndex: 1}, - ), 2) - results := buf.peek(8) - require.Equal(t, 4, len(results)) - verifyBlockNumbers(t, results, 1, 2, 3, 3) - removed := buf.dequeueRange(1, 3, 5, 5) - require.Equal(t, 4, len(removed)) - buf.lock.Lock() - require.Equal(t, 0, len(buf.blocks[0].logs)) - require.Equal(t, int64(2), buf.blocks[1].blockNumber) - require.Equal(t, 1, len(buf.blocks[1].visited)) - buf.lock.Unlock() - }) - - t.Run("enqueue and peek range circular", func(t *testing.T) { - buf := newLogEventBuffer(logger.TestLogger(t), 3, 10, 10) - - require.Equal(t, buf.enqueue(big.NewInt(1), - logpoller.Log{BlockNumber: 1, TxHash: common.HexToHash("0x1"), LogIndex: 0}, - logpoller.Log{BlockNumber: 2, TxHash: common.HexToHash("0x2"), LogIndex: 0}, - logpoller.Log{BlockNumber: 3, TxHash: common.HexToHash("0x3"), LogIndex: 0}, - ), 3) - require.Equal(t, buf.enqueue(big.NewInt(10), - logpoller.Log{BlockNumber: 4, TxHash: common.HexToHash("0x1"), LogIndex: 10}, - logpoller.Log{BlockNumber: 4, TxHash: common.HexToHash("0x1"), LogIndex: 11}, - ), 2) - - results := buf.peekRange(int64(1), int64(1)) - require.Equal(t, 0, len(results)) - - results = buf.peekRange(int64(3), int64(5)) - require.Equal(t, 3, len(results)) - verifyBlockNumbers(t, results, 3, 4, 4) - }) - - t.Run("doesnt enqueue old blocks", func(t *testing.T) { - buf := newLogEventBuffer(logger.TestLogger(t), 3, 5, 10) - - require.Equal(t, buf.enqueue(big.NewInt(10), - logpoller.Log{BlockNumber: 4, TxHash: common.HexToHash("0x1"), LogIndex: 10}, - logpoller.Log{BlockNumber: 4, TxHash: common.HexToHash("0x1"), LogIndex: 11}, - ), 2) - require.Equal(t, buf.enqueue(big.NewInt(1), - logpoller.Log{BlockNumber: 1, TxHash: common.HexToHash("0x1"), LogIndex: 0}, - logpoller.Log{BlockNumber: 2, TxHash: common.HexToHash("0x2"), LogIndex: 0}, - logpoller.Log{BlockNumber: 3, TxHash: common.HexToHash("0x3"), LogIndex: 0}, - ), 2) - results := buf.peekRange(int64(1), int64(5)) - fmt.Println(results) - verifyBlockNumbers(t, results, 2, 3, 4, 4) - }) - - t.Run("dequeue with limits returns latest block logs", func(t *testing.T) { - buf := newLogEventBuffer(logger.TestLogger(t), 3, 5, 10) - require.Equal(t, buf.enqueue(big.NewInt(1), - logpoller.Log{BlockNumber: 1, TxHash: common.HexToHash("0x1"), LogIndex: 0}, - logpoller.Log{BlockNumber: 2, TxHash: common.HexToHash("0x2"), LogIndex: 0}, - logpoller.Log{BlockNumber: 3, TxHash: common.HexToHash("0x3"), LogIndex: 0}, - logpoller.Log{BlockNumber: 4, TxHash: common.HexToHash("0x4"), LogIndex: 0}, - logpoller.Log{BlockNumber: 5, TxHash: common.HexToHash("0x5"), LogIndex: 0}, - ), 5) - - logs := buf.dequeueRange(1, 5, 2, 10) - require.Equal(t, 2, len(logs)) - require.Equal(t, int64(5), logs[0].log.BlockNumber) - require.Equal(t, int64(4), logs[1].log.BlockNumber) - - require.Equal(t, buf.enqueue(big.NewInt(1), - logpoller.Log{BlockNumber: 4, TxHash: common.HexToHash("0x4"), LogIndex: 1}, - logpoller.Log{BlockNumber: 5, TxHash: common.HexToHash("0x5"), LogIndex: 1}, - ), 2) - - logs = buf.dequeueRange(1, 5, 3, 2) - require.Equal(t, 2, len(logs)) - }) - - t.Run("dequeue doesn't return same logs again", func(t *testing.T) { - buf := newLogEventBuffer(logger.TestLogger(t), 3, 5, 10) - require.Equal(t, buf.enqueue(big.NewInt(1), - logpoller.Log{BlockNumber: 1, TxHash: common.HexToHash("0x1"), LogIndex: 0}, - logpoller.Log{BlockNumber: 2, TxHash: common.HexToHash("0x2"), LogIndex: 0}, - logpoller.Log{BlockNumber: 3, TxHash: common.HexToHash("0x3"), LogIndex: 0}, - ), 3) - - logs := buf.dequeueRange(3, 3, 2, 10) - fmt.Println(logs) - require.Equal(t, 1, len(logs)) - - logs = buf.dequeueRange(3, 3, 2, 10) - fmt.Println(logs) - require.Equal(t, 0, len(logs)) - }) -} - -func TestLogEventBuffer_FetchedBlock_Append(t *testing.T) { - type appendArgs struct { - fl fetchedLog - maxBlockLogs, maxUpkeepLogs int - added, dropped bool - } - - tests := []struct { - name string - blockNumber int64 - logs []fetchedLog - visited []fetchedLog - toAdd []appendArgs - expected []fetchedLog - added bool - }{ - { - name: "empty block", - blockNumber: 1, - logs: []fetchedLog{}, - visited: []fetchedLog{}, - toAdd: []appendArgs{ - { - fl: fetchedLog{ - log: logpoller.Log{ - BlockNumber: 1, - TxHash: common.HexToHash("0x1"), - LogIndex: 0, - }, - upkeepID: core.GenUpkeepID(types.LogTrigger, "111").BigInt(), - }, - maxBlockLogs: 10, - maxUpkeepLogs: 2, - added: true, - }, - }, - expected: []fetchedLog{ - { - log: logpoller.Log{ - BlockNumber: 1, - TxHash: common.HexToHash("0x1"), - LogIndex: 0, - }, - upkeepID: core.GenUpkeepID(types.LogTrigger, "111").BigInt(), - }, - }, - }, - { - name: "existing log", - blockNumber: 1, - logs: []fetchedLog{ - { - log: logpoller.Log{ - BlockNumber: 1, - TxHash: common.HexToHash("0x1"), - LogIndex: 0, - }, - upkeepID: core.GenUpkeepID(types.LogTrigger, "111").BigInt(), - }, - }, - visited: []fetchedLog{}, - toAdd: []appendArgs{ - { - fl: fetchedLog{ - log: logpoller.Log{ - BlockNumber: 1, - TxHash: common.HexToHash("0x1"), - LogIndex: 0, - }, - upkeepID: core.GenUpkeepID(types.LogTrigger, "111").BigInt(), - }, - maxBlockLogs: 10, - maxUpkeepLogs: 2, - added: false, - }, - }, - expected: []fetchedLog{ - { - log: logpoller.Log{ - BlockNumber: 1, - TxHash: common.HexToHash("0x1"), - LogIndex: 0, - }, - upkeepID: core.GenUpkeepID(types.LogTrigger, "111").BigInt(), - }, - }, - }, - { - name: "visited log", - blockNumber: 1, - logs: []fetchedLog{}, - visited: []fetchedLog{ - { - log: logpoller.Log{ - BlockNumber: 1, - TxHash: common.HexToHash("0x1"), - LogIndex: 0, - }, - upkeepID: core.GenUpkeepID(types.LogTrigger, "111").BigInt(), - }, - }, - toAdd: []appendArgs{ - { - fl: fetchedLog{ - log: logpoller.Log{ - BlockNumber: 1, - TxHash: common.HexToHash("0x1"), - LogIndex: 0, - }, - upkeepID: core.GenUpkeepID(types.LogTrigger, "111").BigInt(), - }, - maxBlockLogs: 10, - maxUpkeepLogs: 2, - added: false, - }, - }, - expected: []fetchedLog{}, - }, - { - name: "upkeep log limits", - blockNumber: 1, - logs: []fetchedLog{}, - visited: []fetchedLog{}, - toAdd: []appendArgs{ - { - fl: fetchedLog{ - log: logpoller.Log{ - BlockNumber: 1, - TxHash: common.HexToHash("0x1"), - LogIndex: 0, - }, - upkeepID: core.GenUpkeepID(types.LogTrigger, "111").BigInt(), - }, - maxBlockLogs: 10, - maxUpkeepLogs: 2, - added: true, - }, - { - fl: fetchedLog{ - log: logpoller.Log{ - BlockNumber: 1, - TxHash: common.HexToHash("0x1"), - LogIndex: 1, - }, - upkeepID: core.GenUpkeepID(types.LogTrigger, "111").BigInt(), - }, - maxBlockLogs: 10, - maxUpkeepLogs: 2, - added: true, - }, - { - fl: fetchedLog{ - log: logpoller.Log{ - BlockNumber: 1, - TxHash: common.HexToHash("0x1"), - LogIndex: 2, - }, - upkeepID: core.GenUpkeepID(types.LogTrigger, "111").BigInt(), - }, - maxBlockLogs: 10, - maxUpkeepLogs: 2, - added: true, - dropped: true, - }, - }, - expected: []fetchedLog{ - { - log: logpoller.Log{ - BlockNumber: 1, - TxHash: common.HexToHash("0x1"), - LogIndex: 1, - }, - upkeepID: core.GenUpkeepID(types.LogTrigger, "111").BigInt(), - }, - { - log: logpoller.Log{ - BlockNumber: 1, - TxHash: common.HexToHash("0x1"), - LogIndex: 2, - }, - upkeepID: core.GenUpkeepID(types.LogTrigger, "111").BigInt(), - }, - }, - }, - { - name: "block log limits", - blockNumber: 1, - logs: []fetchedLog{}, - visited: []fetchedLog{}, - toAdd: []appendArgs{ - { - fl: fetchedLog{ - log: logpoller.Log{ - BlockNumber: 1, - TxHash: common.HexToHash("0x1"), - LogIndex: 0, - }, - upkeepID: core.GenUpkeepID(types.LogTrigger, "111").BigInt(), - }, - maxBlockLogs: 2, - maxUpkeepLogs: 4, - added: true, - }, - { - fl: fetchedLog{ - log: logpoller.Log{ - BlockNumber: 1, - TxHash: common.HexToHash("0x1"), - LogIndex: 1, - }, - upkeepID: core.GenUpkeepID(types.LogTrigger, "111").BigInt(), - }, - maxBlockLogs: 2, - maxUpkeepLogs: 4, - added: true, - }, - { - fl: fetchedLog{ - log: logpoller.Log{ - BlockNumber: 1, - TxHash: common.HexToHash("0x1"), - LogIndex: 2, - }, - upkeepID: core.GenUpkeepID(types.LogTrigger, "111").BigInt(), - }, - maxBlockLogs: 2, - maxUpkeepLogs: 4, - added: true, - dropped: true, - }, - }, - expected: []fetchedLog{ - { - log: logpoller.Log{ - BlockNumber: 1, - TxHash: common.HexToHash("0x1"), - LogIndex: 1, - }, - upkeepID: core.GenUpkeepID(types.LogTrigger, "111").BigInt(), - }, - { - log: logpoller.Log{ - BlockNumber: 1, - TxHash: common.HexToHash("0x1"), - LogIndex: 2, - }, - upkeepID: core.GenUpkeepID(types.LogTrigger, "111").BigInt(), - }, - }, - }, - } - - for _, tc := range tests { - t.Run(tc.name, func(t *testing.T) { - lggr := logger.TestLogger(t) - b := fetchedBlock{ - blockNumber: tc.blockNumber, - logs: make([]fetchedLog, len(tc.logs)), - visited: make([]fetchedLog, len(tc.visited)), - } - copy(b.logs, tc.logs) - copy(b.visited, tc.visited) - - for _, args := range tc.toAdd { - dropped, added := b.Append(lggr, args.fl, args.maxBlockLogs, args.maxUpkeepLogs) - require.Equal(t, args.added, added) - if args.dropped { - require.NotNil(t, dropped.upkeepID) - } else { - require.Nil(t, dropped.upkeepID) - } - } - // clear cached logIDs - for i := range b.logs { - b.logs[i].cachedLogID = "" - } - require.Equal(t, tc.expected, b.logs) - }) - } -} -func TestLogEventBuffer_FetchedBlock_Sort(t *testing.T) { - tests := []struct { - name string - blockNumber int64 - logs []fetchedLog - beforeSort []string - afterSort []string - iterations int - }{ - { - name: "no logs", - blockNumber: 10, - logs: []fetchedLog{}, - beforeSort: []string{}, - afterSort: []string{}, - }, - { - name: "single log", - blockNumber: 1, - logs: []fetchedLog{ - { - log: logpoller.Log{ - BlockHash: common.HexToHash("0x111"), - BlockNumber: 1, - TxHash: common.HexToHash("0x1"), - LogIndex: 0, - }, - }, - }, - beforeSort: []string{ - "0000000000000000000000000000000000000000000000000000000000000111000000000000000000000000000000000000000000000000000000000000000100000000", - }, - afterSort: []string{ - "0000000000000000000000000000000000000000000000000000000000000111000000000000000000000000000000000000000000000000000000000000000100000000", - }, - }, - { - name: "multiple logs with 10 iterations", - blockNumber: 1, - logs: []fetchedLog{ - { - log: logpoller.Log{ - BlockNumber: 1, - BlockHash: common.HexToHash("0xa25ebae1099f3fbae2525ebae279f3ae25e"), - TxHash: common.HexToHash("0xb711bd1103927611ee41152aa8ae27f3330"), - LogIndex: 0, - }, - upkeepID: core.GenUpkeepID(types.LogTrigger, "111").BigInt(), - }, - { - log: logpoller.Log{ - BlockNumber: 1, - BlockHash: common.HexToHash("0xa25ebae1099f3fbae2525ebae279f3ae25e"), - TxHash: common.HexToHash("0xa651bd1109922111ee411525ebae27f3fb6"), - LogIndex: 0, - }, - upkeepID: core.GenUpkeepID(types.LogTrigger, "222").BigInt(), - }, - { - log: logpoller.Log{ - BlockNumber: 1, - BlockHash: common.HexToHash("0xa25ebae1099f3fbae2525ebae279f3ae25e"), - TxHash: common.HexToHash("0xa651bd1109922111ee411525ebae27f3fb6"), - LogIndex: 4, - }, - upkeepID: core.GenUpkeepID(types.LogTrigger, "111").BigInt(), - }, - { - log: logpoller.Log{ - BlockNumber: 1, - BlockHash: common.HexToHash("0xa25ebae1099f3fbae2525ebae279f3ae25e"), - TxHash: common.HexToHash("0xa651bd1109922111ee411525ebae27f3fb6"), - LogIndex: 3, - }, - upkeepID: core.GenUpkeepID(types.LogTrigger, "222").BigInt(), - }, - { - log: logpoller.Log{ - BlockNumber: 1, - BlockHash: common.HexToHash("0xa25ebae1099f3fbae2525ebae279f3ae25e"), - TxHash: common.HexToHash("0xa651bd1109922111ee411525ebae27f3fb6"), - LogIndex: 2, - }, - upkeepID: core.GenUpkeepID(types.LogTrigger, "111").BigInt(), - }, - { - log: logpoller.Log{ - BlockNumber: 1, - BlockHash: common.HexToHash("0xa25ebae1099f3fbae2525ebae279f3ae25e"), - TxHash: common.HexToHash("0xa651bd1109922111ee411525ebae27f3fb6"), - LogIndex: 5, - }, - upkeepID: core.GenUpkeepID(types.LogTrigger, "111").BigInt(), - }, - { - log: logpoller.Log{ - BlockNumber: 1, - BlockHash: common.HexToHash("0xa25ebae1099f3fbae2525ebae279f3ae25e"), - TxHash: common.HexToHash("0xa651bd1109922111ee411525ebae27f3fb6"), - LogIndex: 3, - }, - upkeepID: core.GenUpkeepID(types.LogTrigger, "111").BigInt(), - }, - { - log: logpoller.Log{ - BlockNumber: 1, - BlockHash: common.HexToHash("0xa25ebae1099f3fbae2525ebae279f3ae25e"), - TxHash: common.HexToHash("0xa651bd1109922111ee411525ebae27f3fb6"), - LogIndex: 1, - }, - upkeepID: core.GenUpkeepID(types.LogTrigger, "111").BigInt(), - }, - }, - beforeSort: []string{ - "00000000000000000000000000000a25ebae1099f3fbae2525ebae279f3ae25e00000000000000000000000000000b711bd1103927611ee41152aa8ae27f333000000000", - "00000000000000000000000000000a25ebae1099f3fbae2525ebae279f3ae25e00000000000000000000000000000a651bd1109922111ee411525ebae27f3fb600000000", - "00000000000000000000000000000a25ebae1099f3fbae2525ebae279f3ae25e00000000000000000000000000000a651bd1109922111ee411525ebae27f3fb600000004", - "00000000000000000000000000000a25ebae1099f3fbae2525ebae279f3ae25e00000000000000000000000000000a651bd1109922111ee411525ebae27f3fb600000003", - "00000000000000000000000000000a25ebae1099f3fbae2525ebae279f3ae25e00000000000000000000000000000a651bd1109922111ee411525ebae27f3fb600000002", - "00000000000000000000000000000a25ebae1099f3fbae2525ebae279f3ae25e00000000000000000000000000000a651bd1109922111ee411525ebae27f3fb600000005", - "00000000000000000000000000000a25ebae1099f3fbae2525ebae279f3ae25e00000000000000000000000000000a651bd1109922111ee411525ebae27f3fb600000003", - "00000000000000000000000000000a25ebae1099f3fbae2525ebae279f3ae25e00000000000000000000000000000a651bd1109922111ee411525ebae27f3fb600000001", - }, - afterSort: []string{ - "00000000000000000000000000000a25ebae1099f3fbae2525ebae279f3ae25e00000000000000000000000000000b711bd1103927611ee41152aa8ae27f333000000000", - "00000000000000000000000000000a25ebae1099f3fbae2525ebae279f3ae25e00000000000000000000000000000a651bd1109922111ee411525ebae27f3fb600000000", - "00000000000000000000000000000a25ebae1099f3fbae2525ebae279f3ae25e00000000000000000000000000000a651bd1109922111ee411525ebae27f3fb600000001", - "00000000000000000000000000000a25ebae1099f3fbae2525ebae279f3ae25e00000000000000000000000000000a651bd1109922111ee411525ebae27f3fb600000002", - "00000000000000000000000000000a25ebae1099f3fbae2525ebae279f3ae25e00000000000000000000000000000a651bd1109922111ee411525ebae27f3fb600000003", - "00000000000000000000000000000a25ebae1099f3fbae2525ebae279f3ae25e00000000000000000000000000000a651bd1109922111ee411525ebae27f3fb600000003", - "00000000000000000000000000000a25ebae1099f3fbae2525ebae279f3ae25e00000000000000000000000000000a651bd1109922111ee411525ebae27f3fb600000004", - "00000000000000000000000000000a25ebae1099f3fbae2525ebae279f3ae25e00000000000000000000000000000a651bd1109922111ee411525ebae27f3fb600000005", - }, - iterations: 10, - }, - } - - for _, tc := range tests { - t.Run(tc.name, func(t *testing.T) { - b := fetchedBlock{ - blockNumber: tc.blockNumber, - logs: make([]fetchedLog, len(tc.logs)), - } - if tc.iterations == 0 { - tc.iterations = 1 - } - // performing the same multiple times should yield the same result - // default is one iteration - for i := 0; i < tc.iterations; i++ { - copy(b.logs, tc.logs) - logIDs := getLogIds(b) - require.Equal(t, len(tc.beforeSort), len(logIDs)) - require.Equal(t, tc.beforeSort, logIDs) - b.Sort() - logIDsAfterSort := getLogIds(b) - require.Equal(t, len(tc.afterSort), len(logIDsAfterSort)) - require.Equal(t, tc.afterSort, logIDsAfterSort) - } - }) - } -} - -func TestLogEventBuffer_FetchedBlock_Clone(t *testing.T) { - b1 := fetchedBlock{ - blockNumber: 1, - logs: []fetchedLog{ - { - log: logpoller.Log{ - BlockNumber: 1, - TxHash: common.HexToHash("0x1"), - LogIndex: 0, - }, - upkeepID: core.GenUpkeepID(types.LogTrigger, "111").BigInt(), - }, - { - log: logpoller.Log{ - BlockNumber: 1, - TxHash: common.HexToHash("0x1"), - LogIndex: 2, - }, - upkeepID: core.GenUpkeepID(types.LogTrigger, "111").BigInt(), - }, - }, - } - - b2 := b1.Clone() - require.Equal(t, b1.blockNumber, b2.blockNumber) - require.Equal(t, len(b1.logs), len(b2.logs)) - require.Equal(t, b1.logs[0].log.BlockNumber, b2.logs[0].log.BlockNumber) - - b1.blockNumber = 2 - b1.logs[0].log.BlockNumber = 2 - require.NotEqual(t, b1.blockNumber, b2.blockNumber) - require.NotEqual(t, b1.logs[0].log.BlockNumber, b2.logs[0].log.BlockNumber) -} - -func verifyBlockNumbers(t *testing.T, logs []fetchedLog, bns ...int64) { - require.Equal(t, len(bns), len(logs), "expected length mismatch") - for i, log := range logs { - require.Equal(t, bns[i], log.log.BlockNumber, "wrong block number") - } -} - -func getLogIds(b fetchedBlock) []string { - logIDs := make([]string, len(b.logs)) - for i, l := range b.logs { - ext := ocr2keepers.LogTriggerExtension{ - TxHash: l.log.TxHash, - Index: uint32(l.log.LogIndex), - BlockHash: l.log.BlockHash, - } - logIDs[i] = hex.EncodeToString(ext.LogIdentifier()) - } - return logIDs -} diff --git a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/logprovider/buffer_v1.go b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/logprovider/buffer_v1.go index e58d5ad9c93..00a56496a00 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/logprovider/buffer_v1.go +++ b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/logprovider/buffer_v1.go @@ -6,8 +6,9 @@ import ( "sync" "sync/atomic" + "github.com/smartcontractkit/chainlink-common/pkg/logger" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" - "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/prommetrics" ) @@ -79,7 +80,7 @@ type logBuffer struct { func NewLogBuffer(lggr logger.Logger, lookback, blockRate, logLimit uint32) LogBuffer { return &logBuffer{ - lggr: lggr.Named("KeepersRegistry.LogEventBufferV1"), + lggr: logger.Sugared(lggr).Named("KeepersRegistry").Named("LogEventBufferV1"), opts: newLogBufferOptions(lookback, blockRate, logLimit), lastBlockSeen: new(atomic.Int64), queueIDs: []string{}, @@ -313,7 +314,7 @@ type upkeepLogQueue struct { func newUpkeepLogQueue(lggr logger.Logger, id *big.Int, opts *logBufferOptions) *upkeepLogQueue { return &upkeepLogQueue{ - lggr: lggr.With("upkeepID", id.String()), + lggr: logger.With(lggr, "upkeepID", id.String()), id: id, opts: opts, logs: map[int64][]logpoller.Log{}, diff --git a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/logprovider/buffer_v1_test.go b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/logprovider/buffer_v1_test.go index f742d39689c..4c46b9b3fea 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/logprovider/buffer_v1_test.go +++ b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/logprovider/buffer_v1_test.go @@ -54,8 +54,6 @@ func TestLogEventBufferV1_SyncFilters(t *testing.T) { type readableLogger struct { logger.Logger DebugwFn func(msg string, keysAndValues ...interface{}) - NamedFn func(name string) logger.Logger - WithFn func(args ...interface{}) logger.Logger } func (l *readableLogger) Debugw(msg string, keysAndValues ...interface{}) { @@ -74,6 +72,7 @@ func TestLogEventBufferV1_EnqueueViolations(t *testing.T) { t.Run("enqueuing logs for a block older than latest seen logs a message", func(t *testing.T) { logReceived := false readableLogger := &readableLogger{ + Logger: logger.TestLogger(t), DebugwFn: func(msg string, keysAndValues ...interface{}) { if msg == "enqueuing logs from a block older than latest seen block" { logReceived = true @@ -103,6 +102,7 @@ func TestLogEventBufferV1_EnqueueViolations(t *testing.T) { t.Run("enqueuing logs for the same block over multiple calls logs a message", func(t *testing.T) { logReceived := false readableLogger := &readableLogger{ + Logger: logger.TestLogger(t), DebugwFn: func(msg string, keysAndValues ...interface{}) { if msg == "enqueuing logs again for a previously seen block" { logReceived = true diff --git a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/logprovider/factory.go b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/logprovider/factory.go index 19302624b49..57b48841a20 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/logprovider/factory.go +++ b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/logprovider/factory.go @@ -4,9 +4,10 @@ import ( "math/big" "time" + "github.com/smartcontractkit/chainlink-common/pkg/logger" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" - "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/core" ) @@ -35,23 +36,12 @@ type LogTriggersOptions struct { // Finality depth is the number of blocks to wait before considering a block final. FinalityDepth int64 - // TODO: (AUTO-9355) remove once we have a single version - BufferVersion BufferVersion // LogLimit is the minimum number of logs to process in a single block window. LogLimit uint32 // BlockRate determines the block window for log processing. BlockRate uint32 } -// BufferVersion is the version of the log buffer. -// TODO: (AUTO-9355) remove once we have a single version -type BufferVersion string - -const ( - BufferVersionDefault BufferVersion = "" - BufferVersionV1 BufferVersion = "v1" -) - func NewOptions(finalityDepth int64, chainID *big.Int) LogTriggersOptions { opts := new(LogTriggersOptions) opts.chainID = chainID @@ -85,7 +75,7 @@ func (o *LogTriggersOptions) Defaults(finalityDepth int64) { func (o *LogTriggersOptions) defaultBlockRate() uint32 { switch o.chainID.Int64() { - case 42161, 421613, 421614: // Arbitrum + case 42161, 421613, 421614: // Arbitrum, Arb Goerli, Arb Sepolia return 2 default: return 1 @@ -94,10 +84,10 @@ func (o *LogTriggersOptions) defaultBlockRate() uint32 { func (o *LogTriggersOptions) defaultLogLimit() uint32 { switch o.chainID.Int64() { - case 1, 4, 5, 42, 11155111: // Eth + case 1, 4, 5, 42, 11155111: // Eth, Rinkeby, Goerli, Kovan, Sepolia return 20 - case 10, 420, 56, 97, 137, 80001, 43113, 43114, 8453, 84531: // Optimism, BSC, Polygon, Avax, Base - return 5 + case 10, 420, 11155420, 56, 97, 137, 80001, 80002, 43114, 43113, 8453, 84531, 84532: // Optimism, OP Goerli, OP Sepolia, BSC, BSC Test, Polygon, Mumbai, Amoy, Avax, Avax Fuji, Base, Base Goerli, Base Sepolia + return 4 default: return 1 } diff --git a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/logprovider/integration_test.go b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/logprovider/integration_test.go index cdd800071da..49741b79115 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/logprovider/integration_test.go +++ b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/logprovider/integration_test.go @@ -25,124 +25,101 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/log_upkeep_counter_wrapper" "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" - "github.com/smartcontractkit/chainlink/v2/core/internal/cltest/heavyweight" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" evmregistry21 "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/core" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/logprovider" + "github.com/smartcontractkit/chainlink/v2/core/utils/testutils/heavyweight" ) func TestIntegration_LogEventProvider(t *testing.T) { - tests := []struct { - name string - bufferVersion logprovider.BufferVersion - logLimit uint32 - }{ - { - name: "default buffer", - bufferVersion: logprovider.BufferVersionDefault, - logLimit: 10, - }, - { - name: "buffer v1", - bufferVersion: logprovider.BufferVersionV1, - logLimit: 10, - }, - } + ctx, cancel := context.WithCancel(testutils.Context(t)) + defer cancel() + + backend, stopMining, accounts := setupBackend(t) + defer stopMining() + carrol := accounts[2] + + db := setupDB(t) + defer db.Close() + + opts := logprovider.NewOptions(200, big.NewInt(1)) + opts.ReadInterval = time.Second / 2 + opts.LogLimit = 10 + + lp, ethClient := setupDependencies(t, db, backend) + filterStore := logprovider.NewUpkeepFilterStore() + provider, _ := setup(logger.TestLogger(t), lp, nil, nil, filterStore, &opts) + logProvider := provider.(logprovider.LogEventProviderTest) + + n := 10 + + backend.Commit() + lp.PollAndSaveLogs(ctx, 1) // Ensure log poller has a latest block - for _, tc := range tests { - bufferVersion, logLimit := tc.bufferVersion, tc.logLimit - t.Run(tc.name, func(t *testing.T) { - ctx, cancel := context.WithCancel(testutils.Context(t)) - defer cancel() - - backend, stopMining, accounts := setupBackend(t) - defer stopMining() - carrol := accounts[2] - - db := setupDB(t) - defer db.Close() - - opts := logprovider.NewOptions(200, big.NewInt(1)) - opts.ReadInterval = time.Second / 2 - opts.BufferVersion = bufferVersion - opts.LogLimit = logLimit - - lp, ethClient := setupDependencies(t, db, backend) - filterStore := logprovider.NewUpkeepFilterStore() - provider, _ := setup(logger.TestLogger(t), lp, nil, nil, filterStore, &opts) - logProvider := provider.(logprovider.LogEventProviderTest) - - n := 10 - - backend.Commit() - lp.PollAndSaveLogs(ctx, 1) // Ensure log poller has a latest block - - ids, addrs, contracts := deployUpkeepCounter(ctx, t, n, ethClient, backend, carrol, logProvider) - lp.PollAndSaveLogs(ctx, int64(n)) - - go func() { - if err := logProvider.Start(ctx); err != nil { - t.Logf("error starting log provider: %s", err) - t.Fail() - } - }() - defer logProvider.Close() - - logsRounds := 10 - - poll := pollFn(ctx, t, lp, ethClient) - - triggerEvents(ctx, t, backend, carrol, logsRounds, poll, contracts...) - - poll(backend.Commit()) - - waitLogPoller(ctx, t, backend, lp, ethClient) - - waitLogProvider(ctx, t, logProvider, 3) - - allPayloads := collectPayloads(ctx, t, logProvider, n, logsRounds/2) - require.GreaterOrEqual(t, len(allPayloads), n, - "failed to get logs after restart") - - t.Run("Restart", func(t *testing.T) { - t.Log("restarting log provider") - // assuming that our service was closed and restarted, - // we should be able to backfill old logs and fetch new ones - filterStore := logprovider.NewUpkeepFilterStore() - logProvider2 := logprovider.NewLogProvider(logger.TestLogger(t), lp, big.NewInt(1), logprovider.NewLogEventsPacker(), filterStore, opts) - - poll(backend.Commit()) - go func() { - if err2 := logProvider2.Start(ctx); err2 != nil { - t.Logf("error starting log provider: %s", err2) - t.Fail() - } - }() - defer logProvider2.Close() - - // re-register filters - for i, id := range ids { - err := logProvider2.RegisterFilter(ctx, logprovider.FilterOptions{ - UpkeepID: id, - TriggerConfig: newPlainLogTriggerConfig(addrs[i]), - // using block number at which the upkeep was registered, - // before we emitted any logs - UpdateBlock: uint64(n), - }) - require.NoError(t, err) - } - - waitLogProvider(ctx, t, logProvider2, 2) - - t.Log("getting logs after restart") - logsAfterRestart := collectPayloads(ctx, t, logProvider2, n, 5) - require.GreaterOrEqual(t, len(logsAfterRestart), n, - "failed to get logs after restart") + ids, addrs, contracts := deployUpkeepCounter(ctx, t, n, ethClient, backend, carrol, logProvider) + lp.PollAndSaveLogs(ctx, int64(n)) + + go func() { + if err := logProvider.Start(ctx); err != nil { + t.Logf("error starting log provider: %s", err) + t.Fail() + } + }() + defer logProvider.Close() + + logsRounds := 10 + + poll := pollFn(ctx, t, lp, ethClient) + + triggerEvents(ctx, t, backend, carrol, logsRounds, poll, contracts...) + + poll(backend.Commit()) + + waitLogPoller(ctx, t, backend, lp, ethClient) + + waitLogProvider(ctx, t, logProvider, 3) + + allPayloads := collectPayloads(ctx, t, logProvider, n, logsRounds/2) + require.GreaterOrEqual(t, len(allPayloads), n, + "failed to get logs after restart") + + t.Run("Restart", func(t *testing.T) { + t.Log("restarting log provider") + // assuming that our service was closed and restarted, + // we should be able to backfill old logs and fetch new ones + filterStore := logprovider.NewUpkeepFilterStore() + logProvider2 := logprovider.NewLogProvider(logger.TestLogger(t), lp, big.NewInt(1), logprovider.NewLogEventsPacker(), filterStore, opts) + + poll(backend.Commit()) + go func() { + if err2 := logProvider2.Start(ctx); err2 != nil { + t.Logf("error starting log provider: %s", err2) + t.Fail() + } + }() + defer logProvider2.Close() + + // re-register filters + for i, id := range ids { + err := logProvider2.RegisterFilter(ctx, logprovider.FilterOptions{ + UpkeepID: id, + TriggerConfig: newPlainLogTriggerConfig(addrs[i]), + // using block number at which the upkeep was registered, + // before we emitted any logs + UpdateBlock: uint64(n), }) - }) - } + require.NoError(t, err) + } + + waitLogProvider(ctx, t, logProvider2, 2) + + t.Log("getting logs after restart") + logsAfterRestart := collectPayloads(ctx, t, logProvider2, n, 5) + require.GreaterOrEqual(t, len(logsAfterRestart), n, + "failed to get logs after restart") + }) } func TestIntegration_LogEventProvider_UpdateConfig(t *testing.T) { @@ -219,78 +196,55 @@ func TestIntegration_LogEventProvider_UpdateConfig(t *testing.T) { } func TestIntegration_LogEventProvider_Backfill(t *testing.T) { - tests := []struct { - name string - bufferVersion logprovider.BufferVersion - logLimit uint32 - }{ - { - name: "default buffer", - bufferVersion: logprovider.BufferVersionDefault, - logLimit: 10, - }, - { - name: "buffer v1", - bufferVersion: logprovider.BufferVersionV1, - logLimit: 10, - }, - } - - for _, tc := range tests { - bufferVersion, limitLow := tc.bufferVersion, tc.logLimit - t.Run(tc.name, func(t *testing.T) { - ctx, cancel := context.WithTimeout(testutils.Context(t), time.Second*60) - defer cancel() + ctx, cancel := context.WithTimeout(testutils.Context(t), time.Second*60) + defer cancel() - backend, stopMining, accounts := setupBackend(t) - defer stopMining() - carrol := accounts[2] + backend, stopMining, accounts := setupBackend(t) + defer stopMining() + carrol := accounts[2] - db := setupDB(t) - defer db.Close() + db := setupDB(t) + defer db.Close() - opts := logprovider.NewOptions(200, big.NewInt(1)) - opts.ReadInterval = time.Second / 4 - opts.BufferVersion = bufferVersion - opts.LogLimit = limitLow + opts := logprovider.NewOptions(200, big.NewInt(1)) + opts.ReadInterval = time.Second / 4 + opts.LogLimit = 10 - lp, ethClient := setupDependencies(t, db, backend) - filterStore := logprovider.NewUpkeepFilterStore() - provider, _ := setup(logger.TestLogger(t), lp, nil, nil, filterStore, &opts) - logProvider := provider.(logprovider.LogEventProviderTest) + lp, ethClient := setupDependencies(t, db, backend) + filterStore := logprovider.NewUpkeepFilterStore() + provider, _ := setup(logger.TestLogger(t), lp, nil, nil, filterStore, &opts) + logProvider := provider.(logprovider.LogEventProviderTest) - n := 10 + n := 10 - backend.Commit() - lp.PollAndSaveLogs(ctx, 1) // Ensure log poller has a latest block - _, _, contracts := deployUpkeepCounter(ctx, t, n, ethClient, backend, carrol, logProvider) + backend.Commit() + lp.PollAndSaveLogs(ctx, 1) // Ensure log poller has a latest block + _, _, contracts := deployUpkeepCounter(ctx, t, n, ethClient, backend, carrol, logProvider) - poll := pollFn(ctx, t, lp, ethClient) + poll := pollFn(ctx, t, lp, ethClient) - rounds := 8 - for i := 0; i < rounds; i++ { - poll(backend.Commit()) - triggerEvents(ctx, t, backend, carrol, n, poll, contracts...) - poll(backend.Commit()) - } + rounds := 8 + for i := 0; i < rounds; i++ { + poll(backend.Commit()) + triggerEvents(ctx, t, backend, carrol, n, poll, contracts...) + poll(backend.Commit()) + } - waitLogPoller(ctx, t, backend, lp, ethClient) + waitLogPoller(ctx, t, backend, lp, ethClient) - // starting the log provider should backfill logs - go func() { - if startErr := logProvider.Start(ctx); startErr != nil { - t.Logf("error starting log provider: %s", startErr) - t.Fail() - } - }() - defer logProvider.Close() + // starting the log provider should backfill logs + go func() { + if startErr := logProvider.Start(ctx); startErr != nil { + t.Logf("error starting log provider: %s", startErr) + t.Fail() + } + }() + defer logProvider.Close() - waitLogProvider(ctx, t, logProvider, 3) + waitLogProvider(ctx, t, logProvider, 3) - allPayloads := collectPayloads(ctx, t, logProvider, n*rounds, 5) - require.GreaterOrEqual(t, len(allPayloads), len(contracts), "failed to backfill logs") - }) - } + allPayloads := collectPayloads(ctx, t, logProvider, n*rounds, 5) + require.GreaterOrEqual(t, len(allPayloads), len(contracts), "failed to backfill logs") } func TestIntegration_LogRecoverer_Backfill(t *testing.T) { diff --git a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/logprovider/provider.go b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/logprovider/provider.go index 3609d0a4654..50b2ebc0d06 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/logprovider/provider.go +++ b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/logprovider/provider.go @@ -16,13 +16,12 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" - ocr2keepers "github.com/smartcontractkit/chainlink-common/pkg/types/automation" - + "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink-common/pkg/services" + ocr2keepers "github.com/smartcontractkit/chainlink-common/pkg/types/automation" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" ac "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/automation_compatible_utils" - "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/core" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/prommetrics" "github.com/smartcontractkit/chainlink/v2/core/utils" @@ -81,13 +80,8 @@ type LogEventProviderTest interface { CurrentPartitionIdx() uint64 } -type LogEventProviderFeatures interface { - WithBufferVersion(v BufferVersion) -} - var _ LogEventProvider = &logEventProvider{} var _ LogEventProviderTest = &logEventProvider{} -var _ LogEventProviderFeatures = &logEventProvider{} // logEventProvider manages log filters for upkeeps and enables to read the log events. type logEventProvider struct { @@ -104,8 +98,7 @@ type logEventProvider struct { registerLock sync.Mutex filterStore UpkeepFilterStore - buffer *logEventBuffer - bufferV1 LogBuffer + buffer LogBuffer opts LogTriggersOptions @@ -117,10 +110,9 @@ type logEventProvider struct { func NewLogProvider(lggr logger.Logger, poller logpoller.LogPoller, chainID *big.Int, packer LogDataPacker, filterStore UpkeepFilterStore, opts LogTriggersOptions) *logEventProvider { return &logEventProvider{ threadCtrl: utils.NewThreadControl(), - lggr: lggr.Named("KeepersRegistry.LogEventProvider"), + lggr: logger.Named(lggr, "KeepersRegistry.LogEventProvider"), packer: packer, - buffer: newLogEventBuffer(lggr, int(opts.LookbackBlocks), defaultNumOfLogUpkeeps, defaultFastExecLogsHigh), - bufferV1: NewLogBuffer(lggr, uint32(opts.LookbackBlocks), opts.BlockRate, opts.LogLimit), + buffer: NewLogBuffer(lggr, uint32(opts.LookbackBlocks), opts.BlockRate, opts.LogLimit), poller: poller, opts: opts, filterStore: filterStore, @@ -142,25 +134,12 @@ func (p *logEventProvider) SetConfig(cfg ocr2keepers.LogEventProviderConfig) { logLimit = p.opts.defaultLogLimit() } - p.lggr.With("where", "setConfig").Infow("setting config ", "bockRate", blockRate, "logLimit", logLimit) + p.lggr.Infow("setting config", "where", "setConfig", "bockRate", blockRate, "logLimit", logLimit) atomic.StoreUint32(&p.opts.BlockRate, blockRate) atomic.StoreUint32(&p.opts.LogLimit, logLimit) - switch p.opts.BufferVersion { - case BufferVersionV1: - p.bufferV1.SetConfig(uint32(p.opts.LookbackBlocks), blockRate, logLimit) - default: - } -} - -func (p *logEventProvider) WithBufferVersion(v BufferVersion) { - p.lock.Lock() - defer p.lock.Unlock() - - p.lggr.Debugw("with buffer version", "version", v) - - p.opts.BufferVersion = v + p.buffer.SetConfig(uint32(p.opts.LookbackBlocks), blockRate, logLimit) } func (p *logEventProvider) Start(context.Context) error { @@ -176,7 +155,7 @@ func (p *logEventProvider) Start(context.Context) error { } p.threadCtrl.Go(func(ctx context.Context) { - lggr := p.lggr.With("where", "scheduler") + lggr := logger.With(p.lggr, "where", "scheduler") p.scheduleReadJobs(ctx, func(ids []*big.Int) { select { @@ -197,7 +176,7 @@ func (p *logEventProvider) Start(context.Context) error { for { select { case <-ticker.C: - if err := p.syncBufferFilters(); err != nil { + if err := p.buffer.SyncFilters(p.filterStore); err != nil { p.lggr.Warnw("failed to sync buffer filters", "err", err) } case <-ctx.Done(): @@ -259,22 +238,11 @@ func (p *logEventProvider) getLogsFromBuffer(latestBlock int64) []ocr2keepers.Up start = 1 } - switch p.opts.BufferVersion { - case BufferVersionV1: - payloads = p.minimumCommitmentDequeue(latestBlock, start) + payloads = p.minimumCommitmentDequeue(latestBlock, start) - // if we have remaining capacity following minimum commitment dequeue, perform a best effort dequeue - if len(payloads) < MaxPayloads { - payloads = p.bestEffortDequeue(latestBlock, start, payloads) - } - default: - logs := p.buffer.dequeueRange(start, latestBlock, AllowedLogsPerUpkeep, MaxPayloads) - for _, l := range logs { - payload, err := p.createPayload(l.upkeepID, l.log) - if err == nil { - payloads = append(payloads, payload) - } - } + // if we have remaining capacity following minimum commitment dequeue, perform a best effort dequeue + if len(payloads) < MaxPayloads { + payloads = p.bestEffortDequeue(latestBlock, start, payloads) } return payloads @@ -290,7 +258,7 @@ func (p *logEventProvider) minimumCommitmentDequeue(latestBlock, start int64) [] startWindow, _ := getBlockWindow(start, blockRate) // dequeue the minimum number logs (log limit, varies by chain) per upkeep for this block window - logs, remaining := p.bufferV1.Dequeue(startWindow, MaxPayloads-len(payloads), true) + logs, remaining := p.buffer.Dequeue(startWindow, MaxPayloads-len(payloads), true) if len(logs) > 0 { p.lggr.Debugw("minimum commitment dequeue", "start", start, "latestBlock", latestBlock, "logs", len(logs), "remaining", remaining) } @@ -316,7 +284,7 @@ func (p *logEventProvider) bestEffortDequeue(latestBlock, start int64, payloads startWindow, _ := getBlockWindow(start, blockRate) // dequeue as many logs as we can, based on remaining capacity, for this block window - logs, remaining := p.bufferV1.Dequeue(startWindow, MaxPayloads-len(payloads), false) + logs, remaining := p.buffer.Dequeue(startWindow, MaxPayloads-len(payloads), false) if len(logs) > 0 { p.lggr.Debugw("best effort dequeue", "start", start, "latestBlock", latestBlock, "logs", len(logs), "remaining", remaining) } @@ -400,7 +368,7 @@ func (p *logEventProvider) startReader(pctx context.Context, readQ <-chan []*big ctx, cancel := context.WithCancel(pctx) defer cancel() - lggr := p.lggr.With("where", "reader") + lggr := logger.With(p.lggr, "where", "reader") for { select { @@ -522,12 +490,8 @@ func (p *logEventProvider) readLogs(ctx context.Context, latest int64, filters [ } filteredLogs := filter.Select(logs...) - switch p.opts.BufferVersion { - case BufferVersionV1: - p.bufferV1.Enqueue(filter.upkeepID, filteredLogs...) - default: - p.buffer.enqueue(filter.upkeepID, filteredLogs...) - } + p.buffer.Enqueue(filter.upkeepID, filteredLogs...) + // Update the lastPollBlock for filter in slice this is then // updated into filter store in updateFiltersLastPoll filters[i].lastPollBlock = latest @@ -535,16 +499,3 @@ func (p *logEventProvider) readLogs(ctx context.Context, latest int64, filters [ return merr } - -func (p *logEventProvider) syncBufferFilters() error { - p.lock.RLock() - buffVersion := p.opts.BufferVersion - p.lock.RUnlock() - - switch buffVersion { - case BufferVersionV1: - return p.bufferV1.SyncFilters(p.filterStore) - default: - return nil - } -} diff --git a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/logprovider/provider_life_cycle.go b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/logprovider/provider_life_cycle.go index db47ac2ecd8..cbd493bf2e4 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/logprovider/provider_life_cycle.go +++ b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/logprovider/provider_life_cycle.go @@ -10,6 +10,8 @@ import ( "github.com/ethereum/go-ethereum/common" + "github.com/smartcontractkit/chainlink-common/pkg/logger" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" ) @@ -106,7 +108,7 @@ func (p *logEventProvider) register(ctx context.Context, lpFilter logpoller.Filt if err != nil { return fmt.Errorf("failed to get latest block while registering filter: %w", err) } - lggr := p.lggr.With("upkeepID", ufilter.upkeepID.String()) + lggr := logger.With(p.lggr, "upkeepID", ufilter.upkeepID.String()) logPollerHasFilter := p.poller.HasFilter(lpFilter.Name) filterStoreHasFilter := p.filterStore.Has(ufilter.upkeepID) if filterStoreHasFilter { diff --git a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/logprovider/provider_test.go b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/logprovider/provider_test.go index 282f89d370c..9536a24ce06 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/logprovider/provider_test.go +++ b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/logprovider/provider_test.go @@ -258,37 +258,14 @@ func TestLogEventProvider_ReadLogs(t *testing.T) { filterStore := NewUpkeepFilterStore() p := NewLogProvider(logger.TestLogger(t), mp, big.NewInt(1), &mockedPacker{}, filterStore, NewOptions(200, big.NewInt(1))) - var ids []*big.Int for i := 0; i < 10; i++ { cfg, f := newEntry(p, i+1) - ids = append(ids, f.upkeepID) require.NoError(t, p.RegisterFilter(ctx, FilterOptions{ UpkeepID: f.upkeepID, TriggerConfig: cfg, })) } - t.Run("no entries", func(t *testing.T) { - require.NoError(t, p.ReadLogs(ctx, big.NewInt(999999))) - logs := p.buffer.peek(10) - require.Len(t, logs, 0) - }) - - t.Run("has entries", func(t *testing.T) { - require.NoError(t, p.ReadLogs(ctx, ids[:2]...)) - logs := p.buffer.peek(10) - require.Len(t, logs, 2) - - var updatedFilters []upkeepFilter - filterStore.RangeFiltersByIDs(func(i int, f upkeepFilter) { - updatedFilters = append(updatedFilters, f.Clone()) - }, ids[:2]...) - for _, f := range updatedFilters { - // Last poll block should be updated - require.Equal(t, int64(1), f.lastPollBlock) - } - }) - // TODO: test rate limiting } @@ -342,7 +319,6 @@ func remainingBlockWindowCounts(queues map[string]*upkeepLogQueue, blockRate int func TestLogEventProvider_GetLatestPayloads(t *testing.T) { t.Run("dequeuing from an empty buffer returns 0 logs", func(t *testing.T) { opts := NewOptions(200, big.NewInt(42161)) - opts.BufferVersion = "v1" logPoller := &mockLogPoller{ LatestBlockFn: func(ctx context.Context) (int64, error) { @@ -361,7 +337,6 @@ func TestLogEventProvider_GetLatestPayloads(t *testing.T) { t.Run("a single log for a single upkeep gets dequeued", func(t *testing.T) { opts := NewOptions(200, big.NewInt(42161)) - opts.BufferVersion = "v1" logPoller := &mockLogPoller{ LatestBlockFn: func(ctx context.Context) (int64, error) { @@ -373,7 +348,7 @@ func TestLogEventProvider_GetLatestPayloads(t *testing.T) { ctx := context.Background() - buffer := provider.bufferV1 + buffer := provider.buffer buffer.Enqueue(big.NewInt(1), logpoller.Log{BlockNumber: 1, TxHash: common.HexToHash("0x1"), LogIndex: 0}) @@ -384,7 +359,6 @@ func TestLogEventProvider_GetLatestPayloads(t *testing.T) { t.Run("a log per upkeep for 4 upkeeps across 4 blocks (2 separate block windows) is dequeued, for a total of 4 payloads", func(t *testing.T) { opts := NewOptions(200, big.NewInt(42161)) - opts.BufferVersion = "v1" logPoller := &mockLogPoller{ LatestBlockFn: func(ctx context.Context) (int64, error) { @@ -396,7 +370,7 @@ func TestLogEventProvider_GetLatestPayloads(t *testing.T) { ctx := context.Background() - buffer := provider.bufferV1 + buffer := provider.buffer buffer.Enqueue(big.NewInt(1), logpoller.Log{BlockNumber: 1, TxHash: common.HexToHash("0x1"), LogIndex: 0}) buffer.Enqueue(big.NewInt(2), logpoller.Log{BlockNumber: 2, TxHash: common.HexToHash("0x2"), LogIndex: 0}) @@ -410,7 +384,6 @@ func TestLogEventProvider_GetLatestPayloads(t *testing.T) { t.Run("100 logs are dequeued for a single upkeep, 1 log for every block window across 100 blocks followed by best effort", func(t *testing.T) { opts := NewOptions(200, big.NewInt(42161)) - opts.BufferVersion = "v1" logPoller := &mockLogPoller{ LatestBlockFn: func(ctx context.Context) (int64, error) { @@ -422,7 +395,7 @@ func TestLogEventProvider_GetLatestPayloads(t *testing.T) { ctx := context.Background() - buffer := provider.bufferV1.(*logBuffer) + buffer := provider.buffer.(*logBuffer) for i := 0; i < 100; i++ { buffer.Enqueue(big.NewInt(1), logpoller.Log{BlockNumber: int64(i + 1), TxHash: common.HexToHash(fmt.Sprintf("0x%d", i+1)), LogIndex: 0}) @@ -439,7 +412,6 @@ func TestLogEventProvider_GetLatestPayloads(t *testing.T) { t.Run("100 logs are dequeued for two upkeeps, 25 logs each as min commitment (50 logs total best effort), followed by best effort", func(t *testing.T) { opts := NewOptions(200, big.NewInt(42161)) - opts.BufferVersion = "v1" logPoller := &mockLogPoller{ LatestBlockFn: func(ctx context.Context) (int64, error) { @@ -451,7 +423,7 @@ func TestLogEventProvider_GetLatestPayloads(t *testing.T) { ctx := context.Background() - buffer := provider.bufferV1.(*logBuffer) + buffer := provider.buffer.(*logBuffer) for i := 0; i < 100; i++ { buffer.Enqueue(big.NewInt(1), logpoller.Log{BlockNumber: int64(i + 1), TxHash: common.HexToHash(fmt.Sprintf("0x1%d", i+1)), LogIndex: 0}) @@ -491,7 +463,6 @@ func TestLogEventProvider_GetLatestPayloads(t *testing.T) { t.Run("minimum guaranteed for all windows including an incomplete window followed by best effort", func(t *testing.T) { opts := NewOptions(200, big.NewInt(42161)) - opts.BufferVersion = "v1" logPoller := &mockLogPoller{ LatestBlockFn: func(ctx context.Context) (int64, error) { @@ -503,7 +474,7 @@ func TestLogEventProvider_GetLatestPayloads(t *testing.T) { ctx := context.Background() - buffer := provider.bufferV1.(*logBuffer) + buffer := provider.buffer.(*logBuffer) for i := 0; i < 102; i++ { buffer.Enqueue(big.NewInt(1), logpoller.Log{BlockNumber: int64(i + 1), TxHash: common.HexToHash(fmt.Sprintf("0x1%d", i+1)), LogIndex: 0}) @@ -551,7 +522,6 @@ func TestLogEventProvider_GetLatestPayloads(t *testing.T) { t.Run("min dequeue followed by best effort followed by reorg followed by best effort", func(t *testing.T) { opts := NewOptions(200, big.NewInt(42161)) - opts.BufferVersion = "v1" logPoller := &mockLogPoller{ LatestBlockFn: func(ctx context.Context) (int64, error) { @@ -563,7 +533,7 @@ func TestLogEventProvider_GetLatestPayloads(t *testing.T) { ctx := context.Background() - buffer := provider.bufferV1.(*logBuffer) + buffer := provider.buffer.(*logBuffer) for i := 0; i < 100; i++ { buffer.Enqueue(big.NewInt(1), logpoller.Log{BlockNumber: int64(i + 1), TxHash: common.HexToHash(fmt.Sprintf("0x1%d", i+1)), LogIndex: 0}) @@ -606,7 +576,6 @@ func TestLogEventProvider_GetLatestPayloads(t *testing.T) { t.Run("sparsely populated blocks", func(t *testing.T) { opts := NewOptions(200, big.NewInt(42161)) - opts.BufferVersion = "v1" logPoller := &mockLogPoller{ LatestBlockFn: func(ctx context.Context) (int64, error) { @@ -618,7 +587,7 @@ func TestLogEventProvider_GetLatestPayloads(t *testing.T) { ctx := context.Background() - buffer := provider.bufferV1.(*logBuffer) + buffer := provider.buffer.(*logBuffer) upkeepOmittedOnBlocks := map[int64][]int{ 1: {5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 85, 90, 95, 100}, // upkeep 1 won't have logs on 20 blocks diff --git a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/logprovider/recoverer.go b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/logprovider/recoverer.go index 9e41008ed83..984856bf3cd 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/logprovider/recoverer.go +++ b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/logprovider/recoverer.go @@ -14,18 +14,17 @@ import ( "sync/atomic" "time" - "github.com/smartcontractkit/chainlink-automation/pkg/v3/types" - "github.com/ethereum/go-ethereum/common" - "github.com/smartcontractkit/chainlink-automation/pkg/v3/random" + "github.com/smartcontractkit/chainlink-common/pkg/logger" + "github.com/smartcontractkit/chainlink-common/pkg/services" ocr2keepers "github.com/smartcontractkit/chainlink-common/pkg/types/automation" - "github.com/smartcontractkit/chainlink-common/pkg/services" + "github.com/smartcontractkit/chainlink-automation/pkg/v3/random" + "github.com/smartcontractkit/chainlink-automation/pkg/v3/types" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" - "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/core" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/prommetrics" "github.com/smartcontractkit/chainlink/v2/core/utils" @@ -71,7 +70,7 @@ type logRecoverer struct { services.StateMachine threadCtrl utils.ThreadControl - lggr logger.Logger + lggr logger.SugaredLogger lookbackBlocks *atomic.Int64 blockTime *atomic.Int64 @@ -96,7 +95,7 @@ var _ LogRecoverer = &logRecoverer{} func NewLogRecoverer(lggr logger.Logger, poller logpoller.LogPoller, client client.Client, stateStore core.UpkeepStateReader, packer LogDataPacker, filterStore UpkeepFilterStore, opts LogTriggersOptions) *logRecoverer { rec := &logRecoverer{ - lggr: lggr.Named(LogRecovererServiceName), + lggr: logger.Sugared(lggr).Named(LogRecovererServiceName), threadCtrl: utils.NewThreadControl(), diff --git a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/mercury/streams/streams.go b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/mercury/streams/streams.go index 5a4b701f61a..17005939219 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/mercury/streams/streams.go +++ b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/mercury/streams/streams.go @@ -15,11 +15,11 @@ import ( "github.com/ethereum/go-ethereum/common/hexutil" "github.com/patrickmn/go-cache" + "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink-common/pkg/services" ocr2keepers "github.com/smartcontractkit/chainlink-common/pkg/types/automation" autov2common "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/i_automation_v21_plus_common" - "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/core" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/encoding" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/mercury" @@ -119,7 +119,7 @@ func (s *streams) Lookup(ctx context.Context, checkResults []ocr2keepers.CheckRe // buildResult checks if the upkeep is allowed by Mercury and builds a streams lookup request from the check result func (s *streams) buildResult(ctx context.Context, i int, checkResult ocr2keepers.CheckResult, checkResults []ocr2keepers.CheckResult, lookups map[int]*mercury.StreamsLookup) { - lookupLggr := s.lggr.With("where", "StreamsLookup") + lookupLggr := logger.Sugared(s.lggr).With("where", "StreamsLookup") if checkResult.IneligibilityReason != uint8(encoding.UpkeepFailureReasonTargetCheckReverted) { // Streams Lookup only works when upkeep target check reverts prommetrics.AutomationStreamsLookupError.WithLabelValues(prommetrics.StreamsLookupErrorReasonNotReverted).Inc() diff --git a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/mercury/v02/request.go b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/mercury/v02/request.go index 5e954475a8d..c02b7c10de5 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/mercury/v02/request.go +++ b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/mercury/v02/request.go @@ -11,14 +11,14 @@ import ( "strconv" "time" - automationTypes "github.com/smartcontractkit/chainlink-automation/pkg/v3/types" + "github.com/avast/retry-go/v4" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink-common/pkg/services" - "github.com/avast/retry-go/v4" - "github.com/ethereum/go-ethereum/common/hexutil" + automationTypes "github.com/smartcontractkit/chainlink-automation/pkg/v3/types" - "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/encoding" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/mercury" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/prommetrics" diff --git a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/mercury/v03/request.go b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/mercury/v03/request.go index 39a26b6b5d9..c2ffb2172b0 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/mercury/v03/request.go +++ b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/mercury/v03/request.go @@ -10,14 +10,14 @@ import ( "strings" "time" - automationTypes "github.com/smartcontractkit/chainlink-automation/pkg/v3/types" + "github.com/avast/retry-go/v4" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink-common/pkg/services" - "github.com/avast/retry-go/v4" - "github.com/ethereum/go-ethereum/common/hexutil" + automationTypes "github.com/smartcontractkit/chainlink-automation/pkg/v3/types" - "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/encoding" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/mercury" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/prommetrics" diff --git a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/mercury/v03/v03_request_test.go b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/mercury/v03/v03_request_test.go index be99296d153..cce00646aeb 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/mercury/v03/v03_request_test.go +++ b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/mercury/v03/v03_request_test.go @@ -232,6 +232,7 @@ func TestV03_DoMercuryRequestV03_MultipleFeedsSuccess(t *testing.T) { } func TestV03_DoMercuryRequestV03_Timeout(t *testing.T) { + t.Skip("TODO: MERC-5965") t.Parallel() upkeepId, _ := new(big.Int).SetString("88786950015966611018675766524283132478093844178961698330929478019253453382042", 10) pluginRetryKey := "88786950015966611018675766524283132478093844178961698330929478019253453382042|34" diff --git a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/mocks/http_client.go b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/mocks/http_client.go index f05cc8f75f2..8c969040868 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/mocks/http_client.go +++ b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/mocks/http_client.go @@ -13,6 +13,14 @@ type HttpClient struct { mock.Mock } +type HttpClient_Expecter struct { + mock *mock.Mock +} + +func (_m *HttpClient) EXPECT() *HttpClient_Expecter { + return &HttpClient_Expecter{mock: &_m.Mock} +} + // Do provides a mock function with given fields: req func (_m *HttpClient) Do(req *http.Request) (*http.Response, error) { ret := _m.Called(req) @@ -43,6 +51,34 @@ func (_m *HttpClient) Do(req *http.Request) (*http.Response, error) { return r0, r1 } +// HttpClient_Do_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Do' +type HttpClient_Do_Call struct { + *mock.Call +} + +// Do is a helper method to define mock.On call +// - req *http.Request +func (_e *HttpClient_Expecter) Do(req interface{}) *HttpClient_Do_Call { + return &HttpClient_Do_Call{Call: _e.mock.On("Do", req)} +} + +func (_c *HttpClient_Do_Call) Run(run func(req *http.Request)) *HttpClient_Do_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*http.Request)) + }) + return _c +} + +func (_c *HttpClient_Do_Call) Return(_a0 *http.Response, _a1 error) *HttpClient_Do_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *HttpClient_Do_Call) RunAndReturn(run func(*http.Request) (*http.Response, error)) *HttpClient_Do_Call { + _c.Call.Return(run) + return _c +} + // NewHttpClient creates a new instance of HttpClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewHttpClient(t interface { diff --git a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/mocks/registry.go b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/mocks/registry.go index 240e4a7daa5..9a4d09a0b15 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/mocks/registry.go +++ b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/mocks/registry.go @@ -21,6 +21,14 @@ type Registry struct { mock.Mock } +type Registry_Expecter struct { + mock *mock.Mock +} + +func (_m *Registry) EXPECT() *Registry_Expecter { + return &Registry_Expecter{mock: &_m.Mock} +} + // CheckCallback provides a mock function with given fields: opts, id, values, extraData func (_m *Registry) CheckCallback(opts *bind.CallOpts, id *big.Int, values [][]byte, extraData []byte) (i_automation_v21_plus_common.CheckCallback, error) { ret := _m.Called(opts, id, values, extraData) @@ -49,6 +57,37 @@ func (_m *Registry) CheckCallback(opts *bind.CallOpts, id *big.Int, values [][]b return r0, r1 } +// Registry_CheckCallback_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CheckCallback' +type Registry_CheckCallback_Call struct { + *mock.Call +} + +// CheckCallback is a helper method to define mock.On call +// - opts *bind.CallOpts +// - id *big.Int +// - values [][]byte +// - extraData []byte +func (_e *Registry_Expecter) CheckCallback(opts interface{}, id interface{}, values interface{}, extraData interface{}) *Registry_CheckCallback_Call { + return &Registry_CheckCallback_Call{Call: _e.mock.On("CheckCallback", opts, id, values, extraData)} +} + +func (_c *Registry_CheckCallback_Call) Run(run func(opts *bind.CallOpts, id *big.Int, values [][]byte, extraData []byte)) *Registry_CheckCallback_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts), args[1].(*big.Int), args[2].([][]byte), args[3].([]byte)) + }) + return _c +} + +func (_c *Registry_CheckCallback_Call) Return(_a0 i_automation_v21_plus_common.CheckCallback, _a1 error) *Registry_CheckCallback_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Registry_CheckCallback_Call) RunAndReturn(run func(*bind.CallOpts, *big.Int, [][]byte, []byte) (i_automation_v21_plus_common.CheckCallback, error)) *Registry_CheckCallback_Call { + _c.Call.Return(run) + return _c +} + // GetActiveUpkeepIDs provides a mock function with given fields: opts, startIndex, maxCount func (_m *Registry) GetActiveUpkeepIDs(opts *bind.CallOpts, startIndex *big.Int, maxCount *big.Int) ([]*big.Int, error) { ret := _m.Called(opts, startIndex, maxCount) @@ -79,6 +118,36 @@ func (_m *Registry) GetActiveUpkeepIDs(opts *bind.CallOpts, startIndex *big.Int, return r0, r1 } +// Registry_GetActiveUpkeepIDs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetActiveUpkeepIDs' +type Registry_GetActiveUpkeepIDs_Call struct { + *mock.Call +} + +// GetActiveUpkeepIDs is a helper method to define mock.On call +// - opts *bind.CallOpts +// - startIndex *big.Int +// - maxCount *big.Int +func (_e *Registry_Expecter) GetActiveUpkeepIDs(opts interface{}, startIndex interface{}, maxCount interface{}) *Registry_GetActiveUpkeepIDs_Call { + return &Registry_GetActiveUpkeepIDs_Call{Call: _e.mock.On("GetActiveUpkeepIDs", opts, startIndex, maxCount)} +} + +func (_c *Registry_GetActiveUpkeepIDs_Call) Run(run func(opts *bind.CallOpts, startIndex *big.Int, maxCount *big.Int)) *Registry_GetActiveUpkeepIDs_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts), args[1].(*big.Int), args[2].(*big.Int)) + }) + return _c +} + +func (_c *Registry_GetActiveUpkeepIDs_Call) Return(_a0 []*big.Int, _a1 error) *Registry_GetActiveUpkeepIDs_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Registry_GetActiveUpkeepIDs_Call) RunAndReturn(run func(*bind.CallOpts, *big.Int, *big.Int) ([]*big.Int, error)) *Registry_GetActiveUpkeepIDs_Call { + _c.Call.Return(run) + return _c +} + // GetState provides a mock function with given fields: opts func (_m *Registry) GetState(opts *bind.CallOpts) (i_automation_v21_plus_common.GetState, error) { ret := _m.Called(opts) @@ -107,6 +176,34 @@ func (_m *Registry) GetState(opts *bind.CallOpts) (i_automation_v21_plus_common. return r0, r1 } +// Registry_GetState_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetState' +type Registry_GetState_Call struct { + *mock.Call +} + +// GetState is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *Registry_Expecter) GetState(opts interface{}) *Registry_GetState_Call { + return &Registry_GetState_Call{Call: _e.mock.On("GetState", opts)} +} + +func (_c *Registry_GetState_Call) Run(run func(opts *bind.CallOpts)) *Registry_GetState_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *Registry_GetState_Call) Return(_a0 i_automation_v21_plus_common.GetState, _a1 error) *Registry_GetState_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Registry_GetState_Call) RunAndReturn(run func(*bind.CallOpts) (i_automation_v21_plus_common.GetState, error)) *Registry_GetState_Call { + _c.Call.Return(run) + return _c +} + // GetUpkeep provides a mock function with given fields: opts, id func (_m *Registry) GetUpkeep(opts *bind.CallOpts, id *big.Int) (i_automation_v21_plus_common.IAutomationV21PlusCommonUpkeepInfoLegacy, error) { ret := _m.Called(opts, id) @@ -135,6 +232,35 @@ func (_m *Registry) GetUpkeep(opts *bind.CallOpts, id *big.Int) (i_automation_v2 return r0, r1 } +// Registry_GetUpkeep_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetUpkeep' +type Registry_GetUpkeep_Call struct { + *mock.Call +} + +// GetUpkeep is a helper method to define mock.On call +// - opts *bind.CallOpts +// - id *big.Int +func (_e *Registry_Expecter) GetUpkeep(opts interface{}, id interface{}) *Registry_GetUpkeep_Call { + return &Registry_GetUpkeep_Call{Call: _e.mock.On("GetUpkeep", opts, id)} +} + +func (_c *Registry_GetUpkeep_Call) Run(run func(opts *bind.CallOpts, id *big.Int)) *Registry_GetUpkeep_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts), args[1].(*big.Int)) + }) + return _c +} + +func (_c *Registry_GetUpkeep_Call) Return(_a0 i_automation_v21_plus_common.IAutomationV21PlusCommonUpkeepInfoLegacy, _a1 error) *Registry_GetUpkeep_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Registry_GetUpkeep_Call) RunAndReturn(run func(*bind.CallOpts, *big.Int) (i_automation_v21_plus_common.IAutomationV21PlusCommonUpkeepInfoLegacy, error)) *Registry_GetUpkeep_Call { + _c.Call.Return(run) + return _c +} + // GetUpkeepPrivilegeConfig provides a mock function with given fields: opts, upkeepId func (_m *Registry) GetUpkeepPrivilegeConfig(opts *bind.CallOpts, upkeepId *big.Int) ([]byte, error) { ret := _m.Called(opts, upkeepId) @@ -165,6 +291,35 @@ func (_m *Registry) GetUpkeepPrivilegeConfig(opts *bind.CallOpts, upkeepId *big. return r0, r1 } +// Registry_GetUpkeepPrivilegeConfig_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetUpkeepPrivilegeConfig' +type Registry_GetUpkeepPrivilegeConfig_Call struct { + *mock.Call +} + +// GetUpkeepPrivilegeConfig is a helper method to define mock.On call +// - opts *bind.CallOpts +// - upkeepId *big.Int +func (_e *Registry_Expecter) GetUpkeepPrivilegeConfig(opts interface{}, upkeepId interface{}) *Registry_GetUpkeepPrivilegeConfig_Call { + return &Registry_GetUpkeepPrivilegeConfig_Call{Call: _e.mock.On("GetUpkeepPrivilegeConfig", opts, upkeepId)} +} + +func (_c *Registry_GetUpkeepPrivilegeConfig_Call) Run(run func(opts *bind.CallOpts, upkeepId *big.Int)) *Registry_GetUpkeepPrivilegeConfig_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts), args[1].(*big.Int)) + }) + return _c +} + +func (_c *Registry_GetUpkeepPrivilegeConfig_Call) Return(_a0 []byte, _a1 error) *Registry_GetUpkeepPrivilegeConfig_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Registry_GetUpkeepPrivilegeConfig_Call) RunAndReturn(run func(*bind.CallOpts, *big.Int) ([]byte, error)) *Registry_GetUpkeepPrivilegeConfig_Call { + _c.Call.Return(run) + return _c +} + // GetUpkeepTriggerConfig provides a mock function with given fields: opts, upkeepId func (_m *Registry) GetUpkeepTriggerConfig(opts *bind.CallOpts, upkeepId *big.Int) ([]byte, error) { ret := _m.Called(opts, upkeepId) @@ -195,6 +350,35 @@ func (_m *Registry) GetUpkeepTriggerConfig(opts *bind.CallOpts, upkeepId *big.In return r0, r1 } +// Registry_GetUpkeepTriggerConfig_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetUpkeepTriggerConfig' +type Registry_GetUpkeepTriggerConfig_Call struct { + *mock.Call +} + +// GetUpkeepTriggerConfig is a helper method to define mock.On call +// - opts *bind.CallOpts +// - upkeepId *big.Int +func (_e *Registry_Expecter) GetUpkeepTriggerConfig(opts interface{}, upkeepId interface{}) *Registry_GetUpkeepTriggerConfig_Call { + return &Registry_GetUpkeepTriggerConfig_Call{Call: _e.mock.On("GetUpkeepTriggerConfig", opts, upkeepId)} +} + +func (_c *Registry_GetUpkeepTriggerConfig_Call) Run(run func(opts *bind.CallOpts, upkeepId *big.Int)) *Registry_GetUpkeepTriggerConfig_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts), args[1].(*big.Int)) + }) + return _c +} + +func (_c *Registry_GetUpkeepTriggerConfig_Call) Return(_a0 []byte, _a1 error) *Registry_GetUpkeepTriggerConfig_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Registry_GetUpkeepTriggerConfig_Call) RunAndReturn(run func(*bind.CallOpts, *big.Int) ([]byte, error)) *Registry_GetUpkeepTriggerConfig_Call { + _c.Call.Return(run) + return _c +} + // ParseLog provides a mock function with given fields: log func (_m *Registry) ParseLog(log types.Log) (generated.AbigenLog, error) { ret := _m.Called(log) @@ -225,6 +409,34 @@ func (_m *Registry) ParseLog(log types.Log) (generated.AbigenLog, error) { return r0, r1 } +// Registry_ParseLog_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseLog' +type Registry_ParseLog_Call struct { + *mock.Call +} + +// ParseLog is a helper method to define mock.On call +// - log types.Log +func (_e *Registry_Expecter) ParseLog(log interface{}) *Registry_ParseLog_Call { + return &Registry_ParseLog_Call{Call: _e.mock.On("ParseLog", log)} +} + +func (_c *Registry_ParseLog_Call) Run(run func(log types.Log)) *Registry_ParseLog_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *Registry_ParseLog_Call) Return(_a0 generated.AbigenLog, _a1 error) *Registry_ParseLog_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Registry_ParseLog_Call) RunAndReturn(run func(types.Log) (generated.AbigenLog, error)) *Registry_ParseLog_Call { + _c.Call.Return(run) + return _c +} + // NewRegistry creates a new instance of Registry. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewRegistry(t interface { diff --git a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/payload_builder.go b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/payload_builder.go index 7f29cb3b7ac..c6262899a32 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/payload_builder.go +++ b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/payload_builder.go @@ -3,11 +3,11 @@ package evm import ( "context" - "github.com/smartcontractkit/chainlink-automation/pkg/v3/types" - + "github.com/smartcontractkit/chainlink-common/pkg/logger" ocr2keepers "github.com/smartcontractkit/chainlink-common/pkg/types/automation" - "github.com/smartcontractkit/chainlink/v2/core/logger" + "github.com/smartcontractkit/chainlink-automation/pkg/v3/types" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/core" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/logprovider" ) diff --git a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/registry.go b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/registry.go index cb7e689b042..25bd7a445e4 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/registry.go +++ b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/registry.go @@ -10,10 +10,6 @@ import ( "sync" "time" - types2 "github.com/smartcontractkit/chainlink-automation/pkg/v3/types" - - "github.com/smartcontractkit/chainlink-common/pkg/types" - "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" @@ -22,19 +18,20 @@ import ( "github.com/pkg/errors" "go.uber.org/multierr" - evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" - + "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink-common/pkg/services" - + "github.com/smartcontractkit/chainlink-common/pkg/types" ocr2keepers "github.com/smartcontractkit/chainlink-common/pkg/types/automation" + types2 "github.com/smartcontractkit/chainlink-automation/pkg/v3/types" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/gas" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" + evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" "github.com/smartcontractkit/chainlink/v2/core/chains/legacyevm" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" ac "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/i_automation_v21_plus_common" - "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/core" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/encoding" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/logprovider" @@ -66,7 +63,6 @@ var ( logEventLookback int64 = 250 ) -//go:generate mockery --quiet --name Registry --output ./mocks/ --case=underscore type Registry interface { GetUpkeep(opts *bind.CallOpts, id *big.Int) (encoding.UpkeepInfo, error) GetState(opts *bind.CallOpts) (ac.GetState, error) @@ -77,7 +73,6 @@ type Registry interface { ParseLog(log coreTypes.Log) (generated.AbigenLog, error) } -//go:generate mockery --quiet --name HttpClient --output ./mocks/ --case=underscore type HttpClient interface { Do(req *http.Request) (*http.Response, error) } @@ -100,7 +95,7 @@ func NewEvmRegistry( return &EvmRegistry{ stopCh: make(chan struct{}), threadCtrl: utils.NewThreadControl(), - lggr: lggr.Named(RegistryServiceName), + lggr: logger.Sugared(lggr).Named(RegistryServiceName), poller: client.LogPoller(), addr: addr, client: client.Client(), @@ -177,7 +172,7 @@ func (c *MercuryConfig) SetPluginRetry(k string, v interface{}, d time.Duration) type EvmRegistry struct { services.StateMachine threadCtrl utils.ThreadControl - lggr logger.Logger + lggr logger.SugaredLogger poller logpoller.LogPoller addr common.Address client client.Client diff --git a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/registry_check_pipeline_test.go b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/registry_check_pipeline_test.go index 6f8785fda78..cb014e1d3ec 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/registry_check_pipeline_test.go +++ b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/registry_check_pipeline_test.go @@ -8,10 +8,6 @@ import ( "sync/atomic" "testing" - types3 "github.com/smartcontractkit/chainlink-automation/pkg/v3/types" - - types2 "github.com/smartcontractkit/chainlink-common/pkg/types" - "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/rpc" @@ -20,8 +16,12 @@ import ( "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" + "github.com/smartcontractkit/chainlink-common/pkg/logger" + types2 "github.com/smartcontractkit/chainlink-common/pkg/types" ocr2keepers "github.com/smartcontractkit/chainlink-common/pkg/types/automation" + types3 "github.com/smartcontractkit/chainlink-automation/pkg/v3/types" + evmClientMocks "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client/mocks" gasMocks "github.com/smartcontractkit/chainlink/v2/core/chains/evm/gas/mocks" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" @@ -30,7 +30,6 @@ import ( ac "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/i_automation_v21_plus_common" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/streams_lookup_compatible_interface" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" - "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/core" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/encoding" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/mocks" @@ -82,7 +81,7 @@ func TestRegistry_GetBlockAndUpkeepId(t *testing.T) { } func TestRegistry_VerifyCheckBlock(t *testing.T) { - lggr := logger.TestLogger(t) + lggr := logger.Test(t) upkeepId := ocr2keepers.UpkeepIdentifier{} upkeepId.FromBigInt(big.NewInt(12345)) tests := []struct { @@ -197,7 +196,7 @@ func TestRegistry_VerifyCheckBlock(t *testing.T) { } bs.latestBlock.Store(tc.latestBlock) e := &EvmRegistry{ - lggr: lggr, + lggr: logger.Sugared(lggr), bs: bs, poller: tc.poller, } @@ -229,7 +228,7 @@ func (p *mockLogPoller) IndexedLogs(ctx context.Context, eventSig common.Hash, a } func TestRegistry_VerifyLogExists(t *testing.T) { - lggr := logger.TestLogger(t) + lggr := logger.Test(t) upkeepId := ocr2keepers.UpkeepIdentifier{} upkeepId.FromBigInt(big.NewInt(12345)) @@ -351,7 +350,7 @@ func TestRegistry_VerifyLogExists(t *testing.T) { blocks: tc.blocks, } e := &EvmRegistry{ - lggr: lggr, + lggr: logger.Sugared(lggr), bs: bs, } @@ -379,7 +378,7 @@ func TestRegistry_VerifyLogExists(t *testing.T) { } func TestRegistry_CheckUpkeeps(t *testing.T) { - lggr := logger.TestLogger(t) + lggr := logger.Test(t) uid0 := core.GenUpkeepID(types3.UpkeepType(0), "p0") uid1 := core.GenUpkeepID(types3.UpkeepType(1), "p1") uid2 := core.GenUpkeepID(types3.UpkeepType(1), "p2") @@ -509,7 +508,7 @@ func TestRegistry_CheckUpkeeps(t *testing.T) { } bs.latestBlock.Store(tc.latestBlock) e := &EvmRegistry{ - lggr: lggr, + lggr: logger.Sugared(lggr), bs: bs, poller: tc.poller, } @@ -669,7 +668,7 @@ func TestRegistry_SimulatePerformUpkeeps(t *testing.T) { // setups up an evm registry for tests. func setupEVMRegistry(t *testing.T) *EvmRegistry { - lggr := logger.TestLogger(t) + lggr := logger.Test(t) addr := common.HexToAddress("0x6cA639822c6C241Fa9A7A6b5032F6F7F1C513CAD") keeperRegistryABI, err := abi.JSON(strings.NewReader(ac.IAutomationV21PlusCommonABI)) require.Nil(t, err, "need registry abi") @@ -682,7 +681,7 @@ func setupEVMRegistry(t *testing.T) *EvmRegistry { ge := gasMocks.NewEvmFeeEstimator(t) r := &EvmRegistry{ - lggr: lggr, + lggr: logger.Sugared(lggr), poller: logPoller, addr: addr, client: client, diff --git a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/registry_test.go b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/registry_test.go index ab530f877ae..1a3f103dd10 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/registry_test.go +++ b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/registry_test.go @@ -15,19 +15,19 @@ import ( "github.com/stretchr/testify/mock" types2 "github.com/smartcontractkit/chainlink-automation/pkg/v3/types" + "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink-common/pkg/types" "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" - evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" - "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" types3 "github.com/smartcontractkit/chainlink/v2/core/chains/evm/headtracker/types" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller/mocks" + evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" ubig "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils/big" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" ac "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/automation_compatible_utils" autov2common "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/i_automation_v21_plus_common" - "github.com/smartcontractkit/chainlink/v2/core/logger" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/core" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/encoding" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/logprovider" @@ -546,7 +546,7 @@ func TestRegistry_refreshLogTriggerUpkeeps(t *testing.T) { } { t.Run(tc.name, func(t *testing.T) { ctx := tests.Context(t) - lggr := logger.TestLogger(t) + lggr := logger.Test(t) var hb types3.HeadBroadcaster var lp logpoller.LogPoller @@ -560,7 +560,7 @@ func TestRegistry_refreshLogTriggerUpkeeps(t *testing.T) { bs: bs, registry: tc.registry, packer: tc.packer, - lggr: lggr, + lggr: logger.Sugared(lggr), } err := registry.refreshLogTriggerUpkeeps(ctx, tc.ids) diff --git a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/transmit/event_provider.go b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/transmit/event_provider.go index f1a64688044..697f56c866b 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/transmit/event_provider.go +++ b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/transmit/event_provider.go @@ -6,18 +6,17 @@ import ( "fmt" "sync" - "github.com/smartcontractkit/chainlink-automation/pkg/v3/types" - "github.com/ethereum/go-ethereum/common" + "github.com/smartcontractkit/chainlink-common/pkg/logger" + "github.com/smartcontractkit/chainlink-common/pkg/services" ocr2keepers "github.com/smartcontractkit/chainlink-common/pkg/types/automation" - "github.com/smartcontractkit/chainlink-common/pkg/services" + "github.com/smartcontractkit/chainlink-automation/pkg/v3/types" evmclient "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" ac "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/i_automation_v21_plus_common" - "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/core" ) diff --git a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/upkeepstate/scanner.go b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/upkeepstate/scanner.go index d11970864ad..27a35ddff13 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/upkeepstate/scanner.go +++ b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/upkeepstate/scanner.go @@ -8,10 +8,11 @@ import ( "github.com/ethereum/go-ethereum/common" + "github.com/smartcontractkit/chainlink-common/pkg/logger" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" ac "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/i_automation_v21_plus_common" - "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/logprovider" ) @@ -43,7 +44,7 @@ func NewPerformedEventsScanner( finalityDepth uint32, ) *performedEventsScanner { return &performedEventsScanner{ - lggr: lggr.Named("EventsScanner"), + lggr: logger.Named(lggr, "EventsScanner"), poller: poller, registryAddress: registryAddress, finalityDepth: finalityDepth, diff --git a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/upkeepstate/store.go b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/upkeepstate/store.go index e6486ca56ae..27cac24a9fe 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/upkeepstate/store.go +++ b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/upkeepstate/store.go @@ -8,13 +8,12 @@ import ( "sync" "time" + "github.com/smartcontractkit/chainlink-common/pkg/logger" + "github.com/smartcontractkit/chainlink-common/pkg/services" "github.com/smartcontractkit/chainlink-common/pkg/sqlutil" ocr2keepers "github.com/smartcontractkit/chainlink-common/pkg/types/automation" - "github.com/smartcontractkit/chainlink-common/pkg/services" - ubig "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils/big" - "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/core" "github.com/smartcontractkit/chainlink/v2/core/utils" ) @@ -84,7 +83,7 @@ type upkeepStateStore struct { func NewUpkeepStateStore(orm ORM, lggr logger.Logger, scanner PerformedLogsScanner) *upkeepStateStore { return &upkeepStateStore{ orm: orm, - lggr: lggr.Named(UpkeepStateStoreServiceName), + lggr: logger.Named(lggr, UpkeepStateStoreServiceName), cache: map[string]*upkeepStateRecord{}, scanner: scanner, retention: CacheExpiration, diff --git a/core/services/ocr2/plugins/ocr2keeper/integration_21_test.go b/core/services/ocr2/plugins/ocr2keeper/integration_21_test.go index cd992b1ea61..7f74f9a38a5 100644 --- a/core/services/ocr2/plugins/ocr2keeper/integration_21_test.go +++ b/core/services/ocr2/plugins/ocr2keeper/integration_21_test.go @@ -54,7 +54,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/job" "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ethkey" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ocr2keeper" - "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/logprovider" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/mercury" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/mercury/streams" "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm" @@ -119,7 +118,7 @@ func TestIntegration_KeeperPluginConditionalUpkeep(t *testing.T) { require.NoError(t, err) registry := deployKeeper21Registry(t, steve, backend, linkAddr, linkFeedAddr, gasFeedAddr) - setupNodes(t, nodeKeys, registry, backend, steve, false) + setupNodes(t, nodeKeys, registry, backend, steve) <-time.After(time.Second * 5) @@ -173,368 +172,314 @@ func TestIntegration_KeeperPluginConditionalUpkeep(t *testing.T) { } func TestIntegration_KeeperPluginLogUpkeep(t *testing.T) { - tests := []struct { - name string - logBufferVersion logprovider.BufferVersion - }{ - { - name: "default buffer", - logBufferVersion: logprovider.BufferVersionDefault, - }, - { - name: "buffer v1", - logBufferVersion: logprovider.BufferVersionV1, - }, - } + g := gomega.NewWithT(t) - for _, tc := range tests { - t.Run(tc.name, func(t *testing.T) { - g := gomega.NewWithT(t) - - // setup blockchain - sergey := testutils.MustNewSimTransactor(t) // owns all the link - steve := testutils.MustNewSimTransactor(t) // registry owner - carrol := testutils.MustNewSimTransactor(t) // upkeep owner - genesisData := core.GenesisAlloc{ - sergey.From: {Balance: assets.Ether(10000).ToInt()}, - steve.From: {Balance: assets.Ether(10000).ToInt()}, - carrol.From: {Balance: assets.Ether(10000).ToInt()}, - } - // Generate 5 keys for nodes (1 bootstrap + 4 ocr nodes) and fund them with ether - var nodeKeys [5]ethkey.KeyV2 - for i := int64(0); i < 5; i++ { - nodeKeys[i] = cltest.MustGenerateRandomKey(t) - genesisData[nodeKeys[i].Address] = core.GenesisAccount{Balance: assets.Ether(1000).ToInt()} - } + // setup blockchain + sergey := testutils.MustNewSimTransactor(t) // owns all the link + steve := testutils.MustNewSimTransactor(t) // registry owner + carrol := testutils.MustNewSimTransactor(t) // upkeep owner + genesisData := core.GenesisAlloc{ + sergey.From: {Balance: assets.Ether(10000).ToInt()}, + steve.From: {Balance: assets.Ether(10000).ToInt()}, + carrol.From: {Balance: assets.Ether(10000).ToInt()}, + } + // Generate 5 keys for nodes (1 bootstrap + 4 ocr nodes) and fund them with ether + var nodeKeys [5]ethkey.KeyV2 + for i := int64(0); i < 5; i++ { + nodeKeys[i] = cltest.MustGenerateRandomKey(t) + genesisData[nodeKeys[i].Address] = core.GenesisAccount{Balance: assets.Ether(1000).ToInt()} + } - backend := cltest.NewSimulatedBackend(t, genesisData, uint32(ethconfig.Defaults.Miner.GasCeil)) - stopMining := cltest.Mine(backend, 3*time.Second) // Should be greater than deltaRound since we cannot access old blocks on simulated blockchain - defer stopMining() + backend := cltest.NewSimulatedBackend(t, genesisData, uint32(ethconfig.Defaults.Miner.GasCeil)) + stopMining := cltest.Mine(backend, 3*time.Second) // Should be greater than deltaRound since we cannot access old blocks on simulated blockchain + defer stopMining() - // Deploy registry - linkAddr, _, linkToken, err := link_token_interface.DeployLinkToken(sergey, backend) - require.NoError(t, err) - gasFeedAddr, _, _, err := mock_v3_aggregator_contract.DeployMockV3AggregatorContract(steve, backend, 18, big.NewInt(60000000000)) - require.NoError(t, err) - linkFeedAddr, _, _, err := mock_v3_aggregator_contract.DeployMockV3AggregatorContract(steve, backend, 18, big.NewInt(2000000000000000000)) - require.NoError(t, err) + // Deploy registry + linkAddr, _, linkToken, err := link_token_interface.DeployLinkToken(sergey, backend) + require.NoError(t, err) + gasFeedAddr, _, _, err := mock_v3_aggregator_contract.DeployMockV3AggregatorContract(steve, backend, 18, big.NewInt(60000000000)) + require.NoError(t, err) + linkFeedAddr, _, _, err := mock_v3_aggregator_contract.DeployMockV3AggregatorContract(steve, backend, 18, big.NewInt(2000000000000000000)) + require.NoError(t, err) - registry := deployKeeper21Registry(t, steve, backend, linkAddr, linkFeedAddr, gasFeedAddr) - setupNodes(t, nodeKeys, registry, backend, steve, tc.logBufferVersion == logprovider.BufferVersionV1) - upkeeps := 1 + registry := deployKeeper21Registry(t, steve, backend, linkAddr, linkFeedAddr, gasFeedAddr) + setupNodes(t, nodeKeys, registry, backend, steve) + upkeeps := 1 - _, err = linkToken.Transfer(sergey, carrol.From, big.NewInt(0).Mul(oneHunEth, big.NewInt(int64(upkeeps+1)))) - require.NoError(t, err) + _, err = linkToken.Transfer(sergey, carrol.From, big.NewInt(0).Mul(oneHunEth, big.NewInt(int64(upkeeps+1)))) + require.NoError(t, err) - backend.Commit() + backend.Commit() - ids, addrs, contracts := deployUpkeeps(t, backend, carrol, steve, linkToken, registry, upkeeps) - require.Equal(t, upkeeps, len(ids)) - require.Equal(t, len(ids), len(contracts)) - require.Equal(t, len(ids), len(addrs)) + ids, addrs, contracts := deployUpkeeps(t, backend, carrol, steve, linkToken, registry, upkeeps) + require.Equal(t, upkeeps, len(ids)) + require.Equal(t, len(ids), len(contracts)) + require.Equal(t, len(ids), len(addrs)) - backend.Commit() + backend.Commit() - emits := 1 - go emitEvents(testutils.Context(t), t, emits, contracts, carrol, func() { - backend.Commit() - }) + emits := 1 + go emitEvents(testutils.Context(t), t, emits, contracts, carrol, func() { + backend.Commit() + }) - listener, done := listenPerformed(t, backend, registry, ids, int64(1)) - g.Eventually(listener, testutils.WaitTimeout(t), cltest.DBPollingInterval).Should(gomega.BeTrue()) - done() + listener, done := listenPerformed(t, backend, registry, ids, int64(1)) + g.Eventually(listener, testutils.WaitTimeout(t), cltest.DBPollingInterval).Should(gomega.BeTrue()) + done() - t.Run("recover logs", func(t *testing.T) { - addr, contract := addrs[0], contracts[0] - upkeepID := registerUpkeep(t, registry, addr, carrol, steve, backend) + t.Run("recover logs", func(t *testing.T) { + addr, contract := addrs[0], contracts[0] + upkeepID := registerUpkeep(t, registry, addr, carrol, steve, backend) + backend.Commit() + t.Logf("Registered new upkeep %s for address %s", upkeepID.String(), addr.String()) + // Emit 100 logs in a burst + recoverEmits := 100 + i := 0 + emitEvents(testutils.Context(t), t, 100, []*log_upkeep_counter_wrapper.LogUpkeepCounter{contract}, carrol, func() { + i++ + if i%(recoverEmits/4) == 0 { backend.Commit() - t.Logf("Registered new upkeep %s for address %s", upkeepID.String(), addr.String()) - // Emit 100 logs in a burst - recoverEmits := 100 - i := 0 - emitEvents(testutils.Context(t), t, 100, []*log_upkeep_counter_wrapper.LogUpkeepCounter{contract}, carrol, func() { - i++ - if i%(recoverEmits/4) == 0 { - backend.Commit() - time.Sleep(time.Millisecond * 250) // otherwise we get "invalid transaction nonce" errors - } - }) + time.Sleep(time.Millisecond * 250) // otherwise we get "invalid transaction nonce" errors + } + }) - beforeDummyBlocks := backend.Blockchain().CurrentBlock().Number.Uint64() + beforeDummyBlocks := backend.Blockchain().CurrentBlock().Number.Uint64() - // Mine enough blocks to ensure these logs don't fall into log provider range - dummyBlocks := 500 - for i := 0; i < dummyBlocks; i++ { - backend.Commit() - time.Sleep(time.Millisecond * 10) - } + // Mine enough blocks to ensure these logs don't fall into log provider range + dummyBlocks := 500 + for i := 0; i < dummyBlocks; i++ { + backend.Commit() + time.Sleep(time.Millisecond * 10) + } - t.Logf("Mined %d blocks, waiting for logs to be recovered", dummyBlocks) + t.Logf("Mined %d blocks, waiting for logs to be recovered", dummyBlocks) - listener, done := listenPerformedN(t, backend, registry, ids, int64(beforeDummyBlocks), recoverEmits) - defer done() - g.Eventually(listener, testutils.WaitTimeout(t), cltest.DBPollingInterval).Should(gomega.BeTrue()) - }) - }) - } + listener, done := listenPerformedN(t, backend, registry, ids, int64(beforeDummyBlocks), recoverEmits) + defer done() + g.Eventually(listener, testutils.WaitTimeout(t), cltest.DBPollingInterval).Should(gomega.BeTrue()) + }) } func TestIntegration_KeeperPluginLogUpkeep_Retry(t *testing.T) { - tests := []struct { - name string - logBufferVersion logprovider.BufferVersion - }{ - { - name: "default buffer", - logBufferVersion: logprovider.BufferVersionDefault, - }, - { - name: "buffer v1", - logBufferVersion: logprovider.BufferVersionV1, - }, + g := gomega.NewWithT(t) + + // setup blockchain + linkOwner := testutils.MustNewSimTransactor(t) // owns all the link + registryOwner := testutils.MustNewSimTransactor(t) // registry owner + upkeepOwner := testutils.MustNewSimTransactor(t) // upkeep owner + genesisData := core.GenesisAlloc{ + linkOwner.From: {Balance: assets.Ether(10000).ToInt()}, + registryOwner.From: {Balance: assets.Ether(10000).ToInt()}, + upkeepOwner.From: {Balance: assets.Ether(10000).ToInt()}, } - for _, tc := range tests { - t.Run(tc.name, func(t *testing.T) { - g := gomega.NewWithT(t) - - // setup blockchain - linkOwner := testutils.MustNewSimTransactor(t) // owns all the link - registryOwner := testutils.MustNewSimTransactor(t) // registry owner - upkeepOwner := testutils.MustNewSimTransactor(t) // upkeep owner - genesisData := core.GenesisAlloc{ - linkOwner.From: {Balance: assets.Ether(10000).ToInt()}, - registryOwner.From: {Balance: assets.Ether(10000).ToInt()}, - upkeepOwner.From: {Balance: assets.Ether(10000).ToInt()}, - } + // Generate 5 keys for nodes (1 bootstrap + 4 ocr nodes) and fund them with ether + var nodeKeys [5]ethkey.KeyV2 + for i := int64(0); i < 5; i++ { + nodeKeys[i] = cltest.MustGenerateRandomKey(t) + genesisData[nodeKeys[i].Address] = core.GenesisAccount{Balance: assets.Ether(1000).ToInt()} + } - // Generate 5 keys for nodes (1 bootstrap + 4 ocr nodes) and fund them with ether - var nodeKeys [5]ethkey.KeyV2 - for i := int64(0); i < 5; i++ { - nodeKeys[i] = cltest.MustGenerateRandomKey(t) - genesisData[nodeKeys[i].Address] = core.GenesisAccount{Balance: assets.Ether(1000).ToInt()} - } + backend := cltest.NewSimulatedBackend(t, genesisData, uint32(ethconfig.Defaults.Miner.GasCeil)) + stopMining := cltest.Mine(backend, 3*time.Second) // Should be greater than deltaRound since we cannot access old blocks on simulated blockchain + defer stopMining() - backend := cltest.NewSimulatedBackend(t, genesisData, uint32(ethconfig.Defaults.Miner.GasCeil)) - stopMining := cltest.Mine(backend, 3*time.Second) // Should be greater than deltaRound since we cannot access old blocks on simulated blockchain - defer stopMining() + // Deploy registry + linkAddr, _, linkToken, err := link_token_interface.DeployLinkToken(linkOwner, backend) + require.NoError(t, err) - // Deploy registry - linkAddr, _, linkToken, err := link_token_interface.DeployLinkToken(linkOwner, backend) - require.NoError(t, err) + gasFeedAddr, _, _, err := mock_v3_aggregator_contract.DeployMockV3AggregatorContract(registryOwner, backend, 18, big.NewInt(60000000000)) + require.NoError(t, err) - gasFeedAddr, _, _, err := mock_v3_aggregator_contract.DeployMockV3AggregatorContract(registryOwner, backend, 18, big.NewInt(60000000000)) - require.NoError(t, err) + linkFeedAddr, _, _, err := mock_v3_aggregator_contract.DeployMockV3AggregatorContract(registryOwner, backend, 18, big.NewInt(2000000000000000000)) + require.NoError(t, err) - linkFeedAddr, _, _, err := mock_v3_aggregator_contract.DeployMockV3AggregatorContract(registryOwner, backend, 18, big.NewInt(2000000000000000000)) - require.NoError(t, err) + registry := deployKeeper21Registry(t, registryOwner, backend, linkAddr, linkFeedAddr, gasFeedAddr) - registry := deployKeeper21Registry(t, registryOwner, backend, linkAddr, linkFeedAddr, gasFeedAddr) + _, mercuryServer := setupNodes(t, nodeKeys, registry, backend, registryOwner) - _, mercuryServer := setupNodes(t, nodeKeys, registry, backend, registryOwner, tc.logBufferVersion == logprovider.BufferVersionV1) + const upkeepCount = 10 + const mercuryFailCount = upkeepCount * 3 * 2 - const upkeepCount = 10 - const mercuryFailCount = upkeepCount * 3 * 2 + // testing with the mercury server involves mocking responses. currently, + // there is not a way to connect a mercury call to an upkeep id (though we + // could add custom headers) so the test must be fairly basic and just + // count calls before switching to successes + var ( + mu sync.Mutex + count int + ) - // testing with the mercury server involves mocking responses. currently, - // there is not a way to connect a mercury call to an upkeep id (though we - // could add custom headers) so the test must be fairly basic and just - // count calls before switching to successes - var ( - mu sync.Mutex - count int - ) + mercuryServer.RegisterHandler(func(w http.ResponseWriter, r *http.Request) { + mu.Lock() + defer mu.Unlock() - mercuryServer.RegisterHandler(func(w http.ResponseWriter, r *http.Request) { - mu.Lock() - defer mu.Unlock() + count++ - count++ + _ = r.ParseForm() - _ = r.ParseForm() + t.Logf("MercuryHTTPServe:RequestURI: %s", r.RequestURI) - t.Logf("MercuryHTTPServe:RequestURI: %s", r.RequestURI) + for key, value := range r.Form { + t.Logf("MercuryHTTPServe:FormValue: key: %s; value: %s;", key, value) + } - for key, value := range r.Form { - t.Logf("MercuryHTTPServe:FormValue: key: %s; value: %s;", key, value) - } + // the streams lookup retries against the remote server 3 times before + // returning a result as retryable. + // the simulation here should force the streams lookup process to return + // retryable 2 times. + // the total count of failures should be (upkeepCount * 3 * tryCount) + if count <= mercuryFailCount { + w.WriteHeader(http.StatusNotFound) - // the streams lookup retries against the remote server 3 times before - // returning a result as retryable. - // the simulation here should force the streams lookup process to return - // retryable 2 times. - // the total count of failures should be (upkeepCount * 3 * tryCount) - if count <= mercuryFailCount { - w.WriteHeader(http.StatusNotFound) + return + } - return - } + // start sending success messages + output := `{"chainlinkBlob":"0x0001c38d71fed6c320b90e84b6f559459814d068e2a1700adc931ca9717d4fe70000000000000000000000000000000000000000000000000000000001a80b52b4bf1233f9cb71144a253a1791b202113c4ab4a92fa1b176d684b4959666ff8200000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000260000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001004254432d5553442d415242495452554d2d544553544e4554000000000000000000000000000000000000000000000000000000000000000000000000645570be000000000000000000000000000000000000000000000000000002af2b818dc5000000000000000000000000000000000000000000000000000002af2426faf3000000000000000000000000000000000000000000000000000002af32dc209700000000000000000000000000000000000000000000000000000000012130f8df0a9745bb6ad5e2df605e158ba8ad8a33ef8a0acf9851f0f01668a3a3f2b68600000000000000000000000000000000000000000000000000000000012130f60000000000000000000000000000000000000000000000000000000000000002c4a7958dce105089cf5edb68dad7dcfe8618d7784eb397f97d5a5fade78c11a58275aebda478968e545f7e3657aba9dcbe8d44605e4c6fde3e24edd5e22c94270000000000000000000000000000000000000000000000000000000000000002459c12d33986018a8959566d145225f0c4a4e61a9a3f50361ccff397899314f0018162cf10cd89897635a0bb62a822355bd199d09f4abe76e4d05261bb44733d"}` - // start sending success messages - output := `{"chainlinkBlob":"0x0001c38d71fed6c320b90e84b6f559459814d068e2a1700adc931ca9717d4fe70000000000000000000000000000000000000000000000000000000001a80b52b4bf1233f9cb71144a253a1791b202113c4ab4a92fa1b176d684b4959666ff8200000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000260000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001004254432d5553442d415242495452554d2d544553544e4554000000000000000000000000000000000000000000000000000000000000000000000000645570be000000000000000000000000000000000000000000000000000002af2b818dc5000000000000000000000000000000000000000000000000000002af2426faf3000000000000000000000000000000000000000000000000000002af32dc209700000000000000000000000000000000000000000000000000000000012130f8df0a9745bb6ad5e2df605e158ba8ad8a33ef8a0acf9851f0f01668a3a3f2b68600000000000000000000000000000000000000000000000000000000012130f60000000000000000000000000000000000000000000000000000000000000002c4a7958dce105089cf5edb68dad7dcfe8618d7784eb397f97d5a5fade78c11a58275aebda478968e545f7e3657aba9dcbe8d44605e4c6fde3e24edd5e22c94270000000000000000000000000000000000000000000000000000000000000002459c12d33986018a8959566d145225f0c4a4e61a9a3f50361ccff397899314f0018162cf10cd89897635a0bb62a822355bd199d09f4abe76e4d05261bb44733d"}` + w.WriteHeader(http.StatusOK) + _, _ = w.Write([]byte(output)) + }) - w.WriteHeader(http.StatusOK) - _, _ = w.Write([]byte(output)) - }) + defer mercuryServer.Stop() - defer mercuryServer.Stop() + _, err = linkToken.Transfer(linkOwner, upkeepOwner.From, big.NewInt(0).Mul(oneHunEth, big.NewInt(int64(upkeepCount+1)))) + require.NoError(t, err) - _, err = linkToken.Transfer(linkOwner, upkeepOwner.From, big.NewInt(0).Mul(oneHunEth, big.NewInt(int64(upkeepCount+1)))) - require.NoError(t, err) + backend.Commit() - backend.Commit() + feeds, err := newFeedLookupUpkeepController(backend, registryOwner) + require.NoError(t, err, "no error expected from creating a feed lookup controller") + + // deploy multiple upkeeps that listen to a log emitter and need to be + // performed for each log event + _ = feeds.DeployUpkeeps(t, backend, upkeepOwner, upkeepCount, func(int) bool { + return false + }) + _ = feeds.RegisterAndFund(t, registry, registryOwner, backend, linkToken) + _ = feeds.EnableMercury(t, backend, registry, registryOwner) + _ = feeds.VerifyEnv(t, backend, registry, registryOwner) - feeds, err := newFeedLookupUpkeepController(backend, registryOwner) - require.NoError(t, err, "no error expected from creating a feed lookup controller") - - // deploy multiple upkeeps that listen to a log emitter and need to be - // performed for each log event - _ = feeds.DeployUpkeeps(t, backend, upkeepOwner, upkeepCount, func(int) bool { - return false - }) - _ = feeds.RegisterAndFund(t, registry, registryOwner, backend, linkToken) - _ = feeds.EnableMercury(t, backend, registry, registryOwner) - _ = feeds.VerifyEnv(t, backend, registry, registryOwner) - - // start emitting events in a separate go-routine - // feed lookup relies on a single contract event log to perform multiple - // listener contracts - go func() { - // only 1 event is necessary to make all 10 upkeeps eligible - _ = feeds.EmitEvents(t, backend, 1, func() { - // pause per emit for expected block production time - time.Sleep(3 * time.Second) - }) - }() - - listener, done := listenPerformed(t, backend, registry, feeds.UpkeepsIds(), int64(1)) - defer done() - g.Eventually(listener, testutils.WaitTimeout(t)-(5*time.Second), cltest.DBPollingInterval).Should(gomega.BeTrue()) + // start emitting events in a separate go-routine + // feed lookup relies on a single contract event log to perform multiple + // listener contracts + go func() { + // only 1 event is necessary to make all 10 upkeeps eligible + _ = feeds.EmitEvents(t, backend, 1, func() { + // pause per emit for expected block production time + time.Sleep(3 * time.Second) }) - } + }() + + listener, done := listenPerformed(t, backend, registry, feeds.UpkeepsIds(), int64(1)) + defer done() + g.Eventually(listener, testutils.WaitTimeout(t)-(5*time.Second), cltest.DBPollingInterval).Should(gomega.BeTrue()) } func TestIntegration_KeeperPluginLogUpkeep_ErrHandler(t *testing.T) { - tests := []struct { - name string - logBufferVersion logprovider.BufferVersion - }{ - { - name: "default buffer", - logBufferVersion: logprovider.BufferVersionDefault, - }, - { - name: "buffer v1", - logBufferVersion: logprovider.BufferVersionV1, - }, + g := gomega.NewWithT(t) + + // setup blockchain + linkOwner := testutils.MustNewSimTransactor(t) // owns all the link + registryOwner := testutils.MustNewSimTransactor(t) // registry owner + upkeepOwner := testutils.MustNewSimTransactor(t) // upkeep owner + genesisData := core.GenesisAlloc{ + linkOwner.From: {Balance: assets.Ether(10000).ToInt()}, + registryOwner.From: {Balance: assets.Ether(10000).ToInt()}, + upkeepOwner.From: {Balance: assets.Ether(10000).ToInt()}, } - for _, tc := range tests { - t.Run(tc.name, func(t *testing.T) { - g := gomega.NewWithT(t) - - // setup blockchain - linkOwner := testutils.MustNewSimTransactor(t) // owns all the link - registryOwner := testutils.MustNewSimTransactor(t) // registry owner - upkeepOwner := testutils.MustNewSimTransactor(t) // upkeep owner - genesisData := core.GenesisAlloc{ - linkOwner.From: {Balance: assets.Ether(10000).ToInt()}, - registryOwner.From: {Balance: assets.Ether(10000).ToInt()}, - upkeepOwner.From: {Balance: assets.Ether(10000).ToInt()}, - } + // Generate 5 keys for nodes (1 bootstrap + 4 ocr nodes) and fund them with ether + var nodeKeys [5]ethkey.KeyV2 + for i := int64(0); i < 5; i++ { + nodeKeys[i] = cltest.MustGenerateRandomKey(t) + genesisData[nodeKeys[i].Address] = core.GenesisAccount{Balance: assets.Ether(1000).ToInt()} + } - // Generate 5 keys for nodes (1 bootstrap + 4 ocr nodes) and fund them with ether - var nodeKeys [5]ethkey.KeyV2 - for i := int64(0); i < 5; i++ { - nodeKeys[i] = cltest.MustGenerateRandomKey(t) - genesisData[nodeKeys[i].Address] = core.GenesisAccount{Balance: assets.Ether(1000).ToInt()} - } + backend := cltest.NewSimulatedBackend(t, genesisData, uint32(ethconfig.Defaults.Miner.GasCeil)) + stopMining := cltest.Mine(backend, 3*time.Second) // Should be greater than deltaRound since we cannot access old blocks on simulated blockchain + defer stopMining() - backend := cltest.NewSimulatedBackend(t, genesisData, uint32(ethconfig.Defaults.Miner.GasCeil)) - stopMining := cltest.Mine(backend, 3*time.Second) // Should be greater than deltaRound since we cannot access old blocks on simulated blockchain - defer stopMining() + // Deploy registry + linkAddr, _, linkToken, err := link_token_interface.DeployLinkToken(linkOwner, backend) + require.NoError(t, err) - // Deploy registry - linkAddr, _, linkToken, err := link_token_interface.DeployLinkToken(linkOwner, backend) - require.NoError(t, err) + gasFeedAddr, _, _, err := mock_v3_aggregator_contract.DeployMockV3AggregatorContract(registryOwner, backend, 18, big.NewInt(60000000000)) + require.NoError(t, err) - gasFeedAddr, _, _, err := mock_v3_aggregator_contract.DeployMockV3AggregatorContract(registryOwner, backend, 18, big.NewInt(60000000000)) - require.NoError(t, err) + linkFeedAddr, _, _, err := mock_v3_aggregator_contract.DeployMockV3AggregatorContract(registryOwner, backend, 18, big.NewInt(2000000000000000000)) + require.NoError(t, err) - linkFeedAddr, _, _, err := mock_v3_aggregator_contract.DeployMockV3AggregatorContract(registryOwner, backend, 18, big.NewInt(2000000000000000000)) - require.NoError(t, err) + registry := deployKeeper21Registry(t, registryOwner, backend, linkAddr, linkFeedAddr, gasFeedAddr) - registry := deployKeeper21Registry(t, registryOwner, backend, linkAddr, linkFeedAddr, gasFeedAddr) + _, mercuryServer := setupNodes(t, nodeKeys, registry, backend, registryOwner) - _, mercuryServer := setupNodes(t, nodeKeys, registry, backend, registryOwner, tc.logBufferVersion == logprovider.BufferVersionV1) + upkeepCount := 10 - upkeepCount := 10 + errResponses := []int{ + http.StatusUnauthorized, + http.StatusBadRequest, + http.StatusInternalServerError, + http.StatusNotFound, + http.StatusNotFound, + http.StatusNotFound, + http.StatusUnauthorized, + } + startMercuryServer(t, mercuryServer, func(i int) (int, []byte) { + var resp int + if i < len(errResponses) { + resp = errResponses[i] + } + if resp == 0 { + resp = http.StatusNotFound + } + return resp, nil + }) + defer mercuryServer.Stop() - errResponses := []int{ - http.StatusUnauthorized, - http.StatusBadRequest, - http.StatusInternalServerError, - http.StatusNotFound, - http.StatusNotFound, - http.StatusNotFound, - http.StatusUnauthorized, - } - startMercuryServer(t, mercuryServer, func(i int) (int, []byte) { - var resp int - if i < len(errResponses) { - resp = errResponses[i] - } - if resp == 0 { - resp = http.StatusNotFound - } - return resp, nil - }) - defer mercuryServer.Stop() + _, err = linkToken.Transfer(linkOwner, upkeepOwner.From, big.NewInt(0).Mul(oneHunEth, big.NewInt(int64(upkeepCount+1)))) + require.NoError(t, err) - _, err = linkToken.Transfer(linkOwner, upkeepOwner.From, big.NewInt(0).Mul(oneHunEth, big.NewInt(int64(upkeepCount+1)))) - require.NoError(t, err) + backend.Commit() - backend.Commit() + feeds, err := newFeedLookupUpkeepController(backend, registryOwner) + require.NoError(t, err, "no error expected from creating a feed lookup controller") - feeds, err := newFeedLookupUpkeepController(backend, registryOwner) - require.NoError(t, err, "no error expected from creating a feed lookup controller") + // deploy multiple upkeeps that listen to a log emitter and need to be + // performed for each log event + checkResultsProvider := func(i int) bool { + return i%2 == 1 + } + require.NoError(t, feeds.DeployUpkeeps(t, backend, upkeepOwner, upkeepCount, checkResultsProvider)) + require.NoError(t, feeds.RegisterAndFund(t, registry, registryOwner, backend, linkToken)) + require.NoError(t, feeds.EnableMercury(t, backend, registry, registryOwner)) + require.NoError(t, feeds.VerifyEnv(t, backend, registry, registryOwner)) + + startBlock := backend.Blockchain().CurrentBlock().Number.Int64() + // start emitting events in a separate go-routine + // feed lookup relies on a single contract event log to perform multiple + // listener contracts + go func() { + // only 1 event is necessary to make all 10 upkeeps eligible + _ = feeds.EmitEvents(t, backend, 1, func() { + // pause per emit for expected block production time + time.Sleep(3 * time.Second) + }) + }() - // deploy multiple upkeeps that listen to a log emitter and need to be - // performed for each log event - checkResultsProvider := func(i int) bool { - return i%2 == 1 - } - require.NoError(t, feeds.DeployUpkeeps(t, backend, upkeepOwner, upkeepCount, checkResultsProvider)) - require.NoError(t, feeds.RegisterAndFund(t, registry, registryOwner, backend, linkToken)) - require.NoError(t, feeds.EnableMercury(t, backend, registry, registryOwner)) - require.NoError(t, feeds.VerifyEnv(t, backend, registry, registryOwner)) - - startBlock := backend.Blockchain().CurrentBlock().Number.Int64() - // start emitting events in a separate go-routine - // feed lookup relies on a single contract event log to perform multiple - // listener contracts - go func() { - // only 1 event is necessary to make all 10 upkeeps eligible - _ = feeds.EmitEvents(t, backend, 1, func() { - // pause per emit for expected block production time - time.Sleep(3 * time.Second) - }) - }() - - go makeDummyBlocks(t, backend, 3*time.Second, 1000) - - idsToCheck := make([]*big.Int, 0) - for i, uid := range feeds.UpkeepsIds() { - if checkResultsProvider(i) { - idsToCheck = append(idsToCheck, uid) - } - } + go makeDummyBlocks(t, backend, 3*time.Second, 1000) - listener, done := listenPerformed(t, backend, registry, idsToCheck, startBlock) - defer done() - g.Eventually(listener, testutils.WaitTimeout(t)-(5*time.Second), cltest.DBPollingInterval).Should(gomega.BeTrue()) - }) + idsToCheck := make([]*big.Int, 0) + for i, uid := range feeds.UpkeepsIds() { + if checkResultsProvider(i) { + idsToCheck = append(idsToCheck, uid) + } } + + listener, done := listenPerformed(t, backend, registry, idsToCheck, startBlock) + defer done() + g.Eventually(listener, testutils.WaitTimeout(t)-(5*time.Second), cltest.DBPollingInterval).Should(gomega.BeTrue()) } func startMercuryServer(t *testing.T, mercuryServer *mercury.SimulatedMercuryServer, responder func(i int) (int, []byte)) { @@ -644,7 +589,7 @@ func listenPerformed(t *testing.T, backend *backends.SimulatedBackend, registry return listenPerformedN(t, backend, registry, ids, startBlock, 0) } -func setupNodes(t *testing.T, nodeKeys [5]ethkey.KeyV2, registry *iregistry21.IKeeperRegistryMaster, backend *backends.SimulatedBackend, usr *bind.TransactOpts, useBufferV1 bool) ([]Node, *mercury.SimulatedMercuryServer) { +func setupNodes(t *testing.T, nodeKeys [5]ethkey.KeyV2, registry *iregistry21.IKeeperRegistryMaster, backend *backends.SimulatedBackend, usr *bind.TransactOpts) ([]Node, *mercury.SimulatedMercuryServer) { lggr := logger.TestLogger(t) mServer := mercury.NewSimulatedMercuryServer() mServer.Start() @@ -727,8 +672,7 @@ func setupNodes(t *testing.T, nodeKeys [5]ethkey.KeyV2, registry *iregistry21.IK cacheEvictionInterval = "1s" mercuryCredentialName = "%s" contractVersion = "v2.1" - useBufferV1 = %v - `, i, registry.Address(), node.KeyBundle.ID(), node.Transmitter, fmt.Sprintf("%s@127.0.0.1:%d", bootstrapPeerID, bootstrapNodePort), MercuryCredName, useBufferV1)) + `, i, registry.Address(), node.KeyBundle.ID(), node.Transmitter, fmt.Sprintf("%s@127.0.0.1:%d", bootstrapPeerID, bootstrapNodePort), MercuryCredName)) } // Setup config on contract @@ -1166,6 +1110,7 @@ func (c *feedLookupUpkeepController) EmitEvents( ctx := testutils.Context(t) for i := 0; i < count && ctx.Err() == nil; i++ { + blockBeforeOrder, _ := backend.BlockByHash(ctx, backend.Commit()) _, err := c.protocol.ExecuteLimitOrder(c.protocolOwner, big.NewInt(1000), big.NewInt(10000), c.logSrcAddr) require.NoError(t, err, "no error expected from limit order exec") @@ -1182,7 +1127,7 @@ func (c *feedLookupUpkeepController) EmitEvents( iter, _ := c.protocol.FilterLimitOrderExecuted( &bind.FilterOpts{ Context: testutils.Context(t), - Start: block.NumberU64() - 1, + Start: blockBeforeOrder.NumberU64() - 1, }, []*big.Int{big.NewInt(1000)}, []*big.Int{big.NewInt(10000)}, diff --git a/core/services/ocr2/plugins/ocr2keeper/integration_test.go b/core/services/ocr2/plugins/ocr2keeper/integration_test.go index 2ce9ff3d243..4796c43569a 100644 --- a/core/services/ocr2/plugins/ocr2keeper/integration_test.go +++ b/core/services/ocr2/plugins/ocr2keeper/integration_test.go @@ -44,7 +44,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/link_token_interface" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/mock_v3_aggregator_contract" "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" - "github.com/smartcontractkit/chainlink/v2/core/internal/cltest/heavyweight" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" @@ -59,6 +58,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/ocrbootstrap" "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm" "github.com/smartcontractkit/chainlink/v2/core/store/models" + "github.com/smartcontractkit/chainlink/v2/core/utils/testutils/heavyweight" ) const ( diff --git a/core/services/ocr2/plugins/promwrapper/mocks/prometheus_backend.go b/core/services/ocr2/plugins/promwrapper/mocks/prometheus_backend.go index 7a480dfc8e5..ecbaaba08a0 100644 --- a/core/services/ocr2/plugins/promwrapper/mocks/prometheus_backend.go +++ b/core/services/ocr2/plugins/promwrapper/mocks/prometheus_backend.go @@ -9,56 +9,354 @@ type PrometheusBackend struct { mock.Mock } +type PrometheusBackend_Expecter struct { + mock *mock.Mock +} + +func (_m *PrometheusBackend) EXPECT() *PrometheusBackend_Expecter { + return &PrometheusBackend_Expecter{mock: &_m.Mock} +} + // SetAcceptFinalizedReportToTransmitAcceptedReportLatency provides a mock function with given fields: _a0, _a1 func (_m *PrometheusBackend) SetAcceptFinalizedReportToTransmitAcceptedReportLatency(_a0 []string, _a1 float64) { _m.Called(_a0, _a1) } +// PrometheusBackend_SetAcceptFinalizedReportToTransmitAcceptedReportLatency_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetAcceptFinalizedReportToTransmitAcceptedReportLatency' +type PrometheusBackend_SetAcceptFinalizedReportToTransmitAcceptedReportLatency_Call struct { + *mock.Call +} + +// SetAcceptFinalizedReportToTransmitAcceptedReportLatency is a helper method to define mock.On call +// - _a0 []string +// - _a1 float64 +func (_e *PrometheusBackend_Expecter) SetAcceptFinalizedReportToTransmitAcceptedReportLatency(_a0 interface{}, _a1 interface{}) *PrometheusBackend_SetAcceptFinalizedReportToTransmitAcceptedReportLatency_Call { + return &PrometheusBackend_SetAcceptFinalizedReportToTransmitAcceptedReportLatency_Call{Call: _e.mock.On("SetAcceptFinalizedReportToTransmitAcceptedReportLatency", _a0, _a1)} +} + +func (_c *PrometheusBackend_SetAcceptFinalizedReportToTransmitAcceptedReportLatency_Call) Run(run func(_a0 []string, _a1 float64)) *PrometheusBackend_SetAcceptFinalizedReportToTransmitAcceptedReportLatency_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].([]string), args[1].(float64)) + }) + return _c +} + +func (_c *PrometheusBackend_SetAcceptFinalizedReportToTransmitAcceptedReportLatency_Call) Return() *PrometheusBackend_SetAcceptFinalizedReportToTransmitAcceptedReportLatency_Call { + _c.Call.Return() + return _c +} + +func (_c *PrometheusBackend_SetAcceptFinalizedReportToTransmitAcceptedReportLatency_Call) RunAndReturn(run func([]string, float64)) *PrometheusBackend_SetAcceptFinalizedReportToTransmitAcceptedReportLatency_Call { + _c.Call.Return(run) + return _c +} + // SetCloseDuration provides a mock function with given fields: _a0, _a1 func (_m *PrometheusBackend) SetCloseDuration(_a0 []string, _a1 float64) { _m.Called(_a0, _a1) } +// PrometheusBackend_SetCloseDuration_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetCloseDuration' +type PrometheusBackend_SetCloseDuration_Call struct { + *mock.Call +} + +// SetCloseDuration is a helper method to define mock.On call +// - _a0 []string +// - _a1 float64 +func (_e *PrometheusBackend_Expecter) SetCloseDuration(_a0 interface{}, _a1 interface{}) *PrometheusBackend_SetCloseDuration_Call { + return &PrometheusBackend_SetCloseDuration_Call{Call: _e.mock.On("SetCloseDuration", _a0, _a1)} +} + +func (_c *PrometheusBackend_SetCloseDuration_Call) Run(run func(_a0 []string, _a1 float64)) *PrometheusBackend_SetCloseDuration_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].([]string), args[1].(float64)) + }) + return _c +} + +func (_c *PrometheusBackend_SetCloseDuration_Call) Return() *PrometheusBackend_SetCloseDuration_Call { + _c.Call.Return() + return _c +} + +func (_c *PrometheusBackend_SetCloseDuration_Call) RunAndReturn(run func([]string, float64)) *PrometheusBackend_SetCloseDuration_Call { + _c.Call.Return(run) + return _c +} + // SetObservationDuration provides a mock function with given fields: _a0, _a1 func (_m *PrometheusBackend) SetObservationDuration(_a0 []string, _a1 float64) { _m.Called(_a0, _a1) } +// PrometheusBackend_SetObservationDuration_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetObservationDuration' +type PrometheusBackend_SetObservationDuration_Call struct { + *mock.Call +} + +// SetObservationDuration is a helper method to define mock.On call +// - _a0 []string +// - _a1 float64 +func (_e *PrometheusBackend_Expecter) SetObservationDuration(_a0 interface{}, _a1 interface{}) *PrometheusBackend_SetObservationDuration_Call { + return &PrometheusBackend_SetObservationDuration_Call{Call: _e.mock.On("SetObservationDuration", _a0, _a1)} +} + +func (_c *PrometheusBackend_SetObservationDuration_Call) Run(run func(_a0 []string, _a1 float64)) *PrometheusBackend_SetObservationDuration_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].([]string), args[1].(float64)) + }) + return _c +} + +func (_c *PrometheusBackend_SetObservationDuration_Call) Return() *PrometheusBackend_SetObservationDuration_Call { + _c.Call.Return() + return _c +} + +func (_c *PrometheusBackend_SetObservationDuration_Call) RunAndReturn(run func([]string, float64)) *PrometheusBackend_SetObservationDuration_Call { + _c.Call.Return(run) + return _c +} + // SetObservationToReportLatency provides a mock function with given fields: _a0, _a1 func (_m *PrometheusBackend) SetObservationToReportLatency(_a0 []string, _a1 float64) { _m.Called(_a0, _a1) } +// PrometheusBackend_SetObservationToReportLatency_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetObservationToReportLatency' +type PrometheusBackend_SetObservationToReportLatency_Call struct { + *mock.Call +} + +// SetObservationToReportLatency is a helper method to define mock.On call +// - _a0 []string +// - _a1 float64 +func (_e *PrometheusBackend_Expecter) SetObservationToReportLatency(_a0 interface{}, _a1 interface{}) *PrometheusBackend_SetObservationToReportLatency_Call { + return &PrometheusBackend_SetObservationToReportLatency_Call{Call: _e.mock.On("SetObservationToReportLatency", _a0, _a1)} +} + +func (_c *PrometheusBackend_SetObservationToReportLatency_Call) Run(run func(_a0 []string, _a1 float64)) *PrometheusBackend_SetObservationToReportLatency_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].([]string), args[1].(float64)) + }) + return _c +} + +func (_c *PrometheusBackend_SetObservationToReportLatency_Call) Return() *PrometheusBackend_SetObservationToReportLatency_Call { + _c.Call.Return() + return _c +} + +func (_c *PrometheusBackend_SetObservationToReportLatency_Call) RunAndReturn(run func([]string, float64)) *PrometheusBackend_SetObservationToReportLatency_Call { + _c.Call.Return(run) + return _c +} + // SetQueryDuration provides a mock function with given fields: _a0, _a1 func (_m *PrometheusBackend) SetQueryDuration(_a0 []string, _a1 float64) { _m.Called(_a0, _a1) } +// PrometheusBackend_SetQueryDuration_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetQueryDuration' +type PrometheusBackend_SetQueryDuration_Call struct { + *mock.Call +} + +// SetQueryDuration is a helper method to define mock.On call +// - _a0 []string +// - _a1 float64 +func (_e *PrometheusBackend_Expecter) SetQueryDuration(_a0 interface{}, _a1 interface{}) *PrometheusBackend_SetQueryDuration_Call { + return &PrometheusBackend_SetQueryDuration_Call{Call: _e.mock.On("SetQueryDuration", _a0, _a1)} +} + +func (_c *PrometheusBackend_SetQueryDuration_Call) Run(run func(_a0 []string, _a1 float64)) *PrometheusBackend_SetQueryDuration_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].([]string), args[1].(float64)) + }) + return _c +} + +func (_c *PrometheusBackend_SetQueryDuration_Call) Return() *PrometheusBackend_SetQueryDuration_Call { + _c.Call.Return() + return _c +} + +func (_c *PrometheusBackend_SetQueryDuration_Call) RunAndReturn(run func([]string, float64)) *PrometheusBackend_SetQueryDuration_Call { + _c.Call.Return(run) + return _c +} + // SetQueryToObservationLatency provides a mock function with given fields: _a0, _a1 func (_m *PrometheusBackend) SetQueryToObservationLatency(_a0 []string, _a1 float64) { _m.Called(_a0, _a1) } +// PrometheusBackend_SetQueryToObservationLatency_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetQueryToObservationLatency' +type PrometheusBackend_SetQueryToObservationLatency_Call struct { + *mock.Call +} + +// SetQueryToObservationLatency is a helper method to define mock.On call +// - _a0 []string +// - _a1 float64 +func (_e *PrometheusBackend_Expecter) SetQueryToObservationLatency(_a0 interface{}, _a1 interface{}) *PrometheusBackend_SetQueryToObservationLatency_Call { + return &PrometheusBackend_SetQueryToObservationLatency_Call{Call: _e.mock.On("SetQueryToObservationLatency", _a0, _a1)} +} + +func (_c *PrometheusBackend_SetQueryToObservationLatency_Call) Run(run func(_a0 []string, _a1 float64)) *PrometheusBackend_SetQueryToObservationLatency_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].([]string), args[1].(float64)) + }) + return _c +} + +func (_c *PrometheusBackend_SetQueryToObservationLatency_Call) Return() *PrometheusBackend_SetQueryToObservationLatency_Call { + _c.Call.Return() + return _c +} + +func (_c *PrometheusBackend_SetQueryToObservationLatency_Call) RunAndReturn(run func([]string, float64)) *PrometheusBackend_SetQueryToObservationLatency_Call { + _c.Call.Return(run) + return _c +} + // SetReportDuration provides a mock function with given fields: _a0, _a1 func (_m *PrometheusBackend) SetReportDuration(_a0 []string, _a1 float64) { _m.Called(_a0, _a1) } +// PrometheusBackend_SetReportDuration_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetReportDuration' +type PrometheusBackend_SetReportDuration_Call struct { + *mock.Call +} + +// SetReportDuration is a helper method to define mock.On call +// - _a0 []string +// - _a1 float64 +func (_e *PrometheusBackend_Expecter) SetReportDuration(_a0 interface{}, _a1 interface{}) *PrometheusBackend_SetReportDuration_Call { + return &PrometheusBackend_SetReportDuration_Call{Call: _e.mock.On("SetReportDuration", _a0, _a1)} +} + +func (_c *PrometheusBackend_SetReportDuration_Call) Run(run func(_a0 []string, _a1 float64)) *PrometheusBackend_SetReportDuration_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].([]string), args[1].(float64)) + }) + return _c +} + +func (_c *PrometheusBackend_SetReportDuration_Call) Return() *PrometheusBackend_SetReportDuration_Call { + _c.Call.Return() + return _c +} + +func (_c *PrometheusBackend_SetReportDuration_Call) RunAndReturn(run func([]string, float64)) *PrometheusBackend_SetReportDuration_Call { + _c.Call.Return(run) + return _c +} + // SetReportToAcceptFinalizedReportLatency provides a mock function with given fields: _a0, _a1 func (_m *PrometheusBackend) SetReportToAcceptFinalizedReportLatency(_a0 []string, _a1 float64) { _m.Called(_a0, _a1) } +// PrometheusBackend_SetReportToAcceptFinalizedReportLatency_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetReportToAcceptFinalizedReportLatency' +type PrometheusBackend_SetReportToAcceptFinalizedReportLatency_Call struct { + *mock.Call +} + +// SetReportToAcceptFinalizedReportLatency is a helper method to define mock.On call +// - _a0 []string +// - _a1 float64 +func (_e *PrometheusBackend_Expecter) SetReportToAcceptFinalizedReportLatency(_a0 interface{}, _a1 interface{}) *PrometheusBackend_SetReportToAcceptFinalizedReportLatency_Call { + return &PrometheusBackend_SetReportToAcceptFinalizedReportLatency_Call{Call: _e.mock.On("SetReportToAcceptFinalizedReportLatency", _a0, _a1)} +} + +func (_c *PrometheusBackend_SetReportToAcceptFinalizedReportLatency_Call) Run(run func(_a0 []string, _a1 float64)) *PrometheusBackend_SetReportToAcceptFinalizedReportLatency_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].([]string), args[1].(float64)) + }) + return _c +} + +func (_c *PrometheusBackend_SetReportToAcceptFinalizedReportLatency_Call) Return() *PrometheusBackend_SetReportToAcceptFinalizedReportLatency_Call { + _c.Call.Return() + return _c +} + +func (_c *PrometheusBackend_SetReportToAcceptFinalizedReportLatency_Call) RunAndReturn(run func([]string, float64)) *PrometheusBackend_SetReportToAcceptFinalizedReportLatency_Call { + _c.Call.Return(run) + return _c +} + // SetShouldAcceptFinalizedReportDuration provides a mock function with given fields: _a0, _a1 func (_m *PrometheusBackend) SetShouldAcceptFinalizedReportDuration(_a0 []string, _a1 float64) { _m.Called(_a0, _a1) } +// PrometheusBackend_SetShouldAcceptFinalizedReportDuration_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetShouldAcceptFinalizedReportDuration' +type PrometheusBackend_SetShouldAcceptFinalizedReportDuration_Call struct { + *mock.Call +} + +// SetShouldAcceptFinalizedReportDuration is a helper method to define mock.On call +// - _a0 []string +// - _a1 float64 +func (_e *PrometheusBackend_Expecter) SetShouldAcceptFinalizedReportDuration(_a0 interface{}, _a1 interface{}) *PrometheusBackend_SetShouldAcceptFinalizedReportDuration_Call { + return &PrometheusBackend_SetShouldAcceptFinalizedReportDuration_Call{Call: _e.mock.On("SetShouldAcceptFinalizedReportDuration", _a0, _a1)} +} + +func (_c *PrometheusBackend_SetShouldAcceptFinalizedReportDuration_Call) Run(run func(_a0 []string, _a1 float64)) *PrometheusBackend_SetShouldAcceptFinalizedReportDuration_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].([]string), args[1].(float64)) + }) + return _c +} + +func (_c *PrometheusBackend_SetShouldAcceptFinalizedReportDuration_Call) Return() *PrometheusBackend_SetShouldAcceptFinalizedReportDuration_Call { + _c.Call.Return() + return _c +} + +func (_c *PrometheusBackend_SetShouldAcceptFinalizedReportDuration_Call) RunAndReturn(run func([]string, float64)) *PrometheusBackend_SetShouldAcceptFinalizedReportDuration_Call { + _c.Call.Return(run) + return _c +} + // SetShouldTransmitAcceptedReportDuration provides a mock function with given fields: _a0, _a1 func (_m *PrometheusBackend) SetShouldTransmitAcceptedReportDuration(_a0 []string, _a1 float64) { _m.Called(_a0, _a1) } +// PrometheusBackend_SetShouldTransmitAcceptedReportDuration_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetShouldTransmitAcceptedReportDuration' +type PrometheusBackend_SetShouldTransmitAcceptedReportDuration_Call struct { + *mock.Call +} + +// SetShouldTransmitAcceptedReportDuration is a helper method to define mock.On call +// - _a0 []string +// - _a1 float64 +func (_e *PrometheusBackend_Expecter) SetShouldTransmitAcceptedReportDuration(_a0 interface{}, _a1 interface{}) *PrometheusBackend_SetShouldTransmitAcceptedReportDuration_Call { + return &PrometheusBackend_SetShouldTransmitAcceptedReportDuration_Call{Call: _e.mock.On("SetShouldTransmitAcceptedReportDuration", _a0, _a1)} +} + +func (_c *PrometheusBackend_SetShouldTransmitAcceptedReportDuration_Call) Run(run func(_a0 []string, _a1 float64)) *PrometheusBackend_SetShouldTransmitAcceptedReportDuration_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].([]string), args[1].(float64)) + }) + return _c +} + +func (_c *PrometheusBackend_SetShouldTransmitAcceptedReportDuration_Call) Return() *PrometheusBackend_SetShouldTransmitAcceptedReportDuration_Call { + _c.Call.Return() + return _c +} + +func (_c *PrometheusBackend_SetShouldTransmitAcceptedReportDuration_Call) RunAndReturn(run func([]string, float64)) *PrometheusBackend_SetShouldTransmitAcceptedReportDuration_Call { + _c.Call.Return(run) + return _c +} + // NewPrometheusBackend creates a new instance of PrometheusBackend. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewPrometheusBackend(t interface { diff --git a/core/services/ocr2/plugins/promwrapper/plugin.go b/core/services/ocr2/plugins/promwrapper/plugin.go index 58d8e171f39..cc6c9d135dd 100644 --- a/core/services/ocr2/plugins/promwrapper/plugin.go +++ b/core/services/ocr2/plugins/promwrapper/plugin.go @@ -132,7 +132,6 @@ var ( ) ) -//go:generate mockery --quiet --name PrometheusBackend --output ./mocks/ --case=underscore type ( // Contains interface for logging OCR telemetry. PrometheusBackend interface { diff --git a/core/services/ocr2/plugins/s4/messages.pb.go b/core/services/ocr2/plugins/s4/messages.pb.go index e629633cb12..66bbeb7dbb6 100644 --- a/core/services/ocr2/plugins/s4/messages.pb.go +++ b/core/services/ocr2/plugins/s4/messages.pb.go @@ -7,10 +7,11 @@ package s4 import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" ) const ( diff --git a/core/services/ocr2/plugins/threshold/decryption_queue.go b/core/services/ocr2/plugins/threshold/decryption_queue.go index 442fcffe8b4..9c5d6d9d84b 100644 --- a/core/services/ocr2/plugins/threshold/decryption_queue.go +++ b/core/services/ocr2/plugins/threshold/decryption_queue.go @@ -13,7 +13,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/job" ) -//go:generate mockery --quiet --name Decryptor --output ./mocks/ --case=underscore type Decryptor interface { Decrypt(ctx context.Context, ciphertextId decryptionPlugin.CiphertextId, ciphertext []byte) ([]byte, error) } diff --git a/core/services/ocr2/plugins/threshold/mocks/decryptor.go b/core/services/ocr2/plugins/threshold/mocks/decryptor.go index b1afed995fc..1cbf9c2d056 100644 --- a/core/services/ocr2/plugins/threshold/mocks/decryptor.go +++ b/core/services/ocr2/plugins/threshold/mocks/decryptor.go @@ -14,6 +14,14 @@ type Decryptor struct { mock.Mock } +type Decryptor_Expecter struct { + mock *mock.Mock +} + +func (_m *Decryptor) EXPECT() *Decryptor_Expecter { + return &Decryptor_Expecter{mock: &_m.Mock} +} + // Decrypt provides a mock function with given fields: ctx, ciphertextId, ciphertext func (_m *Decryptor) Decrypt(ctx context.Context, ciphertextId decryptionplugin.CiphertextId, ciphertext []byte) ([]byte, error) { ret := _m.Called(ctx, ciphertextId, ciphertext) @@ -44,6 +52,36 @@ func (_m *Decryptor) Decrypt(ctx context.Context, ciphertextId decryptionplugin. return r0, r1 } +// Decryptor_Decrypt_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Decrypt' +type Decryptor_Decrypt_Call struct { + *mock.Call +} + +// Decrypt is a helper method to define mock.On call +// - ctx context.Context +// - ciphertextId decryptionplugin.CiphertextId +// - ciphertext []byte +func (_e *Decryptor_Expecter) Decrypt(ctx interface{}, ciphertextId interface{}, ciphertext interface{}) *Decryptor_Decrypt_Call { + return &Decryptor_Decrypt_Call{Call: _e.mock.On("Decrypt", ctx, ciphertextId, ciphertext)} +} + +func (_c *Decryptor_Decrypt_Call) Run(run func(ctx context.Context, ciphertextId decryptionplugin.CiphertextId, ciphertext []byte)) *Decryptor_Decrypt_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(decryptionplugin.CiphertextId), args[2].([]byte)) + }) + return _c +} + +func (_c *Decryptor_Decrypt_Call) Return(_a0 []byte, _a1 error) *Decryptor_Decrypt_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Decryptor_Decrypt_Call) RunAndReturn(run func(context.Context, decryptionplugin.CiphertextId, []byte) ([]byte, error)) *Decryptor_Decrypt_Call { + _c.Call.Return(run) + return _c +} + // NewDecryptor creates a new instance of Decryptor. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewDecryptor(t interface { diff --git a/core/services/ocr2/validate/validate.go b/core/services/ocr2/validate/validate.go index 2993a67114e..7ea34e5ac2d 100644 --- a/core/services/ocr2/validate/validate.go +++ b/core/services/ocr2/validate/validate.go @@ -6,6 +6,7 @@ import ( "errors" "fmt" "os/exec" + "strings" "github.com/lib/pq" "github.com/pelletier/go-toml" @@ -19,10 +20,13 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/config/env" "github.com/smartcontractkit/chainlink/v2/core/services/job" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/config" lloconfig "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/llo/config" mercuryconfig "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/mercury/config" "github.com/smartcontractkit/chainlink/v2/core/services/ocrcommon" + "github.com/smartcontractkit/chainlink/v2/core/services/pipeline" "github.com/smartcontractkit/chainlink/v2/core/services/relay" + evmtypes "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/types" "github.com/smartcontractkit/chainlink/v2/plugins" ) @@ -81,7 +85,6 @@ var ( "relay": {}, "relayConfig": {}, "pluginType": {}, - "pluginConfig": {}, } notExpectedParams = map[string]struct{}{ "isBootstrapPeer": {}, @@ -114,7 +117,11 @@ func validateSpec(ctx context.Context, tree *toml.Tree, spec job.Job, rc plugins // TODO validator for DR-OCR spec: https://smartcontract-it.atlassian.net/browse/FUN-112 return nil case types.Mercury: - return validateOCR2MercurySpec(spec.OCR2OracleSpec.PluginConfig, *spec.OCR2OracleSpec.FeedID) + return validateOCR2MercurySpec(spec.OCR2OracleSpec, *spec.OCR2OracleSpec.FeedID) + case types.CCIPExecution: + return validateOCR2CCIPExecutionSpec(spec.OCR2OracleSpec.PluginConfig) + case types.CCIPCommit: + return validateOCR2CCIPCommitSpec(spec.OCR2OracleSpec.PluginConfig) case types.LLO: return validateOCR2LLOSpec(spec.OCR2OracleSpec.PluginConfig) case types.GenericPlugin: @@ -190,18 +197,6 @@ func (o *OCR2OnchainSigningStrategy) IsMultiChain() bool { return o.StrategyName == "multi-chain" } -func (o *OCR2OnchainSigningStrategy) PublicKey() (string, error) { - pk, ok := o.Config["publicKey"] - if !ok { - return "", nil - } - pkString, ok := pk.(string) - if !ok { - return "", fmt.Errorf("expected string publicKey value, but got: %T", pk) - } - return pkString, nil -} - func (o *OCR2OnchainSigningStrategy) ConfigCopy() job.JSONConfig { copiedConfig := make(job.JSONConfig) for k, v := range o.Config { @@ -244,13 +239,6 @@ func validateGenericPluginSpec(ctx context.Context, spec *job.OCR2OracleSpec, rc if err != nil { return err } - pk, ossErr := onchainSigningStrategy.PublicKey() - if ossErr != nil { - return ossErr - } - if pk == "" { - return errors.New("generic config invalid: must provide public key for the onchain signing strategy") - } } plugEnv := env.NewPlugin(p.PluginName) @@ -309,13 +297,76 @@ func validateOCR2KeeperSpec(jsonConfig job.JSONConfig) error { return nil } -func validateOCR2MercurySpec(jsonConfig job.JSONConfig, feedId [32]byte) error { +func validateOCR2MercurySpec(spec *job.OCR2OracleSpec, feedID [32]byte) error { + var relayConfig evmtypes.RelayConfig + err := json.Unmarshal(spec.RelayConfig.Bytes(), &relayConfig) + if err != nil { + return pkgerrors.Wrap(err, "error while unmarshalling relay config") + } + + if len(spec.PluginConfig) == 0 { + if !relayConfig.EnableTriggerCapability { + return pkgerrors.Wrap(err, "at least one transmission option must be configured") + } + return nil + } + var pluginConfig mercuryconfig.PluginConfig - err := json.Unmarshal(jsonConfig.Bytes(), &pluginConfig) + err = json.Unmarshal(spec.PluginConfig.Bytes(), &pluginConfig) if err != nil { - return pkgerrors.Wrap(err, "error while unmarshaling plugin config") + return pkgerrors.Wrap(err, "error while unmarshalling plugin config") + } + return pkgerrors.Wrap(mercuryconfig.ValidatePluginConfig(pluginConfig, feedID), "Mercury PluginConfig is invalid") +} + +func validateOCR2CCIPExecutionSpec(jsonConfig job.JSONConfig) error { + if jsonConfig == nil { + return errors.New("pluginConfig is empty") + } + var cfg config.ExecPluginJobSpecConfig + err := json.Unmarshal(jsonConfig.Bytes(), &cfg) + if err != nil { + return pkgerrors.Wrap(err, "error while unmarshalling plugin config") + } + if cfg.USDCConfig != (config.USDCConfig{}) { + return cfg.USDCConfig.ValidateUSDCConfig() + } + return nil +} + +func validateOCR2CCIPCommitSpec(jsonConfig job.JSONConfig) error { + if jsonConfig == nil { + return errors.New("pluginConfig is empty") + } + var cfg config.CommitPluginJobSpecConfig + err := json.Unmarshal(jsonConfig.Bytes(), &cfg) + if err != nil { + return pkgerrors.Wrap(err, "error while unmarshalling plugin config") } - return pkgerrors.Wrap(mercuryconfig.ValidatePluginConfig(pluginConfig, feedId), "Mercury PluginConfig is invalid") + + // Ensure that either the tokenPricesUSDPipeline or the priceGetterConfig is set, but not both. + emptyPipeline := strings.Trim(cfg.TokenPricesUSDPipeline, "\n\t ") == "" + emptyPriceGetter := cfg.PriceGetterConfig == nil + if emptyPipeline && emptyPriceGetter { + return fmt.Errorf("either tokenPricesUSDPipeline or priceGetterConfig must be set") + } + if !emptyPipeline && !emptyPriceGetter { + return fmt.Errorf("only one of tokenPricesUSDPipeline or priceGetterConfig must be set: %s and %v", cfg.TokenPricesUSDPipeline, cfg.PriceGetterConfig) + } + + if !emptyPipeline { + _, err = pipeline.Parse(cfg.TokenPricesUSDPipeline) + if err != nil { + return pkgerrors.Wrap(err, "invalid token prices pipeline") + } + } else { + // Validate prices config (like it was done for the pipeline). + if emptyPriceGetter { + return pkgerrors.New("priceGetterConfig is empty") + } + } + + return nil } func validateOCR2LLOSpec(jsonConfig job.JSONConfig) error { diff --git a/core/services/ocr2/validate/validate_test.go b/core/services/ocr2/validate/validate_test.go index b92752c647d..1356e0db628 100644 --- a/core/services/ocr2/validate/validate_test.go +++ b/core/services/ocr2/validate/validate_test.go @@ -49,7 +49,6 @@ chainID = 1337 strategyName = "single-chain" [onchainSigningStrategy.config] evm = "" -publicKey = "0x1234567890123456789012345678901234567890" [pluginConfig] juelsPerFeeCoinSource = """ ds1 [type=bridge name=voter_turnout]; @@ -105,7 +104,6 @@ chainID = 1337 strategyName = "single-chain" [onchainSigningStrategy.config] evm = "" -publicKey = "0x1234567890123456789012345678901234567890" [pluginConfig] juelsPerFeeCoinSource = """ ds1 [type=bridge name=voter_turnout]; @@ -150,7 +148,6 @@ chainID = 1337 strategyName = "single-chain" [onchainSigningStrategy.config] evm = "" -publicKey = "0x1234567890123456789012345678901234567890" [pluginConfig] `, assertion: func(t *testing.T, os job.Job, err error) { @@ -174,7 +171,6 @@ chainID = 1337 strategyName = "single-chain" [onchainSigningStrategy.config] evm = "" -publicKey = "0x1234567890123456789012345678901234567890" [pluginConfig] `, assertion: func(t *testing.T, os job.Job, err error) { @@ -200,7 +196,6 @@ chainID = 1337 strategyName = "single-chain" [onchainSigningStrategy.config] evm = "" -publicKey = "0x1234567890123456789012345678901234567890" [pluginConfig] `, assertion: func(t *testing.T, os job.Job, err error) { @@ -226,7 +221,6 @@ chainID = 1337 strategyName = "single-chain" [onchainSigningStrategy.config] evm = "" -publicKey = "0x1234567890123456789012345678901234567890" [pluginConfig] `, assertion: func(t *testing.T, os job.Job, err error) { @@ -253,7 +247,6 @@ chainID = 1337 strategyName = "single-chain" [onchainSigningStrategy.config] evm = "" -publicKey = "0x1234567890123456789012345678901234567890" [pluginConfig] `, assertion: func(t *testing.T, os job.Job, err error) { @@ -279,7 +272,6 @@ chainID = 1337 strategyName = "single-chain" [onchainSigningStrategy.config] evm = "" -publicKey = "0x1234567890123456789012345678901234567890" [pluginConfig] `, assertion: func(t *testing.T, os job.Job, err error) { @@ -303,7 +295,6 @@ chainID = 1337 strategyName = "single-chain" [onchainSigningStrategy.config] evm = "" -publicKey = "0x1234567890123456789012345678901234567890" [pluginConfig] `, assertion: func(t *testing.T, os job.Job, err error) { @@ -344,7 +335,6 @@ answer1 [type=median index=0]; strategyName = "single-chain" [onchainSigningStrategy.config] evm = "" -publicKey = "0x1234567890123456789012345678901234567890" [pluginConfig] juelsPerFeeCoinSource = """ ds1 [type=bridge name=voter_turnout]; @@ -383,7 +373,6 @@ answer1 [type=median index=0]; strategyName = "single-chain" [onchainSigningStrategy.config] evm = "" -publicKey = "0x1234567890123456789012345678901234567890" [pluginConfig] juelsPerFeeCoinSource = """ -> @@ -415,7 +404,6 @@ answer1 [type=median index=0]; strategyName = "single-chain" [onchainSigningStrategy.config] evm = "" -publicKey = "0x1234567890123456789012345678901234567890" [pluginConfig] juelsPerFeeCoinSource = """ ds1 [type=bridge name=voter_turnout]; @@ -429,46 +417,6 @@ chainID = 1337 require.Contains(t, err.Error(), "no such relay blerg supported") }, }, - { - name: "Generic public onchain signing strategy with no public key", - toml: ` -type = "offchainreporting2" -pluginType = "plugin" -schemaVersion = 1 -relay = "evm" -contractID = "0x613a38AC1659769640aaE063C651F48E0250454C" -p2pPeerID = "12D3KooWHfYFQ8hGttAYbMCevQVESEQhzJAqFZokMVtom8bNxwGq" -p2pv2Bootstrappers = [ -"12D3KooWHfYFQ8hGttAYbMCevQVESEQhzJAqFZokMVtom8bNxwGq@127.0.0.1:5001", -] -ocrKeyBundleID = "73e8966a78ca09bb912e9565cfb79fbe8a6048fab1f0cf49b18047c3895e0447" -monitoringEndpoint = "chain.link:4321" -transmitterID = "0xF67D0290337bca0847005C7ffD1BC75BA9AAE6e4" -observationTimeout = "10s" -observationSource = """ -ds1 [type=bridge name=voter_turnout]; -ds1_parse [type=jsonparse path="one,two"]; -ds1_multiply [type=multiply times=1.23]; -ds1 -> ds1_parse -> ds1_multiply -> answer1; -answer1 [type=median index=0]; -""" -[relayConfig] -chainID = 1337 -[onchainSigningStrategy] -strategyName = "single-chain" -[onchainSigningStrategy.config] -evm = "" -publicKey = "" -[pluginConfig] -pluginName = "median" -telemetryType = "median" -OCRVersion=2 -`, - assertion: func(t *testing.T, os job.Job, err error) { - require.Error(t, err) - require.Contains(t, err.Error(), "must provide public key for the onchain signing strategy") - }, - }, { name: "Generic plugin config validation - nothing provided", toml: ` @@ -493,7 +441,6 @@ chainID = 4 strategyName = "single-chain" [onchainSigningStrategy.config] evm = "" -publicKey = "0x1234567890123456789012345678901234567890" [pluginConfig] `, @@ -525,7 +472,6 @@ chainID = 4 strategyName = "single-chain" [onchainSigningStrategy.config] evm = "" -publicKey = "0x1234567890123456789012345678901234567890" [pluginConfig] PluginName="some random name" @@ -559,7 +505,6 @@ chainID = 4 strategyName = "single-chain" [onchainSigningStrategy.config] evm = "" -publicKey = "0x1234567890123456789012345678901234567890" [pluginConfig] PluginName="some random name" @@ -594,7 +539,6 @@ chainID = 4 strategyName = "single-chain" [onchainSigningStrategy.config] evm = "" -publicKey = "0x1234567890123456789012345678901234567890" [pluginConfig] PluginName="some random name" @@ -712,7 +656,6 @@ func TestOCR2OnchainSigningStrategy_Unmarshal(t *testing.T) { strategyName = "single-chain" [onchainSigningStrategy.config] evm = "08d14c6eed757414d72055d28de6caf06535806c6a14e450f3a2f1c854420e17" -publicKey = "0x1234567890123456789012345678901234567890" ` oss := &envelope2{} tree, err := toml.Load(payload) @@ -725,12 +668,9 @@ publicKey = "0x1234567890123456789012345678901234567890" err = json.Unmarshal(b, oss) require.NoError(t, err) - pk, err := oss.OnchainSigningStrategy.PublicKey() - require.NoError(t, err) kbID, err := oss.OnchainSigningStrategy.KeyBundleID("evm") require.NoError(t, err) assert.False(t, oss.OnchainSigningStrategy.IsMultiChain()) - assert.Equal(t, "0x1234567890123456789012345678901234567890", pk) assert.Equal(t, "08d14c6eed757414d72055d28de6caf06535806c6a14e450f3a2f1c854420e17", kbID) } diff --git a/core/services/ocrbootstrap/delegate.go b/core/services/ocrbootstrap/delegate.go index fdcb68ceecc..10ac0cb45df 100644 --- a/core/services/ocrbootstrap/delegate.go +++ b/core/services/ocrbootstrap/delegate.go @@ -39,10 +39,16 @@ type Delegate struct { type relayConfig struct { // providerType used for determining which type of contract to track config on ProviderType string `json:"providerType"` + // HACK // Extra fields to enable router proxy contract support. Must match field names of functions' PluginConfig. DONID string `json:"donID"` ContractVersion uint32 `json:"contractVersion"` ContractUpdateCheckFrequencySec uint32 `json:"contractUpdateCheckFrequencySec"` + + // Annoyingly, the pre-existing donID field is already reserved and has a + // special-case usage just for functions. It's also a string and not uint32 + // as Baku requires. + LLODONID uint32 `json:"lloDonID"` } // NewDelegateBootstrap creates a new Delegate @@ -111,7 +117,7 @@ func (d *Delegate) ServicesForSpec(ctx context.Context, jb job.Job) (services [] var relayCfg relayConfig if err = json.Unmarshal(spec.RelayConfig.Bytes(), &relayCfg); err != nil { - return nil, err + return nil, fmt.Errorf("failed to unmarshal relay config for bootstrap job: %w", err) } var configProvider types.ConfigProvider diff --git a/core/services/ocrcommon/adapters.go b/core/services/ocrcommon/adapters.go index 372d9e37f15..b75a8a003c3 100644 --- a/core/services/ocrcommon/adapters.go +++ b/core/services/ocrcommon/adapters.go @@ -1,8 +1,14 @@ package ocrcommon import ( + "bytes" + "cmp" "context" + "encoding/binary" "fmt" + "io" + "math" + "slices" "github.com/pkg/errors" "github.com/smartcontractkit/libocr/offchainreporting2plus/ocr3types" @@ -11,6 +17,7 @@ import ( "google.golang.org/protobuf/types/known/structpb" "github.com/smartcontractkit/chainlink/v2/core/logger" + "github.com/smartcontractkit/chainlink/v2/core/services/keystore/chaintype" "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ocr2key" ) @@ -81,6 +88,82 @@ func (c *OCR3ContractTransmitterAdapter) FromAccount() (ocrtypes.Account, error) var _ ocr3types.OnchainKeyring[[]byte] = (*OCR3OnchainKeyringMultiChainAdapter)(nil) +func MarshalMultichainKeyBundle(ost map[string]ocr2key.KeyBundle) (ocrtypes.OnchainPublicKey, error) { + pubKeys := map[string]ocrtypes.OnchainPublicKey{} + for k, b := range ost { + pubKeys[k] = []byte(b.PublicKey()) + } + return MarshalMultichainPublicKey(pubKeys) +} + +func MarshalMultichainPublicKey(ost map[string]ocrtypes.OnchainPublicKey) (ocrtypes.OnchainPublicKey, error) { + var pubKeys [][]byte + for k, pubKey := range ost { + typ, err := chaintype.ChainType(k).Type() + if err != nil { + // skipping unknown key type + continue + } + buf := new(bytes.Buffer) + if err = binary.Write(buf, binary.LittleEndian, typ); err != nil { + return nil, err + } + length := len(pubKey) + if length < 0 || length > math.MaxUint16 { + return nil, fmt.Errorf("pubKey doesn't fit into uint16") + } + if err = binary.Write(buf, binary.LittleEndian, uint16(length)); err != nil { //nolint:gosec + return nil, err + } + _, _ = buf.Write(pubKey) + pubKeys = append(pubKeys, buf.Bytes()) + } + // sort keys based on encoded type to make encoding deterministic + slices.SortFunc(pubKeys, func(a, b []byte) int { return cmp.Compare(a[0], b[0]) }) + return bytes.Join(pubKeys, nil), nil +} + +func UnmarshalMultichainPublicKey(d []byte) (map[string]ocrtypes.OnchainPublicKey, error) { + m := map[string]ocrtypes.OnchainPublicKey{} + buf := bytes.NewReader(d) + + for { + // type + typ, err := buf.ReadByte() + if err != nil { + return nil, err + } + // length + var length uint16 + err = binary.Read(buf, binary.LittleEndian, &length) + if err != nil { + return nil, err + } + // value + pubKey := make([]byte, length) + n, err := buf.Read(pubKey) + if err != nil { + return nil, err + } + if n != int(length) { + return nil, io.EOF + } + + k, err := chaintype.NewChainType(typ) + if err != nil { + // skipping unknown key type + continue + } + m[string(k)] = pubKey + + if buf.Len() == 0 { + break + } + } + + return m, nil +} + type OCR3OnchainKeyringMultiChainAdapter struct { keyBundles map[string]ocr2key.KeyBundle publicKey ocrtypes.OnchainPublicKey @@ -91,38 +174,41 @@ func NewOCR3OnchainKeyringMultiChainAdapter(ost map[string]ocr2key.KeyBundle, lg if len(ost) == 0 { return nil, errors.New("no key bundles provided") } - // We don't need to check for the existence of `publicKey` in the keyBundles map because it is required on validation on `validate/validate.go` - return &OCR3OnchainKeyringMultiChainAdapter{ost, ost["publicKey"].PublicKey(), lggr}, nil + publicKey, err := MarshalMultichainKeyBundle(ost) + if err != nil { + return nil, err + } + return &OCR3OnchainKeyringMultiChainAdapter{ost, publicKey, lggr}, nil } func (a *OCR3OnchainKeyringMultiChainAdapter) PublicKey() ocrtypes.OnchainPublicKey { return a.publicKey } -func (a *OCR3OnchainKeyringMultiChainAdapter) getKeyBundleFromInfo(info []byte) (ocr2key.KeyBundle, error) { +func (a *OCR3OnchainKeyringMultiChainAdapter) getKeyBundleFromInfo(info []byte) (string, ocr2key.KeyBundle, error) { unmarshalledInfo := new(structpb.Struct) err := proto.Unmarshal(info, unmarshalledInfo) if err != nil { - return nil, fmt.Errorf("failed to unmarshal report info: %v", err) + return "", nil, fmt.Errorf("failed to unmarshal report info: %v", err) } infoMap := unmarshalledInfo.AsMap() keyBundleName, ok := infoMap["keyBundleName"] if !ok { - return nil, errors.New("keyBundleName not found in report info") + return "", nil, errors.New("keyBundleName not found in report info") } name, ok := keyBundleName.(string) if !ok { - return nil, errors.New("keyBundleName is not a string") + return "", nil, errors.New("keyBundleName is not a string") } kb, ok := a.keyBundles[name] if !ok { - return nil, fmt.Errorf("keyBundle not found: %s", name) + return "", nil, fmt.Errorf("keyBundle not found: %s", name) } - return kb, nil + return name, kb, nil } func (a *OCR3OnchainKeyringMultiChainAdapter) Sign(digest ocrtypes.ConfigDigest, seqNr uint64, r ocr3types.ReportWithInfo[[]byte]) (signature []byte, err error) { - kb, err := a.getKeyBundleFromInfo(r.Info) + _, kb, err := a.getKeyBundleFromInfo(r.Info) if err != nil { return nil, fmt.Errorf("sign: failed to get key bundle from report info: %v", err) } @@ -137,12 +223,22 @@ func (a *OCR3OnchainKeyringMultiChainAdapter) Sign(digest ocrtypes.ConfigDigest, } func (a *OCR3OnchainKeyringMultiChainAdapter) Verify(opk ocrtypes.OnchainPublicKey, digest ocrtypes.ConfigDigest, seqNr uint64, ri ocr3types.ReportWithInfo[[]byte], signature []byte) bool { - kb, err := a.getKeyBundleFromInfo(ri.Info) + kbName, kb, err := a.getKeyBundleFromInfo(ri.Info) if err != nil { a.lggr.Warnf("verify: failed to get key bundle from report info: %v", err) return false } - return kb.Verify(opk, ocrtypes.ReportContext{ + keys, err := UnmarshalMultichainPublicKey(opk) + if err != nil { + a.lggr.Warnf("verify: failed to unmarshal public keys: %v", err) + return false + } + publicKey, ok := keys[kbName] + if !ok { + a.lggr.Warnf("verify: publicKey not found: %v", kbName) + return false + } + return kb.Verify(publicKey, ocrtypes.ReportContext{ ReportTimestamp: ocrtypes.ReportTimestamp{ ConfigDigest: digest, Epoch: uint32(seqNr), diff --git a/core/services/ocrcommon/adapters_test.go b/core/services/ocrcommon/adapters_test.go index fed854b0b32..fddfb297ecc 100644 --- a/core/services/ocrcommon/adapters_test.go +++ b/core/services/ocrcommon/adapters_test.go @@ -2,25 +2,23 @@ package ocrcommon_test import ( "context" - "encoding/json" "fmt" + "math" "reflect" "testing" - "github.com/pelletier/go-toml" "github.com/smartcontractkit/libocr/offchainreporting2/types" "github.com/smartcontractkit/libocr/offchainreporting2plus/ocr3types" ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" "google.golang.org/protobuf/types/known/structpb" - "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/keystest" "github.com/smartcontractkit/chainlink/v2/core/logger" + "github.com/smartcontractkit/chainlink/v2/core/services/keystore/chaintype" "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ocr2key" - keystoreMocks "github.com/smartcontractkit/chainlink/v2/core/services/keystore/mocks" - "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/validate" "github.com/smartcontractkit/chainlink/v2/core/services/ocrcommon" ) @@ -115,63 +113,116 @@ func TestOCR3OnchainKeyringAdapter(t *testing.T) { require.Equal(t, maxSignatureLength, kr.MaxSignatureLength()) } -type envelope struct { - OnchainSigningStrategy *validate.OCR2OnchainSigningStrategy -} - func TestNewOCR3OnchainKeyringMultiChainAdapter(t *testing.T) { - payload := ` -[onchainSigningStrategy] -strategyName = "single-chain" -[onchainSigningStrategy.config] -evm = "08d14c6eed757414d72055d28de6caf06535806c6a14e450f3a2f1c854420e17" -publicKey = "pub-key" -` - oss := &envelope{} - tree, err := toml.Load(payload) - require.NoError(t, err) - o := map[string]any{} - err = tree.Unmarshal(&o) + evmBundle, err := ocr2key.New(chaintype.EVM) require.NoError(t, err) - b, err := json.Marshal(o) - require.NoError(t, err) - err = json.Unmarshal(b, oss) + + aptosBundle, err := ocr2key.New(chaintype.Aptos) require.NoError(t, err) - reportInfo := ocr3types.ReportWithInfo[[]byte]{ - Report: []byte("multi-chain-report"), + + bundles := map[string]ocr2key.KeyBundle{ + "evm": evmBundle, + "aptos": aptosBundle, } - info, err := structpb.NewStruct(map[string]interface{}{ + adapter, err := ocrcommon.NewOCR3OnchainKeyringMultiChainAdapter(bundles, logger.TestLogger(t)) + require.NoError(t, err) + + maxLength := math.Max(float64(evmBundle.MaxSignatureLength()), float64(aptosBundle.MaxSignatureLength())) + assert.Equal(t, int(maxLength), adapter.MaxSignatureLength()) + + // evm signature + info, err := structpb.NewStruct(map[string]any{ "keyBundleName": "evm", }) require.NoError(t, err) - infoB, err := proto.Marshal(info) + + infob, err := proto.Marshal(info) require.NoError(t, err) - reportInfo.Info = infoB + r := ocr3types.ReportWithInfo[[]byte]{ + Report: []byte("report"), + Info: infob, + } - ks := keystoreMocks.NewOCR2(t) - fakeKey := ocr2key.MustNewInsecure(keystest.NewRandReaderFromSeed(1), "evm") - pk := fakeKey.PublicKey() - ks.On("Get", "pub-key").Return(fakeKey, nil) - ks.On("Get", "08d14c6eed757414d72055d28de6caf06535806c6a14e450f3a2f1c854420e17").Return(fakeKey, nil) - keyBundles := map[string]ocr2key.KeyBundle{} - for name := range oss.OnchainSigningStrategy.ConfigCopy() { - kbID, ostErr := oss.OnchainSigningStrategy.KeyBundleID(name) - require.NoError(t, ostErr) - os, ostErr := ks.Get(kbID) - require.NoError(t, ostErr) - keyBundles[name] = os + sig, err := adapter.Sign(configDigest, seqNr, r) + require.NoError(t, err) + assert.True(t, adapter.Verify(adapter.PublicKey(), configDigest, seqNr, r, sig)) + + // aptos signature + info, err = structpb.NewStruct(map[string]any{ + "keyBundleName": "aptos", + }) + require.NoError(t, err) + + infob, err = proto.Marshal(info) + require.NoError(t, err) + r = ocr3types.ReportWithInfo[[]byte]{ + Report: []byte("report"), + Info: infob, } - adapter, err := ocrcommon.NewOCR3OnchainKeyringMultiChainAdapter(keyBundles, logger.TestLogger(t)) + sig, err = adapter.Sign(configDigest, seqNr, r) require.NoError(t, err) + assert.True(t, adapter.Verify(adapter.PublicKey(), configDigest, seqNr, r, sig)) + + // no bundles _, err = ocrcommon.NewOCR3OnchainKeyringMultiChainAdapter(map[string]ocr2key.KeyBundle{}, logger.TestLogger(t)) require.Error(t, err, "no key bundles provided") +} + +func newMultichainAdapter(t *testing.T) *ocrcommon.OCR3OnchainKeyringMultiChainAdapter { + evmBundle, err := ocr2key.New(chaintype.EVM) + require.NoError(t, err) + + aptosBundle, err := ocr2key.New(chaintype.Aptos) + require.NoError(t, err) + + bundles := map[string]ocr2key.KeyBundle{ + "evm": evmBundle, + "aptos": aptosBundle, + } + adapter, err := ocrcommon.NewOCR3OnchainKeyringMultiChainAdapter(bundles, logger.TestLogger(t)) + require.NoError(t, err) + + return adapter +} + +func TestNewOCR3OnchainKeyringMultiChainAdapter_VerifyFromDifferentNodesPublicKeys(t *testing.T) { + firstNodeAdapter := newMultichainAdapter(t) + secondNodeAdapter := newMultichainAdapter(t) - sig, err := adapter.Sign(configDigest, seqNr, reportInfo) - assert.NoError(t, err) - assert.True(t, adapter.Verify(pk, configDigest, seqNr, reportInfo, sig)) - assert.Equal(t, pk, adapter.PublicKey()) - assert.Equal(t, fakeKey.MaxSignatureLength(), adapter.MaxSignatureLength()) + // evm signature + info, err := structpb.NewStruct(map[string]any{ + "keyBundleName": "evm", + }) + require.NoError(t, err) + + infob, err := proto.Marshal(info) + require.NoError(t, err) + r := ocr3types.ReportWithInfo[[]byte]{ + Report: []byte("report"), + Info: infob, + } + + sig, err := firstNodeAdapter.Sign(configDigest, seqNr, r) + require.NoError(t, err) + assert.True(t, secondNodeAdapter.Verify(firstNodeAdapter.PublicKey(), configDigest, seqNr, r, sig)) + + // aptos signature + info, err = structpb.NewStruct(map[string]any{ + "keyBundleName": "aptos", + }) + require.NoError(t, err) + + infob, err = proto.Marshal(info) + require.NoError(t, err) + r = ocr3types.ReportWithInfo[[]byte]{ + Report: []byte("report"), + Info: infob, + } + + sig, err = secondNodeAdapter.Sign(configDigest, seqNr, r) + require.NoError(t, err) + assert.True(t, firstNodeAdapter.Verify(secondNodeAdapter.PublicKey(), configDigest, seqNr, r, sig)) } var _ ocrtypes.ContractTransmitter = (*fakeContractTransmitter)(nil) diff --git a/core/services/ocrcommon/arbitrum_block_translator.go b/core/services/ocrcommon/arbitrum_block_translator.go index 1b7c3712382..9179fe32270 100644 --- a/core/services/ocrcommon/arbitrum_block_translator.go +++ b/core/services/ocrcommon/arbitrum_block_translator.go @@ -10,9 +10,10 @@ import ( "github.com/pkg/errors" + "github.com/smartcontractkit/chainlink-common/pkg/logger" + evmclient "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" - "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/utils" ) @@ -33,7 +34,7 @@ type ArbitrumBlockTranslator struct { func NewArbitrumBlockTranslator(ethClient evmclient.Client, lggr logger.Logger) *ArbitrumBlockTranslator { return &ArbitrumBlockTranslator{ ethClient, - lggr.Named("ArbitrumBlockTranslator"), + logger.Named(lggr, "ArbitrumBlockTranslator"), make(map[int64]int64), sync.RWMutex{}, utils.KeyedMutex{}, diff --git a/core/services/ocrcommon/arbitrum_block_translator_test.go b/core/services/ocrcommon/arbitrum_block_translator_test.go index fa6875fb798..6b9abc93bf7 100644 --- a/core/services/ocrcommon/arbitrum_block_translator_test.go +++ b/core/services/ocrcommon/arbitrum_block_translator_test.go @@ -1,6 +1,7 @@ package ocrcommon_test import ( + "context" "database/sql" "math/big" mrand "math/rand" @@ -34,7 +35,7 @@ func TestArbitrumBlockTranslator_BinarySearch(t *testing.T) { var changedInL1Block int64 = 5541 latestBlock := blocks[1000] - client.On("HeadByNumber", ctx, (*big.Int)(nil)).Return(&latestBlock, nil).Once() + client.On("HeadByNumber", ctx, (*big.Int)(nil)).Return(latestBlock, nil).Once() from, to, err := abt.BinarySearch(ctx, changedInL1Block) require.NoError(t, err) @@ -51,11 +52,10 @@ func TestArbitrumBlockTranslator_BinarySearch(t *testing.T) { var changedInL1Block int64 = 42 latestBlock := blocks[1000] - client.On("HeadByNumber", ctx, (*big.Int)(nil)).Return(&latestBlock, nil).Once() + client.On("HeadByNumber", ctx, (*big.Int)(nil)).Return(latestBlock, nil).Once() - tmp := new(evmtypes.Head) - client.On("HeadByNumber", ctx, mock.AnythingOfType("*big.Int")).Return(tmp, nil).Run(func(args mock.Arguments) { - *tmp = blocks[args[1].(*big.Int).Int64()] + client.On("HeadByNumber", ctx, mock.AnythingOfType("*big.Int")).Return(func(_ context.Context, num *big.Int) (*evmtypes.Head, error) { + return blocks[num.Int64()], nil }) _, _, err := abt.BinarySearch(ctx, changedInL1Block) @@ -71,11 +71,10 @@ func TestArbitrumBlockTranslator_BinarySearch(t *testing.T) { var changedInL1Block int64 = 5043 latestBlock := blocks[1000] - client.On("HeadByNumber", ctx, (*big.Int)(nil)).Return(&latestBlock, nil).Once() + client.On("HeadByNumber", ctx, (*big.Int)(nil)).Return(latestBlock, nil).Once() - tmp := new(evmtypes.Head) - client.On("HeadByNumber", ctx, mock.AnythingOfType("*big.Int")).Return(tmp, nil).Run(func(args mock.Arguments) { - *tmp = blocks[args[1].(*big.Int).Int64()] + client.On("HeadByNumber", ctx, mock.AnythingOfType("*big.Int")).Return(func(_ context.Context, num *big.Int) (*evmtypes.Head, error) { + return blocks[num.Int64()], nil }) _, _, err := abt.BinarySearch(ctx, changedInL1Block) @@ -91,12 +90,10 @@ func TestArbitrumBlockTranslator_BinarySearch(t *testing.T) { var changedInL1Block int64 = 5042 latestBlock := blocks[1000] - client.On("HeadByNumber", ctx, (*big.Int)(nil)).Return(&latestBlock, nil).Once() + client.On("HeadByNumber", ctx, (*big.Int)(nil)).Return(latestBlock, nil).Once() - tmp := new(evmtypes.Head) - client.On("HeadByNumber", ctx, mock.AnythingOfType("*big.Int")).Return(tmp, nil).Run(func(args mock.Arguments) { - h := blocks[args[1].(*big.Int).Int64()] - *tmp = h + client.On("HeadByNumber", ctx, mock.AnythingOfType("*big.Int")).Return(func(_ context.Context, num *big.Int) (*evmtypes.Head, error) { + return blocks[num.Int64()], nil }) from, to, err := abt.BinarySearch(ctx, changedInL1Block) @@ -114,12 +111,10 @@ func TestArbitrumBlockTranslator_BinarySearch(t *testing.T) { var changedInL1Block int64 = 5000 latestBlock := blocks[1000] - client.On("HeadByNumber", ctx, (*big.Int)(nil)).Return(&latestBlock, nil).Once() + client.On("HeadByNumber", ctx, (*big.Int)(nil)).Return(latestBlock, nil).Once() - tmp := new(evmtypes.Head) - client.On("HeadByNumber", ctx, mock.AnythingOfType("*big.Int")).Return(tmp, nil).Run(func(args mock.Arguments) { - h := blocks[args[1].(*big.Int).Int64()] - *tmp = h + client.On("HeadByNumber", ctx, mock.AnythingOfType("*big.Int")).Return(func(_ context.Context, num *big.Int) (*evmtypes.Head, error) { + return blocks[num.Int64()], nil }) from, to, err := abt.BinarySearch(ctx, changedInL1Block) @@ -137,12 +132,10 @@ func TestArbitrumBlockTranslator_BinarySearch(t *testing.T) { var changedInL1Block int64 = 5540 latestBlock := blocks[1000] - client.On("HeadByNumber", ctx, (*big.Int)(nil)).Return(&latestBlock, nil).Once() + client.On("HeadByNumber", ctx, (*big.Int)(nil)).Return(latestBlock, nil).Once() - tmp := new(evmtypes.Head) - client.On("HeadByNumber", ctx, mock.AnythingOfType("*big.Int")).Return(tmp, nil).Run(func(args mock.Arguments) { - h := blocks[args[1].(*big.Int).Int64()] - *tmp = h + client.On("HeadByNumber", ctx, mock.AnythingOfType("*big.Int")).Return(func(_ context.Context, num *big.Int) (*evmtypes.Head, error) { + return blocks[num.Int64()], nil }) from, to, err := abt.BinarySearch(ctx, changedInL1Block) @@ -161,12 +154,10 @@ func TestArbitrumBlockTranslator_BinarySearch(t *testing.T) { latestBlock := blocks[1000] // Latest is never cached - client.On("HeadByNumber", ctx, (*big.Int)(nil)).Return(&latestBlock, nil).Once() + client.On("HeadByNumber", ctx, (*big.Int)(nil)).Return(latestBlock, nil).Once() - tmp := new(evmtypes.Head) - client.On("HeadByNumber", ctx, mock.AnythingOfType("*big.Int")).Times(20+18+14).Return(tmp, nil).Run(func(args mock.Arguments) { - h := blocks[args[1].(*big.Int).Int64()] - *tmp = h + client.On("HeadByNumber", ctx, mock.AnythingOfType("*big.Int")).Return(func(_ context.Context, num *big.Int) (*evmtypes.Head, error) { + return blocks[num.Int64()], nil }) // First search, nothing cached (total 21 - bsearch 20) @@ -230,14 +221,14 @@ func TestArbitrumBlockTranslator_NumberToQueryRange(t *testing.T) { }) } -func generateDeterministicL2Blocks() (heads []evmtypes.Head) { +func generateDeterministicL2Blocks() (heads []*evmtypes.Head) { source := mrand.NewSource(0) deterministicRand := mrand.New(source) l2max := 1000 var l1BlockNumber int64 = 5000 var parentHash common.Hash for i := 0; i <= l2max; i++ { - head := evmtypes.Head{ + head := &evmtypes.Head{ Number: int64(i), L1BlockNumber: sql.NullInt64{Int64: l1BlockNumber, Valid: true}, Hash: utils.NewHash(), diff --git a/core/services/ocrcommon/block_translator.go b/core/services/ocrcommon/block_translator.go index d7ceffc5ea7..fa44d79c2d2 100644 --- a/core/services/ocrcommon/block_translator.go +++ b/core/services/ocrcommon/block_translator.go @@ -4,10 +4,11 @@ import ( "context" "math/big" + "github.com/smartcontractkit/chainlink-common/pkg/logger" + evmclient "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/config/chaintype" evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" - "github.com/smartcontractkit/chainlink/v2/core/logger" ) // BlockTranslator converts emitted block numbers (from block.number) into a diff --git a/core/services/ocrcommon/data_source.go b/core/services/ocrcommon/data_source.go index 336074f81f8..9e3bde00dc0 100644 --- a/core/services/ocrcommon/data_source.go +++ b/core/services/ocrcommon/data_source.go @@ -193,7 +193,7 @@ func (ds *inMemoryDataSource) executeRun(ctx context.Context) (*pipeline.Run, pi }, }) - run, trrs, err := ds.pipelineRunner.ExecuteRun(ctx, ds.spec, vars, ds.lggr) + run, trrs, err := ds.pipelineRunner.ExecuteRun(ctx, ds.spec, vars) if err != nil { return nil, pipeline.TaskRunResults{}, errors.Wrapf(err, "error executing run for spec ID %v", ds.spec.ID) } @@ -227,7 +227,7 @@ func (ds *inMemoryDataSource) Observe(ctx context.Context, timestamp ocr2types.R return nil, err } - finalResult := trrs.FinalResult(ds.lggr) + finalResult := trrs.FinalResult() setEATelemetry(ds, finalResult, trrs, ObservationTimestamp{ Round: timestamp.Round, Epoch: timestamp.Epoch, @@ -310,7 +310,7 @@ func (ds *inMemoryDataSourceCache) updateCache(ctx context.Context) error { return errors.Wrapf(ds.latestUpdateErr, "error updating in memory data source cache for spec ID %v", ds.spec.ID) } - value, err := ds.inMemoryDataSource.parse(latestTrrs.FinalResult(ds.lggr)) + value, err := ds.inMemoryDataSource.parse(latestTrrs.FinalResult()) if err != nil { ds.latestUpdateErr = errors.Wrapf(err, "invalid result") return ds.latestUpdateErr @@ -318,7 +318,7 @@ func (ds *inMemoryDataSourceCache) updateCache(ctx context.Context) error { // update cache values ds.latestTrrs = latestTrrs - ds.latestResult = ds.latestTrrs.FinalResult(ds.lggr) + ds.latestResult = ds.latestTrrs.FinalResult() ds.latestUpdateErr = nil // backup in case data source fails continuously and node gets rebooted @@ -402,7 +402,7 @@ func (ds *dataSourceBase) observe(ctx context.Context, timestamp ObservationTime // a db write block that. ds.saver.Save(run) - finalResult := trrs.FinalResult(ds.lggr) + finalResult := trrs.FinalResult() setEATelemetry(&ds.inMemoryDataSource, finalResult, trrs, timestamp) return ds.inMemoryDataSource.parse(finalResult) diff --git a/core/services/ocrcommon/telemetry.go b/core/services/ocrcommon/telemetry.go index ec50db18aa2..810952f455e 100644 --- a/core/services/ocrcommon/telemetry.go +++ b/core/services/ocrcommon/telemetry.go @@ -7,31 +7,38 @@ import ( "math/big" "github.com/ethereum/go-ethereum/common" - - "google.golang.org/protobuf/proto" - "github.com/smartcontractkit/libocr/commontypes" ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" + "google.golang.org/protobuf/proto" + "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink-common/pkg/services" - "github.com/smartcontractkit/chainlink/v2/core/logger" + v1types "github.com/smartcontractkit/chainlink-common/pkg/types/mercury/v1" + v2types "github.com/smartcontractkit/chainlink-common/pkg/types/mercury/v2" + v3types "github.com/smartcontractkit/chainlink-common/pkg/types/mercury/v3" + v4types "github.com/smartcontractkit/chainlink-common/pkg/types/mercury/v4" + "github.com/smartcontractkit/chainlink/v2/core/services/job" "github.com/smartcontractkit/chainlink/v2/core/services/pipeline" mercuryutils "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury/utils" "github.com/smartcontractkit/chainlink/v2/core/services/synchronization/telem" "github.com/smartcontractkit/chainlink/v2/core/utils" - - v1types "github.com/smartcontractkit/chainlink-common/pkg/types/mercury/v1" - v2types "github.com/smartcontractkit/chainlink-common/pkg/types/mercury/v2" - v3types "github.com/smartcontractkit/chainlink-common/pkg/types/mercury/v3" ) -type eaTelemetry struct { +type EATelemetry struct { DataSource string ProviderRequestedTimestamp int64 ProviderReceivedTimestamp int64 ProviderDataStreamEstablished int64 ProviderIndicatedTime int64 + + DpBenchmarkPrice float64 + DpBid float64 + DpAsk float64 + BridgeTaskRunStartedTimestamp int64 + BridgeTaskRunEndedTimestamp int64 + AssetSymbol string + BridgeRequestData string } type EnhancedTelemetryData struct { @@ -41,15 +48,17 @@ type EnhancedTelemetryData struct { } type EnhancedTelemetryMercuryData struct { - V1Observation *v1types.Observation - V2Observation *v2types.Observation - V3Observation *v3types.Observation - TaskRunResults pipeline.TaskRunResults - RepTimestamp ocrtypes.ReportTimestamp - FeedVersion mercuryutils.FeedVersion - FetchMaxFinalizedTimestamp bool - IsLinkFeed bool - IsNativeFeed bool + V1Observation *v1types.Observation + V2Observation *v2types.Observation + V3Observation *v3types.Observation + V4Observation *v4types.Observation + TaskRunResults pipeline.TaskRunResults + RepTimestamp ocrtypes.ReportTimestamp + FeedVersion mercuryutils.FeedVersion + FetchMaxFinalizedTimestamp bool + IsLinkFeed bool + IsNativeFeed bool + DpInvariantViolationDetected bool } type EnhancedTelemetryService[T EnhancedTelemetryData | EnhancedTelemetryMercuryData] struct { @@ -143,8 +152,44 @@ func (e *EnhancedTelemetryService[T]) getChainID() string { } } +func ParseMercuryEATelemetry(lggr logger.Logger, trrs pipeline.TaskRunResults, feedVersion mercuryutils.FeedVersion) (eaTelemetryValues []EATelemetry) { + for _, trr := range trrs { + if trr.Task.Type() != pipeline.TaskTypeBridge { + continue + } + bridgeTask := trr.Task.(*pipeline.BridgeTask) + bridgeName := bridgeTask.Name + + bridgeRawResponse, ok := trr.Result.Value.(string) + if !ok { + lggr.Warnw(fmt.Sprintf("cannot get bridge response from bridge task, id=%s, name=%q, expected string got %T", trr.Task.DotID(), bridgeName, trr.Result.Value), "dotID", trr.Task.DotID(), "bridgeName", bridgeName) + continue + } + eaTelem, err := parseEATelemetry([]byte(bridgeRawResponse)) + if err != nil { + lggr.Warnw(fmt.Sprintf("cannot parse EA telemetry, id=%s, name=%q", trr.Task.DotID(), bridgeName), "err", err, "dotID", trr.Task.DotID(), "bridgeName", bridgeName) + } + eaTelem.BridgeRequestData = bridgeTask.RequestData + eaTelem.DpBenchmarkPrice, eaTelem.DpBid, eaTelem.DpAsk = getPricesFromBridgeTask(lggr, trr, trrs, feedVersion) + + eaTelem.BridgeTaskRunStartedTimestamp = trr.CreatedAt.UnixMilli() + eaTelem.BridgeTaskRunEndedTimestamp = trr.FinishedAt.Time.UnixMilli() + + parsedBridgeData := parseBridgeRequestData(bridgeTask.RequestData, feedVersion) + if parsedBridgeData.IsMarketStatus { + // Only collect telemetry for pricing bridges. + continue + } + + eaTelem.AssetSymbol = parsedBridgeData.AssetSymbol + + eaTelemetryValues = append(eaTelemetryValues, eaTelem) + } + return +} + // parseEATelemetry attempts to parse the bridge telemetry -func parseEATelemetry(b []byte) (eaTelemetry, error) { +func parseEATelemetry(b []byte) (EATelemetry, error) { type eaTimestamps struct { ProviderRequestedTimestamp int64 `json:"providerDataRequestedUnixMs"` ProviderReceivedTimestamp int64 `json:"providerDataReceivedUnixMs"` @@ -162,10 +207,10 @@ func parseEATelemetry(b []byte) (eaTelemetry, error) { t := eaTelem{} if err := json.Unmarshal(b, &t); err != nil { - return eaTelemetry{}, err + return EATelemetry{}, err } - return eaTelemetry{ + return EATelemetry{ DataSource: t.TelemMeta.AdapterName, ProviderRequestedTimestamp: t.TelemTimestamps.ProviderRequestedTimestamp, ProviderReceivedTimestamp: t.TelemTimestamps.ProviderReceivedTimestamp, @@ -293,13 +338,15 @@ func (e *EnhancedTelemetryService[T]) collectMercuryEnhancedTelemetry(d Enhanced var bn int64 var bh string var bt uint64 - // v1+v2+v3 fields + // v1+v2+v3+v4 fields bp := big.NewInt(0) - //v1+v3 fields + // v1+v3 fields bid := big.NewInt(0) ask := big.NewInt(0) // v2+v3 fields var mfts, lp, np int64 + // v4 fields + var marketStatus telem.MarketStatus switch { case d.V1Observation != nil: @@ -356,41 +403,40 @@ func (e *EnhancedTelemetryService[T]) collectMercuryEnhancedTelemetry(d Enhanced if obs.Ask.Err == nil && obs.Ask.Val != nil { ask = obs.Ask.Val } - } - - for _, trr := range d.TaskRunResults { - if trr.Task.Type() != pipeline.TaskTypeBridge { - continue + case d.V4Observation != nil: + obs := *d.V4Observation + if obs.MaxFinalizedTimestamp.Err == nil { + mfts = obs.MaxFinalizedTimestamp.Val } - bridgeTask := trr.Task.(*pipeline.BridgeTask) - bridgeName := bridgeTask.Name - - bridgeRawResponse, ok := trr.Result.Value.(string) - if !ok { - e.lggr.Warnw(fmt.Sprintf("cannot get bridge response from bridge task, job=%d, id=%s, name=%q, expected string got %T", e.job.ID, trr.Task.DotID(), bridgeName, trr.Result.Value), "jobID", e.job.ID, "dotID", trr.Task.DotID(), "bridgeName", bridgeName) - continue + if obs.LinkPrice.Err == nil && obs.LinkPrice.Val != nil { + lp = obs.LinkPrice.Val.Int64() } - eaTelem, err := parseEATelemetry([]byte(bridgeRawResponse)) - if err != nil { - e.lggr.Warnw(fmt.Sprintf("cannot parse EA telemetry, job=%d, id=%s, name=%q", e.job.ID, trr.Task.DotID(), bridgeName), "err", err, "jobID", e.job.ID, "dotID", trr.Task.DotID(), "bridgeName", bridgeName) + if obs.NativePrice.Err == nil && obs.NativePrice.Val != nil { + np = obs.NativePrice.Val.Int64() } + if obs.BenchmarkPrice.Err == nil && obs.BenchmarkPrice.Val != nil { + bp = obs.BenchmarkPrice.Val + } + if obs.MarketStatus.Err == nil { + marketStatus = telem.MarketStatus(obs.MarketStatus.Val) + } + } - assetSymbol := e.getAssetSymbolFromRequestData(bridgeTask.RequestData) - - benchmarkPrice, bidPrice, askPrice := e.getPricesFromResults(trr, d.TaskRunResults, d.FeedVersion) - + eaTelemetryValues := ParseMercuryEATelemetry(logger.Sugared(e.lggr).With("jobID", e.job.ID), d.TaskRunResults, d.FeedVersion) + for _, eaTelem := range eaTelemetryValues { t := &telem.EnhancedEAMercury{ DataSource: eaTelem.DataSource, - DpBenchmarkPrice: benchmarkPrice, - DpBid: bidPrice, - DpAsk: askPrice, + DpBenchmarkPrice: eaTelem.DpBenchmarkPrice, + DpBid: eaTelem.DpBid, + DpAsk: eaTelem.DpAsk, + DpInvariantViolationDetected: d.DpInvariantViolationDetected, CurrentBlockNumber: bn, CurrentBlockHash: bh, CurrentBlockTimestamp: bt, FetchMaxFinalizedTimestamp: d.FetchMaxFinalizedTimestamp, MaxFinalizedTimestamp: mfts, - BridgeTaskRunStartedTimestamp: trr.CreatedAt.UnixMilli(), - BridgeTaskRunEndedTimestamp: trr.FinishedAt.Time.UnixMilli(), + BridgeTaskRunStartedTimestamp: eaTelem.BridgeTaskRunStartedTimestamp, + BridgeTaskRunEndedTimestamp: eaTelem.BridgeTaskRunEndedTimestamp, ProviderRequestedTimestamp: eaTelem.ProviderRequestedTimestamp, ProviderReceivedTimestamp: eaTelem.ProviderReceivedTimestamp, ProviderDataStreamEstablished: eaTelem.ProviderDataStreamEstablished, @@ -402,6 +448,7 @@ func (e *EnhancedTelemetryService[T]) collectMercuryEnhancedTelemetry(d Enhanced ObservationBenchmarkPriceString: stringOrEmpty(bp), ObservationBidString: stringOrEmpty(bid), ObservationAskString: stringOrEmpty(ask), + ObservationMarketStatus: marketStatus, IsLinkFeed: d.IsLinkFeed, LinkPrice: lp, IsNativeFeed: d.IsNativeFeed, @@ -409,10 +456,11 @@ func (e *EnhancedTelemetryService[T]) collectMercuryEnhancedTelemetry(d Enhanced ConfigDigest: d.RepTimestamp.ConfigDigest.Hex(), Round: int64(d.RepTimestamp.Round), Epoch: int64(d.RepTimestamp.Epoch), - AssetSymbol: assetSymbol, + BridgeRequestData: eaTelem.BridgeRequestData, + AssetSymbol: eaTelem.AssetSymbol, Version: uint32(d.FeedVersion), } - + e.lggr.Debugw(fmt.Sprintf("EA Telemetry = %+v", t), "feedID", e.job.OCR2OracleSpec.FeedID.Hex(), "jobID", e.job.ID, "datasource", eaTelem.DataSource) bytes, err := proto.Marshal(t) if err != nil { e.lggr.Warnf("protobuf marshal failed %v", err.Error()) @@ -423,11 +471,32 @@ func (e *EnhancedTelemetryService[T]) collectMercuryEnhancedTelemetry(d Enhanced } } -// getAssetSymbolFromRequestData parses the requestData of the bridge to generate an asset symbol pair -func (e *EnhancedTelemetryService[T]) getAssetSymbolFromRequestData(requestData string) string { +type telemetryAttributes struct { + PriceType *string `json:"priceType"` +} + +func parseTelemetryAttributes(a string) (telemetryAttributes, error) { + attrs := &telemetryAttributes{} + err := json.Unmarshal([]byte(a), attrs) + if err != nil { + return telemetryAttributes{}, err + } + return *attrs, nil +} + +type bridgeRequestData struct { + AssetSymbol string + IsMarketStatus bool +} + +// parseRequestData parses the requestData of the bridge. +func parseBridgeRequestData(requestData string, mercuryVersion mercuryutils.FeedVersion) bridgeRequestData { type reqDataPayload struct { - To string `json:"to"` - From string `json:"from"` + Endpoint *string `json:"endpoint"` + To *string `json:"to"` + From *string `json:"from"` + Address *string `json:"address"` // used for view function ea only + Market *string `json:"market"` // used for market status ea only } type reqData struct { Data reqDataPayload `json:"data"` @@ -436,10 +505,25 @@ func (e *EnhancedTelemetryService[T]) getAssetSymbolFromRequestData(requestData rd := &reqData{} err := json.Unmarshal([]byte(requestData), rd) if err != nil { - return "" + return bridgeRequestData{} + } + + if mercuryVersion == 4 && ((rd.Data.Endpoint != nil && *rd.Data.Endpoint == "market-status") || (rd.Data.Market != nil && *rd.Data.Market != "")) { + return bridgeRequestData{ + AssetSymbol: *rd.Data.Market, + IsMarketStatus: true, + } } - return rd.Data.From + "/" + rd.Data.To + if rd.Data.From != nil && rd.Data.To != nil { + return bridgeRequestData{AssetSymbol: *rd.Data.From + "/" + *rd.Data.To} + } + + if rd.Data.Address != nil { + return bridgeRequestData{AssetSymbol: *rd.Data.Address} + } + + return bridgeRequestData{} } // ShouldCollectEnhancedTelemetryMercury checks if enhanced telemetry should be collected and sent @@ -450,64 +534,131 @@ func ShouldCollectEnhancedTelemetryMercury(jb job.Job) bool { return false } -// getPricesFromResults parses the pipeline.TaskRunResults for pipeline.TaskTypeJSONParse and gets the benchmarkPrice, +const ( + bid = "bid" + ask = "ask" + benchmark = "benchmark" + exchangeRate = "exchangeRate" +) + +func getPricesFromBridgeTask(lggr logger.Logger, bridgeTask pipeline.TaskRunResult, allTasks pipeline.TaskRunResults, mercuryVersion mercuryutils.FeedVersion) (float64, float64, float64) { + var benchmarkPrice, bidPrice, askPrice float64 + + // This will assume that all fields we care about are tagged with the correct priceType + benchmarkPrice, bidPrice, askPrice = getPricesFromBridgeTaskByTelemetryField(lggr, bridgeTask, allTasks) + + // If prices weren't parsed by telemetry fields - attempt to get prices using the legacy method + // This is for backwards compatibility with job specs that don't have the telemetry attributes set + if benchmarkPrice == 0 && bidPrice == 0 && askPrice == 0 { + benchmarkP, bidP, askP := getPricesFromResultsByOrder(lggr, bridgeTask, allTasks, mercuryVersion) + bidPrice = bidP + askPrice = askP + benchmarkPrice = benchmarkP + } + + return benchmarkPrice, bidPrice, askPrice +} + +// CollectTaskRunResultsWithTags collects TaskRunResults for descendent tasks with non-empty TaskTags. +func collectTaskRunResultsWithTags(bridgeTask pipeline.TaskRunResult, allTasks pipeline.TaskRunResults) []pipeline.TaskRunResult { + startTask := bridgeTask.Task + descendants := startTask.GetDescendantTasks() + var taskRunResultsWithTags []pipeline.TaskRunResult + for _, task := range descendants { + trr := allTasks.GetTaskRunResultOf(task) + if trr != nil { + if trr.Task.TaskTags() != "" { + taskRunResultsWithTags = append(taskRunResultsWithTags, *trr) + } + } + } + return taskRunResultsWithTags +} + +// getPricesFromBridgeTaskByTelemetryField attempts to parse prices from via telemetry fields in the TaskTags +func getPricesFromBridgeTaskByTelemetryField(lggr logger.Logger, bridgeTask pipeline.TaskRunResult, allTasks pipeline.TaskRunResults) (float64, float64, float64) { + var benchmarkPrice, bidPrice, askPrice float64 + + // Outputs are the mapped tasks from this task. + var tasksWithTags = collectTaskRunResultsWithTags(bridgeTask, allTasks) + + for _, trr := range tasksWithTags { + attributes, err := parseTelemetryAttributes(trr.Task.TaskTags()) + if err != nil { + lggr.Warnw(fmt.Sprintf("found telemetry attributes but cannot them, taskTags=%s", trr.Task.TaskTags()), "err", err) + continue + } + + if attributes.PriceType != nil { + switch *attributes.PriceType { + case bid: + bidPrice = parsePriceFromTask(lggr, trr) + case ask: + askPrice = parsePriceFromTask(lggr, trr) + case benchmark: + benchmarkPrice = parsePriceFromTask(lggr, trr) + case exchangeRate: + price := parsePriceFromTask(lggr, trr) + benchmarkPrice, bidPrice, askPrice = price, price, price + case "": + lggr.Warnw(fmt.Sprintf("no priceType found in attributes, parsedAttributes=%+v, id %s", attributes, trr.Task.DotID())) + } + } + } + + return benchmarkPrice, bidPrice, askPrice +} + +func parsePriceFromTask(lggr logger.Logger, trr pipeline.TaskRunResult) float64 { + var val float64 + if trr.Result.Error != nil { + lggr.Warnw(fmt.Sprintf("got error on EA telemetry price task, id %s: %s", trr.Task.DotID(), trr.Result.Error), "err", trr.Result.Error) + return 0 + } + val, err := getResultFloat64(&trr) + if err != nil { + lggr.Warnw(fmt.Sprintf("cannot parse EA telemetry price to float64, DOT id %s", trr.Task.DotID()), "task_type", trr.Task.Type(), "task_tags", trr.Task.TaskTags(), "err", err) + } + return val +} + +// getPricesFromResultsByOrder parses the pipeline.TaskRunResults for pipeline.TaskTypeJSONParse and gets the benchmarkPrice, // bid and ask. This functions expects the pipeline.TaskRunResults to be correctly ordered -func (e *EnhancedTelemetryService[T]) getPricesFromResults(startTask pipeline.TaskRunResult, allTasks pipeline.TaskRunResults, mercuryVersion mercuryutils.FeedVersion) (float64, float64, float64) { +func getPricesFromResultsByOrder(lggr logger.Logger, startTask pipeline.TaskRunResult, allTasks pipeline.TaskRunResults, mercuryVersion mercuryutils.FeedVersion) (float64, float64, float64) { var benchmarkPrice, askPrice, bidPrice float64 - var err error + // We rely on task results to be sorted in the correct order benchmarkPriceTask := allTasks.GetNextTaskOf(startTask) if benchmarkPriceTask == nil { - e.lggr.Warnf("cannot parse enhanced EA telemetry benchmark price, task is nil, job %d", e.job.ID) + lggr.Warn("cannot parse enhanced EA telemetry benchmark price, task is nil") return 0, 0, 0 } if benchmarkPriceTask.Task.Type() == pipeline.TaskTypeJSONParse { - if benchmarkPriceTask.Result.Error != nil { - e.lggr.Warnw(fmt.Sprintf("got error for enhanced EA telemetry benchmark price, job %d, id %s: %s", e.job.ID, benchmarkPriceTask.Task.DotID(), benchmarkPriceTask.Result.Error), "err", benchmarkPriceTask.Result.Error) - } else { - benchmarkPrice, err = getResultFloat64(benchmarkPriceTask) - if err != nil { - e.lggr.Warnw(fmt.Sprintf("cannot parse enhanced EA telemetry benchmark price, job %d, id %s", e.job.ID, benchmarkPriceTask.Task.DotID()), "err", err) - } - } + benchmarkPrice = parsePriceFromTask(lggr, *benchmarkPriceTask) } - // mercury version 2 only supports benchmarkPrice - if mercuryVersion == 2 { + // mercury versions 2 and 4 only supports benchmarkPrice + if mercuryVersion == 2 || mercuryVersion == 4 { return benchmarkPrice, 0, 0 } bidTask := allTasks.GetNextTaskOf(*benchmarkPriceTask) if bidTask == nil { - e.lggr.Warnf("cannot parse enhanced EA telemetry bid price, task is nil, job %d, id %s", e.job.ID, benchmarkPriceTask.Task.DotID()) + lggr.Warnf("cannot parse enhanced EA telemetry bid price, task is nil, id %s", benchmarkPriceTask.Task.DotID()) return benchmarkPrice, 0, 0 } - if bidTask != nil && bidTask.Task.Type() == pipeline.TaskTypeJSONParse { - if bidTask.Result.Error != nil { - e.lggr.Warnw(fmt.Sprintf("got error for enhanced EA telemetry bid price, job %d, id %s: %s", e.job.ID, bidTask.Task.DotID(), bidTask.Result.Error), "err", bidTask.Result.Error) - } else { - bidPrice, err = getResultFloat64(bidTask) - if err != nil { - e.lggr.Warnw(fmt.Sprintf("cannot parse enhanced EA telemetry bid price, job %d, id %s", e.job.ID, bidTask.Task.DotID()), "err", err) - } - } + if bidTask.Task.Type() == pipeline.TaskTypeJSONParse { + bidPrice = parsePriceFromTask(lggr, *bidTask) } askTask := allTasks.GetNextTaskOf(*bidTask) if askTask == nil { - e.lggr.Warnf("cannot parse enhanced EA telemetry ask price, task is nil, job %d, id %s", e.job.ID, benchmarkPriceTask.Task.DotID()) + lggr.Warnf("cannot parse enhanced EA telemetry ask price, task is nil, id %s", benchmarkPriceTask.Task.DotID()) return benchmarkPrice, bidPrice, 0 } - if askTask != nil && askTask.Task.Type() == pipeline.TaskTypeJSONParse { - if bidTask.Result.Error != nil { - e.lggr.Warnw(fmt.Sprintf("got error for enhanced EA telemetry ask price, job %d, id %s: %s", e.job.ID, askTask.Task.DotID(), askTask.Result.Error), "err", askTask.Result.Error) - } else { - askPrice, err = getResultFloat64(askTask) - if err != nil { - e.lggr.Warnw(fmt.Sprintf("cannot parse enhanced EA telemetry ask price, job %d, id %s", e.job.ID, askTask.Task.DotID()), "err", err) - } - } + if askTask.Task.Type() == pipeline.TaskTypeJSONParse { + askPrice = parsePriceFromTask(lggr, *askTask) } return benchmarkPrice, bidPrice, askPrice diff --git a/core/services/ocrcommon/telemetry_test.go b/core/services/ocrcommon/telemetry_test.go index f764e7380f8..ed64e45c2db 100644 --- a/core/services/ocrcommon/telemetry_test.go +++ b/core/services/ocrcommon/telemetry_test.go @@ -6,19 +6,19 @@ import ( "testing" "github.com/ethereum/go-ethereum/common" + "github.com/shopspring/decimal" + "github.com/smartcontractkit/libocr/offchainreporting2plus/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" "go.uber.org/zap" "google.golang.org/protobuf/proto" - "github.com/smartcontractkit/libocr/offchainreporting2plus/types" - "github.com/smartcontractkit/chainlink-common/pkg/services/servicetest" "github.com/smartcontractkit/chainlink-common/pkg/types/mercury" mercuryv1 "github.com/smartcontractkit/chainlink-common/pkg/types/mercury/v1" mercuryv2 "github.com/smartcontractkit/chainlink-common/pkg/types/mercury/v2" - + mercuryv4 "github.com/smartcontractkit/chainlink-common/pkg/types/mercury/v4" evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils" ubig "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils/big" @@ -273,7 +273,6 @@ func TestSendEATelemetry(t *testing.T) { expectedMessage, _ := proto.Marshal(&expectedTelemetry) wg.Wait() assert.Equal(t, expectedMessage, sentMessage) - //enhancedTelemService.StopOnce("EnhancedTelemetryService", func() error { return nil }) doneCh <- struct{}{} } @@ -445,21 +444,123 @@ var trrsMercuryV2 = pipeline.TaskRunResults{ }, } -func TestGetPricesFromResults(t *testing.T) { - lggr, logs := logger.TestLoggerObserved(t, zap.WarnLevel) - e := EnhancedTelemetryService[EnhancedTelemetryMercuryData]{ - lggr: lggr, - job: &job.Job{ - ID: 0, +var trrsMercuryV4 = pipeline.TaskRunResults{ + pipeline.TaskRunResult{ + Task: &pipeline.BridgeTask{ + Name: "link-usd-test-bridge-v2", + BaseTask: pipeline.NewBaseTask(0, "ds1", nil, nil, 0), + RequestData: `{"data":{"to":"LINK","from":"USD"}}`, + }, + Result: pipeline.Result{ + Value: bridgeResponse, + }, + }, + pipeline.TaskRunResult{ + Task: &pipeline.JSONParseTask{ + BaseTask: pipeline.NewBaseTask(1, "ds1_benchmark", nil, nil, 1), + }, + Result: pipeline.Result{ + Value: 123456.123456, + }, + }, + pipeline.TaskRunResult{ + Task: &pipeline.BridgeTask{ + Name: "market-status-bridge", + BaseTask: pipeline.NewBaseTask(2, "ds2", nil, nil, 2), + RequestData: `{"data":{"endpoint":"market-status","market":"forex"}}`, + }, + Result: pipeline.Result{ + Value: bridgeResponse, }, + }, + pipeline.TaskRunResult{ + Task: &pipeline.JSONParseTask{ + BaseTask: pipeline.NewBaseTask(3, "market_status", nil, nil, 3), + }, + Result: pipeline.Result{ + Value: 2.0, + }, + }, +} + +func TestGetPricesFromBridgeByTelemetryField(t *testing.T) { + lggr, _ := logger.TestLoggerObserved(t, zap.WarnLevel) + // These are intentionally out of order from the "legacy" method which expects order of `benchmark, bid, ask` + jsonParseTaskBid := pipeline.JSONParseTask{ + BaseTask: pipeline.NewBaseTask(1, "json_parse_2", nil, nil, 2), + } + jsonParseTaskBid.BaseTask.Tags = `{"priceType": "bid"}` + jsonParseTaskAsk := pipeline.JSONParseTask{ + BaseTask: pipeline.NewBaseTask(2, "json_parse_3", nil, nil, 3), + } + jsonParseTaskAsk.BaseTask.Tags = `{"priceType": "ask"}` + jsonParseTaskBenchmark := pipeline.JSONParseTask{ + BaseTask: pipeline.NewBaseTask(3, "json_parse_1", nil, nil, 1), + } + jsonParseTaskBenchmark.BaseTask.Tags = `{"priceType": "benchmark"}` + + bridgeOutputs := []pipeline.Task{&jsonParseTaskAsk, &jsonParseTaskBid, &jsonParseTaskBenchmark} + + bridgeTask := pipeline.BridgeTask{ + Name: "bridge-task", + BaseTask: pipeline.NewBaseTask(0, "bridge", nil, bridgeOutputs, 0), } - benchmarkPrice, bid, ask := e.getPricesFromResults(trrsMercuryV1[0], trrsMercuryV1, 1) + // Create task run results + taskRunResults := pipeline.TaskRunResults{ + pipeline.TaskRunResult{ + Task: &bridgeTask, + Result: pipeline.Result{ + Value: bridgeResponse, + }, + }, + pipeline.TaskRunResult{ + Task: &jsonParseTaskBenchmark, + Result: pipeline.Result{ + Value: "123456.123456", + }, + }, + pipeline.TaskRunResult{ + Task: &jsonParseTaskBid, + Result: pipeline.Result{ + Value: "1234567.1234567", + }, + }, + pipeline.TaskRunResult{ + Task: &jsonParseTaskAsk, + Result: pipeline.Result{ + Value: "321123", + }, + }, + } + + benchmarkPrice, bidPrice, askPrice := getPricesFromBridgeTask(lggr, taskRunResults[0], taskRunResults, 1) + + require.Equal(t, 123456.123456, benchmarkPrice) + require.Equal(t, 1234567.1234567, bidPrice) + require.Equal(t, 321123.0, askPrice) + + // now removing the TaskTags will throw off the parsed order - and we'll be parsing the "incorrect" prices + // according to the legacy ordering approach + jsonParseTaskAsk.BaseTask.Tags = "" + jsonParseTaskBid.BaseTask.Tags = "" + jsonParseTaskBenchmark.BaseTask.Tags = "" + + wrongBenchmarkPrice, wrongBidPrice, wrongAskPrice := getPricesFromBridgeTask(lggr, taskRunResults[0], taskRunResults, 1) + require.Equal(t, 1234567.1234567, wrongBenchmarkPrice) + require.Equal(t, 321123.0, wrongBidPrice) + require.Equal(t, 123456.123456, wrongAskPrice) +} + +func TestGetPricesFromBridgeTaskByOrder(t *testing.T) { + lggr, logs := logger.TestLoggerObserved(t, zap.WarnLevel) + + benchmarkPrice, bid, ask := getPricesFromBridgeTask(lggr, trrsMercuryV1[0], trrsMercuryV1, 1) require.Equal(t, 123456.123456, benchmarkPrice) require.Equal(t, 1234567.1234567, bid) require.Equal(t, float64(321123), ask) - benchmarkPrice, bid, ask = e.getPricesFromResults(trrsMercuryV1[0], pipeline.TaskRunResults{}, 1) + benchmarkPrice, bid, ask = getPricesFromBridgeTask(lggr, trrsMercuryV1[0], pipeline.TaskRunResults{}, 1) require.Equal(t, float64(0), benchmarkPrice) require.Equal(t, float64(0), bid) require.Equal(t, float64(0), ask) @@ -467,12 +568,12 @@ func TestGetPricesFromResults(t *testing.T) { require.Contains(t, logs.All()[0].Message, "cannot parse enhanced EA telemetry") tt := trrsMercuryV1[:2] - e.getPricesFromResults(trrsMercuryV1[0], tt, 1) + getPricesFromBridgeTask(lggr, trrsMercuryV1[0], tt, 1) require.Equal(t, 2, logs.Len()) require.Contains(t, logs.All()[1].Message, "cannot parse enhanced EA telemetry bid price, task is nil") tt = trrsMercuryV1[:3] - e.getPricesFromResults(trrsMercuryV1[0], tt, 1) + getPricesFromBridgeTask(lggr, trrsMercuryV1[0], tt, 1) require.Equal(t, 3, logs.Len()) require.Contains(t, logs.All()[2].Message, "cannot parse enhanced EA telemetry ask price, task is nil") @@ -510,16 +611,16 @@ func TestGetPricesFromResults(t *testing.T) { Value: nil, }, }} - benchmarkPrice, bid, ask = e.getPricesFromResults(trrsMercuryV1[0], trrs2, 3) + benchmarkPrice, bid, ask = getPricesFromBridgeTask(lggr, trrsMercuryV1[0], trrs2, 3) require.Equal(t, benchmarkPrice, float64(0)) require.Equal(t, bid, float64(0)) require.Equal(t, ask, float64(0)) require.Equal(t, logs.Len(), 6) - require.Contains(t, logs.All()[3].Message, "cannot parse enhanced EA telemetry benchmark price") - require.Contains(t, logs.All()[4].Message, "cannot parse enhanced EA telemetry bid price") - require.Contains(t, logs.All()[5].Message, "cannot parse enhanced EA telemetry ask price") + require.Contains(t, logs.All()[3].Message, "cannot parse EA telemetry price to float64, DOT id ds1_benchmark") + require.Contains(t, logs.All()[4].Message, "cannot parse EA telemetry price to float64, DOT id ds2_bid") + require.Contains(t, logs.All()[5].Message, "cannot parse EA telemetry price to float64, DOT id ds3_ask") - benchmarkPrice, bid, ask = e.getPricesFromResults(trrsMercuryV1[0], trrsMercuryV2, 2) + benchmarkPrice, bid, ask = getPricesFromBridgeTask(lggr, trrsMercuryV1[0], trrsMercuryV2, 2) require.Equal(t, 123456.123456, benchmarkPrice) require.Equal(t, float64(0), bid) require.Equal(t, float64(0), ask) @@ -541,11 +642,180 @@ func TestShouldCollectEnhancedTelemetryMercury(t *testing.T) { require.Equal(t, ShouldCollectEnhancedTelemetryMercury(j), false) } -func TestGetAssetSymbolFromRequestData(t *testing.T) { - e := EnhancedTelemetryService[EnhancedTelemetryMercuryData]{} - require.Equal(t, e.getAssetSymbolFromRequestData(""), "") +func TestParseBridgeRequestData(t *testing.T) { + require.Equal(t, parseBridgeRequestData("", 2), bridgeRequestData{}) + reqData := `{"data":{"to":"LINK","from":"USD"}}` - require.Equal(t, e.getAssetSymbolFromRequestData(reqData), "USD/LINK") + require.Equal(t, parseBridgeRequestData(reqData, 2), bridgeRequestData{AssetSymbol: "USD/LINK"}) + + reqData = `{"data":{"to":"LINK","from":"USD","market":"forex"}}` + require.Equal(t, parseBridgeRequestData(reqData, 2), bridgeRequestData{AssetSymbol: "USD/LINK"}) + + reqData = `{"data":{"endpoint":"market-status","market":"forex"}}` + require.Equal(t, parseBridgeRequestData(reqData, 4), bridgeRequestData{AssetSymbol: "forex", IsMarketStatus: true}) + + reqData = `{"data":{"market":"metals"}}` + require.Equal(t, parseBridgeRequestData(reqData, 4), bridgeRequestData{AssetSymbol: "metals", IsMarketStatus: true}) + + viewFunctionReqData := `{"data":{"address":"0x12345678", "signature": "function stEthPerToken() view returns (int256)"}}` + require.Equal(t, parseBridgeRequestData(viewFunctionReqData, 3), bridgeRequestData{AssetSymbol: "0x12345678"}) +} + +func getViewFunctionTaskRunResults() pipeline.TaskRunResults { + var taskViewFunctionParseValue = func() pipeline.MultiplyTask { + task := pipeline.MultiplyTask{ + BaseTask: pipeline.NewBaseTask(3, "ds1_parse", nil, nil, 3), + Times: "1", + } + task.BaseTask.Tags = `{"priceType": "exchangeRate"}` + return task + }() + + var taskViewFunctionDecode = pipeline.ETHABIDecodeTask{ + ABI: "uint256 data", + BaseTask: pipeline.NewBaseTask(2, "ds1_decode", nil, []pipeline.Task{&taskViewFunctionParseValue}, 2), + } + + var taskViewFunctionJSONParse = pipeline.JSONParseTask{ + BaseTask: pipeline.NewBaseTask(1, "ds1_parse", nil, []pipeline.Task{&taskViewFunctionDecode}, 1), + } + + const viewFunctionBridgeResponse = `{ + "data": { + "result": "0x000000000000000000000000000000000000000000000000105ba6a589b23a81" + }, + "statusCode": 200, + "result": "0x000000000000000000000000000000000000000000000000105ba6a589b23a81", + "timestamps": { + "providerDataRequestedUnixMs": 1726243598046, + "providerDataReceivedUnixMs": 1726243598341 + }, + "meta": { + "adapterName": "VIEW_FUNCTION" + } + }` + + var taskViewFunctionBridgeRequest = pipeline.BridgeTask{ + Name: "bridge-view-function", + BaseTask: pipeline.NewBaseTask(0, "ds1", nil, []pipeline.Task{&taskViewFunctionJSONParse}, 0), + RequestData: `{"data":{"address":"0x1234","signature":"function stEthPerToken() external view returns (uint256)"}}`, + } + + return pipeline.TaskRunResults{ + pipeline.TaskRunResult{ + Task: &taskViewFunctionBridgeRequest, + Result: pipeline.Result{ + Value: viewFunctionBridgeResponse, + }, + }, + pipeline.TaskRunResult{ + Task: &taskViewFunctionJSONParse, + Result: pipeline.Result{ + Value: `0x000000000000000000000000000000000000000000000000105ba6a589b23a81`, + }, + }, + pipeline.TaskRunResult{ + Task: &taskViewFunctionDecode, + Result: pipeline.Result{ + Value: map[string]interface{}{ + "data": big.NewInt(1178718957397490305), + }, + }, + }, + pipeline.TaskRunResult{ + Task: &taskViewFunctionParseValue, + Result: pipeline.Result{ + Value: decimal.NewFromInt(1178718957397490305), + }, + }, + } +} + +func TestCollectMercuryEnhancedTelemetryV1ViewFunction(t *testing.T) { + wg := sync.WaitGroup{} + ingressClient := mocks.NewTelemetryService(t) + ingressAgent := telemetry.NewIngressAgentWrapper(ingressClient) + monitoringEndpoint := ingressAgent.GenMonitoringEndpoint("test-network", "test-chainID", "0xa", synchronization.EnhancedEAMercury) + + var sentMessage []byte + ingressClient.On("Send", mock.Anything, mock.AnythingOfType("[]uint8"), mock.AnythingOfType("string"), mock.AnythingOfType("TelemetryType")).Return().Run(func(args mock.Arguments) { + sentMessage = args[1].([]byte) + wg.Done() + }) + + lggr, _ := logger.TestLoggerObserved(t, zap.WarnLevel) + chTelem := make(chan EnhancedTelemetryMercuryData, 100) + chDone := make(chan struct{}) + feedID := common.HexToHash("0x111") + e := EnhancedTelemetryService[EnhancedTelemetryMercuryData]{ + chDone: chDone, + chTelem: chTelem, + job: &job.Job{ + Type: job.Type(pipeline.OffchainReporting2JobType), + OCR2OracleSpec: &job.OCR2OracleSpec{ + CaptureEATelemetry: true, + FeedID: &feedID, + }, + }, + lggr: lggr, + monitoringEndpoint: monitoringEndpoint, + } + servicetest.Run(t, &e) + + wg.Add(1) + + taskRunResults := getViewFunctionTaskRunResults() + + chTelem <- EnhancedTelemetryMercuryData{ + TaskRunResults: taskRunResults, + V1Observation: &mercuryv1.Observation{ + BenchmarkPrice: mercury.ObsResult[*big.Int]{Val: big.NewInt(111111)}, + Bid: mercury.ObsResult[*big.Int]{Val: big.NewInt(222222)}, + Ask: mercury.ObsResult[*big.Int]{Val: big.NewInt(333333)}, + CurrentBlockNum: mercury.ObsResult[int64]{Val: 123456789}, + CurrentBlockHash: mercury.ObsResult[[]byte]{Val: common.HexToHash("0x123321").Bytes()}, + CurrentBlockTimestamp: mercury.ObsResult[uint64]{Val: 987654321}, + }, + RepTimestamp: types.ReportTimestamp{ + ConfigDigest: types.ConfigDigest{2}, + Epoch: 11, + Round: 22, + }, + } + + expectedTelemetry := telem.EnhancedEAMercury{ + DataSource: "VIEW_FUNCTION", + DpBenchmarkPrice: 1178718957397490400, + DpBid: 1178718957397490400, + DpAsk: 1178718957397490400, + CurrentBlockNumber: 123456789, + CurrentBlockHash: common.HexToHash("0x123321").String(), + CurrentBlockTimestamp: 987654321, + BridgeTaskRunStartedTimestamp: taskRunResults[0].CreatedAt.UnixMilli(), + BridgeTaskRunEndedTimestamp: taskRunResults[0].FinishedAt.Time.UnixMilli(), + ProviderRequestedTimestamp: 1726243598046, + ProviderReceivedTimestamp: 1726243598341, + ProviderDataStreamEstablished: 0, + ProviderIndicatedTime: 0, + Feed: common.HexToHash("0x111").String(), + ObservationBenchmarkPrice: 111111, + ObservationBid: 222222, + ObservationAsk: 333333, + ConfigDigest: "0200000000000000000000000000000000000000000000000000000000000000", + Round: 22, + Epoch: 11, + BridgeRequestData: `{"data":{"address":"0x1234","signature":"function stEthPerToken() external view returns (uint256)"}}`, + AssetSymbol: "0x1234", + ObservationBenchmarkPriceString: "111111", + ObservationBidString: "222222", + ObservationAskString: "333333", + } + + expectedMessage, _ := proto.Marshal(&expectedTelemetry) + wg.Wait() + require.Equal(t, expectedMessage, sentMessage) + + chDone <- struct{}{} } func TestCollectMercuryEnhancedTelemetryV1(t *testing.T) { @@ -619,6 +889,7 @@ func TestCollectMercuryEnhancedTelemetryV1(t *testing.T) { ConfigDigest: "0200000000000000000000000000000000000000000000000000000000000000", Round: 22, Epoch: 11, + BridgeRequestData: `{"data":{"to":"LINK","from":"USD"}}`, AssetSymbol: "USD/LINK", ObservationBenchmarkPriceString: "111111", ObservationBidString: "222222", @@ -660,7 +931,7 @@ func TestCollectMercuryEnhancedTelemetryV1(t *testing.T) { wg.Wait() require.Equal(t, 2, logs.Len()) - require.Contains(t, logs.All()[0].Message, `cannot get bridge response from bridge task, job=0, id=ds1, name="test-mercury-bridge-1"`) + require.Contains(t, logs.All()[0].Message, `cannot get bridge response from bridge task, id=ds1, name="test-mercury-bridge-1"`) require.Contains(t, logs.All()[1].Message, "cannot parse EA telemetry") chDone <- struct{}{} } @@ -732,6 +1003,7 @@ func TestCollectMercuryEnhancedTelemetryV2(t *testing.T) { ConfigDigest: "0200000000000000000000000000000000000000000000000000000000000000", Round: 22, Epoch: 11, + BridgeRequestData: `{"data":{"to":"LINK","from":"USD"}}`, AssetSymbol: "USD/LINK", ObservationBenchmarkPriceString: "111111", MaxFinalizedTimestamp: 321, @@ -781,3 +1053,81 @@ func TestCollectMercuryEnhancedTelemetryV2(t *testing.T) { require.Contains(t, logs.All()[3].Message, "cannot parse enhanced EA telemetry bid price") chDone <- struct{}{} } + +func TestCollectMercuryEnhancedTelemetryV4(t *testing.T) { + ingressClient := mocks.NewTelemetryService(t) + ingressAgent := telemetry.NewIngressAgentWrapper(ingressClient) + monitoringEndpoint := ingressAgent.GenMonitoringEndpoint("test-network", "test-chainID", "0xa", synchronization.EnhancedEAMercury) + + sentMessageCh := make(chan []byte) + ingressClient.On("Send", mock.Anything, mock.AnythingOfType("[]uint8"), mock.AnythingOfType("string"), mock.AnythingOfType("TelemetryType")).Return().Run(func(args mock.Arguments) { + sentMessageCh <- args[1].([]byte) + }) + + lggr, _ := logger.TestLoggerObserved(t, zap.WarnLevel) + chTelem := make(chan EnhancedTelemetryMercuryData, 100) + chDone := make(chan struct{}) + feedID := common.HexToHash("0x0004") + e := EnhancedTelemetryService[EnhancedTelemetryMercuryData]{ + chDone: chDone, + chTelem: chTelem, + job: &job.Job{ + Type: job.Type(pipeline.OffchainReporting2JobType), + OCR2OracleSpec: &job.OCR2OracleSpec{ + CaptureEATelemetry: true, + FeedID: &feedID, + }, + }, + lggr: lggr, + monitoringEndpoint: monitoringEndpoint, + } + servicetest.Run(t, &e) + + chTelem <- EnhancedTelemetryMercuryData{ + TaskRunResults: trrsMercuryV4, + FeedVersion: 4, + V4Observation: &mercuryv4.Observation{ + BenchmarkPrice: mercury.ObsResult[*big.Int]{Val: big.NewInt(111111)}, + MarketStatus: mercury.ObsResult[uint32]{Val: 2}, + MaxFinalizedTimestamp: mercury.ObsResult[int64]{Val: 321}, + LinkPrice: mercury.ObsResult[*big.Int]{Val: big.NewInt(4321)}, + NativePrice: mercury.ObsResult[*big.Int]{Val: big.NewInt(54321)}, + }, + RepTimestamp: types.ReportTimestamp{ + ConfigDigest: types.ConfigDigest{2}, + Epoch: 11, + Round: 22, + }, + } + + expectedPricingTelemetry := telem.EnhancedEAMercury{ + DataSource: "data-source-name", + DpBenchmarkPrice: 123456.123456, + BridgeTaskRunStartedTimestamp: trrsMercuryV4[0].CreatedAt.UnixMilli(), + BridgeTaskRunEndedTimestamp: trrsMercuryV4[0].FinishedAt.Time.UnixMilli(), + ProviderRequestedTimestamp: 92233720368547760, + ProviderReceivedTimestamp: -92233720368547760, + ProviderDataStreamEstablished: 1, + ProviderIndicatedTime: -123456789, + Feed: common.HexToHash("0x0004").String(), + ObservationBenchmarkPrice: 111111, + ObservationMarketStatus: 2, + ConfigDigest: "0200000000000000000000000000000000000000000000000000000000000000", + Round: 22, + Epoch: 11, + AssetSymbol: "USD/LINK", + ObservationBenchmarkPriceString: "111111", + MaxFinalizedTimestamp: 321, + LinkPrice: 4321, + NativePrice: 54321, + Version: 4, + BridgeRequestData: `{"data":{"to":"LINK","from":"USD"}}`, + } + expectedPricingMessage, _ := proto.Marshal(&expectedPricingTelemetry) + require.Equal(t, expectedPricingMessage, <-sentMessageCh) + + chDone <- struct{}{} + + // Verify that no other telemetry is sent. + require.Len(t, sentMessageCh, 0) +} diff --git a/core/services/p2p/types/mocks/peer.go b/core/services/p2p/types/mocks/peer.go index 31fb4c10d04..4fad5488e86 100644 --- a/core/services/p2p/types/mocks/peer.go +++ b/core/services/p2p/types/mocks/peer.go @@ -16,6 +16,14 @@ type Peer struct { mock.Mock } +type Peer_Expecter struct { + mock *mock.Mock +} + +func (_m *Peer) EXPECT() *Peer_Expecter { + return &Peer_Expecter{mock: &_m.Mock} +} + // Close provides a mock function with given fields: func (_m *Peer) Close() error { ret := _m.Called() @@ -34,6 +42,33 @@ func (_m *Peer) Close() error { return r0 } +// Peer_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close' +type Peer_Close_Call struct { + *mock.Call +} + +// Close is a helper method to define mock.On call +func (_e *Peer_Expecter) Close() *Peer_Close_Call { + return &Peer_Close_Call{Call: _e.mock.On("Close")} +} + +func (_c *Peer_Close_Call) Run(run func()) *Peer_Close_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Peer_Close_Call) Return(_a0 error) *Peer_Close_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Peer_Close_Call) RunAndReturn(run func() error) *Peer_Close_Call { + _c.Call.Return(run) + return _c +} + // HealthReport provides a mock function with given fields: func (_m *Peer) HealthReport() map[string]error { ret := _m.Called() @@ -54,6 +89,33 @@ func (_m *Peer) HealthReport() map[string]error { return r0 } +// Peer_HealthReport_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HealthReport' +type Peer_HealthReport_Call struct { + *mock.Call +} + +// HealthReport is a helper method to define mock.On call +func (_e *Peer_Expecter) HealthReport() *Peer_HealthReport_Call { + return &Peer_HealthReport_Call{Call: _e.mock.On("HealthReport")} +} + +func (_c *Peer_HealthReport_Call) Run(run func()) *Peer_HealthReport_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Peer_HealthReport_Call) Return(_a0 map[string]error) *Peer_HealthReport_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Peer_HealthReport_Call) RunAndReturn(run func() map[string]error) *Peer_HealthReport_Call { + _c.Call.Return(run) + return _c +} + // ID provides a mock function with given fields: func (_m *Peer) ID() ragep2ptypes.PeerID { ret := _m.Called() @@ -74,6 +136,33 @@ func (_m *Peer) ID() ragep2ptypes.PeerID { return r0 } +// Peer_ID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ID' +type Peer_ID_Call struct { + *mock.Call +} + +// ID is a helper method to define mock.On call +func (_e *Peer_Expecter) ID() *Peer_ID_Call { + return &Peer_ID_Call{Call: _e.mock.On("ID")} +} + +func (_c *Peer_ID_Call) Run(run func()) *Peer_ID_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Peer_ID_Call) Return(_a0 ragep2ptypes.PeerID) *Peer_ID_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Peer_ID_Call) RunAndReturn(run func() ragep2ptypes.PeerID) *Peer_ID_Call { + _c.Call.Return(run) + return _c +} + // Name provides a mock function with given fields: func (_m *Peer) Name() string { ret := _m.Called() @@ -92,6 +181,33 @@ func (_m *Peer) Name() string { return r0 } +// Peer_Name_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Name' +type Peer_Name_Call struct { + *mock.Call +} + +// Name is a helper method to define mock.On call +func (_e *Peer_Expecter) Name() *Peer_Name_Call { + return &Peer_Name_Call{Call: _e.mock.On("Name")} +} + +func (_c *Peer_Name_Call) Run(run func()) *Peer_Name_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Peer_Name_Call) Return(_a0 string) *Peer_Name_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Peer_Name_Call) RunAndReturn(run func() string) *Peer_Name_Call { + _c.Call.Return(run) + return _c +} + // Ready provides a mock function with given fields: func (_m *Peer) Ready() error { ret := _m.Called() @@ -110,6 +226,33 @@ func (_m *Peer) Ready() error { return r0 } +// Peer_Ready_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Ready' +type Peer_Ready_Call struct { + *mock.Call +} + +// Ready is a helper method to define mock.On call +func (_e *Peer_Expecter) Ready() *Peer_Ready_Call { + return &Peer_Ready_Call{Call: _e.mock.On("Ready")} +} + +func (_c *Peer_Ready_Call) Run(run func()) *Peer_Ready_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Peer_Ready_Call) Return(_a0 error) *Peer_Ready_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Peer_Ready_Call) RunAndReturn(run func() error) *Peer_Ready_Call { + _c.Call.Return(run) + return _c +} + // Receive provides a mock function with given fields: func (_m *Peer) Receive() <-chan types.Message { ret := _m.Called() @@ -130,6 +273,33 @@ func (_m *Peer) Receive() <-chan types.Message { return r0 } +// Peer_Receive_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Receive' +type Peer_Receive_Call struct { + *mock.Call +} + +// Receive is a helper method to define mock.On call +func (_e *Peer_Expecter) Receive() *Peer_Receive_Call { + return &Peer_Receive_Call{Call: _e.mock.On("Receive")} +} + +func (_c *Peer_Receive_Call) Run(run func()) *Peer_Receive_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Peer_Receive_Call) Return(_a0 <-chan types.Message) *Peer_Receive_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Peer_Receive_Call) RunAndReturn(run func() <-chan types.Message) *Peer_Receive_Call { + _c.Call.Return(run) + return _c +} + // Send provides a mock function with given fields: peerID, msg func (_m *Peer) Send(peerID ragep2ptypes.PeerID, msg []byte) error { ret := _m.Called(peerID, msg) @@ -148,6 +318,35 @@ func (_m *Peer) Send(peerID ragep2ptypes.PeerID, msg []byte) error { return r0 } +// Peer_Send_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Send' +type Peer_Send_Call struct { + *mock.Call +} + +// Send is a helper method to define mock.On call +// - peerID ragep2ptypes.PeerID +// - msg []byte +func (_e *Peer_Expecter) Send(peerID interface{}, msg interface{}) *Peer_Send_Call { + return &Peer_Send_Call{Call: _e.mock.On("Send", peerID, msg)} +} + +func (_c *Peer_Send_Call) Run(run func(peerID ragep2ptypes.PeerID, msg []byte)) *Peer_Send_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(ragep2ptypes.PeerID), args[1].([]byte)) + }) + return _c +} + +func (_c *Peer_Send_Call) Return(_a0 error) *Peer_Send_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Peer_Send_Call) RunAndReturn(run func(ragep2ptypes.PeerID, []byte) error) *Peer_Send_Call { + _c.Call.Return(run) + return _c +} + // Start provides a mock function with given fields: _a0 func (_m *Peer) Start(_a0 context.Context) error { ret := _m.Called(_a0) @@ -166,6 +365,34 @@ func (_m *Peer) Start(_a0 context.Context) error { return r0 } +// Peer_Start_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Start' +type Peer_Start_Call struct { + *mock.Call +} + +// Start is a helper method to define mock.On call +// - _a0 context.Context +func (_e *Peer_Expecter) Start(_a0 interface{}) *Peer_Start_Call { + return &Peer_Start_Call{Call: _e.mock.On("Start", _a0)} +} + +func (_c *Peer_Start_Call) Run(run func(_a0 context.Context)) *Peer_Start_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *Peer_Start_Call) Return(_a0 error) *Peer_Start_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Peer_Start_Call) RunAndReturn(run func(context.Context) error) *Peer_Start_Call { + _c.Call.Return(run) + return _c +} + // UpdateConnections provides a mock function with given fields: peers func (_m *Peer) UpdateConnections(peers map[ragep2ptypes.PeerID]types.StreamConfig) error { ret := _m.Called(peers) @@ -184,6 +411,34 @@ func (_m *Peer) UpdateConnections(peers map[ragep2ptypes.PeerID]types.StreamConf return r0 } +// Peer_UpdateConnections_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateConnections' +type Peer_UpdateConnections_Call struct { + *mock.Call +} + +// UpdateConnections is a helper method to define mock.On call +// - peers map[ragep2ptypes.PeerID]types.StreamConfig +func (_e *Peer_Expecter) UpdateConnections(peers interface{}) *Peer_UpdateConnections_Call { + return &Peer_UpdateConnections_Call{Call: _e.mock.On("UpdateConnections", peers)} +} + +func (_c *Peer_UpdateConnections_Call) Run(run func(peers map[ragep2ptypes.PeerID]types.StreamConfig)) *Peer_UpdateConnections_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(map[ragep2ptypes.PeerID]types.StreamConfig)) + }) + return _c +} + +func (_c *Peer_UpdateConnections_Call) Return(_a0 error) *Peer_UpdateConnections_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Peer_UpdateConnections_Call) RunAndReturn(run func(map[ragep2ptypes.PeerID]types.StreamConfig) error) *Peer_UpdateConnections_Call { + _c.Call.Return(run) + return _c +} + // NewPeer creates a new instance of Peer. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewPeer(t interface { diff --git a/core/services/p2p/types/mocks/peer_wrapper.go b/core/services/p2p/types/mocks/peer_wrapper.go index 170ab317f4c..c7b76b58f4e 100644 --- a/core/services/p2p/types/mocks/peer_wrapper.go +++ b/core/services/p2p/types/mocks/peer_wrapper.go @@ -14,6 +14,14 @@ type PeerWrapper struct { mock.Mock } +type PeerWrapper_Expecter struct { + mock *mock.Mock +} + +func (_m *PeerWrapper) EXPECT() *PeerWrapper_Expecter { + return &PeerWrapper_Expecter{mock: &_m.Mock} +} + // Close provides a mock function with given fields: func (_m *PeerWrapper) Close() error { ret := _m.Called() @@ -32,6 +40,33 @@ func (_m *PeerWrapper) Close() error { return r0 } +// PeerWrapper_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close' +type PeerWrapper_Close_Call struct { + *mock.Call +} + +// Close is a helper method to define mock.On call +func (_e *PeerWrapper_Expecter) Close() *PeerWrapper_Close_Call { + return &PeerWrapper_Close_Call{Call: _e.mock.On("Close")} +} + +func (_c *PeerWrapper_Close_Call) Run(run func()) *PeerWrapper_Close_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *PeerWrapper_Close_Call) Return(_a0 error) *PeerWrapper_Close_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *PeerWrapper_Close_Call) RunAndReturn(run func() error) *PeerWrapper_Close_Call { + _c.Call.Return(run) + return _c +} + // GetPeer provides a mock function with given fields: func (_m *PeerWrapper) GetPeer() types.Peer { ret := _m.Called() @@ -52,6 +87,33 @@ func (_m *PeerWrapper) GetPeer() types.Peer { return r0 } +// PeerWrapper_GetPeer_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPeer' +type PeerWrapper_GetPeer_Call struct { + *mock.Call +} + +// GetPeer is a helper method to define mock.On call +func (_e *PeerWrapper_Expecter) GetPeer() *PeerWrapper_GetPeer_Call { + return &PeerWrapper_GetPeer_Call{Call: _e.mock.On("GetPeer")} +} + +func (_c *PeerWrapper_GetPeer_Call) Run(run func()) *PeerWrapper_GetPeer_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *PeerWrapper_GetPeer_Call) Return(_a0 types.Peer) *PeerWrapper_GetPeer_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *PeerWrapper_GetPeer_Call) RunAndReturn(run func() types.Peer) *PeerWrapper_GetPeer_Call { + _c.Call.Return(run) + return _c +} + // HealthReport provides a mock function with given fields: func (_m *PeerWrapper) HealthReport() map[string]error { ret := _m.Called() @@ -72,6 +134,33 @@ func (_m *PeerWrapper) HealthReport() map[string]error { return r0 } +// PeerWrapper_HealthReport_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HealthReport' +type PeerWrapper_HealthReport_Call struct { + *mock.Call +} + +// HealthReport is a helper method to define mock.On call +func (_e *PeerWrapper_Expecter) HealthReport() *PeerWrapper_HealthReport_Call { + return &PeerWrapper_HealthReport_Call{Call: _e.mock.On("HealthReport")} +} + +func (_c *PeerWrapper_HealthReport_Call) Run(run func()) *PeerWrapper_HealthReport_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *PeerWrapper_HealthReport_Call) Return(_a0 map[string]error) *PeerWrapper_HealthReport_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *PeerWrapper_HealthReport_Call) RunAndReturn(run func() map[string]error) *PeerWrapper_HealthReport_Call { + _c.Call.Return(run) + return _c +} + // Name provides a mock function with given fields: func (_m *PeerWrapper) Name() string { ret := _m.Called() @@ -90,6 +179,33 @@ func (_m *PeerWrapper) Name() string { return r0 } +// PeerWrapper_Name_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Name' +type PeerWrapper_Name_Call struct { + *mock.Call +} + +// Name is a helper method to define mock.On call +func (_e *PeerWrapper_Expecter) Name() *PeerWrapper_Name_Call { + return &PeerWrapper_Name_Call{Call: _e.mock.On("Name")} +} + +func (_c *PeerWrapper_Name_Call) Run(run func()) *PeerWrapper_Name_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *PeerWrapper_Name_Call) Return(_a0 string) *PeerWrapper_Name_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *PeerWrapper_Name_Call) RunAndReturn(run func() string) *PeerWrapper_Name_Call { + _c.Call.Return(run) + return _c +} + // Ready provides a mock function with given fields: func (_m *PeerWrapper) Ready() error { ret := _m.Called() @@ -108,6 +224,33 @@ func (_m *PeerWrapper) Ready() error { return r0 } +// PeerWrapper_Ready_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Ready' +type PeerWrapper_Ready_Call struct { + *mock.Call +} + +// Ready is a helper method to define mock.On call +func (_e *PeerWrapper_Expecter) Ready() *PeerWrapper_Ready_Call { + return &PeerWrapper_Ready_Call{Call: _e.mock.On("Ready")} +} + +func (_c *PeerWrapper_Ready_Call) Run(run func()) *PeerWrapper_Ready_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *PeerWrapper_Ready_Call) Return(_a0 error) *PeerWrapper_Ready_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *PeerWrapper_Ready_Call) RunAndReturn(run func() error) *PeerWrapper_Ready_Call { + _c.Call.Return(run) + return _c +} + // Start provides a mock function with given fields: _a0 func (_m *PeerWrapper) Start(_a0 context.Context) error { ret := _m.Called(_a0) @@ -126,6 +269,34 @@ func (_m *PeerWrapper) Start(_a0 context.Context) error { return r0 } +// PeerWrapper_Start_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Start' +type PeerWrapper_Start_Call struct { + *mock.Call +} + +// Start is a helper method to define mock.On call +// - _a0 context.Context +func (_e *PeerWrapper_Expecter) Start(_a0 interface{}) *PeerWrapper_Start_Call { + return &PeerWrapper_Start_Call{Call: _e.mock.On("Start", _a0)} +} + +func (_c *PeerWrapper_Start_Call) Run(run func(_a0 context.Context)) *PeerWrapper_Start_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *PeerWrapper_Start_Call) Return(_a0 error) *PeerWrapper_Start_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *PeerWrapper_Start_Call) RunAndReturn(run func(context.Context) error) *PeerWrapper_Start_Call { + _c.Call.Return(run) + return _c +} + // NewPeerWrapper creates a new instance of PeerWrapper. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewPeerWrapper(t interface { diff --git a/core/services/p2p/types/mocks/signer.go b/core/services/p2p/types/mocks/signer.go index 2e3f74a239a..e9dd3665b5e 100644 --- a/core/services/p2p/types/mocks/signer.go +++ b/core/services/p2p/types/mocks/signer.go @@ -9,6 +9,14 @@ type Signer struct { mock.Mock } +type Signer_Expecter struct { + mock *mock.Mock +} + +func (_m *Signer) EXPECT() *Signer_Expecter { + return &Signer_Expecter{mock: &_m.Mock} +} + // Sign provides a mock function with given fields: data func (_m *Signer) Sign(data []byte) ([]byte, error) { ret := _m.Called(data) @@ -39,6 +47,34 @@ func (_m *Signer) Sign(data []byte) ([]byte, error) { return r0, r1 } +// Signer_Sign_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Sign' +type Signer_Sign_Call struct { + *mock.Call +} + +// Sign is a helper method to define mock.On call +// - data []byte +func (_e *Signer_Expecter) Sign(data interface{}) *Signer_Sign_Call { + return &Signer_Sign_Call{Call: _e.mock.On("Sign", data)} +} + +func (_c *Signer_Sign_Call) Run(run func(data []byte)) *Signer_Sign_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].([]byte)) + }) + return _c +} + +func (_c *Signer_Sign_Call) Return(_a0 []byte, _a1 error) *Signer_Sign_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Signer_Sign_Call) RunAndReturn(run func([]byte) ([]byte, error)) *Signer_Sign_Call { + _c.Call.Return(run) + return _c +} + // NewSigner creates a new instance of Signer. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewSigner(t interface { diff --git a/core/services/p2p/types/types.go b/core/services/p2p/types/types.go index 837e075860a..a6db2a8fe1d 100644 --- a/core/services/p2p/types/types.go +++ b/core/services/p2p/types/types.go @@ -11,7 +11,6 @@ const PeerIDLength = 32 type PeerID = ragetypes.PeerID -//go:generate mockery --quiet --name Peer --output ./mocks/ --case=underscore type Peer interface { services.Service ID() PeerID @@ -20,13 +19,11 @@ type Peer interface { Receive() <-chan Message } -//go:generate mockery --quiet --name PeerWrapper --output ./mocks/ --case=underscore type PeerWrapper interface { services.Service GetPeer() Peer } -//go:generate mockery --quiet --name Signer --output ./mocks/ --case=underscore type Signer interface { Sign(data []byte) ([]byte, error) } diff --git a/core/services/pg/connection.go b/core/services/pg/connection.go index b76c9bc10ed..c1e6248b13f 100644 --- a/core/services/pg/connection.go +++ b/core/services/pg/connection.go @@ -2,6 +2,7 @@ package pg import ( "database/sql" + "errors" "fmt" "log" "os" @@ -9,6 +10,7 @@ import ( "github.com/XSAM/otelsql" "github.com/google/uuid" + "github.com/jackc/pgconn" "github.com/jackc/pgx/v4" "github.com/jackc/pgx/v4/stdlib" "github.com/jmoiron/sqlx" @@ -130,6 +132,14 @@ func setMaxConns(db *sqlx.DB, config ConnectionConfig) { // See: https://smartcontract-it.atlassian.net/browse/MERC-3654 var cnt int if err := db.Get(&cnt, `SELECT COUNT(*) FROM ocr2_oracle_specs WHERE plugin_type = 'mercury'`); err != nil { + const errUndefinedTable = "42P01" + var pqerr *pgconn.PgError + if errors.As(err, &pqerr) { + if pqerr.Code == errUndefinedTable { + // no mercury jobs defined + return + } + } log.Printf("Error checking mercury jobs: %s", err.Error()) return } diff --git a/core/services/pg/lease_lock_test.go b/core/services/pg/lease_lock_test.go index 1b4116b5bf9..65bbe3b8610 100644 --- a/core/services/pg/lease_lock_test.go +++ b/core/services/pg/lease_lock_test.go @@ -12,11 +12,11 @@ import ( "github.com/jmoiron/sqlx" "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" - "github.com/smartcontractkit/chainlink/v2/core/internal/cltest/heavyweight" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" "github.com/smartcontractkit/chainlink/v2/core/services/pg" + "github.com/smartcontractkit/chainlink/v2/core/utils/testutils/heavyweight" ) func newLeaseLock(t *testing.T, db *sqlx.DB, cfg pg.LeaseLockConfig) pg.LeaseLock { diff --git a/core/services/pipeline/common.go b/core/services/pipeline/common.go index 1e2c52dad66..50611ee32a4 100644 --- a/core/services/pipeline/common.go +++ b/core/services/pipeline/common.go @@ -3,6 +3,7 @@ package pipeline import ( "context" "errors" + "fmt" "net/url" "reflect" "sort" @@ -10,14 +11,15 @@ import ( "strings" "time" + "github.com/go-viper/mapstructure/v2" "github.com/google/uuid" - "github.com/mitchellh/mapstructure" pkgerrors "github.com/pkg/errors" "gopkg.in/guregu/null.v4" commonconfig "github.com/smartcontractkit/chainlink-common/pkg/config" cutils "github.com/smartcontractkit/chainlink-common/pkg/utils" "github.com/smartcontractkit/chainlink-common/pkg/utils/jsonserializable" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/config" "github.com/smartcontractkit/chainlink/v2/core/logger" cnull "github.com/smartcontractkit/chainlink/v2/core/null" @@ -28,6 +30,7 @@ const ( BlockhashStoreJobType string = "blockhashstore" BootstrapJobType string = "bootstrap" CronJobType string = "cron" + CCIPJobType string = "ccip" DirectRequestJobType string = "directrequest" FluxMonitorJobType string = "fluxmonitor" GatewayJobType string = "gateway" @@ -43,8 +46,6 @@ const ( StandardCapabilitiesJobType string = "standardcapabilities" ) -//go:generate mockery --quiet --name Config --output ./mocks/ --case=underscore - type ( Task interface { Type() TaskType @@ -59,6 +60,8 @@ type ( TaskRetries() uint32 TaskMinBackoff() time.Duration TaskMaxBackoff() time.Duration + TaskTags() string + GetDescendantTasks() []Task } Config interface { @@ -231,7 +234,7 @@ func (trrs TaskRunResults) GetTaskRunResultsFinishedAt() time.Time { // FinalResult pulls the FinalResult for the pipeline_run from the task runs // It needs to respect the output index of each task -func (trrs TaskRunResults) FinalResult(l logger.Logger) FinalResult { +func (trrs TaskRunResults) FinalResult() FinalResult { var found bool var fr FinalResult sort.Slice(trrs, func(i, j int) bool { @@ -247,7 +250,7 @@ func (trrs TaskRunResults) FinalResult(l logger.Logger) FinalResult { } if !found { - l.Panicw("Expected at least one task to be final", "tasks", trrs) + panic(fmt.Sprintf("expected at least one task to be final: %v", trrs)) } return fr } @@ -262,6 +265,16 @@ func (trrs TaskRunResults) Terminals() (terminals []TaskRunResult) { return } +// GetNextTaskOf returns the task with the next id or nil if it does not exist +func (trrs *TaskRunResults) GetTaskRunResultOf(task Task) *TaskRunResult { + for _, trr := range *trrs { + if trr.Task.Base().id == task.Base().id { + return &trr + } + } + return nil +} + // GetNextTaskOf returns the task with the next id or nil if it does not exist func (trrs *TaskRunResults) GetNextTaskOf(task TaskRunResult) *TaskRunResult { nextID := task.Task.Base().id + 1 diff --git a/core/services/pipeline/common_http.go b/core/services/pipeline/common_http.go index 492cc8f8f76..06a6c1a372c 100644 --- a/core/services/pipeline/common_http.go +++ b/core/services/pipeline/common_http.go @@ -64,7 +64,7 @@ func makeHTTPRequest( if statusCode >= 400 { maybeErr := bestEffortExtractError(responseBytes) - return nil, statusCode, respHeaders, 0, errors.Errorf("got error from %s: (status code %v) %s", url.String(), statusCode, maybeErr) + return responseBytes, statusCode, respHeaders, 0, errors.Errorf("got error from %s: (status code %v) %s", url.String(), statusCode, maybeErr) } return responseBytes, statusCode, respHeaders, elapsed, nil } diff --git a/core/services/pipeline/common_test.go b/core/services/pipeline/common_test.go index ce545ec14a0..ed7998b79e3 100644 --- a/core/services/pipeline/common_test.go +++ b/core/services/pipeline/common_test.go @@ -17,6 +17,14 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/pipeline" ) +func TestAtrributesAttribute(t *testing.T) { + a := `ds1 [type=http method=GET tags=<{"attribute1":"value1", "attribute2":42}>];` + p, err := pipeline.Parse(a) + require.NoError(t, err) + task := p.Tasks[0] + assert.Equal(t, "{\"attribute1\":\"value1\", \"attribute2\":42}", task.TaskTags()) +} + func TestTimeoutAttribute(t *testing.T) { t.Parallel() @@ -320,3 +328,69 @@ func TestGetNextTaskOf(t *testing.T) { nextTask = trrs.GetNextTaskOf(*nextTask) assert.Empty(t, nextTask) } + +func TestGetDescendantTasks(t *testing.T) { + t.Parallel() + + t.Run("GetDescendantTasks with multiple levels of tasks", func(t *testing.T) { + l3T2 := pipeline.AnyTask{ + BaseTask: pipeline.NewBaseTask(6, "l3T2", nil, nil, 1), + } + l3T1 := pipeline.MedianTask{ + BaseTask: pipeline.NewBaseTask(5, "l3T1", nil, nil, 1), + } + l2T1 := pipeline.MultiplyTask{ + BaseTask: pipeline.NewBaseTask(4, "l2T1", nil, []pipeline.Task{&l3T1, &l3T2}, 1), + } + l1T1 := pipeline.JSONParseTask{ + BaseTask: pipeline.NewBaseTask(3, "l1T1", nil, []pipeline.Task{&l2T1}, 2), + } + l1T2 := pipeline.JSONParseTask{ + BaseTask: pipeline.NewBaseTask(2, "l1T2", nil, nil, 3), + } + l1T3 := pipeline.JSONParseTask{ + BaseTask: pipeline.NewBaseTask(1, "l1T3", nil, nil, 4), + } + + baseTask := pipeline.BridgeTask{ + Name: "bridge-task", + BaseTask: pipeline.NewBaseTask(0, "baseTask", nil, []pipeline.Task{&l1T1, &l1T2, &l1T3}, 0), + } + + descendents := baseTask.GetDescendantTasks() + assert.Len(t, descendents, 6) + }) + + t.Run("GetDescendantTasks with duplicate tasks defined", func(t *testing.T) { + l2T1 := pipeline.JSONParseTask{ + BaseTask: pipeline.NewBaseTask(2, "l1T2", nil, nil, 3), + } + l1T1 := pipeline.JSONParseTask{ + BaseTask: pipeline.NewBaseTask(1, "l1T2", nil, []pipeline.Task{&l2T1, &l2T1, &l2T1}, 3), + } + taskWithRepeats := pipeline.BridgeTask{ + Name: "bridge-task", + BaseTask: pipeline.NewBaseTask(0, "taskWithRepeats", nil, []pipeline.Task{&l1T1, &l1T1, &l1T1}, 0), + } + descendents := taskWithRepeats.GetDescendantTasks() + assert.Len(t, descendents, 2) + }) + + t.Run("GetDescendantTasks with nil output tasks", func(t *testing.T) { + taskWithRepeats := pipeline.BridgeTask{ + Name: "bridge-task", + BaseTask: pipeline.NewBaseTask(0, "taskWithRepeats", nil, nil, 0), + } + descendents := taskWithRepeats.GetDescendantTasks() + assert.Len(t, descendents, 0) + }) + + t.Run("GetDescendantTasks with empty list of output tasks", func(t *testing.T) { + taskWithRepeats := pipeline.BridgeTask{ + Name: "bridge-task", + BaseTask: pipeline.NewBaseTask(0, "taskWithRepeats", nil, []pipeline.Task{}, 0), + } + descendents := taskWithRepeats.GetDescendantTasks() + assert.Len(t, descendents, 0) + }) +} diff --git a/core/services/pipeline/eautils/eautils.go b/core/services/pipeline/eautils/eautils.go new file mode 100644 index 00000000000..ddb8de79774 --- /dev/null +++ b/core/services/pipeline/eautils/eautils.go @@ -0,0 +1,65 @@ +package eautils + +import ( + "encoding/json" + "fmt" + "net/http" +) + +type AdapterStatus struct { + ErrorMessage *string `json:"errorMessage"` + Error any `json:"error"` + StatusCode *int `json:"statusCode"` + ProviderStatusCode *int `json:"providerStatusCode"` +} + +func BestEffortExtractEAStatus(responseBytes []byte) (code int, ok bool) { + var status AdapterStatus + err := json.Unmarshal(responseBytes, &status) + if err != nil { + return 0, false + } + + if status.StatusCode == nil { + return 0, false + } + + if *status.StatusCode != http.StatusOK { + return *status.StatusCode, true + } + + if status.ProviderStatusCode != nil && *status.ProviderStatusCode != http.StatusOK { + return *status.ProviderStatusCode, true + } + + if status.Error != nil { + return http.StatusInternalServerError, true + } + + return *status.StatusCode, true +} + +type adapterErrorResponse struct { + Error *AdapterError `json:"error"` +} + +type AdapterError struct { + Name string `json:"name"` + Message string `json:"message"` +} + +func (err *AdapterError) Error() string { + return fmt.Sprintf("%s: %s", err.Name, err.Message) +} + +func BestEffortExtractEAError(responseBytes []byte) error { + var errorResponse adapterErrorResponse + err := json.Unmarshal(responseBytes, &errorResponse) + if err != nil { + return nil + } + if errorResponse.Error != nil { + return errorResponse.Error + } + return nil +} diff --git a/core/services/pipeline/internal/eautils/eautils_test.go b/core/services/pipeline/eautils/eautils_test.go similarity index 100% rename from core/services/pipeline/internal/eautils/eautils_test.go rename to core/services/pipeline/eautils/eautils_test.go diff --git a/core/services/pipeline/internal/eautils/eautils.go b/core/services/pipeline/internal/eautils/eautils.go deleted file mode 100644 index 30faa826b22..00000000000 --- a/core/services/pipeline/internal/eautils/eautils.go +++ /dev/null @@ -1,39 +0,0 @@ -package eautils - -import ( - "encoding/json" - "net/http" -) - -type AdapterStatus struct { - ErrorMessage *string `json:"errorMessage"` - Error any `json:"error"` - StatusCode *int `json:"statusCode"` - ProviderStatusCode *int `json:"providerStatusCode"` -} - -func BestEffortExtractEAStatus(responseBytes []byte) (code int, ok bool) { - var status AdapterStatus - err := json.Unmarshal(responseBytes, &status) - if err != nil { - return 0, false - } - - if status.StatusCode == nil { - return 0, false - } - - if *status.StatusCode != http.StatusOK { - return *status.StatusCode, true - } - - if status.ProviderStatusCode != nil && *status.ProviderStatusCode != http.StatusOK { - return *status.ProviderStatusCode, true - } - - if status.Error != nil { - return http.StatusInternalServerError, true - } - - return *status.StatusCode, true -} diff --git a/core/services/pipeline/mocks/config.go b/core/services/pipeline/mocks/config.go index 91653b8d142..f92c7609c70 100644 --- a/core/services/pipeline/mocks/config.go +++ b/core/services/pipeline/mocks/config.go @@ -14,6 +14,14 @@ type Config struct { mock.Mock } +type Config_Expecter struct { + mock *mock.Mock +} + +func (_m *Config) EXPECT() *Config_Expecter { + return &Config_Expecter{mock: &_m.Mock} +} + // DefaultHTTPLimit provides a mock function with given fields: func (_m *Config) DefaultHTTPLimit() int64 { ret := _m.Called() @@ -32,6 +40,33 @@ func (_m *Config) DefaultHTTPLimit() int64 { return r0 } +// Config_DefaultHTTPLimit_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DefaultHTTPLimit' +type Config_DefaultHTTPLimit_Call struct { + *mock.Call +} + +// DefaultHTTPLimit is a helper method to define mock.On call +func (_e *Config_Expecter) DefaultHTTPLimit() *Config_DefaultHTTPLimit_Call { + return &Config_DefaultHTTPLimit_Call{Call: _e.mock.On("DefaultHTTPLimit")} +} + +func (_c *Config_DefaultHTTPLimit_Call) Run(run func()) *Config_DefaultHTTPLimit_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Config_DefaultHTTPLimit_Call) Return(_a0 int64) *Config_DefaultHTTPLimit_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Config_DefaultHTTPLimit_Call) RunAndReturn(run func() int64) *Config_DefaultHTTPLimit_Call { + _c.Call.Return(run) + return _c +} + // DefaultHTTPTimeout provides a mock function with given fields: func (_m *Config) DefaultHTTPTimeout() config.Duration { ret := _m.Called() @@ -50,6 +85,33 @@ func (_m *Config) DefaultHTTPTimeout() config.Duration { return r0 } +// Config_DefaultHTTPTimeout_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DefaultHTTPTimeout' +type Config_DefaultHTTPTimeout_Call struct { + *mock.Call +} + +// DefaultHTTPTimeout is a helper method to define mock.On call +func (_e *Config_Expecter) DefaultHTTPTimeout() *Config_DefaultHTTPTimeout_Call { + return &Config_DefaultHTTPTimeout_Call{Call: _e.mock.On("DefaultHTTPTimeout")} +} + +func (_c *Config_DefaultHTTPTimeout_Call) Run(run func()) *Config_DefaultHTTPTimeout_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Config_DefaultHTTPTimeout_Call) Return(_a0 config.Duration) *Config_DefaultHTTPTimeout_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Config_DefaultHTTPTimeout_Call) RunAndReturn(run func() config.Duration) *Config_DefaultHTTPTimeout_Call { + _c.Call.Return(run) + return _c +} + // MaxRunDuration provides a mock function with given fields: func (_m *Config) MaxRunDuration() time.Duration { ret := _m.Called() @@ -68,6 +130,33 @@ func (_m *Config) MaxRunDuration() time.Duration { return r0 } +// Config_MaxRunDuration_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MaxRunDuration' +type Config_MaxRunDuration_Call struct { + *mock.Call +} + +// MaxRunDuration is a helper method to define mock.On call +func (_e *Config_Expecter) MaxRunDuration() *Config_MaxRunDuration_Call { + return &Config_MaxRunDuration_Call{Call: _e.mock.On("MaxRunDuration")} +} + +func (_c *Config_MaxRunDuration_Call) Run(run func()) *Config_MaxRunDuration_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Config_MaxRunDuration_Call) Return(_a0 time.Duration) *Config_MaxRunDuration_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Config_MaxRunDuration_Call) RunAndReturn(run func() time.Duration) *Config_MaxRunDuration_Call { + _c.Call.Return(run) + return _c +} + // ReaperInterval provides a mock function with given fields: func (_m *Config) ReaperInterval() time.Duration { ret := _m.Called() @@ -86,6 +175,33 @@ func (_m *Config) ReaperInterval() time.Duration { return r0 } +// Config_ReaperInterval_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ReaperInterval' +type Config_ReaperInterval_Call struct { + *mock.Call +} + +// ReaperInterval is a helper method to define mock.On call +func (_e *Config_Expecter) ReaperInterval() *Config_ReaperInterval_Call { + return &Config_ReaperInterval_Call{Call: _e.mock.On("ReaperInterval")} +} + +func (_c *Config_ReaperInterval_Call) Run(run func()) *Config_ReaperInterval_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Config_ReaperInterval_Call) Return(_a0 time.Duration) *Config_ReaperInterval_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Config_ReaperInterval_Call) RunAndReturn(run func() time.Duration) *Config_ReaperInterval_Call { + _c.Call.Return(run) + return _c +} + // ReaperThreshold provides a mock function with given fields: func (_m *Config) ReaperThreshold() time.Duration { ret := _m.Called() @@ -104,6 +220,33 @@ func (_m *Config) ReaperThreshold() time.Duration { return r0 } +// Config_ReaperThreshold_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ReaperThreshold' +type Config_ReaperThreshold_Call struct { + *mock.Call +} + +// ReaperThreshold is a helper method to define mock.On call +func (_e *Config_Expecter) ReaperThreshold() *Config_ReaperThreshold_Call { + return &Config_ReaperThreshold_Call{Call: _e.mock.On("ReaperThreshold")} +} + +func (_c *Config_ReaperThreshold_Call) Run(run func()) *Config_ReaperThreshold_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Config_ReaperThreshold_Call) Return(_a0 time.Duration) *Config_ReaperThreshold_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Config_ReaperThreshold_Call) RunAndReturn(run func() time.Duration) *Config_ReaperThreshold_Call { + _c.Call.Return(run) + return _c +} + // VerboseLogging provides a mock function with given fields: func (_m *Config) VerboseLogging() bool { ret := _m.Called() @@ -122,6 +265,33 @@ func (_m *Config) VerboseLogging() bool { return r0 } +// Config_VerboseLogging_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'VerboseLogging' +type Config_VerboseLogging_Call struct { + *mock.Call +} + +// VerboseLogging is a helper method to define mock.On call +func (_e *Config_Expecter) VerboseLogging() *Config_VerboseLogging_Call { + return &Config_VerboseLogging_Call{Call: _e.mock.On("VerboseLogging")} +} + +func (_c *Config_VerboseLogging_Call) Run(run func()) *Config_VerboseLogging_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Config_VerboseLogging_Call) Return(_a0 bool) *Config_VerboseLogging_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Config_VerboseLogging_Call) RunAndReturn(run func() bool) *Config_VerboseLogging_Call { + _c.Call.Return(run) + return _c +} + // NewConfig creates a new instance of Config. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewConfig(t interface { diff --git a/core/services/pipeline/mocks/orm.go b/core/services/pipeline/mocks/orm.go index 387df0d41cf..3563fcab08e 100644 --- a/core/services/pipeline/mocks/orm.go +++ b/core/services/pipeline/mocks/orm.go @@ -22,6 +22,14 @@ type ORM struct { mock.Mock } +type ORM_Expecter struct { + mock *mock.Mock +} + +func (_m *ORM) EXPECT() *ORM_Expecter { + return &ORM_Expecter{mock: &_m.Mock} +} + // Close provides a mock function with given fields: func (_m *ORM) Close() error { ret := _m.Called() @@ -40,6 +48,33 @@ func (_m *ORM) Close() error { return r0 } +// ORM_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close' +type ORM_Close_Call struct { + *mock.Call +} + +// Close is a helper method to define mock.On call +func (_e *ORM_Expecter) Close() *ORM_Close_Call { + return &ORM_Close_Call{Call: _e.mock.On("Close")} +} + +func (_c *ORM_Close_Call) Run(run func()) *ORM_Close_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ORM_Close_Call) Return(_a0 error) *ORM_Close_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ORM_Close_Call) RunAndReturn(run func() error) *ORM_Close_Call { + _c.Call.Return(run) + return _c +} + // CreateRun provides a mock function with given fields: ctx, run func (_m *ORM) CreateRun(ctx context.Context, run *pipeline.Run) error { ret := _m.Called(ctx, run) @@ -58,6 +93,35 @@ func (_m *ORM) CreateRun(ctx context.Context, run *pipeline.Run) error { return r0 } +// ORM_CreateRun_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateRun' +type ORM_CreateRun_Call struct { + *mock.Call +} + +// CreateRun is a helper method to define mock.On call +// - ctx context.Context +// - run *pipeline.Run +func (_e *ORM_Expecter) CreateRun(ctx interface{}, run interface{}) *ORM_CreateRun_Call { + return &ORM_CreateRun_Call{Call: _e.mock.On("CreateRun", ctx, run)} +} + +func (_c *ORM_CreateRun_Call) Run(run func(ctx context.Context, run *pipeline.Run)) *ORM_CreateRun_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*pipeline.Run)) + }) + return _c +} + +func (_c *ORM_CreateRun_Call) Return(err error) *ORM_CreateRun_Call { + _c.Call.Return(err) + return _c +} + +func (_c *ORM_CreateRun_Call) RunAndReturn(run func(context.Context, *pipeline.Run) error) *ORM_CreateRun_Call { + _c.Call.Return(run) + return _c +} + // CreateSpec provides a mock function with given fields: ctx, _a1, maxTaskTimeout func (_m *ORM) CreateSpec(ctx context.Context, _a1 pipeline.Pipeline, maxTaskTimeout models.Interval) (int32, error) { ret := _m.Called(ctx, _a1, maxTaskTimeout) @@ -86,6 +150,36 @@ func (_m *ORM) CreateSpec(ctx context.Context, _a1 pipeline.Pipeline, maxTaskTim return r0, r1 } +// ORM_CreateSpec_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateSpec' +type ORM_CreateSpec_Call struct { + *mock.Call +} + +// CreateSpec is a helper method to define mock.On call +// - ctx context.Context +// - _a1 pipeline.Pipeline +// - maxTaskTimeout models.Interval +func (_e *ORM_Expecter) CreateSpec(ctx interface{}, _a1 interface{}, maxTaskTimeout interface{}) *ORM_CreateSpec_Call { + return &ORM_CreateSpec_Call{Call: _e.mock.On("CreateSpec", ctx, _a1, maxTaskTimeout)} +} + +func (_c *ORM_CreateSpec_Call) Run(run func(ctx context.Context, _a1 pipeline.Pipeline, maxTaskTimeout models.Interval)) *ORM_CreateSpec_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(pipeline.Pipeline), args[2].(models.Interval)) + }) + return _c +} + +func (_c *ORM_CreateSpec_Call) Return(_a0 int32, _a1 error) *ORM_CreateSpec_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ORM_CreateSpec_Call) RunAndReturn(run func(context.Context, pipeline.Pipeline, models.Interval) (int32, error)) *ORM_CreateSpec_Call { + _c.Call.Return(run) + return _c +} + // DataSource provides a mock function with given fields: func (_m *ORM) DataSource() sqlutil.DataSource { ret := _m.Called() @@ -106,6 +200,33 @@ func (_m *ORM) DataSource() sqlutil.DataSource { return r0 } +// ORM_DataSource_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DataSource' +type ORM_DataSource_Call struct { + *mock.Call +} + +// DataSource is a helper method to define mock.On call +func (_e *ORM_Expecter) DataSource() *ORM_DataSource_Call { + return &ORM_DataSource_Call{Call: _e.mock.On("DataSource")} +} + +func (_c *ORM_DataSource_Call) Run(run func()) *ORM_DataSource_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ORM_DataSource_Call) Return(_a0 sqlutil.DataSource) *ORM_DataSource_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ORM_DataSource_Call) RunAndReturn(run func() sqlutil.DataSource) *ORM_DataSource_Call { + _c.Call.Return(run) + return _c +} + // DeleteRun provides a mock function with given fields: ctx, id func (_m *ORM) DeleteRun(ctx context.Context, id int64) error { ret := _m.Called(ctx, id) @@ -124,6 +245,35 @@ func (_m *ORM) DeleteRun(ctx context.Context, id int64) error { return r0 } +// ORM_DeleteRun_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteRun' +type ORM_DeleteRun_Call struct { + *mock.Call +} + +// DeleteRun is a helper method to define mock.On call +// - ctx context.Context +// - id int64 +func (_e *ORM_Expecter) DeleteRun(ctx interface{}, id interface{}) *ORM_DeleteRun_Call { + return &ORM_DeleteRun_Call{Call: _e.mock.On("DeleteRun", ctx, id)} +} + +func (_c *ORM_DeleteRun_Call) Run(run func(ctx context.Context, id int64)) *ORM_DeleteRun_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(int64)) + }) + return _c +} + +func (_c *ORM_DeleteRun_Call) Return(_a0 error) *ORM_DeleteRun_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ORM_DeleteRun_Call) RunAndReturn(run func(context.Context, int64) error) *ORM_DeleteRun_Call { + _c.Call.Return(run) + return _c +} + // DeleteRunsOlderThan provides a mock function with given fields: _a0, _a1 func (_m *ORM) DeleteRunsOlderThan(_a0 context.Context, _a1 time.Duration) error { ret := _m.Called(_a0, _a1) @@ -142,6 +292,35 @@ func (_m *ORM) DeleteRunsOlderThan(_a0 context.Context, _a1 time.Duration) error return r0 } +// ORM_DeleteRunsOlderThan_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteRunsOlderThan' +type ORM_DeleteRunsOlderThan_Call struct { + *mock.Call +} + +// DeleteRunsOlderThan is a helper method to define mock.On call +// - _a0 context.Context +// - _a1 time.Duration +func (_e *ORM_Expecter) DeleteRunsOlderThan(_a0 interface{}, _a1 interface{}) *ORM_DeleteRunsOlderThan_Call { + return &ORM_DeleteRunsOlderThan_Call{Call: _e.mock.On("DeleteRunsOlderThan", _a0, _a1)} +} + +func (_c *ORM_DeleteRunsOlderThan_Call) Run(run func(_a0 context.Context, _a1 time.Duration)) *ORM_DeleteRunsOlderThan_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(time.Duration)) + }) + return _c +} + +func (_c *ORM_DeleteRunsOlderThan_Call) Return(_a0 error) *ORM_DeleteRunsOlderThan_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ORM_DeleteRunsOlderThan_Call) RunAndReturn(run func(context.Context, time.Duration) error) *ORM_DeleteRunsOlderThan_Call { + _c.Call.Return(run) + return _c +} + // FindRun provides a mock function with given fields: ctx, id func (_m *ORM) FindRun(ctx context.Context, id int64) (pipeline.Run, error) { ret := _m.Called(ctx, id) @@ -170,6 +349,35 @@ func (_m *ORM) FindRun(ctx context.Context, id int64) (pipeline.Run, error) { return r0, r1 } +// ORM_FindRun_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindRun' +type ORM_FindRun_Call struct { + *mock.Call +} + +// FindRun is a helper method to define mock.On call +// - ctx context.Context +// - id int64 +func (_e *ORM_Expecter) FindRun(ctx interface{}, id interface{}) *ORM_FindRun_Call { + return &ORM_FindRun_Call{Call: _e.mock.On("FindRun", ctx, id)} +} + +func (_c *ORM_FindRun_Call) Run(run func(ctx context.Context, id int64)) *ORM_FindRun_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(int64)) + }) + return _c +} + +func (_c *ORM_FindRun_Call) Return(_a0 pipeline.Run, _a1 error) *ORM_FindRun_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ORM_FindRun_Call) RunAndReturn(run func(context.Context, int64) (pipeline.Run, error)) *ORM_FindRun_Call { + _c.Call.Return(run) + return _c +} + // GetAllRuns provides a mock function with given fields: ctx func (_m *ORM) GetAllRuns(ctx context.Context) ([]pipeline.Run, error) { ret := _m.Called(ctx) @@ -200,6 +408,34 @@ func (_m *ORM) GetAllRuns(ctx context.Context) ([]pipeline.Run, error) { return r0, r1 } +// ORM_GetAllRuns_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAllRuns' +type ORM_GetAllRuns_Call struct { + *mock.Call +} + +// GetAllRuns is a helper method to define mock.On call +// - ctx context.Context +func (_e *ORM_Expecter) GetAllRuns(ctx interface{}) *ORM_GetAllRuns_Call { + return &ORM_GetAllRuns_Call{Call: _e.mock.On("GetAllRuns", ctx)} +} + +func (_c *ORM_GetAllRuns_Call) Run(run func(ctx context.Context)) *ORM_GetAllRuns_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *ORM_GetAllRuns_Call) Return(_a0 []pipeline.Run, _a1 error) *ORM_GetAllRuns_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ORM_GetAllRuns_Call) RunAndReturn(run func(context.Context) ([]pipeline.Run, error)) *ORM_GetAllRuns_Call { + _c.Call.Return(run) + return _c +} + // GetUnfinishedRuns provides a mock function with given fields: _a0, _a1, _a2 func (_m *ORM) GetUnfinishedRuns(_a0 context.Context, _a1 time.Time, _a2 func(pipeline.Run) error) error { ret := _m.Called(_a0, _a1, _a2) @@ -218,6 +454,36 @@ func (_m *ORM) GetUnfinishedRuns(_a0 context.Context, _a1 time.Time, _a2 func(pi return r0 } +// ORM_GetUnfinishedRuns_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetUnfinishedRuns' +type ORM_GetUnfinishedRuns_Call struct { + *mock.Call +} + +// GetUnfinishedRuns is a helper method to define mock.On call +// - _a0 context.Context +// - _a1 time.Time +// - _a2 func(pipeline.Run) error +func (_e *ORM_Expecter) GetUnfinishedRuns(_a0 interface{}, _a1 interface{}, _a2 interface{}) *ORM_GetUnfinishedRuns_Call { + return &ORM_GetUnfinishedRuns_Call{Call: _e.mock.On("GetUnfinishedRuns", _a0, _a1, _a2)} +} + +func (_c *ORM_GetUnfinishedRuns_Call) Run(run func(_a0 context.Context, _a1 time.Time, _a2 func(pipeline.Run) error)) *ORM_GetUnfinishedRuns_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(time.Time), args[2].(func(pipeline.Run) error)) + }) + return _c +} + +func (_c *ORM_GetUnfinishedRuns_Call) Return(_a0 error) *ORM_GetUnfinishedRuns_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ORM_GetUnfinishedRuns_Call) RunAndReturn(run func(context.Context, time.Time, func(pipeline.Run) error) error) *ORM_GetUnfinishedRuns_Call { + _c.Call.Return(run) + return _c +} + // HealthReport provides a mock function with given fields: func (_m *ORM) HealthReport() map[string]error { ret := _m.Called() @@ -238,6 +504,33 @@ func (_m *ORM) HealthReport() map[string]error { return r0 } +// ORM_HealthReport_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HealthReport' +type ORM_HealthReport_Call struct { + *mock.Call +} + +// HealthReport is a helper method to define mock.On call +func (_e *ORM_Expecter) HealthReport() *ORM_HealthReport_Call { + return &ORM_HealthReport_Call{Call: _e.mock.On("HealthReport")} +} + +func (_c *ORM_HealthReport_Call) Run(run func()) *ORM_HealthReport_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ORM_HealthReport_Call) Return(_a0 map[string]error) *ORM_HealthReport_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ORM_HealthReport_Call) RunAndReturn(run func() map[string]error) *ORM_HealthReport_Call { + _c.Call.Return(run) + return _c +} + // InsertFinishedRun provides a mock function with given fields: ctx, run, saveSuccessfulTaskRuns func (_m *ORM) InsertFinishedRun(ctx context.Context, run *pipeline.Run, saveSuccessfulTaskRuns bool) error { ret := _m.Called(ctx, run, saveSuccessfulTaskRuns) @@ -256,6 +549,36 @@ func (_m *ORM) InsertFinishedRun(ctx context.Context, run *pipeline.Run, saveSuc return r0 } +// ORM_InsertFinishedRun_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'InsertFinishedRun' +type ORM_InsertFinishedRun_Call struct { + *mock.Call +} + +// InsertFinishedRun is a helper method to define mock.On call +// - ctx context.Context +// - run *pipeline.Run +// - saveSuccessfulTaskRuns bool +func (_e *ORM_Expecter) InsertFinishedRun(ctx interface{}, run interface{}, saveSuccessfulTaskRuns interface{}) *ORM_InsertFinishedRun_Call { + return &ORM_InsertFinishedRun_Call{Call: _e.mock.On("InsertFinishedRun", ctx, run, saveSuccessfulTaskRuns)} +} + +func (_c *ORM_InsertFinishedRun_Call) Run(run func(ctx context.Context, run *pipeline.Run, saveSuccessfulTaskRuns bool)) *ORM_InsertFinishedRun_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*pipeline.Run), args[2].(bool)) + }) + return _c +} + +func (_c *ORM_InsertFinishedRun_Call) Return(err error) *ORM_InsertFinishedRun_Call { + _c.Call.Return(err) + return _c +} + +func (_c *ORM_InsertFinishedRun_Call) RunAndReturn(run func(context.Context, *pipeline.Run, bool) error) *ORM_InsertFinishedRun_Call { + _c.Call.Return(run) + return _c +} + // InsertFinishedRunWithSpec provides a mock function with given fields: ctx, run, saveSuccessfulTaskRuns func (_m *ORM) InsertFinishedRunWithSpec(ctx context.Context, run *pipeline.Run, saveSuccessfulTaskRuns bool) error { ret := _m.Called(ctx, run, saveSuccessfulTaskRuns) @@ -274,6 +597,36 @@ func (_m *ORM) InsertFinishedRunWithSpec(ctx context.Context, run *pipeline.Run, return r0 } +// ORM_InsertFinishedRunWithSpec_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'InsertFinishedRunWithSpec' +type ORM_InsertFinishedRunWithSpec_Call struct { + *mock.Call +} + +// InsertFinishedRunWithSpec is a helper method to define mock.On call +// - ctx context.Context +// - run *pipeline.Run +// - saveSuccessfulTaskRuns bool +func (_e *ORM_Expecter) InsertFinishedRunWithSpec(ctx interface{}, run interface{}, saveSuccessfulTaskRuns interface{}) *ORM_InsertFinishedRunWithSpec_Call { + return &ORM_InsertFinishedRunWithSpec_Call{Call: _e.mock.On("InsertFinishedRunWithSpec", ctx, run, saveSuccessfulTaskRuns)} +} + +func (_c *ORM_InsertFinishedRunWithSpec_Call) Run(run func(ctx context.Context, run *pipeline.Run, saveSuccessfulTaskRuns bool)) *ORM_InsertFinishedRunWithSpec_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*pipeline.Run), args[2].(bool)) + }) + return _c +} + +func (_c *ORM_InsertFinishedRunWithSpec_Call) Return(err error) *ORM_InsertFinishedRunWithSpec_Call { + _c.Call.Return(err) + return _c +} + +func (_c *ORM_InsertFinishedRunWithSpec_Call) RunAndReturn(run func(context.Context, *pipeline.Run, bool) error) *ORM_InsertFinishedRunWithSpec_Call { + _c.Call.Return(run) + return _c +} + // InsertFinishedRuns provides a mock function with given fields: ctx, run, saveSuccessfulTaskRuns func (_m *ORM) InsertFinishedRuns(ctx context.Context, run []*pipeline.Run, saveSuccessfulTaskRuns bool) error { ret := _m.Called(ctx, run, saveSuccessfulTaskRuns) @@ -292,6 +645,36 @@ func (_m *ORM) InsertFinishedRuns(ctx context.Context, run []*pipeline.Run, save return r0 } +// ORM_InsertFinishedRuns_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'InsertFinishedRuns' +type ORM_InsertFinishedRuns_Call struct { + *mock.Call +} + +// InsertFinishedRuns is a helper method to define mock.On call +// - ctx context.Context +// - run []*pipeline.Run +// - saveSuccessfulTaskRuns bool +func (_e *ORM_Expecter) InsertFinishedRuns(ctx interface{}, run interface{}, saveSuccessfulTaskRuns interface{}) *ORM_InsertFinishedRuns_Call { + return &ORM_InsertFinishedRuns_Call{Call: _e.mock.On("InsertFinishedRuns", ctx, run, saveSuccessfulTaskRuns)} +} + +func (_c *ORM_InsertFinishedRuns_Call) Run(run func(ctx context.Context, run []*pipeline.Run, saveSuccessfulTaskRuns bool)) *ORM_InsertFinishedRuns_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].([]*pipeline.Run), args[2].(bool)) + }) + return _c +} + +func (_c *ORM_InsertFinishedRuns_Call) Return(err error) *ORM_InsertFinishedRuns_Call { + _c.Call.Return(err) + return _c +} + +func (_c *ORM_InsertFinishedRuns_Call) RunAndReturn(run func(context.Context, []*pipeline.Run, bool) error) *ORM_InsertFinishedRuns_Call { + _c.Call.Return(run) + return _c +} + // InsertRun provides a mock function with given fields: ctx, run func (_m *ORM) InsertRun(ctx context.Context, run *pipeline.Run) error { ret := _m.Called(ctx, run) @@ -310,6 +693,35 @@ func (_m *ORM) InsertRun(ctx context.Context, run *pipeline.Run) error { return r0 } +// ORM_InsertRun_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'InsertRun' +type ORM_InsertRun_Call struct { + *mock.Call +} + +// InsertRun is a helper method to define mock.On call +// - ctx context.Context +// - run *pipeline.Run +func (_e *ORM_Expecter) InsertRun(ctx interface{}, run interface{}) *ORM_InsertRun_Call { + return &ORM_InsertRun_Call{Call: _e.mock.On("InsertRun", ctx, run)} +} + +func (_c *ORM_InsertRun_Call) Run(run func(ctx context.Context, run *pipeline.Run)) *ORM_InsertRun_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*pipeline.Run)) + }) + return _c +} + +func (_c *ORM_InsertRun_Call) Return(_a0 error) *ORM_InsertRun_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ORM_InsertRun_Call) RunAndReturn(run func(context.Context, *pipeline.Run) error) *ORM_InsertRun_Call { + _c.Call.Return(run) + return _c +} + // Name provides a mock function with given fields: func (_m *ORM) Name() string { ret := _m.Called() @@ -328,6 +740,33 @@ func (_m *ORM) Name() string { return r0 } +// ORM_Name_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Name' +type ORM_Name_Call struct { + *mock.Call +} + +// Name is a helper method to define mock.On call +func (_e *ORM_Expecter) Name() *ORM_Name_Call { + return &ORM_Name_Call{Call: _e.mock.On("Name")} +} + +func (_c *ORM_Name_Call) Run(run func()) *ORM_Name_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ORM_Name_Call) Return(_a0 string) *ORM_Name_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ORM_Name_Call) RunAndReturn(run func() string) *ORM_Name_Call { + _c.Call.Return(run) + return _c +} + // Ready provides a mock function with given fields: func (_m *ORM) Ready() error { ret := _m.Called() @@ -346,6 +785,33 @@ func (_m *ORM) Ready() error { return r0 } +// ORM_Ready_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Ready' +type ORM_Ready_Call struct { + *mock.Call +} + +// Ready is a helper method to define mock.On call +func (_e *ORM_Expecter) Ready() *ORM_Ready_Call { + return &ORM_Ready_Call{Call: _e.mock.On("Ready")} +} + +func (_c *ORM_Ready_Call) Run(run func()) *ORM_Ready_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ORM_Ready_Call) Return(_a0 error) *ORM_Ready_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ORM_Ready_Call) RunAndReturn(run func() error) *ORM_Ready_Call { + _c.Call.Return(run) + return _c +} + // Start provides a mock function with given fields: _a0 func (_m *ORM) Start(_a0 context.Context) error { ret := _m.Called(_a0) @@ -364,6 +830,34 @@ func (_m *ORM) Start(_a0 context.Context) error { return r0 } +// ORM_Start_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Start' +type ORM_Start_Call struct { + *mock.Call +} + +// Start is a helper method to define mock.On call +// - _a0 context.Context +func (_e *ORM_Expecter) Start(_a0 interface{}) *ORM_Start_Call { + return &ORM_Start_Call{Call: _e.mock.On("Start", _a0)} +} + +func (_c *ORM_Start_Call) Run(run func(_a0 context.Context)) *ORM_Start_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *ORM_Start_Call) Return(_a0 error) *ORM_Start_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ORM_Start_Call) RunAndReturn(run func(context.Context) error) *ORM_Start_Call { + _c.Call.Return(run) + return _c +} + // StoreRun provides a mock function with given fields: ctx, run func (_m *ORM) StoreRun(ctx context.Context, run *pipeline.Run) (bool, error) { ret := _m.Called(ctx, run) @@ -392,6 +886,35 @@ func (_m *ORM) StoreRun(ctx context.Context, run *pipeline.Run) (bool, error) { return r0, r1 } +// ORM_StoreRun_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StoreRun' +type ORM_StoreRun_Call struct { + *mock.Call +} + +// StoreRun is a helper method to define mock.On call +// - ctx context.Context +// - run *pipeline.Run +func (_e *ORM_Expecter) StoreRun(ctx interface{}, run interface{}) *ORM_StoreRun_Call { + return &ORM_StoreRun_Call{Call: _e.mock.On("StoreRun", ctx, run)} +} + +func (_c *ORM_StoreRun_Call) Run(run func(ctx context.Context, run *pipeline.Run)) *ORM_StoreRun_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*pipeline.Run)) + }) + return _c +} + +func (_c *ORM_StoreRun_Call) Return(restart bool, err error) *ORM_StoreRun_Call { + _c.Call.Return(restart, err) + return _c +} + +func (_c *ORM_StoreRun_Call) RunAndReturn(run func(context.Context, *pipeline.Run) (bool, error)) *ORM_StoreRun_Call { + _c.Call.Return(run) + return _c +} + // Transact provides a mock function with given fields: _a0, _a1 func (_m *ORM) Transact(_a0 context.Context, _a1 func(pipeline.ORM) error) error { ret := _m.Called(_a0, _a1) @@ -410,6 +933,35 @@ func (_m *ORM) Transact(_a0 context.Context, _a1 func(pipeline.ORM) error) error return r0 } +// ORM_Transact_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Transact' +type ORM_Transact_Call struct { + *mock.Call +} + +// Transact is a helper method to define mock.On call +// - _a0 context.Context +// - _a1 func(pipeline.ORM) error +func (_e *ORM_Expecter) Transact(_a0 interface{}, _a1 interface{}) *ORM_Transact_Call { + return &ORM_Transact_Call{Call: _e.mock.On("Transact", _a0, _a1)} +} + +func (_c *ORM_Transact_Call) Run(run func(_a0 context.Context, _a1 func(pipeline.ORM) error)) *ORM_Transact_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(func(pipeline.ORM) error)) + }) + return _c +} + +func (_c *ORM_Transact_Call) Return(_a0 error) *ORM_Transact_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ORM_Transact_Call) RunAndReturn(run func(context.Context, func(pipeline.ORM) error) error) *ORM_Transact_Call { + _c.Call.Return(run) + return _c +} + // UpdateTaskRunResult provides a mock function with given fields: ctx, taskID, result func (_m *ORM) UpdateTaskRunResult(ctx context.Context, taskID uuid.UUID, result pipeline.Result) (pipeline.Run, bool, error) { ret := _m.Called(ctx, taskID, result) @@ -445,6 +997,36 @@ func (_m *ORM) UpdateTaskRunResult(ctx context.Context, taskID uuid.UUID, result return r0, r1, r2 } +// ORM_UpdateTaskRunResult_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateTaskRunResult' +type ORM_UpdateTaskRunResult_Call struct { + *mock.Call +} + +// UpdateTaskRunResult is a helper method to define mock.On call +// - ctx context.Context +// - taskID uuid.UUID +// - result pipeline.Result +func (_e *ORM_Expecter) UpdateTaskRunResult(ctx interface{}, taskID interface{}, result interface{}) *ORM_UpdateTaskRunResult_Call { + return &ORM_UpdateTaskRunResult_Call{Call: _e.mock.On("UpdateTaskRunResult", ctx, taskID, result)} +} + +func (_c *ORM_UpdateTaskRunResult_Call) Run(run func(ctx context.Context, taskID uuid.UUID, result pipeline.Result)) *ORM_UpdateTaskRunResult_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(uuid.UUID), args[2].(pipeline.Result)) + }) + return _c +} + +func (_c *ORM_UpdateTaskRunResult_Call) Return(run pipeline.Run, start bool, err error) *ORM_UpdateTaskRunResult_Call { + _c.Call.Return(run, start, err) + return _c +} + +func (_c *ORM_UpdateTaskRunResult_Call) RunAndReturn(run func(context.Context, uuid.UUID, pipeline.Result) (pipeline.Run, bool, error)) *ORM_UpdateTaskRunResult_Call { + _c.Call.Return(run) + return _c +} + // WithDataSource provides a mock function with given fields: _a0 func (_m *ORM) WithDataSource(_a0 sqlutil.DataSource) pipeline.ORM { ret := _m.Called(_a0) @@ -465,6 +1047,34 @@ func (_m *ORM) WithDataSource(_a0 sqlutil.DataSource) pipeline.ORM { return r0 } +// ORM_WithDataSource_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WithDataSource' +type ORM_WithDataSource_Call struct { + *mock.Call +} + +// WithDataSource is a helper method to define mock.On call +// - _a0 sqlutil.DataSource +func (_e *ORM_Expecter) WithDataSource(_a0 interface{}) *ORM_WithDataSource_Call { + return &ORM_WithDataSource_Call{Call: _e.mock.On("WithDataSource", _a0)} +} + +func (_c *ORM_WithDataSource_Call) Run(run func(_a0 sqlutil.DataSource)) *ORM_WithDataSource_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(sqlutil.DataSource)) + }) + return _c +} + +func (_c *ORM_WithDataSource_Call) Return(_a0 pipeline.ORM) *ORM_WithDataSource_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ORM_WithDataSource_Call) RunAndReturn(run func(sqlutil.DataSource) pipeline.ORM) *ORM_WithDataSource_Call { + _c.Call.Return(run) + return _c +} + // NewORM creates a new instance of ORM. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewORM(t interface { diff --git a/core/services/pipeline/mocks/pipeline_param_unmarshaler.go b/core/services/pipeline/mocks/pipeline_param_unmarshaler.go index cbba896ddad..53f6b1d12be 100644 --- a/core/services/pipeline/mocks/pipeline_param_unmarshaler.go +++ b/core/services/pipeline/mocks/pipeline_param_unmarshaler.go @@ -9,6 +9,14 @@ type PipelineParamUnmarshaler struct { mock.Mock } +type PipelineParamUnmarshaler_Expecter struct { + mock *mock.Mock +} + +func (_m *PipelineParamUnmarshaler) EXPECT() *PipelineParamUnmarshaler_Expecter { + return &PipelineParamUnmarshaler_Expecter{mock: &_m.Mock} +} + // UnmarshalPipelineParam provides a mock function with given fields: val func (_m *PipelineParamUnmarshaler) UnmarshalPipelineParam(val interface{}) error { ret := _m.Called(val) @@ -27,6 +35,34 @@ func (_m *PipelineParamUnmarshaler) UnmarshalPipelineParam(val interface{}) erro return r0 } +// PipelineParamUnmarshaler_UnmarshalPipelineParam_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UnmarshalPipelineParam' +type PipelineParamUnmarshaler_UnmarshalPipelineParam_Call struct { + *mock.Call +} + +// UnmarshalPipelineParam is a helper method to define mock.On call +// - val interface{} +func (_e *PipelineParamUnmarshaler_Expecter) UnmarshalPipelineParam(val interface{}) *PipelineParamUnmarshaler_UnmarshalPipelineParam_Call { + return &PipelineParamUnmarshaler_UnmarshalPipelineParam_Call{Call: _e.mock.On("UnmarshalPipelineParam", val)} +} + +func (_c *PipelineParamUnmarshaler_UnmarshalPipelineParam_Call) Run(run func(val interface{})) *PipelineParamUnmarshaler_UnmarshalPipelineParam_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(interface{})) + }) + return _c +} + +func (_c *PipelineParamUnmarshaler_UnmarshalPipelineParam_Call) Return(_a0 error) *PipelineParamUnmarshaler_UnmarshalPipelineParam_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *PipelineParamUnmarshaler_UnmarshalPipelineParam_Call) RunAndReturn(run func(interface{}) error) *PipelineParamUnmarshaler_UnmarshalPipelineParam_Call { + _c.Call.Return(run) + return _c +} + // NewPipelineParamUnmarshaler creates a new instance of PipelineParamUnmarshaler. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewPipelineParamUnmarshaler(t interface { diff --git a/core/services/pipeline/mocks/runner.go b/core/services/pipeline/mocks/runner.go index cd93fbeab71..bb424459abf 100644 --- a/core/services/pipeline/mocks/runner.go +++ b/core/services/pipeline/mocks/runner.go @@ -5,10 +5,8 @@ package mocks import ( context "context" - logger "github.com/smartcontractkit/chainlink/v2/core/logger" - mock "github.com/stretchr/testify/mock" - pipeline "github.com/smartcontractkit/chainlink/v2/core/services/pipeline" + mock "github.com/stretchr/testify/mock" sqlutil "github.com/smartcontractkit/chainlink-common/pkg/sqlutil" @@ -20,6 +18,14 @@ type Runner struct { mock.Mock } +type Runner_Expecter struct { + mock *mock.Mock +} + +func (_m *Runner) EXPECT() *Runner_Expecter { + return &Runner_Expecter{mock: &_m.Mock} +} + // Close provides a mock function with given fields: func (_m *Runner) Close() error { ret := _m.Called() @@ -38,9 +44,36 @@ func (_m *Runner) Close() error { return r0 } -// ExecuteAndInsertFinishedRun provides a mock function with given fields: ctx, spec, vars, l, saveSuccessfulTaskRuns -func (_m *Runner) ExecuteAndInsertFinishedRun(ctx context.Context, spec pipeline.Spec, vars pipeline.Vars, l logger.Logger, saveSuccessfulTaskRuns bool) (int64, pipeline.TaskRunResults, error) { - ret := _m.Called(ctx, spec, vars, l, saveSuccessfulTaskRuns) +// Runner_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close' +type Runner_Close_Call struct { + *mock.Call +} + +// Close is a helper method to define mock.On call +func (_e *Runner_Expecter) Close() *Runner_Close_Call { + return &Runner_Close_Call{Call: _e.mock.On("Close")} +} + +func (_c *Runner_Close_Call) Run(run func()) *Runner_Close_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Runner_Close_Call) Return(_a0 error) *Runner_Close_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Runner_Close_Call) RunAndReturn(run func() error) *Runner_Close_Call { + _c.Call.Return(run) + return _c +} + +// ExecuteAndInsertFinishedRun provides a mock function with given fields: ctx, spec, vars, saveSuccessfulTaskRuns +func (_m *Runner) ExecuteAndInsertFinishedRun(ctx context.Context, spec pipeline.Spec, vars pipeline.Vars, saveSuccessfulTaskRuns bool) (int64, pipeline.TaskRunResults, error) { + ret := _m.Called(ctx, spec, vars, saveSuccessfulTaskRuns) if len(ret) == 0 { panic("no return value specified for ExecuteAndInsertFinishedRun") @@ -49,25 +82,25 @@ func (_m *Runner) ExecuteAndInsertFinishedRun(ctx context.Context, spec pipeline var r0 int64 var r1 pipeline.TaskRunResults var r2 error - if rf, ok := ret.Get(0).(func(context.Context, pipeline.Spec, pipeline.Vars, logger.Logger, bool) (int64, pipeline.TaskRunResults, error)); ok { - return rf(ctx, spec, vars, l, saveSuccessfulTaskRuns) + if rf, ok := ret.Get(0).(func(context.Context, pipeline.Spec, pipeline.Vars, bool) (int64, pipeline.TaskRunResults, error)); ok { + return rf(ctx, spec, vars, saveSuccessfulTaskRuns) } - if rf, ok := ret.Get(0).(func(context.Context, pipeline.Spec, pipeline.Vars, logger.Logger, bool) int64); ok { - r0 = rf(ctx, spec, vars, l, saveSuccessfulTaskRuns) + if rf, ok := ret.Get(0).(func(context.Context, pipeline.Spec, pipeline.Vars, bool) int64); ok { + r0 = rf(ctx, spec, vars, saveSuccessfulTaskRuns) } else { r0 = ret.Get(0).(int64) } - if rf, ok := ret.Get(1).(func(context.Context, pipeline.Spec, pipeline.Vars, logger.Logger, bool) pipeline.TaskRunResults); ok { - r1 = rf(ctx, spec, vars, l, saveSuccessfulTaskRuns) + if rf, ok := ret.Get(1).(func(context.Context, pipeline.Spec, pipeline.Vars, bool) pipeline.TaskRunResults); ok { + r1 = rf(ctx, spec, vars, saveSuccessfulTaskRuns) } else { if ret.Get(1) != nil { r1 = ret.Get(1).(pipeline.TaskRunResults) } } - if rf, ok := ret.Get(2).(func(context.Context, pipeline.Spec, pipeline.Vars, logger.Logger, bool) error); ok { - r2 = rf(ctx, spec, vars, l, saveSuccessfulTaskRuns) + if rf, ok := ret.Get(2).(func(context.Context, pipeline.Spec, pipeline.Vars, bool) error); ok { + r2 = rf(ctx, spec, vars, saveSuccessfulTaskRuns) } else { r2 = ret.Error(2) } @@ -75,9 +108,40 @@ func (_m *Runner) ExecuteAndInsertFinishedRun(ctx context.Context, spec pipeline return r0, r1, r2 } -// ExecuteRun provides a mock function with given fields: ctx, spec, vars, l -func (_m *Runner) ExecuteRun(ctx context.Context, spec pipeline.Spec, vars pipeline.Vars, l logger.Logger) (*pipeline.Run, pipeline.TaskRunResults, error) { - ret := _m.Called(ctx, spec, vars, l) +// Runner_ExecuteAndInsertFinishedRun_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ExecuteAndInsertFinishedRun' +type Runner_ExecuteAndInsertFinishedRun_Call struct { + *mock.Call +} + +// ExecuteAndInsertFinishedRun is a helper method to define mock.On call +// - ctx context.Context +// - spec pipeline.Spec +// - vars pipeline.Vars +// - saveSuccessfulTaskRuns bool +func (_e *Runner_Expecter) ExecuteAndInsertFinishedRun(ctx interface{}, spec interface{}, vars interface{}, saveSuccessfulTaskRuns interface{}) *Runner_ExecuteAndInsertFinishedRun_Call { + return &Runner_ExecuteAndInsertFinishedRun_Call{Call: _e.mock.On("ExecuteAndInsertFinishedRun", ctx, spec, vars, saveSuccessfulTaskRuns)} +} + +func (_c *Runner_ExecuteAndInsertFinishedRun_Call) Run(run func(ctx context.Context, spec pipeline.Spec, vars pipeline.Vars, saveSuccessfulTaskRuns bool)) *Runner_ExecuteAndInsertFinishedRun_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(pipeline.Spec), args[2].(pipeline.Vars), args[3].(bool)) + }) + return _c +} + +func (_c *Runner_ExecuteAndInsertFinishedRun_Call) Return(runID int64, results pipeline.TaskRunResults, err error) *Runner_ExecuteAndInsertFinishedRun_Call { + _c.Call.Return(runID, results, err) + return _c +} + +func (_c *Runner_ExecuteAndInsertFinishedRun_Call) RunAndReturn(run func(context.Context, pipeline.Spec, pipeline.Vars, bool) (int64, pipeline.TaskRunResults, error)) *Runner_ExecuteAndInsertFinishedRun_Call { + _c.Call.Return(run) + return _c +} + +// ExecuteRun provides a mock function with given fields: ctx, spec, vars +func (_m *Runner) ExecuteRun(ctx context.Context, spec pipeline.Spec, vars pipeline.Vars) (*pipeline.Run, pipeline.TaskRunResults, error) { + ret := _m.Called(ctx, spec, vars) if len(ret) == 0 { panic("no return value specified for ExecuteRun") @@ -86,27 +150,27 @@ func (_m *Runner) ExecuteRun(ctx context.Context, spec pipeline.Spec, vars pipel var r0 *pipeline.Run var r1 pipeline.TaskRunResults var r2 error - if rf, ok := ret.Get(0).(func(context.Context, pipeline.Spec, pipeline.Vars, logger.Logger) (*pipeline.Run, pipeline.TaskRunResults, error)); ok { - return rf(ctx, spec, vars, l) + if rf, ok := ret.Get(0).(func(context.Context, pipeline.Spec, pipeline.Vars) (*pipeline.Run, pipeline.TaskRunResults, error)); ok { + return rf(ctx, spec, vars) } - if rf, ok := ret.Get(0).(func(context.Context, pipeline.Spec, pipeline.Vars, logger.Logger) *pipeline.Run); ok { - r0 = rf(ctx, spec, vars, l) + if rf, ok := ret.Get(0).(func(context.Context, pipeline.Spec, pipeline.Vars) *pipeline.Run); ok { + r0 = rf(ctx, spec, vars) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*pipeline.Run) } } - if rf, ok := ret.Get(1).(func(context.Context, pipeline.Spec, pipeline.Vars, logger.Logger) pipeline.TaskRunResults); ok { - r1 = rf(ctx, spec, vars, l) + if rf, ok := ret.Get(1).(func(context.Context, pipeline.Spec, pipeline.Vars) pipeline.TaskRunResults); ok { + r1 = rf(ctx, spec, vars) } else { if ret.Get(1) != nil { r1 = ret.Get(1).(pipeline.TaskRunResults) } } - if rf, ok := ret.Get(2).(func(context.Context, pipeline.Spec, pipeline.Vars, logger.Logger) error); ok { - r2 = rf(ctx, spec, vars, l) + if rf, ok := ret.Get(2).(func(context.Context, pipeline.Spec, pipeline.Vars) error); ok { + r2 = rf(ctx, spec, vars) } else { r2 = ret.Error(2) } @@ -114,6 +178,36 @@ func (_m *Runner) ExecuteRun(ctx context.Context, spec pipeline.Spec, vars pipel return r0, r1, r2 } +// Runner_ExecuteRun_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ExecuteRun' +type Runner_ExecuteRun_Call struct { + *mock.Call +} + +// ExecuteRun is a helper method to define mock.On call +// - ctx context.Context +// - spec pipeline.Spec +// - vars pipeline.Vars +func (_e *Runner_Expecter) ExecuteRun(ctx interface{}, spec interface{}, vars interface{}) *Runner_ExecuteRun_Call { + return &Runner_ExecuteRun_Call{Call: _e.mock.On("ExecuteRun", ctx, spec, vars)} +} + +func (_c *Runner_ExecuteRun_Call) Run(run func(ctx context.Context, spec pipeline.Spec, vars pipeline.Vars)) *Runner_ExecuteRun_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(pipeline.Spec), args[2].(pipeline.Vars)) + }) + return _c +} + +func (_c *Runner_ExecuteRun_Call) Return(run *pipeline.Run, trrs pipeline.TaskRunResults, err error) *Runner_ExecuteRun_Call { + _c.Call.Return(run, trrs, err) + return _c +} + +func (_c *Runner_ExecuteRun_Call) RunAndReturn(run func(context.Context, pipeline.Spec, pipeline.Vars) (*pipeline.Run, pipeline.TaskRunResults, error)) *Runner_ExecuteRun_Call { + _c.Call.Return(run) + return _c +} + // HealthReport provides a mock function with given fields: func (_m *Runner) HealthReport() map[string]error { ret := _m.Called() @@ -134,6 +228,33 @@ func (_m *Runner) HealthReport() map[string]error { return r0 } +// Runner_HealthReport_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HealthReport' +type Runner_HealthReport_Call struct { + *mock.Call +} + +// HealthReport is a helper method to define mock.On call +func (_e *Runner_Expecter) HealthReport() *Runner_HealthReport_Call { + return &Runner_HealthReport_Call{Call: _e.mock.On("HealthReport")} +} + +func (_c *Runner_HealthReport_Call) Run(run func()) *Runner_HealthReport_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Runner_HealthReport_Call) Return(_a0 map[string]error) *Runner_HealthReport_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Runner_HealthReport_Call) RunAndReturn(run func() map[string]error) *Runner_HealthReport_Call { + _c.Call.Return(run) + return _c +} + // InitializePipeline provides a mock function with given fields: spec func (_m *Runner) InitializePipeline(spec pipeline.Spec) (*pipeline.Pipeline, error) { ret := _m.Called(spec) @@ -164,6 +285,34 @@ func (_m *Runner) InitializePipeline(spec pipeline.Spec) (*pipeline.Pipeline, er return r0, r1 } +// Runner_InitializePipeline_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'InitializePipeline' +type Runner_InitializePipeline_Call struct { + *mock.Call +} + +// InitializePipeline is a helper method to define mock.On call +// - spec pipeline.Spec +func (_e *Runner_Expecter) InitializePipeline(spec interface{}) *Runner_InitializePipeline_Call { + return &Runner_InitializePipeline_Call{Call: _e.mock.On("InitializePipeline", spec)} +} + +func (_c *Runner_InitializePipeline_Call) Run(run func(spec pipeline.Spec)) *Runner_InitializePipeline_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(pipeline.Spec)) + }) + return _c +} + +func (_c *Runner_InitializePipeline_Call) Return(_a0 *pipeline.Pipeline, _a1 error) *Runner_InitializePipeline_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Runner_InitializePipeline_Call) RunAndReturn(run func(pipeline.Spec) (*pipeline.Pipeline, error)) *Runner_InitializePipeline_Call { + _c.Call.Return(run) + return _c +} + // InsertFinishedRun provides a mock function with given fields: ctx, ds, run, saveSuccessfulTaskRuns func (_m *Runner) InsertFinishedRun(ctx context.Context, ds sqlutil.DataSource, run *pipeline.Run, saveSuccessfulTaskRuns bool) error { ret := _m.Called(ctx, ds, run, saveSuccessfulTaskRuns) @@ -182,6 +331,37 @@ func (_m *Runner) InsertFinishedRun(ctx context.Context, ds sqlutil.DataSource, return r0 } +// Runner_InsertFinishedRun_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'InsertFinishedRun' +type Runner_InsertFinishedRun_Call struct { + *mock.Call +} + +// InsertFinishedRun is a helper method to define mock.On call +// - ctx context.Context +// - ds sqlutil.DataSource +// - run *pipeline.Run +// - saveSuccessfulTaskRuns bool +func (_e *Runner_Expecter) InsertFinishedRun(ctx interface{}, ds interface{}, run interface{}, saveSuccessfulTaskRuns interface{}) *Runner_InsertFinishedRun_Call { + return &Runner_InsertFinishedRun_Call{Call: _e.mock.On("InsertFinishedRun", ctx, ds, run, saveSuccessfulTaskRuns)} +} + +func (_c *Runner_InsertFinishedRun_Call) Run(run func(ctx context.Context, ds sqlutil.DataSource, run *pipeline.Run, saveSuccessfulTaskRuns bool)) *Runner_InsertFinishedRun_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(sqlutil.DataSource), args[2].(*pipeline.Run), args[3].(bool)) + }) + return _c +} + +func (_c *Runner_InsertFinishedRun_Call) Return(_a0 error) *Runner_InsertFinishedRun_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Runner_InsertFinishedRun_Call) RunAndReturn(run func(context.Context, sqlutil.DataSource, *pipeline.Run, bool) error) *Runner_InsertFinishedRun_Call { + _c.Call.Return(run) + return _c +} + // InsertFinishedRuns provides a mock function with given fields: ctx, ds, runs, saveSuccessfulTaskRuns func (_m *Runner) InsertFinishedRuns(ctx context.Context, ds sqlutil.DataSource, runs []*pipeline.Run, saveSuccessfulTaskRuns bool) error { ret := _m.Called(ctx, ds, runs, saveSuccessfulTaskRuns) @@ -200,6 +380,37 @@ func (_m *Runner) InsertFinishedRuns(ctx context.Context, ds sqlutil.DataSource, return r0 } +// Runner_InsertFinishedRuns_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'InsertFinishedRuns' +type Runner_InsertFinishedRuns_Call struct { + *mock.Call +} + +// InsertFinishedRuns is a helper method to define mock.On call +// - ctx context.Context +// - ds sqlutil.DataSource +// - runs []*pipeline.Run +// - saveSuccessfulTaskRuns bool +func (_e *Runner_Expecter) InsertFinishedRuns(ctx interface{}, ds interface{}, runs interface{}, saveSuccessfulTaskRuns interface{}) *Runner_InsertFinishedRuns_Call { + return &Runner_InsertFinishedRuns_Call{Call: _e.mock.On("InsertFinishedRuns", ctx, ds, runs, saveSuccessfulTaskRuns)} +} + +func (_c *Runner_InsertFinishedRuns_Call) Run(run func(ctx context.Context, ds sqlutil.DataSource, runs []*pipeline.Run, saveSuccessfulTaskRuns bool)) *Runner_InsertFinishedRuns_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(sqlutil.DataSource), args[2].([]*pipeline.Run), args[3].(bool)) + }) + return _c +} + +func (_c *Runner_InsertFinishedRuns_Call) Return(_a0 error) *Runner_InsertFinishedRuns_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Runner_InsertFinishedRuns_Call) RunAndReturn(run func(context.Context, sqlutil.DataSource, []*pipeline.Run, bool) error) *Runner_InsertFinishedRuns_Call { + _c.Call.Return(run) + return _c +} + // Name provides a mock function with given fields: func (_m *Runner) Name() string { ret := _m.Called() @@ -218,11 +429,66 @@ func (_m *Runner) Name() string { return r0 } +// Runner_Name_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Name' +type Runner_Name_Call struct { + *mock.Call +} + +// Name is a helper method to define mock.On call +func (_e *Runner_Expecter) Name() *Runner_Name_Call { + return &Runner_Name_Call{Call: _e.mock.On("Name")} +} + +func (_c *Runner_Name_Call) Run(run func()) *Runner_Name_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Runner_Name_Call) Return(_a0 string) *Runner_Name_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Runner_Name_Call) RunAndReturn(run func() string) *Runner_Name_Call { + _c.Call.Return(run) + return _c +} + // OnRunFinished provides a mock function with given fields: _a0 func (_m *Runner) OnRunFinished(_a0 func(*pipeline.Run)) { _m.Called(_a0) } +// Runner_OnRunFinished_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OnRunFinished' +type Runner_OnRunFinished_Call struct { + *mock.Call +} + +// OnRunFinished is a helper method to define mock.On call +// - _a0 func(*pipeline.Run) +func (_e *Runner_Expecter) OnRunFinished(_a0 interface{}) *Runner_OnRunFinished_Call { + return &Runner_OnRunFinished_Call{Call: _e.mock.On("OnRunFinished", _a0)} +} + +func (_c *Runner_OnRunFinished_Call) Run(run func(_a0 func(*pipeline.Run))) *Runner_OnRunFinished_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(func(*pipeline.Run))) + }) + return _c +} + +func (_c *Runner_OnRunFinished_Call) Return() *Runner_OnRunFinished_Call { + _c.Call.Return() + return _c +} + +func (_c *Runner_OnRunFinished_Call) RunAndReturn(run func(func(*pipeline.Run))) *Runner_OnRunFinished_Call { + _c.Call.Return(run) + return _c +} + // Ready provides a mock function with given fields: func (_m *Runner) Ready() error { ret := _m.Called() @@ -241,6 +507,33 @@ func (_m *Runner) Ready() error { return r0 } +// Runner_Ready_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Ready' +type Runner_Ready_Call struct { + *mock.Call +} + +// Ready is a helper method to define mock.On call +func (_e *Runner_Expecter) Ready() *Runner_Ready_Call { + return &Runner_Ready_Call{Call: _e.mock.On("Ready")} +} + +func (_c *Runner_Ready_Call) Run(run func()) *Runner_Ready_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Runner_Ready_Call) Return(_a0 error) *Runner_Ready_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Runner_Ready_Call) RunAndReturn(run func() error) *Runner_Ready_Call { + _c.Call.Return(run) + return _c +} + // ResumeRun provides a mock function with given fields: ctx, taskID, value, err func (_m *Runner) ResumeRun(ctx context.Context, taskID uuid.UUID, value interface{}, err error) error { ret := _m.Called(ctx, taskID, value, err) @@ -259,9 +552,40 @@ func (_m *Runner) ResumeRun(ctx context.Context, taskID uuid.UUID, value interfa return r0 } -// Run provides a mock function with given fields: ctx, run, l, saveSuccessfulTaskRuns, fn -func (_m *Runner) Run(ctx context.Context, run *pipeline.Run, l logger.Logger, saveSuccessfulTaskRuns bool, fn func(sqlutil.DataSource) error) (bool, error) { - ret := _m.Called(ctx, run, l, saveSuccessfulTaskRuns, fn) +// Runner_ResumeRun_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ResumeRun' +type Runner_ResumeRun_Call struct { + *mock.Call +} + +// ResumeRun is a helper method to define mock.On call +// - ctx context.Context +// - taskID uuid.UUID +// - value interface{} +// - err error +func (_e *Runner_Expecter) ResumeRun(ctx interface{}, taskID interface{}, value interface{}, err interface{}) *Runner_ResumeRun_Call { + return &Runner_ResumeRun_Call{Call: _e.mock.On("ResumeRun", ctx, taskID, value, err)} +} + +func (_c *Runner_ResumeRun_Call) Run(run func(ctx context.Context, taskID uuid.UUID, value interface{}, err error)) *Runner_ResumeRun_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(uuid.UUID), args[2].(interface{}), args[3].(error)) + }) + return _c +} + +func (_c *Runner_ResumeRun_Call) Return(_a0 error) *Runner_ResumeRun_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Runner_ResumeRun_Call) RunAndReturn(run func(context.Context, uuid.UUID, interface{}, error) error) *Runner_ResumeRun_Call { + _c.Call.Return(run) + return _c +} + +// Run provides a mock function with given fields: ctx, run, saveSuccessfulTaskRuns, fn +func (_m *Runner) Run(ctx context.Context, run *pipeline.Run, saveSuccessfulTaskRuns bool, fn func(sqlutil.DataSource) error) (bool, error) { + ret := _m.Called(ctx, run, saveSuccessfulTaskRuns, fn) if len(ret) == 0 { panic("no return value specified for Run") @@ -269,17 +593,17 @@ func (_m *Runner) Run(ctx context.Context, run *pipeline.Run, l logger.Logger, s var r0 bool var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *pipeline.Run, logger.Logger, bool, func(sqlutil.DataSource) error) (bool, error)); ok { - return rf(ctx, run, l, saveSuccessfulTaskRuns, fn) + if rf, ok := ret.Get(0).(func(context.Context, *pipeline.Run, bool, func(sqlutil.DataSource) error) (bool, error)); ok { + return rf(ctx, run, saveSuccessfulTaskRuns, fn) } - if rf, ok := ret.Get(0).(func(context.Context, *pipeline.Run, logger.Logger, bool, func(sqlutil.DataSource) error) bool); ok { - r0 = rf(ctx, run, l, saveSuccessfulTaskRuns, fn) + if rf, ok := ret.Get(0).(func(context.Context, *pipeline.Run, bool, func(sqlutil.DataSource) error) bool); ok { + r0 = rf(ctx, run, saveSuccessfulTaskRuns, fn) } else { r0 = ret.Get(0).(bool) } - if rf, ok := ret.Get(1).(func(context.Context, *pipeline.Run, logger.Logger, bool, func(sqlutil.DataSource) error) error); ok { - r1 = rf(ctx, run, l, saveSuccessfulTaskRuns, fn) + if rf, ok := ret.Get(1).(func(context.Context, *pipeline.Run, bool, func(sqlutil.DataSource) error) error); ok { + r1 = rf(ctx, run, saveSuccessfulTaskRuns, fn) } else { r1 = ret.Error(1) } @@ -287,6 +611,37 @@ func (_m *Runner) Run(ctx context.Context, run *pipeline.Run, l logger.Logger, s return r0, r1 } +// Runner_Run_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Run' +type Runner_Run_Call struct { + *mock.Call +} + +// Run is a helper method to define mock.On call +// - ctx context.Context +// - run *pipeline.Run +// - saveSuccessfulTaskRuns bool +// - fn func(sqlutil.DataSource) error +func (_e *Runner_Expecter) Run(ctx interface{}, run interface{}, saveSuccessfulTaskRuns interface{}, fn interface{}) *Runner_Run_Call { + return &Runner_Run_Call{Call: _e.mock.On("Run", ctx, run, saveSuccessfulTaskRuns, fn)} +} + +func (_c *Runner_Run_Call) Run(run func(ctx context.Context, run *pipeline.Run, saveSuccessfulTaskRuns bool, fn func(sqlutil.DataSource) error)) *Runner_Run_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*pipeline.Run), args[2].(bool), args[3].(func(sqlutil.DataSource) error)) + }) + return _c +} + +func (_c *Runner_Run_Call) Return(incomplete bool, err error) *Runner_Run_Call { + _c.Call.Return(incomplete, err) + return _c +} + +func (_c *Runner_Run_Call) RunAndReturn(run func(context.Context, *pipeline.Run, bool, func(sqlutil.DataSource) error) (bool, error)) *Runner_Run_Call { + _c.Call.Return(run) + return _c +} + // Start provides a mock function with given fields: _a0 func (_m *Runner) Start(_a0 context.Context) error { ret := _m.Called(_a0) @@ -305,6 +660,34 @@ func (_m *Runner) Start(_a0 context.Context) error { return r0 } +// Runner_Start_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Start' +type Runner_Start_Call struct { + *mock.Call +} + +// Start is a helper method to define mock.On call +// - _a0 context.Context +func (_e *Runner_Expecter) Start(_a0 interface{}) *Runner_Start_Call { + return &Runner_Start_Call{Call: _e.mock.On("Start", _a0)} +} + +func (_c *Runner_Start_Call) Run(run func(_a0 context.Context)) *Runner_Start_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *Runner_Start_Call) Return(_a0 error) *Runner_Start_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Runner_Start_Call) RunAndReturn(run func(context.Context) error) *Runner_Start_Call { + _c.Call.Return(run) + return _c +} + // NewRunner creates a new instance of Runner. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewRunner(t interface { diff --git a/core/services/pipeline/orm.go b/core/services/pipeline/orm.go index 266b605ed42..872d92a1bbf 100644 --- a/core/services/pipeline/orm.go +++ b/core/services/pipeline/orm.go @@ -74,8 +74,6 @@ type CreateDataSource interface { GetContext(ctx context.Context, dest interface{}, query string, args ...interface{}) error } -//go:generate mockery --quiet --name ORM --output ./mocks/ --case=underscore - type ORM interface { services.Service diff --git a/core/services/pipeline/orm_test.go b/core/services/pipeline/orm_test.go index 877aa9e4aa5..f3d529d87e6 100644 --- a/core/services/pipeline/orm_test.go +++ b/core/services/pipeline/orm_test.go @@ -21,7 +21,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/bridges" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils/big" "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" - "github.com/smartcontractkit/chainlink/v2/core/internal/cltest/heavyweight" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/configtest" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/pgtest" @@ -30,6 +29,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/job" "github.com/smartcontractkit/chainlink/v2/core/services/pipeline" "github.com/smartcontractkit/chainlink/v2/core/store/models" + "github.com/smartcontractkit/chainlink/v2/core/utils/testutils/heavyweight" ) type testOnlyORM interface { diff --git a/core/services/pipeline/runner.go b/core/services/pipeline/runner.go index a73848f68af..586bb7738f3 100644 --- a/core/services/pipeline/runner.go +++ b/core/services/pipeline/runner.go @@ -28,20 +28,18 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/store/models" ) -//go:generate mockery --quiet --name Runner --output ./mocks/ --case=underscore - type Runner interface { services.Service // Run is a blocking call that will execute the run until no further progress can be made. // If `incomplete` is true, the run is only partially complete and is suspended, awaiting to be resumed when more data comes in. // Note that `saveSuccessfulTaskRuns` value is ignored if the run contains async tasks. - Run(ctx context.Context, run *Run, l logger.Logger, saveSuccessfulTaskRuns bool, fn func(tx sqlutil.DataSource) error) (incomplete bool, err error) + Run(ctx context.Context, run *Run, saveSuccessfulTaskRuns bool, fn func(tx sqlutil.DataSource) error) (incomplete bool, err error) ResumeRun(ctx context.Context, taskID uuid.UUID, value interface{}, err error) error // ExecuteRun executes a new run in-memory according to a spec and returns the results. // We expect spec.JobID and spec.JobName to be set for logging/prometheus. - ExecuteRun(ctx context.Context, spec Spec, vars Vars, l logger.Logger) (run *Run, trrs TaskRunResults, err error) + ExecuteRun(ctx context.Context, spec Spec, vars Vars) (run *Run, trrs TaskRunResults, err error) // InsertFinishedRun saves the run results in the database. // ds is an optional override, for example when executing a transaction. InsertFinishedRun(ctx context.Context, ds sqlutil.DataSource, run *Run, saveSuccessfulTaskRuns bool) error @@ -51,7 +49,7 @@ type Runner interface { // It is a combination of ExecuteRun and InsertFinishedRun. // Note that the spec MUST have a DOT graph for this to work. // This will persist the Spec in the DB if it doesn't have an ID. - ExecuteAndInsertFinishedRun(ctx context.Context, spec Spec, vars Vars, l logger.Logger, saveSuccessfulTaskRuns bool) (runID int64, results TaskRunResults, err error) + ExecuteAndInsertFinishedRun(ctx context.Context, spec Spec, vars Vars, saveSuccessfulTaskRuns bool) (runID int64, results TaskRunResults, err error) OnRunFinished(func(*Run)) InitializePipeline(spec Spec) (*Pipeline, error) @@ -290,12 +288,7 @@ func overtimeContext(ctx context.Context) (context.Context, context.CancelFunc) return context.WithoutCancel(ctx), func() {} } -func (r *runner) ExecuteRun( - ctx context.Context, - spec Spec, - vars Vars, - l logger.Logger, -) (*Run, TaskRunResults, error) { +func (r *runner) ExecuteRun(ctx context.Context, spec Spec, vars Vars) (*Run, TaskRunResults, error) { // Pipeline runs may return results after the context is cancelled, so we modify the // deadline to give them time to return before the parent context deadline. var cancel func() @@ -320,7 +313,7 @@ func (r *runner) ExecuteRun( } run := NewRun(spec, vars) - taskRunResults := r.run(ctx, pipeline, run, vars, l) + taskRunResults := r.run(ctx, pipeline, run, vars) if run.Pending { return run, nil, fmt.Errorf("unexpected async run for spec ID %v, tried executing via ExecuteRun", spec.ID) @@ -382,8 +375,8 @@ func (r *runner) InitializePipeline(spec Spec) (pipeline *Pipeline, err error) { return pipeline, nil } -func (r *runner) run(ctx context.Context, pipeline *Pipeline, run *Run, vars Vars, l logger.Logger) TaskRunResults { - l = l.With("run.ID", run.ID, "executionID", uuid.New(), "specID", run.PipelineSpecID, "jobID", run.PipelineSpec.JobID, "jobName", run.PipelineSpec.JobName) +func (r *runner) run(ctx context.Context, pipeline *Pipeline, run *Run, vars Vars) TaskRunResults { + l := r.lggr.With("run.ID", run.ID, "executionID", uuid.New(), "specID", run.PipelineSpecID, "jobID", run.PipelineSpec.JobID, "jobName", run.PipelineSpec.JobName) l.Debug("Initiating tasks for pipeline run of spec") scheduler := newScheduler(pipeline, run, vars, l) @@ -610,8 +603,8 @@ func logTaskRunToPrometheus(trr TaskRunResult, spec Spec) { } // ExecuteAndInsertFinishedRun executes a run in memory then inserts the finished run/task run records, returning the final result -func (r *runner) ExecuteAndInsertFinishedRun(ctx context.Context, spec Spec, vars Vars, l logger.Logger, saveSuccessfulTaskRuns bool) (runID int64, results TaskRunResults, err error) { - run, trrs, err := r.ExecuteRun(ctx, spec, vars, l) +func (r *runner) ExecuteAndInsertFinishedRun(ctx context.Context, spec Spec, vars Vars, saveSuccessfulTaskRuns bool) (runID int64, results TaskRunResults, err error) { + run, trrs, err := r.ExecuteRun(ctx, spec, vars) if err != nil { return 0, trrs, pkgerrors.Wrapf(err, "error executing run for spec ID %v", spec.ID) } @@ -632,7 +625,7 @@ func (r *runner) ExecuteAndInsertFinishedRun(ctx context.Context, spec Spec, var return run.ID, trrs, nil } -func (r *runner) Run(ctx context.Context, run *Run, l logger.Logger, saveSuccessfulTaskRuns bool, fn func(tx sqlutil.DataSource) error) (incomplete bool, err error) { +func (r *runner) Run(ctx context.Context, run *Run, saveSuccessfulTaskRuns bool, fn func(tx sqlutil.DataSource) error) (incomplete bool, err error) { pipeline, err := r.InitializePipeline(run.PipelineSpec) if err != nil { return false, err @@ -683,7 +676,7 @@ func (r *runner) Run(ctx context.Context, run *Run, l logger.Logger, saveSuccess } for { - r.run(ctx, pipeline, run, NewVarsFrom(run.Inputs.Val.(map[string]interface{})), l) + r.run(ctx, pipeline, run, NewVarsFrom(run.Inputs.Val.(map[string]interface{}))) if preinsert { // FailSilently = run failed and task was marked failEarly. skip StoreRun and instead delete all trace of it @@ -739,7 +732,9 @@ func (r *runner) ResumeRun(ctx context.Context, taskID uuid.UUID, value interfac if start { // start the runner again go func() { - if _, err := r.Run(context.Background(), &run, r.lggr, false, nil); err != nil { + ctx, cancel := r.chStop.NewCtx() + defer cancel() + if _, err := r.Run(ctx, &run, false, nil); err != nil { r.lggr.Errorw("Resume run failure", "err", err) } r.lggr.Debug("Resume run success") @@ -801,7 +796,7 @@ func (r *runner) scheduleUnfinishedRuns() { go func() { defer wgRunsDone.Done() - _, err := r.Run(ctx, &run, r.lggr, false, nil) + _, err := r.Run(ctx, &run, false, nil) if ctx.Err() != nil { return } else if err != nil { diff --git a/core/services/pipeline/runner_test.go b/core/services/pipeline/runner_test.go index dddc84e7368..ea30b3ff086 100644 --- a/core/services/pipeline/runner_test.go +++ b/core/services/pipeline/runner_test.go @@ -106,12 +106,11 @@ ds5 [type=http method="GET" url="%s" index=2] spec := pipeline.Spec{DotDagSource: s} vars := pipeline.NewVarsFrom(nil) - lggr := logger.TestLogger(t) - _, trrs, err := r.ExecuteRun(testutils.Context(t), spec, vars, lggr) + _, trrs, err := r.ExecuteRun(testutils.Context(t), spec, vars) require.NoError(t, err) require.Len(t, trrs, len(d.Tasks)) - finalResults := trrs.FinalResult(lggr) + finalResults := trrs.FinalResult() require.Len(t, finalResults.Values, 3) require.Len(t, finalResults.AllErrors, 12) require.Len(t, finalResults.FatalErrors, 3) @@ -132,6 +131,50 @@ ds5 [type=http method="GET" url="%s" index=2] require.Len(t, errorResults, 3) } +func Test_PipelineRunner_ExecuteEthAbiDecode(t *testing.T) { + db := pgtest.NewSqlxDB(t) + cfg := configtest.NewTestGeneralConfig(t) + + mockResult := `{"data":{"result":"0x000000000000000000000000000000000000000000000000105ba6a589b23a81"}}` + s1 := httptest.NewServer(NewMockHandler(mockResult)) + defer s1.Close() + + bridgeFeedURL, err := url.ParseRequestURI(s1.URL) + require.NoError(t, err) + + _, bt := cltest.MustCreateBridge(t, db, cltest.BridgeOpts{URL: bridgeFeedURL.String()}) + + btORM := bridgesMocks.NewORM(t) + btORM.On("FindBridge", mock.Anything, bt.Name).Return(*bt, nil).Once() + + r, _ := newRunner(t, db, btORM, cfg) + + s := fmt.Sprintf(` + ds1 [type=bridge name="%s" timeout=0 requestData=<{"data": {"address": "0x1234"}}>] + ds1_parse [type=jsonparse path="data,result"] + ds1_decode [type=ethabidecode abi="int256 data" data="$(ds1_parse)"]; + ds1_value [type="multiply" input="$(ds1_decode.data)" times=1] + + ds1->ds1_parse->ds1_decode->ds1_value + +`, bt.Name.String()) + d, err := pipeline.Parse(s) + require.NoError(t, err) + + spec := pipeline.Spec{DotDagSource: s} + vars := pipeline.NewVarsFrom(nil) + + _, trrs, err := r.ExecuteRun(testutils.Context(t), spec, vars) + require.NoError(t, err) + require.Len(t, trrs, len(d.Tasks)) + + finalResults := trrs.FinalResult() + + val := finalResults.Values[0].(decimal.Decimal) + + assert.Equal(t, decimal.NewFromInt(1178718957397490305), val) +} + type taskRunWithVars struct { bridgeName string ds2URL, ds4URL string @@ -282,7 +325,7 @@ func Test_PipelineRunner_ExecuteTaskRunsWithVars(t *testing.T) { spec := pipeline.Spec{ DotDagSource: specStr, } - _, taskRunResults, err := runner.ExecuteRun(testutils.Context(t), spec, pipeline.NewVarsFrom(test.vars), logger.TestLogger(t)) + _, taskRunResults, err := runner.ExecuteRun(testutils.Context(t), spec, pipeline.NewVarsFrom(test.vars)) require.NoError(t, err) require.Len(t, taskRunResults, len(p.Tasks)) @@ -367,12 +410,11 @@ func Test_PipelineRunner_CBORParse(t *testing.T) { } vars := pipeline.NewVarsFrom(global) - lggr := logger.TestLogger(t) - _, trrs, err := r.ExecuteRun(testutils.Context(t), spec, vars, lggr) + _, trrs, err := r.ExecuteRun(testutils.Context(t), spec, vars) require.NoError(t, err) require.Len(t, trrs, len(d.Tasks)) - finalResults := trrs.FinalResult(lggr) + finalResults := trrs.FinalResult() require.Len(t, finalResults.Values, 1) assert.Equal(t, make(map[string]interface{}), finalResults.Values[0]) require.Len(t, finalResults.FatalErrors, 1) @@ -395,12 +437,11 @@ func Test_PipelineRunner_CBORParse(t *testing.T) { } vars := pipeline.NewVarsFrom(global) - lggr := logger.TestLogger(t) - _, trrs, err := r.ExecuteRun(testutils.Context(t), spec, vars, lggr) + _, trrs, err := r.ExecuteRun(testutils.Context(t), spec, vars) require.NoError(t, err) require.Len(t, trrs, len(d.Tasks)) - finalResults := trrs.FinalResult(lggr) + finalResults := trrs.FinalResult() require.Len(t, finalResults.Values, 1) assert.Equal(t, "foo", finalResults.Values[0]) require.Len(t, finalResults.FatalErrors, 1) @@ -450,7 +491,7 @@ answer1 [type=median index=0]; spec := pipeline.Spec{DotDagSource: s} vars := pipeline.NewVarsFrom(nil) - _, trrs, err := r.ExecuteRun(ctx, spec, vars, logger.TestLogger(t)) + _, trrs, err := r.ExecuteRun(ctx, spec, vars) require.NoError(t, err) for _, trr := range trrs { if trr.IsTerminal() { @@ -490,8 +531,8 @@ succeed2 -> final; `} vars := pipeline.NewVarsFrom(nil) - _, taskResults, err := r.ExecuteAndInsertFinishedRun(testutils.Context(t), spec, vars, lggr, false) - finalResult := taskResults.FinalResult(lggr) + _, taskResults, err := r.ExecuteAndInsertFinishedRun(testutils.Context(t), spec, vars, false) + finalResult := taskResults.FinalResult() require.NoError(t, err) assert.True(t, finalResult.HasErrors()) assert.False(t, finalResult.HasFatalErrors()) @@ -529,8 +570,8 @@ succeed2 -> final; `} vars := pipeline.NewVarsFrom(nil) - _, taskResults, err := r.ExecuteAndInsertFinishedRun(testutils.Context(t), spec, vars, lggr, false) - finalResult := taskResults.FinalResult(lggr) + _, taskResults, err := r.ExecuteAndInsertFinishedRun(testutils.Context(t), spec, vars, false) + finalResult := taskResults.FinalResult() require.NoError(t, err) assert.True(t, finalResult.HasErrors()) assert.False(t, finalResult.HasFatalErrors()) @@ -544,7 +585,6 @@ func Test_PipelineRunner_MultipleOutputs(t *testing.T) { btORM := bridgesMocks.NewORM(t) r, _ := newRunner(t, db, btORM, cfg) input := map[string]interface{}{"val": 2} - lggr := logger.TestLogger(t) _, trrs, err := r.ExecuteRun(testutils.Context(t), pipeline.Spec{ DotDagSource: ` a [type=multiply input="$(val)" times=2] @@ -553,16 +593,16 @@ b2 [type=multiply input="$(a)" times=3] c [type=median values=<[ $(b1), $(b2) ]> index=0] a->b1->c; a->b2->c;`, - }, pipeline.NewVarsFrom(input), lggr) + }, pipeline.NewVarsFrom(input)) require.NoError(t, err) require.Equal(t, 4, len(trrs)) - assert.Equal(t, false, trrs.FinalResult(lggr).HasFatalErrors()) + assert.Equal(t, false, trrs.FinalResult().HasFatalErrors()) // a = 4 // (b1 = 8) + (b2 = 12) // c = 20 / 2 - result, err := trrs.FinalResult(lggr).SingularResult() + result, err := trrs.FinalResult().SingularResult() require.NoError(t, err) assert.Equal(t, mustDecimal(t, "10").String(), result.Value.(decimal.Decimal).String()) } @@ -572,7 +612,6 @@ func Test_PipelineRunner_MultipleTerminatingOutputs(t *testing.T) { btORM := bridgesMocks.NewORM(t) r, _ := newRunner(t, pgtest.NewSqlxDB(t), btORM, cfg) input := map[string]interface{}{"val": 2} - lggr := logger.TestLogger(t) _, trrs, err := r.ExecuteRun(testutils.Context(t), pipeline.Spec{ DotDagSource: ` a [type=multiply input="$(val)" times=2] @@ -580,10 +619,10 @@ b1 [type=multiply input="$(a)" times=2 index=0] b2 [type=multiply input="$(a)" times=3 index=1] a->b1; a->b2;`, - }, pipeline.NewVarsFrom(input), lggr) + }, pipeline.NewVarsFrom(input)) require.NoError(t, err) require.Equal(t, 3, len(trrs)) - result := trrs.FinalResult(lggr) + result := trrs.FinalResult() assert.Equal(t, false, result.HasFatalErrors()) assert.Equal(t, mustDecimal(t, "8").String(), result.Values[0].(decimal.Decimal).String()) @@ -672,8 +711,7 @@ ds5 [type=http method="GET" url="%s" index=2] run.ID = 1 // give it a valid "id" }).Once() orm.On("StoreRun", mock.Anything, mock.AnythingOfType("*pipeline.Run")).Return(false, nil).Once() - lggr := logger.TestLogger(t) - incomplete, err := r.Run(testutils.Context(t), run, lggr, false, nil) + incomplete, err := r.Run(testutils.Context(t), run, false, nil) require.NoError(t, err) require.Len(t, run.PipelineTaskRuns, 9) // 3 tasks are suspended: ds1_parse, ds1_multiply, median. ds1 is present, but contains ErrPending require.Equal(t, true, incomplete) // still incomplete @@ -682,7 +720,7 @@ ds5 [type=http method="GET" url="%s" index=2] // Trigger run resumption with no new data orm.On("StoreRun", mock.Anything, mock.AnythingOfType("*pipeline.Run")).Return(false, nil).Once() - incomplete, err = r.Run(testutils.Context(t), run, lggr, false, nil) + incomplete, err = r.Run(testutils.Context(t), run, false, nil) require.NoError(t, err) require.Equal(t, true, incomplete) // still incomplete @@ -695,7 +733,7 @@ ds5 [type=http method="GET" url="%s" index=2] } // Trigger run resumption orm.On("StoreRun", mock.Anything, mock.AnythingOfType("*pipeline.Run")).Return(false, nil).Once() - incomplete, err = r.Run(testutils.Context(t), run, lggr, false, nil) + incomplete, err = r.Run(testutils.Context(t), run, false, nil) require.NoError(t, err) require.Equal(t, false, incomplete) // done require.Len(t, run.PipelineTaskRuns, 12) @@ -815,7 +853,7 @@ ds5 [type=http method="GET" url="%s" index=2] }).Once() // StoreRun is called again to store the final result orm.On("StoreRun", mock.Anything, mock.AnythingOfType("*pipeline.Run")).Return(false, nil).Once() - incomplete, err := r.Run(testutils.Context(t), run, logger.TestLogger(t), false, nil) + incomplete, err := r.Run(testutils.Context(t), run, false, nil) require.NoError(t, err) require.Len(t, run.PipelineTaskRuns, 12) require.Equal(t, false, incomplete) // run is complete @@ -849,17 +887,16 @@ func Test_PipelineRunner_LowercaseOutputs(t *testing.T) { "first": "camelCase", "second": "UPPERCASE", } - lggr := logger.TestLogger(t) _, trrs, err := r.ExecuteRun(testutils.Context(t), pipeline.Spec{ DotDagSource: ` a [type=lowercase input="$(first)"] `, - }, pipeline.NewVarsFrom(input), lggr) + }, pipeline.NewVarsFrom(input)) require.NoError(t, err) require.Equal(t, 1, len(trrs)) - assert.Equal(t, false, trrs.FinalResult(lggr).HasFatalErrors()) + assert.Equal(t, false, trrs.FinalResult().HasFatalErrors()) - result, err := trrs.FinalResult(lggr).SingularResult() + result, err := trrs.FinalResult().SingularResult() require.NoError(t, err) assert.Equal(t, "camelcase", result.Value.(string)) } @@ -872,17 +909,16 @@ func Test_PipelineRunner_UppercaseOutputs(t *testing.T) { input := map[string]interface{}{ "first": "somerAnDomTEST", } - lggr := logger.TestLogger(t) _, trrs, err := r.ExecuteRun(testutils.Context(t), pipeline.Spec{ DotDagSource: ` a [type=uppercase input="$(first)"] `, - }, pipeline.NewVarsFrom(input), lggr) + }, pipeline.NewVarsFrom(input)) require.NoError(t, err) require.Equal(t, 1, len(trrs)) - assert.Equal(t, false, trrs.FinalResult(lggr).HasFatalErrors()) + assert.Equal(t, false, trrs.FinalResult().HasFatalErrors()) - result, err := trrs.FinalResult(lggr).SingularResult() + result, err := trrs.FinalResult().SingularResult() require.NoError(t, err) assert.Equal(t, "SOMERANDOMTEST", result.Value.(string)) } @@ -895,17 +931,16 @@ func Test_PipelineRunner_HexDecodeOutputs(t *testing.T) { input := map[string]interface{}{ "astring": "0x12345678", } - lggr := logger.TestLogger(t) _, trrs, err := r.ExecuteRun(testutils.Context(t), pipeline.Spec{ DotDagSource: ` a [type=hexdecode input="$(astring)"] `, - }, pipeline.NewVarsFrom(input), lggr) + }, pipeline.NewVarsFrom(input)) require.NoError(t, err) require.Equal(t, 1, len(trrs)) - assert.Equal(t, false, trrs.FinalResult(lggr).HasFatalErrors()) + assert.Equal(t, false, trrs.FinalResult().HasFatalErrors()) - result, err := trrs.FinalResult(lggr).SingularResult() + result, err := trrs.FinalResult().SingularResult() require.NoError(t, err) assert.Equal(t, []byte{0x12, 0x34, 0x56, 0x78}, result.Value) } @@ -919,19 +954,18 @@ func Test_PipelineRunner_HexEncodeAndDecode(t *testing.T) { input := map[string]interface{}{ "input_val": inputBytes, } - lggr := logger.TestLogger(t) _, trrs, err := r.ExecuteRun(testutils.Context(t), pipeline.Spec{ DotDagSource: ` en [type=hexencode input="$(input_val)"] de [type=hexdecode] en->de `, - }, pipeline.NewVarsFrom(input), lggr) + }, pipeline.NewVarsFrom(input)) require.NoError(t, err) require.Equal(t, 2, len(trrs)) - assert.Equal(t, false, trrs.FinalResult(lggr).HasFatalErrors()) + assert.Equal(t, false, trrs.FinalResult().HasFatalErrors()) - result, err := trrs.FinalResult(lggr).SingularResult() + result, err := trrs.FinalResult().SingularResult() require.NoError(t, err) assert.Equal(t, inputBytes, result.Value) } @@ -944,17 +978,16 @@ func Test_PipelineRunner_Base64DecodeOutputs(t *testing.T) { input := map[string]interface{}{ "astring": "SGVsbG8sIHBsYXlncm91bmQ=", } - lggr := logger.TestLogger(t) _, trrs, err := r.ExecuteRun(testutils.Context(t), pipeline.Spec{ DotDagSource: ` a [type=base64decode input="$(astring)"] `, - }, pipeline.NewVarsFrom(input), lggr) + }, pipeline.NewVarsFrom(input)) require.NoError(t, err) require.Equal(t, 1, len(trrs)) - assert.Equal(t, false, trrs.FinalResult(lggr).HasFatalErrors()) + assert.Equal(t, false, trrs.FinalResult().HasFatalErrors()) - result, err := trrs.FinalResult(lggr).SingularResult() + result, err := trrs.FinalResult().SingularResult() require.NoError(t, err) assert.Equal(t, []byte("Hello, playground"), result.Value) } @@ -968,19 +1001,18 @@ func Test_PipelineRunner_Base64EncodeAndDecode(t *testing.T) { input := map[string]interface{}{ "input_val": inputBytes, } - lggr := logger.TestLogger(t) _, trrs, err := r.ExecuteRun(testutils.Context(t), pipeline.Spec{ DotDagSource: ` en [type=base64encode input="$(input_val)"] de [type=base64decode] en->de `, - }, pipeline.NewVarsFrom(input), lggr) + }, pipeline.NewVarsFrom(input)) require.NoError(t, err) require.Equal(t, 2, len(trrs)) - assert.Equal(t, false, trrs.FinalResult(lggr).HasFatalErrors()) + assert.Equal(t, false, trrs.FinalResult().HasFatalErrors()) - result, err := trrs.FinalResult(lggr).SingularResult() + result, err := trrs.FinalResult().SingularResult() require.NoError(t, err) assert.Equal(t, inputBytes, result.Value) } @@ -1003,7 +1035,7 @@ succeed; spec := pipeline.Spec{DotDagSource: fmt.Sprintf(template, 1)} vars := pipeline.NewVarsFrom(nil) - _, trrs, err := r.ExecuteRun(testutils.Context(t), spec, vars, lggr) + _, trrs, err := r.ExecuteRun(testutils.Context(t), spec, vars) require.NoError(t, err) require.Len(t, trrs, 1) assert.Equal(t, "1", trrs[0].Result.Value.(pipeline.ObjectParam).DecimalValue.Decimal().String()) @@ -1018,7 +1050,7 @@ succeed; // even though this is set to 2, it should use the cached version spec.DotDagSource = fmt.Sprintf(template, 2) - _, trrs, err = r.ExecuteRun(testutils.Context(t), spec, vars, lggr) + _, trrs, err = r.ExecuteRun(testutils.Context(t), spec, vars) require.NoError(t, err) require.Len(t, trrs, 1) assert.Equal(t, "1", trrs[0].Result.Value.(pipeline.ObjectParam).DecimalValue.Decimal().String()) diff --git a/core/services/pipeline/task.base.go b/core/services/pipeline/task.base.go index 7a62f4e7ff8..3e1db5fcdb5 100644 --- a/core/services/pipeline/task.base.go +++ b/core/services/pipeline/task.base.go @@ -22,6 +22,8 @@ type BaseTask struct { MinBackoff time.Duration `mapstructure:"minBackoff"` MaxBackoff time.Duration `mapstructure:"maxBackoff"` + Tags string `mapstructure:"tags" json:"-"` + uuid uuid.UUID } @@ -77,3 +79,32 @@ func (t BaseTask) TaskMaxBackoff() time.Duration { } return time.Minute } + +func (t BaseTask) TaskTags() string { + return t.Tags +} + +// GetDescendantTasks retrieves all descendant tasks of a given task +func (t BaseTask) GetDescendantTasks() []Task { + if len(t.outputs) == 0 { + return []Task{} + } + var descendants []Task + queue := append([]Task{}, t.outputs...) + visited := make(map[int]bool) + + for len(queue) > 0 { + currentTask := queue[0] + queue = queue[1:] + + taskID := currentTask.ID() + if visited[taskID] { + continue + } + visited[taskID] = true + descendants = append(descendants, currentTask) + queue = append(queue, currentTask.Outputs()...) + } + + return descendants +} diff --git a/core/services/pipeline/task.bridge.go b/core/services/pipeline/task.bridge.go index 103e5664666..8289b283c08 100644 --- a/core/services/pipeline/task.bridge.go +++ b/core/services/pipeline/task.bridge.go @@ -16,7 +16,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/bridges" "github.com/smartcontractkit/chainlink/v2/core/logger" - "github.com/smartcontractkit/chainlink/v2/core/services/pipeline/internal/eautils" + "github.com/smartcontractkit/chainlink/v2/core/services/pipeline/eautils" ) // NOTE: These metrics generate a new label per bridge, this should be safe @@ -178,6 +178,10 @@ func (t *BridgeTask) Run(ctx context.Context, lggr logger.Logger, vars Vars, inp } if err != nil || statusCode != http.StatusOK { + if adapterErr := eautils.BestEffortExtractEAError(responseBytes); adapterErr != nil { + err = adapterErr + } + promBridgeErrors.WithLabelValues(t.Name).Inc() if cacheTTL == 0 { return Result{Error: err}, RunInfo{IsRetryable: isRetryableHTTPError(statusCode, err)} diff --git a/core/services/pipeline/task.bridge_test.go b/core/services/pipeline/task.bridge_test.go index 2efff2af6b6..cd81f8656fd 100644 --- a/core/services/pipeline/task.bridge_test.go +++ b/core/services/pipeline/task.bridge_test.go @@ -23,6 +23,7 @@ import ( commonconfig "github.com/smartcontractkit/chainlink-common/pkg/config" "github.com/smartcontractkit/chainlink-common/pkg/services/servicetest" + "github.com/smartcontractkit/chainlink/v2/core/bridges" "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" @@ -32,7 +33,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" "github.com/smartcontractkit/chainlink/v2/core/services/pipeline" - "github.com/smartcontractkit/chainlink/v2/core/services/pipeline/internal/eautils" + "github.com/smartcontractkit/chainlink/v2/core/services/pipeline/eautils" "github.com/smartcontractkit/chainlink/v2/core/store/models" "github.com/smartcontractkit/chainlink/v2/core/utils" ) @@ -116,6 +117,18 @@ func mustReadFile(t testing.TB, file string) string { return string(content) } +// NewMockHandler returns an http.HandlerFunc that responds with the given payload for any request +func NewMockHandler(payload string) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + _, err := w.Write([]byte(payload)) + if err != nil { + http.Error(w, "Failed to write response", http.StatusInternalServerError) + } + } +} + func fakePriceResponder(t *testing.T, requestData map[string]interface{}, result decimal.Decimal, inputKey string, expectedInput interface{}) http.Handler { t.Helper() @@ -1088,12 +1101,6 @@ func TestBridgeTask_AdapterResponseStatusFailure(t *testing.T) { require.NoError(t, err) task.HelperSetDependencies(cfg.JobPipeline(), cfg.WebServer(), orm, specID, uuid.UUID{}, c) - // Insert entry 1m in the past, stale value, should not be used in case of EA failure. - _, err = db.ExecContext(ctx, `INSERT INTO bridge_last_value(dot_id, spec_id, value, finished_at) - VALUES($1, $2, $3, $4) ON CONFLICT ON CONSTRAINT bridge_last_value_pkey - DO UPDATE SET value = $3, finished_at = $4;`, task.DotID(), specID, big.NewInt(9700).Bytes(), time.Now()) - require.NoError(t, err) - vars := pipeline.NewVarsFrom( map[string]interface{}{ "jobRun": map[string]interface{}{ @@ -1104,9 +1111,27 @@ func TestBridgeTask_AdapterResponseStatusFailure(t *testing.T) { }, ) + testAdapterResponse.SetStatusCode(http.StatusInternalServerError) + testAdapterResponse.Error = map[string]interface{}{ + "name": "AdapterLWBAError", + "message": "bid ask violation detected", + } + result, runInfo := task.Run(ctx, logger.TestLogger(t), vars, nil) + + require.ErrorContains(t, result.Error, "AdapterLWBAError: bid ask violation detected") + require.Nil(t, result.Value) + require.True(t, runInfo.IsRetryable) + require.False(t, runInfo.IsPending) + + // Insert entry 1m in the past, stale value, should not be used in case of EA failure. + _, err = db.ExecContext(ctx, `INSERT INTO bridge_last_value(dot_id, spec_id, value, finished_at) + VALUES($1, $2, $3, $4) ON CONFLICT ON CONSTRAINT bridge_last_value_pkey + DO UPDATE SET value = $3, finished_at = $4;`, task.DotID(), specID, big.NewInt(9700).Bytes(), time.Now()) + require.NoError(t, err) + // expect all external adapter response status failures to be served from the cache testAdapterResponse.SetStatusCode(http.StatusBadRequest) - result, runInfo := task.Run(ctx, logger.TestLogger(t), vars, nil) + result, runInfo = task.Run(ctx, logger.TestLogger(t), vars, nil) require.NoError(t, result.Error) require.NotNil(t, result.Value) @@ -1211,3 +1236,47 @@ func TestBridgeTask_AdapterTimeout(t *testing.T) { require.False(t, runInfo.IsPending) }) } + +func TestBridgeTask_PipelineAdapterLWBAError(t *testing.T) { + t.Parallel() + + dag := ` +ds [type=bridge name="adapter-error-bridge" timeout="50ms" requestData="{\"data\":{\"from\":\"ETH\",\"to\":\"USD\"}}"]; +` + + ctx := testutils.Context(t) + db := pgtest.NewSqlxDB(t) + cfg := configtest.NewTestGeneralConfig(t) + orm := bridges.NewORM(db) + r, _ := newRunner(t, db, orm, cfg) + + bridge := httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) { + b, herr := io.ReadAll(req.Body) + require.NoError(t, herr) + require.Equal(t, `{"data":{"from":"ETH","to":"USD"}}`, string(b)) + + res.WriteHeader(http.StatusInternalServerError) + resp := `{"error": {"name":"AdapterLWBAError", "message": "bid ask violation detected"}}` + _, herr = res.Write([]byte(resp)) + require.NoError(t, herr) + })) + t.Cleanup(bridge.Close) + u, _ := url.Parse(bridge.URL) + require.NoError(t, orm.CreateBridgeType(ctx, &bridges.BridgeType{ + Name: "adapter-error-bridge", + URL: models.WebURL(*u), + })) + + spec := pipeline.Spec{DotDagSource: dag} + vars := pipeline.NewVarsFrom(nil) + + _, trrs, err := r.ExecuteRun(ctx, spec, vars) + + require.NoError(t, err) + require.Len(t, trrs, 1) + + finalResult := trrs[0] + + require.ErrorContains(t, finalResult.Result.Error, "AdapterLWBAError: bid ask violation detected") + require.Nil(t, finalResult.Result.Value) +} diff --git a/core/services/pipeline/task.divide_test.go b/core/services/pipeline/task.divide_test.go index 8eb8e4de063..e13f4512794 100644 --- a/core/services/pipeline/task.divide_test.go +++ b/core/services/pipeline/task.divide_test.go @@ -220,8 +220,7 @@ ds1 -> div_by_ds2 -> multiply; spec := pipeline.Spec{DotDagSource: dag} vars := pipeline.NewVarsFrom(nil) - lggr := logger.TestLogger(t) - _, trrs, err := r.ExecuteRun(testutils.Context(t), spec, vars, lggr) + _, trrs, err := r.ExecuteRun(testutils.Context(t), spec, vars) require.NoError(t, err) require.Len(t, trrs, 4) diff --git a/core/services/pipeline/task.eth_abi_decode_test.go b/core/services/pipeline/task.eth_abi_decode_test.go index 3c7f5b4776b..565e8b485dd 100644 --- a/core/services/pipeline/task.eth_abi_decode_test.go +++ b/core/services/pipeline/task.eth_abi_decode_test.go @@ -25,6 +25,20 @@ var testsABIDecode = []struct { expectedErrorCause error expectedErrorContains string }{ + { + "uint256", + "uint256 data", + "$(data)", + NewVarsFrom(map[string]interface{}{ + "data": "0x000000000000000000000000000000000000000000000000105ba6a589b23a81", + }), + nil, + map[string]interface{}{ + "data": big.NewInt(1178718957397490305), + }, + nil, + "", + }, { "uint256, bool, int256, string", "uint256 u, bool b, int256 i, string s", diff --git a/core/services/pipeline/task.eth_tx.go b/core/services/pipeline/task.eth_tx.go index 964591cacd2..506a2518f76 100644 --- a/core/services/pipeline/task.eth_tx.go +++ b/core/services/pipeline/task.eth_tx.go @@ -8,13 +8,14 @@ import ( "strconv" "github.com/ethereum/go-ethereum/common" - "github.com/mitchellh/mapstructure" + "github.com/go-viper/mapstructure/v2" "github.com/pkg/errors" "go.uber.org/multierr" "gopkg.in/guregu/null.v4" "github.com/smartcontractkit/chainlink-common/pkg/utils/hex" clnull "github.com/smartcontractkit/chainlink-common/pkg/utils/null" + txmgrcommon "github.com/smartcontractkit/chainlink/v2/common/txmgr" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/txmgr" "github.com/smartcontractkit/chainlink/v2/core/chains/legacyevm" diff --git a/core/services/pipeline/task_params.go b/core/services/pipeline/task_params.go index 12582f6ef49..c44fd122e9e 100644 --- a/core/services/pipeline/task_params.go +++ b/core/services/pipeline/task_params.go @@ -17,8 +17,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/utils" ) -//go:generate mockery --quiet --name PipelineParamUnmarshaler --output ./mocks/ --case=underscore - type PipelineParamUnmarshaler interface { UnmarshalPipelineParam(val interface{}) error } diff --git a/core/services/promreporter/prom_reporter.go b/core/services/promreporter/prom_reporter.go deleted file mode 100644 index 92e674aac44..00000000000 --- a/core/services/promreporter/prom_reporter.go +++ /dev/null @@ -1,274 +0,0 @@ -package promreporter - -import ( - "context" - "fmt" - "math/big" - "sync" - "time" - - "github.com/smartcontractkit/chainlink-common/pkg/sqlutil" - txmgrcommon "github.com/smartcontractkit/chainlink/v2/common/txmgr" - "github.com/smartcontractkit/chainlink/v2/core/chains/evm/txmgr" - - "github.com/pkg/errors" - "github.com/prometheus/client_golang/prometheus" - "github.com/prometheus/client_golang/prometheus/promauto" - "go.uber.org/multierr" - - "github.com/smartcontractkit/chainlink-common/pkg/services" - "github.com/smartcontractkit/chainlink-common/pkg/utils/mailbox" - - evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" - "github.com/smartcontractkit/chainlink/v2/core/chains/legacyevm" - "github.com/smartcontractkit/chainlink/v2/core/logger" -) - -//go:generate mockery --quiet --name PrometheusBackend --output ../../internal/mocks/ --case=underscore -type ( - promReporter struct { - services.StateMachine - ds sqlutil.DataSource - chains legacyevm.LegacyChainContainer - lggr logger.Logger - backend PrometheusBackend - newHeads *mailbox.Mailbox[*evmtypes.Head] - chStop services.StopChan - wgDone sync.WaitGroup - reportPeriod time.Duration - } - - PrometheusBackend interface { - SetUnconfirmedTransactions(*big.Int, int64) - SetMaxUnconfirmedAge(*big.Int, float64) - SetMaxUnconfirmedBlocks(*big.Int, int64) - SetPipelineRunsQueued(n int) - SetPipelineTaskRunsQueued(n int) - } - - defaultBackend struct{} -) - -var ( - promUnconfirmedTransactions = promauto.NewGaugeVec(prometheus.GaugeOpts{ - Name: "unconfirmed_transactions", - Help: "Number of currently unconfirmed transactions", - }, []string{"evmChainID"}) - promMaxUnconfirmedAge = promauto.NewGaugeVec(prometheus.GaugeOpts{ - Name: "max_unconfirmed_tx_age", - Help: "The length of time the oldest unconfirmed transaction has been in that state (in seconds). Will be 0 if there are no unconfirmed transactions.", - }, []string{"evmChainID"}) - promMaxUnconfirmedBlocks = promauto.NewGaugeVec(prometheus.GaugeOpts{ - Name: "max_unconfirmed_blocks", - Help: "The max number of blocks any currently unconfirmed transaction has been unconfirmed for", - }, []string{"evmChainID"}) - promPipelineRunsQueued = promauto.NewGauge(prometheus.GaugeOpts{ - Name: "pipeline_runs_queued", - Help: "The total number of pipeline runs that are awaiting execution", - }) - promPipelineTaskRunsQueued = promauto.NewGauge(prometheus.GaugeOpts{ - Name: "pipeline_task_runs_queued", - Help: "The total number of pipeline task runs that are awaiting execution", - }) -) - -func (defaultBackend) SetUnconfirmedTransactions(evmChainID *big.Int, n int64) { - promUnconfirmedTransactions.WithLabelValues(evmChainID.String()).Set(float64(n)) -} - -func (defaultBackend) SetMaxUnconfirmedAge(evmChainID *big.Int, s float64) { - promMaxUnconfirmedAge.WithLabelValues(evmChainID.String()).Set(s) -} - -func (defaultBackend) SetMaxUnconfirmedBlocks(evmChainID *big.Int, n int64) { - promMaxUnconfirmedBlocks.WithLabelValues(evmChainID.String()).Set(float64(n)) -} - -func (defaultBackend) SetPipelineRunsQueued(n int) { - promPipelineTaskRunsQueued.Set(float64(n)) -} - -func (defaultBackend) SetPipelineTaskRunsQueued(n int) { - promPipelineRunsQueued.Set(float64(n)) -} - -func NewPromReporter(ds sqlutil.DataSource, chainContainer legacyevm.LegacyChainContainer, lggr logger.Logger, opts ...interface{}) *promReporter { - var backend PrometheusBackend = defaultBackend{} - period := 15 * time.Second - for _, opt := range opts { - switch v := opt.(type) { - case time.Duration: - period = v - case PrometheusBackend: - backend = v - } - } - - chStop := make(chan struct{}) - return &promReporter{ - ds: ds, - chains: chainContainer, - lggr: lggr.Named("PromReporter"), - backend: backend, - newHeads: mailbox.NewSingle[*evmtypes.Head](), - chStop: chStop, - reportPeriod: period, - } -} - -// Start starts PromReporter. -func (pr *promReporter) Start(context.Context) error { - return pr.StartOnce("PromReporter", func() error { - pr.wgDone.Add(1) - go pr.eventLoop() - return nil - }) -} - -func (pr *promReporter) Close() error { - return pr.StopOnce("PromReporter", func() error { - close(pr.chStop) - pr.wgDone.Wait() - return nil - }) -} -func (pr *promReporter) Name() string { - return pr.lggr.Name() -} - -func (pr *promReporter) HealthReport() map[string]error { - return map[string]error{pr.Name(): pr.Healthy()} -} - -func (pr *promReporter) OnNewLongestChain(ctx context.Context, head *evmtypes.Head) { - pr.newHeads.Deliver(head) -} - -func (pr *promReporter) eventLoop() { - pr.lggr.Debug("Starting event loop") - defer pr.wgDone.Done() - ctx, cancel := pr.chStop.NewCtx() - defer cancel() - for { - select { - case <-pr.newHeads.Notify(): - head, exists := pr.newHeads.Retrieve() - if !exists { - continue - } - pr.reportHeadMetrics(ctx, head) - case <-time.After(pr.reportPeriod): - if err := errors.Wrap(pr.reportPipelineRunStats(ctx), "reportPipelineRunStats failed"); err != nil { - pr.lggr.Errorw("Error reporting prometheus metrics", "err", err) - } - - case <-pr.chStop: - return - } - } -} - -func (pr *promReporter) getTxm(evmChainID *big.Int) (txmgr.TxManager, error) { - chain, err := pr.chains.Get(evmChainID.String()) - if err != nil { - return nil, fmt.Errorf("failed to get chain: %w", err) - } - return chain.TxManager(), nil -} - -func (pr *promReporter) reportHeadMetrics(ctx context.Context, head *evmtypes.Head) { - evmChainID := head.EVMChainID.ToInt() - err := multierr.Combine( - errors.Wrap(pr.reportPendingEthTxes(ctx, evmChainID), "reportPendingEthTxes failed"), - errors.Wrap(pr.reportMaxUnconfirmedAge(ctx, evmChainID), "reportMaxUnconfirmedAge failed"), - errors.Wrap(pr.reportMaxUnconfirmedBlocks(ctx, head), "reportMaxUnconfirmedBlocks failed"), - ) - - if err != nil && ctx.Err() == nil { - pr.lggr.Errorw("Error reporting prometheus metrics", "err", err) - } -} - -func (pr *promReporter) reportPendingEthTxes(ctx context.Context, evmChainID *big.Int) (err error) { - txm, err := pr.getTxm(evmChainID) - if err != nil { - return fmt.Errorf("failed to get txm: %w", err) - } - - unconfirmed, err := txm.CountTransactionsByState(ctx, txmgrcommon.TxUnconfirmed) - if err != nil { - return fmt.Errorf("failed to query for unconfirmed eth_tx count: %w", err) - } - pr.backend.SetUnconfirmedTransactions(evmChainID, int64(unconfirmed)) - return nil -} - -func (pr *promReporter) reportMaxUnconfirmedAge(ctx context.Context, evmChainID *big.Int) (err error) { - txm, err := pr.getTxm(evmChainID) - if err != nil { - return fmt.Errorf("failed to get txm: %w", err) - } - - broadcastAt, err := txm.FindEarliestUnconfirmedBroadcastTime(ctx) - if err != nil { - return fmt.Errorf("failed to query for min broadcast time: %w", err) - } - - var seconds float64 - if broadcastAt.Valid { - seconds = time.Since(broadcastAt.ValueOrZero()).Seconds() - } - pr.backend.SetMaxUnconfirmedAge(evmChainID, seconds) - return nil -} - -func (pr *promReporter) reportMaxUnconfirmedBlocks(ctx context.Context, head *evmtypes.Head) (err error) { - txm, err := pr.getTxm(head.EVMChainID.ToInt()) - if err != nil { - return fmt.Errorf("failed to get txm: %w", err) - } - - earliestUnconfirmedTxBlock, err := txm.FindEarliestUnconfirmedTxAttemptBlock(ctx) - if err != nil { - return fmt.Errorf("failed to query for earliest unconfirmed tx block: %w", err) - } - - var blocksUnconfirmed int64 - if !earliestUnconfirmedTxBlock.IsZero() { - blocksUnconfirmed = head.Number - earliestUnconfirmedTxBlock.ValueOrZero() - } - pr.backend.SetMaxUnconfirmedBlocks(head.EVMChainID.ToInt(), blocksUnconfirmed) - return nil -} - -func (pr *promReporter) reportPipelineRunStats(ctx context.Context) (err error) { - rows, err := pr.ds.QueryContext(ctx, ` -SELECT pipeline_run_id FROM pipeline_task_runs WHERE finished_at IS NULL -`) - if err != nil { - return errors.Wrap(err, "failed to query for pipeline_run_id") - } - defer func() { - err = multierr.Combine(err, rows.Close()) - }() - - pipelineTaskRunsQueued := 0 - pipelineRunsQueuedSet := make(map[int32]struct{}) - for rows.Next() { - var pipelineRunID int32 - if err = rows.Scan(&pipelineRunID); err != nil { - return errors.Wrap(err, "unexpected error scanning row") - } - pipelineTaskRunsQueued++ - pipelineRunsQueuedSet[pipelineRunID] = struct{}{} - } - if err = rows.Err(); err != nil { - return err - } - pipelineRunsQueued := len(pipelineRunsQueuedSet) - - pr.backend.SetPipelineTaskRunsQueued(pipelineTaskRunsQueued) - pr.backend.SetPipelineRunsQueued(pipelineRunsQueued) - - return nil -} diff --git a/core/services/promreporter/prom_reporter_test.go b/core/services/promreporter/prom_reporter_test.go deleted file mode 100644 index b61fa25bdc4..00000000000 --- a/core/services/promreporter/prom_reporter_test.go +++ /dev/null @@ -1,162 +0,0 @@ -package promreporter_test - -import ( - "math/big" - "sync/atomic" - "testing" - "time" - - "github.com/jmoiron/sqlx" - "github.com/stretchr/testify/mock" - "github.com/stretchr/testify/require" - - "github.com/smartcontractkit/chainlink-common/pkg/services/servicetest" - - "github.com/smartcontractkit/chainlink/v2/core/chains/evm/gas" - "github.com/smartcontractkit/chainlink/v2/core/chains/evm/headtracker" - "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" - "github.com/smartcontractkit/chainlink/v2/core/chains/evm/txmgr" - evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" - ubig "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils/big" - "github.com/smartcontractkit/chainlink/v2/core/chains/legacyevm" - "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" - "github.com/smartcontractkit/chainlink/v2/core/internal/mocks" - "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" - "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/configtest" - "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/evmtest" - "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/pgtest" - "github.com/smartcontractkit/chainlink/v2/core/logger" - "github.com/smartcontractkit/chainlink/v2/core/services/promreporter" -) - -func newHead() evmtypes.Head { - return evmtypes.Head{Number: 42, EVMChainID: ubig.NewI(0)} -} - -func newLegacyChainContainer(t *testing.T, db *sqlx.DB) legacyevm.LegacyChainContainer { - config, dbConfig, evmConfig := txmgr.MakeTestConfigs(t) - keyStore := cltest.NewKeyStore(t, db).Eth() - ethClient := evmtest.NewEthClientMockWithDefaultChain(t) - estimator, err := gas.NewEstimator(logger.TestLogger(t), ethClient, config, evmConfig.GasEstimator()) - require.NoError(t, err) - lggr := logger.TestLogger(t) - lpOpts := logpoller.Opts{ - PollPeriod: 100 * time.Millisecond, - FinalityDepth: 2, - BackfillBatchSize: 3, - RpcBatchSize: 2, - KeepFinalizedBlocksDepth: 1000, - } - ht := headtracker.NewSimulatedHeadTracker(ethClient, lpOpts.UseFinalityTag, lpOpts.FinalityDepth) - lp := logpoller.NewLogPoller(logpoller.NewORM(testutils.FixtureChainID, db, lggr), ethClient, lggr, ht, lpOpts) - - txm, err := txmgr.NewTxm( - db, - evmConfig, - evmConfig.GasEstimator(), - evmConfig.Transactions(), - nil, - dbConfig, - dbConfig.Listener(), - ethClient, - lggr, - lp, - keyStore, - estimator) - require.NoError(t, err) - - cfg := configtest.NewGeneralConfig(t, nil) - return cltest.NewLegacyChainsWithMockChainAndTxManager(t, ethClient, cfg, txm) -} - -func Test_PromReporter_OnNewLongestChain(t *testing.T) { - t.Run("with nothing in the database", func(t *testing.T) { - db := pgtest.NewSqlxDB(t) - - backend := mocks.NewPrometheusBackend(t) - reporter := promreporter.NewPromReporter(db, newLegacyChainContainer(t, db), logger.TestLogger(t), backend, 10*time.Millisecond) - - var subscribeCalls atomic.Int32 - - backend.On("SetUnconfirmedTransactions", big.NewInt(0), int64(0)).Return() - backend.On("SetMaxUnconfirmedAge", big.NewInt(0), float64(0)).Return() - backend.On("SetMaxUnconfirmedBlocks", big.NewInt(0), int64(0)).Return() - backend.On("SetPipelineTaskRunsQueued", 0).Return() - backend.On("SetPipelineRunsQueued", 0). - Run(func(args mock.Arguments) { - subscribeCalls.Add(1) - }). - Return() - - servicetest.Run(t, reporter) - - head := newHead() - reporter.OnNewLongestChain(testutils.Context(t), &head) - - require.Eventually(t, func() bool { return subscribeCalls.Load() >= 1 }, 12*time.Second, 100*time.Millisecond) - }) - - t.Run("with unconfirmed evm.txes", func(t *testing.T) { - db := pgtest.NewSqlxDB(t) - txStore := cltest.NewTestTxStore(t, db) - ethKeyStore := cltest.NewKeyStore(t, db).Eth() - _, fromAddress := cltest.MustInsertRandomKey(t, ethKeyStore) - - var subscribeCalls atomic.Int32 - - backend := mocks.NewPrometheusBackend(t) - backend.On("SetUnconfirmedTransactions", big.NewInt(0), int64(3)).Return() - backend.On("SetMaxUnconfirmedAge", big.NewInt(0), mock.MatchedBy(func(s float64) bool { - return s > 0 - })).Return() - backend.On("SetMaxUnconfirmedBlocks", big.NewInt(0), int64(35)).Return() - backend.On("SetPipelineTaskRunsQueued", 0).Return() - backend.On("SetPipelineRunsQueued", 0). - Run(func(args mock.Arguments) { - subscribeCalls.Add(1) - }). - Return() - reporter := promreporter.NewPromReporter(db, newLegacyChainContainer(t, db), logger.TestLogger(t), backend, 10*time.Millisecond) - servicetest.Run(t, reporter) - - etx := cltest.MustInsertUnconfirmedEthTxWithBroadcastLegacyAttempt(t, txStore, 0, fromAddress) - cltest.MustInsertUnconfirmedEthTxWithBroadcastLegacyAttempt(t, txStore, 1, fromAddress) - cltest.MustInsertUnconfirmedEthTxWithBroadcastLegacyAttempt(t, txStore, 2, fromAddress) - require.NoError(t, txStore.UpdateTxAttemptBroadcastBeforeBlockNum(testutils.Context(t), etx.ID, 7)) - - head := newHead() - reporter.OnNewLongestChain(testutils.Context(t), &head) - - require.Eventually(t, func() bool { return subscribeCalls.Load() >= 1 }, 12*time.Second, 100*time.Millisecond) - }) - - t.Run("with unfinished pipeline task runs", func(t *testing.T) { - db := pgtest.NewSqlxDB(t) - pgtest.MustExec(t, db, `SET CONSTRAINTS pipeline_task_runs_pipeline_run_id_fkey DEFERRED`) - - backend := mocks.NewPrometheusBackend(t) - reporter := promreporter.NewPromReporter(db, newLegacyChainContainer(t, db), logger.TestLogger(t), backend, 10*time.Millisecond) - - cltest.MustInsertUnfinishedPipelineTaskRun(t, db, 1) - cltest.MustInsertUnfinishedPipelineTaskRun(t, db, 1) - cltest.MustInsertUnfinishedPipelineTaskRun(t, db, 2) - - var subscribeCalls atomic.Int32 - - backend.On("SetUnconfirmedTransactions", big.NewInt(0), int64(0)).Return() - backend.On("SetMaxUnconfirmedAge", big.NewInt(0), float64(0)).Return() - backend.On("SetMaxUnconfirmedBlocks", big.NewInt(0), int64(0)).Return() - backend.On("SetPipelineTaskRunsQueued", 3).Return() - backend.On("SetPipelineRunsQueued", 2). - Run(func(args mock.Arguments) { - subscribeCalls.Add(1) - }). - Return() - servicetest.Run(t, reporter) - - head := newHead() - reporter.OnNewLongestChain(testutils.Context(t), &head) - - require.Eventually(t, func() bool { return subscribeCalls.Load() >= 1 }, 12*time.Second, 100*time.Millisecond) - }) -} diff --git a/core/services/registrysyncer/local_registry.go b/core/services/registrysyncer/local_registry.go new file mode 100644 index 00000000000..d4bf4a49f53 --- /dev/null +++ b/core/services/registrysyncer/local_registry.go @@ -0,0 +1,104 @@ +package registrysyncer + +import ( + "context" + "errors" + "fmt" + + "github.com/smartcontractkit/chainlink-common/pkg/capabilities" + + kcr "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/capabilities_registry" + "github.com/smartcontractkit/chainlink/v2/core/logger" + p2ptypes "github.com/smartcontractkit/chainlink/v2/core/services/p2p/types" +) + +type DonID uint32 + +type DON struct { + capabilities.DON + CapabilityConfigurations map[string]CapabilityConfiguration +} + +type CapabilityConfiguration struct { + Config []byte +} + +type Capability struct { + ID string + CapabilityType capabilities.CapabilityType +} + +type LocalRegistry struct { + lggr logger.Logger + getPeerID func() (p2ptypes.PeerID, error) + IDsToDONs map[DonID]DON + IDsToNodes map[p2ptypes.PeerID]kcr.CapabilitiesRegistryNodeInfo + IDsToCapabilities map[string]Capability +} + +func NewLocalRegistry( + lggr logger.Logger, + getPeerID func() (p2ptypes.PeerID, error), + IDsToDONs map[DonID]DON, + IDsToNodes map[p2ptypes.PeerID]kcr.CapabilitiesRegistryNodeInfo, + IDsToCapabilities map[string]Capability, +) LocalRegistry { + return LocalRegistry{ + lggr: lggr.Named("LocalRegistry"), + getPeerID: getPeerID, + IDsToDONs: IDsToDONs, + IDsToNodes: IDsToNodes, + IDsToCapabilities: IDsToCapabilities, + } +} + +func (l *LocalRegistry) LocalNode(ctx context.Context) (capabilities.Node, error) { + // Load the current nodes PeerWrapper, this gets us the current node's + // PeerID, allowing us to contextualize registry information in terms of DON ownership + // (eg. get my current DON configuration, etc). + pid, err := l.getPeerID() + if err != nil { + return capabilities.Node{}, errors.New("unable to get local node: peerWrapper hasn't started yet") + } + + var workflowDON capabilities.DON + capabilityDONs := []capabilities.DON{} + for _, d := range l.IDsToDONs { + for _, p := range d.Members { + if p == pid { + if d.AcceptsWorkflows { + // The CapabilitiesRegistry enforces that the DON ID is strictly + // greater than 0, so if the ID is 0, it means we've not set `workflowDON` initialized above yet. + if workflowDON.ID == 0 { + workflowDON = d.DON + l.lggr.Debug("Workflow DON identified: %+v", workflowDON) + } else { + l.lggr.Errorf("Configuration error: node %s belongs to more than one workflowDON", pid) + } + } + + capabilityDONs = append(capabilityDONs, d.DON) + } + } + } + + return capabilities.Node{ + PeerID: &pid, + WorkflowDON: workflowDON, + CapabilityDONs: capabilityDONs, + }, nil +} + +func (l *LocalRegistry) ConfigForCapability(ctx context.Context, capabilityID string, donID uint32) (CapabilityConfiguration, error) { + d, ok := l.IDsToDONs[DonID(donID)] + if !ok { + return CapabilityConfiguration{}, fmt.Errorf("could not find don %d", donID) + } + + cc, ok := d.CapabilityConfigurations[capabilityID] + if !ok { + return CapabilityConfiguration{}, fmt.Errorf("could not find capability configuration for capability %s and donID %d", capabilityID, donID) + } + + return cc, nil +} diff --git a/core/services/registrysyncer/mocks/orm.go b/core/services/registrysyncer/mocks/orm.go new file mode 100644 index 00000000000..d7777ecb6e4 --- /dev/null +++ b/core/services/registrysyncer/mocks/orm.go @@ -0,0 +1,142 @@ +// Code generated by mockery v2.43.2. DO NOT EDIT. + +package mocks + +import ( + context "context" + + registrysyncer "github.com/smartcontractkit/chainlink/v2/core/services/registrysyncer" + mock "github.com/stretchr/testify/mock" +) + +// ORM is an autogenerated mock type for the ORM type +type ORM struct { + mock.Mock +} + +type ORM_Expecter struct { + mock *mock.Mock +} + +func (_m *ORM) EXPECT() *ORM_Expecter { + return &ORM_Expecter{mock: &_m.Mock} +} + +// AddLocalRegistry provides a mock function with given fields: ctx, localRegistry +func (_m *ORM) AddLocalRegistry(ctx context.Context, localRegistry registrysyncer.LocalRegistry) error { + ret := _m.Called(ctx, localRegistry) + + if len(ret) == 0 { + panic("no return value specified for AddLocalRegistry") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, registrysyncer.LocalRegistry) error); ok { + r0 = rf(ctx, localRegistry) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// ORM_AddLocalRegistry_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddLocalRegistry' +type ORM_AddLocalRegistry_Call struct { + *mock.Call +} + +// AddLocalRegistry is a helper method to define mock.On call +// - ctx context.Context +// - localRegistry registrysyncer.LocalRegistry +func (_e *ORM_Expecter) AddLocalRegistry(ctx interface{}, localRegistry interface{}) *ORM_AddLocalRegistry_Call { + return &ORM_AddLocalRegistry_Call{Call: _e.mock.On("AddLocalRegistry", ctx, localRegistry)} +} + +func (_c *ORM_AddLocalRegistry_Call) Run(run func(ctx context.Context, localRegistry registrysyncer.LocalRegistry)) *ORM_AddLocalRegistry_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(registrysyncer.LocalRegistry)) + }) + return _c +} + +func (_c *ORM_AddLocalRegistry_Call) Return(_a0 error) *ORM_AddLocalRegistry_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ORM_AddLocalRegistry_Call) RunAndReturn(run func(context.Context, registrysyncer.LocalRegistry) error) *ORM_AddLocalRegistry_Call { + _c.Call.Return(run) + return _c +} + +// LatestLocalRegistry provides a mock function with given fields: ctx +func (_m *ORM) LatestLocalRegistry(ctx context.Context) (*registrysyncer.LocalRegistry, error) { + ret := _m.Called(ctx) + + if len(ret) == 0 { + panic("no return value specified for LatestLocalRegistry") + } + + var r0 *registrysyncer.LocalRegistry + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (*registrysyncer.LocalRegistry, error)); ok { + return rf(ctx) + } + if rf, ok := ret.Get(0).(func(context.Context) *registrysyncer.LocalRegistry); ok { + r0 = rf(ctx) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*registrysyncer.LocalRegistry) + } + } + + if rf, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = rf(ctx) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ORM_LatestLocalRegistry_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LatestLocalRegistry' +type ORM_LatestLocalRegistry_Call struct { + *mock.Call +} + +// LatestLocalRegistry is a helper method to define mock.On call +// - ctx context.Context +func (_e *ORM_Expecter) LatestLocalRegistry(ctx interface{}) *ORM_LatestLocalRegistry_Call { + return &ORM_LatestLocalRegistry_Call{Call: _e.mock.On("LatestLocalRegistry", ctx)} +} + +func (_c *ORM_LatestLocalRegistry_Call) Run(run func(ctx context.Context)) *ORM_LatestLocalRegistry_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *ORM_LatestLocalRegistry_Call) Return(_a0 *registrysyncer.LocalRegistry, _a1 error) *ORM_LatestLocalRegistry_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ORM_LatestLocalRegistry_Call) RunAndReturn(run func(context.Context) (*registrysyncer.LocalRegistry, error)) *ORM_LatestLocalRegistry_Call { + _c.Call.Return(run) + return _c +} + +// NewORM creates a new instance of ORM. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewORM(t interface { + mock.TestingT + Cleanup(func()) +}) *ORM { + mock := &ORM{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/core/services/registrysyncer/orm.go b/core/services/registrysyncer/orm.go new file mode 100644 index 00000000000..cb08eaafeaf --- /dev/null +++ b/core/services/registrysyncer/orm.go @@ -0,0 +1,167 @@ +package registrysyncer + +import ( + "context" + "crypto/sha256" + "encoding/json" + "fmt" + "math/big" + + "github.com/smartcontractkit/chainlink-common/pkg/sqlutil" + + kcr "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/capabilities_registry" + "github.com/smartcontractkit/chainlink/v2/core/logger" + p2ptypes "github.com/smartcontractkit/chainlink/v2/core/services/p2p/types" +) + +type capabilitiesRegistryNodeInfo struct { + NodeOperatorId uint32 `json:"nodeOperatorId"` + ConfigCount uint32 `json:"configCount"` + WorkflowDONId uint32 `json:"workflowDONId"` + Signer p2ptypes.PeerID `json:"signer"` + P2pId p2ptypes.PeerID `json:"p2pId"` + HashedCapabilityIds []p2ptypes.PeerID `json:"hashedCapabilityIds"` + CapabilitiesDONIds []string `json:"capabilitiesDONIds"` +} + +func (l *LocalRegistry) MarshalJSON() ([]byte, error) { + idsToNodes := make(map[p2ptypes.PeerID]capabilitiesRegistryNodeInfo) + for k, v := range l.IDsToNodes { + hashedCapabilityIds := make([]p2ptypes.PeerID, len(v.HashedCapabilityIds)) + for i, id := range v.HashedCapabilityIds { + hashedCapabilityIds[i] = p2ptypes.PeerID(id[:]) + } + capabilitiesDONIds := make([]string, len(v.CapabilitiesDONIds)) + for i, id := range v.CapabilitiesDONIds { + capabilitiesDONIds[i] = id.String() + } + idsToNodes[k] = capabilitiesRegistryNodeInfo{ + NodeOperatorId: v.NodeOperatorId, + ConfigCount: v.ConfigCount, + WorkflowDONId: v.WorkflowDONId, + Signer: p2ptypes.PeerID(v.Signer[:]), + P2pId: p2ptypes.PeerID(v.P2pId[:]), + HashedCapabilityIds: hashedCapabilityIds, + CapabilitiesDONIds: capabilitiesDONIds, + } + } + + b, err := json.Marshal(&struct { + IDsToDONs map[DonID]DON + IDsToNodes map[p2ptypes.PeerID]capabilitiesRegistryNodeInfo + IDsToCapabilities map[string]Capability + }{ + IDsToDONs: l.IDsToDONs, + IDsToNodes: idsToNodes, + IDsToCapabilities: l.IDsToCapabilities, + }) + if err != nil { + return []byte{}, err + } + return b, nil +} + +func (l *LocalRegistry) UnmarshalJSON(data []byte) error { + temp := struct { + IDsToDONs map[DonID]DON + IDsToNodes map[p2ptypes.PeerID]capabilitiesRegistryNodeInfo + IDsToCapabilities map[string]Capability + }{ + IDsToDONs: make(map[DonID]DON), + IDsToNodes: make(map[p2ptypes.PeerID]capabilitiesRegistryNodeInfo), + IDsToCapabilities: make(map[string]Capability), + } + + if err := json.Unmarshal(data, &temp); err != nil { + return fmt.Errorf("failed to unmarshal state: %w", err) + } + + l.IDsToDONs = temp.IDsToDONs + + l.IDsToNodes = make(map[p2ptypes.PeerID]kcr.CapabilitiesRegistryNodeInfo) + for peerID, v := range temp.IDsToNodes { + hashedCapabilityIds := make([][32]byte, len(v.HashedCapabilityIds)) + for i, id := range v.HashedCapabilityIds { + copy(hashedCapabilityIds[i][:], id[:]) + } + + capabilitiesDONIds := make([]*big.Int, len(v.CapabilitiesDONIds)) + for i, id := range v.CapabilitiesDONIds { + bigInt := new(big.Int) + bigInt.SetString(id, 10) + capabilitiesDONIds[i] = bigInt + } + l.IDsToNodes[peerID] = kcr.CapabilitiesRegistryNodeInfo{ + NodeOperatorId: v.NodeOperatorId, + ConfigCount: v.ConfigCount, + WorkflowDONId: v.WorkflowDONId, + Signer: v.Signer, + P2pId: v.P2pId, + HashedCapabilityIds: hashedCapabilityIds, + CapabilitiesDONIds: capabilitiesDONIds, + } + } + + l.IDsToCapabilities = temp.IDsToCapabilities + + return nil +} + +type ORM interface { + AddLocalRegistry(ctx context.Context, localRegistry LocalRegistry) error + LatestLocalRegistry(ctx context.Context) (*LocalRegistry, error) +} + +type orm struct { + ds sqlutil.DataSource + lggr logger.Logger +} + +var _ ORM = (*orm)(nil) + +func NewORM(ds sqlutil.DataSource, lggr logger.Logger) orm { + namedLogger := lggr.Named("RegistrySyncerORM") + return orm{ + ds: ds, + lggr: namedLogger, + } +} + +func (orm orm) AddLocalRegistry(ctx context.Context, localRegistry LocalRegistry) error { + return sqlutil.TransactDataSource(ctx, orm.ds, nil, func(tx sqlutil.DataSource) error { + localRegistryJSON, err := localRegistry.MarshalJSON() + if err != nil { + return err + } + hash := sha256.Sum256(localRegistryJSON) + _, err = tx.ExecContext( + ctx, + `INSERT INTO registry_syncer_states (data, data_hash) VALUES ($1, $2) ON CONFLICT (data_hash) DO NOTHING`, + localRegistryJSON, fmt.Sprintf("%x", hash[:]), + ) + if err != nil { + return err + } + _, err = tx.ExecContext(ctx, `DELETE FROM registry_syncer_states +WHERE data_hash NOT IN ( + SELECT data_hash FROM registry_syncer_states + ORDER BY id DESC + LIMIT 10 +);`) + return err + }) +} + +func (orm orm) LatestLocalRegistry(ctx context.Context) (*LocalRegistry, error) { + var localRegistry LocalRegistry + var localRegistryJSON string + err := orm.ds.GetContext(ctx, &localRegistryJSON, `SELECT data FROM registry_syncer_states ORDER BY id DESC LIMIT 1`) + if err != nil { + return nil, err + } + err = localRegistry.UnmarshalJSON([]byte(localRegistryJSON)) + if err != nil { + return nil, err + } + return &localRegistry, nil +} diff --git a/core/services/registrysyncer/orm_test.go b/core/services/registrysyncer/orm_test.go new file mode 100644 index 00000000000..03772ea22bf --- /dev/null +++ b/core/services/registrysyncer/orm_test.go @@ -0,0 +1,145 @@ +package registrysyncer_test + +import ( + "encoding/hex" + "math/big" + "testing" + "time" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/types/known/durationpb" + + ragetypes "github.com/smartcontractkit/libocr/ragep2p/types" + + "github.com/smartcontractkit/chainlink-common/pkg/capabilities" + capabilitiespb "github.com/smartcontractkit/chainlink-common/pkg/capabilities/pb" + "github.com/smartcontractkit/chainlink-common/pkg/values" + + kcr "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/capabilities_registry" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/pgtest" + "github.com/smartcontractkit/chainlink/v2/core/logger" + "github.com/smartcontractkit/chainlink/v2/core/services/p2p/types" + "github.com/smartcontractkit/chainlink/v2/core/services/registrysyncer" +) + +func TestRegistrySyncerORM_InsertAndRetrieval(t *testing.T) { + db := pgtest.NewSqlxDB(t) + ctx := testutils.Context(t) + lggr := logger.TestLogger(t) + orm := registrysyncer.NewORM(db, lggr) + + var states []registrysyncer.LocalRegistry + for i := 0; i < 11; i++ { + state := generateState(t) + err := orm.AddLocalRegistry(ctx, state) + require.NoError(t, err) + states = append(states, state) + } + + var count int + err := db.Get(&count, `SELECT count(*) FROM registry_syncer_states`) + require.NoError(t, err) + assert.Equal(t, 10, count) + + state, err := orm.LatestLocalRegistry(ctx) + require.NoError(t, err) + assert.Equal(t, states[10], *state) +} + +func generateState(t *testing.T) registrysyncer.LocalRegistry { + dID := uint32(1) + var pid ragetypes.PeerID + err := pid.UnmarshalText([]byte("12D3KooWBCF1XT5Wi8FzfgNCqRL76Swv8TRU3TiD4QiJm8NMNX7N")) + require.NoError(t, err) + nodes := [][32]byte{ + pid, + randomWord(), + randomWord(), + randomWord(), + } + capabilityID := randomWord() + capabilityID2 := randomWord() + capabilityIDStr := hex.EncodeToString(capabilityID[:]) + capabilityID2Str := hex.EncodeToString(capabilityID2[:]) + + config := &capabilitiespb.CapabilityConfig{ + DefaultConfig: values.Proto(values.EmptyMap()).GetMapValue(), + RemoteConfig: &capabilitiespb.CapabilityConfig_RemoteTriggerConfig{ + RemoteTriggerConfig: &capabilitiespb.RemoteTriggerConfig{ + RegistrationRefresh: durationpb.New(20 * time.Second), + RegistrationExpiry: durationpb.New(60 * time.Second), + // F + 1 + MinResponsesToAggregate: uint32(1) + 1, + MessageExpiry: durationpb.New(120 * time.Second), + }, + }, + } + configb, err := proto.Marshal(config) + require.NoError(t, err) + + return registrysyncer.LocalRegistry{ + IDsToDONs: map[registrysyncer.DonID]registrysyncer.DON{ + registrysyncer.DonID(dID): { + DON: capabilities.DON{ + ID: dID, + ConfigVersion: uint32(0), + F: uint8(1), + IsPublic: true, + AcceptsWorkflows: true, + Members: toPeerIDs(nodes), + }, + CapabilityConfigurations: map[string]registrysyncer.CapabilityConfiguration{ + capabilityIDStr: { + Config: configb, + }, + capabilityID2Str: { + Config: configb, + }, + }, + }, + }, + IDsToCapabilities: map[string]registrysyncer.Capability{ + capabilityIDStr: { + ID: capabilityIDStr, + CapabilityType: capabilities.CapabilityTypeAction, + }, + capabilityID2Str: { + ID: capabilityID2Str, + CapabilityType: capabilities.CapabilityTypeConsensus, + }, + }, + IDsToNodes: map[types.PeerID]kcr.CapabilitiesRegistryNodeInfo{ + nodes[0]: { + NodeOperatorId: 1, + Signer: randomWord(), + P2pId: nodes[0], + HashedCapabilityIds: [][32]byte{capabilityID, capabilityID2}, + CapabilitiesDONIds: []*big.Int{}, + }, + nodes[1]: { + NodeOperatorId: 1, + Signer: randomWord(), + P2pId: nodes[1], + HashedCapabilityIds: [][32]byte{capabilityID, capabilityID2}, + CapabilitiesDONIds: []*big.Int{}, + }, + nodes[2]: { + NodeOperatorId: 1, + Signer: randomWord(), + P2pId: nodes[2], + HashedCapabilityIds: [][32]byte{capabilityID, capabilityID2}, + CapabilitiesDONIds: []*big.Int{}, + }, + nodes[3]: { + NodeOperatorId: 1, + Signer: randomWord(), + P2pId: nodes[3], + HashedCapabilityIds: [][32]byte{capabilityID, capabilityID2}, + CapabilitiesDONIds: []*big.Int{}, + }, + }, + } +} diff --git a/core/services/registrysyncer/syncer.go b/core/services/registrysyncer/syncer.go index d7d7c1bf92f..1ef78b6edcc 100644 --- a/core/services/registrysyncer/syncer.go +++ b/core/services/registrysyncer/syncer.go @@ -4,11 +4,14 @@ import ( "context" "encoding/json" "fmt" + "math/big" "sync" "time" + "github.com/smartcontractkit/chainlink-common/pkg/capabilities" "github.com/smartcontractkit/chainlink-common/pkg/services" "github.com/smartcontractkit/chainlink-common/pkg/types" + "github.com/smartcontractkit/chainlink-common/pkg/types/query/primitives" kcr "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/capabilities_registry" "github.com/smartcontractkit/chainlink/v2/core/logger" @@ -16,17 +19,8 @@ import ( evmrelaytypes "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/types" ) -type HashedCapabilityID [32]byte -type DonID uint32 - -type State struct { - IDsToDONs map[DonID]kcr.CapabilitiesRegistryDONInfo - IDsToNodes map[p2ptypes.PeerID]kcr.CapabilitiesRegistryNodeInfo - IDsToCapabilities map[HashedCapabilityID]kcr.CapabilitiesRegistryCapabilityInfo -} - type Launcher interface { - Launch(ctx context.Context, state State) error + Launch(ctx context.Context, registry *LocalRegistry) error } type Syncer interface { @@ -34,13 +28,33 @@ type Syncer interface { AddLauncher(h ...Launcher) } +type ContractReaderFactory interface { + NewContractReader(context.Context, []byte) (types.ContractReader, error) +} + +type RegistrySyncer interface { + Sync(ctx context.Context, isInitialSync bool) error + AddLauncher(launchers ...Launcher) + Start(ctx context.Context) error + Close() error + Ready() error + HealthReport() map[string]error + Name() string +} + type registrySyncer struct { - stopCh services.StopChan - launchers []Launcher - reader types.ContractReader - initReader func(ctx context.Context, lggr logger.Logger, relayer contractReaderFactory, registryAddress string) (types.ContractReader, error) - relayer contractReaderFactory - registryAddress string + services.StateMachine + stopCh services.StopChan + launchers []Launcher + reader types.ContractReader + initReader func(ctx context.Context, lggr logger.Logger, relayer ContractReaderFactory, capabilitiesContract types.BoundContract) (types.ContractReader, error) + relayer ContractReaderFactory + capabilitiesContract types.BoundContract + getPeerID func() (p2ptypes.PeerID, error) + + orm ORM + + updateChan chan *LocalRegistry wg sync.WaitGroup lggr logger.Logger @@ -56,27 +70,30 @@ var ( // New instantiates a new RegistrySyncer func New( lggr logger.Logger, - relayer contractReaderFactory, + getPeerID func() (p2ptypes.PeerID, error), + relayer ContractReaderFactory, registryAddress string, -) (*registrySyncer, error) { - stopCh := make(services.StopChan) + orm ORM, +) (RegistrySyncer, error) { return ®istrySyncer{ - stopCh: stopCh, - lggr: lggr.Named("RegistrySyncer"), - relayer: relayer, - registryAddress: registryAddress, - initReader: newReader, + stopCh: make(services.StopChan), + updateChan: make(chan *LocalRegistry), + lggr: lggr.Named("RegistrySyncer"), + relayer: relayer, + capabilitiesContract: types.BoundContract{ + Address: registryAddress, + Name: "CapabilitiesRegistry", + }, + initReader: newReader, + orm: orm, + getPeerID: getPeerID, }, nil } -type contractReaderFactory interface { - NewContractReader(context.Context, []byte) (types.ContractReader, error) -} - // NOTE: this can't be called while initializing the syncer and needs to be called in the sync loop. // This is because Bind() makes an onchain call to verify that the contract address exists, and if // called during initialization, this results in a "no live nodes" error. -func newReader(ctx context.Context, lggr logger.Logger, relayer contractReaderFactory, remoteRegistryAddress string) (types.ContractReader, error) { +func newReader(ctx context.Context, lggr logger.Logger, relayer ContractReaderFactory, capabilitiesContract types.BoundContract) (types.ContractReader, error) { contractReaderConfig := evmrelaytypes.ChainReaderConfig{ Contracts: map[string]evmrelaytypes.ChainContractReader{ "CapabilitiesRegistry": { @@ -106,23 +123,25 @@ func newReader(ctx context.Context, lggr logger.Logger, relayer contractReaderFa return nil, err } - err = cr.Bind(ctx, []types.BoundContract{ - { - Address: remoteRegistryAddress, - Name: "CapabilitiesRegistry", - }, - }) + err = cr.Bind(ctx, []types.BoundContract{capabilitiesContract}) return cr, err } func (s *registrySyncer) Start(ctx context.Context) error { - s.wg.Add(1) - go func() { - defer s.wg.Done() - s.syncLoop() - }() - return nil + return s.StartOnce("RegistrySyncer", func() error { + s.wg.Add(1) + go func() { + defer s.wg.Done() + s.syncLoop() + }() + s.wg.Add(1) + go func() { + defer s.wg.Done() + s.updateStateLoop() + }() + return nil + }) } func (s *registrySyncer) syncLoop() { @@ -136,7 +155,7 @@ func (s *registrySyncer) syncLoop() { // sync immediately once spinning up syncLoop, as by default a ticker will // fire for the first time at T+N, where N is the interval. s.lggr.Debug("starting initial sync with remote registry") - err := s.sync(ctx) + err := s.Sync(ctx, true) if err != nil { s.lggr.Errorw("failed to sync with remote registry", "error", err) } @@ -147,7 +166,7 @@ func (s *registrySyncer) syncLoop() { return case <-ticker.C: s.lggr.Debug("starting regular sync with the remote registry") - err := s.sync(ctx) + err := s.Sync(ctx, false) if err != nil { s.lggr.Errorw("failed to sync with remote registry", "error", err) } @@ -155,33 +174,78 @@ func (s *registrySyncer) syncLoop() { } } -func (s *registrySyncer) state(ctx context.Context) (State, error) { - dons := []kcr.CapabilitiesRegistryDONInfo{} - err := s.reader.GetLatestValue(ctx, "CapabilitiesRegistry", "getDONs", nil, &dons) - if err != nil { - return State{}, err - } +func (s *registrySyncer) updateStateLoop() { + ctx, cancel := s.stopCh.NewCtx() + defer cancel() - idsToDONs := map[DonID]kcr.CapabilitiesRegistryDONInfo{} - for _, d := range dons { - idsToDONs[DonID(d.Id)] = d + for { + select { + case <-s.stopCh: + return + case localRegistry, ok := <-s.updateChan: + if !ok { + // channel has been closed, terminating. + return + } + if err := s.orm.AddLocalRegistry(ctx, *localRegistry); err != nil { + s.lggr.Errorw("failed to save state to local registry", "error", err) + } + } } +} +func (s *registrySyncer) localRegistry(ctx context.Context) (*LocalRegistry, error) { caps := []kcr.CapabilitiesRegistryCapabilityInfo{} - err = s.reader.GetLatestValue(ctx, "CapabilitiesRegistry", "getCapabilities", nil, &caps) + + err := s.reader.GetLatestValue(ctx, s.capabilitiesContract.ReadIdentifier("getCapabilities"), primitives.Unconfirmed, nil, &caps) if err != nil { - return State{}, err + return nil, err } - idsToCapabilities := map[HashedCapabilityID]kcr.CapabilitiesRegistryCapabilityInfo{} + idsToCapabilities := map[string]Capability{} + hashedIDsToCapabilityIDs := map[[32]byte]string{} for _, c := range caps { - idsToCapabilities[c.HashedId] = c + cid := fmt.Sprintf("%s@%s", c.LabelledName, c.Version) + idsToCapabilities[cid] = Capability{ + ID: cid, + CapabilityType: toCapabilityType(c.CapabilityType), + } + + hashedIDsToCapabilityIDs[c.HashedId] = cid + } + + dons := []kcr.CapabilitiesRegistryDONInfo{} + + err = s.reader.GetLatestValue(ctx, s.capabilitiesContract.ReadIdentifier("getDONs"), primitives.Unconfirmed, nil, &dons) + if err != nil { + return nil, err + } + + idsToDONs := map[DonID]DON{} + for _, d := range dons { + cc := map[string]CapabilityConfiguration{} + for _, dc := range d.CapabilityConfigurations { + cid, ok := hashedIDsToCapabilityIDs[dc.CapabilityId] + if !ok { + return nil, fmt.Errorf("invariant violation: could not find full ID for hashed ID %s", dc.CapabilityId) + } + + cc[cid] = CapabilityConfiguration{ + Config: dc.Config, + } + } + + idsToDONs[DonID(d.Id)] = DON{ + DON: *toDONInfo(d), + CapabilityConfigurations: cc, + } } nodes := []kcr.CapabilitiesRegistryNodeInfo{} - err = s.reader.GetLatestValue(ctx, "CapabilitiesRegistry", "getNodes", nil, &nodes) + + err = s.reader.GetLatestValue(ctx, s.capabilitiesContract.ReadIdentifier("getNodes"), primitives.Unconfirmed, nil, &nodes) if err != nil { - return State{}, err + return nil, err } idsToNodes := map[p2ptypes.PeerID]kcr.CapabilitiesRegistryNodeInfo{} @@ -189,10 +253,16 @@ func (s *registrySyncer) state(ctx context.Context) (State, error) { idsToNodes[node.P2pId] = node } - return State{IDsToDONs: idsToDONs, IDsToCapabilities: idsToCapabilities, IDsToNodes: idsToNodes}, nil + return &LocalRegistry{ + lggr: s.lggr, + getPeerID: s.getPeerID, + IDsToDONs: idsToDONs, + IDsToCapabilities: idsToCapabilities, + IDsToNodes: idsToNodes, + }, nil } -func (s *registrySyncer) sync(ctx context.Context) error { +func (s *registrySyncer) Sync(ctx context.Context, isInitialSync bool) error { s.mu.RLock() defer s.mu.RUnlock() @@ -202,7 +272,7 @@ func (s *registrySyncer) sync(ctx context.Context) error { } if s.reader == nil { - reader, err := s.initReader(ctx, s.lggr, s.relayer, s.registryAddress) + reader, err := s.initReader(ctx, s.lggr, s.relayer, s.capabilitiesContract) if err != nil { return err } @@ -210,13 +280,44 @@ func (s *registrySyncer) sync(ctx context.Context) error { s.reader = reader } - state, err := s.state(ctx) - if err != nil { - return fmt.Errorf("failed to sync with remote registry: %w", err) + var lr *LocalRegistry + var err error + + if isInitialSync { + s.lggr.Debug("syncing with local registry") + lr, err = s.orm.LatestLocalRegistry(ctx) + if err != nil { + s.lggr.Warnw("failed to sync with local registry, using remote registry instead", "error", err) + } else { + lr.lggr = s.lggr + lr.getPeerID = s.getPeerID + } + } + + if lr == nil { + s.lggr.Debug("syncing with remote registry") + localRegistry, err := s.localRegistry(ctx) + if err != nil { + return fmt.Errorf("failed to sync with remote registry: %w", err) + } + lr = localRegistry + // Attempt to send local registry to the update channel without blocking + // This is to prevent the tests from hanging if they are not calling `Start()` on the syncer + select { + case <-s.stopCh: + s.lggr.Debug("sync cancelled, stopping") + case s.updateChan <- lr: + // Successfully sent state + s.lggr.Debug("remote registry update triggered successfully") + default: + // No one is ready to receive the state, handle accordingly + s.lggr.Debug("no listeners on update channel, remote registry update skipped") + } } for _, h := range s.launchers { - if err := h.Launch(ctx, state); err != nil { + lrCopy := deepCopyLocalRegistry(lr) + if err := h.Launch(ctx, &lrCopy); err != nil { s.lggr.Errorf("error calling launcher: %s", err) } } @@ -224,6 +325,89 @@ func (s *registrySyncer) sync(ctx context.Context) error { return nil } +func deepCopyLocalRegistry(lr *LocalRegistry) LocalRegistry { + var lrCopy LocalRegistry + lrCopy.lggr = lr.lggr + lrCopy.getPeerID = lr.getPeerID + lrCopy.IDsToDONs = make(map[DonID]DON, len(lr.IDsToDONs)) + for id, don := range lr.IDsToDONs { + d := capabilities.DON{ + ID: don.ID, + ConfigVersion: don.ConfigVersion, + Members: make([]p2ptypes.PeerID, len(don.Members)), + F: don.F, + IsPublic: don.IsPublic, + AcceptsWorkflows: don.AcceptsWorkflows, + } + copy(d.Members, don.Members) + capCfgs := make(map[string]CapabilityConfiguration, len(don.CapabilityConfigurations)) + for capID, capCfg := range don.CapabilityConfigurations { + capCfgs[capID] = CapabilityConfiguration{ + Config: capCfg.Config[:], + } + } + lrCopy.IDsToDONs[id] = DON{ + DON: d, + CapabilityConfigurations: capCfgs, + } + } + + lrCopy.IDsToCapabilities = make(map[string]Capability, len(lr.IDsToCapabilities)) + for id, capability := range lr.IDsToCapabilities { + cp := capability + lrCopy.IDsToCapabilities[id] = cp + } + + lrCopy.IDsToNodes = make(map[p2ptypes.PeerID]kcr.CapabilitiesRegistryNodeInfo, len(lr.IDsToNodes)) + for id, node := range lr.IDsToNodes { + nodeInfo := kcr.CapabilitiesRegistryNodeInfo{ + NodeOperatorId: node.NodeOperatorId, + ConfigCount: node.ConfigCount, + WorkflowDONId: node.WorkflowDONId, + Signer: node.Signer, + P2pId: node.P2pId, + HashedCapabilityIds: make([][32]byte, len(node.HashedCapabilityIds)), + CapabilitiesDONIds: make([]*big.Int, len(node.CapabilitiesDONIds)), + } + copy(nodeInfo.HashedCapabilityIds, node.HashedCapabilityIds) + copy(nodeInfo.CapabilitiesDONIds, node.CapabilitiesDONIds) + lrCopy.IDsToNodes[id] = nodeInfo + } + + return lrCopy +} + +func toCapabilityType(capabilityType uint8) capabilities.CapabilityType { + switch capabilityType { + case 0: + return capabilities.CapabilityTypeTrigger + case 1: + return capabilities.CapabilityTypeAction + case 2: + return capabilities.CapabilityTypeConsensus + case 3: + return capabilities.CapabilityTypeTarget + default: + return capabilities.CapabilityTypeUnknown + } +} + +func toDONInfo(don kcr.CapabilitiesRegistryDONInfo) *capabilities.DON { + peerIDs := []p2ptypes.PeerID{} + for _, p := range don.NodeP2PIds { + peerIDs = append(peerIDs, p) + } + + return &capabilities.DON{ + ID: don.Id, + ConfigVersion: don.ConfigCount, + Members: peerIDs, + F: don.F, + IsPublic: don.IsPublic, + AcceptsWorkflows: don.AcceptsWorkflows, + } +} + func (s *registrySyncer) AddLauncher(launchers ...Launcher) { s.mu.Lock() defer s.mu.Unlock() @@ -231,9 +415,14 @@ func (s *registrySyncer) AddLauncher(launchers ...Launcher) { } func (s *registrySyncer) Close() error { - close(s.stopCh) - s.wg.Wait() - return nil + return s.StopOnce("RegistrySyncer", func() error { + close(s.stopCh) + s.mu.Lock() + defer s.mu.Unlock() + close(s.updateChan) + s.wg.Wait() + return nil + }) } func (s *registrySyncer) Ready() error { diff --git a/core/services/registrysyncer/syncer_test.go b/core/services/registrysyncer/syncer_test.go index f36aa806067..9e51b7498f0 100644 --- a/core/services/registrysyncer/syncer_test.go +++ b/core/services/registrysyncer/syncer_test.go @@ -1,4 +1,4 @@ -package registrysyncer +package registrysyncer_test import ( "context" @@ -6,6 +6,7 @@ import ( "encoding/json" "fmt" "math/big" + "sync" "testing" "time" @@ -15,9 +16,17 @@ import ( "github.com/ethereum/go-ethereum/core" "github.com/ethereum/go-ethereum/eth/ethconfig" "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/types/known/durationpb" + "github.com/smartcontractkit/chainlink-common/pkg/capabilities" "github.com/smartcontractkit/chainlink-common/pkg/types" + "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" + "github.com/smartcontractkit/chainlink-common/pkg/values" + + capabilitiespb "github.com/smartcontractkit/chainlink-common/pkg/capabilities/pb" evmclient "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/headtracker" @@ -27,14 +36,16 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/pgtest" "github.com/smartcontractkit/chainlink/v2/core/logger" p2ptypes "github.com/smartcontractkit/chainlink/v2/core/services/p2p/types" + "github.com/smartcontractkit/chainlink/v2/core/services/registrysyncer" + syncerMocks "github.com/smartcontractkit/chainlink/v2/core/services/registrysyncer/mocks" "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm" evmrelaytypes "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/types" ) var writeChainCapability = kcr.CapabilitiesRegistryCapability{ - LabelledName: "write-chain", - Version: "1.0.1", - ResponseType: uint8(1), + LabelledName: "write-chain", + Version: "1.0.1", + CapabilityType: uint8(3), } func startNewChainWithRegistry(t *testing.T) (*kcr.CapabilitiesRegistry, common.Address, *bind.TransactOpts, *backends.SimulatedBackend) { @@ -60,6 +71,7 @@ func startNewChainWithRegistry(t *testing.T) (*kcr.CapabilitiesRegistry, common. type crFactory struct { lggr logger.Logger + ht logpoller.HeadTracker logPoller logpoller.LogPoller client evmclient.Client } @@ -69,7 +81,8 @@ func (c *crFactory) NewContractReader(ctx context.Context, cfg []byte) (types.Co if err := json.Unmarshal(cfg, crCfg); err != nil { return nil, err } - svc, err := evm.NewChainReaderService(ctx, c.lggr, c.logPoller, c.client, *crCfg) + + svc, err := evm.NewChainReaderService(ctx, c.lggr, c.logPoller, c.ht, c.client, *crCfg) if err != nil { return nil, err } @@ -103,6 +116,7 @@ func newContractReaderFactory(t *testing.T, simulatedBackend *backends.Simulated return &crFactory{ lggr: lggr, client: client, + ht: ht, logPoller: lp, } } @@ -117,14 +131,57 @@ func randomWord() [32]byte { } type launcher struct { - localRegistry State + localRegistry *registrysyncer.LocalRegistry + mu sync.RWMutex } -func (l *launcher) Launch(ctx context.Context, localRegistry State) error { +func (l *launcher) Launch(ctx context.Context, localRegistry *registrysyncer.LocalRegistry) error { + l.mu.Lock() + defer l.mu.Unlock() l.localRegistry = localRegistry return nil } +type orm struct { + ormMock *syncerMocks.ORM + latestLocalRegistryCh chan struct{} + addLocalRegistryCh chan struct{} +} + +func newORM(t *testing.T) *orm { + t.Helper() + + return &orm{ + ormMock: syncerMocks.NewORM(t), + latestLocalRegistryCh: make(chan struct{}, 1), + addLocalRegistryCh: make(chan struct{}, 1), + } +} + +func (o *orm) Cleanup() { + close(o.latestLocalRegistryCh) + close(o.addLocalRegistryCh) +} + +func (o *orm) AddLocalRegistry(ctx context.Context, localRegistry registrysyncer.LocalRegistry) error { + o.addLocalRegistryCh <- struct{}{} + err := o.ormMock.AddLocalRegistry(ctx, localRegistry) + return err +} + +func (o *orm) LatestLocalRegistry(ctx context.Context) (*registrysyncer.LocalRegistry, error) { + o.latestLocalRegistryCh <- struct{}{} + return o.ormMock.LatestLocalRegistry(ctx) +} + +func toPeerIDs(ids [][32]byte) []p2ptypes.PeerID { + var pids []p2ptypes.PeerID + for _, id := range ids { + pids = append(pids, id) + } + return pids +} + func TestReader_Integration(t *testing.T) { ctx := testutils.Context(t) reg, regAddress, owner, sim := startNewChainWithRegistry(t) @@ -133,7 +190,9 @@ func TestReader_Integration(t *testing.T) { require.NoError(t, err, "AddCapability failed for %s", writeChainCapability.LabelledName) sim.Commit() - cid, err := reg.GetHashedCapabilityId(&bind.CallOpts{}, writeChainCapability.LabelledName, writeChainCapability.Version) + cid := fmt.Sprintf("%s@%s", writeChainCapability.LabelledName, writeChainCapability.Version) + + hid, err := reg.GetHashedCapabilityId(&bind.CallOpts{}, writeChainCapability.LabelledName, writeChainCapability.Version) require.NoError(t, err) _, err = reg.AddNodeOperators(owner, []kcr.CapabilitiesRegistryNodeOperator{ @@ -162,30 +221,47 @@ func TestReader_Integration(t *testing.T) { NodeOperatorId: uint32(1), Signer: signersSet[0], P2pId: nodeSet[0], - HashedCapabilityIds: [][32]byte{cid}, + HashedCapabilityIds: [][32]byte{hid}, }, { // The first NodeOperatorId has id 1 since the id is auto-incrementing. NodeOperatorId: uint32(1), Signer: signersSet[1], P2pId: nodeSet[1], - HashedCapabilityIds: [][32]byte{cid}, + HashedCapabilityIds: [][32]byte{hid}, }, { // The first NodeOperatorId has id 1 since the id is auto-incrementing. NodeOperatorId: uint32(1), Signer: signersSet[2], P2pId: nodeSet[2], - HashedCapabilityIds: [][32]byte{cid}, + HashedCapabilityIds: [][32]byte{hid}, }, } _, err = reg.AddNodes(owner, nodes) require.NoError(t, err) + config := &capabilitiespb.CapabilityConfig{ + DefaultConfig: values.Proto(values.EmptyMap()).GetMapValue(), + RemoteConfig: &capabilitiespb.CapabilityConfig_RemoteTriggerConfig{ + RemoteTriggerConfig: &capabilitiespb.RemoteTriggerConfig{ + RegistrationRefresh: durationpb.New(20 * time.Second), + RegistrationExpiry: durationpb.New(60 * time.Second), + // F + 1 + MinResponsesToAggregate: uint32(1) + 1, + MessageExpiry: durationpb.New(120 * time.Second), + }, + }, + } + configb, err := proto.Marshal(config) + if err != nil { + panic(err) + } + cfgs := []kcr.CapabilitiesRegistryCapabilityConfiguration{ { - CapabilityId: cid, - Config: []byte(`{"hello": "world"}`), + CapabilityId: hid, + Config: configb, }, } _, err = reg.AddDON( @@ -200,38 +276,38 @@ func TestReader_Integration(t *testing.T) { require.NoError(t, err) + db := pgtest.NewSqlxDB(t) factory := newContractReaderFactory(t, sim) - syncer, err := New(logger.TestLogger(t), factory, regAddress.Hex()) + syncerORM := registrysyncer.NewORM(db, logger.TestLogger(t)) + syncer, err := registrysyncer.New(logger.TestLogger(t), func() (p2ptypes.PeerID, error) { return p2ptypes.PeerID{}, nil }, factory, regAddress.Hex(), syncerORM) require.NoError(t, err) l := &launcher{} syncer.AddLauncher(l) - err = syncer.sync(ctx) + err = syncer.Sync(ctx, false) // not looking to load from the DB in this specific test. s := l.localRegistry require.NoError(t, err) assert.Len(t, s.IDsToCapabilities, 1) gotCap := s.IDsToCapabilities[cid] - assert.Equal(t, kcr.CapabilitiesRegistryCapabilityInfo{ - HashedId: cid, - LabelledName: "write-chain", - Version: "1.0.1", - ResponseType: uint8(1), - CapabilityType: uint8(0), - IsDeprecated: false, + assert.Equal(t, registrysyncer.Capability{ + CapabilityType: capabilities.CapabilityTypeTarget, + ID: "write-chain@1.0.1", }, gotCap) assert.Len(t, s.IDsToDONs, 1) - assert.Equal(t, kcr.CapabilitiesRegistryDONInfo{ - Id: 1, // initial Id - ConfigCount: 1, // initial Count - IsPublic: true, - AcceptsWorkflows: true, - F: 1, - NodeP2PIds: nodeSet, - CapabilityConfigurations: cfgs, - }, s.IDsToDONs[1]) + expectedDON := capabilities.DON{ + ID: 1, + ConfigVersion: 1, + IsPublic: true, + AcceptsWorkflows: true, + F: 1, + Members: toPeerIDs(nodeSet), + } + gotDon := s.IDsToDONs[1] + assert.Equal(t, expectedDON, gotDon.DON) + assert.Equal(t, configb, gotDon.CapabilityConfigurations[cid].Config) nodesInfo := []kcr.CapabilitiesRegistryNodeInfo{ { @@ -241,7 +317,7 @@ func TestReader_Integration(t *testing.T) { WorkflowDONId: 1, Signer: signersSet[0], P2pId: nodeSet[0], - HashedCapabilityIds: [][32]byte{cid}, + HashedCapabilityIds: [][32]byte{hid}, CapabilitiesDONIds: []*big.Int{}, }, { @@ -251,7 +327,7 @@ func TestReader_Integration(t *testing.T) { WorkflowDONId: 1, Signer: signersSet[1], P2pId: nodeSet[1], - HashedCapabilityIds: [][32]byte{cid}, + HashedCapabilityIds: [][32]byte{hid}, CapabilitiesDONIds: []*big.Int{}, }, { @@ -261,7 +337,7 @@ func TestReader_Integration(t *testing.T) { WorkflowDONId: 1, Signer: signersSet[2], P2pId: nodeSet[2], - HashedCapabilityIds: [][32]byte{cid}, + HashedCapabilityIds: [][32]byte{hid}, CapabilitiesDONIds: []*big.Int{}, }, } @@ -273,3 +349,216 @@ func TestReader_Integration(t *testing.T) { nodeSet[2]: nodesInfo[2], }, s.IDsToNodes) } + +func TestSyncer_DBIntegration(t *testing.T) { + ctx := testutils.Context(t) + reg, regAddress, owner, sim := startNewChainWithRegistry(t) + + _, err := reg.AddCapabilities(owner, []kcr.CapabilitiesRegistryCapability{writeChainCapability}) + require.NoError(t, err, "AddCapability failed for %s", writeChainCapability.LabelledName) + sim.Commit() + + cid, err := reg.GetHashedCapabilityId(&bind.CallOpts{}, writeChainCapability.LabelledName, writeChainCapability.Version) + require.NoError(t, err) + + _, err = reg.AddNodeOperators(owner, []kcr.CapabilitiesRegistryNodeOperator{ + { + Admin: owner.From, + Name: "TEST_NOP", + }, + }) + require.NoError(t, err) + + nodeSet := [][32]byte{ + randomWord(), + randomWord(), + randomWord(), + } + + signersSet := [][32]byte{ + randomWord(), + randomWord(), + randomWord(), + } + + nodes := []kcr.CapabilitiesRegistryNodeParams{ + { + // The first NodeOperatorId has id 1 since the id is auto-incrementing. + NodeOperatorId: uint32(1), + Signer: signersSet[0], + P2pId: nodeSet[0], + HashedCapabilityIds: [][32]byte{cid}, + }, + { + // The first NodeOperatorId has id 1 since the id is auto-incrementing. + NodeOperatorId: uint32(1), + Signer: signersSet[1], + P2pId: nodeSet[1], + HashedCapabilityIds: [][32]byte{cid}, + }, + { + // The first NodeOperatorId has id 1 since the id is auto-incrementing. + NodeOperatorId: uint32(1), + Signer: signersSet[2], + P2pId: nodeSet[2], + HashedCapabilityIds: [][32]byte{cid}, + }, + } + _, err = reg.AddNodes(owner, nodes) + require.NoError(t, err) + + config := &capabilitiespb.CapabilityConfig{ + DefaultConfig: values.Proto(values.EmptyMap()).GetMapValue(), + RemoteConfig: &capabilitiespb.CapabilityConfig_RemoteTriggerConfig{ + RemoteTriggerConfig: &capabilitiespb.RemoteTriggerConfig{ + RegistrationRefresh: durationpb.New(20 * time.Second), + RegistrationExpiry: durationpb.New(60 * time.Second), + // F + 1 + MinResponsesToAggregate: uint32(1) + 1, + }, + }, + } + configb, err := proto.Marshal(config) + require.NoError(t, err) + + cfgs := []kcr.CapabilitiesRegistryCapabilityConfiguration{ + { + CapabilityId: cid, + Config: configb, + }, + } + _, err = reg.AddDON( + owner, + nodeSet, + cfgs, + true, + true, + 1, + ) + sim.Commit() + + require.NoError(t, err) + + factory := newContractReaderFactory(t, sim) + syncerORM := newORM(t) + syncerORM.ormMock.On("LatestLocalRegistry", mock.Anything).Return(nil, fmt.Errorf("no state found")) + syncerORM.ormMock.On("AddLocalRegistry", mock.Anything, mock.Anything).Return(nil) + syncer, err := newTestSyncer(logger.TestLogger(t), func() (p2ptypes.PeerID, error) { return p2ptypes.PeerID{}, nil }, factory, regAddress.Hex(), syncerORM) + require.NoError(t, err) + require.NoError(t, syncer.Start(ctx)) + t.Cleanup(func() { + syncerORM.Cleanup() + require.NoError(t, syncer.Close()) + }) + + l := &launcher{} + syncer.AddLauncher(l) + + var latestLocalRegistryCalled, addLocalRegistryCalled bool + timeout := time.After(testutils.WaitTimeout(t)) + + for !latestLocalRegistryCalled || !addLocalRegistryCalled { + select { + case val := <-syncerORM.latestLocalRegistryCh: + assert.Equal(t, struct{}{}, val) + latestLocalRegistryCalled = true + case val := <-syncerORM.addLocalRegistryCh: + assert.Equal(t, struct{}{}, val) + addLocalRegistryCalled = true + case <-timeout: + t.Fatal("test timed out; channels did not received data") + } + } +} + +func TestSyncer_LocalNode(t *testing.T) { + ctx := tests.Context(t) + lggr := logger.TestLogger(t) + + var pid p2ptypes.PeerID + err := pid.UnmarshalText([]byte("12D3KooWBCF1XT5Wi8FzfgNCqRL76Swv8TRU3TiD4QiJm8NMNX7N")) + require.NoError(t, err) + + workflowDonNodes := []p2ptypes.PeerID{ + pid, + randomWord(), + randomWord(), + randomWord(), + } + + dID := uint32(1) + // The below state describes a Workflow DON (AcceptsWorkflows = true), + // which exposes the streams-trigger and write_chain capabilities. + // We expect receivers to be wired up and both capabilities to be added to the registry. + localRegistry := registrysyncer.NewLocalRegistry( + lggr, + func() (p2ptypes.PeerID, error) { return pid, nil }, + map[registrysyncer.DonID]registrysyncer.DON{ + registrysyncer.DonID(dID): { + DON: capabilities.DON{ + ID: dID, + ConfigVersion: uint32(2), + F: uint8(1), + IsPublic: true, + AcceptsWorkflows: true, + Members: workflowDonNodes, + }, + }, + }, + map[p2ptypes.PeerID]kcr.CapabilitiesRegistryNodeInfo{ + workflowDonNodes[0]: { + NodeOperatorId: 1, + Signer: randomWord(), + P2pId: workflowDonNodes[0], + }, + workflowDonNodes[1]: { + NodeOperatorId: 1, + Signer: randomWord(), + P2pId: workflowDonNodes[1], + }, + workflowDonNodes[2]: { + NodeOperatorId: 1, + Signer: randomWord(), + P2pId: workflowDonNodes[2], + }, + workflowDonNodes[3]: { + NodeOperatorId: 1, + Signer: randomWord(), + P2pId: workflowDonNodes[3], + }, + }, + map[string]registrysyncer.Capability{}, + ) + + node, err := localRegistry.LocalNode(ctx) + require.NoError(t, err) + + don := capabilities.DON{ + ID: dID, + ConfigVersion: 2, + Members: workflowDonNodes, + F: 1, + IsPublic: true, + AcceptsWorkflows: true, + } + expectedNode := capabilities.Node{ + PeerID: &pid, + WorkflowDON: don, + CapabilityDONs: []capabilities.DON{don}, + } + assert.Equal(t, expectedNode, node) +} + +func newTestSyncer( + lggr logger.Logger, + getPeerID func() (p2ptypes.PeerID, error), + relayer registrysyncer.ContractReaderFactory, + registryAddress string, + orm *orm, +) (registrysyncer.RegistrySyncer, error) { + rs, err := registrysyncer.New(lggr, getPeerID, relayer, registryAddress, orm) + if err != nil { + return nil, err + } + return rs, nil +} diff --git a/core/services/relay/dummy/config_provider.go b/core/services/relay/dummy/config_provider.go index 10662ee296d..db36acba830 100644 --- a/core/services/relay/dummy/config_provider.go +++ b/core/services/relay/dummy/config_provider.go @@ -63,7 +63,7 @@ type configProvider struct { } func NewConfigProvider(lggr logger.Logger, cfg RelayConfig) (types.ConfigProvider, error) { - cp := &configProvider{lggr: lggr.Named("DummyConfigProvider")} + cp := &configProvider{lggr: lggr.Named("DummyConfigProvider").Named(cfg.ConfigTracker.ConfigDigest.String())} { contractConfig, err := cfg.ConfigTracker.ToContractConfig() diff --git a/core/services/relay/dummy/config_tracker.go b/core/services/relay/dummy/config_tracker.go index 0ae188361fa..ecd08196e58 100644 --- a/core/services/relay/dummy/config_tracker.go +++ b/core/services/relay/dummy/config_tracker.go @@ -21,7 +21,7 @@ func NewContractConfigTracker(lggr logger.Logger, cfg ConfigTrackerCfg) (ocrtype if err != nil { return nil, err } - return &configTracker{lggr.Named("DummyConfigProvider"), contractConfig, cfg.ChangedInBlock, cfg.BlockHeight}, nil + return &configTracker{lggr.Named("DummyConfigTracker"), contractConfig, cfg.ChangedInBlock, cfg.BlockHeight}, nil } // Notify may optionally emit notification events when the contract's diff --git a/core/services/relay/dummy/llo_provider.go b/core/services/relay/dummy/llo_provider.go index 4aeb21bed8a..88f72588157 100644 --- a/core/services/relay/dummy/llo_provider.go +++ b/core/services/relay/dummy/llo_provider.go @@ -11,14 +11,18 @@ import ( relaytypes "github.com/smartcontractkit/chainlink-common/pkg/types" llotypes "github.com/smartcontractkit/chainlink-common/pkg/types/llo" "github.com/smartcontractkit/chainlink/v2/core/logger" - "github.com/smartcontractkit/chainlink/v2/core/services/llo" ) var _ commontypes.LLOProvider = (*lloProvider)(nil) +type Transmitter interface { + services.Service + llotypes.Transmitter +} + type lloProvider struct { cp commontypes.ConfigProvider - transmitter llo.Transmitter + transmitter Transmitter logger logger.Logger channelDefinitionCache llotypes.ChannelDefinitionCache @@ -28,7 +32,7 @@ type lloProvider struct { func NewLLOProvider( lggr logger.Logger, cp commontypes.ConfigProvider, - transmitter llo.Transmitter, + transmitter Transmitter, channelDefinitionCache llotypes.ChannelDefinitionCache, ) relaytypes.LLOProvider { return &lloProvider{ @@ -73,10 +77,6 @@ func (p *lloProvider) OffchainConfigDigester() ocrtypes.OffchainConfigDigester { return p.cp.OffchainConfigDigester() } -func (p *lloProvider) OnchainConfigCodec() llo.OnchainConfigCodec { - return &llo.JSONOnchainConfigCodec{} -} - func (p *lloProvider) ContractTransmitter() llotypes.Transmitter { return p.transmitter } diff --git a/core/services/relay/dummy/relayer.go b/core/services/relay/dummy/relayer.go index cf3aa732c47..a9b90b9a2f5 100644 --- a/core/services/relay/dummy/relayer.go +++ b/core/services/relay/dummy/relayer.go @@ -64,6 +64,9 @@ func (r *relayer) NewLLOProvider(ctx context.Context, rargs types.RelayArgs, par } return NewLLOProvider(r.lggr, cp, transmitter, cdc), nil } +func (r *relayer) LatestHead(_ context.Context) (types.Head, error) { + return types.Head{}, nil +} func (r *relayer) GetChainStatus(ctx context.Context) (types.ChainStatus, error) { return types.ChainStatus{}, nil } diff --git a/core/services/relay/evm/binding.go b/core/services/relay/evm/binding.go deleted file mode 100644 index 9c7fd186dec..00000000000 --- a/core/services/relay/evm/binding.go +++ /dev/null @@ -1,17 +0,0 @@ -package evm - -import ( - "context" - - commontypes "github.com/smartcontractkit/chainlink-common/pkg/types" - "github.com/smartcontractkit/chainlink-common/pkg/types/query" -) - -type readBinding interface { - Bind(ctx context.Context, binding commontypes.BoundContract) error - SetCodec(codec commontypes.RemoteCodec) - Register(ctx context.Context) error - Unregister(ctx context.Context) error - GetLatestValue(ctx context.Context, params, returnVal any) error - QueryKey(ctx context.Context, filter query.KeyFilter, limitAndSort query.LimitAndSort, sequenceDataType any) ([]commontypes.Sequence, error) -} diff --git a/core/services/relay/evm/bindings.go b/core/services/relay/evm/bindings.go deleted file mode 100644 index 9ad73c01926..00000000000 --- a/core/services/relay/evm/bindings.go +++ /dev/null @@ -1,70 +0,0 @@ -package evm - -import ( - "context" - "fmt" - - commontypes "github.com/smartcontractkit/chainlink-common/pkg/types" - "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" -) - -// bindings manage all contract bindings, key is contract name. -type bindings map[string]*contractBinding - -func (b bindings) GetReadBinding(contractName, readName string) (readBinding, error) { - // GetReadBindings should only be called after Chain Reader init. - cb, cbExists := b[contractName] - if !cbExists { - return nil, fmt.Errorf("%w: no contract named %s", commontypes.ErrInvalidType, contractName) - } - - rb, rbExists := cb.readBindings[readName] - if !rbExists { - return nil, fmt.Errorf("%w: no readName named %s in contract %s", commontypes.ErrInvalidType, readName, contractName) - } - return rb, nil -} - -// AddReadBinding adds read bindings. Calling this outside of Chain Reader init is not thread safe. -func (b bindings) AddReadBinding(contractName, readName string, rb readBinding) { - cb, cbExists := b[contractName] - if !cbExists { - cb = &contractBinding{ - name: contractName, - readBindings: make(map[string]readBinding), - } - b[contractName] = cb - } - cb.readBindings[readName] = rb -} - -// Bind binds contract addresses to contract bindings and read bindings. -// Bind also registers the common contract polling filter and eventBindings polling filters. -func (b bindings) Bind(ctx context.Context, lp logpoller.LogPoller, boundContracts []commontypes.BoundContract) error { - for _, bc := range boundContracts { - cb, cbExists := b[bc.Name] - if !cbExists { - return fmt.Errorf("%w: no contract named %s", commontypes.ErrInvalidConfig, bc.Name) - } - - if err := cb.Bind(ctx, lp, bc); err != nil { - return err - } - - for _, rb := range cb.readBindings { - if err := rb.Bind(ctx, bc); err != nil { - return err - } - } - } - return nil -} - -func (b bindings) ForEach(ctx context.Context, fn func(context.Context, *contractBinding) error) error { - for _, cb := range b { - if err := fn(ctx, cb); err != nil { - return err - } - } - return nil -} diff --git a/core/services/relay/evm/cap_encoder.go b/core/services/relay/evm/cap_encoder.go index 790114e4c03..2a6f288a5de 100644 --- a/core/services/relay/evm/cap_encoder.go +++ b/core/services/relay/evm/cap_encoder.go @@ -10,7 +10,9 @@ import ( consensustypes "github.com/smartcontractkit/chainlink-common/pkg/capabilities/consensus/ocr3/types" commontypes "github.com/smartcontractkit/chainlink-common/pkg/types" "github.com/smartcontractkit/chainlink-common/pkg/values" + abiutil "github.com/smartcontractkit/chainlink/v2/core/chains/evm/abi" + "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/codec" "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/types" ) @@ -47,7 +49,7 @@ func NewEVMEncoder(config *values.Map) (consensustypes.Encoder, error) { codecConfig := types.CodecConfig{Configs: map[string]types.ChainCodecConfig{ encoderName: {TypeABI: string(jsonSelector)}, }} - c, err := NewCodec(codecConfig) + c, err := codec.NewCodec(codecConfig) if err != nil { return nil, err } diff --git a/core/services/relay/evm/ccip.go b/core/services/relay/evm/ccip.go new file mode 100644 index 00000000000..3eefb7bec7b --- /dev/null +++ b/core/services/relay/evm/ccip.go @@ -0,0 +1,203 @@ +package evm + +import ( + "context" + "fmt" + "math/big" + "time" + + "github.com/smartcontractkit/chainlink-common/pkg/logger" + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/gas" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/abihelpers" + ccipconfig "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/config" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/prices" +) + +var _ cciptypes.CommitStoreReader = (*IncompleteSourceCommitStoreReader)(nil) +var _ cciptypes.CommitStoreReader = (*IncompleteDestCommitStoreReader)(nil) + +// IncompleteSourceCommitStoreReader is an implementation of CommitStoreReader with the only valid methods being +// GasPriceEstimator, ChangeConfig, and OffchainConfig +type IncompleteSourceCommitStoreReader struct { + estimator gas.EvmFeeEstimator + gasPriceEstimator *prices.DAGasPriceEstimator + sourceMaxGasPrice *big.Int + offchainConfig cciptypes.CommitOffchainConfig +} + +func NewIncompleteSourceCommitStoreReader(estimator gas.EvmFeeEstimator, sourceMaxGasPrice *big.Int) *IncompleteSourceCommitStoreReader { + return &IncompleteSourceCommitStoreReader{ + estimator: estimator, + sourceMaxGasPrice: sourceMaxGasPrice, + } +} + +func (i *IncompleteSourceCommitStoreReader) ChangeConfig(ctx context.Context, onchainConfig []byte, offchainConfig []byte) (cciptypes.Address, error) { + onchainConfigParsed, err := abihelpers.DecodeAbiStruct[ccip.CommitOnchainConfig](onchainConfig) + if err != nil { + return "", err + } + + offchainConfigParsed, err := ccipconfig.DecodeOffchainConfig[ccip.JSONCommitOffchainConfigV1_2_0](offchainConfig) + if err != nil { + return "", err + } + + i.gasPriceEstimator = prices.NewDAGasPriceEstimator( + i.estimator, + i.sourceMaxGasPrice, + int64(offchainConfigParsed.ExecGasPriceDeviationPPB), + int64(offchainConfigParsed.DAGasPriceDeviationPPB), + ) + i.offchainConfig = ccip.NewCommitOffchainConfig( + offchainConfigParsed.ExecGasPriceDeviationPPB, + offchainConfigParsed.GasPriceHeartBeat.Duration(), + offchainConfigParsed.TokenPriceDeviationPPB, + offchainConfigParsed.TokenPriceHeartBeat.Duration(), + offchainConfigParsed.InflightCacheExpiry.Duration(), + offchainConfigParsed.PriceReportingDisabled, + ) + + return cciptypes.Address(onchainConfigParsed.PriceRegistry.String()), nil +} + +func (i *IncompleteSourceCommitStoreReader) DecodeCommitReport(ctx context.Context, report []byte) (cciptypes.CommitStoreReport, error) { + return cciptypes.CommitStoreReport{}, fmt.Errorf("invalid usage of IncompleteSourceCommitStoreReader") +} + +func (i *IncompleteSourceCommitStoreReader) EncodeCommitReport(ctx context.Context, report cciptypes.CommitStoreReport) ([]byte, error) { + return []byte{}, fmt.Errorf("invalid usage of IncompleteSourceCommitStoreReader") +} + +// GasPriceEstimator returns an ExecGasPriceEstimator to satisfy the GasPriceEstimatorCommit interface, +// with deviationPPB values hardcoded to 0 when this implementation is first constructed. +// When ChangeConfig is called, another call to this method must be made to fetch a GasPriceEstimator with updated values +func (i *IncompleteSourceCommitStoreReader) GasPriceEstimator(ctx context.Context) (cciptypes.GasPriceEstimatorCommit, error) { + return i.gasPriceEstimator, nil +} + +func (i *IncompleteSourceCommitStoreReader) GetAcceptedCommitReportsGteTimestamp(ctx context.Context, ts time.Time, confirmations int) ([]cciptypes.CommitStoreReportWithTxMeta, error) { + return nil, fmt.Errorf("invalid usage of IncompleteSourceCommitStoreReader") +} + +func (i *IncompleteSourceCommitStoreReader) GetCommitReportMatchingSeqNum(ctx context.Context, seqNum uint64, confirmations int) ([]cciptypes.CommitStoreReportWithTxMeta, error) { + return nil, fmt.Errorf("invalid usage of IncompleteSourceCommitStoreReader") +} + +func (i *IncompleteSourceCommitStoreReader) GetCommitStoreStaticConfig(ctx context.Context) (cciptypes.CommitStoreStaticConfig, error) { + return cciptypes.CommitStoreStaticConfig{}, fmt.Errorf("invalid usage of IncompleteSourceCommitStoreReader") +} + +func (i *IncompleteSourceCommitStoreReader) GetExpectedNextSequenceNumber(ctx context.Context) (uint64, error) { + return 0, fmt.Errorf("invalid usage of IncompleteSourceCommitStoreReader") +} + +func (i *IncompleteSourceCommitStoreReader) GetLatestPriceEpochAndRound(ctx context.Context) (uint64, error) { + return 0, fmt.Errorf("invalid usage of IncompleteSourceCommitStoreReader") +} + +func (i *IncompleteSourceCommitStoreReader) IsBlessed(ctx context.Context, root [32]byte) (bool, error) { + return false, fmt.Errorf("invalid usage of IncompleteSourceCommitStoreReader") +} + +func (i *IncompleteSourceCommitStoreReader) IsDestChainHealthy(ctx context.Context) (bool, error) { + return false, fmt.Errorf("invalid usage of IncompleteSourceCommitStoreReader") +} + +func (i *IncompleteSourceCommitStoreReader) IsDown(ctx context.Context) (bool, error) { + return false, fmt.Errorf("invalid usage of IncompleteSourceCommitStoreReader") +} + +func (i *IncompleteSourceCommitStoreReader) OffchainConfig(ctx context.Context) (cciptypes.CommitOffchainConfig, error) { + return i.offchainConfig, nil +} + +func (i *IncompleteSourceCommitStoreReader) VerifyExecutionReport(ctx context.Context, report cciptypes.ExecReport) (bool, error) { + return false, fmt.Errorf("invalid usage of IncompleteSourceCommitStoreReader") +} + +func (i *IncompleteSourceCommitStoreReader) Close() error { + return fmt.Errorf("invalid usage of IncompleteSourceCommitStoreReader") +} + +// IncompleteDestCommitStoreReader is an implementation of CommitStoreReader with all valid methods except +// GasPriceEstimator, ChangeConfig, and OffchainConfig. +type IncompleteDestCommitStoreReader struct { + cs cciptypes.CommitStoreReader +} + +func NewIncompleteDestCommitStoreReader(lggr logger.Logger, versionFinder ccip.VersionFinder, address cciptypes.Address, ec client.Client, lp logpoller.LogPoller) (*IncompleteDestCommitStoreReader, error) { + cs, err := ccip.NewCommitStoreReader(lggr, versionFinder, address, ec, lp) + if err != nil { + return nil, err + } + + return &IncompleteDestCommitStoreReader{ + cs: cs, + }, nil +} + +func (i *IncompleteDestCommitStoreReader) ChangeConfig(ctx context.Context, onchainConfig []byte, offchainConfig []byte) (cciptypes.Address, error) { + return "", fmt.Errorf("invalid usage of IncompleteDestCommitStoreReader") +} + +func (i *IncompleteDestCommitStoreReader) DecodeCommitReport(ctx context.Context, report []byte) (cciptypes.CommitStoreReport, error) { + return i.cs.DecodeCommitReport(ctx, report) +} + +func (i *IncompleteDestCommitStoreReader) EncodeCommitReport(ctx context.Context, report cciptypes.CommitStoreReport) ([]byte, error) { + return i.cs.EncodeCommitReport(ctx, report) +} + +func (i *IncompleteDestCommitStoreReader) GasPriceEstimator(ctx context.Context) (cciptypes.GasPriceEstimatorCommit, error) { + return nil, fmt.Errorf("invalid usage of IncompleteDestCommitStoreReader") +} + +func (i *IncompleteDestCommitStoreReader) GetAcceptedCommitReportsGteTimestamp(ctx context.Context, ts time.Time, confirmations int) ([]cciptypes.CommitStoreReportWithTxMeta, error) { + return i.cs.GetAcceptedCommitReportsGteTimestamp(ctx, ts, confirmations) +} + +func (i *IncompleteDestCommitStoreReader) GetCommitReportMatchingSeqNum(ctx context.Context, seqNum uint64, confirmations int) ([]cciptypes.CommitStoreReportWithTxMeta, error) { + return i.cs.GetCommitReportMatchingSeqNum(ctx, seqNum, confirmations) +} + +func (i *IncompleteDestCommitStoreReader) GetCommitStoreStaticConfig(ctx context.Context) (cciptypes.CommitStoreStaticConfig, error) { + return i.cs.GetCommitStoreStaticConfig(ctx) +} + +func (i *IncompleteDestCommitStoreReader) GetExpectedNextSequenceNumber(ctx context.Context) (uint64, error) { + return i.cs.GetExpectedNextSequenceNumber(ctx) +} + +func (i *IncompleteDestCommitStoreReader) GetLatestPriceEpochAndRound(ctx context.Context) (uint64, error) { + return i.cs.GetLatestPriceEpochAndRound(ctx) +} + +func (i *IncompleteDestCommitStoreReader) IsBlessed(ctx context.Context, root [32]byte) (bool, error) { + return i.cs.IsBlessed(ctx, root) +} + +func (i *IncompleteDestCommitStoreReader) IsDestChainHealthy(ctx context.Context) (bool, error) { + return i.cs.IsDestChainHealthy(ctx) +} + +func (i *IncompleteDestCommitStoreReader) IsDown(ctx context.Context) (bool, error) { + return i.cs.IsDown(ctx) +} + +func (i *IncompleteDestCommitStoreReader) OffchainConfig(ctx context.Context) (cciptypes.CommitOffchainConfig, error) { + return cciptypes.CommitOffchainConfig{}, fmt.Errorf("invalid usage of IncompleteDestCommitStoreReader") +} + +func (i *IncompleteDestCommitStoreReader) VerifyExecutionReport(ctx context.Context, report cciptypes.ExecReport) (bool, error) { + return i.cs.VerifyExecutionReport(ctx, report) +} + +func (i *IncompleteDestCommitStoreReader) Close() error { + return i.cs.Close() +} diff --git a/core/services/relay/evm/ccip_test.go b/core/services/relay/evm/ccip_test.go new file mode 100644 index 00000000000..8c0bfe182e1 --- /dev/null +++ b/core/services/relay/evm/ccip_test.go @@ -0,0 +1,18 @@ +package evm + +import ( + "math/big" + "testing" + + "github.com/stretchr/testify/assert" +) + +func Test_CCIPSubjectUUID(t *testing.T) { + // We want the function to be + // (1) an actual function (i.e., deterministic) + assert.Equal(t, chainToUUID(big.NewInt(1)), chainToUUID(big.NewInt(1))) + // (2) injective (produce different results for different inputs) + assert.NotEqual(t, chainToUUID(big.NewInt(1)), chainToUUID(big.NewInt(2))) + // (3) stable across runs + assert.Equal(t, "c980e777-c95c-577b-83f6-ceb26a1a982d", chainToUUID(big.NewInt(1)).String()) +} diff --git a/core/services/relay/evm/chain_components_test.go b/core/services/relay/evm/chain_components_test.go new file mode 100644 index 00000000000..50c530904dd --- /dev/null +++ b/core/services/relay/evm/chain_components_test.go @@ -0,0 +1,311 @@ +package evm_test + +import ( + "context" + "crypto/ecdsa" + "fmt" + "math" + "math/big" + "os" + "strconv" + "testing" + "time" + + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/accounts/abi/bind/backends" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/crypto" + "github.com/jmoiron/sqlx" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + commonconfig "github.com/smartcontractkit/chainlink-common/pkg/config" + commontestutils "github.com/smartcontractkit/chainlink-common/pkg/loop/testutils" + clcommontypes "github.com/smartcontractkit/chainlink-common/pkg/types" + "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ethkey" + + "github.com/smartcontractkit/chainlink/v2/core/logger" + "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" + "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm" + "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/types" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" + evmtxmgr "github.com/smartcontractkit/chainlink/v2/core/chains/evm/txmgr" + "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/configtest" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/pgtest" + keytypes "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ethkey" + . "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/evmtesting" //nolint common practice to import test mods with . +) + +const commonGasLimitOnEvms = uint64(4712388) + +func TestContractReaderEventsInitValidation(t *testing.T) { + tests := []struct { + name string + chainContractReaders map[string]types.ChainContractReader + expectedError error + }{ + { + name: "Invalid ABI", + chainContractReaders: map[string]types.ChainContractReader{ + "InvalidContract": { + ContractABI: "{invalid json}", + Configs: map[string]*types.ChainReaderDefinition{}, + }, + }, + expectedError: fmt.Errorf("failed to parse abi"), + }, + { + name: "Conflicting polling filter definitions", + chainContractReaders: map[string]types.ChainContractReader{ + "ContractWithConflict": { + ContractABI: "[]", + Configs: map[string]*types.ChainReaderDefinition{ + "EventWithConflict": { + ChainSpecificName: "EventName", + ReadType: types.Event, + EventDefinitions: &types.EventDefinitions{ + PollingFilter: &types.PollingFilter{}, + }, + }, + }, + ContractPollingFilter: types.ContractPollingFilter{ + GenericEventNames: []string{"EventWithConflict"}, + }, + }, + }, + expectedError: fmt.Errorf( + "%w: conflicting chain reader polling filter definitions for contract: %s event: %s, can't have polling filter defined both on contract and event level", + clcommontypes.ErrInvalidConfig, "ContractWithConflict", "EventWithConflict"), + }, + { + name: "No polling filter defined", + chainContractReaders: map[string]types.ChainContractReader{ + "ContractWithNoFilter": { + ContractABI: "[]", + Configs: map[string]*types.ChainReaderDefinition{ + "EventWithNoFilter": { + ChainSpecificName: "EventName", + ReadType: types.Event, + }, + }, + }, + }, + expectedError: fmt.Errorf( + "%w: chain reader has no polling filter defined for contract: %s, event: %s", + clcommontypes.ErrInvalidConfig, "ContractWithNoFilter", "EventWithNoFilter"), + }, + { + name: "Invalid chain reader definition read type", + chainContractReaders: map[string]types.ChainContractReader{ + "ContractWithInvalidReadType": { + ContractABI: "[]", + Configs: map[string]*types.ChainReaderDefinition{ + "InvalidReadType": { + ChainSpecificName: "InvalidName", + ReadType: types.ReadType(2), + }, + }, + }, + }, + expectedError: fmt.Errorf( + "%w: invalid chain reader definition read type", + clcommontypes.ErrInvalidConfig), + }, + { + name: "Event not present in ABI", + chainContractReaders: map[string]types.ChainContractReader{ + "ContractWithConflict": { + ContractABI: "[{\"anonymous\":false,\"inputs\":[],\"name\":\"WrongEvent\",\"type\":\"event\"}]", + Configs: map[string]*types.ChainReaderDefinition{ + "SomeEvent": { + ChainSpecificName: "EventName", + ReadType: types.Event, + }, + }, + ContractPollingFilter: types.ContractPollingFilter{ + GenericEventNames: []string{"SomeEvent"}, + }, + }, + }, + expectedError: fmt.Errorf( + "%w: event %s doesn't exist", + clcommontypes.ErrInvalidConfig, "EventName"), + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + _, err := evm.NewChainReaderService(testutils.Context(t), logger.NullLogger, nil, nil, nil, types.ChainReaderConfig{Contracts: tt.chainContractReaders}) + require.Error(t, err) + if err != nil { + assert.Contains(t, err.Error(), tt.expectedError.Error()) + } + }) + } +} + +func TestChainComponents(t *testing.T) { + t.Parallel() + it := &EVMChainComponentsInterfaceTester[*testing.T]{Helper: &helper{}} + + it.Helper.Init(t) + + // add new subtests here so that it can be run on real chains too + RunChainComponentsEvmTests(t, it) + RunChainComponentsInLoopEvmTests[*testing.T](t, commontestutils.WrapContractReaderTesterForLoop(it)) +} + +type helper struct { + sim *backends.SimulatedBackend + accounts []*bind.TransactOpts + deployerKey *ecdsa.PrivateKey + senderKey *ecdsa.PrivateKey + txm evmtxmgr.TxManager + client client.Client + db *sqlx.DB +} + +func (h *helper) Init(t *testing.T) { + h.SetupKeys(t) + + h.accounts = h.Accounts(t) + + h.db = pgtest.NewSqlxDB(t) + + h.Backend() + h.client = h.Client(t) + + h.txm = h.TXM(t, h.client) + h.Commit() +} + +func (h *helper) SetupKeys(t *testing.T) { + deployerPkey, err := crypto.GenerateKey() + require.NoError(t, err) + h.deployerKey = deployerPkey + + senderPkey, err := crypto.GenerateKey() + require.NoError(t, err) + h.senderKey = senderPkey +} + +func (h *helper) Accounts(t *testing.T) []*bind.TransactOpts { + if h.accounts != nil { + return h.accounts + } + deployer, err := bind.NewKeyedTransactorWithChainID(h.deployerKey, big.NewInt(1337)) + require.NoError(t, err) + + sender, err := bind.NewKeyedTransactorWithChainID(h.senderKey, big.NewInt(1337)) + require.NoError(t, err) + + return []*bind.TransactOpts{deployer, sender} +} + +func (h *helper) MustGenerateRandomKey(t *testing.T) ethkey.KeyV2 { + return cltest.MustGenerateRandomKey(t) +} + +func (h *helper) GasPriceBufferPercent() int64 { + return 0 +} + +func (h *helper) Backend() bind.ContractBackend { + if h.sim == nil { + h.sim = backends.NewSimulatedBackend( + core.GenesisAlloc{h.accounts[0].From: {Balance: big.NewInt(math.MaxInt64)}, h.accounts[1].From: {Balance: big.NewInt(math.MaxInt64)}}, commonGasLimitOnEvms*5000) + cltest.Mine(h.sim, 1*time.Second) + } + + return h.sim +} + +func (h *helper) Commit() { + h.sim.Commit() +} + +func (h *helper) Client(t *testing.T) client.Client { + if h.client != nil { + return h.client + } + return client.NewSimulatedBackendClient(t, h.sim, big.NewInt(1337)) +} + +func (h *helper) ChainID() *big.Int { + return testutils.SimulatedChainID +} + +func (h *helper) NewSqlxDB(t *testing.T) *sqlx.DB { + return pgtest.NewSqlxDB(t) +} + +func (h *helper) Context(t *testing.T) context.Context { + return testutils.Context(t) +} + +func (h *helper) ChainReaderEVMClient(ctx context.Context, t *testing.T, ht logpoller.HeadTracker, conf types.ChainReaderConfig) client.Client { + // wrap the client so that we can mock historical contract state + cwh := &evm.ClientWithContractHistory{Client: h.Client(t), HT: ht} + require.NoError(t, cwh.Init(ctx, conf)) + return cwh +} + +func (h *helper) WrappedChainWriter(cw clcommontypes.ChainWriter, client client.Client) clcommontypes.ChainWriter { + cwhw := evm.NewChainWriterHistoricalWrapper(cw, client.(*evm.ClientWithContractHistory)) + return cwhw +} + +func (h *helper) MaxWaitTimeForEvents() time.Duration { + // From trial and error, when running on CI, sometimes the boxes get slow + maxWaitTime := time.Second * 30 + maxWaitTimeStr, ok := os.LookupEnv("MAX_WAIT_TIME_FOR_EVENTS_S") + if ok { + waitS, err := strconv.ParseInt(maxWaitTimeStr, 10, 64) + if err != nil { + fmt.Printf("Error parsing MAX_WAIT_TIME_FOR_EVENTS_S: %v, defaulting to %v\n", err, maxWaitTime) + } + maxWaitTime = time.Second * time.Duration(waitS) + } + return maxWaitTime +} + +func (h *helper) TXM(t *testing.T, client client.Client) evmtxmgr.TxManager { + if h.txm != nil { + return h.txm + } + db := h.db + + clconfig := configtest.NewGeneralConfigSimulated(t, func(c *chainlink.Config, s *chainlink.Secrets) { + c.Database.Listener.FallbackPollInterval = commonconfig.MustNewDuration(100 * time.Millisecond) + c.EVM[0].GasEstimator.EIP1559DynamicFees = ptr(true) + }) + + clconfig.EVMConfigs()[0].GasEstimator.PriceMax = assets.GWei(100) + + app := cltest.NewApplicationWithConfigV2AndKeyOnSimulatedBlockchain(t, clconfig, h.sim, db, client) + err := app.Start(h.Context(t)) + require.NoError(t, err) + + keyStore := app.KeyStore.Eth() + + keyStore.XXXTestingOnlyAdd(h.Context(t), keytypes.FromPrivateKey(h.deployerKey)) + require.NoError(t, keyStore.Add(h.Context(t), h.accounts[0].From, h.ChainID())) + require.NoError(t, keyStore.Enable(h.Context(t), h.accounts[0].From, h.ChainID())) + + keyStore.XXXTestingOnlyAdd(h.Context(t), keytypes.FromPrivateKey(h.senderKey)) + require.NoError(t, keyStore.Add(h.Context(t), h.accounts[1].From, h.ChainID())) + require.NoError(t, keyStore.Enable(h.Context(t), h.accounts[1].From, h.ChainID())) + + chain, err := app.GetRelayers().LegacyEVMChains().Get((h.ChainID()).String()) + require.NoError(t, err) + + h.txm = chain.TxManager() + return h.txm +} + +func ptr[T any](v T) *T { return &v } diff --git a/core/services/relay/evm/chain_reader.go b/core/services/relay/evm/chain_reader.go index 9cfe846d55d..e5041f5486a 100644 --- a/core/services/relay/evm/chain_reader.go +++ b/core/services/relay/evm/chain_reader.go @@ -4,26 +4,28 @@ import ( "context" "errors" "fmt" - "reflect" + "maps" "slices" "strings" - "sync" "time" "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/common" - "github.com/smartcontractkit/chainlink-common/pkg/codec" - "github.com/smartcontractkit/chainlink-common/pkg/types/query" - "github.com/smartcontractkit/chainlink-common/pkg/types/query/primitives" - + commoncodec "github.com/smartcontractkit/chainlink-common/pkg/codec" + "github.com/smartcontractkit/chainlink-common/pkg/logger" commonservices "github.com/smartcontractkit/chainlink-common/pkg/services" commontypes "github.com/smartcontractkit/chainlink-common/pkg/types" + "github.com/smartcontractkit/chainlink-common/pkg/types/query" + "github.com/smartcontractkit/chainlink-common/pkg/types/query/primitives" + "github.com/smartcontractkit/chainlink-common/pkg/values" evmclient "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" - "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services" + "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/codec" + "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/read" "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/types" ) @@ -33,12 +35,14 @@ type ChainReaderService interface { } type chainReader struct { - lggr logger.Logger - lp logpoller.LogPoller - client evmclient.Client - contractBindings bindings - parsed *parsedTypes - codec commontypes.RemoteCodec + commontypes.UnimplementedContractReader + lggr logger.Logger + ht logpoller.HeadTracker + lp logpoller.LogPoller + client evmclient.Client + parsed *codec.ParsedTypes + bindings *read.BindingsRegistry + codec commontypes.RemoteCodec commonservices.StateMachine } @@ -47,13 +51,14 @@ var _ commontypes.ContractTypeProvider = &chainReader{} // NewChainReaderService is a constructor for ChainReader, returns nil if there is any error // Note that the ChainReaderService returned does not support anonymous events. -func NewChainReaderService(ctx context.Context, lggr logger.Logger, lp logpoller.LogPoller, client evmclient.Client, config types.ChainReaderConfig) (ChainReaderService, error) { +func NewChainReaderService(_ context.Context, lggr logger.Logger, lp logpoller.LogPoller, ht logpoller.HeadTracker, client evmclient.Client, config types.ChainReaderConfig) (ChainReaderService, error) { cr := &chainReader{ - lggr: lggr.Named("ChainReader"), - lp: lp, - client: client, - contractBindings: bindings{}, - parsed: &parsedTypes{encoderDefs: map[string]types.CodecEntry{}, decoderDefs: map[string]types.CodecEntry{}}, + lggr: logger.Named(lggr, "ChainReader"), + ht: ht, + lp: lp, + client: client, + bindings: read.NewBindingsRegistry(), + parsed: &codec.ParsedTypes{EncoderDefs: map[string]types.CodecEntry{}, DecoderDefs: map[string]types.CodecEntry{}}, } var err error @@ -61,16 +66,20 @@ func NewChainReaderService(ctx context.Context, lggr logger.Logger, lp logpoller return nil, err } - if cr.codec, err = cr.parsed.toCodec(); err != nil { + if cr.codec, err = cr.parsed.ToCodec(); err != nil { return nil, err } - err = cr.contractBindings.ForEach(ctx, func(c context.Context, cb *contractBinding) error { - for _, rb := range cb.readBindings { - rb.SetCodec(cr.codec) - } - return nil - }) + cr.bindings.SetBatchCaller(read.NewDynamicLimitedBatchCaller( + cr.lggr, + cr.codec, + cr.client, + read.DefaultRpcBatchSizeLimit, + read.DefaultRpcBatchBackOffMultiplier, + read.DefaultMaxParallelRpcCalls, + )) + + cr.bindings.SetCodecAll(cr.codec) return cr, err } @@ -118,7 +127,14 @@ func (cr *chainReader) init(chainContractReaders map[string]types.ChainContractR return err } } - cr.contractBindings[contractName].pollingFilter = chainContractReader.PollingFilter.ToLPFilter(eventSigsForContractFilter) + + if !cr.bindings.HasContractBinding(contractName) { + return fmt.Errorf("%w: no read bindings added for contract: %s", commontypes.ErrInvalidConfig, contractName) + } + + if err = cr.bindings.SetFilter(contractName, chainContractReader.PollingFilter.ToLPFilter(eventSigsForContractFilter)); err != nil { + return err + } } return nil } @@ -128,14 +144,7 @@ func (cr *chainReader) Name() string { return cr.lggr.Name() } // Start registers polling filters if contracts are already bound. func (cr *chainReader) Start(ctx context.Context) error { return cr.StartOnce("ChainReader", func() error { - return cr.contractBindings.ForEach(ctx, func(c context.Context, cb *contractBinding) error { - for _, rb := range cb.readBindings { - if err := rb.Register(ctx); err != nil { - return err - } - } - return cb.Register(ctx, cr.lp) - }) + return cr.bindings.RegisterAll(ctx, cr.lp) }) } @@ -144,14 +153,7 @@ func (cr *chainReader) Close() error { return cr.StopOnce("ChainReader", func() error { ctx, cancel := context.WithTimeout(context.Background(), time.Second) defer cancel() - return cr.contractBindings.ForEach(ctx, func(c context.Context, cb *contractBinding) error { - for _, rb := range cb.readBindings { - if err := rb.Unregister(ctx); err != nil { - return err - } - } - return cb.Unregister(ctx, cr.lp) - }) + return cr.bindings.UnregisterAll(ctx, cr.lp) }) } @@ -161,37 +163,93 @@ func (cr *chainReader) HealthReport() map[string]error { return map[string]error{cr.Name(): nil} } -func (cr *chainReader) GetLatestValue(ctx context.Context, contractName, method string, params any, returnVal any) error { - b, err := cr.contractBindings.GetReadBinding(contractName, method) +func (cr *chainReader) Bind(ctx context.Context, bindings []commontypes.BoundContract) error { + return cr.bindings.Bind(ctx, cr.lp, bindings) +} + +func (cr *chainReader) Unbind(ctx context.Context, bindings []commontypes.BoundContract) error { + return cr.bindings.Unbind(ctx, cr.lp, bindings) +} + +func (cr *chainReader) GetLatestValue(ctx context.Context, readName string, confidenceLevel primitives.ConfidenceLevel, params any, returnVal any) error { + binding, address, err := cr.bindings.GetReader(readName) + if err != nil { + return err + } + + ptrToValue, isValue := returnVal.(*values.Value) + if !isValue { + return binding.GetLatestValue(ctx, common.HexToAddress(address), confidenceLevel, params, returnVal) + } + + contractType, err := cr.CreateContractType(readName, false) if err != nil { return err } - return b.GetLatestValue(ctx, params, returnVal) + if err = cr.GetLatestValue(ctx, readName, confidenceLevel, params, contractType); err != nil { + return err + } + + value, err := values.Wrap(contractType) + if err != nil { + return err + } + + *ptrToValue = value + + return nil } -func (cr *chainReader) Bind(ctx context.Context, bindings []commontypes.BoundContract) error { - return cr.contractBindings.Bind(ctx, cr.lp, bindings) +func (cr *chainReader) BatchGetLatestValues(ctx context.Context, request commontypes.BatchGetLatestValuesRequest) (commontypes.BatchGetLatestValuesResult, error) { + return cr.bindings.BatchGetLatestValues(ctx, request) } -func (cr *chainReader) QueryKey(ctx context.Context, contractName string, filter query.KeyFilter, limitAndSort query.LimitAndSort, sequenceDataType any) ([]commontypes.Sequence, error) { - b, err := cr.contractBindings.GetReadBinding(contractName, filter.Key) +func (cr *chainReader) QueryKey( + ctx context.Context, + contract commontypes.BoundContract, + filter query.KeyFilter, + limitAndSort query.LimitAndSort, + sequenceDataType any, +) ([]commontypes.Sequence, error) { + binding, address, err := cr.bindings.GetReader(contract.ReadIdentifier(filter.Key)) if err != nil { return nil, err } - return b.QueryKey(ctx, filter, limitAndSort, sequenceDataType) -} + _, isValuePtr := sequenceDataType.(*values.Value) + if !isValuePtr { + return binding.QueryKey(ctx, common.HexToAddress(address), filter, limitAndSort, sequenceDataType) + } -func (cr *chainReader) CreateContractType(contractName, itemType string, forEncoding bool) (any, error) { - return cr.codec.CreateType(wrapItemType(contractName, itemType, forEncoding), forEncoding) -} + dataTypeFromReadIdentifier, err := cr.CreateContractType(contract.ReadIdentifier(filter.Key), false) + if err != nil { + return nil, err + } -func wrapItemType(contractName, itemType string, isParams bool) string { - if isParams { - return fmt.Sprintf("params.%s.%s", contractName, itemType) + sequence, err := binding.QueryKey(ctx, common.HexToAddress(address), filter, limitAndSort, dataTypeFromReadIdentifier) + if err != nil { + return nil, err } - return fmt.Sprintf("return.%s.%s", contractName, itemType) + + sequenceOfValues := make([]commontypes.Sequence, len(sequence)) + for idx, entry := range sequence { + value, err := values.Wrap(entry.Data) + if err != nil { + return nil, err + } + sequenceOfValues[idx] = commontypes.Sequence{ + Cursor: entry.Cursor, + Head: entry.Head, + Data: &value, + } + } + + return sequenceOfValues, nil +} + +func (cr *chainReader) CreateContractType(readIdentifier string, forEncoding bool) (any, error) { + return cr.codec.CreateType(cr.bindings.ReadTypeIdentifier(readIdentifier, forEncoding), forEncoding) } func (cr *chainReader) addMethod( @@ -204,17 +262,20 @@ func (cr *chainReader) addMethod( return fmt.Errorf("%w: method %s doesn't exist", commontypes.ErrInvalidConfig, chainReaderDefinition.ChainSpecificName) } - cr.contractBindings.AddReadBinding(contractName, methodName, &methodBinding{ - contractName: contractName, - method: methodName, - client: cr.client, - }) + confirmations, err := ConfirmationsFromConfig(chainReaderDefinition.ConfidenceConfirmations) + if err != nil { + return err + } + + if err = cr.bindings.AddReader(contractName, methodName, read.NewMethodBinding(contractName, methodName, cr.client, cr.ht, confirmations, cr.lggr)); err != nil { + return err + } - if err := cr.addEncoderDef(contractName, methodName, method.Inputs, method.ID, chainReaderDefinition); err != nil { + if err = cr.addEncoderDef(contractName, methodName, method.Inputs, method.ID, chainReaderDefinition.InputModifications); err != nil { return err } - return cr.addDecoderDef(contractName, methodName, method.Outputs, chainReaderDefinition) + return cr.addDecoderDef(contractName, methodName, method.Outputs, chainReaderDefinition.OutputModifications) } func (cr *chainReader) addEvent(contractName, eventName string, a abi.ABI, chainReaderDefinition types.ChainReaderDefinition) error { @@ -223,116 +284,119 @@ func (cr *chainReader) addEvent(contractName, eventName string, a abi.ABI, chain return fmt.Errorf("%w: event %s doesn't exist", commontypes.ErrInvalidConfig, chainReaderDefinition.ChainSpecificName) } - var inputFields []string - if chainReaderDefinition.EventDefinitions != nil { - inputFields = chainReaderDefinition.EventDefinitions.InputFields - } - - filterArgs, codecTopicInfo, indexArgNames := setupEventInput(event, inputFields) - if err := verifyEventIndexedInputsUsed(eventName, inputFields, indexArgNames); err != nil { - return err - } - - if err := codecTopicInfo.Init(); err != nil { - return err - } - - // Encoder def's codec won't be used to encode, only for its type as input for GetLatestValue - if err := cr.addEncoderDef(contractName, eventName, filterArgs, nil, chainReaderDefinition); err != nil { + indexedAsUnIndexedABITypes, indexedTopicsCodecTypes, eventDWs := getEventTypes(event) + if err := indexedTopicsCodecTypes.Init(); err != nil { return err } - inputInfo, inputModifier, err := cr.getEventInput(chainReaderDefinition, contractName, eventName) + // Encoder defs codec won't be used for encoding, but for storing caller filtering params which won't be hashed. + err := cr.addEncoderDef(contractName, eventName, indexedAsUnIndexedABITypes, nil, chainReaderDefinition.InputModifications) if err != nil { return err } - confirmations, err := confirmationsFromConfig(chainReaderDefinition.ConfidenceConfirmations) + codecTypes, codecModifiers := make(map[string]types.CodecEntry), make(map[string]commoncodec.Modifier) + topicTypeID := codec.WrapItemType(contractName, eventName, true) + codecTypes[topicTypeID], codecModifiers[topicTypeID] = cr.getEventItemTypeAndModifier(topicTypeID) + + confirmations, err := ConfirmationsFromConfig(chainReaderDefinition.ConfidenceConfirmations) if err != nil { return err } - eb := &eventBinding{ - contractName: contractName, - eventName: eventName, - lp: cr.lp, - hash: event.ID, - inputInfo: inputInfo, - inputModifier: inputModifier, - codecTopicInfo: codecTopicInfo, - topics: make(map[string]topicDetail), - eventDataWords: make(map[string]uint8), - confirmationsMapping: confirmations, - } - + eb := read.NewEventBinding(contractName, eventName, cr.lp, event.ID, indexedTopicsCodecTypes, confirmations) if eventDefinitions := chainReaderDefinition.EventDefinitions; eventDefinitions != nil { if eventDefinitions.PollingFilter != nil { - eb.filterRegisterer = &filterRegisterer{ - pollingFilter: eventDefinitions.PollingFilter.ToLPFilter(evmtypes.HashArray{a.Events[event.Name].ID}), - filterLock: sync.Mutex{}, - } + eb.SetFilter(eventDefinitions.PollingFilter.ToLPFilter(evmtypes.HashArray{a.Events[event.Name].ID})) } - if eventDefinitions.GenericDataWordNames != nil { - eb.eventDataWords = eventDefinitions.GenericDataWordNames + topicsDetails, topicsCodecTypeInfo, topicsModifiers, initQueryingErr := cr.initTopicQuerying(contractName, eventName, event.Inputs, eventDefinitions.GenericTopicNames, chainReaderDefinition.InputModifications) + if initQueryingErr != nil { + return initQueryingErr + } + maps.Copy(codecTypes, topicsCodecTypeInfo) + // TODO BCFR-44 reused GetLatestValue params modifiers, probably can be left like this + maps.Copy(codecModifiers, topicsModifiers) + + // TODO BCFR-44 no dw modifier for now + dataWordsDetails, dWSCodecTypeInfo, initDWQueryingErr := cr.initDWQuerying(contractName, eventName, eventDWs, eventDefinitions.GenericDataWordNames) + if initDWQueryingErr != nil { + return initDWQueryingErr } + maps.Copy(codecTypes, dWSCodecTypeInfo) - cr.addQueryingReadBindings(contractName, eventDefinitions.GenericTopicNames, event.Inputs, eb) + eb.SetTopicDetails(topicsDetails) + eb.SetDataWordsDetails(dataWordsDetails) } - cr.contractBindings.AddReadBinding(contractName, eventName, eb) + eb.SetCodecTypesAndModifiers(codecTypes, codecModifiers) + if err = cr.bindings.AddReader(contractName, eventName, eb); err != nil { + return err + } - return cr.addDecoderDef(contractName, eventName, event.Inputs, chainReaderDefinition) + return cr.addDecoderDef(contractName, eventName, event.Inputs, chainReaderDefinition.OutputModifications) } -// addQueryingReadBindings reuses the eventBinding and maps it to topic and dataWord keys used for QueryKey. -func (cr *chainReader) addQueryingReadBindings(contractName string, genericTopicNames map[string]string, eventInputs abi.Arguments, eb *eventBinding) { - // add topic readBindings for QueryKey +// initTopicQuerying registers codec types and modifiers for topics to be used for typing value comparator QueryKey filters. +func (cr *chainReader) initTopicQuerying(contractName, eventName string, eventInputs abi.Arguments, genericTopicNames map[string]string, inputModifications commoncodec.ModifiersConfig) (map[string]read.TopicDetail, map[string]types.CodecEntry, map[string]commoncodec.Modifier, error) { + topicsDetails := make(map[string]read.TopicDetail) + topicsTypes := make(map[string]types.CodecEntry) + topicsModifiers := make(map[string]commoncodec.Modifier) for topicIndex, topic := range eventInputs { genericTopicName, ok := genericTopicNames[topic.Name] if ok { - eb.topics[genericTopicName] = topicDetail{ - Argument: topic, - Index: uint64(topicIndex), + topicsDetails[genericTopicName] = read.TopicDetail{Argument: topic, Index: uint64(topicIndex + 1)} + + topicTypeID := eventName + "." + genericTopicName + if err := cr.addEncoderDef(contractName, topicTypeID, abi.Arguments{{Type: topic.Type}}, nil, inputModifications); err != nil { + return nil, nil, nil, err } - } - cr.contractBindings.AddReadBinding(contractName, genericTopicName, eb) - } - // add data word readBindings for QueryKey - for genericDataWordName := range eb.eventDataWords { - cr.contractBindings.AddReadBinding(contractName, genericDataWordName, eb) + topicCodecTypeID := codec.WrapItemType(contractName, topicTypeID, true) + topicsTypes[topicCodecTypeID], topicsModifiers[topicCodecTypeID] = cr.getEventItemTypeAndModifier(topicCodecTypeID) + } } + return topicsDetails, topicsTypes, topicsModifiers, nil } -func (cr *chainReader) getEventInput(def types.ChainReaderDefinition, contractName, eventName string) ( - types.CodecEntry, codec.Modifier, error) { - inputInfo := cr.parsed.encoderDefs[wrapItemType(contractName, eventName, true)] - inMod, err := def.InputModifications.ToModifier(evmDecoderHooks...) - if err != nil { - return nil, nil, err - } +// initDWQuerying registers codec types for evm data words to be used for typing value comparator QueryKey filters. +func (cr *chainReader) initDWQuerying(contractName, eventName string, eventDWs map[string]read.DataWordDetail, dWDefs map[string]string) (map[string]read.DataWordDetail, map[string]types.CodecEntry, error) { + dwsCodecTypeInfo := make(map[string]types.CodecEntry) + dWsDetail := make(map[string]read.DataWordDetail) + + for genericName, onChainName := range dWDefs { + for eventID, dWDetail := range eventDWs { + // Extract field name in this manner to account for nested fields + fieldName := strings.Join(strings.Split(eventID, ".")[1:], ".") + if fieldName == onChainName { + dWsDetail[genericName] = dWDetail + + dwTypeID := eventName + "." + genericName + if err := cr.addEncoderDef(contractName, dwTypeID, abi.Arguments{abi.Argument{Type: dWDetail.Type}}, nil, nil); err != nil { + return nil, nil, fmt.Errorf("%w: failed to init codec for data word %s on index %d querying for event: %q", err, genericName, dWDetail.Index, eventName) + } - // initialize the modification - if _, err = inMod.RetypeToOffChain(reflect.PointerTo(inputInfo.CheckedType()), ""); err != nil { - return nil, nil, err + dwCodecTypeID := codec.WrapItemType(contractName, dwTypeID, true) + dwsCodecTypeInfo[dwCodecTypeID] = cr.parsed.EncoderDefs[dwCodecTypeID] + break + } + } + if _, ok := dWsDetail[genericName]; !ok { + return nil, nil, fmt.Errorf("failed to find data word: %q for event: %q, it either doesn't exist or can't be searched for", genericName, eventName) + } } - - return inputInfo, inMod, nil + return dWsDetail, dwsCodecTypeInfo, nil } -func verifyEventIndexedInputsUsed(eventName string, inputFields []string, indexArgNames map[string]bool) error { - for _, value := range inputFields { - if !indexArgNames[abi.ToCamelCase(value)] { - return fmt.Errorf("%w: %s is not an indexed argument of event %s", commontypes.ErrInvalidConfig, value, eventName) - } - } - return nil +// getEventItemTypeAndModifier returns codec entry for expected incoming event item and the modifier. +func (cr *chainReader) getEventItemTypeAndModifier(itemType string) (types.CodecEntry, commoncodec.Modifier) { + inputTypeInfo := cr.parsed.EncoderDefs[itemType] + return inputTypeInfo, inputTypeInfo.Modifier() } -func (cr *chainReader) addEncoderDef(contractName, itemType string, args abi.Arguments, prefix []byte, chainReaderDefinition types.ChainReaderDefinition) error { +func (cr *chainReader) addEncoderDef(contractName, itemType string, args abi.Arguments, prefix []byte, inputModifications commoncodec.ModifiersConfig) error { // ABI.Pack prepends the method.ID to the encodings, we'll need the encoder to do the same. - inputMod, err := chainReaderDefinition.InputModifications.ToModifier(evmDecoderHooks...) + inputMod, err := inputModifications.ToModifier(codec.DecoderHooks...) if err != nil { return err } @@ -342,54 +406,95 @@ func (cr *chainReader) addEncoderDef(contractName, itemType string, args abi.Arg return err } - cr.parsed.encoderDefs[wrapItemType(contractName, itemType, true)] = input + cr.parsed.EncoderDefs[codec.WrapItemType(contractName, itemType, true)] = input return nil } -func (cr *chainReader) addDecoderDef(contractName, itemType string, outputs abi.Arguments, def types.ChainReaderDefinition) error { - mod, err := def.OutputModifications.ToModifier(evmDecoderHooks...) +func (cr *chainReader) addDecoderDef(contractName, itemType string, outputs abi.Arguments, outputModifications commoncodec.ModifiersConfig) error { + mod, err := outputModifications.ToModifier(codec.DecoderHooks...) if err != nil { return err } output := types.NewCodecEntry(outputs, nil, mod) - cr.parsed.decoderDefs[wrapItemType(contractName, itemType, false)] = output + cr.parsed.DecoderDefs[codec.WrapItemType(contractName, itemType, false)] = output return output.Init() } -func setupEventInput(event abi.Event, inputFields []string) ([]abi.Argument, types.CodecEntry, map[string]bool) { - topicFieldDefs := map[string]bool{} - for _, value := range inputFields { - capFirstValue := abi.ToCamelCase(value) - topicFieldDefs[capFirstValue] = true - } - - filterArgs := make([]abi.Argument, 0, types.MaxTopicFields) - inputArgs := make([]abi.Argument, 0, len(event.Inputs)) - indexArgNames := map[string]bool{} +// getEventTypes returns abi args where indexed flag is set to false because we expect caller to filter with params that aren't hashed, +// codecEntry where expected on chain types are set, for e.g. indexed topics of type string or uint8[32] array are expected as common.Hash onchain, +// and un-indexed data info in form of evm indexed 32 byte data words. +func getEventTypes(event abi.Event) ([]abi.Argument, types.CodecEntry, map[string]read.DataWordDetail) { + indexedAsUnIndexedTypes := make([]abi.Argument, 0, types.MaxTopicFields) + indexedTypes := make([]abi.Argument, 0, len(event.Inputs)) + dataWords := make(map[string]read.DataWordDetail) + var dwIndex int for _, input := range event.Inputs { if !input.Indexed { + dwIndex = calculateFieldDWIndex(input, event.Name+"."+input.Name, dataWords, dwIndex) continue } - filterWith := topicFieldDefs[abi.ToCamelCase(input.Name)] - if filterWith { - // When presenting the filter off-chain, - // the user will provide the unhashed version of the input - // The reader will hash topics if needed. - inputUnindexed := input - inputUnindexed.Indexed = false - filterArgs = append(filterArgs, inputUnindexed) - } + indexedAsUnIndexed := input + indexedAsUnIndexed.Indexed = false + // when presenting the filter off-chain, the caller will provide the unHashed version of the input and CR will hash topics when needed. + indexedAsUnIndexedTypes = append(indexedAsUnIndexedTypes, indexedAsUnIndexed) + indexedTypes = append(indexedTypes, input) + } + + return indexedAsUnIndexedTypes, types.NewCodecEntry(indexedTypes, nil, nil), dataWords +} - inputArgs = append(inputArgs, input) - indexArgNames[abi.ToCamelCase(input.Name)] = true +// calculateFieldDWIndex recursively calculates the indices of all static unindexed fields in the event +// and calculates the offset for all unsearchable / dynamic fields. +func calculateFieldDWIndex(arg abi.Argument, fieldPath string, dataWords map[string]read.DataWordDetail, index int) int { + if isDynamic(arg.Type) { + return index + 1 } - return filterArgs, types.NewCodecEntry(inputArgs, nil, nil), indexArgNames + return processFields(arg.Type, fieldPath, dataWords, index) +} + +func processFields(fieldType abi.Type, parentFieldPath string, dataWords map[string]read.DataWordDetail, index int) int { + switch fieldType.T { + case abi.TupleTy: + // Recursively process tuple elements + for i, tupleElem := range fieldType.TupleElems { + fieldName := fieldType.TupleRawNames[i] + fullFieldPath := fmt.Sprintf("%s.%s", parentFieldPath, fieldName) + index = processFields(*tupleElem, fullFieldPath, dataWords, index) + } + return index + case abi.ArrayTy: + // Static arrays are not searchable, however, we can reliably calculate their size so that the fields + // after them can be searched. + return index + fieldType.Size + default: + dataWords[parentFieldPath] = read.DataWordDetail{ + Index: index, + Argument: abi.Argument{Type: fieldType}, + } + return index + 1 + } +} + +func isDynamic(fieldType abi.Type) bool { + switch fieldType.T { + case abi.StringTy, abi.SliceTy, abi.BytesTy: + return true + case abi.TupleTy: + // If one element in a struct is dynamic, the whole struct is treated as dynamic. + for _, elem := range fieldType.TupleElems { + if isDynamic(*elem) { + return true + } + } + } + return false } -func confirmationsFromConfig(values map[string]int) (map[primitives.ConfidenceLevel]evmtypes.Confirmations, error) { +// ConfirmationsFromConfig maps chain agnostic confidence levels defined in config to predefined EVM finality. +func ConfirmationsFromConfig(values map[string]int) (map[primitives.ConfidenceLevel]evmtypes.Confirmations, error) { mappings := map[primitives.ConfidenceLevel]evmtypes.Confirmations{ primitives.Unconfirmed: evmtypes.Unconfirmed, primitives.Finalized: evmtypes.Finalized, diff --git a/core/services/relay/evm/chain_reader_historical_client_wrapper_test.go b/core/services/relay/evm/chain_reader_historical_client_wrapper_test.go new file mode 100644 index 00000000000..28984779c36 --- /dev/null +++ b/core/services/relay/evm/chain_reader_historical_client_wrapper_test.go @@ -0,0 +1,161 @@ +package evm + +import ( + "context" + "fmt" + "math" + "math/big" + "strings" + + "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + + clcommontypes "github.com/smartcontractkit/chainlink-common/pkg/types" + . "github.com/smartcontractkit/chainlink-common/pkg/types/interfacetests" //nolint common practice to import test mods with . + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" + "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/codec" + "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/types" +) + +// ClientWithContractHistory makes it possible to modify client.Client CallContract so that it returns historical data. +type ClientWithContractHistory struct { + client.Client + valsWithCall + HT logpoller.HeadTracker + codec clcommontypes.RemoteCodec +} + +func (cwh *ClientWithContractHistory) Init(_ context.Context, config types.ChainReaderConfig) error { + cwh.valsWithCall = make(map[int64]valWithCall) + parsedTypes := codec.ParsedTypes{ + EncoderDefs: make(map[string]types.CodecEntry), + DecoderDefs: make(map[string]types.CodecEntry), + } + + // setup codec for method calls + for contractName, contractCfg := range config.Contracts { + contractAbi, err := abi.JSON(strings.NewReader(contractCfg.ContractABI)) + if err != nil { + return err + } + + for genericName, readDef := range contractCfg.Configs { + if readDef.ReadType == types.Event { + continue + } + + inputMod, err := readDef.InputModifications.ToModifier(codec.DecoderHooks...) + if err != nil { + return err + } + + outputMod, err := readDef.OutputModifications.ToModifier(codec.DecoderHooks...) + if err != nil { + return err + } + + method := contractAbi.Methods[readDef.ChainSpecificName] + input, output := types.NewCodecEntry(method.Inputs, method.ID, inputMod), types.NewCodecEntry(method.Outputs, nil, outputMod) + + if err = input.Init(); err != nil { + return err + } + if err = output.Init(); err != nil { + return err + } + + parsedTypes.EncoderDefs[codec.WrapItemType(contractName, genericName, true)] = input + parsedTypes.DecoderDefs[codec.WrapItemType(contractName, genericName, false)] = output + } + } + + parsedCodec, err := parsedTypes.ToCodec() + if err != nil { + return err + } + + cwh.codec = parsedCodec + + return nil +} + +func (cwh *ClientWithContractHistory) SetUintLatestValue(ctx context.Context, val uint64, forCall ExpectedGetLatestValueArgs) error { + latestBlock, _, err := cwh.HT.LatestAndFinalizedBlock(ctx) + if err != nil { + return err + } + + cwh.valsWithCall[latestBlock.Number] = valWithCall{ + ExpectedGetLatestValueArgs: forCall, + val: val, + } + return nil +} + +// findValClosestToBlock returns the value that was added in block that is <= blockNumber, otherwise return empty valWithCall +func (cwh *ClientWithContractHistory) findValClosestToBlock(blockNumber *big.Int) (val valWithCall) { + var valIsInBlock int64 = math.MaxInt64 + for block, v := range cwh.valsWithCall { + if block <= blockNumber.Int64() && block <= valIsInBlock { + valIsInBlock, val = block, v + } + } + return val +} + +// CallContract does the standard CallContract if blockNumber is latest, otherwise returns mocked historical value since SimulatedBackend doesn't support historical calls. +func (cwh *ClientWithContractHistory) CallContract(ctx context.Context, msg ethereum.CallMsg, blockNumber *big.Int) ([]byte, error) { + latestBlock, _, err := cwh.HT.LatestAndFinalizedBlock(ctx) + if err != nil { + return nil, err + } + + if blockNumber == nil || blockNumber.Int64() == latestBlock.BlockNumber() { + return cwh.Client.CallContract(ctx, msg, blockNumber) + } + + // hardcoded to work with the simplest test case of uint64 return value with no params, since we just want to test proper finality handling. + valAndCall := cwh.findValClosestToBlock(blockNumber) + if valAndCall.ContractName == "" || valAndCall.ReadName == "" { + return nil, fmt.Errorf("no recorded values found for historical contract call in block : %s, stored historical values are: \n\t%s", blockNumber, cwh.valsWithCall.String()) + } + + // encode the expected call to compare with the actual call + dataToCmp, err := cwh.codec.Encode(ctx, valAndCall.Params, codec.WrapItemType(valAndCall.ContractName, valAndCall.ReadName, true)) + if err != nil { + return nil, err + } + + if string(msg.Data) == string(dataToCmp) { + // format the value to match the standard evm rpc response + paddedHexString := fmt.Sprintf("%064s", hexutil.EncodeUint64(valAndCall.val)[2:]) + return common.Hex2Bytes(paddedHexString), nil + } + + return nil, fmt.Errorf("found historical contract value, but it doesn't match the contract call, stored historical values are: \n\t%s", cwh.valsWithCall.String()) +} + +// valsWithCall is used to mock historical data since SimulatedBackend doesn't support it +type valsWithCall map[int64]valWithCall + +func (v valsWithCall) String() string { + result := "valsWithCall{\n" + for key, val := range v { + result += fmt.Sprintf(" Blocknumber: %d, Value: %s\n", key, val.String()) + } + result += "}" + return result +} + +type valWithCall struct { + ExpectedGetLatestValueArgs + val uint64 +} + +func (v valWithCall) String() string { + return fmt.Sprintf("{ExpectedArgs: {%s}, Value: %d}", v.ExpectedGetLatestValueArgs.String(), v.val) +} diff --git a/core/services/relay/evm/chain_reader_test.go b/core/services/relay/evm/chain_reader_test.go deleted file mode 100644 index 1e32753bc52..00000000000 --- a/core/services/relay/evm/chain_reader_test.go +++ /dev/null @@ -1,215 +0,0 @@ -package evm_test - -import ( - "context" - "fmt" - "math" - "math/big" - "os" - "strconv" - "testing" - "time" - - "github.com/ethereum/go-ethereum/accounts/abi/bind" - "github.com/ethereum/go-ethereum/accounts/abi/bind/backends" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/crypto" - "github.com/jmoiron/sqlx" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - - clcommontypes "github.com/smartcontractkit/chainlink-common/pkg/types" - . "github.com/smartcontractkit/chainlink-common/pkg/types/interfacetests" //nolint common practice to import test mods with . - - "github.com/smartcontractkit/chainlink/v2/core/logger" - "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm" - "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/types" - - commontestutils "github.com/smartcontractkit/chainlink-common/pkg/loop/testutils" - - "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" - "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" - "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/pgtest" - . "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/evmtesting" //nolint common practice to import test mods with . -) - -const commonGasLimitOnEvms = uint64(4712388) - -func TestChainReaderEventsInitValidation(t *testing.T) { - tests := []struct { - name string - chainContractReaders map[string]types.ChainContractReader - expectedError error - }{ - { - name: "Invalid ABI", - chainContractReaders: map[string]types.ChainContractReader{ - "InvalidContract": { - ContractABI: "{invalid json}", - Configs: map[string]*types.ChainReaderDefinition{}, - }, - }, - expectedError: fmt.Errorf("failed to parse abi"), - }, - { - name: "Conflicting polling filter definitions", - chainContractReaders: map[string]types.ChainContractReader{ - "ContractWithConflict": { - ContractABI: "[]", - Configs: map[string]*types.ChainReaderDefinition{ - "EventWithConflict": { - ChainSpecificName: "EventName", - ReadType: types.Event, - EventDefinitions: &types.EventDefinitions{ - PollingFilter: &types.PollingFilter{}, - }, - }, - }, - ContractPollingFilter: types.ContractPollingFilter{ - GenericEventNames: []string{"EventWithConflict"}, - }, - }, - }, - expectedError: fmt.Errorf( - "%w: conflicting chain reader polling filter definitions for contract: %s event: %s, can't have polling filter defined both on contract and event level", - clcommontypes.ErrInvalidConfig, "ContractWithConflict", "EventWithConflict"), - }, - { - name: "No polling filter defined", - chainContractReaders: map[string]types.ChainContractReader{ - "ContractWithNoFilter": { - ContractABI: "[]", - Configs: map[string]*types.ChainReaderDefinition{ - "EventWithNoFilter": { - ChainSpecificName: "EventName", - ReadType: types.Event, - }, - }, - }, - }, - expectedError: fmt.Errorf( - "%w: chain reader has no polling filter defined for contract: %s, event: %s", - clcommontypes.ErrInvalidConfig, "ContractWithNoFilter", "EventWithNoFilter"), - }, - { - name: "Invalid chain reader definition read type", - chainContractReaders: map[string]types.ChainContractReader{ - "ContractWithInvalidReadType": { - ContractABI: "[]", - Configs: map[string]*types.ChainReaderDefinition{ - "InvalidReadType": { - ChainSpecificName: "InvalidName", - ReadType: types.ReadType(2), - }, - }, - }, - }, - expectedError: fmt.Errorf( - "%w: invalid chain reader definition read type", - clcommontypes.ErrInvalidConfig), - }, - { - name: "Event not present in ABI", - chainContractReaders: map[string]types.ChainContractReader{ - "ContractWithConflict": { - ContractABI: "[{\"anonymous\":false,\"inputs\":[],\"name\":\"WrongEvent\",\"type\":\"event\"}]", - Configs: map[string]*types.ChainReaderDefinition{ - "SomeEvent": { - ChainSpecificName: "EventName", - ReadType: types.Event, - }, - }, - ContractPollingFilter: types.ContractPollingFilter{ - GenericEventNames: []string{"SomeEvent"}, - }, - }, - }, - expectedError: fmt.Errorf( - "%w: event %s doesn't exist", - clcommontypes.ErrInvalidConfig, "EventName"), - }, - } - - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - _, err := evm.NewChainReaderService(testutils.Context(t), logger.NullLogger, nil, nil, types.ChainReaderConfig{Contracts: tt.chainContractReaders}) - require.Error(t, err) - if err != nil { - assert.Contains(t, err.Error(), tt.expectedError.Error()) - } - }) - } -} - -func TestChainReader(t *testing.T) { - t.Parallel() - it := &EVMChainReaderInterfaceTester[*testing.T]{Helper: &helper{}} - // add new subtests here so that it can be run on real chains too - RunChainReaderEvmTests(t, it) - RunChainReaderInterfaceTests[*testing.T](t, commontestutils.WrapChainReaderTesterForLoop(it)) -} - -type helper struct { - sim *backends.SimulatedBackend - auth *bind.TransactOpts -} - -func (h *helper) GasPriceBufferPercent() int64 { - return 0 -} - -func (h *helper) SetupAuth(t *testing.T) *bind.TransactOpts { - privateKey, err := crypto.GenerateKey() - require.NoError(t, err) - - h.auth, err = bind.NewKeyedTransactorWithChainID(privateKey, big.NewInt(1337)) - require.NoError(t, err) - - h.Backend() - h.Commit() - return h.auth -} - -func (h *helper) Backend() bind.ContractBackend { - if h.sim == nil { - h.sim = backends.NewSimulatedBackend( - core.GenesisAlloc{h.auth.From: {Balance: big.NewInt(math.MaxInt64)}}, commonGasLimitOnEvms*5000) - } - - return h.sim -} - -func (h *helper) Commit() { - h.sim.Commit() -} - -func (h *helper) Client(t *testing.T) client.Client { - return client.NewSimulatedBackendClient(t, h.sim, big.NewInt(1337)) -} - -func (h *helper) ChainID() *big.Int { - return testutils.SimulatedChainID -} - -func (h *helper) NewSqlxDB(t *testing.T) *sqlx.DB { - return pgtest.NewSqlxDB(t) -} - -func (h *helper) Context(t *testing.T) context.Context { - return testutils.Context(t) -} - -func (h *helper) MaxWaitTimeForEvents() time.Duration { - // From trial and error, when running on CI, sometimes the boxes get slow - maxWaitTime := time.Second * 30 - maxWaitTimeStr, ok := os.LookupEnv("MAX_WAIT_TIME_FOR_EVENTS_S") - if ok { - waitS, err := strconv.ParseInt(maxWaitTimeStr, 10, 64) - if err != nil { - fmt.Printf("Error parsing MAX_WAIT_TIME_FOR_EVENTS_S: %v, defaulting to %v\n", err, maxWaitTime) - } - maxWaitTime = time.Second * time.Duration(waitS) - } - - return maxWaitTime -} diff --git a/core/services/relay/evm/chain_writer.go b/core/services/relay/evm/chain_writer.go index 8e057d5da26..d61c17b2ae2 100644 --- a/core/services/relay/evm/chain_writer.go +++ b/core/services/relay/evm/chain_writer.go @@ -9,6 +9,7 @@ import ( "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/common" + "github.com/smartcontractkit/chainlink-common/pkg/logger" commonservices "github.com/smartcontractkit/chainlink-common/pkg/services" commontypes "github.com/smartcontractkit/chainlink-common/pkg/types" @@ -18,8 +19,8 @@ import ( evmclient "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/gas" evmtxmgr "github.com/smartcontractkit/chainlink/v2/core/chains/evm/txmgr" - "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services" + "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/codec" "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/types" ) @@ -45,7 +46,7 @@ func NewChainWriterService(logger logger.Logger, client evmclient.Client, txm ev sendStrategy: txmgr.NewSendEveryStrategy(), contracts: config.Contracts, - parsedContracts: &parsedTypes{encoderDefs: map[string]types.CodecEntry{}, decoderDefs: map[string]types.CodecEntry{}}, + parsedContracts: &codec.ParsedTypes{EncoderDefs: map[string]types.CodecEntry{}, DecoderDefs: map[string]types.CodecEntry{}}, } if config.SendStrategy != nil { @@ -57,7 +58,7 @@ func NewChainWriterService(logger logger.Logger, client evmclient.Client, txm ev } var err error - if w.encoder, err = w.parsedContracts.toCodec(); err != nil { + if w.encoder, err = w.parsedContracts.ToCodec(); err != nil { return nil, fmt.Errorf("%w: failed to create codec", err) } @@ -75,7 +76,7 @@ type chainWriter struct { sendStrategy txmgrtypes.TxStrategy contracts map[string]*types.ContractConfig - parsedContracts *parsedTypes + parsedContracts *codec.ParsedTypes encoder commontypes.Encoder } @@ -100,7 +101,7 @@ func (w *chainWriter) SubmitTransaction(ctx context.Context, contract, method st return fmt.Errorf("method config not found: %v", method) } - calldata, err := w.encoder.Encode(ctx, args, wrapItemType(contract, method, true)) + calldata, err := w.encoder.Encode(ctx, args, codec.WrapItemType(contract, method, true)) if err != nil { return fmt.Errorf("%w: failed to encode args", err) } @@ -122,12 +123,18 @@ func (w *chainWriter) SubmitTransaction(ctx context.Context, contract, method st } } + gasLimit := methodConfig.GasLimit + if meta != nil && meta.GasLimit != nil { + gasLimit = meta.GasLimit.Uint64() + } + req := evmtxmgr.TxRequest{ FromAddress: methodConfig.FromAddress, ToAddress: common.HexToAddress(toAddress), EncodedPayload: calldata, - FeeLimit: methodConfig.GasLimit, + FeeLimit: gasLimit, Meta: txMeta, + IdempotencyKey: &transactionID, Strategy: w.sendStrategy, Checker: checker, Value: *v, @@ -155,7 +162,7 @@ func (w *chainWriter) parseContracts() error { } // ABI.Pack prepends the method.ID to the encodings, we'll need the encoder to do the same. - inputMod, err := methodConfig.InputModifications.ToModifier(evmDecoderHooks...) + inputMod, err := methodConfig.InputModifications.ToModifier(codec.DecoderHooks...) if err != nil { return fmt.Errorf("%w: failed to create input mods", err) } @@ -166,7 +173,7 @@ func (w *chainWriter) parseContracts() error { return fmt.Errorf("%w: failed to init codec entry for method %s", err, method) } - w.parsedContracts.encoderDefs[wrapItemType(contract, method, true)] = input + w.parsedContracts.EncoderDefs[codec.WrapItemType(contract, method, true)] = input } } @@ -185,7 +192,7 @@ func (w *chainWriter) GetFeeComponents(ctx context.Context) (*commontypes.ChainF return nil, fmt.Errorf("gas estimator not available") } - fee, _, err := w.ge.GetFee(ctx, nil, 0, w.maxGasPrice) + fee, _, err := w.ge.GetFee(ctx, nil, 0, w.maxGasPrice, nil, nil) if err != nil { return nil, err } diff --git a/core/services/relay/evm/chain_writer_historical_wrapper_test.go b/core/services/relay/evm/chain_writer_historical_wrapper_test.go new file mode 100644 index 00000000000..c849d1f3d57 --- /dev/null +++ b/core/services/relay/evm/chain_writer_historical_wrapper_test.go @@ -0,0 +1,39 @@ +package evm + +import ( + "context" + "math/big" + + commontypes "github.com/smartcontractkit/chainlink-common/pkg/types" + interfacetesttypes "github.com/smartcontractkit/chainlink-common/pkg/types/interfacetests" + primitives "github.com/smartcontractkit/chainlink-common/pkg/types/query/primitives" +) + +// This wrapper is required to enable the ChainReader to access historical data +// Since the geth simulated backend doesn't support historical data, we use this +// thin wrapper. +type ChainWriterHistoricalWrapper struct { + commontypes.ChainWriter + cwh *ClientWithContractHistory +} + +func NewChainWriterHistoricalWrapper(cw commontypes.ChainWriter, cwh *ClientWithContractHistory) *ChainWriterHistoricalWrapper { + return &ChainWriterHistoricalWrapper{ChainWriter: cw, cwh: cwh} +} + +func (cwhw *ChainWriterHistoricalWrapper) SubmitTransaction(ctx context.Context, contractName, method string, args any, transactionID string, toAddress string, meta *commontypes.TxMeta, value *big.Int) error { + if primArgs, ok := args.(interfacetesttypes.PrimitiveArgs); ok { + callArgs := interfacetesttypes.ExpectedGetLatestValueArgs{ + ContractName: contractName, + ReadName: "GetAlterablePrimitiveValue", + ConfidenceLevel: primitives.Unconfirmed, + Params: nil, + ReturnVal: nil, + } + err := cwhw.cwh.SetUintLatestValue(ctx, primArgs.Value, callArgs) + if err != nil { + return err + } + } + return cwhw.ChainWriter.SubmitTransaction(ctx, contractName, method, args, transactionID, toAddress, meta, value) +} diff --git a/core/services/relay/evm/chain_writer_test.go b/core/services/relay/evm/chain_writer_test.go index 66c85bfc2c3..b70a0dd0e3b 100644 --- a/core/services/relay/evm/chain_writer_test.go +++ b/core/services/relay/evm/chain_writer_test.go @@ -67,6 +67,7 @@ func TestChainWriter(t *testing.T) { status commontypes.TransactionStatus }{ {uuid.NewString(), commontypes.Unknown}, + {uuid.NewString(), commontypes.Pending}, {uuid.NewString(), commontypes.Unconfirmed}, {uuid.NewString(), commontypes.Finalized}, {uuid.NewString(), commontypes.Failed}, @@ -86,7 +87,7 @@ func TestChainWriter(t *testing.T) { }) t.Run("GetFeeComponents", func(t *testing.T) { - ge.On("GetFee", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(gas.EvmFee{ + ge.On("GetFee", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(gas.EvmFee{ Legacy: assets.NewWei(big.NewInt(1000000001)), DynamicFeeCap: assets.NewWei(big.NewInt(1000000002)), DynamicTipCap: assets.NewWei(big.NewInt(1000000003)), @@ -112,7 +113,7 @@ func TestChainWriter(t *testing.T) { }) t.Run("Returns Legacy Fee in absence of Dynamic Fee", func(t *testing.T) { - ge.On("GetFee", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(gas.EvmFee{ + ge.On("GetFee", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(gas.EvmFee{ Legacy: assets.NewWei(big.NewInt(1000000001)), DynamicFeeCap: nil, DynamicTipCap: assets.NewWei(big.NewInt(1000000003)), @@ -124,7 +125,7 @@ func TestChainWriter(t *testing.T) { }) t.Run("Fails when neither legacy or dynamic fee is available", func(t *testing.T) { - ge.On("GetFee", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(gas.EvmFee{ + ge.On("GetFee", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(gas.EvmFee{ Legacy: nil, DynamicFeeCap: nil, DynamicTipCap: nil, @@ -136,7 +137,7 @@ func TestChainWriter(t *testing.T) { t.Run("Fails when GetFee returns an error", func(t *testing.T) { expectedErr := fmt.Errorf("GetFee error") - ge.On("GetFee", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(gas.EvmFee{ + ge.On("GetFee", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(gas.EvmFee{ Legacy: nil, DynamicFeeCap: nil, DynamicTipCap: nil, @@ -146,7 +147,7 @@ func TestChainWriter(t *testing.T) { }) t.Run("Fails when L1Oracle returns error", func(t *testing.T) { - ge.On("GetFee", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(gas.EvmFee{ + ge.On("GetFee", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(gas.EvmFee{ Legacy: assets.NewWei(big.NewInt(1000000001)), DynamicFeeCap: assets.NewWei(big.NewInt(1000000002)), DynamicTipCap: assets.NewWei(big.NewInt(1000000003)), diff --git a/core/services/relay/evm/codec.go b/core/services/relay/evm/codec.go deleted file mode 100644 index 9636996c2ae..00000000000 --- a/core/services/relay/evm/codec.go +++ /dev/null @@ -1,152 +0,0 @@ -package evm - -import ( - "encoding/json" - "fmt" - "math/big" - "reflect" - - "github.com/ethereum/go-ethereum/accounts/abi" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/mitchellh/mapstructure" - - "github.com/smartcontractkit/chainlink-common/pkg/codec" - - commontypes "github.com/smartcontractkit/chainlink-common/pkg/types" - - "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/types" -) - -// decodeAccountAndAllowArraySliceHook allows: -// -// strings to be converted to [32]byte allowing config to represent them as 0x... -// slices or arrays to be converted to a pointer to that type -// -// BigIntHook allows *big.Int to be represented as any integer type or a string and to go back to them. -// Useful for config, or if when a model may use a go type that isn't a *big.Int when Pack expects one. -// Eg: int32 in a go struct from a plugin could require a *big.Int in Pack for int24, if it fits, we shouldn't care. -// SliceToArrayVerifySizeHook verifies that slices have the correct size when converting to an array -// sizeVerifyBigIntHook allows our custom types that verify the number fits in the on-chain type to be converted as-if -// it was a *big.Int -var evmDecoderHooks = []mapstructure.DecodeHookFunc{ - decodeAccountAndAllowArraySliceHook, - codec.BigIntHook, - codec.SliceToArrayVerifySizeHook, - sizeVerifyBigIntHook, - codec.NumberHook, -} - -// NewCodec creates a new [commontypes.RemoteCodec] for EVM. -// Note that names in the ABI are converted to Go names using [abi.ToCamelCase], -// this is per convention in [abi.MakeTopics], [abi.Arguments.Pack] etc. -// This allows names on-chain to be in go convention when generated. -// It means that if you need to use a [codec.Modifier] to reference a field -// you need to use the Go name instead of the name on-chain. -// eg: rename FooBar -> Bar, not foo_bar_ to Bar if the name on-chain is foo_bar_ -func NewCodec(conf types.CodecConfig) (commontypes.RemoteCodec, error) { - parsed := &parsedTypes{ - encoderDefs: map[string]types.CodecEntry{}, - decoderDefs: map[string]types.CodecEntry{}, - } - - for k, v := range conf.Configs { - args := abi.Arguments{} - if err := json.Unmarshal(([]byte)(v.TypeABI), &args); err != nil { - return nil, err - } - - mod, err := v.ModifierConfigs.ToModifier(evmDecoderHooks...) - if err != nil { - return nil, err - } - - item := types.NewCodecEntry(args, nil, mod) - if err = item.Init(); err != nil { - return nil, err - } - - parsed.encoderDefs[k] = item - parsed.decoderDefs[k] = item - } - - return parsed.toCodec() -} - -type evmCodec struct { - *encoder - *decoder - *parsedTypes -} - -func (c *evmCodec) CreateType(itemType string, forEncoding bool) (any, error) { - var itemTypes map[string]types.CodecEntry - if forEncoding { - itemTypes = c.encoderDefs - } else { - itemTypes = c.decoderDefs - } - - def, ok := itemTypes[itemType] - if !ok { - return nil, fmt.Errorf("%w: cannot find type name %s", commontypes.ErrInvalidType, itemType) - } - - return reflect.New(def.CheckedType()).Interface(), nil -} - -var bigIntType = reflect.TypeOf((*big.Int)(nil)) - -func sizeVerifyBigIntHook(from, to reflect.Type, data any) (any, error) { - if from.Implements(types.SizedBigIntType()) && - !to.Implements(types.SizedBigIntType()) && - !reflect.PointerTo(to).Implements(types.SizedBigIntType()) { - return codec.BigIntHook(from, bigIntType, reflect.ValueOf(data).Convert(bigIntType).Interface()) - } - - if !to.Implements(types.SizedBigIntType()) { - return data, nil - } - - var err error - data, err = codec.BigIntHook(from, bigIntType, data) - if err != nil { - return nil, err - } - - bi, ok := data.(*big.Int) - if !ok { - return data, nil - } - - converted := reflect.ValueOf(bi).Convert(to).Interface().(types.SizedBigInt) - return converted, converted.Verify() -} - -func decodeAccountAndAllowArraySliceHook(from, to reflect.Type, data any) (any, error) { - if from.Kind() == reflect.String && - (to == reflect.TypeOf(common.Address{}) || to == reflect.TypeOf(&common.Address{})) { - return decodeAddress(data) - } - - if from.Kind() == reflect.Pointer && to.Kind() != reflect.Pointer && from != nil && - (from.Elem().Kind() == reflect.Slice || from.Elem().Kind() == reflect.Array) { - return reflect.ValueOf(data).Elem().Interface(), nil - } - - return data, nil -} - -func decodeAddress(data any) (any, error) { - decoded, err := hexutil.Decode(data.(string)) - if err != nil { - return nil, fmt.Errorf("%w: %w", commontypes.ErrInvalidType, err) - } else if len(decoded) != common.AddressLength { - return nil, fmt.Errorf( - "%w: wrong number size for address expected %v got %v", - commontypes.ErrSliceWrongLen, - common.AddressLength, len(decoded)) - } - - return common.Address(decoded), nil -} diff --git a/core/services/relay/evm/codec/codec.go b/core/services/relay/evm/codec/codec.go new file mode 100644 index 00000000000..b0572b54791 --- /dev/null +++ b/core/services/relay/evm/codec/codec.go @@ -0,0 +1,166 @@ +package codec + +import ( + "encoding/json" + "fmt" + "math/big" + "reflect" + + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/go-viper/mapstructure/v2" + + commoncodec "github.com/smartcontractkit/chainlink-common/pkg/codec" + commontypes "github.com/smartcontractkit/chainlink-common/pkg/types" + + "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/types" +) + +// DecoderHooks +// +// decodeAccountAndAllowArraySliceHook allows: +// +// strings to be converted to [32]byte allowing config to represent them as 0x... +// slices or arrays to be converted to a pointer to that type +// +// BigIntHook allows *big.Int to be represented as any integer type or a string and to go back to them. +// Useful for config, or if when a model may use a go type that isn't a *big.Int when Pack expects one. +// Eg: int32 in a go struct from a plugin could require a *big.Int in Pack for int24, if it fits, we shouldn't care. +// SliceToArrayVerifySizeHook verifies that slices have the correct size when converting to an array +// sizeVerifyBigIntHook allows our custom types that verify the number fits in the on-chain type to be converted as-if +// it was a *big.Int +var DecoderHooks = []mapstructure.DecodeHookFunc{ + decodeAccountAndAllowArraySliceHook, + commoncodec.BigIntHook, + commoncodec.SliceToArrayVerifySizeHook, + sizeVerifyBigIntHook, + commoncodec.NumberHook, +} + +// NewCodec creates a new [commontypes.RemoteCodec] for EVM. +// Note that names in the ABI are converted to Go names using [abi.ToCamelCase], +// this is per convention in [abi.MakeTopics], [abi.Arguments.Pack] etc. +// This allows names on-chain to be in go convention when generated. +// It means that if you need to use a [codec.Modifier] to reference a field +// you need to use the Go name instead of the name on-chain. +// eg: rename FooBar -> Bar, not foo_bar_ to Bar if the name on-chain is foo_bar_ +func NewCodec(conf types.CodecConfig) (commontypes.RemoteCodec, error) { + parsed := &ParsedTypes{ + EncoderDefs: map[string]types.CodecEntry{}, + DecoderDefs: map[string]types.CodecEntry{}, + } + + for k, v := range conf.Configs { + args := abi.Arguments{} + if err := json.Unmarshal(([]byte)(v.TypeABI), &args); err != nil { + return nil, err + } + + mod, err := v.ModifierConfigs.ToModifier(DecoderHooks...) + if err != nil { + return nil, err + } + + item := types.NewCodecEntry(args, nil, mod) + if err = item.Init(); err != nil { + return nil, err + } + + parsed.EncoderDefs[k] = item + parsed.DecoderDefs[k] = item + } + + return parsed.ToCodec() +} + +type evmCodec struct { + *encoder + *decoder + *ParsedTypes +} + +func (c *evmCodec) CreateType(itemType string, forEncoding bool) (any, error) { + var itemTypes map[string]types.CodecEntry + if forEncoding { + itemTypes = c.EncoderDefs + } else { + itemTypes = c.DecoderDefs + } + + def, ok := itemTypes[itemType] + if !ok { + return nil, fmt.Errorf("%w: cannot find type name %s", commontypes.ErrInvalidType, itemType) + } + + // we don't need double pointers, and they can also mess up reflection variable creation and mapstruct decode + if def.CheckedType().Kind() == reflect.Pointer { + return reflect.New(def.CheckedType()).Elem().Interface(), nil + } + + return reflect.New(def.CheckedType()).Interface(), nil +} + +func WrapItemType(contractName, itemType string, isParams bool) string { + if isParams { + return fmt.Sprintf("params.%s.%s", contractName, itemType) + } + + return fmt.Sprintf("return.%s.%s", contractName, itemType) +} + +var bigIntType = reflect.TypeOf((*big.Int)(nil)) + +func sizeVerifyBigIntHook(from, to reflect.Type, data any) (any, error) { + if from.Implements(types.SizedBigIntType()) && + !to.Implements(types.SizedBigIntType()) && + !reflect.PointerTo(to).Implements(types.SizedBigIntType()) { + return commoncodec.BigIntHook(from, bigIntType, reflect.ValueOf(data).Convert(bigIntType).Interface()) + } + + if !to.Implements(types.SizedBigIntType()) { + return data, nil + } + + var err error + data, err = commoncodec.BigIntHook(from, bigIntType, data) + if err != nil { + return nil, err + } + + bi, ok := data.(*big.Int) + if !ok { + return data, nil + } + + converted := reflect.ValueOf(bi).Convert(to).Interface().(types.SizedBigInt) + return converted, converted.Verify() +} + +func decodeAccountAndAllowArraySliceHook(from, to reflect.Type, data any) (any, error) { + if from.Kind() == reflect.String && + (to == reflect.TypeOf(common.Address{}) || to == reflect.TypeOf(&common.Address{})) { + return decodeAddress(data) + } + + if from.Kind() == reflect.Pointer && to.Kind() != reflect.Pointer && from != nil && + (from.Elem().Kind() == reflect.Slice || from.Elem().Kind() == reflect.Array) { + return reflect.ValueOf(data).Elem().Interface(), nil + } + + return data, nil +} + +func decodeAddress(data any) (any, error) { + decoded, err := hexutil.Decode(data.(string)) + if err != nil { + return nil, fmt.Errorf("%w: %w", commontypes.ErrInvalidType, err) + } else if len(decoded) != common.AddressLength { + return nil, fmt.Errorf( + "%w: wrong number size for address expected %v got %v", + commontypes.ErrSliceWrongLen, + common.AddressLength, len(decoded)) + } + + return common.Address(decoded), nil +} diff --git a/core/services/relay/evm/codec_fuzz_test.go b/core/services/relay/evm/codec/codec_fuzz_test.go similarity index 92% rename from core/services/relay/evm/codec_fuzz_test.go rename to core/services/relay/evm/codec/codec_fuzz_test.go index 5870e9d77ad..1b65a1bc29d 100644 --- a/core/services/relay/evm/codec_fuzz_test.go +++ b/core/services/relay/evm/codec/codec_fuzz_test.go @@ -1,4 +1,4 @@ -package evm_test +package codec_test import ( "testing" diff --git a/core/services/relay/evm/codec_test.go b/core/services/relay/evm/codec/codec_test.go similarity index 90% rename from core/services/relay/evm/codec_test.go rename to core/services/relay/evm/codec/codec_test.go index 638a9afd706..7cb242c13de 100644 --- a/core/services/relay/evm/codec_test.go +++ b/core/services/relay/evm/codec/codec_test.go @@ -1,4 +1,4 @@ -package evm_test +package codec_test import ( "encoding/json" @@ -12,7 +12,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/smartcontractkit/chainlink-common/pkg/codec" + commoncodec "github.com/smartcontractkit/chainlink-common/pkg/codec" + "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/evmtesting" looptestutils "github.com/smartcontractkit/chainlink-common/pkg/loop/testutils" //nolint common practice to import test mods with . commontypes "github.com/smartcontractkit/chainlink-common/pkg/types" @@ -20,8 +21,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/chain_reader_tester" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" - "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm" - "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/evmtesting" + "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/codec" "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/types" ) @@ -45,7 +45,7 @@ func TestCodec(t *testing.T) { codecConfig := types.CodecConfig{Configs: map[string]types.ChainCodecConfig{ codecName: {TypeABI: evmEncoderConfig}, }} - c, err := evm.NewCodec(codecConfig) + c, err := codec.NewCodec(codecConfig) require.NoError(t, err) result, err := c.Encode(testutils.Context(t), encode, codecName) @@ -91,7 +91,7 @@ func TestCodec_SimpleEncode(t *testing.T) { codecConfig := types.CodecConfig{Configs: map[string]types.ChainCodecConfig{ codecName: {TypeABI: evmEncoderConfig}, }} - c, err := evm.NewCodec(codecConfig) + c, err := codec.NewCodec(codecConfig) require.NoError(t, err) result, err := c.Encode(testutils.Context(t), input, codecName) @@ -120,7 +120,7 @@ func TestCodec_EncodeTuple(t *testing.T) { codecConfig := types.CodecConfig{Configs: map[string]types.ChainCodecConfig{ codecName: {TypeABI: evmEncoderConfig}, }} - c, err := evm.NewCodec(codecConfig) + c, err := codec.NewCodec(codecConfig) require.NoError(t, err) result, err := c.Encode(testutils.Context(t), input, codecName) @@ -152,7 +152,7 @@ func TestCodec_EncodeTupleWithLists(t *testing.T) { codecConfig := types.CodecConfig{Configs: map[string]types.ChainCodecConfig{ codecName: {TypeABI: evmEncoderConfig}, }} - c, err := evm.NewCodec(codecConfig) + c, err := codec.NewCodec(codecConfig) require.NoError(t, err) result, err := c.Encode(testutils.Context(t), input, codecName) @@ -204,13 +204,14 @@ func (it *codecInterfaceTester) GetCodec(t *testing.T) commontypes.Codec { entry.TypeABI = string(defBytes) if k != sizeItemType && k != NilType { - entry.ModifierConfigs = codec.ModifiersConfig{ - &codec.RenameModifierConfig{Fields: map[string]string{"NestedStruct.Inner.IntVal": "I"}}, + entry.ModifierConfigs = commoncodec.ModifiersConfig{ + &commoncodec.RenameModifierConfig{Fields: map[string]string{"NestedDynamicStruct.Inner.IntVal": "I"}}, + &commoncodec.RenameModifierConfig{Fields: map[string]string{"NestedStaticStruct.Inner.IntVal": "I"}}, } } if k == TestItemWithConfigExtra { - hardCode := &codec.HardCodeModifierConfig{ + hardCode := &commoncodec.HardCodeModifierConfig{ OnChainValues: map[string]any{ "BigField": testStruct.BigField.String(), "Account": hexutil.Encode(testStruct.Account), @@ -222,7 +223,7 @@ func (it *codecInterfaceTester) GetCodec(t *testing.T) commontypes.Codec { codecConfig.Configs[k] = entry } - c, err := evm.NewCodec(codecConfig) + c, err := codec.NewCodec(codecConfig) require.NoError(t, err) return c } @@ -280,14 +281,24 @@ func packArgs(t *testing.T, allArgs []any, oargs abi.Arguments, request *EncodeR return bytes } -var inner = []abi.ArgumentMarshaling{ +var innerDynamic = []abi.ArgumentMarshaling{ {Name: "IntVal", Type: "int64"}, {Name: "S", Type: "string"}, } -var nested = []abi.ArgumentMarshaling{ +var nestedDynamic = []abi.ArgumentMarshaling{ + {Name: "FixedBytes", Type: "bytes2"}, + {Name: "Inner", Type: "tuple", Components: innerDynamic}, +} + +var innerStatic = []abi.ArgumentMarshaling{ + {Name: "IntVal", Type: "int64"}, + {Name: "A", Type: "address"}, +} + +var nestedStatic = []abi.ArgumentMarshaling{ {Name: "FixedBytes", Type: "bytes2"}, - {Name: "Inner", Type: "tuple", Components: inner}, + {Name: "Inner", Type: "tuple", Components: innerStatic}, } var ts = []abi.ArgumentMarshaling{ @@ -298,7 +309,8 @@ var ts = []abi.ArgumentMarshaling{ {Name: "Account", Type: "address"}, {Name: "Accounts", Type: "address[]"}, {Name: "BigField", Type: "int192"}, - {Name: "NestedStruct", Type: "tuple", Components: nested}, + {Name: "NestedDynamicStruct", Type: "tuple", Components: nestedDynamic}, + {Name: "NestedStaticStruct", Type: "tuple", Components: nestedStatic}, } const sizeItemType = "item for size" @@ -355,6 +367,7 @@ func argsFromTestStruct(ts TestStruct) []any { common.Address(ts.Account), getAccounts(ts), ts.BigField, - evmtesting.MidToInternalType(ts.NestedStruct), + evmtesting.MidDynamicToInternalType(ts.NestedDynamicStruct), + evmtesting.MidStaticToInternalType(ts.NestedStaticStruct), } } diff --git a/core/services/relay/evm/decoder.go b/core/services/relay/evm/codec/decoder.go similarity index 90% rename from core/services/relay/evm/decoder.go rename to core/services/relay/evm/codec/decoder.go index fdecf002020..70c0f1d668b 100644 --- a/core/services/relay/evm/decoder.go +++ b/core/services/relay/evm/codec/decoder.go @@ -1,11 +1,11 @@ -package evm +package codec import ( "context" "fmt" "reflect" - "github.com/mitchellh/mapstructure" + "github.com/go-viper/mapstructure/v2" commontypes "github.com/smartcontractkit/chainlink-common/pkg/types" @@ -45,7 +45,7 @@ func (m *decoder) Decode(_ context.Context, raw []byte, into any, itemType strin iInto.Set(reflect.MakeSlice(iInto.Type(), length, length)) return setElements(length, rDecode, iInto) default: - return mapstructureDecode(decode, into) + return MapstructureDecode(decode, into) } } @@ -83,7 +83,7 @@ func extractDecoding(info types.CodecEntry, raw []byte) (any, error) { func setElements(length int, rDecode reflect.Value, iInto reflect.Value) error { for i := 0; i < length; i++ { - if err := mapstructureDecode(rDecode.Index(i).Interface(), iInto.Index(i).Addr().Interface()); err != nil { + if err := MapstructureDecode(rDecode.Index(i).Interface(), iInto.Index(i).Addr().Interface()); err != nil { return err } } @@ -91,9 +91,9 @@ func setElements(length int, rDecode reflect.Value, iInto reflect.Value) error { return nil } -func mapstructureDecode(src, dest any) error { +func MapstructureDecode(src, dest any) error { mDecoder, err := mapstructure.NewDecoder(&mapstructure.DecoderConfig{ - DecodeHook: mapstructure.ComposeDecodeHookFunc(evmDecoderHooks...), + DecodeHook: mapstructure.ComposeDecodeHookFunc(DecoderHooks...), Result: dest, Squash: true, }) diff --git a/core/services/relay/evm/encoder.go b/core/services/relay/evm/codec/encoder.go similarity index 89% rename from core/services/relay/evm/encoder.go rename to core/services/relay/evm/codec/encoder.go index ae60e4ab35a..18ad32831c2 100644 --- a/core/services/relay/evm/encoder.go +++ b/core/services/relay/evm/codec/encoder.go @@ -1,4 +1,4 @@ -package evm +package codec import ( "context" @@ -52,13 +52,13 @@ func encode(item reflect.Value, info types.CodecEntry) ([]byte, error) { } switch item.Kind() { case reflect.Array, reflect.Slice: - native, err := representArray(item, info) + native, err := RepresentArray(item, info) if err != nil { return nil, err } return pack(info, native) case reflect.Struct, reflect.Map: - values, err := unrollItem(item, info) + values, err := UnrollItem(item, info) if err != nil { return nil, err } @@ -68,7 +68,7 @@ func encode(item reflect.Value, info types.CodecEntry) ([]byte, error) { } } -func representArray(item reflect.Value, info types.CodecEntry) (any, error) { +func RepresentArray(item reflect.Value, info types.CodecEntry) (any, error) { length := item.Len() checkedType := info.CheckedType() checked := reflect.New(checkedType) @@ -87,7 +87,7 @@ func representArray(item reflect.Value, info types.CodecEntry) (any, error) { checkedElm := checkedType.Elem() for i := 0; i < length; i++ { tmp := reflect.New(checkedElm) - if err := mapstructureDecode(item.Index(i).Interface(), tmp.Interface()); err != nil { + if err := MapstructureDecode(item.Index(i).Interface(), tmp.Interface()); err != nil { return nil, err } iChecked.Index(i).Set(tmp.Elem()) @@ -97,10 +97,10 @@ func representArray(item reflect.Value, info types.CodecEntry) (any, error) { return nil, err } - return native.Elem().Interface(), nil + return native.Interface(), nil } -func unrollItem(item reflect.Value, info types.CodecEntry) ([]any, error) { +func UnrollItem(item reflect.Value, info types.CodecEntry) ([]any, error) { checkedType := info.CheckedType() if item.CanAddr() { item = item.Addr() @@ -114,7 +114,7 @@ func unrollItem(item reflect.Value, info types.CodecEntry) ([]any, error) { } else if !info.IsNativePointer(item.Type()) { var err error checked := reflect.New(checkedType) - if err = mapstructureDecode(item.Interface(), checked.Interface()); err != nil { + if err = MapstructureDecode(item.Interface(), checked.Interface()); err != nil { return nil, err } if item, err = info.ToNative(checked); err != nil { @@ -122,7 +122,6 @@ func unrollItem(item reflect.Value, info types.CodecEntry) ([]any, error) { } } - item = reflect.Indirect(item) length := item.NumField() values := make([]any, length) iType := item.Type() diff --git a/core/services/relay/evm/codec/parsed_types.go b/core/services/relay/evm/codec/parsed_types.go new file mode 100644 index 00000000000..31c95caf4dd --- /dev/null +++ b/core/services/relay/evm/codec/parsed_types.go @@ -0,0 +1,50 @@ +package codec + +import ( + "fmt" + "reflect" + + commoncodec "github.com/smartcontractkit/chainlink-common/pkg/codec" + commontypes "github.com/smartcontractkit/chainlink-common/pkg/types" + + "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/types" +) + +type ParsedTypes struct { + EncoderDefs map[string]types.CodecEntry + DecoderDefs map[string]types.CodecEntry +} + +func (parsed *ParsedTypes) ToCodec() (commontypes.RemoteCodec, error) { + modByTypeName := map[string]commoncodec.Modifier{} + if err := AddEntries(parsed.EncoderDefs, modByTypeName); err != nil { + return nil, err + } + if err := AddEntries(parsed.DecoderDefs, modByTypeName); err != nil { + return nil, err + } + + mod, err := commoncodec.NewByItemTypeModifier(modByTypeName) + if err != nil { + return nil, err + } + underlying := &evmCodec{ + encoder: &encoder{Definitions: parsed.EncoderDefs}, + decoder: &decoder{Definitions: parsed.DecoderDefs}, + ParsedTypes: parsed, + } + return commoncodec.NewModifierCodec(underlying, mod, DecoderHooks...) +} + +// AddEntries extracts the mods from codecEntry and adds them to modByTypeName use with codec.NewByItemTypeModifier +// Since each input/output can have its own modifications, we need to keep track of them by type name +func AddEntries(defs map[string]types.CodecEntry, modByTypeName map[string]commoncodec.Modifier) error { + for k, def := range defs { + modByTypeName[k] = def.Modifier() + _, err := def.Modifier().RetypeToOffChain(reflect.PointerTo(def.CheckedType()), k) + if err != nil { + return fmt.Errorf("%w: cannot retype %v: %w", commontypes.ErrInvalidConfig, k, err) + } + } + return nil +} diff --git a/core/services/relay/evm/commit_provider.go b/core/services/relay/evm/commit_provider.go new file mode 100644 index 00000000000..501e1ae0ef0 --- /dev/null +++ b/core/services/relay/evm/commit_provider.go @@ -0,0 +1,309 @@ +package evm + +import ( + "context" + "fmt" + "math/big" + + "go.uber.org/multierr" + + "github.com/ethereum/go-ethereum/accounts/abi/bind" + ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" + + "github.com/smartcontractkit/chainlink-common/pkg/logger" + commontypes "github.com/smartcontractkit/chainlink-common/pkg/types" + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/gas" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/router" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip" +) + +var _ commontypes.CCIPCommitProvider = (*SrcCommitProvider)(nil) +var _ commontypes.CCIPCommitProvider = (*DstCommitProvider)(nil) + +type SrcCommitProvider struct { + lggr logger.Logger + startBlock uint64 + client client.Client + lp logpoller.LogPoller + estimator gas.EvmFeeEstimator + maxGasPrice *big.Int + + // these values will be lazily initialized + seenOnRampAddress *cciptypes.Address + seenSourceChainSelector *uint64 + seenDestChainSelector *uint64 +} + +func NewSrcCommitProvider( + lggr logger.Logger, + startBlock uint64, + client client.Client, + lp logpoller.LogPoller, + srcEstimator gas.EvmFeeEstimator, + maxGasPrice *big.Int, +) commontypes.CCIPCommitProvider { + return &SrcCommitProvider{ + lggr: lggr, + startBlock: startBlock, + client: client, + lp: lp, + estimator: srcEstimator, + maxGasPrice: maxGasPrice, + } +} + +type DstCommitProvider struct { + lggr logger.Logger + versionFinder ccip.VersionFinder + startBlock uint64 + client client.Client + lp logpoller.LogPoller + contractTransmitter *contractTransmitter + configWatcher *configWatcher + gasEstimator gas.EvmFeeEstimator + maxGasPrice big.Int + + // these values will be lazily initialized + seenCommitStoreAddress *cciptypes.Address + seenOffRampAddress *cciptypes.Address +} + +func NewDstCommitProvider( + lggr logger.Logger, + versionFinder ccip.VersionFinder, + startBlock uint64, + client client.Client, + lp logpoller.LogPoller, + gasEstimator gas.EvmFeeEstimator, + maxGasPrice big.Int, + contractTransmitter contractTransmitter, + configWatcher *configWatcher, +) commontypes.CCIPCommitProvider { + return &DstCommitProvider{ + lggr: lggr, + versionFinder: versionFinder, + startBlock: startBlock, + client: client, + lp: lp, + contractTransmitter: &contractTransmitter, + configWatcher: configWatcher, + gasEstimator: gasEstimator, + maxGasPrice: maxGasPrice, + } +} + +func (P *SrcCommitProvider) Name() string { + return "CCIPCommitProvider.SrcRelayerProvider" +} + +// Close is called when the job that created this provider is deleted. +// At this time, any of the methods on the provider may or may not have been called. +// If NewOnRampReader has not been called, their corresponding +// Close methods will be expected to error. +func (P *SrcCommitProvider) Close() error { + versionFinder := ccip.NewEvmVersionFinder() + + unregisterFuncs := make([]func() error, 0, 2) + unregisterFuncs = append(unregisterFuncs, func() error { + // avoid panic in the case NewOnRampReader wasn't called + if P.seenOnRampAddress == nil { + return nil + } + return ccip.CloseOnRampReader(P.lggr, versionFinder, *P.seenSourceChainSelector, *P.seenDestChainSelector, *P.seenOnRampAddress, P.lp, P.client) + }) + + var multiErr error + for _, fn := range unregisterFuncs { + if err := fn(); err != nil { + multiErr = multierr.Append(multiErr, err) + } + } + return multiErr +} + +func (P *SrcCommitProvider) Ready() error { + return nil +} + +func (P *SrcCommitProvider) HealthReport() map[string]error { + return make(map[string]error) +} + +func (P *SrcCommitProvider) OffchainConfigDigester() ocrtypes.OffchainConfigDigester { + // TODO CCIP-2494 + // "OffchainConfigDigester called on SrcCommitProvider. Valid on DstCommitProvider." + return UnimplementedOffchainConfigDigester{} +} + +func (P *SrcCommitProvider) ContractConfigTracker() ocrtypes.ContractConfigTracker { + // // TODO CCIP-2494 + // "ContractConfigTracker called on SrcCommitProvider. Valid on DstCommitProvider.") + return UnimplementedContractConfigTracker{} +} + +func (P *SrcCommitProvider) ContractTransmitter() ocrtypes.ContractTransmitter { + // // TODO CCIP-2494 + // "ContractTransmitter called on SrcCommitProvider. Valid on DstCommitProvider." + return UnimplementedContractTransmitter{} +} + +func (P *SrcCommitProvider) ContractReader() commontypes.ContractReader { + return nil +} + +func (P *SrcCommitProvider) Codec() commontypes.Codec { + return nil +} + +func (P *DstCommitProvider) Name() string { + return "CCIPCommitProvider.DstRelayerProvider" +} + +func (P *DstCommitProvider) Close() error { + versionFinder := ccip.NewEvmVersionFinder() + + unregisterFuncs := make([]func() error, 0, 2) + unregisterFuncs = append(unregisterFuncs, func() error { + if P.seenCommitStoreAddress == nil { + return nil + } + return ccip.CloseCommitStoreReader(P.lggr, versionFinder, *P.seenCommitStoreAddress, P.client, P.lp) + }) + unregisterFuncs = append(unregisterFuncs, func() error { + if P.seenOffRampAddress == nil { + return nil + } + return ccip.CloseOffRampReader(P.lggr, versionFinder, *P.seenOffRampAddress, P.client, P.lp, nil, big.NewInt(0)) + }) + + var multiErr error + for _, fn := range unregisterFuncs { + if err := fn(); err != nil { + multiErr = multierr.Append(multiErr, err) + } + } + return multiErr +} + +func (P *DstCommitProvider) Ready() error { + return nil +} + +func (P *DstCommitProvider) HealthReport() map[string]error { + return make(map[string]error) +} + +func (P *DstCommitProvider) OffchainConfigDigester() ocrtypes.OffchainConfigDigester { + return P.configWatcher.OffchainConfigDigester() +} + +func (P *DstCommitProvider) ContractConfigTracker() ocrtypes.ContractConfigTracker { + return P.configWatcher.ContractConfigTracker() +} + +func (P *DstCommitProvider) ContractTransmitter() ocrtypes.ContractTransmitter { + return P.contractTransmitter +} + +func (P *DstCommitProvider) ContractReader() commontypes.ContractReader { + return nil +} + +func (P *DstCommitProvider) Codec() commontypes.Codec { + return nil +} + +func (P *SrcCommitProvider) Start(ctx context.Context) error { + if P.startBlock != 0 { + P.lggr.Infow("start replaying src chain", "fromBlock", P.startBlock) + return P.lp.Replay(ctx, int64(P.startBlock)) + } + return nil +} + +func (P *DstCommitProvider) Start(ctx context.Context) error { + if P.startBlock != 0 { + P.lggr.Infow("start replaying dst chain", "fromBlock", P.startBlock) + return P.lp.Replay(ctx, int64(P.startBlock)) + } + return nil +} + +func (P *SrcCommitProvider) NewPriceGetter(ctx context.Context) (priceGetter cciptypes.PriceGetter, err error) { + return nil, fmt.Errorf("can't construct a price getter from one relayer") +} + +func (P *DstCommitProvider) NewPriceGetter(ctx context.Context) (priceGetter cciptypes.PriceGetter, err error) { + return nil, fmt.Errorf("can't construct a price getter from one relayer") +} + +func (P *SrcCommitProvider) NewCommitStoreReader(ctx context.Context, commitStoreAddress cciptypes.Address) (commitStoreReader cciptypes.CommitStoreReader, err error) { + commitStoreReader = NewIncompleteSourceCommitStoreReader(P.estimator, P.maxGasPrice) + return +} + +func (P *DstCommitProvider) NewCommitStoreReader(ctx context.Context, commitStoreAddress cciptypes.Address) (commitStoreReader cciptypes.CommitStoreReader, err error) { + P.seenCommitStoreAddress = &commitStoreAddress + + versionFinder := ccip.NewEvmVersionFinder() + commitStoreReader, err = NewIncompleteDestCommitStoreReader(P.lggr, versionFinder, commitStoreAddress, P.client, P.lp) + return +} + +func (P *SrcCommitProvider) NewOnRampReader(ctx context.Context, onRampAddress cciptypes.Address, sourceChainSelector uint64, destChainSelector uint64) (onRampReader cciptypes.OnRampReader, err error) { + P.seenOnRampAddress = &onRampAddress + P.seenSourceChainSelector = &sourceChainSelector + P.seenDestChainSelector = &destChainSelector + + versionFinder := ccip.NewEvmVersionFinder() + onRampReader, err = ccip.NewOnRampReader(P.lggr, versionFinder, sourceChainSelector, destChainSelector, onRampAddress, P.lp, P.client) + return +} + +func (P *DstCommitProvider) NewOnRampReader(ctx context.Context, onRampAddress cciptypes.Address, sourceChainSelector uint64, destChainSelector uint64) (onRampReader cciptypes.OnRampReader, err error) { + return nil, fmt.Errorf("invalid: NewOnRampReader called for DstCommitProvider.NewOnRampReader should be called on SrcCommitProvider") +} + +func (P *SrcCommitProvider) NewOffRampReader(ctx context.Context, offRampAddr cciptypes.Address) (offRampReader cciptypes.OffRampReader, err error) { + return nil, fmt.Errorf("invalid: NewOffRampReader called for SrcCommitProvider. NewOffRampReader should be called on DstCommitProvider") +} + +func (P *DstCommitProvider) NewOffRampReader(ctx context.Context, offRampAddr cciptypes.Address) (offRampReader cciptypes.OffRampReader, err error) { + offRampReader, err = ccip.NewOffRampReader(P.lggr, P.versionFinder, offRampAddr, P.client, P.lp, P.gasEstimator, &P.maxGasPrice, true) + return +} + +func (P *SrcCommitProvider) NewPriceRegistryReader(ctx context.Context, addr cciptypes.Address) (priceRegistryReader cciptypes.PriceRegistryReader, err error) { + return nil, fmt.Errorf("invalid: NewPriceRegistryReader called for SrcCommitProvider. NewOffRampReader should be called on DstCommitProvider") +} + +func (P *DstCommitProvider) NewPriceRegistryReader(ctx context.Context, addr cciptypes.Address) (priceRegistryReader cciptypes.PriceRegistryReader, err error) { + destPriceRegistry := ccip.NewEvmPriceRegistry(P.lp, P.client, P.lggr, ccip.CommitPluginLabel) + priceRegistryReader, err = destPriceRegistry.NewPriceRegistryReader(ctx, addr) + return +} + +func (P *SrcCommitProvider) SourceNativeToken(ctx context.Context, sourceRouterAddr cciptypes.Address) (cciptypes.Address, error) { + sourceRouterAddrHex, err := ccip.GenericAddrToEvm(sourceRouterAddr) + if err != nil { + return "", err + } + sourceRouter, err := router.NewRouter(sourceRouterAddrHex, P.client) + if err != nil { + return "", err + } + sourceNative, err := sourceRouter.GetWrappedNative(&bind.CallOpts{Context: ctx}) + if err != nil { + return "", err + } + + return ccip.EvmAddrToGeneric(sourceNative), nil +} + +func (P *DstCommitProvider) SourceNativeToken(ctx context.Context, sourceRouterAddr cciptypes.Address) (cciptypes.Address, error) { + return "", fmt.Errorf("invalid: SourceNativeToken called for DstCommitProvider. SourceNativeToken should be called on SrcCommitProvider") +} diff --git a/core/services/relay/evm/config_poller.go b/core/services/relay/evm/config_poller.go index 2280d60d7ee..a00b04b0786 100644 --- a/core/services/relay/evm/config_poller.go +++ b/core/services/relay/evm/config_poller.go @@ -15,11 +15,11 @@ import ( "github.com/smartcontractkit/libocr/gethwrappers2/ocrconfigurationstoreevmsimple" ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" + "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink-common/pkg/services" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" - "github.com/smartcontractkit/chainlink/v2/core/logger" evmRelayTypes "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/types" ) diff --git a/core/services/relay/evm/contract_binding.go b/core/services/relay/evm/contract_binding.go deleted file mode 100644 index da2d7ed9bd1..00000000000 --- a/core/services/relay/evm/contract_binding.go +++ /dev/null @@ -1,100 +0,0 @@ -package evm - -import ( - "context" - "fmt" - "sync" - - "github.com/ethereum/go-ethereum/common" - "github.com/google/uuid" - - commontypes "github.com/smartcontractkit/chainlink-common/pkg/types" - "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" - evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" -) - -type filterRegisterer struct { - pollingFilter logpoller.Filter - filterLock sync.Mutex - // registerCalled is used to determine if Register was called during Chain Reader service Start. - // This is done to avoid calling Register while the service is not running because log poller is most likely also not running. - registerCalled bool -} - -// contractBinding stores read bindings and manages the common contract event filter. -type contractBinding struct { - name string - // filterRegisterer is used to manage polling filter registration for the common contract filter. - // The common contract filter should be used by events that share filtering args. - filterRegisterer - // key is read name method, event or event keys used for queryKey. - readBindings map[string]readBinding - // bound determines if address is set to the contract binding. - bound bool - bindLock sync.Mutex -} - -// Bind binds contract addresses to contract binding and registers the common contract polling filter. -func (cb *contractBinding) Bind(ctx context.Context, lp logpoller.LogPoller, boundContract commontypes.BoundContract) error { - // it's enough to just lock bound here since Register/Unregister are only called from here and from Start/Close - // even if they somehow happen at the same time it will be fine because of filter lock and hasFilter check - cb.bindLock.Lock() - defer cb.bindLock.Unlock() - - if cb.bound { - // we are changing contract address reference, so we need to unregister old filter it exists - if err := cb.Unregister(ctx, lp); err != nil { - return err - } - } - - cb.pollingFilter.Addresses = evmtypes.AddressArray{common.HexToAddress(boundContract.Address)} - cb.pollingFilter.Name = logpoller.FilterName(boundContract.Name+"."+uuid.NewString(), boundContract.Address) - cb.bound = true - - if cb.registerCalled { - return cb.Register(ctx, lp) - } - - return nil -} - -// Register registers the common contract filter. -func (cb *contractBinding) Register(ctx context.Context, lp logpoller.LogPoller) error { - cb.filterLock.Lock() - defer cb.filterLock.Unlock() - - cb.registerCalled = true - // can't be true before filters params are set so there is no race with a bad filter outcome - if !cb.bound { - return nil - } - - if len(cb.pollingFilter.EventSigs) > 0 && !lp.HasFilter(cb.pollingFilter.Name) { - if err := lp.RegisterFilter(ctx, cb.pollingFilter); err != nil { - return fmt.Errorf("%w: %w", commontypes.ErrInternal, err) - } - } - - return nil -} - -// Unregister unregisters the common contract filter. -func (cb *contractBinding) Unregister(ctx context.Context, lp logpoller.LogPoller) error { - cb.filterLock.Lock() - defer cb.filterLock.Unlock() - - if !cb.bound { - return nil - } - - if !lp.HasFilter(cb.pollingFilter.Name) { - return nil - } - - if err := lp.UnregisterFilter(ctx, cb.pollingFilter.Name); err != nil { - return fmt.Errorf("%w: %w", commontypes.ErrInternal, err) - } - - return nil -} diff --git a/core/services/relay/evm/contract_transmitter.go b/core/services/relay/evm/contract_transmitter.go index d594dfb9214..10ab4697df5 100644 --- a/core/services/relay/evm/contract_transmitter.go +++ b/core/services/relay/evm/contract_transmitter.go @@ -12,13 +12,15 @@ import ( "github.com/ethereum/go-ethereum/common" gethcommon "github.com/ethereum/go-ethereum/common" "github.com/pkg/errors" + "github.com/smartcontractkit/libocr/offchainreporting2plus/chains/evmutil" ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" + "github.com/smartcontractkit/chainlink-common/pkg/logger" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/txmgr" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils" - "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services" ) @@ -102,7 +104,7 @@ func NewOCRContractTransmitter( transmittedEventSig: transmitted.ID, lp: lp, contractReader: caller, - lggr: lggr.Named("OCRContractTransmitter"), + lggr: logger.Named(lggr, "OCRContractTransmitter"), reportToEvmTxMeta: reportToEvmTxMetaNoop, excludeSigs: false, retention: 0, @@ -213,9 +215,6 @@ func (oc *contractTransmitter) LatestConfigDigestAndEpoch(ctx context.Context) ( } // Otherwise, we have to scan for the logs. - if err != nil { - return ocrtypes.ConfigDigest{}, 0, err - } latest, err := oc.lp.LatestLogByEventSigWithConfs(ctx, oc.transmittedEventSig, oc.contractAddress, 1) if err != nil { if errors.Is(err, sql.ErrNoRows) { diff --git a/core/services/relay/evm/event_binding.go b/core/services/relay/evm/event_binding.go deleted file mode 100644 index a3f1fa9d6a2..00000000000 --- a/core/services/relay/evm/event_binding.go +++ /dev/null @@ -1,474 +0,0 @@ -package evm - -import ( - "context" - "fmt" - "reflect" - "strings" - "sync" - - "github.com/ethereum/go-ethereum/accounts/abi" - "github.com/ethereum/go-ethereum/common" - "github.com/google/uuid" - - "github.com/smartcontractkit/chainlink-common/pkg/codec" - commontypes "github.com/smartcontractkit/chainlink-common/pkg/types" - "github.com/smartcontractkit/chainlink-common/pkg/types/query" - "github.com/smartcontractkit/chainlink-common/pkg/types/query/primitives" - - "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" - evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" - "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/types" -) - -type eventBinding struct { - address common.Address - contractName string - eventName string - lp logpoller.LogPoller - // filterRegisterer in eventBinding is to be used as an override for lp filter defined in the contract binding. - // If filterRegisterer is nil, this event should be registered with the lp filter defined in the contract binding. - *filterRegisterer - hash common.Hash - codec commontypes.RemoteCodec - pending bool - // bound determines if address is set to the contract binding. - bound bool - bindLock sync.Mutex - inputInfo types.CodecEntry - inputModifier codec.Modifier - codecTopicInfo types.CodecEntry - // topics maps a generic topic name (key) to topic data - topics map[string]topicDetail - // eventDataWords maps a generic name to a word index - // key is a predefined generic name for evm log event data word - // for e.g. first evm data word(32bytes) of USDC log event is value so the key can be called value - eventDataWords map[string]uint8 - confirmationsMapping map[primitives.ConfidenceLevel]evmtypes.Confirmations -} - -type topicDetail struct { - abi.Argument - Index uint64 -} - -var _ readBinding = &eventBinding{} - -func (e *eventBinding) SetCodec(codec commontypes.RemoteCodec) { - e.codec = codec -} - -func (e *eventBinding) Bind(ctx context.Context, binding commontypes.BoundContract) error { - // it's enough to just lock bound here since Register/Unregister are only called from here and from Start/Close - // even if they somehow happen at the same time it will be fine because of filter lock and hasFilter check - e.bindLock.Lock() - defer e.bindLock.Unlock() - - if e.bound { - // we are changing contract address reference, so we need to unregister old filter it exists - if err := e.Unregister(ctx); err != nil { - return err - } - } - - e.address = common.HexToAddress(binding.Address) - e.pending = binding.Pending - - // filterRegisterer isn't required here because the event can also be polled for by the contractBinding common filter. - if e.filterRegisterer != nil { - id := fmt.Sprintf("%s.%s.%s", e.contractName, e.eventName, uuid.NewString()) - e.pollingFilter.Name = logpoller.FilterName(id, e.address) - e.pollingFilter.Addresses = evmtypes.AddressArray{e.address} - e.bound = true - if e.registerCalled { - return e.Register(ctx) - } - } - e.bound = true - return nil -} - -func (e *eventBinding) Register(ctx context.Context) error { - if e.filterRegisterer == nil { - return nil - } - - e.filterLock.Lock() - defer e.filterLock.Unlock() - - e.registerCalled = true - // can't be true before filters params are set so there is no race with a bad filter outcome - if !e.bound { - return nil - } - - if e.lp.HasFilter(e.pollingFilter.Name) { - return nil - } - - if err := e.lp.RegisterFilter(ctx, e.pollingFilter); err != nil { - return fmt.Errorf("%w: %w", commontypes.ErrInternal, err) - } - - return nil -} - -func (e *eventBinding) Unregister(ctx context.Context) error { - if e.filterRegisterer == nil { - return nil - } - - e.filterLock.Lock() - defer e.filterLock.Unlock() - - if !e.bound { - return nil - } - - if !e.lp.HasFilter(e.pollingFilter.Name) { - return nil - } - - if err := e.lp.UnregisterFilter(ctx, e.pollingFilter.Name); err != nil { - return fmt.Errorf("%w: %w", commontypes.ErrInternal, err) - } - - return nil -} - -func (e *eventBinding) GetLatestValue(ctx context.Context, params, into any) error { - if err := e.validateBound(); err != nil { - return err - } - - // TODO BCF-3247 change GetLatestValue to use chain agnostic confidence levels - confs := evmtypes.Finalized - if e.pending { - confs = evmtypes.Unconfirmed - } - - if len(e.inputInfo.Args()) == 0 { - return e.getLatestValueWithoutFilters(ctx, confs, into) - } - - return e.getLatestValueWithFilters(ctx, confs, params, into) -} - -func (e *eventBinding) QueryKey(ctx context.Context, filter query.KeyFilter, limitAndSort query.LimitAndSort, sequenceDataType any) ([]commontypes.Sequence, error) { - if err := e.validateBound(); err != nil { - return nil, err - } - - remapped, err := e.remap(filter) - if err != nil { - return nil, err - } - - // filter should always use the address and event sig - defaultExpressions := []query.Expression{ - logpoller.NewAddressFilter(e.address), - logpoller.NewEventSigFilter(e.hash), - } - remapped.Expressions = append(defaultExpressions, remapped.Expressions...) - - logs, err := e.lp.FilteredLogs(ctx, remapped, limitAndSort, e.contractName+"-"+e.eventName) - if err != nil { - return nil, err - } - - // no need to return an error. an empty list is fine - if len(logs) == 0 { - return []commontypes.Sequence{}, nil - } - - return e.decodeLogsIntoSequences(ctx, logs, sequenceDataType) -} - -func (e *eventBinding) validateBound() error { - if !e.bound { - return fmt.Errorf( - "%w: event %s that belongs to contract: %s, not bound", - commontypes.ErrInvalidType, - e.eventName, - e.contractName, - ) - } - return nil -} - -func (e *eventBinding) getLatestValueWithoutFilters(ctx context.Context, confs evmtypes.Confirmations, into any) error { - log, err := e.lp.LatestLogByEventSigWithConfs(ctx, e.hash, e.address, confs) - if err = wrapInternalErr(err); err != nil { - return err - } - - return e.decodeLog(ctx, log, into) -} - -func (e *eventBinding) getLatestValueWithFilters( - ctx context.Context, confs evmtypes.Confirmations, params, into any) error { - offChain, err := e.convertToOffChainType(params) - if err != nil { - return err - } - - checkedParams, err := e.inputModifier.TransformToOnChain(offChain, "" /* unused */) - if err != nil { - return err - } - - nativeParams, err := e.inputInfo.ToNative(reflect.ValueOf(checkedParams)) - if err != nil { - return err - } - - filtersAndIndices, err := e.encodeParams(nativeParams) - if err != nil { - return err - } - - fai := filtersAndIndices[0] - remainingFilters := filtersAndIndices[1:] - - logs, err := e.lp.IndexedLogs(ctx, e.hash, e.address, 1, []common.Hash{fai}, confs) - if err != nil { - return wrapInternalErr(err) - } - - // TODO: there should be a better way to ask log poller to filter these - // First, you should be able to ask for as many topics to match - // Second, you should be able to get the latest only - var logToUse *logpoller.Log - for _, log := range logs { - tmp := log - if compareLogs(&tmp, logToUse) > 0 && matchesRemainingFilters(&tmp, remainingFilters) { - // copy so that it's not pointing to the changing variable - logToUse = &tmp - } - } - - if logToUse == nil { - return fmt.Errorf("%w: no events found", commontypes.ErrNotFound) - } - - return e.decodeLog(ctx, logToUse, into) -} - -func (e *eventBinding) convertToOffChainType(params any) (any, error) { - offChain, err := e.codec.CreateType(wrapItemType(e.contractName, e.eventName, true), true) - if err != nil { - return nil, err - } - - if err = mapstructureDecode(params, offChain); err != nil { - return nil, err - } - - return offChain, nil -} - -func compareLogs(log, use *logpoller.Log) int64 { - if use == nil { - return 1 - } - - if log.BlockNumber != use.BlockNumber { - return log.BlockNumber - use.BlockNumber - } - - return log.LogIndex - use.LogIndex -} - -func matchesRemainingFilters(log *logpoller.Log, filters []common.Hash) bool { - for i, rfai := range filters { - if !reflect.DeepEqual(rfai[:], log.Topics[i+2]) { - return false - } - } - - return true -} - -func (e *eventBinding) encodeParams(item reflect.Value) ([]common.Hash, error) { - for item.Kind() == reflect.Pointer { - item = reflect.Indirect(item) - } - - var topics []any - switch item.Kind() { - case reflect.Array, reflect.Slice: - native, err := representArray(item, e.inputInfo) - if err != nil { - return nil, err - } - topics = []any{native} - case reflect.Struct, reflect.Map: - var err error - if topics, err = unrollItem(item, e.inputInfo); err != nil { - return nil, err - } - default: - return nil, fmt.Errorf("%w: cannot encode kind %v", commontypes.ErrInvalidType, item.Kind()) - } - - // abi params allow you to Pack a pointers, but MakeTopics doesn't work with pointers. - if err := e.derefTopics(topics); err != nil { - return nil, err - } - - hashes, err := abi.MakeTopics(topics) - if err != nil { - return nil, wrapInternalErr(err) - } - - if len(hashes) != 1 { - return nil, fmt.Errorf("%w: expected 1 filter set, got %d", commontypes.ErrInternal, len(hashes)) - } - - return hashes[0], nil -} - -func (e *eventBinding) derefTopics(topics []any) error { - for i, topic := range topics { - rTopic := reflect.ValueOf(topic) - if rTopic.Kind() == reflect.Pointer { - if rTopic.IsNil() { - return fmt.Errorf( - "%w: input topic %s cannot be nil", commontypes.ErrInvalidType, e.inputInfo.Args()[i].Name) - } - topics[i] = rTopic.Elem().Interface() - } - } - return nil -} - -func (e *eventBinding) decodeLog(ctx context.Context, log *logpoller.Log, into any) error { - if err := e.codec.Decode(ctx, log.Data, into, wrapItemType(e.contractName, e.eventName, false)); err != nil { - return err - } - - topics := make([]common.Hash, len(e.codecTopicInfo.Args())) - if len(log.Topics) < len(topics)+1 { - return fmt.Errorf("%w: not enough topics to decode", commontypes.ErrInvalidType) - } - - for i := 0; i < len(topics); i++ { - topics[i] = common.Hash(log.Topics[i+1]) - } - - topicsInto := map[string]any{} - if err := abi.ParseTopicsIntoMap(topicsInto, e.codecTopicInfo.Args(), topics); err != nil { - return fmt.Errorf("%w: %w", commontypes.ErrInvalidType, err) - } - - return mapstructureDecode(topicsInto, into) -} - -func (e *eventBinding) decodeLogsIntoSequences(ctx context.Context, logs []logpoller.Log, into any) ([]commontypes.Sequence, error) { - sequences := make([]commontypes.Sequence, len(logs)) - - for idx := range logs { - sequences[idx] = commontypes.Sequence{ - Cursor: fmt.Sprintf("%s-%s-%d", logs[idx].BlockHash, logs[idx].TxHash, logs[idx].LogIndex), - Head: commontypes.Head{ - Identifier: fmt.Sprint(logs[idx].BlockNumber), - Hash: logs[idx].BlockHash.Bytes(), - Timestamp: uint64(logs[idx].BlockTimestamp.Unix()), - }, - } - - var typeVal reflect.Value - - typeInto := reflect.TypeOf(into) - if typeInto.Kind() == reflect.Pointer { - typeVal = reflect.New(typeInto.Elem()) - } else { - typeVal = reflect.Indirect(reflect.New(typeInto)) - } - - // create a new value of the same type as 'into' for the data to be extracted to - sequences[idx].Data = typeVal.Interface() - - if err := e.decodeLog(ctx, &logs[idx], sequences[idx].Data); err != nil { - return nil, err - } - } - - return sequences, nil -} - -func (e *eventBinding) remap(filter query.KeyFilter) (query.KeyFilter, error) { - remapped := query.KeyFilter{} - - for _, expression := range filter.Expressions { - remappedExpression, err := e.remapExpression(filter.Key, expression) - if err != nil { - return query.KeyFilter{}, err - } - - remapped.Expressions = append(remapped.Expressions, remappedExpression) - } - - return remapped, nil -} - -func (e *eventBinding) remapExpression(key string, expression query.Expression) (query.Expression, error) { - if !expression.IsPrimitive() { - remappedBoolExpressions := make([]query.Expression, len(expression.BoolExpression.Expressions)) - - for i := range expression.BoolExpression.Expressions { - remapped, err := e.remapExpression(key, expression.BoolExpression.Expressions[i]) - if err != nil { - return query.Expression{}, err - } - - remappedBoolExpressions[i] = remapped - } - - if expression.BoolExpression.BoolOperator == query.AND { - return query.And(remappedBoolExpressions...), nil - } - - return query.Or(remappedBoolExpressions...), nil - } - - return e.remapPrimitive(key, expression) -} - -// remap chain agnostic primitives to chain specific -func (e *eventBinding) remapPrimitive(key string, expression query.Expression) (query.Expression, error) { - switch primitive := expression.Primitive.(type) { - case *primitives.Comparator: - if val, ok := e.eventDataWords[primitive.Name]; ok { - return logpoller.NewEventByWordFilter(e.hash, val, primitive.ValueComparators), nil - } - - return logpoller.NewEventByTopicFilter(e.topics[key].Index, primitive.ValueComparators), nil - case *primitives.Confidence: - return logpoller.NewConfirmationsFilter(e.confirmationsFrom(primitive.ConfidenceLevel)), nil - default: - return expression, nil - } -} - -func (e *eventBinding) confirmationsFrom(confidence primitives.ConfidenceLevel) evmtypes.Confirmations { - value, ok := e.confirmationsMapping[confidence] - if ok { - return value - } - - // if the mapping doesn't exist, default to finalized for safety - return evmtypes.Finalized -} - -func wrapInternalErr(err error) error { - if err == nil { - return nil - } - - errStr := err.Error() - if strings.Contains(errStr, "not found") || strings.Contains(errStr, "no rows") { - return fmt.Errorf("%w: %w", commontypes.ErrNotFound, err) - } - return fmt.Errorf("%w: %w", commontypes.ErrInternal, err) -} diff --git a/core/services/relay/evm/evm.go b/core/services/relay/evm/evm.go index e91726ba040..880ad73ad21 100644 --- a/core/services/relay/evm/evm.go +++ b/core/services/relay/evm/evm.go @@ -1,10 +1,14 @@ package evm import ( + "bytes" "context" + "crypto/sha256" "encoding/json" "errors" "fmt" + "math/big" + "net/http" "strings" "sync" @@ -19,30 +23,41 @@ import ( "github.com/smartcontractkit/libocr/offchainreporting2/reportingplugin/median/evmreportcodec" ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" + chainselectors "github.com/smartcontractkit/chain-selectors" + ocr3capability "github.com/smartcontractkit/chainlink-common/pkg/capabilities/consensus/ocr3" "github.com/smartcontractkit/chainlink-common/pkg/capabilities/triggers" + "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink-common/pkg/services" "github.com/smartcontractkit/chainlink-common/pkg/sqlutil" commontypes "github.com/smartcontractkit/chainlink-common/pkg/types" + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" coretypes "github.com/smartcontractkit/chainlink-common/pkg/types/core" txmgrcommon "github.com/smartcontractkit/chainlink/v2/common/txmgr" txm "github.com/smartcontractkit/chainlink/v2/core/chains/evm/txmgr" evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" "github.com/smartcontractkit/chainlink/v2/core/chains/legacyevm" - "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/keystore" "github.com/smartcontractkit/chainlink/v2/core/services/llo" "github.com/smartcontractkit/chainlink/v2/core/services/llo/bm" + "github.com/smartcontractkit/chainlink/v2/core/services/llo/mercurytransmitter" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/ccipcommit" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/ccipexec" + ccipconfig "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/config" + cciptransmitter "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/transmitter" lloconfig "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/llo/config" mercuryconfig "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/mercury/config" "github.com/smartcontractkit/chainlink/v2/core/services/ocrcommon" + "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/codec" "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/functions" "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury" mercuryutils "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury/utils" reportcodecv1 "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury/v1/reportcodec" reportcodecv2 "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury/v2/reportcodec" reportcodecv3 "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury/v3/reportcodec" + reportcodecv4 "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury/v4/reportcodec" "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury/wsrpc" "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/types" ) @@ -50,7 +65,7 @@ import ( var ( OCR2AggregatorTransmissionContractABI abi.ABI OCR2AggregatorLogDecoder LogDecoder - ChannelVerifierLogDecoder LogDecoder + OCR3CapabilityLogDecoder LogDecoder ) func init() { @@ -63,7 +78,7 @@ func init() { if err != nil { panic(err) } - ChannelVerifierLogDecoder, err = newChannelVerifierLogDecoder() + OCR3CapabilityLogDecoder, err = newOCR3CapabilityLogDecoder() if err != nil { panic(err) } @@ -71,13 +86,63 @@ func init() { var _ commontypes.Relayer = &Relayer{} //nolint:staticcheck +// The current PluginProvider interface does not support an error return. This was fine up until CCIP. +// CCIP is the first product to introduce the idea of incomplete implementations of a provider based on +// what chain (for CCIP, src or dest) the provider is created for. The Unimplemented* implementations below allow us to return +// a non nil value, which is hopefully a better developer experience should you find yourself using the right methods +// but on the *wrong* provider. + +// [UnimplementedOffchainConfigDigester] satisfies the OCR OffchainConfigDigester interface +type UnimplementedOffchainConfigDigester struct{} + +func (e UnimplementedOffchainConfigDigester) ConfigDigest(config ocrtypes.ContractConfig) (ocrtypes.ConfigDigest, error) { + return ocrtypes.ConfigDigest{}, fmt.Errorf("unimplemented for this relayer") +} + +func (e UnimplementedOffchainConfigDigester) ConfigDigestPrefix() (ocrtypes.ConfigDigestPrefix, error) { + return 0, fmt.Errorf("unimplemented for this relayer") +} + +// [UnimplementedContractConfigTracker] satisfies the OCR ContractConfigTracker interface +type UnimplementedContractConfigTracker struct{} + +func (u UnimplementedContractConfigTracker) Notify() <-chan struct{} { + return nil +} + +func (u UnimplementedContractConfigTracker) LatestConfigDetails(ctx context.Context) (changedInBlock uint64, configDigest ocrtypes.ConfigDigest, err error) { + return 0, ocrtypes.ConfigDigest{}, fmt.Errorf("unimplemented for this relayer") +} + +func (u UnimplementedContractConfigTracker) LatestConfig(ctx context.Context, changedInBlock uint64) (ocrtypes.ContractConfig, error) { + return ocrtypes.ContractConfig{}, fmt.Errorf("unimplemented for this relayer") +} + +func (u UnimplementedContractConfigTracker) LatestBlockHeight(ctx context.Context) (blockHeight uint64, err error) { + return 0, fmt.Errorf("unimplemented for this relayer") +} + +// [UnimplementedContractTransmitter] satisfies the OCR ContractTransmitter interface +type UnimplementedContractTransmitter struct{} + +func (u UnimplementedContractTransmitter) Transmit(context.Context, ocrtypes.ReportContext, ocrtypes.Report, []ocrtypes.AttributedOnchainSignature) error { + return fmt.Errorf("unimplemented for this relayer") +} + +func (u UnimplementedContractTransmitter) FromAccount() (ocrtypes.Account, error) { + return "", fmt.Errorf("unimplemented for this relayer") +} + +func (u UnimplementedContractTransmitter) LatestConfigDigestAndEpoch(ctx context.Context) (configDigest ocrtypes.ConfigDigest, epoch uint32, err error) { + return ocrtypes.ConfigDigest{}, 0, fmt.Errorf("unimplemented for this relayer") +} + type Relayer struct { ds sqlutil.DataSource chain legacyevm.Chain - lggr logger.Logger + lggr logger.SugaredLogger ks CSAETHKeystore mercuryPool wsrpc.Pool - chainReader commontypes.ContractReader codec commontypes.Codec capabilitiesRegistry coretypes.CapabilitiesRegistry @@ -87,8 +152,7 @@ type Relayer struct { triggerCapability *triggers.MercuryTriggerService // LLO/data streams - cdcFactory llo.ChannelDefinitionCacheFactory - lloORM llo.ORM + cdcFactory func() (llo.ChannelDefinitionCacheFactory, error) } type CSAETHKeystore interface { @@ -102,6 +166,7 @@ type RelayerOpts struct { MercuryPool wsrpc.Pool TransmitterConfig mercury.TransmitterConfig CapabilitiesRegistry coretypes.CapabilitiesRegistry + HTTPClient *http.Client } func (c RelayerOpts) Validate() error { @@ -126,19 +191,23 @@ func NewRelayer(lggr logger.Logger, chain legacyevm.Chain, opts RelayerOpts) (*R if err != nil { return nil, fmt.Errorf("cannot create evm relayer: %w", err) } - lggr = lggr.Named("Relayer") - + sugared := logger.Sugared(lggr).Named("Relayer") mercuryORM := mercury.NewORM(opts.DS) - lloORM := llo.NewORM(opts.DS, chain.ID()) - cdcFactory := llo.NewChannelDefinitionCacheFactory(lggr, lloORM, chain.LogPoller()) + cdcFactory := sync.OnceValues(func() (llo.ChannelDefinitionCacheFactory, error) { + chainSelector, err := chainselectors.SelectorFromChainId(chain.ID().Uint64()) + if err != nil { + return nil, fmt.Errorf("failed to get chain selector for chain id %s: %w", chain.ID(), err) + } + lloORM := llo.NewORM(opts.DS, chainSelector) + return llo.NewChannelDefinitionCacheFactory(sugared, lloORM, chain.LogPoller(), opts.HTTPClient), nil + }) relayer := &Relayer{ ds: opts.DS, chain: chain, - lggr: lggr, + lggr: sugared, ks: opts.CSAETHKeystore, mercuryPool: opts.MercuryPool, cdcFactory: cdcFactory, - lloORM: lloORM, mercuryORM: mercuryORM, transmitterCfg: opts.TransmitterConfig, capabilitiesRegistry: opts.CapabilitiesRegistry, @@ -147,7 +216,12 @@ func NewRelayer(lggr logger.Logger, chain legacyevm.Chain, opts RelayerOpts) (*R // Initialize write target capability if configuration is defined if chain.Config().EVM().Workflow().ForwarderAddress() != nil { ctx := context.Background() - capability, err := NewWriteTarget(ctx, relayer, chain, lggr) + if chain.Config().EVM().Workflow().GasLimitDefault() == nil { + return nil, fmt.Errorf("unable to instantiate write target as default gas limit is not set") + } + + capability, err := NewWriteTarget(ctx, relayer, chain, *chain.Config().EVM().Workflow().GasLimitDefault(), + lggr) if err != nil { return nil, fmt.Errorf("failed to initialize write target: %w", err) } @@ -187,12 +261,57 @@ func (r *Relayer) HealthReport() (report map[string]error) { return } +func newOCR3CapabilityConfigProvider(ctx context.Context, lggr logger.Logger, chain legacyevm.Chain, opts *types.RelayOpts) (*configWatcher, error) { + if !common.IsHexAddress(opts.ContractID) { + return nil, errors.New("invalid contractID, expected hex address") + } + + aggregatorAddress := common.HexToAddress(opts.ContractID) + offchainConfigDigester := OCR3CapabilityOffchainConfigDigester{ + ChainID: chain.Config().EVM().ChainID().Uint64(), + ContractAddress: aggregatorAddress, + } + return newContractConfigProvider(ctx, lggr, chain, opts, aggregatorAddress, OCR3CapabilityLogDecoder, offchainConfigDigester) +} + +// NewPluginProvider, but customized to use a different config provider func (r *Relayer) NewOCR3CapabilityProvider(rargs commontypes.RelayArgs, pargs commontypes.PluginArgs) (commontypes.OCR3CapabilityProvider, error) { - pp, err := r.NewPluginProvider(rargs, pargs) + // TODO https://smartcontract-it.atlassian.net/browse/BCF-2887 + ctx := context.Background() + lggr := logger.Sugared(r.lggr).Named("PluginProvider").Named(rargs.ExternalJobID.String()) + relayOpts := types.NewRelayOpts(rargs) + relayConfig, err := relayOpts.RelayConfig() + if err != nil { + return nil, fmt.Errorf("failed to get relay config: %w", err) + } + + configWatcher, err := newOCR3CapabilityConfigProvider(ctx, r.lggr, r.chain, relayOpts) + if err != nil { + return nil, err + } + + transmitter, err := newOnChainContractTransmitter(ctx, r.lggr, rargs, r.ks.Eth(), configWatcher, configTransmitterOpts{}, OCR2AggregatorTransmissionContractABI) if err != nil { return nil, err } + var chainReaderService ChainReaderService + if relayConfig.ChainReader != nil { + if chainReaderService, err = NewChainReaderService(ctx, lggr, r.chain.LogPoller(), r.chain.HeadTracker(), r.chain.Client(), *relayConfig.ChainReader); err != nil { + return nil, err + } + } else { + lggr.Info("ChainReader missing from RelayConfig") + } + + pp := NewPluginProvider( + chainReaderService, + r.codec, + transmitter, + configWatcher, + lggr, + ) + fromAccount, err := pp.ContractTransmitter().FromAccount() if err != nil { return nil, err @@ -207,10 +326,14 @@ func (r *Relayer) NewOCR3CapabilityProvider(rargs commontypes.RelayArgs, pargs c func (r *Relayer) NewPluginProvider(rargs commontypes.RelayArgs, pargs commontypes.PluginArgs) (commontypes.PluginProvider, error) { // TODO https://smartcontract-it.atlassian.net/browse/BCF-2887 ctx := context.Background() + lggr := logger.Sugared(r.lggr).Named("PluginProvider").Named(rargs.ExternalJobID.String()) + relayOpts := types.NewRelayOpts(rargs) + relayConfig, err := relayOpts.RelayConfig() + if err != nil { + return nil, fmt.Errorf("failed to get relay config: %w", err) + } - lggr := r.lggr.Named("PluginProvider").Named(rargs.ExternalJobID.String()) - - configWatcher, err := newStandardConfigProvider(ctx, r.lggr, r.chain, types.NewRelayOpts(rargs)) + configWatcher, err := newStandardConfigProvider(ctx, r.lggr, r.chain, relayOpts) if err != nil { return nil, err } @@ -220,8 +343,17 @@ func (r *Relayer) NewPluginProvider(rargs commontypes.RelayArgs, pargs commontyp return nil, err } + var chainReaderService ChainReaderService + if relayConfig.ChainReader != nil { + if chainReaderService, err = NewChainReaderService(ctx, lggr, r.chain.LogPoller(), r.chain.HeadTracker(), r.chain.Client(), *relayConfig.ChainReader); err != nil { + return nil, err + } + } else { + lggr.Info("ChainReader missing from RelayConfig") + } + return NewPluginProvider( - r.chainReader, + chainReaderService, r.codec, transmitter, configWatcher, @@ -232,7 +364,7 @@ func (r *Relayer) NewPluginProvider(rargs commontypes.RelayArgs, pargs commontyp func (r *Relayer) NewMercuryProvider(rargs commontypes.RelayArgs, pargs commontypes.PluginArgs) (commontypes.MercuryProvider, error) { // TODO https://smartcontract-it.atlassian.net/browse/BCF-2887 ctx := context.Background() - lggr := r.lggr.Named("MercuryProvider").Named(rargs.ExternalJobID.String()) + lggr := logger.Sugared(r.lggr).Named("MercuryProvider").Named(rargs.ExternalJobID.String()) relayOpts := types.NewRelayOpts(rargs) relayConfig, err := relayOpts.RelayConfig() if err != nil { @@ -296,6 +428,7 @@ func (r *Relayer) NewMercuryProvider(rargs commontypes.RelayArgs, pargs commonty reportCodecV1 := reportcodecv1.NewReportCodec(*relayConfig.FeedID, lggr.Named("ReportCodecV1")) reportCodecV2 := reportcodecv2.NewReportCodec(*relayConfig.FeedID, lggr.Named("ReportCodecV2")) reportCodecV3 := reportcodecv3.NewReportCodec(*relayConfig.FeedID, lggr.Named("ReportCodecV3")) + reportCodecV4 := reportcodecv4.NewReportCodec(*relayConfig.FeedID, lggr.Named("ReportCodecV4")) var transmitterCodec mercury.TransmitterReportDecoder switch feedID.Version() { @@ -305,12 +438,14 @@ func (r *Relayer) NewMercuryProvider(rargs commontypes.RelayArgs, pargs commonty transmitterCodec = reportCodecV2 case 3: transmitterCodec = reportCodecV3 + case 4: + transmitterCodec = reportCodecV4 default: return nil, fmt.Errorf("invalid feed version %d", feedID.Version()) } transmitter := mercury.NewTransmitter(lggr, r.transmitterCfg, clients, privKey.PublicKey, rargs.JobID, *relayConfig.FeedID, r.mercuryORM, transmitterCodec, r.triggerCapability) - return NewMercuryProvider(cp, r.chainReader, r.codec, NewMercuryChainReader(r.chain.HeadTracker()), transmitter, reportCodecV1, reportCodecV2, reportCodecV3, lggr), nil + return NewMercuryProvider(cp, r.codec, NewMercuryChainReader(r.chain.HeadTracker()), transmitter, reportCodecV1, reportCodecV2, reportCodecV3, reportCodecV4, lggr), nil } func (r *Relayer) NewLLOProvider(rargs commontypes.RelayArgs, pargs commontypes.PluginArgs) (commontypes.LLOProvider, error) { @@ -353,20 +488,38 @@ func (r *Relayer) NewLLOProvider(rargs commontypes.RelayArgs, pargs commontypes. // FIXME: Remove after benchmarking is done // https://smartcontract-it.atlassian.net/browse/MERC-3487 - var transmitter llo.Transmitter + var transmitter LLOTransmitter if lloCfg.BenchmarkMode { r.lggr.Info("Benchmark mode enabled, using dummy transmitter. NOTE: THIS WILL NOT TRANSMIT ANYTHING") transmitter = bm.NewTransmitter(r.lggr, fmt.Sprintf("%x", privKey.PublicKey)) } else { - var client wsrpc.Client - client, err = r.mercuryPool.Checkout(context.Background(), privKey, lloCfg.ServerPubKey, lloCfg.ServerURL()) - if err != nil { - return nil, err + clients := make(map[string]wsrpc.Client) + for _, server := range lloCfg.GetServers() { + client, err2 := r.mercuryPool.Checkout(context.Background(), privKey, server.PubKey, server.URL) + if err2 != nil { + return nil, err2 + } + clients[server.URL] = client } - transmitter = llo.NewTransmitter(r.lggr, client, privKey.PublicKey) + transmitter = llo.NewTransmitter(llo.TransmitterOpts{ + Lggr: r.lggr, + FromAccount: fmt.Sprintf("%x", privKey.PublicKey), // NOTE: This may need to change if we support e.g. multiple tranmsmitters, to be a composite of all keys + MercuryTransmitterOpts: mercurytransmitter.Opts{ + Lggr: r.lggr, + Cfg: r.transmitterCfg, + Clients: clients, + FromAccount: privKey.PublicKey, + DonID: relayConfig.LLODONID, + ORM: mercurytransmitter.NewORM(r.ds, relayConfig.LLODONID), + }, + }) + } + + cdcFactory, err := r.cdcFactory() + if err != nil { + return nil, err } - - cdc, err := r.cdcFactory.NewCache(lloCfg) + cdc, err := cdcFactory.NewCache(lloCfg) if err != nil { return nil, err } @@ -403,6 +556,8 @@ func (r *Relayer) NewConfigProvider(args commontypes.RelayArgs) (configProvider if args.ProviderType == "" { if relayConfig.FeedID == nil { args.ProviderType = "median" + } else if relayConfig.LLODONID > 0 { + args.ProviderType = "llo" } else { args.ProviderType = "mercury" } @@ -415,6 +570,8 @@ func (r *Relayer) NewConfigProvider(args commontypes.RelayArgs) (configProvider configProvider, err = newMercuryConfigProvider(ctx, lggr, r.chain, relayOpts) case "llo": configProvider, err = newLLOConfigProvider(ctx, lggr, r.chain, relayOpts) + case "ocr3-capability": + configProvider, err = newOCR3CapabilityConfigProvider(ctx, r.lggr, r.chain, relayOpts) default: return nil, fmt.Errorf("unrecognized provider type: %q", args.ProviderType) } @@ -445,16 +602,15 @@ func FilterNamesFromRelayArgs(args commontypes.RelayArgs) (filterNames []string, } type configWatcher struct { - services.StateMachine - lggr logger.Logger + services.Service + eng *services.Engine + contractAddress common.Address offchainDigester ocrtypes.OffchainConfigDigester configPoller types.ConfigPoller chain legacyevm.Chain runReplay bool fromBlock uint64 - stopCh services.StopChan - wg sync.WaitGroup } func newConfigWatcher(lggr logger.Logger, @@ -465,54 +621,41 @@ func newConfigWatcher(lggr logger.Logger, fromBlock uint64, runReplay bool, ) *configWatcher { - return &configWatcher{ - lggr: lggr.Named("ConfigWatcher").Named(contractAddress.String()), + cw := &configWatcher{ contractAddress: contractAddress, offchainDigester: offchainDigester, configPoller: configPoller, chain: chain, runReplay: runReplay, fromBlock: fromBlock, - stopCh: make(chan struct{}), - } -} - -func (c *configWatcher) Name() string { - return c.lggr.Name() -} - -func (c *configWatcher) Start(ctx context.Context) error { - return c.StartOnce(fmt.Sprintf("configWatcher %x", c.contractAddress), func() error { - if c.runReplay && c.fromBlock != 0 { - // Only replay if it's a brand runReplay job. - c.wg.Add(1) - go func() { - defer c.wg.Done() - ctx, cancel := c.stopCh.NewCtx() - defer cancel() - c.lggr.Infow("starting replay for config", "fromBlock", c.fromBlock) - if err := c.configPoller.Replay(ctx, int64(c.fromBlock)); err != nil { - c.lggr.Errorw("error replaying for config", "err", err) - } else { - c.lggr.Infow("completed replaying for config", "fromBlock", c.fromBlock) - } - }() - } - c.configPoller.Start() - return nil - }) + } + cw.Service, cw.eng = services.Config{ + Name: fmt.Sprintf("ConfigWatcher.%s", contractAddress), + NewSubServices: nil, + Start: cw.start, + Close: cw.close, + }.NewServiceEngine(lggr) + return cw } -func (c *configWatcher) Close() error { - return c.StopOnce(fmt.Sprintf("configWatcher %x", c.contractAddress), func() error { - close(c.stopCh) - c.wg.Wait() - return c.configPoller.Close() - }) +func (c *configWatcher) start(ctx context.Context) error { + if c.runReplay && c.fromBlock != 0 { + // Only replay if it's a brand runReplay job. + c.eng.Go(func(ctx context.Context) { + c.eng.Infow("starting replay for config", "fromBlock", c.fromBlock) + if err := c.configPoller.Replay(ctx, int64(c.fromBlock)); err != nil { + c.eng.Errorw("error replaying for config", "err", err) + } else { + c.eng.Infow("completed replaying for config", "fromBlock", c.fromBlock) + } + }) + } + c.configPoller.Start() + return nil } -func (c *configWatcher) HealthReport() map[string]error { - return map[string]error{c.Name(): c.Healthy()} +func (c *configWatcher) close() error { + return c.configPoller.Close() } func (c *configWatcher) OffchainConfigDigester() ocrtypes.OffchainConfigDigester { @@ -614,6 +757,17 @@ func generateTransmitterFrom(ctx context.Context, rargs commontypes.RelayArgs, e configWatcher.chain.ID(), ethKeystore, ) + case commontypes.CCIPExecution: + transmitter, err = cciptransmitter.NewTransmitterWithStatusChecker( + configWatcher.chain.TxManager(), + fromAddresses, + gasLimit, + effectiveTransmitterAddress, + strategy, + checker, + configWatcher.chain.ID(), + ethKeystore, + ) default: transmitter, err = ocrcommon.NewTransmitter( configWatcher.chain.TxManager(), @@ -648,14 +802,14 @@ func (r *Relayer) NewContractReader(chainReaderConfig []byte) (commontypes.Contr return nil, fmt.Errorf("failed to unmarshall chain reader config err: %s", err) } - return NewChainReaderService(ctx, r.lggr, r.chain.LogPoller(), r.chain.Client(), *cfg) + return NewChainReaderService(ctx, r.lggr, r.chain.LogPoller(), r.chain.HeadTracker(), r.chain.Client(), *cfg) } func (r *Relayer) NewMedianProvider(rargs commontypes.RelayArgs, pargs commontypes.PluginArgs) (commontypes.MedianProvider, error) { // TODO https://smartcontract-it.atlassian.net/browse/BCF-2887 ctx := context.Background() - lggr := r.lggr.Named("MedianProvider").Named(rargs.ExternalJobID.String()) + lggr := logger.Sugared(r.lggr).Named("MedianProvider").Named(rargs.ExternalJobID.String()) relayOpts := types.NewRelayOpts(rargs) relayConfig, err := relayOpts.RelayConfig() if err != nil { @@ -698,11 +852,11 @@ func (r *Relayer) NewMedianProvider(rargs commontypes.RelayArgs, pargs commontyp // allow fallback until chain reader is default and median contract is removed, but still log just in case var chainReaderService ChainReaderService if relayConfig.ChainReader != nil { - if chainReaderService, err = NewChainReaderService(ctx, lggr, r.chain.LogPoller(), r.chain.Client(), *relayConfig.ChainReader); err != nil { + if chainReaderService, err = NewChainReaderService(ctx, lggr, r.chain.LogPoller(), r.chain.HeadTracker(), r.chain.Client(), *relayConfig.ChainReader); err != nil { return nil, err } - boundContracts := []commontypes.BoundContract{{Name: "median", Pending: true, Address: contractID.String()}} + boundContracts := []commontypes.BoundContract{{Name: "median", Address: contractID.String()}} if err = chainReaderService.Bind(context.Background(), boundContracts); err != nil { return nil, err } @@ -712,7 +866,7 @@ func (r *Relayer) NewMedianProvider(rargs commontypes.RelayArgs, pargs commontyp medianProvider.chainReader = chainReaderService if relayConfig.Codec != nil { - medianProvider.codec, err = NewCodec(*relayConfig.Codec) + medianProvider.codec, err = codec.NewCodec(*relayConfig.Codec) if err != nil { return nil, err } @@ -724,18 +878,164 @@ func (r *Relayer) NewMedianProvider(rargs commontypes.RelayArgs, pargs commontyp } func (r *Relayer) NewAutomationProvider(rargs commontypes.RelayArgs, pargs commontypes.PluginArgs) (commontypes.AutomationProvider, error) { - lggr := r.lggr.Named("AutomationProvider").Named(rargs.ExternalJobID.String()) + lggr := logger.Sugared(r.lggr).Named("AutomationProvider").Named(rargs.ExternalJobID.String()) ocr2keeperRelayer := NewOCR2KeeperRelayer(r.ds, r.chain, lggr.Named("OCR2KeeperRelayer"), r.ks.Eth()) return ocr2keeperRelayer.NewOCR2KeeperProvider(rargs, pargs) } -func (r *Relayer) NewCCIPCommitProvider(_ commontypes.RelayArgs, _ commontypes.PluginArgs) (commontypes.CCIPCommitProvider, error) { - return nil, errors.New("ccip.commit is not supported for evm") +func chainToUUID(chainID *big.Int) uuid.UUID { + // See https://www.rfc-editor.org/rfc/rfc4122.html#section-4.1.3 for the list of supported versions. + const VersionSHA1 = 5 + var buf bytes.Buffer + buf.WriteString("CCIP:") + buf.Write(chainID.Bytes()) + // We use SHA-256 instead of SHA-1 because the former has better collision resistance. + // The UUID will contain only the first 16 bytes of the hash. + // You can't say which algorithms was used just by looking at the UUID bytes. + return uuid.NewHash(sha256.New(), uuid.NameSpaceOID, buf.Bytes(), VersionSHA1) +} + +// NewCCIPCommitProvider constructs a provider of type CCIPCommitProvider. Since this is happening in the Relayer, +// which lives in a separate process from delegate which is requesting a provider, we need to wire in through pargs +// which *type* (impl) of CCIPCommitProvider should be created. CCIP is currently a special case where the provider has a +// subset of implementations of the complete interface as certain contracts in a CCIP lane are only deployed on the src +// chain or on the dst chain. This results in the two implementations of providers: a src and dst implementation. +func (r *Relayer) NewCCIPCommitProvider(rargs commontypes.RelayArgs, pargs commontypes.PluginArgs) (commontypes.CCIPCommitProvider, error) { + // TODO https://smartcontract-it.atlassian.net/browse/BCF-2887 + ctx := context.Background() + + versionFinder := ccip.NewEvmVersionFinder() + + var commitPluginConfig ccipconfig.CommitPluginConfig + err := json.Unmarshal(pargs.PluginConfig, &commitPluginConfig) + if err != nil { + return nil, err + } + sourceStartBlock := commitPluginConfig.SourceStartBlock + destStartBlock := commitPluginConfig.DestStartBlock + + // The src chain implementation of this provider does not need a configWatcher or contractTransmitter; + // bail early. + if commitPluginConfig.IsSourceProvider { + return NewSrcCommitProvider( + r.lggr, + sourceStartBlock, + r.chain.Client(), + r.chain.LogPoller(), + r.chain.GasEstimator(), + r.chain.Config().EVM().GasEstimator().PriceMax().ToInt(), + ), nil + } + + relayOpts := types.NewRelayOpts(rargs) + configWatcher, err := newStandardConfigProvider(ctx, r.lggr, r.chain, relayOpts) + if err != nil { + return nil, err + } + address := common.HexToAddress(relayOpts.ContractID) + typ, ver, err := ccipconfig.TypeAndVersion(address, r.chain.Client()) + if err != nil { + return nil, err + } + fn, err := ccipcommit.CommitReportToEthTxMeta(typ, ver) + if err != nil { + return nil, err + } + subjectID := chainToUUID(configWatcher.chain.ID()) + contractTransmitter, err := newOnChainContractTransmitter(ctx, r.lggr, rargs, r.ks.Eth(), configWatcher, configTransmitterOpts{ + subjectID: &subjectID, + }, OCR2AggregatorTransmissionContractABI, WithReportToEthMetadata(fn), WithRetention(0)) + if err != nil { + return nil, err + } + + return NewDstCommitProvider( + r.lggr, + versionFinder, + destStartBlock, + r.chain.Client(), + r.chain.LogPoller(), + r.chain.GasEstimator(), + *r.chain.Config().EVM().GasEstimator().PriceMax().ToInt(), + *contractTransmitter, + configWatcher, + ), nil } -func (r *Relayer) NewCCIPExecProvider(_ commontypes.RelayArgs, _ commontypes.PluginArgs) (commontypes.CCIPExecProvider, error) { - return nil, errors.New("ccip.exec is not supported for evm") +// NewCCIPExecProvider constructs a provider of type CCIPExecProvider. Since this is happening in the Relayer, +// which lives in a separate process from delegate which is requesting a provider, we need to wire in through pargs +// which *type* (impl) of CCIPExecProvider should be created. CCIP is currently a special case where the provider has a +// subset of implementations of the complete interface as certain contracts in a CCIP lane are only deployed on the src +// chain or on the dst chain. This results in the two implementations of providers: a src and dst implementation. +func (r *Relayer) NewCCIPExecProvider(rargs commontypes.RelayArgs, pargs commontypes.PluginArgs) (commontypes.CCIPExecProvider, error) { + // TODO https://smartcontract-it.atlassian.net/browse/BCF-2887 + ctx := context.Background() + + versionFinder := ccip.NewEvmVersionFinder() + + var execPluginConfig ccipconfig.ExecPluginConfig + err := json.Unmarshal(pargs.PluginConfig, &execPluginConfig) + if err != nil { + return nil, err + } + + usdcConfig := execPluginConfig.USDCConfig + + // The src chain implementation of this provider does not need a configWatcher or contractTransmitter; + // bail early. + if execPluginConfig.IsSourceProvider { + return NewSrcExecProvider( + r.lggr, + versionFinder, + r.chain.Client(), + r.chain.GasEstimator(), + r.chain.Config().EVM().GasEstimator().PriceMax().ToInt(), + r.chain.LogPoller(), + execPluginConfig.SourceStartBlock, + execPluginConfig.JobID, + usdcConfig.AttestationAPI, + int(usdcConfig.AttestationAPITimeoutSeconds), + usdcConfig.AttestationAPIIntervalMilliseconds, + usdcConfig.SourceMessageTransmitterAddress, + ) + } + + relayOpts := types.NewRelayOpts(rargs) + configWatcher, err := newStandardConfigProvider(ctx, r.lggr, r.chain, relayOpts) + if err != nil { + return nil, err + } + address := common.HexToAddress(relayOpts.ContractID) + typ, ver, err := ccipconfig.TypeAndVersion(address, r.chain.Client()) + if err != nil { + return nil, err + } + fn, err := ccipexec.ExecReportToEthTxMeta(ctx, typ, ver) + if err != nil { + return nil, err + } + subjectID := chainToUUID(configWatcher.chain.ID()) + contractTransmitter, err := newOnChainContractTransmitter(ctx, r.lggr, rargs, r.ks.Eth(), configWatcher, configTransmitterOpts{ + subjectID: &subjectID, + }, OCR2AggregatorTransmissionContractABI, WithReportToEthMetadata(fn), WithRetention(0)) + if err != nil { + return nil, err + } + + return NewDstExecProvider( + r.lggr, + versionFinder, + r.chain.Client(), + r.chain.LogPoller(), + execPluginConfig.DestStartBlock, + contractTransmitter, + configWatcher, + r.chain.GasEstimator(), + *r.chain.Config().EVM().GasEstimator().PriceMax().ToInt(), + r.chain.TxManager(), + cciptypes.Address(rargs.ContractID), + ) } var _ commontypes.MedianProvider = (*medianProvider)(nil) @@ -798,7 +1098,7 @@ func (p *medianProvider) ContractConfigTracker() ocrtypes.ContractConfigTracker return p.configWatcher.ContractConfigTracker() } -func (p *medianProvider) ChainReader() commontypes.ContractReader { +func (p *medianProvider) ContractReader() commontypes.ContractReader { return p.chainReader } diff --git a/core/services/relay/evm/evmtesting/chain_components_interface_tester.go b/core/services/relay/evm/evmtesting/chain_components_interface_tester.go new file mode 100644 index 00000000000..ac8ece9b37f --- /dev/null +++ b/core/services/relay/evm/evmtesting/chain_components_interface_tester.go @@ -0,0 +1,469 @@ +package evmtesting + +import ( + "context" + "encoding/json" + "math/big" + "time" + + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/jmoiron/sqlx" + "github.com/smartcontractkit/libocr/commontypes" + + "github.com/smartcontractkit/chainlink-common/pkg/codec" + clcommontypes "github.com/smartcontractkit/chainlink-common/pkg/types" + . "github.com/smartcontractkit/chainlink-common/pkg/types/interfacetests" //nolint common practice to import test mods with . + "github.com/smartcontractkit/chainlink-common/pkg/types/query/primitives" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/gas" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/headtracker" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" + evmtxmgr "github.com/smartcontractkit/chainlink/v2/core/chains/evm/txmgr" + evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/chain_reader_tester" + _ "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/pgtest" // force binding for tx type + "github.com/smartcontractkit/chainlink/v2/core/logger" + "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm" + "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/types" + + gethtypes "github.com/ethereum/go-ethereum/core/types" + "github.com/stretchr/testify/require" +) + +const ( + triggerWithDynamicTopic = "TriggeredEventWithDynamicTopic" + triggerWithAllTopics = "TriggeredWithFourTopics" + triggerWithAllTopicsWithHashed = "TriggeredWithFourTopicsWithHashed" + finalityDepth = 4 +) + +type EVMChainComponentsInterfaceTesterHelper[T TestingT[T]] interface { + Init(t T) + Client(t T) client.Client + Commit() + Backend() bind.ContractBackend + ChainID() *big.Int + Context(t T) context.Context + NewSqlxDB(t T) *sqlx.DB + MaxWaitTimeForEvents() time.Duration + GasPriceBufferPercent() int64 + Accounts(t T) []*bind.TransactOpts + TXM(T, client.Client) evmtxmgr.TxManager + // To enable the historical wrappers required for Simulated Backend tests. + ChainReaderEVMClient(ctx context.Context, t T, ht logpoller.HeadTracker, conf types.ChainReaderConfig) client.Client + WrappedChainWriter(cw clcommontypes.ChainWriter, client client.Client) clcommontypes.ChainWriter +} + +type EVMChainComponentsInterfaceTester[T TestingT[T]] struct { + Helper EVMChainComponentsInterfaceTesterHelper[T] + client client.Client + address string + address2 string + contractTesters map[string]*chain_reader_tester.ChainReaderTester + chainReaderConfig types.ChainReaderConfig + chainWriterConfig types.ChainWriterConfig + deployerAuth *bind.TransactOpts + senderAuth *bind.TransactOpts + cr evm.ChainReaderService + cw evm.ChainWriterService + dirtyContracts bool + txm evmtxmgr.TxManager + gasEstimator gas.EvmFeeEstimator +} + +func (it *EVMChainComponentsInterfaceTester[T]) Setup(t T) { + t.Cleanup(func() { + // DB may be closed by the test already, ignore errors + if it.cr != nil { + _ = it.cr.Close() + } + it.cr = nil + + if it.dirtyContracts { + it.contractTesters = nil + } + + if it.cw != nil { + _ = it.cw.Close() + } + it.cw = nil + }) + + // can re-use the same chain for tests, just make new contract for each test + if it.client != nil { + it.deployNewContracts(t) + return + } + + // Need to separate accounts to ensure the nonce doesn't get misaligned after the + // contract deployments. + accounts := it.Helper.Accounts(t) + it.deployerAuth = accounts[0] + it.senderAuth = accounts[1] + + testStruct := CreateTestStruct[T](0, it) + + methodTakingLatestParamsReturningTestStructConfig := types.ChainReaderDefinition{ + ChainSpecificName: "getElementAtIndex", + OutputModifications: codec.ModifiersConfig{ + &codec.RenameModifierConfig{Fields: map[string]string{"NestedDynamicStruct.Inner.IntVal": "I"}}, + &codec.RenameModifierConfig{Fields: map[string]string{"NestedStaticStruct.Inner.IntVal": "I"}}, + }, + } + + it.chainReaderConfig = types.ChainReaderConfig{ + Contracts: map[string]types.ChainContractReader{ + AnyContractName: { + ContractABI: chain_reader_tester.ChainReaderTesterMetaData.ABI, + ContractPollingFilter: types.ContractPollingFilter{ + GenericEventNames: []string{EventName, EventWithFilterName, triggerWithAllTopicsWithHashed}, + }, + Configs: map[string]*types.ChainReaderDefinition{ + MethodTakingLatestParamsReturningTestStruct: &methodTakingLatestParamsReturningTestStructConfig, + MethodReturningAlterableUint64: { + ChainSpecificName: "getAlterablePrimitiveValue", + }, + MethodReturningUint64: { + ChainSpecificName: "getPrimitiveValue", + }, + MethodReturningUint64Slice: { + ChainSpecificName: "getSliceValue", + }, + EventName: { + ChainSpecificName: "Triggered", + ReadType: types.Event, + EventDefinitions: &types.EventDefinitions{ + GenericTopicNames: map[string]string{"field": "Field"}, + GenericDataWordNames: map[string]string{ + "OracleID": "oracleId", + "NestedStaticStruct.Inner.IntVal": "nestedStaticStruct.Inner.IntVal", + "BigField": "bigField", + }, + }, + OutputModifications: codec.ModifiersConfig{ + &codec.RenameModifierConfig{Fields: map[string]string{"NestedDynamicStruct.Inner.IntVal": "I"}}, + &codec.RenameModifierConfig{Fields: map[string]string{"NestedStaticStruct.Inner.IntVal": "I"}}, + }, + }, + EventWithFilterName: { + ChainSpecificName: "Triggered", + ReadType: types.Event, + }, + triggerWithDynamicTopic: { + ChainSpecificName: triggerWithDynamicTopic, + ReadType: types.Event, + EventDefinitions: &types.EventDefinitions{ + // No specific reason for filter being defined here instead of on contract level, this is just for test case variety. + PollingFilter: &types.PollingFilter{}, + }, + InputModifications: codec.ModifiersConfig{ + &codec.RenameModifierConfig{Fields: map[string]string{"FieldHash": "Field"}}, + }, + }, + triggerWithAllTopics: { + ChainSpecificName: triggerWithAllTopics, + ReadType: types.Event, + EventDefinitions: &types.EventDefinitions{ + PollingFilter: &types.PollingFilter{}, + }, + // This doesn't have to be here, since the defalt mapping would work, but is left as an example. + // Keys which are string float values(confidence levels) are chain agnostic and should be reused across chains. + // These float values can map to different finality concepts across chains. + ConfidenceConfirmations: map[string]int{"0.0": int(evmtypes.Unconfirmed), "1.0": int(evmtypes.Finalized)}, + }, + triggerWithAllTopicsWithHashed: { + ChainSpecificName: triggerWithAllTopicsWithHashed, + ReadType: types.Event, + EventDefinitions: &types.EventDefinitions{}, + }, + MethodReturningSeenStruct: { + ChainSpecificName: "returnSeen", + InputModifications: codec.ModifiersConfig{ + &codec.HardCodeModifierConfig{ + OnChainValues: map[string]any{ + "BigField": testStruct.BigField.String(), + "Account": hexutil.Encode(testStruct.Account), + }, + }, + &codec.RenameModifierConfig{Fields: map[string]string{"NestedDynamicStruct.Inner.IntVal": "I"}}, + &codec.RenameModifierConfig{Fields: map[string]string{"NestedStaticStruct.Inner.IntVal": "I"}}, + }, + OutputModifications: codec.ModifiersConfig{ + &codec.HardCodeModifierConfig{OffChainValues: map[string]any{"ExtraField": AnyExtraValue}}, + &codec.RenameModifierConfig{Fields: map[string]string{"NestedDynamicStruct.Inner.IntVal": "I"}}, + &codec.RenameModifierConfig{Fields: map[string]string{"NestedStaticStruct.Inner.IntVal": "I"}}, + }, + }, + }, + }, + AnySecondContractName: { + ContractABI: chain_reader_tester.ChainReaderTesterMetaData.ABI, + Configs: map[string]*types.ChainReaderDefinition{ + MethodTakingLatestParamsReturningTestStruct: &methodTakingLatestParamsReturningTestStructConfig, + MethodReturningUint64: { + ChainSpecificName: "getDifferentPrimitiveValue", + }, + }, + }, + }, + } + it.GetContractReader(t) + it.txm = it.Helper.TXM(t, it.client) + + it.chainWriterConfig = types.ChainWriterConfig{ + Contracts: map[string]*types.ContractConfig{ + AnyContractName: { + ContractABI: chain_reader_tester.ChainReaderTesterMetaData.ABI, + Configs: map[string]*types.ChainWriterDefinition{ + "addTestStruct": { + ChainSpecificName: "addTestStruct", + FromAddress: it.Helper.Accounts(t)[1].From, + GasLimit: 2_000_000, + Checker: "simulate", + InputModifications: codec.ModifiersConfig{ + &codec.RenameModifierConfig{Fields: map[string]string{"NestedDynamicStruct.Inner.IntVal": "I"}}, + &codec.RenameModifierConfig{Fields: map[string]string{"NestedStaticStruct.Inner.IntVal": "I"}}, + }, + }, + "setAlterablePrimitiveValue": { + ChainSpecificName: "setAlterablePrimitiveValue", + FromAddress: it.Helper.Accounts(t)[1].From, + GasLimit: 2_000_000, + Checker: "simulate", + }, + "triggerEvent": { + ChainSpecificName: "triggerEvent", + FromAddress: it.Helper.Accounts(t)[1].From, + GasLimit: 2_000_000, + Checker: "simulate", + InputModifications: codec.ModifiersConfig{ + &codec.RenameModifierConfig{Fields: map[string]string{"NestedDynamicStruct.Inner.IntVal": "I"}}, + &codec.RenameModifierConfig{Fields: map[string]string{"NestedStaticStruct.Inner.IntVal": "I"}}, + }, + }, + "triggerEventWithDynamicTopic": { + ChainSpecificName: "triggerEventWithDynamicTopic", + FromAddress: it.Helper.Accounts(t)[1].From, + GasLimit: 2_000_000, + Checker: "simulate", + }, + "triggerWithFourTopics": { + ChainSpecificName: "triggerWithFourTopics", + FromAddress: it.Helper.Accounts(t)[1].From, + GasLimit: 2_000_000, + Checker: "simulate", + }, + "triggerWithFourTopicsWithHashed": { + ChainSpecificName: "triggerWithFourTopicsWithHashed", + FromAddress: it.Helper.Accounts(t)[1].From, + GasLimit: 2_000_000, + Checker: "simulate", + }, + }, + }, + AnySecondContractName: { + ContractABI: chain_reader_tester.ChainReaderTesterMetaData.ABI, + Configs: map[string]*types.ChainWriterDefinition{ + "addTestStruct": { + ChainSpecificName: "addTestStruct", + FromAddress: it.Helper.Accounts(t)[1].From, + GasLimit: 2_000_000, + Checker: "simulate", + InputModifications: codec.ModifiersConfig{ + &codec.RenameModifierConfig{Fields: map[string]string{"NestedDynamicStruct.Inner.IntVal": "I"}}, + &codec.RenameModifierConfig{Fields: map[string]string{"NestedStaticStruct.Inner.IntVal": "I"}}, + }, + }, + }, + }, + }, + MaxGasPrice: assets.NewWei(big.NewInt(1000000000000000000)), + } + it.deployNewContracts(t) +} + +func (it *EVMChainComponentsInterfaceTester[T]) Name() string { + return "EVM" +} + +func (it *EVMChainComponentsInterfaceTester[T]) GetAccountBytes(i int) []byte { + account := [20]byte{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10} + account[i%20] += byte(i) + account[(i+3)%20] += byte(i + 3) + return account[:] +} + +func (it *EVMChainComponentsInterfaceTester[T]) GetContractReader(t T) clcommontypes.ContractReader { + ctx := it.Helper.Context(t) + if it.cr != nil { + return it.cr + } + + lggr := logger.NullLogger + db := it.Helper.NewSqlxDB(t) + lpOpts := logpoller.Opts{ + PollPeriod: time.Millisecond, + FinalityDepth: finalityDepth, + BackfillBatchSize: 1, + RpcBatchSize: 1, + KeepFinalizedBlocksDepth: 10000, + } + ht := headtracker.NewSimulatedHeadTracker(it.Helper.Client(t), lpOpts.UseFinalityTag, lpOpts.FinalityDepth) + lp := logpoller.NewLogPoller(logpoller.NewORM(it.Helper.ChainID(), db, lggr), it.Helper.Client(t), lggr, ht, lpOpts) + require.NoError(t, lp.Start(ctx)) + + // encode and decode the config to ensure the test covers type issues + confBytes, err := json.Marshal(it.chainReaderConfig) + require.NoError(t, err) + + conf, err := types.ChainReaderConfigFromBytes(confBytes) + require.NoError(t, err) + + cwh := it.Helper.ChainReaderEVMClient(ctx, t, ht, conf) + it.client = cwh + + cr, err := evm.NewChainReaderService(ctx, lggr, lp, ht, it.client, conf) + require.NoError(t, err) + require.NoError(t, cr.Start(ctx)) + it.cr = cr + return cr +} + +// This function is no longer necessary for Simulated Backend or Testnet tests. +func (it *EVMChainComponentsInterfaceTester[T]) GenerateBlocksTillConfidenceLevel(t T, contractName, readName string, confidenceLevel primitives.ConfidenceLevel) { +} + +func (it *EVMChainComponentsInterfaceTester[T]) GetChainWriter(t T) clcommontypes.ChainWriter { + ctx := it.Helper.Context(t) + if it.cw != nil { + return it.cw + } + + cw, err := evm.NewChainWriterService(logger.NullLogger, it.client, it.txm, it.gasEstimator, it.chainWriterConfig) + require.NoError(t, err) + it.cw = it.Helper.WrappedChainWriter(cw, it.client) + + require.NoError(t, err) + require.NoError(t, cw.Start(ctx)) + return it.cw +} + +func (it *EVMChainComponentsInterfaceTester[T]) GetBindings(_ T) []clcommontypes.BoundContract { + return []clcommontypes.BoundContract{ + {Name: AnyContractName, Address: it.address}, + {Name: AnySecondContractName, Address: it.address2}, + } +} + +func (it *EVMChainComponentsInterfaceTester[T]) DirtyContracts() { + it.dirtyContracts = true +} + +func (it *EVMChainComponentsInterfaceTester[T]) GetAuthWithGasSet(t T) *bind.TransactOpts { + gasPrice, err := it.client.SuggestGasPrice(it.Helper.Context(t)) + require.NoError(t, err) + extra := new(big.Int).Mul(gasPrice, big.NewInt(it.Helper.GasPriceBufferPercent())) + extra = extra.Div(extra, big.NewInt(100)) + it.deployerAuth.GasPrice = gasPrice.Add(gasPrice, extra) + return it.deployerAuth +} + +func (it *EVMChainComponentsInterfaceTester[T]) IncNonce() { + if it.deployerAuth.Nonce == nil { + it.deployerAuth.Nonce = big.NewInt(1) + } else { + it.deployerAuth.Nonce = it.deployerAuth.Nonce.Add(it.deployerAuth.Nonce, big.NewInt(1)) + } +} + +func (it *EVMChainComponentsInterfaceTester[T]) AwaitTx(t T, tx *gethtypes.Transaction) { + ctx := it.Helper.Context(t) + receipt, err := bind.WaitMined(ctx, it.client, tx) + require.NoError(t, err) + require.Equal(t, gethtypes.ReceiptStatusSuccessful, receipt.Status) +} + +func (it *EVMChainComponentsInterfaceTester[T]) deployNewContracts(t T) { + // First test deploy both contracts, otherwise only deploy contracts if cleanup decides that we need to. + if it.address == "" || it.contractTesters == nil { + it.contractTesters = make(map[string]*chain_reader_tester.ChainReaderTester, 2) + address, ts1 := it.deployNewContract(t) + address2, ts2 := it.deployNewContract(t) + it.address, it.address2 = address, address2 + it.contractTesters[it.address] = ts1 + it.contractTesters[it.address2] = ts2 + it.dirtyContracts = false + } +} + +func (it *EVMChainComponentsInterfaceTester[T]) deployNewContract(t T) (string, *chain_reader_tester.ChainReaderTester) { + // 105528 was in the error: gas too low: have 0, want 105528 + // Not sure if there's a better way to get it. + it.deployerAuth.GasLimit = 10552800 + + address, tx, ts, err := chain_reader_tester.DeployChainReaderTester(it.GetAuthWithGasSet(t), it.Helper.Backend()) + require.NoError(t, err) + it.Helper.Commit() + + it.IncNonce() + it.AwaitTx(t, tx) + return address.String(), ts +} + +func (it *EVMChainComponentsInterfaceTester[T]) MaxWaitTimeForEvents() time.Duration { + return it.Helper.MaxWaitTimeForEvents() +} + +func OracleIDsToBytes(oracleIDs [32]commontypes.OracleID) [32]byte { + convertedIDs := [32]byte{} + for i, id := range oracleIDs { + convertedIDs[i] = byte(id) + } + return convertedIDs +} + +func ConvertAccounts(accounts [][]byte) []common.Address { + convertedAccounts := make([]common.Address, len(accounts)) + for i, a := range accounts { + convertedAccounts[i] = common.Address(a) + } + return convertedAccounts +} + +func ToInternalType(testStruct TestStruct) chain_reader_tester.TestStruct { + return chain_reader_tester.TestStruct{ + Field: *testStruct.Field, + DifferentField: testStruct.DifferentField, + OracleId: byte(testStruct.OracleID), + OracleIds: OracleIDsToBytes(testStruct.OracleIDs), + Account: common.Address(testStruct.Account), + Accounts: ConvertAccounts(testStruct.Accounts), + BigField: testStruct.BigField, + NestedDynamicStruct: MidDynamicToInternalType(testStruct.NestedDynamicStruct), + NestedStaticStruct: MidStaticToInternalType(testStruct.NestedStaticStruct), + } +} + +func MidDynamicToInternalType(m MidLevelDynamicTestStruct) chain_reader_tester.MidLevelDynamicTestStruct { + return chain_reader_tester.MidLevelDynamicTestStruct{ + FixedBytes: m.FixedBytes, + Inner: chain_reader_tester.InnerDynamicTestStruct{ + IntVal: int64(m.Inner.I), + S: m.Inner.S, + }, + } +} + +func MidStaticToInternalType(m MidLevelStaticTestStruct) chain_reader_tester.MidLevelStaticTestStruct { + return chain_reader_tester.MidLevelStaticTestStruct{ + FixedBytes: m.FixedBytes, + Inner: chain_reader_tester.InnerStaticTestStruct{ + IntVal: int64(m.Inner.I), + A: common.BytesToAddress(m.Inner.A), + }, + } +} diff --git a/core/services/relay/evm/evmtesting/chain_reader_interface_tester.go b/core/services/relay/evm/evmtesting/chain_reader_interface_tester.go deleted file mode 100644 index 92407809351..00000000000 --- a/core/services/relay/evm/evmtesting/chain_reader_interface_tester.go +++ /dev/null @@ -1,351 +0,0 @@ -package evmtesting - -import ( - "context" - "encoding/json" - "math/big" - "time" - - "github.com/ethereum/go-ethereum/accounts/abi/bind" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/jmoiron/sqlx" - "github.com/smartcontractkit/libocr/commontypes" - - "github.com/smartcontractkit/chainlink-common/pkg/codec" - clcommontypes "github.com/smartcontractkit/chainlink-common/pkg/types" - . "github.com/smartcontractkit/chainlink-common/pkg/types/interfacetests" //nolint common practice to import test mods with . - - "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" - "github.com/smartcontractkit/chainlink/v2/core/chains/evm/headtracker" - "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" - "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/chain_reader_tester" - _ "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/pgtest" // force binding for tx type - "github.com/smartcontractkit/chainlink/v2/core/logger" - "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm" - "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/types" - - evmtypes "github.com/ethereum/go-ethereum/core/types" - "github.com/stretchr/testify/require" -) - -const ( - triggerWithDynamicTopic = "TriggeredEventWithDynamicTopic" - triggerWithAllTopics = "TriggeredWithFourTopics" -) - -type EVMChainReaderInterfaceTesterHelper[T TestingT[T]] interface { - SetupAuth(t T) *bind.TransactOpts - Client(t T) client.Client - Commit() - Backend() bind.ContractBackend - ChainID() *big.Int - Context(t T) context.Context - NewSqlxDB(t T) *sqlx.DB - MaxWaitTimeForEvents() time.Duration - GasPriceBufferPercent() int64 -} - -type EVMChainReaderInterfaceTester[T TestingT[T]] struct { - Helper EVMChainReaderInterfaceTesterHelper[T] - client client.Client - address string - address2 string - chainConfig types.ChainReaderConfig - auth *bind.TransactOpts - evmTest *chain_reader_tester.ChainReaderTester - cr evm.ChainReaderService - dirtyContracts bool -} - -func (it *EVMChainReaderInterfaceTester[T]) Setup(t T) { - t.Cleanup(func() { - // DB may be closed by the test already, ignore errors - if it.cr != nil { - _ = it.cr.Close() - } - it.cr = nil - - if it.dirtyContracts { - it.evmTest = nil - } - }) - - // can re-use the same chain for tests, just make new contract for each test - if it.client != nil { - it.deployNewContracts(t) - return - } - - it.auth = it.Helper.SetupAuth(t) - - testStruct := CreateTestStruct[T](0, it) - - it.chainConfig = types.ChainReaderConfig{ - Contracts: map[string]types.ChainContractReader{ - AnyContractName: { - ContractABI: chain_reader_tester.ChainReaderTesterMetaData.ABI, - ContractPollingFilter: types.ContractPollingFilter{ - GenericEventNames: []string{EventName, EventWithFilterName}, - }, - Configs: map[string]*types.ChainReaderDefinition{ - MethodTakingLatestParamsReturningTestStruct: { - ChainSpecificName: "getElementAtIndex", - OutputModifications: codec.ModifiersConfig{ - &codec.RenameModifierConfig{Fields: map[string]string{"NestedStruct.Inner.IntVal": "I"}}, - }, - }, - MethodReturningUint64: { - ChainSpecificName: "getPrimitiveValue", - }, - DifferentMethodReturningUint64: { - ChainSpecificName: "getDifferentPrimitiveValue", - }, - MethodReturningUint64Slice: { - ChainSpecificName: "getSliceValue", - }, - EventName: { - ChainSpecificName: "Triggered", - ReadType: types.Event, - OutputModifications: codec.ModifiersConfig{ - &codec.RenameModifierConfig{Fields: map[string]string{"NestedStruct.Inner.IntVal": "I"}}, - }, - ConfidenceConfirmations: map[string]int{"0.0": 0, "1.0": -1}, - }, - EventWithFilterName: { - ChainSpecificName: "Triggered", - ReadType: types.Event, - EventDefinitions: &types.EventDefinitions{InputFields: []string{"Field"}}, - ConfidenceConfirmations: map[string]int{"0.0": 0, "1.0": -1}, - }, - triggerWithDynamicTopic: { - ChainSpecificName: triggerWithDynamicTopic, - ReadType: types.Event, - EventDefinitions: &types.EventDefinitions{ - InputFields: []string{"fieldHash"}, - // no specific reason for filter being defined here insted on contract level, - // this is just for test case variety - PollingFilter: &types.PollingFilter{}, - }, - InputModifications: codec.ModifiersConfig{ - &codec.RenameModifierConfig{Fields: map[string]string{"FieldHash": "Field"}}, - }, - ConfidenceConfirmations: map[string]int{"0.0": 0, "1.0": -1}, - }, - triggerWithAllTopics: { - ChainSpecificName: triggerWithAllTopics, - ReadType: types.Event, - EventDefinitions: &types.EventDefinitions{ - InputFields: []string{"Field1", "Field2", "Field3"}, - PollingFilter: &types.PollingFilter{}, - }, - ConfidenceConfirmations: map[string]int{"0.0": 0, "1.0": -1}, - }, - MethodReturningSeenStruct: { - ChainSpecificName: "returnSeen", - InputModifications: codec.ModifiersConfig{ - &codec.HardCodeModifierConfig{ - OnChainValues: map[string]any{ - "BigField": testStruct.BigField.String(), - "Account": hexutil.Encode(testStruct.Account), - }, - }, - &codec.RenameModifierConfig{Fields: map[string]string{"NestedStruct.Inner.IntVal": "I"}}, - }, - OutputModifications: codec.ModifiersConfig{ - &codec.HardCodeModifierConfig{OffChainValues: map[string]any{"ExtraField": AnyExtraValue}}, - &codec.RenameModifierConfig{Fields: map[string]string{"NestedStruct.Inner.IntVal": "I"}}, - }, - }, - }, - }, - AnySecondContractName: { - ContractABI: chain_reader_tester.ChainReaderTesterMetaData.ABI, - Configs: map[string]*types.ChainReaderDefinition{ - MethodReturningUint64: { - ChainSpecificName: "getDifferentPrimitiveValue", - }, - }, - }, - }, - } - it.client = it.Helper.Client(t) - - it.deployNewContracts(t) -} - -func (it *EVMChainReaderInterfaceTester[T]) Name() string { - return "EVM" -} - -func (it *EVMChainReaderInterfaceTester[T]) GetAccountBytes(i int) []byte { - account := [20]byte{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10} - account[i%20] += byte(i) - account[(i+3)%20] += byte(i + 3) - return account[:] -} - -func (it *EVMChainReaderInterfaceTester[T]) GetChainReader(t T) clcommontypes.ContractReader { - ctx := it.Helper.Context(t) - if it.cr != nil { - return it.cr - } - - lggr := logger.NullLogger - db := it.Helper.NewSqlxDB(t) - lpOpts := logpoller.Opts{ - PollPeriod: time.Millisecond, - FinalityDepth: 4, - BackfillBatchSize: 1, - RpcBatchSize: 1, - KeepFinalizedBlocksDepth: 10000, - } - ht := headtracker.NewSimulatedHeadTracker(it.client, lpOpts.UseFinalityTag, lpOpts.FinalityDepth) - lp := logpoller.NewLogPoller(logpoller.NewORM(it.Helper.ChainID(), db, lggr), it.client, lggr, ht, lpOpts) - require.NoError(t, lp.Start(ctx)) - - // encode and decode the config to ensure the test covers type issues - confBytes, err := json.Marshal(it.chainConfig) - require.NoError(t, err) - - conf, err := types.ChainReaderConfigFromBytes(confBytes) - require.NoError(t, err) - - cr, err := evm.NewChainReaderService(ctx, lggr, lp, it.client, conf) - require.NoError(t, err) - require.NoError(t, cr.Start(ctx)) - it.cr = cr - return cr -} - -func (it *EVMChainReaderInterfaceTester[T]) SetLatestValue(t T, testStruct *TestStruct) { - it.sendTxWithTestStruct(t, testStruct, (*chain_reader_tester.ChainReaderTesterTransactor).AddTestStruct) -} - -func (it *EVMChainReaderInterfaceTester[T]) TriggerEvent(t T, testStruct *TestStruct) { - it.sendTxWithTestStruct(t, testStruct, (*chain_reader_tester.ChainReaderTesterTransactor).TriggerEvent) -} - -func (it *EVMChainReaderInterfaceTester[T]) GetBindings(_ T) []clcommontypes.BoundContract { - return []clcommontypes.BoundContract{ - {Name: AnyContractName, Address: it.address, Pending: true}, - {Name: AnySecondContractName, Address: it.address2, Pending: true}, - } -} - -type testStructFn = func(*chain_reader_tester.ChainReaderTesterTransactor, *bind.TransactOpts, int32, string, uint8, [32]uint8, common.Address, []common.Address, *big.Int, chain_reader_tester.MidLevelTestStruct) (*evmtypes.Transaction, error) - -func (it *EVMChainReaderInterfaceTester[T]) sendTxWithTestStruct(t T, testStruct *TestStruct, fn testStructFn) { - tx, err := fn( - &it.evmTest.ChainReaderTesterTransactor, - it.GetAuthWithGasSet(t), - *testStruct.Field, - testStruct.DifferentField, - uint8(testStruct.OracleID), - OracleIdsToBytes(testStruct.OracleIDs), - common.Address(testStruct.Account), - ConvertAccounts(testStruct.Accounts), - testStruct.BigField, - MidToInternalType(testStruct.NestedStruct), - ) - require.NoError(t, err) - it.Helper.Commit() - it.IncNonce() - it.AwaitTx(t, tx) - it.dirtyContracts = true -} - -func (it *EVMChainReaderInterfaceTester[T]) GetAuthWithGasSet(t T) *bind.TransactOpts { - gasPrice, err := it.client.SuggestGasPrice(it.Helper.Context(t)) - require.NoError(t, err) - extra := new(big.Int).Mul(gasPrice, big.NewInt(it.Helper.GasPriceBufferPercent())) - extra = extra.Div(extra, big.NewInt(100)) - it.auth.GasPrice = gasPrice.Add(gasPrice, extra) - return it.auth -} - -func (it *EVMChainReaderInterfaceTester[T]) IncNonce() { - if it.auth.Nonce == nil { - it.auth.Nonce = big.NewInt(1) - } else { - it.auth.Nonce = it.auth.Nonce.Add(it.auth.Nonce, big.NewInt(1)) - } -} - -func (it *EVMChainReaderInterfaceTester[T]) AwaitTx(t T, tx *evmtypes.Transaction) { - ctx := it.Helper.Context(t) - receipt, err := bind.WaitMined(ctx, it.client, tx) - require.NoError(t, err) - require.Equal(t, evmtypes.ReceiptStatusSuccessful, receipt.Status) -} - -func (it *EVMChainReaderInterfaceTester[T]) deployNewContracts(t T) { - // First test deploy both contracts, otherwise only deploy contracts if cleanup decides that we need to. - if it.address == "" { - it.address = it.deployNewContract(t) - it.address2 = it.deployNewContract(t) - } else if it.evmTest == nil { - it.address = it.deployNewContract(t) - it.dirtyContracts = false - } -} - -func (it *EVMChainReaderInterfaceTester[T]) deployNewContract(t T) string { - // 105528 was in the error: gas too low: have 0, want 105528 - // Not sure if there's a better way to get it. - it.auth.GasLimit = 10552800 - - address, tx, ts, err := chain_reader_tester.DeployChainReaderTester(it.GetAuthWithGasSet(t), it.Helper.Backend()) - require.NoError(t, err) - it.Helper.Commit() - if it.evmTest == nil { - it.evmTest = ts - } - - it.IncNonce() - it.AwaitTx(t, tx) - return address.String() -} - -func (it *EVMChainReaderInterfaceTester[T]) MaxWaitTimeForEvents() time.Duration { - return it.Helper.MaxWaitTimeForEvents() -} - -func OracleIdsToBytes(oracleIDs [32]commontypes.OracleID) [32]byte { - convertedIds := [32]byte{} - for i, id := range oracleIDs { - convertedIds[i] = byte(id) - } - return convertedIds -} - -func ConvertAccounts(accounts [][]byte) []common.Address { - convertedAccounts := make([]common.Address, len(accounts)) - for i, a := range accounts { - convertedAccounts[i] = common.Address(a) - } - return convertedAccounts -} - -func ToInternalType(testStruct TestStruct) chain_reader_tester.TestStruct { - return chain_reader_tester.TestStruct{ - Field: *testStruct.Field, - DifferentField: testStruct.DifferentField, - OracleId: byte(testStruct.OracleID), - OracleIds: OracleIdsToBytes(testStruct.OracleIDs), - Account: common.Address(testStruct.Account), - Accounts: ConvertAccounts(testStruct.Accounts), - BigField: testStruct.BigField, - NestedStruct: MidToInternalType(testStruct.NestedStruct), - } -} - -func MidToInternalType(m MidLevelTestStruct) chain_reader_tester.MidLevelTestStruct { - return chain_reader_tester.MidLevelTestStruct{ - FixedBytes: m.FixedBytes, - Inner: chain_reader_tester.InnerTestStruct{ - IntVal: int64(m.Inner.I), - S: m.Inner.S, - }, - } -} diff --git a/core/services/relay/evm/evmtesting/run_tests.go b/core/services/relay/evm/evmtesting/run_tests.go index 28bda5a09a5..7e01cf2b657 100644 --- a/core/services/relay/evm/evmtesting/run_tests.go +++ b/core/services/relay/evm/evmtesting/run_tests.go @@ -10,39 +10,58 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "github.com/smartcontractkit/chainlink-common/pkg/types" clcommontypes "github.com/smartcontractkit/chainlink-common/pkg/types" + "github.com/smartcontractkit/chainlink-common/pkg/types/query" + "github.com/smartcontractkit/chainlink-common/pkg/types/query/primitives" + "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" + "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/read" . "github.com/smartcontractkit/chainlink-common/pkg/types/interfacetests" //nolint common practice to import test mods with . - - "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm" ) -func RunChainReaderEvmTests[T TestingT[T]](t T, it *EVMChainReaderInterfaceTester[T]) { - RunChainReaderInterfaceTests[T](t, it) +func RunChainComponentsEvmTests[T TestingT[T]](t T, it *EVMChainComponentsInterfaceTester[T]) { + RunContractReaderEvmTests[T](t, it) + // Add ChainWriter tests here +} + +func RunChainComponentsInLoopEvmTests[T TestingT[T]](t T, it ChainComponentsInterfaceTester[T]) { + RunContractReaderInLoopTests[T](t, it) + // Add ChainWriter tests here +} + +func RunContractReaderEvmTests[T TestingT[T]](t T, it *EVMChainComponentsInterfaceTester[T]) { + RunContractReaderInterfaceTests[T](t, it, false) t.Run("Dynamically typed topics can be used to filter and have type correct in return", func(t T) { it.Setup(t) anyString := "foo" - it.dirtyContracts = true - tx, err := it.evmTest.ChainReaderTesterTransactor.TriggerEventWithDynamicTopic(it.GetAuthWithGasSet(t), anyString) - require.NoError(t, err) - it.Helper.Commit() - it.IncNonce() - it.AwaitTx(t, tx) ctx := it.Helper.Context(t) - cr := it.GetChainReader(t) - require.NoError(t, cr.Bind(ctx, it.GetBindings(t))) + cr := it.GetContractReader(t) + bindings := it.GetBindings(t) + require.NoError(t, cr.Bind(ctx, bindings)) + + type DynamicEvent struct { + Field string + } + SubmitTransactionToCW(t, it, "triggerEventWithDynamicTopic", DynamicEvent{Field: anyString}, bindings[0], types.Unconfirmed) input := struct{ Field string }{Field: anyString} tp := cr.(clcommontypes.ContractTypeProvider) - output, err := tp.CreateContractType(AnyContractName, triggerWithDynamicTopic, false) + + readName := types.BoundContract{ + Address: bindings[0].Address, + Name: AnyContractName, + }.ReadIdentifier(triggerWithDynamicTopic) + + output, err := tp.CreateContractType(readName, false) require.NoError(t, err) rOutput := reflect.Indirect(reflect.ValueOf(output)) require.Eventually(t, func() bool { - return cr.GetLatestValue(ctx, AnyContractName, triggerWithDynamicTopic, input, output) == nil + return cr.GetLatestValue(ctx, readName, primitives.Unconfirmed, input, output) == nil }, it.MaxWaitTimeForEvents(), 100*time.Millisecond) assert.Equal(t, &anyString, rOutput.FieldByName("Field").Interface()) @@ -53,44 +72,173 @@ func RunChainReaderEvmTests[T TestingT[T]](t T, it *EVMChainReaderInterfaceTeste t.Run("Multiple topics can filter together", func(t T) { it.Setup(t) - it.dirtyContracts = true + ctx := it.Helper.Context(t) + cr := it.GetContractReader(t) + bindings := it.GetBindings(t) + + require.NoError(t, cr.Bind(ctx, bindings)) + triggerFourTopics(t, it, int32(1), int32(2), int32(3)) triggerFourTopics(t, it, int32(2), int32(2), int32(3)) triggerFourTopics(t, it, int32(1), int32(3), int32(3)) triggerFourTopics(t, it, int32(1), int32(2), int32(4)) - ctx := it.Helper.Context(t) - cr := it.GetChainReader(t) - require.NoError(t, cr.Bind(ctx, it.GetBindings(t))) + var bound types.BoundContract + for idx := range bindings { + if bindings[idx].Name == AnyContractName { + bound = bindings[idx] + } + } + var latest struct{ Field1, Field2, Field3 int32 } params := struct{ Field1, Field2, Field3 int32 }{Field1: 1, Field2: 2, Field3: 3} time.Sleep(it.MaxWaitTimeForEvents()) - require.NoError(t, cr.GetLatestValue(ctx, AnyContractName, triggerWithAllTopics, params, &latest)) + require.NoError(t, cr.GetLatestValue(ctx, bound.ReadIdentifier(triggerWithAllTopics), primitives.Unconfirmed, params, &latest)) assert.Equal(t, int32(1), latest.Field1) assert.Equal(t, int32(2), latest.Field2) assert.Equal(t, int32(3), latest.Field3) }) + t.Run("Filtering can be done on indexed topics that get hashed", func(t T) { + it.Setup(t) + + cr := it.GetContractReader(t) + ctx := it.Helper.Context(t) + bindings := it.GetBindings(t) + + require.NoError(t, cr.Bind(ctx, bindings)) + + triggerFourTopicsWithHashed(t, it, "1", [32]uint8{2}, [32]byte{5}) + triggerFourTopicsWithHashed(t, it, "2", [32]uint8{2}, [32]byte{3}) + triggerFourTopicsWithHashed(t, it, "1", [32]uint8{3}, [32]byte{3}) + + var bound types.BoundContract + for idx := range bindings { + if bindings[idx].Name == AnyContractName { + bound = bindings[idx] + } + } + + var latest struct { + Field3 [32]byte + } + params := struct { + Field1 string + Field2 [32]uint8 + Field3 [32]byte + }{Field1: "1", Field2: [32]uint8{2}, Field3: [32]byte{5}} + + time.Sleep(it.MaxWaitTimeForEvents()) + require.NoError(t, cr.GetLatestValue(ctx, bound.ReadIdentifier(triggerWithAllTopicsWithHashed), primitives.Unconfirmed, params, &latest)) + // only checking Field3 topic makes sense since it isn't hashed, to check other fields we'd have to replicate solidity encoding and hashing + assert.Equal(t, [32]uint8{5}, latest.Field3) + }) + t.Run("Bind returns error on missing contract at address", func(t T) { it.Setup(t) addr := common.BigToAddress(big.NewInt(42)) - reader := it.GetChainReader(t) + reader := it.GetContractReader(t) ctx := it.Helper.Context(t) - err := reader.Bind(ctx, []clcommontypes.BoundContract{{Name: AnyContractName, Address: addr.Hex(), Pending: true}}) + err := reader.Bind(ctx, []clcommontypes.BoundContract{{Name: AnyContractName, Address: addr.Hex()}}) - require.ErrorIs(t, err, evm.NoContractExistsError{Address: addr}) + require.ErrorIs(t, err, read.NoContractExistsError{Address: addr}) }) } -func triggerFourTopics[T TestingT[T]](t T, it *EVMChainReaderInterfaceTester[T], i1, i2, i3 int32) { - tx, err := it.evmTest.ChainReaderTesterTransactor.TriggerWithFourTopics(it.GetAuthWithGasSet(t), i1, i2, i3) - require.NoError(t, err) - require.NoError(t, err) - it.Helper.Commit() - it.IncNonce() - it.AwaitTx(t, tx) +func RunContractReaderInLoopTests[T TestingT[T]](t T, it ChainComponentsInterfaceTester[T]) { + RunContractReaderInterfaceTests[T](t, it, false) + + it.Setup(t) + ctx := tests.Context(t) + cr := it.GetContractReader(t) + require.NoError(t, cr.Bind(ctx, it.GetBindings(t))) + bindings := it.GetBindings(t) + boundContract := BindingsByName(bindings, AnyContractName)[0] + require.NoError(t, cr.Bind(ctx, bindings)) + + ts1 := CreateTestStruct[T](0, it) + _ = SubmitTransactionToCW(t, it, MethodTriggeringEvent, ts1, boundContract, types.Unconfirmed) + ts2 := CreateTestStruct[T](15, it) + _ = SubmitTransactionToCW(t, it, MethodTriggeringEvent, ts2, boundContract, types.Unconfirmed) + ts3 := CreateTestStruct[T](35, it) + _ = SubmitTransactionToCW(t, it, MethodTriggeringEvent, ts3, boundContract, types.Unconfirmed) + + t.Run("Filtering can be done on data words using value comparator", func(t T) { + ts := &TestStruct{} + assert.Eventually(t, func() bool { + sequences, err := cr.QueryKey(ctx, boundContract, query.KeyFilter{Key: EventName, Expressions: []query.Expression{ + query.Comparator("OracleID", + primitives.ValueComparator{ + Value: uint8(ts2.OracleID), + Operator: primitives.Eq, + }), + }, + }, query.LimitAndSort{}, ts) + return err == nil && len(sequences) == 1 && reflect.DeepEqual(&ts2, sequences[0].Data) + }, it.MaxWaitTimeForEvents(), time.Millisecond*10) + }) + + t.Run("Filtering can be done on data words using value comparator on a nested field", func(t T) { + ts := &TestStruct{} + assert.Eventually(t, func() bool { + sequences, err := cr.QueryKey(ctx, boundContract, query.KeyFilter{Key: EventName, Expressions: []query.Expression{ + query.Comparator("OracleID", + primitives.ValueComparator{ + Value: uint8(ts2.OracleID), + Operator: primitives.Eq, + }), + query.Comparator("NestedStaticStruct.Inner.IntVal", + primitives.ValueComparator{ + Value: ts2.NestedStaticStruct.Inner.I, + Operator: primitives.Eq, + }), + }, + }, query.LimitAndSort{}, ts) + return err == nil && len(sequences) == 1 && reflect.DeepEqual(&ts2, sequences[0].Data) + }, it.MaxWaitTimeForEvents(), time.Millisecond*10) + }) + + t.Run("Filtering can be done on data words using value comparator on field that follows a dynamic field", func(t T) { + ts := &TestStruct{} + assert.Eventually(t, func() bool { + sequences, err := cr.QueryKey(ctx, boundContract, query.KeyFilter{Key: EventName, Expressions: []query.Expression{ + query.Comparator("OracleID", + primitives.ValueComparator{ + Value: uint8(ts2.OracleID), + Operator: primitives.Eq, + }), + query.Comparator("BigField", + primitives.ValueComparator{ + Value: ts2.BigField, + Operator: primitives.Eq, + }), + }, + }, query.LimitAndSort{}, ts) + return err == nil && len(sequences) == 1 && reflect.DeepEqual(&ts2, sequences[0].Data) + }, it.MaxWaitTimeForEvents(), time.Millisecond*10) + }) +} + +func triggerFourTopics[T TestingT[T]](t T, it *EVMChainComponentsInterfaceTester[T], i1, i2, i3 int32) { + type DynamicEvent struct { + Field1 int32 + Field2 int32 + Field3 int32 + } + contracts := it.GetBindings(t) + SubmitTransactionToCW(t, it, "triggerWithFourTopics", DynamicEvent{Field1: i1, Field2: i2, Field3: i3}, contracts[0], types.Unconfirmed) +} + +func triggerFourTopicsWithHashed[T TestingT[T]](t T, it *EVMChainComponentsInterfaceTester[T], i1 string, i2 [32]uint8, i3 [32]byte) { + type DynamicEvent struct { + Field1 string + Field2 [32]uint8 + Field3 [32]byte + } + contracts := it.GetBindings(t) + SubmitTransactionToCW(t, it, "triggerWithFourTopicsWithHashed", DynamicEvent{Field1: i1, Field2: i2, Field3: i3}, contracts[0], types.Unconfirmed) } diff --git a/core/services/relay/evm/exec_provider.go b/core/services/relay/evm/exec_provider.go new file mode 100644 index 00000000000..e0a9b378f27 --- /dev/null +++ b/core/services/relay/evm/exec_provider.go @@ -0,0 +1,391 @@ +package evm + +import ( + "context" + "fmt" + "math/big" + "net/url" + "time" + + "go.uber.org/multierr" + + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" + + "github.com/smartcontractkit/chainlink-common/pkg/logger" + "github.com/smartcontractkit/chainlink-common/pkg/types" + commontypes "github.com/smartcontractkit/chainlink-common/pkg/types" + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/gas" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/txmgr" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/router" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/tokendata/usdc" +) + +type SrcExecProvider struct { + lggr logger.Logger + versionFinder ccip.VersionFinder + client client.Client + lp logpoller.LogPoller + startBlock uint64 + estimator gas.EvmFeeEstimator + maxGasPrice *big.Int + usdcReader *ccip.USDCReaderImpl + usdcAttestationAPI string + usdcAttestationAPITimeoutSeconds int + usdcAttestationAPIIntervalMilliseconds int + usdcSrcMsgTransmitterAddr common.Address + + // these values are nil and are updated for Close() + seenOnRampAddress *cciptypes.Address + seenSourceChainSelector *uint64 + seenDestChainSelector *uint64 +} + +func NewSrcExecProvider( + lggr logger.Logger, + versionFinder ccip.VersionFinder, + client client.Client, + estimator gas.EvmFeeEstimator, + maxGasPrice *big.Int, + lp logpoller.LogPoller, + startBlock uint64, + jobID string, + usdcAttestationAPI string, + usdcAttestationAPITimeoutSeconds int, + usdcAttestationAPIIntervalMilliseconds int, + usdcSrcMsgTransmitterAddr common.Address, +) (commontypes.CCIPExecProvider, error) { + var usdcReader *ccip.USDCReaderImpl + var err error + if usdcAttestationAPI != "" { + usdcReader, err = ccip.NewUSDCReader(lggr, jobID, usdcSrcMsgTransmitterAddr, lp, true) + if err != nil { + return nil, fmt.Errorf("new usdc reader: %w", err) + } + } + + return &SrcExecProvider{ + lggr: lggr, + versionFinder: versionFinder, + client: client, + estimator: estimator, + maxGasPrice: maxGasPrice, + lp: lp, + startBlock: startBlock, + usdcReader: usdcReader, + usdcAttestationAPI: usdcAttestationAPI, + usdcAttestationAPITimeoutSeconds: usdcAttestationAPITimeoutSeconds, + usdcAttestationAPIIntervalMilliseconds: usdcAttestationAPIIntervalMilliseconds, + usdcSrcMsgTransmitterAddr: usdcSrcMsgTransmitterAddr, + }, nil +} + +func (s *SrcExecProvider) Name() string { + return "CCIP.SrcExecProvider" +} + +func (s *SrcExecProvider) Start(ctx context.Context) error { + if s.startBlock != 0 { + s.lggr.Infow("start replaying src chain", "fromBlock", s.startBlock) + return s.lp.Replay(ctx, int64(s.startBlock)) + } + return nil +} + +// Close is called when the job that created this provider is closed. +func (s *SrcExecProvider) Close() error { + versionFinder := ccip.NewEvmVersionFinder() + + unregisterFuncs := make([]func() error, 0, 2) + unregisterFuncs = append(unregisterFuncs, func() error { + // avoid panic in the case NewOnRampReader wasn't called + if s.seenOnRampAddress == nil { + return nil + } + return ccip.CloseOnRampReader(s.lggr, versionFinder, *s.seenSourceChainSelector, *s.seenDestChainSelector, *s.seenOnRampAddress, s.lp, s.client) + }) + unregisterFuncs = append(unregisterFuncs, func() error { + if s.usdcAttestationAPI == "" { + return nil + } + return ccip.CloseUSDCReader(s.lggr, s.lggr.Name(), s.usdcSrcMsgTransmitterAddr, s.lp) + }) + var multiErr error + for _, fn := range unregisterFuncs { + if err := fn(); err != nil { + multiErr = multierr.Append(multiErr, err) + } + } + return multiErr +} + +func (s *SrcExecProvider) Ready() error { + return nil +} + +func (s *SrcExecProvider) HealthReport() map[string]error { + return make(map[string]error) +} + +func (s *SrcExecProvider) OffchainConfigDigester() ocrtypes.OffchainConfigDigester { + // TODO CCIP-2494 + // OffchainConfigDigester called on SrcExecProvider. It should only be called on DstExecProvider + return UnimplementedOffchainConfigDigester{} +} + +func (s *SrcExecProvider) ContractConfigTracker() ocrtypes.ContractConfigTracker { + // TODO CCIP-2494 + // "ContractConfigTracker called on SrcExecProvider. It should only be called on DstExecProvider + return UnimplementedContractConfigTracker{} +} + +func (s *SrcExecProvider) ContractTransmitter() ocrtypes.ContractTransmitter { + // TODO CCIP-2494 + // "ContractTransmitter called on SrcExecProvider. It should only be called on DstExecProvider + return UnimplementedContractTransmitter{} +} + +func (s *SrcExecProvider) ContractReader() commontypes.ContractReader { + return nil +} + +func (s *SrcExecProvider) Codec() commontypes.Codec { + return nil +} + +func (s *SrcExecProvider) GetTransactionStatus(ctx context.Context, transactionID string) (types.TransactionStatus, error) { + return 0, fmt.Errorf("invalid: GetTransactionStatus called on SrcExecProvider. It should only be called on DstExecProvider") +} + +func (s *SrcExecProvider) NewCommitStoreReader(ctx context.Context, addr cciptypes.Address) (commitStoreReader cciptypes.CommitStoreReader, err error) { + commitStoreReader = NewIncompleteSourceCommitStoreReader(s.estimator, s.maxGasPrice) + return +} + +func (s *SrcExecProvider) NewOffRampReader(ctx context.Context, addr cciptypes.Address) (cciptypes.OffRampReader, error) { + return nil, fmt.Errorf("invalid: NewOffRampReader called on SrcExecProvider. Valid on DstExecProvider") +} + +func (s *SrcExecProvider) NewOnRampReader(ctx context.Context, onRampAddress cciptypes.Address, sourceChainSelector uint64, destChainSelector uint64) (onRampReader cciptypes.OnRampReader, err error) { + s.seenOnRampAddress = &onRampAddress + + versionFinder := ccip.NewEvmVersionFinder() + onRampReader, err = ccip.NewOnRampReader(s.lggr, versionFinder, sourceChainSelector, destChainSelector, onRampAddress, s.lp, s.client) + return +} + +func (s *SrcExecProvider) NewPriceRegistryReader(ctx context.Context, addr cciptypes.Address) (priceRegistryReader cciptypes.PriceRegistryReader, err error) { + srcPriceRegistry := ccip.NewEvmPriceRegistry(s.lp, s.client, s.lggr, ccip.ExecPluginLabel) + priceRegistryReader, err = srcPriceRegistry.NewPriceRegistryReader(ctx, addr) + return +} + +func (s *SrcExecProvider) NewTokenDataReader(ctx context.Context, tokenAddress cciptypes.Address) (tokenDataReader cciptypes.TokenDataReader, err error) { + attestationURI, err2 := url.ParseRequestURI(s.usdcAttestationAPI) + if err2 != nil { + return nil, fmt.Errorf("failed to parse USDC attestation API: %w", err2) + } + tokenAddr, err2 := ccip.GenericAddrToEvm(tokenAddress) + if err2 != nil { + return nil, fmt.Errorf("failed to parse token address: %w", err2) + } + tokenDataReader = usdc.NewUSDCTokenDataReader( + s.lggr, + s.usdcReader, + attestationURI, + s.usdcAttestationAPITimeoutSeconds, + tokenAddr, + time.Duration(s.usdcAttestationAPIIntervalMilliseconds)*time.Millisecond, + ) + return +} + +func (s *SrcExecProvider) NewTokenPoolBatchedReader(ctx context.Context, offRampAddr cciptypes.Address, sourceChainSelector uint64) (cciptypes.TokenPoolBatchedReader, error) { + return nil, fmt.Errorf("invalid: NewTokenPoolBatchedReader called on SrcExecProvider. It should only be called on DstExecProvdier") +} + +func (s *SrcExecProvider) SourceNativeToken(ctx context.Context, sourceRouterAddr cciptypes.Address) (cciptypes.Address, error) { + sourceRouterAddrHex, err := ccip.GenericAddrToEvm(sourceRouterAddr) + if err != nil { + return "", err + } + sourceRouter, err := router.NewRouter(sourceRouterAddrHex, s.client) + if err != nil { + return "", err + } + sourceNative, err := sourceRouter.GetWrappedNative(&bind.CallOpts{Context: ctx}) + if err != nil { + return "", err + } + + return ccip.EvmAddrToGeneric(sourceNative), nil +} + +type DstExecProvider struct { + lggr logger.Logger + versionFinder ccip.VersionFinder + client client.Client + lp logpoller.LogPoller + startBlock uint64 + contractTransmitter *contractTransmitter + configWatcher *configWatcher + gasEstimator gas.EvmFeeEstimator + maxGasPrice big.Int + txm txmgr.TxManager + offRampAddress cciptypes.Address + + // these values are nil and are updated for Close() + seenCommitStoreAddr *cciptypes.Address +} + +func NewDstExecProvider( + lggr logger.Logger, + versionFinder ccip.VersionFinder, + client client.Client, + lp logpoller.LogPoller, + startBlock uint64, + contractTransmitter *contractTransmitter, + configWatcher *configWatcher, + gasEstimator gas.EvmFeeEstimator, + maxGasPrice big.Int, + txm txmgr.TxManager, + offRampAddress cciptypes.Address, +) (commontypes.CCIPExecProvider, error) { + return &DstExecProvider{ + lggr: lggr, + versionFinder: versionFinder, + client: client, + lp: lp, + startBlock: startBlock, + contractTransmitter: contractTransmitter, + configWatcher: configWatcher, + gasEstimator: gasEstimator, + maxGasPrice: maxGasPrice, + txm: txm, + offRampAddress: offRampAddress, + }, nil +} + +func (d *DstExecProvider) Name() string { + return "CCIP.DestRelayerExecProvider" +} + +func (d *DstExecProvider) Start(ctx context.Context) error { + if d.startBlock != 0 { + d.lggr.Infow("start replaying dst chain", "fromBlock", d.startBlock) + return d.lp.Replay(ctx, int64(d.startBlock)) + } + return nil +} + +// Close is called when the job that created this provider is deleted +// At this time, any of the methods on the provider may or may not have been called. +// If NewOnRampReader and NewCommitStoreReader have not been called, their corresponding +// Close methods will be expected to error. +func (d *DstExecProvider) Close() error { + versionFinder := ccip.NewEvmVersionFinder() + + unregisterFuncs := make([]func() error, 0, 2) + unregisterFuncs = append(unregisterFuncs, func() error { + if d.seenCommitStoreAddr == nil { + return nil + } + return ccip.CloseCommitStoreReader(d.lggr, versionFinder, *d.seenCommitStoreAddr, d.client, d.lp) + }) + unregisterFuncs = append(unregisterFuncs, func() error { + return ccip.CloseOffRampReader(d.lggr, versionFinder, d.offRampAddress, d.client, d.lp, nil, big.NewInt(0)) + }) + + var multiErr error + for _, fn := range unregisterFuncs { + if err := fn(); err != nil { + multiErr = multierr.Append(multiErr, err) + } + } + return multiErr +} + +func (d *DstExecProvider) Ready() error { + return nil +} + +func (d *DstExecProvider) HealthReport() map[string]error { + return make(map[string]error) +} + +func (d *DstExecProvider) OffchainConfigDigester() ocrtypes.OffchainConfigDigester { + return d.configWatcher.OffchainConfigDigester() +} + +func (d *DstExecProvider) ContractConfigTracker() ocrtypes.ContractConfigTracker { + return d.configWatcher.ContractConfigTracker() +} + +func (d *DstExecProvider) ContractTransmitter() ocrtypes.ContractTransmitter { + return d.contractTransmitter +} + +func (d *DstExecProvider) ContractReader() commontypes.ContractReader { + return nil +} + +func (d *DstExecProvider) Codec() commontypes.Codec { + return nil +} + +func (d *DstExecProvider) GetTransactionStatus(ctx context.Context, transactionID string) (types.TransactionStatus, error) { + return d.txm.GetTransactionStatus(ctx, transactionID) +} + +func (d *DstExecProvider) NewCommitStoreReader(ctx context.Context, addr cciptypes.Address) (commitStoreReader cciptypes.CommitStoreReader, err error) { + d.seenCommitStoreAddr = &addr + + versionFinder := ccip.NewEvmVersionFinder() + commitStoreReader, err = NewIncompleteDestCommitStoreReader(d.lggr, versionFinder, addr, d.client, d.lp) + return +} + +func (d *DstExecProvider) NewOffRampReader(ctx context.Context, offRampAddress cciptypes.Address) (offRampReader cciptypes.OffRampReader, err error) { + offRampReader, err = ccip.NewOffRampReader(d.lggr, d.versionFinder, offRampAddress, d.client, d.lp, d.gasEstimator, &d.maxGasPrice, true) + return +} + +func (d *DstExecProvider) NewOnRampReader(ctx context.Context, addr cciptypes.Address, sourceChainSelector uint64, destChainSelector uint64) (cciptypes.OnRampReader, error) { + return nil, fmt.Errorf("invalid: NewOnRampReader called on DstExecProvider. It should only be called on SrcExecProvider") +} + +func (d *DstExecProvider) NewPriceRegistryReader(ctx context.Context, addr cciptypes.Address) (priceRegistryReader cciptypes.PriceRegistryReader, err error) { + destPriceRegistry := ccip.NewEvmPriceRegistry(d.lp, d.client, d.lggr, ccip.ExecPluginLabel) + priceRegistryReader, err = destPriceRegistry.NewPriceRegistryReader(ctx, addr) + return +} + +func (d *DstExecProvider) NewTokenDataReader(ctx context.Context, tokenAddress cciptypes.Address) (cciptypes.TokenDataReader, error) { + return nil, fmt.Errorf("invalid: NewTokenDataReader called on DstExecProvider. It should only be called on SrcExecProvider") +} + +func (d *DstExecProvider) NewTokenPoolBatchedReader(ctx context.Context, offRampAddress cciptypes.Address, sourceChainSelector uint64) (tokenPoolBatchedReader cciptypes.TokenPoolBatchedReader, err error) { + batchCaller := ccip.NewDynamicLimitedBatchCaller( + d.lggr, + d.client, + uint(ccip.DefaultRpcBatchSizeLimit), + uint(ccip.DefaultRpcBatchBackOffMultiplier), + uint(ccip.DefaultMaxParallelRpcCalls), + ) + + tokenPoolBatchedReader, err = ccip.NewEVMTokenPoolBatchedReader(d.lggr, sourceChainSelector, offRampAddress, batchCaller) + if err != nil { + return nil, fmt.Errorf("new token pool batched reader: %w", err) + } + return +} + +func (d *DstExecProvider) SourceNativeToken(ctx context.Context, addr cciptypes.Address) (cciptypes.Address, error) { + return "", fmt.Errorf("invalid: SourceNativeToken called on DstExecProvider. It should only be called on SrcExecProvider") +} diff --git a/core/services/relay/evm/functions.go b/core/services/relay/evm/functions.go index a04a991e379..98928241fde 100644 --- a/core/services/relay/evm/functions.go +++ b/core/services/relay/evm/functions.go @@ -8,17 +8,15 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/pkg/errors" - "go.uber.org/multierr" - ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" + "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink-common/pkg/services" commontypes "github.com/smartcontractkit/chainlink-common/pkg/types" txmgrcommon "github.com/smartcontractkit/chainlink/v2/common/txmgr" txm "github.com/smartcontractkit/chainlink/v2/core/chains/evm/txmgr" "github.com/smartcontractkit/chainlink/v2/core/chains/legacyevm" - "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/keystore" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/functions/config" functionsRelay "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/functions" @@ -26,12 +24,29 @@ import ( ) type functionsProvider struct { - services.StateMachine + services.Service + eng *services.Engine + configWatcher *configWatcher contractTransmitter ContractTransmitter logPollerWrapper evmRelayTypes.LogPollerWrapper } +func newFunctionsProvider(lggr logger.Logger, cw *configWatcher, ct ContractTransmitter, lpw evmRelayTypes.LogPollerWrapper) *functionsProvider { + p := &functionsProvider{ + configWatcher: cw, + contractTransmitter: ct, + logPollerWrapper: lpw, + } + p.Service, p.eng = services.Config{ + Name: "FunctionsProvider", + NewSubServices: func(lggr logger.Logger) []services.Service { + return []services.Service{p.configWatcher, p.logPollerWrapper} + }, + }.NewServiceEngine(lggr) + return p +} + var _ evmRelayTypes.FunctionsProvider = (*functionsProvider)(nil) func (p *functionsProvider) ContractTransmitter() ocrtypes.ContractTransmitter { @@ -47,23 +62,6 @@ func (p *functionsProvider) FunctionsEvents() commontypes.FunctionsEvents { return nil } -func (p *functionsProvider) Start(ctx context.Context) error { - return p.StartOnce("FunctionsProvider", func() error { - if err := p.configWatcher.Start(ctx); err != nil { - return err - } - return p.logPollerWrapper.Start(ctx) - }) -} - -func (p *functionsProvider) Close() error { - return p.StopOnce("FunctionsProvider", func() (err error) { - err = multierr.Combine(err, p.logPollerWrapper.Close()) - err = multierr.Combine(err, p.configWatcher.Close()) - return - }) -} - // Forward all calls to the underlying configWatcher func (p *functionsProvider) OffchainConfigDigester() ocrtypes.OffchainConfigDigester { return p.configWatcher.OffchainConfigDigester() @@ -73,15 +71,7 @@ func (p *functionsProvider) ContractConfigTracker() ocrtypes.ContractConfigTrack return p.configWatcher.ContractConfigTracker() } -func (p *functionsProvider) HealthReport() map[string]error { - return p.configWatcher.HealthReport() -} - -func (p *functionsProvider) Name() string { - return p.configWatcher.Name() -} - -func (p *functionsProvider) ChainReader() commontypes.ContractReader { +func (p *functionsProvider) ContractReader() commontypes.ContractReader { return nil } @@ -127,11 +117,7 @@ func NewFunctionsProvider(ctx context.Context, chain legacyevm.Chain, rargs comm } else { lggr.Warn("no sending keys configured for functions plugin, not starting contract transmitter") } - return &functionsProvider{ - configWatcher: configWatcher, - contractTransmitter: contractTransmitter, - logPollerWrapper: logPollerWrapper, - }, nil + return newFunctionsProvider(lggr, configWatcher, contractTransmitter, logPollerWrapper), nil } func newFunctionsConfigProvider(ctx context.Context, pluginType functionsRelay.FunctionsPluginType, chain legacyevm.Chain, args commontypes.RelayArgs, fromBlock uint64, logPollerWrapper evmRelayTypes.LogPollerWrapper, lggr logger.Logger) (*configWatcher, error) { diff --git a/core/services/relay/evm/functions/config_poller.go b/core/services/relay/evm/functions/config_poller.go index 71616f2e840..2cb21738b91 100644 --- a/core/services/relay/evm/functions/config_poller.go +++ b/core/services/relay/evm/functions/config_poller.go @@ -9,12 +9,13 @@ import ( "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/common" "github.com/pkg/errors" - "github.com/smartcontractkit/libocr/gethwrappers2/ocr2aggregator" + "github.com/smartcontractkit/libocr/gethwrappers2/ocr2aggregator" ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2/types" + "github.com/smartcontractkit/chainlink-common/pkg/logger" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" - "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/types" ) diff --git a/core/services/relay/evm/functions/contract_transmitter.go b/core/services/relay/evm/functions/contract_transmitter.go index 23143ed3ef1..f588a02390c 100644 --- a/core/services/relay/evm/functions/contract_transmitter.go +++ b/core/services/relay/evm/functions/contract_transmitter.go @@ -13,14 +13,16 @@ import ( "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/common" "github.com/pkg/errors" + "github.com/smartcontractkit/libocr/offchainreporting2plus/chains/evmutil" ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" + "github.com/smartcontractkit/chainlink-common/pkg/logger" + "github.com/smartcontractkit/chainlink/v2/common/txmgr/types" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/txmgr" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils" - "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/functions/encoding" evmRelayTypes "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/types" @@ -105,7 +107,7 @@ func NewFunctionsContractTransmitter( transmittedEventSig: transmitted.ID, lp: lp, contractReader: caller, - lggr: lggr.Named("OCRFunctionsContractTransmitter"), + lggr: logger.Named(lggr, "OCRFunctionsContractTransmitter"), contractVersion: contractVersion, reportCodec: codec, txm: txm, diff --git a/core/services/relay/evm/functions/logpoller_wrapper.go b/core/services/relay/evm/functions/logpoller_wrapper.go index 559b1ec33f5..260c366eb8e 100644 --- a/core/services/relay/evm/functions/logpoller_wrapper.go +++ b/core/services/relay/evm/functions/logpoller_wrapper.go @@ -10,19 +10,20 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/pkg/errors" + "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink-common/pkg/services" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/functions/generated/functions_coordinator" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/functions/generated/functions_router" - "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/functions/config" evmRelayTypes "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/types" ) type logPollerWrapper struct { - services.StateMachine + services.Service + eng *services.Engine routerContract *functions_router.FunctionsRouter pluginConfig config.PluginConfig @@ -38,9 +39,6 @@ type logPollerWrapper struct { detectedRequests detectedEvents detectedResponses detectedEvents mu sync.Mutex - closeWait sync.WaitGroup - stopCh services.StopChan - lggr logger.Logger } type detectedEvent struct { @@ -94,7 +92,7 @@ func NewLogPollerWrapper(routerContractAddress common.Address, pluginConfig conf return nil, errors.Errorf("invalid config: number of required confirmation blocks >= pastBlocksToPoll") } - return &logPollerWrapper{ + w := &logPollerWrapper{ routerContract: routerContract, pluginConfig: pluginConfig, requestBlockOffset: requestBlockOffset, @@ -106,40 +104,25 @@ func NewLogPollerWrapper(routerContractAddress common.Address, pluginConfig conf logPoller: logPoller, client: client, subscribers: make(map[string]evmRelayTypes.RouteUpdateSubscriber), - stopCh: make(services.StopChan), - lggr: lggr.Named("LogPollerWrapper"), - }, nil -} - -func (l *logPollerWrapper) Start(context.Context) error { - return l.StartOnce("LogPollerWrapper", func() error { - l.lggr.Infow("starting LogPollerWrapper", "routerContract", l.routerContract.Address().Hex(), "contractVersion", l.pluginConfig.ContractVersion) - l.mu.Lock() - defer l.mu.Unlock() - if l.pluginConfig.ContractVersion != 1 { - return errors.New("only contract version 1 is supported") - } - l.closeWait.Add(1) - go l.checkForRouteUpdates() - return nil - }) -} - -func (l *logPollerWrapper) Close() error { - return l.StopOnce("LogPollerWrapper", func() (err error) { - l.lggr.Info("closing LogPollerWrapper") - close(l.stopCh) - l.closeWait.Wait() - return nil - }) + } + w.Service, w.eng = services.Config{ + Name: "LoggPollerWrapper", + Start: w.start, + }.NewServiceEngine(lggr) + return w, nil } -func (l *logPollerWrapper) HealthReport() map[string]error { - return map[string]error{l.Name(): l.Ready()} +func (l *logPollerWrapper) start(context.Context) error { + l.eng.Infow("starting LogPollerWrapper", "routerContract", l.routerContract.Address().Hex(), "contractVersion", l.pluginConfig.ContractVersion) + l.mu.Lock() + defer l.mu.Unlock() + if l.pluginConfig.ContractVersion != 1 { + return errors.New("only contract version 1 is supported") + } + l.eng.Go(l.checkForRouteUpdates) + return nil } -func (l *logPollerWrapper) Name() string { return l.lggr.Name() } - // methods of LogPollerWrapper func (l *logPollerWrapper) LatestEvents(ctx context.Context) ([]evmRelayTypes.OracleRequest, []evmRelayTypes.OracleResponse, error) { l.mu.Lock() @@ -166,7 +149,7 @@ func (l *logPollerWrapper) LatestEvents(ctx context.Context) ([]evmRelayTypes.Or resultsReq := []evmRelayTypes.OracleRequest{} resultsResp := []evmRelayTypes.OracleResponse{} if len(coordinators) == 0 { - l.lggr.Debug("LatestEvents: no non-zero coordinators to check") + l.eng.Debug("LatestEvents: no non-zero coordinators to check") return resultsReq, resultsResp, errors.New("no non-zero coordinators to check") } @@ -174,32 +157,32 @@ func (l *logPollerWrapper) LatestEvents(ctx context.Context) ([]evmRelayTypes.Or requestEndBlock := latestBlockNum - l.requestBlockOffset requestLogs, err := l.logPoller.Logs(ctx, startBlockNum, requestEndBlock, functions_coordinator.FunctionsCoordinatorOracleRequest{}.Topic(), coordinator) if err != nil { - l.lggr.Errorw("LatestEvents: fetching request logs from LogPoller failed", "startBlock", startBlockNum, "endBlock", requestEndBlock) + l.eng.Errorw("LatestEvents: fetching request logs from LogPoller failed", "startBlock", startBlockNum, "endBlock", requestEndBlock) return nil, nil, err } - l.lggr.Debugw("LatestEvents: fetched request logs", "nRequestLogs", len(requestLogs), "latestBlock", latest, "startBlock", startBlockNum, "endBlock", requestEndBlock) + l.eng.Debugw("LatestEvents: fetched request logs", "nRequestLogs", len(requestLogs), "latestBlock", latest, "startBlock", startBlockNum, "endBlock", requestEndBlock) requestLogs = l.filterPreviouslyDetectedEvents(requestLogs, &l.detectedRequests, "requests") responseEndBlock := latestBlockNum - l.responseBlockOffset responseLogs, err := l.logPoller.Logs(ctx, startBlockNum, responseEndBlock, functions_coordinator.FunctionsCoordinatorOracleResponse{}.Topic(), coordinator) if err != nil { - l.lggr.Errorw("LatestEvents: fetching response logs from LogPoller failed", "startBlock", startBlockNum, "endBlock", responseEndBlock) + l.eng.Errorw("LatestEvents: fetching response logs from LogPoller failed", "startBlock", startBlockNum, "endBlock", responseEndBlock) return nil, nil, err } - l.lggr.Debugw("LatestEvents: fetched request logs", "nResponseLogs", len(responseLogs), "latestBlock", latest, "startBlock", startBlockNum, "endBlock", responseEndBlock) + l.eng.Debugw("LatestEvents: fetched request logs", "nResponseLogs", len(responseLogs), "latestBlock", latest, "startBlock", startBlockNum, "endBlock", responseEndBlock) responseLogs = l.filterPreviouslyDetectedEvents(responseLogs, &l.detectedResponses, "responses") parsingContract, err := functions_coordinator.NewFunctionsCoordinator(coordinator, l.client) if err != nil { - l.lggr.Error("LatestEvents: creating a contract instance for parsing failed") + l.eng.Error("LatestEvents: creating a contract instance for parsing failed") return nil, nil, err } - l.lggr.Debugw("LatestEvents: parsing logs", "nRequestLogs", len(requestLogs), "nResponseLogs", len(responseLogs), "coordinatorAddress", coordinator.Hex()) + l.eng.Debugw("LatestEvents: parsing logs", "nRequestLogs", len(requestLogs), "nResponseLogs", len(responseLogs), "coordinatorAddress", coordinator.Hex()) for _, log := range requestLogs { gethLog := log.ToGethLog() oracleRequest, err := parsingContract.ParseOracleRequest(gethLog) if err != nil { - l.lggr.Errorw("LatestEvents: failed to parse a request log, skipping", "err", err) + l.eng.Errorw("LatestEvents: failed to parse a request log, skipping", "err", err) continue } @@ -212,7 +195,7 @@ func (l *logPollerWrapper) LatestEvents(ctx context.Context) ([]evmRelayTypes.Or bytes32Type, errType7 := abi.NewType("bytes32", "bytes32", nil) if errType1 != nil || errType2 != nil || errType3 != nil || errType4 != nil || errType5 != nil || errType6 != nil || errType7 != nil { - l.lggr.Errorw("LatestEvents: failed to initialize types", "errType1", errType1, + l.eng.Errorw("LatestEvents: failed to initialize types", "errType1", errType1, "errType2", errType2, "errType3", errType3, "errType4", errType4, "errType5", errType5, "errType6", errType6, "errType7", errType7, ) continue @@ -244,7 +227,7 @@ func (l *logPollerWrapper) LatestEvents(ctx context.Context) ([]evmRelayTypes.Or oracleRequest.Commitment.TimeoutTimestamp, ) if err != nil { - l.lggr.Errorw("LatestEvents: failed to pack commitment bytes, skipping", "err", err) + l.eng.Errorw("LatestEvents: failed to pack commitment bytes, skipping", "err", err) } resultsReq = append(resultsReq, evmRelayTypes.OracleRequest{ @@ -266,7 +249,7 @@ func (l *logPollerWrapper) LatestEvents(ctx context.Context) ([]evmRelayTypes.Or gethLog := log.ToGethLog() oracleResponse, err := parsingContract.ParseOracleResponse(gethLog) if err != nil { - l.lggr.Errorw("LatestEvents: failed to parse a response log, skipping") + l.eng.Errorw("LatestEvents: failed to parse a response log, skipping") continue } resultsResp = append(resultsResp, evmRelayTypes.OracleResponse{ @@ -275,13 +258,13 @@ func (l *logPollerWrapper) LatestEvents(ctx context.Context) ([]evmRelayTypes.Or } } - l.lggr.Debugw("LatestEvents: done", "nRequestLogs", len(resultsReq), "nResponseLogs", len(resultsResp), "startBlock", startBlockNum, "endBlock", latestBlockNum) + l.eng.Debugw("LatestEvents: done", "nRequestLogs", len(resultsReq), "nResponseLogs", len(resultsResp), "startBlock", startBlockNum, "endBlock", latestBlockNum) return resultsReq, resultsResp, nil } func (l *logPollerWrapper) filterPreviouslyDetectedEvents(logs []logpoller.Log, detectedEvents *detectedEvents, filterType string) []logpoller.Log { if len(logs) > maxLogsToProcess { - l.lggr.Errorw("filterPreviouslyDetectedEvents: too many logs to process, only processing latest maxLogsToProcess logs", "filterType", filterType, "nLogs", len(logs), "maxLogsToProcess", maxLogsToProcess) + l.eng.Errorw("filterPreviouslyDetectedEvents: too many logs to process, only processing latest maxLogsToProcess logs", "filterType", filterType, "nLogs", len(logs), "maxLogsToProcess", maxLogsToProcess) logs = logs[len(logs)-maxLogsToProcess:] } l.mu.Lock() @@ -290,7 +273,7 @@ func (l *logPollerWrapper) filterPreviouslyDetectedEvents(logs []logpoller.Log, for _, log := range logs { var requestId [32]byte if len(log.Topics) < 2 || len(log.Topics[1]) != 32 { - l.lggr.Errorw("filterPreviouslyDetectedEvents: invalid log, skipping", "filterType", filterType, "log", log) + l.eng.Errorw("filterPreviouslyDetectedEvents: invalid log, skipping", "filterType", filterType, "log", log) continue } copy(requestId[:], log.Topics[1]) // requestId is the second topic (1st topic is the event signature) @@ -310,7 +293,7 @@ func (l *logPollerWrapper) filterPreviouslyDetectedEvents(logs []logpoller.Log, expiredRequests++ } detectedEvents.detectedEventsOrdered = detectedEvents.detectedEventsOrdered[expiredRequests:] - l.lggr.Debugw("filterPreviouslyDetectedEvents: done", "filterType", filterType, "nLogs", len(logs), "nFilteredLogs", len(filteredLogs), "nExpiredRequests", expiredRequests, "previouslyDetectedCacheSize", len(detectedEvents.detectedEventsOrdered)) + l.eng.Debugw("filterPreviouslyDetectedEvents: done", "filterType", filterType, "nLogs", len(logs), "nFilteredLogs", len(filteredLogs), "nExpiredRequests", expiredRequests, "previouslyDetectedCacheSize", len(detectedEvents.detectedEventsOrdered)) return filteredLogs } @@ -319,7 +302,7 @@ func (l *logPollerWrapper) SubscribeToUpdates(ctx context.Context, subscriberNam if l.pluginConfig.ContractVersion == 0 { // in V0, immediately set contract address to Oracle contract and never update again if err := subscriber.UpdateRoutes(ctx, l.routerContract.Address(), l.routerContract.Address()); err != nil { - l.lggr.Errorw("LogPollerWrapper: Failed to update routes", "subscriberName", subscriberName, "err", err) + l.eng.Errorw("LogPollerWrapper: Failed to update routes", "subscriberName", subscriberName, "err", err) } } else if l.pluginConfig.ContractVersion == 1 { l.mu.Lock() @@ -328,37 +311,36 @@ func (l *logPollerWrapper) SubscribeToUpdates(ctx context.Context, subscriberNam } } -func (l *logPollerWrapper) checkForRouteUpdates() { - defer l.closeWait.Done() +func (l *logPollerWrapper) checkForRouteUpdates(ctx context.Context) { freqSec := l.pluginConfig.ContractUpdateCheckFrequencySec if freqSec == 0 { - l.lggr.Errorw("LogPollerWrapper: ContractUpdateCheckFrequencySec is zero - route update checks disabled") + l.eng.Errorw("LogPollerWrapper: ContractUpdateCheckFrequencySec is zero - route update checks disabled") return } - updateOnce := func() { + updateOnce := func(ctx context.Context) { // NOTE: timeout == frequency here, could be changed to a separate config value timeout := time.Duration(l.pluginConfig.ContractUpdateCheckFrequencySec) * time.Second - ctx, cancel := l.stopCh.CtxCancel(context.WithTimeout(context.Background(), timeout)) + ctx, cancel := context.WithTimeout(ctx, timeout) defer cancel() active, proposed, err := l.getCurrentCoordinators(ctx) if err != nil { - l.lggr.Errorw("LogPollerWrapper: error calling getCurrentCoordinators", "err", err) + l.eng.Errorw("LogPollerWrapper: error calling getCurrentCoordinators", "err", err) return } l.handleRouteUpdate(ctx, active, proposed) } - updateOnce() // update once right away + updateOnce(ctx) // update once right away ticker := time.NewTicker(time.Duration(freqSec) * time.Second) defer ticker.Stop() for { select { - case <-l.stopCh: + case <-ctx.Done(): return case <-ticker.C: - updateOnce() + updateOnce(ctx) } } } @@ -394,22 +376,22 @@ func (l *logPollerWrapper) handleRouteUpdate(ctx context.Context, activeCoordina defer l.mu.Unlock() if activeCoordinator == (common.Address{}) { - l.lggr.Error("LogPollerWrapper: cannot update activeCoordinator to zero address") + l.eng.Error("LogPollerWrapper: cannot update activeCoordinator to zero address") return } if activeCoordinator == l.activeCoordinator && proposedCoordinator == l.proposedCoordinator { - l.lggr.Debug("LogPollerWrapper: no changes to routes") + l.eng.Debug("LogPollerWrapper: no changes to routes") return } errActive := l.registerFilters(ctx, activeCoordinator) errProposed := l.registerFilters(ctx, proposedCoordinator) if errActive != nil || errProposed != nil { - l.lggr.Errorw("LogPollerWrapper: Failed to register filters", "errorActive", errActive, "errorProposed", errProposed) + l.eng.Errorw("LogPollerWrapper: Failed to register filters", "errorActive", errActive, "errorProposed", errProposed) return } - l.lggr.Debugw("LogPollerWrapper: new routes", "activeCoordinator", activeCoordinator.Hex(), "proposedCoordinator", proposedCoordinator.Hex()) + l.eng.Debugw("LogPollerWrapper: new routes", "activeCoordinator", activeCoordinator.Hex(), "proposedCoordinator", proposedCoordinator.Hex()) l.activeCoordinator = activeCoordinator l.proposedCoordinator = proposedCoordinator @@ -417,7 +399,7 @@ func (l *logPollerWrapper) handleRouteUpdate(ctx context.Context, activeCoordina for _, subscriber := range l.subscribers { err := subscriber.UpdateRoutes(ctx, activeCoordinator, proposedCoordinator) if err != nil { - l.lggr.Errorw("LogPollerWrapper: Failed to update routes", "err", err) + l.eng.Errorw("LogPollerWrapper: Failed to update routes", "err", err) } } @@ -430,9 +412,9 @@ func (l *logPollerWrapper) handleRouteUpdate(ctx context.Context, activeCoordina continue } if err := l.logPoller.UnregisterFilter(ctx, filter.Name); err != nil { - l.lggr.Errorw("LogPollerWrapper: Failed to unregister filter", "filterName", filter.Name, "err", err) + l.eng.Errorw("LogPollerWrapper: Failed to unregister filter", "filterName", filter.Name, "err", err) } - l.lggr.Debugw("LogPollerWrapper: Successfully unregistered filter", "filterName", filter.Name) + l.eng.Debugw("LogPollerWrapper: Successfully unregistered filter", "filterName", filter.Name) } } diff --git a/core/services/relay/evm/llo_config_provider.go b/core/services/relay/evm/llo_config_provider.go index 6efd0ccada2..0fe98d1cf71 100644 --- a/core/services/relay/evm/llo_config_provider.go +++ b/core/services/relay/evm/llo_config_provider.go @@ -2,22 +2,54 @@ package evm import ( "context" + "fmt" + "math/big" "github.com/ethereum/go-ethereum/common" - pkgerrors "github.com/pkg/errors" + "github.com/pkg/errors" + + ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" + + "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink/v2/core/chains/legacyevm" - "github.com/smartcontractkit/chainlink/v2/core/logger" - "github.com/smartcontractkit/chainlink/v2/core/services/llo" + "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury" "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/types" ) +func DonIDToBytes32(donID uint32) [32]byte { + var b [32]byte + copy(b[:], common.LeftPadBytes(big.NewInt(int64(donID)).Bytes(), 32)) + return b +} + func newLLOConfigProvider(ctx context.Context, lggr logger.Logger, chain legacyevm.Chain, opts *types.RelayOpts) (*configWatcher, error) { if !common.IsHexAddress(opts.ContractID) { - return nil, pkgerrors.Errorf("invalid contractID, expected hex address") + return nil, errors.New("invalid contractID, expected hex address") + } + + configuratorAddress := common.HexToAddress(opts.ContractID) + + relayConfig, err := opts.RelayConfig() + if err != nil { + return nil, fmt.Errorf("failed to get relay config: %w", err) + } + if relayConfig.LLODONID == 0 { + return nil, errors.New("donID must be specified in relayConfig for LLO jobs") + } + donIDPadded := DonIDToBytes32(relayConfig.LLODONID) + cp, err := mercury.NewConfigPoller( + ctx, + logger.Named(lggr, fmt.Sprintf("LLO-%d", relayConfig.LLODONID)), + chain.LogPoller(), + configuratorAddress, + donIDPadded, + // TODO: Does LLO need to support config contract? MERC-1827 + ) + if err != nil { + return nil, err } - aggregatorAddress := common.HexToAddress(opts.ContractID) - configDigester := llo.NewOffchainConfigDigester(chain.Config().EVM().ChainID(), aggregatorAddress) - return newContractConfigProvider(ctx, lggr, chain, opts, aggregatorAddress, ChannelVerifierLogDecoder, configDigester) + configDigester := mercury.NewOffchainConfigDigester(donIDPadded, chain.Config().EVM().ChainID(), configuratorAddress, ocrtypes.ConfigDigestPrefixLLO) + return newConfigWatcher(lggr, configuratorAddress, configDigester, cp, chain, relayConfig.FromBlock, opts.New), nil } diff --git a/core/services/relay/evm/llo_provider.go b/core/services/relay/evm/llo_provider.go index b685565e6e0..2cf6163047f 100644 --- a/core/services/relay/evm/llo_provider.go +++ b/core/services/relay/evm/llo_provider.go @@ -6,20 +6,23 @@ import ( ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" + "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink-common/pkg/services" commontypes "github.com/smartcontractkit/chainlink-common/pkg/types" relaytypes "github.com/smartcontractkit/chainlink-common/pkg/types" llotypes "github.com/smartcontractkit/chainlink-common/pkg/types/llo" - - "github.com/smartcontractkit/chainlink/v2/core/logger" - "github.com/smartcontractkit/chainlink/v2/core/services/llo" ) var _ commontypes.LLOProvider = (*lloProvider)(nil) +type LLOTransmitter interface { + services.Service + llotypes.Transmitter +} + type lloProvider struct { cp commontypes.ConfigProvider - transmitter llo.Transmitter + transmitter LLOTransmitter logger logger.Logger channelDefinitionCache llotypes.ChannelDefinitionCache @@ -28,14 +31,14 @@ type lloProvider struct { func NewLLOProvider( cp commontypes.ConfigProvider, - transmitter llo.Transmitter, + transmitter LLOTransmitter, lggr logger.Logger, channelDefinitionCache llotypes.ChannelDefinitionCache, ) relaytypes.LLOProvider { return &lloProvider{ cp, transmitter, - lggr.Named("LLOProvider"), + logger.Named(lggr, "LLOProvider"), channelDefinitionCache, services.MultiStart{}, } @@ -74,10 +77,6 @@ func (p *lloProvider) OffchainConfigDigester() ocrtypes.OffchainConfigDigester { return p.cp.OffchainConfigDigester() } -func (p *lloProvider) OnchainConfigCodec() llo.OnchainConfigCodec { - return &llo.JSONOnchainConfigCodec{} -} - func (p *lloProvider) ContractTransmitter() llotypes.Transmitter { return p.transmitter } diff --git a/core/services/relay/evm/llo_verifier_decoder.go b/core/services/relay/evm/llo_verifier_decoder.go deleted file mode 100644 index 922b83bec0d..00000000000 --- a/core/services/relay/evm/llo_verifier_decoder.go +++ /dev/null @@ -1,67 +0,0 @@ -package evm - -import ( - "fmt" - - "github.com/ethereum/go-ethereum/accounts/abi" - "github.com/ethereum/go-ethereum/common" - "github.com/pkg/errors" - - ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" - - "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/llo-feeds/generated/channel_verifier" -) - -var _ LogDecoder = &channelVerifierLogDecoder{} - -type channelVerifierLogDecoder struct { - eventName string - eventSig common.Hash - abi *abi.ABI -} - -func newChannelVerifierLogDecoder() (*channelVerifierLogDecoder, error) { - const eventName = "ConfigSet" - abi, err := channel_verifier.ChannelVerifierMetaData.GetAbi() - if err != nil { - return nil, err - } - return &channelVerifierLogDecoder{ - eventName: eventName, - eventSig: abi.Events[eventName].ID, - abi: abi, - }, nil -} - -func (d *channelVerifierLogDecoder) Decode(rawLog []byte) (ocrtypes.ContractConfig, error) { - unpacked := new(channel_verifier.ChannelVerifierConfigSet) - err := d.abi.UnpackIntoInterface(unpacked, d.eventName, rawLog) - if err != nil { - return ocrtypes.ContractConfig{}, errors.Wrap(err, "failed to unpack log data") - } - - var transmitAccounts []ocrtypes.Account - for _, addr := range unpacked.OffchainTransmitters { - transmitAccounts = append(transmitAccounts, ocrtypes.Account(fmt.Sprintf("%x", addr))) - } - var signers []ocrtypes.OnchainPublicKey - for _, addr := range unpacked.Signers { - addr := addr - signers = append(signers, addr[:]) - } - - return ocrtypes.ContractConfig{ - ConfigDigest: unpacked.ConfigDigest, - ConfigCount: unpacked.ConfigCount, - Signers: signers, - Transmitters: transmitAccounts, - F: unpacked.F, - OnchainConfig: unpacked.OnchainConfig, - OffchainConfigVersion: unpacked.OffchainConfigVersion, - OffchainConfig: unpacked.OffchainConfig, - }, nil -} - -func (d *channelVerifierLogDecoder) EventSig() common.Hash { - return d.eventSig -} diff --git a/core/services/relay/evm/loop_impl.go b/core/services/relay/evm/loop_impl.go index 7f9d405847d..aec956cd0d2 100644 --- a/core/services/relay/evm/loop_impl.go +++ b/core/services/relay/evm/loop_impl.go @@ -2,12 +2,11 @@ package evm import ( "github.com/smartcontractkit/chainlink-common/pkg/loop" - relay "github.com/smartcontractkit/chainlink-common/pkg/loop/adapters/relay" + "github.com/smartcontractkit/chainlink-common/pkg/loop/adapters/relay" "github.com/smartcontractkit/chainlink/v2/core/chains/legacyevm" ) -//go:generate mockery --quiet --name LoopRelayAdapter --output ./mocks/ --case=underscore type LoopRelayAdapter interface { loop.Relayer Chain() legacyevm.Chain diff --git a/core/services/relay/evm/median.go b/core/services/relay/evm/median.go index 2407cff7140..60a63994bdc 100644 --- a/core/services/relay/evm/median.go +++ b/core/services/relay/evm/median.go @@ -8,16 +8,17 @@ import ( "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/pkg/errors" + "github.com/smartcontractkit/libocr/gethwrappers2/ocr2aggregator" "github.com/smartcontractkit/libocr/offchainreporting2/reportingplugin/median" "github.com/smartcontractkit/libocr/offchainreporting2plus/types" ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" + "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink-common/pkg/services" "github.com/smartcontractkit/chainlink-common/pkg/sqlutil" "github.com/smartcontractkit/chainlink/v2/core/chains/legacyevm" offchain_aggregator_wrapper "github.com/smartcontractkit/chainlink/v2/core/internal/gethwrappers2/generated/offchainaggregator" - "github.com/smartcontractkit/chainlink/v2/core/logger" ) var _ median.MedianContract = &medianContract{} @@ -31,7 +32,7 @@ type medianContract struct { } func newMedianContract(configTracker types.ContractConfigTracker, contractAddress common.Address, chain legacyevm.Chain, specID int32, ds sqlutil.DataSource, lggr logger.Logger) (*medianContract, error) { - lggr = lggr.Named("MedianContract") + lggr = logger.Named(lggr, "MedianContract") contract, err := offchain_aggregator_wrapper.NewOffchainAggregator(contractAddress, chain.Client()) if err != nil { return nil, errors.Wrap(err, "could not instantiate NewOffchainAggregator") diff --git a/core/services/relay/evm/median_test.go b/core/services/relay/evm/median_test.go index 9c474006aa7..a1578737b68 100644 --- a/core/services/relay/evm/median_test.go +++ b/core/services/relay/evm/median_test.go @@ -7,23 +7,23 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "github.com/smartcontractkit/chainlink-common/pkg/logger" commontypes "github.com/smartcontractkit/chainlink-common/pkg/types" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils/big" "github.com/smartcontractkit/chainlink/v2/core/chains/legacyevm/mocks" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" - "github.com/smartcontractkit/chainlink/v2/core/logger" evmtypes "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/types" ) func TestNewMedianProvider(t *testing.T) { - lggr := logger.TestLogger(t) + lggr := logger.Test(t) chain := mocks.NewChain(t) chainID := testutils.NewRandomEVMChainID() chain.On("ID").Return(chainID) contractID := testutils.NewAddress() - relayer := Relayer{lggr: lggr, chain: chain} + relayer := Relayer{lggr: logger.Sugared(lggr), chain: chain} pargs := commontypes.PluginArgs{} diff --git a/core/services/relay/evm/mercury/config_digest.go b/core/services/relay/evm/mercury/config_digest.go index 291a723ee3a..c7a6076c886 100644 --- a/core/services/relay/evm/mercury/config_digest.go +++ b/core/services/relay/evm/mercury/config_digest.go @@ -37,6 +37,7 @@ func configDigest( onchainConfig []byte, offchainConfigVersion uint64, offchainConfig []byte, + prefix types.ConfigDigestPrefix, ) types.ConfigDigest { msg, err := configDigestArgs.Pack( feedID, @@ -60,10 +61,6 @@ func configDigest( // assertion panic("copy too little data") } - binary.BigEndian.PutUint16(configDigest[:2], uint16(types.ConfigDigestPrefixMercuryV02)) - if !(configDigest[0] == 0 && configDigest[1] == 6) { - // assertion - panic("unexpected mismatch") - } + binary.BigEndian.PutUint16(configDigest[:2], uint16(prefix)) return configDigest } diff --git a/core/services/relay/evm/mercury/config_digest_test.go b/core/services/relay/evm/mercury/config_digest_test.go index fe718e92fe5..680513688a4 100644 --- a/core/services/relay/evm/mercury/config_digest_test.go +++ b/core/services/relay/evm/mercury/config_digest_test.go @@ -15,6 +15,7 @@ import ( "github.com/leanovate/gopter" "github.com/leanovate/gopter/gen" "github.com/leanovate/gopter/prop" + ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" "github.com/smartcontractkit/wsrpc/credentials" "github.com/stretchr/testify/require" @@ -63,6 +64,7 @@ func TestConfigCalculationMatches(t *testing.T) { onchainConfig, offchainConfigVersion, offchainConfig, + ocrtypes.ConfigDigestPrefixMercuryV02, ) bigChainID := new(big.Int) diff --git a/core/services/relay/evm/mercury/config_poller.go b/core/services/relay/evm/mercury/config_poller.go index 2da541a8e42..7bb5d2af7b5 100644 --- a/core/services/relay/evm/mercury/config_poller.go +++ b/core/services/relay/evm/mercury/config_poller.go @@ -11,9 +11,10 @@ import ( "github.com/pkg/errors" ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" + "github.com/smartcontractkit/chainlink-common/pkg/logger" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/llo-feeds/generated/verifier" - "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury/utils" ) @@ -53,7 +54,7 @@ func unpackLogData(d []byte) (*verifier.VerifierConfigSet, error) { return unpacked, nil } -func configFromLog(logData []byte) (FullConfigFromLog, error) { +func ConfigFromLog(logData []byte) (FullConfigFromLog, error) { unpacked, err := unpackLogData(logData) if err != nil { return FullConfigFromLog{}, err @@ -139,7 +140,7 @@ func (cp *ConfigPoller) LatestConfigDetails(ctx context.Context) (changedInBlock return 0, ocrtypes.ConfigDigest{}, nil } latest := logs[len(logs)-1] - latestConfigSet, err := configFromLog(latest.Data) + latestConfigSet, err := ConfigFromLog(latest.Data) if err != nil { return 0, ocrtypes.ConfigDigest{}, err } @@ -155,7 +156,7 @@ func (cp *ConfigPoller) LatestConfig(ctx context.Context, changedInBlock uint64) if len(lgs) == 0 { return ocrtypes.ContractConfig{}, nil } - latestConfigSet, err := configFromLog(lgs[len(lgs)-1].Data) + latestConfigSet, err := ConfigFromLog(lgs[len(lgs)-1].Data) if err != nil { return ocrtypes.ContractConfig{}, err } diff --git a/core/services/relay/evm/mercury/mocks/async_deleter.go b/core/services/relay/evm/mercury/mocks/async_deleter.go index 181b9080fd5..c4a64bbb56c 100644 --- a/core/services/relay/evm/mercury/mocks/async_deleter.go +++ b/core/services/relay/evm/mercury/mocks/async_deleter.go @@ -12,11 +12,47 @@ type AsyncDeleter struct { mock.Mock } +type AsyncDeleter_Expecter struct { + mock *mock.Mock +} + +func (_m *AsyncDeleter) EXPECT() *AsyncDeleter_Expecter { + return &AsyncDeleter_Expecter{mock: &_m.Mock} +} + // AsyncDelete provides a mock function with given fields: req func (_m *AsyncDeleter) AsyncDelete(req *pb.TransmitRequest) { _m.Called(req) } +// AsyncDeleter_AsyncDelete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AsyncDelete' +type AsyncDeleter_AsyncDelete_Call struct { + *mock.Call +} + +// AsyncDelete is a helper method to define mock.On call +// - req *pb.TransmitRequest +func (_e *AsyncDeleter_Expecter) AsyncDelete(req interface{}) *AsyncDeleter_AsyncDelete_Call { + return &AsyncDeleter_AsyncDelete_Call{Call: _e.mock.On("AsyncDelete", req)} +} + +func (_c *AsyncDeleter_AsyncDelete_Call) Run(run func(req *pb.TransmitRequest)) *AsyncDeleter_AsyncDelete_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*pb.TransmitRequest)) + }) + return _c +} + +func (_c *AsyncDeleter_AsyncDelete_Call) Return() *AsyncDeleter_AsyncDelete_Call { + _c.Call.Return() + return _c +} + +func (_c *AsyncDeleter_AsyncDelete_Call) RunAndReturn(run func(*pb.TransmitRequest)) *AsyncDeleter_AsyncDelete_Call { + _c.Call.Return(run) + return _c +} + // NewAsyncDeleter creates a new instance of AsyncDeleter. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewAsyncDeleter(t interface { diff --git a/core/services/relay/evm/mercury/mocks/pipeline.go b/core/services/relay/evm/mercury/mocks/pipeline.go index f553ba98509..a7183c9a037 100644 --- a/core/services/relay/evm/mercury/mocks/pipeline.go +++ b/core/services/relay/evm/mercury/mocks/pipeline.go @@ -13,7 +13,7 @@ type MockRunner struct { Err error } -func (m *MockRunner) ExecuteRun(ctx context.Context, spec pipeline.Spec, vars pipeline.Vars, l logger.Logger) (run *pipeline.Run, trrs pipeline.TaskRunResults, err error) { +func (m *MockRunner) ExecuteRun(ctx context.Context, spec pipeline.Spec, vars pipeline.Vars) (run *pipeline.Run, trrs pipeline.TaskRunResults, err error) { return &pipeline.Run{ID: 42}, m.Trrs, m.Err } @@ -23,6 +23,10 @@ type MockTask struct { result pipeline.Result } +func (m *MockTask) GetDescendantTasks() []pipeline.Task { return nil } + +func (m *MockTask) TaskTags() string { return "{\"anything\": \"here\"}" } + func (m *MockTask) Type() pipeline.TaskType { return "MockTask" } func (m *MockTask) ID() int { return 0 } func (m *MockTask) DotID() string { return "" } diff --git a/core/services/relay/evm/mercury/offchain_config_digester.go b/core/services/relay/evm/mercury/offchain_config_digester.go index f9ba0b23095..80b30054551 100644 --- a/core/services/relay/evm/mercury/offchain_config_digester.go +++ b/core/services/relay/evm/mercury/offchain_config_digester.go @@ -18,14 +18,15 @@ import ( var _ ocrtypes.OffchainConfigDigester = OffchainConfigDigester{} -func NewOffchainConfigDigester(feedID [32]byte, chainID *big.Int, contractAddress common.Address) OffchainConfigDigester { - return OffchainConfigDigester{feedID, chainID, contractAddress} +func NewOffchainConfigDigester(feedID [32]byte, chainID *big.Int, contractAddress common.Address, prefix ocrtypes.ConfigDigestPrefix) OffchainConfigDigester { + return OffchainConfigDigester{feedID, chainID, contractAddress, prefix} } type OffchainConfigDigester struct { FeedID utils.FeedID ChainID *big.Int ContractAddress common.Address + Prefix ocrtypes.ConfigDigestPrefix } func (d OffchainConfigDigester) ConfigDigest(cc ocrtypes.ContractConfig) (ocrtypes.ConfigDigest, error) { @@ -63,9 +64,10 @@ func (d OffchainConfigDigester) ConfigDigest(cc ocrtypes.ContractConfig) (ocrtyp cc.OnchainConfig, cc.OffchainConfigVersion, cc.OffchainConfig, + d.Prefix, ), nil } func (d OffchainConfigDigester) ConfigDigestPrefix() (ocrtypes.ConfigDigestPrefix, error) { - return ocrtypes.ConfigDigestPrefixMercuryV02, nil + return d.Prefix, nil } diff --git a/core/services/relay/evm/mercury/persistence_manager.go b/core/services/relay/evm/mercury/persistence_manager.go index d7f3d8eaa0d..dfe75e7c3ce 100644 --- a/core/services/relay/evm/mercury/persistence_manager.go +++ b/core/services/relay/evm/mercury/persistence_manager.go @@ -7,9 +7,10 @@ import ( ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" + "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink-common/pkg/services" "github.com/smartcontractkit/chainlink-common/pkg/sqlutil" - "github.com/smartcontractkit/chainlink/v2/core/logger" + "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury/wsrpc/pb" ) @@ -39,7 +40,7 @@ type PersistenceManager struct { func NewPersistenceManager(lggr logger.Logger, serverURL string, orm ORM, jobID int32, maxTransmitQueueSize int, flushDeletesFrequency, pruneFrequency time.Duration) *PersistenceManager { return &PersistenceManager{ - lggr: lggr.Named("MercuryPersistenceManager").With("serverURL", serverURL), + lggr: logger.Sugared(lggr).Named("MercuryPersistenceManager").With("serverURL", serverURL), orm: orm, serverURL: serverURL, stopCh: make(services.StopChan), diff --git a/core/services/relay/evm/mercury/queue.go b/core/services/relay/evm/mercury/queue.go index 93dc0bfc689..a450d21af6e 100644 --- a/core/services/relay/evm/mercury/queue.go +++ b/core/services/relay/evm/mercury/queue.go @@ -13,13 +13,12 @@ import ( ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" + "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink-common/pkg/services" - "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury/wsrpc/pb" ) -//go:generate mockery --quiet --name asyncDeleter --output ./mocks/ --case=underscore --structname=AsyncDeleter type asyncDeleter interface { AsyncDelete(req *pb.TransmitRequest) } @@ -43,7 +42,7 @@ type transmitQueue struct { services.StateMachine cond sync.Cond - lggr logger.Logger + lggr logger.SugaredLogger asyncDeleter asyncDeleter mu *sync.RWMutex @@ -77,7 +76,7 @@ func NewTransmitQueue(lggr logger.Logger, serverURL, feedID string, maxlen int, return &transmitQueue{ services.StateMachine{}, sync.Cond{L: mu}, - lggr.Named("TransmitQueue"), + logger.Sugared(lggr).Named("TransmitQueue"), asyncDeleter, mu, nil, // pq needs to be initialized by calling tq.Init before use diff --git a/core/services/relay/evm/mercury/transmitter.go b/core/services/relay/evm/mercury/transmitter.go index f1434bf20f1..b914e67b453 100644 --- a/core/services/relay/evm/mercury/transmitter.go +++ b/core/services/relay/evm/mercury/transmitter.go @@ -27,10 +27,10 @@ import ( capStreams "github.com/smartcontractkit/chainlink-common/pkg/capabilities/datastreams" "github.com/smartcontractkit/chainlink-common/pkg/capabilities/triggers" commonconfig "github.com/smartcontractkit/chainlink-common/pkg/config" + "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink-common/pkg/services" "github.com/smartcontractkit/chainlink-common/pkg/types/mercury" - "github.com/smartcontractkit/chainlink/v2/core/logger" mercuryutils "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury/utils" "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury/wsrpc" "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury/wsrpc/pb" @@ -110,7 +110,7 @@ type TransmitterConfig interface { type mercuryTransmitter struct { services.StateMachine - lggr logger.Logger + lggr logger.SugaredLogger cfg TransmitterConfig orm ORM @@ -147,7 +147,7 @@ func getPayloadTypes() abi.Arguments { } type server struct { - lggr logger.Logger + lggr logger.SugaredLogger transmitTimeout time.Duration @@ -285,7 +285,7 @@ func (s *server) runQueueLoop(stopCh services.StopChan, wg *sync.WaitGroup, feed func newServer(lggr logger.Logger, cfg TransmitterConfig, client wsrpc.Client, pm *PersistenceManager, serverURL, feedIDHex string) *server { return &server{ - lggr, + logger.Sugared(lggr), cfg.TransmitTimeout().Duration(), client, pm, @@ -302,16 +302,17 @@ func newServer(lggr logger.Logger, cfg TransmitterConfig, client wsrpc.Client, p } func NewTransmitter(lggr logger.Logger, cfg TransmitterConfig, clients map[string]wsrpc.Client, fromAccount ed25519.PublicKey, jobID int32, feedID [32]byte, orm ORM, codec TransmitterReportDecoder, triggerCapability *triggers.MercuryTriggerService) *mercuryTransmitter { + sugared := logger.Sugared(lggr) feedIDHex := fmt.Sprintf("0x%x", feedID[:]) servers := make(map[string]*server, len(clients)) for serverURL, client := range clients { - cLggr := lggr.Named(serverURL).With("serverURL", serverURL) + cLggr := sugared.Named(serverURL).With("serverURL", serverURL) pm := NewPersistenceManager(cLggr, serverURL, orm, jobID, int(cfg.TransmitQueueMaxSize()), flushDeletesFrequency, pruneFrequency) servers[serverURL] = newServer(cLggr, cfg, client, pm, serverURL, feedIDHex) } return &mercuryTransmitter{ services.StateMachine{}, - lggr.Named("MercuryTransmitter").With("feedID", feedIDHex), + sugared.Named("MercuryTransmitter").With("feedID", feedIDHex), cfg, orm, servers, diff --git a/core/services/relay/evm/mercury/utils/feeds.go b/core/services/relay/evm/mercury/utils/feeds.go index 6f8978bbf0d..eb4f6850221 100644 --- a/core/services/relay/evm/mercury/utils/feeds.go +++ b/core/services/relay/evm/mercury/utils/feeds.go @@ -83,6 +83,7 @@ const ( REPORT_V1 REPORT_V2 REPORT_V3 + REPORT_V4 _ ) @@ -103,10 +104,14 @@ func (f *FeedID) UnmarshalText(input []byte) error { func (f FeedID) Version() FeedVersion { if _, exists := legacyV1FeedIDM[f]; exists { return REPORT_V1 + } else if f[0] == 0x01 { // Keystone Feed IDs + return FeedVersion(binary.BigEndian.Uint16(f[5:7])) } + return FeedVersion(binary.BigEndian.Uint16(f[:2])) } func (f FeedID) IsV1() bool { return f.Version() == REPORT_V1 } func (f FeedID) IsV2() bool { return f.Version() == REPORT_V2 } func (f FeedID) IsV3() bool { return f.Version() == REPORT_V3 } +func (f FeedID) IsV4() bool { return f.Version() == REPORT_V4 } diff --git a/core/services/relay/evm/mercury/utils/feeds_test.go b/core/services/relay/evm/mercury/utils/feeds_test.go index 37b9b47de76..d6db7a4a8c4 100644 --- a/core/services/relay/evm/mercury/utils/feeds_test.go +++ b/core/services/relay/evm/mercury/utils/feeds_test.go @@ -7,27 +7,48 @@ import ( ) var ( - v1FeedId = (FeedID)([32]uint8{00, 01, 107, 74, 167, 229, 124, 167, 182, 138, 225, 191, 69, 101, 63, 86, 182, 86, 253, 58, 163, 53, 239, 127, 174, 105, 107, 102, 63, 27, 132, 114}) - v2FeedId = (FeedID)([32]uint8{00, 02, 107, 74, 167, 229, 124, 167, 182, 138, 225, 191, 69, 101, 63, 86, 182, 86, 253, 58, 163, 53, 239, 127, 174, 105, 107, 102, 63, 27, 132, 114}) - v3FeedId = (FeedID)([32]uint8{00, 03, 107, 74, 167, 229, 124, 167, 182, 138, 225, 191, 69, 101, 63, 86, 182, 86, 253, 58, 163, 53, 239, 127, 174, 105, 107, 102, 63, 27, 132, 114}) + v1FeedID = (FeedID)([32]uint8{00, 01, 107, 74, 167, 229, 124, 167, 182, 138, 225, 191, 69, 101, 63, 86, 182, 86, 253, 58, 163, 53, 239, 127, 174, 105, 107, 102, 63, 27, 132, 114}) + v2FeedID = (FeedID)([32]uint8{00, 02, 107, 74, 167, 229, 124, 167, 182, 138, 225, 191, 69, 101, 63, 86, 182, 86, 253, 58, 163, 53, 239, 127, 174, 105, 107, 102, 63, 27, 132, 114}) + v3FeedID = (FeedID)([32]uint8{00, 03, 107, 74, 167, 229, 124, 167, 182, 138, 225, 191, 69, 101, 63, 86, 182, 86, 253, 58, 163, 53, 239, 127, 174, 105, 107, 102, 63, 27, 132, 114}) + keystonev2Feed = (FeedID)([32]uint8{01, 12, 34, 56, 78, 00, 02, 04, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00}) + keystonev3Feed = (FeedID)([32]uint8{01, 12, 34, 56, 78, 00, 03, 04, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00}) + keystonev4Feed = (FeedID)([32]uint8{01, 12, 34, 56, 78, 00, 04, 04, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00}) ) func Test_FeedID_Version(t *testing.T) { t.Run("versioned feed ID", func(t *testing.T) { - assert.Equal(t, REPORT_V1, v1FeedId.Version()) - assert.True(t, v1FeedId.IsV1()) - assert.False(t, v1FeedId.IsV2()) - assert.False(t, v1FeedId.IsV3()) - - assert.Equal(t, REPORT_V2, v2FeedId.Version()) - assert.False(t, v2FeedId.IsV1()) - assert.True(t, v2FeedId.IsV2()) - assert.False(t, v2FeedId.IsV3()) - - assert.Equal(t, REPORT_V3, v3FeedId.Version()) - assert.False(t, v3FeedId.IsV1()) - assert.False(t, v3FeedId.IsV2()) - assert.True(t, v3FeedId.IsV3()) + assert.Equal(t, REPORT_V1, v1FeedID.Version()) + assert.True(t, v1FeedID.IsV1()) + assert.False(t, v1FeedID.IsV2()) + assert.False(t, v1FeedID.IsV3()) + + assert.Equal(t, REPORT_V2, v2FeedID.Version()) + assert.False(t, v2FeedID.IsV1()) + assert.True(t, v2FeedID.IsV2()) + assert.False(t, v2FeedID.IsV3()) + + assert.Equal(t, REPORT_V3, v3FeedID.Version()) + assert.False(t, v3FeedID.IsV1()) + assert.False(t, v3FeedID.IsV2()) + assert.True(t, v3FeedID.IsV3()) + + assert.Equal(t, REPORT_V2, keystonev2Feed.Version()) + assert.False(t, keystonev2Feed.IsV1()) + assert.True(t, keystonev2Feed.IsV2()) + assert.False(t, keystonev2Feed.IsV3()) + assert.False(t, keystonev2Feed.IsV4()) + + assert.Equal(t, REPORT_V3, keystonev3Feed.Version()) + assert.False(t, keystonev3Feed.IsV1()) + assert.False(t, keystonev3Feed.IsV2()) + assert.True(t, keystonev3Feed.IsV3()) + assert.False(t, keystonev3Feed.IsV4()) + + assert.Equal(t, REPORT_V4, keystonev4Feed.Version()) + assert.False(t, keystonev4Feed.IsV1()) + assert.False(t, keystonev4Feed.IsV2()) + assert.False(t, keystonev4Feed.IsV3()) + assert.True(t, keystonev4Feed.IsV4()) }) t.Run("legacy special cases", func(t *testing.T) { for _, feedID := range legacyV1FeedIDs { diff --git a/core/services/relay/evm/mercury/v1/data_source.go b/core/services/relay/evm/mercury/v1/data_source.go index 7f41bd1e36c..5a9a11decaa 100644 --- a/core/services/relay/evm/mercury/v1/data_source.go +++ b/core/services/relay/evm/mercury/v1/data_source.go @@ -45,7 +45,7 @@ var ( const nBlocksObservation int = v1.MaxAllowedBlocks type Runner interface { - ExecuteRun(ctx context.Context, spec pipeline.Spec, vars pipeline.Vars, l logger.Logger) (run *pipeline.Run, trrs pipeline.TaskRunResults, err error) + ExecuteRun(ctx context.Context, spec pipeline.Spec, vars pipeline.Vars) (run *pipeline.Run, trrs pipeline.TaskRunResults, err error) } // Fetcher fetcher data from Mercury server @@ -283,7 +283,7 @@ func (ds *datasource) executeRun(ctx context.Context) (*pipeline.Run, pipeline.T }, }) - run, trrs, err := ds.pipelineRunner.ExecuteRun(ctx, ds.spec, vars, ds.lggr) + run, trrs, err := ds.pipelineRunner.ExecuteRun(ctx, ds.spec, vars) if err != nil { return nil, nil, pkgerrors.Wrapf(err, "error executing run for spec ID %v", ds.spec.ID) } diff --git a/core/services/relay/evm/mercury/v1/data_source_test.go b/core/services/relay/evm/mercury/v1/data_source_test.go index 197d802a3b3..7f5117a0aa8 100644 --- a/core/services/relay/evm/mercury/v1/data_source_test.go +++ b/core/services/relay/evm/mercury/v1/data_source_test.go @@ -332,16 +332,15 @@ func TestMercury_Observe(t *testing.T) { t.Run("when chain is too short", func(t *testing.T) { h4 := &evmtypes.Head{ Number: 4, - Parent: nil, } h5 := &evmtypes.Head{ Number: 5, - Parent: h4, } + h5.Parent.Store(h4) h6 := &evmtypes.Head{ Number: 6, - Parent: h5, } + h6.Parent.Store(h5) ht2 := htmocks.NewHeadTracker[*evmtypes.Head, common.Hash](t) ht2.On("LatestChain").Return(h6) @@ -362,7 +361,7 @@ func TestMercury_Observe(t *testing.T) { for i := range heads { heads[i] = &evmtypes.Head{Number: int64(i)} if i > 0 { - heads[i].Parent = heads[i-1] + heads[i].Parent.Store(heads[i-1]) } } diff --git a/core/services/relay/evm/mercury/v1/reportcodec/report_codec.go b/core/services/relay/evm/mercury/v1/reportcodec/report_codec.go index f4c6af32b8e..fb332dcc8ff 100644 --- a/core/services/relay/evm/mercury/v1/reportcodec/report_codec.go +++ b/core/services/relay/evm/mercury/v1/reportcodec/report_codec.go @@ -11,8 +11,9 @@ import ( ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" + "github.com/smartcontractkit/chainlink-common/pkg/logger" v1 "github.com/smartcontractkit/chainlink-common/pkg/types/mercury/v1" - "github.com/smartcontractkit/chainlink/v2/core/logger" + "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury/utils" reporttypes "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury/v1/types" ) diff --git a/core/services/relay/evm/mercury/v2/data_source.go b/core/services/relay/evm/mercury/v2/data_source.go index 7c2d6424fae..fed748ac937 100644 --- a/core/services/relay/evm/mercury/v2/data_source.go +++ b/core/services/relay/evm/mercury/v2/data_source.go @@ -26,7 +26,7 @@ import ( ) type Runner interface { - ExecuteRun(ctx context.Context, spec pipeline.Spec, vars pipeline.Vars, l logger.Logger) (run *pipeline.Run, trrs pipeline.TaskRunResults, err error) + ExecuteRun(ctx context.Context, spec pipeline.Spec, vars pipeline.Vars) (run *pipeline.Run, trrs pipeline.TaskRunResults, err error) } type LatestReportFetcher interface { @@ -108,7 +108,9 @@ func (ds *datasource) Observe(ctx context.Context, repts ocrtypes.ReportTimestam }() var isLink, isNative bool - if ds.feedID == ds.linkFeedID { + if len(ds.jb.OCR2OracleSpec.PluginConfig) == 0 { + obs.LinkPrice.Val = v2.MissingPrice + } else if ds.feedID == ds.linkFeedID { isLink = true } else { wg.Add(1) @@ -126,7 +128,9 @@ func (ds *datasource) Observe(ctx context.Context, repts ocrtypes.ReportTimestam }() } - if ds.feedID == ds.nativeFeedID { + if len(ds.jb.OCR2OracleSpec.PluginConfig) == 0 { + obs.NativePrice.Val = v2.MissingPrice + } else if ds.feedID == ds.nativeFeedID { isNative = true } else { wg.Add(1) @@ -228,7 +232,7 @@ func (ds *datasource) executeRun(ctx context.Context) (*pipeline.Run, pipeline.T }, }) - run, trrs, err := ds.pipelineRunner.ExecuteRun(ctx, ds.spec, vars, ds.lggr) + run, trrs, err := ds.pipelineRunner.ExecuteRun(ctx, ds.spec, vars) if err != nil { return nil, nil, pkgerrors.Wrapf(err, "error executing run for spec ID %v", ds.spec.ID) } diff --git a/core/services/relay/evm/mercury/v2/data_source_test.go b/core/services/relay/evm/mercury/v2/data_source_test.go index 19af909c8e9..25716521d86 100644 --- a/core/services/relay/evm/mercury/v2/data_source_test.go +++ b/core/services/relay/evm/mercury/v2/data_source_test.go @@ -15,6 +15,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/logger" + "github.com/smartcontractkit/chainlink/v2/core/services/job" "github.com/smartcontractkit/chainlink/v2/core/services/pipeline" mercurymocks "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury/mocks" "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury/utils" @@ -72,7 +73,16 @@ func (ms *mockSaver) Save(r *pipeline.Run) { func Test_Datasource(t *testing.T) { orm := &mockORM{} - ds := &datasource{orm: orm, lggr: logger.TestLogger(t)} + jb := job.Job{ + Type: job.Type(pipeline.OffchainReporting2JobType), + OCR2OracleSpec: &job.OCR2OracleSpec{ + CaptureEATelemetry: true, + PluginConfig: map[string]interface{}{ + "serverURL": "a", + }, + }, + } + ds := &datasource{orm: orm, lggr: logger.TestLogger(t), jb: jb} ctx := testutils.Context(t) repts := ocrtypes.ReportTimestamp{} @@ -274,6 +284,25 @@ func Test_Datasource(t *testing.T) { assert.EqualError(t, obs.NativePrice.Err, "some error fetching native price") }) + t.Run("when PluginConfig is empty", func(t *testing.T) { + t.Cleanup(func() { + ds.jb = jb + }) + + fetcher.linkPriceErr = errors.New("some error fetching link price") + fetcher.nativePriceErr = errors.New("some error fetching native price") + + ds.jb.OCR2OracleSpec.PluginConfig = job.JSONConfig{} + + obs, err := ds.Observe(ctx, repts, false) + assert.NoError(t, err) + assert.Nil(t, obs.LinkPrice.Err) + assert.Equal(t, obs.LinkPrice.Val, v2.MissingPrice) + assert.Nil(t, obs.NativePrice.Err) + assert.Equal(t, obs.NativePrice.Val, v2.MissingPrice) + assert.Equal(t, big.NewInt(122), obs.BenchmarkPrice.Val) + }) + t.Run("when succeeds to fetch linkPrice or nativePrice but got nil (new feed)", func(t *testing.T) { obs, err := ds.Observe(ctx, repts, false) assert.NoError(t, err) diff --git a/core/services/relay/evm/mercury/v2/reportcodec/report_codec.go b/core/services/relay/evm/mercury/v2/reportcodec/report_codec.go index 33c5fa9a326..ebbdfac66cd 100644 --- a/core/services/relay/evm/mercury/v2/reportcodec/report_codec.go +++ b/core/services/relay/evm/mercury/v2/reportcodec/report_codec.go @@ -9,9 +9,9 @@ import ( ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" + "github.com/smartcontractkit/chainlink-common/pkg/logger" v2 "github.com/smartcontractkit/chainlink-common/pkg/types/mercury/v2" - "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury/utils" reporttypes "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury/v2/types" ) diff --git a/core/services/relay/evm/mercury/v3/data_source.go b/core/services/relay/evm/mercury/v3/data_source.go index a751149f378..9744ec45d80 100644 --- a/core/services/relay/evm/mercury/v3/data_source.go +++ b/core/services/relay/evm/mercury/v3/data_source.go @@ -8,17 +8,16 @@ import ( "sync" pkgerrors "github.com/pkg/errors" - ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" "github.com/smartcontractkit/chainlink-common/pkg/types/mercury" v3types "github.com/smartcontractkit/chainlink-common/pkg/types/mercury/v3" v3 "github.com/smartcontractkit/chainlink-data-streams/mercury/v3" - "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/job" "github.com/smartcontractkit/chainlink/v2/core/services/ocrcommon" "github.com/smartcontractkit/chainlink/v2/core/services/pipeline" + "github.com/smartcontractkit/chainlink/v2/core/services/pipeline/eautils" "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury/types" mercurytypes "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury/types" mercuryutils "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury/utils" @@ -26,8 +25,10 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/utils" ) +const adapterLWBAErrorName = "AdapterLWBAError" + type Runner interface { - ExecuteRun(ctx context.Context, spec pipeline.Spec, vars pipeline.Vars, l logger.Logger) (run *pipeline.Run, trrs pipeline.TaskRunResults, err error) + ExecuteRun(ctx context.Context, spec pipeline.Spec, vars pipeline.Vars) (run *pipeline.Run, trrs pipeline.TaskRunResults, err error) } type LatestReportFetcher interface { @@ -111,7 +112,9 @@ func (ds *datasource) Observe(ctx context.Context, repts ocrtypes.ReportTimestam }() var isLink, isNative bool - if ds.feedID == ds.linkFeedID { + if len(ds.jb.OCR2OracleSpec.PluginConfig) == 0 { + obs.LinkPrice.Val = v3.MissingPrice + } else if ds.feedID == ds.linkFeedID { isLink = true } else { wg.Add(1) @@ -129,7 +132,9 @@ func (ds *datasource) Observe(ctx context.Context, repts ocrtypes.ReportTimestam }() } - if ds.feedID == ds.nativeFeedID { + if len(ds.jb.OCR2OracleSpec.PluginConfig) == 0 { + obs.NativePrice.Val = v3.MissingPrice + } else if ds.feedID == ds.nativeFeedID { isNative = true } else { wg.Add(1) @@ -151,6 +156,19 @@ func (ds *datasource) Observe(ctx context.Context, repts ocrtypes.ReportTimestam cancel() if pipelineExecutionErr != nil { + var adapterError *eautils.AdapterError + if errors.As(pipelineExecutionErr, &adapterError) && adapterError.Name == adapterLWBAErrorName { + ocrcommon.MaybeEnqueueEnhancedTelem(ds.jb, ds.chEnhancedTelem, ocrcommon.EnhancedTelemetryMercuryData{ + V3Observation: &obs, + TaskRunResults: trrs, + RepTimestamp: repts, + FeedVersion: mercuryutils.REPORT_V3, + FetchMaxFinalizedTimestamp: fetchMaxFinalizedTimestamp, + IsLinkFeed: isLink, + IsNativeFeed: isNative, + DpInvariantViolationDetected: true, + }) + } return } @@ -267,7 +285,7 @@ func (ds *datasource) executeRun(ctx context.Context) (*pipeline.Run, pipeline.T }, }) - run, trrs, err := ds.pipelineRunner.ExecuteRun(ctx, ds.spec, vars, ds.lggr) + run, trrs, err := ds.pipelineRunner.ExecuteRun(ctx, ds.spec, vars) if err != nil { return nil, nil, pkgerrors.Wrapf(err, "error executing run for spec ID %v", ds.spec.ID) } diff --git a/core/services/relay/evm/mercury/v3/data_source_test.go b/core/services/relay/evm/mercury/v3/data_source_test.go index ffcdc28f81c..518fabb12c9 100644 --- a/core/services/relay/evm/mercury/v3/data_source_test.go +++ b/core/services/relay/evm/mercury/v3/data_source_test.go @@ -5,16 +5,18 @@ import ( "math/big" "testing" - "github.com/pkg/errors" - "github.com/stretchr/testify/assert" - - mercurytypes "github.com/smartcontractkit/chainlink-common/pkg/types/mercury" relaymercuryv3 "github.com/smartcontractkit/chainlink-data-streams/mercury/v3" + "github.com/smartcontractkit/chainlink/v2/core/services/ocrcommon" + "github.com/smartcontractkit/chainlink/v2/core/services/pipeline/eautils" + "github.com/pkg/errors" ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" + "github.com/stretchr/testify/assert" + mercurytypes "github.com/smartcontractkit/chainlink-common/pkg/types/mercury" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/logger" + "github.com/smartcontractkit/chainlink/v2/core/services/job" "github.com/smartcontractkit/chainlink/v2/core/services/pipeline" mercurymocks "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury/mocks" "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury/utils" @@ -72,7 +74,16 @@ func (ms *mockSaver) Save(r *pipeline.Run) { func Test_Datasource(t *testing.T) { orm := &mockORM{} - ds := &datasource{orm: orm, lggr: logger.TestLogger(t)} + jb := job.Job{ + Type: job.Type(pipeline.OffchainReporting2JobType), + OCR2OracleSpec: &job.OCR2OracleSpec{ + CaptureEATelemetry: true, + PluginConfig: map[string]interface{}{ + "serverURL": "a", + }, + }, + } + ds := &datasource{orm: orm, lggr: logger.TestLogger(t), jb: jb} ctx := testutils.Context(t) repts := ocrtypes.ReportTimestamp{} @@ -254,8 +265,59 @@ func Test_Datasource(t *testing.T) { Err: nil, } + chEnhancedTelem := make(chan ocrcommon.EnhancedTelemetryMercuryData, 1) + ds.chEnhancedTelem = chEnhancedTelem + _, err := ds.Observe(ctx, repts, false) assert.EqualError(t, err, "Observe failed while parsing run results: some error with ask") + + select { + case <-chEnhancedTelem: + assert.Fail(t, "did not expect to receive telemetry") + default: + } + }) + + t.Run("when run results fails with a bid ask violation", func(t *testing.T) { + t.Cleanup(func() { + runner := &mercurymocks.MockRunner{ + Trrs: goodTrrs, + Err: nil, + } + ds.pipelineRunner = runner + }) + + badTrrs := []pipeline.TaskRunResult{ + { + // benchmark price + Result: pipeline.Result{Value: "122.345"}, + Task: &mercurymocks.MockTask{}, + }, + { + // bid + Result: pipeline.Result{Value: "121.993"}, + Task: &mercurymocks.MockTask{}, + }, + { + // ask + Result: pipeline.Result{Error: &eautils.AdapterError{Name: adapterLWBAErrorName, Message: "bid ask violation"}}, + Task: &mercurymocks.MockTask{}, + }, + } + + ds.pipelineRunner = &mercurymocks.MockRunner{ + Trrs: badTrrs, + Err: nil, + } + + chEnhancedTelem := make(chan ocrcommon.EnhancedTelemetryMercuryData, 1) + ds.chEnhancedTelem = chEnhancedTelem + + _, err := ds.Observe(ctx, repts, false) + assert.EqualError(t, err, "Observe failed while parsing run results: AdapterLWBAError: bid ask violation") + + telem := <-chEnhancedTelem + assert.True(t, telem.DpInvariantViolationDetected) }) t.Run("when run execution succeeded", func(t *testing.T) { @@ -302,6 +364,25 @@ func Test_Datasource(t *testing.T) { assert.EqualError(t, obs.NativePrice.Err, "some error fetching native price") }) + t.Run("when PluginConfig is empty", func(t *testing.T) { + t.Cleanup(func() { + ds.jb = jb + }) + + fetcher.linkPriceErr = errors.New("some error fetching link price") + fetcher.nativePriceErr = errors.New("some error fetching native price") + + ds.jb.OCR2OracleSpec.PluginConfig = job.JSONConfig{} + + obs, err := ds.Observe(ctx, repts, false) + assert.NoError(t, err) + assert.Nil(t, obs.LinkPrice.Err) + assert.Equal(t, obs.LinkPrice.Val, relaymercuryv3.MissingPrice) + assert.Nil(t, obs.NativePrice.Err) + assert.Equal(t, obs.NativePrice.Val, relaymercuryv3.MissingPrice) + assert.Equal(t, big.NewInt(122), obs.BenchmarkPrice.Val) + }) + t.Run("when succeeds to fetch linkPrice or nativePrice but got nil (new feed)", func(t *testing.T) { obs, err := ds.Observe(ctx, repts, false) assert.NoError(t, err) diff --git a/core/services/relay/evm/mercury/v3/reportcodec/report_codec.go b/core/services/relay/evm/mercury/v3/reportcodec/report_codec.go index 601431838d2..1bf750fbf97 100644 --- a/core/services/relay/evm/mercury/v3/reportcodec/report_codec.go +++ b/core/services/relay/evm/mercury/v3/reportcodec/report_codec.go @@ -9,9 +9,9 @@ import ( ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" + "github.com/smartcontractkit/chainlink-common/pkg/logger" v3 "github.com/smartcontractkit/chainlink-common/pkg/types/mercury/v3" - "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury/utils" reporttypes "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury/v3/types" ) diff --git a/core/services/relay/evm/mercury/v4/data_source.go b/core/services/relay/evm/mercury/v4/data_source.go new file mode 100644 index 00000000000..bf45ccc87fd --- /dev/null +++ b/core/services/relay/evm/mercury/v4/data_source.go @@ -0,0 +1,262 @@ +package v4 + +import ( + "context" + "errors" + "fmt" + "math/big" + "sync" + + pkgerrors "github.com/pkg/errors" + ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" + + "github.com/smartcontractkit/chainlink-common/pkg/types/mercury" + v4types "github.com/smartcontractkit/chainlink-common/pkg/types/mercury/v4" + v4 "github.com/smartcontractkit/chainlink-data-streams/mercury/v4" + "github.com/smartcontractkit/chainlink/v2/core/logger" + "github.com/smartcontractkit/chainlink/v2/core/services/job" + "github.com/smartcontractkit/chainlink/v2/core/services/ocrcommon" + "github.com/smartcontractkit/chainlink/v2/core/services/pipeline" + "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury/types" + mercurytypes "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury/types" + mercuryutils "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury/utils" + "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury/v4/reportcodec" + "github.com/smartcontractkit/chainlink/v2/core/utils" +) + +type Runner interface { + ExecuteRun(ctx context.Context, spec pipeline.Spec, vars pipeline.Vars) (run *pipeline.Run, trrs pipeline.TaskRunResults, err error) +} + +type LatestReportFetcher interface { + LatestPrice(ctx context.Context, feedID [32]byte) (*big.Int, error) + LatestTimestamp(context.Context) (int64, error) +} + +type datasource struct { + pipelineRunner Runner + jb job.Job + spec pipeline.Spec + feedID mercuryutils.FeedID + lggr logger.Logger + saver ocrcommon.Saver + orm types.DataSourceORM + codec reportcodec.ReportCodec + + fetcher LatestReportFetcher + linkFeedID mercuryutils.FeedID + nativeFeedID mercuryutils.FeedID + + mu sync.RWMutex + + chEnhancedTelem chan<- ocrcommon.EnhancedTelemetryMercuryData +} + +var _ v4.DataSource = &datasource{} + +func NewDataSource(orm types.DataSourceORM, pr pipeline.Runner, jb job.Job, spec pipeline.Spec, feedID mercuryutils.FeedID, lggr logger.Logger, s ocrcommon.Saver, enhancedTelemChan chan ocrcommon.EnhancedTelemetryMercuryData, fetcher LatestReportFetcher, linkFeedID, nativeFeedID mercuryutils.FeedID) *datasource { + return &datasource{pr, jb, spec, feedID, lggr, s, orm, reportcodec.ReportCodec{}, fetcher, linkFeedID, nativeFeedID, sync.RWMutex{}, enhancedTelemChan} +} + +func (ds *datasource) Observe(ctx context.Context, repts ocrtypes.ReportTimestamp, fetchMaxFinalizedTimestamp bool) (obs v4types.Observation, pipelineExecutionErr error) { + var wg sync.WaitGroup + ctx, cancel := context.WithCancel(ctx) + + if fetchMaxFinalizedTimestamp { + wg.Add(1) + go func() { + defer wg.Done() + latest, dbErr := ds.orm.LatestReport(ctx, ds.feedID) + if dbErr != nil { + obs.MaxFinalizedTimestamp.Err = dbErr + return + } + if latest != nil { + maxFinalizedBlockNumber, decodeErr := ds.codec.ObservationTimestampFromReport(latest) + obs.MaxFinalizedTimestamp.Val, obs.MaxFinalizedTimestamp.Err = int64(maxFinalizedBlockNumber), decodeErr + return + } + obs.MaxFinalizedTimestamp.Val, obs.MaxFinalizedTimestamp.Err = ds.fetcher.LatestTimestamp(ctx) + }() + } + + var trrs pipeline.TaskRunResults + wg.Add(1) + go func() { + defer wg.Done() + var run *pipeline.Run + run, trrs, pipelineExecutionErr = ds.executeRun(ctx) + if pipelineExecutionErr != nil { + cancel() + pipelineExecutionErr = fmt.Errorf("Observe failed while executing run: %w", pipelineExecutionErr) + return + } + + ds.saver.Save(run) + + var parsed parseOutput + parsed, pipelineExecutionErr = ds.parse(trrs) + if pipelineExecutionErr != nil { + cancel() + // This is not expected under normal circumstances + ds.lggr.Errorw("Observe failed while parsing run results", "err", pipelineExecutionErr) + pipelineExecutionErr = fmt.Errorf("Observe failed while parsing run results: %w", pipelineExecutionErr) + return + } + obs.BenchmarkPrice = parsed.benchmarkPrice + obs.MarketStatus = parsed.marketStatus + }() + + var isLink, isNative bool + if len(ds.jb.OCR2OracleSpec.PluginConfig) == 0 { + obs.LinkPrice.Val = v4.MissingPrice + } else if ds.feedID == ds.linkFeedID { + isLink = true + } else { + wg.Add(1) + go func() { + defer wg.Done() + obs.LinkPrice.Val, obs.LinkPrice.Err = ds.fetcher.LatestPrice(ctx, ds.linkFeedID) + if obs.LinkPrice.Val == nil && obs.LinkPrice.Err == nil { + mercurytypes.PriceFeedMissingCount.WithLabelValues(ds.linkFeedID.String()).Inc() + ds.lggr.Warnw(fmt.Sprintf("Mercury server was missing LINK feed, using sentinel value of %s", v4.MissingPrice), "linkFeedID", ds.linkFeedID) + obs.LinkPrice.Val = v4.MissingPrice + } else if obs.LinkPrice.Err != nil { + mercurytypes.PriceFeedErrorCount.WithLabelValues(ds.linkFeedID.String()).Inc() + ds.lggr.Errorw("Mercury server returned error querying LINK price feed", "err", obs.LinkPrice.Err, "linkFeedID", ds.linkFeedID) + } + }() + } + + if len(ds.jb.OCR2OracleSpec.PluginConfig) == 0 { + obs.NativePrice.Val = v4.MissingPrice + } else if ds.feedID == ds.nativeFeedID { + isNative = true + } else { + wg.Add(1) + go func() { + defer wg.Done() + obs.NativePrice.Val, obs.NativePrice.Err = ds.fetcher.LatestPrice(ctx, ds.nativeFeedID) + if obs.NativePrice.Val == nil && obs.NativePrice.Err == nil { + mercurytypes.PriceFeedMissingCount.WithLabelValues(ds.nativeFeedID.String()).Inc() + ds.lggr.Warnw(fmt.Sprintf("Mercury server was missing native feed, using sentinel value of %s", v4.MissingPrice), "nativeFeedID", ds.nativeFeedID) + obs.NativePrice.Val = v4.MissingPrice + } else if obs.NativePrice.Err != nil { + mercurytypes.PriceFeedErrorCount.WithLabelValues(ds.nativeFeedID.String()).Inc() + ds.lggr.Errorw("Mercury server returned error querying native price feed", "err", obs.NativePrice.Err, "nativeFeedID", ds.nativeFeedID) + } + }() + } + + wg.Wait() + cancel() + + if pipelineExecutionErr != nil { + return + } + + if isLink || isNative { + // run has now completed so it is safe to use benchmark price + if isLink { + // This IS the LINK feed, use our observed price + obs.LinkPrice.Val, obs.LinkPrice.Err = obs.BenchmarkPrice.Val, obs.BenchmarkPrice.Err + } + if isNative { + // This IS the native feed, use our observed price + obs.NativePrice.Val, obs.NativePrice.Err = obs.BenchmarkPrice.Val, obs.BenchmarkPrice.Err + } + } + + ocrcommon.MaybeEnqueueEnhancedTelem(ds.jb, ds.chEnhancedTelem, ocrcommon.EnhancedTelemetryMercuryData{ + V4Observation: &obs, + TaskRunResults: trrs, + RepTimestamp: repts, + FeedVersion: mercuryutils.REPORT_V4, + FetchMaxFinalizedTimestamp: fetchMaxFinalizedTimestamp, + IsLinkFeed: isLink, + IsNativeFeed: isNative, + }) + + return obs, nil +} + +func toBigInt(val interface{}) (*big.Int, error) { + dec, err := utils.ToDecimal(val) + if err != nil { + return nil, err + } + return dec.BigInt(), nil +} + +type parseOutput struct { + benchmarkPrice mercury.ObsResult[*big.Int] + marketStatus mercury.ObsResult[uint32] +} + +func (ds *datasource) parse(trrs pipeline.TaskRunResults) (o parseOutput, merr error) { + var finaltrrs []pipeline.TaskRunResult + for _, trr := range trrs { + // only return terminal trrs from executeRun + if trr.IsTerminal() { + finaltrrs = append(finaltrrs, trr) + } + } + + // pipeline.TaskRunResults comes ordered asc by index, this is guaranteed + // by the pipeline executor + if len(finaltrrs) != 2 { + return o, fmt.Errorf("invalid number of results, expected: 2, got: %d", len(finaltrrs)) + } + + merr = errors.Join( + setBenchmarkPrice(&o, finaltrrs[0].Result), + setMarketStatus(&o, finaltrrs[1].Result), + ) + + return o, merr +} + +func setBenchmarkPrice(o *parseOutput, res pipeline.Result) error { + if res.Error != nil { + o.benchmarkPrice.Err = res.Error + return res.Error + } + val, err := toBigInt(res.Value) + if err != nil { + return fmt.Errorf("failed to parse BenchmarkPrice: %w", err) + } + o.benchmarkPrice.Val = val + return nil +} + +func setMarketStatus(o *parseOutput, res pipeline.Result) error { + if res.Error != nil { + o.marketStatus.Err = res.Error + return res.Error + } + val, err := toBigInt(res.Value) + if err != nil { + return fmt.Errorf("failed to parse MarketStatus: %w", err) + } + o.marketStatus.Val = uint32(val.Int64()) + return nil +} + +// The context passed in here has a timeout of (ObservationTimeout + ObservationGracePeriod). +// Upon context cancellation, its expected that we return any usable values within ObservationGracePeriod. +func (ds *datasource) executeRun(ctx context.Context) (*pipeline.Run, pipeline.TaskRunResults, error) { + vars := pipeline.NewVarsFrom(map[string]interface{}{ + "jb": map[string]interface{}{ + "databaseID": ds.jb.ID, + "externalJobID": ds.jb.ExternalJobID, + "name": ds.jb.Name.ValueOrZero(), + }, + }) + + run, trrs, err := ds.pipelineRunner.ExecuteRun(ctx, ds.spec, vars) + if err != nil { + return nil, nil, pkgerrors.Wrapf(err, "error executing run for spec ID %v", ds.spec.ID) + } + + return run, trrs, err +} diff --git a/core/services/relay/evm/mercury/v4/data_source_test.go b/core/services/relay/evm/mercury/v4/data_source_test.go new file mode 100644 index 00000000000..48aec5989a6 --- /dev/null +++ b/core/services/relay/evm/mercury/v4/data_source_test.go @@ -0,0 +1,348 @@ +package v4 + +import ( + "context" + "math/big" + "testing" + + "github.com/pkg/errors" + ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" + "github.com/stretchr/testify/assert" + + mercurytypes "github.com/smartcontractkit/chainlink-common/pkg/types/mercury" + relaymercuryv4 "github.com/smartcontractkit/chainlink-data-streams/mercury/v4" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" + "github.com/smartcontractkit/chainlink/v2/core/logger" + "github.com/smartcontractkit/chainlink/v2/core/services/job" + "github.com/smartcontractkit/chainlink/v2/core/services/pipeline" + mercurymocks "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury/mocks" + "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury/utils" + reportcodecv4 "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury/v4/reportcodec" +) + +var _ mercurytypes.ServerFetcher = &mockFetcher{} + +type mockFetcher struct { + ts int64 + tsErr error + linkPrice *big.Int + linkPriceErr error + nativePrice *big.Int + nativePriceErr error +} + +var feedId utils.FeedID = [32]byte{1} +var linkFeedId utils.FeedID = [32]byte{2} +var nativeFeedId utils.FeedID = [32]byte{3} + +func (m *mockFetcher) FetchInitialMaxFinalizedBlockNumber(context.Context) (*int64, error) { + return nil, nil +} + +func (m *mockFetcher) LatestPrice(ctx context.Context, fId [32]byte) (*big.Int, error) { + if fId == linkFeedId { + return m.linkPrice, m.linkPriceErr + } else if fId == nativeFeedId { + return m.nativePrice, m.nativePriceErr + } + return nil, nil +} + +func (m *mockFetcher) LatestTimestamp(context.Context) (int64, error) { + return m.ts, m.tsErr +} + +type mockORM struct { + report []byte + err error +} + +func (m *mockORM) LatestReport(ctx context.Context, feedID [32]byte) (report []byte, err error) { + return m.report, m.err +} + +type mockSaver struct { + r *pipeline.Run +} + +func (ms *mockSaver) Save(r *pipeline.Run) { + ms.r = r +} + +func Test_Datasource(t *testing.T) { + orm := &mockORM{} + jb := job.Job{ + Type: job.Type(pipeline.OffchainReporting2JobType), + OCR2OracleSpec: &job.OCR2OracleSpec{ + CaptureEATelemetry: true, + PluginConfig: map[string]interface{}{ + "serverURL": "a", + }, + }, + } + ds := &datasource{orm: orm, lggr: logger.TestLogger(t), jb: jb} + ctx := testutils.Context(t) + repts := ocrtypes.ReportTimestamp{} + + fetcher := &mockFetcher{} + ds.fetcher = fetcher + + saver := &mockSaver{} + ds.saver = saver + + goodTrrs := []pipeline.TaskRunResult{ + { + // bp + Result: pipeline.Result{Value: "122.345"}, + Task: &mercurymocks.MockTask{}, + }, + { + // marketStatus + Result: pipeline.Result{Value: "1"}, + Task: &mercurymocks.MockTask{}, + }, + } + + ds.pipelineRunner = &mercurymocks.MockRunner{ + Trrs: goodTrrs, + } + + spec := pipeline.Spec{} + ds.spec = spec + + t.Run("when fetchMaxFinalizedTimestamp=true", func(t *testing.T) { + t.Run("with latest report in database", func(t *testing.T) { + orm.report = buildSamplev4Report() + orm.err = nil + + obs, err := ds.Observe(ctx, repts, true) + assert.NoError(t, err) + + assert.NoError(t, obs.MaxFinalizedTimestamp.Err) + assert.Equal(t, int64(124), obs.MaxFinalizedTimestamp.Val) + }) + t.Run("if querying latest report fails", func(t *testing.T) { + orm.report = nil + orm.err = errors.New("something exploded") + + obs, err := ds.Observe(ctx, repts, true) + assert.NoError(t, err) + + assert.EqualError(t, obs.MaxFinalizedTimestamp.Err, "something exploded") + assert.Zero(t, obs.MaxFinalizedTimestamp.Val) + }) + t.Run("if codec fails to decode", func(t *testing.T) { + orm.report = []byte{1, 2, 3} + orm.err = nil + + obs, err := ds.Observe(ctx, repts, true) + assert.NoError(t, err) + + assert.EqualError(t, obs.MaxFinalizedTimestamp.Err, "failed to decode report: abi: cannot marshal in to go type: length insufficient 3 require 32") + assert.Zero(t, obs.MaxFinalizedTimestamp.Val) + }) + + orm.report = nil + orm.err = nil + + t.Run("if LatestTimestamp returns error", func(t *testing.T) { + fetcher.tsErr = errors.New("some error") + + obs, err := ds.Observe(ctx, repts, true) + assert.NoError(t, err) + + assert.EqualError(t, obs.MaxFinalizedTimestamp.Err, "some error") + assert.Zero(t, obs.MaxFinalizedTimestamp.Val) + }) + + t.Run("if LatestTimestamp succeeds", func(t *testing.T) { + fetcher.tsErr = nil + fetcher.ts = 123 + + obs, err := ds.Observe(ctx, repts, true) + assert.NoError(t, err) + + assert.Equal(t, int64(123), obs.MaxFinalizedTimestamp.Val) + assert.NoError(t, obs.MaxFinalizedTimestamp.Err) + }) + + t.Run("if LatestTimestamp succeeds but ts=0 (new feed)", func(t *testing.T) { + fetcher.tsErr = nil + fetcher.ts = 0 + + obs, err := ds.Observe(ctx, repts, true) + assert.NoError(t, err) + + assert.NoError(t, obs.MaxFinalizedTimestamp.Err) + assert.Zero(t, obs.MaxFinalizedTimestamp.Val) + }) + + t.Run("when run execution succeeded", func(t *testing.T) { + t.Run("when feedId=linkFeedID=nativeFeedId", func(t *testing.T) { + t.Cleanup(func() { + ds.feedID, ds.linkFeedID, ds.nativeFeedID = feedId, linkFeedId, nativeFeedId + }) + + ds.feedID, ds.linkFeedID, ds.nativeFeedID = feedId, feedId, feedId + + fetcher.ts = 123123 + fetcher.tsErr = nil + + obs, err := ds.Observe(ctx, repts, true) + assert.NoError(t, err) + + assert.Equal(t, big.NewInt(122), obs.BenchmarkPrice.Val) + assert.NoError(t, obs.BenchmarkPrice.Err) + assert.Equal(t, int64(123123), obs.MaxFinalizedTimestamp.Val) + assert.NoError(t, obs.MaxFinalizedTimestamp.Err) + assert.Equal(t, big.NewInt(122), obs.LinkPrice.Val) + assert.NoError(t, obs.LinkPrice.Err) + assert.Equal(t, big.NewInt(122), obs.NativePrice.Val) + assert.NoError(t, obs.NativePrice.Err) + assert.Equal(t, uint32(1), obs.MarketStatus.Val) + assert.NoError(t, obs.MarketStatus.Err) + }) + }) + }) + + t.Run("when fetchMaxFinalizedTimestamp=false", func(t *testing.T) { + t.Run("when run execution fails, returns error", func(t *testing.T) { + t.Cleanup(func() { + ds.pipelineRunner = &mercurymocks.MockRunner{ + Trrs: goodTrrs, + Err: nil, + } + }) + + ds.pipelineRunner = &mercurymocks.MockRunner{ + Trrs: goodTrrs, + Err: errors.New("run execution failed"), + } + + _, err := ds.Observe(ctx, repts, false) + assert.EqualError(t, err, "Observe failed while executing run: error executing run for spec ID 0: run execution failed") + }) + + t.Run("when parsing run results fails, return error", func(t *testing.T) { + t.Cleanup(func() { + runner := &mercurymocks.MockRunner{ + Trrs: goodTrrs, + Err: nil, + } + ds.pipelineRunner = runner + }) + + badTrrs := []pipeline.TaskRunResult{ + { + // benchmark price + Result: pipeline.Result{Error: errors.New("some error with bp")}, + Task: &mercurymocks.MockTask{}, + }, + { + // marketStatus + Result: pipeline.Result{Value: "1"}, + Task: &mercurymocks.MockTask{}, + }, + } + + ds.pipelineRunner = &mercurymocks.MockRunner{ + Trrs: badTrrs, + Err: nil, + } + + _, err := ds.Observe(ctx, repts, false) + assert.EqualError(t, err, "Observe failed while parsing run results: some error with bp") + }) + + t.Run("when run execution succeeded", func(t *testing.T) { + t.Run("when feedId=linkFeedID=nativeFeedId", func(t *testing.T) { + t.Cleanup(func() { + ds.feedID, ds.linkFeedID, ds.nativeFeedID = feedId, linkFeedId, nativeFeedId + }) + + var feedId utils.FeedID = [32]byte{1} + ds.feedID, ds.linkFeedID, ds.nativeFeedID = feedId, feedId, feedId + + obs, err := ds.Observe(ctx, repts, false) + assert.NoError(t, err) + + assert.Equal(t, big.NewInt(122), obs.BenchmarkPrice.Val) + assert.NoError(t, obs.BenchmarkPrice.Err) + assert.Equal(t, int64(0), obs.MaxFinalizedTimestamp.Val) + assert.NoError(t, obs.MaxFinalizedTimestamp.Err) + assert.Equal(t, big.NewInt(122), obs.LinkPrice.Val) + assert.NoError(t, obs.LinkPrice.Err) + assert.Equal(t, big.NewInt(122), obs.NativePrice.Val) + assert.NoError(t, obs.NativePrice.Err) + assert.Equal(t, uint32(1), obs.MarketStatus.Val) + assert.NoError(t, obs.MarketStatus.Err) + }) + + t.Run("when fails to fetch linkPrice or nativePrice", func(t *testing.T) { + t.Cleanup(func() { + fetcher.linkPriceErr = nil + fetcher.nativePriceErr = nil + }) + + fetcher.linkPriceErr = errors.New("some error fetching link price") + fetcher.nativePriceErr = errors.New("some error fetching native price") + + obs, err := ds.Observe(ctx, repts, false) + assert.NoError(t, err) + + assert.Nil(t, obs.LinkPrice.Val) + assert.EqualError(t, obs.LinkPrice.Err, "some error fetching link price") + assert.Nil(t, obs.NativePrice.Val) + assert.EqualError(t, obs.NativePrice.Err, "some error fetching native price") + }) + + t.Run("when PluginConfig is empty", func(t *testing.T) { + t.Cleanup(func() { + ds.jb = jb + }) + + fetcher.linkPriceErr = errors.New("some error fetching link price") + fetcher.nativePriceErr = errors.New("some error fetching native price") + + ds.jb.OCR2OracleSpec.PluginConfig = job.JSONConfig{} + + obs, err := ds.Observe(ctx, repts, false) + assert.NoError(t, err) + assert.Nil(t, obs.LinkPrice.Err) + assert.Equal(t, obs.LinkPrice.Val, relaymercuryv4.MissingPrice) + assert.Nil(t, obs.NativePrice.Err) + assert.Equal(t, obs.NativePrice.Val, relaymercuryv4.MissingPrice) + assert.Equal(t, big.NewInt(122), obs.BenchmarkPrice.Val) + }) + + t.Run("when succeeds to fetch linkPrice or nativePrice but got nil (new feed)", func(t *testing.T) { + obs, err := ds.Observe(ctx, repts, false) + assert.NoError(t, err) + + assert.Equal(t, obs.LinkPrice.Val, relaymercuryv4.MissingPrice) + assert.Nil(t, obs.LinkPrice.Err) + assert.Equal(t, obs.NativePrice.Val, relaymercuryv4.MissingPrice) + assert.Nil(t, obs.NativePrice.Err) + }) + }) + }) +} + +var sampleFeedID = [32]uint8{28, 145, 107, 74, 167, 229, 124, 167, 182, 138, 225, 191, 69, 101, 63, 86, 182, 86, 253, 58, 163, 53, 239, 127, 174, 105, 107, 102, 63, 27, 132, 114} + +func buildSamplev4Report() []byte { + feedID := sampleFeedID + timestamp := uint32(124) + bp := big.NewInt(242) + validFromTimestamp := uint32(123) + expiresAt := uint32(456) + linkFee := big.NewInt(3334455) + nativeFee := big.NewInt(556677) + marketStatus := uint32(1) + + b, err := reportcodecv4.ReportTypes.Pack(feedID, validFromTimestamp, timestamp, nativeFee, linkFee, expiresAt, bp, marketStatus) + if err != nil { + panic(err) + } + return b +} diff --git a/core/services/relay/evm/mercury/v4/reportcodec/report_codec.go b/core/services/relay/evm/mercury/v4/reportcodec/report_codec.go new file mode 100644 index 00000000000..dd98ef272e9 --- /dev/null +++ b/core/services/relay/evm/mercury/v4/reportcodec/report_codec.go @@ -0,0 +1,77 @@ +package reportcodec + +import ( + "errors" + "fmt" + "math/big" + + pkgerrors "github.com/pkg/errors" + ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" + + "github.com/smartcontractkit/chainlink-common/pkg/logger" + v4 "github.com/smartcontractkit/chainlink-common/pkg/types/mercury/v4" + + "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury/utils" + reporttypes "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury/v4/types" +) + +var ReportTypes = reporttypes.GetSchema() +var maxReportLength = 32 * len(ReportTypes) // each arg is 256 bit EVM word +var zero = big.NewInt(0) + +var _ v4.ReportCodec = &ReportCodec{} + +type ReportCodec struct { + logger logger.Logger + feedID utils.FeedID +} + +func NewReportCodec(feedID [32]byte, lggr logger.Logger) *ReportCodec { + return &ReportCodec{lggr, feedID} +} + +func (r *ReportCodec) BuildReport(rf v4.ReportFields) (ocrtypes.Report, error) { + var merr error + if rf.BenchmarkPrice == nil { + merr = errors.Join(merr, errors.New("benchmarkPrice may not be nil")) + } + if rf.LinkFee == nil { + merr = errors.Join(merr, errors.New("linkFee may not be nil")) + } else if rf.LinkFee.Cmp(zero) < 0 { + merr = errors.Join(merr, fmt.Errorf("linkFee may not be negative (got: %s)", rf.LinkFee)) + } + if rf.NativeFee == nil { + merr = errors.Join(merr, errors.New("nativeFee may not be nil")) + } else if rf.NativeFee.Cmp(zero) < 0 { + merr = errors.Join(merr, fmt.Errorf("nativeFee may not be negative (got: %s)", rf.NativeFee)) + } + if merr != nil { + return nil, merr + } + reportBytes, err := ReportTypes.Pack(r.feedID, rf.ValidFromTimestamp, rf.Timestamp, rf.NativeFee, rf.LinkFee, rf.ExpiresAt, rf.BenchmarkPrice, rf.MarketStatus) + return ocrtypes.Report(reportBytes), pkgerrors.Wrap(err, "failed to pack report blob") +} + +func (r *ReportCodec) MaxReportLength(n int) (int, error) { + return maxReportLength, nil +} + +func (r *ReportCodec) ObservationTimestampFromReport(report ocrtypes.Report) (uint32, error) { + decoded, err := r.Decode(report) + if err != nil { + return 0, err + } + return decoded.ObservationsTimestamp, nil +} + +func (r *ReportCodec) Decode(report ocrtypes.Report) (*reporttypes.Report, error) { + return reporttypes.Decode(report) +} + +func (r *ReportCodec) BenchmarkPriceFromReport(report ocrtypes.Report) (*big.Int, error) { + decoded, err := r.Decode(report) + if err != nil { + return nil, err + } + return decoded.BenchmarkPrice, nil +} diff --git a/core/services/relay/evm/mercury/v4/reportcodec/report_codec_test.go b/core/services/relay/evm/mercury/v4/reportcodec/report_codec_test.go new file mode 100644 index 00000000000..7be81bf2796 --- /dev/null +++ b/core/services/relay/evm/mercury/v4/reportcodec/report_codec_test.go @@ -0,0 +1,155 @@ +package reportcodec + +import ( + "math/big" + "testing" + + "github.com/smartcontractkit/libocr/offchainreporting2plus/types" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + v4 "github.com/smartcontractkit/chainlink-common/pkg/types/mercury/v4" +) + +func newValidReportFields() v4.ReportFields { + return v4.ReportFields{ + Timestamp: 242, + BenchmarkPrice: big.NewInt(243), + ValidFromTimestamp: 123, + ExpiresAt: 20, + LinkFee: big.NewInt(456), + NativeFee: big.NewInt(457), + MarketStatus: 1, + } +} + +func Test_ReportCodec_BuildReport(t *testing.T) { + r := ReportCodec{} + + t.Run("BuildReport errors on zero values", func(t *testing.T) { + _, err := r.BuildReport(v4.ReportFields{}) + require.Error(t, err) + assert.Contains(t, err.Error(), "benchmarkPrice may not be nil") + assert.Contains(t, err.Error(), "linkFee may not be nil") + assert.Contains(t, err.Error(), "nativeFee may not be nil") + }) + + t.Run("BuildReport constructs a report from observations", func(t *testing.T) { + rf := newValidReportFields() + // only need to test happy path since validations are done in relaymercury + + report, err := r.BuildReport(rf) + require.NoError(t, err) + + reportElems := make(map[string]interface{}) + err = ReportTypes.UnpackIntoMap(reportElems, report) + require.NoError(t, err) + + assert.Equal(t, int(reportElems["observationsTimestamp"].(uint32)), 242) + assert.Equal(t, reportElems["benchmarkPrice"].(*big.Int).Int64(), int64(243)) + assert.Equal(t, reportElems["validFromTimestamp"].(uint32), uint32(123)) + assert.Equal(t, reportElems["expiresAt"].(uint32), uint32(20)) + assert.Equal(t, reportElems["linkFee"].(*big.Int).Int64(), int64(456)) + assert.Equal(t, reportElems["nativeFee"].(*big.Int).Int64(), int64(457)) + assert.Equal(t, reportElems["marketStatus"].(uint32), uint32(1)) + + assert.Equal(t, types.Report{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x7b, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xf2, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0xc9, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0xc8, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x14, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xf3, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1}, report) + max, err := r.MaxReportLength(4) + require.NoError(t, err) + assert.LessOrEqual(t, len(report), max) + + t.Run("Decode decodes the report", func(t *testing.T) { + decoded, err := r.Decode(report) + require.NoError(t, err) + + require.NotNil(t, decoded) + + assert.Equal(t, uint32(242), decoded.ObservationsTimestamp) + assert.Equal(t, big.NewInt(243), decoded.BenchmarkPrice) + assert.Equal(t, uint32(123), decoded.ValidFromTimestamp) + assert.Equal(t, uint32(20), decoded.ExpiresAt) + assert.Equal(t, big.NewInt(456), decoded.LinkFee) + assert.Equal(t, big.NewInt(457), decoded.NativeFee) + assert.Equal(t, uint32(1), decoded.MarketStatus) + }) + }) + + t.Run("errors on negative fee", func(t *testing.T) { + rf := newValidReportFields() + rf.LinkFee = big.NewInt(-1) + rf.NativeFee = big.NewInt(-1) + _, err := r.BuildReport(rf) + require.Error(t, err) + + assert.Contains(t, err.Error(), "linkFee may not be negative (got: -1)") + assert.Contains(t, err.Error(), "nativeFee may not be negative (got: -1)") + }) + + t.Run("Decode errors on invalid report", func(t *testing.T) { + _, err := r.Decode([]byte{1, 2, 3}) + assert.EqualError(t, err, "failed to decode report: abi: cannot marshal in to go type: length insufficient 3 require 32") + + longBad := make([]byte, 64) + for i := 0; i < len(longBad); i++ { + longBad[i] = byte(i) + } + _, err = r.Decode(longBad) + assert.EqualError(t, err, "failed to decode report: abi: improperly encoded uint32 value") + }) +} + +func buildSampleReport(ts int64) []byte { + feedID := [32]byte{'f', 'o', 'o'} + timestamp := uint32(ts) + bp := big.NewInt(242) + validFromTimestamp := uint32(123) + expiresAt := uint32(456) + linkFee := big.NewInt(3334455) + nativeFee := big.NewInt(556677) + marketStatus := uint32(1) + + b, err := ReportTypes.Pack(feedID, validFromTimestamp, timestamp, nativeFee, linkFee, expiresAt, bp, marketStatus) + if err != nil { + panic(err) + } + return b +} + +func Test_ReportCodec_ObservationTimestampFromReport(t *testing.T) { + r := ReportCodec{} + + t.Run("ObservationTimestampFromReport extracts observation timestamp from a valid report", func(t *testing.T) { + report := buildSampleReport(123) + + ts, err := r.ObservationTimestampFromReport(report) + require.NoError(t, err) + + assert.Equal(t, ts, uint32(123)) + }) + t.Run("ObservationTimestampFromReport returns error when report is invalid", func(t *testing.T) { + report := []byte{1, 2, 3} + + _, err := r.ObservationTimestampFromReport(report) + require.Error(t, err) + + assert.EqualError(t, err, "failed to decode report: abi: cannot marshal in to go type: length insufficient 3 require 32") + }) +} + +func Test_ReportCodec_BenchmarkPriceFromReport(t *testing.T) { + r := ReportCodec{} + + t.Run("BenchmarkPriceFromReport extracts the benchmark price from valid report", func(t *testing.T) { + report := buildSampleReport(123) + + bp, err := r.BenchmarkPriceFromReport(report) + require.NoError(t, err) + + assert.Equal(t, big.NewInt(242), bp) + }) + t.Run("BenchmarkPriceFromReport errors on invalid report", func(t *testing.T) { + _, err := r.BenchmarkPriceFromReport([]byte{1, 2, 3}) + require.Error(t, err) + assert.EqualError(t, err, "failed to decode report: abi: cannot marshal in to go type: length insufficient 3 require 32") + }) +} diff --git a/core/services/relay/evm/mercury/v4/types/types.go b/core/services/relay/evm/mercury/v4/types/types.go new file mode 100644 index 00000000000..584836c1e9b --- /dev/null +++ b/core/services/relay/evm/mercury/v4/types/types.go @@ -0,0 +1,54 @@ +package reporttypes + +import ( + "fmt" + "math/big" + + "github.com/ethereum/go-ethereum/accounts/abi" +) + +var schema = GetSchema() + +func GetSchema() abi.Arguments { + mustNewType := func(t string) abi.Type { + result, err := abi.NewType(t, "", []abi.ArgumentMarshaling{}) + if err != nil { + panic(fmt.Sprintf("Unexpected error during abi.NewType: %s", err)) + } + return result + } + return abi.Arguments([]abi.Argument{ + {Name: "feedId", Type: mustNewType("bytes32")}, + {Name: "validFromTimestamp", Type: mustNewType("uint32")}, + {Name: "observationsTimestamp", Type: mustNewType("uint32")}, + {Name: "nativeFee", Type: mustNewType("uint192")}, + {Name: "linkFee", Type: mustNewType("uint192")}, + {Name: "expiresAt", Type: mustNewType("uint32")}, + {Name: "benchmarkPrice", Type: mustNewType("int192")}, + {Name: "marketStatus", Type: mustNewType("uint32")}, + }) +} + +type Report struct { + FeedId [32]byte + ObservationsTimestamp uint32 + BenchmarkPrice *big.Int + ValidFromTimestamp uint32 + ExpiresAt uint32 + LinkFee *big.Int + NativeFee *big.Int + MarketStatus uint32 +} + +// Decode is made available to external users (i.e. mercury server) +func Decode(report []byte) (*Report, error) { + values, err := schema.Unpack(report) + if err != nil { + return nil, fmt.Errorf("failed to decode report: %w", err) + } + decoded := new(Report) + if err = schema.Copy(decoded, values); err != nil { + return nil, fmt.Errorf("failed to copy report values to struct: %w", err) + } + return decoded, nil +} diff --git a/core/services/relay/evm/mercury/verifier/verifier.go b/core/services/relay/evm/mercury/verifier/verifier.go new file mode 100644 index 00000000000..02bb17d3871 --- /dev/null +++ b/core/services/relay/evm/mercury/verifier/verifier.go @@ -0,0 +1,111 @@ +package verifier + +import ( + "errors" + "fmt" + + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/crypto" + "github.com/smartcontractkit/libocr/offchainreporting2plus/types" +) + +var ( + ErrVerificationFailed = errors.New("verification failed") + + ErrFailedUnmarshalPubkey = fmt.Errorf("%w: failed to unmarshal pubkey", ErrVerificationFailed) + ErrVerifyInvalidSignatureCount = fmt.Errorf("%w: invalid signature count", ErrVerificationFailed) + ErrVerifyMismatchedSignatureCount = fmt.Errorf("%w: mismatched signature count", ErrVerificationFailed) + ErrVerifyInvalidSignature = fmt.Errorf("%w: invalid signature", ErrVerificationFailed) + ErrVerifySomeSignerUnauthorized = fmt.Errorf("%w: node unauthorized", ErrVerificationFailed) + ErrVerifyNonUniqueSignature = fmt.Errorf("%w: signer has already signed", ErrVerificationFailed) +) + +type SignedReport struct { + RawRs [][32]byte + RawSs [][32]byte + RawVs [32]byte + ReportContext [3][32]byte + Report []byte +} + +type Verifier interface { + // Verify checks the report against its configuration, and then verifies signatures. + // It replicates the Verifier contract's "verify" function for server side + // report verification. + // See also: contracts/src/v0.8/llo-feeds/Verifier.sol + Verify(report SignedReport, f uint8, authorizedSigners []common.Address) (signers []common.Address, err error) +} + +var _ Verifier = (*verifier)(nil) + +type verifier struct{} + +func NewVerifier() Verifier { + return &verifier{} +} + +func (v *verifier) Verify(sr SignedReport, f uint8, authorizedSigners []common.Address) (signers []common.Address, err error) { + if len(sr.RawRs) != int(f+1) { + return signers, fmt.Errorf("%w: expected the number of signatures (len(rs)) to equal the number of signatures required (f), but f=%d and len(rs)=%d", ErrVerifyInvalidSignatureCount, f+1, len(sr.RawRs)) + } + if len(sr.RawRs) != len(sr.RawSs) { + return signers, fmt.Errorf("%w: got %d rs and %d ss, expected equal", ErrVerifyMismatchedSignatureCount, len(sr.RawRs), len(sr.RawSs)) + } + + sigData := ReportToSigData(sr.ReportContext, sr.Report) + + signerMap := make(map[common.Address]bool) + for _, signer := range authorizedSigners { + signerMap[signer] = false + } + + // Loop over every signature and collect errors. This wastes some CPU cycles, but we need to know everyone who + // signed the report. Some risk mitigated by checking that the number of signatures matches the expected (F) earlier + var verifyErrors error + reportSigners := make([]common.Address, len(sr.RawRs)) // For logging + metrics, string for convenience + for i := 0; i < len(sr.RawRs); i++ { + sig := append(sr.RawRs[i][:], sr.RawSs[i][:]...) + sig = append(sig, sr.RawVs[i]) // In the contract, you'll see vs+27. We don't do that here since geth adds +27 internally + + sigPubKey, err := crypto.Ecrecover(sigData, sig) + if err != nil { + verifyErrors = errors.Join(verifyErrors, fmt.Errorf("failed to recover signature: %w", err)) + continue + } + + verified := crypto.VerifySignature(sigPubKey, sigData, sig[:64]) + if !verified { + verifyErrors = errors.Join(verifyErrors, ErrVerifyInvalidSignature, fmt.Errorf("signature verification failed for pubKey: %x, sig: %x", sigPubKey, sig)) + continue + } + + unmarshalledPub, err := crypto.UnmarshalPubkey(sigPubKey) + if err != nil { + verifyErrors = errors.Join(verifyErrors, ErrFailedUnmarshalPubkey, fmt.Errorf("public key=%x error=%w", sigPubKey, err)) + continue + } + + address := crypto.PubkeyToAddress(*unmarshalledPub) + reportSigners[i] = address + encountered, authorized := signerMap[address] + if !authorized { + verifyErrors = errors.Join(verifyErrors, ErrVerifySomeSignerUnauthorized, fmt.Errorf("signer %s not in list of authorized nodes", address.String())) + continue + } + if encountered { + verifyErrors = errors.Join(verifyErrors, ErrVerifyNonUniqueSignature, fmt.Errorf("signer %s has already signed this report", address.String())) + continue + } + signerMap[address] = true + signers = append(signers, address) + } + return signers, verifyErrors +} + +func ReportToSigData(reportCtx [3][32]byte, sr types.Report) []byte { + sigData := crypto.Keccak256(sr) + sigData = append(sigData, reportCtx[0][:]...) + sigData = append(sigData, reportCtx[1][:]...) + sigData = append(sigData, reportCtx[2][:]...) + return crypto.Keccak256(sigData) +} diff --git a/core/services/relay/evm/mercury/verifier/verifier_test.go b/core/services/relay/evm/mercury/verifier/verifier_test.go new file mode 100644 index 00000000000..abe891b583e --- /dev/null +++ b/core/services/relay/evm/mercury/verifier/verifier_test.go @@ -0,0 +1,80 @@ +package verifier + +import ( + "testing" + + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury" +) + +func Test_Verifier(t *testing.T) { + t.Parallel() + + signedReportBinary := hexutil.MustDecode(`0x0006e1dde86b8a12add45546a14ea7e5efd10b67a373c6f4c41ecfa17d0005350000000000000000000000000000000000000000000000000000000000000201000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000002800001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000012000034c9214519c942ad0aa84a3dd31870e6efe8b3fcab4e176c5226879b26c77000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000669150aa0000000000000000000000000000000000001504e1e6c380271bb8b129ac8f7c0000000000000000000000000000000000001504e1e6c380271bb8b129ac8f7c00000000000000000000000000000000000000000000000000000000669150ab0000000000000000000000000000000000000000000000000000002482116240000000000000000000000000000000000000000000000000000000247625a04000000000000000000000000000000000000000000000000000000024880743400000000000000000000000000000000000000000000000000000000000000002710ac21df88ab70c8822b68be53d7bed65c82ffc9204c1d7ccf3c6c4048b3ca2cafb26e7bbd8f13fe626c946baa5ffcb444319c4229b945ea65d0c99c21978a100000000000000000000000000000000000000000000000000000000000000022c07843f17aa3ecd55f52e99e889906f825f49e4ddfa9c74ca487dd4ff101cc636108a5323be838e658dffa1be67bd91e99f68c4bf86936b76c5d8193b707597`) + m := make(map[string]interface{}) + err := mercury.PayloadTypes.UnpackIntoMap(m, signedReportBinary) + require.NoError(t, err) + + signedReport := SignedReport{ + RawRs: m["rawRs"].([][32]byte), + RawSs: m["rawSs"].([][32]byte), + RawVs: m["rawVs"].([32]byte), + ReportContext: m["reportContext"].([3][32]byte), + Report: m["report"].([]byte), + } + + f := uint8(1) + + v := NewVerifier() + + t.Run("Verify errors with unauthorized signers", func(t *testing.T) { + _, err := v.Verify(signedReport, f, []common.Address{}) + require.Error(t, err) + assert.EqualError(t, err, "verification failed: node unauthorized\nsigner 0x3fc9FaA15d71EeD614e5322bd9554Fb35cC381d2 not in list of authorized nodes\nverification failed: node unauthorized\nsigner 0xBa6534da0E49c71cD9d0292203F1524876f33E23 not in list of authorized nodes") + }) + + t.Run("Verify succeeds with authorized signers", func(t *testing.T) { + signers, err := v.Verify(signedReport, f, []common.Address{ + common.HexToAddress("0xde25e5b4005f611e356ce203900da4e37d72d58f"), + common.HexToAddress("0x256431d41cf0d944f5877bc6c93846a9829dfc03"), + common.HexToAddress("0x3fc9faa15d71eed614e5322bd9554fb35cc381d2"), + common.HexToAddress("0xba6534da0e49c71cd9d0292203f1524876f33e23"), + }) + require.NoError(t, err) + assert.Equal(t, []common.Address{ + common.HexToAddress("0x3fc9faa15d71eed614e5322bd9554fb35cc381d2"), + common.HexToAddress("0xBa6534da0E49c71cD9d0292203F1524876f33E23"), + }, signers) + }) + + t.Run("Verify fails if report has been tampered with", func(t *testing.T) { + badReport := signedReport + badReport.Report = []byte{0x0011} + _, err := v.Verify(badReport, f, []common.Address{ + common.HexToAddress("0xde25e5b4005f611e356ce203900da4e37d72d58f"), + common.HexToAddress("0x256431d41cf0d944f5877bc6c93846a9829dfc03"), + common.HexToAddress("0x3fc9faa15d71eed614e5322bd9554fb35cc381d2"), + common.HexToAddress("0xba6534da0e49c71cd9d0292203f1524876f33e23"), + }) + + require.Error(t, err) + }) + + t.Run("Verify fails if rawVs has been changed", func(t *testing.T) { + badReport := signedReport + badReport.RawVs = [32]byte{0x0011} + _, err := v.Verify(badReport, f, []common.Address{ + common.HexToAddress("0xde25e5b4005f611e356ce203900da4e37d72d58f"), + common.HexToAddress("0x256431d41cf0d944f5877bc6c93846a9829dfc03"), + common.HexToAddress("0x3fc9faa15d71eed614e5322bd9554fb35cc381d2"), + common.HexToAddress("0xba6534da0e49c71cd9d0292203f1524876f33e23"), + }) + + require.Error(t, err) + assert.Contains(t, err.Error(), "failed to recover signature: invalid signature recovery id") + }) +} diff --git a/core/services/relay/evm/mercury/wsrpc/client.go b/core/services/relay/evm/mercury/wsrpc/client.go index b5d784face0..37207510655 100644 --- a/core/services/relay/evm/mercury/wsrpc/client.go +++ b/core/services/relay/evm/mercury/wsrpc/client.go @@ -11,6 +11,7 @@ import ( "github.com/pkg/errors" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promauto" + grpc_connectivity "google.golang.org/grpc/connectivity" "github.com/smartcontractkit/wsrpc" "github.com/smartcontractkit/wsrpc/connectivity" @@ -70,8 +71,8 @@ type Client interface { type Conn interface { WaitForReady(ctx context.Context) bool - GetState() connectivity.State - Close() + GetState() grpc_connectivity.State + Close() error } type client struct { @@ -230,7 +231,7 @@ func (w *client) Healthy() (err error) { return err } state := w.conn.GetState() - if state != connectivity.Ready { + if state != grpc_connectivity.Ready { return errors.Errorf("client state should be %s; got %s", connectivity.Ready, state) } return nil diff --git a/core/services/relay/evm/mercury/wsrpc/mocks/mocks.go b/core/services/relay/evm/mercury/wsrpc/mocks/mocks.go index 61912c26b02..e202802ea77 100644 --- a/core/services/relay/evm/mercury/wsrpc/mocks/mocks.go +++ b/core/services/relay/evm/mercury/wsrpc/mocks/mocks.go @@ -3,7 +3,7 @@ package mocks import ( "context" - "github.com/smartcontractkit/wsrpc/connectivity" + grpc_connectivity "google.golang.org/grpc/connectivity" "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury/wsrpc/pb" ) @@ -29,15 +29,16 @@ func (m *MockWSRPCClient) ServerURL() string { return "mock server url" } func (m *MockWSRPCClient) RawClient() pb.MercuryClient { return nil } type MockConn struct { - State connectivity.State + State grpc_connectivity.State Ready bool Closed bool } -func (m *MockConn) Close() { +func (m *MockConn) Close() error { m.Closed = true + return nil } func (m MockConn) WaitForReady(ctx context.Context) bool { return m.Ready } -func (m MockConn) GetState() connectivity.State { return m.State } +func (m MockConn) GetState() grpc_connectivity.State { return m.State } diff --git a/core/services/relay/evm/mercury/wsrpc/pb/mercury.pb.go b/core/services/relay/evm/mercury/wsrpc/pb/mercury.pb.go index a1f0fef069e..ab74d426bbe 100644 --- a/core/services/relay/evm/mercury/wsrpc/pb/mercury.pb.go +++ b/core/services/relay/evm/mercury/wsrpc/pb/mercury.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.1 +// protoc-gen-go v1.34.2 // protoc v4.25.1 // source: mercury.proto @@ -535,7 +535,7 @@ func file_mercury_proto_rawDescGZIP() []byte { } var file_mercury_proto_msgTypes = make([]protoimpl.MessageInfo, 6) -var file_mercury_proto_goTypes = []interface{}{ +var file_mercury_proto_goTypes = []any{ (*TransmitRequest)(nil), // 0: pb.TransmitRequest (*TransmitResponse)(nil), // 1: pb.TransmitResponse (*LatestReportRequest)(nil), // 2: pb.LatestReportRequest @@ -563,7 +563,7 @@ func file_mercury_proto_init() { return } if !protoimpl.UnsafeEnabled { - file_mercury_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_mercury_proto_msgTypes[0].Exporter = func(v any, i int) any { switch v := v.(*TransmitRequest); i { case 0: return &v.state @@ -575,7 +575,7 @@ func file_mercury_proto_init() { return nil } } - file_mercury_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_mercury_proto_msgTypes[1].Exporter = func(v any, i int) any { switch v := v.(*TransmitResponse); i { case 0: return &v.state @@ -587,7 +587,7 @@ func file_mercury_proto_init() { return nil } } - file_mercury_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + file_mercury_proto_msgTypes[2].Exporter = func(v any, i int) any { switch v := v.(*LatestReportRequest); i { case 0: return &v.state @@ -599,7 +599,7 @@ func file_mercury_proto_init() { return nil } } - file_mercury_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + file_mercury_proto_msgTypes[3].Exporter = func(v any, i int) any { switch v := v.(*LatestReportResponse); i { case 0: return &v.state @@ -611,7 +611,7 @@ func file_mercury_proto_init() { return nil } } - file_mercury_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + file_mercury_proto_msgTypes[4].Exporter = func(v any, i int) any { switch v := v.(*Report); i { case 0: return &v.state @@ -623,7 +623,7 @@ func file_mercury_proto_init() { return nil } } - file_mercury_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + file_mercury_proto_msgTypes[5].Exporter = func(v any, i int) any { switch v := v.(*Timestamp); i { case 0: return &v.state diff --git a/core/services/relay/evm/mercury_config_provider.go b/core/services/relay/evm/mercury_config_provider.go index bd0749e5ae2..53bf8e22d24 100644 --- a/core/services/relay/evm/mercury_config_provider.go +++ b/core/services/relay/evm/mercury_config_provider.go @@ -7,10 +7,12 @@ import ( "github.com/ethereum/go-ethereum/common" + ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" + + "github.com/smartcontractkit/chainlink-common/pkg/logger" commontypes "github.com/smartcontractkit/chainlink-common/pkg/types" "github.com/smartcontractkit/chainlink/v2/core/chains/legacyevm" - "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury" "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/types" ) @@ -31,7 +33,7 @@ func newMercuryConfigProvider(ctx context.Context, lggr logger.Logger, chain leg } cp, err := mercury.NewConfigPoller( ctx, - lggr.Named(relayConfig.FeedID.String()), + logger.Named(lggr, relayConfig.FeedID.String()), chain.LogPoller(), aggregatorAddress, *relayConfig.FeedID, @@ -41,6 +43,6 @@ func newMercuryConfigProvider(ctx context.Context, lggr logger.Logger, chain leg return nil, err } - offchainConfigDigester := mercury.NewOffchainConfigDigester(*relayConfig.FeedID, chain.Config().EVM().ChainID(), aggregatorAddress) + offchainConfigDigester := mercury.NewOffchainConfigDigester(*relayConfig.FeedID, chain.Config().EVM().ChainID(), aggregatorAddress, ocrtypes.ConfigDigestPrefixMercuryV02) return newConfigWatcher(lggr, aggregatorAddress, offchainConfigDigester, cp, chain, relayConfig.FromBlock, opts.New), nil } diff --git a/core/services/relay/evm/mercury_provider.go b/core/services/relay/evm/mercury_provider.go index 48882b701c9..85f633e063a 100644 --- a/core/services/relay/evm/mercury_provider.go +++ b/core/services/relay/evm/mercury_provider.go @@ -6,17 +6,18 @@ import ( ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" + "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink-common/pkg/services" commontypes "github.com/smartcontractkit/chainlink-common/pkg/types" - mercurytypes "github.com/smartcontractkit/chainlink-common/pkg/types/mercury" v1 "github.com/smartcontractkit/chainlink-common/pkg/types/mercury/v1" v2 "github.com/smartcontractkit/chainlink-common/pkg/types/mercury/v2" v3 "github.com/smartcontractkit/chainlink-common/pkg/types/mercury/v3" + v4 "github.com/smartcontractkit/chainlink-common/pkg/types/mercury/v4" + "github.com/smartcontractkit/chainlink-data-streams/mercury" httypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/headtracker/types" - "github.com/smartcontractkit/chainlink/v2/core/logger" evmmercury "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury" ) @@ -24,12 +25,12 @@ var _ commontypes.MercuryProvider = (*mercuryProvider)(nil) type mercuryProvider struct { cp commontypes.ConfigProvider - chainReader commontypes.ContractReader codec commontypes.Codec transmitter evmmercury.Transmitter reportCodecV1 v1.ReportCodec reportCodecV2 v2.ReportCodec reportCodecV3 v3.ReportCodec + reportCodecV4 v4.ReportCodec mercuryChainReader mercurytypes.ChainReader logger logger.Logger ms services.MultiStart @@ -37,23 +38,23 @@ type mercuryProvider struct { func NewMercuryProvider( cp commontypes.ConfigProvider, - chainReader commontypes.ContractReader, codec commontypes.Codec, mercuryChainReader mercurytypes.ChainReader, transmitter evmmercury.Transmitter, reportCodecV1 v1.ReportCodec, reportCodecV2 v2.ReportCodec, reportCodecV3 v3.ReportCodec, + reportCodecV4 v4.ReportCodec, lggr logger.Logger, ) *mercuryProvider { return &mercuryProvider{ cp, - chainReader, codec, transmitter, reportCodecV1, reportCodecV2, reportCodecV3, + reportCodecV4, mercuryChainReader, lggr, services.MultiStart{}, @@ -115,6 +116,10 @@ func (p *mercuryProvider) ReportCodecV3() v3.ReportCodec { return p.reportCodecV3 } +func (p *mercuryProvider) ReportCodecV4() v4.ReportCodec { + return p.reportCodecV4 +} + func (p *mercuryProvider) ContractTransmitter() ocrtypes.ContractTransmitter { return p.transmitter } @@ -123,8 +128,8 @@ func (p *mercuryProvider) MercuryServerFetcher() mercurytypes.ServerFetcher { return p.transmitter } -func (p *mercuryProvider) ChainReader() commontypes.ContractReader { - return p.chainReader +func (p *mercuryProvider) ContractReader() commontypes.ContractReader { + return nil } var _ mercurytypes.ChainReader = (*mercuryChainReader)(nil) diff --git a/core/services/relay/evm/method_binding.go b/core/services/relay/evm/method_binding.go deleted file mode 100644 index 4f642bdab94..00000000000 --- a/core/services/relay/evm/method_binding.go +++ /dev/null @@ -1,92 +0,0 @@ -package evm - -import ( - "context" - "fmt" - - "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/common" - - commontypes "github.com/smartcontractkit/chainlink-common/pkg/types" - "github.com/smartcontractkit/chainlink-common/pkg/types/query" - - evmclient "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" -) - -type NoContractExistsError struct { - Address common.Address -} - -func (e NoContractExistsError) Error() string { - return fmt.Sprintf("contract does not exist at address: %s", e.Address) -} - -type methodBinding struct { - address common.Address - contractName string - method string - client evmclient.Client - codec commontypes.Codec - bound bool -} - -var _ readBinding = &methodBinding{} - -func (m *methodBinding) SetCodec(codec commontypes.RemoteCodec) { - m.codec = codec -} - -func (m *methodBinding) Bind(ctx context.Context, binding commontypes.BoundContract) error { - addr := common.HexToAddress(binding.Address) - - // check for contract byte code at the latest block and provided address - byteCode, err := m.client.CodeAt(ctx, addr, nil) - if err != nil { - return err - } - - if len(byteCode) == 0 { - return NoContractExistsError{Address: addr} - } - - m.address = addr - m.bound = true - - return nil -} - -func (m *methodBinding) Register(_ context.Context) error { - return nil -} - -func (m *methodBinding) Unregister(_ context.Context) error { - return nil -} - -func (m *methodBinding) GetLatestValue(ctx context.Context, params, returnValue any) error { - if !m.bound { - return fmt.Errorf("%w: method not bound", commontypes.ErrInvalidType) - } - - data, err := m.codec.Encode(ctx, params, wrapItemType(m.contractName, m.method, true)) - if err != nil { - return err - } - - callMsg := ethereum.CallMsg{ - To: &m.address, - From: m.address, - Data: data, - } - - bytes, err := m.client.CallContract(ctx, callMsg, nil) - if err != nil { - return fmt.Errorf("%w: %w", commontypes.ErrInternal, err) - } - - return m.codec.Decode(ctx, bytes, returnValue, wrapItemType(m.contractName, m.method, false)) -} - -func (m *methodBinding) QueryKey(_ context.Context, _ query.KeyFilter, _ query.LimitAndSort, _ any) ([]commontypes.Sequence, error) { - return nil, nil -} diff --git a/core/services/relay/evm/mocks/codec.go b/core/services/relay/evm/mocks/codec.go new file mode 100644 index 00000000000..4369760e0dc --- /dev/null +++ b/core/services/relay/evm/mocks/codec.go @@ -0,0 +1,261 @@ +// Code generated by mockery v2.43.2. DO NOT EDIT. + +package mocks + +import ( + context "context" + + mock "github.com/stretchr/testify/mock" +) + +// Codec is an autogenerated mock type for the Codec type +type Codec struct { + mock.Mock +} + +type Codec_Expecter struct { + mock *mock.Mock +} + +func (_m *Codec) EXPECT() *Codec_Expecter { + return &Codec_Expecter{mock: &_m.Mock} +} + +// Decode provides a mock function with given fields: ctx, raw, into, itemType +func (_m *Codec) Decode(ctx context.Context, raw []byte, into interface{}, itemType string) error { + ret := _m.Called(ctx, raw, into, itemType) + + if len(ret) == 0 { + panic("no return value specified for Decode") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, []byte, interface{}, string) error); ok { + r0 = rf(ctx, raw, into, itemType) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// Codec_Decode_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Decode' +type Codec_Decode_Call struct { + *mock.Call +} + +// Decode is a helper method to define mock.On call +// - ctx context.Context +// - raw []byte +// - into interface{} +// - itemType string +func (_e *Codec_Expecter) Decode(ctx interface{}, raw interface{}, into interface{}, itemType interface{}) *Codec_Decode_Call { + return &Codec_Decode_Call{Call: _e.mock.On("Decode", ctx, raw, into, itemType)} +} + +func (_c *Codec_Decode_Call) Run(run func(ctx context.Context, raw []byte, into interface{}, itemType string)) *Codec_Decode_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].([]byte), args[2].(interface{}), args[3].(string)) + }) + return _c +} + +func (_c *Codec_Decode_Call) Return(_a0 error) *Codec_Decode_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Codec_Decode_Call) RunAndReturn(run func(context.Context, []byte, interface{}, string) error) *Codec_Decode_Call { + _c.Call.Return(run) + return _c +} + +// Encode provides a mock function with given fields: ctx, item, itemType +func (_m *Codec) Encode(ctx context.Context, item interface{}, itemType string) ([]byte, error) { + ret := _m.Called(ctx, item, itemType) + + if len(ret) == 0 { + panic("no return value specified for Encode") + } + + var r0 []byte + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, interface{}, string) ([]byte, error)); ok { + return rf(ctx, item, itemType) + } + if rf, ok := ret.Get(0).(func(context.Context, interface{}, string) []byte); ok { + r0 = rf(ctx, item, itemType) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]byte) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, interface{}, string) error); ok { + r1 = rf(ctx, item, itemType) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// Codec_Encode_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Encode' +type Codec_Encode_Call struct { + *mock.Call +} + +// Encode is a helper method to define mock.On call +// - ctx context.Context +// - item interface{} +// - itemType string +func (_e *Codec_Expecter) Encode(ctx interface{}, item interface{}, itemType interface{}) *Codec_Encode_Call { + return &Codec_Encode_Call{Call: _e.mock.On("Encode", ctx, item, itemType)} +} + +func (_c *Codec_Encode_Call) Run(run func(ctx context.Context, item interface{}, itemType string)) *Codec_Encode_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(interface{}), args[2].(string)) + }) + return _c +} + +func (_c *Codec_Encode_Call) Return(_a0 []byte, _a1 error) *Codec_Encode_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Codec_Encode_Call) RunAndReturn(run func(context.Context, interface{}, string) ([]byte, error)) *Codec_Encode_Call { + _c.Call.Return(run) + return _c +} + +// GetMaxDecodingSize provides a mock function with given fields: ctx, n, itemType +func (_m *Codec) GetMaxDecodingSize(ctx context.Context, n int, itemType string) (int, error) { + ret := _m.Called(ctx, n, itemType) + + if len(ret) == 0 { + panic("no return value specified for GetMaxDecodingSize") + } + + var r0 int + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, int, string) (int, error)); ok { + return rf(ctx, n, itemType) + } + if rf, ok := ret.Get(0).(func(context.Context, int, string) int); ok { + r0 = rf(ctx, n, itemType) + } else { + r0 = ret.Get(0).(int) + } + + if rf, ok := ret.Get(1).(func(context.Context, int, string) error); ok { + r1 = rf(ctx, n, itemType) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// Codec_GetMaxDecodingSize_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetMaxDecodingSize' +type Codec_GetMaxDecodingSize_Call struct { + *mock.Call +} + +// GetMaxDecodingSize is a helper method to define mock.On call +// - ctx context.Context +// - n int +// - itemType string +func (_e *Codec_Expecter) GetMaxDecodingSize(ctx interface{}, n interface{}, itemType interface{}) *Codec_GetMaxDecodingSize_Call { + return &Codec_GetMaxDecodingSize_Call{Call: _e.mock.On("GetMaxDecodingSize", ctx, n, itemType)} +} + +func (_c *Codec_GetMaxDecodingSize_Call) Run(run func(ctx context.Context, n int, itemType string)) *Codec_GetMaxDecodingSize_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(int), args[2].(string)) + }) + return _c +} + +func (_c *Codec_GetMaxDecodingSize_Call) Return(_a0 int, _a1 error) *Codec_GetMaxDecodingSize_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Codec_GetMaxDecodingSize_Call) RunAndReturn(run func(context.Context, int, string) (int, error)) *Codec_GetMaxDecodingSize_Call { + _c.Call.Return(run) + return _c +} + +// GetMaxEncodingSize provides a mock function with given fields: ctx, n, itemType +func (_m *Codec) GetMaxEncodingSize(ctx context.Context, n int, itemType string) (int, error) { + ret := _m.Called(ctx, n, itemType) + + if len(ret) == 0 { + panic("no return value specified for GetMaxEncodingSize") + } + + var r0 int + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, int, string) (int, error)); ok { + return rf(ctx, n, itemType) + } + if rf, ok := ret.Get(0).(func(context.Context, int, string) int); ok { + r0 = rf(ctx, n, itemType) + } else { + r0 = ret.Get(0).(int) + } + + if rf, ok := ret.Get(1).(func(context.Context, int, string) error); ok { + r1 = rf(ctx, n, itemType) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// Codec_GetMaxEncodingSize_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetMaxEncodingSize' +type Codec_GetMaxEncodingSize_Call struct { + *mock.Call +} + +// GetMaxEncodingSize is a helper method to define mock.On call +// - ctx context.Context +// - n int +// - itemType string +func (_e *Codec_Expecter) GetMaxEncodingSize(ctx interface{}, n interface{}, itemType interface{}) *Codec_GetMaxEncodingSize_Call { + return &Codec_GetMaxEncodingSize_Call{Call: _e.mock.On("GetMaxEncodingSize", ctx, n, itemType)} +} + +func (_c *Codec_GetMaxEncodingSize_Call) Run(run func(ctx context.Context, n int, itemType string)) *Codec_GetMaxEncodingSize_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(int), args[2].(string)) + }) + return _c +} + +func (_c *Codec_GetMaxEncodingSize_Call) Return(_a0 int, _a1 error) *Codec_GetMaxEncodingSize_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Codec_GetMaxEncodingSize_Call) RunAndReturn(run func(context.Context, int, string) (int, error)) *Codec_GetMaxEncodingSize_Call { + _c.Call.Return(run) + return _c +} + +// NewCodec creates a new instance of Codec. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewCodec(t interface { + mock.TestingT + Cleanup(func()) +}) *Codec { + mock := &Codec{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/core/services/relay/evm/mocks/loop_relay_adapter.go b/core/services/relay/evm/mocks/loop_relay_adapter.go index 8fe8d51498e..76579d4746a 100644 --- a/core/services/relay/evm/mocks/loop_relay_adapter.go +++ b/core/services/relay/evm/mocks/loop_relay_adapter.go @@ -18,6 +18,14 @@ type LoopRelayAdapter struct { mock.Mock } +type LoopRelayAdapter_Expecter struct { + mock *mock.Mock +} + +func (_m *LoopRelayAdapter) EXPECT() *LoopRelayAdapter_Expecter { + return &LoopRelayAdapter_Expecter{mock: &_m.Mock} +} + // Chain provides a mock function with given fields: func (_m *LoopRelayAdapter) Chain() legacyevm.Chain { ret := _m.Called() @@ -38,6 +46,33 @@ func (_m *LoopRelayAdapter) Chain() legacyevm.Chain { return r0 } +// LoopRelayAdapter_Chain_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Chain' +type LoopRelayAdapter_Chain_Call struct { + *mock.Call +} + +// Chain is a helper method to define mock.On call +func (_e *LoopRelayAdapter_Expecter) Chain() *LoopRelayAdapter_Chain_Call { + return &LoopRelayAdapter_Chain_Call{Call: _e.mock.On("Chain")} +} + +func (_c *LoopRelayAdapter_Chain_Call) Run(run func()) *LoopRelayAdapter_Chain_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *LoopRelayAdapter_Chain_Call) Return(_a0 legacyevm.Chain) *LoopRelayAdapter_Chain_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *LoopRelayAdapter_Chain_Call) RunAndReturn(run func() legacyevm.Chain) *LoopRelayAdapter_Chain_Call { + _c.Call.Return(run) + return _c +} + // Close provides a mock function with given fields: func (_m *LoopRelayAdapter) Close() error { ret := _m.Called() @@ -56,6 +91,33 @@ func (_m *LoopRelayAdapter) Close() error { return r0 } +// LoopRelayAdapter_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close' +type LoopRelayAdapter_Close_Call struct { + *mock.Call +} + +// Close is a helper method to define mock.On call +func (_e *LoopRelayAdapter_Expecter) Close() *LoopRelayAdapter_Close_Call { + return &LoopRelayAdapter_Close_Call{Call: _e.mock.On("Close")} +} + +func (_c *LoopRelayAdapter_Close_Call) Run(run func()) *LoopRelayAdapter_Close_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *LoopRelayAdapter_Close_Call) Return(_a0 error) *LoopRelayAdapter_Close_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *LoopRelayAdapter_Close_Call) RunAndReturn(run func() error) *LoopRelayAdapter_Close_Call { + _c.Call.Return(run) + return _c +} + // GetChainStatus provides a mock function with given fields: ctx func (_m *LoopRelayAdapter) GetChainStatus(ctx context.Context) (types.ChainStatus, error) { ret := _m.Called(ctx) @@ -84,6 +146,34 @@ func (_m *LoopRelayAdapter) GetChainStatus(ctx context.Context) (types.ChainStat return r0, r1 } +// LoopRelayAdapter_GetChainStatus_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetChainStatus' +type LoopRelayAdapter_GetChainStatus_Call struct { + *mock.Call +} + +// GetChainStatus is a helper method to define mock.On call +// - ctx context.Context +func (_e *LoopRelayAdapter_Expecter) GetChainStatus(ctx interface{}) *LoopRelayAdapter_GetChainStatus_Call { + return &LoopRelayAdapter_GetChainStatus_Call{Call: _e.mock.On("GetChainStatus", ctx)} +} + +func (_c *LoopRelayAdapter_GetChainStatus_Call) Run(run func(ctx context.Context)) *LoopRelayAdapter_GetChainStatus_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *LoopRelayAdapter_GetChainStatus_Call) Return(_a0 types.ChainStatus, _a1 error) *LoopRelayAdapter_GetChainStatus_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *LoopRelayAdapter_GetChainStatus_Call) RunAndReturn(run func(context.Context) (types.ChainStatus, error)) *LoopRelayAdapter_GetChainStatus_Call { + _c.Call.Return(run) + return _c +} + // HealthReport provides a mock function with given fields: func (_m *LoopRelayAdapter) HealthReport() map[string]error { ret := _m.Called() @@ -104,6 +194,89 @@ func (_m *LoopRelayAdapter) HealthReport() map[string]error { return r0 } +// LoopRelayAdapter_HealthReport_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HealthReport' +type LoopRelayAdapter_HealthReport_Call struct { + *mock.Call +} + +// HealthReport is a helper method to define mock.On call +func (_e *LoopRelayAdapter_Expecter) HealthReport() *LoopRelayAdapter_HealthReport_Call { + return &LoopRelayAdapter_HealthReport_Call{Call: _e.mock.On("HealthReport")} +} + +func (_c *LoopRelayAdapter_HealthReport_Call) Run(run func()) *LoopRelayAdapter_HealthReport_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *LoopRelayAdapter_HealthReport_Call) Return(_a0 map[string]error) *LoopRelayAdapter_HealthReport_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *LoopRelayAdapter_HealthReport_Call) RunAndReturn(run func() map[string]error) *LoopRelayAdapter_HealthReport_Call { + _c.Call.Return(run) + return _c +} + +// LatestHead provides a mock function with given fields: ctx +func (_m *LoopRelayAdapter) LatestHead(ctx context.Context) (types.Head, error) { + ret := _m.Called(ctx) + + if len(ret) == 0 { + panic("no return value specified for LatestHead") + } + + var r0 types.Head + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (types.Head, error)); ok { + return rf(ctx) + } + if rf, ok := ret.Get(0).(func(context.Context) types.Head); ok { + r0 = rf(ctx) + } else { + r0 = ret.Get(0).(types.Head) + } + + if rf, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = rf(ctx) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// LoopRelayAdapter_LatestHead_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LatestHead' +type LoopRelayAdapter_LatestHead_Call struct { + *mock.Call +} + +// LatestHead is a helper method to define mock.On call +// - ctx context.Context +func (_e *LoopRelayAdapter_Expecter) LatestHead(ctx interface{}) *LoopRelayAdapter_LatestHead_Call { + return &LoopRelayAdapter_LatestHead_Call{Call: _e.mock.On("LatestHead", ctx)} +} + +func (_c *LoopRelayAdapter_LatestHead_Call) Run(run func(ctx context.Context)) *LoopRelayAdapter_LatestHead_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *LoopRelayAdapter_LatestHead_Call) Return(_a0 types.Head, _a1 error) *LoopRelayAdapter_LatestHead_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *LoopRelayAdapter_LatestHead_Call) RunAndReturn(run func(context.Context) (types.Head, error)) *LoopRelayAdapter_LatestHead_Call { + _c.Call.Return(run) + return _c +} + // ListNodeStatuses provides a mock function with given fields: ctx, pageSize, pageToken func (_m *LoopRelayAdapter) ListNodeStatuses(ctx context.Context, pageSize int32, pageToken string) ([]types.NodeStatus, string, int, error) { ret := _m.Called(ctx, pageSize, pageToken) @@ -148,6 +321,36 @@ func (_m *LoopRelayAdapter) ListNodeStatuses(ctx context.Context, pageSize int32 return r0, r1, r2, r3 } +// LoopRelayAdapter_ListNodeStatuses_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListNodeStatuses' +type LoopRelayAdapter_ListNodeStatuses_Call struct { + *mock.Call +} + +// ListNodeStatuses is a helper method to define mock.On call +// - ctx context.Context +// - pageSize int32 +// - pageToken string +func (_e *LoopRelayAdapter_Expecter) ListNodeStatuses(ctx interface{}, pageSize interface{}, pageToken interface{}) *LoopRelayAdapter_ListNodeStatuses_Call { + return &LoopRelayAdapter_ListNodeStatuses_Call{Call: _e.mock.On("ListNodeStatuses", ctx, pageSize, pageToken)} +} + +func (_c *LoopRelayAdapter_ListNodeStatuses_Call) Run(run func(ctx context.Context, pageSize int32, pageToken string)) *LoopRelayAdapter_ListNodeStatuses_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(int32), args[2].(string)) + }) + return _c +} + +func (_c *LoopRelayAdapter_ListNodeStatuses_Call) Return(stats []types.NodeStatus, nextPageToken string, total int, err error) *LoopRelayAdapter_ListNodeStatuses_Call { + _c.Call.Return(stats, nextPageToken, total, err) + return _c +} + +func (_c *LoopRelayAdapter_ListNodeStatuses_Call) RunAndReturn(run func(context.Context, int32, string) ([]types.NodeStatus, string, int, error)) *LoopRelayAdapter_ListNodeStatuses_Call { + _c.Call.Return(run) + return _c +} + // Name provides a mock function with given fields: func (_m *LoopRelayAdapter) Name() string { ret := _m.Called() @@ -166,6 +369,33 @@ func (_m *LoopRelayAdapter) Name() string { return r0 } +// LoopRelayAdapter_Name_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Name' +type LoopRelayAdapter_Name_Call struct { + *mock.Call +} + +// Name is a helper method to define mock.On call +func (_e *LoopRelayAdapter_Expecter) Name() *LoopRelayAdapter_Name_Call { + return &LoopRelayAdapter_Name_Call{Call: _e.mock.On("Name")} +} + +func (_c *LoopRelayAdapter_Name_Call) Run(run func()) *LoopRelayAdapter_Name_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *LoopRelayAdapter_Name_Call) Return(_a0 string) *LoopRelayAdapter_Name_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *LoopRelayAdapter_Name_Call) RunAndReturn(run func() string) *LoopRelayAdapter_Name_Call { + _c.Call.Return(run) + return _c +} + // NewChainWriter provides a mock function with given fields: ctx, chainWriterConfig func (_m *LoopRelayAdapter) NewChainWriter(ctx context.Context, chainWriterConfig []byte) (types.ChainWriter, error) { ret := _m.Called(ctx, chainWriterConfig) @@ -196,6 +426,35 @@ func (_m *LoopRelayAdapter) NewChainWriter(ctx context.Context, chainWriterConfi return r0, r1 } +// LoopRelayAdapter_NewChainWriter_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NewChainWriter' +type LoopRelayAdapter_NewChainWriter_Call struct { + *mock.Call +} + +// NewChainWriter is a helper method to define mock.On call +// - ctx context.Context +// - chainWriterConfig []byte +func (_e *LoopRelayAdapter_Expecter) NewChainWriter(ctx interface{}, chainWriterConfig interface{}) *LoopRelayAdapter_NewChainWriter_Call { + return &LoopRelayAdapter_NewChainWriter_Call{Call: _e.mock.On("NewChainWriter", ctx, chainWriterConfig)} +} + +func (_c *LoopRelayAdapter_NewChainWriter_Call) Run(run func(ctx context.Context, chainWriterConfig []byte)) *LoopRelayAdapter_NewChainWriter_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].([]byte)) + }) + return _c +} + +func (_c *LoopRelayAdapter_NewChainWriter_Call) Return(_a0 types.ChainWriter, _a1 error) *LoopRelayAdapter_NewChainWriter_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *LoopRelayAdapter_NewChainWriter_Call) RunAndReturn(run func(context.Context, []byte) (types.ChainWriter, error)) *LoopRelayAdapter_NewChainWriter_Call { + _c.Call.Return(run) + return _c +} + // NewConfigProvider provides a mock function with given fields: _a0, _a1 func (_m *LoopRelayAdapter) NewConfigProvider(_a0 context.Context, _a1 types.RelayArgs) (types.ConfigProvider, error) { ret := _m.Called(_a0, _a1) @@ -226,24 +485,53 @@ func (_m *LoopRelayAdapter) NewConfigProvider(_a0 context.Context, _a1 types.Rel return r0, r1 } +// LoopRelayAdapter_NewConfigProvider_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NewConfigProvider' +type LoopRelayAdapter_NewConfigProvider_Call struct { + *mock.Call +} + +// NewConfigProvider is a helper method to define mock.On call +// - _a0 context.Context +// - _a1 types.RelayArgs +func (_e *LoopRelayAdapter_Expecter) NewConfigProvider(_a0 interface{}, _a1 interface{}) *LoopRelayAdapter_NewConfigProvider_Call { + return &LoopRelayAdapter_NewConfigProvider_Call{Call: _e.mock.On("NewConfigProvider", _a0, _a1)} +} + +func (_c *LoopRelayAdapter_NewConfigProvider_Call) Run(run func(_a0 context.Context, _a1 types.RelayArgs)) *LoopRelayAdapter_NewConfigProvider_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(types.RelayArgs)) + }) + return _c +} + +func (_c *LoopRelayAdapter_NewConfigProvider_Call) Return(_a0 types.ConfigProvider, _a1 error) *LoopRelayAdapter_NewConfigProvider_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *LoopRelayAdapter_NewConfigProvider_Call) RunAndReturn(run func(context.Context, types.RelayArgs) (types.ConfigProvider, error)) *LoopRelayAdapter_NewConfigProvider_Call { + _c.Call.Return(run) + return _c +} + // NewContractReader provides a mock function with given fields: ctx, contractReaderConfig -func (_m *LoopRelayAdapter) NewContractReader(ctx context.Context, contractReaderConfig []byte) (types.ChainReader, error) { +func (_m *LoopRelayAdapter) NewContractReader(ctx context.Context, contractReaderConfig []byte) (types.ContractReader, error) { ret := _m.Called(ctx, contractReaderConfig) if len(ret) == 0 { panic("no return value specified for NewContractReader") } - var r0 types.ChainReader + var r0 types.ContractReader var r1 error - if rf, ok := ret.Get(0).(func(context.Context, []byte) (types.ChainReader, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, []byte) (types.ContractReader, error)); ok { return rf(ctx, contractReaderConfig) } - if rf, ok := ret.Get(0).(func(context.Context, []byte) types.ChainReader); ok { + if rf, ok := ret.Get(0).(func(context.Context, []byte) types.ContractReader); ok { r0 = rf(ctx, contractReaderConfig) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(types.ChainReader) + r0 = ret.Get(0).(types.ContractReader) } } @@ -256,6 +544,35 @@ func (_m *LoopRelayAdapter) NewContractReader(ctx context.Context, contractReade return r0, r1 } +// LoopRelayAdapter_NewContractReader_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NewContractReader' +type LoopRelayAdapter_NewContractReader_Call struct { + *mock.Call +} + +// NewContractReader is a helper method to define mock.On call +// - ctx context.Context +// - contractReaderConfig []byte +func (_e *LoopRelayAdapter_Expecter) NewContractReader(ctx interface{}, contractReaderConfig interface{}) *LoopRelayAdapter_NewContractReader_Call { + return &LoopRelayAdapter_NewContractReader_Call{Call: _e.mock.On("NewContractReader", ctx, contractReaderConfig)} +} + +func (_c *LoopRelayAdapter_NewContractReader_Call) Run(run func(ctx context.Context, contractReaderConfig []byte)) *LoopRelayAdapter_NewContractReader_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].([]byte)) + }) + return _c +} + +func (_c *LoopRelayAdapter_NewContractReader_Call) Return(_a0 types.ContractReader, _a1 error) *LoopRelayAdapter_NewContractReader_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *LoopRelayAdapter_NewContractReader_Call) RunAndReturn(run func(context.Context, []byte) (types.ContractReader, error)) *LoopRelayAdapter_NewContractReader_Call { + _c.Call.Return(run) + return _c +} + // NewLLOProvider provides a mock function with given fields: _a0, _a1, _a2 func (_m *LoopRelayAdapter) NewLLOProvider(_a0 context.Context, _a1 types.RelayArgs, _a2 types.PluginArgs) (types.LLOProvider, error) { ret := _m.Called(_a0, _a1, _a2) @@ -286,6 +603,36 @@ func (_m *LoopRelayAdapter) NewLLOProvider(_a0 context.Context, _a1 types.RelayA return r0, r1 } +// LoopRelayAdapter_NewLLOProvider_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NewLLOProvider' +type LoopRelayAdapter_NewLLOProvider_Call struct { + *mock.Call +} + +// NewLLOProvider is a helper method to define mock.On call +// - _a0 context.Context +// - _a1 types.RelayArgs +// - _a2 types.PluginArgs +func (_e *LoopRelayAdapter_Expecter) NewLLOProvider(_a0 interface{}, _a1 interface{}, _a2 interface{}) *LoopRelayAdapter_NewLLOProvider_Call { + return &LoopRelayAdapter_NewLLOProvider_Call{Call: _e.mock.On("NewLLOProvider", _a0, _a1, _a2)} +} + +func (_c *LoopRelayAdapter_NewLLOProvider_Call) Run(run func(_a0 context.Context, _a1 types.RelayArgs, _a2 types.PluginArgs)) *LoopRelayAdapter_NewLLOProvider_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(types.RelayArgs), args[2].(types.PluginArgs)) + }) + return _c +} + +func (_c *LoopRelayAdapter_NewLLOProvider_Call) Return(_a0 types.LLOProvider, _a1 error) *LoopRelayAdapter_NewLLOProvider_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *LoopRelayAdapter_NewLLOProvider_Call) RunAndReturn(run func(context.Context, types.RelayArgs, types.PluginArgs) (types.LLOProvider, error)) *LoopRelayAdapter_NewLLOProvider_Call { + _c.Call.Return(run) + return _c +} + // NewPluginProvider provides a mock function with given fields: _a0, _a1, _a2 func (_m *LoopRelayAdapter) NewPluginProvider(_a0 context.Context, _a1 types.RelayArgs, _a2 types.PluginArgs) (types.PluginProvider, error) { ret := _m.Called(_a0, _a1, _a2) @@ -316,6 +663,36 @@ func (_m *LoopRelayAdapter) NewPluginProvider(_a0 context.Context, _a1 types.Rel return r0, r1 } +// LoopRelayAdapter_NewPluginProvider_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NewPluginProvider' +type LoopRelayAdapter_NewPluginProvider_Call struct { + *mock.Call +} + +// NewPluginProvider is a helper method to define mock.On call +// - _a0 context.Context +// - _a1 types.RelayArgs +// - _a2 types.PluginArgs +func (_e *LoopRelayAdapter_Expecter) NewPluginProvider(_a0 interface{}, _a1 interface{}, _a2 interface{}) *LoopRelayAdapter_NewPluginProvider_Call { + return &LoopRelayAdapter_NewPluginProvider_Call{Call: _e.mock.On("NewPluginProvider", _a0, _a1, _a2)} +} + +func (_c *LoopRelayAdapter_NewPluginProvider_Call) Run(run func(_a0 context.Context, _a1 types.RelayArgs, _a2 types.PluginArgs)) *LoopRelayAdapter_NewPluginProvider_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(types.RelayArgs), args[2].(types.PluginArgs)) + }) + return _c +} + +func (_c *LoopRelayAdapter_NewPluginProvider_Call) Return(_a0 types.PluginProvider, _a1 error) *LoopRelayAdapter_NewPluginProvider_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *LoopRelayAdapter_NewPluginProvider_Call) RunAndReturn(run func(context.Context, types.RelayArgs, types.PluginArgs) (types.PluginProvider, error)) *LoopRelayAdapter_NewPluginProvider_Call { + _c.Call.Return(run) + return _c +} + // Ready provides a mock function with given fields: func (_m *LoopRelayAdapter) Ready() error { ret := _m.Called() @@ -334,6 +711,33 @@ func (_m *LoopRelayAdapter) Ready() error { return r0 } +// LoopRelayAdapter_Ready_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Ready' +type LoopRelayAdapter_Ready_Call struct { + *mock.Call +} + +// Ready is a helper method to define mock.On call +func (_e *LoopRelayAdapter_Expecter) Ready() *LoopRelayAdapter_Ready_Call { + return &LoopRelayAdapter_Ready_Call{Call: _e.mock.On("Ready")} +} + +func (_c *LoopRelayAdapter_Ready_Call) Run(run func()) *LoopRelayAdapter_Ready_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *LoopRelayAdapter_Ready_Call) Return(_a0 error) *LoopRelayAdapter_Ready_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *LoopRelayAdapter_Ready_Call) RunAndReturn(run func() error) *LoopRelayAdapter_Ready_Call { + _c.Call.Return(run) + return _c +} + // Start provides a mock function with given fields: _a0 func (_m *LoopRelayAdapter) Start(_a0 context.Context) error { ret := _m.Called(_a0) @@ -352,6 +756,34 @@ func (_m *LoopRelayAdapter) Start(_a0 context.Context) error { return r0 } +// LoopRelayAdapter_Start_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Start' +type LoopRelayAdapter_Start_Call struct { + *mock.Call +} + +// Start is a helper method to define mock.On call +// - _a0 context.Context +func (_e *LoopRelayAdapter_Expecter) Start(_a0 interface{}) *LoopRelayAdapter_Start_Call { + return &LoopRelayAdapter_Start_Call{Call: _e.mock.On("Start", _a0)} +} + +func (_c *LoopRelayAdapter_Start_Call) Run(run func(_a0 context.Context)) *LoopRelayAdapter_Start_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *LoopRelayAdapter_Start_Call) Return(_a0 error) *LoopRelayAdapter_Start_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *LoopRelayAdapter_Start_Call) RunAndReturn(run func(context.Context) error) *LoopRelayAdapter_Start_Call { + _c.Call.Return(run) + return _c +} + // Transact provides a mock function with given fields: ctx, from, to, amount, balanceCheck func (_m *LoopRelayAdapter) Transact(ctx context.Context, from string, to string, amount *big.Int, balanceCheck bool) error { ret := _m.Called(ctx, from, to, amount, balanceCheck) @@ -370,6 +802,38 @@ func (_m *LoopRelayAdapter) Transact(ctx context.Context, from string, to string return r0 } +// LoopRelayAdapter_Transact_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Transact' +type LoopRelayAdapter_Transact_Call struct { + *mock.Call +} + +// Transact is a helper method to define mock.On call +// - ctx context.Context +// - from string +// - to string +// - amount *big.Int +// - balanceCheck bool +func (_e *LoopRelayAdapter_Expecter) Transact(ctx interface{}, from interface{}, to interface{}, amount interface{}, balanceCheck interface{}) *LoopRelayAdapter_Transact_Call { + return &LoopRelayAdapter_Transact_Call{Call: _e.mock.On("Transact", ctx, from, to, amount, balanceCheck)} +} + +func (_c *LoopRelayAdapter_Transact_Call) Run(run func(ctx context.Context, from string, to string, amount *big.Int, balanceCheck bool)) *LoopRelayAdapter_Transact_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string), args[3].(*big.Int), args[4].(bool)) + }) + return _c +} + +func (_c *LoopRelayAdapter_Transact_Call) Return(_a0 error) *LoopRelayAdapter_Transact_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *LoopRelayAdapter_Transact_Call) RunAndReturn(run func(context.Context, string, string, *big.Int, bool) error) *LoopRelayAdapter_Transact_Call { + _c.Call.Return(run) + return _c +} + // NewLoopRelayAdapter creates a new instance of LoopRelayAdapter. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewLoopRelayAdapter(t interface { diff --git a/core/services/relay/evm/mocks/request_round_db.go b/core/services/relay/evm/mocks/request_round_db.go index 07d02af533e..587edfa34a5 100644 --- a/core/services/relay/evm/mocks/request_round_db.go +++ b/core/services/relay/evm/mocks/request_round_db.go @@ -18,6 +18,14 @@ type RequestRoundDB struct { mock.Mock } +type RequestRoundDB_Expecter struct { + mock *mock.Mock +} + +func (_m *RequestRoundDB) EXPECT() *RequestRoundDB_Expecter { + return &RequestRoundDB_Expecter{mock: &_m.Mock} +} + // LoadLatestRoundRequested provides a mock function with given fields: _a0 func (_m *RequestRoundDB) LoadLatestRoundRequested(_a0 context.Context) (ocr2aggregator.OCR2AggregatorRoundRequested, error) { ret := _m.Called(_a0) @@ -46,6 +54,34 @@ func (_m *RequestRoundDB) LoadLatestRoundRequested(_a0 context.Context) (ocr2agg return r0, r1 } +// RequestRoundDB_LoadLatestRoundRequested_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LoadLatestRoundRequested' +type RequestRoundDB_LoadLatestRoundRequested_Call struct { + *mock.Call +} + +// LoadLatestRoundRequested is a helper method to define mock.On call +// - _a0 context.Context +func (_e *RequestRoundDB_Expecter) LoadLatestRoundRequested(_a0 interface{}) *RequestRoundDB_LoadLatestRoundRequested_Call { + return &RequestRoundDB_LoadLatestRoundRequested_Call{Call: _e.mock.On("LoadLatestRoundRequested", _a0)} +} + +func (_c *RequestRoundDB_LoadLatestRoundRequested_Call) Run(run func(_a0 context.Context)) *RequestRoundDB_LoadLatestRoundRequested_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *RequestRoundDB_LoadLatestRoundRequested_Call) Return(rr ocr2aggregator.OCR2AggregatorRoundRequested, err error) *RequestRoundDB_LoadLatestRoundRequested_Call { + _c.Call.Return(rr, err) + return _c +} + +func (_c *RequestRoundDB_LoadLatestRoundRequested_Call) RunAndReturn(run func(context.Context) (ocr2aggregator.OCR2AggregatorRoundRequested, error)) *RequestRoundDB_LoadLatestRoundRequested_Call { + _c.Call.Return(run) + return _c +} + // SaveLatestRoundRequested provides a mock function with given fields: ctx, rr func (_m *RequestRoundDB) SaveLatestRoundRequested(ctx context.Context, rr ocr2aggregator.OCR2AggregatorRoundRequested) error { ret := _m.Called(ctx, rr) @@ -64,6 +100,35 @@ func (_m *RequestRoundDB) SaveLatestRoundRequested(ctx context.Context, rr ocr2a return r0 } +// RequestRoundDB_SaveLatestRoundRequested_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SaveLatestRoundRequested' +type RequestRoundDB_SaveLatestRoundRequested_Call struct { + *mock.Call +} + +// SaveLatestRoundRequested is a helper method to define mock.On call +// - ctx context.Context +// - rr ocr2aggregator.OCR2AggregatorRoundRequested +func (_e *RequestRoundDB_Expecter) SaveLatestRoundRequested(ctx interface{}, rr interface{}) *RequestRoundDB_SaveLatestRoundRequested_Call { + return &RequestRoundDB_SaveLatestRoundRequested_Call{Call: _e.mock.On("SaveLatestRoundRequested", ctx, rr)} +} + +func (_c *RequestRoundDB_SaveLatestRoundRequested_Call) Run(run func(ctx context.Context, rr ocr2aggregator.OCR2AggregatorRoundRequested)) *RequestRoundDB_SaveLatestRoundRequested_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(ocr2aggregator.OCR2AggregatorRoundRequested)) + }) + return _c +} + +func (_c *RequestRoundDB_SaveLatestRoundRequested_Call) Return(_a0 error) *RequestRoundDB_SaveLatestRoundRequested_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *RequestRoundDB_SaveLatestRoundRequested_Call) RunAndReturn(run func(context.Context, ocr2aggregator.OCR2AggregatorRoundRequested) error) *RequestRoundDB_SaveLatestRoundRequested_Call { + _c.Call.Return(run) + return _c +} + // WithDataSource provides a mock function with given fields: _a0 func (_m *RequestRoundDB) WithDataSource(_a0 sqlutil.DataSource) evm.RequestRoundDB { ret := _m.Called(_a0) @@ -84,6 +149,34 @@ func (_m *RequestRoundDB) WithDataSource(_a0 sqlutil.DataSource) evm.RequestRoun return r0 } +// RequestRoundDB_WithDataSource_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WithDataSource' +type RequestRoundDB_WithDataSource_Call struct { + *mock.Call +} + +// WithDataSource is a helper method to define mock.On call +// - _a0 sqlutil.DataSource +func (_e *RequestRoundDB_Expecter) WithDataSource(_a0 interface{}) *RequestRoundDB_WithDataSource_Call { + return &RequestRoundDB_WithDataSource_Call{Call: _e.mock.On("WithDataSource", _a0)} +} + +func (_c *RequestRoundDB_WithDataSource_Call) Run(run func(_a0 sqlutil.DataSource)) *RequestRoundDB_WithDataSource_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(sqlutil.DataSource)) + }) + return _c +} + +func (_c *RequestRoundDB_WithDataSource_Call) Return(_a0 evm.RequestRoundDB) *RequestRoundDB_WithDataSource_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *RequestRoundDB_WithDataSource_Call) RunAndReturn(run func(sqlutil.DataSource) evm.RequestRoundDB) *RequestRoundDB_WithDataSource_Call { + _c.Call.Return(run) + return _c +} + // NewRequestRoundDB creates a new instance of RequestRoundDB. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewRequestRoundDB(t interface { diff --git a/core/services/relay/evm/ocr2keeper.go b/core/services/relay/evm/ocr2keeper.go index b2d19c11702..625ee71c182 100644 --- a/core/services/relay/evm/ocr2keeper.go +++ b/core/services/relay/evm/ocr2keeper.go @@ -13,6 +13,7 @@ import ( ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" "github.com/smartcontractkit/chainlink-automation/pkg/v3/plugin" + "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink-common/pkg/sqlutil" commontypes "github.com/smartcontractkit/chainlink-common/pkg/types" "github.com/smartcontractkit/chainlink-common/pkg/types/automation" @@ -20,7 +21,6 @@ import ( evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" "github.com/smartcontractkit/chainlink/v2/core/chains/legacyevm" ac "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/i_automation_v21_plus_common" - "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/keystore" evm "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/encoding" @@ -196,7 +196,7 @@ func (c *ocr2keeperProvider) ContractTransmitter() ocrtypes.ContractTransmitter return c.contractTransmitter } -func (c *ocr2keeperProvider) ChainReader() commontypes.ContractReader { +func (c *ocr2keeperProvider) ContractReader() commontypes.ContractReader { return nil } @@ -218,7 +218,7 @@ func newOCR2KeeperConfigProvider(ctx context.Context, lggr logger.Logger, chain configPoller, err := NewConfigPoller( ctx, - lggr.With("contractID", rargs.ContractID), + logger.With(lggr, "contractID", rargs.ContractID), CPConfig{ chain.Client(), chain.LogPoller(), diff --git a/core/services/relay/evm/ocr3_capability_provider.go b/core/services/relay/evm/ocr3_capability_provider.go index 2080e1df873..ca41466570c 100644 --- a/core/services/relay/evm/ocr3_capability_provider.go +++ b/core/services/relay/evm/ocr3_capability_provider.go @@ -1,9 +1,23 @@ package evm import ( + "encoding/hex" + "fmt" + + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/common" "github.com/smartcontractkit/libocr/offchainreporting2plus/ocr3types" + ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" "github.com/smartcontractkit/chainlink-common/pkg/types" + + "math/big" + "strings" + + "github.com/ethereum/go-ethereum/crypto" + + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/ocr3_capability" + "github.com/smartcontractkit/chainlink/v2/core/services/ocrcommon" ) type ocr3CapabilityProvider struct { @@ -14,3 +28,181 @@ type ocr3CapabilityProvider struct { func (o *ocr3CapabilityProvider) OCR3ContractTransmitter() ocr3types.ContractTransmitter[[]byte] { return o.transmitter } + +var _ LogDecoder = &ocr3CapabilityLogDecoder{} + +type ocr3CapabilityLogDecoder struct { + eventName string + eventSig common.Hash + abi *abi.ABI +} + +// Modified newOCR2AggregatorLogDecoder to use OCR3Capability ABI +func newOCR3CapabilityLogDecoder() (*ocr3CapabilityLogDecoder, error) { + const eventName = "ConfigSet" + abi, err := ocr3_capability.OCR3CapabilityMetaData.GetAbi() + if err != nil { + return nil, err + } + return &ocr3CapabilityLogDecoder{ + eventName: eventName, + eventSig: abi.Events[eventName].ID, + abi: abi, + }, nil +} + +func (d *ocr3CapabilityLogDecoder) Decode(rawLog []byte) (ocrtypes.ContractConfig, error) { + unpacked := new(ocr3_capability.OCR3CapabilityConfigSet) + err := d.abi.UnpackIntoInterface(unpacked, d.eventName, rawLog) + if err != nil { + return ocrtypes.ContractConfig{}, fmt.Errorf("failed to unpack log data: %w", err) + } + + var transmitAccounts []ocrtypes.Account + for _, addr := range unpacked.Transmitters { + transmitAccounts = append(transmitAccounts, ocrtypes.Account(addr.Hex())) + } + var signers []ocrtypes.OnchainPublicKey + allPubKeys := map[string]any{} + for _, pubKey := range unpacked.Signers { + pubKey := pubKey + + // validate uniqueness of each individual key + pubKeys, err := ocrcommon.UnmarshalMultichainPublicKey(pubKey) + if err != nil { + return ocrtypes.ContractConfig{}, err + } + for _, key := range pubKeys { + raw := hex.EncodeToString(key) + _, exists := allPubKeys[raw] + if exists { + return ocrtypes.ContractConfig{}, fmt.Errorf("Duplicate onchain public key: %v", raw) + } + allPubKeys[raw] = struct{}{} + } + + signers = append(signers, pubKey[:]) + } + + return ocrtypes.ContractConfig{ + ConfigDigest: unpacked.ConfigDigest, + ConfigCount: unpacked.ConfigCount, + Signers: signers, + Transmitters: transmitAccounts, + F: unpacked.F, + OnchainConfig: unpacked.OnchainConfig, + OffchainConfigVersion: unpacked.OffchainConfigVersion, + OffchainConfig: unpacked.OffchainConfig, + }, nil +} + +func (d *ocr3CapabilityLogDecoder) EventSig() common.Hash { + return d.eventSig +} + +var _ ocrtypes.OffchainConfigDigester = OCR3CapabilityOffchainConfigDigester{} + +// EVMOffchainConfigDigester forked to not assume signers are 20 byte addresses +type OCR3CapabilityOffchainConfigDigester struct { + ChainID uint64 + ContractAddress common.Address +} + +func (d OCR3CapabilityOffchainConfigDigester) ConfigDigest(cc ocrtypes.ContractConfig) (ocrtypes.ConfigDigest, error) { + signers := [][]byte{} + for _, signer := range cc.Signers { + signers = append(signers, signer) + } + transmitters := []common.Address{} + for i, transmitter := range cc.Transmitters { + if !strings.HasPrefix(string(transmitter), "0x") || len(transmitter) != 42 || !common.IsHexAddress(string(transmitter)) { + return ocrtypes.ConfigDigest{}, fmt.Errorf("%v-th evm transmitter should be a 42 character Ethereum address string, but got '%v'", i, transmitter) + } + a := common.HexToAddress(string(transmitter)) + transmitters = append(transmitters, a) + } + + return ocr3CapabilityConfigDigest( + d.ChainID, + d.ContractAddress, + cc.ConfigCount, + signers, + transmitters, + cc.F, + cc.OnchainConfig, + cc.OffchainConfigVersion, + cc.OffchainConfig, + ), nil +} + +const ConfigDigestPrefixKeystoneOCR3Capability ocrtypes.ConfigDigestPrefix = 0x000e + +func (d OCR3CapabilityOffchainConfigDigester) ConfigDigestPrefix() (ocrtypes.ConfigDigestPrefix, error) { + return ConfigDigestPrefixKeystoneOCR3Capability, nil +} + +func makeOCR3CapabilityConfigDigestArgs() abi.Arguments { + mustNewType := func(t string) abi.Type { + result, err := abi.NewType(t, "", []abi.ArgumentMarshaling{}) + if err != nil { + panic(fmt.Sprintf("Unexpected error during abi.NewType: %s", err)) + } + return result + } + return abi.Arguments([]abi.Argument{ + {Name: "chainId", Type: mustNewType("uint256")}, + {Name: "contractAddress", Type: mustNewType("address")}, + {Name: "configCount", Type: mustNewType("uint64")}, + {Name: "signers", Type: mustNewType("bytes[]")}, + {Name: "transmitters", Type: mustNewType("address[]")}, + {Name: "f", Type: mustNewType("uint8")}, + {Name: "onchainConfig", Type: mustNewType("bytes")}, + {Name: "encodedConfigVersion", Type: mustNewType("uint64")}, + {Name: "encodedConfig", Type: mustNewType("bytes")}, + }) +} + +var ocr3CapabilityConfigDigestArgs = makeOCR3CapabilityConfigDigestArgs() + +func ocr3CapabilityConfigDigest( + chainID uint64, + contractAddress common.Address, + configCount uint64, + oracles [][]byte, + transmitters []common.Address, + f uint8, + onchainConfig []byte, + offchainConfigVersion uint64, + offchainConfig []byte, +) ocrtypes.ConfigDigest { + chainIDBig := new(big.Int) + chainIDBig.SetUint64(chainID) + msg, err := ocr3CapabilityConfigDigestArgs.Pack( + chainIDBig, + contractAddress, + configCount, + oracles, + transmitters, + f, + onchainConfig, + offchainConfigVersion, + offchainConfig, + ) + if err != nil { + // assertion + panic(err) + } + rawHash := crypto.Keccak256(msg) + configDigest := ocrtypes.ConfigDigest{} + if n := copy(configDigest[:], rawHash); n != len(configDigest) { + // assertion + panic("copy too little data") + } + if ConfigDigestPrefixKeystoneOCR3Capability != 0x000e { + // assertion + panic("wrong ConfigDigestPrefix") + } + configDigest[0] = 0 + configDigest[1] = 0x0e + return configDigest +} diff --git a/core/services/relay/evm/parsed_types.go b/core/services/relay/evm/parsed_types.go deleted file mode 100644 index 168057e998d..00000000000 --- a/core/services/relay/evm/parsed_types.go +++ /dev/null @@ -1,50 +0,0 @@ -package evm - -import ( - "fmt" - "reflect" - - "github.com/smartcontractkit/chainlink-common/pkg/codec" - commontypes "github.com/smartcontractkit/chainlink-common/pkg/types" - - "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/types" -) - -type parsedTypes struct { - encoderDefs map[string]types.CodecEntry - decoderDefs map[string]types.CodecEntry -} - -func (parsed *parsedTypes) toCodec() (commontypes.RemoteCodec, error) { - modByTypeName := map[string]codec.Modifier{} - if err := addEntries(parsed.encoderDefs, modByTypeName); err != nil { - return nil, err - } - if err := addEntries(parsed.decoderDefs, modByTypeName); err != nil { - return nil, err - } - - mod, err := codec.NewByItemTypeModifier(modByTypeName) - if err != nil { - return nil, err - } - underlying := &evmCodec{ - encoder: &encoder{Definitions: parsed.encoderDefs}, - decoder: &decoder{Definitions: parsed.decoderDefs}, - parsedTypes: parsed, - } - return codec.NewModifierCodec(underlying, mod, evmDecoderHooks...) -} - -// addEntries extracts the mods from codecEntry and adds them to modByTypeName use with codec.NewByItemTypeModifier -// Since each input/output can have its own modifications, we need to keep track of them by type name -func addEntries(defs map[string]types.CodecEntry, modByTypeName map[string]codec.Modifier) error { - for k, def := range defs { - modByTypeName[k] = def.Modifier() - _, err := def.Modifier().RetypeToOffChain(reflect.PointerTo(def.CheckedType()), k) - if err != nil { - return fmt.Errorf("%w: cannot retype %v: %w", commontypes.ErrInvalidConfig, k, err) - } - } - return nil -} diff --git a/core/services/relay/evm/plugin_provider.go b/core/services/relay/evm/plugin_provider.go index ffcea48db2c..b8ce56ff12f 100644 --- a/core/services/relay/evm/plugin_provider.go +++ b/core/services/relay/evm/plugin_provider.go @@ -5,17 +5,16 @@ import ( ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" + "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink-common/pkg/services" "github.com/smartcontractkit/chainlink-common/pkg/types" - - "github.com/smartcontractkit/chainlink/v2/core/logger" ) type pluginProvider struct { services.Service - chainReader types.ContractReader + chainReader ChainReaderService codec types.Codec - contractTransmitter ocrtypes.ContractTransmitter + contractTransmitter ContractTransmitter configWatcher *configWatcher lggr logger.Logger ms services.MultiStart @@ -24,9 +23,9 @@ type pluginProvider struct { var _ types.PluginProvider = (*pluginProvider)(nil) func NewPluginProvider( - chainReader types.ContractReader, + chainReader ChainReaderService, codec types.Codec, - contractTransmitter ocrtypes.ContractTransmitter, + contractTransmitter ContractTransmitter, configWatcher *configWatcher, lggr logger.Logger, ) *pluginProvider { @@ -47,6 +46,10 @@ func (p *pluginProvider) Ready() error { return nil } func (p *pluginProvider) HealthReport() map[string]error { hp := map[string]error{p.Name(): p.Ready()} services.CopyHealth(hp, p.configWatcher.HealthReport()) + services.CopyHealth(hp, p.contractTransmitter.HealthReport()) + if p.chainReader != nil { + services.CopyHealth(hp, p.chainReader.HealthReport()) + } return hp } @@ -62,7 +65,7 @@ func (p *pluginProvider) ContractConfigTracker() ocrtypes.ContractConfigTracker return p.configWatcher.configPoller } -func (p *pluginProvider) ChainReader() types.ContractReader { +func (p *pluginProvider) ContractReader() types.ContractReader { return p.chainReader } @@ -71,9 +74,14 @@ func (p *pluginProvider) Codec() types.Codec { } func (p *pluginProvider) Start(ctx context.Context) error { - return p.configWatcher.Start(ctx) + srvcs := []services.StartClose{p.configWatcher, p.contractTransmitter} + if p.chainReader != nil { + srvcs = append(srvcs, p.chainReader) + } + + return p.ms.Start(ctx, srvcs...) } func (p *pluginProvider) Close() error { - return p.configWatcher.Close() + return p.ms.Close() } diff --git a/core/services/relay/evm/read/batch.go b/core/services/relay/evm/read/batch.go new file mode 100644 index 00000000000..1d72e222963 --- /dev/null +++ b/core/services/relay/evm/read/batch.go @@ -0,0 +1,317 @@ +package read + +import ( + "context" + "fmt" + "math/big" + + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/rpc" + "github.com/pkg/errors" + "golang.org/x/sync/errgroup" + + "github.com/smartcontractkit/chainlink-common/pkg/logger" + "github.com/smartcontractkit/chainlink-common/pkg/types" + "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/codec" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" +) + +var errEmptyOutput = errors.New("rpc call output is empty (make sure that the contract method exists and rpc is healthy)") + +const ( + // DefaultRpcBatchSizeLimit defines the maximum number of rpc requests to be included in a batch. + DefaultRpcBatchSizeLimit = 100 + + // DefaultRpcBatchBackOffMultiplier defines the rate of reducing the batch size limit for retried calls. + // For example if limit is 20 and multiplier is 4: + // 1. 20 + // 2. 20/4 = 5 + // 3. 5/4 = 1 + DefaultRpcBatchBackOffMultiplier = 5 + + // DefaultMaxParallelRpcCalls defines the default maximum number of individual in-parallel rpc calls. + DefaultMaxParallelRpcCalls = 10 +) + +// BatchResult is organised by contracts names, key is contract name. +type BatchResult map[string]ContractResults +type ContractResults []MethodCallResult +type MethodCallResult struct { + Address string + MethodName string + ReturnValue any + Err error +} + +type BatchCall []Call +type Call struct { + ContractAddress common.Address + ContractName, MethodName string + Params, ReturnVal any +} + +func (c BatchCall) String() string { + callString := "" + for _, call := range c { + callString += fmt.Sprintf("%s\n", call.String()) + } + return callString +} + +// Implement the String method for the Call struct +func (c Call) String() string { + return fmt.Sprintf("contractAddress: %s, contractName: %s, method: %s, params: %+v returnValType: %T", + c.ContractAddress.Hex(), c.ContractName, c.MethodName, c.Params, c.ReturnVal) +} + +type BatchCaller interface { + // BatchCall executes all the provided BatchRequest and returns the results in the same order + // of the calls. Pass blockNumber=0 to use the latest block. + BatchCall(ctx context.Context, blockNumber uint64, batchRequests BatchCall) (BatchResult, error) +} + +// dynamicLimitedBatchCaller makes batched rpc calls and perform retries by reducing the batch size on each retry. +type dynamicLimitedBatchCaller struct { + bc *defaultEvmBatchCaller +} + +func NewDynamicLimitedBatchCaller(lggr logger.Logger, codec types.Codec, evmClient client.Client, batchSizeLimit, backOffMultiplier, parallelRpcCallsLimit uint) BatchCaller { + return &dynamicLimitedBatchCaller{ + bc: newDefaultEvmBatchCaller(lggr, evmClient, codec, batchSizeLimit, backOffMultiplier, parallelRpcCallsLimit), + } +} + +func (c *dynamicLimitedBatchCaller) BatchCall(ctx context.Context, blockNumber uint64, reqs BatchCall) (BatchResult, error) { + return c.bc.batchCallDynamicLimitRetries(ctx, blockNumber, reqs) +} + +type defaultEvmBatchCaller struct { + lggr logger.Logger + evmClient client.Client + codec types.Codec + batchSizeLimit uint + parallelRpcCallsLimit uint + backOffMultiplier uint +} + +// NewDefaultEvmBatchCaller returns a new batch caller instance. +// batchCallLimit defines the maximum number of calls for BatchCallLimit method, pass 0 to keep the default. +// backOffMultiplier defines the back-off strategy for retries on BatchCallDynamicLimitRetries method, pass 0 to keep the default. +func newDefaultEvmBatchCaller( + lggr logger.Logger, evmClient client.Client, codec types.Codec, batchSizeLimit, backOffMultiplier, parallelRpcCallsLimit uint, +) *defaultEvmBatchCaller { + batchSize := uint(DefaultRpcBatchSizeLimit) + if batchSizeLimit > 0 { + batchSize = batchSizeLimit + } + + multiplier := uint(DefaultRpcBatchBackOffMultiplier) + if backOffMultiplier > 0 { + multiplier = backOffMultiplier + } + + parallelRpcCalls := uint(DefaultMaxParallelRpcCalls) + if parallelRpcCallsLimit > 0 { + parallelRpcCalls = parallelRpcCallsLimit + } + + return &defaultEvmBatchCaller{ + lggr: lggr, + evmClient: evmClient, + codec: codec, + batchSizeLimit: batchSize, + parallelRpcCallsLimit: parallelRpcCalls, + backOffMultiplier: multiplier, + } +} + +func (c *defaultEvmBatchCaller) batchCall(ctx context.Context, blockNumber uint64, batchCall BatchCall) ([]dataAndErr, error) { + if len(batchCall) == 0 { + return nil, nil + } + + packedOutputs := make([]string, len(batchCall)) + rpcBatchCalls := make([]rpc.BatchElem, len(batchCall)) + for i, call := range batchCall { + data, err := c.codec.Encode(ctx, call.Params, codec.WrapItemType(call.ContractName, call.MethodName, true)) + if err != nil { + return nil, err + } + + blockNumStr := "latest" + if blockNumber > 0 { + blockNumStr = hexutil.EncodeBig(big.NewInt(0).SetUint64(blockNumber)) + } + + rpcBatchCalls[i] = rpc.BatchElem{ + Method: "eth_call", + Args: []any{ + map[string]interface{}{ + "from": common.Address{}, + "to": call.ContractAddress, + "data": hexutil.Bytes(data), + }, + blockNumStr, + }, + Result: &packedOutputs[i], + } + } + + if err := c.evmClient.BatchCallContext(ctx, rpcBatchCalls); err != nil { + return nil, fmt.Errorf("batch call context: %w", err) + } + + results := make([]dataAndErr, len(batchCall)) + for i, call := range batchCall { + results[i] = dataAndErr{ + address: call.ContractAddress.Hex(), + contractName: call.ContractName, + methodName: call.MethodName, + returnVal: call.ReturnVal, + } + + if rpcBatchCalls[i].Error != nil { + results[i].err = rpcBatchCalls[i].Error + continue + } + + if packedOutputs[i] == "" { + // Some RPCs instead of returning "0x" are returning an empty string. + // We are overriding this behaviour for consistent handling of this scenario. + packedOutputs[i] = "0x" + } + + b, err := hexutil.Decode(packedOutputs[i]) + if err != nil { + return nil, fmt.Errorf("decode result %s: packedOutputs %s: %w", call, packedOutputs[i], err) + } + + if err = c.codec.Decode(ctx, b, call.ReturnVal, codec.WrapItemType(call.ContractName, call.MethodName, false)); err != nil { + if len(b) == 0 { + results[i].err = fmt.Errorf("unpack result %s: %s: %w", call, err.Error(), errEmptyOutput) + } else { + results[i].err = fmt.Errorf("unpack result %s: %w", call, err) + } + continue + } + results[i].returnVal = call.ReturnVal + } + + return results, nil +} + +func (c *defaultEvmBatchCaller) batchCallDynamicLimitRetries(ctx context.Context, blockNumber uint64, calls BatchCall) (BatchResult, error) { + lim := c.batchSizeLimit + // Limit the batch size to the number of calls + if uint(len(calls)) < lim { + lim = uint(len(calls)) + } + for { + results, err := c.batchCallLimit(ctx, blockNumber, calls, lim) + if err == nil { + return results, nil + } + + if lim <= 1 { + return nil, errors.Wrapf(err, "calls %+v", calls) + } + + newLim := lim / c.backOffMultiplier + if newLim == 0 || newLim == lim { + newLim = 1 + } + lim = newLim + c.lggr.Errorf("retrying batch call with %d calls and %d limit that failed with error=%s", + len(calls), lim, err) + } +} + +type dataAndErr struct { + address string + contractName, methodName string + returnVal any + err error +} + +func (c *defaultEvmBatchCaller) batchCallLimit(ctx context.Context, blockNumber uint64, calls BatchCall, batchSizeLimit uint) (BatchResult, error) { + if batchSizeLimit <= 0 { + res, err := c.batchCall(ctx, blockNumber, calls) + return convertToBatchResult(res), err + } + + type job struct { + blockNumber uint64 + calls BatchCall + results []dataAndErr + } + + jobs := make([]job, 0) + for i := 0; i < len(calls); i += int(batchSizeLimit) { + idxFrom := i + idxTo := idxFrom + int(batchSizeLimit) + if idxTo > len(calls) { + idxTo = len(calls) + } + jobs = append(jobs, job{blockNumber: blockNumber, calls: calls[idxFrom:idxTo], results: nil}) + } + + if c.parallelRpcCallsLimit > 1 { + eg := new(errgroup.Group) + eg.SetLimit(int(c.parallelRpcCallsLimit)) + for jobIdx := range jobs { + jobIdx := jobIdx + eg.Go(func() error { + res, err := c.batchCall(ctx, jobs[jobIdx].blockNumber, jobs[jobIdx].calls) + if err != nil { + return err + } + jobs[jobIdx].results = res + return nil + }) + } + if err := eg.Wait(); err != nil { + return nil, err + } + } else { + var err error + for jobIdx := range jobs { + jobs[jobIdx].results, err = c.batchCall(ctx, jobs[jobIdx].blockNumber, jobs[jobIdx].calls) + if err != nil { + return nil, err + } + } + } + + var results []dataAndErr + for _, jb := range jobs { + results = append(results, jb.results...) + } + + return convertToBatchResult(results), nil +} + +func convertToBatchResult(data []dataAndErr) BatchResult { + if data == nil { + return nil + } + + batchResult := make(BatchResult) + for _, d := range data { + methodCall := MethodCallResult{ + Address: d.address, + MethodName: d.methodName, + ReturnValue: d.returnVal, + Err: d.err, + } + + if _, exists := batchResult[d.contractName]; !exists { + batchResult[d.contractName] = ContractResults{} + } + + batchResult[d.contractName] = append(batchResult[d.contractName], methodCall) + } + + return batchResult +} diff --git a/core/services/relay/evm/read/batch_caller_test.go b/core/services/relay/evm/read/batch_caller_test.go new file mode 100644 index 00000000000..4f50bdc6911 --- /dev/null +++ b/core/services/relay/evm/read/batch_caller_test.go @@ -0,0 +1,191 @@ +package read_test + +import ( + "fmt" + "math/big" + "testing" + + "github.com/cometbft/cometbft/libs/rand" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/rpc" + "github.com/pkg/errors" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + "github.com/stretchr/testify/require" + + chainmocks "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client/mocks" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" + "github.com/smartcontractkit/chainlink/v2/core/logger" + "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/codec" + "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mocks" + "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/read" + evmtypes "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/types" +) + +func TestDefaultEvmBatchCaller_BatchCallDynamicLimit(t *testing.T) { + testCases := []struct { + name string + maxBatchSize uint + backOffMultiplier uint + numCalls int + expectedBatchSizesOnEachRetry []int + }{ + { + name: "defaults", + maxBatchSize: read.DefaultRpcBatchSizeLimit, + backOffMultiplier: read.DefaultRpcBatchBackOffMultiplier, + numCalls: 200, + expectedBatchSizesOnEachRetry: []int{100, 20, 4, 1}, + }, + { + name: "base simple scenario", + maxBatchSize: 20, + backOffMultiplier: 2, + numCalls: 100, + expectedBatchSizesOnEachRetry: []int{20, 10, 5, 2, 1}, + }, + { + name: "remainder", + maxBatchSize: 99, + backOffMultiplier: 5, + numCalls: 100, + expectedBatchSizesOnEachRetry: []int{99, 19, 3, 1}, + }, + { + name: "large back off multiplier", + maxBatchSize: 20, + backOffMultiplier: 18, + numCalls: 100, + expectedBatchSizesOnEachRetry: []int{20, 1}, + }, + { + name: "back off equal to batch size", + maxBatchSize: 20, + backOffMultiplier: 20, + numCalls: 100, + expectedBatchSizesOnEachRetry: []int{20, 1}, + }, + { + name: "back off larger than batch size", + maxBatchSize: 20, + backOffMultiplier: 220, + numCalls: 100, + expectedBatchSizesOnEachRetry: []int{20, 1}, + }, + { + name: "back off 1", + maxBatchSize: 20, + backOffMultiplier: 1, + numCalls: 100, + expectedBatchSizesOnEachRetry: []int{20, 1}, + }, + } + + mockCodec := mocks.NewCodec(t) + mockCodec.On("Encode", mock.Anything, mock.Anything, mock.Anything).Return([]byte{}, nil) + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + batchSizes := make([]int, 0) + ec := chainmocks.NewClient(t) + ec.On("BatchCallContext", mock.Anything, mock.Anything).Run(func(args mock.Arguments) { + evmCalls := args.Get(1).([]rpc.BatchElem) + batchSizes = append(batchSizes, len(evmCalls)) + }).Return(errors.New("some error")) + + calls := make(read.BatchCall, tc.numCalls) + for i := range calls { + calls[i] = read.Call{} + } + + bc := read.NewDynamicLimitedBatchCaller(logger.TestLogger(t), mockCodec, ec, tc.maxBatchSize, tc.backOffMultiplier, 1) + _, _ = bc.BatchCall(testutils.Context(t), 123, calls) + assert.Equal(t, tc.expectedBatchSizesOnEachRetry, batchSizes) + }) + } +} + +func TestDefaultEvmBatchCaller_batchCallLimit(t *testing.T) { + ctx := testutils.Context(t) + testCases := []struct { + numCalls uint + batchSize uint + parallelRpcCallsLimit uint + }{ + {numCalls: 100, batchSize: 10, parallelRpcCallsLimit: 5}, + {numCalls: 10, batchSize: 100, parallelRpcCallsLimit: 10}, + {numCalls: 1, batchSize: 100, parallelRpcCallsLimit: 10}, + {numCalls: 1000, batchSize: 10, parallelRpcCallsLimit: 2}, + {numCalls: rand.Uint() % 1000, batchSize: rand.Uint() % 500, parallelRpcCallsLimit: rand.Uint() % 500}, + } + + type MethodParam struct { + A uint64 + } + type MethodReturn struct { + B uint64 + } + paramABI := `[{"type":"uint64","name":"A"}]` + returnABI := `[{"type":"uint64","name":"B"}]` + codecConfig := evmtypes.CodecConfig{Configs: map[string]evmtypes.ChainCodecConfig{}} + + for i, tc := range testCases { + t.Run(fmt.Sprintf("%v", tc), func(t *testing.T) { + ec := chainmocks.NewClient(t) + calls := make(read.BatchCall, tc.numCalls) + for j := range calls { + contractName := fmt.Sprintf("testCase_%d", i) + methodName := fmt.Sprintf("method_%d", j) + codecConfig.Configs[fmt.Sprintf("params.%s.%s", contractName, methodName)] = evmtypes.ChainCodecConfig{TypeABI: paramABI} + codecConfig.Configs[fmt.Sprintf("return.%s.%s", contractName, methodName)] = evmtypes.ChainCodecConfig{TypeABI: returnABI} + + params := MethodParam{A: uint64(j)} + var returnVal MethodReturn + calls[j] = read.Call{ + ContractName: contractName, + MethodName: methodName, + Params: ¶ms, + ReturnVal: &returnVal, + } + } + + ec.On("BatchCallContext", mock.Anything, mock.Anything). + Run(func(args mock.Arguments) { + evmCalls := args.Get(1).([]rpc.BatchElem) + for i := range evmCalls { + arg := evmCalls[i].Args[0].(map[string]interface{})["data"].(hexutil.Bytes) + str, isOk := evmCalls[i].Result.(*string) + require.True(t, isOk) + *str = fmt.Sprintf("0x%064x", new(big.Int).SetBytes(arg[24:]).Uint64()) + } + }).Return(nil) + + testCodec, err := codec.NewCodec(codecConfig) + require.NoError(t, err) + bc := read.NewDynamicLimitedBatchCaller(logger.TestLogger(t), testCodec, ec, tc.batchSize, 99999, tc.parallelRpcCallsLimit) + + // make the call and make sure the results are there + results, err := bc.BatchCall(ctx, 0, calls) + require.NoError(t, err) + for _, call := range calls { + contractResults, ok := results[call.ContractName] + if !ok { + t.Errorf("missing contract name %s", call.ContractName) + } + hasResult := false + for j, result := range contractResults { + if hasResult = result.MethodName == call.MethodName; hasResult { + require.NoError(t, result.Err) + resNum, isOk := result.ReturnValue.(*MethodReturn) + require.True(t, isOk) + require.Equal(t, uint64(j), resNum.B) + break + } + } + if !hasResult { + t.Errorf("missing method name %s", call.MethodName) + } + } + }) + } +} diff --git a/core/services/relay/evm/read/bindings.go b/core/services/relay/evm/read/bindings.go new file mode 100644 index 00000000000..55f237af0eb --- /dev/null +++ b/core/services/relay/evm/read/bindings.go @@ -0,0 +1,296 @@ +package read + +import ( + "context" + "errors" + "fmt" + "strings" + "sync" + + "github.com/ethereum/go-ethereum/common" + + commontypes "github.com/smartcontractkit/chainlink-common/pkg/types" + "github.com/smartcontractkit/chainlink-common/pkg/types/query" + "github.com/smartcontractkit/chainlink-common/pkg/types/query/primitives" + "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/codec" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" + evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" +) + +type Reader interface { + BatchCall(address common.Address, params, retVal any) (Call, error) + GetLatestValue(ctx context.Context, addr common.Address, confidence primitives.ConfidenceLevel, params, returnVal any) error + QueryKey(context.Context, common.Address, query.KeyFilter, query.LimitAndSort, any) ([]commontypes.Sequence, error) + + Bind(context.Context, ...common.Address) error + Unbind(context.Context, ...common.Address) error + SetCodec(commontypes.RemoteCodec) + + Register(context.Context) error + Unregister(context.Context) error +} + +type BindingsRegistry struct { + // dependencies + batch BatchCaller + + // private state + mu sync.RWMutex + contractBindings map[string]*contractBinding + contractLookup *lookup +} + +func NewBindingsRegistry() *BindingsRegistry { + return &BindingsRegistry{ + contractBindings: make(map[string]*contractBinding), + contractLookup: newLookup(), + } +} + +func (b *BindingsRegistry) SetBatchCaller(caller BatchCaller) { + b.mu.Lock() + defer b.mu.Unlock() + + b.batch = caller +} + +func (b *BindingsRegistry) HasContractBinding(contractName string) bool { + b.mu.RLock() + defer b.mu.RUnlock() + + _, ok := b.contractBindings[contractName] + + return ok +} + +// GetReader should only be called after Chain Reader is started. +func (b *BindingsRegistry) GetReader(readName string) (Reader, string, error) { + b.mu.RLock() + defer b.mu.RUnlock() + + values, ok := b.contractLookup.getContractForReadName(readName) + if !ok { + return nil, "", fmt.Errorf("%w: no reader for read name %s", commontypes.ErrInvalidType, readName) + } + + cb, cbExists := b.contractBindings[values.contract] + if !cbExists { + return nil, "", fmt.Errorf("%w: no contract named %s", commontypes.ErrInvalidType, values.contract) + } + + binding, rbExists := cb.GetReaderNamed(values.readName) + if !rbExists { + return nil, "", fmt.Errorf("%w: no reader named %s in contract %s", commontypes.ErrInvalidType, values.readName, values.contract) + } + + return binding, values.address, nil +} + +func (b *BindingsRegistry) AddReader(contractName, readName string, rdr Reader) error { + b.mu.Lock() + defer b.mu.Unlock() + + switch v := rdr.(type) { + case *EventBinding: + // unwrap codec type naming for event data words and topics to be used by lookup for Querying by Value Comparators + // For e.g. "params.contractName.eventName.IndexedTopic" -> "eventName.IndexedTopic" + // or "params.contractName.eventName.someFieldInData" -> "eventName.someFieldInData" + for name := range v.eventTypes { + split := strings.Split(name, ".") + if len(split) < 3 || split[1] != contractName { + return fmt.Errorf("invalid event type name %s", name) + } + b.contractLookup.addReadNameForContract(contractName, strings.Join(split[2:], ".")) + } + } + + b.contractLookup.addReadNameForContract(contractName, readName) + + cb, cbExists := b.contractBindings[contractName] + if !cbExists { + cb = newContractBinding(contractName) + b.contractBindings[contractName] = cb + } + + cb.AddReaderNamed(readName, rdr) + return nil +} + +// Bind binds contract addresses to contract bindings and read bindings. +// Bind also registers the common contract polling filter and eventBindings polling filters. +func (b *BindingsRegistry) Bind(ctx context.Context, reg Registrar, bindings []commontypes.BoundContract) error { + b.mu.RLock() + defer b.mu.RUnlock() + + for _, binding := range bindings { + contract, exists := b.contractBindings[binding.Name] + if !exists { + return fmt.Errorf("%w: no contract named %s", commontypes.ErrInvalidConfig, binding.Name) + } + + b.contractLookup.bindAddressForContract(binding.Name, binding.Address) + + if err := errors.Join( + contract.Bind(ctx, reg, common.HexToAddress(binding.Address)), + contract.BindReaders(ctx, common.HexToAddress(binding.Address)), + ); err != nil { + return err + } + } + + return nil +} + +func (b *BindingsRegistry) BatchGetLatestValues(ctx context.Context, request commontypes.BatchGetLatestValuesRequest) (commontypes.BatchGetLatestValuesResult, error) { + b.mu.RLock() + defer b.mu.RUnlock() + + var batchCall BatchCall + + for binding, contractBatch := range request { + cb := b.contractBindings[binding.Name] + + for i := range contractBatch { + req := contractBatch[i] + + values, ok := b.contractLookup.getContractForReadName(binding.ReadIdentifier(req.ReadName)) + if !ok { + return nil, fmt.Errorf("%w: no method for read name %s", commontypes.ErrInvalidType, binding.ReadIdentifier(req.ReadName)) + } + + rdr, exists := cb.GetReaderNamed(values.readName) + if !exists { + return nil, fmt.Errorf("%w: no contract read binding for %s", commontypes.ErrInvalidType, values.readName) + } + + call, err := rdr.BatchCall(common.HexToAddress(values.address), req.Params, req.ReturnVal) + if err != nil { + return nil, err + } + + batchCall = append(batchCall, call) + } + } + + results, err := b.batch.BatchCall(ctx, 0, batchCall) + if err != nil { + return nil, err + } + + // reconstruct results from batchCall and filteredLogs into common type while maintaining order from request. + batchGetLatestValuesResults := make(commontypes.BatchGetLatestValuesResult) + for contractName, contractResult := range results { + for _, methodResult := range contractResult { + binding := commontypes.BoundContract{ + Name: contractName, + Address: methodResult.Address, + } + + brr := commontypes.BatchReadResult{ + ReadName: methodResult.MethodName, + } + + brr.SetResult(methodResult.ReturnValue, methodResult.Err) + + if _, ok := batchGetLatestValuesResults[binding]; !ok { + batchGetLatestValuesResults[binding] = make(commontypes.ContractBatchResults, 0) + } + + batchGetLatestValuesResults[binding] = append(batchGetLatestValuesResults[binding], brr) + } + } + + return batchGetLatestValuesResults, err +} + +// Unbind unbinds contract addresses to contract bindings and read bindings. +func (b *BindingsRegistry) Unbind(ctx context.Context, reg Registrar, bindings []commontypes.BoundContract) error { + b.mu.RLock() + defer b.mu.RUnlock() + + for _, binding := range bindings { + contract, exists := b.contractBindings[binding.Name] + if !exists { + return fmt.Errorf("%w: no contract named %s", commontypes.ErrInvalidConfig, binding.Name) + } + + b.contractLookup.unbindAddressForContract(binding.Name, binding.Address) + + if err := errors.Join( + contract.Unbind(ctx, reg, common.HexToAddress(binding.Address)), + contract.UnbindReaders(ctx, common.HexToAddress(binding.Address)), + ); err != nil { + return err + } + } + + return nil +} + +func (b *BindingsRegistry) RegisterAll(ctx context.Context, reg Registrar) error { + b.mu.RLock() + defer b.mu.RUnlock() + + for _, cb := range b.contractBindings { + if err := errors.Join(cb.RegisterReaders(ctx), cb.Register(ctx, reg)); err != nil { + return err + } + } + + return nil +} + +func (b *BindingsRegistry) UnregisterAll(ctx context.Context, reg Registrar) error { + b.mu.RLock() + defer b.mu.RUnlock() + + for _, cb := range b.contractBindings { + if err := errors.Join(cb.UnregisterReaders(ctx), cb.Unregister(ctx, reg)); err != nil { + return err + } + } + + return nil +} + +func (b *BindingsRegistry) SetCodecAll(codec commontypes.RemoteCodec) { + b.mu.RLock() + defer b.mu.RUnlock() + + for _, cb := range b.contractBindings { + cb.SetCodecAll(codec) + } +} + +func (b *BindingsRegistry) SetFilter(name string, filter logpoller.Filter) error { + b.mu.RLock() + defer b.mu.RUnlock() + + contract, ok := b.contractBindings[name] + if !ok { + return fmt.Errorf("%w: no contract binding for %s", commontypes.ErrInvalidConfig, name) + } + + contract.SetFilter(filter) + + return nil +} + +func (b *BindingsRegistry) ReadTypeIdentifier(readName string, forEncoding bool) string { + values, ok := b.contractLookup.getContractForReadName(readName) + if !ok { + return "" + } + + return codec.WrapItemType(values.contract, values.readName, forEncoding) +} + +// confidenceToConfirmations matches predefined chain agnostic confidence levels to predefined EVM finality. +func confidenceToConfirmations(confirmationsMapping map[primitives.ConfidenceLevel]evmtypes.Confirmations, confidenceLevel primitives.ConfidenceLevel) (evmtypes.Confirmations, error) { + confirmations, exists := confirmationsMapping[confidenceLevel] + if !exists { + return 0, fmt.Errorf("missing mapping for confidence level: %s", confidenceLevel) + } + return confirmations, nil +} diff --git a/core/services/relay/evm/read/bindings_test.go b/core/services/relay/evm/read/bindings_test.go new file mode 100644 index 00000000000..d9cfa91a987 --- /dev/null +++ b/core/services/relay/evm/read/bindings_test.go @@ -0,0 +1,112 @@ +package read_test + +import ( + "context" + "testing" + + "github.com/ethereum/go-ethereum/common" + "github.com/stretchr/testify/mock" + "github.com/stretchr/testify/require" + + commontypes "github.com/smartcontractkit/chainlink-common/pkg/types" + "github.com/smartcontractkit/chainlink-common/pkg/types/query/primitives" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" + "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/read" + "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/read/mocks" +) + +var ( + contractName1 = "Contract1" + methodName1 = "Method1" + methodName2 = "Method2" + eventName0 = "EventName0" + filterWithSigs = logpoller.Filter{ + Name: eventName0, + EventSigs: []common.Hash{common.HexToHash("0x25"), common.HexToHash("0x29")}, + } +) + +func TestBindingsRegistry(t *testing.T) { + t.Parallel() + + t.Run("readers are addable, bindable, and retrievable", func(t *testing.T) { + t.Parallel() + + mBatch := new(mocks.BatchCaller) + mRdr := new(mocks.Reader) + mReg := new(mocks.Registrar) + + mRdr.EXPECT().Bind(mock.Anything, mock.Anything).Return(nil) + + named := read.NewBindingsRegistry() + named.SetBatchCaller(mBatch) + + require.NoError(t, named.AddReader(contractName1, methodName1, mRdr)) + + bindings := []commontypes.BoundContract{{Address: "0x24", Name: contractName1}} + _ = named.Bind(context.Background(), mReg, bindings) + + rdr, _, err := named.GetReader(bindings[0].ReadIdentifier(methodName1)) + + require.NoError(t, err) + require.NotNil(t, rdr) + }) + + t.Run("register all before bind", func(t *testing.T) { + t.Parallel() + + mBatch := new(mocks.BatchCaller) + mRdr0 := new(mocks.Reader) + mRdr1 := new(mocks.Reader) + mReg := new(mocks.Registrar) + + named := read.NewBindingsRegistry() + named.SetBatchCaller(mBatch) + + // register is called once through RegisterAll and again in Bind + mRdr0.EXPECT().Register(mock.Anything).Return(nil) + mRdr1.EXPECT().Register(mock.Anything).Return(nil) + + mRdr0.EXPECT().Bind(mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(nil) + mRdr1.EXPECT().Bind(mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(nil) + + mReg.EXPECT().HasFilter(mock.Anything).Return(false) + mReg.EXPECT().RegisterFilter(mock.Anything, mock.Anything).Return(nil) + mRdr0.EXPECT().GetLatestValue(mock.Anything, common.HexToAddress("0x25"), mock.Anything, mock.Anything, mock.Anything).Return(nil) + mRdr0.EXPECT().GetLatestValue(mock.Anything, common.HexToAddress("0x24"), mock.Anything, mock.Anything, mock.Anything).Return(nil) + mRdr1.EXPECT().GetLatestValue(mock.Anything, common.HexToAddress("0x26"), mock.Anything, mock.Anything, mock.Anything).Return(nil) + + // part of the init phase of chain reader + require.NoError(t, named.AddReader(contractName1, methodName1, mRdr0)) + require.NoError(t, named.AddReader(contractName1, methodName2, mRdr1)) + _ = named.SetFilter(contractName1, filterWithSigs) + + // run within the start phase of chain reader + require.NoError(t, named.RegisterAll(context.Background(), mReg)) + + bindings := []commontypes.BoundContract{ + {Address: "0x24", Name: contractName1}, + {Address: "0x25", Name: contractName1}, + {Address: "0x26", Name: contractName1}, + } + + // calling bind will also call register for each reader + _ = named.Bind(context.Background(), mReg, bindings) + + rdr1, _, err := named.GetReader(bindings[0].ReadIdentifier(methodName1)) + require.NoError(t, err) + + rdr2, _, err := named.GetReader(bindings[0].ReadIdentifier(methodName2)) + require.NoError(t, err) + + require.NoError(t, rdr1.GetLatestValue(context.Background(), common.HexToAddress("0x25"), primitives.Finalized, nil, nil)) + require.NoError(t, rdr1.GetLatestValue(context.Background(), common.HexToAddress("0x24"), primitives.Finalized, nil, nil)) + require.NoError(t, rdr2.GetLatestValue(context.Background(), common.HexToAddress("0x26"), primitives.Finalized, nil, nil)) + + mBatch.AssertExpectations(t) + mRdr0.AssertExpectations(t) + mRdr1.AssertExpectations(t) + mReg.AssertExpectations(t) + }) +} diff --git a/core/services/relay/evm/read/contract.go b/core/services/relay/evm/read/contract.go new file mode 100644 index 00000000000..1b47c9ee870 --- /dev/null +++ b/core/services/relay/evm/read/contract.go @@ -0,0 +1,243 @@ +package read + +import ( + "context" + "errors" + "sync" + + "github.com/ethereum/go-ethereum/common" + "github.com/google/uuid" + + commontypes "github.com/smartcontractkit/chainlink-common/pkg/types" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" +) + +// contractBinding stores read bindings and manages the common contract event filter. +type contractBinding struct { + // filterRegistrar is used to manage polling filter registration for the common contract filter. + // The common contract filter should be used by events that share filtering args. + registrar *syncedFilter + + // registered is used to determine if Register was called during Chain Reader service Start. + // This is done to avoid calling Register while the service is not running because log poller is most likely also not running. + registerCalled bool + + // internal properties + name string + readers map[string]Reader // key is read name method, event or event keys used for queryKey. + bound map[common.Address]bool // bound determines if address is set to the contract binding. + mu sync.RWMutex +} + +func newContractBinding(name string) *contractBinding { + return &contractBinding{ + name: name, + readers: make(map[string]Reader), + bound: make(map[common.Address]bool), + registrar: newSyncedFilter(), + } +} + +// GetReaderNamed returns a reader for the provided contract name. This method is thread safe. +func (cb *contractBinding) GetReaderNamed(name string) (Reader, bool) { + cb.mu.RLock() + defer cb.mu.RUnlock() + + binding, exists := cb.readers[name] + + return binding, exists +} + +// AddReaderNamed adds a new reader to the contract bindings for the provided contract name. This +// method is thread safe. +func (cb *contractBinding) AddReaderNamed(name string, rdr Reader) { + cb.mu.Lock() + defer cb.mu.Unlock() + + cb.readers[name] = rdr +} + +// Bind binds contract addresses to contract binding and registers the common contract polling filter. +func (cb *contractBinding) Bind(ctx context.Context, registrar Registrar, bindings ...common.Address) error { + if cb.isBound() { + if err := cb.Unregister(ctx, registrar); err != nil { + return err + } + } + + for _, binding := range bindings { + if cb.bindingExists(binding) { + continue + } + + cb.registrar.SetName(logpoller.FilterName(cb.name + "." + uuid.NewString())) + cb.registrar.AddAddress(binding) + cb.addBinding(binding) + } + + // registerCalled during ChainReader start + if cb.registered() { + return cb.Register(ctx, registrar) + } + + return nil +} + +func (cb *contractBinding) BindReaders(ctx context.Context, addresses ...common.Address) error { + cb.mu.RLock() + defer cb.mu.RUnlock() + + var err error + + for _, reader := range cb.readers { + err = errors.Join(err, reader.Bind(ctx, addresses...)) + } + + return err +} + +// Unbind unbinds contract addresses from contract binding and unregisters the common contract polling filter. +func (cb *contractBinding) Unbind(ctx context.Context, registrar Registrar, bindings ...common.Address) error { + for _, binding := range bindings { + if !cb.bindingExists(binding) { + continue + } + + cb.registrar.RemoveAddress(binding) + cb.removeBinding(binding) + } + + // we are changing contract address reference, so we need to unregister old filter or re-register existing filter + if cb.registrar.Count() == 0 { + cb.registrar.SetName("") + + return cb.Unregister(ctx, registrar) + } else if cb.registered() { + return cb.Register(ctx, registrar) + } + + return nil +} + +func (cb *contractBinding) UnbindReaders(ctx context.Context, addresses ...common.Address) error { + cb.mu.RLock() + defer cb.mu.RUnlock() + + var err error + + for _, reader := range cb.readers { + err = errors.Join(reader.Unbind(ctx, addresses...)) + } + + return err +} + +func (cb *contractBinding) SetCodecAll(codec commontypes.RemoteCodec) { + cb.mu.RLock() + defer cb.mu.RUnlock() + + for _, binding := range cb.readers { + binding.SetCodec(codec) + } +} + +// Register registers the common contract filter. +func (cb *contractBinding) Register(ctx context.Context, registrar Registrar) error { + cb.setRegistered() + + if !cb.isBound() { + return nil + } + + if cb.registrar.HasEventSigs() { + if err := cb.registrar.Register(ctx, registrar); err != nil { + return err + } + } + + return nil +} + +func (cb *contractBinding) RegisterReaders(ctx context.Context) error { + cb.mu.RLock() + defer cb.mu.RUnlock() + + for _, binding := range cb.readers { + if err := binding.Register(ctx); err != nil { + return err + } + } + + return nil +} + +// Unregister unregisters the common contract filter. +func (cb *contractBinding) Unregister(ctx context.Context, registrar Registrar) error { + if !cb.isBound() { + return nil + } + + return cb.registrar.Unregister(ctx, registrar) +} + +func (cb *contractBinding) UnregisterReaders(ctx context.Context) error { + cb.mu.RLock() + defer cb.mu.RUnlock() + + for _, binding := range cb.readers { + if err := binding.Unregister(ctx); err != nil { + return err + } + } + + return nil +} + +func (cb *contractBinding) SetFilter(filter logpoller.Filter) { + cb.registrar.SetFilter(filter) +} + +func (cb *contractBinding) isBound() bool { + cb.mu.RLock() + defer cb.mu.RUnlock() + + return len(cb.bound) > 0 +} + +func (cb *contractBinding) bindingExists(binding common.Address) bool { + cb.mu.RLock() + defer cb.mu.RUnlock() + + bound, exists := cb.bound[binding] + + return exists && bound +} + +func (cb *contractBinding) addBinding(binding common.Address) { + cb.mu.Lock() + defer cb.mu.Unlock() + + cb.bound[binding] = true +} + +func (cb *contractBinding) removeBinding(binding common.Address) { + cb.mu.Lock() + defer cb.mu.Unlock() + + delete(cb.bound, binding) +} + +func (cb *contractBinding) registered() bool { + cb.mu.RLock() + defer cb.mu.RUnlock() + + return cb.registerCalled +} + +func (cb *contractBinding) setRegistered() { + cb.mu.Lock() + defer cb.mu.Unlock() + + cb.registerCalled = true +} diff --git a/core/services/relay/evm/read/event.go b/core/services/relay/evm/read/event.go new file mode 100644 index 00000000000..a2cf95a2da2 --- /dev/null +++ b/core/services/relay/evm/read/event.go @@ -0,0 +1,708 @@ +package read + +import ( + "context" + "fmt" + "reflect" + "strings" + "sync" + + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/crypto" + "github.com/google/uuid" + + commoncodec "github.com/smartcontractkit/chainlink-common/pkg/codec" + commontypes "github.com/smartcontractkit/chainlink-common/pkg/types" + "github.com/smartcontractkit/chainlink-common/pkg/types/query" + "github.com/smartcontractkit/chainlink-common/pkg/types/query/primitives" + "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/codec" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" + evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" + "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/types" +) + +type EventBinding struct { + // read-only properties + contractName string + eventName string + hash common.Hash + // eventTypes has all the types for GetLatestValue unHashed indexed topics params and for QueryKey data words or unHashed indexed topics value comparators. + eventTypes map[string]types.CodecEntry + // indexedTopicsTypes has type info about hashed indexed topics. + indexedTopicsTypes types.CodecEntry + // eventModifiers only has a modifier for indexed topic filtering, but data words can also be added if needed. + eventModifiers map[string]commoncodec.Modifier + + // dependencies + // filterRegistrar in EventBinding is to be used as an override for lp filter defined in the contract binding. + // If filterRegisterer is nil, this event should be registered with the lp filter defined in the contract binding. + registrar *syncedFilter + registerCalled bool + lp logpoller.LogPoller + + // internal properties / state + codec commontypes.RemoteCodec + bound map[common.Address]bool // bound determines if address is set to the contract binding. + mu sync.RWMutex + // topics map a generic topic name (key) to topic data + topics map[string]TopicDetail + // dataWords key is the generic dataWordNamb. + dataWords map[string]DataWordDetail + confirmationsMapping map[primitives.ConfidenceLevel]evmtypes.Confirmations +} + +func NewEventBinding( + contract, event string, + poller logpoller.LogPoller, + hash common.Hash, + indexedTopicsTypes types.CodecEntry, + confirmations map[primitives.ConfidenceLevel]evmtypes.Confirmations, +) *EventBinding { + return &EventBinding{ + contractName: contract, + eventName: event, + lp: poller, + hash: hash, + indexedTopicsTypes: indexedTopicsTypes, + confirmationsMapping: confirmations, + topics: make(map[string]TopicDetail), + dataWords: make(map[string]DataWordDetail), + bound: make(map[common.Address]bool), + } +} + +type TopicDetail struct { + abi.Argument + Index uint64 +} + +// DataWordDetail contains all the information about a single evm Data word. +// For b.g. first evm data word(32bytes) of USDC log event is uint256 var called valub. +type DataWordDetail struct { + Index int + abi.Argument +} + +var _ Reader = &EventBinding{} + +func (b *EventBinding) SetCodec(codec commontypes.RemoteCodec) { + b.mu.Lock() + defer b.mu.Unlock() + + b.codec = codec +} + +func (b *EventBinding) SetFilter(filter logpoller.Filter) { + b.mu.Lock() + defer b.mu.Unlock() + + b.registrar = newSyncedFilter() + b.registrar.SetFilter(filter) +} + +func (b *EventBinding) SetCodecTypesAndModifiers(types map[string]types.CodecEntry, modifiers map[string]commoncodec.Modifier) { + b.mu.Lock() + defer b.mu.Unlock() + + b.eventTypes = types + b.eventModifiers = modifiers +} + +func (b *EventBinding) SetDataWordsDetails(dwDetail map[string]DataWordDetail) { + b.mu.Lock() + defer b.mu.Unlock() + + b.dataWords = dwDetail +} + +func (b *EventBinding) SetTopicDetails(topicDetails map[string]TopicDetail) { + b.mu.Lock() + defer b.mu.Unlock() + + b.topics = topicDetails +} + +func (b *EventBinding) GetDataWords() map[string]DataWordDetail { + b.mu.RLock() + defer b.mu.RUnlock() + + return b.dataWords +} + +func (b *EventBinding) Bind(ctx context.Context, bindings ...common.Address) error { + if b.hasBindings() { + // we are changing contract address reference, so we need to unregister old filter if it exists + if err := b.Unregister(ctx); err != nil { + return err + } + } + + // filterRegisterer isn't required here because the event can also be polled for by the contractBinding common filter. + if b.registrar != nil { + b.registrar.SetName(logpoller.FilterName(fmt.Sprintf("%s.%s.%s", b.contractName, b.eventName, uuid.NewString()))) + } + + for _, binding := range bindings { + if b.isBound(binding) { + continue + } + + if b.registrar != nil { + b.registrar.AddAddress(binding) + } + + b.addBinding(binding) + } + + if b.registered() { + return b.Register(ctx) + } + + return nil +} + +func (b *EventBinding) Unbind(ctx context.Context, bindings ...common.Address) error { + for _, binding := range bindings { + if !b.isBound(binding) { + continue + } + + if b.registrar != nil { + b.registrar.RemoveAddress(binding) + } + + b.removeBinding(binding) + } + + if err := b.Unregister(ctx); err != nil { + return err + } + + // we are changing contract address reference, so we need to unregister old filter or re-register existing filter + if b.registrar != nil { + if b.registrar.Count() == 0 { + b.registrar.SetName("") + + return b.Unregister(ctx) + } else if b.registered() { + return b.Register(ctx) + } + } + + return nil +} + +func (b *EventBinding) Register(ctx context.Context) error { + b.mu.Lock() + defer b.mu.Unlock() + + if b.registrar == nil { + return nil + } + + b.registerCalled = true + + // can't be true before filters params are set so there is no race with a bad filter outcome + if len(b.bound) == 0 { + return nil + } + + return b.registrar.Register(ctx, b.lp) +} + +func (b *EventBinding) Unregister(ctx context.Context) error { + b.mu.Lock() + defer b.mu.Unlock() + + if b.registrar == nil { + return nil + } + + if len(b.bound) == 0 { + return nil + } + + return b.registrar.Unregister(ctx, b.lp) +} + +func (b *EventBinding) BatchCall(_ common.Address, _, _ any) (Call, error) { + return Call{}, fmt.Errorf("%w: events are not yet supported in batch get latest values", commontypes.ErrInvalidType) +} + +func (b *EventBinding) GetLatestValue(ctx context.Context, address common.Address, confidenceLevel primitives.ConfidenceLevel, params, into any) error { + if err := b.validateBound(address); err != nil { + return err + } + + confs, err := confidenceToConfirmations(b.confirmationsMapping, confidenceLevel) + if err != nil { + return err + } + + topicTypeID := codec.WrapItemType(b.contractName, b.eventName, true) + + onChainTypedVal, err := b.toNativeOnChainType(topicTypeID, params) + if err != nil { + return fmt.Errorf("failed to convert params to native on chain types: %w", err) + } + + filterTopics, err := b.extractFilterTopics(topicTypeID, onChainTypedVal) + if err != nil { + return err + } + + var log *logpoller.Log + if len(filterTopics) != 0 { + var hashedTopics []common.Hash + hashedTopics, err = b.hashTopics(topicTypeID, filterTopics) + if err != nil { + return err + } + + if log, err = b.getLatestLog(ctx, address, confs, hashedTopics); err != nil { + return err + } + } else { + if log, err = b.lp.LatestLogByEventSigWithConfs(ctx, b.hash, address, confs); err != nil { + return wrapInternalErr(err) + } + } + + return b.decodeLog(ctx, log, into) +} + +func (b *EventBinding) QueryKey(ctx context.Context, address common.Address, filter query.KeyFilter, limitAndSort query.LimitAndSort, sequenceDataType any) ([]commontypes.Sequence, error) { + if err := b.validateBound(address); err != nil { + return nil, err + } + + remapped, err := b.remap(filter) + if err != nil { + return nil, err + } + + // filter should always use the address and event sig + defaultExpressions := []query.Expression{ + logpoller.NewAddressFilter(address), + logpoller.NewEventSigFilter(b.hash), + } + remapped.Expressions = append(defaultExpressions, remapped.Expressions...) + + logs, err := b.lp.FilteredLogs(ctx, remapped.Expressions, limitAndSort, b.contractName+"-"+address.String()+"-"+b.eventName) + if err != nil { + return nil, err + } + + // no need to return an error. an empty list is fine + if len(logs) == 0 { + return []commontypes.Sequence{}, nil + } + + return b.decodeLogsIntoSequences(ctx, logs, sequenceDataType) +} + +func (b *EventBinding) getLatestLog(ctx context.Context, address common.Address, confs evmtypes.Confirmations, hashedTopics []common.Hash) (*logpoller.Log, error) { + // Create limiter and filter for the query. + limiter := query.NewLimitAndSort(query.CountLimit(1), query.NewSortBySequence(query.Desc)) + topicFilters, err := createTopicFilters(hashedTopics) + if err != nil { + return nil, err + } + + filter, err := logpoller.Where( + topicFilters, + logpoller.NewAddressFilter(address), + logpoller.NewEventSigFilter(b.hash), + logpoller.NewConfirmationsFilter(confs), + ) + if err != nil { + return nil, wrapInternalErr(err) + } + + // Gets the latest log that matches the filter and limiter. + logs, err := b.lp.FilteredLogs(ctx, filter, limiter, b.contractName+"-"+address.String()+"-"+b.eventName) + if err != nil { + return nil, wrapInternalErr(err) + } + + if len(logs) == 0 { + return nil, fmt.Errorf("%w: no events found", commontypes.ErrNotFound) + } + return &logs[0], err +} + +func (b *EventBinding) decodeLogsIntoSequences(ctx context.Context, logs []logpoller.Log, into any) ([]commontypes.Sequence, error) { + sequences := make([]commontypes.Sequence, len(logs)) + + for idx := range logs { + sequences[idx] = commontypes.Sequence{ + Cursor: logpoller.FormatContractReaderCursor(logs[idx]), + Head: commontypes.Head{ + Height: fmt.Sprint(logs[idx].BlockNumber), + Hash: logs[idx].BlockHash.Bytes(), + Timestamp: uint64(logs[idx].BlockTimestamp.Unix()), + }, + } + + var typeVal reflect.Value + + typeInto := reflect.TypeOf(into) + if typeInto.Kind() == reflect.Pointer { + typeVal = reflect.New(typeInto.Elem()) + } else { + typeVal = reflect.Indirect(reflect.New(typeInto)) + } + + // create a new value of the same type as 'into' for the data to be extracted to + sequences[idx].Data = typeVal.Interface() + + if err := b.decodeLog(ctx, &logs[idx], sequences[idx].Data); err != nil { + return nil, err + } + } + return sequences, nil +} + +// extractFilterTopics extracts filter topics from input params and returns them as a slice of any. +// returned slice will retain the order of the topics and fill in missing topics with nil, if all values are nil, empty slice is returned. +func (b *EventBinding) extractFilterTopics(topicTypeID string, value any) (filterTopics []any, err error) { + item := reflect.ValueOf(value) + switch item.Kind() { + case reflect.Array, reflect.Slice: + var native any + native, err = codec.RepresentArray(item, b.eventTypes[topicTypeID]) + if err != nil { + return nil, err + } + filterTopics = []any{native} + case reflect.Struct, reflect.Map: + if filterTopics, err = codec.UnrollItem(item, b.eventTypes[topicTypeID]); err != nil { + return nil, err + } + default: + return nil, fmt.Errorf("%w: cannot encode kind %v", commontypes.ErrInvalidType, item.Kind()) + } + + // check if at least one topic filter is present + for _, filterVal := range derefValues(filterTopics) { + if filterVal != nil { + return filterTopics, nil + } + } + + return []any{}, nil +} + +// hashTopics hashes topic filters values to match on chain indexed topics. +func (b *EventBinding) hashTopics(topicTypeID string, topics []any) ([]common.Hash, error) { + var hashableTopics []any + for i, topic := range derefValues(topics) { + if topic == nil { + continue + } + + // make topic value for non-fixed bytes array manually because geth MakeTopics doesn't support it + topicTyp, exists := b.eventTypes[topicTypeID] + if !exists { + return nil, fmt.Errorf("cannot find event type entry") + } + + if abiArg := topicTyp.Args()[i]; abiArg.Type.T == abi.ArrayTy && (abiArg.Type.Elem != nil && abiArg.Type.Elem.T == abi.UintTy) { + packed, err := abi.Arguments{abiArg}.Pack(topic) + if err != nil { + return nil, err + } + topic = crypto.Keccak256Hash(packed) + } + + hashableTopics = append(hashableTopics, topic) + } + + hashes, err := abi.MakeTopics(hashableTopics) + if err != nil { + return nil, wrapInternalErr(err) + } + + if len(hashes) != 1 { + return nil, fmt.Errorf("%w: expected 1 filter set, got %d", commontypes.ErrInternal, len(hashes)) + } + + return hashes[0], nil +} + +func (b *EventBinding) decodeLog(ctx context.Context, log *logpoller.Log, into any) error { + // decode non indexed topics and apply output modifiers + if err := b.codec.Decode(ctx, log.Data, into, codec.WrapItemType(b.contractName, b.eventName, false)); err != nil { + return err + } + + // decode indexed topics which is rarely useful since most indexed topic types get Keccak256 hashed and should be just used for log filtering. + topics := make([]common.Hash, len(b.indexedTopicsTypes.Args())) + if len(log.Topics) < len(topics)+1 { + return fmt.Errorf("%w: not enough topics to decode", commontypes.ErrInvalidType) + } + + for i := 0; i < len(topics); i++ { + topics[i] = common.Hash(log.Topics[i+1]) + } + + topicsInto := map[string]any{} + if err := abi.ParseTopicsIntoMap(topicsInto, b.indexedTopicsTypes.Args(), topics); err != nil { + return fmt.Errorf("%w: %w", commontypes.ErrInvalidType, err) + } + + return codec.MapstructureDecode(topicsInto, into) +} + +// remap chain agnostic primitives to chain specific logPoller primitives. +func (b *EventBinding) remap(filter query.KeyFilter) (remapped query.KeyFilter, err error) { + for _, expression := range filter.Expressions { + remappedExpression, err := b.remapExpression(filter.Key, expression) + if err != nil { + return query.KeyFilter{}, err + } + + remapped.Expressions = append(remapped.Expressions, remappedExpression) + } + + return remapped, nil +} + +func (b *EventBinding) remapExpression(key string, expression query.Expression) (query.Expression, error) { + if !expression.IsPrimitive() { + remappedBoolExpressions := make([]query.Expression, len(expression.BoolExpression.Expressions)) + for i := range expression.BoolExpression.Expressions { + remapped, err := b.remapExpression(key, expression.BoolExpression.Expressions[i]) + if err != nil { + return query.Expression{}, err + } + + remappedBoolExpressions[i] = remapped + } + + if expression.BoolExpression.BoolOperator == query.AND { + return query.And(remappedBoolExpressions...), nil + } + + return query.Or(remappedBoolExpressions...), nil + } + + return b.remapPrimitive(expression) +} + +func (b *EventBinding) remapPrimitive(expression query.Expression) (query.Expression, error) { + switch primitive := expression.Primitive.(type) { + case *primitives.Comparator: + hashedValComps, err := b.encodeComparator(primitive) + if err != nil { + return query.Expression{}, fmt.Errorf("failed to encode comparator %q: %w", primitive.Name, err) + } + return hashedValComps, nil + case *primitives.Confidence: + confirmations, err := confidenceToConfirmations(b.confirmationsMapping, primitive.ConfidenceLevel) + if err != nil { + return query.Expression{}, err + } + + return logpoller.NewConfirmationsFilter(confirmations), nil + default: + return expression, nil + } +} + +func (b *EventBinding) encodeComparator(comparator *primitives.Comparator) (query.Expression, error) { + dwInfo, isDW := b.dataWords[comparator.Name] + if !isDW { + if _, exists := b.topics[comparator.Name]; !exists { + return query.Expression{}, fmt.Errorf("comparator name doesn't match any of the indexed topics or data words") + } + } + + var hashedValComps []logpoller.HashedValueComparator + itemType := codec.WrapItemType(b.contractName, b.eventName+"."+comparator.Name, true) + for _, valComp := range comparator.ValueComparators { + onChainTypedVal, err := b.toNativeOnChainType(itemType, valComp.Value) + if err != nil { + return query.Expression{}, fmt.Errorf("failed to convert comparator value to native on chain type: %w", err) + } + + hashedValComp := logpoller.HashedValueComparator{Operator: valComp.Operator} + if isDW { + hashedValComp.Value, err = b.encodeValComparatorDataWord(itemType, onChainTypedVal) + } else { + hashedValComp.Value, err = b.encodeValComparatorTopic(itemType, onChainTypedVal) + } + if err != nil { + return query.Expression{}, err + } + hashedValComps = append(hashedValComps, hashedValComp) + } + + if isDW { + return logpoller.NewEventByWordFilter(dwInfo.Index, hashedValComps), nil + } + + return logpoller.NewEventByTopicFilter(b.topics[comparator.Name].Index, hashedValComps), nil +} + +func (b *EventBinding) encodeValComparatorDataWord(dwTypeID string, value any) (hash common.Hash, err error) { + defer func() { + if r := recover(); r != nil { + err = fmt.Errorf("%w: cannot encode %s data word comparator. Recovered from panic: %v", commontypes.ErrInvalidType, dwTypeID, r) + } + }() + + dwTypes, exists := b.eventTypes[dwTypeID] + if !exists { + return common.Hash{}, fmt.Errorf("cannot find data word type for %s", dwTypeID) + } + + packedArgs, err := dwTypes.Args().Pack(value) + if err != nil { + return common.Hash{}, err + } + + return common.BytesToHash(packedArgs), nil +} + +func (b *EventBinding) encodeValComparatorTopic(topicTypeID string, value any) (hash common.Hash, err error) { + hashedTopics, err := b.hashTopics(topicTypeID, []any{value}) + if err != nil { + return common.Hash{}, err + } + + return hashedTopics[0], nil +} + +// toNativeOnChainType converts value into its on chain version by applying codec modifiers, map structure hooks and abi typing. +func (b *EventBinding) toNativeOnChainType(itemType string, value any) (any, error) { + offChain, err := b.codec.CreateType(itemType, true) + if err != nil { + return nil, fmt.Errorf("failed to create type: %w", err) + } + + // apply map struct evm hooks to correct incoming values + if err = codec.MapstructureDecode(value, offChain); err != nil { + return nil, err + } + + // apply modifiers if present + onChain := offChain + if modifier, exists := b.eventModifiers[itemType]; exists { + onChain, err = modifier.TransformToOnChain(offChain, "" /* unused */) + if err != nil { + return nil, fmt.Errorf("failed to apply modifiers to offchain type %T: %w", onChain, err) + } + } + + typ, exists := b.eventTypes[itemType] + if !exists { + return query.Expression{}, fmt.Errorf("cannot find event type entry") + } + + native, err := typ.ToNative(reflect.ValueOf(onChain)) + if err != nil { + return query.Expression{}, err + } + + return native.Interface(), nil +} + +func (b *EventBinding) validateBound(address common.Address) error { + b.mu.Lock() + defer b.mu.Unlock() + + bound, exists := b.bound[address] + if !exists || !bound { + return fmt.Errorf( + "%w: event %s that belongs to contract: %s, not bound", + commontypes.ErrInvalidType, + b.eventName, + b.contractName, + ) + } + + return nil +} + +func createTopicFilters(hashedTopics []common.Hash) (query.Expression, error) { + var expressions []query.Expression + for topicID, hash := range hashedTopics { + // first topic index is 1-based, so we add 1. + expressions = append(expressions, logpoller.NewEventByTopicFilter( + uint64(topicID+1), []logpoller.HashedValueComparator{{Value: hash, Operator: primitives.Eq}}, + )) + } + + if len(expressions) == 0 { + return query.Expression{}, fmt.Errorf("%w: no topic filters found during query creation", commontypes.ErrInternal) + } + + return query.And(expressions...), nil +} + +// derefValues dereferences pointers to nil values to nil. +func derefValues(topics []any) []any { + for i, topic := range topics { + rTopic := reflect.ValueOf(topic) + if rTopic.Kind() == reflect.Pointer { + if rTopic.IsNil() { + topics[i] = nil + } else { + topics[i] = rTopic.Elem().Interface() + } + } + } + return topics +} + +func wrapInternalErr(err error) error { + if err == nil { + return nil + } + + errStr := err.Error() + if strings.Contains(errStr, "not found") || strings.Contains(errStr, "no rows") { + return fmt.Errorf("%w: %w", commontypes.ErrNotFound, err) + } + return fmt.Errorf("%w: %w", commontypes.ErrInternal, err) +} + +func (b *EventBinding) hasBindings() bool { + b.mu.RLock() + defer b.mu.RUnlock() + + return len(b.bound) > 0 +} + +func (b *EventBinding) isBound(binding common.Address) bool { + b.mu.RLock() + defer b.mu.RUnlock() + + _, exists := b.bound[binding] + + return exists +} + +func (b *EventBinding) addBinding(binding common.Address) { + b.mu.Lock() + defer b.mu.Unlock() + + b.bound[binding] = true +} + +func (b *EventBinding) removeBinding(binding common.Address) { + b.mu.Lock() + defer b.mu.Unlock() + + delete(b.bound, binding) +} + +func (b *EventBinding) registered() bool { + b.mu.RLock() + defer b.mu.RUnlock() + + return b.registerCalled +} diff --git a/core/services/relay/evm/read/filter.go b/core/services/relay/evm/read/filter.go new file mode 100644 index 00000000000..08f45729ece --- /dev/null +++ b/core/services/relay/evm/read/filter.go @@ -0,0 +1,107 @@ +package read + +import ( + "context" + "fmt" + "sync" + + "github.com/ethereum/go-ethereum/common" + + commontypes "github.com/smartcontractkit/chainlink-common/pkg/types" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" +) + +type Registrar interface { + HasFilter(string) bool + RegisterFilter(context.Context, logpoller.Filter) error + UnregisterFilter(context.Context, string) error +} + +type syncedFilter struct { + // internal state properties + mu sync.RWMutex + filter logpoller.Filter +} + +func newSyncedFilter() *syncedFilter { + return &syncedFilter{} +} + +func (r *syncedFilter) Register(ctx context.Context, registrar Registrar) error { + r.mu.RLock() + defer r.mu.RUnlock() + + if !registrar.HasFilter(r.filter.Name) { + if err := registrar.RegisterFilter(ctx, r.filter); err != nil { + return fmt.Errorf("%w: %w", commontypes.ErrInternal, err) + } + } + + return nil +} + +func (r *syncedFilter) Unregister(ctx context.Context, registrar Registrar) error { + r.mu.RLock() + defer r.mu.RUnlock() + + if !registrar.HasFilter(r.filter.Name) { + return nil + } + + if err := registrar.UnregisterFilter(ctx, r.filter.Name); err != nil { + return fmt.Errorf("%w: %w", commontypes.ErrInternal, err) + } + + return nil +} + +func (r *syncedFilter) SetFilter(filter logpoller.Filter) { + r.mu.Lock() + defer r.mu.Unlock() + + r.filter = filter +} + +func (r *syncedFilter) SetName(name string) { + r.mu.Lock() + defer r.mu.Unlock() + + r.filter.Name = name +} + +func (r *syncedFilter) AddAddress(address common.Address) { + r.mu.Lock() + defer r.mu.Unlock() + + r.filter.Addresses = append(r.filter.Addresses, address) +} + +func (r *syncedFilter) RemoveAddress(address common.Address) { + r.mu.Lock() + defer r.mu.Unlock() + + var addrIdx int + for idx, addr := range r.filter.Addresses { + if addr.Hex() == address.Hex() { + addrIdx = idx + } + } + + r.filter.Addresses[addrIdx] = r.filter.Addresses[len(r.filter.Addresses)-1] + r.filter.Addresses = r.filter.Addresses[:len(r.filter.Addresses)-1] +} + +func (r *syncedFilter) Count() int { + r.mu.RLock() + defer r.mu.RUnlock() + + return len(r.filter.Addresses) +} + +func (r *syncedFilter) HasEventSigs() bool { + r.mu.RLock() + defer r.mu.RUnlock() + + return len(r.filter.EventSigs) > 0 && len(r.filter.Addresses) > 0 +} diff --git a/core/services/relay/evm/read/lookup.go b/core/services/relay/evm/read/lookup.go new file mode 100644 index 00000000000..5679d8cee06 --- /dev/null +++ b/core/services/relay/evm/read/lookup.go @@ -0,0 +1,84 @@ +package read + +import ( + "sync" + + "github.com/smartcontractkit/chainlink-common/pkg/types" +) + +type readValues struct { + address string + contract string + readName string +} + +// lookup provides basic utilities for mapping a complete readIdentifier to +// finite contract read information +type lookup struct { + mu sync.RWMutex + // contractReadNames maps a contract name to all available readNames (method, log, event, etc.) + contractReadNames map[string][]string + // readIdentifiers maps from a complete readIdentifier string to finite read data + // a readIdentifier is a combination of address, contract, and readName as a concatenated string + readIdentifiers map[string]readValues +} + +func newLookup() *lookup { + return &lookup{ + contractReadNames: make(map[string][]string), + readIdentifiers: make(map[string]readValues), + } +} + +func (l *lookup) addReadNameForContract(contract, readName string) { + l.mu.Lock() + defer l.mu.Unlock() + + readNames, exists := l.contractReadNames[contract] + if !exists { + readNames = []string{} + } + + l.contractReadNames[contract] = append(readNames, readName) +} + +func (l *lookup) bindAddressForContract(contract, address string) { + l.mu.Lock() + defer l.mu.Unlock() + + for _, readName := range l.contractReadNames[contract] { + readIdentifier := types.BoundContract{ + Address: address, + Name: contract, + }.ReadIdentifier(readName) + + l.readIdentifiers[readIdentifier] = readValues{ + address: address, + contract: contract, + readName: readName, + } + } +} + +func (l *lookup) unbindAddressForContract(contract, address string) { + l.mu.Lock() + defer l.mu.Unlock() + + for _, readName := range l.contractReadNames[contract] { + readIdentifier := types.BoundContract{ + Address: address, + Name: contract, + }.ReadIdentifier(readName) + + delete(l.readIdentifiers, readIdentifier) + } +} + +func (l *lookup) getContractForReadName(readName string) (readValues, bool) { + l.mu.RLock() + defer l.mu.RUnlock() + + contract, ok := l.readIdentifiers[readName] + + return contract, ok +} diff --git a/core/services/relay/evm/read/method.go b/core/services/relay/evm/read/method.go new file mode 100644 index 00000000000..26a72544716 --- /dev/null +++ b/core/services/relay/evm/read/method.go @@ -0,0 +1,204 @@ +package read + +import ( + "context" + "fmt" + "math/big" + "sync" + + "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/common" + + "github.com/smartcontractkit/chainlink-common/pkg/logger" + commontypes "github.com/smartcontractkit/chainlink-common/pkg/types" + "github.com/smartcontractkit/chainlink-common/pkg/types/query" + "github.com/smartcontractkit/chainlink-common/pkg/types/query/primitives" + "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/codec" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" + evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" + + evmclient "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" +) + +type NoContractExistsError struct { + Address common.Address +} + +func (e NoContractExistsError) Error() string { + return fmt.Sprintf("contract does not exist at address: %s", e.Address) +} + +type MethodBinding struct { + // read-only properties + contractName string + method string + + // dependencies + client evmclient.Client + ht logpoller.HeadTracker + lggr logger.Logger + confirmationsMapping map[primitives.ConfidenceLevel]evmtypes.Confirmations + + // internal state properties + codec commontypes.Codec + bindings map[common.Address]struct{} + mu sync.RWMutex +} + +func NewMethodBinding( + name, method string, + client evmclient.Client, + heads logpoller.HeadTracker, + confs map[primitives.ConfidenceLevel]evmtypes.Confirmations, + lggr logger.Logger, +) *MethodBinding { + return &MethodBinding{ + contractName: name, + method: method, + client: client, + ht: heads, + lggr: lggr, + confirmationsMapping: confs, + bindings: make(map[common.Address]struct{}), + } +} + +var _ Reader = &MethodBinding{} + +func (b *MethodBinding) Bind(ctx context.Context, bindings ...common.Address) error { + for _, binding := range bindings { + if b.isBound(binding) { + continue + } + + // check for contract byte code at the latest block and provided address + byteCode, err := b.client.CodeAt(ctx, binding, nil) + if err != nil { + return err + } + + if len(byteCode) == 0 { + return NoContractExistsError{Address: binding} + } + + b.setBinding(binding) + } + + return nil +} + +func (b *MethodBinding) Unbind(ctx context.Context, bindings ...common.Address) error { + b.mu.Lock() + defer b.mu.Unlock() + + for _, binding := range bindings { + delete(b.bindings, binding) + } + + return nil +} + +func (b *MethodBinding) SetCodec(codec commontypes.RemoteCodec) { + b.mu.Lock() + defer b.mu.Unlock() + + b.codec = codec +} + +func (b *MethodBinding) BatchCall(address common.Address, params, retVal any) (Call, error) { + if !b.isBound(address) { + return Call{}, fmt.Errorf("%w: address (%s) not bound to method (%s) for contract (%s)", commontypes.ErrInvalidConfig, address.Hex(), b.method, b.contractName) + } + + return Call{ + ContractAddress: address, + ContractName: b.contractName, + MethodName: b.method, + Params: params, + ReturnVal: retVal, + }, nil +} + +func (b *MethodBinding) GetLatestValue(ctx context.Context, addr common.Address, confidenceLevel primitives.ConfidenceLevel, params, returnVal any) error { + if !b.isBound(addr) { + return fmt.Errorf("%w: method not bound", commontypes.ErrInvalidType) + } + + data, err := b.codec.Encode(ctx, params, codec.WrapItemType(b.contractName, b.method, true)) + if err != nil { + return err + } + + callMsg := ethereum.CallMsg{ + To: &addr, + From: addr, + Data: data, + } + + block, err := b.blockNumberFromConfidence(ctx, confidenceLevel) + if err != nil { + return err + } + + bytes, err := b.client.CallContract(ctx, callMsg, block) + if err != nil { + return fmt.Errorf("%w: %w", commontypes.ErrInternal, err) + } + + return b.codec.Decode(ctx, bytes, returnVal, codec.WrapItemType(b.contractName, b.method, false)) +} + +func (b *MethodBinding) QueryKey( + _ context.Context, + _ common.Address, + _ query.KeyFilter, + _ query.LimitAndSort, + _ any, +) ([]commontypes.Sequence, error) { + return nil, nil +} + +func (b *MethodBinding) Register(_ context.Context) error { return nil } +func (b *MethodBinding) Unregister(_ context.Context) error { return nil } + +func (b *MethodBinding) blockNumberFromConfidence(ctx context.Context, confidenceLevel primitives.ConfidenceLevel) (*big.Int, error) { + confirmations, err := confidenceToConfirmations(b.confirmationsMapping, confidenceLevel) + if err != nil { + err = fmt.Errorf("%w for contract: %s, method: %s", err, b.contractName, b.method) + if confidenceLevel == primitives.Unconfirmed { + b.lggr.Errorf("%v, now falling back to default contract call behaviour that calls latest state", err) + return nil, nil + } + return nil, err + } + + _, finalized, err := b.ht.LatestAndFinalizedBlock(ctx) + if err != nil { + return nil, err + } + + if confirmations == evmtypes.Finalized { + return big.NewInt(finalized.Number), nil + } else if confirmations == evmtypes.Unconfirmed { + return nil, nil + } + + return nil, fmt.Errorf("unknown evm confirmations: %v for contract: %s, method: %s", confirmations, b.contractName, b.method) +} + +func (b *MethodBinding) isBound(binding common.Address) bool { + b.mu.RLock() + defer b.mu.RUnlock() + + _, exists := b.bindings[binding] + + return exists +} + +func (b *MethodBinding) setBinding(binding common.Address) { + b.mu.Lock() + defer b.mu.Unlock() + + b.bindings[binding] = struct{}{} +} diff --git a/core/services/relay/evm/read/mocks/batch_caller.go b/core/services/relay/evm/read/mocks/batch_caller.go new file mode 100644 index 00000000000..5f1144b5d81 --- /dev/null +++ b/core/services/relay/evm/read/mocks/batch_caller.go @@ -0,0 +1,97 @@ +// Code generated by mockery v2.43.2. DO NOT EDIT. + +package mocks + +import ( + context "context" + + read "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/read" + mock "github.com/stretchr/testify/mock" +) + +// BatchCaller is an autogenerated mock type for the BatchCaller type +type BatchCaller struct { + mock.Mock +} + +type BatchCaller_Expecter struct { + mock *mock.Mock +} + +func (_m *BatchCaller) EXPECT() *BatchCaller_Expecter { + return &BatchCaller_Expecter{mock: &_m.Mock} +} + +// BatchCall provides a mock function with given fields: ctx, blockNumber, batchRequests +func (_m *BatchCaller) BatchCall(ctx context.Context, blockNumber uint64, batchRequests read.BatchCall) (read.BatchResult, error) { + ret := _m.Called(ctx, blockNumber, batchRequests) + + if len(ret) == 0 { + panic("no return value specified for BatchCall") + } + + var r0 read.BatchResult + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, uint64, read.BatchCall) (read.BatchResult, error)); ok { + return rf(ctx, blockNumber, batchRequests) + } + if rf, ok := ret.Get(0).(func(context.Context, uint64, read.BatchCall) read.BatchResult); ok { + r0 = rf(ctx, blockNumber, batchRequests) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(read.BatchResult) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, uint64, read.BatchCall) error); ok { + r1 = rf(ctx, blockNumber, batchRequests) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// BatchCaller_BatchCall_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BatchCall' +type BatchCaller_BatchCall_Call struct { + *mock.Call +} + +// BatchCall is a helper method to define mock.On call +// - ctx context.Context +// - blockNumber uint64 +// - batchRequests read.BatchCall +func (_e *BatchCaller_Expecter) BatchCall(ctx interface{}, blockNumber interface{}, batchRequests interface{}) *BatchCaller_BatchCall_Call { + return &BatchCaller_BatchCall_Call{Call: _e.mock.On("BatchCall", ctx, blockNumber, batchRequests)} +} + +func (_c *BatchCaller_BatchCall_Call) Run(run func(ctx context.Context, blockNumber uint64, batchRequests read.BatchCall)) *BatchCaller_BatchCall_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(uint64), args[2].(read.BatchCall)) + }) + return _c +} + +func (_c *BatchCaller_BatchCall_Call) Return(_a0 read.BatchResult, _a1 error) *BatchCaller_BatchCall_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *BatchCaller_BatchCall_Call) RunAndReturn(run func(context.Context, uint64, read.BatchCall) (read.BatchResult, error)) *BatchCaller_BatchCall_Call { + _c.Call.Return(run) + return _c +} + +// NewBatchCaller creates a new instance of BatchCaller. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewBatchCaller(t interface { + mock.TestingT + Cleanup(func()) +}) *BatchCaller { + mock := &BatchCaller{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/core/services/relay/evm/read/mocks/reader.go b/core/services/relay/evm/read/mocks/reader.go new file mode 100644 index 00000000000..6bb9dd70cc1 --- /dev/null +++ b/core/services/relay/evm/read/mocks/reader.go @@ -0,0 +1,463 @@ +// Code generated by mockery v2.43.2. DO NOT EDIT. + +package mocks + +import ( + context "context" + + common "github.com/ethereum/go-ethereum/common" + + mock "github.com/stretchr/testify/mock" + + primitives "github.com/smartcontractkit/chainlink-common/pkg/types/query/primitives" + + query "github.com/smartcontractkit/chainlink-common/pkg/types/query" + + read "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/read" + + types "github.com/smartcontractkit/chainlink-common/pkg/types" +) + +// Reader is an autogenerated mock type for the Reader type +type Reader struct { + mock.Mock +} + +type Reader_Expecter struct { + mock *mock.Mock +} + +func (_m *Reader) EXPECT() *Reader_Expecter { + return &Reader_Expecter{mock: &_m.Mock} +} + +// BatchCall provides a mock function with given fields: address, params, retVal +func (_m *Reader) BatchCall(address common.Address, params interface{}, retVal interface{}) (read.Call, error) { + ret := _m.Called(address, params, retVal) + + if len(ret) == 0 { + panic("no return value specified for BatchCall") + } + + var r0 read.Call + var r1 error + if rf, ok := ret.Get(0).(func(common.Address, interface{}, interface{}) (read.Call, error)); ok { + return rf(address, params, retVal) + } + if rf, ok := ret.Get(0).(func(common.Address, interface{}, interface{}) read.Call); ok { + r0 = rf(address, params, retVal) + } else { + r0 = ret.Get(0).(read.Call) + } + + if rf, ok := ret.Get(1).(func(common.Address, interface{}, interface{}) error); ok { + r1 = rf(address, params, retVal) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// Reader_BatchCall_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BatchCall' +type Reader_BatchCall_Call struct { + *mock.Call +} + +// BatchCall is a helper method to define mock.On call +// - address common.Address +// - params interface{} +// - retVal interface{} +func (_e *Reader_Expecter) BatchCall(address interface{}, params interface{}, retVal interface{}) *Reader_BatchCall_Call { + return &Reader_BatchCall_Call{Call: _e.mock.On("BatchCall", address, params, retVal)} +} + +func (_c *Reader_BatchCall_Call) Run(run func(address common.Address, params interface{}, retVal interface{})) *Reader_BatchCall_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(common.Address), args[1].(interface{}), args[2].(interface{})) + }) + return _c +} + +func (_c *Reader_BatchCall_Call) Return(_a0 read.Call, _a1 error) *Reader_BatchCall_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Reader_BatchCall_Call) RunAndReturn(run func(common.Address, interface{}, interface{}) (read.Call, error)) *Reader_BatchCall_Call { + _c.Call.Return(run) + return _c +} + +// Bind provides a mock function with given fields: _a0, _a1 +func (_m *Reader) Bind(_a0 context.Context, _a1 ...common.Address) error { + _va := make([]interface{}, len(_a1)) + for _i := range _a1 { + _va[_i] = _a1[_i] + } + var _ca []interface{} + _ca = append(_ca, _a0) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for Bind") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, ...common.Address) error); ok { + r0 = rf(_a0, _a1...) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// Reader_Bind_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Bind' +type Reader_Bind_Call struct { + *mock.Call +} + +// Bind is a helper method to define mock.On call +// - _a0 context.Context +// - _a1 ...common.Address +func (_e *Reader_Expecter) Bind(_a0 interface{}, _a1 ...interface{}) *Reader_Bind_Call { + return &Reader_Bind_Call{Call: _e.mock.On("Bind", + append([]interface{}{_a0}, _a1...)...)} +} + +func (_c *Reader_Bind_Call) Run(run func(_a0 context.Context, _a1 ...common.Address)) *Reader_Bind_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]common.Address, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(common.Address) + } + } + run(args[0].(context.Context), variadicArgs...) + }) + return _c +} + +func (_c *Reader_Bind_Call) Return(_a0 error) *Reader_Bind_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Reader_Bind_Call) RunAndReturn(run func(context.Context, ...common.Address) error) *Reader_Bind_Call { + _c.Call.Return(run) + return _c +} + +// GetLatestValue provides a mock function with given fields: ctx, addr, confidence, params, returnVal +func (_m *Reader) GetLatestValue(ctx context.Context, addr common.Address, confidence primitives.ConfidenceLevel, params interface{}, returnVal interface{}) error { + ret := _m.Called(ctx, addr, confidence, params, returnVal) + + if len(ret) == 0 { + panic("no return value specified for GetLatestValue") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, common.Address, primitives.ConfidenceLevel, interface{}, interface{}) error); ok { + r0 = rf(ctx, addr, confidence, params, returnVal) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// Reader_GetLatestValue_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetLatestValue' +type Reader_GetLatestValue_Call struct { + *mock.Call +} + +// GetLatestValue is a helper method to define mock.On call +// - ctx context.Context +// - addr common.Address +// - confidence primitives.ConfidenceLevel +// - params interface{} +// - returnVal interface{} +func (_e *Reader_Expecter) GetLatestValue(ctx interface{}, addr interface{}, confidence interface{}, params interface{}, returnVal interface{}) *Reader_GetLatestValue_Call { + return &Reader_GetLatestValue_Call{Call: _e.mock.On("GetLatestValue", ctx, addr, confidence, params, returnVal)} +} + +func (_c *Reader_GetLatestValue_Call) Run(run func(ctx context.Context, addr common.Address, confidence primitives.ConfidenceLevel, params interface{}, returnVal interface{})) *Reader_GetLatestValue_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(common.Address), args[2].(primitives.ConfidenceLevel), args[3].(interface{}), args[4].(interface{})) + }) + return _c +} + +func (_c *Reader_GetLatestValue_Call) Return(_a0 error) *Reader_GetLatestValue_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Reader_GetLatestValue_Call) RunAndReturn(run func(context.Context, common.Address, primitives.ConfidenceLevel, interface{}, interface{}) error) *Reader_GetLatestValue_Call { + _c.Call.Return(run) + return _c +} + +// QueryKey provides a mock function with given fields: _a0, _a1, _a2, _a3, _a4 +func (_m *Reader) QueryKey(_a0 context.Context, _a1 common.Address, _a2 query.KeyFilter, _a3 query.LimitAndSort, _a4 interface{}) ([]types.Sequence, error) { + ret := _m.Called(_a0, _a1, _a2, _a3, _a4) + + if len(ret) == 0 { + panic("no return value specified for QueryKey") + } + + var r0 []types.Sequence + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, common.Address, query.KeyFilter, query.LimitAndSort, interface{}) ([]types.Sequence, error)); ok { + return rf(_a0, _a1, _a2, _a3, _a4) + } + if rf, ok := ret.Get(0).(func(context.Context, common.Address, query.KeyFilter, query.LimitAndSort, interface{}) []types.Sequence); ok { + r0 = rf(_a0, _a1, _a2, _a3, _a4) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]types.Sequence) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, common.Address, query.KeyFilter, query.LimitAndSort, interface{}) error); ok { + r1 = rf(_a0, _a1, _a2, _a3, _a4) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// Reader_QueryKey_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'QueryKey' +type Reader_QueryKey_Call struct { + *mock.Call +} + +// QueryKey is a helper method to define mock.On call +// - _a0 context.Context +// - _a1 common.Address +// - _a2 query.KeyFilter +// - _a3 query.LimitAndSort +// - _a4 interface{} +func (_e *Reader_Expecter) QueryKey(_a0 interface{}, _a1 interface{}, _a2 interface{}, _a3 interface{}, _a4 interface{}) *Reader_QueryKey_Call { + return &Reader_QueryKey_Call{Call: _e.mock.On("QueryKey", _a0, _a1, _a2, _a3, _a4)} +} + +func (_c *Reader_QueryKey_Call) Run(run func(_a0 context.Context, _a1 common.Address, _a2 query.KeyFilter, _a3 query.LimitAndSort, _a4 interface{})) *Reader_QueryKey_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(common.Address), args[2].(query.KeyFilter), args[3].(query.LimitAndSort), args[4].(interface{})) + }) + return _c +} + +func (_c *Reader_QueryKey_Call) Return(_a0 []types.Sequence, _a1 error) *Reader_QueryKey_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Reader_QueryKey_Call) RunAndReturn(run func(context.Context, common.Address, query.KeyFilter, query.LimitAndSort, interface{}) ([]types.Sequence, error)) *Reader_QueryKey_Call { + _c.Call.Return(run) + return _c +} + +// Register provides a mock function with given fields: _a0 +func (_m *Reader) Register(_a0 context.Context) error { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for Register") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context) error); ok { + r0 = rf(_a0) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// Reader_Register_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Register' +type Reader_Register_Call struct { + *mock.Call +} + +// Register is a helper method to define mock.On call +// - _a0 context.Context +func (_e *Reader_Expecter) Register(_a0 interface{}) *Reader_Register_Call { + return &Reader_Register_Call{Call: _e.mock.On("Register", _a0)} +} + +func (_c *Reader_Register_Call) Run(run func(_a0 context.Context)) *Reader_Register_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *Reader_Register_Call) Return(_a0 error) *Reader_Register_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Reader_Register_Call) RunAndReturn(run func(context.Context) error) *Reader_Register_Call { + _c.Call.Return(run) + return _c +} + +// SetCodec provides a mock function with given fields: _a0 +func (_m *Reader) SetCodec(_a0 types.RemoteCodec) { + _m.Called(_a0) +} + +// Reader_SetCodec_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetCodec' +type Reader_SetCodec_Call struct { + *mock.Call +} + +// SetCodec is a helper method to define mock.On call +// - _a0 types.RemoteCodec +func (_e *Reader_Expecter) SetCodec(_a0 interface{}) *Reader_SetCodec_Call { + return &Reader_SetCodec_Call{Call: _e.mock.On("SetCodec", _a0)} +} + +func (_c *Reader_SetCodec_Call) Run(run func(_a0 types.RemoteCodec)) *Reader_SetCodec_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.RemoteCodec)) + }) + return _c +} + +func (_c *Reader_SetCodec_Call) Return() *Reader_SetCodec_Call { + _c.Call.Return() + return _c +} + +func (_c *Reader_SetCodec_Call) RunAndReturn(run func(types.RemoteCodec)) *Reader_SetCodec_Call { + _c.Call.Return(run) + return _c +} + +// Unbind provides a mock function with given fields: _a0, _a1 +func (_m *Reader) Unbind(_a0 context.Context, _a1 ...common.Address) error { + _va := make([]interface{}, len(_a1)) + for _i := range _a1 { + _va[_i] = _a1[_i] + } + var _ca []interface{} + _ca = append(_ca, _a0) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for Unbind") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, ...common.Address) error); ok { + r0 = rf(_a0, _a1...) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// Reader_Unbind_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Unbind' +type Reader_Unbind_Call struct { + *mock.Call +} + +// Unbind is a helper method to define mock.On call +// - _a0 context.Context +// - _a1 ...common.Address +func (_e *Reader_Expecter) Unbind(_a0 interface{}, _a1 ...interface{}) *Reader_Unbind_Call { + return &Reader_Unbind_Call{Call: _e.mock.On("Unbind", + append([]interface{}{_a0}, _a1...)...)} +} + +func (_c *Reader_Unbind_Call) Run(run func(_a0 context.Context, _a1 ...common.Address)) *Reader_Unbind_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]common.Address, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(common.Address) + } + } + run(args[0].(context.Context), variadicArgs...) + }) + return _c +} + +func (_c *Reader_Unbind_Call) Return(_a0 error) *Reader_Unbind_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Reader_Unbind_Call) RunAndReturn(run func(context.Context, ...common.Address) error) *Reader_Unbind_Call { + _c.Call.Return(run) + return _c +} + +// Unregister provides a mock function with given fields: _a0 +func (_m *Reader) Unregister(_a0 context.Context) error { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for Unregister") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context) error); ok { + r0 = rf(_a0) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// Reader_Unregister_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Unregister' +type Reader_Unregister_Call struct { + *mock.Call +} + +// Unregister is a helper method to define mock.On call +// - _a0 context.Context +func (_e *Reader_Expecter) Unregister(_a0 interface{}) *Reader_Unregister_Call { + return &Reader_Unregister_Call{Call: _e.mock.On("Unregister", _a0)} +} + +func (_c *Reader_Unregister_Call) Run(run func(_a0 context.Context)) *Reader_Unregister_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *Reader_Unregister_Call) Return(_a0 error) *Reader_Unregister_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Reader_Unregister_Call) RunAndReturn(run func(context.Context) error) *Reader_Unregister_Call { + _c.Call.Return(run) + return _c +} + +// NewReader creates a new instance of Reader. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewReader(t interface { + mock.TestingT + Cleanup(func()) +}) *Reader { + mock := &Reader{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/core/services/relay/evm/read/mocks/registrar.go b/core/services/relay/evm/read/mocks/registrar.go new file mode 100644 index 00000000000..670c29317a1 --- /dev/null +++ b/core/services/relay/evm/read/mocks/registrar.go @@ -0,0 +1,177 @@ +// Code generated by mockery v2.43.2. DO NOT EDIT. + +package mocks + +import ( + context "context" + + logpoller "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" + mock "github.com/stretchr/testify/mock" +) + +// Registrar is an autogenerated mock type for the Registrar type +type Registrar struct { + mock.Mock +} + +type Registrar_Expecter struct { + mock *mock.Mock +} + +func (_m *Registrar) EXPECT() *Registrar_Expecter { + return &Registrar_Expecter{mock: &_m.Mock} +} + +// HasFilter provides a mock function with given fields: _a0 +func (_m *Registrar) HasFilter(_a0 string) bool { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for HasFilter") + } + + var r0 bool + if rf, ok := ret.Get(0).(func(string) bool); ok { + r0 = rf(_a0) + } else { + r0 = ret.Get(0).(bool) + } + + return r0 +} + +// Registrar_HasFilter_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HasFilter' +type Registrar_HasFilter_Call struct { + *mock.Call +} + +// HasFilter is a helper method to define mock.On call +// - _a0 string +func (_e *Registrar_Expecter) HasFilter(_a0 interface{}) *Registrar_HasFilter_Call { + return &Registrar_HasFilter_Call{Call: _e.mock.On("HasFilter", _a0)} +} + +func (_c *Registrar_HasFilter_Call) Run(run func(_a0 string)) *Registrar_HasFilter_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Registrar_HasFilter_Call) Return(_a0 bool) *Registrar_HasFilter_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Registrar_HasFilter_Call) RunAndReturn(run func(string) bool) *Registrar_HasFilter_Call { + _c.Call.Return(run) + return _c +} + +// RegisterFilter provides a mock function with given fields: _a0, _a1 +func (_m *Registrar) RegisterFilter(_a0 context.Context, _a1 logpoller.Filter) error { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for RegisterFilter") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, logpoller.Filter) error); ok { + r0 = rf(_a0, _a1) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// Registrar_RegisterFilter_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RegisterFilter' +type Registrar_RegisterFilter_Call struct { + *mock.Call +} + +// RegisterFilter is a helper method to define mock.On call +// - _a0 context.Context +// - _a1 logpoller.Filter +func (_e *Registrar_Expecter) RegisterFilter(_a0 interface{}, _a1 interface{}) *Registrar_RegisterFilter_Call { + return &Registrar_RegisterFilter_Call{Call: _e.mock.On("RegisterFilter", _a0, _a1)} +} + +func (_c *Registrar_RegisterFilter_Call) Run(run func(_a0 context.Context, _a1 logpoller.Filter)) *Registrar_RegisterFilter_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(logpoller.Filter)) + }) + return _c +} + +func (_c *Registrar_RegisterFilter_Call) Return(_a0 error) *Registrar_RegisterFilter_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Registrar_RegisterFilter_Call) RunAndReturn(run func(context.Context, logpoller.Filter) error) *Registrar_RegisterFilter_Call { + _c.Call.Return(run) + return _c +} + +// UnregisterFilter provides a mock function with given fields: _a0, _a1 +func (_m *Registrar) UnregisterFilter(_a0 context.Context, _a1 string) error { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for UnregisterFilter") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, string) error); ok { + r0 = rf(_a0, _a1) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// Registrar_UnregisterFilter_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UnregisterFilter' +type Registrar_UnregisterFilter_Call struct { + *mock.Call +} + +// UnregisterFilter is a helper method to define mock.On call +// - _a0 context.Context +// - _a1 string +func (_e *Registrar_Expecter) UnregisterFilter(_a0 interface{}, _a1 interface{}) *Registrar_UnregisterFilter_Call { + return &Registrar_UnregisterFilter_Call{Call: _e.mock.On("UnregisterFilter", _a0, _a1)} +} + +func (_c *Registrar_UnregisterFilter_Call) Run(run func(_a0 context.Context, _a1 string)) *Registrar_UnregisterFilter_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *Registrar_UnregisterFilter_Call) Return(_a0 error) *Registrar_UnregisterFilter_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Registrar_UnregisterFilter_Call) RunAndReturn(run func(context.Context, string) error) *Registrar_UnregisterFilter_Call { + _c.Call.Return(run) + return _c +} + +// NewRegistrar creates a new instance of Registrar. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewRegistrar(t interface { + mock.TestingT + Cleanup(func()) +}) *Registrar { + mock := &Registrar{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/core/services/relay/evm/relayer_extender.go b/core/services/relay/evm/relayer_extender.go index f262948c9c5..f4477491577 100644 --- a/core/services/relay/evm/relayer_extender.go +++ b/core/services/relay/evm/relayer_extender.go @@ -74,6 +74,10 @@ type ChainRelayerExt struct { var _ EVMChainRelayerExtender = &ChainRelayerExt{} +func (s *ChainRelayerExt) LatestHead(ctx context.Context) (commontypes.Head, error) { + return s.chain.LatestHead(ctx) +} + func (s *ChainRelayerExt) GetChainStatus(ctx context.Context) (commontypes.ChainStatus, error) { return s.chain.GetChainStatus(ctx) } diff --git a/core/services/relay/evm/request_round_db.go b/core/services/relay/evm/request_round_db.go index 96c5a05d1c7..07a2d1cbc3b 100644 --- a/core/services/relay/evm/request_round_db.go +++ b/core/services/relay/evm/request_round_db.go @@ -8,12 +8,10 @@ import ( "github.com/smartcontractkit/libocr/gethwrappers2/ocr2aggregator" ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" + "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink-common/pkg/sqlutil" - "github.com/smartcontractkit/chainlink/v2/core/logger" ) -//go:generate mockery --quiet --name RequestRoundDB --output ./mocks/ --case=underscore - // RequestRoundDB stores requested rounds for querying by the median plugin. type RequestRoundDB interface { SaveLatestRoundRequested(ctx context.Context, rr ocr2aggregator.OCR2AggregatorRoundRequested) error diff --git a/core/services/relay/evm/request_round_tracker.go b/core/services/relay/evm/request_round_tracker.go index 7cf13775693..b9200fff757 100644 --- a/core/services/relay/evm/request_round_tracker.go +++ b/core/services/relay/evm/request_round_tracker.go @@ -12,13 +12,13 @@ import ( "github.com/smartcontractkit/libocr/gethwrappers2/ocr2aggregator" ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" + "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink-common/pkg/services" "github.com/smartcontractkit/chainlink-common/pkg/sqlutil" evmclient "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/log" offchain_aggregator_wrapper "github.com/smartcontractkit/chainlink/v2/core/internal/gethwrappers2/generated/offchainaggregator" - "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/ocrcommon" ) diff --git a/core/services/relay/evm/standard_config_provider.go b/core/services/relay/evm/standard_config_provider.go index 59f91c52f4a..91ca25413fa 100644 --- a/core/services/relay/evm/standard_config_provider.go +++ b/core/services/relay/evm/standard_config_provider.go @@ -10,8 +10,9 @@ import ( "github.com/smartcontractkit/libocr/offchainreporting2plus/chains/evmutil" ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" + "github.com/smartcontractkit/chainlink-common/pkg/logger" + "github.com/smartcontractkit/chainlink/v2/core/chains/legacyevm" - "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/types" ) diff --git a/core/services/relay/evm/statuschecker/mocks/ccip_transaction_status_checker.go b/core/services/relay/evm/statuschecker/mocks/ccip_transaction_status_checker.go new file mode 100644 index 00000000000..9bd59ccf4ef --- /dev/null +++ b/core/services/relay/evm/statuschecker/mocks/ccip_transaction_status_checker.go @@ -0,0 +1,104 @@ +// Code generated by mockery v2.43.2. DO NOT EDIT. + +package mocks + +import ( + context "context" + + mock "github.com/stretchr/testify/mock" + + types "github.com/smartcontractkit/chainlink-common/pkg/types" +) + +// CCIPTransactionStatusChecker is an autogenerated mock type for the CCIPTransactionStatusChecker type +type CCIPTransactionStatusChecker struct { + mock.Mock +} + +type CCIPTransactionStatusChecker_Expecter struct { + mock *mock.Mock +} + +func (_m *CCIPTransactionStatusChecker) EXPECT() *CCIPTransactionStatusChecker_Expecter { + return &CCIPTransactionStatusChecker_Expecter{mock: &_m.Mock} +} + +// CheckMessageStatus provides a mock function with given fields: ctx, msgID +func (_m *CCIPTransactionStatusChecker) CheckMessageStatus(ctx context.Context, msgID string) ([]types.TransactionStatus, int, error) { + ret := _m.Called(ctx, msgID) + + if len(ret) == 0 { + panic("no return value specified for CheckMessageStatus") + } + + var r0 []types.TransactionStatus + var r1 int + var r2 error + if rf, ok := ret.Get(0).(func(context.Context, string) ([]types.TransactionStatus, int, error)); ok { + return rf(ctx, msgID) + } + if rf, ok := ret.Get(0).(func(context.Context, string) []types.TransactionStatus); ok { + r0 = rf(ctx, msgID) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]types.TransactionStatus) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string) int); ok { + r1 = rf(ctx, msgID) + } else { + r1 = ret.Get(1).(int) + } + + if rf, ok := ret.Get(2).(func(context.Context, string) error); ok { + r2 = rf(ctx, msgID) + } else { + r2 = ret.Error(2) + } + + return r0, r1, r2 +} + +// CCIPTransactionStatusChecker_CheckMessageStatus_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CheckMessageStatus' +type CCIPTransactionStatusChecker_CheckMessageStatus_Call struct { + *mock.Call +} + +// CheckMessageStatus is a helper method to define mock.On call +// - ctx context.Context +// - msgID string +func (_e *CCIPTransactionStatusChecker_Expecter) CheckMessageStatus(ctx interface{}, msgID interface{}) *CCIPTransactionStatusChecker_CheckMessageStatus_Call { + return &CCIPTransactionStatusChecker_CheckMessageStatus_Call{Call: _e.mock.On("CheckMessageStatus", ctx, msgID)} +} + +func (_c *CCIPTransactionStatusChecker_CheckMessageStatus_Call) Run(run func(ctx context.Context, msgID string)) *CCIPTransactionStatusChecker_CheckMessageStatus_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *CCIPTransactionStatusChecker_CheckMessageStatus_Call) Return(transactionStatuses []types.TransactionStatus, retryCounter int, err error) *CCIPTransactionStatusChecker_CheckMessageStatus_Call { + _c.Call.Return(transactionStatuses, retryCounter, err) + return _c +} + +func (_c *CCIPTransactionStatusChecker_CheckMessageStatus_Call) RunAndReturn(run func(context.Context, string) ([]types.TransactionStatus, int, error)) *CCIPTransactionStatusChecker_CheckMessageStatus_Call { + _c.Call.Return(run) + return _c +} + +// NewCCIPTransactionStatusChecker creates a new instance of CCIPTransactionStatusChecker. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewCCIPTransactionStatusChecker(t interface { + mock.TestingT + Cleanup(func()) +}) *CCIPTransactionStatusChecker { + mock := &CCIPTransactionStatusChecker{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/core/services/relay/evm/statuschecker/txm_status_checker.go b/core/services/relay/evm/statuschecker/txm_status_checker.go new file mode 100644 index 00000000000..f22e6d78b9f --- /dev/null +++ b/core/services/relay/evm/statuschecker/txm_status_checker.go @@ -0,0 +1,54 @@ +package statuschecker + +import ( + "context" + "fmt" + + "github.com/smartcontractkit/chainlink-common/pkg/types" +) + +// CCIPTransactionStatusChecker is an interface that defines the method for checking the status of a transaction. +// CheckMessageStatus checks the status of a transaction for a given message ID. +// It returns a list of transaction statuses, the retry counter, and an error if any occurred during the process. +// + +type CCIPTransactionStatusChecker interface { + CheckMessageStatus(ctx context.Context, msgID string) (transactionStatuses []types.TransactionStatus, retryCounter int, err error) +} + +type TxmStatusChecker struct { + getTransactionStatus func(ctx context.Context, transactionID string) (types.TransactionStatus, error) +} + +func NewTxmStatusChecker(getTransactionStatus func(ctx context.Context, transactionID string) (types.TransactionStatus, error)) *TxmStatusChecker { + return &TxmStatusChecker{getTransactionStatus: getTransactionStatus} +} + +// CheckMessageStatus checks the status of a message by checking the status of all transactions associated with the message ID. +// It returns a slice of all statuses and the number of transactions found (-1 if none). +// The key will follow the format: -. TXM will be queried for each key until a NotFound error is returned. +// The goal is to find all transactions associated with a message ID and snooze messages if they are fatal in the Execution Plugin. +func (tsc *TxmStatusChecker) CheckMessageStatus(ctx context.Context, msgID string) ([]types.TransactionStatus, int, error) { + var counter int + const maxStatuses = 1000 // Cap the number of statuses to avoid infinite loop + + allStatuses := make([]types.TransactionStatus, 0) + + for { + transactionID := fmt.Sprintf("%s-%d", msgID, counter) + status, err := tsc.getTransactionStatus(ctx, transactionID) + if err != nil && status == types.Unknown { + // If the status is unknown and err not nil, it means the transaction was not found + break + } + allStatuses = append(allStatuses, status) + counter++ + + // Break the loop if the cap is reached + if counter >= maxStatuses { + return allStatuses, counter - 1, fmt.Errorf("maximum number of statuses reached, possible infinite loop") + } + } + + return allStatuses, counter - 1, nil +} diff --git a/core/services/relay/evm/statuschecker/txm_status_checker_test.go b/core/services/relay/evm/statuschecker/txm_status_checker_test.go new file mode 100644 index 00000000000..456d07e7a7d --- /dev/null +++ b/core/services/relay/evm/statuschecker/txm_status_checker_test.go @@ -0,0 +1,103 @@ +package statuschecker + +import ( + "context" + "errors" + "fmt" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + + "github.com/smartcontractkit/chainlink-common/pkg/types" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/txmgr/mocks" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" +) + +func Test_CheckMessageStatus(t *testing.T) { + testutils.SkipShort(t, "") + ctx := context.Background() + mockTxManager := mocks.NewMockEvmTxManager(t) + checker := NewTxmStatusChecker(mockTxManager.GetTransactionStatus) + + msgID := "test-message-id" + + // Define test cases + testCases := []struct { + name string + setupMock func() + expectedStatus []types.TransactionStatus + expectedCounter int + expectedError error + }{ + { + name: "No transactions found", + setupMock: func() { + mockTxManager.Mock = mock.Mock{} + mockTxManager.On("GetTransactionStatus", ctx, "test-message-id-0").Return(types.Unknown, errors.New("failed to find transaction with IdempotencyKey test-message-id-0")) + }, + expectedStatus: []types.TransactionStatus{}, + expectedCounter: -1, + expectedError: nil, + }, + { + name: "Single transaction found", + setupMock: func() { + mockTxManager.Mock = mock.Mock{} + mockTxManager.On("GetTransactionStatus", ctx, "test-message-id-0").Return(types.Finalized, nil) + mockTxManager.On("GetTransactionStatus", ctx, "test-message-id-1").Return(types.Unknown, errors.New("failed to find transaction with IdempotencyKey test-message-id-1")) + }, + expectedStatus: []types.TransactionStatus{types.Finalized}, + expectedCounter: 0, + expectedError: nil, + }, + { + name: "Multiple transactions found", + setupMock: func() { + mockTxManager.Mock = mock.Mock{} + mockTxManager.On("GetTransactionStatus", ctx, "test-message-id-0").Return(types.Finalized, nil) + mockTxManager.On("GetTransactionStatus", ctx, "test-message-id-1").Return(types.Failed, nil) + mockTxManager.On("GetTransactionStatus", ctx, "test-message-id-2").Return(types.Unknown, errors.New("failed to find transaction with IdempotencyKey test-message-id-2")) + }, + expectedStatus: []types.TransactionStatus{types.Finalized, types.Failed}, + expectedCounter: 1, + expectedError: nil, + }, + { + name: "Unknown status without nil (in progress)", + setupMock: func() { + mockTxManager.Mock = mock.Mock{} + mockTxManager.On("GetTransactionStatus", ctx, "test-message-id-0").Return(types.Unknown, nil) + mockTxManager.On("GetTransactionStatus", ctx, "test-message-id-1").Return(types.Unknown, errors.New("failed to find transaction with IdempotencyKey test-message-id-1")) + }, + expectedStatus: []types.TransactionStatus{types.Unknown}, + expectedCounter: 0, + expectedError: nil, + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + tc.setupMock() + statuses, counter, err := checker.CheckMessageStatus(ctx, msgID) + assert.Equal(t, tc.expectedStatus, statuses) + assert.Equal(t, tc.expectedCounter, counter) + assert.Equal(t, tc.expectedError, err) + mockTxManager.AssertExpectations(t) + }) + } +} + +func Test_FailForMoreThan1000Retries(t *testing.T) { + ctx := context.Background() + mockTxManager := mocks.NewMockEvmTxManager(t) + checker := NewTxmStatusChecker(mockTxManager.GetTransactionStatus) + + for i := 0; i < 1000; i++ { + mockTxManager.On("GetTransactionStatus", ctx, fmt.Sprintf("test-message-id-%d", i)).Return(types.Finalized, nil) + } + + msgID := "test-message-id" + _, _, err := checker.CheckMessageStatus(ctx, msgID) + assert.EqualError(t, err, "maximum number of statuses reached, possible infinite loop") +} diff --git a/core/services/relay/evm/types/codec_entry.go b/core/services/relay/evm/types/codec_entry.go index 38242c43a2d..6a39f9d226f 100644 --- a/core/services/relay/evm/types/codec_entry.go +++ b/core/services/relay/evm/types/codec_entry.go @@ -57,12 +57,25 @@ func (entry *codecEntry) NativeType() reflect.Type { return entry.nativeType } -func (entry *codecEntry) ToNative(checked reflect.Value) (reflect.Value, error) { - if checked.Type() != reflect.PointerTo(entry.checkedType) { - return reflect.Value{}, fmt.Errorf("%w: checked type %v does not match expected type %v", commontypes.ErrInvalidType, reflect.TypeOf(checked), entry.checkedType) +func (entry *codecEntry) ToNative(checked reflect.Value) (val reflect.Value, err error) { + defer func() { + if r := recover(); r != nil { + val = reflect.Value{} + err = fmt.Errorf("invalid checked value: %v", r) + } + }() + + // some checked types are expected to be pointers already for e.g. big numbers, so this is fine + checkedTypeIsPtr := entry.checkedType == checked.Type() + if checked.Type() != reflect.PointerTo(entry.checkedType) && !checkedTypeIsPtr { + return reflect.Value{}, fmt.Errorf("%w: checked type %v does not match expected type %v", commontypes.ErrInvalidType, checked.Type(), entry.checkedType) + } + + if checkedTypeIsPtr { + return reflect.NewAt(entry.nativeType.Elem(), checked.UnsafePointer()), nil } - return reflect.NewAt(entry.nativeType, checked.UnsafePointer()), nil + return reflect.Indirect(reflect.NewAt(entry.nativeType, checked.UnsafePointer())), nil } func (entry *codecEntry) IsNativePointer(item reflect.Type) bool { @@ -200,7 +213,7 @@ func getNativeAndCheckedTypesForArg(arg *abi.Argument) (reflect.Type, reflect.Ty return reflect.TypeOf(common.Hash{}), reflect.TypeOf(common.Hash{}), nil } fallthrough - case abi.SliceTy, abi.TupleTy, abi.FixedBytesTy, abi.FixedPointTy, abi.FunctionTy: + case abi.SliceTy, abi.TupleTy, abi.FixedPointTy, abi.FunctionTy: // https://github.com/ethereum/go-ethereum/blob/release/1.12/accounts/abi/topics.go#L78 return nil, nil, fmt.Errorf("%w: unsupported indexed type: %v", commontypes.ErrInvalidConfig, arg.Type) default: diff --git a/core/services/relay/evm/types/codec_entry_test.go b/core/services/relay/evm/types/codec_entry_test.go index 06b08fcecf2..c71d5c0ad33 100644 --- a/core/services/relay/evm/types/codec_entry_test.go +++ b/core/services/relay/evm/types/codec_entry_test.go @@ -47,14 +47,13 @@ func TestCodecEntry(t *testing.T) { f4 := big.NewInt( /*2^23 - 1*/ 8388607) setAndVerifyLimit(t, (*int24)(f4), f4, iChecked.FieldByName("Field4")) - rNative, err := entry.ToNative(checked) - require.NoError(t, err) - iNative := reflect.Indirect(rNative) - assert.Equal(t, iNative.Field(0).Interface(), iChecked.Field(0).Interface()) - assert.Equal(t, iNative.Field(1).Interface(), iChecked.Field(1).Interface()) - assert.Equal(t, iNative.Field(2).Interface(), f3) - assert.Equal(t, iNative.Field(3).Interface(), f4) - assertHaveSameStructureAndNames(t, iNative.Type(), entry.CheckedType()) + native, err := entry.ToNative(checked) + require.NoError(t, err) + assert.Equal(t, native.Field(0).Interface(), iChecked.Field(0).Interface()) + assert.Equal(t, native.Field(1).Interface(), iChecked.Field(1).Interface()) + assert.Equal(t, native.Field(2).Interface(), f3) + assert.Equal(t, native.Field(3).Interface(), f4) + assertHaveSameStructureAndNames(t, native.Type(), entry.CheckedType()) }) t.Run("tuples", func(t *testing.T) { @@ -86,12 +85,11 @@ func TestCodecEntry(t *testing.T) { native, err := entry.ToNative(checked) require.NoError(t, err) - iNative := reflect.Indirect(native) - require.Equal(t, iNative.Field(0).Interface(), iChecked.Field(0).Interface()) - nF2 := reflect.Indirect(iNative.Field(1)) + require.Equal(t, native.Field(0).Interface(), iChecked.Field(0).Interface()) + nF2 := reflect.Indirect(native.Field(1)) assert.Equal(t, nF2.Field(0).Interface(), f3) assert.Equal(t, nF2.Field(1).Interface(), f4) - assertHaveSameStructureAndNames(t, iNative.Type(), entry.CheckedType()) + assertHaveSameStructureAndNames(t, native.Type(), entry.CheckedType()) }) t.Run("nested tuple member names are capitalized", func(t *testing.T) { @@ -123,12 +121,11 @@ func TestCodecEntry(t *testing.T) { native, err := entry.ToNative(checked) require.NoError(t, err) - iNative := reflect.Indirect(native) - require.Equal(t, iNative.Field(0).Interface(), iChecked.Field(0).Interface()) - nF2 := reflect.Indirect(iNative.Field(1)) + require.Equal(t, native.Field(0).Interface(), iChecked.Field(0).Interface()) + nF2 := reflect.Indirect(native.Field(1)) assert.Equal(t, nF2.Field(0).Interface(), f3) assert.Equal(t, nF2.Field(1).Interface(), f4) - assertHaveSameStructureAndNames(t, iNative.Type(), entry.CheckedType()) + assertHaveSameStructureAndNames(t, native.Type(), entry.CheckedType()) }) t.Run("unwrapped types", func(t *testing.T) { @@ -145,9 +142,8 @@ func TestCodecEntry(t *testing.T) { iChecked.FieldByName("Field1").Set(reflect.ValueOf(&anyValue)) native, err := entry.ToNative(checked) require.NoError(t, err) - iNative := reflect.Indirect(native) - assert.Equal(t, &anyValue, iNative.FieldByName("Field1").Interface()) - assertHaveSameStructureAndNames(t, iNative.Type(), entry.CheckedType()) + assert.Equal(t, &anyValue, native.FieldByName("Field1").Interface()) + assertHaveSameStructureAndNames(t, native.Type(), entry.CheckedType()) }) t.Run("slice types", func(t *testing.T) { @@ -162,9 +158,8 @@ func TestCodecEntry(t *testing.T) { iChecked.FieldByName("Field1").Set(reflect.ValueOf(anySliceValue)) native, err := entry.ToNative(checked) require.NoError(t, err) - iNative := reflect.Indirect(native) - assert.Equal(t, anySliceValue, iNative.FieldByName("Field1").Interface()) - assertHaveSameStructureAndNames(t, iNative.Type(), entry.CheckedType()) + assert.Equal(t, anySliceValue, native.FieldByName("Field1").Interface()) + assertHaveSameStructureAndNames(t, native.Type(), entry.CheckedType()) }) t.Run("array types", func(t *testing.T) { @@ -178,8 +173,7 @@ func TestCodecEntry(t *testing.T) { iChecked.FieldByName("Field1").Set(reflect.ValueOf(anySliceValue)) native, err := entry.ToNative(checked) require.NoError(t, err) - iNative := reflect.Indirect(native) - assert.Equal(t, anySliceValue, iNative.FieldByName("Field1").Interface()) + assert.Equal(t, anySliceValue, native.FieldByName("Field1").Interface()) }) t.Run("Not return values makes struct{}", func(t *testing.T) { @@ -188,7 +182,7 @@ func TestCodecEntry(t *testing.T) { assert.Equal(t, reflect.TypeOf(struct{}{}), entry.CheckedType()) native, err := entry.ToNative(reflect.ValueOf(&struct{}{})) require.NoError(t, err) - assert.Equal(t, &struct{}{}, native.Interface()) + assert.Equal(t, struct{}{}, native.Interface()) }) t.Run("Address works", func(t *testing.T) { @@ -204,9 +198,8 @@ func TestCodecEntry(t *testing.T) { native, err := entry.ToNative(checked) require.NoError(t, err) - iNative := reflect.Indirect(native) - assert.Equal(t, anyAddr, iNative.FieldByName("Foo").Interface()) - assertHaveSameStructureAndNames(t, iNative.Type(), entry.CheckedType()) + assert.Equal(t, anyAddr, native.FieldByName("Foo").Interface()) + assertHaveSameStructureAndNames(t, native.Type(), entry.CheckedType()) }) t.Run("Unnamed parameters are named after their locations", func(t *testing.T) { @@ -269,21 +262,30 @@ func TestCodecEntry(t *testing.T) { assert.Equal(t, reflect.TypeOf((*int16)(nil)), checkedField.Type) native, err := entry.ToNative(reflect.New(entry.CheckedType())) require.NoError(t, err) - iNative := reflect.Indirect(native) - assertHaveSameStructureAndNames(t, iNative.Type(), entry.CheckedType()) + assertHaveSameStructureAndNames(t, native.Type(), entry.CheckedType()) }) - t.Run("Indexed non basic types change to hash", func(t *testing.T) { - anyType, err := abi.NewType("string", "", []abi.ArgumentMarshaling{}) + t.Run("Indexed string and bytes array change to hash", func(t *testing.T) { + stringType, err := abi.NewType("string", "", []abi.ArgumentMarshaling{}) require.NoError(t, err) - entry := NewCodecEntry(abi.Arguments{{Name: "Name", Type: anyType, Indexed: true}}, nil, nil) - require.NoError(t, entry.Init()) - nativeField, ok := entry.CheckedType().FieldByName("Name") - require.True(t, ok) - assert.Equal(t, reflect.TypeOf(&common.Hash{}), nativeField.Type) - native, err := entry.ToNative(reflect.New(entry.CheckedType())) + arrayType, err := abi.NewType("uint8[32]", "", []abi.ArgumentMarshaling{}) require.NoError(t, err) - assertHaveSameStructureAndNames(t, native.Type().Elem(), entry.CheckedType()) + + abiArgs := abi.Arguments{ + {Name: "String", Type: stringType, Indexed: true}, + {Name: "Array", Type: arrayType, Indexed: true}, + } + + for i := 0; i < len(abiArgs); i++ { + entry := NewCodecEntry(abi.Arguments{abiArgs[i]}, nil, nil) + require.NoError(t, entry.Init()) + nativeField, ok := entry.CheckedType().FieldByName(abiArgs[i].Name) + require.True(t, ok) + assert.Equal(t, reflect.TypeOf(&common.Hash{}), nativeField.Type) + native, err := entry.ToNative(reflect.New(entry.CheckedType())) + require.NoError(t, err) + assertHaveSameStructureAndNames(t, native.Type(), entry.CheckedType()) + } }) t.Run("Too many indexed items returns an error", func(t *testing.T) { diff --git a/core/services/relay/evm/types/mocks/log_poller_wrapper.go b/core/services/relay/evm/types/mocks/log_poller_wrapper.go index 4febb453693..de46154d138 100644 --- a/core/services/relay/evm/types/mocks/log_poller_wrapper.go +++ b/core/services/relay/evm/types/mocks/log_poller_wrapper.go @@ -14,6 +14,14 @@ type LogPollerWrapper struct { mock.Mock } +type LogPollerWrapper_Expecter struct { + mock *mock.Mock +} + +func (_m *LogPollerWrapper) EXPECT() *LogPollerWrapper_Expecter { + return &LogPollerWrapper_Expecter{mock: &_m.Mock} +} + // Close provides a mock function with given fields: func (_m *LogPollerWrapper) Close() error { ret := _m.Called() @@ -32,6 +40,33 @@ func (_m *LogPollerWrapper) Close() error { return r0 } +// LogPollerWrapper_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close' +type LogPollerWrapper_Close_Call struct { + *mock.Call +} + +// Close is a helper method to define mock.On call +func (_e *LogPollerWrapper_Expecter) Close() *LogPollerWrapper_Close_Call { + return &LogPollerWrapper_Close_Call{Call: _e.mock.On("Close")} +} + +func (_c *LogPollerWrapper_Close_Call) Run(run func()) *LogPollerWrapper_Close_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *LogPollerWrapper_Close_Call) Return(_a0 error) *LogPollerWrapper_Close_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *LogPollerWrapper_Close_Call) RunAndReturn(run func() error) *LogPollerWrapper_Close_Call { + _c.Call.Return(run) + return _c +} + // HealthReport provides a mock function with given fields: func (_m *LogPollerWrapper) HealthReport() map[string]error { ret := _m.Called() @@ -52,6 +87,33 @@ func (_m *LogPollerWrapper) HealthReport() map[string]error { return r0 } +// LogPollerWrapper_HealthReport_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HealthReport' +type LogPollerWrapper_HealthReport_Call struct { + *mock.Call +} + +// HealthReport is a helper method to define mock.On call +func (_e *LogPollerWrapper_Expecter) HealthReport() *LogPollerWrapper_HealthReport_Call { + return &LogPollerWrapper_HealthReport_Call{Call: _e.mock.On("HealthReport")} +} + +func (_c *LogPollerWrapper_HealthReport_Call) Run(run func()) *LogPollerWrapper_HealthReport_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *LogPollerWrapper_HealthReport_Call) Return(_a0 map[string]error) *LogPollerWrapper_HealthReport_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *LogPollerWrapper_HealthReport_Call) RunAndReturn(run func() map[string]error) *LogPollerWrapper_HealthReport_Call { + _c.Call.Return(run) + return _c +} + // LatestEvents provides a mock function with given fields: ctx func (_m *LogPollerWrapper) LatestEvents(ctx context.Context) ([]types.OracleRequest, []types.OracleResponse, error) { ret := _m.Called(ctx) @@ -91,6 +153,34 @@ func (_m *LogPollerWrapper) LatestEvents(ctx context.Context) ([]types.OracleReq return r0, r1, r2 } +// LogPollerWrapper_LatestEvents_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LatestEvents' +type LogPollerWrapper_LatestEvents_Call struct { + *mock.Call +} + +// LatestEvents is a helper method to define mock.On call +// - ctx context.Context +func (_e *LogPollerWrapper_Expecter) LatestEvents(ctx interface{}) *LogPollerWrapper_LatestEvents_Call { + return &LogPollerWrapper_LatestEvents_Call{Call: _e.mock.On("LatestEvents", ctx)} +} + +func (_c *LogPollerWrapper_LatestEvents_Call) Run(run func(ctx context.Context)) *LogPollerWrapper_LatestEvents_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *LogPollerWrapper_LatestEvents_Call) Return(_a0 []types.OracleRequest, _a1 []types.OracleResponse, _a2 error) *LogPollerWrapper_LatestEvents_Call { + _c.Call.Return(_a0, _a1, _a2) + return _c +} + +func (_c *LogPollerWrapper_LatestEvents_Call) RunAndReturn(run func(context.Context) ([]types.OracleRequest, []types.OracleResponse, error)) *LogPollerWrapper_LatestEvents_Call { + _c.Call.Return(run) + return _c +} + // Name provides a mock function with given fields: func (_m *LogPollerWrapper) Name() string { ret := _m.Called() @@ -109,6 +199,33 @@ func (_m *LogPollerWrapper) Name() string { return r0 } +// LogPollerWrapper_Name_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Name' +type LogPollerWrapper_Name_Call struct { + *mock.Call +} + +// Name is a helper method to define mock.On call +func (_e *LogPollerWrapper_Expecter) Name() *LogPollerWrapper_Name_Call { + return &LogPollerWrapper_Name_Call{Call: _e.mock.On("Name")} +} + +func (_c *LogPollerWrapper_Name_Call) Run(run func()) *LogPollerWrapper_Name_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *LogPollerWrapper_Name_Call) Return(_a0 string) *LogPollerWrapper_Name_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *LogPollerWrapper_Name_Call) RunAndReturn(run func() string) *LogPollerWrapper_Name_Call { + _c.Call.Return(run) + return _c +} + // Ready provides a mock function with given fields: func (_m *LogPollerWrapper) Ready() error { ret := _m.Called() @@ -127,6 +244,33 @@ func (_m *LogPollerWrapper) Ready() error { return r0 } +// LogPollerWrapper_Ready_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Ready' +type LogPollerWrapper_Ready_Call struct { + *mock.Call +} + +// Ready is a helper method to define mock.On call +func (_e *LogPollerWrapper_Expecter) Ready() *LogPollerWrapper_Ready_Call { + return &LogPollerWrapper_Ready_Call{Call: _e.mock.On("Ready")} +} + +func (_c *LogPollerWrapper_Ready_Call) Run(run func()) *LogPollerWrapper_Ready_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *LogPollerWrapper_Ready_Call) Return(_a0 error) *LogPollerWrapper_Ready_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *LogPollerWrapper_Ready_Call) RunAndReturn(run func() error) *LogPollerWrapper_Ready_Call { + _c.Call.Return(run) + return _c +} + // Start provides a mock function with given fields: _a0 func (_m *LogPollerWrapper) Start(_a0 context.Context) error { ret := _m.Called(_a0) @@ -145,11 +289,69 @@ func (_m *LogPollerWrapper) Start(_a0 context.Context) error { return r0 } +// LogPollerWrapper_Start_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Start' +type LogPollerWrapper_Start_Call struct { + *mock.Call +} + +// Start is a helper method to define mock.On call +// - _a0 context.Context +func (_e *LogPollerWrapper_Expecter) Start(_a0 interface{}) *LogPollerWrapper_Start_Call { + return &LogPollerWrapper_Start_Call{Call: _e.mock.On("Start", _a0)} +} + +func (_c *LogPollerWrapper_Start_Call) Run(run func(_a0 context.Context)) *LogPollerWrapper_Start_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *LogPollerWrapper_Start_Call) Return(_a0 error) *LogPollerWrapper_Start_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *LogPollerWrapper_Start_Call) RunAndReturn(run func(context.Context) error) *LogPollerWrapper_Start_Call { + _c.Call.Return(run) + return _c +} + // SubscribeToUpdates provides a mock function with given fields: ctx, name, subscriber func (_m *LogPollerWrapper) SubscribeToUpdates(ctx context.Context, name string, subscriber types.RouteUpdateSubscriber) { _m.Called(ctx, name, subscriber) } +// LogPollerWrapper_SubscribeToUpdates_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SubscribeToUpdates' +type LogPollerWrapper_SubscribeToUpdates_Call struct { + *mock.Call +} + +// SubscribeToUpdates is a helper method to define mock.On call +// - ctx context.Context +// - name string +// - subscriber types.RouteUpdateSubscriber +func (_e *LogPollerWrapper_Expecter) SubscribeToUpdates(ctx interface{}, name interface{}, subscriber interface{}) *LogPollerWrapper_SubscribeToUpdates_Call { + return &LogPollerWrapper_SubscribeToUpdates_Call{Call: _e.mock.On("SubscribeToUpdates", ctx, name, subscriber)} +} + +func (_c *LogPollerWrapper_SubscribeToUpdates_Call) Run(run func(ctx context.Context, name string, subscriber types.RouteUpdateSubscriber)) *LogPollerWrapper_SubscribeToUpdates_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(types.RouteUpdateSubscriber)) + }) + return _c +} + +func (_c *LogPollerWrapper_SubscribeToUpdates_Call) Return() *LogPollerWrapper_SubscribeToUpdates_Call { + _c.Call.Return() + return _c +} + +func (_c *LogPollerWrapper_SubscribeToUpdates_Call) RunAndReturn(run func(context.Context, string, types.RouteUpdateSubscriber)) *LogPollerWrapper_SubscribeToUpdates_Call { + _c.Call.Return(run) + return _c +} + // NewLogPollerWrapper creates a new instance of LogPollerWrapper. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewLogPollerWrapper(t interface { diff --git a/core/services/relay/evm/types/types.go b/core/services/relay/evm/types/types.go index e09f48f1337..c1f814c5965 100644 --- a/core/services/relay/evm/types/types.go +++ b/core/services/relay/evm/types/types.go @@ -100,11 +100,9 @@ type EventDefinitions struct { // GenericTopicNames helps QueryingKeys not rely on EVM specific topic names. Key is chain specific name, value is generic name. // This helps us translate chain agnostic querying key "transfer-value" to EVM specific "evmTransferEvent-weiAmountTopic". GenericTopicNames map[string]string `json:"genericTopicNames,omitempty"` - // key is a predefined generic name for evm log event data word - // for e.g. first evm data word(32bytes) of USDC log event is value so the key can be called value - GenericDataWordNames map[string]uint8 `json:"genericDataWordNames,omitempty"` - // InputFields allows you to choose which indexed fields are expected from the input - InputFields []string `json:"inputFields,omitempty"` + // GenericDataWordNames key is generic name for evm log event data word that maps to on chain name. + // For e.g. first evm data word(32bytes) of USDC log event is value so the key can be called value. + GenericDataWordNames map[string]string `json:"genericDataWordDefs,omitempty"` // PollingFilter should be defined on a contract level in ContractPollingFilter, // unless event needs to override the contract level filter options. // This will create a separate log poller filter for this event. @@ -195,6 +193,9 @@ type RelayConfig struct { // Mercury-specific FeedID *common.Hash `json:"feedID"` EnableTriggerCapability bool `json:"enableTriggerCapability"` + + // LLO-specific + LLODONID uint32 `json:"lloDonID" toml:"lloDonID"` } var ErrBadRelayConfig = errors.New("bad relay config") @@ -265,8 +266,6 @@ type RouteUpdateSubscriber interface { } // A LogPoller wrapper that understands router proxy contracts -// -//go:generate mockery --quiet --name LogPollerWrapper --output ./mocks/ --case=underscore type LogPollerWrapper interface { services.Service LatestEvents(ctx context.Context) ([]OracleRequest, []OracleResponse, error) diff --git a/core/services/relay/evm/types/types_test.go b/core/services/relay/evm/types/types_test.go index 37d5e77693a..11825ae5c40 100644 --- a/core/services/relay/evm/types/types_test.go +++ b/core/services/relay/evm/types/types_test.go @@ -80,7 +80,7 @@ func Test_ChainReaderConfig(t *testing.T) { } }, "configs":{ - "config1":"{\"cacheEnabled\":true,\"chainSpecificName\":\"specificName1\",\"inputModifications\":[{\"Fields\":[\"ts\"],\"Type\":\"epoch to time\"},{\"Fields\":{\"a\":\"b\"},\"Type\":\"rename\"}],\"outputModifications\":[{\"Fields\":[\"ts\"],\"Type\":\"epoch to time\"},{\"Fields\":{\"c\":\"d\"},\"Type\":\"rename\"}],\"eventDefinitions\":{\"genericTopicNames\":{\"TopicKey1\":\"TopicVal1\"},\"genericDataWordNames\":{\"DataWordKey\":1},\"inputFields\":[\"Event1\",\"Event2\"],\"pollingFilter\":{\"topic2\":[\"0x4abbe4784b1fb071039bb9cb50b82978fb5d3ab98fb512c032e75786b93e2c52\"],\"topic3\":[\"0x5abbe4784b1fb071039bb9cb50b82978fb5d3ab98fb512c032e75786b93e2c52\"],\"topic4\":[\"0x6abbe4784b1fb071039bb9cb50b82978fb5d3ab98fb512c032e75786b93e2c52\"],\"retention\":\"1m0s\",\"maxLogsKept\":100,\"logsPerBlock\":10}},\"confidenceConfirmations\":{\"0.0\":0,\"1.0\":-1}}" + "config1":"{\"cacheEnabled\":true,\"chainSpecificName\":\"specificName1\",\"inputModifications\":[{\"Fields\":[\"ts\"],\"Type\":\"epoch to time\"},{\"Fields\":{\"a\":\"b\"},\"Type\":\"rename\"}],\"outputModifications\":[{\"Fields\":[\"ts\"],\"Type\":\"epoch to time\"},{\"Fields\":{\"c\":\"d\"},\"Type\":\"rename\"}],\"eventDefinitions\":{\"genericTopicNames\":{\"TopicKey1\":\"TopicVal1\"},\"genericDataWordDefs\":{\"DataWordKey\": \"DataWordKey\"},\"pollingFilter\":{\"topic2\":[\"0x4abbe4784b1fb071039bb9cb50b82978fb5d3ab98fb512c032e75786b93e2c52\"],\"topic3\":[\"0x5abbe4784b1fb071039bb9cb50b82978fb5d3ab98fb512c032e75786b93e2c52\"],\"topic4\":[\"0x6abbe4784b1fb071039bb9cb50b82978fb5d3ab98fb512c032e75786b93e2c52\"],\"retention\":\"1m0s\",\"maxLogsKept\":100,\"logsPerBlock\":10}},\"confidenceConfirmations\":{\"0.0\":0,\"1.0\":-1}}" } } } @@ -128,8 +128,7 @@ func Test_ChainReaderConfig(t *testing.T) { ConfidenceConfirmations: map[string]int{"0.0": 0, "1.0": -1}, EventDefinitions: &EventDefinitions{ GenericTopicNames: map[string]string{"TopicKey1": "TopicVal1"}, - GenericDataWordNames: map[string]uint8{"DataWordKey": 1}, - InputFields: []string{"Event1", "Event2"}, + GenericDataWordNames: map[string]string{"DataWordKey": "DataWordKey"}, PollingFilter: &PollingFilter{ Topic2: evmtypes.HashArray{common.HexToHash("0x4abbe4784b1fb071039bb9cb50b82978fb5d3ab98fb512c032e75786b93e2c52")}, Topic3: evmtypes.HashArray{common.HexToHash("0x5abbe4784b1fb071039bb9cb50b82978fb5d3ab98fb512c032e75786b93e2c52")}, diff --git a/core/services/relay/evm/write_target.go b/core/services/relay/evm/write_target.go index fb1c694a2e7..14e6d1bf348 100644 --- a/core/services/relay/evm/write_target.go +++ b/core/services/relay/evm/write_target.go @@ -7,14 +7,15 @@ import ( chainselectors "github.com/smartcontractkit/chain-selectors" + "github.com/smartcontractkit/chainlink-common/pkg/logger" + "github.com/smartcontractkit/chainlink/v2/core/capabilities/targets" "github.com/smartcontractkit/chainlink/v2/core/chains/legacyevm" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/forwarder" - "github.com/smartcontractkit/chainlink/v2/core/logger" relayevmtypes "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/types" ) -func NewWriteTarget(ctx context.Context, relayer *Relayer, chain legacyevm.Chain, lggr logger.Logger) (*targets.WriteTarget, error) { +func NewWriteTarget(ctx context.Context, relayer *Relayer, chain legacyevm.Chain, gasLimitDefault uint64, lggr logger.Logger) (*targets.WriteTarget, error) { // generate ID based on chain selector id := fmt.Sprintf("write_%v@1.0.0", chain.ID()) chainName, err := chainselectors.NameFromChainId(chain.ID().Uint64()) @@ -31,8 +32,8 @@ func NewWriteTarget(ctx context.Context, relayer *Relayer, chain legacyevm.Chain "forwarder": { ContractABI: forwarder.KeystoneForwarderABI, Configs: map[string]*relayevmtypes.ChainReaderDefinition{ - "getTransmitter": { - ChainSpecificName: "getTransmitter", + "getTransmissionInfo": { + ChainSpecificName: "getTransmissionInfo", }, }, }, @@ -53,9 +54,8 @@ func NewWriteTarget(ctx context.Context, relayer *Relayer, chain legacyevm.Chain Configs: map[string]*relayevmtypes.ChainWriterDefinition{ "report": { ChainSpecificName: "report", - Checker: "simulate", FromAddress: config.FromAddress().Address(), - GasLimit: 200_000, + GasLimit: gasLimitDefault, }, }, }, @@ -73,5 +73,5 @@ func NewWriteTarget(ctx context.Context, relayer *Relayer, chain legacyevm.Chain return nil, err } - return targets.NewWriteTarget(lggr, id, cr, cw, config.ForwarderAddress().String()), nil + return targets.NewWriteTarget(logger.Named(lggr, "WriteTarget"), id, cr, cw, config.ForwarderAddress().String(), gasLimitDefault), nil } diff --git a/core/services/relay/evm/write_target_test.go b/core/services/relay/evm/write_target_test.go index 694f7e1910c..94b2367b6d6 100644 --- a/core/services/relay/evm/write_target_test.go +++ b/core/services/relay/evm/write_target_test.go @@ -1,11 +1,18 @@ package evm_test import ( + "bytes" + "encoding/hex" "errors" + "fmt" "math/big" "testing" + "github.com/ethereum/go-ethereum/common" + "github.com/smartcontractkit/chainlink-common/pkg/values" + "github.com/smartcontractkit/chainlink/v2/common/headtracker/mocks" + "github.com/smartcontractkit/chainlink/v2/core/capabilities/targets" "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/pgtest" "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm" @@ -14,6 +21,7 @@ import ( evmcapabilities "github.com/smartcontractkit/chainlink/v2/core/capabilities" evmclimocks "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client/mocks" gasmocks "github.com/smartcontractkit/chainlink/v2/core/chains/evm/gas/mocks" + pollermocks "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller/mocks" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/txmgr" txmmocks "github.com/smartcontractkit/chainlink/v2/core/chains/evm/txmgr/mocks" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" @@ -33,22 +41,84 @@ import ( var forwardABI = types.MustGetABI(forwarder.KeystoneForwarderMetaData.ABI) +func newMockedEncodeTransmissionInfo() ([]byte, error) { + info := targets.TransmissionInfo{ + GasLimit: big.NewInt(0), + InvalidReceiver: false, + State: 0, + Success: false, + TransmissionId: [32]byte{}, + Transmitter: common.HexToAddress("0x0"), + } + + var buffer bytes.Buffer + gasLimitBytes := info.GasLimit.Bytes() + if len(gasLimitBytes) > 80 { + return nil, fmt.Errorf("GasLimit too large") + } + paddedGasLimit := make([]byte, 80-len(gasLimitBytes)) + buffer.Write(paddedGasLimit) + buffer.Write(gasLimitBytes) + + // Encode InvalidReceiver (as uint8) + if info.InvalidReceiver { + buffer.WriteByte(1) + } else { + buffer.WriteByte(0) + } + + // Padding for InvalidReceiver to fit into 32 bytes + padInvalidReceiver := make([]byte, 31) + buffer.Write(padInvalidReceiver) + + // Encode State (as uint8) + buffer.WriteByte(info.State) + + // Padding for State to fit into 32 bytes + padState := make([]byte, 31) + buffer.Write(padState) + + // Encode Success (as uint8) + if info.Success { + buffer.WriteByte(1) + } else { + buffer.WriteByte(0) + } + + // Padding for Success to fit into 32 bytes + padSuccess := make([]byte, 31) + buffer.Write(padSuccess) + + // Encode TransmissionId (as bytes32) + buffer.Write(info.TransmissionId[:]) + + // Encode Transmitter (as address) + buffer.Write(info.Transmitter.Bytes()) + + return buffer.Bytes(), nil +} + func TestEvmWrite(t *testing.T) { chain := evmmocks.NewChain(t) txManager := txmmocks.NewMockEvmTxManager(t) evmClient := evmclimocks.NewClient(t) + poller := pollermocks.NewLogPoller(t) - // This probably isn't the best way to do this, but couldn't find a simpler way to mock the CallContract response - var mockCall []byte - for i := 0; i < 32; i++ { - mockCall = append(mockCall, byte(0)) - } + // This is a very error-prone way to mock an on-chain response to a GetLatestValue("getTransmissionInfo") call + // It's a bit of a hack, but it's the best way to do it without a lot of refactoring + mockCall, err := newMockedEncodeTransmissionInfo() + require.NoError(t, err) evmClient.On("CallContract", mock.Anything, mock.Anything, mock.Anything).Return(mockCall, nil).Maybe() evmClient.On("CodeAt", mock.Anything, mock.Anything, mock.Anything).Return([]byte("test"), nil) chain.On("ID").Return(big.NewInt(11155111)) chain.On("TxManager").Return(txManager) - chain.On("LogPoller").Return(nil) + chain.On("LogPoller").Return(poller) + + ht := mocks.NewHeadTracker[*types.Head, common.Hash](t) + ht.On("LatestAndFinalizedBlock", mock.Anything).Return(&types.Head{}, &types.Head{}, nil) + chain.On("HeadTracker").Return(ht) + chain.On("Client").Return(evmClient) cfg := configtest.NewGeneralConfig(t, func(c *chainlink.Config, s *chainlink.Secrets) { @@ -79,86 +149,76 @@ func TestEvmWrite(t *testing.T) { }) require.NoError(t, err) - txManager.On("CreateTransaction", mock.Anything, mock.Anything).Return(txmgr.Tx{}, nil).Run(func(args mock.Arguments) { - req := args.Get(1).(txmgr.TxRequest) - payload := make(map[string]any) - method := forwardABI.Methods["report"] - err = method.Inputs.UnpackIntoMap(payload, req.EncodedPayload[4:]) - require.NoError(t, err) - require.Equal(t, []byte{0x1, 0x2, 0x3}, payload["rawReport"]) - require.Equal(t, [][]byte{}, payload["signatures"]) - }).Once() - - t.Run("succeeds with valid report", func(t *testing.T) { - ctx := testutils.Context(t) - capability, err := evm.NewWriteTarget(ctx, relayer, chain, lggr) - require.NoError(t, err) + reportID := [2]byte{0x00, 0x01} + reportMetadata := targets.ReportV1Metadata{ + Version: 1, + WorkflowExecutionID: [32]byte{}, + Timestamp: 0, + DonID: 0, + DonConfigVersion: 0, + WorkflowCID: [32]byte{}, + WorkflowName: [10]byte{}, + WorkflowOwner: [20]byte{}, + ReportID: reportID, + } - config, err := values.NewMap(map[string]any{ - "Address": evmCfg.EVM().Workflow().ForwarderAddress().String(), - }) - require.NoError(t, err) + reportMetadataBytes, err := reportMetadata.Encode() + require.NoError(t, err) - inputs, err := values.NewMap(map[string]any{ - "signed_report": map[string]any{ - "report": []byte{1, 2, 3}, - "signatures": [][]byte{}, - "context": []byte{4, 5}, - "id": []byte{9, 9}, - }, - }) - require.NoError(t, err) + signatures := [][]byte{} - req := capabilities.CapabilityRequest{ - Metadata: capabilities.RequestMetadata{ - WorkflowID: "test-id", - }, - Config: config, - Inputs: inputs, - } + validInputs, err := values.NewMap(map[string]any{ + "signed_report": map[string]any{ + "report": reportMetadataBytes, + "signatures": signatures, + "context": []byte{4, 5}, + "id": reportID[:], + }, + }) + require.NoError(t, err) - ch, err := capability.Execute(ctx, req) - require.NoError(t, err) + validMetadata := capabilities.RequestMetadata{ + WorkflowID: hex.EncodeToString(reportMetadata.WorkflowCID[:]), + WorkflowOwner: hex.EncodeToString(reportMetadata.WorkflowOwner[:]), + WorkflowName: hex.EncodeToString(reportMetadata.WorkflowName[:]), + WorkflowExecutionID: hex.EncodeToString(reportMetadata.WorkflowExecutionID[:]), + } - response := <-ch - require.Nil(t, response.Err) + validConfig, err := values.NewMap(map[string]any{ + "Address": evmCfg.EVM().Workflow().ForwarderAddress().String(), }) + require.NoError(t, err) - t.Run("succeeds with empty report", func(t *testing.T) { - ctx := testutils.Context(t) - capability, err := evm.NewWriteTarget(ctx, relayer, chain, logger.TestLogger(t)) + txManager.On("CreateTransaction", mock.Anything, mock.Anything).Return(txmgr.Tx{}, nil).Run(func(args mock.Arguments) { + req := args.Get(1).(txmgr.TxRequest) + payload := make(map[string]any) + method := forwardABI.Methods["report"] + err = method.Inputs.UnpackIntoMap(payload, req.EncodedPayload[4:]) require.NoError(t, err) + require.Equal(t, reportMetadataBytes, payload["rawReport"]) + require.Equal(t, signatures, payload["signatures"]) + }).Once() - config, err := values.NewMap(map[string]any{ - "Address": evmCfg.EVM().Workflow().ForwarderAddress().String(), - }) - require.NoError(t, err) + gasLimitDefault := uint64(400_000) - inputs, err := values.NewMap(map[string]any{ - "signed_report": map[string]any{ - "report": nil, - }, - }) + t.Run("succeeds with valid report", func(t *testing.T) { + ctx := testutils.Context(t) + capability, err := evm.NewWriteTarget(ctx, relayer, chain, gasLimitDefault, lggr) require.NoError(t, err) req := capabilities.CapabilityRequest{ - Metadata: capabilities.RequestMetadata{ - WorkflowID: "test-id", - }, - Config: config, - Inputs: inputs, + Metadata: validMetadata, + Config: validConfig, + Inputs: validInputs, } - ch, err := capability.Execute(ctx, req) + _, err = capability.Execute(ctx, req) require.NoError(t, err) - - response := <-ch - require.Nil(t, response.Err) }) t.Run("fails with invalid config", func(t *testing.T) { ctx := testutils.Context(t) - capability, err := evm.NewWriteTarget(ctx, relayer, chain, logger.TestLogger(t)) + capability, err := evm.NewWriteTarget(ctx, relayer, chain, gasLimitDefault, logger.TestLogger(t)) require.NoError(t, err) invalidConfig, err := values.NewMap(map[string]any{ @@ -166,19 +226,10 @@ func TestEvmWrite(t *testing.T) { }) require.NoError(t, err) - inputs, err := values.NewMap(map[string]any{ - "signed_report": map[string]any{ - "report": nil, - }, - }) - require.NoError(t, err) - req := capabilities.CapabilityRequest{ - Metadata: capabilities.RequestMetadata{ - WorkflowID: "test-id", - }, - Config: invalidConfig, - Inputs: inputs, + Metadata: validMetadata, + Config: invalidConfig, + Inputs: validInputs, } _, err = capability.Execute(ctx, req) @@ -187,30 +238,13 @@ func TestEvmWrite(t *testing.T) { t.Run("fails when TXM CreateTransaction returns error", func(t *testing.T) { ctx := testutils.Context(t) - capability, err := evm.NewWriteTarget(ctx, relayer, chain, logger.TestLogger(t)) - require.NoError(t, err) - - config, err := values.NewMap(map[string]any{ - "Address": evmCfg.EVM().Workflow().ForwarderAddress().String(), - }) - require.NoError(t, err) - - inputs, err := values.NewMap(map[string]any{ - "signed_report": map[string]any{ - "report": []byte{1, 2, 3}, - "signatures": [][]byte{}, - "context": []byte{4, 5}, - "id": []byte{9, 9}, - }, - }) + capability, err := evm.NewWriteTarget(ctx, relayer, chain, gasLimitDefault, logger.TestLogger(t)) require.NoError(t, err) req := capabilities.CapabilityRequest{ - Metadata: capabilities.RequestMetadata{ - WorkflowID: "test-id", - }, - Config: config, - Inputs: inputs, + Metadata: validMetadata, + Config: validConfig, + Inputs: validInputs, } txManager.On("CreateTransaction", mock.Anything, mock.Anything).Return(txmgr.Tx{}, errors.New("TXM error")) diff --git a/core/services/s4/mocks/orm.go b/core/services/s4/mocks/orm.go index 9b627d033e8..a9452c27840 100644 --- a/core/services/s4/mocks/orm.go +++ b/core/services/s4/mocks/orm.go @@ -19,6 +19,14 @@ type ORM struct { mock.Mock } +type ORM_Expecter struct { + mock *mock.Mock +} + +func (_m *ORM) EXPECT() *ORM_Expecter { + return &ORM_Expecter{mock: &_m.Mock} +} + // DeleteExpired provides a mock function with given fields: ctx, limit, utcNow func (_m *ORM) DeleteExpired(ctx context.Context, limit uint, utcNow time.Time) (int64, error) { ret := _m.Called(ctx, limit, utcNow) @@ -47,6 +55,36 @@ func (_m *ORM) DeleteExpired(ctx context.Context, limit uint, utcNow time.Time) return r0, r1 } +// ORM_DeleteExpired_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteExpired' +type ORM_DeleteExpired_Call struct { + *mock.Call +} + +// DeleteExpired is a helper method to define mock.On call +// - ctx context.Context +// - limit uint +// - utcNow time.Time +func (_e *ORM_Expecter) DeleteExpired(ctx interface{}, limit interface{}, utcNow interface{}) *ORM_DeleteExpired_Call { + return &ORM_DeleteExpired_Call{Call: _e.mock.On("DeleteExpired", ctx, limit, utcNow)} +} + +func (_c *ORM_DeleteExpired_Call) Run(run func(ctx context.Context, limit uint, utcNow time.Time)) *ORM_DeleteExpired_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(uint), args[2].(time.Time)) + }) + return _c +} + +func (_c *ORM_DeleteExpired_Call) Return(_a0 int64, _a1 error) *ORM_DeleteExpired_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ORM_DeleteExpired_Call) RunAndReturn(run func(context.Context, uint, time.Time) (int64, error)) *ORM_DeleteExpired_Call { + _c.Call.Return(run) + return _c +} + // Get provides a mock function with given fields: ctx, address, slotId func (_m *ORM) Get(ctx context.Context, address *big.Big, slotId uint) (*s4.Row, error) { ret := _m.Called(ctx, address, slotId) @@ -77,6 +115,36 @@ func (_m *ORM) Get(ctx context.Context, address *big.Big, slotId uint) (*s4.Row, return r0, r1 } +// ORM_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' +type ORM_Get_Call struct { + *mock.Call +} + +// Get is a helper method to define mock.On call +// - ctx context.Context +// - address *big.Big +// - slotId uint +func (_e *ORM_Expecter) Get(ctx interface{}, address interface{}, slotId interface{}) *ORM_Get_Call { + return &ORM_Get_Call{Call: _e.mock.On("Get", ctx, address, slotId)} +} + +func (_c *ORM_Get_Call) Run(run func(ctx context.Context, address *big.Big, slotId uint)) *ORM_Get_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*big.Big), args[2].(uint)) + }) + return _c +} + +func (_c *ORM_Get_Call) Return(_a0 *s4.Row, _a1 error) *ORM_Get_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ORM_Get_Call) RunAndReturn(run func(context.Context, *big.Big, uint) (*s4.Row, error)) *ORM_Get_Call { + _c.Call.Return(run) + return _c +} + // GetSnapshot provides a mock function with given fields: ctx, addressRange func (_m *ORM) GetSnapshot(ctx context.Context, addressRange *s4.AddressRange) ([]*s4.SnapshotRow, error) { ret := _m.Called(ctx, addressRange) @@ -107,6 +175,35 @@ func (_m *ORM) GetSnapshot(ctx context.Context, addressRange *s4.AddressRange) ( return r0, r1 } +// ORM_GetSnapshot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSnapshot' +type ORM_GetSnapshot_Call struct { + *mock.Call +} + +// GetSnapshot is a helper method to define mock.On call +// - ctx context.Context +// - addressRange *s4.AddressRange +func (_e *ORM_Expecter) GetSnapshot(ctx interface{}, addressRange interface{}) *ORM_GetSnapshot_Call { + return &ORM_GetSnapshot_Call{Call: _e.mock.On("GetSnapshot", ctx, addressRange)} +} + +func (_c *ORM_GetSnapshot_Call) Run(run func(ctx context.Context, addressRange *s4.AddressRange)) *ORM_GetSnapshot_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*s4.AddressRange)) + }) + return _c +} + +func (_c *ORM_GetSnapshot_Call) Return(_a0 []*s4.SnapshotRow, _a1 error) *ORM_GetSnapshot_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ORM_GetSnapshot_Call) RunAndReturn(run func(context.Context, *s4.AddressRange) ([]*s4.SnapshotRow, error)) *ORM_GetSnapshot_Call { + _c.Call.Return(run) + return _c +} + // GetUnconfirmedRows provides a mock function with given fields: ctx, limit func (_m *ORM) GetUnconfirmedRows(ctx context.Context, limit uint) ([]*s4.Row, error) { ret := _m.Called(ctx, limit) @@ -137,6 +234,35 @@ func (_m *ORM) GetUnconfirmedRows(ctx context.Context, limit uint) ([]*s4.Row, e return r0, r1 } +// ORM_GetUnconfirmedRows_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetUnconfirmedRows' +type ORM_GetUnconfirmedRows_Call struct { + *mock.Call +} + +// GetUnconfirmedRows is a helper method to define mock.On call +// - ctx context.Context +// - limit uint +func (_e *ORM_Expecter) GetUnconfirmedRows(ctx interface{}, limit interface{}) *ORM_GetUnconfirmedRows_Call { + return &ORM_GetUnconfirmedRows_Call{Call: _e.mock.On("GetUnconfirmedRows", ctx, limit)} +} + +func (_c *ORM_GetUnconfirmedRows_Call) Run(run func(ctx context.Context, limit uint)) *ORM_GetUnconfirmedRows_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(uint)) + }) + return _c +} + +func (_c *ORM_GetUnconfirmedRows_Call) Return(_a0 []*s4.Row, _a1 error) *ORM_GetUnconfirmedRows_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ORM_GetUnconfirmedRows_Call) RunAndReturn(run func(context.Context, uint) ([]*s4.Row, error)) *ORM_GetUnconfirmedRows_Call { + _c.Call.Return(run) + return _c +} + // Update provides a mock function with given fields: ctx, row func (_m *ORM) Update(ctx context.Context, row *s4.Row) error { ret := _m.Called(ctx, row) @@ -155,6 +281,35 @@ func (_m *ORM) Update(ctx context.Context, row *s4.Row) error { return r0 } +// ORM_Update_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Update' +type ORM_Update_Call struct { + *mock.Call +} + +// Update is a helper method to define mock.On call +// - ctx context.Context +// - row *s4.Row +func (_e *ORM_Expecter) Update(ctx interface{}, row interface{}) *ORM_Update_Call { + return &ORM_Update_Call{Call: _e.mock.On("Update", ctx, row)} +} + +func (_c *ORM_Update_Call) Run(run func(ctx context.Context, row *s4.Row)) *ORM_Update_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*s4.Row)) + }) + return _c +} + +func (_c *ORM_Update_Call) Return(_a0 error) *ORM_Update_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ORM_Update_Call) RunAndReturn(run func(context.Context, *s4.Row) error) *ORM_Update_Call { + _c.Call.Return(run) + return _c +} + // NewORM creates a new instance of ORM. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewORM(t interface { diff --git a/core/services/s4/mocks/storage.go b/core/services/s4/mocks/storage.go index 29344d9ebfe..a89a0a6bdf3 100644 --- a/core/services/s4/mocks/storage.go +++ b/core/services/s4/mocks/storage.go @@ -17,6 +17,14 @@ type Storage struct { mock.Mock } +type Storage_Expecter struct { + mock *mock.Mock +} + +func (_m *Storage) EXPECT() *Storage_Expecter { + return &Storage_Expecter{mock: &_m.Mock} +} + // Constraints provides a mock function with given fields: func (_m *Storage) Constraints() s4.Constraints { ret := _m.Called() @@ -35,6 +43,33 @@ func (_m *Storage) Constraints() s4.Constraints { return r0 } +// Storage_Constraints_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Constraints' +type Storage_Constraints_Call struct { + *mock.Call +} + +// Constraints is a helper method to define mock.On call +func (_e *Storage_Expecter) Constraints() *Storage_Constraints_Call { + return &Storage_Constraints_Call{Call: _e.mock.On("Constraints")} +} + +func (_c *Storage_Constraints_Call) Run(run func()) *Storage_Constraints_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Storage_Constraints_Call) Return(_a0 s4.Constraints) *Storage_Constraints_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Storage_Constraints_Call) RunAndReturn(run func() s4.Constraints) *Storage_Constraints_Call { + _c.Call.Return(run) + return _c +} + // Get provides a mock function with given fields: ctx, key func (_m *Storage) Get(ctx context.Context, key *s4.Key) (*s4.Record, *s4.Metadata, error) { ret := _m.Called(ctx, key) @@ -74,6 +109,35 @@ func (_m *Storage) Get(ctx context.Context, key *s4.Key) (*s4.Record, *s4.Metada return r0, r1, r2 } +// Storage_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' +type Storage_Get_Call struct { + *mock.Call +} + +// Get is a helper method to define mock.On call +// - ctx context.Context +// - key *s4.Key +func (_e *Storage_Expecter) Get(ctx interface{}, key interface{}) *Storage_Get_Call { + return &Storage_Get_Call{Call: _e.mock.On("Get", ctx, key)} +} + +func (_c *Storage_Get_Call) Run(run func(ctx context.Context, key *s4.Key)) *Storage_Get_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*s4.Key)) + }) + return _c +} + +func (_c *Storage_Get_Call) Return(_a0 *s4.Record, _a1 *s4.Metadata, _a2 error) *Storage_Get_Call { + _c.Call.Return(_a0, _a1, _a2) + return _c +} + +func (_c *Storage_Get_Call) RunAndReturn(run func(context.Context, *s4.Key) (*s4.Record, *s4.Metadata, error)) *Storage_Get_Call { + _c.Call.Return(run) + return _c +} + // List provides a mock function with given fields: ctx, address func (_m *Storage) List(ctx context.Context, address common.Address) ([]*s4.SnapshotRow, error) { ret := _m.Called(ctx, address) @@ -104,6 +168,35 @@ func (_m *Storage) List(ctx context.Context, address common.Address) ([]*s4.Snap return r0, r1 } +// Storage_List_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'List' +type Storage_List_Call struct { + *mock.Call +} + +// List is a helper method to define mock.On call +// - ctx context.Context +// - address common.Address +func (_e *Storage_Expecter) List(ctx interface{}, address interface{}) *Storage_List_Call { + return &Storage_List_Call{Call: _e.mock.On("List", ctx, address)} +} + +func (_c *Storage_List_Call) Run(run func(ctx context.Context, address common.Address)) *Storage_List_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(common.Address)) + }) + return _c +} + +func (_c *Storage_List_Call) Return(_a0 []*s4.SnapshotRow, _a1 error) *Storage_List_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Storage_List_Call) RunAndReturn(run func(context.Context, common.Address) ([]*s4.SnapshotRow, error)) *Storage_List_Call { + _c.Call.Return(run) + return _c +} + // Put provides a mock function with given fields: ctx, key, record, signature func (_m *Storage) Put(ctx context.Context, key *s4.Key, record *s4.Record, signature []byte) error { ret := _m.Called(ctx, key, record, signature) @@ -122,6 +215,37 @@ func (_m *Storage) Put(ctx context.Context, key *s4.Key, record *s4.Record, sign return r0 } +// Storage_Put_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Put' +type Storage_Put_Call struct { + *mock.Call +} + +// Put is a helper method to define mock.On call +// - ctx context.Context +// - key *s4.Key +// - record *s4.Record +// - signature []byte +func (_e *Storage_Expecter) Put(ctx interface{}, key interface{}, record interface{}, signature interface{}) *Storage_Put_Call { + return &Storage_Put_Call{Call: _e.mock.On("Put", ctx, key, record, signature)} +} + +func (_c *Storage_Put_Call) Run(run func(ctx context.Context, key *s4.Key, record *s4.Record, signature []byte)) *Storage_Put_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*s4.Key), args[2].(*s4.Record), args[3].([]byte)) + }) + return _c +} + +func (_c *Storage_Put_Call) Return(_a0 error) *Storage_Put_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Storage_Put_Call) RunAndReturn(run func(context.Context, *s4.Key, *s4.Record, []byte) error) *Storage_Put_Call { + _c.Call.Return(run) + return _c +} + // NewStorage creates a new instance of Storage. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewStorage(t interface { diff --git a/core/services/s4/orm.go b/core/services/s4/orm.go index 952d8a33b24..abf3a76e5af 100644 --- a/core/services/s4/orm.go +++ b/core/services/s4/orm.go @@ -28,8 +28,6 @@ type SnapshotRow struct { PayloadSize uint64 } -//go:generate mockery --quiet --name ORM --output ./mocks/ --case=underscore - // ORM represents S4 persistence layer. // All functions are thread-safe. type ORM interface { diff --git a/core/services/s4/storage.go b/core/services/s4/storage.go index 1af14ec269f..02948575207 100644 --- a/core/services/s4/storage.go +++ b/core/services/s4/storage.go @@ -44,8 +44,6 @@ type Metadata struct { Signature []byte } -//go:generate mockery --quiet --name Storage --output ./mocks/ --case=underscore - // Storage represents S4 storage access interface. // All functions are thread-safe. type Storage interface { diff --git a/core/services/standardcapabilities/delegate.go b/core/services/standardcapabilities/delegate.go index d072c948469..15c829fbf84 100644 --- a/core/services/standardcapabilities/delegate.go +++ b/core/services/standardcapabilities/delegate.go @@ -12,6 +12,9 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/sqlutil" "github.com/smartcontractkit/chainlink-common/pkg/types" "github.com/smartcontractkit/chainlink-common/pkg/types/core" + gatewayconnector "github.com/smartcontractkit/chainlink/v2/core/capabilities/gateway_connector" + "github.com/smartcontractkit/chainlink/v2/core/capabilities/webapi" + webapitarget "github.com/smartcontractkit/chainlink/v2/core/capabilities/webapi/target" "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/job" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/generic" @@ -26,23 +29,29 @@ type RelayGetter interface { } type Delegate struct { - logger logger.Logger - ds sqlutil.DataSource - jobORM job.ORM - registry core.CapabilitiesRegistry - cfg plugins.RegistrarConfig - monitoringEndpointGen telemetry.MonitoringEndpointGenerator - pipelineRunner pipeline.Runner - relayers RelayGetter + logger logger.Logger + ds sqlutil.DataSource + jobORM job.ORM + registry core.CapabilitiesRegistry + cfg plugins.RegistrarConfig + monitoringEndpointGen telemetry.MonitoringEndpointGenerator + pipelineRunner pipeline.Runner + relayers RelayGetter + gatewayConnectorWrapper *gatewayconnector.ServiceWrapper isNewlyCreatedJob bool } +const ( + commandOverrideForWebAPITrigger = "__builtin_web-api-trigger" + commandOverrideForWebAPITarget = "__builtin_web-api-target" +) + func NewDelegate(logger logger.Logger, ds sqlutil.DataSource, jobORM job.ORM, registry core.CapabilitiesRegistry, cfg plugins.RegistrarConfig, monitoringEndpointGen telemetry.MonitoringEndpointGenerator, pipelineRunner pipeline.Runner, - relayers RelayGetter) *Delegate { + relayers RelayGetter, gatewayConnectorWrapper *gatewayconnector.ServiceWrapper) *Delegate { return &Delegate{logger: logger, ds: ds, jobORM: jobORM, registry: registry, cfg: cfg, monitoringEndpointGen: monitoringEndpointGen, pipelineRunner: pipelineRunner, - relayers: relayers, isNewlyCreatedJob: false} + relayers: relayers, isNewlyCreatedJob: false, gatewayConnectorWrapper: gatewayConnectorWrapper} } func (d *Delegate) JobType() job.Type { @@ -67,6 +76,44 @@ func (d *Delegate) ServicesForSpec(ctx context.Context, spec job.Job) ([]job.Ser return nil, fmt.Errorf("failed to create relayer set: %w", err) } + // NOTE: special cases for built-in capabilities (to be moved into LOOPPs in the future) + if spec.StandardCapabilitiesSpec.Command == commandOverrideForWebAPITrigger { + if d.gatewayConnectorWrapper == nil { + return nil, errors.New("gateway connector is required for web API Trigger capability") + } + connector := d.gatewayConnectorWrapper.GetGatewayConnector() + triggerSrvc, err := webapi.NewTrigger(spec.StandardCapabilitiesSpec.Config, d.registry, connector, log) + if err != nil { + return nil, fmt.Errorf("failed to create a Web API Trigger service: %w", err) + } + return []job.ServiceCtx{triggerSrvc}, nil + } + + if spec.StandardCapabilitiesSpec.Command == commandOverrideForWebAPITarget { + if d.gatewayConnectorWrapper == nil { + return nil, errors.New("gateway connector is required for web API Target capability") + } + connector := d.gatewayConnectorWrapper.GetGatewayConnector() + if len(spec.StandardCapabilitiesSpec.Config) == 0 { + return nil, errors.New("config is empty") + } + var targetCfg webapitarget.Config + err := toml.Unmarshal([]byte(spec.StandardCapabilitiesSpec.Config), &targetCfg) + if err != nil { + return nil, err + } + lggr := d.logger.Named("WebAPITarget") + handler, err := webapitarget.NewConnectorHandler(connector, targetCfg, lggr) + if err != nil { + return nil, err + } + capability, err := webapitarget.NewCapability(targetCfg, d.registry, handler, lggr) + if err != nil { + return nil, err + } + return []job.ServiceCtx{capability, handler}, nil + } + standardCapability := newStandardCapabilities(log, spec.StandardCapabilitiesSpec, d.cfg, telemetryService, kvStore, d.registry, errorLog, pr, relayerSet) diff --git a/core/services/streams/stream.go b/core/services/streams/stream.go index cb168c11bce..b65c6dc12f6 100644 --- a/core/services/streams/stream.go +++ b/core/services/streams/stream.go @@ -3,16 +3,14 @@ package streams import ( "context" "fmt" - "math/big" "sync" "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/pipeline" - "github.com/smartcontractkit/chainlink/v2/core/utils" ) type Runner interface { - ExecuteRun(ctx context.Context, spec pipeline.Spec, vars pipeline.Vars, l logger.Logger) (run *pipeline.Run, trrs pipeline.TaskRunResults, err error) + ExecuteRun(ctx context.Context, spec pipeline.Spec, vars pipeline.Vars) (run *pipeline.Run, trrs pipeline.TaskRunResults, err error) InitializePipeline(spec pipeline.Spec) (*pipeline.Pipeline, error) } @@ -87,42 +85,10 @@ func (s *stream) executeRun(ctx context.Context) (*pipeline.Run, pipeline.TaskRu }, }) - run, trrs, err := s.runner.ExecuteRun(ctx, *s.spec, vars, s.lggr) + run, trrs, err := s.runner.ExecuteRun(ctx, *s.spec, vars) if err != nil { return nil, nil, fmt.Errorf("error executing run for spec ID %v: %w", s.spec.ID, err) } return run, trrs, err } - -// ExtractBigInt returns a result of a pipeline run that returns one single -// decimal result, as a *big.Int. -// This acts as a reference/example method, other methods can be implemented to -// extract any desired type that matches a particular pipeline run output. -// Returns error on parse errors: if results are wrong type -func ExtractBigInt(trrs pipeline.TaskRunResults) (*big.Int, error) { - // pipeline.TaskRunResults comes ordered asc by index, this is guaranteed - // by the pipeline executor - finaltrrs := trrs.Terminals() - - if len(finaltrrs) != 1 { - return nil, fmt.Errorf("invalid number of results, expected: 1, got: %d", len(finaltrrs)) - } - res := finaltrrs[0].Result - if res.Error != nil { - return nil, res.Error - } - val, err := toBigInt(res.Value) - if err != nil { - return nil, fmt.Errorf("failed to parse BenchmarkPrice: %w", err) - } - return val, nil -} - -func toBigInt(val interface{}) (*big.Int, error) { - dec, err := utils.ToDecimal(val) - if err != nil { - return nil, err - } - return dec.BigInt(), nil -} diff --git a/core/services/streams/stream_test.go b/core/services/streams/stream_test.go index 3e8f58cd58b..78174138121 100644 --- a/core/services/streams/stream_test.go +++ b/core/services/streams/stream_test.go @@ -2,7 +2,6 @@ package streams import ( "context" - "math/big" "testing" "time" @@ -26,7 +25,7 @@ type mockRunner struct { err error } -func (m *mockRunner) ExecuteRun(ctx context.Context, spec pipeline.Spec, vars pipeline.Vars, l logger.Logger) (run *pipeline.Run, trrs pipeline.TaskRunResults, err error) { +func (m *mockRunner) ExecuteRun(ctx context.Context, spec pipeline.Spec, vars pipeline.Vars) (run *pipeline.Run, trrs pipeline.TaskRunResults, err error) { return m.run, m.trrs, m.err } func (m *mockRunner) InitializePipeline(spec pipeline.Spec) (p *pipeline.Pipeline, err error) { @@ -99,35 +98,3 @@ succeed; }) }) } - -func Test_ExtractBigInt(t *testing.T) { - t.Run("wrong number of inputs", func(t *testing.T) { - trrs := []pipeline.TaskRunResult{} - - _, err := ExtractBigInt(trrs) - assert.EqualError(t, err, "invalid number of results, expected: 1, got: 0") - }) - t.Run("wrong type", func(t *testing.T) { - trrs := []pipeline.TaskRunResult{ - { - Result: pipeline.Result{Value: []byte{1, 2, 3}}, - Task: &MockTask{}, - }, - } - - _, err := ExtractBigInt(trrs) - assert.EqualError(t, err, "failed to parse BenchmarkPrice: type []uint8 cannot be converted to decimal.Decimal ([1 2 3])") - }) - t.Run("correct inputs", func(t *testing.T) { - trrs := []pipeline.TaskRunResult{ - { - Result: pipeline.Result{Value: "122.345"}, - Task: &MockTask{}, - }, - } - - val, err := ExtractBigInt(trrs) - require.NoError(t, err) - assert.Equal(t, big.NewInt(122), val) - }) -} diff --git a/core/services/synchronization/common.go b/core/services/synchronization/common.go index 1278875e331..9145a3c9ace 100644 --- a/core/services/synchronization/common.go +++ b/core/services/synchronization/common.go @@ -16,12 +16,20 @@ const ( OCR TelemetryType = "ocr" OCR2Automation TelemetryType = "ocr2-automation" OCR2Functions TelemetryType = "ocr2-functions" + OCR2CCIPCommit TelemetryType = "ocr2-ccip-commit" + OCR2CCIPExec TelemetryType = "ocr2-ccip-exec" OCR2Threshold TelemetryType = "ocr2-threshold" OCR2S4 TelemetryType = "ocr2-s4" OCR2Median TelemetryType = "ocr2-median" OCR3Mercury TelemetryType = "ocr3-mercury" + OCR3DataFeeds TelemetryType = "ocr3-data-feeds" AutomationCustom TelemetryType = "automation-custom" OCR3Automation TelemetryType = "ocr3-automation" + OCR3Rebalancer TelemetryType = "ocr3-rebalancer" + OCR3CCIPCommit TelemetryType = "ocr3-ccip-commit" + OCR3CCIPExec TelemetryType = "ocr3-ccip-exec" + OCR3CCIPBootstrap TelemetryType = "ocr3-bootstrap" + HeadReport TelemetryType = "head-report" ) type TelemPayload struct { @@ -32,8 +40,6 @@ type TelemPayload struct { // TelemetryService encapsulates all the functionality needed to // send telemetry to the ingress server using wsrpc -// -//go:generate mockery --quiet --name TelemetryService --output ./mocks --case=underscore type TelemetryService interface { services.ServiceCtx Send(ctx context.Context, telemetry []byte, contractID string, telemType TelemetryType) diff --git a/core/services/synchronization/helpers_test.go b/core/services/synchronization/helpers_test.go index 7bb2dde7633..aea9bf77f49 100644 --- a/core/services/synchronization/helpers_test.go +++ b/core/services/synchronization/helpers_test.go @@ -12,15 +12,15 @@ import ( // NewTestTelemetryIngressClient calls NewTelemetryIngressClient and injects telemClient. func NewTestTelemetryIngressClient(t *testing.T, url *url.URL, serverPubKeyHex string, ks keystore.CSA, logging bool, telemClient telemPb.TelemClient) TelemetryService { - tc := NewTelemetryIngressClient(url, serverPubKeyHex, ks, logging, logger.TestLogger(t), 100, "test", "test") + tc := NewTelemetryIngressClient(url, serverPubKeyHex, ks, logging, logger.TestLogger(t), 100) tc.(*telemetryIngressClient).telemClient = telemClient return tc } // NewTestTelemetryIngressBatchClient calls NewTelemetryIngressBatchClient and injects telemClient. func NewTestTelemetryIngressBatchClient(t *testing.T, url *url.URL, serverPubKeyHex string, ks keystore.CSA, logging bool, telemClient telemPb.TelemClient, sendInterval time.Duration, uniconn bool) TelemetryService { - tc := NewTelemetryIngressBatchClient(url, serverPubKeyHex, ks, logging, logger.TestLogger(t), 100, 50, sendInterval, time.Second, uniconn, "test", "test") - tc.(*telemetryIngressBatchClient).close = func() error { return nil } + tc := NewTelemetryIngressBatchClient(url, serverPubKeyHex, ks, logging, logger.TestLogger(t), 100, 50, sendInterval, time.Second, uniconn) + tc.(*telemetryIngressBatchClient).closeFn = func() error { return nil } tc.(*telemetryIngressBatchClient).telemClient = telemClient return tc } diff --git a/core/services/synchronization/mocks/telem_client.go b/core/services/synchronization/mocks/telem_client.go index 3c19dd07bc4..da9678943ca 100644 --- a/core/services/synchronization/mocks/telem_client.go +++ b/core/services/synchronization/mocks/telem_client.go @@ -14,6 +14,14 @@ type TelemClient struct { mock.Mock } +type TelemClient_Expecter struct { + mock *mock.Mock +} + +func (_m *TelemClient) EXPECT() *TelemClient_Expecter { + return &TelemClient_Expecter{mock: &_m.Mock} +} + // Telem provides a mock function with given fields: ctx, in func (_m *TelemClient) Telem(ctx context.Context, in *telem.TelemRequest) (*telem.TelemResponse, error) { ret := _m.Called(ctx, in) @@ -44,6 +52,35 @@ func (_m *TelemClient) Telem(ctx context.Context, in *telem.TelemRequest) (*tele return r0, r1 } +// TelemClient_Telem_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Telem' +type TelemClient_Telem_Call struct { + *mock.Call +} + +// Telem is a helper method to define mock.On call +// - ctx context.Context +// - in *telem.TelemRequest +func (_e *TelemClient_Expecter) Telem(ctx interface{}, in interface{}) *TelemClient_Telem_Call { + return &TelemClient_Telem_Call{Call: _e.mock.On("Telem", ctx, in)} +} + +func (_c *TelemClient_Telem_Call) Run(run func(ctx context.Context, in *telem.TelemRequest)) *TelemClient_Telem_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*telem.TelemRequest)) + }) + return _c +} + +func (_c *TelemClient_Telem_Call) Return(_a0 *telem.TelemResponse, _a1 error) *TelemClient_Telem_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *TelemClient_Telem_Call) RunAndReturn(run func(context.Context, *telem.TelemRequest) (*telem.TelemResponse, error)) *TelemClient_Telem_Call { + _c.Call.Return(run) + return _c +} + // TelemBatch provides a mock function with given fields: ctx, in func (_m *TelemClient) TelemBatch(ctx context.Context, in *telem.TelemBatchRequest) (*telem.TelemResponse, error) { ret := _m.Called(ctx, in) @@ -74,6 +111,35 @@ func (_m *TelemClient) TelemBatch(ctx context.Context, in *telem.TelemBatchReque return r0, r1 } +// TelemClient_TelemBatch_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TelemBatch' +type TelemClient_TelemBatch_Call struct { + *mock.Call +} + +// TelemBatch is a helper method to define mock.On call +// - ctx context.Context +// - in *telem.TelemBatchRequest +func (_e *TelemClient_Expecter) TelemBatch(ctx interface{}, in interface{}) *TelemClient_TelemBatch_Call { + return &TelemClient_TelemBatch_Call{Call: _e.mock.On("TelemBatch", ctx, in)} +} + +func (_c *TelemClient_TelemBatch_Call) Run(run func(ctx context.Context, in *telem.TelemBatchRequest)) *TelemClient_TelemBatch_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*telem.TelemBatchRequest)) + }) + return _c +} + +func (_c *TelemClient_TelemBatch_Call) Return(_a0 *telem.TelemResponse, _a1 error) *TelemClient_TelemBatch_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *TelemClient_TelemBatch_Call) RunAndReturn(run func(context.Context, *telem.TelemBatchRequest) (*telem.TelemResponse, error)) *TelemClient_TelemBatch_Call { + _c.Call.Return(run) + return _c +} + // NewTelemClient creates a new instance of TelemClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewTelemClient(t interface { diff --git a/core/services/synchronization/mocks/telemetry_service.go b/core/services/synchronization/mocks/telemetry_service.go index 8c6677e4be4..c391c92cca1 100644 --- a/core/services/synchronization/mocks/telemetry_service.go +++ b/core/services/synchronization/mocks/telemetry_service.go @@ -14,6 +14,14 @@ type TelemetryService struct { mock.Mock } +type TelemetryService_Expecter struct { + mock *mock.Mock +} + +func (_m *TelemetryService) EXPECT() *TelemetryService_Expecter { + return &TelemetryService_Expecter{mock: &_m.Mock} +} + // Close provides a mock function with given fields: func (_m *TelemetryService) Close() error { ret := _m.Called() @@ -32,6 +40,33 @@ func (_m *TelemetryService) Close() error { return r0 } +// TelemetryService_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close' +type TelemetryService_Close_Call struct { + *mock.Call +} + +// Close is a helper method to define mock.On call +func (_e *TelemetryService_Expecter) Close() *TelemetryService_Close_Call { + return &TelemetryService_Close_Call{Call: _e.mock.On("Close")} +} + +func (_c *TelemetryService_Close_Call) Run(run func()) *TelemetryService_Close_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *TelemetryService_Close_Call) Return(_a0 error) *TelemetryService_Close_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *TelemetryService_Close_Call) RunAndReturn(run func() error) *TelemetryService_Close_Call { + _c.Call.Return(run) + return _c +} + // HealthReport provides a mock function with given fields: func (_m *TelemetryService) HealthReport() map[string]error { ret := _m.Called() @@ -52,6 +87,33 @@ func (_m *TelemetryService) HealthReport() map[string]error { return r0 } +// TelemetryService_HealthReport_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HealthReport' +type TelemetryService_HealthReport_Call struct { + *mock.Call +} + +// HealthReport is a helper method to define mock.On call +func (_e *TelemetryService_Expecter) HealthReport() *TelemetryService_HealthReport_Call { + return &TelemetryService_HealthReport_Call{Call: _e.mock.On("HealthReport")} +} + +func (_c *TelemetryService_HealthReport_Call) Run(run func()) *TelemetryService_HealthReport_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *TelemetryService_HealthReport_Call) Return(_a0 map[string]error) *TelemetryService_HealthReport_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *TelemetryService_HealthReport_Call) RunAndReturn(run func() map[string]error) *TelemetryService_HealthReport_Call { + _c.Call.Return(run) + return _c +} + // Name provides a mock function with given fields: func (_m *TelemetryService) Name() string { ret := _m.Called() @@ -70,6 +132,33 @@ func (_m *TelemetryService) Name() string { return r0 } +// TelemetryService_Name_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Name' +type TelemetryService_Name_Call struct { + *mock.Call +} + +// Name is a helper method to define mock.On call +func (_e *TelemetryService_Expecter) Name() *TelemetryService_Name_Call { + return &TelemetryService_Name_Call{Call: _e.mock.On("Name")} +} + +func (_c *TelemetryService_Name_Call) Run(run func()) *TelemetryService_Name_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *TelemetryService_Name_Call) Return(_a0 string) *TelemetryService_Name_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *TelemetryService_Name_Call) RunAndReturn(run func() string) *TelemetryService_Name_Call { + _c.Call.Return(run) + return _c +} + // Ready provides a mock function with given fields: func (_m *TelemetryService) Ready() error { ret := _m.Called() @@ -88,11 +177,69 @@ func (_m *TelemetryService) Ready() error { return r0 } +// TelemetryService_Ready_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Ready' +type TelemetryService_Ready_Call struct { + *mock.Call +} + +// Ready is a helper method to define mock.On call +func (_e *TelemetryService_Expecter) Ready() *TelemetryService_Ready_Call { + return &TelemetryService_Ready_Call{Call: _e.mock.On("Ready")} +} + +func (_c *TelemetryService_Ready_Call) Run(run func()) *TelemetryService_Ready_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *TelemetryService_Ready_Call) Return(_a0 error) *TelemetryService_Ready_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *TelemetryService_Ready_Call) RunAndReturn(run func() error) *TelemetryService_Ready_Call { + _c.Call.Return(run) + return _c +} + // Send provides a mock function with given fields: ctx, telemetry, contractID, telemType func (_m *TelemetryService) Send(ctx context.Context, telemetry []byte, contractID string, telemType synchronization.TelemetryType) { _m.Called(ctx, telemetry, contractID, telemType) } +// TelemetryService_Send_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Send' +type TelemetryService_Send_Call struct { + *mock.Call +} + +// Send is a helper method to define mock.On call +// - ctx context.Context +// - telemetry []byte +// - contractID string +// - telemType synchronization.TelemetryType +func (_e *TelemetryService_Expecter) Send(ctx interface{}, telemetry interface{}, contractID interface{}, telemType interface{}) *TelemetryService_Send_Call { + return &TelemetryService_Send_Call{Call: _e.mock.On("Send", ctx, telemetry, contractID, telemType)} +} + +func (_c *TelemetryService_Send_Call) Run(run func(ctx context.Context, telemetry []byte, contractID string, telemType synchronization.TelemetryType)) *TelemetryService_Send_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].([]byte), args[2].(string), args[3].(synchronization.TelemetryType)) + }) + return _c +} + +func (_c *TelemetryService_Send_Call) Return() *TelemetryService_Send_Call { + _c.Call.Return() + return _c +} + +func (_c *TelemetryService_Send_Call) RunAndReturn(run func(context.Context, []byte, string, synchronization.TelemetryType)) *TelemetryService_Send_Call { + _c.Call.Return(run) + return _c +} + // Start provides a mock function with given fields: _a0 func (_m *TelemetryService) Start(_a0 context.Context) error { ret := _m.Called(_a0) @@ -111,6 +258,34 @@ func (_m *TelemetryService) Start(_a0 context.Context) error { return r0 } +// TelemetryService_Start_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Start' +type TelemetryService_Start_Call struct { + *mock.Call +} + +// Start is a helper method to define mock.On call +// - _a0 context.Context +func (_e *TelemetryService_Expecter) Start(_a0 interface{}) *TelemetryService_Start_Call { + return &TelemetryService_Start_Call{Call: _e.mock.On("Start", _a0)} +} + +func (_c *TelemetryService_Start_Call) Run(run func(_a0 context.Context)) *TelemetryService_Start_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *TelemetryService_Start_Call) Return(_a0 error) *TelemetryService_Start_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *TelemetryService_Start_Call) RunAndReturn(run func(context.Context) error) *TelemetryService_Start_Call { + _c.Call.Return(run) + return _c +} + // NewTelemetryService creates a new instance of TelemetryService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewTelemetryService(t interface { diff --git a/core/services/synchronization/telem/gen.go b/core/services/synchronization/telem/gen.go deleted file mode 100644 index 108beb58678..00000000000 --- a/core/services/synchronization/telem/gen.go +++ /dev/null @@ -1,3 +0,0 @@ -package telem - -//go:generate mockery --quiet --name TelemClient --output ../mocks/ --case=underscore diff --git a/core/services/synchronization/telem/telem.pb.go b/core/services/synchronization/telem/telem.pb.go index e382823eeb3..8ededa8ce1c 100644 --- a/core/services/synchronization/telem/telem.pb.go +++ b/core/services/synchronization/telem/telem.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.1 -// protoc v3.21.12 +// protoc-gen-go v1.34.2 +// protoc v5.28.0 // source: core/services/synchronization/telem/telem.proto package telem @@ -264,7 +264,7 @@ func file_core_services_synchronization_telem_telem_proto_rawDescGZIP() []byte { } var file_core_services_synchronization_telem_telem_proto_msgTypes = make([]protoimpl.MessageInfo, 3) -var file_core_services_synchronization_telem_telem_proto_goTypes = []interface{}{ +var file_core_services_synchronization_telem_telem_proto_goTypes = []any{ (*TelemRequest)(nil), // 0: telem.TelemRequest (*TelemBatchRequest)(nil), // 1: telem.TelemBatchRequest (*TelemResponse)(nil), // 2: telem.TelemResponse @@ -287,7 +287,7 @@ func file_core_services_synchronization_telem_telem_proto_init() { return } if !protoimpl.UnsafeEnabled { - file_core_services_synchronization_telem_telem_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_core_services_synchronization_telem_telem_proto_msgTypes[0].Exporter = func(v any, i int) any { switch v := v.(*TelemRequest); i { case 0: return &v.state @@ -299,7 +299,7 @@ func file_core_services_synchronization_telem_telem_proto_init() { return nil } } - file_core_services_synchronization_telem_telem_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_core_services_synchronization_telem_telem_proto_msgTypes[1].Exporter = func(v any, i int) any { switch v := v.(*TelemBatchRequest); i { case 0: return &v.state @@ -311,7 +311,7 @@ func file_core_services_synchronization_telem_telem_proto_init() { return nil } } - file_core_services_synchronization_telem_telem_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + file_core_services_synchronization_telem_telem_proto_msgTypes[2].Exporter = func(v any, i int) any { switch v := v.(*TelemResponse); i { case 0: return &v.state diff --git a/core/services/synchronization/telem/telem_automation_custom.pb.go b/core/services/synchronization/telem/telem_automation_custom.pb.go index e88cb2f951a..7c498be9fde 100644 --- a/core/services/synchronization/telem/telem_automation_custom.pb.go +++ b/core/services/synchronization/telem/telem_automation_custom.pb.go @@ -1,8 +1,8 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 -// protoc v4.23.4 -// source: telem_automation_custom.proto +// protoc-gen-go v1.34.2 +// protoc v5.28.0 +// source: core/services/synchronization/telem/telem_automation_custom.proto package telem @@ -34,7 +34,7 @@ type BlockNumber struct { func (x *BlockNumber) Reset() { *x = BlockNumber{} if protoimpl.UnsafeEnabled { - mi := &file_telem_automation_custom_proto_msgTypes[0] + mi := &file_core_services_synchronization_telem_telem_automation_custom_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -47,7 +47,7 @@ func (x *BlockNumber) String() string { func (*BlockNumber) ProtoMessage() {} func (x *BlockNumber) ProtoReflect() protoreflect.Message { - mi := &file_telem_automation_custom_proto_msgTypes[0] + mi := &file_core_services_synchronization_telem_telem_automation_custom_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -60,7 +60,7 @@ func (x *BlockNumber) ProtoReflect() protoreflect.Message { // Deprecated: Use BlockNumber.ProtoReflect.Descriptor instead. func (*BlockNumber) Descriptor() ([]byte, []int) { - return file_telem_automation_custom_proto_rawDescGZIP(), []int{0} + return file_core_services_synchronization_telem_telem_automation_custom_proto_rawDescGZIP(), []int{0} } func (x *BlockNumber) GetTimestamp() uint64 { @@ -104,7 +104,7 @@ type NodeVersion struct { func (x *NodeVersion) Reset() { *x = NodeVersion{} if protoimpl.UnsafeEnabled { - mi := &file_telem_automation_custom_proto_msgTypes[1] + mi := &file_core_services_synchronization_telem_telem_automation_custom_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -117,7 +117,7 @@ func (x *NodeVersion) String() string { func (*NodeVersion) ProtoMessage() {} func (x *NodeVersion) ProtoReflect() protoreflect.Message { - mi := &file_telem_automation_custom_proto_msgTypes[1] + mi := &file_core_services_synchronization_telem_telem_automation_custom_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -130,7 +130,7 @@ func (x *NodeVersion) ProtoReflect() protoreflect.Message { // Deprecated: Use NodeVersion.ProtoReflect.Descriptor instead. func (*NodeVersion) Descriptor() ([]byte, []int) { - return file_telem_automation_custom_proto_rawDescGZIP(), []int{1} + return file_core_services_synchronization_telem_telem_automation_custom_proto_rawDescGZIP(), []int{1} } func (x *NodeVersion) GetTimestamp() uint64 { @@ -169,7 +169,7 @@ type AutomationTelemWrapper struct { func (x *AutomationTelemWrapper) Reset() { *x = AutomationTelemWrapper{} if protoimpl.UnsafeEnabled { - mi := &file_telem_automation_custom_proto_msgTypes[2] + mi := &file_core_services_synchronization_telem_telem_automation_custom_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -182,7 +182,7 @@ func (x *AutomationTelemWrapper) String() string { func (*AutomationTelemWrapper) ProtoMessage() {} func (x *AutomationTelemWrapper) ProtoReflect() protoreflect.Message { - mi := &file_telem_automation_custom_proto_msgTypes[2] + mi := &file_core_services_synchronization_telem_telem_automation_custom_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -195,7 +195,7 @@ func (x *AutomationTelemWrapper) ProtoReflect() protoreflect.Message { // Deprecated: Use AutomationTelemWrapper.ProtoReflect.Descriptor instead. func (*AutomationTelemWrapper) Descriptor() ([]byte, []int) { - return file_telem_automation_custom_proto_rawDescGZIP(), []int{2} + return file_core_services_synchronization_telem_telem_automation_custom_proto_rawDescGZIP(), []int{2} } func (m *AutomationTelemWrapper) GetMsg() isAutomationTelemWrapper_Msg { @@ -235,64 +235,66 @@ func (*AutomationTelemWrapper_BlockNumber) isAutomationTelemWrapper_Msg() {} func (*AutomationTelemWrapper_NodeVersion) isAutomationTelemWrapper_Msg() {} -var File_telem_automation_custom_proto protoreflect.FileDescriptor - -var file_telem_automation_custom_proto_rawDesc = []byte{ - 0x0a, 0x1d, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x5f, 0x61, 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x5f, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, - 0x05, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x22, 0x92, 0x01, 0x0a, 0x0b, 0x42, 0x6c, 0x6f, 0x63, 0x6b, - 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, - 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, - 0x74, 0x61, 0x6d, 0x70, 0x12, 0x21, 0x0a, 0x0c, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x6e, 0x75, - 0x6d, 0x62, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x63, - 0x6b, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1d, 0x0a, 0x0a, 0x62, 0x6c, 0x6f, 0x63, 0x6b, - 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x62, 0x6c, 0x6f, - 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x5f, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x63, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x22, 0x73, 0x0a, 0x0b, 0x4e, - 0x6f, 0x64, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, +var File_core_services_synchronization_telem_telem_automation_custom_proto protoreflect.FileDescriptor + +var file_core_services_synchronization_telem_telem_automation_custom_proto_rawDesc = []byte{ + 0x0a, 0x41, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, + 0x73, 0x79, 0x6e, 0x63, 0x68, 0x72, 0x6f, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, + 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x2f, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x5f, 0x61, 0x75, 0x74, 0x6f, + 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x12, 0x05, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x22, 0x92, 0x01, 0x0a, 0x0b, 0x42, + 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x74, - 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x21, 0x0a, 0x0c, 0x6e, 0x6f, 0x64, 0x65, - 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, - 0x6e, 0x6f, 0x64, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x23, 0x0a, 0x0d, 0x63, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x0c, 0x52, 0x0c, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, - 0x22, 0x91, 0x01, 0x0a, 0x16, 0x41, 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, - 0x65, 0x6c, 0x65, 0x6d, 0x57, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x12, 0x37, 0x0a, 0x0c, 0x62, - 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x12, 0x2e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, - 0x75, 0x6d, 0x62, 0x65, 0x72, 0x48, 0x00, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x75, - 0x6d, 0x62, 0x65, 0x72, 0x12, 0x37, 0x0a, 0x0c, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x76, 0x65, 0x72, - 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x74, 0x65, 0x6c, - 0x65, 0x6d, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x48, 0x00, - 0x52, 0x0b, 0x6e, 0x6f, 0x64, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x42, 0x05, 0x0a, - 0x03, 0x6d, 0x73, 0x67, 0x42, 0x4e, 0x5a, 0x4c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, - 0x6f, 0x6d, 0x2f, 0x73, 0x6d, 0x61, 0x72, 0x74, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, - 0x6b, 0x69, 0x74, 0x2f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x6b, 0x2f, 0x76, 0x32, - 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, 0x73, - 0x79, 0x6e, 0x63, 0x68, 0x72, 0x6f, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x74, - 0x65, 0x6c, 0x65, 0x6d, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x21, 0x0a, 0x0c, 0x62, 0x6c, 0x6f, 0x63, + 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, + 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1d, 0x0a, 0x0a, 0x62, + 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x0c, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x22, + 0x73, 0x0a, 0x0b, 0x4e, 0x6f, 0x64, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1c, + 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x21, 0x0a, 0x0c, + 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0b, 0x6e, 0x6f, 0x64, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, + 0x23, 0x0a, 0x0d, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x44, 0x69, + 0x67, 0x65, 0x73, 0x74, 0x22, 0x91, 0x01, 0x0a, 0x16, 0x41, 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x54, 0x65, 0x6c, 0x65, 0x6d, 0x57, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x12, + 0x37, 0x0a, 0x0c, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x2e, 0x42, 0x6c, + 0x6f, 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x48, 0x00, 0x52, 0x0b, 0x62, 0x6c, 0x6f, + 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x37, 0x0a, 0x0c, 0x6e, 0x6f, 0x64, 0x65, + 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, + 0x2e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, + 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x0b, 0x6e, 0x6f, 0x64, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, + 0x6e, 0x42, 0x05, 0x0a, 0x03, 0x6d, 0x73, 0x67, 0x42, 0x4e, 0x5a, 0x4c, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x6d, 0x61, 0x72, 0x74, 0x63, 0x6f, 0x6e, 0x74, + 0x72, 0x61, 0x63, 0x74, 0x6b, 0x69, 0x74, 0x2f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x6c, 0x69, 0x6e, + 0x6b, 0x2f, 0x76, 0x32, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x73, 0x2f, 0x73, 0x79, 0x6e, 0x63, 0x68, 0x72, 0x6f, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x2f, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( - file_telem_automation_custom_proto_rawDescOnce sync.Once - file_telem_automation_custom_proto_rawDescData = file_telem_automation_custom_proto_rawDesc + file_core_services_synchronization_telem_telem_automation_custom_proto_rawDescOnce sync.Once + file_core_services_synchronization_telem_telem_automation_custom_proto_rawDescData = file_core_services_synchronization_telem_telem_automation_custom_proto_rawDesc ) -func file_telem_automation_custom_proto_rawDescGZIP() []byte { - file_telem_automation_custom_proto_rawDescOnce.Do(func() { - file_telem_automation_custom_proto_rawDescData = protoimpl.X.CompressGZIP(file_telem_automation_custom_proto_rawDescData) +func file_core_services_synchronization_telem_telem_automation_custom_proto_rawDescGZIP() []byte { + file_core_services_synchronization_telem_telem_automation_custom_proto_rawDescOnce.Do(func() { + file_core_services_synchronization_telem_telem_automation_custom_proto_rawDescData = protoimpl.X.CompressGZIP(file_core_services_synchronization_telem_telem_automation_custom_proto_rawDescData) }) - return file_telem_automation_custom_proto_rawDescData + return file_core_services_synchronization_telem_telem_automation_custom_proto_rawDescData } -var file_telem_automation_custom_proto_msgTypes = make([]protoimpl.MessageInfo, 3) -var file_telem_automation_custom_proto_goTypes = []interface{}{ +var file_core_services_synchronization_telem_telem_automation_custom_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_core_services_synchronization_telem_telem_automation_custom_proto_goTypes = []any{ (*BlockNumber)(nil), // 0: telem.BlockNumber (*NodeVersion)(nil), // 1: telem.NodeVersion (*AutomationTelemWrapper)(nil), // 2: telem.AutomationTelemWrapper } -var file_telem_automation_custom_proto_depIdxs = []int32{ +var file_core_services_synchronization_telem_telem_automation_custom_proto_depIdxs = []int32{ 0, // 0: telem.AutomationTelemWrapper.block_number:type_name -> telem.BlockNumber 1, // 1: telem.AutomationTelemWrapper.node_version:type_name -> telem.NodeVersion 2, // [2:2] is the sub-list for method output_type @@ -302,13 +304,13 @@ var file_telem_automation_custom_proto_depIdxs = []int32{ 0, // [0:2] is the sub-list for field type_name } -func init() { file_telem_automation_custom_proto_init() } -func file_telem_automation_custom_proto_init() { - if File_telem_automation_custom_proto != nil { +func init() { file_core_services_synchronization_telem_telem_automation_custom_proto_init() } +func file_core_services_synchronization_telem_telem_automation_custom_proto_init() { + if File_core_services_synchronization_telem_telem_automation_custom_proto != nil { return } if !protoimpl.UnsafeEnabled { - file_telem_automation_custom_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_core_services_synchronization_telem_telem_automation_custom_proto_msgTypes[0].Exporter = func(v any, i int) any { switch v := v.(*BlockNumber); i { case 0: return &v.state @@ -320,7 +322,7 @@ func file_telem_automation_custom_proto_init() { return nil } } - file_telem_automation_custom_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_core_services_synchronization_telem_telem_automation_custom_proto_msgTypes[1].Exporter = func(v any, i int) any { switch v := v.(*NodeVersion); i { case 0: return &v.state @@ -332,7 +334,7 @@ func file_telem_automation_custom_proto_init() { return nil } } - file_telem_automation_custom_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + file_core_services_synchronization_telem_telem_automation_custom_proto_msgTypes[2].Exporter = func(v any, i int) any { switch v := v.(*AutomationTelemWrapper); i { case 0: return &v.state @@ -345,7 +347,7 @@ func file_telem_automation_custom_proto_init() { } } } - file_telem_automation_custom_proto_msgTypes[2].OneofWrappers = []interface{}{ + file_core_services_synchronization_telem_telem_automation_custom_proto_msgTypes[2].OneofWrappers = []any{ (*AutomationTelemWrapper_BlockNumber)(nil), (*AutomationTelemWrapper_NodeVersion)(nil), } @@ -353,18 +355,18 @@ func file_telem_automation_custom_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_telem_automation_custom_proto_rawDesc, + RawDescriptor: file_core_services_synchronization_telem_telem_automation_custom_proto_rawDesc, NumEnums: 0, NumMessages: 3, NumExtensions: 0, NumServices: 0, }, - GoTypes: file_telem_automation_custom_proto_goTypes, - DependencyIndexes: file_telem_automation_custom_proto_depIdxs, - MessageInfos: file_telem_automation_custom_proto_msgTypes, + GoTypes: file_core_services_synchronization_telem_telem_automation_custom_proto_goTypes, + DependencyIndexes: file_core_services_synchronization_telem_telem_automation_custom_proto_depIdxs, + MessageInfos: file_core_services_synchronization_telem_telem_automation_custom_proto_msgTypes, }.Build() - File_telem_automation_custom_proto = out.File - file_telem_automation_custom_proto_rawDesc = nil - file_telem_automation_custom_proto_goTypes = nil - file_telem_automation_custom_proto_depIdxs = nil + File_core_services_synchronization_telem_telem_automation_custom_proto = out.File + file_core_services_synchronization_telem_telem_automation_custom_proto_rawDesc = nil + file_core_services_synchronization_telem_telem_automation_custom_proto_goTypes = nil + file_core_services_synchronization_telem_telem_automation_custom_proto_depIdxs = nil } diff --git a/core/services/synchronization/telem/telem_enhanced_ea.pb.go b/core/services/synchronization/telem/telem_enhanced_ea.pb.go index 94237396a7a..687ff7ab4e9 100644 --- a/core/services/synchronization/telem/telem_enhanced_ea.pb.go +++ b/core/services/synchronization/telem/telem_enhanced_ea.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.1 -// protoc v3.21.12 +// protoc-gen-go v1.34.2 +// protoc v5.28.0 // source: core/services/synchronization/telem/telem_enhanced_ea.proto package telem @@ -239,7 +239,7 @@ func file_core_services_synchronization_telem_telem_enhanced_ea_proto_rawDescGZI } var file_core_services_synchronization_telem_telem_enhanced_ea_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_core_services_synchronization_telem_telem_enhanced_ea_proto_goTypes = []interface{}{ +var file_core_services_synchronization_telem_telem_enhanced_ea_proto_goTypes = []any{ (*EnhancedEA)(nil), // 0: telem.EnhancedEA } var file_core_services_synchronization_telem_telem_enhanced_ea_proto_depIdxs = []int32{ @@ -256,7 +256,7 @@ func file_core_services_synchronization_telem_telem_enhanced_ea_proto_init() { return } if !protoimpl.UnsafeEnabled { - file_core_services_synchronization_telem_telem_enhanced_ea_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_core_services_synchronization_telem_telem_enhanced_ea_proto_msgTypes[0].Exporter = func(v any, i int) any { switch v := v.(*EnhancedEA); i { case 0: return &v.state diff --git a/core/services/synchronization/telem/telem_enhanced_ea_mercury.pb.go b/core/services/synchronization/telem/telem_enhanced_ea_mercury.pb.go index 9cda6ef99a1..09eed12ee8a 100644 --- a/core/services/synchronization/telem/telem_enhanced_ea_mercury.pb.go +++ b/core/services/synchronization/telem/telem_enhanced_ea_mercury.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 -// protoc v4.24.3 +// protoc-gen-go v1.34.2 +// protoc v5.28.0 // source: core/services/synchronization/telem/telem_enhanced_ea_mercury.proto package telem @@ -20,16 +20,68 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +type MarketStatus int32 + +const ( + // Same values as those used by OCR. + MarketStatus_UNKNOWN MarketStatus = 0 + MarketStatus_CLOSED MarketStatus = 1 + MarketStatus_OPEN MarketStatus = 2 +) + +// Enum value maps for MarketStatus. +var ( + MarketStatus_name = map[int32]string{ + 0: "UNKNOWN", + 1: "CLOSED", + 2: "OPEN", + } + MarketStatus_value = map[string]int32{ + "UNKNOWN": 0, + "CLOSED": 1, + "OPEN": 2, + } +) + +func (x MarketStatus) Enum() *MarketStatus { + p := new(MarketStatus) + *p = x + return p +} + +func (x MarketStatus) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (MarketStatus) Descriptor() protoreflect.EnumDescriptor { + return file_core_services_synchronization_telem_telem_enhanced_ea_mercury_proto_enumTypes[0].Descriptor() +} + +func (MarketStatus) Type() protoreflect.EnumType { + return &file_core_services_synchronization_telem_telem_enhanced_ea_mercury_proto_enumTypes[0] +} + +func (x MarketStatus) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use MarketStatus.Descriptor instead. +func (MarketStatus) EnumDescriptor() ([]byte, []int) { + return file_core_services_synchronization_telem_telem_enhanced_ea_mercury_proto_rawDescGZIP(), []int{0} +} + type EnhancedEAMercury struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Version uint32 `protobuf:"varint,32,opt,name=version,proto3" json:"version,omitempty"` - DataSource string `protobuf:"bytes,1,opt,name=data_source,json=dataSource,proto3" json:"data_source,omitempty"` - DpBenchmarkPrice float64 `protobuf:"fixed64,2,opt,name=dp_benchmark_price,json=dpBenchmarkPrice,proto3" json:"dp_benchmark_price,omitempty"` - DpBid float64 `protobuf:"fixed64,3,opt,name=dp_bid,json=dpBid,proto3" json:"dp_bid,omitempty"` - DpAsk float64 `protobuf:"fixed64,4,opt,name=dp_ask,json=dpAsk,proto3" json:"dp_ask,omitempty"` + Version uint32 `protobuf:"varint,32,opt,name=version,proto3" json:"version,omitempty"` + DataSource string `protobuf:"bytes,1,opt,name=data_source,json=dataSource,proto3" json:"data_source,omitempty"` + DpBenchmarkPrice float64 `protobuf:"fixed64,2,opt,name=dp_benchmark_price,json=dpBenchmarkPrice,proto3" json:"dp_benchmark_price,omitempty"` + DpBid float64 `protobuf:"fixed64,3,opt,name=dp_bid,json=dpBid,proto3" json:"dp_bid,omitempty"` + DpAsk float64 `protobuf:"fixed64,4,opt,name=dp_ask,json=dpAsk,proto3" json:"dp_ask,omitempty"` + DpInvariantViolationDetected bool `protobuf:"varint,33,opt,name=dp_invariant_violation_detected,json=dpInvariantViolationDetected,proto3" json:"dp_invariant_violation_detected,omitempty"` + BridgeRequestData string `protobuf:"bytes,35,opt,name=bridge_request_data,json=bridgeRequestData,proto3" json:"bridge_request_data,omitempty"` // v1 fields (block range) CurrentBlockNumber int64 `protobuf:"varint,5,opt,name=current_block_number,json=currentBlockNumber,proto3" json:"current_block_number,omitempty"` CurrentBlockHash string `protobuf:"bytes,6,opt,name=current_block_hash,json=currentBlockHash,proto3" json:"current_block_hash,omitempty"` @@ -49,7 +101,7 @@ type EnhancedEAMercury struct { ProviderDataStreamEstablished int64 `protobuf:"varint,12,opt,name=provider_data_stream_established,json=providerDataStreamEstablished,proto3" json:"provider_data_stream_established,omitempty"` ProviderIndicatedTime int64 `protobuf:"varint,13,opt,name=provider_indicated_time,json=providerIndicatedTime,proto3" json:"provider_indicated_time,omitempty"` Feed string `protobuf:"bytes,14,opt,name=feed,proto3" json:"feed,omitempty"` - // v1+v2+v3 + // v1+v2+v3+v4 ObservationBenchmarkPrice int64 `protobuf:"varint,15,opt,name=observation_benchmark_price,json=observationBenchmarkPrice,proto3" json:"observation_benchmark_price,omitempty"` // This value overflows, will be reserved and removed in future versions ObservationBenchmarkPriceString string `protobuf:"bytes,22,opt,name=observation_benchmark_price_string,json=observationBenchmarkPriceString,proto3" json:"observation_benchmark_price_string,omitempty"` // v1+v3 @@ -57,10 +109,12 @@ type EnhancedEAMercury struct { ObservationAsk int64 `protobuf:"varint,17,opt,name=observation_ask,json=observationAsk,proto3" json:"observation_ask,omitempty"` // This value overflows, will be reserved and removed in future versions ObservationBidString string `protobuf:"bytes,23,opt,name=observation_bid_string,json=observationBidString,proto3" json:"observation_bid_string,omitempty"` ObservationAskString string `protobuf:"bytes,24,opt,name=observation_ask_string,json=observationAskString,proto3" json:"observation_ask_string,omitempty"` - ConfigDigest string `protobuf:"bytes,18,opt,name=config_digest,json=configDigest,proto3" json:"config_digest,omitempty"` - Round int64 `protobuf:"varint,19,opt,name=round,proto3" json:"round,omitempty"` - Epoch int64 `protobuf:"varint,20,opt,name=epoch,proto3" json:"epoch,omitempty"` - AssetSymbol string `protobuf:"bytes,21,opt,name=asset_symbol,json=assetSymbol,proto3" json:"asset_symbol,omitempty"` + // v4 + ObservationMarketStatus MarketStatus `protobuf:"varint,34,opt,name=observation_market_status,json=observationMarketStatus,proto3,enum=telem.MarketStatus" json:"observation_market_status,omitempty"` + ConfigDigest string `protobuf:"bytes,18,opt,name=config_digest,json=configDigest,proto3" json:"config_digest,omitempty"` + Round int64 `protobuf:"varint,19,opt,name=round,proto3" json:"round,omitempty"` + Epoch int64 `protobuf:"varint,20,opt,name=epoch,proto3" json:"epoch,omitempty"` + AssetSymbol string `protobuf:"bytes,21,opt,name=asset_symbol,json=assetSymbol,proto3" json:"asset_symbol,omitempty"` } func (x *EnhancedEAMercury) Reset() { @@ -130,6 +184,20 @@ func (x *EnhancedEAMercury) GetDpAsk() float64 { return 0 } +func (x *EnhancedEAMercury) GetDpInvariantViolationDetected() bool { + if x != nil { + return x.DpInvariantViolationDetected + } + return false +} + +func (x *EnhancedEAMercury) GetBridgeRequestData() string { + if x != nil { + return x.BridgeRequestData + } + return "" +} + func (x *EnhancedEAMercury) GetCurrentBlockNumber() int64 { if x != nil { return x.CurrentBlockNumber @@ -291,6 +359,13 @@ func (x *EnhancedEAMercury) GetObservationAskString() string { return "" } +func (x *EnhancedEAMercury) GetObservationMarketStatus() MarketStatus { + if x != nil { + return x.ObservationMarketStatus + } + return MarketStatus_UNKNOWN +} + func (x *EnhancedEAMercury) GetConfigDigest() string { if x != nil { return x.ConfigDigest @@ -326,7 +401,7 @@ var file_core_services_synchronization_telem_telem_enhanced_ea_mercury_proto_raw 0x73, 0x79, 0x6e, 0x63, 0x68, 0x72, 0x6f, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x2f, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x5f, 0x65, 0x6e, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x64, 0x5f, 0x65, 0x61, 0x5f, 0x6d, 0x65, 0x72, 0x63, 0x75, 0x72, 0x79, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x05, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x22, 0xe2, 0x0b, 0x0a, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x05, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x22, 0xaa, 0x0d, 0x0a, 0x11, 0x45, 0x6e, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x64, 0x45, 0x41, 0x4d, 0x65, 0x72, 0x63, 0x75, 0x72, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x20, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1f, 0x0a, 0x0b, @@ -337,96 +412,112 @@ var file_core_services_synchronization_telem_telem_enhanced_ea_mercury_proto_raw 0x63, 0x68, 0x6d, 0x61, 0x72, 0x6b, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x15, 0x0a, 0x06, 0x64, 0x70, 0x5f, 0x62, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x01, 0x52, 0x05, 0x64, 0x70, 0x42, 0x69, 0x64, 0x12, 0x15, 0x0a, 0x06, 0x64, 0x70, 0x5f, 0x61, 0x73, 0x6b, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x01, 0x52, 0x05, 0x64, 0x70, 0x41, 0x73, 0x6b, 0x12, 0x30, 0x0a, 0x14, 0x63, 0x75, 0x72, - 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, - 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x12, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, - 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x2c, 0x0a, 0x12, 0x63, - 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, - 0x68, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, - 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x12, 0x36, 0x0a, 0x17, 0x63, 0x75, 0x72, - 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x73, - 0x74, 0x61, 0x6d, 0x70, 0x18, 0x07, 0x20, 0x01, 0x28, 0x04, 0x52, 0x15, 0x63, 0x75, 0x72, 0x72, - 0x65, 0x6e, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, - 0x70, 0x12, 0x41, 0x0a, 0x1d, 0x66, 0x65, 0x74, 0x63, 0x68, 0x5f, 0x6d, 0x61, 0x78, 0x5f, 0x66, - 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, - 0x6d, 0x70, 0x18, 0x19, 0x20, 0x01, 0x28, 0x08, 0x52, 0x1a, 0x66, 0x65, 0x74, 0x63, 0x68, 0x4d, - 0x61, 0x78, 0x46, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x73, - 0x74, 0x61, 0x6d, 0x70, 0x12, 0x36, 0x0a, 0x17, 0x6d, 0x61, 0x78, 0x5f, 0x66, 0x69, 0x6e, 0x61, - 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, - 0x1a, 0x20, 0x01, 0x28, 0x03, 0x52, 0x15, 0x6d, 0x61, 0x78, 0x46, 0x69, 0x6e, 0x61, 0x6c, 0x69, - 0x7a, 0x65, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x33, 0x0a, 0x15, - 0x6f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x69, 0x6d, 0x65, - 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x1b, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x14, 0x6f, 0x62, 0x73, - 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, - 0x70, 0x12, 0x20, 0x0a, 0x0c, 0x69, 0x73, 0x5f, 0x6c, 0x69, 0x6e, 0x6b, 0x5f, 0x66, 0x65, 0x65, - 0x64, 0x18, 0x1c, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x69, 0x73, 0x4c, 0x69, 0x6e, 0x6b, 0x46, - 0x65, 0x65, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x6c, 0x69, 0x6e, 0x6b, 0x5f, 0x70, 0x72, 0x69, 0x63, - 0x65, 0x18, 0x1d, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x6c, 0x69, 0x6e, 0x6b, 0x50, 0x72, 0x69, - 0x63, 0x65, 0x12, 0x24, 0x0a, 0x0e, 0x69, 0x73, 0x5f, 0x6e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x5f, - 0x66, 0x65, 0x65, 0x64, 0x18, 0x1e, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x69, 0x73, 0x4e, 0x61, - 0x74, 0x69, 0x76, 0x65, 0x46, 0x65, 0x65, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x6e, 0x61, 0x74, 0x69, - 0x76, 0x65, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x1f, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, - 0x6e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x48, 0x0a, 0x21, 0x62, - 0x72, 0x69, 0x64, 0x67, 0x65, 0x5f, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x72, 0x75, 0x6e, 0x5f, 0x73, - 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, - 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x1d, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x54, 0x61, - 0x73, 0x6b, 0x52, 0x75, 0x6e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, 0x54, 0x69, 0x6d, 0x65, - 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x44, 0x0a, 0x1f, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x5f, - 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x72, 0x75, 0x6e, 0x5f, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x5f, 0x74, - 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x1b, - 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x75, 0x6e, 0x45, 0x6e, 0x64, - 0x65, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x40, 0x0a, 0x1c, 0x70, - 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x65, - 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x0a, 0x20, 0x01, 0x28, - 0x03, 0x52, 0x1a, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x65, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x3e, 0x0a, - 0x1b, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x5f, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, - 0x65, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x0b, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x19, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x52, 0x65, 0x63, 0x65, - 0x69, 0x76, 0x65, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x47, 0x0a, - 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x73, - 0x74, 0x72, 0x65, 0x61, 0x6d, 0x5f, 0x65, 0x73, 0x74, 0x61, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, - 0x64, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x03, 0x52, 0x1d, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, - 0x72, 0x44, 0x61, 0x74, 0x61, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x45, 0x73, 0x74, 0x61, 0x62, - 0x6c, 0x69, 0x73, 0x68, 0x65, 0x64, 0x12, 0x36, 0x0a, 0x17, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, - 0x65, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x74, 0x69, 0x6d, - 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x03, 0x52, 0x15, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, - 0x72, 0x49, 0x6e, 0x64, 0x69, 0x63, 0x61, 0x74, 0x65, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x12, - 0x0a, 0x04, 0x66, 0x65, 0x65, 0x64, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x66, 0x65, - 0x65, 0x64, 0x12, 0x3e, 0x0a, 0x1b, 0x6f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x5f, 0x62, 0x65, 0x6e, 0x63, 0x68, 0x6d, 0x61, 0x72, 0x6b, 0x5f, 0x70, 0x72, 0x69, 0x63, - 0x65, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x03, 0x52, 0x19, 0x6f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x65, 0x6e, 0x63, 0x68, 0x6d, 0x61, 0x72, 0x6b, 0x50, 0x72, 0x69, - 0x63, 0x65, 0x12, 0x4b, 0x0a, 0x22, 0x6f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x5f, 0x62, 0x65, 0x6e, 0x63, 0x68, 0x6d, 0x61, 0x72, 0x6b, 0x5f, 0x70, 0x72, 0x69, 0x63, - 0x65, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x18, 0x16, 0x20, 0x01, 0x28, 0x09, 0x52, 0x1f, + 0x28, 0x01, 0x52, 0x05, 0x64, 0x70, 0x41, 0x73, 0x6b, 0x12, 0x45, 0x0a, 0x1f, 0x64, 0x70, 0x5f, + 0x69, 0x6e, 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x5f, 0x76, 0x69, 0x6f, 0x6c, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x65, 0x74, 0x65, 0x63, 0x74, 0x65, 0x64, 0x18, 0x21, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x1c, 0x64, 0x70, 0x49, 0x6e, 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x56, + 0x69, 0x6f, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x65, 0x74, 0x65, 0x63, 0x74, 0x65, 0x64, + 0x12, 0x2e, 0x0a, 0x13, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x23, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x62, + 0x72, 0x69, 0x64, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x44, 0x61, 0x74, 0x61, + 0x12, 0x30, 0x0a, 0x14, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x62, 0x6c, 0x6f, 0x63, + 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x12, + 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x62, + 0x65, 0x72, 0x12, 0x2c, 0x0a, 0x12, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x62, 0x6c, + 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, + 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, + 0x12, 0x36, 0x0a, 0x17, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x62, 0x6c, 0x6f, 0x63, + 0x6b, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x07, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x15, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x54, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x41, 0x0a, 0x1d, 0x66, 0x65, 0x74, 0x63, + 0x68, 0x5f, 0x6d, 0x61, 0x78, 0x5f, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x5f, + 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x19, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x1a, 0x66, 0x65, 0x74, 0x63, 0x68, 0x4d, 0x61, 0x78, 0x46, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, + 0x65, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x36, 0x0a, 0x17, 0x6d, + 0x61, 0x78, 0x5f, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x5f, 0x74, 0x69, 0x6d, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x1a, 0x20, 0x01, 0x28, 0x03, 0x52, 0x15, 0x6d, 0x61, + 0x78, 0x46, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, + 0x61, 0x6d, 0x70, 0x12, 0x33, 0x0a, 0x15, 0x6f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x1b, 0x20, 0x01, + 0x28, 0x0d, 0x52, 0x14, 0x6f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x20, 0x0a, 0x0c, 0x69, 0x73, 0x5f, 0x6c, + 0x69, 0x6e, 0x6b, 0x5f, 0x66, 0x65, 0x65, 0x64, 0x18, 0x1c, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, + 0x69, 0x73, 0x4c, 0x69, 0x6e, 0x6b, 0x46, 0x65, 0x65, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x6c, 0x69, + 0x6e, 0x6b, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x1d, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, + 0x6c, 0x69, 0x6e, 0x6b, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x24, 0x0a, 0x0e, 0x69, 0x73, 0x5f, + 0x6e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x66, 0x65, 0x65, 0x64, 0x18, 0x1e, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x0c, 0x69, 0x73, 0x4e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x46, 0x65, 0x65, 0x64, 0x12, + 0x21, 0x0a, 0x0c, 0x6e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, + 0x1f, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x6e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x50, 0x72, 0x69, + 0x63, 0x65, 0x12, 0x48, 0x0a, 0x21, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x5f, 0x74, 0x61, 0x73, + 0x6b, 0x5f, 0x72, 0x75, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, 0x5f, 0x74, 0x69, + 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x1d, 0x62, + 0x72, 0x69, 0x64, 0x67, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x75, 0x6e, 0x53, 0x74, 0x61, 0x72, + 0x74, 0x65, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x44, 0x0a, 0x1f, + 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x5f, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x72, 0x75, 0x6e, 0x5f, + 0x65, 0x6e, 0x64, 0x65, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, + 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x1b, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x54, 0x61, 0x73, + 0x6b, 0x52, 0x75, 0x6e, 0x45, 0x6e, 0x64, 0x65, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x12, 0x40, 0x0a, 0x1c, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x5f, 0x72, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x03, 0x52, 0x1a, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, + 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x65, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x73, + 0x74, 0x61, 0x6d, 0x70, 0x12, 0x3e, 0x0a, 0x1b, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, + 0x5f, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, + 0x61, 0x6d, 0x70, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x03, 0x52, 0x19, 0x70, 0x72, 0x6f, 0x76, 0x69, + 0x64, 0x65, 0x72, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x73, + 0x74, 0x61, 0x6d, 0x70, 0x12, 0x47, 0x0a, 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, + 0x5f, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x5f, 0x65, 0x73, 0x74, + 0x61, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x64, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x03, 0x52, 0x1d, + 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x44, 0x61, 0x74, 0x61, 0x53, 0x74, 0x72, 0x65, + 0x61, 0x6d, 0x45, 0x73, 0x74, 0x61, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x64, 0x12, 0x36, 0x0a, + 0x17, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x61, + 0x74, 0x65, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x03, 0x52, 0x15, + 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x64, 0x69, 0x63, 0x61, 0x74, 0x65, + 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x65, 0x65, 0x64, 0x18, 0x0e, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x66, 0x65, 0x65, 0x64, 0x12, 0x3e, 0x0a, 0x1b, 0x6f, 0x62, 0x73, + 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x62, 0x65, 0x6e, 0x63, 0x68, 0x6d, 0x61, + 0x72, 0x6b, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x03, 0x52, 0x19, 0x6f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x65, 0x6e, 0x63, 0x68, - 0x6d, 0x61, 0x72, 0x6b, 0x50, 0x72, 0x69, 0x63, 0x65, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x12, - 0x27, 0x0a, 0x0f, 0x6f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x62, - 0x69, 0x64, 0x18, 0x10, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0e, 0x6f, 0x62, 0x73, 0x65, 0x72, 0x76, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x69, 0x64, 0x12, 0x27, 0x0a, 0x0f, 0x6f, 0x62, 0x73, 0x65, - 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x61, 0x73, 0x6b, 0x18, 0x11, 0x20, 0x01, 0x28, - 0x03, 0x52, 0x0e, 0x6f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x73, - 0x6b, 0x12, 0x34, 0x0a, 0x16, 0x6f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x5f, 0x62, 0x69, 0x64, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x18, 0x17, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x14, 0x6f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x69, - 0x64, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x12, 0x34, 0x0a, 0x16, 0x6f, 0x62, 0x73, 0x65, 0x72, - 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x61, 0x73, 0x6b, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, - 0x67, 0x18, 0x18, 0x20, 0x01, 0x28, 0x09, 0x52, 0x14, 0x6f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x73, 0x6b, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x12, 0x23, 0x0a, - 0x0d, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, 0x12, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x44, 0x69, 0x67, 0x65, - 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x18, 0x13, 0x20, 0x01, 0x28, - 0x03, 0x52, 0x05, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, - 0x68, 0x18, 0x14, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x21, - 0x0a, 0x0c, 0x61, 0x73, 0x73, 0x65, 0x74, 0x5f, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x18, 0x15, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x61, 0x73, 0x73, 0x65, 0x74, 0x53, 0x79, 0x6d, 0x62, 0x6f, - 0x6c, 0x42, 0x4e, 0x5a, 0x4c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x73, 0x6d, 0x61, 0x72, 0x74, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x6b, 0x69, 0x74, - 0x2f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x6b, 0x2f, 0x76, 0x32, 0x2f, 0x63, 0x6f, - 0x72, 0x65, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, 0x73, 0x79, 0x6e, 0x63, - 0x68, 0x72, 0x6f, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x74, 0x65, 0x6c, 0x65, - 0x6d, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6d, 0x61, 0x72, 0x6b, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x4b, 0x0a, 0x22, 0x6f, 0x62, 0x73, + 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x62, 0x65, 0x6e, 0x63, 0x68, 0x6d, 0x61, + 0x72, 0x6b, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x18, + 0x16, 0x20, 0x01, 0x28, 0x09, 0x52, 0x1f, 0x6f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x42, 0x65, 0x6e, 0x63, 0x68, 0x6d, 0x61, 0x72, 0x6b, 0x50, 0x72, 0x69, 0x63, 0x65, + 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x12, 0x27, 0x0a, 0x0f, 0x6f, 0x62, 0x73, 0x65, 0x72, 0x76, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x62, 0x69, 0x64, 0x18, 0x10, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x0e, 0x6f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x69, 0x64, 0x12, + 0x27, 0x0a, 0x0f, 0x6f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x61, + 0x73, 0x6b, 0x18, 0x11, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0e, 0x6f, 0x62, 0x73, 0x65, 0x72, 0x76, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x73, 0x6b, 0x12, 0x34, 0x0a, 0x16, 0x6f, 0x62, 0x73, 0x65, + 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x62, 0x69, 0x64, 0x5f, 0x73, 0x74, 0x72, 0x69, + 0x6e, 0x67, 0x18, 0x17, 0x20, 0x01, 0x28, 0x09, 0x52, 0x14, 0x6f, 0x62, 0x73, 0x65, 0x72, 0x76, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x69, 0x64, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x12, 0x34, + 0x0a, 0x16, 0x6f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x61, 0x73, + 0x6b, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x18, 0x18, 0x20, 0x01, 0x28, 0x09, 0x52, 0x14, + 0x6f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x73, 0x6b, 0x53, 0x74, + 0x72, 0x69, 0x6e, 0x67, 0x12, 0x4f, 0x0a, 0x19, 0x6f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x18, 0x22, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x13, 0x2e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x2e, + 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x17, 0x6f, 0x62, + 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x53, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, + 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, 0x12, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x63, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x72, 0x6f, + 0x75, 0x6e, 0x64, 0x18, 0x13, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x72, 0x6f, 0x75, 0x6e, 0x64, + 0x12, 0x14, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x14, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x21, 0x0a, 0x0c, 0x61, 0x73, 0x73, 0x65, 0x74, 0x5f, + 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x18, 0x15, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x61, 0x73, + 0x73, 0x65, 0x74, 0x53, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x2a, 0x31, 0x0a, 0x0c, 0x4d, 0x61, 0x72, + 0x6b, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, + 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x43, 0x4c, 0x4f, 0x53, 0x45, 0x44, + 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x4f, 0x50, 0x45, 0x4e, 0x10, 0x02, 0x42, 0x4e, 0x5a, 0x4c, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x6d, 0x61, 0x72, 0x74, + 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x6b, 0x69, 0x74, 0x2f, 0x63, 0x68, 0x61, 0x69, + 0x6e, 0x6c, 0x69, 0x6e, 0x6b, 0x2f, 0x76, 0x32, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, 0x73, 0x79, 0x6e, 0x63, 0x68, 0x72, 0x6f, 0x6e, 0x69, + 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -441,16 +532,19 @@ func file_core_services_synchronization_telem_telem_enhanced_ea_mercury_proto_ra return file_core_services_synchronization_telem_telem_enhanced_ea_mercury_proto_rawDescData } +var file_core_services_synchronization_telem_telem_enhanced_ea_mercury_proto_enumTypes = make([]protoimpl.EnumInfo, 1) var file_core_services_synchronization_telem_telem_enhanced_ea_mercury_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_core_services_synchronization_telem_telem_enhanced_ea_mercury_proto_goTypes = []interface{}{ - (*EnhancedEAMercury)(nil), // 0: telem.EnhancedEAMercury +var file_core_services_synchronization_telem_telem_enhanced_ea_mercury_proto_goTypes = []any{ + (MarketStatus)(0), // 0: telem.MarketStatus + (*EnhancedEAMercury)(nil), // 1: telem.EnhancedEAMercury } var file_core_services_synchronization_telem_telem_enhanced_ea_mercury_proto_depIdxs = []int32{ - 0, // [0:0] is the sub-list for method output_type - 0, // [0:0] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name + 0, // 0: telem.EnhancedEAMercury.observation_market_status:type_name -> telem.MarketStatus + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name } func init() { file_core_services_synchronization_telem_telem_enhanced_ea_mercury_proto_init() } @@ -459,7 +553,7 @@ func file_core_services_synchronization_telem_telem_enhanced_ea_mercury_proto_in return } if !protoimpl.UnsafeEnabled { - file_core_services_synchronization_telem_telem_enhanced_ea_mercury_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_core_services_synchronization_telem_telem_enhanced_ea_mercury_proto_msgTypes[0].Exporter = func(v any, i int) any { switch v := v.(*EnhancedEAMercury); i { case 0: return &v.state @@ -477,13 +571,14 @@ func file_core_services_synchronization_telem_telem_enhanced_ea_mercury_proto_in File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_core_services_synchronization_telem_telem_enhanced_ea_mercury_proto_rawDesc, - NumEnums: 0, + NumEnums: 1, NumMessages: 1, NumExtensions: 0, NumServices: 0, }, GoTypes: file_core_services_synchronization_telem_telem_enhanced_ea_mercury_proto_goTypes, DependencyIndexes: file_core_services_synchronization_telem_telem_enhanced_ea_mercury_proto_depIdxs, + EnumInfos: file_core_services_synchronization_telem_telem_enhanced_ea_mercury_proto_enumTypes, MessageInfos: file_core_services_synchronization_telem_telem_enhanced_ea_mercury_proto_msgTypes, }.Build() File_core_services_synchronization_telem_telem_enhanced_ea_mercury_proto = out.File diff --git a/core/services/synchronization/telem/telem_enhanced_ea_mercury.proto b/core/services/synchronization/telem/telem_enhanced_ea_mercury.proto index a527552bb6b..d57b7ca836a 100644 --- a/core/services/synchronization/telem/telem_enhanced_ea_mercury.proto +++ b/core/services/synchronization/telem/telem_enhanced_ea_mercury.proto @@ -4,6 +4,13 @@ option go_package = "github.com/smartcontractkit/chainlink/v2/core/services/sync package telem; +enum MarketStatus { + // Same values as those used by OCR. + UNKNOWN = 0; + CLOSED = 1; + OPEN = 2; +} + message EnhancedEAMercury { uint32 version = 32; @@ -11,6 +18,8 @@ message EnhancedEAMercury { double dp_benchmark_price=2; double dp_bid=3; double dp_ask=4; + bool dp_invariant_violation_detected=33; + string bridge_request_data = 35; // v1 fields (block range) int64 current_block_number=5; @@ -35,7 +44,7 @@ message EnhancedEAMercury { string feed=14; - // v1+v2+v3 + // v1+v2+v3+v4 int64 observation_benchmark_price=15; // This value overflows, will be reserved and removed in future versions string observation_benchmark_price_string = 22; // v1+v3 @@ -43,11 +52,11 @@ message EnhancedEAMercury { int64 observation_ask=17; // This value overflows, will be reserved and removed in future versions string observation_bid_string = 23; string observation_ask_string = 24; + // v4 + MarketStatus observation_market_status=34; string config_digest = 18; int64 round=19; int64 epoch=20; string asset_symbol=21; - - } diff --git a/core/services/synchronization/telem/telem_functions_request.pb.go b/core/services/synchronization/telem/telem_functions_request.pb.go index 82690cb90de..1a67d1223a8 100644 --- a/core/services/synchronization/telem/telem_functions_request.pb.go +++ b/core/services/synchronization/telem/telem_functions_request.pb.go @@ -1,8 +1,8 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.30.0 -// protoc v3.21.12 -// source: telem_functions_request.proto +// protoc-gen-go v1.34.2 +// protoc v5.28.0 +// source: core/services/synchronization/telem/telem_functions_request.proto package telem @@ -33,7 +33,7 @@ type FunctionsRequest struct { func (x *FunctionsRequest) Reset() { *x = FunctionsRequest{} if protoimpl.UnsafeEnabled { - mi := &file_telem_functions_request_proto_msgTypes[0] + mi := &file_core_services_synchronization_telem_telem_functions_request_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -46,7 +46,7 @@ func (x *FunctionsRequest) String() string { func (*FunctionsRequest) ProtoMessage() {} func (x *FunctionsRequest) ProtoReflect() protoreflect.Message { - mi := &file_telem_functions_request_proto_msgTypes[0] + mi := &file_core_services_synchronization_telem_telem_functions_request_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -59,7 +59,7 @@ func (x *FunctionsRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use FunctionsRequest.ProtoReflect.Descriptor instead. func (*FunctionsRequest) Descriptor() ([]byte, []int) { - return file_telem_functions_request_proto_rawDescGZIP(), []int{0} + return file_core_services_synchronization_telem_telem_functions_request_proto_rawDescGZIP(), []int{0} } func (x *FunctionsRequest) GetRequestId() string { @@ -83,43 +83,46 @@ func (x *FunctionsRequest) GetDomains() []string { return nil } -var File_telem_functions_request_proto protoreflect.FileDescriptor - -var file_telem_functions_request_proto_rawDesc = []byte{ - 0x0a, 0x1d, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x5f, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, - 0x05, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x22, 0x6e, 0x0a, 0x10, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, - 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x6e, 0x6f, 0x64, - 0x65, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0b, 0x6e, 0x6f, 0x64, 0x65, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x18, 0x0a, 0x07, - 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x64, - 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x73, 0x42, 0x4e, 0x5a, 0x4c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, - 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x6d, 0x61, 0x72, 0x74, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, - 0x63, 0x74, 0x6b, 0x69, 0x74, 0x2f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x6b, 0x2f, - 0x76, 0x32, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, - 0x2f, 0x73, 0x79, 0x6e, 0x63, 0x68, 0x72, 0x6f, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x2f, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +var File_core_services_synchronization_telem_telem_functions_request_proto protoreflect.FileDescriptor + +var file_core_services_synchronization_telem_telem_functions_request_proto_rawDesc = []byte{ + 0x0a, 0x41, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, + 0x73, 0x79, 0x6e, 0x63, 0x68, 0x72, 0x6f, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, + 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x2f, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x5f, 0x66, 0x75, 0x6e, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x12, 0x05, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x22, 0x6e, 0x0a, 0x10, 0x46, 0x75, + 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, + 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x12, 0x21, 0x0a, + 0x0c, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6e, 0x6f, 0x64, 0x65, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x12, 0x18, 0x0a, 0x07, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, + 0x09, 0x52, 0x07, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x73, 0x42, 0x4e, 0x5a, 0x4c, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x6d, 0x61, 0x72, 0x74, 0x63, 0x6f, + 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x6b, 0x69, 0x74, 0x2f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x6c, + 0x69, 0x6e, 0x6b, 0x2f, 0x76, 0x32, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x73, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x73, 0x2f, 0x73, 0x79, 0x6e, 0x63, 0x68, 0x72, 0x6f, 0x6e, 0x69, 0x7a, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, } var ( - file_telem_functions_request_proto_rawDescOnce sync.Once - file_telem_functions_request_proto_rawDescData = file_telem_functions_request_proto_rawDesc + file_core_services_synchronization_telem_telem_functions_request_proto_rawDescOnce sync.Once + file_core_services_synchronization_telem_telem_functions_request_proto_rawDescData = file_core_services_synchronization_telem_telem_functions_request_proto_rawDesc ) -func file_telem_functions_request_proto_rawDescGZIP() []byte { - file_telem_functions_request_proto_rawDescOnce.Do(func() { - file_telem_functions_request_proto_rawDescData = protoimpl.X.CompressGZIP(file_telem_functions_request_proto_rawDescData) +func file_core_services_synchronization_telem_telem_functions_request_proto_rawDescGZIP() []byte { + file_core_services_synchronization_telem_telem_functions_request_proto_rawDescOnce.Do(func() { + file_core_services_synchronization_telem_telem_functions_request_proto_rawDescData = protoimpl.X.CompressGZIP(file_core_services_synchronization_telem_telem_functions_request_proto_rawDescData) }) - return file_telem_functions_request_proto_rawDescData + return file_core_services_synchronization_telem_telem_functions_request_proto_rawDescData } -var file_telem_functions_request_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_telem_functions_request_proto_goTypes = []interface{}{ +var file_core_services_synchronization_telem_telem_functions_request_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_core_services_synchronization_telem_telem_functions_request_proto_goTypes = []any{ (*FunctionsRequest)(nil), // 0: telem.FunctionsRequest } -var file_telem_functions_request_proto_depIdxs = []int32{ +var file_core_services_synchronization_telem_telem_functions_request_proto_depIdxs = []int32{ 0, // [0:0] is the sub-list for method output_type 0, // [0:0] is the sub-list for method input_type 0, // [0:0] is the sub-list for extension type_name @@ -127,13 +130,13 @@ var file_telem_functions_request_proto_depIdxs = []int32{ 0, // [0:0] is the sub-list for field type_name } -func init() { file_telem_functions_request_proto_init() } -func file_telem_functions_request_proto_init() { - if File_telem_functions_request_proto != nil { +func init() { file_core_services_synchronization_telem_telem_functions_request_proto_init() } +func file_core_services_synchronization_telem_telem_functions_request_proto_init() { + if File_core_services_synchronization_telem_telem_functions_request_proto != nil { return } if !protoimpl.UnsafeEnabled { - file_telem_functions_request_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_core_services_synchronization_telem_telem_functions_request_proto_msgTypes[0].Exporter = func(v any, i int) any { switch v := v.(*FunctionsRequest); i { case 0: return &v.state @@ -150,18 +153,18 @@ func file_telem_functions_request_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_telem_functions_request_proto_rawDesc, + RawDescriptor: file_core_services_synchronization_telem_telem_functions_request_proto_rawDesc, NumEnums: 0, NumMessages: 1, NumExtensions: 0, NumServices: 0, }, - GoTypes: file_telem_functions_request_proto_goTypes, - DependencyIndexes: file_telem_functions_request_proto_depIdxs, - MessageInfos: file_telem_functions_request_proto_msgTypes, + GoTypes: file_core_services_synchronization_telem_telem_functions_request_proto_goTypes, + DependencyIndexes: file_core_services_synchronization_telem_telem_functions_request_proto_depIdxs, + MessageInfos: file_core_services_synchronization_telem_telem_functions_request_proto_msgTypes, }.Build() - File_telem_functions_request_proto = out.File - file_telem_functions_request_proto_rawDesc = nil - file_telem_functions_request_proto_goTypes = nil - file_telem_functions_request_proto_depIdxs = nil + File_core_services_synchronization_telem_telem_functions_request_proto = out.File + file_core_services_synchronization_telem_telem_functions_request_proto_rawDesc = nil + file_core_services_synchronization_telem_telem_functions_request_proto_goTypes = nil + file_core_services_synchronization_telem_telem_functions_request_proto_depIdxs = nil } diff --git a/core/services/synchronization/telem/telem_head_report.pb.go b/core/services/synchronization/telem/telem_head_report.pb.go new file mode 100644 index 00000000000..c4101d06560 --- /dev/null +++ b/core/services/synchronization/telem/telem_head_report.pb.go @@ -0,0 +1,256 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.34.2 +// protoc v5.28.0 +// source: core/services/synchronization/telem/telem_head_report.proto + +package telem + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type HeadReportRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ChainID string `protobuf:"bytes,1,opt,name=chainID,proto3" json:"chainID,omitempty"` + Latest *Block `protobuf:"bytes,2,opt,name=latest,proto3" json:"latest,omitempty"` + Finalized *Block `protobuf:"bytes,3,opt,name=finalized,proto3,oneof" json:"finalized,omitempty"` +} + +func (x *HeadReportRequest) Reset() { + *x = HeadReportRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_core_services_synchronization_telem_telem_head_report_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *HeadReportRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HeadReportRequest) ProtoMessage() {} + +func (x *HeadReportRequest) ProtoReflect() protoreflect.Message { + mi := &file_core_services_synchronization_telem_telem_head_report_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use HeadReportRequest.ProtoReflect.Descriptor instead. +func (*HeadReportRequest) Descriptor() ([]byte, []int) { + return file_core_services_synchronization_telem_telem_head_report_proto_rawDescGZIP(), []int{0} +} + +func (x *HeadReportRequest) GetChainID() string { + if x != nil { + return x.ChainID + } + return "" +} + +func (x *HeadReportRequest) GetLatest() *Block { + if x != nil { + return x.Latest + } + return nil +} + +func (x *HeadReportRequest) GetFinalized() *Block { + if x != nil { + return x.Finalized + } + return nil +} + +type Block struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Timestamp uint64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + Number uint64 `protobuf:"varint,2,opt,name=number,proto3" json:"number,omitempty"` + Hash string `protobuf:"bytes,3,opt,name=hash,proto3" json:"hash,omitempty"` +} + +func (x *Block) Reset() { + *x = Block{} + if protoimpl.UnsafeEnabled { + mi := &file_core_services_synchronization_telem_telem_head_report_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Block) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Block) ProtoMessage() {} + +func (x *Block) ProtoReflect() protoreflect.Message { + mi := &file_core_services_synchronization_telem_telem_head_report_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Block.ProtoReflect.Descriptor instead. +func (*Block) Descriptor() ([]byte, []int) { + return file_core_services_synchronization_telem_telem_head_report_proto_rawDescGZIP(), []int{1} +} + +func (x *Block) GetTimestamp() uint64 { + if x != nil { + return x.Timestamp + } + return 0 +} + +func (x *Block) GetNumber() uint64 { + if x != nil { + return x.Number + } + return 0 +} + +func (x *Block) GetHash() string { + if x != nil { + return x.Hash + } + return "" +} + +var File_core_services_synchronization_telem_telem_head_report_proto protoreflect.FileDescriptor + +var file_core_services_synchronization_telem_telem_head_report_proto_rawDesc = []byte{ + 0x0a, 0x3b, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, + 0x73, 0x79, 0x6e, 0x63, 0x68, 0x72, 0x6f, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, + 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x2f, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x5f, 0x68, 0x65, 0x61, 0x64, + 0x5f, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x05, 0x74, + 0x65, 0x6c, 0x65, 0x6d, 0x22, 0x92, 0x01, 0x0a, 0x11, 0x48, 0x65, 0x61, 0x64, 0x52, 0x65, 0x70, + 0x6f, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x68, + 0x61, 0x69, 0x6e, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x68, 0x61, + 0x69, 0x6e, 0x49, 0x44, 0x12, 0x24, 0x0a, 0x06, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x2e, 0x42, 0x6c, 0x6f, + 0x63, 0x6b, 0x52, 0x06, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x12, 0x2f, 0x0a, 0x09, 0x66, 0x69, + 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, + 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x00, 0x52, 0x09, 0x66, + 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x88, 0x01, 0x01, 0x42, 0x0c, 0x0a, 0x0a, 0x5f, + 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x22, 0x51, 0x0a, 0x05, 0x42, 0x6c, 0x6f, + 0x63, 0x6b, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, + 0x12, 0x16, 0x0a, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x61, 0x73, 0x68, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x68, 0x61, 0x73, 0x68, 0x42, 0x4e, 0x5a, 0x4c, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x6d, 0x61, 0x72, 0x74, + 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x6b, 0x69, 0x74, 0x2f, 0x63, 0x68, 0x61, 0x69, + 0x6e, 0x6c, 0x69, 0x6e, 0x6b, 0x2f, 0x76, 0x32, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, 0x73, 0x79, 0x6e, 0x63, 0x68, 0x72, 0x6f, 0x6e, 0x69, + 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_core_services_synchronization_telem_telem_head_report_proto_rawDescOnce sync.Once + file_core_services_synchronization_telem_telem_head_report_proto_rawDescData = file_core_services_synchronization_telem_telem_head_report_proto_rawDesc +) + +func file_core_services_synchronization_telem_telem_head_report_proto_rawDescGZIP() []byte { + file_core_services_synchronization_telem_telem_head_report_proto_rawDescOnce.Do(func() { + file_core_services_synchronization_telem_telem_head_report_proto_rawDescData = protoimpl.X.CompressGZIP(file_core_services_synchronization_telem_telem_head_report_proto_rawDescData) + }) + return file_core_services_synchronization_telem_telem_head_report_proto_rawDescData +} + +var file_core_services_synchronization_telem_telem_head_report_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_core_services_synchronization_telem_telem_head_report_proto_goTypes = []any{ + (*HeadReportRequest)(nil), // 0: telem.HeadReportRequest + (*Block)(nil), // 1: telem.Block +} +var file_core_services_synchronization_telem_telem_head_report_proto_depIdxs = []int32{ + 1, // 0: telem.HeadReportRequest.latest:type_name -> telem.Block + 1, // 1: telem.HeadReportRequest.finalized:type_name -> telem.Block + 2, // [2:2] is the sub-list for method output_type + 2, // [2:2] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_core_services_synchronization_telem_telem_head_report_proto_init() } +func file_core_services_synchronization_telem_telem_head_report_proto_init() { + if File_core_services_synchronization_telem_telem_head_report_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_core_services_synchronization_telem_telem_head_report_proto_msgTypes[0].Exporter = func(v any, i int) any { + switch v := v.(*HeadReportRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_core_services_synchronization_telem_telem_head_report_proto_msgTypes[1].Exporter = func(v any, i int) any { + switch v := v.(*Block); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_core_services_synchronization_telem_telem_head_report_proto_msgTypes[0].OneofWrappers = []any{} + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_core_services_synchronization_telem_telem_head_report_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_core_services_synchronization_telem_telem_head_report_proto_goTypes, + DependencyIndexes: file_core_services_synchronization_telem_telem_head_report_proto_depIdxs, + MessageInfos: file_core_services_synchronization_telem_telem_head_report_proto_msgTypes, + }.Build() + File_core_services_synchronization_telem_telem_head_report_proto = out.File + file_core_services_synchronization_telem_telem_head_report_proto_rawDesc = nil + file_core_services_synchronization_telem_telem_head_report_proto_goTypes = nil + file_core_services_synchronization_telem_telem_head_report_proto_depIdxs = nil +} diff --git a/core/services/synchronization/telem/telem_head_report.proto b/core/services/synchronization/telem/telem_head_report.proto new file mode 100644 index 00000000000..6f4cf2ddae6 --- /dev/null +++ b/core/services/synchronization/telem/telem_head_report.proto @@ -0,0 +1,17 @@ +syntax = "proto3"; + +option go_package = "github.com/smartcontractkit/chainlink/v2/core/services/synchronization/telem"; + +package telem; + +message HeadReportRequest { + string chainID = 1; + Block latest = 2; + optional Block finalized = 3; +} + +message Block { + uint64 timestamp = 1; + uint64 number = 2; + string hash = 3; +} diff --git a/core/services/synchronization/telem/telem_wsrpc.pb.go b/core/services/synchronization/telem/telem_wsrpc.pb.go index b946bf88cda..e7df2090e4f 100644 --- a/core/services/synchronization/telem/telem_wsrpc.pb.go +++ b/core/services/synchronization/telem/telem_wsrpc.pb.go @@ -1,13 +1,12 @@ // Code generated by protoc-gen-go-wsrpc. DO NOT EDIT. // versions: // - protoc-gen-go-wsrpc v0.0.1 -// - protoc v3.21.12 +// - protoc v5.28.0 package telem import ( context "context" - wsrpc "github.com/smartcontractkit/wsrpc" ) diff --git a/core/services/synchronization/telemetry_ingress_batch_client.go b/core/services/synchronization/telemetry_ingress_batch_client.go index cade98cf606..26ce1e3066a 100644 --- a/core/services/synchronization/telemetry_ingress_batch_client.go +++ b/core/services/synchronization/telemetry_ingress_batch_client.go @@ -12,8 +12,9 @@ import ( "github.com/smartcontractkit/wsrpc" "github.com/smartcontractkit/wsrpc/examples/simple/keys" + "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink-common/pkg/services" - "github.com/smartcontractkit/chainlink/v2/core/logger" + "github.com/smartcontractkit/chainlink-common/pkg/timeutil" "github.com/smartcontractkit/chainlink/v2/core/services/keystore" telemPb "github.com/smartcontractkit/chainlink/v2/core/services/synchronization/telem" ) @@ -37,21 +38,18 @@ func (NoopTelemetryIngressBatchClient) Name() string { return func (NoopTelemetryIngressBatchClient) Ready() error { return nil } type telemetryIngressBatchClient struct { - services.StateMachine + services.Service + eng *services.Engine + url *url.URL ks keystore.CSA serverPubKeyHex string connected atomic.Bool telemClient telemPb.TelemClient - close func() error - - globalLogger logger.Logger - logging bool - lggr logger.Logger + closeFn func() error - wgDone sync.WaitGroup - chDone services.StopChan + logging bool telemBufferSize uint telemMaxBatchSize uint @@ -66,8 +64,8 @@ type telemetryIngressBatchClient struct { // NewTelemetryIngressBatchClient returns a client backed by wsrpc that // can send telemetry to the telemetry ingress server -func NewTelemetryIngressBatchClient(url *url.URL, serverPubKeyHex string, ks keystore.CSA, logging bool, lggr logger.Logger, telemBufferSize uint, telemMaxBatchSize uint, telemSendInterval time.Duration, telemSendTimeout time.Duration, useUniconn bool, network string, chainID string) TelemetryService { - return &telemetryIngressBatchClient{ +func NewTelemetryIngressBatchClient(url *url.URL, serverPubKeyHex string, ks keystore.CSA, logging bool, lggr logger.Logger, telemBufferSize uint, telemMaxBatchSize uint, telemSendInterval time.Duration, telemSendTimeout time.Duration, useUniconn bool) TelemetryService { + c := &telemetryIngressBatchClient{ telemBufferSize: telemBufferSize, telemMaxBatchSize: telemMaxBatchSize, telemSendInterval: telemSendInterval, @@ -75,13 +73,17 @@ func NewTelemetryIngressBatchClient(url *url.URL, serverPubKeyHex string, ks key url: url, ks: ks, serverPubKeyHex: serverPubKeyHex, - globalLogger: lggr, logging: logging, - lggr: lggr.Named("TelemetryIngressBatchClient").Named(network).Named(chainID), - chDone: make(services.StopChan), workers: make(map[string]*telemetryIngressBatchWorker), useUniConn: useUniconn, } + c.Service, c.eng = services.Config{ + Name: "TelemetryIngressBatchClient", + Start: c.start, + Close: c.close, + }.NewServiceEngine(lggr) + + return c } // Start connects the wsrpc client to the telemetry ingress server @@ -90,71 +92,53 @@ func NewTelemetryIngressBatchClient(url *url.URL, serverPubKeyHex string, ks key // an error and wsrpc will continue to retry the connection. Eventually when the ingress // server does come back up, wsrpc will establish the connection without any interaction // on behalf of the node operator. -func (tc *telemetryIngressBatchClient) Start(ctx context.Context) error { - return tc.StartOnce("TelemetryIngressBatchClient", func() error { - clientPrivKey, err := tc.getCSAPrivateKey() - if err != nil { - return err - } +func (tc *telemetryIngressBatchClient) start(ctx context.Context) error { + clientPrivKey, err := tc.getCSAPrivateKey() + if err != nil { + return err + } - serverPubKey := keys.FromHex(tc.serverPubKeyHex) - - // Initialize a new wsrpc client caller - // This is used to call RPC methods on the server - if tc.telemClient == nil { // only preset for tests - if tc.useUniConn { - tc.wgDone.Add(1) - go func() { - defer tc.wgDone.Done() - ctx2, cancel := tc.chDone.NewCtx() - defer cancel() - conn, err := wsrpc.DialUniWithContext(ctx2, tc.lggr, tc.url.String(), clientPrivKey, serverPubKey) - if err != nil { - if ctx2.Err() != nil { - tc.lggr.Warnw("gave up connecting to telemetry endpoint", "err", err) - } else { - tc.lggr.Criticalw("telemetry endpoint dial errored unexpectedly", "err", err, "server pubkey", tc.serverPubKeyHex) - tc.SvcErrBuffer.Append(err) - } - return - } - tc.telemClient = telemPb.NewTelemClient(conn) - tc.close = conn.Close - tc.connected.Store(true) - }() - } else { - // Spawns a goroutine that will eventually connect - conn, err := wsrpc.DialWithContext(ctx, tc.url.String(), wsrpc.WithTransportCreds(clientPrivKey, serverPubKey), wsrpc.WithLogger(tc.lggr)) + serverPubKey := keys.FromHex(tc.serverPubKeyHex) + + // Initialize a new wsrpc client caller + // This is used to call RPC methods on the server + if tc.telemClient == nil { // only preset for tests + if tc.useUniConn { + tc.eng.Go(func(ctx context.Context) { + conn, err := wsrpc.DialUniWithContext(ctx, tc.eng, tc.url.String(), clientPrivKey, serverPubKey) if err != nil { - return fmt.Errorf("could not start TelemIngressBatchClient, Dial returned error: %v", err) + if ctx.Err() != nil { + tc.eng.Warnw("gave up connecting to telemetry endpoint", "err", err) + } else { + tc.eng.Criticalw("telemetry endpoint dial errored unexpectedly", "err", err, "server pubkey", tc.serverPubKeyHex) + tc.eng.EmitHealthErr(err) + } + return } tc.telemClient = telemPb.NewTelemClient(conn) - tc.close = func() error { conn.Close(); return nil } + tc.closeFn = conn.Close + tc.connected.Store(true) + }) + } else { + // Spawns a goroutine that will eventually connect + conn, err := wsrpc.DialWithContext(ctx, tc.url.String(), wsrpc.WithTransportCreds(clientPrivKey, serverPubKey), wsrpc.WithLogger(tc.eng)) + if err != nil { + return fmt.Errorf("could not start TelemIngressBatchClient, Dial returned error: %v", err) } + tc.telemClient = telemPb.NewTelemClient(conn) + tc.closeFn = func() error { conn.Close(); return nil } } + } - return nil - }) + return nil } // Close disconnects the wsrpc client from the ingress server and waits for all workers to exit -func (tc *telemetryIngressBatchClient) Close() error { - return tc.StopOnce("TelemetryIngressBatchClient", func() error { - close(tc.chDone) - tc.wgDone.Wait() - if (tc.useUniConn && tc.connected.Load()) || !tc.useUniConn { - return tc.close() - } - return nil - }) -} - -func (tc *telemetryIngressBatchClient) Name() string { - return tc.lggr.Name() -} - -func (tc *telemetryIngressBatchClient) HealthReport() map[string]error { - return map[string]error{tc.Name(): tc.Healthy()} +func (tc *telemetryIngressBatchClient) close() error { + if (tc.useUniConn && tc.connected.Load()) || !tc.useUniConn { + return tc.closeFn() + } + return nil } // getCSAPrivateKey gets the client's CSA private key @@ -175,7 +159,7 @@ func (tc *telemetryIngressBatchClient) getCSAPrivateKey() (privkey []byte, err e // and a warning is logged. func (tc *telemetryIngressBatchClient) Send(ctx context.Context, telemData []byte, contractID string, telemType TelemetryType) { if tc.useUniConn && !tc.connected.Load() { - tc.lggr.Warnw("not connected to telemetry endpoint", "endpoint", tc.url.String()) + tc.eng.Warnw("not connected to telemetry endpoint", "endpoint", tc.url.String()) return } payload := TelemPayload{ @@ -206,18 +190,17 @@ func (tc *telemetryIngressBatchClient) findOrCreateWorker(payload TelemPayload) if !found { worker = NewTelemetryIngressBatchWorker( tc.telemMaxBatchSize, - tc.telemSendInterval, tc.telemSendTimeout, tc.telemClient, - &tc.wgDone, - tc.chDone, make(chan TelemPayload, tc.telemBufferSize), payload.ContractID, payload.TelemType, - tc.globalLogger, + tc.eng, tc.logging, ) - worker.Start() + tc.eng.GoTick(timeutil.NewTicker(func() time.Duration { + return tc.telemSendInterval + }), worker.Send) tc.workers[workerKey] = worker } diff --git a/core/services/synchronization/telemetry_ingress_batch_worker.go b/core/services/synchronization/telemetry_ingress_batch_worker.go index e7ea6595811..7eca26f02c9 100644 --- a/core/services/synchronization/telemetry_ingress_batch_worker.go +++ b/core/services/synchronization/telemetry_ingress_batch_worker.go @@ -2,13 +2,12 @@ package synchronization import ( "context" - "sync" "sync/atomic" "time" "github.com/smartcontractkit/chainlink-common/pkg/services" - "github.com/smartcontractkit/chainlink/v2/core/logger" + "github.com/smartcontractkit/chainlink-common/pkg/logger" telemPb "github.com/smartcontractkit/chainlink/v2/core/services/synchronization/telem" ) @@ -18,11 +17,8 @@ type telemetryIngressBatchWorker struct { services.Service telemMaxBatchSize uint - telemSendInterval time.Duration telemSendTimeout time.Duration telemClient telemPb.TelemClient - wgDone *sync.WaitGroup - chDone services.StopChan chTelemetry chan TelemPayload contractID string telemType TelemetryType @@ -35,65 +31,45 @@ type telemetryIngressBatchWorker struct { // telemetry to the ingress server via WSRPC func NewTelemetryIngressBatchWorker( telemMaxBatchSize uint, - telemSendInterval time.Duration, telemSendTimeout time.Duration, telemClient telemPb.TelemClient, - wgDone *sync.WaitGroup, - chDone chan struct{}, chTelemetry chan TelemPayload, contractID string, telemType TelemetryType, - globalLogger logger.Logger, + lggr logger.Logger, logging bool, ) *telemetryIngressBatchWorker { return &telemetryIngressBatchWorker{ - telemSendInterval: telemSendInterval, telemSendTimeout: telemSendTimeout, telemMaxBatchSize: telemMaxBatchSize, telemClient: telemClient, - wgDone: wgDone, - chDone: chDone, chTelemetry: chTelemetry, contractID: contractID, telemType: telemType, logging: logging, - lggr: globalLogger.Named("TelemetryIngressBatchWorker"), + lggr: logger.Named(lggr, "TelemetryIngressBatchWorker"), } } -// Start sends batched telemetry to the ingress server on an interval -func (tw *telemetryIngressBatchWorker) Start() { - tw.wgDone.Add(1) - sendTicker := time.NewTicker(tw.telemSendInterval) - - go func() { - defer tw.wgDone.Done() - - for { - select { - case <-sendTicker.C: - if len(tw.chTelemetry) == 0 { - continue - } +// Send sends batched telemetry to the ingress server on an interval +func (tw *telemetryIngressBatchWorker) Send(ctx context.Context) { + if len(tw.chTelemetry) == 0 { + return + } - // Send batched telemetry to the ingress server, log any errors - telemBatchReq := tw.BuildTelemBatchReq() - ctx, cancel := tw.chDone.CtxCancel(context.WithTimeout(context.Background(), tw.telemSendTimeout)) - _, err := tw.telemClient.TelemBatch(ctx, telemBatchReq) - cancel() + // Send batched telemetry to the ingress server, log any errors + telemBatchReq := tw.BuildTelemBatchReq() + ctx, cancel := context.WithTimeout(ctx, tw.telemSendTimeout) + _, err := tw.telemClient.TelemBatch(ctx, telemBatchReq) + cancel() - if err != nil { - tw.lggr.Warnf("Could not send telemetry: %v", err) - continue - } - if tw.logging { - tw.lggr.Debugw("Successfully sent telemetry to ingress server", "contractID", telemBatchReq.ContractId, "telemType", telemBatchReq.TelemetryType, "telemetry", telemBatchReq.Telemetry) - } - case <-tw.chDone: - return - } - } - }() + if err != nil { + tw.lggr.Warnf("Could not send telemetry: %v", err) + return + } + if tw.logging { + tw.lggr.Debugw("Successfully sent telemetry to ingress server", "contractID", telemBatchReq.ContractId, "telemType", telemBatchReq.TelemetryType, "telemetry", telemBatchReq.Telemetry) + } } // logBufferFullWithExpBackoff logs messages at diff --git a/core/services/synchronization/telemetry_ingress_batch_worker_test.go b/core/services/synchronization/telemetry_ingress_batch_worker_test.go index 109022c7135..bf44ee9195a 100644 --- a/core/services/synchronization/telemetry_ingress_batch_worker_test.go +++ b/core/services/synchronization/telemetry_ingress_batch_worker_test.go @@ -1,7 +1,6 @@ package synchronization_test import ( - "sync" "testing" "time" @@ -22,11 +21,8 @@ func TestTelemetryIngressWorker_BuildTelemBatchReq(t *testing.T) { chTelemetry := make(chan synchronization.TelemPayload, 10) worker := synchronization.NewTelemetryIngressBatchWorker( uint(maxTelemBatchSize), - time.Millisecond*1, time.Second, mocks.NewTelemClient(t), - &sync.WaitGroup{}, - make(chan struct{}), chTelemetry, "0xa", synchronization.OCR, diff --git a/core/services/synchronization/telemetry_ingress_client.go b/core/services/synchronization/telemetry_ingress_client.go index dc4ced31d09..1ed55bb5468 100644 --- a/core/services/synchronization/telemetry_ingress_client.go +++ b/core/services/synchronization/telemetry_ingress_client.go @@ -4,15 +4,14 @@ import ( "context" "errors" "net/url" - "sync" "sync/atomic" "time" "github.com/smartcontractkit/wsrpc" "github.com/smartcontractkit/wsrpc/examples/simple/keys" + "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink-common/pkg/services" - "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/keystore" telemPb "github.com/smartcontractkit/chainlink/v2/core/services/synchronization/telem" ) @@ -35,82 +34,59 @@ func (NoopTelemetryIngressClient) Name() string { return "Noop func (NoopTelemetryIngressClient) Ready() error { return nil } type telemetryIngressClient struct { - services.StateMachine + services.Service + eng *services.Engine + url *url.URL ks keystore.CSA serverPubKeyHex string telemClient telemPb.TelemClient logging bool - lggr logger.Logger - wgDone sync.WaitGroup - chDone services.StopChan dropMessageCount atomic.Uint32 chTelemetry chan TelemPayload } // NewTelemetryIngressClient returns a client backed by wsrpc that // can send telemetry to the telemetry ingress server -func NewTelemetryIngressClient(url *url.URL, serverPubKeyHex string, ks keystore.CSA, logging bool, lggr logger.Logger, telemBufferSize uint, network string, chainID string) TelemetryService { - return &telemetryIngressClient{ +func NewTelemetryIngressClient(url *url.URL, serverPubKeyHex string, ks keystore.CSA, logging bool, lggr logger.Logger, telemBufferSize uint) TelemetryService { + c := &telemetryIngressClient{ url: url, ks: ks, serverPubKeyHex: serverPubKeyHex, logging: logging, - lggr: lggr.Named("TelemetryIngressClient").Named(network).Named(chainID), chTelemetry: make(chan TelemPayload, telemBufferSize), - chDone: make(services.StopChan), } + c.Service, c.eng = services.Config{ + Name: "TelemetryIngressClient", + Start: c.start, + }.NewServiceEngine(lggr) + return c } // Start connects the wsrpc client to the telemetry ingress server -func (tc *telemetryIngressClient) Start(context.Context) error { - return tc.StartOnce("TelemetryIngressClient", func() error { - privkey, err := tc.getCSAPrivateKey() - if err != nil { - return err - } - - tc.connect(privkey) - - return nil - }) -} - -// Close disconnects the wsrpc client from the ingress server -func (tc *telemetryIngressClient) Close() error { - return tc.StopOnce("TelemetryIngressClient", func() error { - close(tc.chDone) - tc.wgDone.Wait() - return nil - }) -} +func (tc *telemetryIngressClient) start(context.Context) error { + privkey, err := tc.getCSAPrivateKey() + if err != nil { + return err + } -func (tc *telemetryIngressClient) Name() string { - return tc.lggr.Name() -} + tc.connect(privkey) -func (tc *telemetryIngressClient) HealthReport() map[string]error { - return map[string]error{tc.Name(): tc.Healthy()} + return nil } func (tc *telemetryIngressClient) connect(clientPrivKey []byte) { - tc.wgDone.Add(1) - - go func() { - defer tc.wgDone.Done() - ctx, cancel := tc.chDone.NewCtx() - defer cancel() - + tc.eng.Go(func(ctx context.Context) { serverPubKey := keys.FromHex(tc.serverPubKeyHex) - conn, err := wsrpc.DialWithContext(ctx, tc.url.String(), wsrpc.WithTransportCreds(clientPrivKey, serverPubKey), wsrpc.WithLogger(tc.lggr)) + conn, err := wsrpc.DialWithContext(ctx, tc.url.String(), wsrpc.WithTransportCreds(clientPrivKey, serverPubKey), wsrpc.WithLogger(tc.eng)) if err != nil { if ctx.Err() != nil { - tc.lggr.Warnw("gave up connecting to telemetry endpoint", "err", err) + tc.eng.Warnw("gave up connecting to telemetry endpoint", "err", err) } else { - tc.lggr.Criticalw("telemetry endpoint dial errored unexpectedly", "err", err) - tc.SvcErrBuffer.Append(err) + tc.eng.Criticalw("telemetry endpoint dial errored unexpectedly", "err", err) + tc.eng.EmitHealthErr(err) } return } @@ -126,16 +102,12 @@ func (tc *telemetryIngressClient) connect(clientPrivKey []byte) { tc.handleTelemetry() // Wait for close - <-tc.chDone - }() + <-ctx.Done() + }) } func (tc *telemetryIngressClient) handleTelemetry() { - tc.wgDone.Add(1) - go func() { - defer tc.wgDone.Done() - ctx, cancel := tc.chDone.NewCtx() - defer cancel() + tc.eng.Go(func(ctx context.Context) { for { select { case p := <-tc.chTelemetry: @@ -148,17 +120,17 @@ func (tc *telemetryIngressClient) handleTelemetry() { } _, err := tc.telemClient.Telem(ctx, telemReq) if err != nil { - tc.lggr.Errorf("Could not send telemetry: %v", err) + tc.eng.Errorf("Could not send telemetry: %v", err) continue } if tc.logging { - tc.lggr.Debugw("successfully sent telemetry to ingress server", "contractID", p.ContractID, "telemetry", p.Telemetry) + tc.eng.Debugw("successfully sent telemetry to ingress server", "contractID", p.ContractID, "telemetry", p.Telemetry) } - case <-tc.chDone: + case <-ctx.Done(): return } } - }() + }) } // logBufferFullWithExpBackoff logs messages at @@ -176,7 +148,7 @@ func (tc *telemetryIngressClient) handleTelemetry() { func (tc *telemetryIngressClient) logBufferFullWithExpBackoff(payload TelemPayload) { count := tc.dropMessageCount.Add(1) if count > 0 && (count%100 == 0 || count&(count-1) == 0) { - tc.lggr.Warnw("telemetry ingress client buffer full, dropping message", "telemetry", payload.Telemetry, "droppedCount", count) + tc.eng.Warnw("telemetry ingress client buffer full, dropping message", "telemetry", payload.Telemetry, "droppedCount", count) } } diff --git a/core/services/telemetry/manager.go b/core/services/telemetry/manager.go index a65759a5c62..7b788c4806c 100644 --- a/core/services/telemetry/manager.go +++ b/core/services/telemetry/manager.go @@ -1,29 +1,29 @@ package telemetry import ( - "context" "net/url" "strings" "time" "github.com/pkg/errors" - "go.uber.org/multierr" - "github.com/smartcontractkit/libocr/commontypes" + "github.com/smartcontractkit/chainlink-common/pkg/logger" + common "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink-common/pkg/services" "github.com/smartcontractkit/chainlink/v2/core/config" - "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/keystore" "github.com/smartcontractkit/chainlink/v2/core/services/synchronization" ) type Manager struct { - services.StateMachine - bufferSize uint - endpoints []*telemetryEndpoint - ks keystore.CSA - lggr logger.Logger + services.Service + eng *services.Engine + + bufferSize uint + endpoints []*telemetryEndpoint + ks keystore.CSA + logging bool maxBatchSize uint sendInterval time.Duration @@ -45,9 +45,7 @@ type telemetryEndpoint struct { func NewManager(cfg config.TelemetryIngress, csaKeyStore keystore.CSA, lggr logger.Logger) *Manager { m := &Manager{ bufferSize: cfg.BufferSize(), - endpoints: nil, ks: csaKeyStore, - lggr: lggr.Named("TelemetryManager"), logging: cfg.Logging(), maxBatchSize: cfg.MaxBatchSize(), sendInterval: cfg.SendInterval(), @@ -55,44 +53,21 @@ func NewManager(cfg config.TelemetryIngress, csaKeyStore keystore.CSA, lggr logg uniConn: cfg.UniConn(), useBatchSend: cfg.UseBatchSend(), } - for _, e := range cfg.Endpoints() { - if err := m.addEndpoint(e); err != nil { - m.lggr.Error(err) - } - } - return m -} - -func (m *Manager) Start(ctx context.Context) error { - return m.StartOnce("TelemetryManager", func() error { - var err error - for _, e := range m.endpoints { - err = multierr.Append(err, e.client.Start(ctx)) - } - return err - }) -} -func (m *Manager) Close() error { - return m.StopOnce("TelemetryManager", func() error { - var err error - for _, e := range m.endpoints { - err = multierr.Append(err, e.client.Close()) - } - return err - }) -} - -func (m *Manager) Name() string { - return m.lggr.Name() -} + m.Service, m.eng = services.Config{ + Name: "TelemetryManager", + NewSubServices: func(lggr common.Logger) (subs []services.Service) { + for _, e := range cfg.Endpoints() { + if sub, err := m.newEndpoint(e, lggr, cfg); err != nil { + lggr.Error(err) + } else { + subs = append(subs, sub) + } + } + return + }, + }.NewServiceEngine(lggr) -func (m *Manager) HealthReport() map[string]error { - hr := map[string]error{m.Name(): m.Healthy()} - - for _, e := range m.endpoints { - services.CopyHealth(hr, e.client.HealthReport()) - } - return hr + return m } // GenMonitoringEndpoint creates a new monitoring endpoints based on the existing available endpoints defined in the core config TOML, if no endpoint for the network and chainID exists, a NOOP agent will be used and the telemetry will not be sent @@ -100,7 +75,7 @@ func (m *Manager) GenMonitoringEndpoint(network string, chainID string, contract e, found := m.getEndpoint(network, chainID) if !found { - m.lggr.Warnf("no telemetry endpoint found for network %q chainID %q, telemetry %q for contactID %q will NOT be sent", network, chainID, telemType, contractID) + m.eng.Warnf("no telemetry endpoint found for network %q chainID %q, telemetry %q for contractID %q will NOT be sent", network, chainID, telemType, contractID) return &NoopAgent{} } @@ -111,32 +86,33 @@ func (m *Manager) GenMonitoringEndpoint(network string, chainID string, contract return NewIngressAgent(e.client, network, chainID, contractID, telemType) } -func (m *Manager) addEndpoint(e config.TelemetryIngressEndpoint) error { +func (m *Manager) newEndpoint(e config.TelemetryIngressEndpoint, lggr logger.Logger, cfg config.TelemetryIngress) (services.Service, error) { if e.Network() == "" { - return errors.New("cannot add telemetry endpoint, network cannot be empty") + return nil, errors.New("cannot add telemetry endpoint, network cannot be empty") } if e.ChainID() == "" { - return errors.New("cannot add telemetry endpoint, chainID cannot be empty") + return nil, errors.New("cannot add telemetry endpoint, chainID cannot be empty") } if e.URL() == nil { - return errors.New("cannot add telemetry endpoint, URL cannot be empty") + return nil, errors.New("cannot add telemetry endpoint, URL cannot be empty") } if e.ServerPubKey() == "" { - return errors.New("cannot add telemetry endpoint, ServerPubKey cannot be empty") + return nil, errors.New("cannot add telemetry endpoint, ServerPubKey cannot be empty") } if _, found := m.getEndpoint(e.Network(), e.ChainID()); found { - return errors.Errorf("cannot add telemetry endpoint for network %q and chainID %q, endpoint already exists", e.Network(), e.ChainID()) + return nil, errors.Errorf("cannot add telemetry endpoint for network %q and chainID %q, endpoint already exists", e.Network(), e.ChainID()) } + lggr = logger.Sugared(lggr).Named(e.Network()).Named(e.ChainID()) var tClient synchronization.TelemetryService if m.useBatchSend { - tClient = synchronization.NewTelemetryIngressBatchClient(e.URL(), e.ServerPubKey(), m.ks, m.logging, m.lggr, m.bufferSize, m.maxBatchSize, m.sendInterval, m.sendTimeout, m.uniConn, e.Network(), e.ChainID()) + tClient = synchronization.NewTelemetryIngressBatchClient(e.URL(), e.ServerPubKey(), m.ks, cfg.Logging(), lggr, cfg.BufferSize(), cfg.MaxBatchSize(), cfg.SendInterval(), cfg.SendTimeout(), cfg.UniConn()) } else { - tClient = synchronization.NewTelemetryIngressClient(e.URL(), e.ServerPubKey(), m.ks, m.logging, m.lggr, m.bufferSize, e.Network(), e.ChainID()) + tClient = synchronization.NewTelemetryIngressClient(e.URL(), e.ServerPubKey(), m.ks, cfg.Logging(), lggr, cfg.BufferSize()) } te := telemetryEndpoint{ @@ -148,7 +124,7 @@ func (m *Manager) addEndpoint(e config.TelemetryIngressEndpoint) error { } m.endpoints = append(m.endpoints, &te) - return nil + return te.client, nil } func (m *Manager) getEndpoint(network string, chainID string) (*telemetryEndpoint, bool) { diff --git a/core/services/telemetry/manager_test.go b/core/services/telemetry/manager_test.go index 4e55cb75752..fef065b572c 100644 --- a/core/services/telemetry/manager_test.go +++ b/core/services/telemetry/manager_test.go @@ -156,7 +156,7 @@ func TestNewManager(t *testing.T) { require.Equal(t, uint(123), m.bufferSize) require.Equal(t, ks, m.ks) - require.Equal(t, "TelemetryManager", m.lggr.Name()) + require.Equal(t, "TelemetryManager", m.Name()) require.Equal(t, true, m.logging) require.Equal(t, uint(51), m.maxBatchSize) require.Equal(t, time.Millisecond*512, m.sendInterval) diff --git a/core/services/telemetry/monitoring_endpoint_generator_mock.go b/core/services/telemetry/monitoring_endpoint_generator_mock.go new file mode 100644 index 00000000000..a0fc503ecca --- /dev/null +++ b/core/services/telemetry/monitoring_endpoint_generator_mock.go @@ -0,0 +1,88 @@ +// Code generated by mockery v2.43.2. DO NOT EDIT. + +package telemetry + +import ( + commontypes "github.com/smartcontractkit/libocr/commontypes" + mock "github.com/stretchr/testify/mock" + + synchronization "github.com/smartcontractkit/chainlink/v2/core/services/synchronization" +) + +// MockMonitoringEndpointGenerator is an autogenerated mock type for the MonitoringEndpointGenerator type +type MockMonitoringEndpointGenerator struct { + mock.Mock +} + +type MockMonitoringEndpointGenerator_Expecter struct { + mock *mock.Mock +} + +func (_m *MockMonitoringEndpointGenerator) EXPECT() *MockMonitoringEndpointGenerator_Expecter { + return &MockMonitoringEndpointGenerator_Expecter{mock: &_m.Mock} +} + +// GenMonitoringEndpoint provides a mock function with given fields: network, chainID, contractID, telemType +func (_m *MockMonitoringEndpointGenerator) GenMonitoringEndpoint(network string, chainID string, contractID string, telemType synchronization.TelemetryType) commontypes.MonitoringEndpoint { + ret := _m.Called(network, chainID, contractID, telemType) + + if len(ret) == 0 { + panic("no return value specified for GenMonitoringEndpoint") + } + + var r0 commontypes.MonitoringEndpoint + if rf, ok := ret.Get(0).(func(string, string, string, synchronization.TelemetryType) commontypes.MonitoringEndpoint); ok { + r0 = rf(network, chainID, contractID, telemType) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(commontypes.MonitoringEndpoint) + } + } + + return r0 +} + +// MockMonitoringEndpointGenerator_GenMonitoringEndpoint_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GenMonitoringEndpoint' +type MockMonitoringEndpointGenerator_GenMonitoringEndpoint_Call struct { + *mock.Call +} + +// GenMonitoringEndpoint is a helper method to define mock.On call +// - network string +// - chainID string +// - contractID string +// - telemType synchronization.TelemetryType +func (_e *MockMonitoringEndpointGenerator_Expecter) GenMonitoringEndpoint(network interface{}, chainID interface{}, contractID interface{}, telemType interface{}) *MockMonitoringEndpointGenerator_GenMonitoringEndpoint_Call { + return &MockMonitoringEndpointGenerator_GenMonitoringEndpoint_Call{Call: _e.mock.On("GenMonitoringEndpoint", network, chainID, contractID, telemType)} +} + +func (_c *MockMonitoringEndpointGenerator_GenMonitoringEndpoint_Call) Run(run func(network string, chainID string, contractID string, telemType synchronization.TelemetryType)) *MockMonitoringEndpointGenerator_GenMonitoringEndpoint_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(string), args[2].(string), args[3].(synchronization.TelemetryType)) + }) + return _c +} + +func (_c *MockMonitoringEndpointGenerator_GenMonitoringEndpoint_Call) Return(_a0 commontypes.MonitoringEndpoint) *MockMonitoringEndpointGenerator_GenMonitoringEndpoint_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockMonitoringEndpointGenerator_GenMonitoringEndpoint_Call) RunAndReturn(run func(string, string, string, synchronization.TelemetryType) commontypes.MonitoringEndpoint) *MockMonitoringEndpointGenerator_GenMonitoringEndpoint_Call { + _c.Call.Return(run) + return _c +} + +// NewMockMonitoringEndpointGenerator creates a new instance of MockMonitoringEndpointGenerator. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewMockMonitoringEndpointGenerator(t interface { + mock.TestingT + Cleanup(func()) +}) *MockMonitoringEndpointGenerator { + mock := &MockMonitoringEndpointGenerator{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/core/services/versioning/orm_test.go b/core/services/versioning/orm_test.go index 3504c2bc772..44c63f60d04 100644 --- a/core/services/versioning/orm_test.go +++ b/core/services/versioning/orm_test.go @@ -97,6 +97,86 @@ func Test_Version_CheckVersion(t *testing.T) { assert.Equal(t, "9.9.8", dbv.String()) } +func TestORM_CheckVersion_CCIP(t *testing.T) { + ctx := testutils.Context(t) + db := pgtest.NewSqlxDB(t) + + lggr := logger.TestLogger(t) + + orm := NewORM(db, lggr) + + tests := []struct { + name string + currentVersion string + newVersion string + expectedError bool + }{ + { + name: "ccip patch version bump from 0 -> 2", + currentVersion: "2.5.0-ccip1.4.0", + newVersion: "2.5.0-ccip1.4.2", + expectedError: false, + }, + { + name: "ccip patch downgrade errors", + currentVersion: "2.5.0-ccip1.4.2", + newVersion: "2.5.0-ccip1.4.1", + expectedError: true, + }, + { + name: "ccip patch version bump from 2 -> 10", + currentVersion: "2.5.0-ccip1.4.2", + newVersion: "2.5.0-ccip1.4.10", + expectedError: false, + }, + { + name: "ccip patch version bump from 9 -> 101", + currentVersion: "2.5.0-ccip1.4.9", + newVersion: "2.5.0-ccip1.4.101", + expectedError: false, + }, + { + name: "upgrading only core version", + currentVersion: "2.5.0-ccip1.4.10", + newVersion: "2.6.0-ccip1.4.10", + expectedError: false, + }, + { + name: "downgrading only core version errors", + currentVersion: "2.6.0-ccip1.4.10", + newVersion: "2.5.0-ccip1.4.10", + expectedError: true, + }, + { + name: "upgrading both core and ccip version", + currentVersion: "2.5.0-ccip1.4.10", + newVersion: "2.6.0-ccip1.4.11", + expectedError: false, + }, + { + name: "upgrading both core and ccip version but minor version", + currentVersion: "2.5.0-ccip1.4.10", + newVersion: "2.6.0-ccip1.5.0", + expectedError: false, + }, + } + + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + _, err := db.ExecContext(ctx, `TRUNCATE node_versions;`) + require.NoError(t, err) + + require.NoError(t, orm.UpsertNodeVersion(ctx, NewNodeVersion(test.currentVersion))) + _, _, err = CheckVersion(ctx, db, lggr, test.newVersion) + if test.expectedError { + require.Error(t, err) + } else { + require.NoError(t, err) + } + }) + } +} + func TestORM_NodeVersion_FindLatestNodeVersion(t *testing.T) { ctx := testutils.Context(t) db := pgtest.NewSqlxDB(t) diff --git a/core/services/vrf/delegate_test.go b/core/services/vrf/delegate_test.go index 889b19d0e04..9718dc376a7 100644 --- a/core/services/vrf/delegate_test.go +++ b/core/services/vrf/delegate_test.go @@ -83,7 +83,7 @@ func buildVrfUni(t *testing.T, db *sqlx.DB, cfg chainlink.GeneralConfig) vrfUniv btORM := bridges.NewORM(db) ks := keystore.NewInMemory(db, utils.FastScryptParams, lggr) _, dbConfig, evmConfig := txmgr.MakeTestConfigs(t) - txm, err := txmgr.NewTxm(db, evmConfig, evmConfig.GasEstimator(), evmConfig.Transactions(), nil, dbConfig, dbConfig.Listener(), ec, logger.TestLogger(t), nil, ks.Eth(), nil) + txm, err := txmgr.NewTxm(db, evmConfig, evmConfig.GasEstimator(), evmConfig.Transactions(), nil, dbConfig, dbConfig.Listener(), ec, logger.TestLogger(t), nil, ks.Eth(), nil, nil) orm := headtracker.NewORM(*testutils.FixtureChainID, db) require.NoError(t, orm.IdempotentInsertHead(testutils.Context(t), cltest.Head(51))) jrm := job.NewORM(db, prm, btORM, ks, lggr) diff --git a/core/services/vrf/extraargs/types.go b/core/services/vrf/extraargs/types.go index eecd0bfa334..540de0f015a 100644 --- a/core/services/vrf/extraargs/types.go +++ b/core/services/vrf/extraargs/types.go @@ -13,7 +13,7 @@ const boolAbiType = `[{ "type": "bool" }]` var extraArgsV1Tag = crypto.Keccak256([]byte("VRF ExtraArgsV1"))[:4] -func FromExtraArgsV1(extraArgs []byte) (nativePayment bool, err error) { +func DecodeV1(extraArgs []byte) (nativePayment bool, err error) { decodedBool, err := utils.ABIDecode(boolAbiType, extraArgs[functionSignatureLength:]) if err != nil { return false, fmt.Errorf("failed to decode 0x%x to bool", extraArgs[functionSignatureLength:]) @@ -25,7 +25,7 @@ func FromExtraArgsV1(extraArgs []byte) (nativePayment bool, err error) { return nativePayment, nil } -func ExtraArgsV1(nativePayment bool) ([]byte, error) { +func EncodeV1(nativePayment bool) ([]byte, error) { encodedArgs, err := utils.ABIEncode(boolAbiType, nativePayment) if err != nil { return nil, err diff --git a/core/services/vrf/mocks/aggregator_v3_interface.go b/core/services/vrf/mocks/aggregator_v3_interface.go index 65bf4f11268..adb7600ffe1 100644 --- a/core/services/vrf/mocks/aggregator_v3_interface.go +++ b/core/services/vrf/mocks/aggregator_v3_interface.go @@ -14,13 +14,21 @@ import ( mock "github.com/stretchr/testify/mock" ) -// AggregatorV3Interface is an autogenerated mock type for the AggregatorV3InterfaceInterface type -type AggregatorV3Interface struct { +// AggregatorV3InterfaceInterface is an autogenerated mock type for the AggregatorV3InterfaceInterface type +type AggregatorV3InterfaceInterface struct { mock.Mock } +type AggregatorV3InterfaceInterface_Expecter struct { + mock *mock.Mock +} + +func (_m *AggregatorV3InterfaceInterface) EXPECT() *AggregatorV3InterfaceInterface_Expecter { + return &AggregatorV3InterfaceInterface_Expecter{mock: &_m.Mock} +} + // Address provides a mock function with given fields: -func (_m *AggregatorV3Interface) Address() common.Address { +func (_m *AggregatorV3InterfaceInterface) Address() common.Address { ret := _m.Called() if len(ret) == 0 { @@ -39,8 +47,35 @@ func (_m *AggregatorV3Interface) Address() common.Address { return r0 } +// AggregatorV3InterfaceInterface_Address_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Address' +type AggregatorV3InterfaceInterface_Address_Call struct { + *mock.Call +} + +// Address is a helper method to define mock.On call +func (_e *AggregatorV3InterfaceInterface_Expecter) Address() *AggregatorV3InterfaceInterface_Address_Call { + return &AggregatorV3InterfaceInterface_Address_Call{Call: _e.mock.On("Address")} +} + +func (_c *AggregatorV3InterfaceInterface_Address_Call) Run(run func()) *AggregatorV3InterfaceInterface_Address_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *AggregatorV3InterfaceInterface_Address_Call) Return(_a0 common.Address) *AggregatorV3InterfaceInterface_Address_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *AggregatorV3InterfaceInterface_Address_Call) RunAndReturn(run func() common.Address) *AggregatorV3InterfaceInterface_Address_Call { + _c.Call.Return(run) + return _c +} + // Decimals provides a mock function with given fields: opts -func (_m *AggregatorV3Interface) Decimals(opts *bind.CallOpts) (uint8, error) { +func (_m *AggregatorV3InterfaceInterface) Decimals(opts *bind.CallOpts) (uint8, error) { ret := _m.Called(opts) if len(ret) == 0 { @@ -67,8 +102,36 @@ func (_m *AggregatorV3Interface) Decimals(opts *bind.CallOpts) (uint8, error) { return r0, r1 } +// AggregatorV3InterfaceInterface_Decimals_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Decimals' +type AggregatorV3InterfaceInterface_Decimals_Call struct { + *mock.Call +} + +// Decimals is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *AggregatorV3InterfaceInterface_Expecter) Decimals(opts interface{}) *AggregatorV3InterfaceInterface_Decimals_Call { + return &AggregatorV3InterfaceInterface_Decimals_Call{Call: _e.mock.On("Decimals", opts)} +} + +func (_c *AggregatorV3InterfaceInterface_Decimals_Call) Run(run func(opts *bind.CallOpts)) *AggregatorV3InterfaceInterface_Decimals_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *AggregatorV3InterfaceInterface_Decimals_Call) Return(_a0 uint8, _a1 error) *AggregatorV3InterfaceInterface_Decimals_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *AggregatorV3InterfaceInterface_Decimals_Call) RunAndReturn(run func(*bind.CallOpts) (uint8, error)) *AggregatorV3InterfaceInterface_Decimals_Call { + _c.Call.Return(run) + return _c +} + // Description provides a mock function with given fields: opts -func (_m *AggregatorV3Interface) Description(opts *bind.CallOpts) (string, error) { +func (_m *AggregatorV3InterfaceInterface) Description(opts *bind.CallOpts) (string, error) { ret := _m.Called(opts) if len(ret) == 0 { @@ -95,8 +158,36 @@ func (_m *AggregatorV3Interface) Description(opts *bind.CallOpts) (string, error return r0, r1 } +// AggregatorV3InterfaceInterface_Description_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Description' +type AggregatorV3InterfaceInterface_Description_Call struct { + *mock.Call +} + +// Description is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *AggregatorV3InterfaceInterface_Expecter) Description(opts interface{}) *AggregatorV3InterfaceInterface_Description_Call { + return &AggregatorV3InterfaceInterface_Description_Call{Call: _e.mock.On("Description", opts)} +} + +func (_c *AggregatorV3InterfaceInterface_Description_Call) Run(run func(opts *bind.CallOpts)) *AggregatorV3InterfaceInterface_Description_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *AggregatorV3InterfaceInterface_Description_Call) Return(_a0 string, _a1 error) *AggregatorV3InterfaceInterface_Description_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *AggregatorV3InterfaceInterface_Description_Call) RunAndReturn(run func(*bind.CallOpts) (string, error)) *AggregatorV3InterfaceInterface_Description_Call { + _c.Call.Return(run) + return _c +} + // GetRoundData provides a mock function with given fields: opts, _roundId -func (_m *AggregatorV3Interface) GetRoundData(opts *bind.CallOpts, _roundId *big.Int) (aggregator_v3_interface.GetRoundData, error) { +func (_m *AggregatorV3InterfaceInterface) GetRoundData(opts *bind.CallOpts, _roundId *big.Int) (aggregator_v3_interface.GetRoundData, error) { ret := _m.Called(opts, _roundId) if len(ret) == 0 { @@ -123,8 +214,37 @@ func (_m *AggregatorV3Interface) GetRoundData(opts *bind.CallOpts, _roundId *big return r0, r1 } +// AggregatorV3InterfaceInterface_GetRoundData_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetRoundData' +type AggregatorV3InterfaceInterface_GetRoundData_Call struct { + *mock.Call +} + +// GetRoundData is a helper method to define mock.On call +// - opts *bind.CallOpts +// - _roundId *big.Int +func (_e *AggregatorV3InterfaceInterface_Expecter) GetRoundData(opts interface{}, _roundId interface{}) *AggregatorV3InterfaceInterface_GetRoundData_Call { + return &AggregatorV3InterfaceInterface_GetRoundData_Call{Call: _e.mock.On("GetRoundData", opts, _roundId)} +} + +func (_c *AggregatorV3InterfaceInterface_GetRoundData_Call) Run(run func(opts *bind.CallOpts, _roundId *big.Int)) *AggregatorV3InterfaceInterface_GetRoundData_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts), args[1].(*big.Int)) + }) + return _c +} + +func (_c *AggregatorV3InterfaceInterface_GetRoundData_Call) Return(_a0 aggregator_v3_interface.GetRoundData, _a1 error) *AggregatorV3InterfaceInterface_GetRoundData_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *AggregatorV3InterfaceInterface_GetRoundData_Call) RunAndReturn(run func(*bind.CallOpts, *big.Int) (aggregator_v3_interface.GetRoundData, error)) *AggregatorV3InterfaceInterface_GetRoundData_Call { + _c.Call.Return(run) + return _c +} + // LatestRoundData provides a mock function with given fields: opts -func (_m *AggregatorV3Interface) LatestRoundData(opts *bind.CallOpts) (aggregator_v3_interface.LatestRoundData, error) { +func (_m *AggregatorV3InterfaceInterface) LatestRoundData(opts *bind.CallOpts) (aggregator_v3_interface.LatestRoundData, error) { ret := _m.Called(opts) if len(ret) == 0 { @@ -151,8 +271,36 @@ func (_m *AggregatorV3Interface) LatestRoundData(opts *bind.CallOpts) (aggregato return r0, r1 } +// AggregatorV3InterfaceInterface_LatestRoundData_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LatestRoundData' +type AggregatorV3InterfaceInterface_LatestRoundData_Call struct { + *mock.Call +} + +// LatestRoundData is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *AggregatorV3InterfaceInterface_Expecter) LatestRoundData(opts interface{}) *AggregatorV3InterfaceInterface_LatestRoundData_Call { + return &AggregatorV3InterfaceInterface_LatestRoundData_Call{Call: _e.mock.On("LatestRoundData", opts)} +} + +func (_c *AggregatorV3InterfaceInterface_LatestRoundData_Call) Run(run func(opts *bind.CallOpts)) *AggregatorV3InterfaceInterface_LatestRoundData_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *AggregatorV3InterfaceInterface_LatestRoundData_Call) Return(_a0 aggregator_v3_interface.LatestRoundData, _a1 error) *AggregatorV3InterfaceInterface_LatestRoundData_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *AggregatorV3InterfaceInterface_LatestRoundData_Call) RunAndReturn(run func(*bind.CallOpts) (aggregator_v3_interface.LatestRoundData, error)) *AggregatorV3InterfaceInterface_LatestRoundData_Call { + _c.Call.Return(run) + return _c +} + // Version provides a mock function with given fields: opts -func (_m *AggregatorV3Interface) Version(opts *bind.CallOpts) (*big.Int, error) { +func (_m *AggregatorV3InterfaceInterface) Version(opts *bind.CallOpts) (*big.Int, error) { ret := _m.Called(opts) if len(ret) == 0 { @@ -181,13 +329,41 @@ func (_m *AggregatorV3Interface) Version(opts *bind.CallOpts) (*big.Int, error) return r0, r1 } -// NewAggregatorV3Interface creates a new instance of AggregatorV3Interface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// AggregatorV3InterfaceInterface_Version_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Version' +type AggregatorV3InterfaceInterface_Version_Call struct { + *mock.Call +} + +// Version is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *AggregatorV3InterfaceInterface_Expecter) Version(opts interface{}) *AggregatorV3InterfaceInterface_Version_Call { + return &AggregatorV3InterfaceInterface_Version_Call{Call: _e.mock.On("Version", opts)} +} + +func (_c *AggregatorV3InterfaceInterface_Version_Call) Run(run func(opts *bind.CallOpts)) *AggregatorV3InterfaceInterface_Version_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *AggregatorV3InterfaceInterface_Version_Call) Return(_a0 *big.Int, _a1 error) *AggregatorV3InterfaceInterface_Version_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *AggregatorV3InterfaceInterface_Version_Call) RunAndReturn(run func(*bind.CallOpts) (*big.Int, error)) *AggregatorV3InterfaceInterface_Version_Call { + _c.Call.Return(run) + return _c +} + +// NewAggregatorV3InterfaceInterface creates a new instance of AggregatorV3InterfaceInterface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. -func NewAggregatorV3Interface(t interface { +func NewAggregatorV3InterfaceInterface(t interface { mock.TestingT Cleanup(func()) -}) *AggregatorV3Interface { - mock := &AggregatorV3Interface{} +}) *AggregatorV3InterfaceInterface { + mock := &AggregatorV3InterfaceInterface{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) diff --git a/core/services/vrf/mocks/config.go b/core/services/vrf/mocks/config.go index 75cbd82d782..1cc315f5afb 100644 --- a/core/services/vrf/mocks/config.go +++ b/core/services/vrf/mocks/config.go @@ -9,6 +9,14 @@ type Config struct { mock.Mock } +type Config_Expecter struct { + mock *mock.Mock +} + +func (_m *Config) EXPECT() *Config_Expecter { + return &Config_Expecter{mock: &_m.Mock} +} + // FinalityDepth provides a mock function with given fields: func (_m *Config) FinalityDepth() uint32 { ret := _m.Called() @@ -27,6 +35,33 @@ func (_m *Config) FinalityDepth() uint32 { return r0 } +// Config_FinalityDepth_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FinalityDepth' +type Config_FinalityDepth_Call struct { + *mock.Call +} + +// FinalityDepth is a helper method to define mock.On call +func (_e *Config_Expecter) FinalityDepth() *Config_FinalityDepth_Call { + return &Config_FinalityDepth_Call{Call: _e.mock.On("FinalityDepth")} +} + +func (_c *Config_FinalityDepth_Call) Run(run func()) *Config_FinalityDepth_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Config_FinalityDepth_Call) Return(_a0 uint32) *Config_FinalityDepth_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Config_FinalityDepth_Call) RunAndReturn(run func() uint32) *Config_FinalityDepth_Call { + _c.Call.Return(run) + return _c +} + // MinIncomingConfirmations provides a mock function with given fields: func (_m *Config) MinIncomingConfirmations() uint32 { ret := _m.Called() @@ -45,6 +80,33 @@ func (_m *Config) MinIncomingConfirmations() uint32 { return r0 } +// Config_MinIncomingConfirmations_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MinIncomingConfirmations' +type Config_MinIncomingConfirmations_Call struct { + *mock.Call +} + +// MinIncomingConfirmations is a helper method to define mock.On call +func (_e *Config_Expecter) MinIncomingConfirmations() *Config_MinIncomingConfirmations_Call { + return &Config_MinIncomingConfirmations_Call{Call: _e.mock.On("MinIncomingConfirmations")} +} + +func (_c *Config_MinIncomingConfirmations_Call) Run(run func()) *Config_MinIncomingConfirmations_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Config_MinIncomingConfirmations_Call) Return(_a0 uint32) *Config_MinIncomingConfirmations_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Config_MinIncomingConfirmations_Call) RunAndReturn(run func() uint32) *Config_MinIncomingConfirmations_Call { + _c.Call.Return(run) + return _c +} + // NewConfig creates a new instance of Config. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewConfig(t interface { diff --git a/core/services/vrf/mocks/fee_config.go b/core/services/vrf/mocks/fee_config.go index df9d5ce1aea..8633969e0a6 100644 --- a/core/services/vrf/mocks/fee_config.go +++ b/core/services/vrf/mocks/fee_config.go @@ -16,6 +16,14 @@ type FeeConfig struct { mock.Mock } +type FeeConfig_Expecter struct { + mock *mock.Mock +} + +func (_m *FeeConfig) EXPECT() *FeeConfig_Expecter { + return &FeeConfig_Expecter{mock: &_m.Mock} +} + // LimitDefault provides a mock function with given fields: func (_m *FeeConfig) LimitDefault() uint64 { ret := _m.Called() @@ -34,6 +42,33 @@ func (_m *FeeConfig) LimitDefault() uint64 { return r0 } +// FeeConfig_LimitDefault_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LimitDefault' +type FeeConfig_LimitDefault_Call struct { + *mock.Call +} + +// LimitDefault is a helper method to define mock.On call +func (_e *FeeConfig_Expecter) LimitDefault() *FeeConfig_LimitDefault_Call { + return &FeeConfig_LimitDefault_Call{Call: _e.mock.On("LimitDefault")} +} + +func (_c *FeeConfig_LimitDefault_Call) Run(run func()) *FeeConfig_LimitDefault_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *FeeConfig_LimitDefault_Call) Return(_a0 uint64) *FeeConfig_LimitDefault_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *FeeConfig_LimitDefault_Call) RunAndReturn(run func() uint64) *FeeConfig_LimitDefault_Call { + _c.Call.Return(run) + return _c +} + // LimitJobType provides a mock function with given fields: func (_m *FeeConfig) LimitJobType() config.LimitJobType { ret := _m.Called() @@ -54,6 +89,33 @@ func (_m *FeeConfig) LimitJobType() config.LimitJobType { return r0 } +// FeeConfig_LimitJobType_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LimitJobType' +type FeeConfig_LimitJobType_Call struct { + *mock.Call +} + +// LimitJobType is a helper method to define mock.On call +func (_e *FeeConfig_Expecter) LimitJobType() *FeeConfig_LimitJobType_Call { + return &FeeConfig_LimitJobType_Call{Call: _e.mock.On("LimitJobType")} +} + +func (_c *FeeConfig_LimitJobType_Call) Run(run func()) *FeeConfig_LimitJobType_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *FeeConfig_LimitJobType_Call) Return(_a0 config.LimitJobType) *FeeConfig_LimitJobType_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *FeeConfig_LimitJobType_Call) RunAndReturn(run func() config.LimitJobType) *FeeConfig_LimitJobType_Call { + _c.Call.Return(run) + return _c +} + // PriceMaxKey provides a mock function with given fields: addr func (_m *FeeConfig) PriceMaxKey(addr common.Address) *assets.Wei { ret := _m.Called(addr) @@ -74,6 +136,34 @@ func (_m *FeeConfig) PriceMaxKey(addr common.Address) *assets.Wei { return r0 } +// FeeConfig_PriceMaxKey_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PriceMaxKey' +type FeeConfig_PriceMaxKey_Call struct { + *mock.Call +} + +// PriceMaxKey is a helper method to define mock.On call +// - addr common.Address +func (_e *FeeConfig_Expecter) PriceMaxKey(addr interface{}) *FeeConfig_PriceMaxKey_Call { + return &FeeConfig_PriceMaxKey_Call{Call: _e.mock.On("PriceMaxKey", addr)} +} + +func (_c *FeeConfig_PriceMaxKey_Call) Run(run func(addr common.Address)) *FeeConfig_PriceMaxKey_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(common.Address)) + }) + return _c +} + +func (_c *FeeConfig_PriceMaxKey_Call) Return(_a0 *assets.Wei) *FeeConfig_PriceMaxKey_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *FeeConfig_PriceMaxKey_Call) RunAndReturn(run func(common.Address) *assets.Wei) *FeeConfig_PriceMaxKey_Call { + _c.Call.Return(run) + return _c +} + // NewFeeConfig creates a new instance of FeeConfig. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewFeeConfig(t interface { diff --git a/core/services/vrf/mocks/vrf_coordinator_v2.go b/core/services/vrf/mocks/vrf_coordinator_v2.go index 79b389af234..5901efb4a69 100644 --- a/core/services/vrf/mocks/vrf_coordinator_v2.go +++ b/core/services/vrf/mocks/vrf_coordinator_v2.go @@ -24,6 +24,14 @@ type VRFCoordinatorV2Interface struct { mock.Mock } +type VRFCoordinatorV2Interface_Expecter struct { + mock *mock.Mock +} + +func (_m *VRFCoordinatorV2Interface) EXPECT() *VRFCoordinatorV2Interface_Expecter { + return &VRFCoordinatorV2Interface_Expecter{mock: &_m.Mock} +} + // AcceptOwnership provides a mock function with given fields: opts func (_m *VRFCoordinatorV2Interface) AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { ret := _m.Called(opts) @@ -54,6 +62,34 @@ func (_m *VRFCoordinatorV2Interface) AcceptOwnership(opts *bind.TransactOpts) (* return r0, r1 } +// VRFCoordinatorV2Interface_AcceptOwnership_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AcceptOwnership' +type VRFCoordinatorV2Interface_AcceptOwnership_Call struct { + *mock.Call +} + +// AcceptOwnership is a helper method to define mock.On call +// - opts *bind.TransactOpts +func (_e *VRFCoordinatorV2Interface_Expecter) AcceptOwnership(opts interface{}) *VRFCoordinatorV2Interface_AcceptOwnership_Call { + return &VRFCoordinatorV2Interface_AcceptOwnership_Call{Call: _e.mock.On("AcceptOwnership", opts)} +} + +func (_c *VRFCoordinatorV2Interface_AcceptOwnership_Call) Run(run func(opts *bind.TransactOpts)) *VRFCoordinatorV2Interface_AcceptOwnership_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts)) + }) + return _c +} + +func (_c *VRFCoordinatorV2Interface_AcceptOwnership_Call) Return(_a0 *types.Transaction, _a1 error) *VRFCoordinatorV2Interface_AcceptOwnership_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *VRFCoordinatorV2Interface_AcceptOwnership_Call) RunAndReturn(run func(*bind.TransactOpts) (*types.Transaction, error)) *VRFCoordinatorV2Interface_AcceptOwnership_Call { + _c.Call.Return(run) + return _c +} + // AcceptSubscriptionOwnerTransfer provides a mock function with given fields: opts, subId func (_m *VRFCoordinatorV2Interface) AcceptSubscriptionOwnerTransfer(opts *bind.TransactOpts, subId uint64) (*types.Transaction, error) { ret := _m.Called(opts, subId) @@ -84,6 +120,35 @@ func (_m *VRFCoordinatorV2Interface) AcceptSubscriptionOwnerTransfer(opts *bind. return r0, r1 } +// VRFCoordinatorV2Interface_AcceptSubscriptionOwnerTransfer_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AcceptSubscriptionOwnerTransfer' +type VRFCoordinatorV2Interface_AcceptSubscriptionOwnerTransfer_Call struct { + *mock.Call +} + +// AcceptSubscriptionOwnerTransfer is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - subId uint64 +func (_e *VRFCoordinatorV2Interface_Expecter) AcceptSubscriptionOwnerTransfer(opts interface{}, subId interface{}) *VRFCoordinatorV2Interface_AcceptSubscriptionOwnerTransfer_Call { + return &VRFCoordinatorV2Interface_AcceptSubscriptionOwnerTransfer_Call{Call: _e.mock.On("AcceptSubscriptionOwnerTransfer", opts, subId)} +} + +func (_c *VRFCoordinatorV2Interface_AcceptSubscriptionOwnerTransfer_Call) Run(run func(opts *bind.TransactOpts, subId uint64)) *VRFCoordinatorV2Interface_AcceptSubscriptionOwnerTransfer_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].(uint64)) + }) + return _c +} + +func (_c *VRFCoordinatorV2Interface_AcceptSubscriptionOwnerTransfer_Call) Return(_a0 *types.Transaction, _a1 error) *VRFCoordinatorV2Interface_AcceptSubscriptionOwnerTransfer_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *VRFCoordinatorV2Interface_AcceptSubscriptionOwnerTransfer_Call) RunAndReturn(run func(*bind.TransactOpts, uint64) (*types.Transaction, error)) *VRFCoordinatorV2Interface_AcceptSubscriptionOwnerTransfer_Call { + _c.Call.Return(run) + return _c +} + // AddConsumer provides a mock function with given fields: opts, subId, consumer func (_m *VRFCoordinatorV2Interface) AddConsumer(opts *bind.TransactOpts, subId uint64, consumer common.Address) (*types.Transaction, error) { ret := _m.Called(opts, subId, consumer) @@ -114,6 +179,36 @@ func (_m *VRFCoordinatorV2Interface) AddConsumer(opts *bind.TransactOpts, subId return r0, r1 } +// VRFCoordinatorV2Interface_AddConsumer_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddConsumer' +type VRFCoordinatorV2Interface_AddConsumer_Call struct { + *mock.Call +} + +// AddConsumer is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - subId uint64 +// - consumer common.Address +func (_e *VRFCoordinatorV2Interface_Expecter) AddConsumer(opts interface{}, subId interface{}, consumer interface{}) *VRFCoordinatorV2Interface_AddConsumer_Call { + return &VRFCoordinatorV2Interface_AddConsumer_Call{Call: _e.mock.On("AddConsumer", opts, subId, consumer)} +} + +func (_c *VRFCoordinatorV2Interface_AddConsumer_Call) Run(run func(opts *bind.TransactOpts, subId uint64, consumer common.Address)) *VRFCoordinatorV2Interface_AddConsumer_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].(uint64), args[2].(common.Address)) + }) + return _c +} + +func (_c *VRFCoordinatorV2Interface_AddConsumer_Call) Return(_a0 *types.Transaction, _a1 error) *VRFCoordinatorV2Interface_AddConsumer_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *VRFCoordinatorV2Interface_AddConsumer_Call) RunAndReturn(run func(*bind.TransactOpts, uint64, common.Address) (*types.Transaction, error)) *VRFCoordinatorV2Interface_AddConsumer_Call { + _c.Call.Return(run) + return _c +} + // Address provides a mock function with given fields: func (_m *VRFCoordinatorV2Interface) Address() common.Address { ret := _m.Called() @@ -134,6 +229,33 @@ func (_m *VRFCoordinatorV2Interface) Address() common.Address { return r0 } +// VRFCoordinatorV2Interface_Address_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Address' +type VRFCoordinatorV2Interface_Address_Call struct { + *mock.Call +} + +// Address is a helper method to define mock.On call +func (_e *VRFCoordinatorV2Interface_Expecter) Address() *VRFCoordinatorV2Interface_Address_Call { + return &VRFCoordinatorV2Interface_Address_Call{Call: _e.mock.On("Address")} +} + +func (_c *VRFCoordinatorV2Interface_Address_Call) Run(run func()) *VRFCoordinatorV2Interface_Address_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *VRFCoordinatorV2Interface_Address_Call) Return(_a0 common.Address) *VRFCoordinatorV2Interface_Address_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *VRFCoordinatorV2Interface_Address_Call) RunAndReturn(run func() common.Address) *VRFCoordinatorV2Interface_Address_Call { + _c.Call.Return(run) + return _c +} + // BLOCKHASHSTORE provides a mock function with given fields: opts func (_m *VRFCoordinatorV2Interface) BLOCKHASHSTORE(opts *bind.CallOpts) (common.Address, error) { ret := _m.Called(opts) @@ -164,6 +286,34 @@ func (_m *VRFCoordinatorV2Interface) BLOCKHASHSTORE(opts *bind.CallOpts) (common return r0, r1 } +// VRFCoordinatorV2Interface_BLOCKHASHSTORE_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BLOCKHASHSTORE' +type VRFCoordinatorV2Interface_BLOCKHASHSTORE_Call struct { + *mock.Call +} + +// BLOCKHASHSTORE is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *VRFCoordinatorV2Interface_Expecter) BLOCKHASHSTORE(opts interface{}) *VRFCoordinatorV2Interface_BLOCKHASHSTORE_Call { + return &VRFCoordinatorV2Interface_BLOCKHASHSTORE_Call{Call: _e.mock.On("BLOCKHASHSTORE", opts)} +} + +func (_c *VRFCoordinatorV2Interface_BLOCKHASHSTORE_Call) Run(run func(opts *bind.CallOpts)) *VRFCoordinatorV2Interface_BLOCKHASHSTORE_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *VRFCoordinatorV2Interface_BLOCKHASHSTORE_Call) Return(_a0 common.Address, _a1 error) *VRFCoordinatorV2Interface_BLOCKHASHSTORE_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *VRFCoordinatorV2Interface_BLOCKHASHSTORE_Call) RunAndReturn(run func(*bind.CallOpts) (common.Address, error)) *VRFCoordinatorV2Interface_BLOCKHASHSTORE_Call { + _c.Call.Return(run) + return _c +} + // CancelSubscription provides a mock function with given fields: opts, subId, to func (_m *VRFCoordinatorV2Interface) CancelSubscription(opts *bind.TransactOpts, subId uint64, to common.Address) (*types.Transaction, error) { ret := _m.Called(opts, subId, to) @@ -194,6 +344,36 @@ func (_m *VRFCoordinatorV2Interface) CancelSubscription(opts *bind.TransactOpts, return r0, r1 } +// VRFCoordinatorV2Interface_CancelSubscription_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CancelSubscription' +type VRFCoordinatorV2Interface_CancelSubscription_Call struct { + *mock.Call +} + +// CancelSubscription is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - subId uint64 +// - to common.Address +func (_e *VRFCoordinatorV2Interface_Expecter) CancelSubscription(opts interface{}, subId interface{}, to interface{}) *VRFCoordinatorV2Interface_CancelSubscription_Call { + return &VRFCoordinatorV2Interface_CancelSubscription_Call{Call: _e.mock.On("CancelSubscription", opts, subId, to)} +} + +func (_c *VRFCoordinatorV2Interface_CancelSubscription_Call) Run(run func(opts *bind.TransactOpts, subId uint64, to common.Address)) *VRFCoordinatorV2Interface_CancelSubscription_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].(uint64), args[2].(common.Address)) + }) + return _c +} + +func (_c *VRFCoordinatorV2Interface_CancelSubscription_Call) Return(_a0 *types.Transaction, _a1 error) *VRFCoordinatorV2Interface_CancelSubscription_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *VRFCoordinatorV2Interface_CancelSubscription_Call) RunAndReturn(run func(*bind.TransactOpts, uint64, common.Address) (*types.Transaction, error)) *VRFCoordinatorV2Interface_CancelSubscription_Call { + _c.Call.Return(run) + return _c +} + // CreateSubscription provides a mock function with given fields: opts func (_m *VRFCoordinatorV2Interface) CreateSubscription(opts *bind.TransactOpts) (*types.Transaction, error) { ret := _m.Called(opts) @@ -224,6 +404,34 @@ func (_m *VRFCoordinatorV2Interface) CreateSubscription(opts *bind.TransactOpts) return r0, r1 } +// VRFCoordinatorV2Interface_CreateSubscription_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateSubscription' +type VRFCoordinatorV2Interface_CreateSubscription_Call struct { + *mock.Call +} + +// CreateSubscription is a helper method to define mock.On call +// - opts *bind.TransactOpts +func (_e *VRFCoordinatorV2Interface_Expecter) CreateSubscription(opts interface{}) *VRFCoordinatorV2Interface_CreateSubscription_Call { + return &VRFCoordinatorV2Interface_CreateSubscription_Call{Call: _e.mock.On("CreateSubscription", opts)} +} + +func (_c *VRFCoordinatorV2Interface_CreateSubscription_Call) Run(run func(opts *bind.TransactOpts)) *VRFCoordinatorV2Interface_CreateSubscription_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts)) + }) + return _c +} + +func (_c *VRFCoordinatorV2Interface_CreateSubscription_Call) Return(_a0 *types.Transaction, _a1 error) *VRFCoordinatorV2Interface_CreateSubscription_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *VRFCoordinatorV2Interface_CreateSubscription_Call) RunAndReturn(run func(*bind.TransactOpts) (*types.Transaction, error)) *VRFCoordinatorV2Interface_CreateSubscription_Call { + _c.Call.Return(run) + return _c +} + // DeregisterProvingKey provides a mock function with given fields: opts, publicProvingKey func (_m *VRFCoordinatorV2Interface) DeregisterProvingKey(opts *bind.TransactOpts, publicProvingKey [2]*big.Int) (*types.Transaction, error) { ret := _m.Called(opts, publicProvingKey) @@ -254,6 +462,35 @@ func (_m *VRFCoordinatorV2Interface) DeregisterProvingKey(opts *bind.TransactOpt return r0, r1 } +// VRFCoordinatorV2Interface_DeregisterProvingKey_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeregisterProvingKey' +type VRFCoordinatorV2Interface_DeregisterProvingKey_Call struct { + *mock.Call +} + +// DeregisterProvingKey is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - publicProvingKey [2]*big.Int +func (_e *VRFCoordinatorV2Interface_Expecter) DeregisterProvingKey(opts interface{}, publicProvingKey interface{}) *VRFCoordinatorV2Interface_DeregisterProvingKey_Call { + return &VRFCoordinatorV2Interface_DeregisterProvingKey_Call{Call: _e.mock.On("DeregisterProvingKey", opts, publicProvingKey)} +} + +func (_c *VRFCoordinatorV2Interface_DeregisterProvingKey_Call) Run(run func(opts *bind.TransactOpts, publicProvingKey [2]*big.Int)) *VRFCoordinatorV2Interface_DeregisterProvingKey_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].([2]*big.Int)) + }) + return _c +} + +func (_c *VRFCoordinatorV2Interface_DeregisterProvingKey_Call) Return(_a0 *types.Transaction, _a1 error) *VRFCoordinatorV2Interface_DeregisterProvingKey_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *VRFCoordinatorV2Interface_DeregisterProvingKey_Call) RunAndReturn(run func(*bind.TransactOpts, [2]*big.Int) (*types.Transaction, error)) *VRFCoordinatorV2Interface_DeregisterProvingKey_Call { + _c.Call.Return(run) + return _c +} + // FilterConfigSet provides a mock function with given fields: opts func (_m *VRFCoordinatorV2Interface) FilterConfigSet(opts *bind.FilterOpts) (*vrf_coordinator_v2.VRFCoordinatorV2ConfigSetIterator, error) { ret := _m.Called(opts) @@ -284,6 +521,34 @@ func (_m *VRFCoordinatorV2Interface) FilterConfigSet(opts *bind.FilterOpts) (*vr return r0, r1 } +// VRFCoordinatorV2Interface_FilterConfigSet_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterConfigSet' +type VRFCoordinatorV2Interface_FilterConfigSet_Call struct { + *mock.Call +} + +// FilterConfigSet is a helper method to define mock.On call +// - opts *bind.FilterOpts +func (_e *VRFCoordinatorV2Interface_Expecter) FilterConfigSet(opts interface{}) *VRFCoordinatorV2Interface_FilterConfigSet_Call { + return &VRFCoordinatorV2Interface_FilterConfigSet_Call{Call: _e.mock.On("FilterConfigSet", opts)} +} + +func (_c *VRFCoordinatorV2Interface_FilterConfigSet_Call) Run(run func(opts *bind.FilterOpts)) *VRFCoordinatorV2Interface_FilterConfigSet_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts)) + }) + return _c +} + +func (_c *VRFCoordinatorV2Interface_FilterConfigSet_Call) Return(_a0 *vrf_coordinator_v2.VRFCoordinatorV2ConfigSetIterator, _a1 error) *VRFCoordinatorV2Interface_FilterConfigSet_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *VRFCoordinatorV2Interface_FilterConfigSet_Call) RunAndReturn(run func(*bind.FilterOpts) (*vrf_coordinator_v2.VRFCoordinatorV2ConfigSetIterator, error)) *VRFCoordinatorV2Interface_FilterConfigSet_Call { + _c.Call.Return(run) + return _c +} + // FilterFundsRecovered provides a mock function with given fields: opts func (_m *VRFCoordinatorV2Interface) FilterFundsRecovered(opts *bind.FilterOpts) (*vrf_coordinator_v2.VRFCoordinatorV2FundsRecoveredIterator, error) { ret := _m.Called(opts) @@ -314,6 +579,34 @@ func (_m *VRFCoordinatorV2Interface) FilterFundsRecovered(opts *bind.FilterOpts) return r0, r1 } +// VRFCoordinatorV2Interface_FilterFundsRecovered_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterFundsRecovered' +type VRFCoordinatorV2Interface_FilterFundsRecovered_Call struct { + *mock.Call +} + +// FilterFundsRecovered is a helper method to define mock.On call +// - opts *bind.FilterOpts +func (_e *VRFCoordinatorV2Interface_Expecter) FilterFundsRecovered(opts interface{}) *VRFCoordinatorV2Interface_FilterFundsRecovered_Call { + return &VRFCoordinatorV2Interface_FilterFundsRecovered_Call{Call: _e.mock.On("FilterFundsRecovered", opts)} +} + +func (_c *VRFCoordinatorV2Interface_FilterFundsRecovered_Call) Run(run func(opts *bind.FilterOpts)) *VRFCoordinatorV2Interface_FilterFundsRecovered_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts)) + }) + return _c +} + +func (_c *VRFCoordinatorV2Interface_FilterFundsRecovered_Call) Return(_a0 *vrf_coordinator_v2.VRFCoordinatorV2FundsRecoveredIterator, _a1 error) *VRFCoordinatorV2Interface_FilterFundsRecovered_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *VRFCoordinatorV2Interface_FilterFundsRecovered_Call) RunAndReturn(run func(*bind.FilterOpts) (*vrf_coordinator_v2.VRFCoordinatorV2FundsRecoveredIterator, error)) *VRFCoordinatorV2Interface_FilterFundsRecovered_Call { + _c.Call.Return(run) + return _c +} + // FilterOwnershipTransferRequested provides a mock function with given fields: opts, from, to func (_m *VRFCoordinatorV2Interface) FilterOwnershipTransferRequested(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*vrf_coordinator_v2.VRFCoordinatorV2OwnershipTransferRequestedIterator, error) { ret := _m.Called(opts, from, to) @@ -344,6 +637,36 @@ func (_m *VRFCoordinatorV2Interface) FilterOwnershipTransferRequested(opts *bind return r0, r1 } +// VRFCoordinatorV2Interface_FilterOwnershipTransferRequested_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterOwnershipTransferRequested' +type VRFCoordinatorV2Interface_FilterOwnershipTransferRequested_Call struct { + *mock.Call +} + +// FilterOwnershipTransferRequested is a helper method to define mock.On call +// - opts *bind.FilterOpts +// - from []common.Address +// - to []common.Address +func (_e *VRFCoordinatorV2Interface_Expecter) FilterOwnershipTransferRequested(opts interface{}, from interface{}, to interface{}) *VRFCoordinatorV2Interface_FilterOwnershipTransferRequested_Call { + return &VRFCoordinatorV2Interface_FilterOwnershipTransferRequested_Call{Call: _e.mock.On("FilterOwnershipTransferRequested", opts, from, to)} +} + +func (_c *VRFCoordinatorV2Interface_FilterOwnershipTransferRequested_Call) Run(run func(opts *bind.FilterOpts, from []common.Address, to []common.Address)) *VRFCoordinatorV2Interface_FilterOwnershipTransferRequested_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts), args[1].([]common.Address), args[2].([]common.Address)) + }) + return _c +} + +func (_c *VRFCoordinatorV2Interface_FilterOwnershipTransferRequested_Call) Return(_a0 *vrf_coordinator_v2.VRFCoordinatorV2OwnershipTransferRequestedIterator, _a1 error) *VRFCoordinatorV2Interface_FilterOwnershipTransferRequested_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *VRFCoordinatorV2Interface_FilterOwnershipTransferRequested_Call) RunAndReturn(run func(*bind.FilterOpts, []common.Address, []common.Address) (*vrf_coordinator_v2.VRFCoordinatorV2OwnershipTransferRequestedIterator, error)) *VRFCoordinatorV2Interface_FilterOwnershipTransferRequested_Call { + _c.Call.Return(run) + return _c +} + // FilterOwnershipTransferred provides a mock function with given fields: opts, from, to func (_m *VRFCoordinatorV2Interface) FilterOwnershipTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*vrf_coordinator_v2.VRFCoordinatorV2OwnershipTransferredIterator, error) { ret := _m.Called(opts, from, to) @@ -374,6 +697,36 @@ func (_m *VRFCoordinatorV2Interface) FilterOwnershipTransferred(opts *bind.Filte return r0, r1 } +// VRFCoordinatorV2Interface_FilterOwnershipTransferred_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterOwnershipTransferred' +type VRFCoordinatorV2Interface_FilterOwnershipTransferred_Call struct { + *mock.Call +} + +// FilterOwnershipTransferred is a helper method to define mock.On call +// - opts *bind.FilterOpts +// - from []common.Address +// - to []common.Address +func (_e *VRFCoordinatorV2Interface_Expecter) FilterOwnershipTransferred(opts interface{}, from interface{}, to interface{}) *VRFCoordinatorV2Interface_FilterOwnershipTransferred_Call { + return &VRFCoordinatorV2Interface_FilterOwnershipTransferred_Call{Call: _e.mock.On("FilterOwnershipTransferred", opts, from, to)} +} + +func (_c *VRFCoordinatorV2Interface_FilterOwnershipTransferred_Call) Run(run func(opts *bind.FilterOpts, from []common.Address, to []common.Address)) *VRFCoordinatorV2Interface_FilterOwnershipTransferred_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts), args[1].([]common.Address), args[2].([]common.Address)) + }) + return _c +} + +func (_c *VRFCoordinatorV2Interface_FilterOwnershipTransferred_Call) Return(_a0 *vrf_coordinator_v2.VRFCoordinatorV2OwnershipTransferredIterator, _a1 error) *VRFCoordinatorV2Interface_FilterOwnershipTransferred_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *VRFCoordinatorV2Interface_FilterOwnershipTransferred_Call) RunAndReturn(run func(*bind.FilterOpts, []common.Address, []common.Address) (*vrf_coordinator_v2.VRFCoordinatorV2OwnershipTransferredIterator, error)) *VRFCoordinatorV2Interface_FilterOwnershipTransferred_Call { + _c.Call.Return(run) + return _c +} + // FilterProvingKeyDeregistered provides a mock function with given fields: opts, oracle func (_m *VRFCoordinatorV2Interface) FilterProvingKeyDeregistered(opts *bind.FilterOpts, oracle []common.Address) (*vrf_coordinator_v2.VRFCoordinatorV2ProvingKeyDeregisteredIterator, error) { ret := _m.Called(opts, oracle) @@ -404,6 +757,35 @@ func (_m *VRFCoordinatorV2Interface) FilterProvingKeyDeregistered(opts *bind.Fil return r0, r1 } +// VRFCoordinatorV2Interface_FilterProvingKeyDeregistered_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterProvingKeyDeregistered' +type VRFCoordinatorV2Interface_FilterProvingKeyDeregistered_Call struct { + *mock.Call +} + +// FilterProvingKeyDeregistered is a helper method to define mock.On call +// - opts *bind.FilterOpts +// - oracle []common.Address +func (_e *VRFCoordinatorV2Interface_Expecter) FilterProvingKeyDeregistered(opts interface{}, oracle interface{}) *VRFCoordinatorV2Interface_FilterProvingKeyDeregistered_Call { + return &VRFCoordinatorV2Interface_FilterProvingKeyDeregistered_Call{Call: _e.mock.On("FilterProvingKeyDeregistered", opts, oracle)} +} + +func (_c *VRFCoordinatorV2Interface_FilterProvingKeyDeregistered_Call) Run(run func(opts *bind.FilterOpts, oracle []common.Address)) *VRFCoordinatorV2Interface_FilterProvingKeyDeregistered_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts), args[1].([]common.Address)) + }) + return _c +} + +func (_c *VRFCoordinatorV2Interface_FilterProvingKeyDeregistered_Call) Return(_a0 *vrf_coordinator_v2.VRFCoordinatorV2ProvingKeyDeregisteredIterator, _a1 error) *VRFCoordinatorV2Interface_FilterProvingKeyDeregistered_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *VRFCoordinatorV2Interface_FilterProvingKeyDeregistered_Call) RunAndReturn(run func(*bind.FilterOpts, []common.Address) (*vrf_coordinator_v2.VRFCoordinatorV2ProvingKeyDeregisteredIterator, error)) *VRFCoordinatorV2Interface_FilterProvingKeyDeregistered_Call { + _c.Call.Return(run) + return _c +} + // FilterProvingKeyRegistered provides a mock function with given fields: opts, oracle func (_m *VRFCoordinatorV2Interface) FilterProvingKeyRegistered(opts *bind.FilterOpts, oracle []common.Address) (*vrf_coordinator_v2.VRFCoordinatorV2ProvingKeyRegisteredIterator, error) { ret := _m.Called(opts, oracle) @@ -434,6 +816,35 @@ func (_m *VRFCoordinatorV2Interface) FilterProvingKeyRegistered(opts *bind.Filte return r0, r1 } +// VRFCoordinatorV2Interface_FilterProvingKeyRegistered_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterProvingKeyRegistered' +type VRFCoordinatorV2Interface_FilterProvingKeyRegistered_Call struct { + *mock.Call +} + +// FilterProvingKeyRegistered is a helper method to define mock.On call +// - opts *bind.FilterOpts +// - oracle []common.Address +func (_e *VRFCoordinatorV2Interface_Expecter) FilterProvingKeyRegistered(opts interface{}, oracle interface{}) *VRFCoordinatorV2Interface_FilterProvingKeyRegistered_Call { + return &VRFCoordinatorV2Interface_FilterProvingKeyRegistered_Call{Call: _e.mock.On("FilterProvingKeyRegistered", opts, oracle)} +} + +func (_c *VRFCoordinatorV2Interface_FilterProvingKeyRegistered_Call) Run(run func(opts *bind.FilterOpts, oracle []common.Address)) *VRFCoordinatorV2Interface_FilterProvingKeyRegistered_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts), args[1].([]common.Address)) + }) + return _c +} + +func (_c *VRFCoordinatorV2Interface_FilterProvingKeyRegistered_Call) Return(_a0 *vrf_coordinator_v2.VRFCoordinatorV2ProvingKeyRegisteredIterator, _a1 error) *VRFCoordinatorV2Interface_FilterProvingKeyRegistered_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *VRFCoordinatorV2Interface_FilterProvingKeyRegistered_Call) RunAndReturn(run func(*bind.FilterOpts, []common.Address) (*vrf_coordinator_v2.VRFCoordinatorV2ProvingKeyRegisteredIterator, error)) *VRFCoordinatorV2Interface_FilterProvingKeyRegistered_Call { + _c.Call.Return(run) + return _c +} + // FilterRandomWordsFulfilled provides a mock function with given fields: opts, requestId func (_m *VRFCoordinatorV2Interface) FilterRandomWordsFulfilled(opts *bind.FilterOpts, requestId []*big.Int) (*vrf_coordinator_v2.VRFCoordinatorV2RandomWordsFulfilledIterator, error) { ret := _m.Called(opts, requestId) @@ -464,6 +875,35 @@ func (_m *VRFCoordinatorV2Interface) FilterRandomWordsFulfilled(opts *bind.Filte return r0, r1 } +// VRFCoordinatorV2Interface_FilterRandomWordsFulfilled_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterRandomWordsFulfilled' +type VRFCoordinatorV2Interface_FilterRandomWordsFulfilled_Call struct { + *mock.Call +} + +// FilterRandomWordsFulfilled is a helper method to define mock.On call +// - opts *bind.FilterOpts +// - requestId []*big.Int +func (_e *VRFCoordinatorV2Interface_Expecter) FilterRandomWordsFulfilled(opts interface{}, requestId interface{}) *VRFCoordinatorV2Interface_FilterRandomWordsFulfilled_Call { + return &VRFCoordinatorV2Interface_FilterRandomWordsFulfilled_Call{Call: _e.mock.On("FilterRandomWordsFulfilled", opts, requestId)} +} + +func (_c *VRFCoordinatorV2Interface_FilterRandomWordsFulfilled_Call) Run(run func(opts *bind.FilterOpts, requestId []*big.Int)) *VRFCoordinatorV2Interface_FilterRandomWordsFulfilled_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts), args[1].([]*big.Int)) + }) + return _c +} + +func (_c *VRFCoordinatorV2Interface_FilterRandomWordsFulfilled_Call) Return(_a0 *vrf_coordinator_v2.VRFCoordinatorV2RandomWordsFulfilledIterator, _a1 error) *VRFCoordinatorV2Interface_FilterRandomWordsFulfilled_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *VRFCoordinatorV2Interface_FilterRandomWordsFulfilled_Call) RunAndReturn(run func(*bind.FilterOpts, []*big.Int) (*vrf_coordinator_v2.VRFCoordinatorV2RandomWordsFulfilledIterator, error)) *VRFCoordinatorV2Interface_FilterRandomWordsFulfilled_Call { + _c.Call.Return(run) + return _c +} + // FilterRandomWordsRequested provides a mock function with given fields: opts, keyHash, subId, sender func (_m *VRFCoordinatorV2Interface) FilterRandomWordsRequested(opts *bind.FilterOpts, keyHash [][32]byte, subId []uint64, sender []common.Address) (*vrf_coordinator_v2.VRFCoordinatorV2RandomWordsRequestedIterator, error) { ret := _m.Called(opts, keyHash, subId, sender) @@ -494,6 +934,37 @@ func (_m *VRFCoordinatorV2Interface) FilterRandomWordsRequested(opts *bind.Filte return r0, r1 } +// VRFCoordinatorV2Interface_FilterRandomWordsRequested_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterRandomWordsRequested' +type VRFCoordinatorV2Interface_FilterRandomWordsRequested_Call struct { + *mock.Call +} + +// FilterRandomWordsRequested is a helper method to define mock.On call +// - opts *bind.FilterOpts +// - keyHash [][32]byte +// - subId []uint64 +// - sender []common.Address +func (_e *VRFCoordinatorV2Interface_Expecter) FilterRandomWordsRequested(opts interface{}, keyHash interface{}, subId interface{}, sender interface{}) *VRFCoordinatorV2Interface_FilterRandomWordsRequested_Call { + return &VRFCoordinatorV2Interface_FilterRandomWordsRequested_Call{Call: _e.mock.On("FilterRandomWordsRequested", opts, keyHash, subId, sender)} +} + +func (_c *VRFCoordinatorV2Interface_FilterRandomWordsRequested_Call) Run(run func(opts *bind.FilterOpts, keyHash [][32]byte, subId []uint64, sender []common.Address)) *VRFCoordinatorV2Interface_FilterRandomWordsRequested_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts), args[1].([][32]byte), args[2].([]uint64), args[3].([]common.Address)) + }) + return _c +} + +func (_c *VRFCoordinatorV2Interface_FilterRandomWordsRequested_Call) Return(_a0 *vrf_coordinator_v2.VRFCoordinatorV2RandomWordsRequestedIterator, _a1 error) *VRFCoordinatorV2Interface_FilterRandomWordsRequested_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *VRFCoordinatorV2Interface_FilterRandomWordsRequested_Call) RunAndReturn(run func(*bind.FilterOpts, [][32]byte, []uint64, []common.Address) (*vrf_coordinator_v2.VRFCoordinatorV2RandomWordsRequestedIterator, error)) *VRFCoordinatorV2Interface_FilterRandomWordsRequested_Call { + _c.Call.Return(run) + return _c +} + // FilterSubscriptionCanceled provides a mock function with given fields: opts, subId func (_m *VRFCoordinatorV2Interface) FilterSubscriptionCanceled(opts *bind.FilterOpts, subId []uint64) (*vrf_coordinator_v2.VRFCoordinatorV2SubscriptionCanceledIterator, error) { ret := _m.Called(opts, subId) @@ -524,6 +995,35 @@ func (_m *VRFCoordinatorV2Interface) FilterSubscriptionCanceled(opts *bind.Filte return r0, r1 } +// VRFCoordinatorV2Interface_FilterSubscriptionCanceled_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterSubscriptionCanceled' +type VRFCoordinatorV2Interface_FilterSubscriptionCanceled_Call struct { + *mock.Call +} + +// FilterSubscriptionCanceled is a helper method to define mock.On call +// - opts *bind.FilterOpts +// - subId []uint64 +func (_e *VRFCoordinatorV2Interface_Expecter) FilterSubscriptionCanceled(opts interface{}, subId interface{}) *VRFCoordinatorV2Interface_FilterSubscriptionCanceled_Call { + return &VRFCoordinatorV2Interface_FilterSubscriptionCanceled_Call{Call: _e.mock.On("FilterSubscriptionCanceled", opts, subId)} +} + +func (_c *VRFCoordinatorV2Interface_FilterSubscriptionCanceled_Call) Run(run func(opts *bind.FilterOpts, subId []uint64)) *VRFCoordinatorV2Interface_FilterSubscriptionCanceled_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts), args[1].([]uint64)) + }) + return _c +} + +func (_c *VRFCoordinatorV2Interface_FilterSubscriptionCanceled_Call) Return(_a0 *vrf_coordinator_v2.VRFCoordinatorV2SubscriptionCanceledIterator, _a1 error) *VRFCoordinatorV2Interface_FilterSubscriptionCanceled_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *VRFCoordinatorV2Interface_FilterSubscriptionCanceled_Call) RunAndReturn(run func(*bind.FilterOpts, []uint64) (*vrf_coordinator_v2.VRFCoordinatorV2SubscriptionCanceledIterator, error)) *VRFCoordinatorV2Interface_FilterSubscriptionCanceled_Call { + _c.Call.Return(run) + return _c +} + // FilterSubscriptionConsumerAdded provides a mock function with given fields: opts, subId func (_m *VRFCoordinatorV2Interface) FilterSubscriptionConsumerAdded(opts *bind.FilterOpts, subId []uint64) (*vrf_coordinator_v2.VRFCoordinatorV2SubscriptionConsumerAddedIterator, error) { ret := _m.Called(opts, subId) @@ -554,6 +1054,35 @@ func (_m *VRFCoordinatorV2Interface) FilterSubscriptionConsumerAdded(opts *bind. return r0, r1 } +// VRFCoordinatorV2Interface_FilterSubscriptionConsumerAdded_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterSubscriptionConsumerAdded' +type VRFCoordinatorV2Interface_FilterSubscriptionConsumerAdded_Call struct { + *mock.Call +} + +// FilterSubscriptionConsumerAdded is a helper method to define mock.On call +// - opts *bind.FilterOpts +// - subId []uint64 +func (_e *VRFCoordinatorV2Interface_Expecter) FilterSubscriptionConsumerAdded(opts interface{}, subId interface{}) *VRFCoordinatorV2Interface_FilterSubscriptionConsumerAdded_Call { + return &VRFCoordinatorV2Interface_FilterSubscriptionConsumerAdded_Call{Call: _e.mock.On("FilterSubscriptionConsumerAdded", opts, subId)} +} + +func (_c *VRFCoordinatorV2Interface_FilterSubscriptionConsumerAdded_Call) Run(run func(opts *bind.FilterOpts, subId []uint64)) *VRFCoordinatorV2Interface_FilterSubscriptionConsumerAdded_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts), args[1].([]uint64)) + }) + return _c +} + +func (_c *VRFCoordinatorV2Interface_FilterSubscriptionConsumerAdded_Call) Return(_a0 *vrf_coordinator_v2.VRFCoordinatorV2SubscriptionConsumerAddedIterator, _a1 error) *VRFCoordinatorV2Interface_FilterSubscriptionConsumerAdded_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *VRFCoordinatorV2Interface_FilterSubscriptionConsumerAdded_Call) RunAndReturn(run func(*bind.FilterOpts, []uint64) (*vrf_coordinator_v2.VRFCoordinatorV2SubscriptionConsumerAddedIterator, error)) *VRFCoordinatorV2Interface_FilterSubscriptionConsumerAdded_Call { + _c.Call.Return(run) + return _c +} + // FilterSubscriptionConsumerRemoved provides a mock function with given fields: opts, subId func (_m *VRFCoordinatorV2Interface) FilterSubscriptionConsumerRemoved(opts *bind.FilterOpts, subId []uint64) (*vrf_coordinator_v2.VRFCoordinatorV2SubscriptionConsumerRemovedIterator, error) { ret := _m.Called(opts, subId) @@ -584,6 +1113,35 @@ func (_m *VRFCoordinatorV2Interface) FilterSubscriptionConsumerRemoved(opts *bin return r0, r1 } +// VRFCoordinatorV2Interface_FilterSubscriptionConsumerRemoved_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterSubscriptionConsumerRemoved' +type VRFCoordinatorV2Interface_FilterSubscriptionConsumerRemoved_Call struct { + *mock.Call +} + +// FilterSubscriptionConsumerRemoved is a helper method to define mock.On call +// - opts *bind.FilterOpts +// - subId []uint64 +func (_e *VRFCoordinatorV2Interface_Expecter) FilterSubscriptionConsumerRemoved(opts interface{}, subId interface{}) *VRFCoordinatorV2Interface_FilterSubscriptionConsumerRemoved_Call { + return &VRFCoordinatorV2Interface_FilterSubscriptionConsumerRemoved_Call{Call: _e.mock.On("FilterSubscriptionConsumerRemoved", opts, subId)} +} + +func (_c *VRFCoordinatorV2Interface_FilterSubscriptionConsumerRemoved_Call) Run(run func(opts *bind.FilterOpts, subId []uint64)) *VRFCoordinatorV2Interface_FilterSubscriptionConsumerRemoved_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts), args[1].([]uint64)) + }) + return _c +} + +func (_c *VRFCoordinatorV2Interface_FilterSubscriptionConsumerRemoved_Call) Return(_a0 *vrf_coordinator_v2.VRFCoordinatorV2SubscriptionConsumerRemovedIterator, _a1 error) *VRFCoordinatorV2Interface_FilterSubscriptionConsumerRemoved_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *VRFCoordinatorV2Interface_FilterSubscriptionConsumerRemoved_Call) RunAndReturn(run func(*bind.FilterOpts, []uint64) (*vrf_coordinator_v2.VRFCoordinatorV2SubscriptionConsumerRemovedIterator, error)) *VRFCoordinatorV2Interface_FilterSubscriptionConsumerRemoved_Call { + _c.Call.Return(run) + return _c +} + // FilterSubscriptionCreated provides a mock function with given fields: opts, subId func (_m *VRFCoordinatorV2Interface) FilterSubscriptionCreated(opts *bind.FilterOpts, subId []uint64) (*vrf_coordinator_v2.VRFCoordinatorV2SubscriptionCreatedIterator, error) { ret := _m.Called(opts, subId) @@ -614,6 +1172,35 @@ func (_m *VRFCoordinatorV2Interface) FilterSubscriptionCreated(opts *bind.Filter return r0, r1 } +// VRFCoordinatorV2Interface_FilterSubscriptionCreated_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterSubscriptionCreated' +type VRFCoordinatorV2Interface_FilterSubscriptionCreated_Call struct { + *mock.Call +} + +// FilterSubscriptionCreated is a helper method to define mock.On call +// - opts *bind.FilterOpts +// - subId []uint64 +func (_e *VRFCoordinatorV2Interface_Expecter) FilterSubscriptionCreated(opts interface{}, subId interface{}) *VRFCoordinatorV2Interface_FilterSubscriptionCreated_Call { + return &VRFCoordinatorV2Interface_FilterSubscriptionCreated_Call{Call: _e.mock.On("FilterSubscriptionCreated", opts, subId)} +} + +func (_c *VRFCoordinatorV2Interface_FilterSubscriptionCreated_Call) Run(run func(opts *bind.FilterOpts, subId []uint64)) *VRFCoordinatorV2Interface_FilterSubscriptionCreated_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts), args[1].([]uint64)) + }) + return _c +} + +func (_c *VRFCoordinatorV2Interface_FilterSubscriptionCreated_Call) Return(_a0 *vrf_coordinator_v2.VRFCoordinatorV2SubscriptionCreatedIterator, _a1 error) *VRFCoordinatorV2Interface_FilterSubscriptionCreated_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *VRFCoordinatorV2Interface_FilterSubscriptionCreated_Call) RunAndReturn(run func(*bind.FilterOpts, []uint64) (*vrf_coordinator_v2.VRFCoordinatorV2SubscriptionCreatedIterator, error)) *VRFCoordinatorV2Interface_FilterSubscriptionCreated_Call { + _c.Call.Return(run) + return _c +} + // FilterSubscriptionFunded provides a mock function with given fields: opts, subId func (_m *VRFCoordinatorV2Interface) FilterSubscriptionFunded(opts *bind.FilterOpts, subId []uint64) (*vrf_coordinator_v2.VRFCoordinatorV2SubscriptionFundedIterator, error) { ret := _m.Called(opts, subId) @@ -644,6 +1231,35 @@ func (_m *VRFCoordinatorV2Interface) FilterSubscriptionFunded(opts *bind.FilterO return r0, r1 } +// VRFCoordinatorV2Interface_FilterSubscriptionFunded_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterSubscriptionFunded' +type VRFCoordinatorV2Interface_FilterSubscriptionFunded_Call struct { + *mock.Call +} + +// FilterSubscriptionFunded is a helper method to define mock.On call +// - opts *bind.FilterOpts +// - subId []uint64 +func (_e *VRFCoordinatorV2Interface_Expecter) FilterSubscriptionFunded(opts interface{}, subId interface{}) *VRFCoordinatorV2Interface_FilterSubscriptionFunded_Call { + return &VRFCoordinatorV2Interface_FilterSubscriptionFunded_Call{Call: _e.mock.On("FilterSubscriptionFunded", opts, subId)} +} + +func (_c *VRFCoordinatorV2Interface_FilterSubscriptionFunded_Call) Run(run func(opts *bind.FilterOpts, subId []uint64)) *VRFCoordinatorV2Interface_FilterSubscriptionFunded_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts), args[1].([]uint64)) + }) + return _c +} + +func (_c *VRFCoordinatorV2Interface_FilterSubscriptionFunded_Call) Return(_a0 *vrf_coordinator_v2.VRFCoordinatorV2SubscriptionFundedIterator, _a1 error) *VRFCoordinatorV2Interface_FilterSubscriptionFunded_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *VRFCoordinatorV2Interface_FilterSubscriptionFunded_Call) RunAndReturn(run func(*bind.FilterOpts, []uint64) (*vrf_coordinator_v2.VRFCoordinatorV2SubscriptionFundedIterator, error)) *VRFCoordinatorV2Interface_FilterSubscriptionFunded_Call { + _c.Call.Return(run) + return _c +} + // FilterSubscriptionOwnerTransferRequested provides a mock function with given fields: opts, subId func (_m *VRFCoordinatorV2Interface) FilterSubscriptionOwnerTransferRequested(opts *bind.FilterOpts, subId []uint64) (*vrf_coordinator_v2.VRFCoordinatorV2SubscriptionOwnerTransferRequestedIterator, error) { ret := _m.Called(opts, subId) @@ -674,6 +1290,35 @@ func (_m *VRFCoordinatorV2Interface) FilterSubscriptionOwnerTransferRequested(op return r0, r1 } +// VRFCoordinatorV2Interface_FilterSubscriptionOwnerTransferRequested_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterSubscriptionOwnerTransferRequested' +type VRFCoordinatorV2Interface_FilterSubscriptionOwnerTransferRequested_Call struct { + *mock.Call +} + +// FilterSubscriptionOwnerTransferRequested is a helper method to define mock.On call +// - opts *bind.FilterOpts +// - subId []uint64 +func (_e *VRFCoordinatorV2Interface_Expecter) FilterSubscriptionOwnerTransferRequested(opts interface{}, subId interface{}) *VRFCoordinatorV2Interface_FilterSubscriptionOwnerTransferRequested_Call { + return &VRFCoordinatorV2Interface_FilterSubscriptionOwnerTransferRequested_Call{Call: _e.mock.On("FilterSubscriptionOwnerTransferRequested", opts, subId)} +} + +func (_c *VRFCoordinatorV2Interface_FilterSubscriptionOwnerTransferRequested_Call) Run(run func(opts *bind.FilterOpts, subId []uint64)) *VRFCoordinatorV2Interface_FilterSubscriptionOwnerTransferRequested_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts), args[1].([]uint64)) + }) + return _c +} + +func (_c *VRFCoordinatorV2Interface_FilterSubscriptionOwnerTransferRequested_Call) Return(_a0 *vrf_coordinator_v2.VRFCoordinatorV2SubscriptionOwnerTransferRequestedIterator, _a1 error) *VRFCoordinatorV2Interface_FilterSubscriptionOwnerTransferRequested_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *VRFCoordinatorV2Interface_FilterSubscriptionOwnerTransferRequested_Call) RunAndReturn(run func(*bind.FilterOpts, []uint64) (*vrf_coordinator_v2.VRFCoordinatorV2SubscriptionOwnerTransferRequestedIterator, error)) *VRFCoordinatorV2Interface_FilterSubscriptionOwnerTransferRequested_Call { + _c.Call.Return(run) + return _c +} + // FilterSubscriptionOwnerTransferred provides a mock function with given fields: opts, subId func (_m *VRFCoordinatorV2Interface) FilterSubscriptionOwnerTransferred(opts *bind.FilterOpts, subId []uint64) (*vrf_coordinator_v2.VRFCoordinatorV2SubscriptionOwnerTransferredIterator, error) { ret := _m.Called(opts, subId) @@ -704,6 +1349,35 @@ func (_m *VRFCoordinatorV2Interface) FilterSubscriptionOwnerTransferred(opts *bi return r0, r1 } +// VRFCoordinatorV2Interface_FilterSubscriptionOwnerTransferred_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterSubscriptionOwnerTransferred' +type VRFCoordinatorV2Interface_FilterSubscriptionOwnerTransferred_Call struct { + *mock.Call +} + +// FilterSubscriptionOwnerTransferred is a helper method to define mock.On call +// - opts *bind.FilterOpts +// - subId []uint64 +func (_e *VRFCoordinatorV2Interface_Expecter) FilterSubscriptionOwnerTransferred(opts interface{}, subId interface{}) *VRFCoordinatorV2Interface_FilterSubscriptionOwnerTransferred_Call { + return &VRFCoordinatorV2Interface_FilterSubscriptionOwnerTransferred_Call{Call: _e.mock.On("FilterSubscriptionOwnerTransferred", opts, subId)} +} + +func (_c *VRFCoordinatorV2Interface_FilterSubscriptionOwnerTransferred_Call) Run(run func(opts *bind.FilterOpts, subId []uint64)) *VRFCoordinatorV2Interface_FilterSubscriptionOwnerTransferred_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.FilterOpts), args[1].([]uint64)) + }) + return _c +} + +func (_c *VRFCoordinatorV2Interface_FilterSubscriptionOwnerTransferred_Call) Return(_a0 *vrf_coordinator_v2.VRFCoordinatorV2SubscriptionOwnerTransferredIterator, _a1 error) *VRFCoordinatorV2Interface_FilterSubscriptionOwnerTransferred_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *VRFCoordinatorV2Interface_FilterSubscriptionOwnerTransferred_Call) RunAndReturn(run func(*bind.FilterOpts, []uint64) (*vrf_coordinator_v2.VRFCoordinatorV2SubscriptionOwnerTransferredIterator, error)) *VRFCoordinatorV2Interface_FilterSubscriptionOwnerTransferred_Call { + _c.Call.Return(run) + return _c +} + // FulfillRandomWords provides a mock function with given fields: opts, proof, rc func (_m *VRFCoordinatorV2Interface) FulfillRandomWords(opts *bind.TransactOpts, proof vrf_coordinator_v2.VRFProof, rc vrf_coordinator_v2.VRFCoordinatorV2RequestCommitment) (*types.Transaction, error) { ret := _m.Called(opts, proof, rc) @@ -734,6 +1408,36 @@ func (_m *VRFCoordinatorV2Interface) FulfillRandomWords(opts *bind.TransactOpts, return r0, r1 } +// VRFCoordinatorV2Interface_FulfillRandomWords_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FulfillRandomWords' +type VRFCoordinatorV2Interface_FulfillRandomWords_Call struct { + *mock.Call +} + +// FulfillRandomWords is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - proof vrf_coordinator_v2.VRFProof +// - rc vrf_coordinator_v2.VRFCoordinatorV2RequestCommitment +func (_e *VRFCoordinatorV2Interface_Expecter) FulfillRandomWords(opts interface{}, proof interface{}, rc interface{}) *VRFCoordinatorV2Interface_FulfillRandomWords_Call { + return &VRFCoordinatorV2Interface_FulfillRandomWords_Call{Call: _e.mock.On("FulfillRandomWords", opts, proof, rc)} +} + +func (_c *VRFCoordinatorV2Interface_FulfillRandomWords_Call) Run(run func(opts *bind.TransactOpts, proof vrf_coordinator_v2.VRFProof, rc vrf_coordinator_v2.VRFCoordinatorV2RequestCommitment)) *VRFCoordinatorV2Interface_FulfillRandomWords_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].(vrf_coordinator_v2.VRFProof), args[2].(vrf_coordinator_v2.VRFCoordinatorV2RequestCommitment)) + }) + return _c +} + +func (_c *VRFCoordinatorV2Interface_FulfillRandomWords_Call) Return(_a0 *types.Transaction, _a1 error) *VRFCoordinatorV2Interface_FulfillRandomWords_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *VRFCoordinatorV2Interface_FulfillRandomWords_Call) RunAndReturn(run func(*bind.TransactOpts, vrf_coordinator_v2.VRFProof, vrf_coordinator_v2.VRFCoordinatorV2RequestCommitment) (*types.Transaction, error)) *VRFCoordinatorV2Interface_FulfillRandomWords_Call { + _c.Call.Return(run) + return _c +} + // GetCommitment provides a mock function with given fields: opts, requestId func (_m *VRFCoordinatorV2Interface) GetCommitment(opts *bind.CallOpts, requestId *big.Int) ([32]byte, error) { ret := _m.Called(opts, requestId) @@ -764,6 +1468,35 @@ func (_m *VRFCoordinatorV2Interface) GetCommitment(opts *bind.CallOpts, requestI return r0, r1 } +// VRFCoordinatorV2Interface_GetCommitment_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetCommitment' +type VRFCoordinatorV2Interface_GetCommitment_Call struct { + *mock.Call +} + +// GetCommitment is a helper method to define mock.On call +// - opts *bind.CallOpts +// - requestId *big.Int +func (_e *VRFCoordinatorV2Interface_Expecter) GetCommitment(opts interface{}, requestId interface{}) *VRFCoordinatorV2Interface_GetCommitment_Call { + return &VRFCoordinatorV2Interface_GetCommitment_Call{Call: _e.mock.On("GetCommitment", opts, requestId)} +} + +func (_c *VRFCoordinatorV2Interface_GetCommitment_Call) Run(run func(opts *bind.CallOpts, requestId *big.Int)) *VRFCoordinatorV2Interface_GetCommitment_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts), args[1].(*big.Int)) + }) + return _c +} + +func (_c *VRFCoordinatorV2Interface_GetCommitment_Call) Return(_a0 [32]byte, _a1 error) *VRFCoordinatorV2Interface_GetCommitment_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *VRFCoordinatorV2Interface_GetCommitment_Call) RunAndReturn(run func(*bind.CallOpts, *big.Int) ([32]byte, error)) *VRFCoordinatorV2Interface_GetCommitment_Call { + _c.Call.Return(run) + return _c +} + // GetConfig provides a mock function with given fields: opts func (_m *VRFCoordinatorV2Interface) GetConfig(opts *bind.CallOpts) (vrf_coordinator_v2.GetConfig, error) { ret := _m.Called(opts) @@ -792,8 +1525,36 @@ func (_m *VRFCoordinatorV2Interface) GetConfig(opts *bind.CallOpts) (vrf_coordin return r0, r1 } -// GetCurrentSubId provides a mock function with given fields: opts -func (_m *VRFCoordinatorV2Interface) GetCurrentSubId(opts *bind.CallOpts) (uint64, error) { +// VRFCoordinatorV2Interface_GetConfig_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetConfig' +type VRFCoordinatorV2Interface_GetConfig_Call struct { + *mock.Call +} + +// GetConfig is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *VRFCoordinatorV2Interface_Expecter) GetConfig(opts interface{}) *VRFCoordinatorV2Interface_GetConfig_Call { + return &VRFCoordinatorV2Interface_GetConfig_Call{Call: _e.mock.On("GetConfig", opts)} +} + +func (_c *VRFCoordinatorV2Interface_GetConfig_Call) Run(run func(opts *bind.CallOpts)) *VRFCoordinatorV2Interface_GetConfig_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *VRFCoordinatorV2Interface_GetConfig_Call) Return(_a0 vrf_coordinator_v2.GetConfig, _a1 error) *VRFCoordinatorV2Interface_GetConfig_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *VRFCoordinatorV2Interface_GetConfig_Call) RunAndReturn(run func(*bind.CallOpts) (vrf_coordinator_v2.GetConfig, error)) *VRFCoordinatorV2Interface_GetConfig_Call { + _c.Call.Return(run) + return _c +} + +// GetCurrentSubId provides a mock function with given fields: opts +func (_m *VRFCoordinatorV2Interface) GetCurrentSubId(opts *bind.CallOpts) (uint64, error) { ret := _m.Called(opts) if len(ret) == 0 { @@ -820,6 +1581,34 @@ func (_m *VRFCoordinatorV2Interface) GetCurrentSubId(opts *bind.CallOpts) (uint6 return r0, r1 } +// VRFCoordinatorV2Interface_GetCurrentSubId_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetCurrentSubId' +type VRFCoordinatorV2Interface_GetCurrentSubId_Call struct { + *mock.Call +} + +// GetCurrentSubId is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *VRFCoordinatorV2Interface_Expecter) GetCurrentSubId(opts interface{}) *VRFCoordinatorV2Interface_GetCurrentSubId_Call { + return &VRFCoordinatorV2Interface_GetCurrentSubId_Call{Call: _e.mock.On("GetCurrentSubId", opts)} +} + +func (_c *VRFCoordinatorV2Interface_GetCurrentSubId_Call) Run(run func(opts *bind.CallOpts)) *VRFCoordinatorV2Interface_GetCurrentSubId_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *VRFCoordinatorV2Interface_GetCurrentSubId_Call) Return(_a0 uint64, _a1 error) *VRFCoordinatorV2Interface_GetCurrentSubId_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *VRFCoordinatorV2Interface_GetCurrentSubId_Call) RunAndReturn(run func(*bind.CallOpts) (uint64, error)) *VRFCoordinatorV2Interface_GetCurrentSubId_Call { + _c.Call.Return(run) + return _c +} + // GetFallbackWeiPerUnitLink provides a mock function with given fields: opts func (_m *VRFCoordinatorV2Interface) GetFallbackWeiPerUnitLink(opts *bind.CallOpts) (*big.Int, error) { ret := _m.Called(opts) @@ -850,6 +1639,34 @@ func (_m *VRFCoordinatorV2Interface) GetFallbackWeiPerUnitLink(opts *bind.CallOp return r0, r1 } +// VRFCoordinatorV2Interface_GetFallbackWeiPerUnitLink_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetFallbackWeiPerUnitLink' +type VRFCoordinatorV2Interface_GetFallbackWeiPerUnitLink_Call struct { + *mock.Call +} + +// GetFallbackWeiPerUnitLink is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *VRFCoordinatorV2Interface_Expecter) GetFallbackWeiPerUnitLink(opts interface{}) *VRFCoordinatorV2Interface_GetFallbackWeiPerUnitLink_Call { + return &VRFCoordinatorV2Interface_GetFallbackWeiPerUnitLink_Call{Call: _e.mock.On("GetFallbackWeiPerUnitLink", opts)} +} + +func (_c *VRFCoordinatorV2Interface_GetFallbackWeiPerUnitLink_Call) Run(run func(opts *bind.CallOpts)) *VRFCoordinatorV2Interface_GetFallbackWeiPerUnitLink_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *VRFCoordinatorV2Interface_GetFallbackWeiPerUnitLink_Call) Return(_a0 *big.Int, _a1 error) *VRFCoordinatorV2Interface_GetFallbackWeiPerUnitLink_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *VRFCoordinatorV2Interface_GetFallbackWeiPerUnitLink_Call) RunAndReturn(run func(*bind.CallOpts) (*big.Int, error)) *VRFCoordinatorV2Interface_GetFallbackWeiPerUnitLink_Call { + _c.Call.Return(run) + return _c +} + // GetFeeConfig provides a mock function with given fields: opts func (_m *VRFCoordinatorV2Interface) GetFeeConfig(opts *bind.CallOpts) (vrf_coordinator_v2.GetFeeConfig, error) { ret := _m.Called(opts) @@ -878,6 +1695,34 @@ func (_m *VRFCoordinatorV2Interface) GetFeeConfig(opts *bind.CallOpts) (vrf_coor return r0, r1 } +// VRFCoordinatorV2Interface_GetFeeConfig_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetFeeConfig' +type VRFCoordinatorV2Interface_GetFeeConfig_Call struct { + *mock.Call +} + +// GetFeeConfig is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *VRFCoordinatorV2Interface_Expecter) GetFeeConfig(opts interface{}) *VRFCoordinatorV2Interface_GetFeeConfig_Call { + return &VRFCoordinatorV2Interface_GetFeeConfig_Call{Call: _e.mock.On("GetFeeConfig", opts)} +} + +func (_c *VRFCoordinatorV2Interface_GetFeeConfig_Call) Run(run func(opts *bind.CallOpts)) *VRFCoordinatorV2Interface_GetFeeConfig_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *VRFCoordinatorV2Interface_GetFeeConfig_Call) Return(_a0 vrf_coordinator_v2.GetFeeConfig, _a1 error) *VRFCoordinatorV2Interface_GetFeeConfig_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *VRFCoordinatorV2Interface_GetFeeConfig_Call) RunAndReturn(run func(*bind.CallOpts) (vrf_coordinator_v2.GetFeeConfig, error)) *VRFCoordinatorV2Interface_GetFeeConfig_Call { + _c.Call.Return(run) + return _c +} + // GetFeeTier provides a mock function with given fields: opts, reqCount func (_m *VRFCoordinatorV2Interface) GetFeeTier(opts *bind.CallOpts, reqCount uint64) (uint32, error) { ret := _m.Called(opts, reqCount) @@ -906,6 +1751,35 @@ func (_m *VRFCoordinatorV2Interface) GetFeeTier(opts *bind.CallOpts, reqCount ui return r0, r1 } +// VRFCoordinatorV2Interface_GetFeeTier_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetFeeTier' +type VRFCoordinatorV2Interface_GetFeeTier_Call struct { + *mock.Call +} + +// GetFeeTier is a helper method to define mock.On call +// - opts *bind.CallOpts +// - reqCount uint64 +func (_e *VRFCoordinatorV2Interface_Expecter) GetFeeTier(opts interface{}, reqCount interface{}) *VRFCoordinatorV2Interface_GetFeeTier_Call { + return &VRFCoordinatorV2Interface_GetFeeTier_Call{Call: _e.mock.On("GetFeeTier", opts, reqCount)} +} + +func (_c *VRFCoordinatorV2Interface_GetFeeTier_Call) Run(run func(opts *bind.CallOpts, reqCount uint64)) *VRFCoordinatorV2Interface_GetFeeTier_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts), args[1].(uint64)) + }) + return _c +} + +func (_c *VRFCoordinatorV2Interface_GetFeeTier_Call) Return(_a0 uint32, _a1 error) *VRFCoordinatorV2Interface_GetFeeTier_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *VRFCoordinatorV2Interface_GetFeeTier_Call) RunAndReturn(run func(*bind.CallOpts, uint64) (uint32, error)) *VRFCoordinatorV2Interface_GetFeeTier_Call { + _c.Call.Return(run) + return _c +} + // GetRequestConfig provides a mock function with given fields: opts func (_m *VRFCoordinatorV2Interface) GetRequestConfig(opts *bind.CallOpts) (uint16, uint32, [][32]byte, error) { ret := _m.Called(opts) @@ -950,6 +1824,34 @@ func (_m *VRFCoordinatorV2Interface) GetRequestConfig(opts *bind.CallOpts) (uint return r0, r1, r2, r3 } +// VRFCoordinatorV2Interface_GetRequestConfig_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetRequestConfig' +type VRFCoordinatorV2Interface_GetRequestConfig_Call struct { + *mock.Call +} + +// GetRequestConfig is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *VRFCoordinatorV2Interface_Expecter) GetRequestConfig(opts interface{}) *VRFCoordinatorV2Interface_GetRequestConfig_Call { + return &VRFCoordinatorV2Interface_GetRequestConfig_Call{Call: _e.mock.On("GetRequestConfig", opts)} +} + +func (_c *VRFCoordinatorV2Interface_GetRequestConfig_Call) Run(run func(opts *bind.CallOpts)) *VRFCoordinatorV2Interface_GetRequestConfig_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *VRFCoordinatorV2Interface_GetRequestConfig_Call) Return(_a0 uint16, _a1 uint32, _a2 [][32]byte, _a3 error) *VRFCoordinatorV2Interface_GetRequestConfig_Call { + _c.Call.Return(_a0, _a1, _a2, _a3) + return _c +} + +func (_c *VRFCoordinatorV2Interface_GetRequestConfig_Call) RunAndReturn(run func(*bind.CallOpts) (uint16, uint32, [][32]byte, error)) *VRFCoordinatorV2Interface_GetRequestConfig_Call { + _c.Call.Return(run) + return _c +} + // GetSubscription provides a mock function with given fields: opts, subId func (_m *VRFCoordinatorV2Interface) GetSubscription(opts *bind.CallOpts, subId uint64) (vrf_coordinator_v2.GetSubscription, error) { ret := _m.Called(opts, subId) @@ -978,6 +1880,35 @@ func (_m *VRFCoordinatorV2Interface) GetSubscription(opts *bind.CallOpts, subId return r0, r1 } +// VRFCoordinatorV2Interface_GetSubscription_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSubscription' +type VRFCoordinatorV2Interface_GetSubscription_Call struct { + *mock.Call +} + +// GetSubscription is a helper method to define mock.On call +// - opts *bind.CallOpts +// - subId uint64 +func (_e *VRFCoordinatorV2Interface_Expecter) GetSubscription(opts interface{}, subId interface{}) *VRFCoordinatorV2Interface_GetSubscription_Call { + return &VRFCoordinatorV2Interface_GetSubscription_Call{Call: _e.mock.On("GetSubscription", opts, subId)} +} + +func (_c *VRFCoordinatorV2Interface_GetSubscription_Call) Run(run func(opts *bind.CallOpts, subId uint64)) *VRFCoordinatorV2Interface_GetSubscription_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts), args[1].(uint64)) + }) + return _c +} + +func (_c *VRFCoordinatorV2Interface_GetSubscription_Call) Return(_a0 vrf_coordinator_v2.GetSubscription, _a1 error) *VRFCoordinatorV2Interface_GetSubscription_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *VRFCoordinatorV2Interface_GetSubscription_Call) RunAndReturn(run func(*bind.CallOpts, uint64) (vrf_coordinator_v2.GetSubscription, error)) *VRFCoordinatorV2Interface_GetSubscription_Call { + _c.Call.Return(run) + return _c +} + // GetTotalBalance provides a mock function with given fields: opts func (_m *VRFCoordinatorV2Interface) GetTotalBalance(opts *bind.CallOpts) (*big.Int, error) { ret := _m.Called(opts) @@ -1008,6 +1939,34 @@ func (_m *VRFCoordinatorV2Interface) GetTotalBalance(opts *bind.CallOpts) (*big. return r0, r1 } +// VRFCoordinatorV2Interface_GetTotalBalance_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetTotalBalance' +type VRFCoordinatorV2Interface_GetTotalBalance_Call struct { + *mock.Call +} + +// GetTotalBalance is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *VRFCoordinatorV2Interface_Expecter) GetTotalBalance(opts interface{}) *VRFCoordinatorV2Interface_GetTotalBalance_Call { + return &VRFCoordinatorV2Interface_GetTotalBalance_Call{Call: _e.mock.On("GetTotalBalance", opts)} +} + +func (_c *VRFCoordinatorV2Interface_GetTotalBalance_Call) Run(run func(opts *bind.CallOpts)) *VRFCoordinatorV2Interface_GetTotalBalance_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *VRFCoordinatorV2Interface_GetTotalBalance_Call) Return(_a0 *big.Int, _a1 error) *VRFCoordinatorV2Interface_GetTotalBalance_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *VRFCoordinatorV2Interface_GetTotalBalance_Call) RunAndReturn(run func(*bind.CallOpts) (*big.Int, error)) *VRFCoordinatorV2Interface_GetTotalBalance_Call { + _c.Call.Return(run) + return _c +} + // HashOfKey provides a mock function with given fields: opts, publicKey func (_m *VRFCoordinatorV2Interface) HashOfKey(opts *bind.CallOpts, publicKey [2]*big.Int) ([32]byte, error) { ret := _m.Called(opts, publicKey) @@ -1038,6 +1997,35 @@ func (_m *VRFCoordinatorV2Interface) HashOfKey(opts *bind.CallOpts, publicKey [2 return r0, r1 } +// VRFCoordinatorV2Interface_HashOfKey_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HashOfKey' +type VRFCoordinatorV2Interface_HashOfKey_Call struct { + *mock.Call +} + +// HashOfKey is a helper method to define mock.On call +// - opts *bind.CallOpts +// - publicKey [2]*big.Int +func (_e *VRFCoordinatorV2Interface_Expecter) HashOfKey(opts interface{}, publicKey interface{}) *VRFCoordinatorV2Interface_HashOfKey_Call { + return &VRFCoordinatorV2Interface_HashOfKey_Call{Call: _e.mock.On("HashOfKey", opts, publicKey)} +} + +func (_c *VRFCoordinatorV2Interface_HashOfKey_Call) Run(run func(opts *bind.CallOpts, publicKey [2]*big.Int)) *VRFCoordinatorV2Interface_HashOfKey_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts), args[1].([2]*big.Int)) + }) + return _c +} + +func (_c *VRFCoordinatorV2Interface_HashOfKey_Call) Return(_a0 [32]byte, _a1 error) *VRFCoordinatorV2Interface_HashOfKey_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *VRFCoordinatorV2Interface_HashOfKey_Call) RunAndReturn(run func(*bind.CallOpts, [2]*big.Int) ([32]byte, error)) *VRFCoordinatorV2Interface_HashOfKey_Call { + _c.Call.Return(run) + return _c +} + // LINK provides a mock function with given fields: opts func (_m *VRFCoordinatorV2Interface) LINK(opts *bind.CallOpts) (common.Address, error) { ret := _m.Called(opts) @@ -1068,6 +2056,34 @@ func (_m *VRFCoordinatorV2Interface) LINK(opts *bind.CallOpts) (common.Address, return r0, r1 } +// VRFCoordinatorV2Interface_LINK_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LINK' +type VRFCoordinatorV2Interface_LINK_Call struct { + *mock.Call +} + +// LINK is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *VRFCoordinatorV2Interface_Expecter) LINK(opts interface{}) *VRFCoordinatorV2Interface_LINK_Call { + return &VRFCoordinatorV2Interface_LINK_Call{Call: _e.mock.On("LINK", opts)} +} + +func (_c *VRFCoordinatorV2Interface_LINK_Call) Run(run func(opts *bind.CallOpts)) *VRFCoordinatorV2Interface_LINK_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *VRFCoordinatorV2Interface_LINK_Call) Return(_a0 common.Address, _a1 error) *VRFCoordinatorV2Interface_LINK_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *VRFCoordinatorV2Interface_LINK_Call) RunAndReturn(run func(*bind.CallOpts) (common.Address, error)) *VRFCoordinatorV2Interface_LINK_Call { + _c.Call.Return(run) + return _c +} + // LINKETHFEED provides a mock function with given fields: opts func (_m *VRFCoordinatorV2Interface) LINKETHFEED(opts *bind.CallOpts) (common.Address, error) { ret := _m.Called(opts) @@ -1098,6 +2114,34 @@ func (_m *VRFCoordinatorV2Interface) LINKETHFEED(opts *bind.CallOpts) (common.Ad return r0, r1 } +// VRFCoordinatorV2Interface_LINKETHFEED_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LINKETHFEED' +type VRFCoordinatorV2Interface_LINKETHFEED_Call struct { + *mock.Call +} + +// LINKETHFEED is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *VRFCoordinatorV2Interface_Expecter) LINKETHFEED(opts interface{}) *VRFCoordinatorV2Interface_LINKETHFEED_Call { + return &VRFCoordinatorV2Interface_LINKETHFEED_Call{Call: _e.mock.On("LINKETHFEED", opts)} +} + +func (_c *VRFCoordinatorV2Interface_LINKETHFEED_Call) Run(run func(opts *bind.CallOpts)) *VRFCoordinatorV2Interface_LINKETHFEED_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *VRFCoordinatorV2Interface_LINKETHFEED_Call) Return(_a0 common.Address, _a1 error) *VRFCoordinatorV2Interface_LINKETHFEED_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *VRFCoordinatorV2Interface_LINKETHFEED_Call) RunAndReturn(run func(*bind.CallOpts) (common.Address, error)) *VRFCoordinatorV2Interface_LINKETHFEED_Call { + _c.Call.Return(run) + return _c +} + // MAXCONSUMERS provides a mock function with given fields: opts func (_m *VRFCoordinatorV2Interface) MAXCONSUMERS(opts *bind.CallOpts) (uint16, error) { ret := _m.Called(opts) @@ -1126,6 +2170,34 @@ func (_m *VRFCoordinatorV2Interface) MAXCONSUMERS(opts *bind.CallOpts) (uint16, return r0, r1 } +// VRFCoordinatorV2Interface_MAXCONSUMERS_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MAXCONSUMERS' +type VRFCoordinatorV2Interface_MAXCONSUMERS_Call struct { + *mock.Call +} + +// MAXCONSUMERS is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *VRFCoordinatorV2Interface_Expecter) MAXCONSUMERS(opts interface{}) *VRFCoordinatorV2Interface_MAXCONSUMERS_Call { + return &VRFCoordinatorV2Interface_MAXCONSUMERS_Call{Call: _e.mock.On("MAXCONSUMERS", opts)} +} + +func (_c *VRFCoordinatorV2Interface_MAXCONSUMERS_Call) Run(run func(opts *bind.CallOpts)) *VRFCoordinatorV2Interface_MAXCONSUMERS_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *VRFCoordinatorV2Interface_MAXCONSUMERS_Call) Return(_a0 uint16, _a1 error) *VRFCoordinatorV2Interface_MAXCONSUMERS_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *VRFCoordinatorV2Interface_MAXCONSUMERS_Call) RunAndReturn(run func(*bind.CallOpts) (uint16, error)) *VRFCoordinatorV2Interface_MAXCONSUMERS_Call { + _c.Call.Return(run) + return _c +} + // MAXNUMWORDS provides a mock function with given fields: opts func (_m *VRFCoordinatorV2Interface) MAXNUMWORDS(opts *bind.CallOpts) (uint32, error) { ret := _m.Called(opts) @@ -1154,6 +2226,34 @@ func (_m *VRFCoordinatorV2Interface) MAXNUMWORDS(opts *bind.CallOpts) (uint32, e return r0, r1 } +// VRFCoordinatorV2Interface_MAXNUMWORDS_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MAXNUMWORDS' +type VRFCoordinatorV2Interface_MAXNUMWORDS_Call struct { + *mock.Call +} + +// MAXNUMWORDS is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *VRFCoordinatorV2Interface_Expecter) MAXNUMWORDS(opts interface{}) *VRFCoordinatorV2Interface_MAXNUMWORDS_Call { + return &VRFCoordinatorV2Interface_MAXNUMWORDS_Call{Call: _e.mock.On("MAXNUMWORDS", opts)} +} + +func (_c *VRFCoordinatorV2Interface_MAXNUMWORDS_Call) Run(run func(opts *bind.CallOpts)) *VRFCoordinatorV2Interface_MAXNUMWORDS_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *VRFCoordinatorV2Interface_MAXNUMWORDS_Call) Return(_a0 uint32, _a1 error) *VRFCoordinatorV2Interface_MAXNUMWORDS_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *VRFCoordinatorV2Interface_MAXNUMWORDS_Call) RunAndReturn(run func(*bind.CallOpts) (uint32, error)) *VRFCoordinatorV2Interface_MAXNUMWORDS_Call { + _c.Call.Return(run) + return _c +} + // MAXREQUESTCONFIRMATIONS provides a mock function with given fields: opts func (_m *VRFCoordinatorV2Interface) MAXREQUESTCONFIRMATIONS(opts *bind.CallOpts) (uint16, error) { ret := _m.Called(opts) @@ -1182,6 +2282,34 @@ func (_m *VRFCoordinatorV2Interface) MAXREQUESTCONFIRMATIONS(opts *bind.CallOpts return r0, r1 } +// VRFCoordinatorV2Interface_MAXREQUESTCONFIRMATIONS_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MAXREQUESTCONFIRMATIONS' +type VRFCoordinatorV2Interface_MAXREQUESTCONFIRMATIONS_Call struct { + *mock.Call +} + +// MAXREQUESTCONFIRMATIONS is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *VRFCoordinatorV2Interface_Expecter) MAXREQUESTCONFIRMATIONS(opts interface{}) *VRFCoordinatorV2Interface_MAXREQUESTCONFIRMATIONS_Call { + return &VRFCoordinatorV2Interface_MAXREQUESTCONFIRMATIONS_Call{Call: _e.mock.On("MAXREQUESTCONFIRMATIONS", opts)} +} + +func (_c *VRFCoordinatorV2Interface_MAXREQUESTCONFIRMATIONS_Call) Run(run func(opts *bind.CallOpts)) *VRFCoordinatorV2Interface_MAXREQUESTCONFIRMATIONS_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *VRFCoordinatorV2Interface_MAXREQUESTCONFIRMATIONS_Call) Return(_a0 uint16, _a1 error) *VRFCoordinatorV2Interface_MAXREQUESTCONFIRMATIONS_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *VRFCoordinatorV2Interface_MAXREQUESTCONFIRMATIONS_Call) RunAndReturn(run func(*bind.CallOpts) (uint16, error)) *VRFCoordinatorV2Interface_MAXREQUESTCONFIRMATIONS_Call { + _c.Call.Return(run) + return _c +} + // OnTokenTransfer provides a mock function with given fields: opts, arg0, amount, data func (_m *VRFCoordinatorV2Interface) OnTokenTransfer(opts *bind.TransactOpts, arg0 common.Address, amount *big.Int, data []byte) (*types.Transaction, error) { ret := _m.Called(opts, arg0, amount, data) @@ -1212,6 +2340,37 @@ func (_m *VRFCoordinatorV2Interface) OnTokenTransfer(opts *bind.TransactOpts, ar return r0, r1 } +// VRFCoordinatorV2Interface_OnTokenTransfer_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OnTokenTransfer' +type VRFCoordinatorV2Interface_OnTokenTransfer_Call struct { + *mock.Call +} + +// OnTokenTransfer is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - arg0 common.Address +// - amount *big.Int +// - data []byte +func (_e *VRFCoordinatorV2Interface_Expecter) OnTokenTransfer(opts interface{}, arg0 interface{}, amount interface{}, data interface{}) *VRFCoordinatorV2Interface_OnTokenTransfer_Call { + return &VRFCoordinatorV2Interface_OnTokenTransfer_Call{Call: _e.mock.On("OnTokenTransfer", opts, arg0, amount, data)} +} + +func (_c *VRFCoordinatorV2Interface_OnTokenTransfer_Call) Run(run func(opts *bind.TransactOpts, arg0 common.Address, amount *big.Int, data []byte)) *VRFCoordinatorV2Interface_OnTokenTransfer_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].(common.Address), args[2].(*big.Int), args[3].([]byte)) + }) + return _c +} + +func (_c *VRFCoordinatorV2Interface_OnTokenTransfer_Call) Return(_a0 *types.Transaction, _a1 error) *VRFCoordinatorV2Interface_OnTokenTransfer_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *VRFCoordinatorV2Interface_OnTokenTransfer_Call) RunAndReturn(run func(*bind.TransactOpts, common.Address, *big.Int, []byte) (*types.Transaction, error)) *VRFCoordinatorV2Interface_OnTokenTransfer_Call { + _c.Call.Return(run) + return _c +} + // OracleWithdraw provides a mock function with given fields: opts, recipient, amount func (_m *VRFCoordinatorV2Interface) OracleWithdraw(opts *bind.TransactOpts, recipient common.Address, amount *big.Int) (*types.Transaction, error) { ret := _m.Called(opts, recipient, amount) @@ -1242,6 +2401,36 @@ func (_m *VRFCoordinatorV2Interface) OracleWithdraw(opts *bind.TransactOpts, rec return r0, r1 } +// VRFCoordinatorV2Interface_OracleWithdraw_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OracleWithdraw' +type VRFCoordinatorV2Interface_OracleWithdraw_Call struct { + *mock.Call +} + +// OracleWithdraw is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - recipient common.Address +// - amount *big.Int +func (_e *VRFCoordinatorV2Interface_Expecter) OracleWithdraw(opts interface{}, recipient interface{}, amount interface{}) *VRFCoordinatorV2Interface_OracleWithdraw_Call { + return &VRFCoordinatorV2Interface_OracleWithdraw_Call{Call: _e.mock.On("OracleWithdraw", opts, recipient, amount)} +} + +func (_c *VRFCoordinatorV2Interface_OracleWithdraw_Call) Run(run func(opts *bind.TransactOpts, recipient common.Address, amount *big.Int)) *VRFCoordinatorV2Interface_OracleWithdraw_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].(common.Address), args[2].(*big.Int)) + }) + return _c +} + +func (_c *VRFCoordinatorV2Interface_OracleWithdraw_Call) Return(_a0 *types.Transaction, _a1 error) *VRFCoordinatorV2Interface_OracleWithdraw_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *VRFCoordinatorV2Interface_OracleWithdraw_Call) RunAndReturn(run func(*bind.TransactOpts, common.Address, *big.Int) (*types.Transaction, error)) *VRFCoordinatorV2Interface_OracleWithdraw_Call { + _c.Call.Return(run) + return _c +} + // Owner provides a mock function with given fields: opts func (_m *VRFCoordinatorV2Interface) Owner(opts *bind.CallOpts) (common.Address, error) { ret := _m.Called(opts) @@ -1272,6 +2461,34 @@ func (_m *VRFCoordinatorV2Interface) Owner(opts *bind.CallOpts) (common.Address, return r0, r1 } +// VRFCoordinatorV2Interface_Owner_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Owner' +type VRFCoordinatorV2Interface_Owner_Call struct { + *mock.Call +} + +// Owner is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *VRFCoordinatorV2Interface_Expecter) Owner(opts interface{}) *VRFCoordinatorV2Interface_Owner_Call { + return &VRFCoordinatorV2Interface_Owner_Call{Call: _e.mock.On("Owner", opts)} +} + +func (_c *VRFCoordinatorV2Interface_Owner_Call) Run(run func(opts *bind.CallOpts)) *VRFCoordinatorV2Interface_Owner_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *VRFCoordinatorV2Interface_Owner_Call) Return(_a0 common.Address, _a1 error) *VRFCoordinatorV2Interface_Owner_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *VRFCoordinatorV2Interface_Owner_Call) RunAndReturn(run func(*bind.CallOpts) (common.Address, error)) *VRFCoordinatorV2Interface_Owner_Call { + _c.Call.Return(run) + return _c +} + // OwnerCancelSubscription provides a mock function with given fields: opts, subId func (_m *VRFCoordinatorV2Interface) OwnerCancelSubscription(opts *bind.TransactOpts, subId uint64) (*types.Transaction, error) { ret := _m.Called(opts, subId) @@ -1302,6 +2519,35 @@ func (_m *VRFCoordinatorV2Interface) OwnerCancelSubscription(opts *bind.Transact return r0, r1 } +// VRFCoordinatorV2Interface_OwnerCancelSubscription_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OwnerCancelSubscription' +type VRFCoordinatorV2Interface_OwnerCancelSubscription_Call struct { + *mock.Call +} + +// OwnerCancelSubscription is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - subId uint64 +func (_e *VRFCoordinatorV2Interface_Expecter) OwnerCancelSubscription(opts interface{}, subId interface{}) *VRFCoordinatorV2Interface_OwnerCancelSubscription_Call { + return &VRFCoordinatorV2Interface_OwnerCancelSubscription_Call{Call: _e.mock.On("OwnerCancelSubscription", opts, subId)} +} + +func (_c *VRFCoordinatorV2Interface_OwnerCancelSubscription_Call) Run(run func(opts *bind.TransactOpts, subId uint64)) *VRFCoordinatorV2Interface_OwnerCancelSubscription_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].(uint64)) + }) + return _c +} + +func (_c *VRFCoordinatorV2Interface_OwnerCancelSubscription_Call) Return(_a0 *types.Transaction, _a1 error) *VRFCoordinatorV2Interface_OwnerCancelSubscription_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *VRFCoordinatorV2Interface_OwnerCancelSubscription_Call) RunAndReturn(run func(*bind.TransactOpts, uint64) (*types.Transaction, error)) *VRFCoordinatorV2Interface_OwnerCancelSubscription_Call { + _c.Call.Return(run) + return _c +} + // ParseConfigSet provides a mock function with given fields: log func (_m *VRFCoordinatorV2Interface) ParseConfigSet(log types.Log) (*vrf_coordinator_v2.VRFCoordinatorV2ConfigSet, error) { ret := _m.Called(log) @@ -1332,6 +2578,34 @@ func (_m *VRFCoordinatorV2Interface) ParseConfigSet(log types.Log) (*vrf_coordin return r0, r1 } +// VRFCoordinatorV2Interface_ParseConfigSet_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseConfigSet' +type VRFCoordinatorV2Interface_ParseConfigSet_Call struct { + *mock.Call +} + +// ParseConfigSet is a helper method to define mock.On call +// - log types.Log +func (_e *VRFCoordinatorV2Interface_Expecter) ParseConfigSet(log interface{}) *VRFCoordinatorV2Interface_ParseConfigSet_Call { + return &VRFCoordinatorV2Interface_ParseConfigSet_Call{Call: _e.mock.On("ParseConfigSet", log)} +} + +func (_c *VRFCoordinatorV2Interface_ParseConfigSet_Call) Run(run func(log types.Log)) *VRFCoordinatorV2Interface_ParseConfigSet_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *VRFCoordinatorV2Interface_ParseConfigSet_Call) Return(_a0 *vrf_coordinator_v2.VRFCoordinatorV2ConfigSet, _a1 error) *VRFCoordinatorV2Interface_ParseConfigSet_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *VRFCoordinatorV2Interface_ParseConfigSet_Call) RunAndReturn(run func(types.Log) (*vrf_coordinator_v2.VRFCoordinatorV2ConfigSet, error)) *VRFCoordinatorV2Interface_ParseConfigSet_Call { + _c.Call.Return(run) + return _c +} + // ParseFundsRecovered provides a mock function with given fields: log func (_m *VRFCoordinatorV2Interface) ParseFundsRecovered(log types.Log) (*vrf_coordinator_v2.VRFCoordinatorV2FundsRecovered, error) { ret := _m.Called(log) @@ -1362,6 +2636,34 @@ func (_m *VRFCoordinatorV2Interface) ParseFundsRecovered(log types.Log) (*vrf_co return r0, r1 } +// VRFCoordinatorV2Interface_ParseFundsRecovered_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseFundsRecovered' +type VRFCoordinatorV2Interface_ParseFundsRecovered_Call struct { + *mock.Call +} + +// ParseFundsRecovered is a helper method to define mock.On call +// - log types.Log +func (_e *VRFCoordinatorV2Interface_Expecter) ParseFundsRecovered(log interface{}) *VRFCoordinatorV2Interface_ParseFundsRecovered_Call { + return &VRFCoordinatorV2Interface_ParseFundsRecovered_Call{Call: _e.mock.On("ParseFundsRecovered", log)} +} + +func (_c *VRFCoordinatorV2Interface_ParseFundsRecovered_Call) Run(run func(log types.Log)) *VRFCoordinatorV2Interface_ParseFundsRecovered_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *VRFCoordinatorV2Interface_ParseFundsRecovered_Call) Return(_a0 *vrf_coordinator_v2.VRFCoordinatorV2FundsRecovered, _a1 error) *VRFCoordinatorV2Interface_ParseFundsRecovered_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *VRFCoordinatorV2Interface_ParseFundsRecovered_Call) RunAndReturn(run func(types.Log) (*vrf_coordinator_v2.VRFCoordinatorV2FundsRecovered, error)) *VRFCoordinatorV2Interface_ParseFundsRecovered_Call { + _c.Call.Return(run) + return _c +} + // ParseLog provides a mock function with given fields: log func (_m *VRFCoordinatorV2Interface) ParseLog(log types.Log) (generated.AbigenLog, error) { ret := _m.Called(log) @@ -1392,6 +2694,34 @@ func (_m *VRFCoordinatorV2Interface) ParseLog(log types.Log) (generated.AbigenLo return r0, r1 } +// VRFCoordinatorV2Interface_ParseLog_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseLog' +type VRFCoordinatorV2Interface_ParseLog_Call struct { + *mock.Call +} + +// ParseLog is a helper method to define mock.On call +// - log types.Log +func (_e *VRFCoordinatorV2Interface_Expecter) ParseLog(log interface{}) *VRFCoordinatorV2Interface_ParseLog_Call { + return &VRFCoordinatorV2Interface_ParseLog_Call{Call: _e.mock.On("ParseLog", log)} +} + +func (_c *VRFCoordinatorV2Interface_ParseLog_Call) Run(run func(log types.Log)) *VRFCoordinatorV2Interface_ParseLog_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *VRFCoordinatorV2Interface_ParseLog_Call) Return(_a0 generated.AbigenLog, _a1 error) *VRFCoordinatorV2Interface_ParseLog_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *VRFCoordinatorV2Interface_ParseLog_Call) RunAndReturn(run func(types.Log) (generated.AbigenLog, error)) *VRFCoordinatorV2Interface_ParseLog_Call { + _c.Call.Return(run) + return _c +} + // ParseOwnershipTransferRequested provides a mock function with given fields: log func (_m *VRFCoordinatorV2Interface) ParseOwnershipTransferRequested(log types.Log) (*vrf_coordinator_v2.VRFCoordinatorV2OwnershipTransferRequested, error) { ret := _m.Called(log) @@ -1422,6 +2752,34 @@ func (_m *VRFCoordinatorV2Interface) ParseOwnershipTransferRequested(log types.L return r0, r1 } +// VRFCoordinatorV2Interface_ParseOwnershipTransferRequested_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseOwnershipTransferRequested' +type VRFCoordinatorV2Interface_ParseOwnershipTransferRequested_Call struct { + *mock.Call +} + +// ParseOwnershipTransferRequested is a helper method to define mock.On call +// - log types.Log +func (_e *VRFCoordinatorV2Interface_Expecter) ParseOwnershipTransferRequested(log interface{}) *VRFCoordinatorV2Interface_ParseOwnershipTransferRequested_Call { + return &VRFCoordinatorV2Interface_ParseOwnershipTransferRequested_Call{Call: _e.mock.On("ParseOwnershipTransferRequested", log)} +} + +func (_c *VRFCoordinatorV2Interface_ParseOwnershipTransferRequested_Call) Run(run func(log types.Log)) *VRFCoordinatorV2Interface_ParseOwnershipTransferRequested_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *VRFCoordinatorV2Interface_ParseOwnershipTransferRequested_Call) Return(_a0 *vrf_coordinator_v2.VRFCoordinatorV2OwnershipTransferRequested, _a1 error) *VRFCoordinatorV2Interface_ParseOwnershipTransferRequested_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *VRFCoordinatorV2Interface_ParseOwnershipTransferRequested_Call) RunAndReturn(run func(types.Log) (*vrf_coordinator_v2.VRFCoordinatorV2OwnershipTransferRequested, error)) *VRFCoordinatorV2Interface_ParseOwnershipTransferRequested_Call { + _c.Call.Return(run) + return _c +} + // ParseOwnershipTransferred provides a mock function with given fields: log func (_m *VRFCoordinatorV2Interface) ParseOwnershipTransferred(log types.Log) (*vrf_coordinator_v2.VRFCoordinatorV2OwnershipTransferred, error) { ret := _m.Called(log) @@ -1452,6 +2810,34 @@ func (_m *VRFCoordinatorV2Interface) ParseOwnershipTransferred(log types.Log) (* return r0, r1 } +// VRFCoordinatorV2Interface_ParseOwnershipTransferred_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseOwnershipTransferred' +type VRFCoordinatorV2Interface_ParseOwnershipTransferred_Call struct { + *mock.Call +} + +// ParseOwnershipTransferred is a helper method to define mock.On call +// - log types.Log +func (_e *VRFCoordinatorV2Interface_Expecter) ParseOwnershipTransferred(log interface{}) *VRFCoordinatorV2Interface_ParseOwnershipTransferred_Call { + return &VRFCoordinatorV2Interface_ParseOwnershipTransferred_Call{Call: _e.mock.On("ParseOwnershipTransferred", log)} +} + +func (_c *VRFCoordinatorV2Interface_ParseOwnershipTransferred_Call) Run(run func(log types.Log)) *VRFCoordinatorV2Interface_ParseOwnershipTransferred_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *VRFCoordinatorV2Interface_ParseOwnershipTransferred_Call) Return(_a0 *vrf_coordinator_v2.VRFCoordinatorV2OwnershipTransferred, _a1 error) *VRFCoordinatorV2Interface_ParseOwnershipTransferred_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *VRFCoordinatorV2Interface_ParseOwnershipTransferred_Call) RunAndReturn(run func(types.Log) (*vrf_coordinator_v2.VRFCoordinatorV2OwnershipTransferred, error)) *VRFCoordinatorV2Interface_ParseOwnershipTransferred_Call { + _c.Call.Return(run) + return _c +} + // ParseProvingKeyDeregistered provides a mock function with given fields: log func (_m *VRFCoordinatorV2Interface) ParseProvingKeyDeregistered(log types.Log) (*vrf_coordinator_v2.VRFCoordinatorV2ProvingKeyDeregistered, error) { ret := _m.Called(log) @@ -1482,6 +2868,34 @@ func (_m *VRFCoordinatorV2Interface) ParseProvingKeyDeregistered(log types.Log) return r0, r1 } +// VRFCoordinatorV2Interface_ParseProvingKeyDeregistered_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseProvingKeyDeregistered' +type VRFCoordinatorV2Interface_ParseProvingKeyDeregistered_Call struct { + *mock.Call +} + +// ParseProvingKeyDeregistered is a helper method to define mock.On call +// - log types.Log +func (_e *VRFCoordinatorV2Interface_Expecter) ParseProvingKeyDeregistered(log interface{}) *VRFCoordinatorV2Interface_ParseProvingKeyDeregistered_Call { + return &VRFCoordinatorV2Interface_ParseProvingKeyDeregistered_Call{Call: _e.mock.On("ParseProvingKeyDeregistered", log)} +} + +func (_c *VRFCoordinatorV2Interface_ParseProvingKeyDeregistered_Call) Run(run func(log types.Log)) *VRFCoordinatorV2Interface_ParseProvingKeyDeregistered_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *VRFCoordinatorV2Interface_ParseProvingKeyDeregistered_Call) Return(_a0 *vrf_coordinator_v2.VRFCoordinatorV2ProvingKeyDeregistered, _a1 error) *VRFCoordinatorV2Interface_ParseProvingKeyDeregistered_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *VRFCoordinatorV2Interface_ParseProvingKeyDeregistered_Call) RunAndReturn(run func(types.Log) (*vrf_coordinator_v2.VRFCoordinatorV2ProvingKeyDeregistered, error)) *VRFCoordinatorV2Interface_ParseProvingKeyDeregistered_Call { + _c.Call.Return(run) + return _c +} + // ParseProvingKeyRegistered provides a mock function with given fields: log func (_m *VRFCoordinatorV2Interface) ParseProvingKeyRegistered(log types.Log) (*vrf_coordinator_v2.VRFCoordinatorV2ProvingKeyRegistered, error) { ret := _m.Called(log) @@ -1512,6 +2926,34 @@ func (_m *VRFCoordinatorV2Interface) ParseProvingKeyRegistered(log types.Log) (* return r0, r1 } +// VRFCoordinatorV2Interface_ParseProvingKeyRegistered_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseProvingKeyRegistered' +type VRFCoordinatorV2Interface_ParseProvingKeyRegistered_Call struct { + *mock.Call +} + +// ParseProvingKeyRegistered is a helper method to define mock.On call +// - log types.Log +func (_e *VRFCoordinatorV2Interface_Expecter) ParseProvingKeyRegistered(log interface{}) *VRFCoordinatorV2Interface_ParseProvingKeyRegistered_Call { + return &VRFCoordinatorV2Interface_ParseProvingKeyRegistered_Call{Call: _e.mock.On("ParseProvingKeyRegistered", log)} +} + +func (_c *VRFCoordinatorV2Interface_ParseProvingKeyRegistered_Call) Run(run func(log types.Log)) *VRFCoordinatorV2Interface_ParseProvingKeyRegistered_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *VRFCoordinatorV2Interface_ParseProvingKeyRegistered_Call) Return(_a0 *vrf_coordinator_v2.VRFCoordinatorV2ProvingKeyRegistered, _a1 error) *VRFCoordinatorV2Interface_ParseProvingKeyRegistered_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *VRFCoordinatorV2Interface_ParseProvingKeyRegistered_Call) RunAndReturn(run func(types.Log) (*vrf_coordinator_v2.VRFCoordinatorV2ProvingKeyRegistered, error)) *VRFCoordinatorV2Interface_ParseProvingKeyRegistered_Call { + _c.Call.Return(run) + return _c +} + // ParseRandomWordsFulfilled provides a mock function with given fields: log func (_m *VRFCoordinatorV2Interface) ParseRandomWordsFulfilled(log types.Log) (*vrf_coordinator_v2.VRFCoordinatorV2RandomWordsFulfilled, error) { ret := _m.Called(log) @@ -1542,9 +2984,37 @@ func (_m *VRFCoordinatorV2Interface) ParseRandomWordsFulfilled(log types.Log) (* return r0, r1 } -// ParseRandomWordsRequested provides a mock function with given fields: log -func (_m *VRFCoordinatorV2Interface) ParseRandomWordsRequested(log types.Log) (*vrf_coordinator_v2.VRFCoordinatorV2RandomWordsRequested, error) { - ret := _m.Called(log) +// VRFCoordinatorV2Interface_ParseRandomWordsFulfilled_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseRandomWordsFulfilled' +type VRFCoordinatorV2Interface_ParseRandomWordsFulfilled_Call struct { + *mock.Call +} + +// ParseRandomWordsFulfilled is a helper method to define mock.On call +// - log types.Log +func (_e *VRFCoordinatorV2Interface_Expecter) ParseRandomWordsFulfilled(log interface{}) *VRFCoordinatorV2Interface_ParseRandomWordsFulfilled_Call { + return &VRFCoordinatorV2Interface_ParseRandomWordsFulfilled_Call{Call: _e.mock.On("ParseRandomWordsFulfilled", log)} +} + +func (_c *VRFCoordinatorV2Interface_ParseRandomWordsFulfilled_Call) Run(run func(log types.Log)) *VRFCoordinatorV2Interface_ParseRandomWordsFulfilled_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *VRFCoordinatorV2Interface_ParseRandomWordsFulfilled_Call) Return(_a0 *vrf_coordinator_v2.VRFCoordinatorV2RandomWordsFulfilled, _a1 error) *VRFCoordinatorV2Interface_ParseRandomWordsFulfilled_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *VRFCoordinatorV2Interface_ParseRandomWordsFulfilled_Call) RunAndReturn(run func(types.Log) (*vrf_coordinator_v2.VRFCoordinatorV2RandomWordsFulfilled, error)) *VRFCoordinatorV2Interface_ParseRandomWordsFulfilled_Call { + _c.Call.Return(run) + return _c +} + +// ParseRandomWordsRequested provides a mock function with given fields: log +func (_m *VRFCoordinatorV2Interface) ParseRandomWordsRequested(log types.Log) (*vrf_coordinator_v2.VRFCoordinatorV2RandomWordsRequested, error) { + ret := _m.Called(log) if len(ret) == 0 { panic("no return value specified for ParseRandomWordsRequested") @@ -1572,6 +3042,34 @@ func (_m *VRFCoordinatorV2Interface) ParseRandomWordsRequested(log types.Log) (* return r0, r1 } +// VRFCoordinatorV2Interface_ParseRandomWordsRequested_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseRandomWordsRequested' +type VRFCoordinatorV2Interface_ParseRandomWordsRequested_Call struct { + *mock.Call +} + +// ParseRandomWordsRequested is a helper method to define mock.On call +// - log types.Log +func (_e *VRFCoordinatorV2Interface_Expecter) ParseRandomWordsRequested(log interface{}) *VRFCoordinatorV2Interface_ParseRandomWordsRequested_Call { + return &VRFCoordinatorV2Interface_ParseRandomWordsRequested_Call{Call: _e.mock.On("ParseRandomWordsRequested", log)} +} + +func (_c *VRFCoordinatorV2Interface_ParseRandomWordsRequested_Call) Run(run func(log types.Log)) *VRFCoordinatorV2Interface_ParseRandomWordsRequested_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *VRFCoordinatorV2Interface_ParseRandomWordsRequested_Call) Return(_a0 *vrf_coordinator_v2.VRFCoordinatorV2RandomWordsRequested, _a1 error) *VRFCoordinatorV2Interface_ParseRandomWordsRequested_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *VRFCoordinatorV2Interface_ParseRandomWordsRequested_Call) RunAndReturn(run func(types.Log) (*vrf_coordinator_v2.VRFCoordinatorV2RandomWordsRequested, error)) *VRFCoordinatorV2Interface_ParseRandomWordsRequested_Call { + _c.Call.Return(run) + return _c +} + // ParseSubscriptionCanceled provides a mock function with given fields: log func (_m *VRFCoordinatorV2Interface) ParseSubscriptionCanceled(log types.Log) (*vrf_coordinator_v2.VRFCoordinatorV2SubscriptionCanceled, error) { ret := _m.Called(log) @@ -1602,6 +3100,34 @@ func (_m *VRFCoordinatorV2Interface) ParseSubscriptionCanceled(log types.Log) (* return r0, r1 } +// VRFCoordinatorV2Interface_ParseSubscriptionCanceled_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseSubscriptionCanceled' +type VRFCoordinatorV2Interface_ParseSubscriptionCanceled_Call struct { + *mock.Call +} + +// ParseSubscriptionCanceled is a helper method to define mock.On call +// - log types.Log +func (_e *VRFCoordinatorV2Interface_Expecter) ParseSubscriptionCanceled(log interface{}) *VRFCoordinatorV2Interface_ParseSubscriptionCanceled_Call { + return &VRFCoordinatorV2Interface_ParseSubscriptionCanceled_Call{Call: _e.mock.On("ParseSubscriptionCanceled", log)} +} + +func (_c *VRFCoordinatorV2Interface_ParseSubscriptionCanceled_Call) Run(run func(log types.Log)) *VRFCoordinatorV2Interface_ParseSubscriptionCanceled_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *VRFCoordinatorV2Interface_ParseSubscriptionCanceled_Call) Return(_a0 *vrf_coordinator_v2.VRFCoordinatorV2SubscriptionCanceled, _a1 error) *VRFCoordinatorV2Interface_ParseSubscriptionCanceled_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *VRFCoordinatorV2Interface_ParseSubscriptionCanceled_Call) RunAndReturn(run func(types.Log) (*vrf_coordinator_v2.VRFCoordinatorV2SubscriptionCanceled, error)) *VRFCoordinatorV2Interface_ParseSubscriptionCanceled_Call { + _c.Call.Return(run) + return _c +} + // ParseSubscriptionConsumerAdded provides a mock function with given fields: log func (_m *VRFCoordinatorV2Interface) ParseSubscriptionConsumerAdded(log types.Log) (*vrf_coordinator_v2.VRFCoordinatorV2SubscriptionConsumerAdded, error) { ret := _m.Called(log) @@ -1632,6 +3158,34 @@ func (_m *VRFCoordinatorV2Interface) ParseSubscriptionConsumerAdded(log types.Lo return r0, r1 } +// VRFCoordinatorV2Interface_ParseSubscriptionConsumerAdded_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseSubscriptionConsumerAdded' +type VRFCoordinatorV2Interface_ParseSubscriptionConsumerAdded_Call struct { + *mock.Call +} + +// ParseSubscriptionConsumerAdded is a helper method to define mock.On call +// - log types.Log +func (_e *VRFCoordinatorV2Interface_Expecter) ParseSubscriptionConsumerAdded(log interface{}) *VRFCoordinatorV2Interface_ParseSubscriptionConsumerAdded_Call { + return &VRFCoordinatorV2Interface_ParseSubscriptionConsumerAdded_Call{Call: _e.mock.On("ParseSubscriptionConsumerAdded", log)} +} + +func (_c *VRFCoordinatorV2Interface_ParseSubscriptionConsumerAdded_Call) Run(run func(log types.Log)) *VRFCoordinatorV2Interface_ParseSubscriptionConsumerAdded_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *VRFCoordinatorV2Interface_ParseSubscriptionConsumerAdded_Call) Return(_a0 *vrf_coordinator_v2.VRFCoordinatorV2SubscriptionConsumerAdded, _a1 error) *VRFCoordinatorV2Interface_ParseSubscriptionConsumerAdded_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *VRFCoordinatorV2Interface_ParseSubscriptionConsumerAdded_Call) RunAndReturn(run func(types.Log) (*vrf_coordinator_v2.VRFCoordinatorV2SubscriptionConsumerAdded, error)) *VRFCoordinatorV2Interface_ParseSubscriptionConsumerAdded_Call { + _c.Call.Return(run) + return _c +} + // ParseSubscriptionConsumerRemoved provides a mock function with given fields: log func (_m *VRFCoordinatorV2Interface) ParseSubscriptionConsumerRemoved(log types.Log) (*vrf_coordinator_v2.VRFCoordinatorV2SubscriptionConsumerRemoved, error) { ret := _m.Called(log) @@ -1662,6 +3216,34 @@ func (_m *VRFCoordinatorV2Interface) ParseSubscriptionConsumerRemoved(log types. return r0, r1 } +// VRFCoordinatorV2Interface_ParseSubscriptionConsumerRemoved_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseSubscriptionConsumerRemoved' +type VRFCoordinatorV2Interface_ParseSubscriptionConsumerRemoved_Call struct { + *mock.Call +} + +// ParseSubscriptionConsumerRemoved is a helper method to define mock.On call +// - log types.Log +func (_e *VRFCoordinatorV2Interface_Expecter) ParseSubscriptionConsumerRemoved(log interface{}) *VRFCoordinatorV2Interface_ParseSubscriptionConsumerRemoved_Call { + return &VRFCoordinatorV2Interface_ParseSubscriptionConsumerRemoved_Call{Call: _e.mock.On("ParseSubscriptionConsumerRemoved", log)} +} + +func (_c *VRFCoordinatorV2Interface_ParseSubscriptionConsumerRemoved_Call) Run(run func(log types.Log)) *VRFCoordinatorV2Interface_ParseSubscriptionConsumerRemoved_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *VRFCoordinatorV2Interface_ParseSubscriptionConsumerRemoved_Call) Return(_a0 *vrf_coordinator_v2.VRFCoordinatorV2SubscriptionConsumerRemoved, _a1 error) *VRFCoordinatorV2Interface_ParseSubscriptionConsumerRemoved_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *VRFCoordinatorV2Interface_ParseSubscriptionConsumerRemoved_Call) RunAndReturn(run func(types.Log) (*vrf_coordinator_v2.VRFCoordinatorV2SubscriptionConsumerRemoved, error)) *VRFCoordinatorV2Interface_ParseSubscriptionConsumerRemoved_Call { + _c.Call.Return(run) + return _c +} + // ParseSubscriptionCreated provides a mock function with given fields: log func (_m *VRFCoordinatorV2Interface) ParseSubscriptionCreated(log types.Log) (*vrf_coordinator_v2.VRFCoordinatorV2SubscriptionCreated, error) { ret := _m.Called(log) @@ -1692,6 +3274,34 @@ func (_m *VRFCoordinatorV2Interface) ParseSubscriptionCreated(log types.Log) (*v return r0, r1 } +// VRFCoordinatorV2Interface_ParseSubscriptionCreated_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseSubscriptionCreated' +type VRFCoordinatorV2Interface_ParseSubscriptionCreated_Call struct { + *mock.Call +} + +// ParseSubscriptionCreated is a helper method to define mock.On call +// - log types.Log +func (_e *VRFCoordinatorV2Interface_Expecter) ParseSubscriptionCreated(log interface{}) *VRFCoordinatorV2Interface_ParseSubscriptionCreated_Call { + return &VRFCoordinatorV2Interface_ParseSubscriptionCreated_Call{Call: _e.mock.On("ParseSubscriptionCreated", log)} +} + +func (_c *VRFCoordinatorV2Interface_ParseSubscriptionCreated_Call) Run(run func(log types.Log)) *VRFCoordinatorV2Interface_ParseSubscriptionCreated_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *VRFCoordinatorV2Interface_ParseSubscriptionCreated_Call) Return(_a0 *vrf_coordinator_v2.VRFCoordinatorV2SubscriptionCreated, _a1 error) *VRFCoordinatorV2Interface_ParseSubscriptionCreated_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *VRFCoordinatorV2Interface_ParseSubscriptionCreated_Call) RunAndReturn(run func(types.Log) (*vrf_coordinator_v2.VRFCoordinatorV2SubscriptionCreated, error)) *VRFCoordinatorV2Interface_ParseSubscriptionCreated_Call { + _c.Call.Return(run) + return _c +} + // ParseSubscriptionFunded provides a mock function with given fields: log func (_m *VRFCoordinatorV2Interface) ParseSubscriptionFunded(log types.Log) (*vrf_coordinator_v2.VRFCoordinatorV2SubscriptionFunded, error) { ret := _m.Called(log) @@ -1722,6 +3332,34 @@ func (_m *VRFCoordinatorV2Interface) ParseSubscriptionFunded(log types.Log) (*vr return r0, r1 } +// VRFCoordinatorV2Interface_ParseSubscriptionFunded_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseSubscriptionFunded' +type VRFCoordinatorV2Interface_ParseSubscriptionFunded_Call struct { + *mock.Call +} + +// ParseSubscriptionFunded is a helper method to define mock.On call +// - log types.Log +func (_e *VRFCoordinatorV2Interface_Expecter) ParseSubscriptionFunded(log interface{}) *VRFCoordinatorV2Interface_ParseSubscriptionFunded_Call { + return &VRFCoordinatorV2Interface_ParseSubscriptionFunded_Call{Call: _e.mock.On("ParseSubscriptionFunded", log)} +} + +func (_c *VRFCoordinatorV2Interface_ParseSubscriptionFunded_Call) Run(run func(log types.Log)) *VRFCoordinatorV2Interface_ParseSubscriptionFunded_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *VRFCoordinatorV2Interface_ParseSubscriptionFunded_Call) Return(_a0 *vrf_coordinator_v2.VRFCoordinatorV2SubscriptionFunded, _a1 error) *VRFCoordinatorV2Interface_ParseSubscriptionFunded_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *VRFCoordinatorV2Interface_ParseSubscriptionFunded_Call) RunAndReturn(run func(types.Log) (*vrf_coordinator_v2.VRFCoordinatorV2SubscriptionFunded, error)) *VRFCoordinatorV2Interface_ParseSubscriptionFunded_Call { + _c.Call.Return(run) + return _c +} + // ParseSubscriptionOwnerTransferRequested provides a mock function with given fields: log func (_m *VRFCoordinatorV2Interface) ParseSubscriptionOwnerTransferRequested(log types.Log) (*vrf_coordinator_v2.VRFCoordinatorV2SubscriptionOwnerTransferRequested, error) { ret := _m.Called(log) @@ -1752,6 +3390,34 @@ func (_m *VRFCoordinatorV2Interface) ParseSubscriptionOwnerTransferRequested(log return r0, r1 } +// VRFCoordinatorV2Interface_ParseSubscriptionOwnerTransferRequested_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseSubscriptionOwnerTransferRequested' +type VRFCoordinatorV2Interface_ParseSubscriptionOwnerTransferRequested_Call struct { + *mock.Call +} + +// ParseSubscriptionOwnerTransferRequested is a helper method to define mock.On call +// - log types.Log +func (_e *VRFCoordinatorV2Interface_Expecter) ParseSubscriptionOwnerTransferRequested(log interface{}) *VRFCoordinatorV2Interface_ParseSubscriptionOwnerTransferRequested_Call { + return &VRFCoordinatorV2Interface_ParseSubscriptionOwnerTransferRequested_Call{Call: _e.mock.On("ParseSubscriptionOwnerTransferRequested", log)} +} + +func (_c *VRFCoordinatorV2Interface_ParseSubscriptionOwnerTransferRequested_Call) Run(run func(log types.Log)) *VRFCoordinatorV2Interface_ParseSubscriptionOwnerTransferRequested_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *VRFCoordinatorV2Interface_ParseSubscriptionOwnerTransferRequested_Call) Return(_a0 *vrf_coordinator_v2.VRFCoordinatorV2SubscriptionOwnerTransferRequested, _a1 error) *VRFCoordinatorV2Interface_ParseSubscriptionOwnerTransferRequested_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *VRFCoordinatorV2Interface_ParseSubscriptionOwnerTransferRequested_Call) RunAndReturn(run func(types.Log) (*vrf_coordinator_v2.VRFCoordinatorV2SubscriptionOwnerTransferRequested, error)) *VRFCoordinatorV2Interface_ParseSubscriptionOwnerTransferRequested_Call { + _c.Call.Return(run) + return _c +} + // ParseSubscriptionOwnerTransferred provides a mock function with given fields: log func (_m *VRFCoordinatorV2Interface) ParseSubscriptionOwnerTransferred(log types.Log) (*vrf_coordinator_v2.VRFCoordinatorV2SubscriptionOwnerTransferred, error) { ret := _m.Called(log) @@ -1782,6 +3448,34 @@ func (_m *VRFCoordinatorV2Interface) ParseSubscriptionOwnerTransferred(log types return r0, r1 } +// VRFCoordinatorV2Interface_ParseSubscriptionOwnerTransferred_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseSubscriptionOwnerTransferred' +type VRFCoordinatorV2Interface_ParseSubscriptionOwnerTransferred_Call struct { + *mock.Call +} + +// ParseSubscriptionOwnerTransferred is a helper method to define mock.On call +// - log types.Log +func (_e *VRFCoordinatorV2Interface_Expecter) ParseSubscriptionOwnerTransferred(log interface{}) *VRFCoordinatorV2Interface_ParseSubscriptionOwnerTransferred_Call { + return &VRFCoordinatorV2Interface_ParseSubscriptionOwnerTransferred_Call{Call: _e.mock.On("ParseSubscriptionOwnerTransferred", log)} +} + +func (_c *VRFCoordinatorV2Interface_ParseSubscriptionOwnerTransferred_Call) Run(run func(log types.Log)) *VRFCoordinatorV2Interface_ParseSubscriptionOwnerTransferred_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Log)) + }) + return _c +} + +func (_c *VRFCoordinatorV2Interface_ParseSubscriptionOwnerTransferred_Call) Return(_a0 *vrf_coordinator_v2.VRFCoordinatorV2SubscriptionOwnerTransferred, _a1 error) *VRFCoordinatorV2Interface_ParseSubscriptionOwnerTransferred_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *VRFCoordinatorV2Interface_ParseSubscriptionOwnerTransferred_Call) RunAndReturn(run func(types.Log) (*vrf_coordinator_v2.VRFCoordinatorV2SubscriptionOwnerTransferred, error)) *VRFCoordinatorV2Interface_ParseSubscriptionOwnerTransferred_Call { + _c.Call.Return(run) + return _c +} + // PendingRequestExists provides a mock function with given fields: opts, subId func (_m *VRFCoordinatorV2Interface) PendingRequestExists(opts *bind.CallOpts, subId uint64) (bool, error) { ret := _m.Called(opts, subId) @@ -1810,6 +3504,35 @@ func (_m *VRFCoordinatorV2Interface) PendingRequestExists(opts *bind.CallOpts, s return r0, r1 } +// VRFCoordinatorV2Interface_PendingRequestExists_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PendingRequestExists' +type VRFCoordinatorV2Interface_PendingRequestExists_Call struct { + *mock.Call +} + +// PendingRequestExists is a helper method to define mock.On call +// - opts *bind.CallOpts +// - subId uint64 +func (_e *VRFCoordinatorV2Interface_Expecter) PendingRequestExists(opts interface{}, subId interface{}) *VRFCoordinatorV2Interface_PendingRequestExists_Call { + return &VRFCoordinatorV2Interface_PendingRequestExists_Call{Call: _e.mock.On("PendingRequestExists", opts, subId)} +} + +func (_c *VRFCoordinatorV2Interface_PendingRequestExists_Call) Run(run func(opts *bind.CallOpts, subId uint64)) *VRFCoordinatorV2Interface_PendingRequestExists_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts), args[1].(uint64)) + }) + return _c +} + +func (_c *VRFCoordinatorV2Interface_PendingRequestExists_Call) Return(_a0 bool, _a1 error) *VRFCoordinatorV2Interface_PendingRequestExists_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *VRFCoordinatorV2Interface_PendingRequestExists_Call) RunAndReturn(run func(*bind.CallOpts, uint64) (bool, error)) *VRFCoordinatorV2Interface_PendingRequestExists_Call { + _c.Call.Return(run) + return _c +} + // RecoverFunds provides a mock function with given fields: opts, to func (_m *VRFCoordinatorV2Interface) RecoverFunds(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) { ret := _m.Called(opts, to) @@ -1840,6 +3563,35 @@ func (_m *VRFCoordinatorV2Interface) RecoverFunds(opts *bind.TransactOpts, to co return r0, r1 } +// VRFCoordinatorV2Interface_RecoverFunds_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RecoverFunds' +type VRFCoordinatorV2Interface_RecoverFunds_Call struct { + *mock.Call +} + +// RecoverFunds is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - to common.Address +func (_e *VRFCoordinatorV2Interface_Expecter) RecoverFunds(opts interface{}, to interface{}) *VRFCoordinatorV2Interface_RecoverFunds_Call { + return &VRFCoordinatorV2Interface_RecoverFunds_Call{Call: _e.mock.On("RecoverFunds", opts, to)} +} + +func (_c *VRFCoordinatorV2Interface_RecoverFunds_Call) Run(run func(opts *bind.TransactOpts, to common.Address)) *VRFCoordinatorV2Interface_RecoverFunds_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].(common.Address)) + }) + return _c +} + +func (_c *VRFCoordinatorV2Interface_RecoverFunds_Call) Return(_a0 *types.Transaction, _a1 error) *VRFCoordinatorV2Interface_RecoverFunds_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *VRFCoordinatorV2Interface_RecoverFunds_Call) RunAndReturn(run func(*bind.TransactOpts, common.Address) (*types.Transaction, error)) *VRFCoordinatorV2Interface_RecoverFunds_Call { + _c.Call.Return(run) + return _c +} + // RegisterProvingKey provides a mock function with given fields: opts, oracle, publicProvingKey func (_m *VRFCoordinatorV2Interface) RegisterProvingKey(opts *bind.TransactOpts, oracle common.Address, publicProvingKey [2]*big.Int) (*types.Transaction, error) { ret := _m.Called(opts, oracle, publicProvingKey) @@ -1870,6 +3622,36 @@ func (_m *VRFCoordinatorV2Interface) RegisterProvingKey(opts *bind.TransactOpts, return r0, r1 } +// VRFCoordinatorV2Interface_RegisterProvingKey_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RegisterProvingKey' +type VRFCoordinatorV2Interface_RegisterProvingKey_Call struct { + *mock.Call +} + +// RegisterProvingKey is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - oracle common.Address +// - publicProvingKey [2]*big.Int +func (_e *VRFCoordinatorV2Interface_Expecter) RegisterProvingKey(opts interface{}, oracle interface{}, publicProvingKey interface{}) *VRFCoordinatorV2Interface_RegisterProvingKey_Call { + return &VRFCoordinatorV2Interface_RegisterProvingKey_Call{Call: _e.mock.On("RegisterProvingKey", opts, oracle, publicProvingKey)} +} + +func (_c *VRFCoordinatorV2Interface_RegisterProvingKey_Call) Run(run func(opts *bind.TransactOpts, oracle common.Address, publicProvingKey [2]*big.Int)) *VRFCoordinatorV2Interface_RegisterProvingKey_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].(common.Address), args[2].([2]*big.Int)) + }) + return _c +} + +func (_c *VRFCoordinatorV2Interface_RegisterProvingKey_Call) Return(_a0 *types.Transaction, _a1 error) *VRFCoordinatorV2Interface_RegisterProvingKey_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *VRFCoordinatorV2Interface_RegisterProvingKey_Call) RunAndReturn(run func(*bind.TransactOpts, common.Address, [2]*big.Int) (*types.Transaction, error)) *VRFCoordinatorV2Interface_RegisterProvingKey_Call { + _c.Call.Return(run) + return _c +} + // RemoveConsumer provides a mock function with given fields: opts, subId, consumer func (_m *VRFCoordinatorV2Interface) RemoveConsumer(opts *bind.TransactOpts, subId uint64, consumer common.Address) (*types.Transaction, error) { ret := _m.Called(opts, subId, consumer) @@ -1900,6 +3682,36 @@ func (_m *VRFCoordinatorV2Interface) RemoveConsumer(opts *bind.TransactOpts, sub return r0, r1 } +// VRFCoordinatorV2Interface_RemoveConsumer_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveConsumer' +type VRFCoordinatorV2Interface_RemoveConsumer_Call struct { + *mock.Call +} + +// RemoveConsumer is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - subId uint64 +// - consumer common.Address +func (_e *VRFCoordinatorV2Interface_Expecter) RemoveConsumer(opts interface{}, subId interface{}, consumer interface{}) *VRFCoordinatorV2Interface_RemoveConsumer_Call { + return &VRFCoordinatorV2Interface_RemoveConsumer_Call{Call: _e.mock.On("RemoveConsumer", opts, subId, consumer)} +} + +func (_c *VRFCoordinatorV2Interface_RemoveConsumer_Call) Run(run func(opts *bind.TransactOpts, subId uint64, consumer common.Address)) *VRFCoordinatorV2Interface_RemoveConsumer_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].(uint64), args[2].(common.Address)) + }) + return _c +} + +func (_c *VRFCoordinatorV2Interface_RemoveConsumer_Call) Return(_a0 *types.Transaction, _a1 error) *VRFCoordinatorV2Interface_RemoveConsumer_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *VRFCoordinatorV2Interface_RemoveConsumer_Call) RunAndReturn(run func(*bind.TransactOpts, uint64, common.Address) (*types.Transaction, error)) *VRFCoordinatorV2Interface_RemoveConsumer_Call { + _c.Call.Return(run) + return _c +} + // RequestRandomWords provides a mock function with given fields: opts, keyHash, subId, requestConfirmations, callbackGasLimit, numWords func (_m *VRFCoordinatorV2Interface) RequestRandomWords(opts *bind.TransactOpts, keyHash [32]byte, subId uint64, requestConfirmations uint16, callbackGasLimit uint32, numWords uint32) (*types.Transaction, error) { ret := _m.Called(opts, keyHash, subId, requestConfirmations, callbackGasLimit, numWords) @@ -1930,6 +3742,39 @@ func (_m *VRFCoordinatorV2Interface) RequestRandomWords(opts *bind.TransactOpts, return r0, r1 } +// VRFCoordinatorV2Interface_RequestRandomWords_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RequestRandomWords' +type VRFCoordinatorV2Interface_RequestRandomWords_Call struct { + *mock.Call +} + +// RequestRandomWords is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - keyHash [32]byte +// - subId uint64 +// - requestConfirmations uint16 +// - callbackGasLimit uint32 +// - numWords uint32 +func (_e *VRFCoordinatorV2Interface_Expecter) RequestRandomWords(opts interface{}, keyHash interface{}, subId interface{}, requestConfirmations interface{}, callbackGasLimit interface{}, numWords interface{}) *VRFCoordinatorV2Interface_RequestRandomWords_Call { + return &VRFCoordinatorV2Interface_RequestRandomWords_Call{Call: _e.mock.On("RequestRandomWords", opts, keyHash, subId, requestConfirmations, callbackGasLimit, numWords)} +} + +func (_c *VRFCoordinatorV2Interface_RequestRandomWords_Call) Run(run func(opts *bind.TransactOpts, keyHash [32]byte, subId uint64, requestConfirmations uint16, callbackGasLimit uint32, numWords uint32)) *VRFCoordinatorV2Interface_RequestRandomWords_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].([32]byte), args[2].(uint64), args[3].(uint16), args[4].(uint32), args[5].(uint32)) + }) + return _c +} + +func (_c *VRFCoordinatorV2Interface_RequestRandomWords_Call) Return(_a0 *types.Transaction, _a1 error) *VRFCoordinatorV2Interface_RequestRandomWords_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *VRFCoordinatorV2Interface_RequestRandomWords_Call) RunAndReturn(run func(*bind.TransactOpts, [32]byte, uint64, uint16, uint32, uint32) (*types.Transaction, error)) *VRFCoordinatorV2Interface_RequestRandomWords_Call { + _c.Call.Return(run) + return _c +} + // RequestSubscriptionOwnerTransfer provides a mock function with given fields: opts, subId, newOwner func (_m *VRFCoordinatorV2Interface) RequestSubscriptionOwnerTransfer(opts *bind.TransactOpts, subId uint64, newOwner common.Address) (*types.Transaction, error) { ret := _m.Called(opts, subId, newOwner) @@ -1960,6 +3805,36 @@ func (_m *VRFCoordinatorV2Interface) RequestSubscriptionOwnerTransfer(opts *bind return r0, r1 } +// VRFCoordinatorV2Interface_RequestSubscriptionOwnerTransfer_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RequestSubscriptionOwnerTransfer' +type VRFCoordinatorV2Interface_RequestSubscriptionOwnerTransfer_Call struct { + *mock.Call +} + +// RequestSubscriptionOwnerTransfer is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - subId uint64 +// - newOwner common.Address +func (_e *VRFCoordinatorV2Interface_Expecter) RequestSubscriptionOwnerTransfer(opts interface{}, subId interface{}, newOwner interface{}) *VRFCoordinatorV2Interface_RequestSubscriptionOwnerTransfer_Call { + return &VRFCoordinatorV2Interface_RequestSubscriptionOwnerTransfer_Call{Call: _e.mock.On("RequestSubscriptionOwnerTransfer", opts, subId, newOwner)} +} + +func (_c *VRFCoordinatorV2Interface_RequestSubscriptionOwnerTransfer_Call) Run(run func(opts *bind.TransactOpts, subId uint64, newOwner common.Address)) *VRFCoordinatorV2Interface_RequestSubscriptionOwnerTransfer_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].(uint64), args[2].(common.Address)) + }) + return _c +} + +func (_c *VRFCoordinatorV2Interface_RequestSubscriptionOwnerTransfer_Call) Return(_a0 *types.Transaction, _a1 error) *VRFCoordinatorV2Interface_RequestSubscriptionOwnerTransfer_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *VRFCoordinatorV2Interface_RequestSubscriptionOwnerTransfer_Call) RunAndReturn(run func(*bind.TransactOpts, uint64, common.Address) (*types.Transaction, error)) *VRFCoordinatorV2Interface_RequestSubscriptionOwnerTransfer_Call { + _c.Call.Return(run) + return _c +} + // SetConfig provides a mock function with given fields: opts, minimumRequestConfirmations, maxGasLimit, stalenessSeconds, gasAfterPaymentCalculation, fallbackWeiPerUnitLink, feeConfig func (_m *VRFCoordinatorV2Interface) SetConfig(opts *bind.TransactOpts, minimumRequestConfirmations uint16, maxGasLimit uint32, stalenessSeconds uint32, gasAfterPaymentCalculation uint32, fallbackWeiPerUnitLink *big.Int, feeConfig vrf_coordinator_v2.VRFCoordinatorV2FeeConfig) (*types.Transaction, error) { ret := _m.Called(opts, minimumRequestConfirmations, maxGasLimit, stalenessSeconds, gasAfterPaymentCalculation, fallbackWeiPerUnitLink, feeConfig) @@ -1990,6 +3865,40 @@ func (_m *VRFCoordinatorV2Interface) SetConfig(opts *bind.TransactOpts, minimumR return r0, r1 } +// VRFCoordinatorV2Interface_SetConfig_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetConfig' +type VRFCoordinatorV2Interface_SetConfig_Call struct { + *mock.Call +} + +// SetConfig is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - minimumRequestConfirmations uint16 +// - maxGasLimit uint32 +// - stalenessSeconds uint32 +// - gasAfterPaymentCalculation uint32 +// - fallbackWeiPerUnitLink *big.Int +// - feeConfig vrf_coordinator_v2.VRFCoordinatorV2FeeConfig +func (_e *VRFCoordinatorV2Interface_Expecter) SetConfig(opts interface{}, minimumRequestConfirmations interface{}, maxGasLimit interface{}, stalenessSeconds interface{}, gasAfterPaymentCalculation interface{}, fallbackWeiPerUnitLink interface{}, feeConfig interface{}) *VRFCoordinatorV2Interface_SetConfig_Call { + return &VRFCoordinatorV2Interface_SetConfig_Call{Call: _e.mock.On("SetConfig", opts, minimumRequestConfirmations, maxGasLimit, stalenessSeconds, gasAfterPaymentCalculation, fallbackWeiPerUnitLink, feeConfig)} +} + +func (_c *VRFCoordinatorV2Interface_SetConfig_Call) Run(run func(opts *bind.TransactOpts, minimumRequestConfirmations uint16, maxGasLimit uint32, stalenessSeconds uint32, gasAfterPaymentCalculation uint32, fallbackWeiPerUnitLink *big.Int, feeConfig vrf_coordinator_v2.VRFCoordinatorV2FeeConfig)) *VRFCoordinatorV2Interface_SetConfig_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].(uint16), args[2].(uint32), args[3].(uint32), args[4].(uint32), args[5].(*big.Int), args[6].(vrf_coordinator_v2.VRFCoordinatorV2FeeConfig)) + }) + return _c +} + +func (_c *VRFCoordinatorV2Interface_SetConfig_Call) Return(_a0 *types.Transaction, _a1 error) *VRFCoordinatorV2Interface_SetConfig_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *VRFCoordinatorV2Interface_SetConfig_Call) RunAndReturn(run func(*bind.TransactOpts, uint16, uint32, uint32, uint32, *big.Int, vrf_coordinator_v2.VRFCoordinatorV2FeeConfig) (*types.Transaction, error)) *VRFCoordinatorV2Interface_SetConfig_Call { + _c.Call.Return(run) + return _c +} + // TransferOwnership provides a mock function with given fields: opts, to func (_m *VRFCoordinatorV2Interface) TransferOwnership(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) { ret := _m.Called(opts, to) @@ -2020,6 +3929,35 @@ func (_m *VRFCoordinatorV2Interface) TransferOwnership(opts *bind.TransactOpts, return r0, r1 } +// VRFCoordinatorV2Interface_TransferOwnership_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TransferOwnership' +type VRFCoordinatorV2Interface_TransferOwnership_Call struct { + *mock.Call +} + +// TransferOwnership is a helper method to define mock.On call +// - opts *bind.TransactOpts +// - to common.Address +func (_e *VRFCoordinatorV2Interface_Expecter) TransferOwnership(opts interface{}, to interface{}) *VRFCoordinatorV2Interface_TransferOwnership_Call { + return &VRFCoordinatorV2Interface_TransferOwnership_Call{Call: _e.mock.On("TransferOwnership", opts, to)} +} + +func (_c *VRFCoordinatorV2Interface_TransferOwnership_Call) Run(run func(opts *bind.TransactOpts, to common.Address)) *VRFCoordinatorV2Interface_TransferOwnership_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.TransactOpts), args[1].(common.Address)) + }) + return _c +} + +func (_c *VRFCoordinatorV2Interface_TransferOwnership_Call) Return(_a0 *types.Transaction, _a1 error) *VRFCoordinatorV2Interface_TransferOwnership_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *VRFCoordinatorV2Interface_TransferOwnership_Call) RunAndReturn(run func(*bind.TransactOpts, common.Address) (*types.Transaction, error)) *VRFCoordinatorV2Interface_TransferOwnership_Call { + _c.Call.Return(run) + return _c +} + // TypeAndVersion provides a mock function with given fields: opts func (_m *VRFCoordinatorV2Interface) TypeAndVersion(opts *bind.CallOpts) (string, error) { ret := _m.Called(opts) @@ -2048,6 +3986,34 @@ func (_m *VRFCoordinatorV2Interface) TypeAndVersion(opts *bind.CallOpts) (string return r0, r1 } +// VRFCoordinatorV2Interface_TypeAndVersion_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TypeAndVersion' +type VRFCoordinatorV2Interface_TypeAndVersion_Call struct { + *mock.Call +} + +// TypeAndVersion is a helper method to define mock.On call +// - opts *bind.CallOpts +func (_e *VRFCoordinatorV2Interface_Expecter) TypeAndVersion(opts interface{}) *VRFCoordinatorV2Interface_TypeAndVersion_Call { + return &VRFCoordinatorV2Interface_TypeAndVersion_Call{Call: _e.mock.On("TypeAndVersion", opts)} +} + +func (_c *VRFCoordinatorV2Interface_TypeAndVersion_Call) Run(run func(opts *bind.CallOpts)) *VRFCoordinatorV2Interface_TypeAndVersion_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.CallOpts)) + }) + return _c +} + +func (_c *VRFCoordinatorV2Interface_TypeAndVersion_Call) Return(_a0 string, _a1 error) *VRFCoordinatorV2Interface_TypeAndVersion_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *VRFCoordinatorV2Interface_TypeAndVersion_Call) RunAndReturn(run func(*bind.CallOpts) (string, error)) *VRFCoordinatorV2Interface_TypeAndVersion_Call { + _c.Call.Return(run) + return _c +} + // WatchConfigSet provides a mock function with given fields: opts, sink func (_m *VRFCoordinatorV2Interface) WatchConfigSet(opts *bind.WatchOpts, sink chan<- *vrf_coordinator_v2.VRFCoordinatorV2ConfigSet) (event.Subscription, error) { ret := _m.Called(opts, sink) @@ -2078,6 +4044,35 @@ func (_m *VRFCoordinatorV2Interface) WatchConfigSet(opts *bind.WatchOpts, sink c return r0, r1 } +// VRFCoordinatorV2Interface_WatchConfigSet_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchConfigSet' +type VRFCoordinatorV2Interface_WatchConfigSet_Call struct { + *mock.Call +} + +// WatchConfigSet is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *vrf_coordinator_v2.VRFCoordinatorV2ConfigSet +func (_e *VRFCoordinatorV2Interface_Expecter) WatchConfigSet(opts interface{}, sink interface{}) *VRFCoordinatorV2Interface_WatchConfigSet_Call { + return &VRFCoordinatorV2Interface_WatchConfigSet_Call{Call: _e.mock.On("WatchConfigSet", opts, sink)} +} + +func (_c *VRFCoordinatorV2Interface_WatchConfigSet_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *vrf_coordinator_v2.VRFCoordinatorV2ConfigSet)) *VRFCoordinatorV2Interface_WatchConfigSet_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *vrf_coordinator_v2.VRFCoordinatorV2ConfigSet)) + }) + return _c +} + +func (_c *VRFCoordinatorV2Interface_WatchConfigSet_Call) Return(_a0 event.Subscription, _a1 error) *VRFCoordinatorV2Interface_WatchConfigSet_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *VRFCoordinatorV2Interface_WatchConfigSet_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *vrf_coordinator_v2.VRFCoordinatorV2ConfigSet) (event.Subscription, error)) *VRFCoordinatorV2Interface_WatchConfigSet_Call { + _c.Call.Return(run) + return _c +} + // WatchFundsRecovered provides a mock function with given fields: opts, sink func (_m *VRFCoordinatorV2Interface) WatchFundsRecovered(opts *bind.WatchOpts, sink chan<- *vrf_coordinator_v2.VRFCoordinatorV2FundsRecovered) (event.Subscription, error) { ret := _m.Called(opts, sink) @@ -2108,6 +4103,35 @@ func (_m *VRFCoordinatorV2Interface) WatchFundsRecovered(opts *bind.WatchOpts, s return r0, r1 } +// VRFCoordinatorV2Interface_WatchFundsRecovered_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchFundsRecovered' +type VRFCoordinatorV2Interface_WatchFundsRecovered_Call struct { + *mock.Call +} + +// WatchFundsRecovered is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *vrf_coordinator_v2.VRFCoordinatorV2FundsRecovered +func (_e *VRFCoordinatorV2Interface_Expecter) WatchFundsRecovered(opts interface{}, sink interface{}) *VRFCoordinatorV2Interface_WatchFundsRecovered_Call { + return &VRFCoordinatorV2Interface_WatchFundsRecovered_Call{Call: _e.mock.On("WatchFundsRecovered", opts, sink)} +} + +func (_c *VRFCoordinatorV2Interface_WatchFundsRecovered_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *vrf_coordinator_v2.VRFCoordinatorV2FundsRecovered)) *VRFCoordinatorV2Interface_WatchFundsRecovered_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *vrf_coordinator_v2.VRFCoordinatorV2FundsRecovered)) + }) + return _c +} + +func (_c *VRFCoordinatorV2Interface_WatchFundsRecovered_Call) Return(_a0 event.Subscription, _a1 error) *VRFCoordinatorV2Interface_WatchFundsRecovered_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *VRFCoordinatorV2Interface_WatchFundsRecovered_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *vrf_coordinator_v2.VRFCoordinatorV2FundsRecovered) (event.Subscription, error)) *VRFCoordinatorV2Interface_WatchFundsRecovered_Call { + _c.Call.Return(run) + return _c +} + // WatchOwnershipTransferRequested provides a mock function with given fields: opts, sink, from, to func (_m *VRFCoordinatorV2Interface) WatchOwnershipTransferRequested(opts *bind.WatchOpts, sink chan<- *vrf_coordinator_v2.VRFCoordinatorV2OwnershipTransferRequested, from []common.Address, to []common.Address) (event.Subscription, error) { ret := _m.Called(opts, sink, from, to) @@ -2138,6 +4162,37 @@ func (_m *VRFCoordinatorV2Interface) WatchOwnershipTransferRequested(opts *bind. return r0, r1 } +// VRFCoordinatorV2Interface_WatchOwnershipTransferRequested_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchOwnershipTransferRequested' +type VRFCoordinatorV2Interface_WatchOwnershipTransferRequested_Call struct { + *mock.Call +} + +// WatchOwnershipTransferRequested is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *vrf_coordinator_v2.VRFCoordinatorV2OwnershipTransferRequested +// - from []common.Address +// - to []common.Address +func (_e *VRFCoordinatorV2Interface_Expecter) WatchOwnershipTransferRequested(opts interface{}, sink interface{}, from interface{}, to interface{}) *VRFCoordinatorV2Interface_WatchOwnershipTransferRequested_Call { + return &VRFCoordinatorV2Interface_WatchOwnershipTransferRequested_Call{Call: _e.mock.On("WatchOwnershipTransferRequested", opts, sink, from, to)} +} + +func (_c *VRFCoordinatorV2Interface_WatchOwnershipTransferRequested_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *vrf_coordinator_v2.VRFCoordinatorV2OwnershipTransferRequested, from []common.Address, to []common.Address)) *VRFCoordinatorV2Interface_WatchOwnershipTransferRequested_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *vrf_coordinator_v2.VRFCoordinatorV2OwnershipTransferRequested), args[2].([]common.Address), args[3].([]common.Address)) + }) + return _c +} + +func (_c *VRFCoordinatorV2Interface_WatchOwnershipTransferRequested_Call) Return(_a0 event.Subscription, _a1 error) *VRFCoordinatorV2Interface_WatchOwnershipTransferRequested_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *VRFCoordinatorV2Interface_WatchOwnershipTransferRequested_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *vrf_coordinator_v2.VRFCoordinatorV2OwnershipTransferRequested, []common.Address, []common.Address) (event.Subscription, error)) *VRFCoordinatorV2Interface_WatchOwnershipTransferRequested_Call { + _c.Call.Return(run) + return _c +} + // WatchOwnershipTransferred provides a mock function with given fields: opts, sink, from, to func (_m *VRFCoordinatorV2Interface) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *vrf_coordinator_v2.VRFCoordinatorV2OwnershipTransferred, from []common.Address, to []common.Address) (event.Subscription, error) { ret := _m.Called(opts, sink, from, to) @@ -2168,6 +4223,37 @@ func (_m *VRFCoordinatorV2Interface) WatchOwnershipTransferred(opts *bind.WatchO return r0, r1 } +// VRFCoordinatorV2Interface_WatchOwnershipTransferred_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchOwnershipTransferred' +type VRFCoordinatorV2Interface_WatchOwnershipTransferred_Call struct { + *mock.Call +} + +// WatchOwnershipTransferred is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *vrf_coordinator_v2.VRFCoordinatorV2OwnershipTransferred +// - from []common.Address +// - to []common.Address +func (_e *VRFCoordinatorV2Interface_Expecter) WatchOwnershipTransferred(opts interface{}, sink interface{}, from interface{}, to interface{}) *VRFCoordinatorV2Interface_WatchOwnershipTransferred_Call { + return &VRFCoordinatorV2Interface_WatchOwnershipTransferred_Call{Call: _e.mock.On("WatchOwnershipTransferred", opts, sink, from, to)} +} + +func (_c *VRFCoordinatorV2Interface_WatchOwnershipTransferred_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *vrf_coordinator_v2.VRFCoordinatorV2OwnershipTransferred, from []common.Address, to []common.Address)) *VRFCoordinatorV2Interface_WatchOwnershipTransferred_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *vrf_coordinator_v2.VRFCoordinatorV2OwnershipTransferred), args[2].([]common.Address), args[3].([]common.Address)) + }) + return _c +} + +func (_c *VRFCoordinatorV2Interface_WatchOwnershipTransferred_Call) Return(_a0 event.Subscription, _a1 error) *VRFCoordinatorV2Interface_WatchOwnershipTransferred_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *VRFCoordinatorV2Interface_WatchOwnershipTransferred_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *vrf_coordinator_v2.VRFCoordinatorV2OwnershipTransferred, []common.Address, []common.Address) (event.Subscription, error)) *VRFCoordinatorV2Interface_WatchOwnershipTransferred_Call { + _c.Call.Return(run) + return _c +} + // WatchProvingKeyDeregistered provides a mock function with given fields: opts, sink, oracle func (_m *VRFCoordinatorV2Interface) WatchProvingKeyDeregistered(opts *bind.WatchOpts, sink chan<- *vrf_coordinator_v2.VRFCoordinatorV2ProvingKeyDeregistered, oracle []common.Address) (event.Subscription, error) { ret := _m.Called(opts, sink, oracle) @@ -2198,6 +4284,36 @@ func (_m *VRFCoordinatorV2Interface) WatchProvingKeyDeregistered(opts *bind.Watc return r0, r1 } +// VRFCoordinatorV2Interface_WatchProvingKeyDeregistered_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchProvingKeyDeregistered' +type VRFCoordinatorV2Interface_WatchProvingKeyDeregistered_Call struct { + *mock.Call +} + +// WatchProvingKeyDeregistered is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *vrf_coordinator_v2.VRFCoordinatorV2ProvingKeyDeregistered +// - oracle []common.Address +func (_e *VRFCoordinatorV2Interface_Expecter) WatchProvingKeyDeregistered(opts interface{}, sink interface{}, oracle interface{}) *VRFCoordinatorV2Interface_WatchProvingKeyDeregistered_Call { + return &VRFCoordinatorV2Interface_WatchProvingKeyDeregistered_Call{Call: _e.mock.On("WatchProvingKeyDeregistered", opts, sink, oracle)} +} + +func (_c *VRFCoordinatorV2Interface_WatchProvingKeyDeregistered_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *vrf_coordinator_v2.VRFCoordinatorV2ProvingKeyDeregistered, oracle []common.Address)) *VRFCoordinatorV2Interface_WatchProvingKeyDeregistered_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *vrf_coordinator_v2.VRFCoordinatorV2ProvingKeyDeregistered), args[2].([]common.Address)) + }) + return _c +} + +func (_c *VRFCoordinatorV2Interface_WatchProvingKeyDeregistered_Call) Return(_a0 event.Subscription, _a1 error) *VRFCoordinatorV2Interface_WatchProvingKeyDeregistered_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *VRFCoordinatorV2Interface_WatchProvingKeyDeregistered_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *vrf_coordinator_v2.VRFCoordinatorV2ProvingKeyDeregistered, []common.Address) (event.Subscription, error)) *VRFCoordinatorV2Interface_WatchProvingKeyDeregistered_Call { + _c.Call.Return(run) + return _c +} + // WatchProvingKeyRegistered provides a mock function with given fields: opts, sink, oracle func (_m *VRFCoordinatorV2Interface) WatchProvingKeyRegistered(opts *bind.WatchOpts, sink chan<- *vrf_coordinator_v2.VRFCoordinatorV2ProvingKeyRegistered, oracle []common.Address) (event.Subscription, error) { ret := _m.Called(opts, sink, oracle) @@ -2228,6 +4344,36 @@ func (_m *VRFCoordinatorV2Interface) WatchProvingKeyRegistered(opts *bind.WatchO return r0, r1 } +// VRFCoordinatorV2Interface_WatchProvingKeyRegistered_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchProvingKeyRegistered' +type VRFCoordinatorV2Interface_WatchProvingKeyRegistered_Call struct { + *mock.Call +} + +// WatchProvingKeyRegistered is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *vrf_coordinator_v2.VRFCoordinatorV2ProvingKeyRegistered +// - oracle []common.Address +func (_e *VRFCoordinatorV2Interface_Expecter) WatchProvingKeyRegistered(opts interface{}, sink interface{}, oracle interface{}) *VRFCoordinatorV2Interface_WatchProvingKeyRegistered_Call { + return &VRFCoordinatorV2Interface_WatchProvingKeyRegistered_Call{Call: _e.mock.On("WatchProvingKeyRegistered", opts, sink, oracle)} +} + +func (_c *VRFCoordinatorV2Interface_WatchProvingKeyRegistered_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *vrf_coordinator_v2.VRFCoordinatorV2ProvingKeyRegistered, oracle []common.Address)) *VRFCoordinatorV2Interface_WatchProvingKeyRegistered_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *vrf_coordinator_v2.VRFCoordinatorV2ProvingKeyRegistered), args[2].([]common.Address)) + }) + return _c +} + +func (_c *VRFCoordinatorV2Interface_WatchProvingKeyRegistered_Call) Return(_a0 event.Subscription, _a1 error) *VRFCoordinatorV2Interface_WatchProvingKeyRegistered_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *VRFCoordinatorV2Interface_WatchProvingKeyRegistered_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *vrf_coordinator_v2.VRFCoordinatorV2ProvingKeyRegistered, []common.Address) (event.Subscription, error)) *VRFCoordinatorV2Interface_WatchProvingKeyRegistered_Call { + _c.Call.Return(run) + return _c +} + // WatchRandomWordsFulfilled provides a mock function with given fields: opts, sink, requestId func (_m *VRFCoordinatorV2Interface) WatchRandomWordsFulfilled(opts *bind.WatchOpts, sink chan<- *vrf_coordinator_v2.VRFCoordinatorV2RandomWordsFulfilled, requestId []*big.Int) (event.Subscription, error) { ret := _m.Called(opts, sink, requestId) @@ -2258,6 +4404,36 @@ func (_m *VRFCoordinatorV2Interface) WatchRandomWordsFulfilled(opts *bind.WatchO return r0, r1 } +// VRFCoordinatorV2Interface_WatchRandomWordsFulfilled_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchRandomWordsFulfilled' +type VRFCoordinatorV2Interface_WatchRandomWordsFulfilled_Call struct { + *mock.Call +} + +// WatchRandomWordsFulfilled is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *vrf_coordinator_v2.VRFCoordinatorV2RandomWordsFulfilled +// - requestId []*big.Int +func (_e *VRFCoordinatorV2Interface_Expecter) WatchRandomWordsFulfilled(opts interface{}, sink interface{}, requestId interface{}) *VRFCoordinatorV2Interface_WatchRandomWordsFulfilled_Call { + return &VRFCoordinatorV2Interface_WatchRandomWordsFulfilled_Call{Call: _e.mock.On("WatchRandomWordsFulfilled", opts, sink, requestId)} +} + +func (_c *VRFCoordinatorV2Interface_WatchRandomWordsFulfilled_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *vrf_coordinator_v2.VRFCoordinatorV2RandomWordsFulfilled, requestId []*big.Int)) *VRFCoordinatorV2Interface_WatchRandomWordsFulfilled_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *vrf_coordinator_v2.VRFCoordinatorV2RandomWordsFulfilled), args[2].([]*big.Int)) + }) + return _c +} + +func (_c *VRFCoordinatorV2Interface_WatchRandomWordsFulfilled_Call) Return(_a0 event.Subscription, _a1 error) *VRFCoordinatorV2Interface_WatchRandomWordsFulfilled_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *VRFCoordinatorV2Interface_WatchRandomWordsFulfilled_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *vrf_coordinator_v2.VRFCoordinatorV2RandomWordsFulfilled, []*big.Int) (event.Subscription, error)) *VRFCoordinatorV2Interface_WatchRandomWordsFulfilled_Call { + _c.Call.Return(run) + return _c +} + // WatchRandomWordsRequested provides a mock function with given fields: opts, sink, keyHash, subId, sender func (_m *VRFCoordinatorV2Interface) WatchRandomWordsRequested(opts *bind.WatchOpts, sink chan<- *vrf_coordinator_v2.VRFCoordinatorV2RandomWordsRequested, keyHash [][32]byte, subId []uint64, sender []common.Address) (event.Subscription, error) { ret := _m.Called(opts, sink, keyHash, subId, sender) @@ -2288,6 +4464,38 @@ func (_m *VRFCoordinatorV2Interface) WatchRandomWordsRequested(opts *bind.WatchO return r0, r1 } +// VRFCoordinatorV2Interface_WatchRandomWordsRequested_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchRandomWordsRequested' +type VRFCoordinatorV2Interface_WatchRandomWordsRequested_Call struct { + *mock.Call +} + +// WatchRandomWordsRequested is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *vrf_coordinator_v2.VRFCoordinatorV2RandomWordsRequested +// - keyHash [][32]byte +// - subId []uint64 +// - sender []common.Address +func (_e *VRFCoordinatorV2Interface_Expecter) WatchRandomWordsRequested(opts interface{}, sink interface{}, keyHash interface{}, subId interface{}, sender interface{}) *VRFCoordinatorV2Interface_WatchRandomWordsRequested_Call { + return &VRFCoordinatorV2Interface_WatchRandomWordsRequested_Call{Call: _e.mock.On("WatchRandomWordsRequested", opts, sink, keyHash, subId, sender)} +} + +func (_c *VRFCoordinatorV2Interface_WatchRandomWordsRequested_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *vrf_coordinator_v2.VRFCoordinatorV2RandomWordsRequested, keyHash [][32]byte, subId []uint64, sender []common.Address)) *VRFCoordinatorV2Interface_WatchRandomWordsRequested_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *vrf_coordinator_v2.VRFCoordinatorV2RandomWordsRequested), args[2].([][32]byte), args[3].([]uint64), args[4].([]common.Address)) + }) + return _c +} + +func (_c *VRFCoordinatorV2Interface_WatchRandomWordsRequested_Call) Return(_a0 event.Subscription, _a1 error) *VRFCoordinatorV2Interface_WatchRandomWordsRequested_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *VRFCoordinatorV2Interface_WatchRandomWordsRequested_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *vrf_coordinator_v2.VRFCoordinatorV2RandomWordsRequested, [][32]byte, []uint64, []common.Address) (event.Subscription, error)) *VRFCoordinatorV2Interface_WatchRandomWordsRequested_Call { + _c.Call.Return(run) + return _c +} + // WatchSubscriptionCanceled provides a mock function with given fields: opts, sink, subId func (_m *VRFCoordinatorV2Interface) WatchSubscriptionCanceled(opts *bind.WatchOpts, sink chan<- *vrf_coordinator_v2.VRFCoordinatorV2SubscriptionCanceled, subId []uint64) (event.Subscription, error) { ret := _m.Called(opts, sink, subId) @@ -2318,6 +4526,36 @@ func (_m *VRFCoordinatorV2Interface) WatchSubscriptionCanceled(opts *bind.WatchO return r0, r1 } +// VRFCoordinatorV2Interface_WatchSubscriptionCanceled_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchSubscriptionCanceled' +type VRFCoordinatorV2Interface_WatchSubscriptionCanceled_Call struct { + *mock.Call +} + +// WatchSubscriptionCanceled is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *vrf_coordinator_v2.VRFCoordinatorV2SubscriptionCanceled +// - subId []uint64 +func (_e *VRFCoordinatorV2Interface_Expecter) WatchSubscriptionCanceled(opts interface{}, sink interface{}, subId interface{}) *VRFCoordinatorV2Interface_WatchSubscriptionCanceled_Call { + return &VRFCoordinatorV2Interface_WatchSubscriptionCanceled_Call{Call: _e.mock.On("WatchSubscriptionCanceled", opts, sink, subId)} +} + +func (_c *VRFCoordinatorV2Interface_WatchSubscriptionCanceled_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *vrf_coordinator_v2.VRFCoordinatorV2SubscriptionCanceled, subId []uint64)) *VRFCoordinatorV2Interface_WatchSubscriptionCanceled_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *vrf_coordinator_v2.VRFCoordinatorV2SubscriptionCanceled), args[2].([]uint64)) + }) + return _c +} + +func (_c *VRFCoordinatorV2Interface_WatchSubscriptionCanceled_Call) Return(_a0 event.Subscription, _a1 error) *VRFCoordinatorV2Interface_WatchSubscriptionCanceled_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *VRFCoordinatorV2Interface_WatchSubscriptionCanceled_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *vrf_coordinator_v2.VRFCoordinatorV2SubscriptionCanceled, []uint64) (event.Subscription, error)) *VRFCoordinatorV2Interface_WatchSubscriptionCanceled_Call { + _c.Call.Return(run) + return _c +} + // WatchSubscriptionConsumerAdded provides a mock function with given fields: opts, sink, subId func (_m *VRFCoordinatorV2Interface) WatchSubscriptionConsumerAdded(opts *bind.WatchOpts, sink chan<- *vrf_coordinator_v2.VRFCoordinatorV2SubscriptionConsumerAdded, subId []uint64) (event.Subscription, error) { ret := _m.Called(opts, sink, subId) @@ -2348,6 +4586,36 @@ func (_m *VRFCoordinatorV2Interface) WatchSubscriptionConsumerAdded(opts *bind.W return r0, r1 } +// VRFCoordinatorV2Interface_WatchSubscriptionConsumerAdded_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchSubscriptionConsumerAdded' +type VRFCoordinatorV2Interface_WatchSubscriptionConsumerAdded_Call struct { + *mock.Call +} + +// WatchSubscriptionConsumerAdded is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *vrf_coordinator_v2.VRFCoordinatorV2SubscriptionConsumerAdded +// - subId []uint64 +func (_e *VRFCoordinatorV2Interface_Expecter) WatchSubscriptionConsumerAdded(opts interface{}, sink interface{}, subId interface{}) *VRFCoordinatorV2Interface_WatchSubscriptionConsumerAdded_Call { + return &VRFCoordinatorV2Interface_WatchSubscriptionConsumerAdded_Call{Call: _e.mock.On("WatchSubscriptionConsumerAdded", opts, sink, subId)} +} + +func (_c *VRFCoordinatorV2Interface_WatchSubscriptionConsumerAdded_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *vrf_coordinator_v2.VRFCoordinatorV2SubscriptionConsumerAdded, subId []uint64)) *VRFCoordinatorV2Interface_WatchSubscriptionConsumerAdded_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *vrf_coordinator_v2.VRFCoordinatorV2SubscriptionConsumerAdded), args[2].([]uint64)) + }) + return _c +} + +func (_c *VRFCoordinatorV2Interface_WatchSubscriptionConsumerAdded_Call) Return(_a0 event.Subscription, _a1 error) *VRFCoordinatorV2Interface_WatchSubscriptionConsumerAdded_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *VRFCoordinatorV2Interface_WatchSubscriptionConsumerAdded_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *vrf_coordinator_v2.VRFCoordinatorV2SubscriptionConsumerAdded, []uint64) (event.Subscription, error)) *VRFCoordinatorV2Interface_WatchSubscriptionConsumerAdded_Call { + _c.Call.Return(run) + return _c +} + // WatchSubscriptionConsumerRemoved provides a mock function with given fields: opts, sink, subId func (_m *VRFCoordinatorV2Interface) WatchSubscriptionConsumerRemoved(opts *bind.WatchOpts, sink chan<- *vrf_coordinator_v2.VRFCoordinatorV2SubscriptionConsumerRemoved, subId []uint64) (event.Subscription, error) { ret := _m.Called(opts, sink, subId) @@ -2378,6 +4646,36 @@ func (_m *VRFCoordinatorV2Interface) WatchSubscriptionConsumerRemoved(opts *bind return r0, r1 } +// VRFCoordinatorV2Interface_WatchSubscriptionConsumerRemoved_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchSubscriptionConsumerRemoved' +type VRFCoordinatorV2Interface_WatchSubscriptionConsumerRemoved_Call struct { + *mock.Call +} + +// WatchSubscriptionConsumerRemoved is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *vrf_coordinator_v2.VRFCoordinatorV2SubscriptionConsumerRemoved +// - subId []uint64 +func (_e *VRFCoordinatorV2Interface_Expecter) WatchSubscriptionConsumerRemoved(opts interface{}, sink interface{}, subId interface{}) *VRFCoordinatorV2Interface_WatchSubscriptionConsumerRemoved_Call { + return &VRFCoordinatorV2Interface_WatchSubscriptionConsumerRemoved_Call{Call: _e.mock.On("WatchSubscriptionConsumerRemoved", opts, sink, subId)} +} + +func (_c *VRFCoordinatorV2Interface_WatchSubscriptionConsumerRemoved_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *vrf_coordinator_v2.VRFCoordinatorV2SubscriptionConsumerRemoved, subId []uint64)) *VRFCoordinatorV2Interface_WatchSubscriptionConsumerRemoved_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *vrf_coordinator_v2.VRFCoordinatorV2SubscriptionConsumerRemoved), args[2].([]uint64)) + }) + return _c +} + +func (_c *VRFCoordinatorV2Interface_WatchSubscriptionConsumerRemoved_Call) Return(_a0 event.Subscription, _a1 error) *VRFCoordinatorV2Interface_WatchSubscriptionConsumerRemoved_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *VRFCoordinatorV2Interface_WatchSubscriptionConsumerRemoved_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *vrf_coordinator_v2.VRFCoordinatorV2SubscriptionConsumerRemoved, []uint64) (event.Subscription, error)) *VRFCoordinatorV2Interface_WatchSubscriptionConsumerRemoved_Call { + _c.Call.Return(run) + return _c +} + // WatchSubscriptionCreated provides a mock function with given fields: opts, sink, subId func (_m *VRFCoordinatorV2Interface) WatchSubscriptionCreated(opts *bind.WatchOpts, sink chan<- *vrf_coordinator_v2.VRFCoordinatorV2SubscriptionCreated, subId []uint64) (event.Subscription, error) { ret := _m.Called(opts, sink, subId) @@ -2408,6 +4706,36 @@ func (_m *VRFCoordinatorV2Interface) WatchSubscriptionCreated(opts *bind.WatchOp return r0, r1 } +// VRFCoordinatorV2Interface_WatchSubscriptionCreated_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchSubscriptionCreated' +type VRFCoordinatorV2Interface_WatchSubscriptionCreated_Call struct { + *mock.Call +} + +// WatchSubscriptionCreated is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *vrf_coordinator_v2.VRFCoordinatorV2SubscriptionCreated +// - subId []uint64 +func (_e *VRFCoordinatorV2Interface_Expecter) WatchSubscriptionCreated(opts interface{}, sink interface{}, subId interface{}) *VRFCoordinatorV2Interface_WatchSubscriptionCreated_Call { + return &VRFCoordinatorV2Interface_WatchSubscriptionCreated_Call{Call: _e.mock.On("WatchSubscriptionCreated", opts, sink, subId)} +} + +func (_c *VRFCoordinatorV2Interface_WatchSubscriptionCreated_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *vrf_coordinator_v2.VRFCoordinatorV2SubscriptionCreated, subId []uint64)) *VRFCoordinatorV2Interface_WatchSubscriptionCreated_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *vrf_coordinator_v2.VRFCoordinatorV2SubscriptionCreated), args[2].([]uint64)) + }) + return _c +} + +func (_c *VRFCoordinatorV2Interface_WatchSubscriptionCreated_Call) Return(_a0 event.Subscription, _a1 error) *VRFCoordinatorV2Interface_WatchSubscriptionCreated_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *VRFCoordinatorV2Interface_WatchSubscriptionCreated_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *vrf_coordinator_v2.VRFCoordinatorV2SubscriptionCreated, []uint64) (event.Subscription, error)) *VRFCoordinatorV2Interface_WatchSubscriptionCreated_Call { + _c.Call.Return(run) + return _c +} + // WatchSubscriptionFunded provides a mock function with given fields: opts, sink, subId func (_m *VRFCoordinatorV2Interface) WatchSubscriptionFunded(opts *bind.WatchOpts, sink chan<- *vrf_coordinator_v2.VRFCoordinatorV2SubscriptionFunded, subId []uint64) (event.Subscription, error) { ret := _m.Called(opts, sink, subId) @@ -2438,6 +4766,36 @@ func (_m *VRFCoordinatorV2Interface) WatchSubscriptionFunded(opts *bind.WatchOpt return r0, r1 } +// VRFCoordinatorV2Interface_WatchSubscriptionFunded_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchSubscriptionFunded' +type VRFCoordinatorV2Interface_WatchSubscriptionFunded_Call struct { + *mock.Call +} + +// WatchSubscriptionFunded is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *vrf_coordinator_v2.VRFCoordinatorV2SubscriptionFunded +// - subId []uint64 +func (_e *VRFCoordinatorV2Interface_Expecter) WatchSubscriptionFunded(opts interface{}, sink interface{}, subId interface{}) *VRFCoordinatorV2Interface_WatchSubscriptionFunded_Call { + return &VRFCoordinatorV2Interface_WatchSubscriptionFunded_Call{Call: _e.mock.On("WatchSubscriptionFunded", opts, sink, subId)} +} + +func (_c *VRFCoordinatorV2Interface_WatchSubscriptionFunded_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *vrf_coordinator_v2.VRFCoordinatorV2SubscriptionFunded, subId []uint64)) *VRFCoordinatorV2Interface_WatchSubscriptionFunded_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *vrf_coordinator_v2.VRFCoordinatorV2SubscriptionFunded), args[2].([]uint64)) + }) + return _c +} + +func (_c *VRFCoordinatorV2Interface_WatchSubscriptionFunded_Call) Return(_a0 event.Subscription, _a1 error) *VRFCoordinatorV2Interface_WatchSubscriptionFunded_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *VRFCoordinatorV2Interface_WatchSubscriptionFunded_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *vrf_coordinator_v2.VRFCoordinatorV2SubscriptionFunded, []uint64) (event.Subscription, error)) *VRFCoordinatorV2Interface_WatchSubscriptionFunded_Call { + _c.Call.Return(run) + return _c +} + // WatchSubscriptionOwnerTransferRequested provides a mock function with given fields: opts, sink, subId func (_m *VRFCoordinatorV2Interface) WatchSubscriptionOwnerTransferRequested(opts *bind.WatchOpts, sink chan<- *vrf_coordinator_v2.VRFCoordinatorV2SubscriptionOwnerTransferRequested, subId []uint64) (event.Subscription, error) { ret := _m.Called(opts, sink, subId) @@ -2468,6 +4826,36 @@ func (_m *VRFCoordinatorV2Interface) WatchSubscriptionOwnerTransferRequested(opt return r0, r1 } +// VRFCoordinatorV2Interface_WatchSubscriptionOwnerTransferRequested_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchSubscriptionOwnerTransferRequested' +type VRFCoordinatorV2Interface_WatchSubscriptionOwnerTransferRequested_Call struct { + *mock.Call +} + +// WatchSubscriptionOwnerTransferRequested is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *vrf_coordinator_v2.VRFCoordinatorV2SubscriptionOwnerTransferRequested +// - subId []uint64 +func (_e *VRFCoordinatorV2Interface_Expecter) WatchSubscriptionOwnerTransferRequested(opts interface{}, sink interface{}, subId interface{}) *VRFCoordinatorV2Interface_WatchSubscriptionOwnerTransferRequested_Call { + return &VRFCoordinatorV2Interface_WatchSubscriptionOwnerTransferRequested_Call{Call: _e.mock.On("WatchSubscriptionOwnerTransferRequested", opts, sink, subId)} +} + +func (_c *VRFCoordinatorV2Interface_WatchSubscriptionOwnerTransferRequested_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *vrf_coordinator_v2.VRFCoordinatorV2SubscriptionOwnerTransferRequested, subId []uint64)) *VRFCoordinatorV2Interface_WatchSubscriptionOwnerTransferRequested_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *vrf_coordinator_v2.VRFCoordinatorV2SubscriptionOwnerTransferRequested), args[2].([]uint64)) + }) + return _c +} + +func (_c *VRFCoordinatorV2Interface_WatchSubscriptionOwnerTransferRequested_Call) Return(_a0 event.Subscription, _a1 error) *VRFCoordinatorV2Interface_WatchSubscriptionOwnerTransferRequested_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *VRFCoordinatorV2Interface_WatchSubscriptionOwnerTransferRequested_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *vrf_coordinator_v2.VRFCoordinatorV2SubscriptionOwnerTransferRequested, []uint64) (event.Subscription, error)) *VRFCoordinatorV2Interface_WatchSubscriptionOwnerTransferRequested_Call { + _c.Call.Return(run) + return _c +} + // WatchSubscriptionOwnerTransferred provides a mock function with given fields: opts, sink, subId func (_m *VRFCoordinatorV2Interface) WatchSubscriptionOwnerTransferred(opts *bind.WatchOpts, sink chan<- *vrf_coordinator_v2.VRFCoordinatorV2SubscriptionOwnerTransferred, subId []uint64) (event.Subscription, error) { ret := _m.Called(opts, sink, subId) @@ -2498,6 +4886,36 @@ func (_m *VRFCoordinatorV2Interface) WatchSubscriptionOwnerTransferred(opts *bin return r0, r1 } +// VRFCoordinatorV2Interface_WatchSubscriptionOwnerTransferred_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchSubscriptionOwnerTransferred' +type VRFCoordinatorV2Interface_WatchSubscriptionOwnerTransferred_Call struct { + *mock.Call +} + +// WatchSubscriptionOwnerTransferred is a helper method to define mock.On call +// - opts *bind.WatchOpts +// - sink chan<- *vrf_coordinator_v2.VRFCoordinatorV2SubscriptionOwnerTransferred +// - subId []uint64 +func (_e *VRFCoordinatorV2Interface_Expecter) WatchSubscriptionOwnerTransferred(opts interface{}, sink interface{}, subId interface{}) *VRFCoordinatorV2Interface_WatchSubscriptionOwnerTransferred_Call { + return &VRFCoordinatorV2Interface_WatchSubscriptionOwnerTransferred_Call{Call: _e.mock.On("WatchSubscriptionOwnerTransferred", opts, sink, subId)} +} + +func (_c *VRFCoordinatorV2Interface_WatchSubscriptionOwnerTransferred_Call) Run(run func(opts *bind.WatchOpts, sink chan<- *vrf_coordinator_v2.VRFCoordinatorV2SubscriptionOwnerTransferred, subId []uint64)) *VRFCoordinatorV2Interface_WatchSubscriptionOwnerTransferred_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*bind.WatchOpts), args[1].(chan<- *vrf_coordinator_v2.VRFCoordinatorV2SubscriptionOwnerTransferred), args[2].([]uint64)) + }) + return _c +} + +func (_c *VRFCoordinatorV2Interface_WatchSubscriptionOwnerTransferred_Call) Return(_a0 event.Subscription, _a1 error) *VRFCoordinatorV2Interface_WatchSubscriptionOwnerTransferred_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *VRFCoordinatorV2Interface_WatchSubscriptionOwnerTransferred_Call) RunAndReturn(run func(*bind.WatchOpts, chan<- *vrf_coordinator_v2.VRFCoordinatorV2SubscriptionOwnerTransferred, []uint64) (event.Subscription, error)) *VRFCoordinatorV2Interface_WatchSubscriptionOwnerTransferred_Call { + _c.Call.Return(run) + return _c +} + // NewVRFCoordinatorV2Interface creates a new instance of VRFCoordinatorV2Interface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewVRFCoordinatorV2Interface(t interface { diff --git a/core/services/vrf/v1/integration_test.go b/core/services/vrf/v1/integration_test.go index 74006639c6e..125388b6b2a 100644 --- a/core/services/vrf/v1/integration_test.go +++ b/core/services/vrf/v1/integration_test.go @@ -16,11 +16,11 @@ import ( "gopkg.in/guregu/null.v4" commonconfig "github.com/smartcontractkit/chainlink-common/pkg/config" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/txmgr" ubig "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils/big" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/solidity_vrf_coordinator_interface" "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" - "github.com/smartcontractkit/chainlink/v2/core/internal/cltest/heavyweight" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" "github.com/smartcontractkit/chainlink/v2/core/services/job" @@ -30,6 +30,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/vrf/vrfcommon" "github.com/smartcontractkit/chainlink/v2/core/services/vrf/vrftesthelpers" "github.com/smartcontractkit/chainlink/v2/core/testdata/testspecs" + "github.com/smartcontractkit/chainlink/v2/core/utils/testutils/heavyweight" ) func TestIntegration_VRF_JPV2(t *testing.T) { diff --git a/core/services/vrf/v1/listener_v1.go b/core/services/vrf/v1/listener_v1.go index c8029403084..74b522d4089 100644 --- a/core/services/vrf/v1/listener_v1.go +++ b/core/services/vrf/v1/listener_v1.go @@ -484,7 +484,7 @@ func (lsn *Listener) ProcessRequest(ctx context.Context, req request) bool { run := pipeline.NewRun(*lsn.Job.PipelineSpec, vars) // The VRF pipeline has no async tasks, so we don't need to check for `incomplete` - if _, err = lsn.PipelineRunner.Run(ctx, run, lggr, true, func(tx sqlutil.DataSource) error { + if _, err = lsn.PipelineRunner.Run(ctx, run, true, func(tx sqlutil.DataSource) error { // Always mark consumed regardless of whether the proof failed or not. if err = lsn.Chain.LogBroadcaster().MarkConsumed(ctx, tx, req.lb); err != nil { lggr.Errorw("Failed mark consumed", "err", err) diff --git a/core/services/vrf/v2/bhs_feeder_test.go b/core/services/vrf/v2/bhs_feeder_test.go index b39fd0dec7f..d3e0008f18b 100644 --- a/core/services/vrf/v2/bhs_feeder_test.go +++ b/core/services/vrf/v2/bhs_feeder_test.go @@ -12,10 +12,10 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/chains/evm/config/toml" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" - "github.com/smartcontractkit/chainlink/v2/core/internal/cltest/heavyweight" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" "github.com/smartcontractkit/chainlink/v2/core/services/vrf/vrftesthelpers" + "github.com/smartcontractkit/chainlink/v2/core/utils/testutils/heavyweight" ) func TestStartHeartbeats(t *testing.T) { diff --git a/core/services/vrf/v2/coordinator_v2x_interface.go b/core/services/vrf/v2/coordinator_v2x_interface.go index 31621562588..35e8bcd4709 100644 --- a/core/services/vrf/v2/coordinator_v2x_interface.go +++ b/core/services/vrf/v2/coordinator_v2x_interface.go @@ -250,7 +250,7 @@ func (c *coordinatorV2_5) ParseRandomWordsFulfilled(log types.Log) (RandomWordsF } func (c *coordinatorV2_5) RequestRandomWords(opts *bind.TransactOpts, keyHash [32]byte, subID *big.Int, requestConfirmations uint16, callbackGasLimit uint32, numWords uint32, payInEth bool) (*types.Transaction, error) { - extraArgs, err := extraargs.ExtraArgsV1(payInEth) + extraArgs, err := extraargs.EncodeV1(payInEth) if err != nil { return nil, err } @@ -569,7 +569,7 @@ func (r *v2_5RandomWordsRequested) CallbackGasLimit() uint32 { } func (r *v2_5RandomWordsRequested) NativePayment() bool { - nativePayment, err := extraargs.FromExtraArgsV1(r.event.ExtraArgs) + nativePayment, err := extraargs.DecodeV1(r.event.ExtraArgs) if err != nil { panic(err) } @@ -1073,7 +1073,7 @@ func (r *RequestCommitment) NativePayment() bool { if r.VRFVersion == vrfcommon.V2 { return false } - nativePayment, err := extraargs.FromExtraArgsV1(r.V2Plus.ExtraArgs) + nativePayment, err := extraargs.DecodeV1(r.V2Plus.ExtraArgs) if err != nil { panic(err) } diff --git a/core/services/vrf/v2/integration_helpers_test.go b/core/services/vrf/v2/integration_helpers_test.go index d61779c5714..2fccdb2b2e3 100644 --- a/core/services/vrf/v2/integration_helpers_test.go +++ b/core/services/vrf/v2/integration_helpers_test.go @@ -30,7 +30,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_external_sub_owner_example" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrfv2_transparent_upgradeable_proxy" "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" - "github.com/smartcontractkit/chainlink/v2/core/internal/cltest/heavyweight" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/evmtest" "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" @@ -41,6 +40,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/vrf/vrftesthelpers" "github.com/smartcontractkit/chainlink/v2/core/testdata/testspecs" "github.com/smartcontractkit/chainlink/v2/core/utils" + "github.com/smartcontractkit/chainlink/v2/core/utils/testutils/heavyweight" ) func testSingleConsumerHappyPath( diff --git a/core/services/vrf/v2/integration_v2_plus_test.go b/core/services/vrf/v2/integration_v2_plus_test.go index 53baaa0eda3..b4c47c3e0b9 100644 --- a/core/services/vrf/v2/integration_v2_plus_test.go +++ b/core/services/vrf/v2/integration_v2_plus_test.go @@ -17,6 +17,7 @@ import ( "github.com/stretchr/testify/require" commonconfig "github.com/smartcontractkit/chainlink-common/pkg/config" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/config/toml" evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" @@ -40,7 +41,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrfv2plus_consumer_example" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrfv2plus_reverting_example" "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" - "github.com/smartcontractkit/chainlink/v2/core/internal/cltest/heavyweight" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/configtest" "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" @@ -51,6 +51,7 @@ import ( v22 "github.com/smartcontractkit/chainlink/v2/core/services/vrf/v2" "github.com/smartcontractkit/chainlink/v2/core/services/vrf/vrfcommon" "github.com/smartcontractkit/chainlink/v2/core/services/vrf/vrftesthelpers" + "github.com/smartcontractkit/chainlink/v2/core/utils/testutils/heavyweight" ) type coordinatorV2PlusUniverse struct { @@ -965,7 +966,7 @@ func requestAndEstimateFulfillmentCost( requestLog := FindLatestRandomnessRequestedLog(t, uni.rootContract, vrfkey.PublicKey.MustHash(), nil) s, err := proof.BigToSeed(requestLog.PreSeed()) require.NoError(t, err) - extraArgs, err := extraargs.ExtraArgsV1(nativePayment) + extraArgs, err := extraargs.EncodeV1(nativePayment) require.NoError(t, err) proof, rc, err := proof.GenerateProofResponseV2Plus(app.GetKeyStore().VRF(), vrfkey.ID(), proof.PreSeedDataV2Plus{ PreSeed: s, diff --git a/core/services/vrf/v2/integration_v2_reverted_txns_test.go b/core/services/vrf/v2/integration_v2_reverted_txns_test.go index 25e3afcf751..6682fe9e88a 100644 --- a/core/services/vrf/v2/integration_v2_reverted_txns_test.go +++ b/core/services/vrf/v2/integration_v2_reverted_txns_test.go @@ -27,7 +27,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_coordinator_v2" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_external_sub_owner_example" "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" - "github.com/smartcontractkit/chainlink/v2/core/internal/cltest/heavyweight" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" "github.com/smartcontractkit/chainlink/v2/core/services/job" @@ -37,6 +36,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/vrf/vrfcommon" "github.com/smartcontractkit/chainlink/v2/core/testdata/testspecs" "github.com/smartcontractkit/chainlink/v2/core/utils" + "github.com/smartcontractkit/chainlink/v2/core/utils/testutils/heavyweight" ) var ( diff --git a/core/services/vrf/v2/integration_v2_test.go b/core/services/vrf/v2/integration_v2_test.go index e9ae908565a..33ed5a76b5c 100644 --- a/core/services/vrf/v2/integration_v2_test.go +++ b/core/services/vrf/v2/integration_v2_test.go @@ -63,7 +63,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrfv2_wrapper" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrfv2_wrapper_consumer_example" "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" - "github.com/smartcontractkit/chainlink/v2/core/internal/cltest/heavyweight" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/configtest" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/evmtest" @@ -83,6 +82,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/vrf/vrftesthelpers" "github.com/smartcontractkit/chainlink/v2/core/testdata/testspecs" "github.com/smartcontractkit/chainlink/v2/core/utils" + "github.com/smartcontractkit/chainlink/v2/core/utils/testutils/heavyweight" ) var defaultMaxGasPrice = uint64(1e12) @@ -142,7 +142,7 @@ func makeTestTxm(t *testing.T, txStore txmgr.TestEvmTxStore, keyStore keystore.M _, _, evmConfig := txmgr.MakeTestConfigs(t) txmConfig := txmgr.NewEvmTxmConfig(evmConfig) txm := txmgr.NewEvmTxm(ec.ConfiguredChainID(), txmConfig, evmConfig.Transactions(), keyStore.Eth(), logger.TestLogger(t), nil, nil, - nil, txStore, nil, nil, nil, nil) + nil, txStore, nil, nil, nil, nil, nil) return txm } diff --git a/core/services/vrf/v2/listener_v2_log_processor.go b/core/services/vrf/v2/listener_v2_log_processor.go index 9408768d4de..3e9acf77601 100644 --- a/core/services/vrf/v2/listener_v2_log_processor.go +++ b/core/services/vrf/v2/listener_v2_log_processor.go @@ -1126,7 +1126,7 @@ func (lsn *listenerV2) simulateFulfillment( }, }) var trrs pipeline.TaskRunResults - res.run, trrs, err = lsn.pipelineRunner.ExecuteRun(ctx, *lsn.job.PipelineSpec, vars, lg) + res.run, trrs, err = lsn.pipelineRunner.ExecuteRun(ctx, *lsn.job.PipelineSpec, vars) if err != nil { res.err = fmt.Errorf("executing run: %w", err) return res @@ -1168,7 +1168,7 @@ func (lsn *listenerV2) simulateFulfillment( return res } - finalResult := trrs.FinalResult(lg) + finalResult := trrs.FinalResult() if len(finalResult.Values) != 1 { res.err = errors.Errorf("unexpected number of outputs, expected 1, was %d", len(finalResult.Values)) return res diff --git a/core/services/vrf/v2/listener_v2_test.go b/core/services/vrf/v2/listener_v2_test.go index ac59f1fdb69..b7a8710c4f8 100644 --- a/core/services/vrf/v2/listener_v2_test.go +++ b/core/services/vrf/v2/listener_v2_test.go @@ -40,7 +40,7 @@ func makeTestTxm(t *testing.T, txStore txmgr.TestEvmTxStore, keyStore keystore.M ec := evmtest.NewEthClientMockWithDefaultChain(t) txmConfig := txmgr.NewEvmTxmConfig(evmConfig) txm := txmgr.NewEvmTxm(ec.ConfiguredChainID(), txmConfig, evmConfig.Transactions(), keyStore.Eth(), logger.TestLogger(t), nil, nil, - nil, txStore, nil, nil, nil, nil) + nil, txStore, nil, nil, nil, nil, nil) return txm } diff --git a/core/services/vrf/vrfcommon/types.go b/core/services/vrf/vrfcommon/types.go index a27fcd5beb8..7dbe9b15f61 100644 --- a/core/services/vrf/vrfcommon/types.go +++ b/core/services/vrf/vrfcommon/types.go @@ -14,13 +14,11 @@ type GethKeyStore interface { GetRoundRobinAddress(ctx context.Context, chainID *big.Int, addresses ...common.Address) (common.Address, error) } -//go:generate mockery --quiet --name Config --output ../mocks/ --case=underscore type Config interface { FinalityDepth() uint32 MinIncomingConfirmations() uint32 } -//go:generate mockery --quiet --name FeeConfig --output ../mocks/ --case=underscore type FeeConfig interface { LimitDefault() uint64 LimitJobType() config.LimitJobType diff --git a/core/services/webhook/delegate.go b/core/services/webhook/delegate.go index 690ae38d088..2c6d597f2aa 100644 --- a/core/services/webhook/delegate.go +++ b/core/services/webhook/delegate.go @@ -179,7 +179,7 @@ func (r *webhookJobRunner) RunJob(ctx context.Context, jobUUID uuid.UUID, reques run := pipeline.NewRun(*spec.PipelineSpec, vars) - _, err := r.runner.Run(ctx, run, jobLggr, true, nil) + _, err := r.runner.Run(ctx, run, true, nil) if err != nil { jobLggr.Errorw("Error running pipeline for webhook job", "err", err) return 0, err diff --git a/core/services/webhook/external_initiator_manager.go b/core/services/webhook/external_initiator_manager.go index 2f9a176906d..10614d71938 100644 --- a/core/services/webhook/external_initiator_manager.go +++ b/core/services/webhook/external_initiator_manager.go @@ -18,8 +18,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/store/models" ) -//go:generate mockery --quiet --name ExternalInitiatorManager --output ./mocks/ --case=underscore - // ExternalInitiatorManager manages HTTP requests to remote external initiators type ExternalInitiatorManager interface { Notify(ctx context.Context, webhookSpecID int32) error @@ -27,7 +25,6 @@ type ExternalInitiatorManager interface { FindExternalInitiatorByName(ctx context.Context, name string) (bridges.ExternalInitiator, error) } -//go:generate mockery --quiet --name HTTPClient --output ./mocks/ --case=underscore type HTTPClient interface { Do(req *http.Request) (*http.Response, error) } diff --git a/core/services/webhook/mocks/external_initiator_manager.go b/core/services/webhook/mocks/external_initiator_manager.go index 7e0b334f09a..215a3d4a5be 100644 --- a/core/services/webhook/mocks/external_initiator_manager.go +++ b/core/services/webhook/mocks/external_initiator_manager.go @@ -15,6 +15,14 @@ type ExternalInitiatorManager struct { mock.Mock } +type ExternalInitiatorManager_Expecter struct { + mock *mock.Mock +} + +func (_m *ExternalInitiatorManager) EXPECT() *ExternalInitiatorManager_Expecter { + return &ExternalInitiatorManager_Expecter{mock: &_m.Mock} +} + // DeleteJob provides a mock function with given fields: ctx, webhookSpecID func (_m *ExternalInitiatorManager) DeleteJob(ctx context.Context, webhookSpecID int32) error { ret := _m.Called(ctx, webhookSpecID) @@ -33,6 +41,35 @@ func (_m *ExternalInitiatorManager) DeleteJob(ctx context.Context, webhookSpecID return r0 } +// ExternalInitiatorManager_DeleteJob_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteJob' +type ExternalInitiatorManager_DeleteJob_Call struct { + *mock.Call +} + +// DeleteJob is a helper method to define mock.On call +// - ctx context.Context +// - webhookSpecID int32 +func (_e *ExternalInitiatorManager_Expecter) DeleteJob(ctx interface{}, webhookSpecID interface{}) *ExternalInitiatorManager_DeleteJob_Call { + return &ExternalInitiatorManager_DeleteJob_Call{Call: _e.mock.On("DeleteJob", ctx, webhookSpecID)} +} + +func (_c *ExternalInitiatorManager_DeleteJob_Call) Run(run func(ctx context.Context, webhookSpecID int32)) *ExternalInitiatorManager_DeleteJob_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(int32)) + }) + return _c +} + +func (_c *ExternalInitiatorManager_DeleteJob_Call) Return(_a0 error) *ExternalInitiatorManager_DeleteJob_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ExternalInitiatorManager_DeleteJob_Call) RunAndReturn(run func(context.Context, int32) error) *ExternalInitiatorManager_DeleteJob_Call { + _c.Call.Return(run) + return _c +} + // FindExternalInitiatorByName provides a mock function with given fields: ctx, name func (_m *ExternalInitiatorManager) FindExternalInitiatorByName(ctx context.Context, name string) (bridges.ExternalInitiator, error) { ret := _m.Called(ctx, name) @@ -61,6 +98,35 @@ func (_m *ExternalInitiatorManager) FindExternalInitiatorByName(ctx context.Cont return r0, r1 } +// ExternalInitiatorManager_FindExternalInitiatorByName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindExternalInitiatorByName' +type ExternalInitiatorManager_FindExternalInitiatorByName_Call struct { + *mock.Call +} + +// FindExternalInitiatorByName is a helper method to define mock.On call +// - ctx context.Context +// - name string +func (_e *ExternalInitiatorManager_Expecter) FindExternalInitiatorByName(ctx interface{}, name interface{}) *ExternalInitiatorManager_FindExternalInitiatorByName_Call { + return &ExternalInitiatorManager_FindExternalInitiatorByName_Call{Call: _e.mock.On("FindExternalInitiatorByName", ctx, name)} +} + +func (_c *ExternalInitiatorManager_FindExternalInitiatorByName_Call) Run(run func(ctx context.Context, name string)) *ExternalInitiatorManager_FindExternalInitiatorByName_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *ExternalInitiatorManager_FindExternalInitiatorByName_Call) Return(_a0 bridges.ExternalInitiator, _a1 error) *ExternalInitiatorManager_FindExternalInitiatorByName_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ExternalInitiatorManager_FindExternalInitiatorByName_Call) RunAndReturn(run func(context.Context, string) (bridges.ExternalInitiator, error)) *ExternalInitiatorManager_FindExternalInitiatorByName_Call { + _c.Call.Return(run) + return _c +} + // Notify provides a mock function with given fields: ctx, webhookSpecID func (_m *ExternalInitiatorManager) Notify(ctx context.Context, webhookSpecID int32) error { ret := _m.Called(ctx, webhookSpecID) @@ -79,6 +145,35 @@ func (_m *ExternalInitiatorManager) Notify(ctx context.Context, webhookSpecID in return r0 } +// ExternalInitiatorManager_Notify_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Notify' +type ExternalInitiatorManager_Notify_Call struct { + *mock.Call +} + +// Notify is a helper method to define mock.On call +// - ctx context.Context +// - webhookSpecID int32 +func (_e *ExternalInitiatorManager_Expecter) Notify(ctx interface{}, webhookSpecID interface{}) *ExternalInitiatorManager_Notify_Call { + return &ExternalInitiatorManager_Notify_Call{Call: _e.mock.On("Notify", ctx, webhookSpecID)} +} + +func (_c *ExternalInitiatorManager_Notify_Call) Run(run func(ctx context.Context, webhookSpecID int32)) *ExternalInitiatorManager_Notify_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(int32)) + }) + return _c +} + +func (_c *ExternalInitiatorManager_Notify_Call) Return(_a0 error) *ExternalInitiatorManager_Notify_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ExternalInitiatorManager_Notify_Call) RunAndReturn(run func(context.Context, int32) error) *ExternalInitiatorManager_Notify_Call { + _c.Call.Return(run) + return _c +} + // NewExternalInitiatorManager creates a new instance of ExternalInitiatorManager. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewExternalInitiatorManager(t interface { diff --git a/core/services/webhook/mocks/http_client.go b/core/services/webhook/mocks/http_client.go index 4bc69d5e7e8..4a6750871d8 100644 --- a/core/services/webhook/mocks/http_client.go +++ b/core/services/webhook/mocks/http_client.go @@ -13,6 +13,14 @@ type HTTPClient struct { mock.Mock } +type HTTPClient_Expecter struct { + mock *mock.Mock +} + +func (_m *HTTPClient) EXPECT() *HTTPClient_Expecter { + return &HTTPClient_Expecter{mock: &_m.Mock} +} + // Do provides a mock function with given fields: req func (_m *HTTPClient) Do(req *http.Request) (*http.Response, error) { ret := _m.Called(req) @@ -43,6 +51,34 @@ func (_m *HTTPClient) Do(req *http.Request) (*http.Response, error) { return r0, r1 } +// HTTPClient_Do_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Do' +type HTTPClient_Do_Call struct { + *mock.Call +} + +// Do is a helper method to define mock.On call +// - req *http.Request +func (_e *HTTPClient_Expecter) Do(req interface{}) *HTTPClient_Do_Call { + return &HTTPClient_Do_Call{Call: _e.mock.On("Do", req)} +} + +func (_c *HTTPClient_Do_Call) Run(run func(req *http.Request)) *HTTPClient_Do_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*http.Request)) + }) + return _c +} + +func (_c *HTTPClient_Do_Call) Return(_a0 *http.Response, _a1 error) *HTTPClient_Do_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *HTTPClient_Do_Call) RunAndReturn(run func(*http.Request) (*http.Response, error)) *HTTPClient_Do_Call { + _c.Call.Return(run) + return _c +} + // NewHTTPClient creates a new instance of HTTPClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewHTTPClient(t interface { diff --git a/core/services/workflows/delegate.go b/core/services/workflows/delegate.go index b937e0b580c..2aac9ba97b5 100644 --- a/core/services/workflows/delegate.go +++ b/core/services/workflows/delegate.go @@ -6,19 +6,17 @@ import ( "github.com/google/uuid" "github.com/pelletier/go-toml" - - "github.com/smartcontractkit/chainlink-common/pkg/capabilities" "github.com/smartcontractkit/chainlink-common/pkg/types/core" + "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/job" "github.com/smartcontractkit/chainlink/v2/core/services/workflows/store" ) type Delegate struct { - registry core.CapabilitiesRegistry - logger logger.Logger - getLocalNode func(ctx context.Context) (capabilities.Node, error) - store store.Store + registry core.CapabilitiesRegistry + logger logger.Logger + store store.Store } var _ job.Delegate = (*Delegate)(nil) @@ -36,16 +34,21 @@ func (d *Delegate) BeforeJobDeleted(spec job.Job) {} func (d *Delegate) OnDeleteJob(context.Context, job.Job) error { return nil } // ServicesForSpec satisfies the job.Delegate interface. -func (d *Delegate) ServicesForSpec(_ context.Context, spec job.Job) ([]job.ServiceCtx, error) { +func (d *Delegate) ServicesForSpec(ctx context.Context, spec job.Job) ([]job.ServiceCtx, error) { + sdkSpec, err := spec.WorkflowSpec.SDKSpec(ctx) + if err != nil { + return nil, err + } + cfg := Config{ Lggr: d.logger, - Spec: spec.WorkflowSpec.Workflow, + Workflow: sdkSpec, WorkflowID: spec.WorkflowSpec.WorkflowID, WorkflowOwner: spec.WorkflowSpec.WorkflowOwner, WorkflowName: spec.WorkflowSpec.WorkflowName, Registry: d.registry, - GetLocalNode: d.getLocalNode, Store: d.store, + Config: []byte(spec.WorkflowSpec.Config), } engine, err := NewEngine(cfg) if err != nil { @@ -58,12 +61,11 @@ func NewDelegate( logger logger.Logger, registry core.CapabilitiesRegistry, store store.Store, - getLocalNode func(ctx context.Context) (capabilities.Node, error), ) *Delegate { - return &Delegate{logger: logger, registry: registry, store: store, getLocalNode: getLocalNode} + return &Delegate{logger: logger, registry: registry, store: store} } -func ValidatedWorkflowJobSpec(tomlString string) (job.Job, error) { +func ValidatedWorkflowJobSpec(ctx context.Context, tomlString string) (job.Job, error) { var jb = job.Job{ExternalJobID: uuid.New()} tree, err := toml.Load(tomlString) @@ -85,16 +87,21 @@ func ValidatedWorkflowJobSpec(tomlString string) (job.Job, error) { return jb, fmt.Errorf("toml unmarshal error on workflow spec: %w", err) } - err = spec.Validate() + sdkSpec, err := spec.SDKSpec(ctx) if err != nil { - return jb, fmt.Errorf("invalid WorkflowSpec: %w", err) + return jb, fmt.Errorf("failed to convert to sdk workflow spec: %w", err) } // ensure the embedded workflow graph is valid - _, err = Parse(spec.Workflow) - if err != nil { + if _, err = Parse(sdkSpec); err != nil { return jb, fmt.Errorf("failed to parse workflow graph: %w", err) } + + err = spec.Validate(ctx) + if err != nil { + return jb, fmt.Errorf("invalid WorkflowSpec: %w", err) + } + jb.WorkflowSpec = &spec jb.WorkflowSpecID = &spec.ID diff --git a/core/services/workflows/delegate_test.go b/core/services/workflows/delegate_test.go index a12eac80bbf..d27a1012e6b 100644 --- a/core/services/workflows/delegate_test.go +++ b/core/services/workflows/delegate_test.go @@ -5,6 +5,7 @@ import ( "github.com/stretchr/testify/require" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/services/workflows" "github.com/smartcontractkit/chainlink/v2/core/testdata/testspecs" ) @@ -99,7 +100,7 @@ schemaVersion = 1 for _, tc := range tt { tc := tc t.Run(tc.name, func(t *testing.T) { - _, err := workflows.ValidatedWorkflowJobSpec(tc.workflowTomlFn()) + _, err := workflows.ValidatedWorkflowJobSpec(testutils.Context(t), tc.workflowTomlFn()) if tc.valid { require.NoError(t, err) } else { diff --git a/core/services/workflows/engine.go b/core/services/workflows/engine.go index f83d40b176f..26bc2d4cd68 100644 --- a/core/services/workflows/engine.go +++ b/core/services/workflows/engine.go @@ -10,6 +10,9 @@ import ( "time" "github.com/jonboulle/clockwork" + "github.com/smartcontractkit/chainlink-common/pkg/workflows/sdk" + + "github.com/smartcontractkit/chainlink-common/pkg/workflows/exec" "github.com/smartcontractkit/chainlink-common/pkg/capabilities" "github.com/smartcontractkit/chainlink-common/pkg/services" @@ -33,11 +36,10 @@ type Engine struct { logger logger.Logger registry core.CapabilitiesRegistry workflow *workflow - getLocalNode func(ctx context.Context) (capabilities.Node, error) localNode capabilities.Node executionStates store.Store pendingStepRequests chan stepRequest - triggerEvents chan capabilities.CapabilityResponse + triggerEvents chan capabilities.TriggerResponse stepUpdateCh chan store.WorkflowExecutionStep wg sync.WaitGroup stopCh services.StopChan @@ -164,9 +166,11 @@ func (e *Engine) initializeCapability(ctx context.Context, step *step) error { return newCPErr("failed to get capability info", err) } + step.info = info + // Special treatment for local targets - wrap into a transmission capability // If the DON is nil, this is a local target. - if info.CapabilityType == capabilities.CapabilityTypeTarget && info.DON == nil { + if info.CapabilityType == capabilities.CapabilityTypeTarget && info.IsLocal { l := e.logger.With("capabilityID", step.ID) l.Debug("wrapping capability in local transmission protocol") cp = transmission.NewLocalTargetCapability( @@ -179,7 +183,7 @@ func (e *Engine) initializeCapability(ctx context.Context, step *step) error { // We configure actions, consensus and targets here, and // they all satisfy the `CallbackCapability` interface - cc, ok := cp.(capabilities.CallbackCapability) + cc, ok := cp.(capabilities.ExecutableCapability) if !ok { return newCPErr("capability does not satisfy CallbackCapability") } @@ -222,7 +226,7 @@ func (e *Engine) init(ctx context.Context) { retryErr := retryable(ctx, e.logger, e.retryMs, e.maxRetries, func() error { // first wait for localDON to return a non-error response; this depends // on the underlying peerWrapper returning the PeerID. - node, err := e.getLocalNode(ctx) + node, err := e.registry.LocalNode(ctx) if err != nil { return fmt.Errorf("failed to get donInfo: %w", err) } @@ -318,32 +322,25 @@ func generateTriggerId(workflowID string, triggerIdx int) string { // registerTrigger is used during the initialization phase to bind a trigger to this workflow func (e *Engine) registerTrigger(ctx context.Context, t *triggerCapability, triggerIdx int) error { triggerID := generateTriggerId(e.workflow.id, triggerIdx) - triggerInputs, err := values.NewMap( - map[string]any{ - "triggerId": triggerID, - }, - ) - if err != nil { - return err - } tc, err := values.NewMap(t.Config) if err != nil { return err } - t.config = tc + t.config.Store(tc) - triggerRegRequest := capabilities.CapabilityRequest{ + triggerRegRequest := capabilities.TriggerRegistrationRequest{ Metadata: capabilities.RequestMetadata{ WorkflowID: e.workflow.id, + WorkflowOwner: e.workflow.owner, + WorkflowName: e.workflow.name, WorkflowDonID: e.localNode.WorkflowDON.ID, WorkflowDonConfigVersion: e.localNode.WorkflowDON.ConfigVersion, - WorkflowName: e.workflow.name, - WorkflowOwner: e.workflow.owner, + ReferenceID: t.Ref, }, - Config: tc, - Inputs: triggerInputs, + Config: t.config.Load(), + TriggerID: triggerID, } eventsCh, err := t.trigger.RegisterTrigger(ctx, triggerRegRequest) if err != nil { @@ -421,10 +418,10 @@ func (e *Engine) loop(ctx context.Context) { continue } - te := &capabilities.TriggerEvent{} - err := resp.Value.UnwrapTo(te) - if err != nil { - e.logger.Errorf("could not unwrap trigger event; error %v", resp.Err) + te := resp.Event + + if te.ID == "" { + e.logger.With(tIDKey, te.TriggerType).Error("trigger event ID is empty; not executing") continue } @@ -434,7 +431,7 @@ func (e *Engine) loop(ctx context.Context) { continue } - err = e.startExecution(ctx, executionID, resp.Value) + err = e.startExecution(ctx, executionID, resp.Event.Outputs) if err != nil { e.logger.With(eIDKey, executionID).Errorf("failed to start execution: %v", err) } @@ -465,7 +462,7 @@ func generateExecutionID(workflowID, eventID string) (string, error) { } // startExecution kicks off a new workflow execution when a trigger event is received. -func (e *Engine) startExecution(ctx context.Context, executionID string, event values.Value) error { +func (e *Engine) startExecution(ctx context.Context, executionID string, event *values.Map) error { e.logger.With("event", event, eIDKey, executionID).Debug("executing on a trigger event") ec := &store.WorkflowExecution{ Steps: map[string]*store.WorkflowExecutionStep{ @@ -680,6 +677,49 @@ func (e *Engine) workerForStepRequest(ctx context.Context, msg stepRequest) { } } +func merge(baseConfig *values.Map, overrideConfig *values.Map) *values.Map { + m := values.EmptyMap() + + for k, v := range baseConfig.Underlying { + m.Underlying[k] = v + } + + for k, v := range overrideConfig.Underlying { + m.Underlying[k] = v + } + + return m +} + +func (e *Engine) configForStep(ctx context.Context, executionID string, step *step) (*values.Map, error) { + ID := step.info.ID + + // If the capability info is missing a DON, then + // the capability is local, and we should use the localNode's DON ID. + var donID uint32 + if !step.info.IsLocal { + donID = step.info.DON.ID + } else { + donID = e.localNode.WorkflowDON.ID + } + + capConfig, err := e.registry.ConfigForCapability(ctx, ID, donID) + if err != nil { + e.logger.Warnw(fmt.Sprintf("could not retrieve config from remote registry: %s", err), "executionID", executionID, "capabilityID", ID) + return step.config, nil + } + + if capConfig.DefaultConfig == nil { + return step.config, nil + } + + // Merge the configs for now; note that this means that a workflow can override + // all of the config set by the capability. This is probably not desirable in + // the long-term, but we don't know much about those use cases so stick to a simpler + // implementation for now. + return merge(capConfig.DefaultConfig, step.config), nil +} + // executeStep executes the referenced capability within a step and returns the result. func (e *Engine) executeStep(ctx context.Context, msg stepRequest) (*values.Map, values.Value, error) { step, err := e.workflow.Vertex(msg.stepRef) @@ -694,7 +734,7 @@ func (e *Engine) executeStep(ctx context.Context, msg stepRequest) (*values.Map, inputs = step.Inputs.Mapping } - i, err := findAndInterpolateAllKeys(inputs, msg.state) + i, err := exec.FindAndInterpolateAllKeys(inputs, msg.state) if err != nil { return nil, nil, err } @@ -704,9 +744,14 @@ func (e *Engine) executeStep(ctx context.Context, msg stepRequest) (*values.Map, return nil, nil, err } + config, err := e.configForStep(ctx, msg.state.ExecutionID, step) + if err != nil { + return nil, nil, err + } + tr := capabilities.CapabilityRequest{ Inputs: inputsMap, - Config: step.config, + Config: config, Metadata: capabilities.RequestMetadata{ WorkflowID: msg.state.WorkflowID, WorkflowExecutionID: msg.state.ExecutionID, @@ -714,36 +759,30 @@ func (e *Engine) executeStep(ctx context.Context, msg stepRequest) (*values.Map, WorkflowName: e.workflow.name, WorkflowDonID: e.localNode.WorkflowDON.ID, WorkflowDonConfigVersion: e.localNode.WorkflowDON.ConfigVersion, + ReferenceID: msg.stepRef, }, } - output, err := executeSyncAndUnwrapSingleValue(ctx, step.capability, tr) + output, err := step.capability.Execute(ctx, tr) if err != nil { return inputsMap, nil, err } - return inputsMap, output, err + return inputsMap, output.Value, err } func (e *Engine) deregisterTrigger(ctx context.Context, t *triggerCapability, triggerIdx int) error { - triggerInputs, err := values.NewMap( - map[string]any{ - "triggerId": generateTriggerId(e.workflow.id, triggerIdx), - }, - ) - if err != nil { - return err - } - deregRequest := capabilities.CapabilityRequest{ + deregRequest := capabilities.TriggerRegistrationRequest{ Metadata: capabilities.RequestMetadata{ WorkflowID: e.workflow.id, WorkflowDonID: e.localNode.WorkflowDON.ID, WorkflowDonConfigVersion: e.localNode.WorkflowDON.ConfigVersion, WorkflowName: e.workflow.name, WorkflowOwner: e.workflow.owner, + ReferenceID: t.Ref, }, - Inputs: triggerInputs, - Config: t.config, + TriggerID: generateTriggerId(e.workflow.id, triggerIdx), + Config: t.config.Load(), } // if t.trigger == nil, then we haven't initialized the workflow @@ -815,7 +854,7 @@ func (e *Engine) Close() error { } type Config struct { - Spec string + Workflow sdk.WorkflowSpec WorkflowID string WorkflowOwner string WorkflowName string @@ -825,8 +864,8 @@ type Config struct { QueueSize int NewWorkerTimeout time.Duration MaxExecutionDuration time.Duration - GetLocalNode func(ctx context.Context) (capabilities.Node, error) Store store.Store + Config []byte // For testing purposes only maxRetries int @@ -868,12 +907,6 @@ func NewEngine(cfg Config) (engine *Engine, err error) { cfg.MaxExecutionDuration = defaultMaxExecutionDuration } - if cfg.GetLocalNode == nil { - cfg.GetLocalNode = func(ctx context.Context) (capabilities.Node, error) { - return capabilities.Node{}, nil - } - } - if cfg.retryMs == 0 { cfg.retryMs = 5000 } @@ -898,7 +931,7 @@ func NewEngine(cfg Config) (engine *Engine, err error) { // - that the resulting graph is strongly connected (i.e. no disjointed subgraphs exist) // - etc. - workflow, err := Parse(cfg.Spec) + workflow, err := Parse(cfg.Workflow) if err != nil { return nil, err } @@ -911,11 +944,10 @@ func NewEngine(cfg Config) (engine *Engine, err error) { logger: cfg.Lggr.Named("WorkflowEngine").With("workflowID", cfg.WorkflowID), registry: cfg.Registry, workflow: workflow, - getLocalNode: cfg.GetLocalNode, executionStates: cfg.Store, pendingStepRequests: make(chan stepRequest, cfg.QueueSize), stepUpdateCh: make(chan store.WorkflowExecutionStep), - triggerEvents: make(chan capabilities.CapabilityResponse), + triggerEvents: make(chan capabilities.TriggerResponse), stopCh: make(chan struct{}), newWorkerTimeout: cfg.NewWorkerTimeout, maxExecutionDuration: cfg.MaxExecutionDuration, @@ -930,24 +962,6 @@ func NewEngine(cfg Config) (engine *Engine, err error) { return engine, nil } -// ExecuteSyncAndUnwrapSingleValue is a convenience method that executes a capability synchronously and unwraps the -// result if it is a single value otherwise returns the list. -func executeSyncAndUnwrapSingleValue(ctx context.Context, cap capabilities.CallbackCapability, req capabilities.CapabilityRequest) (values.Value, error) { - l, err := capabilities.ExecuteSync(ctx, cap, req) - if err != nil { - return nil, err - } - - // `ExecuteSync` returns a `values.List` even if there was - // just one return value. If that is the case, let's unwrap the - // single value to make it easier to use in -- for example -- variable interpolation. - if len(l.Underlying) > 1 { - return l, nil - } - - return l.Underlying[0], nil -} - // Logging keys const ( cIDKey = "capabilityID" diff --git a/core/services/workflows/engine_test.go b/core/services/workflows/engine_test.go index 2c4129dbaf7..9bd1b285377 100644 --- a/core/services/workflows/engine_test.go +++ b/core/services/workflows/engine_test.go @@ -11,17 +11,21 @@ import ( "github.com/shopspring/decimal" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" "github.com/smartcontractkit/chainlink-common/pkg/capabilities" + capabilitiespb "github.com/smartcontractkit/chainlink-common/pkg/capabilities/pb" "github.com/smartcontractkit/chainlink-common/pkg/services/servicetest" "github.com/smartcontractkit/chainlink-common/pkg/values" "github.com/smartcontractkit/chainlink-common/pkg/workflows" + coreCap "github.com/smartcontractkit/chainlink/v2/core/capabilities" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/pgtest" "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/job" p2ptypes "github.com/smartcontractkit/chainlink/v2/core/services/p2p/types" + "github.com/smartcontractkit/chainlink/v2/core/services/registrysyncer" "github.com/smartcontractkit/chainlink/v2/core/services/workflows/store" ) @@ -99,26 +103,52 @@ func newTestDBStore(t *testing.T, clock clockwork.Clock) store.Store { return store.NewDBStore(db, logger.TestLogger(t), clock) } +type testConfigProvider struct { + localNode func(ctx context.Context) (capabilities.Node, error) + configForCapability func(ctx context.Context, capabilityID string, donID uint32) (registrysyncer.CapabilityConfiguration, error) +} + +func (t testConfigProvider) LocalNode(ctx context.Context) (capabilities.Node, error) { + if t.localNode != nil { + return t.localNode(ctx) + } + + peerID := p2ptypes.PeerID{} + return capabilities.Node{ + WorkflowDON: capabilities.DON{ + ID: 1, + }, + PeerID: &peerID, + }, nil +} + +func (t testConfigProvider) ConfigForCapability(ctx context.Context, capabilityID string, donID uint32) (registrysyncer.CapabilityConfiguration, error) { + if t.configForCapability != nil { + return t.configForCapability(ctx, capabilityID, donID) + } + + return registrysyncer.CapabilityConfiguration{}, nil +} + // newTestEngine creates a new engine with some test defaults. func newTestEngine(t *testing.T, reg *coreCap.Registry, spec string, opts ...func(c *Config)) (*Engine, *testHooks) { - peerID := p2ptypes.PeerID{} initFailed := make(chan struct{}) initSuccessful := make(chan struct{}) executionFinished := make(chan string, 100) clock := clockwork.NewFakeClock() + + sdkSpec, err := (&job.WorkflowSpec{ + Workflow: spec, + SpecType: job.YamlSpec, + }).SDKSpec(testutils.Context(t)) + require.NoError(t, err) + + reg.SetLocalRegistry(&testConfigProvider{}) cfg := Config{ WorkflowID: testWorkflowId, Lggr: logger.TestLogger(t), Registry: reg, - Spec: spec, - GetLocalNode: func(ctx context.Context) (capabilities.Node, error) { - return capabilities.Node{ - WorkflowDON: capabilities.DON{ - ID: 1, - }, - PeerID: &peerID, - }, nil - }, + Workflow: sdkSpec, maxRetries: 1, retryMs: 100, afterInit: func(success bool) { @@ -163,7 +193,7 @@ func getExecutionId(t *testing.T, eng *Engine, hooks *testHooks) string { type mockCapability struct { capabilities.CapabilityInfo - capabilities.CallbackExecutable + capabilities.Executable response chan capabilities.CapabilityResponse transform func(capabilities.CapabilityRequest) (capabilities.CapabilityResponse, error) } @@ -176,18 +206,14 @@ func newMockCapability(info capabilities.CapabilityInfo, transform func(capabili } } -func (m *mockCapability) Execute(ctx context.Context, req capabilities.CapabilityRequest) (<-chan capabilities.CapabilityResponse, error) { +func (m *mockCapability) Execute(ctx context.Context, req capabilities.CapabilityRequest) (capabilities.CapabilityResponse, error) { cr, err := m.transform(req) if err != nil { - return nil, err + return capabilities.CapabilityResponse{}, err } - ch := make(chan capabilities.CapabilityResponse, 10) - m.response <- cr - ch <- cr - close(ch) - return ch, nil + return cr, nil } func (m *mockCapability) RegisterToWorkflow(ctx context.Context, request capabilities.RegisterToWorkflowRequest) error { @@ -200,20 +226,20 @@ func (m *mockCapability) UnregisterFromWorkflow(ctx context.Context, request cap type mockTriggerCapability struct { capabilities.CapabilityInfo - triggerEvent *capabilities.CapabilityResponse - ch chan capabilities.CapabilityResponse + triggerEvent *capabilities.TriggerResponse + ch chan capabilities.TriggerResponse } var _ capabilities.TriggerCapability = (*mockTriggerCapability)(nil) -func (m *mockTriggerCapability) RegisterTrigger(ctx context.Context, req capabilities.CapabilityRequest) (<-chan capabilities.CapabilityResponse, error) { +func (m *mockTriggerCapability) RegisterTrigger(ctx context.Context, req capabilities.TriggerRegistrationRequest) (<-chan capabilities.TriggerResponse, error) { if m.triggerEvent != nil { m.ch <- *m.triggerEvent } return m.ch, nil } -func (m *mockTriggerCapability) UnregisterTrigger(ctx context.Context, req capabilities.CapabilityRequest) error { +func (m *mockTriggerCapability) UnregisterTrigger(ctx context.Context, req capabilities.TriggerRegistrationRequest) error { return nil } @@ -252,8 +278,11 @@ func TestEngineWithHardcodedWorkflow(t *testing.T) { servicetest.Run(t, eng) eid := getExecutionId(t, eng, testHooks) - assert.Equal(t, cr, <-target1.response) - assert.Equal(t, cr, <-target2.response) + resp1 := <-target1.response + assert.Equal(t, cr.Event.Outputs, resp1.Value) + + resp2 := <-target2.response + assert.Equal(t, cr.Event.Outputs, resp2.Value) state, err := eng.executionStates.Get(ctx, eid) require.NoError(t, err) @@ -304,14 +333,14 @@ targets: ` ) -func mockTrigger(t *testing.T) (capabilities.TriggerCapability, capabilities.CapabilityResponse) { +func mockTrigger(t *testing.T) (capabilities.TriggerCapability, capabilities.TriggerResponse) { mt := &mockTriggerCapability{ CapabilityInfo: capabilities.MustNewCapabilityInfo( "mercury-trigger@1.0.0", capabilities.CapabilityTypeTrigger, "issues a trigger when a mercury report is received.", ), - ch: make(chan capabilities.CapabilityResponse, 10), + ch: make(chan capabilities.TriggerResponse, 10), } resp, err := values.NewMap(map[string]any{ "123": decimal.NewFromFloat(1.00), @@ -319,11 +348,15 @@ func mockTrigger(t *testing.T) (capabilities.TriggerCapability, capabilities.Cap "789": decimal.NewFromFloat(1.50), }) require.NoError(t, err) - cr := capabilities.CapabilityResponse{ - Value: resp, + tr := capabilities.TriggerResponse{ + Event: capabilities.TriggerEvent{ + TriggerType: mt.ID, + ID: time.Now().UTC().Format(time.RFC3339), + Outputs: resp, + }, } - mt.triggerEvent = &cr - return mt, cr + mt.triggerEvent = &tr + return mt, tr } func mockNoopTrigger(t *testing.T) capabilities.TriggerCapability { @@ -333,7 +366,7 @@ func mockNoopTrigger(t *testing.T) capabilities.TriggerCapability { capabilities.CapabilityTypeTrigger, "issues a trigger when a mercury report is received.", ), - ch: make(chan capabilities.CapabilityResponse, 10), + ch: make(chan capabilities.TriggerResponse, 10), } return mt } @@ -359,10 +392,9 @@ func mockConsensusWithEarlyTermination() *mockCapability { "an ocr3 consensus capability", ), func(req capabilities.CapabilityRequest) (capabilities.CapabilityResponse, error) { - return capabilities.CapabilityResponse{ + return capabilities.CapabilityResponse{}, // copy error object to make sure message comparison works as expected - Err: errors.New(capabilities.ErrStopExecution.Error()), - }, nil + errors.New(capabilities.ErrStopExecution.Error()) }, ) } @@ -528,7 +560,7 @@ func TestEngine_MultiStepDependencies(t *testing.T) { ctx := testutils.Context(t) reg := coreCap.NewRegistry(logger.TestLogger(t)) - trigger, cr := mockTrigger(t) + trigger, tr := mockTrigger(t) require.NoError(t, reg.Add(ctx, trigger)) require.NoError(t, reg.Add(ctx, mockConsensus())) @@ -555,9 +587,10 @@ func TestEngine_MultiStepDependencies(t *testing.T) { obs := unw.(map[string]any)["observations"] assert.Len(t, obs, 2) - tunw, err := values.Unwrap(cr.Value) require.NoError(t, err) - assert.Equal(t, obs.([]any)[0], tunw) + uo, err := values.Unwrap(tr.Event.Outputs) + require.NoError(t, err) + assert.Equal(t, obs.([]any)[0].(map[string]any), uo) o, err := values.Unwrap(out) require.NoError(t, err) @@ -787,6 +820,19 @@ func TestEngine_GetsNodeInfoDuringInitialization(t *testing.T) { }, } retryCount := 0 + + reg.SetLocalRegistry(testConfigProvider{ + localNode: func(ctx context.Context) (capabilities.Node, error) { + n := capabilities.Node{} + err := errors.New("peer not initialized") + if retryCount > 0 { + n = node + err = nil + } + retryCount++ + return n, err + }, + }) eng, hooks := newTestEngine( t, reg, @@ -796,16 +842,6 @@ func TestEngine_GetsNodeInfoDuringInitialization(t *testing.T) { c.clock = clock c.maxRetries = 2 c.retryMs = 0 - c.GetLocalNode = func(ctx context.Context) (capabilities.Node, error) { - n := capabilities.Node{} - err := errors.New("peer not initialized") - if retryCount > 0 { - n = node - err = nil - } - retryCount++ - return n, err - } }, ) servicetest.Run(t, eng) @@ -969,3 +1005,126 @@ func TestEngine_Error(t *testing.T) { }) } } + +func TestEngine_MergesWorkflowConfigAndCRConfig(t *testing.T) { + ctx := testutils.Context(t) + reg := coreCap.NewRegistry(logger.TestLogger(t)) + + trigger, _ := mockTrigger(t) + + require.NoError(t, reg.Add(ctx, trigger)) + require.NoError(t, reg.Add(ctx, mockConsensus())) + writeID := "write_polygon-testnet-mumbai@1.0.0" + + gotConfig := values.EmptyMap() + target := newMockCapability( + // Create a remote capability so we don't use the local transmission protocol. + capabilities.MustNewRemoteCapabilityInfo( + writeID, + capabilities.CapabilityTypeTarget, + "a write capability targeting polygon testnet", + &capabilities.DON{ID: 1}, + ), + func(req capabilities.CapabilityRequest) (capabilities.CapabilityResponse, error) { + gotConfig = req.Config + + return capabilities.CapabilityResponse{ + Value: req.Inputs, + }, nil + }, + ) + require.NoError(t, reg.Add(ctx, target)) + + eng, testHooks := newTestEngine( + t, + reg, + simpleWorkflow, + ) + reg.SetLocalRegistry(testConfigProvider{ + configForCapability: func(ctx context.Context, capabilityID string, donID uint32) (registrysyncer.CapabilityConfiguration, error) { + if capabilityID != writeID { + return registrysyncer.CapabilityConfiguration{}, nil + } + + cm, err := values.WrapMap(map[string]any{ + "deltaStage": "1s", + "schedule": "allAtOnce", + }) + if err != nil { + return registrysyncer.CapabilityConfiguration{}, err + } + + cb, err := proto.Marshal(&capabilitiespb.CapabilityConfig{ + DefaultConfig: values.ProtoMap(cm), + }) + return registrysyncer.CapabilityConfiguration{ + Config: cb, + }, err + }, + }) + + servicetest.Run(t, eng) + + eid := getExecutionId(t, eng, testHooks) + + state, err := eng.executionStates.Get(ctx, eid) + require.NoError(t, err) + + assert.Equal(t, state.Status, store.StatusCompleted) + + m, err := values.Unwrap(gotConfig) + require.NoError(t, err) + assert.Equal(t, m.(map[string]any)["deltaStage"], "1s") + assert.Equal(t, m.(map[string]any)["schedule"], "allAtOnce") +} + +func TestEngine_HandlesNilConfigOnchain(t *testing.T) { + ctx := testutils.Context(t) + reg := coreCap.NewRegistry(logger.TestLogger(t)) + + trigger, _ := mockTrigger(t) + + require.NoError(t, reg.Add(ctx, trigger)) + require.NoError(t, reg.Add(ctx, mockConsensus())) + writeID := "write_polygon-testnet-mumbai@1.0.0" + + gotConfig := values.EmptyMap() + target := newMockCapability( + // Create a remote capability so we don't use the local transmission protocol. + capabilities.MustNewRemoteCapabilityInfo( + writeID, + capabilities.CapabilityTypeTarget, + "a write capability targeting polygon testnet", + &capabilities.DON{ID: 1}, + ), + func(req capabilities.CapabilityRequest) (capabilities.CapabilityResponse, error) { + gotConfig = req.Config + + return capabilities.CapabilityResponse{ + Value: req.Inputs, + }, nil + }, + ) + require.NoError(t, reg.Add(ctx, target)) + + eng, testHooks := newTestEngine( + t, + reg, + simpleWorkflow, + ) + reg.SetLocalRegistry(testConfigProvider{}) + + servicetest.Run(t, eng) + + eid := getExecutionId(t, eng, testHooks) + + state, err := eng.executionStates.Get(ctx, eid) + require.NoError(t, err) + + assert.Equal(t, state.Status, store.StatusCompleted) + + m, err := values.Unwrap(gotConfig) + require.NoError(t, err) + // The write target config contains three keys + assert.Len(t, m.(map[string]any), 3) +} diff --git a/core/services/workflows/models.go b/core/services/workflows/models.go index d55212a30ca..cf1fffa9a4c 100644 --- a/core/services/workflows/models.go +++ b/core/services/workflows/models.go @@ -3,8 +3,10 @@ package workflows import ( "errors" "fmt" + "sync/atomic" "github.com/dominikbraun/graph" + "github.com/smartcontractkit/chainlink-common/pkg/workflows/sdk" "github.com/smartcontractkit/chainlink-common/pkg/capabilities" "github.com/smartcontractkit/chainlink-common/pkg/values" @@ -24,7 +26,7 @@ type workflow struct { triggers []*triggerCapability - spec *workflows.WorkflowSpec + spec *sdk.WorkflowSpec } func (w *workflow) walkDo(start string, do func(s *step) error) error { @@ -78,22 +80,26 @@ func (w *workflow) dependents(start string) ([]*step, error) { // step wraps a Vertex with additional context for execution that is mutated by the engine type step struct { workflows.Vertex - capability capabilities.CallbackCapability + capability capabilities.ExecutableCapability + info capabilities.CapabilityInfo config *values.Map } type triggerCapability struct { - workflows.StepDefinition + sdk.StepDefinition trigger capabilities.TriggerCapability - config *values.Map + + config atomic.Pointer[values.Map] } -func Parse(yamlWorkflow string) (*workflow, error) { - wf2, err := workflows.ParseDependencyGraph(yamlWorkflow) +func Parse(sdkSpec sdk.WorkflowSpec) (*workflow, error) { + wf2, err := workflows.BuildDependencyGraph(sdkSpec) if err != nil { return nil, err } - return createWorkflow(wf2) + + wfs, err := createWorkflow(wf2) + return wfs, err } // createWorkflow converts a StaticWorkflow to an executable workflow diff --git a/core/services/workflows/models_test.go b/core/services/workflows/models_test.go index a28aeb9df01..68944e64bad 100644 --- a/core/services/workflows/models_test.go +++ b/core/services/workflows/models_test.go @@ -7,6 +7,9 @@ import ( "github.com/stretchr/testify/require" "github.com/smartcontractkit/chainlink-common/pkg/workflows" + + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" + "github.com/smartcontractkit/chainlink/v2/core/services/job" ) func TestParse_Graph(t *testing.T) { @@ -290,7 +293,11 @@ targets: for _, tc := range testCases { t.Run(tc.name, func(st *testing.T) { - wf, err := Parse(tc.yaml) + + spec, err := job.YAMLSpecFactory{}.Spec(testutils.Context(t), []byte(tc.yaml), nil) + require.NoError(t, err) + + wf, err := Parse(spec) if tc.errMsg != "" { assert.ErrorContains(st, err, tc.errMsg) } else { @@ -316,7 +323,10 @@ targets: } func TestParsesIntsCorrectly(t *testing.T) { - wf, err := Parse(hardcodedWorkflow) + spec, err := job.YAMLSpecFactory{}.Spec(testutils.Context(t), []byte(hardcodedWorkflow), nil) + require.NoError(t, err) + + wf, err := Parse(spec) require.NoError(t, err) n, err := wf.Vertex("evm_median") diff --git a/core/services/workflows/state.go b/core/services/workflows/state.go index 6fc61af3954..3a67f82a1ed 100644 --- a/core/services/workflows/state.go +++ b/core/services/workflows/state.go @@ -1,14 +1,9 @@ package workflows import ( - "fmt" - "strconv" - "strings" - "github.com/smartcontractkit/chainlink/v2/core/services/workflows/store" "github.com/smartcontractkit/chainlink-common/pkg/values" - "github.com/smartcontractkit/chainlink-common/pkg/workflows" ) // copyState returns a deep copy of the input executionState @@ -17,12 +12,10 @@ func copyState(es store.WorkflowExecution) store.WorkflowExecution { for ref, step := range es.Steps { var mval *values.Map if step.Inputs != nil { - mp := values.Proto(step.Inputs).GetMapValue() - mval = values.FromMapValueProto(mp) + mval = step.Inputs.CopyMap() } - op := values.Proto(step.Outputs.Value) - copiedov := values.FromProto(op) + copiedov := values.Copy(step.Outputs.Value) newState := &store.WorkflowExecutionStep{ ExecutionID: step.ExecutionID, @@ -46,93 +39,3 @@ func copyState(es store.WorkflowExecution) store.WorkflowExecution { Steps: steps, } } - -// interpolateKey takes a multi-part, dot-separated key and attempts to replace -// it with its corresponding value in `state`. -// -// A key is valid if it contains at least two parts, with: -// - the first part being the workflow step's `ref` variable -// - the second part being one of `inputs` or `outputs` -// -// If a key has more than two parts, then we traverse the parts -// to find the value we want to replace. -// We support traversing both nested maps and lists and any combination of the two. -func interpolateKey(key string, state store.WorkflowExecution) (any, error) { - parts := strings.Split(key, ".") - - if len(parts) < 2 { - return "", fmt.Errorf("cannot interpolate %s: must have at least two parts", key) - } - - // lookup the step we want to get either input or output state from - sc, ok := state.Steps[parts[0]] - if !ok { - return "", fmt.Errorf("could not find ref `%s`", parts[0]) - } - - var value values.Value - switch parts[1] { - case "inputs": - value = sc.Inputs - case "outputs": - if sc.Outputs.Err != nil { - return "", fmt.Errorf("cannot interpolate ref part `%s` in `%+v`: step has errored", parts[1], sc) - } - - value = sc.Outputs.Value - default: - return "", fmt.Errorf("cannot interpolate ref part `%s` in `%+v`: second part must be `inputs` or `outputs`", parts[1], sc) - } - - val, err := values.Unwrap(value) - if err != nil { - return "", err - } - - remainingParts := parts[2:] - for _, r := range remainingParts { - switch v := val.(type) { - case map[string]any: - inner, ok := v[r] - if !ok { - return "", fmt.Errorf("could not find ref part `%s` (ref: `%s`) in `%+v`", r, key, v) - } - - val = inner - case []any: - i, err := strconv.Atoi(r) - if err != nil { - return "", fmt.Errorf("could not interpolate ref part `%s` (ref: `%s`) in `%+v`: `%s` is not convertible to an int", r, key, v, r) - } - - if (i > len(v)-1) || (i < 0) { - return "", fmt.Errorf("could not interpolate ref part `%s` (ref: `%s`) in `%+v`: index out of bounds %d", r, key, v, i) - } - - val = v[i] - default: - return "", fmt.Errorf("could not interpolate ref part `%s` (ref: `%s`) in `%+v`", r, key, val) - } - } - - return val, nil -} - -// findAndInterpolateAllKeys takes an `input` any value, and recursively -// identifies any values that should be replaced from `state`. -// -// A value `v` should be replaced if it is wrapped as follows: `$(v)`. -func findAndInterpolateAllKeys(input any, state store.WorkflowExecution) (any, error) { - return workflows.DeepMap( - input, - func(el string) (any, error) { - matches := workflows.InterpolationTokenRe.FindStringSubmatch(el) - if len(matches) < 2 { - return el, nil - } - - interpolatedVar := matches[1] - return interpolateKey(interpolatedVar, state) - }, - ) -} diff --git a/core/services/workflows/state_test.go b/core/services/workflows/state_test.go deleted file mode 100644 index a9829a97c74..00000000000 --- a/core/services/workflows/state_test.go +++ /dev/null @@ -1,268 +0,0 @@ -package workflows - -import ( - "errors" - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - - "github.com/smartcontractkit/chainlink-common/pkg/values" - "github.com/smartcontractkit/chainlink/v2/core/services/workflows/store" -) - -func TestInterpolateKey(t *testing.T) { - t.Parallel() - val, err := values.NewMap( - map[string]any{ - "reports": map[string]any{ - "inner": "key", - }, - "reportsList": []any{ - "listElement", - }, - }, - ) - require.NoError(t, err) - - testCases := []struct { - name string - key string - state store.WorkflowExecution - expected any - errMsg string - }{ - { - name: "digging into a string", - key: "evm_median.outputs.reports", - state: store.WorkflowExecution{ - Steps: map[string]*store.WorkflowExecutionStep{ - "evm_median": { - Outputs: store.StepOutput{ - Value: values.NewString(""), - }, - }, - }, - }, - errMsg: "could not interpolate ref part `reports` (ref: `evm_median.outputs.reports`) in ``", - }, - { - name: "ref doesn't exist", - key: "evm_median.outputs.reports", - state: store.WorkflowExecution{ - Steps: map[string]*store.WorkflowExecutionStep{}, - }, - errMsg: "could not find ref `evm_median`", - }, - { - name: "less than 2 parts", - key: "evm_median", - state: store.WorkflowExecution{ - Steps: map[string]*store.WorkflowExecutionStep{}, - }, - errMsg: "must have at least two parts", - }, - { - name: "second part isn't `inputs` or `outputs`", - key: "evm_median.foo", - state: store.WorkflowExecution{ - Steps: map[string]*store.WorkflowExecutionStep{ - "evm_median": { - Outputs: store.StepOutput{ - Value: values.NewString(""), - }, - }, - }, - }, - errMsg: "second part must be `inputs` or `outputs`", - }, - { - name: "outputs has errored", - key: "evm_median.outputs", - state: store.WorkflowExecution{ - Steps: map[string]*store.WorkflowExecutionStep{ - "evm_median": { - Outputs: store.StepOutput{ - Err: errors.New("catastrophic error"), - }, - }, - }, - }, - errMsg: "step has errored", - }, - { - name: "digging into a recursive map", - key: "evm_median.outputs.reports.inner", - state: store.WorkflowExecution{ - Steps: map[string]*store.WorkflowExecutionStep{ - "evm_median": { - Outputs: store.StepOutput{ - Value: val, - }, - }, - }, - }, - expected: "key", - }, - { - name: "missing key in map", - key: "evm_median.outputs.reports.missing", - state: store.WorkflowExecution{ - Steps: map[string]*store.WorkflowExecutionStep{ - "evm_median": { - Outputs: store.StepOutput{ - Value: val, - }, - }, - }, - }, - errMsg: "could not find ref part `missing` (ref: `evm_median.outputs.reports.missing`) in", - }, - { - name: "digging into an array", - key: "evm_median.outputs.reportsList.0", - state: store.WorkflowExecution{ - Steps: map[string]*store.WorkflowExecutionStep{ - "evm_median": { - Outputs: store.StepOutput{ - Value: val, - }, - }, - }, - }, - expected: "listElement", - }, - { - name: "digging into an array that's too small", - key: "evm_median.outputs.reportsList.2", - state: store.WorkflowExecution{ - Steps: map[string]*store.WorkflowExecutionStep{ - "evm_median": { - Outputs: store.StepOutput{ - Value: val, - }, - }, - }, - }, - errMsg: "index out of bounds 2", - }, - { - name: "digging into an array with a string key", - key: "evm_median.outputs.reportsList.notAString", - state: store.WorkflowExecution{ - Steps: map[string]*store.WorkflowExecutionStep{ - "evm_median": { - Outputs: store.StepOutput{ - Value: val, - }, - }, - }, - }, - errMsg: "could not interpolate ref part `notAString` (ref: `evm_median.outputs.reportsList.notAString`) in `[listElement]`: `notAString` is not convertible to an int", - }, - { - name: "digging into an array with a negative index", - key: "evm_median.outputs.reportsList.-1", - state: store.WorkflowExecution{ - Steps: map[string]*store.WorkflowExecutionStep{ - "evm_median": { - Outputs: store.StepOutput{ - Value: val, - }, - }, - }, - }, - errMsg: "could not interpolate ref part `-1` (ref: `evm_median.outputs.reportsList.-1`) in `[listElement]`: index out of bounds -1", - }, - { - name: "empty element", - key: "evm_median.outputs..notAString", - state: store.WorkflowExecution{ - Steps: map[string]*store.WorkflowExecutionStep{ - "evm_median": { - Outputs: store.StepOutput{ - Value: val, - }, - }, - }, - }, - errMsg: "could not find ref part `` (ref: `evm_median.outputs..notAString`) in", - }, - } - - for _, tc := range testCases { - t.Run(tc.name, func(st *testing.T) { - got, err := interpolateKey(tc.key, tc.state) - if tc.errMsg != "" { - require.ErrorContains(st, err, tc.errMsg) - } else { - require.NoError(t, err) - assert.Equal(t, tc.expected, got) - } - }) - } -} - -func TestInterpolateInputsFromState(t *testing.T) { - t.Parallel() - testCases := []struct { - name string - inputs map[string]any - state store.WorkflowExecution - expected any - errMsg string - }{ - { - name: "substituting with a variable that exists", - inputs: map[string]any{ - "shouldnotinterpolate": map[string]any{ - "shouldinterpolate": "$(evm_median.outputs)", - }, - }, - state: store.WorkflowExecution{ - Steps: map[string]*store.WorkflowExecutionStep{ - "evm_median": { - Outputs: store.StepOutput{ - Value: values.NewString(""), - }, - }, - }, - }, - expected: map[string]any{ - "shouldnotinterpolate": map[string]any{ - "shouldinterpolate": "", - }, - }, - }, - { - name: "no substitution required", - inputs: map[string]any{ - "foo": "bar", - }, - state: store.WorkflowExecution{ - Steps: map[string]*store.WorkflowExecutionStep{ - "evm_median": { - Outputs: store.StepOutput{ - Value: values.NewString(""), - }, - }, - }, - }, - expected: map[string]any{ - "foo": "bar", - }, - }, - } - - for _, tc := range testCases { - t.Run(tc.name, func(st *testing.T) { - got, err := findAndInterpolateAllKeys(tc.inputs, tc.state) - if tc.errMsg != "" { - require.ErrorContains(st, err, tc.errMsg) - } else { - require.NoError(t, err) - assert.Equal(t, tc.expected, got) - } - }) - } -} diff --git a/core/services/workflows/store/models.go b/core/services/workflows/store/models.go index 275ca85b4fc..b7c7d189ad8 100644 --- a/core/services/workflows/store/models.go +++ b/core/services/workflows/store/models.go @@ -4,6 +4,7 @@ import ( "time" "github.com/smartcontractkit/chainlink-common/pkg/values" + "github.com/smartcontractkit/chainlink-common/pkg/workflows/exec" ) // Note: any update to the enum below should be reflected in @@ -50,3 +51,18 @@ type WorkflowExecution struct { UpdatedAt *time.Time FinishedAt *time.Time } + +func (w WorkflowExecution) ResultForStep(s string) (*exec.Result, bool) { + step, ok := w.Steps[s] + if !ok { + return &exec.Result{}, false + } + + return &exec.Result{ + Inputs: step.Inputs, + Outputs: step.Outputs.Value, + Error: step.Outputs.Err, + }, true +} + +var _ exec.Results = WorkflowExecution{} diff --git a/core/services/workflows/store/store_db.go b/core/services/workflows/store/store_db.go index e1d08629053..80ecfbb2d6e 100644 --- a/core/services/workflows/store/store_db.go +++ b/core/services/workflows/store/store_db.go @@ -127,7 +127,10 @@ func stepToState(step workflowStepRow) (*WorkflowExecutionStep, error) { return nil, err } - inputs = values.FromMapValueProto(vmProto) + inputs, err = values.FromMapValueProto(vmProto) + if err != nil { + return nil, err + } } var ( @@ -146,7 +149,10 @@ func stepToState(step workflowStepRow) (*WorkflowExecutionStep, error) { return nil, err } - outputs = values.FromProto(vProto) + outputs, err = values.FromProto(vProto) + if err != nil { + return nil, err + } } return &WorkflowExecutionStep{ diff --git a/core/sessions/authentication.go b/core/sessions/authentication.go index b923d5c16c7..acd6e4beccc 100644 --- a/core/sessions/authentication.go +++ b/core/sessions/authentication.go @@ -26,8 +26,6 @@ var ErrNotSupported = fmt.Errorf("functionality not supported with current authe // ErrEmptySessionID captures the empty case error message var ErrEmptySessionID = errors.New("session ID cannot be empty") -//go:generate mockery --quiet --name BasicAdminUsersORM --output ./mocks/ --case=underscore - // BasicAdminUsersORM is the interface that defines the functionality required for supporting basic admin functionality // adjacent to the identity provider authentication provider implementation. It is currently implemented by the local // users/sessions ORM containing local admin CLI actions. This is separate from the AuthenticationProvider, @@ -39,8 +37,6 @@ type BasicAdminUsersORM interface { FindUser(ctx context.Context, email string) (User, error) } -//go:generate mockery --quiet --name AuthenticationProvider --output ./mocks/ --case=underscore - // AuthenticationProvider is an interface that abstracts the required application calls to a user management backend // Currently localauth (users table DB) or LDAP server (readonly) type AuthenticationProvider interface { diff --git a/core/sessions/ldapauth/client.go b/core/sessions/ldapauth/client.go index bb259f8c9a2..872bd8f7636 100644 --- a/core/sessions/ldapauth/client.go +++ b/core/sessions/ldapauth/client.go @@ -12,15 +12,11 @@ type ldapClient struct { config config.LDAP } -//go:generate mockery --quiet --name LDAPClient --output ./mocks/ --case=underscore - // Wrapper for creating a handle to a *ldap.Conn/LDAPConn interface type LDAPClient interface { CreateEphemeralConnection() (LDAPConn, error) } -//go:generate mockery --quiet --name LDAPConn --output ./mocks/ --case=underscore - // Wrapper for ldap connection and mock testing, implemented by *ldap.Conn type LDAPConn interface { Search(searchRequest *ldap.SearchRequest) (*ldap.SearchResult, error) diff --git a/core/sessions/ldapauth/mocks/ldap_client.go b/core/sessions/ldapauth/mocks/ldap_client.go index f902730d02d..6f18d3a3e64 100644 --- a/core/sessions/ldapauth/mocks/ldap_client.go +++ b/core/sessions/ldapauth/mocks/ldap_client.go @@ -12,6 +12,14 @@ type LDAPClient struct { mock.Mock } +type LDAPClient_Expecter struct { + mock *mock.Mock +} + +func (_m *LDAPClient) EXPECT() *LDAPClient_Expecter { + return &LDAPClient_Expecter{mock: &_m.Mock} +} + // CreateEphemeralConnection provides a mock function with given fields: func (_m *LDAPClient) CreateEphemeralConnection() (ldapauth.LDAPConn, error) { ret := _m.Called() @@ -42,6 +50,33 @@ func (_m *LDAPClient) CreateEphemeralConnection() (ldapauth.LDAPConn, error) { return r0, r1 } +// LDAPClient_CreateEphemeralConnection_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateEphemeralConnection' +type LDAPClient_CreateEphemeralConnection_Call struct { + *mock.Call +} + +// CreateEphemeralConnection is a helper method to define mock.On call +func (_e *LDAPClient_Expecter) CreateEphemeralConnection() *LDAPClient_CreateEphemeralConnection_Call { + return &LDAPClient_CreateEphemeralConnection_Call{Call: _e.mock.On("CreateEphemeralConnection")} +} + +func (_c *LDAPClient_CreateEphemeralConnection_Call) Run(run func()) *LDAPClient_CreateEphemeralConnection_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *LDAPClient_CreateEphemeralConnection_Call) Return(_a0 ldapauth.LDAPConn, _a1 error) *LDAPClient_CreateEphemeralConnection_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *LDAPClient_CreateEphemeralConnection_Call) RunAndReturn(run func() (ldapauth.LDAPConn, error)) *LDAPClient_CreateEphemeralConnection_Call { + _c.Call.Return(run) + return _c +} + // NewLDAPClient creates a new instance of LDAPClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewLDAPClient(t interface { diff --git a/core/sessions/ldapauth/mocks/ldap_conn.go b/core/sessions/ldapauth/mocks/ldap_conn.go index 48783feaf55..5a6a5d499da 100644 --- a/core/sessions/ldapauth/mocks/ldap_conn.go +++ b/core/sessions/ldapauth/mocks/ldap_conn.go @@ -13,6 +13,14 @@ type LDAPConn struct { mock.Mock } +type LDAPConn_Expecter struct { + mock *mock.Mock +} + +func (_m *LDAPConn) EXPECT() *LDAPConn_Expecter { + return &LDAPConn_Expecter{mock: &_m.Mock} +} + // Bind provides a mock function with given fields: username, password func (_m *LDAPConn) Bind(username string, password string) error { ret := _m.Called(username, password) @@ -31,6 +39,35 @@ func (_m *LDAPConn) Bind(username string, password string) error { return r0 } +// LDAPConn_Bind_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Bind' +type LDAPConn_Bind_Call struct { + *mock.Call +} + +// Bind is a helper method to define mock.On call +// - username string +// - password string +func (_e *LDAPConn_Expecter) Bind(username interface{}, password interface{}) *LDAPConn_Bind_Call { + return &LDAPConn_Bind_Call{Call: _e.mock.On("Bind", username, password)} +} + +func (_c *LDAPConn_Bind_Call) Run(run func(username string, password string)) *LDAPConn_Bind_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(string)) + }) + return _c +} + +func (_c *LDAPConn_Bind_Call) Return(_a0 error) *LDAPConn_Bind_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *LDAPConn_Bind_Call) RunAndReturn(run func(string, string) error) *LDAPConn_Bind_Call { + _c.Call.Return(run) + return _c +} + // Close provides a mock function with given fields: func (_m *LDAPConn) Close() error { ret := _m.Called() @@ -49,6 +86,33 @@ func (_m *LDAPConn) Close() error { return r0 } +// LDAPConn_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close' +type LDAPConn_Close_Call struct { + *mock.Call +} + +// Close is a helper method to define mock.On call +func (_e *LDAPConn_Expecter) Close() *LDAPConn_Close_Call { + return &LDAPConn_Close_Call{Call: _e.mock.On("Close")} +} + +func (_c *LDAPConn_Close_Call) Run(run func()) *LDAPConn_Close_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *LDAPConn_Close_Call) Return(err error) *LDAPConn_Close_Call { + _c.Call.Return(err) + return _c +} + +func (_c *LDAPConn_Close_Call) RunAndReturn(run func() error) *LDAPConn_Close_Call { + _c.Call.Return(run) + return _c +} + // Search provides a mock function with given fields: searchRequest func (_m *LDAPConn) Search(searchRequest *ldap.SearchRequest) (*ldap.SearchResult, error) { ret := _m.Called(searchRequest) @@ -79,6 +143,34 @@ func (_m *LDAPConn) Search(searchRequest *ldap.SearchRequest) (*ldap.SearchResul return r0, r1 } +// LDAPConn_Search_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Search' +type LDAPConn_Search_Call struct { + *mock.Call +} + +// Search is a helper method to define mock.On call +// - searchRequest *ldap.SearchRequest +func (_e *LDAPConn_Expecter) Search(searchRequest interface{}) *LDAPConn_Search_Call { + return &LDAPConn_Search_Call{Call: _e.mock.On("Search", searchRequest)} +} + +func (_c *LDAPConn_Search_Call) Run(run func(searchRequest *ldap.SearchRequest)) *LDAPConn_Search_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*ldap.SearchRequest)) + }) + return _c +} + +func (_c *LDAPConn_Search_Call) Return(_a0 *ldap.SearchResult, _a1 error) *LDAPConn_Search_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *LDAPConn_Search_Call) RunAndReturn(run func(*ldap.SearchRequest) (*ldap.SearchResult, error)) *LDAPConn_Search_Call { + _c.Call.Return(run) + return _c +} + // NewLDAPConn creates a new instance of LDAPConn. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewLDAPConn(t interface { diff --git a/core/sessions/mocks/authentication_provider.go b/core/sessions/mocks/authentication_provider.go index 69777f3e96c..58955487893 100644 --- a/core/sessions/mocks/authentication_provider.go +++ b/core/sessions/mocks/authentication_provider.go @@ -18,6 +18,14 @@ type AuthenticationProvider struct { mock.Mock } +type AuthenticationProvider_Expecter struct { + mock *mock.Mock +} + +func (_m *AuthenticationProvider) EXPECT() *AuthenticationProvider_Expecter { + return &AuthenticationProvider_Expecter{mock: &_m.Mock} +} + // AuthorizedUserWithSession provides a mock function with given fields: ctx, sessionID func (_m *AuthenticationProvider) AuthorizedUserWithSession(ctx context.Context, sessionID string) (sessions.User, error) { ret := _m.Called(ctx, sessionID) @@ -46,6 +54,35 @@ func (_m *AuthenticationProvider) AuthorizedUserWithSession(ctx context.Context, return r0, r1 } +// AuthenticationProvider_AuthorizedUserWithSession_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AuthorizedUserWithSession' +type AuthenticationProvider_AuthorizedUserWithSession_Call struct { + *mock.Call +} + +// AuthorizedUserWithSession is a helper method to define mock.On call +// - ctx context.Context +// - sessionID string +func (_e *AuthenticationProvider_Expecter) AuthorizedUserWithSession(ctx interface{}, sessionID interface{}) *AuthenticationProvider_AuthorizedUserWithSession_Call { + return &AuthenticationProvider_AuthorizedUserWithSession_Call{Call: _e.mock.On("AuthorizedUserWithSession", ctx, sessionID)} +} + +func (_c *AuthenticationProvider_AuthorizedUserWithSession_Call) Run(run func(ctx context.Context, sessionID string)) *AuthenticationProvider_AuthorizedUserWithSession_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *AuthenticationProvider_AuthorizedUserWithSession_Call) Return(_a0 sessions.User, _a1 error) *AuthenticationProvider_AuthorizedUserWithSession_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *AuthenticationProvider_AuthorizedUserWithSession_Call) RunAndReturn(run func(context.Context, string) (sessions.User, error)) *AuthenticationProvider_AuthorizedUserWithSession_Call { + _c.Call.Return(run) + return _c +} + // ClearNonCurrentSessions provides a mock function with given fields: ctx, sessionID func (_m *AuthenticationProvider) ClearNonCurrentSessions(ctx context.Context, sessionID string) error { ret := _m.Called(ctx, sessionID) @@ -64,6 +101,35 @@ func (_m *AuthenticationProvider) ClearNonCurrentSessions(ctx context.Context, s return r0 } +// AuthenticationProvider_ClearNonCurrentSessions_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ClearNonCurrentSessions' +type AuthenticationProvider_ClearNonCurrentSessions_Call struct { + *mock.Call +} + +// ClearNonCurrentSessions is a helper method to define mock.On call +// - ctx context.Context +// - sessionID string +func (_e *AuthenticationProvider_Expecter) ClearNonCurrentSessions(ctx interface{}, sessionID interface{}) *AuthenticationProvider_ClearNonCurrentSessions_Call { + return &AuthenticationProvider_ClearNonCurrentSessions_Call{Call: _e.mock.On("ClearNonCurrentSessions", ctx, sessionID)} +} + +func (_c *AuthenticationProvider_ClearNonCurrentSessions_Call) Run(run func(ctx context.Context, sessionID string)) *AuthenticationProvider_ClearNonCurrentSessions_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *AuthenticationProvider_ClearNonCurrentSessions_Call) Return(_a0 error) *AuthenticationProvider_ClearNonCurrentSessions_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *AuthenticationProvider_ClearNonCurrentSessions_Call) RunAndReturn(run func(context.Context, string) error) *AuthenticationProvider_ClearNonCurrentSessions_Call { + _c.Call.Return(run) + return _c +} + // CreateAndSetAuthToken provides a mock function with given fields: ctx, user func (_m *AuthenticationProvider) CreateAndSetAuthToken(ctx context.Context, user *sessions.User) (*auth.Token, error) { ret := _m.Called(ctx, user) @@ -94,6 +160,35 @@ func (_m *AuthenticationProvider) CreateAndSetAuthToken(ctx context.Context, use return r0, r1 } +// AuthenticationProvider_CreateAndSetAuthToken_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateAndSetAuthToken' +type AuthenticationProvider_CreateAndSetAuthToken_Call struct { + *mock.Call +} + +// CreateAndSetAuthToken is a helper method to define mock.On call +// - ctx context.Context +// - user *sessions.User +func (_e *AuthenticationProvider_Expecter) CreateAndSetAuthToken(ctx interface{}, user interface{}) *AuthenticationProvider_CreateAndSetAuthToken_Call { + return &AuthenticationProvider_CreateAndSetAuthToken_Call{Call: _e.mock.On("CreateAndSetAuthToken", ctx, user)} +} + +func (_c *AuthenticationProvider_CreateAndSetAuthToken_Call) Run(run func(ctx context.Context, user *sessions.User)) *AuthenticationProvider_CreateAndSetAuthToken_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*sessions.User)) + }) + return _c +} + +func (_c *AuthenticationProvider_CreateAndSetAuthToken_Call) Return(_a0 *auth.Token, _a1 error) *AuthenticationProvider_CreateAndSetAuthToken_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *AuthenticationProvider_CreateAndSetAuthToken_Call) RunAndReturn(run func(context.Context, *sessions.User) (*auth.Token, error)) *AuthenticationProvider_CreateAndSetAuthToken_Call { + _c.Call.Return(run) + return _c +} + // CreateSession provides a mock function with given fields: ctx, sr func (_m *AuthenticationProvider) CreateSession(ctx context.Context, sr sessions.SessionRequest) (string, error) { ret := _m.Called(ctx, sr) @@ -122,6 +217,35 @@ func (_m *AuthenticationProvider) CreateSession(ctx context.Context, sr sessions return r0, r1 } +// AuthenticationProvider_CreateSession_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateSession' +type AuthenticationProvider_CreateSession_Call struct { + *mock.Call +} + +// CreateSession is a helper method to define mock.On call +// - ctx context.Context +// - sr sessions.SessionRequest +func (_e *AuthenticationProvider_Expecter) CreateSession(ctx interface{}, sr interface{}) *AuthenticationProvider_CreateSession_Call { + return &AuthenticationProvider_CreateSession_Call{Call: _e.mock.On("CreateSession", ctx, sr)} +} + +func (_c *AuthenticationProvider_CreateSession_Call) Run(run func(ctx context.Context, sr sessions.SessionRequest)) *AuthenticationProvider_CreateSession_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(sessions.SessionRequest)) + }) + return _c +} + +func (_c *AuthenticationProvider_CreateSession_Call) Return(_a0 string, _a1 error) *AuthenticationProvider_CreateSession_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *AuthenticationProvider_CreateSession_Call) RunAndReturn(run func(context.Context, sessions.SessionRequest) (string, error)) *AuthenticationProvider_CreateSession_Call { + _c.Call.Return(run) + return _c +} + // CreateUser provides a mock function with given fields: ctx, user func (_m *AuthenticationProvider) CreateUser(ctx context.Context, user *sessions.User) error { ret := _m.Called(ctx, user) @@ -140,6 +264,35 @@ func (_m *AuthenticationProvider) CreateUser(ctx context.Context, user *sessions return r0 } +// AuthenticationProvider_CreateUser_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateUser' +type AuthenticationProvider_CreateUser_Call struct { + *mock.Call +} + +// CreateUser is a helper method to define mock.On call +// - ctx context.Context +// - user *sessions.User +func (_e *AuthenticationProvider_Expecter) CreateUser(ctx interface{}, user interface{}) *AuthenticationProvider_CreateUser_Call { + return &AuthenticationProvider_CreateUser_Call{Call: _e.mock.On("CreateUser", ctx, user)} +} + +func (_c *AuthenticationProvider_CreateUser_Call) Run(run func(ctx context.Context, user *sessions.User)) *AuthenticationProvider_CreateUser_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*sessions.User)) + }) + return _c +} + +func (_c *AuthenticationProvider_CreateUser_Call) Return(_a0 error) *AuthenticationProvider_CreateUser_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *AuthenticationProvider_CreateUser_Call) RunAndReturn(run func(context.Context, *sessions.User) error) *AuthenticationProvider_CreateUser_Call { + _c.Call.Return(run) + return _c +} + // DeleteAuthToken provides a mock function with given fields: ctx, user func (_m *AuthenticationProvider) DeleteAuthToken(ctx context.Context, user *sessions.User) error { ret := _m.Called(ctx, user) @@ -158,6 +311,35 @@ func (_m *AuthenticationProvider) DeleteAuthToken(ctx context.Context, user *ses return r0 } +// AuthenticationProvider_DeleteAuthToken_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteAuthToken' +type AuthenticationProvider_DeleteAuthToken_Call struct { + *mock.Call +} + +// DeleteAuthToken is a helper method to define mock.On call +// - ctx context.Context +// - user *sessions.User +func (_e *AuthenticationProvider_Expecter) DeleteAuthToken(ctx interface{}, user interface{}) *AuthenticationProvider_DeleteAuthToken_Call { + return &AuthenticationProvider_DeleteAuthToken_Call{Call: _e.mock.On("DeleteAuthToken", ctx, user)} +} + +func (_c *AuthenticationProvider_DeleteAuthToken_Call) Run(run func(ctx context.Context, user *sessions.User)) *AuthenticationProvider_DeleteAuthToken_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*sessions.User)) + }) + return _c +} + +func (_c *AuthenticationProvider_DeleteAuthToken_Call) Return(_a0 error) *AuthenticationProvider_DeleteAuthToken_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *AuthenticationProvider_DeleteAuthToken_Call) RunAndReturn(run func(context.Context, *sessions.User) error) *AuthenticationProvider_DeleteAuthToken_Call { + _c.Call.Return(run) + return _c +} + // DeleteUser provides a mock function with given fields: ctx, email func (_m *AuthenticationProvider) DeleteUser(ctx context.Context, email string) error { ret := _m.Called(ctx, email) @@ -176,6 +358,35 @@ func (_m *AuthenticationProvider) DeleteUser(ctx context.Context, email string) return r0 } +// AuthenticationProvider_DeleteUser_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteUser' +type AuthenticationProvider_DeleteUser_Call struct { + *mock.Call +} + +// DeleteUser is a helper method to define mock.On call +// - ctx context.Context +// - email string +func (_e *AuthenticationProvider_Expecter) DeleteUser(ctx interface{}, email interface{}) *AuthenticationProvider_DeleteUser_Call { + return &AuthenticationProvider_DeleteUser_Call{Call: _e.mock.On("DeleteUser", ctx, email)} +} + +func (_c *AuthenticationProvider_DeleteUser_Call) Run(run func(ctx context.Context, email string)) *AuthenticationProvider_DeleteUser_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *AuthenticationProvider_DeleteUser_Call) Return(_a0 error) *AuthenticationProvider_DeleteUser_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *AuthenticationProvider_DeleteUser_Call) RunAndReturn(run func(context.Context, string) error) *AuthenticationProvider_DeleteUser_Call { + _c.Call.Return(run) + return _c +} + // DeleteUserSession provides a mock function with given fields: ctx, sessionID func (_m *AuthenticationProvider) DeleteUserSession(ctx context.Context, sessionID string) error { ret := _m.Called(ctx, sessionID) @@ -194,6 +405,35 @@ func (_m *AuthenticationProvider) DeleteUserSession(ctx context.Context, session return r0 } +// AuthenticationProvider_DeleteUserSession_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteUserSession' +type AuthenticationProvider_DeleteUserSession_Call struct { + *mock.Call +} + +// DeleteUserSession is a helper method to define mock.On call +// - ctx context.Context +// - sessionID string +func (_e *AuthenticationProvider_Expecter) DeleteUserSession(ctx interface{}, sessionID interface{}) *AuthenticationProvider_DeleteUserSession_Call { + return &AuthenticationProvider_DeleteUserSession_Call{Call: _e.mock.On("DeleteUserSession", ctx, sessionID)} +} + +func (_c *AuthenticationProvider_DeleteUserSession_Call) Run(run func(ctx context.Context, sessionID string)) *AuthenticationProvider_DeleteUserSession_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *AuthenticationProvider_DeleteUserSession_Call) Return(_a0 error) *AuthenticationProvider_DeleteUserSession_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *AuthenticationProvider_DeleteUserSession_Call) RunAndReturn(run func(context.Context, string) error) *AuthenticationProvider_DeleteUserSession_Call { + _c.Call.Return(run) + return _c +} + // FindExternalInitiator provides a mock function with given fields: ctx, eia func (_m *AuthenticationProvider) FindExternalInitiator(ctx context.Context, eia *auth.Token) (*bridges.ExternalInitiator, error) { ret := _m.Called(ctx, eia) @@ -224,6 +464,35 @@ func (_m *AuthenticationProvider) FindExternalInitiator(ctx context.Context, eia return r0, r1 } +// AuthenticationProvider_FindExternalInitiator_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindExternalInitiator' +type AuthenticationProvider_FindExternalInitiator_Call struct { + *mock.Call +} + +// FindExternalInitiator is a helper method to define mock.On call +// - ctx context.Context +// - eia *auth.Token +func (_e *AuthenticationProvider_Expecter) FindExternalInitiator(ctx interface{}, eia interface{}) *AuthenticationProvider_FindExternalInitiator_Call { + return &AuthenticationProvider_FindExternalInitiator_Call{Call: _e.mock.On("FindExternalInitiator", ctx, eia)} +} + +func (_c *AuthenticationProvider_FindExternalInitiator_Call) Run(run func(ctx context.Context, eia *auth.Token)) *AuthenticationProvider_FindExternalInitiator_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*auth.Token)) + }) + return _c +} + +func (_c *AuthenticationProvider_FindExternalInitiator_Call) Return(initiator *bridges.ExternalInitiator, err error) *AuthenticationProvider_FindExternalInitiator_Call { + _c.Call.Return(initiator, err) + return _c +} + +func (_c *AuthenticationProvider_FindExternalInitiator_Call) RunAndReturn(run func(context.Context, *auth.Token) (*bridges.ExternalInitiator, error)) *AuthenticationProvider_FindExternalInitiator_Call { + _c.Call.Return(run) + return _c +} + // FindUser provides a mock function with given fields: ctx, email func (_m *AuthenticationProvider) FindUser(ctx context.Context, email string) (sessions.User, error) { ret := _m.Called(ctx, email) @@ -252,6 +521,35 @@ func (_m *AuthenticationProvider) FindUser(ctx context.Context, email string) (s return r0, r1 } +// AuthenticationProvider_FindUser_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindUser' +type AuthenticationProvider_FindUser_Call struct { + *mock.Call +} + +// FindUser is a helper method to define mock.On call +// - ctx context.Context +// - email string +func (_e *AuthenticationProvider_Expecter) FindUser(ctx interface{}, email interface{}) *AuthenticationProvider_FindUser_Call { + return &AuthenticationProvider_FindUser_Call{Call: _e.mock.On("FindUser", ctx, email)} +} + +func (_c *AuthenticationProvider_FindUser_Call) Run(run func(ctx context.Context, email string)) *AuthenticationProvider_FindUser_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *AuthenticationProvider_FindUser_Call) Return(_a0 sessions.User, _a1 error) *AuthenticationProvider_FindUser_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *AuthenticationProvider_FindUser_Call) RunAndReturn(run func(context.Context, string) (sessions.User, error)) *AuthenticationProvider_FindUser_Call { + _c.Call.Return(run) + return _c +} + // FindUserByAPIToken provides a mock function with given fields: ctx, apiToken func (_m *AuthenticationProvider) FindUserByAPIToken(ctx context.Context, apiToken string) (sessions.User, error) { ret := _m.Called(ctx, apiToken) @@ -280,6 +578,35 @@ func (_m *AuthenticationProvider) FindUserByAPIToken(ctx context.Context, apiTok return r0, r1 } +// AuthenticationProvider_FindUserByAPIToken_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindUserByAPIToken' +type AuthenticationProvider_FindUserByAPIToken_Call struct { + *mock.Call +} + +// FindUserByAPIToken is a helper method to define mock.On call +// - ctx context.Context +// - apiToken string +func (_e *AuthenticationProvider_Expecter) FindUserByAPIToken(ctx interface{}, apiToken interface{}) *AuthenticationProvider_FindUserByAPIToken_Call { + return &AuthenticationProvider_FindUserByAPIToken_Call{Call: _e.mock.On("FindUserByAPIToken", ctx, apiToken)} +} + +func (_c *AuthenticationProvider_FindUserByAPIToken_Call) Run(run func(ctx context.Context, apiToken string)) *AuthenticationProvider_FindUserByAPIToken_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *AuthenticationProvider_FindUserByAPIToken_Call) Return(_a0 sessions.User, _a1 error) *AuthenticationProvider_FindUserByAPIToken_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *AuthenticationProvider_FindUserByAPIToken_Call) RunAndReturn(run func(context.Context, string) (sessions.User, error)) *AuthenticationProvider_FindUserByAPIToken_Call { + _c.Call.Return(run) + return _c +} + // GetUserWebAuthn provides a mock function with given fields: ctx, email func (_m *AuthenticationProvider) GetUserWebAuthn(ctx context.Context, email string) ([]sessions.WebAuthn, error) { ret := _m.Called(ctx, email) @@ -310,6 +637,35 @@ func (_m *AuthenticationProvider) GetUserWebAuthn(ctx context.Context, email str return r0, r1 } +// AuthenticationProvider_GetUserWebAuthn_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetUserWebAuthn' +type AuthenticationProvider_GetUserWebAuthn_Call struct { + *mock.Call +} + +// GetUserWebAuthn is a helper method to define mock.On call +// - ctx context.Context +// - email string +func (_e *AuthenticationProvider_Expecter) GetUserWebAuthn(ctx interface{}, email interface{}) *AuthenticationProvider_GetUserWebAuthn_Call { + return &AuthenticationProvider_GetUserWebAuthn_Call{Call: _e.mock.On("GetUserWebAuthn", ctx, email)} +} + +func (_c *AuthenticationProvider_GetUserWebAuthn_Call) Run(run func(ctx context.Context, email string)) *AuthenticationProvider_GetUserWebAuthn_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *AuthenticationProvider_GetUserWebAuthn_Call) Return(_a0 []sessions.WebAuthn, _a1 error) *AuthenticationProvider_GetUserWebAuthn_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *AuthenticationProvider_GetUserWebAuthn_Call) RunAndReturn(run func(context.Context, string) ([]sessions.WebAuthn, error)) *AuthenticationProvider_GetUserWebAuthn_Call { + _c.Call.Return(run) + return _c +} + // ListUsers provides a mock function with given fields: ctx func (_m *AuthenticationProvider) ListUsers(ctx context.Context) ([]sessions.User, error) { ret := _m.Called(ctx) @@ -340,6 +696,34 @@ func (_m *AuthenticationProvider) ListUsers(ctx context.Context) ([]sessions.Use return r0, r1 } +// AuthenticationProvider_ListUsers_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListUsers' +type AuthenticationProvider_ListUsers_Call struct { + *mock.Call +} + +// ListUsers is a helper method to define mock.On call +// - ctx context.Context +func (_e *AuthenticationProvider_Expecter) ListUsers(ctx interface{}) *AuthenticationProvider_ListUsers_Call { + return &AuthenticationProvider_ListUsers_Call{Call: _e.mock.On("ListUsers", ctx)} +} + +func (_c *AuthenticationProvider_ListUsers_Call) Run(run func(ctx context.Context)) *AuthenticationProvider_ListUsers_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *AuthenticationProvider_ListUsers_Call) Return(_a0 []sessions.User, _a1 error) *AuthenticationProvider_ListUsers_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *AuthenticationProvider_ListUsers_Call) RunAndReturn(run func(context.Context) ([]sessions.User, error)) *AuthenticationProvider_ListUsers_Call { + _c.Call.Return(run) + return _c +} + // SaveWebAuthn provides a mock function with given fields: ctx, token func (_m *AuthenticationProvider) SaveWebAuthn(ctx context.Context, token *sessions.WebAuthn) error { ret := _m.Called(ctx, token) @@ -358,6 +742,35 @@ func (_m *AuthenticationProvider) SaveWebAuthn(ctx context.Context, token *sessi return r0 } +// AuthenticationProvider_SaveWebAuthn_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SaveWebAuthn' +type AuthenticationProvider_SaveWebAuthn_Call struct { + *mock.Call +} + +// SaveWebAuthn is a helper method to define mock.On call +// - ctx context.Context +// - token *sessions.WebAuthn +func (_e *AuthenticationProvider_Expecter) SaveWebAuthn(ctx interface{}, token interface{}) *AuthenticationProvider_SaveWebAuthn_Call { + return &AuthenticationProvider_SaveWebAuthn_Call{Call: _e.mock.On("SaveWebAuthn", ctx, token)} +} + +func (_c *AuthenticationProvider_SaveWebAuthn_Call) Run(run func(ctx context.Context, token *sessions.WebAuthn)) *AuthenticationProvider_SaveWebAuthn_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*sessions.WebAuthn)) + }) + return _c +} + +func (_c *AuthenticationProvider_SaveWebAuthn_Call) Return(_a0 error) *AuthenticationProvider_SaveWebAuthn_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *AuthenticationProvider_SaveWebAuthn_Call) RunAndReturn(run func(context.Context, *sessions.WebAuthn) error) *AuthenticationProvider_SaveWebAuthn_Call { + _c.Call.Return(run) + return _c +} + // Sessions provides a mock function with given fields: ctx, offset, limit func (_m *AuthenticationProvider) Sessions(ctx context.Context, offset int, limit int) ([]sessions.Session, error) { ret := _m.Called(ctx, offset, limit) @@ -388,6 +801,36 @@ func (_m *AuthenticationProvider) Sessions(ctx context.Context, offset int, limi return r0, r1 } +// AuthenticationProvider_Sessions_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Sessions' +type AuthenticationProvider_Sessions_Call struct { + *mock.Call +} + +// Sessions is a helper method to define mock.On call +// - ctx context.Context +// - offset int +// - limit int +func (_e *AuthenticationProvider_Expecter) Sessions(ctx interface{}, offset interface{}, limit interface{}) *AuthenticationProvider_Sessions_Call { + return &AuthenticationProvider_Sessions_Call{Call: _e.mock.On("Sessions", ctx, offset, limit)} +} + +func (_c *AuthenticationProvider_Sessions_Call) Run(run func(ctx context.Context, offset int, limit int)) *AuthenticationProvider_Sessions_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(int), args[2].(int)) + }) + return _c +} + +func (_c *AuthenticationProvider_Sessions_Call) Return(_a0 []sessions.Session, _a1 error) *AuthenticationProvider_Sessions_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *AuthenticationProvider_Sessions_Call) RunAndReturn(run func(context.Context, int, int) ([]sessions.Session, error)) *AuthenticationProvider_Sessions_Call { + _c.Call.Return(run) + return _c +} + // SetAuthToken provides a mock function with given fields: ctx, user, token func (_m *AuthenticationProvider) SetAuthToken(ctx context.Context, user *sessions.User, token *auth.Token) error { ret := _m.Called(ctx, user, token) @@ -406,6 +849,36 @@ func (_m *AuthenticationProvider) SetAuthToken(ctx context.Context, user *sessio return r0 } +// AuthenticationProvider_SetAuthToken_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetAuthToken' +type AuthenticationProvider_SetAuthToken_Call struct { + *mock.Call +} + +// SetAuthToken is a helper method to define mock.On call +// - ctx context.Context +// - user *sessions.User +// - token *auth.Token +func (_e *AuthenticationProvider_Expecter) SetAuthToken(ctx interface{}, user interface{}, token interface{}) *AuthenticationProvider_SetAuthToken_Call { + return &AuthenticationProvider_SetAuthToken_Call{Call: _e.mock.On("SetAuthToken", ctx, user, token)} +} + +func (_c *AuthenticationProvider_SetAuthToken_Call) Run(run func(ctx context.Context, user *sessions.User, token *auth.Token)) *AuthenticationProvider_SetAuthToken_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*sessions.User), args[2].(*auth.Token)) + }) + return _c +} + +func (_c *AuthenticationProvider_SetAuthToken_Call) Return(_a0 error) *AuthenticationProvider_SetAuthToken_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *AuthenticationProvider_SetAuthToken_Call) RunAndReturn(run func(context.Context, *sessions.User, *auth.Token) error) *AuthenticationProvider_SetAuthToken_Call { + _c.Call.Return(run) + return _c +} + // SetPassword provides a mock function with given fields: ctx, user, newPassword func (_m *AuthenticationProvider) SetPassword(ctx context.Context, user *sessions.User, newPassword string) error { ret := _m.Called(ctx, user, newPassword) @@ -424,6 +897,36 @@ func (_m *AuthenticationProvider) SetPassword(ctx context.Context, user *session return r0 } +// AuthenticationProvider_SetPassword_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetPassword' +type AuthenticationProvider_SetPassword_Call struct { + *mock.Call +} + +// SetPassword is a helper method to define mock.On call +// - ctx context.Context +// - user *sessions.User +// - newPassword string +func (_e *AuthenticationProvider_Expecter) SetPassword(ctx interface{}, user interface{}, newPassword interface{}) *AuthenticationProvider_SetPassword_Call { + return &AuthenticationProvider_SetPassword_Call{Call: _e.mock.On("SetPassword", ctx, user, newPassword)} +} + +func (_c *AuthenticationProvider_SetPassword_Call) Run(run func(ctx context.Context, user *sessions.User, newPassword string)) *AuthenticationProvider_SetPassword_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*sessions.User), args[2].(string)) + }) + return _c +} + +func (_c *AuthenticationProvider_SetPassword_Call) Return(_a0 error) *AuthenticationProvider_SetPassword_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *AuthenticationProvider_SetPassword_Call) RunAndReturn(run func(context.Context, *sessions.User, string) error) *AuthenticationProvider_SetPassword_Call { + _c.Call.Return(run) + return _c +} + // TestPassword provides a mock function with given fields: ctx, email, password func (_m *AuthenticationProvider) TestPassword(ctx context.Context, email string, password string) error { ret := _m.Called(ctx, email, password) @@ -442,6 +945,36 @@ func (_m *AuthenticationProvider) TestPassword(ctx context.Context, email string return r0 } +// AuthenticationProvider_TestPassword_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TestPassword' +type AuthenticationProvider_TestPassword_Call struct { + *mock.Call +} + +// TestPassword is a helper method to define mock.On call +// - ctx context.Context +// - email string +// - password string +func (_e *AuthenticationProvider_Expecter) TestPassword(ctx interface{}, email interface{}, password interface{}) *AuthenticationProvider_TestPassword_Call { + return &AuthenticationProvider_TestPassword_Call{Call: _e.mock.On("TestPassword", ctx, email, password)} +} + +func (_c *AuthenticationProvider_TestPassword_Call) Run(run func(ctx context.Context, email string, password string)) *AuthenticationProvider_TestPassword_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string)) + }) + return _c +} + +func (_c *AuthenticationProvider_TestPassword_Call) Return(_a0 error) *AuthenticationProvider_TestPassword_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *AuthenticationProvider_TestPassword_Call) RunAndReturn(run func(context.Context, string, string) error) *AuthenticationProvider_TestPassword_Call { + _c.Call.Return(run) + return _c +} + // UpdateRole provides a mock function with given fields: ctx, email, newRole func (_m *AuthenticationProvider) UpdateRole(ctx context.Context, email string, newRole string) (sessions.User, error) { ret := _m.Called(ctx, email, newRole) @@ -470,6 +1003,36 @@ func (_m *AuthenticationProvider) UpdateRole(ctx context.Context, email string, return r0, r1 } +// AuthenticationProvider_UpdateRole_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateRole' +type AuthenticationProvider_UpdateRole_Call struct { + *mock.Call +} + +// UpdateRole is a helper method to define mock.On call +// - ctx context.Context +// - email string +// - newRole string +func (_e *AuthenticationProvider_Expecter) UpdateRole(ctx interface{}, email interface{}, newRole interface{}) *AuthenticationProvider_UpdateRole_Call { + return &AuthenticationProvider_UpdateRole_Call{Call: _e.mock.On("UpdateRole", ctx, email, newRole)} +} + +func (_c *AuthenticationProvider_UpdateRole_Call) Run(run func(ctx context.Context, email string, newRole string)) *AuthenticationProvider_UpdateRole_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string)) + }) + return _c +} + +func (_c *AuthenticationProvider_UpdateRole_Call) Return(_a0 sessions.User, _a1 error) *AuthenticationProvider_UpdateRole_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *AuthenticationProvider_UpdateRole_Call) RunAndReturn(run func(context.Context, string, string) (sessions.User, error)) *AuthenticationProvider_UpdateRole_Call { + _c.Call.Return(run) + return _c +} + // NewAuthenticationProvider creates a new instance of AuthenticationProvider. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewAuthenticationProvider(t interface { diff --git a/core/sessions/mocks/basic_admin_users_orm.go b/core/sessions/mocks/basic_admin_users_orm.go index 800f7b595a7..8ff07baf0b3 100644 --- a/core/sessions/mocks/basic_admin_users_orm.go +++ b/core/sessions/mocks/basic_admin_users_orm.go @@ -14,6 +14,14 @@ type BasicAdminUsersORM struct { mock.Mock } +type BasicAdminUsersORM_Expecter struct { + mock *mock.Mock +} + +func (_m *BasicAdminUsersORM) EXPECT() *BasicAdminUsersORM_Expecter { + return &BasicAdminUsersORM_Expecter{mock: &_m.Mock} +} + // CreateUser provides a mock function with given fields: ctx, user func (_m *BasicAdminUsersORM) CreateUser(ctx context.Context, user *sessions.User) error { ret := _m.Called(ctx, user) @@ -32,6 +40,35 @@ func (_m *BasicAdminUsersORM) CreateUser(ctx context.Context, user *sessions.Use return r0 } +// BasicAdminUsersORM_CreateUser_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateUser' +type BasicAdminUsersORM_CreateUser_Call struct { + *mock.Call +} + +// CreateUser is a helper method to define mock.On call +// - ctx context.Context +// - user *sessions.User +func (_e *BasicAdminUsersORM_Expecter) CreateUser(ctx interface{}, user interface{}) *BasicAdminUsersORM_CreateUser_Call { + return &BasicAdminUsersORM_CreateUser_Call{Call: _e.mock.On("CreateUser", ctx, user)} +} + +func (_c *BasicAdminUsersORM_CreateUser_Call) Run(run func(ctx context.Context, user *sessions.User)) *BasicAdminUsersORM_CreateUser_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*sessions.User)) + }) + return _c +} + +func (_c *BasicAdminUsersORM_CreateUser_Call) Return(_a0 error) *BasicAdminUsersORM_CreateUser_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *BasicAdminUsersORM_CreateUser_Call) RunAndReturn(run func(context.Context, *sessions.User) error) *BasicAdminUsersORM_CreateUser_Call { + _c.Call.Return(run) + return _c +} + // FindUser provides a mock function with given fields: ctx, email func (_m *BasicAdminUsersORM) FindUser(ctx context.Context, email string) (sessions.User, error) { ret := _m.Called(ctx, email) @@ -60,6 +97,35 @@ func (_m *BasicAdminUsersORM) FindUser(ctx context.Context, email string) (sessi return r0, r1 } +// BasicAdminUsersORM_FindUser_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindUser' +type BasicAdminUsersORM_FindUser_Call struct { + *mock.Call +} + +// FindUser is a helper method to define mock.On call +// - ctx context.Context +// - email string +func (_e *BasicAdminUsersORM_Expecter) FindUser(ctx interface{}, email interface{}) *BasicAdminUsersORM_FindUser_Call { + return &BasicAdminUsersORM_FindUser_Call{Call: _e.mock.On("FindUser", ctx, email)} +} + +func (_c *BasicAdminUsersORM_FindUser_Call) Run(run func(ctx context.Context, email string)) *BasicAdminUsersORM_FindUser_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *BasicAdminUsersORM_FindUser_Call) Return(_a0 sessions.User, _a1 error) *BasicAdminUsersORM_FindUser_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *BasicAdminUsersORM_FindUser_Call) RunAndReturn(run func(context.Context, string) (sessions.User, error)) *BasicAdminUsersORM_FindUser_Call { + _c.Call.Return(run) + return _c +} + // ListUsers provides a mock function with given fields: ctx func (_m *BasicAdminUsersORM) ListUsers(ctx context.Context) ([]sessions.User, error) { ret := _m.Called(ctx) @@ -90,6 +156,34 @@ func (_m *BasicAdminUsersORM) ListUsers(ctx context.Context) ([]sessions.User, e return r0, r1 } +// BasicAdminUsersORM_ListUsers_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListUsers' +type BasicAdminUsersORM_ListUsers_Call struct { + *mock.Call +} + +// ListUsers is a helper method to define mock.On call +// - ctx context.Context +func (_e *BasicAdminUsersORM_Expecter) ListUsers(ctx interface{}) *BasicAdminUsersORM_ListUsers_Call { + return &BasicAdminUsersORM_ListUsers_Call{Call: _e.mock.On("ListUsers", ctx)} +} + +func (_c *BasicAdminUsersORM_ListUsers_Call) Run(run func(ctx context.Context)) *BasicAdminUsersORM_ListUsers_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *BasicAdminUsersORM_ListUsers_Call) Return(_a0 []sessions.User, _a1 error) *BasicAdminUsersORM_ListUsers_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *BasicAdminUsersORM_ListUsers_Call) RunAndReturn(run func(context.Context) ([]sessions.User, error)) *BasicAdminUsersORM_ListUsers_Call { + _c.Call.Return(run) + return _c +} + // NewBasicAdminUsersORM creates a new instance of BasicAdminUsersORM. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewBasicAdminUsersORM(t interface { diff --git a/core/store/migrate/migrate_test.go b/core/store/migrate/migrate_test.go index 9a8bf96573e..adbc0ca2f66 100644 --- a/core/store/migrate/migrate_test.go +++ b/core/store/migrate/migrate_test.go @@ -19,7 +19,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" ubig "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils/big" "github.com/smartcontractkit/chainlink/v2/core/config/env" - "github.com/smartcontractkit/chainlink/v2/core/internal/cltest/heavyweight" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/configtest" "github.com/smartcontractkit/chainlink/v2/core/logger" @@ -28,6 +27,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/pipeline" "github.com/smartcontractkit/chainlink/v2/core/store/migrate" "github.com/smartcontractkit/chainlink/v2/core/store/models" + "github.com/smartcontractkit/chainlink/v2/core/utils/testutils/heavyweight" ) type OffchainReporting2OracleSpec100 struct { @@ -618,3 +618,14 @@ func BenchmarkBackfillingRecordsWithMigration202(b *testing.B) { require.NoError(b, err) } } + +func TestRollback_247_TxStateEnumUpdate(t *testing.T) { + ctx := testutils.Context(t) + _, db := heavyweight.FullTestDBV2(t, nil) + p, err := migrate.NewProvider(ctx, db.DB) + require.NoError(t, err) + _, err = p.DownTo(ctx, 54) + require.NoError(t, err) + _, err = p.UpTo(ctx, 247) + require.NoError(t, err) +} diff --git a/core/store/migrate/migrations/0247_bal_spec_placeholder.sql b/core/store/migrate/migrations/0247_bal_spec_placeholder.sql new file mode 100644 index 00000000000..3eedf2cf363 --- /dev/null +++ b/core/store/migrate/migrations/0247_bal_spec_placeholder.sql @@ -0,0 +1,61 @@ +-- +goose Up +CREATE TABLE bal_specs ( + id BIGSERIAL PRIMARY KEY +); +ALTER TABLE + jobs +ADD + COLUMN bal_spec_id INT REFERENCES bal_specs (id), +DROP + CONSTRAINT chk_specs, +ADD + CONSTRAINT chk_specs CHECK ( + num_nonnulls( + ocr_oracle_spec_id, ocr2_oracle_spec_id, + direct_request_spec_id, flux_monitor_spec_id, + keeper_spec_id, cron_spec_id, webhook_spec_id, + vrf_spec_id, blockhash_store_spec_id, + block_header_feeder_spec_id, bootstrap_spec_id, + gateway_spec_id, + legacy_gas_station_server_spec_id, + legacy_gas_station_sidecar_spec_id, + eal_spec_id, + workflow_spec_id, + standard_capabilities_spec_id, + ccip_spec_id, + ccip_bootstrap_spec_id, + bal_spec_id, + CASE "type" WHEN 'stream' THEN 1 ELSE NULL END -- 'stream' type lacks a spec but should not cause validation to fail + ) = 1 + ); + +-- +goose Down +ALTER TABLE + jobs +DROP + CONSTRAINT chk_specs, +ADD + CONSTRAINT chk_specs CHECK ( + num_nonnulls( + ocr_oracle_spec_id, ocr2_oracle_spec_id, + direct_request_spec_id, flux_monitor_spec_id, + keeper_spec_id, cron_spec_id, webhook_spec_id, + vrf_spec_id, blockhash_store_spec_id, + block_header_feeder_spec_id, bootstrap_spec_id, + gateway_spec_id, + legacy_gas_station_server_spec_id, + legacy_gas_station_sidecar_spec_id, + eal_spec_id, + workflow_spec_id, + standard_capabilities_spec_id, + ccip_spec_id, + ccip_bootstrap_spec_id, + CASE "type" WHEN 'stream' THEN 1 ELSE NULL END -- 'stream' type lacks a spec but should not cause validation to fail + ) = 1 + ); +ALTER TABLE + jobs +DROP + COLUMN bal_spec_id; +DROP + TABLE IF EXISTS bal_specs; \ No newline at end of file diff --git a/core/store/migrate/migrations/0248_add_tx_finalized_state.sql b/core/store/migrate/migrations/0248_add_tx_finalized_state.sql new file mode 100644 index 00000000000..dcfe8eec734 --- /dev/null +++ b/core/store/migrate/migrations/0248_add_tx_finalized_state.sql @@ -0,0 +1,135 @@ +-- +goose Up +-- Creating new column and enum instead of just adding new value to the existing enum so the migration changes match the rollback logic +-- Otherwise, migration will complain about mismatching column order + +-- +goose StatementBegin +-- Rename the existing enum with finalized state to mark it as old +ALTER TYPE evm.txes_state RENAME TO txes_state_old; + +-- Create new enum without finalized state +CREATE TYPE evm.txes_state AS ENUM ( + 'unstarted', + 'in_progress', + 'fatal_error', + 'unconfirmed', + 'confirmed_missing_receipt', + 'confirmed', + 'finalized' +); + +-- Add a new state column with the new enum type to the txes table +ALTER TABLE evm.txes ADD COLUMN state_new evm.txes_state; + +-- Copy data from the old column to the new +UPDATE evm.txes SET state_new = state::text::evm.txes_state; + +-- Drop constraints referring to old enum type on the old state column +ALTER TABLE evm.txes ALTER COLUMN state DROP DEFAULT; +ALTER TABLE evm.txes DROP CONSTRAINT chk_eth_txes_fsm; +DROP INDEX IF EXISTS idx_eth_txes_state_from_address_evm_chain_id; +DROP INDEX IF EXISTS idx_eth_txes_min_unconfirmed_nonce_for_key_evm_chain_id; +DROP INDEX IF EXISTS idx_only_one_in_progress_tx_per_account_id_per_evm_chain_id; +DROP INDEX IF EXISTS idx_eth_txes_unstarted_subject_id_evm_chain_id; + +-- Drop the old state column +ALTER TABLE evm.txes DROP state; + +-- Drop the old enum type +DROP TYPE evm.txes_state_old; + +-- Rename the new column name state to replace the old column +ALTER TABLE evm.txes RENAME state_new TO state; + +-- Reset the state column's default +ALTER TABLE evm.txes ALTER COLUMN state SET DEFAULT 'unstarted'::evm.txes_state, ALTER COLUMN state SET NOT NULL; + +-- Recreate constraint with finalized state +ALTER TABLE evm.txes ADD CONSTRAINT chk_eth_txes_fsm CHECK ( + state = 'unstarted'::evm.txes_state AND nonce IS NULL AND error IS NULL AND broadcast_at IS NULL AND initial_broadcast_at IS NULL + OR + state = 'in_progress'::evm.txes_state AND nonce IS NOT NULL AND error IS NULL AND broadcast_at IS NULL AND initial_broadcast_at IS NULL + OR + state = 'fatal_error'::evm.txes_state AND error IS NOT NULL + OR + state = 'unconfirmed'::evm.txes_state AND nonce IS NOT NULL AND error IS NULL AND broadcast_at IS NOT NULL AND initial_broadcast_at IS NOT NULL + OR + state = 'confirmed'::evm.txes_state AND nonce IS NOT NULL AND error IS NULL AND broadcast_at IS NOT NULL AND initial_broadcast_at IS NOT NULL + OR + state = 'confirmed_missing_receipt'::evm.txes_state AND nonce IS NOT NULL AND error IS NULL AND broadcast_at IS NOT NULL AND initial_broadcast_at IS NOT NULL + OR + state = 'finalized'::evm.txes_state AND nonce IS NOT NULL AND error IS NULL AND broadcast_at IS NOT NULL AND initial_broadcast_at IS NOT NULL +) NOT VALID; + +-- Recreate index to include finalized state +CREATE INDEX idx_eth_txes_state_from_address_evm_chain_id ON evm.txes(evm_chain_id, from_address, state) WHERE state <> 'confirmed'::evm.txes_state AND state <> 'finalized'::evm.txes_state; +CREATE INDEX idx_eth_txes_min_unconfirmed_nonce_for_key_evm_chain_id ON evm.txes(evm_chain_id, from_address, nonce) WHERE state = 'unconfirmed'::evm.txes_state; +CREATE UNIQUE INDEX idx_only_one_in_progress_tx_per_account_id_per_evm_chain_id ON evm.txes(evm_chain_id, from_address) WHERE state = 'in_progress'::evm.txes_state; +CREATE INDEX idx_eth_txes_unstarted_subject_id_evm_chain_id ON evm.txes(evm_chain_id, subject, id) WHERE subject IS NOT NULL AND state = 'unstarted'::evm.txes_state; +-- +goose StatementEnd + +-- +goose Down +-- +goose StatementBegin + +-- Rename the existing enum with finalized state to mark it as old +ALTER TYPE evm.txes_state RENAME TO txes_state_old; + +-- Create new enum without finalized state +CREATE TYPE evm.txes_state AS ENUM ( + 'unstarted', + 'in_progress', + 'fatal_error', + 'unconfirmed', + 'confirmed_missing_receipt', + 'confirmed' +); + +-- Add a new state column with the new enum type to the txes table +ALTER TABLE evm.txes ADD COLUMN state_new evm.txes_state; + +-- Update all transactions with finalized state to confirmed in the old state column +UPDATE evm.txes SET state = 'confirmed'::evm.txes_state_old WHERE state = 'finalized'::evm.txes_state_old; + +-- Copy data from the old column to the new +UPDATE evm.txes SET state_new = state::text::evm.txes_state; + +-- Drop constraints referring to old enum type on the old state column +ALTER TABLE evm.txes ALTER COLUMN state DROP DEFAULT; +ALTER TABLE evm.txes DROP CONSTRAINT chk_eth_txes_fsm; +DROP INDEX IF EXISTS idx_eth_txes_state_from_address_evm_chain_id; +DROP INDEX IF EXISTS idx_eth_txes_min_unconfirmed_nonce_for_key_evm_chain_id; +DROP INDEX IF EXISTS idx_only_one_in_progress_tx_per_account_id_per_evm_chain_id; +DROP INDEX IF EXISTS idx_eth_txes_unstarted_subject_id_evm_chain_id; + +-- Drop the old state column +ALTER TABLE evm.txes DROP state; + +-- Drop the old enum type +DROP TYPE evm.txes_state_old; + +-- Rename the new column name state to replace the old column +ALTER TABLE evm.txes RENAME state_new TO state; + +-- Reset the state column's default +ALTER TABLE evm.txes ALTER COLUMN state SET DEFAULT 'unstarted'::evm.txes_state, ALTER COLUMN state SET NOT NULL; + +-- Recereate constraint without finalized state +ALTER TABLE evm.txes ADD CONSTRAINT chk_eth_txes_fsm CHECK ( + state = 'unstarted'::evm.txes_state AND nonce IS NULL AND error IS NULL AND broadcast_at IS NULL AND initial_broadcast_at IS NULL + OR + state = 'in_progress'::evm.txes_state AND nonce IS NOT NULL AND error IS NULL AND broadcast_at IS NULL AND initial_broadcast_at IS NULL + OR + state = 'fatal_error'::evm.txes_state AND error IS NOT NULL + OR + state = 'unconfirmed'::evm.txes_state AND nonce IS NOT NULL AND error IS NULL AND broadcast_at IS NOT NULL AND initial_broadcast_at IS NOT NULL + OR + state = 'confirmed'::evm.txes_state AND nonce IS NOT NULL AND error IS NULL AND broadcast_at IS NOT NULL AND initial_broadcast_at IS NOT NULL + OR + state = 'confirmed_missing_receipt'::evm.txes_state AND nonce IS NOT NULL AND error IS NULL AND broadcast_at IS NOT NULL AND initial_broadcast_at IS NOT NULL +) NOT VALID; + +-- Recreate index with new enum type +CREATE INDEX idx_eth_txes_state_from_address_evm_chain_id ON evm.txes(evm_chain_id, from_address, state) WHERE state <> 'confirmed'::evm.txes_state; +CREATE INDEX idx_eth_txes_min_unconfirmed_nonce_for_key_evm_chain_id ON evm.txes(evm_chain_id, from_address, nonce) WHERE state = 'unconfirmed'::evm.txes_state; +CREATE UNIQUE INDEX idx_only_one_in_progress_tx_per_account_id_per_evm_chain_id ON evm.txes(evm_chain_id, from_address) WHERE state = 'in_progress'::evm.txes_state; +CREATE INDEX idx_eth_txes_unstarted_subject_id_evm_chain_id ON evm.txes(evm_chain_id, subject, id) WHERE subject IS NOT NULL AND state = 'unstarted'::evm.txes_state; +-- +goose StatementEnd diff --git a/core/store/migrate/migrations/0249_registry_syncer_state.sql b/core/store/migrate/migrations/0249_registry_syncer_state.sql new file mode 100644 index 00000000000..e34a3790a38 --- /dev/null +++ b/core/store/migrate/migrations/0249_registry_syncer_state.sql @@ -0,0 +1,11 @@ +-- +goose Up +CREATE TABLE registry_syncer_states ( + id SERIAL PRIMARY KEY, + data JSONB NOT NULL, + data_hash TEXT NOT NULL UNIQUE, + created_at TIMESTAMPTZ NOT NULL DEFAULT now() +); +-- +goose Down +-- +goose StatementBegin +DROP TABLE registry_syncer_states; +-- +goose StatementEnd diff --git a/core/store/migrate/migrations/0250_ccip_token_prices_fix.sql b/core/store/migrate/migrations/0250_ccip_token_prices_fix.sql new file mode 100644 index 00000000000..6c6cf02b43f --- /dev/null +++ b/core/store/migrate/migrations/0250_ccip_token_prices_fix.sql @@ -0,0 +1,49 @@ +-- +goose Up + +-- We need to re-create tables from scratch because of the unique constraint on tokens and chains selectors +DROP TABLE ccip.observed_token_prices; +DROP TABLE ccip.observed_gas_prices; + +CREATE TABLE ccip.observed_token_prices +( + chain_selector NUMERIC(20, 0) NOT NULL, + token_addr BYTEA NOT NULL, + token_price NUMERIC(78, 0) NOT NULL, + updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW(), + PRIMARY KEY (chain_selector, token_addr) +); + +CREATE TABLE ccip.observed_gas_prices +( + chain_selector NUMERIC(20, 0) NOT NULL, + source_chain_selector NUMERIC(20, 0) NOT NULL, + gas_price NUMERIC(78, 0) NOT NULL, + updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW(), + PRIMARY KEY (chain_selector, source_chain_selector) +); + +-- +goose Down +DROP TABLE ccip.observed_token_prices; +DROP TABLE ccip.observed_gas_prices; + +-- Restore state from migration 0236_ccip_prices_cache.sql +CREATE TABLE ccip.observed_gas_prices +( + chain_selector NUMERIC(20, 0) NOT NULL, + job_id INTEGER NOT NULL, + source_chain_selector NUMERIC(20, 0) NOT NULL, + gas_price NUMERIC(78, 0) NOT NULL, + created_at TIMESTAMPTZ NOT NULL DEFAULT NOW() +); + +CREATE TABLE ccip.observed_token_prices +( + chain_selector NUMERIC(20, 0) NOT NULL, + job_id INTEGER NOT NULL, + token_addr BYTEA NOT NULL, + token_price NUMERIC(78, 0) NOT NULL, + created_at TIMESTAMPTZ NOT NULL DEFAULT NOW() +); + +CREATE INDEX idx_ccip_gas_prices_chain_gas_price_timestamp ON ccip.observed_gas_prices (chain_selector, source_chain_selector, created_at DESC); +CREATE INDEX idx_ccip_token_prices_token_price_timestamp ON ccip.observed_token_prices (chain_selector, token_addr, created_at DESC); diff --git a/core/store/migrate/migrations/0251_add_don_id_to_channel_definitions.sql b/core/store/migrate/migrations/0251_add_don_id_to_channel_definitions.sql new file mode 100644 index 00000000000..9c77592b0ab --- /dev/null +++ b/core/store/migrate/migrations/0251_add_don_id_to_channel_definitions.sql @@ -0,0 +1,13 @@ +-- +goose Up +DELETE FROM channel_definitions; +ALTER TABLE channel_definitions DROP CONSTRAINT channel_definitions_pkey; +ALTER TABLE channel_definitions ADD COLUMN don_id bigint, ADD COLUMN version bigint; +ALTER TABLE channel_definitions RENAME COLUMN evm_chain_id TO chain_selector; +ALTER TABLE channel_definitions ALTER COLUMN chain_selector TYPE NUMERIC(20, 0); +ALTER TABLE channel_definitions ADD PRIMARY KEY (chain_selector, addr, don_id); + +-- +goose Down +ALTER TABLE channel_definitions DROP COLUMN don_id, DROP COLUMN version; +ALTER TABLE channel_definitions RENAME COLUMN chain_selector TO evm_chain_id; +ALTER TABLE channel_definitions ALTER COLUMN evm_chain_id TYPE bigint; +ALTER TABLE channel_definitions ADD PRIMARY KEY (evm_chain_id, addr); diff --git a/core/store/migrate/migrations/0252_add_llo_transmit_requests.sql b/core/store/migrate/migrations/0252_add_llo_transmit_requests.sql new file mode 100644 index 00000000000..d08ae0c921a --- /dev/null +++ b/core/store/migrate/migrations/0252_add_llo_transmit_requests.sql @@ -0,0 +1,21 @@ +-- +goose Up + +CREATE TABLE llo_mercury_transmit_queue ( + don_id BIGINT NOT NULL, + server_url TEXT NOT NULL, + config_digest BYTEA NOT NULL, + seq_nr BIGINT NOT NULL, + report BYTEA NOT NULL, + lifecycle_stage TEXT NOT NULL, + report_format BIGINT NOT NULL, + signatures BYTEA[] NOT NULL, + signers SMALLINT[] NOT NULL, + transmission_hash BYTEA NOT NULL, + PRIMARY KEY (transmission_hash) +); + + CREATE INDEX idx_llo_mercury_transmit_queue_don_id_server_url_seq_nr ON llo_mercury_transmit_queue (don_id, server_url, seq_nr DESC); + +-- +goose Down + +DROP TABLE llo_mercury_transmit_queue; diff --git a/core/store/migrate/migrations/0253_add_spec_type_to_workflow_spec.sql b/core/store/migrate/migrations/0253_add_spec_type_to_workflow_spec.sql new file mode 100644 index 00000000000..3c62c460976 --- /dev/null +++ b/core/store/migrate/migrations/0253_add_spec_type_to_workflow_spec.sql @@ -0,0 +1,13 @@ +-- +goose Up +-- +goose StatementBegin + +ALTER TABLE workflow_specs ADD COLUMN spec_type varchar(255) DEFAULT 'yaml'; + +-- +goose StatementEnd + +-- +goose Down +-- +goose StatementBegin + +ALTER TABLE workflow_specs DROP COLUMN spec_type; + +-- +goose StatementEnd \ No newline at end of file diff --git a/core/testdata/testspecs/v2_specs.go b/core/testdata/testspecs/v2_specs.go index 3a1798ab5ad..554b18ae818 100644 --- a/core/testdata/testspecs/v2_specs.go +++ b/core/testdata/testspecs/v2_specs.go @@ -1,6 +1,7 @@ package testspecs import ( + "crypto/sha256" "fmt" "strconv" "strings" @@ -10,9 +11,9 @@ import ( "github.com/google/uuid" "github.com/test-go/testify/require" - pkgworkflows "github.com/smartcontractkit/chainlink-common/pkg/workflows" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/services/job" "github.com/smartcontractkit/chainlink/v2/core/services/vrf/vrfcommon" "github.com/smartcontractkit/chainlink/v2/core/services/webhook" @@ -899,9 +900,8 @@ func (w WorkflowJobSpec) Job() job.Job { // GenerateWorkflowJobSpec creates a WorkflowJobSpec from the given workflow yaml spec string func GenerateWorkflowJobSpec(t *testing.T, spec string) WorkflowJobSpec { t.Helper() - s, err := pkgworkflows.ParseWorkflowSpecYaml(spec) - require.NoError(t, err, "failed to parse YAML workflow spec %s", spec) - id := s.CID + sum := sha256.Sum256([]byte(spec)) + id := fmt.Sprintf("%x", sum) template := ` type = "workflow" schemaVersion = 1 @@ -913,7 +913,7 @@ workflow = """ ` toml := fmt.Sprintf(template, id, spec) - j, err := workflows.ValidatedWorkflowJobSpec(toml) + j, err := workflows.ValidatedWorkflowJobSpec(testutils.Context(t), toml) require.NoError(t, err, "failed to validate TOML job spec for workflow %s", toml) return WorkflowJobSpec{toml: toml, j: j} } diff --git a/core/utils/http/http.go b/core/utils/http/http.go index 3336ac9f42f..0c713f9662c 100644 --- a/core/utils/http/http.go +++ b/core/utils/http/http.go @@ -7,7 +7,7 @@ import ( "net/url" "time" - "github.com/smartcontractkit/chainlink/v2/core/logger" + "github.com/smartcontractkit/chainlink-common/pkg/logger" ) type httpClientConfig interface { @@ -38,9 +38,13 @@ func newDefaultTransport() *http.Transport { return t } +type HTTPClient interface { + Do(req *http.Request) (*http.Response, error) +} + // HTTPRequest holds the request and config struct for a http request type HTTPRequest struct { - Client *http.Client + Client HTTPClient Request *http.Request Config HTTPRequestConfig Logger logger.Logger @@ -48,35 +52,46 @@ type HTTPRequest struct { // HTTPRequestConfig holds the configurable settings for a http request type HTTPRequestConfig struct { + // SizeLimit in bytes SizeLimit int64 } -// SendRequest sends a HTTPRequest, -// returns a body, status code, and error. -func (h *HTTPRequest) SendRequest() (responseBody []byte, statusCode int, headers http.Header, err error) { +// SendRequestReader allows for streaming the body directly and does not read +// it all into memory +// +// CALLER IS RESPONSIBLE FOR CLOSING RETURNED RESPONSE BODY +func (h *HTTPRequest) SendRequestReader() (responseBody io.ReadCloser, statusCode int, headers http.Header, err error) { start := time.Now() - r, err := h.Client.Do(h.Request) if err != nil { - h.Logger.Tracew("http adapter got error", "err", err) + logger.Sugared(h.Logger).Tracew("http adapter got error", "err", err) return nil, 0, nil, err } - defer logger.Sugared(h.Logger).ErrorIfFn(r.Body.Close, "Error closing SendRequest response body") statusCode = r.StatusCode elapsed := time.Since(start) - h.Logger.Tracew(fmt.Sprintf("http adapter got %v in %s", statusCode, elapsed), "statusCode", statusCode, "timeElapsedSeconds", elapsed) + logger.Sugared(h.Logger).Tracew(fmt.Sprintf("http adapter got %v in %s", statusCode, elapsed), "statusCode", statusCode, "timeElapsedSeconds", elapsed) source := http.MaxBytesReader(nil, r.Body, h.Config.SizeLimit) - bytes, err := io.ReadAll(source) + + return source, statusCode, r.Header, nil +} + +// SendRequest sends a HTTPRequest, +// returns a body, status code, and error. +func (h *HTTPRequest) SendRequest() (responseBody []byte, statusCode int, headers http.Header, err error) { + start := time.Now() + + source, statusCode, headers, err := h.SendRequestReader() if err != nil { - h.Logger.Errorw("http adapter error reading body", "err", err) - return nil, statusCode, nil, err + return nil, statusCode, headers, err } - elapsed = time.Since(start) - h.Logger.Tracew(fmt.Sprintf("http adapter finished after %s", elapsed), "statusCode", statusCode, "timeElapsedSeconds", elapsed) + defer logger.Sugared(h.Logger).ErrorIfFn(source.Close, "Error closing SendRequest response body") + bytes, err := io.ReadAll(source) + elapsed := time.Since(start) + logger.Sugared(h.Logger).Tracew(fmt.Sprintf("http adapter finished after %s", elapsed), "statusCode", statusCode, "timeElapsedSeconds", elapsed) responseBody = bytes - return responseBody, statusCode, r.Header, nil + return responseBody, statusCode, headers, nil } diff --git a/core/utils/http/http_allowed_ips.go b/core/utils/http/http_allowed_ips.go index 6432e4ff91d..2b77e89c7d4 100644 --- a/core/utils/http/http_allowed_ips.go +++ b/core/utils/http/http_allowed_ips.go @@ -9,7 +9,7 @@ import ( "github.com/pkg/errors" "go.uber.org/multierr" - "github.com/smartcontractkit/chainlink/v2/core/logger" + "github.com/smartcontractkit/chainlink-common/pkg/logger" ) var privateIPBlocks []*net.IPNet diff --git a/core/utils/testutils/heavyweight/orm.go b/core/utils/testutils/heavyweight/orm.go new file mode 100644 index 00000000000..4e824b1ab0f --- /dev/null +++ b/core/utils/testutils/heavyweight/orm.go @@ -0,0 +1,96 @@ +// Package heavyweight contains test helpers that are costly and you should +// think **real carefully** before using in your tests. +package heavyweight + +import ( + "os" + "path" + "runtime" + "strings" + "testing" + + "github.com/google/uuid" + "github.com/stretchr/testify/require" + + "github.com/jmoiron/sqlx" + + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/configtest" + "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" + "github.com/smartcontractkit/chainlink/v2/core/services/pg" + "github.com/smartcontractkit/chainlink/v2/core/store/dialects" + "github.com/smartcontractkit/chainlink/v2/core/store/models" + "github.com/smartcontractkit/chainlink/v2/internal/testdb" +) + +// FullTestDBV2 creates a pristine DB which runs in a separate database than the normal +// unit tests, so you can do things like use other Postgres connection types with it. +func FullTestDBV2(t testing.TB, overrideFn func(c *chainlink.Config, s *chainlink.Secrets)) (chainlink.GeneralConfig, *sqlx.DB) { + return KindFixtures.PrepareDB(t, overrideFn) +} + +// FullTestDBNoFixturesV2 is the same as FullTestDB, but it does not load fixtures. +func FullTestDBNoFixturesV2(t testing.TB, overrideFn func(c *chainlink.Config, s *chainlink.Secrets)) (chainlink.GeneralConfig, *sqlx.DB) { + return KindTemplate.PrepareDB(t, overrideFn) +} + +// FullTestDBEmptyV2 creates an empty DB (without migrations). +func FullTestDBEmptyV2(t testing.TB, overrideFn func(c *chainlink.Config, s *chainlink.Secrets)) (chainlink.GeneralConfig, *sqlx.DB) { + return KindEmpty.PrepareDB(t, overrideFn) +} + +func generateName() string { + return strings.ReplaceAll(uuid.New().String(), "-", "") +} + +type Kind int + +const ( + KindEmpty Kind = iota + KindTemplate + KindFixtures +) + +func (c Kind) PrepareDB(t testing.TB, overrideFn func(c *chainlink.Config, s *chainlink.Secrets)) (chainlink.GeneralConfig, *sqlx.DB) { + testutils.SkipShort(t, "FullTestDB") + + gcfg := configtest.NewGeneralConfigSimulated(t, func(c *chainlink.Config, s *chainlink.Secrets) { + c.Database.Dialect = dialects.Postgres + if overrideFn != nil { + overrideFn(c, s) + } + }) + + require.NoError(t, os.MkdirAll(gcfg.RootDir(), 0700)) + migrationTestDBURL, err := testdb.CreateOrReplace(gcfg.Database().URL(), generateName(), c != KindEmpty) + require.NoError(t, err) + db, err := pg.NewConnection(migrationTestDBURL, dialects.Postgres, gcfg.Database()) + require.NoError(t, err) + t.Cleanup(func() { + require.NoError(t, db.Close()) // must close before dropping + require.NoError(t, testdb.Drop(*testutils.MustParseURL(t, migrationTestDBURL))) + os.RemoveAll(gcfg.RootDir()) + }) + + gcfg = configtest.NewGeneralConfigSimulated(t, func(c *chainlink.Config, s *chainlink.Secrets) { + c.Database.Dialect = dialects.Postgres + s.Database.URL = models.MustSecretURL(migrationTestDBURL) + if overrideFn != nil { + overrideFn(c, s) + } + }) + + if c == KindFixtures { + _, filename, _, ok := runtime.Caller(1) + if !ok { + t.Fatal("could not get runtime.Caller(1)") + } + filepath := path.Join(path.Dir(filename), "../../../store/fixtures/fixtures.sql") + fixturesSQL, err := os.ReadFile(filepath) + require.NoError(t, err) + _, err = db.Exec(string(fixturesSQL)) + require.NoError(t, err) + } + + return gcfg, db +} diff --git a/core/utils/thread_control_test.go b/core/utils/thread_control_test.go index 51d5c00a578..49bec742428 100644 --- a/core/utils/thread_control_test.go +++ b/core/utils/thread_control_test.go @@ -7,6 +7,7 @@ import ( "testing" "time" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) @@ -50,7 +51,7 @@ func TestThreadControl_GoCtx(t *testing.T) { start := time.Now() wg.Wait() end := time.Since(start) - require.True(t, end > timeout-1) - require.True(t, end < 2*timeout) + assert.Greater(t, end, timeout-1) + assert.Less(t, end, 2*timeout) require.Equal(t, int32(1), finished.Load()) } diff --git a/core/utils/utils.go b/core/utils/utils.go index d076284112f..237f6a43589 100644 --- a/core/utils/utils.go +++ b/core/utils/utils.go @@ -481,6 +481,23 @@ func NewRedialBackoff() backoff.Backoff { } } +func NewHTTPFetchBackoff() backoff.Backoff { + return backoff.Backoff{ + Min: 100 * time.Millisecond, + Max: 15 * time.Second, + Jitter: true, + } +} + +// NewDBBackoff is a standard backoff to use for database connection issues +func NewDBBackoff() backoff.Backoff { + return backoff.Backoff{ + Min: 100 * time.Millisecond, + Max: 5 * time.Second, + Jitter: true, + } +} + // KeyedMutex allows to lock based on particular values type KeyedMutex struct { mutexes sync.Map diff --git a/core/web/assets/index.html b/core/web/assets/index.html index e50dfc07090..d5411542a95 100644 --- a/core/web/assets/index.html +++ b/core/web/assets/index.html @@ -1 +1 @@ -Operator UIChainlink
\ No newline at end of file +Operator UIChainlink
\ No newline at end of file diff --git a/core/web/assets/index.html.gz b/core/web/assets/index.html.gz index f32bc10dbc3..4f63d9ebf44 100644 Binary files a/core/web/assets/index.html.gz and b/core/web/assets/index.html.gz differ diff --git a/core/web/assets/main.6f07a88cfc748f57e21d.js b/core/web/assets/main.6f07a88cfc748f57e21d.js deleted file mode 100644 index bf6a280a999..00000000000 --- a/core/web/assets/main.6f07a88cfc748f57e21d.js +++ /dev/null @@ -1,174 +0,0 @@ -(()=>{var __webpack_modules__={98925(e,t,n){"use strict";let r=n(98633),i=n.g.Date;class a extends i{constructor(e){super(e),this.isDate=!0}toISOString(){return`${this.getUTCFullYear()}-${r(2,this.getUTCMonth()+1)}-${r(2,this.getUTCDate())}`}}e.exports=e=>{let t=new a(e);if(!isNaN(t))return t;throw TypeError("Invalid Datetime")}},86595(e,t,n){"use strict";let r=n(98633);class i extends Date{constructor(e){super(e+"Z"),this.isFloating=!0}toISOString(){let e=`${this.getUTCFullYear()}-${r(2,this.getUTCMonth()+1)}-${r(2,this.getUTCDate())}`,t=`${r(2,this.getUTCHours())}:${r(2,this.getUTCMinutes())}:${r(2,this.getUTCSeconds())}.${r(3,this.getUTCMilliseconds())}`;return`${e}T${t}`}}e.exports=e=>{let t=new i(e);if(!isNaN(t))return t;throw TypeError("Invalid Datetime")}},76114(e){"use strict";e.exports=e=>{let t=new Date(e);if(!isNaN(t))return t;throw TypeError("Invalid Datetime")}},99439(e,t,n){"use strict";let r=n(98633);class i extends Date{constructor(e){super(`0000-01-01T${e}Z`),this.isTime=!0}toISOString(){return`${r(2,this.getUTCHours())}:${r(2,this.getUTCMinutes())}:${r(2,this.getUTCSeconds())}.${r(3,this.getUTCMilliseconds())}`}}e.exports=e=>{let t=new i(e);if(!isNaN(t))return t;throw TypeError("Invalid Datetime")}},98633(e){"use strict";e.exports=(e,t)=>{for(t=String(t);t.length{let t=new TomlError(e.message);return t.code=e.code,t.wrapped=e,t},module.exports.TomlError=TomlError;let createDateTime=__webpack_require__(76114),createDateTimeFloat=__webpack_require__(86595),createDate=__webpack_require__(98925),createTime=__webpack_require__(99439),CTRL_I=9,CTRL_J=10,CTRL_M=13,CTRL_CHAR_BOUNDARY=31,CHAR_SP=32,CHAR_QUOT=34,CHAR_NUM=35,CHAR_APOS=39,CHAR_PLUS=43,CHAR_COMMA=44,CHAR_HYPHEN=45,CHAR_PERIOD=46,CHAR_0=48,CHAR_1=49,CHAR_7=55,CHAR_9=57,CHAR_COLON=58,CHAR_EQUALS=61,CHAR_A=65,CHAR_E=69,CHAR_F=70,CHAR_T=84,CHAR_U=85,CHAR_Z=90,CHAR_LOWBAR=95,CHAR_a=97,CHAR_b=98,CHAR_e=101,CHAR_f=102,CHAR_i=105,CHAR_l=108,CHAR_n=110,CHAR_o=111,CHAR_r=114,CHAR_s=115,CHAR_t=116,CHAR_u=117,CHAR_x=120,CHAR_z=122,CHAR_LCUB=123,CHAR_RCUB=125,CHAR_LSQB=91,CHAR_BSOL=92,CHAR_RSQB=93,CHAR_DEL=127,SURROGATE_FIRST=55296,SURROGATE_LAST=57343,escapes={[CHAR_b]:"\b",[CHAR_t]:" ",[CHAR_n]:"\n",[CHAR_f]:"\f",[CHAR_r]:"\r",[CHAR_QUOT]:'"',[CHAR_BSOL]:"\\"};function isDigit(e){return e>=CHAR_0&&e<=CHAR_9}function isHexit(e){return e>=CHAR_A&&e<=CHAR_F||e>=CHAR_a&&e<=CHAR_f||e>=CHAR_0&&e<=CHAR_9}function isBit(e){return e===CHAR_1||e===CHAR_0}function isOctit(e){return e>=CHAR_0&&e<=CHAR_7}function isAlphaNumQuoteHyphen(e){return e>=CHAR_A&&e<=CHAR_Z||e>=CHAR_a&&e<=CHAR_z||e>=CHAR_0&&e<=CHAR_9||e===CHAR_APOS||e===CHAR_QUOT||e===CHAR_LOWBAR||e===CHAR_HYPHEN}function isAlphaNumHyphen(e){return e>=CHAR_A&&e<=CHAR_Z||e>=CHAR_a&&e<=CHAR_z||e>=CHAR_0&&e<=CHAR_9||e===CHAR_LOWBAR||e===CHAR_HYPHEN}let _type=Symbol("type"),_declared=Symbol("declared"),hasOwnProperty=Object.prototype.hasOwnProperty,defineProperty=Object.defineProperty,descriptor={configurable:!0,enumerable:!0,writable:!0,value:void 0};function hasKey(e,t){return!!hasOwnProperty.call(e,t)||("__proto__"===t&&defineProperty(e,"__proto__",descriptor),!1)}let INLINE_TABLE=Symbol("inline-table");function InlineTable(){return Object.defineProperties({},{[_type]:{value:INLINE_TABLE}})}function isInlineTable(e){return null!==e&&"object"==typeof e&&e[_type]===INLINE_TABLE}let TABLE=Symbol("table");function Table(){return Object.defineProperties({},{[_type]:{value:TABLE},[_declared]:{value:!1,writable:!0}})}function isTable(e){return null!==e&&"object"==typeof e&&e[_type]===TABLE}let _contentType=Symbol("content-type"),INLINE_LIST=Symbol("inline-list");function InlineList(e){return Object.defineProperties([],{[_type]:{value:INLINE_LIST},[_contentType]:{value:e}})}function isInlineList(e){return null!==e&&"object"==typeof e&&e[_type]===INLINE_LIST}let LIST=Symbol("list");function List(){return Object.defineProperties([],{[_type]:{value:LIST}})}function isList(e){return null!==e&&"object"==typeof e&&e[_type]===LIST}let _custom;try{let utilInspect=eval("require('util').inspect");_custom=utilInspect.custom}catch(_){}let _inspect=_custom||"inspect";class BoxedBigInt{constructor(e){try{this.value=__webpack_require__.g.BigInt.asIntN(64,e)}catch(t){this.value=null}Object.defineProperty(this,_type,{value:INTEGER})}isNaN(){return null===this.value}toString(){return String(this.value)}[_inspect](){return`[BigInt: ${this.toString()}]}`}valueOf(){return this.value}}let INTEGER=Symbol("integer");function Integer(e){let t=Number(e);return(Object.is(t,-0)&&(t=0),__webpack_require__.g.BigInt&&!Number.isSafeInteger(t))?new BoxedBigInt(e):Object.defineProperties(new Number(t),{isNaN:{value:function(){return isNaN(this)}},[_type]:{value:INTEGER},[_inspect]:{value:()=>`[Integer: ${e}]`}})}function isInteger(e){return null!==e&&"object"==typeof e&&e[_type]===INTEGER}let FLOAT=Symbol("float");function Float(e){return Object.defineProperties(new Number(e),{[_type]:{value:FLOAT},[_inspect]:{value:()=>`[Float: ${e}]`}})}function isFloat(e){return null!==e&&"object"==typeof e&&e[_type]===FLOAT}function tomlType(e){let t=typeof e;if("object"===t){if(null===e)return"null";if(e instanceof Date)return"datetime";if(_type in e)switch(e[_type]){case INLINE_TABLE:return"inline-table";case INLINE_LIST:return"inline-list";case TABLE:return"table";case LIST:return"list";case FLOAT:return"float";case INTEGER:return"integer"}}return t}function makeParserClass(e){class t extends e{constructor(){super(),this.ctx=this.obj=Table()}atEndOfWord(){return this.char===CHAR_NUM||this.char===CTRL_I||this.char===CHAR_SP||this.atEndOfLine()}atEndOfLine(){return this.char===e.END||this.char===CTRL_J||this.char===CTRL_M}parseStart(){if(this.char===e.END)return null;if(this.char===CHAR_LSQB)return this.call(this.parseTableOrList);if(this.char===CHAR_NUM)return this.call(this.parseComment);if(this.char===CTRL_J||this.char===CHAR_SP||this.char===CTRL_I||this.char===CTRL_M)return null;if(isAlphaNumQuoteHyphen(this.char))return this.callNow(this.parseAssignStatement);else throw this.error(new TomlError(`Unknown character "${this.char}"`))}parseWhitespaceToEOL(){if(this.char===CHAR_SP||this.char===CTRL_I||this.char===CTRL_M)return null;if(this.char===CHAR_NUM)return this.goto(this.parseComment);if(this.char===e.END||this.char===CTRL_J)return this.return();throw this.error(new TomlError("Unexpected character, expected only whitespace or comments till end of line"))}parseAssignStatement(){return this.callNow(this.parseAssign,this.recordAssignStatement)}recordAssignStatement(e){let t=this.ctx,n=e.key.pop();for(let r of e.key){if(hasKey(t,r)&&!isTable(t[r]))throw this.error(new TomlError("Can't redefine existing key"));t=t[r]=t[r]||Table()}if(hasKey(t,n))throw this.error(new TomlError("Can't redefine existing key"));return t[_declared]=!0,isInteger(e.value)||isFloat(e.value)?t[n]=e.value.valueOf():t[n]=e.value,this.goto(this.parseWhitespaceToEOL)}parseAssign(){return this.callNow(this.parseKeyword,this.recordAssignKeyword)}recordAssignKeyword(e){return this.state.resultTable?this.state.resultTable.push(e):this.state.resultTable=[e],this.goto(this.parseAssignKeywordPreDot)}parseAssignKeywordPreDot(){return this.char===CHAR_PERIOD?this.next(this.parseAssignKeywordPostDot):this.char!==CHAR_SP&&this.char!==CTRL_I?this.goto(this.parseAssignEqual):void 0}parseAssignKeywordPostDot(){if(this.char!==CHAR_SP&&this.char!==CTRL_I)return this.callNow(this.parseKeyword,this.recordAssignKeyword)}parseAssignEqual(){if(this.char===CHAR_EQUALS)return this.next(this.parseAssignPreValue);throw this.error(new TomlError('Invalid character, expected "="'))}parseAssignPreValue(){return this.char===CHAR_SP||this.char===CTRL_I?null:this.callNow(this.parseValue,this.recordAssignValue)}recordAssignValue(e){return this.returnNow({key:this.state.resultTable,value:e})}parseComment(){do{if(this.char===e.END||this.char===CTRL_J)return this.return();if(this.char===CHAR_DEL||this.char<=CTRL_CHAR_BOUNDARY&&this.char!==CTRL_I)throw this.errorControlCharIn("comments")}while(this.nextChar())}parseTableOrList(){if(this.char!==CHAR_LSQB)return this.goto(this.parseTable);this.next(this.parseList)}parseTable(){return this.ctx=this.obj,this.goto(this.parseTableNext)}parseTableNext(){return this.char===CHAR_SP||this.char===CTRL_I?null:this.callNow(this.parseKeyword,this.parseTableMore)}parseTableMore(e){if(this.char===CHAR_SP||this.char===CTRL_I)return null;if(this.char===CHAR_RSQB){if(hasKey(this.ctx,e)&&(!isTable(this.ctx[e])||this.ctx[e][_declared]))throw this.error(new TomlError("Can't redefine existing key"));return this.ctx=this.ctx[e]=this.ctx[e]||Table(),this.ctx[_declared]=!0,this.next(this.parseWhitespaceToEOL)}if(this.char===CHAR_PERIOD){if(hasKey(this.ctx,e)){if(isTable(this.ctx[e]))this.ctx=this.ctx[e];else if(isList(this.ctx[e]))this.ctx=this.ctx[e][this.ctx[e].length-1];else throw this.error(new TomlError("Can't redefine existing key"))}else this.ctx=this.ctx[e]=Table();return this.next(this.parseTableNext)}throw this.error(new TomlError("Unexpected character, expected whitespace, . or ]"))}parseList(){return this.ctx=this.obj,this.goto(this.parseListNext)}parseListNext(){return this.char===CHAR_SP||this.char===CTRL_I?null:this.callNow(this.parseKeyword,this.parseListMore)}parseListMore(e){if(this.char===CHAR_SP||this.char===CTRL_I)return null;if(this.char===CHAR_RSQB){if(hasKey(this.ctx,e)||(this.ctx[e]=List()),isInlineList(this.ctx[e]))throw this.error(new TomlError("Can't extend an inline array"));if(isList(this.ctx[e])){let t=Table();this.ctx[e].push(t),this.ctx=t}else throw this.error(new TomlError("Can't redefine an existing key"));return this.next(this.parseListEnd)}if(this.char===CHAR_PERIOD){if(hasKey(this.ctx,e)){if(isInlineList(this.ctx[e]))throw this.error(new TomlError("Can't extend an inline array"));if(isInlineTable(this.ctx[e]))throw this.error(new TomlError("Can't extend an inline table"));else if(isList(this.ctx[e]))this.ctx=this.ctx[e][this.ctx[e].length-1];else if(isTable(this.ctx[e]))this.ctx=this.ctx[e];else throw this.error(new TomlError("Can't redefine an existing key"))}else this.ctx=this.ctx[e]=Table();return this.next(this.parseListNext)}throw this.error(new TomlError("Unexpected character, expected whitespace, . or ]"))}parseListEnd(e){if(this.char===CHAR_RSQB)return this.next(this.parseWhitespaceToEOL);throw this.error(new TomlError("Unexpected character, expected whitespace, . or ]"))}parseValue(){if(this.char===e.END)throw this.error(new TomlError("Key without value"));if(this.char===CHAR_QUOT)return this.next(this.parseDoubleString);if(this.char===CHAR_APOS)return this.next(this.parseSingleString);if(this.char===CHAR_HYPHEN||this.char===CHAR_PLUS)return this.goto(this.parseNumberSign);if(this.char===CHAR_i)return this.next(this.parseInf);if(this.char===CHAR_n)return this.next(this.parseNan);if(isDigit(this.char))return this.goto(this.parseNumberOrDateTime);else if(this.char===CHAR_t||this.char===CHAR_f)return this.goto(this.parseBoolean);else if(this.char===CHAR_LSQB)return this.call(this.parseInlineList,this.recordValue);else if(this.char===CHAR_LCUB)return this.call(this.parseInlineTable,this.recordValue);else throw this.error(new TomlError("Unexpected character, expecting string, number, datetime, boolean, inline array or inline table"))}recordValue(e){return this.returnNow(e)}parseInf(){if(this.char===CHAR_n)return this.next(this.parseInf2);throw this.error(new TomlError('Unexpected character, expected "inf", "+inf" or "-inf"'))}parseInf2(){if(this.char===CHAR_f)return"-"===this.state.buf?this.return(-1/0):this.return(1/0);throw this.error(new TomlError('Unexpected character, expected "inf", "+inf" or "-inf"'))}parseNan(){if(this.char===CHAR_a)return this.next(this.parseNan2);throw this.error(new TomlError('Unexpected character, expected "nan"'))}parseNan2(){if(this.char===CHAR_n)return this.return(NaN);throw this.error(new TomlError('Unexpected character, expected "nan"'))}parseKeyword(){return this.char===CHAR_QUOT?this.next(this.parseBasicString):this.char===CHAR_APOS?this.next(this.parseLiteralString):this.goto(this.parseBareKey)}parseBareKey(){do{if(this.char===e.END)throw this.error(new TomlError("Key ended without value"));if(isAlphaNumHyphen(this.char))this.consume();else if(0!==this.state.buf.length)return this.returnNow();else throw this.error(new TomlError("Empty bare keys are not allowed"))}while(this.nextChar())}parseSingleString(){return this.char===CHAR_APOS?this.next(this.parseLiteralMultiStringMaybe):this.goto(this.parseLiteralString)}parseLiteralString(){do{if(this.char===CHAR_APOS)return this.return();if(this.atEndOfLine())throw this.error(new TomlError("Unterminated string"));if(this.char===CHAR_DEL||this.char<=CTRL_CHAR_BOUNDARY&&this.char!==CTRL_I)throw this.errorControlCharIn("strings");else this.consume()}while(this.nextChar())}parseLiteralMultiStringMaybe(){return this.char===CHAR_APOS?this.next(this.parseLiteralMultiString):this.returnNow()}parseLiteralMultiString(){return this.char===CTRL_M?null:this.char===CTRL_J?this.next(this.parseLiteralMultiStringContent):this.goto(this.parseLiteralMultiStringContent)}parseLiteralMultiStringContent(){do{if(this.char===CHAR_APOS)return this.next(this.parseLiteralMultiEnd);if(this.char===e.END)throw this.error(new TomlError("Unterminated multi-line string"));if(this.char===CHAR_DEL||this.char<=CTRL_CHAR_BOUNDARY&&this.char!==CTRL_I&&this.char!==CTRL_J&&this.char!==CTRL_M)throw this.errorControlCharIn("strings");else this.consume()}while(this.nextChar())}parseLiteralMultiEnd(){return this.char===CHAR_APOS?this.next(this.parseLiteralMultiEnd2):(this.state.buf+="'",this.goto(this.parseLiteralMultiStringContent))}parseLiteralMultiEnd2(){return this.char===CHAR_APOS?this.next(this.parseLiteralMultiEnd3):(this.state.buf+="''",this.goto(this.parseLiteralMultiStringContent))}parseLiteralMultiEnd3(){return this.char===CHAR_APOS?(this.state.buf+="'",this.next(this.parseLiteralMultiEnd4)):this.returnNow()}parseLiteralMultiEnd4(){return this.char===CHAR_APOS?(this.state.buf+="'",this.return()):this.returnNow()}parseDoubleString(){return this.char===CHAR_QUOT?this.next(this.parseMultiStringMaybe):this.goto(this.parseBasicString)}parseBasicString(){do{if(this.char===CHAR_BSOL)return this.call(this.parseEscape,this.recordEscapeReplacement);if(this.char===CHAR_QUOT)return this.return();if(this.atEndOfLine())throw this.error(new TomlError("Unterminated string"));else if(this.char===CHAR_DEL||this.char<=CTRL_CHAR_BOUNDARY&&this.char!==CTRL_I)throw this.errorControlCharIn("strings");else this.consume()}while(this.nextChar())}recordEscapeReplacement(e){return this.state.buf+=e,this.goto(this.parseBasicString)}parseMultiStringMaybe(){return this.char===CHAR_QUOT?this.next(this.parseMultiString):this.returnNow()}parseMultiString(){return this.char===CTRL_M?null:this.char===CTRL_J?this.next(this.parseMultiStringContent):this.goto(this.parseMultiStringContent)}parseMultiStringContent(){do{if(this.char===CHAR_BSOL)return this.call(this.parseMultiEscape,this.recordMultiEscapeReplacement);if(this.char===CHAR_QUOT)return this.next(this.parseMultiEnd);if(this.char===e.END)throw this.error(new TomlError("Unterminated multi-line string"));else if(this.char===CHAR_DEL||this.char<=CTRL_CHAR_BOUNDARY&&this.char!==CTRL_I&&this.char!==CTRL_J&&this.char!==CTRL_M)throw this.errorControlCharIn("strings");else this.consume()}while(this.nextChar())}errorControlCharIn(e){let t="\\u00";return this.char<16&&(t+="0"),t+=this.char.toString(16),this.error(new TomlError(`Control characters (codes < 0x1f and 0x7f) are not allowed in ${e}, use ${t} instead`))}recordMultiEscapeReplacement(e){return this.state.buf+=e,this.goto(this.parseMultiStringContent)}parseMultiEnd(){return this.char===CHAR_QUOT?this.next(this.parseMultiEnd2):(this.state.buf+='"',this.goto(this.parseMultiStringContent))}parseMultiEnd2(){return this.char===CHAR_QUOT?this.next(this.parseMultiEnd3):(this.state.buf+='""',this.goto(this.parseMultiStringContent))}parseMultiEnd3(){return this.char===CHAR_QUOT?(this.state.buf+='"',this.next(this.parseMultiEnd4)):this.returnNow()}parseMultiEnd4(){return this.char===CHAR_QUOT?(this.state.buf+='"',this.return()):this.returnNow()}parseMultiEscape(){return this.char===CTRL_M||this.char===CTRL_J?this.next(this.parseMultiTrim):this.char===CHAR_SP||this.char===CTRL_I?this.next(this.parsePreMultiTrim):this.goto(this.parseEscape)}parsePreMultiTrim(){if(this.char===CHAR_SP||this.char===CTRL_I)return null;if(this.char===CTRL_M||this.char===CTRL_J)return this.next(this.parseMultiTrim);throw this.error(new TomlError("Can't escape whitespace"))}parseMultiTrim(){return this.char===CTRL_J||this.char===CHAR_SP||this.char===CTRL_I||this.char===CTRL_M?null:this.returnNow()}parseEscape(){if(this.char in escapes)return this.return(escapes[this.char]);if(this.char===CHAR_u)return this.call(this.parseSmallUnicode,this.parseUnicodeReturn);if(this.char===CHAR_U)return this.call(this.parseLargeUnicode,this.parseUnicodeReturn);throw this.error(new TomlError("Unknown escape character: "+this.char))}parseUnicodeReturn(e){try{let t=parseInt(e,16);if(t>=SURROGATE_FIRST&&t<=SURROGATE_LAST)throw this.error(new TomlError("Invalid unicode, character in range 0xD800 - 0xDFFF is reserved"));return this.returnNow(String.fromCodePoint(t))}catch(n){throw this.error(TomlError.wrap(n))}}parseSmallUnicode(){if(isHexit(this.char)){if(this.consume(),this.state.buf.length>=4)return this.return()}else throw this.error(new TomlError("Invalid character in unicode sequence, expected hex"))}parseLargeUnicode(){if(isHexit(this.char)){if(this.consume(),this.state.buf.length>=8)return this.return()}else throw this.error(new TomlError("Invalid character in unicode sequence, expected hex"))}parseNumberSign(){return this.consume(),this.next(this.parseMaybeSignedInfOrNan)}parseMaybeSignedInfOrNan(){return this.char===CHAR_i?this.next(this.parseInf):this.char===CHAR_n?this.next(this.parseNan):this.callNow(this.parseNoUnder,this.parseNumberIntegerStart)}parseNumberIntegerStart(){return this.char===CHAR_0?(this.consume(),this.next(this.parseNumberIntegerExponentOrDecimal)):this.goto(this.parseNumberInteger)}parseNumberIntegerExponentOrDecimal(){return this.char===CHAR_PERIOD?(this.consume(),this.call(this.parseNoUnder,this.parseNumberFloat)):this.char===CHAR_E||this.char===CHAR_e?(this.consume(),this.next(this.parseNumberExponentSign)):this.returnNow(Integer(this.state.buf))}parseNumberInteger(){if(isDigit(this.char))this.consume();else{if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnder);if(this.char===CHAR_E||this.char===CHAR_e)return this.consume(),this.next(this.parseNumberExponentSign);if(this.char===CHAR_PERIOD)return this.consume(),this.call(this.parseNoUnder,this.parseNumberFloat);let e=Integer(this.state.buf);if(!e.isNaN())return this.returnNow(e);throw this.error(new TomlError("Invalid number"))}}parseNoUnder(){if(this.char===CHAR_LOWBAR||this.char===CHAR_PERIOD||this.char===CHAR_E||this.char===CHAR_e)throw this.error(new TomlError("Unexpected character, expected digit"));if(this.atEndOfWord())throw this.error(new TomlError("Incomplete number"));return this.returnNow()}parseNoUnderHexOctBinLiteral(){if(this.char===CHAR_LOWBAR||this.char===CHAR_PERIOD)throw this.error(new TomlError("Unexpected character, expected digit"));if(this.atEndOfWord())throw this.error(new TomlError("Incomplete number"));return this.returnNow()}parseNumberFloat(){if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnder,this.parseNumberFloat);if(isDigit(this.char))this.consume();else if(this.char===CHAR_E||this.char===CHAR_e)return this.consume(),this.next(this.parseNumberExponentSign);else return this.returnNow(Float(this.state.buf))}parseNumberExponentSign(){if(isDigit(this.char))return this.goto(this.parseNumberExponent);if(this.char===CHAR_HYPHEN||this.char===CHAR_PLUS)this.consume(),this.call(this.parseNoUnder,this.parseNumberExponent);else throw this.error(new TomlError("Unexpected character, expected -, + or digit"))}parseNumberExponent(){if(isDigit(this.char))this.consume();else if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnder);else return this.returnNow(Float(this.state.buf))}parseNumberOrDateTime(){return this.char===CHAR_0?(this.consume(),this.next(this.parseNumberBaseOrDateTime)):this.goto(this.parseNumberOrDateTimeOnly)}parseNumberOrDateTimeOnly(){if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnder,this.parseNumberInteger);if(isDigit(this.char))this.consume(),this.state.buf.length>4&&this.next(this.parseNumberInteger);else if(this.char===CHAR_E||this.char===CHAR_e)return this.consume(),this.next(this.parseNumberExponentSign);else if(this.char===CHAR_PERIOD)return this.consume(),this.call(this.parseNoUnder,this.parseNumberFloat);else if(this.char===CHAR_HYPHEN)return this.goto(this.parseDateTime);else if(this.char===CHAR_COLON)return this.goto(this.parseOnlyTimeHour);else return this.returnNow(Integer(this.state.buf))}parseDateTimeOnly(){if(this.state.buf.length<4){if(isDigit(this.char))return this.consume();if(this.char===CHAR_COLON)return this.goto(this.parseOnlyTimeHour);throw this.error(new TomlError("Expected digit while parsing year part of a date"))}if(this.char===CHAR_HYPHEN)return this.goto(this.parseDateTime);throw this.error(new TomlError("Expected hyphen (-) while parsing year part of date"))}parseNumberBaseOrDateTime(){if(this.char===CHAR_b)return this.consume(),this.call(this.parseNoUnderHexOctBinLiteral,this.parseIntegerBin);if(this.char===CHAR_o)return this.consume(),this.call(this.parseNoUnderHexOctBinLiteral,this.parseIntegerOct);if(this.char===CHAR_x)return this.consume(),this.call(this.parseNoUnderHexOctBinLiteral,this.parseIntegerHex);if(this.char===CHAR_PERIOD)return this.goto(this.parseNumberInteger);if(isDigit(this.char))return this.goto(this.parseDateTimeOnly);else return this.returnNow(Integer(this.state.buf))}parseIntegerHex(){if(isHexit(this.char))this.consume();else{if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnderHexOctBinLiteral);let e=Integer(this.state.buf);if(!e.isNaN())return this.returnNow(e);throw this.error(new TomlError("Invalid number"))}}parseIntegerOct(){if(isOctit(this.char))this.consume();else{if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnderHexOctBinLiteral);let e=Integer(this.state.buf);if(!e.isNaN())return this.returnNow(e);throw this.error(new TomlError("Invalid number"))}}parseIntegerBin(){if(isBit(this.char))this.consume();else{if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnderHexOctBinLiteral);let e=Integer(this.state.buf);if(!e.isNaN())return this.returnNow(e);throw this.error(new TomlError("Invalid number"))}}parseDateTime(){if(this.state.buf.length<4)throw this.error(new TomlError("Years less than 1000 must be zero padded to four characters"));return this.state.result=this.state.buf,this.state.buf="",this.next(this.parseDateMonth)}parseDateMonth(){if(this.char===CHAR_HYPHEN){if(this.state.buf.length<2)throw this.error(new TomlError("Months less than 10 must be zero padded to two characters"));return this.state.result+="-"+this.state.buf,this.state.buf="",this.next(this.parseDateDay)}if(isDigit(this.char))this.consume();else throw this.error(new TomlError("Incomplete datetime"))}parseDateDay(){if(this.char===CHAR_T||this.char===CHAR_SP){if(this.state.buf.length<2)throw this.error(new TomlError("Days less than 10 must be zero padded to two characters"));return this.state.result+="-"+this.state.buf,this.state.buf="",this.next(this.parseStartTimeHour)}if(this.atEndOfWord())return this.returnNow(createDate(this.state.result+"-"+this.state.buf));if(isDigit(this.char))this.consume();else throw this.error(new TomlError("Incomplete datetime"))}parseStartTimeHour(){return this.atEndOfWord()?this.returnNow(createDate(this.state.result)):this.goto(this.parseTimeHour)}parseTimeHour(){if(this.char===CHAR_COLON){if(this.state.buf.length<2)throw this.error(new TomlError("Hours less than 10 must be zero padded to two characters"));return this.state.result+="T"+this.state.buf,this.state.buf="",this.next(this.parseTimeMin)}if(isDigit(this.char))this.consume();else throw this.error(new TomlError("Incomplete datetime"))}parseTimeMin(){if(this.state.buf.length<2&&isDigit(this.char))this.consume();else if(2===this.state.buf.length&&this.char===CHAR_COLON)return this.state.result+=":"+this.state.buf,this.state.buf="",this.next(this.parseTimeSec);else throw this.error(new TomlError("Incomplete datetime"))}parseTimeSec(){if(isDigit(this.char)){if(this.consume(),2===this.state.buf.length)return this.state.result+=":"+this.state.buf,this.state.buf="",this.next(this.parseTimeZoneOrFraction)}else throw this.error(new TomlError("Incomplete datetime"))}parseOnlyTimeHour(){if(this.char===CHAR_COLON){if(this.state.buf.length<2)throw this.error(new TomlError("Hours less than 10 must be zero padded to two characters"));return this.state.result=this.state.buf,this.state.buf="",this.next(this.parseOnlyTimeMin)}throw this.error(new TomlError("Incomplete time"))}parseOnlyTimeMin(){if(this.state.buf.length<2&&isDigit(this.char))this.consume();else if(2===this.state.buf.length&&this.char===CHAR_COLON)return this.state.result+=":"+this.state.buf,this.state.buf="",this.next(this.parseOnlyTimeSec);else throw this.error(new TomlError("Incomplete time"))}parseOnlyTimeSec(){if(isDigit(this.char)){if(this.consume(),2===this.state.buf.length)return this.next(this.parseOnlyTimeFractionMaybe)}else throw this.error(new TomlError("Incomplete time"))}parseOnlyTimeFractionMaybe(){if(this.state.result+=":"+this.state.buf,this.char!==CHAR_PERIOD)return this.return(createTime(this.state.result));this.state.buf="",this.next(this.parseOnlyTimeFraction)}parseOnlyTimeFraction(){if(isDigit(this.char))this.consume();else if(this.atEndOfWord()){if(0===this.state.buf.length)throw this.error(new TomlError("Expected digit in milliseconds"));return this.returnNow(createTime(this.state.result+"."+this.state.buf))}else throw this.error(new TomlError("Unexpected character in datetime, expected period (.), minus (-), plus (+) or Z"))}parseTimeZoneOrFraction(){if(this.char===CHAR_PERIOD)this.consume(),this.next(this.parseDateTimeFraction);else if(this.char===CHAR_HYPHEN||this.char===CHAR_PLUS)this.consume(),this.next(this.parseTimeZoneHour);else if(this.char===CHAR_Z)return this.consume(),this.return(createDateTime(this.state.result+this.state.buf));else if(this.atEndOfWord())return this.returnNow(createDateTimeFloat(this.state.result+this.state.buf));else throw this.error(new TomlError("Unexpected character in datetime, expected period (.), minus (-), plus (+) or Z"))}parseDateTimeFraction(){if(isDigit(this.char))this.consume();else if(1===this.state.buf.length)throw this.error(new TomlError("Expected digit in milliseconds"));else if(this.char===CHAR_HYPHEN||this.char===CHAR_PLUS)this.consume(),this.next(this.parseTimeZoneHour);else if(this.char===CHAR_Z)return this.consume(),this.return(createDateTime(this.state.result+this.state.buf));else if(this.atEndOfWord())return this.returnNow(createDateTimeFloat(this.state.result+this.state.buf));else throw this.error(new TomlError("Unexpected character in datetime, expected period (.), minus (-), plus (+) or Z"))}parseTimeZoneHour(){if(isDigit(this.char)){if(this.consume(),/\d\d$/.test(this.state.buf))return this.next(this.parseTimeZoneSep)}else throw this.error(new TomlError("Unexpected character in datetime, expected digit"))}parseTimeZoneSep(){if(this.char===CHAR_COLON)this.consume(),this.next(this.parseTimeZoneMin);else throw this.error(new TomlError("Unexpected character in datetime, expected colon"))}parseTimeZoneMin(){if(isDigit(this.char)){if(this.consume(),/\d\d$/.test(this.state.buf))return this.return(createDateTime(this.state.result+this.state.buf))}else throw this.error(new TomlError("Unexpected character in datetime, expected digit"))}parseBoolean(){return this.char===CHAR_t?(this.consume(),this.next(this.parseTrue_r)):this.char===CHAR_f?(this.consume(),this.next(this.parseFalse_a)):void 0}parseTrue_r(){if(this.char===CHAR_r)return this.consume(),this.next(this.parseTrue_u);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseTrue_u(){if(this.char===CHAR_u)return this.consume(),this.next(this.parseTrue_e);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseTrue_e(){if(this.char===CHAR_e)return this.return(!0);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseFalse_a(){if(this.char===CHAR_a)return this.consume(),this.next(this.parseFalse_l);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseFalse_l(){if(this.char===CHAR_l)return this.consume(),this.next(this.parseFalse_s);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseFalse_s(){if(this.char===CHAR_s)return this.consume(),this.next(this.parseFalse_e);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseFalse_e(){if(this.char===CHAR_e)return this.return(!1);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseInlineList(){if(this.char===CHAR_SP||this.char===CTRL_I||this.char===CTRL_M||this.char===CTRL_J)return null;if(this.char===e.END)throw this.error(new TomlError("Unterminated inline array"));return this.char===CHAR_NUM?this.call(this.parseComment):this.char===CHAR_RSQB?this.return(this.state.resultArr||InlineList()):this.callNow(this.parseValue,this.recordInlineListValue)}recordInlineListValue(e){return this.state.resultArr||(this.state.resultArr=InlineList(tomlType(e))),isFloat(e)||isInteger(e)?this.state.resultArr.push(e.valueOf()):this.state.resultArr.push(e),this.goto(this.parseInlineListNext)}parseInlineListNext(){if(this.char===CHAR_SP||this.char===CTRL_I||this.char===CTRL_M||this.char===CTRL_J)return null;if(this.char===CHAR_NUM)return this.call(this.parseComment);if(this.char===CHAR_COMMA)return this.next(this.parseInlineList);if(this.char===CHAR_RSQB)return this.goto(this.parseInlineList);throw this.error(new TomlError("Invalid character, expected whitespace, comma (,) or close bracket (])"))}parseInlineTable(){if(this.char===CHAR_SP||this.char===CTRL_I)return null;if(this.char===e.END||this.char===CHAR_NUM||this.char===CTRL_J||this.char===CTRL_M)throw this.error(new TomlError("Unterminated inline array"));return this.char===CHAR_RCUB?this.return(this.state.resultTable||InlineTable()):(this.state.resultTable||(this.state.resultTable=InlineTable()),this.callNow(this.parseAssign,this.recordInlineTableValue))}recordInlineTableValue(e){let t=this.state.resultTable,n=e.key.pop();for(let r of e.key){if(hasKey(t,r)&&(!isTable(t[r])||t[r][_declared]))throw this.error(new TomlError("Can't redefine existing key"));t=t[r]=t[r]||Table()}if(hasKey(t,n))throw this.error(new TomlError("Can't redefine existing key"));return isInteger(e.value)||isFloat(e.value)?t[n]=e.value.valueOf():t[n]=e.value,this.goto(this.parseInlineTableNext)}parseInlineTableNext(){if(this.char===CHAR_SP||this.char===CTRL_I)return null;if(this.char===e.END||this.char===CHAR_NUM||this.char===CTRL_J||this.char===CTRL_M)throw this.error(new TomlError("Unterminated inline array"));if(this.char===CHAR_COMMA)return this.next(this.parseInlineTablePostComma);if(this.char===CHAR_RCUB)return this.goto(this.parseInlineTable);throw this.error(new TomlError("Invalid character, expected whitespace, comma (,) or close bracket (])"))}parseInlineTablePostComma(){if(this.char===CHAR_SP||this.char===CTRL_I)return null;if(this.char===e.END||this.char===CHAR_NUM||this.char===CTRL_J||this.char===CTRL_M)throw this.error(new TomlError("Unterminated inline array"));if(this.char===CHAR_COMMA)throw this.error(new TomlError("Empty elements in inline tables are not permitted"));if(this.char!==CHAR_RCUB)return this.goto(this.parseInlineTable);throw this.error(new TomlError("Trailing commas in inline tables are not permitted"))}}return t}},90560(e,t,n){"use strict";e.exports=a;let r=n(8676),i=n(22418);function a(e,t){t||(t={});let n=0,a=t.blocksize||40960,o=new r;return new Promise((e,t)=>{setImmediate(s,n,a,e,t)});function s(t,n,r,a){if(t>=e.length)try{return r(o.finish())}catch(u){return a(i(u,e))}try{o.parse(e.slice(t,t+n)),setImmediate(s,t+n,n,r,a)}catch(c){a(i(c,e))}}}},22418(e){"use strict";function t(e,t){if(null==e.pos||null==e.line)return e;let n=e.message;if(n+=` at row ${e.line+1}, col ${e.col+1}, pos ${e.pos}: -`,t&&t.split){let r=t.split(/\n/),i=String(Math.min(r.length,e.line+3)).length,a=" ";for(;a.length "+r[o]+"\n",n+=a+" ";for(let u=0;u{let i,a=!1,o=!1;function s(){if(a=!0,!i)try{n(t.finish())}catch(e){r(e)}}function u(e){o=!0,r(e)}function c(){i=!0;let n;for(;null!==(n=e.read());)try{t.parse(n)}catch(r){return u(r)}if(i=!1,a)return s();o||e.once("readable",c)}e.once("end",s),e.once("error",u),c()})}function s(){let e=new i;return new r.Transform({objectMode:!0,transform(t,n,r){try{e.parse(t.toString(n))}catch(i){this.emit("error",i)}r()},flush(t){try{this.push(e.finish())}catch(n){this.emit("error",n)}t()}})}},56530(e,t,n){"use strict";e.exports=a;let r=n(8676),i=n(22418);function a(e){n.g.Buffer&&n.g.Buffer.isBuffer(e)&&(e=e.toString("utf8"));let t=new r;try{return t.parse(e),t.finish()}catch(a){throw i(a,e)}}},83512(e,t,n){"use strict";e.exports=n(56530),e.exports.async=n(90560),e.exports.stream=n(6435),e.exports.prettyError=n(22418)},36921(e){"use strict";function t(e){if(null===e)throw n("null");if(void 0===e)throw n("undefined");if("object"!=typeof e)throw n(typeof e);if("function"==typeof e.toJSON&&(e=e.toJSON()),null==e)return null;let t=u(e);if("table"!==t)throw n(t);return o("","",e)}function n(e){return Error("Can only stringify objects, not "+e)}function r(e){return Object.keys(e).filter(t=>s(e[t]))}function i(e){return Object.keys(e).filter(t=>!s(e[t]))}function a(e){let t=Array.isArray(e)?[]:Object.prototype.hasOwnProperty.call(e,"__proto__")?{["__proto__"]:void 0}:{};for(let n of Object.keys(e))!e[n]||"function"!=typeof e[n].toJSON||"toISOString"in e[n]?t[n]=e[n]:t[n]=e[n].toJSON();return t}function o(e,t,n){let o,s;o=r(n=a(n)),s=i(n);let l=[],f=t||"";o.forEach(e=>{var t=u(n[e]);"undefined"!==t&&"null"!==t&&l.push(f+c(e)+" = "+b(n[e],!0))}),l.length>0&&l.push("");let d=e&&o.length>0?t+" ":"";return s.forEach(t=>{l.push(S(e,d,t,n[t]))}),l.join("\n")}function s(e){switch(u(e)){case"undefined":case"null":case"integer":case"nan":case"float":case"boolean":case"string":case"datetime":return!0;case"array":return 0===e.length||"table"!==u(e[0]);case"table":return 0===Object.keys(e).length;default:return!1}}function u(e){if(void 0===e)return"undefined";if(null===e)return"null";if("bigint"==typeof e||Number.isInteger(e)&&!Object.is(e,-0))return"integer";if("number"==typeof e)return"float";if("boolean"==typeof e)return"boolean";else if("string"==typeof e)return"string";else if("toISOString"in e)return isNaN(e)?"undefined":"datetime";else if(Array.isArray(e))return"array";else return"table"}function c(e){let t=String(e);return/^[-A-Za-z0-9_]+$/.test(t)?t:l(t)}function l(e){return'"'+h(e).replace(/"/g,'\\"')+'"'}function f(e){return"'"+e+"'"}function d(e,t){for(;t.length"\\u"+d(4,e.codePointAt(0).toString(16)))}function p(e){let t=e.split(/\n/).map(e=>h(e).replace(/"(?="")/g,'\\"')).join("\n");return'"'===t.slice(-1)&&(t+="\\\n"),'"""\n'+t+'"""'}function b(e,t){let n=u(e);return"string"===n&&(t&&/\n/.test(e)?n="string-multiline":!/[\b\t\n\f\r']/.test(e)&&/"/.test(e)&&(n="string-literal")),m(e,n)}function m(e,t){switch(t||(t=u(e)),t){case"string-multiline":return p(e);case"string":return l(e);case"string-literal":return f(e);case"integer":return g(e);case"float":return v(e);case"boolean":return y(e);case"datetime":return w(e);case"array":return _(e.filter(e=>"null"!==u(e)&&"undefined"!==u(e)&&"nan"!==u(e)));case"table":return E(e);default:throw n(t)}}function g(e){return String(e).replace(/\B(?=(\d{3})+(?!\d))/g,"_")}function v(e){if(e===1/0)return"inf";if(e===-1/0)return"-inf";if(Object.is(e,NaN))return"nan";if(Object.is(e,-0))return"-0.0";let[t,n]=String(e).split(".");return g(t)+"."+n}function y(e){return String(e)}function w(e){return e.toISOString()}function _(e){e=a(e);let t="[",n=e.map(e=>m(e));return n.join(", ").length>60||/\n/.test(n)?t+="\n "+n.join(",\n ")+"\n":t+=" "+n.join(", ")+(n.length>0?" ":""),t+"]"}function E(e){e=a(e);let t=[];return Object.keys(e).forEach(n=>{t.push(c(n)+" = "+b(e[n],!1))}),"{ "+t.join(", ")+(t.length>0?" ":"")+"}"}function S(e,t,r,i){let a=u(i);if("array"===a)return k(e,t,r,i);if("table"===a)return x(e,t,r,i);throw n(a)}function k(e,t,r,i){i=a(i);let s=u(i[0]);if("table"!==s)throw n(s);let l=e+c(r),f="";return i.forEach(e=>{f.length>0&&(f+="\n"),f+=t+"[["+l+"]]\n",f+=o(l+".",t,e)}),f}function x(e,t,n,i){let a=e+c(n),s="";return r(i).length>0&&(s+=t+"["+a+"]\n"),s+o(a+".",t,i)}e.exports=t,e.exports.value=m},5022(e,t,n){"use strict";t.parse=n(83512),t.stringify=n(36921)},46515(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.styles=void 0;var i=r(n(10434)),a=r(n(38416)),o=r(n(70215)),s=r(n(67294));r(n(45697));var u=r(n(94184)),c=r(n(78252)),l=n(98741),f=r(n(68821)),d=function(e){var t="light"===e.palette.type?e.palette.grey[100]:e.palette.grey[900];return{root:{display:"flex",flexDirection:"column",width:"100%",boxSizing:"border-box",zIndex:e.zIndex.appBar,flexShrink:0},positionFixed:{position:"fixed",top:0,left:"auto",right:0},positionAbsolute:{position:"absolute",top:0,left:"auto",right:0},positionSticky:{position:"sticky",top:0,left:"auto",right:0},positionStatic:{position:"static"},positionRelative:{position:"relative"},colorDefault:{backgroundColor:t,color:e.palette.getContrastText(t)},colorPrimary:{backgroundColor:e.palette.primary.main,color:e.palette.primary.contrastText},colorSecondary:{backgroundColor:e.palette.secondary.main,color:e.palette.secondary.contrastText}}};function h(e){var t,n=e.children,r=e.classes,c=e.className,d=e.color,h=e.position,p=(0,o.default)(e,["children","classes","className","color","position"]),b=(0,u.default)(r.root,r["position".concat((0,l.capitalize)(h))],(t={},(0,a.default)(t,r["color".concat((0,l.capitalize)(d))],"inherit"!==d),(0,a.default)(t,"mui-fixed","fixed"===h),t),c);return s.default.createElement(f.default,(0,i.default)({square:!0,component:"header",elevation:4,className:b},p),n)}t.styles=d,h.defaultProps={color:"primary",position:"fixed"};var p=(0,c.default)(d,{name:"MuiAppBar"})(h);t.default=p},95880(e,t,n){"use strict";var r,i=n(64836);r={value:!0},Object.defineProperty(t,"Z",{enumerable:!0,get:function(){return a.default}});var a=i(n(46515))},68477(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.styles=void 0;var i=r(n(38416)),a=r(n(10434)),o=r(n(70215)),s=r(n(67294));r(n(45697));var u=r(n(94184));n(55252);var c=r(n(78252)),l=function(e){return{root:{position:"relative",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,width:40,height:40,fontFamily:e.typography.fontFamily,fontSize:e.typography.pxToRem(20),borderRadius:"50%",overflow:"hidden",userSelect:"none"},colorDefault:{color:e.palette.background.default,backgroundColor:"light"===e.palette.type?e.palette.grey[400]:e.palette.grey[600]},img:{width:"100%",height:"100%",textAlign:"center",objectFit:"cover"}}};function f(e){var t=e.alt,n=e.children,r=e.childrenClassName,c=e.classes,l=e.className,f=e.component,d=e.imgProps,h=e.sizes,p=e.src,b=e.srcSet,m=(0,o.default)(e,["alt","children","childrenClassName","classes","className","component","imgProps","sizes","src","srcSet"]),g=null,v=p||b;return g=v?s.default.createElement("img",(0,a.default)({alt:t,src:p,srcSet:b,sizes:h,className:c.img},d)):r&&s.default.isValidElement(n)?s.default.cloneElement(n,{className:(0,u.default)(r,n.props.className)}):n,s.default.createElement(f,(0,a.default)({className:(0,u.default)(c.root,c.system,(0,i.default)({},c.colorDefault,!v),l)},m),g)}t.styles=l,f.defaultProps={component:"div"};var d=(0,c.default)(l,{name:"MuiAvatar"})(f);t.default=d},90338(e,t,n){"use strict";var r,i=n(64836);r={value:!0},Object.defineProperty(t,"Z",{enumerable:!0,get:function(){return a.default}});var a=i(n(68477))},9211(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.styles=void 0;var i=r(n(10434)),a=r(n(38416)),o=r(n(70215)),s=r(n(67294));r(n(45697));var u=r(n(94184)),c=r(n(78252)),l=r(n(46408)),f={root:{zIndex:-1,position:"fixed",right:0,bottom:0,top:0,left:0,backgroundColor:"rgba(0, 0, 0, 0.5)",WebkitTapHighlightColor:"transparent",touchAction:"none"},invisible:{backgroundColor:"transparent"}};function d(e){var t=e.classes,n=e.className,r=e.invisible,c=e.open,f=e.transitionDuration,d=(0,o.default)(e,["classes","className","invisible","open","transitionDuration"]);return s.default.createElement(l.default,(0,i.default)({in:c,timeout:f},d),s.default.createElement("div",{className:(0,u.default)(t.root,(0,a.default)({},t.invisible,r),n),"aria-hidden":"true"}))}t.styles=f,d.defaultProps={invisible:!1};var h=(0,c.default)(f,{name:"MuiBackdrop"})(d);t.default=h},14983(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return i.default}});var i=r(n(9211))},84732(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.styles=void 0;var i=r(n(10434)),a=r(n(38416)),o=r(n(70215)),s=r(n(67294));r(n(45697));var u=r(n(94184));n(55252);var c=r(n(78252)),l=n(98741),f=10,d=function(e){return{root:{position:"relative",display:"inline-flex",verticalAlign:"middle"},badge:{display:"flex",flexDirection:"row",flexWrap:"wrap",justifyContent:"center",alignContent:"center",alignItems:"center",position:"absolute",top:0,right:0,boxSizing:"border-box",fontFamily:e.typography.fontFamily,fontWeight:e.typography.fontWeightMedium,fontSize:e.typography.pxToRem(12),minWidth:2*f,padding:"0 4px",height:2*f,borderRadius:f,backgroundColor:e.palette.color,color:e.palette.textColor,zIndex:1,transform:"scale(1) translate(50%, -50%)",transformOrigin:"100% 0%",transition:e.transitions.create("transform",{easing:e.transitions.easing.easeInOut,duration:e.transitions.duration.enteringScreen})},colorPrimary:{backgroundColor:e.palette.primary.main,color:e.palette.primary.contrastText},colorSecondary:{backgroundColor:e.palette.secondary.main,color:e.palette.secondary.contrastText},colorError:{backgroundColor:e.palette.error.main,color:e.palette.error.contrastText},invisible:{transition:e.transitions.create("transform",{easing:e.transitions.easing.easeInOut,duration:e.transitions.duration.leavingScreen}),transform:"scale(0) translate(50%, -50%)",transformOrigin:"100% 0%"},dot:{height:6,minWidth:6,padding:0}}};function h(e){var t,n=e.badgeContent,r=e.children,c=e.classes,f=e.className,d=e.color,h=e.component,p=e.invisible,b=e.showZero,m=e.max,g=e.variant,v=(0,o.default)(e,["badgeContent","children","classes","className","color","component","invisible","showZero","max","variant"]),y=p;null!=p||0!==Number(n)||b||(y=!0);var w=(0,u.default)(c.badge,(t={},(0,a.default)(t,c["color".concat((0,l.capitalize)(d))],"default"!==d),(0,a.default)(t,c.invisible,y),(0,a.default)(t,c.dot,"dot"===g),t)),_="";return"dot"!==g&&(_=n>m?"".concat(m,"+"):n),s.default.createElement(h,(0,i.default)({className:(0,u.default)(c.root,f)},v),r,s.default.createElement("span",{className:w},_))}t.styles=d,h.defaultProps={color:"default",component:"span",max:99,showZero:!1,variant:"standard"};var p=(0,c.default)(d,{name:"MuiBadge"})(h);t.default=p},70398(e,t,n){"use strict";var r,i=n(64836);r={value:!0},Object.defineProperty(t,"Z",{enumerable:!0,get:function(){return a.default}});var a=i(n(84732))},21783(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.styles=void 0;var i=r(n(38416)),a=r(n(70215)),o=r(n(10434)),s=r(n(67294));r(n(45697));var u=r(n(94184));n(55252);var c=r(n(78252)),l=n(59114),f=r(n(16070)),d=n(98741),h=function(e){return{root:(0,o.default)({lineHeight:1.75},e.typography.button,{boxSizing:"border-box",minWidth:64,padding:"6px 16px",borderRadius:e.shape.borderRadius,color:e.palette.text.primary,transition:e.transitions.create(["background-color","box-shadow","border"],{duration:e.transitions.duration.short}),"&:hover":{textDecoration:"none",backgroundColor:(0,l.fade)(e.palette.text.primary,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"},"&$disabled":{backgroundColor:"transparent"}},"&$disabled":{color:e.palette.action.disabled}}),label:{width:"100%",display:"inherit",alignItems:"inherit",justifyContent:"inherit"},text:{padding:"6px 8px"},textPrimary:{color:e.palette.primary.main,"&:hover":{backgroundColor:(0,l.fade)(e.palette.primary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},textSecondary:{color:e.palette.secondary.main,"&:hover":{backgroundColor:(0,l.fade)(e.palette.secondary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},flat:{},flatPrimary:{},flatSecondary:{},outlined:{padding:"5px 16px",border:"1px solid ".concat("light"===e.palette.type?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)"),"&$disabled":{border:"1px solid ".concat(e.palette.action.disabled)}},outlinedPrimary:{color:e.palette.primary.main,border:"1px solid ".concat((0,l.fade)(e.palette.primary.main,.5)),"&:hover":{border:"1px solid ".concat(e.palette.primary.main),backgroundColor:(0,l.fade)(e.palette.primary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},outlinedSecondary:{color:e.palette.secondary.main,border:"1px solid ".concat((0,l.fade)(e.palette.secondary.main,.5)),"&:hover":{border:"1px solid ".concat(e.palette.secondary.main),backgroundColor:(0,l.fade)(e.palette.secondary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},"&$disabled":{border:"1px solid ".concat(e.palette.action.disabled)}},contained:{color:e.palette.getContrastText(e.palette.grey[300]),backgroundColor:e.palette.grey[300],boxShadow:e.shadows[2],"&$focusVisible":{boxShadow:e.shadows[6]},"&:active":{boxShadow:e.shadows[8]},"&$disabled":{color:e.palette.action.disabled,boxShadow:e.shadows[0],backgroundColor:e.palette.action.disabledBackground},"&:hover":{backgroundColor:e.palette.grey.A100,"@media (hover: none)":{backgroundColor:e.palette.grey[300]},"&$disabled":{backgroundColor:e.palette.action.disabledBackground}}},containedPrimary:{color:e.palette.primary.contrastText,backgroundColor:e.palette.primary.main,"&:hover":{backgroundColor:e.palette.primary.dark,"@media (hover: none)":{backgroundColor:e.palette.primary.main}}},containedSecondary:{color:e.palette.secondary.contrastText,backgroundColor:e.palette.secondary.main,"&:hover":{backgroundColor:e.palette.secondary.dark,"@media (hover: none)":{backgroundColor:e.palette.secondary.main}}},raised:{},raisedPrimary:{},raisedSecondary:{},fab:{borderRadius:"50%",padding:0,minWidth:0,width:56,height:56,boxShadow:e.shadows[6],"&:active":{boxShadow:e.shadows[12]}},extendedFab:{borderRadius:24,padding:"0 16px",width:"auto",minWidth:48,height:48},focusVisible:{},disabled:{},colorInherit:{color:"inherit",borderColor:"currentColor"},mini:{width:40,height:40},sizeSmall:{padding:"4px 8px",minWidth:64,fontSize:e.typography.pxToRem(13)},sizeLarge:{padding:"8px 24px",fontSize:e.typography.pxToRem(15)},fullWidth:{width:"100%"}}};function p(e){var t,n=e.children,r=e.classes,c=e.className,l=e.color,h=e.disabled,p=e.disableFocusRipple,b=e.focusVisibleClassName,m=e.fullWidth,g=e.mini,v=e.size,y=e.variant,w=(0,a.default)(e,["children","classes","className","color","disabled","disableFocusRipple","focusVisibleClassName","fullWidth","mini","size","variant"]),_="fab"===y||"extendedFab"===y,E="contained"===y||"raised"===y,S="text"===y||"flat"===y,k=(0,u.default)(r.root,(t={},(0,i.default)(t,r.fab,_),(0,i.default)(t,r.mini,_&&g),(0,i.default)(t,r.extendedFab,"extendedFab"===y),(0,i.default)(t,r.text,S),(0,i.default)(t,r.textPrimary,S&&"primary"===l),(0,i.default)(t,r.textSecondary,S&&"secondary"===l),(0,i.default)(t,r.flat,S),(0,i.default)(t,r.flatPrimary,S&&"primary"===l),(0,i.default)(t,r.flatSecondary,S&&"secondary"===l),(0,i.default)(t,r.contained,E||_),(0,i.default)(t,r.containedPrimary,(E||_)&&"primary"===l),(0,i.default)(t,r.containedSecondary,(E||_)&&"secondary"===l),(0,i.default)(t,r.raised,E||_),(0,i.default)(t,r.raisedPrimary,(E||_)&&"primary"===l),(0,i.default)(t,r.raisedSecondary,(E||_)&&"secondary"===l),(0,i.default)(t,r.outlined,"outlined"===y),(0,i.default)(t,r.outlinedPrimary,"outlined"===y&&"primary"===l),(0,i.default)(t,r.outlinedSecondary,"outlined"===y&&"secondary"===l),(0,i.default)(t,r["size".concat((0,d.capitalize)(v))],"medium"!==v),(0,i.default)(t,r.disabled,h),(0,i.default)(t,r.fullWidth,m),(0,i.default)(t,r.colorInherit,"inherit"===l),t),c);return s.default.createElement(f.default,(0,o.default)({className:k,disabled:h,focusRipple:!p,focusVisibleClassName:(0,u.default)(r.focusVisible,b)},w),s.default.createElement("span",{className:r.label},n))}t.styles=h,p.defaultProps={color:"default",component:"button",disabled:!1,disableFocusRipple:!1,fullWidth:!1,mini:!1,size:"medium",type:"button",variant:"text"};var b=(0,c.default)(h,{name:"MuiButton"})(p);t.default=b},83638(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return i.default}});var i=r(n(21783))},74610(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.styles=void 0;var i=r(n(10434)),a=r(n(38416)),o=r(n(70215)),s=r(n(56690)),u=r(n(89728)),c=r(n(94993)),l=r(n(73808)),f=r(n(61655)),d=r(n(66115)),h=r(n(67294));r(n(45697));var p=r(n(73935)),b=r(n(94184));n(55252);var m=r(n(62614)),g=r(n(78252)),v=r(n(78582)),y=n(32252),w=r(n(65406)),_=r(n(83673)),E={root:{display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:"none",border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle","-moz-appearance":"none","-webkit-appearance":"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},"&$disabled":{pointerEvents:"none",cursor:"default"}},disabled:{},focusVisible:{}};t.styles=E;var S=function(e){function t(){(0,s.default)(this,t);for(var e,n,r=arguments.length,i=Array(r),a=0;a0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=arguments.length>2?arguments[2]:void 0,u=o.pulsate,c=void 0!==u&&u,l=o.center,f=void 0===l?n.props.center||o.pulsate:l,h=o.fakeElement,b=void 0!==h&&h;if("mousedown"===a.type&&n.ignoringMouseDown){n.ignoringMouseDown=!1;return}"touchstart"===a.type&&(n.ignoringMouseDown=!0);var m=b?null:p.default.findDOMNode((0,d.default)((0,d.default)(n))),g=m?m.getBoundingClientRect():{width:0,height:0,left:0,top:0};if(!f&&(0!==a.clientX||0!==a.clientY)&&(a.clientX||a.touches)){var v=a.clientX?a.clientX:a.touches[0].clientX,y=a.clientY?a.clientY:a.touches[0].clientY;t=Math.round(v-g.left),r=Math.round(y-g.top)}else t=Math.round(g.width/2),r=Math.round(g.height/2);if(f)(i=Math.sqrt((2*Math.pow(g.width,2)+Math.pow(g.height,2))/3))%2==0&&(i+=1);else{i=Math.sqrt(Math.pow(2*Math.max(Math.abs((m?m.clientWidth:0)-t),t)+2,2)+Math.pow(2*Math.max(Math.abs((m?m.clientHeight:0)-r),r)+2,2))}a.touches?(n.startTimerCommit=function(){n.startCommit({pulsate:c,rippleX:t,rippleY:r,rippleSize:i,cb:s})},n.startTimer=setTimeout(function(){n.startTimerCommit&&(n.startTimerCommit(),n.startTimerCommit=null)},w)):n.startCommit({pulsate:c,rippleX:t,rippleY:r,rippleSize:i,cb:s})},n.startCommit=function(e){var t=e.pulsate,r=e.rippleX,i=e.rippleY,a=e.rippleSize,s=e.cb;n.setState(function(e){return{nextKey:e.nextKey+1,ripples:[].concat((0,o.default)(e.ripples),[h.default.createElement(v.default,{key:e.nextKey,classes:n.props.classes,timeout:{exit:y,enter:y},pulsate:t,rippleX:r,rippleY:i,rippleSize:a})])}},s)},n.stop=function(e,t){clearTimeout(n.startTimer);var r=n.state.ripples;if("touchend"===e.type&&n.startTimerCommit){e.persist(),n.startTimerCommit(),n.startTimerCommit=null,n.startTimer=setTimeout(function(){n.stop(e,t)});return}n.startTimerCommit=null,r&&r.length&&n.setState({ripples:r.slice(1)},t)},n}return(0,f.default)(t,e),(0,u.default)(t,[{key:"componentWillUnmount",value:function(){clearTimeout(this.startTimer)}},{key:"render",value:function(){var e=this.props,t=(e.center,e.classes),n=e.className,r=(0,a.default)(e,["center","classes","className"]);return h.default.createElement(b.default,(0,i.default)({component:"span",enter:!0,exit:!0,className:(0,m.default)(t.root,n)},r),this.state.ripples)}}]),t}(h.default.PureComponent);E.defaultProps={center:!1};var S=(0,g.default)(_,{flip:!1,name:"MuiTouchRipple"})(E);t.default=S},83673(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=function(e,t,n,r){return function(i){r&&r.call(e,i);var a=!1;return i.defaultPrevented&&(a=!0),e.props.disableTouchRipple&&"Blur"!==t&&(a=!0),!a&&e.ripple&&e.ripple[n](i),"function"==typeof e.props["on".concat(t)]&&e.props["on".concat(t)](i),!0}};"undefined"==typeof window&&(n=function(){return function(){}});var r=n;t.default=r},32252(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.detectFocusVisible=s,t.listenForFocusKeys=f,r(n(42473));var i=r(n(16143)),a={focusKeyPressed:!1,keyUpEventTimeout:-1};function o(e){for(var t=e.activeElement;t&&t.shadowRoot&&t.shadowRoot.activeElement;)t=t.shadowRoot.activeElement;return t}function s(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;e.focusVisibleTimeout=setTimeout(function(){var u=(0,i.default)(t),c=o(u);a.focusKeyPressed&&(c===t||t.contains(c))?n():r-1}var l=function(e){c(e)&&(a.focusKeyPressed=!0,clearTimeout(a.keyUpEventTimeout),a.keyUpEventTimeout=setTimeout(function(){a.focusKeyPressed=!1},500))};function f(e){e.addEventListener("keyup",l)}},16070(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return i.default}});var i=r(n(74610))},46003(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.styles=void 0;var i=r(n(10434)),a=r(n(70215)),o=r(n(67294));r(n(45697));var s=r(n(94184)),u=r(n(68821)),c=r(n(78252)),l={root:{overflow:"hidden"}};function f(e){var t=e.classes,n=e.className,r=e.raised,c=(0,a.default)(e,["classes","className","raised"]);return o.default.createElement(u.default,(0,i.default)({className:(0,s.default)(t.root,n),elevation:r?8:1},c))}t.styles=l,f.defaultProps={raised:!1};var d=(0,c.default)(l,{name:"MuiCard"})(f);t.default=d},82204(e,t,n){"use strict";var r,i=n(64836);r={value:!0},Object.defineProperty(t,"Z",{enumerable:!0,get:function(){return a.default}});var a=i(n(46003))},5780(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.styles=void 0;var i=r(n(10434)),a=r(n(70215)),o=r(n(67294));r(n(45697));var s=r(n(94184));n(55252);var u=r(n(78252)),c={root:{padding:16,"&:last-child":{paddingBottom:24}}};function l(e){var t=e.classes,n=e.className,r=e.component,u=(0,a.default)(e,["classes","className","component"]);return o.default.createElement(r,(0,i.default)({className:(0,s.default)(t.root,n)},u))}t.styles=c,l.defaultProps={component:"div"};var f=(0,u.default)(c,{name:"MuiCardContent"})(l);t.default=f},30060(e,t,n){"use strict";var r,i=n(64836);r={value:!0},Object.defineProperty(t,"Z",{enumerable:!0,get:function(){return a.default}});var a=i(n(5780))},50704(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.styles=void 0;var i=r(n(10434)),a=r(n(70215)),o=r(n(67294));r(n(45697));var s=r(n(94184));n(55252);var u=r(n(78252)),c=r(n(71426)),l={root:{display:"flex",alignItems:"center",padding:16},avatar:{flex:"0 0 auto",marginRight:16},action:{flex:"0 0 auto",alignSelf:"flex-start",marginTop:-8,marginRight:-8},content:{flex:"1 1 auto"},title:{},subheader:{}};function f(e){var t=e.action,n=e.avatar,r=e.classes,u=e.className,l=e.component,f=e.disableTypography,d=e.subheader,h=e.subheaderTypographyProps,p=e.title,b=e.titleTypographyProps,m=(0,a.default)(e,["action","avatar","classes","className","component","disableTypography","subheader","subheaderTypographyProps","title","titleTypographyProps"]),g=p;null==g||g.type===c.default||f||(g=o.default.createElement(c.default,(0,i.default)({variant:n?"body2":"headline",internalDeprecatedVariant:!0,className:r.title,component:"span"},b),g));var v=d;return null==v||v.type===c.default||f||(v=o.default.createElement(c.default,(0,i.default)({variant:n?"body2":"body1",className:r.subheader,color:"textSecondary",component:"span"},h),v)),o.default.createElement(l,(0,i.default)({className:(0,s.default)(r.root,u)},m),n&&o.default.createElement("div",{className:r.avatar},n),o.default.createElement("div",{className:r.content},g,v),t&&o.default.createElement("div",{className:r.action},t))}t.styles=l,f.defaultProps={component:"div",disableTypography:!1};var d=(0,u.default)(l,{name:"MuiCardHeader"})(f);t.default=d},52658(e,t,n){"use strict";var r,i=n(64836);r={value:!0},Object.defineProperty(t,"Z",{enumerable:!0,get:function(){return a.default}});var a=i(n(50704))},82811(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.styles=void 0;var i=r(n(10434)),a=r(n(38416)),o=r(n(70215)),s=r(n(67294));r(n(45697));var u=r(n(94184)),c=r(n(85609)),l=r(n(42159)),f=r(n(41549)),d=r(n(61486)),h=n(98741),p=r(n(78252)),b=function(e){return{root:{color:e.palette.text.secondary},checked:{},disabled:{},indeterminate:{},colorPrimary:{"&$checked":{color:e.palette.primary.main},"&$disabled":{color:e.palette.action.disabled}},colorSecondary:{"&$checked":{color:e.palette.secondary.main},"&$disabled":{color:e.palette.action.disabled}}}};function m(e){var t=e.checkedIcon,n=e.classes,r=e.className,l=e.color,f=e.icon,d=e.indeterminate,p=e.indeterminateIcon,b=e.inputProps,m=(0,o.default)(e,["checkedIcon","classes","className","color","icon","indeterminate","indeterminateIcon","inputProps"]);return s.default.createElement(c.default,(0,i.default)({type:"checkbox",checkedIcon:d?p:t,className:(0,u.default)((0,a.default)({},n.indeterminate,d),r),classes:{root:(0,u.default)(n.root,n["color".concat((0,h.capitalize)(l))]),checked:n.checked,disabled:n.disabled},inputProps:(0,i.default)({"data-indeterminate":d},b),icon:d?p:f},m))}t.styles=b,m.defaultProps={checkedIcon:s.default.createElement(f.default,null),color:"secondary",icon:s.default.createElement(l.default,null),indeterminate:!1,indeterminateIcon:s.default.createElement(d.default,null)};var g=(0,p.default)(b,{name:"MuiCheckbox"})(m);t.default=g},71209(e,t,n){"use strict";var r,i=n(64836);r={value:!0},Object.defineProperty(t,"Z",{enumerable:!0,get:function(){return a.default}});var a=i(n(82811))},16444(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.styles=void 0;var i=r(n(10434)),a=r(n(38416)),o=r(n(70215)),s=r(n(56690)),u=r(n(89728)),c=r(n(94993)),l=r(n(73808)),f=r(n(61655)),d=r(n(67294));r(n(45697));var h=r(n(94184));r(n(42473)),n(55252);var p=r(n(99781)),b=r(n(78252)),m=n(59114);r(n(21677));var g=n(98741);n(68477);var v=function(e){var t=32,n="light"===e.palette.type?e.palette.grey[300]:e.palette.grey[700],r=(0,m.fade)(e.palette.text.primary,.26);return{root:{fontFamily:e.typography.fontFamily,fontSize:e.typography.pxToRem(13),display:"inline-flex",alignItems:"center",justifyContent:"center",height:t,color:e.palette.getContrastText(n),backgroundColor:n,borderRadius:t/2,whiteSpace:"nowrap",transition:e.transitions.create(["background-color","box-shadow"]),cursor:"default",outline:"none",textDecoration:"none",border:"none",padding:0,verticalAlign:"middle",boxSizing:"border-box"},colorPrimary:{backgroundColor:e.palette.primary.main,color:e.palette.primary.contrastText},colorSecondary:{backgroundColor:e.palette.secondary.main,color:e.palette.secondary.contrastText},clickable:{WebkitTapHighlightColor:"transparent",cursor:"pointer","&:hover, &:focus":{backgroundColor:(0,m.emphasize)(n,.08)},"&:active":{boxShadow:e.shadows[1],backgroundColor:(0,m.emphasize)(n,.12)}},clickableColorPrimary:{"&:hover, &:focus":{backgroundColor:(0,m.emphasize)(e.palette.primary.main,.08)},"&:active":{backgroundColor:(0,m.emphasize)(e.palette.primary.main,.12)}},clickableColorSecondary:{"&:hover, &:focus":{backgroundColor:(0,m.emphasize)(e.palette.secondary.main,.08)},"&:active":{backgroundColor:(0,m.emphasize)(e.palette.secondary.main,.12)}},deletable:{"&:focus":{backgroundColor:(0,m.emphasize)(n,.08)}},deletableColorPrimary:{"&:focus":{backgroundColor:(0,m.emphasize)(e.palette.primary.main,.2)}},deletableColorSecondary:{"&:focus":{backgroundColor:(0,m.emphasize)(e.palette.secondary.main,.2)}},outlined:{backgroundColor:"transparent",border:"1px solid ".concat("light"===e.palette.type?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)"),"$clickable&:hover, $clickable&:focus, $deletable&:focus":{backgroundColor:(0,m.fade)(e.palette.text.primary,e.palette.action.hoverOpacity)},"& $avatar":{marginLeft:-1}},outlinedPrimary:{color:e.palette.primary.main,border:"1px solid ".concat(e.palette.primary.main),"$clickable&:hover, $clickable&:focus, $deletable&:focus":{backgroundColor:(0,m.fade)(e.palette.primary.main,e.palette.action.hoverOpacity)}},outlinedSecondary:{color:e.palette.secondary.main,border:"1px solid ".concat(e.palette.secondary.main),"$clickable&:hover, $clickable&:focus, $deletable&:focus":{backgroundColor:(0,m.fade)(e.palette.secondary.main,e.palette.action.hoverOpacity)}},avatar:{marginRight:-4,width:t,height:t,color:"light"===e.palette.type?e.palette.grey[700]:e.palette.grey[300],fontSize:e.typography.pxToRem(16)},avatarColorPrimary:{color:e.palette.primary.contrastText,backgroundColor:e.palette.primary.dark},avatarColorSecondary:{color:e.palette.secondary.contrastText,backgroundColor:e.palette.secondary.dark},avatarChildren:{width:19,height:19},icon:{color:"light"===e.palette.type?e.palette.grey[700]:e.palette.grey[300],marginLeft:4,marginRight:-8},iconColorPrimary:{color:"inherit"},iconColorSecondary:{color:"inherit"},label:{display:"flex",alignItems:"center",paddingLeft:12,paddingRight:12,userSelect:"none",whiteSpace:"nowrap",cursor:"inherit"},deleteIcon:{WebkitTapHighlightColor:"transparent",color:r,cursor:"pointer",height:"auto",margin:"0 4px 0 -8px","&:hover":{color:(0,m.fade)(r,.4)}},deleteIconColorPrimary:{color:(0,m.fade)(e.palette.primary.contrastText,.7),"&:hover, &:active":{color:e.palette.primary.contrastText}},deleteIconColorSecondary:{color:(0,m.fade)(e.palette.secondary.contrastText,.7),"&:hover, &:active":{color:e.palette.secondary.contrastText}},deleteIconOutlinedColorPrimary:{color:(0,m.fade)(e.palette.primary.main,.7),"&:hover, &:active":{color:e.palette.primary.main}},deleteIconOutlinedColorSecondary:{color:(0,m.fade)(e.palette.secondary.main,.7),"&:hover, &:active":{color:e.palette.secondary.main}}}};t.styles=v;var y=function(e){function t(){(0,s.default)(this,t);for(var e,n,r=arguments.length,i=Array(r),a=0;a :last-child":{paddingRight:32},"&$expanded":{margin:"20px 0"}},expandIcon:{position:"absolute",top:"50%",right:8,transform:"translateY(-50%) rotate(0deg)",transition:e.transitions.create("transform",t),"&:hover":{backgroundColor:"transparent"},"&$expanded":{transform:"translateY(-50%) rotate(180deg)"}}}};t.styles=g;var v=function(e){function t(){(0,s.default)(this,t);for(var e,n,r=arguments.length,i=Array(r),a=0;a $item":{padding:e/2}})}),n}var b=function(e){return(0,o.default)({container:{boxSizing:"border-box",display:"flex",flexWrap:"wrap",width:"100%"},item:{boxSizing:"border-box",margin:"0"},zeroMinWidth:{minWidth:0},"direction-xs-column":{flexDirection:"column"},"direction-xs-column-reverse":{flexDirection:"column-reverse"},"direction-xs-row-reverse":{flexDirection:"row-reverse"},"wrap-xs-nowrap":{flexWrap:"nowrap"},"wrap-xs-wrap-reverse":{flexWrap:"wrap-reverse"},"align-items-xs-center":{alignItems:"center"},"align-items-xs-flex-start":{alignItems:"flex-start"},"align-items-xs-flex-end":{alignItems:"flex-end"},"align-items-xs-baseline":{alignItems:"baseline"},"align-content-xs-center":{alignContent:"center"},"align-content-xs-flex-start":{alignContent:"flex-start"},"align-content-xs-flex-end":{alignContent:"flex-end"},"align-content-xs-space-between":{alignContent:"space-between"},"align-content-xs-space-around":{alignContent:"space-around"},"justify-xs-center":{justifyContent:"center"},"justify-xs-flex-end":{justifyContent:"flex-end"},"justify-xs-space-between":{justifyContent:"space-between"},"justify-xs-space-around":{justifyContent:"space-around"},"justify-xs-space-evenly":{justifyContent:"space-evenly"}},p(e,"xs"),l.keys.reduce(function(t,n){return h(t,e,n),t},{}))};function m(e){var t,n=e.alignContent,r=e.alignItems,c=e.classes,l=e.className,f=e.component,d=e.container,h=e.direction,p=e.item,b=e.justify,g=e.lg,v=e.md,y=e.sm,w=e.spacing,_=e.wrap,E=e.xl,S=e.xs,k=e.zeroMinWidth,x=(0,a.default)(e,["alignContent","alignItems","classes","className","component","container","direction","item","justify","lg","md","sm","spacing","wrap","xl","xs","zeroMinWidth"]),T=(0,u.default)((t={},(0,i.default)(t,c.container,d),(0,i.default)(t,c.item,p),(0,i.default)(t,c.zeroMinWidth,k),(0,i.default)(t,c["spacing-xs-".concat(String(w))],d&&0!==w),(0,i.default)(t,c["direction-xs-".concat(String(h))],h!==m.defaultProps.direction),(0,i.default)(t,c["wrap-xs-".concat(String(_))],_!==m.defaultProps.wrap),(0,i.default)(t,c["align-items-xs-".concat(String(r))],r!==m.defaultProps.alignItems),(0,i.default)(t,c["align-content-xs-".concat(String(n))],n!==m.defaultProps.alignContent),(0,i.default)(t,c["justify-xs-".concat(String(b))],b!==m.defaultProps.justify),(0,i.default)(t,c["grid-xs-".concat(String(S))],!1!==S),(0,i.default)(t,c["grid-sm-".concat(String(y))],!1!==y),(0,i.default)(t,c["grid-md-".concat(String(v))],!1!==v),(0,i.default)(t,c["grid-lg-".concat(String(g))],!1!==g),(0,i.default)(t,c["grid-xl-".concat(String(E))],!1!==E),t),l);return s.default.createElement(f,(0,o.default)({className:T},x))}t.styles=b,m.defaultProps={alignContent:"stretch",alignItems:"stretch",component:"div",container:!1,direction:"row",item:!1,justify:"flex-start",lg:!1,md:!1,sm:!1,spacing:0,wrap:"wrap",xl:!1,xs:!1,zeroMinWidth:!1};var g,v=(0,c.default)(b,{name:"MuiGrid"})(m);t.default=v},39814(e,t,n){"use strict";var r,i=n(64836);r={value:!0},Object.defineProperty(t,"Z",{enumerable:!0,get:function(){return a.default}});var a=i(n(27973))},57205(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(10434)),a=r(n(70215)),o=r(n(56690)),s=r(n(89728)),u=r(n(94993)),c=r(n(73808)),l=r(n(61655)),f=r(n(67294));r(n(45697));var d=r(n(60644)),h=r(n(82313)),p=n(41929);function b(e){return"scale(".concat(e,", ").concat(Math.pow(e,2),")")}var m={entering:{opacity:1,transform:b(1)},entered:{opacity:1,transform:"".concat(b(1)," translateZ(0)")}},g=function(e){function t(){(0,o.default)(this,t);for(var e,n,r=arguments.length,i=Array(r),a=0;a=Number(e.rows)&&(n=Math.min(Number(e.rowsMax)*t,n)),n=Math.max(n,t),Math.abs(this.state.height-n)>1&&this.setState({height:n}))}}},{key:"render",value:function(){var e=this.props,t=e.classes,n=e.className,r=e.defaultValue,o=(e.onChange,e.rows),s=(e.rowsMax,e.style),u=(e.textareaRef,e.value),c=(0,a.default)(e,["classes","className","defaultValue","onChange","rows","rowsMax","style","textareaRef","value"]);return f.default.createElement("div",{className:t.root},f.default.createElement(p.default,{target:"window",onResize:this.handleResize}),f.default.createElement("textarea",{"aria-hidden":"true",className:(0,d.default)(t.textarea,t.shadow),readOnly:!0,ref:this.handleRefSinglelineShadow,rows:"1",tabIndex:-1,value:""}),f.default.createElement("textarea",{"aria-hidden":"true",className:(0,d.default)(t.textarea,t.shadow),defaultValue:r,readOnly:!0,ref:this.handleRefShadow,rows:o,tabIndex:-1,value:u}),f.default.createElement("textarea",(0,i.default)({rows:o,className:(0,d.default)(t.textarea,n),defaultValue:r,value:u,onChange:this.handleChange,ref:this.handleRefInput,style:(0,i.default)({height:this.state.height},s)},c)))}}]),t}(f.default.Component);y.defaultProps={rows:1};var w=(0,b.default)(v,{name:"MuiPrivateTextarea"})(y);t.default=w},67598(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return i.default}});var i=r(n(62010))},78586(e,t){"use strict";function n(e){return null!=e&&!(Array.isArray(e)&&0===e.length)}function r(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return e&&(n(e.value)&&""!==e.value||t&&n(e.defaultValue)&&""!==e.defaultValue)}function i(e){return e.startAdornment}Object.defineProperty(t,"__esModule",{value:!0}),t.hasValue=n,t.isFilled=r,t.isAdornedStart=i},56030(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.styles=void 0;var i=r(n(10434)),a=r(n(38416)),o=r(n(70215)),s=r(n(67294));r(n(45697));var u=r(n(94184)),c=r(n(58189)),l=r(n(52598)),f=r(n(78252)),d=r(n(69645)),h=function(e){return{root:{transformOrigin:"top left"},focused:{},disabled:{},error:{},required:{},formControl:{position:"absolute",left:0,top:0,transform:"translate(0, 24px) scale(1)"},marginDense:{transform:"translate(0, 21px) scale(1)"},shrink:{transform:"translate(0, 1.5px) scale(0.75)",transformOrigin:"top left"},animated:{transition:e.transitions.create(["color","transform"],{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut})},filled:{zIndex:1,pointerEvents:"none",transform:"translate(12px, 20px) scale(1)","&$marginDense":{transform:"translate(12px, 17px) scale(1)"},"&$shrink":{transform:"translate(12px, 10px) scale(0.75)","&$marginDense":{transform:"translate(12px, 7px) scale(0.75)"}}},outlined:{zIndex:1,pointerEvents:"none",transform:"translate(14px, 20px) scale(1)","&$marginDense":{transform:"translate(14px, 17px) scale(1)"},"&$shrink":{transform:"translate(14px, -6px) scale(0.75)"}}}};function p(e){var t,n=e.children,r=e.classes,l=e.className,f=e.disableAnimation,h=e.FormLabelClasses,p=(e.margin,e.muiFormControl),b=e.shrink,m=(e.variant,(0,o.default)(e,["children","classes","className","disableAnimation","FormLabelClasses","margin","muiFormControl","shrink","variant"])),g=b;void 0===g&&p&&(g=p.filled||p.focused||p.adornedStart);var v=(0,c.default)({props:e,muiFormControl:p,states:["margin","variant"]}),y=(0,u.default)(r.root,(t={},(0,a.default)(t,r.formControl,p),(0,a.default)(t,r.animated,!f),(0,a.default)(t,r.shrink,g),(0,a.default)(t,r.marginDense,"dense"===v.margin),(0,a.default)(t,r.filled,"filled"===v.variant),(0,a.default)(t,r.outlined,"outlined"===v.variant),t),l);return s.default.createElement(d.default,(0,i.default)({"data-shrink":g,className:y,classes:(0,i.default)({focused:r.focused,disabled:r.disabled,error:r.error,required:r.required},h)},m),n)}t.styles=h,p.defaultProps={disableAnimation:!1};var b=(0,f.default)(h,{name:"MuiInputLabel"})((0,l.default)(p));t.default=b},23153(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return i.default}});var i=r(n(56030))},46616(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.styles=void 0;var i=r(n(10434)),a=r(n(38416)),o=r(n(70215)),s=r(n(67294));r(n(45697));var u=r(n(94184));r(n(42473));var c=r(n(78252)),l=n(59114),f=4,d=function(e){return{root:{position:"relative",overflow:"hidden",height:4},colorPrimary:{backgroundColor:(0,l.lighten)(e.palette.primary.light,.6)},colorSecondary:{backgroundColor:(0,l.lighten)(e.palette.secondary.light,.4)},determinate:{},indeterminate:{},buffer:{backgroundColor:"transparent"},query:{transform:"rotate(180deg)"},dashed:{position:"absolute",marginTop:0,height:"100%",width:"100%",animation:"buffer 3s infinite linear",animationName:"$buffer"},dashedColorPrimary:{backgroundImage:"radial-gradient(".concat((0,l.lighten)(e.palette.primary.light,.6)," 0%, ").concat((0,l.lighten)(e.palette.primary.light,.6)," 16%, transparent 42%)"),backgroundSize:"10px 10px",backgroundPosition:"0px -23px"},dashedColorSecondary:{backgroundImage:"radial-gradient(".concat((0,l.lighten)(e.palette.secondary.light,.4)," 0%, ").concat((0,l.lighten)(e.palette.secondary.light,.6)," 16%, transparent 42%)"),backgroundSize:"10px 10px",backgroundPosition:"0px -23px"},bar:{width:"100%",position:"absolute",left:0,bottom:0,top:0,transition:"transform 0.2s linear",transformOrigin:"left"},barColorPrimary:{backgroundColor:e.palette.primary.main},barColorSecondary:{backgroundColor:e.palette.secondary.main},bar1Indeterminate:{width:"auto",animation:"mui-indeterminate1 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite",animationName:"$mui-indeterminate1"},bar1Determinate:{transition:"transform .".concat(f,"s linear")},bar1Buffer:{zIndex:1,transition:"transform .".concat(f,"s linear")},bar2Indeterminate:{width:"auto",animation:"mui-indeterminate2 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) infinite",animationName:"$mui-indeterminate2",animationDelay:"1.15s"},bar2Buffer:{transition:"transform .".concat(f,"s linear")},"@keyframes mui-indeterminate1":{"0%":{left:"-35%",right:"100%"},"60%":{left:"100%",right:"-90%"},"100%":{left:"100%",right:"-90%"}},"@keyframes mui-indeterminate2":{"0%":{left:"-200%",right:"100%"},"60%":{left:"107%",right:"-8%"},"100%":{left:"107%",right:"-8%"}},"@keyframes buffer":{"0%":{opacity:1,backgroundPosition:"0px -23px"},"50%":{opacity:0,backgroundPosition:"0px -23px"},"100%":{opacity:1,backgroundPosition:"-200px -23px"}}}};function h(e){var t,n,r,c,l=e.classes,f=e.className,d=e.color,h=e.value,p=e.valueBuffer,b=e.variant,m=(0,o.default)(e,["classes","className","color","value","valueBuffer","variant"]),g=(0,u.default)(l.root,(t={},(0,a.default)(t,l.colorPrimary,"primary"===d),(0,a.default)(t,l.colorSecondary,"secondary"===d),(0,a.default)(t,l.determinate,"determinate"===b),(0,a.default)(t,l.indeterminate,"indeterminate"===b),(0,a.default)(t,l.buffer,"buffer"===b),(0,a.default)(t,l.query,"query"===b),t),f),v=(0,u.default)(l.dashed,(n={},(0,a.default)(n,l.dashedColorPrimary,"primary"===d),(0,a.default)(n,l.dashedColorSecondary,"secondary"===d),n)),y=(0,u.default)(l.bar,(r={},(0,a.default)(r,l.barColorPrimary,"primary"===d),(0,a.default)(r,l.barColorSecondary,"secondary"===d),(0,a.default)(r,l.bar1Indeterminate,"indeterminate"===b||"query"===b),(0,a.default)(r,l.bar1Determinate,"determinate"===b),(0,a.default)(r,l.bar1Buffer,"buffer"===b),r)),w=(0,u.default)(l.bar,(c={},(0,a.default)(c,l.barColorPrimary,"primary"===d&&"buffer"!==b),(0,a.default)(c,l.colorPrimary,"primary"===d&&"buffer"===b),(0,a.default)(c,l.barColorSecondary,"secondary"===d&&"buffer"!==b),(0,a.default)(c,l.colorSecondary,"secondary"===d&&"buffer"===b),(0,a.default)(c,l.bar2Indeterminate,"indeterminate"===b||"query"===b),(0,a.default)(c,l.bar2Buffer,"buffer"===b),c)),_={},E={bar1:{},bar2:{}};return("determinate"===b||"buffer"===b)&&void 0!==h&&(_["aria-valuenow"]=Math.round(h),E.bar1.transform="scaleX(".concat(h/100,")")),"buffer"===b&&void 0!==p&&(E.bar2.transform="scaleX(".concat((p||0)/100,")")),s.default.createElement("div",(0,i.default)({className:g,role:"progressbar"},_,m),"buffer"===b?s.default.createElement("div",{className:v}):null,s.default.createElement("div",{className:y,style:E.bar1}),"determinate"===b?null:s.default.createElement("div",{className:w,style:E.bar2}))}t.styles=d,h.defaultProps={color:"primary",variant:"indeterminate"};var p=(0,c.default)(d,{name:"MuiLinearProgress"})(h);t.default=p},79424(e,t,n){"use strict";var r,i=n(64836);r={value:!0},Object.defineProperty(t,"Z",{enumerable:!0,get:function(){return a.default}});var a=i(n(46616))},74080(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.styles=void 0;var i=r(n(10434)),a=r(n(38416)),o=r(n(70215)),s=r(n(67294));r(n(45697));var u=r(n(94184));n(55252);var c=r(n(78252)),l=r(n(47457)),f={root:{listStyle:"none",margin:0,padding:0,position:"relative"},padding:{paddingTop:8,paddingBottom:8},dense:{paddingTop:4,paddingBottom:4},subheader:{paddingTop:0}};function d(e){var t,n=e.children,r=e.classes,c=e.className,f=e.component,d=e.dense,h=e.disablePadding,p=e.subheader,b=(0,o.default)(e,["children","classes","className","component","dense","disablePadding","subheader"]);return s.default.createElement(f,(0,i.default)({className:(0,u.default)(r.root,(t={},(0,a.default)(t,r.dense,d&&!h),(0,a.default)(t,r.padding,!h),(0,a.default)(t,r.subheader,p),t),c)},b),s.default.createElement(l.default.Provider,{value:{dense:d}},p,n))}t.styles=f,d.defaultProps={component:"ul",dense:!1,disablePadding:!1};var h=(0,c.default)(f,{name:"MuiList"})(d);t.default=h},47457(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(67294)).default.createContext({});t.default=i},3022(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return i.default}});var i=r(n(74080))},29936(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.styles=void 0;var i=r(n(10434)),a=r(n(38416)),o=r(n(70215)),s=r(n(67294));r(n(45697));var u=r(n(94184));n(55252);var c=r(n(78252)),l=r(n(16070)),f=n(44370),d=r(n(671)),h=function(e){return{root:{display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",width:"100%",boxSizing:"border-box",textAlign:"left",paddingTop:11,paddingBottom:11,"&$selected, &$selected:hover, &$selected:focus":{backgroundColor:e.palette.action.selected}},container:{position:"relative"},focusVisible:{},default:{},dense:{paddingTop:8,paddingBottom:8},alignItemsFlexStart:{alignItems:"flex-start"},disabled:{opacity:.5},divider:{borderBottom:"1px solid ".concat(e.palette.divider),backgroundClip:"padding-box"},gutters:{paddingLeft:16,paddingRight:16},button:{transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest}),"&:hover":{textDecoration:"none",backgroundColor:e.palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},"&:focus":{backgroundColor:e.palette.action.hover}},secondaryAction:{paddingRight:32},selected:{}}};function p(e){var t=e.alignItems,n=e.button,r=e.children,c=e.classes,h=e.className,p=e.component,b=e.ContainerComponent,m=e.ContainerProps,g=(m=void 0===m?{}:m).className,v=(0,o.default)(m,["className"]),y=e.dense,w=e.disabled,_=e.disableGutters,E=e.divider,S=e.focusVisibleClassName,k=e.selected,x=(0,o.default)(e,["alignItems","button","children","classes","className","component","ContainerComponent","ContainerProps","dense","disabled","disableGutters","divider","focusVisibleClassName","selected"]);return s.default.createElement(d.default,{dense:y,alignItems:t},function(e){var o,d=e.dense,m=s.default.Children.toArray(r),y=m.some(function(e){return(0,f.isMuiElement)(e,["ListItemAvatar"])}),T=m.length&&(0,f.isMuiElement)(m[m.length-1],["ListItemSecondaryAction"]),M=(0,u.default)(c.root,c.default,(o={},(0,a.default)(o,c.dense,d||y),(0,a.default)(o,c.gutters,!_),(0,a.default)(o,c.divider,E),(0,a.default)(o,c.disabled,w),(0,a.default)(o,c.button,n),(0,a.default)(o,c.alignItemsFlexStart,"flex-start"===t),(0,a.default)(o,c.secondaryAction,T),(0,a.default)(o,c.selected,k),o),h),O=(0,i.default)({className:M,disabled:w},x),A=p||"li";return(n&&(O.component=p||"div",O.focusVisibleClassName=(0,u.default)(c.focusVisible,S),A=l.default),T)?(A=O.component||p?A:"div","li"===b&&("li"===A?A="div":"li"===O.component&&(O.component="div")),s.default.createElement(b,(0,i.default)({className:(0,u.default)(c.container,g)},v),s.default.createElement(A,O,m),m.pop())):s.default.createElement(A,O,m)})}t.styles=h,p.defaultProps={alignItems:"center",button:!1,ContainerComponent:"li",dense:!1,disabled:!1,disableGutters:!1,divider:!1,selected:!1};var b=(0,c.default)(h,{name:"MuiListItem"})(p);t.default=b},671(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(67294));r(n(45697));var a=r(n(47457));function o(e){var t=e.alignItems,n=e.children,r=e.dense;return i.default.createElement(a.default.Consumer,null,function(e){var o={dense:r||e.dense||!1,alignItems:t};return i.default.createElement(a.default.Provider,{value:o},n(o))})}var s=o;t.default=s},60323(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return i.default}});var i=r(n(29936))},69394(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.styles=void 0;var i=r(n(10434)),a=r(n(70215)),o=r(n(67294));r(n(45697));var s=r(n(94184)),u=r(n(78252)),c=function(e){return{root:{marginRight:16,color:e.palette.action.active,flexShrink:0,display:"inline-flex"}}};function l(e){var t=e.children,n=e.classes,r=e.className,u=(0,a.default)(e,["children","classes","className"]);return o.default.createElement("div",(0,i.default)({className:(0,s.default)(n.root,r)},u),t)}t.styles=c;var f=(0,u.default)(c,{name:"MuiListItemIcon"})(l);t.default=f},11186(e,t,n){"use strict";var r,i=n(64836);r={value:!0},Object.defineProperty(t,"Z",{enumerable:!0,get:function(){return a.default}});var a=i(n(69394))},73390(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.styles=void 0;var i=r(n(10434)),a=r(n(38416)),o=r(n(70215)),s=r(n(67294));r(n(45697));var u=r(n(94184)),c=r(n(78252)),l=r(n(71426)),f=r(n(47457)),d=function(e){return{root:{flex:"1 1 auto",minWidth:0,padding:"0 16px","&:first-child":{paddingLeft:0}},inset:{"&:first-child":{paddingLeft:56}},dense:{fontSize:e.typography.pxToRem(13)},primary:{"&$textDense":{fontSize:"inherit"}},secondary:{"&$textDense":{fontSize:"inherit"}},textDense:{}}};function h(e){var t=e.children,n=e.classes,r=e.className,c=e.disableTypography,d=e.inset,h=e.primary,p=e.primaryTypographyProps,b=e.secondary,m=e.secondaryTypographyProps,g=e.theme,v=(0,o.default)(e,["children","classes","className","disableTypography","inset","primary","primaryTypographyProps","secondary","secondaryTypographyProps","theme"]);return s.default.createElement(f.default.Consumer,null,function(e){var o,f=e.dense,y=null!=h?h:t;null==y||y.type===l.default||c||(y=s.default.createElement(l.default,(0,i.default)({variant:g.typography.useNextVariants?"body1":"subheading",className:(0,u.default)(n.primary,(0,a.default)({},n.textDense,f)),component:"span"},p),y));var w=b;return null==w||w.type===l.default||c||(w=s.default.createElement(l.default,(0,i.default)({className:(0,u.default)(n.secondary,(0,a.default)({},n.textDense,f)),color:"textSecondary"},m),w)),s.default.createElement("div",(0,i.default)({className:(0,u.default)(n.root,(o={},(0,a.default)(o,n.dense,f),(0,a.default)(o,n.inset,d),o),r)},v),y,w)})}t.styles=d,h.defaultProps={disableTypography:!1,inset:!1};var p=(0,c.default)(d,{name:"MuiListItemText",withTheme:!0})(h);t.default=p},87591(e,t,n){"use strict";var r,i=n(64836);r={value:!0},Object.defineProperty(t,"Z",{enumerable:!0,get:function(){return a.default}});var a=i(n(73390))},95890(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.styles=void 0;var i=r(n(10434)),a=r(n(70215)),o=r(n(56690)),s=r(n(89728)),u=r(n(94993)),c=r(n(73808)),l=r(n(61655)),f=r(n(67294));r(n(45697));var d=r(n(73935)),h=r(n(44825)),p=r(n(78252)),b=r(n(50810)),m=r(n(34980)),g={vertical:"top",horizontal:"right"},v={vertical:"top",horizontal:"left"},y={paper:{maxHeight:"calc(100% - 96px)",WebkitOverflowScrolling:"touch"}};t.styles=y;var w=function(e){function t(){(0,o.default)(this,t);for(var e,n,r=arguments.length,i=Array(r),a=0;a=0?t.children[e].focus():t.firstChild.focus())}},{key:"resetTabIndex",value:function(){for(var e=this.listRef,t=(0,h.default)(e).activeElement,n=[],r=0;r0&&void 0!==arguments[0]?arguments[0]:{};(0,i.default)(this,e);var n=t.hideSiblingNodes,r=void 0===n||n,a=t.handleContainerOverflow,o=void 0===a||a;this.hideSiblingNodes=r,this.handleContainerOverflow=o,this.modals=[],this.data=[]}return(0,a.default)(e,[{key:"add",value:function(e,t){var n=this.modals.indexOf(e);if(-1!==n)return n;n=this.modals.length,this.modals.push(e),e.modalRef&&(0,l.ariaHidden)(e.modalRef,!1),this.hideSiblingNodes&&(0,l.ariaHiddenSiblings)(t,e.mountNode,e.modalRef,!0);var r=f(this.data,function(e){return e.container===t});if(-1!==r)return this.data[r].modals.push(e),n;var i={modals:[e],container:t,overflowing:(0,c.default)(t),prevPaddings:[]};return this.data.push(i),n}},{key:"mount",value:function(e){var t=f(this.data,function(t){return -1!==t.modals.indexOf(e)}),n=this.data[t];!n.style&&this.handleContainerOverflow&&h(n)}},{key:"remove",value:function(e){var t=this.modals.indexOf(e);if(-1===t)return t;var n=f(this.data,function(t){return -1!==t.modals.indexOf(e)}),r=this.data[n];if(r.modals.splice(r.modals.indexOf(e),1),this.modals.splice(t,1),0===r.modals.length)this.handleContainerOverflow&&p(r),e.modalRef&&(0,l.ariaHidden)(e.modalRef,!0),this.hideSiblingNodes&&(0,l.ariaHiddenSiblings)(r.container,e.mountNode,e.modalRef,!1),this.data.splice(n,1);else if(this.hideSiblingNodes){var i=r.modals[r.modals.length-1];i.modalRef&&(0,l.ariaHidden)(i.modalRef,!1)}return t}},{key:"isTopModal",value:function(e){return!!this.modals.length&&this.modals[this.modals.length-1]===e}}]),e}();t.default=b},55536(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(t,"ModalManager",{enumerable:!0,get:function(){return a.default}});var i=r(n(58228)),a=r(n(2158))},16575(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.isBody=s,t.default=u;var i=r(n(7624)),a=r(n(16143)),o=r(n(62614));function s(e){return e&&"body"===e.tagName.toLowerCase()}function u(e){var t=(0,a.default)(e),n=(0,o.default)(t);if(!(0,i.default)(t)&&!s(e))return e.scrollHeight>e.clientHeight;var r=n.getComputedStyle(t.body),u=parseInt(r.getPropertyValue("margin-left"),10),c=parseInt(r.getPropertyValue("margin-right"),10);return u+t.body.clientWidth+c0?.75*r+8:0;return s.default.createElement("fieldset",(0,a.default)({"aria-hidden":!0,style:(0,a.default)((0,i.default)({},"padding".concat((0,l.capitalize)(p)),8+(c?0:b/2)),f),className:(0,u.default)(t.root,n)},h),s.default.createElement("legend",{className:t.legend,style:{width:c?b:.01}},s.default.createElement("span",{dangerouslySetInnerHTML:{__html:"​"}})))}t.styles=f;var h=(0,c.withStyles)(f,{name:"MuiPrivateNotchedOutline",withTheme:!0})(d);t.default=h},96405(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.styles=void 0;var i=r(n(10434)),a=r(n(70215)),o=r(n(67294));r(n(45697));var s=r(n(94184));n(55252);var u=r(n(67598)),c=r(n(21142)),l=r(n(78252)),f=function(e){var t="light"===e.palette.type?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{root:{position:"relative","& $notchedOutline":{borderColor:t},"&:hover:not($disabled):not($focused):not($error) $notchedOutline":{borderColor:e.palette.text.primary,"@media (hover: none)":{borderColor:t}},"&$focused $notchedOutline":{borderColor:e.palette.primary.main,borderWidth:2},"&$error $notchedOutline":{borderColor:e.palette.error.main},"&$disabled $notchedOutline":{borderColor:e.palette.action.disabled}},focused:{},disabled:{},adornedStart:{paddingLeft:14},adornedEnd:{paddingRight:14},error:{},multiline:{padding:"18.5px 14px",boxSizing:"border-box"},notchedOutline:{},input:{padding:"18.5px 14px"},inputMarginDense:{paddingTop:15,paddingBottom:15},inputMultiline:{padding:0},inputAdornedStart:{paddingLeft:0},inputAdornedEnd:{paddingRight:0}}};function d(e){var t=e.classes,n=e.labelWidth,r=e.notched,l=(0,a.default)(e,["classes","labelWidth","notched"]);return o.default.createElement(u.default,(0,i.default)({renderPrefix:function(e){return o.default.createElement(c.default,{className:t.notchedOutline,labelWidth:n,notched:void 0!==r?r:Boolean(e.startAdornment||e.filled||e.focused)})},classes:(0,i.default)({},t,{root:(0,s.default)(t.root,t.underline),notchedOutline:null})},l))}t.styles=f,u.default.defaultProps={fullWidth:!1,inputComponent:"input",multiline:!1,type:"text"},d.muiName="Input";var h=(0,l.default)(f,{name:"MuiOutlinedInput"})(d);t.default=h},59537(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return i.default}});var i=r(n(96405))},30083(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.styles=void 0;var i=r(n(38416)),a=r(n(70215)),o=r(n(10434)),s=r(n(67294));r(n(45697));var u=r(n(94184));r(n(42473)),n(55252);var c=r(n(78252)),l=function(e){var t={};return e.shadows.forEach(function(e,n){t["elevation".concat(n)]={boxShadow:e}}),(0,o.default)({root:{backgroundColor:e.palette.background.paper},rounded:{borderRadius:e.shape.borderRadius}},t)};function f(e){var t=e.classes,n=e.className,r=e.component,c=e.square,l=e.elevation,f=(0,a.default)(e,["classes","className","component","square","elevation"]),d=(0,u.default)(t.root,t["elevation".concat(l)],(0,i.default)({},t.rounded,!c),n);return s.default.createElement(r,(0,o.default)({className:d},f))}t.styles=l,f.defaultProps={component:"div",elevation:2,square:!1};var d=(0,c.default)(l,{name:"MuiPaper"})(f);t.default=d},68821(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return i.default}});var i=r(n(30083))},64224(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.styles=void 0;var i=r(n(10434)),a=r(n(70215)),o=r(n(56690)),s=r(n(89728)),u=r(n(94993)),c=r(n(73808)),l=r(n(61655)),f=r(n(67294));r(n(45697));var d=r(n(73935));r(n(42473));var h=r(n(20296)),p=r(n(96421));n(55252);var b=r(n(16143)),m=r(n(62614)),g=n(98741),v=r(n(78252)),y=r(n(55536)),w=r(n(261)),_=r(n(68821));function E(e,t){var n=0;return"number"==typeof t?n=t:"center"===t?n=e.height/2:"bottom"===t&&(n=e.height),n}function S(e,t){var n=0;return"number"==typeof t?n=t:"center"===t?n=e.width/2:"right"===t&&(n=e.width),n}function k(e){return[e.horizontal,e.vertical].map(function(e){return"number"==typeof e?"".concat(e,"px"):e}).join(" ")}function x(e,t){for(var n=t,r=0;n&&n!==e;)r+=(n=n.parentNode).scrollTop;return r}function T(e){return"function"==typeof e?e():e}var M={paper:{position:"absolute",overflowY:"auto",overflowX:"hidden",minWidth:16,minHeight:16,maxWidth:"calc(100% - 32px)",maxHeight:"calc(100% - 32px)",outline:"none"}};t.styles=M;var O=function(e){function t(){var e;return(0,o.default)(this,t),(e=(0,u.default)(this,(0,c.default)(t).call(this))).handleGetOffsetTop=E,e.handleGetOffsetLeft=S,e.componentWillUnmount=function(){e.handleResize.clear()},e.setPositioningStyles=function(t){var n=e.getPositioningStyle(t);null!==n.top&&(t.style.top=n.top),null!==n.left&&(t.style.left=n.left),t.style.transformOrigin=n.transformOrigin},e.getPositioningStyle=function(t){var n=e.props,r=n.anchorEl,i=n.anchorReference,a=n.marginThreshold,o=e.getContentAnchorOffset(t),s={width:t.offsetWidth,height:t.offsetHeight},u=e.getTransformOrigin(s,o);if("none"===i)return{top:null,left:null,transformOrigin:k(u)};var c=e.getAnchorOffset(o),l=c.top-u.vertical,f=c.left-u.horizontal,d=l+s.height,h=f+s.width,p=(0,m.default)(T(r)),b=p.innerHeight-a,g=p.innerWidth-a;if(lb){var y=d-b;l-=y,u.vertical+=y}if(fg){var _=h-g;f-=_,u.horizontal+=_}return{top:"".concat(l,"px"),left:"".concat(f,"px"),transformOrigin:k(u)}},e.handleEntering=function(t){e.props.onEntering&&e.props.onEntering(t),e.setPositioningStyles(t)},"undefined"!=typeof window&&(e.handleResize=(0,h.default)(function(){e.props.open&&e.setPositioningStyles(e.paperRef)},166)),e}return(0,l.default)(t,e),(0,s.default)(t,[{key:"componentDidMount",value:function(){this.props.action&&this.props.action({updatePosition:this.handleResize})}},{key:"getAnchorOffset",value:function(e){var t=this.props,n=t.anchorEl,r=t.anchorOrigin,i=t.anchorReference,a=t.anchorPosition;if("anchorPosition"===i)return a;var o=(T(n)||(0,b.default)(this.paperRef).body).getBoundingClientRect(),s=0===e?r.vertical:"center";return{top:o.top+this.handleGetOffsetTop(o,s),left:o.left+this.handleGetOffsetLeft(o,r.horizontal)}}},{key:"getContentAnchorOffset",value:function(e){var t=this.props,n=t.getContentAnchorEl,r=t.anchorReference,i=0;if(n&&"anchorEl"===r){var a=n(e);if(a&&e.contains(a)){var o=x(e,a);i=a.offsetTop+a.clientHeight/2-o||0}}return i}},{key:"getTransformOrigin",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.props.transformOrigin;return{vertical:this.handleGetOffsetTop(e,n.vertical)+t,horizontal:this.handleGetOffsetLeft(e,n.horizontal)}}},{key:"render",value:function(){var e=this,t=this.props,n=(t.action,t.anchorEl),r=(t.anchorOrigin,t.anchorPosition,t.anchorReference,t.children),o=t.classes,s=t.container,u=t.elevation,c=(t.getContentAnchorEl,t.marginThreshold,t.ModalClasses),l=t.onEnter,h=t.onEntered,m=(t.onEntering,t.onExit),v=t.onExited,w=t.onExiting,E=t.open,S=t.PaperProps,k=t.role,x=(t.transformOrigin,t.TransitionComponent),M=t.transitionDuration,O=t.TransitionProps,A=void 0===O?{}:O,L=(0,a.default)(t,["action","anchorEl","anchorOrigin","anchorPosition","anchorReference","children","classes","container","elevation","getContentAnchorEl","marginThreshold","ModalClasses","onEnter","onEntered","onEntering","onExit","onExited","onExiting","open","PaperProps","role","transformOrigin","TransitionComponent","transitionDuration","TransitionProps"]),C=M;"auto"!==M||x.muiSupportAuto||(C=void 0);var I=s||(n?(0,b.default)(T(n)).body:void 0);return f.default.createElement(y.default,(0,i.default)({classes:c,container:I,open:E,BackdropProps:{invisible:!0}},L),f.default.createElement(x,(0,i.default)({appear:!0,in:E,onEnter:l,onEntered:h,onExit:m,onExited:v,onExiting:w,role:k,timeout:C},A,{onEntering:(0,g.createChainedFunction)(this.handleEntering,A.onEntering)}),f.default.createElement(_.default,(0,i.default)({className:o.paper,elevation:u,ref:function(t){e.paperRef=d.default.findDOMNode(t)}},S),f.default.createElement(p.default,{target:"window",onResize:this.handleResize}),r)))}}]),t}(f.default.Component);O.defaultProps={anchorReference:"anchorEl",anchorOrigin:{vertical:"top",horizontal:"left"},elevation:8,marginThreshold:16,transformOrigin:{vertical:"top",horizontal:"left"},TransitionComponent:w.default,transitionDuration:"auto"};var A=(0,v.default)(M,{name:"MuiPopover"})(O);t.default=A},50810(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return i.default}});var i=r(n(64224))},24693(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(70215)),a=r(n(10434)),o=r(n(56690)),s=r(n(89728)),u=r(n(94993)),c=r(n(73808)),l=r(n(61655)),f=r(n(66115)),d=r(n(67294)),h=r(n(73935));r(n(45697));var p=r(n(28981)),b=r(n(25649));function m(e){if("rtl"!==("undefined"!=typeof window&&document.body.getAttribute("dir")||"ltr"))return e;switch(e){case"bottom-end":return"bottom-start";case"bottom-start":return"bottom-end";case"top-end":return"top-start";case"top-start":return"top-end";default:return e}}function g(e){return"function"==typeof e?e():e}var v=function(e){function t(e){var n;return(0,o.default)(this,t),(n=(0,u.default)(this,(0,c.default)(t).call(this))).handleOpen=function(){var e=n.props,t=e.anchorEl,r=e.modifiers,i=e.open,o=e.placement,s=e.popperOptions,u=void 0===s?{}:s,c=e.disablePortal,l=h.default.findDOMNode((0,f.default)((0,f.default)(n)));l&&t&&i&&(n.popper&&(n.popper.destroy(),n.popper=null),n.popper=new p.default(g(t),l,(0,a.default)({placement:m(o)},u,{modifiers:(0,a.default)({},c?{}:{preventOverflow:{boundariesElement:"window"}},r,u.modifiers),onCreate:n.handlePopperUpdate,onUpdate:n.handlePopperUpdate})))},n.handlePopperUpdate=function(e){e.placement!==n.state.placement&&n.setState({placement:e.placement})},n.handleExited=function(){n.setState({exited:!0}),n.handleClose()},n.handleClose=function(){n.popper&&(n.popper.destroy(),n.popper=null)},n.state={exited:!e.open},n}return(0,l.default)(t,e),(0,s.default)(t,[{key:"componentDidUpdate",value:function(e){e.open===this.props.open||this.props.open||this.props.transition||this.handleClose(),(e.open!==this.props.open||e.anchorEl!==this.props.anchorEl||e.popperOptions!==this.props.popperOptions||e.modifiers!==this.props.modifiers||e.disablePortal!==this.props.disablePortal||e.placement!==this.props.placement)&&this.handleOpen()}},{key:"componentWillUnmount",value:function(){this.handleClose()}},{key:"render",value:function(){var e=this.props,t=(e.anchorEl,e.children),n=e.container,r=e.disablePortal,o=e.keepMounted,s=(e.modifiers,e.open),u=e.placement,c=(e.popperOptions,e.transition),l=(0,i.default)(e,["anchorEl","children","container","disablePortal","keepMounted","modifiers","open","placement","popperOptions","transition"]),f=this.state,h=f.exited,p=f.placement;if(!o&&!s&&(!c||h))return null;var g={placement:p||m(u)};return c&&(g.TransitionProps={in:s,onExited:this.handleExited}),d.default.createElement(b.default,{onRendered:this.handleOpen,disablePortal:r,container:n},d.default.createElement("div",(0,a.default)({role:"tooltip",style:{position:"absolute"}},l),"function"==typeof t?t(g):t))}}],[{key:"getDerivedStateFromProps",value:function(e){return e.open?{exited:!1}:e.transition?null:{exited:!0}}}]),t}(d.default.Component);v.defaultProps={disablePortal:!1,placement:"bottom",transition:!1};var y=v;t.default=y},60111(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return i.default}});var i=r(n(24693))},92261(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(56690)),a=r(n(89728)),o=r(n(94993)),s=r(n(73808)),u=r(n(61655)),c=r(n(67294)),l=r(n(73935));r(n(45697));var f=r(n(16143));function d(e,t){return e="function"==typeof e?e():e,l.default.findDOMNode(e)||t}function h(e){return(0,f.default)(l.default.findDOMNode(e))}n(55252);var p=function(e){function t(){(0,i.default)(this,t);for(var e,n,r=arguments.length,a=Array(r),u=0;u1;n.state.labelWrapped!==e&&n.setState({labelWrapped:e})}},n}return(0,c.default)(t,e),(0,o.default)(t,[{key:"componentDidMount",value:function(){this.checkTextWrap()}},{key:"componentDidUpdate",value:function(e,t){this.state.labelWrapped===t.labelWrapped&&this.checkTextWrap()}},{key:"render",value:function(){var e,t,n=this,r=this.props,a=r.classes,o=r.className,s=r.disabled,u=r.fullWidth,c=r.icon,p=r.indicator,g=r.label,v=(r.onChange,r.selected),y=r.textColor,w=(r.value,(0,i.default)(r,["classes","className","disabled","fullWidth","icon","indicator","label","onChange","selected","textColor","value"]));return void 0!==g&&(e=d.default.createElement("span",{className:a.labelContainer},d.default.createElement("span",{className:(0,h.default)(a.label,(0,l.default)({},a.labelWrapped,this.state.labelWrapped)),ref:function(e){n.labelRef=e}},g))),d.default.createElement(b.default,(0,f.default)({focusRipple:!0,className:(0,h.default)(a.root,a["textColor".concat((0,m.capitalize)(y))],(t={},(0,l.default)(t,a.disabled,s),(0,l.default)(t,a.selected,v),(0,l.default)(t,a.labelIcon,c&&e),(0,l.default)(t,a.fullWidth,u),t),o),role:"tab","aria-selected":v,disabled:s},w,{onClick:this.handleChange}),d.default.createElement("span",{className:a.wrapper},c,e),p)}}]),t}(d.default.Component);v.defaultProps={disabled:!1,textColor:"inherit"};var y=(0,p.default)(g,{name:"MuiTab"})(v);t.default=y},75759(e,t,n){"use strict";var r,i=n(64836);r={value:!0},Object.defineProperty(t,"Z",{enumerable:!0,get:function(){return a.default}});var a=i(n(70201))},7575(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.styles=void 0;var i=r(n(10434)),a=r(n(70215)),o=r(n(56690)),s=r(n(89728)),u=r(n(94993)),c=r(n(73808)),l=r(n(61655)),f=r(n(67294));r(n(45697));var d=r(n(94184));n(55252);var h=r(n(78252)),p=r(n(82577)),b=function(e){return{root:{display:"table",fontFamily:e.typography.fontFamily,width:"100%",borderCollapse:"collapse",borderSpacing:0}}};t.styles=b;var m=function(e){function t(){(0,o.default)(this,t);for(var e,n,r=arguments.length,i=Array(r),a=0;ai&&n(null,i)}},{key:"render",value:function(){var e,t=this.props,n=t.ActionsComponent,r=t.backIconButtonProps,o=t.classes,s=t.colSpan,u=t.component,c=t.count,l=t.labelDisplayedRows,d=t.labelRowsPerPage,y=t.nextIconButtonProps,w=t.onChangePage,_=t.onChangeRowsPerPage,E=t.page,S=t.rowsPerPage,k=t.rowsPerPageOptions,x=t.SelectProps,T=void 0===x?{}:x,M=(0,a.default)(t,["ActionsComponent","backIconButtonProps","classes","colSpan","component","count","labelDisplayedRows","labelRowsPerPage","nextIconButtonProps","onChangePage","onChangeRowsPerPage","page","rowsPerPage","rowsPerPageOptions","SelectProps"]);(u===m.default||"td"===u)&&(e=s||1e3);var O=T.native?"option":p.default;return f.default.createElement(u,(0,i.default)({className:o.root,colSpan:e},M),f.default.createElement(g.default,{className:o.toolbar},f.default.createElement("div",{className:o.spacer}),k.length>1&&f.default.createElement(v.default,{color:"inherit",variant:"caption",className:o.caption},d),k.length>1&&f.default.createElement(b.default,(0,i.default)({classes:{root:o.selectRoot,select:o.select,icon:o.selectIcon},input:f.default.createElement(h.default,{className:o.input}),value:S,onChange:_},T),k.map(function(e){return f.default.createElement(O,{className:o.menuItem,key:e,value:e},e)})),f.default.createElement(v.default,{color:"inherit",variant:"caption",className:o.caption},l({from:0===c?0:E*S+1,to:Math.min(c,(E+1)*S),count:c,page:E})),f.default.createElement(n,{className:o.actions,backIconButtonProps:r,count:c,nextIconButtonProps:y,onChangePage:w,page:E,rowsPerPage:S})))}}]),t}(f.default.Component);_.defaultProps={ActionsComponent:y.default,component:m.default,labelDisplayedRows:function(e){var t=e.from,n=e.to,r=e.count;return"".concat(t,"-").concat(n," of ").concat(r)},labelRowsPerPage:"Rows per page:",rowsPerPageOptions:[10,25,50,100]};var E=(0,d.default)(w,{name:"MuiTablePagination"})(_);t.default=E},32844(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(10434)),a=r(n(70215)),o=r(n(56690)),s=r(n(89728)),u=r(n(94993)),c=r(n(73808)),l=r(n(61655)),f=r(n(67294));r(n(45697));var d=r(n(86861)),h=r(n(43836)),p=r(n(82313)),b=r(n(81701)),m=f.default.createElement(h.default,null),g=f.default.createElement(d.default,null),v=f.default.createElement(d.default,null),y=f.default.createElement(h.default,null),w=function(e){function t(){(0,o.default)(this,t);for(var e,n,r=arguments.length,i=Array(r),a=0;a=Math.ceil(n/s)-1,color:"inherit"},r),"rtl"===u.direction?v:y))}}]),t}(f.default.Component),_=(0,p.default)()(w);t.default=_},18217(e,t,n){"use strict";var r,i=n(64836);r={value:!0},Object.defineProperty(t,"Z",{enumerable:!0,get:function(){return a.default}});var a=i(n(71744))},86424(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.styles=void 0;var i=r(n(10434)),a=r(n(38416)),o=r(n(70215)),s=r(n(67294));r(n(45697));var u=r(n(94184));n(55252);var c=r(n(78252)),l=r(n(27628)),f=function(e){return{root:{color:"inherit",display:"table-row",height:48,verticalAlign:"middle",outline:"none","&$selected":{backgroundColor:"light"===e.palette.type?"rgba(0, 0, 0, 0.04)":"rgba(255, 255, 255, 0.08)"},"&$hover:hover":{backgroundColor:"light"===e.palette.type?"rgba(0, 0, 0, 0.07)":"rgba(255, 255, 255, 0.14)"}},selected:{},hover:{},head:{height:56},footer:{height:56}}};function d(e){var t=e.classes,n=e.className,r=e.component,c=e.hover,f=e.selected,d=(0,o.default)(e,["classes","className","component","hover","selected"]);return s.default.createElement(l.default.Consumer,null,function(e){var o,l=(0,u.default)(t.root,(o={},(0,a.default)(o,t.head,e&&"head"===e.variant),(0,a.default)(o,t.footer,e&&"footer"===e.variant),(0,a.default)(o,t.hover,c),(0,a.default)(o,t.selected,f),o),n);return s.default.createElement(r,(0,i.default)({className:l},d))})}t.styles=f,d.defaultProps={component:"tr",hover:!1,selected:!1};var h=(0,c.default)(f,{name:"MuiTableRow"})(d);t.default=h},17175(e,t,n){"use strict";var r,i=n(64836);r={value:!0},Object.defineProperty(t,"Z",{enumerable:!0,get:function(){return a.default}});var a=i(n(86424))},28550(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(56690)),a=r(n(89728)),o=r(n(94993)),s=r(n(73808)),u=r(n(61655)),c=r(n(67294));r(n(45697));var l,f=r(n(96421)),d=r(n(20296)),h={width:90,height:90,position:"absolute",top:-9e3,overflow:"scroll",msOverflowStyle:"scrollbar"},p=function(e){function t(){var e;return(0,i.default)(this,t),(e=(0,o.default)(this,(0,s.default)(t).call(this))).handleRef=function(t){e.nodeRef=t},e.setMeasurements=function(){var t=e.nodeRef;t&&(e.scrollbarHeight=t.offsetHeight-t.clientHeight)},"undefined"!=typeof window&&(e.handleResize=(0,d.default)(function(){var t=e.scrollbarHeight;e.setMeasurements(),t!==e.scrollbarHeight&&e.props.onChange(e.scrollbarHeight)},166)),e}return(0,u.default)(t,e),(0,a.default)(t,[{key:"componentDidMount",value:function(){this.setMeasurements(),this.props.onChange(this.scrollbarHeight)}},{key:"componentWillUnmount",value:function(){this.handleResize.clear()}},{key:"render",value:function(){return c.default.createElement(c.default.Fragment,null,c.default.createElement(f.default,{target:"window",onResize:this.handleResize}),c.default.createElement("div",{style:h,ref:this.handleRef}))}}]),t}(c.default.Component);t.default=p},12417(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.styles=void 0;var i=r(n(10434)),a=r(n(70215)),o=r(n(67294));r(n(45697));var s=r(n(94184)),u=r(n(78252)),c=n(98741),l=function(e){return{root:{position:"absolute",height:2,bottom:0,width:"100%",transition:e.transitions.create()},colorPrimary:{backgroundColor:e.palette.primary.main},colorSecondary:{backgroundColor:e.palette.secondary.main}}};function f(e){var t=e.classes,n=e.className,r=e.color,u=(0,a.default)(e,["classes","className","color"]);return o.default.createElement("span",(0,i.default)({className:(0,s.default)(t.root,t["color".concat((0,c.capitalize)(r))],n)},u))}t.styles=l;var d=(0,u.default)(l,{name:"MuiPrivateTabIndicator"})(f);t.default=d},69583(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.styles=void 0;var i=r(n(10434)),a=r(n(70215)),o=r(n(67294));r(n(45697));var s=r(n(94184)),u=r(n(86861)),c=r(n(43836)),l=r(n(78252)),f=r(n(16070)),d={root:{color:"inherit",width:56,flexShrink:0}};t.styles=d;var h=o.default.createElement(u.default,null),p=o.default.createElement(c.default,null);function b(e){var t=e.classes,n=e.className,r=e.direction,u=e.onClick,c=e.visible,l=(0,a.default)(e,["classes","className","direction","onClick","visible"]),d=(0,s.default)(t.root,n);return c?o.default.createElement(f.default,(0,i.default)({className:d,onClick:u,tabIndex:-1},l),"left"===r?h:p):o.default.createElement("div",{className:d})}b.defaultProps={visible:!0};var m=(0,l.default)(d,{name:"MuiPrivateTabScrollButton"})(b);t.default=m},89172(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.styles=void 0;var i=r(n(10434)),a=r(n(70215)),o=r(n(56690)),s=r(n(89728)),u=r(n(94993)),c=r(n(73808)),l=r(n(61655)),f=r(n(38416)),d=r(n(67294));r(n(45697)),r(n(42473));var h=r(n(94184)),p=r(n(96421)),b=r(n(20296)),m=n(46417);n(55252);var g=r(n(13329)),v=r(n(28550)),y=r(n(78252)),w=r(n(12417)),_=r(n(69583));r(n(346));var E=function(e){return{root:{overflow:"hidden",minHeight:48,WebkitOverflowScrolling:"touch"},flexContainer:{display:"flex"},centered:{justifyContent:"center"},scroller:{position:"relative",display:"inline-block",flex:"1 1 auto",whiteSpace:"nowrap"},fixed:{overflowX:"hidden",width:"100%"},scrollable:{overflowX:"scroll"},scrollButtons:{},scrollButtonsAuto:(0,f.default)({},e.breakpoints.down("xs"),{display:"none"}),indicator:{}}};t.styles=E;var S=function(e){function t(){var e;return(0,o.default)(this,t),(e=(0,u.default)(this,(0,c.default)(t).call(this))).state={indicatorStyle:{},scrollerStyle:{marginBottom:0},showLeftScroll:!1,showRightScroll:!1,mounted:!1},e.getConditionalElements=function(){var t=e.props,n=t.classes,r=t.scrollable,i=t.ScrollButtonComponent,a=t.scrollButtons,o=t.theme,s=t.variant,u={},c="scrollable"===s||r;u.scrollbarSizeListener=c?d.default.createElement(v.default,{onChange:e.handleScrollbarSizeChange}):null;var l=c&&("auto"===a||"on"===a);return u.scrollButtonLeft=l?d.default.createElement(i,{direction:o&&"rtl"===o.direction?"right":"left",onClick:e.handleLeftScrollClick,visible:e.state.showLeftScroll,className:(0,h.default)(n.scrollButtons,(0,f.default)({},n.scrollButtonsAuto,"auto"===a))}):null,u.scrollButtonRight=l?d.default.createElement(i,{direction:o&&"rtl"===o.direction?"left":"right",onClick:e.handleRightScrollClick,visible:e.state.showRightScroll,className:(0,h.default)(n.scrollButtons,(0,f.default)({},n.scrollButtonsAuto,"auto"===a))}):null,u},e.getTabsMeta=function(t,n){if(e.tabsRef){var r,i,a=e.tabsRef.getBoundingClientRect();r={clientWidth:e.tabsRef.clientWidth,scrollLeft:e.tabsRef.scrollLeft,scrollLeftNormalized:(0,m.getNormalizedScrollLeft)(e.tabsRef,n),scrollWidth:e.tabsRef.scrollWidth,left:a.left,right:a.right}}if(e.tabsRef&&!1!==t){var o=e.tabsRef.children[0].children;if(o.length>0){var s=o[e.valueToIndex.get(t)];i=s?s.getBoundingClientRect():null}}return{tabsMeta:r,tabMeta:i}},e.handleLeftScrollClick=function(){e.moveTabsScroll(-e.tabsRef.clientWidth)},e.handleRightScrollClick=function(){e.moveTabsScroll(e.tabsRef.clientWidth)},e.handleScrollbarSizeChange=function(t){e.setState({scrollerStyle:{marginBottom:-t}})},e.moveTabsScroll=function(t){var n=e.props.theme,r="rtl"===n.direction?-1:1,i=e.tabsRef.scrollLeft+t*r,a="rtl"===n.direction&&"reverse"===(0,m.detectScrollType)()?-1:1;e.scroll(a*i)},e.scrollSelectedIntoView=function(){var t=e.props,n=t.theme,r=t.value,i=e.getTabsMeta(r,n.direction),a=i.tabsMeta,o=i.tabMeta;if(o&&a){if(o.lefta.right){var u=a.scrollLeft+(o.right-a.right);e.scroll(u)}}},e.scroll=function(t){(0,g.default)("scrollLeft",e.tabsRef,t)},e.updateScrollButtonState=function(){var t=e.props,n=t.scrollable,r=t.scrollButtons,i=t.theme;if(("scrollable"===t.variant||n)&&"off"!==r){var a=e.tabsRef,o=a.scrollWidth,s=a.clientWidth,u=(0,m.getNormalizedScrollLeft)(e.tabsRef,i.direction),c="rtl"===i.direction?o>s+u:u>0,l="rtl"===i.direction?u>0:o>s+u;(c!==e.state.showLeftScroll||l!==e.state.showRightScroll)&&e.setState({showLeftScroll:c,showRightScroll:l})}},"undefined"!=typeof window&&(e.handleResize=(0,b.default)(function(){e.updateIndicatorState(e.props),e.updateScrollButtonState()},166),e.handleTabsScroll=(0,b.default)(function(){e.updateScrollButtonState()},166)),e}return(0,l.default)(t,e),(0,s.default)(t,[{key:"componentDidMount",value:function(){this.setState({mounted:!0}),this.updateIndicatorState(this.props),this.updateScrollButtonState(),this.props.action&&this.props.action({updateIndicator:this.handleResize})}},{key:"componentDidUpdate",value:function(e,t){this.updateIndicatorState(this.props),this.updateScrollButtonState(),this.state.indicatorStyle!==t.indicatorStyle&&this.scrollSelectedIntoView()}},{key:"componentWillUnmount",value:function(){this.handleResize.clear(),this.handleTabsScroll.clear()}},{key:"updateIndicatorState",value:function(e){var t=e.theme,n=e.value,r=this.getTabsMeta(n,t.direction),i=r.tabsMeta,a=r.tabMeta,o=0;if(a&&i){var s="rtl"===t.direction?i.scrollLeftNormalized+i.clientWidth-i.scrollWidth:i.scrollLeft;o=Math.round(a.left-i.left+s)}var u={left:o,width:a?Math.round(a.width):0};u.left===this.state.indicatorStyle.left&&u.width===this.state.indicatorStyle.width||isNaN(u.left)||isNaN(u.width)||this.setState({indicatorStyle:u})}},{key:"render",value:function(){var e,t=this,n=this.props,r=(n.action,n.centered),o=n.children,s=n.classes,u=n.className,c=n.component,l=n.fullWidth,b=void 0!==l&&l,m=n.indicatorColor,g=n.onChange,v=n.scrollable,y=void 0!==v&&v,_=(n.ScrollButtonComponent,n.scrollButtons,n.TabIndicatorProps),E=void 0===_?{}:_,S=n.textColor,k=(n.theme,n.value),x=n.variant,T=(0,a.default)(n,["action","centered","children","classes","className","component","fullWidth","indicatorColor","onChange","scrollable","ScrollButtonComponent","scrollButtons","TabIndicatorProps","textColor","theme","value","variant"]),M="scrollable"===x||y,O=(0,h.default)(s.root,u),A=(0,h.default)(s.flexContainer,(0,f.default)({},s.centered,r&&!M)),L=(0,h.default)(s.scroller,(e={},(0,f.default)(e,s.fixed,!M),(0,f.default)(e,s.scrollable,M),e)),C=d.default.createElement(w.default,(0,i.default)({className:s.indicator,color:m},E,{style:(0,i.default)({},this.state.indicatorStyle,E.style)}));this.valueToIndex=new Map;var I=0,D=d.default.Children.map(o,function(e){if(!d.default.isValidElement(e))return null;var n=void 0===e.props.value?I:e.props.value;t.valueToIndex.set(n,I);var r=n===k;return I+=1,d.default.cloneElement(e,{fullWidth:"fullWidth"===x||b,indicator:r&&!t.state.mounted&&C,selected:r,onChange:g,textColor:S,value:n})}),N=this.getConditionalElements();return d.default.createElement(c,(0,i.default)({className:O},T),d.default.createElement(p.default,{target:"window",onResize:this.handleResize}),N.scrollbarSizeListener,d.default.createElement("div",{className:s.flexContainer},N.scrollButtonLeft,d.default.createElement("div",{className:L,style:this.state.scrollerStyle,ref:function(e){t.tabsRef=e},role:"tablist",onScroll:this.handleTabsScroll},d.default.createElement("div",{className:A},D),this.state.mounted&&C),N.scrollButtonRight))}}]),t}(d.default.Component);S.defaultProps={centered:!1,component:"div",indicatorColor:"secondary",ScrollButtonComponent:_.default,scrollButtons:"auto",textColor:"inherit",variant:"standard"};var k=(0,y.default)(E,{name:"MuiTabs",withTheme:!0})(S);t.default=k},12794(e,t,n){"use strict";var r,i=n(64836);r={value:!0},Object.defineProperty(t,"Z",{enumerable:!0,get:function(){return a.default}});var a=i(n(89172))},78592(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(10434)),a=r(n(70215)),o=r(n(56690)),s=r(n(89728)),u=r(n(94993)),c=r(n(73808)),l=r(n(61655)),f=r(n(67294)),d=r(n(73935));r(n(42473)),r(n(45697));var h=r(n(54846)),p=r(n(1402)),b=r(n(59537)),m=r(n(23153)),g=r(n(85461)),v=r(n(76023)),y=r(n(11970)),w={standard:h.default,filled:p.default,outlined:b.default},_=function(e){function t(e){var n;return(0,o.default)(this,t),(n=(0,u.default)(this,(0,c.default)(t).call(this,e))).labelRef=f.default.createRef(),n}return(0,l.default)(t,e),(0,s.default)(t,[{key:"componentDidMount",value:function(){"outlined"===this.props.variant&&(this.labelNode=d.default.findDOMNode(this.labelRef.current),this.forceUpdate())}},{key:"render",value:function(){var e=this.props,t=e.autoComplete,n=e.autoFocus,r=e.children,o=e.className,s=e.defaultValue,u=e.error,c=e.FormHelperTextProps,l=e.fullWidth,d=e.helperText,h=e.id,p=e.InputLabelProps,b=e.inputProps,_=e.InputProps,E=e.inputRef,S=e.label,k=e.multiline,x=e.name,T=e.onBlur,M=e.onChange,O=e.onFocus,A=e.placeholder,L=e.required,C=e.rows,I=e.rowsMax,D=e.select,N=e.SelectProps,P=e.type,R=e.value,j=e.variant,F=(0,a.default)(e,["autoComplete","autoFocus","children","className","defaultValue","error","FormHelperTextProps","fullWidth","helperText","id","InputLabelProps","inputProps","InputProps","inputRef","label","multiline","name","onBlur","onChange","onFocus","placeholder","required","rows","rowsMax","select","SelectProps","type","value","variant"]),Y={};"outlined"===j&&(p&&void 0!==p.shrink&&(Y.notched=p.shrink),Y.labelWidth=this.labelNode&&this.labelNode.offsetWidth||0);var B=d&&h?"".concat(h,"-helper-text"):void 0,U=w[j],H=f.default.createElement(U,(0,i.default)({"aria-describedby":B,autoComplete:t,autoFocus:n,defaultValue:s,fullWidth:l,multiline:k,name:x,rows:C,rowsMax:I,type:P,value:R,id:h,inputRef:E,onBlur:T,onChange:M,onFocus:O,placeholder:A,inputProps:b},Y,_));return f.default.createElement(g.default,(0,i.default)({className:o,error:u,fullWidth:l,required:L,variant:j},F),S&&f.default.createElement(m.default,(0,i.default)({htmlFor:h,ref:this.labelRef},p),S),D?f.default.createElement(y.default,(0,i.default)({"aria-describedby":B,value:R,input:H},N),r):H,d&&f.default.createElement(v.default,(0,i.default)({id:B},c),d))}}]),t}(f.default.Component);_.defaultProps={required:!1,select:!1,variant:"standard"};var E=_;t.default=E},60520(e,t,n){"use strict";var r,i=n(64836);r={value:!0},Object.defineProperty(t,"Z",{enumerable:!0,get:function(){return a.default}});var a=i(n(78592))},48596(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.styles=void 0;var i=r(n(10434)),a=r(n(38416)),o=r(n(70215)),s=r(n(67294));r(n(45697));var u=r(n(94184)),c=r(n(78252)),l=function(e){return{root:{position:"relative",display:"flex",alignItems:"center"},gutters:e.mixins.gutters(),regular:e.mixins.toolbar,dense:{minHeight:48}}};function f(e){var t=e.children,n=e.classes,r=e.className,c=e.disableGutters,l=e.variant,f=(0,o.default)(e,["children","classes","className","disableGutters","variant"]),d=(0,u.default)(n.root,n[l],(0,a.default)({},n.gutters,!c),r);return s.default.createElement("div",(0,i.default)({className:d},f),t)}t.styles=l,f.defaultProps={disableGutters:!1,variant:"regular"};var d=(0,c.default)(l,{name:"MuiToolbar"})(f);t.default=d},28902(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return i.default}});var i=r(n(48596))},83065(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.styles=void 0;var i=r(n(10434)),a=r(n(70215)),o=r(n(56690)),s=r(n(89728)),u=r(n(94993)),c=r(n(73808)),l=r(n(61655)),f=r(n(38416)),d=r(n(67294));r(n(45697)),r(n(42473));var h=r(n(94184));n(55252);var p=r(n(39737)),b=r(n(78252)),m=n(98741),g=r(n(261)),v=r(n(60111)),y=function(e){return{popper:{zIndex:e.zIndex.tooltip,opacity:.9,pointerEvents:"none"},popperInteractive:{pointerEvents:"auto"},tooltip:{backgroundColor:e.palette.grey[700],borderRadius:e.shape.borderRadius,color:e.palette.common.white,fontFamily:e.typography.fontFamily,padding:"4px 8px",fontSize:e.typography.pxToRem(10),lineHeight:"".concat(e.typography.round(1.4),"em"),maxWidth:300},touch:{padding:"8px 16px",fontSize:e.typography.pxToRem(14),lineHeight:"".concat(e.typography.round(16/14),"em")},tooltipPlacementLeft:(0,f.default)({transformOrigin:"right center",margin:"0 24px "},e.breakpoints.up("sm"),{margin:"0 14px"}),tooltipPlacementRight:(0,f.default)({transformOrigin:"left center",margin:"0 24px"},e.breakpoints.up("sm"),{margin:"0 14px"}),tooltipPlacementTop:(0,f.default)({transformOrigin:"center bottom",margin:"24px 0"},e.breakpoints.up("sm"),{margin:"14px 0"}),tooltipPlacementBottom:(0,f.default)({transformOrigin:"center top",margin:"24px 0"},e.breakpoints.up("sm"),{margin:"14px 0"})}};t.styles=y;var w=function(e){function t(e){var n;return(0,o.default)(this,t),(n=(0,u.default)(this,(0,c.default)(t).call(this))).ignoreNonTouchEvents=!1,n.onRootRef=function(e){n.childrenRef=e},n.handleFocus=function(e){n.childrenRef||(n.childrenRef=e.currentTarget),n.handleEnter(e);var t=n.props.children.props;t.onFocus&&t.onFocus(e)},n.handleEnter=function(e){var t=n.props,r=t.children,i=t.enterDelay,a=r.props;"mouseover"===e.type&&a.onMouseOver&&a.onMouseOver(e),(!n.ignoreNonTouchEvents||"touchstart"===e.type)&&(n.childrenRef.setAttribute("title",""),clearTimeout(n.enterTimer),clearTimeout(n.leaveTimer),i?(e.persist(),n.enterTimer=setTimeout(function(){n.handleOpen(e)},i)):n.handleOpen(e))},n.handleOpen=function(e){n.isControlled||n.state.open||n.setState({open:!0}),n.props.onOpen&&n.props.onOpen(e)},n.handleLeave=function(e){var t=n.props,r=t.children,i=t.leaveDelay,a=r.props;"blur"===e.type&&a.onBlur&&a.onBlur(e),"mouseleave"===e.type&&a.onMouseLeave&&a.onMouseLeave(e),clearTimeout(n.enterTimer),clearTimeout(n.leaveTimer),i?(e.persist(),n.leaveTimer=setTimeout(function(){n.handleClose(e)},i)):n.handleClose(e)},n.handleClose=function(e){n.isControlled||n.setState({open:!1}),n.props.onClose&&n.props.onClose(e),clearTimeout(n.closeTimer),n.closeTimer=setTimeout(function(){n.ignoreNonTouchEvents=!1},n.props.theme.transitions.duration.shortest)},n.handleTouchStart=function(e){n.ignoreNonTouchEvents=!0;var t=n.props,r=t.children,i=t.enterTouchDelay;r.props.onTouchStart&&r.props.onTouchStart(e),clearTimeout(n.leaveTimer),clearTimeout(n.closeTimer),clearTimeout(n.touchTimer),e.persist(),n.touchTimer=setTimeout(function(){n.handleEnter(e)},i)},n.handleTouchEnd=function(e){var t=n.props,r=t.children,i=t.leaveTouchDelay;r.props.onTouchEnd&&r.props.onTouchEnd(e),clearTimeout(n.touchTimer),clearTimeout(n.leaveTimer),e.persist(),n.leaveTimer=setTimeout(function(){n.handleClose(e)},i)},n.isControlled=null!=e.open,n.state={open:null},n.isControlled||(n.state.open=!1),n}return(0,l.default)(t,e),(0,s.default)(t,[{key:"componentDidMount",value:function(){this.defaultId="mui-tooltip-".concat(Math.round(1e5*Math.random())),this.props.open&&this.forceUpdate()}},{key:"componentWillUnmount",value:function(){clearTimeout(this.closeTimer),clearTimeout(this.enterTimer),clearTimeout(this.focusTimer),clearTimeout(this.leaveTimer),clearTimeout(this.touchTimer)}},{key:"render",value:function(){var e=this,t=this.props,n=t.children,r=t.classes,o=t.disableFocusListener,s=t.disableHoverListener,u=t.disableTouchListener,c=(t.enterDelay,t.enterTouchDelay,t.id),l=t.interactive,b=(t.leaveDelay,t.leaveTouchDelay,t.onClose,t.onOpen,t.open),g=t.placement,y=t.PopperProps,w=t.theme,_=t.title,E=t.TransitionComponent,S=t.TransitionProps,k=(0,a.default)(t,["children","classes","disableFocusListener","disableHoverListener","disableTouchListener","enterDelay","enterTouchDelay","id","interactive","leaveDelay","leaveTouchDelay","onClose","onOpen","open","placement","PopperProps","theme","title","TransitionComponent","TransitionProps"]),x=this.isControlled?b:this.state.open;""===_&&(x=!1);var T=!x&&!s,M=(0,i.default)({"aria-describedby":x?c||this.defaultId:null,title:T&&"string"==typeof _?_:null},k,n.props,{className:(0,h.default)(k.className,n.props.className)});u||(M.onTouchStart=this.handleTouchStart,M.onTouchEnd=this.handleTouchEnd),s||(M.onMouseOver=this.handleEnter,M.onMouseLeave=this.handleLeave),o||(M.onFocus=this.handleFocus,M.onBlur=this.handleLeave);var O=l?{onMouseOver:M.onMouseOver,onMouseLeave:M.onMouseLeave,onFocus:M.onFocus,onBlur:M.onBlur}:{};return d.default.createElement(d.default.Fragment,null,d.default.createElement(p.default,{rootRef:this.onRootRef},d.default.cloneElement(n,M)),d.default.createElement(v.default,(0,i.default)({className:(0,h.default)(r.popper,(0,f.default)({},r.popperInteractive,l)),placement:g,anchorEl:this.childrenRef,open:x,id:M["aria-describedby"],transition:!0},O,y),function(t){var n=t.placement,a=t.TransitionProps;return d.default.createElement(E,(0,i.default)({timeout:w.transitions.duration.shorter},a,S),d.default.createElement("div",{className:(0,h.default)(r.tooltip,(0,f.default)({},r.touch,e.ignoreNonTouchEvents),r["tooltipPlacement".concat((0,m.capitalize)(n.split("-")[0]))])},_))}))}}]),t}(d.default.Component);w.defaultProps={disableFocusListener:!1,disableHoverListener:!1,disableTouchListener:!1,enterDelay:0,enterTouchDelay:1e3,interactive:!1,leaveDelay:0,leaveTouchDelay:1500,placement:"bottom",TransitionComponent:g.default};var _=(0,b.default)(y,{name:"MuiTooltip",withTheme:!0})(w);t.default=_},31657(e,t,n){"use strict";var r,i=n(64836);r={value:!0},Object.defineProperty(t,"Z",{enumerable:!0,get:function(){return a.default}});var a=i(n(83065))},49476(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.styles=void 0;var i=r(n(10434)),a=r(n(38416)),o=r(n(70215)),s=r(n(67294));r(n(45697));var u=r(n(94184));n(55252);var c=r(n(78252)),l=n(98741),f=function(e){return{root:{display:"block",margin:0},display4:e.typography.display4,display3:e.typography.display3,display2:e.typography.display2,display1:e.typography.display1,headline:e.typography.headline,title:e.typography.title,subheading:e.typography.subheading,body2:e.typography.body2,body1:e.typography.body1,caption:e.typography.caption,button:e.typography.button,h1:e.typography.h1,h2:e.typography.h2,h3:e.typography.h3,h4:e.typography.h4,h5:e.typography.h5,h6:e.typography.h6,subtitle1:e.typography.subtitle1,subtitle2:e.typography.subtitle2,overline:e.typography.overline,srOnly:{position:"absolute",height:1,width:1,overflow:"hidden"},alignLeft:{textAlign:"left"},alignCenter:{textAlign:"center"},alignRight:{textAlign:"right"},alignJustify:{textAlign:"justify"},noWrap:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},gutterBottom:{marginBottom:"0.35em"},paragraph:{marginBottom:16},colorInherit:{color:"inherit"},colorPrimary:{color:e.palette.primary.main},colorSecondary:{color:e.palette.secondary.main},colorTextPrimary:{color:e.palette.text.primary},colorTextSecondary:{color:e.palette.text.secondary},colorError:{color:e.palette.error.main},inline:{display:"inline"}}};t.styles=f;var d={display4:"h1",display3:"h2",display2:"h3",display1:"h4",headline:"h5",title:"h6",subheading:"subtitle1"};function h(e,t){var n=e.typography,r=t;return r||(r=n.useNextVariants?"body2":"body1"),n.useNextVariants&&(r=d[r]||r),r}var p={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p",display4:"h1",display3:"h1",display2:"h1",display1:"h1",headline:"h1",title:"h2",subheading:"h3"};function b(e){var t,n=e.align,r=e.classes,c=e.className,f=e.color,d=e.component,b=e.gutterBottom,m=e.headlineMapping,g=e.inline,v=(e.internalDeprecatedVariant,e.noWrap),y=e.paragraph,w=e.theme,_=e.variant,E=(0,o.default)(e,["align","classes","className","color","component","gutterBottom","headlineMapping","inline","internalDeprecatedVariant","noWrap","paragraph","theme","variant"]),S=h(w,_),k=(0,u.default)(r.root,(t={},(0,a.default)(t,r[S],"inherit"!==S),(0,a.default)(t,r["color".concat((0,l.capitalize)(f))],"default"!==f),(0,a.default)(t,r.noWrap,v),(0,a.default)(t,r.gutterBottom,b),(0,a.default)(t,r.paragraph,y),(0,a.default)(t,r["align".concat((0,l.capitalize)(n))],"inherit"!==n),(0,a.default)(t,r.inline,g),t),c),x=d||(y?"p":m[S]||p[S])||"span";return s.default.createElement(x,(0,i.default)({className:k},E))}b.defaultProps={align:"inherit",color:"default",gutterBottom:!1,headlineMapping:p,inline:!1,noWrap:!1,paragraph:!1};var m=(0,c.default)(f,{name:"MuiTypography",withTheme:!0})(b);t.default=m},71426(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return i.default}});var i=r(n(49476))},8070(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n={50:"#fff8e1",100:"#ffecb3",200:"#ffe082",300:"#ffd54f",400:"#ffca28",500:"#ffc107",600:"#ffb300",700:"#ffa000",800:"#ff8f00",900:"#ff6f00",A100:"#ffe57f",A200:"#ffd740",A400:"#ffc400",A700:"#ffab00"};t.default=n},63259(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n={50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",A100:"#82b1ff",A200:"#448aff",A400:"#2979ff",A700:"#2962ff"};t.default=n},38236(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n={50:"#eceff1",100:"#cfd8dc",200:"#b0bec5",300:"#90a4ae",400:"#78909c",500:"#607d8b",600:"#546e7a",700:"#455a64",800:"#37474f",900:"#263238",A100:"#cfd8dc",A200:"#b0bec5",A400:"#78909c",A700:"#455a64"};t.default=n},60169(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n={50:"#efebe9",100:"#d7ccc8",200:"#bcaaa4",300:"#a1887f",400:"#8d6e63",500:"#795548",600:"#6d4c41",700:"#5d4037",800:"#4e342e",900:"#3e2723",A100:"#d7ccc8",A200:"#bcaaa4",A400:"#8d6e63",A700:"#5d4037"};t.default=n},515(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n={black:"#000",white:"#fff"};t.default=n},57646(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n={50:"#e0f7fa",100:"#b2ebf2",200:"#80deea",300:"#4dd0e1",400:"#26c6da",500:"#00bcd4",600:"#00acc1",700:"#0097a7",800:"#00838f",900:"#006064",A100:"#84ffff",A200:"#18ffff",A400:"#00e5ff",A700:"#00b8d4"};t.default=n},50173(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n={50:"#fbe9e7",100:"#ffccbc",200:"#ffab91",300:"#ff8a65",400:"#ff7043",500:"#ff5722",600:"#f4511e",700:"#e64a19",800:"#d84315",900:"#bf360c",A100:"#ff9e80",A200:"#ff6e40",A400:"#ff3d00",A700:"#dd2c00"};t.default=n},45018(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n={50:"#ede7f6",100:"#d1c4e9",200:"#b39ddb",300:"#9575cd",400:"#7e57c2",500:"#673ab7",600:"#5e35b1",700:"#512da8",800:"#4527a0",900:"#311b92",A100:"#b388ff",A200:"#7c4dff",A400:"#651fff",A700:"#6200ea"};t.default=n},47559(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",A100:"#b9f6ca",A200:"#69f0ae",A400:"#00e676",A700:"#00c853"};t.default=n},70167(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#d5d5d5",A200:"#aaaaaa",A400:"#303030",A700:"#616161"};t.default=n},19350(e,t,n){"use strict";var r,i=n(64836);r={value:!0},Object.defineProperty(t,"y0",{enumerable:!0,get:function(){return a.default}}),r={enumerable:!0,get:function(){return o.default}},r={enumerable:!0,get:function(){return s.default}},r={enumerable:!0,get:function(){return u.default}},r={enumerable:!0,get:function(){return c.default}},r={enumerable:!0,get:function(){return l.default}},r={enumerable:!0,get:function(){return f.default}},r={enumerable:!0,get:function(){return d.default}},r={enumerable:!0,get:function(){return h.default}},r={enumerable:!0,get:function(){return p.default}},Object.defineProperty(t,"ek",{enumerable:!0,get:function(){return b.default}}),r={enumerable:!0,get:function(){return m.default}},r={enumerable:!0,get:function(){return g.default}},r={enumerable:!0,get:function(){return v.default}},r={enumerable:!0,get:function(){return y.default}},r={enumerable:!0,get:function(){return w.default}},r={enumerable:!0,get:function(){return _.default}},r={enumerable:!0,get:function(){return E.default}},Object.defineProperty(t,"BA",{enumerable:!0,get:function(){return S.default}}),r={enumerable:!0,get:function(){return k.default}};var a=i(n(515)),o=i(n(83165)),s=i(n(124)),u=i(n(18118)),c=i(n(45018)),l=i(n(78768)),f=i(n(63259)),d=i(n(4923)),h=i(n(57646)),p=i(n(91605)),b=i(n(47559)),m=i(n(40192)),g=i(n(98567)),v=i(n(74578)),y=i(n(8070)),w=i(n(36594)),_=i(n(50173)),E=i(n(60169)),S=i(n(70167)),k=i(n(38236))},78768(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n={50:"#e8eaf6",100:"#c5cae9",200:"#9fa8da",300:"#7986cb",400:"#5c6bc0",500:"#3f51b5",600:"#3949ab",700:"#303f9f",800:"#283593",900:"#1a237e",A100:"#8c9eff",A200:"#536dfe",A400:"#3d5afe",A700:"#304ffe"};t.default=n},4923(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n={50:"#e1f5fe",100:"#b3e5fc",200:"#81d4fa",300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",600:"#039be5",700:"#0288d1",800:"#0277bd",900:"#01579b",A100:"#80d8ff",A200:"#40c4ff",A400:"#00b0ff",A700:"#0091ea"};t.default=n},40192(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n={50:"#f1f8e9",100:"#dcedc8",200:"#c5e1a5",300:"#aed581",400:"#9ccc65",500:"#8bc34a",600:"#7cb342",700:"#689f38",800:"#558b2f",900:"#33691e",A100:"#ccff90",A200:"#b2ff59",A400:"#76ff03",A700:"#64dd17"};t.default=n},98567(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n={50:"#f9fbe7",100:"#f0f4c3",200:"#e6ee9c",300:"#dce775",400:"#d4e157",500:"#cddc39",600:"#c0ca33",700:"#afb42b",800:"#9e9d24",900:"#827717",A100:"#f4ff81",A200:"#eeff41",A400:"#c6ff00",A700:"#aeea00"};t.default=n},36594(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n={50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",A100:"#ffd180",A200:"#ffab40",A400:"#ff9100",A700:"#ff6d00"};t.default=n},124(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n={50:"#fce4ec",100:"#f8bbd0",200:"#f48fb1",300:"#f06292",400:"#ec407a",500:"#e91e63",600:"#d81b60",700:"#c2185b",800:"#ad1457",900:"#880e4f",A100:"#ff80ab",A200:"#ff4081",A400:"#f50057",A700:"#c51162"};t.default=n},18118(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n={50:"#f3e5f5",100:"#e1bee7",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",600:"#8e24aa",700:"#7b1fa2",800:"#6a1b9a",900:"#4a148c",A100:"#ea80fc",A200:"#e040fb",A400:"#d500f9",A700:"#aa00ff"};t.default=n},83165(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",A100:"#ff8a80",A200:"#ff5252",A400:"#ff1744",A700:"#d50000"};t.default=n},91605(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n={50:"#e0f2f1",100:"#b2dfdb",200:"#80cbc4",300:"#4db6ac",400:"#26a69a",500:"#009688",600:"#00897b",700:"#00796b",800:"#00695c",900:"#004d40",A100:"#a7ffeb",A200:"#64ffda",A400:"#1de9b6",A700:"#00bfa5"};t.default=n},74578(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n={50:"#fffde7",100:"#fff9c4",200:"#fff59d",300:"#fff176",400:"#ffee58",500:"#ffeb3b",600:"#fdd835",700:"#fbc02d",800:"#f9a825",900:"#f57f17",A100:"#ffff8d",A200:"#ffff00",A400:"#ffea00",A700:"#ffd600"};t.default=n},85609(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.styles=void 0;var i=r(n(10434)),a=r(n(38416)),o=r(n(70215)),s=r(n(56690)),u=r(n(89728)),c=r(n(94993)),l=r(n(73808)),f=r(n(61655)),d=r(n(67294));r(n(45697));var h=r(n(94184)),p=r(n(52598)),b=r(n(78252)),m=r(n(81701)),g={root:{display:"inline-flex",alignItems:"center",transition:"none","&:hover":{backgroundColor:"transparent"}},checked:{},disabled:{},input:{cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0}};t.styles=g;var v=function(e){function t(e){var n;return(0,s.default)(this,t),(n=(0,c.default)(this,(0,l.default)(t).call(this))).handleFocus=function(e){n.props.onFocus&&n.props.onFocus(e);var t=n.props.muiFormControl;t&&t.onFocus&&t.onFocus(e)},n.handleBlur=function(e){n.props.onBlur&&n.props.onBlur(e);var t=n.props.muiFormControl;t&&t.onBlur&&t.onBlur(e)},n.handleInputChange=function(e){var t=e.target.checked;n.isControlled||n.setState({checked:t}),n.props.onChange&&n.props.onChange(e,t)},n.isControlled=null!=e.checked,n.state={},n.isControlled||(n.state.checked=void 0!==e.defaultChecked&&e.defaultChecked),n}return(0,f.default)(t,e),(0,u.default)(t,[{key:"render",value:function(){var e,t=this.props,n=t.autoFocus,r=t.checked,s=t.checkedIcon,u=t.classes,c=t.className,l=t.defaultChecked,f=t.disabled,p=t.icon,b=t.id,g=t.inputProps,v=t.inputRef,y=t.muiFormControl,w=t.name,_=(t.onBlur,t.onChange,t.onFocus,t.readOnly),E=t.required,S=t.tabIndex,k=t.type,x=t.value,T=(0,o.default)(t,["autoFocus","checked","checkedIcon","classes","className","defaultChecked","disabled","icon","id","inputProps","inputRef","muiFormControl","name","onBlur","onChange","onFocus","readOnly","required","tabIndex","type","value"]),M=f;y&&void 0===M&&(M=y.disabled);var O=this.isControlled?r:this.state.checked,A="checkbox"===k||"radio"===k;return d.default.createElement(m.default,(0,i.default)({component:"span",className:(0,h.default)(u.root,(e={},(0,a.default)(e,u.checked,O),(0,a.default)(e,u.disabled,M),e),c),disabled:M,tabIndex:null,role:void 0,onFocus:this.handleFocus,onBlur:this.handleBlur},T),O?s:p,d.default.createElement("input",(0,i.default)({autoFocus:n,checked:r,defaultChecked:l,className:u.input,disabled:M,id:A&&b,name:w,onChange:this.handleInputChange,readOnly:_,ref:v,required:E,tabIndex:S,type:k,value:x},g)))}}]),t}(d.default.Component),y=(0,b.default)(g,{name:"MuiPrivateSwitchBase"})((0,p.default)(v));t.default=y},13329(e,t){"use strict";function n(e){return(1+Math.sin(Math.PI*e-Math.PI/2))/2}function r(e,t,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:function(){},o=i.ease,s=void 0===o?n:o,u=i.duration,c=void 0===u?300:u,l=null,f=t[e],d=!1,h=function(){d=!0},p=function n(i){if(d){a(Error("Animation cancelled"));return}null===l&&(l=i);var o=Math.min(1,(i-l)/c);if(t[e]=s(o)*(r-f)+f,o>=1){requestAnimationFrame(function(){a(null)});return}requestAnimationFrame(n)};return f===r?(a(Error("Element already at target position")),h):(requestAnimationFrame(p),h)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r;t.default=i},74622(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(67294)),a=r(n(46949)),o=r(n(40577)),s=i.default.createElement("path",{d:"M7 10l5 5 5-5z"}),u=function(e){return i.default.createElement(o.default,e,s)};(u=(0,a.default)(u)).muiName="SvgIcon";var c=u;t.default=c},99781(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(67294)),a=r(n(46949)),o=r(n(40577)),s=i.default.createElement("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}),u=function(e){return i.default.createElement(o.default,e,s)};(u=(0,a.default)(u)).muiName="SvgIcon";var c=u;t.default=c},41549(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(67294)),a=r(n(46949)),o=r(n(40577)),s=i.default.createElement("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"}),u=function(e){return i.default.createElement(o.default,e,s)};(u=(0,a.default)(u)).muiName="SvgIcon";var c=u;t.default=c},42159(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(67294)),a=r(n(46949)),o=r(n(40577)),s=i.default.createElement("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"}),u=function(e){return i.default.createElement(o.default,e,s)};(u=(0,a.default)(u)).muiName="SvgIcon";var c=u;t.default=c},61486(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(67294)),a=r(n(46949)),o=r(n(40577)),s=i.default.createElement("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z"}),u=function(e){return i.default.createElement(o.default,e,s)};(u=(0,a.default)(u)).muiName="SvgIcon";var c=u;t.default=c},86861(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(67294)),a=r(n(46949)),o=r(n(40577)),s=i.default.createElement("path",{d:"M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"}),u=function(e){return i.default.createElement(o.default,e,s)};(u=(0,a.default)(u)).muiName="SvgIcon";var c=u;t.default=c},43836(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(67294)),a=r(n(46949)),o=r(n(40577)),s=i.default.createElement("path",{d:"M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z"}),u=function(e){return i.default.createElement(o.default,e,s)};(u=(0,a.default)(u)).muiName="SvgIcon";var c=u;t.default=c},93078(e,t,n){"use strict";/*! - * is-plain-object - * - * Copyright (c) 2014-2017, Jon Schlinkert. - * Released under the MIT License. - */ var r=n(47798);function i(e){return!0===r(e)&&"[object Object]"===Object.prototype.toString.call(e)}e.exports=function(e){var t,n;return!1!==i(e)&&"function"==typeof(t=e.constructor)&&!1!==i(n=t.prototype)&&!1!==n.hasOwnProperty("isPrototypeOf")}},72366(e,t,n){"use strict";var r=n(75263),i=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.MuiThemeProviderOld=void 0;var a=i(n(10434)),o=i(n(38416)),s=i(n(56690)),u=i(n(89728)),c=i(n(94993)),l=i(n(73808)),f=i(n(61655)),d=i(n(67294)),h=i(n(45697));i(n(42473));var p=i(n(43890)),b=n(55252),m=r(n(51067)),g=function(e){function t(e,n){var r;return(0,s.default)(this,t),(r=(0,c.default)(this,(0,l.default)(t).call(this))).broadcast=(0,p.default)(),r.outerTheme=m.default.initial(n),r.broadcast.setState(r.mergeOuterLocalTheme(e.theme)),r}return(0,f.default)(t,e),(0,u.default)(t,[{key:"getChildContext",value:function(){var e,t=this.props,n=t.disableStylesGeneration,r=t.sheetsCache,i=t.sheetsManager,a=this.context.muiThemeProviderOptions||{};return void 0!==n&&(a.disableStylesGeneration=n),void 0!==r&&(a.sheetsCache=r),void 0!==i&&(a.sheetsManager=i),e={},(0,o.default)(e,m.CHANNEL,this.broadcast),(0,o.default)(e,"muiThemeProviderOptions",a),e}},{key:"componentDidMount",value:function(){var e=this;this.unsubscribeId=m.default.subscribe(this.context,function(t){e.outerTheme=t,e.broadcast.setState(e.mergeOuterLocalTheme(e.props.theme))})}},{key:"componentDidUpdate",value:function(e){this.props.theme!==e.theme&&this.broadcast.setState(this.mergeOuterLocalTheme(this.props.theme))}},{key:"componentWillUnmount",value:function(){null!==this.unsubscribeId&&m.default.unsubscribe(this.context,this.unsubscribeId)}},{key:"mergeOuterLocalTheme",value:function(e){return"function"==typeof e?e(this.outerTheme):this.outerTheme?(0,a.default)({},this.outerTheme,e):e}},{key:"render",value:function(){return this.props.children}}]),t}(d.default.Component);t.MuiThemeProviderOld=g,g.childContextTypes=(0,a.default)({},m.default.contextTypes,{muiThemeProviderOptions:h.default.object}),g.contextTypes=(0,a.default)({},m.default.contextTypes,{muiThemeProviderOptions:h.default.object}),b.ponyfillGlobal.__MUI_STYLES__||(b.ponyfillGlobal.__MUI_STYLES__={}),b.ponyfillGlobal.__MUI_STYLES__.MuiThemeProvider||(b.ponyfillGlobal.__MUI_STYLES__.MuiThemeProvider=g);var v=b.ponyfillGlobal.__MUI_STYLES__.MuiThemeProvider;t.default=v},59114(e,t,n){"use strict";var r=n(64836);function i(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return en?n:e}function a(e){e=e.substr(1);var t=RegExp(".{1,".concat(e.length/3,"}"),"g"),n=e.match(t);return n&&1===n[0].length&&(n=n.map(function(e){return e+e})),n?"rgb(".concat(n.map(function(e){return parseInt(e,16)}).join(", "),")"):""}function o(e){if(0===e.indexOf("#"))return e;function t(e){var t=e.toString(16);return 1===t.length?"0".concat(t):t}var n=s(e).values;return n=n.map(function(e){return t(e)}),"#".concat(n.join(""))}function s(e){if("#"===e.charAt(0))return s(a(e));var t=e.indexOf("("),n=e.substring(0,t),r=e.substring(t+1,e.length-1).split(",");return r=r.map(function(e){return parseFloat(e)}),{type:n,values:r}}function u(e){var t=e.type,n=e.values;return -1!==t.indexOf("rgb")&&(n=n.map(function(e,t){return t<3?parseInt(e,10):e})),-1!==t.indexOf("hsl")&&(n[1]="".concat(n[1],"%"),n[2]="".concat(n[2],"%")),"".concat(e.type,"(").concat(n.join(", "),")")}function c(e,t){var n=l(e),r=l(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function l(e){var t=s(e);if(-1!==t.type.indexOf("rgb")){var n=t.values.map(function(e){return(e/=255)<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)});return Number((.2126*n[0]+.7152*n[1]+.0722*n[2]).toFixed(3))}return t.values[2]/100}function f(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.15;return l(e)>.5?h(e,t):p(e,t)}function d(e,t){return e?(e=s(e),t=i(t),("rgb"===e.type||"hsl"===e.type)&&(e.type+="a"),e.values[3]=t,u(e)):e}function h(e,t){if(!e)return e;if(e=s(e),t=i(t),-1!==e.type.indexOf("hsl"))e.values[2]*=1-t;else if(-1!==e.type.indexOf("rgb"))for(var n=0;n<3;n+=1)e.values[n]*=1-t;return u(e)}function p(e,t){if(!e)return e;if(e=s(e),t=i(t),-1!==e.type.indexOf("hsl"))e.values[2]+=(100-e.values[2])*t;else if(-1!==e.type.indexOf("rgb"))for(var n=0;n<3;n+=1)e.values[n]+=(255-e.values[n])*t;return u(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.convertHexToRGB=a,t.rgbToHex=o,t.decomposeColor=s,t.recomposeColor=u,t.getContrastRatio=c,t.getLuminance=l,t.emphasize=f,t.fade=d,t.darken=h,t.lighten=p,r(n(42473))},94811(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=s,t.keys=void 0;var i=r(n(10434)),a=r(n(70215)),o=["xs","sm","md","lg","xl"];function s(e){var t=e.values,n=void 0===t?{xs:0,sm:600,md:960,lg:1280,xl:1920}:t,r=e.unit,s=void 0===r?"px":r,u=e.step,c=void 0===u?5:u,l=(0,a.default)(e,["values","unit","step"]);function f(e){var t="number"==typeof n[e]?n[e]:e;return"@media (min-width:".concat(t).concat(s,")")}function d(e){var t=o.indexOf(e)+1,r=n[o[t]];if(t===o.length)return f("xs");var i="number"==typeof r&&t>0?r:e;return"@media (max-width:".concat(i-c/100).concat(s,")")}function h(e,t){var r=o.indexOf(t)+1;return r===o.length?f(e):"@media (min-width:".concat(n[e]).concat(s,") and ")+"(max-width:".concat(n[o[r]]-c/100).concat(s,")")}function p(e){return h(e,e)}function b(e){return n[e]}return(0,i.default)({keys:o,values:n,up:f,down:d,between:h,only:p,width:b},l)}t.keys=o},20237(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=o,r(n(42473));var i=/([[\].#*$><+~=|^:(),"'`\s])/g;function a(e){var t;return String(e).replace(i,"-")}function o(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.dangerouslyUseGlobalCSS,n=void 0!==t&&t,r=e.productionPrefix,i=void 0===r?"jss":r,o=e.seed,s=void 0===o?"":o,u=0;return function(e,t){return(u+=1,n&&t&&t.options.name)?"".concat(a(t.options.name),"-").concat(e.key):"".concat(i).concat(s).concat(u)}}},40226(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var i=r(n(38416)),a=r(n(10434));function o(e,t,n){var r;return(0,a.default)({gutters:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,a.default)({paddingLeft:2*t.unit,paddingRight:2*t.unit},n,(0,i.default)({},e.up("sm"),(0,a.default)({paddingLeft:3*t.unit,paddingRight:3*t.unit},n[e.up("sm")])))},toolbar:(r={minHeight:56},(0,i.default)(r,"".concat(e.up("xs")," and (orientation: landscape)"),{minHeight:48}),(0,i.default)(r,e.up("sm"),{minHeight:64}),r)},n)}},71615(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,r(n(38416));var i=r(n(10434)),a=r(n(70215)),o=r(n(94863)),s=r(n(93078));r(n(42473));var u=r(n(94811)),c=r(n(40226)),l=r(n(21091)),f=r(n(45184)),d=r(n(80743)),h=r(n(59591)),p=r(n(5324)),b=r(n(15406)),m=r(n(88676));function g(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.breakpoints,r=void 0===n?{}:n,g=t.mixins,v=void 0===g?{}:g,y=t.palette,w=void 0===y?{}:y,_=t.shadows,E=t.spacing,S=void 0===E?{}:E,k=t.typography,x=void 0===k?{}:k,T=(0,a.default)(t,["breakpoints","mixins","palette","shadows","spacing","typography"]),M=(0,l.default)(w),O=(0,u.default)(r),A=(0,i.default)({},p.default,S);return(0,i.default)({breakpoints:O,direction:"ltr",mixins:(0,c.default)(O,A,v),overrides:{},palette:M,props:{},shadows:_||d.default,typography:(0,f.default)(M,x)},(0,o.default)({shape:h.default,spacing:A,transitions:b.default,zIndex:m.default},T,{isMergeableObject:s.default}))}var v=g;t.default=v},21091(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=m,t.dark=t.light=void 0;var i=r(n(10434)),a=r(n(70215));r(n(42473));var o=r(n(94863)),s=r(n(78768)),u=r(n(124)),c=r(n(70167)),l=r(n(83165)),f=r(n(515)),d=n(59114),h={text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.54)",disabled:"rgba(0, 0, 0, 0.38)",hint:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:f.default.white,default:c.default[50]},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.08)",hoverOpacity:.08,selected:"rgba(0, 0, 0, 0.14)",disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)"}};t.light=h;var p={text:{primary:f.default.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",hint:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:c.default[800],default:"#303030"},action:{active:f.default.white,hover:"rgba(255, 255, 255, 0.1)",hoverOpacity:.1,selected:"rgba(255, 255, 255, 0.2)",disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)"}};function b(e,t,n,r){e[t]||(e.hasOwnProperty(n)?e[t]=e[n]:"light"===t?e.light=(0,d.lighten)(e.main,r):"dark"===t&&(e.dark=(0,d.darken)(e.main,1.5*r)))}function m(e){var t=e.primary,n=void 0===t?{light:s.default[300],main:s.default[500],dark:s.default[700]}:t,r=e.secondary,m=void 0===r?{light:u.default.A200,main:u.default.A400,dark:u.default.A700}:r,g=e.error,v=void 0===g?{light:l.default[300],main:l.default[500],dark:l.default[700]}:g,y=e.type,w=void 0===y?"light":y,_=e.contrastThreshold,E=void 0===_?3:_,S=e.tonalOffset,k=void 0===S?.2:S,x=(0,a.default)(e,["primary","secondary","error","type","contrastThreshold","tonalOffset"]);function T(e){var t;return(0,d.getContrastRatio)(e,p.text.primary)>=E?p.text.primary:h.text.primary}function M(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:500,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:300,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:700;return!e.main&&e[t]&&(e.main=e[t]),b(e,"light",n,k),b(e,"dark",r,k),e.contrastText||(e.contrastText=T(e.main)),e}M(n),M(m,"A400","A200","A700"),M(v);var O={dark:p,light:h};return(0,o.default)((0,i.default)({common:f.default,type:w,primary:n,secondary:m,error:v,grey:c.default,contrastThreshold:E,getContrastText:T,augmentColor:M,tonalOffset:k},O[w]),x,{clone:!1})}t.dark=p},16059(e,t){"use strict";function n(e){return e}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n},45184(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=f;var i=r(n(10434)),a=r(n(70215)),o=r(n(94863));r(n(42473));var s=n(55252);function u(e){return Math.round(1e5*e)/1e5}var c={textTransform:"uppercase"},l='"Roboto", "Helvetica", "Arial", sans-serif';function f(e,t){var n="function"==typeof t?t(e):t,r=n.fontFamily,f=void 0===r?l:r,d=n.fontSize,h=void 0===d?14:d,p=n.fontWeightLight,b=void 0===p?300:p,m=n.fontWeightRegular,g=void 0===m?400:m,v=n.fontWeightMedium,y=void 0===v?500:v,w=n.htmlFontSize,_=void 0===w?16:w,E=n.useNextVariants,S=void 0===E?Boolean(s.ponyfillGlobal.__MUI_USE_NEXT_TYPOGRAPHY_VARIANTS__):E,k=(n.suppressWarning,n.allVariants),x=(0,a.default)(n,["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","htmlFontSize","useNextVariants","suppressWarning","allVariants"]),T=h/14,M=function(e){return"".concat(e/_*T,"rem")},O=function(t,n,r,a,o){return(0,i.default)({color:e.text.primary,fontFamily:f,fontWeight:t,fontSize:M(n),lineHeight:r},f===l?{letterSpacing:"".concat(u(a/n),"em")}:{},o,k)},A={h1:O(b,96,1,-1.5),h2:O(b,60,1,-.5),h3:O(g,48,1.04,0),h4:O(g,34,1.17,.25),h5:O(g,24,1.33,0),h6:O(y,20,1.6,.15),subtitle1:O(g,16,1.75,.15),subtitle2:O(y,14,1.57,.1),body1Next:O(g,16,1.5,.15),body2Next:O(g,14,1.5,.15),buttonNext:O(y,14,1.75,.4,c),captionNext:O(g,12,1.66,.4),overline:O(g,12,2.66,1,c)},L={display4:(0,i.default)({fontSize:M(112),fontWeight:b,fontFamily:f,letterSpacing:"-.04em",lineHeight:"".concat(u(128/112),"em"),marginLeft:"-.04em",color:e.text.secondary},k),display3:(0,i.default)({fontSize:M(56),fontWeight:g,fontFamily:f,letterSpacing:"-.02em",lineHeight:"".concat(u(73/56),"em"),marginLeft:"-.02em",color:e.text.secondary},k),display2:(0,i.default)({fontSize:M(45),fontWeight:g,fontFamily:f,lineHeight:"".concat(u(51/45),"em"),marginLeft:"-.02em",color:e.text.secondary},k),display1:(0,i.default)({fontSize:M(34),fontWeight:g,fontFamily:f,lineHeight:"".concat(u(41/34),"em"),color:e.text.secondary},k),headline:(0,i.default)({fontSize:M(24),fontWeight:g,fontFamily:f,lineHeight:"".concat(u(32.5/24),"em"),color:e.text.primary},k),title:(0,i.default)({fontSize:M(21),fontWeight:y,fontFamily:f,lineHeight:"".concat(u(24.5/21),"em"),color:e.text.primary},k),subheading:(0,i.default)({fontSize:M(16),fontWeight:g,fontFamily:f,lineHeight:"".concat(u(1.5),"em"),color:e.text.primary},k),body2:(0,i.default)({fontSize:M(14),fontWeight:y,fontFamily:f,lineHeight:"".concat(u(24/14),"em"),color:e.text.primary},k),body1:(0,i.default)({fontSize:M(14),fontWeight:g,fontFamily:f,lineHeight:"".concat(u(20.5/14),"em"),color:e.text.primary},k),caption:(0,i.default)({fontSize:M(12),fontWeight:g,fontFamily:f,lineHeight:"".concat(u(1.375),"em"),color:e.text.secondary},k),button:(0,i.default)({fontSize:M(14),textTransform:"uppercase",fontWeight:y,fontFamily:f,color:e.text.primary},k)};return(0,o.default)((0,i.default)({pxToRem:M,round:u,fontFamily:f,fontSize:h,fontWeightLight:b,fontWeightRegular:g,fontWeightMedium:y},L,A,S?{body1:A.body1Next,body2:A.body2Next,button:A.buttonNext,caption:A.captionNext}:{},{useNextVariants:S}),x,{clone:!1})}},42458(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(10434));r(n(18698)),r(n(42473));var a=r(n(94863));function o(e,t){return t}function s(e){var t="function"==typeof e;function n(n,r){var s=t?e(n):e;if(!r||!n.overrides||!n.overrides[r])return s;var u=n.overrides[r],c=(0,i.default)({},s);return Object.keys(u).forEach(function(e){c[e]=(0,a.default)(c[e],u[e],{arrayMerge:o})}),c}return{create:n,options:{},themingEnabled:t}}var u=s;t.default=u},58057(e,t){"use strict";function n(e){var t,n=e.theme,r=e.name,i=e.props;if(!n.props||!r||!n.props[r])return i;var a=n.props[r];for(t in a)void 0===i[t]&&(i[t]=a[t]);return i}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n;t.default=r},32316(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"createGenerateClassName",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(t,"createMuiTheme",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(t,"jssPreset",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"MuiThemeProvider",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(t,"createStyles",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(t,"withStyles",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(t,"withTheme",{enumerable:!0,get:function(){return l.default}});var i=r(n(20237)),a=r(n(71615)),o=r(n(9399)),s=r(n(72366)),u=r(n(16059)),c=r(n(78252)),l=r(n(82313))},9399(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(29059)),a=r(n(28752)),o=r(n(35828)),s=r(n(50462)),u=r(n(65926)),c=r(n(89347));function l(){return{plugins:[(0,i.default)(),(0,a.default)(),(0,o.default)(),(0,s.default)(),"undefined"==typeof window?null:(0,u.default)(),(0,c.default)()]}}var f=l;t.default=f},35199(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(10434));function a(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.baseClasses,n=e.newClasses;if(e.Component,!n)return t;var r=(0,i.default)({},t);return Object.keys(n).forEach(function(e){n[e]&&(r[e]="".concat(t[e]," ").concat(n[e]))}),r}r(n(42473)),n(55252);var o=a;t.default=o},88693(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n={set:function(e,t,n,r){var i=e.get(t);i||(i=new Map,e.set(t,i)),i.set(n,r)},get:function(e,t,n){var r=e.get(t);return r?r.get(n):void 0},delete:function(e,t,n){e.get(t).delete(n)}};t.default=n},31898(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n={jss:"64a55d578f856d258dc345b094a2a2b3",sheetsRegistry:"d4bd0baacbc52bbd48bbb9eb24344ecd",sheetOptions:"6fc570d6bd61383819d0f9e7407c452d"};t.default=n},80743(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=.2,r=.14,i=.12;function a(){return["".concat(arguments.length<=0?void 0:arguments[0],"px ").concat(arguments.length<=1?void 0:arguments[1],"px ").concat(arguments.length<=2?void 0:arguments[2],"px ").concat(arguments.length<=3?void 0:arguments[3],"px rgba(0,0,0,").concat(n,")"),"".concat(arguments.length<=4?void 0:arguments[4],"px ").concat(arguments.length<=5?void 0:arguments[5],"px ").concat(arguments.length<=6?void 0:arguments[6],"px ").concat(arguments.length<=7?void 0:arguments[7],"px rgba(0,0,0,").concat(r,")"),"".concat(arguments.length<=8?void 0:arguments[8],"px ").concat(arguments.length<=9?void 0:arguments[9],"px ").concat(arguments.length<=10?void 0:arguments[10],"px ").concat(arguments.length<=11?void 0:arguments[11],"px rgba(0,0,0,").concat(i,")")].join(",")}var o=["none",a(0,1,3,0,0,1,1,0,0,2,1,-1),a(0,1,5,0,0,2,2,0,0,3,1,-2),a(0,1,8,0,0,3,4,0,0,3,3,-2),a(0,2,4,-1,0,4,5,0,0,1,10,0),a(0,3,5,-1,0,5,8,0,0,1,14,0),a(0,3,5,-1,0,6,10,0,0,1,18,0),a(0,4,5,-2,0,7,10,1,0,2,16,1),a(0,5,5,-3,0,8,10,1,0,3,14,2),a(0,5,6,-3,0,9,12,1,0,3,16,2),a(0,6,6,-3,0,10,14,1,0,4,18,3),a(0,6,7,-4,0,11,15,1,0,4,20,3),a(0,7,8,-4,0,12,17,2,0,5,22,4),a(0,7,8,-4,0,13,19,2,0,5,24,4),a(0,7,9,-4,0,14,21,2,0,5,26,4),a(0,8,9,-5,0,15,22,2,0,6,28,5),a(0,8,10,-5,0,16,24,2,0,6,30,5),a(0,8,11,-5,0,17,26,2,0,6,32,5),a(0,9,11,-5,0,18,28,2,0,7,34,6),a(0,9,12,-6,0,19,29,2,0,7,36,6),a(0,10,13,-6,0,20,31,3,0,8,38,7),a(0,10,13,-6,0,21,33,3,0,8,40,7),a(0,10,14,-6,0,22,35,3,0,8,42,7),a(0,11,14,-7,0,23,36,3,0,9,44,8),a(0,11,15,-7,0,24,38,3,0,9,46,8)];t.default=o},59591(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n={borderRadius:4};t.default=n},5324(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n={unit:8};t.default=n},51067(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.CHANNEL=void 0;var i=r(n(38416)),a="__THEMING__";t.CHANNEL=a;var o={contextTypes:(0,i.default)({},a,function(){}),initial:function(e){return e[a]?e[a].getState():null},subscribe:function(e,t){return e[a]?e[a].subscribe(t):null},unsubscribe:function(e,t){e[a]&&e[a].unsubscribe(t)}};t.default=o},15406(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.isNumber=t.isString=t.formatMs=t.duration=t.easing=void 0;var i=r(n(70215));r(n(42473));var a={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"};t.easing=a;var o={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};t.duration=o;var s=function(e){return"".concat(Math.round(e),"ms")};t.formatMs=s;var u=function(e){return"string"==typeof e};t.isString=u;var c=function(e){return!isNaN(parseFloat(e))};t.isNumber=c;var l={easing:a,duration:o,create:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["all"],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.duration,r=void 0===n?o.standard:n,u=t.easing,c=void 0===u?a.easeInOut:u,l=t.delay,f=void 0===l?0:l;return(0,i.default)(t,["duration","easing","delay"]),(Array.isArray(e)?e:[e]).map(function(e){return"".concat(e," ").concat("string"==typeof r?r:s(r)," ").concat(c," ").concat("string"==typeof f?f:s(f))}).join(",")},getAutoHeightDuration:function(e){if(!e)return 0;var t=e/36;return Math.round((4+15*Math.pow(t,.25)+t/5)*10)}};t.default=l},78252(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.sheetsManager=void 0;var i=r(n(38416)),a=r(n(10434)),o=r(n(56690)),s=r(n(89728)),u=r(n(94993)),c=r(n(73808)),l=r(n(61655)),f=r(n(70215)),d=r(n(67294)),h=r(n(45697));r(n(42473));var p=r(n(8679)),b=n(55252),m=n(55690),g=r(n(31898)),v=r(n(9399)),y=r(n(35199)),w=r(n(88693)),_=r(n(71615)),E=r(n(51067)),S=r(n(20237)),k=r(n(42458)),x=r(n(58057)),T=(0,m.create)((0,v.default)()),M=(0,S.default)(),O=-1e11,A=new Map;t.sheetsManager=A;var L={},C=(0,_.default)({typography:{suppressWarning:!0}}),I=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(n){var r,b=t.withTheme,m=void 0!==b&&b,v=t.flip,_=void 0===v?null:v,S=t.name,I=(0,f.default)(t,["withTheme","flip","name"]),D=(0,k.default)(e),N=D.themingEnabled||"string"==typeof S||m;O+=1,D.options.index=O;var P=function(e){function t(e,n){(0,o.default)(this,t),(r=(0,u.default)(this,(0,c.default)(t).call(this,e,n))).jss=n[g.default.jss]||T,r.sheetsManager=A,r.unsubscribeId=null;var r,i=n.muiThemeProviderOptions;return i&&(i.sheetsManager&&(r.sheetsManager=i.sheetsManager),r.sheetsCache=i.sheetsCache,r.disableStylesGeneration=i.disableStylesGeneration),r.stylesCreatorSaved=D,r.sheetOptions=(0,a.default)({generateClassName:M},n[g.default.sheetOptions]),r.theme=N?E.default.initial(n)||C:L,r.attach(r.theme),r.cacheClasses={value:null,lastProp:null,lastJSS:{}},r}return(0,l.default)(t,e),(0,s.default)(t,[{key:"componentDidMount",value:function(){var e=this;N&&(this.unsubscribeId=E.default.subscribe(this.context,function(t){var n=e.theme;e.theme=t,e.attach(e.theme),e.setState({},function(){e.detach(n)})}))}},{key:"componentDidUpdate",value:function(){this.stylesCreatorSaved}},{key:"componentWillUnmount",value:function(){this.detach(this.theme),null!==this.unsubscribeId&&E.default.unsubscribe(this.context,this.unsubscribeId)}},{key:"getClasses",value:function(){if(this.disableStylesGeneration)return this.props.classes||{};var e=!1,t=w.default.get(this.sheetsManager,this.stylesCreatorSaved,this.theme);return t.sheet.classes!==this.cacheClasses.lastJSS&&(this.cacheClasses.lastJSS=t.sheet.classes,e=!0),this.props.classes!==this.cacheClasses.lastProp&&(this.cacheClasses.lastProp=this.props.classes,e=!0),e&&(this.cacheClasses.value=(0,y.default)({baseClasses:this.cacheClasses.lastJSS,newClasses:this.props.classes,Component:n})),this.cacheClasses.value}},{key:"attach",value:function(e){if(!this.disableStylesGeneration){var t=this.stylesCreatorSaved,n=w.default.get(this.sheetsManager,t,e);if(n||(n={refs:0,sheet:null},w.default.set(this.sheetsManager,t,e,n)),0===n.refs){this.sheetsCache&&(r=w.default.get(this.sheetsCache,t,e)),!r&&((r=this.createSheet(e)).attach(),this.sheetsCache&&w.default.set(this.sheetsCache,t,e,r)),n.sheet=r;var r,i=this.context[g.default.sheetsRegistry];i&&i.add(r)}n.refs+=1}}},{key:"createSheet",value:function(e){var t=this.stylesCreatorSaved.create(e,S),r=S;return this.jss.createStyleSheet(t,(0,a.default)({meta:r,classNamePrefix:r,flip:"boolean"==typeof _?_:"rtl"===e.direction,link:!1},this.sheetOptions,this.stylesCreatorSaved.options,{name:S||n.displayName},I))}},{key:"detach",value:function(e){if(!this.disableStylesGeneration){var t=w.default.get(this.sheetsManager,this.stylesCreatorSaved,e);if(t.refs-=1,0===t.refs){w.default.delete(this.sheetsManager,this.stylesCreatorSaved,e),this.jss.removeStyleSheet(t.sheet);var n=this.context[g.default.sheetsRegistry];n&&n.remove(t.sheet)}}}},{key:"render",value:function(){var e=this.props,t=(e.classes,e.innerRef),r=(0,f.default)(e,["classes","innerRef"]),i=(0,x.default)({theme:this.theme,name:S,props:r});return m&&!i.theme&&(i.theme=this.theme),d.default.createElement(n,(0,a.default)({},i,{classes:this.getClasses(),ref:t}))}}]),t}(d.default.Component);return P.contextTypes=(0,a.default)((r={muiThemeProviderOptions:h.default.object},(0,i.default)(r,g.default.jss,h.default.object),(0,i.default)(r,g.default.sheetOptions,h.default.object),(0,i.default)(r,g.default.sheetsRegistry,h.default.object),r),N?E.default.contextTypes:{}),(0,p.default)(P,n),P}};b.ponyfillGlobal.__MUI_STYLES__||(b.ponyfillGlobal.__MUI_STYLES__={}),b.ponyfillGlobal.__MUI_STYLES__.withStyles||(b.ponyfillGlobal.__MUI_STYLES__.withStyles=I);var D=function(e,t){return b.ponyfillGlobal.__MUI_STYLES__.withStyles(e,(0,a.default)({defaultTheme:C},t))};t.default=D},82313(e,t,n){"use strict";var r,i=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=i(n(10434)),o=i(n(70215)),s=i(n(56690)),u=i(n(89728)),c=i(n(94993)),l=i(n(73808)),f=i(n(61655)),d=i(n(67294));i(n(45697));var h=i(n(8679)),p=n(55252),b=i(n(71615)),m=i(n(51067));function g(){return r||(r=(0,b.default)({typography:{suppressWarning:!0}}))}var v=function(){return function(e){var t=function(t){function n(e,t){var r;return(0,s.default)(this,n),(r=(0,c.default)(this,(0,l.default)(n).call(this))).state={theme:m.default.initial(t)||g()},r}return(0,f.default)(n,t),(0,u.default)(n,[{key:"componentDidMount",value:function(){var e=this;this.unsubscribeId=m.default.subscribe(this.context,function(t){e.setState({theme:t})})}},{key:"componentWillUnmount",value:function(){null!==this.unsubscribeId&&m.default.unsubscribe(this.context,this.unsubscribeId)}},{key:"render",value:function(){var t=this.props,n=t.innerRef,r=(0,o.default)(t,["innerRef"]);return d.default.createElement(e,(0,a.default)({theme:this.state.theme,ref:n},r))}}]),n}(d.default.Component);return t.contextTypes=m.default.contextTypes,(0,h.default)(t,e),t}};p.ponyfillGlobal.__MUI_STYLES__||(p.ponyfillGlobal.__MUI_STYLES__={}),p.ponyfillGlobal.__MUI_STYLES__.withTheme||(p.ponyfillGlobal.__MUI_STYLES__.withTheme=v);var y=p.ponyfillGlobal.__MUI_STYLES__.withTheme;t.default=y},88676(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n={mobileStepper:1e3,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500};t.default=n},41929(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getTransitionProps=r,t.reflow=void 0;var n=function(e){return e.scrollTop};function r(e,t){var n=e.timeout,r=e.style,i=void 0===r?{}:r;return{duration:i.transitionDuration||"number"==typeof n?n:n[t.mode],delay:i.transitionDelay}}t.reflow=n},346(e,t){"use strict";function n(e,t){return function(){return null}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n;t.default=r},98741(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.capitalize=a,t.contains=o,t.findIndex=s,t.find=u,t.createChainedFunction=c;var i=r(n(18698));function a(e){return e.charAt(0).toUpperCase()+e.slice(1)}function o(e,t){return Object.keys(t).every(function(n){return e.hasOwnProperty(n)&&e[n]===t[n]})}function s(e,t){for(var n=(0,i.default)(t),r=0;r-1?e[n]:void 0}function c(){for(var e=arguments.length,t=Array(e),n=0;n1&&void 0!==arguments[1]?arguments[1]:window,n=(0,i.default)(e);return n.defaultView||n.parentView||t}var o=a;t.default=o},44370(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.cloneElementWithClassName=o,t.cloneChildrenWithClassName=s,t.isMuiElement=u,t.setRef=c;var i=r(n(67294)),a=r(n(94184));function o(e,t){return i.default.cloneElement(e,{className:(0,a.default)(e.props.className,t)})}function s(e,t){return i.default.Children.map(e,function(e){return i.default.isValidElement(e)&&o(e,t)})}function u(e,t){return i.default.isValidElement(e)&&-1!==t.indexOf(e.type.muiName)}function c(e,t){"function"==typeof e?e(t):e&&(e.current=t)}},47348(e,t){"use strict";function n(e){return function(){return null}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n;t.default=r},21677(e,t){"use strict";function n(e,t,n,r,i){return null}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n;t.default=r},78290(e,t,n){"use strict";var r=n(75263);Object.defineProperty(t,"__esModule",{value:!0});var i={};Object.defineProperty(t,"default",{enumerable:!0,get:function(){return a.default}});var a=r(n(88446));Object.keys(a).forEach(function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(i,e)||Object.defineProperty(t,e,{enumerable:!0,get:function(){return a[e]}}))})},88446(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.isWidthDown=t.isWidthUp=void 0;var i=r(n(10434)),a=r(n(70215)),o=r(n(56690)),s=r(n(89728)),u=r(n(94993)),c=r(n(73808)),l=r(n(61655)),f=r(n(67294));r(n(45697));var d=r(n(96421)),h=r(n(20296));n(55252);var p=r(n(8679)),b=r(n(82313)),m=n(94811),g=r(n(58057)),v=function(e,t){var n=!(arguments.length>2)||void 0===arguments[2]||arguments[2];return n?m.keys.indexOf(e)<=m.keys.indexOf(t):m.keys.indexOf(e)2)||void 0===arguments[2]||arguments[2];return n?m.keys.indexOf(t)<=m.keys.indexOf(e):m.keys.indexOf(t)0&&void 0!==arguments[0]?arguments[0]:{};return function(t){var n=e.withTheme,r=void 0!==n&&n,v=e.noSSR,y=void 0!==v&&v,w=e.initialWidth,_=e.resizeInterval,E=void 0===_?166:_,S=function(e){function n(e){var t;return(0,o.default)(this,n),(t=(0,u.default)(this,(0,c.default)(n).call(this,e))).state={width:y?t.getWidth():void 0},"undefined"!=typeof window&&(t.handleResize=(0,h.default)(function(){var e=t.getWidth();e!==t.state.width&&t.setState({width:e})},E)),t}return(0,l.default)(n,e),(0,s.default)(n,[{key:"componentDidMount",value:function(){var e=this.getWidth();e!==this.state.width&&this.setState({width:e})}},{key:"componentWillUnmount",value:function(){this.handleResize.clear()}},{key:"getWidth",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.innerWidth,t=this.props.theme.breakpoints,n=null,r=1;null===n&&ri.Z,componentPropType:()=>r.Z,exactProp:()=>a.ZP,getDisplayName:()=>o.ZP,ponyfillGlobal:()=>s.Z});var r=n(78728),i=n(5477),a=n(43781),o=n(25189),s=n(34712);/** @license Material-UI v3.0.0-alpha.3 - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ },34712(e,t){"use strict";n={value:!0},t.Z=void 0;var n,r="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();t.Z=r},82152(e,t,n){"use strict";n.d(t,{D:()=>u});var r=Object.prototype,i=r.toString,a=r.hasOwnProperty,o=Function.prototype.toString,s=new Map;function u(e,t){try{return c(e,t)}finally{s.clear()}}function c(e,t){if(e===t)return!0;var n=i.call(e),r=i.call(t);if(n!==r)return!1;switch(n){case"[object Array]":if(e.length!==t.length)break;case"[object Object]":if(p(e,t))return!0;var s=l(e),u=l(t),f=s.length;if(f!==u.length)break;for(var b=0;b=0&&e.indexOf(t,n)===n}function p(e,t){var n=s.get(e);if(n){if(n.has(t))return!0}else s.set(e,n=new Set);return n.add(t),!1}},79742(e,t){"use strict";t.byteLength=c,t.toByteArray=f,t.fromByteArray=p;for(var n=[],r=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,s=a.length;o0)throw Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");-1===n&&(n=t);var r=n===t?0:4-n%4;return[n,r]}function c(e){var t=u(e),n=t[0],r=t[1];return(n+r)*3/4-r}function l(e,t,n){return(t+n)*3/4-n}function f(e){var t,n,a=u(e),o=a[0],s=a[1],c=new i(l(e,o,s)),f=0,d=s>0?o-4:o;for(n=0;n>16&255,c[f++]=t>>8&255,c[f++]=255&t;return 2===s&&(t=r[e.charCodeAt(n)]<<2|r[e.charCodeAt(n+1)]>>4,c[f++]=255&t),1===s&&(t=r[e.charCodeAt(n)]<<10|r[e.charCodeAt(n+1)]<<4|r[e.charCodeAt(n+2)]>>2,c[f++]=t>>8&255,c[f++]=255&t),c}function d(e){return n[e>>18&63]+n[e>>12&63]+n[e>>6&63]+n[63&e]}function h(e,t,n){for(var r,i=[],a=t;au?u:s+o));return 1===i?a.push(n[(t=e[r-1])>>2]+n[t<<4&63]+"=="):2===i&&a.push(n[(t=(e[r-2]<<8)+e[r-1])>>10]+n[t>>4&63]+n[t<<2&63]+"="),a.join("")}r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63},44431:function(e,t,n){var r;!function(i){"use strict";var a,o=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,s=Math.ceil,u=Math.floor,c="[BigNumber Error] ",l=c+"Number primitive has more than 15 significant digits: ",f=1e14,d=14,h=9007199254740991,p=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],b=1e7,m=1e9;function g(e){var t,n,r,i,a,x,T,M,O,A,L=$.prototype={constructor:$,toString:null,valueOf:null},C=new $(1),I=20,D=4,N=-7,P=21,R=-1e7,j=1e7,F=!1,Y=1,B=0,U={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:"\xa0",suffix:""},H="0123456789abcdefghijklmnopqrstuvwxyz";function $(e,t){var n,r,i,a,s,c,f,p,b=this;if(!(b instanceof $))return new $(e,t);if(null==t){if(e&&!0===e._isBigNumber){b.s=e.s,!e.c||e.e>j?b.c=b.e=null:e.e=10;s/=10,a++);a>j?b.c=b.e=null:(b.e=a,b.c=[e]);return}p=String(e)}else{if(!o.test(p=String(e)))return A(b,p,c);b.s=45==p.charCodeAt(0)?(p=p.slice(1),-1):1}(a=p.indexOf("."))>-1&&(p=p.replace(".","")),(s=p.search(/e/i))>0?(a<0&&(a=s),a+=+p.slice(s+1),p=p.substring(0,s)):a<0&&(a=p.length)}else{if(_(t,2,H.length,"Base"),10==t)return b=new $(e),K(b,I+b.e+1,D);if(p=String(e),c="number"==typeof e){if(0*e!=0)return A(b,p,c,t);if(b.s=1/e<0?(p=p.slice(1),-1):1,$.DEBUG&&p.replace(/^0\.0*|\./,"").length>15)throw Error(l+e)}else b.s=45===p.charCodeAt(0)?(p=p.slice(1),-1):1;for(n=H.slice(0,t),a=s=0,f=p.length;sn.indexOf(r=p.charAt(s))){if("."==r){if(s>a){a=f;continue}}else if(!i&&(p==p.toUpperCase()&&(p=p.toLowerCase())||p==p.toLowerCase()&&(p=p.toUpperCase()))){i=!0,s=-1,a=0;continue}return A(b,String(e),c,t)}c=!1,(a=(p=O(p,t,10,b.s)).indexOf("."))>-1?p=p.replace(".",""):a=p.length}for(s=0;48===p.charCodeAt(s);s++);for(f=p.length;48===p.charCodeAt(--f););if(p=p.slice(s,++f)){if(f-=s,c&&$.DEBUG&&f>15&&(e>h||e!==u(e)))throw Error(l+b.s*e);if((a=a-s-1)>j)b.c=b.e=null;else if(a=P)?S(u,o):k(u,o,"0");else if(a=(e=K(new $(e),t,n)).e,s=(u=y(e.c)).length,1==r||2==r&&(t<=a||a<=N)){for(;ss){if(--t>0)for(u+=".";t--;u+="0");}else if((t+=a-s)>0)for(a+1==s&&(u+=".");t--;u+="0");return e.s<0&&i?"-"+u:u}function G(e,t){for(var n,r=1,i=new $(e[0]);r=10;i/=10,r++);return(n=r+n*d-1)>j?e.c=e.e=null:n=10;c/=10,i++);if((a=t-i)<0)a+=d,o=t,b=(l=m[h=0])/g[i-o-1]%10|0;else if((h=s((a+1)/d))>=m.length){if(r){for(;m.length<=h;m.push(0));l=b=0,i=1,a%=d,o=a-d+1}else break out}else{for(i=1,l=c=m[h];c>=10;c/=10,i++);a%=d,b=(o=a-d+i)<0?0:l/g[i-o-1]%10|0}if(r=r||t<0||null!=m[h+1]||(o<0?l:l%g[i-o-1]),r=n<4?(b||r)&&(0==n||n==(e.s<0?3:2)):b>5||5==b&&(4==n||r||6==n&&(a>0?o>0?l/g[i-o]:0:m[h-1])%10&1||n==(e.s<0?8:7)),t<1||!m[0])return m.length=0,r?(t-=e.e+1,m[0]=g[(d-t%d)%d],e.e=-t||0):m[0]=e.e=0,e;if(0==a?(m.length=h,c=1,h--):(m.length=h+1,c=g[d-a],m[h]=o>0?u(l/g[i-o]%g[o])*c:0),r)for(;;){if(0==h){for(a=1,o=m[0];o>=10;o/=10,a++);for(o=m[0]+=c,c=1;o>=10;o/=10,c++);a!=c&&(e.e++,m[0]==f&&(m[0]=1));break}if(m[h]+=c,m[h]!=f)break;m[h--]=0,c=1}for(a=m.length;0===m[--a];m.pop());}e.e>j?e.c=e.e=null:e.e=P?S(t,n):k(t,n,"0"),e.s<0?"-"+t:t)}return $.clone=g,$.ROUND_UP=0,$.ROUND_DOWN=1,$.ROUND_CEIL=2,$.ROUND_FLOOR=3,$.ROUND_HALF_UP=4,$.ROUND_HALF_DOWN=5,$.ROUND_HALF_EVEN=6,$.ROUND_HALF_CEIL=7,$.ROUND_HALF_FLOOR=8,$.EUCLID=9,$.config=$.set=function(e){var t,n;if(null!=e){if("object"==typeof e){if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(_(n=e[t],0,m,t),I=n),e.hasOwnProperty(t="ROUNDING_MODE")&&(_(n=e[t],0,8,t),D=n),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((n=e[t])&&n.pop?(_(n[0],-m,0,t),_(n[1],0,m,t),N=n[0],P=n[1]):(_(n,-m,m,t),N=-(P=n<0?-n:n))),e.hasOwnProperty(t="RANGE")){if((n=e[t])&&n.pop)_(n[0],-m,-1,t),_(n[1],1,m,t),R=n[0],j=n[1];else if(_(n,-m,m,t),n)R=-(j=n<0?-n:n);else throw Error(c+t+" cannot be zero: "+n)}if(e.hasOwnProperty(t="CRYPTO")){if(!!(n=e[t])===n){if(n){if("undefined"!=typeof crypto&&crypto&&(crypto.getRandomValues||crypto.randomBytes))F=n;else throw F=!n,Error(c+"crypto unavailable")}else F=n}else throw Error(c+t+" not true or false: "+n)}if(e.hasOwnProperty(t="MODULO_MODE")&&(_(n=e[t],0,9,t),Y=n),e.hasOwnProperty(t="POW_PRECISION")&&(_(n=e[t],0,m,t),B=n),e.hasOwnProperty(t="FORMAT")){if("object"==typeof(n=e[t]))U=n;else throw Error(c+t+" not an object: "+n)}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(n=e[t])||/^.?$|[+\-.\s]|(.).*\1/.test(n))throw Error(c+t+" invalid: "+n);H=n}}else throw Error(c+"Object expected: "+e)}return{DECIMAL_PLACES:I,ROUNDING_MODE:D,EXPONENTIAL_AT:[N,P],RANGE:[R,j],CRYPTO:F,MODULO_MODE:Y,POW_PRECISION:B,FORMAT:U,ALPHABET:H}},$.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!$.DEBUG)return!0;var t,n,r=e.c,i=e.e,a=e.s;out:if("[object Array]"==({}).toString.call(r)){if((1===a||-1===a)&&i>=-m&&i<=m&&i===u(i)){if(0===r[0]){if(0===i&&1===r.length)return!0;break out}if((t=(i+1)%d)<1&&(t+=d),String(r[0]).length==t){for(t=0;t=f||n!==u(n))break out;if(0!==n)return!0}}}else if(null===r&&null===i&&(null===a||1===a||-1===a))return!0;throw Error(c+"Invalid BigNumber: "+e)},$.maximum=$.max=function(){return G(arguments,L.lt)},$.minimum=$.min=function(){return G(arguments,L.gt)},$.random=(n=Math.random()*(t=9007199254740992)&2097151?function(){return u(Math.random()*t)}:function(){return(1073741824*Math.random()|0)*8388608+(8388608*Math.random()|0)},function(e){var t,r,i,a,o,l=0,f=[],h=new $(C);if(null==e?e=I:_(e,0,m),a=s(e/d),F){if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(a*=2));l>>11))>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),t[l]=r[0],t[l+1]=r[1]):(f.push(o%1e14),l+=2);l=a/2}else if(crypto.randomBytes){for(t=crypto.randomBytes(a*=7);l=9e15?crypto.randomBytes(7).copy(t,l):(f.push(o%1e14),l+=7);l=a/7}else throw F=!1,Error(c+"crypto unavailable")}if(!F)for(;l=10;o/=10,l++);ln-1&&(null==o[i+1]&&(o[i+1]=0),o[i+1]+=o[i]/n|0,o[i]%=n)}return o.reverse()}return function(n,r,i,a,o){var s,u,c,l,f,d,h,p,b=n.indexOf("."),m=I,g=D;for(b>=0&&(l=B,B=0,n=n.replace(".",""),d=(p=new $(r)).pow(n.length-b),B=l,p.c=t(k(y(d.c),d.e,"0"),10,i,e),p.e=p.c.length),c=l=(h=t(n,r,i,o?(s=H,e):(s=e,H))).length;0==h[--l];h.pop());if(!h[0])return s.charAt(0);if(b<0?--c:(d.c=h,d.e=c,d.s=a,h=(d=M(d,p,m,g,i)).c,f=d.r,c=d.e),b=h[u=c+m+1],l=i/2,f=f||u<0||null!=h[u+1],f=g<4?(null!=b||f)&&(0==g||g==(d.s<0?3:2)):b>l||b==l&&(4==g||f||6==g&&1&h[u-1]||g==(d.s<0?8:7)),u<1||!h[0])n=f?k(s.charAt(1),-m,s.charAt(0)):s.charAt(0);else{if(h.length=u,f)for(--i;++h[--u]>i;)h[u]=0,u||(++c,h=[1].concat(h));for(l=h.length;!h[--l];);for(b=0,n="";b<=l;n+=s.charAt(h[b++]));n=k(n,c,s.charAt(0))}return n}}(),M=function(){function e(e,t,n){var r,i,a,o,s=0,u=e.length,c=t%b,l=t/b|0;for(e=e.slice();u--;)r=l*(a=e[u]%b)+(o=e[u]/b|0)*c,s=((i=c*a+r%b*b+s)/n|0)+(r/b|0)+l*o,e[u]=i%n;return s&&(e=[s].concat(e)),e}function t(e,t,n,r){var i,a;if(n!=r)a=n>r?1:-1;else for(i=a=0;it[i]?1:-1;break}return a}function n(e,t,n,r){for(var i=0;n--;)e[n]-=i,i=e[n]1;e.splice(0,1));}return function(r,i,a,o,s){var c,l,h,p,b,m,g,y,w,_,E,S,k,x,T,M,O,A=r.s==i.s?1:-1,L=r.c,C=i.c;if(!L||!L[0]||!C||!C[0])return new $(r.s&&i.s&&(L?!C||L[0]!=C[0]:C)?L&&0==L[0]||!C?0*A:A/0:NaN);for(w=(y=new $(A)).c=[],A=a+(l=r.e-i.e)+1,s||(s=f,l=v(r.e/d)-v(i.e/d),A=A/d|0),h=0;C[h]==(L[h]||0);h++);if(C[h]>(L[h]||0)&&l--,A<0)w.push(1),p=!0;else{for(x=L.length,M=C.length,h=0,A+=2,(b=u(s/(C[0]+1)))>1&&(C=e(C,b,s),L=e(L,b,s),M=C.length,x=L.length),k=M,E=(_=L.slice(0,M)).length;E=s/2&&T++;do{if(b=0,(c=t(C,_,M,E))<0){if(S=_[0],M!=E&&(S=S*s+(_[1]||0)),(b=u(S/T))>1)for(b>=s&&(b=s-1),g=(m=e(C,b,s)).length,E=_.length;1==t(m,_,g,E);)b--,n(m,Mt(C,_,M,E);)b++,n(_,M=10;A/=10,h++);K(y,a+(y.e=h+l*d-1)+1,o,p)}else y.e=l,y.r=+p;return y}}(),A=(r=/^(-?)0([xbo])(?=\w[\w.]*$)/i,i=/^([^.]+)\.$/,a=/^\.([^.]+)$/,x=/^-?(Infinity|NaN)$/,T=/^\s*\+(?=[\w.])|^\s+|\s+$/g,function(e,t,n,o){var s,u=n?t:t.replace(T,"");if(x.test(u))e.s=isNaN(u)?null:u<0?-1:1;else{if(!n&&(u=u.replace(r,function(e,t,n){return s="x"==(n=n.toLowerCase())?16:"b"==n?2:8,o&&o!=s?e:t}),o&&(s=o,u=u.replace(i,"$1").replace(a,"0.$1")),t!=u))return new $(u,s);if($.DEBUG)throw Error(c+"Not a"+(o?" base "+o:"")+" number: "+t);e.s=null}e.c=e.e=null}),L.absoluteValue=L.abs=function(){var e=new $(this);return e.s<0&&(e.s=1),e},L.comparedTo=function(e,t){return w(this,new $(e,t))},L.decimalPlaces=L.dp=function(e,t){var n,r,i,a=this;if(null!=e)return _(e,0,m),null==t?t=D:_(t,0,8),K(new $(a),e+a.e+1,t);if(!(n=a.c))return null;if(r=((i=n.length-1)-v(this.e/d))*d,i=n[i])for(;i%10==0;i/=10,r--);return r<0&&(r=0),r},L.dividedBy=L.div=function(e,t){return M(this,new $(e,t),I,D)},L.dividedToIntegerBy=L.idiv=function(e,t){return M(this,new $(e,t),0,1)},L.exponentiatedBy=L.pow=function(e,t){var n,r,i,a,o,l,f,h,p,b=this;if((e=new $(e)).c&&!e.isInteger())throw Error(c+"Exponent not an integer: "+V(e));if(null!=t&&(t=new $(t)),l=e.e>14,!b.c||!b.c[0]||1==b.c[0]&&!b.e&&1==b.c.length||!e.c||!e.c[0])return p=new $(Math.pow(+V(b),l?2-E(e):+V(e))),t?p.mod(t):p;if(f=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new $(NaN);(r=!f&&b.isInteger()&&t.isInteger())&&(b=b.mod(t))}else{if(e.e>9&&(b.e>0||b.e<-1||(0==b.e?b.c[0]>1||l&&b.c[1]>=24e7:b.c[0]<8e13||l&&b.c[0]<=9999975e7)))return a=(b.s<0&&E(e),-0),b.e>-1&&(a=1/a),new $(f?1/a:a);B&&(a=s(B/d+2))}for(l?(n=new $(.5),f&&(e.s=1),h=E(e)):h=(i=Math.abs(+V(e)))%2,p=new $(C);;){if(h){if(!(p=p.times(b)).c)break;a?p.c.length>a&&(p.c.length=a):r&&(p=p.mod(t))}if(i){if(0===(i=u(i/2)))break;h=i%2}else if(K(e=e.times(n),e.e+1,1),e.e>14)h=E(e);else{if(0==(i=+V(e)))break;h=i%2}b=b.times(b),a?b.c&&b.c.length>a&&(b.c.length=a):r&&(b=b.mod(t))}return r?p:(f&&(p=C.div(p)),t?p.mod(t):a?K(p,B,D,o):p)},L.integerValue=function(e){var t=new $(this);return null==e?e=D:_(e,0,8),K(t,t.e+1,e)},L.isEqualTo=L.eq=function(e,t){return 0===w(this,new $(e,t))},L.isFinite=function(){return!!this.c},L.isGreaterThan=L.gt=function(e,t){return w(this,new $(e,t))>0},L.isGreaterThanOrEqualTo=L.gte=function(e,t){return 1===(t=w(this,new $(e,t)))||0===t},L.isInteger=function(){return!!this.c&&v(this.e/d)>this.c.length-2},L.isLessThan=L.lt=function(e,t){return 0>w(this,new $(e,t))},L.isLessThanOrEqualTo=L.lte=function(e,t){return -1===(t=w(this,new $(e,t)))||0===t},L.isNaN=function(){return!this.s},L.isNegative=function(){return this.s<0},L.isPositive=function(){return this.s>0},L.isZero=function(){return!!this.c&&0==this.c[0]},L.minus=function(e,t){var n,r,i,a,o=this,s=o.s;if(t=(e=new $(e,t)).s,!s||!t)return new $(NaN);if(s!=t)return e.s=-t,o.plus(e);var u=o.e/d,c=e.e/d,l=o.c,h=e.c;if(!u||!c){if(!l||!h)return l?(e.s=-t,e):new $(h?o:NaN);if(!l[0]||!h[0])return h[0]?(e.s=-t,e):new $(l[0]?o:-0)}if(u=v(u),c=v(c),l=l.slice(),s=u-c){for((a=s<0)?(s=-s,i=l):(c=u,i=h),i.reverse(),t=s;t--;i.push(0));i.reverse()}else for(r=(a=(s=l.length)<(t=h.length))?s:t,s=t=0;t0)for(;t--;l[n++]=0);for(t=f-1;r>s;){if(l[--r]=0;){for(n=0,p=S[i]%w,m=S[i]/w|0,a=i+(o=u);a>i;)s=m*(c=E[--o]%w)+(l=E[o]/w|0)*p,n=((c=p*c+s%w*w+g[a]+n)/y|0)+(s/w|0)+m*l,g[a--]=c%y;g[a]=n}return n?++r:g.splice(0,1),W(e,g,r)},L.negated=function(){var e=new $(this);return e.s=-e.s||null,e},L.plus=function(e,t){var n,r=this,i=r.s;if(t=(e=new $(e,t)).s,!i||!t)return new $(NaN);if(i!=t)return e.s=-t,r.minus(e);var a=r.e/d,o=e.e/d,s=r.c,u=e.c;if(!a||!o){if(!s||!u)return new $(i/0);if(!s[0]||!u[0])return u[0]?e:new $(s[0]?r:0*i)}if(a=v(a),o=v(o),s=s.slice(),i=a-o){for(i>0?(o=a,n=u):(i=-i,n=s),n.reverse();i--;n.push(0));n.reverse()}for((i=s.length)-(t=u.length)<0&&(n=u,u=s,s=n,t=i),i=0;t;)i=(s[--t]=s[t]+u[t]+i)/f|0,s[t]=f===s[t]?0:s[t]%f;return i&&(s=[i].concat(s),++o),W(e,s,o)},L.precision=L.sd=function(e,t){var n,r,i,a=this;if(null!=e&&!!e!==e)return _(e,1,m),null==t?t=D:_(t,0,8),K(new $(a),e,t);if(!(n=a.c))return null;if(r=(i=n.length-1)*d+1,i=n[i]){for(;i%10==0;i/=10,r--);for(i=n[0];i>=10;i/=10,r++);}return e&&a.e+1>r&&(r=a.e+1),r},L.shiftedBy=function(e){return _(e,-h,h),this.times("1e"+e)},L.squareRoot=L.sqrt=function(){var e,t,n,r,i,a=this,o=a.c,s=a.s,u=a.e,c=I+4,l=new $("0.5");if(1!==s||!o||!o[0])return new $(!s||s<0&&(!o||o[0])?NaN:o?a:1/0);if(0==(s=Math.sqrt(+V(a)))||s==1/0?(((t=y(o)).length+u)%2==0&&(t+="0"),s=Math.sqrt(+t),u=v((u+1)/2)-(u<0||u%2),t=s==1/0?"5e"+u:(t=s.toExponential()).slice(0,t.indexOf("e")+1)+u,n=new $(t)):n=new $(s+""),n.c[0]){for((s=(u=n.e)+c)<3&&(s=0);;)if(i=n,n=l.times(i.plus(M(a,i,c,1))),y(i.c).slice(0,s)===(t=y(n.c)).slice(0,s)){if(n.e0&&b>0){for(a=b%s||s,f=p.substr(0,a);a0&&(f+=l+p.slice(a)),h&&(f="-"+f)}r=d?f+(n.decimalSeparator||"")+((u=+n.fractionGroupSize)?d.replace(RegExp("\\d{"+u+"}\\B","g"),"$&"+(n.fractionGroupSeparator||"")):d):f}return(n.prefix||"")+r+(n.suffix||"")},L.toFraction=function(e){var t,n,r,i,a,o,s,u,l,f,h,b,m=this,g=m.c;if(null!=e&&(!(s=new $(e)).isInteger()&&(s.c||1!==s.s)||s.lt(C)))throw Error(c+"Argument "+(s.isInteger()?"out of range: ":"not an integer: ")+V(s));if(!g)return new $(m);for(t=new $(C),l=n=new $(C),r=u=new $(C),b=y(g),a=t.e=b.length-m.e-1,t.c[0]=p[(o=a%d)<0?d+o:o],e=!e||s.comparedTo(t)>0?a>0?t:l:s,o=j,j=1/0,s=new $(b),u.c[0]=0;f=M(s,t,0,1),1!=(i=n.plus(f.times(r))).comparedTo(e);)n=r,r=i,l=u.plus(f.times(i=l)),u=i,t=s.minus(f.times(i=t)),s=i;return i=M(e.minus(n),r,0,1),u=u.plus(i.times(l)),n=n.plus(i.times(r)),u.s=l.s=m.s,a*=2,h=1>M(l,r,a,D).minus(m).abs().comparedTo(M(u,n,a,D).minus(m).abs())?[l,r]:[u,n],j=o,h},L.toNumber=function(){return+V(this)},L.toPrecision=function(e,t){return null!=e&&_(e,1,m),z(this,e,t,2)},L.toString=function(e){var t,n=this,r=n.s,i=n.e;return null===i?r?(t="Infinity",r<0&&(t="-"+t)):t="NaN":(null==e?t=i<=N||i>=P?S(y(n.c),i):k(y(n.c),i,"0"):10===e?(n=K(new $(n),I+i+1,D),t=k(y(n.c),n.e,"0")):(_(e,2,H.length,"Base"),t=O(k(y(n.c),i,"0"),10,e,r,!0)),r<0&&n.c[0]&&(t="-"+t)),t},L.valueOf=L.toJSON=function(){return V(this)},L._isBigNumber=!0,null!=e&&$.set(e),$}function v(e){var t=0|e;return e>0||e===t?t:t-1}function y(e){for(var t,n,r=1,i=e.length,a=e[0]+"";rc^n?1:-1;for(o=0,s=(u=i.length)<(c=a.length)?u:c;oa[o]^n?1:-1;return u==c?0:u>c^n?1:-1}function _(e,t,n,r){if(en||e!==u(e))throw Error(c+(r||"Argument")+("number"==typeof e?en?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function E(e){var t=e.c.length-1;return v(e.e/d)==t&&e.c[t]%2!=0}function S(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function k(e,t,n){var r,i;if(t<0){for(i=n+".";++t;i+=n);e=i+e}else if(r=e.length,++t>r){for(i=n,t-=r;--t;i+=n);e+=i}else ti});let i=r},48764(e,t,n){"use strict";/*! - * The buffer module from node.js, for the browser. - * - * @author Feross Aboukhadijeh - * @license MIT - */ var r=n(79742),i=n(80645),a="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=c,t.SlowBuffer=w,t.INSPECT_MAX_BYTES=50;var o=2147483647;function s(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(n){return!1}}function u(e){if(e>o)throw RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,c.prototype),t}function c(e,t,n){if("number"==typeof e){if("string"==typeof t)throw TypeError('The "string" argument must be of type string. Received type number');return h(e)}return l(e,t,n)}function l(e,t,n){if("string"==typeof e)return p(e,t);if(ArrayBuffer.isView(e))return m(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(X(e,ArrayBuffer)||e&&X(e.buffer,ArrayBuffer)||"undefined"!=typeof SharedArrayBuffer&&(X(e,SharedArrayBuffer)||e&&X(e.buffer,SharedArrayBuffer)))return g(e,t,n);if("number"==typeof e)throw TypeError('The "value" argument must not be of type number. Received type number');var r=e.valueOf&&e.valueOf();if(null!=r&&r!==e)return c.from(r,t,n);var i=v(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return c.from(e[Symbol.toPrimitive]("string"),t,n);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function f(e){if("number"!=typeof e)throw TypeError('"size" argument must be of type number');if(e<0)throw RangeError('The value "'+e+'" is invalid for option "size"')}function d(e,t,n){return(f(e),e<=0)?u(e):void 0!==t?"string"==typeof n?u(e).fill(t,n):u(e).fill(t):u(e)}function h(e){return f(e),u(e<0?0:0|y(e))}function p(e,t){if(("string"!=typeof t||""===t)&&(t="utf8"),!c.isEncoding(t))throw TypeError("Unknown encoding: "+t);var n=0|_(e,t),r=u(n),i=r.write(e,t);return i!==n&&(r=r.slice(0,i)),r}function b(e){for(var t=e.length<0?0:0|y(e.length),n=u(t),r=0;r=o)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return 0|e}function w(e){return+e!=e&&(e=0),c.alloc(+e)}function _(e,t){if(c.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||X(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var n=e.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===n)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return W(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return q(e).length;default:if(i)return r?-1:W(e).length;t=(""+t).toLowerCase(),i=!0}}function E(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length||((void 0===n||n>this.length)&&(n=this.length),n<=0||(n>>>=0)<=(t>>>=0)))return"";for(e||(e="utf8");;)switch(e){case"hex":return j(this,t,n);case"utf8":case"utf-8":return I(this,t,n);case"ascii":return P(this,t,n);case"latin1":case"binary":return R(this,t,n);case"base64":return C(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return F(this,t,n);default:if(r)throw TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function S(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function k(e,t,n,r,i){if(0===e.length)return -1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),J(n=+n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return -1;n=e.length-1}else if(n<0){if(!i)return -1;n=0}if("string"==typeof t&&(t=c.from(t,r)),c.isBuffer(t))return 0===t.length?-1:x(e,t,n,r,i);if("number"==typeof t)return(t&=255,"function"==typeof Uint8Array.prototype.indexOf)?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):x(e,[t],n,r,i);throw TypeError("val must be string, number or Buffer")}function x(e,t,n,r,i){var a,o=1,s=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return -1;o=2,s/=2,u/=2,n/=2}function c(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(i){var l=-1;for(a=n;as&&(n=s-u),a=n;a>=0;a--){for(var f=!0,d=0;di&&(r=i):r=i;var a=t.length;r>a/2&&(r=a/2);for(var o=0;o239?4:c>223?3:c>191?2:1;if(i+f<=n)switch(f){case 1:c<128&&(l=c);break;case 2:(192&(a=e[i+1]))==128&&(u=(31&c)<<6|63&a)>127&&(l=u);break;case 3:a=e[i+1],o=e[i+2],(192&a)==128&&(192&o)==128&&(u=(15&c)<<12|(63&a)<<6|63&o)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:a=e[i+1],o=e[i+2],s=e[i+3],(192&a)==128&&(192&o)==128&&(192&s)==128&&(u=(15&c)<<18|(63&a)<<12|(63&o)<<6|63&s)>65535&&u<1114112&&(l=u)}null===l?(l=65533,f=1):l>65535&&(l-=65536,r.push(l>>>10&1023|55296),l=56320|1023&l),r.push(l),i+=f}return N(r)}t.kMaxLength=o,c.TYPED_ARRAY_SUPPORT=s(),c.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(c.prototype,"parent",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.buffer}}),Object.defineProperty(c.prototype,"offset",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.byteOffset}}),c.poolSize=8192,c.from=function(e,t,n){return l(e,t,n)},Object.setPrototypeOf(c.prototype,Uint8Array.prototype),Object.setPrototypeOf(c,Uint8Array),c.alloc=function(e,t,n){return d(e,t,n)},c.allocUnsafe=function(e){return h(e)},c.allocUnsafeSlow=function(e){return h(e)},c.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==c.prototype},c.compare=function(e,t){if(X(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),X(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),!c.isBuffer(e)||!c.isBuffer(t))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var n=e.length,r=t.length,i=0,a=Math.min(n,r);ir.length?c.from(a).copy(r,i):Uint8Array.prototype.set.call(r,a,i);else if(c.isBuffer(a))a.copy(r,i);else throw TypeError('"list" argument must be an Array of Buffers');i+=a.length}return r},c.byteLength=_,c.prototype._isBuffer=!0,c.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;tn&&(e+=" ... "),""},a&&(c.prototype[a]=c.prototype.inspect),c.prototype.compare=function(e,t,n,r,i){if(X(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(e))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return -1;if(t>=n)return 1;if(t>>>=0,n>>>=0,r>>>=0,i>>>=0,this===e)return 0;for(var a=i-r,o=n-t,s=Math.min(a,o),u=this.slice(r,i),l=e.slice(t,n),f=0;f>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var i=this.length-t;if((void 0===n||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var a=!1;;)switch(r){case"hex":return T(this,e,t,n);case"utf8":case"utf-8":return M(this,e,t,n);case"ascii":case"latin1":case"binary":return O(this,e,t,n);case"base64":return A(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L(this,e,t,n);default:if(a)throw TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),a=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var D=4096;function N(e){var t=e.length;if(t<=D)return String.fromCharCode.apply(String,e);for(var n="",r=0;rr)&&(n=r);for(var i="",a=t;an)throw RangeError("Trying to access beyond buffer length")}function B(e,t,n,r,i,a){if(!c.isBuffer(e))throw TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw RangeError("Index out of range")}function U(e,t,n,r,i,a){if(n+r>e.length||n<0)throw RangeError("Index out of range")}function H(e,t,n,r,a){return t=+t,n>>>=0,a||U(e,t,n,4,34028234663852886e22,-34028234663852886e22),i.write(e,t,n,r,23,4),n+4}function $(e,t,n,r,a){return t=+t,n>>>=0,a||U(e,t,n,8,17976931348623157e292,-17976931348623157e292),i.write(e,t,n,r,52,8),n+8}c.prototype.slice=function(e,t){var n=this.length;e=~~e,t=void 0===t?n:~~t,e<0?(e+=n)<0&&(e=0):e>n&&(e=n),t<0?(t+=n)<0&&(t=0):t>n&&(t=n),t>>=0,t>>>=0,n||Y(e,t,this.length);for(var r=this[e],i=1,a=0;++a>>=0,t>>>=0,n||Y(e,t,this.length);for(var r=this[e+--t],i=1;t>0&&(i*=256);)r+=this[e+--t]*i;return r},c.prototype.readUint8=c.prototype.readUInt8=function(e,t){return e>>>=0,t||Y(e,1,this.length),this[e]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(e,t){return e>>>=0,t||Y(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(e,t){return e>>>=0,t||Y(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(e,t){return e>>>=0,t||Y(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(e,t){return e>>>=0,t||Y(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||Y(e,t,this.length);for(var r=this[e],i=1,a=0;++a=(i*=128)&&(r-=Math.pow(2,8*t)),r},c.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||Y(e,t,this.length);for(var r=t,i=1,a=this[e+--r];r>0&&(i*=256);)a+=this[e+--r]*i;return a>=(i*=128)&&(a-=Math.pow(2,8*t)),a},c.prototype.readInt8=function(e,t){return(e>>>=0,t||Y(e,1,this.length),128&this[e])?-((255-this[e]+1)*1):this[e]},c.prototype.readInt16LE=function(e,t){e>>>=0,t||Y(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt16BE=function(e,t){e>>>=0,t||Y(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt32LE=function(e,t){return e>>>=0,t||Y(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return e>>>=0,t||Y(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readFloatLE=function(e,t){return e>>>=0,t||Y(e,4,this.length),i.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||Y(e,4,this.length),i.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||Y(e,8,this.length),i.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||Y(e,8,this.length),i.read(this,e,!1,52,8)},c.prototype.writeUintLE=c.prototype.writeUIntLE=function(e,t,n,r){if(e=+e,t>>>=0,n>>>=0,!r){var i=Math.pow(2,8*n)-1;B(this,e,t,n,i,0)}var a=1,o=0;for(this[t]=255&e;++o>>=0,n>>>=0,!r){var i=Math.pow(2,8*n)-1;B(this,e,t,n,i,0)}var a=n-1,o=1;for(this[t+a]=255&e;--a>=0&&(o*=256);)this[t+a]=e/o&255;return t+n},c.prototype.writeUint8=c.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||B(this,e,t,1,255,0),this[t]=255&e,t+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||B(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||B(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||B(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||B(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var i=Math.pow(2,8*n-1);B(this,e,t,n,i-1,-i)}var a=0,o=1,s=0;for(this[t]=255&e;++a>0)-s&255;return t+n},c.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var i=Math.pow(2,8*n-1);B(this,e,t,n,i-1,-i)}var a=n-1,o=1,s=0;for(this[t+a]=255&e;--a>=0&&(o*=256);)e<0&&0===s&&0!==this[t+a+1]&&(s=1),this[t+a]=(e/o>>0)-s&255;return t+n},c.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||B(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||B(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||B(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||B(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},c.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||B(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeFloatLE=function(e,t,n){return H(this,e,t,!0,n)},c.prototype.writeFloatBE=function(e,t,n){return H(this,e,t,!1,n)},c.prototype.writeDoubleLE=function(e,t,n){return $(this,e,t,!0,n)},c.prototype.writeDoubleBE=function(e,t,n){return $(this,e,t,!1,n)},c.prototype.copy=function(e,t,n,r){if(!c.isBuffer(e))throw TypeError("argument should be a Buffer");if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw RangeError("Index out of range");if(r<0)throw RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(i=t;i55295&&n<57344){if(!i){if(n>56319||o+1===r){(t-=3)>-1&&a.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&a.push(239,191,189),i=n;continue}n=(i-55296<<10|n-56320)+65536}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;a.push(n)}else if(n<2048){if((t-=2)<0)break;a.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;a.push(n>>12|224,n>>6&63|128,63&n|128)}else if(n<1114112){if((t-=4)<0)break;a.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}else throw Error("Invalid code point")}return a}function K(e){for(var t=[],n=0;n>8,a.push(i=n%256),a.push(r);return a}function q(e){return r.toByteArray(G(e))}function Z(e,t,n,r){for(var i=0;i=t.length)&&!(i>=e.length);++i)t[i+n]=e[i];return i}function X(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function J(e){return e!=e}var Q=function(){for(var e="0123456789abcdef",t=Array(256),n=0;n<16;++n)for(var r=16*n,i=0;i<16;++i)t[r+i]=e[n]+e[i];return t}()},94184(e,t){var n,r; /*! - Copyright (c) 2018 Jed Watson. - Licensed under the MIT License (MIT), see - http://jedwatson.github.io/classnames -*/ !function(){"use strict";var i={}.hasOwnProperty;function a(){for(var e=[],t=0;t>8&255]},F=function(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]},Y=function(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]},B=function(e){return N(e,23,4)},U=function(e){return N(e,52,8)},H=function(e,t){g(e[x],t,{get:function(){return _(this)[t]}})},$=function(e,t,n,r){var i=d(n),a=_(e);if(i+t>a.byteLength)throw D(M);var o=_(a.buffer).bytes,s=i+a.byteOffset,u=o.slice(s,s+t);return r?u:u.reverse()},z=function(e,t,n,r,i,a){var o=d(n),s=_(e);if(o+t>s.byteLength)throw D(M);for(var u=_(s.buffer).bytes,c=o+s.byteOffset,l=r(+i),f=0;fV;)(G=K[V++])in A||o(A,G,O[G]);W.constructor=A}b&&p(C)!==I&&b(C,I);var q=new L(new A(2)),Z=C.setInt8;q.setInt8(0,2147483648),q.setInt8(1,2147483649),(q.getInt8(0)||!q.getInt8(1))&&s(C,{setInt8:function(e,t){Z.call(this,e,t<<24>>24)},setUint8:function(e,t){Z.call(this,e,t<<24>>24)}},{unsafe:!0})}else A=function(e){c(this,A,S);var t=d(e);E(this,{bytes:v.call(Array(t),0),byteLength:t}),i||(this.byteLength=t)},L=function(e,t,n){c(this,L,k),c(e,A,k);var r=_(e).byteLength,a=l(t);if(a<0||a>r)throw D("Wrong offset");if(n=void 0===n?r-a:f(n),a+n>r)throw D(T);E(this,{buffer:e,byteLength:n,byteOffset:a}),i||(this.buffer=e,this.byteLength=n,this.byteOffset=a)},i&&(H(A,"byteLength"),H(L,"buffer"),H(L,"byteLength"),H(L,"byteOffset")),s(L[x],{getInt8:function(e){return $(this,1,e)[0]<<24>>24},getUint8:function(e){return $(this,1,e)[0]},getInt16:function(e){var t=$(this,2,e,arguments.length>1?arguments[1]:void 0);return(t[1]<<8|t[0])<<16>>16},getUint16:function(e){var t=$(this,2,e,arguments.length>1?arguments[1]:void 0);return t[1]<<8|t[0]},getInt32:function(e){return Y($(this,4,e,arguments.length>1?arguments[1]:void 0))},getUint32:function(e){return Y($(this,4,e,arguments.length>1?arguments[1]:void 0))>>>0},getFloat32:function(e){return P($(this,4,e,arguments.length>1?arguments[1]:void 0),23)},getFloat64:function(e){return P($(this,8,e,arguments.length>1?arguments[1]:void 0),52)},setInt8:function(e,t){z(this,1,e,R,t)},setUint8:function(e,t){z(this,1,e,R,t)},setInt16:function(e,t){z(this,2,e,j,t,arguments.length>2?arguments[2]:void 0)},setUint16:function(e,t){z(this,2,e,j,t,arguments.length>2?arguments[2]:void 0)},setInt32:function(e,t){z(this,4,e,F,t,arguments.length>2?arguments[2]:void 0)},setUint32:function(e,t){z(this,4,e,F,t,arguments.length>2?arguments[2]:void 0)},setFloat32:function(e,t){z(this,4,e,B,t,arguments.length>2?arguments[2]:void 0)},setFloat64:function(e,t){z(this,8,e,U,t,arguments.length>2?arguments[2]:void 0)}});y(A,S),y(L,k),e.exports={ArrayBuffer:A,DataView:L}},1048(e,t,n){"use strict";var r=n(47908),i=n(51400),a=n(17466),o=Math.min;e.exports=[].copyWithin||function(e,t){var n=r(this),s=a(n.length),u=i(e,s),c=i(t,s),l=arguments.length>2?arguments[2]:void 0,f=o((void 0===l?s:i(l,s))-c,s-u),d=1;for(c0;)c in n?n[u]=n[c]:delete n[u],u+=d,c+=d;return n}},21285(e,t,n){"use strict";var r=n(47908),i=n(51400),a=n(17466);e.exports=function(e){for(var t=r(this),n=a(t.length),o=arguments.length,s=i(o>1?arguments[1]:void 0,n),u=o>2?arguments[2]:void 0,c=void 0===u?n:i(u,n);c>s;)t[s++]=e;return t}},18533(e,t,n){"use strict";var r=n(42092).forEach,i=n(9341)("forEach");e.exports=i?[].forEach:function(e){return r(this,e,arguments.length>1?arguments[1]:void 0)}},97745(e){e.exports=function(e,t){for(var n=0,r=t.length,i=new e(r);r>n;)i[n]=t[n++];return i}},48457(e,t,n){"use strict";var r=n(49974),i=n(47908),a=n(53411),o=n(97659),s=n(17466),u=n(86135),c=n(18554),l=n(71246);e.exports=function(e){var t,n,f,d,h,p,b=i(e),m="function"==typeof this?this:Array,g=arguments.length,v=g>1?arguments[1]:void 0,y=void 0!==v,w=l(b),_=0;if(y&&(v=r(v,g>2?arguments[2]:void 0,2)),void 0==w||m==Array&&o(w))for(t=s(b.length),n=new m(t);t>_;_++)p=y?v(b[_],_):b[_],u(n,_,p);else for(h=(d=c(b,w)).next,n=new m;!(f=h.call(d)).done;_++)p=y?a(d,v,[f.value,_],!0):f.value,u(n,_,p);return n.length=_,n}},61386(e,t,n){var r=n(49974),i=n(68361),a=n(47908),o=n(17466),s=n(34948),u=n(70030),c=n(97745),l=[].push;e.exports=function(e,t,n,f){for(var d,h,p,b=a(e),m=i(b),g=r(t,n,3),v=u(null),y=o(m.length),w=0;y>w;w++)(h=s(g(p=m[w],w,b)))in v?l.call(v[h],p):v[h]=[p];if(f&&(d=f(b))!==Array)for(h in v)v[h]=c(d,v[h]);return v}},41318(e,t,n){var r=n(45656),i=n(17466),a=n(51400),o=function(e){return function(t,n,o){var s,u=r(t),c=i(u.length),l=a(o,c);if(e&&n!=n){for(;c>l;)if((s=u[l++])!=s)return!0}else for(;c>l;l++)if((e||l in u)&&u[l]===n)return e||l||0;return!e&&-1}};e.exports={includes:o(!0),indexOf:o(!1)}},9671(e,t,n){var r=n(49974),i=n(68361),a=n(47908),o=n(17466),s=function(e){var t=1==e;return function(n,s,u){for(var c,l,f=a(n),d=i(f),h=r(s,u,3),p=o(d.length);p-- >0;)if(l=h(c=d[p],p,f))switch(e){case 0:return c;case 1:return p}return t?-1:void 0}};e.exports={findLast:s(0),findLastIndex:s(1)}},42092(e,t,n){var r=n(49974),i=n(68361),a=n(47908),o=n(17466),s=n(65417),u=[].push,c=function(e){var t=1==e,n=2==e,c=3==e,l=4==e,f=6==e,d=7==e,h=5==e||f;return function(p,b,m,g){for(var v,y,w=a(p),_=i(w),E=r(b,m,3),S=o(_.length),k=0,x=g||s,T=t?x(p,S):n||d?x(p,0):void 0;S>k;k++)if((h||k in _)&&(y=E(v=_[k],k,w),e)){if(t)T[k]=y;else if(y)switch(e){case 3:return!0;case 5:return v;case 6:return k;case 2:u.call(T,v)}else switch(e){case 4:return!1;case 7:u.call(T,v)}}return f?-1:c||l?l:T}};e.exports={forEach:c(0),map:c(1),filter:c(2),some:c(3),every:c(4),find:c(5),findIndex:c(6),filterReject:c(7)}},86583(e,t,n){"use strict";var r=n(45656),i=n(99958),a=n(17466),o=n(9341),s=Math.min,u=[].lastIndexOf,c=!!u&&1/[1].lastIndexOf(1,-0)<0,l=o("lastIndexOf"),f=c||!l;e.exports=f?function(e){if(c)return u.apply(this,arguments)||0;var t=r(this),n=a(t.length),o=n-1;for(arguments.length>1&&(o=s(o,i(arguments[1]))),o<0&&(o=n+o);o>=0;o--)if(o in t&&t[o]===e)return o||0;return -1}:u},81194(e,t,n){var r=n(47293),i=n(5112),a=n(7392),o=i("species");e.exports=function(e){return a>=51||!r(function(){var t=[];return(t.constructor={})[o]=function(){return{foo:1}},1!==t[e](Boolean).foo})}},9341(e,t,n){"use strict";var r=n(47293);e.exports=function(e,t){var n=[][e];return!!n&&r(function(){n.call(null,t||function(){throw 1},1)})}},53671(e,t,n){var r=n(13099),i=n(47908),a=n(68361),o=n(17466),s=function(e){return function(t,n,s,u){r(n);var c=i(t),l=a(c),f=o(c.length),d=e?f-1:0,h=e?-1:1;if(s<2)for(;;){if(d in l){u=l[d],d+=h;break}if(d+=h,e?d<0:f<=d)throw TypeError("Reduce of empty array with no initial value")}for(;e?d>=0:f>d;d+=h)d in l&&(u=n(u,l[d],d,c));return u}};e.exports={left:s(!1),right:s(!0)}},94362(e){var t=Math.floor,n=function(e,a){var o=e.length,s=t(o/2);return o<8?r(e,a):i(n(e.slice(0,s),a),n(e.slice(s),a),a)},r=function(e,t){for(var n,r,i=e.length,a=1;a0;)e[r]=e[--r];r!==a++&&(e[r]=n)}return e},i=function(e,t,n){for(var r=e.length,i=t.length,a=0,o=0,s=[];a=n(e[a],t[o])?e[a++]:t[o++]):s.push(a1?arguments[1]:void 0;return(r(this),(t=void 0!==c)&&r(c),void 0==e)?new this:(n=[],t?(o=0,s=i(c,u>2?arguments[2]:void 0,2),a(e,function(e){n.push(s(e,o++))})):a(e,n.push,{that:n}),new this(n))}},82044(e){"use strict";e.exports=function(){for(var e=arguments.length,t=Array(e);e--;)t[e]=arguments[e];return new this(t)}},95631(e,t,n){"use strict";var r=n(3070).f,i=n(70030),a=n(12248),o=n(49974),s=n(25787),u=n(20408),c=n(70654),l=n(96340),f=n(19781),d=n(62423).fastKey,h=n(29909),p=h.set,b=h.getterFor;e.exports={getConstructor:function(e,t,n,c){var l=e(function(e,r){s(e,l,t),p(e,{type:t,index:i(null),first:void 0,last:void 0,size:0}),f||(e.size=0),void 0!=r&&u(r,e[c],{that:e,AS_ENTRIES:n})}),h=b(t),m=function(e,t,n){var r,i,a=h(e),o=g(e,t);return o?o.value=n:(a.last=o={index:i=d(t,!0),key:t,value:n,previous:r=a.last,next:void 0,removed:!1},a.first||(a.first=o),r&&(r.next=o),f?a.size++:e.size++,"F"!==i&&(a.index[i]=o)),e},g=function(e,t){var n,r=h(e),i=d(t);if("F"!==i)return r.index[i];for(n=r.first;n;n=n.next)if(n.key==t)return n};return a(l.prototype,{clear:function(){for(var e=this,t=h(e),n=t.index,r=t.first;r;)r.removed=!0,r.previous&&(r.previous=r.previous.next=void 0),delete n[r.index],r=r.next;t.first=t.last=void 0,f?t.size=0:e.size=0},delete:function(e){var t=this,n=h(t),r=g(t,e);if(r){var i=r.next,a=r.previous;delete n.index[r.index],r.removed=!0,a&&(a.next=i),i&&(i.previous=a),n.first==r&&(n.first=i),n.last==r&&(n.last=a),f?n.size--:t.size--}return!!r},forEach:function(e){for(var t,n=h(this),r=o(e,arguments.length>1?arguments[1]:void 0,3);t=t?t.next:n.first;)for(r(t.value,t.key,this);t&&t.removed;)t=t.previous},has:function(e){return!!g(this,e)}}),a(l.prototype,n?{get:function(e){var t=g(this,e);return t&&t.value},set:function(e,t){return m(this,0===e?0:e,t)}}:{add:function(e){return m(this,e=0===e?0:e,e)}}),f&&r(l.prototype,"size",{get:function(){return h(this).size}}),l},setStrong:function(e,t,n){var r=t+" Iterator",i=b(t),a=b(r);c(e,t,function(e,t){p(this,{type:r,target:e,state:i(e),kind:t,last:void 0})},function(){for(var e=a(this),t=e.kind,n=e.last;n&&n.removed;)n=n.previous;return e.target&&(e.last=n=n?n.next:e.state.first)?"keys"==t?{value:n.key,done:!1}:"values"==t?{value:n.value,done:!1}:{value:[n.key,n.value],done:!1}:(e.target=void 0,{value:void 0,done:!0})},n?"entries":"values",!n,!0),l(t)}}},29320(e,t,n){"use strict";var r=n(12248),i=n(62423).getWeakData,a=n(19670),o=n(70111),s=n(25787),u=n(20408),c=n(42092),l=n(86656),f=n(29909),d=f.set,h=f.getterFor,p=c.find,b=c.findIndex,m=0,g=function(e){return e.frozen||(e.frozen=new v)},v=function(){this.entries=[]},y=function(e,t){return p(e.entries,function(e){return e[0]===t})};v.prototype={get:function(e){var t=y(this,e);if(t)return t[1]},has:function(e){return!!y(this,e)},set:function(e,t){var n=y(this,e);n?n[1]=t:this.entries.push([e,t])},delete:function(e){var t=b(this.entries,function(t){return t[0]===e});return~t&&this.entries.splice(t,1),!!~t}},e.exports={getConstructor:function(e,t,n,c){var f=e(function(e,r){s(e,f,t),d(e,{type:t,id:m++,frozen:void 0}),void 0!=r&&u(r,e[c],{that:e,AS_ENTRIES:n})}),p=h(t),b=function(e,t,n){var r=p(e),o=i(a(t),!0);return!0===o?g(r).set(t,n):o[r.id]=n,e};return r(f.prototype,{delete:function(e){var t=p(this);if(!o(e))return!1;var n=i(e);return!0===n?g(t).delete(e):n&&l(n,t.id)&&delete n[t.id]},has:function(e){var t=p(this);if(!o(e))return!1;var n=i(e);return!0===n?g(t).has(e):n&&l(n,t.id)}}),r(f.prototype,n?{get:function(e){var t=p(this);if(o(e)){var n=i(e);return!0===n?g(t).get(e):n?n[t.id]:void 0}},set:function(e,t){return b(this,e,t)}}:{add:function(e){return b(this,e,!0)}}),f}}},77710(e,t,n){"use strict";var r=n(82109),i=n(17854),a=n(54705),o=n(31320),s=n(62423),u=n(20408),c=n(25787),l=n(70111),f=n(47293),d=n(17072),h=n(58003),p=n(79587);e.exports=function(e,t,n){var b=-1!==e.indexOf("Map"),m=-1!==e.indexOf("Weak"),g=b?"set":"add",v=i[e],y=v&&v.prototype,w=v,_={},E=function(e){var t=y[e];o(y,e,"add"==e?function(e){return t.call(this,0===e?0:e),this}:"delete"==e?function(e){return(!m||!!l(e))&&t.call(this,0===e?0:e)}:"get"==e?function(e){return m&&!l(e)?void 0:t.call(this,0===e?0:e)}:"has"==e?function(e){return(!m||!!l(e))&&t.call(this,0===e?0:e)}:function(e,n){return t.call(this,0===e?0:e,n),this})};if(a(e,"function"!=typeof v||!(m||y.forEach&&!f(function(){new v().entries().next()}))))w=n.getConstructor(t,e,b,g),s.enable();else if(a(e,!0)){var S=new w,k=S[g](m?{}:-0,1)!=S,x=f(function(){S.has(1)}),T=d(function(e){new v(e)}),M=!m&&f(function(){for(var e=new v,t=5;t--;)e[g](t,t);return!e.has(-0)});T||((w=t(function(t,n){c(t,w,e);var r=p(new v,t,w);return void 0!=n&&u(n,r[g],{that:r,AS_ENTRIES:b}),r})).prototype=y,y.constructor=w),(x||M)&&(E("delete"),E("has"),b&&E("get")),(M||k)&&E(g),m&&y.clear&&delete y.clear}return _[e]=w,r({global:!0,forced:w!=v},_),h(w,e),m||n.setStrong(w,e,b),w}},10313(e,t,n){var r=n(51532),i=n(4129),a=n(70030),o=n(70111),s=function(){this.object=null,this.symbol=null,this.primitives=null,this.objectsByIndex=a(null)};s.prototype.get=function(e,t){return this[e]||(this[e]=t())},s.prototype.next=function(e,t,n){var a=n?this.objectsByIndex[e]||(this.objectsByIndex[e]=new i):this.primitives||(this.primitives=new r),o=a.get(t);return o||a.set(t,o=new s),o};var u=new s;e.exports=function(){var e,t,n=u,r=arguments.length;for(e=0;e"+s+""}},24994(e,t,n){"use strict";var r=n(13383).IteratorPrototype,i=n(70030),a=n(79114),o=n(58003),s=n(97497),u=function(){return this};e.exports=function(e,t,n){var c=t+" Iterator";return e.prototype=i(r,{next:a(1,n)}),o(e,c,!1,!0),s[c]=u,e}},68880(e,t,n){var r=n(19781),i=n(3070),a=n(79114);e.exports=r?function(e,t,n){return i.f(e,t,a(1,n))}:function(e,t,n){return e[t]=n,e}},79114(e){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},86135(e,t,n){"use strict";var r=n(34948),i=n(3070),a=n(79114);e.exports=function(e,t,n){var o=r(t);o in e?i.f(e,o,a(0,n)):e[o]=n}},85573(e,t,n){"use strict";var r=n(47293),i=n(76650).start,a=Math.abs,o=Date.prototype,s=o.getTime,u=o.toISOString;e.exports=r(function(){return"0385-07-25T07:06:39.999Z"!=u.call(new Date(-5e13-1))})||!r(function(){u.call(new Date(NaN))})?function(){if(!isFinite(s.call(this)))throw RangeError("Invalid time value");var e=this,t=e.getUTCFullYear(),n=e.getUTCMilliseconds(),r=t<0?"-":t>9999?"+":"";return r+i(a(t),r?6:4,0)+"-"+i(e.getUTCMonth()+1,2,0)+"-"+i(e.getUTCDate(),2,0)+"T"+i(e.getUTCHours(),2,0)+":"+i(e.getUTCMinutes(),2,0)+":"+i(e.getUTCSeconds(),2,0)+"."+i(n,3,0)+"Z"}:u},38709(e,t,n){"use strict";var r=n(19670),i=n(92140);e.exports=function(e){if(r(this),"string"===e||"default"===e)e="string";else if("number"!==e)throw TypeError("Incorrect hint");return i(this,e)}},70654(e,t,n){"use strict";var r=n(82109),i=n(24994),a=n(79518),o=n(27674),s=n(58003),u=n(68880),c=n(31320),l=n(5112),f=n(31913),d=n(97497),h=n(13383),p=h.IteratorPrototype,b=h.BUGGY_SAFARI_ITERATORS,m=l("iterator"),g="keys",v="values",y="entries",w=function(){return this};e.exports=function(e,t,n,l,h,_,E){i(n,t,l);var S,k,x,T=function(e){if(e===h&&C)return C;if(!b&&e in A)return A[e];switch(e){case g:case v:case y:return function(){return new n(this,e)}}return function(){return new n(this)}},M=t+" Iterator",O=!1,A=e.prototype,L=A[m]||A["@@iterator"]||h&&A[h],C=!b&&L||T(h),I="Array"==t&&A.entries||L;if(I&&(S=a(I.call(new e)),p!==Object.prototype&&S.next&&(f||a(S)===p||(o?o(S,p):"function"!=typeof S[m]&&u(S,m,w)),s(S,M,!0,!0),f&&(d[M]=w))),h==v&&L&&L.name!==v&&(O=!0,C=function(){return L.call(this)}),(!f||E)&&A[m]!==C&&u(A,m,C),d[t]=C,h){if(k={values:T(v),keys:_?C:T(g),entries:T(y)},E)for(x in k)!b&&!O&&x in A||c(A,x,k[x]);else r({target:t,proto:!0,forced:b||O},k)}return k}},97235(e,t,n){var r=n(40857),i=n(86656),a=n(6061),o=n(3070).f;e.exports=function(e){var t=r.Symbol||(r.Symbol={});i(t,e)||o(t,e,{value:a.f(e)})}},19781(e,t,n){var r=n(47293);e.exports=!r(function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})},80317(e,t,n){var r=n(17854),i=n(70111),a=r.document,o=i(a)&&i(a.createElement);e.exports=function(e){return o?a.createElement(e):{}}},48324(e){e.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},68886(e,t,n){var r=n(88113).match(/firefox\/(\d+)/i);e.exports=!!r&&+r[1]},7871(e){e.exports="object"==typeof window},30256(e,t,n){var r=n(88113);e.exports=/MSIE|Trident/.test(r)},71528(e,t,n){var r=n(88113),i=n(17854);e.exports=/ipad|iphone|ipod/i.test(r)&&void 0!==i.Pebble},6833(e,t,n){var r=n(88113);e.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(r)},35268(e,t,n){var r=n(84326),i=n(17854);e.exports="process"==r(i.process)},71036(e,t,n){var r=n(88113);e.exports=/web0s(?!.*chrome)/i.test(r)},88113(e,t,n){var r=n(35005);e.exports=r("navigator","userAgent")||""},7392(e,t,n){var r,i,a=n(17854),o=n(88113),s=a.process,u=a.Deno,c=s&&s.versions||u&&u.version,l=c&&c.v8;l?i=(r=l.split("."))[0]<4?1:r[0]+r[1]:o&&(!(r=o.match(/Edge\/(\d+)/))||r[1]>=74)&&(r=o.match(/Chrome\/(\d+)/))&&(i=r[1]),e.exports=i&&+i},98008(e,t,n){var r=n(88113).match(/AppleWebKit\/(\d+)\./);e.exports=!!r&&+r[1]},80748(e){e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},82109(e,t,n){var r=n(17854),i=n(31236).f,a=n(68880),o=n(31320),s=n(83505),u=n(99920),c=n(54705);e.exports=function(e,t){var n,l,f,d,h,p,b=e.target,m=e.global,g=e.stat;if(l=m?r:g?r[b]||s(b,{}):(r[b]||{}).prototype)for(f in t){if(h=t[f],d=e.noTargetGet?(p=i(l,f))&&p.value:l[f],!(n=c(m?f:b+(g?".":"#")+f,e.forced))&&void 0!==d){if(typeof h==typeof d)continue;u(h,d)}(e.sham||d&&d.sham)&&a(h,"sham",!0),o(l,f,h,e)}}},47293(e){e.exports=function(e){try{return!!e()}catch(t){return!0}}},27007(e,t,n){"use strict";n(74916);var r=n(31320),i=n(22261),a=n(47293),o=n(5112),s=n(68880),u=o("species"),c=RegExp.prototype;e.exports=function(e,t,n,l){var f=o(e),d=!a(function(){var t={};return t[f]=function(){return 7},7!=""[e](t)}),h=d&&!a(function(){var t=!1,n=/a/;return"split"===e&&((n={}).constructor={},n.constructor[u]=function(){return n},n.flags="",n[f]=/./[f]),n.exec=function(){return t=!0,null},n[f](""),!t});if(!d||!h||n){var p=/./[f],b=t(f,""[e],function(e,t,n,r,a){var o=t.exec;return o===i||o===c.exec?d&&!a?{done:!0,value:p.call(t,n,r)}:{done:!0,value:e.call(n,t,r)}:{done:!1}});r(String.prototype,e,b[0]),r(c,f,b[1])}l&&s(c[f],"sham",!0)}},6790(e,t,n){"use strict";var r=n(43157),i=n(17466),a=n(49974),o=function(e,t,n,s,u,c,l,f){for(var d,h=u,p=0,b=!!l&&a(l,f,3);p0&&r(d))h=o(e,t,d,i(d.length),h,c-1)-1;else{if(h>=9007199254740991)throw TypeError("Exceed the acceptable array length");e[h]=d}h++}p++}return h};e.exports=o},76677(e,t,n){var r=n(47293);e.exports=!r(function(){return Object.isExtensible(Object.preventExtensions({}))})},49974(e,t,n){var r=n(13099);e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 0:return function(){return e.call(t)};case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,i){return e.call(t,n,r,i)}}return function(){return e.apply(t,arguments)}}},27065(e,t,n){"use strict";var r=n(13099),i=n(70111),a=[].slice,o={},s=function(e,t,n){if(!(t in o)){for(var r=[],i=0;i]*>)/g,s=/\$([$&'`]|\d{1,2})/g;e.exports=function(e,t,n,u,c,l){var f=n+e.length,d=u.length,h=s;return void 0!==c&&(c=r(c),h=o),a.call(l,h,function(r,a){var o;switch(a.charAt(0)){case"$":return"$";case"&":return e;case"`":return t.slice(0,n);case"'":return t.slice(f);case"<":o=c[a.slice(1,-1)];break;default:var s=+a;if(0===s)return r;if(s>d){var l=i(s/10);if(0===l)return r;if(l<=d)return void 0===u[l-1]?a.charAt(1):u[l-1]+a.charAt(1);return r}o=u[s-1]}return void 0===o?"":o})}},17854(e,t,n){var r=function(e){return e&&e.Math==Math&&e};e.exports=r("object"==typeof globalThis&&globalThis)||r("object"==typeof window&&window)||r("object"==typeof self&&self)||r("object"==typeof n.g&&n.g)||function(){return this}()||Function("return this")()},86656(e,t,n){var r=n(47908),i={}.hasOwnProperty;e.exports=Object.hasOwn||function(e,t){return i.call(r(e),t)}},3501(e){e.exports={}},842(e,t,n){var r=n(17854);e.exports=function(e,t){var n=r.console;n&&n.error&&(1===arguments.length?n.error(e):n.error(e,t))}},60490(e,t,n){var r=n(35005);e.exports=r("document","documentElement")},64664(e,t,n){var r=n(19781),i=n(47293),a=n(80317);e.exports=!r&&!i(function(){return 7!=Object.defineProperty(a("div"),"a",{get:function(){return 7}}).a})},11179(e){var t=Math.abs,n=Math.pow,r=Math.floor,i=Math.log,a=Math.LN2,o=function(e,o,s){var u,c,l,f=Array(s),d=8*s-o-1,h=(1<>1,b=23===o?n(2,-24)-n(2,-77):0,m=e<0||0===e&&1/e<0?1:0,g=0;for((e=t(e))!=e||e===1/0?(c=e!=e?1:0,u=h):(u=r(i(e)/a),e*(l=n(2,-u))<1&&(u--,l*=2),u+p>=1?e+=b/l:e+=b*n(2,1-p),e*l>=2&&(u++,l/=2),u+p>=h?(c=0,u=h):u+p>=1?(c=(e*l-1)*n(2,o),u+=p):(c=e*n(2,p-1)*n(2,o),u=0));o>=8;f[g++]=255&c,c/=256,o-=8);for(u=u<0;f[g++]=255&u,u/=256,d-=8);return f[--g]|=128*m,f},s=function(e,t){var r,i=e.length,a=8*i-t-1,o=(1<>1,u=a-7,c=i-1,l=e[c--],f=127&l;for(l>>=7;u>0;f=256*f+e[c],c--,u-=8);for(r=f&(1<<-u)-1,f>>=-u,u+=t;u>0;r=256*r+e[c],c--,u-=8);if(0===f)f=1-s;else{if(f===o)return r?NaN:l?-1/0:1/0;r+=n(2,t),f-=s}return(l?-1:1)*r*n(2,f-t)};e.exports={pack:o,unpack:s}},68361(e,t,n){var r=n(47293),i=n(84326),a="".split;e.exports=r(function(){return!Object("z").propertyIsEnumerable(0)})?function(e){return"String"==i(e)?a.call(e,""):Object(e)}:Object},79587(e,t,n){var r=n(70111),i=n(27674);e.exports=function(e,t,n){var a,o;return i&&"function"==typeof(a=t.constructor)&&a!==n&&r(o=a.prototype)&&o!==n.prototype&&i(e,o),e}},42788(e,t,n){var r=n(5465),i=Function.toString;"function"!=typeof r.inspectSource&&(r.inspectSource=function(e){return i.call(e)}),e.exports=r.inspectSource},62423(e,t,n){var r=n(82109),i=n(3501),a=n(70111),o=n(86656),s=n(3070).f,u=n(8006),c=n(1156),l=n(69711),f=n(76677),d=!1,h=l("meta"),p=0,b=Object.isExtensible||function(){return!0},m=function(e){s(e,h,{value:{objectID:"O"+p++,weakData:{}}})},g=function(e,t){if(!a(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!o(e,h)){if(!b(e))return"F";if(!t)return"E";m(e)}return e[h].objectID},v=function(e,t){if(!o(e,h)){if(!b(e))return!0;if(!t)return!1;m(e)}return e[h].weakData},y=function(e){return f&&d&&b(e)&&!o(e,h)&&m(e),e},w=function(){_.enable=function(){},d=!0;var e=u.f,t=[].splice,n={};n[h]=1,e(n).length&&(u.f=function(n){for(var r=e(n),i=0,a=r.length;ih;h++)if((b=k(e[h]))&&b instanceof l)return b;return new l(!1)}f=s(e,d)}for(m=f.next;!(g=m.call(f)).done;){try{b=k(g.value)}catch(x){c(f,"throw",x)}if("object"==typeof b&&b&&b instanceof l)return b}return new l(!1)}},99212(e,t,n){var r=n(19670);e.exports=function(e,t,n){var i,a;r(e);try{if(void 0===(i=e.return)){if("throw"===t)throw n;return n}i=i.call(e)}catch(o){a=!0,i=o}if("throw"===t)throw n;if(a)throw i;return r(i),n}},54956(e,t,n){"use strict";var r=n(40857),i=n(13099),a=n(19670),o=n(70030),s=n(68880),u=n(12248),c=n(5112),l=n(29909),f=l.set,d=l.get,h=c("toStringTag");e.exports=function(e,t){var n=function(e){e.next=i(e.iterator.next),e.done=!1,e.ignoreArg=!t,f(this,e)};return n.prototype=u(o(r.Iterator.prototype),{next:function(n){var r=d(this),i=arguments.length?[r.ignoreArg?void 0:n]:t?[]:[void 0];r.ignoreArg=!1;var a=r.done?void 0:e.call(r,i);return{done:r.done,value:a}},return:function(e){var t=d(this).iterator;t.done=!0;var n=t.return;return{done:!0,value:void 0===n?e:a(n.call(t,e)).value}},throw:function(e){var t=d(this).iterator;t.done=!0;var n=t.throw;if(void 0===n)throw e;return n.call(t,e)}}),t||s(n.prototype,h,"Generator"),n}},13383(e,t,n){"use strict";var r,i,a,o=n(47293),s=n(79518),u=n(68880),c=n(86656),l=n(5112),f=n(31913),d=l("iterator"),h=!1,p=function(){return this};[].keys&&("next"in(a=[].keys())?(i=s(s(a)))!==Object.prototype&&(r=i):h=!0);var b=void 0==r||o(function(){var e={};return r[d].call(e)!==e});b&&(r={}),f&&!b||c(r,d)||u(r,d,p),e.exports={IteratorPrototype:r,BUGGY_SAFARI_ITERATORS:h}},97497(e){e.exports={}},37502(e,t,n){"use strict";var r=n(19670);e.exports=function(e,t){var n=r(this),i=n.has(e)&&"update"in t?t.update(n.get(e),e,n):t.insert(e,n);return n.set(e,i),i}},8154(e,t,n){"use strict";var r=n(19670);e.exports=function(e,t){var n,i=r(this),a=arguments.length>2?arguments[2]:void 0;if("function"!=typeof t&&"function"!=typeof a)throw TypeError("At least one callback required");return i.has(e)?(n=i.get(e),"function"==typeof t&&(n=t(n),i.set(e,n))):"function"==typeof a&&(n=a(),i.set(e,n)),n}},66736(e){var t=Math.expm1,n=Math.exp;e.exports=!t||t(10)>22025.465794806718||22025.465794806718>t(10)||-.00000000000000002!=t(-.00000000000000002)?function(e){return 0==(e=+e)?e:e>-.000001&&e<1e-6?e+e*e/2:n(e)-1}:t},26130(e,t,n){var r=n(64310),i=Math.abs,a=Math.pow,o=a(2,-52),s=a(2,-23),u=a(2,127)*(2-s),c=a(2,-126),l=function(e){return e+1/o-1/o};e.exports=Math.fround||function(e){var t,n,a=i(e),f=r(e);return au||n!=n?f*(1/0):f*n}},26513(e){var t=Math.log;e.exports=Math.log1p||function(e){return(e=+e)>-.00000001&&e<1e-8?e-e*e/2:t(1+e)}},47103(e){e.exports=Math.scale||function(e,t,n,r,i){return 0===arguments.length||e!=e||t!=t||n!=n||r!=r||i!=i?NaN:e===1/0||e===-1/0?e:(e-t)*(i-r)/(n-t)+r}},64310(e){e.exports=Math.sign||function(e){return 0==(e=+e)||e!=e?e:e<0?-1:1}},95948(e,t,n){var r,i,a,o,s,u,c,l,f=n(17854),d=n(31236).f,h=n(20261).set,p=n(6833),b=n(71528),m=n(71036),g=n(35268),v=f.MutationObserver||f.WebKitMutationObserver,y=f.document,w=f.process,_=f.Promise,E=d(f,"queueMicrotask"),S=E&&E.value;S||(r=function(){var e,t;for(g&&(e=w.domain)&&e.exit();i;){t=i.fn,i=i.next;try{t()}catch(n){throw i?o():a=void 0,n}}a=void 0,e&&e.enter()},p||g||m||!v||!y?!b&&_&&_.resolve?((c=_.resolve(void 0)).constructor=_,l=c.then,o=function(){l.call(c,r)}):o=g?function(){w.nextTick(r)}:function(){h.call(f,r)}:(s=!0,u=y.createTextNode(""),new v(r).observe(u,{characterData:!0}),o=function(){u.data=s=!s})),e.exports=S||function(e){var t={fn:e,next:void 0};a&&(a.next=t),i||(i=t,o()),a=t}},13366(e,t,n){var r=n(17854);e.exports=r.Promise},30133(e,t,n){var r=n(7392),i=n(47293);e.exports=!!Object.getOwnPropertySymbols&&!i(function(){var e=Symbol();return!String(e)||!(Object(e) instanceof Symbol)||!Symbol.sham&&r&&r<41})},590(e,t,n){var r=n(47293),i=n(5112),a=n(31913),o=i("iterator");e.exports=!r(function(){var e=new URL("b?a=1&b=2&c=3","http://a"),t=e.searchParams,n="";return e.pathname="c%20d",t.forEach(function(e,r){t.delete("b"),n+=r+e}),a&&!e.toJSON||!t.sort||"http://a/c%20d?a=1&c=3"!==e.href||"3"!==t.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!t[o]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("http://тест").host||"#%D0%B1"!==new URL("http://a#б").hash||"a1c3"!==n||"x"!==new URL("http://x",void 0).host})},68536(e,t,n){var r=n(17854),i=n(42788),a=r.WeakMap;e.exports="function"==typeof a&&/native code/.test(i(a))},78523(e,t,n){"use strict";var r=n(13099),i=function(e){var t,n;this.promise=new e(function(e,r){if(void 0!==t||void 0!==n)throw TypeError("Bad Promise constructor");t=e,n=r}),this.resolve=r(t),this.reject=r(n)};e.exports.f=function(e){return new i(e)}},3929(e,t,n){var r=n(47850);e.exports=function(e){if(r(e))throw TypeError("The method doesn't accept regular expressions");return e}},77023(e,t,n){var r=n(17854).isFinite;e.exports=Number.isFinite||function(e){return"number"==typeof e&&r(e)}},2814(e,t,n){var r=n(17854),i=n(41340),a=n(53111).trim,o=n(81361),s=r.parseFloat,u=1/s(o+"-0")!=-1/0;e.exports=u?function(e){var t=a(i(e)),n=s(t);return 0===n&&"-"==t.charAt(0)?-0:n}:s},83009(e,t,n){var r=n(17854),i=n(41340),a=n(53111).trim,o=n(81361),s=r.parseInt,u=/^[+-]?0[Xx]/,c=8!==s(o+"08")||22!==s(o+"0x16");e.exports=c?function(e,t){var n=a(i(e));return s(n,t>>>0||(u.test(n)?16:10))}:s},80430(e,t,n){"use strict";var r=n(29909),i=n(24994),a=n(70111),o=n(36048),s=n(19781),u="Incorrect Number.range arguments",c="NumericRangeIterator",l=r.set,f=r.getterFor(c),d=i(function(e,t,n,r,i,o){if(typeof e!=r||t!==1/0&&t!==-1/0&&typeof t!=r)throw TypeError(u);if(e===1/0||e===-1/0)throw RangeError(u);var f,d=t>e,h=!1;if(void 0===n)f=void 0;else if(a(n))f=n.step,h=!!n.inclusive;else if(typeof n==r)f=n;else throw TypeError(u);if(null==f&&(f=d?o:-o),typeof f!=r)throw TypeError(u);if(f===1/0||f===-1/0||f===i&&e!==t)throw RangeError(u);var p=e!=e||t!=t||f!=f||t>e!=f>i;l(this,{type:c,start:e,end:t,step:f,inclusiveEnd:h,hitsEnd:p,currentCount:i,zero:i}),s||(this.start=e,this.end=t,this.step=f,this.inclusive=h)},c,function(){var e,t=f(this);if(t.hitsEnd)return{value:void 0,done:!0};var n=t.start,r=t.end,i=n+t.step*t.currentCount++;i===r&&(t.hitsEnd=!0);var a=t.inclusiveEnd;return(e=r>n?a?i>r:i>=r:a?r>i:r>=i)?{value:void 0,done:t.hitsEnd=!0}:{value:i,done:!1}}),h=function(e){return{get:e,set:function(){},configurable:!0,enumerable:!1}};s&&o(d.prototype,{start:h(function(){return f(this).start}),end:h(function(){return f(this).end}),inclusive:h(function(){return f(this).inclusiveEnd}),step:h(function(){return f(this).step})}),e.exports=d},21574(e,t,n){"use strict";var r=n(19781),i=n(47293),a=n(81956),o=n(25181),s=n(55296),u=n(47908),c=n(68361),l=Object.assign,f=Object.defineProperty;e.exports=!l||i(function(){if(r&&1!==l({b:1},l(f({},"a",{enumerable:!0,get:function(){f(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},n=Symbol(),i="abcdefghijklmnopqrst";return e[n]=7,i.split("").forEach(function(e){t[e]=e}),7!=l({},e)[n]||a(l({},t)).join("")!=i})?function(e,t){for(var n=u(e),i=arguments.length,l=1,f=o.f,d=s.f;i>l;)for(var h,p=c(arguments[l++]),b=f?a(p).concat(f(p)):a(p),m=b.length,g=0;m>g;)h=b[g++],(!r||d.call(p,h))&&(n[h]=p[h]);return n}:l},70030(e,t,n){var r,i=n(19670),a=n(36048),o=n(80748),s=n(3501),u=n(60490),c=n(80317),l=n(6200),f=">",d="<",h="prototype",p="script",b=l("IE_PROTO"),m=function(){},g=function(e){return d+p+f+e+d+"/"+p+f},v=function(e){e.write(g("")),e.close();var t=e.parentWindow.Object;return e=null,t},y=function(){var e,t=c("iframe"),n="java"+p+":";return t.style.display="none",u.appendChild(t),t.src=String(n),(e=t.contentWindow.document).open(),e.write(g("document.F=Object")),e.close(),e.F},w=function(){try{r=new ActiveXObject("htmlfile")}catch(e){}w="undefined"!=typeof document?document.domain&&r?v(r):y():v(r);for(var t=o.length;t--;)delete w[h][o[t]];return w()};s[b]=!0,e.exports=Object.create||function(e,t){var n;return null!==e?(m[h]=i(e),n=new m,m[h]=null,n[b]=e):n=w(),void 0===t?n:a(n,t)}},36048(e,t,n){var r=n(19781),i=n(3070),a=n(19670),o=n(81956);e.exports=r?Object.defineProperties:function(e,t){a(e);for(var n,r=o(t),s=r.length,u=0;s>u;)i.f(e,n=r[u++],t[n]);return e}},3070(e,t,n){var r=n(19781),i=n(64664),a=n(19670),o=n(34948),s=Object.defineProperty;t.f=r?s:function(e,t,n){if(a(e),t=o(t),a(n),i)try{return s(e,t,n)}catch(r){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(e[t]=n.value),e}},31236(e,t,n){var r=n(19781),i=n(55296),a=n(79114),o=n(45656),s=n(34948),u=n(86656),c=n(64664),l=Object.getOwnPropertyDescriptor;t.f=r?l:function(e,t){if(e=o(e),t=s(t),c)try{return l(e,t)}catch(n){}if(u(e,t))return a(!i.f.call(e,t),e[t])}},1156(e,t,n){var r=n(45656),i=n(8006).f,a={}.toString,o="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],s=function(e){try{return i(e)}catch(t){return o.slice()}};e.exports.f=function(e){return o&&"[object Window]"==a.call(e)?s(e):i(r(e))}},8006(e,t,n){var r=n(16324),i=n(80748).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return r(e,i)}},25181(e,t){t.f=Object.getOwnPropertySymbols},79518(e,t,n){var r=n(86656),i=n(47908),a=n(6200),o=n(49920),s=a("IE_PROTO"),u=Object.prototype;e.exports=o?Object.getPrototypeOf:function(e){return(e=i(e),r(e,s))?e[s]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?u:null}},60996(e,t,n){"use strict";var r=n(29909),i=n(24994),a=n(86656),o=n(81956),s=n(47908),u="Object Iterator",c=r.set,l=r.getterFor(u);e.exports=i(function(e,t){var n=s(e);c(this,{type:u,mode:t,object:n,keys:o(n),index:0})},"Object",function(){for(var e=l(this),t=e.keys;;){if(null===t||e.index>=t.length)return e.object=e.keys=null,{value:void 0,done:!0};var n=t[e.index++],r=e.object;if(a(r,n)){switch(e.mode){case"keys":return{value:n,done:!1};case"values":return{value:r[n],done:!1}}return{value:[n,r[n]],done:!1}}}})},16324(e,t,n){var r=n(86656),i=n(45656),a=n(41318).indexOf,o=n(3501);e.exports=function(e,t){var n,s=i(e),u=0,c=[];for(n in s)!r(o,n)&&r(s,n)&&c.push(n);for(;t.length>u;)r(s,n=t[u++])&&(~a(c,n)||c.push(n));return c}},81956(e,t,n){var r=n(16324),i=n(80748);e.exports=Object.keys||function(e){return r(e,i)}},55296(e,t){"use strict";var n={}.propertyIsEnumerable,r=Object.getOwnPropertyDescriptor,i=r&&!n.call({1:2},1);t.f=i?function(e){var t=r(this,e);return!!t&&t.enumerable}:n},69026(e,t,n){"use strict";var r=n(31913),i=n(17854),a=n(47293),o=n(98008);e.exports=r||!a(function(){if(!o||!(o<535)){var e=Math.random();__defineSetter__.call(null,e,function(){}),delete i[e]}})},27674(e,t,n){var r=n(19670),i=n(96077);e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{(e=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(n,[]),t=n instanceof Array}catch(a){}return function(n,a){return r(n),i(a),t?e.call(n,a):n.__proto__=a,n}}():void 0)},44699(e,t,n){var r=n(19781),i=n(81956),a=n(45656),o=n(55296).f,s=function(e){return function(t){for(var n,s=a(t),u=i(s),c=u.length,l=0,f=[];c>l;)n=u[l++],(!r||o.call(s,n))&&f.push(e?[n,s[n]]:s[n]);return f}};e.exports={entries:s(!0),values:s(!1)}},90288(e,t,n){"use strict";var r=n(51694),i=n(70648);e.exports=r?({}).toString:function(){return"[object "+i(this)+"]"}},92140(e,t,n){var r=n(70111);e.exports=function(e,t){var n,i;if("string"===t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e))||"function"==typeof(n=e.valueOf)&&!r(i=n.call(e))||"string"!==t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;throw TypeError("Can't convert object to primitive value")}},53887(e,t,n){var r=n(35005),i=n(8006),a=n(25181),o=n(19670);e.exports=r("Reflect","ownKeys")||function(e){var t=i.f(o(e)),n=a.f;return n?t.concat(n(e)):t}},40857(e,t,n){var r=n(17854);e.exports=r},12534(e){e.exports=function(e){try{return{error:!1,value:e()}}catch(t){return{error:!0,value:t}}}},69478(e,t,n){var r=n(19670),i=n(70111),a=n(78523);e.exports=function(e,t){if(r(e),i(t)&&t.constructor===e)return t;var n=a.f(e);return(0,n.resolve)(t),n.promise}},12248(e,t,n){var r=n(31320);e.exports=function(e,t,n){for(var i in t)r(e,i,t[i],n);return e}},31320(e,t,n){var r=n(17854),i=n(68880),a=n(86656),o=n(83505),s=n(42788),u=n(29909),c=u.get,l=u.enforce,f=String(String).split("String");(e.exports=function(e,t,n,s){var u,c=!!s&&!!s.unsafe,d=!!s&&!!s.enumerable,h=!!s&&!!s.noTargetGet;if("function"!=typeof n||("string"!=typeof t||a(n,"name")||i(n,"name",t),(u=l(n)).source||(u.source=f.join("string"==typeof t?t:""))),e===r){d?e[t]=n:o(t,n);return}c?!h&&e[t]&&(d=!0):delete e[t],d?e[t]=n:i(e,t,n)})(Function.prototype,"toString",function(){return"function"==typeof this&&c(this).source||s(this)})},38845(e,t,n){var r=n(51532),i=n(4129),a=n(72309)("metadata"),o=a.store||(a.store=new i),s=function(e,t,n){var i=o.get(e);if(!i){if(!n)return;o.set(e,i=new r)}var a=i.get(t);if(!a){if(!n)return;i.set(t,a=new r)}return a},u=function(e,t,n){var r=s(t,n,!1);return void 0!==r&&r.has(e)},c=function(e,t,n){var r=s(t,n,!1);return void 0===r?void 0:r.get(e)},l=function(e,t,n,r){s(n,r,!0).set(e,t)},f=function(e,t){var n=s(e,t,!1),r=[];return n&&n.forEach(function(e,t){r.push(t)}),r},d=function(e){return void 0===e||"symbol"==typeof e?e:String(e)};e.exports={store:o,getMap:s,has:u,get:c,set:l,keys:f,toKey:d}},97651(e,t,n){var r=n(84326),i=n(22261);e.exports=function(e,t){var n=e.exec;if("function"==typeof n){var a=n.call(e,t);if("object"!=typeof a)throw TypeError("RegExp exec method returned something other than an Object or null");return a}if("RegExp"!==r(e))throw TypeError("RegExp#exec called on incompatible receiver");return i.call(e,t)}},22261(e,t,n){"use strict";var r,i,a=n(41340),o=n(67066),s=n(52999),u=n(72309),c=n(70030),l=n(29909).get,f=n(9441),d=n(38173),h=RegExp.prototype.exec,p=u("native-string-replace",String.prototype.replace),b=h,m=(r=/a/,i=/b*/g,h.call(r,"a"),h.call(i,"a"),0!==r.lastIndex||0!==i.lastIndex),g=s.UNSUPPORTED_Y||s.BROKEN_CARET,v=void 0!==/()??/.exec("")[1];(m||v||g||f||d)&&(b=function(e){var t,n,r,i,s,u,f,d=this,y=l(d),w=a(e),_=y.raw;if(_)return _.lastIndex=d.lastIndex,t=b.call(_,w),d.lastIndex=_.lastIndex,t;var E=y.groups,S=g&&d.sticky,k=o.call(d),x=d.source,T=0,M=w;if(S&&(-1===(k=k.replace("y","")).indexOf("g")&&(k+="g"),M=w.slice(d.lastIndex),d.lastIndex>0&&(!d.multiline||d.multiline&&"\n"!==w.charAt(d.lastIndex-1))&&(x="(?: "+x+")",M=" "+M,T++),n=RegExp("^(?:"+x+")",k)),v&&(n=RegExp("^"+x+"$(?!\\s)",k)),m&&(r=d.lastIndex),i=h.call(S?n:d,M),S?i?(i.input=i.input.slice(T),i[0]=i[0].slice(T),i.index=d.lastIndex,d.lastIndex+=i[0].length):d.lastIndex=0:m&&i&&(d.lastIndex=d.global?i.index+i[0].length:r),v&&i&&i.length>1&&p.call(i[0],n,function(){for(s=1;sb)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$
c")})},84488(e){e.exports=function(e){if(void 0==e)throw TypeError("Can't call method on "+e);return e}},46465(e){e.exports=function(e,t){return e===t||e!=e&&t!=t}},81150(e){e.exports=Object.is||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}},83505(e,t,n){var r=n(17854);e.exports=function(e,t){try{Object.defineProperty(r,e,{value:t,configurable:!0,writable:!0})}catch(n){r[e]=t}return t}},96340(e,t,n){"use strict";var r=n(35005),i=n(3070),a=n(5112),o=n(19781),s=a("species");e.exports=function(e){var t=r(e),n=i.f;o&&t&&!t[s]&&n(t,s,{configurable:!0,get:function(){return this}})}},58003(e,t,n){var r=n(3070).f,i=n(86656),a=n(5112)("toStringTag");e.exports=function(e,t,n){e&&!i(e=n?e:e.prototype,a)&&r(e,a,{configurable:!0,value:t})}},6200(e,t,n){var r=n(72309),i=n(69711),a=r("keys");e.exports=function(e){return a[e]||(a[e]=i(e))}},5465(e,t,n){var r=n(17854),i=n(83505),a="__core-js_shared__",o=r[a]||i(a,{});e.exports=o},72309(e,t,n){var r=n(31913),i=n(5465);(e.exports=function(e,t){return i[e]||(i[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.17.0",mode:r?"pure":"global",copyright:"\xa9 2021 Denis Pushkarev (zloirock.ru)"})},36707(e,t,n){var r=n(19670),i=n(13099),a=n(5112)("species");e.exports=function(e,t){var n,o=r(e).constructor;return void 0===o||void 0==(n=r(o)[a])?t:i(n)}},43429(e,t,n){var r=n(47293);e.exports=function(e){return r(function(){var t=""[e]('"');return t!==t.toLowerCase()||t.split('"').length>3})}},28710(e,t,n){var r=n(99958),i=n(41340),a=n(84488),o=function(e){return function(t,n){var o,s,u=i(a(t)),c=r(n),l=u.length;return c<0||c>=l?e?"":void 0:(o=u.charCodeAt(c))<55296||o>56319||c+1===l||(s=u.charCodeAt(c+1))<56320||s>57343?e?u.charAt(c):o:e?u.slice(c,c+2):(o-55296<<10)+(s-56320)+65536}};e.exports={codeAt:o(!1),charAt:o(!0)}},54986(e,t,n){var r=n(88113);e.exports=/Version\/10(?:\.\d+){1,2}(?: [\w./]+)?(?: Mobile\/\w+)? Safari\//.test(r)},76650(e,t,n){var r=n(17466),i=n(41340),a=n(38415),o=n(84488),s=Math.ceil,u=function(e){return function(t,n,u){var c,l,f=i(o(t)),d=f.length,h=void 0===u?" ":i(u),p=r(n);return p<=d||""==h?f:(c=p-d,(l=a.call(h,s(c/h.length))).length>c&&(l=l.slice(0,c)),e?f+l:l+f)}};e.exports={start:u(!1),end:u(!0)}},33197(e){"use strict";var t=2147483647,n=36,r=1,i=26,a=38,o=700,s=72,u=128,c="-",l=/[^\0-\u007E]/,f=/[.\u3002\uFF0E\uFF61]/g,d="Overflow: input needs wider integers to process",h=n-r,p=Math.floor,b=String.fromCharCode,m=function(e){for(var t=[],n=0,r=e.length;n=55296&&i<=56319&&n>1,e+=p(e/t);e>h*i>>1;s+=n)e=p(e/h);return p(s+(h+1)*e/(e+a))},y=function(e){var a,o,l=[],f=(e=m(e)).length,h=u,y=0,w=s;for(a=0;a=h&&op((t-y)/k))throw RangeError(d);for(y+=(S-h)*k,h=S,a=0;at)throw RangeError(d);if(o==h){for(var x=y,T=n;;T+=n){var M=T<=w?r:T>=w+i?i:T-w;if(x0;(o>>>=1)&&(t+=t))1&o&&(n+=t);return n}},76091(e,t,n){var r=n(47293),i=n(81361),a="​\x85᠎";e.exports=function(e){return r(function(){return!!i[e]()||a[e]()!=a||i[e].name!==e})}},53111(e,t,n){var r=n(84488),i=n(41340),a="["+n(81361)+"]",o=RegExp("^"+a+a+"*"),s=RegExp(a+a+"*$"),u=function(e){return function(t){var n=i(r(t));return 1&e&&(n=n.replace(o,"")),2&e&&(n=n.replace(s,"")),n}};e.exports={start:u(1),end:u(2),trim:u(3)}},20261(e,t,n){var r,i,a,o,s=n(17854),u=n(47293),c=n(49974),l=n(60490),f=n(80317),d=n(6833),h=n(35268),p=s.setImmediate,b=s.clearImmediate,m=s.process,g=s.MessageChannel,v=s.Dispatch,y=0,w={},_="onreadystatechange";try{r=s.location}catch(E){}var S=function(e){if(w.hasOwnProperty(e)){var t=w[e];delete w[e],t()}},k=function(e){return function(){S(e)}},x=function(e){S(e.data)},T=function(e){s.postMessage(String(e),r.protocol+"//"+r.host)};p&&b||(p=function(e){for(var t=[],n=arguments.length,r=1;n>r;)t.push(arguments[r++]);return w[++y]=function(){("function"==typeof e?e:Function(e)).apply(void 0,t)},i(y),y},b=function(e){delete w[e]},h?i=function(e){m.nextTick(k(e))}:v&&v.now?i=function(e){v.now(k(e))}:g&&!d?(o=(a=new g).port2,a.port1.onmessage=x,i=c(o.postMessage,o,1)):s.addEventListener&&"function"==typeof postMessage&&!s.importScripts&&r&&"file:"!==r.protocol&&!u(T)?(i=T,s.addEventListener("message",x,!1)):i=_ in f("script")?function(e){l.appendChild(f("script"))[_]=function(){l.removeChild(this),S(e)}}:function(e){setTimeout(k(e),0)}),e.exports={set:p,clear:b}},50863(e,t,n){var r=n(84326);e.exports=function(e){if("number"!=typeof e&&"Number"!=r(e))throw TypeError("Incorrect invocation");return+e}},51400(e,t,n){var r=n(99958),i=Math.max,a=Math.min;e.exports=function(e,t){var n=r(e);return n<0?i(n+t,0):a(n,t)}},57067(e,t,n){var r=n(99958),i=n(17466);e.exports=function(e){if(void 0===e)return 0;var t=r(e),n=i(t);if(t!==n)throw RangeError("Wrong length or index");return n}},45656(e,t,n){var r=n(68361),i=n(84488);e.exports=function(e){return r(i(e))}},99958(e){var t=Math.ceil,n=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?n:t)(e)}},17466(e,t,n){var r=n(99958),i=Math.min;e.exports=function(e){return e>0?i(r(e),9007199254740991):0}},47908(e,t,n){var r=n(84488);e.exports=function(e){return Object(r(e))}},84590(e,t,n){var r=n(73002);e.exports=function(e,t){var n=r(e);if(n%t)throw RangeError("Wrong offset");return n}},73002(e,t,n){var r=n(99958);e.exports=function(e){var t=r(e);if(t<0)throw RangeError("The argument can't be less than 0");return t}},57593(e,t,n){var r=n(70111),i=n(52190),a=n(92140),o=n(5112)("toPrimitive");e.exports=function(e,t){if(!r(e)||i(e))return e;var n,s=e[o];if(void 0!==s){if(void 0===t&&(t="default"),!r(n=s.call(e,t))||i(n))return n;throw TypeError("Can't convert object to primitive value")}return void 0===t&&(t="number"),a(e,t)}},34948(e,t,n){var r=n(57593),i=n(52190);e.exports=function(e){var t=r(e,"string");return i(t)?t:String(t)}},51694(e,t,n){var r=n(5112)("toStringTag"),i={};i[r]="z",e.exports="[object z]"===String(i)},41340(e,t,n){var r=n(52190);e.exports=function(e){if(r(e))throw TypeError("Cannot convert a Symbol value to a string");return String(e)}},19843(e,t,n){"use strict";var r=n(82109),i=n(17854),a=n(19781),o=n(63832),s=n(90260),u=n(13331),c=n(25787),l=n(79114),f=n(68880),d=n(18730),h=n(17466),p=n(57067),b=n(84590),m=n(34948),g=n(86656),v=n(70648),y=n(70111),w=n(52190),_=n(70030),E=n(27674),S=n(8006).f,k=n(97321),x=n(42092).forEach,T=n(96340),M=n(3070),O=n(31236),A=n(29909),L=n(79587),C=A.get,I=A.set,D=M.f,N=O.f,P=Math.round,R=i.RangeError,j=u.ArrayBuffer,F=u.DataView,Y=s.NATIVE_ARRAY_BUFFER_VIEWS,B=s.TYPED_ARRAY_CONSTRUCTOR,U=s.TYPED_ARRAY_TAG,H=s.TypedArray,$=s.TypedArrayPrototype,z=s.aTypedArrayConstructor,G=s.isTypedArray,W="BYTES_PER_ELEMENT",K="Wrong length",V=function(e,t){for(var n=0,r=t.length,i=new(z(e))(r);r>n;)i[n]=t[n++];return i},q=function(e,t){D(e,t,{get:function(){return C(this)[t]}})},Z=function(e){var t;return e instanceof j||"ArrayBuffer"==(t=v(e))||"SharedArrayBuffer"==t},X=function(e,t){return G(e)&&!w(t)&&t in e&&d(+t)&&t>=0},J=function(e,t){return t=m(t),X(e,t)?l(2,e[t]):N(e,t)},Q=function(e,t,n){return(t=m(t),X(e,t)&&y(n)&&g(n,"value")&&!g(n,"get")&&!g(n,"set")&&!n.configurable&&(!g(n,"writable")||n.writable)&&(!g(n,"enumerable")||n.enumerable))?(e[t]=n.value,e):D(e,t,n)};a?(Y||(O.f=J,M.f=Q,q($,"buffer"),q($,"byteOffset"),q($,"byteLength"),q($,"length")),r({target:"Object",stat:!0,forced:!Y},{getOwnPropertyDescriptor:J,defineProperty:Q}),e.exports=function(e,t,n){var a=e.match(/\d+$/)[0]/8,s=e+(n?"Clamped":"")+"Array",u="get"+e,l="set"+e,d=i[s],m=d,g=m&&m.prototype,v={},w=function(e,t){var n=C(e);return n.view[u](t*a+n.byteOffset,!0)},M=function(e,t,r){var i=C(e);n&&(r=(r=P(r))<0?0:r>255?255:255&r),i.view[l](t*a+i.byteOffset,r,!0)},O=function(e,t){D(e,t,{get:function(){return w(this,t)},set:function(e){return M(this,t,e)},enumerable:!0})};Y?o&&(m=t(function(e,t,n,r){return c(e,m,s),L(y(t)?Z(t)?void 0!==r?new d(t,b(n,a),r):void 0!==n?new d(t,b(n,a)):new d(t):G(t)?V(m,t):k.call(m,t):new d(p(t)),e,m)}),E&&E(m,H),x(S(d),function(e){e in m||f(m,e,d[e])}),m.prototype=g):(m=t(function(e,t,n,r){c(e,m,s);var i,o,u,l=0,f=0;if(y(t)){if(Z(t)){i=t,f=b(n,a);var d=t.byteLength;if(void 0===r){if(d%a||(o=d-f)<0)throw R(K)}else if((o=h(r)*a)+f>d)throw R(K);u=o/a}else if(G(t))return V(m,t);else return k.call(m,t)}else o=(u=p(t))*a,i=new j(o);for(I(e,{buffer:i,byteOffset:f,byteLength:o,length:u,view:new F(i)});l1?arguments[1]:void 0,g=void 0!==m,v=o(p);if(void 0!=v&&!s(v))for(h=(d=a(p,v)).next,p=[];!(f=h.call(d)).done;)p.push(f.value);for(g&&b>2&&(m=u(m,arguments[2],2)),n=i(p.length),l=new(c(this))(n),t=0;n>t;t++)l[t]=g?m(p[t],t):p[t];return l}},66304(e,t,n){var r=n(90260),i=n(36707),a=r.TYPED_ARRAY_CONSTRUCTOR,o=r.aTypedArrayConstructor;e.exports=function(e){return o(i(e,e[a]))}},69711(e){var t=0,n=Math.random();e.exports=function(e){return"Symbol("+String(void 0===e?"":e)+")_"+(++t+n).toString(36)}},43307(e,t,n){var r=n(30133);e.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},6061(e,t,n){var r=n(5112);t.f=r},5112(e,t,n){var r=n(17854),i=n(72309),a=n(86656),o=n(69711),s=n(30133),u=n(43307),c=i("wks"),l=r.Symbol,f=u?l:l&&l.withoutSetter||o;e.exports=function(e){return a(c,e)&&(s||"string"==typeof c[e])||(s&&a(l,e)?c[e]=l[e]:c[e]=f("Symbol."+e)),c[e]}},81361(e){e.exports=" \n\v\f\r \xa0               \u2028\u2029\uFEFF"},9170(e,t,n){"use strict";var r=n(82109),i=n(79518),a=n(27674),o=n(70030),s=n(68880),u=n(79114),c=n(20408),l=n(41340),f=function(e,t){var n=this;if(!(n instanceof f))return new f(e,t);a&&(n=a(Error(void 0),i(n))),void 0!==t&&s(n,"message",l(t));var r=[];return c(e,r.push,{that:r}),s(n,"errors",r),n};f.prototype=o(Error.prototype,{constructor:u(5,f),message:u(5,""),name:u(5,"AggregateError")}),r({global:!0},{AggregateError:f})},18264(e,t,n){"use strict";var r=n(82109),i=n(17854),a=n(13331),o=n(96340),s="ArrayBuffer",u=a[s];r({global:!0,forced:i[s]!==u},{ArrayBuffer:u}),o(s)},76938(e,t,n){var r=n(82109),i=n(90260);r({target:"ArrayBuffer",stat:!0,forced:!i.NATIVE_ARRAY_BUFFER_VIEWS},{isView:i.isView})},39575(e,t,n){"use strict";var r=n(82109),i=n(47293),a=n(13331),o=n(19670),s=n(51400),u=n(17466),c=n(36707),l=a.ArrayBuffer,f=a.DataView,d=l.prototype.slice,h=i(function(){return!new l(2).slice(1,void 0).byteLength});r({target:"ArrayBuffer",proto:!0,unsafe:!0,forced:h},{slice:function(e,t){if(void 0!==d&&void 0===t)return d.call(o(this),e);for(var n=o(this).byteLength,r=s(e,n),i=s(void 0===t?n:t,n),a=new(c(this,l))(u(i-r)),h=new f(this),p=new f(a),b=0;r=0?r:n+r;return s<0||s>=n?void 0:t[s]}}),s("at")},92222(e,t,n){"use strict";var r=n(82109),i=n(47293),a=n(43157),o=n(70111),s=n(47908),u=n(17466),c=n(86135),l=n(65417),f=n(81194),d=n(5112),h=n(7392),p=d("isConcatSpreadable"),b=9007199254740991,m="Maximum allowed index exceeded",g=h>=51||!i(function(){var e=[];return e[p]=!1,e.concat()[0]!==e}),v=f("concat"),y=function(e){if(!o(e))return!1;var t=e[p];return void 0!==t?!!t:a(e)};r({target:"Array",proto:!0,forced:!g||!v},{concat:function(e){var t,n,r,i,a,o=s(this),f=l(o,0),d=0;for(t=-1,r=arguments.length;tb)throw TypeError(m);for(n=0;n=b)throw TypeError(m);c(f,d++,a)}return f.length=d,f}})},50545(e,t,n){var r=n(82109),i=n(1048),a=n(51223);r({target:"Array",proto:!0},{copyWithin:i}),a("copyWithin")},26541(e,t,n){"use strict";var r=n(82109),i=n(42092).every,a=n(9341)("every");r({target:"Array",proto:!0,forced:!a},{every:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}})},43290(e,t,n){var r=n(82109),i=n(21285),a=n(51223);r({target:"Array",proto:!0},{fill:i}),a("fill")},57327(e,t,n){"use strict";var r=n(82109),i=n(42092).filter,a=n(81194)("filter");r({target:"Array",proto:!0,forced:!a},{filter:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}})},34553(e,t,n){"use strict";var r=n(82109),i=n(42092).findIndex,a=n(51223),o="findIndex",s=!0;o in[]&&[,][o](function(){s=!1}),r({target:"Array",proto:!0,forced:s},{findIndex:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),a(o)},69826(e,t,n){"use strict";var r=n(82109),i=n(42092).find,a=n(51223),o="find",s=!0;o in[]&&[,][o](function(){s=!1}),r({target:"Array",proto:!0,forced:s},{find:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),a(o)},86535(e,t,n){"use strict";var r=n(82109),i=n(6790),a=n(47908),o=n(17466),s=n(13099),u=n(65417);r({target:"Array",proto:!0},{flatMap:function(e){var t,n=a(this),r=o(n.length);return s(e),(t=u(n,0)).length=i(t,n,n,r,0,1,e,arguments.length>1?arguments[1]:void 0),t}})},84944(e,t,n){"use strict";var r=n(82109),i=n(6790),a=n(47908),o=n(17466),s=n(99958),u=n(65417);r({target:"Array",proto:!0},{flat:function(){var e=arguments.length?arguments[0]:void 0,t=a(this),n=o(t.length),r=u(t,0);return r.length=i(r,t,t,n,0,void 0===e?1:s(e)),r}})},89554(e,t,n){"use strict";var r=n(82109),i=n(18533);r({target:"Array",proto:!0,forced:[].forEach!=i},{forEach:i})},91038(e,t,n){var r=n(82109),i=n(48457),a=!n(17072)(function(e){Array.from(e)});r({target:"Array",stat:!0,forced:a},{from:i})},26699(e,t,n){"use strict";var r=n(82109),i=n(41318).includes,a=n(51223);r({target:"Array",proto:!0},{includes:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),a("includes")},82772(e,t,n){"use strict";var r=n(82109),i=n(41318).indexOf,a=n(9341),o=[].indexOf,s=!!o&&1/[1].indexOf(1,-0)<0,u=a("indexOf");r({target:"Array",proto:!0,forced:s||!u},{indexOf:function(e){return s?o.apply(this,arguments)||0:i(this,e,arguments.length>1?arguments[1]:void 0)}})},79753(e,t,n){var r=n(82109),i=n(43157);r({target:"Array",stat:!0},{isArray:i})},66992(e,t,n){"use strict";var r=n(45656),i=n(51223),a=n(97497),o=n(29909),s=n(70654),u="Array Iterator",c=o.set,l=o.getterFor(u);e.exports=s(Array,"Array",function(e,t){c(this,{type:u,target:r(e),index:0,kind:t})},function(){var e=l(this),t=e.target,n=e.kind,r=e.index++;return!t||r>=t.length?(e.target=void 0,{value:void 0,done:!0}):"keys"==n?{value:r,done:!1}:"values"==n?{value:t[r],done:!1}:{value:[r,t[r]],done:!1}},"values"),a.Arguments=a.Array,i("keys"),i("values"),i("entries")},69600(e,t,n){"use strict";var r=n(82109),i=n(68361),a=n(45656),o=n(9341),s=[].join,u=i!=Object,c=o("join",",");r({target:"Array",proto:!0,forced:u||!c},{join:function(e){return s.call(a(this),void 0===e?",":e)}})},94986(e,t,n){var r=n(82109),i=n(86583);r({target:"Array",proto:!0,forced:i!==[].lastIndexOf},{lastIndexOf:i})},21249(e,t,n){"use strict";var r=n(82109),i=n(42092).map,a=n(81194)("map");r({target:"Array",proto:!0,forced:!a},{map:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}})},26572(e,t,n){"use strict";var r=n(82109),i=n(47293),a=n(86135),o=i(function(){function e(){}return!(Array.of.call(e) instanceof e)});r({target:"Array",stat:!0,forced:o},{of:function(){for(var e=0,t=arguments.length,n=new("function"==typeof this?this:Array)(t);t>e;)a(n,e,arguments[e++]);return n.length=t,n}})},96644(e,t,n){"use strict";var r=n(82109),i=n(53671).right,a=n(9341),o=n(7392),s=n(35268),u=a("reduceRight"),c=!s&&o>79&&o<83;r({target:"Array",proto:!0,forced:!u||c},{reduceRight:function(e){return i(this,e,arguments.length,arguments.length>1?arguments[1]:void 0)}})},85827(e,t,n){"use strict";var r=n(82109),i=n(53671).left,a=n(9341),o=n(7392),s=n(35268),u=a("reduce"),c=!s&&o>79&&o<83;r({target:"Array",proto:!0,forced:!u||c},{reduce:function(e){return i(this,e,arguments.length,arguments.length>1?arguments[1]:void 0)}})},65069(e,t,n){"use strict";var r=n(82109),i=n(43157),a=[].reverse,o=[1,2];r({target:"Array",proto:!0,forced:String(o)===String(o.reverse())},{reverse:function(){return i(this)&&(this.length=this.length),a.call(this)}})},47042(e,t,n){"use strict";var r=n(82109),i=n(70111),a=n(43157),o=n(51400),s=n(17466),u=n(45656),c=n(86135),l=n(5112),f=n(81194)("slice"),d=l("species"),h=[].slice,p=Math.max;r({target:"Array",proto:!0,forced:!f},{slice:function(e,t){var n,r,l,f=u(this),b=s(f.length),m=o(e,b),g=o(void 0===t?b:t,b);if(a(f)&&("function"==typeof(n=f.constructor)&&(n===Array||a(n.prototype))?n=void 0:i(n)&&null===(n=n[d])&&(n=void 0),n===Array||void 0===n))return h.call(f,m,g);for(l=0,r=new(void 0===n?Array:n)(p(g-m,0));m1?arguments[1]:void 0)}})},2707(e,t,n){"use strict";var r=n(82109),i=n(13099),a=n(47908),o=n(17466),s=n(41340),u=n(47293),c=n(94362),l=n(9341),f=n(68886),d=n(30256),h=n(7392),p=n(98008),b=[],m=b.sort,g=u(function(){b.sort(void 0)}),v=u(function(){b.sort(null)}),y=l("sort"),w=!u(function(){if(h)return h<70;if(!f||!(f>3)){if(d)return!0;if(p)return p<603;var e,t,n,r,i="";for(e=65;e<76;e++){switch(t=String.fromCharCode(e),e){case 66:case 69:case 70:case 72:n=3;break;case 68:case 71:n=4;break;default:n=2}for(r=0;r<47;r++)b.push({k:t+r,v:n})}for(b.sort(function(e,t){return t.v-e.v}),r=0;rs(n)?1:-1}};r({target:"Array",proto:!0,forced:_},{sort:function(e){void 0!==e&&i(e);var t,n,r=a(this);if(w)return void 0===e?m.call(r):m.call(r,e);var s=[],u=o(r.length);for(n=0;nh)throw TypeError(p);for(b=0,l=u(v,r);by-r+n;b--)delete v[b-1]}else if(n>r)for(b=y-r;b>w;b--)m=b+r-1,g=b+n-1,m in v?v[g]=v[m]:delete v[g];for(b=0;b94906265.62425156?s(e)+c:a(e-1+u(e-1)*u(e+1))}})},82376(e,t,n){var r=n(82109),i=Math.asinh,a=Math.log,o=Math.sqrt;function s(e){return isFinite(e=+e)&&0!=e?e<0?-s(-e):a(e+o(e*e+1)):e}r({target:"Math",stat:!0,forced:!(i&&1/i(0)>0)},{asinh:s})},73181(e,t,n){var r=n(82109),i=Math.atanh,a=Math.log;r({target:"Math",stat:!0,forced:!(i&&1/i(-0)<0)},{atanh:function(e){return 0==(e=+e)?e:a((1+e)/(1-e))/2}})},23484(e,t,n){var r=n(82109),i=n(64310),a=Math.abs,o=Math.pow;r({target:"Math",stat:!0},{cbrt:function(e){return i(e=+e)*o(a(e),1/3)}})},2388(e,t,n){var r=n(82109),i=Math.floor,a=Math.log,o=Math.LOG2E;r({target:"Math",stat:!0},{clz32:function(e){return(e>>>=0)?31-i(a(e+.5)*o):32}})},88621(e,t,n){var r=n(82109),i=n(66736),a=Math.cosh,o=Math.abs,s=Math.E;r({target:"Math",stat:!0,forced:!a||a(710)===1/0},{cosh:function(e){var t=i(o(e)-1)+1;return(t+1/(t*s*s))*(s/2)}})},60403(e,t,n){var r=n(82109),i=n(66736);r({target:"Math",stat:!0,forced:i!=Math.expm1},{expm1:i})},84755(e,t,n){var r=n(82109),i=n(26130);r({target:"Math",stat:!0},{fround:i})},25438(e,t,n){var r=n(82109),i=Math.hypot,a=Math.abs,o=Math.sqrt,s=!!i&&i(1/0,NaN)!==1/0;r({target:"Math",stat:!0,forced:s},{hypot:function(e,t){for(var n,r,i=0,s=0,u=arguments.length,c=0;s0?i+=(r=n/c)*r:i+=n;return c===1/0?1/0:c*o(i)}})},90332(e,t,n){var r=n(82109),i=n(47293),a=Math.imul,o=i(function(){return -5!=a(4294967295,5)||2!=a.length});r({target:"Math",stat:!0,forced:o},{imul:function(e,t){var n=65535,r=+e,i=+t,a=n&r,o=n&i;return 0|a*o+((n&r>>>16)*o+a*(n&i>>>16)<<16>>>0)}})},40658(e,t,n){var r=n(82109),i=Math.log,a=Math.LOG10E;r({target:"Math",stat:!0},{log10:function(e){return i(e)*a}})},40197(e,t,n){var r=n(82109),i=n(26513);r({target:"Math",stat:!0},{log1p:i})},44914(e,t,n){var r=n(82109),i=Math.log,a=Math.LN2;r({target:"Math",stat:!0},{log2:function(e){return i(e)/a}})},52420(e,t,n){var r=n(82109),i=n(64310);r({target:"Math",stat:!0},{sign:i})},60160(e,t,n){var r=n(82109),i=n(47293),a=n(66736),o=Math.abs,s=Math.exp,u=Math.E,c=i(function(){return -.00000000000000002!=Math.sinh(-.00000000000000002)});r({target:"Math",stat:!0,forced:c},{sinh:function(e){return 1>o(e=+e)?(a(e)-a(-e))/2:(s(e-1)-s(-e-1))*(u/2)}})},60970(e,t,n){var r=n(82109),i=n(66736),a=Math.exp;r({target:"Math",stat:!0},{tanh:function(e){var t=i(e=+e),n=i(-e);return t==1/0?1:n==1/0?-1:(t-n)/(a(e)+a(-e))}})},10408(e,t,n){n(58003)(Math,"Math",!0)},73689(e,t,n){var r=n(82109),i=Math.ceil,a=Math.floor;r({target:"Math",stat:!0},{trunc:function(e){return(e>0?a:i)(e)}})},9653(e,t,n){"use strict";var r=n(19781),i=n(17854),a=n(54705),o=n(31320),s=n(86656),u=n(84326),c=n(79587),l=n(52190),f=n(57593),d=n(47293),h=n(70030),p=n(8006).f,b=n(31236).f,m=n(3070).f,g=n(53111).trim,v="Number",y=i[v],w=y.prototype,_=u(h(w))==v,E=function(e){if(l(e))throw TypeError("Cannot convert a Symbol value to a number");var t,n,r,i,a,o,s,u,c=f(e,"number");if("string"==typeof c&&c.length>2){if(43===(t=(c=g(c)).charCodeAt(0))||45===t){if(88===(n=c.charCodeAt(2))||120===n)return NaN}else if(48===t){switch(c.charCodeAt(1)){case 66:case 98:r=2,i=49;break;case 79:case 111:r=8,i=55;break;default:return+c}for(s=0,o=(a=c.slice(2)).length;si)return NaN;return parseInt(a,r)}}return+c};if(a(v,!y(" 0o1")||!y("0b1")||y("+0x1"))){for(var S,k=function(e){var t=arguments.length<1?0:e,n=this;return n instanceof k&&(_?d(function(){w.valueOf.call(n)}):u(n)!=v)?c(new y(E(t)),n,k):E(t)},x=r?p(y):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger,fromString,range".split(","),T=0;x.length>T;T++)s(y,S=x[T])&&!s(k,S)&&m(k,S,b(y,S));k.prototype=w,w.constructor=k,o(i,v,k)}},93299(e,t,n){n(82109)({target:"Number",stat:!0},{EPSILON:2220446049250313e-31})},35192(e,t,n){var r=n(82109),i=n(77023);r({target:"Number",stat:!0},{isFinite:i})},33161(e,t,n){var r=n(82109),i=n(18730);r({target:"Number",stat:!0},{isInteger:i})},44048(e,t,n){n(82109)({target:"Number",stat:!0},{isNaN:function(e){return e!=e}})},78285(e,t,n){var r=n(82109),i=n(18730),a=Math.abs;r({target:"Number",stat:!0},{isSafeInteger:function(e){return i(e)&&9007199254740991>=a(e)}})},44363(e,t,n){n(82109)({target:"Number",stat:!0},{MAX_SAFE_INTEGER:9007199254740991})},55994(e,t,n){n(82109)({target:"Number",stat:!0},{MIN_SAFE_INTEGER:-9007199254740991})},61874(e,t,n){var r=n(82109),i=n(2814);r({target:"Number",stat:!0,forced:Number.parseFloat!=i},{parseFloat:i})},9494(e,t,n){var r=n(82109),i=n(83009);r({target:"Number",stat:!0,forced:Number.parseInt!=i},{parseInt:i})},56977(e,t,n){"use strict";var r=n(82109),i=n(99958),a=n(50863),o=n(38415),s=n(47293),u=1..toFixed,c=Math.floor,l=function(e,t,n){return 0===t?n:t%2==1?l(e,t-1,n*e):l(e*e,t/2,n)},f=function(e){for(var t=0,n=e;n>=4096;)t+=12,n/=4096;for(;n>=2;)t+=1,n/=2;return t},d=function(e,t,n){for(var r=-1,i=n;++r<6;)i+=t*e[r],e[r]=i%1e7,i=c(i/1e7)},h=function(e,t){for(var n=6,r=0;--n>=0;)r+=e[n],e[n]=c(r/t),r=r%t*1e7},p=function(e){for(var t=6,n="";--t>=0;)if(""!==n||0===t||0!==e[t]){var r=String(e[t]);n=""===n?r:n+o.call("0",7-r.length)+r}return n},b=!!u||!s(function(){u.call({})});r({target:"Number",proto:!0,forced:b},{toFixed:function(e){var t,n,r,s,u=a(this),c=i(e),b=[0,0,0,0,0,0],m="",g="0";if(c<0||c>20)throw RangeError("Incorrect fraction digits");if(u!=u)return"NaN";if(u<=-1e21||u>=1e21)return String(u);if(u<0&&(m="-",u=-u),u>1e-21){if(n=(t=f(u*l(2,69,1))-69)<0?u*l(2,-t,1):u/l(2,t,1),n*=4503599627370496,(t=52-t)>0){for(d(b,0,n),r=c;r>=7;)d(b,1e7,0),r-=7;for(d(b,l(10,r,1),0),r=t-1;r>=23;)h(b,8388608),r-=23;h(b,1<0?m+((s=g.length)<=c?"0."+o.call("0",c-s)+g:g.slice(0,s-c)+"."+g.slice(s-c)):m+g}})},55147(e,t,n){"use strict";var r=n(82109),i=n(47293),a=n(50863),o=1..toPrecision,s=i(function(){return"1"!==o.call(1,void 0)})||!i(function(){o.call({})});r({target:"Number",proto:!0,forced:s},{toPrecision:function(e){return void 0===e?o.call(a(this)):o.call(a(this),e)}})},19601(e,t,n){var r=n(82109),i=n(21574);r({target:"Object",stat:!0,forced:Object.assign!==i},{assign:i})},78011(e,t,n){var r=n(82109),i=n(19781),a=n(70030);r({target:"Object",stat:!0,sham:!i},{create:a})},59595(e,t,n){"use strict";var r=n(82109),i=n(19781),a=n(69026),o=n(47908),s=n(13099),u=n(3070);i&&r({target:"Object",proto:!0,forced:a},{__defineGetter__:function(e,t){u.f(o(this),e,{get:s(t),enumerable:!0,configurable:!0})}})},33321(e,t,n){var r=n(82109),i=n(19781),a=n(36048);r({target:"Object",stat:!0,forced:!i,sham:!i},{defineProperties:a})},69070(e,t,n){var r=n(82109),i=n(19781),a=n(3070);r({target:"Object",stat:!0,forced:!i,sham:!i},{defineProperty:a.f})},35500(e,t,n){"use strict";var r=n(82109),i=n(19781),a=n(69026),o=n(47908),s=n(13099),u=n(3070);i&&r({target:"Object",proto:!0,forced:a},{__defineSetter__:function(e,t){u.f(o(this),e,{set:s(t),enumerable:!0,configurable:!0})}})},69720(e,t,n){var r=n(82109),i=n(44699).entries;r({target:"Object",stat:!0},{entries:function(e){return i(e)}})},43371(e,t,n){var r=n(82109),i=n(76677),a=n(47293),o=n(70111),s=n(62423).onFreeze,u=Object.freeze,c=a(function(){u(1)});r({target:"Object",stat:!0,forced:c,sham:!i},{freeze:function(e){return u&&o(e)?u(s(e)):e}})},38559(e,t,n){var r=n(82109),i=n(20408),a=n(86135);r({target:"Object",stat:!0},{fromEntries:function(e){var t={};return i(e,function(e,n){a(t,e,n)},{AS_ENTRIES:!0}),t}})},38880(e,t,n){var r=n(82109),i=n(47293),a=n(45656),o=n(31236).f,s=n(19781),u=i(function(){o(1)}),c=!s||u;r({target:"Object",stat:!0,forced:c,sham:!s},{getOwnPropertyDescriptor:function(e,t){return o(a(e),t)}})},49337(e,t,n){var r=n(82109),i=n(19781),a=n(53887),o=n(45656),s=n(31236),u=n(86135);r({target:"Object",stat:!0,sham:!i},{getOwnPropertyDescriptors:function(e){for(var t,n,r=o(e),i=s.f,c=a(r),l={},f=0;c.length>f;)void 0!==(n=i(r,t=c[f++]))&&u(l,t,n);return l}})},36210(e,t,n){var r=n(82109),i=n(47293),a=n(1156).f,o=i(function(){return!Object.getOwnPropertyNames(1)});r({target:"Object",stat:!0,forced:o},{getOwnPropertyNames:a})},30489(e,t,n){var r=n(82109),i=n(47293),a=n(47908),o=n(79518),s=n(49920),u=i(function(){o(1)});r({target:"Object",stat:!0,forced:u,sham:!s},{getPrototypeOf:function(e){return o(a(e))}})},46314(e,t,n){var r=n(82109),i=n(86656);r({target:"Object",stat:!0},{hasOwn:i})},41825(e,t,n){var r=n(82109),i=n(47293),a=n(70111),o=Object.isExtensible,s=i(function(){o(1)});r({target:"Object",stat:!0,forced:s},{isExtensible:function(e){return!!a(e)&&(!o||o(e))}})},98410(e,t,n){var r=n(82109),i=n(47293),a=n(70111),o=Object.isFrozen,s=i(function(){o(1)});r({target:"Object",stat:!0,forced:s},{isFrozen:function(e){return!a(e)||!!o&&o(e)}})},72200(e,t,n){var r=n(82109),i=n(47293),a=n(70111),o=Object.isSealed,s=i(function(){o(1)});r({target:"Object",stat:!0,forced:s},{isSealed:function(e){return!a(e)||!!o&&o(e)}})},43304(e,t,n){var r=n(82109),i=n(81150);r({target:"Object",stat:!0},{is:i})},47941(e,t,n){var r=n(82109),i=n(47908),a=n(81956),o=n(47293)(function(){a(1)});r({target:"Object",stat:!0,forced:o},{keys:function(e){return a(i(e))}})},94869(e,t,n){"use strict";var r=n(82109),i=n(19781),a=n(69026),o=n(47908),s=n(34948),u=n(79518),c=n(31236).f;i&&r({target:"Object",proto:!0,forced:a},{__lookupGetter__:function(e){var t,n=o(this),r=s(e);do if(t=c(n,r))return t.get;while(n=u(n))}})},33952(e,t,n){"use strict";var r=n(82109),i=n(19781),a=n(69026),o=n(47908),s=n(34948),u=n(79518),c=n(31236).f;i&&r({target:"Object",proto:!0,forced:a},{__lookupSetter__:function(e){var t,n=o(this),r=s(e);do if(t=c(n,r))return t.set;while(n=u(n))}})},57227(e,t,n){var r=n(82109),i=n(70111),a=n(62423).onFreeze,o=n(76677),s=n(47293),u=Object.preventExtensions,c=s(function(){u(1)});r({target:"Object",stat:!0,forced:c,sham:!o},{preventExtensions:function(e){return u&&i(e)?u(a(e)):e}})},60514(e,t,n){var r=n(82109),i=n(70111),a=n(62423).onFreeze,o=n(76677),s=n(47293),u=Object.seal,c=s(function(){u(1)});r({target:"Object",stat:!0,forced:c,sham:!o},{seal:function(e){return u&&i(e)?u(a(e)):e}})},68304(e,t,n){var r=n(82109),i=n(27674);r({target:"Object",stat:!0},{setPrototypeOf:i})},41539(e,t,n){var r=n(51694),i=n(31320),a=n(90288);r||i(Object.prototype,"toString",a,{unsafe:!0})},26833(e,t,n){var r=n(82109),i=n(44699).values;r({target:"Object",stat:!0},{values:function(e){return i(e)}})},54678(e,t,n){var r=n(82109),i=n(2814);r({global:!0,forced:parseFloat!=i},{parseFloat:i})},91058(e,t,n){var r=n(82109),i=n(83009);r({global:!0,forced:parseInt!=i},{parseInt:i})},17922(e,t,n){"use strict";var r=n(82109),i=n(13099),a=n(78523),o=n(12534),s=n(20408);r({target:"Promise",stat:!0},{allSettled:function(e){var t=this,n=a.f(t),r=n.resolve,u=n.reject,c=o(function(){var n=i(t.resolve),a=[],o=0,u=1;s(e,function(e){var i=o++,s=!1;a.push(void 0),u++,n.call(t,e).then(function(e){!s&&(s=!0,a[i]={status:"fulfilled",value:e},--u||r(a))},function(e){!s&&(s=!0,a[i]={status:"rejected",reason:e},--u||r(a))})}),--u||r(a)});return c.error&&u(c.value),n.promise}})},34668(e,t,n){"use strict";var r=n(82109),i=n(13099),a=n(35005),o=n(78523),s=n(12534),u=n(20408),c="No one promise resolved";r({target:"Promise",stat:!0},{any:function(e){var t=this,n=o.f(t),r=n.resolve,l=n.reject,f=s(function(){var n=i(t.resolve),o=[],s=0,f=1,d=!1;u(e,function(e){var i=s++,u=!1;o.push(void 0),f++,n.call(t,e).then(function(e){u||d||(d=!0,r(e))},function(e){!u&&!d&&(u=!0,o[i]=e,--f||l(new(a("AggregateError"))(o,c)))})}),--f||l(new(a("AggregateError"))(o,c))});return f.error&&l(f.value),n.promise}})},17727(e,t,n){"use strict";var r=n(82109),i=n(31913),a=n(13366),o=n(47293),s=n(35005),u=n(36707),c=n(69478),l=n(31320),f=!!a&&o(function(){a.prototype.finally.call({then:function(){}},function(){})});if(r({target:"Promise",proto:!0,real:!0,forced:f},{finally:function(e){var t=u(this,s("Promise")),n="function"==typeof e;return this.then(n?function(n){return c(t,e()).then(function(){return n})}:e,n?function(n){return c(t,e()).then(function(){throw n})}:e)}}),!i&&"function"==typeof a){var d=s("Promise").prototype.finally;a.prototype.finally!==d&&l(a.prototype,"finally",d,{unsafe:!0})}},88674(e,t,n){"use strict";var r,i,a,o,s=n(82109),u=n(31913),c=n(17854),l=n(35005),f=n(13366),d=n(31320),h=n(12248),p=n(27674),b=n(58003),m=n(96340),g=n(70111),v=n(13099),y=n(25787),w=n(42788),_=n(20408),E=n(17072),S=n(36707),k=n(20261).set,x=n(95948),T=n(69478),M=n(842),O=n(78523),A=n(12534),L=n(29909),C=n(54705),I=n(5112),D=n(7871),N=n(35268),P=n(7392),R=I("species"),j="Promise",F=L.get,Y=L.set,B=L.getterFor(j),U=f&&f.prototype,H=f,$=U,z=c.TypeError,G=c.document,W=c.process,K=O.f,V=K,q=!!(G&&G.createEvent&&c.dispatchEvent),Z="function"==typeof PromiseRejectionEvent,X="unhandledrejection",J="rejectionhandled",Q=0,ee=1,et=2,en=1,er=2,ei=!1,ea=C(j,function(){var e=w(H),t=e!==String(H);if(!t&&66===P||u&&!$.finally)return!0;if(P>=51&&/native code/.test(e))return!1;var n=new H(function(e){e(1)}),r=function(e){e(function(){},function(){})};return(n.constructor={})[R]=r,!(ei=n.then(function(){}) instanceof r)||!t&&D&&!Z}),eo=ea||!E(function(e){H.all(e).catch(function(){})}),es=function(e){var t;return!!g(e)&&"function"==typeof(t=e.then)&&t},eu=function(e,t){if(!e.notified){e.notified=!0;var n=e.reactions;x(function(){for(var r=e.value,i=e.state==ee,a=0;n.length>a;){var o,s,u,c=n[a++],l=i?c.ok:c.fail,f=c.resolve,d=c.reject,h=c.domain;try{l?(i||(e.rejection===er&&ed(e),e.rejection=en),!0===l?o=r:(h&&h.enter(),o=l(r),h&&(h.exit(),u=!0)),o===c.promise?d(z("Promise-chain cycle")):(s=es(o))?s.call(o,f,d):f(o)):d(r)}catch(p){h&&!u&&h.exit(),d(p)}}e.reactions=[],e.notified=!1,t&&!e.rejection&&el(e)})}},ec=function(e,t,n){var r,i;q?((r=G.createEvent("Event")).promise=t,r.reason=n,r.initEvent(e,!1,!0),c.dispatchEvent(r)):r={promise:t,reason:n},!Z&&(i=c["on"+e])?i(r):e===X&&M("Unhandled promise rejection",n)},el=function(e){k.call(c,function(){var t,n=e.facade,r=e.value;if(ef(e)&&(t=A(function(){N?W.emit("unhandledRejection",r,n):ec(X,n,r)}),e.rejection=N||ef(e)?er:en,t.error))throw t.value})},ef=function(e){return e.rejection!==en&&!e.parent},ed=function(e){k.call(c,function(){var t=e.facade;N?W.emit("rejectionHandled",t):ec(J,t,e.value)})},eh=function(e,t,n){return function(r){e(t,r,n)}},ep=function(e,t,n){e.done||(e.done=!0,n&&(e=n),e.value=t,e.state=et,eu(e,!0))},eb=function(e,t,n){if(!e.done){e.done=!0,n&&(e=n);try{if(e.facade===t)throw z("Promise can't be resolved itself");var r=es(t);r?x(function(){var n={done:!1};try{r.call(t,eh(eb,n,e),eh(ep,n,e))}catch(i){ep(n,i,e)}}):(e.value=t,e.state=ee,eu(e,!1))}catch(i){ep({done:!1},i,e)}}};if(ea&&($=(H=function(e){y(this,H,j),v(e),r.call(this);var t=F(this);try{e(eh(eb,t),eh(ep,t))}catch(n){ep(t,n)}}).prototype,(r=function(e){Y(this,{type:j,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:Q,value:void 0})}).prototype=h($,{then:function(e,t){var n=B(this),r=K(S(this,H));return r.ok="function"!=typeof e||e,r.fail="function"==typeof t&&t,r.domain=N?W.domain:void 0,n.parent=!0,n.reactions.push(r),n.state!=Q&&eu(n,!1),r.promise},catch:function(e){return this.then(void 0,e)}}),i=function(){var e=new r,t=F(e);this.promise=e,this.resolve=eh(eb,t),this.reject=eh(ep,t)},O.f=K=function(e){return e===H||e===a?new i(e):V(e)},!u&&"function"==typeof f&&U!==Object.prototype)){o=U.then,ei||(d(U,"then",function(e,t){var n=this;return new H(function(e,t){o.call(n,e,t)}).then(e,t)},{unsafe:!0}),d(U,"catch",$.catch,{unsafe:!0}));try{delete U.constructor}catch(em){}p&&p(U,$)}s({global:!0,wrap:!0,forced:ea},{Promise:H}),b(H,j,!1,!0),m(j),a=l(j),s({target:j,stat:!0,forced:ea},{reject:function(e){var t=K(this);return t.reject.call(void 0,e),t.promise}}),s({target:j,stat:!0,forced:u||ea},{resolve:function(e){return T(u&&this===a?H:this,e)}}),s({target:j,stat:!0,forced:eo},{all:function(e){var t=this,n=K(t),r=n.resolve,i=n.reject,a=A(function(){var n=v(t.resolve),a=[],o=0,s=1;_(e,function(e){var u=o++,c=!1;a.push(void 0),s++,n.call(t,e).then(function(e){!c&&(c=!0,a[u]=e,--s||r(a))},i)}),--s||r(a)});return a.error&&i(a.value),n.promise},race:function(e){var t=this,n=K(t),r=n.reject,i=A(function(){var i=v(t.resolve);_(e,function(e){i.call(t,e).then(n.resolve,r)})});return i.error&&r(i.value),n.promise}})},36535(e,t,n){var r=n(82109),i=n(35005),a=n(13099),o=n(19670),s=n(47293),u=i("Reflect","apply"),c=Function.apply,l=!s(function(){u(function(){})});r({target:"Reflect",stat:!0,forced:l},{apply:function(e,t,n){return a(e),o(n),u?u(e,t,n):c.call(e,t,n)}})},12419(e,t,n){var r=n(82109),i=n(35005),a=n(13099),o=n(19670),s=n(70111),u=n(70030),c=n(27065),l=n(47293),f=i("Reflect","construct"),d=l(function(){function e(){}return!(f(function(){},[],e) instanceof e)}),h=!l(function(){f(function(){})}),p=d||h;r({target:"Reflect",stat:!0,forced:p,sham:p},{construct:function(e,t){a(e),o(t);var n=arguments.length<3?e:a(arguments[2]);if(h&&!d)return f(e,t,n);if(e==n){switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3])}var r=[null];return r.push.apply(r,t),new(c.apply(e,r))}var i=n.prototype,l=u(s(i)?i:Object.prototype),p=Function.apply.call(e,l,t);return s(p)?p:l}})},69596(e,t,n){var r=n(82109),i=n(19781),a=n(19670),o=n(34948),s=n(3070),u=n(47293)(function(){Reflect.defineProperty(s.f({},1,{value:1}),1,{value:2})});r({target:"Reflect",stat:!0,forced:u,sham:!i},{defineProperty:function(e,t,n){a(e);var r=o(t);a(n);try{return s.f(e,r,n),!0}catch(i){return!1}}})},52586(e,t,n){var r=n(82109),i=n(19670),a=n(31236).f;r({target:"Reflect",stat:!0},{deleteProperty:function(e,t){var n=a(i(e),t);return(!n||!!n.configurable)&&delete e[t]}})},95683(e,t,n){var r=n(82109),i=n(19781),a=n(19670),o=n(31236);r({target:"Reflect",stat:!0,sham:!i},{getOwnPropertyDescriptor:function(e,t){return o.f(a(e),t)}})},39361(e,t,n){var r=n(82109),i=n(19670),a=n(79518),o=n(49920);r({target:"Reflect",stat:!0,sham:!o},{getPrototypeOf:function(e){return a(i(e))}})},74819(e,t,n){var r=n(82109),i=n(70111),a=n(19670),o=n(45032),s=n(31236),u=n(79518);function c(e,t){var n,r,l=arguments.length<3?e:arguments[2];return a(e)===l?e[t]:(n=s.f(e,t))?o(n)?n.value:void 0===n.get?void 0:n.get.call(l):i(r=u(e))?c(r,t,l):void 0}r({target:"Reflect",stat:!0},{get:c})},51037(e,t,n){n(82109)({target:"Reflect",stat:!0},{has:function(e,t){return t in e}})},5898(e,t,n){var r=n(82109),i=n(19670),a=Object.isExtensible;r({target:"Reflect",stat:!0},{isExtensible:function(e){return i(e),!a||a(e)}})},67556(e,t,n){var r=n(82109),i=n(53887);r({target:"Reflect",stat:!0},{ownKeys:i})},14361(e,t,n){var r=n(82109),i=n(35005),a=n(19670),o=n(76677);r({target:"Reflect",stat:!0,sham:!o},{preventExtensions:function(e){a(e);try{var t=i("Object","preventExtensions");return t&&t(e),!0}catch(n){return!1}}})},39532(e,t,n){var r=n(82109),i=n(19670),a=n(96077),o=n(27674);o&&r({target:"Reflect",stat:!0},{setPrototypeOf:function(e,t){i(e),a(t);try{return o(e,t),!0}catch(n){return!1}}})},83593(e,t,n){var r=n(82109),i=n(19670),a=n(70111),o=n(45032),s=n(47293),u=n(3070),c=n(31236),l=n(79518),f=n(79114);function d(e,t,n){var r,s,h,p=arguments.length<4?e:arguments[3],b=c.f(i(e),t);if(!b){if(a(s=l(e)))return d(s,t,n,p);b=f(0)}if(o(b)){if(!1===b.writable||!a(p))return!1;if(r=c.f(p,t)){if(r.get||r.set||!1===r.writable)return!1;r.value=n,u.f(p,t,r)}else u.f(p,t,f(0,n))}else{if(void 0===(h=b.set))return!1;h.call(p,n)}return!0}var h=s(function(){var e=function(){},t=u.f(new e,"a",{configurable:!0});return!1!==Reflect.set(e.prototype,"a",1,t)});r({target:"Reflect",stat:!0,forced:h},{set:d})},81299(e,t,n){var r=n(82109),i=n(17854),a=n(58003);r({global:!0},{Reflect:{}}),a(i.Reflect,"Reflect",!0)},24603(e,t,n){var r=n(19781),i=n(17854),a=n(54705),o=n(79587),s=n(68880),u=n(3070).f,c=n(8006).f,l=n(47850),f=n(41340),d=n(67066),h=n(52999),p=n(31320),b=n(47293),m=n(86656),g=n(29909).enforce,v=n(96340),y=n(5112),w=n(9441),_=n(38173),E=y("match"),S=i.RegExp,k=S.prototype,x=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,T=/a/g,M=/a/g,O=new S(T)!==T,A=h.UNSUPPORTED_Y,L=r&&(!O||A||w||_||b(function(){return M[E]=!1,S(T)!=T||S(M)==M||"/a/i"!=S(T,"i")})),C=function(e){for(var t,n=e.length,r=0,i="",a=!1;r<=n;r++){if("\\"===(t=e.charAt(r))){i+=t+e.charAt(++r);continue}a||"."!==t?("["===t?a=!0:"]"===t&&(a=!1),i+=t):i+="[\\s\\S]"}return i},I=function(e){for(var t,n=e.length,r=0,i="",a=[],o={},s=!1,u=!1,c=0,l="";r<=n;r++){if("\\"===(t=e.charAt(r)))t+=e.charAt(++r);else if("]"===t)s=!1;else if(!s)switch(!0){case"["===t:s=!0;break;case"("===t:x.test(e.slice(r+1))&&(r+=2,u=!0),i+=t,c++;continue;case">"===t&&u:if(""===l||m(o,l))throw SyntaxError("Invalid capture group name");o[l]=!0,a.push([l,c]),u=!1,l="";continue}u?l+=t:i+=t}return[i,a]};if(a("RegExp",L)){for(var D=function(e,t){var n,r,i,a,u,c,h=this instanceof D,p=l(e),b=void 0===t,m=[],v=e;if(!h&&p&&b&&e.constructor===D)return e;if((p||e instanceof D)&&(e=e.source,b&&(t=("flags"in v)?v.flags:d.call(v))),e=void 0===e?"":f(e),t=void 0===t?"":f(t),v=e,w&&("dotAll"in T)&&(r=!!t&&t.indexOf("s")>-1)&&(t=t.replace(/s/g,"")),n=t,A&&("sticky"in T)&&(i=!!t&&t.indexOf("y")>-1)&&(t=t.replace(/y/g,"")),_&&(e=(a=I(e))[0],m=a[1]),u=o(S(e,t),h?this:k,D),(r||i||m.length)&&(c=g(u),r&&(c.dotAll=!0,c.raw=D(C(e),n)),i&&(c.sticky=!0),m.length&&(c.groups=m)),e!==v)try{s(u,"source",""===v?"(?:)":v)}catch(y){}return u},N=function(e){(e in D)||u(D,e,{configurable:!0,get:function(){return S[e]},set:function(t){S[e]=t}})},P=c(S),R=0;P.length>R;)N(P[R++]);k.constructor=D,D.prototype=k,p(i,"RegExp",D)}v("RegExp")},28450(e,t,n){var r=n(19781),i=n(9441),a=n(3070).f,o=n(29909).get,s=RegExp.prototype;r&&i&&a(s,"dotAll",{configurable:!0,get:function(){if(this!==s){if(this instanceof RegExp)return!!o(this).dotAll;throw TypeError("Incompatible receiver, RegExp required")}}})},74916(e,t,n){"use strict";var r=n(82109),i=n(22261);r({target:"RegExp",proto:!0,forced:/./.exec!==i},{exec:i})},92087(e,t,n){var r=n(19781),i=n(3070),a=n(67066),o=n(47293);r&&o(function(){return"sy"!==Object.getOwnPropertyDescriptor(RegExp.prototype,"flags").get.call({dotAll:!0,sticky:!0})})&&i.f(RegExp.prototype,"flags",{configurable:!0,get:a})},88386(e,t,n){var r=n(19781),i=n(52999).UNSUPPORTED_Y,a=n(3070).f,o=n(29909).get,s=RegExp.prototype;r&&i&&a(s,"sticky",{configurable:!0,get:function(){if(this!==s){if(this instanceof RegExp)return!!o(this).sticky;throw TypeError("Incompatible receiver, RegExp required")}}})},77601(e,t,n){"use strict";n(74916);var r,i,a=n(82109),o=n(70111),s=(r=!1,(i=/[ac]/).exec=function(){return r=!0,/./.exec.apply(this,arguments)},!0===i.test("abc")&&r),u=/./.test;a({target:"RegExp",proto:!0,forced:!s},{test:function(e){if("function"!=typeof this.exec)return u.call(this,e);var t=this.exec(e);if(null!==t&&!o(t))throw Error("RegExp exec method returned something other than an Object or null");return!!t}})},39714(e,t,n){"use strict";var r=n(31320),i=n(19670),a=n(41340),o=n(47293),s=n(67066),u="toString",c=RegExp.prototype,l=c[u],f=o(function(){return"/a/b"!=l.call({source:"a",flags:"b"})}),d=l.name!=u;(f||d)&&r(RegExp.prototype,u,function(){var e=i(this),t=a(e.source),n=e.flags,r=a(void 0===n&&e instanceof RegExp&&!("flags"in c)?s.call(e):n);return"/"+t+"/"+r},{unsafe:!0})},70189(e,t,n){"use strict";var r=n(77710),i=n(95631);e.exports=r("Set",function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}},i)},15218(e,t,n){"use strict";var r=n(82109),i=n(14230),a=n(43429);r({target:"String",proto:!0,forced:a("anchor")},{anchor:function(e){return i(this,"a","name",e)}})},24506(e,t,n){"use strict";var r=n(82109),i=n(84488),a=n(99958),o=n(17466),s=n(41340),u=n(47293)(function(){return"\uD842"!=="𠮷".at(0)});r({target:"String",proto:!0,forced:u},{at:function(e){var t=s(i(this)),n=o(t.length),r=a(e),u=r>=0?r:n+r;return u<0||u>=n?void 0:t.charAt(u)}})},74475(e,t,n){"use strict";var r=n(82109),i=n(14230),a=n(43429);r({target:"String",proto:!0,forced:a("big")},{big:function(){return i(this,"big","","")}})},57929(e,t,n){"use strict";var r=n(82109),i=n(14230),a=n(43429);r({target:"String",proto:!0,forced:a("blink")},{blink:function(){return i(this,"blink","","")}})},50915(e,t,n){"use strict";var r=n(82109),i=n(14230),a=n(43429);r({target:"String",proto:!0,forced:a("bold")},{bold:function(){return i(this,"b","","")}})},79841(e,t,n){"use strict";var r=n(82109),i=n(28710).codeAt;r({target:"String",proto:!0},{codePointAt:function(e){return i(this,e)}})},27852(e,t,n){"use strict";var r,i=n(82109),a=n(31236).f,o=n(17466),s=n(41340),u=n(3929),c=n(84488),l=n(84964),f=n(31913),d="".endsWith,h=Math.min,p=l("endsWith"),b=!f&&!p&&!!(r=a(String.prototype,"endsWith"))&&!r.writable;i({target:"String",proto:!0,forced:!b&&!p},{endsWith:function(e){var t=s(c(this));u(e);var n=arguments.length>1?arguments[1]:void 0,r=o(t.length),i=void 0===n?r:h(o(n),r),a=s(e);return d?d.call(t,a,i):t.slice(i-a.length,i)===a}})},29253(e,t,n){"use strict";var r=n(82109),i=n(14230),a=n(43429);r({target:"String",proto:!0,forced:a("fixed")},{fixed:function(){return i(this,"tt","","")}})},42125(e,t,n){"use strict";var r=n(82109),i=n(14230),a=n(43429);r({target:"String",proto:!0,forced:a("fontcolor")},{fontcolor:function(e){return i(this,"font","color",e)}})},78830(e,t,n){"use strict";var r=n(82109),i=n(14230),a=n(43429);r({target:"String",proto:!0,forced:a("fontsize")},{fontsize:function(e){return i(this,"font","size",e)}})},94953(e,t,n){var r=n(82109),i=n(51400),a=String.fromCharCode,o=String.fromCodePoint;r({target:"String",stat:!0,forced:!!o&&1!=o.length},{fromCodePoint:function(e){for(var t,n=[],r=arguments.length,o=0;r>o;){if(t=+arguments[o++],i(t,1114111)!==t)throw RangeError(t+" is not a valid code point");n.push(t<65536?a(t):a(((t-=65536)>>10)+55296,t%1024+56320))}return n.join("")}})},32023(e,t,n){"use strict";var r=n(82109),i=n(3929),a=n(84488),o=n(41340),s=n(84964);r({target:"String",proto:!0,forced:!s("includes")},{includes:function(e){return!!~o(a(this)).indexOf(o(i(e)),arguments.length>1?arguments[1]:void 0)}})},58734(e,t,n){"use strict";var r=n(82109),i=n(14230),a=n(43429);r({target:"String",proto:!0,forced:a("italics")},{italics:function(){return i(this,"i","","")}})},78783(e,t,n){"use strict";var r=n(28710).charAt,i=n(41340),a=n(29909),o=n(70654),s="String Iterator",u=a.set,c=a.getterFor(s);o(String,"String",function(e){u(this,{type:s,string:i(e),index:0})},function(){var e,t=c(this),n=t.string,i=t.index;return i>=n.length?{value:void 0,done:!0}:(e=r(n,i),t.index+=e.length,{value:e,done:!1})})},29254(e,t,n){"use strict";var r=n(82109),i=n(14230),a=n(43429);r({target:"String",proto:!0,forced:a("link")},{link:function(e){return i(this,"a","href",e)}})},76373(e,t,n){"use strict";var r=n(82109),i=n(24994),a=n(84488),o=n(17466),s=n(41340),u=n(13099),c=n(19670),l=n(84326),f=n(47850),d=n(67066),h=n(68880),p=n(47293),b=n(5112),m=n(36707),g=n(31530),v=n(29909),y=n(31913),w=b("matchAll"),_="RegExp String",E=_+" Iterator",S=v.set,k=v.getterFor(E),x=RegExp.prototype,T=x.exec,M="".matchAll,O=!!M&&!p(function(){"a".matchAll(/./)}),A=function(e,t){var n,r=e.exec;if("function"==typeof r){if("object"!=typeof(n=r.call(e,t)))throw TypeError("Incorrect exec result");return n}return T.call(e,t)},L=i(function(e,t,n,r){S(this,{type:E,regexp:e,string:t,global:n,unicode:r,done:!1})},_,function(){var e=k(this);if(e.done)return{value:void 0,done:!0};var t=e.regexp,n=e.string,r=A(t,n);return null===r?{value:void 0,done:e.done=!0}:e.global?(""===s(r[0])&&(t.lastIndex=g(n,o(t.lastIndex),e.unicode)),{value:r,done:!1}):(e.done=!0,{value:r,done:!1})}),C=function(e){var t,n,r,i,a,u,l=c(this),f=s(e);return t=m(l,RegExp),void 0===(n=l.flags)&&l instanceof RegExp&&!("flags"in x)&&(n=d.call(l)),r=void 0===n?"":s(n),i=new t(t===RegExp?l.source:l,r),a=!!~r.indexOf("g"),u=!!~r.indexOf("u"),i.lastIndex=o(l.lastIndex),new L(i,f,a,u)};r({target:"String",proto:!0,forced:O},{matchAll:function(e){var t,n,r,i,o=a(this);if(null!=e){if(f(e)&&!~(t=s(a("flags"in x?e.flags:d.call(e)))).indexOf("g"))throw TypeError("`.matchAll` does not allow non-global regexes");if(O)return M.apply(o,arguments);if(void 0===(r=e[w])&&y&&"RegExp"==l(e)&&(r=C),null!=r)return u(r).call(e,o)}else if(O)return M.apply(o,arguments);return n=s(o),i=RegExp(e,"g"),y?C.call(i,n):i[w](n)}}),y||w in x||h(x,w,C)},4723(e,t,n){"use strict";var r=n(27007),i=n(19670),a=n(17466),o=n(41340),s=n(84488),u=n(31530),c=n(97651);r("match",function(e,t,n){return[function(t){var n=s(this),r=void 0==t?void 0:t[e];return void 0!==r?r.call(t,n):RegExp(t)[e](o(n))},function(e){var r,s=i(this),l=o(e),f=n(t,s,l);if(f.done)return f.value;if(!s.global)return c(s,l);var d=s.unicode;s.lastIndex=0;for(var h=[],p=0;null!==(r=c(s,l));){var b=o(r[0]);h[p]=b,""===b&&(s.lastIndex=u(l,a(s.lastIndex),d)),p++}return 0===p?null:h}]})},66528(e,t,n){"use strict";var r=n(82109),i=n(76650).end,a=n(54986);r({target:"String",proto:!0,forced:a},{padEnd:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}})},83112(e,t,n){"use strict";var r=n(82109),i=n(76650).start,a=n(54986);r({target:"String",proto:!0,forced:a},{padStart:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}})},38992(e,t,n){var r=n(82109),i=n(45656),a=n(17466),o=n(41340);r({target:"String",stat:!0},{raw:function(e){for(var t=i(e.raw),n=a(t.length),r=arguments.length,s=[],u=0;n>u;)s.push(o(t[u++])),ue.length?-1:""===t?n:e.indexOf(t,n)};r({target:"String",proto:!0},{replaceAll:function(e,t){var n,r,c,b,m,g,v,y,w,_=i(this),E=0,S=0,k="";if(null!=e){if((n=a(e))&&!~(r=o(i("flags"in d?e.flags:s.call(e)))).indexOf("g"))throw TypeError("`.replaceAll` does not allow non-global regexes");if(void 0!==(c=e[f]))return c.call(e,_,t);if(l&&n)return o(_).replace(e,t)}for(b=o(_),m=o(e),(g="function"==typeof t)||(t=o(t)),y=h(1,v=m.length),E=p(b,m,0);-1!==E;)w=g?o(t(m,E,b)):u(m,b,E,[],void 0,t),k+=b.slice(S,E)+w,S=E+v,E=p(b,m,E+y);return S")});r("replace",function(e,t,n){var r=v?"$":"$0";return[function(e,n){var r=c(this),i=void 0==e?void 0:e[h];return void 0!==i?i.call(e,r,n):t.call(u(r),e,n)},function(e,i){var c=a(this),h=u(e);if("string"==typeof i&&-1===i.indexOf(r)&&-1===i.indexOf("$<")){var g=n(t,c,h,i);if(g.done)return g.value}var v="function"==typeof i;v||(i=u(i));var y=c.global;if(y){var w=c.unicode;c.lastIndex=0}for(var _=[];;){var E=d(c,h);if(null===E||(_.push(E),!y))break;""===u(E[0])&&(c.lastIndex=l(h,s(c.lastIndex),w))}for(var S="",k=0,x=0;x<_.length;x++){for(var T=u((E=_[x])[0]),M=p(b(o(E.index),h.length),0),O=[],A=1;A=k&&(S+=h.slice(k,M)+I,k=M+T.length)}return S+h.slice(k)}]},!y||!g||v)},64765(e,t,n){"use strict";var r=n(27007),i=n(19670),a=n(84488),o=n(81150),s=n(41340),u=n(97651);r("search",function(e,t,n){return[function(t){var n=a(this),r=void 0==t?void 0:t[e];return void 0!==r?r.call(t,n):RegExp(t)[e](s(n))},function(e){var r=i(this),a=s(e),c=n(t,r,a);if(c.done)return c.value;var l=r.lastIndex;o(l,0)||(r.lastIndex=0);var f=u(r,a);return o(r.lastIndex,l)||(r.lastIndex=l),null===f?-1:f.index}]})},37268(e,t,n){"use strict";var r=n(82109),i=n(14230),a=n(43429);r({target:"String",proto:!0,forced:a("small")},{small:function(){return i(this,"small","","")}})},23123(e,t,n){"use strict";var r=n(27007),i=n(47850),a=n(19670),o=n(84488),s=n(36707),u=n(31530),c=n(17466),l=n(41340),f=n(97651),d=n(22261),h=n(52999),p=n(47293),b=h.UNSUPPORTED_Y,m=[].push,g=Math.min,v=4294967295,y=!p(function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var n="ab".split(e);return 2!==n.length||"a"!==n[0]||"b"!==n[1]});r("split",function(e,t,n){var r;return r="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(e,n){var r,a,s,u=l(o(this)),c=void 0===n?v:n>>>0;if(0===c)return[];if(void 0===e)return[u];if(!i(e))return t.call(u,e,c);for(var f=[],h=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),p=0,b=RegExp(e.source,h+"g");(r=d.call(b,u))&&(!((a=b.lastIndex)>p)||(f.push(u.slice(p,r.index)),r.length>1&&r.index=c)));)b.lastIndex===r.index&&b.lastIndex++;return p===u.length?(s||!b.test(""))&&f.push(""):f.push(u.slice(p)),f.length>c?f.slice(0,c):f}:"0".split(void 0,0).length?function(e,n){return void 0===e&&0===n?[]:t.call(this,e,n)}:t,[function(t,n){var i=o(this),a=void 0==t?void 0:t[e];return void 0!==a?a.call(t,i,n):r.call(l(i),t,n)},function(e,i){var o=a(this),d=l(e),h=n(r,o,d,i,r!==t);if(h.done)return h.value;var p=s(o,RegExp),m=o.unicode,y=(o.ignoreCase?"i":"")+(o.multiline?"m":"")+(o.unicode?"u":"")+(b?"g":"y"),w=new p(b?"^(?:"+o.source+")":o,y),_=void 0===i?v:i>>>0;if(0===_)return[];if(0===d.length)return null===f(w,d)?[d]:[];for(var E=0,S=0,k=[];S1?arguments[1]:void 0,t.length)),r=s(e);return d?d.call(t,r,n):t.slice(n,n+r.length)===r}})},7397(e,t,n){"use strict";var r=n(82109),i=n(14230),a=n(43429);r({target:"String",proto:!0,forced:a("strike")},{strike:function(){return i(this,"strike","","")}})},60086(e,t,n){"use strict";var r=n(82109),i=n(14230),a=n(43429);r({target:"String",proto:!0,forced:a("sub")},{sub:function(){return i(this,"sub","","")}})},83650(e,t,n){"use strict";var r=n(82109),i=n(84488),a=n(99958),o=n(41340),s="".slice,u=Math.max,c=Math.min;r({target:"String",proto:!0},{substr:function(e,t){var n,r,l=o(i(this)),f=l.length,d=a(e);return(d===1/0&&(d=0),d<0&&(d=u(f+d,0)),(n=void 0===t?f:a(t))<=0||n===1/0)?"":(r=c(d+n,f),d>=r?"":s.call(l,d,r))}})},80623(e,t,n){"use strict";var r=n(82109),i=n(14230),a=n(43429);r({target:"String",proto:!0,forced:a("sup")},{sup:function(){return i(this,"sup","","")}})},48702(e,t,n){"use strict";var r=n(82109),i=n(53111).end,a=n(76091)("trimEnd"),o=a?function(){return i(this)}:"".trimEnd;r({target:"String",proto:!0,forced:a},{trimEnd:o,trimRight:o})},55674(e,t,n){"use strict";var r=n(82109),i=n(53111).start,a=n(76091)("trimStart"),o=a?function(){return i(this)}:"".trimStart;r({target:"String",proto:!0,forced:a},{trimStart:o,trimLeft:o})},73210(e,t,n){"use strict";var r=n(82109),i=n(53111).trim,a=n(76091);r({target:"String",proto:!0,forced:a("trim")},{trim:function(){return i(this)}})},72443(e,t,n){n(97235)("asyncIterator")},41817(e,t,n){"use strict";var r=n(82109),i=n(19781),a=n(17854),o=n(86656),s=n(70111),u=n(3070).f,c=n(99920),l=a.Symbol;if(i&&"function"==typeof l&&(!("description"in l.prototype)||void 0!==l().description)){var f={},d=function(){var e=arguments.length<1||void 0===arguments[0]?void 0:String(arguments[0]),t=this instanceof d?new l(e):void 0===e?l():l(e);return""===e&&(f[t]=!0),t};c(d,l);var h=d.prototype=l.prototype;h.constructor=d;var p=h.toString,b="Symbol(test)"==String(l("test")),m=/^Symbol\((.*)\)[^)]+$/;u(h,"description",{configurable:!0,get:function(){var e=s(this)?this.valueOf():this,t=p.call(e);if(o(f,e))return"";var n=b?t.slice(7,-1):t.replace(m,"$1");return""===n?void 0:n}}),r({global:!0,forced:!0},{Symbol:d})}},92401(e,t,n){n(97235)("hasInstance")},8722(e,t,n){n(97235)("isConcatSpreadable")},32165(e,t,n){n(97235)("iterator")},82526(e,t,n){"use strict";var r=n(82109),i=n(17854),a=n(35005),o=n(31913),s=n(19781),u=n(30133),c=n(47293),l=n(86656),f=n(43157),d=n(70111),h=n(52190),p=n(19670),b=n(47908),m=n(45656),g=n(34948),v=n(41340),y=n(79114),w=n(70030),_=n(81956),E=n(8006),S=n(1156),k=n(25181),x=n(31236),T=n(3070),M=n(55296),O=n(68880),A=n(31320),L=n(72309),C=n(6200),I=n(3501),D=n(69711),N=n(5112),P=n(6061),R=n(97235),j=n(58003),F=n(29909),Y=n(42092).forEach,B=C("hidden"),U="Symbol",H="prototype",$=N("toPrimitive"),z=F.set,G=F.getterFor(U),W=Object[H],K=i.Symbol,V=a("JSON","stringify"),q=x.f,Z=T.f,X=S.f,J=M.f,Q=L("symbols"),ee=L("op-symbols"),et=L("string-to-symbol-registry"),en=L("symbol-to-string-registry"),er=L("wks"),ei=i.QObject,ea=!ei||!ei[H]||!ei[H].findChild,eo=s&&c(function(){return 7!=w(Z({},"a",{get:function(){return Z(this,"a",{value:7}).a}})).a})?function(e,t,n){var r=q(W,t);r&&delete W[t],Z(e,t,n),r&&e!==W&&Z(W,t,r)}:Z,es=function(e,t){var n=Q[e]=w(K[H]);return z(n,{type:U,tag:e,description:t}),s||(n.description=t),n},eu=function(e,t,n){e===W&&eu(ee,t,n),p(e);var r=g(t);return(p(n),l(Q,r))?(n.enumerable?(l(e,B)&&e[B][r]&&(e[B][r]=!1),n=w(n,{enumerable:y(0,!1)})):(l(e,B)||Z(e,B,y(1,{})),e[B][r]=!0),eo(e,r,n)):Z(e,r,n)},ec=function(e,t){p(e);var n=m(t),r=_(n).concat(ep(n));return Y(r,function(t){(!s||ef.call(n,t))&&eu(e,t,n[t])}),e},el=function(e,t){return void 0===t?w(e):ec(w(e),t)},ef=function(e){var t=g(e),n=J.call(this,t);return(!(this===W&&l(Q,t))||!!l(ee,t))&&(!(n||!l(this,t)||!l(Q,t)||l(this,B)&&this[B][t])||n)},ed=function(e,t){var n=m(e),r=g(t);if(!(n===W&&l(Q,r))||l(ee,r)){var i=q(n,r);return i&&l(Q,r)&&!(l(n,B)&&n[B][r])&&(i.enumerable=!0),i}},eh=function(e){var t=X(m(e)),n=[];return Y(t,function(e){l(Q,e)||l(I,e)||n.push(e)}),n},ep=function(e){var t=e===W,n=X(t?ee:m(e)),r=[];return Y(n,function(e){l(Q,e)&&(!t||l(W,e))&&r.push(Q[e])}),r};if(u||(A((K=function(){if(this instanceof K)throw TypeError("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?v(arguments[0]):void 0,t=D(e),n=function(e){this===W&&n.call(ee,e),l(this,B)&&l(this[B],t)&&(this[B][t]=!1),eo(this,t,y(1,e))};return s&&ea&&eo(W,t,{configurable:!0,set:n}),es(t,e)})[H],"toString",function(){return G(this).tag}),A(K,"withoutSetter",function(e){return es(D(e),e)}),M.f=ef,T.f=eu,x.f=ed,E.f=S.f=eh,k.f=ep,P.f=function(e){return es(N(e),e)},s&&(Z(K[H],"description",{configurable:!0,get:function(){return G(this).description}}),o||A(W,"propertyIsEnumerable",ef,{unsafe:!0}))),r({global:!0,wrap:!0,forced:!u,sham:!u},{Symbol:K}),Y(_(er),function(e){R(e)}),r({target:U,stat:!0,forced:!u},{for:function(e){var t=v(e);if(l(et,t))return et[t];var n=K(t);return et[t]=n,en[n]=t,n},keyFor:function(e){if(!h(e))throw TypeError(e+" is not a symbol");if(l(en,e))return en[e]},useSetter:function(){ea=!0},useSimple:function(){ea=!1}}),r({target:"Object",stat:!0,forced:!u,sham:!s},{create:el,defineProperty:eu,defineProperties:ec,getOwnPropertyDescriptor:ed}),r({target:"Object",stat:!0,forced:!u},{getOwnPropertyNames:eh,getOwnPropertySymbols:ep}),r({target:"Object",stat:!0,forced:c(function(){k.f(1)})},{getOwnPropertySymbols:function(e){return k.f(b(e))}}),V){var eb=!u||c(function(){var e=K();return"[null]"!=V([e])||"{}"!=V({a:e})||"{}"!=V(Object(e))});r({target:"JSON",stat:!0,forced:eb},{stringify:function(e,t,n){for(var r,i=[e],a=1;arguments.length>a;)i.push(arguments[a++]);if(r=t,!(!d(t)&&void 0===e||h(e)))return f(t)||(t=function(e,t){if("function"==typeof r&&(t=r.call(this,e,t)),!h(t))return t}),i[1]=t,V.apply(null,i)}})}K[H][$]||O(K[H],$,K[H].valueOf),j(K,U),I[B]=!0},16066(e,t,n){n(97235)("matchAll")},69007(e,t,n){n(97235)("match")},83510(e,t,n){n(97235)("replace")},41840(e,t,n){n(97235)("search")},6982(e,t,n){n(97235)("species")},32159(e,t,n){n(97235)("split")},96649(e,t,n){n(97235)("toPrimitive")},39341(e,t,n){n(97235)("toStringTag")},60543(e,t,n){n(97235)("unscopables")},48675(e,t,n){"use strict";var r=n(90260),i=n(17466),a=n(99958),o=r.aTypedArray;(0,r.exportTypedArrayMethod)("at",function(e){var t=o(this),n=i(t.length),r=a(e),s=r>=0?r:n+r;return s<0||s>=n?void 0:t[s]})},92990(e,t,n){"use strict";var r=n(90260),i=n(1048),a=r.aTypedArray;(0,r.exportTypedArrayMethod)("copyWithin",function(e,t){return i.call(a(this),e,t,arguments.length>2?arguments[2]:void 0)})},18927(e,t,n){"use strict";var r=n(90260),i=n(42092).every,a=r.aTypedArray;(0,r.exportTypedArrayMethod)("every",function(e){return i(a(this),e,arguments.length>1?arguments[1]:void 0)})},33105(e,t,n){"use strict";var r=n(90260),i=n(21285),a=r.aTypedArray;(0,r.exportTypedArrayMethod)("fill",function(e){return i.apply(a(this),arguments)})},35035(e,t,n){"use strict";var r=n(90260),i=n(42092).filter,a=n(43074),o=r.aTypedArray;(0,r.exportTypedArrayMethod)("filter",function(e){var t=i(o(this),e,arguments.length>1?arguments[1]:void 0);return a(this,t)})},7174(e,t,n){"use strict";var r=n(90260),i=n(42092).findIndex,a=r.aTypedArray;(0,r.exportTypedArrayMethod)("findIndex",function(e){return i(a(this),e,arguments.length>1?arguments[1]:void 0)})},74345(e,t,n){"use strict";var r=n(90260),i=n(42092).find,a=r.aTypedArray;(0,r.exportTypedArrayMethod)("find",function(e){return i(a(this),e,arguments.length>1?arguments[1]:void 0)})},44197(e,t,n){n(19843)("Float32",function(e){return function(t,n,r){return e(this,t,n,r)}})},76495(e,t,n){n(19843)("Float64",function(e){return function(t,n,r){return e(this,t,n,r)}})},32846(e,t,n){"use strict";var r=n(90260),i=n(42092).forEach,a=r.aTypedArray;(0,r.exportTypedArrayMethod)("forEach",function(e){i(a(this),e,arguments.length>1?arguments[1]:void 0)})},98145(e,t,n){"use strict";var r=n(63832),i=n(90260).exportTypedArrayStaticMethod,a=n(97321);i("from",a,r)},44731(e,t,n){"use strict";var r=n(90260),i=n(41318).includes,a=r.aTypedArray;(0,r.exportTypedArrayMethod)("includes",function(e){return i(a(this),e,arguments.length>1?arguments[1]:void 0)})},77209(e,t,n){"use strict";var r=n(90260),i=n(41318).indexOf,a=r.aTypedArray;(0,r.exportTypedArrayMethod)("indexOf",function(e){return i(a(this),e,arguments.length>1?arguments[1]:void 0)})},35109(e,t,n){n(19843)("Int16",function(e){return function(t,n,r){return e(this,t,n,r)}})},65125(e,t,n){n(19843)("Int32",function(e){return function(t,n,r){return e(this,t,n,r)}})},87145(e,t,n){n(19843)("Int8",function(e){return function(t,n,r){return e(this,t,n,r)}})},96319(e,t,n){"use strict";var r=n(17854),i=n(90260),a=n(66992),o=n(5112)("iterator"),s=r.Uint8Array,u=a.values,c=a.keys,l=a.entries,f=i.aTypedArray,d=i.exportTypedArrayMethod,h=s&&s.prototype[o],p=!!h&&("values"==h.name||void 0==h.name),b=function(){return u.call(f(this))};d("entries",function(){return l.call(f(this))}),d("keys",function(){return c.call(f(this))}),d("values",b,!p),d(o,b,!p)},58867(e,t,n){"use strict";var r=n(90260),i=r.aTypedArray,a=r.exportTypedArrayMethod,o=[].join;a("join",function(e){return o.apply(i(this),arguments)})},37789(e,t,n){"use strict";var r=n(90260),i=n(86583),a=r.aTypedArray;(0,r.exportTypedArrayMethod)("lastIndexOf",function(e){return i.apply(a(this),arguments)})},33739(e,t,n){"use strict";var r=n(90260),i=n(42092).map,a=n(66304),o=r.aTypedArray;(0,r.exportTypedArrayMethod)("map",function(e){return i(o(this),e,arguments.length>1?arguments[1]:void 0,function(e,t){return new(a(e))(t)})})},95206(e,t,n){"use strict";var r=n(90260),i=n(63832),a=r.aTypedArrayConstructor;(0,r.exportTypedArrayStaticMethod)("of",function(){for(var e=0,t=arguments.length,n=new(a(this))(t);t>e;)n[e]=arguments[e++];return n},i)},14483(e,t,n){"use strict";var r=n(90260),i=n(53671).right,a=r.aTypedArray;(0,r.exportTypedArrayMethod)("reduceRight",function(e){return i(a(this),e,arguments.length,arguments.length>1?arguments[1]:void 0)})},29368(e,t,n){"use strict";var r=n(90260),i=n(53671).left,a=r.aTypedArray;(0,r.exportTypedArrayMethod)("reduce",function(e){return i(a(this),e,arguments.length,arguments.length>1?arguments[1]:void 0)})},12056(e,t,n){"use strict";var r=n(90260),i=r.aTypedArray,a=r.exportTypedArrayMethod,o=Math.floor;a("reverse",function(){for(var e,t=this,n=i(t).length,r=o(n/2),a=0;a1?arguments[1]:void 0,1),n=this.length,r=o(e),s=i(r.length),c=0;if(s+t>n)throw RangeError("Wrong length");for(;ca;)c[a]=n[a++];return c},c)},27462(e,t,n){"use strict";var r=n(90260),i=n(42092).some,a=r.aTypedArray;(0,r.exportTypedArrayMethod)("some",function(e){return i(a(this),e,arguments.length>1?arguments[1]:void 0)})},33824(e,t,n){"use strict";var r=n(90260),i=n(17854),a=n(47293),o=n(13099),s=n(17466),u=n(94362),c=n(68886),l=n(30256),f=n(7392),d=n(98008),h=r.aTypedArray,p=r.exportTypedArrayMethod,b=i.Uint16Array,m=b&&b.prototype.sort,g=!!m&&!a(function(){var e=new b(2);e.sort(null),e.sort({})}),v=!!m&&!a(function(){if(f)return f<74;if(c)return c<67;if(l)return!0;if(d)return d<602;var e,t,n=new b(516),r=Array(516);for(e=0;e<516;e++)t=e%4,n[e]=515-e,r[e]=e-2*t+3;for(n.sort(function(e,t){return(e/4|0)-(t/4|0)}),e=0;e<516;e++)if(n[e]!==r[e])return!0}),y=function(e){return function(t,n){return void 0!==e?+e(t,n)||0:n!=n?-1:t!=t?1:0===t&&0===n?1/t>0&&1/n<0?1:-1:t>n}};p("sort",function(e){var t,n=this;if(void 0!==e&&o(e),v)return m.call(n,e);h(n);var r=s(n.length),i=Array(r);for(t=0;t1?arguments[1]:void 0)}}),a("filterOut")},34286(e,t,n){"use strict";var r=n(82109),i=n(42092).filterReject,a=n(51223);r({target:"Array",proto:!0},{filterReject:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),a("filterReject")},77461(e,t,n){"use strict";var r=n(82109),i=n(9671).findLastIndex,a=n(51223);r({target:"Array",proto:!0},{findLastIndex:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),a("findLastIndex")},3048(e,t,n){"use strict";var r=n(82109),i=n(9671).findLast,a=n(51223);r({target:"Array",proto:!0},{findLast:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),a("findLast")},1999(e,t,n){"use strict";var r=n(82109),i=n(61386),a=n(77475),o=n(51223);r({target:"Array",proto:!0},{groupBy:function(e){var t=arguments.length>1?arguments[1]:void 0;return i(this,e,t,a)}}),o("groupBy")},8e4(e,t,n){var r=n(82109),i=n(43157),a=Object.isFrozen,o=function(e,t){if(!a||!i(e)||!a(e))return!1;for(var n,r=0,o=e.length;r1?arguments[1]:void 0,3);return!u(n,function(e,n,i){if(!r(n,e,t))return i()},{AS_ENTRIES:!0,IS_ITERATOR:!0,INTERRUPTED:!0}).stopped}})},71957(e,t,n){"use strict";var r=n(82109),i=n(31913),a=n(35005),o=n(19670),s=n(13099),u=n(49974),c=n(36707),l=n(54647),f=n(20408);r({target:"Map",proto:!0,real:!0,forced:i},{filter:function(e){var t=o(this),n=l(t),r=u(e,arguments.length>1?arguments[1]:void 0,3),i=new(c(t,a("Map"))),d=s(i.set);return f(n,function(e,n){r(n,e,t)&&d.call(i,e,n)},{AS_ENTRIES:!0,IS_ITERATOR:!0}),i}})},103(e,t,n){"use strict";var r=n(82109),i=n(31913),a=n(19670),o=n(49974),s=n(54647),u=n(20408);r({target:"Map",proto:!0,real:!0,forced:i},{findKey:function(e){var t=a(this),n=s(t),r=o(e,arguments.length>1?arguments[1]:void 0,3);return u(n,function(e,n,i){if(r(n,e,t))return i(e)},{AS_ENTRIES:!0,IS_ITERATOR:!0,INTERRUPTED:!0}).result}})},96306(e,t,n){"use strict";var r=n(82109),i=n(31913),a=n(19670),o=n(49974),s=n(54647),u=n(20408);r({target:"Map",proto:!0,real:!0,forced:i},{find:function(e){var t=a(this),n=s(t),r=o(e,arguments.length>1?arguments[1]:void 0,3);return u(n,function(e,n,i){if(r(n,e,t))return i(n)},{AS_ENTRIES:!0,IS_ITERATOR:!0,INTERRUPTED:!0}).result}})},8582(e,t,n){var r=n(82109),i=n(27296);r({target:"Map",stat:!0},{from:i})},90618(e,t,n){"use strict";var r=n(82109),i=n(20408),a=n(13099);r({target:"Map",stat:!0},{groupBy:function(e,t){var n=new this;a(t);var r=a(n.has),o=a(n.get),s=a(n.set);return i(e,function(e){var i=t(e);r.call(n,i)?o.call(n,i).push(e):s.call(n,i,[e])}),n}})},74592(e,t,n){"use strict";var r=n(82109),i=n(31913),a=n(19670),o=n(54647),s=n(46465),u=n(20408);r({target:"Map",proto:!0,real:!0,forced:i},{includes:function(e){return u(o(a(this)),function(t,n,r){if(s(n,e))return r()},{AS_ENTRIES:!0,IS_ITERATOR:!0,INTERRUPTED:!0}).stopped}})},88440(e,t,n){"use strict";var r=n(82109),i=n(20408),a=n(13099);r({target:"Map",stat:!0},{keyBy:function(e,t){var n=new this;a(t);var r=a(n.set);return i(e,function(e){r.call(n,t(e),e)}),n}})},58276(e,t,n){"use strict";var r=n(82109),i=n(31913),a=n(19670),o=n(54647),s=n(20408);r({target:"Map",proto:!0,real:!0,forced:i},{keyOf:function(e){return s(o(a(this)),function(t,n,r){if(n===e)return r(t)},{AS_ENTRIES:!0,IS_ITERATOR:!0,INTERRUPTED:!0}).result}})},35082(e,t,n){"use strict";var r=n(82109),i=n(31913),a=n(35005),o=n(19670),s=n(13099),u=n(49974),c=n(36707),l=n(54647),f=n(20408);r({target:"Map",proto:!0,real:!0,forced:i},{mapKeys:function(e){var t=o(this),n=l(t),r=u(e,arguments.length>1?arguments[1]:void 0,3),i=new(c(t,a("Map"))),d=s(i.set);return f(n,function(e,n){d.call(i,r(n,e,t),n)},{AS_ENTRIES:!0,IS_ITERATOR:!0}),i}})},12813(e,t,n){"use strict";var r=n(82109),i=n(31913),a=n(35005),o=n(19670),s=n(13099),u=n(49974),c=n(36707),l=n(54647),f=n(20408);r({target:"Map",proto:!0,real:!0,forced:i},{mapValues:function(e){var t=o(this),n=l(t),r=u(e,arguments.length>1?arguments[1]:void 0,3),i=new(c(t,a("Map"))),d=s(i.set);return f(n,function(e,n){d.call(i,e,r(n,e,t))},{AS_ENTRIES:!0,IS_ITERATOR:!0}),i}})},18222(e,t,n){"use strict";var r=n(82109),i=n(31913),a=n(19670),o=n(13099),s=n(20408);r({target:"Map",proto:!0,real:!0,forced:i},{merge:function(e){for(var t=a(this),n=o(t.set),r=arguments.length,i=0;i1?arguments[1]:void 0,3);return u(n,function(e,n,i){if(r(n,e,t))return i()},{AS_ENTRIES:!0,IS_ITERATOR:!0,INTERRUPTED:!0}).stopped}})},74442(e,t,n){"use strict";var r=n(82109),i=n(31913),a=n(8154);r({target:"Map",proto:!0,real:!0,forced:i},{updateOrInsert:a})},7512(e,t,n){"use strict";var r=n(82109),i=n(31913),a=n(19670),o=n(13099);r({target:"Map",proto:!0,real:!0,forced:i},{update:function(e,t){var n=a(this),r=arguments.length;o(t);var i=n.has(e);if(!i&&r<3)throw TypeError("Updating absent value");var s=i?n.get(e):o(r>2?arguments[2]:void 0)(e,n);return n.set(e,t(s,e,n)),n}})},87713(e,t,n){"use strict";var r=n(82109),i=n(31913),a=n(8154);r({target:"Map",proto:!0,real:!0,forced:i},{upsert:a})},46603(e,t,n){var r=n(82109),i=Math.min,a=Math.max;r({target:"Math",stat:!0},{clamp:function(e,t,n){return i(n,a(t,e))}})},70100(e,t,n){n(82109)({target:"Math",stat:!0},{DEG_PER_RAD:Math.PI/180})},26429(e,t,n){var r=n(82109),i=180/Math.PI;r({target:"Math",stat:!0},{degrees:function(e){return e*i}})},13187(e,t,n){var r=n(82109),i=n(47103),a=n(26130);r({target:"Math",stat:!0},{fscale:function(e,t,n,r,o){return a(i(e,t,n,r,o))}})},60092(e,t,n){n(82109)({target:"Math",stat:!0},{iaddh:function(e,t,n,r){var i=e>>>0,a=n>>>0;return(t>>>0)+(r>>>0)+((i&a|(i|a)&~(i+a>>>0))>>>31)|0}})},19041(e,t,n){n(82109)({target:"Math",stat:!0},{imulh:function(e,t){var n=65535,r=+e,i=+t,a=r&n,o=i&n,s=r>>16,u=i>>16,c=(s*o>>>0)+(a*o>>>16);return s*u+(c>>16)+((a*u>>>0)+(c&n)>>16)}})},30666(e,t,n){n(82109)({target:"Math",stat:!0},{isubh:function(e,t,n,r){var i=e>>>0,a=n>>>0;return(t>>>0)-(r>>>0)-((~i&a|~(i^a)&i-a>>>0)>>>31)|0}})},51638(e,t,n){n(82109)({target:"Math",stat:!0},{RAD_PER_DEG:180/Math.PI})},62975(e,t,n){var r=n(82109),i=Math.PI/180;r({target:"Math",stat:!0},{radians:function(e){return e*i}})},15728(e,t,n){var r=n(82109),i=n(47103);r({target:"Math",stat:!0},{scale:i})},46056(e,t,n){var r=n(82109),i=n(19670),a=n(77023),o=n(24994),s=n(29909),u="Seeded Random",c=u+" Generator",l=s.set,f=s.getterFor(c),d='Math.seededPRNG() argument should have a "seed" field with a finite value.',h=o(function(e){l(this,{type:c,seed:e%2147483647})},u,function(){var e=f(this);return{value:(1073741823&(e.seed=(1103515245*e.seed+12345)%2147483647))/1073741823,done:!1}});r({target:"Math",stat:!0,forced:!0},{seededPRNG:function(e){var t=i(e).seed;if(!a(t))throw TypeError(d);return new h(t)}})},44299(e,t,n){n(82109)({target:"Math",stat:!0},{signbit:function(e){return(e=+e)==e&&0==e?1/e==-1/0:e<0}})},5162(e,t,n){n(82109)({target:"Math",stat:!0},{umulh:function(e,t){var n=65535,r=+e,i=+t,a=r&n,o=i&n,s=r>>>16,u=i>>>16,c=(s*o>>>0)+(a*o>>>16);return s*u+(c>>>16)+((a*u>>>0)+(c&n)>>>16)}})},50292(e,t,n){"use strict";var r=n(82109),i=n(99958),a=n(83009),o="Invalid number representation",s="Invalid radix",u=/^[\da-z]+$/;r({target:"Number",stat:!0},{fromString:function(e,t){var n,r,c=1;if("string"!=typeof e)throw TypeError(o);if(!e.length||"-"==e.charAt(0)&&(c=-1,!(e=e.slice(1)).length))throw SyntaxError(o);if((n=void 0===t?10:i(t))<2||n>36)throw RangeError(s);if(!u.test(e)||(r=a(e,n)).toString(n)!==e)throw SyntaxError(o);return c*r}})},29427(e,t,n){"use strict";var r=n(82109),i=n(80430);r({target:"Number",stat:!0},{range:function(e,t,n){return new i(e,t,n,"number",0,1)}})},96936(e,t,n){n(46314)},99964(e,t,n){"use strict";var r=n(82109),i=n(60996);r({target:"Object",stat:!0},{iterateEntries:function(e){return new i(e,"entries")}})},75238(e,t,n){"use strict";var r=n(82109),i=n(60996);r({target:"Object",stat:!0},{iterateKeys:function(e){return new i(e,"keys")}})},4987(e,t,n){"use strict";var r=n(82109),i=n(60996);r({target:"Object",stat:!0},{iterateValues:function(e){return new i(e,"values")}})},1025(e,t,n){"use strict";var r=n(82109),i=n(19781),a=n(96340),o=n(13099),s=n(19670),u=n(70111),c=n(25787),l=n(3070).f,f=n(68880),d=n(12248),h=n(18554),p=n(58173),b=n(20408),m=n(842),g=n(5112),v=n(29909),y=g("observable"),w=v.get,_=v.set,E=function(e){var t=e.cleanup;if(t){e.cleanup=void 0;try{t()}catch(n){m(n)}}},S=function(e){return void 0===e.observer},k=function(e){var t=e.facade;if(!i){t.closed=!0;var n=e.subscriptionObserver;n&&(n.closed=!0)}e.observer=void 0},x=function(e,t){var n,r=_(this,{cleanup:void 0,observer:s(e),subscriptionObserver:void 0});i||(this.closed=!1);try{(n=p(e.start))&&n.call(e,this)}catch(a){m(a)}if(!S(r)){var u=r.subscriptionObserver=new T(this);try{var c=t(u),l=c;null!=c&&(r.cleanup="function"==typeof c.unsubscribe?function(){l.unsubscribe()}:o(c))}catch(f){u.error(f);return}S(r)&&E(r)}};x.prototype=d({},{unsubscribe:function(){var e=w(this);S(e)||(k(e),E(e))}}),i&&l(x.prototype,"closed",{configurable:!0,get:function(){return S(w(this))}});var T=function(e){_(this,{subscription:e}),i||(this.closed=!1)};T.prototype=d({},{next:function(e){var t=w(w(this).subscription);if(!S(t)){var n=t.observer;try{var r=p(n.next);r&&r.call(n,e)}catch(i){m(i)}}},error:function(e){var t=w(w(this).subscription);if(!S(t)){var n=t.observer;k(t);try{var r=p(n.error);r?r.call(n,e):m(e)}catch(i){m(i)}E(t)}},complete:function(){var e=w(w(this).subscription);if(!S(e)){var t=e.observer;k(e);try{var n=p(t.complete);n&&n.call(t)}catch(r){m(r)}E(e)}}}),i&&l(T.prototype,"closed",{configurable:!0,get:function(){return S(w(w(this).subscription))}});var M=function(e){c(this,M,"Observable"),_(this,{subscriber:o(e)})};d(M.prototype,{subscribe:function(e){var t=arguments.length;return new x("function"==typeof e?{next:e,error:t>1?arguments[1]:void 0,complete:t>2?arguments[2]:void 0}:u(e)?e:{},w(this).subscriber)}}),d(M,{from:function(e){var t="function"==typeof this?this:M,n=p(s(e)[y]);if(n){var r=s(n.call(e));return r.constructor===t?r:new t(function(e){return r.subscribe(e)})}var i=h(e);return new t(function(e){b(i,function(t,n){if(e.next(t),e.closed)return n()},{IS_ITERATOR:!0,INTERRUPTED:!0}),e.complete()})},of:function(){for(var e="function"==typeof this?this:M,t=arguments.length,n=Array(t),r=0;r1?arguments[1]:void 0,3);return!u(n,function(e,n){if(!r(e,e,t))return n()},{IS_ITERATOR:!0,INTERRUPTED:!0}).stopped}})},64362(e,t,n){"use strict";var r=n(82109),i=n(31913),a=n(35005),o=n(19670),s=n(13099),u=n(49974),c=n(36707),l=n(96767),f=n(20408);r({target:"Set",proto:!0,real:!0,forced:i},{filter:function(e){var t=o(this),n=l(t),r=u(e,arguments.length>1?arguments[1]:void 0,3),i=new(c(t,a("Set"))),d=s(i.add);return f(n,function(e){r(e,e,t)&&d.call(i,e)},{IS_ITERATOR:!0}),i}})},15389(e,t,n){"use strict";var r=n(82109),i=n(31913),a=n(19670),o=n(49974),s=n(96767),u=n(20408);r({target:"Set",proto:!0,real:!0,forced:i},{find:function(e){var t=a(this),n=s(t),r=o(e,arguments.length>1?arguments[1]:void 0,3);return u(n,function(e,n){if(r(e,e,t))return n(e)},{IS_ITERATOR:!0,INTERRUPTED:!0}).result}})},46006(e,t,n){var r=n(82109),i=n(27296);r({target:"Set",stat:!0},{from:i})},90401(e,t,n){"use strict";var r=n(82109),i=n(31913),a=n(35005),o=n(19670),s=n(13099),u=n(36707),c=n(20408);r({target:"Set",proto:!0,real:!0,forced:i},{intersection:function(e){var t=o(this),n=new(u(t,a("Set"))),r=s(t.has),i=s(n.add);return c(e,function(e){r.call(t,e)&&i.call(n,e)}),n}})},45164(e,t,n){"use strict";var r=n(82109),i=n(31913),a=n(19670),o=n(13099),s=n(20408);r({target:"Set",proto:!0,real:!0,forced:i},{isDisjointFrom:function(e){var t=a(this),n=o(t.has);return!s(e,function(e,r){if(!0===n.call(t,e))return r()},{INTERRUPTED:!0}).stopped}})},91238(e,t,n){"use strict";var r=n(82109),i=n(31913),a=n(35005),o=n(19670),s=n(13099),u=n(18554),c=n(20408);r({target:"Set",proto:!0,real:!0,forced:i},{isSubsetOf:function(e){var t=u(this),n=o(e),r=n.has;return"function"!=typeof r&&(n=new(a("Set"))(e),r=s(n.has)),!c(t,function(e,t){if(!1===r.call(n,e))return t()},{IS_ITERATOR:!0,INTERRUPTED:!0}).stopped}})},54837(e,t,n){"use strict";var r=n(82109),i=n(31913),a=n(19670),o=n(13099),s=n(20408);r({target:"Set",proto:!0,real:!0,forced:i},{isSupersetOf:function(e){var t=a(this),n=o(t.has);return!s(e,function(e,r){if(!1===n.call(t,e))return r()},{INTERRUPTED:!0}).stopped}})},87485(e,t,n){"use strict";var r=n(82109),i=n(31913),a=n(19670),o=n(96767),s=n(20408);r({target:"Set",proto:!0,real:!0,forced:i},{join:function(e){var t=a(this),n=o(t),r=void 0===e?",":String(e),i=[];return s(n,i.push,{that:i,IS_ITERATOR:!0}),i.join(r)}})},56767(e,t,n){"use strict";var r=n(82109),i=n(31913),a=n(35005),o=n(19670),s=n(13099),u=n(49974),c=n(36707),l=n(96767),f=n(20408);r({target:"Set",proto:!0,real:!0,forced:i},{map:function(e){var t=o(this),n=l(t),r=u(e,arguments.length>1?arguments[1]:void 0,3),i=new(c(t,a("Set"))),d=s(i.add);return f(n,function(e){d.call(i,r(e,e,t))},{IS_ITERATOR:!0}),i}})},69916(e,t,n){var r=n(82109),i=n(82044);r({target:"Set",stat:!0},{of:i})},76651(e,t,n){"use strict";var r=n(82109),i=n(31913),a=n(19670),o=n(13099),s=n(96767),u=n(20408);r({target:"Set",proto:!0,real:!0,forced:i},{reduce:function(e){var t=a(this),n=s(t),r=arguments.length<2,i=r?void 0:arguments[1];if(o(e),u(n,function(n){r?(r=!1,i=n):i=e(i,n,n,t)},{IS_ITERATOR:!0}),r)throw TypeError("Reduce of empty set with no initial value");return i}})},61437(e,t,n){"use strict";var r=n(82109),i=n(31913),a=n(19670),o=n(49974),s=n(96767),u=n(20408);r({target:"Set",proto:!0,real:!0,forced:i},{some:function(e){var t=a(this),n=s(t),r=o(e,arguments.length>1?arguments[1]:void 0,3);return u(n,function(e,n){if(r(e,e,t))return n()},{IS_ITERATOR:!0,INTERRUPTED:!0}).stopped}})},35285(e,t,n){"use strict";var r=n(82109),i=n(31913),a=n(35005),o=n(19670),s=n(13099),u=n(36707),c=n(20408);r({target:"Set",proto:!0,real:!0,forced:i},{symmetricDifference:function(e){var t=o(this),n=new(u(t,a("Set")))(t),r=s(n.delete),i=s(n.add);return c(e,function(e){r.call(n,e)||i.call(n,e)}),n}})},39865(e,t,n){"use strict";var r=n(82109),i=n(31913),a=n(35005),o=n(19670),s=n(13099),u=n(36707),c=n(20408);r({target:"Set",proto:!0,real:!0,forced:i},{union:function(e){var t=o(this),n=new(u(t,a("Set")))(t);return c(e,s(n.add),{that:n}),n}})},86035(e,t,n){"use strict";var r=n(82109),i=n(28710).charAt,a=n(47293)(function(){return"𠮷"!=="𠮷".at(0)});r({target:"String",proto:!0,forced:a},{at:function(e){return i(this,e)}})},67501(e,t,n){"use strict";var r=n(82109),i=n(24994),a=n(84488),o=n(41340),s=n(29909),u=n(28710),c=u.codeAt,l=u.charAt,f="String Iterator",d=s.set,h=s.getterFor(f),p=i(function(e){d(this,{type:f,string:e,index:0})},"String",function(){var e,t=h(this),n=t.string,r=t.index;return r>=n.length?{value:void 0,done:!0}:(e=l(n,r),t.index+=e.length,{value:{codePoint:c(e,0),position:r},done:!1})});r({target:"String",proto:!0},{codePoints:function(){return new p(o(a(this)))}})},13728(e,t,n){n(76373)},27207(e,t,n){n(68757)},609(e,t,n){n(97235)("asyncDispose")},21568(e,t,n){n(97235)("dispose")},54534(e,t,n){n(97235)("matcher")},95090(e,t,n){n(97235)("metadata")},48824(e,t,n){n(97235)("observable")},44130(e,t,n){n(97235)("patternMatch")},35954(e,t,n){n(97235)("replaceAll")},38012(e,t,n){n(48675)},26182(e,t,n){"use strict";var r=n(90260),i=n(42092).filterReject,a=n(43074),o=r.aTypedArray;(0,r.exportTypedArrayMethod)("filterOut",function(e){var t=i(o(this),e,arguments.length>1?arguments[1]:void 0);return a(this,t)})},8922(e,t,n){"use strict";var r=n(90260),i=n(42092).filterReject,a=n(43074),o=r.aTypedArray;(0,r.exportTypedArrayMethod)("filterReject",function(e){var t=i(o(this),e,arguments.length>1?arguments[1]:void 0);return a(this,t)})},1118(e,t,n){"use strict";var r=n(90260),i=n(9671).findLastIndex,a=r.aTypedArray;(0,r.exportTypedArrayMethod)("findLastIndex",function(e){return i(a(this),e,arguments.length>1?arguments[1]:void 0)})},37380(e,t,n){"use strict";var r=n(90260),i=n(9671).findLast,a=r.aTypedArray;(0,r.exportTypedArrayMethod)("findLast",function(e){return i(a(this),e,arguments.length>1?arguments[1]:void 0)})},5835(e,t,n){"use strict";var r=n(90260),i=n(61386),a=n(66304),o=r.aTypedArray;(0,r.exportTypedArrayMethod)("groupBy",function(e){var t=arguments.length>1?arguments[1]:void 0;return i(o(this),e,t,a)})},84444(e,t,n){"use strict";var r=n(90260),i=n(60956),a=n(43074),o=r.aTypedArray;(0,r.exportTypedArrayMethod)("uniqueBy",function(e){return a(this,i.call(o(this),e))})},78206(e,t,n){"use strict";var r=n(82109),i=n(31913),a=n(34092);r({target:"WeakMap",proto:!0,real:!0,forced:i},{deleteAll:function(){return a.apply(this,arguments)}})},12714(e,t,n){"use strict";var r=n(82109),i=n(31913),a=n(37502);r({target:"WeakMap",proto:!0,real:!0,forced:i},{emplace:a})},76478(e,t,n){var r=n(82109),i=n(27296);r({target:"WeakMap",stat:!0},{from:i})},79715(e,t,n){var r=n(82109),i=n(82044);r({target:"WeakMap",stat:!0},{of:i})},5964(e,t,n){"use strict";var r=n(82109),i=n(31913),a=n(8154);r({target:"WeakMap",proto:!0,real:!0,forced:i},{upsert:a})},43561(e,t,n){"use strict";var r=n(82109),i=n(31913),a=n(31501);r({target:"WeakSet",proto:!0,real:!0,forced:i},{addAll:function(){return a.apply(this,arguments)}})},32049(e,t,n){"use strict";var r=n(82109),i=n(31913),a=n(34092);r({target:"WeakSet",proto:!0,real:!0,forced:i},{deleteAll:function(){return a.apply(this,arguments)}})},86020(e,t,n){var r=n(82109),i=n(27296);r({target:"WeakSet",stat:!0},{from:i})},56585(e,t,n){var r=n(82109),i=n(82044);r({target:"WeakSet",stat:!0},{of:i})},54747(e,t,n){var r=n(17854),i=n(48324),a=n(18533),o=n(68880);for(var s in i){var u=r[s],c=u&&u.prototype;if(c&&c.forEach!==a)try{o(c,"forEach",a)}catch(l){c.forEach=a}}},33948(e,t,n){var r=n(17854),i=n(48324),a=n(66992),o=n(68880),s=n(5112),u=s("iterator"),c=s("toStringTag"),l=a.values;for(var f in i){var d=r[f],h=d&&d.prototype;if(h){if(h[u]!==l)try{o(h,u,l)}catch(p){h[u]=l}if(h[c]||o(h,c,f),i[f]){for(var b in a)if(h[b]!==a[b])try{o(h,b,a[b])}catch(m){h[b]=a[b]}}}}},84633(e,t,n){var r=n(82109),i=n(17854),a=n(20261);r({global:!0,bind:!0,enumerable:!0,forced:!i.setImmediate||!i.clearImmediate},{setImmediate:a.set,clearImmediate:a.clear})},85844(e,t,n){var r=n(82109),i=n(17854),a=n(95948),o=n(35268),s=i.process;r({global:!0,enumerable:!0,noTargetGet:!0},{queueMicrotask:function(e){var t=o&&s.domain;a(t?t.bind(e):e)}})},32564(e,t,n){var r=n(82109),i=n(17854),a=n(88113),o=[].slice,s=/MSIE .\./.test(a),u=function(e){return function(t,n){var r=arguments.length>2,i=r?o.call(arguments,2):void 0;return e(r?function(){("function"==typeof t?t:Function(t)).apply(this,i)}:t,n)}};r({global:!0,bind:!0,forced:s},{setTimeout:u(i.setTimeout),setInterval:u(i.setInterval)})},41637(e,t,n){"use strict";n(66992);var r=n(82109),i=n(35005),a=n(590),o=n(31320),s=n(12248),u=n(58003),c=n(24994),l=n(29909),f=n(25787),d=n(86656),h=n(49974),p=n(70648),b=n(19670),m=n(70111),g=n(41340),v=n(70030),y=n(79114),w=n(18554),_=n(71246),E=n(5112),S=i("fetch"),k=i("Request"),x=k&&k.prototype,T=i("Headers"),M=E("iterator"),O="URLSearchParams",A=O+"Iterator",L=l.set,C=l.getterFor(O),I=l.getterFor(A),D=/\+/g,N=[,,,,],P=function(e){return N[e-1]||(N[e-1]=RegExp("((?:%[\\da-f]{2}){"+e+"})","gi"))},R=function(e){try{return decodeURIComponent(e)}catch(t){return e}},j=function(e){var t=e.replace(D," "),n=4;try{return decodeURIComponent(t)}catch(r){for(;n;)t=t.replace(P(n--),R);return t}},F=/[!'()~]|%20/g,Y={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},B=function(e){return Y[e]},U=function(e){return encodeURIComponent(e).replace(F,B)},H=function(e,t){if(t)for(var n,r,i=t.split("&"),a=0;a0?arguments[0]:void 0,l=this,h=[];if(L(l,{type:O,entries:h,updateURL:function(){},updateSearchParams:$}),void 0!==c){if(m(c)){if("function"==typeof(e=_(c)))for(n=(t=w(c,e)).next;!(r=n.call(t)).done;){if((o=(a=(i=w(b(r.value))).next).call(i)).done||(s=a.call(i)).done||!a.call(i).done)throw TypeError("Expected sequence with length 2");h.push({key:g(o.value),value:g(s.value)})}else for(u in c)d(c,u)&&h.push({key:u,value:g(c[u])})}else H(h,"string"==typeof c?"?"===c.charAt(0)?c.slice(1):c:g(c))}},K=W.prototype;if(s(K,{append:function(e,t){z(arguments.length,2);var n=C(this);n.entries.push({key:g(e),value:g(t)}),n.updateURL()},delete:function(e){z(arguments.length,1);for(var t=C(this),n=t.entries,r=g(e),i=0;ie.key){i.splice(t,0,e);break}t===n&&i.push(e)}r.updateURL()},forEach:function(e){for(var t,n=C(this).entries,r=h(e,arguments.length>1?arguments[1]:void 0,3),i=0;i1?V(arguments[1]):{})}}),"function"==typeof k){var q=function(e){return f(this,q,"Request"),new k(e,arguments.length>1?V(arguments[1]):{})};x.constructor=q,q.prototype=x,r({global:!0,forced:!0},{Request:q})}}e.exports={URLSearchParams:W,getState:C}},60285(e,t,n){"use strict";n(78783);var r,i=n(82109),a=n(19781),o=n(590),s=n(17854),u=n(36048),c=n(31320),l=n(25787),f=n(86656),d=n(21574),h=n(48457),p=n(28710).codeAt,b=n(33197),m=n(41340),g=n(58003),v=n(41637),y=n(29909),w=s.URL,_=v.URLSearchParams,E=v.getState,S=y.set,k=y.getterFor("URL"),x=Math.floor,T=Math.pow,M="Invalid authority",O="Invalid scheme",A="Invalid host",L="Invalid port",C=/[A-Za-z]/,I=/[\d+-.A-Za-z]/,D=/\d/,N=/^0x/i,P=/^[0-7]+$/,R=/^\d+$/,j=/^[\dA-Fa-f]+$/,F=/[\0\t\n\r #%/:<>?@[\\\]^|]/,Y=/[\0\t\n\r #/:<>?@[\\\]^|]/,B=/^[\u0000-\u0020]+|[\u0000-\u0020]+$/g,U=/[\t\n\r]/g,H=function(e,t){var n,r,i;if("["==t.charAt(0)){if("]"!=t.charAt(t.length-1)||!(n=z(t.slice(1,-1))))return A;e.host=n}else if(Q(e)){if(t=b(t),F.test(t)||null===(n=$(t)))return A;e.host=n}else{if(Y.test(t))return A;for(i=0,n="",r=h(t);i4)return e;for(r=0,n=[];r1&&"0"==i.charAt(0)&&(a=N.test(i)?16:8,i=i.slice(8==a?1:2)),""===i)o=0;else{if(!(10==a?R:8==a?P:j).test(i))return e;o=parseInt(i,a)}n.push(o)}for(r=0;r=T(256,5-t))return null}else if(o>255)return null;for(r=0,s=n.pop();r6))return;for(r=0;d();){if(i=null,r>0){if("."!=d()||!(r<4))return;f++}if(!D.test(d()))return;for(;D.test(d());){if(a=parseInt(d(),10),null===i)i=a;else{if(0==i)return;i=10*i+a}if(i>255)return;f++}u[c]=256*u[c]+i,(2==++r||4==r)&&c++}if(4!=r)return;break}if(":"==d()){if(f++,!d())return}else if(d())return;u[c++]=t}if(null!==l)for(o=c-l,c=7;0!=c&&o>0;)s=u[c],u[c--]=u[l+o-1],u[l+--o]=s;else if(8!=c)return;return u},G=function(e){for(var t=null,n=1,r=null,i=0,a=0;a<8;a++)0!==e[a]?(i>n&&(t=r,n=i),r=null,i=0):(null===r&&(r=a),++i);return i>n&&(t=r,n=i),t},W=function(e){var t,n,r,i;if("number"==typeof e){for(n=0,t=[];n<4;n++)t.unshift(e%256),e=x(e/256);return t.join(".")}if("object"==typeof e){for(n=0,t="",r=G(e);n<8;n++)(!i||0!==e[n])&&(i&&(i=!1),r===n?(t+=n?":":"::",i=!0):(t+=e[n].toString(16),n<7&&(t+=":")));return"["+t+"]"}return e},K={},V=d({},K,{" ":1,'"':1,"<":1,">":1,"`":1}),q=d({},V,{"#":1,"?":1,"{":1,"}":1}),Z=d({},q,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),X=function(e,t){var n=p(e,0);return n>32&&n<127&&!f(t,e)?e:encodeURIComponent(e)},J={ftp:21,file:null,http:80,https:443,ws:80,wss:443},Q=function(e){return f(J,e.scheme)},ee=function(e){return""!=e.username||""!=e.password},et=function(e){return!e.host||e.cannotBeABaseURL||"file"==e.scheme},en=function(e,t){var n;return 2==e.length&&C.test(e.charAt(0))&&(":"==(n=e.charAt(1))||!t&&"|"==n)},er=function(e){var t;return e.length>1&&en(e.slice(0,2))&&(2==e.length||"/"===(t=e.charAt(2))||"\\"===t||"?"===t||"#"===t)},ei=function(e){var t=e.path,n=t.length;n&&("file"!=e.scheme||1!=n||!en(t[0],!0))&&t.pop()},ea=function(e){return"."===e||"%2e"===e.toLowerCase()},eo=function(e){return".."===(e=e.toLowerCase())||"%2e."===e||".%2e"===e||"%2e%2e"===e},es={},eu={},ec={},el={},ef={},ed={},eh={},ep={},eb={},em={},eg={},ev={},ey={},ew={},e_={},eE={},eS={},ek={},ex={},eT={},eM={},eO=function(e,t,n,i){var a,o,s,u,c=n||es,l=0,d="",p=!1,b=!1,m=!1;for(n||(e.scheme="",e.username="",e.password="",e.host=null,e.port=null,e.path=[],e.query=null,e.fragment=null,e.cannotBeABaseURL=!1,t=t.replace(B,"")),t=t.replace(U,""),a=h(t);l<=a.length;){switch(o=a[l],c){case es:if(o&&C.test(o))d+=o.toLowerCase(),c=eu;else{if(n)return O;c=ec;continue}break;case eu:if(o&&(I.test(o)||"+"==o||"-"==o||"."==o))d+=o.toLowerCase();else if(":"==o){if(n&&(Q(e)!=f(J,d)||"file"==d&&(ee(e)||null!==e.port)||"file"==e.scheme&&!e.host))return;if(e.scheme=d,n){Q(e)&&J[e.scheme]==e.port&&(e.port=null);return}d="","file"==e.scheme?c=ew:Q(e)&&i&&i.scheme==e.scheme?c=el:Q(e)?c=ep:"/"==a[l+1]?(c=ef,l++):(e.cannotBeABaseURL=!0,e.path.push(""),c=ex)}else{if(n)return O;d="",c=ec,l=0;continue}break;case ec:if(!i||i.cannotBeABaseURL&&"#"!=o)return O;if(i.cannotBeABaseURL&&"#"==o){e.scheme=i.scheme,e.path=i.path.slice(),e.query=i.query,e.fragment="",e.cannotBeABaseURL=!0,c=eM;break}c="file"==i.scheme?ew:ed;continue;case el:if("/"==o&&"/"==a[l+1])c=eb,l++;else{c=ed;continue}break;case ef:if("/"==o){c=em;break}c=ek;continue;case ed:if(e.scheme=i.scheme,o==r)e.username=i.username,e.password=i.password,e.host=i.host,e.port=i.port,e.path=i.path.slice(),e.query=i.query;else if("/"==o||"\\"==o&&Q(e))c=eh;else if("?"==o)e.username=i.username,e.password=i.password,e.host=i.host,e.port=i.port,e.path=i.path.slice(),e.query="",c=eT;else if("#"==o)e.username=i.username,e.password=i.password,e.host=i.host,e.port=i.port,e.path=i.path.slice(),e.query=i.query,e.fragment="",c=eM;else{e.username=i.username,e.password=i.password,e.host=i.host,e.port=i.port,e.path=i.path.slice(),e.path.pop(),c=ek;continue}break;case eh:if(Q(e)&&("/"==o||"\\"==o))c=eb;else if("/"==o)c=em;else{e.username=i.username,e.password=i.password,e.host=i.host,e.port=i.port,c=ek;continue}break;case ep:if(c=eb,"/"!=o||"/"!=d.charAt(l+1))continue;l++;break;case eb:if("/"!=o&&"\\"!=o){c=em;continue}break;case em:if("@"==o){p&&(d="%40"+d),p=!0,s=h(d);for(var g=0;g65535)return L;e.port=Q(e)&&w===J[e.scheme]?null:w,d=""}if(n)return;c=eS;continue}break;case ew:if(e.scheme="file","/"==o||"\\"==o)c=e_;else if(i&&"file"==i.scheme){if(o==r)e.host=i.host,e.path=i.path.slice(),e.query=i.query;else if("?"==o)e.host=i.host,e.path=i.path.slice(),e.query="",c=eT;else if("#"==o)e.host=i.host,e.path=i.path.slice(),e.query=i.query,e.fragment="",c=eM;else{er(a.slice(l).join(""))||(e.host=i.host,e.path=i.path.slice(),ei(e)),c=ek;continue}}else{c=ek;continue}break;case e_:if("/"==o||"\\"==o){c=eE;break}i&&"file"==i.scheme&&!er(a.slice(l).join(""))&&(en(i.path[0],!0)?e.path.push(i.path[0]):e.host=i.host),c=ek;continue;case eE:if(o==r||"/"==o||"\\"==o||"?"==o||"#"==o){if(!n&&en(d))c=ek;else if(""==d){if(e.host="",n)return;c=eS}else{if(u=H(e,d))return u;if("localhost"==e.host&&(e.host=""),n)return;d="",c=eS}continue}d+=o;break;case eS:if(Q(e)){if(c=ek,"/"!=o&&"\\"!=o)continue}else if(n||"?"!=o){if(n||"#"!=o){if(o!=r&&(c=ek,"/"!=o))continue}else e.fragment="",c=eM}else e.query="",c=eT;break;case ek:if(o==r||"/"==o||"\\"==o&&Q(e)||!n&&("?"==o||"#"==o)){if(eo(d)?(ei(e),"/"==o||"\\"==o&&Q(e)||e.path.push("")):ea(d)?"/"==o||"\\"==o&&Q(e)||e.path.push(""):("file"==e.scheme&&!e.path.length&&en(d)&&(e.host&&(e.host=""),d=d.charAt(0)+":"),e.path.push(d)),d="","file"==e.scheme&&(o==r||"?"==o||"#"==o))for(;e.path.length>1&&""===e.path[0];)e.path.shift();"?"==o?(e.query="",c=eT):"#"==o&&(e.fragment="",c=eM)}else d+=X(o,q);break;case ex:"?"==o?(e.query="",c=eT):"#"==o?(e.fragment="",c=eM):o!=r&&(e.path[0]+=X(o,K));break;case eT:n||"#"!=o?o!=r&&("'"==o&&Q(e)?e.query+="%27":"#"==o?e.query+="%23":e.query+=X(o,K)):(e.fragment="",c=eM);break;case eM:o!=r&&(e.fragment+=X(o,V))}l++}},eA=function(e){var t,n,r=l(this,eA,"URL"),i=arguments.length>1?arguments[1]:void 0,o=m(e),s=S(r,{type:"URL"});if(void 0!==i){if(i instanceof eA)t=k(i);else if(n=eO(t={},m(i)))throw TypeError(n)}if(n=eO(s,o,null,t))throw TypeError(n);var u=s.searchParams=new _,c=E(u);c.updateSearchParams(s.query),c.updateURL=function(){s.query=String(u)||null},a||(r.href=eC.call(r),r.origin=eI.call(r),r.protocol=eD.call(r),r.username=eN.call(r),r.password=eP.call(r),r.host=eR.call(r),r.hostname=ej.call(r),r.port=eF.call(r),r.pathname=eY.call(r),r.search=eB.call(r),r.searchParams=eU.call(r),r.hash=eH.call(r))},eL=eA.prototype,eC=function(){var e=k(this),t=e.scheme,n=e.username,r=e.password,i=e.host,a=e.port,o=e.path,s=e.query,u=e.fragment,c=t+":";return null!==i?(c+="//",ee(e)&&(c+=n+(r?":"+r:"")+"@"),c+=W(i),null!==a&&(c+=":"+a)):"file"==t&&(c+="//"),c+=e.cannotBeABaseURL?o[0]:o.length?"/"+o.join("/"):"",null!==s&&(c+="?"+s),null!==u&&(c+="#"+u),c},eI=function(){var e=k(this),t=e.scheme,n=e.port;if("blob"==t)try{return new eA(t.path[0]).origin}catch(r){return"null"}return"file"!=t&&Q(e)?t+"://"+W(e.host)+(null!==n?":"+n:""):"null"},eD=function(){return k(this).scheme+":"},eN=function(){return k(this).username},eP=function(){return k(this).password},eR=function(){var e=k(this),t=e.host,n=e.port;return null===t?"":null===n?W(t):W(t)+":"+n},ej=function(){var e=k(this).host;return null===e?"":W(e)},eF=function(){var e=k(this).port;return null===e?"":String(e)},eY=function(){var e=k(this),t=e.path;return e.cannotBeABaseURL?t[0]:t.length?"/"+t.join("/"):""},eB=function(){var e=k(this).query;return e?"?"+e:""},eU=function(){return k(this).searchParams},eH=function(){var e=k(this).fragment;return e?"#"+e:""},e$=function(e,t){return{get:e,set:t,configurable:!0,enumerable:!0}};if(a&&u(eL,{href:e$(eC,function(e){var t=k(this),n=m(e),r=eO(t,n);if(r)throw TypeError(r);E(t.searchParams).updateSearchParams(t.query)}),origin:e$(eI),protocol:e$(eD,function(e){var t=k(this);eO(t,m(e)+":",es)}),username:e$(eN,function(e){var t=k(this),n=h(m(e));if(!et(t)){t.username="";for(var r=0;rc});var r={value:function(){}};function i(){for(var e,t=0,n=arguments.length,r={};t=0&&(n=e.slice(r+1),e=e.slice(0,r)),e&&!t.hasOwnProperty(e))throw Error("unknown type: "+e);return{type:e,name:n}})}function s(e,t){for(var n,r=0,i=e.length;r0)for(var n,r,i=Array(n),a=0;am,dragDisable:()=>u.Z,dragEnable:()=>u.D});var r=n(92626),i=n(25109),a=n(43095),o=n(94017),s=n(24793),u=n(44266),c=n(34299);function l(e){return function(){return e}}function f(e,t,n,r,i,a,o,s,u,c){this.target=e,this.type=t,this.subject=n,this.identifier=r,this.active=i,this.x=a,this.y=o,this.dx=s,this.dy=u,this._=c}function d(){return!i.B.ctrlKey&&!i.B.button}function h(){return this.parentNode}function p(e){return null==e?{x:i.B.x,y:i.B.y}:e}function b(){return navigator.maxTouchPoints||"ontouchstart"in this}function m(){var e,t,n,m,g=d,v=h,y=p,w=b,_={},E=(0,r.Z)("start","drag","end"),S=0,k=0;function x(e){e.on("mousedown.drag",T).filter(w).on("touchstart.drag",A).on("touchmove.drag",L).on("touchend.drag touchcancel.drag",C).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function T(){if(!m&&g.apply(this,arguments)){var r=I("mouse",v.apply(this,arguments),a.Z,this,arguments);r&&((0,o.Z)(i.B.view).on("mousemove.drag",M,!0).on("mouseup.drag",O,!0),(0,u.Z)(i.B.view),(0,c.r)(),n=!1,e=i.B.clientX,t=i.B.clientY,r("start"))}}function M(){if((0,c.Z)(),!n){var r=i.B.clientX-e,a=i.B.clientY-t;n=r*r+a*a>k}_.mouse("drag")}function O(){(0,o.Z)(i.B.view).on("mousemove.drag mouseup.drag",null),(0,u.D)(i.B.view,n),(0,c.Z)(),_.mouse("end")}function A(){if(g.apply(this,arguments)){var e,t,n=i.B.changedTouches,r=v.apply(this,arguments),a=n.length;for(e=0;eo,Z:()=>a});var r=n(94017),i=n(34299);function a(e){var t=e.document.documentElement,n=(0,r.Z)(e).on("dragstart.drag",i.Z,!0);"onselectstart"in t?n.on("selectstart.drag",i.Z,!0):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function o(e,t){var n=e.document.documentElement,a=(0,r.Z)(e).on("dragstart.drag",null);t&&(a.on("click.drag",i.Z,!0),setTimeout(function(){a.on("click.drag",null)},0)),"onselectstart"in n?a.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}},34299(e,t,n){"use strict";n.d(t,{Z:()=>a,r:()=>i});var r=n(25109);function i(){r.B.stopImmediatePropagation()}function a(){r.B.preventDefault(),r.B.stopImmediatePropagation()}},9893(e,t,n){"use strict";function r(e,t){var n;function r(){var r,i,a=n.length,o=0,s=0;for(r=0;r=(a=(b+g)/2))?b=a:g=a,(l=n>=(o=(m+v)/2))?m=o:v=o,i=h,!(h=h[f=l<<1|c]))return i[f]=p,e;if(s=+e._x.call(null,h.data),u=+e._y.call(null,h.data),t===s&&n===u)return p.next=h,i?i[f]=p:e._root=p,e;do i=i?i[f]=[,,,,]:e._root=[,,,,],(c=t>=(a=(b+g)/2))?b=a:g=a,(l=n>=(o=(m+v)/2))?m=o:v=o;while((f=l<<1|c)==(d=(u>=o)<<1|s>=a))return i[d]=h,i[f]=p,e}function u(e){var t,n,r,i,a=e.length,o=Array(a),u=Array(a),c=1/0,l=1/0,f=-1/0,d=-1/0;for(n=0;nf&&(f=r),id&&(d=i));if(c>f||l>d)return this;for(this.cover(c,l).cover(f,d),n=0;ne||e>=i||r>t||t>=a;)switch(s=(th)&&!((a=u.y0)>p)&&!((o=u.x1)=v)<<1|e>=g)&&(u=b[b.length-1],b[b.length-1]=b[b.length-1-c],b[b.length-1-c]=u)}else{var y=e-+this._x.call(null,m.data),w=t-+this._y.call(null,m.data),_=y*y+w*w;if(_=(s=(p+m)/2))?p=s:m=s,(l=o>=(u=(b+g)/2))?b=u:g=u,t=h,!(h=h[f=l<<1|c]))return this;if(!h.length)break;(t[f+1&3]||t[f+2&3]||t[f+3&3])&&(n=t,d=f)}for(;h.data!==e;)if(r=h,!(h=h.next))return this;return((i=h.next)&&delete h.next,r)?(i?r.next=i:delete r.next,this):t?(i?t[f]=i:delete t[f],(h=t[0]||t[1]||t[2]||t[3])&&h===(t[3]||t[2]||t[1]||t[0])&&!h.length&&(n?n[d]=h:this._root=h),this):(this._root=i,this)}function b(e){for(var t=0,n=e.length;tr,forceCollide:()=>L,forceLink:()=>B,forceManyBody:()=>V,forceRadial:()=>q,forceSimulation:()=>K,forceX:()=>Z,forceY:()=>X});var M=k.prototype=x.prototype;function O(e){return e.x+e.vx}function A(e){return e.y+e.vy}function L(e){var t,n,r=1,o=1;function s(){for(var e,i,s,c,l,f,d,h=t.length,p=0;ps.index){var b=c-u.x-u.vx,m=l-u.y-u.vy,g=b*b+m*m;gc+p||il+p||oe.r&&(e.r=e[t].r)}function c(){if(t){var r,i,a=t.length;for(r=0,n=Array(a);r1?(null==n?s.remove(e):s.set(e,h(n)),t):s.get(e)},find:function(t,n,r){var i,a,o,s,u,c=0,l=e.length;for(null==r?r=1/0:r*=r,c=0;c1?(c.on(e,n),t):c.on(e)}}}function V(){var e,t,n,r,o=i(-30),s=1,u=1/0,c=.81;function l(r){var i,a=e.length,o=k(e,$,z).visitAfter(d);for(n=r,i=0;i=u)){(e.data!==t||e.next)&&(0===f&&(p+=(f=a())*f),0===d&&(p+=(d=a())*d),ps});var r=n(73888),i=n(31986);function a(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===i.P&&t.documentElement.namespaceURI===i.P?t.createElement(e):t.createElementNS(n,e)}}function o(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function s(e){var t=(0,r.Z)(e);return(t.local?o:a)(t)}},58556(e,t,n){"use strict";n.r(t),n.d(t,{clientPoint:()=>h.Z,create:()=>a,creator:()=>r.Z,customEvent:()=>S._H,event:()=>S.B,local:()=>s,matcher:()=>c.Z,mouse:()=>l.Z,namespace:()=>f.Z,namespaces:()=>d.Z,select:()=>i.Z,selectAll:()=>b,selection:()=>p.ZP,selector:()=>m.Z,selectorAll:()=>g.Z,style:()=>v.S,touch:()=>y.Z,touches:()=>_,window:()=>E.Z});var r=n(789),i=n(94017);function a(e){return(0,i.Z)((0,r.Z)(e).call(document.documentElement))}var o=0;function s(){return new u}function u(){this._="@"+(++o).toString(36)}u.prototype=s.prototype={constructor:u,get:function(e){for(var t=this._;!(t in e);)if(!(e=e.parentNode))return;return e[t]},set:function(e,t){return e[this._]=t},remove:function(e){return this._ in e&&delete e[this._]},toString:function(){return this._}};var c=n(3083),l=n(43095),f=n(73888),d=n(31986),h=n(42115),p=n(23817);function b(e){return"string"==typeof e?new p.Y1([document.querySelectorAll(e)],[document.documentElement]):new p.Y1([null==e?[]:e],p.Jz)}var m=n(82634),g=n(3545),v=n(49986),y=n(24793),w=n(45553);function _(e,t){null==t&&(t=(0,w.Z)().touches);for(var n=0,r=t?t.length:0,i=Array(r);nr})},43095(e,t,n){"use strict";n.d(t,{Z:()=>a});var r=n(45553),i=n(42115);function a(e){var t=(0,r.Z)();return t.changedTouches&&(t=t.changedTouches[0]),(0,i.Z)(e,t)}},73888(e,t,n){"use strict";n.d(t,{Z:()=>i});var r=n(31986);function i(e){var t=e+="",n=t.indexOf(":");return n>=0&&"xmlns"!==(t=e.slice(0,n))&&(e=e.slice(n+1)),r.Z.hasOwnProperty(t)?{space:r.Z[t],local:e}:e}},31986(e,t,n){"use strict";n.d(t,{P:()=>r,Z:()=>i});var r="http://www.w3.org/1999/xhtml";let i={svg:"http://www.w3.org/2000/svg",xhtml:r,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"}},42115(e,t,n){"use strict";function r(e,t){var n=e.ownerSVGElement||e;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=t.clientX,r.y=t.clientY,[(r=r.matrixTransform(e.getScreenCTM().inverse())).x,r.y]}var i=e.getBoundingClientRect();return[t.clientX-i.left-e.clientLeft,t.clientY-i.top-e.clientTop]}n.d(t,{Z:()=>r})},94017(e,t,n){"use strict";n.d(t,{Z:()=>i});var r=n(23817);function i(e){return"string"==typeof e?new r.Y1([[document.querySelector(e)]],[document.documentElement]):new r.Y1([[e]],r.Jz)}},23817(e,t,n){"use strict";n.d(t,{Y1:()=>eT,ZP:()=>eO,Jz:()=>ex});var r=n(82634);function i(e){"function"!=typeof e&&(e=(0,r.Z)(e));for(var t=this._groups,n=t.length,i=Array(n),a=0;a=k&&(k=S+1);!(E=y[k])&&++k=0;)(r=i[a])&&(o&&4^r.compareDocumentPosition(o)&&o.parentNode.insertBefore(r,o),o=r);return this}function _(e){function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}e||(e=E);for(var n=this._groups,r=n.length,i=Array(r),a=0;at?1:e>=t?0:NaN}function S(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function k(){var e=Array(this.size()),t=-1;return this.each(function(){e[++t]=this}),e}function x(){for(var e=this._groups,t=0,n=e.length;t1?this.each((null==t?F:"function"==typeof t?B:Y)(e,t)):this.node()[e]}function H(e){return e.trim().split(/^|\s+/)}function $(e){return e.classList||new z(e)}function z(e){this._node=e,this._names=H(e.getAttribute("class")||"")}function G(e,t){for(var n=$(e),r=-1,i=t.length;++rthis._names.indexOf(e)&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};var ec=n(789);function el(e){var t="function"==typeof e?e:(0,ec.Z)(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function ef(){return null}function ed(e,t){var n="function"==typeof e?e:(0,ec.Z)(e),i=null==t?ef:"function"==typeof t?t:(0,r.Z)(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),i.apply(this,arguments)||null)})}function eh(){var e=this.parentNode;e&&e.removeChild(this)}function ep(){return this.each(eh)}function eb(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function em(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function eg(e){return this.select(e?em:eb)}function ev(e){return arguments.length?this.property("__data__",e):this.node().__data__}var ey=n(25109),ew=n(85021);function e_(e,t,n){var r=(0,ew.Z)(e),i=r.CustomEvent;"function"==typeof i?i=new i(t,n):(i=r.document.createEvent("Event"),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function eE(e,t){return function(){return e_(this,e,t)}}function eS(e,t){return function(){return e_(this,e,t.apply(this,arguments))}}function ek(e,t){return this.each(("function"==typeof t?eS:eE)(e,t))}var ex=[null];function eT(e,t){this._groups=e,this._parents=t}function eM(){return new eT([[document.documentElement]],ex)}eT.prototype=eM.prototype={constructor:eT,select:i,selectAll:o,filter:u,data:m,enter:l,exit:g,join:v,merge:y,order:w,sort:_,call:S,nodes:k,node:x,size:T,empty:M,each:O,attr:R,style:j.Z,property:U,classed:Z,text:ee,html:ei,raise:eo,lower:eu,append:el,insert:ed,remove:ep,clone:eg,datum:ev,on:ey.ZP,dispatch:ek};let eO=eM},25109(e,t,n){"use strict";n.d(t,{B:()=>i,ZP:()=>l,_H:()=>f});var r={},i=null;function a(e,t,n){return e=o(e,t,n),function(t){var n=t.relatedTarget;n&&(n===this||8&n.compareDocumentPosition(this))||e.call(this,t)}}function o(e,t,n){return function(r){var a=i;i=r;try{e.call(this,this.__data__,t,n)}finally{i=a}}}function s(e){return e.trim().split(/^|\s+/).map(function(e){var t="",n=e.indexOf(".");return n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}})}function u(e){return function(){var t=this.__on;if(t){for(var n,r=0,i=-1,a=t.length;ru,Z:()=>s});var r=n(85021);function i(e){return function(){this.style.removeProperty(e)}}function a(e,t,n){return function(){this.style.setProperty(e,t,n)}}function o(e,t,n){return function(){var r=t.apply(this,arguments);null==r?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function s(e,t,n){return arguments.length>1?this.each((null==t?i:"function"==typeof t?o:a)(e,t,null==n?"":n)):u(this.node(),e)}function u(e,t){return e.style.getPropertyValue(t)||(0,r.Z)(e).getComputedStyle(e,null).getPropertyValue(t)}},82634(e,t,n){"use strict";function r(){}function i(e){return null==e?r:function(){return this.querySelector(e)}}n.d(t,{Z:()=>i})},3545(e,t,n){"use strict";function r(){return[]}function i(e){return null==e?r:function(){return this.querySelectorAll(e)}}n.d(t,{Z:()=>i})},45553(e,t,n){"use strict";n.d(t,{Z:()=>i});var r=n(25109);function i(){for(var e,t=r.B;e=t.sourceEvent;)t=e;return t}},24793(e,t,n){"use strict";n.d(t,{Z:()=>a});var r=n(45553),i=n(42115);function a(e,t,n){arguments.length<3&&(n=t,t=(0,r.Z)().changedTouches);for(var a,o=0,s=t?t.length:0;or})},71098(e,t,n){"use strict";n.r(t),n.d(t,{arc:()=>C,area:()=>j,areaRadial:()=>W,curveBasis:()=>eM,curveBasisClosed:()=>eA,curveBasisOpen:()=>eC,curveBundle:()=>eD,curveCardinal:()=>eR,curveCardinalClosed:()=>eF,curveCardinalOpen:()=>eB,curveCatmullRom:()=>e$,curveCatmullRomClosed:()=>eG,curveCatmullRomOpen:()=>eK,curveLinear:()=>D,curveLinearClosed:()=>eq,curveMonotoneX:()=>e3,curveMonotoneY:()=>e4,curveNatural:()=>e8,curveStep:()=>e7,curveStepAfter:()=>tt,curveStepBefore:()=>te,line:()=>R,lineRadial:()=>G,linkHorizontal:()=>et,linkRadial:()=>er,linkVertical:()=>en,pie:()=>B,pointRadial:()=>K,radialArea:()=>W,radialLine:()=>G,stack:()=>ta,stackOffsetDiverging:()=>ts,stackOffsetExpand:()=>to,stackOffsetNone:()=>tn,stackOffsetSilhouette:()=>tu,stackOffsetWiggle:()=>tc,stackOrderAppearance:()=>tl,stackOrderAscending:()=>td,stackOrderDescending:()=>tp,stackOrderInsideOut:()=>tb,stackOrderNone:()=>tr,stackOrderReverse:()=>tm,symbol:()=>eS,symbolCircle:()=>ei,symbolCross:()=>ea,symbolDiamond:()=>eu,symbolSquare:()=>ep,symbolStar:()=>eh,symbolTriangle:()=>em,symbolWye:()=>e_,symbols:()=>eE});var r=Math.PI,i=2*r,a=1e-6,o=i-a;function s(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function u(){return new s}s.prototype=u.prototype={constructor:s,moveTo:function(e,t){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(e,t){this._+="L"+(this._x1=+e)+","+(this._y1=+t)},quadraticCurveTo:function(e,t,n,r){this._+="Q"+ +e+","+ +t+","+(this._x1=+n)+","+(this._y1=+r)},bezierCurveTo:function(e,t,n,r,i,a){this._+="C"+ +e+","+ +t+","+ +n+","+ +r+","+(this._x1=+i)+","+(this._y1=+a)},arcTo:function(e,t,n,i,o){e=+e,t=+t,n=+n,i=+i,o=+o;var s=this._x1,u=this._y1,c=n-e,l=i-t,f=s-e,d=u-t,h=f*f+d*d;if(o<0)throw Error("negative radius: "+o);if(null===this._x1)this._+="M"+(this._x1=e)+","+(this._y1=t);else if(h>a){if(Math.abs(d*c-l*f)>a&&o){var p=n-s,b=i-u,m=c*c+l*l,g=Math.sqrt(m),v=Math.sqrt(h),y=o*Math.tan((r-Math.acos((m+h-(p*p+b*b))/(2*g*v)))/2),w=y/v,_=y/g;Math.abs(w-1)>a&&(this._+="L"+(e+w*f)+","+(t+w*d)),this._+="A"+o+","+o+",0,0,"+ +(d*p>f*b)+","+(this._x1=e+_*c)+","+(this._y1=t+_*l)}else this._+="L"+(this._x1=e)+","+(this._y1=t)}},arc:function(e,t,n,s,u,c){e=+e,t=+t,n=+n,c=!!c;var l=n*Math.cos(s),f=n*Math.sin(s),d=e+l,h=t+f,p=1^c,b=c?s-u:u-s;if(n<0)throw Error("negative radius: "+n);null===this._x1?this._+="M"+d+","+h:(Math.abs(this._x1-d)>a||Math.abs(this._y1-h)>a)&&(this._+="L"+d+","+h),n&&(b<0&&(b=b%i+i),b>o?this._+="A"+n+","+n+",0,1,"+p+","+(e-l)+","+(t-f)+"A"+n+","+n+",0,1,"+p+","+(this._x1=d)+","+(this._y1=h):b>a&&(this._+="A"+n+","+n+",0,"+ +(b>=r)+","+p+","+(this._x1=e+n*Math.cos(u))+","+(this._y1=t+n*Math.sin(u))))},rect:function(e,t,n,r){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)+"h"+ +n+"v"+ +r+"h"+-n+"Z"},toString:function(){return this._}};let c=u;function l(e){return function(){return e}}var f=Math.abs,d=Math.atan2,h=Math.cos,p=Math.max,b=Math.min,m=Math.sin,g=Math.sqrt,v=1e-12,y=Math.PI,w=y/2,_=2*y;function E(e){return e>1?0:e<-1?y:Math.acos(e)}function S(e){return e>=1?w:e<=-1?-w:Math.asin(e)}function k(e){return e.innerRadius}function x(e){return e.outerRadius}function T(e){return e.startAngle}function M(e){return e.endAngle}function O(e){return e&&e.padAngle}function A(e,t,n,r,i,a,o,s){var u=n-e,c=r-t,l=o-i,f=s-a,d=f*u-l*c;if(!(d*dI*I+D*D&&(T=O,M=A),{cx:T,cy:M,x01:-l,y01:-f,x11:T*(i/S-1),y11:M*(i/S-1)}}function C(){var e=k,t=x,n=l(0),r=null,i=T,a=M,o=O,s=null;function u(){var u,l,p=+e.apply(this,arguments),k=+t.apply(this,arguments),x=i.apply(this,arguments)-w,T=a.apply(this,arguments)-w,M=f(T-x),O=T>x;if(s||(s=u=c()),kv){if(M>_-v)s.moveTo(k*h(x),k*m(x)),s.arc(0,0,k,x,T,!O),p>v&&(s.moveTo(p*h(T),p*m(T)),s.arc(0,0,p,T,x,O));else{var C,I,D=x,N=T,P=x,R=T,j=M,F=M,Y=o.apply(this,arguments)/2,B=Y>v&&(r?+r.apply(this,arguments):g(p*p+k*k)),U=b(f(k-p)/2,+n.apply(this,arguments)),H=U,$=U;if(B>v){var z=S(B/p*m(Y)),G=S(B/k*m(Y));(j-=2*z)>v?(z*=O?1:-1,P+=z,R-=z):(j=0,P=R=(x+T)/2),(F-=2*G)>v?(G*=O?1:-1,D+=G,N-=G):(F=0,D=N=(x+T)/2)}var W=k*h(D),K=k*m(D),V=p*h(R),q=p*m(R);if(U>v){var Z,X=k*h(N),J=k*m(N),Q=p*h(P),ee=p*m(P);if(Mv?$>v?(C=L(Q,ee,W,K,k,$,O),I=L(X,J,V,q,k,$,O),s.moveTo(C.cx+C.x01,C.cy+C.y01),$v&&j>v?H>v?(C=L(V,q,X,J,p,-H,O),I=L(W,K,Q,ee,p,-H,O),s.lineTo(C.cx+C.x01,C.cy+C.y01),H=f;--d)s.point(g[d],v[d]);s.lineEnd(),s.areaEnd()}}m&&(g[l]=+e(h,l,u),v[l]=+n(h,l,u),s.point(t?+t(h,l,u):g[l],r?+r(h,l,u):v[l]))}if(p)return s=null,p+""||null}function f(){return R().defined(i).curve(o).context(a)}return u.x=function(n){return arguments.length?(e="function"==typeof n?n:l(+n),t=null,u):e},u.x0=function(t){return arguments.length?(e="function"==typeof t?t:l(+t),u):e},u.x1=function(e){return arguments.length?(t=null==e?null:"function"==typeof e?e:l(+e),u):t},u.y=function(e){return arguments.length?(n="function"==typeof e?e:l(+e),r=null,u):n},u.y0=function(e){return arguments.length?(n="function"==typeof e?e:l(+e),u):n},u.y1=function(e){return arguments.length?(r=null==e?null:"function"==typeof e?e:l(+e),u):r},u.lineX0=u.lineY0=function(){return f().x(e).y(n)},u.lineY1=function(){return f().x(e).y(r)},u.lineX1=function(){return f().x(t).y(n)},u.defined=function(e){return arguments.length?(i="function"==typeof e?e:l(!!e),u):i},u.curve=function(e){return arguments.length?(o=e,null!=a&&(s=o(a)),u):o},u.context=function(e){return arguments.length?(null==e?a=s=null:s=o(a=e),u):a},u}function F(e,t){return te?1:t>=e?0:NaN}function Y(e){return e}function B(){var e=Y,t=F,n=null,r=l(0),i=l(_),a=l(0);function o(o){var s,u,c,l,f,d=o.length,h=0,p=Array(d),b=Array(d),m=+r.apply(this,arguments),g=Math.min(_,Math.max(-_,i.apply(this,arguments)-m)),v=Math.min(Math.abs(g)/d,a.apply(this,arguments)),y=v*(g<0?-1:1);for(s=0;s0&&(h+=f);for(null!=t?p.sort(function(e,n){return t(b[e],b[n])}):null!=n&&p.sort(function(e,t){return n(o[e],o[t])}),s=0,c=h?(g-d*y)/h:0;s0?f*c:0)+y,b[u]={data:o[u],index:s,value:f,startAngle:m,endAngle:l,padAngle:v};return b}return o.value=function(t){return arguments.length?(e="function"==typeof t?t:l(+t),o):e},o.sortValues=function(e){return arguments.length?(t=e,n=null,o):t},o.sort=function(e){return arguments.length?(n=e,t=null,o):n},o.startAngle=function(e){return arguments.length?(r="function"==typeof e?e:l(+e),o):r},o.endAngle=function(e){return arguments.length?(i="function"==typeof e?e:l(+e),o):i},o.padAngle=function(e){return arguments.length?(a="function"==typeof e?e:l(+e),o):a},o}I.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t)}}};var U=$(D);function H(e){this._curve=e}function $(e){function t(t){return new H(e(t))}return t._curve=e,t}function z(e){var t=e.curve;return e.angle=e.x,delete e.x,e.radius=e.y,delete e.y,e.curve=function(e){return arguments.length?t($(e)):t()._curve},e}function G(){return z(R().curve(U))}function W(){var e=j().curve(U),t=e.curve,n=e.lineX0,r=e.lineX1,i=e.lineY0,a=e.lineY1;return e.angle=e.x,delete e.x,e.startAngle=e.x0,delete e.x0,e.endAngle=e.x1,delete e.x1,e.radius=e.y,delete e.y,e.innerRadius=e.y0,delete e.y0,e.outerRadius=e.y1,delete e.y1,e.lineStartAngle=function(){return z(n())},delete e.lineX0,e.lineEndAngle=function(){return z(r())},delete e.lineX1,e.lineInnerRadius=function(){return z(i())},delete e.lineY0,e.lineOuterRadius=function(){return z(a())},delete e.lineY1,e.curve=function(e){return arguments.length?t($(e)):t()._curve},e}function K(e,t){return[(t=+t)*Math.cos(e-=Math.PI/2),t*Math.sin(e)]}H.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(e,t){this._curve.point(t*Math.sin(e),-(t*Math.cos(e)))}};var V=Array.prototype.slice;function q(e){return e.source}function Z(e){return e.target}function X(e){var t=q,n=Z,r=N,i=P,a=null;function o(){var o,s=V.call(arguments),u=t.apply(this,s),l=n.apply(this,s);if(a||(a=o=c()),e(a,+r.apply(this,(s[0]=u,s)),+i.apply(this,s),+r.apply(this,(s[0]=l,s)),+i.apply(this,s)),o)return a=null,o+""||null}return o.source=function(e){return arguments.length?(t=e,o):t},o.target=function(e){return arguments.length?(n=e,o):n},o.x=function(e){return arguments.length?(r="function"==typeof e?e:l(+e),o):r},o.y=function(e){return arguments.length?(i="function"==typeof e?e:l(+e),o):i},o.context=function(e){return arguments.length?(a=null==e?null:e,o):a},o}function J(e,t,n,r,i){e.moveTo(t,n),e.bezierCurveTo(t=(t+r)/2,n,t,i,r,i)}function Q(e,t,n,r,i){e.moveTo(t,n),e.bezierCurveTo(t,n=(n+i)/2,r,n,r,i)}function ee(e,t,n,r,i){var a=K(t,n),o=K(t,n=(n+i)/2),s=K(r,n),u=K(r,i);e.moveTo(a[0],a[1]),e.bezierCurveTo(o[0],o[1],s[0],s[1],u[0],u[1])}function et(){return X(J)}function en(){return X(Q)}function er(){var e=X(ee);return e.angle=e.x,delete e.x,e.radius=e.y,delete e.y,e}let ei={draw:function(e,t){var n=Math.sqrt(t/y);e.moveTo(n,0),e.arc(0,0,n,0,_)}},ea={draw:function(e,t){var n=Math.sqrt(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}};var eo=Math.sqrt(1/3),es=2*eo;let eu={draw:function(e,t){var n=Math.sqrt(t/es),r=n*eo;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}};var ec=.8908130915292852,el=Math.sin(y/10)/Math.sin(7*y/10),ef=Math.sin(_/10)*el,ed=-Math.cos(_/10)*el;let eh={draw:function(e,t){var n=Math.sqrt(t*ec),r=ef*n,i=ed*n;e.moveTo(0,-n),e.lineTo(r,i);for(var a=1;a<5;++a){var o=_*a/5,s=Math.cos(o),u=Math.sin(o);e.lineTo(u*n,-s*n),e.lineTo(s*r-u*i,u*r+s*i)}e.closePath()}},ep={draw:function(e,t){var n=Math.sqrt(t),r=-n/2;e.rect(r,r,n,n)}};var eb=Math.sqrt(3);let em={draw:function(e,t){var n=-Math.sqrt(t/(3*eb));e.moveTo(0,2*n),e.lineTo(-eb*n,-n),e.lineTo(eb*n,-n),e.closePath()}};var eg=-.5,ev=Math.sqrt(3)/2,ey=1/Math.sqrt(12),ew=(ey/2+1)*3;let e_={draw:function(e,t){var n=Math.sqrt(t/ew),r=n/2,i=n*ey,a=r,o=n*ey+n,s=-a,u=o;e.moveTo(r,i),e.lineTo(a,o),e.lineTo(s,u),e.lineTo(eg*r-ev*i,ev*r+eg*i),e.lineTo(eg*a-ev*o,ev*a+eg*o),e.lineTo(eg*s-ev*u,ev*s+eg*u),e.lineTo(eg*r+ev*i,eg*i-ev*r),e.lineTo(eg*a+ev*o,eg*o-ev*a),e.lineTo(eg*s+ev*u,eg*u-ev*s),e.closePath()}};var eE=[ei,ea,eu,ep,eh,em,e_];function eS(){var e=l(ei),t=l(64),n=null;function r(){var r;if(n||(n=r=c()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),r)return n=null,r+""||null}return r.type=function(t){return arguments.length?(e="function"==typeof t?t:l(t),r):e},r.size=function(e){return arguments.length?(t="function"==typeof e?e:l(+e),r):t},r.context=function(e){return arguments.length?(n=null==e?null:e,r):n},r}function ek(){}function ex(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function eT(e){this._context=e}function eM(e){return new eT(e)}function eO(e){this._context=e}function eA(e){return new eO(e)}function eL(e){this._context=e}function eC(e){return new eL(e)}function eI(e,t){this._basis=new eT(e),this._beta=t}eT.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:ex(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:ex(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},eO.prototype={areaStart:ek,areaEnd:ek,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:ex(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},eL.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:ex(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},eI.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,n=e.length-1;if(n>0)for(var r,i=e[0],a=t[0],o=e[n]-i,s=t[n]-a,u=-1;++u<=n;)r=u/n,this._basis.point(this._beta*e[u]+(1-this._beta)*(i+r*o),this._beta*t[u]+(1-this._beta)*(a+r*s));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};let eD=function e(t){function n(e){return 1===t?new eT(e):new eI(e,t)}return n.beta=function(t){return e(+t)},n}(.85);function eN(e,t,n){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-n),e._x2,e._y2)}function eP(e,t){this._context=e,this._k=(1-t)/6}eP.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:eN(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:eN(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};let eR=function e(t){function n(e){return new eP(e,0)}return n.tension=function(t){return e(+t)},n}(0);function ej(e,t){this._context=e,this._k=(1-t)/6}ej.prototype={areaStart:ek,areaEnd:ek,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:eN(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};let eF=function e(t){function n(e){return new ej(e,0)}return n.tension=function(t){return e(+t)},n}(0);function eY(e,t){this._context=e,this._k=(1-t)/6}eY.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:eN(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};let eB=function e(t){function n(e){return new eY(e,0)}return n.tension=function(t){return e(+t)},n}(0);function eU(e,t,n){var r=e._x1,i=e._y1,a=e._x2,o=e._y2;if(e._l01_a>v){var s=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,u=3*e._l01_a*(e._l01_a+e._l12_a);r=(r*s-e._x0*e._l12_2a+e._x2*e._l01_2a)/u,i=(i*s-e._y0*e._l12_2a+e._y2*e._l01_2a)/u}if(e._l23_a>v){var c=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,l=3*e._l23_a*(e._l23_a+e._l12_a);a=(a*c+e._x1*e._l23_2a-t*e._l12_2a)/l,o=(o*c+e._y1*e._l23_2a-n*e._l12_2a)/l}e._context.bezierCurveTo(r,i,a,o,e._x2,e._y2)}function eH(e,t){this._context=e,this._alpha=t}eH.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:eU(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};let e$=function e(t){function n(e){return t?new eH(e,t):new eP(e,0)}return n.alpha=function(t){return e(+t)},n}(.5);function ez(e,t){this._context=e,this._alpha=t}ez.prototype={areaStart:ek,areaEnd:ek,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:eU(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};let eG=function e(t){function n(e){return t?new ez(e,t):new ej(e,0)}return n.alpha=function(t){return e(+t)},n}(.5);function eW(e,t){this._context=e,this._alpha=t}eW.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:eU(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};let eK=function e(t){function n(e){return t?new eW(e,t):new eY(e,0)}return n.alpha=function(t){return e(+t)},n}(.5);function eV(e){this._context=e}function eq(e){return new eV(e)}function eZ(e){return e<0?-1:1}function eX(e,t,n){var r=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(r||i<0&&-0),o=(n-e._y1)/(i||r<0&&-0),s=(a*i+o*r)/(r+i);return(eZ(a)+eZ(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function eJ(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function eQ(e,t,n){var r=e._x0,i=e._y0,a=e._x1,o=e._y1,s=(a-r)/3;e._context.bezierCurveTo(r+s,i+s*t,a-s,o-s*n,a,o)}function e1(e){this._context=e}function e0(e){this._context=new e2(e)}function e2(e){this._context=e}function e3(e){return new e1(e)}function e4(e){return new e0(e)}function e6(e){this._context=e}function e5(e){var t,n,r=e.length-1,i=Array(r),a=Array(r),o=Array(r);for(i[0]=0,a[0]=2,o[0]=e[0]+2*e[1],t=1;t=0;--t)i[t]=(o[t]-i[t+1])/a[t];for(t=0,a[r-1]=(e[r]+i[r-1])/2;t1)for(var n,r,i,a=1,o=e[t[0]],s=o.length;a=0;)n[t]=t;return n}function ti(e,t){return e[t]}function ta(){var e=l([]),t=tr,n=tn,r=ti;function i(i){var a,o,s=e.apply(this,arguments),u=i.length,c=s.length,l=Array(c);for(a=0;a0){for(var n,r,i,a=0,o=e[0].length;a0)for(var n,r,i,a,o,s,u=0,c=e[t[0]].length;u0?(r[0]=a,r[1]=a+=i):i<0?(r[1]=o,r[0]=o+=i):(r[0]=0,r[1]=i)}function tu(e,t){if((n=e.length)>0){for(var n,r=0,i=e[t[0]],a=i.length;r0&&(r=(n=e[t[0]]).length)>0){for(var n,r,i,a=0,o=1;oa&&(a=t,r=n);return r}function td(e){var t=e.map(th);return tr(e).sort(function(e,n){return t[e]-t[n]})}function th(e){for(var t,n=0,r=-1,i=e.length;++r=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}}this._x=e,this._y=t}}},35374(e,t,n){"use strict";n.d(t,{B7:()=>m,HT:()=>g,zO:()=>p});var r,i,a=0,o=0,s=0,u=1e3,c=0,l=0,f=0,d="object"==typeof performance&&performance.now?performance:Date,h="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function p(){return l||(h(b),l=d.now()+f)}function b(){l=0}function m(){this._call=this._time=this._next=null}function g(e,t,n){var r=new m;return r.restart(e,t,n),r}function v(){p(),++a;for(var e,t=r;t;)(e=l-t._time)>=0&&t._call.call(null,e),t=t._next;--a}function y(){l=(c=d.now())+f,a=o=0;try{v()}finally{a=0,_(),l=0}}function w(){var e=d.now(),t=e-c;t>u&&(f-=t,c=e)}function _(){for(var e,t,n=r,a=1/0;n;)n._call?(a>n._time&&(a=n._time),e=n,n=n._next):(t=n._next,n._next=null,n=e?e._next=t:r=t);i=e,E(a)}function E(e){if(!a){var t;o&&(o=clearTimeout(o)),e-l>24?(e<1/0&&(o=setTimeout(y,e-d.now()-f)),s&&(s=clearInterval(s))):(s||(c=d.now(),s=setInterval(w,u)),a=1,h(y))}}m.prototype=g.prototype={constructor:m,restart:function(e,t,n){if("function"!=typeof e)throw TypeError("callback is not a function");n=(null==n?p():+n)+(null==t?0:+t),this._next||i===this||(i?i._next=this:r=this,i=this),this._call=e,this._time=n,E()},stop:function(){this._call&&(this._call=null,this._time=1/0,E())}}},76626(e,t,n){"use strict";n.r(t),n.d(t,{zoom:()=>t6,zoomIdentity:()=>tq,zoomTransform:()=>tZ});var r,i,a,o,s=n(92626),u=n(44266),c=Math.SQRT2,l=2,f=4,d=1e-12;function h(e){return((e=Math.exp(e))+1/e)/2}function p(e){return((e=Math.exp(e))-1/e)/2}function b(e){return((e=Math.exp(2*e))-1)/(e+1)}function m(e,t){var n,r,i=e[0],a=e[1],o=e[2],s=t[0],u=t[1],m=t[2],g=s-i,v=u-a,y=g*g+v*v;if(yT)throw Error("too late; already scheduled");return n}function P(e,t){var n=R(e,t);if(n.state>A)throw Error("too late; already running");return n}function R(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw Error("transition not found");return n}function j(e,t,n){var r,i=e.__transition;function a(e){n.state=M,n.timer.restart(o,n.delay,n.time),n.delay<=e&&o(e-n.delay)}function o(a){var c,l,f,d;if(n.state!==M)return u();for(c in i)if((d=i[c]).name===n.name){if(d.state===A)return S(o);d.state===L?(d.state=I,d.timer.stop(),d.on.call("interrupt",e,e.__data__,d.index,d.group),delete i[c]):+cO&&n.state180?t+=360:t-e>180&&(e+=360),a.push({i:n.push(i(n)+"rotate(",null,r)-2,x:B(e,t)})):t&&n.push(i(n)+"rotate("+t+r)}function s(e,t,n,a){e!==t?a.push({i:n.push(i(n)+"skewX(",null,r)-2,x:B(e,t)}):t&&n.push(i(n)+"skewX("+t+r)}function u(e,t,n,r,a,o){if(e!==n||t!==r){var s=a.push(i(a)+"scale(",null,",",null,")");o.push({i:s-4,x:B(e,n)},{i:s-2,x:B(t,r)})}else(1!==n||1!==r)&&a.push(i(a)+"scale("+n+","+r+")")}return function(t,n){var r=[],i=[];return t=e(t),n=e(n),a(t.translateX,t.translateY,n.translateX,n.translateY,r,i),o(t.rotate,n.rotate,r,i),s(t.skewX,n.skewX,r,i),u(t.scaleX,t.scaleY,n.scaleX,n.scaleY,r,i),t=n=null,function(e){for(var t,n=-1,a=i.length;++n>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?e_(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?e_(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=ec.exec(e))?new ek(t[1],t[2],t[3],1):(t=el.exec(e))?new ek(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=ef.exec(e))?e_(t[1],t[2],t[3],t[4]):(t=ed.exec(e))?e_(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=eh.exec(e))?eO(t[1],t[2]/100,t[3]/100,1):(t=ep.exec(e))?eO(t[1],t[2]/100,t[3]/100,t[4]):eb.hasOwnProperty(e)?ew(eb[e]):"transparent"===e?new ek(NaN,NaN,NaN,0):null}function ew(e){return new ek(e>>16&255,e>>8&255,255&e,1)}function e_(e,t,n,r){return r<=0&&(e=t=n=NaN),new ek(e,t,n,r)}function eE(e){return(e instanceof en||(e=ey(e)),e)?(e=e.rgb(),new ek(e.r,e.g,e.b,e.opacity)):new ek}function eS(e,t,n,r){return 1===arguments.length?eE(e):new ek(e,t,n,null==r?1:r)}function ek(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function ex(){return"#"+eM(this.r)+eM(this.g)+eM(this.b)}function eT(){var e=this.opacity;return(1===(e=isNaN(e)?1:Math.max(0,Math.min(1,e)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===e?")":", "+e+")")}function eM(e){return((e=Math.max(0,Math.min(255,Math.round(e)||0)))<16?"0":"")+e.toString(16)}function eO(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new eC(e,t,n,r)}function eA(e){if(e instanceof eC)return new eC(e.h,e.s,e.l,e.opacity);if(e instanceof en||(e=ey(e)),!e)return new eC;if(e instanceof eC)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,s=a-i,u=(a+i)/2;return s?(o=t===a?(n-r)/s+(n0&&u<1?0:o,new eC(o,s,u,e.opacity)}function eL(e,t,n,r){return 1===arguments.length?eA(e):new eC(e,t,n,null==r?1:r)}function eC(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function eI(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}function eD(e,t,n,r,i){var a=e*e,o=a*e;return((1-3*e+3*a-o)*t+(4-6*a+3*o)*n+(1+3*e+3*a-3*o)*r+o*i)/6}function eN(e){var t=e.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,t-1):Math.floor(n*t),i=e[r],a=e[r+1],o=r>0?e[r-1]:2*i-a,s=r=240?e-240:e+120,i,r),eI(e,i,r),eI(e<120?e+240:e-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var e=this.opacity;return(1===(e=isNaN(e)?1:Math.max(0,Math.min(1,e)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===e?")":", "+e+")")}}));let eU=function e(t){var n=eY(1);function r(e,t){var r=n((e=eS(e)).r,(t=eS(t)).r),i=n(e.g,t.g),a=n(e.b,t.b),o=eB(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=a(t),e.opacity=o(t),e+""}}return r.gamma=e,r}(1);function eH(e){return function(t){var n,r,i=t.length,a=Array(i),o=Array(i),s=Array(i);for(n=0;na&&(i=t.slice(a,i),s[o]?s[o]+=i:s[++o]=i),(n=n[0])===(r=r[0])?s[o]?s[o]+=r:s[++o]=r:(s[++o]=null,u.push({i:o,x:B(n,r)})),a=ez.lastIndex;return a=0&&(e=e.slice(0,t)),!e||"start"===e})}function tc(e,t,n){var r,i,a=tu(t)?N:P;return function(){var o=a(this,e),s=o.on;s!==r&&(i=(r=s).copy()).on(t,n),o.on=i}}function tl(e,t){var n=this._id;return arguments.length<2?R(this.node(),n).on.on(e):this.each(tc(n,e,t))}function tf(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function td(){return this.on("end.remove",tf(this._id))}var th=n(82634);function tp(e){var t=this._name,n=this._id;"function"!=typeof e&&(e=(0,th.Z)(e));for(var r=this._groups,i=r.length,a=Array(i),o=0;or?(r+i)/2:Math.min(0,r)||Math.max(0,i),o>a?(a+o)/2:Math.min(0,a)||Math.max(0,o))}function t6(){var e,t,n=tQ,r=t1,i=t4,a=t2,o=t3,c=[0,1/0],l=[[-1/0,-1/0],[1/0,1/0]],f=250,d=m,h=(0,s.Z)("start","zoom","end"),p=500,b=150,_=0;function E(e){e.property("__zoom",t0).on("wheel.zoom",A).on("mousedown.zoom",L).on("dblclick.zoom",C).filter(o).on("touchstart.zoom",I).on("touchmove.zoom",D).on("touchend.zoom touchcancel.zoom",N).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function S(e,t){return(t=Math.max(c[0],Math.min(c[1],t)))===e.k?e:new tV(t,e.x,e.y)}function k(e,t,n){var r=t[0]-n[0]*e.k,i=t[1]-n[1]*e.k;return r===e.x&&i===e.y?e:new tV(e.k,r,i)}function x(e){return[(+e[0][0]+ +e[1][0])/2,(+e[0][1]+ +e[1][1])/2]}function T(e,t,n){e.on("start.zoom",function(){M(this,arguments).start()}).on("interrupt.zoom end.zoom",function(){M(this,arguments).end()}).tween("zoom",function(){var e=this,i=arguments,a=M(e,i),o=r.apply(e,i),s=null==n?x(o):"function"==typeof n?n.apply(e,i):n,u=Math.max(o[1][0]-o[0][0],o[1][1]-o[0][1]),c=e.__zoom,l="function"==typeof t?t.apply(e,i):t,f=d(c.invert(s).concat(u/c.k),l.invert(s).concat(u/l.k));return function(e){if(1===e)e=l;else{var t=f(e),n=u/t[2];e=new tV(n,s[0]-t[0]*n,s[1]-t[1]*n)}a.zoom(null,e)}})}function M(e,t,n){return!n&&e.__zooming||new O(e,t)}function O(e,t){this.that=e,this.args=t,this.active=0,this.extent=r.apply(e,t),this.taps=0}function A(){if(n.apply(this,arguments)){var e=M(this,arguments),t=this.__zoom,r=Math.max(c[0],Math.min(c[1],t.k*Math.pow(2,a.apply(this,arguments)))),o=(0,v.Z)(this);if(e.wheel)(e.mouse[0][0]!==o[0]||e.mouse[0][1]!==o[1])&&(e.mouse[1]=t.invert(e.mouse[0]=o)),clearTimeout(e.wheel);else{if(t.k===r)return;e.mouse=[o,t.invert(o)],F(this),e.start()}tJ(),e.wheel=setTimeout(s,b),e.zoom("mouse",i(k(S(t,r),e.mouse[0],e.mouse[1]),e.extent,l))}function s(){e.wheel=null,e.end()}}function L(){if(!t&&n.apply(this,arguments)){var e=M(this,arguments,!0),r=(0,y.Z)(g.B.view).on("mousemove.zoom",c,!0).on("mouseup.zoom",f,!0),a=(0,v.Z)(this),o=g.B.clientX,s=g.B.clientY;(0,u.Z)(g.B.view),tX(),e.mouse=[a,this.__zoom.invert(a)],F(this),e.start()}function c(){if(tJ(),!e.moved){var t=g.B.clientX-o,n=g.B.clientY-s;e.moved=t*t+n*n>_}e.zoom("mouse",i(k(e.that.__zoom,e.mouse[0]=(0,v.Z)(e.that),e.mouse[1]),e.extent,l))}function f(){r.on("mousemove.zoom mouseup.zoom",null),(0,u.D)(g.B.view,e.moved),tJ(),e.end()}}function C(){if(n.apply(this,arguments)){var e=this.__zoom,t=(0,v.Z)(this),a=e.invert(t),o=e.k*(g.B.shiftKey?.5:2),s=i(k(S(e,o),t,a),r.apply(this,arguments),l);tJ(),f>0?(0,y.Z)(this).transition().duration(f).call(T,s,t):(0,y.Z)(this).call(E.transform,s)}}function I(){if(n.apply(this,arguments)){var t,r,i,a,o=g.B.touches,s=o.length,u=M(this,arguments,g.B.changedTouches.length===s);for(tX(),r=0;r=0?i=setTimeout(r,t-c):(i=null,n||(u=e.apply(o,a),o=a=null))}null==t&&(t=100);var i,a,o,s,u,c=function(){o=this,a=arguments,s=Date.now();var c=n&&!i;return i||(i=setTimeout(r,t)),c&&(u=e.apply(o,a),o=a=null),u};return c.clear=function(){i&&(clearTimeout(i),i=null)},c.flush=function(){i&&(u=e.apply(o,a),o=a=null,clearTimeout(i),i=null)},c}t.debounce=t,e.exports=t},94863:function(e){var t,n;t=this,n=function(){"use strict";var e=function(e){return t(e)&&!n(e)};function t(e){return!!e&&"object"==typeof e}function n(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||i(e)}var r="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function i(e){return e.$$typeof===r}function a(e){return Array.isArray(e)?[]:{}}function o(e,t){return!1!==t.clone&&t.isMergeableObject(e)?d(a(e),e,t):e}function s(e,t,n){return e.concat(t).map(function(e){return o(e,n)})}function u(e,t){if(!t.customMerge)return d;var n=t.customMerge(e);return"function"==typeof n?n:d}function c(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return e.propertyIsEnumerable(t)}):[]}function l(e){return Object.keys(e).concat(c(e))}function f(e,t,n){var r={};return n.isMergeableObject(e)&&l(e).forEach(function(t){r[t]=o(e[t],n)}),l(t).forEach(function(i){n.isMergeableObject(t[i])&&e[i]?r[i]=u(i,n)(e[i],t[i],n):r[i]=o(t[i],n)}),r}function d(t,n,r){(r=r||{}).arrayMerge=r.arrayMerge||s,r.isMergeableObject=r.isMergeableObject||e;var i=Array.isArray(n);return i!==Array.isArray(t)?o(n,r):i?r.arrayMerge(t,n,r):f(t,n,r)}return d.all=function(e,t){if(!Array.isArray(e))throw Error("first argument should be an array");return e.reduce(function(e,n){return d(e,n,t)},{})},d},e.exports=n()},7624(e,t){"use strict";function n(e){return e===e.window?e:9===e.nodeType&&(e.defaultView||e.parentWindow)}t.__esModule=!0,t.default=n,e.exports=t.default},87797(e,t,n){"use strict";var r=n(64836);t.__esModule=!0,t.default=s;var i=r(n(53497)),a=/^(top|right|bottom|left)$/,o=/^([+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|))(?!px)[a-z%]+$/i;function s(e){if(!e)throw TypeError("No Element passed to `getComputedStyle()`");var t=e.ownerDocument;return"defaultView"in t?t.defaultView.opener?e.ownerDocument.defaultView.getComputedStyle(e,null):window.getComputedStyle(e,null):{getPropertyValue:function(t){var n=e.style;"float"==(t=(0,i.default)(t))&&(t="styleFloat");var r=e.currentStyle[t]||null;if(null==r&&n&&n[t]&&(r=n[t]),o.test(r)&&!a.test(t)){var s=n.left,u=e.runtimeStyle,c=u&&u.left;c&&(u.left=e.currentStyle.left),n.left="fontSize"===t?"1em":r,r=n.pixelLeft+"px",n.left=s,c&&(u.left=c)}return r}}}e.exports=t.default},10162(e,t,n){"use strict";var r=n(64836);t.__esModule=!0,t.default=l;var i=r(n(53497)),a=r(n(24403)),o=r(n(87797)),s=r(n(91760)),u=n(20702),c=r(n(43293));function l(e,t,n){var r="",l="",f=t;if("string"==typeof t){if(void 0===n)return e.style[(0,i.default)(t)]||(0,o.default)(e).getPropertyValue((0,a.default)(t));(f={})[t]=n}Object.keys(f).forEach(function(t){var n=f[t];n||0===n?(0,c.default)(t)?l+=t+"("+n+") ":r+=(0,a.default)(t)+": "+n+";":(0,s.default)(e,(0,a.default)(t))}),l&&(r+=u.transform+": "+l+";"),e.style.cssText+=";"+r}e.exports=t.default},91760(e,t){"use strict";function n(e,t){return"removeProperty"in e.style?e.style.removeProperty(t):e.style.removeAttribute(t)}t.__esModule=!0,t.default=n,e.exports=t.default},43293(e,t){"use strict";t.__esModule=!0,t.default=r;var n=/^((translate|rotate|scale)(X|Y|Z|3d)?|matrix(3d)?|perspective|skew(X|Y)?)$/i;function r(e){return!!(e&&n.test(e))}e.exports=t.default},20702(e,t,n){"use strict";var r,i,a,o,s,u,c,l,f,d,h,p=n(64836);t.__esModule=!0,t.default=t.animationEnd=t.animationDelay=t.animationTiming=t.animationDuration=t.animationName=t.transitionEnd=t.transitionDuration=t.transitionDelay=t.transitionTiming=t.transitionProperty=t.transform=void 0;var b=p(n(50139)),m="transform";if(t.transform=m,t.animationEnd=a,t.transitionEnd=i,t.transitionDelay=c,t.transitionTiming=u,t.transitionDuration=s,t.transitionProperty=o,t.animationDelay=h,t.animationTiming=d,t.animationDuration=f,t.animationName=l,b.default){var g=y();r=g.prefix,t.transitionEnd=i=g.transitionEnd,t.animationEnd=a=g.animationEnd,t.transform=m=r+"-"+m,t.transitionProperty=o=r+"-transition-property",t.transitionDuration=s=r+"-transition-duration",t.transitionDelay=c=r+"-transition-delay",t.transitionTiming=u=r+"-transition-timing-function",t.animationName=l=r+"-animation-name",t.animationDuration=f=r+"-animation-duration",t.animationTiming=d=r+"-animation-delay",t.animationDelay=h=r+"-animation-timing-function"}var v={transform:m,end:i,property:o,timing:u,delay:c,duration:s};function y(){for(var e,t,n=document.createElement("div").style,r={O:function(e){return"o"+e.toLowerCase()},Moz:function(e){return e.toLowerCase()},Webkit:function(e){return"webkit"+e},ms:function(e){return"MS"+e}},i=Object.keys(r),a="",o=0;o0&&void 0!==arguments[0]?arguments[0]:{},r=n.defaultLayoutOptions,a=void 0===r?{}:r,s=n.algorithms,u=void 0===s?["layered","stress","mrtree","radial","force","disco","sporeOverlap","sporeCompaction","rectpacking"]:s,c=n.workerFactory,l=n.workerUrl;if(i(this,e),this.defaultLayoutOptions=a,this.initialized=!1,void 0===l&&void 0===c)throw Error("Cannot construct an ELK without both 'workerUrl' and 'workerFactory'.");var f=c;void 0!==l&&void 0===c&&(f=function(e){return new Worker(e)});var d=f(l);if("function"!=typeof d.postMessage)throw TypeError("Created worker does not provide the required 'postMessage' function.");this.worker=new o(d),this.worker.postMessage({cmd:"register",algorithms:u}).then(function(e){return t.initialized=!0}).catch(console.err)}return r(e,[{key:"layout",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.layoutOptions,r=void 0===n?this.defaultLayoutOptions:n,i=t.logging,a=void 0!==i&&i,o=t.measureExecutionTime,s=void 0!==o&&o;return e?this.worker.postMessage({cmd:"layout",graph:e,layoutOptions:r,options:{logging:a,measureExecutionTime:s}}):Promise.reject(Error("Missing mandatory parameter 'graph'."))}},{key:"knownLayoutAlgorithms",value:function(){return this.worker.postMessage({cmd:"algorithms"})}},{key:"knownLayoutOptions",value:function(){return this.worker.postMessage({cmd:"options"})}},{key:"knownLayoutCategories",value:function(){return this.worker.postMessage({cmd:"categories"})}},{key:"terminateWorker",value:function(){this.worker.terminate()}}]),e}();n.default=a;var o=function(){function e(t){var n=this;if(i(this,e),void 0===t)throw Error("Missing mandatory parameter 'worker'.");this.resolvers={},this.worker=t,this.worker.onmessage=function(e){setTimeout(function(){n.receive(n,e)},0)}}return r(e,[{key:"postMessage",value:function(e){var t=this.id||0;this.id=t+1,e.id=t;var n=this;return new Promise(function(r,i){n.resolvers[t]=function(e,t){e?(n.convertGwtStyleError(e),i(e)):r(t)},n.worker.postMessage(e)})}},{key:"receive",value:function(e,t){var n=t.data,r=e.resolvers[n.id];r&&(delete e.resolvers[n.id],n.error?r(n.error):r(null,n.data))}},{key:"terminate",value:function(){this.worker.terminate&&this.worker.terminate()}},{key:"convertGwtStyleError",value:function(e){if(e){var t=e.__java$exception;t&&(t.cause&&t.cause.backingJsObject&&(e.cause=t.cause.backingJsObject,this.convertGwtStyleError(e.cause)),delete e.__java$exception)}}}]),e}()},{}],2:[function(e,t,n){"use strict";var r=e("./elk-api.js").default;Object.defineProperty(t.exports,"__esModule",{value:!0}),t.exports=r,r.default=r},{"./elk-api.js":1}]},{},[2])(2)},e.exports=t()},55273(e,t,n){"use strict";function r(){}function i(){}function a(){}function o(){}function s(){}function u(){}function c(){}function l(){}function f(){}function d(){}function h(){}function p(){}function b(){}function m(){}function g(){}function v(){}function y(){}function w(){}function _(){}function E(){}function S(){}function k(){}function x(){}function T(){}function M(){}function O(){}function A(){}function L(){}function C(){}function I(){}function D(){}function N(){}function P(){}function R(){}function j(){}function F(){}function Y(){}function B(){}function U(){}function H(){}function $(){}function z(){}function G(){}function W(){}function K(){}function V(){}function q(){}function Z(){}function X(){}function J(){}function Q(){}function ee(){}function et(){}function en(){}function er(){}function ei(){}function ea(){}function eo(){}function es(){}function eu(){}function ec(){}function el(){}function ef(){}function ed(){}function eh(){}function ep(){}function eb(){}function em(){}function eg(){}function ev(){}function ey(){}function ew(){}function e_(){}function eE(){}function eS(){}function ek(){}function ex(){}function eT(){}function eM(){}function eO(){}function eA(){}function eL(){}function eC(){}function eI(){}function eD(){}function eN(){}function eP(){}function eR(){}function ej(){}function eF(){}function eY(){}function eB(){}function eU(){}function eH(){}function e$(){}function ez(){}function eG(){}function eW(){}function eK(){}function eV(){}function eq(){}function eZ(){}function eX(){}function eJ(){}function eQ(){}function e1(){}function e0(){}function e2(){}function e3(){}function e4(){}function e6(){}function e5(){}function e8(){}function e9(){}function e7(){}function te(){}function tt(){}function tn(){}function tr(){}function ti(){}function ta(){}function to(){}function ts(){}function tu(){}function tc(){}function tl(){}function tf(){}function td(){}function th(){}function tp(){}function tb(){}function tm(){}function tg(){}function tv(){}function ty(){}function tw(){}function t_(){}function tE(){}function tS(){}function tk(){}function tx(){}function tT(){}function tM(){}function tO(){}function tA(){}function tL(){}function tC(){}function tI(){}function tD(){}function tN(){}function tP(){}function tR(){}function tj(){}function tF(){}function tY(){}function tB(){}function tU(){}function tH(){}function t$(){}function tz(){}function tG(){}function tW(){}function tK(){}function tV(){}function tq(){}function tZ(){}function tX(){}function tJ(){}function tQ(){}function t1(){}function t0(){}function t2(){}function t3(){}function t4(){}function t6(){}function t5(){}function t8(){}function t9(){}function t7(){}function ne(){}function nt(){}function nn(){}function nr(){}function ni(){}function na(){}function no(){}function ns(){}function nu(){}function nc(){}function nl(){}function nf(){}function nd(){}function nh(){}function np(){}function nb(){}function nm(){}function ng(){}function nv(){}function ny(){}function nw(){}function n_(){}function nE(){}function nS(){}function nk(){}function nx(){}function nT(){}function nM(){}function nO(){}function nA(){}function nL(){}function nC(){}function nI(){}function nD(){}function nN(){}function nP(){}function nR(){}function nj(){}function nF(){}function nY(){}function nB(){}function nU(){}function nH(){}function n$(){}function nz(){}function nG(){}function nW(){}function nK(){}function nV(){}function nq(){}function nZ(){}function nX(){}function nJ(){}function nQ(){}function n1(){}function n0(){}function n2(){}function n3(){}function n4(){}function n6(){}function n5(){}function n8(){}function n9(){}function n7(){}function re(){}function rt(){}function rn(){}function rr(){}function ri(){}function ra(){}function ro(){}function rs(){}function ru(){}function rc(){}function rl(){}function rf(){}function rd(){}function rh(){}function rp(){}function rb(){}function rm(){}function rg(){}function rv(){}function ry(){}function rw(){}function r_(){}function rE(){}function rS(){}function rk(){}function rx(){}function rT(){}function rM(){}function rO(){}function rA(){}function rL(){}function rC(){}function rI(){}function rD(){}function rN(){}function rP(){}function rR(){}function rj(){}function rF(){}function rY(){}function rB(){}function rU(){}function rH(){}function r$(){}function rz(){}function rG(){}function rW(){}function rK(){}function rV(){}function rq(){}function rZ(){}function rX(){}function rJ(){}function rQ(){}function r1(){}function r0(){}function r2(){}function r3(){}function r4(){}function r6(){}function r5(){}function r8(){}function r9(){}function r7(){}function ie(){}function it(){}function ir(){}function ii(){}function ia(){}function io(){}function is(){}function iu(){}function ic(){}function il(){}function id(){}function ih(){}function ip(){}function ib(){}function im(){}function ig(){}function iv(){}function iy(){}function iw(){}function i_(){}function iE(){}function iS(){}function ik(){}function ix(){}function iT(){}function iM(){}function iO(){}function iA(){}function iL(){}function iC(){}function iI(){}function iD(){}function iN(){}function iP(){}function iR(){}function ij(){}function iF(){}function iY(){}function iB(){}function iU(){}function iH(){}function i$(){}function iz(){}function iG(){}function iW(){}function iK(){}function iV(){}function iq(){}function iZ(){}function iX(){}function iJ(){}function iQ(){}function i1(){}function i0(){}function i2(){}function i3(){}function i4(){}function i6(){}function i5(){}function i8(){}function i9(){}function i7(){}function ae(){}function at(){}function an(){}function ar(){}function ai(){}function aa(){}function ao(){}function as(){}function au(){}function ac(){}function al(){}function af(){}function ad(){}function ah(){}function ap(){}function ab(){}function am(){}function ag(){}function av(){}function ay(){}function aw(){}function a_(){}function aE(){}function aS(){}function ak(){}function ax(){}function aT(){}function aM(){}function aO(){}function aA(){}function aL(){}function aC(){}function aI(){}function aD(){}function aN(){}function aP(){}function aR(){}function aj(){}function aF(){}function aY(){}function aB(){}function aU(){}function aH(){}function a$(){}function az(){}function aG(){}function aW(){}function aK(){}function aV(){}function aq(){}function aZ(){}function aX(){}function aJ(){}function aQ(){}function a1(){}function a0(){}function a2(){}function a3(){}function a4(){}function a6(){}function a5(){}function a8(){}function a9(){}function a7(){}function oe(){}function ot(){}function on(){}function or(){}function oi(){}function oa(){}function oo(){}function os(){}function ou(){}function oc(){}function ol(){}function of(){}function od(){}function oh(){}function op(){}function ob(){}function om(){}function og(){}function ov(){}function oy(){}function ow(){}function o_(){}function oE(){}function oS(){}function ok(){}function ox(){}function oT(){}function oM(){}function oO(){}function oA(){}function oL(){}function oC(){}function oI(){}function oD(){}function oN(){}function oP(){}function oR(){}function oj(){}function oF(){}function oY(){}function oB(){}function oU(){}function oH(){}function o$(){}function oz(){}function oG(){}function oW(){}function oK(){}function oV(){}function oq(){}function oZ(){}function oX(){}function oJ(){}function oQ(){}function o1(){}function o0(){}function o2(){}function o3(){}function o4(){}function o6(){}function o5(){}function o8(){}function o9(){}function o7(){}function se(){}function st(){}function sn(){}function sr(){}function si(){}function sa(){}function so(){}function ss(){}function su(){}function sc(){}function sl(){}function sf(){}function sd(){}function sh(){}function sp(){}function sb(){}function sm(){}function sg(){}function sv(){}function sy(){}function sw(){}function s_(){}function sE(){}function sS(){}function sk(){}function sx(){}function sT(){}function sM(){}function sO(){}function sA(){}function sL(){}function sC(){}function sI(){}function sD(){}function sN(){}function sP(){}function sR(){}function sj(){}function sF(){}function sY(){}function sB(){}function sU(){}function sH(){}function s$(){}function sz(){}function sG(){}function sW(){}function sK(){}function sV(){}function sq(){}function sZ(){}function sX(){}function sJ(){}function sQ(){}function s1(){}function s0(){}function s2(){}function s3(){}function s4(){}function s6(){}function s5(){}function s8(){}function s9(){}function s7(){}function ue(){}function ut(){}function un(){}function ur(){}function ui(){}function ua(){}function uo(){}function us(){}function uu(){}function uc(){}function ul(){}function uf(){}function ud(){}function uh(){}function up(){}function ub(){}function um(){}function ug(){}function uv(){}function uy(){}function uw(){}function u_(){}function uE(){}function uS(){}function uk(){}function ux(){}function uT(){}function uM(){}function uO(){}function uA(){}function uL(){}function uC(){}function uI(){}function uD(){}function uN(){}function uP(){}function uR(){}function uj(){}function uF(){}function uY(){}function uB(){}function uU(){}function uH(){}function u$(){}function uz(){}function uG(){}function uW(){}function uK(){}function uV(){}function uq(){}function uZ(){}function uX(){}function uJ(){}function uQ(){}function u1(){}function u0(){}function u2(){}function u3(){}function u4(){}function u6(){}function u5(){}function u8(){}function u9(){}function u7(){}function ce(){}function ct(){}function cn(e){}function cr(e){}function ci(){m4()}function ca(){eug()}function co(){epz()}function cs(){evw()}function cu(){eEg()}function cc(){eCk()}function cl(){egA()}function cf(){egq()}function cd(){_O()}function ch(){_k()}function cp(){DR()}function cb(){_A()}function cm(){erJ()}function cg(){_C()}function cv(){Xi()}function cy(){en5()}function cw(){Jb()}function c_(){Gw()}function cE(){euv()}function cS(){e_z()}function ck(){en8()}function cx(){K8()}function cT(){eBH()}function cM(){egP()}function cO(){G_()}function cA(){eBy()}function cL(){Gv()}function cC(){en9()}function cI(){eoz()}function cD(){Gx()}function cN(){JK()}function cP(){_I()}function cR(){eTK()}function cj(){egj()}function cF(){eiQ()}function cY(){e_L()}function cB(){eCT()}function cU(){ebJ()}function cH(){eTj()}function c$(){eaB()}function cz(){GS()}function cG(){eDn()}function cW(){eTU()}function cK(){eMK()}function cV(){J1()}function cq(){e_C()}function cZ(){eBB()}function cX(){euw()}function cJ(){ed6()}function cQ(){ePm()}function c1(){De()}function c0(){eiM()}function c2(){eD4()}function c3(e){BJ(e)}function c4(e){this.a=e}function c6(e){this.a=e}function c5(e){this.a=e}function c8(e){this.a=e}function c9(e){this.a=e}function c7(e){this.a=e}function le(e){this.a=e}function lt(e){this.a=e}function ln(e){this.a=e}function lr(e){this.a=e}function li(e){this.a=e}function la(e){this.a=e}function lo(e){this.a=e}function ls(e){this.a=e}function lu(e){this.a=e}function lc(e){this.a=e}function ll(e){this.a=e}function lf(e){this.a=e}function ld(e){this.a=e}function lh(e){this.a=e}function lp(e){this.a=e}function lb(e){this.b=e}function lm(e){this.c=e}function lg(e){this.a=e}function lv(e){this.a=e}function ly(e){this.a=e}function lw(e){this.a=e}function l_(e){this.a=e}function lE(e){this.a=e}function lS(e){this.a=e}function lk(e){this.a=e}function lx(e){this.a=e}function lT(e){this.a=e}function lM(e){this.a=e}function lO(e){this.a=e}function lA(e){this.a=e}function lL(e){this.a=e}function lC(e){this.a=e}function lI(e){this.a=e}function lD(e){this.a=e}function lN(){this.a=[]}function lP(e,t){e.a=t}function lR(e,t){e.a=t}function lj(e,t){e.b=t}function lF(e,t){e.b=t}function lY(e,t){e.b=t}function lB(e,t){e.j=t}function lU(e,t){e.g=t}function lH(e,t){e.i=t}function l$(e,t){e.c=t}function lz(e,t){e.d=t}function lG(e,t){e.d=t}function lW(e,t){e.c=t}function lK(e,t){e.k=t}function lV(e,t){e.c=t}function lq(e,t){e.c=t}function lZ(e,t){e.a=t}function lX(e,t){e.a=t}function lJ(e,t){e.f=t}function lQ(e,t){e.a=t}function l1(e,t){e.b=t}function l0(e,t){e.d=t}function l2(e,t){e.i=t}function l3(e,t){e.o=t}function l4(e,t){e.r=t}function l6(e,t){e.a=t}function l5(e,t){e.b=t}function l8(e,t){e.e=t}function l9(e,t){e.f=t}function l7(e,t){e.g=t}function fe(e,t){e.e=t}function ft(e,t){e.f=t}function fn(e,t){e.f=t}function fr(e,t){e.n=t}function fi(e,t){e.a=t}function fa(e,t){e.a=t}function fo(e,t){e.c=t}function fs(e,t){e.c=t}function fu(e,t){e.d=t}function fc(e,t){e.e=t}function fl(e,t){e.g=t}function ff(e,t){e.a=t}function fd(e,t){e.c=t}function fh(e,t){e.d=t}function fp(e,t){e.e=t}function fb(e,t){e.f=t}function fm(e,t){e.j=t}function fg(e,t){e.a=t}function fv(e,t){e.b=t}function fy(e,t){e.a=t}function fw(e){e.b=e.a}function f_(e){e.c=e.d.d}function fE(e){this.d=e}function fS(e){this.a=e}function fk(e){this.a=e}function fx(e){this.a=e}function fT(e){this.a=e}function fM(e){this.a=e}function fO(e){this.a=e}function fA(e){this.a=e}function fL(e){this.a=e}function fC(e){this.a=e}function fI(e){this.a=e}function fD(e){this.a=e}function fN(e){this.a=e}function fP(e){this.a=e}function fR(e){this.a=e}function fj(e){this.b=e}function fF(e){this.b=e}function fY(e){this.b=e}function fB(e){this.a=e}function fU(e){this.a=e}function fH(e){this.a=e}function f$(e){this.c=e}function fz(e){this.c=e}function fG(e){this.c=e}function fW(e){this.a=e}function fK(e){this.a=e}function fV(e){this.a=e}function fq(e){this.a=e}function fZ(e){this.a=e}function fX(e){this.a=e}function fJ(e){this.a=e}function fQ(e){this.a=e}function f1(e){this.a=e}function f0(e){this.a=e}function f2(e){this.a=e}function f3(e){this.a=e}function f4(e){this.a=e}function f6(e){this.a=e}function f5(e){this.a=e}function f8(e){this.a=e}function f9(e){this.a=e}function f7(e){this.a=e}function de(e){this.a=e}function dt(e){this.a=e}function dn(e){this.a=e}function dr(e){this.a=e}function di(e){this.a=e}function da(e){this.a=e}function ds(e){this.a=e}function du(e){this.a=e}function dc(e){this.a=e}function dl(e){this.a=e}function df(e){this.a=e}function dd(e){this.a=e}function dh(e){this.a=e}function dp(e){this.a=e}function db(e){this.a=e}function dm(e){this.a=e}function dg(e){this.a=e}function dv(e){this.a=e}function dy(e){this.a=e}function dw(e){this.a=e}function d_(e){this.a=e}function dE(e){this.a=e}function dS(e){this.a=e}function dk(e){this.a=e}function dx(e){this.a=e}function dT(e){this.a=e}function dM(e){this.a=e}function dO(e){this.e=e}function dA(e){this.a=e}function dL(e){this.a=e}function dC(e){this.a=e}function dI(e){this.a=e}function dD(e){this.a=e}function dN(e){this.a=e}function dP(e){this.a=e}function dR(e){this.a=e}function dj(e){this.a=e}function dF(e){this.a=e}function dY(e){this.a=e}function dB(e){this.a=e}function dU(e){this.a=e}function dH(e){this.a=e}function d$(e){this.a=e}function dz(e){this.a=e}function dG(e){this.a=e}function dW(e){this.a=e}function dK(e){this.a=e}function dV(e){this.a=e}function dq(e){this.a=e}function dZ(e){this.a=e}function dX(e){this.a=e}function dJ(e){this.a=e}function dQ(e){this.a=e}function d1(e){this.a=e}function d0(e){this.a=e}function d2(e){this.a=e}function d3(e){this.a=e}function d4(e){this.a=e}function d6(e){this.a=e}function d5(e){this.a=e}function d8(e){this.a=e}function d9(e){this.a=e}function d7(e){this.a=e}function he(e){this.a=e}function ht(e){this.a=e}function hn(e){this.a=e}function hr(e){this.a=e}function hi(e){this.a=e}function ha(e){this.a=e}function ho(e){this.a=e}function hs(e){this.a=e}function hu(e){this.a=e}function hc(e){this.a=e}function hl(e){this.a=e}function hf(e){this.a=e}function hd(e){this.a=e}function hh(e){this.a=e}function hp(e){this.a=e}function hb(e){this.a=e}function hm(e){this.a=e}function hg(e){this.a=e}function hv(e){this.c=e}function hy(e){this.b=e}function hw(e){this.a=e}function h_(e){this.a=e}function hE(e){this.a=e}function hS(e){this.a=e}function hk(e){this.a=e}function hx(e){this.a=e}function hT(e){this.a=e}function hM(e){this.a=e}function hO(e){this.a=e}function hA(e){this.a=e}function hL(e){this.a=e}function hC(e){this.a=e}function hI(e){this.a=e}function hD(e){this.a=e}function hN(e){this.a=e}function hP(e){this.a=e}function hR(e){this.a=e}function hj(e){this.a=e}function hF(e){this.a=e}function hY(e){this.a=e}function hB(e){this.a=e}function hU(e){this.a=e}function hH(e){this.a=e}function h$(e){this.a=e}function hz(e){this.a=e}function hG(e){this.a=e}function hW(e){this.a=e}function hK(e){this.a=e}function hV(e){this.a=e}function hq(e){this.a=e}function hZ(e){this.a=e}function hX(e){this.a=e}function hJ(e){this.a=e}function hQ(e){this.a=e}function h1(e){this.a=e}function h0(e){this.a=e}function h2(e){this.a=e}function h3(e){this.a=e}function h4(e){this.a=e}function h6(e){this.a=e}function h5(e){this.a=e}function h8(e){this.a=e}function h9(e){this.a=e}function h7(e){this.a=e}function pe(e){this.a=e}function pt(e){this.a=e}function pn(e){this.a=e}function pr(e){this.a=e}function pi(e){this.a=e}function pa(e){this.a=e}function po(e){this.a=e}function ps(e){this.a=e}function pu(e){this.a=e}function pc(e){this.a=e}function pl(e){this.a=e}function pf(e){this.a=e}function pd(e){this.a=e}function ph(e){this.a=e}function pp(e){this.a=e}function pb(e){this.a=e}function pm(e){this.a=e}function pg(e){this.a=e}function pv(e){this.a=e}function py(e){this.a=e}function pw(e){this.a=e}function p_(e){this.a=e}function pE(e){this.a=e}function pS(e){this.a=e}function pk(e){this.a=e}function px(e){this.a=e}function pT(e){this.a=e}function pM(e){this.a=e}function pO(e){this.b=e}function pA(e){this.f=e}function pL(e){this.a=e}function pC(e){this.a=e}function pI(e){this.a=e}function pD(e){this.a=e}function pN(e){this.a=e}function pP(e){this.a=e}function pR(e){this.a=e}function pj(e){this.a=e}function pF(e){this.a=e}function pY(e){this.a=e}function pB(e){this.a=e}function pU(e){this.b=e}function pH(e){this.c=e}function p$(e){this.e=e}function pz(e){this.a=e}function pG(e){this.a=e}function pW(e){this.a=e}function pK(e){this.a=e}function pV(e){this.a=e}function pq(e){this.d=e}function pZ(e){this.a=e}function pX(e){this.a=e}function pJ(e){this.e=e}function pQ(){this.a=0}function p1(){TG(this)}function p0(){Tz(this)}function p2(){Yy(this)}function p3(){UP(this)}function p4(){cn(this)}function p6(){this.c=tgK}function p5(e,t){t.Wb(e)}function p8(e,t){e.b+=t}function p9(e){e.b=new gQ}function p7(e){return e.e}function be(e){return e.a}function bt(e){return e.a}function bn(e){return e.a}function br(e){return e.a}function bi(e){return e.a}function ba(){return null}function bo(){return null}function bs(){yC(),eY2()}function bu(e){e.b.tf(e.e)}function bc(e,t){e.b=t-e.b}function bl(e,t){e.a=t-e.a}function bf(e,t){t.ad(e.a)}function bd(e,t){ekv(t,e)}function bh(e,t,n){e.Od(n,t)}function bp(e,t){e.e=t,t.b=e}function bb(e){Dn(),this.a=e}function bm(e){Dn(),this.a=e}function bg(e){Dn(),this.a=e}function bv(e){Bx(),this.a=e}function by(e){$O(),e0E.be(e)}function bw(){O6.call(this)}function b_(){O6.call(this)}function bE(){bw.call(this)}function bS(){bw.call(this)}function bk(){bw.call(this)}function bx(){bw.call(this)}function bT(){bw.call(this)}function bM(){bw.call(this)}function bO(){bw.call(this)}function bA(){bw.call(this)}function bL(){bw.call(this)}function bC(){bw.call(this)}function bI(){bw.call(this)}function bD(){this.a=this}function bN(){this.Bb|=256}function bP(){this.b=new xW}function bR(){bR=A,new p2}function bj(){bE.call(this)}function bF(e,t){e.length=t}function bY(e,t){P_(e.a,t)}function bB(e,t){eEU(e.c,t)}function bU(e,t){Yf(e.b,t)}function bH(e,t){ebB(e.a,t)}function b$(e,t){elj(e.a,t)}function bz(e,t){eam(e.e,t)}function bG(e){exZ(e.c,e.b)}function bW(e,t){e.kc().Nb(t)}function bK(e){this.a=efh(e)}function bV(){this.a=new p2}function bq(){this.a=new p2}function bZ(){this.a=new p0}function bX(){this.a=new p0}function bJ(){this.a=new p0}function bQ(){this.a=new ey}function b1(){this.a=new Z5}function b0(){this.a=new tt}function b2(){this.a=new w7}function b3(){this.a=new W8}function b4(){this.a=new zZ}function b6(){this.a=new Cz}function b5(){this.a=new p0}function b8(){this.a=new p0}function b9(){this.a=new p0}function b7(){this.a=new p0}function me(){this.d=new p0}function mt(){this.a=new bV}function mn(){this.a=new p2}function mr(){this.b=new p2}function mi(){this.b=new p0}function ma(){this.e=new p0}function mo(){this.d=new p0}function ms(){this.a=new cS}function mu(){p0.call(this)}function mc(){bZ.call(this)}function ml(){CK.call(this)}function mf(){b8.call(this)}function md(){mh.call(this)}function mh(){p4.call(this)}function mp(){p4.call(this)}function mb(){mp.call(this)}function mm(){$m.call(this)}function mg(){$m.call(this)}function mv(){mq.call(this)}function my(){mq.call(this)}function mw(){mq.call(this)}function m_(){mZ.call(this)}function mE(){_n.call(this)}function mS(){oZ.call(this)}function mk(){oZ.call(this)}function mx(){m0.call(this)}function mT(){m0.call(this)}function mM(){p2.call(this)}function mO(){p2.call(this)}function mA(){p2.call(this)}function mL(){bV.call(this)}function mC(){en0.call(this)}function mI(){bN.call(this)}function mD(){Oy.call(this)}function mN(){Oy.call(this)}function mP(){p2.call(this)}function mR(){p2.call(this)}function mj(){p2.call(this)}function mF(){sr.call(this)}function mY(){sr.call(this)}function mB(){mF.call(this)}function mU(){u7.call(this)}function mH(e){eti.call(this,e)}function m$(e){eti.call(this,e)}function mz(e){ln.call(this,e)}function mG(e){wB.call(this,e)}function mW(e){mG.call(this,e)}function mK(e){wB.call(this,e)}function mV(){this.a=new _n}function mq(){this.a=new bV}function mZ(){this.a=new p2}function mX(){this.a=new p0}function mJ(){this.j=new p0}function mQ(){this.a=new aX}function m1(){this.a=new y4}function m0(){this.a=new sn}function m2(){m2=A,e0d=new vm}function m3(){m3=A,e0f=new vb}function m4(){m4=A,e0l=new i}function m6(){m6=A,e0m=new OV}function m5(e){mG.call(this,e)}function m8(e){mG.call(this,e)}function m9(e){ql.call(this,e)}function m7(e){ql.call(this,e)}function ge(e){IJ.call(this,e)}function gt(e){eEb.call(this,e)}function gn(e){w$.call(this,e)}function gr(e){wG.call(this,e)}function gi(e){wG.call(this,e)}function ga(e){wG.call(this,e)}function go(e){Fu.call(this,e)}function gs(e){go.call(this,e)}function gu(){lD.call(this,{})}function gc(e){Og(),this.a=e}function gl(e){e.b=null,e.c=0}function gf(e,t){e.e=t,eA8(e,t)}function gd(e,t){e.a=t,eSG(e)}function gh(e,t,n){e.a[t.g]=n}function gp(e,t,n){evq(n,e,t)}function gb(e,t){In(t.i,e.n)}function gm(e,t){esW(e).td(t)}function gg(e,t){return e*e/t}function gv(e,t){return e.g-t.g}function gy(e){return new lI(e)}function gw(e){return new B_(e)}function g_(e){go.call(this,e)}function gE(e){go.call(this,e)}function gS(e){go.call(this,e)}function gk(e){Fu.call(this,e)}function gx(e){eiJ(),this.a=e}function gT(e){I7(),this.a=e}function gM(e){jK(),this.f=e}function gO(e){jK(),this.f=e}function gA(e){go.call(this,e)}function gL(e){go.call(this,e)}function gC(e){go.call(this,e)}function gI(e){go.call(this,e)}function gD(e){go.call(this,e)}function gN(e){return BJ(e),e}function gP(e){return BJ(e),e}function gR(e){return BJ(e),e}function gj(e){return BJ(e),e}function gF(e){return BJ(e),e}function gY(e){return e.b==e.c}function gB(e){return!!e&&e.b}function gU(e){return!!e&&e.k}function gH(e){return!!e&&e.j}function g$(e){BJ(e),this.a=e}function gz(e){return esR(e),e}function gG(e){Ya(e,e.length)}function gW(e){go.call(this,e)}function gK(e){go.call(this,e)}function gV(e){go.call(this,e)}function gq(e){go.call(this,e)}function gZ(e){go.call(this,e)}function gX(e){go.call(this,e)}function gJ(e){AI.call(this,e,0)}function gQ(){G$.call(this,12,3)}function g1(){g1=A,e0_=new _}function g0(){g0=A,e0y=new r}function g2(){g2=A,e0k=new b}function g3(){g3=A,e0M=new g}function g4(){throw p7(new bO)}function g6(){throw p7(new bO)}function g5(){throw p7(new bO)}function g8(){throw p7(new bO)}function g9(){throw p7(new bO)}function g7(){throw p7(new bO)}function ve(){this.a=Lq(Y8(eUd))}function vt(e){Dn(),this.a=Y8(e)}function vn(e,t){e.Td(t),t.Sd(e)}function vr(e,t){e.a.ec().Mc(t)}function vi(e,t,n){e.c.lf(t,n)}function va(e){gE.call(this,e)}function vo(e){gL.call(this,e)}function vs(){fM.call(this,"")}function vu(){fM.call(this,"")}function vc(){fM.call(this,"")}function vl(){fM.call(this,"")}function vf(e){gE.call(this,e)}function vd(e){fF.call(this,e)}function vh(e){O2.call(this,e)}function vp(e){vd.call(this,e)}function vb(){ls.call(this,null)}function vm(){ls.call(this,null)}function vg(){vg=A,$O()}function vv(){vv=A,e2d=eyz()}function vy(e){return e.a?e.b:0}function vw(e){return e.a?e.b:0}function v_(e,t){return e.a-t.a}function vE(e,t){return e.a-t.a}function vS(e,t){return e.a-t.a}function vk(e,t){return QO(e,t)}function vx(e,t){return z8(e,t)}function vT(e,t){return t in e.a}function vM(e,t){return e.f=t,e}function vO(e,t){return e.b=t,e}function vA(e,t){return e.c=t,e}function vL(e,t){return e.g=t,e}function vC(e,t){return e.a=t,e}function vI(e,t){return e.f=t,e}function vD(e,t){return e.k=t,e}function vN(e,t){return e.a=t,e}function vP(e,t){return e.e=t,e}function vR(e,t){return e.e=t,e}function vj(e,t){return e.f=t,e}function vF(e,t){e.b=!0,e.d=t}function vY(e,t){e.b=new TS(t)}function vB(e,t,n){t.td(e.a[n])}function vU(e,t,n){t.we(e.a[n])}function vH(e,t){return e.b-t.b}function v$(e,t){return e.g-t.g}function vz(e,t){return e.s-t.s}function vG(e,t){return e?0:t-1}function vW(e,t){return e?0:t-1}function vK(e,t){return e?t-1:0}function vV(e,t){return t.Yf(e)}function vq(e,t){return e.b=t,e}function vZ(e,t){return e.a=t,e}function vX(e,t){return e.c=t,e}function vJ(e,t){return e.d=t,e}function vQ(e,t){return e.e=t,e}function v1(e,t){return e.f=t,e}function v0(e,t){return e.a=t,e}function v2(e,t){return e.b=t,e}function v3(e,t){return e.c=t,e}function v4(e,t){return e.c=t,e}function v6(e,t){return e.b=t,e}function v5(e,t){return e.d=t,e}function v8(e,t){return e.e=t,e}function v9(e,t){return e.f=t,e}function v7(e,t){return e.g=t,e}function ye(e,t){return e.a=t,e}function yt(e,t){return e.i=t,e}function yn(e,t){return e.j=t,e}function yr(e,t){return e.k=t,e}function yi(e,t){return e.j=t,e}function ya(e,t){e_z(),Gc(t,e)}function yo(e,t,n){jX(e.a,t,n)}function ys(e){U9.call(this,e)}function yu(e){U9.call(this,e)}function yc(e){I3.call(this,e)}function yl(e){efB.call(this,e)}function yf(e){eta.call(this,e)}function yd(e){HO.call(this,e)}function yh(e){HO.call(this,e)}function yp(){MA.call(this,"")}function yb(){this.a=0,this.b=0}function ym(){this.b=0,this.a=0}function yg(e,t){e.b=0,enh(e,t)}function yv(e,t){e.c=t,e.b=!0}function yy(e,t){return e.c._b(t)}function yw(e){return e.e&&e.e()}function y_(e){return e?e.d:null}function yE(e,t){return ecD(e.b,t)}function yS(e){return e?e.g:null}function yk(e){return e?e.i:null}function yx(e){return LW(e),e.o}function yT(){yT=A,tmc=evO()}function yM(){yM=A,tml=ewS()}function yO(){yO=A,tgg=evL()}function yA(){yA=A,tvE=evA()}function yL(){yL=A,tvS=eSH()}function yC(){yC=A,tmF=enF()}function yI(){throw p7(new bO)}function yD(){throw p7(new bO)}function yN(){throw p7(new bO)}function yP(){throw p7(new bO)}function yR(){throw p7(new bO)}function yj(){throw p7(new bO)}function yF(e){this.a=new w9(e)}function yY(e){eF7(),eBh(this,e)}function yB(e){this.a=new FG(e)}function yU(e,t){for(;e.ye(t););}function yH(e,t){for(;e.sd(t););}function y$(e,t){return e.a+=t,e}function yz(e,t){return e.a+=t,e}function yG(e,t){return e.a+=t,e}function yW(e,t){return e.a+=t,e}function yK(e){return B1(e),e.a}function yV(e){return e.b!=e.d.c}function yq(e){return e.l|e.m<<22}function yZ(e,t){return e.d[t.p]}function yX(e,t){return eA6(e,t)}function yJ(e,t,n){e.splice(t,n)}function yQ(e){e.c?eL3(e):eL4(e)}function y1(e){this.a=0,this.b=e}function y0(){this.a=new eAs(e6I)}function y2(){this.b=new eAs(e6T)}function y3(){this.b=new eAs(e6H)}function y4(){this.b=new eAs(e6H)}function y6(){throw p7(new bO)}function y5(){throw p7(new bO)}function y8(){throw p7(new bO)}function y9(){throw p7(new bO)}function y7(){throw p7(new bO)}function we(){throw p7(new bO)}function wt(){throw p7(new bO)}function wn(){throw p7(new bO)}function wr(){throw p7(new bO)}function wi(){throw p7(new bO)}function wa(){throw p7(new bC)}function wo(){throw p7(new bC)}function ws(e){this.a=new wu(e)}function wu(e){erh(this,e,ey0())}function wc(e){return!e||BV(e)}function wl(e){return -1!=tvJ[e]}function wf(){0!=e1Z&&(e1Z=0),e1J=-1}function wd(){null==eUn&&(eUn=[])}function wh(e,t){eTl(H8(e.a),t)}function wp(e,t){eTl(H8(e.a),t)}function wb(e,t){OC.call(this,e,t)}function wm(e,t){wb.call(this,e,t)}function wg(e,t){this.b=e,this.c=t}function wv(e,t){this.b=e,this.a=t}function wy(e,t){this.a=e,this.b=t}function ww(e,t){this.a=e,this.b=t}function w_(e,t){this.a=e,this.b=t}function wE(e,t){this.a=e,this.b=t}function wS(e,t){this.a=e,this.b=t}function wk(e,t){this.a=e,this.b=t}function wx(e,t){this.a=e,this.b=t}function wT(e,t){this.a=e,this.b=t}function wM(e,t){this.b=e,this.a=t}function wO(e,t){this.b=e,this.a=t}function wA(e,t){this.b=e,this.a=t}function wL(e,t){this.b=e,this.a=t}function wC(e,t){this.f=e,this.g=t}function wI(e,t){this.e=e,this.d=t}function wD(e,t){this.g=e,this.i=t}function wN(e,t){this.a=e,this.b=t}function wP(e,t){this.a=e,this.f=t}function wR(e,t){this.b=e,this.c=t}function wj(e,t){this.a=e,this.b=t}function wF(e,t){this.a=e,this.b=t}function wY(e,t){this.a=e,this.b=t}function wB(e){Oq(e.dc()),this.c=e}function wU(e){this.b=Pp(Y8(e),83)}function wH(e){this.a=Pp(Y8(e),83)}function w$(e){this.a=Pp(Y8(e),15)}function wz(e){this.a=Pp(Y8(e),15)}function wG(e){this.b=Pp(Y8(e),47)}function wW(){this.q=new eB4.Date}function wK(){wK=A,e0V=new L}function wV(){wV=A,e2o=new T}function wq(e){return e.f.c+e.g.c}function wZ(e,t){return e.b.Hc(t)}function wX(e,t){return e.b.Ic(t)}function wJ(e,t){return e.b.Qc(t)}function wQ(e,t){return e.b.Hc(t)}function w1(e,t){return e.c.uc(t)}function w0(e,t){return e.a._b(t)}function w2(e,t){return ecX(e.c,t)}function w3(e,t){return F8(e.b,t)}function w4(e,t){return e>t&&t0}function Ei(e,t){return 0>ecd(e,t)}function Ea(e,t){return e.a.get(t)}function Eo(e,t){return t.split(e)}function Es(e,t){return F8(e.e,t)}function Eu(e){return BJ(e),!1}function Ec(e){Gq.call(this,e,21)}function El(e,t){zL.call(this,e,t)}function Ef(e,t){wC.call(this,e,t)}function Ed(e,t){wC.call(this,e,t)}function Eh(e){BT(),IJ.call(this,e)}function Ep(e,t){jA(e,e.length,t)}function Eb(e,t){Yj(e,e.length,t)}function Em(e,t,n){t.ud(e.a.Ge(n))}function Eg(e,t,n){t.we(e.a.Fe(n))}function Ev(e,t,n){t.td(e.a.Kb(n))}function Ey(e,t,n){e.Mb(n)&&t.td(n)}function Ew(e,t,n){e.splice(t,0,n)}function E_(e,t){return Aa(e.e,t)}function EE(e,t){this.d=e,this.e=t}function ES(e,t){this.b=e,this.a=t}function Ek(e,t){this.b=e,this.a=t}function Ex(e,t){this.b=e,this.a=t}function ET(e,t){this.a=e,this.b=t}function EM(e,t){this.a=e,this.b=t}function EO(e,t){this.a=e,this.b=t}function EA(e,t){this.a=e,this.b=t}function EL(e,t){this.a=e,this.b=t}function EC(e,t){this.b=e,this.a=t}function EI(e,t){this.b=e,this.a=t}function ED(e,t){wC.call(this,e,t)}function EN(e,t){wC.call(this,e,t)}function EP(e,t){wC.call(this,e,t)}function ER(e,t){wC.call(this,e,t)}function Ej(e,t){wC.call(this,e,t)}function EF(e,t){wC.call(this,e,t)}function EY(e,t){wC.call(this,e,t)}function EB(e,t){wC.call(this,e,t)}function EU(e,t){wC.call(this,e,t)}function EH(e,t){wC.call(this,e,t)}function E$(e,t){wC.call(this,e,t)}function Ez(e,t){wC.call(this,e,t)}function EG(e,t){wC.call(this,e,t)}function EW(e,t){wC.call(this,e,t)}function EK(e,t){wC.call(this,e,t)}function EV(e,t){wC.call(this,e,t)}function Eq(e,t){wC.call(this,e,t)}function EZ(e,t){wC.call(this,e,t)}function EX(e,t){this.a=e,this.b=t}function EJ(e,t){this.a=e,this.b=t}function EQ(e,t){this.a=e,this.b=t}function E1(e,t){this.a=e,this.b=t}function E0(e,t){this.a=e,this.b=t}function E2(e,t){this.a=e,this.b=t}function E3(e,t){this.a=e,this.b=t}function E4(e,t){this.a=e,this.b=t}function E6(e,t){this.a=e,this.b=t}function E5(e,t){this.b=e,this.a=t}function E8(e,t){this.b=e,this.a=t}function E9(e,t){this.b=e,this.a=t}function E7(e,t){this.b=e,this.a=t}function Se(e,t){this.c=e,this.d=t}function St(e,t){this.e=e,this.d=t}function Sn(e,t){this.a=e,this.b=t}function Sr(e,t){this.b=t,this.c=e}function Si(e,t){wC.call(this,e,t)}function Sa(e,t){wC.call(this,e,t)}function So(e,t){wC.call(this,e,t)}function Ss(e,t){wC.call(this,e,t)}function Su(e,t){wC.call(this,e,t)}function Sc(e,t){wC.call(this,e,t)}function Sl(e,t){wC.call(this,e,t)}function Sf(e,t){wC.call(this,e,t)}function Sd(e,t){wC.call(this,e,t)}function Sh(e,t){wC.call(this,e,t)}function Sp(e,t){wC.call(this,e,t)}function Sb(e,t){wC.call(this,e,t)}function Sm(e,t){wC.call(this,e,t)}function Sg(e,t){wC.call(this,e,t)}function Sv(e,t){wC.call(this,e,t)}function Sy(e,t){wC.call(this,e,t)}function Sw(e,t){wC.call(this,e,t)}function S_(e,t){wC.call(this,e,t)}function SE(e,t){wC.call(this,e,t)}function SS(e,t){wC.call(this,e,t)}function Sk(e,t){wC.call(this,e,t)}function Sx(e,t){wC.call(this,e,t)}function ST(e,t){wC.call(this,e,t)}function SM(e,t){wC.call(this,e,t)}function SO(e,t){wC.call(this,e,t)}function SA(e,t){wC.call(this,e,t)}function SL(e,t){wC.call(this,e,t)}function SC(e,t){wC.call(this,e,t)}function SI(e,t){wC.call(this,e,t)}function SD(e,t){wC.call(this,e,t)}function SN(e,t){wC.call(this,e,t)}function SP(e,t){wC.call(this,e,t)}function SR(e,t){wC.call(this,e,t)}function Sj(e,t){wC.call(this,e,t)}function SF(e,t){this.b=e,this.a=t}function SY(e,t){this.a=e,this.b=t}function SB(e,t){this.a=e,this.b=t}function SU(e,t){this.a=e,this.b=t}function SH(e,t){this.a=e,this.b=t}function S$(e,t){wC.call(this,e,t)}function Sz(e,t){wC.call(this,e,t)}function SG(e,t){this.b=e,this.d=t}function SW(e,t){wC.call(this,e,t)}function SK(e,t){wC.call(this,e,t)}function SV(e,t){this.a=e,this.b=t}function Sq(e,t){this.a=e,this.b=t}function SZ(e,t){wC.call(this,e,t)}function SX(e,t){wC.call(this,e,t)}function SJ(e,t){wC.call(this,e,t)}function SQ(e,t){wC.call(this,e,t)}function S1(e,t){wC.call(this,e,t)}function S0(e,t){wC.call(this,e,t)}function S2(e,t){wC.call(this,e,t)}function S3(e,t){wC.call(this,e,t)}function S4(e,t){wC.call(this,e,t)}function S6(e,t){wC.call(this,e,t)}function S5(e,t){wC.call(this,e,t)}function S8(e,t){wC.call(this,e,t)}function S9(e,t){wC.call(this,e,t)}function S7(e,t){wC.call(this,e,t)}function ke(e,t){wC.call(this,e,t)}function kt(e,t){wC.call(this,e,t)}function kn(e,t){return Aa(e.c,t)}function kr(e,t){return Aa(t.b,e)}function ki(e,t){return-e.b.Je(t)}function ka(e,t){return Aa(e.g,t)}function ko(e,t){wC.call(this,e,t)}function ks(e,t){wC.call(this,e,t)}function ku(e,t){this.a=e,this.b=t}function kc(e,t){this.a=e,this.b=t}function kl(e,t){this.a=e,this.b=t}function kf(e,t){wC.call(this,e,t)}function kd(e,t){wC.call(this,e,t)}function kh(e,t){wC.call(this,e,t)}function kp(e,t){wC.call(this,e,t)}function kb(e,t){wC.call(this,e,t)}function km(e,t){wC.call(this,e,t)}function kg(e,t){wC.call(this,e,t)}function kv(e,t){wC.call(this,e,t)}function ky(e,t){wC.call(this,e,t)}function kw(e,t){wC.call(this,e,t)}function k_(e,t){wC.call(this,e,t)}function kE(e,t){wC.call(this,e,t)}function kS(e,t){wC.call(this,e,t)}function kk(e,t){wC.call(this,e,t)}function kx(e,t){wC.call(this,e,t)}function kT(e,t){wC.call(this,e,t)}function kM(e,t){this.a=e,this.b=t}function kO(e,t){this.a=e,this.b=t}function kA(e,t){this.a=e,this.b=t}function kL(e,t){this.a=e,this.b=t}function kC(e,t){this.a=e,this.b=t}function kI(e,t){this.a=e,this.b=t}function kD(e,t){this.a=e,this.b=t}function kN(e,t){wC.call(this,e,t)}function kP(e,t){this.a=e,this.b=t}function kR(e,t){this.a=e,this.b=t}function kj(e,t){this.a=e,this.b=t}function kF(e,t){this.a=e,this.b=t}function kY(e,t){this.a=e,this.b=t}function kB(e,t){this.a=e,this.b=t}function kU(e,t){this.b=e,this.a=t}function kH(e,t){this.b=e,this.a=t}function k$(e,t){this.b=e,this.a=t}function kz(e,t){this.b=e,this.a=t}function kG(e,t){this.a=e,this.b=t}function kW(e,t){this.a=e,this.b=t}function kK(e,t){eOU(e.a,Pp(t,56))}function kV(e,t){QM(e.a,Pp(t,11))}function kq(e,t){return Pj(),t!=e}function kZ(){return vv(),new e2d}function kX(){Gk(),this.b=new bV}function kJ(){eAV(),this.a=new bV}function kQ(){Gy(),jG.call(this)}function k1(e,t){wC.call(this,e,t)}function k0(e,t){this.a=e,this.b=t}function k2(e,t){this.a=e,this.b=t}function k3(e,t){this.a=e,this.b=t}function k4(e,t){this.a=e,this.b=t}function k6(e,t){this.a=e,this.b=t}function k5(e,t){this.a=e,this.b=t}function k8(e,t){this.d=e,this.b=t}function k9(e,t){this.d=e,this.e=t}function k7(e,t){this.f=e,this.c=t}function xe(e,t){this.b=e,this.c=t}function xt(e,t){this.i=e,this.g=t}function xn(e,t){this.e=e,this.a=t}function xr(e,t){this.a=e,this.b=t}function xi(e,t){e.i=null,erA(e,t)}function xa(e,t){e&&Um(tmR,e,t)}function xo(e,t){return edG(e.a,t)}function xs(e){return edK(e.c,e.b)}function xu(e){return e?e.dd():null}function xc(e){return null==e?null:e}function xl(e){return typeof e===eUi}function xf(e){return typeof e===eUa}function xd(e){return typeof e===eUo}function xh(e,t){return e.Hd().Xb(t)}function xp(e,t){return ei7(e.Kc(),t)}function xb(e,t){return 0==ecd(e,t)}function xm(e,t){return ecd(e,t)>=0}function xg(e,t){return 0!=ecd(e,t)}function xv(e){return""+(BJ(e),e)}function xy(e,t){return e.substr(t)}function xw(e){return efH(e),e.d.gc()}function x_(e){return eTe(e,e.c),e}function xE(e){return Rb(null==e),e}function xS(e,t){return e.a+=""+t,e}function xk(e,t){return e.a+=""+t,e}function xx(e,t){return e.a+=""+t,e}function xT(e,t){return e.a+=""+t,e}function xM(e,t){return e.a+=""+t,e}function xO(e,t){return e.a+=""+t,e}function xA(e,t){qQ(e,t,e.a,e.a.a)}function xL(e,t){qQ(e,t,e.c.b,e.c)}function xC(e,t,n){eyc(t,eSE(e,n))}function xI(e,t,n){eyc(t,eSE(e,n))}function xD(e,t){eeS(new Ow(e),t)}function xN(e,t){e.q.setTime(Kj(t))}function xP(e,t){FH.call(this,e,t)}function xR(e,t){FH.call(this,e,t)}function xj(e,t){FH.call(this,e,t)}function xF(e){Yy(this),eij(this,e)}function xY(e){return GK(e,0),null}function xB(e){return e.a=0,e.b=0,e}function xU(e,t){return e.a=t.g+1,e}function xH(e,t){return 2==e.j[t.p]}function x$(e){return YZ(Pp(e,79))}function xz(){xz=A,e4r=euY(epE())}function xG(){xG=A,e7$=euY(eAn())}function xW(){this.b=new w9(ee0(12))}function xK(){this.b=0,this.a=!1}function xV(){this.b=0,this.a=!1}function xq(e){this.a=e,ci.call(this)}function xZ(e){this.a=e,ci.call(this)}function xX(e,t){Cm.call(this,e,t)}function xJ(e,t){Ii.call(this,e,t)}function xQ(e,t){xt.call(this,e,t)}function x1(e,t){eaN.call(this,e,t)}function x0(e,t){AA.call(this,e,t)}function x2(e,t){_6(),Um(tmU,e,t)}function x3(e,t){return Az(e.a,0,t)}function x4(e,t){return e.a.a.a.cc(t)}function x6(e,t){return xc(e)===xc(t)}function x5(e,t){return elN(e.a,t.a)}function x8(e,t){return ME(e.a,t.a)}function x9(e,t){return YM(e.a,t.a)}function x7(e,t){return e.indexOf(t)}function Te(e,t){return e==t?0:e?1:-1}function Tt(e){return e<10?"0"+e:""+e}function Tn(e){return Y8(e),new xq(e)}function Tr(e){return Mk(e.l,e.m,e.h)}function Ti(e){return zy((BJ(e),e))}function Ta(e){return zy((BJ(e),e))}function To(e,t){return ME(e.g,t.g)}function Ts(e){return typeof e===eUa}function Tu(e){return e==e9f||e==e9p}function Tc(e){return e==e9f||e==e9d}function Tl(e){return QI(e.b.b,e,0)}function Tf(e){this.a=kZ(),this.b=e}function Td(e){this.a=kZ(),this.b=e}function Th(e,t){return P_(e.a,t),t}function Tp(e,t){return P_(e.c,t),e}function Tb(e,t){return eat(e.a,t),e}function Tm(e,t){return Dj(),t.a+=e}function Tg(e,t){return Dj(),t.a+=e}function Tv(e,t){return Dj(),t.c+=e}function Ty(e,t){Qe(e,0,e.length,t)}function Tw(){fJ.call(this,new qh)}function T_(){jp.call(this,0,0,0,0)}function TE(){Hr.call(this,0,0,0,0)}function TS(e){this.a=e.a,this.b=e.b}function Tk(e){return e==tpm||e==tpg}function Tx(e){return e==tpy||e==tpb}function TT(e){return e==tss||e==tso}function TM(e){return e!=tbc&&e!=tbl}function TO(e){return e.Lg()&&e.Mg()}function TA(e){return UB(Pp(e,118))}function TL(e){return eat(new K2,e)}function TC(e,t){return new eaN(t,e)}function TI(e,t){return new eaN(t,e)}function TD(e,t,n){ent(e,t),enn(e,n)}function TN(e,t,n){ena(e,t),eni(e,n)}function TP(e,t,n){eno(e,t),ens(e,n)}function TR(e,t,n){enr(e,t),enc(e,n)}function Tj(e,t,n){enu(e,t),enl(e,n)}function TF(e,t){euc(e,t),enp(e,e.D)}function TY(e){k7.call(this,e,!0)}function TB(e,t,n){L3.call(this,e,t,n)}function TU(e){eLQ(),ead.call(this,e)}function TH(){Ef.call(this,"Head",1)}function T$(){Ef.call(this,"Tail",3)}function Tz(e){e.c=Je(e1R,eUp,1,0,5,1)}function TG(e){e.a=Je(e1R,eUp,1,8,5,1)}function TW(e){ety(e.xf(),new dh(e))}function TK(e){return null!=e?esj(e):0}function TV(e,t){return etg(t,zY(e))}function Tq(e,t){return etg(t,zY(e))}function TZ(e,t){return e[e.length]=t}function TX(e,t){return e[e.length]=t}function TJ(e){return Ph(e.b.Kc(),e.a)}function TQ(e,t){return erb(Bi(e.d),t)}function T1(e,t){return erb(Bi(e.g),t)}function T0(e,t){return erb(Bi(e.j),t)}function T2(e,t){Cm.call(this,e.b,t)}function T3(e){jp.call(this,e,e,e,e)}function T4(e){return e.b&&ePE(e),e.a}function T6(e){return e.b&&ePE(e),e.c}function T5(e,t){!e2M&&(e.b=t)}function T8(e,t,n){return Bc(e,t,n),n}function T9(e,t,n){Bc(e.c[t.g],t.g,n)}function T7(e,t,n){Pp(e.c,69).Xh(t,n)}function Me(e,t,n){TP(n,n.i+e,n.j+t)}function Mt(e,t){JL(qt(e.a),Gj(t))}function Mn(e,t){JL(QX(e.a),GF(t))}function Mr(e){eBG(),pJ.call(this,e)}function Mi(e){return null==e?0:esj(e)}function Ma(){Ma=A,tuT=new efY(e68)}function Mo(){Mo=A,new Ms,new p0}function Ms(){new p2,new p2,new p2}function Mu(){Mu=A,bR(),e0S=new p2}function Mc(){Mc=A,eB4.Math.log(2)}function Ml(){Ml=A,tgZ=(_Z(),tmE)}function Mf(){throw p7(new gW(e1O))}function Md(){throw p7(new gW(e1O))}function Mh(){throw p7(new gW(e1A))}function Mp(){throw p7(new gW(e1A))}function Mb(e){this.a=e,PS.call(this,e)}function Mm(e){this.a=e,wU.call(this,e)}function Mg(e){this.a=e,wU.call(this,e)}function Mv(e,t){jM(e.c,e.c.length,t)}function My(e){return e.at?1:0}function MS(e,t){return ecd(e,t)>0?e:t}function Mk(e,t,n){return{l:e,m:t,h:n}}function Mx(e,t){null!=e.a&&kV(t,e.a)}function MT(e){e.a=new C,e.c=new C}function MM(e){this.b=e,this.a=new p0}function MO(e){this.b=new e1,this.a=e}function MA(e){CW.call(this),this.a=e}function ML(){Ef.call(this,"Range",2)}function MC(){evR(),this.a=new eAs(e4k)}function MI(e,t){Y8(t),Uz(e).Jc(new d)}function MD(e,t){return GE(),t.n.b+=e}function MN(e,t,n){return Um(e.g,n,t)}function MP(e,t,n){return Um(e.k,n,t)}function MR(e,t){return Um(e.a,t.a,t)}function Mj(e,t,n){return eho(t,n,e.c)}function MF(e){return new kl(e.c,e.d)}function MY(e){return new kl(e.c,e.d)}function MB(e){return new kl(e.a,e.b)}function MU(e,t){return ej9(e.a,t,null)}function MH(e){Gs(e,null),Go(e,null)}function M$(e){GA(e,null),GL(e,null)}function Mz(){AA.call(this,null,null)}function MG(){AL.call(this,null,null)}function MW(e){this.a=e,p2.call(this)}function MK(e){this.b=(Hj(),new f$(e))}function MV(e){e.j=Je(e19,eUP,310,0,0,1)}function Mq(e,t,n){e.c.Vc(t,Pp(n,133))}function MZ(e,t,n){e.c.ji(t,Pp(n,133))}function MX(e,t){eRT(e),e.Gc(Pp(t,15))}function MJ(e,t){return eR4(e.c,e.b,t)}function MQ(e,t){return new O5(e.Kc(),t)}function M1(e,t){return -1!=eoD(e.Kc(),t)}function M0(e,t){return null!=e.a.Bc(t)}function M2(e){return e.Ob()?e.Pb():null}function M3(e){return ehv(e,0,e.length)}function M4(e,t){return null!=e&&ebs(e,t)}function M6(e,t){e.q.setHours(t),eNq(e,t)}function M5(e,t){e.c&&(Re(t),zd(t))}function M8(e,t,n){Pp(e.Kb(n),164).Nb(t)}function M9(e,t,n){return ejq(e,t,n),n}function M7(e,t,n){e.a=1502^t,e.b=n^e$d}function Oe(e,t,n){return e.a[t.g][n.g]}function Ot(e,t){return e.a[t.c.p][t.p]}function On(e,t){return e.e[t.c.p][t.p]}function Or(e,t){return e.c[t.c.p][t.p]}function Oi(e,t){return e.j[t.p]=eOo(t)}function Oa(e,t){return ZZ(e.f,t.tg())}function Oo(e,t){return ZZ(e.b,t.tg())}function Os(e,t){return e.a0?t*t/e:t*t*100}function Li(e,t){return e>0?t/(e*e):100*t}function La(e,t,n){return P_(t,ef6(e,n))}function Lo(e,t,n){J1(),e.Xe(t)&&n.td(e)}function Ls(e,t,n){var r;(r=e.Zc(t)).Rb(n)}function Lu(e,t,n){return e.a+=t,e.b+=n,e}function Lc(e,t,n){return e.a*=t,e.b*=n,e}function Ll(e,t,n){return e.a-=t,e.b-=n,e}function Lf(e,t){return e.a=t.a,e.b=t.b,e}function Ld(e){return e.a=-e.a,e.b=-e.b,e}function Lh(e){this.c=e,this.a=1,this.b=1}function Lp(e){this.c=e,eno(e,0),ens(e,0)}function Lb(e){_n.call(this),enD(this,e)}function Lm(e){eBp(),p9(this),this.mf(e)}function Lg(e,t){_0(),AA.call(this,e,t)}function Lv(e,t){_2(),AL.call(this,e,t)}function Ly(e,t){_2(),AL.call(this,e,t)}function Lw(e,t){_2(),Lv.call(this,e,t)}function L_(e,t,n){JY.call(this,e,t,n,2)}function LE(e,t){Ml(),jd.call(this,e,t)}function LS(e,t){Ml(),LE.call(this,e,t)}function Lk(e,t){Ml(),LE.call(this,e,t)}function Lx(e,t){Ml(),Lk.call(this,e,t)}function LT(e,t){Ml(),jd.call(this,e,t)}function LM(e,t){Ml(),LT.call(this,e,t)}function LO(e,t){Ml(),jd.call(this,e,t)}function LA(e,t){return e.c.Fc(Pp(t,133))}function LL(e,t,n){return eP8(Qq(e,t),n)}function LC(e,t,n){return t.Qk(e.e,e.c,n)}function LI(e,t,n){return t.Rk(e.e,e.c,n)}function LD(e,t){return ecv(e.e,Pp(t,49))}function LN(e,t,n){elm(QX(e.a),t,GF(n))}function LP(e,t,n){elm(qt(e.a),t,Gj(n))}function LR(e,t){t.$modCount=e.$modCount}function Lj(){Lj=A,tcV=new pO("root")}function LF(){LF=A,tmB=new mx,new mT}function LY(){this.a=new zu,this.b=new zu}function LB(){en0.call(this),this.Bb|=eH3}function LU(){wC.call(this,"GROW_TREE",0)}function LH(e){return null==e?null:eYt(e)}function L$(e){return null==e?null:eEO(e)}function Lz(e){return null==e?null:efF(e)}function LG(e){return null==e?null:efF(e)}function LW(e){null==e.o&&eMb(e)}function LK(e){return Rb(null==e||xl(e)),e}function LV(e){return Rb(null==e||xf(e)),e}function Lq(e){return Rb(null==e||xd(e)),e}function LZ(e){this.q=new eB4.Date(Kj(e))}function LX(e,t){this.c=e,wI.call(this,e,t)}function LJ(e,t){this.a=e,LX.call(this,e,t)}function LQ(e,t){this.d=e,f_(this),this.b=t}function L1(e,t){Jo.call(this,e),this.a=t}function L0(e,t){Jo.call(this,e),this.a=t}function L2(e){edL.call(this,0,0),this.f=e}function L3(e,t,n){XS.call(this,e,t,n,null)}function L4(e,t,n){XS.call(this,e,t,n,null)}function L6(e,t,n){return 0>=e.ue(t,n)?n:t}function L5(e,t,n){return 0>=e.ue(t,n)?t:n}function L8(e,t){return Pp(eef(e.b,t),149)}function L9(e,t){return Pp(eef(e.c,t),229)}function L7(e){return Pp(RJ(e.a,e.b),287)}function Ce(e){return new kl(e.c,e.d+e.a)}function Ct(e){return GE(),TT(Pp(e,197))}function Cn(){Cn=A,e4i=el8((ed5(),tbq))}function Cr(e,t){t.a?eLc(e,t):Ai(e.a,t.b)}function Ci(e,t){!e2M&&P_(e.a,t)}function Ca(e,t){return _k(),eag(t.d.i,e)}function Co(e,t){return erJ(),new eIu(t,e)}function Cs(e,t){return $C(t,ezr),e.f=t,e}function Cu(e,t,n){return n=eDg(e,t,3,n)}function Cc(e,t,n){return n=eDg(e,t,6,n)}function Cl(e,t,n){return n=eDg(e,t,9,n)}function Cf(e,t,n){++e.j,e.Ki(),X9(e,t,n)}function Cd(e,t,n){++e.j,e.Hi(t,e.oi(t,n))}function Ch(e,t,n){var r;(r=e.Zc(t)).Rb(n)}function Cp(e,t,n){return ePT(e.c,e.b,t,n)}function Cb(e,t){return(t&eUu)%e.d.length}function Cm(e,t){pO.call(this,e),this.a=t}function Cg(e,t){pH.call(this,e),this.a=t}function Cv(e,t){pH.call(this,e),this.a=t}function Cy(e,t){this.c=e,eta.call(this,t)}function Cw(e,t){this.a=e,pU.call(this,t)}function C_(e,t){this.a=e,pU.call(this,t)}function CE(e){this.a=(enG(e,eU3),new XM(e))}function CS(e){this.a=(enG(e,eU3),new XM(e))}function Ck(e){return e.a||(e.a=new h),e.a}function Cx(e){return e>8?0:e+1}function CT(e,t){return OQ(),e==t?0:e?1:-1}function CM(e,t,n){return jT(e,Pp(t,22),n)}function CO(e,t,n){return e.apply(t,n)}function CA(e,t,n){return e.a+=ehv(t,0,n),e}function CL(e,t){var n;return n=e.e,e.e=t,n}function CC(e,t){var n;(n=e[e$c]).call(e,t)}function CI(e,t){var n;(n=e[e$c]).call(e,t)}function CD(e,t){e.a.Vc(e.b,t),++e.b,e.c=-1}function CN(e){Yy(e.e),e.d.b=e.d,e.d.a=e.d}function CP(e){e.b?CP(e.b):e.f.c.zc(e.e,e.d)}function CR(e,t,n){_w(),lP(e,t.Ce(e.a,n))}function Cj(e,t){return y_(ehn(e.a,t,!0))}function CF(e,t){return y_(ehr(e.a,t,!0))}function CY(e,t){return vk(Array(t),e)}function CB(e){return String.fromCharCode(e)}function CU(e){return null==e?null:e.message}function CH(){this.a=new p0,this.b=new p0}function C$(){this.a=new tt,this.b=new bP}function Cz(){this.b=new yb,this.c=new p0}function CG(){this.d=new yb,this.e=new yb}function CW(){this.n=new yb,this.o=new yb}function CK(){this.n=new mp,this.i=new TE}function CV(){this.a=new cg,this.b=new i_}function Cq(){this.a=new p0,this.d=new p0}function CZ(){this.b=new bV,this.a=new bV}function CX(){this.b=new p2,this.a=new p2}function CJ(){this.b=new y2,this.a=new ay}function CQ(){CK.call(this),this.a=new yb}function C1(e){eaD.call(this,e,(Qu(),e2D))}function C0(e,t,n,r){jp.call(this,e,t,n,r)}function C2(e,t,n){null!=n&&ern(t,emI(e,n))}function C3(e,t,n){null!=n&&err(t,emI(e,n))}function C4(e,t,n){return n=eDg(e,t,11,n)}function C6(e,t){return e.a+=t.a,e.b+=t.b,e}function C5(e,t){return e.a-=t.a,e.b-=t.b,e}function C8(e,t){return e.n.a=(BJ(t),t+10)}function C9(e,t){return e.n.a=(BJ(t),t+10)}function C7(e,t){return t==e||ev8(eOg(t),e)}function Ie(e,t){return null==Um(e.a,t,"")}function It(e,t){return _k(),!eag(t.d.i,e)}function In(e,t){Tk(e.f)?eMi(e,t):ewz(e,t)}function Ir(e,t){var n;return t.Hh(e.a)}function Ii(e,t){gE.call(this,eJT+e+eXH+t)}function Ia(e,t,n,r){FQ.call(this,e,t,n,r)}function Io(e,t,n,r){FQ.call(this,e,t,n,r)}function Is(e,t,n,r){Io.call(this,e,t,n,r)}function Iu(e,t,n,r){F1.call(this,e,t,n,r)}function Ic(e,t,n,r){F1.call(this,e,t,n,r)}function Il(e,t,n,r){F1.call(this,e,t,n,r)}function If(e,t,n,r){Ic.call(this,e,t,n,r)}function Id(e,t,n,r){Ic.call(this,e,t,n,r)}function Ih(e,t,n,r){Il.call(this,e,t,n,r)}function Ip(e,t,n,r){Id.call(this,e,t,n,r)}function Ib(e,t,n,r){FZ.call(this,e,t,n,r)}function Im(e,t,n){this.a=e,AI.call(this,t,n)}function Ig(e,t,n){this.c=t,this.b=n,this.a=e}function Iv(e,t,n){return e.d=Pp(t.Kb(n),164)}function Iy(e,t){return e.Aj().Nh().Kh(e,t)}function Iw(e,t){return e.Aj().Nh().Ih(e,t)}function I_(e,t){return BJ(e),xc(e)===xc(t)}function IE(e,t){return BJ(e),xc(e)===xc(t)}function IS(e,t){return y_(ehn(e.a,t,!1))}function Ik(e,t){return y_(ehr(e.a,t,!1))}function Ix(e,t){return e.b.sd(new EM(e,t))}function IT(e,t){return e.b.sd(new EO(e,t))}function IM(e,t){return e.b.sd(new EA(e,t))}function IO(e,t,n){return e.lastIndexOf(t,n)}function IA(e,t,n){return elN(e[t.b],e[n.b])}function IL(e,t){return eo3(t,(eBy(),tat),e)}function IC(e,t){return ME(t.a.d.p,e.a.d.p)}function II(e,t){return ME(e.a.d.p,t.a.d.p)}function ID(e,t){return elN(e.c-e.s,t.c-t.s)}function IN(e){return e.c?QI(e.c.a,e,0):-1}function IP(e){return e<100?null:new yf(e)}function IR(e){return e==tba||e==tbs||e==tbo}function Ij(e,t){return M4(t,15)&&eCc(e.c,t)}function IF(e,t){!e2M&&t&&(e.d=t)}function IY(e,t){var n;return!!esq(e,n=t)}function IB(e,t){this.c=e,YC.call(this,e,t)}function IU(e){this.c=e,xj.call(this,eUY,0)}function IH(e,t){Px.call(this,e,e.length,t)}function I$(e,t,n){return Pp(e.c,69).lk(t,n)}function Iz(e,t,n){return Pp(e.c,69).mk(t,n)}function IG(e,t,n){return LC(e,Pp(t,332),n)}function IW(e,t,n){return LI(e,Pp(t,332),n)}function IK(e,t,n){return ey1(e,Pp(t,332),n)}function IV(e,t,n){return e_t(e,Pp(t,332),n)}function Iq(e,t){return null==t?null:ecA(e.b,t)}function IZ(e){return xf(e)?(BJ(e),e):e.ke()}function IX(e){return!isNaN(e)&&!isFinite(e)}function IJ(e){Dn(),this.a=(Hj(),new vd(e))}function IQ(e){Pj(),this.d=e,this.a=new p1}function I1(e,t,n){this.a=e,this.b=t,this.c=n}function I0(e,t,n){this.a=e,this.b=t,this.c=n}function I2(e,t,n){this.d=e,this.b=n,this.a=t}function I3(e){MT(this),HC(this),er7(this,e)}function I4(e){Tz(this),PO(this.c,0,e.Pc())}function I6(e){BH(e.a),Jl(e.c,e.b),e.b=null}function I5(e){this.a=e,wK(),eap(Date.now())}function I8(){I8=A,e2G=new r,e2W=new r}function I9(){I9=A,e2h=new I,e2p=new D}function I7(){I7=A,tmY=Je(e1R,eUp,1,0,5,1)}function De(){De=A,tgH=Je(e1R,eUp,1,0,5,1)}function Dt(){Dt=A,tg$=Je(e1R,eUp,1,0,5,1)}function Dn(){Dn=A,new bb((Hj(),Hj(),e2r))}function Dr(e){return Qu(),eeM((Qc(),e2j),e)}function Di(e){return eum(),eeM((XC(),e2$),e)}function Da(e){return epC(),eeM((qk(),e3d),e)}function Do(e){return eeR(),eeM((qx(),e3b),e)}function Ds(e){return eCp(),eeM((eaF(),e3I),e)}function Du(e){return etx(),eeM((XO(),e3R),e)}function Dc(e){return Qs(),eeM((XA(),e3B),e)}function Dl(e){return QQ(),eeM((XL(),e3z),e)}function Df(e){return eBW(),eeM((xz(),e4r),e)}function Dd(e){return eaY(),eeM((Qf(),e4l),e)}function Dh(e){return ep7(),eeM((Qd(),e4b),e)}function Dp(e){return ebe(),eeM((Qh(),e5z),e)}function Db(e){return _y(),eeM((Vt(),e5W),e)}function Dm(e){return eej(),eeM((qT(),e8h),e)}function Dg(e){return QJ(),eeM((XI(),e85),e)}function Dv(e){return e_x(),eeM((eeW(),e9a),e)}function Dy(e){return eok(),eeM((Ql(),e9b),e)}function Dw(e){return ec4(),eeM((XD(),e9T),e)}function D_(e,t){if(!e)throw p7(new gL(t))}function DE(e){return eEn(),eeM((etQ(),e9R),e)}function DS(e){jp.call(this,e.d,e.c,e.a,e.b)}function Dk(e){jp.call(this,e.d,e.c,e.a,e.b)}function Dx(e,t,n){this.b=e,this.c=t,this.a=n}function DT(e,t,n){this.b=e,this.a=t,this.c=n}function DM(e,t,n){this.a=e,this.b=t,this.c=n}function DO(e,t,n){this.a=e,this.b=t,this.c=n}function DA(e,t,n){this.a=e,this.b=t,this.c=n}function DL(e,t,n){this.a=e,this.b=t,this.c=n}function DC(e,t,n){this.b=e,this.a=t,this.c=n}function DI(e,t,n){this.e=t,this.b=e,this.d=n}function DD(e,t,n){return _w(),e.a.Od(t,n),t}function DN(e){var t;return(t=new ew).e=e,t}function DP(e){var t;return(t=new me).b=e,t}function DR(){DR=A,e9V=new nd,e9q=new nh}function Dj(){Dj=A,e76=new rB,e75=new rU}function DF(e){return eoE(),eeM((Qb(),e7X),e)}function DY(e){return eoS(),eeM((Qg(),tet),e)}function DB(e){return eLz(),eeM((ei3(),tek),e)}function DU(e){return eSg(),eeM((et2(),teI),e)}function DH(e){return Jp(),eeM((qI(),teP),e)}function D$(e){return en7(),eeM((XN(),teY),e)}function Dz(e){return ey4(),eeM((eeU(),tes),e)}function DG(e){return erX(),eeM((Xj(),teb),e)}function DW(e){return enB(),eeM((XP(),te$),e)}function DK(e){return eb5(),eeM((eeY(),teq),e)}function DV(e){return eeF(),eeM((qO(),teJ),e)}function Dq(e){return eoG(),eeM((XR(),te2),e)}function DZ(e){return eEf(),eeM((et5(),te7),e)}function DX(e){return Qx(),eeM((qA(),ttn),e)}function DJ(e){return eyd(),eeM((et4(),ttc),e)}function DQ(e){return e_3(),eeM((et3(),ttm),e)}function D1(e){return eLR(),eeM((eoH(),ttM),e)}function D0(e){return eaU(),eeM((XY(),ttC),e)}function D2(e){return Q1(),eeM((XF(),ttP),e)}function D3(e){return K5(),eeM((qD(),ttF),e)}function D4(e){return ef_(),eeM((eeH(),tnF),e)}function D6(e){return ewY(),eeM((et6(),tst),e)}function D5(e){return euJ(),eeM((XB(),tsa),e)}function D8(e){return ebk(),eeM((Qv(),tsl),e)}function D9(e){return enY(),eeM((X$(),tsR),e)}function D7(e){return eOJ(),eeM((ei2(),tsx),e)}function Ne(e){return esn(),eeM((XH(),tsA),e)}function Nt(e){return Q0(),eeM((qC(),tsI),e)}function Nn(e){return ei0(),eeM((XU(),tsB),e)}function Nr(e){return ebG(),eeM((eeB(),tsm),e)}function Ni(e){return Xo(),eeM((qL(),ts$),e)}function Na(e){return euy(),eeM((XG(),tsK),e)}function No(e){return eiO(),eeM((XW(),tsX),e)}function Ns(e){return eox(),eeM((Xz(),ts0),e)}function Nu(e){return enU(),eeM((XK(),tuo),e)}function Nc(e){return qG(),eeM((qP(),tud),e)}function Nl(e){return zs(),eeM((qR(),tu_),e)}function Nf(e){return zQ(),eeM((qj(),tuk),e)}function Nd(e){return Xa(),eeM((qN(),tu$),e)}function Nh(e){return zo(),eeM((qF(),tuX),e)}function Np(e){return egR(),eeM((Qp(),tu2),e)}function Nb(e){return eS_(),eeM((et8(),tu7),e)}function Nm(e){return z1(),eeM((qU(),tcB),e)}function Ng(e){return erZ(),eeM((qB(),tcX),e)}function Nv(e){return Kn(),eeM((qY(),tc$),e)}function Ny(e){return efx(),eeM((XV(),tc0),e)}function Nw(e){return J0(),eeM((qH(),tc4),e)}function N_(e){return eub(),eeM((Xq(),tc9),e)}function NE(e){return emC(),eeM((Qm(),tlA),e)}function NS(e){return ei1(),eeM((XX(),tlD),e)}function Nk(e){return efS(),eeM((XZ(),tlj),e)}function Nx(e){return eOB(),eeM((eeG(),tfl),e)}function NT(e){return efk(),eeM((XJ(),tfp),e)}function NM(e){return _D(),eeM((K7(),tfm),e)}function NO(e){return _N(),eeM((K9(),tfv),e)}function NA(e){return Xs(),eeM((qz(),tf_),e)}function NL(e){return eEM(),eeM((ee$(),tfM),e)}function NC(e){return _P(),eeM((Ve(),tf7),e)}function NI(e){return eoT(),eeM((q$(),tdn),e)}function ND(e){return epx(),eeM((eez(),tdb),e)}function NN(e){return eSd(),eeM((ei4(),tdk),e)}function NP(e){return ebx(),eeM((et0(),tdD),e)}function NR(e){return eyY(),eeM((et1(),tdJ),e)}function Nj(e){return eB$(),eeM((xG(),e7$),e)}function NF(e){return erq(),eeM((qM(),e9K),e)}function NY(e){return ec3(),eeM((eeK(),tpw),e)}function NB(e){return etT(),eeM((X1(),tpk),e)}function NU(e){return efE(),eeM((Q_(),tpA),e)}function NH(e){return e_a(),eeM((et7(),tpR),e)}function N$(e){return eck(),eeM((XQ(),tpK),e)}function Nz(e){return egF(),eeM((Qw(),tpJ),e)}function NG(e){return eT7(),eeM((eaj(),tp9),e)}function NW(e){return epT(),eeM((eeV(),tbi),e)}function NK(e){return ewf(),eeM((etC(),tbf),e)}function NV(e){return ekU(),eeM((et9(),tbv),e)}function Nq(e){return ed5(),eeM((QS(),tbZ),e)}function NZ(e){return eI3(),eeM((eo$(),tb5),e)}function NX(e){return eYu(),eeM((eeq(),tbB),e)}function NJ(e){return edM(),eeM((QE(),tmt),e)}function NQ(e){return eup(),eeM((Qy(),tmo),e)}function N1(e){return eTy(),eeM((ei6(),tmP),e)}function N0(e,t){return BJ(e),e+(BJ(t),t)}function N2(e,t){return wK(),JL(H8(e.a),t)}function N3(e,t){return wK(),JL(H8(e.a),t)}function N4(e,t){this.c=e,this.a=t,this.b=t-e}function N6(e,t,n){this.a=e,this.b=t,this.c=n}function N5(e,t,n){this.a=e,this.b=t,this.c=n}function N8(e,t,n){this.a=e,this.b=t,this.c=n}function N9(e,t,n){this.a=e,this.b=t,this.c=n}function N7(e,t,n){this.a=e,this.b=t,this.c=n}function Pe(e,t,n){this.e=e,this.a=t,this.c=n}function Pt(e,t,n){Ml(),zl.call(this,e,t,n)}function Pn(e,t,n){Ml(),BP.call(this,e,t,n)}function Pr(e,t,n){Ml(),BP.call(this,e,t,n)}function Pi(e,t,n){Ml(),BP.call(this,e,t,n)}function Pa(e,t,n){Ml(),Pn.call(this,e,t,n)}function Po(e,t,n){Ml(),Pn.call(this,e,t,n)}function Ps(e,t,n){Ml(),Po.call(this,e,t,n)}function Pu(e,t,n){Ml(),Pr.call(this,e,t,n)}function Pc(e,t,n){Ml(),Pi.call(this,e,t,n)}function Pl(e,t){return Y8(e),Y8(t),new wx(e,t)}function Pf(e,t){return Y8(e),Y8(t),new Rn(e,t)}function Pd(e,t){return Y8(e),Y8(t),new Rr(e,t)}function Ph(e,t){return Y8(e),Y8(t),new wM(e,t)}function Pp(e,t){return Rb(null==e||ebs(e,t)),e}function Pb(e){var t;return t=new p0,eel(t,e),t}function Pm(e){var t;return t=new bV,eel(t,e),t}function Pg(e){var t;return ein(t=new b2,e),t}function Pv(e){var t;return ein(t=new _n,e),t}function Py(e){return e.e||(e.e=new p0),e.e}function Pw(e){return e.c||(e.c=new sk),e.c}function P_(e,t){return e.c[e.c.length]=t,!0}function PE(e,t){this.c=e,this.b=t,this.a=!1}function PS(e){this.d=e,f_(this),this.b=Ft(e.d)}function Pk(){this.a=";,;",this.b="",this.c=""}function Px(e,t,n){F$.call(this,t,n),this.a=e}function PT(e,t,n){this.b=e,xP.call(this,t,n)}function PM(e,t,n){this.c=e,EE.call(this,t,n)}function PO(e,t,n){ekp(n,0,e,t,n.length,!1)}function PA(e,t,n,r,i){e.b=t,e.c=n,e.d=r,e.a=i}function PL(e,t){t&&(e.b=t,e.a=(B1(t),t.a))}function PC(e,t,n,r,i){e.d=t,e.c=n,e.a=r,e.b=i}function PI(e){var t,n;t=e.b,n=e.c,e.b=n,e.c=t}function PD(e){var t,n;n=e.d,t=e.a,e.d=t,e.a=n}function PN(e){return eal(YE(Ts(e)?eaL(e):e))}function PP(e,t){return ME(Rx(e.d),Rx(t.d))}function PR(e,t){return t==(eYu(),tbY)?e.c:e.d}function Pj(){Pj=A,tuu=(eYu(),tbY),tuc=tby}function PF(){this.b=gP(LV(epB((eCk(),e8N))))}function PY(e){return _w(),Je(e1R,eUp,1,e,5,1)}function PB(e){return new kl(e.c+e.b,e.d+e.a)}function PU(e,t){return _C(),ME(e.d.p,t.d.p)}function PH(e){return A5(0!=e.b),etw(e,e.a.a)}function P$(e){return A5(0!=e.b),etw(e,e.c.b)}function Pz(e,t){if(!e)throw p7(new gS(t))}function PG(e,t){if(!e)throw p7(new gL(t))}function PW(e,t,n){Se.call(this,e,t),this.b=n}function PK(e,t,n){k9.call(this,e,t),this.c=n}function PV(e,t,n){etn.call(this,t,n),this.d=e}function Pq(e){Dt(),sr.call(this),this.th(e)}function PZ(e,t,n){this.a=e,xQ.call(this,t,n)}function PX(e,t,n){this.a=e,xQ.call(this,t,n)}function PJ(e,t,n){k9.call(this,e,t),this.c=n}function PQ(){ZE(),BY.call(this,(_Q(),tgp))}function P1(e){return null!=e&&!efz(e,tm1,tm0)}function P0(e,t){return(elt(e)<<4|elt(t))&eHd}function P2(e,t){return U_(),eb2(e,t),new Uf(e,t)}function P3(e,t){var n;e.n&&(n=t,P_(e.f,n))}function P4(e,t,n){var r;ee3(e,t,r=new B_(n))}function P6(e,t){var n;return n=e.c,ers(e,t),n}function P5(e,t){return t<0?e.g=-1:e.g=t,e}function P8(e,t){return etN(e),e.a*=t,e.b*=t,e}function P9(e,t,n,r,i){e.c=t,e.d=n,e.b=r,e.a=i}function P7(e,t){return qQ(e,t,e.c.b,e.c),!0}function Re(e){e.a.b=e.b,e.b.a=e.a,e.a=e.b=null}function Rt(e){this.b=e,this.a=Fc(this.b.a).Ed()}function Rn(e,t){this.b=e,this.a=t,ci.call(this)}function Rr(e,t){this.a=e,this.b=t,ci.call(this)}function Ri(e,t){F$.call(this,t,1040),this.a=e}function Ra(e){return 0==e||isNaN(e)?e:e<0?-1:1}function Ro(e){return HR(),e_I(e)==z$(e_P(e))}function Rs(e){return HR(),e_P(e)==z$(e_I(e))}function Ru(e,t){return eyE(e,new Se(t.a,t.b))}function Rc(e){return!q9(e)&&e.c.i.c==e.d.i.c}function Rl(e){var t;return t=e.n,e.a.b+t.d+t.a}function Rf(e){var t;return t=e.n,e.e.b+t.d+t.a}function Rd(e){var t;return t=e.n,e.e.a+t.b+t.c}function Rh(e){return eBG(),++tyv,new jb(0,e)}function Rp(e){return e.a?e.a:Hh(e)}function Rb(e){if(!e)throw p7(new gA(null))}function Rm(){Rm=A,tvm=(Hj(),new fB(eQU))}function Rg(){Rg=A,new ebw((m2(),e0d),(m3(),e0f))}function Rv(){Rv=A,e0B=Je(e16,eUP,19,256,0,1)}function Ry(e,t,n,r){ef3.call(this,e,t,n,r,0,0)}function Rw(e,t,n){return Um(e.b,Pp(n.b,17),t)}function R_(e,t,n){return Um(e.b,Pp(n.b,17),t)}function RE(e,t){return P_(e,new kl(t.a,t.b))}function RS(e,t){return e.c=t)throw p7(new bj)}function FR(e,t,n){return Bc(t,0,R6(t[0],n[0])),t}function Fj(e,t,n){t.Ye(n,gP(LV(Bp(e.b,n)))*e.a)}function FF(e,t,n){return eLG(),eiq(e,t)&&eiq(e,n)}function FY(e){return ekU(),!e.Hc(tbp)&&!e.Hc(tbm)}function FB(e){return new kl(e.c+e.b/2,e.d+e.a/2)}function FU(e,t){return t.kh()?ecv(e.b,Pp(t,49)):t}function FH(e,t){this.e=e,this.d=(64&t)!=0?t|eUR:t}function F$(e,t){this.c=0,this.d=e,this.b=64|t|eUR}function Fz(e){this.b=new XM(11),this.a=(HF(),e)}function FG(e){this.b=null,this.a=(HF(),e||e2s)}function FW(e){this.a=ebb(e.a),this.b=new I4(e.b)}function FK(e){this.b=e,AF.call(this,e),Op(this)}function FV(e){this.b=e,AB.call(this,e),Ob(this)}function Fq(e,t,n){this.a=e,Ia.call(this,t,n,5,6)}function FZ(e,t,n,r){this.b=e,O_.call(this,t,n,r)}function FX(e,t,n,r,i){JB.call(this,e,t,n,r,i,-1)}function FJ(e,t,n,r,i){JU.call(this,e,t,n,r,i,-1)}function FQ(e,t,n,r){O_.call(this,e,t,n),this.b=r}function F1(e,t,n,r){PK.call(this,e,t,n),this.b=r}function F0(e){k7.call(this,e,!1),this.a=!1}function F2(e,t){this.b=e,lm.call(this,e.b),this.a=t}function F3(e,t){Bx(),wj.call(this,e,ecT(new g$(t)))}function F4(e,t){return eBG(),++tyv,new BR(e,t,0)}function F6(e,t){return eBG(),++tyv,new BR(6,e,t)}function F5(e,t){return IE(e.substr(0,t.length),t)}function F8(e,t){return xd(t)?$r(e,t):!!$I(e.f,t)}function F9(e,t){for(BJ(t);e.Ob();)t.td(e.Pb())}function F7(e,t,n){eLQ(),this.e=e,this.d=t,this.a=n}function Ye(e,t,n,r){var i;(i=e.i).i=t,i.a=n,i.b=r}function Yt(e){var t;for(t=e;t.f;)t=t.f;return t}function Yn(e){var t;return A5(null!=(t=eso(e))),t}function Yr(e){var t;return A5(null!=(t=elT(e))),t}function Yi(e,t){var n;return ZQ(t,n=e.a.gc()),n-t}function Ya(e,t){var n;for(n=0;n0?eB4.Math.log(e/t):-100}function YM(e,t){return 0>ecd(e,t)?-1:ecd(e,t)>0?1:0}function YO(e,t,n){return ePQ(e,Pp(t,46),Pp(n,167))}function YA(e,t){return Pp(Ff(Fc(e.a)).Xb(t),42).cd()}function YL(e,t){return eto(t,e.length),new Ri(e,t)}function YC(e,t){this.d=e,Ow.call(this,e),this.e=t}function YI(e){this.d=(BJ(e),e),this.a=0,this.c=eUY}function YD(e,t){pJ.call(this,1),this.a=e,this.b=t}function YN(e,t){return e.c?YN(e.c,t):P_(e.b,t),e}function YP(e,t,n){var r;return r=eep(e,t),V7(e,t,n),r}function YR(e,t){var n;return QO(n=e.slice(0,t),e)}function Yj(e,t,n){var r;for(r=0;r=e.g}function BL(e,t,n){var r;return r=er$(e,t,n),eCK(e,r)}function BC(e,t){var n;n=e.a.length,eep(e,n),V7(e,n,t)}function BI(e,t){var n;(n=console[e]).call(console,t)}function BD(e,t){var n;++e.j,n=e.Vi(),e.Ii(e.oi(n,t))}function BN(e,t,n){Pp(t.b,65),ety(t.a,new N5(e,n,t))}function BP(e,t,n){p$.call(this,t),this.a=e,this.b=n}function BR(e,t,n){pJ.call(this,e),this.a=t,this.b=n}function Bj(e,t,n){this.a=e,pH.call(this,t),this.b=n}function BF(e,t,n){this.a=e,K3.call(this,8,t,null,n)}function BY(e){this.a=(BJ(eJ7),eJ7),this.b=e,new mP}function BB(e){this.c=e,this.b=this.c.a,this.a=this.c.e}function BU(e){this.c=e,this.b=e.a.d.a,LR(e.a.e,this)}function BH(e){A4(-1!=e.c),e.d.$c(e.c),e.b=e.c,e.c=-1}function B$(e){return eB4.Math.sqrt(e.a*e.a+e.b*e.b)}function Bz(e,t){return FP(t,e.a.c.length),RJ(e.a,t)}function BG(e,t){return xc(e)===xc(t)||null!=e&&ecX(e,t)}function BW(e){return 0>=e?new _e:erg(e-1)}function BK(e){return!!tyb&&$r(tyb,e)}function BV(e){return e?e.dc():!e.Kc().Ob()}function Bq(e){return!e.a&&e.c?e.c.b:e.a}function BZ(e){return e.a||(e.a=new O_(e5f,e,4)),e.a}function BX(e){return e.d||(e.d=new O_(tgr,e,1)),e.d}function BJ(e){if(null==e)throw p7(new bM);return e}function BQ(e){e.c?e.c.He():(e.d=!0,eAA(e))}function B1(e){e.c?B1(e.c):(el3(e),e.d=!0)}function B0(e){UG(e.a),e.b=Je(e1R,eUp,1,e.b.length,5,1)}function B2(e,t){return ME(t.j.c.length,e.j.c.length)}function B3(e,t){e.c<0||e.b.b=0?e.Bh(n):ekN(e,t)}function B6(e){var t,n;return(t=e.c.i.c)==(n=e.d.i.c)}function B5(e){if(4!=e.p)throw p7(new bT);return e.e}function B8(e){if(3!=e.p)throw p7(new bT);return e.e}function B9(e){if(6!=e.p)throw p7(new bT);return e.f}function B7(e){if(6!=e.p)throw p7(new bT);return e.k}function Ue(e){if(3!=e.p)throw p7(new bT);return e.j}function Ut(e){if(4!=e.p)throw p7(new bT);return e.j}function Un(e){return e.b||(e.b=new pG(new mR)),e.b}function Ur(e){return -2==e.c&&fd(e,e_d(e.g,e.b)),e.c}function Ui(e,t){var n;return(n=Y5("",e)).n=t,n.i=1,n}function Ua(e,t){jB(Pp(t.b,65),e),ety(t.a,new dv(e))}function Uo(e,t){JL((e.a||(e.a=new C_(e,e)),e.a),t)}function Us(e,t){this.b=e,YC.call(this,e,t),Op(this)}function Uu(e,t){this.b=e,IB.call(this,e,t),Ob(this)}function Uc(e,t,n,r){wD.call(this,e,t),this.d=n,this.a=r}function Ul(e,t,n,r){wD.call(this,e,n),this.a=t,this.f=r}function Uf(e,t){MK.call(this,erv(Y8(e),Y8(t))),this.a=t}function Ud(){e_w.call(this,eQB,(yA(),tvE)),ejt(this)}function Uh(){e_w.call(this,eQc,(yO(),tgg)),eP3(this)}function Up(){wC.call(this,"DELAUNAY_TRIANGULATION",0)}function Ub(e){return String.fromCharCode.apply(null,e)}function Um(e,t,n){return xd(t)?Ge(e,t,n):eS8(e.f,t,n)}function Ug(e){return Hj(),e?e.ve():(HF(),HF(),e2c)}function Uv(e,t,n){return eoM(),n.pg(e,Pp(t.cd(),146))}function Uy(e,t){return Rg(),new ebw(new OK(e),new OW(t))}function Uw(e){return enG(e,eU5),ee1(eft(eft(5,e),e/10|0))}function U_(){U_=A,e0p=new gt(eow(vx(e1$,1),eUK,42,0,[]))}function UE(e){return e.d||(e.d=new fF(e.c.Cc())),e.d}function US(e){return e.a||(e.a=new vp(e.c.vc())),e.a}function Uk(e){return e.b||(e.b=new vd(e.c.ec())),e.b}function Ux(e,t){for(;t-- >0;)e=e<<1|(e<0?1:0);return e}function UT(e,t){return xc(e)===xc(t)||null!=e&&ecX(e,t)}function UM(e,t){return OQ(),Pp(t.b,19).ar&&++r,r}function Hl(e){var t,n;return etV(n=t=new p6,e),n}function Hf(e){var t,n;return e_U(n=t=new p6,e),n}function Hd(e,t){var n;return n=Bp(e.f,t),eiX(t,n),null}function Hh(e){var t;return(t=erw(e))?t:null}function Hp(e){return e.b||(e.b=new FQ(e5g,e,12,3)),e.b}function Hb(e){return null!=e&&wZ(tm$,e.toLowerCase())}function Hm(e,t){return elN(jl(e)*jc(e),jl(t)*jc(t))}function Hg(e,t){return elN(jl(e)*jc(e),jl(t)*jc(t))}function Hv(e,t){return elN(e.d.c+e.d.b/2,t.d.c+t.d.b/2)}function Hy(e,t){return elN(e.g.c+e.g.b/2,t.g.c+t.g.b/2)}function Hw(e,t,n){n.a?ens(e,t.b-e.f/2):eno(e,t.a-e.g/2)}function H_(e,t,n,r){this.a=e,this.b=t,this.c=n,this.d=r}function HE(e,t,n,r){this.a=e,this.b=t,this.c=n,this.d=r}function HS(e,t,n,r){this.e=e,this.a=t,this.c=n,this.d=r}function Hk(e,t,n,r){this.a=e,this.c=t,this.d=n,this.b=r}function Hx(e,t,n,r){Ml(),ZU.call(this,t,n,r),this.a=e}function HT(e,t,n,r){Ml(),ZU.call(this,t,n,r),this.a=e}function HM(e,t){this.a=e,LQ.call(this,e,Pp(e.d,15).Zc(t))}function HO(e){this.f=e,this.c=this.f.e,e.f>0&&evH(this)}function HA(e,t,n,r){this.b=e,this.c=r,xj.call(this,t,n)}function HL(e){return A5(e.b=0&&IE(e.substr(n,t.length),t)}function $N(e,t,n,r,i,a,o){return new qu(e.e,t,n,r,i,a,o)}function $P(e,t,n,r,i,a){this.a=e,en1.call(this,t,n,r,i,a)}function $R(e,t,n,r,i,a){this.a=e,en1.call(this,t,n,r,i,a)}function $j(e,t){this.g=e,this.d=eow(vx(e4N,1),eGW,10,0,[t])}function $F(e,t){this.e=e,this.a=e1R,this.b=eCz(t),this.c=t}function $Y(e,t){CK.call(this),etk(this),this.a=e,this.c=t}function $B(e,t,n,r){Bc(e.c[t.g],n.g,r),Bc(e.c[n.g],t.g,r)}function $U(e,t,n,r){Bc(e.c[t.g],t.g,n),Bc(e.b[t.g],t.g,r)}function $H(){return Xo(),eow(vx(e6u,1),eU4,376,0,[tsH,tsU])}function $$(){return Qx(),eow(vx(e40,1),eU4,479,0,[ttt,tte])}function $z(){return eeF(),eow(vx(e4J,1),eU4,419,0,[teZ,teX])}function $G(){return Jp(),eow(vx(e4V,1),eU4,422,0,[teD,teN])}function $W(){return K5(),eow(vx(e48,1),eU4,420,0,[ttR,ttj])}function $K(){return Q0(),eow(vx(e6a,1),eU4,421,0,[tsL,tsC])}function $V(){return qG(),eow(vx(e6v,1),eU4,523,0,[tuf,tul])}function $q(){return Xa(),eow(vx(e6k,1),eU4,520,0,[tuH,tuU])}function $Z(){return zs(),eow(vx(e6E,1),eU4,516,0,[tuw,tuy])}function $X(){return zQ(),eow(vx(e6S,1),eU4,515,0,[tuE,tuS])}function $J(){return zo(),eow(vx(e6x,1),eU4,455,0,[tuq,tuZ])}function $Q(){return Kn(),eow(vx(e6C,1),eU4,425,0,[tcH,tcU])}function $1(){return z1(),eow(vx(e6L,1),eU4,480,0,[tcF,tcY])}function $0(){return erZ(),eow(vx(e6I,1),eU4,495,0,[tcq,tcZ])}function $2(){return J0(),eow(vx(e6N,1),eU4,426,0,[tc2,tc3])}function $3(){return eoT(),eow(vx(e6V,1),eU4,429,0,[tdt,tde])}function $4(){return Xs(),eow(vx(e6G,1),eU4,430,0,[tfw,tfy])}function $6(){return epC(),eow(vx(e2Q,1),eU4,428,0,[e3f,e3l])}function $5(){return eeR(),eow(vx(e21,1),eU4,427,0,[e3h,e3p])}function $8(){return eej(),eow(vx(e4E,1),eU4,424,0,[e8f,e8d])}function $9(){return erq(),eow(vx(e4F,1),eU4,511,0,[e9W,e9G])}function $7(e,t,n,r){return n>=0?e.jh(t,n,r):e.Sg(null,n,r)}function ze(e){return 0==e.b.b?e.a.$e():PH(e.b)}function zt(e){if(5!=e.p)throw p7(new bT);return jE(e.f)}function zn(e){if(5!=e.p)throw p7(new bT);return jE(e.k)}function zr(e){return xc(e.a)===xc((eiM(),tgW))&&eR1(e),e.a}function zi(e){this.a=Pp(Y8(e),271),this.b=(Hj(),new O4(e))}function za(e,t){l6(this,new kl(e.a,e.b)),l5(this,Pv(t))}function zo(){zo=A,tuq=new SK(ezt,0),tuZ=new SK(ezn,1)}function zs(){zs=A,tuw=new Sz(ezn,0),tuy=new Sz(ezt,1)}function zu(){m8.call(this,new w9(ee0(12))),Oq(!0),this.a=2}function zc(e,t,n){eBG(),pJ.call(this,e),this.b=t,this.a=n}function zl(e,t,n){Ml(),p$.call(this,t),this.a=e,this.b=n}function zf(e){CK.call(this),etk(this),this.a=e,this.c=!0}function zd(e){var t;t=e.c.d.b,e.b=t,e.a=e.c.d,t.a=e.c.d.b=e}function zh(e){var t;enZ(e.a),TW(e.a),efJ(t=new dp(e.a))}function zp(e,t){eC_(e,!0),ety(e.e.wf(),new Dx(e,!0,t))}function zb(e,t){return qe(t),enL(e,Je(ty_,eHT,25,t,15,1),t)}function zm(e,t){return HR(),e==z$(e_I(t))||e==z$(e_P(t))}function zg(e,t){return null==t?xu($I(e.f,null)):Ea(e.g,t)}function zv(e){return 0==e.b?null:(A5(0!=e.b),etw(e,e.a.a))}function zy(e){return 0|Math.max(Math.min(e,eUu),-2147483648)}function zw(e,t){var n=e0w[e.charCodeAt(0)];return null==n?e:n}function z_(e,t){return H6(e,"set1"),H6(t,"set2"),new wF(e,t)}function zE(e,t){var n;return C6(Ld(n=et$(e.f,t)),e.f.d)}function zS(e,t){var n,r;return ej4(e,n=t,r=new H),r.d}function zk(e,t,n,r){var i;i=new CQ,t.a[n.g]=i,jT(e.b,r,i)}function zx(e,t,n){var r;(r=e.Yg(t))>=0?e.sh(r,n):eOh(e,t,n)}function zT(e,t,n){z0(),e&&Um(tmj,e,t),e&&Um(tmR,e,n)}function zM(e,t,n){this.i=new p0,this.b=e,this.g=t,this.a=n}function zO(e,t,n){this.c=new p0,this.e=e,this.f=t,this.b=n}function zA(e,t,n){this.a=new p0,this.e=e,this.f=t,this.c=n}function zL(e,t){MV(this),this.f=t,this.g=e,HD(this),this._d()}function zC(e,t){var n;n=e.q.getHours(),e.q.setDate(t),eNq(e,n)}function zI(e,t){var n;for(Y8(t),n=e.a;n;n=n.c)t.Od(n.g,n.i)}function zD(e){var t;return esb(t=new yF(ee0(e.length)),e),t}function zN(e){function t(){}return t.prototype=e||{},new t}function zP(e,t){return!!eos(e,t)&&(enP(e),!0)}function zR(e,t){if(null==t)throw p7(new bM);return ehF(e,t)}function zj(e){return e.qe()?null:(0,eUt[e.n])}function zF(e){return e.Db>>16!=3?null:Pp(e.Cb,33)}function zY(e){return e.Db>>16!=9?null:Pp(e.Cb,33)}function zB(e){return e.Db>>16!=6?null:Pp(e.Cb,79)}function zU(e){return e.Db>>16!=7?null:Pp(e.Cb,235)}function zH(e){return e.Db>>16!=7?null:Pp(e.Cb,160)}function z$(e){return e.Db>>16!=11?null:Pp(e.Cb,33)}function zz(e,t){var n;return(n=e.Yg(t))>=0?e.lh(n):exu(e,t)}function zG(e,t){var n;return n=new RZ(t),e_h(n,e),new I4(n)}function zW(e){var t;return t=e.d,t=e.si(e.f),JL(e,t),t.Ob()}function zK(e,t){return e.b+=t.b,e.c+=t.c,e.d+=t.d,e.a+=t.a,e}function zV(e,t){return eB4.Math.abs(e)0}function zZ(){this.a=new Tw,this.e=new bV,this.g=0,this.i=0}function zX(e){this.a=e,this.b=Je(e6b,eUP,1944,e.e.length,0,2)}function zJ(e,t,n){var r;r=esg(e,t,n),e.b=new erH(r.c.length)}function zQ(){zQ=A,tuE=new S$(ezh,0),tuS=new S$("UP",1)}function z1(){z1=A,tcF=new SJ(eV2,0),tcY=new SJ("FAN",1)}function z0(){z0=A,tmj=new p2,tmR=new p2,xa(e0r,new o9)}function z2(e){if(0!=e.p)throw p7(new bT);return xg(e.f,0)}function z3(e){if(0!=e.p)throw p7(new bT);return xg(e.k,0)}function z4(e){return e.Db>>16!=3?null:Pp(e.Cb,147)}function z6(e){return e.Db>>16!=6?null:Pp(e.Cb,235)}function z5(e){return e.Db>>16!=17?null:Pp(e.Cb,26)}function z8(e,t){var n=e.a=e.a||[];return n[t]||(n[t]=e.le(t))}function z9(e,t){var n;return null==(n=e.a.get(t))?[]:n}function z7(e,t){var n;n=e.q.getHours(),e.q.setMonth(t),eNq(e,n)}function Ge(e,t,n){return null==t?eS8(e.f,null,n):efi(e.g,t,n)}function Gt(e,t,n,r,i,a){return new Q$(e.e,t,e.aj(),n,r,i,a)}function Gn(e,t,n){return e.a=Az(e.a,0,t)+""+n+xy(e.a,t),e}function Gr(e,t,n){return P_(e.a,(U_(),eb2(t,n),new wD(t,n))),e}function Gi(e){return OX(e.c),e.e=e.a=e.c,e.c=e.c.c,++e.d,e.a.f}function Ga(e){return OX(e.e),e.c=e.a=e.e,e.e=e.e.e,--e.d,e.a.f}function Go(e,t){e.d&&QA(e.d.e,e),e.d=t,e.d&&P_(e.d.e,e)}function Gs(e,t){e.c&&QA(e.c.g,e),e.c=t,e.c&&P_(e.c.g,e)}function Gu(e,t){e.c&&QA(e.c.a,e),e.c=t,e.c&&P_(e.c.a,e)}function Gc(e,t){e.i&&QA(e.i.j,e),e.i=t,e.i&&P_(e.i.j,e)}function Gl(e,t,n){this.a=t,this.c=e,this.b=(Y8(n),new I4(n))}function Gf(e,t,n){this.a=t,this.c=e,this.b=(Y8(n),new I4(n))}function Gd(e,t){this.a=e,this.c=MB(this.a),this.b=new $g(t)}function Gh(e){var t;return el3(e),t=new bV,UJ(e,new di(t))}function Gp(e,t){if(e<0||e>t)throw p7(new gE(e$O+e+e$A+t))}function Gb(e,t){return jR(e.a,t)?Yl(e,Pp(t,22).g,null):null}function Gm(e){return euQ(),OQ(),0!=Pp(e.a,81).d.e}function Gg(){Gg=A,e0g=euY((m6(),eow(vx(e1W,1),eU4,538,0,[e0m])))}function Gv(){Gv=A,ts2=j0(new K2,(e_x(),e9i),(eB$(),e7N))}function Gy(){Gy=A,ts3=j0(new K2,(e_x(),e9i),(eB$(),e7N))}function Gw(){Gw=A,ts6=j0(new K2,(e_x(),e9i),(eB$(),e7N))}function G_(){G_=A,tuh=RI(new K2,(e_x(),e9i),(eB$(),e7o))}function GE(){GE=A,tug=RI(new K2,(e_x(),e9i),(eB$(),e7o))}function GS(){GS=A,tuv=RI(new K2,(e_x(),e9i),(eB$(),e7o))}function Gk(){Gk=A,tux=RI(new K2,(e_x(),e9i),(eB$(),e7o))}function Gx(){Gx=A,tcz=j0(new K2,(egR(),tu0),(eS_(),tu3))}function GT(e,t,n,r){this.c=e,this.d=r,GA(this,t),GL(this,n)}function GM(e){this.c=new _n,this.b=e.b,this.d=e.c,this.a=e.a}function GO(e){this.a=eB4.Math.cos(e),this.b=eB4.Math.sin(e)}function GA(e,t){e.a&&QA(e.a.k,e),e.a=t,e.a&&P_(e.a.k,e)}function GL(e,t){e.b&&QA(e.b.f,e),e.b=t,e.b&&P_(e.b.f,e)}function GC(e,t){BN(e,e.b,e.c),Pp(e.b.b,65),t&&Pp(t.b,65).b}function GI(e,t){elJ(e,t),M4(e.Cb,88)&&eko(Zd(Pp(e.Cb,88)),2)}function GD(e,t){M4(e.Cb,88)&&eko(Zd(Pp(e.Cb,88)),4),er3(e,t)}function GN(e,t){M4(e.Cb,179)&&(Pp(e.Cb,179).tb=null),er3(e,t)}function GP(e,t){return _4(),eec(t)?new RA(t,e):new xe(t,e)}function GR(e,t){var n,r;(r=null!=(n=t.c))&&BC(e,new B_(t.c))}function Gj(e){var t,n;return n=(yO(),t=new p6),etV(n,e),n}function GF(e){var t,n;return n=(yO(),t=new p6),etV(n,e),n}function GY(e,t){var n;return n=new By(e),t.c[t.c.length]=n,n}function GB(e,t){var n;return(n=Pp(ecA(HU(e.a),t),14))?n.gc():0}function GU(e){var t;return el3(e),etc(e,t=(HF(),HF(),e2u))}function GH(e){for(var t;;)if(t=e.Pb(),!e.Ob())return t}function G$(e,t){mK.call(this,new w9(ee0(e))),enG(t,eUN),this.a=t}function Gz(e,t,n){ec6(t,n,e.gc()),this.c=e,this.a=t,this.b=n-t}function GG(e,t,n){var r;ec6(t,n,e.c.length),r=n-t,yJ(e.c,t,r)}function GW(e,t){M7(e,jE(WM(Fv(t,24),e$b)),jE(WM(t,e$b)))}function GK(e,t){if(e<0||e>=t)throw p7(new gE(e$O+e+e$A+t))}function GV(e,t){if(e<0||e>=t)throw p7(new vf(e$O+e+e$A+t))}function Gq(e,t){this.b=(BJ(e),e),this.a=(t&eH0)==0?64|t|eUR:t}function GZ(e){TG(this),bF(this.a,esi(eB4.Math.max(8,e))<<1)}function GX(e){return esp(eow(vx(e60,1),eUP,8,0,[e.i.n,e.n,e.a]))}function GJ(){return eum(),eow(vx(e2L,1),eU4,132,0,[e2B,e2U,e2H])}function GQ(){return etx(),eow(vx(e25,1),eU4,232,0,[e3D,e3N,e3P])}function G1(){return Qs(),eow(vx(e27,1),eU4,461,0,[e3F,e3j,e3Y])}function G0(){return QQ(),eow(vx(e3t,1),eU4,462,0,[e3$,e3H,e3U])}function G2(){return ec4(),eow(vx(e4L,1),eU4,423,0,[e9x,e9k,e9S])}function G3(){return QJ(),eow(vx(e4S,1),eU4,379,0,[e84,e83,e86])}function G4(){return euJ(),eow(vx(e6e,1),eU4,378,0,[tsn,tsr,tsi])}function G6(){return en7(),eow(vx(e4q,1),eU4,314,0,[tej,teR,teF])}function G5(){return enB(),eow(vx(e4Z,1),eU4,337,0,[teB,teH,teU])}function G8(){return eoG(),eow(vx(e4Q,1),eU4,450,0,[te1,teQ,te0])}function G9(){return erX(),eow(vx(e4G,1),eU4,361,0,[tep,teh,ted])}function G7(){return Q1(),eow(vx(e45,1),eU4,303,0,[ttD,ttN,ttI])}function We(){return eaU(),eow(vx(e46,1),eU4,292,0,[ttA,ttL,ttO])}function Wt(){return enY(),eow(vx(e6o,1),eU4,452,0,[tsP,tsD,tsN])}function Wn(){return esn(),eow(vx(e6i,1),eU4,339,0,[tsM,tsT,tsO])}function Wr(){return ei0(),eow(vx(e6s,1),eU4,375,0,[tsj,tsF,tsY])}function Wi(){return eox(),eow(vx(e6f,1),eU4,377,0,[tsQ,ts1,tsJ])}function Wa(){return euy(),eow(vx(e6c,1),eU4,336,0,[tsz,tsG,tsW])}function Wo(){return eiO(),eow(vx(e6l,1),eU4,338,0,[tsZ,tsV,tsq])}function Ws(){return enU(),eow(vx(e6p,1),eU4,454,0,[tur,tui,tua])}function Wu(){return efx(),eow(vx(e6D,1),eU4,442,0,[tc1,tcJ,tcQ])}function Wc(){return eub(),eow(vx(e6P,1),eU4,380,0,[tc6,tc5,tc8])}function Wl(){return efS(),eow(vx(e6Y,1),eU4,381,0,[tlP,tlR,tlN])}function Wf(){return ei1(),eow(vx(e6j,1),eU4,293,0,[tlC,tlI,tlL])}function Wd(){return efk(),eow(vx(e6H,1),eU4,437,0,[tff,tfd,tfh])}function Wh(){return eck(),eow(vx(e67,1),eU4,334,0,[tpG,tpz,tpW])}function Wp(){return etT(),eow(vx(e65,1),eU4,272,0,[tp_,tpE,tpS])}function Wb(e,t){return eMw(e,t,M4(t,99)&&(Pp(t,18).Bb&eH3)!=0)}function Wm(e,t,n){var r;return(r=ePI(e,t,!1)).b<=t&&r.a<=n}function Wg(e,t,n){var r;(r=new ac).b=t,r.a=n,++t.b,P_(e.d,r)}function Wv(e,t){var n;return A3(!!(n=(BJ(e),e).g)),BJ(t),n(t)}function Wy(e,t){var n,r;return r=Yi(e,t),n=e.a.Zc(r),new wR(e,n)}function Ww(e){return e.Db>>16!=6?null:Pp(eTp(e),235)}function W_(e){if(2!=e.p)throw p7(new bT);return jE(e.f)&eHd}function WE(e){if(2!=e.p)throw p7(new bT);return jE(e.k)&eHd}function WS(e){return e.a==(ZE(),tvd)&&ff(e,eM0(e.g,e.b)),e.a}function Wk(e){return e.d==(ZE(),tvd)&&fh(e,eIj(e.g,e.b)),e.d}function Wx(e){return A5(e.ar?1:0}function WY(e,t){var n,r;return r=n=QP(t),Pp(Bp(e.c,r),19).a}function WB(e,t){var n;for(n=e+"";n.length0&&0==e.a[--e.d];);0==e.a[e.d++]&&(e.e=0)}function Kc(e){return e.a?0==e.e.length?e.a.a:e.a.a+""+e.e:e.c}function Kl(e){return!!e.a&&0!=QX(e.a.a).i&&!(e.b&&ebq(e.b))}function Kf(e){return!!e.u&&0!=qt(e.u.a).i&&!(e.n&&ebV(e.n))}function Kd(e){return Rj(e.e.Hd().gc()*e.c.Hd().gc(),16,new c8(e))}function Kh(e,t){return YM(eap(e.q.getTime()),eap(t.q.getTime()))}function Kp(e){return Pp(epg(e,Je(e4C,eGG,17,e.c.length,0,1)),474)}function Kb(e){return Pp(epg(e,Je(e4N,eGW,10,e.c.length,0,1)),193)}function Km(e){return GE(),!q9(e)&&!(!q9(e)&&e.c.i.c==e.d.i.c)}function Kg(e,t,n){var r;r=(Y8(e),new I4(e)),egT(new Gl(r,t,n))}function Kv(e,t,n){var r;r=(Y8(e),new I4(e)),egM(new Gf(r,t,n))}function Ky(e,t){var n;return n=1-t,e.a[n]=erj(e.a[n],n),erj(e,t)}function Kw(e,t){var n;e.e=new mQ,n=eLj(t),Mv(n,e.c),eLJ(e,n,0)}function K_(e,t,n,r){var i;(i=new od).a=t,i.b=n,i.c=r,P7(e.a,i)}function KE(e,t,n,r){var i;(i=new od).a=t,i.b=n,i.c=r,P7(e.b,i)}function KS(e){var t,n,r;return n=eI4(t=new YQ,e),eFg(t),r=n}function Kk(){var e,t,n;return P_(tg5,t=n=e=new p6),t}function Kx(e){return e.j.c=Je(e1R,eUp,1,0,5,1),UG(e.c),Uj(e.a),e}function KT(e){return(_L(),M4(e.g,10))?Pp(e.g,10):null}function KM(e){return!Uz(e).dc()&&(MI(e,new v),!0)}function KO(e){if(!("stack"in e))try{throw e}catch(t){}return e}function KA(e,t){if(e<0||e>=t)throw p7(new gE(eku(e,t)));return e}function KL(e,t,n){if(e<0||tn)throw p7(new gE(eE3(e,t,n)))}function KC(e,t){if(Yf(e.a,t),t.d)throw p7(new go(e$P));t.d=e}function KI(e,t){if(t.$modCount!=e.$modCount)throw p7(new bA)}function KD(e,t){return!!M4(t,42)&&emT(e.a,Pp(t,42))}function KN(e,t){return!!M4(t,42)&&emT(e.a,Pp(t,42))}function KP(e,t){return!!M4(t,42)&&emT(e.a,Pp(t,42))}function KR(e,t){return e.a<=e.b&&(t.ud(e.a++),!0)}function Kj(e){var t;return Ts(e)?-0==(t=e)?0:t:eem(e)}function KF(e){var t;return B1(e),t=new Y,yU(e.a,new dn(t)),t}function KY(e){var t;return B1(e),t=new F,yU(e.a,new dt(t)),t}function KB(e,t){this.a=e,fE.call(this,e),Gp(t,e.gc()),this.b=t}function KU(e){this.e=e,this.b=this.e.a.entries(),this.a=[]}function KH(e){return Rj(e.e.Hd().gc()*e.c.Hd().gc(),273,new c5(e))}function K$(e){return new XM((enG(e,eU5),ee1(eft(eft(5,e),e/10|0))))}function Kz(e){return Pp(epg(e,Je(e4j,eGK,11,e.c.length,0,1)),1943)}function KG(e,t,n){return n.f.c.length>0?YO(e.a,t,n):YO(e.b,t,n)}function KW(e,t,n){e.d&&QA(e.d.e,e),e.d=t,e.d&&jO(e.d.e,n,e)}function KK(e,t){eY6(t,e),PD(e.d),PD(Pp(e_k(e,(eBy(),taq)),207))}function KV(e,t){eY4(t,e),PI(e.d),PI(Pp(e_k(e,(eBy(),taq)),207))}function Kq(e,t){var n,r;return n=zR(e,t),r=null,n&&(r=n.fe()),r}function KZ(e,t){var n,r;return n=eep(e,t),r=null,n&&(r=n.ie()),r}function KX(e,t){var n,r;return n=zR(e,t),r=null,n&&(r=n.ie()),r}function KJ(e,t){var n,r;return n=zR(e,t),r=null,n&&(r=eSa(n)),r}function KQ(e,t,n){var r;return r=ehM(n),eIg(e.g,r,t),eIg(e.i,t,n),t}function K1(e,t,n){var r;r=ehl();try{return CO(e,t,n)}finally{Vx(r)}}function K0(e){var t;t=e.Wg(),this.a=M4(t,69)?Pp(t,69).Zh():t.Kc()}function K2(){mJ.call(this),this.j.c=Je(e1R,eUp,1,0,5,1),this.a=-1}function K3(e,t,n,r){this.d=e,this.n=t,this.g=n,this.o=r,this.p=-1}function K4(e,t,n,r){this.e=r,this.d=null,this.c=e,this.a=t,this.b=n}function K6(e,t,n){this.d=new hg(this),this.e=e,this.i=t,this.f=n}function K5(){K5=A,ttR=new S_(e$9,0),ttj=new S_("TOP_LEFT",1)}function K8(){K8=A,ts7=Uy(ell(1),ell(4)),ts9=Uy(ell(1),ell(2))}function K9(){K9=A,tfv=euY((_N(),eow(vx(e6z,1),eU4,551,0,[tfg])))}function K7(){K7=A,tfm=euY((_D(),eow(vx(e6$,1),eU4,482,0,[tfb])))}function Ve(){Ve=A,tf7=euY((_P(),eow(vx(e6K,1),eU4,530,0,[tf9])))}function Vt(){Vt=A,e5W=euY((_y(),eow(vx(e4w,1),eU4,481,0,[e5G])))}function Vn(){return eaY(),eow(vx(e3r,1),eU4,406,0,[e4c,e4o,e4s,e4u])}function Vr(){return Qu(),eow(vx(e2E,1),eU4,297,0,[e2D,e2N,e2P,e2R])}function Vi(){return ebe(),eow(vx(e4y,1),eU4,394,0,[e5U,e5B,e5H,e5$])}function Va(){return ep7(),eow(vx(e3i,1),eU4,323,0,[e4d,e4f,e4h,e4p])}function Vo(){return eok(),eow(vx(e4A,1),eU4,405,0,[e9f,e9p,e9d,e9h])}function Vs(){return eoE(),eow(vx(e4U,1),eU4,360,0,[e7Z,e7V,e7q,e7K])}function Vu(e,t,n,r){return M4(n,54)?new A7(e,t,n,r):new Fo(e,t,n,r)}function Vc(){return eoS(),eow(vx(e4$,1),eU4,411,0,[e78,e79,e77,tee])}function Vl(e){var t;return e.j==(eYu(),tbj)&&(t=eTt(e),Aa(t,tby))}function Vf(e,t){var n;Gs(n=t.a,t.c.d),Go(n,t.d.d),etH(n.a,e.n)}function Vd(e,t){return Pp(Af(FT(Pp(Zq(e.k,t),15).Oc(),tex)),113)}function Vh(e,t){return Pp(Af(FM(Pp(Zq(e.k,t),15).Oc(),tex)),113)}function Vp(e){return new Gq(eip(Pp(e.a.dd(),14).gc(),e.a.cd()),16)}function Vb(e){return M4(e,14)?Pp(e,14).dc():!e.Kc().Ob()}function Vm(e){return(_L(),M4(e.g,145))?Pp(e.g,145):null}function Vg(e){if(e.e.g!=e.b)throw p7(new bA);return!!e.c&&e.d>0}function Vv(e){return A5(e.b!=e.d.c),e.c=e.b,e.b=e.b.a,++e.a,e.c.c}function Vy(e,t){BJ(t),Bc(e.a,e.c,t),e.c=e.c+1&e.a.length-1,ega(e)}function Vw(e,t){BJ(t),e.b=e.b-1&e.a.length-1,Bc(e.a,e.b,t),ega(e)}function V_(e,t){var n;for(n=e.j.c.length;n0&&ePD(e.g,0,t,0,e.i),t}function VB(e,t){var n;return _6(),!(n=Pp(Bp(tmU,e),55))||n.wj(t)}function VU(e){if(1!=e.p)throw p7(new bT);return jE(e.f)<<24>>24}function VH(e){if(1!=e.p)throw p7(new bT);return jE(e.k)<<24>>24}function V$(e){if(7!=e.p)throw p7(new bT);return jE(e.k)<<16>>16}function Vz(e){if(7!=e.p)throw p7(new bT);return jE(e.f)<<16>>16}function VG(e){var t;for(t=0;e.Ob();)e.Pb(),t=eft(t,1);return ee1(t)}function VW(e,t){var n;return n=new vl,e.xd(n),n.a+="..",t.yd(n),n.a}function VK(e,t,n){var r;r=Pp(Bp(e.g,n),57),P_(e.a.c,new kD(t,r))}function VV(e,t,n){return F_(LV(xu($I(e.f,t))),LV(xu($I(e.f,n))))}function Vq(e,t,n){return eNA(e,t,n,M4(t,99)&&(Pp(t,18).Bb&eH3)!=0)}function VZ(e,t,n){return eN1(e,t,n,M4(t,99)&&(Pp(t,18).Bb&eH3)!=0)}function VX(e,t,n){return eMN(e,t,n,M4(t,99)&&(Pp(t,18).Bb&eH3)!=0)}function VJ(e,t){return e==(eEn(),e9N)&&t==e9N?4:e==e9N||t==e9N?8:32}function VQ(e,t){return xc(t)===xc(e)?"(this Map)":null==t?eUg:efF(t)}function V1(e,t){return Pp(null==t?xu($I(e.f,null)):Ea(e.g,t),281)}function V0(e,t,n){var r;return r=ehM(n),Um(e.b,r,t),Um(e.c,t,n),t}function V2(e,t){var n;for(n=t;n;)Lu(e,n.i,n.j),n=z$(n);return e}function V3(e,t){var n;return n=$a(Pb(new Qj(e,t))),RG(new Qj(e,t)),n}function V4(e,t){var n;return _4(),eEy(n=Pp(e,66).Mj(),t),n.Ok(t)}function V6(e,t,n,r,i){var a;a=eMW(i,n,r),P_(t,eS4(i,a)),e_X(e,i,t)}function V5(e,t,n){e.i=0,e.e=0,t!=n&&(esC(e,t,n),esL(e,t,n))}function V8(e,t){var n;n=e.q.getHours(),e.q.setFullYear(t+eHx),eNq(e,n)}function V9(e,t,n){if(n){var r=n.ee();e.a[t]=r(n)}else delete e.a[t]}function V7(e,t,n){n=n?n.ee()(n):void 0,e.a[t]=n}function qe(e){if(e<0)throw p7(new gI("Negative array size: "+e))}function qt(e){return e.n||(Zd(e),e.n=new j4(e,tgr,e),$E(e)),e.n}function qn(e){return A5(e.a=0&&e.a[n]===t[n];n--);return n<0}function qy(e,t){var n;return(euv(),0!=(n=e.j.g-t.j.g))?n:0}function qw(e,t){return(BJ(t),null!=e.a)?jN(t.Kb(e.a)):e2b}function q_(e){var t;return e?new RZ(e):(t=new Tw,ein(t,e),t)}function qE(e,t){var n;return t.b.Kb(QD(e,t.c.Ee(),n=new ds(t)))}function qS(e){ewP(),M7(this,jE(WM(Fv(e,24),e$b)),jE(WM(e,e$b)))}function qk(){qk=A,e3d=euY((epC(),eow(vx(e2Q,1),eU4,428,0,[e3f,e3l])))}function qx(){qx=A,e3b=euY((eeR(),eow(vx(e21,1),eU4,427,0,[e3h,e3p])))}function qT(){qT=A,e8h=euY((eej(),eow(vx(e4E,1),eU4,424,0,[e8f,e8d])))}function qM(){qM=A,e9K=euY((erq(),eow(vx(e4F,1),eU4,511,0,[e9W,e9G])))}function qO(){qO=A,teJ=euY((eeF(),eow(vx(e4J,1),eU4,419,0,[teZ,teX])))}function qA(){qA=A,ttn=euY((Qx(),eow(vx(e40,1),eU4,479,0,[ttt,tte])))}function qL(){qL=A,ts$=euY((Xo(),eow(vx(e6u,1),eU4,376,0,[tsH,tsU])))}function qC(){qC=A,tsI=euY((Q0(),eow(vx(e6a,1),eU4,421,0,[tsL,tsC])))}function qI(){qI=A,teP=euY((Jp(),eow(vx(e4V,1),eU4,422,0,[teD,teN])))}function qD(){qD=A,ttF=euY((K5(),eow(vx(e48,1),eU4,420,0,[ttR,ttj])))}function qN(){qN=A,tu$=euY((Xa(),eow(vx(e6k,1),eU4,520,0,[tuH,tuU])))}function qP(){qP=A,tud=euY((qG(),eow(vx(e6v,1),eU4,523,0,[tuf,tul])))}function qR(){qR=A,tu_=euY((zs(),eow(vx(e6E,1),eU4,516,0,[tuw,tuy])))}function qj(){qj=A,tuk=euY((zQ(),eow(vx(e6S,1),eU4,515,0,[tuE,tuS])))}function qF(){qF=A,tuX=euY((zo(),eow(vx(e6x,1),eU4,455,0,[tuq,tuZ])))}function qY(){qY=A,tc$=euY((Kn(),eow(vx(e6C,1),eU4,425,0,[tcH,tcU])))}function qB(){qB=A,tcX=euY((erZ(),eow(vx(e6I,1),eU4,495,0,[tcq,tcZ])))}function qU(){qU=A,tcB=euY((z1(),eow(vx(e6L,1),eU4,480,0,[tcF,tcY])))}function qH(){qH=A,tc4=euY((J0(),eow(vx(e6N,1),eU4,426,0,[tc2,tc3])))}function q$(){q$=A,tdn=euY((eoT(),eow(vx(e6V,1),eU4,429,0,[tdt,tde])))}function qz(){qz=A,tf_=euY((Xs(),eow(vx(e6G,1),eU4,430,0,[tfw,tfy])))}function qG(){qG=A,tuf=new Sj("UPPER",0),tul=new Sj("LOWER",1)}function qW(e,t){var n;H1(n=new gu,"x",t.a),H1(n,"y",t.b),BC(e,n)}function qK(e,t){var n;H1(n=new gu,"x",t.a),H1(n,"y",t.b),BC(e,n)}function qV(e,t){var n,r;r=!1;do n=eo5(e,t),r|=n;while(n)return r}function qq(e,t){var n,r;for(n=t,r=0;n>0;)r+=e.a[n],n-=n&-n;return r}function qZ(e,t){var n;for(n=t;n;)Lu(e,-n.i,-n.j),n=z$(n);return e}function qX(e,t){var n,r;for(BJ(t),r=e.Kc();r.Ob();)n=r.Pb(),t.td(n)}function qJ(e,t){var n;return n=t.cd(),new wD(n,e.e.pc(n,Pp(t.dd(),14)))}function qQ(e,t,n,r){var i;(i=new C).c=t,i.b=n,i.a=r,r.b=n.a=i,++e.b}function q1(e,t,n){var r;return r=(GK(t,e.c.length),e.c[t]),e.c[t]=n,r}function q0(e,t,n){return Pp(null==t?eS8(e.f,null,n):efi(e.g,t,n),281)}function q2(e){return e.c&&e.d?WH(e.c)+"->"+WH(e.d):"e_"+Ao(e)}function q3(e,t){return(el3(e),yK(new R1(e,new Qa(t,e.a)))).sd(e2z)}function q4(){return e_x(),eow(vx(e4k,1),eU4,356,0,[e9e,e9t,e9n,e9r,e9i])}function q6(){return eYu(),eow(vx(e5a,1),eGj,61,0,[tbF,tbw,tby,tbj,tbY])}function q5(e){return vg(),function(){return K1(e,this,arguments)}}function q8(){return Date.now?Date.now():(new Date).getTime()}function q9(e){return!!e.c&&!!e.d&&!!e.c.i&&e.c.i==e.d.i}function q7(e){if(!e.c.Sb())throw p7(new bC);return e.a=!0,e.c.Ub()}function Ze(e){e.i=0,Eb(e.b,null),Eb(e.c,null),e.a=null,e.e=null,++e.g}function Zt(e){El.call(this,null==e?eUg:efF(e),M4(e,78)?Pp(e,78):null)}function Zn(e){eBD(),p9(this),this.a=new _n,esJ(this,e),P7(this.a,e)}function Zr(){Tz(this),this.b=new kl(eHQ,eHQ),this.a=new kl(eH1,eH1)}function Zi(e,t){this.c=0,this.b=t,xR.call(this,e,17493),this.a=this.c}function Za(e){Zo(),!e2M&&(this.c=e,this.e=!0,this.a=new p0)}function Zo(){Zo=A,e2M=!0,e2x=!1,e2T=!1,e2A=!1,e2O=!1}function Zs(e,t){return!!M4(t,149)&&IE(e.c,Pp(t,149).c)}function Zu(e,t){var n;return n=0,e&&(n+=e.f.a/2),t&&(n+=t.f.a/2),n}function Zc(e,t){var n;return(n=Pp(eef(e.d,t),23))||Pp(eef(e.e,t),23)}function Zl(e){this.b=e,Ow.call(this,e),this.a=Pp(eaS(this.b.a,4),126)}function Zf(e){this.b=e,AY.call(this,e),this.a=Pp(eaS(this.b.a,4),126)}function Zd(e){return e.t||(e.t=new pR(e),elm(new gT(e),0,e.t)),e.t}function Zh(){return ec3(),eow(vx(e66,1),eU4,103,0,[tpv,tpg,tpm,tpb,tpy])}function Zp(){return epT(),eow(vx(e5n,1),eU4,249,0,[tbt,tbr,tp7,tbe,tbn])}function Zb(){return epx(),eow(vx(e6Q,1),eU4,175,0,[tdh,tdd,tdl,tdp,tdf])}function Zm(){return eEM(),eow(vx(e6W,1),eU4,316,0,[tfE,tfS,tfT,tfk,tfx])}function Zg(){return ebG(),eow(vx(e6n,1),eU4,315,0,[tsb,tsd,tsh,tsf,tsp])}function Zv(){return eb5(),eow(vx(e4X,1),eU4,335,0,[teG,tez,teK,teV,teW])}function Zy(){return eOB(),eow(vx(e6U,1),eU4,355,0,[tfo,tfa,tfu,tfs,tfc])}function Zw(){return ey4(),eow(vx(e4z,1),eU4,363,0,[ter,tea,teo,tei,ten])}function Z_(){return ef_(),eow(vx(e49,1),eU4,163,0,[tnj,tnD,tnN,tnP,tnR])}function ZE(){var e,t;ZE=A,tvf=(yO(),t=new bN),tvd=e=new mC}function ZS(e){var t;return!e.c&&M4(t=e.r,88)&&(e.c=Pp(t,26)),e.c}function Zk(e){return e.e=3,e.d=e.Yb(),2!=e.e&&(e.e=0,!0)}function Zx(e){var t,n,r;return t=e&eHH,Mk(t,n=e>>22&eHH,r=e<0?eH$:0)}function ZT(e){var t,n,r,i;for(r=0,i=(n=e).length;r0?ehe(e,t):eA9(e,-t)}function ZL(e,t){return 0==t||0==e.e?e:t>0?eA9(e,t):ehe(e,-t)}function ZC(e){if(eTk(e))return e.c=e.a,e.a.Pb();throw p7(new bC)}function ZI(e){var t,n;return t=e.c.i,n=e.d.i,t.k==(eEn(),e9C)&&n.k==e9C}function ZD(e){var t;return t=new $b,eaW(t,e),eo3(t,(eBy(),taR),null),t}function ZN(e,t,n){var r;return(r=e.Yg(t))>=0?e._g(r,n,!0):exk(e,t,n)}function ZP(e,t,n,r){var i;for(i=0;it)throw p7(new gE(eS1(e,t,"index")));return e}function Z1(e,t,n,r){var i;return i=Je(ty_,eHT,25,t,15,1),ewD(i,e,t,n,r),i}function Z0(e,t){var n;n=e.q.getHours()+(t/60|0),e.q.setMinutes(t),eNq(e,n)}function Z2(e,t){return eB4.Math.min(Jh(t.a,e.d.d.c),Jh(t.b,e.d.d.c))}function Z3(e,t){return xd(t)?null==t?eTx(e.f,null):eaK(e.g,t):eTx(e.f,t)}function Z4(e){this.c=e,this.a=new fz(this.c.a),this.b=new fz(this.c.b)}function Z6(){this.e=new p0,this.c=new p0,this.d=new p0,this.b=new p0}function Z5(){this.g=new bJ,this.b=new bJ,this.a=new p0,this.k=new p0}function Z8(e,t,n){this.a=e,this.c=t,this.d=n,P_(t.e,this),P_(n.b,this)}function Z9(e,t){xP.call(this,t.rd(),-6&t.qd()),BJ(e),this.a=e,this.b=t}function Z7(e,t){xR.call(this,t.rd(),-6&t.qd()),BJ(e),this.a=e,this.b=t}function Xe(e,t){xj.call(this,t.rd(),-6&t.qd()),BJ(e),this.a=e,this.b=t}function Xt(e,t,n){this.a=e,this.b=t,this.c=n,P_(e.t,this),P_(t.i,this)}function Xn(){this.b=new _n,this.a=new _n,this.b=new _n,this.a=new _n}function Xr(){Xr=A,tdx=new pO("org.eclipse.elk.labels.labelManager")}function Xi(){Xi=A,e7W=new Cm("separateLayerConnections",(eoE(),e7Z))}function Xa(){Xa=A,tuH=new SW("REGULAR",0),tuU=new SW("CRITICAL",1)}function Xo(){Xo=A,tsH=new SI("STACKED",0),tsU=new SI("SEQUENCED",1)}function Xs(){Xs=A,tfw=new S7("FIXED",0),tfy=new S7("CENTER_NODE",1)}function Xu(e,t){var n;return n=ejH(e,t),e.b=new erH(n.c.length),eRj(e,n)}function Xc(e,t,n){var r;return++e.e,--e.f,(r=Pp(e.d[t].$c(n),133)).dd()}function Xl(e){var t;return!e.a&&M4(t=e.r,148)&&(e.a=Pp(t,148)),e.a}function Xf(e){return e.a?e.e?Xf(e.e):null:e}function Xd(e,t){return e.pt.p?-1:0}function Xh(e,t){return BJ(t),e.c=0,"Initial capacity must not be negative")}function XO(){XO=A,e3R=euY((etx(),eow(vx(e25,1),eU4,232,0,[e3D,e3N,e3P])))}function XA(){XA=A,e3B=euY((Qs(),eow(vx(e27,1),eU4,461,0,[e3F,e3j,e3Y])))}function XL(){XL=A,e3z=euY((QQ(),eow(vx(e3t,1),eU4,462,0,[e3$,e3H,e3U])))}function XC(){XC=A,e2$=euY((eum(),eow(vx(e2L,1),eU4,132,0,[e2B,e2U,e2H])))}function XI(){XI=A,e85=euY((QJ(),eow(vx(e4S,1),eU4,379,0,[e84,e83,e86])))}function XD(){XD=A,e9T=euY((ec4(),eow(vx(e4L,1),eU4,423,0,[e9x,e9k,e9S])))}function XN(){XN=A,teY=euY((en7(),eow(vx(e4q,1),eU4,314,0,[tej,teR,teF])))}function XP(){XP=A,te$=euY((enB(),eow(vx(e4Z,1),eU4,337,0,[teB,teH,teU])))}function XR(){XR=A,te2=euY((eoG(),eow(vx(e4Q,1),eU4,450,0,[te1,teQ,te0])))}function Xj(){Xj=A,teb=euY((erX(),eow(vx(e4G,1),eU4,361,0,[tep,teh,ted])))}function XF(){XF=A,ttP=euY((Q1(),eow(vx(e45,1),eU4,303,0,[ttD,ttN,ttI])))}function XY(){XY=A,ttC=euY((eaU(),eow(vx(e46,1),eU4,292,0,[ttA,ttL,ttO])))}function XB(){XB=A,tsa=euY((euJ(),eow(vx(e6e,1),eU4,378,0,[tsn,tsr,tsi])))}function XU(){XU=A,tsB=euY((ei0(),eow(vx(e6s,1),eU4,375,0,[tsj,tsF,tsY])))}function XH(){XH=A,tsA=euY((esn(),eow(vx(e6i,1),eU4,339,0,[tsM,tsT,tsO])))}function X$(){X$=A,tsR=euY((enY(),eow(vx(e6o,1),eU4,452,0,[tsP,tsD,tsN])))}function Xz(){Xz=A,ts0=euY((eox(),eow(vx(e6f,1),eU4,377,0,[tsQ,ts1,tsJ])))}function XG(){XG=A,tsK=euY((euy(),eow(vx(e6c,1),eU4,336,0,[tsz,tsG,tsW])))}function XW(){XW=A,tsX=euY((eiO(),eow(vx(e6l,1),eU4,338,0,[tsZ,tsV,tsq])))}function XK(){XK=A,tuo=euY((enU(),eow(vx(e6p,1),eU4,454,0,[tur,tui,tua])))}function XV(){XV=A,tc0=euY((efx(),eow(vx(e6D,1),eU4,442,0,[tc1,tcJ,tcQ])))}function Xq(){Xq=A,tc9=euY((eub(),eow(vx(e6P,1),eU4,380,0,[tc6,tc5,tc8])))}function XZ(){XZ=A,tlj=euY((efS(),eow(vx(e6Y,1),eU4,381,0,[tlP,tlR,tlN])))}function XX(){XX=A,tlD=euY((ei1(),eow(vx(e6j,1),eU4,293,0,[tlC,tlI,tlL])))}function XJ(){XJ=A,tfp=euY((efk(),eow(vx(e6H,1),eU4,437,0,[tff,tfd,tfh])))}function XQ(){XQ=A,tpK=euY((eck(),eow(vx(e67,1),eU4,334,0,[tpG,tpz,tpW])))}function X1(){X1=A,tpk=euY((etT(),eow(vx(e65,1),eU4,272,0,[tp_,tpE,tpS])))}function X0(){return ewf(),eow(vx(e5r,1),eU4,98,0,[tbl,tbc,tbu,tba,tbs,tbo])}function X2(e,t){return e.o||(e.o=new JY((eBa(),tmy),e5O,e,0)),edG(e.o,t)}function X3(e){return e.g||(e.g=new o2),e.g.d||(e.g.d=new pD(e)),e.g.d}function X4(e){return e.g||(e.g=new o2),e.g.a||(e.g.a=new pN(e)),e.g.a}function X6(e){return e.g||(e.g=new o2),e.g.b||(e.g.b=new pI(e)),e.g.b}function X5(e){return e.g||(e.g=new o2),e.g.c||(e.g.c=new pP(e)),e.g.c}function X8(e,t,n){var r,i;for(r=0,i=new eaN(t,e);rn||t=0?e._g(n,!0,!0):exk(e,t,!0)}function JW(e,t){return elN(gP(LV(e_k(e,(eBU(),tnv)))),gP(LV(e_k(t,tnv))))}function JK(){JK=A,tcG=ehY(ehY(_G(new K2,(egR(),tuQ)),(eS_(),tu9)),tu4)}function JV(e,t,n){var r;return r=esg(e,t,n),e.b=new erH(r.c.length),eLI(e,r)}function Jq(e){if(e.b<=0)throw p7(new bC);return--e.b,e.a-=e.c.c,ell(e.a)}function JZ(e){var t;if(!e.a)throw p7(new UD);return t=e.a,e.a=z$(e.a),t}function JX(e){for(;!e.a;)if(!IM(e.c,new dr(e)))return!1;return!0}function JJ(e){var t;return(Y8(e),M4(e,198))?t=Pp(e,198):new lp(e)}function JQ(e){J1(),Pp(e.We((eBB(),thJ)),174).Fc((ekU(),tbb)),e.Ye(thX,null)}function J1(){J1=A,tdo=new os,tdu=new ou,tds=es0((eBB(),thX),tdo,thL,tdu)}function J0(){J0=A,tc2=new S2("LEAF_NUMBER",0),tc3=new S2("NODE_SIZE",1)}function J2(e,t,n){e.a=t,e.c=n,e.b.a.$b(),HC(e.d),e.e.a.c=Je(e1R,eUp,1,0,5,1)}function J3(e){e.a=Je(ty_,eHT,25,e.b+1,15,1),e.c=Je(ty_,eHT,25,e.b,15,1),e.d=0}function J4(e,t){e.a.ue(t.d,e.b)>0&&(P_(e.c,new PW(t.c,t.d,e.d)),e.b=t.d)}function J6(e,t){if(null==e.g||t>=e.i)throw p7(new xJ(t,e.i));return e.g[t]}function J5(e,t,n){if(euu(e,n),null!=n&&!e.wj(n))throw p7(new bS);return n}function J8(e){var t;if(e.Ek())for(t=e.i-1;t>=0;--t)etj(e,t);return VY(e)}function J9(e){var t,n;if(!e.b)return null;for(n=e.b;t=n.a[0];)n=t;return n}function J7(e,t){var n,r;return qe(t),(n=QO(r=e.slice(0,t),e)).length=t,n}function Qe(e,t,n,r){var i;r=(HF(),r||e2s),eS0(i=e.slice(t,n),e,t,n,-t,r)}function Qt(e,t,n,r,i){return t<0?exk(e,n,r):Pp(n,66).Nj().Pj(e,e.yh(),t,r,i)}function Qn(e){return M4(e,172)?""+Pp(e,172).a:null==e?null:efF(e)}function Qr(e){return M4(e,172)?""+Pp(e,172).a:null==e?null:efF(e)}function Qi(e,t){if(t.a)throw p7(new go(e$P));Yf(e.a,t),t.a=e,e.j||(e.j=t)}function Qa(e,t){xj.call(this,t.rd(),-16449&t.qd()),BJ(e),this.a=e,this.c=t}function Qo(e,t){var n,r;return r=t/e.c.Hd().gc()|0,n=t%e.c.Hd().gc(),X_(e,r,n)}function Qs(){Qs=A,e3F=new EY(ezt,0),e3j=new EY(e$9,1),e3Y=new EY(ezn,2)}function Qu(){Qu=A,e2D=new Ef("All",0),e2N=new TH,e2P=new ML,e2R=new T$}function Qc(){Qc=A,e2j=euY((Qu(),eow(vx(e2E,1),eU4,297,0,[e2D,e2N,e2P,e2R])))}function Ql(){Ql=A,e9b=euY((eok(),eow(vx(e4A,1),eU4,405,0,[e9f,e9p,e9d,e9h])))}function Qf(){Qf=A,e4l=euY((eaY(),eow(vx(e3r,1),eU4,406,0,[e4c,e4o,e4s,e4u])))}function Qd(){Qd=A,e4b=euY((ep7(),eow(vx(e3i,1),eU4,323,0,[e4d,e4f,e4h,e4p])))}function Qh(){Qh=A,e5z=euY((ebe(),eow(vx(e4y,1),eU4,394,0,[e5U,e5B,e5H,e5$])))}function Qp(){Qp=A,tu2=euY((egR(),eow(vx(e6T,1),eU4,393,0,[tuJ,tuQ,tu1,tu0])))}function Qb(){Qb=A,e7X=euY((eoE(),eow(vx(e4U,1),eU4,360,0,[e7Z,e7V,e7q,e7K])))}function Qm(){Qm=A,tlA=euY((emC(),eow(vx(e6R,1),eU4,340,0,[tlO,tlT,tlM,tlx])))}function Qg(){Qg=A,tet=euY((eoS(),eow(vx(e4$,1),eU4,411,0,[e78,e79,e77,tee])))}function Qv(){Qv=A,tsl=euY((ebk(),eow(vx(e6t,1),eU4,197,0,[tsu,tsc,tss,tso])))}function Qy(){Qy=A,tmo=euY((eup(),eow(vx(e5l,1),eU4,396,0,[tmr,tmi,tmn,tma])))}function Qw(){Qw=A,tpJ=euY((egF(),eow(vx(e5e,1),eU4,285,0,[tpX,tpV,tpq,tpZ])))}function Q_(){Q_=A,tpA=euY((efE(),eow(vx(e68,1),eU4,218,0,[tpO,tpT,tpx,tpM])))}function QE(){QE=A,tmt=euY((edM(),eow(vx(e5u,1),eU4,311,0,[tme,tb8,tb7,tb9])))}function QS(){QS=A,tbZ=euY((ed5(),eow(vx(e5o,1),eU4,374,0,[tbV,tbq,tbK,tbW])))}function Qk(){Qk=A,ePm(),tvq=eHQ,tvV=eH1,tvX=new fL(eHQ),tvZ=new fL(eH1)}function Qx(){Qx=A,ttt=new Sb(eGR,0),tte=new Sb("IMPROVE_STRAIGHTNESS",1)}function QT(e,t){return Pj(),P_(e,new kD(t,ell(t.e.c.length+t.g.c.length)))}function QM(e,t){return Pj(),P_(e,new kD(t,ell(t.e.c.length+t.g.c.length)))}function QO(e,t){return 10!=eeg(t)&&eow(esF(t),t.hm,t.__elementTypeId$,eeg(t),e),e}function QA(e,t){var n;return -1!=(n=QI(e,t,0))&&(ZV(e,n),!0)}function QL(e,t){var n;return(n=Pp(Z3(e.e,t),387))?(Re(n),n.e):null}function QC(e){var t;return Ts(e)&&!isNaN(t=0-e)?t:eal(eoQ(e))}function QI(e,t,n){for(;n=0?ebl(e,n,!0,!0):exk(e,t,!0)}function Q9(e,t){var n,r;return _L(),n=Vm(e),r=Vm(t),!!n&&!!r&&!ep6(n.k,r.k)}function Q7(e,t){eno(e,null==t||IX((BJ(t),t))||isNaN((BJ(t),t))?0:(BJ(t),t))}function eee(e,t){ens(e,null==t||IX((BJ(t),t))||isNaN((BJ(t),t))?0:(BJ(t),t))}function eet(e,t){ena(e,null==t||IX((BJ(t),t))||isNaN((BJ(t),t))?0:(BJ(t),t))}function een(e,t){eni(e,null==t||IX((BJ(t),t))||isNaN((BJ(t),t))?0:(BJ(t),t))}function eer(e){(this.q?this.q:(Hj(),Hj(),e2i)).Ac(e.q?e.q:(Hj(),Hj(),e2i))}function eei(e,t){return M4(t,99)&&(Pp(t,18).Bb&eH3)!=0?new x1(t,e):new eaN(t,e)}function eea(e,t){return M4(t,99)&&(Pp(t,18).Bb&eH3)!=0?new x1(t,e):new eaN(t,e)}function eeo(e,t){e4g=new e0,e4v=t,Pp((e4m=e).b,65),Jr(e4m,e4g,null),eRk(e4m)}function ees(e,t,n){var r;return r=e.g[t],Of(e,t,e.oi(t,n)),e.gi(t,n,r),e.ci(),r}function eeu(e,t){var n;return(n=e.Xc(t))>=0&&(e.$c(n),!0)}function eec(e){var t;return e.d!=e.r&&(t=evl(e),e.e=!!t&&t.Cj()==eJK,e.d=t),e.e}function eel(e,t){var n;for(Y8(e),Y8(t),n=!1;t.Ob();)n|=e.Fc(t.Pb());return n}function eef(e,t){var n;return(n=Pp(Bp(e.e,t),387))?(M5(e,n),n.e):null}function eed(e){var t,n;return(t=e/60|0,0==(n=e%60))?""+t:""+t+":"+n}function eeh(e,t){var n,r;return el3(e),r=new Xe(t,e.a),n=new IU(r),new R1(e,n)}function eep(e,t){var n=e.a[t],r=(eoW(),e0O)[typeof n];return r?r(n):euV(typeof n)}function eeb(e){switch(e.g){case 0:return eUu;case 1:return -1;default:return 0}}function eem(e){return 0>evy(e,(Q2(),e0D))?-As(eoQ(e)):e.l+e.m*eHG+e.h*eHW}function eeg(e){return null==e.__elementTypeCategory$?10:e.__elementTypeCategory$}function eev(e){var t;return null!=(t=0==e.b.c.length?null:RJ(e.b,0))&&erD(e,0),t}function eey(e,t){for(;t[0]=0;)++t[0]}function eew(e,t){this.e=t,this.a=eaJ(e),this.a<54?this.f=Kj(e):this.c=ep_(e)}function ee_(e,t,n,r){eBG(),pJ.call(this,26),this.c=e,this.a=t,this.d=n,this.b=r}function eeE(e,t,n){var r,i;for(i=0,r=10;ie.a[r]&&(r=n);return r}function eeI(e,t){var n;return 0==(n=efT(e.e.c,t.e.c))?elN(e.e.d,t.e.d):n}function eeD(e,t){return 0==t.e||0==e.e?e09:(exX(),eAl(e,t))}function eeN(e,t){if(!e)throw p7(new gL(eAL("Enum constant undefined: %s",t)))}function eeP(){eeP=A,e9v=new tp,e9y=new td,e9m=new ty,e9g=new tw,e9w=new t_}function eeR(){eeR=A,e3h=new ER("BY_SIZE",0),e3p=new ER("BY_SIZE_AND_SHAPE",1)}function eej(){eej=A,e8f=new EH("EADES",0),e8d=new EH("FRUCHTERMAN_REINGOLD",1)}function eeF(){eeF=A,teZ=new Sd("READING_DIRECTION",0),teX=new Sd("ROTATION",1)}function eeY(){eeY=A,teq=euY((eb5(),eow(vx(e4X,1),eU4,335,0,[teG,tez,teK,teV,teW])))}function eeB(){eeB=A,tsm=euY((ebG(),eow(vx(e6n,1),eU4,315,0,[tsb,tsd,tsh,tsf,tsp])))}function eeU(){eeU=A,tes=euY((ey4(),eow(vx(e4z,1),eU4,363,0,[ter,tea,teo,tei,ten])))}function eeH(){eeH=A,tnF=euY((ef_(),eow(vx(e49,1),eU4,163,0,[tnj,tnD,tnN,tnP,tnR])))}function ee$(){ee$=A,tfM=euY((eEM(),eow(vx(e6W,1),eU4,316,0,[tfE,tfS,tfT,tfk,tfx])))}function eez(){eez=A,tdb=euY((epx(),eow(vx(e6Q,1),eU4,175,0,[tdh,tdd,tdl,tdp,tdf])))}function eeG(){eeG=A,tfl=euY((eOB(),eow(vx(e6U,1),eU4,355,0,[tfo,tfa,tfu,tfs,tfc])))}function eeW(){eeW=A,e9a=euY((e_x(),eow(vx(e4k,1),eU4,356,0,[e9e,e9t,e9n,e9r,e9i])))}function eeK(){eeK=A,tpw=euY((ec3(),eow(vx(e66,1),eU4,103,0,[tpv,tpg,tpm,tpb,tpy])))}function eeV(){eeV=A,tbi=euY((epT(),eow(vx(e5n,1),eU4,249,0,[tbt,tbr,tp7,tbe,tbn])))}function eeq(){eeq=A,tbB=euY((eYu(),eow(vx(e5a,1),eGj,61,0,[tbF,tbw,tby,tbj,tbY])))}function eeZ(e,t){var n;return(n=Pp(Bp(e.a,t),134))||(n=new eX,Um(e.a,t,n)),n}function eeX(e){var t;return!!(t=Pp(e_k(e,(eBU(),ttU)),305))&&t.a==e}function eeJ(e){var t;return!!(t=Pp(e_k(e,(eBU(),ttU)),305))&&t.i==e}function eeQ(e,t){return BJ(t),FD(e),!!e.d.Ob()&&(t.td(e.d.Pb()),!0)}function ee1(e){return ecd(e,eUu)>0?eUu:0>ecd(e,eHt)?eHt:jE(e)}function ee0(e){return e<3?(enG(e,eU0),e+1):e=0&&t=-.01&&e.a<=ezs&&(e.a=0),e.b>=-.01&&e.b<=ezs&&(e.b=0),e}function ee6(e,t){return t==(I9(),I9(),e2p)?e.toLocaleLowerCase():e.toLowerCase()}function ee5(e){return((2&e.i)!=0?"interface ":(1&e.i)!=0?"":"class ")+(LW(e),e.o)}function ee8(e){var t,n;n=t=new mD,JL((e.q||(e.q=new FQ(tgi,e,11,10)),e.q),n)}function ee9(e,t){var n;return n=t>0?t-1:t,yr(yi(eny(P5(new mV,n),e.n),e.j),e.k)}function ee7(e,t,n,r){var i;e.j=-1,ex9(e,eSu(e,t,n),(_4(),(i=Pp(t,66).Mj()).Ok(r)))}function ete(e){this.g=e,this.f=new p0,this.a=eB4.Math.min(this.g.c.c,this.g.d.c)}function ett(e){this.b=new p0,this.a=new p0,this.c=new p0,this.d=new p0,this.e=e}function etn(e,t){this.a=new p2,this.e=new p2,this.b=(euJ(),tsi),this.c=e,this.b=t}function etr(e,t,n){CK.call(this),etk(this),this.a=e,this.c=n,this.b=t.d,this.f=t.e}function eti(e){this.d=e,this.c=e.c.vc().Kc(),this.b=null,this.a=null,this.e=(m6(),e0m)}function eta(e){if(e<0)throw p7(new gL("Illegal Capacity: "+e));this.g=this.ri(e)}function eto(e,t){if(0>e||e>t)throw p7(new va("fromIndex: 0, toIndex: "+e+e$m+t))}function ets(e){var t;if(e.a==e.b.a)throw p7(new bC);return t=e.a,e.c=t,e.a=e.a.e,t}function etu(e){var t;A4(!!e.c),t=e.c.a,etw(e.d,e.c),e.b==e.c?e.b=t:--e.a,e.c=null}function etc(e,t){var n;return el3(e),n=new HA(e,e.a.rd(),4|e.a.qd(),t),new R1(e,n)}function etl(e,t){var n,r;return(n=Pp(ecA(e.d,t),14))?(r=t,e.e.pc(r,n)):null}function etf(e,t){var n,r;for(r=e.Kc();r.Ob();)eo3(n=Pp(r.Pb(),70),(eBU(),tnt),t)}function etd(e){var t;return(t=gP(LV(e_k(e,(eBy(),tak)))))<0&&eo3(e,tak,t=0),t}function eth(e,t,n){var r;ev_(n,r=eB4.Math.max(0,e.b/2-.5),1),P_(t,new EJ(n,r))}function etp(e,t,n){var r;return zy(Ra(r=e.a.e[Pp(t.a,10).p]-e.a.e[Pp(n.a,10).p]))}function etb(e,t,n,r,i,a){var o;o=ZD(r),Gs(o,i),Go(o,a),exg(e.a,r,new DT(o,t,n.f))}function etm(e,t){var n;if(!(n=eAh(e.Tg(),t)))throw p7(new gL(eZV+t+eZX));return n}function etg(e,t){var n;for(n=e;z$(n);)if((n=z$(n))==t)return!0;return!1}function etv(e,t){var n,r,i;for(i=0,r=t.a.cd(),n=Pp(t.a.dd(),14).gc();i0&&(e.a/=t,e.b/=t),e}function etP(e){var t;return e.w?e.w:((t=Ww(e))&&!t.kh()&&(e.w=t),t)}function etR(e){var t;return null==e?null:e_e(t=Pp(e,190),t.length)}function etj(e,t){if(null==e.g||t>=e.i)throw p7(new xJ(t,e.i));return e.li(t,e.g[t])}function etF(e){var t,n;for(t=e.a.d.j,n=e.c.d.j;t!=n;)erC(e.b,t),t=elI(t);erC(e.b,t)}function etY(e){var t;for(t=0;t=14&&t<=16)),e}function etW(e,t,n){var r=function(){return e.apply(r,arguments)};return t.apply(r,n),r}function etK(e,t,n){var r,i;r=t;do i=gP(e.p[r.p])+n,e.p[r.p]=i,r=e.a[r.p];while(r!=t)}function etV(e,t){var n,r;r=e.a,n=elr(e,t,null),r==t||e.e||(n=eFr(e,t,n)),n&&n.Fi()}function etq(e,t){return Mc(),enj(eHe),eB4.Math.abs(e-t)<=eHe||e==t||isNaN(e)&&isNaN(t)}function etZ(e,t){return Mc(),enj(eHe),eB4.Math.abs(e-t)<=eHe||e==t||isNaN(e)&&isNaN(t)}function etX(e,t){return e_z(),ME(e.b.c.length-e.e.c.length,t.b.c.length-t.e.c.length)}function etJ(e,t){return yk(eif(e,t,jE(efn(eUJ,Ux(jE(efn(null==t?0:esj(t),eUQ)),15)))))}function etQ(){etQ=A,e9R=euY((eEn(),eow(vx(e4P,1),eU4,267,0,[e9N,e9D,e9C,e9P,e9I,e9L])))}function et1(){et1=A,tdJ=euY((eyY(),eow(vx(e64,1),eU4,291,0,[tdX,tdZ,tdq,tdK,tdW,tdV])))}function et0(){et0=A,tdD=euY((ebx(),eow(vx(e63,1),eU4,248,0,[tdM,tdL,tdC,tdI,tdO,tdA])))}function et2(){et2=A,teI=euY((eSg(),eow(vx(e4K,1),eU4,227,0,[teO,teL,teM,teA,teC,teT])))}function et3(){et3=A,ttm=euY((e_3(),eow(vx(e43,1),eU4,275,0,[ttp,ttf,ttb,tth,ttd,ttl])))}function et4(){et4=A,ttc=euY((eyd(),eow(vx(e42,1),eU4,274,0,[tto,tta,ttu,tti,tts,ttr])))}function et6(){et6=A,tst=euY((ewY(),eow(vx(e47,1),eU4,313,0,[to7,to8,to6,to5,tse,to9])))}function et5(){et5=A,te7=euY((eEf(),eow(vx(e41,1),eU4,276,0,[te4,te3,te5,te6,te9,te8])))}function et8(){et8=A,tu7=euY((eS_(),eow(vx(e6A,1),eU4,327,0,[tu9,tu4,tu5,tu6,tu8,tu3])))}function et9(){et9=A,tbv=euY((ekU(),eow(vx(e5i,1),eU4,273,0,[tbm,tbp,tbb,tbh,tbd,tbg])))}function et7(){et7=A,tpR=euY((e_a(),eow(vx(e69,1),eU4,312,0,[tpN,tpI,tpP,tpL,tpD,tpC])))}function ene(){return eT7(),eow(vx(e5t,1),eU4,93,0,[tp1,tpQ,tp2,tp8,tp5,tp6,tp3,tp4,tp0])}function ent(e,t){var n;n=e.a,e.a=t,(4&e.Db)!=0&&(1&e.Db)==0&&eam(e,new qo(e,0,n,e.a))}function enn(e,t){var n;n=e.b,e.b=t,(4&e.Db)!=0&&(1&e.Db)==0&&eam(e,new qo(e,1,n,e.b))}function enr(e,t){var n;n=e.b,e.b=t,(4&e.Db)!=0&&(1&e.Db)==0&&eam(e,new qo(e,3,n,e.b))}function eni(e,t){var n;n=e.f,e.f=t,(4&e.Db)!=0&&(1&e.Db)==0&&eam(e,new qo(e,3,n,e.f))}function ena(e,t){var n;n=e.g,e.g=t,(4&e.Db)!=0&&(1&e.Db)==0&&eam(e,new qo(e,4,n,e.g))}function eno(e,t){var n;n=e.i,e.i=t,(4&e.Db)!=0&&(1&e.Db)==0&&eam(e,new qo(e,5,n,e.i))}function ens(e,t){var n;n=e.j,e.j=t,(4&e.Db)!=0&&(1&e.Db)==0&&eam(e,new qo(e,6,n,e.j))}function enu(e,t){var n;n=e.j,e.j=t,(4&e.Db)!=0&&(1&e.Db)==0&&eam(e,new qo(e,1,n,e.j))}function enc(e,t){var n;n=e.c,e.c=t,(4&e.Db)!=0&&(1&e.Db)==0&&eam(e,new qo(e,4,n,e.c))}function enl(e,t){var n;n=e.k,e.k=t,(4&e.Db)!=0&&(1&e.Db)==0&&eam(e,new qo(e,2,n,e.k))}function enf(e,t){var n;n=e.d,e.d=t,(4&e.Db)!=0&&(1&e.Db)==0&&eam(e,new qs(e,2,n,e.d))}function end(e,t){var n;n=e.s,e.s=t,(4&e.Db)!=0&&(1&e.Db)==0&&eam(e,new qs(e,4,n,e.s))}function enh(e,t){var n;n=e.t,e.t=t,(4&e.Db)!=0&&(1&e.Db)==0&&eam(e,new qs(e,5,n,e.t))}function enp(e,t){var n;n=e.F,e.F=t,(4&e.Db)!=0&&(1&e.Db)==0&&eam(e,new FX(e,1,5,n,t))}function enb(e,t){var n;return(n=Pp(Bp((_6(),tmU),e),55))?n.xj(t):Je(e1R,eUp,1,t,5,1)}function enm(e,t){var n,r;return(n=t in e.a)&&(r=zR(e,t).he())?r.a:null}function eng(e,t){var n,r,i;return n=(r=(yT(),i=new o0),t&&eAu(r,t),r),eri(n,e),n}function env(e,t,n){if(euu(e,n),!e.Bk()&&null!=n&&!e.wj(n))throw p7(new bS);return n}function eny(e,t){return e.n=t,e.n?(e.f=new p0,e.e=new p0):(e.f=null,e.e=null),e}function enw(e,t,n,r,i,a){var o;return enA(n,o=Y5(e,t)),o.i=i?8:0,o.f=r,o.e=i,o.g=a,o}function en_(e,t,n,r,i){this.d=t,this.k=r,this.f=i,this.o=-1,this.p=1,this.c=e,this.a=n}function enE(e,t,n,r,i){this.d=t,this.k=r,this.f=i,this.o=-1,this.p=2,this.c=e,this.a=n}function enS(e,t,n,r,i){this.d=t,this.k=r,this.f=i,this.o=-1,this.p=6,this.c=e,this.a=n}function enk(e,t,n,r,i){this.d=t,this.k=r,this.f=i,this.o=-1,this.p=7,this.c=e,this.a=n}function enx(e,t,n,r,i){this.d=t,this.j=r,this.e=i,this.o=-1,this.p=4,this.c=e,this.a=n}function enT(e,t){var n,r,i,a;for(i=0,a=(r=t).length;i=0),0>ehP(e.d,e.c)&&(e.a=e.a-1&e.d.a.length-1,e.b=e.d.c),e.c=-1}function enR(e){return e.a<54?e.f<0?-1:e.f>0?1:0:(e.c||(e.c=euK(e.f)),e.c).e}function enj(e){if(!(e>=0))throw p7(new gL("tolerance ("+e+") must be >= 0"));return e}function enF(){return tdc||(tdc=new eC$,es4(tdc,eow(vx(e20,1),eUp,130,0,[new cZ]))),tdc}function enY(){enY=A,tsP=new SL(ezo,0),tsD=new SL("INPUT",1),tsN=new SL("OUTPUT",2)}function enB(){enB=A,teB=new Sl("ARD",0),teH=new Sl("MSD",1),teU=new Sl("MANUAL",2)}function enU(){enU=A,tur=new SR("BARYCENTER",0),tui=new SR(eG7,1),tua=new SR(eWe,2)}function enH(e,t){var n;if(n=e.gc(),t<0||t>n)throw p7(new Ii(t,n));return new IB(e,t)}function en$(e,t){var n;return M4(t,42)?e.c.Mc(t):(n=edG(e,t),ehx(e,t),n)}function enz(e,t,n){return eu2(e,t),er3(e,n),end(e,0),enh(e,1),els(e,!0),eli(e,!0),e}function enG(e,t){if(e<0)throw p7(new gL(t+" cannot be negative but was: "+e));return e}function enW(e,t){var n,r;for(n=0,r=e.gc();n0)?Pp(RJ(n.a,r-1),10):null}function ert(e,t){var n;n=e.k,e.k=t,(4&e.Db)!=0&&(1&e.Db)==0&&eam(e,new FX(e,1,2,n,e.k))}function ern(e,t){var n;n=e.f,e.f=t,(4&e.Db)!=0&&(1&e.Db)==0&&eam(e,new FX(e,1,8,n,e.f))}function err(e,t){var n;n=e.i,e.i=t,(4&e.Db)!=0&&(1&e.Db)==0&&eam(e,new FX(e,1,7,n,e.i))}function eri(e,t){var n;n=e.a,e.a=t,(4&e.Db)!=0&&(1&e.Db)==0&&eam(e,new FX(e,1,8,n,e.a))}function era(e,t){var n;n=e.b,e.b=t,(4&e.Db)!=0&&(1&e.Db)==0&&eam(e,new FX(e,1,0,n,e.b))}function ero(e,t){var n;n=e.b,e.b=t,(4&e.Db)!=0&&(1&e.Db)==0&&eam(e,new FX(e,1,0,n,e.b))}function ers(e,t){var n;n=e.c,e.c=t,(4&e.Db)!=0&&(1&e.Db)==0&&eam(e,new FX(e,1,1,n,e.c))}function eru(e,t){var n;n=e.c,e.c=t,(4&e.Db)!=0&&(1&e.Db)==0&&eam(e,new FX(e,1,1,n,e.c))}function erc(e,t){var n;n=e.c,e.c=t,(4&e.Db)!=0&&(1&e.Db)==0&&eam(e,new FX(e,1,4,n,e.c))}function erl(e,t){var n;n=e.d,e.d=t,(4&e.Db)!=0&&(1&e.Db)==0&&eam(e,new FX(e,1,1,n,e.d))}function erf(e,t){var n;n=e.D,e.D=t,(4&e.Db)!=0&&(1&e.Db)==0&&eam(e,new FX(e,1,2,n,e.D))}function erd(e,t){e.r>0&&e.c0&&0!=e.g&&erd(e.i,t/e.r*e.i.d))}function erh(e,t,n){var r;e.b=t,e.a=n,r=(512&e.a)==512?new mU:new u7,e.c=eLV(r,e.b,e.a)}function erp(e,t){return eLt(e.e,t)?(_4(),eec(t)?new RA(t,e):new xe(t,e)):new xr(t,e)}function erb(e,t){return yS(eid(e.a,t,jE(efn(eUJ,Ux(jE(efn(null==t?0:esj(t),eUQ)),15)))))}function erm(e,t,n){return Qz(e,new f8(t),new ea,new f9(n),eow(vx(e2L,1),eU4,132,0,[]))}function erg(e){var t,n;return 0>e?new _e:(t=e+1,n=new Zi(t,e),new L0(null,n))}function erv(e,t){var n;return Hj(),n=new w9(1),xd(e)?Ge(n,e,t):eS8(n.f,e,t),new f$(n)}function ery(e,t){var n,r;return(n=e.o+e.p)<(r=t.o+t.p)?-1:n==r?0:1}function erw(e){var t;return(t=e_k(e,(eBU(),tnc)),M4(t,160))?edo(Pp(t,160)):null}function er_(e){var t;return(t=esi(e=eB4.Math.max(e,2)),e>t)?(t<<=1)>0?t:eU2:t}function erE(e){switch(OZ(3!=e.e),e.e){case 2:return!1;case 0:return!0}return Zk(e)}function erS(e,t){var n;return!!M4(t,8)&&(n=Pp(t,8),e.a==n.a&&e.b==n.b)}function erk(e,t,n){var r,i,a;return a=t>>5,i=31&t,r=WM(Fy(e.n[n][a],jE(Fg(i,1))),3)}function erx(e,t){var n,r;for(r=t.vc().Kc();r.Ob();)evQ(e,(n=Pp(r.Pb(),42)).cd(),n.dd())}function erT(e,t){var n;n=new e0,Pp(t.b,65),Pp(t.b,65),Pp(t.b,65),ety(t.a,new N8(e,n,t))}function erM(e,t){var n;n=e.b,e.b=t,(4&e.Db)!=0&&(1&e.Db)==0&&eam(e,new FX(e,1,21,n,e.b))}function erO(e,t){var n;n=e.d,e.d=t,(4&e.Db)!=0&&(1&e.Db)==0&&eam(e,new FX(e,1,11,n,e.d))}function erA(e,t){var n;n=e.j,e.j=t,(4&e.Db)!=0&&(1&e.Db)==0&&eam(e,new FX(e,1,13,n,e.j))}function erL(e,t,n){var r,i,a;for(a=e.a.length-1,i=e.b,r=0;r>>31;0!=r&&(e[n]=r)}function eip(e,t){var n,r;for(Hj(),r=new p0,n=0;n0&&(this.g=this.ri(this.i+(this.i/8|0)+1),e.Qc(this.g))}function eiR(e,t){PJ.call(this,tgd,e,t),this.b=this,this.a=eAY(e.Tg(),ee2(this.e.Tg(),this.c))}function eij(e,t){var n,r;for(BJ(t),r=t.vc().Kc();r.Ob();)n=Pp(r.Pb(),42),e.zc(n.cd(),n.dd())}function eiF(e,t,n){var r;for(r=n.Kc();r.Ob();)if(!Vq(e,t,r.Pb()))return!1;return!0}function eiY(e,t,n,r,i){var a;return n&&(a=edv(t.Tg(),e.c),i=n.gh(t,-1-(-1==a?r:a),null,i)),i}function eiB(e,t,n,r,i){var a;return n&&(a=edv(t.Tg(),e.c),i=n.ih(t,-1-(-1==a?r:a),null,i)),i}function eiU(e){var t;if(-2==e.b){if(0==e.e)t=-1;else for(t=0;0==e.a[t];t++);e.b=t}return e.b}function eiH(e){switch(e.g){case 2:return eYu(),tbY;case 4:return eYu(),tby;default:return e}}function ei$(e){switch(e.g){case 1:return eYu(),tbj;case 3:return eYu(),tbw;default:return e}}function eiz(e){var t,n,r;return e.j==(eYu(),tbw)&&(t=eTt(e),n=Aa(t,tby),(r=Aa(t,tbY))||r&&n)}function eiG(e){var t,n;return t=Pp(e.e&&e.e(),9),n=Pp(YR(t,t.length),9),new I1(t,n,t.length)}function eiW(e,t){ewG(t,eG8,1),efJ(_p(new dp((__(),new U7(e,!1,!1,new tO))))),eEj(t)}function eiK(e,t){return OQ(),xd(e)?ZZ(e,Lq(t)):xf(e)?F_(e,LV(t)):xl(e)?Fw(e,LK(t)):e.wd(t)}function eiV(e,t){t.q=e,e.d=eB4.Math.max(e.d,t.r),e.b+=t.d+(0==e.a.c.length?0:e.c),P_(e.a,t)}function eiq(e,t){var n,r,i,a;return i=e.c,n=e.c+e.b,a=e.d,r=e.d+e.a,t.a>i&&t.aa&&t.b1||e.Ob())return++e.a,e.g=0,t=e.i,e.Ob(),t;throw p7(new bC)}function eaA(e){var t;return Ma(),En(tuT,e)||((t=new af).a=e,CM(tuT,e,t)),Pp(UA(tuT,e),635)}function eaL(e){var t,n,r,i;return r=0,(i=e)<0&&(i+=eHW,r=eH$),n=zy(i/eHG),Mk(t=zy(i-n*eHG),n,r)}function eaC(e){var t,n,r;for(r=0,n=new _t(e.a);n.aecd(e,0)&&(e=PN(e)),64-(0!=(t=jE(Fv(e,32)))?exv(t):exv(jE(e))+32)}function eaQ(e){var t;return t=Pp(e_k(e,(eBU(),tt1)),61),e.k==(eEn(),e9C)&&(t==(eYu(),tbY)||t==tby)}function ea1(e,t,n){var r,i;(i=Pp(e_k(e,(eBy(),taR)),74))&&(eu_(r=new mE,0,i),etH(r,n),er7(t,r))}function ea0(e,t,n){var r,i,a,o;r=(o=Bq(e)).d,i=o.c,a=e.n,t&&(a.a=a.a-r.b-i.a),n&&(a.b=a.b-r.d-i.b)}function ea2(e,t){var n,r;return(n=e.j)!=(r=t.j)?n.g-r.g:e.p==t.p?0:n==(eYu(),tbw)?e.p-t.p:t.p-e.p}function ea3(e){var t,n;for(eYp(e),n=new fz(e.d);n.a>22),i=e.h+t.h+(r>>22),Mk(n&eHH,r&eHH,i&eH$)}function eor(e,t){var n,r,i;return n=e.l-t.l,r=e.m-t.m+(n>>22),i=e.h-t.h+(r>>22),Mk(n&eHH,r&eHH,i&eH$)}function eoi(e){var t;return e<128?((t=(RH(),e0Y)[e])||(t=e0Y[e]=new fA(e)),t):new fA(e)}function eoa(e){var t;return M4(e,78)?e:((t=e&&e.__java$exception)||(t=new euq(e),by(t)),t)}function eoo(e){if(M4(e,186))return Pp(e,118);if(e)return null;throw p7(new gD(eXR))}function eos(e,t){if(null==t)return!1;for(;e.a!=e.b;)if(ecX(t,ecn(e)))return!0;return!1}function eou(e){return!!e.a.Ob()||e.a==e.d&&(e.a=new KU(e.e.f),e.a.Ob())}function eoc(e,t){var n,r;return 0!=(r=(n=t.Pc()).length)&&(PO(e.c,e.c.length,n),!0)}function eol(e,t,n){var r,i;for(i=t.vc().Kc();i.Ob();)r=Pp(i.Pb(),42),e.yc(r.cd(),r.dd(),n);return e}function eof(e,t){var n,r;for(r=new fz(e.b);r.a=0,"Negative initial capacity"),PG(t>=0,"Non-positive load factor"),Yy(this)}function eoV(e,t,n){return!(e>=128)&&(e<64?xg(WM(Fg(1,e),n),0):xg(WM(Fg(1,e-64),t),0))}function eoq(e,t){return!!e&&!!t&&e!=t&&0>efT(e.b.c,t.b.c+t.b.b)&&0>efT(t.b.c,e.b.c+e.b.b)}function eoZ(e){var t,n,r;return n=e.n,r=e.o,t=e.d,new Hr(n.a-t.b,n.b-t.d,r.a+(t.b+t.c),r.b+(t.d+t.a))}function eoX(e){var t,n,r,i;for(n=e.a,r=0,i=n.length;r(r=e.gc()))throw p7(new Ii(t,r));return e.hi()&&(n=zG(e,n)),e.Vh(t,n)}function eo2(e,t,n){return null==n?(e.q||(e.q=new p2),Z3(e.q,t)):(e.q||(e.q=new p2),Um(e.q,t,n)),e}function eo3(e,t,n){return null==n?(e.q||(e.q=new p2),Z3(e.q,t)):(e.q||(e.q=new p2),Um(e.q,t,n)),e}function eo4(e){var t,n;return n=new Z6,eaW(n,e),eo3(n,(erV(),e8j),e),t=new p2,eNY(e,n,t),eFS(e,n,t),n}function eo6(e){var t,n,r;for(eLG(),n=Je(e60,eUP,8,2,0,1),r=0,t=0;t<2;t++)r+=.5,n[t]=emh(r,e);return n}function eo5(e,t){var n,r,i,a;for(a=0,n=!1,r=e.a[t].length;a>=1);return t}function esa(e){var t,n;return 32==(n=exv(e.h))?32==(t=exv(e.m))?exv(e.l)+32:t+20-10:n-12}function eso(e){var t;return null==(t=e.a[e.b])?null:(Bc(e.a,e.b,null),e.b=e.b+1&e.a.length-1,t)}function ess(e){var t,n;return t=e.t-e.k[e.o.p]*e.d+e.j[e.o.p]>e.f,n=e.u+e.e[e.o.p]*e.d>e.f*e.s*e.d,t||n}function esu(e,t,n){var r,i;return r=new Js(t,n),i=new H,e.b=eLg(e,e.b,r,i),i.b||++e.c,e.b.b=!1,i.d}function esc(e,t,n){var r,i,a,o;for(o=ecZ(t,n),a=0,i=o.Kc();i.Ob();)r=Pp(i.Pb(),11),Um(e.c,r,ell(a++))}function esl(e){var t,n;for(n=new fz(e.a.b);n.an&&(n=e[t]);return n}function esg(e,t,n){var r;return r=new p0,eA0(e,t,r,(eYu(),tby),!0,!1),eA0(e,n,r,tbY,!1,!1),r}function esv(e,t,n){var r,i,a,o;return a=null,i=Kq(o=t,"labels"),a=(eT2((r=new kG(e,n)).a,r.b,i),i)}function esy(e,t,n,r){var i;return!(!(i=eMv(e,t,n,r))&&(i=elh(e,n,r)))||eR3(e,t,i)?i:null}function esw(e,t,n,r){var i;return!(!(i=eMy(e,t,n,r))&&(i=elp(e,n,r)))||eR3(e,t,i)?i:null}function es_(e,t){var n;for(n=0;n1||t>=0&&e.b<3)}function esP(e){var t,n,r;for(t=new mE,r=epL(e,0);r.b!=r.d.c;)n=Pp(Vv(r),8),Ls(t,0,new TS(n));return t}function esR(e){var t,n;for(n=new fz(e.a.b);n.ar?1:0}function esJ(e,t){return!!eO2(e,t)&&(exg(e.b,Pp(e_k(t,(eBU(),ttX)),21),t),P7(e.a,t),!0)}function esQ(e){var t,n;(t=Pp(e_k(e,(eBU(),tng)),10))&&(QA((n=t.c).a,t),0==n.a.c.length&&QA(Bq(t).b,n))}function es1(e){return e2M?Je(e2k,e$_,572,0,0,1):Pp(epg(e.a,Je(e2k,e$_,572,e.a.c.length,0,1)),842)}function es0(e,t,n,r){return U_(),new gt(eow(vx(e1$,1),eUK,42,0,[(eb2(e,t),new wD(e,t)),(eb2(n,r),new wD(n,r))]))}function es2(e,t,n){var r,i;return enz(i=r=new mD,t,n),JL((e.q||(e.q=new FQ(tgi,e,11,10)),e.q),i),i}function es3(e){var t,n,r,i;for(t=0,r=Je(e17,eUP,2,n=(i=Eo(tmx,e)).length,6,1);t=e.b.c.length)&&(es5(e,2*t+1),(n=2*t+2)=0&&e[r]===t[r];r--);return r<0?0:Ei(WM(e[r],eH9),WM(t[r],eH9))?-1:1}function es7(e,t){var n,r;for(r=epL(e,0);r.b!=r.d.c;)(n=Pp(Vv(r),214)).e.length>0&&(t.td(n),n.i&&elk(n))}function eue(e,t){var n,r;return r=Pp(eaS(e.a,4),126),n=Je(e5N,eJM,415,t,0,1),null!=r&&ePD(r,0,n,0,r.length),n}function eut(e,t){var n;return n=new eCg((256&e.f)!=0,e.i,e.a,e.d,(16&e.f)!=0,e.j,e.g,t),null!=e.e||(n.c=e),n}function eun(e,t){var n,r;for(r=e.Zb().Cc().Kc();r.Ob();)if((n=Pp(r.Pb(),14)).Hc(t))return!0;return!1}function eur(e,t,n,r,i){var a,o;for(o=n;o<=i;o++)for(a=t;a<=r;a++)if(emy(e,a,o))return!0;return!1}function eui(e,t,n){var r,i,a,o;for(BJ(n),o=!1,a=e.Zc(t),i=n.Kc();i.Ob();)r=i.Pb(),a.Rb(r),o=!0;return o}function eua(e,t){var n;return e===t||!!M4(t,83)&&(n=Pp(t,83),eEB(Fc(e),n.vc()))}function euo(e,t,n){var r,i;for(i=n.Kc();i.Ob();)if(r=Pp(i.Pb(),42),e.re(t,r.dd()))return!0;return!1}function eus(e,t,n){return e.d[t.p][n.p]||(ebp(e,t,n),e.d[t.p][n.p]=!0,e.d[n.p][t.p]=!0),e.a[t.p][n.p]}function euu(e,t){if(!e.ai()&&null==t)throw p7(new gL("The 'no null' constraint is violated"));return t}function euc(e,t){null==e.D&&null!=e.B&&(e.D=e.B,e.B=null),erf(e,null==t?null:(BJ(t),t)),e.C&&e.yk(null)}function eul(e,t){var n;return!!(e&&e!=t&&Ln(t,(eBU(),tt9)))&&(n=Pp(e_k(t,(eBU(),tt9)),10))!=e}function euf(e){switch(e.i){case 2:return!0;case 1:return!1;case -1:++e.c;default:return e.pl()}}function eud(e){switch(e.i){case -2:return!0;case -1:return!1;case 1:--e.c;default:return e.ql()}}function euh(e){zL.call(this,"The given string does not match the expected format for individual spacings.",e)}function eup(){eup=A,tmr=new kN("ELK",0),tmi=new kN("JSON",1),tmn=new kN("DOT",2),tma=new kN("SVG",3)}function eub(){eub=A,tc6=new S3(eGR,0),tc5=new S3("RADIAL_COMPACTION",1),tc8=new S3("WEDGE_COMPACTION",2)}function eum(){eum=A,e2B=new Ed("CONCURRENT",0),e2U=new Ed("IDENTITY_FINISH",1),e2H=new Ed("UNORDERED",2)}function eug(){eug=A,e5q=(_y(),e5G),e5V=new xX(ezj,e5q),e5K=new pO(ezF),e5Z=new pO(ezY),e5X=new pO(ezB)}function euv(){euv=A,e72=new n1,e73=new n0,e70=new n2,e71=new n3,e7J=(BJ(e7Q=new n4),new P)}function euy(){euy=A,tsz=new SD("CONSERVATIVE",0),tsG=new SD("CONSERVATIVE_SOFT",1),tsW=new SD("SLOPPY",2)}function euw(){euw=A,tpH=new T3(15),tpU=new T2((eBB(),thN),tpH),tp$=th3,tpj=td3,tpF=thx,tpB=thO,tpY=thM}function eu_(e,t,n){var r,i,a;for(r=new _n,a=epL(n,0);a.b!=a.d.c;)i=Pp(Vv(a),8),P7(r,new TS(i));eui(e,t,r)}function euE(e){var t,n,r;for(t=0,r=Je(e60,eUP,8,e.b,0,1),n=epL(e,0);n.b!=n.d.c;)r[t++]=Pp(Vv(n),8);return r}function euS(e){var t;return 0!=(t=(e.a||(e.a=new FQ(tgn,e,9,5)),e.a)).i?_K(Pp(etj(t,0),678)):null}function euk(e,t){var n;return(n=eft(e,t),Ei(WA(e,t),0)|xm(WA(e,n),0))?n:eft(eUY,WA(Fy(n,63),1))}function eux(e,t){var n;n=null!=epB((edk(),to3))&&null!=t.wg()?gP(LV(t.wg()))/gP(LV(epB(to3))):1,Um(e.b,t,n)}function euT(e,t){var n,r;return(n=Pp(e.d.Bc(t),14))?((r=e.e.hc()).Gc(n),e.e.d-=n.gc(),n.$b(),r):null}function euM(e,t){var n,r;if(0!=(r=e.c[t]))for(e.c[t]=0,e.d-=r,n=t+1;n0)return FP(t-1,e.a.c.length),ZV(e.a,t-1);throw p7(new bL)}function euA(e,t,n){if(t<0)throw p7(new gE(eq1+t));tt)throw p7(new gL(e$x+e+e$T+t));if(e<0||t>n)throw p7(new va(e$x+e+e$M+t+e$m+n))}function euC(e){if(!e.a||(8&e.a.i)==0)throw p7(new gC("Enumeration class expected for layout option "+e.f))}function euI(e){var t;++e.j,0==e.i?e.g=null:e.ieVq?e-n>eVq:n-e>eVq)}function euG(e,t){return!e||t&&!e.j||M4(e,124)&&0==Pp(e,124).a.b?0:e.Re()}function euW(e,t){return!e||t&&!e.k||M4(e,124)&&0==Pp(e,124).a.a?0:e.Se()}function euK(e){return(eLQ(),e<0)?-1!=e?new ep4(-1,-e):e03:e<=10?e06[zy(e)]:new ep4(1,e)}function euV(e){throw eoW(),p7(new gs("Unexpected typeof result '"+e+"'; please report this bug to the GWT team"))}function euq(e){g0(),MV(this),HD(this),this.e=e,eA8(this,e),this.g=null==e?eUg:efF(e),this.a="",this.b=e,this.a=""}function euZ(){this.a=new a4,this.f=new hW(this),this.b=new hK(this),this.i=new hV(this),this.e=new hq(this)}function euX(){m5.call(this,new Ju(ee0(16))),enG(2,eUN),this.b=2,this.a=new Uc(null,null,0,null),bp(this.a,this.a)}function euJ(){euJ=A,tsn=new SS("DUMMY_NODE_OVER",0),tsr=new SS("DUMMY_NODE_UNDER",1),tsi=new SS("EQUAL",2)}function euQ(){euQ=A,e9u=zD(eow(vx(e66,1),eU4,103,0,[(ec3(),tpm),tpg])),e9c=zD(eow(vx(e66,1),eU4,103,0,[tpy,tpb]))}function eu1(e){return(eYu(),tbC).Hc(e.j)?gP(LV(e_k(e,(eBU(),tnM)))):esp(eow(vx(e60,1),eUP,8,0,[e.i.n,e.n,e.a])).b}function eu0(e){var t,n,r,i;for(n=(r=e.b.a).a.ec().Kc();n.Ob();)t=Pp(n.Pb(),561),i=new eMq(t,e.e,e.f),P_(e.g,i)}function eu2(e,t){var n,r,i;r=e.nk(t,null),i=null,t&&(i=(yO(),n=new p6),etV(i,e.r)),(r=ew3(e,i,r))&&r.Fi()}function eu3(e,t){var n,r;for(r=0!=eMU(e.d,1),n=!0;n;)n=!1,n=t.c.Tf(t.e,r),n|=eAb(e,t,r,!1),r=!r;er0(e)}function eu4(e,t){var n,r,i;return r=!1,n=t.q.d,t.di&&(eyC(t.q,i),r=n!=t.q.d)),r}function eu6(e,t){var n,r,i,a,o,s,u,c;return u=t.i,c=t.j,i=(r=e.f).i,a=r.j,o=u-i,s=c-a,n=eB4.Math.sqrt(o*o+s*s)}function eu5(e,t){var n,r;return(r=ehO(e))||(tmT||(tmT=new sh),n=(eRe(),eSR(t)),JL((r=new pq(n)).Vk(),e)),r}function eu8(e,t){var n,r;return(n=Pp(e.c.Bc(t),14))?((r=e.hc()).Gc(n),e.d-=n.gc(),n.$b(),e.mc(r)):e.jc()}function eu9(e,t){var n;for(n=0;n=e.c.b:e.a<=e.c.b))throw p7(new bC);return t=e.a,e.a+=e.c.c,++e.b,ell(t)}function eci(e){var t;return t=new ete(e),Kv(e.a,e9w,new g$(eow(vx(e4M,1),eUp,369,0,[t]))),t.d&&P_(t.f,t.d),t.f}function eca(e){var t;return eaW(t=new MA(e.a),e),eo3(t,(eBU(),tnc),e),t.o.a=e.g,t.o.b=e.f,t.n.a=e.i,t.n.b=e.j,t}function eco(e,t,n,r){var i,a;for(a=e.Kc();a.Ob();)(i=Pp(a.Pb(),70)).n.a=t.a+(r.a-i.o.a)/2,i.n.b=t.b,t.b+=i.o.b+n}function ecs(e,t,n){var r,i;for(i=t.a.a.ec().Kc();i.Ob();)if($o(e,r=Pp(i.Pb(),57),n))return!0;return!1}function ecu(e){var t,n;for(n=new fz(e.r);n.a=0?t:-t;r>0;)r%2==0?(n*=n,r=r/2|0):(i*=n,r-=1);return t<0?1/i:i}function ecw(e,t){var n,r,i;for(i=1,n=e,r=t>=0?t:-t;r>0;)r%2==0?(n*=n,r=r/2|0):(i*=n,r-=1);return t<0?1/i:i}function ec_(e){var t,n,r,i;if(null!=e){for(n=0;n0&&esJ(n=Pp(RJ(e.a,e.a.c.length-1),570),t))&&P_(e.a,new Zn(t))}function ecP(e){var t,n;Dj(),t=e.d.c-e.e.c,ety((n=Pp(e.g,145)).b,new d7(t)),ety(n.c,new he(t)),qX(n.i,new ht(t))}function ecR(e){var t;return t=new vc,t.a+="VerticalSegment ",xT(t,e.e),t.a+=" ",xM(t,OU(new ve,new fz(e.k))),t.a}function ecj(e){var t;return(t=Pp(eef(e.c.c,""),229))||(t=new GM(v3(v2(new of,""),"Other")),epy(e.c.c,"",t)),t}function ecF(e){var t;return(64&e.Db)!=0?eMT(e):(t=new O1(eMT(e)),t.a+=" (name: ",xk(t,e.zb),t.a+=")",t.a)}function ecY(e,t,n){var r,i;return i=e.sb,e.sb=t,(4&e.Db)!=0&&(1&e.Db)==0&&(r=new FX(e,1,4,i,t),n?n.Ei(r):n=r),n}function ecB(e,t){var n,r,i;for(n=0,i=efr(e,t).Kc();i.Ob();)n+=null!=e_k(r=Pp(i.Pb(),11),(eBU(),tng))?1:0;return n}function ecU(e,t,n){var r,i,a;for(r=0,a=epL(e,0);a.b!=a.d.c&&!((i=gP(LV(Vv(a))))>n);)i>=t&&++r;return r}function ecH(e,t,n){var r,i;return r=new Q$(e.e,3,13,null,(i=t.c)||(eBK(),tgA),ebv(e,t),!1),n?n.Ei(r):n=r,n}function ec$(e,t,n){var r,i;return r=new Q$(e.e,4,13,(i=t.c)||(eBK(),tgA),null,ebv(e,t),!1),n?n.Ei(r):n=r,n}function ecz(e,t,n){var r,i;return i=e.r,e.r=t,(4&e.Db)!=0&&(1&e.Db)==0&&(r=new FX(e,1,8,i,e.r),n?n.Ei(r):n=r),n}function ecG(e,t){var n,r;return(r=(n=Pp(t,676)).vk())||n.wk(r=M4(t,88)?new k8(e,Pp(t,26)):new Ke(e,Pp(t,148))),r}function ecW(e,t,n){var r;e.qi(e.i+1),r=e.oi(t,n),t!=e.i&&ePD(e.g,t,e.g,t+1,e.i-t),Bc(e.g,t,r),++e.i,e.bi(t,n),e.ci()}function ecK(e,t){var n;return t.a&&(n=t.a.a.length,e.a?xM(e.a,e.b):e.a=new O0(e.d),Ka(e.a,t.a,t.d.length,n)),e}function ecV(e,t){var n,r,i,a;if(t.vi(e.a),null!=(a=Pp(eaS(e.a,8),1936)))for(r=0,i=(n=a).length;rn)throw p7(new gE(e$x+e+e$M+t+", size: "+n));if(e>t)throw p7(new gL(e$x+e+e$T+t))}function ec5(e,t,n){if(t<0)ekN(e,n);else{if(!n.Ij())throw p7(new gL(eZV+n.ne()+eZq));Pp(n,66).Nj().Vj(e,e.yh(),t)}}function ec8(e,t,n,r,i,a,o,s){var u;for(u=n;a=r||t=s.ue(e[t],e[u])?Bc(i,a++,e[t++]):Bc(i,a++,e[u++])}function ec9(e,t,n,r,i,a){this.e=new p0,this.f=(enY(),tsP),P_(this.e,e),this.d=t,this.a=n,this.b=r,this.f=i,this.c=a}function ec7(e,t){var n,r;for(r=new Ow(e);r.e!=r.i.gc();)if(n=Pp(epH(r),26),xc(t)===xc(n))return!0;return!1}function ele(e){var t,n,r,i;for(eBW(),n=epE(),r=0,i=n.length;r=65&&e<=70?e-65+10:e>=97&&e<=102?e-97+10:e>=48&&e<=57?e-48:0}function eln(e){var t;return(64&e.Db)!=0?eMT(e):(t=new O1(eMT(e)),t.a+=" (source: ",xk(t,e.d),t.a+=")",t.a)}function elr(e,t,n){var r,i;return i=e.a,e.a=t,(4&e.Db)!=0&&(1&e.Db)==0&&(r=new FX(e,1,5,i,e.a),n?ey7(n,r):n=r),n}function eli(e,t){var n;n=(256&e.Bb)!=0,t?e.Bb|=256:e.Bb&=-257,(4&e.Db)!=0&&(1&e.Db)==0&&eam(e,new ZB(e,1,2,n,t))}function ela(e,t){var n;n=(256&e.Bb)!=0,t?e.Bb|=256:e.Bb&=-257,(4&e.Db)!=0&&(1&e.Db)==0&&eam(e,new ZB(e,1,8,n,t))}function elo(e,t){var n;n=(256&e.Bb)!=0,t?e.Bb|=256:e.Bb&=-257,(4&e.Db)!=0&&(1&e.Db)==0&&eam(e,new ZB(e,1,8,n,t))}function els(e,t){var n;n=(512&e.Bb)!=0,t?e.Bb|=512:e.Bb&=-513,(4&e.Db)!=0&&(1&e.Db)==0&&eam(e,new ZB(e,1,3,n,t))}function elu(e,t){var n;n=(512&e.Bb)!=0,t?e.Bb|=512:e.Bb&=-513,(4&e.Db)!=0&&(1&e.Db)==0&&eam(e,new ZB(e,1,9,n,t))}function elc(e,t){var n;return -1==e.b&&e.a&&(n=e.a.Gj(),e.b=n?e.c.Xg(e.a.aj(),n):edv(e.c.Tg(),e.a)),e.c.Og(e.b,t)}function ell(e){var t,n;return e>-129&&e<128?(t=e+128,(n=(Rv(),e0B)[t])||(n=e0B[t]=new fC(e)),n):new fC(e)}function elf(e){var t,n;return e>-129&&e<128?(t=e+128,(n=(RU(),e0K)[t])||(n=e0K[t]=new fD(e)),n):new fD(e)}function eld(e){var t,n;return(t=e.k)==(eEn(),e9C)&&((n=Pp(e_k(e,(eBU(),tt1)),61))==(eYu(),tbw)||n==tbj)}function elh(e,t,n){var r,i,a;return(a=i=eMC(e.b,t))&&(r=Pp(eP8(Qq(e,a),""),26))?eMv(e,r,t,n):null}function elp(e,t,n){var r,i,a;return(a=i=eMC(e.b,t))&&(r=Pp(eP8(Qq(e,a),""),26))?eMy(e,r,t,n):null}function elb(e,t){var n,r;for(r=new Ow(e);r.e!=r.i.gc();)if(n=Pp(epH(r),138),xc(t)===xc(n))return!0;return!1}function elm(e,t,n){var r;if(t>(r=e.gc()))throw p7(new Ii(t,r));if(e.hi()&&e.Hc(n))throw p7(new gL(eXB));e.Xh(t,n)}function elg(e,t){var n;if(null==(n=etJ(e.i,t)))throw p7(new gK("Node did not exist in input."));return eiX(t,n),null}function elv(e,t){var n;if(n=eAh(e,t),M4(n,322))return Pp(n,34);throw p7(new gL(eZV+t+"' is not a valid attribute"))}function ely(e,t,n){var r,i;for(r=0,i=M4(t,99)&&(Pp(t,18).Bb&eH3)!=0?new x1(t,e):new eaN(t,e);rt?1:e==t?0==e?elN(1/e,1/t):0:isNaN(e)?isNaN(t)?0:1:-1}function elP(e,t){ewG(t,"Sort end labels",1),_r(UJ(eeh(new R1(null,new Gq(e.b,16)),new t2),new t3),new t4),eEj(t)}function elR(e,t,n){var r,i;return e.ej()?(i=e.fj(),r=exm(e,t,n),e.$i(e.Zi(7,ell(n),r,t,i)),r):exm(e,t,n)}function elj(e,t){var n,r,i;null==e.d?(++e.e,--e.f):(i=t.cd(),r=((n=t.Sh())&eUu)%e.d.length,Xc(e,r,eML(e,r,n,i)))}function elF(e,t){var n;n=(e.Bb&eXt)!=0,t?e.Bb|=eXt:e.Bb&=-1025,(4&e.Db)!=0&&(1&e.Db)==0&&eam(e,new ZB(e,1,10,n,t))}function elY(e,t){var n;n=(e.Bb&eH0)!=0,t?e.Bb|=eH0:e.Bb&=-4097,(4&e.Db)!=0&&(1&e.Db)==0&&eam(e,new ZB(e,1,12,n,t))}function elB(e,t){var n;n=(e.Bb&eJV)!=0,t?e.Bb|=eJV:e.Bb&=-8193,(4&e.Db)!=0&&(1&e.Db)==0&&eam(e,new ZB(e,1,15,n,t))}function elU(e,t){var n;n=(e.Bb&eJq)!=0,t?e.Bb|=eJq:e.Bb&=-2049,(4&e.Db)!=0&&(1&e.Db)==0&&eam(e,new ZB(e,1,11,n,t))}function elH(e,t){var n;return 0!=(n=elN(e.b.c,t.b.c))||0!=(n=elN(e.a.a,t.a.a))?n:elN(e.a.b,t.a.b)}function el$(e,t){var n;if(null==(n=Bp(e.k,t)))throw p7(new gK("Port did not exist in input."));return eiX(t,n),null}function elz(e){var t,n;for(n=eM$(etP(e)).Kc();n.Ob();)if(eDM(e,t=Lq(n.Pb())))return qb((_X(),tgh),t);return null}function elG(e,t){var n,r,i,a,o;for(i=0,o=eAY(e.e.Tg(),t),a=0,n=Pp(e.g,119);i>10)+eH4&eHd,t[1]=(1023&e)+56320&eHd,ehv(t,0,t.length)}function el0(e){var t,n;return(n=Pp(e_k(e,(eBy(),tal)),103))==(ec3(),tpv)?(t=gP(LV(e_k(e,tiX))))>=1?tpg:tpb:n}function el2(e){switch(Pp(e_k(e,(eBy(),tag)),218).g){case 1:return new ig;case 3:return new iE;default:return new im}}function el3(e){if(e.c)el3(e.c);else if(e.d)throw p7(new gC("Stream already terminated, can't be modified or used"))}function el4(e){var t;return(64&e.Db)!=0?eMT(e):(t=new O1(eMT(e)),t.a+=" (identifier: ",xk(t,e.k),t.a+=")",t.a)}function el6(e,t,n){var r,i;return r=(yT(),i=new oJ),ent(r,t),enn(r,n),e&&JL((e.a||(e.a=new O_(e5h,e,5)),e.a),r),r}function el5(e,t,n,r){var i,a;return BJ(r),BJ(n),null==(a=null==(i=e.xc(t))?n:_i(Pp(i,15),Pp(n,14)))?e.Bc(t):e.zc(t,a),a}function el8(e){var t,n,r,i;return n=(t=Pp(yw((i=(r=e.gm).f)==e1G?r:i),9),new I1(t,Pp(CY(t,t.length),9),0)),erC(n,e),n}function el9(e,t,n){var r,i;for(i=e.a.ec().Kc();i.Ob();)if(r=Pp(i.Pb(),10),eot(n,Pp(RJ(t,r.p),14)))return r;return null}function el7(e,t,n){var r;try{esE(e,t,n)}catch(i){if(i=eoa(i),M4(i,597))throw r=i,p7(new Zt(r));throw p7(i)}return t}function efe(e,t){var n;return Ts(e)&&Ts(t)&&eHV<(n=e-t)&&n>1,e.k=n-1>>1}function efo(){var e,t,n;ewP(),n=e2w+++Date.now(),e=zy(eB4.Math.floor(n*e$h))&e$b,t=zy(n-e*e$p),this.a=1502^e,this.b=t^e$d}function efs(e){var t,n,r;for(t=new p0,r=new fz(e.j);r.a34028234663852886e22?eHQ:t<-34028234663852886e22?eH1:t}function efp(e){return e-=e>>1&1431655765,e=((e=(e>>2&858993459)+(858993459&e))>>4)+e&252645135,e+=e>>8,63&(e+=e>>16)}function efb(e){var t,n,r,i;for(t=new CS(e.Hd().gc()),i=0,r=JJ(e.Hd().Kc());r.Ob();)Gr(t,n=r.Pb(),ell(i++));return eEA(t.a)}function efm(e,t){var n,r,i;for(i=new p2,r=t.vc().Kc();r.Ob();)Um(i,(n=Pp(r.Pb(),42)).cd(),eab(e,Pp(n.dd(),15)));return i}function efg(e,t){0==e.n.c.length&&P_(e.n,new zO(e.s,e.t,e.i)),P_(e.b,t),eml(Pp(RJ(e.n,e.n.c.length-1),211),t),eNk(e,t)}function efv(e){return(e.c!=e.b.b||e.i!=e.g.b)&&(e.a.c=Je(e1R,eUp,1,0,5,1),eoc(e.a,e.b),eoc(e.a,e.g),e.c=e.b.b,e.i=e.g.b),e.a}function efy(e,t){var n,r,i;for(i=0,r=Pp(t.Kb(e),20).Kc();r.Ob();)gN(LK(e_k(n=Pp(r.Pb(),17),(eBU(),tnE))))||++i;return i}function efw(e,t){var n,r,i;i=gP(LV(ed$(r=KT(t),(eBy(),toO)))),ev_(t,n=eB4.Math.max(0,i/2-.5),1),P_(e,new E8(t,n))}function ef_(){ef_=A,tnj=new ST(eGR,0),tnD=new ST("FIRST",1),tnN=new ST(eWi,2),tnP=new ST("LAST",3),tnR=new ST(eWa,4)}function efE(){efE=A,tpO=new kb(ezo,0),tpT=new kb("POLYLINE",1),tpx=new kb("ORTHOGONAL",2),tpM=new kb("SPLINES",3)}function efS(){efS=A,tlP=new S5("ASPECT_RATIO_DRIVEN",0),tlR=new S5("MAX_SCALE_DRIVEN",1),tlN=new S5("AREA_DRIVEN",2)}function efk(){efk=A,tff=new S9("P1_STRUCTURE",0),tfd=new S9("P2_PROCESSING_ORDER",1),tfh=new S9("P3_EXECUTION",2)}function efx(){efx=A,tc1=new S0("OVERLAP_REMOVAL",0),tcJ=new S0("COMPACTION",1),tcQ=new S0("GRAPH_SIZE_CALCULATION",2)}function efT(e,t){return Mc(),enj(eHe),eB4.Math.abs(e-t)<=eHe||e==t||isNaN(e)&&isNaN(t)?0:et?1:Te(isNaN(e),isNaN(t))}function efM(e,t){var n,r;for(n=epL(e,0);n.b!=n.d.c;){if((r=gR(LV(Vv(n))))==t)return;if(r>t){Ks(n);break}}YU(n,t)}function efO(e,t){var n,r,i,a,o;if(n=t.f,epy(e.c.d,n,t),null!=t.g)for(i=t.g,a=0,o=i.length;at&&r.ue(e[a-1],e[a])>0;--a)o=e[a],Bc(e,a,e[a-1]),Bc(e,a-1,o)}function efL(e,t,n,r){if(t<0)eOh(e,n,r);else{if(!n.Ij())throw p7(new gL(eZV+n.ne()+eZq));Pp(n,66).Nj().Tj(e,e.yh(),t,r)}}function efC(e,t){if(t==e.d)return e.e;if(t==e.e)return e.d;throw p7(new gL("Node "+t+" not part of edge "+e))}function efI(e,t){switch(t.g){case 2:return e.b;case 1:return e.c;case 4:return e.d;case 3:return e.a;default:return!1}}function efD(e,t){switch(t.g){case 2:return e.b;case 1:return e.c;case 4:return e.d;case 3:return e.a;default:return!1}}function efN(e,t,n,r){switch(t){case 3:return e.f;case 4:return e.g;case 5:return e.i;case 6:return e.j}return ec2(e,t,n,r)}function efP(e){return e.k==(eEn(),e9N)&&q3(new R1(null,new YI(new Fa(OH(efc(e).a.Kc(),new c)))),new it)}function efR(e){return null==e.e?e:(e.c||(e.c=new eCg((256&e.f)!=0,e.i,e.a,e.d,(16&e.f)!=0,e.j,e.g,null)),e.c)}function efj(e,t){return e.h==eHz&&0==e.m&&0==e.l?(t&&(e0A=Mk(0,0,0)),Tr((Q2(),e0I))):(t&&(e0A=Mk(e.l,e.m,e.h)),Mk(0,0,0))}function efF(e){var t;return Array.isArray(e)&&e.im===O?yx(esF(e))+"@"+(t=esj(e)>>>0).toString(16):e.toString()}function efY(e){var t;this.a=(t=Pp(e.e&&e.e(),9),new I1(t,Pp(CY(t,t.length),9),0)),this.b=Je(e1R,eUp,1,this.a.a.length,5,1)}function efB(e){var t,n,r;for(this.a=new Tw,r=new fz(e);r.a0&&(GV(t-1,e.length),58==e.charCodeAt(t-1))&&!efz(e,tm1,tm0)}function efz(e,t,n){var r,i;for(r=0,i=e.length;r=i)return t.c+n;return t.c+t.b.gc()}function efK(e,t){var n,r,i,a;for(LF(),r=J8(e),i=t,Qe(r,0,r.length,i),n=0;n0&&(r+=i,++n);return n>1&&(r+=e.d*(n-1)),r}function efq(e){var t,n,r;for(r=new vs,r.a+="[",t=0,n=e.gc();t0&&this.b>0&&ji(this.c,this.b,this.a)}function ef4(e){edk(),this.c=ZW(eow(vx(e6Z,1),eUp,831,0,[to2])),this.b=new p2,this.a=e,Um(this.b,to3,1),ety(to4,new h4(this))}function ef6(e,t){var n;return e.d?F8(e.b,t)?Pp(Bp(e.b,t),51):(n=t.Kf(),Um(e.b,t,n),n):t.Kf()}function ef5(e,t){var n;return xc(e)===xc(t)||!!M4(t,91)&&(n=Pp(t,91),e.e==n.e&&e.d==n.d&&qv(e,n.a))}function ef8(e){switch(eYu(),e.g){case 4:return tbw;case 1:return tby;case 3:return tbj;case 2:return tbY;default:return tbF}}function ef9(e,t){switch(t){case 3:return 0!=e.f;case 4:return 0!=e.g;case 5:return 0!=e.i;case 6:return 0!=e.j}return eaT(e,t)}function ef7(e){switch(e.g){case 0:return new aV;case 1:return new aq;default:throw p7(new gL(eqa+(null!=e.f?e.f:""+e.g)))}}function ede(e){switch(e.g){case 0:return new aK;case 1:return new aZ;default:throw p7(new gL(eWt+(null!=e.f?e.f:""+e.g)))}}function edt(e){switch(e.g){case 0:return new mZ;case 1:return new m_;default:throw p7(new gL(eqN+(null!=e.f?e.f:""+e.g)))}}function edn(e){switch(e.g){case 1:return new aU;case 2:return new LY;default:throw p7(new gL(eqa+(null!=e.f?e.f:""+e.g)))}}function edr(e){var t,n;if(e.b)return e.b;for(n=e2M?null:e.d;n;){if(t=e2M?null:n.b)return t;n=e2M?null:n.d}return _g(),e2F}function edi(e){var t,n,r;return 0==e.e?0:(t=e.d<<5,n=e.a[e.d-1],e.e<0&&(r=eiU(e))==e.d-1&&(--n,n|=0),t-=exv(n))}function eda(e){var t,n,r;return e>5,t=31&e,(r=Je(ty_,eHT,25,n+1,15,1))[n]=1<3;)i*=10,--a;e=(e+(i>>1))/i|0}return r.i=e,!0}function edl(e){return euQ(),OQ(),!!(efD(Pp(e.a,81).j,Pp(e.b,103))||0!=Pp(e.a,81).d.e&&efD(Pp(e.a,81).j,Pp(e.b,103)))}function edf(e){J1(),Pp(e.We((eBB(),thL)),174).Hc((eI3(),tb4))&&(Pp(e.We(thJ),174).Fc((ekU(),tbg)),Pp(e.We(thL),174).Mc(tb4))}function edd(e,t){var n,r;if(!t)return!1;for(n=0;n=0;--r)for(i=0,t=n[r];i>1,this.k=t-1>>1}function edC(e,t){ewG(t,"End label post-processing",1),_r(UJ(eeh(new R1(null,new Gq(e.b,16)),new tV),new tq),new tZ),eEj(t)}function edI(e,t,n){var r,i;return r=gP(e.p[t.i.p])+gP(e.d[t.i.p])+t.n.b+t.a.b,(i=gP(e.p[n.i.p])+gP(e.d[n.i.p])+n.n.b+n.a.b)-r}function edD(e,t,n){var r,i;for(i=0,r=WM(n,eH9);0!=ecd(r,0)&&i0&&(GV(0,t.length),43==t.charCodeAt(0))?t.substr(1):t)}function edR(e){var t;return null==e?null:new TU((t=ePh(e,!0)).length>0&&(GV(0,t.length),43==t.charCodeAt(0))?t.substr(1):t)}function edj(e,t){var n;return e.i>0&&(t.lengthe.i&&Bc(t,e.i,null),t}function edF(e,t,n){var r,i,a;return e.ej()?(r=e.i,a=e.fj(),ecW(e,r,t),i=e.Zi(3,null,t,r,a),n?n.Ei(i):n=i):ecW(e,e.i,t),n}function edY(e,t,n){var r,i;return r=new Q$(e.e,4,10,M4(i=t.c,88)?Pp(i,26):(eBK(),tgI),null,ebv(e,t),!1),n?n.Ei(r):n=r,n}function edB(e,t,n){var r,i;return r=new Q$(e.e,3,10,null,M4(i=t.c,88)?Pp(i,26):(eBK(),tgI),ebv(e,t),!1),n?n.Ei(r):n=r,n}function edU(e){var t;return Cn(),t=new TS(Pp(e.e.We((eBB(),thO)),8)),e.B.Hc((eI3(),tbQ))&&(t.a<=0&&(t.a=20),t.b<=0&&(t.b=20)),t}function edH(e){var t;return ebk(),t=(e.q?e.q:(Hj(),Hj(),e2i))._b((eBy(),ta0))?Pp(e_k(e,ta0),197):Pp(e_k(Bq(e),ta2),197)}function ed$(e,t){var n,r;return r=null,Ln(e,(eBy(),toD))&&(n=Pp(e_k(e,toD),94)).Xe(t)&&(r=n.We(t)),null==r&&(r=e_k(Bq(e),t)),r}function edz(e,t){var n,r,i;return!!M4(t,42)&&(r=(n=Pp(t,42)).cd(),i=ecA(e.Rc(),r),BG(i,n.dd())&&(null!=i||e.Rc()._b(r)))}function edG(e,t){var n,r,i;return e.f>0&&(e.qj(),i=((r=null==t?0:esj(t))&eUu)%e.d.length,-1!=(n=eML(e,i,r,t)))}function edW(e,t){var n,r,i;return e.f>0&&(e.qj(),i=((r=null==t?0:esj(t))&eUu)%e.d.length,n=exx(e,i,r,t))?n.dd():null}function edK(e,t){var n,r,i,a;for(i=0,a=eAY(e.e.Tg(),t),n=Pp(e.g,119);i1?WO(Fg(t.a[1],32),WM(t.a[0],eH9)):WM(t.a[0],eH9),Kj(efn(t.e,n))))}function edQ(e,t){var n;return Ts(e)&&Ts(t)&&eHV<(n=e%t)&&n>5,t&=31,r=Je(ty_,eHT,25,i=e.d+n+(0==t?0:1),15,1),ewZ(r,e.a,n,t),a=new F7(e.e,i,r),Ku(a),a}function eht(e,t,n){var r,i;r=Pp(zg(tv4,t),117),i=Pp(zg(tv6,t),117),n?(Ge(tv4,e,r),Ge(tv6,e,i)):(Ge(tv6,e,r),Ge(tv4,e,i))}function ehn(e,t,n){var r,i,a;for(i=null,a=e.b;a;){if(r=e.a.ue(t,a.d),n&&0==r)return a;r>=0?a=a.a[1]:(i=a,a=a.a[0])}return i}function ehr(e,t,n){var r,i,a;for(i=null,a=e.b;a;){if(r=e.a.ue(t,a.d),n&&0==r)return a;r<=0?a=a.a[0]:(i=a,a=a.a[1])}return i}function ehi(e,t,n,r){var i,a,o;return i=!1,ejB(e.f,n,r)&&(epn(e.f,e.a[t][n],e.a[t][r]),o=(a=e.a[t])[r],a[r]=a[n],a[n]=o,i=!0),i}function eha(e,t,n,r,i){var a,o,s;for(o=i;t.b!=t.c;)a=Pp(Yn(t),10),s=Pp(efr(a,r).Xb(0),11),e.d[s.p]=o++,n.c[n.c.length]=s;return o}function eho(e,t,n){var r,i,a,o,s;return o=e.k,s=t.k,i=LV(ed$(e,r=n[o.g][s.g])),a=LV(ed$(t,r)),eB4.Math.max((BJ(i),i),(BJ(a),a))}function ehs(e,t,n){var r,i,a,o;for(r=n/e.c.length,i=0,o=new fz(e);o.a2e3&&(e1X=e,e1J=eB4.setTimeout(wf,10)),0==e1Z++&&(eeA((g1(),e0_)),!0)}function ehf(e,t){var n,r,i;for(r=new Fa(OH(efc(e).a.Kc(),new c));eTk(r);)if((i=(n=Pp(ZC(r),17)).d.i).c==t)return!1;return!0}function ehd(e,t){var n,r;if(M4(t,245)){r=Pp(t,245);try{return n=e.vd(r),0==n}catch(i){if(i=eoa(i),!M4(i,205))throw p7(i)}}return!1}function ehh(){return Error.stackTraceLimit>0?(eB4.Error.stackTraceLimit=Error.stackTraceLimit=64,!0):"stack"in Error()}function ehp(e,t){return Mc(),Mc(),enj(eHe),(eB4.Math.abs(e-t)<=eHe||e==t||isNaN(e)&&isNaN(t)?0:et?1:Te(isNaN(e),isNaN(t)))>0}function ehb(e,t){return Mc(),Mc(),enj(eHe),(eB4.Math.abs(e-t)<=eHe||e==t||isNaN(e)&&isNaN(t)?0:et?1:Te(isNaN(e),isNaN(t)))<0}function ehm(e,t){return Mc(),Mc(),enj(eHe),(eB4.Math.abs(e-t)<=eHe||e==t||isNaN(e)&&isNaN(t)?0:et?1:Te(isNaN(e),isNaN(t)))<=0}function ehg(e,t){for(var n=0;!t[n]||""==t[n];)n++;for(var r=t[n++];neH5)return n.fh();if((r=n.Zg())||n==e)break}return r}function ehA(e){return(z0(),M4(e,156))?Pp(Bp(tmR,e0r),288).vg(e):F8(tmR,esF(e))?Pp(Bp(tmR,esF(e)),288).vg(e):null}function ehL(e){if(ehZ(eq5,e))return OQ(),e0P;if(ehZ(eq8,e))return OQ(),e0N;throw p7(new gL("Expecting true or false"))}function ehC(e,t){if(t.c==e)return t.d;if(t.d==e)return t.c;throw p7(new gL("Input edge is not connected to the input port."))}function ehI(e,t){return e.e>t.e?1:e.et.d?e.e:e.d=48&&e<48+eB4.Math.min(10,10)?e-48:e>=97&&e<97?e-97+10:e>=65&&e<65?e-65+10:-1}function ehN(e,t){var n;return xc(t)===xc(e)||!!M4(t,21)&&(n=Pp(t,21)).gc()==e.gc()&&e.Ic(n)}function ehP(e,t){var n,r,i,a;return(r=e.a.length-1,n=t-e.b&r,a=e.c-t&r,A2(n<(i=e.c-e.b&r)),n>=a)?(euD(e,t),-1):(euN(e,t),1)}function ehR(e,t){var n,r;for(n=(GV(t,e.length),e.charCodeAt(t)),r=t+1;rt.e?1:e.ft.f?1:esj(e)-esj(t)}function ehZ(e,t){return BJ(e),null!=t&&(!!IE(e,t)||e.length==t.length&&IE(e.toLowerCase(),t.toLowerCase()))}function ehX(e,t){var n,r,i,a;for(r=0,i=t.gc();r0&&0>ecd(e,128)?(t=jE(e)+128,(n=(RB(),e0H)[t])||(n=e0H[t]=new fI(e)),n):new fI(e)}function eh1(e,t){var n,r;return(n=t.Hh(e.a))&&null!=(r=Lq(edW((n.b||(n.b=new L_((eBK(),tgF),tgf,n)),n.b),eXP)))?r:t.ne()}function eh0(e,t){var n,r;return(n=t.Hh(e.a))&&null!=(r=Lq(edW((n.b||(n.b=new L_((eBK(),tgF),tgf,n)),n.b),eXP)))?r:t.ne()}function eh2(e,t){var n,r;for(Gk(),r=new Fa(OH(efs(e).a.Kc(),new c));eTk(r);)if((n=Pp(ZC(r),17)).d.i==t||n.c.i==t)return n;return null}function eh3(e,t,n){this.c=e,this.f=new p0,this.e=new yb,this.j=new R$,this.n=new R$,this.b=t,this.g=new Hr(t.c,t.d,t.b,t.a),this.a=n}function eh4(e){var t,n,r,i;for(r=0,this.a=new Tw,this.d=new bV,this.e=0,i=(n=e).length;r0)}function ept(e){var t;xc(eT9(e,(eBB(),thl)))===xc((eck(),tpG))&&(z$(e)?(t=Pp(eT9(z$(e),thl),334),ebu(e,thl,t)):ebu(e,thl,tpW))}function epn(e,t,n){var r,i;e_m(e.e,t,n,(eYu(),tbY)),e_m(e.i,t,n,tby),e.a&&(i=Pp(e_k(t,(eBU(),tnc)),11),r=Pp(e_k(n,tnc),11),WW(e.g,i,r))}function epr(e,t,n){var r,i,a;r=t.c.p,a=t.p,e.b[r][a]=new $j(e,t),n&&(e.a[r][a]=new hv(t),(i=Pp(e_k(t,(eBU(),tt9)),10))&&exg(e.d,i,t))}function epi(e,t){var n,r,i;if(P_(e8n,e),t.Fc(e),n=Pp(Bp(e8t,e),21))for(i=n.Kc();i.Ob();)-1!=QI(e8n,r=Pp(i.Pb(),33),0)||epi(r,t)}function epa(e,t,n){var r;(e2x?(edr(e),0):e2T?(_g(),0):e2A?(_g(),0):!e2O||(_g(),1))||((r=new I5(t)).b=n,eEt(e,r))}function epo(e,t){var n;n=!e.A.Hc((ed5(),tbq))||e.q==(ewf(),tbo),e.u.Hc((ekU(),tbp))?n?eY_(e,t):eF3(e,t):e.u.Hc(tbm)&&(n?eFO(e,t):eYY(e,t))}function eps(e,t){var n,r;if(++e.j,null!=t&&exM(t,n=M4(r=e.a.Cb,97)?Pp(r,97).Jg():null)){ehU(e.a,4,n);return}ehU(e.a,4,Pp(t,126))}function epu(e,t,n){return new Hr(eB4.Math.min(e.a,t.a)-n/2,eB4.Math.min(e.b,t.b)-n/2,eB4.Math.abs(e.a-t.a)+n,eB4.Math.abs(e.b-t.b)+n)}function epc(e,t){var n,r;return 0!=(n=ME(e.a.c.p,t.a.c.p))?n:0!=(r=ME(e.a.d.i.p,t.a.d.i.p))?r:ME(t.a.d.p,e.a.d.p)}function epl(e,t,n){var r,i,a,o;return(a=t.j)!=(o=n.j)?a.g-o.g:(r=e.f[t.p],i=e.f[n.p],0==r&&0==i?0:0==r?-1:0==i?1:elN(r,i))}function epf(e,t,n){var r,i,a;if(!n[t.d])for(n[t.d]=!0,i=new fz(efv(t));i.a=(i=e.length))return i;for(t=t>0?t:0;tr&&Bc(t,r,null),t}function epv(e,t){var n,r;for(r=e.a.length,t.lengthr&&Bc(t,r,null),t}function epy(e,t,n){var r,i,a;return(i=Pp(Bp(e.e,t),387))?(a=CL(i,n),M5(e,i),a):(r=new PM(e,t,n),Um(e.e,t,r),zd(r),null)}function epw(e){var t;if(null==e)return null;if(null==(t=eMI(ePh(e,!0))))throw p7(new gV("Invalid hexBinary value: '"+e+"'"));return t}function ep_(e){return(eLQ(),0>ecd(e,0))?0!=ecd(e,-1)?new ey$(-1,QC(e)):e03:0>=ecd(e,10)?e06[jE(e)]:new ey$(1,e)}function epE(){return eBW(),eow(vx(e3n,1),eU4,159,0,[e4e,e37,e4t,e30,e31,e32,e36,e34,e33,e39,e38,e35,e3J,e3X,e3Q,e3q,e3V,e3Z,e3W,e3G,e3K,e4n])}function epS(e){var t;this.d=new p0,this.j=new yb,this.g=new yb,t=e.g.b,this.f=Pp(e_k(Bq(t),(eBy(),tal)),103),this.e=gP(LV(epj(t,toN)))}function epk(e){this.b=new p0,this.e=new p0,this.d=e,this.a=!yK(UJ(new R1(null,new YI(new Z4(e.b))),new f2(new ir))).sd((_w(),e2z))}function epx(){epx=A,tdh=new ko("PARENTS",0),tdd=new ko("NODES",1),tdl=new ko("EDGES",2),tdp=new ko("PORTS",3),tdf=new ko("LABELS",4)}function epT(){epT=A,tbt=new kw("DISTRIBUTED",0),tbr=new kw("JUSTIFIED",1),tp7=new kw("BEGIN",2),tbe=new kw(e$9,3),tbn=new kw("END",4)}function epM(e){var t;switch(t=e.yi(null)){case 10:return 0;case 15:return 1;case 14:return 2;case 11:return 3;case 21:return 4}return -1}function epO(e){switch(e.g){case 1:return ec3(),tpy;case 4:return ec3(),tpm;case 2:return ec3(),tpg;case 3:return ec3(),tpb}return ec3(),tpv}function epA(e,t,n){var r;switch((r=n.q.getFullYear()-eHx+eHx)<0&&(r=-r),t){case 1:e.a+=r;break;case 2:eeE(e,r%100,2);break;default:eeE(e,r,t)}}function epL(e,t){var n,r;if(Gp(t,e.b),t>=e.b>>1)for(r=e.c,n=e.b;n>t;--n)r=r.b;else for(n=0,r=e.a.a;n=64&&t<128&&(i=WO(i,Fg(1,t-64)));return i}function epj(e,t){var n,r;return r=null,Ln(e,(eBB(),tpa))&&(n=Pp(e_k(e,tpa),94)).Xe(t)&&(r=n.We(t)),null==r&&Bq(e)&&(r=e_k(Bq(e),t)),r}function epF(e,t){var n,r,i;(r=(i=t.d.i).k)!=(eEn(),e9N)&&r!=e9L&&(n=new Fa(OH(efc(i).a.Kc(),new c)),eTk(n)&&Um(e.k,t,Pp(ZC(n),17)))}function epY(e,t){var n,r,i;return r=ee2(e.Tg(),t),(n=t-e.Ah())<0?(i=e.Yg(r))>=0?e.lh(i):exu(e,r):n<0?exu(e,r):Pp(r,66).Nj().Sj(e,e.yh(),n)}function epB(e){var t;if(!M4(e.a,4))return e.a;if(null==(t=ehA(e.a)))throw p7(new gC(eq9+e.b+"'. "+eq4+(LW(e5D),e5D.k)+eq6));return t}function epU(e){var t;if(null==e)return null;if(null==(t=eYD(ePh(e,!0))))throw p7(new gV("Invalid base64Binary value: '"+e+"'"));return t}function epH(e){var t;try{return t=e.i.Xb(e.e),e.mj(),e.g=e.e++,t}catch(n){if(n=eoa(n),M4(n,73))throw e.mj(),p7(new bC);throw p7(n)}}function ep$(e){var t;try{return t=e.c.ki(e.e),e.mj(),e.g=e.e++,t}catch(n){if(n=eoa(n),M4(n,73))throw e.mj(),p7(new bC);throw p7(n)}}function epz(){epz=A,e57=(eBB(),tpt),e53=ths,e5J=td2,e54=thN,e58=(evw(),e3y),e55=e3g,e59=e3_,e56=e3m,e51=(eug(),e5V),e5Q=e5K,e50=e5Z,e52=e5X}function epG(e){switch(_M(),this.c=new p0,this.d=e,e.g){case 0:case 2:this.a=Ug(e9_),this.b=eHQ;break;case 3:case 1:this.a=e9_,this.b=eH1}}function epW(e,t,n){var r,i;if(e.c)eno(e.c,e.c.i+t),ens(e.c,e.c.j+n);else for(i=new fz(e.b);i.a0&&(P_(e.b,new PE(t.a,n)),0<(r=t.a.length)?t.a=t.a.substr(0,0):0>r&&(t.a+=M3(Je(tyw,eHl,25,-r,15,1))))}function epq(e,t){var n,r,i;for(n=e.o,i=Pp(Pp(Zq(e.r,t),21),84).Kc();i.Ob();)(r=Pp(i.Pb(),111)).e.a=ego(r,n.a),r.e.b=n.b*gP(LV(r.b.We(e4a)))}function epZ(e,t){var n,r,i,a;return i=e.k,n=gP(LV(e_k(e,(eBU(),tnv)))),a=t.k,r=gP(LV(e_k(t,tnv))),a!=(eEn(),e9C)?-1:i!=e9C?1:n==r?0:n=0?e.hh(t,n,r):(e.eh()&&(r=(i=e.Vg())>=0?e.Qg(r):e.eh().ih(e,-1-i,null,r)),e.Sg(t,n,r))}function ep2(e,t){switch(t){case 7:e.e||(e.e=new Ih(e5g,e,7,4)),eRT(e.e);return;case 8:e.d||(e.d=new Ih(e5g,e,8,5)),eRT(e.d);return}edS(e,t)}function ep3(e,t){var n;n=e.Zc(t);try{return n.Pb()}catch(r){if(r=eoa(r),M4(r,109))throw p7(new gE("Can't get element "+t));throw p7(r)}}function ep4(e,t){this.e=e,t=0&&(n.d=e.t);break;case 3:e.t>=0&&(n.a=e.t)}e.C&&(n.b=e.C.b,n.c=e.C.c)}function ep7(){ep7=A,e4d=new EN(ezb,0),e4f=new EN(ezm,1),e4h=new EN(ezg,2),e4p=new EN(ezv,3),e4d.a=!1,e4f.a=!0,e4h.a=!1,e4p.a=!0}function ebe(){ebe=A,e5U=new ED(ezb,0),e5B=new ED(ezm,1),e5H=new ED(ezg,2),e5$=new ED(ezv,3),e5U.a=!1,e5B.a=!0,e5H.a=!1,e5$.a=!0}function ebt(e){var t;t=e.a;do(t=Pp(ZC(new Fa(OH(efu(t).a.Kc(),new c))),17).c.i).k==(eEn(),e9D)&&e.b.Fc(t);while(t.k==(eEn(),e9D))e.b=eaa(e.b)}function ebn(e){var t,n,r;for(r=e.c.a,e.p=(Y8(r),new I4(r)),n=new fz(r);n.an.b))}function ebs(e,t){return xd(e)?!!e0c[t]:e.hm?!!e.hm[t]:xf(e)?!!e0u[t]:!!xl(e)&&!!e0s[t]}function ebu(e,t,n){return null==n?(e.o||(e.o=new JY((eBa(),tmy),e5O,e,0)),ehx(e.o,t)):(e.o||(e.o=new JY((eBa(),tmy),e5O,e,0)),evQ(e.o,t,n)),e}function ebc(e,t,n,r){var i,a;a=t.Xe((eBB(),thS))?Pp(t.We(thS),21):e.j,(i=ele(a))!=(eBW(),e4n)&&(!n||ehj(i))&&eEU(eMD(e,i,r),t)}function ebl(e,t,n,r){var i,a,o;return a=ee2(e.Tg(),t),(i=t-e.Ah())<0?(o=e.Yg(a))>=0?e._g(o,n,!0):exk(e,a,n):Pp(a,66).Nj().Pj(e,e.yh(),i,n,r)}function ebf(e,t,n,r){var i,a,o;n.mh(t)&&(_4(),eec(t)?ehX(e,i=Pp(n.ah(t),153)):(a=(o=t)?Pp(r,49).xh(o):null)&&p5(n.ah(t),a))}function ebd(e){switch(e.g){case 1:return eaY(),e4c;case 3:return eaY(),e4o;case 2:return eaY(),e4u;case 4:return eaY(),e4s;default:return null}}function ebh(e){switch(typeof e){case eUo:return ebA(e);case eUa:return zy(e);case eUi:return OQ(),e?1231:1237;default:return null==e?0:Ao(e)}}function ebp(e,t,n){if(e.e)switch(e.b){case 1:HJ(e.c,t,n);break;case 0:HQ(e.c,t,n)}else V5(e.c,t,n);e.a[t.p][n.p]=e.c.i,e.a[n.p][t.p]=e.c.e}function ebb(e){var t,n;if(null==e)return null;for(t=0,n=Je(e4N,eUP,193,e.length,0,2);t=0)return i;if(e.Fk()){for(r=0;r=(i=e.gc()))throw p7(new Ii(t,i));if(e.hi()&&(r=e.Xc(n))>=0&&r!=t)throw p7(new gL(eXB));return e.mi(t,n)}function ebw(e,t){if(this.a=Pp(Y8(e),245),this.b=Pp(Y8(t),245),e.vd(t)>0||e==(m3(),e0f)||t==(m2(),e0d))throw p7(new gL("Invalid range: "+VW(e,t)))}function eb_(e){var t,n;for(this.b=new p0,this.c=e,this.a=!1,n=new fz(e.a);n.a0),(t&-t)==t)return zy(t*eMU(e,31)*4656612873077393e-25);do r=(n=eMU(e,31))%t;while(n-r+(t-1)<0)return zy(r)}function ebA(e){var t,n,r;return(I8(),null!=(r=e2W[n=":"+e]))?zy((BJ(r),r)):(t=null==(r=e2G[n])?eAC(e):zy((BJ(r),r)),HB(),e2W[n]=t,t)}function ebL(e,t,n){ewG(n,"Compound graph preprocessor",1),e.a=new zu,eFC(e,t,null),eRs(e,t),eOz(e),eo3(t,(eBU(),ttW),e.a),e.a=null,Yy(e.b),eEj(n)}function ebC(e,t,n){switch(n.g){case 1:e.a=t.a/2,e.b=0;break;case 2:e.a=t.a,e.b=t.b/2;break;case 3:e.a=t.a/2,e.b=t.b;break;case 4:e.a=0,e.b=t.b/2}}function ebI(e){var t,n,r;for(r=Pp(Zq(e.a,(ey4(),tea)),15).Kc();r.Ob();)t=egD(n=Pp(r.Pb(),101)),Yz(e,n,t[0],(erX(),ted),0),Yz(e,n,t[1],tep,1)}function ebD(e){var t,n,r;for(r=Pp(Zq(e.a,(ey4(),teo)),15).Kc();r.Ob();)t=egD(n=Pp(r.Pb(),101)),Yz(e,n,t[0],(erX(),ted),0),Yz(e,n,t[1],tep,1)}function ebN(e){switch(e.g){case 0:return null;case 1:return new er1;case 2:return new mQ;default:throw p7(new gL(eqa+(null!=e.f?e.f:""+e.g)))}}function ebP(e,t,n){var r,i;for(eod(e,t-e.s,n-e.t),i=new fz(e.n);i.a1&&(a=ebE(e,t)),a}function ebj(e){var t;return e.f&&e.f.kh()&&(t=Pp(e.f,49),e.f=Pp(ecv(e,t),82),e.f!=t&&(4&e.Db)!=0&&(1&e.Db)==0&&eam(e,new FX(e,9,8,t,e.f))),e.f}function ebF(e){var t;return e.i&&e.i.kh()&&(t=Pp(e.i,49),e.i=Pp(ecv(e,t),82),e.i!=t&&(4&e.Db)!=0&&(1&e.Db)==0&&eam(e,new FX(e,9,7,t,e.i))),e.i}function ebY(e){var t;return e.b&&(64&e.b.Db)!=0&&(t=e.b,e.b=Pp(ecv(e,t),18),e.b!=t&&(4&e.Db)!=0&&(1&e.Db)==0&&eam(e,new FX(e,9,21,t,e.b))),e.b}function ebB(e,t){var n,r,i;null==e.d?(++e.e,++e.f):(r=t.Sh(),eO1(e,e.f+1),i=(r&eUu)%e.d.length,(n=e.d[i])||(n=e.d[i]=e.uj()),n.Fc(t),++e.f)}function ebU(e,t,n){var r;return!t.Kj()&&(-2!=t.Zj()?null==(r=t.zj())?null==n:ecX(r,n):t.Hj()==e.e.Tg()&&null==n)}function ebH(){var e;enG(16,eU0),e=er_(16),this.b=Je(e1z,eU1,317,e,0,1),this.c=Je(e1z,eU1,317,e,0,1),this.a=null,this.e=null,this.i=0,this.f=e-1,this.g=0}function eb$(e){CW.call(this),this.k=(eEn(),e9N),this.j=(enG(6,eU3),new XM(6)),this.b=(enG(2,eU3),new XM(2)),this.d=new md,this.f=new mb,this.a=e}function ebz(e){var t,n;!(e.c.length<=1)&&(t=eLW(e,(eYu(),tbj)),eSe(e,Pp(t.a,19).a,Pp(t.b,19).a),n=eLW(e,tbY),eSe(e,Pp(n.a,19).a,Pp(n.b,19).a))}function ebG(){ebG=A,tsb=new Sx("SIMPLE",0),tsd=new Sx(eWg,1),tsh=new Sx("LINEAR_SEGMENTS",2),tsf=new Sx("BRANDES_KOEPF",3),tsp=new Sx(eVI,4)}function ebW(e,t,n){IR(Pp(e_k(t,(eBy(),tol)),98))||(Q3(e,t,eEC(t,n)),Q3(e,t,eEC(t,(eYu(),tbj))),Q3(e,t,eEC(t,tbw)),Hj(),Mv(t.j,new hm(e)))}function ebK(e,t,n,r){var i,a,o;for(o=(i=r?Pp(Zq(e.a,t),21):Pp(Zq(e.b,t),21)).Kc();o.Ob();)if(eL9(e,n,a=Pp(o.Pb(),33)))return!0;return!1}function ebV(e){var t,n;for(n=new Ow(e);n.e!=n.i.gc();)if((t=Pp(epH(n),87)).e||0!=(t.d||(t.d=new O_(tgr,t,1)),t.d).i)return!0;return!1}function ebq(e){var t,n;for(n=new Ow(e);n.e!=n.i.gc();)if((t=Pp(epH(n),87)).e||0!=(t.d||(t.d=new O_(tgr,t,1)),t.d).i)return!0;return!1}function ebZ(e){var t,n,r;for(t=0,r=new fz(e.c.a);r.a102?-1:e<=57?e-48:e<65?-1:e<=70?e-65+10:e<97?-1:e-97+10}function eb2(e,t){if(null==e)throw p7(new gD("null key in entry: null="+t));if(null==t)throw p7(new gD("null value in entry: "+e+"=null"))}function eb3(e,t){for(var n,r;e.Ob();)if(!t.Ob()||(n=e.Pb(),r=t.Pb(),!(xc(n)===xc(r)||null!=n&&ecX(n,r))))return!1;return!t.Ob()}function eb4(e,t){var n;return n=eow(vx(tyx,1),eH6,25,15,[euG(e.a[0],t),euG(e.a[1],t),euG(e.a[2],t)]),e.d&&(n[0]=eB4.Math.max(n[0],n[2]),n[2]=n[0]),n}function eb6(e,t){var n;return n=eow(vx(tyx,1),eH6,25,15,[euW(e.a[0],t),euW(e.a[1],t),euW(e.a[2],t)]),e.d&&(n[0]=eB4.Math.max(n[0],n[2]),n[2]=n[0]),n}function eb5(){eb5=A,teG=new Sf("GREEDY",0),tez=new Sf(eWv,1),teK=new Sf(eWg,2),teV=new Sf("MODEL_ORDER",3),teW=new Sf("GREEDY_MODEL_ORDER",4)}function eb8(e,t){var n,r,i;for(e.b[t.g]=1,r=epL(t.d,0);r.b!=r.d.c;)i=(n=Pp(Vv(r),188)).c,1==e.b[i.g]?P7(e.a,n):2==e.b[i.g]?e.b[i.g]=1:eb8(e,i)}function eb9(e,t){var n,r,i;for(i=new XM(t.gc()),r=t.Kc();r.Ob();)(n=Pp(r.Pb(),286)).c==n.f?eE6(e,n,n.c):eEQ(e,n)||(i.c[i.c.length]=n);return i}function eb7(e,t,n){var r,i,a,o,s;for(s=e.r+t,e.r+=t,e.d+=n,r=n/e.n.c.length,i=0,o=new fz(e.n);o.aa&&Bc(t,a,null),t}function emx(e,t){var n,r;if(r=e.gc(),null==t){for(n=0;n0&&(u+=i),c[l]=o,o+=s*(u+r)}function emj(e){var t,n,r;for(t=0,r=e.f,e.n=Je(tyx,eH6,25,r,15,1),e.d=Je(tyx,eH6,25,r,15,1);t0?e.c:0),++i;e.b=r,e.d=a}function emW(e,t){var n,r,i,a,o;for(r=0,i=0,n=0,o=new fz(t);o.a0?e.g:0),++n;e.c=i,e.d=r}function emK(e,t){var n;return n=eow(vx(tyx,1),eH6,25,15,[ebM(e,(etx(),e3D),t),ebM(e,e3N,t),ebM(e,e3P,t)]),e.f&&(n[0]=eB4.Math.max(n[0],n[2]),n[2]=n[0]),n}function emV(e,t,n){var r;try{eCQ(e,t+e.j,n+e.k,!1,!0)}catch(i){if(i=eoa(i),M4(i,73))throw r=i,p7(new gE(r.g+ezk+t+eUd+n+")."));throw p7(i)}}function emq(e,t,n){var r;try{eCQ(e,t+e.j,n+e.k,!0,!1)}catch(i){if(i=eoa(i),M4(i,73))throw r=i,p7(new gE(r.g+ezk+t+eUd+n+")."));throw p7(i)}}function emZ(e){var t;Ln(e,(eBy(),taZ))&&((t=Pp(e_k(e,taZ),21)).Hc((eT7(),tp1))?(t.Mc(tp1),t.Fc(tp2)):t.Hc(tp2)&&(t.Mc(tp2),t.Fc(tp1)))}function emX(e){var t;Ln(e,(eBy(),taZ))&&((t=Pp(e_k(e,taZ),21)).Hc((eT7(),tp8))?(t.Mc(tp8),t.Fc(tp6)):t.Hc(tp6)&&(t.Mc(tp6),t.Fc(tp8)))}function emJ(e,t,n){ewG(n,"Self-Loop ordering",1),_r(UQ(UJ(UJ(eeh(new R1(null,new Gq(t.b,16)),new n8),new n9),new n7),new re),new d1(e)),eEj(n)}function emQ(e,t,n,r){var i,a;for(i=t;i0&&(i.b+=t),i}function em9(e,t){var n,r,i;for(i=new yb,r=e.Kc();r.Ob();)eIn(n=Pp(r.Pb(),37),0,i.b),i.b+=n.f.b+t,i.a=eB4.Math.max(i.a,n.f.a);return i.a>0&&(i.a+=t),i}function em7(e){var t,n,r;for(r=eUu,n=new fz(e.a);n.a>16==6?e.Cb.ih(e,5,e5E,t):(r=ebY(Pp(ee2((n=Pp(eaS(e,16),26))||e.zh(),e.Db>>16),18)),e.Cb.ih(e,r.n,r.f,t))}function egr(e){$O();var t=e.e;if(t&&t.stack){var n=t.stack,r=t+"\n";return n.substring(0,r.length)==r&&(n=n.substring(r.length)),n.split("\n")}return[]}function egi(e){var t;return(t=(en4(),e0U))[e>>>28]|t[e>>24&15]<<4|t[e>>20&15]<<8|t[e>>16&15]<<12|t[e>>12&15]<<16|t[e>>8&15]<<20|t[e>>4&15]<<24|t[15&e]<<28}function ega(e){var t,n,r;e.b==e.c&&(r=e.a.length,n=esi(eB4.Math.max(8,r))<<1,0!=e.b?(t=CY(e.a,n),erL(e,t,r),e.a=t,e.b=0):bF(e.a,n),e.c=r)}function ego(e,t){var n;return(n=e.b).Xe((eBB(),thK))?n.Hf()==(eYu(),tbY)?-n.rf().a-gP(LV(n.We(thK))):t+gP(LV(n.We(thK))):n.Hf()==(eYu(),tbY)?-n.rf().a:t}function egs(e){var t;return 0!=e.b.c.length&&Pp(RJ(e.b,0),70).a?Pp(RJ(e.b,0),70).a:null!=(t=Hh(e))?t:""+(e.c?QI(e.c.a,e,0):-1)}function egu(e){var t;return 0!=e.f.c.length&&Pp(RJ(e.f,0),70).a?Pp(RJ(e.f,0),70).a:null!=(t=Hh(e))?t:""+(e.i?QI(e.i.j,e,0):-1)}function egc(e,t){var n,r;if(t<0||t>=e.gc())return null;for(n=t;n0?e.c:0),i=eB4.Math.max(i,t.d),++r;e.e=a,e.b=i}function egd(e){var t,n;if(!e.b)for(e.b=K$(Pp(e.f,118).Ag().i),n=new Ow(Pp(e.f,118).Ag());n.e!=n.i.gc();)t=Pp(epH(n),137),P_(e.b,new gO(t));return e.b}function egh(e,t){var n,r,i;if(t.dc())return LF(),LF(),tmB;for(n=new Cy(e,t.gc()),i=new Ow(e);i.e!=i.i.gc();)r=epH(i),t.Hc(r)&&JL(n,r);return n}function egp(e,t,n,r){return 0==t?r?(e.o||(e.o=new JY((eBa(),tmy),e5O,e,0)),e.o):(e.o||(e.o=new JY((eBa(),tmy),e5O,e,0)),X5(e.o)):ebl(e,t,n,r)}function egb(e){var t,n;if(e.rb)for(t=0,n=e.rb.i;t>22))>>22)<0)&&(e.l=n&eHH,e.m=r&eHH,e.h=i&eH$,!0))}function egw(e,t,n,r,i,a,o){var s,u;return!(t.Ae()&&((u=e.a.ue(n,r))<0||!i&&0==u)||t.Be()&&((s=e.a.ue(n,a))>0||!o&&0==s))}function eg_(e,t){var n;if(euv(),0!=(n=e.j.g-t.j.g))return 0;switch(e.j.g){case 2:return efy(t,e73)-efy(e,e73);case 4:return efy(e,e72)-efy(t,e72)}return 0}function egE(e){switch(e.g){case 0:return te3;case 1:return te4;case 2:return te6;case 3:return te5;case 4:return te8;case 5:return te9;default:return null}}function egS(e,t,n){var r,i;return r=(eu2(i=new mN,t),er3(i,n),JL((e.c||(e.c=new FQ(tga,e,12,10)),e.c),i),i),end(r,0),enh(r,1),els(r,!0),eli(r,!0),r}function egk(e,t){var n,r;if(t>=e.i)throw p7(new xJ(t,e.i));return++e.j,n=e.g[t],(r=e.i-t-1)>0&&ePD(e.g,t+1,e.g,t,r),Bc(e.g,--e.i,null),e.fi(t,n),e.ci(),n}function egx(e,t){var n,r;return e.Db>>16==17?e.Cb.ih(e,21,tm7,t):(r=ebY(Pp(ee2((n=Pp(eaS(e,16),26))||e.zh(),e.Db>>16),18)),e.Cb.ih(e,r.n,r.f,t))}function egT(e){var t,n,r,i;for(Hj(),Mv(e.c,e.a),i=new fz(e.c);i.an.a.c.length))throw p7(new gL("index must be >= 0 and <= layer node count"));e.c&&QA(e.c.a,e),e.c=n,n&&jO(n.a,t,e)}function egH(e,t){var n,r,i;for(r=new Fa(OH(efs(e).a.Kc(),new c));eTk(r);)return n=Pp(ZC(r),17),i=Pp(t.Kb(n),10),new c6(Y8(i.n.b+i.o.b/2));return m4(),m4(),e0l}function eg$(e,t){this.c=new p2,this.a=e,this.b=t,this.d=Pp(e_k(e,(eBU(),tnx)),304),xc(e_k(e,(eBy(),taX)))===xc((Qx(),tte))?this.e=new mg:this.e=new mm}function egz(e,t){var n,r,i,a;for(a=0,r=new fz(e);r.a>16==6?e.Cb.ih(e,6,e5g,t):(r=ebY(Pp(ee2((n=Pp(eaS(e,16),26))||(eBa(),tmp),e.Db>>16),18)),e.Cb.ih(e,r.n,r.f,t))}function eg0(e,t){var n,r;return e.Db>>16==7?e.Cb.ih(e,1,e5p,t):(r=ebY(Pp(ee2((n=Pp(eaS(e,16),26))||(eBa(),tmm),e.Db>>16),18)),e.Cb.ih(e,r.n,r.f,t))}function eg2(e,t){var n,r;return e.Db>>16==9?e.Cb.ih(e,9,e5k,t):(r=ebY(Pp(ee2((n=Pp(eaS(e,16),26))||(eBa(),tmv),e.Db>>16),18)),e.Cb.ih(e,r.n,r.f,t))}function eg3(e,t){var n,r;return e.Db>>16==5?e.Cb.ih(e,9,tgt,t):(r=ebY(Pp(ee2((n=Pp(eaS(e,16),26))||(eBK(),tgT),e.Db>>16),18)),e.Cb.ih(e,r.n,r.f,t))}function eg4(e,t){var n,r;return e.Db>>16==3?e.Cb.ih(e,0,e5y,t):(r=ebY(Pp(ee2((n=Pp(eaS(e,16),26))||(eBK(),tgy),e.Db>>16),18)),e.Cb.ih(e,r.n,r.f,t))}function eg6(e,t){var n,r;return e.Db>>16==7?e.Cb.ih(e,6,e5E,t):(r=ebY(Pp(ee2((n=Pp(eaS(e,16),26))||(eBK(),tgP),e.Db>>16),18)),e.Cb.ih(e,r.n,r.f,t))}function eg5(){this.a=new o5,this.g=new ebH,this.j=new ebH,this.b=new p2,this.d=new ebH,this.i=new ebH,this.k=new p2,this.c=new p2,this.e=new p2,this.f=new p2}function eg8(e,t,n){var r,i,a;for(n<0&&(n=0),a=e.i,i=n;ieH5)return eg7(e,r);if(r==e)return!0}}return!1}function eve(e){switch(Ab(),e.q.g){case 5:ekK(e,(eYu(),tbw)),ekK(e,tbj);break;case 4:eMz(e,(eYu(),tbw)),eMz(e,tbj);break;default:eYa(e,(eYu(),tbw)),eYa(e,tbj)}}function evt(e){switch(Ab(),e.q.g){case 5:exG(e,(eYu(),tby)),exG(e,tbY);break;case 4:epq(e,(eYu(),tby)),epq(e,tbY);break;default:eYo(e,(eYu(),tby)),eYo(e,tbY)}}function evn(e){var t,n;(t=Pp(e_k(e,(eCk(),e8O)),19))?0==(n=t.a)?eo3(e,(erV(),e8F),new efo):eo3(e,(erV(),e8F),new qS(n)):eo3(e,(erV(),e8F),new qS(1))}function evr(e,t){var n;switch(n=e.i,t.g){case 1:return-(e.n.b+e.o.b);case 2:return e.n.a-n.o.a;case 3:return e.n.b-n.o.b;case 4:return-(e.n.a+e.o.a)}return 0}function evi(e,t){switch(e.g){case 0:return t==(ef_(),tnN)?e7V:e7q;case 1:return t==(ef_(),tnN)?e7V:e7K;case 2:return t==(ef_(),tnN)?e7K:e7q;default:return e7K}}function eva(e,t){var n,r,i;for(QA(e.a,t),e.e-=t.r+(0==e.a.c.length?0:e.c),i=eqe,r=new fz(e.a);r.a>16==3?e.Cb.ih(e,12,e5k,t):(r=ebY(Pp(ee2((n=Pp(eaS(e,16),26))||(eBa(),tmh),e.Db>>16),18)),e.Cb.ih(e,r.n,r.f,t))}function evs(e,t){var n,r;return e.Db>>16==11?e.Cb.ih(e,10,e5k,t):(r=ebY(Pp(ee2((n=Pp(eaS(e,16),26))||(eBa(),tmg),e.Db>>16),18)),e.Cb.ih(e,r.n,r.f,t))}function evu(e,t){var n,r;return e.Db>>16==10?e.Cb.ih(e,11,tm7,t):(r=ebY(Pp(ee2((n=Pp(eaS(e,16),26))||(eBK(),tgD),e.Db>>16),18)),e.Cb.ih(e,r.n,r.f,t))}function evc(e,t){var n,r;return e.Db>>16==10?e.Cb.ih(e,12,tgi,t):(r=ebY(Pp(ee2((n=Pp(eaS(e,16),26))||(eBK(),tgR),e.Db>>16),18)),e.Cb.ih(e,r.n,r.f,t))}function evl(e){var t;return(1&e.Bb)==0&&e.r&&e.r.kh()&&(t=Pp(e.r,49),e.r=Pp(ecv(e,t),138),e.r!=t&&(4&e.Db)!=0&&(1&e.Db)==0&&eam(e,new FX(e,9,8,t,e.r))),e.r}function evf(e,t,n){var r;return r=eow(vx(tyx,1),eH6,25,15,[e_u(e,(etx(),e3D),t,n),e_u(e,e3N,t,n),e_u(e,e3P,t,n)]),e.f&&(r[0]=eB4.Math.max(r[0],r[2]),r[2]=r[0]),r}function evd(e,t){var n,r,i;if(0!=(i=eb9(e,t)).c.length)for(Mv(i,new nD),n=i.c.length,r=0;r>19)!=(c=t.h>>19)?c-u:(i=e.h)!=(s=t.h)?i-s:(r=e.m)!=(o=t.m)?r-o:(n=e.l)-(a=t.l)}function evw(){evw=A,e3E=(eCp(),e3A),e3_=new xX(e$J,e3E),e3w=(eeR(),e3p),e3y=new xX(e$Q,e3w),e3v=(epC(),e3f),e3g=new xX(e$1,e3v),e3m=new xX(e$0,(OQ(),!0))}function ev_(e,t,n){var r,i;r=t*n,M4(e.g,145)?(i=Vm(e)).f.d?i.f.a||(e.d.a+=r+ezs):(e.d.d-=r+ezs,e.d.a+=r+ezs):M4(e.g,10)&&(e.d.d-=r,e.d.a+=2*r)}function evE(e,t,n){var r,i,a,o,s;for(i=e[n.g],s=new fz(t.d);s.a0?e.g:0),++n;t.b=r,t.e=i}function evk(e){var t,n,r;if(r=e.b,w4(e.i,r.length)){for(n=2*r.length,e.b=Je(e1z,eU1,317,n,0,1),e.c=Je(e1z,eU1,317,n,0,1),e.f=n-1,e.i=0,t=e.a;t;t=t.c)ekT(e,t,t);++e.g}}function evx(e,t,n,r){var i,a,o,s;for(i=0;io&&(s=o/r),i>a&&(u=a/i),Ol(e,eB4.Math.min(s,u)),e}function evO(){var e,t;ePm();try{if(t=Pp(eyv((_Q(),tgp),eXe),2014))return t}catch(n){if(n=eoa(n),M4(n,102))e=n,Fi((Mo(),e));else throw p7(n)}return new o1}function evA(){var e,t;Qk();try{if(t=Pp(eyv((_Q(),tgp),eQB),2024))return t}catch(n){if(n=eoa(n),M4(n,102))e=n,Fi((Mo(),e));else throw p7(n)}return new uc}function evL(){var e,t;ePm();try{if(t=Pp(eyv((_Q(),tgp),eQc),1941))return t}catch(n){if(n=eoa(n),M4(n,102))e=n,Fi((Mo(),e));else throw p7(n)}return new sT}function evC(e,t,n){var r,i;return i=e.e,e.e=t,(4&e.Db)!=0&&(1&e.Db)==0&&(r=new FX(e,1,4,i,t),n?n.Ei(r):n=r),i!=t&&(n=t?eFr(e,eOl(e,t),n):eFr(e,e.a,n)),n}function evI(){wW.call(this),this.e=-1,this.a=!1,this.p=eHt,this.k=-1,this.c=-1,this.b=-1,this.g=!1,this.f=-1,this.j=-1,this.n=-1,this.i=-1,this.d=-1,this.o=eHt}function evD(e,t){var n,r,i;if(r=e.b.d.d,e.a||(r+=e.b.d.a),i=t.b.d.d,t.a||(i+=t.b.d.a),0==(n=elN(r,i))){if(!e.a&&t.a)return -1;if(!t.a&&e.a)return 1}return n}function evN(e,t){var n,r,i;if(r=e.b.b.d,e.a||(r+=e.b.b.a),i=t.b.b.d,t.a||(i+=t.b.b.a),0==(n=elN(r,i))){if(!e.a&&t.a)return -1;if(!t.a&&e.a)return 1}return n}function evP(e,t){var n,r,i;if(r=e.b.g.d,e.a||(r+=e.b.g.a),i=t.b.g.d,t.a||(i+=t.b.g.a),0==(n=elN(r,i))){if(!e.a&&t.a)return -1;if(!t.a&&e.a)return 1}return n}function evR(){evR=A,e88=j0(RI(RI(RI(new K2,(e_x(),e9r),(eB$(),e7f)),e9r,e7b),e9i,e7E),e9i,e97),e87=RI(RI(new K2,e9r,e9Q),e9r,e7e),e89=j0(new K2,e9i,e7n)}function evj(e){var t,n,r,i,a;for(t=Pp(e_k(e,(eBU(),ttq)),83),a=e.n,r=t.Cc().Kc();r.Ob();)i=(n=Pp(r.Pb(),306)).i,i.c+=a.a,i.d+=a.b,n.c?eL3(n):eL4(n);eo3(e,ttq,null)}function evF(e,t,n){var r,i;switch(r=(i=e.b).d,t.g){case 1:return-r.d-n;case 2:return i.o.a+r.c+n;case 3:return i.o.b+r.a+n;case 4:return-r.b-n;default:return -1}}function evY(e){var t,n,r,i,a;if(r=0,i=ezq,e.b)for(t=0;t<360;t++)n=.017453292519943295*t,eIq(e,e.d,0,0,eV7,n),(a=e.b.ig(e.d))0&&(o=(a&eUu)%e.d.length,i=exx(e,o,a,t)))?s=i.ed(n):(r=e.tj(a,t,n),e.c.Fc(r),null)}function ev1(e,t){var n,r,i,a;switch(ecG(e,t)._k()){case 3:case 2:for(i=0,a=(n=ePk(t)).i;i=0;r--)if(IE(e[r].d,t)||IE(e[r].d,n)){e.length>=r+1&&e.splice(0,r+1);break}return e}function eyt(e,t){var n;return Ts(e)&&Ts(t)&&eHV<(n=e/t)&&n0&&(e.b+=2,e.a+=r):(e.b+=1,e.a+=eB4.Math.min(r,i))}function eyc(e,t){var n,r;if(r=!1,xd(t)&&(r=!0,BC(e,new B_(Lq(t)))),!r&&M4(t,236)&&(r=!0,BC(e,(n=IZ(Pp(t,236)),new lI(n)))),!r)throw p7(new gk(eXE))}function eyl(e,t,n,r){var i,a,o;return i=new Q$(e.e,1,10,M4(o=t.c,88)?Pp(o,26):(eBK(),tgI),M4(a=n.c,88)?Pp(a,26):(eBK(),tgI),ebv(e,t),!1),r?r.Ei(i):r=i,r}function eyf(e){var t,n;switch(Pp(e_k(Bq(e),(eBy(),taP)),420).g){case 0:return t=e.n,n=e.o,new kl(t.a+n.a/2,t.b+n.b/2);case 1:return new TS(e.n);default:return null}}function eyd(){eyd=A,tto=new Sm(eGR,0),tta=new Sm("LEFTUP",1),ttu=new Sm("RIGHTUP",2),tti=new Sm("LEFTDOWN",3),tts=new Sm("RIGHTDOWN",4),ttr=new Sm("BALANCED",5)}function eyh(e,t,n){var r,i,a;if(0==(r=elN(e.a[t.p],e.a[n.p]))){if(i=Pp(e_k(t,(eBU(),tt7)),15),a=Pp(e_k(n,tt7),15),i.Hc(n))return -1;if(a.Hc(t))return 1}return r}function eyp(e){switch(e.g){case 1:return new a$;case 2:return new az;case 3:return new aH;case 0:return null;default:throw p7(new gL(eqa+(null!=e.f?e.f:""+e.g)))}}function eyb(e,t,n){switch(t){case 1:e.n||(e.n=new FQ(e5S,e,1,7)),eRT(e.n),e.n||(e.n=new FQ(e5S,e,1,7)),Y4(e.n,Pp(n,14));return;case 2:ert(e,Lq(n));return}esU(e,t,n)}function eym(e,t,n){switch(t){case 3:eni(e,gP(LV(n)));return;case 4:ena(e,gP(LV(n)));return;case 5:eno(e,gP(LV(n)));return;case 6:ens(e,gP(LV(n)));return}eyb(e,t,n)}function eyg(e,t,n){var r,i,a;(i=ew3(a=r=new mN,t,null))&&i.Fi(),er3(a,n),JL((e.c||(e.c=new FQ(tga,e,12,10)),e.c),a),end(a,0),enh(a,1),els(a,!0),eli(a,!0)}function eyv(e,t){var n,r,i;return M4(n=Ea(e.g,t),235)?((i=Pp(n,235)).Qh(),i.Nh()):M4(n,498)?i=(r=Pp(n,1938)).b:null}function eyy(e,t,n,r){var i,a;return Y8(t),Y8(n),a=Pp(Iq(e.d,t),19),QW(!!a,"Row %s not in %s",t,e.e),i=Pp(Iq(e.b,n),19),QW(!!i,"Column %s not in %s",n,e.c),eoy(e,a.a,i.a,r)}function eyw(e,t,n,r,i,a,o){var s,u,c,l,f;if(l=i[a],f=emH(s=(c=a==o-1)?r:0,l),10!=r&&eow(vx(e,o-a),t[a],n[a],s,f),!c)for(++a,u=0;u1||-1==s?(a=Pp(u,15),i.Wb(ehk(e,a))):i.Wb(eI4(e,Pp(u,56))))}function eyP(e,t,n,r){wd();var i=eUn;function a(){for(var e=0;eeVW);)i>-.000001&&++n;return n}function eyW(e,t){var n;t!=e.b?(n=null,e.b&&(n=$7(e.b,e,-4,n)),t&&(n=ep0(t,e,-4,n)),(n=ecm(e,t,n))&&n.Fi()):(4&e.Db)!=0&&(1&e.Db)==0&&eam(e,new FX(e,1,3,t,t))}function eyK(e,t){var n;t!=e.f?(n=null,e.f&&(n=$7(e.f,e,-1,n)),t&&(n=ep0(t,e,-1,n)),(n=ecg(e,t,n))&&n.Fi()):(4&e.Db)!=0&&(1&e.Db)==0&&eam(e,new FX(e,1,0,t,t))}function eyV(e){var t,n,r;if(null==e)return null;if((n=Pp(e,15)).dc())return"";for(r=new vs,t=n.Kc();t.Ob();)xk(r,(eR7(),Lq(t.Pb()))),r.a+=" ";return x3(r,r.a.length-1)}function eyq(e){var t,n,r;if(null==e)return null;if((n=Pp(e,15)).dc())return"";for(r=new vs,t=n.Kc();t.Ob();)xk(r,(eR7(),Lq(t.Pb()))),r.a+=" ";return x3(r,r.a.length-1)}function eyZ(e,t,n){var r,i;return(r=e.c[t.c.p][t.p],i=e.c[n.c.p][n.p],null!=r.a&&null!=i.a)?F_(r.a,i.a):null!=r.a?-1:null!=i.a?1:0}function eyX(e,t){var n,r,i,a,o,s;if(t)for(a=t.a.length,s=((n=new Fs(a)).b-n.a)*n.c<0?(_8(),eB3):new OR(n);s.Ob();)i=KZ(t,(o=Pp(s.Pb(),19)).a),UX((r=new pu(e)).a,i)}function eyJ(e,t){var n,r,i,a,o,s;if(t)for(a=t.a.length,s=((n=new Fs(a)).b-n.a)*n.c<0?(_8(),eB3):new OR(n);s.Ob();)i=KZ(t,(o=Pp(s.Pb(),19)).a),UZ((r=new h7(e)).a,i)}function eyQ(e){var t;if(null!=e&&e.length>0&&33==UI(e,e.length-1))try{return t=eSR(Az(e,0,e.length-1)),null==t.e}catch(n){if(n=eoa(n),!M4(n,32))throw p7(n)}return!1}function ey1(e,t,n){var r,i,a;return r=t.ak(),a=t.dd(),i=r.$j()?$N(e,3,r,null,a,eN1(e,r,a,M4(r,99)&&(Pp(r,18).Bb&eH3)!=0),!0):$N(e,1,r,r.zj(),a,-1,!0),n?n.Ei(i):n=i,n}function ey0(){var e,t,n;for(e=0,t=0;e<1;e++){if(0==(n=eTa((GV(e,1),"X".charCodeAt(e)))))throw p7(new gX("Unknown Option: "+"X".substr(e)));t|=n}return t}function ey2(e,t,n){var r,i,a;switch(i=el0(r=Bq(t)),a=new eES,Gc(a,t),n.g){case 1:ekv(a,elC(ef8(i)));break;case 2:ekv(a,ef8(i))}return eo3(a,(eBy(),toc),LV(e_k(e,toc))),a}function ey3(e){var t,n;return t=Pp(ZC(new Fa(OH(efu(e.a).a.Kc(),new c))),17),n=Pp(ZC(new Fa(OH(efc(e.a).a.Kc(),new c))),17),gN(LK(e_k(t,(eBU(),tnE))))||gN(LK(e_k(n,tnE)))}function ey4(){ey4=A,ter=new Sa("ONE_SIDE",0),tea=new Sa("TWO_SIDES_CORNER",1),teo=new Sa("TWO_SIDES_OPPOSING",2),tei=new Sa("THREE_SIDES",3),ten=new Sa("FOUR_SIDES",4)}function ey6(e,t,n,r,i){var a,o;a=Pp(qE(UJ(t.Oc(),new ih),JF(new U,new B,new en,eow(vx(e2L,1),eU4,132,0,[(eum(),e2U)]))),15),o=Pp(eay(e.b,n,r),15),0==i?o.Wc(0,a):o.Gc(a)}function ey5(e,t){var n,r,i,a,o;for(a=new fz(t.a);a.a0&&egL(this,this.c-1,(eYu(),tby)),this.c0&&e[0].length>0&&(this.c=gN(LK(e_k(Bq(e[0][0]),(eBU(),tne))))),this.a=Je(e6d,eUP,2018,e.length,0,2),this.b=Je(e6h,eUP,2019,e.length,0,2),this.d=new euX}function ewu(e){return 0!=e.c.length&&((GK(0,e.c.length),Pp(e.c[0],17)).c.i.k==(eEn(),e9D)||q3(UQ(new R1(null,new Gq(e,16)),new iJ),new iQ))}function ewc(e,t,n){return ewG(n,"Tree layout",1),Kx(e.b),Yb(e.b,(egR(),tuJ),tuJ),Yb(e.b,tuQ,tuQ),Yb(e.b,tu1,tu1),Yb(e.b,tu0,tu0),e.a=eRq(e.b,t),eAG(e,t,eiI(n,1)),eEj(n),t}function ewl(e,t){var n,r,i,a,o,s,u;for(s=eLj(t),a=t.f,u=t.g,o=eB4.Math.sqrt(a*a+u*u),i=0,r=new fz(s);r.a=0?(n=eyt(e,eHK),r=edQ(e,eHK)):(n=eyt(t=Fy(e,1),5e8),r=eft(Fg(r=edQ(t,5e8),1),WM(e,1))),WO(Fg(r,32),WM(n,eH9))}function ewM(e,t,n){var r,i;switch(r=(A5(0!=t.b),Pp(etw(t,t.a.a),8)),n.g){case 0:r.b=0;break;case 2:r.b=e.f;break;case 3:r.a=0;break;default:r.a=e.g}return YU(i=epL(t,0),r),t}function ewO(e,t,n,r){var i,a,o,s,u;switch(u=e.b,s=epd(o=(a=t.d).j,u.d[o.g],n),i=C6(MB(a.n),a.a),a.j.g){case 1:case 3:s.a+=i.a;break;case 2:case 4:s.b+=i.b}qQ(r,s,r.c.b,r.c)}function ewA(e,t,n){var r,i,a,o;for(o=QI(e.e,t,0),(a=new ma).b=n,r=new KB(e.e,o);r.b1;t>>=1)(1&t)!=0&&(r=eeD(r,n)),n=1==n.d?eeD(n,n):new eh6(eDE(n.a,n.d,Je(ty_,eHT,25,n.d<<1,15,1)));return eeD(r,n)}function ewP(){var e,t,n,r;for(t=32,ewP=A,e2v=Je(tyx,eH6,25,25,15,1),e2y=Je(tyx,eH6,25,33,15,1),r=152587890625e-16;t>=0;t--)e2y[t]=r,r*=.5;for(e=24,n=1;e>=0;e--)e2v[e]=n,n*=.5}function ewR(e){var t,n;if(gN(LK(eT9(e,(eBy(),taI))))){for(n=new Fa(OH(eOi(e).a.Kc(),new c));eTk(n);)if(t=Pp(ZC(n),79),exb(t)&&gN(LK(eT9(t,taD))))return!0}return!1}function ewj(e,t){var n,r,i;Yf(e.f,t)&&(t.b=e,r=t.c,-1!=QI(e.j,r,0)||P_(e.j,r),i=t.d,-1!=QI(e.j,i,0)||P_(e.j,i),0!=(n=t.a.b).c.length&&(e.i||(e.i=new epS(e)),ea_(e.i,n)))}function ewF(e){var t,n,r,i,a;return(r=(n=e.c.d).j)==(a=(i=e.d.d).j)?n.p=0&&IE(e.substr(t,3),"GMT")?(n[0]=t+3,eDh(e,n,r)):(t>=0&&IE(e.substr(t,3),"UTC")&&(n[0]=t+3),eDh(e,n,r))}function ewz(e,t){var n,r,i,a,o;for(a=e.g.a,o=e.g.b,r=new fz(e.d);r.an;a--)e[a]|=t[a-n-1]>>>o,e[a-1]=t[a-n-1]<=e.f)break;a.c[a.c.length]=n}return a}function ew1(e){var t,n,r,i;for(t=null,i=new fz(e.wf());i.a0&&ePD(e.g,t,e.g,t+r,s),o=n.Kc(),e.i+=r,i=0;ia&&F5(c,ee6(n[s],e2h))&&(i=s,a=u);return i>=0&&(r[0]=t+a),i}function ew8(e,t){var n;if(0!=(n=To(e.b.Hf(),t.b.Hf())))return n;switch(e.b.Hf().g){case 1:case 2:return ME(e.b.sf(),t.b.sf());case 3:case 4:return ME(t.b.sf(),e.b.sf())}return 0}function ew9(e){var t,n,r;for(r=e.e.c.length,e.a=RF(ty_,[eUP,eHT],[48,25],15,[r,r],2),n=new fz(e.c);n.a>4&15,a=15&e[r],o[i++]=tmk[n],o[i++]=tmk[a];return ehv(o,0,o.length)}function e_t(e,t,n){var r,i,a;return r=t.ak(),a=t.dd(),i=r.$j()?$N(e,4,r,a,null,eN1(e,r,a,M4(r,99)&&(Pp(r,18).Bb&eH3)!=0),!0):$N(e,r.Kj()?2:1,r,a,r.zj(),-1,!0),n?n.Ei(i):n=i,n}function e_n(e){var t,n;return e>=eH3?(t=eH4+(e-eH3>>10&1023)&eHd,n=56320+(e-eH3&1023)&eHd,String.fromCharCode(t)+""+String.fromCharCode(n)):String.fromCharCode(e&eHd)}function e_r(e,t){var n,r,i,a;return Cn(),(i=Pp(Pp(Zq(e.r,t),21),84)).gc()>=2&&(r=Pp(i.Kc().Pb(),111),n=e.u.Hc((ekU(),tbh)),a=e.u.Hc(tbg),!r.a&&!n&&(2==i.gc()||a))}function e_i(e,t,n,r,i){var a,o,s;for(a=eLx(e,t,n,r,i),s=!1;!a;)eME(e,i,!0),s=!0,a=eLx(e,t,n,r,i);s&&eME(e,i,!1),0!=(o=eoA(i)).c.length&&(e.d&&e.d.lg(o),e_i(e,i,n,r,o))}function e_a(){e_a=A,tpN=new km(eGR,0),tpI=new km("DIRECTED",1),tpP=new km("UNDIRECTED",2),tpL=new km("ASSOCIATION",3),tpD=new km("GENERALIZATION",4),tpC=new km("DEPENDENCY",5)}function e_o(e,t){var n;if(!zY(e))throw p7(new gC(eZL));switch(n=zY(e),t.g){case 1:return-(e.j+e.f);case 2:return e.i-n.g;case 3:return e.j-n.f;case 4:return-(e.i+e.g)}return 0}function e_s(e,t){var n,r;for(BJ(t),r=e.b.c.length,P_(e.b,t);r>0;){if(n=r,r=(r-1)/2|0,0>=e.a.ue(RJ(e.b,r),t))return q1(e.b,n,t),!0;q1(e.b,n,RJ(e.b,r))}return q1(e.b,r,t),!0}function e_u(e,t,n,r){var i,a;if(i=0,n)i=euW(e.a[n.g][t.g],r);else for(a=0;a=s)}function e_l(e,t,n,r){var i;if(i=!1,xd(r)&&(i=!0,P4(t,n,Lq(r))),!i&&xl(r)&&(i=!0,e_l(e,t,n,r)),!i&&M4(r,236)&&(i=!0,H1(t,n,Pp(r,236))),!i)throw p7(new gk(eXE))}function e_f(e,t){var n,r,i;if((n=t.Hh(e.a))&&null!=(i=edW((n.b||(n.b=new L_((eBK(),tgF),tgf,n)),n.b),eQe))){for(r=1;r<(eSp(),tvs).length;++r)if(IE(tvs[r],i))return r}return 0}function e_d(e,t){var n,r,i;if((n=t.Hh(e.a))&&null!=(i=edW((n.b||(n.b=new L_((eBK(),tgF),tgf,n)),n.b),eQe))){for(r=1;r<(eSp(),tvu).length;++r)if(IE(tvu[r],i))return r}return 0}function e_h(e,t){var n,r,i,a;if(BJ(t),(a=e.a.gc())0?1:0;a.a[i]!=n;)a=a.a[i],i=e.a.ue(n.d,a.d)>0?1:0;a.a[i]=r,r.b=n.b,r.a[0]=n.a[0],r.a[1]=n.a[1],n.a[0]=null,n.a[1]=null}function e_y(e){var t,n;return ekU(),t=jL(tbp,eow(vx(e5i,1),eU4,273,0,[tbm])),!(eaC(z_(t,e))>1)&&(n=jL(tbh,eow(vx(e5i,1),eU4,273,0,[tbd,tbg])),!(eaC(z_(n,e))>1))}function e_w(e,t){var n;M4(n=zg((_Q(),tgp),e),498)?Ge(tgp,e,new k6(this,t)):Ge(tgp,e,this),e_9(this,t),t==(yO(),tgg)?(this.wb=Pp(this,1939),Pp(t,1941)):this.wb=(BM(),tgv)}function e__(e){var t,n,r;if(null==e)return null;for(n=0,t=null;n=eHf?"error":r>=900?"warn":r>=800?"info":"log",e.a),e.b&&eAp(t,n,e.b,"Exception: ",!0))}function e_k(e,t){var n,r;return null!=(r=(e.q||(e.q=new p2),Bp(e.q,t)))?r:(M4(n=t.wg(),4)&&(null==n?(e.q||(e.q=new p2),Z3(e.q,t)):(e.q||(e.q=new p2),Um(e.q,t,n))),n)}function e_x(){e_x=A,e9e=new Ez("P1_CYCLE_BREAKING",0),e9t=new Ez("P2_LAYERING",1),e9n=new Ez("P3_NODE_ORDERING",2),e9r=new Ez("P4_NODE_PLACEMENT",3),e9i=new Ez("P5_EDGE_ROUTING",4)}function e_T(e,t){var n,r,i,a,o;for(r=(i=1==t?e9c:e9u).a.ec().Kc();r.Ob();)for(n=Pp(r.Pb(),103),o=Pp(Zq(e.f.c,n),21).Kc();o.Ob();)a=Pp(o.Pb(),46),QA(e.b.b,a.b),QA(e.b.a,Pp(a.b,81).d)}function e_M(e,t){var n;if(eeP(),e.c!=t.c)return elN(e.c,t.c);if(e.b==t.b||eiS(e.b,t.b)){if(n=Tu(e.b)?1:-1,e.a&&!t.a)return n;if(!e.a&&t.a)return-n}return ME(e.b.g,t.b.g)}function e_O(e,t){var n;ewG(t,"Hierarchical port position processing",1),(n=e.b).c.length>0&&eI5((GK(0,n.c.length),Pp(n.c[0],29)),e),n.c.length>1&&eI5(Pp(RJ(n,n.c.length-1),29),e),eEj(t)}function e_A(e,t){var n,r,i;if(e_Y(e,t))return!0;for(r=new fz(t);r.a=(i=e.Vi())||t<0)throw p7(new gE(eXU+t+eXH+i));if(n>=i||n<0)throw p7(new gE(eX$+n+eXH+i));return t!=n?(a=e.Ti(n),e.Hi(t,a),a):e.Oi(n)}function e_j(e){var t,n,r;if(r=e,e)for(t=0,n=e.Ug();n;n=n.Ug()){if(++t>eH5)return e_j(n);if(r=n,n==e)throw p7(new gC("There is a cycle in the containment hierarchy of "+e))}return r}function e_F(e){var t,n,r;for(r=new eaP(eUd,"[","]"),n=e.Kc();n.Ob();)ZJ(r,xc(t=n.Pb())===xc(e)?"(this Collection)":null==t?eUg:efF(t));return r.a?0==r.e.length?r.a.a:r.a.a+""+r.e:r.c}function e_Y(e,t){var n,r;if(r=!1,2>t.gc())return!1;for(n=0;n=e.charCodeAt(r));)++r;for(t=n;t>r&&(GV(t-1,e.length),32>=e.charCodeAt(t-1));)--t;return r>0||t1&&(e.j.b+=e.e)):(e.j.a+=n.a,e.j.b=eB4.Math.max(e.j.b,n.b),e.d.c.length>1&&(e.j.a+=e.e))}function e_z(){e_z=A,tec=eow(vx(e5a,1),eGj,61,0,[(eYu(),tbw),tby,tbj]),teu=eow(vx(e5a,1),eGj,61,0,[tby,tbj,tbY]),tel=eow(vx(e5a,1),eGj,61,0,[tbj,tbY,tbw]),tef=eow(vx(e5a,1),eGj,61,0,[tbY,tbw,tby])}function e_G(e,t,n,r){var i,a,o,s,u,c,l;if(o=e.c.d,s=e.d.d,o.j!=s.j)for(l=e.b,i=o.j,u=null;i!=s.j;)u=0==t?elI(i):elL(i),P7(r,C6(a=epd(i,l.d[i.g],n),c=epd(u,l.d[u.g],n))),i=u}function e_W(e,t,n,r){var i,a,o,s,u;return o=egN(e.a,t,n),s=Pp(o.a,19).a,a=Pp(o.b,19).a,r&&(u=Pp(e_k(t,(eBU(),tng)),10),i=Pp(e_k(n,tng),10),u&&i&&(V5(e.b,u,i),s+=e.b.i,a+=e.b.e)),s>a}function e_K(e){var t,n,r,i,a,o,s,u,c;for(r=0,this.a=ebb(e),this.b=new p0,i=(n=e).length;rL7(e.d).c?(e.i+=e.g.c,ed3(e.d)):L7(e.d).c>L7(e.g).c?(e.e+=e.d.c,ed3(e.g)):(e.i+=R5(e.g),e.e+=R5(e.d),ed3(e.g),ed3(e.d))}function e_X(e,t,n){var r,i,a,o;for(a=t.q,o=t.r,new GT((Xa(),tuU),t,a,1),new GT(tuU,a,o,1),i=new fz(n);i.as&&(u=s/r),i>a&&(c=a/i),o=eB4.Math.min(u,c),e.a+=o*(t.a-e.a),e.b+=o*(t.b-e.b)}function e_6(e,t,n,r,i){var a,o;for(o=!1,a=Pp(RJ(n.b,0),33);eNK(e,t,a,r,i)&&(o=!0,eyL(n,a),0!=n.b.c.length);)a=Pp(RJ(n.b,0),33);return 0==n.b.c.length&&eva(n.j,n),o&&emG(t.q),o}function e_5(e,t){var n,r,i,a;if(eLG(),t.b<2)return!1;for(r=n=Pp(Vv(a=epL(t,0)),8);a.b!=a.d.c;){if(eOV(e,r,i=Pp(Vv(a),8)))return!0;r=i}return!!eOV(e,r,n)}function e_8(e,t,n,r){var i,a;return 0==n?(e.o||(e.o=new JY((eBa(),tmy),e5O,e,0)),Iz(e.o,t,r)):(a=Pp(ee2((i=Pp(eaS(e,16),26))||e.zh(),n),66)).Nj().Rj(e,ehH(e),n-Y1(e.zh()),t,r)}function e_9(e,t){var n;t!=e.sb?(n=null,e.sb&&(n=Pp(e.sb,49).ih(e,1,e5w,n)),t&&(n=Pp(t,49).gh(e,1,e5w,n)),(n=ecY(e,t,n))&&n.Fi()):(4&e.Db)!=0&&(1&e.Db)==0&&eam(e,new FX(e,1,4,t,t))}function e_7(e,t){var n,r,i,a;if(t)i=enm(t,"x"),enr((n=new pa(e)).a,(BJ(i),i)),a=enm(t,"y"),enc((r=new po(e)).a,(BJ(a),a));else throw p7(new gK("All edge sections need an end point."))}function eEe(e,t){var n,r,i,a;if(t)i=enm(t,"x"),enu((n=new pn(e)).a,(BJ(i),i)),a=enm(t,"y"),enl((r=new pr(e)).a,(BJ(a),a));else throw p7(new gK("All edge sections need a start point."))}function eEt(e,t){var n,r,i,a,o,s,u;for(r=es1(e),a=0,s=r.length;a>22-t,i=e.h<>22-t):t<44?(n=0,r=e.l<>44-t):(n=0,r=0,i=e.l<e))return 0==t||t==e?1:0==e?0:ev5(e)/(ev5(t)*ev5(e-t));throw p7(new gL("k must be smaller than n"))}function eEh(e,t){var n,r,i,a;for(n=new TY(e);null!=n.g||n.c?null==n.g||0!=n.i&&Pp(n.g[n.i-1],47).Ob():zW(n);)if(M4(a=Pp(eM6(n),56),160))for(i=0,r=Pp(a,160);i>4],t[2*n+1]=tv0[15&a];return ehv(t,0,t.length)}function eEA(e){var t,n,r;switch(U_(),r=e.c.length){case 0:return e0p;case 1:return P2((t=Pp(ekM(new fz(e)),42)).cd(),t.dd());default:return n=Pp(epg(e,Je(e1$,eUK,42,e.c.length,0,1)),165),new gt(n)}}function eEL(e){var t,n,r,i,a,o;for(t=new p1,n=new p1,Vw(t,e),Vw(n,e);n.b!=n.c;)for(i=Pp(Yn(n),37),o=new fz(i.a);o.a0&&eIl(e,n,t),i):exV(e,t,n)}function eEN(e,t,n){var r,i,a,o;if(0!=t.b){for(r=new _n,o=epL(t,0);o.b!=o.d.c;)er7(r,eoO(a=Pp(Vv(o),86))),(i=a.e).a=Pp(e_k(a,(eR5(),tcg)),19).a,i.b=Pp(e_k(a,tcv),19).a;eEN(e,r,eiI(n,r.b/e.a|0))}}function eEP(e,t){var n,r,i,a,o;if(e.e<=t||Wm(e,e.g,t))return e.g;for(a=e.r,r=e.g,o=e.r,i=(a-r)/2+r;r+11&&(e.e.b+=e.a)):(e.e.a+=n.a,e.e.b=eB4.Math.max(e.e.b,n.b),e.d.c.length>1&&(e.e.a+=e.a))}function eEH(e){var t,n,r,i;switch(t=(i=e.i).b,r=i.j,n=i.g,i.a.g){case 0:n.a=(e.g.b.o.a-r.a)/2;break;case 1:n.a=t.d.n.a+t.d.a.a;break;case 2:n.a=t.d.n.a+t.d.a.a-r.a;break;case 3:n.b=t.d.n.b+t.d.a.b}}function eE$(e,t,n,r,i){if(rr&&(e.a=r),e.bi&&(e.b=i),e}function eEz(e){if(M4(e,149))return eAi(Pp(e,149));if(M4(e,229))return efZ(Pp(e,229));if(M4(e,23))return eEa(Pp(e,23));throw p7(new gL(eXx+e_F(new g$(eow(vx(e1R,1),eUp,1,5,[e])))))}function eEG(e,t,n,r,i){var a,o,s;for(o=0,a=!0;o>>i|n[o+r+1]<>>i,++o}return a}function eEW(e,t,n,r){var i,a,o;if(t.k==(eEn(),e9D)){for(a=new Fa(OH(efu(t).a.Kc(),new c));eTk(a);)if((o=(i=Pp(ZC(a),17)).c.i.k)==e9D&&e.c.a[i.c.i.c.p]==r&&e.c.a[t.c.p]==n)return!0}return!1}function eEK(e,t){var n,r,i,a;return t&=63,n=e.h&eH$,t<22?(a=n>>>t,i=e.m>>t|n<<22-t,r=e.l>>t|e.m<<22-t):t<44?(a=0,i=n>>>t-22,r=e.m>>t-22|e.h<<44-t):(a=0,i=0,r=n>>>t-44),Mk(r&eHH,i&eHH,a&eH$)}function eEV(e,t,n,r){var i;this.b=r,this.e=e==(enU(),tui),i=t[n],this.d=RF(tyE,[eUP,e$6],[177,25],16,[i.length,i.length],2),this.a=RF(ty_,[eUP,eHT],[48,25],15,[i.length,i.length],2),this.c=new ewo(t,n)}function eEq(e){var t,n,r;for(e.k=new G$((eYu(),eow(vx(e5a,1),eGj,61,0,[tbF,tbw,tby,tbj,tbY])).length,e.j.c.length),r=new fz(e.j);r.a=n)return eE6(e,t,r.p),!0;return!1}function eE1(e){var t;return(64&e.Db)!=0?eEp(e):(t=new O0(eZ$),e.a&&xM(xM((t.a+=' "',t),e.a),'"'),xM(yW(xM(yW(xM(yW(xM(yW((t.a+=" (",t),e.i),","),e.j)," | "),e.g),","),e.f),")"),t.a)}function eE0(e,t,n){var r,i,a,o,s;for(o=0,s=eAY(e.e.Tg(),t),i=Pp(e.g,119),r=0;on?eS1(e,n,"start index"):t<0||t>n?eS1(t,n,"end index"):eCG("end index (%s) must not be less than start index (%s)",eow(vx(e1R,1),eUp,1,5,[ell(t),ell(e)]))}function eE4(e,t){var n,r,i,a;for(r=0,i=e.length;r0&&eE8(e,a,n));t.p=0}function eE9(e){var t;this.c=new _n,this.f=e.e,this.e=e.d,this.i=e.g,this.d=e.c,this.b=e.b,this.k=e.j,this.a=e.a,e.i?this.j=e.i:this.j=(t=Pp(yw(e6Q),9),new I1(t,Pp(CY(t,t.length),9),0)),this.g=e.f}function eE7(e){var t,n,r,i;for(t=Bd(xM(new O0("Predicates."),"and"),40),n=!0,i=new fE(e);i.b0?s[o-1]:Je(e4N,eGW,10,0,0,1),i=s[o],c=o=0?e.Bh(i):ekN(e,r);else throw p7(new gL(eZV+r.ne()+eZq))}else throw p7(new gL(eZJ+t+eZQ))}else ec5(e,n,r)}function eSa(e){var t,n;if(n=null,t=!1,M4(e,204)&&(t=!0,n=Pp(e,204).a),!t&&M4(e,258)&&(t=!0,n=""+Pp(e,258).a),!t&&M4(e,483)&&(t=!0,n=""+Pp(e,483).a),!t)throw p7(new gk(eXE));return n}function eSo(e,t){var n,r;if(!e.f)return t.Ob();for(;t.Ob();)if(M4(r=(n=Pp(t.Pb(),72)).ak(),99)&&(Pp(r,18).Bb&eZ1)!=0&&(!e.e||r.Gj()!=e5d||0!=r.aj())&&null!=n.dd())return t.Ub(),!0;return!1}function eSs(e,t){var n,r;if(!e.f)return t.Sb();for(;t.Sb();)if(M4(r=(n=Pp(t.Ub(),72)).ak(),99)&&(Pp(r,18).Bb&eZ1)!=0&&(!e.e||r.Gj()!=e5d||0!=r.aj())&&null!=n.dd())return t.Pb(),!0;return!1}function eSu(e,t,n){var r,i,a,o,s,u;for(o=0,u=eAY(e.e.Tg(),t),r=0,s=e.i,i=Pp(e.g,119);o1&&(t.c[t.c.length]=a)}function eSf(e){var t,n,r,i;for(er7(n=new _n,e.o),r=new mc;0!=n.b;)(i=eYP(e,t=Pp(0==n.b?null:(A5(0!=n.b),etw(n,n.a.a)),508),!0))&&P_(r.a,t);for(;0!=r.a.c.length;)eYP(e,t=Pp(euO(r),508),!1)}function eSd(){eSd=A,tdS=new ks(ezo,0),tdm=new ks("BOOLEAN",1),tdw=new ks("INT",2),tdE=new ks("STRING",3),tdg=new ks("DOUBLE",4),tdv=new ks("ENUM",5),tdy=new ks("ENUMSET",6),td_=new ks("OBJECT",7)}function eSh(e,t){var n,r,i,a,o;r=eB4.Math.min(e.c,t.c),a=eB4.Math.min(e.d,t.d),i=eB4.Math.max(e.c+e.b,t.c+t.b),o=eB4.Math.max(e.d+e.a,t.d+t.a),i=(i/2|0))for(this.e=r?r.c:null,this.d=i;n++0;)Gi(this);this.b=t,this.a=null}function eSk(e,t){var n,r;t.a?eAk(e,t):((n=Pp(Ik(e.b,t.b),57))&&n==e.a[t.b.f]&&n.a&&n.a!=t.b.a&&n.c.Fc(t.b),(r=Pp(IS(e.b,t.b),57))&&e.a[r.f]==t.b&&r.a&&r.a!=t.b.a&&t.b.c.Fc(r),Ai(e.b,t.b))}function eSx(e,t){var n,r;if(n=Pp(UA(e.b,t),124),Pp(Pp(Zq(e.r,t),21),84).dc()){n.n.b=0,n.n.c=0;return}n.n.b=e.C.b,n.n.c=e.C.c,e.A.Hc((ed5(),tbq))&&eCD(e,t),r=ebi(e,t),eLZ(e,t)==(epT(),tbt)&&(r+=2*e.w),n.a.a=r}function eST(e,t){var n,r;if(n=Pp(UA(e.b,t),124),Pp(Pp(Zq(e.r,t),21),84).dc()){n.n.d=0,n.n.a=0;return}n.n.d=e.C.d,n.n.a=e.C.a,e.A.Hc((ed5(),tbq))&&eCN(e,t),r=eba(e,t),eLZ(e,t)==(epT(),tbt)&&(r+=2*e.w),n.a.b=r}function eSM(e,t){var n,r,i,a;for(a=new p0,r=new fz(t);r.aeB4.Math.abs(r-i))}function eSU(e,t,n){var r,i,a,o,s,u;if(null!=(s=Pp(eaS(e.a,8),1936)))for(a=0,o=(i=s).length;an.a&&(r.Hc((eyY(),tdW))?i=(t.a-n.a)/2:r.Hc(tdV)&&(i=t.a-n.a)),t.b>n.b&&(r.Hc((eyY(),tdZ))?a=(t.b-n.b)/2:r.Hc(tdq)&&(a=t.b-n.b)),e_g(e,i,a)}function eSJ(e,t,n,r,i,a,o,s,u,c,l,f,d){M4(e.Cb,88)&&eko(Zd(Pp(e.Cb,88)),4),er3(e,n),e.f=o,elY(e,s),elU(e,u),elF(e,c),elB(e,l),els(e,f),elZ(e,d),eli(e,!0),end(e,i),e.ok(a),eu2(e,t),null!=r&&(e.i=null,erA(e,r))}function eSQ(e){var t,n;if(!e.f)return e.n>0;for(;e.n>0;){if(M4(n=(t=Pp(e.k.Xb(e.n-1),72)).ak(),99)&&(Pp(n,18).Bb&eZ1)!=0&&(!e.e||n.Gj()!=e5d||0!=n.aj())&&null!=t.dd())return!0;--e.n}return!1}function eS1(e,t,n){if(e<0)return eCG(eUh,eow(vx(e1R,1),eUp,1,5,[n,ell(e)]));if(!(t<0))return eCG("%s (%s) must not be greater than size (%s)",eow(vx(e1R,1),eUp,1,5,[n,ell(e),ell(t)]));throw p7(new gL(eUb+t))}function eS0(e,t,n,r,i,a){var o,s,u,c;if((o=r-n)<7){efA(t,n,r,a);return}if(c=(u=n+i)+((s=r+i)-u>>1),eS0(t,e,u,c,-i,a),eS0(t,e,c,s,-i,a),0>=a.ue(e[c-1],e[c])){for(;n=0?e.sh(a,n):eOh(e,i,n);else throw p7(new gL(eZV+i.ne()+eZq))}else throw p7(new gL(eZJ+t+eZQ))}else efL(e,r,i,n)}function eS5(e){var t,n,r,i;if(n=Pp(e,49).qh())try{if(r=null,(t=eMC((_Q(),tgp),eDv(efR(n))))&&(i=t.rh())&&(r=i.Wk(gF(n.e))),r&&r!=e)return eS5(r)}catch(a){if(a=eoa(a),!M4(a,60))throw p7(a)}return e}function eS8(e,t,n){var r,i,a,o;if(o=null==t?0:e.b.se(t),0==(i=null==(r=e.a.get(o))?[]:r).length)e.a.set(o,i);else if(a=euj(e,t,i))return a.ed(n);return Bc(i,i.length,new EE(t,n)),++e.c,$c(e.b),null}function eS9(e,t){var n,r;return Kx(e.a),Yb(e.a,(erZ(),tcq),tcq),Yb(e.a,tcZ,tcZ),r=new K2,RI(r,tcZ,(efx(),tc1)),xc(eT9(t,(egj(),tlf)))!==xc((eub(),tc6))&&RI(r,tcZ,tcJ),RI(r,tcZ,tcQ),Tb(e.a,r),n=eRq(e.a,t)}function eS7(e){if(!e)return g3(),e0M;var t=e.valueOf?e.valueOf():e;if(t!==e){var n=e0O[typeof t];return n?n(t):euV(typeof t)}return e instanceof Array||e instanceof eB4.Array?new lL(e):new lD(e)}function eke(e,t,n){var r,i,a;switch(a=e.o,(i=(r=Pp(UA(e.p,n),244)).i).b=ek0(r),i.a=ek1(r),i.b=eB4.Math.max(i.b,a.a),i.b>a.a&&!t&&(i.b=a.a),i.c=-(i.b-a.a)/2,n.g){case 1:i.d=-i.a;break;case 3:i.d=a.b}eNE(r),eNM(r)}function ekt(e,t,n){var r,i,a;switch(a=e.o,(i=(r=Pp(UA(e.p,n),244)).i).b=ek0(r),i.a=ek1(r),i.a=eB4.Math.max(i.a,a.b),i.a>a.b&&!t&&(i.a=a.b),i.d=-(i.a-a.b)/2,n.g){case 4:i.c=-i.b;break;case 2:i.c=a.a}eNE(r),eNM(r)}function ekn(e,t){var n,r,i,a,o;if(!t.dc()){if(i=Pp(t.Xb(0),128),1==t.gc()){eA1(e,i,i,1,0,t);return}for(n=1;n0)try{i=eDa(t,eHt,eUu)}catch(a){if(a=eoa(a),M4(a,127))throw r=a,p7(new QH(r));throw p7(a)}return i<(n=(e.a||(e.a=new pK(e)),e.a)).i&&i>=0?Pp(etj(n,i),56):null}function eku(e,t){if(e<0)return eCG(eUh,eow(vx(e1R,1),eUp,1,5,["index",ell(e)]));if(!(t<0))return eCG("%s (%s) must be less than size (%s)",eow(vx(e1R,1),eUp,1,5,["index",ell(e),ell(t)]));throw p7(new gL(eUb+t))}function ekc(e){var t,n,r,i,a;if(null==e)return eUg;for(r=0,a=new eaP(eUd,"[","]"),i=(n=e).length;re.a.ue(RJ(e.b,o),RJ(e.b,a))&&(s=o),s),!(0>e.a.ue(i,RJ(e.b,r))));)q1(e.b,t,RJ(e.b,r)),t=r;q1(e.b,t,i)}function ekp(e,t,n,r,i,a){var o,s,u,c,l;for(xc(e)===xc(n)&&(e=e.slice(t,t+i),t=0),u=n,s=t,c=t+i;s0)for(o=e.c.d,s=e.d.d,i=Ol(C5(new kl(s.a,s.b),o),1/(r+1)),a=new kl(o.a,o.b),n=new fz(e.a);n.a=0?e._g(n,!0,!0):exk(e,i,!0),153),Pp(r,215).ol(t);else throw p7(new gL(eZV+t.ne()+eZq))}function ekP(e){var t,n;return e>-140737488355328&&e<0x800000000000?0==e?0:((t=e<0)&&(e=-e),n=zy(eB4.Math.floor(eB4.Math.log(e)/.6931471805599453)),(!t||e!=eB4.Math.pow(2,n))&&++n,n):eaJ(eap(e))}function ekR(e){var t,n,r,i,a,o,s;for(a=new Tw,n=new fz(e);n.a2&&s.e.b+s.j.b<=2&&(i=s,r=o),a.a.zc(i,a),i.q=r);return a}function ekj(e,t){var n,r,i;return r=new eb$(e),eaW(r,t),eo3(r,(eBU(),ttQ),t),eo3(r,(eBy(),tol),(ewf(),tbo)),eo3(r,tiq,(ebx(),tdA)),lK(r,(eEn(),e9C)),n=new eES,Gc(n,r),ekv(n,(eYu(),tbY)),i=new eES,Gc(i,r),ekv(i,tby),r}function ekF(e){switch(e.g){case 0:return new gx((enU(),tur));case 1:return new cC;case 2:return new cF;default:throw p7(new gL("No implementation is available for the crossing minimizer "+(null!=e.f?e.f:""+e.g)))}}function ekY(e,t){var n,r,i,a,o;for(e.c[t.p]=!0,P_(e.a,t),o=new fz(t.j);o.a=(a=o.gc()))o.$b();else for(r=0,i=o.Kc();r0?g6():o<0&&ekJ(e,t,-o),!0)}function ek1(e){var t,n,r,i,a,o,s;if(s=0,0==e.b){for(i=0,o=eb4(e,!0),t=0,a=(r=o).length;i0&&(s+=n,++t);t>1&&(s+=e.c*(t-1))}else s=vy(eib(U1(UJ(Yw(e.a),new eS),new ek)));return s>0?s+e.n.d+e.n.a:0}function ek0(e){var t,n,r,i,a,o,s;if(s=0,0==e.b)s=vy(eib(U1(UJ(Yw(e.a),new e_),new eE)));else{for(i=0,o=eb6(e,!0),t=0,a=(r=o).length;i0&&(s+=n,++t);t>1&&(s+=e.c*(t-1))}return s>0?s+e.n.b+e.n.c:0}function ek2(e,t){var n,r,i,a;for(n=(a=Pp(UA(e.b,t),124)).a,i=Pp(Pp(Zq(e.r,t),21),84).Kc();i.Ob();)(r=Pp(i.Pb(),111)).c&&(n.a=eB4.Math.max(n.a,Rd(r.c)));if(n.a>0)switch(t.g){case 2:a.n.c=e.s;break;case 4:a.n.b=e.s}}function ek3(e,t){var n,r,i;return 0==(n=Pp(e_k(t,(eCk(),e8M)),19).a-Pp(e_k(e,e8M),19).a)?(r=C5(MB(Pp(e_k(e,(erV(),e8P)),8)),Pp(e_k(e,e8R),8)),i=C5(MB(Pp(e_k(t,e8P),8)),Pp(e_k(t,e8R),8)),elN(r.a*r.b,i.a*i.b)):n}function ek4(e,t){var n,r,i;return 0==(n=Pp(e_k(t,(eTj(),tcD)),19).a-Pp(e_k(e,tcD),19).a)?(r=C5(MB(Pp(e_k(e,(eR5(),tce)),8)),Pp(e_k(e,tct),8)),i=C5(MB(Pp(e_k(t,tce),8)),Pp(e_k(t,tct),8)),elN(r.a*r.b,i.a*i.b)):n}function ek6(e){var t,n;return n=new vc,n.a+="e_",null!=(t=eaZ(e))&&(n.a+=""+t),e.c&&e.d&&(xM((n.a+=" ",n),egu(e.c)),xM(xT((n.a+="[",n),e.c.i),"]"),xM((n.a+=eGH,n),egu(e.d)),xM(xT((n.a+="[",n),e.d.i),"]")),n.a}function ek5(e){switch(e.g){case 0:return new cD;case 1:return new cN;case 2:return new cI;case 3:return new cP;default:throw p7(new gL("No implementation is available for the layout phase "+(null!=e.f?e.f:""+e.g)))}}function ek8(e,t,n,r,i){var a;switch(a=0,i.g){case 1:a=eB4.Math.max(0,t.b+e.b-(n.b+r));break;case 3:a=eB4.Math.max(0,-e.b-r);break;case 2:a=eB4.Math.max(0,-e.a-r);break;case 4:a=eB4.Math.max(0,t.a+e.a-(n.a+r))}return a}function ek9(e,t,n){var r,i,a,o,s;if(n)for(i=n.a.length,s=((r=new Fs(i)).b-r.a)*r.c<0?(_8(),eB3):new OR(r);s.Ob();)eXh in(a=KZ(n,(o=Pp(s.Pb(),19)).a)).a||eXp in a.a?eId(e,a,t):eBe(e,a,t),Om(Pp(Bp(e.b,ehM(a)),79))}function ek7(e){var t,n;switch(e.b){case -1:return!0;case 0:if((n=e.t)>1||-1==n||(t=evl(e))&&(_4(),t.Cj()==eJK))return e.b=-1,!0;return e.b=1,!1;default:return!1}}function exe(e,t){var n,r,i,a,o;for(i=0,r=(t.s||(t.s=new FQ(tm5,t,21,17)),t.s),a=null,o=r.i;i=0&&r=0?e._g(n,!0,!0):exk(e,i,!0),153),Pp(r,215).ll(t);throw p7(new gL(eZV+t.ne()+eZX))}function exc(){var e;return(_5(),tg8)?Pp(eMC((_Q(),tgp),eQc),1939):(x2(e1$,new ut),ej8(),e=Pp(M4(zg((_Q(),tgp),eQc),547)?zg(tgp,eQc):new Uh,547),tg8=!0,eBY(e),eB0(e),Um((_1(),tgm),e,new sM),Ge(tgp,eQc,e),e)}function exl(e,t){var n,r,i,a;e.j=-1,TO(e.e)?(n=e.i,a=0!=e.i,Zz(e,t),r=new Q$(e.e,3,e.c,null,t,n,a),i=t.Qk(e.e,e.c,null),(i=ey1(e,t,i))?(i.Ei(r),i.Fi()):eam(e.e,r)):(Zz(e,t),(i=t.Qk(e.e,e.c,null))&&i.Fi())}function exf(e,t){var n,r,i;if(i=0,(r=t[0])>=e.length)return -1;for(n=(GV(r,e.length),e.charCodeAt(r));n>=48&&n<=57&&(i=10*i+(n-48),!(++r>=e.length));)n=(GV(r,e.length),e.charCodeAt(r));return r>t[0]?t[0]=r:i=-1,i}function exd(e){var t,n,r,i,a;return i=Pp(e.a,19).a,a=Pp(e.b,19).a,n=i,r=a,t=eB4.Math.max(eB4.Math.abs(i),eB4.Math.abs(a)),i<=0&&i==a?(n=0,r=a-1):i==-t&&a!=t?(n=a,r=i,a>=0&&++n):(n=-a,r=i),new kD(ell(n),ell(r))}function exh(e,t,n,r){var i,a,o,s,u,c;for(i=0;i=0&&c>=0&&u=e.i)throw p7(new gE(eXU+t+eXH+e.i));if(n>=e.i)throw p7(new gE(eX$+n+eXH+e.i));return r=e.g[n],t!=n&&(t>16))>>16&16),e>>=t,n+=t=(r=e-256)>>16&8,e<<=t,n+=t=(r=e-eH0)>>16&4,e<<=t,n+=t=(r=e-eUR)>>16&2,e<<=t,n+2-(t=(r=e>>14)&~(r>>1)))}function exy(e){var t,n,r,i;for(HR(),e8n=new p0,e8t=new p2,e8e=new p0,t=(e.a||(e.a=new FQ(e5k,e,10,11)),e.a),eYE(t),i=new Ow(t);i.e!=i.i.gc();)r=Pp(epH(i),33),-1==QI(e8n,r,0)&&(n=new p0,P_(e8e,n),epi(r,n));return e8e}function exw(e,t,n){var r,i,a,o;e.a=n.b.d,M4(t,352)?(i=eLO(Pp(t,79),!1,!1),a=eEF(i),qX(a,r=new d_(e)),eNI(a,i),null!=t.We((eBB(),thg))&&qX(Pp(t.We(thg),74),r)):((o=Pp(t,470)).Hg(o.Dg()+e.a.a),o.Ig(o.Eg()+e.a.b))}function ex_(e,t){var n,r,i,a,o,s,u,c;for(s=1,c=gP(LV(e_k(t,(eBy(),toH)))),u=e[0].n.a+e[0].o.a+e[0].d.c+c;s=0)?n:(s=B$(C5(new kl(o.c+o.b/2,o.d+o.a/2),new kl(a.c+a.b/2,a.d+a.a/2))),-(eDz(a,o)-1)*s)}function exS(e,t,n){var r;_r(new R1(null,(n.a||(n.a=new FQ(e5v,n,6,6)),new Gq(n.a,16))),new kC(e,t)),_r(new R1(null,(n.n||(n.n=new FQ(e5S,n,1,7)),new Gq(n.n,16))),new kI(e,t)),(r=Pp(eT9(n,(eBB(),thg)),74))&&eil(r,e,t)}function exk(e,t,n){var r,i,a;if(a=eR3((eSp(),tvc),e.Tg(),t))return _4(),Pp(a,66).Oj()||(a=Wk(QZ(tvc,a))),i=Pp((r=e.Yg(a))>=0?e._g(r,!0,!0):exk(e,a,!0),153),Pp(i,215).hl(t,n);throw p7(new gL(eZV+t.ne()+eZX))}function exx(e,t,n,r){var i,a,o,s,u;if(i=e.d[t]){if(a=i.g,u=i.i,null!=r){for(s=0;s=n&&(r=t,o=(c=(u.c+u.a)/2)-n,u.c<=c-n&&(i=new N4(u.c,o),jO(e,r++,i)),(s=c+n)<=u.a&&(a=new N4(s,u.a),Gp(r,e.c.length),Ew(e.c,r,a)))}function exI(e){var t;if(e.c||null!=e.g){if(null==e.g)return!0;if(0==e.i)return!1;t=Pp(e.g[e.i-1],47)}else e.d=e.si(e.f),JL(e,e.d),t=e.d;return t==e.b&&null.km>=null.jm()?(eM6(e),exI(e)):t.Ob()}function exD(e,t,n){var r,i,a,o,s;if((s=n)||(s=P5(new mV,0)),ewG(s,eGA,1),ejY(e.c,t),1==(o=ejz(e.a,t)).gc())eRd(Pp(o.Xb(0),37),s);else for(a=1/o.gc(),i=o.Kc();i.Ob();)eRd(r=Pp(i.Pb(),37),eiI(s,a));vi(e.a,o,t),eL7(t),eEj(s)}function exN(e){if(this.a=e,e.c.i.k==(eEn(),e9C))this.c=e.c,this.d=Pp(e_k(e.c.i,(eBU(),tt1)),61);else if(e.d.i.k==e9C)this.c=e.d,this.d=Pp(e_k(e.d.i,(eBU(),tt1)),61);else throw p7(new gL("Edge "+e+" is not an external edge."))}function exP(e,t){var n,r,i;i=e.b,e.b=t,(4&e.Db)!=0&&(1&e.Db)==0&&eam(e,new FX(e,1,3,i,e.b)),t?t!=e&&(er3(e,t.zb),enf(e,t.d),erc(e,null==(n=null==(r=t.c)?t.zb:r)||IE(n,t.zb)?null:n)):(er3(e,null),enf(e,0),erc(e,null))}function exR(e){var t,n;if(!e.f)return e.n=(o=null==(n=Pp(eaS(e.a,4),126))?0:n.length))throw p7(new Ii(t,o));return i=n[t],1==o?r=null:(r=Je(e5N,eJM,415,o-1,0,1),ePD(n,0,r,0,t),(a=o-t-1)>0&&ePD(n,t+1,r,t,a)),eps(e,r),eSU(e,t,i),i}function ex$(){ex$=A,tvw=Pp(etj(H8((yL(),tvS).qb),6),34),tvg=Pp(etj(H8(tvS.qb),3),34),tvv=Pp(etj(H8(tvS.qb),4),34),tvy=Pp(etj(H8(tvS.qb),5),18),eyD(tvw),eyD(tvg),eyD(tvv),eyD(tvy),tv_=new g$(eow(vx(tm5,1),eJ4,170,0,[tvw,tvg]))}function exz(e,t){var n;this.d=new mh,this.b=t,this.e=new TS(t.qf()),n=e.u.Hc((ekU(),tbb)),e.u.Hc(tbp)?e.D?this.a=n&&!t.If():this.a=!0:e.u.Hc(tbm)&&n?this.a=!(t.zf().Kc().Ob()||t.Bf().Kc().Ob()):this.a=!1}function exG(e,t){var n,r,i,a;for(n=e.o.a,a=Pp(Pp(Zq(e.r,t),21),84).Kc();a.Ob();)(i=Pp(a.Pb(),111)).e.a=(r=i.b).Xe((eBB(),thK))?r.Hf()==(eYu(),tbY)?-r.rf().a-gP(LV(r.We(thK))):n+gP(LV(r.We(thK))):r.Hf()==(eYu(),tbY)?-r.rf().a:n}function exW(e,t){var n,r,i,a;n=Pp(e_k(e,(eBy(),tal)),103),a=Pp(eT9(t,tob),61),(i=Pp(e_k(e,tol),98))!=(ewf(),tbc)&&i!=tbl?a==(eYu(),tbF)&&(a=eNh(t,n))==tbF&&(a=ef8(n)):a=(r=eRl(t))>0?ef8(n):elC(ef8(n)),ebu(t,tob,a)}function exK(e,t){var n,r,i,a,o;for(o=e.j,t.a!=t.b&&Mv(o,new ia),i=o.c.length/2|0,r=0;r0&&eIl(e,n,t),a):null!=r.a?(eIl(e,t,n),-1):null!=i.a?(eIl(e,n,t),1):0}function exq(e,t){var n,r,i,a;e.ej()?(n=e.Vi(),a=e.fj(),++e.j,e.Hi(n,e.oi(n,t)),r=e.Zi(3,null,t,n,a),e.bj()&&(i=e.cj(t,null))?(i.Ei(r),i.Fi()):e.$i(r)):(BD(e,t),e.bj()&&(i=e.cj(t,null))&&i.Fi())}function exZ(e,t){var n,r,i,a,o;for(o=eAY(e.e.Tg(),t),i=new o7,n=Pp(e.g,119),a=e.i;--a>=0;)r=n[a],o.rl(r.ak())&&JL(i,r);!eYK(e,i)&&TO(e.e)&&bz(e,t.$j()?$N(e,6,t,(Hj(),e2r),null,-1,!1):$N(e,t.Kj()?2:1,t,null,null,-1,!1))}function exX(){var e,t;for(t=0,exX=A,e2t=Je(e0t,eUP,91,32,0,1),e2n=Je(e0t,eUP,91,32,0,1),e=1;t<=18;t++)e2t[t]=ep_(e),e2n[t]=ep_(Fg(e,t)),e=efn(e,5);for(;to)))&&(!t.q||(o=(r=t.C).c.c.a-r.o.a/2,!((i=r.n.a-n)>o))))}function exQ(e,t){var n;ewG(t,"Partition preprocessing",1),n=Pp(qE(UJ(eeh(UJ(new R1(null,new Gq(e.a,16)),new nZ),new nX),new nJ),JF(new U,new B,new en,eow(vx(e2L,1),eU4,132,0,[(eum(),e2U)]))),15),_r(n.Oc(),new nQ),eEj(t)}function ex1(e){var t,n,r,i,a,o,s;for(Gk(),n=new qh,i=new fz(e.e.b);i.a1?e.e*=gP(e.a):e.f/=gP(e.a),eu0(e),ehK(e),eCj(e),eo3(e.b,(epz(),e52),e.g)}function ex8(e,t,n){var r,i,a,o,s,u;for(r=0,u=n,t||(r=n*(e.c.length-1),u*=-1),a=new fz(e);a.a=0?(!t&&(t=new vu,r>0&&xk(t,e.substr(0,r))),t.a+="\\",Bf(t,n&eHd)):t&&Bf(t,n&eHd);return t?t.a:e}function eTh(e){var t;if(!e.a)throw p7(new gC("IDataType class expected for layout option "+e.f));if(null==(t=VN(e.a)))throw p7(new gC("Couldn't create new instance of property '"+e.f+"'. "+eq4+(LW(e5D),e5D.k)+eq6));return Pp(t,414)}function eTp(e){var t,n,r,i,a;return(a=e.eh())&&a.kh()&&(i=ecv(e,a))!=a?(n=e.Vg(),r=(t=e.Vg())>=0?e.Qg(null):e.eh().ih(e,-1-t,null,null),e.Rg(Pp(i,49),n),r&&r.Fi(),e.Lg()&&e.Mg()&&n>-1&&eam(e,new FX(e,9,n,a,i)),i):a}function eTb(e){var t,n,r,i,a,o,s,u;for(r=0,o=0,a=e.f.e;r>5)>=e.d)return e.e<0;if(n=e.a[i],t=1<<(31&t),e.e<0){if(i<(r=eiU(e)))return!1;n=r==i?-n:~n}return(n&t)!=0}function eT_(e,t,n,r){var i;Pp(n.b,65),Pp(n.b,65),Pp(r.b,65),Pp(r.b,65),P8(i=C5(MB(Pp(n.b,65).c),Pp(r.b,65).c),ekg(Pp(n.b,65),Pp(r.b,65),i)),Pp(r.b,65),Pp(r.b,65),Pp(r.b,65).c.a,i.a,Pp(r.b,65).c.b,i.b,Pp(r.b,65),ety(r.a,new N8(e,t,r))}function eTE(e,t){var n,r,i,a,o,s,u;if(a=t.e){for(o=0,n=eTp(a),r=Pp(e.g,674);o>16)),15).Xc(a))0&&(Tk(e.a.c)&&t.n.d||Tx(e.a.c)&&t.n.b||(t.g.d+=eB4.Math.max(0,r/2-.5)),Tk(e.a.c)&&t.n.a||Tx(e.a.c)&&t.n.c||(t.g.a-=r-1))}function eTO(e){var t,n,r,i,a;if(i=new p0,a=eDC(e,i),t=Pp(e_k(e,(eBU(),tng)),10))for(r=new fz(t.j);r.a>t,a=e.m>>t|n<<22-t,i=e.l>>t|e.m<<22-t):t<44?(o=r?eH$:0,a=n>>t-22,i=e.m>>t-22|n<<44-t):(o=r?eH$:0,a=r?eHH:0,i=n>>t-44),Mk(i&eHH,a&eHH,o&eH$)}function eTI(e){var t,n,r,i,a,o;for(this.c=new p0,this.d=e,r=eHQ,i=eHQ,t=eH1,n=eH1,o=epL(e,0);o.b!=o.d.c;)a=Pp(Vv(o),8),r=eB4.Math.min(r,a.a),i=eB4.Math.min(i,a.b),t=eB4.Math.max(t,a.a),n=eB4.Math.max(n,a.b);this.a=new Hr(r,i,t-r,n-i)}function eTD(e,t){var n,r,i,a,o,s;for(a=new fz(e.b);a.a0&&M4(t,42)&&(e.a.qj(),a=null==(u=(c=Pp(t,42)).cd())?0:esj(u),o=Cb(e.a,a),n=e.a.d[o])){for(s=0,r=Pp(n.g,367),l=n.i;s=2)for(t=LV((n=i.Kc()).Pb());n.Ob();)a=t,t=LV(n.Pb()),r=eB4.Math.min(r,(BJ(t),t-(BJ(a),a)));return r}function eTX(e,t){var n,r,i,a,o;qQ(r=new _n,t,r.c.b,r.c);do for(n=(A5(0!=r.b),Pp(etw(r,r.a.a),86)),e.b[n.g]=1,a=epL(n.d,0);a.b!=a.d.c;)o=(i=Pp(Vv(a),188)).c,1==e.b[o.g]?P7(e.a,i):2==e.b[o.g]?e.b[o.g]=1:qQ(r,o,r.c.b,r.c);while(0!=r.b)}function eTJ(e,t){var n,r,i;if(xc(t)===xc(Y8(e)))return!0;if(!M4(t,15)||(r=Pp(t,15),(i=e.gc())!=r.gc()))return!1;if(!M4(r,54))return eb3(e.Kc(),r.Kc());for(n=0;n0&&(i=n),o=new fz(e.f.e);o.a0?(t-=1,n-=1):r>=0&&i<0?(t+=1,n+=1):r>0&&i>=0?(t-=1,n+=1):(t+=1,n-=1),new kD(ell(t),ell(n))}function eMf(e,t){if(e.ct.c)return 1;if(e.bt.b)return 1;if(e.a!=t.a)return esj(e.a)-esj(t.a);else if(e.d==(qG(),tuf)&&t.d==tul)return -1;else if(e.d==tul&&t.d==tuf)return 1;return 0}function eMd(e,t){var n,r,i,a,o;return(o=(a=t.a).c.i==t.b?a.d:a.c,r=a.c.i==t.b?a.c:a.d,(i=edI(e.a,o,r))>0&&i0):i<0&&-i0)}function eMh(e,t,n,r){var i,a,o,s,u,c,l,f;for(i=(t-e.d)/e.c.c.length,a=0,e.a+=n,e.d=t,f=new fz(e.c);f.a>24;return o}function eMb(e){if(e.pe()){var t=e.c;t.qe()?e.o="["+t.n:t.pe()?e.o="["+t.ne():e.o="[L"+t.ne()+";",e.b=t.me()+"[]",e.k=t.oe()+"[]";return}var n=e.j,r=e.d;r=r.split("/"),e.o=ehg(".",[n,ehg("$",r)]),e.b=ehg(".",[n,ehg(".",r)]),e.k=r[r.length-1]}function eMm(e,t){var n,r,i,a,o;for(o=null,a=new fz(e.e.a);a.a=0;t-=2)for(n=0;n<=t;n+=2)(e.b[n]>e.b[n+2]||e.b[n]===e.b[n+2]&&e.b[n+1]>e.b[n+3])&&(r=e.b[n+2],e.b[n+2]=e.b[n],e.b[n]=r,r=e.b[n+3],e.b[n+3]=e.b[n+1],e.b[n+1]=r);e.c=!0}}function eMk(e,t){var n,r,i,a,o,s,u,c;for(a=(o=1==t?e9c:e9u).a.ec().Kc();a.Ob();)for(i=Pp(a.Pb(),103),u=Pp(Zq(e.f.c,i),21).Kc();u.Ob();)switch(s=Pp(u.Pb(),46),r=Pp(s.b,81),n=(c=Pp(s.a,189)).c,i.g){case 2:case 1:r.g.d+=n;break;case 4:case 3:r.g.c+=n}}function eMx(e,t){var n,r,i,a,o,s,u,c,l;for(s=0,c=-1,l=0,u=(o=e).length;s0&&++l;++c}return l}function eMT(e){var t,n;return n=new O0(yx(e.gm)),n.a+="@",xM(n,(t=esj(e)>>>0).toString(16)),e.kh()?(n.a+=" (eProxyURI: ",xT(n,e.qh()),e.$g()&&(n.a+=" eClass: ",xT(n,e.$g())),n.a+=")"):e.$g()&&(n.a+=" (eClass: ",xT(n,e.$g()),n.a+=")"),n.a}function eMM(e){var t,n,r,i;if(e.e)throw p7(new gC((LW(e2J),e$j+e2J.k+e$F)));for(e.d==(ec3(),tpv)&&eF_(e,tpm),n=new fz(e.a.a);n.a>24}return n}function eMD(e,t,n){var r,i,a;if(!(i=Pp(UA(e.i,t),306))){if(i=new etr(e.d,t,n),jT(e.i,t,i),ehj(t))Od(e.a,t.c,t.b,i);else switch(a=eSv(t),r=Pp(UA(e.p,a),244),a.g){case 1:case 3:i.j=!0,gh(r,t.b,i);break;case 4:case 2:i.k=!0,gh(r,t.c,i)}}return i}function eMN(e,t,n,r){var i,a,o,s,u,c;if(s=new o7,u=eAY(e.e.Tg(),t),i=Pp(e.g,119),_4(),Pp(t,66).Oj())for(o=0;o=0)return i;for(a=1,s=new fz(t.j);s.a0&&t.ue((GK(i-1,e.c.length),Pp(e.c[i-1],10)),a)>0;)q1(e,i,(GK(i-1,e.c.length),Pp(e.c[i-1],10))),--i;GK(i,e.c.length),e.c[i]=a}n.a=new p2,n.b=new p2}function eMj(e,t,n){var r,i,a,o,s,u,c,l;for(o=0,l=(r=Pp(t.e&&t.e(),9),new I1(r,Pp(CY(r,r.length),9),0)),s=(a=u=eIk(n,"[\\[\\]\\s,]+")).length;o0&&(Tk(e.a.c)&&t.n.d||Tx(e.a.c)&&t.n.b||(t.g.d-=eB4.Math.max(0,r/2-.5)),Tk(e.a.c)&&t.n.a||Tx(e.a.c)&&t.n.c||(t.g.a+=eB4.Math.max(0,r-1)))}function eMY(e,t,n){var r,i;if((e.c-e.b&e.a.length-1)==2)t==(eYu(),tbw)||t==tby?(etf(Pp(eso(e),15),(egF(),tpV)),etf(Pp(eso(e),15),tpq)):(etf(Pp(eso(e),15),(egF(),tpq)),etf(Pp(eso(e),15),tpV));else for(i=new UN(e);i.a!=i.b;)etf(r=Pp(ecn(i),15),n)}function eMB(e,t){var n,r,i,a,o,s,u;for(i=Pb(new pL(e)),s=new KB(i,i.c.length),a=Pb(new pL(t)),u=new KB(a,a.c.length),o=null;s.b>0&&u.b>0;)if((n=(A5(s.b>0),Pp(s.a.Xb(s.c=--s.b),33)))==(r=(A5(u.b>0),Pp(u.a.Xb(u.c=--u.b),33))))o=n;else break;return o}function eMU(e,t){var n,r,i,a,o,s;return(a=e.a*e$d+1502*e.b,s=e.b*e$d+11,a+=n=eB4.Math.floor(s*e$h),s-=n*e$p,a%=e$p,e.a=a,e.b=s,t<=24)?eB4.Math.floor(e.a*e2v[t]):((r=(i=e.a*(1<=2147483648&&(r-=eH7),r)}function eMH(e,t,n){var r,i,a,o;WY(e,t)>WY(e,n)?(r=efr(n,(eYu(),tby)),e.d=r.dc()?0:Rk(Pp(r.Xb(0),11)),o=efr(t,tbY),e.b=o.dc()?0:Rk(Pp(o.Xb(0),11))):(i=efr(n,(eYu(),tbY)),e.d=i.dc()?0:Rk(Pp(i.Xb(0),11)),a=efr(t,tby),e.b=a.dc()?0:Rk(Pp(a.Xb(0),11)))}function eM$(e){var t,n,r,i,a,o,s;if(e&&(t=e.Hh(eQc))&&null!=(o=Lq(edW((t.b||(t.b=new L_((eBK(),tgF),tgf,t)),t.b),"conversionDelegates")))){for(s=new p0,r=eIk(o,"\\w+"),i=0,a=r.length;ie.c);o++)i.a>=e.s&&(a<0&&(a=o),s=o);return u=(e.s+e.c)/2,a>=0&&(r=eIe(e,t,a,s),u=_V((GK(r,t.c.length),Pp(t.c[r],329))),exC(t,r,n)),u}function eMK(){eMK=A,tlK=new T2((eBB(),td2),1.3),tlX=thc,tfe=new T3(15),tl7=new T2(thN,tfe),tfr=new T2(tpl,15),tlV=td8,tl3=thx,tl4=thO,tl6=thL,tl2=thS,tl5=thD,tft=thJ,tl9=(eTU(),tl$),tl0=tlU,tl8=tlH,tfn=tlG,tlJ=tlB,tlQ=thb,tl1=thm,tlZ=tlY,tlq=tlF,tfi=tlW}function eMV(e,t,n){var r,i,a,o,s,u,c;for(erl(o=a=new sa,(BJ(t),t)),c=(o.b||(o.b=new L_((eBK(),tgF),tgf,o)),o.b),u=1;u0&&eRJ(this,i)}function eMZ(e,t,n,r,i,a){var o,s,u;if(!i[t.b]){for(i[t.b]=!0,(o=r)||(o=new Z6),P_(o.e,t),u=a[t.b].Kc();u.Ob();)(s=Pp(u.Pb(),282)).d!=n&&s.c!=n&&(s.c!=t&&eMZ(e,s.c,t,o,i,a),s.d!=t&&eMZ(e,s.d,t,o,i,a),P_(o.c,s),eoc(o.d,s.b));return o}return null}function eMX(e){var t,n,r,i,a,o,s;for(t=0,i=new fz(e.e);i.a=2}function eMJ(e,t){var n,r,i,a;for(ewG(t,"Self-Loop pre-processing",1),r=new fz(e.a);r.a1)&&(t=jL(tp1,eow(vx(e5t,1),eU4,93,0,[tpQ,tp2])),!(eaC(z_(t,e))>1)&&(r=jL(tp8,eow(vx(e5t,1),eU4,93,0,[tp5,tp6])),!(eaC(z_(r,e))>1)))}function eM0(e,t){var n,r,i;return(n=t.Hh(e.a))&&null!=(i=Lq(edW((n.b||(n.b=new L_((eBK(),tgF),tgf,n)),n.b),"affiliation")))?-1==(r=O9(i,e_n(35)))?elp(e,Fr(e,etP(t.Hj())),i):0==r?elp(e,null,i.substr(1)):elp(e,i.substr(0,r),i.substr(r+1)):null}function eM2(e){var t,n,r;try{return null==e?eUg:efF(e)}catch(i){if(i=eoa(i),M4(i,102))return t=i,r=yx(esF(e))+"@"+(n=(wK(),ebh(e)>>>0)).toString(16),epa(eob(),(_g(),"Exception during lenientFormat for "+r),t),"<"+r+" threw "+yx(t.gm)+">";throw p7(i)}}function eM3(e){switch(e.g){case 0:return new ck;case 1:return new cy;case 2:return new _j;case 3:return new i$;case 4:return new CZ;case 5:return new cx;default:throw p7(new gL("No implementation is available for the layerer "+(null!=e.f?e.f:""+e.g)))}}function eM4(e,t,n){var r,i,a;for(a=new fz(e.t);a.a0&&(r.b.n-=r.c,r.b.n<=0&&r.b.u>0&&P7(t,r.b));for(i=new fz(e.i);i.a0&&(r.a.u-=r.c,r.a.u<=0&&r.a.n>0&&P7(n,r.a))}function eM6(e){var t,n,r,i,a;if(null==e.g&&(e.d=e.si(e.f),JL(e,e.d),e.c))return e.f;if(i=(t=Pp(e.g[e.i-1],47)).Pb(),e.e=t,(n=e.si(i)).Ob())e.d=n,JL(e,n);else for(e.d=null;!t.Ob()&&(Bc(e.g,--e.i,null),0!=e.i);)t=r=Pp(e.g[e.i-1],47);return i}function eM5(e,t){var n,r,i,a,o,s;if(i=(r=t).ak(),eLt(e.e,i)){if(i.hi()&&Vq(e,i,r.dd()))return!1}else for(a=0,s=eAY(e.e.Tg(),i),n=Pp(e.g,119);a1||n>1)return 2;return t+n==1?2:0}function eOs(e,t,n){var r,i,a,o,s;for(ewG(n,"ELK Force",1),gN(LK(eT9(t,(eCk(),e8E))))||zh(r=new df((_q(),new gM(t)))),s=eo4(t),evn(s),esO(e,Pp(e_k(s,e8v),424)),a=(o=eNx(e.a,s)).Kc();a.Ob();)i=Pp(a.Pb(),231),eIL(e.b,i,eiI(n,1/o.gc()));s=eYC(o),eYh(s),eEj(n)}function eOu(e,t){var n,r,i,a,o;if(ewG(t,"Breaking Point Processor",1),eFM(e),gN(LK(e_k(e,(eBy(),toJ))))){for(i=new fz(e.b);i.a=0?e._g(r,!0,!0):exk(e,a,!0),153),Pp(i,215).ml(t,n)}else throw p7(new gL(eZV+t.ne()+eZq))}function eOp(e,t){var n,r,i,a,o;for(r=1,n=new p0,i=eeh(new R1(null,new Gq(e,16)),new aM),a=eeh(new R1(null,new Gq(e,16)),new aO),o=QN(Xg(U1(eAa(eow(vx(e2C,1),eUp,833,0,[i,a])),new aA)));r=2*t&&P_(n,new N4(o[r-1]+t,o[r]-t));return n}function eOb(e,t,n){ewG(n,"Eades radial",1),n.n&&t&&WG(n,KS(t),(eup(),tmr)),e.d=Pp(eT9(t,(Lj(),tcV)),33),e.c=gP(LV(eT9(t,(egj(),tl_)))),e.e=ebN(Pp(eT9(t,tlE),293)),e.a=ef7(Pp(eT9(t,tlk),426)),e.b=eyp(Pp(eT9(t,tlg),340)),evY(e),n.n&&t&&WG(n,KS(t),(eup(),tmr))}function eOm(e,t,n){var r,i,a,o,s,u,c,l;if(n)for(a=n.a.length,s=((r=new Fs(a)).b-r.a)*r.c<0?(_8(),eB3):new OR(r);s.Ob();)(i=KZ(n,(o=Pp(s.Pb(),19)).a))&&(eB9=null,u=Vj(e,(c=(yT(),l=new mk),t&&eOL(c,t),c),i),ert(u,KJ(i,eXS)),ewU(i,u),eka(i,u),esv(e,i,u))}function eOg(e){var t,n,r,i,a,o;if(!e.j){if(o=new sd,null==(a=(t=tgz).a.zc(e,t))){for(r=new Ow($E(e));r.e!=r.i.gc();)n=Pp(epH(r),26),i=eOg(n),Y4(o,i),JL(o,n);t.a.Bc(e)}euI(o),e.j=new xQ((Pp(etj(H8((BM(),tgv).o),11),18),o.i),o.g),Zd(e).b&=-33}return e.j}function eOv(e){var t,n,r,i;if(null==e)return null;if(r=ePh(e,!0),i=eQq.length,IE(r.substr(r.length-i,i),eQq)){if(4==(n=r.length)){if(43==(t=(GV(0,r.length),r.charCodeAt(0))))return tvX;if(45==t)return tvZ}else if(3==n)return tvX}return new bK(r)}function eOy(e){var t,n,r;return((n=e.l)&n-1)!=0||((r=e.m)&r-1)!=0||((t=e.h)&t-1)!=0||0==t&&0==r&&0==n?-1:0==t&&0==r&&0!=n?enq(n):0==t&&0!=r&&0==n?enq(r)+22:0!=t&&0==r&&0==n?enq(t)+44:-1}function eOw(e,t){var n,r,i,a,o;for(ewG(t,"Edge joining",1),n=gN(LK(e_k(e,(eBy(),toz)))),i=new fz(e.b);i.a1)for(i=new fz(e.a);i.a0),a.a.Xb(a.c=--a.b),CD(a,i),A5(a.becd(r,0)?(i=eHf-jE(edQ(QC(r),eHf)))==eHf&&(i=0):i=jE(edQ(r,eHf)),1==t?Bd(e,48+(i=eB4.Math.min((i+50)/100|0,9))&eHd):2==t?eeE(e,i=eB4.Math.min((i+5)/10|0,99),2):(eeE(e,i,3),t>3&&eeE(e,0,t-3))}function eOM(e){var t,n,r,i;return xc(e_k(e,(eBy(),taM)))===xc((eck(),tpz))?!e.e&&xc(e_k(e,tat))!==xc((eaU(),ttO)):(r=Pp(e_k(e,tan),292),i=gN(LK(e_k(e,tao)))||xc(e_k(e,tas))===xc((en7(),teR)),t=Pp(e_k(e,tae),19).a,n=e.a.c.length,!i&&r!=(eaU(),ttO)&&(0==t||t>n))}function eOO(e){var t,n;for(n=0;n0);n++);if(n>0&&n0);t++);return t>0&&n>16!=6&&t){if(eg7(e,t))throw p7(new gL(eZ4+ex2(e)));r=null,e.Cb&&(r=(n=e.Db>>16)>=0?eg1(e,r):e.Cb.ih(e,-1-n,null,r)),t&&(r=ep0(t,e,6,r)),(r=Cc(e,t,r))&&r.Fi()}else(4&e.Db)!=0&&(1&e.Db)==0&&eam(e,new FX(e,1,6,t,t))}function eOL(e,t){var n,r;if(t!=e.Cb||e.Db>>16!=9&&t){if(eg7(e,t))throw p7(new gL(eZ4+eC6(e)));r=null,e.Cb&&(r=(n=e.Db>>16)>=0?eg2(e,r):e.Cb.ih(e,-1-n,null,r)),t&&(r=ep0(t,e,9,r)),(r=Cl(e,t,r))&&r.Fi()}else(4&e.Db)!=0&&(1&e.Db)==0&&eam(e,new FX(e,1,9,t,t))}function eOC(e,t){var n,r;if(t!=e.Cb||e.Db>>16!=3&&t){if(eg7(e,t))throw p7(new gL(eZ4+ePY(e)));r=null,e.Cb&&(r=(n=e.Db>>16)>=0?evo(e,r):e.Cb.ih(e,-1-n,null,r)),t&&(r=ep0(t,e,12,r)),(r=Cu(e,t,r))&&r.Fi()}else(4&e.Db)!=0&&(1&e.Db)==0&&eam(e,new FX(e,1,3,t,t))}function eOI(e){var t,n,r,i,a;if(r=evl(e),null==(a=e.j)&&r)return e.$j()?null:r.zj();if(M4(r,148)){if((n=r.Aj())&&(i=n.Nh())!=e.i){if((t=Pp(r,148)).Ej())try{e.g=i.Kh(t,a)}catch(o){if(o=eoa(o),M4(o,78))e.g=null;else throw p7(o)}e.i=i}return e.g}return null}function eOD(e){var t;return t=new p0,P_(t,new EL(new kl(e.c,e.d),new kl(e.c+e.b,e.d))),P_(t,new EL(new kl(e.c,e.d),new kl(e.c,e.d+e.a))),P_(t,new EL(new kl(e.c+e.b,e.d+e.a),new kl(e.c+e.b,e.d))),P_(t,new EL(new kl(e.c+e.b,e.d+e.a),new kl(e.c,e.d+e.a))),t}function eON(e,t,n,r){var i,a,o;if(o=eyn(t,n),r.c[r.c.length]=t,-1==e.j[o.p]||2==e.j[o.p]||e.a[t.p])return r;for(e.j[o.p]=-1,a=new Fa(OH(efs(o).a.Kc(),new c));eTk(a);)if(i=Pp(ZC(a),17),!q9(i)&&!(!q9(i)&&i.c.i.c==i.d.i.c)&&i!=t)return eON(e,i,o,r);return r}function eOP(e,t,n){var r,i,a;for(a=t.a.ec().Kc();a.Ob();)i=Pp(a.Pb(),79),(r=Pp(Bp(e.b,i),266))||(z$(e_I(i))==z$(e_P(i))?eLk(e,i,n):e_I(i)==z$(e_P(i))?null==Bp(e.c,i)&&null!=Bp(e.b,e_P(i))&&eFt(e,i,n,!1):null==Bp(e.d,i)&&null!=Bp(e.b,e_I(i))&&eFt(e,i,n,!0))}function eOR(e,t){var n,r,i,a,o,s,u;for(i=e.Kc();i.Ob();)for(r=Pp(i.Pb(),10),s=new eES,Gc(s,r),ekv(s,(eYu(),tby)),eo3(s,(eBU(),tnm),(OQ(),!0)),o=t.Kc();o.Ob();)a=Pp(o.Pb(),10),u=new eES,Gc(u,a),ekv(u,tbY),eo3(u,tnm,!0),n=new $b,eo3(n,tnm,!0),Gs(n,s),Go(n,u)}function eOj(e,t,n,r){var i,a,o,s;i=ehu(e,t,n),a=ehu(e,n,t),o=Pp(Bp(e.c,t),112),s=Pp(Bp(e.c,n),112),ir.b.g&&(a.c[a.c.length]=r);return a}function eOB(){eOB=A,tfo=new S8("CANDIDATE_POSITION_LAST_PLACED_RIGHT",0),tfa=new S8("CANDIDATE_POSITION_LAST_PLACED_BELOW",1),tfu=new S8("CANDIDATE_POSITION_WHOLE_DRAWING_RIGHT",2),tfs=new S8("CANDIDATE_POSITION_WHOLE_DRAWING_BELOW",3),tfc=new S8("WHOLE_DRAWING",4)}function eOU(e,t){if(M4(t,239))return elg(e,Pp(t,33));if(M4(t,186))return el$(e,Pp(t,118));if(M4(t,354))return Hd(e,Pp(t,137));if(M4(t,352))return eNP(e,Pp(t,79));if(t)return null;else throw p7(new gL(eXx+e_F(new g$(eow(vx(e1R,1),eUp,1,5,[t])))))}function eOH(e){var t,n,r,i,a,o,s;for(a=new _n,i=new fz(e.d.a);i.a1)for(t=Al((n=new b1,++e.b,n),e.d),s=epL(a,0);s.b!=s.d.c;)o=Pp(Vv(s),121),eAx(_f(_l(_d(_c(new bQ,1),0),t),o))}function eO$(e,t){var n,r;if(t!=e.Cb||e.Db>>16!=11&&t){if(eg7(e,t))throw p7(new gL(eZ4+eC4(e)));r=null,e.Cb&&(r=(n=e.Db>>16)>=0?evs(e,r):e.Cb.ih(e,-1-n,null,r)),t&&(r=ep0(t,e,10,r)),(r=C4(e,t,r))&&r.Fi()}else(4&e.Db)!=0&&(1&e.Db)==0&&eam(e,new FX(e,1,11,t,t))}function eOz(e){var t,n,r,i;for(r=new esz(new fS(e.b).a);r.b;)n=etz(r),i=Pp(n.cd(),11),eo3(t=Pp(n.dd(),10),(eBU(),tnc),i),eo3(i,tng,t),eo3(i,tt5,(OQ(),!0)),ekv(i,Pp(e_k(t,tt1),61)),e_k(t,tt1),eo3(i.i,(eBy(),tol),(ewf(),tbu)),Pp(e_k(Bq(i.i),tt3),21).Fc((eLR(),ttS))}function eOG(e,t,n){var r,i,a,o,s,u;if(a=0,o=0,e.c)for(u=new fz(e.d.i.j);u.aa.a)?-1:i.a(u=null==e.d?0:e.d.length)))return!1;for(a=0,l=e.d,e.d=Je(e5C,eJA,63,2*u+4,0,1);a=0x7fffffffffffffff?(Q2(),e0L):(i=!1,e<0&&(i=!0,e=-e),r=0,e>=eHW&&(r=zy(e/eHW),e-=r*eHW),n=0,e>=eHG&&(n=zy(e/eHG),e-=n*eHG),a=Mk(t=zy(e),n,r),i&&esh(a),a)}function eO5(e,t){var n,r,i,a;for(n=!t||!e.u.Hc((ekU(),tbp)),a=0,i=new fz(e.e.Cf());i.a=-t&&r==t?new kD(ell(n-1),ell(r)):new kD(ell(n),ell(r-1))}function eAn(){return eB$(),eow(vx(e4B,1),eU4,77,0,[e96,e92,e95,e7d,e7C,e7m,e7j,e7_,e7A,e7s,e7x,e7w,e7L,e7r,e7Y,e9Z,e7k,e7D,e7h,e7I,e7U,e7M,e9X,e7O,e7H,e7P,e7B,e7p,e7e,e7b,e7f,e7F,e91,e99,e7v,e9Q,e7y,e7c,e7i,e7E,e7o,e93,e90,e7l,e7a,e7S,e7R,e9J,e7T,e7u,e7g,e7t,e97,e7N,e98,e7n,e94])}function eAr(e,t,n){e.d=0,e.b=0,t.k==(eEn(),e9P)&&n.k==e9P&&Pp(e_k(t,(eBU(),tnc)),10)==Pp(e_k(n,tnc),10)&&(QP(t).j==(eYu(),tbw)?eMH(e,t,n):eMH(e,n,t)),t.k==e9P&&n.k==e9D?QP(t).j==(eYu(),tbw)?e.d=1:e.b=1:n.k==e9P&&t.k==e9D&&(QP(n).j==(eYu(),tbw)?e.b=1:e.d=1),emu(e,t,n)}function eAi(e){var t,n,r,i,a,o,s,u,c,l,f;return f=ewW(e),(u=null!=(t=e.a))&&P4(f,"category",e.a),(o=!(i=wc(new fk(e.d))))&&(ee3(f,"knownOptions",c=new lN),n=new pS(c),qX(new fk(e.d),n)),(s=!(a=wc(e.g)))&&(ee3(f,"supportedFeatures",l=new lN),r=new pk(l),qX(e.g,r)),f}function eAa(e){var t,n,r,i,a,o,s,u,c;for(u=0,r=!1,t=336,n=0,a=new CE(e.length),c=(s=e).length;u>16!=7&&t){if(eg7(e,t))throw p7(new gL(eZ4+eE1(e)));r=null,e.Cb&&(r=(n=e.Db>>16)>=0?eg0(e,r):e.Cb.ih(e,-1-n,null,r)),t&&(r=Pp(t,49).gh(e,1,e5p,r)),(r=j2(e,t,r))&&r.Fi()}else(4&e.Db)!=0&&(1&e.Db)==0&&eam(e,new FX(e,1,7,t,t))}function eAc(e,t){var n,r;if(t!=e.Cb||e.Db>>16!=3&&t){if(eg7(e,t))throw p7(new gL(eZ4+eln(e)));r=null,e.Cb&&(r=(n=e.Db>>16)>=0?eg4(e,r):e.Cb.ih(e,-1-n,null,r)),t&&(r=Pp(t,49).gh(e,0,e5y,r)),(r=j3(e,t,r))&&r.Fi()}else(4&e.Db)!=0&&(1&e.Db)==0&&eam(e,new FX(e,1,3,t,t))}function eAl(e,t){var n,r,i,a,o,s,u,c,l;return(exX(),t.d>e.d&&(s=e,e=t,t=s),t.d<63)?eLm(e,t):(o=(-2&e.d)<<4,c=ZL(e,o),l=ZL(t,o),r=eNz(e,ZA(c,o)),i=eNz(t,ZA(l,o)),u=eAl(c,l),n=eAl(r,i),a=eAl(eNz(c,r),eNz(i,l)),a=eP6(eP6(a,u),n),a=ZA(a,o),u=ZA(u,o<<1),eP6(eP6(u,a),n))}function eAf(e,t,n){var r,i,a,o,s;for(o=ecZ(e,n),s=Je(e4N,eGW,10,t.length,0,1),r=0,a=o.Kc();a.Ob();)gN(LK(e_k(i=Pp(a.Pb(),11),(eBU(),tt5))))&&(s[r++]=Pp(e_k(i,tng),10));if(r=0;a+=n?1:-1)o|=t.c.Sf(u,a,n,r&&!gN(LK(e_k(t.j,(eBU(),tt2))))&&!gN(LK(e_k(t.j,(eBU(),tnS))))),o|=t.q._f(u,a,n),o|=eCA(e,u[a],n,r);return Yf(e.c,t),o}function eAm(e,t,n){var r,i,a,o,s,u,c,l,f,d;for(l=Kz(e.j),f=0,d=l.length;f1&&(e.a=!0),jU(Pp(n.b,65),C6(MB(Pp(t.b,65).c),Ol(C5(MB(Pp(n.b,65).a),Pp(t.b,65).a),i))),GC(e,t),eAy(e,n)}function eAw(e){var t,n,r,i,a,o,s;for(a=new fz(e.a.a);a.a0&&a>0?o.p=t++:r>0?o.p=n++:a>0?o.p=i++:o.p=n++}Hj(),Mv(e.j,new nG)}function eAE(e){var t,n;n=null,t=Pp(RJ(e.g,0),17);do{if(Ln(n=t.d.i,(eBU(),tna)))return Pp(e_k(n,tna),11).i;if(n.k!=(eEn(),e9N)&&eTk(new Fa(OH(efc(n).a.Kc(),new c))))t=Pp(ZC(new Fa(OH(efc(n).a.Kc(),new c))),17);else if(n.k!=e9N)return null}while(!!n&&n.k!=(eEn(),e9N))return n}function eAS(e,t){var n,r,i,a,o,s,u,c,l;for(a=1,s=t.j,o=t.g,c=em1(e,o,u=Pp(RJ(s,s.c.length-1),113),l=(GK(0,s.c.length),Pp(s.c[0],113)));ac&&(u=n,l=i,c=r);t.a=l,t.c=u}function eAk(e,t){var n,r;if(!(r=YB(e.b,t.b)))throw p7(new gC("Invalid hitboxes for scanline constraint calculation."));(eop(t.b,Pp(CF(e.b,t.b),57))||eop(t.b,Pp(Cj(e.b,t.b),57)))&&(wK(),t.b),e.a[t.b.f]=Pp(Ik(e.b,t.b),57),(n=Pp(IS(e.b,t.b),57))&&(e.a[n.f]=t.b)}function eAx(e){if(!e.a.d||!e.a.e)throw p7(new gC((LW(e23),e23.k+" must have a source and target "+(LW(e24),e24.k)+" specified.")));if(e.a.d==e.a.e)throw p7(new gC("Network simplex does not support self-loops: "+e.a+" "+e.a.d+" "+e.a.e));return Am(e.a.d.g,e.a),Am(e.a.e.b,e.a),e.a}function eAT(e,t,n){var r,i,a,o,s,u,c;for(c=new yB(new hA(e)),o=eow(vx(e4j,1),eGK,11,0,[t,n]),s=0,u=o.length;su-e.b&&su-e.a&&s0&&++h;++d}return h}function eAF(e,t){var n,r,i,a,o;for(o=Pp(e_k(t,(eTj(),tcN)),425),a=epL(t.b,0);a.b!=a.d.c;)if(i=Pp(Vv(a),86),0==e.b[i.g]){switch(o.g){case 0:eb8(e,i);break;case 1:eTX(e,i)}e.b[i.g]=2}for(r=epL(e.a,0);r.b!=r.d.c;)eds((n=Pp(Vv(r),188)).b.d,n,!0),eds(n.c.b,n,!0);eo3(t,(eR5(),tch),e.a)}function eAY(e,t){var n,r,i,a;return(_4(),t)?t==(eR7(),tvG)||(t==tvM||t==tvx||t==tvT)&&e!=tvk?new eF2(e,t):((n=(r=Pp(t,677)).pk())||(UH(QZ((eSp(),tvc),t)),n=r.pk()),a=(n.i||(n.i=new p2),n.i),(i=Pp(xu($I(a.f,e)),1942))||Um(a,e,i=new eF2(e,t)),i):tvb}function eAB(e,t){var n,r,i,a,o,s,u,c,l;for(a=0,u=Pp(e_k(e,(eBU(),tnc)),11),c=esp(eow(vx(e60,1),eUP,8,0,[u.i.n,u.n,u.a])).a,l=e.i.n.b,o=(i=n=Kp(e.e)).length;a0?a.a?n>(s=a.b.rf().a)&&(i=(n-s)/2,a.d.b=i,a.d.c=i):a.d.c=e.s+n:FY(e.u)&&((r=ew1(a.b)).c<0&&(a.d.b=-r.c),r.c+r.b>a.b.rf().a&&(a.d.c=r.c+r.b-a.b.rf().a))}function eAz(e,t){var n,r,i,a;for(ewG(t,"Semi-Interactive Crossing Minimization Processor",1),n=!1,i=new fz(e.b);i.a=0){if(t==n)return new kD(ell(-t-1),ell(-t-1));if(t==-n)return new kD(ell(-t),ell(n+1))}return eB4.Math.abs(t)>eB4.Math.abs(n)?t<0?new kD(ell(-t),ell(n)):new kD(ell(-t),ell(n+1)):new kD(ell(t+1),ell(n))}function eAK(e){var t,n;n=Pp(e_k(e,(eBy(),taY)),163),t=Pp(e_k(e,(eBU(),tt8)),303),n==(ef_(),tnN)?(eo3(e,taY,tnj),eo3(e,tt8,(Q1(),ttN))):n==tnR?(eo3(e,taY,tnj),eo3(e,tt8,(Q1(),ttI))):t==(Q1(),ttN)?(eo3(e,taY,tnN),eo3(e,tt8,ttD)):t==ttI&&(eo3(e,taY,tnR),eo3(e,tt8,ttD))}function eAV(){eAV=A,tuY=new ad,tuP=RI(new K2,(e_x(),e9n),(eB$(),e7h)),tuF=j0(RI(new K2,e9n,e7M),e9i,e7T),tuB=ehY(ehY(_G(j0(RI(new K2,e9e,e7j),e9i,e7R),e9r),e7P),e7F),tuR=j0(RI(RI(RI(new K2,e9t,e7m),e9r,e7v),e9r,e7y),e9i,e7g),tuj=j0(RI(RI(new K2,e9r,e7y),e9r,e99),e9i,e98)}function eAq(){eAq=A,tuz=RI(j0(new K2,(e_x(),e9i),(eB$(),e7t)),e9n,e7h),tuV=ehY(ehY(_G(j0(RI(new K2,e9e,e7j),e9i,e7R),e9r),e7P),e7F),tuG=j0(RI(RI(RI(new K2,e9t,e7m),e9r,e7v),e9r,e7y),e9i,e7g),tuK=RI(RI(new K2,e9n,e7M),e9i,e7T),tuW=j0(RI(RI(new K2,e9r,e7y),e9r,e99),e9i,e98)}function eAZ(e,t,n,r,i){var a,o;(q9(t)||t.c.i.c!=t.d.i.c)&&erS(esp(eow(vx(e60,1),eUP,8,0,[i.i.n,i.n,i.a])),n)||q9(t)||(t.c==i?Ls(t.a,0,new TS(n)):P7(t.a,new TS(n)),r&&!w0(e.a,n)&&((o=Pp(e_k(t,(eBy(),taR)),74))||eo3(t,taR,o=new mE),qQ(o,a=new TS(n),o.c.b,o.c),Yf(e.a,a)))}function eAX(e){var t,n;for(n=new Fa(OH(efu(e).a.Kc(),new c));eTk(n);)if((t=Pp(ZC(n),17)).c.i.k!=(eEn(),e9I))throw p7(new gq(eWr+egs(e)+"' has its layer constraint set to FIRST, but has at least one incoming edge that does not come from a FIRST_SEPARATE node. That must not happen."))}function eAJ(e,t,n){var r,i,a,o,s,u,c;if(0==(i=efp(254&e.Db)))e.Eb=n;else{if(1==i)s=Je(e1R,eUp,1,2,5,1),0==(a=emF(e,t))?(s[0]=n,s[1]=e.Eb):(s[0]=e.Eb,s[1]=n);else for(r=2,s=Je(e1R,eUp,1,i+1,5,1),o=etG(e.Eb),u=0,c=0;r<=128;r<<=1)r==t?s[c++]=n:(e.Db&r)!=0&&(s[c++]=o[u++]);e.Eb=s}e.Db|=t}function eAQ(e,t,n){var r,i,a,o;for(this.b=new p0,i=0,r=0,o=new fz(e);o.a0&&(i+=(a=Pp(RJ(this.b,0),167)).o,r+=a.p),i*=2,r*=2,t>1?i=zy(eB4.Math.ceil(i*t)):r=zy(eB4.Math.ceil(r/t)),this.a=new edL(i,r)}function eA1(e,t,n,r,i,a){var o,s,u,c,l,f,d,h,p,b,m,g;for(l=r,t.j&&t.o?(b=(h=Pp(Bp(e.f,t.A),57)).d.c+h.d.b,--l):b=t.a.c+t.a.b,f=i,n.q&&n.o?(c=(h=Pp(Bp(e.f,n.C),57)).d.c,++f):c=n.a.c,m=c-b,p=b+(s=m/(u=eB4.Math.max(2,f-l))),d=l;d=0;o+=i?1:-1){for(s=t[o],u=r==(eYu(),tby)?i?efr(s,r):eaa(efr(s,r)):i?eaa(efr(s,r)):efr(s,r),a&&(e.c[s.p]=u.gc()),f=u.Kc();f.Ob();)l=Pp(f.Pb(),11),e.d[l.p]=c++;eoc(n,u)}}function eA2(e,t,n){var r,i,a,o,s,u,c,l;for(a=gP(LV(e.b.Kc().Pb())),c=gP(LV(eaX(t.b))),l=C6(r=Ol(MB(e.a),c-n),i=Ol(MB(t.a),n-a)),Ol(l,1/(c-a)),this.a=l,this.b=new p0,s=!0,(o=e.b.Kc()).Pb();o.Ob();)u=gP(LV(o.Pb())),s&&u-n>eVW&&(this.b.Fc(n),s=!1),this.b.Fc(u);s&&this.b.Fc(n)}function eA3(e){var t,n,r,i;if(eIh(e,e.n),e.d.c.length>0){for(gG(e.c);eTT(e,Pp(Wx(new fz(e.e.a)),121))>5,t&=31,r>=e.d)return e.e<0?(eLQ(),e03):(eLQ(),e09);if(i=Je(ty_,eHT,25,(a=e.d-r)+1,15,1),eEG(i,a,e.a,r,t),e.e<0){for(n=0;n0&&e.a[n]<<32-t!=0){for(n=0;n=0)&&(!(n=eR3((eSp(),tvc),i,t))||((r=n.Zj())>1||-1==r)&&3!=Ur(QZ(tvc,n))))}function eLn(e,t,n,r){var i,a,o,s,u;return(s=ewH(Pp(etj((t.b||(t.b=new Ih(e5m,t,4,7)),t.b),0),82)),u=ewH(Pp(etj((t.c||(t.c=new Ih(e5m,t,5,8)),t.c),0),82)),z$(s)==z$(u)||etg(u,s))?null:(o=zF(t))==n?r:(a=Pp(Bp(e.a,o),10))&&(i=a.e)?i:null}function eLr(e,t){var n;switch(n=Pp(e_k(e,(eBy(),tam)),276),ewG(t,"Label side selection ("+n+")",1),n.g){case 0:eTD(e,(egF(),tpV));break;case 1:eTD(e,(egF(),tpq));break;case 2:eNW(e,(egF(),tpV));break;case 3:eNW(e,(egF(),tpq));break;case 4:eLL(e,(egF(),tpV));break;case 5:eLL(e,(egF(),tpq))}eEj(t)}function eLi(e,t,n){var r,i,a,o,s,u;if((o=e[r=vK(n,e.length)])[0].k==(eEn(),e9C))for(i=0,a=vW(n,o.length),u=t.j;i0&&(n[0]+=e.d,o-=n[0]),n[2]>0&&(n[2]+=e.d,o-=n[2]),a=eB4.Math.max(0,o),n[1]=eB4.Math.max(n[1],o),ZR(e,e3N,i.c+r.b+n[0]-(n[1]-o)/2,n),t==e3N&&(e.c.b=a,e.c.c=i.c+r.b+(a-o)/2)}function eLy(){this.c=Je(tyx,eH6,25,(eYu(),eow(vx(e5a,1),eGj,61,0,[tbF,tbw,tby,tbj,tbY])).length,15,1),this.b=Je(tyx,eH6,25,eow(vx(e5a,1),eGj,61,0,[tbF,tbw,tby,tbj,tbY]).length,15,1),this.a=Je(tyx,eH6,25,eow(vx(e5a,1),eGj,61,0,[tbF,tbw,tby,tbj,tbY]).length,15,1),Ep(this.c,eHQ),Ep(this.b,eH1),Ep(this.a,eH1)}function eLw(e,t,n){var r,i,a,o;if(t<=n?(i=t,a=n):(i=n,a=t),r=0,null==e.b)e.b=Je(ty_,eHT,25,2,15,1),e.b[0]=i,e.b[1]=a,e.c=!0;else{if(r=e.b.length,e.b[r-1]+1==i){e.b[r-1]=a;return}o=Je(ty_,eHT,25,r+2,15,1),ePD(e.b,0,o,0,r),e.b=o,e.b[r-1]>=i&&(e.c=!1,e.a=!1),e.b[r++]=i,e.b[r]=a,e.c||eMS(e)}}function eL_(e,t,n){var r,i,a,o,s,u,c;for(c=t.d,e.a=new XM(c.c.length),e.c=new p2,s=new fz(c);s.a=0?e._g(c,!1,!0):exk(e,n,!1),58);n:for(a=f.Kc();a.Ob();){for(l=0,i=Pp(a.Pb(),56);l1;)eLN(i,i.i-1);return r}function eLA(e,t){var n,r,i,a,o,s,u;for(ewG(t,"Comment post-processing",1),a=new fz(e.b);a.ae.d[o.p]&&(n+=qq(e.b,a),Vw(e.a,ell(a)));for(;!gY(e.a);)eek(e.b,Pp(Yn(e.a),19).a)}return n}function eLD(e,t,n){var r,i,a,o;for(a=(t.a||(t.a=new FQ(e5k,t,10,11)),t.a).i,i=new Ow((t.a||(t.a=new FQ(e5k,t,10,11)),t.a));i.e!=i.i.gc();)0==((r=Pp(epH(i),33)).a||(r.a=new FQ(e5k,r,10,11)),r.a).i||(a+=eLD(e,r,!1));if(n)for(o=z$(t);o;)a+=(o.a||(o.a=new FQ(e5k,o,10,11)),o.a).i,o=z$(o);return a}function eLN(e,t){var n,r,i,a;return e.ej()?(r=null,i=e.fj(),e.ij()&&(r=e.kj(e.pi(t),null)),n=e.Zi(4,a=egk(e,t),null,t,i),e.bj()&&null!=a?(r=e.dj(a,r))?(r.Ei(n),r.Fi()):e.$i(n):r?(r.Ei(n),r.Fi()):e.$i(n),a):(a=egk(e,t),e.bj()&&null!=a&&(r=e.dj(a,null))&&r.Fi(),a)}function eLP(e){var t,n,r,i,a,o,s,u,c,l;for(c=e.a,t=new bV,u=0,r=new fz(e.d);r.as.d&&(l=s.d+s.a+c));n.c.d=l,t.a.zc(n,t),u=eB4.Math.max(u,n.c.d+n.c.a)}return u}function eLR(){eLR=A,ttv=new Sv("COMMENTS",0),ttw=new Sv("EXTERNAL_PORTS",1),tt_=new Sv("HYPEREDGES",2),ttE=new Sv("HYPERNODES",3),ttS=new Sv("NON_FREE_PORTS",4),ttk=new Sv("NORTH_SOUTH_PORTS",5),ttT=new Sv(eWw,6),ttg=new Sv("CENTER_LABELS",7),tty=new Sv("END_LABELS",8),ttx=new Sv("PARTITIONS",9)}function eLj(e){var t,n,r,i,a;for(i=new p0,t=new Rq((e.a||(e.a=new FQ(e5k,e,10,11)),e.a)),r=new Fa(OH(eOi(e).a.Kc(),new c));eTk(r);)n=Pp(ZC(r),79),!M4(etj((n.b||(n.b=new Ih(e5m,n,4,7)),n.b),0),186)&&(a=ewH(Pp(etj((n.c||(n.c=new Ih(e5m,n,5,8)),n.c),0),82)),t.a._b(a)||(i.c[i.c.length]=a));return i}function eLF(e){var t,n,r,i,a,o;for(a=new bV,t=new Rq((e.a||(e.a=new FQ(e5k,e,10,11)),e.a)),i=new Fa(OH(eOi(e).a.Kc(),new c));eTk(i);)r=Pp(ZC(i),79),!M4(etj((r.b||(r.b=new Ih(e5m,r,4,7)),r.b),0),186)&&(o=ewH(Pp(etj((r.c||(r.c=new Ih(e5m,r,5,8)),r.c),0),82)),t.a._b(o)||(n=a.a.zc(o,a)));return a}function eLY(e,t,n,r,i){return r<0?((r=ew5(e,i,eow(vx(e17,1),eUP,2,6,[eHh,eHp,eHb,eHm,eHg,eHv,eHy,eHw,eH_,eHE,eHS,eHk]),t))<0&&(r=ew5(e,i,eow(vx(e17,1),eUP,2,6,["Jan","Feb","Mar","Apr",eHg,"Jun","Jul","Aug","Sep","Oct","Nov","Dec"]),t)),!(r<0)&&(n.k=r,!0)):r>0&&(n.k=r-1,!0)}function eLB(e,t,n,r,i){return r<0?((r=ew5(e,i,eow(vx(e17,1),eUP,2,6,[eHh,eHp,eHb,eHm,eHg,eHv,eHy,eHw,eH_,eHE,eHS,eHk]),t))<0&&(r=ew5(e,i,eow(vx(e17,1),eUP,2,6,["Jan","Feb","Mar","Apr",eHg,"Jun","Jul","Aug","Sep","Oct","Nov","Dec"]),t)),!(r<0)&&(n.k=r,!0)):r>0&&(n.k=r-1,!0)}function eLU(e,t,n,r,i,a){var o,s,u,c;if(s=32,r<0){if(t[0]>=e.length||43!=(s=UI(e,t[0]))&&45!=s||(++t[0],(r=exf(e,t))<0))return!1;45==s&&(r=-r)}return 32==s&&t[0]-n==2&&2==i.b&&(o=(c=(u=new wW).q.getFullYear()-eHx+eHx-80)%100,a.a=r==o,r+=(c/100|0)*100+(r=c&&(u=r);u&&(l=eB4.Math.max(l,u.a.o.a)),l>d&&(f=c,d=l)}return f}function eLV(e,t,n){var r,i,a;if(e.e=n,e.d=0,e.b=0,e.f=1,e.i=t,(16&e.e)==16&&(e.i=eIw(e.i)),e.j=e.i.length,eBM(e),a=ehT(e),e.d!=e.j)throw p7(new gX(eBJ((Mo(),eXV))));if(e.g){for(r=0;reqg?Mv(u,e.b):r<=eqg&&r>eqv?Mv(u,e.d):r<=eqv&&r>eqy?Mv(u,e.c):r<=eqy&&Mv(u,e.a),a=eLJ(e,u,a);return i}function eLQ(){var e;for(e=0,eLQ=A,e04=new XE(1,1),e05=new XE(1,10),e09=new XE(0,0),e03=new XE(-1,1),e06=eow(vx(e0t,1),eUP,91,0,[e09,e04,new XE(1,2),new XE(1,3),new XE(1,4),new XE(1,5),new XE(1,6),new XE(1,7),new XE(1,8),new XE(1,9),e05]),e08=Je(e0t,eUP,91,32,0,1);e1)&&(r=new kl(i,n.b),P7(t.a,r)),enD(t.a,eow(vx(e60,1),eUP,8,0,[d,f]))}function eL5(e){_Y(e,new ewB(vQ(vq(vJ(vX(new oc,eZA),"ELK Randomizer"),'Distributes the nodes randomly on the plane, leading to very obfuscating layouts. Can be useful to demonstrate the power of "real" layout algorithms.'),new oz))),KE(e,eZA,ezW,tb$),KE(e,eZA,eGi,15),KE(e,eZA,eGo,ell(0)),KE(e,eZA,ezG,eGt)}function eL8(){var e,t,n,r,i,a;for(t=0,eL8=A,tv1=Je(tyk,eZ9,25,255,15,1),tv0=Je(tyw,eHl,25,16,15,1);t<255;t++)tv1[t]=-1;for(n=57;n>=48;n--)tv1[n]=n-48<<24>>24;for(r=70;r>=65;r--)tv1[r]=r-65+10<<24>>24;for(i=102;i>=97;i--)tv1[i]=i-97+10<<24>>24;for(a=0;a<10;a++)tv0[a]=48+a&eHd;for(e=10;e<=15;e++)tv0[e]=65+e-10&eHd}function eL9(e,t,n){var r,i,a,o,s,u,c,l;return s=t.i-e.g/2,u=n.i-e.g/2,c=t.j-e.g/2,l=n.j-e.g/2,a=t.g+e.g/2,o=n.g+e.g/2,r=t.f+e.g/2,i=n.f+e.g/2,!!(s>19!=0)return"-"+eCr(eoQ(e));for(n=e,r="";!(0==n.l&&0==n.m&&0==n.h);){if(n=eRV(n,i=Zx(eHK),!0),t=""+yq(e0A),!(0==n.l&&0==n.m&&0==n.h))for(a=9-t.length;a>0;a--)t="0"+t;r=t+r}return r}function eCi(){if(!Object.create||!Object.getOwnPropertyNames)return!1;var e="__proto__",t=Object.create(null);return void 0===t[e]&&0==Object.getOwnPropertyNames(t).length&&(t[e]=42,42===t[e]&&0!=Object.getOwnPropertyNames(t).length)}function eCa(e){var t,n,r,i,a,o,s;for(t=!1,n=0,i=new fz(e.d.b);i.a=e.a||!ewg(t,n))return -1;if(Vb(Pp(r.Kb(t),20)))return 1;for(i=0,o=Pp(r.Kb(t),20).Kc();o.Ob();)if(-1==(s=eCu(e,u=(a=Pp(o.Pb(),17)).c.i==t?a.d.i:a.c.i,n,r))||(i=eB4.Math.max(i,s))>e.c-1)return -1;return i+1}function eCc(e,t){var n,r,i,a,o,s;if(xc(t)===xc(e))return!0;if(!M4(t,15)||(r=Pp(t,15),s=e.gc(),r.gc()!=s))return!1;if(o=r.Kc(),e.ni()){for(n=0;n0){if(e.qj(),null!=t){for(a=0;a>24;case 97:case 98:case 99:case 100:case 101:case 102:return e-97+10<<24>>24;case 65:case 66:case 67:case 68:case 69:case 70:return e-65+10<<24>>24;default:throw p7(new vo("Invalid hexadecimal"))}}function eCh(e,t,n){var r,i,a,o;for(ewG(n,"Processor order nodes",2),e.a=gP(LV(e_k(t,(eTj(),tcR)))),i=new _n,o=epL(t.b,0);o.b!=o.d.c;)gN(LK(e_k(a=Pp(Vv(o),86),(eR5(),tcm))))&&qQ(i,a,i.c.b,i.c);eRt(e,r=(A5(0!=i.b),Pp(i.a.a.c,86))),n.b||erd(n,1),eC1(e,r,0-gP(LV(e_k(r,(eR5(),tcu))))/2,0),n.b||erd(n,1),eEj(n)}function eCp(){eCp=A,e3C=new Ej("SPIRAL",0),e3T=new Ej("LINE_BY_LINE",1),e3M=new Ej("MANHATTAN",2),e3x=new Ej("JITTER",3),e3A=new Ej("QUADRANTS_LINE_BY_LINE",4),e3L=new Ej("QUADRANTS_MANHATTAN",5),e3O=new Ej("QUADRANTS_JITTER",6),e3k=new Ej("COMBINE_LINE_BY_LINE_MANHATTAN",7),e3S=new Ej("COMBINE_JITTER_MANHATTAN",8)}function eCb(e,t,n,r){var i,a,o,s,u,c;for(u=eya(e,n),c=eya(t,n),i=!1;u&&c;)if(r||egl(u,c,n))o=eya(u,n),s=eya(c,n),QB(t),QB(e),a=u.c,ejf(u,!1),ejf(c,!1),n?(egU(t,c.p,a),t.p=c.p,egU(e,u.p+1,a),e.p=u.p):(egU(e,u.p,a),e.p=u.p,egU(t,c.p+1,a),t.p=c.p),Gu(u,null),Gu(c,null),u=o,c=s,i=!0;else break;return i}function eCm(e,t,n,r){var i,a,o,s,u;for(i=!1,a=!1,s=new fz(r.j);s.a=t.length)throw p7(new gE("Greedy SwitchDecider: Free layer not in graph."));this.c=t[e],this.e=new IQ(r),er$(this.e,this.c,(eYu(),tbY)),this.i=new IQ(r),er$(this.i,this.c,tby),this.f=new jy(this.c),this.a=!a&&i.i&&!i.s&&this.c[0].k==(eEn(),e9C),this.a&&eSt(this,e,t.length)}function eC_(e,t){var n,r,i,a,o,s;a=!e.B.Hc((eI3(),tbX)),o=e.B.Hc(tb1),e.a=new edA(o,a,e.c),e.n&&HI(e.a.n,e.n),gh(e.g,(etx(),e3N),e.a),t||((r=new eh5(1,a,e.c)).n.a=e.k,jT(e.p,(eYu(),tbw),r),(i=new eh5(1,a,e.c)).n.d=e.k,jT(e.p,tbj,i),(s=new eh5(0,a,e.c)).n.c=e.k,jT(e.p,tbY,s),(n=new eh5(0,a,e.c)).n.b=e.k,jT(e.p,tby,n))}function eCE(e){var t,n,r;switch((t=Pp(e_k(e.d,(eBy(),tag)),218)).g){case 2:n=eBn(e);break;case 3:n=(r=new p0,_r(UJ(UQ(eeh(eeh(new R1(null,new Gq(e.d.b,16)),new rJ),new rQ),new r1),new rY),new ha(r)),r);break;default:throw p7(new gC("Compaction not supported for "+t+" edges."))}eRD(e,n),qX(new fk(e.g),new hr(e))}function eCS(e,t){var n;return(n=new eX,t&&eaW(n,Pp(Bp(e.a,e5p),94)),M4(t,470)&&eaW(n,Pp(Bp(e.a,e5b),94)),M4(t,354))?(eaW(n,Pp(Bp(e.a,e5S),94)),n):(M4(t,82)&&eaW(n,Pp(Bp(e.a,e5m),94)),M4(t,239))?(eaW(n,Pp(Bp(e.a,e5k),94)),n):M4(t,186)?(eaW(n,Pp(Bp(e.a,e5x),94)),n):(M4(t,352)&&eaW(n,Pp(Bp(e.a,e5g),94)),n)}function eCk(){eCk=A,e8M=new T2((eBB(),th4),ell(1)),e8D=new T2(tpl,80),e8I=new T2(tpr,5),e8p=new T2(td2,eGt),e8O=new T2(th6,ell(1)),e8C=new T2(th9,(OQ(),!0)),e8k=new T3(50),e8S=new T2(thN,e8k),e8m=thb,e8x=thV,e8b=new T2(thn,!1),e8E=thD,e8_=thL,e8w=thx,e8y=thS,e8T=thJ,e8v=(eEg(),e8i),e8N=e8c,e8g=e8r,e8A=e8o,e8L=e8u}function eCx(e){var t,n,r,i,a,o,s,u;for(u=new Zr,s=new fz(e.a);s.a0&&t=0)return!1;if(t.p=n.b,P_(n.e,t),i==(eEn(),e9D)||i==e9P){for(o=new fz(t.j);o.a1||-1==o)&&(a|=16),(i.Bb&eZ1)!=0&&(a|=64)),(n.Bb&eH3)!=0&&(a|=eJq),a|=eXt):M4(t,457)?a|=512:(r=t.Bj())&&(1&r.i)!=0&&(a|=256),(512&e.Bb)!=0&&(a|=128),a}function eCG(e,t){var n,r,i,a,o;for(i=0,e=null==e?eUg:(BJ(e),e);ie.d[s.p]&&(n+=qq(e.b,a),Vw(e.a,ell(a))):++o;for(n+=e.b.d*o;!gY(e.a);)eek(e.b,Pp(Yn(e.a),19).a)}return n}function eCV(e,t){var n;return e.f==tvm?(n=Ur(QZ((eSp(),tvc),t)),e.e?4==n&&t!=(ex$(),tvw)&&t!=(ex$(),tvg)&&t!=(ex$(),tvv)&&t!=(ex$(),tvy):2==n):!!(e.d&&(e.d.Hc(t)||e.d.Hc(Wk(QZ((eSp(),tvc),t)))||e.d.Hc(eR3((eSp(),tvc),e.b,t))))||!!(e.f&&eOq((eSp(),e.f),U$(QZ(tvc,t))))&&(n=Ur(QZ(tvc,t)),e.e?4==n:2==n)}function eCq(e,t,n,r){var i,a,o,s,u,c,l,f;return u=(o=Pp(eT9(n,(eBB(),th3)),8)).a,l=o.b+e,(i=eB4.Math.atan2(l,u))<0&&(i+=eV7),(i+=t)>eV7&&(i-=eV7),c=(s=Pp(eT9(r,th3),8)).a,f=s.b+e,(a=eB4.Math.atan2(f,c))<0&&(a+=eV7),(a+=t)>eV7&&(a-=eV7),Mc(),enj(1e-10),1e-10>=eB4.Math.abs(i-a)||i==a||isNaN(i)&&isNaN(a)?0:ia?1:Te(isNaN(i),isNaN(a))}function eCZ(e){var t,n,r,i,a,o,s;for(s=new p2,r=new fz(e.a.b);r.a=e.o)throw p7(new bj);s=t>>5,o=31&t,a=Fg(1,jE(Fg(o,1))),i?e.n[n][s]=WO(e.n[n][s],a):e.n[n][s]=WM(e.n[n][s],PN(a)),a=Fg(a,1),r?e.n[n][s]=WO(e.n[n][s],a):e.n[n][s]=WM(e.n[n][s],PN(a))}catch(u){if(u=eoa(u),M4(u,320))throw p7(new gE(ez_+e.o+"*"+e.p+ezE+t+eUd+n+ezS));throw p7(u)}}function eC1(e,t,n,r){var i,a,o;t&&(a=gP(LV(e_k(t,(eR5(),tcd))))+r,o=n+gP(LV(e_k(t,tcu)))/2,eo3(t,tcg,ell(jE(eap(eB4.Math.round(a))))),eo3(t,tcv,ell(jE(eap(eB4.Math.round(o))))),0==t.d.b||eC1(e,Pp(M2((i=epL(new hz(t).a.d,0),new hG(i))),86),n+gP(LV(e_k(t,tcu)))+e.a,r+gP(LV(e_k(t,tcc)))),null!=e_k(t,tcb)&&eC1(e,Pp(e_k(t,tcb),86),n,r))}function eC0(e,t){var n,r,i,a,o,s,u,c,l,f,d;for(i=2*gP(LV(e_k(u=Bq(t.a),(eBy(),toI)))),l=gP(LV(e_k(u,toY))),c=eB4.Math.max(i,l),a=Je(tyx,eH6,25,t.f-t.c+1,15,1),r=-c,n=0,s=t.b.Kc();s.Ob();)o=Pp(s.Pb(),10),r+=e.a[o.c.p]+c,a[n++]=r;for(r+=e.a[t.a.c.p]+c,a[n++]=r,d=new fz(t.e);d.a0&&(r=(e.n||(e.n=new FQ(e5S,e,1,7)),Pp(etj(e.n,0),137)).a)&&xM(xM((t.a+=' "',t),r),'"')),xM(yW(xM(yW(xM(yW(xM(yW((t.a+=" (",t),e.i),","),e.j)," | "),e.g),","),e.f),")"),t.a)}function eC6(e){var t,n,r;return(64&e.Db)!=0?eEp(e):(t=new O0(eZG),(n=e.k)?xM(xM((t.a+=' "',t),n),'"'):(e.n||(e.n=new FQ(e5S,e,1,7)),e.n.i>0&&(r=(e.n||(e.n=new FQ(e5S,e,1,7)),Pp(etj(e.n,0),137)).a)&&xM(xM((t.a+=' "',t),r),'"')),xM(yW(xM(yW(xM(yW(xM(yW((t.a+=" (",t),e.i),","),e.j)," | "),e.g),","),e.f),")"),t.a)}function eC5(e,t){var n,r,i,a,o,s,u;if(null==t||0==t.length)return null;if(!(i=Pp(zg(e.a,t),149))){for(r=(s=new fT(e.b).a.vc().Kc(),new fN(s));r.a.Ob();)if(o=(n=(a=Pp(r.a.Pb(),42),Pp(a.dd(),149))).c,u=t.length,IE(o.substr(o.length-u,u),t)&&(t.length==o.length||46==UI(o,o.length-t.length-1))){if(i)return null;i=n}i&&Ge(e.a,t,i)}return i}function eC8(e,t){var n,r,i,a;return(n=new eD,i=(r=Pp(qE(UQ(new R1(null,new Gq(e.f,16)),n),Qz(new q,new Z,new er,new ei,eow(vx(e2L,1),eU4,132,0,[(eum(),e2H),e2U]))),21)).gc(),a=(r=Pp(qE(UQ(new R1(null,new Gq(t.f,16)),n),Qz(new q,new Z,new er,new ei,eow(vx(e2L,1),eU4,132,0,[e2H,e2U]))),21)).gc(),ii.p?(ekv(a,tbj),a.d&&(s=a.o.b,t=a.a.b,a.a.b=s-t)):a.j==tbj&&i.p>e.p&&(ekv(a,tbw),a.d&&(s=a.o.b,t=a.a.b,a.a.b=-(s-t)));break}return i}function eIe(e,t,n,r){var i,a,o,s,u,c,l,f,d,h,p;if(a=n,n1)&&(r=new kl(i,n.b),P7(t.a,r)),enD(t.a,eow(vx(e60,1),eUP,8,0,[d,f]))}function eIy(e,t,n){var r,i,a,o,s,u;if(!t)return null;if(!(n<=-1))return ebY(Pp(ee2(e.Tg(),n),18));if(r=ee2(t.Tg(),-1-n),M4(r,99))return Pp(r,18);for(s=0,u=(o=Pp(t.ah(r),153)).gc();s0){for(i=u.length;i>0&&""==u[i-1];)--i;i=t.d.a.gc()){o=t.a.c,s=t.a.c+t.a.b,u=new kl(o+(s-o)/2,t.b),P7(Pp(t.d.a.ec().Kc().Pb(),17).a,u);continue}if((i=Pp(Bp(t.c,n),459)).b||i.c){eIv(e,n,t);continue}(a=e.d==(euy(),tsW)&&(i.d||i.e)&&exJ(e,t)&&1>=t.d.a.gc())?eFd(n,t):eL6(e,n,t)}t.k&&qX(t.d,new nn)}}function eIq(e,t,n,r,i,a){var o,s,u,c,l,f,d,h,p,b,m,g,v,y;for(s=(r+i)/2+(d=a),m=n*eB4.Math.cos(s),g=n*eB4.Math.sin(s),v=m-t.g/2,y=g-t.f/2,eno(t,v),ens(t,y),f=e.a.jg(t),(b=2*eB4.Math.acos(n/n+e.c))=40)&&eNo(e),eRi(e),eA3(e),n=elM(e),r=0;n&&r0&&P7(e.f,a)):(e.c[o]-=c+1,e.c[o]<=0&&e.a[o]>0&&P7(e.e,a))))}function eI1(e){var t,n,r,i,a,o,s,u,c;for(s=new yB(Pp(Y8(new eP),62)),c=eH1,n=new fz(e.d);n.a=0&&un?t:n;c<=f;++c)c==n?s=r++:(a=i[c],l=p.rl(a.ak()),c==t&&(u=c!=f||l?r:r-1),l&&++r);return d=Pp(elR(e,t,n),72),s!=u&&bz(e,new JU(e.e,7,o,ell(s),h.dd(),u)),d}return Pp(elR(e,t,n),72)}function eDe(e,t){var n,r,i,a,o,s,u;for(ewG(t,"Port order processing",1),u=Pp(e_k(e,(eBy(),tom)),421),r=new fz(e.b);r.a=0&&(!(s=egy(e,o))||(c<22?u.l|=1<>>1,o.m=l>>>1|(1&f)<<21,o.l=d>>>1|(1&l)<<21,--c;return n&&esh(u),a&&(r?(e0A=eoQ(e),i&&(e0A=eor(e0A,(Q2(),e0I)))):e0A=Mk(e.l,e.m,e.h)),u}function eDi(e,t){var n,r,i,a,o,s,u,c,l,f;for(c=e.e[t.c.p][t.p]+1,u=t.c.a.c.length+1,s=new fz(e.a);s.a0&&(GV(0,e.length),45==e.charCodeAt(0)||(GV(0,e.length),43==e.charCodeAt(0)))?1:0;rn)throw p7(new vo(eHJ+e+'"'));return s}function eDo(e){var t,n,r,i,a,o,s;for(o=new _n,a=new fz(e.a);a.a1)&&1==t&&Pp(e.a[e.b],10).k==(eEn(),e9I)?eD3(Pp(e.a[e.b],10),(egF(),tpV)):r&&(!n||(e.c-e.b&e.a.length-1)>1)&&1==t&&Pp(e.a[e.c-1&e.a.length-1],10).k==(eEn(),e9I)?eD3(Pp(e.a[e.c-1&e.a.length-1],10),(egF(),tpq)):(e.c-e.b&e.a.length-1)==2?(eD3(Pp(eso(e),10),(egF(),tpV)),eD3(Pp(eso(e),10),tpq)):eM9(e,i),qr(e)}function eDf(e,t,n){var r,i,a,o,s;for(a=0,i=new Ow((e.a||(e.a=new FQ(e5k,e,10,11)),e.a));i.e!=i.i.gc();)r=Pp(epH(i),33),o="",0==(r.n||(r.n=new FQ(e5S,r,1,7)),r.n).i||(o=Pp(etj((r.n||(r.n=new FQ(e5S,r,1,7)),r.n),0),137).a),eaW(s=new esH(a++,t,o),r),eo3(s,(eR5(),tcl),r),s.e.b=r.j+r.f/2,s.f.a=eB4.Math.max(r.g,1),s.e.a=r.i+r.g/2,s.f.b=eB4.Math.max(r.f,1),P7(t.b,s),eS8(n.f,r,s)}function eDd(e){var t,n,r,i,a;r=Pp(e_k(e,(eBU(),tnc)),33),a=Pp(eT9(r,(eBy(),ta4)),174).Hc((ed5(),tbq)),!e.e&&(i=Pp(e_k(e,tt3),21),t=new kl(e.f.a+e.d.b+e.d.c,e.f.b+e.d.d+e.d.a),i.Hc((eLR(),ttw))?(ebu(r,tol,(ewf(),tbo)),eYx(r,t.a,t.b,!1,!0)):gN(LK(eT9(r,ta6)))||eYx(r,t.a,t.b,!0,!0)),a?ebu(r,ta4,el8(tbq)):ebu(r,ta4,(n=Pp(yw(e5o),9),new I1(n,Pp(CY(n,n.length),9),0)))}function eDh(e,t,n){var r,i,a,o;if(t[0]>=e.length)return n.o=0,!0;switch(UI(e,t[0])){case 43:i=1;break;case 45:i=-1;break;default:return n.o=0,!0}if(++t[0],a=t[0],0==(o=exf(e,t))&&t[0]==a)return!1;if(t[0]=0&&s!=n&&(a=new FX(e,1,s,o,null),r?r.Ei(a):r=a),n>=0&&(a=new FX(e,1,n,s==n?o:null,t),r?r.Ei(a):r=a)),r}function eDv(e){var t,n,r;if(null==e.b){if(r=new vs,null!=e.i&&(xk(r,e.i),r.a+=":"),(256&e.f)!=0){for((256&e.f)!=0&&null!=e.a&&(Hb(e.i)||(r.a+="//"),xk(r,e.a)),null!=e.d&&(r.a+="/",xk(r,e.d)),(16&e.f)!=0&&(r.a+="/"),t=0,n=e.j.length;td)&&(f=(u=ePI(r,d,!1)).a,l+s+f<=t.b&&(JR(n,a-n.s),n.c=!0,JR(r,a-n.s),ebP(r,n.s,n.t+n.d+s),r.k=!0,eiV(n.q,r),h=!0,i&&(enN(t,r),r.j=t,e.c.length>o&&(eva((GK(o,e.c.length),Pp(e.c[o],200)),r),0==(GK(o,e.c.length),Pp(e.c[o],200)).a.c.length&&ZV(e,o)))),h)}function eDx(e,t){var n,r,i,a,o,s;if(ewG(t,"Partition midprocessing",1),i=new zu,_r(UJ(new R1(null,new Gq(e.a,16)),new nK),new dQ(i)),0!=i.d){for(r=(s=Pp(qE(GU((a=i.i,new R1(null,(a||(i.i=new OC(i,i.c))).Nc()))),JF(new U,new B,new en,eow(vx(e2L,1),eU4,132,0,[(eum(),e2U)]))),15)).Kc(),n=Pp(r.Pb(),19);r.Ob();)o=Pp(r.Pb(),19),eOR(Pp(Zq(i,n),21),Pp(Zq(i,o),21)),n=o;eEj(t)}}function eDT(e,t,n){var r,i,a,o,s,u,c,l;if(0==t.p){for(t.p=1,(o=n)||(i=new p0,a=(r=Pp(yw(e5a),9),new I1(r,Pp(CY(r,r.length),9),0)),o=new kD(i,a)),Pp(o.a,15).Fc(t),t.k==(eEn(),e9C)&&Pp(o.b,21).Fc(Pp(e_k(t,(eBU(),tt1)),61)),u=new fz(t.j);u.a0){if(i=Pp(e.Ab.g,1934),null==t){for(a=0;a1)for(r=new fz(i);r.an.s&&ss&&(s=i,f.c=Je(e1R,eUp,1,0,5,1)),i==s&&P_(f,new kD(n.c.i,n)));Hj(),Mv(f,e.c),jO(e.b,u.p,f)}}function eDR(e,t){var n,r,i,a,o,s,u,l,f;for(o=new fz(t.b);o.as&&(s=i,f.c=Je(e1R,eUp,1,0,5,1)),i==s&&P_(f,new kD(n.d.i,n)));Hj(),Mv(f,e.c),jO(e.f,u.p,f)}}function eDj(e){_Y(e,new ewB(vQ(vq(vJ(vX(new oc,eZn),"ELK Box"),"Algorithm for packing of unconnected boxes, i.e. graphs without edges."),new oA))),KE(e,eZn,ezW,td$),KE(e,eZn,eGi,15),KE(e,eZn,eGr,ell(0)),KE(e,eZn,eqC,epB(tdj)),KE(e,eZn,eGh,epB(tdY)),KE(e,eZn,eGd,epB(tdU)),KE(e,eZn,ezG,eZt),KE(e,eZn,eGu,epB(tdF)),KE(e,eZn,eGM,epB(tdB)),KE(e,eZn,eZr,epB(tdP)),KE(e,eZn,eVg,epB(tdR))}function eDF(e,t){var n,r,i,a,o,s,u,c,l;if(o=(i=e.i).o.a,a=i.o.b,o<=0&&a<=0)return eYu(),tbF;switch(c=e.n.a,l=e.n.b,s=e.o.a,n=e.o.b,t.g){case 2:case 1:if(c<0)return eYu(),tbY;if(c+s>o)return eYu(),tby;break;case 4:case 3:if(l<0)return eYu(),tbw;if(l+n>a)return eYu(),tbj}return(u=(c+s/2)/o)+(r=(l+n/2)/a)<=1&&u-r<=0?(eYu(),tbY):u+r>=1&&u-r>=0?(eYu(),tby):r<.5?(eYu(),tbw):(eYu(),tbj)}function eDY(e,t){var n,r,i,a,o,s,u,c,l,f,d,h,p,b;for(n=!1,l=gP(LV(e_k(t,(eBy(),toF)))),p=eHe*l,i=new fz(t.b);i.a(u=s.n.b-s.d.d+d.a)+p&&(b=f.g+d.g,d.a=(d.g*d.a+f.g*f.a)/b,d.g=b,f.f=d,n=!0)),a=s,f=d;return n}function eDB(e,t,n,r,i,a,o){var s,u,c,l,f,d;for(d=new TE,c=t.Kc();c.Ob();)for(s=Pp(c.Pb(),839),f=new fz(s.wf());f.a0?s.a?i>(c=s.b.rf().b)&&(e.v||1==s.c.d.c.length?(o=(i-c)/2,s.d.d=o,s.d.a=o):(r=((n=Pp(RJ(s.c.d,0),181).rf().b)-c)/2,s.d.d=eB4.Math.max(0,r),s.d.a=i-r-c)):s.d.a=e.t+i:FY(e.u)&&((a=ew1(s.b)).d<0&&(s.d.d=-a.d),a.d+a.a>s.b.rf().b&&(s.d.a=a.d+a.a-s.b.rf().b))}function eD$(e,t){var n;switch(eeg(e)){case 6:return xd(t);case 7:return xf(t);case 8:return xl(t);case 3:return Array.isArray(t)&&!((n=eeg(t))>=14&&n<=16);case 11:return null!=t&&typeof t===eUs;case 12:return null!=t&&(typeof t===eUr||typeof t==eUs);case 0:return ebs(t,e.__elementTypeId$);case 2:return YS(t)&&t.im!==O;case 1:return YS(t)&&t.im!==O||ebs(t,e.__elementTypeId$);default:return!0}}function eDz(e,t){var n,r,i,a;return(r=eB4.Math.min(eB4.Math.abs(e.c-(t.c+t.b)),eB4.Math.abs(e.c+e.b-t.c)),a=eB4.Math.min(eB4.Math.abs(e.d-(t.d+t.a)),eB4.Math.abs(e.d+e.a-t.d)),(n=eB4.Math.abs(e.c+e.b/2-(t.c+t.b/2)))>e.b/2+t.b/2||(i=eB4.Math.abs(e.d+e.a/2-(t.d+t.a/2)))>e.a/2+t.a/2)?1:0==n&&0==i?0:0==n?a/i+1:0==i?r/n+1:eB4.Math.min(r/n,a/i)+1}function eDG(e,t){var n,r,i,a,o,s;return(i=enR(e),s=enR(t),i!=s)?it.f?1:0:(r=e.e-t.e,(n=(e.d>0?e.d:eB4.Math.floor((e.a-1)*eH8)+1)-(t.d>0?t.d:eB4.Math.floor((t.a-1)*eH8)+1))>r+1)?i:n0&&(o=eeD(o,eN4(r))),ehI(a,o))}function eDW(e,t){var n,r,i,a,o,s,u;for(a=0,s=0,u=0,i=new fz(e.f.e);i.a0&&e.d!=(QJ(),e86)&&(s+=o*(r.d.a+e.a[t.b][r.b]*(t.d.a-r.d.a)/n)),n>0&&e.d!=(QJ(),e83)&&(u+=o*(r.d.b+e.a[t.b][r.b]*(t.d.b-r.d.b)/n)));switch(e.d.g){case 1:return new kl(s/a,t.d.b);case 2:return new kl(t.d.a,u/a);default:return new kl(s/a,u/a)}}function eDK(e,t){var n,r,i,a,o;if(euv(),o=Pp(e_k(e.i,(eBy(),tol)),98),0!=(a=e.j.g-t.j.g)||!(o==(ewf(),tba)||o==tbs||o==tbo))return 0;if(o==(ewf(),tba)&&(n=Pp(e_k(e,tof),19),r=Pp(e_k(t,tof),19),n&&r&&0!=(i=n.a-r.a)))return i;switch(e.j.g){case 1:return elN(e.n.a,t.n.a);case 2:return elN(e.n.b,t.n.b);case 3:return elN(t.n.a,e.n.a);case 4:return elN(t.n.b,e.n.b);default:throw p7(new gC(eGz))}}function eDV(e){var t,n,r,i,a,o;for(n=(e.a||(e.a=new O_(e5h,e,5)),e.a).i+2,o=new XM(n),P_(o,new kl(e.j,e.k)),_r(new R1(null,(e.a||(e.a=new O_(e5h,e,5)),new Gq(e.a,16))),new h5(o)),P_(o,new kl(e.b,e.c)),t=1;t0&&(eoY(u,!1,(ec3(),tpm)),eoY(u,!0,tpg)),ety(t.g,new E4(e,n)),Um(e.g,t,n)}function eDZ(){var e;for(e=2,eDZ=A,e0$=eow(vx(ty_,1),eHT,25,15,[-1,-1,30,19,15,13,11,11,10,9,9,8,8,8,8,7,7,7,7,7,7,7,6,6,6,6,6,6,6,6,6,6,6,6,6,6,5]),e0z=Je(ty_,eHT,25,37,15,1),e0G=eow(vx(ty_,1),eHT,25,15,[-1,-1,63,40,32,28,25,23,21,20,19,19,18,18,17,17,16,16,16,15,15,15,15,14,14,14,14,14,14,13,13,13,13,13,13,13,13]),e0W=Je(tyS,eH2,25,37,14,1);e<=36;e++)e0z[e]=zy(eB4.Math.pow(e,e0$[e])),e0W[e]=eyt(eUY,e0z[e])}function eDX(e){var t;if(1!=(e.a||(e.a=new FQ(e5v,e,6,6)),e.a).i)throw p7(new gL(eZC+(e.a||(e.a=new FQ(e5v,e,6,6)),e.a).i));return t=new mE,eoo(Pp(etj((e.b||(e.b=new Ih(e5m,e,4,7)),e.b),0),82))&&er7(t,eBE(e,eoo(Pp(etj((e.b||(e.b=new Ih(e5m,e,4,7)),e.b),0),82)),!1)),eoo(Pp(etj((e.c||(e.c=new Ih(e5m,e,5,8)),e.c),0),82))&&er7(t,eBE(e,eoo(Pp(etj((e.c||(e.c=new Ih(e5m,e,5,8)),e.c),0),82)),!0)),t}function eDJ(e,t){var n,r,i,a,o;for(i=t.d?e.a.c==(zs(),tuw)?efu(t.b):efc(t.b):e.a.c==(zs(),tuy)?efu(t.b):efc(t.b),a=!1,r=new Fa(OH(i.a.Kc(),new c));eTk(r);)if(n=Pp(ZC(r),17),!(!(o=gN(e.a.f[e.a.g[t.b.p].p]))&&!q9(n)&&n.c.i.c==n.d.i.c||gN(e.a.n[e.a.g[t.b.p].p])||gN(e.a.n[e.a.g[t.b.p].p]))&&(a=!0,w0(e.b,e.a.g[emN(n,t.b).p])))return t.c=!0,t.a=n,t;return t.c=a,t.a=null,t}function eDQ(e,t,n,r,i){var a,o,s,u,c,l,f;for(Hj(),Mv(e,new oU),s=new KB(e,0),f=new p0,a=0;s.b2*a?(l=new etD(f),c=jl(o)/jc(o),u=eY8(l,t,new mp,n,r,i,c),C6(xB(l.e),u),f.c=Je(e1R,eUp,1,0,5,1),a=0,f.c[f.c.length]=l,f.c[f.c.length]=o,a=jl(l)*jc(l)+jl(o)*jc(o)):(f.c[f.c.length]=o,a+=jl(o)*jc(o));return f}function eD1(e,t,n){var r,i,a,o,s,u,c;if(0==(r=n.gc()))return!1;if(e.ej()){if(u=e.fj(),edu(e,t,n),o=1==r?e.Zi(3,null,n.Kc().Pb(),t,u):e.Zi(5,null,n,t,u),e.bj()){for(s=r<100?null:new yf(r),a=t+r,i=t;i0){for(o=0;o>16==-15&&e.Cb.nh()&&QU(new JB(e.Cb,9,13,n,e.c,ebv(QX(Pp(e.Cb,59)),e))):M4(e.Cb,88)&&e.Db>>16==-23&&e.Cb.nh()&&(M4(t=e.c,88)||(t=(eBK(),tgI)),M4(n,88)||(n=(eBK(),tgI)),QU(new JB(e.Cb,9,10,n,t,ebv(qt(Pp(e.Cb,26)),e)))))),e.c}function eD5(e,t){var n,r,i,a,o,s,u,c,l,f;for(ewG(t,"Hypernodes processing",1),i=new fz(e.b);i.an)return i}function eNe(e,t){var n,r,i;r=0!=eMU(e.d,1),(gN(LK(e_k(t.j,(eBU(),tt2))))||gN(LK(e_k(t.j,tnS))))&&xc(e_k(t.j,(eBy(),ti8)))!==xc((esn(),tsM))?r=gN(LK(e_k(t.j,tt2))):t.c.Tf(t.e,r),eAb(e,t,r,!0),gN(LK(e_k(t.j,tnS)))&&eo3(t.j,tnS,(OQ(),!1)),gN(LK(e_k(t.j,tt2)))&&(eo3(t.j,tt2,(OQ(),!1)),eo3(t.j,tnS,!0)),n=eSY(e,t);do{if(er0(e),0==n)return 0;r=!r,i=n,eAb(e,t,r,!1),n=eSY(e,t)}while(i>n)return i}function eNt(e,t,n){var r,i,a,o,s,u,c,l,f,d,h,p;if(t==n)return!0;if(t=eTE(e,t),n=eTE(e,n),!(r=eb1(t)))return(s=t.e)==(h=n.e);if((l=eb1(n))!=r)return!!l&&(u=r.Dj())==(p=l.Dj())&&null!=u;if(a=(o=(t.d||(t.d=new O_(tgr,t,1)),t.d)).i,d=(n.d||(n.d=new O_(tgr,n,1)),n.d),a==d.i){for(c=0;c0,s=efC(t,a),n?Ag(s.b,t):Ag(s.g,t),1==efv(s).c.length&&qQ(r,s,r.c.b,r.c),i=new kD(a,t),Vw(e.o,i),QA(e.e.a,a))}function eNs(e,t){var n,r,i,a,o,s,u;return r=eB4.Math.abs(FB(e.b).a-FB(t.b).a),s=eB4.Math.abs(FB(e.b).b-FB(t.b).b),i=0,u=0,n=1,o=1,r>e.b.b/2+t.b.b/2&&(n=1-(i=eB4.Math.min(eB4.Math.abs(e.b.c-(t.b.c+t.b.b)),eB4.Math.abs(e.b.c+e.b.b-t.b.c)))/r),s>e.b.a/2+t.b.a/2&&(o=1-(u=eB4.Math.min(eB4.Math.abs(e.b.d-(t.b.d+t.b.a)),eB4.Math.abs(e.b.d+e.b.a-t.b.d)))/s),(1-(a=eB4.Math.min(n,o)))*eB4.Math.sqrt(r*r+s*s)}function eNu(e){var t,n,r,i;for(eFX(e,e.e,e.f,(zo(),tuq),!0,e.c,e.i),eFX(e,e.e,e.f,tuq,!1,e.c,e.i),eFX(e,e.e,e.f,tuZ,!0,e.c,e.i),eFX(e,e.e,e.f,tuZ,!1,e.c,e.i),eNd(e,e.c,e.e,e.f,e.i),r=new KB(e.i,0);r.b=65;n--)tvJ[n]=n-65<<24>>24;for(r=122;r>=97;r--)tvJ[r]=r-97+26<<24>>24;for(i=57;i>=48;i--)tvJ[i]=i-48+52<<24>>24;for(a=0,tvJ[43]=62,tvJ[47]=63;a<=25;a++)tvQ[a]=65+a&eHd;for(o=26,u=0;o<=51;++o,u++)tvQ[o]=97+u&eHd;for(e=52,s=0;e<=61;++e,s++)tvQ[e]=48+s&eHd;tvQ[62]=43,tvQ[63]=47}function eNf(e,t){var n,r,i,a,o,s,u,c,l,f,d,h;if(e.dc())return new yb;for(c=0,f=0,i=e.Kc();i.Ob();)a=(r=Pp(i.Pb(),37)).f,c=eB4.Math.max(c,a.a),f+=a.a*a.b;for(c=eB4.Math.max(c,eB4.Math.sqrt(f)*gP(LV(e_k(Pp(e.Kc().Pb(),37),(eBy(),tiX))))),d=0,h=0,u=0,n=t,s=e.Kc();s.Ob();)d+(l=(o=Pp(s.Pb(),37)).f).a>c&&(d=0,h+=u+t,u=0),eIn(o,d,h),n=eB4.Math.max(n,d+l.a),u=eB4.Math.max(u,l.b),d+=l.a+t;return new kl(n+t,h+u+t)}function eNd(e,t,n,r,i){var a,o,s,u,c,l,f;for(o=new fz(t);o.aa)return eYu(),tby;break;case 4:case 3:if(u<0)return eYu(),tbw;if(u+e.f>i)return eYu(),tbj}return(o=(s+e.g/2)/a)+(n=(u+e.f/2)/i)<=1&&o-n<=0?(eYu(),tbY):o+n>=1&&o-n>=0?(eYu(),tby):n<.5?(eYu(),tbw):(eYu(),tbj)}function eNp(e,t,n,r,i){var a,o;if(a=eft(WM(t[0],eH9),WM(r[0],eH9)),e[0]=jE(a),a=Fv(a,32),n>=i){for(o=1;o0&&(i.b[o++]=0,i.b[o++]=a.b[0]-1),t=1;t0&&(l0(u,u.d-i.d),i.c==(Xa(),tuU)&&lQ(u,u.a-i.d),u.d<=0&&u.i>0&&qQ(t,u,t.c.b,t.c));for(a=new fz(e.f);a.a0&&(l2(s,s.i-i.d),i.c==(Xa(),tuU)&&l1(s,s.b-i.d),s.i<=0&&s.d>0&&qQ(n,s,n.c.b,n.c))}function eNv(e,t,n){var r,i,a,o,s,u,c,l;for(ewG(n,"Processor compute fanout",1),Yy(e.b),Yy(e.a),s=null,a=epL(t.b,0);!s&&a.b!=a.d.c;)gN(LK(e_k(c=Pp(Vv(a),86),(eR5(),tcm))))&&(s=c);for(qQ(u=new _n,s,u.c.b,u.c),eYc(e,u),l=epL(t.b,0);l.b!=l.d.c;)o=Lq(e_k(c=Pp(Vv(l),86),(eR5(),tca))),eo3(c,tci,ell(i=null!=zg(e.b,o)?Pp(zg(e.b,o),19).a:0)),eo3(c,tcn,ell(r=1+(null!=zg(e.a,o)?Pp(zg(e.a,o),19).a:0)));eEj(n)}function eNy(e,t,n,r,i){var a,o,s,u,c,l,f,d,h,p;for(u=0,d=eyG(e,n);u0),r.a.Xb(r.c=--r.b),f>d+u&&BH(r);for(o=new fz(h);o.a0),r.a.Xb(r.c=--r.b)}}function eNw(){var e,t,n,r,i,a;if(eBG(),tyg)return tyg;for(e=(++tyv,new WZ(4)),ePR(e,eYB(e1_,!0)),ej0(e,eYB("M",!0)),ej0(e,eYB("C",!0)),a=(++tyv,new WZ(4)),r=0;r<11;r++)eLw(a,r,r);return t=(++tyv,new WZ(4)),ePR(t,eYB("M",!0)),eLw(t,4448,4607),eLw(t,65438,65439),i=(++tyv,new Mr(2)),eRv(i,e),eRv(i,tye),(n=(++tyv,new Mr(2))).$l(jS(a,eYB("L",!0))),n.$l(t),n=(++tyv,new qa(3,n)),tyg=n=(++tyv,new YD(i,n))}function eN_(e){var t,n;if(t=Lq(eT9(e,(eBB(),tdQ))),!eae(t,e)&&!X2(e,th5)&&(0!=(e.a||(e.a=new FQ(e5k,e,10,11)),e.a).i||gN(LK(eT9(e,thh))))){if(null==t||0==e_H(t).length){if(!eae(eG1,e))throw eFh(e,n=xM(xM(new O0("Unable to load default layout algorithm "),eG1)," for unconfigured node ")),p7(new gq(n.a))}else throw eFh(e,n=xM(xM(new O0("Layout algorithm '"),t),"' not found for ")),p7(new gq(n.a))}}function eNE(e){var t,n,r,i,a,o,s,u,c,l,f,d,h;if(n=e.i,t=e.n,0==e.b)for(h=n.c+t.b,d=n.b-t.b-t.c,o=e.a,u=0,l=o.length;u0&&(f-=r[0]+e.c,r[0]+=e.c),r[2]>0&&(f-=r[2]+e.c),r[1]=eB4.Math.max(r[1],f),jQ(e.a[1],n.c+t.b+r[0]-(r[1]-f)/2,r[1]);for(a=e.a,s=0,c=a.length;s0?(e.n.c.length-1)*e.i:0,r=new fz(e.n);r.a1)for(r=epL(i,0);r.b!=r.d.c;)for(n=Pp(Vv(r),231),a=0,u=new fz(n.e);u.a0&&(t[0]+=e.c,f-=t[0]),t[2]>0&&(f-=t[2]+e.c),t[1]=eB4.Math.max(t[1],f),j1(e.a[1],r.d+n.d+t[0]-(t[1]-f)/2,t[1]);else for(p=r.d+n.d,h=r.a-n.d-n.a,o=e.a,u=0,l=o.length;u=0&&a!=n)throw p7(new gL(eXB));for(u=0,i=0;u=efT(e.b.c,i.b.c+i.b.b)&&0>=efT(i.b.c,e.b.c+e.b.b)&&0>=efT(e.b.d,i.b.d+i.b.a)&&0>=efT(i.b.d,e.b.d+e.b.a)){if(0==efT(i.b.c,e.b.c+e.b.b)&&r.a<0||0==efT(i.b.c+i.b.b,e.b.c)&&r.a>0||0==efT(i.b.d,e.b.d+e.b.a)&&r.b<0||0==efT(i.b.d+i.b.a,e.b.d)&&r.b>0){s=0;break}}else s=eB4.Math.min(s,ekg(e,i,r));s=eB4.Math.min(s,eNC(e,a,s,r))}return s}function eNI(e,t){var n,r,i,a,o,s,u;if(e.b<2)throw p7(new gL("The vector chain must contain at least a source and a target point."));for(Tj(t,(i=(A5(0!=e.b),Pp(e.a.a.c,8))).a,i.b),u=new AF((t.a||(t.a=new O_(e5h,t,5)),t.a)),o=epL(e,1);o.agP(Ot(o.g,o.d[0]).a)?(A5(u.b>0),u.a.Xb(u.c=--u.b),CD(u,o),i=!0):s.e&&s.e.gc()>0&&(a=(s.e||(s.e=new p0),s.e).Mc(t),c=(s.e||(s.e=new p0),s.e).Mc(n),(a||c)&&((s.e||(s.e=new p0),s.e).Fc(o),++o.c));i||(r.c[r.c.length]=o)}function eNH(e){var t,n,r;if(TM(Pp(e_k(e,(eBy(),tol)),98)))for(n=new fz(e.j);n.a>>0).toString(16),n.length-2,n.length):e>=eH3?"\\v"+Az(n="0"+(t=e>>>0).toString(16),n.length-6,n.length):""+String.fromCharCode(e&eHd)}return r}function eNz(e,t){var n,r,i,a,o,s,u,c,l,f;if(o=e.e,0==(u=t.e))return e;if(0==o)return 0==t.e?t:new F7(-t.e,t.d,t.a);if((a=e.d)+(s=t.d)==2)return n=WM(e.a[0],eH9),r=WM(t.a[0],eH9),o<0&&(n=QC(n)),u<0&&(r=QC(r)),ep_(efe(n,r));if(-1==(i=a!=s?a>s?1:-1:es9(e.a,t.a,a)))f=-u,l=o==u?Z1(t.a,s,e.a,a):X7(t.a,s,e.a,a);else if(f=o,o==u){if(0==i)return eLQ(),e09;l=Z1(e.a,a,t.a,s)}else l=X7(e.a,a,t.a,s);return c=new F7(f,l.length,l),Ku(c),c}function eNG(e){var t,n,r,i,a,o;for(this.e=new p0,this.a=new p0,n=e.b-1;n<3;n++)Ls(e,0,Pp(ep3(e,0),8));if(e.b<4)throw p7(new gL("At (least dimension + 1) control points are necessary!"));for(this.b=3,this.d=!0,this.c=!1,eMO(this,e.b+this.b-1),o=new p0,a=new fz(this.e),t=0;t=t.o&&n.f<=t.f||.5*t.a<=n.f&&1.5*t.a>=n.f){if((o=Pp(RJ(t.n,t.n.c.length-1),211)).e+o.d+n.g+i<=r&&((a=Pp(RJ(t.n,t.n.c.length-1),211)).f-e.f+n.f<=e.b||1==e.a.c.length))return efg(t,n),!0;if(t.s+n.g<=r&&(t.t+t.d+n.f+i<=e.b||1==e.a.c.length))return P_(t.b,n),s=Pp(RJ(t.n,t.n.c.length-1),211),P_(t.n,new zO(t.s,s.f+s.a+t.i,t.i)),eml(Pp(RJ(t.n,t.n.c.length-1),211),n),eNk(t,n),!0}return!1}function eNV(e,t,n){var r,i,a,o;return e.ej()?(i=null,a=e.fj(),r=e.Zi(1,o=ees(e,t,n),n,t,a),e.bj()&&!(e.ni()&&null!=o?ecX(o,n):xc(o)===xc(n))?(null!=o&&(i=e.dj(o,i)),i=e.cj(n,i),e.ij()&&(i=e.lj(o,n,i)),i?(i.Ei(r),i.Fi()):e.$i(r)):(e.ij()&&(i=e.lj(o,n,i)),i?(i.Ei(r),i.Fi()):e.$i(r)),o):(o=ees(e,t,n),e.bj()&&!(e.ni()&&null!=o?ecX(o,n):xc(o)===xc(n))&&(i=null,null!=o&&(i=e.dj(o,null)),(i=e.cj(n,i))&&i.Fi()),o)}function eNq(e,t){var n,r,i,a,o,s,u,c;t%=24,e.q.getHours()!=t&&((r=new eB4.Date(e.q.getTime())).setDate(r.getDate()+1),(s=e.q.getTimezoneOffset()-r.getTimezoneOffset())>0&&(u=s/60|0,c=s%60,i=e.q.getDate(),(n=e.q.getHours())+u>=24&&++i,a=new eB4.Date(e.q.getFullYear(),e.q.getMonth(),i,t+u,e.q.getMinutes()+c,e.q.getSeconds(),e.q.getMilliseconds()),e.q.setTime(a.getTime()))),o=e.q.getTime(),e.q.setTime(o+36e5),e.q.getHours()!=t&&e.q.setTime(o)}function eNZ(e,t){var n,r,i,a,o;if(ewG(t,"Path-Like Graph Wrapping",1),0==e.b.c.length||(n=(o=(null==(i=new eTN(e)).i&&(i.i=eis(i,new iP)),gP(i.i)*i.f))/(null==i.i&&(i.i=eis(i,new iP)),gP(i.i)),i.b>n)){eEj(t);return}switch(Pp(e_k(e,(eBy(),toq)),337).g){case 2:a=new iF;break;case 0:a=new iO;break;default:a=new iY}if(r=a.Vf(e,i),!a.Wf())switch(Pp(e_k(e,to0),338).g){case 2:r=ekE(i,r);break;case 1:r=ewQ(i,r)}eRw(e,i,r),eEj(t)}function eNX(e,t){var n,r,i,a;if(GW(e.d,e.e),e.c.a.$b(),0!=gP(LV(e_k(t.j,(eBy(),ti3))))||0!=gP(LV(e_k(t.j,ti3))))for(n=ezq,xc(e_k(t.j,ti8))!==xc((esn(),tsM))&&eo3(t.j,(eBU(),tt2),(OQ(),!0)),a=Pp(e_k(t.j,to$),19).a,i=0;i(i=(GK(s+1,t.c.length),Pp(t.c[s+1],19)).a-r)&&++c,P_(o,(GK(s+c,t.c.length),Pp(t.c[s+c],19))),u+=(GK(s+c,t.c.length),Pp(t.c[s+c],19)).a-r,++n;n1&&(u>jl(s)*jc(s)/2||0==o.b)&&(f=new etD(d),l=jl(s)/jc(s),c=eY8(f,t,new mp,n,r,i,l),C6(xB(f.e),c),s=f,h.c[h.c.length]=f,u=0,d.c=Je(e1R,eUp,1,0,5,1)));return eoc(h,d),h}function eN2(e,t,n,r){var i,a,o,s,u,c,l,f,d,h,p,b;if(n.mh(t)&&(l=(h=t)?Pp(r,49).xh(h):null)){if(b=n.bh(t,e.a),(p=t.t)>1||-1==p){if(f=Pp(b,69),d=Pp(l,69),f.dc())d.$b();else for(o=!!ebY(t),a=0,s=e.a?f.Kc():f.Zh();s.Ob();)c=Pp(s.Pb(),56),(i=Pp(eef(e,c),56))?(o?-1==(u=d.Xc(i))?d.Xh(a,i):a!=u&&d.ji(a,i):d.Xh(a,i),++a):e.b&&!o&&(d.Xh(a,c),++a)}else null==b?l.Wb(null):null==(i=eef(e,b))?e.b&&!ebY(t)&&l.Wb(b):l.Wb(i)}}function eN3(e,t){var n,r,i,a,o,s,u,l;for(n=new nf,i=new Fa(OH(efu(t).a.Kc(),new c));eTk(i);)if(r=Pp(ZC(i),17),!q9(r)&&ewg(s=r.c.i,e9q)){if(-1==(l=eCu(e,s,e9q,e9V)))continue;n.b=eB4.Math.max(n.b,l),n.a||(n.a=new p0),P_(n.a,s)}for(o=new Fa(OH(efc(t).a.Kc(),new c));eTk(o);)if(a=Pp(ZC(o),17),!q9(a)&&ewg(u=a.d.i,e9V)){if(-1==(l=eCu(e,u,e9V,e9q)))continue;n.d=eB4.Math.max(n.d,l),n.c||(n.c=new p0),P_(n.c,u)}return n}function eN4(e){var t,n,r,i;if(exX(),t=zy(e),e1e6)throw p7(new g_("power of ten too big"));if(e<=eUu)return ZA(exT(e2t[1],t),t);for(i=r=exT(e2t[1],eUu),n=eap(e-eUu),t=zy(e%eUu);ecd(n,eUu)>0;)i=eeD(i,r),n=efe(n,eUu);for(i=eeD(i,exT(e2t[1],t)),i=ZA(i,eUu),n=eap(e-eUu);ecd(n,eUu)>0;)i=ZA(i,eUu),n=efe(n,eUu);return ZA(i,t)}function eN6(e,t){var n,r,i,a,o,s,u,c,l;for(ewG(t,"Hierarchical port dummy size processing",1),u=new p0,l=new p0,n=2*(r=gP(LV(e_k(e,(eBy(),toA))))),a=new fz(e.b);a.ac&&r>c)l=s,c=gP(t.p[s.p])+gP(t.d[s.p])+s.o.b+s.d.a;else{i=!1,n.n&&P3(n,"bk node placement breaks on "+s+" which should have been after "+l);break}if(!i)break}return n.n&&P3(n,t+" is feasible: "+i),i}function ePr(e,t,n,r){var i,a,o,s,u,c,l;for(s=-1,l=new fz(e);l.a=m&&e.e[u.p]>p*e.b||y>=n*m)&&(d.c[d.c.length]=s,s=new p0,er7(o,a),a.a.$b(),c-=l,h=eB4.Math.max(h,c*e.b+b),c+=y,v=y,y=0,l=0,b=0);return new kD(h,d)}function ePs(e){var t,n,r,i,a,o,s,u,c,l,f,d,h;for(n=(c=new fT(e.c.b).a.vc().Kc(),new fN(c));n.a.Ob();)null==(i=(t=(s=Pp(n.a.Pb(),42),Pp(s.dd(),149))).a)&&(i=""),(r=L9(e.c,i))||0!=i.length||(r=ecj(e)),r&&!eds(r.c,t,!1)&&P7(r.c,t);for(o=epL(e.a,0);o.b!=o.d.c;)a=Pp(Vv(o),478),l=Zc(e.c,a.a),h=Zc(e.c,a.b),l&&h&&P7(l.c,new kD(h,a.c));for(HC(e.a),d=epL(e.b,0);d.b!=d.d.c;)f=Pp(Vv(d),478),t=L8(e.c,f.a),u=Zc(e.c,f.b),t&&u&&_U(t,u,f.c);HC(e.b)}function ePu(e,t,n){var r,i,a,o,s,u,c,l,f,d,h;a=new lD(e),o=new eg5,i=(Ze(o.g),Ze(o.j),Yy(o.b),Ze(o.d),Ze(o.i),Yy(o.k),Yy(o.c),Yy(o.e),h=ekH(o,a,null),eMA(o,a),h),t&&(s=ePA(c=new lD(t)),eEh(i,eow(vx(e6q,1),eUp,527,0,[s]))),d=!1,f=!1,n&&(eXW in(c=new lD(n)).a&&(d=zR(c,eXW).ge().a),eXK in c.a&&(f=zR(c,eXK).ge().a)),l=yr(eny(new mV,d),f),eER(new or,i,l),eXW in a.a&&ee3(a,eXW,null),(d||f)&&(eNj(l,u=new gu,d,f),ee3(a,eXW,u)),r=new pp(o),esA(new TY(i),r)}function ePc(e,t,n){var r,i,a,o,s,u,c,l,f;for(u=0,o=new evI,c=eow(vx(ty_,1),eHT,25,15,[0]),i=-1,a=0,r=0;u0){if(i<0&&l.a&&(i=u,a=c[0],r=0),i>=0){if(s=l.b,u==i&&0==(s-=r++))return 0;if(!eYw(t,c,l,s,o)){u=i-1,c[0]=a;continue}}else if(i=-1,!eYw(t,c,l,0,o))return 0}else{if(i=-1,32==UI(l.c,0)){if(f=c[0],eey(t,c),c[0]>f)continue}else if($D(t,l.c,c[0])){c[0]+=l.c.length;continue}return 0}return eYn(o,n)?c[0]:0}function ePl(e){var t,n,r,i,a,o,s,u;if(!e.f){if(u=new su,s=new su,null==(o=(t=tgz).a.zc(e,t))){for(a=new Ow($E(e));a.e!=a.i.gc();)i=Pp(epH(a),26),Y4(u,ePl(i));t.a.Bc(e),t.a.gc()}for(r=(e.s||(e.s=new FQ(tm5,e,21,17)),new Ow(e.s));r.e!=r.i.gc();)n=Pp(epH(r),170),M4(n,99)&&JL(s,Pp(n,18));euI(s),e.r=new PX(e,(Pp(etj(H8((BM(),tgv).o),6),18),s.i),s.g),Y4(u,e.r),euI(u),e.f=new xQ((Pp(etj(H8(tgv.o),5),18),u.i),u.g),Zd(e).b&=-3}return e.f}function ePf(e){var t,n,r,i,a,o,s,u,c,l,f,d,h,p;for(c=0,r=Je(ty_,eHT,25,o=e.o,15,1),i=Je(ty_,eHT,25,o,15,1),t=Je(ty_,eHT,25,n=e.p,15,1),a=Je(ty_,eHT,25,n,15,1);c=0&&!emy(e,l,f);)--f;i[l]=f}for(h=0;h=0&&!emy(e,s,p);)--s;a[p]=s}for(u=0;ut[d]&&dr[u]&&eCQ(e,u,d,!1,!0)}function ePd(e){var t,n,r,i,a,o,s,u;n=gN(LK(e_k(e,(eCk(),e8b)))),a=e.a.c.d,s=e.a.d.d,n?(o=Ol(C5(new kl(s.a,s.b),a),.5),u=Ol(MB(e.e),.5),t=C5(C6(new kl(a.a,a.b),o),u),Lf(e.d,t)):(i=gP(LV(e_k(e.a,e8I))),r=e.d,a.a>=s.a?a.b>=s.b?(r.a=s.a+(a.a-s.a)/2+i,r.b=s.b+(a.b-s.b)/2-i-e.e.b):(r.a=s.a+(a.a-s.a)/2+i,r.b=a.b+(s.b-a.b)/2+i):a.b>=s.b?(r.a=a.a+(s.a-a.a)/2+i,r.b=s.b+(a.b-s.b)/2+i):(r.a=a.a+(s.a-a.a)/2+i,r.b=a.b+(s.b-a.b)/2-i-e.e.b))}function ePh(e,t){var n,r,i,a,o,s,u;if(null==e)return null;if(0==(a=e.length))return"";for(u=Je(tyw,eHl,25,a,15,1),Ji(0,a,e.length),Ji(0,a,u.length),YF(e,0,a,u,0),n=null,s=t,i=0,o=0;i0?Az(n.a,0,a-1):"":e.substr(0,a-1):n?n.a:e}function ePp(e){_Y(e,new ewB(vQ(vq(vJ(vX(new oc,ezH),"ELK DisCo"),"Layouter for arranging unconnected subgraphs. The subgraphs themselves are, by default, not laid out."),new e4))),KE(e,ezH,ez$,epB(e57)),KE(e,ezH,ezz,epB(e53)),KE(e,ezH,ezG,epB(e5J)),KE(e,ezH,ezW,epB(e54)),KE(e,ezH,e$Q,epB(e58)),KE(e,ezH,e$1,epB(e55)),KE(e,ezH,e$J,epB(e59)),KE(e,ezH,e$0,epB(e56)),KE(e,ezH,ezj,epB(e51)),KE(e,ezH,ezF,epB(e5Q)),KE(e,ezH,ezY,epB(e50)),KE(e,ezH,ezB,epB(e52))}function ePb(e,t,n,r){var i,a,o,s,u,c,l,f,d;if(a=new eb$(e),lK(a,(eEn(),e9P)),eo3(a,(eBy(),tol),(ewf(),tbo)),i=0,t){for(o=new eES,eo3(o,(eBU(),tnc),t),eo3(a,tnc,t.i),ekv(o,(eYu(),tbY)),Gc(o,a),d=Kp(t.e),l=0,f=(c=d).length;lenR(e)?1:0,n=e.e,i=(r.length,eB4.Math.abs(zy(e.e)),new vl),1==t&&(i.a+="-"),e.e>0){if((n-=r.length-t)>=0){for(i.a+="0.";n>e0Z.length;n-=e0Z.length)RX(i,e0Z);CA(i,e0Z,zy(n)),xM(i,r.substr(t))}else n=t-n,xM(i,Az(r,t,zy(n))),i.a+=".",xM(i,xy(r,zy(n)))}else{for(xM(i,r.substr(t));n<-e0Z.length;n+=e0Z.length)RX(i,e0Z);CA(i,e0Z,zy(-n))}return i.a}function ePv(e,t,n,r){var i,a,o,s,u,c,l,f,d;return(c=(u=C5(new kl(n.a,n.b),e)).a*t.b-u.b*t.a,l=t.a*r.b-t.b*r.a,f=(u.a*r.b-u.b*r.a)/l,d=c/l,0!=l)?f>=0&&f<=1&&d>=0&&d<=1?C6(new kl(e.a,e.b),Ol(new kl(t.a,t.b),f)):null:0!=c?null:(a=Jh(e,i=C6(new kl(n.a,n.b),Ol(new kl(r.a,r.b),.5))),o=Jh(C6(new kl(e.a,e.b),t),i),s=.5*eB4.Math.sqrt(r.a*r.a+r.b*r.b),at.a&&(r.Hc((eyY(),tdW))?e.c.a+=(n.a-t.a)/2:r.Hc(tdV)&&(e.c.a+=n.a-t.a)),n.b>t.b&&(r.Hc((eyY(),tdZ))?e.c.b+=(n.b-t.b)/2:r.Hc(tdq)&&(e.c.b+=n.b-t.b)),Pp(e_k(e,(eBU(),tt3)),21).Hc((eLR(),ttw))&&(n.a>t.a||n.b>t.b))for(s=new fz(e.a);s.at.a&&(r.Hc((eyY(),tdW))?e.c.a+=(n.a-t.a)/2:r.Hc(tdV)&&(e.c.a+=n.a-t.a)),n.b>t.b&&(r.Hc((eyY(),tdZ))?e.c.b+=(n.b-t.b)/2:r.Hc(tdq)&&(e.c.b+=n.b-t.b)),Pp(e_k(e,(eBU(),tt3)),21).Hc((eLR(),ttw))&&(n.a>t.a||n.b>t.b))for(o=new fz(e.a);o.at&&(i=0,a+=l.b+n,f.c[f.c.length]=l,l=new W5(a,n),r=new es$(0,l.f,l,n),enN(l,r),i=0),0==r.b.c.length||u.f>=r.o&&u.f<=r.f||.5*r.a<=u.f&&1.5*r.a>=u.f?efg(r,u):(o=new es$(r.s+r.r+n,l.f,l,n),enN(l,o),efg(o,u)),i=u.i+u.g;return f.c[f.c.length]=l,f}function ePk(e){var t,n,r,i,a,o,s,u;if(!e.a){if(e.o=null,u=new pj(e),t=new sc,null==(s=(n=tgz).a.zc(e,n))){for(o=new Ow($E(e));o.e!=o.i.gc();)a=Pp(epH(o),26),Y4(u,ePk(a));n.a.Bc(e),n.a.gc()}for(i=(e.s||(e.s=new FQ(tm5,e,21,17)),new Ow(e.s));i.e!=i.i.gc();)r=Pp(epH(i),170),M4(r,322)&&JL(t,Pp(r,34));euI(t),e.k=new PZ(e,(Pp(etj(H8((BM(),tgv).o),7),18),t.i),t.g),Y4(u,e.k),euI(u),e.a=new xQ((Pp(etj(H8(tgv.o),4),18),u.i),u.g),Zd(e).b&=-2}return e.a}function ePx(e,t,n,r,i,a,o){var s,u,c,l,f,d;return f=!1,u=eO4(n.q,t.f+t.b-n.q.f),!((d=i-(n.q.e+u-o))=(GK(a,e.c.length),Pp(e.c[a],200)).e,(!((l=(s=ePI(r,d,!1)).a)>t.b)||!!c)&&((c||l<=t.b)&&(c&&l>t.b?(n.d=l,JR(n,eEP(n,l))):(eyC(n.q,u),n.c=!0),JR(r,i-(n.s+n.r)),ebP(r,n.q.e+n.q.d,t.f),enN(t,r),e.c.length>a&&(eva((GK(a,e.c.length),Pp(e.c[a],200)),r),0==(GK(a,e.c.length),Pp(e.c[a],200)).a.c.length&&ZV(e,a)),f=!0),f))}function ePT(e,t,n,r){var i,a,o,s,u,c,l;if(l=eAY(e.e.Tg(),t),i=0,a=Pp(e.g,119),u=null,_4(),Pp(t,66).Oj()){for(s=0;se.o.a&&(l=(u-e.o.a)/2,s.b=eB4.Math.max(s.b,l),s.c=eB4.Math.max(s.c,l))}}function ePA(e){var t,n,r,i,a,o,s,u;for(a=new W9,Tp(a,(eoM(),tdr)),r=(i=erG(e,Je(e17,eUP,2,0,6,1)),new fE(new g$(new wY(e,i).b)));r.b0?e.i:0)>t&&u>0&&(a=0,o+=u+e.i,i=eB4.Math.max(i,d),r+=u+e.i,u=0,d=0,n&&(++f,P_(e.n,new zO(e.s,o,e.i))),s=0),d+=c.g+(s>0?e.i:0),u=eB4.Math.max(u,c.f),n&&eml(Pp(RJ(e.n,f),211),c),a+=c.g+(s>0?e.i:0),++s;return i=eB4.Math.max(i,d),r+=u,n&&(e.r=i,e.d=r,egf(e.j)),new Hr(e.s,e.t,i,r)}function ePD(e,t,n,r,i){var a,o,s,u,c,l,f,d,h;if(wK(),Yh(e,"src"),Yh(n,"dest"),d=esF(e),u=esF(n),Pz((4&d.i)!=0,"srcType is not an array"),Pz((4&u.i)!=0,"destType is not an array"),f=d.c,o=u.c,Pz((1&f.i)!=0?f==o:(1&o.i)==0,"Array types don't match"),h=e.length,c=n.length,t<0||r<0||i<0||t+i>h||r+i>c)throw p7(new bE);if((1&f.i)==0&&d!=u){if(l=etG(e),a=etG(n),xc(e)===xc(n)&&tr;)Bc(a,s,l[--t]);else for(s=r+i;r0&&ekp(e,t,n,r,i,!0)}function ePN(){ePN=A,e07=eow(vx(ty_,1),eHT,25,15,[eHt,1162261467,eU2,1220703125,362797056,1977326743,eU2,387420489,eHK,214358881,429981696,815730721,1475789056,170859375,268435456,410338673,612220032,893871739,128e7,1801088541,113379904,148035889,191102976,244140625,308915776,387420489,481890304,594823321,729e6,887503681,eU2,1291467969,1544804416,1838265625,60466176]),e2e=eow(vx(ty_,1),eHT,25,15,[-1,-1,31,19,15,13,11,11,10,9,9,8,8,8,8,7,7,7,7,7,7,7,6,6,6,6,6,6,6,6,6,6,6,6,6,6,5])}function ePP(e){var t,n,r,i,a,o,s,u;for(i=new fz(e.b);i.a=e.b.length?(a[i++]=o.b[r++],a[i++]=o.b[r++]):r>=o.b.length?(a[i++]=e.b[n++],a[i++]=e.b[n++]):o.b[r]0?e.i:0)),++t;for(efX(e.n,u),e.d=n,e.r=r,e.g=0,e.f=0,e.e=0,e.o=eHQ,e.p=eHQ,a=new fz(e.b);a.a0&&(i=(e.n||(e.n=new FQ(e5S,e,1,7)),Pp(etj(e.n,0),137)).a)&&xM(xM((t.a+=' "',t),i),'"')),(n=(e.b||(e.b=new Ih(e5m,e,4,7)),!(e.b.i<=1&&(e.c||(e.c=new Ih(e5m,e,5,8)),e.c.i<=1))))?(t.a+=" [",t):(t.a+=" ",t),xM(t,OU(new ve,new Ow(e.b))),n&&(t.a+="]"),t.a+=eGH,n&&(t.a+="["),xM(t,OU(new ve,new Ow(e.c))),n&&(t.a+="]"),t.a)}function ePB(e,t){var n,r,i,a,o,s,u;if(e.a){if(s=e.a.ne(),u=null,null!=s?t.a+=""+s:null!=(o=e.a.Dj())&&(-1!=(a=x7(o,e_n(91)))?(u=o.substr(a),t.a+=""+Az(null==o?eUg:(BJ(o),o),0,a)):t.a+=""+o),e.d&&0!=e.d.i){for(i=!0,t.a+="<",r=new Ow(e.d);r.e!=r.i.gc();)n=Pp(epH(r),87),i?i=!1:(t.a+=eUd,t),ePB(n,t);t.a+=">"}null!=u&&(t.a+=""+u)}else e.e?null!=(s=e.e.zb)&&(t.a+=""+s):(t.a+="?",e.b?(t.a+=" super ",ePB(e.b,t)):e.f&&(t.a+=" extends ",ePB(e.f,t)))}function ePU(e,t){var n,r,i,a,o,s,u,c,l,f,d,h,p,b,m,g,v,y,w,_,E,S,k,x,T;for(_=e.c,E=t.c,n=QI(_.a,e,0),r=QI(E.a,t,0),y=Pp(edE(e,(enY(),tsD)).Kc().Pb(),11),x=Pp(edE(e,tsN).Kc().Pb(),11),w=Pp(edE(t,tsD).Kc().Pb(),11),T=Pp(edE(t,tsN).Kc().Pb(),11),g=Kp(y.e),S=Kp(x.g),v=Kp(w.e),k=Kp(T.g),egU(e,r,E),l=0,p=(o=v).length;ll?new GT((Xa(),tuH),n,t,c-l):c>0&&l>0&&(new GT((Xa(),tuH),t,n,0),new GT(tuH,n,t,0))),o)}function ePz(e,t){var n,r,i,a,o,s;for(o=new esz(new fS(e.f.b).a);o.b;){if(a=etz(o),i=Pp(a.cd(),594),1==t){if(i.gf()!=(ec3(),tpy)&&i.gf()!=tpb)continue}else if(i.gf()!=(ec3(),tpm)&&i.gf()!=tpg)continue;switch(r=Pp(Pp(a.dd(),46).b,81),n=(s=Pp(Pp(a.dd(),46).a,189)).c,i.gf().g){case 2:r.g.c=e.e.a,r.g.b=eB4.Math.max(1,r.g.b+n);break;case 1:r.g.c=r.g.c+n,r.g.b=eB4.Math.max(1,r.g.b-n);break;case 4:r.g.d=e.e.b,r.g.a=eB4.Math.max(1,r.g.a+n);break;case 3:r.g.d=r.g.d+n,r.g.a=eB4.Math.max(1,r.g.a-n)}}}function ePG(e,t){var n,r,i,a,o,s,u,c,l,f,d,h,p,b;for(s=Je(ty_,eHT,25,t.b.c.length,15,1),c=Je(e4P,eU4,267,t.b.c.length,0,1),u=Je(e4N,eGW,10,t.b.c.length,0,1),f=e.a,d=0,h=f.length;d0&&u[r]&&(p=Mj(e.b,u[r],i)),b=eB4.Math.max(b,i.c.c.b+p);for(a=new fz(l.e);a.a1)throw p7(new gL(eQ$));u||(a=V4(t,r.Kc().Pb()),o.Fc(a))}return eo0(e,eSu(e,t,n),o)}function ePZ(e,t){var n,r,i,a;for(etY(t.b.j),_r(UQ(new R1(null,new Gq(t.d,16)),new iy),new iw),a=new fz(t.d);a.ae.o.b||(n=efr(e,tby),(s=t.d+t.a+(n.gc()-1)*o)>e.o.b)))}function eP6(e,t){var n,r,i,a,o,s,u,c,l,f,d,h,p;if(o=e.e,u=t.e,0==o)return t;if(0==u)return e;if((a=e.d)+(s=t.d)==2)return(n=WM(e.a[0],eH9),r=WM(t.a[0],eH9),o==u)?(p=jE(l=eft(n,r)),0==(h=jE(Fy(l,32)))?new XE(o,p):new F7(o,2,eow(vx(ty_,1),eHT,25,15,[p,h]))):ep_(o<0?efe(r,n):efe(n,r));if(o==u)d=o,f=a>=s?X7(e.a,a,t.a,s):X7(t.a,s,e.a,a);else{if(0==(i=a!=s?a>s?1:-1:es9(e.a,t.a,a)))return eLQ(),e09;1==i?(d=o,f=Z1(e.a,a,t.a,s)):(d=u,f=Z1(t.a,s,e.a,a))}return c=new F7(d,f.length,f),Ku(c),c}function eP5(e,t,n,r,i,a,o){var s,u,c,l,f,d,h;return f=gN(LK(e_k(t,(eBy(),taV)))),d=null,a==(enY(),tsD)&&r.c.i==n?d=r.c:a==tsN&&r.d.i==n&&(d=r.d),(c=o)&&f&&!d?(P_(c.e,r),h=eB4.Math.max(gP(LV(e_k(c.d,tak))),gP(LV(e_k(r,tak)))),eo3(c.d,tak,h)):(l=(eYu(),tbF),d?l=d.j:TM(Pp(e_k(n,tol),98))&&(l=a==tsD?tbY:tby),u=eP9(e,t,n,a,l,r),s=ZD((Bq(n),r)),a==tsD?(Gs(s,Pp(RJ(u.j,0),11)),Go(s,i)):(Gs(s,i),Go(s,Pp(RJ(u.j,0),11))),c=new ec9(r,s,u,Pp(e_k(u,(eBU(),tnc)),11),a,!d)),exg(e.a,r,new DT(c.d,t,a)),c}function eP8(e,t){var n,r,i,a,o,s,u,c,l,f;if(l=null,e.d&&(l=Pp(zg(e.d,t),138)),!l){if(f=(a=e.a.Mh()).i,!e.d||wq(e.d)!=f){for(u=new p2,e.d&&eij(u,e.d),s=c=u.f.c+u.g.c;s0?(h=(p-1)*n,s&&(h+=r),l&&(h+=r),!(h=e.b[i+1])i+=2;else if(n0)for(r=new I4(Pp(Zq(e.a,a),21)),Hj(),Mv(r,new dT(t)),i=new KB(a.b,0);i.b_)?(u=2,o=eUu):0==u?(u=1,o=S):(u=0,o=S):(h=S>=o||o-S0?1:Te(isNaN(r),isNaN(0)))>=0^(enj(eVU),(eB4.Math.abs(s)<=eVU||0==s||isNaN(s)&&isNaN(0)?0:s<0?-1:s>0?1:Te(isNaN(s),isNaN(0)))>=0))?eB4.Math.max(s,r):(enj(eVU),(eB4.Math.abs(r)<=eVU||0==r||isNaN(r)&&isNaN(0)?0:r<0?-1:r>0?1:Te(isNaN(r),isNaN(0)))>0)?eB4.Math.sqrt(s*s+r*r):-eB4.Math.sqrt(s*s+r*r)}function eRv(e,t){var n,r,i,a,o,s;if(t){if(e.a||(e.a=new bZ),2==e.e){bY(e.a,t);return}if(1==t.e){for(i=0;i=eH3?xk(n,el1(r)):Bf(n,r&eHd),o=(++tyv,new zc(10,null,0)),Yu(e.a,o,s-1)):xk(n=(o.bm().length,new vu),o.bm()),0==t.e?(r=t._l())>=eH3?xk(n,el1(r)):Bf(n,r&eHd):xk(n,t.bm()),Pp(o,521).b=n.a}}function eRy(e){var t,n,r,i,a;return null!=e.g?e.g:e.a<32?(e.g=eYS(eap(e.f),zy(e.e)),e.g):(i=eBw((e.c||(e.c=euK(e.f)),e.c),0),0==e.e)?i:(t=(e.c||(e.c=euK(e.f)),e.c).e<0?2:1,n=i.length,r=-e.e+n-t,a=new vc,a.a+=""+i,e.e>0&&r>=-6?r>=0?Gn(a,n-zy(e.e),"."):(a.a=Az(a.a,0,t-1)+"0."+xy(a.a,t-1),Gn(a,t+1,ehv(e0Z,0,-zy(r)-1))):(n-t>=1&&(Gn(a,t,"."),++n),Gn(a,n,"E"),r>0&&Gn(a,++n,"+"),Gn(a,++n,""+Fb(eap(r)))),e.g=a.a,e.g)}function eRw(e,t,n){var r,i,a,o,s,u,c,l,f,d,h,p,b,m;if(!n.dc()){for(s=0,d=0,p=Pp((r=n.Kc()).Pb(),19).a;s1&&(u=c.mg(u,e.a,s));return 1==u.c.length?Pp(RJ(u,u.c.length-1),220):2==u.c.length?eRr((GK(0,u.c.length),Pp(u.c[0],220)),(GK(1,u.c.length),Pp(u.c[1],220)),o,a):null}function eRk(e){var t,n,r,i,a,o;for(ety(e.a,new eJ),n=new fz(e.a);n.a=eB4.Math.abs(r.b)?(r.b=0,a.d+a.a>o.d&&a.do.c&&a.c0){if(t=new xt(e.i,e.g),a=(n=e.i)<100?null:new yf(n),e.ij())for(r=0;r0){for(s=e.g,c=e.i,ZG(e),a=c<100?null:new yf(c),r=0;r>13|(15&e.m)<<9,i=e.m>>4&8191,a=e.m>>17|(255&e.h)<<5,o=(1048320&e.h)>>8,s=8191&t.l,u=t.l>>13|(15&t.m)<<9,c=t.m>>4&8191,l=t.m>>17|(255&t.h)<<5,f=(1048320&t.h)>>8,k=n*s,x=r*s,T=i*s,M=a*s,O=o*s,0!=u&&(x+=n*u,T+=r*u,M+=i*u,O+=a*u),0!=c&&(T+=n*c,M+=r*c,O+=i*c),0!=l&&(M+=n*l,O+=r*l),0!=f&&(O+=n*f),d=(h=k&eHH)+(p=(511&x)<<13),m=k>>22,g=x>>9,b=m+g+(v=(262143&T)<<4)+(y=(31&M)<<17),_=T>>18,w=_+(E=M>>5)+(S=(4095&O)<<8),b+=d>>22,d&=eHH,w+=b>>22,Mk(d,b&=eHH,w&=eH$)}function eRA(e){var t,n,r,i,a,o,s;if(0!=(s=Pp(RJ(e.j,0),11)).g.c.length&&0!=s.e.c.length)throw p7(new gC("Interactive layout does not support NORTH/SOUTH ports with incoming _and_ outgoing edges."));if(0!=s.g.c.length){for(a=eHQ,n=new fz(s.g);n.a4){if(!e.wj(t))return!1;if(e.rk()){if(u=(r=(i=Pp(t,49)).Ug())==e.e&&(e.Dk()?i.Og(i.Vg(),e.zk())==e.Ak():-1-i.Vg()==e.aj()),e.Ek()&&!u&&!r&&i.Zg()){for(a=0;a0&&(c=e.n.a/a);break;case 2:case 4:(i=e.i.o.b)>0&&(c=e.n.b/i)}eo3(e,(eBU(),tnv),c)}if(u=e.o,o=e.a,r)o.a=r.a,o.b=r.b,e.d=!0;else if(t!=tbc&&t!=tbl&&s!=tbF)switch(s.g){case 1:o.a=u.a/2;break;case 2:o.a=u.a,o.b=u.b/2;break;case 3:o.a=u.a/2,o.b=u.b;break;case 4:o.b=u.b/2}else o.a=u.a/2,o.b=u.b/2}function eRP(e){var t,n,r,i,a,o,s,u,c,l;if(e.ej()){if(l=e.Vi(),u=e.fj(),l>0){if(t=new eiP(e.Gi()),a=(n=l)<100?null:new yf(n),Cf(e,n,t.g),i=1==n?e.Zi(4,etj(t,0),null,0,u):e.Zi(6,t,null,-1,u),e.bj()){for(r=new Ow(t);r.e!=r.i.gc();)a=e.dj(epH(r),a);a?(a.Ei(i),a.Fi()):e.$i(i)}else a?(a.Ei(i),a.Fi()):e.$i(i)}else Cf(e,e.Vi(),e.Wi()),e.$i(e.Zi(6,(Hj(),e2r),null,-1,u))}else if(e.bj()){if((l=e.Vi())>0){for(s=e.Wi(),c=l,Cf(e,l,s),a=c<100?null:new yf(c),r=0;re.d[o.p]&&(n+=qq(e.b,a)*Pp(u.b,19).a,Vw(e.a,ell(a)));for(;!gY(e.a);)eek(e.b,Pp(Yn(e.a),19).a)}return n}function eRF(e,t,n,r){var i,a,o,s,u,c,l,f,d,h,p,b,m;for((f=new TS(Pp(eT9(e,(e_C(),tdB)),8))).a=eB4.Math.max(f.a-n.b-n.c,0),f.b=eB4.Math.max(f.b-n.d-n.a,0),(null==(i=LV(eT9(e,tdN)))||(BJ(i),i<=0))&&(i=1.3),s=new p0,p=new Ow((e.a||(e.a=new FQ(e5k,e,10,11)),e.a));p.e!=p.i.gc();)h=Pp(epH(p),33),o=new Lp(h),s.c[s.c.length]=o;switch((d=Pp(eT9(e,tdP),311)).g){case 3:m=eDQ(s,t,f.a,f.b,(c=r,BJ(i),c));break;case 1:m=eN0(s,t,f.a,f.b,(l=r,BJ(i),l));break;default:m=eRH(s,t,f.a,f.b,(u=r,BJ(i),u))}a=new etD(m),b=eY8(a,t,n,f.a,f.b,r,(BJ(i),i)),eYx(e,b.a,b.b,!1,!0)}function eRY(e,t){var n,r,i,a;n=t.b,a=new I4(n.j),i=0,(r=n.j).c=Je(e1R,eUp,1,0,5,1),Y$(Pp(eay(e.b,(eYu(),tbw),(erX(),tep)),15),n),i=emQ(a,i,new r3,r),Y$(Pp(eay(e.b,tbw,teh),15),n),i=emQ(a,i,new r2,r),Y$(Pp(eay(e.b,tbw,ted),15),n),Y$(Pp(eay(e.b,tby,tep),15),n),Y$(Pp(eay(e.b,tby,teh),15),n),i=emQ(a,i,new r4,r),Y$(Pp(eay(e.b,tby,ted),15),n),Y$(Pp(eay(e.b,tbj,tep),15),n),i=emQ(a,i,new r6,r),Y$(Pp(eay(e.b,tbj,teh),15),n),i=emQ(a,i,new r5,r),Y$(Pp(eay(e.b,tbj,ted),15),n),Y$(Pp(eay(e.b,tbY,tep),15),n),i=emQ(a,i,new ic,r),Y$(Pp(eay(e.b,tbY,teh),15),n),Y$(Pp(eay(e.b,tbY,ted),15),n)}function eRB(e,t){var n,r,i,a,o,s,u,c,l,f,d,h,p,b;for(ewG(t,"Layer size calculation",1),l=eHQ,c=eH1,i=!1,s=new fz(e.b);s.a.5?g-=2*o*(p-.5):p<.5&&(g+=2*a*(.5-p)),g<(i=s.d.b)&&(g=i),b=s.d.c,g>m.a-b-l&&(g=m.a-b-l),s.n.a=t+g}}function eRH(e,t,n,r,i){var a,o,s,u,c,l,f,d,h,p,b,m;for(s=Je(tyx,eH6,25,e.c.length,15,1),d=new Fz(new oB),egV(d,e),c=0,b=new p0;0!=d.b.c.length;)if(o=Pp(0==d.b.c.length?null:RJ(d.b,0),157),c>1&&jl(o)*jc(o)/2>s[0]){for(a=0;as[a];)++a;p=new Gz(b,0,a+1),f=new etD(p),l=jl(o)/jc(o),u=eY8(f,t,new mp,n,r,i,l),C6(xB(f.e),u),Ja(e_s(d,f)),egV(d,h=new Gz(b,a+1,b.c.length)),b.c=Je(e1R,eUp,1,0,5,1),c=0,jA(s,s.length,0)}else null!=(m=0==d.b.c.length?null:RJ(d.b,0))&&erD(d,0),c>0&&(s[c]=s[c-1]),s[c]+=jl(o)*jc(o),++c,b.c[b.c.length]=o;return b}function eR$(e){var t,n,r,i,a;if((r=Pp(e_k(e,(eBy(),taY)),163))==(ef_(),tnN)){for(n=new Fa(OH(efu(e).a.Kc(),new c));eTk(n);)if(t=Pp(ZC(n),17),!ZI(t))throw p7(new gq(eWr+egs(e)+"' has its layer constraint set to FIRST_SEPARATE, but has at least one incoming edge. FIRST_SEPARATE nodes must not have incoming edges."))}else if(r==tnR){for(a=new Fa(OH(efc(e).a.Kc(),new c));eTk(a);)if(i=Pp(ZC(a),17),!ZI(i))throw p7(new gq(eWr+egs(e)+"' has its layer constraint set to LAST_SEPARATE, but has at least one outgoing edge. LAST_SEPARATE nodes must not have outgoing edges."))}}function eRz(e,t){var n,r,i,a,o,s,u,c,l,f,d,h,p;for(ewG(t,"Label dummy removal",1),r=gP(LV(e_k(e,(eBy(),toL)))),i=gP(LV(e_k(e,toN))),c=Pp(e_k(e,tal),103),u=new fz(e.b);u.a0&&eE8(e,s,f);for(i=new fz(f);i.a>19!=0&&(t=eoQ(t),u=!u),o=eOy(t),a=!1,i=!1,r=!1,e.h==eHz&&0==e.m&&0==e.l){if(i=!0,a=!0,-1!=o)return s=eTC(e,o),u&&esh(s),n&&(e0A=Mk(0,0,0)),s;e=Tr((Q2(),e0L)),r=!0,u=!u}else e.h>>19!=0&&(a=!0,e=eoQ(e),r=!0,u=!u);return -1!=o?esk(e,o,u,a,n):0>evy(e,t)?(n&&(e0A=a?eoQ(e):Mk(e.l,e.m,e.h)),Mk(0,0,0)):eDr(r?e:Mk(e.l,e.m,e.h),t,u,a,i,n)}function eRq(e,t){var n,r,i,a,o,s,u,c,l,f,d,h,p;if(e.e&&e.c.ct.f)&&!(t.g>e.f)){for(n=0,r=0,o=e.w.a.ec().Kc();o.Ob();)i=Pp(o.Pb(),11),euz(esp(eow(vx(e60,1),eUP,8,0,[i.i.n,i.n,i.a])).b,t.g,t.f)&&++n;for(s=e.r.a.ec().Kc();s.Ob();)i=Pp(s.Pb(),11),euz(esp(eow(vx(e60,1),eUP,8,0,[i.i.n,i.n,i.a])).b,t.g,t.f)&&--n;for(u=t.w.a.ec().Kc();u.Ob();)i=Pp(u.Pb(),11),euz(esp(eow(vx(e60,1),eUP,8,0,[i.i.n,i.n,i.a])).b,e.g,e.f)&&++r;for(a=t.r.a.ec().Kc();a.Ob();)i=Pp(a.Pb(),11),euz(esp(eow(vx(e60,1),eUP,8,0,[i.i.n,i.n,i.a])).b,e.g,e.f)&&--r;n=0)return i=efd(e,t.substr(1,o-1)),eYF(e,l=t.substr(o+1,u-(o+1)),i)}else{if(n=-1,null==e0F&&(e0F=RegExp("\\d")),e0F.test(String.fromCharCode(s))&&(n=IO(t,e_n(46),u-1))>=0){r=Pp(ZN(e,etm(e,t.substr(1,n-1)),!1),58),c=0;try{c=eDa(t.substr(n+1),eHt,eUu)}catch(d){if(d=eoa(d),M4(d,127))throw a=d,p7(new QH(a));throw p7(d)}if(c=0)return n;switch(Ur(QZ(e,n))){case 2:if(IE("",ecG(e,n.Hj()).ne())){if(u=U$(QZ(e,n)),s=UH(QZ(e,n)),l=eMv(e,t,u,s))return l;for(o=0,f=(i=eIx(e,t)).gc();o1)throw p7(new gL(eQ$));for(o=0,l=eAY(e.e.Tg(),t),r=Pp(e.g,119);o1,c=new Z4(d.b);My(c.a)||My(c.b);)f=(u=Pp(My(c.a)?Wx(c.a):Wx(c.b),17)).c==d?u.d:u.c,eB4.Math.abs(esp(eow(vx(e60,1),eUP,8,0,[f.i.n,f.n,f.a])).b-o.b)>1&&eAZ(e,u,o,a,d)}}function eR9(e){var t,n,r,i,a,o;if(i=new KB(e.e,0),r=new KB(e.a,0),e.d)for(n=0;neVW;){for(a=t,o=0;eB4.Math.abs(t-a)0),i.a.Xb(i.c=--i.b),eNy(e,e.b-o,a,r,i),A5(i.b0),r.a.Xb(r.c=--r.b)}if(!e.d)for(n=0;n0?(e.f[l.p]=h/(l.e.c.length+l.g.c.length),e.c=eB4.Math.min(e.c,e.f[l.p]),e.b=eB4.Math.max(e.b,e.f[l.p])):s&&(e.f[l.p]=h)}}function ejt(e){e.b=null,e.bb=null,e.fb=null,e.qb=null,e.a=null,e.c=null,e.d=null,e.e=null,e.f=null,e.n=null,e.M=null,e.L=null,e.Q=null,e.R=null,e.K=null,e.db=null,e.eb=null,e.g=null,e.i=null,e.j=null,e.k=null,e.gb=null,e.o=null,e.p=null,e.q=null,e.r=null,e.$=null,e.ib=null,e.S=null,e.T=null,e.t=null,e.s=null,e.u=null,e.v=null,e.w=null,e.B=null,e.A=null,e.C=null,e.D=null,e.F=null,e.G=null,e.H=null,e.I=null,e.J=null,e.P=null,e.Z=null,e.U=null,e.V=null,e.W=null,e.X=null,e.Y=null,e._=null,e.ab=null,e.cb=null,e.hb=null,e.nb=null,e.lb=null,e.mb=null,e.ob=null,e.pb=null,e.jb=null,e.kb=null,e.N=!1,e.O=!1}function ejn(e,t,n){var r,i,a,o;for(ewG(n,"Graph transformation ("+e.a+")",1),o=WC(t.a),a=new fz(t.b);a.a0&&(e.a=u+(p-1)*a,t.c.b+=e.a,t.f.b+=e.a),0!=b.a.gc()&&(p=ejF(h=new YJ(1,a),t,b,m,t.f.b+u-t.c.b))>0&&(t.f.b+=u+(p-1)*a)}function eji(e,t){var n,r,i,a;a=e.F,null==t?(e.F=null,euc(e,null)):(e.F=(BJ(t),t),-1!=(r=x7(t,e_n(60)))?(i=t.substr(0,r),-1!=x7(t,e_n(46))||IE(i,eUi)||IE(i,eJZ)||IE(i,eJX)||IE(i,eJJ)||IE(i,eJQ)||IE(i,eJ1)||IE(i,eJ0)||IE(i,eJ2)||(i=eJ3),-1!=(n=O9(t,e_n(62)))&&(i+=""+t.substr(n+1)),euc(e,i)):(i=t,-1==x7(t,e_n(46))&&(-1!=(r=x7(t,e_n(91)))&&(i=t.substr(0,r)),IE(i,eUi)||IE(i,eJZ)||IE(i,eJX)||IE(i,eJJ)||IE(i,eJQ)||IE(i,eJ1)||IE(i,eJ0)||IE(i,eJ2)?i=t:(i=eJ3,-1!=r&&(i+=""+t.substr(r)))),euc(e,i),i==t&&(e.F=e.D))),(4&e.Db)!=0&&(1&e.Db)==0&&eam(e,new FX(e,1,5,a,t))}function eja(e,t){var n,r,i,a,o,s,u,c,l,f,d,h,p,b,m,g,v,y;if(!((b=t.b.c.length)<3)){for(h=Je(ty_,eHT,25,b,15,1),f=0,l=new fz(t.b);l.ao)&&Yf(e.b,Pp(m.b,17));++s}a=o}}}function ejo(e,t){var n;if(null==t||IE(t,eUg)||0==t.length&&e.k!=(eSd(),tdy))return null;switch(e.k.g){case 1:return ehZ(t,eq5)?(OQ(),e0P):ehZ(t,eq8)?(OQ(),e0N):null;case 2:try{return ell(eDa(t,eHt,eUu))}catch(r){if(r=eoa(r),M4(r,127))return null;throw p7(r)}case 4:try{return eEu(t)}catch(i){if(i=eoa(i),M4(i,127))return null;throw p7(i)}case 3:return t;case 5:return euC(e),exs(e,t);case 6:return euC(e),eMj(e,e.a,t);case 7:try{return(n=eTh(e)).Jf(t),n}catch(a){if(a=eoa(a),M4(a,32))return null;throw p7(a)}default:throw p7(new gC("Invalid type set for this layout option."))}}function ejs(e){var t,n,r,i,a,o,s;for(eeP(),s=new b5,n=new fz(e);n.a=s.b.c)&&(s.b=t),(!s.c||t.c<=s.c.c)&&(s.d=s.c,s.c=t),(!s.e||t.d>=s.e.d)&&(s.e=t),(!s.f||t.d<=s.f.d)&&(s.f=t);return r=new epG((eok(),e9f)),Kv(e,e9y,new g$(eow(vx(e4M,1),eUp,369,0,[r]))),o=new epG(e9p),Kv(e,e9v,new g$(eow(vx(e4M,1),eUp,369,0,[o]))),i=new epG(e9d),Kv(e,e9g,new g$(eow(vx(e4M,1),eUp,369,0,[i]))),a=new epG(e9h),Kv(e,e9m,new g$(eow(vx(e4M,1),eUp,369,0,[a]))),eOk(r.c,e9f),eOk(i.c,e9d),eOk(a.c,e9h),eOk(o.c,e9p),s.a.c=Je(e1R,eUp,1,0,5,1),eoc(s.a,r.c),eoc(s.a,eaa(i.c)),eoc(s.a,a.c),eoc(s.a,eaa(o.c)),s}function eju(e){var t;switch(e.d){case 1:if(e.hj())return -2!=e.o;break;case 2:if(e.hj())return -2==e.o;break;case 3:case 5:case 4:case 6:case 7:return e.o>-2;default:return!1}switch(t=e.gj(),e.p){case 0:return null!=t&&gN(LK(t))!=xg(e.k,0);case 1:return null!=t&&Pp(t,217).a!=jE(e.k)<<24>>24;case 2:return null!=t&&Pp(t,172).a!=(jE(e.k)&eHd);case 6:return null!=t&&xg(Pp(t,162).a,e.k);case 5:return null!=t&&Pp(t,19).a!=jE(e.k);case 7:return null!=t&&Pp(t,184).a!=jE(e.k)<<16>>16;case 3:return null!=t&&gP(LV(t))!=e.j;case 4:return null!=t&&Pp(t,155).a!=e.j;default:return null==t?null!=e.n:!ecX(t,e.n)}}function ejc(e,t,n){var r,i,a,o;return e.Fk()&&e.Ek()&&(o=FU(e,Pp(n,56)),xc(o)!==xc(n))?(e.Oi(t),e.Ui(t,J5(e,t,o)),e.rk()&&(a=(i=Pp(n,49),e.Dk()?e.Bk()?i.ih(e.b,ebY(Pp(ee2($S(e.b),e.aj()),18)).n,Pp(ee2($S(e.b),e.aj()).Yj(),26).Bj(),null):i.ih(e.b,edv(i.Tg(),ebY(Pp(ee2($S(e.b),e.aj()),18))),null,null):i.ih(e.b,-1-e.aj(),null,null)),Pp(o,49).eh()||(a=(r=Pp(o,49),e.Dk()?e.Bk()?r.gh(e.b,ebY(Pp(ee2($S(e.b),e.aj()),18)).n,Pp(ee2($S(e.b),e.aj()).Yj(),26).Bj(),a):r.gh(e.b,edv(r.Tg(),ebY(Pp(ee2($S(e.b),e.aj()),18))),null,a):r.gh(e.b,-1-e.aj(),null,a))),a&&a.Fi()),TO(e.b)&&e.$i(e.Zi(9,n,o,t,!1)),o):n}function ejl(e,t,n){var r,i,a,o,s,u,c,l,f,d,h,p,b,m,g,v,y,w;for(l=gP(LV(e_k(e,(eBy(),toC)))),r=gP(LV(e_k(e,toG))),eo3(d=new oG,toC,l+r),g=(c=t).d,b=c.c.i,v=c.d.i,m=Tl(b.c),y=Tl(v.c),i=new p0,f=m;f<=y;f++)s=new eb$(e),lK(s,(eEn(),e9D)),eo3(s,(eBU(),tnc),c),eo3(s,tol,(ewf(),tbo)),eo3(s,toD,d),h=Pp(RJ(e.b,f),29),f==m?egU(s,h.a.c.length-n,h):Gu(s,h),(w=gP(LV(e_k(c,tak))))<0&&eo3(c,tak,w=0),s.o.b=w,p=eB4.Math.floor(w/2),o=new eES,ekv(o,(eYu(),tbY)),Gc(o,s),o.n.b=p,u=new eES,ekv(u,tby),Gc(u,s),u.n.b=p,Go(c,o),a=new $b,eaW(a,c),eo3(a,taR,null),Gs(a,u),Go(a,g),evT(s,c,a),i.c[i.c.length]=a,c=a;return i}function ejf(e,t){var n,r,i,a,o,s,u,c,l,f,d,h,p,b,m,g,v,y;for(u=Pp(eEC(e,(eYu(),tbY)).Kc().Pb(),11).e,h=Pp(eEC(e,tby).Kc().Pb(),11).g,s=u.c.length,y=GX(Pp(RJ(e.j,0),11));s-- >0;){for(b=(GK(0,u.c.length),Pp(u.c[0],17)),a=QI(v=(i=(GK(0,h.c.length),Pp(h.c[0],17))).d.e,i,0),KW(b,i.d,a),Gs(i,null),Go(i,null),p=b.a,t&&P7(p,new TS(y)),r=epL(i.a,0);r.b!=r.d.c;)n=Pp(Vv(r),8),P7(p,new TS(n));for(g=b.b,d=new fz(i.b);d.a0&&(o=eB4.Math.max(o,eix(e.C.b+r.d.b,i))),l=r,f=i,d=a;e.C&&e.C.c>0&&(h=d+e.C.c,c&&(h+=l.d.c),o=eB4.Math.max(o,(Mc(),enj(ezs),eB4.Math.abs(f-1)<=ezs||1==f||isNaN(f)&&isNaN(1)?0:h/(1-f)))),n.n.b=0,n.a.a=o}function ejh(e,t){var n,r,i,a,o,s,u,c,l,f,d,h;if(n=Pp(UA(e.b,t),124),(u=Pp(Pp(Zq(e.r,t),21),84)).dc()){n.n.d=0,n.n.a=0;return}for(c=e.u.Hc((ekU(),tbp)),o=0,e.A.Hc((ed5(),tbq))&&eCN(e,t),s=u.Kc(),l=null,d=0,f=0;s.Ob();)a=gP(LV((r=Pp(s.Pb(),111)).b.We((Ab(),e4a)))),i=r.b.rf().b,l?(h=f+l.d.a+e.w+r.d.d,o=eB4.Math.max(o,(Mc(),enj(ezs),eB4.Math.abs(d-a)<=ezs||d==a||isNaN(d)&&isNaN(a)?0:h/(a-d)))):e.C&&e.C.d>0&&(o=eB4.Math.max(o,eix(e.C.d+r.d.d,a))),l=r,d=a,f=i;e.C&&e.C.a>0&&(h=f+e.C.a,c&&(h+=l.d.a),o=eB4.Math.max(o,(Mc(),enj(ezs),eB4.Math.abs(d-1)<=ezs||1==d||isNaN(d)&&isNaN(1)?0:h/(1-d)))),n.n.d=0,n.a.b=o}function ejp(e,t,n){var r,i,a,o,s,u;for(o=0,this.g=e,s=t.d.length,u=n.d.length,this.d=Je(e4N,eGW,10,s+u,0,1);o0?etU(this,this.f/this.a):null!=Ot(t.g,t.d[0]).a&&null!=Ot(n.g,n.d[0]).a?etU(this,(gP(Ot(t.g,t.d[0]).a)+gP(Ot(n.g,n.d[0]).a))/2):null!=Ot(t.g,t.d[0]).a?etU(this,Ot(t.g,t.d[0]).a):null!=Ot(n.g,n.d[0]).a&&etU(this,Ot(n.g,n.d[0]).a)}function ejb(e,t){var n,r,i,a,o,s,u,c,l,f;for(e.a=new Bv(eiG(e66)),r=new fz(t.a);r.a=1&&(m-o>0&&f>=0?(u.n.a+=b,u.n.b+=a*o):m-o<0&&l>=0&&(u.n.a+=b*m,u.n.b+=a));e.o.a=t.a,e.o.b=t.b,eo3(e,(eBy(),ta4),(ed5(),r=Pp(yw(e5o),9),new I1(r,Pp(CY(r,r.length),9),0)))}function ej_(e,t,n,r,i,a){var o;if(!(null==t||!efz(t,tmJ,tmQ)))throw p7(new gL("invalid scheme: "+t));if(!e&&!(null!=n&&-1==x7(n,e_n(35))&&n.length>0&&(GV(0,n.length),47!=n.charCodeAt(0))))throw p7(new gL("invalid opaquePart: "+n));if(e&&!(null!=t&&wZ(tm$,t.toLowerCase()))&&!(null==n||!efz(n,tm1,tm0))||e&&null!=t&&wZ(tm$,t.toLowerCase())&&!eyQ(n))throw p7(new gL(eJI+n));if(!ef$(r))throw p7(new gL("invalid device: "+r));if(!ece(i))throw o=null==i?"invalid segments: null":"invalid segment: "+euR(i),p7(new gL(o));if(!(null==a||-1==x7(a,e_n(35))))throw p7(new gL("invalid query: "+a))}function ejE(e,t){var n,r,i,a,o,s,u,c,l,f,d,h,p,b,m,g;for(ewG(t,"Calculate Graph Size",1),t.n&&e&&WG(t,KS(e),(eup(),tmr)),s=ezq,u=ezq,a=eqe,o=eqe,f=new Ow((e.a||(e.a=new FQ(e5k,e,10,11)),e.a));f.e!=f.i.gc();)p=(c=Pp(epH(f),33)).i,b=c.j,g=c.g,r=c.f,i=Pp(eT9(c,(eBB(),thy)),142),s=eB4.Math.min(s,p-i.b),u=eB4.Math.min(u,b-i.d),a=eB4.Math.max(a,p+g+i.c),o=eB4.Math.max(o,b+r+i.a);for(h=Pp(eT9(e,(eBB(),thN)),116),d=new kl(s-h.b,u-h.d),l=new Ow((e.a||(e.a=new FQ(e5k,e,10,11)),e.a));l.e!=l.i.gc();)c=Pp(epH(l),33),eno(c,c.i-d.a),ens(c,c.j-d.b);m=a-s+(h.b+h.c),n=o-u+(h.d+h.a),ena(e,m),eni(e,n),t.n&&e&&WG(t,KS(e),(eup(),tmr))}function ejS(e){var t,n,r,i,a,o,s,u,c,l;for(r=new p0,o=new fz(e.e.a);o.a0){epV(e,n,0),n.a+=String.fromCharCode(r),epV(e,n,i=ehR(t,a)),a+=i-1;continue}39==r?a+11)for(b=Je(ty_,eHT,25,e.b.b.c.length,15,1),f=0,c=new fz(e.b.b);c.a=s&&i<=u)s<=i&&a<=u?(n[l++]=i,n[l++]=a,r+=2):s<=i?(n[l++]=i,n[l++]=u,e.b[r]=u+1,o+=2):a<=u?(n[l++]=s,n[l++]=a,r+=2):(n[l++]=s,n[l++]=u,e.b[r]=u+1);else if(ueHe)&&s<10)vR(e.c,new tf),ejM(e),Ym(e.c),ejv(e.f)}function ejL(e,t,n){var r,i,a,o,s,u,c,l,f,d,h,p,b,m;if(gN(LK(e_k(n,(eBy(),taI)))))for(s=new fz(n.j);s.a=2){for(o=Pp(Vv(u=epL(n,0)),8),s=Pp(Vv(u),8);s.a0&&eoY(l,!0,(ec3(),tpg)),s.k==(eEn(),e9C)&&UP(l),Um(e.f,s,t)}}function ejN(e,t,n){var r,i,a,o,s,u,c,l,f,d;switch(ewG(n,"Node promotion heuristic",1),e.g=t,eYs(e),e.q=Pp(e_k(t,(eBy(),taz)),260),l=Pp(e_k(e.g,ta$),19).a,a=new nH,e.q.g){case 2:case 1:default:eRn(e,a);break;case 3:for(e.q=(eOJ(),tsk),eRn(e,a),u=0,s=new fz(e.a);s.ae.j&&(e.q=tsv,eRn(e,a));break;case 4:for(e.q=(eOJ(),tsk),eRn(e,a),c=0,i=new fz(e.b);i.ae.k&&(e.q=ts_,eRn(e,a));break;case 6:d=zy(eB4.Math.ceil(e.f.length*l/100)),eRn(e,new dq(d));break;case 5:f=zy(eB4.Math.ceil(e.d*l/100)),eRn(e,new dZ(f))}eLC(e,t),eEj(n)}function ejP(e,t,n){var r,i,a,o;this.j=e,this.e=ewi(e),this.o=this.j.e,this.i=!!this.o,this.p=this.i?Pp(RJ(n,Bq(this.o).p),214):null,i=Pp(e_k(e,(eBU(),tt3)),21),this.g=i.Hc((eLR(),ttw)),this.b=new p0,this.d=new ed0(this.e),o=Pp(e_k(this.j,tnw),230),this.q=eaG(t,o,this.e),this.k=new zX(this),a=ZW(eow(vx(e4H,1),eUp,225,0,[this,this.d,this.k,this.q])),t!=(enU(),tur)||gN(LK(e_k(e,(eBy(),ti7))))?t==tur&&gN(LK(e_k(e,(eBy(),ti7))))?(r=new ews(this.e),a.c[a.c.length]=r,this.c=new erB(r,o,Pp(this.q,402))):this.c=new Sr(t,this):(r=new ews(this.e),a.c[a.c.length]=r,this.c=new K6(r,o,Pp(this.q,402))),P_(a,this.c),eP0(a,this.e),this.s=eY0(this.k)}function ejR(e,t){var n,r,i,a,o,s,u,c,l,f,d,h,p,b,m,g,v,y,w;for(p=(f=Pp(M2((o=epL(new hz(t).a.d,0),new hG(o))),86))?Pp(e_k(f,(eR5(),tco)),86):null,i=1;f&&p;){for(s=0,u=0,w=0,n=f,r=p;s=e.i?(++e.i,P_(e.a,ell(1)),P_(e.b,f)):(r=e.c[t.p][1],q1(e.a,l,ell(Pp(RJ(e.a,l),19).a+1-r)),q1(e.b,l,gP(LV(RJ(e.b,l)))+f-r*e.e)),(e.q==(eOJ(),tsv)&&(Pp(RJ(e.a,l),19).a>e.j||Pp(RJ(e.a,l-1),19).a>e.j)||e.q==ts_&&(gP(LV(RJ(e.b,l)))>e.k||gP(LV(RJ(e.b,l-1)))>e.k))&&(u=!1),o=new Fa(OH(efu(t).a.Kc(),new c));eTk(o);)s=(a=Pp(ZC(o),17)).c.i,e.f[s.p]==l&&(d=ejj(e,s),i+=Pp(d.a,19).a,u=u&&gN(LK(d.b)));return e.f[t.p]=l,i+=e.c[t.p][0],new kD(ell(i),(OQ(),!!u))}function ejF(e,t,n,r,i){var a,o,s,u,c,l,f,d,h,p,b,m,g;for(f=new p2,o=new p0,ekD(e,n,e.d.fg(),o,f),ekD(e,r,e.d.gg(),o,f),e.b=.2*(b=eTZ(eeh(new R1(null,new Gq(o,16)),new aL)),m=eTZ(eeh(new R1(null,new Gq(o,16)),new aC)),eB4.Math.min(b,m)),a=0,s=0;s=2&&(g=eOY(o,!0,d),e.e||(e.e=new h$(e)),ehB(e.e,g,o,e.b)),ewv(o,d),eFn(o),h=-1,l=new fz(o);l.as)}function ejU(e,t){var n,r,i,a,o,s,u,c,l,f,d,h,p,b;for(n=Pp(e_k(e,(eBy(),tol)),98),o=e.f,a=e.d,s=o.a+a.b+a.c,u=0-a.d-e.c.b,l=o.b+a.d+a.a-e.c.b,c=new p0,f=new p0,i=new fz(t);i.a0),Pp(l.a.Xb(l.c=--l.b),17));a!=r&&l.b>0;)e.a[a.p]=!0,e.a[r.p]=!0,a=(A5(l.b>0),Pp(l.a.Xb(l.c=--l.b),17));l.b>0&&BH(l)}}function ejZ(e,t,n){var r,i,a,o,s,u,c,l,f;if(e.a!=t.Aj())throw p7(new gL(eZ6+t.ne()+eZ5));if(r=ecG((eSp(),tvc),t).$k())return r.Aj().Nh().Ih(r,n);if(o=ecG(tvc,t).al()){if(null==n)return null;if((s=Pp(n,15)).dc())return"";for(f=new vs,a=s.Kc();a.Ob();)i=a.Pb(),xk(f,o.Aj().Nh().Ih(o,i)),f.a+=" ";return x3(f,f.a.length-1)}if(!(l=ecG(tvc,t).bl()).dc()){for(c=l.Kc();c.Ob();)if((u=Pp(c.Pb(),148)).wj(n))try{if(f=u.Aj().Nh().Ih(u,n),null!=f)return f}catch(d){if(d=eoa(d),!M4(d,102))throw p7(d)}throw p7(new gL("Invalid value: '"+n+"' for datatype :"+t.ne()))}return Pp(t,834).Fj(),null==n?null:M4(n,172)?""+Pp(n,172).a:esF(n)==e1Q?MU(tmS[0],Pp(n,199)):efF(n)}function ejX(e){var t,n,r,i,a,o,s,u,c,l;for(c=new _n,s=new _n,a=new fz(e);a.a-1){for(i=epL(s,0);i.b!=i.d.c;)(r=Pp(Vv(i),128)).v=o;for(;0!=s.b;)for(r=Pp(egW(s,0),128),n=new fz(r.i);n.a0&&(n+=u.n.a+u.o.a/2,++f),p=new fz(u.j);p.a0&&(n/=f),g=Je(tyx,eH6,25,r.a.c.length,15,1),s=0,c=new fz(r.a);c.a=s&&i<=u)s<=i&&a<=u?r+=2:s<=i?(e.b[r]=u+1,o+=2):a<=u?(n[l++]=i,n[l++]=s-1,r+=2):(n[l++]=i,n[l++]=s-1,e.b[r]=u+1,o+=2);else if(u0?i-=864e5:i+=864e5,u=new LZ(eft(eap(t.q.getTime()),i))),l=new vl,c=e.a.length,a=0;a=97&&r<=122||r>=65&&r<=90){for(o=a+1;o=c)throw p7(new gL("Missing trailing '"));o+10&&0==n.c&&(t||(t=new p0),t.c[t.c.length]=n);if(t)for(;0!=t.c.length;){if((n=Pp(ZV(t,0),233)).b&&n.b.c.length>0){for(a=(n.b||(n.b=new p0),new fz(n.b));a.aQI(e,n,0))return new kD(i,n)}else if(gP(Ot(i.g,i.d[0]).a)>gP(Ot(n.g,n.d[0]).a))return new kD(i,n)}for(s=(n.e||(n.e=new p0),n.e).Kc();s.Ob();)u=((o=Pp(s.Pb(),233)).b||(o.b=new p0),o.b),Gp(0,u.c.length),Ew(u.c,0,n),o.c==u.c.length&&(t.c[t.c.length]=o)}return null}function eFe(e,t){var n,r,i,a,o,s,u,c,l;if(null==e)return eUg;if(null!=(u=t.a.zc(e,t)))return"[...]";for(a=0,n=new eaP(eUd,"[","]"),o=(i=e).length;a=14&&l<=16)?t.a._b(r)?(n.a?xM(n.a,n.b):n.a=new O0(n.d),xx(n.a,"[...]")):ZJ(n,eFe(s=etG(r),c=new Rq(t))):M4(r,177)?ZJ(n,ekd(Pp(r,177))):M4(r,190)?ZJ(n,ewh(Pp(r,190))):M4(r,195)?ZJ(n,eEm(Pp(r,195))):M4(r,2012)?ZJ(n,ewp(Pp(r,2012))):M4(r,48)?ZJ(n,ekf(Pp(r,48))):M4(r,364)?ZJ(n,ekG(Pp(r,364))):M4(r,832)?ZJ(n,ekl(Pp(r,832))):M4(r,104)&&ZJ(n,ekc(Pp(r,104))):ZJ(n,null==r?eUg:efF(r));return n.a?0==n.e.length?n.a.a:n.a.a+""+n.e:n.c}function eFt(e,t,n,r){var i,a,o,s,u,c,l,f,d,h,p,b,m,g,v,y;for(s=eLO(t,!1,!1),g=eEF(s),r&&(g=esP(g)),y=gP(LV(eT9(t,(epz(),e53)))),m=(A5(0!=g.b),Pp(g.a.a.c,8)),f=Pp(ep3(g,1),8),g.b>2?(l=new p0,eoc(l,new Gz(g,1,g.b)),a=eBk(l,y+e.a),v=new eTI(a),eaW(v,t),n.c[n.c.length]=v):v=r?Pp(Bp(e.b,e_I(t)),266):Pp(Bp(e.b,e_P(t)),266),u=e_I(t),r&&(u=e_P(t)),o=eEJ(m,u),c=y+e.a,o.a?(c+=eB4.Math.abs(m.b-f.b),b=new kl(f.a,(f.b+m.b)/2)):(c+=eB4.Math.abs(m.a-f.a),b=new kl((f.a+m.a)/2,f.b)),r?Um(e.d,t,new emL(v,o,b,c)):Um(e.c,t,new emL(v,o,b,c)),Um(e.b,t,v),p=(t.n||(t.n=new FQ(e5S,t,1,7)),t.n),h=new Ow(p);h.e!=h.i.gc();)d=Pp(epH(h),137),i=eIt(e,d,!0,0,0),n.c[n.c.length]=i}function eFn(e){var t,n,r,i,a,o,s,u,c,l;for(c=new p0,s=new p0,o=new fz(e);o.a-1){for(a=new fz(s);a.a0)&&(l3(u,eB4.Math.min(u.o,i.o-1)),l2(u,u.i-1),0==u.i&&(s.c[s.c.length]=u))}}function eFr(e,t,n){var r,i,a,o,s,u,c;if(c=e.c,t||(t=tgK),e.c=t,(4&e.Db)!=0&&(1&e.Db)==0&&(u=new FX(e,1,2,c,e.c),n?n.Ei(u):n=u),c!=t){if(M4(e.Cb,284))e.Db>>16==-10?n=Pp(e.Cb,284).nk(t,n):e.Db>>16==-15&&(t||(t=(eBK(),tgA)),c||(c=(eBK(),tgA)),e.Cb.nh()&&(u=new Q$(e.Cb,1,13,c,t,ebv(QX(Pp(e.Cb,59)),e),!1),n?n.Ei(u):n=u));else if(M4(e.Cb,88))e.Db>>16==-23&&(M4(t,88)||(t=(eBK(),tgI)),M4(c,88)||(c=(eBK(),tgI)),e.Cb.nh()&&(u=new Q$(e.Cb,1,10,c,t,ebv(qt(Pp(e.Cb,26)),e),!1),n?n.Ei(u):n=u));else if(M4(e.Cb,444))for(o=((s=Pp(e.Cb,836)).b||(s.b=new pG(new mR)),s.b),a=(r=new esz(new fS(o.a).a),new pW(r));a.a.b;)n=eFr(i=Pp(etz(a.a).cd(),87),eOl(i,s),n)}return n}function eFi(e,t){var n,r,i,a,o,s,u,c,l,f,d;for(o=gN(LK(eT9(e,(eBy(),taI)))),d=Pp(eT9(e,toh),21),u=!1,c=!1,f=new Ow((e.c||(e.c=new FQ(e5x,e,9,9)),e.c));f.e!=f.i.gc()&&(!u||!c);){for(a=Pp(epH(f),118),s=0,i=Y_(enM(eow(vx(e1B,1),eUp,20,0,[(a.d||(a.d=new Ih(e5g,a,8,5)),a.d),(a.e||(a.e=new Ih(e5g,a,7,4)),a.e)])));eTk(i)&&(r=Pp(ZC(i),79),l=o&&exb(r)&&gN(LK(eT9(r,taD))),n=eRL((r.b||(r.b=new Ih(e5m,r,4,7)),r.b),a)?e==z$(ewH(Pp(etj((r.c||(r.c=new Ih(e5m,r,5,8)),r.c),0),82))):e==z$(ewH(Pp(etj((r.b||(r.b=new Ih(e5m,r,4,7)),r.b),0),82))),!((l||n)&&++s>1)););s>0?u=!0:d.Hc((ekU(),tbp))&&(a.n||(a.n=new FQ(e5S,a,1,7)),a.n).i>0&&(u=!0),s>1&&(c=!0)}u&&t.Fc((eLR(),ttw)),c&&t.Fc((eLR(),tt_))}function eFa(e){var t,n,r,i,a,o,s,u,c,l,f,d;if((d=Pp(eT9(e,(eBB(),thx)),21)).dc())return null;if(s=0,o=0,d.Hc((ed5(),tbV))){for(l=Pp(eT9(e,thV),98),r=2,n=2,i=2,a=2,t=z$(e)?Pp(eT9(z$(e),the),103):Pp(eT9(e,the),103),c=new Ow((e.c||(e.c=new FQ(e5x,e,9,9)),e.c));c.e!=c.i.gc();)if(u=Pp(epH(c),118),(f=Pp(eT9(u,th0),61))==(eYu(),tbF)&&(f=eNh(u,t),ebu(u,th0,f)),l==(ewf(),tbo))switch(f.g){case 1:r=eB4.Math.max(r,u.i+u.g);break;case 2:n=eB4.Math.max(n,u.j+u.f);break;case 3:i=eB4.Math.max(i,u.i+u.g);break;case 4:a=eB4.Math.max(a,u.j+u.f)}else switch(f.g){case 1:r+=u.g+2;break;case 2:n+=u.f+2;break;case 3:i+=u.g+2;break;case 4:a+=u.f+2}s=eB4.Math.max(r,i),o=eB4.Math.max(n,a)}return eYx(e,s,o,!0,!0)}function eFo(e,t,n,r,i){var a,o,s,u,c,l,f,d,h,p,b,m,g,v,y,w;for(v=Pp(qE(etc(UJ(new R1(null,new Gq(t.d,16)),new hc(n)),new hl(n)),JF(new U,new B,new en,eow(vx(e2L,1),eU4,132,0,[(eum(),e2U)]))),15),f=eUu,l=eHt,u=new fz(t.b.j);u.a0)?c&&(d=g.p,o?++d:--d,h=!(eOV(r=eoZ(f=Pp(RJ(g.c.a,d),10)),E,n[0])||FF(r,E,n[0]))):h=!0),p=!1,(_=t.D.i)&&_.c&&s.e&&((l=o&&_.p>0||!o&&_.p<_.c.a.c.length-1)?(d=_.p,o?--d:++d,p=!(eOV(r=eoZ(f=Pp(RJ(_.c.a,d),10)),n[0],k)||FF(r,n[0],k))):p=!0),h&&p&&P7(e.a,S),h||enD(e.a,eow(vx(e60,1),eUP,8,0,[b,m])),p||enD(e.a,eow(vx(e60,1),eUP,8,0,[w,y]))}function eFh(e,t){var n,r,i,a,o,s,u,c;if(M4(e.Ug(),160)?(eFh(Pp(e.Ug(),160),t),t.a+=" > "):t.a+="Root ",IE((n=e.Tg().zb).substr(0,3),"Elk")?xM(t,n.substr(3)):(t.a+=""+n,t),i=e.zg()){xM((t.a+=" ",t),i);return}if(M4(e,354)&&(c=Pp(e,137).a)){xM((t.a+=" ",t),c);return}for(o=new Ow(e.Ag());o.e!=o.i.gc();)if(c=(a=Pp(epH(o),137)).a){xM((t.a+=" ",t),c);return}if(M4(e,352)&&((r=Pp(e,79)).b||(r.b=new Ih(e5m,r,4,7)),0!=r.b.i&&(r.c||(r.c=new Ih(e5m,r,5,8)),0!=r.c.i))){for(t.a+=" (",s=new AF((r.b||(r.b=new Ih(e5m,r,4,7)),r.b));s.e!=s.i.gc();)s.e>0&&(t.a+=eUd),eFh(Pp(epH(s),160),t);for(t.a+=eGH,u=new AF((r.c||(r.c=new Ih(e5m,r,5,8)),r.c));u.e!=u.i.gc();)u.e>0&&(t.a+=eUd),eFh(Pp(epH(u),160),t);t.a+=")"}}function eFp(e,t,n){var r,i,a,o,s,u,c,l,f,d,h;if(a=Pp(e_k(e,(eBU(),tnc)),79)){for(r=e.a,C6(i=new TS(n),eyr(e)),eag(e.d.i,e.c.i)?(d=e.c,f=esp(eow(vx(e60,1),eUP,8,0,[d.n,d.a])),C5(f,n)):f=GX(e.c),qQ(r,f,r.a,r.a.a),h=GX(e.d),null!=e_k(e,tnC)&&C6(h,Pp(e_k(e,tnC),8)),qQ(r,h,r.c.b,r.c),etH(r,i),o=eLO(a,!0,!0),ern(o,Pp(etj((a.b||(a.b=new Ih(e5m,a,4,7)),a.b),0),82)),err(o,Pp(etj((a.c||(a.c=new Ih(e5m,a,5,8)),a.c),0),82)),eNI(r,o),l=new fz(e.b);l.a=0){for(u=null,s=new KB(l.a,c+1);s.bo?1:Te(isNaN(0),isNaN(o)))<0&&(enj(eVU),(eB4.Math.abs(o-1)<=eVU||1==o||isNaN(o)&&isNaN(1)?0:o<1?-1:o>1?1:Te(isNaN(o),isNaN(1)))<0)&&(enj(eVU),(eB4.Math.abs(0-s)<=eVU||0==s||isNaN(0)&&isNaN(s)?0:0s?1:Te(isNaN(0),isNaN(s)))<0)&&(enj(eVU),(eB4.Math.abs(s-1)<=eVU||1==s||isNaN(s)&&isNaN(1)?0:s<1?-1:s>1?1:Te(isNaN(s),isNaN(1)))<0)))}function eFg(e){var t,n,r,i,a,o,s,u,c,l,f,d,h,p,b,m,g,v,y,w,_,E;for(f=new BU(new fQ(e));f.b!=f.c.a.d;)for(b=0,s=Pp((l=JO(f)).d,56),t=Pp(l.e,56),w=(null==(o=s.Tg()).i&&eNT(o),o.i).length;b=0&&b=c.c.c.length?VJ((eEn(),e9N),e9D):VJ((eEn(),e9D),e9D),l*=2,a=n.a.g,n.a.g=eB4.Math.max(a,a+(l-a)),o=n.b.g,n.b.g=eB4.Math.max(o,o+(l-o)),i=t}}}function eFw(e,t,n,r,i){var a,o,s,u,c,l,f,d,h,p,b,m,g,v,y,w,_;for(_=Pg(e),l=new p0,f=(s=e.c.length)-1,d=s+1;0!=_.a.c;){for(;0!=n.b;)y=(A5(0!=n.b),Pp(etw(n,n.a.a),112)),zS(_.a,y),y.g=f--,eNg(y,t,n,r);for(;0!=t.b;)w=(A5(0!=t.b),Pp(etw(t,t.a.a),112)),zS(_.a,w),w.g=d++,eNg(w,t,n,r);for(c=eHt,g=(o=new C1(new Ap(new fP(_.a).a).b),new fR(o));Et(g.a.a);){if(m=(a=AJ(g.a),Pp(a.cd(),112)),!r&&m.b>0&&m.a<=0){l.c=Je(e1R,eUp,1,0,5,1),l.c[l.c.length]=m;break}(b=m.i-m.d)>=c&&(b>c&&(l.c=Je(e1R,eUp,1,0,5,1),c=b),l.c[l.c.length]=m)}0!=l.c.length&&(u=Pp(RJ(l,ebO(i,l.c.length)),112),zS(_.a,u),u.g=d++,eNg(u,t,n,r),l.c=Je(e1R,eUp,1,0,5,1))}for(v=e.c.length+1,p=new fz(e);p.a0&&(d.d+=l.n.d,d.d+=l.d),d.a>0&&(d.a+=l.n.a,d.a+=l.d),d.b>0&&(d.b+=l.n.b,d.b+=l.d),d.c>0&&(d.c+=l.n.c,d.c+=l.d),d}function eFx(e,t,n){var r,i,a,o,s,u,c,l,f,d,h,p;for(d=n.d,f=n.c,o=(a=new kl(n.f.a+n.d.b+n.d.c,n.f.b+n.d.d+n.d.a)).b,c=new fz(e.a);c.a=(l=Pp(Pp(Zq(e.r,t),21),84)).gc()||t==(eYu(),tby)||t==(eYu(),tbY)){eYY(e,t);return}for(b=e.u.Hc((ekU(),tbg)),n=t==(eYu(),tbw)?(eaY(),e4c):(eaY(),e4o),g=t==tbw?(QQ(),e3U):(QQ(),e3$),r=vN(DP(n),e.s),m=t==tbw?eHQ:eH1,c=l.Kc();c.Ob();)(s=Pp(c.Pb(),111)).c&&!(s.c.d.c.length<=0)&&(p=s.b.rf(),h=s.e,(d=(f=s.c).i).b=(a=f.n,f.e.a+a.b+a.c),d.a=(o=f.n,f.e.b+o.d+o.a),b?(d.c=h.a-(i=f.n,f.e.a+i.b+i.c)-e.s,b=!1):d.c=h.a+p.a+e.s,$C(g,ezr),f.f=g,JC(f,(Qs(),e3Y)),P_(r.d,new jH(d,elO(r,d))),m=t==tbw?eB4.Math.min(m,h.b):eB4.Math.max(m,h.b+s.b.rf().b));for(m+=t==tbw?-e.t:e.t,edp((r.e=m,r)),u=l.Kc();u.Ob();)(s=Pp(u.Pb(),111)).c&&!(s.c.d.c.length<=0)&&(d=s.c.i,d.c-=s.e.a,d.d-=s.e.b)}function eFA(e,t,n){var r;if(ewG(n,"StretchWidth layering",1),0==t.a.c.length){eEj(n);return}for(e.c=t,e.t=0,e.u=0,e.i=eHQ,e.g=eH1,e.d=gP(LV(e_k(t,(eBy(),toO)))),ebn(e),eTR(e),eTP(e),eyo(e),ed2(e),e.i=eB4.Math.max(1,e.i),e.g=eB4.Math.max(1,e.g),e.d=e.d/e.i,e.f=e.g/e.i,e.s=ebZ(e),r=new By(e.c),P_(e.c.b,r),e.r=WC(e.p),e.n=zb(e.k,e.k.length);0!=e.r.c.length;)e.o=ecu(e),!e.o||ess(e)&&0!=e.b.a.gc()?(ey5(e,r),r=new By(e.c),P_(e.c.b,r),er7(e.a,e.b),e.b.a.$b(),e.t=e.u,e.u=0):ess(e)?(e.c.b.c=Je(e1R,eUp,1,0,5,1),r=new By(e.c),P_(e.c.b,r),e.t=0,e.u=0,e.b.a.$b(),e.a.a.$b(),++e.f,e.r=WC(e.p),e.n=zb(e.k,e.k.length)):(Gu(e.o,r),QA(e.r,e.o),Yf(e.b,e.o),e.t=e.t-e.k[e.o.p]*e.d+e.j[e.o.p],e.u+=e.e[e.o.p]*e.d);t.a.c=Je(e1R,eUp,1,0,5,1),eSj(t.b),eEj(n)}function eFL(e){var t,n,r,i;for(_r(UJ(new R1(null,new Gq(e.a.b,16)),new rH),new r$),eyR(e),_r(UJ(new R1(null,new Gq(e.a.b,16)),new rz),new rG),e.c==(efE(),tpM)&&(_r(UJ(eeh(new R1(null,new Gq(new fk(e.f),1)),new rW),new rK),new hn(e)),_r(UJ(UQ(eeh(eeh(new R1(null,new Gq(e.d.b,16)),new rV),new rq),new rZ),new rX),new hi(e))),i=new kl(eHQ,eHQ),t=new kl(eH1,eH1),r=new fz(e.a.b);r.a0&&(e.c[t.c.p][t.p].d+=eMU(e.i,24)*e$h*.07000000029802322-.03500000014901161,e.c[t.c.p][t.p].a=e.c[t.c.p][t.p].d/e.c[t.c.p][t.p].b)}}function eFD(e){var t,n,r,i,a,o,s,u,c,l,f,d,h,p,b,m;for(p=new fz(e);p.ar.d,r.d=eB4.Math.max(r.d,t),s&&n&&(r.d=eB4.Math.max(r.d,r.a),r.a=r.d+i);break;case 3:n=t>r.a,r.a=eB4.Math.max(r.a,t),s&&n&&(r.a=eB4.Math.max(r.a,r.d),r.d=r.a+i);break;case 2:n=t>r.c,r.c=eB4.Math.max(r.c,t),s&&n&&(r.c=eB4.Math.max(r.b,r.c),r.b=r.c+i);break;case 4:n=t>r.b,r.b=eB4.Math.max(r.b,t),s&&n&&(r.b=eB4.Math.max(r.b,r.c),r.c=r.b+i)}}}function eFj(e){var t,n,r,i,a,o,s,u,c,l,f;for(c=new fz(e);c.a0||l.j==tbY&&l.e.c.length-l.g.c.length<0)){t=!1;break}for(i=new fz(l.g);i.a=c&&_>=m&&(d+=p.n.b+b.n.b+b.a.b-w,++s));if(n)for(o=new fz(v.e);o.a=c&&_>=m&&(d+=p.n.b+b.n.b+b.a.b-w,++s))}s>0&&(E+=d/s,++h)}h>0?(t.a=i*E/h,t.g=h):(t.a=0,t.g=0)}function eFY(e,t){var n,r,i,a,o,s,u,c,l,f,d;for(i=new fz(e.a.b);i.aeH1||t.o==tuE&&l0&&eno(g,w*E),_>0&&ens(g,_*S);for(ear(e.b,new te),t=new p0,s=new esz(new fS(e.c).a);s.b;)o=etz(s),r=Pp(o.cd(),79),n=Pp(o.dd(),395).a,i=eLO(r,!1,!1),f=ewM(e_I(r),eEF(i),n),eNI(f,i),(y=e_D(r))&&-1==QI(t,y,0)&&(t.c[t.c.length]=y,Hw(y,(A5(0!=f.b),Pp(f.a.a.c,8)),n));for(m=new esz(new fS(e.d).a);m.b;)b=etz(m),r=Pp(b.cd(),79),n=Pp(b.dd(),395).a,i=eLO(r,!1,!1),f=ewM(e_P(r),esP(eEF(i)),n),eNI(f=esP(f),i),(y=e_N(r))&&-1==QI(t,y,0)&&(t.c[t.c.length]=y,Hw(y,(A5(0!=f.b),Pp(f.c.b.c,8)),n))}function eFz(e,t,n,r){var i,a,o,s,u,c,l,f,d,h,p,b,m,g,v,y,w,_,E,S,k;if(0!=n.c.length){for(p=new p0,h=new fz(n);h.aeB4.Math.abs(v-m))continue;v1)for(h=new eRM(p,y,r),qX(y,new SV(e,h)),o.c[o.c.length]=h,f=y.a.ec().Kc();f.Ob();)QA(a,(l=Pp(f.Pb(),46)).b);if(s.a.gc()>1)for(h=new eRM(p,s,r),qX(s,new Sq(e,h)),o.c[o.c.length]=h,f=s.a.ec().Kc();f.Ob();)QA(a,(l=Pp(f.Pb(),46)).b)}}function eFJ(e){_Y(e,new ewB(vZ(vQ(vq(vJ(vX(new oc,eqp),"ELK Radial"),'A radial layout provider which is based on the algorithm of Peter Eades published in "Drawing free trees.", published by International Institute for Advanced Study of Social Information Science, Fujitsu Limited in 1991. The radial layouter takes a tree and places the nodes in radial order around the root. The nodes of the same tree level are placed on the same radius.'),new aW),eqp))),KE(e,eqp,eVT,epB(tlw)),KE(e,eqp,eGi,epB(tlS)),KE(e,eqp,eGh,epB(tlh)),KE(e,eqp,eGM,epB(tlp)),KE(e,eqp,eGd,epB(tlb)),KE(e,eqp,eGp,epB(tld)),KE(e,eqp,eGf,epB(tlm)),KE(e,eqp,eGb,epB(tly)),KE(e,eqp,eql,epB(tll)),KE(e,eqp,eqc,epB(tlf)),KE(e,eqp,eqh,epB(tlg)),KE(e,eqp,eqs,epB(tlv)),KE(e,eqp,equ,epB(tl_)),KE(e,eqp,eqf,epB(tlE)),KE(e,eqp,eqd,epB(tlk))}function eFQ(e){var t;if(this.r=U2(new ex,new eT),this.b=new efY(Pp(Y8(e5a),290)),this.p=new efY(Pp(Y8(e5a),290)),this.i=new efY(Pp(Y8(e3n),290)),this.e=e,this.o=new TS(e.rf()),this.D=e.Df()||gN(LK(e.We((eBB(),thh)))),this.A=Pp(e.We((eBB(),thx)),21),this.B=Pp(e.We(thL),21),this.q=Pp(e.We(thV),98),this.u=Pp(e.We(thJ),21),!e_y(this.u))throw p7(new gq("Invalid port label placement: "+this.u));if(this.v=gN(LK(e.We(th1))),this.j=Pp(e.We(thS),21),!eM1(this.j))throw p7(new gq("Invalid node label placement: "+this.j));this.n=Pp(egG(e,th_),116),this.k=gP(LV(egG(e,tps))),this.d=gP(LV(egG(e,tpo))),this.w=gP(LV(egG(e,tpp))),this.s=gP(LV(egG(e,tpu))),this.t=gP(LV(egG(e,tpc))),this.C=Pp(egG(e,tpd),142),this.c=2*this.d,t=!this.B.Hc((eI3(),tbX)),this.f=new eh5(0,t,0),this.g=new eh5(1,t,0),gh(this.f,(etx(),e3N),this.g)}function eF1(e,t,n,r,i){var a,o,s,u,l,f,d,h,p,b,m,g,v,y,w,_,E,S,k,x,T,M;for(w=0,b=0,p=0,h=1,y=new Ow((e.a||(e.a=new FQ(e5k,e,10,11)),e.a));y.e!=y.i.gc();)g=Pp(epH(y),33),h+=VG(new Fa(OH(eOi(g).a.Kc(),new c))),x=g.g,b=eB4.Math.max(b,x),d=g.f,p=eB4.Math.max(p,d),w+=x*d;for(m=(e.a||(e.a=new FQ(e5k,e,10,11)),e.a).i,o=w+2*r*r*h*m,a=eB4.Math.sqrt(o),u=eB4.Math.max(a*n,b),s=eB4.Math.max(a/n,p),v=new Ow((e.a||(e.a=new FQ(e5k,e,10,11)),e.a));v.e!=v.i.gc();)g=Pp(epH(v),33),T=i.b+(eMU(t,26)*e$l+eMU(t,27)*e$f)*(u-g.g),M=i.b+(eMU(t,26)*e$l+eMU(t,27)*e$f)*(s-g.f),eno(g,T),ens(g,M);for(k=u+(i.b+i.c),S=s+(i.d+i.a),E=new Ow((e.a||(e.a=new FQ(e5k,e,10,11)),e.a));E.e!=E.i.gc();)for(_=Pp(epH(E),33),f=new Fa(OH(eOi(_).a.Kc(),new c));eTk(f);)l=Pp(ZC(f),79),eTc(l)||eBv(l,t,k,S);eYx(e,k+=i.b+i.c,S+=i.d+i.a,!1,!0)}function eF0(e){var t,n,r,i,a,o,s,u,c,l,f;if(null==e)throw p7(new vo(eUg));if(c=e,a=e.length,u=!1,a>0&&(45==(t=(GV(0,e.length),e.charCodeAt(0)))||43==t)&&(e=e.substr(1),--a,u=45==t),0==a)throw p7(new vo(eHJ+c+'"'));for(;e.length>0&&(GV(0,e.length),48==e.charCodeAt(0));)e=e.substr(1),--a;if(a>(eDZ(),e0G)[10])throw p7(new vo(eHJ+c+'"'));for(i=0;i0&&(f=-parseInt(e.substr(0,r),10),e=e.substr(r),a-=r,n=!1);a>=o;){if(r=parseInt(e.substr(0,o),10),e=e.substr(o),a-=o,n)n=!1;else{if(0>ecd(f,s))throw p7(new vo(eHJ+c+'"'));f=efn(f,l)}f=efe(f,r)}if(ecd(f,0)>0||!u&&(f=QC(f),0>ecd(f,0)))throw p7(new vo(eHJ+c+'"'));return f}function eF2(e,t){var n,r,i,a,o,s,u;if(Rm(),this.a=new MW(this),this.b=e,this.c=t,this.f=Yg(QZ((eSp(),tvc),t)),this.f.dc()){if((s=ev1(tvc,e))==t)for(this.e=!0,this.d=new p0,this.f=new o6,this.f.Fc(eQB),Pp(eP8(Qq(tvc,etP(e)),""),26)==e&&this.f.Fc(Fr(tvc,etP(e))),i=eIT(tvc,e).Kc();i.Ob();)switch(Ur(QZ(tvc,r=Pp(i.Pb(),170)))){case 4:this.d.Fc(r);break;case 5:this.f.Gc(Yg(QZ(tvc,r)))}else if(_4(),Pp(t,66).Oj())for(o=0,this.e=!0,this.f=null,this.d=new p0,u=(null==e.i&&eNT(e),e.i).length;o=0&&o0&&(Pp(UA(e.b,t),124).a.b=n)}function eF4(e,t){var n,r,i,a,o,s,u,c,l,f,d,h,p,b,m,g;for(ewG(t,"Comment pre-processing",1),n=0,u=new fz(e.a);u.a0&&64!=(u=(GV(0,t.length),t.charCodeAt(0)))){if(37==u&&(f=t.lastIndexOf("%"),c=!1,0!=f&&(f==d-1||(c=(GV(f+1,t.length),46==t.charCodeAt(f+1)))))){if(y=IE("%",o=t.substr(1,f-1))?null:eYy(o),r=0,c)try{r=eDa(t.substr(f+2),eHt,eUu)}catch(w){if(w=eoa(w),M4(w,127))throw s=w,p7(new QH(s));throw p7(w)}for(m=erW(e.Wg());m.Ob();)if(M4(p=eaO(m),510)&&(v=(i=Pp(p,590)).d,(null==y?null==v:IE(y,v))&&0==r--))return i;return null}if(h=-1==(l=t.lastIndexOf("."))?t:t.substr(0,l),n=0,-1!=l)try{n=eDa(t.substr(l+1),eHt,eUu)}catch(_){if(_=eoa(_),M4(_,127))h=t;else throw p7(_)}for(h=IE("%",h)?null:eYy(h),b=erW(e.Wg());b.Ob();)if(M4(p=eaO(b),191)&&(g=(a=Pp(p,191)).ne(),(null==h?null==g:IE(h,g))&&0==n--))return a;return null}return eR2(e,t)}function eF9(e){var t,n,r,i,a,o,s,u,c,l,f,d,h,p,b,m,g,v,y,w,_,E,S,k,x,T,M;for(E=new p0,p=new fz(e.b);p.a=e.length)return{done:!0};var r=e[n++];return{value:[r,t.get(r)],done:!1}}}},eCi()||(e.prototype.createObject=function(){return{}},e.prototype.get=function(e){return this.obj[":"+e]},e.prototype.set=function(e,t){this.obj[":"+e]=t},e.prototype[e$c]=function(e){delete this.obj[":"+e]},e.prototype.keys=function(){var e=[];for(var t in this.obj)58==t.charCodeAt(0)&&e.push(t.substring(1));return e}),e}function eYt(e){var t,n,r,i,a,o,s,u,c,l,f,d,h,p,b,m;if(eNl(),null==e)return null;if(0==(f=8*e.length))return"";for(u=0,s=f%24,h=f/24|0,a=null,a=Je(tyw,eHl,25,4*(d=0!=s?h+1:h),15,1),c=0,l=0,t=0,n=0,r=0,o=0,i=0;u>24,c=(3&t)<<24>>24,p=(-128&t)==0?t>>2<<24>>24:(t>>2^192)<<24>>24,b=(-128&n)==0?n>>4<<24>>24:(n>>4^240)<<24>>24,m=(-128&r)==0?r>>6<<24>>24:(r>>6^252)<<24>>24,a[o++]=tvQ[p],a[o++]=tvQ[b|c<<4],a[o++]=tvQ[l<<2|m],a[o++]=tvQ[63&r];return 8==s?(c=(3&(t=e[i]))<<24>>24,p=(-128&t)==0?t>>2<<24>>24:(t>>2^192)<<24>>24,a[o++]=tvQ[p],a[o++]=tvQ[c<<4],a[o++]=61,a[o++]=61):16==s&&(t=e[i],l=(15&(n=e[i+1]))<<24>>24,c=(3&t)<<24>>24,p=(-128&t)==0?t>>2<<24>>24:(t>>2^192)<<24>>24,b=(-128&n)==0?n>>4<<24>>24:(n>>4^240)<<24>>24,a[o++]=tvQ[p],a[o++]=tvQ[b|c<<4],a[o++]=tvQ[l<<2],a[o++]=61),ehv(a,0,a.length)}function eYn(e,t){var n,r,i,a,o,s,u;if(0==e.e&&e.p>0&&(e.p=-(e.p-1)),e.p>eHt&&V8(t,e.p-eHx),o=t.q.getDate(),zC(t,1),e.k>=0&&z7(t,e.k),e.c>=0?zC(t,e.c):e.k>=0?(r=35-(u=new est(t.q.getFullYear()-eHx,t.q.getMonth(),35)).q.getDate(),zC(t,eB4.Math.min(r,o))):zC(t,o),e.f<0&&(e.f=t.q.getHours()),e.b>0&&e.f<12&&(e.f+=12),M6(t,24==e.f&&e.g?0:e.f),e.j>=0&&Z0(t,e.j),e.n>=0&&Jf(t,e.n),e.i>=0&&xN(t,eft(efn(eyt(eap(t.q.getTime()),eHf),eHf),e.i)),e.a&&(V8(i=new wW,i.q.getFullYear()-eHx-80),Ei(eap(t.q.getTime()),eap(i.q.getTime()))&&V8(t,i.q.getFullYear()-eHx+100)),e.d>=0){if(-1==e.c)(n=(7+e.d-t.q.getDay())%7)>3&&(n-=7),s=t.q.getMonth(),zC(t,t.q.getDate()+n),t.q.getMonth()!=s&&zC(t,t.q.getDate()+(n>0?-7:7));else if(t.q.getDay()!=e.d)return!1}return e.o>eHt&&(a=t.q.getTimezoneOffset(),xN(t,eft(eap(t.q.getTime()),(e.o-a)*60*eHf))),!0}function eYr(e,t){var n,r,i,a,o,s,u,c,l,f,d,h,p,b,m,g,v,y,w;if(i=e_k(t,(eBU(),tnc)),M4(i,239)){for(p=Pp(i,33),b=t.e,d=new TS(t.c),a=t.d,d.a+=a.b,d.b+=a.d,w=Pp(eT9(p,(eBy(),ta8)),174),Aa(w,(eI3(),tbJ))&&(h=Pp(eT9(p,ta7),116),lR(h,a.a),lG(h,a.d),lj(h,a.b),lW(h,a.c)),n=new p0,l=new fz(t.a);l.a0&&P_(e.p,f),P_(e.o,f);t-=r,p=u+t,l+=t*e.e,q1(e.a,s,ell(p)),q1(e.b,s,l),e.j=eB4.Math.max(e.j,p),e.k=eB4.Math.max(e.k,l),e.d+=t,t+=m}}function eYu(){var e;eYu=A,tbF=new kS(ezo,0),tbw=new kS(ezb,1),tby=new kS(ezm,2),tbj=new kS(ezg,3),tbY=new kS(ezv,4),tbx=(Hj(),new vd((e=Pp(yw(e5a),9),new I1(e,Pp(CY(e,e.length),9),0)))),tbT=ecO(jL(tbw,eow(vx(e5a,1),eGj,61,0,[]))),tb_=ecO(jL(tby,eow(vx(e5a,1),eGj,61,0,[]))),tbN=ecO(jL(tbj,eow(vx(e5a,1),eGj,61,0,[]))),tbR=ecO(jL(tbY,eow(vx(e5a,1),eGj,61,0,[]))),tbC=ecO(jL(tbw,eow(vx(e5a,1),eGj,61,0,[tbj]))),tbk=ecO(jL(tby,eow(vx(e5a,1),eGj,61,0,[tbY]))),tbD=ecO(jL(tbw,eow(vx(e5a,1),eGj,61,0,[tbY]))),tbM=ecO(jL(tbw,eow(vx(e5a,1),eGj,61,0,[tby]))),tbP=ecO(jL(tbj,eow(vx(e5a,1),eGj,61,0,[tbY]))),tbE=ecO(jL(tby,eow(vx(e5a,1),eGj,61,0,[tbj]))),tbL=ecO(jL(tbw,eow(vx(e5a,1),eGj,61,0,[tby,tbY]))),tbS=ecO(jL(tby,eow(vx(e5a,1),eGj,61,0,[tbj,tbY]))),tbI=ecO(jL(tbw,eow(vx(e5a,1),eGj,61,0,[tbj,tbY]))),tbO=ecO(jL(tbw,eow(vx(e5a,1),eGj,61,0,[tby,tbj]))),tbA=ecO(jL(tbw,eow(vx(e5a,1),eGj,61,0,[tby,tbj,tbY])))}function eYc(e,t){var n,r,i,a,o,s,u,c,l,f,d,h,p,b,m,g,v,y;if(0!=t.b){for(h=new _n,s=null,p=null,r=zy(eB4.Math.floor(eB4.Math.log(t.b)*eB4.Math.LOG10E)+1),u=0,y=epL(t,0);y.b!=y.d.c;)for(g=Pp(Vv(y),86),xc(p)!==xc(e_k(g,(eR5(),tca)))&&(p=Lq(e_k(g,tca)),u=0),eo3(g,tca,s=null!=p?p+WB(u++,r):WB(u++,r)),m=(i=epL(new hz(g).a.d,0),new hG(i));yV(m.a);)qQ(h,b=Pp(Vv(m.a),188).c,h.c.b,h.c),eo3(b,tca,s);for(o=0,d=new p2;o=u){A5(g.b>0),g.a.Xb(g.c=--g.b);break}b.a>c&&(i?(eoc(i.b,b.b),i.a=eB4.Math.max(i.a,b.a),BH(g)):(P_(b.b,f),b.c=eB4.Math.min(b.c,c),b.a=eB4.Math.max(b.a,u),i=b))}i||((i=new mi).c=c,i.a=u,CD(g,i),P_(i.b,f))}for(s=t.b,l=0,m=new fz(r);m.as?1:0:(e.b&&(e.b._b(a)&&(i=Pp(e.b.xc(a),19).a),e.b._b(u)&&(s=Pp(e.b.xc(u),19).a)),is?1:0);return 0!=t.e.c.length&&0!=n.g.c.length?1:-1}function eYd(e,t){var n,r,i,a,o,s,u,c,l,f,d,h,p,b,m,g,v,y,w,_,E,S;for(ewG(t,eWo,1),b=new p0,E=new p0,c=new fz(e.b);c.a0&&(w-=p),eRU(o,w),f=0,h=new fz(o.a);h.a0),s.a.Xb(s.c=--s.b)),u=.4*r*f,!a&&s.bt.d.c){if((p=e.c[t.a.d])==(g=e.c[d.a.d]))continue;eAx(_f(_l(_d(_c(new bQ,1),100),p),g))}}}}}}function eYy(e){var t,n,r,i,a,o,s,u;if(eRe(),null==e)return null;if((i=x7(e,e_n(37)))<0)return e;for(u=new O0(e.substr(0,i)),t=Je(tyk,eZ9,25,4,15,1),s=0,r=0,o=e.length;ii+2&&eoV((GV(i+1,e.length),e.charCodeAt(i+1)),tmZ,tmX)&&eoV((GV(i+2,e.length),e.charCodeAt(i+2)),tmZ,tmX)){if(n=P0((GV(i+1,e.length),e.charCodeAt(i+1)),(GV(i+2,e.length),e.charCodeAt(i+2))),i+=2,r>0?(192&n)==128?t[s++]=n<<24>>24:r=0:n>=128&&((224&n)==192?(t[s++]=n<<24>>24,r=2):(240&n)==224?(t[s++]=n<<24>>24,r=3):(248&n)==240&&(t[s++]=n<<24>>24,r=4)),r>0){if(s==r){switch(s){case 2:Bd(u,((31&t[0])<<6|63&t[1])&eHd);break;case 3:Bd(u,((15&t[0])<<12|(63&t[1])<<6|63&t[2])&eHd)}s=0,r=0}}else{for(a=0;a0){if(o+r>e.length)return!1;s=exf(e.substr(0,o+r),t)}else s=exf(e,t)}switch(a){case 71:return s=ew5(e,o,eow(vx(e17,1),eUP,2,6,[eHM,eHO]),t),i.e=s,!0;case 77:return eLY(e,t,i,s,o);case 76:return eLB(e,t,i,s,o);case 69:return eS$(e,t,o,i);case 99:return eSz(e,t,o,i);case 97:return s=ew5(e,o,eow(vx(e17,1),eUP,2,6,["AM","PM"]),t),i.b=s,!0;case 121:return eLU(e,t,o,s,n,i);case 100:if(s<=0)return!1;return i.c=s,!0;case 83:if(s<0)return!1;return edc(s,o,t[0],i);case 104:12==s&&(s=0);case 75:case 72:if(s<0)return!1;return i.f=s,i.g=!1,!0;case 107:if(s<0)return!1;return i.f=s,i.g=!0,!0;case 109:if(s<0)return!1;return i.j=s,!0;case 115:if(s<0)return!1;return i.n=s,!0;case 90:if(oE&&(p.c=E-p.b),P_(o.d,new jH(p,elO(o,p))),v=t==tbw?eB4.Math.max(v,b.b+c.b.rf().b):eB4.Math.min(v,b.b));for(v+=t==tbw?e.t:-e.t,(y=edp((o.e=v,o)))>0&&(Pp(UA(e.b,t),124).a.b=y),l=d.Kc();l.Ob();)(c=Pp(l.Pb(),111)).c&&!(c.c.d.c.length<=0)&&(p=c.c.i,p.c-=c.e.a,p.d-=c.e.b)}function eYE(e){var t,n,r,i,a,o,s,u,l,f,d,h,p;for(t=new p2,u=new Ow(e);u.e!=u.i.gc();){for(s=Pp(epH(u),33),n=new bV,Um(e8t,s,n),p=new e6,i=Pp(qE(new R1(null,new YI(new Fa(OH(eOr(s).a.Kc(),new c)))),jD(p,JF(new U,new B,new en,eow(vx(e2L,1),eU4,132,0,[(eum(),e2U)])))),83),enC(n,Pp(i.xc((OQ(),!0)),14),new e5),o=(r=Pp(qE(UJ(Pp(i.xc(!1),15).Lc(),new e8),JF(new U,new B,new en,eow(vx(e2L,1),eU4,132,0,[e2U]))),15)).Kc();o.Ob();)(h=e_D(a=Pp(o.Pb(),79)))&&((l=Pp(xu($I(t.f,h)),21))||(l=eA7(h),eS8(t.f,h,l)),er7(n,l));for(i=Pp(qE(new R1(null,new YI(new Fa(OH(eOi(s).a.Kc(),new c)))),jD(p,JF(new U,new B,new en,eow(vx(e2L,1),eU4,132,0,[e2U])))),83),enC(n,Pp(i.xc(!0),14),new e9),d=(r=Pp(qE(UJ(Pp(i.xc(!1),15).Lc(),new e7),JF(new U,new B,new en,eow(vx(e2L,1),eU4,132,0,[e2U]))),15)).Kc();d.Ob();)(h=e_N(f=Pp(d.Pb(),79)))&&((l=Pp(xu($I(t.f,h)),21))||(l=eA7(h),eS8(t.f,h,l)),er7(n,l))}}function eYS(e,t){var n,r,i,a,o,s,u,c,l,f,d,h,p,b;if(ePN(),(u=0>ecd(e,0))&&(e=QC(e)),0==ecd(e,0))switch(t){case 0:return"0";case 1:return e$e;case 2:return"0.00";case 3:return"0.000";case 4:return"0.0000";case 5:return"0.00000";case 6:return"0.000000";default:return h=new vc,t<0?(h.a+="0E+",h):(h.a+="0E",h),h.a+=t==eHt?"2147483648":""+-t,h.a}f=Je(tyw,eHl,25,(l=18)+1,15,1),n=l,b=e;do c=b,b=eyt(b,10),f[--n]=jE(eft(48,efe(c,efn(b,10))))&eHd;while(0!=ecd(b,0))if(i=efe(efe(efe(l,n),t),1),0==t)return u&&(f[--n]=45),ehv(f,n,l-n);if(t>0&&ecd(i,-6)>=0){if(ecd(i,0)>=0){for(a=n+jE(i),s=l-1;s>=a;s--)f[s+1]=f[s];return f[++a]=46,u&&(f[--n]=45),ehv(f,n,l-n+1)}for(o=2;Ei(o,eft(QC(i),1));o++)f[--n]=48;return f[--n]=46,f[--n]=48,u&&(f[--n]=45),ehv(f,n,l-n)}return p=n+1,r=l,d=new vl,u&&(d.a+="-"),r-p>=1?(Bd(d,f[n]),d.a+=".",d.a+=ehv(f,n+1,l-n-1)):d.a+=ehv(f,n,l-n),d.a+="E",ecd(i,0)>0&&(d.a+="+"),d.a+=""+Fb(i),d.a}function eYk(e,t,n){var r,i,a,o,s,u,c,l,f,d,h;if(e.e.a.$b(),e.f.a.$b(),e.c.c=Je(e1R,eUp,1,0,5,1),e.i.c=Je(e1R,eUp,1,0,5,1),e.g.a.$b(),t)for(o=new fz(t.a);o.a=1&&(_-c>0&&p>=0?(eno(f,f.i+w),ens(f,f.j+u*c)):_-c<0&&h>=0&&(eno(f,f.i+w*_),ens(f,f.j+u)));return ebu(e,(eBB(),thx),(ed5(),a=Pp(yw(e5o),9),new I1(a,Pp(CY(a,a.length),9),0))),new kl(E,l)}function eYT(e){var t,n,r,i,a,o,s,u,c,l,f,d,h,p;if(h=z$(ewH(Pp(etj((e.b||(e.b=new Ih(e5m,e,4,7)),e.b),0),82))),p=z$(ewH(Pp(etj((e.c||(e.c=new Ih(e5m,e,5,8)),e.c),0),82))),f=h==p,s=new yb,(t=Pp(eT9(e,(euw(),tpj)),74))&&t.b>=2){if(0==(e.a||(e.a=new FQ(e5v,e,6,6)),e.a).i)n=(yT(),i=new oQ),JL((e.a||(e.a=new FQ(e5v,e,6,6)),e.a),n);else if((e.a||(e.a=new FQ(e5v,e,6,6)),e.a).i>1)for(d=new AF((e.a||(e.a=new FQ(e5v,e,6,6)),e.a));d.e!=d.i.gc();)ey_(d);eNI(t,Pp(etj((e.a||(e.a=new FQ(e5v,e,6,6)),e.a),0),202))}if(f)for(r=new Ow((e.a||(e.a=new FQ(e5v,e,6,6)),e.a));r.e!=r.i.gc();)for(n=Pp(epH(r),202),c=new Ow((n.a||(n.a=new O_(e5h,n,5)),n.a));c.e!=c.i.gc();)u=Pp(epH(c),469),s.a=eB4.Math.max(s.a,u.a),s.b=eB4.Math.max(s.b,u.b);for(o=new Ow((e.n||(e.n=new FQ(e5S,e,1,7)),e.n));o.e!=o.i.gc();)a=Pp(epH(o),137),(l=Pp(eT9(a,tp$),8))&&TP(a,l.a,l.b),f&&(s.a=eB4.Math.max(s.a,a.i+a.g),s.b=eB4.Math.max(s.b,a.j+a.f));return s}function eYM(e,t,n){var r,i,a,o,s,u,c,l,f,d,h,p,b,m,g,v,y,w,_,E,k,x;for(s=0,y=t.c.length,i=new eIW(e.a,n,null,null),x=Je(tyx,eH6,25,y,15,1),b=Je(tyx,eH6,25,y,15,1),p=Je(tyx,eH6,25,y,15,1),m=0;sx[u]&&(m=u),f=new fz(e.a.b);f.ah&&(a&&(xL(E,d),xL(k,ell(c.b-1))),A=n.b,L+=d+t,d=0,l=eB4.Math.max(l,n.b+n.c+O)),eno(s,A),ens(s,L),l=eB4.Math.max(l,A+O+n.c),d=eB4.Math.max(d,f),A+=O+t;if(l=eB4.Math.max(l,r),(M=L+d+n.a)ez9,x=eB4.Math.abs(d.b-p.b)>ez9,(!n&&k&&x||n&&(k||x))&&P7(m.a,w)),er7(m.a,r),d=0==r.b?w:(A5(0!=r.b),Pp(r.c.b.c,8)),ea1(h,f,b),eiy(i)==S&&(Bq(S.i)!=i.a&&eSb(b=new yb,Bq(S.i),v),eo3(m,tnC,b)),eEw(h,m,v),l.a.zc(h,l);Gs(m,_),Go(m,S)}for(c=l.a.ec().Kc();c.Ob();)Gs(u=Pp(c.Pb(),17),null),Go(u,null);eEj(t)}function eYC(e){var t,n,r,i,a,o,s,u,c,l,f,d,h,p,b,m,g,v,y,w;if(1==e.gc())return Pp(e.Xb(0),231);if(0>=e.gc())return new Z6;for(i=e.Kc();i.Ob();){for(n=Pp(i.Pb(),231),p=0,l=eUu,f=eUu,u=eHt,c=eHt,h=new fz(n.e);h.as&&(y=0,w+=o+g,o=0),eIJ(b,n,y,w),t=eB4.Math.max(t,y+m.a),o=eB4.Math.max(o,m.b),y+=m.a+g;return b}function eYI(e,t){var n,r,i,a,o,s,u,c,l,f,d,h,p;switch(l=new mE,e.a.g){case 3:d=Pp(e_k(t.e,(eBU(),tnO)),15),h=Pp(e_k(t.j,tnO),15),p=Pp(e_k(t.f,tnO),15),n=Pp(e_k(t.e,tnT),15),r=Pp(e_k(t.j,tnT),15),i=Pp(e_k(t.f,tnT),15),o=new p0,eoc(o,d),h.Jc(new iN),eoc(o,M4(h,152)?ZK(Pp(h,152)):M4(h,131)?Pp(h,131).a:M4(h,54)?new gn(h):new w$(h)),eoc(o,p),a=new p0,eoc(a,n),eoc(a,M4(r,152)?ZK(Pp(r,152)):M4(r,131)?Pp(r,131).a:M4(r,54)?new gn(r):new w$(r)),eoc(a,i),eo3(t.f,tnO,o),eo3(t.f,tnT,a),eo3(t.f,tnA,t.f),eo3(t.e,tnO,null),eo3(t.e,tnT,null),eo3(t.j,tnO,null),eo3(t.j,tnT,null);break;case 1:er7(l,t.e.a),P7(l,t.i.n),er7(l,eaa(t.j.a)),P7(l,t.a.n),er7(l,t.f.a);break;default:er7(l,t.e.a),er7(l,eaa(t.j.a)),er7(l,t.f.a)}HC(t.f.a),er7(t.f.a,l),Gs(t.f,t.e.c),s=Pp(e_k(t.e,(eBy(),taR)),74),c=Pp(e_k(t.j,taR),74),u=Pp(e_k(t.f,taR),74),(s||c||u)&&(Yp(f=new mE,u),Yp(f,c),Yp(f,s),eo3(t.f,taR,f)),Gs(t.j,null),Go(t.j,null),Gs(t.e,null),Go(t.e,null),Gu(t.a,null),Gu(t.i,null),t.g&&eYI(e,t.g)}function eYD(e){var t,n,r,i,a,o,s,u,c,l,f,d,h,p,b,m;if(eNl(),null==e||(a=Q4(e),(p=elw(a))%4!=0))return null;if(0==(b=p/4|0))return Je(tyk,eZ9,25,0,15,1);for(f=null,t=0,n=0,r=0,i=0,o=0,s=0,u=0,c=0,h=0,d=0,l=0,f=Je(tyk,eZ9,25,3*b,15,1);h>4)<<24>>24,f[d++]=((15&n)<<4|r>>2&15)<<24>>24,f[d++]=(r<<6|i)<<24>>24}if(!wl(o=a[l++])||!wl(s=a[l++]))return null;if(t=tvJ[o],n=tvJ[s],u=a[l++],c=a[l++],-1==tvJ[u]||-1==tvJ[c])return 61==u&&61==c?(15&n)!=0?null:(m=Je(tyk,eZ9,25,3*h+1,15,1),ePD(f,0,m,0,3*h),m[d]=(t<<2|n>>4)<<24>>24,m):61==u||61!=c?null:(3&(r=tvJ[u]))!=0?null:(m=Je(tyk,eZ9,25,3*h+2,15,1),ePD(f,0,m,0,3*h),m[d++]=(t<<2|n>>4)<<24>>24,m[d]=((15&n)<<4|r>>2&15)<<24>>24,m);return r=tvJ[u],i=tvJ[c],f[d++]=(t<<2|n>>4)<<24>>24,f[d++]=((15&n)<<4|r>>2&15)<<24>>24,f[d++]=(r<<6|i)<<24>>24,f}function eYN(e,t){var n,r,i,a,o,s,u,c,l,f,d,h,p,b,m,g,v,y,w,_;for(ewG(t,eWo,1),p=Pp(e_k(e,(eBy(),tag)),218),i=new fz(e.b);i.a=2){for(b=!0,n=Pp(Wx(d=new fz(a.j)),11),h=null;d.a0&&(i=Pp(RJ(m.c.a,E-1),10),o=e.i[i.p],k=eB4.Math.ceil(Mj(e.n,i,m)),a=_.a.e-m.d.d-(o.a.e+i.o.b+i.d.a)-k),c=eHQ,E0&&S.a.e.e-S.a.a-(S.b.e.e-S.b.a)<0,p=y.a.e.e-y.a.a-(y.b.e.e-y.b.a)<0&&S.a.e.e-S.a.a-(S.b.e.e-S.b.a)>0,h=y.a.e.e+y.b.aS.b.e.e+S.a.a,w=0,!b&&!p&&(d?a+f>0?w=f:c-r>0&&(w=r):h&&(a+s>0?w=s:c-v>0&&(w=v))),_.a.e+=w,_.b&&(_.d.e+=w),!1))}function eYR(e,t,n){var r,i,a,o,s,u,c,l,f,d;if(r=new Hr(t.qf().a,t.qf().b,t.rf().a,t.rf().b),i=new TE,e.c)for(o=new fz(t.wf());o.ac&&(r.a+=M3(Je(tyw,eHl,25,-c,15,1))),r.a+="Is",x7(u,e_n(32))>=0)for(i=0;i=r.o.b/2}v?(g=Pp(e_k(r,(eBU(),tnI)),15))?d?a=g:(i=Pp(e_k(r,ttB),15))?a=g.gc()<=i.gc()?g:i:(a=new p0,eo3(r,ttB,a)):(a=new p0,eo3(r,tnI,a)):(i=Pp(e_k(r,(eBU(),ttB)),15))?f?a=i:(g=Pp(e_k(r,tnI),15))?a=i.gc()<=g.gc()?i:g:(a=new p0,eo3(r,tnI,a)):(a=new p0,eo3(r,ttB,a)),a.Fc(e),eo3(e,(eBU(),ttH),n),t.d==n?(Go(t,null),n.e.c.length+n.g.c.length==0&&Gc(n,null),esQ(n)):(Gs(t,null),n.e.c.length+n.g.c.length==0&&Gc(n,null)),HC(t.a)}function eYH(e,t){var n,r,i,a,o,s,u,l,f,d,h,p,b,m,g,v,y,w,_,E,S,k,x,T,M,O,A,L;for(y=new KB(e.b,0),f=t.Kc(),b=0,l=Pp(f.Pb(),19).a,E=0,n=new bV,k=new Tw;y.b=e.a&&(r=eN3(e,y),f=eB4.Math.max(f,r.b),_=eB4.Math.max(_,r.d),P_(s,new kD(y,r)));for(l=0,x=new p0;l0),g.a.Xb(g.c=--g.b),T=new By(e.b),CD(g,T),A5(g.b0?(c=0,m&&(c+=s),c+=(x-1)*o,y&&(c+=s),k&&y&&(c=eB4.Math.max(c,eAD(y,o,v,S))),!(c0){for(i=0,d=l<100?null:new yf(l),p=(c=new eiP(t)).g,g=Je(ty_,eHT,25,l,15,1),r=0,w=new eta(l);i=0;)if(null!=h?ecX(h,p[u]):xc(h)===xc(p[u])){g.length<=r&&(m=g,g=Je(ty_,eHT,25,2*g.length,15,1),ePD(m,0,g,0,r)),g[r++]=i,JL(w,p[u]);break v}if(xc(h)===xc(s))break}}if(c=w,p=w.g,l=r,r>g.length&&(m=g,g=Je(ty_,eHT,25,r,15,1),ePD(m,0,g,0,r)),r>0){for(a=0,y=!0;a=0;)egk(e,g[o]);if(r!=l){for(i=l;--i>=r;)egk(c,i);m=g,g=Je(ty_,eHT,25,r,15,1),ePD(m,0,g,0,r)}t=c}}}else for(t=egh(e,t),i=e.i;--i>=0;)t.Hc(e.g[i])&&(egk(e,i),y=!0);if(!y)return!1;if(null!=g){for(f=1==(n=t.gc())?Gt(e,4,t.Kc().Pb(),null,g[0],b):Gt(e,6,t,g,g[0],b),d=n<100?null:new yf(n),i=t.Kc();i.Ob();)d=IW(e,Pp(h=i.Pb(),72),d);d?(d.Ei(f),d.Fi()):eam(e.e,f)}else{for(d=IP(t.gc()),i=t.Kc();i.Ob();)d=IW(e,Pp(h=i.Pb(),72),d);d&&d.Fi()}return!0}function eYV(e,t){var n,r,i,a,o,s,u,l,f,d,h,p,b,m,g,v,y,w;for((n=new eb_(t)).a||eDc(t),l=eCx(t),u=new zu,g=new eLy,m=new fz(t.a);m.a0||n.o==tuS&&i0?(f=Pp(RJ(d.c.a,o-1),10),k=Mj(e.b,d,f),m=d.n.b-d.d.d-(f.n.b+f.o.b+f.d.a+k)):m=d.n.b-d.d.d,c=eB4.Math.min(m,c),oo?eIc(e,t,n):eIc(e,n,t),io?1:0}return r=Pp(e_k(t,(eBU(),tnu)),19).a,a=Pp(e_k(n,tnu),19).a,r>a?eIc(e,t,n):eIc(e,n,t),ra?1:0}function eYQ(e,t,n,r){var i,a,o,s,u,c,l,f,d,h,p,b,m,g,v;if(gN(LK(eT9(t,(eBB(),thI))))||(c=0!=(t.a||(t.a=new FQ(e5k,t,10,11)),t.a).i,l=!(f=ekq(t)).dc(),!c&&!l))return Hj(),Hj(),e2r;if(!(i=Pp(eT9(t,th5),149)))throw p7(new gq("Resolved algorithm is not set; apply a LayoutAlgorithmResolver before computing layout."));if(v=ka(i,(eTy(),tmC)),ept(t),!c&&l&&!v)return Hj(),Hj(),e2r;if(u=new p0,xc(eT9(t,thl))===xc((eck(),tpz))&&(ka(i,tmO)||ka(i,tmM)))for(h=eCL(e,t),er7(p=new _n,(t.a||(t.a=new FQ(e5k,t,10,11)),t.a));0!=p.b;)ept(d=Pp(0==p.b?null:(A5(0!=p.b),etw(p,p.a.a)),33)),(g=xc(eT9(d,thl))===xc(tpW))||X2(d,tdQ)&&!Zs(i,eT9(d,th5))?(s=eYQ(e,d,n,r),eoc(u,s),ebu(d,thl,tpW),eIU(d)):er7(p,(d.a||(d.a=new FQ(e5k,d,10,11)),d.a));else for(h=(t.a||(t.a=new FQ(e5k,t,10,11)),t.a).i,o=new Ow((t.a||(t.a=new FQ(e5k,t,10,11)),t.a));o.e!=o.i.gc();)a=Pp(epH(o),33),s=eYQ(e,a,n,r),eoc(u,s),eIU(a);for(m=new fz(u);m.a=0?ef8(s):elC(ef8(s)),e.Ye(tob,h)),c=new yb,d=!1,e.Xe(tou)?(Lf(c,Pp(e.We(tou),8)),d=!0):Oc(c,o.a/2,o.b/2),h.g){case 4:eo3(l,taY,(ef_(),tnN)),eo3(l,ttV,(eoG(),te0)),l.o.b=o.b,b<0&&(l.o.a=-b),ekv(f,(eYu(),tby)),d||(c.a=o.a),c.a-=o.a;break;case 2:eo3(l,taY,(ef_(),tnR)),eo3(l,ttV,(eoG(),teQ)),l.o.b=o.b,b<0&&(l.o.a=-b),ekv(f,(eYu(),tbY)),d||(c.a=0);break;case 1:eo3(l,tt8,(Q1(),ttN)),l.o.a=o.a,b<0&&(l.o.b=-b),ekv(f,(eYu(),tbj)),d||(c.b=o.b),c.b-=o.b;break;case 3:eo3(l,tt8,(Q1(),ttI)),l.o.a=o.a,b<0&&(l.o.b=-b),ekv(f,(eYu(),tbw)),d||(c.b=0)}if(Lf(f.n,c),eo3(l,tou,c),t==tba||t==tbs||t==tbo){if(p=0,t==tba&&e.Xe(tof))switch(h.g){case 1:case 2:p=Pp(e.We(tof),19).a;break;case 3:case 4:p=-Pp(e.We(tof),19).a}else switch(h.g){case 4:case 2:p=a.b,t==tbs&&(p/=i.b);break;case 1:case 3:p=a.a,t==tbs&&(p/=i.a)}eo3(l,tnv,p)}return eo3(l,tt1,h),l}function eY0(e){var t,n,r,i,a,o,s,u,l,f,d,h,p,b,m,g,v,y,w,_,E,S,k,x,T;if((n=gP(LV(e_k(e.a.j,(eBy(),tar)))))<-1||!e.a.i||IR(Pp(e_k(e.a.o,tol),98))||2>efr(e.a.o,(eYu(),tby)).gc()&&2>efr(e.a.o,tbY).gc())return!0;if(e.a.c.Rf())return!1;for(E=0,_=0,w=new p0,u=e.a.e,l=0,f=u.length;l=n}function eY2(){function n(e){var t=this;this.dispatch=function(t){var n=t.data;switch(n.cmd){case"algorithms":var r=edh((Hj(),new fF(new fT(tmF.b))));e.postMessage({id:n.id,data:r});break;case"categories":var i=edh((Hj(),new fF(new fT(tmF.c))));e.postMessage({id:n.id,data:i});break;case"options":var a=edh((Hj(),new fF(new fT(tmF.d))));e.postMessage({id:n.id,data:a});break;case"register":ejy(n.algorithms),e.postMessage({id:n.id});break;case"layout":ePu(n.graph,n.layoutOptions||{},n.options||{}),e.postMessage({id:n.id,data:n.graph})}},this.saveDispatch=function(n){try{t.dispatch(n)}catch(r){e.postMessage({id:n.data.id,error:r})}}}function r(e){var t=this;this.dispatcher=new n({postMessage:function(e){t.onmessage({data:e})}}),this.postMessage=function(e){setTimeout(function(){t.dispatcher.saveDispatch({data:e})},0)}}if(yC(),typeof document===e$E&&typeof self!==e$E){var i=new n(self);self.onmessage=i.saveDispatch}else"object"!==e$E&&e.exports&&(Object.defineProperty(t,"__esModule",{value:!0}),e.exports={default:r,Worker:r})}function eY3(e){e.N||(e.N=!0,e.b=eak(e,0),er5(e.b,0),er5(e.b,1),er5(e.b,2),e.bb=eak(e,1),er5(e.bb,0),er5(e.bb,1),e.fb=eak(e,2),er5(e.fb,3),er5(e.fb,4),er8(e.fb,5),e.qb=eak(e,3),er5(e.qb,0),er8(e.qb,1),er8(e.qb,2),er5(e.qb,3),er5(e.qb,4),er8(e.qb,5),er5(e.qb,6),e.a=eax(e,4),e.c=eax(e,5),e.d=eax(e,6),e.e=eax(e,7),e.f=eax(e,8),e.g=eax(e,9),e.i=eax(e,10),e.j=eax(e,11),e.k=eax(e,12),e.n=eax(e,13),e.o=eax(e,14),e.p=eax(e,15),e.q=eax(e,16),e.s=eax(e,17),e.r=eax(e,18),e.t=eax(e,19),e.u=eax(e,20),e.v=eax(e,21),e.w=eax(e,22),e.B=eax(e,23),e.A=eax(e,24),e.C=eax(e,25),e.D=eax(e,26),e.F=eax(e,27),e.G=eax(e,28),e.H=eax(e,29),e.J=eax(e,30),e.I=eax(e,31),e.K=eax(e,32),e.M=eax(e,33),e.L=eax(e,34),e.P=eax(e,35),e.Q=eax(e,36),e.R=eax(e,37),e.S=eax(e,38),e.T=eax(e,39),e.U=eax(e,40),e.V=eax(e,41),e.X=eax(e,42),e.W=eax(e,43),e.Y=eax(e,44),e.Z=eax(e,45),e.$=eax(e,46),e._=eax(e,47),e.ab=eax(e,48),e.cb=eax(e,49),e.db=eax(e,50),e.eb=eax(e,51),e.gb=eax(e,52),e.hb=eax(e,53),e.ib=eax(e,54),e.jb=eax(e,55),e.kb=eax(e,56),e.lb=eax(e,57),e.mb=eax(e,58),e.nb=eax(e,59),e.ob=eax(e,60),e.pb=eax(e,61))}function eY4(e,t){var n,r,i,a,o,s,u,c,l,f,d,h,p,b,m,g,v,y,w;if(v=0,0==t.f.a)for(m=new fz(e);m.ac&&0==(GK(c,t.c.length),Pp(t.c[c],200)).a.c.length;)QA(t,(GK(c,t.c.length),t.c[c]));if(!u){--a;continue}if(eDk(t,l,i,u,d,n,c,r)){f=!0;continue}if(d){if(ePx(t,l,i,u,n,c,r)){f=!0;continue}if(eu4(l,i)){i.c=!0,f=!0;continue}}else if(eu4(l,i)){i.c=!0,f=!0;continue}if(f)continue}if(eu4(l,i)){i.c=!0,f=!0,u&&(u.k=!1);continue}emG(i.q)}return f}function eY8(e,t,n,r,i,a,o){var s,u,c,l,f,d,h,p,b,m,g,v,y,w,_,E,S,k,x,T,M,O,A,L;for(b=0,T=0,c=new fz(e.b);c.ab&&(a&&(xL(E,h),xL(k,ell(l.b-1)),P_(e.d,p),s.c=Je(e1R,eUp,1,0,5,1)),A=n.b,L+=h+t,h=0,f=eB4.Math.max(f,n.b+n.c+O)),s.c[s.c.length]=u,epW(u,A,L),f=eB4.Math.max(f,A+O+n.c),h=eB4.Math.max(h,d),A+=O+t,p=u;if(eoc(e.a,s),P_(e.d,Pp(RJ(s,s.c.length-1),157)),f=eB4.Math.max(f,r),(M=L+h+n.a)1&&(o=eB4.Math.min(o,eB4.Math.abs(Pp(ep3(s.a,1),8).b-l.b)))));else for(b=new fz(t.j);b.ai&&(a=d.a-i,o=eUu,r.c=Je(e1R,eUp,1,0,5,1),i=d.a),d.a>=i&&(r.c[r.c.length]=s,s.a.b>1&&(o=eB4.Math.min(o,eB4.Math.abs(Pp(ep3(s.a,s.a.b-2),8).b-d.b)))));if(0!=r.c.length&&a>t.o.a/2&&o>t.o.b/2){for(h=new eES,Gc(h,t),ekv(h,(eYu(),tbw)),h.n.a=t.o.a/2,g=new eES,Gc(g,t),ekv(g,tbj),g.n.a=t.o.a/2,g.n.b=t.o.b,u=new fz(r);u.a=c.b?Gs(s,g):Gs(s,h)):(c=Pp(P$(s.a),8),(m=0==s.a.b?GX(s.c):Pp(AZ(s.a),8)).b>=c.b?Go(s,g):Go(s,h)),(f=Pp(e_k(s,(eBy(),taR)),74))&&eds(f,c,!0);t.n.a=i-t.o.a/2}}function eBe(e,t,n){var r,i,a,o,s,u,c,l,f,d,h,p,b,m,g,v,y,w,_,E,S,k,x,T,M,O,A,L,C,I;if(T=null,O=t,M=V0(e,VF(n),O),ert(M,KJ(O,eXS)),A=Pp(etJ(e.g,ekZ(zR(O,eXi))),33),d=zR(O,"sourcePort"),r=null,d&&(r=ekZ(d)),L=Pp(etJ(e.j,r),118),!A)throw b=(p="An edge must have a source node (edge id: '"+(s=ehM(O)))+eXO,p7(new gK(b));if(L&&!BG(zY(L),A))throw g=(m="The source port of an edge must be a port of the edge's source node (edge id: '"+(u=KJ(O,eXS)))+eXO,p7(new gK(g));if(k=(M.b||(M.b=new Ih(e5m,M,4,7)),M.b),a=null,JL(k,a=L||A),C=Pp(etJ(e.g,ekZ(zR(O,eXC))),33),h=zR(O,"targetPort"),i=null,h&&(i=ekZ(h)),I=Pp(etJ(e.j,i),118),!C)throw y=(v="An edge must have a target node (edge id: '"+(f=ehM(O)))+eXO,p7(new gK(y));if(I&&!BG(zY(I),C))throw _=(w="The target port of an edge must be a port of the edge's target node (edge id: '"+(c=KJ(O,eXS)))+eXO,p7(new gK(_));if(x=(M.c||(M.c=new Ih(e5m,M,5,8)),M.c),o=null,JL(x,o=I||C),0==(M.b||(M.b=new Ih(e5m,M,4,7)),M.b).i||0==(M.c||(M.c=new Ih(e5m,M,5,8)),M.c).i)throw S=(E=eXM+(l=KJ(O,eXS)))+eXO,p7(new gK(S));return ewU(O,M),eMu(O,M),T=esv(e,O,M)}function eBt(e,t){var n,r,i,a,o,s,u,c,l,f,d,h,p,b,m,g,v,y,w,_,E,S,k,x,T;return f=eNf(A_(e,(eYu(),tbx)),t),p=em8(A_(e,tbT),t),w=em8(A_(e,tbN),t),k=em9(A_(e,tbR),t),d=em9(A_(e,tb_),t),v=em8(A_(e,tbD),t),b=em8(A_(e,tbM),t),E=em8(A_(e,tbP),t),_=em8(A_(e,tbE),t),x=em9(A_(e,tbk),t),g=em8(A_(e,tbC),t),y=em8(A_(e,tbL),t),S=em8(A_(e,tbS),t),T=em9(A_(e,tbI),t),h=em9(A_(e,tbO),t),m=em8(A_(e,tbA),t),n=esm(eow(vx(tyx,1),eH6,25,15,[v.a,k.a,E.a,T.a])),r=esm(eow(vx(tyx,1),eH6,25,15,[p.a,f.a,w.a,m.a])),i=g.a,a=esm(eow(vx(tyx,1),eH6,25,15,[b.a,d.a,_.a,h.a])),c=esm(eow(vx(tyx,1),eH6,25,15,[v.b,p.b,b.b,y.b])),u=esm(eow(vx(tyx,1),eH6,25,15,[k.b,f.b,d.b,m.b])),l=x.b,s=esm(eow(vx(tyx,1),eH6,25,15,[E.b,w.b,_.b,S.b])),JD(A_(e,tbx),n+i,c+l),JD(A_(e,tbA),n+i,c+l),JD(A_(e,tbT),n+i,0),JD(A_(e,tbN),n+i,c+l+u),JD(A_(e,tbR),0,c+l),JD(A_(e,tb_),n+i+r,c+l),JD(A_(e,tbM),n+i+r,0),JD(A_(e,tbP),0,c+l+u),JD(A_(e,tbE),n+i+r,c+l+u),JD(A_(e,tbk),0,c),JD(A_(e,tbC),n,0),JD(A_(e,tbS),0,c+l+u),JD(A_(e,tbO),n+i+r,0),(o=new yb).a=esm(eow(vx(tyx,1),eH6,25,15,[n+r+i+a,x.a,y.a,S.a])),o.b=esm(eow(vx(tyx,1),eH6,25,15,[c+u+l+s,g.b,T.b,h.b])),o}function eBn(e){var t,n,r,i,a,o,s,u,l,f,d,h,p,b,m,g;for(m=new p0,h=new fz(e.d.b);h.ai.d.d+i.d.a?f.f.d=!0:(f.f.d=!0,f.f.a=!0))),r.b!=r.d.c&&(t=n);f&&(a=Pp(Bp(e.f,o.d.i),57),t.ba.d.d+a.d.a?f.f.d=!0:(f.f.d=!0,f.f.a=!0))}for(s=new Fa(OH(efu(p).a.Kc(),new c));eTk(s);)0!=(o=Pp(ZC(s),17)).a.b&&(t=Pp(AZ(o.a),8),o.d.j==(eYu(),tbw)&&((g=new ePe(t,new kl(t.a,i.d.d),i,o)).f.a=!0,g.a=o.d,m.c[m.c.length]=g),o.d.j==tbj&&((g=new ePe(t,new kl(t.a,i.d.d+i.d.a),i,o)).f.d=!0,g.a=o.d,m.c[m.c.length]=g))}return m}function eBr(e,t,n){var r,i,a,o,s,u,c,l,f;if(ewG(n,"Network simplex node placement",1),e.e=t,e.n=Pp(e_k(t,(eBU(),tnx)),304),eRx(e),ey9(e),_r(eeh(new R1(null,new Gq(e.e.b,16)),new i2),new hR(e)),_r(UJ(eeh(UJ(eeh(new R1(null,new Gq(e.e.b,16)),new aa),new ao),new as),new au),new hP(e)),gN(LK(e_k(e.e,(eBy(),taQ))))&&(o=eiI(n,1),ewG(o,"Straight Edges Pre-Processing",1),eFy(e),eEj(o)),ebR(e.f),a=Pp(e_k(t,to$),19).a*e.f.a.c.length,eIX(vC(vI(DN(e.f),a),!1),eiI(n,1)),0!=e.d.a.gc()){for(o=eiI(n,1),ewG(o,"Flexible Where Space Processing",1),s=Pp(Af(FM(UQ(new R1(null,new Gq(e.f.a,16)),new i3),new iZ)),19).a,c=(u=Pp(Af(FT(UQ(new R1(null,new Gq(e.f.a,16)),new i4),new iX)),19).a)-s,l=Al(new b1,e.f),f=Al(new b1,e.f),eAx(_f(_l(_c(_d(new bQ,2e4),c),l),f)),_r(UJ(UJ(Yw(e.i),new i6),new i5),new Hn(s,l,c,f)),i=e.d.a.ec().Kc();i.Ob();)(r=Pp(i.Pb(),213)).g=1;eIX(vC(vI(DN(e.f),a),!1),eiI(o,1)),eEj(o)}gN(LK(e_k(t,taQ)))&&(o=eiI(n,1),ewG(o,"Straight Edges Post-Processing",1),eSf(e),eEj(o)),ej3(e),e.e=null,e.f=null,e.i=null,e.c=null,Yy(e.k),e.j=null,e.a=null,e.o=null,e.d.a.$b(),eEj(n)}function eBi(e,t,n){var r,i,a,o,s,u,c,l,f,d,h,p,b,m,g,v,y,w,_;for(s=new fz(e.a.b);s.a0){if(r=f.gc(),c=zy(eB4.Math.floor((r+1)/2))-1,i=zy(eB4.Math.ceil((r+1)/2))-1,t.o==tuS)for(l=i;l>=c;l--)t.a[w.p]==w&&(b=Pp(f.Xb(l),46),p=Pp(b.a,10),!w0(n,b.b)&&h>e.b.e[p.p]&&(t.a[p.p]=w,t.g[w.p]=t.g[p.p],t.a[w.p]=t.g[w.p],t.f[t.g[w.p].p]=(OQ(),!!(gN(t.f[t.g[w.p].p])&w.k==(eEn(),e9D))),h=e.b.e[p.p]));else for(l=c;l<=i;l++)t.a[w.p]==w&&(g=Pp(f.Xb(l),46),m=Pp(g.a,10),!w0(n,g.b)&&h=p&&(v>p&&(h.c=Je(e1R,eUp,1,0,5,1),p=v),h.c[h.c.length]=o);0!=h.c.length&&(d=Pp(RJ(h,ebO(t,h.c.length)),128),M.a.Bc(d),d.s=b++,eM4(d,x,E),h.c=Je(e1R,eUp,1,0,5,1))}for(w=e.c.length+1,s=new fz(e);s.aT.s&&(BH(n),QA(T.i,r),r.c>0&&(r.a=T,P_(T.t,r),r.b=S,P_(S.i,r)))}function eBs(e){var t,n,r,i,a;switch(t=e.c){case 11:return e.Ml();case 12:return e.Ol();case 14:return e.Ql();case 15:return e.Tl();case 16:return e.Rl();case 17:return e.Ul();case 21:return eBM(e),eBG(),eBG(),tye;case 10:switch(e.a){case 65:return e.yl();case 90:return e.Dl();case 122:return e.Kl();case 98:return e.El();case 66:return e.zl();case 60:return e.Jl();case 62:return e.Hl()}}switch(a=eY9(e),t=e.c){case 3:return e.Zl(a);case 4:return e.Xl(a);case 5:return e.Yl(a);case 0:if(123==e.a&&e.d=48&&t<=57){for(r=t-48;i=48&&t<=57;)if((r=10*r+t-48)<0)throw p7(new gX(eBJ((Mo(),eJ_))))}else throw p7(new gX(eBJ((Mo(),eJg))));if(n=r,44==t){if(i>=e.j)throw p7(new gX(eBJ((Mo(),eJy))));if((t=UI(e.i,i++))>=48&&t<=57){for(n=t-48;i=48&&t<=57;)if((n=10*n+t-48)<0)throw p7(new gX(eBJ((Mo(),eJ_))));if(r>n)throw p7(new gX(eBJ((Mo(),eJw))))}else n=-1}if(125!=t)throw p7(new gX(eBJ((Mo(),eJv))));e.sl(i)?(a=(eBG(),eBG(),++tyv,new qa(9,a)),e.d=i+1):(a=(eBG(),eBG(),++tyv,new qa(3,a)),e.d=i),a.dm(r),a.cm(n),eBM(e)}}return a}function eBu(e,t,n,r,i){var a,o,s,u,c,l,f,d,h,p,b,m,g,v,y,w,_,E,S,k,x,T,M;for(b=new XM(t.b),w=new XM(t.b),d=new XM(t.b),k=new XM(t.b),m=new XM(t.b),S=epL(t,0);S.b!=S.d.c;)for(_=Pp(Vv(S),11),s=new fz(_.g);s.a0,g=_.g.c.length>0,c&&g?d.c[d.c.length]=_:c?b.c[b.c.length]=_:g&&(w.c[w.c.length]=_);for(p=new fz(b);p.aefT(Jh(y.d,x),Jh(y.d,y.a))&&(a.c[a.c.length]=y);for(n.c=Je(e1R,eUp,1,0,5,1),w=new fz(a);w.a1)for(p=new AF((e.a||(e.a=new FQ(e5v,e,6,6)),e.a));p.e!=p.i.gc();)ey_(p);for(o=Pp(etj((e.a||(e.a=new FQ(e5v,e,6,6)),e.a),0),202),m=A,A>_+w?m=_+w:A<_-w&&(m=_-w),g=L,L>E+b?g=E+b:L_-w&&m<_+w&&g>E-b&&gA+O?k=A+O:_L+S?x=L+S:EA-O&&kL-S&&xn&&(d=n-1),(h=P+eMU(t,24)*e$h*f-f/2)<0?h=1:h>r&&(h=r-1),i=(yT(),u=new oJ),ent(i,d),enn(i,h),JL((o.a||(o.a=new O_(e5h,o,5)),o.a),i)}function eBy(){eBy=A,tox=(eBB(),th7),toT=tpe,toM=tpt,toO=tpn,toL=tpr,toC=tpi,toN=tpo,toR=tpu,toj=tpc,toP=tps,toF=tpl,toB=tpf,toH=tpp,toD=tpa,tok=(eBH(),tih),toA=tip,toI=tib,toY=tim,tov=new T2(th4,ell(0)),toy=til,tow=tif,to_=tid,toQ=tiB,toG=tiy,toW=tiE,toq=tiL,toK=tix,toV=tiM,to0=tiG,to1=tiH,toX=tiR,toZ=tiN,toJ=tiF,ta0=tit,ta2=tin,taE=trE,taS=trx,toe=new T3(12),ta7=new T2(thN,toe),tav=(efE(),tpx),tag=new T2(tha,tav),toc=new T2(thK,0),toE=new T2(th6,ell(1)),tiX=new T2(td2,eGt),ta9=thI,tol=thV,tob=th0,tac=td7,tiq=td1,taM=thl,toS=new T2(th9,(OQ(),!0)),taI=thh,taD=thp,ta4=thx,ta8=thL,ta6=thM,tad=(ec3(),tpv),tal=new T2(the,tad),taZ=thS,taq=th_,toh=thJ,tod=thX,top=th1,tor=(epT(),tbr),new T2(thB,tor),toa=th$,too=thz,tos=thG,toi=thH,toz=tiv,taG=trZ,taz=trV,to$=tig,taY=trB,tau=trs,tas=tra,ti7=tn1,tae=tn0,tan=tn5,tat=tn2,tao=trr,taK=trJ,taV=trQ,taP=trD,ta3=tio,taJ=tr3,tax=trO,ta1=tr7,taw=trg,ta_=trw,ti9=td8,taX=tr1,ti0=tn$,ti1=tnU,tiQ=tnB,taA=trC,taO=trL,taL=trI,ta5=thO,taR=thg,tak=ths,tab=thr,tap=thn,tar=tn7,tof=thZ,tiJ=td5,taC=thd,tou=thW,tot=thR,ton=thF,taU=tr$,taH=trG,tog=th3,tiZ=tnY,ta$=trK,tam=trh,tah=trf,taW=thy,taj=trj,taQ=tr5,toU=tpd,taf=trc,tom=tiu,tay=trb,taF=trY,tai=trt,taN=thm,taB=trH,taa=trn,ti8=tnJ,ti6=tnq,ti3=tnK,ti4=tnV,ti5=tnX,ti2=tnG,taT=trA}function eBw(e,t){var n,r,i,a,o,s,u,c,l,f,d,h,p,b,m,g,v,y,w,_,E,S,k,x,T,M,O,A;if(ePN(),k=e.e,p=e.d,i=e.a,0==k)switch(t){case 0:return"0";case 1:return e$e;case 2:return"0.00";case 3:return"0.000";case 4:return"0.0000";case 5:return"0.00000";case 6:return"0.000000";default:return E=new vc,t<0?(E.a+="0E+",E):(E.a+="0E",E),E.a+=-t,E.a}if(w=Je(tyw,eHl,25,(y=10*p+1+7)+1,15,1),n=y,1==p){if((s=i[0])<0){A=WM(s,eH9);do b=A,A=eyt(A,10),w[--n]=48+jE(efe(b,efn(A,10)))&eHd;while(0!=ecd(A,0))}else{A=s;do b=A,A=A/10|0,w[--n]=48+(b-10*A)&eHd;while(0!=A)}}else{T=Je(ty_,eHT,25,p,15,1),ePD(i,0,T,0,O=p);I:for(;;){for(S=0,c=O-1;c>=0;c--)g=ewT(M=eft(Fg(S,32),WM(T[c],eH9))),T[c]=jE(g),S=jE(Fv(g,32));v=jE(S),m=n;do w[--n]=48+v%10&eHd;while(0!=(v=v/10|0)&&0!=n)for(u=0,r=9-m+n;u0;u++)w[--n]=48;for(f=O-1;0==T[f];f--)if(0==f)break I;O=f+1}for(;48==w[n];)++n}if(h=k<0,o=y-n-t-1,0==t)return h&&(w[--n]=45),ehv(w,n,y-n);if(t>0&&o>=-6){if(o>=0){for(l=n+o,d=y-1;d>=l;d--)w[d+1]=w[d];return w[++l]=46,h&&(w[--n]=45),ehv(w,n,y-n+1)}for(f=2;f<-o+1;f++)w[--n]=48;return w[--n]=46,w[--n]=48,h&&(w[--n]=45),ehv(w,n,y-n)}return x=n+1,a=y,_=new vl,h&&(_.a+="-"),a-x>=1?(Bd(_,w[n]),_.a+=".",_.a+=ehv(w,n+1,y-n-1)):_.a+=ehv(w,n,y-n),_.a+="E",o>0&&(_.a+="+"),_.a+=""+o,_.a}function eB_(e,t){var n,r,i,a,o,s,u,c,l,f,d,h,p,b,m,g,v,y,w,_,E;switch(e.c=t,e.g=new p2,n=(_q(),new gM(e.c)),efJ(r=new dp(n)),y=Lq(eT9(e.c,(e_L(),tfD))),u=Pp(eT9(e.c,tfP),316),_=Pp(eT9(e.c,tfR),429),o=Pp(eT9(e.c,tfO),482),w=Pp(eT9(e.c,tfN),430),e.j=gP(LV(eT9(e.c,tfj))),s=e.a,u.g){case 0:s=e.a;break;case 1:s=e.b;break;case 2:s=e.i;break;case 3:s=e.e;break;case 4:s=e.f;break;default:throw p7(new gL(eqN+(null!=u.f?u.f:""+u.g)))}if(e.d=new zM(s,_,o),eo3(e.d,(ei5(),e5F),LK(eT9(e.c,tfL))),e.d.c=gN(LK(eT9(e.c,tfA))),0==H9(e.c).i)return e.d;for(f=new Ow(H9(e.c));f.e!=f.i.gc();){for(h=(l=Pp(epH(f),33)).g/2,d=l.f/2,E=new kl(l.i+h,l.j+d);F8(e.g,E);)Lu(E,(eB4.Math.random()-.5)*ez9,(eB4.Math.random()-.5)*ez9);b=Pp(eT9(l,(eBB(),thy)),142),m=new Gd(E,new Hr(E.a-h-e.j/2-b.b,E.b-d-e.j/2-b.d,l.g+e.j+(b.b+b.c),l.f+e.j+(b.d+b.a))),P_(e.d.i,m),Um(e.g,E,new kD(m,l))}switch(w.g){case 0:if(null==y)e.d.d=Pp(RJ(e.d.i,0),65);else for(v=new fz(e.d.i);v.a1&&qQ(l,g,l.c.b,l.c),etu(i)));g=v}return l}function eBS(e,t,n){var r,i,a,o,s,u,c,l,f,d,h,p,b,m,g,v,y,w,_,E,S,k,x,T,M,O,A,L,C,I,D;for(ewG(n,"Greedy cycle removal",1),D=(y=t.a).c.length,e.a=Je(ty_,eHT,25,D,15,1),e.c=Je(ty_,eHT,25,D,15,1),e.b=Je(ty_,eHT,25,D,15,1),c=0,g=new fz(y);g.a0?O+1:1);for(o=new fz(E.g);o.a0?O+1:1)}0==e.c[c]?P7(e.e,b):0==e.a[c]&&P7(e.f,b),++c}for(p=-1,h=1,f=new p0,e.d=Pp(e_k(t,(eBU(),tnw)),230);D>0;){for(;0!=e.e.b;)L=Pp(PH(e.e),10),e.b[L.p]=p--,eIQ(e,L),--D;for(;0!=e.f.b;)C=Pp(PH(e.f),10),e.b[C.p]=h++,eIQ(e,C),--D;if(D>0){for(d=eHt,v=new fz(y);v.a=d&&(w>d&&(f.c=Je(e1R,eUp,1,0,5,1),d=w),f.c[f.c.length]=b);l=e.Zf(f),e.b[l.p]=h++,eIQ(e,l),--D}}for(c=0,A=y.c.length+1;ce.b[I]&&(eNF(r,!0),eo3(t,ttK,(OQ(),!0)));e.a=null,e.c=null,e.b=null,HC(e.f),HC(e.e),eEj(n)}function eBk(e,t){var n,r,i,a,o,s,u,c,l,f,d,h,p,b,m,g;for(r=new p0,s=new p0,m=t/2,h=e.gc(),i=Pp(e.Xb(0),8),g=Pp(e.Xb(1),8),p=eT6(i.a,i.b,g.a,g.b,m),P_(r,(GK(0,p.c.length),Pp(p.c[0],8))),P_(s,(GK(1,p.c.length),Pp(p.c[1],8))),c=2;c=0;u--)P7(n,(GK(u,o.c.length),Pp(o.c[u],8)));return n}function eBx(e){var t,n,r,i,a,o,s,u,c,l,f,d,h;if(o=!0,f=null,r=null,i=null,t=!1,h=tmH,c=null,a=null,(u=epm(e,s=0,tmJ,tmQ))=0&&IE(e.substr(s,2),"//")?(s+=2,u=epm(e,s,tm1,tm0),r=e.substr(s,u-s),s=u):null!=f&&(s==e.length||(GV(s,e.length),47!=e.charCodeAt(s)))&&(o=!1,-1==(u=O7(e,e_n(35),s))&&(u=e.length),r=e.substr(s,u-s),s=u);if(!n&&s0&&58==UI(l,l.length-1)&&(i=l,s=u)),s=e.j){e.a=-1,e.c=1;return}if(t=UI(e.i,e.d++),e.a=t,1==e.b){switch(t){case 92:if(r=10,e.d>=e.j)throw p7(new gX(eBJ((Mo(),eXZ))));e.a=UI(e.i,e.d++);break;case 45:(512&e.e)==512&&e.d=e.j||63!=UI(e.i,e.d))break;if(++e.d>=e.j)throw p7(new gX(eBJ((Mo(),eXX))));switch(t=UI(e.i,e.d++)){case 58:r=13;break;case 61:r=14;break;case 33:r=15;break;case 91:r=19;break;case 62:r=18;break;case 60:if(e.d>=e.j)throw p7(new gX(eBJ((Mo(),eXX))));if(61==(t=UI(e.i,e.d++)))r=16;else if(33==t)r=17;else throw p7(new gX(eBJ((Mo(),eXJ))));break;case 35:for(;e.d=e.j)throw p7(new gX(eBJ((Mo(),eXZ))));e.a=UI(e.i,e.d++);break;default:r=0}e.c=r}function eBO(e){var t,n,r,i,a,o,s,u,l,f,d,h,p,b,m,g,v,y,w,_,E,S,k,x,T,M,O,A;if((k=Pp(e_k(e,(eBy(),tol)),98))!=(ewf(),tbc)&&k!=tbl){for(p=(b=e.b).c.length,f=new XM((enG(p+2,eU5),ee1(eft(eft(5,p+2),(p+2)/10|0)))),m=new XM((enG(p+2,eU5),ee1(eft(eft(5,p+2),(p+2)/10|0)))),P_(f,new p2),P_(f,new p2),P_(m,new p0),P_(m,new p0),S=new p0,t=0;t=E||!ehf(v,r))&&(r=GY(t,f)),Gu(v,r),a=new Fa(OH(efu(v).a.Kc(),new c));eTk(a);)i=Pp(ZC(a),17),!e.a[i.p]&&(m=i.c.i,--e.e[m.p],0==e.e[m.p]&&Ja(e_s(p,m)));for(l=f.c.length-1;l>=0;--l)P_(t.b,(GK(l,f.c.length),Pp(f.c[l],29)));t.a.c=Je(e1R,eUp,1,0,5,1),eEj(n)}function eBL(e){var t,n,r,i,a,o,s,u,c;for(e.b=1,eBM(e),t=null,0==e.c&&94==e.a?(eBM(e),t=(eBG(),eBG(),++tyv,new WZ(4)),eLw(t,0,e1f),s=(++tyv,new WZ(4))):s=(eBG(),eBG(),++tyv,new WZ(4)),i=!0;1!=(c=e.c);){if(0==c&&93==e.a&&!i){t&&(ej0(t,s),s=t);break}if(n=e.a,r=!1,10==c)switch(n){case 100:case 68:case 119:case 87:case 115:case 83:ePR(s,eDu(n)),r=!0;break;case 105:case 73:case 99:case 67:(n=(ePR(s,eDu(n)),-1))<0&&(r=!0);break;case 112:case 80:if(!(u=ext(e,n)))throw p7(new gX(eBJ((Mo(),eJe))));ePR(s,u),r=!0;break;default:n=eCn(e)}else if(24==c&&!i){if(t&&(ej0(t,s),s=t),a=eBL(e),ej0(s,a),0!=e.c||93!=e.a)throw p7(new gX(eBJ((Mo(),eJi))));break}if(eBM(e),!r){if(0==c){if(91==n)throw p7(new gX(eBJ((Mo(),eJa))));if(93==n)throw p7(new gX(eBJ((Mo(),eJo))));if(45==n&&!i&&93!=e.a)throw p7(new gX(eBJ((Mo(),eJs))))}if(0!=e.c||45!=e.a||45==n&&i)eLw(s,n,n);else{if(eBM(e),1==(c=e.c))throw p7(new gX(eBJ((Mo(),eJn))));if(0==c&&93==e.a)eLw(s,n,n),eLw(s,45,45);else if(0==c&&93==e.a||24==c)throw p7(new gX(eBJ((Mo(),eJs))));else{if(o=e.a,0==c){if(91==o)throw p7(new gX(eBJ((Mo(),eJa))));if(93==o)throw p7(new gX(eBJ((Mo(),eJo))));if(45==o)throw p7(new gX(eBJ((Mo(),eJs))))}else 10==c&&(o=eCn(e));if(eBM(e),n>o)throw p7(new gX(eBJ((Mo(),eJl))));eLw(s,n,o)}}}i=!1}if(1==e.c)throw p7(new gX(eBJ((Mo(),eJn))));return eMS(s),eRo(s),e.b=0,eBM(e),s}function eBC(e){eMV(e.c,eJ7,eow(vx(e17,1),eUP,2,6,[eQd,"http://www.w3.org/2001/XMLSchema#decimal"])),eMV(e.d,eJ7,eow(vx(e17,1),eUP,2,6,[eQd,"http://www.w3.org/2001/XMLSchema#integer"])),eMV(e.e,eJ7,eow(vx(e17,1),eUP,2,6,[eQd,"http://www.w3.org/2001/XMLSchema#boolean"])),eMV(e.f,eJ7,eow(vx(e17,1),eUP,2,6,[eQd,"EBoolean",eXP,"EBoolean:Object"])),eMV(e.i,eJ7,eow(vx(e17,1),eUP,2,6,[eQd,"http://www.w3.org/2001/XMLSchema#byte"])),eMV(e.g,eJ7,eow(vx(e17,1),eUP,2,6,[eQd,"http://www.w3.org/2001/XMLSchema#hexBinary"])),eMV(e.j,eJ7,eow(vx(e17,1),eUP,2,6,[eQd,"EByte",eXP,"EByte:Object"])),eMV(e.n,eJ7,eow(vx(e17,1),eUP,2,6,[eQd,"EChar",eXP,"EChar:Object"])),eMV(e.t,eJ7,eow(vx(e17,1),eUP,2,6,[eQd,"http://www.w3.org/2001/XMLSchema#double"])),eMV(e.u,eJ7,eow(vx(e17,1),eUP,2,6,[eQd,"EDouble",eXP,"EDouble:Object"])),eMV(e.F,eJ7,eow(vx(e17,1),eUP,2,6,[eQd,"http://www.w3.org/2001/XMLSchema#float"])),eMV(e.G,eJ7,eow(vx(e17,1),eUP,2,6,[eQd,"EFloat",eXP,"EFloat:Object"])),eMV(e.I,eJ7,eow(vx(e17,1),eUP,2,6,[eQd,"http://www.w3.org/2001/XMLSchema#int"])),eMV(e.J,eJ7,eow(vx(e17,1),eUP,2,6,[eQd,"EInt",eXP,"EInt:Object"])),eMV(e.N,eJ7,eow(vx(e17,1),eUP,2,6,[eQd,"http://www.w3.org/2001/XMLSchema#long"])),eMV(e.O,eJ7,eow(vx(e17,1),eUP,2,6,[eQd,"ELong",eXP,"ELong:Object"])),eMV(e.Z,eJ7,eow(vx(e17,1),eUP,2,6,[eQd,"http://www.w3.org/2001/XMLSchema#short"])),eMV(e.$,eJ7,eow(vx(e17,1),eUP,2,6,[eQd,"EShort",eXP,"EShort:Object"])),eMV(e._,eJ7,eow(vx(e17,1),eUP,2,6,[eQd,"http://www.w3.org/2001/XMLSchema#string"]))}function eBI(e){var t,n,r,i,a,o,s,u,c,l,f,d,h,p,b,m,g,v,y,w,_,E,S,k,x,T,M,O;if(1==e.c.length)return GK(0,e.c.length),Pp(e.c[0],135);if(e.c.length<=0)return new Xn;for(u=new fz(e);u.af&&(M=0,O+=l+S,l=0),eOd(_,o,M,O),t=eB4.Math.max(t,M+E.a),l=eB4.Math.max(l,E.b),M+=E.a+S;for(w=new p2,n=new p2,x=new fz(e);x.aeMg(a))&&(f=a);for(f||(f=(GK(0,m.c.length),Pp(m.c[0],180))),b=new fz(t.b);b.a=-1900?1:0,n>=4?xM(e,eow(vx(e17,1),eUP,2,6,[eHM,eHO])[s]):xM(e,eow(vx(e17,1),eUP,2,6,["BC","AD"])[s]);break;case 121:epA(e,n,r);break;case 77:eIZ(e,n,r);break;case 107:0==(u=i.q.getHours())?eeE(e,24,n):eeE(e,u,n);break;case 83:eOT(e,n,i);break;case 69:l=r.q.getDay(),5==n?xM(e,eow(vx(e17,1),eUP,2,6,["S","M","T","W","T","F","S"])[l]):4==n?xM(e,eow(vx(e17,1),eUP,2,6,[eHA,eHL,eHC,eHI,eHD,eHN,eHP])[l]):xM(e,eow(vx(e17,1),eUP,2,6,["Sun","Mon","Tue","Wed","Thu","Fri","Sat"])[l]);break;case 97:i.q.getHours()>=12&&24>i.q.getHours()?xM(e,eow(vx(e17,1),eUP,2,6,["AM","PM"])[1]):xM(e,eow(vx(e17,1),eUP,2,6,["AM","PM"])[0]);break;case 104:0==(f=i.q.getHours()%12)?eeE(e,12,n):eeE(e,f,n);break;case 75:eeE(e,d=i.q.getHours()%12,n);break;case 72:eeE(e,h=i.q.getHours(),n);break;case 99:p=r.q.getDay(),5==n?xM(e,eow(vx(e17,1),eUP,2,6,["S","M","T","W","T","F","S"])[p]):4==n?xM(e,eow(vx(e17,1),eUP,2,6,[eHA,eHL,eHC,eHI,eHD,eHN,eHP])[p]):3==n?xM(e,eow(vx(e17,1),eUP,2,6,["Sun","Mon","Tue","Wed","Thu","Fri","Sat"])[p]):eeE(e,p,1);break;case 76:b=r.q.getMonth(),5==n?xM(e,eow(vx(e17,1),eUP,2,6,["J","F","M","A","M","J","J","A","S","O","N","D"])[b]):4==n?xM(e,eow(vx(e17,1),eUP,2,6,[eHh,eHp,eHb,eHm,eHg,eHv,eHy,eHw,eH_,eHE,eHS,eHk])[b]):3==n?xM(e,eow(vx(e17,1),eUP,2,6,["Jan","Feb","Mar","Apr",eHg,"Jun","Jul","Aug","Sep","Oct","Nov","Dec"])[b]):eeE(e,b+1,n);break;case 81:m=r.q.getMonth()/3|0,n<4?xM(e,eow(vx(e17,1),eUP,2,6,["Q1","Q2","Q3","Q4"])[m]):xM(e,eow(vx(e17,1),eUP,2,6,["1st quarter","2nd quarter","3rd quarter","4th quarter"])[m]);break;case 100:eeE(e,g=r.q.getDate(),n);break;case 109:eeE(e,c=i.q.getMinutes(),n);break;case 115:eeE(e,o=i.q.getSeconds(),n);break;case 122:n<4?xM(e,a.c[0]):xM(e,a.c[1]);break;case 118:xM(e,a.b);break;case 90:n<3?xM(e,ekA(a)):3==n?xM(e,ek$(a)):xM(e,ekz(a.a));break;default:return!1}return!0}function eBF(e,t,n,r){var i,a,o,s,u,c,l,f,d,h,p,b,m,g,v,y,w,_,E,S,k,x,T,M,O,A;if(eIi(t),u=Pp(etj((t.b||(t.b=new Ih(e5m,t,4,7)),t.b),0),82),l=Pp(etj((t.c||(t.c=new Ih(e5m,t,5,8)),t.c),0),82),s=ewH(u),c=ewH(l),o=0==(t.a||(t.a=new FQ(e5v,t,6,6)),t.a).i?null:Pp(etj((t.a||(t.a=new FQ(e5v,t,6,6)),t.a),0),202),S=Pp(Bp(e.a,s),10),M=Pp(Bp(e.a,c),10),k=null,O=null,M4(u,186)&&(M4(E=Pp(Bp(e.a,u),299),11)?k=Pp(E,11):M4(E,10)&&(S=Pp(E,10),k=Pp(RJ(S.j,0),11))),M4(l,186)&&(M4(T=Pp(Bp(e.a,l),299),11)?O=Pp(T,11):M4(T,10)&&(M=Pp(T,10),O=Pp(RJ(M.j,0),11))),!S||!M)throw p7(new gZ("The source or the target of edge "+t+" could not be found. This usually happens when an edge connects a node laid out by ELK Layered to a node in another level of hierarchy laid out by either another instance of ELK Layered or another layout algorithm alltogether. The former can be solved by setting the hierarchyHandling option to INCLUDE_CHILDREN."));for(b=new $b,eaW(b,t),eo3(b,(eBU(),tnc),t),eo3(b,(eBy(),taR),null),h=Pp(e_k(r,tt3),21),S==M&&h.Fc((eLR(),ttT)),k||(_=(enY(),tsN),x=null,o&&TM(Pp(e_k(S,tol),98))&&(V2(x=new kl(o.j,o.k),zF(t)),qZ(x,n),etg(c,s)&&(_=tsD,C6(x,S.n))),k=ePH(S,x,_,r)),O||(_=(enY(),tsD),A=null,o&&TM(Pp(e_k(M,tol),98))&&(V2(A=new kl(o.b,o.c),zF(t)),qZ(A,n)),O=ePH(M,A,_,Bq(M))),Gs(b,k),Go(b,O),(k.e.c.length>1||k.g.c.length>1||O.e.c.length>1||O.g.c.length>1)&&h.Fc((eLR(),tt_)),d=new Ow((t.n||(t.n=new FQ(e5S,t,1,7)),t.n));d.e!=d.i.gc();)if(f=Pp(epH(d),137),!gN(LK(eT9(f,ta9)))&&f.a)switch(m=eca(f),P_(b.b,m),Pp(e_k(m,tab),272).g){case 1:case 2:h.Fc((eLR(),tty));break;case 0:h.Fc((eLR(),ttg)),eo3(m,tab,(etT(),tp_))}if(a=Pp(e_k(r,tas),314),g=Pp(e_k(r,ta3),315),i=a==(en7(),teR)||g==(ebG(),tsd),o&&0!=(o.a||(o.a=new O_(e5h,o,5)),o.a).i&&i){for(v=eEF(o),p=new mE,w=epL(v,0);w.b!=w.d.c;)y=Pp(Vv(w),8),P7(p,new TS(y));eo3(b,tnl,p)}return b}function eBY(e){e.gb||(e.gb=!0,e.b=eak(e,0),er5(e.b,18),er8(e.b,19),e.a=eak(e,1),er5(e.a,1),er8(e.a,2),er8(e.a,3),er8(e.a,4),er8(e.a,5),e.o=eak(e,2),er5(e.o,8),er5(e.o,9),er8(e.o,10),er8(e.o,11),er8(e.o,12),er8(e.o,13),er8(e.o,14),er8(e.o,15),er8(e.o,16),er8(e.o,17),er8(e.o,18),er8(e.o,19),er8(e.o,20),er8(e.o,21),er8(e.o,22),er8(e.o,23),ee8(e.o),ee8(e.o),ee8(e.o),ee8(e.o),ee8(e.o),ee8(e.o),ee8(e.o),ee8(e.o),ee8(e.o),ee8(e.o),e.p=eak(e,3),er5(e.p,2),er5(e.p,3),er5(e.p,4),er5(e.p,5),er8(e.p,6),er8(e.p,7),ee8(e.p),ee8(e.p),e.q=eak(e,4),er5(e.q,8),e.v=eak(e,5),er8(e.v,9),ee8(e.v),ee8(e.v),ee8(e.v),e.w=eak(e,6),er5(e.w,2),er5(e.w,3),er5(e.w,4),er8(e.w,5),e.B=eak(e,7),er8(e.B,1),ee8(e.B),ee8(e.B),ee8(e.B),e.Q=eak(e,8),er8(e.Q,0),ee8(e.Q),e.R=eak(e,9),er5(e.R,1),e.S=eak(e,10),ee8(e.S),ee8(e.S),ee8(e.S),ee8(e.S),ee8(e.S),ee8(e.S),ee8(e.S),ee8(e.S),ee8(e.S),ee8(e.S),ee8(e.S),ee8(e.S),ee8(e.S),ee8(e.S),ee8(e.S),e.T=eak(e,11),er8(e.T,10),er8(e.T,11),er8(e.T,12),er8(e.T,13),er8(e.T,14),ee8(e.T),ee8(e.T),e.U=eak(e,12),er5(e.U,2),er5(e.U,3),er8(e.U,4),er8(e.U,5),er8(e.U,6),er8(e.U,7),ee8(e.U),e.V=eak(e,13),er8(e.V,10),e.W=eak(e,14),er5(e.W,18),er5(e.W,19),er5(e.W,20),er8(e.W,21),er8(e.W,22),er8(e.W,23),e.bb=eak(e,15),er5(e.bb,10),er5(e.bb,11),er5(e.bb,12),er5(e.bb,13),er5(e.bb,14),er5(e.bb,15),er5(e.bb,16),er8(e.bb,17),ee8(e.bb),ee8(e.bb),e.eb=eak(e,16),er5(e.eb,2),er5(e.eb,3),er5(e.eb,4),er5(e.eb,5),er5(e.eb,6),er5(e.eb,7),er8(e.eb,8),er8(e.eb,9),e.ab=eak(e,17),er5(e.ab,0),er5(e.ab,1),e.H=eak(e,18),er8(e.H,0),er8(e.H,1),er8(e.H,2),er8(e.H,3),er8(e.H,4),er8(e.H,5),ee8(e.H),e.db=eak(e,19),er8(e.db,2),e.c=eax(e,20),e.d=eax(e,21),e.e=eax(e,22),e.f=eax(e,23),e.i=eax(e,24),e.g=eax(e,25),e.j=eax(e,26),e.k=eax(e,27),e.n=eax(e,28),e.r=eax(e,29),e.s=eax(e,30),e.t=eax(e,31),e.u=eax(e,32),e.fb=eax(e,33),e.A=eax(e,34),e.C=eax(e,35),e.D=eax(e,36),e.F=eax(e,37),e.G=eax(e,38),e.I=eax(e,39),e.J=eax(e,40),e.L=eax(e,41),e.M=eax(e,42),e.N=eax(e,43),e.O=eax(e,44),e.P=eax(e,45),e.X=eax(e,46),e.Y=eax(e,47),e.Z=eax(e,48),e.$=eax(e,49),e._=eax(e,50),e.cb=eax(e,51),e.K=eax(e,52))}function eBB(){var e,t;eBB=A,tdQ=new pO(eZi),th5=new pO(eZa),td0=(ebx(),tdM),td1=new xX(eVi,td0),new pQ,td2=new xX(ezG,null),td3=new pO(eZo),td9=(eyY(),jL(tdX,eow(vx(e64,1),eU4,291,0,[tdK]))),td8=new xX(eVg,td9),td7=new xX(eVr,(OQ(),!1)),tht=(ec3(),tpv),the=new xX(eVu,tht),tho=(efE(),tpO),tha=new xX(eKB,tho),thc=new xX(eqC,!1),thf=(eck(),tpG),thl=new xX(eKP,thf),thP=new T3(12),thN=new xX(ezW,thP),thb=new xX(eGu,!1),thm=new xX(eVA,!1),thD=new xX(eGf,!1),thq=(ewf(),tbl),thV=new xX(eGc,thq),th3=new pO(eVT),th4=new pO(eGr),th6=new pO(eGo),th9=new pO(eGs),thv=new mE,thg=new xX(eVv,thv),td5=new xX(eV_,!1),thd=new xX(eVE,!1),new pO(eZs),thw=new mh,thy=new xX(eVM,thw),thI=new xX(eVt,!1),new pQ,th8=new xX(eZu,1),new xX(eZc,!0),ell(0),new xX(eZl,ell(100)),new xX(eZf,!1),ell(0),new xX(eZd,ell(4e3)),ell(0),new xX(eZh,ell(400)),new xX(eZp,!1),new xX(eZb,!1),new xX(eZm,!0),new xX(eZg,!1),td6=(edM(),tme),td4=new xX(eZr,td6),th7=new xX(eKQ,10),tpe=new xX(eK1,10),tpt=new xX(ez$,20),tpn=new xX(eK0,10),tpr=new xX(eGa,2),tpi=new xX(eK2,10),tpo=new xX(eK3,0),tps=new xX(eK5,5),tpu=new xX(eK4,1),tpc=new xX(eK6,1),tpl=new xX(eGi,20),tpf=new xX(eK8,10),tpp=new xX(eK9,10),tpa=new pO(eK7),tph=new T_,tpd=new xX(eVO,tph),thF=new pO(eVx),thj=!1,thR=new xX(eVk,thj),thE=new T3(5),th_=new xX(eVc,thE),thk=(eT7(),t=Pp(yw(e5t),9),new I1(t,Pp(CY(t,t.length),9),0)),thS=new xX(eGp,thk),thU=(epT(),tbt),thB=new xX(eVd,thU),th$=new pO(eVh),thz=new pO(eVp),thG=new pO(eVb),thH=new pO(eVm),thT=(e=Pp(yw(e5o),9),new I1(e,Pp(CY(e,e.length),9),0)),thx=new xX(eGh,thT),thC=el8((eI3(),tbQ)),thL=new xX(eGd,thC),thA=new kl(0,0),thO=new xX(eGM,thA),thM=new xX(eVs,!1),thi=(etT(),tp_),thr=new xX(eVy,thi),thn=new xX(eGl,!1),new pO(eZv),ell(1),new xX(eZy,null),thW=new pO(eVS),thZ=new pO(eVw),th2=(eYu(),tbF),th0=new xX(eVn,th2),thK=new pO(eVe),thQ=(ekU(),el8(tbm)),thJ=new xX(eGb,thQ),thX=new xX(eVl,!1),th1=new xX(eVf,!0),thh=new xX(eVa,!1),thp=new xX(eVo,!1),ths=new xX(ezz,1),thu=(e_a(),tpN),new xX(eZw,thu),thY=!0}function eBU(){var e,t;eBU=A,tnc=new pO(eGm),ttz=new pO("coordinateOrigin"),tny=new pO("processors"),tt$=new Cm("compoundNode",(OQ(),!1)),tt5=new Cm("insideConnections",!1),tnl=new pO("originalBendpoints"),tnf=new pO("originalDummyNodePosition"),tnd=new pO("originalLabelEdge"),tn_=new pO("representedLabels"),ttq=new pO("endLabels"),ttZ=new pO("endLabel.origin"),tnt=new Cm("labelSide",(egF(),tpX)),tns=new Cm("maxEdgeThickness",0),tnE=new Cm("reversed",!1),tnw=new pO(eGg),tni=new Cm("longEdgeSource",null),tna=new Cm("longEdgeTarget",null),tnr=new Cm("longEdgeHasLabelDummies",!1),tnn=new Cm("longEdgeBeforeLabelDummy",!1),ttV=new Cm("edgeConstraint",(eoG(),te1)),tt9=new pO("inLayerLayoutUnit"),tt8=new Cm("inLayerConstraint",(Q1(),ttD)),tt7=new Cm("inLayerSuccessorConstraint",new p0),tne=new Cm("inLayerSuccessorConstraintBetweenNonDummies",!1),tng=new pO("portDummy"),ttG=new Cm("crossingHint",ell(0)),tt3=new Cm("graphProperties",(t=Pp(yw(e44),9),new I1(t,Pp(CY(t,t.length),9),0))),tt1=new Cm("externalPortSide",(eYu(),tbF)),tt0=new Cm("externalPortSize",new yb),ttJ=new pO("externalPortReplacedDummies"),ttQ=new pO("externalPortReplacedDummy"),ttX=new Cm("externalPortConnections",(e=Pp(yw(e5a),9),new I1(e,Pp(CY(e,e.length),9),0))),tnv=new Cm(ezf,0),ttY=new pO("barycenterAssociates"),tnI=new pO("TopSideComments"),ttB=new pO("BottomSideComments"),ttH=new pO("CommentConnectionPort"),tt6=new Cm("inputCollect",!1),tnb=new Cm("outputCollect",!1),ttK=new Cm("cyclic",!1),ttW=new pO("crossHierarchyMap"),tnC=new pO("targetOffset"),new Cm("splineLabelSize",new yb),tnx=new pO("spacings"),tnm=new Cm("partitionConstraint",!1),ttU=new pO("breakingPoint.info"),tnA=new pO("splines.survivingEdge"),tnO=new pO("splines.route.start"),tnT=new pO("splines.edgeChain"),tnp=new pO("originalPortConstraints"),tnk=new pO("selfLoopHolder"),tnM=new pO("splines.nsPortY"),tnu=new pO("modelOrder"),tno=new pO("longEdgeTargetNode"),tt2=new Cm(eW_,!1),tnS=new Cm(eW_,!1),tt4=new pO("layerConstraints.hiddenNodes"),tnh=new pO("layerConstraints.opposidePort"),tnL=new pO("targetNode.modelOrder")}function eBH(){eBH=A,trl=(eeF(),teZ),trc=new xX(eWE,trl),trO=new xX(eWS,(OQ(),!1)),trN=(K5(),ttR),trD=new xX(eWk,trN),trJ=new xX(eWx,!1),trQ=new xX(eWT,!0),tnY=new xX(eWM,!1),tic=(Q0(),tsL),tiu=new xX(eWO,tic),ell(1),tig=new xX(eWA,ell(7)),tiv=new xX(eWL,!1),trA=new xX(eWC,!1),tru=(eb5(),teG),trs=new xX(eWI,tru),trX=(ewY(),to7),trZ=new xX(eWD,trX),trU=(ef_(),tnj),trB=new xX(eWN,trU),ell(-1),trY=new xX(eWP,ell(-1)),ell(-1),trH=new xX(eWR,ell(-1)),ell(-1),tr$=new xX(eWj,ell(4)),ell(-1),trG=new xX(eWF,ell(2)),trq=(eOJ(),tsS),trV=new xX(eWY,trq),ell(0),trK=new xX(eWB,ell(0)),trj=new xX(eWU,ell(eUu)),tro=(en7(),tej),tra=new xX(eWH,tro),tn1=new xX(eW$,!1),tn7=new xX(eWz,.1),trr=new xX(eWG,!1),ell(-1),trt=new xX(eWW,ell(-1)),ell(-1),trn=new xX(eWK,ell(-1)),ell(0),tn0=new xX(eWV,ell(40)),tn8=(eaU(),ttL),tn5=new xX(eWq,tn8),tn3=ttO,tn2=new xX(eWZ,tn3),tis=(ebG(),tsf),tio=new xX(eWX,tis),tr5=new pO(eWJ),tr0=(Qx(),tte),tr1=new xX(eWQ,tr0),tr4=(eyd(),tto),tr3=new xX(eW1,tr4),new pQ,tr7=new xX(eW0,.3),tit=new pO(eW2),tir=(ebk(),tsu),tin=new xX(eW3,tir),trv=(ei0(),tsF),trg=new xX(eW4,trv),tr_=(Xo(),tsH),trw=new xX(eW6,tr_),trS=(euy(),tsW),trE=new xX(eW5,trS),trx=new xX(eW8,.2),trb=new xX(eW9,2),tih=new xX(eW7,null),tib=new xX(eKe,10),tip=new xX(eKt,10),tim=new xX(eKn,20),ell(0),til=new xX(eKr,ell(0)),ell(0),tif=new xX(eKi,ell(0)),ell(0),tid=new xX(eKa,ell(0)),tnB=new xX(eKo,!1),tnz=(e_3(),ttp),tn$=new xX(eKs,tnz),tnH=(Jp(),teN),tnU=new xX(eKu,tnH),trC=new xX(eKc,!1),ell(0),trL=new xX(eKl,ell(16)),ell(0),trI=new xX(eKf,ell(5)),tiU=(eox(),tsQ),tiB=new xX(eKd,tiU),tiy=new xX(eKh,10),tiE=new xX(eKp,1),tiC=(enB(),teH),tiL=new xX(eKb,tiC),tix=new pO(eKm),tiO=ell(1),ell(0),tiM=new xX(eKg,tiO),tiW=(eiO(),tsV),tiG=new xX(eKv,tiW),tiH=new pO(eKy),tiR=new xX(eKw,!0),tiN=new xX(eK_,2),tiF=new xX(eKE,!0),trp=(eEf(),te8),trh=new xX(eKS,trp),trd=(eSg(),teO),trf=new xX(eKk,trd),tnQ=(esn(),tsM),tnJ=new xX(eKx,tnQ),tnX=new xX(eKT,!1),tnW=(ec4(),e9x),tnG=new xX(eKM,tnW),tnZ=(euJ(),tsn),tnq=new xX(eKO,tnZ),tnK=new xX(eKA,0),tnV=new xX(eKL,0),trR=teK,trP=teR,trz=to9,trW=to9,trF=to6,tre=(eck(),tpz),tri=tej,tn9=tej,tn4=tej,tn6=tpz,tr8=tsp,tr9=tsf,tr2=tsf,tr6=tsf,tie=tsh,tia=tsp,tii=tsp,trk=(efE(),tpM),trT=tpM,trM=tsW,trm=tpT,tiw=ts1,ti_=tsJ,tiS=ts1,tik=tsJ,tiI=ts1,tiD=tsJ,tiT=teU,tiA=teH,tiK=ts1,tiV=tsJ,ti$=ts1,tiz=tsJ,tij=tsJ,tiP=tsJ,tiY=tsJ}function eB$(){eB$=A,e96=new Eq("DIRECTION_PREPROCESSOR",0),e92=new Eq("COMMENT_PREPROCESSOR",1),e95=new Eq("EDGE_AND_LAYER_CONSTRAINT_EDGE_REVERSER",2),e7d=new Eq("INTERACTIVE_EXTERNAL_PORT_POSITIONER",3),e7C=new Eq("PARTITION_PREPROCESSOR",4),e7m=new Eq("LABEL_DUMMY_INSERTER",5),e7j=new Eq("SELF_LOOP_PREPROCESSOR",6),e7_=new Eq("LAYER_CONSTRAINT_PREPROCESSOR",7),e7A=new Eq("PARTITION_MIDPROCESSOR",8),e7s=new Eq("HIGH_DEGREE_NODE_LAYER_PROCESSOR",9),e7x=new Eq("NODE_PROMOTION",10),e7w=new Eq("LAYER_CONSTRAINT_POSTPROCESSOR",11),e7L=new Eq("PARTITION_POSTPROCESSOR",12),e7r=new Eq("HIERARCHICAL_PORT_CONSTRAINT_PROCESSOR",13),e7Y=new Eq("SEMI_INTERACTIVE_CROSSMIN_PROCESSOR",14),e9Z=new Eq("BREAKING_POINT_INSERTER",15),e7k=new Eq("LONG_EDGE_SPLITTER",16),e7D=new Eq("PORT_SIDE_PROCESSOR",17),e7h=new Eq("INVERTED_PORT_PROCESSOR",18),e7I=new Eq("PORT_LIST_SORTER",19),e7U=new Eq("SORT_BY_INPUT_ORDER_OF_MODEL",20),e7M=new Eq("NORTH_SOUTH_PORT_PREPROCESSOR",21),e9X=new Eq("BREAKING_POINT_PROCESSOR",22),e7O=new Eq(eG7,23),e7H=new Eq(eWe,24),e7P=new Eq("SELF_LOOP_PORT_RESTORER",25),e7B=new Eq("SINGLE_EDGE_GRAPH_WRAPPER",26),e7p=new Eq("IN_LAYER_CONSTRAINT_PROCESSOR",27),e7e=new Eq("END_NODE_PORT_LABEL_MANAGEMENT_PROCESSOR",28),e7b=new Eq("LABEL_AND_NODE_SIZE_PROCESSOR",29),e7f=new Eq("INNERMOST_NODE_MARGIN_CALCULATOR",30),e7F=new Eq("SELF_LOOP_ROUTER",31),e91=new Eq("COMMENT_NODE_MARGIN_CALCULATOR",32),e99=new Eq("END_LABEL_PREPROCESSOR",33),e7v=new Eq("LABEL_DUMMY_SWITCHER",34),e9Q=new Eq("CENTER_LABEL_MANAGEMENT_PROCESSOR",35),e7y=new Eq("LABEL_SIDE_SELECTOR",36),e7c=new Eq("HYPEREDGE_DUMMY_MERGER",37),e7i=new Eq("HIERARCHICAL_PORT_DUMMY_SIZE_PROCESSOR",38),e7E=new Eq("LAYER_SIZE_AND_GRAPH_HEIGHT_CALCULATOR",39),e7o=new Eq("HIERARCHICAL_PORT_POSITION_PROCESSOR",40),e93=new Eq("CONSTRAINTS_POSTPROCESSOR",41),e90=new Eq("COMMENT_POSTPROCESSOR",42),e7l=new Eq("HYPERNODE_PROCESSOR",43),e7a=new Eq("HIERARCHICAL_PORT_ORTHOGONAL_EDGE_ROUTER",44),e7S=new Eq("LONG_EDGE_JOINER",45),e7R=new Eq("SELF_LOOP_POSTPROCESSOR",46),e9J=new Eq("BREAKING_POINT_REMOVER",47),e7T=new Eq("NORTH_SOUTH_PORT_POSTPROCESSOR",48),e7u=new Eq("HORIZONTAL_COMPACTOR",49),e7g=new Eq("LABEL_DUMMY_REMOVER",50),e7t=new Eq("FINAL_SPLINE_BENDPOINTS_CALCULATOR",51),e97=new Eq("END_LABEL_SORTER",52),e7N=new Eq("REVERSED_EDGE_RESTORER",53),e98=new Eq("END_LABEL_POSTPROCESSOR",54),e7n=new Eq("HIERARCHICAL_NODE_RESIZER",55),e94=new Eq("DIRECTION_POSTPROCESSOR",56)}function eBz(e,t,n){var r,i,a,o,s,u,c,l,f,d,h,p,b,m,g,v,y,w,_,E,S,k,x,T,M,O,A,L,C,I,D,N,P,R,j,F,Y,B,U,H,$,z,G,W,K,V,q,Z,X,J,Q,ee,et,en,er,ei,ea,eo;for(I=0,X=0,P=(A=t).length;I0&&(e.a[H.p]=X++)}for(D=0,en=0,R=(L=n).length;D0;){for(H=(A5(W.b>0),Pp(W.a.Xb(W.c=--W.b),11)),G=0,s=new fz(H.e);s.a0&&(H.j==(eYu(),tbw)?(e.a[H.p]=en,++en):(e.a[H.p]=en+j+Y,++Y))}en+=Y}for(C=0,z=new p2,p=new Tw,N=(O=t).length;Cc.b&&(c.b=K)):H.i.c==Z&&(Kc.c&&(c.c=K));for(Qe(b,0,b.length,null),et=Je(ty_,eHT,25,b.length,15,1),r=Je(ty_,eHT,25,en+1,15,1),g=0;g0;)S%2>0&&(i+=ea[S+1]),S=(S-1)/2|0,++ea[S];for(w=0,x=Je(e6g,eUp,362,2*b.length,0,1);w'?":IE(eXJ,e)?"'(?<' or '(? toIndex: ",e$M=", toIndex: ",e$O="Index: ",e$A=", Size: ",e$L="org.eclipse.elk.alg.common",e$C={62:1},e$I="org.eclipse.elk.alg.common.compaction",e$D="Scanline/EventHandler",e$N="org.eclipse.elk.alg.common.compaction.oned",e$P="CNode belongs to another CGroup.",e$R="ISpacingsHandler/1",e$j="The ",e$F=" instance has been finished already.",e$Y="The direction ",e$B=" is not supported by the CGraph instance.",e$U="OneDimensionalCompactor",e$H="OneDimensionalCompactor/lambda$0$Type",e$$="Quadruplet",e$z="ScanlineConstraintCalculator",e$G="ScanlineConstraintCalculator/ConstraintsScanlineHandler",e$W="ScanlineConstraintCalculator/ConstraintsScanlineHandler/lambda$0$Type",e$K="ScanlineConstraintCalculator/Timestamp",e$V="ScanlineConstraintCalculator/lambda$0$Type",e$q={169:1,45:1},e$Z="org.eclipse.elk.alg.common.compaction.options",e$X="org.eclipse.elk.core.data",e$J="org.eclipse.elk.polyomino.traversalStrategy",e$Q="org.eclipse.elk.polyomino.lowLevelSort",e$1="org.eclipse.elk.polyomino.highLevelSort",e$0="org.eclipse.elk.polyomino.fill",e$2={130:1},e$3="polyomino",e$4="org.eclipse.elk.alg.common.networksimplex",e$6={177:1,3:1,4:1},e$5="org.eclipse.elk.alg.common.nodespacing",e$8="org.eclipse.elk.alg.common.nodespacing.cellsystem",e$9="CENTER",e$7={212:1,326:1},eze={3:1,4:1,5:1,595:1},ezt="LEFT",ezn="RIGHT",ezr="Vertical alignment cannot be null",ezi="BOTTOM",eza="org.eclipse.elk.alg.common.nodespacing.internal",ezo="UNDEFINED",ezs=.01,ezu="org.eclipse.elk.alg.common.nodespacing.internal.algorithm",ezc="LabelPlacer/lambda$0$Type",ezl="LabelPlacer/lambda$1$Type",ezf="portRatioOrPosition",ezd="org.eclipse.elk.alg.common.overlaps",ezh="DOWN",ezp="org.eclipse.elk.alg.common.polyomino",ezb="NORTH",ezm="EAST",ezg="SOUTH",ezv="WEST",ezy="org.eclipse.elk.alg.common.polyomino.structures",ezw="Direction",ez_="Grid is only of size ",ezE=". Requested point (",ezS=") is out of bounds.",ezk=" Given center based coordinates were (",ezx="org.eclipse.elk.graph.properties",ezT="IPropertyHolder",ezM={3:1,94:1,134:1},ezO="org.eclipse.elk.alg.common.spore",ezA="org.eclipse.elk.alg.common.utils",ezL={209:1},ezC="org.eclipse.elk.core",ezI="Connected Components Compaction",ezD="org.eclipse.elk.alg.disco",ezN="org.eclipse.elk.alg.disco.graph",ezP="org.eclipse.elk.alg.disco.options",ezR="CompactionStrategy",ezj="org.eclipse.elk.disco.componentCompaction.strategy",ezF="org.eclipse.elk.disco.componentCompaction.componentLayoutAlgorithm",ezY="org.eclipse.elk.disco.debug.discoGraph",ezB="org.eclipse.elk.disco.debug.discoPolys",ezU="componentCompaction",ezH="org.eclipse.elk.disco",ez$="org.eclipse.elk.spacing.componentComponent",ezz="org.eclipse.elk.edge.thickness",ezG="org.eclipse.elk.aspectRatio",ezW="org.eclipse.elk.padding",ezK="org.eclipse.elk.alg.disco.transform",ezV=1.5707963267948966,ezq=17976931348623157e292,ezZ={3:1,4:1,5:1,192:1},ezX={3:1,6:1,4:1,5:1,106:1,120:1},ezJ="org.eclipse.elk.alg.force",ezQ="ComponentsProcessor",ez1="ComponentsProcessor/1",ez0="org.eclipse.elk.alg.force.graph",ez2="Component Layout",ez3="org.eclipse.elk.alg.force.model",ez4="org.eclipse.elk.force.model",ez6="org.eclipse.elk.force.iterations",ez5="org.eclipse.elk.force.repulsivePower",ez8="org.eclipse.elk.force.temperature",ez9=.001,ez7="org.eclipse.elk.force.repulsion",eGe="org.eclipse.elk.alg.force.options",eGt=1.600000023841858,eGn="org.eclipse.elk.force",eGr="org.eclipse.elk.priority",eGi="org.eclipse.elk.spacing.nodeNode",eGa="org.eclipse.elk.spacing.edgeLabel",eGo="org.eclipse.elk.randomSeed",eGs="org.eclipse.elk.separateConnectedComponents",eGu="org.eclipse.elk.interactive",eGc="org.eclipse.elk.portConstraints",eGl="org.eclipse.elk.edgeLabels.inline",eGf="org.eclipse.elk.omitNodeMicroLayout",eGd="org.eclipse.elk.nodeSize.options",eGh="org.eclipse.elk.nodeSize.constraints",eGp="org.eclipse.elk.nodeLabels.placement",eGb="org.eclipse.elk.portLabels.placement",eGm="origin",eGg="random",eGv="boundingBox.upLeft",eGy="boundingBox.lowRight",eGw="org.eclipse.elk.stress.fixed",eG_="org.eclipse.elk.stress.desiredEdgeLength",eGE="org.eclipse.elk.stress.dimension",eGS="org.eclipse.elk.stress.epsilon",eGk="org.eclipse.elk.stress.iterationLimit",eGx="org.eclipse.elk.stress",eGT="ELK Stress",eGM="org.eclipse.elk.nodeSize.minimum",eGO="org.eclipse.elk.alg.force.stress",eGA="Layered layout",eGL="org.eclipse.elk.alg.layered",eGC="org.eclipse.elk.alg.layered.compaction.components",eGI="org.eclipse.elk.alg.layered.compaction.oned",eGD="org.eclipse.elk.alg.layered.compaction.oned.algs",eGN="org.eclipse.elk.alg.layered.compaction.recthull",eGP="org.eclipse.elk.alg.layered.components",eGR="NONE",eGj={3:1,6:1,4:1,9:1,5:1,122:1},eGF={3:1,6:1,4:1,5:1,141:1,106:1,120:1},eGY="org.eclipse.elk.alg.layered.compound",eGB={51:1},eGU="org.eclipse.elk.alg.layered.graph",eGH=" -> ",eG$="Not supported by LGraph",eGz="Port side is undefined",eGG={3:1,6:1,4:1,5:1,474:1,141:1,106:1,120:1},eGW={3:1,6:1,4:1,5:1,141:1,193:1,203:1,106:1,120:1},eGK={3:1,6:1,4:1,5:1,141:1,1943:1,203:1,106:1,120:1},eGV="([{\"' \r\n",eGq=")]}\"' \r\n",eGZ="The given string contains parts that cannot be parsed as numbers.",eGX="org.eclipse.elk.core.math",eGJ={3:1,4:1,142:1,207:1,414:1},eGQ={3:1,4:1,116:1,207:1,414:1},eG1="org.eclipse.elk.layered",eG0="org.eclipse.elk.alg.layered.graph.transform",eG2="ElkGraphImporter",eG3="ElkGraphImporter/lambda$0$Type",eG4="ElkGraphImporter/lambda$1$Type",eG6="ElkGraphImporter/lambda$2$Type",eG5="ElkGraphImporter/lambda$4$Type",eG8="Node margin calculation",eG9="org.eclipse.elk.alg.layered.intermediate",eG7="ONE_SIDED_GREEDY_SWITCH",eWe="TWO_SIDED_GREEDY_SWITCH",eWt="No implementation is available for the layout processor ",eWn="IntermediateProcessorStrategy",eWr="Node '",eWi="FIRST_SEPARATE",eWa="LAST_SEPARATE",eWo="Odd port side processing",eWs="org.eclipse.elk.alg.layered.intermediate.compaction",eWu="org.eclipse.elk.alg.layered.intermediate.greedyswitch",eWc="org.eclipse.elk.alg.layered.p3order.counting",eWl={225:1},eWf="org.eclipse.elk.alg.layered.intermediate.loops",eWd="org.eclipse.elk.alg.layered.intermediate.loops.ordering",eWh="org.eclipse.elk.alg.layered.intermediate.loops.routing",eWp="org.eclipse.elk.alg.layered.intermediate.preserveorder",eWb="org.eclipse.elk.alg.layered.intermediate.wrapping",eWm="org.eclipse.elk.alg.layered.options",eWg="INTERACTIVE",eWv="DEPTH_FIRST",eWy="EDGE_LENGTH",eWw="SELF_LOOPS",eW_="firstTryWithInitialOrder",eWE="org.eclipse.elk.layered.directionCongruency",eWS="org.eclipse.elk.layered.feedbackEdges",eWk="org.eclipse.elk.layered.interactiveReferencePoint",eWx="org.eclipse.elk.layered.mergeEdges",eWT="org.eclipse.elk.layered.mergeHierarchyEdges",eWM="org.eclipse.elk.layered.allowNonFlowPortsToSwitchSides",eWO="org.eclipse.elk.layered.portSortingStrategy",eWA="org.eclipse.elk.layered.thoroughness",eWL="org.eclipse.elk.layered.unnecessaryBendpoints",eWC="org.eclipse.elk.layered.generatePositionAndLayerIds",eWI="org.eclipse.elk.layered.cycleBreaking.strategy",eWD="org.eclipse.elk.layered.layering.strategy",eWN="org.eclipse.elk.layered.layering.layerConstraint",eWP="org.eclipse.elk.layered.layering.layerChoiceConstraint",eWR="org.eclipse.elk.layered.layering.layerId",eWj="org.eclipse.elk.layered.layering.minWidth.upperBoundOnWidth",eWF="org.eclipse.elk.layered.layering.minWidth.upperLayerEstimationScalingFactor",eWY="org.eclipse.elk.layered.layering.nodePromotion.strategy",eWB="org.eclipse.elk.layered.layering.nodePromotion.maxIterations",eWU="org.eclipse.elk.layered.layering.coffmanGraham.layerBound",eWH="org.eclipse.elk.layered.crossingMinimization.strategy",eW$="org.eclipse.elk.layered.crossingMinimization.forceNodeModelOrder",eWz="org.eclipse.elk.layered.crossingMinimization.hierarchicalSweepiness",eWG="org.eclipse.elk.layered.crossingMinimization.semiInteractive",eWW="org.eclipse.elk.layered.crossingMinimization.positionChoiceConstraint",eWK="org.eclipse.elk.layered.crossingMinimization.positionId",eWV="org.eclipse.elk.layered.crossingMinimization.greedySwitch.activationThreshold",eWq="org.eclipse.elk.layered.crossingMinimization.greedySwitch.type",eWZ="org.eclipse.elk.layered.crossingMinimization.greedySwitchHierarchical.type",eWX="org.eclipse.elk.layered.nodePlacement.strategy",eWJ="org.eclipse.elk.layered.nodePlacement.favorStraightEdges",eWQ="org.eclipse.elk.layered.nodePlacement.bk.edgeStraightening",eW1="org.eclipse.elk.layered.nodePlacement.bk.fixedAlignment",eW0="org.eclipse.elk.layered.nodePlacement.linearSegments.deflectionDampening",eW2="org.eclipse.elk.layered.nodePlacement.networkSimplex.nodeFlexibility",eW3="org.eclipse.elk.layered.nodePlacement.networkSimplex.nodeFlexibility.default",eW4="org.eclipse.elk.layered.edgeRouting.selfLoopDistribution",eW6="org.eclipse.elk.layered.edgeRouting.selfLoopOrdering",eW5="org.eclipse.elk.layered.edgeRouting.splines.mode",eW8="org.eclipse.elk.layered.edgeRouting.splines.sloppy.layerSpacingFactor",eW9="org.eclipse.elk.layered.edgeRouting.polyline.slopedEdgeZoneWidth",eW7="org.eclipse.elk.layered.spacing.baseValue",eKe="org.eclipse.elk.layered.spacing.edgeNodeBetweenLayers",eKt="org.eclipse.elk.layered.spacing.edgeEdgeBetweenLayers",eKn="org.eclipse.elk.layered.spacing.nodeNodeBetweenLayers",eKr="org.eclipse.elk.layered.priority.direction",eKi="org.eclipse.elk.layered.priority.shortness",eKa="org.eclipse.elk.layered.priority.straightness",eKo="org.eclipse.elk.layered.compaction.connectedComponents",eKs="org.eclipse.elk.layered.compaction.postCompaction.strategy",eKu="org.eclipse.elk.layered.compaction.postCompaction.constraints",eKc="org.eclipse.elk.layered.highDegreeNodes.treatment",eKl="org.eclipse.elk.layered.highDegreeNodes.threshold",eKf="org.eclipse.elk.layered.highDegreeNodes.treeHeight",eKd="org.eclipse.elk.layered.wrapping.strategy",eKh="org.eclipse.elk.layered.wrapping.additionalEdgeSpacing",eKp="org.eclipse.elk.layered.wrapping.correctionFactor",eKb="org.eclipse.elk.layered.wrapping.cutting.strategy",eKm="org.eclipse.elk.layered.wrapping.cutting.cuts",eKg="org.eclipse.elk.layered.wrapping.cutting.msd.freedom",eKv="org.eclipse.elk.layered.wrapping.validify.strategy",eKy="org.eclipse.elk.layered.wrapping.validify.forbiddenIndices",eKw="org.eclipse.elk.layered.wrapping.multiEdge.improveCuts",eK_="org.eclipse.elk.layered.wrapping.multiEdge.distancePenalty",eKE="org.eclipse.elk.layered.wrapping.multiEdge.improveWrappedEdges",eKS="org.eclipse.elk.layered.edgeLabels.sideSelection",eKk="org.eclipse.elk.layered.edgeLabels.centerLabelPlacementStrategy",eKx="org.eclipse.elk.layered.considerModelOrder.strategy",eKT="org.eclipse.elk.layered.considerModelOrder.noModelOrder",eKM="org.eclipse.elk.layered.considerModelOrder.components",eKO="org.eclipse.elk.layered.considerModelOrder.longEdgeStrategy",eKA="org.eclipse.elk.layered.considerModelOrder.crossingCounterNodeInfluence",eKL="org.eclipse.elk.layered.considerModelOrder.crossingCounterPortInfluence",eKC="layering",eKI="layering.minWidth",eKD="layering.nodePromotion",eKN="crossingMinimization",eKP="org.eclipse.elk.hierarchyHandling",eKR="crossingMinimization.greedySwitch",eKj="nodePlacement",eKF="nodePlacement.bk",eKY="edgeRouting",eKB="org.eclipse.elk.edgeRouting",eKU="spacing",eKH="priority",eK$="compaction",eKz="compaction.postCompaction",eKG="Specifies whether and how post-process compaction is applied.",eKW="highDegreeNodes",eKK="wrapping",eKV="wrapping.cutting",eKq="wrapping.validify",eKZ="wrapping.multiEdge",eKX="edgeLabels",eKJ="considerModelOrder",eKQ="org.eclipse.elk.spacing.commentComment",eK1="org.eclipse.elk.spacing.commentNode",eK0="org.eclipse.elk.spacing.edgeEdge",eK2="org.eclipse.elk.spacing.edgeNode",eK3="org.eclipse.elk.spacing.labelLabel",eK4="org.eclipse.elk.spacing.labelPortHorizontal",eK6="org.eclipse.elk.spacing.labelPortVertical",eK5="org.eclipse.elk.spacing.labelNode",eK8="org.eclipse.elk.spacing.nodeSelfLoop",eK9="org.eclipse.elk.spacing.portPort",eK7="org.eclipse.elk.spacing.individual",eVe="org.eclipse.elk.port.borderOffset",eVt="org.eclipse.elk.noLayout",eVn="org.eclipse.elk.port.side",eVr="org.eclipse.elk.debugMode",eVi="org.eclipse.elk.alignment",eVa="org.eclipse.elk.insideSelfLoops.activate",eVo="org.eclipse.elk.insideSelfLoops.yo",eVs="org.eclipse.elk.nodeSize.fixedGraphSize",eVu="org.eclipse.elk.direction",eVc="org.eclipse.elk.nodeLabels.padding",eVl="org.eclipse.elk.portLabels.nextToPortIfPossible",eVf="org.eclipse.elk.portLabels.treatAsGroup",eVd="org.eclipse.elk.portAlignment.default",eVh="org.eclipse.elk.portAlignment.north",eVp="org.eclipse.elk.portAlignment.south",eVb="org.eclipse.elk.portAlignment.west",eVm="org.eclipse.elk.portAlignment.east",eVg="org.eclipse.elk.contentAlignment",eVv="org.eclipse.elk.junctionPoints",eVy="org.eclipse.elk.edgeLabels.placement",eVw="org.eclipse.elk.port.index",eV_="org.eclipse.elk.commentBox",eVE="org.eclipse.elk.hypernode",eVS="org.eclipse.elk.port.anchor",eVk="org.eclipse.elk.partitioning.activate",eVx="org.eclipse.elk.partitioning.partition",eVT="org.eclipse.elk.position",eVM="org.eclipse.elk.margins",eVO="org.eclipse.elk.spacing.portsSurrounding",eVA="org.eclipse.elk.interactiveLayout",eVL="org.eclipse.elk.core.util",eVC={3:1,4:1,5:1,593:1},eVI="NETWORK_SIMPLEX",eVD={123:1,51:1},eVN="org.eclipse.elk.alg.layered.p1cycles",eVP="org.eclipse.elk.alg.layered.p2layers",eVR={402:1,225:1},eVj={832:1,3:1,4:1},eVF="org.eclipse.elk.alg.layered.p3order",eVY="org.eclipse.elk.alg.layered.p4nodes",eVB={3:1,4:1,5:1,840:1},eVU=1e-5,eVH="org.eclipse.elk.alg.layered.p4nodes.bk",eV$="org.eclipse.elk.alg.layered.p5edges",eVz="org.eclipse.elk.alg.layered.p5edges.orthogonal",eVG="org.eclipse.elk.alg.layered.p5edges.orthogonal.direction",eVW=1e-6,eVK="org.eclipse.elk.alg.layered.p5edges.splines",eVV=.09999999999999998,eVq=1e-8,eVZ=4.71238898038469,eVX=3.141592653589793,eVJ="org.eclipse.elk.alg.mrtree",eVQ="org.eclipse.elk.alg.mrtree.graph",eV1="org.eclipse.elk.alg.mrtree.intermediate",eV0="Set neighbors in level",eV2="DESCENDANTS",eV3="org.eclipse.elk.mrtree.weighting",eV4="org.eclipse.elk.mrtree.searchOrder",eV6="org.eclipse.elk.alg.mrtree.options",eV5="org.eclipse.elk.mrtree",eV8="org.eclipse.elk.tree",eV9="org.eclipse.elk.alg.radial",eV7=6.283185307179586,eqe=5e-324,eqt="org.eclipse.elk.alg.radial.intermediate",eqn="org.eclipse.elk.alg.radial.intermediate.compaction",eqr={3:1,4:1,5:1,106:1},eqi="org.eclipse.elk.alg.radial.intermediate.optimization",eqa="No implementation is available for the layout option ",eqo="org.eclipse.elk.alg.radial.options",eqs="org.eclipse.elk.radial.orderId",equ="org.eclipse.elk.radial.radius",eqc="org.eclipse.elk.radial.compactor",eql="org.eclipse.elk.radial.compactionStepSize",eqf="org.eclipse.elk.radial.sorter",eqd="org.eclipse.elk.radial.wedgeCriteria",eqh="org.eclipse.elk.radial.optimizationCriteria",eqp="org.eclipse.elk.radial",eqb="org.eclipse.elk.alg.radial.p1position.wedge",eqm="org.eclipse.elk.alg.radial.sorting",eqg=5.497787143782138,eqv=3.9269908169872414,eqy=2.356194490192345,eqw="org.eclipse.elk.alg.rectpacking",eq_="org.eclipse.elk.alg.rectpacking.firstiteration",eqE="org.eclipse.elk.alg.rectpacking.options",eqS="org.eclipse.elk.rectpacking.optimizationGoal",eqk="org.eclipse.elk.rectpacking.lastPlaceShift",eqx="org.eclipse.elk.rectpacking.currentPosition",eqT="org.eclipse.elk.rectpacking.desiredPosition",eqM="org.eclipse.elk.rectpacking.onlyFirstIteration",eqO="org.eclipse.elk.rectpacking.rowCompaction",eqA="org.eclipse.elk.rectpacking.expandToAspectRatio",eqL="org.eclipse.elk.rectpacking.targetWidth",eqC="org.eclipse.elk.expandNodes",eqI="org.eclipse.elk.rectpacking",eqD="org.eclipse.elk.alg.rectpacking.util",eqN="No implementation available for ",eqP="org.eclipse.elk.alg.spore",eqR="org.eclipse.elk.alg.spore.options",eqj="org.eclipse.elk.sporeCompaction",eqF="org.eclipse.elk.underlyingLayoutAlgorithm",eqY="org.eclipse.elk.processingOrder.treeConstruction",eqB="org.eclipse.elk.processingOrder.spanningTreeCostFunction",eqU="org.eclipse.elk.processingOrder.preferredRoot",eqH="org.eclipse.elk.processingOrder.rootSelection",eq$="org.eclipse.elk.structure.structureExtractionStrategy",eqz="org.eclipse.elk.compaction.compactionStrategy",eqG="org.eclipse.elk.compaction.orthogonal",eqW="org.eclipse.elk.overlapRemoval.maxIterations",eqK="org.eclipse.elk.overlapRemoval.runScanline",eqV="processingOrder",eqq="overlapRemoval",eqZ="org.eclipse.elk.sporeOverlap",eqX="org.eclipse.elk.alg.spore.p1structure",eqJ="org.eclipse.elk.alg.spore.p2processingorder",eqQ="org.eclipse.elk.alg.spore.p3execution",eq1="Invalid index: ",eq0="org.eclipse.elk.core.alg",eq2={331:1},eq3={288:1},eq4="Make sure its type is registered with the ",eq6=" utility class.",eq5="true",eq8="false",eq9="Couldn't clone property '",eq7=.05,eZe="org.eclipse.elk.core.options",eZt=1.2999999523162842,eZn="org.eclipse.elk.box",eZr="org.eclipse.elk.box.packingMode",eZi="org.eclipse.elk.algorithm",eZa="org.eclipse.elk.resolvedAlgorithm",eZo="org.eclipse.elk.bendPoints",eZs="org.eclipse.elk.labelManager",eZu="org.eclipse.elk.scaleFactor",eZc="org.eclipse.elk.animate",eZl="org.eclipse.elk.animTimeFactor",eZf="org.eclipse.elk.layoutAncestors",eZd="org.eclipse.elk.maxAnimTime",eZh="org.eclipse.elk.minAnimTime",eZp="org.eclipse.elk.progressBar",eZb="org.eclipse.elk.validateGraph",eZm="org.eclipse.elk.validateOptions",eZg="org.eclipse.elk.zoomToFit",eZv="org.eclipse.elk.font.name",eZy="org.eclipse.elk.font.size",eZw="org.eclipse.elk.edge.type",eZ_="partitioning",eZE="nodeLabels",eZS="portAlignment",eZk="nodeSize",eZx="port",eZT="portLabels",eZM="insideSelfLoops",eZO="org.eclipse.elk.fixed",eZA="org.eclipse.elk.random",eZL="port must have a parent node to calculate the port side",eZC="The edge needs to have exactly one edge section. Found: ",eZI="org.eclipse.elk.core.util.adapters",eZD="org.eclipse.emf.ecore",eZN="org.eclipse.elk.graph",eZP="EMapPropertyHolder",eZR="ElkBendPoint",eZj="ElkGraphElement",eZF="ElkConnectableShape",eZY="ElkEdge",eZB="ElkEdgeSection",eZU="EModelElement",eZH="ENamedElement",eZ$="ElkLabel",eZz="ElkNode",eZG="ElkPort",eZW={92:1,90:1},eZK="org.eclipse.emf.common.notify.impl",eZV="The feature '",eZq="' is not a valid changeable feature",eZZ="Expecting null",eZX="' is not a valid feature",eZJ="The feature ID",eZQ=" is not a valid feature ID",eZ1=32768,eZ0={105:1,92:1,90:1,56:1,49:1,97:1},eZ2="org.eclipse.emf.ecore.impl",eZ3="org.eclipse.elk.graph.impl",eZ4="Recursive containment not allowed for ",eZ6="The datatype '",eZ5="' is not a valid classifier",eZ8="The value '",eZ9={190:1,3:1,4:1},eZ7="The class '",eXe="http://www.eclipse.org/elk/ElkGraph",eXt=1024,eXn="property",eXr="value",eXi="source",eXa="properties",eXo="identifier",eXs="height",eXu="width",eXc="parent",eXl="text",eXf="children",eXd="hierarchical",eXh="sources",eXp="targets",eXb="sections",eXm="bendPoints",eXg="outgoingShape",eXv="incomingShape",eXy="outgoingSections",eXw="incomingSections",eX_="org.eclipse.emf.common.util",eXE="Severe implementation error in the Json to ElkGraph importer.",eXS="id",eXk="org.eclipse.elk.graph.json",eXx="Unhandled parameter types: ",eXT="startPoint",eXM="An edge must have at least one source and one target (edge id: '",eXO="').",eXA="Referenced edge section does not exist: ",eXL=" (edge id: '",eXC="target",eXI="sourcePoint",eXD="targetPoint",eXN="group",eXP="name",eXR="connectableShape cannot be null",eXj="edge cannot be null",eXF="Passed edge is not 'simple'.",eXY="org.eclipse.elk.graph.util",eXB="The 'no duplicates' constraint is violated",eXU="targetIndex=",eXH=", size=",eX$="sourceIndex=",eXz={3:1,4:1,20:1,28:1,52:1,14:1,15:1,54:1,67:1,63:1,58:1},eXG={3:1,4:1,20:1,28:1,52:1,14:1,47:1,15:1,54:1,67:1,63:1,58:1,588:1},eXW="logging",eXK="measureExecutionTime",eXV="parser.parse.1",eXq="parser.parse.2",eXZ="parser.next.1",eXX="parser.next.2",eXJ="parser.next.3",eXQ="parser.next.4",eX1="parser.factor.1",eX0="parser.factor.2",eX2="parser.factor.3",eX3="parser.factor.4",eX4="parser.factor.5",eX6="parser.factor.6",eX5="parser.atom.1",eX8="parser.atom.2",eX9="parser.atom.3",eX7="parser.atom.4",eJe="parser.atom.5",eJt="parser.cc.1",eJn="parser.cc.2",eJr="parser.cc.3",eJi="parser.cc.5",eJa="parser.cc.6",eJo="parser.cc.7",eJs="parser.cc.8",eJu="parser.ope.1",eJc="parser.ope.2",eJl="parser.ope.3",eJf="parser.descape.1",eJd="parser.descape.2",eJh="parser.descape.3",eJp="parser.descape.4",eJb="parser.descape.5",eJm="parser.process.1",eJg="parser.quantifier.1",eJv="parser.quantifier.2",eJy="parser.quantifier.3",eJw="parser.quantifier.4",eJ_="parser.quantifier.5",eJE="org.eclipse.emf.common.notify",eJS={415:1,672:1},eJk={3:1,4:1,20:1,28:1,52:1,14:1,15:1,67:1,58:1},eJx={366:1,143:1},eJT="index=",eJM={3:1,4:1,5:1,126:1},eJO={3:1,4:1,20:1,28:1,52:1,14:1,15:1,54:1,67:1,58:1},eJA={3:1,6:1,4:1,5:1,192:1},eJL={3:1,4:1,5:1,165:1,367:1},eJC=";/?:@&=+$,",eJI="invalid authority: ",eJD="EAnnotation",eJN="ETypedElement",eJP="EStructuralFeature",eJR="EAttribute",eJj="EClassifier",eJF="EEnumLiteral",eJY="EGenericType",eJB="EOperation",eJU="EParameter",eJH="EReference",eJ$="ETypeParameter",eJz="org.eclipse.emf.ecore.util",eJG={76:1},eJW={3:1,20:1,14:1,15:1,58:1,589:1,76:1,69:1,95:1},eJK="org.eclipse.emf.ecore.util.FeatureMap$Entry",eJV=8192,eJq=2048,eJZ="byte",eJX="char",eJJ="double",eJQ="float",eJ1="int",eJ0="long",eJ2="short",eJ3="java.lang.Object",eJ4={3:1,4:1,5:1,247:1},eJ6={3:1,4:1,5:1,673:1},eJ5={3:1,4:1,20:1,28:1,52:1,14:1,15:1,54:1,67:1,63:1,58:1,69:1},eJ8={3:1,4:1,20:1,28:1,52:1,14:1,15:1,54:1,67:1,63:1,58:1,76:1,69:1,95:1},eJ9="mixed",eJ7="http:///org/eclipse/emf/ecore/util/ExtendedMetaData",eQe="kind",eQt={3:1,4:1,5:1,674:1},eQn={3:1,4:1,20:1,28:1,52:1,14:1,15:1,67:1,58:1,76:1,69:1,95:1},eQr={20:1,28:1,52:1,14:1,15:1,58:1,69:1},eQi={47:1,125:1,279:1},eQa={72:1,332:1},eQo="The value of type '",eQs="' must be of type '",eQu=1316,eQc="http://www.eclipse.org/emf/2002/Ecore",eQl=-32768,eQf="constraints",eQd="baseType",eQh="getEStructuralFeature",eQp="getFeatureID",eQb="feature",eQm="getOperationID",eQg="operation",eQv="defaultValue",eQy="eTypeParameters",eQw="isInstance",eQ_="getEEnumLiteral",eQE="eContainingClass",eQS={55:1},eQk={3:1,4:1,5:1,119:1},eQx="org.eclipse.emf.ecore.resource",eQT={92:1,90:1,591:1,1935:1},eQM="org.eclipse.emf.ecore.resource.impl",eQO="unspecified",eQA="simple",eQL="attribute",eQC="attributeWildcard",eQI="element",eQD="elementWildcard",eQN="collapse",eQP="itemType",eQR="namespace",eQj="##targetNamespace",eQF="whiteSpace",eQY="wildcards",eQB="http://www.eclipse.org/emf/2003/XMLType",eQU="##any",eQH="uninitialized",eQ$="The multiplicity constraint is violated",eQz="org.eclipse.emf.ecore.xml.type",eQG="ProcessingInstruction",eQW="SimpleAnyType",eQK="XMLTypeDocumentRoot",eQV="org.eclipse.emf.ecore.xml.type.impl",eQq="INF",eQZ="processing",eQX="ENTITIES_._base",eQJ="minLength",eQQ="ENTITY",eQ1="NCName",eQ0="IDREFS_._base",eQ2="integer",eQ3="token",eQ4="pattern",eQ6="[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*",eQ5="\\i\\c*",eQ8="[\\i-[:]][\\c-[:]]*",eQ9="nonPositiveInteger",eQ7="maxInclusive",e1e="NMTOKEN",e1t="NMTOKENS_._base",e1n="nonNegativeInteger",e1r="minInclusive",e1i="normalizedString",e1a="unsignedByte",e1o="unsignedInt",e1s="18446744073709551615",e1u="unsignedShort",e1c="processingInstruction",e1l="org.eclipse.emf.ecore.xml.type.internal",e1f=1114111,e1d="Internal Error: shorthands: \\u",e1h="xml:isDigit",e1p="xml:isWord",e1b="xml:isSpace",e1m="xml:isNameChar",e1g="xml:isInitialNameChar",e1v="09٠٩۰۹०९০৯੦੯૦૯୦୯௧௯౦౯೦೯൦൯๐๙໐໙༠༩",e1y="AZaz\xc0\xd6\xd8\xf6\xf8ıĴľŁňŊžƀǃǍǰǴǵǺȗɐʨʻˁΆΆΈΊΌΌΎΡΣώϐϖϚϚϜϜϞϞϠϠϢϳЁЌЎяёќўҁҐӄӇӈӋӌӐӫӮӵӸӹԱՖՙՙաֆאתװײءغفيٱڷںھۀێېۓەەۥۦअहऽऽक़ॡঅঌএঐওনপরললশহড়ঢ়য়ৡৰৱਅਊਏਐਓਨਪਰਲਲ਼ਵਸ਼ਸਹਖ਼ੜਫ਼ਫ਼ੲੴઅઋઍઍએઑઓનપરલળવહઽઽૠૠଅଌଏଐଓନପରଲଳଶହଽଽଡ଼ଢ଼ୟୡஅஊஎஐஒகஙசஜஜஞடணதநபமவஷஹఅఌఎఐఒనపళవహౠౡಅಌಎಐಒನಪಳವಹೞೞೠೡഅഌഎഐഒനപഹൠൡกฮะะาำเๅກຂຄຄງຈຊຊຍຍດທນຟມຣລລວວສຫອຮະະາຳຽຽເໄཀཇཉཀྵႠჅაჶᄀᄀᄂᄃᄅᄇᄉᄉᄋᄌᄎᄒᄼᄼᄾᄾᅀᅀᅌᅌᅎᅎᅐᅐᅔᅕᅙᅙᅟᅡᅣᅣᅥᅥᅧᅧᅩᅩᅭᅮᅲᅳᅵᅵᆞᆞᆨᆨᆫᆫᆮᆯᆷᆸᆺᆺᆼᇂᇫᇫᇰᇰᇹᇹḀẛẠỹἀἕἘἝἠὅὈὍὐὗὙὙὛὛὝὝὟώᾀᾴᾶᾼιιῂῄῆῌῐΐῖΊῠῬῲῴῶῼΩΩKÅ℮℮ↀↂ〇〇〡〩ぁゔァヺㄅㄬ一龥가힣",e1w="Private Use",e1_="ASSIGNED",e1E="\0\x7f\x80\xffĀſƀɏɐʯʰ˿̀ͯͰϿЀӿ԰֏֐׿؀ۿ܀ݏހ޿ऀॿঀ৿਀੿઀૿଀୿஀௿ఀ౿ಀ೿ഀൿ඀෿฀๿຀໿ༀ࿿က႟Ⴀჿᄀᇿሀ፿Ꭰ᏿᐀ᙿ ᚟ᚠ᛿ក៿᠀᢯Ḁỿἀ῿ ⁰₟₠⃏⃐⃿℀⅏⅐↏←⇿∀⋿⌀⏿␀␿⑀⑟①⓿─╿▀▟■◿☀⛿✀➿⠀⣿⺀⻿⼀⿟⿰⿿ 〿぀ゟ゠ヿ㄀ㄯ㄰㆏㆐㆟ㆠㆿ㈀㋿㌀㏿㐀䶵一鿿ꀀ꒏꒐꓏가힣豈﫿ffﭏﭐ﷿︠︯︰﹏﹐﹯ﹰ﻾\uFEFF\uFEFF＀￯",e1S="UNASSIGNED",e1k={3:1,117:1},e1x="org.eclipse.emf.ecore.xml.type.util",e1T={3:1,4:1,5:1,368:1},e1M="org.eclipse.xtext.xbase.lib",e1O="Cannot add elements to a Range",e1A="Cannot set elements in a Range",e1L="Cannot remove elements from a Range",e1C="locale",e1I="default",e1D="user.agent",e1N=null;eB4.goog=eB4.goog||{},eB4.goog.global=eB4.goog.global||eB4,e_Q(),eTS(1,null,{},r),eUe.Fb=function(e){return x6(this,e)},eUe.Gb=function(){return this.gm},eUe.Hb=function(){return Ao(this)},eUe.Ib=function(){var e;return yx(esF(this))+"@"+(e=esj(this)>>>0).toString(16)},eUe.equals=function(e){return this.Fb(e)},eUe.hashCode=function(){return this.Hb()},eUe.toString=function(){return this.Ib()},eTS(290,1,{290:1,2026:1},ese),eUe.le=function(e){var t;return(t=new ese).i=4,e>1?t.c=z8(this,e-1):t.c=this,t},eUe.me=function(){return LW(this),this.b},eUe.ne=function(){return yx(this)},eUe.oe=function(){return LW(this),this.k},eUe.pe=function(){return(4&this.i)!=0},eUe.qe=function(){return(1&this.i)!=0},eUe.Ib=function(){return ee5(this)},eUe.i=0;var e1P=1,e1R=Y6(eUc,"Object",1),e1j=Y6(eUc,"Class",290);eTS(1998,1,eUl),Y6(eUf,"Optional",1998),eTS(1170,1998,eUl,i),eUe.Fb=function(e){return e===this},eUe.Hb=function(){return 2040732332},eUe.Ib=function(){return"Optional.absent()"},eUe.Jb=function(e){return Y8(e),m4(),e0l},Y6(eUf,"Absent",1170),eTS(628,1,{},ve),Y6(eUf,"Joiner",628);var e1F=RL(eUf,"Predicate");eTS(582,1,{169:1,582:1,3:1,45:1},c4),eUe.Mb=function(e){return es_(this,e)},eUe.Lb=function(e){return es_(this,e)},eUe.Fb=function(e){var t;return!!M4(e,582)&&(t=Pp(e,582),eT$(this.a,t.a))},eUe.Hb=function(){return esS(this.a)+306654252},eUe.Ib=function(){return eE7(this.a)},Y6(eUf,"Predicates/AndPredicate",582),eTS(408,1998,{408:1,3:1},c6),eUe.Fb=function(e){var t;return!!M4(e,408)&&(t=Pp(e,408),ecX(this.a,t.a))},eUe.Hb=function(){return 1502476572+esj(this.a)},eUe.Ib=function(){return eUm+this.a+")"},eUe.Jb=function(e){return new c6(H6(e.Kb(this.a),"the Function passed to Optional.transform() must not return null."))},Y6(eUf,"Present",408),eTS(198,1,eUv),eUe.Nb=function(e){F9(this,e)},eUe.Qb=function(){g4()},Y6(eUy,"UnmodifiableIterator",198),eTS(1978,198,eUw),eUe.Qb=function(){g4()},eUe.Rb=function(e){throw p7(new bO)},eUe.Wb=function(e){throw p7(new bO)},Y6(eUy,"UnmodifiableListIterator",1978),eTS(386,1978,eUw),eUe.Ob=function(){return this.c0},eUe.Pb=function(){if(this.c>=this.d)throw p7(new bC);return this.Xb(this.c++)},eUe.Tb=function(){return this.c},eUe.Ub=function(){if(this.c<=0)throw p7(new bC);return this.Xb(--this.c)},eUe.Vb=function(){return this.c-1},eUe.c=0,eUe.d=0,Y6(eUy,"AbstractIndexedListIterator",386),eTS(699,198,eUv),eUe.Ob=function(){return erE(this)},eUe.Pb=function(){return QR(this)},eUe.e=1,Y6(eUy,"AbstractIterator",699),eTS(1986,1,{224:1}),eUe.Zb=function(){var e;return(e=this.f)||(this.f=this.ac())},eUe.Fb=function(e){return es6(this,e)},eUe.Hb=function(){return esj(this.Zb())},eUe.dc=function(){return 0==this.gc()},eUe.ec=function(){return Fh(this)},eUe.Ib=function(){return efF(this.Zb())},Y6(eUy,"AbstractMultimap",1986),eTS(726,1986,eU_),eUe.$b=function(){enK(this)},eUe._b=function(e){return yy(this,e)},eUe.ac=function(){return new wI(this,this.c)},eUe.ic=function(e){return this.hc()},eUe.bc=function(){return new OC(this,this.c)},eUe.jc=function(){return this.mc(this.hc())},eUe.kc=function(){return new m$(this)},eUe.lc=function(){return ew4(this.c.vc().Nc(),new o,64,this.d)},eUe.cc=function(e){return Zq(this,e)},eUe.fc=function(e){return eu8(this,e)},eUe.gc=function(){return this.d},eUe.mc=function(e){return Hj(),new fF(e)},eUe.nc=function(){return new mH(this)},eUe.oc=function(){return ew4(this.c.Cc().Nc(),new a,64,this.d)},eUe.pc=function(e,t){return new XS(this,e,t,null)},eUe.d=0,Y6(eUy,"AbstractMapBasedMultimap",726),eTS(1631,726,eU_),eUe.hc=function(){return new XM(this.a)},eUe.jc=function(){return Hj(),Hj(),e2r},eUe.cc=function(e){return Pp(Zq(this,e),15)},eUe.fc=function(e){return Pp(eu8(this,e),15)},eUe.Zb=function(){return HU(this)},eUe.Fb=function(e){return es6(this,e)},eUe.qc=function(e){return Pp(Zq(this,e),15)},eUe.rc=function(e){return Pp(eu8(this,e),15)},eUe.mc=function(e){return $a(Pp(e,15))},eUe.pc=function(e,t){return Vu(this,e,Pp(t,15),null)},Y6(eUy,"AbstractListMultimap",1631),eTS(732,1,eUE),eUe.Nb=function(e){F9(this,e)},eUe.Ob=function(){return this.c.Ob()||this.e.Ob()},eUe.Pb=function(){var e;return this.e.Ob()||(e=Pp(this.c.Pb(),42),this.b=e.cd(),this.a=Pp(e.dd(),14),this.e=this.a.Kc()),this.sc(this.b,this.e.Pb())},eUe.Qb=function(){this.e.Qb(),this.a.dc()&&this.c.Qb(),--this.d.d},Y6(eUy,"AbstractMapBasedMultimap/Itr",732),eTS(1099,732,eUE,mH),eUe.sc=function(e,t){return t},Y6(eUy,"AbstractMapBasedMultimap/1",1099),eTS(1100,1,{},a),eUe.Kb=function(e){return Pp(e,14).Nc()},Y6(eUy,"AbstractMapBasedMultimap/1methodref$spliterator$Type",1100),eTS(1101,732,eUE,m$),eUe.sc=function(e,t){return new wD(e,t)},Y6(eUy,"AbstractMapBasedMultimap/2",1101);var e1Y=RL(eUS,"Map");eTS(1967,1,eUk),eUe.wc=function(e){ear(this,e)},eUe.yc=function(e,t,n){return el5(this,e,t,n)},eUe.$b=function(){this.vc().$b()},eUe.tc=function(e){return emT(this,e)},eUe._b=function(e){return!!ewt(this,e,!1)},eUe.uc=function(e){var t,n,r;for(n=this.vc().Kc();n.Ob();)if(r=(t=Pp(n.Pb(),42)).dd(),xc(e)===xc(r)||null!=e&&ecX(e,r))return!0;return!1},eUe.Fb=function(e){var t,n,r;if(e===this)return!0;if(!M4(e,83)||(r=Pp(e,83),this.gc()!=r.gc()))return!1;for(n=r.vc().Kc();n.Ob();)if(t=Pp(n.Pb(),42),!this.tc(t))return!1;return!0},eUe.xc=function(e){return xu(ewt(this,e,!1))},eUe.Hb=function(){return eoP(this.vc())},eUe.dc=function(){return 0==this.gc()},eUe.ec=function(){return new fk(this)},eUe.zc=function(e,t){throw p7(new gW("Put not supported on this map"))},eUe.Ac=function(e){eij(this,e)},eUe.Bc=function(e){return xu(ewt(this,e,!0))},eUe.gc=function(){return this.vc().gc()},eUe.Ib=function(){return ewb(this)},eUe.Cc=function(){return new fT(this)},Y6(eUS,"AbstractMap",1967),eTS(1987,1967,eUk),eUe.bc=function(){return new wU(this)},eUe.vc=function(){return Fd(this)},eUe.ec=function(){var e;return(e=this.g)||(this.g=this.bc())},eUe.Cc=function(){var e;return(e=this.i)||(this.i=new wH(this))},Y6(eUy,"Maps/ViewCachingAbstractMap",1987),eTS(389,1987,eUk,wI),eUe.xc=function(e){return etl(this,e)},eUe.Bc=function(e){return euT(this,e)},eUe.$b=function(){this.d==this.e.c?this.e.$b():RG(new RK(this))},eUe._b=function(e){return ecD(this.d,e)},eUe.Ec=function(){return new c7(this)},eUe.Dc=function(){return this.Ec()},eUe.Fb=function(e){return this===e||ecX(this.d,e)},eUe.Hb=function(){return esj(this.d)},eUe.ec=function(){return this.e.ec()},eUe.gc=function(){return this.d.gc()},eUe.Ib=function(){return efF(this.d)},Y6(eUy,"AbstractMapBasedMultimap/AsMap",389);var e1B=RL(eUc,"Iterable");eTS(28,1,eUx),eUe.Jc=function(e){qX(this,e)},eUe.Lc=function(){return this.Oc()},eUe.Nc=function(){return new Gq(this,0)},eUe.Oc=function(){return new R1(null,this.Nc())},eUe.Fc=function(e){throw p7(new gW("Add not supported on this collection"))},eUe.Gc=function(e){return er7(this,e)},eUe.$b=function(){UG(this)},eUe.Hc=function(e){return eds(this,e,!1)},eUe.Ic=function(e){return eot(this,e)},eUe.dc=function(){return 0==this.gc()},eUe.Mc=function(e){return eds(this,e,!0)},eUe.Pc=function(){return Fn(this)},eUe.Qc=function(e){return emk(this,e)},eUe.Ib=function(){return e_F(this)},Y6(eUS,"AbstractCollection",28);var e1U=RL(eUS,"Set");eTS(eUT,28,eUM),eUe.Nc=function(){return new Gq(this,1)},eUe.Fb=function(e){return ehN(this,e)},eUe.Hb=function(){return eoP(this)},Y6(eUS,"AbstractSet",eUT),eTS(1970,eUT,eUM),Y6(eUy,"Sets/ImprovedAbstractSet",1970),eTS(1971,1970,eUM),eUe.$b=function(){this.Rc().$b()},eUe.Hc=function(e){return edz(this,e)},eUe.dc=function(){return this.Rc().dc()},eUe.Mc=function(e){var t;return!!this.Hc(e)&&(t=Pp(e,42),this.Rc().ec().Mc(t.cd()))},eUe.gc=function(){return this.Rc().gc()},Y6(eUy,"Maps/EntrySet",1971),eTS(1097,1971,eUM,c7),eUe.Hc=function(e){return ecC(this.a.d.vc(),e)},eUe.Kc=function(){return new RK(this.a)},eUe.Rc=function(){return this.a},eUe.Mc=function(e){var t;return!!ecC(this.a.d.vc(),e)&&(t=Pp(e,42),ZM(this.a.e,t.cd()),!0)},eUe.Nc=function(){return Pl(this.a.d.vc().Nc(),new le(this.a))},Y6(eUy,"AbstractMapBasedMultimap/AsMap/AsMapEntries",1097),eTS(1098,1,{},le),eUe.Kb=function(e){return qJ(this.a,Pp(e,42))},Y6(eUy,"AbstractMapBasedMultimap/AsMap/AsMapEntries/0methodref$wrapEntry$Type",1098),eTS(730,1,eUE,RK),eUe.Nb=function(e){F9(this,e)},eUe.Pb=function(){var e;return e=Pp(this.b.Pb(),42),this.a=Pp(e.dd(),14),qJ(this.c,e)},eUe.Ob=function(){return this.b.Ob()},eUe.Qb=function(){eah(!!this.a),this.b.Qb(),this.c.e.d-=this.a.gc(),this.a.$b(),this.a=null},Y6(eUy,"AbstractMapBasedMultimap/AsMap/AsMapIterator",730),eTS(532,1970,eUM,wU),eUe.$b=function(){this.b.$b()},eUe.Hc=function(e){return this.b._b(e)},eUe.Jc=function(e){Y8(e),this.b.wc(new lk(e))},eUe.dc=function(){return this.b.dc()},eUe.Kc=function(){return new gr(this.b.vc().Kc())},eUe.Mc=function(e){return!!this.b._b(e)&&(this.b.Bc(e),!0)},eUe.gc=function(){return this.b.gc()},Y6(eUy,"Maps/KeySet",532),eTS(318,532,eUM,OC),eUe.$b=function(){var e;RG((e=this.b.vc().Kc(),new wg(this,e)))},eUe.Ic=function(e){return this.b.ec().Ic(e)},eUe.Fb=function(e){return this===e||ecX(this.b.ec(),e)},eUe.Hb=function(){return esj(this.b.ec())},eUe.Kc=function(){var e;return e=this.b.vc().Kc(),new wg(this,e)},eUe.Mc=function(e){var t,n;return n=0,(t=Pp(this.b.Bc(e),14))&&(n=t.gc(),t.$b(),this.a.d-=n),n>0},eUe.Nc=function(){return this.b.ec().Nc()},Y6(eUy,"AbstractMapBasedMultimap/KeySet",318),eTS(731,1,eUE,wg),eUe.Nb=function(e){F9(this,e)},eUe.Ob=function(){return this.c.Ob()},eUe.Pb=function(){return this.a=Pp(this.c.Pb(),42),this.a.cd()},eUe.Qb=function(){var e;eah(!!this.a),e=Pp(this.a.dd(),14),this.c.Qb(),this.b.a.d-=e.gc(),e.$b(),this.a=null},Y6(eUy,"AbstractMapBasedMultimap/KeySet/1",731),eTS(491,389,{83:1,161:1},LX),eUe.bc=function(){return this.Sc()},eUe.ec=function(){return this.Tc()},eUe.Sc=function(){return new wb(this.c,this.Uc())},eUe.Tc=function(){var e;return(e=this.b)||(this.b=this.Sc())},eUe.Uc=function(){return Pp(this.d,161)},Y6(eUy,"AbstractMapBasedMultimap/SortedAsMap",491),eTS(542,491,eUO,LJ),eUe.bc=function(){return new wm(this.a,Pp(Pp(this.d,161),171))},eUe.Sc=function(){return new wm(this.a,Pp(Pp(this.d,161),171))},eUe.ec=function(){var e;return Pp((e=this.b)||(this.b=new wm(this.a,Pp(Pp(this.d,161),171))),271)},eUe.Tc=function(){var e;return Pp((e=this.b)||(this.b=new wm(this.a,Pp(Pp(this.d,161),171))),271)},eUe.Uc=function(){return Pp(Pp(this.d,161),171)},Y6(eUy,"AbstractMapBasedMultimap/NavigableAsMap",542),eTS(490,318,eUA,wb),eUe.Nc=function(){return this.b.ec().Nc()},Y6(eUy,"AbstractMapBasedMultimap/SortedKeySet",490),eTS(388,490,eUL,wm),Y6(eUy,"AbstractMapBasedMultimap/NavigableKeySet",388),eTS(541,28,eUx,XS),eUe.Fc=function(e){var t,n;return efH(this),n=this.d.dc(),(t=this.d.Fc(e))&&(++this.f.d,n&&CP(this)),t},eUe.Gc=function(e){var t,n,r;return!e.dc()&&(r=(efH(this),this.d.gc()),(t=this.d.Gc(e))&&(n=this.d.gc(),this.f.d+=n-r,0==r&&CP(this)),t)},eUe.$b=function(){var e;0!=(e=(efH(this),this.d.gc()))&&(this.d.$b(),this.f.d-=e,jY(this))},eUe.Hc=function(e){return efH(this),this.d.Hc(e)},eUe.Ic=function(e){return efH(this),this.d.Ic(e)},eUe.Fb=function(e){return e===this||(efH(this),ecX(this.d,e))},eUe.Hb=function(){return efH(this),esj(this.d)},eUe.Kc=function(){return efH(this),new PS(this)},eUe.Mc=function(e){var t;return efH(this),(t=this.d.Mc(e))&&(--this.f.d,jY(this)),t},eUe.gc=function(){return xw(this)},eUe.Nc=function(){return efH(this),this.d.Nc()},eUe.Ib=function(){return efH(this),efF(this.d)},Y6(eUy,"AbstractMapBasedMultimap/WrappedCollection",541);var e1H=RL(eUS,"List");eTS(728,541,{20:1,28:1,14:1,15:1},Fo),eUe.ad=function(e){er9(this,e)},eUe.Nc=function(){return efH(this),this.d.Nc()},eUe.Vc=function(e,t){var n;efH(this),n=this.d.dc(),Pp(this.d,15).Vc(e,t),++this.a.d,n&&CP(this)},eUe.Wc=function(e,t){var n,r,i;return!t.dc()&&(i=(efH(this),this.d.gc()),(n=Pp(this.d,15).Wc(e,t))&&(r=this.d.gc(),this.a.d+=r-i,0==i&&CP(this)),n)},eUe.Xb=function(e){return efH(this),Pp(this.d,15).Xb(e)},eUe.Xc=function(e){return efH(this),Pp(this.d,15).Xc(e)},eUe.Yc=function(){return efH(this),new Mb(this)},eUe.Zc=function(e){return efH(this),new HM(this,e)},eUe.$c=function(e){var t;return efH(this),t=Pp(this.d,15).$c(e),--this.a.d,jY(this),t},eUe._c=function(e,t){return efH(this),Pp(this.d,15)._c(e,t)},eUe.bd=function(e,t){return efH(this),Vu(this.a,this.e,Pp(this.d,15).bd(e,t),this.b?this.b:this)},Y6(eUy,"AbstractMapBasedMultimap/WrappedList",728),eTS(1096,728,{20:1,28:1,14:1,15:1,54:1},A7),Y6(eUy,"AbstractMapBasedMultimap/RandomAccessWrappedList",1096),eTS(620,1,eUE,PS),eUe.Nb=function(e){F9(this,e)},eUe.Ob=function(){return UW(this),this.b.Ob()},eUe.Pb=function(){return UW(this),this.b.Pb()},eUe.Qb=function(){OG(this)},Y6(eUy,"AbstractMapBasedMultimap/WrappedCollection/WrappedIterator",620),eTS(729,620,eUC,Mb,HM),eUe.Qb=function(){OG(this)},eUe.Rb=function(e){var t;t=0==xw(this.a),(UW(this),Pp(this.b,125)).Rb(e),++this.a.a.d,t&&CP(this.a)},eUe.Sb=function(){return(UW(this),Pp(this.b,125)).Sb()},eUe.Tb=function(){return(UW(this),Pp(this.b,125)).Tb()},eUe.Ub=function(){return(UW(this),Pp(this.b,125)).Ub()},eUe.Vb=function(){return(UW(this),Pp(this.b,125)).Vb()},eUe.Wb=function(e){(UW(this),Pp(this.b,125)).Wb(e)},Y6(eUy,"AbstractMapBasedMultimap/WrappedList/WrappedListIterator",729),eTS(727,541,eUA,L3),eUe.Nc=function(){return efH(this),this.d.Nc()},Y6(eUy,"AbstractMapBasedMultimap/WrappedSortedSet",727),eTS(1095,727,eUL,TB),Y6(eUy,"AbstractMapBasedMultimap/WrappedNavigableSet",1095),eTS(1094,541,eUM,L4),eUe.Nc=function(){return efH(this),this.d.Nc()},Y6(eUy,"AbstractMapBasedMultimap/WrappedSet",1094),eTS(1103,1,{},o),eUe.Kb=function(e){return Xb(Pp(e,42))},Y6(eUy,"AbstractMapBasedMultimap/lambda$1$Type",1103),eTS(1102,1,{},lt),eUe.Kb=function(e){return new wD(this.a,e)},Y6(eUy,"AbstractMapBasedMultimap/lambda$2$Type",1102);var e1$=RL(eUS,"Map/Entry");eTS(345,1,eUI),eUe.Fb=function(e){var t;return!!M4(e,42)&&(t=Pp(e,42),BG(this.cd(),t.cd())&&BG(this.dd(),t.dd()))},eUe.Hb=function(){var e,t;return e=this.cd(),t=this.dd(),(null==e?0:esj(e))^(null==t?0:esj(t))},eUe.ed=function(e){throw p7(new bO)},eUe.Ib=function(){return this.cd()+"="+this.dd()},Y6(eUy,eUD,345),eTS(1988,28,eUx),eUe.$b=function(){this.fd().$b()},eUe.Hc=function(e){var t;return!!M4(e,42)&&(t=Pp(e,42),Kr(this.fd(),t.cd(),t.dd()))},eUe.Mc=function(e){var t;return!!M4(e,42)&&(t=Pp(e,42),Ki(this.fd(),t.cd(),t.dd()))},eUe.gc=function(){return this.fd().d},Y6(eUy,"Multimaps/Entries",1988),eTS(733,1988,eUx,ln),eUe.Kc=function(){return this.a.kc()},eUe.fd=function(){return this.a},eUe.Nc=function(){return this.a.lc()},Y6(eUy,"AbstractMultimap/Entries",733),eTS(734,733,eUM,mz),eUe.Nc=function(){return this.a.lc()},eUe.Fb=function(e){return eEB(this,e)},eUe.Hb=function(){return eie(this)},Y6(eUy,"AbstractMultimap/EntrySet",734),eTS(735,28,eUx,lr),eUe.$b=function(){this.a.$b()},eUe.Hc=function(e){return eun(this.a,e)},eUe.Kc=function(){return this.a.nc()},eUe.gc=function(){return this.a.d},eUe.Nc=function(){return this.a.oc()},Y6(eUy,"AbstractMultimap/Values",735),eTS(1989,28,{835:1,20:1,28:1,14:1}),eUe.Jc=function(e){Y8(e),Uz(this).Jc(new lS(e))},eUe.Nc=function(){var e;return ew4(e=Uz(this).Nc(),new y,64|1296&e.qd(),this.a.d)},eUe.Fc=function(e){return g6(),!0},eUe.Gc=function(e){return Y8(this),Y8(e),M4(e,543)?KM(Pp(e,835)):!e.dc()&&eel(this,e.Kc())},eUe.Hc=function(e){var t;return((t=Pp(ecA(HU(this.a),e),14))?t.gc():0)>0},eUe.Fb=function(e){return eMc(this,e)},eUe.Hb=function(){return esj(Uz(this))},eUe.dc=function(){return Uz(this).dc()},eUe.Mc=function(e){return ekJ(this,e,1)>0},eUe.Ib=function(){return efF(Uz(this))},Y6(eUy,"AbstractMultiset",1989),eTS(1991,1970,eUM),eUe.$b=function(){enK(this.a.a)},eUe.Hc=function(e){var t,n;return!!M4(e,492)&&(n=Pp(e,416),!(0>=Pp(n.a.dd(),14).gc())&&(t=GB(this.a,n.a.cd()))==Pp(n.a.dd(),14).gc())},eUe.Mc=function(e){var t,n,r,i;return!!M4(e,492)&&(t=(n=Pp(e,416)).a.cd(),0!=(r=Pp(n.a.dd(),14).gc()))&&ekQ(i=this.a,t,r)},Y6(eUy,"Multisets/EntrySet",1991),eTS(1109,1991,eUM,li),eUe.Kc=function(){return new ga(Fd(HU(this.a.a)).Kc())},eUe.gc=function(){return HU(this.a.a).gc()},Y6(eUy,"AbstractMultiset/EntrySet",1109),eTS(619,726,eU_),eUe.hc=function(){return this.gd()},eUe.jc=function(){return this.hd()},eUe.cc=function(e){return this.jd(e)},eUe.fc=function(e){return this.kd(e)},eUe.Zb=function(){var e;return(e=this.f)||(this.f=this.ac())},eUe.hd=function(){return Hj(),Hj(),e2a},eUe.Fb=function(e){return es6(this,e)},eUe.jd=function(e){return Pp(Zq(this,e),21)},eUe.kd=function(e){return Pp(eu8(this,e),21)},eUe.mc=function(e){return Hj(),new vd(Pp(e,21))},eUe.pc=function(e,t){return new L4(this,e,Pp(t,21))},Y6(eUy,"AbstractSetMultimap",619),eTS(1657,619,eU_),eUe.hc=function(){return new yB(this.b)},eUe.gd=function(){return new yB(this.b)},eUe.jc=function(){return Bo(new yB(this.b))},eUe.hd=function(){return Bo(new yB(this.b))},eUe.cc=function(e){return Pp(Pp(Zq(this,e),21),84)},eUe.jd=function(e){return Pp(Pp(Zq(this,e),21),84)},eUe.fc=function(e){return Pp(Pp(eu8(this,e),21),84)},eUe.kd=function(e){return Pp(Pp(eu8(this,e),21),84)},eUe.mc=function(e){return M4(e,271)?Bo(Pp(e,271)):(Hj(),new O4(Pp(e,84)))},eUe.Zb=function(){var e;return(e=this.f)||(this.f=M4(this.c,171)?new LJ(this,Pp(this.c,171)):M4(this.c,161)?new LX(this,Pp(this.c,161)):new wI(this,this.c))},eUe.pc=function(e,t){return M4(t,271)?new TB(this,e,Pp(t,271)):new L3(this,e,Pp(t,84))},Y6(eUy,"AbstractSortedSetMultimap",1657),eTS(1658,1657,eU_),eUe.Zb=function(){var e;return Pp(Pp((e=this.f)||(this.f=M4(this.c,171)?new LJ(this,Pp(this.c,171)):M4(this.c,161)?new LX(this,Pp(this.c,161)):new wI(this,this.c)),161),171)},eUe.ec=function(){var e;return Pp(Pp((e=this.i)||(this.i=M4(this.c,171)?new wm(this,Pp(this.c,171)):M4(this.c,161)?new wb(this,Pp(this.c,161)):new OC(this,this.c)),84),271)},eUe.bc=function(){return M4(this.c,171)?new wm(this,Pp(this.c,171)):M4(this.c,161)?new wb(this,Pp(this.c,161)):new OC(this,this.c)},Y6(eUy,"AbstractSortedKeySortedSetMultimap",1658),eTS(2010,1,{1947:1}),eUe.Fb=function(e){return ev7(this,e)},eUe.Hb=function(){var e;return eoP((e=this.g)||(this.g=new la(this)))},eUe.Ib=function(){var e;return ewb((e=this.f)||(this.f=new OP(this)))},Y6(eUy,"AbstractTable",2010),eTS(665,eUT,eUM,la),eUe.$b=function(){g5()},eUe.Hc=function(e){var t,n;return!!M4(e,468)&&(t=Pp(e,682),!!(n=Pp(ecA(Y7(this.a),xh(t.c.e,t.b)),83))&&ecC(n.vc(),new wD(xh(t.c.c,t.a),X_(t.c,t.b,t.a))))},eUe.Kc=function(){return $e(this.a)},eUe.Mc=function(e){var t,n;return!!M4(e,468)&&(t=Pp(e,682),!!(n=Pp(ecA(Y7(this.a),xh(t.c.e,t.b)),83))&&ecI(n.vc(),new wD(xh(t.c.c,t.a),X_(t.c,t.b,t.a))))},eUe.gc=function(){return R9(this.a)},eUe.Nc=function(){return KH(this.a)},Y6(eUy,"AbstractTable/CellSet",665),eTS(1928,28,eUx,lo),eUe.$b=function(){g5()},eUe.Hc=function(e){return ewx(this.a,e)},eUe.Kc=function(){return $t(this.a)},eUe.gc=function(){return R9(this.a)},eUe.Nc=function(){return Kd(this.a)},Y6(eUy,"AbstractTable/Values",1928),eTS(1632,1631,eU_),Y6(eUy,"ArrayListMultimapGwtSerializationDependencies",1632),eTS(513,1632,eU_,gQ,G$),eUe.hc=function(){return new XM(this.a)},eUe.a=0,Y6(eUy,"ArrayListMultimap",513),eTS(664,2010,{664:1,1947:1,3:1},exj),Y6(eUy,"ArrayTable",664),eTS(1924,386,eUw,OI),eUe.Xb=function(e){return new eo7(this.a,e)},Y6(eUy,"ArrayTable/1",1924),eTS(1925,1,{},c5),eUe.ld=function(e){return new eo7(this.a,e)},Y6(eUy,"ArrayTable/1methodref$getCell$Type",1925),eTS(2011,1,{682:1}),eUe.Fb=function(e){var t;return e===this||!!M4(e,468)&&(t=Pp(e,682),BG(xh(this.c.e,this.b),xh(t.c.e,t.b))&&BG(xh(this.c.c,this.a),xh(t.c.c,t.a))&&BG(X_(this.c,this.b,this.a),X_(t.c,t.b,t.a)))},eUe.Hb=function(){return euF(eow(vx(e1R,1),eUp,1,5,[xh(this.c.e,this.b),xh(this.c.c,this.a),X_(this.c,this.b,this.a)]))},eUe.Ib=function(){return"("+xh(this.c.e,this.b)+","+xh(this.c.c,this.a)+")="+X_(this.c,this.b,this.a)},Y6(eUy,"Tables/AbstractCell",2011),eTS(468,2011,{468:1,682:1},eo7),eUe.a=0,eUe.b=0,eUe.d=0,Y6(eUy,"ArrayTable/2",468),eTS(1927,1,{},c8),eUe.ld=function(e){return Qo(this.a,e)},Y6(eUy,"ArrayTable/2methodref$getValue$Type",1927),eTS(1926,386,eUw,OD),eUe.Xb=function(e){return Qo(this.a,e)},Y6(eUy,"ArrayTable/3",1926),eTS(1979,1967,eUk),eUe.$b=function(){RG(this.kc())},eUe.vc=function(){return new lx(this)},eUe.lc=function(){return new Uq(this.kc(),this.gc())},Y6(eUy,"Maps/IteratorBasedAbstractMap",1979),eTS(828,1979,eUk),eUe.$b=function(){throw p7(new bO)},eUe._b=function(e){return yE(this.c,e)},eUe.kc=function(){return new ON(this,this.c.b.c.gc())},eUe.lc=function(){return Rj(this.c.b.c.gc(),16,new c9(this))},eUe.xc=function(e){var t;return(t=Pp(Iq(this.c,e),19))?this.nd(t.a):null},eUe.dc=function(){return this.c.b.c.dc()},eUe.ec=function(){return Fl(this.c)},eUe.zc=function(e,t){var n;if(!(n=Pp(Iq(this.c,e),19)))throw p7(new gL(this.md()+" "+e+" not in "+Fl(this.c)));return this.od(n.a,t)},eUe.Bc=function(e){throw p7(new bO)},eUe.gc=function(){return this.c.b.c.gc()},Y6(eUy,"ArrayTable/ArrayMap",828),eTS(1923,1,{},c9),eUe.ld=function(e){return Bs(this.a,e)},Y6(eUy,"ArrayTable/ArrayMap/0methodref$getEntry$Type",1923),eTS(1921,345,eUI,wk),eUe.cd=function(){return OB(this.a,this.b)},eUe.dd=function(){return this.a.nd(this.b)},eUe.ed=function(e){return this.a.od(this.b,e)},eUe.b=0,Y6(eUy,"ArrayTable/ArrayMap/1",1921),eTS(1922,386,eUw,ON),eUe.Xb=function(e){return Bs(this.a,e)},Y6(eUy,"ArrayTable/ArrayMap/2",1922),eTS(1920,828,eUk,F2),eUe.md=function(){return"Column"},eUe.nd=function(e){return X_(this.b,this.a,e)},eUe.od=function(e,t){return eoy(this.b,this.a,e,t)},eUe.a=0,Y6(eUy,"ArrayTable/Row",1920),eTS(829,828,eUk,OP),eUe.nd=function(e){return new F2(this.a,e)},eUe.zc=function(e,t){return Pp(t,83),g8()},eUe.od=function(e,t){return Pp(t,83),g9()},eUe.md=function(){return"Row"},Y6(eUy,"ArrayTable/RowMap",829),eTS(1120,1,eUj,wx),eUe.qd=function(){return -262&this.a.qd()},eUe.rd=function(){return this.a.rd()},eUe.Nb=function(e){this.a.Nb(new ww(e,this.b))},eUe.sd=function(e){return this.a.sd(new wy(e,this.b))},Y6(eUy,"CollectSpliterators/1",1120),eTS(1121,1,eUF,wy),eUe.td=function(e){this.a.td(this.b.Kb(e))},Y6(eUy,"CollectSpliterators/1/lambda$0$Type",1121),eTS(1122,1,eUF,ww),eUe.td=function(e){this.a.td(this.b.Kb(e))},Y6(eUy,"CollectSpliterators/1/lambda$1$Type",1122),eTS(1123,1,eUj,K4),eUe.qd=function(){return this.a},eUe.rd=function(){return this.d&&(this.b=MS(this.b,this.d.rd())),MS(this.b,0)},eUe.Nb=function(e){this.d&&(this.d.Nb(e),this.d=null),this.c.Nb(new wv(this.e,e)),this.b=0},eUe.sd=function(e){for(;;){if(this.d&&this.d.sd(e))return xg(this.b,eUY)&&(this.b=efe(this.b,1)),!0;if(this.d=null,!this.c.sd(new w_(this,this.e)))return!1}},eUe.a=0,eUe.b=0,Y6(eUy,"CollectSpliterators/1FlatMapSpliterator",1123),eTS(1124,1,eUF,w_),eUe.td=function(e){Iv(this.a,this.b,e)},Y6(eUy,"CollectSpliterators/1FlatMapSpliterator/lambda$0$Type",1124),eTS(1125,1,eUF,wv),eUe.td=function(e){M8(this.b,this.a,e)},Y6(eUy,"CollectSpliterators/1FlatMapSpliterator/lambda$1$Type",1125),eTS(1117,1,eUj,Ig),eUe.qd=function(){return 16464|this.b},eUe.rd=function(){return this.a.rd()},eUe.Nb=function(e){this.a.xe(new wS(e,this.c))},eUe.sd=function(e){return this.a.ye(new wE(e,this.c))},eUe.b=0,Y6(eUy,"CollectSpliterators/1WithCharacteristics",1117),eTS(1118,1,eUB,wE),eUe.ud=function(e){this.a.td(this.b.ld(e))},Y6(eUy,"CollectSpliterators/1WithCharacteristics/lambda$0$Type",1118),eTS(1119,1,eUB,wS),eUe.ud=function(e){this.a.td(this.b.ld(e))},Y6(eUy,"CollectSpliterators/1WithCharacteristics/lambda$1$Type",1119),eTS(245,1,eUU),eUe.wd=function(e){return this.vd(Pp(e,245))},eUe.vd=function(e){var t;return e==(m2(),e0d)?1:e==(m3(),e0f)?-1:0!=(t=(Rg(),eiK(this.a,e.a)))?t:M4(this,519)==M4(e,519)?0:M4(this,519)?1:-1},eUe.zd=function(){return this.a},eUe.Fb=function(e){return ehd(this,e)},Y6(eUy,"Cut",245),eTS(1761,245,eUU,vb),eUe.vd=function(e){return e==this?0:1},eUe.xd=function(e){throw p7(new b_)},eUe.yd=function(e){e.a+="+∞)"},eUe.zd=function(){throw p7(new gC(eUH))},eUe.Hb=function(){return wK(),ebh(this)},eUe.Ad=function(e){return!1},eUe.Ib=function(){return"+∞"},Y6(eUy,"Cut/AboveAll",1761),eTS(519,245,{245:1,519:1,3:1,35:1},OW),eUe.xd=function(e){xT((e.a+="(",e),this.a)},eUe.yd=function(e){Bd(xT(e,this.a),93)},eUe.Hb=function(){return~esj(this.a)},eUe.Ad=function(e){return Rg(),0>eiK(this.a,e)},eUe.Ib=function(){return"/"+this.a+"\\"},Y6(eUy,"Cut/AboveValue",519),eTS(1760,245,eUU,vm),eUe.vd=function(e){return e==this?0:-1},eUe.xd=function(e){e.a+="(-∞"},eUe.yd=function(e){throw p7(new b_)},eUe.zd=function(){throw p7(new gC(eUH))},eUe.Hb=function(){return wK(),ebh(this)},eUe.Ad=function(e){return!0},eUe.Ib=function(){return"-∞"},Y6(eUy,"Cut/BelowAll",1760),eTS(1762,245,eUU,OK),eUe.xd=function(e){xT((e.a+="[",e),this.a)},eUe.yd=function(e){Bd(xT(e,this.a),41)},eUe.Hb=function(){return esj(this.a)},eUe.Ad=function(e){return Rg(),0>=eiK(this.a,e)},eUe.Ib=function(){return"\\"+this.a+"/"},Y6(eUy,"Cut/BelowValue",1762),eTS(537,1,eU$),eUe.Jc=function(e){qX(this,e)},eUe.Ib=function(){return elq(Pp(H6(this,"use Optional.orNull() instead of Optional.or(null)"),20).Kc())},Y6(eUy,"FluentIterable",537),eTS(433,537,eU$,xq),eUe.Kc=function(){return new Fa(OH(this.a.Kc(),new c))},Y6(eUy,"FluentIterable/2",433),eTS(1046,537,eU$,xZ),eUe.Kc=function(){return Y_(this)},Y6(eUy,"FluentIterable/3",1046),eTS(708,386,eUw,Oj),eUe.Xb=function(e){return this.a[e].Kc()},Y6(eUy,"FluentIterable/3/1",708),eTS(1972,1,{}),eUe.Ib=function(){return efF(this.Bd().b)},Y6(eUy,"ForwardingObject",1972),eTS(1973,1972,eUz),eUe.Bd=function(){return this.Cd()},eUe.Jc=function(e){qX(this,e)},eUe.Lc=function(){return this.Oc()},eUe.Nc=function(){return new Gq(this,0)},eUe.Oc=function(){return new R1(null,this.Nc())},eUe.Fc=function(e){return this.Cd(),yD()},eUe.Gc=function(e){return this.Cd(),yN()},eUe.$b=function(){this.Cd(),yP()},eUe.Hc=function(e){return this.Cd().Hc(e)},eUe.Ic=function(e){return this.Cd().Ic(e)},eUe.dc=function(){return this.Cd().b.dc()},eUe.Kc=function(){return this.Cd().Kc()},eUe.Mc=function(e){return this.Cd(),yR()},eUe.gc=function(){return this.Cd().b.gc()},eUe.Pc=function(){return this.Cd().Pc()},eUe.Qc=function(e){return this.Cd().Qc(e)},Y6(eUy,"ForwardingCollection",1973),eTS(1980,28,eUG),eUe.Kc=function(){return this.Ed()},eUe.Fc=function(e){throw p7(new bO)},eUe.Gc=function(e){throw p7(new bO)},eUe.$b=function(){throw p7(new bO)},eUe.Hc=function(e){return null!=e&&eds(this,e,!1)},eUe.Dd=function(){switch(this.gc()){case 0:return Bx(),Bx(),e0h;case 1:return Bx(),new Rz(Y8(this.Ed().Pb()));default:return new F3(this,this.Pc())}},eUe.Mc=function(e){throw p7(new bO)},Y6(eUy,"ImmutableCollection",1980),eTS(712,1980,eUG,bb),eUe.Kc=function(){return JJ(this.a.Kc())},eUe.Hc=function(e){return null!=e&&this.a.Hc(e)},eUe.Ic=function(e){return this.a.Ic(e)},eUe.dc=function(){return this.a.dc()},eUe.Ed=function(){return JJ(this.a.Kc())},eUe.gc=function(){return this.a.gc()},eUe.Pc=function(){return this.a.Pc()},eUe.Qc=function(e){return this.a.Qc(e)},eUe.Ib=function(){return efF(this.a)},Y6(eUy,"ForwardingImmutableCollection",712),eTS(152,1980,eUW),eUe.Kc=function(){return this.Ed()},eUe.Yc=function(){return this.Fd(0)},eUe.Zc=function(e){return this.Fd(e)},eUe.ad=function(e){er9(this,e)},eUe.Nc=function(){return new Gq(this,16)},eUe.bd=function(e,t){return this.Gd(e,t)},eUe.Vc=function(e,t){throw p7(new bO)},eUe.Wc=function(e,t){throw p7(new bO)},eUe.Fb=function(e){return eTJ(this,e)},eUe.Hb=function(){return eaI(this)},eUe.Xc=function(e){return null==e?-1:emx(this,e)},eUe.Ed=function(){return this.Fd(0)},eUe.Fd=function(e){return AR(this,e)},eUe.$c=function(e){throw p7(new bO)},eUe._c=function(e,t){throw p7(new bO)},eUe.Gd=function(e,t){var n;return ecT((n=new wz(this),new Gz(n,e,t)))},Y6(eUy,"ImmutableList",152),eTS(2006,152,eUW),eUe.Kc=function(){return JJ(this.Hd().Kc())},eUe.bd=function(e,t){return ecT(this.Hd().bd(e,t))},eUe.Hc=function(e){return null!=e&&this.Hd().Hc(e)},eUe.Ic=function(e){return this.Hd().Ic(e)},eUe.Fb=function(e){return ecX(this.Hd(),e)},eUe.Xb=function(e){return xh(this,e)},eUe.Hb=function(){return esj(this.Hd())},eUe.Xc=function(e){return this.Hd().Xc(e)},eUe.dc=function(){return this.Hd().dc()},eUe.Ed=function(){return JJ(this.Hd().Kc())},eUe.gc=function(){return this.Hd().gc()},eUe.Gd=function(e,t){return ecT(this.Hd().bd(e,t))},eUe.Pc=function(){return this.Hd().Qc(Je(e1R,eUp,1,this.Hd().gc(),5,1))},eUe.Qc=function(e){return this.Hd().Qc(e)},eUe.Ib=function(){return efF(this.Hd())},Y6(eUy,"ForwardingImmutableList",2006),eTS(714,1,eUV),eUe.vc=function(){return Fc(this)},eUe.wc=function(e){ear(this,e)},eUe.ec=function(){return Fl(this)},eUe.yc=function(e,t,n){return el5(this,e,t,n)},eUe.Cc=function(){return this.Ld()},eUe.$b=function(){throw p7(new bO)},eUe._b=function(e){return null!=this.xc(e)},eUe.uc=function(e){return this.Ld().Hc(e)},eUe.Jd=function(){return new bm(this)},eUe.Kd=function(){return new bg(this)},eUe.Fb=function(e){return eua(this,e)},eUe.Hb=function(){return Fc(this).Hb()},eUe.dc=function(){return 0==this.gc()},eUe.zc=function(e,t){return g7()},eUe.Bc=function(e){throw p7(new bO)},eUe.Ib=function(){return eEo(this)},eUe.Ld=function(){return this.e?this.e:this.e=this.Kd()},eUe.c=null,eUe.d=null,eUe.e=null,Y6(eUy,"ImmutableMap",714),eTS(715,714,eUV),eUe._b=function(e){return yE(this,e)},eUe.uc=function(e){return w1(this.b,e)},eUe.Id=function(){return ecM(new lu(this))},eUe.Jd=function(){return ecM(Uk(this.b))},eUe.Kd=function(){return Dn(),new bb(UE(this.b))},eUe.Fb=function(e){return w2(this.b,e)},eUe.xc=function(e){return Iq(this,e)},eUe.Hb=function(){return esj(this.b.c)},eUe.dc=function(){return this.b.c.dc()},eUe.gc=function(){return this.b.c.gc()},eUe.Ib=function(){return efF(this.b.c)},Y6(eUy,"ForwardingImmutableMap",715),eTS(1974,1973,eUq),eUe.Bd=function(){return this.Md()},eUe.Cd=function(){return this.Md()},eUe.Nc=function(){return new Gq(this,1)},eUe.Fb=function(e){return e===this||this.Md().Fb(e)},eUe.Hb=function(){return this.Md().Hb()},Y6(eUy,"ForwardingSet",1974),eTS(1069,1974,eUq,lu),eUe.Bd=function(){return US(this.a.b)},eUe.Cd=function(){return US(this.a.b)},eUe.Hc=function(e){if(M4(e,42)&&null==Pp(e,42).cd())return!1;try{return wQ(US(this.a.b),e)}catch(t){if(t=eoa(t),M4(t,205))return!1;throw p7(t)}},eUe.Md=function(){return US(this.a.b)},eUe.Qc=function(e){var t;return t=$L(US(this.a.b),e),US(this.a.b).b.gc()=0?"+":"")+(n/60|0),t=Tt(eB4.Math.abs(n)%60),(e_E(),e2l)[this.q.getDay()]+" "+e2f[this.q.getMonth()]+" "+Tt(this.q.getDate())+" "+Tt(this.q.getHours())+":"+Tt(this.q.getMinutes())+":"+Tt(this.q.getSeconds())+" GMT"+e+t+" "+this.q.getFullYear()};var e1Q=Y6(eUS,"Date",199);eTS(1915,199,eHB,evI),eUe.a=!1,eUe.b=0,eUe.c=0,eUe.d=0,eUe.e=0,eUe.f=0,eUe.g=!1,eUe.i=0,eUe.j=0,eUe.k=0,eUe.n=0,eUe.o=0,eUe.p=0,Y6("com.google.gwt.i18n.shared.impl","DateRecord",1915),eTS(1966,1,{}),eUe.fe=function(){return null},eUe.ge=function(){return null},eUe.he=function(){return null},eUe.ie=function(){return null},eUe.je=function(){return null},Y6(eHU,"JSONValue",1966),eTS(216,1966,{216:1},lN,lL),eUe.Fb=function(e){return!!M4(e,216)&&W$(this.a,Pp(e,216).a)},eUe.ee=function(){return be},eUe.Hb=function(){return $n(this.a)},eUe.fe=function(){return this},eUe.Ib=function(){var e,t,n;for(t=0,n=new O0("["),e=this.a.length;t0&&(n.a+=","),xT(n,eep(this,t));return n.a+="]",n.a},Y6(eHU,"JSONArray",216),eTS(483,1966,{483:1},lC),eUe.ee=function(){return bt},eUe.ge=function(){return this},eUe.Ib=function(){return OQ(),""+this.a},eUe.a=!1,Y6(eHU,"JSONBoolean",483),eTS(985,60,eHr,gs),Y6(eHU,"JSONException",985),eTS(1023,1966,{},g),eUe.ee=function(){return bo},eUe.Ib=function(){return eUg},Y6(eHU,"JSONNull",1023),eTS(258,1966,{258:1},lI),eUe.Fb=function(e){return!!M4(e,258)&&this.a==Pp(e,258).a},eUe.ee=function(){return bn},eUe.Hb=function(){return Ti(this.a)},eUe.he=function(){return this},eUe.Ib=function(){return this.a+""},eUe.a=0,Y6(eHU,"JSONNumber",258),eTS(183,1966,{183:1},gu,lD),eUe.Fb=function(e){return!!M4(e,183)&&W$(this.a,Pp(e,183).a)},eUe.ee=function(){return br},eUe.Hb=function(){return $n(this.a)},eUe.ie=function(){return this},eUe.Ib=function(){var e,t,n,r,i,a,o;for(r=0,o=new O0("{"),e=!0,i=(n=a=erG(this,Je(e17,eUP,2,0,6,1))).length;r=0?":"+this.c:"")+")"},eUe.c=0;var e19=Y6(eUc,"StackTraceElement",310);e0c={3:1,475:1,35:1,2:1};var e17=Y6(eUc,eHa,2);eTS(107,418,{475:1},vs,vu,O1),Y6(eUc,"StringBuffer",107),eTS(100,418,{475:1},vc,vl,O0),Y6(eUc,"StringBuilder",100),eTS(687,73,eHZ,vf),Y6(eUc,"StringIndexOutOfBoundsException",687),eTS(2043,1,{}),eTS(844,1,{},N),eUe.Kb=function(e){return Pp(e,78).e},Y6(eUc,"Throwable/lambda$0$Type",844),eTS(41,60,{3:1,102:1,60:1,78:1,41:1},bO,gW),Y6(eUc,"UnsupportedOperationException",41),eTS(240,236,{3:1,35:1,236:1,240:1},eew,yY),eUe.wd=function(e){return eDG(this,Pp(e,240))},eUe.ke=function(){return eEu(eRy(this))},eUe.Fb=function(e){var t;return this===e||!!M4(e,240)&&(t=Pp(e,240),this.e==t.e&&0==eDG(this,t))},eUe.Hb=function(){var e;return 0!=this.b?this.b:this.a<54?(e=eap(this.f),this.b=jE(WM(e,-1)),this.b=33*this.b+jE(WM(Fv(e,32),-1)),this.b=17*this.b+zy(this.e),this.b):(this.b=17*ect(this.c)+zy(this.e),this.b)},eUe.Ib=function(){return eRy(this)},eUe.a=0,eUe.b=0,eUe.d=0,eUe.e=0,eUe.f=0;var e0e=Y6("java.math","BigDecimal",240);eTS(91,236,{3:1,35:1,236:1,91:1},ep4,XE,F7,ey$,eh6,TU),eUe.wd=function(e){return ehI(this,Pp(e,91))},eUe.ke=function(){return eEu(eBw(this,0))},eUe.Fb=function(e){return ef5(this,e)},eUe.Hb=function(){return ect(this)},eUe.Ib=function(){return eBw(this,0)},eUe.b=-2,eUe.c=0,eUe.d=0,eUe.e=0;var e0t=Y6("java.math","BigInteger",91);eTS(488,1967,eUk),eUe.$b=function(){Yy(this)},eUe._b=function(e){return F8(this,e)},eUe.uc=function(e){return euo(this,e,this.g)||euo(this,e,this.f)},eUe.vc=function(){return new fS(this)},eUe.xc=function(e){return Bp(this,e)},eUe.zc=function(e,t){return Um(this,e,t)},eUe.Bc=function(e){return Z3(this,e)},eUe.gc=function(){return wq(this)},Y6(eUS,"AbstractHashMap",488),eTS(261,eUT,eUM,fS),eUe.$b=function(){this.a.$b()},eUe.Hc=function(e){return KN(this,e)},eUe.Kc=function(){return new esz(this.a)},eUe.Mc=function(e){var t;return!!KN(this,e)&&(t=Pp(e,42).cd(),this.a.Bc(t),!0)},eUe.gc=function(){return this.a.gc()},Y6(eUS,"AbstractHashMap/EntrySet",261),eTS(262,1,eUE,esz),eUe.Nb=function(e){F9(this,e)},eUe.Pb=function(){return etz(this)},eUe.Ob=function(){return this.b},eUe.Qb=function(){JM(this)},eUe.b=!1,Y6(eUS,"AbstractHashMap/EntrySetIterator",262),eTS(417,1,eUE,fE),eUe.Nb=function(e){F9(this,e)},eUe.Ob=function(){return Et(this)},eUe.Pb=function(){return HL(this)},eUe.Qb=function(){BH(this)},eUe.b=0,eUe.c=-1,Y6(eUS,"AbstractList/IteratorImpl",417),eTS(96,417,eUC,KB),eUe.Qb=function(){BH(this)},eUe.Rb=function(e){CD(this,e)},eUe.Sb=function(){return this.b>0},eUe.Tb=function(){return this.b},eUe.Ub=function(){return A5(this.b>0),this.a.Xb(this.c=--this.b)},eUe.Vb=function(){return this.b-1},eUe.Wb=function(e){A4(-1!=this.c),this.a._c(this.c,e)},Y6(eUS,"AbstractList/ListIteratorImpl",96),eTS(219,52,eU6,Gz),eUe.Vc=function(e,t){Gp(e,this.b),this.c.Vc(this.a+e,t),++this.b},eUe.Xb=function(e){return GK(e,this.b),this.c.Xb(this.a+e)},eUe.$c=function(e){var t;return GK(e,this.b),t=this.c.$c(this.a+e),--this.b,t},eUe._c=function(e,t){return GK(e,this.b),this.c._c(this.a+e,t)},eUe.gc=function(){return this.b},eUe.a=0,eUe.b=0,Y6(eUS,"AbstractList/SubList",219),eTS(384,eUT,eUM,fk),eUe.$b=function(){this.a.$b()},eUe.Hc=function(e){return this.a._b(e)},eUe.Kc=function(){var e;return e=this.a.vc().Kc(),new fx(e)},eUe.Mc=function(e){return!!this.a._b(e)&&(this.a.Bc(e),!0)},eUe.gc=function(){return this.a.gc()},Y6(eUS,"AbstractMap/1",384),eTS(691,1,eUE,fx),eUe.Nb=function(e){F9(this,e)},eUe.Ob=function(){return this.a.Ob()},eUe.Pb=function(){var e;return(e=Pp(this.a.Pb(),42)).cd()},eUe.Qb=function(){this.a.Qb()},Y6(eUS,"AbstractMap/1/1",691),eTS(226,28,eUx,fT),eUe.$b=function(){this.a.$b()},eUe.Hc=function(e){return this.a.uc(e)},eUe.Kc=function(){var e;return e=this.a.vc().Kc(),new fN(e)},eUe.gc=function(){return this.a.gc()},Y6(eUS,"AbstractMap/2",226),eTS(294,1,eUE,fN),eUe.Nb=function(e){F9(this,e)},eUe.Ob=function(){return this.a.Ob()},eUe.Pb=function(){var e;return(e=Pp(this.a.Pb(),42)).dd()},eUe.Qb=function(){this.a.Qb()},Y6(eUS,"AbstractMap/2/1",294),eTS(484,1,{484:1,42:1}),eUe.Fb=function(e){var t;return!!M4(e,42)&&(t=Pp(e,42),UT(this.d,t.cd())&&UT(this.e,t.dd()))},eUe.cd=function(){return this.d},eUe.dd=function(){return this.e},eUe.Hb=function(){return TK(this.d)^TK(this.e)},eUe.ed=function(e){return CL(this,e)},eUe.Ib=function(){return this.d+"="+this.e},Y6(eUS,"AbstractMap/AbstractEntry",484),eTS(383,484,{484:1,383:1,42:1},EE),Y6(eUS,"AbstractMap/SimpleEntry",383),eTS(1984,1,e$t),eUe.Fb=function(e){var t;return!!M4(e,42)&&(t=Pp(e,42),UT(this.cd(),t.cd())&&UT(this.dd(),t.dd()))},eUe.Hb=function(){return TK(this.cd())^TK(this.dd())},eUe.Ib=function(){return this.cd()+"="+this.dd()},Y6(eUS,eUD,1984),eTS(1992,1967,eUO),eUe.tc=function(e){return ZO(this,e)},eUe._b=function(e){return IY(this,e)},eUe.vc=function(){return new fj(this)},eUe.xc=function(e){var t;return xu(esq(this,t=e))},eUe.ec=function(){return new fP(this)},Y6(eUS,"AbstractNavigableMap",1992),eTS(739,eUT,eUM,fj),eUe.Hc=function(e){return M4(e,42)&&ZO(this.b,Pp(e,42))},eUe.Kc=function(){return new C1(this.b)},eUe.Mc=function(e){var t;return!!M4(e,42)&&(t=Pp(e,42),Jl(this.b,t))},eUe.gc=function(){return this.b.c},Y6(eUS,"AbstractNavigableMap/EntrySet",739),eTS(493,eUT,eUL,fP),eUe.Nc=function(){return new Ec(this)},eUe.$b=function(){gl(this.a)},eUe.Hc=function(e){return IY(this.a,e)},eUe.Kc=function(){var e;return e=new C1(new Ap(this.a).b),new fR(e)},eUe.Mc=function(e){return!!IY(this.a,e)&&(zS(this.a,e),!0)},eUe.gc=function(){return this.a.c},Y6(eUS,"AbstractNavigableMap/NavigableKeySet",493),eTS(494,1,eUE,fR),eUe.Nb=function(e){F9(this,e)},eUe.Ob=function(){return Et(this.a.a)},eUe.Pb=function(){var e;return(e=AJ(this.a)).cd()},eUe.Qb=function(){I6(this.a)},Y6(eUS,"AbstractNavigableMap/NavigableKeySet/1",494),eTS(2004,28,eUx),eUe.Fc=function(e){return Ja(e_s(this,e)),!0},eUe.Gc=function(e){return BJ(e),PG(e!=this,"Can't add a queue to itself"),er7(this,e)},eUe.$b=function(){for(;null!=eev(this););},Y6(eUS,"AbstractQueue",2004),eTS(302,28,{4:1,20:1,28:1,14:1},p1,GZ),eUe.Fc=function(e){return Vy(this,e),!0},eUe.$b=function(){qr(this)},eUe.Hc=function(e){return eos(new UN(this),e)},eUe.dc=function(){return gY(this)},eUe.Kc=function(){return new UN(this)},eUe.Mc=function(e){return zP(new UN(this),e)},eUe.gc=function(){return this.c-this.b&this.a.length-1},eUe.Nc=function(){return new Gq(this,272)},eUe.Qc=function(e){var t;return t=this.c-this.b&this.a.length-1,e.lengtht&&Bc(e,t,null),e},eUe.b=0,eUe.c=0,Y6(eUS,"ArrayDeque",302),eTS(446,1,eUE,UN),eUe.Nb=function(e){F9(this,e)},eUe.Ob=function(){return this.a!=this.b},eUe.Pb=function(){return ecn(this)},eUe.Qb=function(){enP(this)},eUe.a=0,eUe.b=0,eUe.c=-1,Y6(eUS,"ArrayDeque/IteratorImpl",446),eTS(12,52,e$n,p0,XM,I4),eUe.Vc=function(e,t){jO(this,e,t)},eUe.Fc=function(e){return P_(this,e)},eUe.Wc=function(e,t){return euP(this,e,t)},eUe.Gc=function(e){return eoc(this,e)},eUe.$b=function(){this.c=Je(e1R,eUp,1,0,5,1)},eUe.Hc=function(e){return -1!=QI(this,e,0)},eUe.Jc=function(e){ety(this,e)},eUe.Xb=function(e){return RJ(this,e)},eUe.Xc=function(e){return QI(this,e,0)},eUe.dc=function(){return 0==this.c.length},eUe.Kc=function(){return new fz(this)},eUe.$c=function(e){return ZV(this,e)},eUe.Mc=function(e){return QA(this,e)},eUe.Ud=function(e,t){GG(this,e,t)},eUe._c=function(e,t){return q1(this,e,t)},eUe.gc=function(){return this.c.length},eUe.ad=function(e){Mv(this,e)},eUe.Pc=function(){return AW(this)},eUe.Qc=function(e){return epg(this,e)};var e0n=Y6(eUS,"ArrayList",12);eTS(7,1,eUE,fz),eUe.Nb=function(e){F9(this,e)},eUe.Ob=function(){return My(this)},eUe.Pb=function(){return Wx(this)},eUe.Qb=function(){Yv(this)},eUe.a=0,eUe.b=-1,Y6(eUS,"ArrayList/1",7),eTS(2013,eB4.Function,{},S),eUe.te=function(e,t){return elN(e,t)},eTS(154,52,e$r,g$),eUe.Hc=function(e){return -1!=enW(this,e)},eUe.Jc=function(e){var t,n,r,i;for(BJ(e),n=this.a,r=0,i=n.length;r>>0).toString(16))},eUe.f=0,eUe.i=eH1;var e2X=Y6(e$N,"CNode",57);eTS(814,1,{},b6),Y6(e$N,"CNode/CNodeBuilder",814),eTS(1525,1,{},eh),eUe.Oe=function(e,t){return 0},eUe.Pe=function(e,t){return 0},Y6(e$N,e$R,1525),eTS(1790,1,{},ep),eUe.Le=function(e){var t,n,r,i,a,o,s,u,c,l,f,d,h,p,b;for(c=eHQ,r=new fz(e.a.b);r.ar.d.c||r.d.c==a.d.c&&r.d.b0?e+this.n.d+this.n.a:0},eUe.Se=function(){var e,t,n,r,i;if(i=0,this.e)this.b?i=this.b.a:this.a[1][1]&&(i=this.a[1][1].Se());else if(this.g)i=efV(this,evf(this,null,!0));else for(t=(etx(),eow(vx(e25,1),eU4,232,0,[e3D,e3N,e3P])),n=0,r=t.length;n0?i+this.n.b+this.n.c:0},eUe.Te=function(){var e,t,n,r,i;if(this.g)for(e=evf(this,null,!1),n=(etx(),eow(vx(e25,1),eU4,232,0,[e3D,e3N,e3P])),r=0,i=n.length;r0&&(r[0]+=this.d,n-=r[0]),r[2]>0&&(r[2]+=this.d,n-=r[2]),this.c.a=eB4.Math.max(0,n),this.c.d=t.d+e.d+(this.c.a-n)/2,r[1]=eB4.Math.max(r[1],n),ZP(this,e3N,t.d+e.d+r[0]-(r[1]-n)/2,r)},eUe.b=null,eUe.d=0,eUe.e=!1,eUe.f=!1,eUe.g=!1;var e28=0,e29=0;Y6(e$8,"GridContainerCell",1473),eTS(461,22,{3:1,35:1,22:1,461:1},EY);var e27=enw(e$8,"HorizontalLabelAlignment",461,e1G,G1,Dc);eTS(306,212,{212:1,306:1},zf,etr,$Y),eUe.Re=function(){return Rf(this)},eUe.Se=function(){return Rd(this)},eUe.a=0,eUe.c=!1;var e3e=Y6(e$8,"LabelCell",306);eTS(244,326,{212:1,326:1,244:1},eh5),eUe.Re=function(){return ek1(this)},eUe.Se=function(){return ek0(this)},eUe.Te=function(){eNE(this)},eUe.Ue=function(){eNM(this)},eUe.b=0,eUe.c=0,eUe.d=!1,Y6(e$8,"StripContainerCell",244),eTS(1626,1,eU9,e_),eUe.Mb=function(e){return gU(Pp(e,212))},Y6(e$8,"StripContainerCell/lambda$0$Type",1626),eTS(1627,1,{},eE),eUe.Fe=function(e){return Pp(e,212).Se()},Y6(e$8,"StripContainerCell/lambda$1$Type",1627),eTS(1628,1,eU9,eS),eUe.Mb=function(e){return gH(Pp(e,212))},Y6(e$8,"StripContainerCell/lambda$2$Type",1628),eTS(1629,1,{},ek),eUe.Fe=function(e){return Pp(e,212).Re()},Y6(e$8,"StripContainerCell/lambda$3$Type",1629),eTS(462,22,{3:1,35:1,22:1,462:1},EB);var e3t=enw(e$8,"VerticalLabelAlignment",462,e1G,G0,Dl);eTS(789,1,{},eFQ),eUe.c=0,eUe.d=0,eUe.k=0,eUe.s=0,eUe.t=0,eUe.v=!1,eUe.w=0,eUe.D=!1,Y6(eza,"NodeContext",789),eTS(1471,1,e$C,ex),eUe.ue=function(e,t){return To(Pp(e,61),Pp(t,61))},eUe.Fb=function(e){return this===e},eUe.ve=function(){return new fZ(this)},Y6(eza,"NodeContext/0methodref$comparePortSides$Type",1471),eTS(1472,1,e$C,eT),eUe.ue=function(e,t){return ew8(Pp(e,111),Pp(t,111))},eUe.Fb=function(e){return this===e},eUe.ve=function(){return new fZ(this)},Y6(eza,"NodeContext/1methodref$comparePortContexts$Type",1472),eTS(159,22,{3:1,35:1,22:1,159:1},ei_);var e3n=enw(eza,"NodeLabelLocation",159,e1G,epE,Df);eTS(111,1,{111:1},exz),eUe.a=!1,Y6(eza,"PortContext",111),eTS(1476,1,eUF,eM),eUe.td=function(e){yQ(Pp(e,306))},Y6(ezu,ezc,1476),eTS(1477,1,eU9,eO),eUe.Mb=function(e){return!!Pp(e,111).c},Y6(ezu,ezl,1477),eTS(1478,1,eUF,eA),eUe.td=function(e){yQ(Pp(e,111).c)},Y6(ezu,"LabelPlacer/lambda$2$Type",1478),eTS(1475,1,eUF,eC),eUe.td=function(e){Cn(),bu(Pp(e,111))},Y6(ezu,"NodeLabelAndSizeUtilities/lambda$0$Type",1475),eTS(790,1,eUF,Dx),eUe.td=function(e){_H(this.b,this.c,this.a,Pp(e,181))},eUe.a=!1,eUe.c=!1,Y6(ezu,"NodeLabelCellCreator/lambda$0$Type",790),eTS(1474,1,eUF,db),eUe.td=function(e){bB(this.a,Pp(e,181))},Y6(ezu,"PortContextCreator/lambda$0$Type",1474),eTS(1829,1,{},eI),Y6(ezd,"GreedyRectangleStripOverlapRemover",1829),eTS(1830,1,e$C,eL),eUe.ue=function(e,t){return Ay(Pp(e,222),Pp(t,222))},eUe.Fb=function(e){return this===e},eUe.ve=function(){return new fZ(this)},Y6(ezd,"GreedyRectangleStripOverlapRemover/0methodref$compareByYCoordinate$Type",1830),eTS(1786,1,{},me),eUe.a=5,eUe.e=0,Y6(ezd,"RectangleStripOverlapRemover",1786),eTS(1787,1,e$C,eN),eUe.ue=function(e,t){return Aw(Pp(e,222),Pp(t,222))},eUe.Fb=function(e){return this===e},eUe.ve=function(){return new fZ(this)},Y6(ezd,"RectangleStripOverlapRemover/0methodref$compareLeftRectangleBorders$Type",1787),eTS(1789,1,e$C,eP),eUe.ue=function(e,t){return YY(Pp(e,222),Pp(t,222))},eUe.Fb=function(e){return this===e},eUe.ve=function(){return new fZ(this)},Y6(ezd,"RectangleStripOverlapRemover/1methodref$compareRightRectangleBorders$Type",1789),eTS(406,22,{3:1,35:1,22:1,406:1},EU);var e3r=enw(ezd,"RectangleStripOverlapRemover/OverlapRemovalDirection",406,e1G,Vn,Dd);eTS(222,1,{222:1},jH),Y6(ezd,"RectangleStripOverlapRemover/RectangleNode",222),eTS(1788,1,eUF,dm),eUe.td=function(e){emA(this.a,Pp(e,222))},Y6(ezd,"RectangleStripOverlapRemover/lambda$1$Type",1788),eTS(1304,1,e$C,eR),eUe.ue=function(e,t){return eRu(Pp(e,167),Pp(t,167))},eUe.Fb=function(e){return this===e},eUe.ve=function(){return new fZ(this)},Y6(ezp,"PolyominoCompactor/CornerCasesGreaterThanRestComparator",1304),eTS(1307,1,{},ej),eUe.Kb=function(e){return Pp(e,324).a},Y6(ezp,"PolyominoCompactor/CornerCasesGreaterThanRestComparator/lambda$0$Type",1307),eTS(1308,1,eU9,eF),eUe.Mb=function(e){return Pp(e,323).a},Y6(ezp,"PolyominoCompactor/CornerCasesGreaterThanRestComparator/lambda$1$Type",1308),eTS(1309,1,eU9,eY),eUe.Mb=function(e){return Pp(e,323).a},Y6(ezp,"PolyominoCompactor/CornerCasesGreaterThanRestComparator/lambda$2$Type",1309),eTS(1302,1,e$C,eB),eUe.ue=function(e,t){return eC8(Pp(e,167),Pp(t,167))},eUe.Fb=function(e){return this===e},eUe.ve=function(){return new fZ(this)},Y6(ezp,"PolyominoCompactor/MinNumOfExtensionDirectionsComparator",1302),eTS(1305,1,{},eD),eUe.Kb=function(e){return Pp(e,324).a},Y6(ezp,"PolyominoCompactor/MinNumOfExtensionDirectionsComparator/lambda$0$Type",1305),eTS(767,1,e$C,eU),eUe.ue=function(e,t){return eaq(Pp(e,167),Pp(t,167))},eUe.Fb=function(e){return this===e},eUe.ve=function(){return new fZ(this)},Y6(ezp,"PolyominoCompactor/MinNumOfExtensionsComparator",767),eTS(1300,1,e$C,eH),eUe.ue=function(e,t){return ery(Pp(e,321),Pp(t,321))},eUe.Fb=function(e){return this===e},eUe.ve=function(){return new fZ(this)},Y6(ezp,"PolyominoCompactor/MinPerimeterComparator",1300),eTS(1301,1,e$C,e$),eUe.ue=function(e,t){return ebg(Pp(e,321),Pp(t,321))},eUe.Fb=function(e){return this===e},eUe.ve=function(){return new fZ(this)},Y6(ezp,"PolyominoCompactor/MinPerimeterComparatorWithShape",1301),eTS(1303,1,e$C,ez),eUe.ue=function(e,t){return eIz(Pp(e,167),Pp(t,167))},eUe.Fb=function(e){return this===e},eUe.ve=function(){return new fZ(this)},Y6(ezp,"PolyominoCompactor/SingleExtensionSideGreaterThanRestComparator",1303),eTS(1306,1,{},eG),eUe.Kb=function(e){return Pp(e,324).a},Y6(ezp,"PolyominoCompactor/SingleExtensionSideGreaterThanRestComparator/lambda$0$Type",1306),eTS(777,1,{},EC),eUe.Ce=function(e,t){return KG(this,Pp(e,46),Pp(t,167))},Y6(ezp,"SuccessorCombination",777),eTS(644,1,{},eW),eUe.Ce=function(e,t){var n;return exd((n=Pp(e,46),Pp(t,167),n))},Y6(ezp,"SuccessorJitter",644),eTS(643,1,{},eK),eUe.Ce=function(e,t){var n;return eAW((n=Pp(e,46),Pp(t,167),n))},Y6(ezp,"SuccessorLineByLine",643),eTS(568,1,{},eV),eUe.Ce=function(e,t){var n;return eMl((n=Pp(e,46),Pp(t,167),n))},Y6(ezp,"SuccessorManhattan",568),eTS(1356,1,{},eq),eUe.Ce=function(e,t){var n;return eAt((n=Pp(e,46),Pp(t,167),n))},Y6(ezp,"SuccessorMaxNormWindingInMathPosSense",1356),eTS(400,1,{},dg),eUe.Ce=function(e,t){return YO(this,e,t)},eUe.c=!1,eUe.d=!1,eUe.e=!1,eUe.f=!1,Y6(ezp,"SuccessorQuadrantsGeneric",400),eTS(1357,1,{},eZ),eUe.Kb=function(e){return Pp(e,324).a},Y6(ezp,"SuccessorQuadrantsGeneric/lambda$0$Type",1357),eTS(323,22,{3:1,35:1,22:1,323:1},EN),eUe.a=!1;var e3i=enw(ezy,ezw,323,e1G,Va,Dh);eTS(1298,1,{}),eUe.Ib=function(){var e,t,n,r,i,a;for(i=0,n=" ",e=ell(0);i=0?"b"+e+"["+q2(this.a)+"]":"b["+q2(this.a)+"]":"b_"+Ao(this)},Y6(ez0,"FBendpoint",559),eTS(282,134,{3:1,282:1,94:1,134:1},CH),eUe.Ib=function(){return q2(this)},Y6(ez0,"FEdge",282),eTS(231,134,{3:1,231:1,94:1,134:1},Z6);var e4_=Y6(ez0,"FGraph",231);eTS(447,357,{3:1,447:1,357:1,94:1,134:1},qp),eUe.Ib=function(){return null==this.b||0==this.b.length?"l["+q2(this.a)+"]":"l_"+this.b},Y6(ez0,"FLabel",447),eTS(144,357,{3:1,144:1,357:1,94:1,134:1},Bw),eUe.Ib=function(){return WH(this)},eUe.b=0,Y6(ez0,"FNode",144),eTS(2003,1,{}),eUe.bf=function(e){eD2(this,e)},eUe.cf=function(){emz(this)},eUe.d=0,Y6(ez3,"AbstractForceModel",2003),eTS(631,2003,{631:1},eaR),eUe.af=function(e,t){var n,r,i,a,o;return ekL(this.f,e,t),i=C5(MB(t.d),e.d),o=eB4.Math.sqrt(i.a*i.a+i.b*i.b),r=eB4.Math.max(0,o-B$(e.e)/2-B$(t.e)/2),a=(n=esT(this.e,e,t))>0?-YT(r,this.c)*n:Li(r,this.b)*Pp(e_k(e,(eCk(),e8M)),19).a,Ol(i,a/o),i},eUe.bf=function(e){eD2(this,e),this.a=Pp(e_k(e,(eCk(),e8g)),19).a,this.c=gP(LV(e_k(e,e8D))),this.b=gP(LV(e_k(e,e8A)))},eUe.df=function(e){return e0&&(a-=gg(r,this.a)*n),Ol(i,a*this.b/o),i},eUe.bf=function(e){var t,n,r,i,a,o,s;for(eD2(this,e),this.b=gP(LV(e_k(e,(eCk(),e8N)))),this.c=this.b/Pp(e_k(e,e8g),19).a,r=e.e.c.length,a=0,i=0,s=new fz(e.e);s.a0},eUe.a=0,eUe.b=0,eUe.c=0,Y6(ez3,"FruchtermanReingoldModel",632),eTS(849,1,e$2,cu),eUe.Qe=function(e){efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,ez4),""),"Force Model"),"Determines the model for force calculation."),e8a),(eSd(),tdv)),e4E),el8((epx(),tdh))))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,ez6),""),"Iterations"),"The number of iterations on the force model."),ell(300)),tdw),e16),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,ez5),""),"Repulsive Power"),"Determines how many bend points are added to the edge; such bend points are regarded as repelling particles in the force model"),ell(0)),tdw),e16),el8(tdl)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,ez8),""),"FR Temperature"),"The temperature is used as a scaling factor for particle displacements."),ez9),tdg),e13),el8(tdh)))),K_(e,ez8,ez4,e8l),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,ez7),""),"Eades Repulsion"),"Factor for repulsive forces in Eades' model."),5),tdg),e13),el8(tdh)))),K_(e,ez7,ez4,e8s),eYi((new cc,e))},Y6(eGe,"ForceMetaDataProvider",849),eTS(424,22,{3:1,35:1,22:1,424:1},EH);var e4E=enw(eGe,"ForceModelStrategy",424,e1G,$8,Dm);eTS(988,1,e$2,cc),eUe.Qe=function(e){eYi(e)},Y6(eGe,"ForceOptions",988),eTS(989,1,{},tr),eUe.$e=function(){return new b0},eUe._e=function(e){},Y6(eGe,"ForceOptions/ForceFactory",989),eTS(850,1,e$2,cl),eUe.Qe=function(e){efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eGw),""),"Fixed Position"),"Prevent that the node is moved by the layout algorithm."),(OQ(),!1)),(eSd(),tdm)),e11),el8((epx(),tdd))))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eG_),""),"Desired Edge Length"),"Either specified for parent nodes or for individual edges, where the latter takes higher precedence."),100),tdg),e13),jL(tdh,eow(vx(e6Q,1),eU4,175,0,[tdl]))))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eGE),""),"Layout Dimension"),"Dimensions that are permitted to be altered during layout."),e8U),tdv),e4S),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eGS),""),"Stress Epsilon"),"Termination criterion for the iterative process."),ez9),tdg),e13),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eGk),""),"Iteration Limit"),"Maximum number of performed iterations. Takes higher precedence than 'epsilon'."),ell(eUu)),tdw),e16),el8(tdh)))),ejQ((new cf,e))},Y6(eGe,"StressMetaDataProvider",850),eTS(992,1,e$2,cf),eUe.Qe=function(e){ejQ(e)},Y6(eGe,"StressOptions",992),eTS(993,1,{},ti),eUe.$e=function(){return new C$},eUe._e=function(e){},Y6(eGe,"StressOptions/StressFactory",993),eTS(1128,209,ezL,C$),eUe.Ze=function(e,t){var n,r,i,a,o;for(ewG(t,eGT,1),gN(LK(eT9(e,(egq(),e8q))))?gN(LK(eT9(e,e80)))||zh(n=new df((_q(),new gM(e)))):eOs(new b0,e,eiI(t,1)),i=eo4(e),o=(r=eNx(this.a,i)).Kc();o.Ob();)!((a=Pp(o.Pb(),231)).e.c.length<=1)&&(eRa(this.b,a),eMn(this.b),ety(a.d,new ta));i=eYC(r),eYh(i),eEj(t)},Y6(eGO,"StressLayoutProvider",1128),eTS(1129,1,eUF,ta),eUe.td=function(e){ePd(Pp(e,447))},Y6(eGO,"StressLayoutProvider/lambda$0$Type",1129),eTS(990,1,{},bP),eUe.c=0,eUe.e=0,eUe.g=0,Y6(eGO,"StressMajorization",990),eTS(379,22,{3:1,35:1,22:1,379:1},E$);var e4S=enw(eGO,"StressMajorization/Dimension",379,e1G,G3,Dg);eTS(991,1,e$C,dE),eUe.ue=function(e,t){return IA(this.a,Pp(e,144),Pp(t,144))},eUe.Fb=function(e){return this===e},eUe.ve=function(){return new fZ(this)},Y6(eGO,"StressMajorization/lambda$0$Type",991),eTS(1229,1,{},W8),Y6(eGL,"ElkLayered",1229),eTS(1230,1,eUF,to),eUe.td=function(e){exn(Pp(e,37))},Y6(eGL,"ElkLayered/lambda$0$Type",1230),eTS(1231,1,eUF,dS),eUe.td=function(e){IL(this.a,Pp(e,37))},Y6(eGL,"ElkLayered/lambda$1$Type",1231),eTS(1263,1,{},MC),Y6(eGL,"GraphConfigurator",1263),eTS(759,1,eUF,dk),eUe.td=function(e){e_1(this.a,Pp(e,10))},Y6(eGL,"GraphConfigurator/lambda$0$Type",759),eTS(760,1,{},ts),eUe.Kb=function(e){return evR(),new R1(null,new Gq(Pp(e,29).a,16))},Y6(eGL,"GraphConfigurator/lambda$1$Type",760),eTS(761,1,eUF,dx),eUe.td=function(e){e_1(this.a,Pp(e,10))},Y6(eGL,"GraphConfigurator/lambda$2$Type",761),eTS(1127,209,ezL,b3),eUe.Ze=function(e,t){var n;n=eN7(new mn,e),xc(eT9(e,(eBy(),taM)))===xc((eck(),tpz))?ef0(this.a,n,t):exD(this.a,n,t),eYr(new ch,n)},Y6(eGL,"LayeredLayoutProvider",1127),eTS(356,22,{3:1,35:1,22:1,356:1},Ez);var e4k=enw(eGL,"LayeredPhases",356,e1G,q4,Dv);eTS(1651,1,{},enX),eUe.i=0,Y6(eGC,"ComponentsToCGraphTransformer",1651),eTS(1652,1,{},tu),eUe.ef=function(e,t){return eB4.Math.min(null!=e.a?gP(e.a):e.c.i,null!=t.a?gP(t.a):t.c.i)},eUe.ff=function(e,t){return eB4.Math.min(null!=e.a?gP(e.a):e.c.i,null!=t.a?gP(t.a):t.c.i)},Y6(eGC,"ComponentsToCGraphTransformer/1",1652),eTS(81,1,{81:1}),eUe.i=0,eUe.k=!0,eUe.o=eH1;var e4x=Y6(eGI,"CNode",81);eTS(460,81,{460:1,81:1},Ah,eh3),eUe.Ib=function(){return""},Y6(eGC,"ComponentsToCGraphTransformer/CRectNode",460),eTS(1623,1,{},tc),Y6(eGC,"OneDimensionalComponentsCompaction",1623),eTS(1624,1,{},tl),eUe.Kb=function(e){return Gm(Pp(e,46))},eUe.Fb=function(e){return this===e},Y6(eGC,"OneDimensionalComponentsCompaction/lambda$0$Type",1624),eTS(1625,1,{},tf),eUe.Kb=function(e){return edl(Pp(e,46))},eUe.Fb=function(e){return this===e},Y6(eGC,"OneDimensionalComponentsCompaction/lambda$1$Type",1625),eTS(1654,1,{},Bv),Y6(eGI,"CGraph",1654),eTS(189,1,{189:1},eh4),eUe.b=0,eUe.c=0,eUe.e=0,eUe.g=!0,eUe.i=eH1,Y6(eGI,"CGroup",189),eTS(1653,1,{},tb),eUe.ef=function(e,t){return eB4.Math.max(null!=e.a?gP(e.a):e.c.i,null!=t.a?gP(t.a):t.c.i)},eUe.ff=function(e,t){return eB4.Math.max(null!=e.a?gP(e.a):e.c.i,null!=t.a?gP(t.a):t.c.i)},Y6(eGI,e$R,1653),eTS(1655,1,{},exO),eUe.d=!1;var e4T=Y6(eGI,e$U,1655);eTS(1656,1,{},tm),eUe.Kb=function(e){return _T(),OQ(),0!=Pp(Pp(e,46).a,81).d.e},eUe.Fb=function(e){return this===e},Y6(eGI,e$H,1656),eTS(823,1,{},R$),eUe.a=!1,eUe.b=!1,eUe.c=!1,eUe.d=!1,Y6(eGI,e$$,823),eTS(1825,1,{},j$),Y6(eGD,e$z,1825);var e4M=RL(eGN,e$D);eTS(1826,1,{369:1},$h),eUe.Ke=function(e){eLh(this,Pp(e,466))},Y6(eGD,e$G,1826),eTS(1827,1,e$C,tg),eUe.ue=function(e,t){return Hy(Pp(e,81),Pp(t,81))},eUe.Fb=function(e){return this===e},eUe.ve=function(){return new fZ(this)},Y6(eGD,e$W,1827),eTS(466,1,{466:1},E5),eUe.a=!1,Y6(eGD,e$K,466),eTS(1828,1,e$C,tv),eUe.ue=function(e,t){return evP(Pp(e,466),Pp(t,466))},eUe.Fb=function(e){return this===e},eUe.ve=function(){return new fZ(this)},Y6(eGD,e$V,1828),eTS(140,1,{140:1},Se,PW),eUe.Fb=function(e){var t;return null!=e&&e4O==esF(e)&&(t=Pp(e,140),UT(this.c,t.c)&&UT(this.d,t.d))},eUe.Hb=function(){return euF(eow(vx(e1R,1),eUp,1,5,[this.c,this.d]))},eUe.Ib=function(){return"("+this.c+eUd+this.d+(this.a?"cx":"")+this.b+")"},eUe.a=!0,eUe.c=0,eUe.d=0;var e4O=Y6(eGN,"Point",140);eTS(405,22,{3:1,35:1,22:1,405:1},EG);var e4A=enw(eGN,"Point/Quadrant",405,e1G,Vo,Dy);eTS(1642,1,{},b5),eUe.b=null,eUe.c=null,eUe.d=null,eUe.e=null,eUe.f=null,Y6(eGN,"RectilinearConvexHull",1642),eTS(574,1,{369:1},epG),eUe.Ke=function(e){J4(this,Pp(e,140))},eUe.b=0,Y6(eGN,"RectilinearConvexHull/MaximalElementsEventHandler",574),eTS(1644,1,e$C,th),eUe.ue=function(e,t){return U3(LV(e),LV(t))},eUe.Fb=function(e){return this===e},eUe.ve=function(){return new fZ(this)},Y6(eGN,"RectilinearConvexHull/MaximalElementsEventHandler/lambda$0$Type",1644),eTS(1643,1,{369:1},ete),eUe.Ke=function(e){eAo(this,Pp(e,140))},eUe.a=0,eUe.b=null,eUe.c=null,eUe.d=null,eUe.e=null,Y6(eGN,"RectilinearConvexHull/RectangleEventHandler",1643),eTS(1645,1,e$C,tp),eUe.ue=function(e,t){return WI(Pp(e,140),Pp(t,140))},eUe.Fb=function(e){return this===e},eUe.ve=function(){return new fZ(this)},Y6(eGN,"RectilinearConvexHull/lambda$0$Type",1645),eTS(1646,1,e$C,td),eUe.ue=function(e,t){return WD(Pp(e,140),Pp(t,140))},eUe.Fb=function(e){return this===e},eUe.ve=function(){return new fZ(this)},Y6(eGN,"RectilinearConvexHull/lambda$1$Type",1646),eTS(1647,1,e$C,ty),eUe.ue=function(e,t){return WP(Pp(e,140),Pp(t,140))},eUe.Fb=function(e){return this===e},eUe.ve=function(){return new fZ(this)},Y6(eGN,"RectilinearConvexHull/lambda$2$Type",1647),eTS(1648,1,e$C,tw),eUe.ue=function(e,t){return WN(Pp(e,140),Pp(t,140))},eUe.Fb=function(e){return this===e},eUe.ve=function(){return new fZ(this)},Y6(eGN,"RectilinearConvexHull/lambda$3$Type",1648),eTS(1649,1,e$C,t_),eUe.ue=function(e,t){return e_M(Pp(e,140),Pp(t,140))},eUe.Fb=function(e){return this===e},eUe.ve=function(){return new fZ(this)},Y6(eGN,"RectilinearConvexHull/lambda$4$Type",1649),eTS(1650,1,{},Gf),Y6(eGN,"Scanline",1650),eTS(2005,1,{}),Y6(eGP,"AbstractGraphPlacer",2005),eTS(325,1,{325:1},Lm),eUe.mf=function(e){return!!this.nf(e)&&(exg(this.b,Pp(e_k(e,(eBU(),ttX)),21),e),!0)},eUe.nf=function(e){var t,n,r,i;for(t=Pp(e_k(e,(eBU(),ttX)),21),r=(i=Pp(Zq(e9E,t),21)).Kc();r.Ob();)if(n=Pp(r.Pb(),21),!Pp(Zq(this.b,n),15).dc())return!1;return!0},Y6(eGP,"ComponentGroup",325),eTS(765,2005,{},b8),eUe.of=function(e){var t,n;for(n=new fz(this.a);n.ah&&(_=0,E+=d+i,d=0),m=o.c,eIn(o,_+m.a,E+m.b),xB(m),n=eB4.Math.max(n,_+v.a),d=eB4.Math.max(d,v.b),_+=v.a+i;if(t.f.a=n,t.f.b=E+d,gN(LK(e_k(a,tiQ)))){for(eBb(r=new tE,e,i),f=e.Kc();f.Ob();)C6(xB((l=Pp(f.Pb(),37)).c),r.e);C6(xB(t.f),r.a)}JN(t,e)},Y6(eGP,"SimpleRowGraphPlacer",1291),eTS(1292,1,e$C,tx),eUe.ue=function(e,t){return eaV(Pp(e,37),Pp(t,37))},eUe.Fb=function(e){return this===e},eUe.ve=function(){return new fZ(this)},Y6(eGP,"SimpleRowGraphPlacer/1",1292),eTS(1262,1,e$q,tT),eUe.Lb=function(e){var t;return!!(t=Pp(e_k(Pp(e,243).b,(eBy(),taR)),74))&&0!=t.b},eUe.Fb=function(e){return this===e},eUe.Mb=function(e){var t;return!!(t=Pp(e_k(Pp(e,243).b,(eBy(),taR)),74))&&0!=t.b},Y6(eGY,"CompoundGraphPostprocessor/1",1262),eTS(1261,1,eGB,mr),eUe.pf=function(e,t){ebL(this,Pp(e,37),t)},Y6(eGY,"CompoundGraphPreprocessor",1261),eTS(441,1,{441:1},ec9),eUe.c=!1,Y6(eGY,"CompoundGraphPreprocessor/ExternalPort",441),eTS(243,1,{243:1},DT),eUe.Ib=function(){return AV(this.c)+":"+ek6(this.b)},Y6(eGY,"CrossHierarchyEdge",243),eTS(763,1,e$C,dT),eUe.ue=function(e,t){return egB(this,Pp(e,243),Pp(t,243))},eUe.Fb=function(e){return this===e},eUe.ve=function(){return new fZ(this)},Y6(eGY,"CrossHierarchyEdgeComparator",763),eTS(299,134,{3:1,299:1,94:1,134:1}),eUe.p=0,Y6(eGU,"LGraphElement",299),eTS(17,299,{3:1,17:1,299:1,94:1,134:1},$b),eUe.Ib=function(){return ek6(this)};var e4C=Y6(eGU,"LEdge",17);eTS(37,299,{3:1,20:1,37:1,299:1,94:1,134:1},enJ),eUe.Jc=function(e){qX(this,e)},eUe.Kc=function(){return new fz(this.b)},eUe.Ib=function(){return 0==this.b.c.length?"G-unlayered"+e_F(this.a):0==this.a.c.length?"G-layered"+e_F(this.b):"G[layerless"+e_F(this.a)+", layers"+e_F(this.b)+"]"};var e4I=Y6(eGU,"LGraph",37);eTS(657,1,{}),eUe.qf=function(){return this.e.n},eUe.We=function(e){return e_k(this.e,e)},eUe.rf=function(){return this.e.o},eUe.sf=function(){return this.e.p},eUe.Xe=function(e){return Ln(this.e,e)},eUe.tf=function(e){this.e.n.a=e.a,this.e.n.b=e.b},eUe.uf=function(e){this.e.o.a=e.a,this.e.o.b=e.b},eUe.vf=function(e){this.e.p=e},Y6(eGU,"LGraphAdapters/AbstractLShapeAdapter",657),eTS(577,1,{839:1},dM),eUe.wf=function(){var e,t;if(!this.b)for(this.b=AH(this.a.b.c.length),t=new fz(this.a.b);t.a0&&eu7((GV(t-1,e.length),e.charCodeAt(t-1)),eGq);)--t;if(a> ",e),egu(n)),xM(xT((e.a+="[",e),n.i),"]")),e.a},eUe.c=!0,eUe.d=!1;var e4j=Y6(eGU,"LPort",11);eTS(397,1,eU$,dA),eUe.Jc=function(e){qX(this,e)},eUe.Kc=function(){var e;return e=new fz(this.a.e),new dL(e)},Y6(eGU,"LPort/1",397),eTS(1290,1,eUE,dL),eUe.Nb=function(e){F9(this,e)},eUe.Pb=function(){return Pp(Wx(this.a),17).c},eUe.Ob=function(){return My(this.a)},eUe.Qb=function(){Yv(this.a)},Y6(eGU,"LPort/1/1",1290),eTS(359,1,eU$,dC),eUe.Jc=function(e){qX(this,e)},eUe.Kc=function(){var e;return e=new fz(this.a.g),new dI(e)},Y6(eGU,"LPort/2",359),eTS(762,1,eUE,dI),eUe.Nb=function(e){F9(this,e)},eUe.Pb=function(){return Pp(Wx(this.a),17).d},eUe.Ob=function(){return My(this.a)},eUe.Qb=function(){Yv(this.a)},Y6(eGU,"LPort/2/1",762),eTS(1283,1,eU$,E6),eUe.Jc=function(e){qX(this,e)},eUe.Kc=function(){return new Z4(this)},Y6(eGU,"LPort/CombineIter",1283),eTS(201,1,eUE,Z4),eUe.Nb=function(e){F9(this,e)},eUe.Qb=function(){yI()},eUe.Ob=function(){return Ak(this)},eUe.Pb=function(){return My(this.a)?Wx(this.a):Wx(this.b)},Y6(eGU,"LPort/CombineIter/1",201),eTS(1285,1,e$q,tA),eUe.Lb=function(e){return FO(e)},eUe.Fb=function(e){return this===e},eUe.Mb=function(e){return eiA(),0!=Pp(e,11).e.c.length},Y6(eGU,"LPort/lambda$0$Type",1285),eTS(1284,1,e$q,tL),eUe.Lb=function(e){return FA(e)},eUe.Fb=function(e){return this===e},eUe.Mb=function(e){return eiA(),0!=Pp(e,11).g.c.length},Y6(eGU,"LPort/lambda$1$Type",1284),eTS(1286,1,e$q,tC),eUe.Lb=function(e){return eiA(),Pp(e,11).j==(eYu(),tbw)},eUe.Fb=function(e){return this===e},eUe.Mb=function(e){return eiA(),Pp(e,11).j==(eYu(),tbw)},Y6(eGU,"LPort/lambda$2$Type",1286),eTS(1287,1,e$q,tI),eUe.Lb=function(e){return eiA(),Pp(e,11).j==(eYu(),tby)},eUe.Fb=function(e){return this===e},eUe.Mb=function(e){return eiA(),Pp(e,11).j==(eYu(),tby)},Y6(eGU,"LPort/lambda$3$Type",1287),eTS(1288,1,e$q,tD),eUe.Lb=function(e){return eiA(),Pp(e,11).j==(eYu(),tbj)},eUe.Fb=function(e){return this===e},eUe.Mb=function(e){return eiA(),Pp(e,11).j==(eYu(),tbj)},Y6(eGU,"LPort/lambda$4$Type",1288),eTS(1289,1,e$q,tN),eUe.Lb=function(e){return eiA(),Pp(e,11).j==(eYu(),tbY)},eUe.Fb=function(e){return this===e},eUe.Mb=function(e){return eiA(),Pp(e,11).j==(eYu(),tbY)},Y6(eGU,"LPort/lambda$5$Type",1289),eTS(29,299,{3:1,20:1,299:1,29:1,94:1,134:1},By),eUe.Jc=function(e){qX(this,e)},eUe.Kc=function(){return new fz(this.a)},eUe.Ib=function(){return"L_"+QI(this.b.b,this,0)+e_F(this.a)},Y6(eGU,"Layer",29),eTS(1342,1,{},mn),Y6(eG0,eG2,1342),eTS(1346,1,{},tP),eUe.Kb=function(e){return ewH(Pp(e,82))},Y6(eG0,"ElkGraphImporter/0methodref$connectableShapeToNode$Type",1346),eTS(1349,1,{},tR),eUe.Kb=function(e){return ewH(Pp(e,82))},Y6(eG0,"ElkGraphImporter/1methodref$connectableShapeToNode$Type",1349),eTS(1343,1,eUF,dD),eUe.td=function(e){exW(this.a,Pp(e,118))},Y6(eG0,eG3,1343),eTS(1344,1,eUF,dN),eUe.td=function(e){exW(this.a,Pp(e,118))},Y6(eG0,eG4,1344),eTS(1345,1,{},tj),eUe.Kb=function(e){return new R1(null,new Gq(UF(Pp(e,79)),16))},Y6(eG0,eG6,1345),eTS(1347,1,eU9,dP),eUe.Mb=function(e){return TV(this.a,Pp(e,33))},Y6(eG0,eG5,1347),eTS(1348,1,{},tF),eUe.Kb=function(e){return new R1(null,new Gq(UY(Pp(e,79)),16))},Y6(eG0,"ElkGraphImporter/lambda$5$Type",1348),eTS(1350,1,eU9,dR),eUe.Mb=function(e){return Tq(this.a,Pp(e,33))},Y6(eG0,"ElkGraphImporter/lambda$7$Type",1350),eTS(1351,1,eU9,tY),eUe.Mb=function(e){return HH(Pp(e,79))},Y6(eG0,"ElkGraphImporter/lambda$8$Type",1351),eTS(1278,1,{},ch),Y6(eG0,"ElkGraphLayoutTransferrer",1278),eTS(1279,1,eU9,dj),eUe.Mb=function(e){return It(this.a,Pp(e,17))},Y6(eG0,"ElkGraphLayoutTransferrer/lambda$0$Type",1279),eTS(1280,1,eUF,dF),eUe.td=function(e){_k(),P_(this.a,Pp(e,17))},Y6(eG0,"ElkGraphLayoutTransferrer/lambda$1$Type",1280),eTS(1281,1,eU9,dY),eUe.Mb=function(e){return Ca(this.a,Pp(e,17))},Y6(eG0,"ElkGraphLayoutTransferrer/lambda$2$Type",1281),eTS(1282,1,eUF,dB),eUe.td=function(e){_k(),P_(this.a,Pp(e,17))},Y6(eG0,"ElkGraphLayoutTransferrer/lambda$3$Type",1282),eTS(1485,1,eGB,tB),eUe.pf=function(e,t){eiu(Pp(e,37),t)},Y6(eG9,"CommentNodeMarginCalculator",1485),eTS(1486,1,{},tU),eUe.Kb=function(e){return new R1(null,new Gq(Pp(e,29).a,16))},Y6(eG9,"CommentNodeMarginCalculator/lambda$0$Type",1486),eTS(1487,1,eUF,tH),eUe.td=function(e){ePO(Pp(e,10))},Y6(eG9,"CommentNodeMarginCalculator/lambda$1$Type",1487),eTS(1488,1,eGB,t$),eUe.pf=function(e,t){eLA(Pp(e,37),t)},Y6(eG9,"CommentPostprocessor",1488),eTS(1489,1,eGB,tz),eUe.pf=function(e,t){eF4(Pp(e,37),t)},Y6(eG9,"CommentPreprocessor",1489),eTS(1490,1,eGB,tG),eUe.pf=function(e,t){eOf(Pp(e,37),t)},Y6(eG9,"ConstraintsPostprocessor",1490),eTS(1491,1,eGB,tW),eUe.pf=function(e,t){eau(Pp(e,37),t)},Y6(eG9,"EdgeAndLayerConstraintEdgeReverser",1491),eTS(1492,1,eGB,tK),eUe.pf=function(e,t){edC(Pp(e,37),t)},Y6(eG9,"EndLabelPostprocessor",1492),eTS(1493,1,{},tV),eUe.Kb=function(e){return new R1(null,new Gq(Pp(e,29).a,16))},Y6(eG9,"EndLabelPostprocessor/lambda$0$Type",1493),eTS(1494,1,eU9,tq),eUe.Mb=function(e){return $T(Pp(e,10))},Y6(eG9,"EndLabelPostprocessor/lambda$1$Type",1494),eTS(1495,1,eUF,tZ),eUe.td=function(e){evj(Pp(e,10))},Y6(eG9,"EndLabelPostprocessor/lambda$2$Type",1495),eTS(1496,1,eGB,tX),eUe.pf=function(e,t){eSF(Pp(e,37),t)},Y6(eG9,"EndLabelPreprocessor",1496),eTS(1497,1,{},tJ),eUe.Kb=function(e){return new R1(null,new Gq(Pp(e,29).a,16))},Y6(eG9,"EndLabelPreprocessor/lambda$0$Type",1497),eTS(1498,1,eUF,DA),eUe.td=function(e){_$(this.a,this.b,this.c,Pp(e,10))},eUe.a=0,eUe.b=0,eUe.c=!1,Y6(eG9,"EndLabelPreprocessor/lambda$1$Type",1498),eTS(1499,1,eU9,tQ),eUe.Mb=function(e){return xc(e_k(Pp(e,70),(eBy(),tab)))===xc((etT(),tpS))},Y6(eG9,"EndLabelPreprocessor/lambda$2$Type",1499),eTS(1500,1,eUF,dU),eUe.td=function(e){P7(this.a,Pp(e,70))},Y6(eG9,"EndLabelPreprocessor/lambda$3$Type",1500),eTS(1501,1,eU9,t1),eUe.Mb=function(e){return xc(e_k(Pp(e,70),(eBy(),tab)))===xc((etT(),tpE))},Y6(eG9,"EndLabelPreprocessor/lambda$4$Type",1501),eTS(1502,1,eUF,dH),eUe.td=function(e){P7(this.a,Pp(e,70))},Y6(eG9,"EndLabelPreprocessor/lambda$5$Type",1502),eTS(1551,1,eGB,cd),eUe.pf=function(e,t){elP(Pp(e,37),t)},Y6(eG9,"EndLabelSorter",1551),eTS(1552,1,e$C,t0),eUe.ue=function(e,t){return epc(Pp(e,456),Pp(t,456))},eUe.Fb=function(e){return this===e},eUe.ve=function(){return new fZ(this)},Y6(eG9,"EndLabelSorter/1",1552),eTS(456,1,{456:1},HP),Y6(eG9,"EndLabelSorter/LabelGroup",456),eTS(1553,1,{},t2),eUe.Kb=function(e){return _O(),new R1(null,new Gq(Pp(e,29).a,16))},Y6(eG9,"EndLabelSorter/lambda$0$Type",1553),eTS(1554,1,eU9,t3),eUe.Mb=function(e){return _O(),Pp(e,10).k==(eEn(),e9N)},Y6(eG9,"EndLabelSorter/lambda$1$Type",1554),eTS(1555,1,eUF,t4),eUe.td=function(e){eEr(Pp(e,10))},Y6(eG9,"EndLabelSorter/lambda$2$Type",1555),eTS(1556,1,eU9,t6),eUe.Mb=function(e){return _O(),xc(e_k(Pp(e,70),(eBy(),tab)))===xc((etT(),tpE))},Y6(eG9,"EndLabelSorter/lambda$3$Type",1556),eTS(1557,1,eU9,t5),eUe.Mb=function(e){return _O(),xc(e_k(Pp(e,70),(eBy(),tab)))===xc((etT(),tpS))},Y6(eG9,"EndLabelSorter/lambda$4$Type",1557),eTS(1503,1,eGB,t8),eUe.pf=function(e,t){eP2(this,Pp(e,37))},eUe.b=0,eUe.c=0,Y6(eG9,"FinalSplineBendpointsCalculator",1503),eTS(1504,1,{},t9),eUe.Kb=function(e){return new R1(null,new Gq(Pp(e,29).a,16))},Y6(eG9,"FinalSplineBendpointsCalculator/lambda$0$Type",1504),eTS(1505,1,{},t7),eUe.Kb=function(e){return new R1(null,new YI(new Fa(OH(efc(Pp(e,10)).a.Kc(),new c))))},Y6(eG9,"FinalSplineBendpointsCalculator/lambda$1$Type",1505),eTS(1506,1,eU9,ne),eUe.Mb=function(e){return!q9(Pp(e,17))},Y6(eG9,"FinalSplineBendpointsCalculator/lambda$2$Type",1506),eTS(1507,1,eU9,nt),eUe.Mb=function(e){return Ln(Pp(e,17),(eBU(),tnO))},Y6(eG9,"FinalSplineBendpointsCalculator/lambda$3$Type",1507),eTS(1508,1,eUF,d$),eUe.td=function(e){eIV(this.a,Pp(e,128))},Y6(eG9,"FinalSplineBendpointsCalculator/lambda$4$Type",1508),eTS(1509,1,eUF,nn),eUe.td=function(e){eSj(Pp(e,17).a)},Y6(eG9,"FinalSplineBendpointsCalculator/lambda$5$Type",1509),eTS(792,1,eGB,dz),eUe.pf=function(e,t){ejn(this,Pp(e,37),t)},Y6(eG9,"GraphTransformer",792),eTS(511,22,{3:1,35:1,22:1,511:1},EV);var e4F=enw(eG9,"GraphTransformer/Mode",511,e1G,$9,NF);eTS(1510,1,eGB,nr),eUe.pf=function(e,t){eAP(Pp(e,37),t)},Y6(eG9,"HierarchicalNodeResizingProcessor",1510),eTS(1511,1,eGB,ni),eUe.pf=function(e,t){erP(Pp(e,37),t)},Y6(eG9,"HierarchicalPortConstraintProcessor",1511),eTS(1512,1,e$C,na),eUe.ue=function(e,t){return epZ(Pp(e,10),Pp(t,10))},eUe.Fb=function(e){return this===e},eUe.ve=function(){return new fZ(this)},Y6(eG9,"HierarchicalPortConstraintProcessor/NodeComparator",1512),eTS(1513,1,eGB,no),eUe.pf=function(e,t){eN6(Pp(e,37),t)},Y6(eG9,"HierarchicalPortDummySizeProcessor",1513),eTS(1514,1,eGB,ns),eUe.pf=function(e,t){eCf(this,Pp(e,37),t)},eUe.a=0,Y6(eG9,"HierarchicalPortOrthogonalEdgeRouter",1514),eTS(1515,1,e$C,nu),eUe.ue=function(e,t){return Av(Pp(e,10),Pp(t,10))},eUe.Fb=function(e){return this===e},eUe.ve=function(){return new fZ(this)},Y6(eG9,"HierarchicalPortOrthogonalEdgeRouter/1",1515),eTS(1516,1,e$C,nc),eUe.ue=function(e,t){return JW(Pp(e,10),Pp(t,10))},eUe.Fb=function(e){return this===e},eUe.ve=function(){return new fZ(this)},Y6(eG9,"HierarchicalPortOrthogonalEdgeRouter/2",1516),eTS(1517,1,eGB,nl),eUe.pf=function(e,t){e_O(Pp(e,37),t)},Y6(eG9,"HierarchicalPortPositionProcessor",1517),eTS(1518,1,eGB,cp),eUe.pf=function(e,t){eYG(this,Pp(e,37))},eUe.a=0,eUe.c=0,Y6(eG9,"HighDegreeNodeLayeringProcessor",1518),eTS(571,1,{571:1},nf),eUe.b=-1,eUe.d=-1,Y6(eG9,"HighDegreeNodeLayeringProcessor/HighDegreeNodeInformation",571),eTS(1519,1,{},nd),eUe.Kb=function(e){return DR(),efu(Pp(e,10))},eUe.Fb=function(e){return this===e},Y6(eG9,"HighDegreeNodeLayeringProcessor/lambda$0$Type",1519),eTS(1520,1,{},nh),eUe.Kb=function(e){return DR(),efc(Pp(e,10))},eUe.Fb=function(e){return this===e},Y6(eG9,"HighDegreeNodeLayeringProcessor/lambda$1$Type",1520),eTS(1526,1,eGB,np),eUe.pf=function(e,t){eD9(this,Pp(e,37),t)},Y6(eG9,"HyperedgeDummyMerger",1526),eTS(793,1,{},DL),eUe.a=!1,eUe.b=!1,eUe.c=!1,Y6(eG9,"HyperedgeDummyMerger/MergeState",793),eTS(1527,1,{},nb),eUe.Kb=function(e){return new R1(null,new Gq(Pp(e,29).a,16))},Y6(eG9,"HyperedgeDummyMerger/lambda$0$Type",1527),eTS(1528,1,{},nm),eUe.Kb=function(e){return new R1(null,new Gq(Pp(e,10).j,16))},Y6(eG9,"HyperedgeDummyMerger/lambda$1$Type",1528),eTS(1529,1,eUF,ng),eUe.td=function(e){Pp(e,11).p=-1},Y6(eG9,"HyperedgeDummyMerger/lambda$2$Type",1529),eTS(1530,1,eGB,nv),eUe.pf=function(e,t){eD5(Pp(e,37),t)},Y6(eG9,"HypernodesProcessor",1530),eTS(1531,1,eGB,ny),eUe.pf=function(e,t){eD8(Pp(e,37),t)},Y6(eG9,"InLayerConstraintProcessor",1531),eTS(1532,1,eGB,nw),eUe.pf=function(e,t){eiW(Pp(e,37),t)},Y6(eG9,"InnermostNodeMarginCalculator",1532),eTS(1533,1,eGB,n_),eUe.pf=function(e,t){eFW(this,Pp(e,37))},eUe.a=eH1,eUe.b=eH1,eUe.c=eHQ,eUe.d=eHQ;var e4Y=Y6(eG9,"InteractiveExternalPortPositioner",1533);eTS(1534,1,{},nE),eUe.Kb=function(e){return Pp(e,17).d.i},eUe.Fb=function(e){return this===e},Y6(eG9,"InteractiveExternalPortPositioner/lambda$0$Type",1534),eTS(1535,1,{},dG),eUe.Kb=function(e){return AE(this.a,LV(e))},eUe.Fb=function(e){return this===e},Y6(eG9,"InteractiveExternalPortPositioner/lambda$1$Type",1535),eTS(1536,1,{},nS),eUe.Kb=function(e){return Pp(e,17).c.i},eUe.Fb=function(e){return this===e},Y6(eG9,"InteractiveExternalPortPositioner/lambda$2$Type",1536),eTS(1537,1,{},dW),eUe.Kb=function(e){return AS(this.a,LV(e))},eUe.Fb=function(e){return this===e},Y6(eG9,"InteractiveExternalPortPositioner/lambda$3$Type",1537),eTS(1538,1,{},dK),eUe.Kb=function(e){return C8(this.a,LV(e))},eUe.Fb=function(e){return this===e},Y6(eG9,"InteractiveExternalPortPositioner/lambda$4$Type",1538),eTS(1539,1,{},dV),eUe.Kb=function(e){return C9(this.a,LV(e))},eUe.Fb=function(e){return this===e},Y6(eG9,"InteractiveExternalPortPositioner/lambda$5$Type",1539),eTS(77,22,{3:1,35:1,22:1,77:1,234:1},Eq),eUe.Kf=function(){switch(this.g){case 15:return new iA;case 22:return new iL;case 47:return new iD;case 28:case 35:return new nN;case 32:return new tB;case 42:return new t$;case 1:return new tz;case 41:return new tG;case 56:return new dz((erq(),e9W));case 0:return new dz((erq(),e9G));case 2:return new tW;case 54:return new tK;case 33:return new tX;case 51:return new t8;case 55:return new nr;case 13:return new ni;case 38:return new no;case 44:return new ns;case 40:return new nl;case 9:return new cp;case 49:return new AU;case 37:return new np;case 43:return new nv;case 27:return new ny;case 30:return new nw;case 3:return new n_;case 18:return new nx;case 29:return new nT;case 5:return new cb;case 50:return new nk;case 34:return new cm;case 36:return new nP;case 52:return new cd;case 11:return new nj;case 7:return new cv;case 39:return new nF;case 45:return new nY;case 16:return new nB;case 10:return new nU;case 48:return new n$;case 21:return new nz;case 23:return new gx((enU(),tui));case 8:return new nW;case 12:return new nV;case 4:return new nq;case 19:return new cE;case 17:return new n6;case 53:return new n5;case 6:return new rc;case 25:return new ms;case 46:return new rn;case 31:return new CV;case 14:return new rg;case 26:return new iB;case 20:return new rE;case 24:return new gx((enU(),tua));default:throw p7(new gL(eWt+(null!=this.f?this.f:""+this.g)))}};var e4B=enw(eG9,eWn,77,e1G,eAn,Nj);eTS(1540,1,eGB,nx),eUe.pf=function(e,t){eFq(Pp(e,37),t)},Y6(eG9,"InvertedPortProcessor",1540),eTS(1541,1,eGB,nT),eUe.pf=function(e,t){eIR(Pp(e,37),t)},Y6(eG9,"LabelAndNodeSizeProcessor",1541),eTS(1542,1,eU9,nM),eUe.Mb=function(e){return Pp(e,10).k==(eEn(),e9N)},Y6(eG9,"LabelAndNodeSizeProcessor/lambda$0$Type",1542),eTS(1543,1,eU9,nO),eUe.Mb=function(e){return Pp(e,10).k==(eEn(),e9C)},Y6(eG9,"LabelAndNodeSizeProcessor/lambda$1$Type",1543),eTS(1544,1,eUF,DC),eUe.td=function(e){_z(this.b,this.a,this.c,Pp(e,10))},eUe.a=!1,eUe.c=!1,Y6(eG9,"LabelAndNodeSizeProcessor/lambda$2$Type",1544),eTS(1545,1,eGB,cb),eUe.pf=function(e,t){eFu(Pp(e,37),t)},Y6(eG9,"LabelDummyInserter",1545),eTS(1546,1,e$q,nA),eUe.Lb=function(e){return xc(e_k(Pp(e,70),(eBy(),tab)))===xc((etT(),tp_))},eUe.Fb=function(e){return this===e},eUe.Mb=function(e){return xc(e_k(Pp(e,70),(eBy(),tab)))===xc((etT(),tp_))},Y6(eG9,"LabelDummyInserter/1",1546),eTS(1547,1,eGB,nk),eUe.pf=function(e,t){eRz(Pp(e,37),t)},Y6(eG9,"LabelDummyRemover",1547),eTS(1548,1,eU9,nL),eUe.Mb=function(e){return gN(LK(e_k(Pp(e,70),(eBy(),tap))))},Y6(eG9,"LabelDummyRemover/lambda$0$Type",1548),eTS(1359,1,eGB,cm),eUe.pf=function(e,t){ejC(this,Pp(e,37),t)},eUe.a=null,Y6(eG9,"LabelDummySwitcher",1359),eTS(286,1,{286:1},eIu),eUe.c=0,eUe.d=null,eUe.f=0,Y6(eG9,"LabelDummySwitcher/LabelDummyInfo",286),eTS(1360,1,{},nC),eUe.Kb=function(e){return erJ(),new R1(null,new Gq(Pp(e,29).a,16))},Y6(eG9,"LabelDummySwitcher/lambda$0$Type",1360),eTS(1361,1,eU9,nI),eUe.Mb=function(e){return erJ(),Pp(e,10).k==(eEn(),e9I)},Y6(eG9,"LabelDummySwitcher/lambda$1$Type",1361),eTS(1362,1,{},dX),eUe.Kb=function(e){return Co(this.a,Pp(e,10))},Y6(eG9,"LabelDummySwitcher/lambda$2$Type",1362),eTS(1363,1,eUF,dJ),eUe.td=function(e){BO(this.a,Pp(e,286))},Y6(eG9,"LabelDummySwitcher/lambda$3$Type",1363),eTS(1364,1,e$C,nD),eUe.ue=function(e,t){return FL(Pp(e,286),Pp(t,286))},eUe.Fb=function(e){return this===e},eUe.ve=function(){return new fZ(this)},Y6(eG9,"LabelDummySwitcher/lambda$4$Type",1364),eTS(791,1,eGB,nN),eUe.pf=function(e,t){XT(Pp(e,37),t)},Y6(eG9,"LabelManagementProcessor",791),eTS(1549,1,eGB,nP),eUe.pf=function(e,t){eLr(Pp(e,37),t)},Y6(eG9,"LabelSideSelector",1549),eTS(1550,1,eU9,nR),eUe.Mb=function(e){return gN(LK(e_k(Pp(e,70),(eBy(),tap))))},Y6(eG9,"LabelSideSelector/lambda$0$Type",1550),eTS(1558,1,eGB,nj),eUe.pf=function(e,t){eN5(Pp(e,37),t)},Y6(eG9,"LayerConstraintPostprocessor",1558),eTS(1559,1,eGB,cv),eUe.pf=function(e,t){eMr(Pp(e,37),t)},Y6(eG9,"LayerConstraintPreprocessor",1559),eTS(360,22,{3:1,35:1,22:1,360:1},EZ);var e4U=enw(eG9,"LayerConstraintPreprocessor/HiddenNodeConnections",360,e1G,Vs,DF);eTS(1560,1,eGB,nF),eUe.pf=function(e,t){eRB(Pp(e,37),t)},Y6(eG9,"LayerSizeAndGraphHeightCalculator",1560),eTS(1561,1,eGB,nY),eUe.pf=function(e,t){eOw(Pp(e,37),t)},Y6(eG9,"LongEdgeJoiner",1561),eTS(1562,1,eGB,nB),eUe.pf=function(e,t){eRf(Pp(e,37),t)},Y6(eG9,"LongEdgeSplitter",1562),eTS(1563,1,eGB,nU),eUe.pf=function(e,t){ejN(this,Pp(e,37),t)},eUe.d=0,eUe.e=0,eUe.i=0,eUe.j=0,eUe.k=0,eUe.n=0,Y6(eG9,"NodePromotion",1563),eTS(1564,1,{},nH),eUe.Kb=function(e){return Pp(e,46),OQ(),!0},eUe.Fb=function(e){return this===e},Y6(eG9,"NodePromotion/lambda$0$Type",1564),eTS(1565,1,{},dq),eUe.Kb=function(e){return UM(this.a,Pp(e,46))},eUe.Fb=function(e){return this===e},eUe.a=0,Y6(eG9,"NodePromotion/lambda$1$Type",1565),eTS(1566,1,{},dZ),eUe.Kb=function(e){return UO(this.a,Pp(e,46))},eUe.Fb=function(e){return this===e},eUe.a=0,Y6(eG9,"NodePromotion/lambda$2$Type",1566),eTS(1567,1,eGB,n$),eUe.pf=function(e,t){eYN(Pp(e,37),t)},Y6(eG9,"NorthSouthPortPostprocessor",1567),eTS(1568,1,eGB,nz),eUe.pf=function(e,t){eYd(Pp(e,37),t)},Y6(eG9,"NorthSouthPortPreprocessor",1568),eTS(1569,1,e$C,nG),eUe.ue=function(e,t){return ea2(Pp(e,11),Pp(t,11))},eUe.Fb=function(e){return this===e},eUe.ve=function(){return new fZ(this)},Y6(eG9,"NorthSouthPortPreprocessor/lambda$0$Type",1569),eTS(1570,1,eGB,nW),eUe.pf=function(e,t){eDx(Pp(e,37),t)},Y6(eG9,"PartitionMidprocessor",1570),eTS(1571,1,eU9,nK),eUe.Mb=function(e){return Ln(Pp(e,10),(eBy(),ton))},Y6(eG9,"PartitionMidprocessor/lambda$0$Type",1571),eTS(1572,1,eUF,dQ),eUe.td=function(e){H$(this.a,Pp(e,10))},Y6(eG9,"PartitionMidprocessor/lambda$1$Type",1572),eTS(1573,1,eGB,nV),eUe.pf=function(e,t){eO3(Pp(e,37),t)},Y6(eG9,"PartitionPostprocessor",1573),eTS(1574,1,eGB,nq),eUe.pf=function(e,t){exQ(Pp(e,37),t)},Y6(eG9,"PartitionPreprocessor",1574),eTS(1575,1,eU9,nZ),eUe.Mb=function(e){return Ln(Pp(e,10),(eBy(),ton))},Y6(eG9,"PartitionPreprocessor/lambda$0$Type",1575),eTS(1576,1,{},nX),eUe.Kb=function(e){return new R1(null,new YI(new Fa(OH(efc(Pp(e,10)).a.Kc(),new c))))},Y6(eG9,"PartitionPreprocessor/lambda$1$Type",1576),eTS(1577,1,eU9,nJ),eUe.Mb=function(e){return epe(Pp(e,17))},Y6(eG9,"PartitionPreprocessor/lambda$2$Type",1577),eTS(1578,1,eUF,nQ),eUe.td=function(e){eoL(Pp(e,17))},Y6(eG9,"PartitionPreprocessor/lambda$3$Type",1578),eTS(1579,1,eGB,cE),eUe.pf=function(e,t){eDe(Pp(e,37),t)},Y6(eG9,"PortListSorter",1579),eTS(1580,1,{},n1),eUe.Kb=function(e){return euv(),Pp(e,11).e},Y6(eG9,"PortListSorter/lambda$0$Type",1580),eTS(1581,1,{},n0),eUe.Kb=function(e){return euv(),Pp(e,11).g},Y6(eG9,"PortListSorter/lambda$1$Type",1581),eTS(1582,1,e$C,n2),eUe.ue=function(e,t){return qy(Pp(e,11),Pp(t,11))},eUe.Fb=function(e){return this===e},eUe.ve=function(){return new fZ(this)},Y6(eG9,"PortListSorter/lambda$2$Type",1582),eTS(1583,1,e$C,n3),eUe.ue=function(e,t){return eg_(Pp(e,11),Pp(t,11))},eUe.Fb=function(e){return this===e},eUe.ve=function(){return new fZ(this)},Y6(eG9,"PortListSorter/lambda$3$Type",1583),eTS(1584,1,e$C,n4),eUe.ue=function(e,t){return eDK(Pp(e,11),Pp(t,11))},eUe.Fb=function(e){return this===e},eUe.ve=function(){return new fZ(this)},Y6(eG9,"PortListSorter/lambda$4$Type",1584),eTS(1585,1,eGB,n6),eUe.pf=function(e,t){eT3(Pp(e,37),t)},Y6(eG9,"PortSideProcessor",1585),eTS(1586,1,eGB,n5),eUe.pf=function(e,t){eCH(Pp(e,37),t)},Y6(eG9,"ReversedEdgeRestorer",1586),eTS(1591,1,eGB,ms),eUe.pf=function(e,t){emJ(this,Pp(e,37),t)},Y6(eG9,"SelfLoopPortRestorer",1591),eTS(1592,1,{},n8),eUe.Kb=function(e){return new R1(null,new Gq(Pp(e,29).a,16))},Y6(eG9,"SelfLoopPortRestorer/lambda$0$Type",1592),eTS(1593,1,eU9,n9),eUe.Mb=function(e){return Pp(e,10).k==(eEn(),e9N)},Y6(eG9,"SelfLoopPortRestorer/lambda$1$Type",1593),eTS(1594,1,eU9,n7),eUe.Mb=function(e){return Ln(Pp(e,10),(eBU(),tnk))},Y6(eG9,"SelfLoopPortRestorer/lambda$2$Type",1594),eTS(1595,1,{},re),eUe.Kb=function(e){return Pp(e_k(Pp(e,10),(eBU(),tnk)),403)},Y6(eG9,"SelfLoopPortRestorer/lambda$3$Type",1595),eTS(1596,1,eUF,d1),eUe.td=function(e){eE_(this.a,Pp(e,403))},Y6(eG9,"SelfLoopPortRestorer/lambda$4$Type",1596),eTS(794,1,eUF,rt),eUe.td=function(e){eEq(Pp(e,101))},Y6(eG9,"SelfLoopPortRestorer/lambda$5$Type",794),eTS(1597,1,eGB,rn),eUe.pf=function(e,t){ep1(Pp(e,37),t)},Y6(eG9,"SelfLoopPostProcessor",1597),eTS(1598,1,{},rr),eUe.Kb=function(e){return new R1(null,new Gq(Pp(e,29).a,16))},Y6(eG9,"SelfLoopPostProcessor/lambda$0$Type",1598),eTS(1599,1,eU9,ri),eUe.Mb=function(e){return Pp(e,10).k==(eEn(),e9N)},Y6(eG9,"SelfLoopPostProcessor/lambda$1$Type",1599),eTS(1600,1,eU9,ra),eUe.Mb=function(e){return Ln(Pp(e,10),(eBU(),tnk))},Y6(eG9,"SelfLoopPostProcessor/lambda$2$Type",1600),eTS(1601,1,eUF,ro),eUe.td=function(e){eyi(Pp(e,10))},Y6(eG9,"SelfLoopPostProcessor/lambda$3$Type",1601),eTS(1602,1,{},rs),eUe.Kb=function(e){return new R1(null,new Gq(Pp(e,101).f,1))},Y6(eG9,"SelfLoopPostProcessor/lambda$4$Type",1602),eTS(1603,1,eUF,d0),eUe.td=function(e){Vf(this.a,Pp(e,409))},Y6(eG9,"SelfLoopPostProcessor/lambda$5$Type",1603),eTS(1604,1,eU9,ru),eUe.Mb=function(e){return!!Pp(e,101).i},Y6(eG9,"SelfLoopPostProcessor/lambda$6$Type",1604),eTS(1605,1,eUF,d2),eUe.td=function(e){gb(this.a,Pp(e,101))},Y6(eG9,"SelfLoopPostProcessor/lambda$7$Type",1605),eTS(1587,1,eGB,rc),eUe.pf=function(e,t){eMJ(Pp(e,37),t)},Y6(eG9,"SelfLoopPreProcessor",1587),eTS(1588,1,{},rl),eUe.Kb=function(e){return new R1(null,new Gq(Pp(e,101).f,1))},Y6(eG9,"SelfLoopPreProcessor/lambda$0$Type",1588),eTS(1589,1,{},rf),eUe.Kb=function(e){return Pp(e,409).a},Y6(eG9,"SelfLoopPreProcessor/lambda$1$Type",1589),eTS(1590,1,eUF,rd),eUe.td=function(e){MH(Pp(e,17))},Y6(eG9,"SelfLoopPreProcessor/lambda$2$Type",1590),eTS(1606,1,eGB,CV),eUe.pf=function(e,t){eEi(this,Pp(e,37),t)},Y6(eG9,"SelfLoopRouter",1606),eTS(1607,1,{},rh),eUe.Kb=function(e){return new R1(null,new Gq(Pp(e,29).a,16))},Y6(eG9,"SelfLoopRouter/lambda$0$Type",1607),eTS(1608,1,eU9,rp),eUe.Mb=function(e){return Pp(e,10).k==(eEn(),e9N)},Y6(eG9,"SelfLoopRouter/lambda$1$Type",1608),eTS(1609,1,eU9,rb),eUe.Mb=function(e){return Ln(Pp(e,10),(eBU(),tnk))},Y6(eG9,"SelfLoopRouter/lambda$2$Type",1609),eTS(1610,1,{},rm),eUe.Kb=function(e){return Pp(e_k(Pp(e,10),(eBU(),tnk)),403)},Y6(eG9,"SelfLoopRouter/lambda$3$Type",1610),eTS(1611,1,eUF,EX),eUe.td=function(e){Hs(this.a,this.b,Pp(e,403))},Y6(eG9,"SelfLoopRouter/lambda$4$Type",1611),eTS(1612,1,eGB,rg),eUe.pf=function(e,t){eAz(Pp(e,37),t)},Y6(eG9,"SemiInteractiveCrossMinProcessor",1612),eTS(1613,1,eU9,rv),eUe.Mb=function(e){return Pp(e,10).k==(eEn(),e9N)},Y6(eG9,"SemiInteractiveCrossMinProcessor/lambda$0$Type",1613),eTS(1614,1,eU9,ry),eUe.Mb=function(e){return R8(Pp(e,10))._b((eBy(),tog))},Y6(eG9,"SemiInteractiveCrossMinProcessor/lambda$1$Type",1614),eTS(1615,1,e$C,rw),eUe.ue=function(e,t){return erF(Pp(e,10),Pp(t,10))},eUe.Fb=function(e){return this===e},eUe.ve=function(){return new fZ(this)},Y6(eG9,"SemiInteractiveCrossMinProcessor/lambda$2$Type",1615),eTS(1616,1,{},r_),eUe.Ce=function(e,t){return H4(Pp(e,10),Pp(t,10))},Y6(eG9,"SemiInteractiveCrossMinProcessor/lambda$3$Type",1616),eTS(1618,1,eGB,rE),eUe.pf=function(e,t){eN9(Pp(e,37),t)},Y6(eG9,"SortByInputModelProcessor",1618),eTS(1619,1,eU9,rS),eUe.Mb=function(e){return 0!=Pp(e,11).g.c.length},Y6(eG9,"SortByInputModelProcessor/lambda$0$Type",1619),eTS(1620,1,eUF,d3),eUe.td=function(e){eE5(this.a,Pp(e,11))},Y6(eG9,"SortByInputModelProcessor/lambda$1$Type",1620),eTS(1693,803,{},erY),eUe.Me=function(e){var t,n,r,i;switch(this.c=e,this.a.g){case 2:t=new p0,_r(UJ(new R1(null,new Gq(this.c.a.b,16)),new rj),new E2(this,t)),eS2(this,new rT),ety(t,new rM),t.c=Je(e1R,eUp,1,0,5,1),_r(UJ(new R1(null,new Gq(this.c.a.b,16)),new rO),new d6(t)),eS2(this,new rA),ety(t,new rL),t.c=Je(e1R,eUp,1,0,5,1),n=M_(eim(U1(new R1(null,new Gq(this.c.a.b,16)),new d5(this))),new rC),_r(new R1(null,new Gq(this.c.a.a,16)),new EQ(n,t)),eS2(this,new rD),ety(t,new rk),t.c=Je(e1R,eUp,1,0,5,1);break;case 3:r=new p0,eS2(this,new rx),i=M_(eim(U1(new R1(null,new Gq(this.c.a.b,16)),new d4(this))),new rI),_r(UJ(new R1(null,new Gq(this.c.a.b,16)),new rN),new E0(i,r)),eS2(this,new rP),ety(r,new rR),r.c=Je(e1R,eUp,1,0,5,1);break;default:throw p7(new bI)}},eUe.b=0,Y6(eWs,"EdgeAwareScanlineConstraintCalculation",1693),eTS(1694,1,e$q,rx),eUe.Lb=function(e){return M4(Pp(e,57).g,145)},eUe.Fb=function(e){return this===e},eUe.Mb=function(e){return M4(Pp(e,57).g,145)},Y6(eWs,"EdgeAwareScanlineConstraintCalculation/lambda$0$Type",1694),eTS(1695,1,{},d4),eUe.Fe=function(e){return eky(this.a,Pp(e,57))},Y6(eWs,"EdgeAwareScanlineConstraintCalculation/lambda$1$Type",1695),eTS(1703,1,eU7,EJ),eUe.Vd=function(){ev_(this.a,this.b,-1)},eUe.b=0,Y6(eWs,"EdgeAwareScanlineConstraintCalculation/lambda$10$Type",1703),eTS(1705,1,e$q,rT),eUe.Lb=function(e){return M4(Pp(e,57).g,145)},eUe.Fb=function(e){return this===e},eUe.Mb=function(e){return M4(Pp(e,57).g,145)},Y6(eWs,"EdgeAwareScanlineConstraintCalculation/lambda$11$Type",1705),eTS(1706,1,eUF,rM),eUe.td=function(e){Pp(e,365).Vd()},Y6(eWs,"EdgeAwareScanlineConstraintCalculation/lambda$12$Type",1706),eTS(1707,1,eU9,rO),eUe.Mb=function(e){return M4(Pp(e,57).g,10)},Y6(eWs,"EdgeAwareScanlineConstraintCalculation/lambda$13$Type",1707),eTS(1709,1,eUF,d6),eUe.td=function(e){efw(this.a,Pp(e,57))},Y6(eWs,"EdgeAwareScanlineConstraintCalculation/lambda$14$Type",1709),eTS(1708,1,eU7,E8),eUe.Vd=function(){ev_(this.b,this.a,-1)},eUe.a=0,Y6(eWs,"EdgeAwareScanlineConstraintCalculation/lambda$15$Type",1708),eTS(1710,1,e$q,rA),eUe.Lb=function(e){return M4(Pp(e,57).g,10)},eUe.Fb=function(e){return this===e},eUe.Mb=function(e){return M4(Pp(e,57).g,10)},Y6(eWs,"EdgeAwareScanlineConstraintCalculation/lambda$16$Type",1710),eTS(1711,1,eUF,rL),eUe.td=function(e){Pp(e,365).Vd()},Y6(eWs,"EdgeAwareScanlineConstraintCalculation/lambda$17$Type",1711),eTS(1712,1,{},d5),eUe.Fe=function(e){return ekw(this.a,Pp(e,57))},Y6(eWs,"EdgeAwareScanlineConstraintCalculation/lambda$18$Type",1712),eTS(1713,1,{},rC),eUe.De=function(){return 0},Y6(eWs,"EdgeAwareScanlineConstraintCalculation/lambda$19$Type",1713),eTS(1696,1,{},rI),eUe.De=function(){return 0},Y6(eWs,"EdgeAwareScanlineConstraintCalculation/lambda$2$Type",1696),eTS(1715,1,eUF,EQ),eUe.td=function(e){jq(this.a,this.b,Pp(e,307))},eUe.a=0,Y6(eWs,"EdgeAwareScanlineConstraintCalculation/lambda$20$Type",1715),eTS(1714,1,eU7,E1),eUe.Vd=function(){eT4(this.a,this.b,-1)},eUe.b=0,Y6(eWs,"EdgeAwareScanlineConstraintCalculation/lambda$21$Type",1714),eTS(1716,1,e$q,rD),eUe.Lb=function(e){return Pp(e,57),!0},eUe.Fb=function(e){return this===e},eUe.Mb=function(e){return Pp(e,57),!0},Y6(eWs,"EdgeAwareScanlineConstraintCalculation/lambda$22$Type",1716),eTS(1717,1,eUF,rk),eUe.td=function(e){Pp(e,365).Vd()},Y6(eWs,"EdgeAwareScanlineConstraintCalculation/lambda$23$Type",1717),eTS(1697,1,eU9,rN),eUe.Mb=function(e){return M4(Pp(e,57).g,10)},Y6(eWs,"EdgeAwareScanlineConstraintCalculation/lambda$3$Type",1697),eTS(1699,1,eUF,E0),eUe.td=function(e){jZ(this.a,this.b,Pp(e,57))},eUe.a=0,Y6(eWs,"EdgeAwareScanlineConstraintCalculation/lambda$4$Type",1699),eTS(1698,1,eU7,E9),eUe.Vd=function(){ev_(this.b,this.a,-1)},eUe.a=0,Y6(eWs,"EdgeAwareScanlineConstraintCalculation/lambda$5$Type",1698),eTS(1700,1,e$q,rP),eUe.Lb=function(e){return Pp(e,57),!0},eUe.Fb=function(e){return this===e},eUe.Mb=function(e){return Pp(e,57),!0},Y6(eWs,"EdgeAwareScanlineConstraintCalculation/lambda$6$Type",1700),eTS(1701,1,eUF,rR),eUe.td=function(e){Pp(e,365).Vd()},Y6(eWs,"EdgeAwareScanlineConstraintCalculation/lambda$7$Type",1701),eTS(1702,1,eU9,rj),eUe.Mb=function(e){return M4(Pp(e,57).g,145)},Y6(eWs,"EdgeAwareScanlineConstraintCalculation/lambda$8$Type",1702),eTS(1704,1,eUF,E2),eUe.td=function(e){eth(this.a,this.b,Pp(e,57))},Y6(eWs,"EdgeAwareScanlineConstraintCalculation/lambda$9$Type",1704),eTS(1521,1,eGB,AU),eUe.pf=function(e,t){eRE(this,Pp(e,37),t)},Y6(eWs,"HorizontalGraphCompactor",1521),eTS(1522,1,{},d8),eUe.Oe=function(e,t){var n,r,i;return Q9(e,t)?0:(n=KT(e),r=KT(t),n&&n.k==(eEn(),e9C)||r&&r.k==(eEn(),e9C))?0:(i=Pp(e_k(this.a.a,(eBU(),tnx)),304),Ax(i,n?n.k:(eEn(),e9D),r?r.k:(eEn(),e9D)))},eUe.Pe=function(e,t){var n,r,i;return Q9(e,t)?1:(n=KT(e),r=KT(t),i=Pp(e_k(this.a.a,(eBU(),tnx)),304),AT(i,n?n.k:(eEn(),e9D),r?r.k:(eEn(),e9D)))},Y6(eWs,"HorizontalGraphCompactor/1",1522),eTS(1523,1,{},rF),eUe.Ne=function(e,t){return _L(),0==e.a.i},Y6(eWs,"HorizontalGraphCompactor/lambda$0$Type",1523),eTS(1524,1,{},d9),eUe.Ne=function(e,t){return HZ(this.a,e,t)},Y6(eWs,"HorizontalGraphCompactor/lambda$1$Type",1524),eTS(1664,1,{},QF),Y6(eWs,"LGraphToCGraphTransformer",1664),eTS(1672,1,eU9,rY),eUe.Mb=function(e){return null!=e},Y6(eWs,"LGraphToCGraphTransformer/0methodref$nonNull$Type",1672),eTS(1665,1,{},rB),eUe.Kb=function(e){return Dj(),efF(e_k(Pp(Pp(e,57).g,10),(eBU(),tnc)))},Y6(eWs,"LGraphToCGraphTransformer/lambda$0$Type",1665),eTS(1666,1,{},rU),eUe.Kb=function(e){return Dj(),ecR(Pp(Pp(e,57).g,145))},Y6(eWs,"LGraphToCGraphTransformer/lambda$1$Type",1666),eTS(1675,1,eU9,rH),eUe.Mb=function(e){return Dj(),M4(Pp(e,57).g,10)},Y6(eWs,"LGraphToCGraphTransformer/lambda$10$Type",1675),eTS(1676,1,eUF,r$),eUe.td=function(e){Hq(Pp(e,57))},Y6(eWs,"LGraphToCGraphTransformer/lambda$11$Type",1676),eTS(1677,1,eU9,rz),eUe.Mb=function(e){return Dj(),M4(Pp(e,57).g,145)},Y6(eWs,"LGraphToCGraphTransformer/lambda$12$Type",1677),eTS(1681,1,eUF,rG),eUe.td=function(e){ecP(Pp(e,57))},Y6(eWs,"LGraphToCGraphTransformer/lambda$13$Type",1681),eTS(1678,1,eUF,d7),eUe.td=function(e){Tm(this.a,Pp(e,8))},eUe.a=0,Y6(eWs,"LGraphToCGraphTransformer/lambda$14$Type",1678),eTS(1679,1,eUF,he),eUe.td=function(e){Tv(this.a,Pp(e,110))},eUe.a=0,Y6(eWs,"LGraphToCGraphTransformer/lambda$15$Type",1679),eTS(1680,1,eUF,ht),eUe.td=function(e){Tg(this.a,Pp(e,8))},eUe.a=0,Y6(eWs,"LGraphToCGraphTransformer/lambda$16$Type",1680),eTS(1682,1,{},rW),eUe.Kb=function(e){return Dj(),new R1(null,new YI(new Fa(OH(efc(Pp(e,10)).a.Kc(),new c))))},Y6(eWs,"LGraphToCGraphTransformer/lambda$17$Type",1682),eTS(1683,1,eU9,rK),eUe.Mb=function(e){return Dj(),q9(Pp(e,17))},Y6(eWs,"LGraphToCGraphTransformer/lambda$18$Type",1683),eTS(1684,1,eUF,hn),eUe.td=function(e){eex(this.a,Pp(e,17))},Y6(eWs,"LGraphToCGraphTransformer/lambda$19$Type",1684),eTS(1668,1,eUF,hr),eUe.td=function(e){Wj(this.a,Pp(e,145))},Y6(eWs,"LGraphToCGraphTransformer/lambda$2$Type",1668),eTS(1685,1,{},rV),eUe.Kb=function(e){return Dj(),new R1(null,new Gq(Pp(e,29).a,16))},Y6(eWs,"LGraphToCGraphTransformer/lambda$20$Type",1685),eTS(1686,1,{},rq),eUe.Kb=function(e){return Dj(),new R1(null,new YI(new Fa(OH(efc(Pp(e,10)).a.Kc(),new c))))},Y6(eWs,"LGraphToCGraphTransformer/lambda$21$Type",1686),eTS(1687,1,{},rZ),eUe.Kb=function(e){return Dj(),Pp(e_k(Pp(e,17),(eBU(),tnO)),15)},Y6(eWs,"LGraphToCGraphTransformer/lambda$22$Type",1687),eTS(1688,1,eU9,rX),eUe.Mb=function(e){return AN(Pp(e,15))},Y6(eWs,"LGraphToCGraphTransformer/lambda$23$Type",1688),eTS(1689,1,eUF,hi),eUe.td=function(e){ekn(this.a,Pp(e,15))},Y6(eWs,"LGraphToCGraphTransformer/lambda$24$Type",1689),eTS(1667,1,eUF,E3),eUe.td=function(e){VK(this.a,this.b,Pp(e,145))},Y6(eWs,"LGraphToCGraphTransformer/lambda$3$Type",1667),eTS(1669,1,{},rJ),eUe.Kb=function(e){return Dj(),new R1(null,new Gq(Pp(e,29).a,16))},Y6(eWs,"LGraphToCGraphTransformer/lambda$4$Type",1669),eTS(1670,1,{},rQ),eUe.Kb=function(e){return Dj(),new R1(null,new YI(new Fa(OH(efc(Pp(e,10)).a.Kc(),new c))))},Y6(eWs,"LGraphToCGraphTransformer/lambda$5$Type",1670),eTS(1671,1,{},r1),eUe.Kb=function(e){return Dj(),Pp(e_k(Pp(e,17),(eBU(),tnO)),15)},Y6(eWs,"LGraphToCGraphTransformer/lambda$6$Type",1671),eTS(1673,1,eUF,ha),eUe.td=function(e){exr(this.a,Pp(e,15))},Y6(eWs,"LGraphToCGraphTransformer/lambda$8$Type",1673),eTS(1674,1,eUF,E4),eUe.td=function(e){MN(this.a,this.b,Pp(e,145))},Y6(eWs,"LGraphToCGraphTransformer/lambda$9$Type",1674),eTS(1663,1,{},r0),eUe.Le=function(e){var t,n,r,i,a;for(this.a=e,this.d=new bX,this.c=Je(e24,eUp,121,this.a.a.a.c.length,0,1),this.b=0,n=new fz(this.a.a.a);n.a=b&&(P_(a,ell(l)),v=eB4.Math.max(v,y[l-1]-f),s+=p,m+=y[l-1]-m,f=y[l-1],p=u[l]),p=eB4.Math.max(p,u[l]),++l;s+=p}(h=eB4.Math.min(1/v,1/t.b/s))>r&&(r=h,n=a)}return n},eUe.Wf=function(){return!1},Y6(eWb,"MSDCutIndexHeuristic",802),eTS(1617,1,eGB,iB),eUe.pf=function(e,t){eNZ(Pp(e,37),t)},Y6(eWb,"SingleEdgeGraphWrapper",1617),eTS(227,22,{3:1,35:1,22:1,227:1},Ss);var e4K=enw(eWm,"CenterEdgeLabelPlacementStrategy",227,e1G,Jv,DU);eTS(422,22,{3:1,35:1,22:1,422:1},Su);var e4V=enw(eWm,"ConstraintCalculationStrategy",422,e1G,$G,DH);eTS(314,22,{3:1,35:1,22:1,314:1,246:1,234:1},Sc),eUe.Kf=function(){return ekF(this)},eUe.Xf=function(){return ekF(this)};var e4q=enw(eWm,"CrossingMinimizationStrategy",314,e1G,G6,D$);eTS(337,22,{3:1,35:1,22:1,337:1},Sl);var e4Z=enw(eWm,"CuttingStrategy",337,e1G,G5,DW);eTS(335,22,{3:1,35:1,22:1,335:1,246:1,234:1},Sf),eUe.Kf=function(){return eTW(this)},eUe.Xf=function(){return eTW(this)};var e4X=enw(eWm,"CycleBreakingStrategy",335,e1G,Zv,DK);eTS(419,22,{3:1,35:1,22:1,419:1},Sd);var e4J=enw(eWm,"DirectionCongruency",419,e1G,$z,DV);eTS(450,22,{3:1,35:1,22:1,450:1},Sh);var e4Q=enw(eWm,"EdgeConstraint",450,e1G,G8,Dq);eTS(276,22,{3:1,35:1,22:1,276:1},Sp);var e41=enw(eWm,"EdgeLabelSideSelection",276,e1G,JE,DZ);eTS(479,22,{3:1,35:1,22:1,479:1},Sb);var e40=enw(eWm,"EdgeStraighteningStrategy",479,e1G,$$,DX);eTS(274,22,{3:1,35:1,22:1,274:1},Sm);var e42=enw(eWm,"FixedAlignment",274,e1G,Jw,DJ);eTS(275,22,{3:1,35:1,22:1,275:1},Sg);var e43=enw(eWm,"GraphCompactionStrategy",275,e1G,Jy,DQ);eTS(256,22,{3:1,35:1,22:1,256:1},Sv);var e44=enw(eWm,"GraphProperties",256,e1G,eiT,D1);eTS(292,22,{3:1,35:1,22:1,292:1},Sy);var e46=enw(eWm,"GreedySwitchType",292,e1G,We,D0);eTS(303,22,{3:1,35:1,22:1,303:1},Sw);var e45=enw(eWm,"InLayerConstraint",303,e1G,G7,D2);eTS(420,22,{3:1,35:1,22:1,420:1},S_);var e48=enw(eWm,"InteractiveReferencePoint",420,e1G,$W,D3);eTS(163,22,{3:1,35:1,22:1,163:1},ST);var e49=enw(eWm,"LayerConstraint",163,e1G,Z_,D4);eTS(848,1,e$2,cT),eUe.Qe=function(e){efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eWE),""),"Direction Congruency"),"Specifies how drawings of the same graph with different layout directions compare to each other: either a natural reading direction is preserved or the drawings are rotated versions of each other."),trl),(eSd(),tdv)),e4J),el8((epx(),tdh))))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eWS),""),"Feedback Edges"),"Whether feedback edges should be highlighted by routing around the nodes."),(OQ(),!1)),tdm),e11),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eWk),""),"Interactive Reference Point"),"Determines which point of a node is considered by interactive layout phases."),trN),tdv),e48),el8(tdh)))),K_(e,eWk,eWI,trR),K_(e,eWk,eWH,trP),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eWx),""),"Merge Edges"),"Edges that have no ports are merged so they touch the connected nodes at the same points. When this option is disabled, one port is created for each edge directly connected to a node. When it is enabled, all such incoming edges share an input port, and all outgoing edges share an output port."),!1),tdm),e11),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eWT),""),"Merge Hierarchy-Crossing Edges"),"If hierarchical layout is active, hierarchy-crossing edges use as few hierarchical ports as possible. They are broken by the algorithm, with hierarchical ports inserted as required. Usually, one such port is created for each edge at each hierarchy crossing point. With this option set to true, we try to create as few hierarchical ports as possible in the process. In particular, all edges that form a hyperedge can share a port."),!0),tdm),e11),el8(tdh)))),efO(e,new eE9(v9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eWM),""),"Allow Non-Flow Ports To Switch Sides"),"Specifies whether non-flow ports may switch sides if their node's port constraints are either FIXED_SIDE or FIXED_ORDER. A non-flow port is a port on a side that is not part of the currently configured layout flow. For instance, given a left-to-right layout direction, north and south ports would be considered non-flow ports. Further note that the underlying criterium whether to switch sides or not solely relies on the minimization of edge crossings. Hence, edge length and other aesthetics criteria are not addressed."),!1),tdm),e11),el8(tdp)),eow(vx(e17,1),eUP,2,6,["org.eclipse.elk.layered.northOrSouthPort"])))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eWO),""),"Port Sorting Strategy"),"Only relevant for nodes with FIXED_SIDE port constraints. Determines the way a node's ports are distributed on the sides of a node if their order is not prescribed. The option is set on parent nodes."),tic),tdv),e6a),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eWA),""),"Thoroughness"),"How much effort should be spent to produce a nice layout."),ell(7)),tdw),e16),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eWL),""),"Add Unnecessary Bendpoints"),"Adds bend points even if an edge does not change direction. If true, each long edge dummy will contribute a bend point to its edges and hierarchy-crossing edges will always get a bend point where they cross hierarchy boundaries. By default, bend points are only added where an edge changes direction."),!1),tdm),e11),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eWC),""),"Generate Position and Layer IDs"),"If enabled position id and layer id are generated, which are usually only used internally when setting the interactiveLayout option. This option should be specified on the root node."),!1),tdm),e11),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eWI),"cycleBreaking"),"Cycle Breaking Strategy"),"Strategy for cycle breaking. Cycle breaking looks for cycles in the graph and determines which edges to reverse to break the cycles. Reversed edges will end up pointing to the opposite direction of regular edges (that is, reversed edges will point left if edges usually point right)."),tru),tdv),e4X),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eWD),eKC),"Node Layering Strategy"),"Strategy for node layering."),trX),tdv),e47),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eWN),eKC),"Layer Constraint"),"Determines a constraint on the placement of the node regarding the layering."),trU),tdv),e49),el8(tdd)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eWP),eKC),"Layer Choice Constraint"),"Allows to set a constraint regarding the layer placement of a node. Let i be the value of teh constraint. Assumed the drawing has n layers and i < n. If set to i, it expresses that the node should be placed in i-th layer. Should i>=n be true then the node is placed in the last layer of the drawing. Note that this option is not part of any of ELK Layered's default configurations but is only evaluated as part of the `InteractiveLayeredGraphVisitor`, which must be applied manually or used via the `DiagramLayoutEngine."),ell(-1)),tdw),e16),el8(tdd)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eWR),eKC),"Layer ID"),"Layer identifier that was calculated by ELK Layered for a node. This is only generated if interactiveLayot or generatePositionAndLayerIds is set."),ell(-1)),tdw),e16),el8(tdd)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eWj),eKI),"Upper Bound On Width [MinWidth Layerer]"),"Defines a loose upper bound on the width of the MinWidth layerer. If set to '-1' multiple values are tested and the best result is selected."),ell(4)),tdw),e16),el8(tdh)))),K_(e,eWj,eWD,trz),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eWF),eKI),"Upper Layer Estimation Scaling Factor [MinWidth Layerer]"),"Multiplied with Upper Bound On Width for defining an upper bound on the width of layers which haven't been determined yet, but whose maximum width had been (roughly) estimated by the MinWidth algorithm. Compensates for too high estimations. If set to '-1' multiple values are tested and the best result is selected."),ell(2)),tdw),e16),el8(tdh)))),K_(e,eWF,eWD,trW),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eWY),eKD),"Node Promotion Strategy"),"Reduces number of dummy nodes after layering phase (if possible)."),trq),tdv),e6r),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eWB),eKD),"Max Node Promotion Iterations"),"Limits the number of iterations for node promotion."),ell(0)),tdw),e16),el8(tdh)))),K_(e,eWB,eWY,null),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eWU),"layering.coffmanGraham"),"Layer Bound"),"The maximum number of nodes allowed per layer."),ell(eUu)),tdw),e16),el8(tdh)))),K_(e,eWU,eWD,trF),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eWH),eKN),"Crossing Minimization Strategy"),"Strategy for crossing minimization."),tro),tdv),e4q),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eW$),eKN),"Force Node Model Order"),"The node order given by the model does not change to produce a better layout. E.g. if node A is before node B in the model this is not changed during crossing minimization. This assumes that the node model order is already respected before crossing minimization. This can be achieved by setting considerModelOrder.strategy to NODES_AND_EDGES."),!1),tdm),e11),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eWz),eKN),"Hierarchical Sweepiness"),"How likely it is to use cross-hierarchy (1) vs bottom-up (-1)."),.1),tdg),e13),el8(tdh)))),K_(e,eWz,eKP,tre),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eWG),eKN),"Semi-Interactive Crossing Minimization"),"Preserves the order of nodes within a layer but still minimizes crossings between edges connecting long edge dummies. Derives the desired order from positions specified by the 'org.eclipse.elk.position' layout option. Requires a crossing minimization strategy that is able to process 'in-layer' constraints."),!1),tdm),e11),el8(tdh)))),K_(e,eWG,eWH,tri),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eWW),eKN),"Position Choice Constraint"),"Allows to set a constraint regarding the position placement of a node in a layer. Assumed the layer in which the node placed includes n other nodes and i < n. If set to i, it expresses that the node should be placed at the i-th position. Should i>=n be true then the node is placed at the last position in the layer. Note that this option is not part of any of ELK Layered's default configurations but is only evaluated as part of the `InteractiveLayeredGraphVisitor`, which must be applied manually or used via the `DiagramLayoutEngine."),ell(-1)),tdw),e16),el8(tdd)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eWK),eKN),"Position ID"),"Position within a layer that was determined by ELK Layered for a node. This is only generated if interactiveLayot or generatePositionAndLayerIds is set."),ell(-1)),tdw),e16),el8(tdd)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eWV),eKR),"Greedy Switch Activation Threshold"),"By default it is decided automatically if the greedy switch is activated or not. The decision is based on whether the size of the input graph (without dummy nodes) is smaller than the value of this option. A '0' enforces the activation."),ell(40)),tdw),e16),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eWq),eKR),"Greedy Switch Crossing Minimization"),"Greedy Switch strategy for crossing minimization. The greedy switch heuristic is executed after the regular crossing minimization as a post-processor. Note that if 'hierarchyHandling' is set to 'INCLUDE_CHILDREN', the 'greedySwitchHierarchical.type' option must be used."),tn8),tdv),e46),el8(tdh)))),K_(e,eWq,eWH,tn9),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eWZ),"crossingMinimization.greedySwitchHierarchical"),"Greedy Switch Crossing Minimization (hierarchical)"),"Activates the greedy switch heuristic in case hierarchical layout is used. The differences to the non-hierarchical case (see 'greedySwitch.type') are: 1) greedy switch is inactive by default, 3) only the option value set on the node at which hierarchical layout starts is relevant, and 2) if it's activated by the user, it properly addresses hierarchy-crossing edges."),tn3),tdv),e46),el8(tdh)))),K_(e,eWZ,eWH,tn4),K_(e,eWZ,eKP,tn6),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eWX),eKj),"Node Placement Strategy"),"Strategy for node placement."),tis),tdv),e6n),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v4(v7(v5(v8(new oN,eWJ),eKj),"Favor Straight Edges Over Balancing"),"Favor straight edges over a balanced node placement. The default behavior is determined automatically based on the used 'edgeRouting'. For an orthogonal style it is set to true, for all other styles to false."),tdm),e11),el8(tdh)))),K_(e,eWJ,eWX,tr8),K_(e,eWJ,eWX,tr9),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eWQ),eKF),"BK Edge Straightening"),"Specifies whether the Brandes Koepf node placer tries to increase the number of straight edges at the expense of diagram size. There is a subtle difference to the 'favorStraightEdges' option, which decides whether a balanced placement of the nodes is desired, or not. In bk terms this means combining the four alignments into a single balanced one, or not. This option on the other hand tries to straighten additional edges during the creation of each of the four alignments."),tr0),tdv),e40),el8(tdh)))),K_(e,eWQ,eWX,tr2),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eW1),eKF),"BK Fixed Alignment"),"Tells the BK node placer to use a certain alignment (out of its four) instead of the one producing the smallest height, or the combination of all four."),tr4),tdv),e42),el8(tdh)))),K_(e,eW1,eWX,tr6),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eW0),"nodePlacement.linearSegments"),"Linear Segments Deflection Dampening"),"Dampens the movement of nodes to keep the diagram from getting too large."),.3),tdg),e13),el8(tdh)))),K_(e,eW0,eWX,tie),efO(e,new eE9(yt(ye(yn(v4(v7(v5(v8(new oN,eW2),"nodePlacement.networkSimplex"),"Node Flexibility"),"Aims at shorter and straighter edges. Two configurations are possible: (a) allow ports to move freely on the side they are assigned to (the order is always defined beforehand), (b) additionally allow to enlarge a node wherever it helps. If this option is not configured for a node, the 'nodeFlexibility.default' value is used, which is specified for the node's parent."),tdv),e6t),el8(tdd)))),K_(e,eW2,eWX,tia),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eW3),"nodePlacement.networkSimplex.nodeFlexibility"),"Node Flexibility Default"),"Default value of the 'nodeFlexibility' option for the children of a hierarchical node."),tir),tdv),e6t),el8(tdh)))),K_(e,eW3,eWX,tii),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eW4),eKY),"Self-Loop Distribution"),"Alter the distribution of the loops around the node. It only takes effect for PortConstraints.FREE."),trv),tdv),e6s),el8(tdd)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eW6),eKY),"Self-Loop Ordering"),"Alter the ordering of the loops they can either be stacked or sequenced. It only takes effect for PortConstraints.FREE."),tr_),tdv),e6u),el8(tdd)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eW5),"edgeRouting.splines"),"Spline Routing Mode"),"Specifies the way control points are assembled for each individual edge. CONSERVATIVE ensures that edges are properly routed around the nodes but feels rather orthogonal at times. SLOPPY uses fewer control points to obtain curvier edge routes but may result in edges overlapping nodes."),trS),tdv),e6c),el8(tdh)))),K_(e,eW5,eKB,trk),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eW8),"edgeRouting.splines.sloppy"),"Sloppy Spline Layer Spacing Factor"),"Spacing factor for routing area between layers when using sloppy spline routing."),.2),tdg),e13),el8(tdh)))),K_(e,eW8,eKB,trT),K_(e,eW8,eW5,trM),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eW9),"edgeRouting.polyline"),"Sloped Edge Zone Width"),"Width of the strip to the left and to the right of each layer where the polyline edge router is allowed to refrain from ensuring that edges are routed horizontally. This prevents awkward bend points for nodes that extent almost to the edge of their layer."),2),tdg),e13),el8(tdh)))),K_(e,eW9,eKB,trm),efO(e,new eE9(yt(ye(yn(v4(v7(v5(v8(new oN,eW7),eKU),"Spacing Base Value"),"An optional base value for all other layout options of the 'spacing' group. It can be used to conveniently alter the overall 'spaciousness' of the drawing. Whenever an explicit value is set for the other layout options, this base value will have no effect. The base value is not inherited, i.e. it must be set for each hierarchical node."),tdg),e13),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eKe),eKU),"Edge Node Between Layers Spacing"),"The spacing to be preserved between nodes and edges that are routed next to the node's layer. For the spacing between nodes and edges that cross the node's layer 'spacing.edgeNode' is used."),10),tdg),e13),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eKt),eKU),"Edge Edge Between Layer Spacing"),"Spacing to be preserved between pairs of edges that are routed between the same pair of layers. Note that 'spacing.edgeEdge' is used for the spacing between pairs of edges crossing the same layer."),10),tdg),e13),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eKn),eKU),"Node Node Between Layers Spacing"),"The spacing to be preserved between any pair of nodes of two adjacent layers. Note that 'spacing.nodeNode' is used for the spacing between nodes within the layer itself."),20),tdg),e13),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eKr),eKH),"Direction Priority"),"Defines how important it is to have a certain edge point into the direction of the overall layout. This option is evaluated during the cycle breaking phase."),ell(0)),tdw),e16),el8(tdl)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eKi),eKH),"Shortness Priority"),"Defines how important it is to keep an edge as short as possible. This option is evaluated during the layering phase."),ell(0)),tdw),e16),el8(tdl)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eKa),eKH),"Straightness Priority"),"Defines how important it is to keep an edge straight, i.e. aligned with one of the two axes. This option is evaluated during node placement."),ell(0)),tdw),e16),el8(tdl)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eKo),eK$),ezI),"Tries to further compact components (disconnected sub-graphs)."),!1),tdm),e11),el8(tdh)))),K_(e,eKo,eGs,!0),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eKs),eKz),"Post Compaction Strategy"),eKG),tnz),tdv),e43),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eKu),eKz),"Post Compaction Constraint Calculation"),eKG),tnH),tdv),e4V),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eKc),eKW),"High Degree Node Treatment"),"Makes room around high degree nodes to place leafs and trees."),!1),tdm),e11),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eKl),eKW),"High Degree Node Threshold"),"Whether a node is considered to have a high degree."),ell(16)),tdw),e16),el8(tdh)))),K_(e,eKl,eKc,!0),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eKf),eKW),"High Degree Node Maximum Tree Height"),"Maximum height of a subtree connected to a high degree node to be moved to separate layers."),ell(5)),tdw),e16),el8(tdh)))),K_(e,eKf,eKc,!0),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eKd),eKK),"Graph Wrapping Strategy"),"For certain graphs and certain prescribed drawing areas it may be desirable to split the laid out graph into chunks that are placed side by side. The edges that connect different chunks are 'wrapped' around from the end of one chunk to the start of the other chunk. The points between the chunks are referred to as 'cuts'."),tiU),tdv),e6f),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eKh),eKK),"Additional Wrapped Edges Spacing"),"To visually separate edges that are wrapped from regularly routed edges an additional spacing value can be specified in form of this layout option. The spacing is added to the regular edgeNode spacing."),10),tdg),e13),el8(tdh)))),K_(e,eKh,eKd,tiw),K_(e,eKh,eKd,ti_),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eKp),eKK),"Correction Factor for Wrapping"),"At times and for certain types of graphs the executed wrapping may produce results that are consistently biased in the same fashion: either wrapping to often or to rarely. This factor can be used to correct the bias. Internally, it is simply multiplied with the 'aspect ratio' layout option."),1),tdg),e13),el8(tdh)))),K_(e,eKp,eKd,tiS),K_(e,eKp,eKd,tik),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eKb),eKV),"Cutting Strategy"),"The strategy by which the layer indexes are determined at which the layering crumbles into chunks."),tiC),tdv),e4Z),el8(tdh)))),K_(e,eKb,eKd,tiI),K_(e,eKb,eKd,tiD),efO(e,new eE9(yt(ye(yn(v4(v7(v5(v8(new oN,eKm),eKV),"Manually Specified Cuts"),"Allows the user to specify her own cuts for a certain graph."),td_),e1H),el8(tdh)))),K_(e,eKm,eKb,tiT),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eKg),"wrapping.cutting.msd"),"MSD Freedom"),"The MSD cutting strategy starts with an initial guess on the number of chunks the graph should be split into. The freedom specifies how much the strategy may deviate from this guess. E.g. if an initial number of 3 is computed, a freedom of 1 allows 2, 3, and 4 cuts."),tiO),tdw),e16),el8(tdh)))),K_(e,eKg,eKb,tiA),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eKv),eKq),"Validification Strategy"),"When wrapping graphs, one can specify indices that are not allowed as split points. The validification strategy makes sure every computed split point is allowed."),tiW),tdv),e6l),el8(tdh)))),K_(e,eKv,eKd,tiK),K_(e,eKv,eKd,tiV),efO(e,new eE9(yt(ye(yn(v4(v7(v5(v8(new oN,eKy),eKq),"Valid Indices for Wrapping"),null),td_),e1H),el8(tdh)))),K_(e,eKy,eKd,ti$),K_(e,eKy,eKd,tiz),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eKw),eKZ),"Improve Cuts"),"For general graphs it is important that not too many edges wrap backwards. Thus a compromise between evenly-distributed cuts and the total number of cut edges is sought."),!0),tdm),e11),el8(tdh)))),K_(e,eKw,eKd,tij),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eK_),eKZ),"Distance Penalty When Improving Cuts"),null),2),tdg),e13),el8(tdh)))),K_(e,eK_,eKd,tiP),K_(e,eK_,eKw,!0),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eKE),eKZ),"Improve Wrapped Edges"),"The initial wrapping is performed in a very simple way. As a consequence, edges that wrap from one chunk to another may be unnecessarily long. Activating this option tries to shorten such edges."),!0),tdm),e11),el8(tdh)))),K_(e,eKE,eKd,tiY),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eKS),eKX),"Edge Label Side Selection"),"Method to decide on edge label sides."),trp),tdv),e41),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eKk),eKX),"Edge Center Label Placement Strategy"),"Determines in which layer center labels of long edges should be placed."),trd),tdv),e4K),jL(tdh,eow(vx(e6Q,1),eU4,175,0,[tdf]))))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eKx),eKJ),"Consider Model Order"),"Preserves the order of nodes and edges in the model file if this does not lead to additional edge crossings. Depending on the strategy this is not always possible since the node and edge order might be conflicting."),tnQ),tdv),e6i),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eKT),eKJ),"No Model Order"),"Set on a node to not set a model order for this node even though it is a real node."),!1),tdm),e11),el8(tdd)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eKM),eKJ),"Consider Model Order for Components"),"If set to NONE the usual ordering strategy (by cumulative node priority and size of nodes) is used. INSIDE_PORT_SIDES orders the components with external ports only inside the groups with the same port side. FORCE_MODEL_ORDER enforces the mode order on components. This option might produce bad alignments and sub optimal drawings in terms of used area since the ordering should be respected."),tnW),tdv),e4L),el8(tdh)))),K_(e,eKM,eGs,null),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eKO),eKJ),"Long Edge Ordering Strategy"),"Indicates whether long edges are sorted under, over, or equal to nodes that have no connection to a previous layer in a left-to-right or right-to-left layout. Under and over changes to right and left in a vertical layout."),tnZ),tdv),e6e),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eKA),eKJ),"Crossing Counter Node Order Influence"),"Indicates with what percentage (1 for 100%) violations of the node model order are weighted against the crossings e.g. a value of 0.5 means two model order violations are as important as on edge crossing. This allows some edge crossings in favor of preserving the model order. It is advised to set this value to a very small positive value (e.g. 0.001) to have minimal crossing and a optimal node order. Defaults to no influence (0)."),0),tdg),e13),el8(tdh)))),K_(e,eKA,eKx,null),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eKL),eKJ),"Crossing Counter Port Order Influence"),"Indicates with what percentage (1 for 100%) violations of the port model order are weighted against the crossings e.g. a value of 0.5 means two model order violations are as important as on edge crossing. This allows some edge crossings in favor of preserving the model order. It is advised to set this value to a very small positive value (e.g. 0.001) to have minimal crossing and a optimal port order. Defaults to no influence (0)."),0),tdg),e13),el8(tdh)))),K_(e,eKL,eKx,null),eBq((new cA,e))},Y6(eWm,"LayeredMetaDataProvider",848),eTS(986,1,e$2,cA),eUe.Qe=function(e){eBq(e)},Y6(eWm,"LayeredOptions",986),eTS(987,1,{},iH),eUe.$e=function(){return new b3},eUe._e=function(e){},Y6(eWm,"LayeredOptions/LayeredFactory",987),eTS(1372,1,{}),eUe.a=0,Y6(eVL,"ElkSpacings/AbstractSpacingsBuilder",1372),eTS(779,1372,{},ef4),Y6(eWm,"LayeredSpacings/LayeredSpacingsBuilder",779),eTS(313,22,{3:1,35:1,22:1,313:1,246:1,234:1},SE),eUe.Kf=function(){return eM3(this)},eUe.Xf=function(){return eM3(this)};var e47=enw(eWm,"LayeringStrategy",313,e1G,J_,D6);eTS(378,22,{3:1,35:1,22:1,378:1},SS);var e6e=enw(eWm,"LongEdgeOrderingStrategy",378,e1G,G4,D5);eTS(197,22,{3:1,35:1,22:1,197:1},Sk);var e6t=enw(eWm,"NodeFlexibility",197,e1G,VT,D8);eTS(315,22,{3:1,35:1,22:1,315:1,246:1,234:1},Sx),eUe.Kf=function(){return eTG(this)},eUe.Xf=function(){return eTG(this)};var e6n=enw(eWm,"NodePlacementStrategy",315,e1G,Zg,Nr);eTS(260,22,{3:1,35:1,22:1,260:1},SM);var e6r=enw(eWm,"NodePromotionStrategy",260,e1G,etL,D7);eTS(339,22,{3:1,35:1,22:1,339:1},SO);var e6i=enw(eWm,"OrderingStrategy",339,e1G,Wn,Ne);eTS(421,22,{3:1,35:1,22:1,421:1},SA);var e6a=enw(eWm,"PortSortingStrategy",421,e1G,$K,Nt);eTS(452,22,{3:1,35:1,22:1,452:1},SL);var e6o=enw(eWm,"PortType",452,e1G,Wt,D9);eTS(375,22,{3:1,35:1,22:1,375:1},SC);var e6s=enw(eWm,"SelfLoopDistributionStrategy",375,e1G,Wr,Nn);eTS(376,22,{3:1,35:1,22:1,376:1},SI);var e6u=enw(eWm,"SelfLoopOrderingStrategy",376,e1G,$H,Ni);eTS(304,1,{304:1},ejm),Y6(eWm,"Spacings",304),eTS(336,22,{3:1,35:1,22:1,336:1},SD);var e6c=enw(eWm,"SplineRoutingMode",336,e1G,Wa,Na);eTS(338,22,{3:1,35:1,22:1,338:1},SN);var e6l=enw(eWm,"ValidifyStrategy",338,e1G,Wo,No);eTS(377,22,{3:1,35:1,22:1,377:1},SP);var e6f=enw(eWm,"WrappingStrategy",377,e1G,Wi,Ns);eTS(1383,1,eVD,cL),eUe.Yf=function(e){return Pp(e,37),ts2},eUe.pf=function(e,t){eRb(this,Pp(e,37),t)},Y6(eVN,"DepthFirstCycleBreaker",1383),eTS(782,1,eVD,jG),eUe.Yf=function(e){return Pp(e,37),ts3},eUe.pf=function(e,t){eBS(this,Pp(e,37),t)},eUe.Zf=function(e){return Pp(RJ(e,ebO(this.d,e.c.length)),10)},Y6(eVN,"GreedyCycleBreaker",782),eTS(1386,782,eVD,kQ),eUe.Zf=function(e){var t,n,r,i;for(i=null,t=eUu,r=new fz(e);r.a1&&(gN(LK(e_k(Bq((GK(0,e.c.length),Pp(e.c[0],10))),(eBy(),ti7))))?eMR(e,this.d,Pp(this,660)):(Hj(),Mv(e,this.d)),eaz(this.e,e))},eUe.Sf=function(e,t,n,r){var i,a,o,s,u,c,l;for(t!=ja(n,e.length)&&(a=e[t-(n?1:-1)],Xy(this.f,a,n?(enY(),tsN):(enY(),tsD))),i=e[t][0],l=!r||i.k==(eEn(),e9C),c=ZW(e[t]),this.ag(c,l,!1,n),o=0,u=new fz(c);u.a"),e0?zJ(this.a,e[t-1],e[t]):!n&&t1&&(gN(LK(e_k(Bq((GK(0,e.c.length),Pp(e.c[0],10))),(eBy(),ti7))))?eMR(e,this.d,this):(Hj(),Mv(e,this.d)),gN(LK(e_k(Bq((GK(0,e.c.length),Pp(e.c[0],10))),ti7)))||eaz(this.e,e))},Y6(eVF,"ModelOrderBarycenterHeuristic",660),eTS(1803,1,e$C,hx),eUe.ue=function(e,t){return eED(this.a,Pp(e,10),Pp(t,10))},eUe.Fb=function(e){return this===e},eUe.ve=function(){return new fZ(this)},Y6(eVF,"ModelOrderBarycenterHeuristic/lambda$0$Type",1803),eTS(1403,1,eVD,cF),eUe.Yf=function(e){var t;return Pp(e,37),t=TL(tus),RI(t,(e_x(),e9n),(eB$(),e7I)),t},eUe.pf=function(e,t){$w((Pp(e,37),t))},Y6(eVF,"NoCrossingMinimizer",1403),eTS(796,402,eVR,yu),eUe.$f=function(e,t,n){var r,i,a,o,s,u,c,l,f,d,h;switch(f=this.g,n.g){case 1:for(i=0,a=0,l=new fz(e.j);l.a1&&(i.j==(eYu(),tby)?this.b[e]=!0:i.j==tbY&&e>0&&(this.b[e-1]=!0))},eUe.f=0,Y6(eWc,"AllCrossingsCounter",1798),eTS(587,1,{},erH),eUe.b=0,eUe.d=0,Y6(eWc,"BinaryIndexedTree",587),eTS(524,1,{},IQ),Y6(eWc,"CrossingsCounter",524),eTS(1906,1,e$C,hT),eUe.ue=function(e,t){return je(this.a,Pp(e,11),Pp(t,11))},eUe.Fb=function(e){return this===e},eUe.ve=function(){return new fZ(this)},Y6(eWc,"CrossingsCounter/lambda$0$Type",1906),eTS(1907,1,e$C,hM),eUe.ue=function(e,t){return jt(this.a,Pp(e,11),Pp(t,11))},eUe.Fb=function(e){return this===e},eUe.ve=function(){return new fZ(this)},Y6(eWc,"CrossingsCounter/lambda$1$Type",1907),eTS(1908,1,e$C,hO),eUe.ue=function(e,t){return jn(this.a,Pp(e,11),Pp(t,11))},eUe.Fb=function(e){return this===e},eUe.ve=function(){return new fZ(this)},Y6(eWc,"CrossingsCounter/lambda$2$Type",1908),eTS(1909,1,e$C,hA),eUe.ue=function(e,t){return jr(this.a,Pp(e,11),Pp(t,11))},eUe.Fb=function(e){return this===e},eUe.ve=function(){return new fZ(this)},Y6(eWc,"CrossingsCounter/lambda$3$Type",1909),eTS(1910,1,eUF,hL),eUe.td=function(e){QT(this.a,Pp(e,11))},Y6(eWc,"CrossingsCounter/lambda$4$Type",1910),eTS(1911,1,eU9,hC),eUe.Mb=function(e){return kq(this.a,Pp(e,11))},Y6(eWc,"CrossingsCounter/lambda$5$Type",1911),eTS(1912,1,eUF,hI),eUe.td=function(e){kV(this,e)},Y6(eWc,"CrossingsCounter/lambda$6$Type",1912),eTS(1913,1,eUF,SF),eUe.td=function(e){var t;Pj(),Vw(this.b,(t=this.a,Pp(e,11),t))},Y6(eWc,"CrossingsCounter/lambda$7$Type",1913),eTS(826,1,e$q,iq),eUe.Lb=function(e){return Pj(),Ln(Pp(e,11),(eBU(),tng))},eUe.Fb=function(e){return this===e},eUe.Mb=function(e){return Pj(),Ln(Pp(e,11),(eBU(),tng))},Y6(eWc,"CrossingsCounter/lambda$8$Type",826),eTS(1905,1,{},hD),Y6(eWc,"HyperedgeCrossingsCounter",1905),eTS(467,1,{35:1,467:1},Cq),eUe.wd=function(e){return ehq(this,Pp(e,467))},eUe.b=0,eUe.c=0,eUe.e=0,eUe.f=0;var e6m=Y6(eWc,"HyperedgeCrossingsCounter/Hyperedge",467);eTS(362,1,{35:1,362:1},He),eUe.wd=function(e){return eMf(this,Pp(e,362))},eUe.b=0,eUe.c=0;var e6g=Y6(eWc,"HyperedgeCrossingsCounter/HyperedgeCorner",362);eTS(523,22,{3:1,35:1,22:1,523:1},Sj);var e6v=enw(eWc,"HyperedgeCrossingsCounter/HyperedgeCorner/Type",523,e1G,$V,Nc);eTS(1405,1,eVD,cO),eUe.Yf=function(e){return Pp(e_k(Pp(e,37),(eBU(),tt3)),21).Hc((eLR(),ttw))?tuh:null},eUe.pf=function(e,t){evK(this,Pp(e,37),t)},Y6(eVY,"InteractiveNodePlacer",1405),eTS(1406,1,eVD,cM),eUe.Yf=function(e){return Pp(e_k(Pp(e,37),(eBU(),tt3)),21).Hc((eLR(),ttw))?tup:null},eUe.pf=function(e,t){emS(this,Pp(e,37),t)},Y6(eVY,"LinearSegmentsNodePlacer",1406),eTS(257,1,{35:1,257:1},ma),eUe.wd=function(e){return vH(this,Pp(e,257))},eUe.Fb=function(e){var t;return!!M4(e,257)&&(t=Pp(e,257),this.b==t.b)},eUe.Hb=function(){return this.b},eUe.Ib=function(){return"ls"+e_F(this.e)},eUe.a=0,eUe.b=0,eUe.c=-1,eUe.d=-1,eUe.g=0;var e6y=Y6(eVY,"LinearSegmentsNodePlacer/LinearSegment",257);eTS(1408,1,eVD,jW),eUe.Yf=function(e){return Pp(e_k(Pp(e,37),(eBU(),tt3)),21).Hc((eLR(),ttw))?tug:null},eUe.pf=function(e,t){eBr(this,Pp(e,37),t)},eUe.b=0,eUe.g=0,Y6(eVY,"NetworkSimplexPlacer",1408),eTS(1427,1,e$C,iZ),eUe.ue=function(e,t){return ME(Pp(e,19).a,Pp(t,19).a)},eUe.Fb=function(e){return this===e},eUe.ve=function(){return new fZ(this)},Y6(eVY,"NetworkSimplexPlacer/0methodref$compare$Type",1427),eTS(1429,1,e$C,iX),eUe.ue=function(e,t){return ME(Pp(e,19).a,Pp(t,19).a)},eUe.Fb=function(e){return this===e},eUe.ve=function(){return new fZ(this)},Y6(eVY,"NetworkSimplexPlacer/1methodref$compare$Type",1429),eTS(649,1,{649:1},SY);var e6w=Y6(eVY,"NetworkSimplexPlacer/EdgeRep",649);eTS(401,1,{401:1},Ht),eUe.b=!1;var e6_=Y6(eVY,"NetworkSimplexPlacer/NodeRep",401);eTS(508,12,{3:1,4:1,20:1,28:1,52:1,12:1,14:1,15:1,54:1,508:1},mu),Y6(eVY,"NetworkSimplexPlacer/Path",508),eTS(1409,1,{},iJ),eUe.Kb=function(e){return Pp(e,17).d.i.k},Y6(eVY,"NetworkSimplexPlacer/Path/lambda$0$Type",1409),eTS(1410,1,eU9,iQ),eUe.Mb=function(e){return Pp(e,267)==(eEn(),e9D)},Y6(eVY,"NetworkSimplexPlacer/Path/lambda$1$Type",1410),eTS(1411,1,{},i1),eUe.Kb=function(e){return Pp(e,17).d.i},Y6(eVY,"NetworkSimplexPlacer/Path/lambda$2$Type",1411),eTS(1412,1,eU9,hN),eUe.Mb=function(e){return Ct(edH(Pp(e,10)))},Y6(eVY,"NetworkSimplexPlacer/Path/lambda$3$Type",1412),eTS(1413,1,eU9,i0),eUe.Mb=function(e){return RM(Pp(e,11))},Y6(eVY,"NetworkSimplexPlacer/lambda$0$Type",1413),eTS(1414,1,eUF,SB),eUe.td=function(e){MP(this.a,this.b,Pp(e,11))},Y6(eVY,"NetworkSimplexPlacer/lambda$1$Type",1414),eTS(1423,1,eUF,hP),eUe.td=function(e){ekS(this.a,Pp(e,17))},Y6(eVY,"NetworkSimplexPlacer/lambda$10$Type",1423),eTS(1424,1,{},i2),eUe.Kb=function(e){return GE(),new R1(null,new Gq(Pp(e,29).a,16))},Y6(eVY,"NetworkSimplexPlacer/lambda$11$Type",1424),eTS(1425,1,eUF,hR),eUe.td=function(e){eCe(this.a,Pp(e,10))},Y6(eVY,"NetworkSimplexPlacer/lambda$12$Type",1425),eTS(1426,1,{},i3),eUe.Kb=function(e){return GE(),ell(Pp(e,121).e)},Y6(eVY,"NetworkSimplexPlacer/lambda$13$Type",1426),eTS(1428,1,{},i4),eUe.Kb=function(e){return GE(),ell(Pp(e,121).e)},Y6(eVY,"NetworkSimplexPlacer/lambda$15$Type",1428),eTS(1430,1,eU9,i6),eUe.Mb=function(e){return GE(),Pp(e,401).c.k==(eEn(),e9N)},Y6(eVY,"NetworkSimplexPlacer/lambda$17$Type",1430),eTS(1431,1,eU9,i5),eUe.Mb=function(e){return GE(),Pp(e,401).c.j.c.length>1},Y6(eVY,"NetworkSimplexPlacer/lambda$18$Type",1431),eTS(1432,1,eUF,Hn),eUe.td=function(e){ef2(this.c,this.b,this.d,this.a,Pp(e,401))},eUe.c=0,eUe.d=0,Y6(eVY,"NetworkSimplexPlacer/lambda$19$Type",1432),eTS(1415,1,{},i8),eUe.Kb=function(e){return GE(),new R1(null,new Gq(Pp(e,29).a,16))},Y6(eVY,"NetworkSimplexPlacer/lambda$2$Type",1415),eTS(1433,1,eUF,hj),eUe.td=function(e){MD(this.a,Pp(e,11))},eUe.a=0,Y6(eVY,"NetworkSimplexPlacer/lambda$20$Type",1433),eTS(1434,1,{},i9),eUe.Kb=function(e){return GE(),new R1(null,new Gq(Pp(e,29).a,16))},Y6(eVY,"NetworkSimplexPlacer/lambda$21$Type",1434),eTS(1435,1,eUF,hF),eUe.td=function(e){Oi(this.a,Pp(e,10))},Y6(eVY,"NetworkSimplexPlacer/lambda$22$Type",1435),eTS(1436,1,eU9,i7),eUe.Mb=function(e){return Ct(e)},Y6(eVY,"NetworkSimplexPlacer/lambda$23$Type",1436),eTS(1437,1,{},ae),eUe.Kb=function(e){return GE(),new R1(null,new Gq(Pp(e,29).a,16))},Y6(eVY,"NetworkSimplexPlacer/lambda$24$Type",1437),eTS(1438,1,eU9,hY),eUe.Mb=function(e){return xH(this.a,Pp(e,10))},Y6(eVY,"NetworkSimplexPlacer/lambda$25$Type",1438),eTS(1439,1,eUF,SU),eUe.td=function(e){eSl(this.a,this.b,Pp(e,10))},Y6(eVY,"NetworkSimplexPlacer/lambda$26$Type",1439),eTS(1440,1,eU9,at),eUe.Mb=function(e){return GE(),!q9(Pp(e,17))},Y6(eVY,"NetworkSimplexPlacer/lambda$27$Type",1440),eTS(1441,1,eU9,an),eUe.Mb=function(e){return GE(),!q9(Pp(e,17))},Y6(eVY,"NetworkSimplexPlacer/lambda$28$Type",1441),eTS(1442,1,{},hB),eUe.Ce=function(e,t){return M9(this.a,Pp(e,29),Pp(t,29))},Y6(eVY,"NetworkSimplexPlacer/lambda$29$Type",1442),eTS(1416,1,{},ar),eUe.Kb=function(e){return GE(),new R1(null,new YI(new Fa(OH(efc(Pp(e,10)).a.Kc(),new c))))},Y6(eVY,"NetworkSimplexPlacer/lambda$3$Type",1416),eTS(1417,1,eU9,ai),eUe.Mb=function(e){return GE(),Km(Pp(e,17))},Y6(eVY,"NetworkSimplexPlacer/lambda$4$Type",1417),eTS(1418,1,eUF,hU),eUe.td=function(e){eNB(this.a,Pp(e,17))},Y6(eVY,"NetworkSimplexPlacer/lambda$5$Type",1418),eTS(1419,1,{},aa),eUe.Kb=function(e){return GE(),new R1(null,new Gq(Pp(e,29).a,16))},Y6(eVY,"NetworkSimplexPlacer/lambda$6$Type",1419),eTS(1420,1,eU9,ao),eUe.Mb=function(e){return GE(),Pp(e,10).k==(eEn(),e9N)},Y6(eVY,"NetworkSimplexPlacer/lambda$7$Type",1420),eTS(1421,1,{},as),eUe.Kb=function(e){return GE(),new R1(null,new YI(new Fa(OH(efs(Pp(e,10)).a.Kc(),new c))))},Y6(eVY,"NetworkSimplexPlacer/lambda$8$Type",1421),eTS(1422,1,eU9,au),eUe.Mb=function(e){return GE(),Rc(Pp(e,17))},Y6(eVY,"NetworkSimplexPlacer/lambda$9$Type",1422),eTS(1404,1,eVD,cz),eUe.Yf=function(e){return Pp(e_k(Pp(e,37),(eBU(),tt3)),21).Hc((eLR(),ttw))?tuv:null},eUe.pf=function(e,t){ePV(Pp(e,37),t)},Y6(eVY,"SimpleNodePlacer",1404),eTS(180,1,{180:1},eIW),eUe.Ib=function(){var e;return e="",this.c==(zs(),tuw)?e+=ezn:this.c==tuy&&(e+=ezt),this.o==(zQ(),tuE)?e+=ezh:this.o==tuS?e+="UP":e+="BALANCED",e},Y6(eVH,"BKAlignedLayout",180),eTS(516,22,{3:1,35:1,22:1,516:1},Sz);var e6E=enw(eVH,"BKAlignedLayout/HDirection",516,e1G,$Z,Nl);eTS(515,22,{3:1,35:1,22:1,515:1},S$);var e6S=enw(eVH,"BKAlignedLayout/VDirection",515,e1G,$X,Nf);eTS(1634,1,{},SH),Y6(eVH,"BKAligner",1634),eTS(1637,1,{},eg$),Y6(eVH,"BKCompactor",1637),eTS(654,1,{654:1},ac),eUe.a=0,Y6(eVH,"BKCompactor/ClassEdge",654),eTS(458,1,{458:1},mo),eUe.a=null,eUe.b=0,Y6(eVH,"BKCompactor/ClassNode",458),eTS(1407,1,eVD,kX),eUe.Yf=function(e){return Pp(e_k(Pp(e,37),(eBU(),tt3)),21).Hc((eLR(),ttw))?tux:null},eUe.pf=function(e,t){eBP(this,Pp(e,37),t)},eUe.d=!1,Y6(eVH,"BKNodePlacer",1407),eTS(1635,1,{},al),eUe.d=0,Y6(eVH,"NeighborhoodInformation",1635),eTS(1636,1,e$C,hH),eUe.ue=function(e,t){return etp(this,Pp(e,46),Pp(t,46))},eUe.Fb=function(e){return this===e},eUe.ve=function(){return new fZ(this)},Y6(eVH,"NeighborhoodInformation/NeighborComparator",1636),eTS(808,1,{}),Y6(eVH,"ThresholdStrategy",808),eTS(1763,808,{},mm),eUe.bg=function(e,t,n){return this.a.o==(zQ(),tuS)?eHQ:eH1},eUe.cg=function(){},Y6(eVH,"ThresholdStrategy/NullThresholdStrategy",1763),eTS(579,1,{579:1},SG),eUe.c=!1,eUe.d=!1,Y6(eVH,"ThresholdStrategy/Postprocessable",579),eTS(1764,808,{},mg),eUe.bg=function(e,t,n){var r,i,a;return(i=t==n,r=this.a.a[n.p]==t,i||r)?(a=e,this.a.c,zs(),i&&(a=ePX(this,t,!0)),isNaN(a)||isFinite(a)||!r||(a=ePX(this,n,!1)),a):e},eUe.cg=function(){for(var e,t,n,r,i;0!=this.d.b;){if((r=eDJ(this,i=Pp(zv(this.d),579))).a)e=r.a,((n=gN(this.a.f[this.a.g[i.b.p].p]))||q9(e)||e.c.i.c!=e.d.i.c)&&((t=eMd(this,i))||Th(this.e,i))}for(;0!=this.e.a.c.length;)eMd(this,Pp(euO(this.e),579))},Y6(eVH,"ThresholdStrategy/SimpleThresholdStrategy",1764),eTS(635,1,{635:1,246:1,234:1},af),eUe.Kf=function(){return eaM(this)},eUe.Xf=function(){return eaM(this)},Y6(eV$,"EdgeRouterFactory",635),eTS(1458,1,eVD,cG),eUe.Yf=function(e){return eLb(Pp(e,37))},eUe.pf=function(e,t){eP7(Pp(e,37),t)},Y6(eV$,"OrthogonalEdgeRouter",1458),eTS(1451,1,eVD,kJ),eUe.Yf=function(e){return ev4(Pp(e,37))},eUe.pf=function(e,t){eYg(this,Pp(e,37),t)},Y6(eV$,"PolylineEdgeRouter",1451),eTS(1452,1,e$q,ad),eUe.Lb=function(e){return eaQ(Pp(e,10))},eUe.Fb=function(e){return this===e},eUe.Mb=function(e){return eaQ(Pp(e,10))},Y6(eV$,"PolylineEdgeRouter/1",1452),eTS(1809,1,eU9,ah),eUe.Mb=function(e){return Pp(e,129).c==(Xa(),tuU)},Y6(eVz,"HyperEdgeCycleDetector/lambda$0$Type",1809),eTS(1810,1,{},ap),eUe.Ge=function(e){return Pp(e,129).d},Y6(eVz,"HyperEdgeCycleDetector/lambda$1$Type",1810),eTS(1811,1,eU9,ab),eUe.Mb=function(e){return Pp(e,129).c==(Xa(),tuU)},Y6(eVz,"HyperEdgeCycleDetector/lambda$2$Type",1811),eTS(1812,1,{},am),eUe.Ge=function(e){return Pp(e,129).d},Y6(eVz,"HyperEdgeCycleDetector/lambda$3$Type",1812),eTS(1813,1,{},ag),eUe.Ge=function(e){return Pp(e,129).d},Y6(eVz,"HyperEdgeCycleDetector/lambda$4$Type",1813),eTS(1814,1,{},av),eUe.Ge=function(e){return Pp(e,129).d},Y6(eVz,"HyperEdgeCycleDetector/lambda$5$Type",1814),eTS(112,1,{35:1,112:1},ea$),eUe.wd=function(e){return v$(this,Pp(e,112))},eUe.Fb=function(e){var t;return!!M4(e,112)&&(t=Pp(e,112),this.g==t.g)},eUe.Hb=function(){return this.g},eUe.Ib=function(){var e,t,n,r;for(e=new O0("{"),r=new fz(this.n);r.a"+this.b+" ("+AK(this.c)+")"},eUe.d=0,Y6(eVz,"HyperEdgeSegmentDependency",129),eTS(520,22,{3:1,35:1,22:1,520:1},SW);var e6k=enw(eVz,"HyperEdgeSegmentDependency/DependencyType",520,e1G,$q,Nd);eTS(1815,1,{},h$),Y6(eVz,"HyperEdgeSegmentSplitter",1815),eTS(1816,1,{},ym),eUe.a=0,eUe.b=0,Y6(eVz,"HyperEdgeSegmentSplitter/AreaRating",1816),eTS(329,1,{329:1},N4),eUe.a=0,eUe.b=0,eUe.c=0,Y6(eVz,"HyperEdgeSegmentSplitter/FreeArea",329),eTS(1817,1,e$C,aT),eUe.ue=function(e,t){return ID(Pp(e,112),Pp(t,112))},eUe.Fb=function(e){return this===e},eUe.ve=function(){return new fZ(this)},Y6(eVz,"HyperEdgeSegmentSplitter/lambda$0$Type",1817),eTS(1818,1,eUF,Hi),eUe.td=function(e){V6(this.a,this.d,this.c,this.b,Pp(e,112))},eUe.b=0,Y6(eVz,"HyperEdgeSegmentSplitter/lambda$1$Type",1818),eTS(1819,1,{},aM),eUe.Kb=function(e){return new R1(null,new Gq(Pp(e,112).e,16))},Y6(eVz,"HyperEdgeSegmentSplitter/lambda$2$Type",1819),eTS(1820,1,{},aO),eUe.Kb=function(e){return new R1(null,new Gq(Pp(e,112).j,16))},Y6(eVz,"HyperEdgeSegmentSplitter/lambda$3$Type",1820),eTS(1821,1,{},aA),eUe.Fe=function(e){return gP(LV(e))},Y6(eVz,"HyperEdgeSegmentSplitter/lambda$4$Type",1821),eTS(655,1,{},YJ),eUe.a=0,eUe.b=0,eUe.c=0,Y6(eVz,"OrthogonalRoutingGenerator",655),eTS(1638,1,{},aL),eUe.Kb=function(e){return new R1(null,new Gq(Pp(e,112).e,16))},Y6(eVz,"OrthogonalRoutingGenerator/lambda$0$Type",1638),eTS(1639,1,{},aC),eUe.Kb=function(e){return new R1(null,new Gq(Pp(e,112).j,16))},Y6(eVz,"OrthogonalRoutingGenerator/lambda$1$Type",1639),eTS(661,1,{}),Y6(eVG,"BaseRoutingDirectionStrategy",661),eTS(1807,661,{},mv),eUe.dg=function(e,t,n){var r,i,a,o,s,u,c,l,f,d,h,p,b;if(!e.r||e.q)for(l=t+e.o*n,c=new fz(e.n);c.aez9&&(a=l,i=e,r=new kl(f,a),P7(o.a,r),eDD(this,o,i,r,!1),(d=e.r)&&(h=gP(LV(ep3(d.e,0))),r=new kl(h,a),P7(o.a,r),eDD(this,o,i,r,!1),a=t+d.o*n,i=d,r=new kl(h,a),P7(o.a,r),eDD(this,o,i,r,!1)),r=new kl(b,a),P7(o.a,r),eDD(this,o,i,r,!1)))},eUe.eg=function(e){return e.i.n.a+e.n.a+e.a.a},eUe.fg=function(){return eYu(),tbj},eUe.gg=function(){return eYu(),tbw},Y6(eVG,"NorthToSouthRoutingStrategy",1807),eTS(1808,661,{},my),eUe.dg=function(e,t,n){var r,i,a,o,s,u,c,l,f,d,h,p,b;if(!e.r||e.q)for(l=t-e.o*n,c=new fz(e.n);c.aez9&&(a=l,i=e,r=new kl(f,a),P7(o.a,r),eDD(this,o,i,r,!1),(d=e.r)&&(h=gP(LV(ep3(d.e,0))),r=new kl(h,a),P7(o.a,r),eDD(this,o,i,r,!1),a=t-d.o*n,i=d,r=new kl(h,a),P7(o.a,r),eDD(this,o,i,r,!1)),r=new kl(b,a),P7(o.a,r),eDD(this,o,i,r,!1)))},eUe.eg=function(e){return e.i.n.a+e.n.a+e.a.a},eUe.fg=function(){return eYu(),tbw},eUe.gg=function(){return eYu(),tbj},Y6(eVG,"SouthToNorthRoutingStrategy",1808),eTS(1806,661,{},mw),eUe.dg=function(e,t,n){var r,i,a,o,s,u,c,l,f,d,h,p,b;if(!e.r||e.q)for(l=t+e.o*n,c=new fz(e.n);c.aez9&&(a=l,i=e,r=new kl(a,f),P7(o.a,r),eDD(this,o,i,r,!0),(d=e.r)&&(h=gP(LV(ep3(d.e,0))),r=new kl(a,h),P7(o.a,r),eDD(this,o,i,r,!0),a=t+d.o*n,i=d,r=new kl(a,h),P7(o.a,r),eDD(this,o,i,r,!0)),r=new kl(a,b),P7(o.a,r),eDD(this,o,i,r,!0)))},eUe.eg=function(e){return e.i.n.b+e.n.b+e.a.b},eUe.fg=function(){return eYu(),tby},eUe.gg=function(){return eYu(),tbY},Y6(eVG,"WestToEastRoutingStrategy",1806),eTS(813,1,{},eNG),eUe.Ib=function(){return e_F(this.a)},eUe.b=0,eUe.c=!1,eUe.d=!1,eUe.f=0,Y6(eVK,"NubSpline",813),eTS(407,1,{407:1},eA2,za),Y6(eVK,"NubSpline/PolarCP",407),eTS(1453,1,eVD,egt),eUe.Yf=function(e){return ewy(Pp(e,37))},eUe.pf=function(e,t){eYW(this,Pp(e,37),t)},Y6(eVK,"SplineEdgeRouter",1453),eTS(268,1,{268:1},Xt),eUe.Ib=function(){return this.a+" ->("+this.c+") "+this.b},eUe.c=0,Y6(eVK,"SplineEdgeRouter/Dependency",268),eTS(455,22,{3:1,35:1,22:1,455:1},SK);var e6x=enw(eVK,"SplineEdgeRouter/SideToProcess",455,e1G,$J,Nh);eTS(1454,1,eU9,ak),eUe.Mb=function(e){return eAq(),!Pp(e,128).o},Y6(eVK,"SplineEdgeRouter/lambda$0$Type",1454),eTS(1455,1,{},aS),eUe.Ge=function(e){return eAq(),Pp(e,128).v+1},Y6(eVK,"SplineEdgeRouter/lambda$1$Type",1455),eTS(1456,1,eUF,SV),eUe.td=function(e){Rw(this.a,this.b,Pp(e,46))},Y6(eVK,"SplineEdgeRouter/lambda$2$Type",1456),eTS(1457,1,eUF,Sq),eUe.td=function(e){R_(this.a,this.b,Pp(e,46))},Y6(eVK,"SplineEdgeRouter/lambda$3$Type",1457),eTS(128,1,{35:1,128:1},eSB,eRM),eUe.wd=function(e){return vz(this,Pp(e,128))},eUe.b=0,eUe.e=!1,eUe.f=0,eUe.g=0,eUe.j=!1,eUe.k=!1,eUe.n=0,eUe.o=!1,eUe.p=!1,eUe.q=!1,eUe.s=0,eUe.u=0,eUe.v=0,eUe.F=0,Y6(eVK,"SplineSegment",128),eTS(459,1,{459:1},ax),eUe.a=0,eUe.b=!1,eUe.c=!1,eUe.d=!1,eUe.e=!1,eUe.f=0,Y6(eVK,"SplineSegment/EdgeInformation",459),eTS(1234,1,{},ay),Y6(eVJ,ezQ,1234),eTS(1235,1,e$C,aw),eUe.ue=function(e,t){return ek4(Pp(e,135),Pp(t,135))},eUe.Fb=function(e){return this===e},eUe.ve=function(){return new fZ(this)},Y6(eVJ,ez1,1235),eTS(1233,1,{},y2),Y6(eVJ,"MrTree",1233),eTS(393,22,{3:1,35:1,22:1,393:1,246:1,234:1},SZ),eUe.Kf=function(){return ek5(this)},eUe.Xf=function(){return ek5(this)};var e6T=enw(eVJ,"TreeLayoutPhases",393,e1G,VM,Np);eTS(1130,209,ezL,CJ),eUe.Ze=function(e,t){var n,r,i,a,o,s,u;for(gN(LK(eT9(e,(eTj(),tcA))))||zh(n=new df((_q(),new gM(e)))),o=(eaW(s=new Xn,e),eo3(s,(eR5(),tcl),e),u=new p2,eDf(e,s,u),eDU(e,s,u),s),a=eDO(this.a,o),i=new fz(a);i.a"+WU(this.c):"e_"+esj(this)},Y6(eVQ,"TEdge",188),eTS(135,134,{3:1,135:1,94:1,134:1},Xn),eUe.Ib=function(){var e,t,n,r,i;for(i=null,r=epL(this.b,0);r.b!=r.d.c;)i+=(null==(n=Pp(Vv(r),86)).c||0==n.c.length?"n_"+n.g:"n_"+n.c)+"\n";for(t=epL(this.a,0);t.b!=t.d.c;)i+=((e=Pp(Vv(t),188)).b&&e.c?WU(e.b)+"->"+WU(e.c):"e_"+esj(e))+"\n";return i};var e6M=Y6(eVQ,"TGraph",135);eTS(633,502,{3:1,502:1,633:1,94:1,134:1}),Y6(eVQ,"TShape",633),eTS(86,633,{3:1,502:1,86:1,633:1,94:1,134:1},esH),eUe.Ib=function(){return WU(this)};var e6O=Y6(eVQ,"TNode",86);eTS(255,1,eU$,hz),eUe.Jc=function(e){qX(this,e)},eUe.Kc=function(){var e;return e=epL(this.a.d,0),new hG(e)},Y6(eVQ,"TNode/2",255),eTS(358,1,eUE,hG),eUe.Nb=function(e){F9(this,e)},eUe.Pb=function(){return Pp(Vv(this.a),188).c},eUe.Ob=function(){return yV(this.a)},eUe.Qb=function(){etu(this.a)},Y6(eVQ,"TNode/2/1",358),eTS(1840,1,eGB,CX),eUe.pf=function(e,t){eNv(this,Pp(e,135),t)},Y6(eV1,"FanProcessor",1840),eTS(327,22,{3:1,35:1,22:1,327:1,234:1},SX),eUe.Kf=function(){switch(this.g){case 0:return new mX;case 1:return new CX;case 2:return new aN;case 3:return new aI;case 4:return new aR;case 5:return new aj;default:throw p7(new gL(eWt+(null!=this.f?this.f:""+this.g)))}};var e6A=enw(eV1,eWn,327,e1G,JS,Nb);eTS(1843,1,eGB,aI),eUe.pf=function(e,t){eMo(this,Pp(e,135),t)},eUe.a=0,Y6(eV1,"LevelHeightProcessor",1843),eTS(1844,1,eU$,aD),eUe.Jc=function(e){qX(this,e)},eUe.Kc=function(){return Hj(),wV(),e2o},Y6(eV1,"LevelHeightProcessor/1",1844),eTS(1841,1,eGB,aN),eUe.pf=function(e,t){eSP(this,Pp(e,135),t)},eUe.a=0,Y6(eV1,"NeighborsProcessor",1841),eTS(1842,1,eU$,aP),eUe.Jc=function(e){qX(this,e)},eUe.Kc=function(){return Hj(),wV(),e2o},Y6(eV1,"NeighborsProcessor/1",1842),eTS(1845,1,eGB,aR),eUe.pf=function(e,t){eMa(this,Pp(e,135),t)},eUe.a=0,Y6(eV1,"NodePositionProcessor",1845),eTS(1839,1,eGB,mX),eUe.pf=function(e,t){eRm(this,Pp(e,135))},Y6(eV1,"RootProcessor",1839),eTS(1846,1,eGB,aj),eUe.pf=function(e,t){elE(Pp(e,135))},Y6(eV1,"Untreeifyer",1846),eTS(851,1,e$2,c$),eUe.Qe=function(e){efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eV3),""),"Weighting of Nodes"),"Which weighting to use when computing a node order."),tcE),(eSd(),tdv)),e6L),el8((epx(),tdh))))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eV4),""),"Search Order"),"Which search order to use when computing a spanning tree."),tcw),tdv),e6C),el8(tdh)))),ejG((new cH,e))},Y6(eV6,"MrTreeMetaDataProvider",851),eTS(994,1,e$2,cH),eUe.Qe=function(e){ejG(e)},Y6(eV6,"MrTreeOptions",994),eTS(995,1,{},aF),eUe.$e=function(){return new CJ},eUe._e=function(e){},Y6(eV6,"MrTreeOptions/MrtreeFactory",995),eTS(480,22,{3:1,35:1,22:1,480:1},SJ);var e6L=enw(eV6,"OrderWeighting",480,e1G,$1,Nm);eTS(425,22,{3:1,35:1,22:1,425:1},SQ);var e6C=enw(eV6,"TreeifyingOrder",425,e1G,$Q,Nv);eTS(1459,1,eVD,cD),eUe.Yf=function(e){return Pp(e,135),tcz},eUe.pf=function(e,t){eiD(this,Pp(e,135),t)},Y6("org.eclipse.elk.alg.mrtree.p1treeify","DFSTreeifyer",1459),eTS(1460,1,eVD,cN),eUe.Yf=function(e){return Pp(e,135),tcG},eUe.pf=function(e,t){eSZ(this,Pp(e,135),t)},Y6("org.eclipse.elk.alg.mrtree.p2order","NodeOrderer",1460),eTS(1461,1,eVD,cI),eUe.Yf=function(e){return Pp(e,135),tcW},eUe.pf=function(e,t){eCh(this,Pp(e,135),t)},eUe.a=0,Y6("org.eclipse.elk.alg.mrtree.p3place","NodePlacer",1461),eTS(1462,1,eVD,cP),eUe.Yf=function(e){return Pp(e,135),tcK},eUe.pf=function(e,t){evm(Pp(e,135),t)},Y6("org.eclipse.elk.alg.mrtree.p4route","EdgeRouter",1462),eTS(495,22,{3:1,35:1,22:1,495:1,246:1,234:1},S1),eUe.Kf=function(){return ede(this)},eUe.Xf=function(){return ede(this)};var e6I=enw(eV9,"RadialLayoutPhases",495,e1G,$0,Ng);eTS(1131,209,ezL,y0),eUe.Ze=function(e,t){var n,r,i,a,o,s;if(n=eS9(this,e),ewG(t,"Radial layout",n.c.length),gN(LK(eT9(e,(egj(),tlm))))||zh(r=new df((_q(),new gM(e)))),s=ewE(e),ebu(e,(Lj(),tcV),s),!s)throw p7(new gL("The given graph is not a tree!"));for(0==(i=gP(LV(eT9(e,tl_))))&&(i=ekB(e)),ebu(e,tl_,i),o=new fz(eS9(this,e));o.a0&&eu9((GV(t-1,e.length),e.charCodeAt(t-1)),eGq);)--t;if(r>=t)throw p7(new gL("The given string does not contain any numbers."));if(2!=(i=eIk(e.substr(r,t-r),",|;|\r|\n")).length)throw p7(new gL("Exactly two numbers are expected, "+i.length+" were found."));try{this.a=eEu(e_H(i[0])),this.b=eEu(e_H(i[1]))}catch(a){if(a=eoa(a),M4(a,127))throw n=a,p7(new gL(eGZ+n));throw p7(a)}},eUe.Ib=function(){return"("+this.a+","+this.b+")"},eUe.a=0,eUe.b=0;var e60=Y6(eGX,"KVector",8);eTS(74,68,{3:1,4:1,20:1,28:1,52:1,14:1,68:1,15:1,74:1,414:1},mE,yc,Lb),eUe.Pc=function(){return euE(this)},eUe.Jf=function(e){var t,n,r,i,a,o;r=eIk(e,",|;|\\(|\\)|\\[|\\]|\\{|\\}| | |\n"),HC(this);try{for(n=0,a=0,i=0,o=0;n0&&(a%2==0?i=eEu(r[n]):o=eEu(r[n]),a>0&&a%2!=0&&P7(this,new kl(i,o)),++a),++n}catch(s){if(s=eoa(s),M4(s,127))throw t=s,p7(new gL("The given string does not match the expected format for vectors."+t));throw p7(s)}},eUe.Ib=function(){var e,t,n;for(e=new O0("("),t=epL(this,0);t.b!=t.d.c;)xM(e,(n=Pp(Vv(t),8)).a+","+n.b),t.b!=t.d.c&&(e.a+="; ");return(e.a+=")",e).a};var e62=Y6(eGX,"KVectorChain",74);eTS(248,22,{3:1,35:1,22:1,248:1},kf);var e63=enw(eZe,"Alignment",248,e1G,Jg,NP);eTS(979,1,e$2,cq),eUe.Qe=function(e){eDj(e)},Y6(eZe,"BoxLayouterOptions",979),eTS(980,1,{},oA),eUe.$e=function(){return new oF},eUe._e=function(e){},Y6(eZe,"BoxLayouterOptions/BoxFactory",980),eTS(291,22,{3:1,35:1,22:1,291:1},kd);var e64=enw(eZe,"ContentAlignment",291,e1G,Jm,NR);eTS(684,1,e$2,cZ),eUe.Qe=function(e){efO(e,new eE9(yt(ye(yn(v4(v7(v5(v8(new oN,eZi),""),"Layout Algorithm"),"Select a specific layout algorithm."),(eSd(),tdE)),e17),el8((epx(),tdh))))),efO(e,new eE9(yt(ye(yn(v4(v7(v5(v8(new oN,eZa),""),"Resolved Layout Algorithm"),"Meta data associated with the selected algorithm."),td_),e6X),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eVi),""),"Alignment"),"Alignment of the selected node relative to other nodes; the exact meaning depends on the used algorithm."),td0),tdv),e63),el8(tdd)))),efO(e,new eE9(yt(ye(yn(v4(v7(v5(v8(new oN,ezG),""),"Aspect Ratio"),"The desired aspect ratio of the drawing, that is the quotient of width by height."),tdg),e13),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v4(v7(v5(v8(new oN,eZo),""),"Bend Points"),"A fixed list of bend points for the edge. This is used by the 'Fixed Layout' algorithm to specify a pre-defined routing for an edge. The vector chain must include the source point, any bend points, and the target point, so it must have at least two points."),td_),e62),el8(tdl)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eVg),""),"Content Alignment"),"Specifies how the content of a node are aligned. Each node can individually control the alignment of its contents. I.e. if a node should be aligned top left in its parent node, the parent node should specify that option."),td9),tdy),e64),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eVr),""),"Debug Mode"),"Whether additional debug information shall be generated."),(OQ(),!1)),tdm),e11),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eVu),""),ezw),"Overall direction of edges: horizontal (right / left) or vertical (down / up)."),tht),tdv),e66),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eKB),""),"Edge Routing"),"What kind of edge routing style should be applied for the content of a parent node. Algorithms may also set this option to single edges in order to mark them as splines. The bend point list of edges with this option set to SPLINES must be interpreted as control points for a piecewise cubic spline."),tho),tdv),e68),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eqC),""),"Expand Nodes"),"If active, nodes are expanded to fill the area of their parent."),!1),tdm),e11),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eKP),""),"Hierarchy Handling"),"Determines whether separate layout runs are triggered for different compound nodes in a hierarchical graph. Setting a node's hierarchy handling to `INCLUDE_CHILDREN` will lay out that node and all of its descendants in a single layout run, until a descendant is encountered which has its hierarchy handling set to `SEPARATE_CHILDREN`. In general, `SEPARATE_CHILDREN` will ensure that a new layout run is triggered for a node with that setting. Including multiple levels of hierarchy in a single layout run may allow cross-hierarchical edges to be laid out properly. If the root node is set to `INHERIT` (or not set at all), the default behavior is `SEPARATE_CHILDREN`."),thf),tdv),e67),jL(tdh,eow(vx(e6Q,1),eU4,175,0,[tdd]))))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,ezW),""),"Padding"),"The padding to be left to a parent element's border when placing child elements. This can also serve as an output option of a layout algorithm if node size calculation is setup appropriately."),thP),td_),e4R),jL(tdh,eow(vx(e6Q,1),eU4,175,0,[tdd]))))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eGu),""),"Interactive"),"Whether the algorithm should be run in interactive mode for the content of a parent node. What this means exactly depends on how the specific algorithm interprets this option. Usually in the interactive mode algorithms try to modify the current layout as little as possible."),!1),tdm),e11),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eVA),""),"interactive Layout"),"Whether the graph should be changeable interactively and by setting constraints"),!1),tdm),e11),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eGf),""),"Omit Node Micro Layout"),"Node micro layout comprises the computation of node dimensions (if requested), the placement of ports and their labels, and the placement of node labels. The functionality is implemented independent of any specific layout algorithm and shouldn't have any negative impact on the layout algorithm's performance itself. Yet, if any unforeseen behavior occurs, this option allows to deactivate the micro layout."),!1),tdm),e11),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eGc),""),"Port Constraints"),"Defines constraints of the position of the ports of a node."),thq),tdv),e5r),el8(tdd)))),efO(e,new eE9(yt(ye(yn(v4(v7(v5(v8(new oN,eVT),""),"Position"),"The position of a node, port, or label. This is used by the 'Fixed Layout' algorithm to specify a pre-defined position."),td_),e60),jL(tdd,eow(vx(e6Q,1),eU4,175,0,[tdp,tdf]))))),efO(e,new eE9(yt(ye(yn(v4(v7(v5(v8(new oN,eGr),""),"Priority"),"Defines the priority of an object; its meaning depends on the specific layout algorithm and the context where it is used."),tdw),e16),jL(tdd,eow(vx(e6Q,1),eU4,175,0,[tdl]))))),efO(e,new eE9(yt(ye(yn(v4(v7(v5(v8(new oN,eGo),""),"Randomization Seed"),"Seed used for pseudo-random number generators to control the layout algorithm. If the value is 0, the seed shall be determined pseudo-randomly (e.g. from the system time)."),tdw),e16),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v4(v7(v5(v8(new oN,eGs),""),"Separate Connected Components"),"Whether each connected component should be processed separately."),tdm),e11),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eVv),""),"Junction Points"),"This option is not used as option, but as output of the layout algorithms. It is attached to edges and determines the points where junction symbols should be drawn in order to represent hyperedges with orthogonal routing. Whether such points are computed depends on the chosen layout algorithm and edge routing style. The points are put into the vector chain with no specific order."),thv),td_),e62),el8(tdl)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eV_),""),"Comment Box"),"Whether the node should be regarded as a comment box instead of a regular node. In that case its placement should be similar to how labels are handled. Any edges incident to a comment box specify to which graph elements the comment is related."),!1),tdm),e11),el8(tdd)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eVE),""),"Hypernode"),"Whether the node should be handled as a hypernode."),!1),tdm),e11),el8(tdd)))),efO(e,new eE9(yt(ye(yn(v4(v7(v5(v8(new oN,eZs),""),"Label Manager"),"Label managers can shorten labels upon a layout algorithm's request."),td_),tyO),jL(tdh,eow(vx(e6Q,1),eU4,175,0,[tdf]))))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eVM),""),"Margins"),"Margins define additional space around the actual bounds of a graph element. For instance, ports or labels being placed on the outside of a node's border might introduce such a margin. The margin is used to guarantee non-overlap of other graph elements with those ports or labels."),thw),td_),e4D),el8(tdd)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eVt),""),"No Layout"),"No layout is done for the associated element. This is used to mark parts of a diagram to avoid their inclusion in the layout graph, or to mark parts of the layout graph to prevent layout engines from processing them. If you wish to exclude the contents of a compound node from automatic layout, while the node itself is still considered on its own layer, use the 'Fixed Layout' algorithm for that node."),!1),tdm),e11),jL(tdd,eow(vx(e6Q,1),eU4,175,0,[tdl,tdp,tdf]))))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eZu),""),"Scale Factor"),"The scaling factor to be applied to the corresponding node in recursive layout. It causes the corresponding node's size to be adjusted, and its ports and labels to be sized and placed accordingly after the layout of that node has been determined (and before the node itself and its siblings are arranged). The scaling is not reverted afterwards, so the resulting layout graph contains the adjusted size and position data. This option is currently not supported if 'Layout Hierarchy' is set."),1),tdg),e13),el8(tdd)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eZc),""),"Animate"),"Whether the shift from the old layout to the new computed layout shall be animated."),!0),tdm),e11),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eZl),""),"Animation Time Factor"),"Factor for computation of animation time. The higher the value, the longer the animation time. If the value is 0, the resulting time is always equal to the minimum defined by 'Minimal Animation Time'."),ell(100)),tdw),e16),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eZf),""),"Layout Ancestors"),"Whether the hierarchy levels on the path from the selected element to the root of the diagram shall be included in the layout process."),!1),tdm),e11),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eZd),""),"Maximal Animation Time"),"The maximal time for animations, in milliseconds."),ell(4e3)),tdw),e16),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eZh),""),"Minimal Animation Time"),"The minimal time for animations, in milliseconds."),ell(400)),tdw),e16),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eZp),""),"Progress Bar"),"Whether a progress bar shall be displayed during layout computations."),!1),tdm),e11),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eZb),""),"Validate Graph"),"Whether the graph shall be validated before any layout algorithm is applied. If this option is enabled and at least one error is found, the layout process is aborted and a message is shown to the user."),!1),tdm),e11),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eZm),""),"Validate Options"),"Whether layout options shall be validated before any layout algorithm is applied. If this option is enabled and at least one error is found, the layout process is aborted and a message is shown to the user."),!0),tdm),e11),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eZg),""),"Zoom to Fit"),"Whether the zoom level shall be set to view the whole diagram after layout."),!1),tdm),e11),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eZr),"box"),"Box Layout Mode"),"Configures the packing mode used by the {@link BoxLayoutProvider}. If SIMPLE is not required (neither priorities are used nor the interactive mode), GROUP_DEC can improve the packing and decrease the area. GROUP_MIXED and GROUP_INC may, in very specific scenarios, work better."),td6),tdv),e5u),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eKQ),eKU),"Comment Comment Spacing"),"Spacing to be preserved between a comment box and other comment boxes connected to the same node. The space left between comment boxes of different nodes is controlled by the node-node spacing."),10),tdg),e13),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eK1),eKU),"Comment Node Spacing"),"Spacing to be preserved between a node and its connected comment boxes. The space left between a node and the comments of another node is controlled by the node-node spacing."),10),tdg),e13),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,ez$),eKU),"Components Spacing"),"Spacing to be preserved between pairs of connected components. This option is only relevant if 'separateConnectedComponents' is activated."),20),tdg),e13),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eK0),eKU),"Edge Spacing"),"Spacing to be preserved between any two edges. Note that while this can somewhat easily be satisfied for the segments of orthogonally drawn edges, it is harder for general polylines or splines."),10),tdg),e13),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eGa),eKU),"Edge Label Spacing"),"The minimal distance to be preserved between a label and the edge it is associated with. Note that the placement of a label is influenced by the 'edgelabels.placement' option."),2),tdg),e13),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eK2),eKU),"Edge Node Spacing"),"Spacing to be preserved between nodes and edges."),10),tdg),e13),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eK3),eKU),"Label Spacing"),"Determines the amount of space to be left between two labels of the same graph element."),0),tdg),e13),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eK5),eKU),"Label Node Spacing"),"Spacing to be preserved between labels and the border of node they are associated with. Note that the placement of a label is influenced by the 'nodelabels.placement' option."),5),tdg),e13),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eK4),eKU),"Horizontal spacing between Label and Port"),"Horizontal spacing to be preserved between labels and the ports they are associated with. Note that the placement of a label is influenced by the 'portlabels.placement' option."),1),tdg),e13),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eK6),eKU),"Vertical spacing between Label and Port"),"Vertical spacing to be preserved between labels and the ports they are associated with. Note that the placement of a label is influenced by the 'portlabels.placement' option."),1),tdg),e13),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eGi),eKU),"Node Spacing"),"The minimal distance to be preserved between each two nodes."),20),tdg),e13),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eK8),eKU),"Node Self Loop Spacing"),"Spacing to be preserved between a node and its self loops."),10),tdg),e13),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eK9),eKU),"Port Spacing"),"Spacing between pairs of ports of the same node."),10),tdg),e13),jL(tdh,eow(vx(e6Q,1),eU4,175,0,[tdd]))))),efO(e,new eE9(yt(ye(yn(v4(v7(v5(v8(new oN,eK7),eKU),"Individual Spacing"),"Allows to specify individual spacing values for graph elements that shall be different from the value specified for the element's parent."),td_),e5c),jL(tdd,eow(vx(e6Q,1),eU4,175,0,[tdl,tdp,tdf]))))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eVO),eKU),"Additional Port Space"),"Additional space around the sets of ports on each node side. For each side of a node, this option can reserve additional space before and after the ports on each side. For example, a top spacing of 20 makes sure that the first port on the western and eastern side is 20 units away from the northern border."),tph),td_),e4D),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v4(v7(v5(v8(new oN,eVx),eZ_),"Layout Partition"),"Partition to which the node belongs. This requires Layout Partitioning to be active. Nodes with lower partition IDs will appear to the left of nodes with higher partition IDs (assuming a left-to-right layout direction)."),tdw),e16),jL(tdh,eow(vx(e6Q,1),eU4,175,0,[tdd]))))),K_(e,eVx,eVk,thY),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eVk),eZ_),"Layout Partitioning"),"Whether to activate partitioned layout. This will allow to group nodes through the Layout Partition option. a pair of nodes with different partition indices is then placed such that the node with lower index is placed to the left of the other node (with left-to-right layout direction). Depending on the layout algorithm, this may only be guaranteed to work if all nodes have a layout partition configured, or at least if edges that cross partitions are not part of a partition-crossing cycle."),thj),tdm),e11),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eVc),eZE),"Node Label Padding"),"Define padding for node labels that are placed inside of a node."),thE),td_),e4R),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eGp),eZE),"Node Label Placement"),"Hints for where node labels are to be placed; if empty, the node label's position is not modified."),thk),tdy),e5t),jL(tdd,eow(vx(e6Q,1),eU4,175,0,[tdf]))))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eVd),eZS),"Port Alignment"),"Defines the default port distribution for a node. May be overridden for each side individually."),thU),tdv),e5n),el8(tdd)))),efO(e,new eE9(yt(ye(yn(v4(v7(v5(v8(new oN,eVh),eZS),"Port Alignment (North)"),"Defines how ports on the northern side are placed, overriding the node's general port alignment."),tdv),e5n),el8(tdd)))),efO(e,new eE9(yt(ye(yn(v4(v7(v5(v8(new oN,eVp),eZS),"Port Alignment (South)"),"Defines how ports on the southern side are placed, overriding the node's general port alignment."),tdv),e5n),el8(tdd)))),efO(e,new eE9(yt(ye(yn(v4(v7(v5(v8(new oN,eVb),eZS),"Port Alignment (West)"),"Defines how ports on the western side are placed, overriding the node's general port alignment."),tdv),e5n),el8(tdd)))),efO(e,new eE9(yt(ye(yn(v4(v7(v5(v8(new oN,eVm),eZS),"Port Alignment (East)"),"Defines how ports on the eastern side are placed, overriding the node's general port alignment."),tdv),e5n),el8(tdd)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eGh),eZk),"Node Size Constraints"),"What should be taken into account when calculating a node's size. Empty size constraints specify that a node's size is already fixed and should not be changed."),thT),tdy),e5o),el8(tdd)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eGd),eZk),"Node Size Options"),"Options modifying the behavior of the size constraints set on a node. Each member of the set specifies something that should be taken into account when calculating node sizes. The empty set corresponds to no further modifications."),thC),tdy),e5s),el8(tdd)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eGM),eZk),"Node Size Minimum"),"The minimal size to which a node can be reduced."),thA),td_),e60),el8(tdd)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eVs),eZk),"Fixed Graph Size"),"By default, the fixed layout provider will enlarge a graph until it is large enough to contain its children. If this option is set, it won't do so."),!1),tdm),e11),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eVy),eKX),"Edge Label Placement"),"Gives a hint on where to put edge labels."),thi),tdv),e65),el8(tdf)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eGl),eKX),"Inline Edge Labels"),"If true, an edge label is placed directly on its edge. May only apply to center edge labels. This kind of label placement is only advisable if the label's rendering is such that it is not crossed by its edge and thus stays legible."),!1),tdm),e11),el8(tdf)))),efO(e,new eE9(yt(ye(yn(v4(v7(v5(v8(new oN,eZv),"font"),"Font Name"),"Font name used for a label."),tdE),e17),el8(tdf)))),efO(e,new eE9(yt(ye(yn(v4(v7(v5(v8(new oN,eZy),"font"),"Font Size"),"Font size used for a label."),tdw),e16),el8(tdf)))),efO(e,new eE9(yt(ye(yn(v4(v7(v5(v8(new oN,eVS),eZx),"Port Anchor Offset"),"The offset to the port position where connections shall be attached."),td_),e60),el8(tdp)))),efO(e,new eE9(yt(ye(yn(v4(v7(v5(v8(new oN,eVw),eZx),"Port Index"),"The index of a port in the fixed order around a node. The order is assumed as clockwise, starting with the leftmost port on the top side. This option must be set if 'Port Constraints' is set to FIXED_ORDER and no specific positions are given for the ports. Additionally, the option 'Port Side' must be defined in this case."),tdw),e16),el8(tdp)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eVn),eZx),"Port Side"),"The side of a node on which a port is situated. This option must be set if 'Port Constraints' is set to FIXED_SIDE or FIXED_ORDER and no specific positions are given for the ports."),th2),tdv),e5a),el8(tdp)))),efO(e,new eE9(yt(ye(yn(v4(v7(v5(v8(new oN,eVe),eZx),"Port Border Offset"),"The offset of ports on the node border. With a positive offset the port is moved outside of the node, while with a negative offset the port is moved towards the inside. An offset of 0 means that the port is placed directly on the node border, i.e. if the port side is north, the port's south border touches the nodes's north border; if the port side is east, the port's west border touches the nodes's east border; if the port side is south, the port's north border touches the node's south border; if the port side is west, the port's east border touches the node's west border."),tdg),e13),el8(tdp)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eGb),eZT),"Port Label Placement"),"Decides on a placement method for port labels; if empty, the node label's position is not modified."),thQ),tdy),e5i),el8(tdd)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eVl),eZT),"Port Labels Next to Port"),"Use 'portLabels.placement': NEXT_TO_PORT_OF_POSSIBLE."),!1),tdm),e11),el8(tdd)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eVf),eZT),"Treat Port Labels as Group"),"If this option is true (default), the labels of a port will be treated as a group when it comes to centering them next to their port. If this option is false, only the first label will be centered next to the port, with the others being placed below. This only applies to labels of eastern and western ports and will have no effect if labels are not placed next to their port."),!0),tdm),e11),el8(tdd)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eVa),eZM),"Activate Inside Self Loops"),"Whether this node allows to route self loops inside of it instead of around it. If set to true, this will make the node a compound node if it isn't already, and will require the layout algorithm to support compound nodes with hierarchical ports."),!1),tdm),e11),el8(tdd)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eVo),eZM),"Inside Self Loop"),"Whether a self loop should be routed inside a node instead of around that node."),!1),tdm),e11),el8(tdl)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,ezz),"edge"),"Edge Thickness"),"The thickness of an edge. This is a hint on the line width used to draw an edge, possibly requiring more space to be reserved for it."),1),tdg),e13),el8(tdl)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eZw),"edge"),"Edge Type"),"The type of an edge. This is usually used for UML class diagrams, where associations must be handled differently from generalizations."),thu),tdv),e69),el8(tdl)))),_B(e,new GM(v0(v3(v2(new of,eG1),"Layered"),'The layer-based method was introduced by Sugiyama, Tagawa and Toda in 1981. It emphasizes the direction of edges by pointing as many edges as possible into the same direction. The nodes are arranged in layers, which are sometimes called "hierarchies", and then reordered such that the number of edge crossings is minimized. Afterwards, concrete coordinates are computed for the nodes and edge bend points.'))),_B(e,new GM(v0(v3(v2(new of,"org.eclipse.elk.orthogonal"),"Orthogonal"),'Orthogonal methods that follow the "topology-shape-metrics" approach by Batini, Nardelli and Tamassia \'86. The first phase determines the topology of the drawing by applying a planarization technique, which results in a planar representation of the graph. The orthogonal shape is computed in the second phase, which aims at minimizing the number of edge bends, and is called orthogonalization. The third phase leads to concrete coordinates for nodes and edge bend points by applying a compaction method, thus defining the metrics.'))),_B(e,new GM(v0(v3(v2(new of,eGn),"Force"),"Layout algorithms that follow physical analogies by simulating a system of attractive and repulsive forces. The first successful method of this kind was proposed by Eades in 1984."))),_B(e,new GM(v0(v3(v2(new of,"org.eclipse.elk.circle"),"Circle"),"Circular layout algorithms emphasize cycles or biconnected components of a graph by arranging them in circles. This is useful if a drawing is desired where such components are clearly grouped, or where cycles are shown as prominent OPTIONS of the graph."))),_B(e,new GM(v0(v3(v2(new of,eV8),"Tree"),"Specialized layout methods for trees, i.e. acyclic graphs. The regular structure of graphs that have no undirected cycles can be emphasized using an algorithm of this type."))),_B(e,new GM(v0(v3(v2(new of,"org.eclipse.elk.planar"),"Planar"),"Algorithms that require a planar or upward planar graph. Most of these algorithms are theoretically interesting, but not practically usable."))),_B(e,new GM(v0(v3(v2(new of,eqp),"Radial"),"Radial layout algorithms usually position the nodes of the graph on concentric circles."))),eIm((new cX,e)),eDj((new cq,e)),eL5((new cJ,e))},Y6(eZe,"CoreOptions",684),eTS(103,22,{3:1,35:1,22:1,103:1},kh);var e66=enw(eZe,ezw,103,e1G,Zh,NY);eTS(272,22,{3:1,35:1,22:1,272:1},kp);var e65=enw(eZe,"EdgeLabelPlacement",272,e1G,Wp,NB);eTS(218,22,{3:1,35:1,22:1,218:1},kb);var e68=enw(eZe,"EdgeRouting",218,e1G,VC,NU);eTS(312,22,{3:1,35:1,22:1,312:1},km);var e69=enw(eZe,"EdgeType",312,e1G,Jx,NH);eTS(977,1,e$2,cX),eUe.Qe=function(e){eIm(e)},Y6(eZe,"FixedLayouterOptions",977),eTS(978,1,{},o$),eUe.$e=function(){return new oR},eUe._e=function(e){},Y6(eZe,"FixedLayouterOptions/FixedFactory",978),eTS(334,22,{3:1,35:1,22:1,334:1},kg);var e67=enw(eZe,"HierarchyHandling",334,e1G,Wh,N$);eTS(285,22,{3:1,35:1,22:1,285:1},kv);var e5e=enw(eZe,"LabelSide",285,e1G,VL,Nz);eTS(93,22,{3:1,35:1,22:1,93:1},ky);var e5t=enw(eZe,"NodeLabelPlacement",93,e1G,ene,NG);eTS(249,22,{3:1,35:1,22:1,249:1},kw);var e5n=enw(eZe,"PortAlignment",249,e1G,Zp,NW);eTS(98,22,{3:1,35:1,22:1,98:1},k_);var e5r=enw(eZe,"PortConstraints",98,e1G,X0,NK);eTS(273,22,{3:1,35:1,22:1,273:1},kE);var e5i=enw(eZe,"PortLabelPlacement",273,e1G,Jk,NV);eTS(61,22,{3:1,35:1,22:1,61:1},kS);var e5a=enw(eZe,"PortSide",61,e1G,q6,NX);eTS(981,1,e$2,cJ),eUe.Qe=function(e){eL5(e)},Y6(eZe,"RandomLayouterOptions",981),eTS(982,1,{},oz),eUe.$e=function(){return new oV},eUe._e=function(e){},Y6(eZe,"RandomLayouterOptions/RandomFactory",982),eTS(374,22,{3:1,35:1,22:1,374:1},kk);var e5o=enw(eZe,"SizeConstraint",374,e1G,VA,Nq);eTS(259,22,{3:1,35:1,22:1,259:1},kx);var e5s=enw(eZe,"SizeOptions",259,e1G,en2,NZ);eTS(370,1,{1949:1},mV),eUe.b=!1,eUe.c=0,eUe.d=-1,eUe.e=null,eUe.f=null,eUe.g=-1,eUe.j=!1,eUe.k=!1,eUe.n=!1,eUe.o=0,eUe.q=0,eUe.r=0,Y6(eVL,"BasicProgressMonitor",370),eTS(972,209,ezL,oF),eUe.Ze=function(e,t){var n,r,i,a,o,s,u,c,l;(ewG(t,"Box layout",2),i=gR(LV(eT9(e,(e_C(),tdG)))),a=Pp(eT9(e,tdH),116),n=gN(LK(eT9(e,tdj))),r=gN(LK(eT9(e,tdF))),0===Pp(eT9(e,tdP),311).g)?(o=(s=new I4((e.a||(e.a=new FQ(e5k,e,10,11)),e.a)),Hj(),Mv(s,new h3(r)),s),u=eSI(e),(null==(c=LV(eT9(e,tdN)))||(BJ(c),c<=0))&&(c=1.3),l=eYA(o,i,a,u.a,u.b,n,(BJ(c),c)),eYx(e,l.a,l.b,!1,!0)):eRF(e,i,a,n),eEj(t)},Y6(eVL,"BoxLayoutProvider",972),eTS(973,1,e$C,h3),eUe.ue=function(e,t){return eOQ(this,Pp(e,33),Pp(t,33))},eUe.Fb=function(e){return this===e},eUe.ve=function(){return new fZ(this)},eUe.a=!1,Y6(eVL,"BoxLayoutProvider/1",973),eTS(157,1,{157:1},etD,Lp),eUe.Ib=function(){return this.c?eC4(this.c):e_F(this.b)},Y6(eVL,"BoxLayoutProvider/Group",157),eTS(311,22,{3:1,35:1,22:1,311:1},kT);var e5u=enw(eVL,"BoxLayoutProvider/PackingMode",311,e1G,VI,NJ);eTS(974,1,e$C,oY),eUe.ue=function(e,t){return HK(Pp(e,157),Pp(t,157))},eUe.Fb=function(e){return this===e},eUe.ve=function(){return new fZ(this)},Y6(eVL,"BoxLayoutProvider/lambda$0$Type",974),eTS(975,1,e$C,oB),eUe.ue=function(e,t){return Hm(Pp(e,157),Pp(t,157))},eUe.Fb=function(e){return this===e},eUe.ve=function(){return new fZ(this)},Y6(eVL,"BoxLayoutProvider/lambda$1$Type",975),eTS(976,1,e$C,oU),eUe.ue=function(e,t){return Hg(Pp(e,157),Pp(t,157))},eUe.Fb=function(e){return this===e},eUe.ve=function(){return new fZ(this)},Y6(eVL,"BoxLayoutProvider/lambda$2$Type",976),eTS(1365,1,{831:1},oH),eUe.qg=function(e,t){return _R(),!M4(t,160)||yX((eoM(),Pp(e,160)),t)},Y6(eVL,"ElkSpacings/AbstractSpacingsBuilder/lambda$0$Type",1365),eTS(1366,1,eUF,h4),eUe.td=function(e){eux(this.a,Pp(e,146))},Y6(eVL,"ElkSpacings/AbstractSpacingsBuilder/lambda$1$Type",1366),eTS(1367,1,eUF,oj),eUe.td=function(e){Pp(e,94),_R()},Y6(eVL,"ElkSpacings/AbstractSpacingsBuilder/lambda$2$Type",1367),eTS(1371,1,eUF,h6),eUe.td=function(e){erQ(this.a,Pp(e,94))},Y6(eVL,"ElkSpacings/AbstractSpacingsBuilder/lambda$3$Type",1371),eTS(1369,1,eU9,kM),eUe.Mb=function(e){return esI(this.a,this.b,Pp(e,146))},Y6(eVL,"ElkSpacings/AbstractSpacingsBuilder/lambda$4$Type",1369),eTS(1368,1,eU9,kO),eUe.Mb=function(e){return Lt(this.a,this.b,Pp(e,831))},Y6(eVL,"ElkSpacings/AbstractSpacingsBuilder/lambda$5$Type",1368),eTS(1370,1,eUF,kA),eUe.td=function(e){Fj(this.a,this.b,Pp(e,146))},Y6(eVL,"ElkSpacings/AbstractSpacingsBuilder/lambda$6$Type",1370),eTS(935,1,{},oP),eUe.Kb=function(e){return TA(e)},eUe.Fb=function(e){return this===e},Y6(eVL,"ElkUtil/lambda$0$Type",935),eTS(936,1,eUF,kL),eUe.td=function(e){exS(this.a,this.b,Pp(e,79))},eUe.a=0,eUe.b=0,Y6(eVL,"ElkUtil/lambda$1$Type",936),eTS(937,1,eUF,kC),eUe.td=function(e){gp(this.a,this.b,Pp(e,202))},eUe.a=0,eUe.b=0,Y6(eVL,"ElkUtil/lambda$2$Type",937),eTS(938,1,eUF,kI),eUe.td=function(e){Me(this.a,this.b,Pp(e,137))},eUe.a=0,eUe.b=0,Y6(eVL,"ElkUtil/lambda$3$Type",938),eTS(939,1,eUF,h5),eUe.td=function(e){RE(this.a,Pp(e,469))},Y6(eVL,"ElkUtil/lambda$4$Type",939),eTS(342,1,{35:1,342:1},pQ),eUe.wd=function(e){return Os(this,Pp(e,236))},eUe.Fb=function(e){var t;return!!M4(e,342)&&(t=Pp(e,342),this.a==t.a)},eUe.Hb=function(){return zy(this.a)},eUe.Ib=function(){return this.a+" (exclusive)"},eUe.a=0,Y6(eVL,"ExclusiveBounds/ExclusiveLowerBound",342),eTS(1138,209,ezL,oR),eUe.Ze=function(e,t){var n,r,i,a,o,s,u,l,f,d,h,p,b,m,g,v,y,w,_,E,S,k,x;for(ewG(t,"Fixed Layout",1),a=Pp(eT9(e,(eBB(),tha)),218),d=0,h=0,y=new Ow((e.a||(e.a=new FQ(e5k,e,10,11)),e.a));y.e!=y.i.gc();){for(g=Pp(epH(y),33),(x=Pp(eT9(g,(euw(),tp$)),8))&&(TP(g,x.a,x.b),Pp(eT9(g,tpF),174).Hc((ed5(),tbW))&&(p=Pp(eT9(g,tpB),8)).a>0&&p.b>0&&eYx(g,p.a,p.b,!0,!0)),d=eB4.Math.max(d,g.i+g.g),h=eB4.Math.max(h,g.j+g.f),l=new Ow((g.n||(g.n=new FQ(e5S,g,1,7)),g.n));l.e!=l.i.gc();)s=Pp(epH(l),137),(x=Pp(eT9(s,tp$),8))&&TP(s,x.a,x.b),d=eB4.Math.max(d,g.i+s.i+s.g),h=eB4.Math.max(h,g.j+s.j+s.f);for(E=new Ow((g.c||(g.c=new FQ(e5x,g,9,9)),g.c));E.e!=E.i.gc();)for(_=Pp(epH(E),118),(x=Pp(eT9(_,tp$),8))&&TP(_,x.a,x.b),S=g.i+_.i,k=g.j+_.j,d=eB4.Math.max(d,S+_.g),h=eB4.Math.max(h,k+_.f),u=new Ow((_.n||(_.n=new FQ(e5S,_,1,7)),_.n));u.e!=u.i.gc();)s=Pp(epH(u),137),(x=Pp(eT9(s,tp$),8))&&TP(s,x.a,x.b),d=eB4.Math.max(d,S+s.i+s.g),h=eB4.Math.max(h,k+s.j+s.f);for(i=new Fa(OH(eOi(g).a.Kc(),new c));eTk(i);)n=Pp(ZC(i),79),f=eYT(n),d=eB4.Math.max(d,f.a),h=eB4.Math.max(h,f.b);for(r=new Fa(OH(eOr(g).a.Kc(),new c));eTk(r);)n=Pp(ZC(r),79),z$(e_I(n))!=e&&(f=eYT(n),d=eB4.Math.max(d,f.a),h=eB4.Math.max(h,f.b))}if(a==(efE(),tpx))for(v=new Ow((e.a||(e.a=new FQ(e5k,e,10,11)),e.a));v.e!=v.i.gc();)for(g=Pp(epH(v),33),r=new Fa(OH(eOi(g).a.Kc(),new c));eTk(r);)n=Pp(ZC(r),79),0==(o=eDX(n)).b?ebu(n,thg,null):ebu(n,thg,o);gN(LK(eT9(e,(euw(),tpY))))||(w=Pp(eT9(e,tpU),116),eYx(e,m=d+w.b+w.c,b=h+w.d+w.a,!0,!0)),eEj(t)},Y6(eVL,"FixedLayoutProvider",1138),eTS(373,134,{3:1,414:1,373:1,94:1,134:1},oG,eer),eUe.Jf=function(e){var t,n,r,i,a,o,s,u,c;if(e)try{for(a=u=eIk(e,";,;"),o=0,s=a.length;o>16&eHd|t^r<<16},eUe.Kc=function(){return new h8(this)},eUe.Ib=function(){return null==this.a&&null==this.b?"pair(null,null)":null==this.a?"pair(null,"+efF(this.b)+")":null==this.b?"pair("+efF(this.a)+",null)":"pair("+efF(this.a)+","+efF(this.b)+")"},Y6(eVL,"Pair",46),eTS(983,1,eUE,h8),eUe.Nb=function(e){F9(this,e)},eUe.Ob=function(){return!this.c&&(!this.b&&null!=this.a.a||null!=this.a.b)},eUe.Pb=function(){if(!this.c&&!this.b&&null!=this.a.a)return this.b=!0,this.a.a;if(!this.c&&null!=this.a.b)return this.c=!0,this.a.b;throw p7(new bC)},eUe.Qb=function(){throw this.c&&null!=this.a.b?this.a.b=null:this.b&&null!=this.a.a&&(this.a.a=null),p7(new bT)},eUe.b=!1,eUe.c=!1,Y6(eVL,"Pair/1",983),eTS(448,1,{448:1},Ho),eUe.Fb=function(e){return UT(this.a,Pp(e,448).a)&&UT(this.c,Pp(e,448).c)&&UT(this.d,Pp(e,448).d)&&UT(this.b,Pp(e,448).b)},eUe.Hb=function(){return euF(eow(vx(e1R,1),eUp,1,5,[this.a,this.c,this.d,this.b]))},eUe.Ib=function(){return"("+this.a+eUd+this.c+eUd+this.d+eUd+this.b+")"},Y6(eVL,"Quadruple",448),eTS(1126,209,ezL,oV),eUe.Ze=function(e,t){var n,r,i,a,o;if(ewG(t,"Random Layout",1),0==(e.a||(e.a=new FQ(e5k,e,10,11)),e.a).i){eEj(t);return}i=(a=Pp(eT9(e,(ed6(),tbz)),19))&&0!=a.a?new qS(a.a):new efo,n=gR(LV(eT9(e,tbU))),o=gR(LV(eT9(e,tbG))),r=Pp(eT9(e,tbH),116),eF1(e,i,n,o,r),eEj(t)},Y6(eVL,"RandomLayoutProvider",1126),eTS(553,1,{}),eUe.qf=function(){return new kl(this.f.i,this.f.j)},eUe.We=function(e){return $k(e,(eBB(),thK))?eT9(this.f,tmu):eT9(this.f,e)},eUe.rf=function(){return new kl(this.f.g,this.f.f)},eUe.sf=function(){return this.g},eUe.Xe=function(e){return X2(this.f,e)},eUe.tf=function(e){eno(this.f,e.a),ens(this.f,e.b)},eUe.uf=function(e){ena(this.f,e.a),eni(this.f,e.b)},eUe.vf=function(e){this.g=e},eUe.g=0,Y6(eZI,"ElkGraphAdapters/AbstractElkGraphElementAdapter",553),eTS(554,1,{839:1},h9),eUe.wf=function(){var e,t;if(!this.b)for(this.b=K$(UB(this.a).i),t=new Ow(UB(this.a));t.e!=t.i.gc();)e=Pp(epH(t),137),P_(this.b,new gO(e));return this.b},eUe.b=null,Y6(eZI,"ElkGraphAdapters/ElkEdgeAdapter",554),eTS(301,553,{},gM),eUe.xf=function(){return em3(this)},eUe.a=null,Y6(eZI,"ElkGraphAdapters/ElkGraphAdapter",301),eTS(630,553,{181:1},gO),Y6(eZI,"ElkGraphAdapters/ElkLabelAdapter",630),eTS(629,553,{680:1},AC),eUe.wf=function(){return em0(this)},eUe.Af=function(){var e;return(e=Pp(eT9(this.f,(eBB(),thy)),142))||(e=new mh),e},eUe.Cf=function(){return em2(this)},eUe.Ef=function(e){var t;t=new Dk(e),ebu(this.f,(eBB(),thy),t)},eUe.Ff=function(e){ebu(this.f,(eBB(),thN),new DS(e))},eUe.yf=function(){return this.d},eUe.zf=function(){var e,t;if(!this.a)for(this.a=new p0,t=new Fa(OH(eOr(Pp(this.f,33)).a.Kc(),new c));eTk(t);)e=Pp(ZC(t),79),P_(this.a,new h9(e));return this.a},eUe.Bf=function(){var e,t;if(!this.c)for(this.c=new p0,t=new Fa(OH(eOi(Pp(this.f,33)).a.Kc(),new c));eTk(t);)e=Pp(ZC(t),79),P_(this.c,new h9(e));return this.c},eUe.Df=function(){return 0!=H9(Pp(this.f,33)).i||gN(LK(Pp(this.f,33).We((eBB(),thh))))},eUe.Gf=function(){QV(this,(_q(),tms))},eUe.a=null,eUe.b=null,eUe.c=null,eUe.d=null,eUe.e=null,Y6(eZI,"ElkGraphAdapters/ElkNodeAdapter",629),eTS(1266,553,{838:1},pA),eUe.wf=function(){return egd(this)},eUe.zf=function(){var e,t;if(!this.a)for(this.a=AH(Pp(this.f,118).xg().i),t=new Ow(Pp(this.f,118).xg());t.e!=t.i.gc();)e=Pp(epH(t),79),P_(this.a,new h9(e));return this.a},eUe.Bf=function(){var e,t;if(!this.c)for(this.c=AH(Pp(this.f,118).yg().i),t=new Ow(Pp(this.f,118).yg());t.e!=t.i.gc();)e=Pp(epH(t),79),P_(this.c,new h9(e));return this.c},eUe.Hf=function(){return Pp(Pp(this.f,118).We((eBB(),th0)),61)},eUe.If=function(){var e,t,n,r,i,a,o,s;for(r=zY(Pp(this.f,118)),n=new Ow(Pp(this.f,118).yg());n.e!=n.i.gc();)for(e=Pp(epH(n),79),s=new Ow((e.c||(e.c=new Ih(e5m,e,5,8)),e.c));s.e!=s.i.gc();)if(o=Pp(epH(s),82),etg(ewH(o),r)||ewH(o)==r&&gN(LK(eT9(e,(eBB(),thp)))))return!0;for(t=new Ow(Pp(this.f,118).xg());t.e!=t.i.gc();)for(e=Pp(epH(t),79),a=new Ow((e.b||(e.b=new Ih(e5m,e,4,7)),e.b));a.e!=a.i.gc();)if(i=Pp(epH(a),82),etg(ewH(i),r))return!0;return!1},eUe.a=null,eUe.b=null,eUe.c=null,Y6(eZI,"ElkGraphAdapters/ElkPortAdapter",1266),eTS(1267,1,e$C,oq),eUe.ue=function(e,t){return eC3(Pp(e,118),Pp(t,118))},eUe.Fb=function(e){return this===e},eUe.ve=function(){return new fZ(this)},Y6(eZI,"ElkGraphAdapters/PortComparator",1267);var e5f=RL(eZD,"EObject"),e5d=RL(eZN,eZP),e5h=RL(eZN,eZR),e5p=RL(eZN,eZj),e5b=RL(eZN,"ElkShape"),e5m=RL(eZN,eZF),e5g=RL(eZN,eZY),e5v=RL(eZN,eZB),e5y=RL(eZD,eZU),e5w=RL(eZD,"EFactory"),e5_=RL(eZD,eZH),e5E=RL(eZD,"EPackage"),e5S=RL(eZN,eZ$),e5k=RL(eZN,eZz),e5x=RL(eZN,eZG);eTS(90,1,eZW),eUe.Jg=function(){return this.Kg(),null},eUe.Kg=function(){return null},eUe.Lg=function(){return this.Kg(),!1},eUe.Mg=function(){return!1},eUe.Ng=function(e){eam(this,e)},Y6(eZK,"BasicNotifierImpl",90),eTS(97,90,eZ0),eUe.nh=function(){return TO(this)},eUe.Og=function(e,t){return e},eUe.Pg=function(){throw p7(new bO)},eUe.Qg=function(e){var t;return t=ebY(Pp(ee2(this.Tg(),this.Vg()),18)),this.eh().ih(this,t.n,t.f,e)},eUe.Rg=function(e,t){throw p7(new bO)},eUe.Sg=function(e,t,n){return eDg(this,e,t,n)},eUe.Tg=function(){var e;return this.Pg()&&(e=this.Pg().ck())?e:this.zh()},eUe.Ug=function(){return eTp(this)},eUe.Vg=function(){throw p7(new bO)},eUe.Wg=function(){var e,t;return(t=this.ph().dk())||this.Pg().ik(t=(_0(),null==(e=zr(eNT(this.Tg())))?tgV:new AA(this,e))),t},eUe.Xg=function(e,t){return e},eUe.Yg=function(e){var t;return(t=e.Gj())?e.aj():edv(this.Tg(),e)},eUe.Zg=function(){var e;return(e=this.Pg())?e.fk():null},eUe.$g=function(){return this.Pg()?this.Pg().ck():null},eUe._g=function(e,t,n){return ebl(this,e,t,n)},eUe.ah=function(e){return JG(this,e)},eUe.bh=function(e,t){return ZN(this,e,t)},eUe.dh=function(){var e;return!!(e=this.Pg())&&e.gk()},eUe.eh=function(){throw p7(new bO)},eUe.fh=function(){return ehO(this)},eUe.gh=function(e,t,n,r){return ep0(this,e,t,r)},eUe.hh=function(e,t,n){var r;return(r=Pp(ee2(this.Tg(),t),66)).Nj().Qj(this,this.yh(),t-this.Ah(),e,n)},eUe.ih=function(e,t,n,r){return $7(this,e,t,r)},eUe.jh=function(e,t,n){var r;return(r=Pp(ee2(this.Tg(),t),66)).Nj().Rj(this,this.yh(),t-this.Ah(),e,n)},eUe.kh=function(){return!!this.Pg()&&!!this.Pg().ek()},eUe.lh=function(e){return epY(this,e)},eUe.mh=function(e){return zz(this,e)},eUe.oh=function(e){return eR2(this,e)},eUe.ph=function(){throw p7(new bO)},eUe.qh=function(){return this.Pg()?this.Pg().ek():null},eUe.rh=function(){return ehO(this)},eUe.sh=function(e,t){eS6(this,e,t)},eUe.th=function(e){this.ph().hk(e)},eUe.uh=function(e){this.ph().kk(e)},eUe.vh=function(e){this.ph().jk(e)},eUe.wh=function(e,t){var n,r,i,a;return(a=this.Zg())&&e&&(t=ep5(a.Vk(),this,t),a.Zk(this)),(r=this.eh())&&((eIy(this,this.eh(),this.Vg()).Bb&eH3)!=0?(i=r.fh())&&(e?a||i.Zk(this):i.Yk(this)):(t=(n=this.Vg())>=0?this.Qg(t):this.eh().ih(this,-1-n,null,t),t=this.Sg(null,-1,t))),this.uh(e),t},eUe.xh=function(e){var t,n,r,i,a,o,s,u;if((a=edv(n=this.Tg(),e))>=(t=this.Ah()))return Pp(e,66).Nj().Uj(this,this.yh(),a-t);if(a<=-1){if(o=eR3((eSp(),tvc),n,e)){if(_4(),Pp(o,66).Oj()||(o=Wk(QZ(tvc,o))),i=Pp((r=this.Yg(o))>=0?this._g(r,!0,!0):exk(this,o,!0),153),(u=o.Zj())>1||-1==u)return Pp(Pp(i,215).hl(e,!1),76)}else throw p7(new gL(eZV+e.ne()+eZX))}else if(e.$j())return Pp((r=this.Yg(e))>=0?this._g(r,!1,!0):exk(this,e,!1),76);return new k4(this,e)},eUe.yh=function(){return Q6(this)},eUe.zh=function(){return(BM(),tgv).S},eUe.Ah=function(){return Y1(this.zh())},eUe.Bh=function(e){eSi(this,e)},eUe.Ib=function(){return eMT(this)},Y6(eZ2,"BasicEObjectImpl",97),eTS(114,97,{105:1,92:1,90:1,56:1,108:1,49:1,97:1,114:1}),eUe.Ch=function(e){var t;return(t=Q5(this))[e]},eUe.Dh=function(e,t){var n;n=Q5(this),Bc(n,e,t)},eUe.Eh=function(e){var t;t=Q5(this),Bc(t,e,null)},eUe.Jg=function(){return Pp(eaS(this,4),126)},eUe.Kg=function(){throw p7(new bO)},eUe.Lg=function(){return(4&this.Db)!=0},eUe.Pg=function(){throw p7(new bO)},eUe.Fh=function(e){ehU(this,2,e)},eUe.Rg=function(e,t){this.Db=t<<16|255&this.Db,this.Fh(e)},eUe.Tg=function(){return $S(this)},eUe.Vg=function(){return this.Db>>16},eUe.Wg=function(){var e,t;return _0(),null==(t=zr(eNT((e=Pp(eaS(this,16),26))||this.zh())))?tgV:new AA(this,t)},eUe.Mg=function(){return(1&this.Db)==0},eUe.Zg=function(){return Pp(eaS(this,128),1935)},eUe.$g=function(){return Pp(eaS(this,16),26)},eUe.dh=function(){return(32&this.Db)!=0},eUe.eh=function(){return Pp(eaS(this,2),49)},eUe.kh=function(){return(64&this.Db)!=0},eUe.ph=function(){throw p7(new bO)},eUe.qh=function(){return Pp(eaS(this,64),281)},eUe.th=function(e){ehU(this,16,e)},eUe.uh=function(e){ehU(this,128,e)},eUe.vh=function(e){ehU(this,64,e)},eUe.yh=function(){return ehH(this)},eUe.Db=0,Y6(eZ2,"MinimalEObjectImpl",114),eTS(115,114,{105:1,92:1,90:1,56:1,108:1,49:1,97:1,114:1,115:1}),eUe.Fh=function(e){this.Cb=e},eUe.eh=function(){return this.Cb},Y6(eZ2,"MinimalEObjectImpl/Container",115),eTS(1985,115,{105:1,413:1,94:1,92:1,90:1,56:1,108:1,49:1,97:1,114:1,115:1}),eUe._g=function(e,t,n){return egp(this,e,t,n)},eUe.jh=function(e,t,n){return e_8(this,e,t,n)},eUe.lh=function(e){return Wz(this,e)},eUe.sh=function(e,t){esU(this,e,t)},eUe.zh=function(){return eBa(),tm_},eUe.Bh=function(e){eoF(this,e)},eUe.Ve=function(){return epD(this)},eUe.We=function(e){return eT9(this,e)},eUe.Xe=function(e){return X2(this,e)},eUe.Ye=function(e,t){return ebu(this,e,t)},Y6(eZ3,"EMapPropertyHolderImpl",1985),eTS(567,115,{105:1,469:1,92:1,90:1,56:1,108:1,49:1,97:1,114:1,115:1},oJ),eUe._g=function(e,t,n){switch(e){case 0:return this.a;case 1:return this.b}return ebl(this,e,t,n)},eUe.lh=function(e){switch(e){case 0:return 0!=this.a;case 1:return 0!=this.b}return epY(this,e)},eUe.sh=function(e,t){switch(e){case 0:ent(this,gP(LV(t)));return;case 1:enn(this,gP(LV(t)));return}eS6(this,e,t)},eUe.zh=function(){return eBa(),tmf},eUe.Bh=function(e){switch(e){case 0:ent(this,0);return;case 1:enn(this,0);return}eSi(this,e)},eUe.Ib=function(){var e;return(64&this.Db)!=0?eMT(this):(e=new O1(eMT(this)),e.a+=" (x: ",y$(e,this.a),e.a+=", y: ",y$(e,this.b),e.a+=")",e.a)},eUe.a=0,eUe.b=0,Y6(eZ3,"ElkBendPointImpl",567),eTS(723,1985,{105:1,413:1,160:1,94:1,92:1,90:1,56:1,108:1,49:1,97:1,114:1,115:1}),eUe._g=function(e,t,n){return ec2(this,e,t,n)},eUe.hh=function(e,t,n){return ew0(this,e,t,n)},eUe.jh=function(e,t,n){return ea8(this,e,t,n)},eUe.lh=function(e){return eaT(this,e)},eUe.sh=function(e,t){eyb(this,e,t)},eUe.zh=function(){return eBa(),tmb},eUe.Bh=function(e){ecx(this,e)},eUe.zg=function(){return this.k},eUe.Ag=function(){return UB(this)},eUe.Ib=function(){return el4(this)},eUe.k=null,Y6(eZ3,"ElkGraphElementImpl",723),eTS(724,723,{105:1,413:1,160:1,470:1,94:1,92:1,90:1,56:1,108:1,49:1,97:1,114:1,115:1}),eUe._g=function(e,t,n){return efN(this,e,t,n)},eUe.lh=function(e){return ef9(this,e)},eUe.sh=function(e,t){eym(this,e,t)},eUe.zh=function(){return eBa(),tmw},eUe.Bh=function(e){edS(this,e)},eUe.Bg=function(){return this.f},eUe.Cg=function(){return this.g},eUe.Dg=function(){return this.i},eUe.Eg=function(){return this.j},eUe.Fg=function(e,t){TN(this,e,t)},eUe.Gg=function(e,t){TP(this,e,t)},eUe.Hg=function(e){eno(this,e)},eUe.Ig=function(e){ens(this,e)},eUe.Ib=function(){return eEp(this)},eUe.f=0,eUe.g=0,eUe.i=0,eUe.j=0,Y6(eZ3,"ElkShapeImpl",724),eTS(725,724,{105:1,413:1,82:1,160:1,470:1,94:1,92:1,90:1,56:1,108:1,49:1,97:1,114:1,115:1}),eUe._g=function(e,t,n){return ebQ(this,e,t,n)},eUe.hh=function(e,t,n){return evZ(this,e,t,n)},eUe.jh=function(e,t,n){return evX(this,e,t,n)},eUe.lh=function(e){return esM(this,e)},eUe.sh=function(e,t){eTH(this,e,t)},eUe.zh=function(){return eBa(),tmd},eUe.Bh=function(e){ep2(this,e)},eUe.xg=function(){return this.d||(this.d=new Ih(e5g,this,8,5)),this.d},eUe.yg=function(){return this.e||(this.e=new Ih(e5g,this,7,4)),this.e},Y6(eZ3,"ElkConnectableShapeImpl",725),eTS(352,723,{105:1,413:1,79:1,160:1,352:1,94:1,92:1,90:1,56:1,108:1,49:1,97:1,114:1,115:1},oX),eUe.Qg=function(e){return evo(this,e)},eUe._g=function(e,t,n){switch(e){case 3:return zF(this);case 4:return this.b||(this.b=new Ih(e5m,this,4,7)),this.b;case 5:return this.c||(this.c=new Ih(e5m,this,5,8)),this.c;case 6:return this.a||(this.a=new FQ(e5v,this,6,6)),this.a;case 7:return OQ(),this.b||(this.b=new Ih(e5m,this,4,7)),!(this.b.i<=1)||(this.c||(this.c=new Ih(e5m,this,5,8)),!(this.c.i<=1));case 8:return OQ(),!!eTc(this);case 9:return OQ(),!!exb(this);case 10:return OQ(),this.b||(this.b=new Ih(e5m,this,4,7)),0!=this.b.i&&(this.c||(this.c=new Ih(e5m,this,5,8)),0!=this.c.i)}return ec2(this,e,t,n)},eUe.hh=function(e,t,n){var r;switch(t){case 3:return this.Cb&&(n=(r=this.Db>>16)>=0?evo(this,n):this.Cb.ih(this,-1-r,null,n)),Cu(this,Pp(e,33),n);case 4:return this.b||(this.b=new Ih(e5m,this,4,7)),edF(this.b,e,n);case 5:return this.c||(this.c=new Ih(e5m,this,5,8)),edF(this.c,e,n);case 6:return this.a||(this.a=new FQ(e5v,this,6,6)),edF(this.a,e,n)}return ew0(this,e,t,n)},eUe.jh=function(e,t,n){switch(t){case 3:return Cu(this,null,n);case 4:return this.b||(this.b=new Ih(e5m,this,4,7)),ep5(this.b,e,n);case 5:return this.c||(this.c=new Ih(e5m,this,5,8)),ep5(this.c,e,n);case 6:return this.a||(this.a=new FQ(e5v,this,6,6)),ep5(this.a,e,n)}return ea8(this,e,t,n)},eUe.lh=function(e){switch(e){case 3:return!!zF(this);case 4:return!!this.b&&0!=this.b.i;case 5:return!!this.c&&0!=this.c.i;case 6:return!!this.a&&0!=this.a.i;case 7:return this.b||(this.b=new Ih(e5m,this,4,7)),!(this.b.i<=1&&(this.c||(this.c=new Ih(e5m,this,5,8)),this.c.i<=1));case 8:return eTc(this);case 9:return exb(this);case 10:return this.b||(this.b=new Ih(e5m,this,4,7)),0!=this.b.i&&(this.c||(this.c=new Ih(e5m,this,5,8)),0!=this.c.i)}return eaT(this,e)},eUe.sh=function(e,t){switch(e){case 3:eOC(this,Pp(t,33));return;case 4:this.b||(this.b=new Ih(e5m,this,4,7)),eRT(this.b),this.b||(this.b=new Ih(e5m,this,4,7)),Y4(this.b,Pp(t,14));return;case 5:this.c||(this.c=new Ih(e5m,this,5,8)),eRT(this.c),this.c||(this.c=new Ih(e5m,this,5,8)),Y4(this.c,Pp(t,14));return;case 6:this.a||(this.a=new FQ(e5v,this,6,6)),eRT(this.a),this.a||(this.a=new FQ(e5v,this,6,6)),Y4(this.a,Pp(t,14));return}eyb(this,e,t)},eUe.zh=function(){return eBa(),tmh},eUe.Bh=function(e){switch(e){case 3:eOC(this,null);return;case 4:this.b||(this.b=new Ih(e5m,this,4,7)),eRT(this.b);return;case 5:this.c||(this.c=new Ih(e5m,this,5,8)),eRT(this.c);return;case 6:this.a||(this.a=new FQ(e5v,this,6,6)),eRT(this.a);return}ecx(this,e)},eUe.Ib=function(){return ePY(this)},Y6(eZ3,"ElkEdgeImpl",352),eTS(439,1985,{105:1,413:1,202:1,439:1,94:1,92:1,90:1,56:1,108:1,49:1,97:1,114:1,115:1},oQ),eUe.Qg=function(e){return eg1(this,e)},eUe._g=function(e,t,n){switch(e){case 1:return this.j;case 2:return this.k;case 3:return this.b;case 4:return this.c;case 5:return this.a||(this.a=new O_(e5h,this,5)),this.a;case 6:return zB(this);case 7:if(t)return ebF(this);return this.i;case 8:if(t)return ebj(this);return this.f;case 9:return this.g||(this.g=new Ih(e5v,this,9,10)),this.g;case 10:return this.e||(this.e=new Ih(e5v,this,10,9)),this.e;case 11:return this.d}return egp(this,e,t,n)},eUe.hh=function(e,t,n){var r,i,a;switch(t){case 6:return this.Cb&&(n=(i=this.Db>>16)>=0?eg1(this,n):this.Cb.ih(this,-1-i,null,n)),Cc(this,Pp(e,79),n);case 9:return this.g||(this.g=new Ih(e5v,this,9,10)),edF(this.g,e,n);case 10:return this.e||(this.e=new Ih(e5v,this,10,9)),edF(this.e,e,n)}return(a=Pp(ee2((r=Pp(eaS(this,16),26))||(eBa(),tmp),t),66)).Nj().Qj(this,ehH(this),t-Y1((eBa(),tmp)),e,n)},eUe.jh=function(e,t,n){switch(t){case 5:return this.a||(this.a=new O_(e5h,this,5)),ep5(this.a,e,n);case 6:return Cc(this,null,n);case 9:return this.g||(this.g=new Ih(e5v,this,9,10)),ep5(this.g,e,n);case 10:return this.e||(this.e=new Ih(e5v,this,10,9)),ep5(this.e,e,n)}return e_8(this,e,t,n)},eUe.lh=function(e){switch(e){case 1:return 0!=this.j;case 2:return 0!=this.k;case 3:return 0!=this.b;case 4:return 0!=this.c;case 5:return!!this.a&&0!=this.a.i;case 6:return!!zB(this);case 7:return!!this.i;case 8:return!!this.f;case 9:return!!this.g&&0!=this.g.i;case 10:return!!this.e&&0!=this.e.i;case 11:return null!=this.d}return Wz(this,e)},eUe.sh=function(e,t){switch(e){case 1:enu(this,gP(LV(t)));return;case 2:enl(this,gP(LV(t)));return;case 3:enr(this,gP(LV(t)));return;case 4:enc(this,gP(LV(t)));return;case 5:this.a||(this.a=new O_(e5h,this,5)),eRT(this.a),this.a||(this.a=new O_(e5h,this,5)),Y4(this.a,Pp(t,14));return;case 6:eOA(this,Pp(t,79));return;case 7:err(this,Pp(t,82));return;case 8:ern(this,Pp(t,82));return;case 9:this.g||(this.g=new Ih(e5v,this,9,10)),eRT(this.g),this.g||(this.g=new Ih(e5v,this,9,10)),Y4(this.g,Pp(t,14));return;case 10:this.e||(this.e=new Ih(e5v,this,10,9)),eRT(this.e),this.e||(this.e=new Ih(e5v,this,10,9)),Y4(this.e,Pp(t,14));return;case 11:erO(this,Lq(t));return}esU(this,e,t)},eUe.zh=function(){return eBa(),tmp},eUe.Bh=function(e){switch(e){case 1:enu(this,0);return;case 2:enl(this,0);return;case 3:enr(this,0);return;case 4:enc(this,0);return;case 5:this.a||(this.a=new O_(e5h,this,5)),eRT(this.a);return;case 6:eOA(this,null);return;case 7:err(this,null);return;case 8:ern(this,null);return;case 9:this.g||(this.g=new Ih(e5v,this,9,10)),eRT(this.g);return;case 10:this.e||(this.e=new Ih(e5v,this,10,9)),eRT(this.e);return;case 11:erO(this,null);return}eoF(this,e)},eUe.Ib=function(){return ex2(this)},eUe.b=0,eUe.c=0,eUe.d=null,eUe.j=0,eUe.k=0,Y6(eZ3,"ElkEdgeSectionImpl",439),eTS(150,115,{105:1,92:1,90:1,147:1,56:1,108:1,49:1,97:1,150:1,114:1,115:1}),eUe._g=function(e,t,n){var r;return 0==e?(this.Ab||(this.Ab=new FQ(tm4,this,0,3)),this.Ab):Qt(this,e-Y1(this.zh()),ee2((r=Pp(eaS(this,16),26))||this.zh(),e),t,n)},eUe.hh=function(e,t,n){var r,i;return 0==t?(this.Ab||(this.Ab=new FQ(tm4,this,0,3)),edF(this.Ab,e,n)):(i=Pp(ee2((r=Pp(eaS(this,16),26))||this.zh(),t),66)).Nj().Qj(this,ehH(this),t-Y1(this.zh()),e,n)},eUe.jh=function(e,t,n){var r,i;return 0==t?(this.Ab||(this.Ab=new FQ(tm4,this,0,3)),ep5(this.Ab,e,n)):(i=Pp(ee2((r=Pp(eaS(this,16),26))||this.zh(),t),66)).Nj().Rj(this,ehH(this),t-Y1(this.zh()),e,n)},eUe.lh=function(e){var t;return 0==e?!!this.Ab&&0!=this.Ab.i:VP(this,e-Y1(this.zh()),ee2((t=Pp(eaS(this,16),26))||this.zh(),e))},eUe.oh=function(e){return eF8(this,e)},eUe.sh=function(e,t){var n;if(0===e){this.Ab||(this.Ab=new FQ(tm4,this,0,3)),eRT(this.Ab),this.Ab||(this.Ab=new FQ(tm4,this,0,3)),Y4(this.Ab,Pp(t,14));return}efL(this,e-Y1(this.zh()),ee2((n=Pp(eaS(this,16),26))||this.zh(),e),t)},eUe.uh=function(e){ehU(this,128,e)},eUe.zh=function(){return eBK(),tgL},eUe.Bh=function(e){var t;if(0===e){this.Ab||(this.Ab=new FQ(tm4,this,0,3)),eRT(this.Ab);return}ec5(this,e-Y1(this.zh()),ee2((t=Pp(eaS(this,16),26))||this.zh(),e))},eUe.Gh=function(){this.Bb|=1},eUe.Hh=function(e){return eDM(this,e)},eUe.Bb=0,Y6(eZ2,"EModelElementImpl",150),eTS(704,150,{105:1,92:1,90:1,471:1,147:1,56:1,108:1,49:1,97:1,150:1,114:1,115:1},cQ),eUe.Ih=function(e,t){return ejZ(this,e,t)},eUe.Jh=function(e){var t,n,r,i,a;if(this.a!=etP(e)||(256&e.Bb)!=0)throw p7(new gL(eZ7+e.zb+eZ5));for(r=$E(e);0!=qt(r.a).i;){if(n=Pp(ejc(r,0,(a=(t=Pp(etj(qt(r.a),0),87)).c,M4(a,88)?Pp(a,26):(eBK(),tgI))),26),em4(n))return i=etP(n).Nh().Jh(n),Pp(i,49).th(e),i;r=$E(n)}return(null!=e.D?e.D:e.B)=="java.util.Map$Entry"?new RO(e):new Pq(e)},eUe.Kh=function(e,t){return eBd(this,e,t)},eUe._g=function(e,t,n){var r;switch(e){case 0:return this.Ab||(this.Ab=new FQ(tm4,this,0,3)),this.Ab;case 1:return this.a}return Qt(this,e-Y1((eBK(),tgM)),ee2((r=Pp(eaS(this,16),26))||tgM,e),t,n)},eUe.hh=function(e,t,n){var r,i;switch(t){case 0:return this.Ab||(this.Ab=new FQ(tm4,this,0,3)),edF(this.Ab,e,n);case 1:return this.a&&(n=Pp(this.a,49).ih(this,4,e5E,n)),ecb(this,Pp(e,235),n)}return(i=Pp(ee2((r=Pp(eaS(this,16),26))||(eBK(),tgM),t),66)).Nj().Qj(this,ehH(this),t-Y1((eBK(),tgM)),e,n)},eUe.jh=function(e,t,n){var r,i;switch(t){case 0:return this.Ab||(this.Ab=new FQ(tm4,this,0,3)),ep5(this.Ab,e,n);case 1:return ecb(this,null,n)}return(i=Pp(ee2((r=Pp(eaS(this,16),26))||(eBK(),tgM),t),66)).Nj().Rj(this,ehH(this),t-Y1((eBK(),tgM)),e,n)},eUe.lh=function(e){var t;switch(e){case 0:return!!this.Ab&&0!=this.Ab.i;case 1:return!!this.a}return VP(this,e-Y1((eBK(),tgM)),ee2((t=Pp(eaS(this,16),26))||tgM,e))},eUe.sh=function(e,t){var n;switch(e){case 0:this.Ab||(this.Ab=new FQ(tm4,this,0,3)),eRT(this.Ab),this.Ab||(this.Ab=new FQ(tm4,this,0,3)),Y4(this.Ab,Pp(t,14));return;case 1:e_B(this,Pp(t,235));return}efL(this,e-Y1((eBK(),tgM)),ee2((n=Pp(eaS(this,16),26))||tgM,e),t)},eUe.zh=function(){return eBK(),tgM},eUe.Bh=function(e){var t;switch(e){case 0:this.Ab||(this.Ab=new FQ(tm4,this,0,3)),eRT(this.Ab);return;case 1:e_B(this,null);return}ec5(this,e-Y1((eBK(),tgM)),ee2((t=Pp(eaS(this,16),26))||tgM,e))},Y6(eZ2,"EFactoryImpl",704),eTS(eXt,704,{105:1,2014:1,92:1,90:1,471:1,147:1,56:1,108:1,49:1,97:1,150:1,114:1,115:1},o1),eUe.Ih=function(e,t){switch(e.yj()){case 12:return Pp(t,146).tg();case 13:return efF(t);default:throw p7(new gL(eZ6+e.ne()+eZ5))}},eUe.Jh=function(e){var t;switch(-1==e.G&&(e.G=(t=etP(e))?ebv(t.Mh(),e):-1),e.G){case 4:return new o0;case 6:return new mS;case 7:return new mk;case 8:return new oX;case 9:return new oJ;case 10:return new oQ;case 11:return new o3;default:throw p7(new gL(eZ7+e.zb+eZ5))}},eUe.Kh=function(e,t){switch(e.yj()){case 13:case 12:return null;default:throw p7(new gL(eZ6+e.ne()+eZ5))}},Y6(eZ3,"ElkGraphFactoryImpl",eXt),eTS(438,150,{105:1,92:1,90:1,147:1,191:1,56:1,108:1,49:1,97:1,150:1,114:1,115:1}),eUe.Wg=function(){var e,t;return null==(t=zr(eNT((e=Pp(eaS(this,16),26))||this.zh())))?(_0(),_0(),tgV):new Lg(this,t)},eUe._g=function(e,t,n){var r;switch(e){case 0:return this.Ab||(this.Ab=new FQ(tm4,this,0,3)),this.Ab;case 1:return this.ne()}return Qt(this,e-Y1(this.zh()),ee2((r=Pp(eaS(this,16),26))||this.zh(),e),t,n)},eUe.lh=function(e){var t;switch(e){case 0:return!!this.Ab&&0!=this.Ab.i;case 1:return null!=this.zb}return VP(this,e-Y1(this.zh()),ee2((t=Pp(eaS(this,16),26))||this.zh(),e))},eUe.sh=function(e,t){var n;switch(e){case 0:this.Ab||(this.Ab=new FQ(tm4,this,0,3)),eRT(this.Ab),this.Ab||(this.Ab=new FQ(tm4,this,0,3)),Y4(this.Ab,Pp(t,14));return;case 1:this.Lh(Lq(t));return}efL(this,e-Y1(this.zh()),ee2((n=Pp(eaS(this,16),26))||this.zh(),e),t)},eUe.zh=function(){return eBK(),tgC},eUe.Bh=function(e){var t;switch(e){case 0:this.Ab||(this.Ab=new FQ(tm4,this,0,3)),eRT(this.Ab);return;case 1:this.Lh(null);return}ec5(this,e-Y1(this.zh()),ee2((t=Pp(eaS(this,16),26))||this.zh(),e))},eUe.ne=function(){return this.zb},eUe.Lh=function(e){er3(this,e)},eUe.Ib=function(){return ecF(this)},eUe.zb=null,Y6(eZ2,"ENamedElementImpl",438),eTS(179,438,{105:1,92:1,90:1,147:1,191:1,56:1,235:1,108:1,49:1,97:1,150:1,179:1,114:1,115:1,675:1},$y),eUe.Qg=function(e){return eg6(this,e)},eUe._g=function(e,t,n){var r;switch(e){case 0:return this.Ab||(this.Ab=new FQ(tm4,this,0,3)),this.Ab;case 1:return this.zb;case 2:return this.yb;case 3:return this.xb;case 4:return this.sb;case 5:return this.rb||(this.rb=new Fq(this,tm9,this)),this.rb;case 6:return this.vb||(this.vb=new Ia(e5E,this,6,7)),this.vb;case 7:if(t)return this.Db>>16==7?Pp(this.Cb,235):null;return zU(this)}return Qt(this,e-Y1((eBK(),tgP)),ee2((r=Pp(eaS(this,16),26))||tgP,e),t,n)},eUe.hh=function(e,t,n){var r,i,a;switch(t){case 0:return this.Ab||(this.Ab=new FQ(tm4,this,0,3)),edF(this.Ab,e,n);case 4:return this.sb&&(n=Pp(this.sb,49).ih(this,1,e5w,n)),ecY(this,Pp(e,471),n);case 5:return this.rb||(this.rb=new Fq(this,tm9,this)),edF(this.rb,e,n);case 6:return this.vb||(this.vb=new Ia(e5E,this,6,7)),edF(this.vb,e,n);case 7:return this.Cb&&(n=(i=this.Db>>16)>=0?eg6(this,n):this.Cb.ih(this,-1-i,null,n)),eDg(this,e,7,n)}return(a=Pp(ee2((r=Pp(eaS(this,16),26))||(eBK(),tgP),t),66)).Nj().Qj(this,ehH(this),t-Y1((eBK(),tgP)),e,n)},eUe.jh=function(e,t,n){var r,i;switch(t){case 0:return this.Ab||(this.Ab=new FQ(tm4,this,0,3)),ep5(this.Ab,e,n);case 4:return ecY(this,null,n);case 5:return this.rb||(this.rb=new Fq(this,tm9,this)),ep5(this.rb,e,n);case 6:return this.vb||(this.vb=new Ia(e5E,this,6,7)),ep5(this.vb,e,n);case 7:return eDg(this,null,7,n)}return(i=Pp(ee2((r=Pp(eaS(this,16),26))||(eBK(),tgP),t),66)).Nj().Rj(this,ehH(this),t-Y1((eBK(),tgP)),e,n)},eUe.lh=function(e){var t;switch(e){case 0:return!!this.Ab&&0!=this.Ab.i;case 1:return null!=this.zb;case 2:return null!=this.yb;case 3:return null!=this.xb;case 4:return!!this.sb;case 5:return!!this.rb&&0!=this.rb.i;case 6:return!!this.vb&&0!=this.vb.i;case 7:return!!zU(this)}return VP(this,e-Y1((eBK(),tgP)),ee2((t=Pp(eaS(this,16),26))||tgP,e))},eUe.oh=function(e){var t;return(t=eAd(this,e))||eF8(this,e)},eUe.sh=function(e,t){var n;switch(e){case 0:this.Ab||(this.Ab=new FQ(tm4,this,0,3)),eRT(this.Ab),this.Ab||(this.Ab=new FQ(tm4,this,0,3)),Y4(this.Ab,Pp(t,14));return;case 1:er3(this,Lq(t));return;case 2:er6(this,Lq(t));return;case 3:er4(this,Lq(t));return;case 4:e_9(this,Pp(t,471));return;case 5:this.rb||(this.rb=new Fq(this,tm9,this)),eRT(this.rb),this.rb||(this.rb=new Fq(this,tm9,this)),Y4(this.rb,Pp(t,14));return;case 6:this.vb||(this.vb=new Ia(e5E,this,6,7)),eRT(this.vb),this.vb||(this.vb=new Ia(e5E,this,6,7)),Y4(this.vb,Pp(t,14));return}efL(this,e-Y1((eBK(),tgP)),ee2((n=Pp(eaS(this,16),26))||tgP,e),t)},eUe.vh=function(e){var t,n;if(e&&this.rb)for(n=new Ow(this.rb);n.e!=n.i.gc();)t=epH(n),M4(t,351)&&(Pp(t,351).w=null);ehU(this,64,e)},eUe.zh=function(){return eBK(),tgP},eUe.Bh=function(e){var t;switch(e){case 0:this.Ab||(this.Ab=new FQ(tm4,this,0,3)),eRT(this.Ab);return;case 1:er3(this,null);return;case 2:er6(this,null);return;case 3:er4(this,null);return;case 4:e_9(this,null);return;case 5:this.rb||(this.rb=new Fq(this,tm9,this)),eRT(this.rb);return;case 6:this.vb||(this.vb=new Ia(e5E,this,6,7)),eRT(this.vb);return}ec5(this,e-Y1((eBK(),tgP)),ee2((t=Pp(eaS(this,16),26))||tgP,e))},eUe.Gh=function(){egb(this)},eUe.Mh=function(){return this.rb||(this.rb=new Fq(this,tm9,this)),this.rb},eUe.Nh=function(){return this.sb},eUe.Oh=function(){return this.ub},eUe.Ph=function(){return this.xb},eUe.Qh=function(){return this.yb},eUe.Rh=function(e){this.ub=e},eUe.Ib=function(){var e;return(64&this.Db)!=0?ecF(this):(e=new O1(ecF(this)),e.a+=" (nsURI: ",xk(e,this.yb),e.a+=", nsPrefix: ",xk(e,this.xb),e.a+=")",e.a)},eUe.xb=null,eUe.yb=null,Y6(eZ2,"EPackageImpl",179),eTS(555,179,{105:1,2016:1,555:1,92:1,90:1,147:1,191:1,56:1,235:1,108:1,49:1,97:1,150:1,179:1,114:1,115:1,675:1},eTv),eUe.q=!1,eUe.r=!1;var e5T=!1;Y6(eZ3,"ElkGraphPackageImpl",555),eTS(354,724,{105:1,413:1,160:1,137:1,470:1,354:1,94:1,92:1,90:1,56:1,108:1,49:1,97:1,114:1,115:1},o0),eUe.Qg=function(e){return eg0(this,e)},eUe._g=function(e,t,n){switch(e){case 7:return zH(this);case 8:return this.a}return efN(this,e,t,n)},eUe.hh=function(e,t,n){var r;return 7===t?(this.Cb&&(n=(r=this.Db>>16)>=0?eg0(this,n):this.Cb.ih(this,-1-r,null,n)),j2(this,Pp(e,160),n)):ew0(this,e,t,n)},eUe.jh=function(e,t,n){return 7==t?j2(this,null,n):ea8(this,e,t,n)},eUe.lh=function(e){switch(e){case 7:return!!zH(this);case 8:return!IE("",this.a)}return ef9(this,e)},eUe.sh=function(e,t){switch(e){case 7:eAu(this,Pp(t,160));return;case 8:eri(this,Lq(t));return}eym(this,e,t)},eUe.zh=function(){return eBa(),tmm},eUe.Bh=function(e){switch(e){case 7:eAu(this,null);return;case 8:eri(this,"");return}edS(this,e)},eUe.Ib=function(){return eE1(this)},eUe.a="",Y6(eZ3,"ElkLabelImpl",354),eTS(239,725,{105:1,413:1,82:1,160:1,33:1,470:1,239:1,94:1,92:1,90:1,56:1,108:1,49:1,97:1,114:1,115:1},mS),eUe.Qg=function(e){return evs(this,e)},eUe._g=function(e,t,n){switch(e){case 9:return this.c||(this.c=new FQ(e5x,this,9,9)),this.c;case 10:return this.a||(this.a=new FQ(e5k,this,10,11)),this.a;case 11:return z$(this);case 12:return this.b||(this.b=new FQ(e5g,this,12,3)),this.b;case 13:return OQ(),this.a||(this.a=new FQ(e5k,this,10,11)),this.a.i>0}return ebQ(this,e,t,n)},eUe.hh=function(e,t,n){var r;switch(t){case 9:return this.c||(this.c=new FQ(e5x,this,9,9)),edF(this.c,e,n);case 10:return this.a||(this.a=new FQ(e5k,this,10,11)),edF(this.a,e,n);case 11:return this.Cb&&(n=(r=this.Db>>16)>=0?evs(this,n):this.Cb.ih(this,-1-r,null,n)),C4(this,Pp(e,33),n);case 12:return this.b||(this.b=new FQ(e5g,this,12,3)),edF(this.b,e,n)}return evZ(this,e,t,n)},eUe.jh=function(e,t,n){switch(t){case 9:return this.c||(this.c=new FQ(e5x,this,9,9)),ep5(this.c,e,n);case 10:return this.a||(this.a=new FQ(e5k,this,10,11)),ep5(this.a,e,n);case 11:return C4(this,null,n);case 12:return this.b||(this.b=new FQ(e5g,this,12,3)),ep5(this.b,e,n)}return evX(this,e,t,n)},eUe.lh=function(e){switch(e){case 9:return!!this.c&&0!=this.c.i;case 10:return!!this.a&&0!=this.a.i;case 11:return!!z$(this);case 12:return!!this.b&&0!=this.b.i;case 13:return this.a||(this.a=new FQ(e5k,this,10,11)),this.a.i>0}return esM(this,e)},eUe.sh=function(e,t){switch(e){case 9:this.c||(this.c=new FQ(e5x,this,9,9)),eRT(this.c),this.c||(this.c=new FQ(e5x,this,9,9)),Y4(this.c,Pp(t,14));return;case 10:this.a||(this.a=new FQ(e5k,this,10,11)),eRT(this.a),this.a||(this.a=new FQ(e5k,this,10,11)),Y4(this.a,Pp(t,14));return;case 11:eO$(this,Pp(t,33));return;case 12:this.b||(this.b=new FQ(e5g,this,12,3)),eRT(this.b),this.b||(this.b=new FQ(e5g,this,12,3)),Y4(this.b,Pp(t,14));return}eTH(this,e,t)},eUe.zh=function(){return eBa(),tmg},eUe.Bh=function(e){switch(e){case 9:this.c||(this.c=new FQ(e5x,this,9,9)),eRT(this.c);return;case 10:this.a||(this.a=new FQ(e5k,this,10,11)),eRT(this.a);return;case 11:eO$(this,null);return;case 12:this.b||(this.b=new FQ(e5g,this,12,3)),eRT(this.b);return}ep2(this,e)},eUe.Ib=function(){return eC4(this)},Y6(eZ3,"ElkNodeImpl",239),eTS(186,725,{105:1,413:1,82:1,160:1,118:1,470:1,186:1,94:1,92:1,90:1,56:1,108:1,49:1,97:1,114:1,115:1},mk),eUe.Qg=function(e){return eg2(this,e)},eUe._g=function(e,t,n){return 9==e?zY(this):ebQ(this,e,t,n)},eUe.hh=function(e,t,n){var r;return 9===t?(this.Cb&&(n=(r=this.Db>>16)>=0?eg2(this,n):this.Cb.ih(this,-1-r,null,n)),Cl(this,Pp(e,33),n)):evZ(this,e,t,n)},eUe.jh=function(e,t,n){return 9==t?Cl(this,null,n):evX(this,e,t,n)},eUe.lh=function(e){return 9==e?!!zY(this):esM(this,e)},eUe.sh=function(e,t){if(9===e){eOL(this,Pp(t,33));return}eTH(this,e,t)},eUe.zh=function(){return eBa(),tmv},eUe.Bh=function(e){if(9===e){eOL(this,null);return}ep2(this,e)},eUe.Ib=function(){return eC6(this)},Y6(eZ3,"ElkPortImpl",186);var e5M=RL(eX_,"BasicEMap/Entry");eTS(1092,115,{105:1,42:1,92:1,90:1,133:1,56:1,108:1,49:1,97:1,114:1,115:1},o3),eUe.Fb=function(e){return this===e},eUe.cd=function(){return this.b},eUe.Hb=function(){return Ao(this)},eUe.Uh=function(e){era(this,Pp(e,146))},eUe._g=function(e,t,n){switch(e){case 0:return this.b;case 1:return this.c}return ebl(this,e,t,n)},eUe.lh=function(e){switch(e){case 0:return!!this.b;case 1:return null!=this.c}return epY(this,e)},eUe.sh=function(e,t){switch(e){case 0:era(this,Pp(t,146));return;case 1:eru(this,t);return}eS6(this,e,t)},eUe.zh=function(){return eBa(),tmy},eUe.Bh=function(e){switch(e){case 0:era(this,null);return;case 1:eru(this,null);return}eSi(this,e)},eUe.Sh=function(){var e;return -1==this.a&&(e=this.b,this.a=e?esj(e):0),this.a},eUe.dd=function(){return this.c},eUe.Th=function(e){this.a=e},eUe.ed=function(e){var t;return t=this.c,eru(this,e),t},eUe.Ib=function(){var e;return(64&this.Db)!=0?eMT(this):(xM(xM(xM(e=new vc,this.b?this.b.tg():eUg),eGH),Ae(this.c)),e.a)},eUe.a=-1,eUe.c=null;var e5O=Y6(eZ3,"ElkPropertyToValueMapEntryImpl",1092);eTS(984,1,{},o5),Y6(eXk,"JsonAdapter",984),eTS(210,60,eHr,gK),Y6(eXk,"JsonImportException",210),eTS(857,1,{},eg5),Y6(eXk,"JsonImporter",857),eTS(891,1,{},kP),Y6(eXk,"JsonImporter/lambda$0$Type",891),eTS(892,1,{},kR),Y6(eXk,"JsonImporter/lambda$1$Type",892),eTS(900,1,{},h7),Y6(eXk,"JsonImporter/lambda$10$Type",900),eTS(902,1,{},kj),Y6(eXk,"JsonImporter/lambda$11$Type",902),eTS(903,1,{},kF),Y6(eXk,"JsonImporter/lambda$12$Type",903),eTS(909,1,{},HE),Y6(eXk,"JsonImporter/lambda$13$Type",909),eTS(908,1,{},H_),Y6(eXk,"JsonImporter/lambda$14$Type",908),eTS(904,1,{},kY),Y6(eXk,"JsonImporter/lambda$15$Type",904),eTS(905,1,{},kB),Y6(eXk,"JsonImporter/lambda$16$Type",905),eTS(906,1,{},kU),Y6(eXk,"JsonImporter/lambda$17$Type",906),eTS(907,1,{},kH),Y6(eXk,"JsonImporter/lambda$18$Type",907),eTS(912,1,{},pe),Y6(eXk,"JsonImporter/lambda$19$Type",912),eTS(893,1,{},pt),Y6(eXk,"JsonImporter/lambda$2$Type",893),eTS(910,1,{},pn),Y6(eXk,"JsonImporter/lambda$20$Type",910),eTS(911,1,{},pr),Y6(eXk,"JsonImporter/lambda$21$Type",911),eTS(915,1,{},pi),Y6(eXk,"JsonImporter/lambda$22$Type",915),eTS(913,1,{},pa),Y6(eXk,"JsonImporter/lambda$23$Type",913),eTS(914,1,{},po),Y6(eXk,"JsonImporter/lambda$24$Type",914),eTS(917,1,{},ps),Y6(eXk,"JsonImporter/lambda$25$Type",917),eTS(916,1,{},pu),Y6(eXk,"JsonImporter/lambda$26$Type",916),eTS(918,1,eUF,k$),eUe.td=function(e){JH(this.b,this.a,Lq(e))},Y6(eXk,"JsonImporter/lambda$27$Type",918),eTS(919,1,eUF,kz),eUe.td=function(e){J$(this.b,this.a,Lq(e))},Y6(eXk,"JsonImporter/lambda$28$Type",919),eTS(920,1,{},kG),Y6(eXk,"JsonImporter/lambda$29$Type",920),eTS(896,1,{},pc),Y6(eXk,"JsonImporter/lambda$3$Type",896),eTS(921,1,{},kW),Y6(eXk,"JsonImporter/lambda$30$Type",921),eTS(922,1,{},pl),Y6(eXk,"JsonImporter/lambda$31$Type",922),eTS(923,1,{},pf),Y6(eXk,"JsonImporter/lambda$32$Type",923),eTS(924,1,{},pd),Y6(eXk,"JsonImporter/lambda$33$Type",924),eTS(925,1,{},ph),Y6(eXk,"JsonImporter/lambda$34$Type",925),eTS(859,1,{},pp),Y6(eXk,"JsonImporter/lambda$35$Type",859),eTS(929,1,{},N9),Y6(eXk,"JsonImporter/lambda$36$Type",929),eTS(926,1,eUF,pb),eUe.td=function(e){qW(this.a,Pp(e,469))},Y6(eXk,"JsonImporter/lambda$37$Type",926),eTS(927,1,eUF,k0),eUe.td=function(e){xC(this.a,this.b,Pp(e,202))},Y6(eXk,"JsonImporter/lambda$38$Type",927),eTS(928,1,eUF,k2),eUe.td=function(e){xI(this.a,this.b,Pp(e,202))},Y6(eXk,"JsonImporter/lambda$39$Type",928),eTS(894,1,{},pm),Y6(eXk,"JsonImporter/lambda$4$Type",894),eTS(930,1,eUF,pg),eUe.td=function(e){qK(this.a,Pp(e,8))},Y6(eXk,"JsonImporter/lambda$40$Type",930),eTS(895,1,{},pv),Y6(eXk,"JsonImporter/lambda$5$Type",895),eTS(899,1,{},py),Y6(eXk,"JsonImporter/lambda$6$Type",899),eTS(897,1,{},pw),Y6(eXk,"JsonImporter/lambda$7$Type",897),eTS(898,1,{},p_),Y6(eXk,"JsonImporter/lambda$8$Type",898),eTS(901,1,{},pE),Y6(eXk,"JsonImporter/lambda$9$Type",901),eTS(948,1,eUF,pS),eUe.td=function(e){BC(this.a,new B_(Lq(e)))},Y6(eXk,"JsonMetaDataConverter/lambda$0$Type",948),eTS(949,1,eUF,pk),eUe.td=function(e){Bm(this.a,Pp(e,237))},Y6(eXk,"JsonMetaDataConverter/lambda$1$Type",949),eTS(950,1,eUF,px),eUe.td=function(e){GR(this.a,Pp(e,149))},Y6(eXk,"JsonMetaDataConverter/lambda$2$Type",950),eTS(951,1,eUF,pT),eUe.td=function(e){Bg(this.a,Pp(e,175))},Y6(eXk,"JsonMetaDataConverter/lambda$3$Type",951),eTS(237,22,{3:1,35:1,22:1,237:1},k1);var e5A=enw(ezx,"GraphFeature",237,e1G,etM,N1);eTS(13,1,{35:1,146:1},pO,Cm,xX,T2),eUe.wd=function(e){return Oo(this,Pp(e,146))},eUe.Fb=function(e){return $k(this,e)},eUe.wg=function(){return epB(this)},eUe.tg=function(){return this.b},eUe.Hb=function(){return ebA(this.b)},eUe.Ib=function(){return this.b},Y6(ezx,"Property",13),eTS(818,1,e$C,pM),eUe.ue=function(e,t){return elW(this,Pp(e,94),Pp(t,94))},eUe.Fb=function(e){return this===e},eUe.ve=function(){return new fZ(this)},Y6(ezx,"PropertyHolderComparator",818),eTS(695,1,eUE,pL),eUe.Nb=function(e){F9(this,e)},eUe.Pb=function(){return JZ(this)},eUe.Qb=function(){yI()},eUe.Ob=function(){return!!this.a},Y6(eXY,"ElkGraphUtil/AncestorIterator",695);var e5L=RL(eX_,"EList");eTS(67,52,{20:1,28:1,52:1,14:1,15:1,67:1,58:1}),eUe.Vc=function(e,t){elm(this,e,t)},eUe.Fc=function(e){return JL(this,e)},eUe.Wc=function(e,t){return eo0(this,e,t)},eUe.Gc=function(e){return Y4(this,e)},eUe.Zh=function(){return new AY(this)},eUe.$h=function(){return new AB(this)},eUe._h=function(e){return enH(this,e)},eUe.ai=function(){return!0},eUe.bi=function(e,t){},eUe.ci=function(){},eUe.di=function(e,t){X9(this,e,t)},eUe.ei=function(e,t,n){},eUe.fi=function(e,t){},eUe.gi=function(e,t,n){},eUe.Fb=function(e){return eCc(this,e)},eUe.Hb=function(){return eov(this)},eUe.hi=function(){return!1},eUe.Kc=function(){return new Ow(this)},eUe.Yc=function(){return new AF(this)},eUe.Zc=function(e){var t;if(t=this.gc(),e<0||e>t)throw p7(new Ii(e,t));return new YC(this,e)},eUe.ji=function(e,t){this.ii(e,this.Xc(t))},eUe.Mc=function(e){return eeu(this,e)},eUe.li=function(e,t){return t},eUe._c=function(e,t){return eby(this,e,t)},eUe.Ib=function(){return efq(this)},eUe.ni=function(){return!0},eUe.oi=function(e,t){return euu(this,t)},Y6(eX_,"AbstractEList",67),eTS(63,67,eXz,o7,eta,eiP),eUe.Vh=function(e,t){return ew2(this,e,t)},eUe.Wh=function(e){return emp(this,e)},eUe.Xh=function(e,t){ecW(this,e,t)},eUe.Yh=function(e){Zz(this,e)},eUe.pi=function(e){return J6(this,e)},eUe.$b=function(){ZG(this)},eUe.Hc=function(e){return ev8(this,e)},eUe.Xb=function(e){return etj(this,e)},eUe.qi=function(e){var t,n,r;++this.j,e>(n=null==this.g?0:this.g.length)&&(r=this.g,(t=n+(n/2|0)+4)=0&&(this.$c(t),!0)},eUe.mi=function(e,t){return this.Ui(e,this.oi(e,t))},eUe.gc=function(){return this.Vi()},eUe.Pc=function(){return this.Wi()},eUe.Qc=function(e){return this.Xi(e)},eUe.Ib=function(){return this.Yi()},Y6(eX_,"DelegatingEList",1995),eTS(1996,1995,eJk),eUe.Vh=function(e,t){return eD1(this,e,t)},eUe.Wh=function(e){return this.Vh(this.Vi(),e)},eUe.Xh=function(e,t){eTf(this,e,t)},eUe.Yh=function(e){exq(this,e)},eUe.ai=function(){return!this.bj()},eUe.$b=function(){eRP(this)},eUe.Zi=function(e,t,n,r,i){return new $P(this,e,t,n,r,i)},eUe.$i=function(e){eam(this.Ai(),e)},eUe._i=function(){return null},eUe.aj=function(){return -1},eUe.Ai=function(){return null},eUe.bj=function(){return!1},eUe.cj=function(e,t){return t},eUe.dj=function(e,t){return t},eUe.ej=function(){return!1},eUe.fj=function(){return!this.Ri()},eUe.ii=function(e,t){var n,r;return this.ej()?(r=this.fj(),n=e_R(this,e,t),this.$i(this.Zi(7,ell(t),n,e,r)),n):e_R(this,e,t)},eUe.$c=function(e){var t,n,r,i;return this.ej()?(n=null,r=this.fj(),t=this.Zi(4,i=RC(this,e),null,e,r),this.bj()&&i?(n=this.dj(i,n))?(n.Ei(t),n.Fi()):this.$i(t):n?(n.Ei(t),n.Fi()):this.$i(t),i):(i=RC(this,e),this.bj()&&i&&(n=this.dj(i,null))&&n.Fi(),i)},eUe.mi=function(e,t){return eD0(this,e,t)},Y6(eZK,"DelegatingNotifyingListImpl",1996),eTS(143,1,eJx),eUe.Ei=function(e){return ey7(this,e)},eUe.Fi=function(){QU(this)},eUe.xi=function(){return this.d},eUe._i=function(){return null},eUe.gj=function(){return null},eUe.yi=function(e){return -1},eUe.zi=function(){return eLo(this)},eUe.Ai=function(){return null},eUe.Bi=function(){return eLs(this)},eUe.Ci=function(){return this.o<0?this.o<-2?-2-this.o-1:-1:this.o},eUe.hj=function(){return!1},eUe.Di=function(e){var t,n,r,i,a,o,s,u,c,l,f;switch(this.d){case 1:case 2:switch(i=e.xi()){case 1:case 2:if(xc(a=e.Ai())===xc(this.Ai())&&this.yi(null)==e.yi(null))return this.g=e.zi(),1==e.xi()&&(this.d=1),!0}case 4:if(4===(i=e.xi())&&xc(a=e.Ai())===xc(this.Ai())&&this.yi(null)==e.yi(null))return c=eju(this),u=this.o<0?this.o<-2?-2-this.o-1:-1:this.o,o=e.Ci(),this.d=6,f=new eta(2),u<=o?(JL(f,this.n),JL(f,e.Bi()),this.g=eow(vx(ty_,1),eHT,25,15,[this.o=u,o+1])):(JL(f,e.Bi()),JL(f,this.n),this.g=eow(vx(ty_,1),eHT,25,15,[this.o=o,u])),this.n=f,c||(this.o=-2-this.o-1),!0;break;case 6:if(4===(i=e.xi())&&xc(a=e.Ai())===xc(this.Ai())&&this.yi(null)==e.yi(null)){for(c=eju(this),o=e.Ci(),r=Je(ty_,eHT,25,(l=Pp(this.g,48)).length+1,15,1),t=0;t>>0).toString(16)),r.a+=" (eventType: ",this.d){case 1:r.a+="SET";break;case 2:r.a+="UNSET";break;case 3:r.a+="ADD";break;case 5:r.a+="ADD_MANY";break;case 4:r.a+="REMOVE";break;case 6:r.a+="REMOVE_MANY";break;case 7:r.a+="MOVE";break;case 8:r.a+="REMOVING_ADAPTER";break;case 9:r.a+="RESOLVE";break;default:yz(r,this.d)}if(eIb(this)&&(r.a+=", touch: true"),r.a+=", position: ",yz(r,this.o<0?this.o<-2?-2-this.o-1:-1:this.o),r.a+=", notifier: ",xS(r,this.Ai()),r.a+=", feature: ",xS(r,this._i()),r.a+=", oldValue: ",xS(r,eLs(this)),r.a+=", newValue: ",6==this.d&&M4(this.g,48)){for(n=Pp(this.g,48),r.a+="[",e=0;e10?(this.b&&this.c.j==this.a||(this.b=new Rq(this),this.a=this.j),w0(this.b,e)):ev8(this,e)},eUe.ni=function(){return!0},eUe.a=0,Y6(eX_,"AbstractEList/1",953),eTS(295,73,eHZ,Ii),Y6(eX_,"AbstractEList/BasicIndexOutOfBoundsException",295),eTS(40,1,eUE,Ow),eUe.Nb=function(e){F9(this,e)},eUe.mj=function(){if(this.i.j!=this.f)throw p7(new bA)},eUe.nj=function(){return epH(this)},eUe.Ob=function(){return this.e!=this.i.gc()},eUe.Pb=function(){return this.nj()},eUe.Qb=function(){ey_(this)},eUe.e=0,eUe.f=0,eUe.g=-1,Y6(eX_,"AbstractEList/EIterator",40),eTS(278,40,eUC,AF,YC),eUe.Qb=function(){ey_(this)},eUe.Rb=function(e){edq(this,e)},eUe.oj=function(){var e;try{return e=this.d.Xb(--this.e),this.mj(),this.g=this.e,e}catch(t){if(t=eoa(t),M4(t,73))throw this.mj(),p7(new bC);throw p7(t)}},eUe.pj=function(e){emE(this,e)},eUe.Sb=function(){return 0!=this.e},eUe.Tb=function(){return this.e},eUe.Ub=function(){return this.oj()},eUe.Vb=function(){return this.e-1},eUe.Wb=function(e){this.pj(e)},Y6(eX_,"AbstractEList/EListIterator",278),eTS(341,40,eUE,AY),eUe.nj=function(){return ep$(this)},eUe.Qb=function(){throw p7(new bO)},Y6(eX_,"AbstractEList/NonResolvingEIterator",341),eTS(385,278,eUC,AB,IB),eUe.Rb=function(e){throw p7(new bO)},eUe.nj=function(){var e;try{return e=this.c.ki(this.e),this.mj(),this.g=this.e++,e}catch(t){if(t=eoa(t),M4(t,73))throw this.mj(),p7(new bC);throw p7(t)}},eUe.oj=function(){var e;try{return e=this.c.ki(--this.e),this.mj(),this.g=this.e,e}catch(t){if(t=eoa(t),M4(t,73))throw this.mj(),p7(new bC);throw p7(t)}},eUe.Qb=function(){throw p7(new bO)},eUe.Wb=function(e){throw p7(new bO)},Y6(eX_,"AbstractEList/NonResolvingEListIterator",385),eTS(1982,67,eJO),eUe.Vh=function(e,t){var n,r,i,a,o,s,u,c,l,f,d;if(0==(i=t.gc()))return++this.j,!1;for(r=eue(this,d=(l=null==(c=Pp(eaS(this.a,4),126))?0:c.length)+i),(f=l-e)>0&&ePD(c,e,r,e+i,f),u=t.Kc(),o=0;on)throw p7(new Ii(e,n));return new Uu(this,e)},eUe.$b=function(){var e,t;++this.j,t=null==(e=Pp(eaS(this.a,4),126))?0:e.length,eps(this,null),X9(this,t,e)},eUe.Hc=function(e){var t,n,r,i,a;if(null!=(t=Pp(eaS(this.a,4),126))){if(null!=e){for(i=0,a=(r=t).length;i=(n=null==(t=Pp(eaS(this.a,4),126))?0:t.length))throw p7(new Ii(e,n));return t[e]},eUe.Xc=function(e){var t,n,r;if(null!=(t=Pp(eaS(this.a,4),126))){if(null!=e){for(n=0,r=t.length;nn)throw p7(new Ii(e,n));return new Us(this,e)},eUe.ii=function(e,t){var n,r,i;if(i=null==(n=ehc(this))?0:n.length,e>=i)throw p7(new gE(eXU+e+eXH+i));if(t>=i)throw p7(new gE(eX$+t+eXH+i));return r=n[t],e!=t&&(e0&&ePD(e,0,t,0,n),t},eUe.Qc=function(e){var t,n,r;return(r=null==(t=Pp(eaS(this.a,4),126))?0:t.length)>0&&(e.lengthr&&Bc(e,r,null),e},Y6(eX_,"ArrayDelegatingEList",1982),eTS(1038,40,eUE,Zl),eUe.mj=function(){if(this.b.j!=this.f||xc(Pp(eaS(this.b.a,4),126))!==xc(this.a))throw p7(new bA)},eUe.Qb=function(){ey_(this),this.a=Pp(eaS(this.b.a,4),126)},Y6(eX_,"ArrayDelegatingEList/EIterator",1038),eTS(706,278,eUC,FK,Us),eUe.mj=function(){if(this.b.j!=this.f||xc(Pp(eaS(this.b.a,4),126))!==xc(this.a))throw p7(new bA)},eUe.pj=function(e){emE(this,e),this.a=Pp(eaS(this.b.a,4),126)},eUe.Qb=function(){ey_(this),this.a=Pp(eaS(this.b.a,4),126)},Y6(eX_,"ArrayDelegatingEList/EListIterator",706),eTS(1039,341,eUE,Zf),eUe.mj=function(){if(this.b.j!=this.f||xc(Pp(eaS(this.b.a,4),126))!==xc(this.a))throw p7(new bA)},Y6(eX_,"ArrayDelegatingEList/NonResolvingEIterator",1039),eTS(707,385,eUC,FV,Uu),eUe.mj=function(){if(this.b.j!=this.f||xc(Pp(eaS(this.b.a,4),126))!==xc(this.a))throw p7(new bA)},Y6(eX_,"ArrayDelegatingEList/NonResolvingEListIterator",707),eTS(606,295,eHZ,xJ),Y6(eX_,"BasicEList/BasicIndexOutOfBoundsException",606),eTS(696,63,eXz,xt),eUe.Vc=function(e,t){throw p7(new bO)},eUe.Fc=function(e){throw p7(new bO)},eUe.Wc=function(e,t){throw p7(new bO)},eUe.Gc=function(e){throw p7(new bO)},eUe.$b=function(){throw p7(new bO)},eUe.qi=function(e){throw p7(new bO)},eUe.Kc=function(){return this.Zh()},eUe.Yc=function(){return this.$h()},eUe.Zc=function(e){return this._h(e)},eUe.ii=function(e,t){throw p7(new bO)},eUe.ji=function(e,t){throw p7(new bO)},eUe.$c=function(e){throw p7(new bO)},eUe.Mc=function(e){throw p7(new bO)},eUe._c=function(e,t){throw p7(new bO)},Y6(eX_,"BasicEList/UnmodifiableEList",696),eTS(705,1,{3:1,20:1,14:1,15:1,58:1,589:1}),eUe.Vc=function(e,t){Mq(this,e,Pp(t,42))},eUe.Fc=function(e){return LA(this,Pp(e,42))},eUe.Jc=function(e){qX(this,e)},eUe.Xb=function(e){return Pp(etj(this.c,e),133)},eUe.ii=function(e,t){return Pp(this.c.ii(e,t),42)},eUe.ji=function(e,t){MZ(this,e,Pp(t,42))},eUe.Lc=function(){return new R1(null,new Gq(this,16))},eUe.$c=function(e){return Pp(this.c.$c(e),42)},eUe._c=function(e,t){return YV(this,e,Pp(t,42))},eUe.ad=function(e){er9(this,e)},eUe.Nc=function(){return new Gq(this,16)},eUe.Oc=function(){return new R1(null,new Gq(this,16))},eUe.Wc=function(e,t){return this.c.Wc(e,t)},eUe.Gc=function(e){return this.c.Gc(e)},eUe.$b=function(){this.c.$b()},eUe.Hc=function(e){return this.c.Hc(e)},eUe.Ic=function(e){return eot(this.c,e)},eUe.qj=function(){var e,t,n;if(null==this.d){for(this.d=Je(e5C,eJA,63,2*this.f+1,0,1),n=this.e,this.f=0,t=this.c.Kc();t.e!=t.i.gc();)ebB(this,e=Pp(t.nj(),133));this.e=n}},eUe.Fb=function(e){return Ij(this,e)},eUe.Hb=function(){return eov(this.c)},eUe.Xc=function(e){return this.c.Xc(e)},eUe.rj=function(){this.c=new pC(this)},eUe.dc=function(){return 0==this.f},eUe.Kc=function(){return this.c.Kc()},eUe.Yc=function(){return this.c.Yc()},eUe.Zc=function(e){return this.c.Zc(e)},eUe.sj=function(){return X5(this)},eUe.tj=function(e,t,n){return new N7(e,t,n)},eUe.uj=function(){return new st},eUe.Mc=function(e){return en$(this,e)},eUe.gc=function(){return this.f},eUe.bd=function(e,t){return new Gz(this.c,e,t)},eUe.Pc=function(){return this.c.Pc()},eUe.Qc=function(e){return this.c.Qc(e)},eUe.Ib=function(){return efq(this.c)},eUe.e=0,eUe.f=0,Y6(eX_,"BasicEMap",705),eTS(1033,63,eXz,pC),eUe.bi=function(e,t){bH(this,Pp(t,133))},eUe.ei=function(e,t,n){var r;++(r=this,Pp(t,133),r).a.e},eUe.fi=function(e,t){b$(this,Pp(t,133))},eUe.gi=function(e,t,n){AO(this,Pp(t,133),Pp(n,133))},eUe.di=function(e,t){eac(this.a)},Y6(eX_,"BasicEMap/1",1033),eTS(1034,63,eXz,st),eUe.ri=function(e){return Je(e5R,eJL,612,e,0,1)},Y6(eX_,"BasicEMap/2",1034),eTS(1035,eUT,eUM,pI),eUe.$b=function(){this.a.c.$b()},eUe.Hc=function(e){return edG(this.a,e)},eUe.Kc=function(){return 0==this.a.f?(LF(),tmB.a):new yd(this.a)},eUe.Mc=function(e){var t;return t=this.a.f,ehx(this.a,e),this.a.f!=t},eUe.gc=function(){return this.a.f},Y6(eX_,"BasicEMap/3",1035),eTS(1036,28,eUx,pD),eUe.$b=function(){this.a.c.$b()},eUe.Hc=function(e){return eCl(this.a,e)},eUe.Kc=function(){return 0==this.a.f?(LF(),tmB.a):new yh(this.a)},eUe.gc=function(){return this.a.f},Y6(eX_,"BasicEMap/4",1036),eTS(1037,eUT,eUM,pN),eUe.$b=function(){this.a.c.$b()},eUe.Hc=function(e){var t,n,r,i,a,o,s,u,c;if(this.a.f>0&&M4(e,42)&&(this.a.qj(),i=null==(s=(u=Pp(e,42)).cd())?0:esj(s),a=Cb(this.a,i),t=this.a.d[a])){for(o=0,n=Pp(t.g,367),c=t.i;o"+this.c},eUe.a=0;var e5R=Y6(eX_,"BasicEMap/EntryImpl",612);eTS(536,1,{},o2),Y6(eX_,"BasicEMap/View",536),eTS(768,1,{}),eUe.Fb=function(e){return eT$((Hj(),e2r),e)},eUe.Hb=function(){return esS((Hj(),e2r))},eUe.Ib=function(){return e_F((Hj(),e2r))},Y6(eX_,"ECollections/BasicEmptyUnmodifiableEList",768),eTS(1312,1,eUC,sn),eUe.Nb=function(e){F9(this,e)},eUe.Rb=function(e){throw p7(new bO)},eUe.Ob=function(){return!1},eUe.Sb=function(){return!1},eUe.Pb=function(){throw p7(new bC)},eUe.Tb=function(){return 0},eUe.Ub=function(){throw p7(new bC)},eUe.Vb=function(){return -1},eUe.Qb=function(){throw p7(new bO)},eUe.Wb=function(e){throw p7(new bO)},Y6(eX_,"ECollections/BasicEmptyUnmodifiableEList/1",1312),eTS(1310,768,{20:1,14:1,15:1,58:1},mx),eUe.Vc=function(e,t){y6()},eUe.Fc=function(e){return y5()},eUe.Wc=function(e,t){return y8()},eUe.Gc=function(e){return y9()},eUe.$b=function(){y7()},eUe.Hc=function(e){return!1},eUe.Ic=function(e){return!1},eUe.Jc=function(e){qX(this,e)},eUe.Xb=function(e){return xY((Hj(),e)),null},eUe.Xc=function(e){return -1},eUe.dc=function(){return!0},eUe.Kc=function(){return this.a},eUe.Yc=function(){return this.a},eUe.Zc=function(e){return this.a},eUe.ii=function(e,t){return we()},eUe.ji=function(e,t){wt()},eUe.Lc=function(){return new R1(null,new Gq(this,16))},eUe.$c=function(e){return wn()},eUe.Mc=function(e){return wr()},eUe._c=function(e,t){return wi()},eUe.gc=function(){return 0},eUe.ad=function(e){er9(this,e)},eUe.Nc=function(){return new Gq(this,16)},eUe.Oc=function(){return new R1(null,new Gq(this,16))},eUe.bd=function(e,t){return Hj(),new Gz(e2r,e,t)},eUe.Pc=function(){return Fn((Hj(),e2r))},eUe.Qc=function(e){return Hj(),emk(e2r,e)},Y6(eX_,"ECollections/EmptyUnmodifiableEList",1310),eTS(1311,768,{20:1,14:1,15:1,58:1,589:1},mT),eUe.Vc=function(e,t){y6()},eUe.Fc=function(e){return y5()},eUe.Wc=function(e,t){return y8()},eUe.Gc=function(e){return y9()},eUe.$b=function(){y7()},eUe.Hc=function(e){return!1},eUe.Ic=function(e){return!1},eUe.Jc=function(e){qX(this,e)},eUe.Xb=function(e){return xY((Hj(),e)),null},eUe.Xc=function(e){return -1},eUe.dc=function(){return!0},eUe.Kc=function(){return this.a},eUe.Yc=function(){return this.a},eUe.Zc=function(e){return this.a},eUe.ii=function(e,t){return we()},eUe.ji=function(e,t){wt()},eUe.Lc=function(){return new R1(null,new Gq(this,16))},eUe.$c=function(e){return wn()},eUe.Mc=function(e){return wr()},eUe._c=function(e,t){return wi()},eUe.gc=function(){return 0},eUe.ad=function(e){er9(this,e)},eUe.Nc=function(){return new Gq(this,16)},eUe.Oc=function(){return new R1(null,new Gq(this,16))},eUe.bd=function(e,t){return Hj(),new Gz(e2r,e,t)},eUe.Pc=function(){return Fn((Hj(),e2r))},eUe.Qc=function(e){return Hj(),emk(e2r,e)},eUe.sj=function(){return Hj(),Hj(),e2i},Y6(eX_,"ECollections/EmptyUnmodifiableEMap",1311);var e5j=RL(eX_,"Enumerator");eTS(281,1,{281:1},eCg),eUe.Fb=function(e){var t;return this===e||!!M4(e,281)&&(t=Pp(e,281),this.f==t.f&&jx(this.i,t.i)&&jk(this.a,(256&this.f)!=0?(256&t.f)!=0?t.a:null:(256&t.f)!=0?null:t.a)&&jk(this.d,t.d)&&jk(this.g,t.g)&&jk(this.e,t.e)&&epK(this,t))},eUe.Hb=function(){return this.f},eUe.Ib=function(){return eDv(this)},eUe.f=0;var e5F,e5Y,e5B,e5U,e5H,e5$,e5z,e5G,e5W,e5K,e5V,e5q,e5Z,e5X,e5J,e5Q,e51,e50,e52,e53,e54,e56,e55,e58,e59,e57,e8e,e8t,e8n,e8r,e8i,e8a,e8o,e8s,e8u,e8c,e8l,e8f,e8d,e8h,e8p,e8b,e8m,e8g,e8v,e8y,e8w,e8_,e8E,e8S,e8k,e8x,e8T,e8M,e8O,e8A,e8L,e8C,e8I,e8D,e8N,e8P,e8R,e8j,e8F,e8Y,e8B,e8U,e8H,e8$,e8z,e8G,e8W,e8K,e8V,e8q,e8Z,e8X,e8J,e8Q,e81,e80,e82,e83,e84,e86,e85,e88,e89,e87,e9e,e9t,e9n,e9r,e9i,e9a,e9o,e9s,e9u,e9c,e9l,e9f,e9d,e9h,e9p,e9b,e9m,e9g,e9v,e9y,e9w,e9_,e9E,e9S,e9k,e9x,e9T,e9M,e9O,e9A,e9L,e9C,e9I,e9D,e9N,e9P,e9R,e9j,e9F,e9Y,e9B,e9U,e9H,e9$,e9z,e9G,e9W,e9K,e9V,e9q,e9Z,e9X,e9J,e9Q,e91,e90,e92,e93,e94,e96,e95,e98,e99,e97,e7e,e7t,e7n,e7r,e7i,e7a,e7o,e7s,e7u,e7c,e7l,e7f,e7d,e7h,e7p,e7b,e7m,e7g,e7v,e7y,e7w,e7_,e7E,e7S,e7k,e7x,e7T,e7M,e7O,e7A,e7L,e7C,e7I,e7D,e7N,e7P,e7R,e7j,e7F,e7Y,e7B,e7U,e7H,e7$,e7z,e7G,e7W,e7K,e7V,e7q,e7Z,e7X,e7J,e7Q,e71,e70,e72,e73,e74,e76,e75,e78,e79,e77,tee,tet,ten,ter,tei,tea,teo,tes,teu,tec,tel,tef,ted,teh,tep,teb,tem,teg,tev,tey,tew,te_,teE,teS,tek,tex,teT,teM,teO,teA,teL,teC,teI,teD,teN,teP,teR,tej,teF,teY,teB,teU,teH,te$,tez,teG,teW,teK,teV,teq,teZ,teX,teJ,teQ,te1,te0,te2,te3,te4,te6,te5,te8,te9,te7,tte,ttt,ttn,ttr,tti,tta,tto,tts,ttu,ttc,ttl,ttf,ttd,tth,ttp,ttb,ttm,ttg,ttv,tty,ttw,tt_,ttE,ttS,ttk,ttx,ttT,ttM,ttO,ttA,ttL,ttC,ttI,ttD,ttN,ttP,ttR,ttj,ttF,ttY,ttB,ttU,ttH,tt$,ttz,ttG,ttW,ttK,ttV,ttq,ttZ,ttX,ttJ,ttQ,tt1,tt0,tt2,tt3,tt4,tt6,tt5,tt8,tt9,tt7,tne,tnt,tnn,tnr,tni,tna,tno,tns,tnu,tnc,tnl,tnf,tnd,tnh,tnp,tnb,tnm,tng,tnv,tny,tnw,tn_,tnE,tnS,tnk,tnx,tnT,tnM,tnO,tnA,tnL,tnC,tnI,tnD,tnN,tnP,tnR,tnj,tnF,tnY,tnB,tnU,tnH,tn$,tnz,tnG,tnW,tnK,tnV,tnq,tnZ,tnX,tnJ,tnQ,tn1,tn0,tn2,tn3,tn4,tn6,tn5,tn8,tn9,tn7,tre,trt,trn,trr,tri,tra,tro,trs,tru,trc,trl,trf,trd,trh,trp,trb,trm,trg,trv,trw,tr_,trE,trS,trk,trx,trT,trM,trO,trA,trL,trC,trI,trD,trN,trP,trR,trj,trF,trY,trB,trU,trH,tr$,trz,trG,trW,trK,trV,trq,trZ,trX,trJ,trQ,tr1,tr0,tr2,tr3,tr4,tr6,tr5,tr8,tr9,tr7,tie,tit,tin,tir,tii,tia,tio,tis,tiu,tic,til,tif,tid,tih,tip,tib,tim,tig,tiv,tiy,tiw,ti_,tiE,tiS,tik,tix,tiT,tiM,tiO,tiA,tiL,tiC,tiI,tiD,tiN,tiP,tiR,tij,tiF,tiY,tiB,tiU,tiH,ti$,tiz,tiG,tiW,tiK,tiV,tiq,tiZ,tiX,tiJ,tiQ,ti1,ti0,ti2,ti3,ti4,ti6,ti5,ti8,ti9,ti7,tae,tat,tan,tar,tai,taa,tao,tas,tau,tac,tal,taf,tad,tah,tap,tab,tam,tag,tav,tay,taw,ta_,taE,taS,tak,tax,taT,taM,taO,taA,taL,taC,taI,taD,taN,taP,taR,taj,taF,taY,taB,taU,taH,ta$,taz,taG,taW,taK,taV,taq,taZ,taX,taJ,taQ,ta1,ta0,ta2,ta3,ta4,ta6,ta5,ta8,ta9,ta7,toe,tot,ton,tor,toi,toa,too,tos,tou,toc,tol,tof,tod,toh,top,tob,tom,tog,tov,toy,tow,to_,toE,toS,tok,tox,toT,toM,toO,toA,toL,toC,toI,toD,toN,toP,toR,toj,toF,toY,toB,toU,toH,to$,toz,toG,toW,toK,toV,toq,toZ,toX,toJ,toQ,to1,to0,to2,to3,to4,to6,to5,to8,to9,to7,tse,tst,tsn,tsr,tsi,tsa,tso,tss,tsu,tsc,tsl,tsf,tsd,tsh,tsp,tsb,tsm,tsg,tsv,tsy,tsw,ts_,tsE,tsS,tsk,tsx,tsT,tsM,tsO,tsA,tsL,tsC,tsI,tsD,tsN,tsP,tsR,tsj,tsF,tsY,tsB,tsU,tsH,ts$,tsz,tsG,tsW,tsK,tsV,tsq,tsZ,tsX,tsJ,tsQ,ts1,ts0,ts2,ts3,ts4,ts6,ts5,ts8,ts9,ts7,tue,tut,tun,tur,tui,tua,tuo,tus,tuu,tuc,tul,tuf,tud,tuh,tup,tub,tum,tug,tuv,tuy,tuw,tu_,tuE,tuS,tuk,tux,tuT,tuM,tuO,tuA,tuL,tuC,tuI,tuD,tuN,tuP,tuR,tuj,tuF,tuY,tuB,tuU,tuH,tu$,tuz,tuG,tuW,tuK,tuV,tuq,tuZ,tuX,tuJ,tuQ,tu1,tu0,tu2,tu3,tu4,tu6,tu5,tu8,tu9,tu7,tce,tct,tcn,tcr,tci,tca,tco,tcs,tcu,tcc,tcl,tcf,tcd,tch,tcp,tcb,tcm,tcg,tcv,tcy,tcw,tc_,tcE,tcS,tck,tcx,tcT,tcM,tcO,tcA,tcL,tcC,tcI,tcD,tcN,tcP,tcR,tcj,tcF,tcY,tcB,tcU,tcH,tc$,tcz,tcG,tcW,tcK,tcV,tcq,tcZ,tcX,tcJ,tcQ,tc1,tc0,tc2,tc3,tc4,tc6,tc5,tc8,tc9,tc7,tle,tlt,tln,tlr,tli,tla,tlo,tls,tlu,tlc,tll,tlf,tld,tlh,tlp,tlb,tlm,tlg,tlv,tly,tlw,tl_,tlE,tlS,tlk,tlx,tlT,tlM,tlO,tlA,tlL,tlC,tlI,tlD,tlN,tlP,tlR,tlj,tlF,tlY,tlB,tlU,tlH,tl$,tlz,tlG,tlW,tlK,tlV,tlq,tlZ,tlX,tlJ,tlQ,tl1,tl0,tl2,tl3,tl4,tl6,tl5,tl8,tl9,tl7,tfe,tft,tfn,tfr,tfi,tfa,tfo,tfs,tfu,tfc,tfl,tff,tfd,tfh,tfp,tfb,tfm,tfg,tfv,tfy,tfw,tf_,tfE,tfS,tfk,tfx,tfT,tfM,tfO,tfA,tfL,tfC,tfI,tfD,tfN,tfP,tfR,tfj,tfF,tfY,tfB,tfU,tfH,tf$,tfz,tfG,tfW,tfK,tfV,tfq,tfZ,tfX,tfJ,tfQ,tf1,tf0,tf2,tf3,tf4,tf6,tf5,tf8,tf9,tf7,tde,tdt,tdn,tdr,tdi,tda,tdo,tds,tdu,tdc,tdl,tdf,tdd,tdh,tdp,tdb,tdm,tdg,tdv,tdy,tdw,td_,tdE,tdS,tdk,tdx,tdT,tdM,tdO,tdA,tdL,tdC,tdI,tdD,tdN,tdP,tdR,tdj,tdF,tdY,tdB,tdU,tdH,td$,tdz,tdG,tdW,tdK,tdV,tdq,tdZ,tdX,tdJ,tdQ,td1,td0,td2,td3,td4,td6,td5,td8,td9,td7,the,tht,thn,thr,thi,tha,tho,ths,thu,thc,thl,thf,thd,thh,thp,thb,thm,thg,thv,thy,thw,th_,thE,thS,thk,thx,thT,thM,thO,thA,thL,thC,thI,thD,thN,thP,thR,thj,thF,thY,thB,thU,thH,th$,thz,thG,thW,thK,thV,thq,thZ,thX,thJ,thQ,th1,th0,th2,th3,th4,th6,th5,th8,th9,th7,tpe,tpt,tpn,tpr,tpi,tpa,tpo,tps,tpu,tpc,tpl,tpf,tpd,tph,tpp,tpb,tpm,tpg,tpv,tpy,tpw,tp_,tpE,tpS,tpk,tpx,tpT,tpM,tpO,tpA,tpL,tpC,tpI,tpD,tpN,tpP,tpR,tpj,tpF,tpY,tpB,tpU,tpH,tp$,tpz,tpG,tpW,tpK,tpV,tpq,tpZ,tpX,tpJ,tpQ,tp1,tp0,tp2,tp3,tp4,tp6,tp5,tp8,tp9,tp7,tbe,tbt,tbn,tbr,tbi,tba,tbo,tbs,tbu,tbc,tbl,tbf,tbd,tbh,tbp,tbb,tbm,tbg,tbv,tby,tbw,tb_,tbE,tbS,tbk,tbx,tbT,tbM,tbO,tbA,tbL,tbC,tbI,tbD,tbN,tbP,tbR,tbj,tbF,tbY,tbB,tbU,tbH,tb$,tbz,tbG,tbW,tbK,tbV,tbq,tbZ,tbX,tbJ,tbQ,tb1,tb0,tb2,tb3,tb4,tb6,tb5,tb8,tb9,tb7,tme,tmt,tmn,tmr,tmi,tma,tmo,tms,tmu,tmc,tml,tmf,tmd,tmh,tmp,tmb,tmm,tmg,tmv,tmy,tmw,tm_,tmE,tmS,tmk,tmx,tmT,tmM,tmO,tmA,tmL,tmC,tmI,tmD,tmN,tmP,tmR,tmj,tmF,tmY,tmB,tmU,tmH,tm$,tmz,tmG=0,tmW=0,tmK=0,tmV=0,tmq=0,tmZ=0,tmX=0,tmJ=0,tmQ=0,tm1=0,tm0=0,tm2=0,tm3=0;Y6(eX_,"URI",281),eTS(1091,43,e$s,mM),eUe.zc=function(e,t){return Pp(Ge(this,Lq(e),Pp(t,281)),281)},Y6(eX_,"URI/URICache",1091),eTS(497,63,eXz,o6,jf),eUe.hi=function(){return!0},Y6(eX_,"UniqueEList",497),eTS(581,60,eHr,QH),Y6(eX_,"WrappedException",581);var tm4=RL(eZD,eJD),tm6=RL(eZD,eJN),tm5=RL(eZD,eJP),tm8=RL(eZD,eJR),tm9=RL(eZD,eJj),tm7=RL(eZD,"EClass"),tge=RL(eZD,"EDataType");eTS(1183,43,e$s,mO),eUe.xc=function(e){return xd(e)?zg(this,e):xu($I(this.f,e))},Y6(eZD,"EDataType/Internal/ConversionDelegate/Factory/Registry/Impl",1183);var tgt=RL(eZD,"EEnum"),tgn=RL(eZD,eJF),tgr=RL(eZD,eJY),tgi=RL(eZD,eJB),tga=RL(eZD,eJU),tgo=RL(eZD,eJH);eTS(1029,1,{},o4),eUe.Ib=function(){return"NIL"},Y6(eZD,"EStructuralFeature/Internal/DynamicValueHolder/1",1029),eTS(1028,43,e$s,mA),eUe.xc=function(e){return xd(e)?zg(this,e):xu($I(this.f,e))},Y6(eZD,"EStructuralFeature/Internal/SettingDelegate/Factory/Registry/Impl",1028);var tgs=RL(eZD,eJ$),tgu=RL(eZD,"EValidator/PatternMatcher"),tgc=RL(eJz,"FeatureMap/Entry");eTS(535,1,{72:1},k3),eUe.ak=function(){return this.a},eUe.dd=function(){return this.b},Y6(eZ2,"BasicEObjectImpl/1",535),eTS(1027,1,eJG,k4),eUe.Wj=function(e){return ZN(this.a,this.b,e)},eUe.fj=function(){return zz(this.a,this.b)},eUe.Wb=function(e){zx(this.a,this.b,e)},eUe.Xj=function(){B4(this.a,this.b)},Y6(eZ2,"BasicEObjectImpl/4",1027),eTS(1983,1,{108:1}),eUe.bk=function(e){this.e=0==e?tgH:Je(e1R,eUp,1,e,5,1)},eUe.Ch=function(e){return this.e[e]},eUe.Dh=function(e,t){this.e[e]=t},eUe.Eh=function(e){this.e[e]=null},eUe.ck=function(){return this.c},eUe.dk=function(){throw p7(new bO)},eUe.ek=function(){throw p7(new bO)},eUe.fk=function(){return this.d},eUe.gk=function(){return null!=this.e},eUe.hk=function(e){this.c=e},eUe.ik=function(e){throw p7(new bO)},eUe.jk=function(e){throw p7(new bO)},eUe.kk=function(e){this.d=e},Y6(eZ2,"BasicEObjectImpl/EPropertiesHolderBaseImpl",1983),eTS(185,1983,{108:1},c1),eUe.dk=function(){return this.a},eUe.ek=function(){return this.b},eUe.ik=function(e){this.a=e},eUe.jk=function(e){this.b=e},Y6(eZ2,"BasicEObjectImpl/EPropertiesHolderImpl",185),eTS(506,97,eZ0,sr),eUe.Kg=function(){return this.f},eUe.Pg=function(){return this.k},eUe.Rg=function(e,t){this.g=e,this.i=t},eUe.Tg=function(){return(2&this.j)==0?this.zh():this.ph().ck()},eUe.Vg=function(){return this.i},eUe.Mg=function(){return(1&this.j)!=0},eUe.eh=function(){return this.g},eUe.kh=function(){return(4&this.j)!=0},eUe.ph=function(){return this.k||(this.k=new c1),this.k},eUe.th=function(e){this.ph().hk(e),e?this.j|=2:this.j&=-3},eUe.vh=function(e){this.ph().jk(e),e?this.j|=4:this.j&=-5},eUe.zh=function(){return(BM(),tgv).S},eUe.i=0,eUe.j=1,Y6(eZ2,"EObjectImpl",506),eTS(780,506,{105:1,92:1,90:1,56:1,108:1,49:1,97:1},Pq),eUe.Ch=function(e){return this.e[e]},eUe.Dh=function(e,t){this.e[e]=t},eUe.Eh=function(e){this.e[e]=null},eUe.Tg=function(){return this.d},eUe.Yg=function(e){return edv(this.d,e)},eUe.$g=function(){return this.d},eUe.dh=function(){return null!=this.e},eUe.ph=function(){return this.k||(this.k=new si),this.k},eUe.th=function(e){this.d=e},eUe.yh=function(){var e;return null==this.e&&(e=Y1(this.d),this.e=0==e?tg$:Je(e1R,eUp,1,e,5,1)),this},eUe.Ah=function(){return 0},Y6(eZ2,"DynamicEObjectImpl",780),eTS(1376,780,{105:1,42:1,92:1,90:1,133:1,56:1,108:1,49:1,97:1},RO),eUe.Fb=function(e){return this===e},eUe.Hb=function(){return Ao(this)},eUe.th=function(e){this.d=e,this.b=eAh(e,"key"),this.c=eAh(e,eXr)},eUe.Sh=function(){var e;return -1==this.a&&(e=Q8(this,this.b),this.a=null==e?0:esj(e)),this.a},eUe.cd=function(){return Q8(this,this.b)},eUe.dd=function(){return Q8(this,this.c)},eUe.Th=function(e){this.a=e},eUe.Uh=function(e){zx(this,this.b,e)},eUe.ed=function(e){var t;return t=Q8(this,this.c),zx(this,this.c,e),t},eUe.a=0,Y6(eZ2,"DynamicEObjectImpl/BasicEMapEntry",1376),eTS(1377,1,{108:1},si),eUe.bk=function(e){throw p7(new bO)},eUe.Ch=function(e){throw p7(new bO)},eUe.Dh=function(e,t){throw p7(new bO)},eUe.Eh=function(e){throw p7(new bO)},eUe.ck=function(){throw p7(new bO)},eUe.dk=function(){return this.a},eUe.ek=function(){return this.b},eUe.fk=function(){return this.c},eUe.gk=function(){throw p7(new bO)},eUe.hk=function(e){throw p7(new bO)},eUe.ik=function(e){this.a=e},eUe.jk=function(e){this.b=e},eUe.kk=function(e){this.c=e},Y6(eZ2,"DynamicEObjectImpl/DynamicEPropertiesHolderImpl",1377),eTS(510,150,{105:1,92:1,90:1,590:1,147:1,56:1,108:1,49:1,97:1,510:1,150:1,114:1,115:1},sa),eUe.Qg=function(e){return eg4(this,e)},eUe._g=function(e,t,n){var r;switch(e){case 0:return this.Ab||(this.Ab=new FQ(tm4,this,0,3)),this.Ab;case 1:return this.d;case 2:return n?(this.b||(this.b=new L_((eBK(),tgF),tgf,this)),this.b):(this.b||(this.b=new L_((eBK(),tgF),tgf,this)),X5(this.b));case 3:return z4(this);case 4:return this.a||(this.a=new O_(e5f,this,4)),this.a;case 5:return this.c||(this.c=new OT(e5f,this,5)),this.c}return Qt(this,e-Y1((eBK(),tgy)),ee2((r=Pp(eaS(this,16),26))||tgy,e),t,n)},eUe.hh=function(e,t,n){var r,i,a;switch(t){case 0:return this.Ab||(this.Ab=new FQ(tm4,this,0,3)),edF(this.Ab,e,n);case 3:return this.Cb&&(n=(i=this.Db>>16)>=0?eg4(this,n):this.Cb.ih(this,-1-i,null,n)),j3(this,Pp(e,147),n)}return(a=Pp(ee2((r=Pp(eaS(this,16),26))||(eBK(),tgy),t),66)).Nj().Qj(this,ehH(this),t-Y1((eBK(),tgy)),e,n)},eUe.jh=function(e,t,n){var r,i;switch(t){case 0:return this.Ab||(this.Ab=new FQ(tm4,this,0,3)),ep5(this.Ab,e,n);case 2:return this.b||(this.b=new L_((eBK(),tgF),tgf,this)),Iz(this.b,e,n);case 3:return j3(this,null,n);case 4:return this.a||(this.a=new O_(e5f,this,4)),ep5(this.a,e,n)}return(i=Pp(ee2((r=Pp(eaS(this,16),26))||(eBK(),tgy),t),66)).Nj().Rj(this,ehH(this),t-Y1((eBK(),tgy)),e,n)},eUe.lh=function(e){var t;switch(e){case 0:return!!this.Ab&&0!=this.Ab.i;case 1:return null!=this.d;case 2:return!!this.b&&0!=this.b.f;case 3:return!!z4(this);case 4:return!!this.a&&0!=this.a.i;case 5:return!!this.c&&0!=this.c.i}return VP(this,e-Y1((eBK(),tgy)),ee2((t=Pp(eaS(this,16),26))||tgy,e))},eUe.sh=function(e,t){var n;switch(e){case 0:this.Ab||(this.Ab=new FQ(tm4,this,0,3)),eRT(this.Ab),this.Ab||(this.Ab=new FQ(tm4,this,0,3)),Y4(this.Ab,Pp(t,14));return;case 1:RN(this,Lq(t));return;case 2:this.b||(this.b=new L_((eBK(),tgF),tgf,this)),eai(this.b,t);return;case 3:eAc(this,Pp(t,147));return;case 4:this.a||(this.a=new O_(e5f,this,4)),eRT(this.a),this.a||(this.a=new O_(e5f,this,4)),Y4(this.a,Pp(t,14));return;case 5:this.c||(this.c=new OT(e5f,this,5)),eRT(this.c),this.c||(this.c=new OT(e5f,this,5)),Y4(this.c,Pp(t,14));return}efL(this,e-Y1((eBK(),tgy)),ee2((n=Pp(eaS(this,16),26))||tgy,e),t)},eUe.zh=function(){return eBK(),tgy},eUe.Bh=function(e){var t;switch(e){case 0:this.Ab||(this.Ab=new FQ(tm4,this,0,3)),eRT(this.Ab);return;case 1:erl(this,null);return;case 2:this.b||(this.b=new L_((eBK(),tgF),tgf,this)),this.b.c.$b();return;case 3:eAc(this,null);return;case 4:this.a||(this.a=new O_(e5f,this,4)),eRT(this.a);return;case 5:this.c||(this.c=new OT(e5f,this,5)),eRT(this.c);return}ec5(this,e-Y1((eBK(),tgy)),ee2((t=Pp(eaS(this,16),26))||tgy,e))},eUe.Ib=function(){return eln(this)},eUe.d=null,Y6(eZ2,"EAnnotationImpl",510),eTS(151,705,eJW,JY),eUe.Xh=function(e,t){T7(this,e,Pp(t,42))},eUe.lk=function(e,t){return I$(this,Pp(e,42),t)},eUe.pi=function(e){return Pp(Pp(this.c,69).pi(e),133)},eUe.Zh=function(){return Pp(this.c,69).Zh()},eUe.$h=function(){return Pp(this.c,69).$h()},eUe._h=function(e){return Pp(this.c,69)._h(e)},eUe.mk=function(e,t){return Iz(this,e,t)},eUe.Wj=function(e){return Pp(this.c,76).Wj(e)},eUe.rj=function(){},eUe.fj=function(){return Pp(this.c,76).fj()},eUe.tj=function(e,t,n){var r;return(r=Pp(etP(this.b).Nh().Jh(this.b),133)).Th(e),r.Uh(t),r.ed(n),r},eUe.uj=function(){return new pZ(this)},eUe.Wb=function(e){eai(this,e)},eUe.Xj=function(){Pp(this.c,76).Xj()},Y6(eJz,"EcoreEMap",151),eTS(158,151,eJW,L_),eUe.qj=function(){var e,t,n,r,i,a;if(null==this.d){for(a=Je(e5C,eJA,63,2*this.f+1,0,1),n=this.c.Kc();n.e!=n.i.gc();)(e=a[i=((r=(t=Pp(n.nj(),133)).Sh())&eUu)%a.length])||(e=a[i]=new pZ(this)),e.Fc(t);this.d=a}},Y6(eZ2,"EAnnotationImpl/1",158),eTS(284,438,{105:1,92:1,90:1,147:1,191:1,56:1,108:1,472:1,49:1,97:1,150:1,284:1,114:1,115:1}),eUe._g=function(e,t,n){var r,i;switch(e){case 0:return this.Ab||(this.Ab=new FQ(tm4,this,0,3)),this.Ab;case 1:return this.zb;case 2:return OQ(),(256&this.Bb)!=0;case 3:return OQ(),(512&this.Bb)!=0;case 4:return ell(this.s);case 5:return ell(this.t);case 6:return OQ(),!!this.$j();case 7:return OQ(),(i=this.s)>=1;case 8:if(t)return evl(this);return this.r;case 9:return this.q}return Qt(this,e-Y1(this.zh()),ee2((r=Pp(eaS(this,16),26))||this.zh(),e),t,n)},eUe.jh=function(e,t,n){var r,i;switch(t){case 0:return this.Ab||(this.Ab=new FQ(tm4,this,0,3)),ep5(this.Ab,e,n);case 9:return Y3(this,n)}return(i=Pp(ee2((r=Pp(eaS(this,16),26))||this.zh(),t),66)).Nj().Rj(this,ehH(this),t-Y1(this.zh()),e,n)},eUe.lh=function(e){var t,n;switch(e){case 0:return!!this.Ab&&0!=this.Ab.i;case 1:return null!=this.zb;case 2:return(256&this.Bb)==0;case 3:return(512&this.Bb)==0;case 4:return 0!=this.s;case 5:return 1!=this.t;case 6:return this.$j();case 7:return(n=this.s)>=1;case 8:return!!this.r&&!this.q.e&&0==BX(this.q).i;case 9:return!!this.q&&!(this.r&&!this.q.e&&0==BX(this.q).i)}return VP(this,e-Y1(this.zh()),ee2((t=Pp(eaS(this,16),26))||this.zh(),e))},eUe.sh=function(e,t){var n,r;switch(e){case 0:this.Ab||(this.Ab=new FQ(tm4,this,0,3)),eRT(this.Ab),this.Ab||(this.Ab=new FQ(tm4,this,0,3)),Y4(this.Ab,Pp(t,14));return;case 1:this.Lh(Lq(t));return;case 2:eli(this,gN(LK(t)));return;case 3:els(this,gN(LK(t)));return;case 4:end(this,Pp(t,19).a);return;case 5:this.ok(Pp(t,19).a);return;case 8:eu2(this,Pp(t,138));return;case 9:(r=ew3(this,Pp(t,87),null))&&r.Fi();return}efL(this,e-Y1(this.zh()),ee2((n=Pp(eaS(this,16),26))||this.zh(),e),t)},eUe.zh=function(){return eBK(),tgB},eUe.Bh=function(e){var t,n;switch(e){case 0:this.Ab||(this.Ab=new FQ(tm4,this,0,3)),eRT(this.Ab);return;case 1:this.Lh(null);return;case 2:eli(this,!0);return;case 3:els(this,!0);return;case 4:end(this,0);return;case 5:this.ok(1);return;case 8:eu2(this,null);return;case 9:(n=ew3(this,null,null))&&n.Fi();return}ec5(this,e-Y1(this.zh()),ee2((t=Pp(eaS(this,16),26))||this.zh(),e))},eUe.Gh=function(){evl(this),this.Bb|=1},eUe.Yj=function(){return evl(this)},eUe.Zj=function(){return this.t},eUe.$j=function(){var e;return(e=this.t)>1||-1==e},eUe.hi=function(){return(512&this.Bb)!=0},eUe.nk=function(e,t){return ecz(this,e,t)},eUe.ok=function(e){enh(this,e)},eUe.Ib=function(){return ex3(this)},eUe.s=0,eUe.t=1,Y6(eZ2,"ETypedElementImpl",284),eTS(449,284,{105:1,92:1,90:1,147:1,191:1,56:1,170:1,66:1,108:1,472:1,49:1,97:1,150:1,449:1,284:1,114:1,115:1,677:1}),eUe.Qg=function(e){return egx(this,e)},eUe._g=function(e,t,n){var r,i;switch(e){case 0:return this.Ab||(this.Ab=new FQ(tm4,this,0,3)),this.Ab;case 1:return this.zb;case 2:return OQ(),(256&this.Bb)!=0;case 3:return OQ(),(512&this.Bb)!=0;case 4:return ell(this.s);case 5:return ell(this.t);case 6:return OQ(),!!this.$j();case 7:return OQ(),(i=this.s)>=1;case 8:if(t)return evl(this);return this.r;case 9:return this.q;case 10:return OQ(),(this.Bb&eXt)!=0;case 11:return OQ(),(this.Bb&eJq)!=0;case 12:return OQ(),(this.Bb&eH0)!=0;case 13:return this.j;case 14:return eOI(this);case 15:return OQ(),(this.Bb&eJV)!=0;case 16:return OQ(),(this.Bb&eUR)!=0;case 17:return z5(this)}return Qt(this,e-Y1(this.zh()),ee2((r=Pp(eaS(this,16),26))||this.zh(),e),t,n)},eUe.hh=function(e,t,n){var r,i,a;switch(t){case 0:return this.Ab||(this.Ab=new FQ(tm4,this,0,3)),edF(this.Ab,e,n);case 17:return this.Cb&&(n=(i=this.Db>>16)>=0?egx(this,n):this.Cb.ih(this,-1-i,null,n)),eDg(this,e,17,n)}return(a=Pp(ee2((r=Pp(eaS(this,16),26))||this.zh(),t),66)).Nj().Qj(this,ehH(this),t-Y1(this.zh()),e,n)},eUe.jh=function(e,t,n){var r,i;switch(t){case 0:return this.Ab||(this.Ab=new FQ(tm4,this,0,3)),ep5(this.Ab,e,n);case 9:return Y3(this,n);case 17:return eDg(this,null,17,n)}return(i=Pp(ee2((r=Pp(eaS(this,16),26))||this.zh(),t),66)).Nj().Rj(this,ehH(this),t-Y1(this.zh()),e,n)},eUe.lh=function(e){var t,n;switch(e){case 0:return!!this.Ab&&0!=this.Ab.i;case 1:return null!=this.zb;case 2:return(256&this.Bb)==0;case 3:return(512&this.Bb)==0;case 4:return 0!=this.s;case 5:return 1!=this.t;case 6:return this.$j();case 7:return(n=this.s)>=1;case 8:return!!this.r&&!this.q.e&&0==BX(this.q).i;case 9:return!!this.q&&!(this.r&&!this.q.e&&0==BX(this.q).i);case 10:return(this.Bb&eXt)==0;case 11:return(this.Bb&eJq)!=0;case 12:return(this.Bb&eH0)!=0;case 13:return null!=this.j;case 14:return null!=eOI(this);case 15:return(this.Bb&eJV)!=0;case 16:return(this.Bb&eUR)!=0;case 17:return!!z5(this)}return VP(this,e-Y1(this.zh()),ee2((t=Pp(eaS(this,16),26))||this.zh(),e))},eUe.sh=function(e,t){var n,r;switch(e){case 0:this.Ab||(this.Ab=new FQ(tm4,this,0,3)),eRT(this.Ab),this.Ab||(this.Ab=new FQ(tm4,this,0,3)),Y4(this.Ab,Pp(t,14));return;case 1:GD(this,Lq(t));return;case 2:eli(this,gN(LK(t)));return;case 3:els(this,gN(LK(t)));return;case 4:end(this,Pp(t,19).a);return;case 5:this.ok(Pp(t,19).a);return;case 8:eu2(this,Pp(t,138));return;case 9:(r=ew3(this,Pp(t,87),null))&&r.Fi();return;case 10:elF(this,gN(LK(t)));return;case 11:elU(this,gN(LK(t)));return;case 12:elY(this,gN(LK(t)));return;case 13:xi(this,Lq(t));return;case 15:elB(this,gN(LK(t)));return;case 16:elZ(this,gN(LK(t)));return}efL(this,e-Y1(this.zh()),ee2((n=Pp(eaS(this,16),26))||this.zh(),e),t)},eUe.zh=function(){return eBK(),tgY},eUe.Bh=function(e){var t,n;switch(e){case 0:this.Ab||(this.Ab=new FQ(tm4,this,0,3)),eRT(this.Ab);return;case 1:M4(this.Cb,88)&&eko(Zd(Pp(this.Cb,88)),4),er3(this,null);return;case 2:eli(this,!0);return;case 3:els(this,!0);return;case 4:end(this,0);return;case 5:this.ok(1);return;case 8:eu2(this,null);return;case 9:(n=ew3(this,null,null))&&n.Fi();return;case 10:elF(this,!0);return;case 11:elU(this,!1);return;case 12:elY(this,!1);return;case 13:this.i=null,erA(this,null);return;case 15:elB(this,!1);return;case 16:elZ(this,!1);return}ec5(this,e-Y1(this.zh()),ee2((t=Pp(eaS(this,16),26))||this.zh(),e))},eUe.Gh=function(){UH(QZ((eSp(),tvc),this)),evl(this),this.Bb|=1},eUe.Gj=function(){return this.f},eUe.zj=function(){return eOI(this)},eUe.Hj=function(){return z5(this)},eUe.Lj=function(){return null},eUe.pk=function(){return this.k},eUe.aj=function(){return this.n},eUe.Mj=function(){return eyD(this)},eUe.Nj=function(){var e,t,n,r,i,a,o,s,u;return this.p||((null==(n=z5(this)).i&&eNT(n),n.i).length,(r=this.Lj())&&Y1(z5(r)),e=(o=(i=evl(this)).Bj())?(1&o.i)!=0?o==tyE?e11:o==ty_?e16:o==tyT?e14:o==tyx?e13:o==tyS?e15:o==tyM?e18:o==tyk?e10:e12:o:null,t=eOI(this),s=i.zj(),efl(this),(this.Bb&eUR)!=0&&((a=ev1((eSp(),tvc),n))&&a!=this||(a=Wk(QZ(tvc,this))))?this.p=new k5(this,a):this.$j()?this.rk()?r?(this.Bb&eJV)!=0?e?this.sk()?this.p=new HS(47,e,this,r):this.p=new HS(5,e,this,r):this.sk()?this.p=new qc(46,this,r):this.p=new qc(4,this,r):e?this.sk()?this.p=new HS(49,e,this,r):this.p=new HS(7,e,this,r):this.sk()?this.p=new qc(48,this,r):this.p=new qc(6,this,r):(this.Bb&eJV)!=0?e?e==e1$?this.p=new Pe(50,e5M,this):this.sk()?this.p=new Pe(43,e,this):this.p=new Pe(1,e,this):this.sk()?this.p=new $F(42,this):this.p=new $F(0,this):e?e==e1$?this.p=new Pe(41,e5M,this):this.sk()?this.p=new Pe(45,e,this):this.p=new Pe(3,e,this):this.sk()?this.p=new $F(44,this):this.p=new $F(2,this):M4(i,148)?e==tgc?this.p=new $F(40,this):(512&this.Bb)!=0?(this.Bb&eJV)!=0?e?this.p=new Pe(9,e,this):this.p=new $F(8,this):e?this.p=new Pe(11,e,this):this.p=new $F(10,this):(this.Bb&eJV)!=0?e?this.p=new Pe(13,e,this):this.p=new $F(12,this):e?this.p=new Pe(15,e,this):this.p=new $F(14,this):r?(u=r.t)>1||-1==u?this.sk()?(this.Bb&eJV)!=0?e?this.p=new HS(25,e,this,r):this.p=new qc(24,this,r):e?this.p=new HS(27,e,this,r):this.p=new qc(26,this,r):(this.Bb&eJV)!=0?e?this.p=new HS(29,e,this,r):this.p=new qc(28,this,r):e?this.p=new HS(31,e,this,r):this.p=new qc(30,this,r):this.sk()?(this.Bb&eJV)!=0?e?this.p=new HS(33,e,this,r):this.p=new qc(32,this,r):e?this.p=new HS(35,e,this,r):this.p=new qc(34,this,r):(this.Bb&eJV)!=0?e?this.p=new HS(37,e,this,r):this.p=new qc(36,this,r):e?this.p=new HS(39,e,this,r):this.p=new qc(38,this,r):this.sk()?(this.Bb&eJV)!=0?e?this.p=new Pe(17,e,this):this.p=new $F(16,this):e?this.p=new Pe(19,e,this):this.p=new $F(18,this):(this.Bb&eJV)!=0?e?this.p=new Pe(21,e,this):this.p=new $F(20,this):e?this.p=new Pe(23,e,this):this.p=new $F(22,this):this.qk()?this.sk()?this.p=new Pt(Pp(i,26),this,r):this.p=new zl(Pp(i,26),this,r):M4(i,148)?e==tgc?this.p=new $F(40,this):(this.Bb&eJV)!=0?e?this.p=new j8(t,s,this,(edO(),o==ty_?tg2:o==tyE?tgX:o==tyS?tg3:o==tyT?tg0:o==tyx?tg1:o==tyM?tg6:o==tyk?tgJ:o==tyw?tgQ:tg4)):this.p=new HT(Pp(i,148),t,s,this):e?this.p=new j5(t,s,this,(edO(),o==ty_?tg2:o==tyE?tgX:o==tyS?tg3:o==tyT?tg0:o==tyx?tg1:o==tyM?tg6:o==tyk?tgJ:o==tyw?tgQ:tg4)):this.p=new Hx(Pp(i,148),t,s,this):this.rk()?r?(this.Bb&eJV)!=0?this.sk()?this.p=new Ps(Pp(i,26),this,r):this.p=new Po(Pp(i,26),this,r):this.sk()?this.p=new Pa(Pp(i,26),this,r):this.p=new Pn(Pp(i,26),this,r):(this.Bb&eJV)!=0?this.sk()?this.p=new Lx(Pp(i,26),this):this.p=new Lk(Pp(i,26),this):this.sk()?this.p=new LS(Pp(i,26),this):this.p=new LE(Pp(i,26),this):this.sk()?r?(this.Bb&eJV)!=0?this.p=new Pu(Pp(i,26),this,r):this.p=new Pr(Pp(i,26),this,r):(this.Bb&eJV)!=0?this.p=new LM(Pp(i,26),this):this.p=new LT(Pp(i,26),this):r?(this.Bb&eJV)!=0?this.p=new Pc(Pp(i,26),this,r):this.p=new Pi(Pp(i,26),this,r):(this.Bb&eJV)!=0?this.p=new LO(Pp(i,26),this):this.p=new jd(Pp(i,26),this)),this.p},eUe.Ij=function(){return(this.Bb&eXt)!=0},eUe.qk=function(){return!1},eUe.rk=function(){return!1},eUe.Jj=function(){return(this.Bb&eUR)!=0},eUe.Oj=function(){return eec(this)},eUe.sk=function(){return!1},eUe.Kj=function(){return(this.Bb&eJV)!=0},eUe.tk=function(e){this.k=e},eUe.Lh=function(e){GD(this,e)},eUe.Ib=function(){return eCR(this)},eUe.e=!1,eUe.n=0,Y6(eZ2,"EStructuralFeatureImpl",449),eTS(322,449,{105:1,92:1,90:1,34:1,147:1,191:1,56:1,170:1,66:1,108:1,472:1,49:1,97:1,322:1,150:1,449:1,284:1,114:1,115:1,677:1},mC),eUe._g=function(e,t,n){var r,i;switch(e){case 0:return this.Ab||(this.Ab=new FQ(tm4,this,0,3)),this.Ab;case 1:return this.zb;case 2:return OQ(),(256&this.Bb)!=0;case 3:return OQ(),(512&this.Bb)!=0;case 4:return ell(this.s);case 5:return ell(this.t);case 6:return OQ(),!!ek7(this);case 7:return OQ(),(i=this.s)>=1;case 8:if(t)return evl(this);return this.r;case 9:return this.q;case 10:return OQ(),(this.Bb&eXt)!=0;case 11:return OQ(),(this.Bb&eJq)!=0;case 12:return OQ(),(this.Bb&eH0)!=0;case 13:return this.j;case 14:return eOI(this);case 15:return OQ(),(this.Bb&eJV)!=0;case 16:return OQ(),(this.Bb&eUR)!=0;case 17:return z5(this);case 18:return OQ(),(this.Bb&eZ1)!=0;case 19:if(t)return eoe(this);return Xl(this)}return Qt(this,e-Y1((eBK(),tgw)),ee2((r=Pp(eaS(this,16),26))||tgw,e),t,n)},eUe.lh=function(e){var t,n;switch(e){case 0:return!!this.Ab&&0!=this.Ab.i;case 1:return null!=this.zb;case 2:return(256&this.Bb)==0;case 3:return(512&this.Bb)==0;case 4:return 0!=this.s;case 5:return 1!=this.t;case 6:return ek7(this);case 7:return(n=this.s)>=1;case 8:return!!this.r&&!this.q.e&&0==BX(this.q).i;case 9:return!!this.q&&!(this.r&&!this.q.e&&0==BX(this.q).i);case 10:return(this.Bb&eXt)==0;case 11:return(this.Bb&eJq)!=0;case 12:return(this.Bb&eH0)!=0;case 13:return null!=this.j;case 14:return null!=eOI(this);case 15:return(this.Bb&eJV)!=0;case 16:return(this.Bb&eUR)!=0;case 17:return!!z5(this);case 18:return(this.Bb&eZ1)!=0;case 19:return!!Xl(this)}return VP(this,e-Y1((eBK(),tgw)),ee2((t=Pp(eaS(this,16),26))||tgw,e))},eUe.sh=function(e,t){var n,r;switch(e){case 0:this.Ab||(this.Ab=new FQ(tm4,this,0,3)),eRT(this.Ab),this.Ab||(this.Ab=new FQ(tm4,this,0,3)),Y4(this.Ab,Pp(t,14));return;case 1:GD(this,Lq(t));return;case 2:eli(this,gN(LK(t)));return;case 3:els(this,gN(LK(t)));return;case 4:end(this,Pp(t,19).a);return;case 5:yg(this,Pp(t,19).a);return;case 8:eu2(this,Pp(t,138));return;case 9:(r=ew3(this,Pp(t,87),null))&&r.Fi();return;case 10:elF(this,gN(LK(t)));return;case 11:elU(this,gN(LK(t)));return;case 12:elY(this,gN(LK(t)));return;case 13:xi(this,Lq(t));return;case 15:elB(this,gN(LK(t)));return;case 16:elZ(this,gN(LK(t)));return;case 18:elX(this,gN(LK(t)));return}efL(this,e-Y1((eBK(),tgw)),ee2((n=Pp(eaS(this,16),26))||tgw,e),t)},eUe.zh=function(){return eBK(),tgw},eUe.Bh=function(e){var t,n;switch(e){case 0:this.Ab||(this.Ab=new FQ(tm4,this,0,3)),eRT(this.Ab);return;case 1:M4(this.Cb,88)&&eko(Zd(Pp(this.Cb,88)),4),er3(this,null);return;case 2:eli(this,!0);return;case 3:els(this,!0);return;case 4:end(this,0);return;case 5:this.b=0,enh(this,1);return;case 8:eu2(this,null);return;case 9:(n=ew3(this,null,null))&&n.Fi();return;case 10:elF(this,!0);return;case 11:elU(this,!1);return;case 12:elY(this,!1);return;case 13:this.i=null,erA(this,null);return;case 15:elB(this,!1);return;case 16:elZ(this,!1);return;case 18:elX(this,!1);return}ec5(this,e-Y1((eBK(),tgw)),ee2((t=Pp(eaS(this,16),26))||tgw,e))},eUe.Gh=function(){eoe(this),UH(QZ((eSp(),tvc),this)),evl(this),this.Bb|=1},eUe.$j=function(){return ek7(this)},eUe.nk=function(e,t){return this.b=0,this.a=null,ecz(this,e,t)},eUe.ok=function(e){yg(this,e)},eUe.Ib=function(){var e;return(64&this.Db)!=0?eCR(this):(e=new O1(eCR(this)),e.a+=" (iD: ",yG(e,(this.Bb&eZ1)!=0),e.a+=")",e.a)},eUe.b=0,Y6(eZ2,"EAttributeImpl",322),eTS(351,438,{105:1,92:1,90:1,138:1,147:1,191:1,56:1,108:1,49:1,97:1,351:1,150:1,114:1,115:1,676:1}),eUe.uk=function(e){return e.Tg()==this},eUe.Qg=function(e){return egn(this,e)},eUe.Rg=function(e,t){this.w=null,this.Db=t<<16|255&this.Db,this.Cb=e},eUe._g=function(e,t,n){var r;switch(e){case 0:return this.Ab||(this.Ab=new FQ(tm4,this,0,3)),this.Ab;case 1:return this.zb;case 2:return null!=this.D?this.D:this.B;case 3:return em4(this);case 4:return this.zj();case 5:return this.F;case 6:if(t)return etP(this);return z6(this);case 7:return this.A||(this.A=new OS(tgs,this,7)),this.A}return Qt(this,e-Y1(this.zh()),ee2((r=Pp(eaS(this,16),26))||this.zh(),e),t,n)},eUe.hh=function(e,t,n){var r,i,a;switch(t){case 0:return this.Ab||(this.Ab=new FQ(tm4,this,0,3)),edF(this.Ab,e,n);case 6:return this.Cb&&(n=(i=this.Db>>16)>=0?egn(this,n):this.Cb.ih(this,-1-i,null,n)),eDg(this,e,6,n)}return(a=Pp(ee2((r=Pp(eaS(this,16),26))||this.zh(),t),66)).Nj().Qj(this,ehH(this),t-Y1(this.zh()),e,n)},eUe.jh=function(e,t,n){var r,i;switch(t){case 0:return this.Ab||(this.Ab=new FQ(tm4,this,0,3)),ep5(this.Ab,e,n);case 6:return eDg(this,null,6,n);case 7:return this.A||(this.A=new OS(tgs,this,7)),ep5(this.A,e,n)}return(i=Pp(ee2((r=Pp(eaS(this,16),26))||this.zh(),t),66)).Nj().Rj(this,ehH(this),t-Y1(this.zh()),e,n)},eUe.lh=function(e){var t;switch(e){case 0:return!!this.Ab&&0!=this.Ab.i;case 1:return null!=this.zb;case 2:return null!=this.D&&this.D==this.F;case 3:return!!em4(this);case 4:return null!=this.zj();case 5:return null!=this.F&&this.F!=this.D&&this.F!=this.B;case 6:return!!z6(this);case 7:return!!this.A&&0!=this.A.i}return VP(this,e-Y1(this.zh()),ee2((t=Pp(eaS(this,16),26))||this.zh(),e))},eUe.sh=function(e,t){var n;switch(e){case 0:this.Ab||(this.Ab=new FQ(tm4,this,0,3)),eRT(this.Ab),this.Ab||(this.Ab=new FQ(tm4,this,0,3)),Y4(this.Ab,Pp(t,14));return;case 1:GN(this,Lq(t));return;case 2:TF(this,Lq(t));return;case 5:eji(this,Lq(t));return;case 7:this.A||(this.A=new OS(tgs,this,7)),eRT(this.A),this.A||(this.A=new OS(tgs,this,7)),Y4(this.A,Pp(t,14));return}efL(this,e-Y1(this.zh()),ee2((n=Pp(eaS(this,16),26))||this.zh(),e),t)},eUe.zh=function(){return eBK(),tgE},eUe.Bh=function(e){var t;switch(e){case 0:this.Ab||(this.Ab=new FQ(tm4,this,0,3)),eRT(this.Ab);return;case 1:M4(this.Cb,179)&&(Pp(this.Cb,179).tb=null),er3(this,null);return;case 2:euc(this,null),enp(this,this.D);return;case 5:eji(this,null);return;case 7:this.A||(this.A=new OS(tgs,this,7)),eRT(this.A);return}ec5(this,e-Y1(this.zh()),ee2((t=Pp(eaS(this,16),26))||this.zh(),e))},eUe.yj=function(){var e;return -1==this.G&&(this.G=(e=etP(this))?ebv(e.Mh(),this):-1),this.G},eUe.zj=function(){return null},eUe.Aj=function(){return etP(this)},eUe.vk=function(){return this.v},eUe.Bj=function(){return em4(this)},eUe.Cj=function(){return null!=this.D?this.D:this.B},eUe.Dj=function(){return this.F},eUe.wj=function(e){return eNc(this,e)},eUe.wk=function(e){this.v=e},eUe.xk=function(e){eia(this,e)},eUe.yk=function(e){this.C=e},eUe.Lh=function(e){GN(this,e)},eUe.Ib=function(){return edb(this)},eUe.C=null,eUe.D=null,eUe.G=-1,Y6(eZ2,"EClassifierImpl",351),eTS(88,351,{105:1,92:1,90:1,26:1,138:1,147:1,191:1,56:1,108:1,49:1,97:1,88:1,351:1,150:1,473:1,114:1,115:1,676:1},c0),eUe.uk=function(e){return C7(this,e.Tg())},eUe._g=function(e,t,n){var r;switch(e){case 0:return this.Ab||(this.Ab=new FQ(tm4,this,0,3)),this.Ab;case 1:return this.zb;case 2:return null!=this.D?this.D:this.B;case 3:return em4(this);case 4:return null;case 5:return this.F;case 6:if(t)return etP(this);return z6(this);case 7:return this.A||(this.A=new OS(tgs,this,7)),this.A;case 8:return OQ(),(256&this.Bb)!=0;case 9:return OQ(),(512&this.Bb)!=0;case 10:return $E(this);case 11:return this.q||(this.q=new FQ(tgi,this,11,10)),this.q;case 12:return ePk(this);case 13:return ePl(this);case 14:return ePl(this),this.r;case 15:return ePk(this),this.k;case 16:return eSD(this);case 17:return eNQ(this);case 18:return eNT(this);case 19:return eOg(this);case 20:return ePk(this),this.o;case 21:return this.s||(this.s=new FQ(tm5,this,21,17)),this.s;case 22:return qt(this);case 23:return eCt(this)}return Qt(this,e-Y1((eBK(),tg_)),ee2((r=Pp(eaS(this,16),26))||tg_,e),t,n)},eUe.hh=function(e,t,n){var r,i,a;switch(t){case 0:return this.Ab||(this.Ab=new FQ(tm4,this,0,3)),edF(this.Ab,e,n);case 6:return this.Cb&&(n=(i=this.Db>>16)>=0?egn(this,n):this.Cb.ih(this,-1-i,null,n)),eDg(this,e,6,n);case 11:return this.q||(this.q=new FQ(tgi,this,11,10)),edF(this.q,e,n);case 21:return this.s||(this.s=new FQ(tm5,this,21,17)),edF(this.s,e,n)}return(a=Pp(ee2((r=Pp(eaS(this,16),26))||(eBK(),tg_),t),66)).Nj().Qj(this,ehH(this),t-Y1((eBK(),tg_)),e,n)},eUe.jh=function(e,t,n){var r,i;switch(t){case 0:return this.Ab||(this.Ab=new FQ(tm4,this,0,3)),ep5(this.Ab,e,n);case 6:return eDg(this,null,6,n);case 7:return this.A||(this.A=new OS(tgs,this,7)),ep5(this.A,e,n);case 11:return this.q||(this.q=new FQ(tgi,this,11,10)),ep5(this.q,e,n);case 21:return this.s||(this.s=new FQ(tm5,this,21,17)),ep5(this.s,e,n);case 22:return ep5(qt(this),e,n)}return(i=Pp(ee2((r=Pp(eaS(this,16),26))||(eBK(),tg_),t),66)).Nj().Rj(this,ehH(this),t-Y1((eBK(),tg_)),e,n)},eUe.lh=function(e){var t;switch(e){case 0:return!!this.Ab&&0!=this.Ab.i;case 1:return null!=this.zb;case 2:return null!=this.D&&this.D==this.F;case 3:return!!em4(this);case 4:return!1;case 5:return null!=this.F&&this.F!=this.D&&this.F!=this.B;case 6:return!!z6(this);case 7:return!!this.A&&0!=this.A.i;case 8:return(256&this.Bb)!=0;case 9:return(512&this.Bb)!=0;case 10:return!!this.u&&0!=qt(this.u.a).i&&!(this.n&&ebV(this.n));case 11:return!!this.q&&0!=this.q.i;case 12:return 0!=ePk(this).i;case 13:return 0!=ePl(this).i;case 14:return ePl(this),0!=this.r.i;case 15:return ePk(this),0!=this.k.i;case 16:return 0!=eSD(this).i;case 17:return 0!=eNQ(this).i;case 18:return 0!=eNT(this).i;case 19:return 0!=eOg(this).i;case 20:return ePk(this),!!this.o;case 21:return!!this.s&&0!=this.s.i;case 22:return!!this.n&&ebV(this.n);case 23:return 0!=eCt(this).i}return VP(this,e-Y1((eBK(),tg_)),ee2((t=Pp(eaS(this,16),26))||tg_,e))},eUe.oh=function(e){var t;return(t=null==this.i||this.q&&0!=this.q.i?null:eAh(this,e))||eF8(this,e)},eUe.sh=function(e,t){var n;switch(e){case 0:this.Ab||(this.Ab=new FQ(tm4,this,0,3)),eRT(this.Ab),this.Ab||(this.Ab=new FQ(tm4,this,0,3)),Y4(this.Ab,Pp(t,14));return;case 1:GN(this,Lq(t));return;case 2:TF(this,Lq(t));return;case 5:eji(this,Lq(t));return;case 7:this.A||(this.A=new OS(tgs,this,7)),eRT(this.A),this.A||(this.A=new OS(tgs,this,7)),Y4(this.A,Pp(t,14));return;case 8:ela(this,gN(LK(t)));return;case 9:elu(this,gN(LK(t)));return;case 10:eRP($E(this)),Y4($E(this),Pp(t,14));return;case 11:this.q||(this.q=new FQ(tgi,this,11,10)),eRT(this.q),this.q||(this.q=new FQ(tgi,this,11,10)),Y4(this.q,Pp(t,14));return;case 21:this.s||(this.s=new FQ(tm5,this,21,17)),eRT(this.s),this.s||(this.s=new FQ(tm5,this,21,17)),Y4(this.s,Pp(t,14));return;case 22:eRT(qt(this)),Y4(qt(this),Pp(t,14));return}efL(this,e-Y1((eBK(),tg_)),ee2((n=Pp(eaS(this,16),26))||tg_,e),t)},eUe.zh=function(){return eBK(),tg_},eUe.Bh=function(e){var t;switch(e){case 0:this.Ab||(this.Ab=new FQ(tm4,this,0,3)),eRT(this.Ab);return;case 1:M4(this.Cb,179)&&(Pp(this.Cb,179).tb=null),er3(this,null);return;case 2:euc(this,null),enp(this,this.D);return;case 5:eji(this,null);return;case 7:this.A||(this.A=new OS(tgs,this,7)),eRT(this.A);return;case 8:ela(this,!1);return;case 9:elu(this,!1);return;case 10:this.u&&eRP(this.u);return;case 11:this.q||(this.q=new FQ(tgi,this,11,10)),eRT(this.q);return;case 21:this.s||(this.s=new FQ(tm5,this,21,17)),eRT(this.s);return;case 22:this.n&&eRT(this.n);return}ec5(this,e-Y1((eBK(),tg_)),ee2((t=Pp(eaS(this,16),26))||tg_,e))},eUe.Gh=function(){var e,t;if(ePk(this),ePl(this),eSD(this),eNQ(this),eNT(this),eOg(this),eCt(this),ZG(Pw(Zd(this))),this.s)for(e=0,t=this.s.i;e=0;--t)etj(this,t);return edj(this,e)},eUe.Xj=function(){eRT(this)},eUe.oi=function(e,t){return env(this,e,t)},Y6(eJz,"EcoreEList",622),eTS(496,622,eJ8,PK),eUe.ai=function(){return!1},eUe.aj=function(){return this.c},eUe.bj=function(){return!1},eUe.Fk=function(){return!0},eUe.hi=function(){return!0},eUe.li=function(e,t){return t},eUe.ni=function(){return!1},eUe.c=0,Y6(eJz,"EObjectEList",496),eTS(85,496,eJ8,O_),eUe.bj=function(){return!0},eUe.Dk=function(){return!1},eUe.rk=function(){return!0},Y6(eJz,"EObjectContainmentEList",85),eTS(545,85,eJ8,OE),eUe.ci=function(){this.b=!0},eUe.fj=function(){return this.b},eUe.Xj=function(){var e;eRT(this),TO(this.e)?(e=this.b,this.b=!1,eam(this.e,new ZB(this.e,2,this.c,e,!1))):this.b=!1},eUe.b=!1,Y6(eJz,"EObjectContainmentEList/Unsettable",545),eTS(1140,545,eJ8,j4),eUe.ii=function(e,t){var n,r;return n=Pp(elR(this,e,t),87),TO(this.e)&&bz(this,new JU(this.a,7,(eBK(),tgS),ell(t),M4(r=n.c,88)?Pp(r,26):tgI,e)),n},eUe.jj=function(e,t){return edB(this,Pp(e,87),t)},eUe.kj=function(e,t){return edY(this,Pp(e,87),t)},eUe.lj=function(e,t,n){return eyl(this,Pp(e,87),Pp(t,87),n)},eUe.Zi=function(e,t,n,r,i){switch(e){case 3:return Gt(this,e,t,n,r,this.i>1);case 5:return Gt(this,e,t,n,r,this.i-Pp(n,15).gc()>0);default:return new Q$(this.e,e,this.c,t,n,r,!0)}},eUe.ij=function(){return!0},eUe.fj=function(){return ebV(this)},eUe.Xj=function(){eRT(this)},Y6(eZ2,"EClassImpl/1",1140),eTS(1154,1153,eJS),eUe.ui=function(e){var t,n,r,i,a,o,s;if(8!=(n=e.xi())){if(0==(r=epM(e)))switch(n){case 1:case 9:null!=(s=e.Bi())&&((t=Zd(Pp(s,473))).c||(t.c=new sk),eeu(t.c,e.Ai())),null!=(o=e.zi())&&(1&(i=Pp(o,473)).Bb)==0&&((t=Zd(i)).c||(t.c=new sk),JL(t.c,Pp(e.Ai(),26)));break;case 3:null!=(o=e.zi())&&(1&(i=Pp(o,473)).Bb)==0&&((t=Zd(i)).c||(t.c=new sk),JL(t.c,Pp(e.Ai(),26)));break;case 5:if(null!=(o=e.zi()))for(a=Pp(o,14).Kc();a.Ob();)(1&(i=Pp(a.Pb(),473)).Bb)==0&&((t=Zd(i)).c||(t.c=new sk),JL(t.c,Pp(e.Ai(),26)));break;case 4:null!=(s=e.Bi())&&(1&(i=Pp(s,473)).Bb)==0&&((t=Zd(i)).c||(t.c=new sk),eeu(t.c,e.Ai()));break;case 6:if(null!=(s=e.Bi()))for(a=Pp(s,14).Kc();a.Ob();)(1&(i=Pp(a.Pb(),473)).Bb)==0&&((t=Zd(i)).c||(t.c=new sk),eeu(t.c,e.Ai()))}this.Hk(r)}},eUe.Hk=function(e){eCO(this,e)},eUe.b=63,Y6(eZ2,"ESuperAdapter",1154),eTS(1155,1154,eJS,pR),eUe.Hk=function(e){eko(this,e)},Y6(eZ2,"EClassImpl/10",1155),eTS(1144,696,eJ8),eUe.Vh=function(e,t){return ew2(this,e,t)},eUe.Wh=function(e){return emp(this,e)},eUe.Xh=function(e,t){ecW(this,e,t)},eUe.Yh=function(e){Zz(this,e)},eUe.pi=function(e){return J6(this,e)},eUe.mi=function(e,t){return ees(this,e,t)},eUe.lk=function(e,t){throw p7(new bO)},eUe.Zh=function(){return new AY(this)},eUe.$h=function(){return new AB(this)},eUe._h=function(e){return enH(this,e)},eUe.mk=function(e,t){throw p7(new bO)},eUe.Wj=function(e){return this},eUe.fj=function(){return 0!=this.i},eUe.Wb=function(e){throw p7(new bO)},eUe.Xj=function(){throw p7(new bO)},Y6(eJz,"EcoreEList/UnmodifiableEList",1144),eTS(319,1144,eJ8,xQ),eUe.ni=function(){return!1},Y6(eJz,"EcoreEList/UnmodifiableEList/FastCompare",319),eTS(1147,319,eJ8,eo9),eUe.Xc=function(e){var t,n,r;if(M4(e,170)&&-1!=(n=(t=Pp(e,170)).aj())){for(r=this.i;n4){if(!this.wj(e))return!1;if(this.rk()){if(s=(n=(r=Pp(e,49)).Ug())==this.b&&(this.Dk()?r.Og(r.Vg(),Pp(ee2($S(this.b),this.aj()).Yj(),26).Bj())==ebY(Pp(ee2($S(this.b),this.aj()),18)).n:-1-r.Vg()==this.aj()),this.Ek()&&!s&&!n&&r.Zg()){for(i=0;i1||-1==r)},eUe.Dk=function(){var e,t,n;return t=ee2($S(this.b),this.aj()),!!M4(t,99)&&!!(n=ebY(e=Pp(t,18)))},eUe.Ek=function(){var e,t;return t=ee2($S(this.b),this.aj()),!!M4(t,99)&&((e=Pp(t,18)).Bb&eH3)!=0},eUe.Xc=function(e){var t,n,r,i;if((r=this.Qi(e))>=0)return r;if(this.Fk()){for(n=0,i=this.Vi();n=0;--e)ejc(this,e,this.Oi(e));return this.Wi()},eUe.Qc=function(e){var t;if(this.Ek())for(t=this.Vi()-1;t>=0;--t)ejc(this,t,this.Oi(t));return this.Xi(e)},eUe.Xj=function(){eRP(this)},eUe.oi=function(e,t){return J5(this,e,t)},Y6(eJz,"DelegatingEcoreEList",742),eTS(1150,742,eQn,Cw),eUe.Hi=function(e,t){LP(this,e,Pp(t,26))},eUe.Ii=function(e){Mt(this,Pp(e,26))},eUe.Oi=function(e){var t,n;return n=(t=Pp(etj(qt(this.a),e),87)).c,M4(n,88)?Pp(n,26):(eBK(),tgI)},eUe.Ti=function(e){var t,n;return n=(t=Pp(eLN(qt(this.a),e),87)).c,M4(n,88)?Pp(n,26):(eBK(),tgI)},eUe.Ui=function(e,t){return emm(this,e,Pp(t,26))},eUe.ai=function(){return!1},eUe.Zi=function(e,t,n,r,i){return null},eUe.Ji=function(){return new pF(this)},eUe.Ki=function(){eRT(qt(this.a))},eUe.Li=function(e){return ec7(this,e)},eUe.Mi=function(e){var t,n;for(n=e.Kc();n.Ob();)if(!ec7(this,t=n.Pb()))return!1;return!0},eUe.Ni=function(e){var t,n,r;if(M4(e,15)&&(r=Pp(e,15)).gc()==qt(this.a).i){for(t=r.Kc(),n=new Ow(this);t.Ob();)if(xc(t.Pb())!==xc(epH(n)))return!1;return!0}return!1},eUe.Pi=function(){var e,t,n,r,i;for(n=1,t=new Ow(qt(this.a));t.e!=t.i.gc();)e=Pp(epH(t),87),r=M4(i=e.c,88)?Pp(i,26):(eBK(),tgI),n=31*n+(r?Ao(r):0);return n},eUe.Qi=function(e){var t,n,r,i;for(r=0,n=new Ow(qt(this.a));n.e!=n.i.gc();){if(t=Pp(epH(n),87),xc(e)===xc(M4(i=t.c,88)?Pp(i,26):(eBK(),tgI)))return r;++r}return -1},eUe.Ri=function(){return 0==qt(this.a).i},eUe.Si=function(){return null},eUe.Vi=function(){return qt(this.a).i},eUe.Wi=function(){var e,t,n,r,i,a;for(a=qt(this.a).i,i=Je(e1R,eUp,1,a,5,1),n=0,t=new Ow(qt(this.a));t.e!=t.i.gc();)e=Pp(epH(t),87),i[n++]=M4(r=e.c,88)?Pp(r,26):(eBK(),tgI);return i},eUe.Xi=function(e){var t,n,r,i,a,o,s;for(s=qt(this.a).i,e.lengths&&Bc(e,s,null),r=0,n=new Ow(qt(this.a));n.e!=n.i.gc();)t=Pp(epH(n),87),a=M4(o=t.c,88)?Pp(o,26):(eBK(),tgI),Bc(e,r++,a);return e},eUe.Yi=function(){var e,t,n,r,i;for(i=new vs,i.a+="[",e=qt(this.a),t=0,r=qt(this.a).i;t>16)>=0?egn(this,n):this.Cb.ih(this,-1-i,null,n)),eDg(this,e,6,n);case 9:return this.a||(this.a=new FQ(tgn,this,9,5)),edF(this.a,e,n)}return(a=Pp(ee2((r=Pp(eaS(this,16),26))||(eBK(),tgx),t),66)).Nj().Qj(this,ehH(this),t-Y1((eBK(),tgx)),e,n)},eUe.jh=function(e,t,n){var r,i;switch(t){case 0:return this.Ab||(this.Ab=new FQ(tm4,this,0,3)),ep5(this.Ab,e,n);case 6:return eDg(this,null,6,n);case 7:return this.A||(this.A=new OS(tgs,this,7)),ep5(this.A,e,n);case 9:return this.a||(this.a=new FQ(tgn,this,9,5)),ep5(this.a,e,n)}return(i=Pp(ee2((r=Pp(eaS(this,16),26))||(eBK(),tgx),t),66)).Nj().Rj(this,ehH(this),t-Y1((eBK(),tgx)),e,n)},eUe.lh=function(e){var t;switch(e){case 0:return!!this.Ab&&0!=this.Ab.i;case 1:return null!=this.zb;case 2:return null!=this.D&&this.D==this.F;case 3:return!!em4(this);case 4:return!!euS(this);case 5:return null!=this.F&&this.F!=this.D&&this.F!=this.B;case 6:return!!z6(this);case 7:return!!this.A&&0!=this.A.i;case 8:return(256&this.Bb)==0;case 9:return!!this.a&&0!=this.a.i}return VP(this,e-Y1((eBK(),tgx)),ee2((t=Pp(eaS(this,16),26))||tgx,e))},eUe.sh=function(e,t){var n;switch(e){case 0:this.Ab||(this.Ab=new FQ(tm4,this,0,3)),eRT(this.Ab),this.Ab||(this.Ab=new FQ(tm4,this,0,3)),Y4(this.Ab,Pp(t,14));return;case 1:GN(this,Lq(t));return;case 2:TF(this,Lq(t));return;case 5:eji(this,Lq(t));return;case 7:this.A||(this.A=new OS(tgs,this,7)),eRT(this.A),this.A||(this.A=new OS(tgs,this,7)),Y4(this.A,Pp(t,14));return;case 8:elo(this,gN(LK(t)));return;case 9:this.a||(this.a=new FQ(tgn,this,9,5)),eRT(this.a),this.a||(this.a=new FQ(tgn,this,9,5)),Y4(this.a,Pp(t,14));return}efL(this,e-Y1((eBK(),tgx)),ee2((n=Pp(eaS(this,16),26))||tgx,e),t)},eUe.zh=function(){return eBK(),tgx},eUe.Bh=function(e){var t;switch(e){case 0:this.Ab||(this.Ab=new FQ(tm4,this,0,3)),eRT(this.Ab);return;case 1:M4(this.Cb,179)&&(Pp(this.Cb,179).tb=null),er3(this,null);return;case 2:euc(this,null),enp(this,this.D);return;case 5:eji(this,null);return;case 7:this.A||(this.A=new OS(tgs,this,7)),eRT(this.A);return;case 8:elo(this,!0);return;case 9:this.a||(this.a=new FQ(tgn,this,9,5)),eRT(this.a);return}ec5(this,e-Y1((eBK(),tgx)),ee2((t=Pp(eaS(this,16),26))||tgx,e))},eUe.Gh=function(){var e,t;if(this.a)for(e=0,t=this.a.i;e>16==5?Pp(this.Cb,671):null}return Qt(this,e-Y1((eBK(),tgT)),ee2((r=Pp(eaS(this,16),26))||tgT,e),t,n)},eUe.hh=function(e,t,n){var r,i,a;switch(t){case 0:return this.Ab||(this.Ab=new FQ(tm4,this,0,3)),edF(this.Ab,e,n);case 5:return this.Cb&&(n=(i=this.Db>>16)>=0?eg3(this,n):this.Cb.ih(this,-1-i,null,n)),eDg(this,e,5,n)}return(a=Pp(ee2((r=Pp(eaS(this,16),26))||(eBK(),tgT),t),66)).Nj().Qj(this,ehH(this),t-Y1((eBK(),tgT)),e,n)},eUe.jh=function(e,t,n){var r,i;switch(t){case 0:return this.Ab||(this.Ab=new FQ(tm4,this,0,3)),ep5(this.Ab,e,n);case 5:return eDg(this,null,5,n)}return(i=Pp(ee2((r=Pp(eaS(this,16),26))||(eBK(),tgT),t),66)).Nj().Rj(this,ehH(this),t-Y1((eBK(),tgT)),e,n)},eUe.lh=function(e){var t;switch(e){case 0:return!!this.Ab&&0!=this.Ab.i;case 1:return null!=this.zb;case 2:return 0!=this.d;case 3:return!!this.b;case 4:return null!=this.c;case 5:return!!(this.Db>>16==5?Pp(this.Cb,671):null)}return VP(this,e-Y1((eBK(),tgT)),ee2((t=Pp(eaS(this,16),26))||tgT,e))},eUe.sh=function(e,t){var n;switch(e){case 0:this.Ab||(this.Ab=new FQ(tm4,this,0,3)),eRT(this.Ab),this.Ab||(this.Ab=new FQ(tm4,this,0,3)),Y4(this.Ab,Pp(t,14));return;case 1:er3(this,Lq(t));return;case 2:enf(this,Pp(t,19).a);return;case 3:exP(this,Pp(t,1940));return;case 4:erc(this,Lq(t));return}efL(this,e-Y1((eBK(),tgT)),ee2((n=Pp(eaS(this,16),26))||tgT,e),t)},eUe.zh=function(){return eBK(),tgT},eUe.Bh=function(e){var t;switch(e){case 0:this.Ab||(this.Ab=new FQ(tm4,this,0,3)),eRT(this.Ab);return;case 1:er3(this,null);return;case 2:enf(this,0);return;case 3:exP(this,null);return;case 4:erc(this,null);return}ec5(this,e-Y1((eBK(),tgT)),ee2((t=Pp(eaS(this,16),26))||tgT,e))},eUe.Ib=function(){var e;return null==(e=this.c)?this.zb:e},eUe.b=null,eUe.c=null,eUe.d=0,Y6(eZ2,"EEnumLiteralImpl",573);var tgl=RL(eZ2,"EFactoryImpl/InternalEDateTimeFormat");eTS(489,1,{2015:1},pY),Y6(eZ2,"EFactoryImpl/1ClientInternalEDateTimeFormat",489),eTS(241,115,{105:1,92:1,90:1,87:1,56:1,108:1,49:1,97:1,241:1,114:1,115:1},p6),eUe.Sg=function(e,t,n){var r;return n=eDg(this,e,t,n),this.e&&M4(e,170)&&(r=eOl(this,this.e))!=this.c&&(n=eFr(this,r,n)),n},eUe._g=function(e,t,n){var r;switch(e){case 0:return this.f;case 1:return this.d||(this.d=new O_(tgr,this,1)),this.d;case 2:if(t)return eD6(this);return this.c;case 3:return this.b;case 4:return this.e;case 5:if(t)return eb1(this);return this.a}return Qt(this,e-Y1((eBK(),tgO)),ee2((r=Pp(eaS(this,16),26))||tgO,e),t,n)},eUe.jh=function(e,t,n){var r,i;switch(t){case 0:return ecg(this,null,n);case 1:return this.d||(this.d=new O_(tgr,this,1)),ep5(this.d,e,n);case 3:return ecm(this,null,n)}return(i=Pp(ee2((r=Pp(eaS(this,16),26))||(eBK(),tgO),t),66)).Nj().Rj(this,ehH(this),t-Y1((eBK(),tgO)),e,n)},eUe.lh=function(e){var t;switch(e){case 0:return!!this.f;case 1:return!!this.d&&0!=this.d.i;case 2:return!!this.c;case 3:return!!this.b;case 4:return!!this.e;case 5:return!!this.a}return VP(this,e-Y1((eBK(),tgO)),ee2((t=Pp(eaS(this,16),26))||tgO,e))},eUe.sh=function(e,t){var n;switch(e){case 0:eyK(this,Pp(t,87));return;case 1:this.d||(this.d=new O_(tgr,this,1)),eRT(this.d),this.d||(this.d=new O_(tgr,this,1)),Y4(this.d,Pp(t,14));return;case 3:eyW(this,Pp(t,87));return;case 4:e_U(this,Pp(t,836));return;case 5:etV(this,Pp(t,138));return}efL(this,e-Y1((eBK(),tgO)),ee2((n=Pp(eaS(this,16),26))||tgO,e),t)},eUe.zh=function(){return eBK(),tgO},eUe.Bh=function(e){var t;switch(e){case 0:eyK(this,null);return;case 1:this.d||(this.d=new O_(tgr,this,1)),eRT(this.d);return;case 3:eyW(this,null);return;case 4:e_U(this,null);return;case 5:etV(this,null);return}ec5(this,e-Y1((eBK(),tgO)),ee2((t=Pp(eaS(this,16),26))||tgO,e))},eUe.Ib=function(){var e;return e=new O0(eMT(this)),e.a+=" (expression: ",ePB(this,e),e.a+=")",e.a},Y6(eZ2,"EGenericTypeImpl",241),eTS(1969,1964,eQr),eUe.Xh=function(e,t){Ch(this,e,t)},eUe.lk=function(e,t){return Ch(this,this.gc(),e),t},eUe.pi=function(e){return ep3(this.Gi(),e)},eUe.Zh=function(){return this.$h()},eUe.Gi=function(){return new pV(this)},eUe.$h=function(){return this._h(0)},eUe._h=function(e){return this.Gi().Zc(e)},eUe.mk=function(e,t){return eds(this,e,!0),t},eUe.ii=function(e,t){var n,r;return r=egW(this,t),(n=this.Zc(e)).Rb(r),r},eUe.ji=function(e,t){var n;eds(this,t,!0),(n=this.Zc(e)).Rb(t)},Y6(eJz,"AbstractSequentialInternalEList",1969),eTS(486,1969,eQr,AA),eUe.pi=function(e){return ep3(this.Gi(),e)},eUe.Zh=function(){return null==this.b?(_2(),_2(),tgq):this.Jk()},eUe.Gi=function(){return new x0(this.a,this.b)},eUe.$h=function(){return null==this.b?(_2(),_2(),tgq):this.Jk()},eUe._h=function(e){var t,n;if(null==this.b){if(e<0||e>1)throw p7(new gE(eJT+e+", size=0"));return _2(),_2(),tgq}for(t=0,n=this.Jk();t0;)if(t=this.c[--this.d],(!this.e||t.Gj()!=e5d||0!=t.aj())&&(!this.Mk()||this.b.mh(t))){if(a=this.b.bh(t,this.Lk()),this.f=(_4(),Pp(t,66).Oj()),this.f||t.$j()){if(this.Lk()?(r=Pp(a,15),this.k=r):(r=Pp(a,69),this.k=this.j=r),M4(this.k,54)?(this.o=this.k.gc(),this.n=this.o):this.p=this.j?this.j._h(this.k.gc()):this.k.Zc(this.k.gc()),this.p?eSs(this,this.p):eSQ(this))return i=this.p?this.p.Ub():this.j?this.j.pi(--this.n):this.k.Xb(--this.n),this.f?((e=Pp(i,72)).ak(),n=e.dd(),this.i=n):(n=i,this.i=n),this.g=-3,!0}else if(null!=a)return this.k=null,this.p=null,n=a,this.i=n,this.g=-2,!0}return this.k=null,this.p=null,this.g=-1,!1}},eUe.Pb=function(){return eaO(this)},eUe.Tb=function(){return this.a},eUe.Ub=function(){var e;if(this.g<-1||this.Sb())return--this.a,this.g=0,e=this.i,this.Sb(),e;throw p7(new bC)},eUe.Vb=function(){return this.a-1},eUe.Qb=function(){throw p7(new bO)},eUe.Lk=function(){return!1},eUe.Wb=function(e){throw p7(new bO)},eUe.Mk=function(){return!0},eUe.a=0,eUe.d=0,eUe.f=!1,eUe.g=0,eUe.n=0,eUe.o=0,Y6(eJz,"EContentsEList/FeatureIteratorImpl",279),eTS(697,279,eQi,Lv),eUe.Lk=function(){return!0},Y6(eJz,"EContentsEList/ResolvingFeatureIteratorImpl",697),eTS(1157,697,eQi,Lw),eUe.Mk=function(){return!1},Y6(eZ2,"ENamedElementImpl/1/1",1157),eTS(1158,279,eQi,Ly),eUe.Mk=function(){return!1},Y6(eZ2,"ENamedElementImpl/1/2",1158),eTS(36,143,eJx,qo,qs,FX,JB,Q$,ZB,en_,WX,enE,WJ,Zj,WQ,enx,W1,ZF,W0,enS,W2,FJ,JU,H0,enk,W3,ZY,W4),eUe._i=function(){return JA(this)},eUe.gj=function(){var e;return(e=JA(this))?e.zj():null},eUe.yi=function(e){return -1==this.b&&this.a&&(this.b=this.c.Xg(this.a.aj(),this.a.Gj())),this.c.Og(this.b,e)},eUe.Ai=function(){return this.c},eUe.hj=function(){var e;return!!(e=JA(this))&&e.Kj()},eUe.b=-1,Y6(eZ2,"ENotificationImpl",36),eTS(399,284,{105:1,92:1,90:1,147:1,191:1,56:1,59:1,108:1,472:1,49:1,97:1,150:1,399:1,284:1,114:1,115:1},mD),eUe.Qg=function(e){return evu(this,e)},eUe._g=function(e,t,n){var r,i,a;switch(e){case 0:return this.Ab||(this.Ab=new FQ(tm4,this,0,3)),this.Ab;case 1:return this.zb;case 2:return OQ(),(256&this.Bb)!=0;case 3:return OQ(),(512&this.Bb)!=0;case 4:return ell(this.s);case 5:return ell(this.t);case 6:return OQ(),(a=this.t)>1||-1==a;case 7:return OQ(),(i=this.s)>=1;case 8:if(t)return evl(this);return this.r;case 9:return this.q;case 10:return this.Db>>16==10?Pp(this.Cb,26):null;case 11:return this.d||(this.d=new OS(tgs,this,11)),this.d;case 12:return this.c||(this.c=new FQ(tga,this,12,10)),this.c;case 13:return this.a||(this.a=new C_(this,this)),this.a;case 14:return QX(this)}return Qt(this,e-Y1((eBK(),tgD)),ee2((r=Pp(eaS(this,16),26))||tgD,e),t,n)},eUe.hh=function(e,t,n){var r,i,a;switch(t){case 0:return this.Ab||(this.Ab=new FQ(tm4,this,0,3)),edF(this.Ab,e,n);case 10:return this.Cb&&(n=(i=this.Db>>16)>=0?evu(this,n):this.Cb.ih(this,-1-i,null,n)),eDg(this,e,10,n);case 12:return this.c||(this.c=new FQ(tga,this,12,10)),edF(this.c,e,n)}return(a=Pp(ee2((r=Pp(eaS(this,16),26))||(eBK(),tgD),t),66)).Nj().Qj(this,ehH(this),t-Y1((eBK(),tgD)),e,n)},eUe.jh=function(e,t,n){var r,i;switch(t){case 0:return this.Ab||(this.Ab=new FQ(tm4,this,0,3)),ep5(this.Ab,e,n);case 9:return Y3(this,n);case 10:return eDg(this,null,10,n);case 11:return this.d||(this.d=new OS(tgs,this,11)),ep5(this.d,e,n);case 12:return this.c||(this.c=new FQ(tga,this,12,10)),ep5(this.c,e,n);case 14:return ep5(QX(this),e,n)}return(i=Pp(ee2((r=Pp(eaS(this,16),26))||(eBK(),tgD),t),66)).Nj().Rj(this,ehH(this),t-Y1((eBK(),tgD)),e,n)},eUe.lh=function(e){var t,n,r;switch(e){case 0:return!!this.Ab&&0!=this.Ab.i;case 1:return null!=this.zb;case 2:return(256&this.Bb)==0;case 3:return(512&this.Bb)==0;case 4:return 0!=this.s;case 5:return 1!=this.t;case 6:return(r=this.t)>1||-1==r;case 7:return(n=this.s)>=1;case 8:return!!this.r&&!this.q.e&&0==BX(this.q).i;case 9:return!!this.q&&!(this.r&&!this.q.e&&0==BX(this.q).i);case 10:return!!(this.Db>>16==10?Pp(this.Cb,26):null);case 11:return!!this.d&&0!=this.d.i;case 12:return!!this.c&&0!=this.c.i;case 13:return!!this.a&&0!=QX(this.a.a).i&&!(this.b&&ebq(this.b));case 14:return!!this.b&&ebq(this.b)}return VP(this,e-Y1((eBK(),tgD)),ee2((t=Pp(eaS(this,16),26))||tgD,e))},eUe.sh=function(e,t){var n,r;switch(e){case 0:this.Ab||(this.Ab=new FQ(tm4,this,0,3)),eRT(this.Ab),this.Ab||(this.Ab=new FQ(tm4,this,0,3)),Y4(this.Ab,Pp(t,14));return;case 1:er3(this,Lq(t));return;case 2:eli(this,gN(LK(t)));return;case 3:els(this,gN(LK(t)));return;case 4:end(this,Pp(t,19).a);return;case 5:enh(this,Pp(t,19).a);return;case 8:eu2(this,Pp(t,138));return;case 9:(r=ew3(this,Pp(t,87),null))&&r.Fi();return;case 11:this.d||(this.d=new OS(tgs,this,11)),eRT(this.d),this.d||(this.d=new OS(tgs,this,11)),Y4(this.d,Pp(t,14));return;case 12:this.c||(this.c=new FQ(tga,this,12,10)),eRT(this.c),this.c||(this.c=new FQ(tga,this,12,10)),Y4(this.c,Pp(t,14));return;case 13:this.a||(this.a=new C_(this,this)),eRP(this.a),this.a||(this.a=new C_(this,this)),Y4(this.a,Pp(t,14));return;case 14:eRT(QX(this)),Y4(QX(this),Pp(t,14));return}efL(this,e-Y1((eBK(),tgD)),ee2((n=Pp(eaS(this,16),26))||tgD,e),t)},eUe.zh=function(){return eBK(),tgD},eUe.Bh=function(e){var t,n;switch(e){case 0:this.Ab||(this.Ab=new FQ(tm4,this,0,3)),eRT(this.Ab);return;case 1:er3(this,null);return;case 2:eli(this,!0);return;case 3:els(this,!0);return;case 4:end(this,0);return;case 5:enh(this,1);return;case 8:eu2(this,null);return;case 9:(n=ew3(this,null,null))&&n.Fi();return;case 11:this.d||(this.d=new OS(tgs,this,11)),eRT(this.d);return;case 12:this.c||(this.c=new FQ(tga,this,12,10)),eRT(this.c);return;case 13:this.a&&eRP(this.a);return;case 14:this.b&&eRT(this.b);return}ec5(this,e-Y1((eBK(),tgD)),ee2((t=Pp(eaS(this,16),26))||tgD,e))},eUe.Gh=function(){var e,t;if(this.c)for(e=0,t=this.c.i;es&&Bc(e,s,null),r=0,n=new Ow(QX(this.a));n.e!=n.i.gc();)a=(o=(t=Pp(epH(n),87)).c)||(eBK(),tgA),Bc(e,r++,a);return e},eUe.Yi=function(){var e,t,n,r,i;for(i=new vs,i.a+="[",e=QX(this.a),t=0,r=QX(this.a).i;t1);case 5:return Gt(this,e,t,n,r,this.i-Pp(n,15).gc()>0);default:return new Q$(this.e,e,this.c,t,n,r,!0)}},eUe.ij=function(){return!0},eUe.fj=function(){return ebq(this)},eUe.Xj=function(){eRT(this)},Y6(eZ2,"EOperationImpl/2",1341),eTS(498,1,{1938:1,498:1},k6),Y6(eZ2,"EPackageImpl/1",498),eTS(16,85,eJ8,FQ),eUe.zk=function(){return this.d},eUe.Ak=function(){return this.b},eUe.Dk=function(){return!0},eUe.b=0,Y6(eJz,"EObjectContainmentWithInverseEList",16),eTS(353,16,eJ8,Ia),eUe.Ek=function(){return!0},eUe.li=function(e,t){return ex7(this,e,Pp(t,56))},Y6(eJz,"EObjectContainmentWithInverseEList/Resolving",353),eTS(298,353,eJ8,Fq),eUe.ci=function(){this.a.tb=null},Y6(eZ2,"EPackageImpl/2",298),eTS(1228,1,{},sh),Y6(eZ2,"EPackageImpl/3",1228),eTS(718,43,e$s,mP),eUe._b=function(e){return xd(e)?$r(this,e):!!$I(this.f,e)},Y6(eZ2,"EPackageRegistryImpl",718),eTS(509,284,{105:1,92:1,90:1,147:1,191:1,56:1,2017:1,108:1,472:1,49:1,97:1,150:1,509:1,284:1,114:1,115:1},mN),eUe.Qg=function(e){return evc(this,e)},eUe._g=function(e,t,n){var r,i,a;switch(e){case 0:return this.Ab||(this.Ab=new FQ(tm4,this,0,3)),this.Ab;case 1:return this.zb;case 2:return OQ(),(256&this.Bb)!=0;case 3:return OQ(),(512&this.Bb)!=0;case 4:return ell(this.s);case 5:return ell(this.t);case 6:return OQ(),(a=this.t)>1||-1==a;case 7:return OQ(),(i=this.s)>=1;case 8:if(t)return evl(this);return this.r;case 9:return this.q;case 10:return this.Db>>16==10?Pp(this.Cb,59):null}return Qt(this,e-Y1((eBK(),tgR)),ee2((r=Pp(eaS(this,16),26))||tgR,e),t,n)},eUe.hh=function(e,t,n){var r,i,a;switch(t){case 0:return this.Ab||(this.Ab=new FQ(tm4,this,0,3)),edF(this.Ab,e,n);case 10:return this.Cb&&(n=(i=this.Db>>16)>=0?evc(this,n):this.Cb.ih(this,-1-i,null,n)),eDg(this,e,10,n)}return(a=Pp(ee2((r=Pp(eaS(this,16),26))||(eBK(),tgR),t),66)).Nj().Qj(this,ehH(this),t-Y1((eBK(),tgR)),e,n)},eUe.jh=function(e,t,n){var r,i;switch(t){case 0:return this.Ab||(this.Ab=new FQ(tm4,this,0,3)),ep5(this.Ab,e,n);case 9:return Y3(this,n);case 10:return eDg(this,null,10,n)}return(i=Pp(ee2((r=Pp(eaS(this,16),26))||(eBK(),tgR),t),66)).Nj().Rj(this,ehH(this),t-Y1((eBK(),tgR)),e,n)},eUe.lh=function(e){var t,n,r;switch(e){case 0:return!!this.Ab&&0!=this.Ab.i;case 1:return null!=this.zb;case 2:return(256&this.Bb)==0;case 3:return(512&this.Bb)==0;case 4:return 0!=this.s;case 5:return 1!=this.t;case 6:return(r=this.t)>1||-1==r;case 7:return(n=this.s)>=1;case 8:return!!this.r&&!this.q.e&&0==BX(this.q).i;case 9:return!!this.q&&!(this.r&&!this.q.e&&0==BX(this.q).i);case 10:return!!(this.Db>>16==10?Pp(this.Cb,59):null)}return VP(this,e-Y1((eBK(),tgR)),ee2((t=Pp(eaS(this,16),26))||tgR,e))},eUe.zh=function(){return eBK(),tgR},Y6(eZ2,"EParameterImpl",509),eTS(99,449,{105:1,92:1,90:1,147:1,191:1,56:1,18:1,170:1,66:1,108:1,472:1,49:1,97:1,150:1,99:1,449:1,284:1,114:1,115:1,677:1},LB),eUe._g=function(e,t,n){var r,i,a,o;switch(e){case 0:return this.Ab||(this.Ab=new FQ(tm4,this,0,3)),this.Ab;case 1:return this.zb;case 2:return OQ(),(256&this.Bb)!=0;case 3:return OQ(),(512&this.Bb)!=0;case 4:return ell(this.s);case 5:return ell(this.t);case 6:return OQ(),(o=this.t)>1||-1==o;case 7:return OQ(),(i=this.s)>=1;case 8:if(t)return evl(this);return this.r;case 9:return this.q;case 10:return OQ(),(this.Bb&eXt)!=0;case 11:return OQ(),(this.Bb&eJq)!=0;case 12:return OQ(),(this.Bb&eH0)!=0;case 13:return this.j;case 14:return eOI(this);case 15:return OQ(),(this.Bb&eJV)!=0;case 16:return OQ(),(this.Bb&eUR)!=0;case 17:return z5(this);case 18:return OQ(),(this.Bb&eZ1)!=0;case 19:return OQ(),!!(a=ebY(this))&&(a.Bb&eZ1)!=0;case 20:return OQ(),(this.Bb&eH3)!=0;case 21:if(t)return ebY(this);return this.b;case 22:if(t)return esd(this);return ZS(this);case 23:return this.a||(this.a=new OT(tm8,this,23)),this.a}return Qt(this,e-Y1((eBK(),tgj)),ee2((r=Pp(eaS(this,16),26))||tgj,e),t,n)},eUe.lh=function(e){var t,n,r,i;switch(e){case 0:return!!this.Ab&&0!=this.Ab.i;case 1:return null!=this.zb;case 2:return(256&this.Bb)==0;case 3:return(512&this.Bb)==0;case 4:return 0!=this.s;case 5:return 1!=this.t;case 6:return(i=this.t)>1||-1==i;case 7:return(n=this.s)>=1;case 8:return!!this.r&&!this.q.e&&0==BX(this.q).i;case 9:return!!this.q&&!(this.r&&!this.q.e&&0==BX(this.q).i);case 10:return(this.Bb&eXt)==0;case 11:return(this.Bb&eJq)!=0;case 12:return(this.Bb&eH0)!=0;case 13:return null!=this.j;case 14:return null!=eOI(this);case 15:return(this.Bb&eJV)!=0;case 16:return(this.Bb&eUR)!=0;case 17:return!!z5(this);case 18:return(this.Bb&eZ1)!=0;case 19:return!!(r=ebY(this))&&(r.Bb&eZ1)!=0;case 20:return(this.Bb&eH3)==0;case 21:return!!this.b;case 22:return!!ZS(this);case 23:return!!this.a&&0!=this.a.i}return VP(this,e-Y1((eBK(),tgj)),ee2((t=Pp(eaS(this,16),26))||tgj,e))},eUe.sh=function(e,t){var n,r;switch(e){case 0:this.Ab||(this.Ab=new FQ(tm4,this,0,3)),eRT(this.Ab),this.Ab||(this.Ab=new FQ(tm4,this,0,3)),Y4(this.Ab,Pp(t,14));return;case 1:GD(this,Lq(t));return;case 2:eli(this,gN(LK(t)));return;case 3:els(this,gN(LK(t)));return;case 4:end(this,Pp(t,19).a);return;case 5:enh(this,Pp(t,19).a);return;case 8:eu2(this,Pp(t,138));return;case 9:(r=ew3(this,Pp(t,87),null))&&r.Fi();return;case 10:elF(this,gN(LK(t)));return;case 11:elU(this,gN(LK(t)));return;case 12:elY(this,gN(LK(t)));return;case 13:xi(this,Lq(t));return;case 15:elB(this,gN(LK(t)));return;case 16:elZ(this,gN(LK(t)));return;case 18:GI(this,gN(LK(t)));return;case 20:elQ(this,gN(LK(t)));return;case 21:erM(this,Pp(t,18));return;case 23:this.a||(this.a=new OT(tm8,this,23)),eRT(this.a),this.a||(this.a=new OT(tm8,this,23)),Y4(this.a,Pp(t,14));return}efL(this,e-Y1((eBK(),tgj)),ee2((n=Pp(eaS(this,16),26))||tgj,e),t)},eUe.zh=function(){return eBK(),tgj},eUe.Bh=function(e){var t,n;switch(e){case 0:this.Ab||(this.Ab=new FQ(tm4,this,0,3)),eRT(this.Ab);return;case 1:M4(this.Cb,88)&&eko(Zd(Pp(this.Cb,88)),4),er3(this,null);return;case 2:eli(this,!0);return;case 3:els(this,!0);return;case 4:end(this,0);return;case 5:enh(this,1);return;case 8:eu2(this,null);return;case 9:(n=ew3(this,null,null))&&n.Fi();return;case 10:elF(this,!0);return;case 11:elU(this,!1);return;case 12:elY(this,!1);return;case 13:this.i=null,erA(this,null);return;case 15:elB(this,!1);return;case 16:elZ(this,!1);return;case 18:elJ(this,!1),M4(this.Cb,88)&&eko(Zd(Pp(this.Cb,88)),2);return;case 20:elQ(this,!0);return;case 21:erM(this,null);return;case 23:this.a||(this.a=new OT(tm8,this,23)),eRT(this.a);return}ec5(this,e-Y1((eBK(),tgj)),ee2((t=Pp(eaS(this,16),26))||tgj,e))},eUe.Gh=function(){esd(this),UH(QZ((eSp(),tvc),this)),evl(this),this.Bb|=1},eUe.Lj=function(){return ebY(this)},eUe.qk=function(){var e;return!!(e=ebY(this))&&(e.Bb&eZ1)!=0},eUe.rk=function(){return(this.Bb&eZ1)!=0},eUe.sk=function(){return(this.Bb&eH3)!=0},eUe.nk=function(e,t){return this.c=null,ecz(this,e,t)},eUe.Ib=function(){var e;return(64&this.Db)!=0?eCR(this):(e=new O1(eCR(this)),e.a+=" (containment: ",yG(e,(this.Bb&eZ1)!=0),e.a+=", resolveProxies: ",yG(e,(this.Bb&eH3)!=0),e.a+=")",e.a)},Y6(eZ2,"EReferenceImpl",99),eTS(548,115,{105:1,42:1,92:1,90:1,133:1,56:1,108:1,49:1,97:1,548:1,114:1,115:1},sp),eUe.Fb=function(e){return this===e},eUe.cd=function(){return this.b},eUe.dd=function(){return this.c},eUe.Hb=function(){return Ao(this)},eUe.Uh=function(e){RP(this,Lq(e))},eUe.ed=function(e){return P6(this,Lq(e))},eUe._g=function(e,t,n){var r;switch(e){case 0:return this.b;case 1:return this.c}return Qt(this,e-Y1((eBK(),tgF)),ee2((r=Pp(eaS(this,16),26))||tgF,e),t,n)},eUe.lh=function(e){var t;switch(e){case 0:return null!=this.b;case 1:return null!=this.c}return VP(this,e-Y1((eBK(),tgF)),ee2((t=Pp(eaS(this,16),26))||tgF,e))},eUe.sh=function(e,t){var n;switch(e){case 0:RR(this,Lq(t));return;case 1:ers(this,Lq(t));return}efL(this,e-Y1((eBK(),tgF)),ee2((n=Pp(eaS(this,16),26))||tgF,e),t)},eUe.zh=function(){return eBK(),tgF},eUe.Bh=function(e){var t;switch(e){case 0:ero(this,null);return;case 1:ers(this,null);return}ec5(this,e-Y1((eBK(),tgF)),ee2((t=Pp(eaS(this,16),26))||tgF,e))},eUe.Sh=function(){var e;return -1==this.a&&(e=this.b,this.a=null==e?0:ebA(e)),this.a},eUe.Th=function(e){this.a=e},eUe.Ib=function(){var e;return(64&this.Db)!=0?eMT(this):(e=new O1(eMT(this)),e.a+=" (key: ",xk(e,this.b),e.a+=", value: ",xk(e,this.c),e.a+=")",e.a)},eUe.a=-1,eUe.b=null,eUe.c=null;var tgf=Y6(eZ2,"EStringToStringMapEntryImpl",548),tgd=RL(eJz,"FeatureMap/Entry/Internal");eTS(565,1,eQa),eUe.Ok=function(e){return this.Pk(Pp(e,49))},eUe.Pk=function(e){return this.Ok(e)},eUe.Fb=function(e){var t,n;return this===e||!!M4(e,72)&&(t=Pp(e,72)).ak()==this.c&&(null==(n=this.dd())?null==t.dd():ecX(n,t.dd()))},eUe.ak=function(){return this.c},eUe.Hb=function(){var e;return e=this.dd(),esj(this.c)^(null==e?0:esj(e))},eUe.Ib=function(){var e,t;return t=etP((e=this.c).Hj()).Ph(),e.ne(),(null!=t&&0!=t.length?t+":"+e.ne():e.ne())+"="+this.dd()},Y6(eZ2,"EStructuralFeatureImpl/BasicFeatureMapEntry",565),eTS(776,565,eQa,Cg),eUe.Pk=function(e){return new Cg(this.c,e)},eUe.dd=function(){return this.a},eUe.Qk=function(e,t,n){return eiY(this,e,this.a,t,n)},eUe.Rk=function(e,t,n){return eiB(this,e,this.a,t,n)},Y6(eZ2,"EStructuralFeatureImpl/ContainmentUpdatingFeatureMapEntry",776),eTS(1314,1,{},k5),eUe.Pj=function(e,t,n,r,i){var a;return(a=Pp(JG(e,this.b),215)).nl(this.a).Wj(r)},eUe.Qj=function(e,t,n,r,i){var a;return(a=Pp(JG(e,this.b),215)).el(this.a,r,i)},eUe.Rj=function(e,t,n,r,i){var a;return(a=Pp(JG(e,this.b),215)).fl(this.a,r,i)},eUe.Sj=function(e,t,n){var r;return(r=Pp(JG(e,this.b),215)).nl(this.a).fj()},eUe.Tj=function(e,t,n,r){var i;(i=Pp(JG(e,this.b),215)).nl(this.a).Wb(r)},eUe.Uj=function(e,t,n){return Pp(JG(e,this.b),215).nl(this.a)},eUe.Vj=function(e,t,n){var r;(r=Pp(JG(e,this.b),215)).nl(this.a).Xj()},Y6(eZ2,"EStructuralFeatureImpl/InternalSettingDelegateFeatureMapDelegator",1314),eTS(89,1,{},Pe,HS,$F,qc),eUe.Pj=function(e,t,n,r,i){var a;if(null==(a=t.Ch(n))&&t.Dh(n,a=eBN(this,e)),!i)switch(this.e){case 50:case 41:return Pp(a,589).sj();case 40:return Pp(a,215).kl()}return a},eUe.Qj=function(e,t,n,r,i){var a,o;return null==(o=t.Ch(n))&&t.Dh(n,o=eBN(this,e)),a=Pp(o,69).lk(r,i)},eUe.Rj=function(e,t,n,r,i){var a;return null!=(a=t.Ch(n))&&(i=Pp(a,69).mk(r,i)),i},eUe.Sj=function(e,t,n){var r;return null!=(r=t.Ch(n))&&Pp(r,76).fj()},eUe.Tj=function(e,t,n,r){var i;(i=Pp(t.Ch(n),76))||t.Dh(n,i=eBN(this,e)),i.Wb(r)},eUe.Uj=function(e,t,n){var r,i;return(null==(i=t.Ch(n))&&t.Dh(n,i=eBN(this,e)),M4(i,76))?Pp(i,76):(r=Pp(t.Ch(n),15),new pz(r))},eUe.Vj=function(e,t,n){var r;(r=Pp(t.Ch(n),76))||t.Dh(n,r=eBN(this,e)),r.Xj()},eUe.b=0,eUe.e=0,Y6(eZ2,"EStructuralFeatureImpl/InternalSettingDelegateMany",89),eTS(504,1,{}),eUe.Qj=function(e,t,n,r,i){throw p7(new bO)},eUe.Rj=function(e,t,n,r,i){throw p7(new bO)},eUe.Uj=function(e,t,n){return new Hk(this,e,t,n)},Y6(eZ2,"EStructuralFeatureImpl/InternalSettingDelegateSingle",504),eTS(1331,1,eJG,Hk),eUe.Wj=function(e){return this.a.Pj(this.c,this.d,this.b,e,!0)},eUe.fj=function(){return this.a.Sj(this.c,this.d,this.b)},eUe.Wb=function(e){this.a.Tj(this.c,this.d,this.b,e)},eUe.Xj=function(){this.a.Vj(this.c,this.d,this.b)},eUe.b=0,Y6(eZ2,"EStructuralFeatureImpl/InternalSettingDelegateSingle/1",1331),eTS(769,504,{},zl),eUe.Pj=function(e,t,n,r,i){return eIy(e,e.eh(),e.Vg())==this.b?this.sk()&&r?eTp(e):e.eh():null},eUe.Qj=function(e,t,n,r,i){var a,o;return e.eh()&&(i=(a=e.Vg())>=0?e.Qg(i):e.eh().ih(e,-1-a,null,i)),o=edv(e.Tg(),this.e),e.Sg(r,o,i)},eUe.Rj=function(e,t,n,r,i){var a;return a=edv(e.Tg(),this.e),e.Sg(null,a,i)},eUe.Sj=function(e,t,n){var r;return r=edv(e.Tg(),this.e),!!e.eh()&&e.Vg()==r},eUe.Tj=function(e,t,n,r){var i,a,o,s,u;if(null!=r&&!eNc(this.a,r))throw p7(new gA(eQo+(M4(r,56)?eyB(Pp(r,56).Tg()):ee5(esF(r)))+eQs+this.a+"'"));if(i=e.eh(),o=edv(e.Tg(),this.e),xc(r)!==xc(i)||e.Vg()!=o&&null!=r){if(eg7(e,Pp(r,56)))throw p7(new gL(eZ4+e.Ib()));u=null,i&&(u=(a=e.Vg())>=0?e.Qg(u):e.eh().ih(e,-1-a,null,u)),(s=Pp(r,49))&&(u=s.gh(e,edv(s.Tg(),this.b),null,u)),(u=e.Sg(s,o,u))&&u.Fi()}else e.Lg()&&e.Mg()&&eam(e,new FX(e,1,o,r,r))},eUe.Vj=function(e,t,n){var r,i,a,o;(r=e.eh())?(o=(i=e.Vg())>=0?e.Qg(null):e.eh().ih(e,-1-i,null,null),a=edv(e.Tg(),this.e),(o=e.Sg(null,a,o))&&o.Fi()):e.Lg()&&e.Mg()&&eam(e,new FJ(e,1,this.e,null,null))},eUe.sk=function(){return!1},Y6(eZ2,"EStructuralFeatureImpl/InternalSettingDelegateSingleContainer",769),eTS(1315,769,{},Pt),eUe.sk=function(){return!0},Y6(eZ2,"EStructuralFeatureImpl/InternalSettingDelegateSingleContainerResolving",1315),eTS(563,504,{}),eUe.Pj=function(e,t,n,r,i){var a;return null==(a=t.Ch(n))?this.b:xc(a)===xc(tgZ)?null:a},eUe.Sj=function(e,t,n){var r;return null!=(r=t.Ch(n))&&(xc(r)===xc(tgZ)||!ecX(r,this.b))},eUe.Tj=function(e,t,n,r){var i,a;e.Lg()&&e.Mg()?(i=null==(a=t.Ch(n))?this.b:xc(a)===xc(tgZ)?null:a,null==r?null!=this.c?(t.Dh(n,null),r=this.b):null!=this.b?t.Dh(n,tgZ):t.Dh(n,null):(this.Sk(r),t.Dh(n,r)),eam(e,this.d.Tk(e,1,this.e,i,r))):null==r?null!=this.c?t.Dh(n,null):null!=this.b?t.Dh(n,tgZ):t.Dh(n,null):(this.Sk(r),t.Dh(n,r))},eUe.Vj=function(e,t,n){var r,i;e.Lg()&&e.Mg()?(r=null==(i=t.Ch(n))?this.b:xc(i)===xc(tgZ)?null:i,t.Eh(n),eam(e,this.d.Tk(e,1,this.e,r,this.b))):t.Eh(n)},eUe.Sk=function(e){throw p7(new bk)},Y6(eZ2,"EStructuralFeatureImpl/InternalSettingDelegateSingleData",563),eTS(eQu,1,{},sb),eUe.Tk=function(e,t,n,r,i){return new FJ(e,t,n,r,i)},eUe.Uk=function(e,t,n,r,i,a){return new H0(e,t,n,r,i,a)},Y6(eZ2,"EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator",eQu),eTS(1332,eQu,{},sm),eUe.Tk=function(e,t,n,r,i){return new ZY(e,t,n,gN(LK(r)),gN(LK(i)))},eUe.Uk=function(e,t,n,r,i,a){return new W4(e,t,n,gN(LK(r)),gN(LK(i)),a)},Y6(eZ2,"EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator/1",1332),eTS(1333,eQu,{},sg),eUe.Tk=function(e,t,n,r,i){return new en_(e,t,n,Pp(r,217).a,Pp(i,217).a)},eUe.Uk=function(e,t,n,r,i,a){return new WX(e,t,n,Pp(r,217).a,Pp(i,217).a,a)},Y6(eZ2,"EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator/2",1333),eTS(1334,eQu,{},sv),eUe.Tk=function(e,t,n,r,i){return new enE(e,t,n,Pp(r,172).a,Pp(i,172).a)},eUe.Uk=function(e,t,n,r,i,a){return new WJ(e,t,n,Pp(r,172).a,Pp(i,172).a,a)},Y6(eZ2,"EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator/3",1334),eTS(1335,eQu,{},sy),eUe.Tk=function(e,t,n,r,i){return new Zj(e,t,n,gP(LV(r)),gP(LV(i)))},eUe.Uk=function(e,t,n,r,i,a){return new WQ(e,t,n,gP(LV(r)),gP(LV(i)),a)},Y6(eZ2,"EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator/4",1335),eTS(1336,eQu,{},sw),eUe.Tk=function(e,t,n,r,i){return new enx(e,t,n,Pp(r,155).a,Pp(i,155).a)},eUe.Uk=function(e,t,n,r,i,a){return new W1(e,t,n,Pp(r,155).a,Pp(i,155).a,a)},Y6(eZ2,"EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator/5",1336),eTS(1337,eQu,{},s_),eUe.Tk=function(e,t,n,r,i){return new ZF(e,t,n,Pp(r,19).a,Pp(i,19).a)},eUe.Uk=function(e,t,n,r,i,a){return new W0(e,t,n,Pp(r,19).a,Pp(i,19).a,a)},Y6(eZ2,"EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator/6",1337),eTS(1338,eQu,{},sE),eUe.Tk=function(e,t,n,r,i){return new enS(e,t,n,Pp(r,162).a,Pp(i,162).a)},eUe.Uk=function(e,t,n,r,i,a){return new W2(e,t,n,Pp(r,162).a,Pp(i,162).a,a)},Y6(eZ2,"EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator/7",1338),eTS(1339,eQu,{},sS),eUe.Tk=function(e,t,n,r,i){return new enk(e,t,n,Pp(r,184).a,Pp(i,184).a)},eUe.Uk=function(e,t,n,r,i,a){return new W3(e,t,n,Pp(r,184).a,Pp(i,184).a,a)},Y6(eZ2,"EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator/8",1339),eTS(1317,563,{},Hx),eUe.Sk=function(e){if(!this.a.wj(e))throw p7(new gA(eQo+esF(e)+eQs+this.a+"'"))},Y6(eZ2,"EStructuralFeatureImpl/InternalSettingDelegateSingleDataDynamic",1317),eTS(1318,563,{},j5),eUe.Sk=function(e){},Y6(eZ2,"EStructuralFeatureImpl/InternalSettingDelegateSingleDataStatic",1318),eTS(770,563,{}),eUe.Sj=function(e,t,n){var r;return null!=(r=t.Ch(n))},eUe.Tj=function(e,t,n,r){var i,a;e.Lg()&&e.Mg()?(i=!0,null==(a=t.Ch(n))?(i=!1,a=this.b):xc(a)===xc(tgZ)&&(a=null),null==r?null!=this.c?(t.Dh(n,null),r=this.b):t.Dh(n,tgZ):(this.Sk(r),t.Dh(n,r)),eam(e,this.d.Uk(e,1,this.e,a,r,!i))):null==r?null!=this.c?t.Dh(n,null):t.Dh(n,tgZ):(this.Sk(r),t.Dh(n,r))},eUe.Vj=function(e,t,n){var r,i;e.Lg()&&e.Mg()?(r=!0,null==(i=t.Ch(n))?(r=!1,i=this.b):xc(i)===xc(tgZ)&&(i=null),t.Eh(n),eam(e,this.d.Uk(e,2,this.e,i,this.b,r))):t.Eh(n)},Y6(eZ2,"EStructuralFeatureImpl/InternalSettingDelegateSingleDataUnsettable",770),eTS(1319,770,{},HT),eUe.Sk=function(e){if(!this.a.wj(e))throw p7(new gA(eQo+esF(e)+eQs+this.a+"'"))},Y6(eZ2,"EStructuralFeatureImpl/InternalSettingDelegateSingleDataUnsettableDynamic",1319),eTS(1320,770,{},j8),eUe.Sk=function(e){},Y6(eZ2,"EStructuralFeatureImpl/InternalSettingDelegateSingleDataUnsettableStatic",1320),eTS(398,504,{},jd),eUe.Pj=function(e,t,n,r,i){var a,o,s,u,c;if(c=t.Ch(n),this.Kj()&&xc(c)===xc(tgZ))return null;if(!this.sk()||!r||null==c)return c;if((s=Pp(c,49)).kh()&&(u=ecv(e,s),s!=u)){if(!eNc(this.a,u))throw p7(new gA(eQo+esF(u)+eQs+this.a+"'"));t.Dh(n,c=u),this.rk()&&(a=Pp(u,49),o=s.ih(e,this.b?edv(s.Tg(),this.b):-1-edv(e.Tg(),this.e),null,null),a.eh()||(o=a.gh(e,this.b?edv(a.Tg(),this.b):-1-edv(e.Tg(),this.e),null,o)),o&&o.Fi()),e.Lg()&&e.Mg()&&eam(e,new FJ(e,9,this.e,s,u))}return c},eUe.Qj=function(e,t,n,r,i){var a,o;return xc(o=t.Ch(n))===xc(tgZ)&&(o=null),t.Dh(n,r),this.bj()?xc(o)!==xc(r)&&null!=o&&(i=(a=Pp(o,49)).ih(e,edv(a.Tg(),this.b),null,i)):this.rk()&&null!=o&&(i=Pp(o,49).ih(e,-1-edv(e.Tg(),this.e),null,i)),e.Lg()&&e.Mg()&&(i||(i=new yf(4)),i.Ei(new FJ(e,1,this.e,o,r))),i},eUe.Rj=function(e,t,n,r,i){var a;return xc(a=t.Ch(n))===xc(tgZ)&&(a=null),t.Eh(n),e.Lg()&&e.Mg()&&(i||(i=new yf(4)),this.Kj()?i.Ei(new FJ(e,2,this.e,a,null)):i.Ei(new FJ(e,1,this.e,a,null))),i},eUe.Sj=function(e,t,n){var r;return null!=(r=t.Ch(n))},eUe.Tj=function(e,t,n,r){var i,a,o,s,u;if(null!=r&&!eNc(this.a,r))throw p7(new gA(eQo+(M4(r,56)?eyB(Pp(r,56).Tg()):ee5(esF(r)))+eQs+this.a+"'"));s=null!=(u=t.Ch(n)),this.Kj()&&xc(u)===xc(tgZ)&&(u=null),o=null,this.bj()?xc(u)!==xc(r)&&(null!=u&&(o=(i=Pp(u,49)).ih(e,edv(i.Tg(),this.b),null,o)),null!=r&&(o=(i=Pp(r,49)).gh(e,edv(i.Tg(),this.b),null,o))):this.rk()&&xc(u)!==xc(r)&&(null!=u&&(o=Pp(u,49).ih(e,-1-edv(e.Tg(),this.e),null,o)),null!=r&&(o=Pp(r,49).gh(e,-1-edv(e.Tg(),this.e),null,o))),null==r&&this.Kj()?t.Dh(n,tgZ):t.Dh(n,r),e.Lg()&&e.Mg()?(a=new H0(e,1,this.e,u,r,this.Kj()&&!s),o?(o.Ei(a),o.Fi()):eam(e,a)):o&&o.Fi()},eUe.Vj=function(e,t,n){var r,i,a,o,s;o=null!=(s=t.Ch(n)),this.Kj()&&xc(s)===xc(tgZ)&&(s=null),a=null,null!=s&&(this.bj()?a=(r=Pp(s,49)).ih(e,edv(r.Tg(),this.b),null,a):this.rk()&&(a=Pp(s,49).ih(e,-1-edv(e.Tg(),this.e),null,a))),t.Eh(n),e.Lg()&&e.Mg()?(i=new H0(e,this.Kj()?2:1,this.e,s,null,o),a?(a.Ei(i),a.Fi()):eam(e,i)):a&&a.Fi()},eUe.bj=function(){return!1},eUe.rk=function(){return!1},eUe.sk=function(){return!1},eUe.Kj=function(){return!1},Y6(eZ2,"EStructuralFeatureImpl/InternalSettingDelegateSingleEObject",398),eTS(564,398,{},LE),eUe.rk=function(){return!0},Y6(eZ2,"EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectContainment",564),eTS(1323,564,{},LS),eUe.sk=function(){return!0},Y6(eZ2,"EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectContainmentResolving",1323),eTS(772,564,{},Lk),eUe.Kj=function(){return!0},Y6(eZ2,"EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectContainmentUnsettable",772),eTS(1325,772,{},Lx),eUe.sk=function(){return!0},Y6(eZ2,"EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectContainmentUnsettableResolving",1325),eTS(640,564,{},Pn),eUe.bj=function(){return!0},Y6(eZ2,"EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectContainmentWithInverse",640),eTS(1324,640,{},Pa),eUe.sk=function(){return!0},Y6(eZ2,"EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectContainmentWithInverseResolving",1324),eTS(773,640,{},Po),eUe.Kj=function(){return!0},Y6(eZ2,"EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectContainmentWithInverseUnsettable",773),eTS(1326,773,{},Ps),eUe.sk=function(){return!0},Y6(eZ2,"EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectContainmentWithInverseUnsettableResolving",1326),eTS(641,398,{},LT),eUe.sk=function(){return!0},Y6(eZ2,"EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectResolving",641),eTS(1327,641,{},LM),eUe.Kj=function(){return!0},Y6(eZ2,"EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectResolvingUnsettable",1327),eTS(774,641,{},Pr),eUe.bj=function(){return!0},Y6(eZ2,"EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectResolvingWithInverse",774),eTS(1328,774,{},Pu),eUe.Kj=function(){return!0},Y6(eZ2,"EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectResolvingWithInverseUnsettable",1328),eTS(1321,398,{},LO),eUe.Kj=function(){return!0},Y6(eZ2,"EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectUnsettable",1321),eTS(771,398,{},Pi),eUe.bj=function(){return!0},Y6(eZ2,"EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectWithInverse",771),eTS(1322,771,{},Pc),eUe.Kj=function(){return!0},Y6(eZ2,"EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectWithInverseUnsettable",1322),eTS(775,565,eQa,Bj),eUe.Pk=function(e){return new Bj(this.a,this.c,e)},eUe.dd=function(){return this.b},eUe.Qk=function(e,t,n){return Jt(this,e,this.b,n)},eUe.Rk=function(e,t,n){return Jn(this,e,this.b,n)},Y6(eZ2,"EStructuralFeatureImpl/InverseUpdatingFeatureMapEntry",775),eTS(1329,1,eJG,pz),eUe.Wj=function(e){return this.a},eUe.fj=function(){return M4(this.a,95)?Pp(this.a,95).fj():!this.a.dc()},eUe.Wb=function(e){this.a.$b(),this.a.Gc(Pp(e,15))},eUe.Xj=function(){M4(this.a,95)?Pp(this.a,95).Xj():this.a.$b()},Y6(eZ2,"EStructuralFeatureImpl/SettingMany",1329),eTS(1330,565,eQa,qf),eUe.Ok=function(e){return new Cv((eR7(),tvK),this.b.Ih(this.a,e))},eUe.dd=function(){return null},eUe.Qk=function(e,t,n){return n},eUe.Rk=function(e,t,n){return n},Y6(eZ2,"EStructuralFeatureImpl/SimpleContentFeatureMapEntry",1330),eTS(642,565,eQa,Cv),eUe.Ok=function(e){return new Cv(this.c,e)},eUe.dd=function(){return this.a},eUe.Qk=function(e,t,n){return n},eUe.Rk=function(e,t,n){return n},Y6(eZ2,"EStructuralFeatureImpl/SimpleFeatureMapEntry",642),eTS(391,497,eXz,sk),eUe.ri=function(e){return Je(tm7,eUp,26,e,0,1)},eUe.ni=function(){return!1},Y6(eZ2,"ESuperAdapter/1",391),eTS(444,438,{105:1,92:1,90:1,147:1,191:1,56:1,108:1,836:1,49:1,97:1,150:1,444:1,114:1,115:1},sx),eUe._g=function(e,t,n){var r;switch(e){case 0:return this.Ab||(this.Ab=new FQ(tm4,this,0,3)),this.Ab;case 1:return this.zb;case 2:return this.a||(this.a=new jh(this,tgr,this)),this.a}return Qt(this,e-Y1((eBK(),tgU)),ee2((r=Pp(eaS(this,16),26))||tgU,e),t,n)},eUe.jh=function(e,t,n){var r,i;switch(t){case 0:return this.Ab||(this.Ab=new FQ(tm4,this,0,3)),ep5(this.Ab,e,n);case 2:return this.a||(this.a=new jh(this,tgr,this)),ep5(this.a,e,n)}return(i=Pp(ee2((r=Pp(eaS(this,16),26))||(eBK(),tgU),t),66)).Nj().Rj(this,ehH(this),t-Y1((eBK(),tgU)),e,n)},eUe.lh=function(e){var t;switch(e){case 0:return!!this.Ab&&0!=this.Ab.i;case 1:return null!=this.zb;case 2:return!!this.a&&0!=this.a.i}return VP(this,e-Y1((eBK(),tgU)),ee2((t=Pp(eaS(this,16),26))||tgU,e))},eUe.sh=function(e,t){var n;switch(e){case 0:this.Ab||(this.Ab=new FQ(tm4,this,0,3)),eRT(this.Ab),this.Ab||(this.Ab=new FQ(tm4,this,0,3)),Y4(this.Ab,Pp(t,14));return;case 1:er3(this,Lq(t));return;case 2:this.a||(this.a=new jh(this,tgr,this)),eRT(this.a),this.a||(this.a=new jh(this,tgr,this)),Y4(this.a,Pp(t,14));return}efL(this,e-Y1((eBK(),tgU)),ee2((n=Pp(eaS(this,16),26))||tgU,e),t)},eUe.zh=function(){return eBK(),tgU},eUe.Bh=function(e){var t;switch(e){case 0:this.Ab||(this.Ab=new FQ(tm4,this,0,3)),eRT(this.Ab);return;case 1:er3(this,null);return;case 2:this.a||(this.a=new jh(this,tgr,this)),eRT(this.a);return}ec5(this,e-Y1((eBK(),tgU)),ee2((t=Pp(eaS(this,16),26))||tgU,e))},Y6(eZ2,"ETypeParameterImpl",444),eTS(445,85,eJ8,jh),eUe.cj=function(e,t){return ewV(this,Pp(e,87),t)},eUe.dj=function(e,t){return ewq(this,Pp(e,87),t)},Y6(eZ2,"ETypeParameterImpl/1",445),eTS(634,43,e$s,mR),eUe.ec=function(){return new pG(this)},Y6(eZ2,"ETypeParameterImpl/2",634),eTS(556,eUT,eUM,pG),eUe.Fc=function(e){return Ie(this,Pp(e,87))},eUe.Gc=function(e){var t,n,r;for(r=!1,n=e.Kc();n.Ob();)t=Pp(n.Pb(),87),null==Um(this.a,t,"")&&(r=!0);return r},eUe.$b=function(){Yy(this.a)},eUe.Hc=function(e){return F8(this.a,e)},eUe.Kc=function(){var e;return e=new esz(new fS(this.a).a),new pW(e)},eUe.Mc=function(e){return Xp(this,e)},eUe.gc=function(){return wq(this.a)},Y6(eZ2,"ETypeParameterImpl/2/1",556),eTS(557,1,eUE,pW),eUe.Nb=function(e){F9(this,e)},eUe.Pb=function(){return Pp(etz(this.a).cd(),87)},eUe.Ob=function(){return this.a.b},eUe.Qb=function(){JM(this.a)},Y6(eZ2,"ETypeParameterImpl/2/1/1",557),eTS(1276,43,e$s,mj),eUe._b=function(e){return xd(e)?$r(this,e):!!$I(this.f,e)},eUe.xc=function(e){var t,n;return M4(t=xd(e)?zg(this,e):xu($I(this.f,e)),837)?(t=(n=Pp(t,837))._j(),Um(this,Pp(e,235),t),t):null!=t?t:null==e?(_3(),tvh):null},Y6(eZ2,"EValidatorRegistryImpl",1276),eTS(1313,704,{105:1,92:1,90:1,471:1,147:1,56:1,108:1,1941:1,49:1,97:1,150:1,114:1,115:1},sT),eUe.Ih=function(e,t){switch(e.yj()){case 21:case 22:case 23:case 24:case 26:case 31:case 32:case 37:case 38:case 39:case 40:case 43:case 44:case 48:case 49:case 20:return null==t?null:efF(t);case 25:return etR(t);case 27:return Qn(t);case 28:return Qr(t);case 29:return null==t?null:MU(tmS[0],Pp(t,199));case 41:return null==t?"":yx(Pp(t,290));case 42:return efF(t);case 50:return Lq(t);default:throw p7(new gL(eZ6+e.ne()+eZ5))}},eUe.Jh=function(e){var t;switch(-1==e.G&&(e.G=(t=etP(e))?ebv(t.Mh(),e):-1),e.G){case 0:return new mC;case 1:return new sa;case 2:return new c0;case 4:return new bN;case 5:return new mI;case 6:return new bD;case 7:return new cQ;case 10:return new sr;case 11:return new mD;case 12:return new $y;case 13:return new mN;case 14:return new LB;case 17:return new sp;case 18:return new p6;case 19:return new sx;default:throw p7(new gL(eZ7+e.zb+eZ5))}},eUe.Kh=function(e,t){switch(e.yj()){case 20:return null==t?null:new yY(t);case 21:return null==t?null:new TU(t);case 23:case 22:return null==t?null:ehL(t);case 26:case 24:return null==t?null:eeT(eDa(t,-128,127)<<24>>24);case 25:return eMp(t);case 27:return egg(t);case 28:return egv(t);case 29:return e__(t);case 32:case 31:return null==t?null:eEu(t);case 38:case 37:return null==t?null:new bK(t);case 40:case 39:return null==t?null:ell(eDa(t,eHt,eUu));case 41:case 42:return null;case 44:case 43:return null==t?null:ehQ(eF0(t));case 49:case 48:return null==t?null:elf(eDa(t,eQl,32767)<<16>>16);case 50:return t;default:throw p7(new gL(eZ6+e.ne()+eZ5))}},Y6(eZ2,"EcoreFactoryImpl",1313),eTS(547,179,{105:1,92:1,90:1,147:1,191:1,56:1,235:1,108:1,1939:1,49:1,97:1,150:1,179:1,547:1,114:1,115:1,675:1},Uh),eUe.gb=!1,eUe.hb=!1;var tgh,tgp,tgb,tgm,tgg,tgv,tgy,tgw,tg_,tgE,tgS,tgk,tgx,tgT,tgM,tgO,tgA,tgL,tgC,tgI,tgD,tgN,tgP,tgR,tgj,tgF,tgY,tgB,tgU,tgH,tg$,tgz,tgG,tgW,tgK,tgV,tgq,tgZ,tgX,tgJ,tgQ,tg1,tg0,tg2,tg3,tg4,tg6,tg5,tg8=!1;Y6(eZ2,"EcorePackageImpl",547),eTS(1184,1,{837:1},sM),eUe._j=function(){return OJ(),tvp},Y6(eZ2,"EcorePackageImpl/1",1184),eTS(1193,1,eQS,sO),eUe.wj=function(e){return M4(e,147)},eUe.xj=function(e){return Je(e5y,eUp,147,e,0,1)},Y6(eZ2,"EcorePackageImpl/10",1193),eTS(1194,1,eQS,sA),eUe.wj=function(e){return M4(e,191)},eUe.xj=function(e){return Je(e5_,eUp,191,e,0,1)},Y6(eZ2,"EcorePackageImpl/11",1194),eTS(1195,1,eQS,sL),eUe.wj=function(e){return M4(e,56)},eUe.xj=function(e){return Je(e5f,eUp,56,e,0,1)},Y6(eZ2,"EcorePackageImpl/12",1195),eTS(1196,1,eQS,sC),eUe.wj=function(e){return M4(e,399)},eUe.xj=function(e){return Je(tgi,eJ6,59,e,0,1)},Y6(eZ2,"EcorePackageImpl/13",1196),eTS(1197,1,eQS,sI),eUe.wj=function(e){return M4(e,235)},eUe.xj=function(e){return Je(e5E,eUp,235,e,0,1)},Y6(eZ2,"EcorePackageImpl/14",1197),eTS(1198,1,eQS,sD),eUe.wj=function(e){return M4(e,509)},eUe.xj=function(e){return Je(tga,eUp,2017,e,0,1)},Y6(eZ2,"EcorePackageImpl/15",1198),eTS(1199,1,eQS,sN),eUe.wj=function(e){return M4(e,99)},eUe.xj=function(e){return Je(tgo,eJ4,18,e,0,1)},Y6(eZ2,"EcorePackageImpl/16",1199),eTS(1200,1,eQS,sP),eUe.wj=function(e){return M4(e,170)},eUe.xj=function(e){return Je(tm5,eJ4,170,e,0,1)},Y6(eZ2,"EcorePackageImpl/17",1200),eTS(1201,1,eQS,sR),eUe.wj=function(e){return M4(e,472)},eUe.xj=function(e){return Je(tm6,eUp,472,e,0,1)},Y6(eZ2,"EcorePackageImpl/18",1201),eTS(1202,1,eQS,sj),eUe.wj=function(e){return M4(e,548)},eUe.xj=function(e){return Je(tgf,eJL,548,e,0,1)},Y6(eZ2,"EcorePackageImpl/19",1202),eTS(1185,1,eQS,sF),eUe.wj=function(e){return M4(e,322)},eUe.xj=function(e){return Je(tm8,eJ4,34,e,0,1)},Y6(eZ2,"EcorePackageImpl/2",1185),eTS(1203,1,eQS,sY),eUe.wj=function(e){return M4(e,241)},eUe.xj=function(e){return Je(tgr,eQt,87,e,0,1)},Y6(eZ2,"EcorePackageImpl/20",1203),eTS(1204,1,eQS,sB),eUe.wj=function(e){return M4(e,444)},eUe.xj=function(e){return Je(tgs,eUp,836,e,0,1)},Y6(eZ2,"EcorePackageImpl/21",1204),eTS(1205,1,eQS,sU),eUe.wj=function(e){return xl(e)},eUe.xj=function(e){return Je(e11,eUP,476,e,8,1)},Y6(eZ2,"EcorePackageImpl/22",1205),eTS(1206,1,eQS,sH),eUe.wj=function(e){return M4(e,190)},eUe.xj=function(e){return Je(tyk,eUP,190,e,0,2)},Y6(eZ2,"EcorePackageImpl/23",1206),eTS(1207,1,eQS,s$),eUe.wj=function(e){return M4(e,217)},eUe.xj=function(e){return Je(e10,eUP,217,e,0,1)},Y6(eZ2,"EcorePackageImpl/24",1207),eTS(1208,1,eQS,sz),eUe.wj=function(e){return M4(e,172)},eUe.xj=function(e){return Je(e12,eUP,172,e,0,1)},Y6(eZ2,"EcorePackageImpl/25",1208),eTS(1209,1,eQS,sG),eUe.wj=function(e){return M4(e,199)},eUe.xj=function(e){return Je(e1Q,eUP,199,e,0,1)},Y6(eZ2,"EcorePackageImpl/26",1209),eTS(1210,1,eQS,sW),eUe.wj=function(e){return!1},eUe.xj=function(e){return Je(tyA,eUp,2110,e,0,1)},Y6(eZ2,"EcorePackageImpl/27",1210),eTS(1211,1,eQS,sK),eUe.wj=function(e){return xf(e)},eUe.xj=function(e){return Je(e13,eUP,333,e,7,1)},Y6(eZ2,"EcorePackageImpl/28",1211),eTS(1212,1,eQS,sV),eUe.wj=function(e){return M4(e,58)},eUe.xj=function(e){return Je(e5L,ezZ,58,e,0,1)},Y6(eZ2,"EcorePackageImpl/29",1212),eTS(1186,1,eQS,sq),eUe.wj=function(e){return M4(e,510)},eUe.xj=function(e){return Je(tm4,{3:1,4:1,5:1,1934:1},590,e,0,1)},Y6(eZ2,"EcorePackageImpl/3",1186),eTS(1213,1,eQS,sZ),eUe.wj=function(e){return M4(e,573)},eUe.xj=function(e){return Je(e5j,eUp,1940,e,0,1)},Y6(eZ2,"EcorePackageImpl/30",1213),eTS(1214,1,eQS,sX),eUe.wj=function(e){return M4(e,153)},eUe.xj=function(e){return Je(tg7,ezZ,153,e,0,1)},Y6(eZ2,"EcorePackageImpl/31",1214),eTS(1215,1,eQS,sJ),eUe.wj=function(e){return M4(e,72)},eUe.xj=function(e){return Je(tgc,eQk,72,e,0,1)},Y6(eZ2,"EcorePackageImpl/32",1215),eTS(1216,1,eQS,sQ),eUe.wj=function(e){return M4(e,155)},eUe.xj=function(e){return Je(e14,eUP,155,e,0,1)},Y6(eZ2,"EcorePackageImpl/33",1216),eTS(1217,1,eQS,s1),eUe.wj=function(e){return M4(e,19)},eUe.xj=function(e){return Je(e16,eUP,19,e,0,1)},Y6(eZ2,"EcorePackageImpl/34",1217),eTS(1218,1,eQS,s0),eUe.wj=function(e){return M4(e,290)},eUe.xj=function(e){return Je(e1j,eUp,290,e,0,1)},Y6(eZ2,"EcorePackageImpl/35",1218),eTS(1219,1,eQS,s2),eUe.wj=function(e){return M4(e,162)},eUe.xj=function(e){return Je(e15,eUP,162,e,0,1)},Y6(eZ2,"EcorePackageImpl/36",1219),eTS(1220,1,eQS,s3),eUe.wj=function(e){return M4(e,83)},eUe.xj=function(e){return Je(e1Y,eUp,83,e,0,1)},Y6(eZ2,"EcorePackageImpl/37",1220),eTS(1221,1,eQS,s4),eUe.wj=function(e){return M4(e,591)},eUe.xj=function(e){return Je(tg9,eUp,591,e,0,1)},Y6(eZ2,"EcorePackageImpl/38",1221),eTS(1222,1,eQS,s6),eUe.wj=function(e){return!1},eUe.xj=function(e){return Je(tyL,eUp,2111,e,0,1)},Y6(eZ2,"EcorePackageImpl/39",1222),eTS(1187,1,eQS,s5),eUe.wj=function(e){return M4(e,88)},eUe.xj=function(e){return Je(tm7,eUp,26,e,0,1)},Y6(eZ2,"EcorePackageImpl/4",1187),eTS(1223,1,eQS,s8),eUe.wj=function(e){return M4(e,184)},eUe.xj=function(e){return Je(e18,eUP,184,e,0,1)},Y6(eZ2,"EcorePackageImpl/40",1223),eTS(1224,1,eQS,s9),eUe.wj=function(e){return xd(e)},eUe.xj=function(e){return Je(e17,eUP,2,e,6,1)},Y6(eZ2,"EcorePackageImpl/41",1224),eTS(1225,1,eQS,s7),eUe.wj=function(e){return M4(e,588)},eUe.xj=function(e){return Je(e5I,eUp,588,e,0,1)},Y6(eZ2,"EcorePackageImpl/42",1225),eTS(1226,1,eQS,ue),eUe.wj=function(e){return!1},eUe.xj=function(e){return Je(tyC,eUP,2112,e,0,1)},Y6(eZ2,"EcorePackageImpl/43",1226),eTS(1227,1,eQS,ut),eUe.wj=function(e){return M4(e,42)},eUe.xj=function(e){return Je(e1$,eUK,42,e,0,1)},Y6(eZ2,"EcorePackageImpl/44",1227),eTS(1188,1,eQS,un),eUe.wj=function(e){return M4(e,138)},eUe.xj=function(e){return Je(tm9,eUp,138,e,0,1)},Y6(eZ2,"EcorePackageImpl/5",1188),eTS(1189,1,eQS,ur),eUe.wj=function(e){return M4(e,148)},eUe.xj=function(e){return Je(tge,eUp,148,e,0,1)},Y6(eZ2,"EcorePackageImpl/6",1189),eTS(1190,1,eQS,ui),eUe.wj=function(e){return M4(e,457)},eUe.xj=function(e){return Je(tgt,eUp,671,e,0,1)},Y6(eZ2,"EcorePackageImpl/7",1190),eTS(1191,1,eQS,ua),eUe.wj=function(e){return M4(e,573)},eUe.xj=function(e){return Je(tgn,eUp,678,e,0,1)},Y6(eZ2,"EcorePackageImpl/8",1191),eTS(1192,1,eQS,uo),eUe.wj=function(e){return M4(e,471)},eUe.xj=function(e){return Je(e5w,eUp,471,e,0,1)},Y6(eZ2,"EcorePackageImpl/9",1192),eTS(1025,1982,eJO,gT),eUe.bi=function(e,t){ecV(this,Pp(t,415))},eUe.fi=function(e,t){eSU(this,e,Pp(t,415))},Y6(eZ2,"MinimalEObjectImpl/1ArrayDelegatingAdapterList",1025),eTS(1026,143,eJx,BF),eUe.Ai=function(){return this.a.a},Y6(eZ2,"MinimalEObjectImpl/1ArrayDelegatingAdapterList/1",1026),eTS(1053,1052,{},Ms),Y6("org.eclipse.emf.ecore.plugin","EcorePlugin",1053);var tg9=RL(eQx,"Resource");eTS(781,1378,eQT),eUe.Yk=function(e){},eUe.Zk=function(e){},eUe.Vk=function(){return this.a||(this.a=new pK(this)),this.a},eUe.Wk=function(e){var t,n,r,i,a;if((r=e.length)>0){if(GV(0,e.length),47==e.charCodeAt(0)){for(t=1,a=new XM(4),i=1;t0&&(e=e.substr(0,n))}return ekX(this,e)},eUe.Xk=function(){return this.c},eUe.Ib=function(){var e;return yx(this.gm)+"@"+(e=esj(this)>>>0).toString(16)+" uri='"+this.d+"'"},eUe.b=!1,Y6(eQM,"ResourceImpl",781),eTS(1379,781,eQT,pq),Y6(eQM,"BinaryResourceImpl",1379),eTS(1169,694,eXG),eUe.si=function(e){return M4(e,56)?$x(this,Pp(e,56)):M4(e,591)?new Ow(Pp(e,591).Vk()):xc(e)===xc(this.f)?Pp(e,14).Kc():(LF(),tmB.a)},eUe.Ob=function(){return exI(this)},eUe.a=!1,Y6(eJz,"EcoreUtil/ContentTreeIterator",1169),eTS(1380,1169,eXG,F0),eUe.si=function(e){return xc(e)===xc(this.f)?Pp(e,15).Kc():new K0(Pp(e,56))},Y6(eQM,"ResourceImpl/5",1380),eTS(648,1994,eJ5,pK),eUe.Hc=function(e){return this.i<=4?ev8(this,e):M4(e,49)&&Pp(e,49).Zg()==this.a},eUe.bi=function(e,t){e==this.i-1&&(this.a.b||(this.a.b=!0))},eUe.di=function(e,t){0==e?this.a.b||(this.a.b=!0):X9(this,e,t)},eUe.fi=function(e,t){},eUe.gi=function(e,t,n){},eUe.aj=function(){return 2},eUe.Ai=function(){return this.a},eUe.bj=function(){return!0},eUe.cj=function(e,t){var n;return t=(n=Pp(e,49)).wh(this.a,t)},eUe.dj=function(e,t){var n;return(n=Pp(e,49)).wh(null,t)},eUe.ej=function(){return!1},eUe.hi=function(){return!0},eUe.ri=function(e){return Je(e5f,eUp,56,e,0,1)},eUe.ni=function(){return!1},Y6(eQM,"ResourceImpl/ContentsEList",648),eTS(957,1964,eU6,pV),eUe.Zc=function(e){return this.a._h(e)},eUe.gc=function(){return this.a.gc()},Y6(eJz,"AbstractSequentialInternalEList/1",957),eTS(624,1,{},PQ),Y6(eJz,"BasicExtendedMetaData",624),eTS(1160,1,{},k8),eUe.$k=function(){return null},eUe._k=function(){return -2==this.a&&fi(this,e_f(this.d,this.b)),this.a},eUe.al=function(){return null},eUe.bl=function(){return Hj(),Hj(),e2r},eUe.ne=function(){return this.c==eQH&&fo(this,eh1(this.d,this.b)),this.c},eUe.cl=function(){return 0},eUe.a=-2,eUe.c=eQH,Y6(eJz,"BasicExtendedMetaData/EClassExtendedMetaDataImpl",1160),eTS(1161,1,{},Ke),eUe.$k=function(){return this.a==(ZE(),tvf)&&fa(this,eO8(this.f,this.b)),this.a},eUe._k=function(){return 0},eUe.al=function(){return this.c==(ZE(),tvf)&&fs(this,eO9(this.f,this.b)),this.c},eUe.bl=function(){return this.d||fu(this,eIA(this.f,this.b)),this.d},eUe.ne=function(){return this.e==eQH&&fc(this,eh1(this.f,this.b)),this.e},eUe.cl=function(){return -2==this.g&&fl(this,ewd(this.f,this.b)),this.g},eUe.e=eQH,eUe.g=-2,Y6(eJz,"BasicExtendedMetaData/EDataTypeExtendedMetaDataImpl",1161),eTS(1159,1,{},xn),eUe.b=!1,eUe.c=!1,Y6(eJz,"BasicExtendedMetaData/EPackageExtendedMetaDataImpl",1159),eTS(1162,1,{},W7),eUe.c=-2,eUe.e=eQH,eUe.f=eQH,Y6(eJz,"BasicExtendedMetaData/EStructuralFeatureExtendedMetaDataImpl",1162),eTS(585,622,eJ8,PJ),eUe.aj=function(){return this.c},eUe.Fk=function(){return!1},eUe.li=function(e,t){return t},eUe.c=0,Y6(eJz,"EDataTypeEList",585);var tg7=RL(eJz,"FeatureMap");eTS(75,585,{3:1,4:1,20:1,28:1,52:1,14:1,15:1,54:1,67:1,63:1,58:1,76:1,153:1,215:1,1937:1,69:1,95:1},eiR),eUe.Vc=function(e,t){eO0(this,e,Pp(t,72))},eUe.Fc=function(e){return eM5(this,Pp(e,72))},eUe.Yh=function(e){Y2(this,Pp(e,72))},eUe.cj=function(e,t){return IG(this,Pp(e,72),t)},eUe.dj=function(e,t){return IW(this,Pp(e,72),t)},eUe.ii=function(e,t){return eI7(this,e,t)},eUe.li=function(e,t){return ejg(this,e,Pp(t,72))},eUe._c=function(e,t){return eA5(this,e,Pp(t,72))},eUe.jj=function(e,t){return IK(this,Pp(e,72),t)},eUe.kj=function(e,t){return IV(this,Pp(e,72),t)},eUe.lj=function(e,t,n){return eyU(this,Pp(e,72),Pp(t,72),n)},eUe.oi=function(e,t){return ewk(this,e,Pp(t,72))},eUe.dl=function(e,t){return eIF(this,e,t)},eUe.Wc=function(e,t){var n,r,i,a,o,s,u,c,l;for(c=new eta(t.gc()),i=t.Kc();i.Ob();)if(a=(r=Pp(i.Pb(),72)).ak(),eLt(this.e,a))a.hi()&&(Vq(this,a,r.dd())||ev8(c,r))||JL(c,r);else{for(s=0,l=eAY(this.e.Tg(),a),n=Pp(this.g,119),o=!0;s=0;)if(t=e[this.c],this.k.rl(t.ak()))return this.j=this.f?t:t.dd(),this.i=-2,!0;return this.i=-1,this.g=-1,!1},Y6(eJz,"BasicFeatureMap/FeatureEIterator",410),eTS(662,410,eUC,x1),eUe.Lk=function(){return!0},Y6(eJz,"BasicFeatureMap/ResolvingFeatureEIterator",662),eTS(955,486,eQr,Mz),eUe.Gi=function(){return this},Y6(eJz,"EContentsEList/1",955),eTS(956,486,eQr,x0),eUe.Lk=function(){return!1},Y6(eJz,"EContentsEList/2",956),eTS(954,279,eQi,MG),eUe.Nk=function(e){},eUe.Ob=function(){return!1},eUe.Sb=function(){return!1},Y6(eJz,"EContentsEList/FeatureIteratorImpl/1",954),eTS(825,585,eJ8,OM),eUe.ci=function(){this.a=!0},eUe.fj=function(){return this.a},eUe.Xj=function(){var e;eRT(this),TO(this.e)?(e=this.a,this.a=!1,eam(this.e,new ZB(this.e,2,this.c,e,!1))):this.a=!1},eUe.a=!1,Y6(eJz,"EDataTypeEList/Unsettable",825),eTS(1849,585,eJ8,OO),eUe.hi=function(){return!0},Y6(eJz,"EDataTypeUniqueEList",1849),eTS(1850,825,eJ8,OA),eUe.hi=function(){return!0},Y6(eJz,"EDataTypeUniqueEList/Unsettable",1850),eTS(139,85,eJ8,OS),eUe.Ek=function(){return!0},eUe.li=function(e,t){return ex7(this,e,Pp(t,56))},Y6(eJz,"EObjectContainmentEList/Resolving",139),eTS(1163,545,eJ8,Ok),eUe.Ek=function(){return!0},eUe.li=function(e,t){return ex7(this,e,Pp(t,56))},Y6(eJz,"EObjectContainmentEList/Unsettable/Resolving",1163),eTS(748,16,eJ8,Io),eUe.ci=function(){this.a=!0},eUe.fj=function(){return this.a},eUe.Xj=function(){var e;eRT(this),TO(this.e)?(e=this.a,this.a=!1,eam(this.e,new ZB(this.e,2,this.c,e,!1))):this.a=!1},eUe.a=!1,Y6(eJz,"EObjectContainmentWithInverseEList/Unsettable",748),eTS(1173,748,eJ8,Is),eUe.Ek=function(){return!0},eUe.li=function(e,t){return ex7(this,e,Pp(t,56))},Y6(eJz,"EObjectContainmentWithInverseEList/Unsettable/Resolving",1173),eTS(743,496,eJ8,Ox),eUe.ci=function(){this.a=!0},eUe.fj=function(){return this.a},eUe.Xj=function(){var e;eRT(this),TO(this.e)?(e=this.a,this.a=!1,eam(this.e,new ZB(this.e,2,this.c,e,!1))):this.a=!1},eUe.a=!1,Y6(eJz,"EObjectEList/Unsettable",743),eTS(328,496,eJ8,OT),eUe.Ek=function(){return!0},eUe.li=function(e,t){return ex7(this,e,Pp(t,56))},Y6(eJz,"EObjectResolvingEList",328),eTS(1641,743,eJ8,OL),eUe.Ek=function(){return!0},eUe.li=function(e,t){return ex7(this,e,Pp(t,56))},Y6(eJz,"EObjectResolvingEList/Unsettable",1641),eTS(1381,1,{},us),Y6(eJz,"EObjectValidator",1381),eTS(546,496,eJ8,F1),eUe.zk=function(){return this.d},eUe.Ak=function(){return this.b},eUe.bj=function(){return!0},eUe.Dk=function(){return!0},eUe.b=0,Y6(eJz,"EObjectWithInverseEList",546),eTS(1176,546,eJ8,Iu),eUe.Ck=function(){return!0},Y6(eJz,"EObjectWithInverseEList/ManyInverse",1176),eTS(625,546,eJ8,Ic),eUe.ci=function(){this.a=!0},eUe.fj=function(){return this.a},eUe.Xj=function(){var e;eRT(this),TO(this.e)?(e=this.a,this.a=!1,eam(this.e,new ZB(this.e,2,this.c,e,!1))):this.a=!1},eUe.a=!1,Y6(eJz,"EObjectWithInverseEList/Unsettable",625),eTS(1175,625,eJ8,If),eUe.Ck=function(){return!0},Y6(eJz,"EObjectWithInverseEList/Unsettable/ManyInverse",1175),eTS(749,546,eJ8,Il),eUe.Ek=function(){return!0},eUe.li=function(e,t){return ex7(this,e,Pp(t,56))},Y6(eJz,"EObjectWithInverseResolvingEList",749),eTS(31,749,eJ8,Ih),eUe.Ck=function(){return!0},Y6(eJz,"EObjectWithInverseResolvingEList/ManyInverse",31),eTS(750,625,eJ8,Id),eUe.Ek=function(){return!0},eUe.li=function(e,t){return ex7(this,e,Pp(t,56))},Y6(eJz,"EObjectWithInverseResolvingEList/Unsettable",750),eTS(1174,750,eJ8,Ip),eUe.Ck=function(){return!0},Y6(eJz,"EObjectWithInverseResolvingEList/Unsettable/ManyInverse",1174),eTS(1164,622,eJ8),eUe.ai=function(){return(1792&this.b)==0},eUe.ci=function(){this.b|=1},eUe.Bk=function(){return(4&this.b)!=0},eUe.bj=function(){return(40&this.b)!=0},eUe.Ck=function(){return(16&this.b)!=0},eUe.Dk=function(){return(8&this.b)!=0},eUe.Ek=function(){return(this.b&eJq)!=0},eUe.rk=function(){return(32&this.b)!=0},eUe.Fk=function(){return(this.b&eXt)!=0},eUe.wj=function(e){return this.d?VB(this.d,e):this.ak().Yj().wj(e)},eUe.fj=function(){return(2&this.b)!=0?(1&this.b)!=0:0!=this.i},eUe.hi=function(){return(128&this.b)!=0},eUe.Xj=function(){var e;eRT(this),(2&this.b)!=0&&(TO(this.e)?(e=(1&this.b)!=0,this.b&=-2,bz(this,new ZB(this.e,2,edv(this.e.Tg(),this.ak()),e,!1))):this.b&=-2)},eUe.ni=function(){return(1536&this.b)==0},eUe.b=0,Y6(eJz,"EcoreEList/Generic",1164),eTS(1165,1164,eJ8,H2),eUe.ak=function(){return this.a},Y6(eJz,"EcoreEList/Dynamic",1165),eTS(747,63,eXz,pZ),eUe.ri=function(e){return enb(this.a.a,e)},Y6(eJz,"EcoreEMap/1",747),eTS(746,85,eJ8,FZ),eUe.bi=function(e,t){ebB(this.b,Pp(t,133))},eUe.di=function(e,t){eac(this.b)},eUe.ei=function(e,t,n){var r;++(r=this.b,Pp(t,133),r).e},eUe.fi=function(e,t){elj(this.b,Pp(t,133))},eUe.gi=function(e,t,n){elj(this.b,Pp(n,133)),xc(n)===xc(t)&&Pp(n,133).Th(Mi(Pp(t,133).cd())),ebB(this.b,Pp(t,133))},Y6(eJz,"EcoreEMap/DelegateEObjectContainmentEList",746),eTS(1171,151,eJW,enQ),Y6(eJz,"EcoreEMap/Unsettable",1171),eTS(1172,746,eJ8,Ib),eUe.ci=function(){this.a=!0},eUe.fj=function(){return this.a},eUe.Xj=function(){var e;eRT(this),TO(this.e)?(e=this.a,this.a=!1,eam(this.e,new ZB(this.e,2,this.c,e,!1))):this.a=!1},eUe.a=!1,Y6(eJz,"EcoreEMap/Unsettable/UnsettableDelegateEObjectContainmentEList",1172),eTS(1168,228,e$s,YQ),eUe.a=!1,eUe.b=!1,Y6(eJz,"EcoreUtil/Copier",1168),eTS(745,1,eUE,K0),eUe.Nb=function(e){F9(this,e)},eUe.Ob=function(){return edV(this)},eUe.Pb=function(){var e;return edV(this),e=this.b,this.b=null,e},eUe.Qb=function(){this.a.Qb()},Y6(eJz,"EcoreUtil/ProperContentIterator",745),eTS(1382,1381,{},c2),Y6(eJz,"EcoreValidator",1382),RL(eJz,"FeatureMapUtil/Validator"),eTS(1260,1,{1942:1},uu),eUe.rl=function(e){return!0},Y6(eJz,"FeatureMapUtil/1",1260),eTS(757,1,{1942:1},eF2),eUe.rl=function(e){var t;return this.c==e||(null!=(t=LK(Bp(this.a,e)))?t==(OQ(),e0P):eCV(this,e)?(Z$(this.a,e,(OQ(),e0P)),!0):(Z$(this.a,e,(OQ(),e0N)),!1))},eUe.e=!1,Y6(eJz,"FeatureMapUtil/BasicValidator",757),eTS(758,43,e$s,MW),Y6(eJz,"FeatureMapUtil/BasicValidator/Cache",758),eTS(501,52,{20:1,28:1,52:1,14:1,15:1,58:1,76:1,69:1,95:1},xe),eUe.Vc=function(e,t){eLe(this.c,this.b,e,t)},eUe.Fc=function(e){return eIF(this.c,this.b,e)},eUe.Wc=function(e,t){return ePq(this.c,this.b,e,t)},eUe.Gc=function(e){return MJ(this,e)},eUe.Xh=function(e,t){ee7(this.c,this.b,e,t)},eUe.lk=function(e,t){return eCB(this.c,this.b,e,t)},eUe.pi=function(e){return ePL(this.c,this.b,e,!1)},eUe.Zh=function(){return TC(this.c,this.b)},eUe.$h=function(){return TI(this.c,this.b)},eUe._h=function(e){return X8(this.c,this.b,e)},eUe.mk=function(e,t){return Cp(this,e,t)},eUe.$b=function(){bG(this)},eUe.Hc=function(e){return Vq(this.c,this.b,e)},eUe.Ic=function(e){return eiF(this.c,this.b,e)},eUe.Xb=function(e){return ePL(this.c,this.b,e,!0)},eUe.Wj=function(e){return this},eUe.Xc=function(e){return VZ(this.c,this.b,e)},eUe.dc=function(){return xs(this)},eUe.fj=function(){return!edK(this.c,this.b)},eUe.Kc=function(){return eei(this.c,this.b)},eUe.Yc=function(){return eea(this.c,this.b)},eUe.Zc=function(e){return ely(this.c,this.b,e)},eUe.ii=function(e,t){return eNn(this.c,this.b,e,t)},eUe.ji=function(e,t){Xx(this.c,this.b,e,t)},eUe.$c=function(e){return eE0(this.c,this.b,e)},eUe.Mc=function(e){return eIC(this.c,this.b,e)},eUe._c=function(e,t){return eNL(this.c,this.b,e,t)},eUe.Wb=function(e){exZ(this.c,this.b),MJ(this,Pp(e,15))},eUe.gc=function(){return elG(this.c,this.b)},eUe.Pc=function(){return Wb(this.c,this.b)},eUe.Qc=function(e){return VX(this.c,this.b,e)},eUe.Ib=function(){var e,t;for(t=new vs,t.a+="[",e=TC(this.c,this.b);euf(e);)xk(t,Ae(ebm(e))),euf(e)&&(t.a+=eUd);return t.a+="]",t.a},eUe.Xj=function(){exZ(this.c,this.b)},Y6(eJz,"FeatureMapUtil/FeatureEList",501),eTS(627,36,eJx,qu),eUe.yi=function(e){return elc(this,e)},eUe.Di=function(e){var t,n,r,i,a,o,s;switch(this.d){case 1:case 2:if(xc(a=e.Ai())===xc(this.c)&&elc(this,null)==e.yi(null))return this.g=e.zi(),1==e.xi()&&(this.d=1),!0;break;case 3:if(3===(i=e.xi())&&xc(a=e.Ai())===xc(this.c)&&elc(this,null)==e.yi(null))return this.d=5,JL(t=new eta(2),this.g),JL(t,e.zi()),this.g=t,!0;break;case 5:if(3===(i=e.xi())&&xc(a=e.Ai())===xc(this.c)&&elc(this,null)==e.yi(null))return(n=Pp(this.g,14)).Fc(e.zi()),!0;break;case 4:switch(i=e.xi()){case 3:if(xc(a=e.Ai())===xc(this.c)&&elc(this,null)==e.yi(null))return this.d=1,this.g=e.zi(),!0;break;case 4:if(xc(a=e.Ai())===xc(this.c)&&elc(this,null)==e.yi(null))return this.d=6,JL(s=new eta(2),this.n),JL(s,e.Bi()),this.n=s,o=eow(vx(ty_,1),eHT,25,15,[this.o,e.Ci()]),this.g=o,!0}break;case 6:if(4===(i=e.xi())&&xc(a=e.Ai())===xc(this.c)&&elc(this,null)==e.yi(null))return(n=Pp(this.n,14)).Fc(e.Bi()),r=Je(ty_,eHT,25,(o=Pp(this.g,48)).length+1,15,1),ePD(o,0,r,0,o.length),r[o.length]=e.Ci(),this.g=r,!0}return!1},Y6(eJz,"FeatureMapUtil/FeatureENotificationImpl",627),eTS(552,501,{20:1,28:1,52:1,14:1,15:1,58:1,76:1,153:1,215:1,1937:1,69:1,95:1},RA),eUe.dl=function(e,t){return eIF(this.c,e,t)},eUe.el=function(e,t,n){return eCB(this.c,e,t,n)},eUe.fl=function(e,t,n){return ePT(this.c,e,t,n)},eUe.gl=function(){return this},eUe.hl=function(e,t){return ePC(this.c,e,t)},eUe.il=function(e){return Pp(ePL(this.c,this.b,e,!1),72).ak()},eUe.jl=function(e){return Pp(ePL(this.c,this.b,e,!1),72).dd()},eUe.kl=function(){return this.a},eUe.ll=function(e){return!edK(this.c,e)},eUe.ml=function(e,t){ePJ(this.c,e,t)},eUe.nl=function(e){return erp(this.c,e)},eUe.ol=function(e){emY(this.c,e)},Y6(eJz,"FeatureMapUtil/FeatureFeatureMap",552),eTS(1259,1,eJG,xr),eUe.Wj=function(e){return ePL(this.b,this.a,-1,e)},eUe.fj=function(){return!edK(this.b,this.a)},eUe.Wb=function(e){ePJ(this.b,this.a,e)},eUe.Xj=function(){exZ(this.b,this.a)},Y6(eJz,"FeatureMapUtil/FeatureValue",1259);var tve=RL(eQz,"AnyType");eTS(666,60,eHr,gV),Y6(eQz,"InvalidDatatypeValueException",666);var tvt=RL(eQz,eQG),tvn=RL(eQz,eQW),tvr=RL(eQz,eQK);eTS(830,506,{105:1,92:1,90:1,56:1,49:1,97:1,843:1},mF),eUe._g=function(e,t,n){switch(e){case 0:if(n)return this.c||(this.c=new eiR(this,0)),this.c;return this.c||(this.c=new eiR(this,0)),this.c.b;case 1:if(n)return this.c||(this.c=new eiR(this,0)),Pp(GP(this.c,(eR7(),tvx)),153);return(this.c||(this.c=new eiR(this,0)),Pp(Pp(GP(this.c,(eR7(),tvx)),153),215)).kl();case 2:if(n)return this.b||(this.b=new eiR(this,2)),this.b;return this.b||(this.b=new eiR(this,2)),this.b.b}return Qt(this,e-Y1(this.zh()),ee2((2&this.j)==0?this.zh():(this.k||(this.k=new c1),this.k).ck(),e),t,n)},eUe.jh=function(e,t,n){var r;switch(t){case 0:return this.c||(this.c=new eiR(this,0)),eIM(this.c,e,n);case 1:return(this.c||(this.c=new eiR(this,0)),Pp(Pp(GP(this.c,(eR7(),tvx)),153),69)).mk(e,n);case 2:return this.b||(this.b=new eiR(this,2)),eIM(this.b,e,n)}return(r=Pp(ee2((2&this.j)==0?this.zh():(this.k||(this.k=new c1),this.k).ck(),t),66)).Nj().Rj(this,Q6(this),t-Y1(this.zh()),e,n)},eUe.lh=function(e){switch(e){case 0:return!!this.c&&0!=this.c.i;case 1:return!(this.c||(this.c=new eiR(this,0)),Pp(GP(this.c,(eR7(),tvx)),153)).dc();case 2:return!!this.b&&0!=this.b.i}return VP(this,e-Y1(this.zh()),ee2((2&this.j)==0?this.zh():(this.k||(this.k=new c1),this.k).ck(),e))},eUe.sh=function(e,t){switch(e){case 0:this.c||(this.c=new eiR(this,0)),YH(this.c,t);return;case 1:(this.c||(this.c=new eiR(this,0)),Pp(Pp(GP(this.c,(eR7(),tvx)),153),215)).Wb(t);return;case 2:this.b||(this.b=new eiR(this,2)),YH(this.b,t);return}efL(this,e-Y1(this.zh()),ee2((2&this.j)==0?this.zh():(this.k||(this.k=new c1),this.k).ck(),e),t)},eUe.zh=function(){return eR7(),tvk},eUe.Bh=function(e){switch(e){case 0:this.c||(this.c=new eiR(this,0)),eRT(this.c);return;case 1:(this.c||(this.c=new eiR(this,0)),Pp(GP(this.c,(eR7(),tvx)),153)).$b();return;case 2:this.b||(this.b=new eiR(this,2)),eRT(this.b);return}ec5(this,e-Y1(this.zh()),ee2((2&this.j)==0?this.zh():(this.k||(this.k=new c1),this.k).ck(),e))},eUe.Ib=function(){var e;return(4&this.j)!=0?eMT(this):(e=new O1(eMT(this)),e.a+=" (mixed: ",xS(e,this.c),e.a+=", anyAttribute: ",xS(e,this.b),e.a+=")",e.a)},Y6(eQV,"AnyTypeImpl",830),eTS(667,506,{105:1,92:1,90:1,56:1,49:1,97:1,2021:1,667:1},ul),eUe._g=function(e,t,n){switch(e){case 0:return this.a;case 1:return this.b}return Qt(this,e-Y1((eR7(),tvj)),ee2((2&this.j)==0?tvj:(this.k||(this.k=new c1),this.k).ck(),e),t,n)},eUe.lh=function(e){switch(e){case 0:return null!=this.a;case 1:return null!=this.b}return VP(this,e-Y1((eR7(),tvj)),ee2((2&this.j)==0?tvj:(this.k||(this.k=new c1),this.k).ck(),e))},eUe.sh=function(e,t){switch(e){case 0:fg(this,Lq(t));return;case 1:fv(this,Lq(t));return}efL(this,e-Y1((eR7(),tvj)),ee2((2&this.j)==0?tvj:(this.k||(this.k=new c1),this.k).ck(),e),t)},eUe.zh=function(){return eR7(),tvj},eUe.Bh=function(e){switch(e){case 0:this.a=null;return;case 1:this.b=null;return}ec5(this,e-Y1((eR7(),tvj)),ee2((2&this.j)==0?tvj:(this.k||(this.k=new c1),this.k).ck(),e))},eUe.Ib=function(){var e;return(4&this.j)!=0?eMT(this):(e=new O1(eMT(this)),e.a+=" (data: ",xk(e,this.a),e.a+=", target: ",xk(e,this.b),e.a+=")",e.a)},eUe.a=null,eUe.b=null,Y6(eQV,"ProcessingInstructionImpl",667),eTS(668,830,{105:1,92:1,90:1,56:1,49:1,97:1,843:1,2022:1,668:1},mB),eUe._g=function(e,t,n){switch(e){case 0:if(n)return this.c||(this.c=new eiR(this,0)),this.c;return this.c||(this.c=new eiR(this,0)),this.c.b;case 1:if(n)return this.c||(this.c=new eiR(this,0)),Pp(GP(this.c,(eR7(),tvx)),153);return(this.c||(this.c=new eiR(this,0)),Pp(Pp(GP(this.c,(eR7(),tvx)),153),215)).kl();case 2:if(n)return this.b||(this.b=new eiR(this,2)),this.b;return this.b||(this.b=new eiR(this,2)),this.b.b;case 3:return this.c||(this.c=new eiR(this,0)),Lq(ePC(this.c,(eR7(),tvB),!0));case 4:return Iy(this.a,(this.c||(this.c=new eiR(this,0)),Lq(ePC(this.c,(eR7(),tvB),!0))));case 5:return this.a}return Qt(this,e-Y1((eR7(),tvY)),ee2((2&this.j)==0?tvY:(this.k||(this.k=new c1),this.k).ck(),e),t,n)},eUe.lh=function(e){switch(e){case 0:return!!this.c&&0!=this.c.i;case 1:return!(this.c||(this.c=new eiR(this,0)),Pp(GP(this.c,(eR7(),tvx)),153)).dc();case 2:return!!this.b&&0!=this.b.i;case 3:return this.c||(this.c=new eiR(this,0)),null!=Lq(ePC(this.c,(eR7(),tvB),!0));case 4:return null!=Iy(this.a,(this.c||(this.c=new eiR(this,0)),Lq(ePC(this.c,(eR7(),tvB),!0))));case 5:return!!this.a}return VP(this,e-Y1((eR7(),tvY)),ee2((2&this.j)==0?tvY:(this.k||(this.k=new c1),this.k).ck(),e))},eUe.sh=function(e,t){switch(e){case 0:this.c||(this.c=new eiR(this,0)),YH(this.c,t);return;case 1:(this.c||(this.c=new eiR(this,0)),Pp(Pp(GP(this.c,(eR7(),tvx)),153),215)).Wb(t);return;case 2:this.b||(this.b=new eiR(this,2)),YH(this.b,t);return;case 3:Kt(this,Lq(t));return;case 4:Kt(this,Iw(this.a,t));return;case 5:fy(this,Pp(t,148));return}efL(this,e-Y1((eR7(),tvY)),ee2((2&this.j)==0?tvY:(this.k||(this.k=new c1),this.k).ck(),e),t)},eUe.zh=function(){return eR7(),tvY},eUe.Bh=function(e){switch(e){case 0:this.c||(this.c=new eiR(this,0)),eRT(this.c);return;case 1:(this.c||(this.c=new eiR(this,0)),Pp(GP(this.c,(eR7(),tvx)),153)).$b();return;case 2:this.b||(this.b=new eiR(this,2)),eRT(this.b);return;case 3:this.c||(this.c=new eiR(this,0)),ePJ(this.c,(eR7(),tvB),null);return;case 4:Kt(this,Iw(this.a,null));return;case 5:this.a=null;return}ec5(this,e-Y1((eR7(),tvY)),ee2((2&this.j)==0?tvY:(this.k||(this.k=new c1),this.k).ck(),e))},Y6(eQV,"SimpleAnyTypeImpl",668),eTS(669,506,{105:1,92:1,90:1,56:1,49:1,97:1,2023:1,669:1},mY),eUe._g=function(e,t,n){switch(e){case 0:if(n)return this.a||(this.a=new eiR(this,0)),this.a;return this.a||(this.a=new eiR(this,0)),this.a.b;case 1:return n?(this.b||(this.b=new JY((eBK(),tgF),tgf,this,1)),this.b):(this.b||(this.b=new JY((eBK(),tgF),tgf,this,1)),X5(this.b));case 2:return n?(this.c||(this.c=new JY((eBK(),tgF),tgf,this,2)),this.c):(this.c||(this.c=new JY((eBK(),tgF),tgf,this,2)),X5(this.c));case 3:return this.a||(this.a=new eiR(this,0)),GP(this.a,(eR7(),tv$));case 4:return this.a||(this.a=new eiR(this,0)),GP(this.a,(eR7(),tvz));case 5:return this.a||(this.a=new eiR(this,0)),GP(this.a,(eR7(),tvW));case 6:return this.a||(this.a=new eiR(this,0)),GP(this.a,(eR7(),tvK))}return Qt(this,e-Y1((eR7(),tvH)),ee2((2&this.j)==0?tvH:(this.k||(this.k=new c1),this.k).ck(),e),t,n)},eUe.jh=function(e,t,n){var r;switch(t){case 0:return this.a||(this.a=new eiR(this,0)),eIM(this.a,e,n);case 1:return this.b||(this.b=new JY((eBK(),tgF),tgf,this,1)),Iz(this.b,e,n);case 2:return this.c||(this.c=new JY((eBK(),tgF),tgf,this,2)),Iz(this.c,e,n);case 5:return this.a||(this.a=new eiR(this,0)),Cp(GP(this.a,(eR7(),tvW)),e,n)}return(r=Pp(ee2((2&this.j)==0?(eR7(),tvH):(this.k||(this.k=new c1),this.k).ck(),t),66)).Nj().Rj(this,Q6(this),t-Y1((eR7(),tvH)),e,n)},eUe.lh=function(e){switch(e){case 0:return!!this.a&&0!=this.a.i;case 1:return!!this.b&&0!=this.b.f;case 2:return!!this.c&&0!=this.c.f;case 3:return this.a||(this.a=new eiR(this,0)),!xs(GP(this.a,(eR7(),tv$)));case 4:return this.a||(this.a=new eiR(this,0)),!xs(GP(this.a,(eR7(),tvz)));case 5:return this.a||(this.a=new eiR(this,0)),!xs(GP(this.a,(eR7(),tvW)));case 6:return this.a||(this.a=new eiR(this,0)),!xs(GP(this.a,(eR7(),tvK)))}return VP(this,e-Y1((eR7(),tvH)),ee2((2&this.j)==0?tvH:(this.k||(this.k=new c1),this.k).ck(),e))},eUe.sh=function(e,t){switch(e){case 0:this.a||(this.a=new eiR(this,0)),YH(this.a,t);return;case 1:this.b||(this.b=new JY((eBK(),tgF),tgf,this,1)),eai(this.b,t);return;case 2:this.c||(this.c=new JY((eBK(),tgF),tgf,this,2)),eai(this.c,t);return;case 3:this.a||(this.a=new eiR(this,0)),bG(GP(this.a,(eR7(),tv$))),this.a||(this.a=new eiR(this,0)),MJ(GP(this.a,tv$),Pp(t,14));return;case 4:this.a||(this.a=new eiR(this,0)),bG(GP(this.a,(eR7(),tvz))),this.a||(this.a=new eiR(this,0)),MJ(GP(this.a,tvz),Pp(t,14));return;case 5:this.a||(this.a=new eiR(this,0)),bG(GP(this.a,(eR7(),tvW))),this.a||(this.a=new eiR(this,0)),MJ(GP(this.a,tvW),Pp(t,14));return;case 6:this.a||(this.a=new eiR(this,0)),bG(GP(this.a,(eR7(),tvK))),this.a||(this.a=new eiR(this,0)),MJ(GP(this.a,tvK),Pp(t,14));return}efL(this,e-Y1((eR7(),tvH)),ee2((2&this.j)==0?tvH:(this.k||(this.k=new c1),this.k).ck(),e),t)},eUe.zh=function(){return eR7(),tvH},eUe.Bh=function(e){switch(e){case 0:this.a||(this.a=new eiR(this,0)),eRT(this.a);return;case 1:this.b||(this.b=new JY((eBK(),tgF),tgf,this,1)),this.b.c.$b();return;case 2:this.c||(this.c=new JY((eBK(),tgF),tgf,this,2)),this.c.c.$b();return;case 3:this.a||(this.a=new eiR(this,0)),bG(GP(this.a,(eR7(),tv$)));return;case 4:this.a||(this.a=new eiR(this,0)),bG(GP(this.a,(eR7(),tvz)));return;case 5:this.a||(this.a=new eiR(this,0)),bG(GP(this.a,(eR7(),tvW)));return;case 6:this.a||(this.a=new eiR(this,0)),bG(GP(this.a,(eR7(),tvK)));return}ec5(this,e-Y1((eR7(),tvH)),ee2((2&this.j)==0?tvH:(this.k||(this.k=new c1),this.k).ck(),e))},eUe.Ib=function(){var e;return(4&this.j)!=0?eMT(this):(e=new O1(eMT(this)),e.a+=" (mixed: ",xS(e,this.a),e.a+=")",e.a)},Y6(eQV,"XMLTypeDocumentRootImpl",669),eTS(1919,704,{105:1,92:1,90:1,471:1,147:1,56:1,108:1,49:1,97:1,150:1,114:1,115:1,2024:1},uc),eUe.Ih=function(e,t){switch(e.yj()){case 7:case 8:case 9:case 10:case 16:case 22:case 23:case 24:case 25:case 26:case 32:case 33:case 34:case 36:case 37:case 44:case 45:case 50:case 51:case 53:case 55:case 56:case 57:case 58:case 60:case 61:case 4:return null==t?null:efF(t);case 19:case 28:case 29:case 35:case 38:case 39:case 41:case 46:case 52:case 54:case 5:return Lq(t);case 6:return LH(Pp(t,190));case 12:case 47:case 49:case 11:return ejZ(this,e,t);case 13:return null==t?null:ePg(Pp(t,240));case 15:case 14:return null==t?null:Yk(gP(LV(t)));case 17:return eyV((eR7(),t));case 18:return eyV(t);case 21:case 20:return null==t?null:Yx(Pp(t,155).a);case 27:return L$(Pp(t,190));case 30:return emB((eR7(),Pp(t,15)));case 31:return emB(Pp(t,15));case 40:return LG((eR7(),t));case 42:return eyq((eR7(),t));case 43:return eyq(t);case 59:case 48:return Lz((eR7(),t));default:throw p7(new gL(eZ6+e.ne()+eZ5))}},eUe.Jh=function(e){var t;switch(-1==e.G&&(e.G=(t=etP(e))?ebv(t.Mh(),e):-1),e.G){case 0:return new mF;case 1:return new ul;case 2:return new mB;case 3:return new mY;default:throw p7(new gL(eZ7+e.zb+eZ5))}},eUe.Kh=function(e,t){var n,r,i,a,o,s,u,c,l,f,d,h,p,b,m,g;switch(e.yj()){case 5:case 52:case 4:return t;case 6:return epU(t);case 8:case 7:return null==t?null:ewe(t);case 9:return null==t?null:eeT(eDa((r=ePh(t,!0)).length>0&&(GV(0,r.length),43==r.charCodeAt(0))?r.substr(1):r,-128,127)<<24>>24);case 10:return null==t?null:eeT(eDa((i=ePh(t,!0)).length>0&&(GV(0,i.length),43==i.charCodeAt(0))?i.substr(1):i,-128,127)<<24>>24);case 11:return Lq(eBd(this,(eR7(),tvO),t));case 12:return Lq(eBd(this,(eR7(),tvA),t));case 13:return null==t?null:new yY(ePh(t,!0));case 15:case 14:return eOa(t);case 16:return Lq(eBd(this,(eR7(),tvL),t));case 17:return ehy((eR7(),t));case 18:return ehy(t);case 28:case 29:case 35:case 38:case 39:case 41:case 54:case 19:return ePh(t,!0);case 21:case 20:return eOv(t);case 22:return Lq(eBd(this,(eR7(),tvC),t));case 23:return Lq(eBd(this,(eR7(),tvI),t));case 24:return Lq(eBd(this,(eR7(),tvD),t));case 25:return Lq(eBd(this,(eR7(),tvN),t));case 26:return Lq(eBd(this,(eR7(),tvP),t));case 27:return epw(t);case 30:return ehw((eR7(),t));case 31:return ehw(t);case 32:return null==t?null:ell(eDa((l=ePh(t,!0)).length>0&&(GV(0,l.length),43==l.charCodeAt(0))?l.substr(1):l,eHt,eUu));case 33:return null==t?null:new TU((f=ePh(t,!0)).length>0&&(GV(0,f.length),43==f.charCodeAt(0))?f.substr(1):f);case 34:return null==t?null:ell(eDa((d=ePh(t,!0)).length>0&&(GV(0,d.length),43==d.charCodeAt(0))?d.substr(1):d,eHt,eUu));case 36:return null==t?null:ehQ(eF0((h=ePh(t,!0)).length>0&&(GV(0,h.length),43==h.charCodeAt(0))?h.substr(1):h));case 37:return null==t?null:ehQ(eF0((p=ePh(t,!0)).length>0&&(GV(0,p.length),43==p.charCodeAt(0))?p.substr(1):p));case 40:return edR((eR7(),t));case 42:return eh_((eR7(),t));case 43:return eh_(t);case 44:return null==t?null:new TU((b=ePh(t,!0)).length>0&&(GV(0,b.length),43==b.charCodeAt(0))?b.substr(1):b);case 45:return null==t?null:new TU((m=ePh(t,!0)).length>0&&(GV(0,m.length),43==m.charCodeAt(0))?m.substr(1):m);case 46:return ePh(t,!1);case 47:return Lq(eBd(this,(eR7(),tvR),t));case 59:case 48:return edP((eR7(),t));case 49:return Lq(eBd(this,(eR7(),tvF),t));case 50:return null==t?null:elf(eDa((g=ePh(t,!0)).length>0&&(GV(0,g.length),43==g.charCodeAt(0))?g.substr(1):g,eQl,32767)<<16>>16);case 51:return null==t?null:elf(eDa((a=ePh(t,!0)).length>0&&(GV(0,a.length),43==a.charCodeAt(0))?a.substr(1):a,eQl,32767)<<16>>16);case 53:return Lq(eBd(this,(eR7(),tvU),t));case 55:return null==t?null:elf(eDa((o=ePh(t,!0)).length>0&&(GV(0,o.length),43==o.charCodeAt(0))?o.substr(1):o,eQl,32767)<<16>>16);case 56:return null==t?null:elf(eDa((s=ePh(t,!0)).length>0&&(GV(0,s.length),43==s.charCodeAt(0))?s.substr(1):s,eQl,32767)<<16>>16);case 57:return null==t?null:ehQ(eF0((u=ePh(t,!0)).length>0&&(GV(0,u.length),43==u.charCodeAt(0))?u.substr(1):u));case 58:return null==t?null:ehQ(eF0((c=ePh(t,!0)).length>0&&(GV(0,c.length),43==c.charCodeAt(0))?c.substr(1):c));case 60:return null==t?null:ell(eDa((n=ePh(t,!0)).length>0&&(GV(0,n.length),43==n.charCodeAt(0))?n.substr(1):n,eHt,eUu));case 61:return null==t?null:ell(eDa(ePh(t,!0),eHt,eUu));default:throw p7(new gL(eZ6+e.ne()+eZ5))}},Y6(eQV,"XMLTypeFactoryImpl",1919),eTS(586,179,{105:1,92:1,90:1,147:1,191:1,56:1,235:1,108:1,49:1,97:1,150:1,179:1,114:1,115:1,675:1,1945:1,586:1},Ud),eUe.N=!1,eUe.O=!1;var tvi=!1;Y6(eQV,"XMLTypePackageImpl",586),eTS(1852,1,{837:1},uf),eUe._j=function(){return eD4(),eB2},Y6(eQV,"XMLTypePackageImpl/1",1852),eTS(1861,1,eQS,ud),eUe.wj=function(e){return xd(e)},eUe.xj=function(e){return Je(e17,eUP,2,e,6,1)},Y6(eQV,"XMLTypePackageImpl/10",1861),eTS(1862,1,eQS,uh),eUe.wj=function(e){return xd(e)},eUe.xj=function(e){return Je(e17,eUP,2,e,6,1)},Y6(eQV,"XMLTypePackageImpl/11",1862),eTS(1863,1,eQS,up),eUe.wj=function(e){return xd(e)},eUe.xj=function(e){return Je(e17,eUP,2,e,6,1)},Y6(eQV,"XMLTypePackageImpl/12",1863),eTS(1864,1,eQS,ub),eUe.wj=function(e){return xf(e)},eUe.xj=function(e){return Je(e13,eUP,333,e,7,1)},Y6(eQV,"XMLTypePackageImpl/13",1864),eTS(1865,1,eQS,um),eUe.wj=function(e){return xd(e)},eUe.xj=function(e){return Je(e17,eUP,2,e,6,1)},Y6(eQV,"XMLTypePackageImpl/14",1865),eTS(1866,1,eQS,ug),eUe.wj=function(e){return M4(e,15)},eUe.xj=function(e){return Je(e1H,ezZ,15,e,0,1)},Y6(eQV,"XMLTypePackageImpl/15",1866),eTS(1867,1,eQS,uv),eUe.wj=function(e){return M4(e,15)},eUe.xj=function(e){return Je(e1H,ezZ,15,e,0,1)},Y6(eQV,"XMLTypePackageImpl/16",1867),eTS(1868,1,eQS,uy),eUe.wj=function(e){return xd(e)},eUe.xj=function(e){return Je(e17,eUP,2,e,6,1)},Y6(eQV,"XMLTypePackageImpl/17",1868),eTS(1869,1,eQS,uw),eUe.wj=function(e){return M4(e,155)},eUe.xj=function(e){return Je(e14,eUP,155,e,0,1)},Y6(eQV,"XMLTypePackageImpl/18",1869),eTS(1870,1,eQS,u_),eUe.wj=function(e){return xd(e)},eUe.xj=function(e){return Je(e17,eUP,2,e,6,1)},Y6(eQV,"XMLTypePackageImpl/19",1870),eTS(1853,1,eQS,uE),eUe.wj=function(e){return M4(e,843)},eUe.xj=function(e){return Je(tve,eUp,843,e,0,1)},Y6(eQV,"XMLTypePackageImpl/2",1853),eTS(1871,1,eQS,uS),eUe.wj=function(e){return xd(e)},eUe.xj=function(e){return Je(e17,eUP,2,e,6,1)},Y6(eQV,"XMLTypePackageImpl/20",1871),eTS(1872,1,eQS,uk),eUe.wj=function(e){return xd(e)},eUe.xj=function(e){return Je(e17,eUP,2,e,6,1)},Y6(eQV,"XMLTypePackageImpl/21",1872),eTS(1873,1,eQS,ux),eUe.wj=function(e){return xd(e)},eUe.xj=function(e){return Je(e17,eUP,2,e,6,1)},Y6(eQV,"XMLTypePackageImpl/22",1873),eTS(1874,1,eQS,uT),eUe.wj=function(e){return xd(e)},eUe.xj=function(e){return Je(e17,eUP,2,e,6,1)},Y6(eQV,"XMLTypePackageImpl/23",1874),eTS(1875,1,eQS,uM),eUe.wj=function(e){return M4(e,190)},eUe.xj=function(e){return Je(tyk,eUP,190,e,0,2)},Y6(eQV,"XMLTypePackageImpl/24",1875),eTS(1876,1,eQS,uO),eUe.wj=function(e){return xd(e)},eUe.xj=function(e){return Je(e17,eUP,2,e,6,1)},Y6(eQV,"XMLTypePackageImpl/25",1876),eTS(1877,1,eQS,uA),eUe.wj=function(e){return xd(e)},eUe.xj=function(e){return Je(e17,eUP,2,e,6,1)},Y6(eQV,"XMLTypePackageImpl/26",1877),eTS(1878,1,eQS,uL),eUe.wj=function(e){return M4(e,15)},eUe.xj=function(e){return Je(e1H,ezZ,15,e,0,1)},Y6(eQV,"XMLTypePackageImpl/27",1878),eTS(1879,1,eQS,uC),eUe.wj=function(e){return M4(e,15)},eUe.xj=function(e){return Je(e1H,ezZ,15,e,0,1)},Y6(eQV,"XMLTypePackageImpl/28",1879),eTS(1880,1,eQS,uI),eUe.wj=function(e){return xd(e)},eUe.xj=function(e){return Je(e17,eUP,2,e,6,1)},Y6(eQV,"XMLTypePackageImpl/29",1880),eTS(1854,1,eQS,uD),eUe.wj=function(e){return M4(e,667)},eUe.xj=function(e){return Je(tvt,eUp,2021,e,0,1)},Y6(eQV,"XMLTypePackageImpl/3",1854),eTS(1881,1,eQS,uN),eUe.wj=function(e){return M4(e,19)},eUe.xj=function(e){return Je(e16,eUP,19,e,0,1)},Y6(eQV,"XMLTypePackageImpl/30",1881),eTS(1882,1,eQS,uP),eUe.wj=function(e){return xd(e)},eUe.xj=function(e){return Je(e17,eUP,2,e,6,1)},Y6(eQV,"XMLTypePackageImpl/31",1882),eTS(1883,1,eQS,uR),eUe.wj=function(e){return M4(e,162)},eUe.xj=function(e){return Je(e15,eUP,162,e,0,1)},Y6(eQV,"XMLTypePackageImpl/32",1883),eTS(1884,1,eQS,uj),eUe.wj=function(e){return xd(e)},eUe.xj=function(e){return Je(e17,eUP,2,e,6,1)},Y6(eQV,"XMLTypePackageImpl/33",1884),eTS(1885,1,eQS,uF),eUe.wj=function(e){return xd(e)},eUe.xj=function(e){return Je(e17,eUP,2,e,6,1)},Y6(eQV,"XMLTypePackageImpl/34",1885),eTS(1886,1,eQS,uY),eUe.wj=function(e){return xd(e)},eUe.xj=function(e){return Je(e17,eUP,2,e,6,1)},Y6(eQV,"XMLTypePackageImpl/35",1886),eTS(1887,1,eQS,uB),eUe.wj=function(e){return xd(e)},eUe.xj=function(e){return Je(e17,eUP,2,e,6,1)},Y6(eQV,"XMLTypePackageImpl/36",1887),eTS(1888,1,eQS,uU),eUe.wj=function(e){return M4(e,15)},eUe.xj=function(e){return Je(e1H,ezZ,15,e,0,1)},Y6(eQV,"XMLTypePackageImpl/37",1888),eTS(1889,1,eQS,uH),eUe.wj=function(e){return M4(e,15)},eUe.xj=function(e){return Je(e1H,ezZ,15,e,0,1)},Y6(eQV,"XMLTypePackageImpl/38",1889),eTS(1890,1,eQS,u$),eUe.wj=function(e){return xd(e)},eUe.xj=function(e){return Je(e17,eUP,2,e,6,1)},Y6(eQV,"XMLTypePackageImpl/39",1890),eTS(1855,1,eQS,uz),eUe.wj=function(e){return M4(e,668)},eUe.xj=function(e){return Je(tvn,eUp,2022,e,0,1)},Y6(eQV,"XMLTypePackageImpl/4",1855),eTS(1891,1,eQS,uG),eUe.wj=function(e){return xd(e)},eUe.xj=function(e){return Je(e17,eUP,2,e,6,1)},Y6(eQV,"XMLTypePackageImpl/40",1891),eTS(1892,1,eQS,uW),eUe.wj=function(e){return xd(e)},eUe.xj=function(e){return Je(e17,eUP,2,e,6,1)},Y6(eQV,"XMLTypePackageImpl/41",1892),eTS(1893,1,eQS,uK),eUe.wj=function(e){return xd(e)},eUe.xj=function(e){return Je(e17,eUP,2,e,6,1)},Y6(eQV,"XMLTypePackageImpl/42",1893),eTS(1894,1,eQS,uV),eUe.wj=function(e){return xd(e)},eUe.xj=function(e){return Je(e17,eUP,2,e,6,1)},Y6(eQV,"XMLTypePackageImpl/43",1894),eTS(1895,1,eQS,uq),eUe.wj=function(e){return xd(e)},eUe.xj=function(e){return Je(e17,eUP,2,e,6,1)},Y6(eQV,"XMLTypePackageImpl/44",1895),eTS(1896,1,eQS,uZ),eUe.wj=function(e){return M4(e,184)},eUe.xj=function(e){return Je(e18,eUP,184,e,0,1)},Y6(eQV,"XMLTypePackageImpl/45",1896),eTS(1897,1,eQS,uX),eUe.wj=function(e){return xd(e)},eUe.xj=function(e){return Je(e17,eUP,2,e,6,1)},Y6(eQV,"XMLTypePackageImpl/46",1897),eTS(1898,1,eQS,uJ),eUe.wj=function(e){return xd(e)},eUe.xj=function(e){return Je(e17,eUP,2,e,6,1)},Y6(eQV,"XMLTypePackageImpl/47",1898),eTS(1899,1,eQS,uQ),eUe.wj=function(e){return xd(e)},eUe.xj=function(e){return Je(e17,eUP,2,e,6,1)},Y6(eQV,"XMLTypePackageImpl/48",1899),eTS(eHx,1,eQS,u1),eUe.wj=function(e){return M4(e,184)},eUe.xj=function(e){return Je(e18,eUP,184,e,0,1)},Y6(eQV,"XMLTypePackageImpl/49",eHx),eTS(1856,1,eQS,u0),eUe.wj=function(e){return M4(e,669)},eUe.xj=function(e){return Je(tvr,eUp,2023,e,0,1)},Y6(eQV,"XMLTypePackageImpl/5",1856),eTS(1901,1,eQS,u2),eUe.wj=function(e){return M4(e,162)},eUe.xj=function(e){return Je(e15,eUP,162,e,0,1)},Y6(eQV,"XMLTypePackageImpl/50",1901),eTS(1902,1,eQS,u3),eUe.wj=function(e){return xd(e)},eUe.xj=function(e){return Je(e17,eUP,2,e,6,1)},Y6(eQV,"XMLTypePackageImpl/51",1902),eTS(1903,1,eQS,u4),eUe.wj=function(e){return M4(e,19)},eUe.xj=function(e){return Je(e16,eUP,19,e,0,1)},Y6(eQV,"XMLTypePackageImpl/52",1903),eTS(1857,1,eQS,u6),eUe.wj=function(e){return xd(e)},eUe.xj=function(e){return Je(e17,eUP,2,e,6,1)},Y6(eQV,"XMLTypePackageImpl/6",1857),eTS(1858,1,eQS,u5),eUe.wj=function(e){return M4(e,190)},eUe.xj=function(e){return Je(tyk,eUP,190,e,0,2)},Y6(eQV,"XMLTypePackageImpl/7",1858),eTS(1859,1,eQS,u8),eUe.wj=function(e){return xl(e)},eUe.xj=function(e){return Je(e11,eUP,476,e,8,1)},Y6(eQV,"XMLTypePackageImpl/8",1859),eTS(1860,1,eQS,u9),eUe.wj=function(e){return M4(e,217)},eUe.xj=function(e){return Je(e10,eUP,217,e,0,1)},Y6(eQV,"XMLTypePackageImpl/9",1860),eTS(50,60,eHr,gX),Y6(e1l,"RegEx/ParseException",50),eTS(820,1,{},u7),eUe.sl=function(e){return e16*n)throw p7(new gX(eBJ((Mo(),eJd))));n=16*n+i}if(125!=this.a)throw p7(new gX(eBJ((Mo(),eJh))));if(n>e1f)throw p7(new gX(eBJ((Mo(),eJp))));e=n}else{if(i=0,0!=this.c||(i=eb0(this.a))<0||(n=i,eBM(this),0!=this.c||(i=eb0(this.a))<0))throw p7(new gX(eBJ((Mo(),eJf))));e=n=16*n+i}break;case 117:if(r=0,eBM(this),0!=this.c||(r=eb0(this.a))<0||(t=r,eBM(this),0!=this.c||(r=eb0(this.a))<0)||(t=16*t+r,eBM(this),0!=this.c||(r=eb0(this.a))<0)||(t=16*t+r,eBM(this),0!=this.c||(r=eb0(this.a))<0))throw p7(new gX(eBJ((Mo(),eJf))));e=t=16*t+r;break;case 118:if(eBM(this),0!=this.c||(r=eb0(this.a))<0||(t=r,eBM(this),0!=this.c||(r=eb0(this.a))<0)||(t=16*t+r,eBM(this),0!=this.c||(r=eb0(this.a))<0)||(t=16*t+r,eBM(this),0!=this.c||(r=eb0(this.a))<0)||(t=16*t+r,eBM(this),0!=this.c||(r=eb0(this.a))<0)||(t=16*t+r,eBM(this),0!=this.c||(r=eb0(this.a))<0))throw p7(new gX(eBJ((Mo(),eJf))));if((t=16*t+r)>e1f)throw p7(new gX(eBJ((Mo(),"parser.descappe.4"))));e=t;break;case 65:case 90:case 122:throw p7(new gX(eBJ((Mo(),eJb))))}return e},eUe.ul=function(e){var t,n;switch(e){case 100:n=(32&this.e)==32?eYB("Nd",!0):(eBG(),tv9);break;case 68:n=(32&this.e)==32?eYB("Nd",!1):(eBG(),tyr);break;case 119:n=(32&this.e)==32?eYB("IsWord",!0):(eBG(),tyd);break;case 87:n=(32&this.e)==32?eYB("IsWord",!1):(eBG(),tya);break;case 115:n=(32&this.e)==32?eYB("IsSpace",!0):(eBG(),tys);break;case 83:n=(32&this.e)==32?eYB("IsSpace",!1):(eBG(),tyi);break;default:throw p7(new go(e1d+(t=e).toString(16)))}return n},eUe.vl=function(e){var t,n,r,i,a,o,s,u,c,l,f,d;for(this.b=1,eBM(this),t=null,0==this.c&&94==this.a?(eBM(this),e?l=(eBG(),eBG(),++tyv,new WZ(5)):(t=(eBG(),eBG(),++tyv,new WZ(4)),eLw(t,0,e1f),l=(++tyv,new WZ(4)))):l=(eBG(),eBG(),++tyv,new WZ(4)),i=!0;1!=(d=this.c)&&(0!=d||93!=this.a||i);){if(i=!1,n=this.a,r=!1,10==d)switch(n){case 100:case 68:case 119:case 87:case 115:case 83:ePR(l,this.ul(n)),r=!0;break;case 105:case 73:case 99:case 67:(n=this.Ll(l,n))<0&&(r=!0);break;case 112:case 80:if(!(f=ext(this,n)))throw p7(new gX(eBJ((Mo(),eJe))));ePR(l,f),r=!0;break;default:n=this.tl()}else if(20==d){if((o=AG(this.i,58,this.d))<0)throw p7(new gX(eBJ((Mo(),eJt))));if(s=!0,94==UI(this.i,this.d)&&(++this.d,s=!1),!(u=JI(a=Az(this.i,this.d,o),s,(512&this.e)==512)))throw p7(new gX(eBJ((Mo(),eJr))));if(ePR(l,u),r=!0,o+1>=this.j||93!=UI(this.i,o+1))throw p7(new gX(eBJ((Mo(),eJt))));this.d=o+2}if(eBM(this),!r){if(0!=this.c||45!=this.a)eLw(l,n,n);else{if(eBM(this),1==(d=this.c))throw p7(new gX(eBJ((Mo(),eJn))));0==d&&93==this.a?(eLw(l,n,n),eLw(l,45,45)):(c=this.a,10==d&&(c=this.tl()),eBM(this),eLw(l,n,c))}}(this.e&eXt)==eXt&&0==this.c&&44==this.a&&eBM(this)}if(1==this.c)throw p7(new gX(eBJ((Mo(),eJn))));return t&&(ej0(t,l),l=t),eMS(l),eRo(l),this.b=0,eBM(this),l},eUe.wl=function(){var e,t,n,r;for(n=this.vl(!1);7!=(r=this.c);)if(e=this.a,0==r&&(45==e||38==e)||4==r){if(eBM(this),9!=this.c)throw p7(new gX(eBJ((Mo(),eJu))));if(t=this.vl(!1),4==r)ePR(n,t);else if(45==e)ej0(n,t);else if(38==e)ejO(n,t);else throw p7(new go("ASSERT"))}else throw p7(new gX(eBJ((Mo(),eJc))));return eBM(this),n},eUe.xl=function(){var e,t;return e=this.a-48,t=(eBG(),eBG(),++tyv,new zc(12,null,e)),this.g||(this.g=new bZ),bY(this.g,new pX(e)),eBM(this),t},eUe.yl=function(){return eBM(this),eBG(),tyu},eUe.zl=function(){return eBM(this),eBG(),tyo},eUe.Al=function(){throw p7(new gX(eBJ((Mo(),eJm))))},eUe.Bl=function(){throw p7(new gX(eBJ((Mo(),eJm))))},eUe.Cl=function(){return eBM(this),esV()},eUe.Dl=function(){return eBM(this),eBG(),tyl},eUe.El=function(){return eBM(this),eBG(),tyh},eUe.Fl=function(){var e;if(this.d>=this.j||(65504&(e=UI(this.i,this.d++)))!=64)throw p7(new gX(eBJ((Mo(),eX5))));return eBM(this),eBG(),eBG(),++tyv,new jb(0,e-64)},eUe.Gl=function(){return eBM(this),eNw()},eUe.Hl=function(){return eBM(this),eBG(),typ},eUe.Il=function(){var e;return e=(eBG(),eBG(),++tyv,new jb(0,105)),eBM(this),e},eUe.Jl=function(){return eBM(this),eBG(),tyf},eUe.Kl=function(){return eBM(this),eBG(),tyc},eUe.Ll=function(e,t){return this.tl()},eUe.Ml=function(){return eBM(this),eBG(),tyt},eUe.Nl=function(){var e,t,n,r,i;if(this.d+1>=this.j)throw p7(new gX(eBJ((Mo(),eX3))));if(r=-1,t=null,49<=(e=UI(this.i,this.d))&&e<=57){if(r=e-48,this.g||(this.g=new bZ),bY(this.g,new pX(r)),++this.d,41!=UI(this.i,this.d))throw p7(new gX(eBJ((Mo(),eX1))));++this.d}else switch(63==e&&--this.d,eBM(this),(t=eBs(this)).e){case 20:case 21:case 22:case 23:break;case 8:if(7!=this.c)throw p7(new gX(eBJ((Mo(),eX1))));break;default:throw p7(new gX(eBJ((Mo(),eX4))))}if(eBM(this),i=ehT(this),n=null,2==i.e){if(2!=i.em())throw p7(new gX(eBJ((Mo(),eX6))));n=i.am(1),i=i.am(0)}if(7!=this.c)throw p7(new gX(eBJ((Mo(),eX1))));return eBM(this),eBG(),eBG(),++tyv,new ee_(r,t,i,n)},eUe.Ol=function(){return eBM(this),eBG(),tyn},eUe.Pl=function(){var e;if(eBM(this),e=F4(24,ehT(this)),7!=this.c)throw p7(new gX(eBJ((Mo(),eX1))));return eBM(this),e},eUe.Ql=function(){var e;if(eBM(this),e=F4(20,ehT(this)),7!=this.c)throw p7(new gX(eBJ((Mo(),eX1))));return eBM(this),e},eUe.Rl=function(){var e;if(eBM(this),e=F4(22,ehT(this)),7!=this.c)throw p7(new gX(eBJ((Mo(),eX1))));return eBM(this),e},eUe.Sl=function(){var e,t,n,r,i;for(e=0,n=0,t=-1;this.d=this.j)throw p7(new gX(eBJ((Mo(),eX0))));if(45==t){for(++this.d;this.d=this.j)throw p7(new gX(eBJ((Mo(),eX0))))}if(58==t){if(++this.d,eBM(this),r=Bu(ehT(this),e,n),7!=this.c)throw p7(new gX(eBJ((Mo(),eX1))));eBM(this)}else if(41==t)++this.d,eBM(this),r=Bu(ehT(this),e,n);else throw p7(new gX(eBJ((Mo(),eX2))));return r},eUe.Tl=function(){var e;if(eBM(this),e=F4(21,ehT(this)),7!=this.c)throw p7(new gX(eBJ((Mo(),eX1))));return eBM(this),e},eUe.Ul=function(){var e;if(eBM(this),e=F4(23,ehT(this)),7!=this.c)throw p7(new gX(eBJ((Mo(),eX1))));return eBM(this),e},eUe.Vl=function(){var e,t;if(eBM(this),e=this.f++,t=F6(ehT(this),e),7!=this.c)throw p7(new gX(eBJ((Mo(),eX1))));return eBM(this),t},eUe.Wl=function(){var e;if(eBM(this),e=F6(ehT(this),0),7!=this.c)throw p7(new gX(eBJ((Mo(),eX1))));return eBM(this),e},eUe.Xl=function(e){return(eBM(this),5==this.c)?(eBM(this),jS(e,(eBG(),eBG(),++tyv,new qa(9,e)))):jS(e,(eBG(),eBG(),++tyv,new qa(3,e)))},eUe.Yl=function(e){var t;return eBM(this),t=(eBG(),eBG(),++tyv,new Mr(2)),5==this.c?(eBM(this),eRv(t,tye),eRv(t,e)):(eRv(t,e),eRv(t,tye)),t},eUe.Zl=function(e){return(eBM(this),5==this.c)?(eBM(this),eBG(),eBG(),++tyv,new qa(9,e)):(eBG(),eBG(),++tyv,new qa(3,e))},eUe.a=0,eUe.b=0,eUe.c=0,eUe.d=0,eUe.e=0,eUe.f=1,eUe.g=null,eUe.j=0,Y6(e1l,"RegEx/RegexParser",820),eTS(1824,820,{},mU),eUe.sl=function(e){return!1},eUe.tl=function(){return eCn(this)},eUe.ul=function(e){return eDu(e)},eUe.vl=function(e){return eBL(this)},eUe.wl=function(){throw p7(new gX(eBJ((Mo(),eJm))))},eUe.xl=function(){throw p7(new gX(eBJ((Mo(),eJm))))},eUe.yl=function(){throw p7(new gX(eBJ((Mo(),eJm))))},eUe.zl=function(){throw p7(new gX(eBJ((Mo(),eJm))))},eUe.Al=function(){return eBM(this),eDu(67)},eUe.Bl=function(){return eBM(this),eDu(73)},eUe.Cl=function(){throw p7(new gX(eBJ((Mo(),eJm))))},eUe.Dl=function(){throw p7(new gX(eBJ((Mo(),eJm))))},eUe.El=function(){throw p7(new gX(eBJ((Mo(),eJm))))},eUe.Fl=function(){return eBM(this),eDu(99)},eUe.Gl=function(){throw p7(new gX(eBJ((Mo(),eJm))))},eUe.Hl=function(){throw p7(new gX(eBJ((Mo(),eJm))))},eUe.Il=function(){return eBM(this),eDu(105)},eUe.Jl=function(){throw p7(new gX(eBJ((Mo(),eJm))))},eUe.Kl=function(){throw p7(new gX(eBJ((Mo(),eJm))))},eUe.Ll=function(e,t){return ePR(e,eDu(t)),-1},eUe.Ml=function(){return eBM(this),eBG(),eBG(),++tyv,new jb(0,94)},eUe.Nl=function(){throw p7(new gX(eBJ((Mo(),eJm))))},eUe.Ol=function(){return eBM(this),eBG(),eBG(),++tyv,new jb(0,36)},eUe.Pl=function(){throw p7(new gX(eBJ((Mo(),eJm))))},eUe.Ql=function(){throw p7(new gX(eBJ((Mo(),eJm))))},eUe.Rl=function(){throw p7(new gX(eBJ((Mo(),eJm))))},eUe.Sl=function(){throw p7(new gX(eBJ((Mo(),eJm))))},eUe.Tl=function(){throw p7(new gX(eBJ((Mo(),eJm))))},eUe.Ul=function(){throw p7(new gX(eBJ((Mo(),eJm))))},eUe.Vl=function(){var e;if(eBM(this),e=F6(ehT(this),0),7!=this.c)throw p7(new gX(eBJ((Mo(),eX1))));return eBM(this),e},eUe.Wl=function(){throw p7(new gX(eBJ((Mo(),eJm))))},eUe.Xl=function(e){return eBM(this),jS(e,(eBG(),eBG(),++tyv,new qa(3,e)))},eUe.Yl=function(e){var t;return eBM(this),t=(eBG(),eBG(),++tyv,new Mr(2)),eRv(t,e),eRv(t,tye),t},eUe.Zl=function(e){return eBM(this),eBG(),eBG(),++tyv,new qa(3,e)};var tva=null,tvo=null;Y6(e1l,"RegEx/ParserForXMLSchema",1824),eTS(117,1,e1k,pJ),eUe.$l=function(e){throw p7(new go("Not supported."))},eUe._l=function(){return -1},eUe.am=function(e){return null},eUe.bm=function(){return null},eUe.cm=function(e){},eUe.dm=function(e){},eUe.em=function(){return 0},eUe.Ib=function(){return this.fm(0)},eUe.fm=function(e){return 11==this.e?".":""},eUe.e=0;var tvs,tvu,tvc,tvl,tvf,tvd,tvh,tvp,tvb,tvm,tvg,tvv,tvy,tvw,tv_,tvE,tvS,tvk,tvx,tvT,tvM,tvO,tvA,tvL,tvC,tvI,tvD,tvN,tvP,tvR,tvj,tvF,tvY,tvB,tvU,tvH,tv$,tvz,tvG,tvW,tvK,tvV,tvq,tvZ,tvX,tvJ,tvQ,tv1,tv0,tv2,tv3,tv4,tv6,tv5,tv8,tv9,tv7,tye,tyt,tyn,tyr,tyi,tya,tyo,tys,tyu,tyc,tyl,tyf,tyd,tyh,typ,tyb=null,tym=null,tyg=null,tyv=0,tyy=Y6(e1l,"RegEx/Token",117);eTS(136,117,{3:1,136:1,117:1},WZ),eUe.fm=function(e){var t,n,r;if(4==this.e){if(this==tv7)n=".";else if(this==tv9)n="\\d";else if(this==tyd)n="\\w";else if(this==tys)n="\\s";else{for(r=new vs,r.a+="[",t=0;t0&&(r.a+=","),this.b[t]===this.b[t+1]?xk(r,eN$(this.b[t])):(xk(r,eN$(this.b[t])),r.a+="-",xk(r,eN$(this.b[t+1])));r.a+="]",n=r.a}}else if(this==tyr)n="\\D";else if(this==tya)n="\\W";else if(this==tyi)n="\\S";else{for(r=new vs,r.a+="[^",t=0;t0&&(r.a+=","),this.b[t]===this.b[t+1]?xk(r,eN$(this.b[t])):(xk(r,eN$(this.b[t])),r.a+="-",xk(r,eN$(this.b[t+1])));r.a+="]",n=r.a}return n},eUe.a=!1,eUe.c=!1,Y6(e1l,"RegEx/RangeToken",136),eTS(584,1,{584:1},pX),eUe.a=0,Y6(e1l,"RegEx/RegexParser/ReferencePosition",584),eTS(583,1,{3:1,583:1},wu),eUe.Fb=function(e){var t;return!!(null!=e&&M4(e,583))&&(t=Pp(e,583),IE(this.b,t.b)&&this.a==t.a)},eUe.Hb=function(){return ebA(this.b+"/"+eAN(this.a))},eUe.Ib=function(){return this.c.fm(this.a)},eUe.a=0,Y6(e1l,"RegEx/RegularExpression",583),eTS(223,117,e1k,jb),eUe._l=function(){return this.a},eUe.fm=function(e){var t,n,r;switch(this.e){case 0:switch(this.a){case 124:case 42:case 43:case 63:case 40:case 41:case 46:case 91:case 123:case 92:r="\\"+CB(this.a&eHd);break;case 12:r="\\f";break;case 10:r="\\n";break;case 13:r="\\r";break;case 9:r="\\t";break;case 27:r="\\e";break;default:r=this.a>=eH3?"\\v"+Az(n="0"+(t=this.a>>>0).toString(16),n.length-6,n.length):""+CB(this.a&eHd)}break;case 8:r=this==tyt||this==tyn?""+CB(this.a&eHd):"\\"+CB(this.a&eHd);break;default:r=null}return r},eUe.a=0,Y6(e1l,"RegEx/Token/CharToken",223),eTS(309,117,e1k,qa),eUe.am=function(e){return this.a},eUe.cm=function(e){this.b=e},eUe.dm=function(e){this.c=e},eUe.em=function(){return 1},eUe.fm=function(e){var t;if(3==this.e){if(this.c<0&&this.b<0)t=this.a.fm(e)+"*";else if(this.c==this.b)t=this.a.fm(e)+"{"+this.c+"}";else if(this.c>=0&&this.b>=0)t=this.a.fm(e)+"{"+this.c+","+this.b+"}";else if(this.c>=0&&this.b<0)t=this.a.fm(e)+"{"+this.c+",}";else throw p7(new go("Token#toString(): CLOSURE "+this.c+eUd+this.b))}else if(this.c<0&&this.b<0)t=this.a.fm(e)+"*?";else if(this.c==this.b)t=this.a.fm(e)+"{"+this.c+"}?";else if(this.c>=0&&this.b>=0)t=this.a.fm(e)+"{"+this.c+","+this.b+"}?";else if(this.c>=0&&this.b<0)t=this.a.fm(e)+"{"+this.c+",}?";else throw p7(new go("Token#toString(): NONGREEDYCLOSURE "+this.c+eUd+this.b));return t},eUe.b=0,eUe.c=0,Y6(e1l,"RegEx/Token/ClosureToken",309),eTS(821,117,e1k,YD),eUe.am=function(e){return 0==e?this.a:this.b},eUe.em=function(){return 2},eUe.fm=function(e){var t;return 3==this.b.e&&this.b.am(0)==this.a?this.a.fm(e)+"+":9==this.b.e&&this.b.am(0)==this.a?this.a.fm(e)+"+?":this.a.fm(e)+""+this.b.fm(e)},Y6(e1l,"RegEx/Token/ConcatToken",821),eTS(1822,117,e1k,ee_),eUe.am=function(e){if(0==e)return this.d;if(1==e)return this.b;throw p7(new go("Internal Error: "+e))},eUe.em=function(){return this.b?2:1},eUe.fm=function(e){var t;return t=this.c>0?"(?("+this.c+")":8==this.a.e?"(?("+this.a+")":"(?"+this.a,this.b?t+=this.d+"|"+this.b+")":t+=this.d+")",t},eUe.c=0,Y6(e1l,"RegEx/Token/ConditionToken",1822),eTS(1823,117,e1k,Wq),eUe.am=function(e){return this.b},eUe.em=function(){return 1},eUe.fm=function(e){return"(?"+(0==this.a?"":eAN(this.a))+(0==this.c?"":eAN(this.c))+":"+this.b.fm(e)+")"},eUe.a=0,eUe.c=0,Y6(e1l,"RegEx/Token/ModifierToken",1823),eTS(822,117,e1k,BR),eUe.am=function(e){return this.a},eUe.em=function(){return 1},eUe.fm=function(e){var t;switch(t=null,this.e){case 6:t=0==this.b?"(?:"+this.a.fm(e)+")":"("+this.a.fm(e)+")";break;case 20:t="(?="+this.a.fm(e)+")";break;case 21:t="(?!"+this.a.fm(e)+")";break;case 22:t="(?<="+this.a.fm(e)+")";break;case 23:t="(?"+this.a.fm(e)+")"}return t},eUe.b=0,Y6(e1l,"RegEx/Token/ParenToken",822),eTS(521,117,{3:1,117:1,521:1},zc),eUe.bm=function(){return this.b},eUe.fm=function(e){return 12==this.e?"\\"+this.a:eTd(this.b)},eUe.a=0,Y6(e1l,"RegEx/Token/StringToken",521),eTS(465,117,e1k,Mr),eUe.$l=function(e){eRv(this,e)},eUe.am=function(e){return Pp(Bz(this.a,e),117)},eUe.em=function(){return this.a?this.a.a.c.length:0},eUe.fm=function(e){var t,n,r,i,a;if(1==this.e){if(2==this.a.a.c.length)t=Pp(Bz(this.a,0),117),i=3==(n=Pp(Bz(this.a,1),117)).e&&n.am(0)==t?t.fm(e)+"+":9==n.e&&n.am(0)==t?t.fm(e)+"+?":t.fm(e)+""+n.fm(e);else{for(r=0,a=new vs;r=this.c.b:this.a<=this.c.b},eUe.Sb=function(){return this.b>0},eUe.Tb=function(){return this.b},eUe.Vb=function(){return this.b-1},eUe.Qb=function(){throw p7(new gW(e1L))},eUe.a=0,eUe.b=0,Y6(e1M,"ExclusiveRange/RangeIterator",254);var tyw=Ui(eJX,"C"),ty_=Ui(eJ1,"I"),tyE=Ui(eUi,"Z"),tyS=Ui(eJ0,"J"),tyk=Ui(eJZ,"B"),tyx=Ui(eJJ,"D"),tyT=Ui(eJQ,"F"),tyM=Ui(eJ2,"S"),tyO=RL("org.eclipse.elk.core.labels","ILabelManager"),tyA=RL(eX_,"DiagnosticChain"),tyL=RL(eQx,"ResourceSet"),tyC=Y6(eX_,"InvocationTargetException",null),tyI=(vg(),q5),tyD=tyD=eyP;enI(bs),eiE("permProps",[[[e1C,e1I],[e1D,"gecko1_8"]],[[e1C,e1I],[e1D,"ie10"]],[[e1C,e1I],[e1D,"ie8"]],[[e1C,e1I],[e1D,"ie9"]],[[e1C,e1I],[e1D,"safari"]]]),tyD(null,"elk",null)},3379(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}function a(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var o=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};r(this,t);var a=Object.assign({},e),o=!1;try{o=!0}catch(s){}if(e.workerUrl){if(o){var u=n(84763);a.workerFactory=function(e){return new u(e)}}else console.warn("Web worker requested but 'web-worker' package not installed. \nConsider installing the package or pass your own 'workerFactory' to ELK's constructor.\n... Falling back to non-web worker version.")}if(!a.workerFactory){var c=n(55273).Worker;a.workerFactory=function(e){return new c(e)}}return i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,a))}return a(t,e),t}(n(4005).default);Object.defineProperty(e.exports,"__esModule",{value:!0}),e.exports=o,o.default=o},17187(e){"use strict";var t,n="object"==typeof Reflect?Reflect:null,r=n&&"function"==typeof n.apply?n.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};function i(e){console&&console.warn&&console.warn(e)}t=n&&"function"==typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var a=Number.isNaN||function(e){return e!=e};function o(){o.init.call(this)}e.exports=o,e.exports.once=v,o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var s=10;function u(e){if("function"!=typeof e)throw TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function c(e){return void 0===e._maxListeners?o.defaultMaxListeners:e._maxListeners}function l(e,t,n,r){if(u(n),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),o=e._events),s=o[t]),void 0===s)s=o[t]=n,++e._eventsCount;else if("function"==typeof s?s=o[t]=r?[n,s]:[s,n]:r?s.unshift(n):s.push(n),(a=c(e))>0&&s.length>a&&!s.warned){s.warned=!0;var a,o,s,l=Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=t,l.count=s.length,i(l)}return e}function f(){if(!this.fired)return(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length)?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=f.bind(r);return i.listener=n,r.wrapFn=i,i}function h(e,t,n){var r=e._events;if(void 0===r)return[];var i=r[t];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?g(i):b(i,i.length)}function p(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function b(e,t){for(var n=Array(t),r=0;r0&&(o=t[0]),o instanceof Error)throw o;var o,s=Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var u=a[e];if(void 0===u)return!1;if("function"==typeof u)r(u,this,t);else for(var c=u.length,l=b(u,c),n=0;n=0;a--)if(n[a]===t||n[a].listener===t){o=n[a].listener,i=a;break}if(i<0)return this;0===i?n.shift():m(n,i),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,o||t)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(e){var t,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var i,a=Object.keys(n);for(r=0;r=0;r--)this.removeListener(e,t[r]);return this},o.prototype.listeners=function(e){return h(this,e,!0)},o.prototype.rawListeners=function(e){return h(this,e,!1)},o.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):p.call(e,t)},o.prototype.listenerCount=p,o.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},16839(e,t,n){var r=n(25323),i=n(31744),a=n(98361),o=n(4514);e.exports={graphlib:n(32478),read:r,readMany:i,write:a,version:o,type:"dot",buffer:!1}},11100(e,t,n){"use strict";var r=n(47755),i=n(32478).Graph;function a(e){var t="graph"!==e.type,n=!e.strict,a=[{node:{},edge:{}}],s=e.id,u=new i({directed:t,multigraph:n,compound:!0});return u.setGraph(null===s?{}:{id:s}),r.each(e.stmts,function(e){o(u,e,a)}),u}function o(e,t,n,r){switch(t.type){case"node":s(e,t,n,r);break;case"edge":u(e,t,n,r);break;case"subgraph":c(e,t,n,r);break;case"attr":l(e,t,n);break;case"inlineAttr":f(e,t,n,r)}}function s(e,t,n,i){var a=t.id,o=t.attrs;h(e,a,n,i),r.merge(e.node(a),o)}function u(e,t,n,i){var a,s,u=t.attrs;r.each(t.elems,function(t){switch(o(e,t,n,i),t.type){case"node":s=[t.id];break;case"subgraph":s=p(t)}r.each(a,function(t){r.each(s,function(i){var a;e.hasEdge(t,i)&&e.isMultigraph()&&(a=r.uniqueId("edge")),e.hasEdge(t,i,a)||e.setEdge(t,i,r.clone(r.last(n).edge),a),r.merge(e.edge(t,i,a),u)})}),a=s})}function c(e,t,n,i){var a=t.id;void 0===a&&(a=d(e)),n.push(r.clone(r.last(n))),h(e,a,n,i),r.each(t.stmts,function(t){o(e,t,n,a)}),e.children(a).length||e.removeNode(a),n.pop()}function l(e,t,n){r.merge(r.last(n)[t.attrType],t.attrs)}function f(e,t,n,i){r.merge(i?e.node(i):e.graph(),t.attrs)}function d(e){var t;do t=r.uniqueId("sg");while(e.hasNode(t))return t}function h(e,t,n,i){e.hasNode(t)||(e.setNode(t,r.clone(r.last(n).node)),e.setParent(t,i))}function p(e){var t,n={},i=[],a=i.push.bind(i);for(a(e);i.length;)switch((t=i.pop()).type){case"node":n[t.id]=!0;break;case"edge":r.each(t.elems,a);break;case"subgraph":r.each(t.stmts,a)}return r.keys(n)}e.exports=a},4644(e,t,n){e.exports=function(){function e(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n}function t(e,t,n,r,i,a){this.message=e,this.expected=t,this.found=n,this.offset=r,this.line=i,this.column=a,this.name="SyntaxError"}function r(e){var r,i,a=arguments.length>1?arguments[1]:{},o={},s={start:tf,graphStmt:td},u=tf,c=o,l=null,f="{",d={type:"literal",value:"{",description:'"{"'},h="}",p={type:"literal",value:"}",description:'"}"'},b=function(e,t,n,r){return{type:t,id:n,strict:null!==e,stmts:r}},m=";",g={type:"literal",value:";",description:'";"'},v=function(e,t){for(var n=[e],r=0;r",description:'"->"'},U=function(e,t){var n=[e];if(t)for(var r=0;rt&&(tr=0,ti={line:1,column:1,seenCR:!1}),n(ti,tr,t),tr=t),ti}function tc(e){!(ttta&&(ta=tt,to=[]),to.push(e))}function tl(n,r,i){function a(e){var t=1;for(e.sort(function(e,t){return e.descriptiont.description?1:0});t1?o.slice(0,-1).join(", ")+" or "+o[e.length-1]:o[0])+" but "+(i=t?'"'+n(t)+'"':"end of input")+" found."}var s=tu(i),u=itt?(s=e.charAt(tt),tt++):(s=o,0===ts&&tc(te)),s!==o?i=a=[a,s]:(tt=i,i=c)):(tt=i,i=c);i!==o;)r.push(i),i=tt,a=tt,ts++,e.substr(tt,2)===e9?(s=e9,tt+=2):(s=o,0===ts&&tc(e7)),ts--,s===o?a=F:(tt=a,a=c),a!==o?(e.length>tt?(s=e.charAt(tt),tt++):(s=o,0===ts&&tc(te)),s!==o?i=a=[a,s]:(tt=i,i=c)):(tt=i,i=c);r!==o?(e.substr(tt,2)===e9?(i=e9,tt+=2):(i=o,0===ts&&tc(e7)),i!==o?t=n=[n,r,i]:(tt=t,t=c)):(tt=t,t=c)}else tt=t,t=c}return ts--,t===o&&(n=o,0===ts&&tc(e0)),t}function tY(){var e;return(e=tj())===o&&(e=tF()),e}var tB=n(47755);if((i=u())!==o&&tt===e.length)return i;throw i!==o&&tt":"--",n=new f;e.isMultigraph()||n.write("strict "),n.writeLine((e.isDirected()?"digraph":"graph")+" {"),n.indent();var i=e.graph();return r.isObject(i)&&r.each(i,function(e,t){n.writeLine(l(t)+"="+l(e)+";")}),o(e,void 0,n),e.edges().forEach(function(r){u(e,r,t,n)}),n.unindent(),n.writeLine("}"),n.toString()}function o(e,t,n){var i=e.isCompound()?e.children(t):e.nodes();r.each(i,function(t){e.isCompound()&&e.children(t).length?(n.writeLine("subgraph "+l(t)+" {"),n.indent(),r.isObject(e.node(t))&&r.map(e.node(t),function(e,t){n.writeLine(l(t)+"="+l(e)+";")}),o(e,t,n),n.unindent(),n.writeLine("}")):s(e,t,n)})}function s(e,t,n){n.write(l(t)),c(e.node(t),n),n.writeLine()}function u(e,t,n,r){var i=t.v,a=t.w,o=e.edge(t);r.write(l(i)+" "+n+" "+l(a)),c(o,r),r.writeLine()}function c(e,t){if(r.isObject(e)){var n=r.map(e,function(e,t){return l(t)+"="+l(e)});n.length&&t.write(" ["+n.join(",")+"]")}}function l(e){return"number"==typeof e||e.toString().match(i)?e:'"'+e.toString().replace(/"/g,'\\"')+'"'}function f(){this._indent="",this._content="",this._shouldIndent=!0}f.prototype.INDENT=" ",f.prototype.indent=function(){this._indent+=this.INDENT},f.prototype.unindent=function(){this._indent=this._indent.slice(this.INDENT.length)},f.prototype.writeLine=function(e){this.write((e||"")+"\n"),this._shouldIndent=!0},f.prototype.write=function(e){this._shouldIndent&&(this._shouldIndent=!1,this._content+=this._indent),this._content+=e},f.prototype.toString=function(){return this._content}},28282(e,t,n){var r=n(82354);e.exports={Graph:r.Graph,json:n(28974),alg:n(12440),version:r.version}},2842(e,t,n){var r=n(89126);function i(e){var t,n={},i=[];function a(i){r.has(n,i)||(n[i]=!0,t.push(i),r.each(e.successors(i),a),r.each(e.predecessors(i),a))}return r.each(e.nodes(),function(e){t=[],a(e),t.length&&i.push(t)}),i}e.exports=i},53984(e,t,n){var r=n(89126);function i(e,t,n){r.isArray(t)||(t=[t]);var i=(e.isDirected()?e.successors:e.neighbors).bind(e),o=[],s={};return r.each(t,function(t){if(!e.hasNode(t))throw Error("Graph does not have node: "+t);a(e,t,"post"===n,s,i,o)}),o}function a(e,t,n,i,o,s){!r.has(i,t)&&(i[t]=!0,n||s.push(t),r.each(o(t),function(t){a(e,t,n,i,o,s)}),n&&s.push(t))}e.exports=i},84847(e,t,n){var r=n(63763),i=n(89126);function a(e,t,n){return i.transform(e.nodes(),function(i,a){i[a]=r(e,a,t,n)},{})}e.exports=a},63763(e,t,n){var r=n(89126),i=n(75639);e.exports=o;var a=r.constant(1);function o(e,t,n,r){return s(e,String(t),n||a,r||function(t){return e.outEdges(t)})}function s(e,t,n,r){var a,o,s={},u=new i,c=function(e){var t=e.v!==a?e.v:e.w,r=s[t],i=n(e),c=o.distance+i;if(i<0)throw Error("dijkstra does not allow negative edge weights. Bad edge: "+e+" Weight: "+i);c0&&(o=s[a=u.removeMin()]).distance!==Number.POSITIVE_INFINITY;)r(a).forEach(c);return s}},9096(e,t,n){var r=n(89126),i=n(5023);function a(e){return r.filter(i(e),function(t){return t.length>1||1===t.length&&e.hasEdge(t[0],t[0])})}e.exports=a},38924(e,t,n){var r=n(89126);e.exports=a;var i=r.constant(1);function a(e,t,n){return o(e,t||i,n||function(t){return e.outEdges(t)})}function o(e,t,n){var r={},i=e.nodes();return i.forEach(function(e){r[e]={},r[e][e]={distance:0},i.forEach(function(t){e!==t&&(r[e][t]={distance:Number.POSITIVE_INFINITY})}),n(e).forEach(function(n){var i=n.v===e?n.w:n.v,a=t(n);r[e][i]={distance:a,predecessor:e}})}),i.forEach(function(e){var t=r[e];i.forEach(function(n){var a=r[n];i.forEach(function(n){var r=a[e],i=t[n],o=a[n],s=r.distance+i.distance;s0;){if(n=u.removeMin(),r.has(s,n))o.setEdge(n,s[n]);else if(l)throw Error("Input graph is not connected: "+e);else l=!0;e.nodeEdges(n).forEach(c)}return o}e.exports=o},5023(e,t,n){var r=n(89126);function i(e){var t=0,n=[],i={},a=[];function o(s){var u=i[s]={onStack:!0,lowlink:t,index:t++};if(n.push(s),e.successors(s).forEach(function(e){r.has(i,e)?i[e].onStack&&(u.lowlink=Math.min(u.lowlink,i[e].index)):(o(e),u.lowlink=Math.min(u.lowlink,i[e].lowlink))}),u.lowlink===u.index){var c,l=[];do i[c=n.pop()].onStack=!1,l.push(c);while(s!==c)a.push(l)}}return e.nodes().forEach(function(e){r.has(i,e)||o(e)}),a}e.exports=i},2166(e,t,n){var r=n(89126);function i(e){var t={},n={},i=[];function o(s){if(r.has(n,s))throw new a;r.has(t,s)||(n[s]=!0,t[s]=!0,r.each(e.predecessors(s),o),delete n[s],i.push(s))}if(r.each(e.sinks(),o),r.size(t)!==e.nodeCount())throw new a;return i}function a(){}e.exports=i,i.CycleException=a,a.prototype=Error()},75639(e,t,n){var r=n(89126);function i(){this._arr=[],this._keyIndices={}}e.exports=i,i.prototype.size=function(){return this._arr.length},i.prototype.keys=function(){return this._arr.map(function(e){return e.key})},i.prototype.has=function(e){return r.has(this._keyIndices,e)},i.prototype.priority=function(e){var t=this._keyIndices[e];if(void 0!==t)return this._arr[t].priority},i.prototype.min=function(){if(0===this.size())throw Error("Queue underflow");return this._arr[0].key},i.prototype.add=function(e,t){var n=this._keyIndices;if(e=String(e),!r.has(n,e)){var i=this._arr,a=i.length;return n[e]=a,i.push({key:e,priority:t}),this._decrease(a),!0}return!1},i.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var e=this._arr.pop();return delete this._keyIndices[e.key],this._heapify(0),e.key},i.prototype.decrease=function(e,t){var n=this._keyIndices[e];if(t>this._arr[n].priority)throw Error("New priority is greater than current priority. Key: "+e+" Old: "+this._arr[n].priority+" New: "+t);this._arr[n].priority=t,this._decrease(n)},i.prototype._heapify=function(e){var t=this._arr,n=2*e,r=n+1,i=e;n>1].priorityu){var c=s;s=u,u=c}return s+o+u+o+(r.isUndefined(a)?i:a)}function f(e,t,n,r){var i=""+t,a=""+n;if(!e&&i>a){var o=i;i=a,a=o}var s={v:i,w:a};return r&&(s.name=r),s}function d(e,t){return l(e,t.v,t.w,t.name)}s.prototype._nodeCount=0,s.prototype._edgeCount=0,s.prototype.isDirected=function(){return this._isDirected},s.prototype.isMultigraph=function(){return this._isMultigraph},s.prototype.isCompound=function(){return this._isCompound},s.prototype.setGraph=function(e){return this._label=e,this},s.prototype.graph=function(){return this._label},s.prototype.setDefaultNodeLabel=function(e){return r.isFunction(e)||(e=r.constant(e)),this._defaultNodeLabelFn=e,this},s.prototype.nodeCount=function(){return this._nodeCount},s.prototype.nodes=function(){return r.keys(this._nodes)},s.prototype.sources=function(){var e=this;return r.filter(this.nodes(),function(t){return r.isEmpty(e._in[t])})},s.prototype.sinks=function(){var e=this;return r.filter(this.nodes(),function(t){return r.isEmpty(e._out[t])})},s.prototype.setNodes=function(e,t){var n=arguments,i=this;return r.each(e,function(e){n.length>1?i.setNode(e,t):i.setNode(e)}),this},s.prototype.setNode=function(e,t){return r.has(this._nodes,e)?(arguments.length>1&&(this._nodes[e]=t),this):(this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=a,this._children[e]={},this._children[a][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)},s.prototype.node=function(e){return this._nodes[e]},s.prototype.hasNode=function(e){return r.has(this._nodes,e)},s.prototype.removeNode=function(e){var t=this;if(r.has(this._nodes,e)){var n=function(e){t.removeEdge(t._edgeObjs[e])};delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],r.each(this.children(e),function(e){t.setParent(e)}),delete this._children[e]),r.each(r.keys(this._in[e]),n),delete this._in[e],delete this._preds[e],r.each(r.keys(this._out[e]),n),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this},s.prototype.setParent=function(e,t){if(!this._isCompound)throw Error("Cannot set parent in a non-compound graph");if(r.isUndefined(t))t=a;else{t+="";for(var n=t;!r.isUndefined(n);n=this.parent(n))if(n===e)throw Error("Setting "+t+" as parent of "+e+" would create a cycle");this.setNode(t)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=t,this._children[t][e]=!0,this},s.prototype._removeFromParentsChildList=function(e){delete this._children[this._parent[e]][e]},s.prototype.parent=function(e){if(this._isCompound){var t=this._parent[e];if(t!==a)return t}},s.prototype.children=function(e){if(r.isUndefined(e)&&(e=a),this._isCompound){var t=this._children[e];if(t)return r.keys(t)}else if(e===a)return this.nodes();else if(this.hasNode(e))return[]},s.prototype.predecessors=function(e){var t=this._preds[e];if(t)return r.keys(t)},s.prototype.successors=function(e){var t=this._sucs[e];if(t)return r.keys(t)},s.prototype.neighbors=function(e){var t=this.predecessors(e);if(t)return r.union(t,this.successors(e))},s.prototype.isLeaf=function(e){var t;return 0===(t=this.isDirected()?this.successors(e):this.neighbors(e)).length},s.prototype.filterNodes=function(e){var t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph());var n=this;r.each(this._nodes,function(n,r){e(r)&&t.setNode(r,n)}),r.each(this._edgeObjs,function(e){t.hasNode(e.v)&&t.hasNode(e.w)&&t.setEdge(e,n.edge(e))});var i={};function a(e){var r=n.parent(e);return void 0===r||t.hasNode(r)?(i[e]=r,r):r in i?i[r]:a(r)}return this._isCompound&&r.each(t.nodes(),function(e){t.setParent(e,a(e))}),t},s.prototype.setDefaultEdgeLabel=function(e){return r.isFunction(e)||(e=r.constant(e)),this._defaultEdgeLabelFn=e,this},s.prototype.edgeCount=function(){return this._edgeCount},s.prototype.edges=function(){return r.values(this._edgeObjs)},s.prototype.setPath=function(e,t){var n=this,i=arguments;return r.reduce(e,function(e,r){return i.length>1?n.setEdge(e,r,t):n.setEdge(e,r),r}),this},s.prototype.setEdge=function(){var e,t,n,i,a=!1,o=arguments[0];"object"==typeof o&&null!==o&&"v"in o?(e=o.v,t=o.w,n=o.name,2===arguments.length&&(i=arguments[1],a=!0)):(e=o,t=arguments[1],n=arguments[3],arguments.length>2&&(i=arguments[2],a=!0)),e=""+e,t=""+t,r.isUndefined(n)||(n=""+n);var s=l(this._isDirected,e,t,n);if(r.has(this._edgeLabels,s))return a&&(this._edgeLabels[s]=i),this;if(!r.isUndefined(n)&&!this._isMultigraph)throw Error("Cannot set a named edge when isMultigraph = false");this.setNode(e),this.setNode(t),this._edgeLabels[s]=a?i:this._defaultEdgeLabelFn(e,t,n);var c=f(this._isDirected,e,t,n);return e=c.v,t=c.w,Object.freeze(c),this._edgeObjs[s]=c,u(this._preds[t],e),u(this._sucs[e],t),this._in[t][s]=c,this._out[e][s]=c,this._edgeCount++,this},s.prototype.edge=function(e,t,n){var r=1===arguments.length?d(this._isDirected,arguments[0]):l(this._isDirected,e,t,n);return this._edgeLabels[r]},s.prototype.hasEdge=function(e,t,n){var i=1===arguments.length?d(this._isDirected,arguments[0]):l(this._isDirected,e,t,n);return r.has(this._edgeLabels,i)},s.prototype.removeEdge=function(e,t,n){var r=1===arguments.length?d(this._isDirected,arguments[0]):l(this._isDirected,e,t,n),i=this._edgeObjs[r];return i&&(e=i.v,t=i.w,delete this._edgeLabels[r],delete this._edgeObjs[r],c(this._preds[t],e),c(this._sucs[e],t),delete this._in[t][r],delete this._out[e][r],this._edgeCount--),this},s.prototype.inEdges=function(e,t){var n=this._in[e];if(n){var i=r.values(n);return t?r.filter(i,function(e){return e.v===t}):i}},s.prototype.outEdges=function(e,t){var n=this._out[e];if(n){var i=r.values(n);return t?r.filter(i,function(e){return e.w===t}):i}},s.prototype.nodeEdges=function(e,t){var n=this.inEdges(e,t);if(n)return n.concat(this.outEdges(e,t))}},82354(e,t,n){e.exports={Graph:n(30771),version:n(49631)}},28974(e,t,n){var r=n(89126),i=n(30771);function a(e){var t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:o(e),edges:s(e)};return r.isUndefined(e.graph())||(t.value=r.clone(e.graph())),t}function o(e){return r.map(e.nodes(),function(t){var n=e.node(t),i=e.parent(t),a={v:t};return r.isUndefined(n)||(a.value=n),r.isUndefined(i)||(a.parent=i),a})}function s(e){return r.map(e.edges(),function(t){var n=e.edge(t),i={v:t.v,w:t.w};return r.isUndefined(t.name)||(i.name=t.name),r.isUndefined(n)||(i.value=n),i})}function u(e){var t=new i(e.options).setGraph(e.value);return r.each(e.nodes,function(e){t.setNode(e.v,e.value),e.parent&&t.setParent(e.v,e.parent)}),r.each(e.edges,function(e){t.setEdge({v:e.v,w:e.w,name:e.name},e.value)}),t}e.exports={write:a,read:u}},89126(e,t,n){var r;try{r={clone:n(66678),constant:n(75703),each:n(66073),filter:n(63105),has:n(18721),isArray:n(1469),isEmpty:n(41609),isFunction:n(23560),isUndefined:n(52353),keys:n(3674),map:n(35161),reduce:n(54061),size:n(84238),transform:n(68718),union:n(93386),values:n(52628)}}catch(i){}r||(r=window._),e.exports=r},49631(e){e.exports="2.1.8"},78892(e){"use strict";e.exports=n;var t=/[#.]/g;function n(e,n){for(var r,i,a,o=e||"",s=n||"div",u={},c=0;cC,q_:()=>F,ob:()=>y,PP:()=>B,Ep:()=>v,Hp:()=>w});var r=n(87462);function i(e){return"/"===e.charAt(0)}function a(e,t){for(var n=t,r=n+1,i=e.length;r=0;d--){var h=o[d];"."===h?a(o,d):".."===h?(a(o,d),f++):f&&(a(o,d),f--)}if(!c)for(;f--;f)o.unshift("..");!c||""===o[0]||o[0]&&i(o[0])||o.unshift("");var p=o.join("/");return n&&"/"!==p.substr(-1)&&(p+="/"),p}let s=o;function u(e){return e.valueOf?e.valueOf():Object.prototype.valueOf.call(e)}function c(e,t){if(e===t)return!0;if(null==e||null==t)return!1;if(Array.isArray(e))return Array.isArray(t)&&e.length===t.length&&e.every(function(e,n){return c(e,t[n])});if("object"==typeof e||"object"==typeof t){var n=u(e),r=u(t);return n!==e||r!==t?c(n,r):Object.keys(Object.assign({},e,t)).every(function(n){return c(e[n],t[n])})}return!1}let l=c;var f=n(2177);function d(e){return"/"===e.charAt(0)?e:"/"+e}function h(e){return"/"===e.charAt(0)?e.substr(1):e}function p(e,t){return 0===e.toLowerCase().indexOf(t.toLowerCase())&&-1!=="/?#".indexOf(e.charAt(t.length))}function b(e,t){return p(e,t)?e.substr(t.length):e}function m(e){return"/"===e.charAt(e.length-1)?e.slice(0,-1):e}function g(e){var t=e||"/",n="",r="",i=t.indexOf("#");-1!==i&&(r=t.substr(i),t=t.substr(0,i));var a=t.indexOf("?");return -1!==a&&(n=t.substr(a),t=t.substr(0,a)),{pathname:t,search:"?"===n?"":n,hash:"#"===r?"":r}}function v(e){var t=e.pathname,n=e.search,r=e.hash,i=t||"/";return n&&"?"!==n&&(i+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(i+="#"===r.charAt(0)?r:"#"+r),i}function y(e,t,n,i){var a;"string"==typeof e?(a=g(e)).state=t:(void 0===(a=(0,r.Z)({},e)).pathname&&(a.pathname=""),a.search?"?"!==a.search.charAt(0)&&(a.search="?"+a.search):a.search="",a.hash?"#"!==a.hash.charAt(0)&&(a.hash="#"+a.hash):a.hash="",void 0!==t&&void 0===a.state&&(a.state=t));try{a.pathname=decodeURI(a.pathname)}catch(o){if(o instanceof URIError)throw URIError('Pathname "'+a.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.');throw o}return n&&(a.key=n),i?a.pathname?"/"!==a.pathname.charAt(0)&&(a.pathname=s(a.pathname,i.pathname)):a.pathname=i.pathname:a.pathname||(a.pathname="/"),a}function w(e,t){return e.pathname===t.pathname&&e.search===t.search&&e.hash===t.hash&&e.key===t.key&&l(e.state,t.state)}function _(){var e=null;function t(t){return e=t,function(){e===t&&(e=null)}}function n(t,n,r,i){if(null!=e){var a="function"==typeof e?e(t,n):e;"string"==typeof a?"function"==typeof r?r(a,i):i(!0):i(!1!==a)}else i(!0)}var r=[];function i(e){var t=!0;function n(){t&&e.apply(void 0,arguments)}return r.push(n),function(){t=!1,r=r.filter(function(e){return e!==n})}}function a(){for(var e=arguments.length,t=Array(e),n=0;nn?a.splice(n,a.length-n,i):a.push(i),f({action:r,location:i,index:n,entries:a})}})}function g(e,t){var r="REPLACE",i=y(e,t,d(),M.location);l.confirmTransitionTo(i,r,n,function(e){e&&(M.entries[M.index]=i,f({action:r,location:i}))})}function w(e){var t=Y(M.index+e,0,M.entries.length-1),r="POP",i=M.entries[t];l.confirmTransitionTo(i,r,n,function(e){e?f({action:r,location:i,index:t}):f()})}function E(){w(-1)}function S(){w(1)}function k(e){var t=M.index+e;return t>=0&&tu});var r=/[A-Z]/g,i=/^ms-/,a={};function o(e){return"-"+e.toLowerCase()}function s(e){if(a.hasOwnProperty(e))return a[e];var t=e.replace(r,o);return a[e]=i.test(t)?"-"+t:t}let u=s},80645(e,t){/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ t.read=function(e,t,n,r,i){var a,o,s=8*i-r-1,u=(1<>1,l=-7,f=n?i-1:0,d=n?-1:1,h=e[t+f];for(f+=d,a=h&(1<<-l)-1,h>>=-l,l+=s;l>0;a=256*a+e[t+f],f+=d,l-=8);for(o=a&(1<<-l)-1,a>>=-l,l+=r;l>0;o=256*o+e[t+f],f+=d,l-=8);if(0===a)a=1-c;else{if(a===u)return o?NaN:(h?-1:1)*(1/0);o+=Math.pow(2,r),a-=c}return(h?-1:1)*o*Math.pow(2,a-r)},t.write=function(e,t,n,r,i,a){var o,s,u,c=8*a-i-1,l=(1<>1,d=23===i?5960464477539062e-23:0,h=r?0:a-1,p=r?1:-1,b=t<0||0===t&&1/t<0?1:0;for(isNaN(t=Math.abs(t))||t===1/0?(s=isNaN(t)?1:0,o=l):(o=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-o))<1&&(o--,u*=2),o+f>=1?t+=d/u:t+=d*Math.pow(2,1-f),t*u>=2&&(o++,u/=2),o+f>=l?(s=0,o=l):o+f>=1?(s=(t*u-1)*Math.pow(2,i),o+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,i),o=0));i>=8;e[n+h]=255&s,h+=p,s/=256,i-=8);for(o=o<0;e[n+h]=255&o,h+=p,o/=256,c-=8);e[n+h-p]|=128*b}},35717(e){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}},46260(e){"use strict";function t(e){var t="string"==typeof e?e.charCodeAt(0):e;return t>=97&&t<=122||t>=65&&t<=90}e.exports=t},7961(e,t,n){"use strict";var r=n(46260),i=n(46195);function a(e){return r(e)||i(e)}e.exports=a},46195(e){"use strict";function t(e){var t="string"==typeof e?e.charCodeAt(0):e;return t>=48&&t<=57}e.exports=t},79480(e){"use strict";function t(e){var t="string"==typeof e?e.charCodeAt(0):e;return t>=97&&t<=102||t>=65&&t<=70||t>=48&&t<=57}e.exports=t},33827(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>a,isBrowser:()=>i});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=("undefined"==typeof window?"undefined":r(window))==="object"&&("undefined"==typeof document?"undefined":r(document))==="object"&&9===document.nodeType;let a=i},5826(e){e.exports=Array.isArray||function(e){return"[object Array]"==Object.prototype.toString.call(e)}},47798(e){"use strict";/*! - * isobject - * - * Copyright (c) 2014-2017, Jon Schlinkert. - * Released under the MIT License. - */ e.exports=function(e){return null!=e&&"object"==typeof e&&!1===Array.isArray(e)}},80204(e,t,n){e.exports=self.fetch||(self.fetch=n(25869).default||n(25869))},5690(e,t,n){e.exports=n(67946)},8126(e,t,n){"use strict";n.d(t,{Z:()=>tl});var r,i="en",a={},o={};function s(){return i}function u(e){i=e}function c(e){return a[e]}function l(e){if(!e)throw Error("No locale data passed");a[e.locale]=e,o[e.locale.toLowerCase()]=e.locale}function f(e){return a[e]?e:o[e.toLowerCase()]?o[e.toLowerCase()]:void 0}function d(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.localeMatcher||"lookup";switch(n){case"lookup":case"best fit":return h(e);default:throw RangeError('Invalid "localeMatcher" option: '.concat(n))}}function h(e){var t=f(e);if(t)return t;for(var n=e.split("-");e.length>1;){n.pop();var r=f(e=n.join("-"));if(r)return r}}var p={af:function(e){return 1==e?"one":"other"},am:function(e){return e>=0&&e<=1?"one":"other"},ar:function(e){var t=String(e).split("."),n=Number(t[0])==e&&t[0].slice(-2);return 0==e?"zero":1==e?"one":2==e?"two":n>=3&&n<=10?"few":n>=11&&n<=99?"many":"other"},ast:function(e){var t=!String(e).split(".")[1];return 1==e&&t?"one":"other"},be:function(e){var t=String(e).split("."),n=Number(t[0])==e,r=n&&t[0].slice(-1),i=n&&t[0].slice(-2);return 1==r&&11!=i?"one":r>=2&&r<=4&&(i<12||i>14)?"few":n&&0==r||r>=5&&r<=9||i>=11&&i<=14?"many":"other"},br:function(e){var t=String(e).split("."),n=Number(t[0])==e,r=n&&t[0].slice(-1),i=n&&t[0].slice(-2),a=n&&t[0].slice(-6);return 1==r&&11!=i&&71!=i&&91!=i?"one":2==r&&12!=i&&72!=i&&92!=i?"two":(3==r||4==r||9==r)&&(i<10||i>19)&&(i<70||i>79)&&(i<90||i>99)?"few":0!=e&&n&&0==a?"many":"other"},bs:function(e){var t=String(e).split("."),n=t[0],r=t[1]||"",i=!t[1],a=n.slice(-1),o=n.slice(-2),s=r.slice(-1),u=r.slice(-2);return i&&1==a&&11!=o||1==s&&11!=u?"one":i&&a>=2&&a<=4&&(o<12||o>14)||s>=2&&s<=4&&(u<12||u>14)?"few":"other"},cs:function(e){var t=String(e).split("."),n=t[0],r=!t[1];return 1==e&&r?"one":n>=2&&n<=4&&r?"few":r?"other":"many"},cy:function(e){return 0==e?"zero":1==e?"one":2==e?"two":3==e?"few":6==e?"many":"other"},da:function(e){var t=String(e).split("."),n=t[0],r=Number(t[0])==e;return 1!=e&&(r||0!=n&&1!=n)?"other":"one"},dsb:function(e){var t=String(e).split("."),n=t[0],r=t[1]||"",i=!t[1],a=n.slice(-2),o=r.slice(-2);return i&&1==a||1==o?"one":i&&2==a||2==o?"two":i&&(3==a||4==a)||3==o||4==o?"few":"other"},dz:function(e){return"other"},fil:function(e){var t=String(e).split("."),n=t[0],r=t[1]||"",i=!t[1],a=n.slice(-1),o=r.slice(-1);return i&&(1==n||2==n||3==n)||i&&4!=a&&6!=a&&9!=a||!i&&4!=o&&6!=o&&9!=o?"one":"other"},fr:function(e){return e>=0&&e<2?"one":"other"},ga:function(e){var t=Number(String(e).split(".")[0])==e;return 1==e?"one":2==e?"two":t&&e>=3&&e<=6?"few":t&&e>=7&&e<=10?"many":"other"},gd:function(e){var t=Number(String(e).split(".")[0])==e;return 1==e||11==e?"one":2==e||12==e?"two":t&&e>=3&&e<=10||t&&e>=13&&e<=19?"few":"other"},he:function(e){var t=String(e).split("."),n=t[0],r=!t[1],i=Number(t[0])==e,a=i&&t[0].slice(-1);return 1==e&&r?"one":2==n&&r?"two":r&&(e<0||e>10)&&i&&0==a?"many":"other"},is:function(e){var t=String(e).split("."),n=t[0],r=Number(t[0])==e,i=n.slice(-1),a=n.slice(-2);return r&&1==i&&11!=a||!r?"one":"other"},ksh:function(e){return 0==e?"zero":1==e?"one":"other"},lt:function(e){var t=String(e).split("."),n=t[1]||"",r=Number(t[0])==e,i=r&&t[0].slice(-1),a=r&&t[0].slice(-2);return 1==i&&(a<11||a>19)?"one":i>=2&&i<=9&&(a<11||a>19)?"few":0!=n?"many":"other"},lv:function(e){var t=String(e).split("."),n=t[1]||"",r=n.length,i=Number(t[0])==e,a=i&&t[0].slice(-1),o=i&&t[0].slice(-2),s=n.slice(-2),u=n.slice(-1);return i&&0==a||o>=11&&o<=19||2==r&&s>=11&&s<=19?"zero":1==a&&11!=o||2==r&&1==u&&11!=s||2!=r&&1==u?"one":"other"},mk:function(e){var t=String(e).split("."),n=t[0],r=t[1]||"",i=!t[1],a=n.slice(-1),o=n.slice(-2),s=r.slice(-1),u=r.slice(-2);return i&&1==a&&11!=o||1==s&&11!=u?"one":"other"},mt:function(e){var t=String(e).split("."),n=Number(t[0])==e&&t[0].slice(-2);return 1==e?"one":0==e||n>=2&&n<=10?"few":n>=11&&n<=19?"many":"other"},pa:function(e){return 0==e||1==e?"one":"other"},pl:function(e){var t=String(e).split("."),n=t[0],r=!t[1],i=n.slice(-1),a=n.slice(-2);return 1==e&&r?"one":r&&i>=2&&i<=4&&(a<12||a>14)?"few":r&&1!=n&&(0==i||1==i)||r&&i>=5&&i<=9||r&&a>=12&&a<=14?"many":"other"},pt:function(e){var t=String(e).split(".")[0];return 0==t||1==t?"one":"other"},ro:function(e){var t=String(e).split("."),n=!t[1],r=Number(t[0])==e&&t[0].slice(-2);return 1==e&&n?"one":!n||0==e||1!=e&&r>=1&&r<=19?"few":"other"},ru:function(e){var t=String(e).split("."),n=t[0],r=!t[1],i=n.slice(-1),a=n.slice(-2);return r&&1==i&&11!=a?"one":r&&i>=2&&i<=4&&(a<12||a>14)?"few":r&&0==i||r&&i>=5&&i<=9||r&&a>=11&&a<=14?"many":"other"},se:function(e){return 1==e?"one":2==e?"two":"other"},si:function(e){var t=String(e).split("."),n=t[0],r=t[1]||"";return 0==e||1==e||0==n&&1==r?"one":"other"},sl:function(e){var t=String(e).split("."),n=t[0],r=!t[1],i=n.slice(-2);return r&&1==i?"one":r&&2==i?"two":r&&(3==i||4==i)||!r?"few":"other"}};p.as=p.am,p.az=p.af,p.bg=p.af,p.bn=p.am,p.ca=p.ast,p.ce=p.af,p.chr=p.af,p.de=p.ast,p.ee=p.af,p.el=p.af,p.en=p.ast,p.es=p.af,p.et=p.ast,p.eu=p.af,p.fa=p.am,p.fi=p.ast,p.fo=p.af,p.fur=p.af,p.fy=p.ast,p.gl=p.ast,p.gu=p.am,p.hi=p.am,p.hr=p.bs,p.hsb=p.dsb,p.hu=p.af,p.hy=p.fr,p.ia=p.ast,p.id=p.dz,p.it=p.ast,p.ja=p.dz,p.jgo=p.af,p.jv=p.dz,p.ka=p.af,p.kea=p.dz,p.kk=p.af,p.kl=p.af,p.km=p.dz,p.kn=p.am,p.ko=p.dz,p.ku=p.af,p.ky=p.af,p.lb=p.af,p.lkt=p.dz,p.lo=p.dz,p.ml=p.af,p.mn=p.af,p.mr=p.am,p.ms=p.dz,p.my=p.dz,p.nb=p.af,p.ne=p.af,p.nl=p.ast,p.nn=p.af,p.or=p.af,p.ps=p.af,p["pt-PT"]=p.ast,p.sah=p.dz,p.sd=p.af,p.sk=p.cs,p.so=p.af,p.sq=p.af,p.sr=p.bs,p.sv=p.ast,p.sw=p.ast,p.ta=p.af,p.te=p.af,p.th=p.dz,p.ti=p.pa,p.tk=p.af,p.to=p.dz,p.tr=p.af,p.ug=p.af,p.uk=p.ru,p.ur=p.ast,p.uz=p.af,p.vi=p.dz,p.wae=p.af,p.yi=p.ast,p.yue=p.dz,p.zh=p.dz,p.zu=p.am;let b=p;function m(e){return"pt-PT"===e?e:v(e)}var g=/^([a-z0-9]+)/i;function v(e){var t=e.match(g);if(!t)throw TypeError("Invalid locale: ".concat(e));return t[1]}function y(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function w(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};A(this,e),I(this,"numeric","always"),I(this,"style","long"),I(this,"localeMatcher","lookup");var r=n.numeric,i=n.style,a=n.localeMatcher;if(void 0!==r){if(0>N.indexOf(r))throw RangeError('Invalid "numeric" option: '.concat(r));this.numeric=r}if(void 0!==i){if(0>P.indexOf(i))throw RangeError('Invalid "style" option: '.concat(i));this.style=i}if(void 0!==a){if(0>R.indexOf(a))throw RangeError('Invalid "localeMatcher" option: '.concat(a));this.localeMatcher=a}if("string"==typeof t&&(t=[t]),t.push(s()),this.locale=e.supportedLocalesOf(t,{localeMatcher:this.localeMatcher})[0],!this.locale)throw Error("No supported locale was found");E.supportedLocalesOf(this.locale).length>0?this.pluralRules=new E(this.locale):console.warn('"'.concat(this.locale,'" locale is not supported')),"undefined"!=typeof Intl&&Intl.NumberFormat?(this.numberFormat=new Intl.NumberFormat(this.locale),this.numberingSystem=this.numberFormat.resolvedOptions().numberingSystem):this.numberingSystem="latn",this.locale=d(this.locale,{localeMatcher:this.localeMatcher})}return C(e,[{key:"format",value:function(){var e=z(arguments),t=x(e,2),n=t[0],r=t[1];return this.getRule(n,r).replace("{0}",this.formatNumber(Math.abs(n)))}},{key:"formatToParts",value:function(){var e=z(arguments),t=x(e,2),n=t[0],r=t[1],i=this.getRule(n,r),a=i.indexOf("{0}");if(a<0)return[{type:"literal",value:i}];var o=[];return a>0&&o.push({type:"literal",value:i.slice(0,a)}),o=o.concat(this.formatNumberToParts(Math.abs(n)).map(function(e){return k({},e,{unit:r})})),a+31&&void 0!==arguments[1]?arguments[1]:{};if("string"==typeof e)e=[e];else if(!Array.isArray(e))throw TypeError('Invalid "locales" argument');return e.filter(function(e){return d(e,t)})},j.addLocale=l,j.setDefaultLocale=u,j.getDefaultLocale=s,j.PluralRules=E;var F='Invalid "unit" argument';function Y(e){if("symbol"===S(e))throw TypeError(F);if("string"!=typeof e||("s"===e[e.length-1]&&(e=e.slice(0,e.length-1)),0>D.indexOf(e)))throw RangeError("".concat(F,": ").concat(e));return e}var B='Invalid "number" argument';function U(e){if(e=Number(e),Number.isFinite&&!Number.isFinite(e))throw RangeError("".concat(B,": ").concat(e));return e}function H(e){return 1/e==-1/0}function $(e){return e<0||0===e&&H(e)}function z(e){if(e.length<2)throw TypeError('"unit" argument is required');return[U(e[0]),Y(e[1])]}function G(e){return(G="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function W(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function K(e,t){for(var n=0;n=n.length)break;a=n[i++]}else{if((i=n.next()).done)break;a=i.value}var a,o=a;if(t(o))return o;for(var s=o.split("-");s.length>1;)if(s.pop(),t(o=s.join("-")))return o}throw Error("No locale data has been registered for any of the locales: ".concat(e.join(", ")))}function Q(){return("undefined"==typeof Intl?"undefined":X(Intl))==="object"&&"function"==typeof Intl.DateTimeFormat}var ee=60,et=60*ee,en=24*et,er=7*en,ei=30.44*en,ea=365.2425*en;function eo(e){switch(e){case"second":return 1;case"minute":return ee;case"hour":return et;case"day":return en;case"week":return er;case"month":return ei;case"year":return ea}}function es(e){return void 0!==e.factor?e.factor:eo(e.unit||e.formatAs)||1}function eu(e){return"floor"===e?Math.floor:(0,Math.round)}function ec(e){return"floor"===e?1:.5}function el(e){return(el="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ef(e,t){var n,r=t.prevStep,i=t.timestamp,a=t.now,o=t.future,s=t.round;return r&&(r.id||r.unit)&&(n=e["threshold_for_".concat(r.id||r.unit)]),void 0===n&&void 0!==e.threshold&&"function"==typeof(n=e.threshold)&&(n=n(a,o)),void 0===n&&(n=e.minTime),"object"===el(n)&&(n=r&&r.id&&void 0!==n[r.id]?n[r.id]:n.default),"function"==typeof n&&(n=n(i,{future:o,getMinTimeForUnit:function(e,t){return ed(e,t||r&&r.formatAs,{round:s})}})),void 0===n&&e.test&&(n=e.test(i,{now:a,future:o})?0:9007199254740991),void 0===n&&(r?e.formatAs&&r.formatAs&&(n=ed(e.formatAs,r.formatAs,{round:s})):n=0),void 0===n&&console.warn("[javascript-time-ago] A step should specify `minTime`:\n"+JSON.stringify(e,null,2)),n}function ed(e,t,n){var r,i=n.round,a=eo(e);if(r="now"===t?eo(e):eo(t),void 0!==a&&void 0!==r)return a-r*(1-ec(i))}function eh(e){for(var t=1;t0?e[o-1]:s}}}function eg(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=ef(e[r],eh({prevStep:e[r-1],timestamp:n.now-1e3*t},n));return void 0===i||Math.abs(t)=0})}function ey(e,t,n){var r=n.now,i=n.round;if(eo(e)){var a=1e3*eo(e),o=t>r,s=Math.abs(t-r),u=eu(i)(s/a)*a;return o?u>0?s-u+e_(i,a):s-u+1:-(s-u)+ew(i,a)}}function ew(e,t){return ec(e)*t}function e_(e,t){return(1-ec(e))*t+1}var eE=31536e9;function eS(e,t,n){var r,i=n.prevStep,a=n.nextStep,o=n.now,s=n.future,u=n.round,c=e.getTime?e.getTime():e,l=function(e){return ey(e,c,{now:o,round:u})},f=ex(s?t:a,c,{future:s,now:o,round:u,prevStep:s?i:t});if(void 0!==f){if(t&&(t.getTimeToNextUpdate&&(r=t.getTimeToNextUpdate(c,{getTimeToNextUpdateForUnit:l,getRoundFunction:eu,now:o,future:s,round:u})),void 0===r)){var d=t.unit||t.formatAs;d&&(r=l(d))}return void 0===r?f:Math.min(r,f)}}function ek(e,t,n){var r,i=n.now,a=n.future,o=ef(e,{timestamp:t,now:i,future:a,round:n.round,prevStep:n.prevStep});return void 0===o?void 0:a?t-1e3*o+1:0===o&&t===i?eE:t+1e3*o}function ex(e,t,n){var r=n.now,i=n.future,a=n.round,o=n.prevStep;if(e){var s=ek(e,t,{now:r,future:i,round:a,prevStep:o});if(void 0===s)return;return s-r}return i?t-r+1:eE}var eT={};function eM(e){return eT[e]}function eO(e){if(!e)throw Error("[javascript-time-ago] No locale data passed.");eT[e.locale]=e}let eA=[{formatAs:"now"},{formatAs:"second"},{formatAs:"minute"},{formatAs:"hour"},{formatAs:"day"},{formatAs:"week"},{formatAs:"month"},{formatAs:"year"}],eL={steps:eA,labels:"long"};function eC(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.polyfill;ts(this,e),"string"==typeof t&&(t=[t]),this.locale=J(t.concat(e.getDefaultLocale()),eM),"undefined"!=typeof Intl&&Intl.NumberFormat&&(this.numberFormat=new Intl.NumberFormat(this.locale)),!1===r?(this.IntlRelativeTimeFormat=Intl.RelativeTimeFormat,this.IntlPluralRules=Intl.PluralRules):(this.IntlRelativeTimeFormat=j,this.IntlPluralRules=j.PluralRules),this.relativeTimeFormatCache=new Z,this.pluralRulesCache=new Z}return tc(e,[{key:"format",value:function(e,t,n){n||(t&&!tv(t)?(n=t,t=void 0):n={}),t||(t=eD),"string"==typeof t&&(t=tt(t));var r,i=td(e),a=this.getLabels(t.flavour||t.labels),o=a.labels,s=a.labelsType;void 0!==t.now&&(r=t.now),void 0===r&&void 0!==n.now&&(r=n.now),void 0===r&&(r=Date.now());var u=(r-i)/1e3,c=n.future||u<0,l=tb(o,eM(this.locale).now,eM(this.locale).long,c);if(t.custom){var f=t.custom({now:r,date:new Date(i),time:i,elapsed:u,locale:this.locale});if(void 0!==f)return f}var d=tp(t.units,o,l),h=n.round||t.round,p=eb(t.gradation||t.steps||eD.steps,u,{now:r,units:d,round:h,future:c,getNextStep:!0}),b=tr(p,3),m=b[0],g=b[1],v=b[2],y=this.formatDateForStep(i,g,u,{labels:o,labelsType:s,nowLabel:l,now:r,future:c,round:h})||"";if(n.getTimeToNextUpdate){var w=eS(i,g,{nextStep:v,prevStep:m,now:r,future:c,round:h});return[y,w]}return y}},{key:"formatDateForStep",value:function(e,t,n,r){var i=this,a=r.labels,o=r.labelsType,s=r.nowLabel,u=r.now,c=r.future,l=r.round;if(t){if(t.format)return t.format(e,this.locale,{formatAs:function(e,t){return i.formatValue(t,e,{labels:a,future:c})},now:u,future:c});var f=t.unit||t.formatAs;if(!f)throw Error("[javascript-time-ago] Each step must define either `formatAs` or `format()`. Step: ".concat(JSON.stringify(t)));if("now"===f)return s;var d=Math.abs(n)/es(t);t.granularity&&(d=eu(l)(d/t.granularity)*t.granularity);var h=-1*Math.sign(n)*eu(l)(d);switch(0===h&&(h=0),o){case"long":case"short":case"narrow":return this.getFormatter(o).format(h,f);default:return this.formatValue(h,f,{labels:a,future:c})}}}},{key:"formatValue",value:function(e,t,n){var r=n.labels,i=n.future;return this.getFormattingRule(r,t,e,{future:i}).replace("{0}",this.formatNumber(Math.abs(e)))}},{key:"getFormattingRule",value:function(e,t,n,r){var i=r.future;if(this.locale,"string"==typeof(e=e[t]))return e;var a=e[0===n?i?"future":"past":n<0?"past":"future"]||e;return"string"==typeof a?a:a[this.getPluralRules().select(Math.abs(n))]||a.other}},{key:"formatNumber",value:function(e){return this.numberFormat?this.numberFormat.format(e):String(e)}},{key:"getFormatter",value:function(e){return this.relativeTimeFormatCache.get(this.locale,e)||this.relativeTimeFormatCache.put(this.locale,e,new this.IntlRelativeTimeFormat(this.locale,{style:e}))}},{key:"getPluralRules",value:function(){return this.pluralRulesCache.get(this.locale)||this.pluralRulesCache.put(this.locale,new this.IntlPluralRules(this.locale))}},{key:"getLabels",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];"string"==typeof e&&(e=[e]),e=(e=e.map(function(e){switch(e){case"tiny":case"mini-time":return"mini";default:return e}})).concat("long");for(var t=eM(this.locale),n=e,r=Array.isArray(n),i=0,n=r?n:n[Symbol.iterator]();;){if(r){if(i>=n.length)break;a=n[i++]}else{if((i=n.next()).done)break;a=i.value}var a,o=a;if(t[o])return{labelsType:o,labels:t[o]}}}}]),e}(),tf="en";function td(e){if(e.constructor===Date||th(e))return e.getTime();if("number"==typeof e)return e;throw Error("Unsupported relative time formatter input: ".concat(tn(e),", ").concat(e))}function th(e){return"object"===tn(e)&&"function"==typeof e.getTime}function tp(e,t,n){var r=Object.keys(t);return n&&r.push("now"),e&&(r=e.filter(function(e){return"now"===e||r.indexOf(e)>=0})),r}function tb(e,t,n,r){var i=e.now||t&&t.now;return i?"string"==typeof i?i:r?i.future:i.past:n&&n.second&&n.second.current?n.second.current:void 0}tl.getDefaultLocale=function(){return tf},tl.setDefaultLocale=function(e){return tf=e},tl.addDefaultLocale=function(e){if(r)throw Error("[javascript-time-ago] `TimeAgo.addDefaultLocale()` can only be called once. To add other locales, use `TimeAgo.addLocale()`.");r=!0,tl.setDefaultLocale(e.locale),tl.addLocale(e)},tl.addLocale=function(e){eO(e),j.addLocale(e)},tl.locale=tl.addLocale,tl.addLabels=function(e,t,n){var r=eM(e);r||(eO({locale:e}),r=eM(e)),r[t]=n};var tm={}.constructor;function tg(e){return void 0!==tn(e)&&null!==e&&e.constructor===tm}function tv(e){return"string"==typeof e||ty(e)}function ty(e){return tg(e)&&(Array.isArray(e.steps)||Array.isArray(e.gradation)||Array.isArray(e.flavour)||"string"==typeof e.flavour||Array.isArray(e.labels)||"string"==typeof e.labels||Array.isArray(e.units)||"function"==typeof e.custom)}},41800(e,t,n){e.exports=function(){"use strict";var e={121:function(e,t,r){r.r(t),r.d(t,{default:function(){return E}}),n(41539),n(21249),n(54747),n(15306),n(74916),n(47042),n(82526),n(41817),n(32165),n(78783),n(66992),n(33948),n(81486);var i=n(68929),a=r.n(i),o=n(1469),s=r.n(o),u=n(45220),c=r.n(u),l=n(3674),f=r.n(l),d=n(82492),h=r.n(d);function p(e){return(p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function b(e){return s()(e)?e:[e]}function m(e){if(null===e||"object"!==p(e)||(t=e,"[object Date]"===Object.prototype.toString.call(t)))return e;if(s()(e))return e.map(m);var t,n={};return f()(e).forEach(function(t){n[a()(t)]=m(e[t])}),n}function g(e,t){var n=t.camelizeKeys,r=t.camelizeTypeValues,i={};return f()(e).forEach(function(t){var o=e[t],u=n?a()(t):t;i[u]={},void 0!==o.data&&(s()(o.data)?i[u].data=o.data.map(function(e){return{id:e.id,type:r?a()(e.type):e.type}}):c()(o.data)?i[u].data=o.data:i[u].data={id:o.data.id,type:r?a()(o.data.type):o.data.type}),o.links&&(i[u].links=n?m(o.links):o.links),o.meta&&(i[u].meta=n?m(o.meta):o.meta)}),i}function v(e,t){if(t.camelizeKeys){var n={};return f()(e).forEach(function(t){n[a()(t)]=m(e[t])}),n}return e}function y(e,t){var n=t.camelizeKeys,r=t.camelizeTypeValues,i={};return b(e).forEach(function(e){var t=n?a()(e.type):e.type;i[t]=i[t]||{},i[t][e.id]=i[t][e.id]||{id:e.id},i[t][e.id].type=r?a()(e.type):e.type,n?(i[t][e.id].attributes={},f()(e.attributes).forEach(function(n){i[t][e.id].attributes[a()(n)]=m(e.attributes[n])})):i[t][e.id].attributes=e.attributes,e.links&&(i[t][e.id].links={},f()(e.links).forEach(function(r){var o=n?a()(r):r;i[t][e.id].links[o]=e.links[r]})),e.relationships&&(i[t][e.id].relationships=g(e.relationships,{camelizeKeys:n,camelizeTypeValues:r})),e.meta&&(i[t][e.id].meta=v(e.meta,{camelizeKeys:n}))}),i}function w(e){return e.replace(/\?.*$/,"")}function _(e,t,n){var r,i=n.camelizeKeys,o=n.camelizeTypeValues,s={meta:{}};if(n.filterEndpoint)s.meta[t]={},r=s.meta[t];else{var u=w(t);s.meta[u]={},s.meta[u][t.slice(u.length)]={},r=s.meta[u][t.slice(u.length)]}if(r.data={},e.data){var c=[];b(e.data).forEach(function(e){var t={id:e.id,type:o?a()(e.type):e.type};e.relationships&&(t.relationships=g(e.relationships,{camelizeKeys:i,camelizeTypeValues:o})),c.push(t)}),r.data=c}return e.links&&(r.links=e.links,s.meta[w(t)].links=e.links),e.meta&&(r.meta=v(e.meta,{camelizeKeys:i})),s}function E(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.filterEndpoint,r=void 0===n||n,i=t.camelizeKeys,a=void 0===i||i,o=t.camelizeTypeValues,s=void 0===o||o,u=t.endpoint,c={};if(e.data&&h()(c,y(e.data,{camelizeKeys:a,camelizeTypeValues:s})),e.included&&h()(c,y(e.included,{camelizeKeys:a,camelizeTypeValues:s})),u){var l=r?w(u):u;h()(c,_(e,l,{camelizeKeys:a,camelizeTypeValues:s,filterEndpoint:r}))}return c}}},t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={exports:{}};return e[n](i,i.exports,r),i.exports}return r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r(121)}()},63731:function(e){var t,n;t="undefined"!=typeof self?self:this,n=function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t||4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,(function(t){return e[t]}).bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),i=/["'&<>]/,a=function(e){var t=i.exec(e);if(null!==t){var n,r="",a=void 0,o=0;for(a=t.index;a")},e.prototype.space=function(){this.buffer.push(" ")},e.prototype.indent=function(e){if(e>0){for(var t="",n=0;n'+a(e)+""),this.buffer.push('"')},e.prototype.printString=function(e){this.buffer.push('"'),this.buffer.push(''+a(e)+""),this.buffer.push('"')},e.prototype.printBoolean=function(e){this.buffer.push(''+e+"")},e.prototype.printNumber=function(e){this.buffer.push(''+e+"")},e.prototype.printSelectionStart=function(){this.buffer.push(""),this.buffer.push('
')},e.prototype.printSelectionEnd=function(){this.buffer.push("
"),this.buffer.push('
')},Object.defineProperty(e.prototype,"printSelectionEndAtNewLine",{set:function(e){this._printSelectionEndAtNewLine=e},enumerable:!0,configurable:!0}),e.prototype.toString=function(){return this.buffer.join("")},e}(),s=function(e,t,n,r,i){t.checkCircular(e),t.print("{"),t.newLine();for(var a=Object.keys(e),o=0;o'):a.print('
'),Array.isArray(e)?u(e,a,0,t,i):s(e,a,0,t,i),a.print("
"),a.toString()}return""}},function(e,t,n){"use strict";n.r(t),n.d(t,"__extends",function(){return i}),n.d(t,"__assign",function(){return a}),n.d(t,"__rest",function(){return o}),n.d(t,"__decorate",function(){return s}),n.d(t,"__param",function(){return u}),n.d(t,"__metadata",function(){return c}),n.d(t,"__awaiter",function(){return l}),n.d(t,"__generator",function(){return f}),n.d(t,"__exportStar",function(){return d}),n.d(t,"__values",function(){return h}),n.d(t,"__read",function(){return p}),n.d(t,"__spread",function(){return b}),n.d(t,"__await",function(){return m}),n.d(t,"__asyncGenerator",function(){return g}),n.d(t,"__asyncDelegator",function(){return v}),n.d(t,"__asyncValues",function(){return y}),n.d(t,"__makeTemplateObject",function(){return w}),n.d(t,"__importStar",function(){return _}),n.d(t,"__importDefault",function(){return E});/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. All rights reserved. -Licensed under the Apache License, Version 2.0 (the "License"); you may not use -this file except in compliance with the License. You may obtain a copy of the -License at http://www.apache.org/licenses/LICENSE-2.0 - -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */ var r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};function i(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var a=Object.assign||function(e){for(var t,n=1,r=arguments.length;nt.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);it.indexOf(r[i])&&(n[r[i]]=e[r[i]])}return n}function s(e,t,n,r){var i,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o}function u(e,t){return function(n,r){t(n,r,e)}}function c(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function l(e,t,n,r){return new(n||(n=Promise))(function(i,a){function o(e){try{u(r.next(e))}catch(t){a(t)}}function s(e){try{u(r.throw(e))}catch(t){a(t)}}function u(e){e.done?i(e.value):new n(function(t){t(e.value)}).then(o,s)}u((r=r.apply(e,t||[])).next())})}function f(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(n)throw TypeError("Generator is already executing.");for(;o;)try{if(n=1,r&&(i=r[2&a[0]?"return":a[0]?"throw":"next"])&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[0,i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,r=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(i=(i=o.trys).length>0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}function p(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,a=n.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o}function b(){for(var e=[],t=0;t1||s(e,t)})})}function s(e,t){try{var n;(n=i[e](t)).value instanceof m?Promise.resolve(n.value.v).then(u,c):l(a[0][2],n)}catch(r){l(a[0][3],r)}}function u(e){s("next",e)}function c(e){s("throw",e)}function l(e,t){e(t),a.shift(),a.length&&s(a[0][0],a[0][1])}}function v(e){var t,n;return t={},r("next"),r("throw",function(e){throw e}),r("return"),t[Symbol.iterator]=function(){return this},t;function r(r,i){e[r]&&(t[r]=function(t){return(n=!n)?{value:m(e[r](t)),done:"return"===r}:i?i(t):t})}}function y(e){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator];return t?t.call(e):h(e)}function w(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function _(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function E(e){return e&&e.__esModule?e:{default:e}}}])},e.exports=n()},35828(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;var r=n(25477),i=a(r);function a(e){return e&&e.__esModule?e:{default:e}}function o(e){var t={};for(var n in e)t[(0,i.default)(n)]=e[n];return e.fallbacks&&(Array.isArray(e.fallbacks)?t.fallbacks=e.fallbacks.map(o):t.fallbacks=o(e.fallbacks)),t}function s(){function e(e){if(Array.isArray(e)){for(var t=0;t0&&void 0!==arguments[0]?arguments[0]:{},t=s(e);function n(e,n){if("style"!==n.type)return e;for(var r in e)e[r]=c(r,e[r],t);return e}function r(e,n){return c(n,e,t)}return{onProcessStyle:n,onChangeValue:r}}},29059(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{};return e.createGenerateClassName&&(this.options.createGenerateClassName=e.createGenerateClassName,this.generateClassName=e.createGenerateClassName()),null!=e.insertionPoint&&(this.options.insertionPoint=e.insertionPoint),(e.virtual||e.Renderer)&&(this.options.Renderer=e.Renderer||(e.virtual?A.default:M.default)),e.plugins&&this.use.apply(this,e.plugins),this}},{key:"createStyleSheet",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.index;"number"!=typeof n&&(n=0===y.default.index?0:y.default.index+1);var r=new c.default(e,i({},t,{jss:this,generateClassName:t.generateClassName||this.generateClassName,insertionPoint:this.options.insertionPoint,Renderer:this.options.Renderer,index:n}));return this.plugins.onProcessSheet(r),r}},{key:"removeStyleSheet",value:function(e){return e.detach(),y.default.remove(e),this}},{key:"createRule",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};(void 0===e?"undefined":r(e))==="object"&&(n=t,t=e,e=void 0);var i=n;i.jss=this,i.Renderer=this.options.Renderer,i.generateClassName||(i.generateClassName=this.generateClassName),i.classes||(i.classes={});var a=(0,x.default)(e,t,i);return!i.selector&&a instanceof _.default&&(a.selector="."+i.generateClassName(a)),this.plugins.onProcessRule(a),a}},{key:"use",value:function(){for(var e=this,t=arguments.length,n=Array(t),r=0;r0&&(this.refs[t]--,0===this.refs[t]&&this.sheets[t].detach())}},{key:"size",get:function(){return this.keys.length}}]),e}();t.default=u},92122(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var n=0;n=this.index){t.push(e);return}for(var r=0;rn){t.splice(r,0,e);return}}}},{key:"reset",value:function(){this.registry=[]}},{key:"remove",value:function(e){var t=this.registry.indexOf(e);this.registry.splice(t,1)}},{key:"toString",value:function(e){return this.registry.filter(function(e){return e.attached}).map(function(t){return t.toString(e)}).join("\n")}},{key:"index",get:function(){return 0===this.registry.length?0:this.registry[this.registry.length-1].options.index}}]),e}();t.default=i},26899(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:0;return e.substr(t,e.indexOf("{")-1)},function(e){if(e.type===y.STYLE_RULE)return e.selectorText;if(e.type===y.KEYFRAMES_RULE){var t=e.name;if(t)return"@keyframes "+t;var n=e.cssText;return"@"+v(n,n.indexOf("keyframes"))}return v(e.cssText)});function _(e,t){return e.selectorText=t,e.selectorText===t}var E,S,k=p(function(){return document.head||document.getElementsByTagName("head")[0]}),x=(E=void 0,S=!1,function(e){var t={};E||(E=document.createElement("style"));for(var n=0;nt.index&&r.options.insertionPoint===t.insertionPoint)return r}return null}function M(e,t){for(var n=e.length-1;n>=0;n--){var r=e[n];if(r.attached&&r.options.insertionPoint===t.insertionPoint)return r}return null}function O(e){for(var t=k(),n=0;n0){var n=T(t,e);if(n)return n.renderer.element;if(n=M(t,e))return n.renderer.element.nextElementSibling}var r=e.insertionPoint;if(r&&"string"==typeof r){var i=O(r);if(i)return i.nextSibling;(0,a.default)("jss"===r,'[JSS] Insertion point "%s" not found.',r)}return null}function L(e,t){var n=t.insertionPoint,r=A(t);if(r){var i=r.parentNode;i&&i.insertBefore(e,r);return}if(n&&"number"==typeof n.nodeType){var o=n,s=o.parentNode;s?s.insertBefore(e,o.nextSibling):(0,a.default)(!1,"[JSS] Insertion point is not in the DOM.");return}k().insertBefore(e,r)}var C=p(function(){var e=document.querySelector('meta[property="csp-nonce"]');return e?e.getAttribute("content"):null}),I=function(){function e(t){h(this,e),this.getPropertyValue=b,this.setProperty=m,this.removeProperty=g,this.setSelector=_,this.getKey=w,this.getUnescapedKeysMap=x,this.hasInsertedRules=!1,t&&s.default.add(t),this.sheet=t;var n=this.sheet?this.sheet.options:{},r=n.media,i=n.meta,a=n.element;this.element=a||document.createElement("style"),this.element.setAttribute("data-jss",""),r&&this.element.setAttribute("media",r),i&&this.element.setAttribute("data-meta",i);var o=C();o&&this.element.setAttribute("nonce",o)}return r(e,[{key:"attach",value:function(){!this.element.parentNode&&this.sheet&&(this.hasInsertedRules&&(this.deploy(),this.hasInsertedRules=!1),L(this.element,this.sheet.options))}},{key:"detach",value:function(){this.element.parentNode.removeChild(this.element)}},{key:"deploy",value:function(){this.sheet&&(this.element.textContent="\n"+this.sheet.toString()+"\n")}},{key:"insertRule",value:function(e,t){var n=this.element.sheet,r=n.cssRules,i=e.toString();if(t||(t=r.length),!i)return!1;try{n.insertRule(i,t)}catch(o){return(0,a.default)(!1,"[JSS] Can not insert an unsupported rule \n\r%s",e),!1}return this.hasInsertedRules=!0,r[t]}},{key:"deleteRule",value:function(e){var t=this.element.sheet,n=this.indexOf(e);return -1!==n&&(t.deleteRule(n),!0)}},{key:"indexOf",value:function(e){for(var t=this.element.sheet.cssRules,n=0;n0&&void 0!==arguments[0]?arguments[0]:{indent:1},t=this.rules.toString(e);return t?this.key+" {\n"+t+"\n}":""}}]),e}();t.default=c},12398(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{indent:1},t=this.rules.toString(e);return t&&(t+="\n"),this.key+" {\n"+t+"}"}}]),e}();t.default=c},3486(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var n=0;nc&&(0,i.default)(!1,"[JSS] You might have a memory leak. Rule counter is at %s.",e);var a=t,o="";return(r&&(a=r.options.classNamePrefix||t,null!=r.options.jss.id&&(o+=r.options.jss.id)),"production"===l)?""+a+s.default+o+e:a+n.key+"-"+s.default+(o&&"-"+o)+"-"+e}}},89380(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=l;var r=n(63189),i=c(r),a=n(15803),o=c(a),s=n(2808),u=c(s);function c(e){return e&&e.__esModule?e:{default:e}}function l(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"unnamed",t=arguments[1],n=arguments[2],r=n.jss,a=(0,u.default)(t),s=r.plugins.onCreateRule(e,a,n);return s||("@"===e[0]&&(0,i.default)(!1,"[JSS] Unknown at-rule %s",e),new o.default(e,a,n))}},55878(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n.g.CSS,i="production",a=/([[\].#*$><+~=|^:(),"'`])/g;t.default=function(e){return"production"===i?e:r&&r.escape?r.escape(e):e.replace(a,"\\$1")}},27343(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function r(e){var t=null;for(var i in e){var a=e[i],o=void 0===a?"undefined":n(a);if("function"===o)t||(t={}),t[i]=a;else if("object"===o&&null!==a&&!Array.isArray(a)){var s=r(a);s&&(t||(t={}),t[i]=s)}}return t}t.default=r},97628(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(67121),i=a(r);function a(e){return e&&e.__esModule?e:{default:e}}t.default=function(e){return e&&e[i.default]&&e===e[i.default]()}},94229(e,t){"use strict";function n(e,t){e.renderable=t,e.rules&&t.cssRules&&e.rules.link(t.cssRules)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n},141(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r="2f1acc6c3a606b082e5eef5e54414ffb";null==n.g[r]&&(n.g[r]=0),t.default=n.g[r]++},70084(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;var r=n(16229),i=a(r);function a(e){return e&&e.__esModule?e:{default:e}}function o(e,t){for(var n="",r=0;r2&&void 0!==arguments[2]?arguments[2]:{},r="";if(!t)return r;var a=n.indent,s=void 0===a?0:a,u=t.fallbacks;if(s++,u){if(Array.isArray(u))for(var c=0;c1&&void 0!==arguments[1]&&arguments[1];if(!Array.isArray(e))return e;var r="";if(Array.isArray(e[0]))for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:{};s(this,e),this.cookieOptions=Object.assign({path:"/"},t),u=void 0===t.prefix?u:t.prefix}return r(e,[{key:"getItem",value:function(e){var t=a.default.parse(document.cookie);return t&&t.hasOwnProperty(u+e)?t[u+e]:null}},{key:"setItem",value:function(e,t){return document.cookie=a.default.serialize(u+e,t,this.cookieOptions),t}},{key:"removeItem",value:function(e){var t=Object.assign({},this.cookieOptions,{maxAge:-1});return document.cookie=a.default.serialize(u+e,"",t),null}},{key:"clear",value:function(){var e=a.default.parse(document.cookie);for(var t in e)0===t.indexOf(u)&&this.removeItem(t.substr(u.length));return null}}]),e}();function l(){var e=new c;try{var t="__test";e.setItem(t,"1");var n=e.getItem(t);return e.removeItem(t),"1"===n}catch(r){return!1}}t.default=c},90145(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:"localStorage",t=String(e).replace(/storage$/i,"").toLowerCase();if("local"===t)return a("localStorage");if("session"===t)return a("sessionStorage");if("cookie"===t)return(0,r.hasCookies)();if("memory"===t)return!0;throw Error("Storage method `"+e+"` is not available.\n Please use one of the following: localStorage, sessionStorage, cookieStorage, memoryStorage.")}},72426(e,t){"use strict";/*! - * cookie - * Copyright(c) 2012-2014 Roman Shtylman - * Copyright(c) 2015 Douglas Christopher Wilson - * MIT Licensed - */ t.parse=o,t.serialize=s;var n=decodeURIComponent,r=encodeURIComponent,i=/; */,a=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function o(e,t){if("string"!=typeof e)throw TypeError("argument str must be a string");for(var r={},a=t||{},o=e.split(i),s=a.decode||n,c=0;cc});var r=n(56169);e=n.hmd(e);var i="object"==typeof exports&&exports&&!exports.nodeType&&exports,a=i&&e&&!e.nodeType&&e,o=a&&a.exports===i?r.Z.Buffer:void 0,s=o?o.allocUnsafe:void 0;function u(e,t){if(t)return e.slice();var n=e.length,r=s?s(n):new e.constructor(n);return e.copy(r),r}let c=u},48277(e,t,n){"use strict";n.d(t,{Z:()=>i});var r="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;let i=r},79730(e,t,n){"use strict";n.d(t,{Z:()=>u});var r=n(48277);e=n.hmd(e);var i="object"==typeof exports&&exports&&!exports.nodeType&&exports,a=i&&e&&!e.nodeType&&e,o=a&&a.exports===i&&r.Z.process,s=function(){try{var e=a&&a.require&&a.require("util").types;if(e)return e;return o&&o.binding&&o.binding("util")}catch(t){}}();let u=s},56169(e,t,n){"use strict";n.d(t,{Z:()=>o});var r=n(48277),i="object"==typeof self&&self&&self.Object===Object&&self,a=r.Z||i||Function("return this")();let o=a},29710(e,t,n){"use strict";n.d(t,{Z:()=>l});var r=n(56169);function i(){return!1}let a=i;e=n.hmd(e);var o="object"==typeof exports&&exports&&!exports.nodeType&&exports,s=o&&e&&!e.nodeType&&e,u=s&&s.exports===o?r.Z.Buffer:void 0,c=(u?u.isBuffer:void 0)||a;let l=c},18552(e,t,n){var r=n(10852),i=n(55639),a=r(i,"DataView");e.exports=a},1989(e,t,n){var r=n(51789),i=n(80401),a=n(57667),o=n(21327),s=n(81866);function u(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t-1}e.exports=i},1196(e){function t(e,t,n){for(var r=-1,i=null==e?0:e.length;++r0&&n(l)?t>1?a(l,t-1,n,o,s):r(s,l):o||(s[s.length]=l)}return s}e.exports=a},28483(e,t,n){var r=n(25063)();e.exports=r},47816(e,t,n){var r=n(28483),i=n(3674);function a(e,t){return e&&r(e,t,i)}e.exports=a},97786(e,t,n){var r=n(71811),i=n(40327);function a(e,t){t=r(t,e);for(var n=0,a=t.length;null!=e&&ni?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var a=Array(i);++r=c){var m=t?null:s(e);if(m)return u(m);h=!1,f=o,b=new r}else b=t?[]:p;outer:for(;++l=i?e:r(e,t,n)}e.exports=i},74318(e,t,n){var r=n(11149);function i(e){var t=new e.constructor(e.byteLength);return new r(t).set(new r(e)),t}e.exports=i},64626(e,t,n){e=n.nmd(e);var r=n(55639),i=t&&!t.nodeType&&t,a=i&&e&&!e.nodeType&&e,o=a&&a.exports===i?r.Buffer:void 0,s=o?o.allocUnsafe:void 0;function u(e,t){if(t)return e.slice();var n=e.length,r=s?s(n):new e.constructor(n);return e.copy(r),r}e.exports=u},57157(e,t,n){var r=n(74318);function i(e,t){var n=t?r(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}e.exports=i},93147(e){var t=/\w*$/;function n(e){var n=new e.constructor(e.source,t.exec(e));return n.lastIndex=e.lastIndex,n}e.exports=n},40419(e,t,n){var r=n(62705),i=r?r.prototype:void 0,a=i?i.valueOf:void 0;function o(e){return a?Object(a.call(e)):{}}e.exports=o},77133(e,t,n){var r=n(74318);function i(e,t){var n=t?r(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}e.exports=i},278(e){function t(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n1?n[a-1]:void 0,s=a>2?n[2]:void 0;for(o=e.length>3&&"function"==typeof o?(a--,o):void 0,s&&i(n[0],n[1],s)&&(o=a<3?void 0:o,a=1),t=Object(t);++rd))return!1;var p=l.get(e),b=l.get(t);if(p&&b)return p==t&&b==e;var m=-1,g=!0,v=n&s?new r:void 0;for(l.set(e,t),l.set(t,e);++m-1&&e%1==0&&e-1}e.exports=i},13399(e,t,n){var r=n(18470);function i(e,t){var n=this.__data__,i=r(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this}e.exports=i},24785(e,t,n){var r=n(1989),i=n(38407),a=n(57071);function o(){this.size=0,this.__data__={hash:new r,map:new(a||i),string:new r}}e.exports=o},11285(e,t,n){var r=n(45050);function i(e){var t=r(this,e).delete(e);return this.size-=t?1:0,t}e.exports=i},96e3(e,t,n){var r=n(45050);function i(e){return r(this,e).get(e)}e.exports=i},49916(e,t,n){var r=n(45050);function i(e){return r(this,e).has(e)}e.exports=i},95265(e,t,n){var r=n(45050);function i(e,t){var n=r(this,e),i=n.size;return n.set(e,t),this.size+=n.size==i?0:1,this}e.exports=i},68776(e){function t(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}e.exports=t},42634(e){function t(e,t){return function(n){return null!=n&&n[e]===t&&(void 0!==t||e in Object(n))}}e.exports=t},24523(e,t,n){var r=n(88306),i=500;function a(e){var t=r(e,function(e){return n.size===i&&n.clear(),e}),n=t.cache;return t}e.exports=a},94536(e,t,n){var r=n(10852)(Object,"create");e.exports=r},86916(e,t,n){var r=n(5569)(Object.keys,Object);e.exports=r},33498(e){function t(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}e.exports=t},31167(e,t,n){e=n.nmd(e);var r=n(31957),i=t&&!t.nodeType&&t,a=i&&e&&!e.nodeType&&e,o=a&&a.exports===i&&r.process,s=function(){try{var e=a&&a.require&&a.require("util").types;if(e)return e;return o&&o.binding&&o.binding("util")}catch(t){}}();e.exports=s},2333(e){var t=Object.prototype.toString;function n(e){return t.call(e)}e.exports=n},5569(e){function t(e,t){return function(n){return e(t(n))}}e.exports=t},45357(e,t,n){var r=n(96874),i=Math.max;function a(e,t,n){return t=i(void 0===t?e.length-1:t,0),function(){for(var a=arguments,o=-1,s=i(a.length-t,0),u=Array(s);++o0){if(++i>=t)return arguments[0]}else i=0;return e.apply(void 0,arguments)}}e.exports=i},37465(e,t,n){var r=n(38407);function i(){this.__data__=new r,this.size=0}e.exports=i},63779(e){function t(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}e.exports=t},67599(e){function t(e){return this.__data__.get(e)}e.exports=t},44758(e){function t(e){return this.__data__.has(e)}e.exports=t},34309(e,t,n){var r=n(38407),i=n(57071),a=n(83369),o=200;function s(e,t){var n=this.__data__;if(n instanceof r){var s=n.__data__;if(!i||s.length=t||n<0||g&&r>=f}function S(){var e=i();if(E(e))return k(e);h=setTimeout(S,_(e))}function k(e){return(h=void 0,v&&c)?y(e):(c=l=void 0,d)}function x(){void 0!==h&&clearTimeout(h),b=0,c=p=l=h=void 0}function T(){return void 0===h?d:k(i())}function M(){var e=i(),n=E(e);if(c=arguments,l=this,p=e,n){if(void 0===h)return w(p);if(g)return clearTimeout(h),h=setTimeout(S,t),y(p)}return void 0===h&&(h=setTimeout(S,t)),d}return t=a(t)||0,r(n)&&(m=!!n.leading,f=(g="maxWait"in n)?s(a(n.maxWait)||0,t):f,v="trailing"in n?!!n.trailing:v),M.cancel=x,M.flush=T,M}e.exports=c},53816(e,t,n){var r=n(69389),i=n(79833),a=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,o=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g");function s(e){return(e=i(e))&&e.replace(a,r).replace(o,"")}e.exports=s},66073(e,t,n){e.exports=n(84486)},77813(e){function t(e,t){return e===t||e!=e&&t!=t}e.exports=t},63105(e,t,n){var r=n(34963),i=n(80760),a=n(67206),o=n(1469);function s(e,t){return(o(e)?r:i)(e,a(t,3))}e.exports=s},85564(e,t,n){var r=n(21078);function i(e){return(null==e?0:e.length)?r(e,1):[]}e.exports=i},84486(e,t,n){var r=n(77412),i=n(89881),a=n(54290),o=n(1469);function s(e,t){return(o(e)?r:i)(e,a(t))}e.exports=s},27361(e,t,n){var r=n(97786);function i(e,t,n){var i=null==e?void 0:r(e,t);return void 0===i?n:i}e.exports=i},18721(e,t,n){var r=n(78565),i=n(222);function a(e,t){return null!=e&&i(e,t,r)}e.exports=a},79095(e,t,n){var r=n(13),i=n(222);function a(e,t){return null!=e&&i(e,t,r)}e.exports=a},6557(e){function t(e){return e}e.exports=t},35694(e,t,n){var r=n(9454),i=n(37005),a=Object.prototype,o=a.hasOwnProperty,s=a.propertyIsEnumerable,u=r(function(){return arguments}())?r:function(e){return i(e)&&o.call(e,"callee")&&!s.call(e,"callee")};e.exports=u},1469(e){var t=Array.isArray;e.exports=t},98612(e,t,n){var r=n(23560),i=n(41780);function a(e){return null!=e&&i(e.length)&&!r(e)}e.exports=a},29246(e,t,n){var r=n(98612),i=n(37005);function a(e){return i(e)&&r(e)}e.exports=a},44144(e,t,n){e=n.nmd(e);var r=n(55639),i=n(95062),a=t&&!t.nodeType&&t,o=a&&e&&!e.nodeType&&e,s=o&&o.exports===a?r.Buffer:void 0,u=(s?s.isBuffer:void 0)||i;e.exports=u},41609(e,t,n){var r=n(280),i=n(64160),a=n(35694),o=n(1469),s=n(98612),u=n(44144),c=n(25726),l=n(36719),f="[object Map]",d="[object Set]",h=Object.prototype.hasOwnProperty;function p(e){if(null==e)return!0;if(s(e)&&(o(e)||"string"==typeof e||"function"==typeof e.splice||u(e)||l(e)||a(e)))return!e.length;var t=i(e);if(t==f||t==d)return!e.size;if(c(e))return!r(e).length;for(var n in e)if(h.call(e,n))return!1;return!0}e.exports=p},23560(e,t,n){var r=n(44239),i=n(13218),a="[object AsyncFunction]",o="[object Function]",s="[object GeneratorFunction]",u="[object Proxy]";function c(e){if(!i(e))return!1;var t=r(e);return t==o||t==s||t==a||t==u}e.exports=c},41780(e){var t=9007199254740991;function n(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=t}e.exports=n},56688(e,t,n){var r=n(25588),i=n(7518),a=n(31167),o=a&&a.isMap,s=o?i(o):r;e.exports=s},45220(e){function t(e){return null===e}e.exports=t},13218(e){function t(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}e.exports=t},37005(e){function t(e){return null!=e&&"object"==typeof e}e.exports=t},68630(e,t,n){var r=n(44239),i=n(85924),a=n(37005),o="[object Object]",s=Function.prototype,u=Object.prototype,c=s.toString,l=u.hasOwnProperty,f=c.call(Object);function d(e){if(!a(e)||r(e)!=o)return!1;var t=i(e);if(null===t)return!0;var n=l.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&c.call(n)==f}e.exports=d},72928(e,t,n){var r=n(29221),i=n(7518),a=n(31167),o=a&&a.isSet,s=o?i(o):r;e.exports=s},47037(e,t,n){var r=n(44239),i=n(1469),a=n(37005),o="[object String]";function s(e){return"string"==typeof e||!i(e)&&a(e)&&r(e)==o}e.exports=s},33448(e,t,n){var r=n(44239),i=n(37005),a="[object Symbol]";function o(e){return"symbol"==typeof e||i(e)&&r(e)==a}e.exports=o},36719(e,t,n){var r=n(38749),i=n(7518),a=n(31167),o=a&&a.isTypedArray,s=o?i(o):r;e.exports=s},52353(e){function t(e){return void 0===e}e.exports=t},3674(e,t,n){var r=n(14636),i=n(280),a=n(98612);function o(e){return a(e)?r(e):i(e)}e.exports=o},81704(e,t,n){var r=n(14636),i=n(35014),a=n(98612);function o(e){return a(e)?r(e,!0):i(e)}e.exports=o},96486:function(e,t,n){var r;e=n.nmd(e),(function(){var i,a="4.17.21",o=200,s="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",u="Expected a function",c="Invalid `variable` option passed into `_.template`",l="__lodash_hash_undefined__",f=500,d="__lodash_placeholder__",h=1,p=2,b=4,m=1,g=2,v=1,y=2,w=4,_=8,E=16,S=32,k=64,x=128,T=256,M=512,O=30,A="...",L=800,C=16,I=1,D=2,N=3,P=1/0,R=9007199254740991,j=17976931348623157e292,F=0/0,Y=4294967295,B=Y-1,U=Y>>>1,H=[["ary",x],["bind",v],["bindKey",y],["curry",_],["curryRight",E],["flip",M],["partial",S],["partialRight",k],["rearg",T]],$="[object Arguments]",z="[object Array]",G="[object AsyncFunction]",W="[object Boolean]",K="[object Date]",V="[object DOMException]",q="[object Error]",Z="[object Function]",X="[object GeneratorFunction]",J="[object Map]",Q="[object Number]",ee="[object Null]",et="[object Object]",en="[object Promise]",er="[object Proxy]",ei="[object RegExp]",ea="[object Set]",eo="[object String]",es="[object Symbol]",eu="[object Undefined]",ec="[object WeakMap]",el="[object WeakSet]",ef="[object ArrayBuffer]",ed="[object DataView]",eh="[object Float32Array]",ep="[object Float64Array]",eb="[object Int8Array]",em="[object Int16Array]",eg="[object Int32Array]",ev="[object Uint8Array]",ey="[object Uint8ClampedArray]",ew="[object Uint16Array]",e_="[object Uint32Array]",eE=/\b__p \+= '';/g,eS=/\b(__p \+=) '' \+/g,ek=/(__e\(.*?\)|\b__t\)) \+\n'';/g,ex=/&(?:amp|lt|gt|quot|#39);/g,eT=/[&<>"']/g,eM=RegExp(ex.source),eO=RegExp(eT.source),eA=/<%-([\s\S]+?)%>/g,eL=/<%([\s\S]+?)%>/g,eC=/<%=([\s\S]+?)%>/g,eI=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,eD=/^\w*$/,eN=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,eP=/[\\^$.*+?()[\]{}|]/g,eR=RegExp(eP.source),ej=/^\s+/,eF=/\s/,eY=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,eB=/\{\n\/\* \[wrapped with (.+)\] \*/,eU=/,? & /,eH=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,e$=/[()=,{}\[\]\/\s]/,ez=/\\(\\)?/g,eG=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,eW=/\w*$/,eK=/^[-+]0x[0-9a-f]+$/i,eV=/^0b[01]+$/i,eq=/^\[object .+?Constructor\]$/,eZ=/^0o[0-7]+$/i,eX=/^(?:0|[1-9]\d*)$/,eJ=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,eQ=/($^)/,e1=/['\n\r\u2028\u2029\\]/g,e0="\ud800-\udfff",e2="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",e3="\\u2700-\\u27bf",e4="a-z\\xdf-\\xf6\\xf8-\\xff",e6="A-Z\\xc0-\\xd6\\xd8-\\xde",e5="\\ufe0e\\ufe0f",e8="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",e9="['’]",e7="["+e0+"]",te="["+e8+"]",tt="["+e2+"]",tn="\\d+",tr="["+e3+"]",ti="["+e4+"]",ta="[^"+e0+e8+tn+e3+e4+e6+"]",to="\ud83c[\udffb-\udfff]",ts="[^"+e0+"]",tu="(?:\ud83c[\udde6-\uddff]){2}",tc="[\ud800-\udbff][\udc00-\udfff]",tl="["+e6+"]",tf="\\u200d",td="(?:"+ti+"|"+ta+")",th="(?:"+tl+"|"+ta+")",tp="(?:"+e9+"(?:d|ll|m|re|s|t|ve))?",tb="(?:"+e9+"(?:D|LL|M|RE|S|T|VE))?",tm="(?:"+tt+"|"+to+")?",tg="["+e5+"]?",tv="(?:"+tf+"(?:"+[ts,tu,tc].join("|")+")"+tg+tm+")*",ty="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",tw="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",t_=tg+tm+tv,tE="(?:"+[tr,tu,tc].join("|")+")"+t_,tS="(?:"+[ts+tt+"?",tt,tu,tc,e7].join("|")+")",tk=RegExp(e9,"g"),tx=RegExp(tt,"g"),tT=RegExp(to+"(?="+to+")|"+tS+t_,"g"),tM=RegExp([tl+"?"+ti+"+"+tp+"(?="+[te,tl,"$"].join("|")+")",th+"+"+tb+"(?="+[te,tl+td,"$"].join("|")+")",tl+"?"+td+"+"+tp,tl+"+"+tb,tw,ty,tn,tE].join("|"),"g"),tO=RegExp("["+tf+e0+e2+e5+"]"),tA=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,tL=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],tC=-1,tI={};tI[eh]=tI[ep]=tI[eb]=tI[em]=tI[eg]=tI[ev]=tI[ey]=tI[ew]=tI[e_]=!0,tI[$]=tI[z]=tI[ef]=tI[W]=tI[ed]=tI[K]=tI[q]=tI[Z]=tI[J]=tI[Q]=tI[et]=tI[ei]=tI[ea]=tI[eo]=tI[ec]=!1;var tD={};tD[$]=tD[z]=tD[ef]=tD[ed]=tD[W]=tD[K]=tD[eh]=tD[ep]=tD[eb]=tD[em]=tD[eg]=tD[J]=tD[Q]=tD[et]=tD[ei]=tD[ea]=tD[eo]=tD[es]=tD[ev]=tD[ey]=tD[ew]=tD[e_]=!0,tD[q]=tD[Z]=tD[ec]=!1;var tN={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},tP={"&":"&","<":"<",">":">",'"':""","'":"'"},tR={"&":"&","<":"<",">":">",""":'"',"'":"'"},tj={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},tF=parseFloat,tY=parseInt,tB="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,tU="object"==typeof self&&self&&self.Object===Object&&self,tH=tB||tU||Function("return this")(),t$=t&&!t.nodeType&&t,tz=t$&&e&&!e.nodeType&&e,tG=tz&&tz.exports===t$,tW=tG&&tB.process,tK=function(){try{var e=tz&&tz.require&&tz.require("util").types;if(e)return e;return tW&&tW.binding&&tW.binding("util")}catch(t){}}(),tV=tK&&tK.isArrayBuffer,tq=tK&&tK.isDate,tZ=tK&&tK.isMap,tX=tK&&tK.isRegExp,tJ=tK&&tK.isSet,tQ=tK&&tK.isTypedArray;function t1(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function t0(e,t,n,r){for(var i=-1,a=null==e?0:e.length;++i-1}function t8(e,t,n){for(var r=-1,i=null==e?0:e.length;++r-1;);return n}function nk(e,t){for(var n=e.length;n--&&nu(t,e[n],0)>-1;);return n}function nx(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}var nT=nh(tN),nM=nh(tP);function nO(e){return"\\"+tj[e]}function nA(e,t){return null==e?i:e[t]}function nL(e){return tO.test(e)}function nC(e){return tA.test(e)}function nI(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}function nD(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function nN(e,t){return function(n){return e(t(n))}}function nP(e,t){for(var n=-1,r=e.length,i=0,a=[];++n-1}function rh(e,t){var n=this.__data__,r=rP(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function rp(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t=t?e:t)),e}function rH(e,t,n,r,a,o){var s,u=t&h,c=t&p,l=t&b;if(n&&(s=a?n(e,r,a,o):n(e)),s!==i)return s;if(!u1(e))return e;var f=uF(e);if(f){if(s=a8(e),!u)return al(e,s)}else{var d=a3(e),m=d==Z||d==X;if(u$(e))return ae(e,u);if(d==et||d==$||m&&!a){if(s=c||m?{}:a9(e),!u)return c?ah(e,rF(s,e)):ad(e,rj(s,e))}else{if(!tD[d])return a?e:{};s=a7(e,d,u)}}o||(o=new rS);var g=o.get(e);if(g)return g;o.set(e,s),cr(e)?e.forEach(function(r){s.add(rH(r,t,n,r,e,o))}):u2(e)&&e.forEach(function(r,i){s.set(i,rH(r,t,n,i,e,o))});var v=l?c?aW:aG:c?c$:cH,y=f?i:v(e);return t2(y||e,function(r,i){y&&(r=e[i=r]),rN(s,i,rH(r,t,n,i,e,o))}),s}function r$(e){var t=cH(e);return function(n){return rz(n,e,t)}}function rz(e,t,n){var r=n.length;if(null==e)return!r;for(e=e4(e);r--;){var a=n[r],o=t[a],s=e[a];if(s===i&&!(a in e)||!o(s))return!1}return!0}function rG(e,t,n){if("function"!=typeof e)throw new e8(u);return o_(function(){e.apply(i,n)},t)}function rW(e,t,n,r){var i=-1,a=t5,s=!0,u=e.length,c=[],l=t.length;if(!u)return c;n&&(t=t9(t,nw(n))),r?(a=t8,s=!1):t.length>=o&&(a=nE,s=!1,t=new rw(t));outer:for(;++ia?0:a+n),(r=r===i||r>a?a:cp(r))<0&&(r+=a),r=n>r?0:cb(r);n0&&n(s)?t>1?rQ(s,t-1,n,r,i):t7(i,s):r||(i[i.length]=s)}return i}var r1=ag(),r0=ag(!0);function r2(e,t){return e&&r1(e,t,cH)}function r3(e,t){return e&&r0(e,t,cH)}function r4(e,t){return t6(t,function(t){return uX(e[t])})}function r6(e,t){t=i5(t,e);for(var n=0,r=t.length;null!=e&&nt}function r7(e,t){return null!=e&&tr.call(e,t)}function ie(e,t){return null!=e&&t in e4(e)}function it(e,t,n){return e>=tU(t,n)&&e=120&&f.length>=120)?new rw(s&&f):i}f=e[0];var d=-1,h=u[0];outer:for(;++d-1;)s!==e&&tg.call(s,u,1),tg.call(e,u,1);return e}function iD(e,t){for(var n=e?t.length:0,r=n-1;n--;){var i=t[n];if(n==r||i!==a){var a=i;on(i)?tg.call(e,i,1):iJ(e,i)}}return e}function iN(e,t){return e+tO(tW()*(t-e+1))}function iP(e,t,n,r){for(var i=-1,a=tB(tM((t-e)/(n||1)),0),o=eF(a);a--;)o[r?a:++i]=e,e+=n;return o}function iR(e,t){var n="";if(!e||t<1||t>R)return n;do t%2&&(n+=e),(t=tO(t/2))&&(e+=e);while(t)return n}function ij(e,t){return oE(om(e,t,lB),e+"")}function iF(e){return rL(c8(e))}function iY(e,t){var n=c8(e);return ox(n,rU(t,0,n.length))}function iB(e,t,n,r){if(!u1(e))return e;t=i5(t,e);for(var a=-1,o=t.length,s=o-1,u=e;null!=u&&++ai?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var a=eF(i);++r>>1,o=e[a];null!==o&&!ca(o)&&(n?o<=t:o=o){var l=t?null:aP(e);if(l)return nR(l);s=!1,i=nE,c=new rw}else c=t?[]:u;outer:for(;++r=r?e:iz(e,t,n)}var i7=tE||function(e){return tH.clearTimeout(e)};function ae(e,t){if(t)return e.slice();var n=e.length,r=th?th(n):new e.constructor(n);return e.copy(r),r}function at(e){var t=new e.constructor(e.byteLength);return new td(t).set(new td(e)),t}function an(e,t){var n=t?at(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}function ar(e){var t=new e.constructor(e.source,eW.exec(e));return t.lastIndex=e.lastIndex,t}function ai(e){return n2?e4(n2.call(e)):{}}function aa(e,t){var n=t?at(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function ao(e,t){if(e!==t){var n=e!==i,r=null===e,a=e==e,o=ca(e),s=t!==i,u=null===t,c=t==t,l=ca(t);if(!u&&!l&&!o&&e>t||o&&s&&c&&!u&&!l||r&&s&&c||!n&&c||!a)return 1;if(!r&&!o&&!l&&e=s)return u;return u*("desc"==n[r]?-1:1)}}return e.index-t.index}function au(e,t,n,r){for(var i=-1,a=e.length,o=n.length,s=-1,u=t.length,c=tB(a-o,0),l=eF(u+c),f=!r;++s1?n[a-1]:i,s=a>2?n[2]:i;for(o=e.length>3&&"function"==typeof o?(a--,o):i,s&&or(n[0],n[1],s)&&(o=a<3?i:o,a=1),t=e4(t);++r-1?a[o?t[s]:s]:i}}function ak(e){return az(function(t){var n=t.length,r=n,a=n8.prototype.thru;for(e&&t.reverse();r--;){var o=t[r];if("function"!=typeof o)throw new e8(u);if(a&&!s&&"wrapper"==aV(o))var s=new n8([],!0)}for(r=s?r:n;++r1&&v.reverse(),f&&cu))return!1;var l=o.get(e),f=o.get(t);if(l&&f)return l==t&&f==e;var d=-1,h=!0,p=n&g?new rw:i;for(o.set(e,t),o.set(t,e);++d1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(eY,"{\n/* [wrapped with "+t+"] */\n")}function ot(e){return uF(e)||uj(e)||!!(tv&&e&&e[tv])}function on(e,t){var n=typeof e;return!!(t=null==t?R:t)&&("number"==n||"symbol"!=n&&eX.test(e))&&e>-1&&e%1==0&&e0){if(++t>=L)return arguments[0]}else t=0;return e.apply(i,arguments)}}function ox(e,t){var n=-1,r=e.length,a=r-1;for(t=t===i?r:t;++n1?e[t-1]:i;return n="function"==typeof n?(e.pop(),n):i,sE(e,n)});function sC(e){var t=n4(e);return t.__chain__=!0,t}function sI(e,t){return t(e),e}function sD(e,t){return t(e)}var sN=az(function(e){var t=e.length,n=t?e[0]:0,r=this.__wrapped__,a=function(t){return rB(t,e)};return!(t>1)&&!this.__actions__.length&&r instanceof n9&&on(n)?((r=r.slice(n,+n+(t?1:0))).__actions__.push({func:sD,args:[a],thisArg:i}),new n8(r,this.__chain__).thru(function(e){return t&&!e.length&&e.push(i),e})):this.thru(a)});function sP(){return sC(this)}function sR(){return new n8(this.value(),this.__chain__)}function sj(){i===this.__values__&&(this.__values__=cd(this.value()));var e=this.__index__>=this.__values__.length,t=e?i:this.__values__[this.__index__++];return{done:e,value:t}}function sF(){return this}function sY(e){for(var t,n=this;n instanceof n5;){var r=oL(n);r.__index__=0,r.__values__=i,t?a.__wrapped__=r:t=r;var a=r;n=n.__wrapped__}return a.__wrapped__=e,t}function sB(){var e=this.__wrapped__;if(e instanceof n9){var t=e;return this.__actions__.length&&(t=new n9(this)),(t=t.reverse()).__actions__.push({func:sD,args:[se],thisArg:i}),new n8(t,this.__chain__)}return this.thru(se)}function sU(){return i0(this.__wrapped__,this.__actions__)}var sH=ap(function(e,t,n){tr.call(e,n)?++e[n]:rY(e,n,1)});function s$(e,t,n){var r=uF(e)?t4:rq;return n&&or(e,t,n)&&(t=i),r(e,aZ(t,3))}function sz(e,t){return(uF(e)?t6:rJ)(e,aZ(t,3))}var sG=aS(oH),sW=aS(o$);function sK(e,t){return rQ(s2(e,t),1)}function sV(e,t){return rQ(s2(e,t),P)}function sq(e,t,n){return n=n===i?1:cp(n),rQ(s2(e,t),n)}function sZ(e,t){return(uF(e)?t2:rK)(e,aZ(t,3))}function sX(e,t){return(uF(e)?t3:rV)(e,aZ(t,3))}var sJ=ap(function(e,t,n){tr.call(e,n)?e[n].push(t):rY(e,n,[t])});function sQ(e,t,n,r){e=uB(e)?e:c8(e),n=n&&!r?cp(n):0;var i=e.length;return n<0&&(n=tB(i+n,0)),ci(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&nu(e,t,n)>-1}var s1=ij(function(e,t,n){var r=-1,i="function"==typeof t,a=uB(e)?eF(e.length):[];return rK(e,function(e){a[++r]=i?t1(t,e,n):ia(e,t,n)}),a}),s0=ap(function(e,t,n){rY(e,n,t)});function s2(e,t){return(uF(e)?t9:iE)(e,aZ(t,3))}function s3(e,t,n,r){return null==e?[]:(uF(t)||(t=null==t?[]:[t]),n=r?i:n,uF(n)||(n=null==n?[]:[n]),iO(e,t,n))}var s4=ap(function(e,t,n){e[n?0:1].push(t)},function(){return[[],[]]});function s6(e,t,n){var r=uF(e)?ne:np,i=arguments.length<3;return r(e,aZ(t,4),n,i,rK)}function s5(e,t,n){var r=uF(e)?nt:np,i=arguments.length<3;return r(e,aZ(t,4),n,i,rV)}function s8(e,t){return(uF(e)?t6:rJ)(e,ug(aZ(t,3)))}function s9(e){return(uF(e)?rL:iF)(e)}function s7(e,t,n){return t=(n?or(e,t,n):t===i)?1:cp(t),(uF(e)?rC:iY)(e,t)}function ue(e){return(uF(e)?rI:i$)(e)}function ut(e){if(null==e)return 0;if(uB(e))return ci(e)?nB(e):e.length;var t=a3(e);return t==J||t==ea?e.size:iy(e).length}function un(e,t,n){var r=uF(e)?nn:iG;return n&&or(e,t,n)&&(t=i),r(e,aZ(t,3))}var ur=ij(function(e,t){if(null==e)return[];var n=t.length;return n>1&&or(e,t[0],t[1])?t=[]:n>2&&or(t[0],t[1],t[2])&&(t=[t[0]]),iO(e,rQ(t,1),[])}),ui=tS||function(){return tH.Date.now()};function ua(e,t){if("function"!=typeof t)throw new e8(u);return e=cp(e),function(){if(--e<1)return t.apply(this,arguments)}}function uo(e,t,n){return t=n?i:t,t=e&&null==t?e.length:t,aj(e,x,i,i,i,i,t)}function us(e,t){var n;if("function"!=typeof t)throw new e8(u);return e=cp(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=i),n}}var uu=ij(function(e,t,n){var r=v;if(n.length){var i=nP(n,aq(uu));r|=S}return aj(e,r,t,n,i)}),uc=ij(function(e,t,n){var r=v|y;if(n.length){var i=nP(n,aq(uc));r|=S}return aj(t,r,e,n,i)});function ul(e,t,n){t=n?i:t;var r=aj(e,_,i,i,i,i,i,t);return r.placeholder=ul.placeholder,r}function uf(e,t,n){t=n?i:t;var r=aj(e,E,i,i,i,i,i,t);return r.placeholder=uf.placeholder,r}function ud(e,t,n){var r,a,o,s,c,l,f=0,d=!1,h=!1,p=!0;if("function"!=typeof e)throw new e8(u);function b(t){var n=r,o=a;return r=a=i,f=t,s=e.apply(o,n)}function m(e){return f=e,c=o_(y,t),d?b(e):s}function g(e){var n=e-l,r=e-f,i=t-n;return h?tU(i,o-r):i}function v(e){var n=e-l,r=e-f;return l===i||n>=t||n<0||h&&r>=o}function y(){var e=ui();if(v(e))return w(e);c=o_(y,g(e))}function w(e){return(c=i,p&&r)?b(e):(r=a=i,s)}function _(){c!==i&&i7(c),f=0,r=l=a=c=i}function E(){return c===i?s:w(ui())}function S(){var e=ui(),n=v(e);if(r=arguments,a=this,l=e,n){if(c===i)return m(l);if(h)return i7(c),c=o_(y,t),b(l)}return c===i&&(c=o_(y,t)),s}return t=cm(t)||0,u1(n)&&(d=!!n.leading,o=(h="maxWait"in n)?tB(cm(n.maxWait)||0,t):o,p="trailing"in n?!!n.trailing:p),S.cancel=_,S.flush=E,S}var uh=ij(function(e,t){return rG(e,1,t)}),up=ij(function(e,t,n){return rG(e,cm(t)||0,n)});function ub(e){return aj(e,M)}function um(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new e8(u);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);var o=e.apply(this,r);return n.cache=a.set(i,o)||a,o};return n.cache=new(um.Cache||rp),n}function ug(e){if("function"!=typeof e)throw new e8(u);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}function uv(e){return us(2,e)}um.Cache=rp;var uy=i8(function(e,t){var n=(t=1==t.length&&uF(t[0])?t9(t[0],nw(aZ())):t9(rQ(t,1),nw(aZ()))).length;return ij(function(r){for(var i=-1,a=tU(r.length,n);++i=t}),uj=io(function(){return arguments}())?io:function(e){return u0(e)&&tr.call(e,"callee")&&!tm.call(e,"callee")},uF=eF.isArray,uY=tV?nw(tV):is;function uB(e){return null!=e&&uQ(e.length)&&!uX(e)}function uU(e){return u0(e)&&uB(e)}function uH(e){return!0===e||!1===e||u0(e)&&r8(e)==W}var u$=tN||l4,uz=tq?nw(tq):iu;function uG(e){return u0(e)&&1===e.nodeType&&!ce(e)}function uW(e){if(null==e)return!0;if(uB(e)&&(uF(e)||"string"==typeof e||"function"==typeof e.splice||u$(e)||co(e)||uj(e)))return!e.length;var t=a3(e);if(t==J||t==ea)return!e.size;if(oc(e))return!iy(e).length;for(var n in e)if(tr.call(e,n))return!1;return!0}function uK(e,t){return ic(e,t)}function uV(e,t,n){var r=(n="function"==typeof n?n:i)?n(e,t):i;return r===i?ic(e,t,i,n):!!r}function uq(e){if(!u0(e))return!1;var t=r8(e);return t==q||t==V||"string"==typeof e.message&&"string"==typeof e.name&&!ce(e)}function uZ(e){return"number"==typeof e&&tP(e)}function uX(e){if(!u1(e))return!1;var t=r8(e);return t==Z||t==X||t==G||t==er}function uJ(e){return"number"==typeof e&&e==cp(e)}function uQ(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=R}function u1(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function u0(e){return null!=e&&"object"==typeof e}var u2=tZ?nw(tZ):id;function u3(e,t){return e===t||ih(e,t,aJ(t))}function u4(e,t,n){return n="function"==typeof n?n:i,ih(e,t,aJ(t),n)}function u6(e){return u7(e)&&e!=+e}function u5(e){if(ou(e))throw new e0(s);return ip(e)}function u8(e){return null===e}function u9(e){return null==e}function u7(e){return"number"==typeof e||u0(e)&&r8(e)==Q}function ce(e){if(!u0(e)||r8(e)!=et)return!1;var t=tp(e);if(null===t)return!0;var n=tr.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&tn.call(n)==ts}var ct=tX?nw(tX):ib;function cn(e){return uJ(e)&&e>=-R&&e<=R}var cr=tJ?nw(tJ):im;function ci(e){return"string"==typeof e||!uF(e)&&u0(e)&&r8(e)==eo}function ca(e){return"symbol"==typeof e||u0(e)&&r8(e)==es}var co=tQ?nw(tQ):ig;function cs(e){return e===i}function cu(e){return u0(e)&&a3(e)==ec}function cc(e){return u0(e)&&r8(e)==el}var cl=aI(i_),cf=aI(function(e,t){return e<=t});function cd(e){if(!e)return[];if(uB(e))return ci(e)?nU(e):al(e);if(ty&&e[ty])return nI(e[ty]());var t=a3(e);return(t==J?nD:t==ea?nR:c8)(e)}function ch(e){return e?(e=cm(e))===P||e===-P?(e<0?-1:1)*j:e==e?e:0:0===e?e:0}function cp(e){var t=ch(e),n=t%1;return t==t?n?t-n:t:0}function cb(e){return e?rU(cp(e),0,Y):0}function cm(e){if("number"==typeof e)return e;if(ca(e))return F;if(u1(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=u1(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=ny(e);var n=eV.test(e);return n||eZ.test(e)?tY(e.slice(2),n?2:8):eK.test(e)?F:+e}function cg(e){return af(e,c$(e))}function cv(e){return e?rU(cp(e),-R,R):0===e?e:0}function cy(e){return null==e?"":iZ(e)}var cw=ab(function(e,t){if(oc(t)||uB(t)){af(t,cH(t),e);return}for(var n in t)tr.call(t,n)&&rN(e,n,t[n])}),c_=ab(function(e,t){af(t,c$(t),e)}),cE=ab(function(e,t,n,r){af(t,c$(t),e,r)}),cS=ab(function(e,t,n,r){af(t,cH(t),e,r)}),ck=az(rB);function cx(e,t){var n=n6(e);return null==t?n:rj(n,t)}var cT=ij(function(e,t){e=e4(e);var n=-1,r=t.length,a=r>2?t[2]:i;for(a&&or(t[0],t[1],a)&&(r=1);++n1),t}),af(e,aW(e),n),r&&(n=rH(n,h|p|b,aB));for(var i=t.length;i--;)iJ(n,t[i]);return n});function cq(e,t){return cX(e,ug(aZ(t)))}var cZ=az(function(e,t){return null==e?{}:iA(e,t)});function cX(e,t){if(null==e)return{};var n=t9(aW(e),function(e){return[e]});return t=aZ(t),iL(e,n,function(e,n){return t(e,n[0])})}function cJ(e,t,n){t=i5(t,e);var r=-1,a=t.length;for(a||(a=1,e=i);++rt){var r=e;e=t,t=r}if(n||e%1||t%1){var a=tW();return tU(e+a*(t-e+tF("1e-"+((a+"").length-1))),t)}return iN(e,t)}var ln=aw(function(e,t,n){return t=t.toLowerCase(),e+(n?lr(t):t)});function lr(e){return lL(cy(e).toLowerCase())}function li(e){return(e=cy(e))&&e.replace(eJ,nT).replace(tx,"")}function la(e,t,n){e=cy(e),t=iZ(t);var r=e.length,a=n=n===i?r:rU(cp(n),0,r);return(n-=t.length)>=0&&e.slice(n,a)==t}function lo(e){return(e=cy(e))&&eO.test(e)?e.replace(eT,nM):e}function ls(e){return(e=cy(e))&&eR.test(e)?e.replace(eP,"\\$&"):e}var lu=aw(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}),lc=aw(function(e,t,n){return e+(n?" ":"")+t.toLowerCase()}),ll=ay("toLowerCase");function lf(e,t,n){e=cy(e);var r=(t=cp(t))?nB(e):0;if(!t||r>=t)return e;var i=(t-r)/2;return aA(tO(i),n)+e+aA(tM(i),n)}function ld(e,t,n){e=cy(e);var r=(t=cp(t))?nB(e):0;return t&&r>>0)?(e=cy(e))&&("string"==typeof t||null!=t&&!ct(t))&&!(t=iZ(t))&&nL(e)?i9(nU(e),0,n):e.split(t,n):[]}var ly=aw(function(e,t,n){return e+(n?" ":"")+lL(t)});function lw(e,t,n){return e=cy(e),n=null==n?0:rU(cp(n),0,e.length),t=iZ(t),e.slice(n,n+t.length)==t}function l_(e,t,n){var r=n4.templateSettings;n&&or(e,t,n)&&(t=i),e=cy(e),t=cE({},t,r,aF);var a,o,s=cE({},t.imports,r.imports,aF),u=cH(s),l=n_(s,u),f=0,d=t.interpolate||eQ,h="__p += '",p=e6((t.escape||eQ).source+"|"+d.source+"|"+(d===eC?eG:eQ).source+"|"+(t.evaluate||eQ).source+"|$","g"),b="//# sourceURL="+(tr.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++tC+"]")+"\n";e.replace(p,function(t,n,r,i,s,u){return r||(r=i),h+=e.slice(f,u).replace(e1,nO),n&&(a=!0,h+="' +\n__e("+n+") +\n'"),s&&(o=!0,h+="';\n"+s+";\n__p += '"),r&&(h+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),f=u+t.length,t}),h+="';\n";var m=tr.call(t,"variable")&&t.variable;if(m){if(e$.test(m))throw new e0(c)}else h="with (obj) {\n"+h+"\n}\n";h=(o?h.replace(eE,""):h).replace(eS,"$1").replace(ek,"$1;"),h="function("+(m||"obj")+") {\n"+(m?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(a?", __e = _.escape":"")+(o?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+h+"return __p\n}";var g=lI(function(){return e2(u,b+"return "+h).apply(i,l)});if(g.source=h,uq(g))throw g;return g}function lE(e){return cy(e).toLowerCase()}function lS(e){return cy(e).toUpperCase()}function lk(e,t,n){if((e=cy(e))&&(n||t===i))return ny(e);if(!e||!(t=iZ(t)))return e;var r=nU(e),a=nU(t),o=nS(r,a),s=nk(r,a)+1;return i9(r,o,s).join("")}function lx(e,t,n){if((e=cy(e))&&(n||t===i))return e.slice(0,nH(e)+1);if(!e||!(t=iZ(t)))return e;var r=nU(e),a=nk(r,nU(t))+1;return i9(r,0,a).join("")}function lT(e,t,n){if((e=cy(e))&&(n||t===i))return e.replace(ej,"");if(!e||!(t=iZ(t)))return e;var r=nU(e),a=nS(r,nU(t));return i9(r,a).join("")}function lM(e,t){var n=O,r=A;if(u1(t)){var a="separator"in t?t.separator:a;n="length"in t?cp(t.length):n,r="omission"in t?iZ(t.omission):r}var o=(e=cy(e)).length;if(nL(e)){var s=nU(e);o=s.length}if(n>=o)return e;var u=n-nB(r);if(u<1)return r;var c=s?i9(s,0,u).join(""):e.slice(0,u);if(a===i)return c+r;if(s&&(u+=c.length-u),ct(a)){if(e.slice(u).search(a)){var l,f=c;for(a.global||(a=e6(a.source,cy(eW.exec(a))+"g")),a.lastIndex=0;l=a.exec(f);)var d=l.index;c=c.slice(0,d===i?u:d)}}else if(e.indexOf(iZ(a),u)!=u){var h=c.lastIndexOf(a);h>-1&&(c=c.slice(0,h))}return c+r}function lO(e){return(e=cy(e))&&eM.test(e)?e.replace(ex,n$):e}var lA=aw(function(e,t,n){return e+(n?" ":"")+t.toUpperCase()}),lL=ay("toUpperCase");function lC(e,t,n){return(e=cy(e),i===(t=n?i:t))?nC(e)?nW(e):na(e):e.match(t)||[]}var lI=ij(function(e,t){try{return t1(e,i,t)}catch(n){return uq(n)?n:new e0(n)}}),lD=az(function(e,t){return t2(t,function(t){t=oM(t),rY(e,t,uu(e[t],e))}),e});function lN(e){var t=null==e?0:e.length,n=aZ();return e=t?t9(e,function(e){if("function"!=typeof e[1])throw new e8(u);return[n(e[0]),e[1]]}):[],ij(function(n){for(var r=-1;++rR)return[];var n=Y,r=tU(e,Y);t=aZ(t),e-=Y;for(var i=ng(r,t);++n0||t<0)?new n9(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==i&&(n=(t=cp(t))<0?n.dropRight(-t):n.take(t-e)),n)},n9.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},n9.prototype.toArray=function(){return this.take(Y)},r2(n9.prototype,function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),r=/^(?:head|last)$/.test(t),a=n4[r?"take"+("last"==t?"Right":""):t],o=r||/^find/.test(t);a&&(n4.prototype[t]=function(){var t=this.__wrapped__,s=r?[1]:arguments,u=t instanceof n9,c=s[0],l=u||uF(t),f=function(e){var t=a.apply(n4,t7([e],s));return r&&d?t[0]:t};l&&n&&"function"==typeof c&&1!=c.length&&(u=l=!1);var d=this.__chain__,h=!!this.__actions__.length,p=o&&!d,b=u&&!h;if(!o&&l){t=b?t:new n9(this);var m=e.apply(t,s);return m.__actions__.push({func:sD,args:[f],thisArg:i}),new n8(m,d)}return p&&b?e.apply(this,s):(m=this.thru(f),p?r?m.value()[0]:m.value():m)})}),t2(["pop","push","shift","sort","splice","unshift"],function(e){var t=e9[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);n4.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var i=this.value();return t.apply(uF(i)?i:[],e)}return this[n](function(n){return t.apply(uF(n)?n:[],e)})}}),r2(n9.prototype,function(e,t){var n=n4[t];if(n){var r=n.name+"";tr.call(nq,r)||(nq[r]=[]),nq[r].push({name:t,func:n})}}),nq[ax(i,y).name]=[{name:"wrapper",func:i}],n9.prototype.clone=n7,n9.prototype.reverse=re,n9.prototype.value=rt,n4.prototype.at=sN,n4.prototype.chain=sP,n4.prototype.commit=sR,n4.prototype.next=sj,n4.prototype.plant=sY,n4.prototype.reverse=sB,n4.prototype.toJSON=n4.prototype.valueOf=n4.prototype.value=sU,n4.prototype.first=n4.prototype.head,ty&&(n4.prototype[ty]=sF),n4}();tH._=nK,i!==(r=(function(){return nK}).call(t,n,t,e))&&(e.exports=r)}).call(this)},35161(e,t,n){var r=n(29932),i=n(67206),a=n(69199),o=n(1469);function s(e,t){return(o(e)?r:a)(e,i(t,3))}e.exports=s},67523(e,t,n){var r=n(89465),i=n(47816),a=n(67206);function o(e,t){var n={};return t=a(t,3),i(e,function(e,i,a){r(n,t(e,i,a),e)}),n}e.exports=o},66604(e,t,n){var r=n(89465),i=n(47816),a=n(67206);function o(e,t){var n={};return t=a(t,3),i(e,function(e,i,a){r(n,i,t(e,i,a))}),n}e.exports=o},88306(e,t,n){var r=n(83369),i="Expected a function";function a(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw TypeError(i);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);var o=e.apply(this,r);return n.cache=a.set(i,o)||a,o};return n.cache=new(a.Cache||r),n}a.Cache=r,e.exports=a},82492(e,t,n){var r=n(42980),i=n(21463)(function(e,t,n){r(e,t,n)});e.exports=i},50308(e){function t(){}e.exports=t},7771(e,t,n){var r=n(55639),i=function(){return r.Date.now()};e.exports=i},78718(e,t,n){var r=n(25970),i=n(99021)(function(e,t){return null==e?{}:r(e,t)});e.exports=i},39601(e,t,n){var r=n(40371),i=n(79152),a=n(15403),o=n(40327);function s(e){return a(e)?r(o(e)):i(e)}e.exports=s},54061(e,t,n){var r=n(62663),i=n(89881),a=n(67206),o=n(10107),s=n(1469);function u(e,t,n){var u=s(e)?r:o,c=arguments.length<3;return u(e,a(t,4),n,c,i)}e.exports=u},84238(e,t,n){var r=n(280),i=n(64160),a=n(98612),o=n(47037),s=n(88016),u="[object Map]",c="[object Set]";function l(e){if(null==e)return 0;if(a(e))return o(e)?s(e):e.length;var t=i(e);return t==u||t==c?e.size:r(e).length}e.exports=l},11865(e,t,n){var r=n(35393)(function(e,t,n){return e+(n?"_":"")+t.toLowerCase()});e.exports=r},70479(e){function t(){return[]}e.exports=t},95062(e){function t(){return!1}e.exports=t},14841(e,t,n){var r=n(27561),i=n(13218),a=n(33448),o=0/0,s=/^[-+]0x[0-9a-f]+$/i,u=/^0b[01]+$/i,c=/^0o[0-7]+$/i,l=parseInt;function f(e){if("number"==typeof e)return e;if(a(e))return o;if(i(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=i(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=r(e);var n=u.test(e);return n||c.test(e)?l(e.slice(2),n?2:8):s.test(e)?o:+e}e.exports=f},59881(e,t,n){var r=n(98363),i=n(81704);function a(e){return r(e,i(e))}e.exports=a},79833(e,t,n){var r=n(80531);function i(e){return null==e?"":r(e)}e.exports=i},68718(e,t,n){var r=n(77412),i=n(3118),a=n(47816),o=n(67206),s=n(85924),u=n(1469),c=n(44144),l=n(23560),f=n(13218),d=n(36719);function h(e,t,n){var h=u(e),p=h||c(e)||d(e);if(t=o(t,4),null==n){var b=e&&e.constructor;n=p?h?new b:[]:f(e)&&l(b)?i(s(e)):{}}return(p?r:a)(e,function(e,r,i){return t(n,e,r,i)}),n}e.exports=h},93386(e,t,n){var r=n(21078),i=n(5976),a=n(45652),o=n(29246),s=i(function(e){return a(r(e,1,o,!0))});e.exports=s},11700(e,t,n){var r=n(98805)("toUpperCase");e.exports=r},52628(e,t,n){var r=n(47415),i=n(3674);function a(e){return null==e?[]:r(e,i(e))}e.exports=a},58748(e,t,n){var r=n(49029),i=n(93157),a=n(79833),o=n(2757);function s(e,t,n){return(e=a(e),void 0===(t=n?void 0:t))?i(e)?o(e):r(e):e.match(t)||[]}e.exports=s},42786:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("af",{months:"Januarie_Februarie_Maart_April_Mei_Junie_Julie_Augustus_September_Oktober_November_Desember".split("_"),monthsShort:"Jan_Feb_Mrt_Apr_Mei_Jun_Jul_Aug_Sep_Okt_Nov_Des".split("_"),weekdays:"Sondag_Maandag_Dinsdag_Woensdag_Donderdag_Vrydag_Saterdag".split("_"),weekdaysShort:"Son_Maa_Din_Woe_Don_Vry_Sat".split("_"),weekdaysMin:"So_Ma_Di_Wo_Do_Vr_Sa".split("_"),meridiemParse:/vm|nm/i,isPM:function(e){return/^nm$/i.test(e)},meridiem:function(e,t,n){return e<12?n?"vm":"VM":n?"nm":"NM"},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Vandag om] LT",nextDay:"[M\xf4re om] LT",nextWeek:"dddd [om] LT",lastDay:"[Gister om] LT",lastWeek:"[Laas] dddd [om] LT",sameElse:"L"},relativeTime:{future:"oor %s",past:"%s gelede",s:"'n paar sekondes",ss:"%d sekondes",m:"'n minuut",mm:"%d minute",h:"'n uur",hh:"%d ure",d:"'n dag",dd:"%d dae",M:"'n maand",MM:"%d maande",y:"'n jaar",yy:"%d jaar"},dayOfMonthOrdinalParse:/\d{1,2}(ste|de)/,ordinal:function(e){return e+(1===e||8===e||e>=20?"ste":"de")},week:{dow:1,doy:4}})})(n(30381))},14130:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration -var t=function(e){return 0===e?0:1===e?1:2===e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5},n={s:["أقل من ثانية","ثانية واحدة",["ثانيتان","ثانيتين"],"%d ثوان","%d ثانية","%d ثانية",],m:["أقل من دقيقة","دقيقة واحدة",["دقيقتان","دقيقتين"],"%d دقائق","%d دقيقة","%d دقيقة",],h:["أقل من ساعة","ساعة واحدة",["ساعتان","ساعتين"],"%d ساعات","%d ساعة","%d ساعة",],d:["أقل من يوم","يوم واحد",["يومان","يومين"],"%d أيام","%d يومًا","%d يوم",],M:["أقل من شهر","شهر واحد",["شهران","شهرين"],"%d أشهر","%d شهرا","%d شهر",],y:["أقل من عام","عام واحد",["عامان","عامين"],"%d أعوام","%d عامًا","%d عام",]},r=function(e){return function(r,i,a,o){var s=t(r),u=n[e][t(r)];return 2===s&&(u=u[i?0:1]),u.replace(/%d/i,r)}},i=["جانفي","فيفري","مارس","أفريل","ماي","جوان","جويلية","أوت","سبتمبر","أكتوبر","نوفمبر","ديسمبر",];return e.defineLocale("ar-dz",{months:i,monthsShort:i,weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/‏M/‏YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(e){return"م"===e},meridiem:function(e,t,n){return e<12?"ص":"م"},calendar:{sameDay:"[اليوم عند الساعة] LT",nextDay:"[غدًا عند الساعة] LT",nextWeek:"dddd [عند الساعة] LT",lastDay:"[أمس عند الساعة] LT",lastWeek:"dddd [عند الساعة] LT",sameElse:"L"},relativeTime:{future:"بعد %s",past:"منذ %s",s:r("s"),ss:r("s"),m:r("m"),mm:r("m"),h:r("h"),hh:r("h"),d:r("d"),dd:r("d"),M:r("M"),MM:r("M"),y:r("y"),yy:r("y")},postformat:function(e){return e.replace(/,/g,"،")},week:{dow:0,doy:4}})})(n(30381))},96135:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("ar-kw",{months:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),weekdays:"الأحد_الإتنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"احد_اتنين_ثلاثاء_اربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",ss:"%d ثانية",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},week:{dow:0,doy:12}})})(n(30381))},56440:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration -var t={1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",0:"0"},n=function(e){return 0===e?0:1===e?1:2===e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5},r={s:["أقل من ثانية","ثانية واحدة",["ثانيتان","ثانيتين"],"%d ثوان","%d ثانية","%d ثانية",],m:["أقل من دقيقة","دقيقة واحدة",["دقيقتان","دقيقتين"],"%d دقائق","%d دقيقة","%d دقيقة",],h:["أقل من ساعة","ساعة واحدة",["ساعتان","ساعتين"],"%d ساعات","%d ساعة","%d ساعة",],d:["أقل من يوم","يوم واحد",["يومان","يومين"],"%d أيام","%d يومًا","%d يوم",],M:["أقل من شهر","شهر واحد",["شهران","شهرين"],"%d أشهر","%d شهرا","%d شهر",],y:["أقل من عام","عام واحد",["عامان","عامين"],"%d أعوام","%d عامًا","%d عام",]},i=function(e){return function(t,i,a,o){var s=n(t),u=r[e][n(t)];return 2===s&&(u=u[i?0:1]),u.replace(/%d/i,t)}},a=["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر",];return e.defineLocale("ar-ly",{months:a,monthsShort:a,weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/‏M/‏YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(e){return"م"===e},meridiem:function(e,t,n){return e<12?"ص":"م"},calendar:{sameDay:"[اليوم عند الساعة] LT",nextDay:"[غدًا عند الساعة] LT",nextWeek:"dddd [عند الساعة] LT",lastDay:"[أمس عند الساعة] LT",lastWeek:"dddd [عند الساعة] LT",sameElse:"L"},relativeTime:{future:"بعد %s",past:"منذ %s",s:i("s"),ss:i("s"),m:i("m"),mm:i("m"),h:i("h"),hh:i("h"),d:i("d"),dd:i("d"),M:i("M"),MM:i("M"),y:i("y"),yy:i("y")},preparse:function(e){return e.replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]}).replace(/,/g,"،")},week:{dow:6,doy:12}})})(n(30381))},47702:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("ar-ma",{months:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"احد_اثنين_ثلاثاء_اربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",ss:"%d ثانية",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},week:{dow:1,doy:4}})})(n(30381))},16040:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration -var t={1:"١",2:"٢",3:"٣",4:"٤",5:"٥",6:"٦",7:"٧",8:"٨",9:"٩",0:"٠"},n={"١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","٠":"0"};return e.defineLocale("ar-sa",{months:"يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(e){return"م"===e},meridiem:function(e,t,n){return e<12?"ص":"م"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",ss:"%d ثانية",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},preparse:function(e){return e.replace(/[١٢٣٤٥٦٧٨٩٠]/g,function(e){return n[e]}).replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]}).replace(/,/g,"،")},week:{dow:0,doy:6}})})(n(30381))},37100:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("ar-tn",{months:"جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),monthsShort:"جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",ss:"%d ثانية",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},week:{dow:1,doy:4}})})(n(30381))},30867:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration -var t={1:"١",2:"٢",3:"٣",4:"٤",5:"٥",6:"٦",7:"٧",8:"٨",9:"٩",0:"٠"},n={"١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","٠":"0"},r=function(e){return 0===e?0:1===e?1:2===e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5},i={s:["أقل من ثانية","ثانية واحدة",["ثانيتان","ثانيتين"],"%d ثوان","%d ثانية","%d ثانية",],m:["أقل من دقيقة","دقيقة واحدة",["دقيقتان","دقيقتين"],"%d دقائق","%d دقيقة","%d دقيقة",],h:["أقل من ساعة","ساعة واحدة",["ساعتان","ساعتين"],"%d ساعات","%d ساعة","%d ساعة",],d:["أقل من يوم","يوم واحد",["يومان","يومين"],"%d أيام","%d يومًا","%d يوم",],M:["أقل من شهر","شهر واحد",["شهران","شهرين"],"%d أشهر","%d شهرا","%d شهر",],y:["أقل من عام","عام واحد",["عامان","عامين"],"%d أعوام","%d عامًا","%d عام",]},a=function(e){return function(t,n,a,o){var s=r(t),u=i[e][r(t)];return 2===s&&(u=u[n?0:1]),u.replace(/%d/i,t)}},o=["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر",];return e.defineLocale("ar",{months:o,monthsShort:o,weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/‏M/‏YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(e){return"م"===e},meridiem:function(e,t,n){return e<12?"ص":"م"},calendar:{sameDay:"[اليوم عند الساعة] LT",nextDay:"[غدًا عند الساعة] LT",nextWeek:"dddd [عند الساعة] LT",lastDay:"[أمس عند الساعة] LT",lastWeek:"dddd [عند الساعة] LT",sameElse:"L"},relativeTime:{future:"بعد %s",past:"منذ %s",s:a("s"),ss:a("s"),m:a("m"),mm:a("m"),h:a("h"),hh:a("h"),d:a("d"),dd:a("d"),M:a("M"),MM:a("M"),y:a("y"),yy:a("y")},preparse:function(e){return e.replace(/[١٢٣٤٥٦٧٨٩٠]/g,function(e){return n[e]}).replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]}).replace(/,/g,"،")},week:{dow:6,doy:12}})})(n(30381))},31083:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration -var t={1:"-inci",5:"-inci",8:"-inci",70:"-inci",80:"-inci",2:"-nci",7:"-nci",20:"-nci",50:"-nci",3:"-\xfcnc\xfc",4:"-\xfcnc\xfc",100:"-\xfcnc\xfc",6:"-ncı",9:"-uncu",10:"-uncu",30:"-uncu",60:"-ıncı",90:"-ıncı"};return e.defineLocale("az",{months:"yanvar_fevral_mart_aprel_may_iyun_iyul_avqust_sentyabr_oktyabr_noyabr_dekabr".split("_"),monthsShort:"yan_fev_mar_apr_may_iyn_iyl_avq_sen_okt_noy_dek".split("_"),weekdays:"Bazar_Bazar ertəsi_\xc7ərşənbə axşamı_\xc7ərşənbə_C\xfcmə axşamı_C\xfcmə_Şənbə".split("_"),weekdaysShort:"Baz_BzE_\xc7Ax_\xc7ər_CAx_C\xfcm_Şən".split("_"),weekdaysMin:"Bz_BE_\xc7A_\xc7ə_CA_C\xfc_Şə".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[bug\xfcn saat] LT",nextDay:"[sabah saat] LT",nextWeek:"[gələn həftə] dddd [saat] LT",lastDay:"[d\xfcnən] LT",lastWeek:"[ke\xe7ən həftə] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s sonra",past:"%s əvvəl",s:"bir ne\xe7ə saniyə",ss:"%d saniyə",m:"bir dəqiqə",mm:"%d dəqiqə",h:"bir saat",hh:"%d saat",d:"bir g\xfcn",dd:"%d g\xfcn",M:"bir ay",MM:"%d ay",y:"bir il",yy:"%d il"},meridiemParse:/gecə|səhər|gündüz|axşam/,isPM:function(e){return/^(gündüz|axşam)$/.test(e)},meridiem:function(e,t,n){return e<4?"gecə":e<12?"səhər":e<17?"g\xfcnd\xfcz":"axşam"},dayOfMonthOrdinalParse:/\d{1,2}-(ıncı|inci|nci|üncü|ncı|uncu)/,ordinal:function(e){if(0===e)return e+"-ıncı";var n=e%10,r=e%100-n,i=e>=100?100:null;return e+(t[n]||t[r]||t[i])},week:{dow:1,doy:7}})})(n(30381))},9808:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration -function t(e,t){var n=e.split("_");return t%10==1&&t%100!=11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}function n(e,n,r){var i={ss:n?"секунда_секунды_секунд":"секунду_секунды_секунд",mm:n?"хвіліна_хвіліны_хвілін":"хвіліну_хвіліны_хвілін",hh:n?"гадзіна_гадзіны_гадзін":"гадзіну_гадзіны_гадзін",dd:"дзень_дні_дзён",MM:"месяц_месяцы_месяцаў",yy:"год_гады_гадоў"};return"m"===r?n?"хвіліна":"хвіліну":"h"===r?n?"гадзіна":"гадзіну":e+" "+t(i[r],+e)}return e.defineLocale("be",{months:{format:"студзеня_лютага_сакавіка_красавіка_траўня_чэрвеня_ліпеня_жніўня_верасня_кастрычніка_лістапада_снежня".split("_"),standalone:"студзень_люты_сакавік_красавік_травень_чэрвень_ліпень_жнівень_верасень_кастрычнік_лістапад_снежань".split("_")},monthsShort:"студ_лют_сак_крас_трав_чэрв_ліп_жнів_вер_каст_ліст_снеж".split("_"),weekdays:{format:"нядзелю_панядзелак_аўторак_сераду_чацвер_пятніцу_суботу".split("_"),standalone:"нядзеля_панядзелак_аўторак_серада_чацвер_пятніца_субота".split("_"),isFormat:/\[ ?[Ууў] ?(?:мінулую|наступную)? ?\] ?dddd/},weekdaysShort:"нд_пн_ат_ср_чц_пт_сб".split("_"),weekdaysMin:"нд_пн_ат_ср_чц_пт_сб".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., HH:mm",LLLL:"dddd, D MMMM YYYY г., HH:mm"},calendar:{sameDay:"[Сёння ў] LT",nextDay:"[Заўтра ў] LT",lastDay:"[Учора ў] LT",nextWeek:function(){return"[У] dddd [ў] LT"},lastWeek:function(){switch(this.day()){case 0:case 3:case 5:case 6:return"[У мінулую] dddd [ў] LT";case 1:case 2:case 4:return"[У мінулы] dddd [ў] LT"}},sameElse:"L"},relativeTime:{future:"праз %s",past:"%s таму",s:"некалькі секунд",m:n,mm:n,h:n,hh:n,d:"дзень",dd:n,M:"месяц",MM:n,y:"год",yy:n},meridiemParse:/ночы|раніцы|дня|вечара/,isPM:function(e){return/^(дня|вечара)$/.test(e)},meridiem:function(e,t,n){return e<4?"ночы":e<12?"раніцы":e<17?"дня":"вечара"},dayOfMonthOrdinalParse:/\d{1,2}-(і|ы|га)/,ordinal:function(e,t){switch(t){case"M":case"d":case"DDD":case"w":case"W":return(e%10==2||e%10==3)&&e%100!=12&&e%100!=13?e+"-і":e+"-ы";case"D":return e+"-га";default:return e}},week:{dow:1,doy:7}})})(n(30381))},68338:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("bg",{months:"януари_февруари_март_април_май_юни_юли_август_септември_октомври_ноември_декември".split("_"),monthsShort:"яну_фев_мар_апр_май_юни_юли_авг_сеп_окт_ное_дек".split("_"),weekdays:"неделя_понеделник_вторник_сряда_четвъртък_петък_събота".split("_"),weekdaysShort:"нед_пон_вто_сря_чет_пет_съб".split("_"),weekdaysMin:"нд_пн_вт_ср_чт_пт_сб".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[Днес в] LT",nextDay:"[Утре в] LT",nextWeek:"dddd [в] LT",lastDay:"[Вчера в] LT",lastWeek:function(){switch(this.day()){case 0:case 3:case 6:return"[Миналата] dddd [в] LT";case 1:case 2:case 4:case 5:return"[Миналия] dddd [в] LT"}},sameElse:"L"},relativeTime:{future:"след %s",past:"преди %s",s:"няколко секунди",ss:"%d секунди",m:"минута",mm:"%d минути",h:"час",hh:"%d часа",d:"ден",dd:"%d дена",w:"седмица",ww:"%d седмици",M:"месец",MM:"%d месеца",y:"година",yy:"%d години"},dayOfMonthOrdinalParse:/\d{1,2}-(ев|ен|ти|ви|ри|ми)/,ordinal:function(e){var t=e%10,n=e%100;if(0===e)return e+"-ев";if(0===n)return e+"-ен";if(n>10&&n<20)return e+"-ти";if(1===t)return e+"-ви";if(2===t)return e+"-ри";else if(7===t||8===t)return e+"-ми";else return e+"-ти"},week:{dow:1,doy:7}})})(n(30381))},67438:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("bm",{months:"Zanwuyekalo_Fewuruyekalo_Marisikalo_Awirilikalo_Mɛkalo_Zuwɛnkalo_Zuluyekalo_Utikalo_Sɛtanburukalo_ɔkutɔburukalo_Nowanburukalo_Desanburukalo".split("_"),monthsShort:"Zan_Few_Mar_Awi_Mɛ_Zuw_Zul_Uti_Sɛt_ɔku_Now_Des".split("_"),weekdays:"Kari_Ntɛnɛn_Tarata_Araba_Alamisa_Juma_Sibiri".split("_"),weekdaysShort:"Kar_Ntɛ_Tar_Ara_Ala_Jum_Sib".split("_"),weekdaysMin:"Ka_Nt_Ta_Ar_Al_Ju_Si".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"MMMM [tile] D [san] YYYY",LLL:"MMMM [tile] D [san] YYYY [lɛrɛ] HH:mm",LLLL:"dddd MMMM [tile] D [san] YYYY [lɛrɛ] HH:mm"},calendar:{sameDay:"[Bi lɛrɛ] LT",nextDay:"[Sini lɛrɛ] LT",nextWeek:"dddd [don lɛrɛ] LT",lastDay:"[Kunu lɛrɛ] LT",lastWeek:"dddd [tɛmɛnen lɛrɛ] LT",sameElse:"L"},relativeTime:{future:"%s kɔnɔ",past:"a bɛ %s bɔ",s:"sanga dama dama",ss:"sekondi %d",m:"miniti kelen",mm:"miniti %d",h:"lɛrɛ kelen",hh:"lɛrɛ %d",d:"tile kelen",dd:"tile %d",M:"kalo kelen",MM:"kalo %d",y:"san kelen",yy:"san %d"},week:{dow:1,doy:4}})})(n(30381))},76225:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration -var t={1:"১",2:"২",3:"৩",4:"৪",5:"৫",6:"৬",7:"৭",8:"৮",9:"৯",0:"০"},n={"১":"1","২":"2","৩":"3","৪":"4","৫":"5","৬":"6","৭":"7","৮":"8","৯":"9","০":"0"};return e.defineLocale("bn-bd",{months:"জানুয়ারি_ফেব্রুয়ারি_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর".split("_"),monthsShort:"জানু_ফেব্রু_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্ট_অক্টো_নভে_ডিসে".split("_"),weekdays:"রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পতিবার_শুক্রবার_শনিবার".split("_"),weekdaysShort:"রবি_সোম_মঙ্গল_বুধ_বৃহস্পতি_শুক্র_শনি".split("_"),weekdaysMin:"রবি_সোম_মঙ্গল_বুধ_বৃহ_শুক্র_শনি".split("_"),longDateFormat:{LT:"A h:mm সময়",LTS:"A h:mm:ss সময়",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm সময়",LLLL:"dddd, D MMMM YYYY, A h:mm সময়"},calendar:{sameDay:"[আজ] LT",nextDay:"[আগামীকাল] LT",nextWeek:"dddd, LT",lastDay:"[গতকাল] LT",lastWeek:"[গত] dddd, LT",sameElse:"L"},relativeTime:{future:"%s পরে",past:"%s আগে",s:"কয়েক সেকেন্ড",ss:"%d সেকেন্ড",m:"এক মিনিট",mm:"%d মিনিট",h:"এক ঘন্টা",hh:"%d ঘন্টা",d:"এক দিন",dd:"%d দিন",M:"এক মাস",MM:"%d মাস",y:"এক বছর",yy:"%d বছর"},preparse:function(e){return e.replace(/[১২৩৪৫৬৭৮৯০]/g,function(e){return n[e]})},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]})},meridiemParse:/রাত|ভোর|সকাল|দুপুর|বিকাল|সন্ধ্যা|রাত/,meridiemHour:function(e,t){if(12===e&&(e=0),"রাত"===t)return e<4?e:e+12;if("ভোর"===t)return e;if("সকাল"===t)return e;if("দুপুর"===t)return e>=3?e:e+12;if("বিকাল"===t)return e+12;else if("সন্ধ্যা"===t)return e+12},meridiem:function(e,t,n){if(e<4)return"রাত";if(e<6)return"ভোর";if(e<12)return"সকাল";if(e<15)return"দুপুর";if(e<18)return"বিকাল";else if(e<20)return"সন্ধ্যা";else return"রাত"},week:{dow:0,doy:6}})})(n(30381))},8905:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration -var t={1:"১",2:"২",3:"৩",4:"৪",5:"৫",6:"৬",7:"৭",8:"৮",9:"৯",0:"০"},n={"১":"1","২":"2","৩":"3","৪":"4","৫":"5","৬":"6","৭":"7","৮":"8","৯":"9","০":"0"};return e.defineLocale("bn",{months:"জানুয়ারি_ফেব্রুয়ারি_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর".split("_"),monthsShort:"জানু_ফেব্রু_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্ট_অক্টো_নভে_ডিসে".split("_"),weekdays:"রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পতিবার_শুক্রবার_শনিবার".split("_"),weekdaysShort:"রবি_সোম_মঙ্গল_বুধ_বৃহস্পতি_শুক্র_শনি".split("_"),weekdaysMin:"রবি_সোম_মঙ্গল_বুধ_বৃহ_শুক্র_শনি".split("_"),longDateFormat:{LT:"A h:mm সময়",LTS:"A h:mm:ss সময়",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm সময়",LLLL:"dddd, D MMMM YYYY, A h:mm সময়"},calendar:{sameDay:"[আজ] LT",nextDay:"[আগামীকাল] LT",nextWeek:"dddd, LT",lastDay:"[গতকাল] LT",lastWeek:"[গত] dddd, LT",sameElse:"L"},relativeTime:{future:"%s পরে",past:"%s আগে",s:"কয়েক সেকেন্ড",ss:"%d সেকেন্ড",m:"এক মিনিট",mm:"%d মিনিট",h:"এক ঘন্টা",hh:"%d ঘন্টা",d:"এক দিন",dd:"%d দিন",M:"এক মাস",MM:"%d মাস",y:"এক বছর",yy:"%d বছর"},preparse:function(e){return e.replace(/[১২৩৪৫৬৭৮৯০]/g,function(e){return n[e]})},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]})},meridiemParse:/রাত|সকাল|দুপুর|বিকাল|রাত/,meridiemHour:function(e,t){return(12===e&&(e=0),"রাত"===t&&e>=4||"দুপুর"===t&&e<5||"বিকাল"===t)?e+12:e},meridiem:function(e,t,n){return e<4?"রাত":e<10?"সকাল":e<17?"দুপুর":e<20?"বিকাল":"রাত"},week:{dow:0,doy:6}})})(n(30381))},11560:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration -var t={1:"༡",2:"༢",3:"༣",4:"༤",5:"༥",6:"༦",7:"༧",8:"༨",9:"༩",0:"༠"},n={"༡":"1","༢":"2","༣":"3","༤":"4","༥":"5","༦":"6","༧":"7","༨":"8","༩":"9","༠":"0"};return e.defineLocale("bo",{months:"ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ".split("_"),monthsShort:"ཟླ་1_ཟླ་2_ཟླ་3_ཟླ་4_ཟླ་5_ཟླ་6_ཟླ་7_ཟླ་8_ཟླ་9_ཟླ་10_ཟླ་11_ཟླ་12".split("_"),monthsShortRegex:/^(ཟླ་\d{1,2})/,monthsParseExact:!0,weekdays:"གཟའ་ཉི་མ་_གཟའ་ཟླ་བ་_གཟའ་མིག་དམར་_གཟའ་ལྷག་པ་_གཟའ་ཕུར་བུ_གཟའ་པ་སངས་_གཟའ་སྤེན་པ་".split("_"),weekdaysShort:"ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་".split("_"),weekdaysMin:"ཉི_ཟླ_མིག_ལྷག_ཕུར_སངས_སྤེན".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},calendar:{sameDay:"[དི་རིང] LT",nextDay:"[སང་ཉིན] LT",nextWeek:"[བདུན་ཕྲག་རྗེས་མ], LT",lastDay:"[ཁ་སང] LT",lastWeek:"[བདུན་ཕྲག་མཐའ་མ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s ལ་",past:"%s སྔན་ལ",s:"ལམ་སང",ss:"%d སྐར་ཆ།",m:"སྐར་མ་གཅིག",mm:"%d སྐར་མ",h:"ཆུ་ཚོད་གཅིག",hh:"%d ཆུ་ཚོད",d:"ཉིན་གཅིག",dd:"%d ཉིན་",M:"ཟླ་བ་གཅིག",MM:"%d ཟླ་བ",y:"ལོ་གཅིག",yy:"%d ལོ"},preparse:function(e){return e.replace(/[༡༢༣༤༥༦༧༨༩༠]/g,function(e){return n[e]})},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]})},meridiemParse:/མཚན་མོ|ཞོགས་ཀས|ཉིན་གུང|དགོང་དག|མཚན་མོ/,meridiemHour:function(e,t){return(12===e&&(e=0),"མཚན་མོ"===t&&e>=4||"ཉིན་གུང"===t&&e<5||"དགོང་དག"===t)?e+12:e},meridiem:function(e,t,n){return e<4?"མཚན་མོ":e<10?"ཞོགས་ཀས":e<17?"ཉིན་གུང":e<20?"དགོང་དག":"མཚན་མོ"},week:{dow:0,doy:6}})})(n(30381))},1278:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration -function t(e,t,n){return e+" "+i({mm:"munutenn",MM:"miz",dd:"devezh"}[n],e)}function n(e){switch(r(e)){case 1:case 3:case 4:case 5:case 9:return e+" bloaz";default:return e+" vloaz"}}function r(e){return e>9?r(e%10):e}function i(e,t){return 2===t?a(e):e}function a(e){var t={m:"v",b:"v",d:"z"};return void 0===t[e.charAt(0)]?e:t[e.charAt(0)]+e.substring(1)}var o=[/^gen/i,/^c[ʼ\']hwe/i,/^meu/i,/^ebr/i,/^mae/i,/^(mez|eve)/i,/^gou/i,/^eos/i,/^gwe/i,/^her/i,/^du/i,/^ker/i,],s=/^(genver|c[ʼ\']hwevrer|meurzh|ebrel|mae|mezheven|gouere|eost|gwengolo|here|du|kerzu|gen|c[ʼ\']hwe|meu|ebr|mae|eve|gou|eos|gwe|her|du|ker)/i,u=/^(genver|c[ʼ\']hwevrer|meurzh|ebrel|mae|mezheven|gouere|eost|gwengolo|here|du|kerzu)/i,c=/^(gen|c[ʼ\']hwe|meu|ebr|mae|eve|gou|eos|gwe|her|du|ker)/i,l=[/^sul/i,/^lun/i,/^meurzh/i,/^merc[ʼ\']her/i,/^yaou/i,/^gwener/i,/^sadorn/i,],f=[/^Sul/i,/^Lun/i,/^Meu/i,/^Mer/i,/^Yao/i,/^Gwe/i,/^Sad/i,],d=[/^Su/i,/^Lu/i,/^Me([^r]|$)/i,/^Mer/i,/^Ya/i,/^Gw/i,/^Sa/i,];return e.defineLocale("br",{months:"Genver_Cʼhwevrer_Meurzh_Ebrel_Mae_Mezheven_Gouere_Eost_Gwengolo_Here_Du_Kerzu".split("_"),monthsShort:"Gen_Cʼhwe_Meu_Ebr_Mae_Eve_Gou_Eos_Gwe_Her_Du_Ker".split("_"),weekdays:"Sul_Lun_Meurzh_Mercʼher_Yaou_Gwener_Sadorn".split("_"),weekdaysShort:"Sul_Lun_Meu_Mer_Yao_Gwe_Sad".split("_"),weekdaysMin:"Su_Lu_Me_Mer_Ya_Gw_Sa".split("_"),weekdaysParse:d,fullWeekdaysParse:l,shortWeekdaysParse:f,minWeekdaysParse:d,monthsRegex:s,monthsShortRegex:s,monthsStrictRegex:u,monthsShortStrictRegex:c,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [a viz] MMMM YYYY",LLL:"D [a viz] MMMM YYYY HH:mm",LLLL:"dddd, D [a viz] MMMM YYYY HH:mm"},calendar:{sameDay:"[Hiziv da] LT",nextDay:"[Warcʼhoazh da] LT",nextWeek:"dddd [da] LT",lastDay:"[Decʼh da] LT",lastWeek:"dddd [paset da] LT",sameElse:"L"},relativeTime:{future:"a-benn %s",past:"%s ʼzo",s:"un nebeud segondenno\xf9",ss:"%d eilenn",m:"ur vunutenn",mm:t,h:"un eur",hh:"%d eur",d:"un devezh",dd:t,M:"ur miz",MM:t,y:"ur bloaz",yy:n},dayOfMonthOrdinalParse:/\d{1,2}(añ|vet)/,ordinal:function(e){var t=1===e?"a\xf1":"vet";return e+t},week:{dow:1,doy:4},meridiemParse:/a.m.|g.m./,isPM:function(e){return"g.m."===e},meridiem:function(e,t,n){return e<12?"a.m.":"g.m."}})})(n(30381))},80622:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration -function t(e,t,n){var r=e+" ";switch(n){case"ss":return 1===e?r+="sekunda":2===e||3===e||4===e?r+="sekunde":r+="sekundi",r;case"m":return t?"jedna minuta":"jedne minute";case"mm":return 1===e?r+="minuta":2===e||3===e||4===e?r+="minute":r+="minuta",r;case"h":return t?"jedan sat":"jednog sata";case"hh":return 1===e?r+="sat":2===e||3===e||4===e?r+="sata":r+="sati",r;case"dd":return 1===e?r+="dan":r+="dana",r;case"MM":return 1===e?r+="mjesec":2===e||3===e||4===e?r+="mjeseca":r+="mjeseci",r;case"yy":return 1===e?r+="godina":2===e||3===e||4===e?r+="godine":r+="godina",r}}return e.defineLocale("bs",{months:"januar_februar_mart_april_maj_juni_juli_august_septembar_oktobar_novembar_decembar".split("_"),monthsShort:"jan._feb._mar._apr._maj._jun._jul._aug._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[jučer u] LT",lastWeek:function(){switch(this.day()){case 0:case 3:return"[prošlu] dddd [u] LT";case 6:return"[prošle] [subote] [u] LT";case 1:case 2:case 4:case 5:return"[prošli] dddd [u] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"par sekundi",ss:t,m:t,mm:t,h:t,hh:t,d:"dan",dd:t,M:"mjesec",MM:t,y:"godinu",yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})})(n(30381))},2468:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("ca",{months:{standalone:"gener_febrer_mar\xe7_abril_maig_juny_juliol_agost_setembre_octubre_novembre_desembre".split("_"),format:"de gener_de febrer_de mar\xe7_d'abril_de maig_de juny_de juliol_d'agost_de setembre_d'octubre_de novembre_de desembre".split("_"),isFormat:/D[oD]?(\s)+MMMM/},monthsShort:"gen._febr._mar\xe7_abr._maig_juny_jul._ag._set._oct._nov._des.".split("_"),monthsParseExact:!0,weekdays:"diumenge_dilluns_dimarts_dimecres_dijous_divendres_dissabte".split("_"),weekdaysShort:"dg._dl._dt._dc._dj._dv._ds.".split("_"),weekdaysMin:"dg_dl_dt_dc_dj_dv_ds".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM [de] YYYY",ll:"D MMM YYYY",LLL:"D MMMM [de] YYYY [a les] H:mm",lll:"D MMM YYYY, H:mm",LLLL:"dddd D MMMM [de] YYYY [a les] H:mm",llll:"ddd D MMM YYYY, H:mm"},calendar:{sameDay:function(){return"[avui a "+(1!==this.hours()?"les":"la")+"] LT"},nextDay:function(){return"[dem\xe0 a "+(1!==this.hours()?"les":"la")+"] LT"},nextWeek:function(){return"dddd [a "+(1!==this.hours()?"les":"la")+"] LT"},lastDay:function(){return"[ahir a "+(1!==this.hours()?"les":"la")+"] LT"},lastWeek:function(){return"[el] dddd [passat a "+(1!==this.hours()?"les":"la")+"] LT"},sameElse:"L"},relativeTime:{future:"d'aqu\xed %s",past:"fa %s",s:"uns segons",ss:"%d segons",m:"un minut",mm:"%d minuts",h:"una hora",hh:"%d hores",d:"un dia",dd:"%d dies",M:"un mes",MM:"%d mesos",y:"un any",yy:"%d anys"},dayOfMonthOrdinalParse:/\d{1,2}(r|n|t|è|a)/,ordinal:function(e,t){var n=1===e?"r":2===e?"n":3===e?"r":4===e?"t":"\xe8";return("w"===t||"W"===t)&&(n="a"),e+n},week:{dow:1,doy:4}})})(n(30381))},5822:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration -var t="leden_\xfanor_březen_duben_květen_červen_červenec_srpen_z\xe1ř\xed_ř\xedjen_listopad_prosinec".split("_"),n="led_\xfano_bře_dub_kvě_čvn_čvc_srp_z\xe1ř_ř\xedj_lis_pro".split("_"),r=[/^led/i,/^úno/i,/^bře/i,/^dub/i,/^kvě/i,/^(čvn|červen$|června)/i,/^(čvc|červenec|července)/i,/^srp/i,/^zář/i,/^říj/i,/^lis/i,/^pro/i,],i=/^(leden|únor|březen|duben|květen|červenec|července|červen|června|srpen|září|říjen|listopad|prosinec|led|úno|bře|dub|kvě|čvn|čvc|srp|zář|říj|lis|pro)/i;function a(e){return e>1&&e<5&&1!=~~(e/10)}function o(e,t,n,r){var i=e+" ";switch(n){case"s":return t||r?"p\xe1r sekund":"p\xe1r sekundami";case"ss":if(t||r)return i+(a(e)?"sekundy":"sekund");return i+"sekundami";case"m":return t?"minuta":r?"minutu":"minutou";case"mm":if(t||r)return i+(a(e)?"minuty":"minut");return i+"minutami";case"h":return t?"hodina":r?"hodinu":"hodinou";case"hh":if(t||r)return i+(a(e)?"hodiny":"hodin");return i+"hodinami";case"d":return t||r?"den":"dnem";case"dd":if(t||r)return i+(a(e)?"dny":"dn\xed");return i+"dny";case"M":return t||r?"měs\xedc":"měs\xedcem";case"MM":if(t||r)return i+(a(e)?"měs\xedce":"měs\xedců");return i+"měs\xedci";case"y":return t||r?"rok":"rokem";case"yy":if(t||r)return i+(a(e)?"roky":"let");return i+"lety"}}return e.defineLocale("cs",{months:t,monthsShort:n,monthsRegex:i,monthsShortRegex:i,monthsStrictRegex:/^(leden|ledna|února|únor|březen|března|duben|dubna|květen|května|červenec|července|červen|června|srpen|srpna|září|říjen|října|listopadu|listopad|prosinec|prosince)/i,monthsShortStrictRegex:/^(led|úno|bře|dub|kvě|čvn|čvc|srp|zář|říj|lis|pro)/i,monthsParse:r,longMonthsParse:r,shortMonthsParse:r,weekdays:"neděle_ponděl\xed_\xfater\xfd_středa_čtvrtek_p\xe1tek_sobota".split("_"),weekdaysShort:"ne_po_\xfat_st_čt_p\xe1_so".split("_"),weekdaysMin:"ne_po_\xfat_st_čt_p\xe1_so".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd D. MMMM YYYY H:mm",l:"D. M. YYYY"},calendar:{sameDay:"[dnes v] LT",nextDay:"[z\xedtra v] LT",nextWeek:function(){switch(this.day()){case 0:return"[v neděli v] LT";case 1:case 2:return"[v] dddd [v] LT";case 3:return"[ve středu v] LT";case 4:return"[ve čtvrtek v] LT";case 5:return"[v p\xe1tek v] LT";case 6:return"[v sobotu v] LT"}},lastDay:"[včera v] LT",lastWeek:function(){switch(this.day()){case 0:return"[minulou neděli v] LT";case 1:case 2:return"[minul\xe9] dddd [v] LT";case 3:return"[minulou středu v] LT";case 4:case 5:return"[minul\xfd] dddd [v] LT";case 6:return"[minulou sobotu v] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"před %s",s:o,ss:o,m:o,mm:o,h:o,hh:o,d:o,dd:o,M:o,MM:o,y:o,yy:o},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})})(n(30381))},50877:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("cv",{months:"кӑрлач_нарӑс_пуш_ака_май_ҫӗртме_утӑ_ҫурла_авӑн_юпа_чӳк_раштав".split("_"),monthsShort:"кӑр_нар_пуш_ака_май_ҫӗр_утӑ_ҫур_авн_юпа_чӳк_раш".split("_"),weekdays:"вырсарникун_тунтикун_ытларикун_юнкун_кӗҫнерникун_эрнекун_шӑматкун".split("_"),weekdaysShort:"выр_тун_ытл_юн_кӗҫ_эрн_шӑм".split("_"),weekdaysMin:"вр_тн_ыт_юн_кҫ_эр_шм".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ]",LLL:"YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm",LLLL:"dddd, YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm"},calendar:{sameDay:"[Паян] LT [сехетре]",nextDay:"[Ыран] LT [сехетре]",lastDay:"[Ӗнер] LT [сехетре]",nextWeek:"[Ҫитес] dddd LT [сехетре]",lastWeek:"[Иртнӗ] dddd LT [сехетре]",sameElse:"L"},relativeTime:{future:function(e){var t=/сехет$/i.exec(e)?"рен":/ҫул$/i.exec(e)?"тан":"ран";return e+t},past:"%s каялла",s:"пӗр-ик ҫеккунт",ss:"%d ҫеккунт",m:"пӗр минут",mm:"%d минут",h:"пӗр сехет",hh:"%d сехет",d:"пӗр кун",dd:"%d кун",M:"пӗр уйӑх",MM:"%d уйӑх",y:"пӗр ҫул",yy:"%d ҫул"},dayOfMonthOrdinalParse:/\d{1,2}-мӗш/,ordinal:"%d-мӗш",week:{dow:1,doy:7}})})(n(30381))},47373:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("cy",{months:"Ionawr_Chwefror_Mawrth_Ebrill_Mai_Mehefin_Gorffennaf_Awst_Medi_Hydref_Tachwedd_Rhagfyr".split("_"),monthsShort:"Ion_Chwe_Maw_Ebr_Mai_Meh_Gor_Aws_Med_Hyd_Tach_Rhag".split("_"),weekdays:"Dydd Sul_Dydd Llun_Dydd Mawrth_Dydd Mercher_Dydd Iau_Dydd Gwener_Dydd Sadwrn".split("_"),weekdaysShort:"Sul_Llun_Maw_Mer_Iau_Gwe_Sad".split("_"),weekdaysMin:"Su_Ll_Ma_Me_Ia_Gw_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Heddiw am] LT",nextDay:"[Yfory am] LT",nextWeek:"dddd [am] LT",lastDay:"[Ddoe am] LT",lastWeek:"dddd [diwethaf am] LT",sameElse:"L"},relativeTime:{future:"mewn %s",past:"%s yn \xf4l",s:"ychydig eiliadau",ss:"%d eiliad",m:"munud",mm:"%d munud",h:"awr",hh:"%d awr",d:"diwrnod",dd:"%d diwrnod",M:"mis",MM:"%d mis",y:"blwyddyn",yy:"%d flynedd"},dayOfMonthOrdinalParse:/\d{1,2}(fed|ain|af|il|ydd|ed|eg)/,ordinal:function(e){var t=e,n="",r=["","af","il","ydd","ydd","ed","ed","ed","fed","fed","fed","eg","fed","eg","eg","fed","eg","eg","fed","eg","fed"];return t>20?n=40===t||50===t||60===t||80===t||100===t?"fed":"ain":t>0&&(n=r[t]),e+n},week:{dow:1,doy:4}})})(n(30381))},24780:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("da",{months:"januar_februar_marts_april_maj_juni_juli_august_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"),weekdays:"s\xf8ndag_mandag_tirsdag_onsdag_torsdag_fredag_l\xf8rdag".split("_"),weekdaysShort:"s\xf8n_man_tir_ons_tor_fre_l\xf8r".split("_"),weekdaysMin:"s\xf8_ma_ti_on_to_fr_l\xf8".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd [d.] D. MMMM YYYY [kl.] HH:mm"},calendar:{sameDay:"[i dag kl.] LT",nextDay:"[i morgen kl.] LT",nextWeek:"p\xe5 dddd [kl.] LT",lastDay:"[i g\xe5r kl.] LT",lastWeek:"[i] dddd[s kl.] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"%s siden",s:"f\xe5 sekunder",ss:"%d sekunder",m:"et minut",mm:"%d minutter",h:"en time",hh:"%d timer",d:"en dag",dd:"%d dage",M:"en m\xe5ned",MM:"%d m\xe5neder",y:"et \xe5r",yy:"%d \xe5r"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})})(n(30381))},60217:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration -function t(e,t,n,r){var i={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[e+" Tage",e+" Tagen"],w:["eine Woche","einer Woche"],M:["ein Monat","einem Monat"],MM:[e+" Monate",e+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[e+" Jahre",e+" Jahren"]};return t?i[n][0]:i[n][1]}return e.defineLocale("de-at",{months:"J\xe4nner_Februar_M\xe4rz_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"J\xe4n._Feb._M\xe4rz_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[heute um] LT [Uhr]",sameElse:"L",nextDay:"[morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",ss:"%d Sekunden",m:t,mm:"%d Minuten",h:t,hh:"%d Stunden",d:t,dd:t,w:t,ww:"%d Wochen",M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})})(n(30381))},60894:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration -function t(e,t,n,r){var i={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[e+" Tage",e+" Tagen"],w:["eine Woche","einer Woche"],M:["ein Monat","einem Monat"],MM:[e+" Monate",e+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[e+" Jahre",e+" Jahren"]};return t?i[n][0]:i[n][1]}return e.defineLocale("de-ch",{months:"Januar_Februar_M\xe4rz_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Feb._M\xe4rz_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[heute um] LT [Uhr]",sameElse:"L",nextDay:"[morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",ss:"%d Sekunden",m:t,mm:"%d Minuten",h:t,hh:"%d Stunden",d:t,dd:t,w:t,ww:"%d Wochen",M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})})(n(30381))},59740:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration -function t(e,t,n,r){var i={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[e+" Tage",e+" Tagen"],w:["eine Woche","einer Woche"],M:["ein Monat","einem Monat"],MM:[e+" Monate",e+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[e+" Jahre",e+" Jahren"]};return t?i[n][0]:i[n][1]}return e.defineLocale("de",{months:"Januar_Februar_M\xe4rz_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Feb._M\xe4rz_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[heute um] LT [Uhr]",sameElse:"L",nextDay:"[morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",ss:"%d Sekunden",m:t,mm:"%d Minuten",h:t,hh:"%d Stunden",d:t,dd:t,w:t,ww:"%d Wochen",M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})})(n(30381))},5300:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration -var t=["ޖެނުއަރީ","ފެބްރުއަރީ","މާރިޗު","އޭޕްރީލު","މޭ","ޖޫން","ޖުލައި","އޯގަސްޓު","ސެޕްޓެމްބަރު","އޮކްޓޯބަރު","ނޮވެމްބަރު","ޑިސެމްބަރު",],n=["އާދިއްތަ","ހޯމަ","އަންގާރަ","ބުދަ","ބުރާސްފަތި","ހުކުރު","ހޮނިހިރު",];return e.defineLocale("dv",{months:t,monthsShort:t,weekdays:n,weekdaysShort:n,weekdaysMin:"އާދި_ހޯމަ_އަން_ބުދަ_ބުރާ_ހުކު_ހޮނި".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/M/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/މކ|މފ/,isPM:function(e){return"މފ"===e},meridiem:function(e,t,n){return e<12?"މކ":"މފ"},calendar:{sameDay:"[މިއަދު] LT",nextDay:"[މާދަމާ] LT",nextWeek:"dddd LT",lastDay:"[އިއްޔެ] LT",lastWeek:"[ފާއިތުވި] dddd LT",sameElse:"L"},relativeTime:{future:"ތެރޭގައި %s",past:"ކުރިން %s",s:"ސިކުންތުކޮޅެއް",ss:"d% ސިކުންތު",m:"މިނިޓެއް",mm:"މިނިޓު %d",h:"ގަޑިއިރެއް",hh:"ގަޑިއިރު %d",d:"ދުވަހެއް",dd:"ދުވަސް %d",M:"މަހެއް",MM:"މަސް %d",y:"އަހަރެއް",yy:"އަހަރު %d"},preparse:function(e){return e.replace(/،/g,",")},postformat:function(e){return e.replace(/,/g,"،")},week:{dow:7,doy:12}})})(n(30381))},50837:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration -function t(e){return"undefined"!=typeof Function&&e instanceof Function||"[object Function]"===Object.prototype.toString.call(e)}return e.defineLocale("el",{monthsNominativeEl:"Ιανουάριος_Φεβρουάριος_Μάρτιος_Απρίλιος_Μάιος_Ιούνιος_Ιούλιος_Αύγουστος_Σεπτέμβριος_Οκτώβριος_Νοέμβριος_Δεκέμβριος".split("_"),monthsGenitiveEl:"Ιανουαρίου_Φεβρουαρίου_Μαρτίου_Απριλίου_Μαΐου_Ιουνίου_Ιουλίου_Αυγούστου_Σεπτεμβρίου_Οκτωβρίου_Νοεμβρίου_Δεκεμβρίου".split("_"),months:function(e,t){return e?"string"==typeof t&&/D/.test(t.substring(0,t.indexOf("MMMM")))?this._monthsGenitiveEl[e.month()]:this._monthsNominativeEl[e.month()]:this._monthsNominativeEl},monthsShort:"Ιαν_Φεβ_Μαρ_Απρ_Μαϊ_Ιουν_Ιουλ_Αυγ_Σεπ_Οκτ_Νοε_Δεκ".split("_"),weekdays:"Κυριακή_Δευτέρα_Τρίτη_Τετάρτη_Πέμπτη_Παρασκευή_Σάββατο".split("_"),weekdaysShort:"Κυρ_Δευ_Τρι_Τετ_Πεμ_Παρ_Σαβ".split("_"),weekdaysMin:"Κυ_Δε_Τρ_Τε_Πε_Πα_Σα".split("_"),meridiem:function(e,t,n){return e>11?n?"μμ":"ΜΜ":n?"πμ":"ΠΜ"},isPM:function(e){return"μ"===(e+"").toLowerCase()[0]},meridiemParse:/[ΠΜ]\.?Μ?\.?/i,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendarEl:{sameDay:"[Σήμερα {}] LT",nextDay:"[Αύριο {}] LT",nextWeek:"dddd [{}] LT",lastDay:"[Χθες {}] LT",lastWeek:function(){return 6===this.day()?"[το προηγούμενο] dddd [{}] LT":"[την προηγούμενη] dddd [{}] LT"},sameElse:"L"},calendar:function(e,n){var r=this._calendarEl[e],i=n&&n.hours();return t(r)&&(r=r.apply(n)),r.replace("{}",i%12==1?"στη":"στις")},relativeTime:{future:"σε %s",past:"%s πριν",s:"λίγα δευτερόλεπτα",ss:"%d δευτερόλεπτα",m:"ένα λεπτό",mm:"%d λεπτά",h:"μία ώρα",hh:"%d ώρες",d:"μία μέρα",dd:"%d μέρες",M:"ένας μήνας",MM:"%d μήνες",y:"ένας χρόνος",yy:"%d χρόνια"},dayOfMonthOrdinalParse:/\d{1,2}η/,ordinal:"%dη",week:{dow:1,doy:4}})})(n(30381))},78348:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("en-au",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10,n=1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th";return e+n},week:{dow:0,doy:4}})})(n(30381))},77925:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("en-ca",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"YYYY-MM-DD",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10,n=1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th";return e+n}})})(n(30381))},22243:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("en-gb",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10,n=1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th";return e+n},week:{dow:1,doy:4}})})(n(30381))},46436:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("en-ie",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10,n=1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th";return e+n},week:{dow:1,doy:4}})})(n(30381))},47207:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("en-il",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10,n=1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th";return e+n}})})(n(30381))},44175:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("en-in",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10,n=1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th";return e+n},week:{dow:0,doy:6}})})(n(30381))},76319:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("en-nz",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10,n=1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th";return e+n},week:{dow:1,doy:4}})})(n(30381))},31662:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("en-sg",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10,n=1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th";return e+n},week:{dow:1,doy:4}})})(n(30381))},92915:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("eo",{months:"januaro_februaro_marto_aprilo_majo_junio_julio_aŭgusto_septembro_oktobro_novembro_decembro".split("_"),monthsShort:"jan_feb_mart_apr_maj_jun_jul_aŭg_sept_okt_nov_dec".split("_"),weekdays:"dimanĉo_lundo_mardo_merkredo_ĵaŭdo_vendredo_sabato".split("_"),weekdaysShort:"dim_lun_mard_merk_ĵaŭ_ven_sab".split("_"),weekdaysMin:"di_lu_ma_me_ĵa_ve_sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"[la] D[-an de] MMMM, YYYY",LLL:"[la] D[-an de] MMMM, YYYY HH:mm",LLLL:"dddd[n], [la] D[-an de] MMMM, YYYY HH:mm",llll:"ddd, [la] D[-an de] MMM, YYYY HH:mm"},meridiemParse:/[ap]\.t\.m/i,isPM:function(e){return"p"===e.charAt(0).toLowerCase()},meridiem:function(e,t,n){return e>11?n?"p.t.m.":"P.T.M.":n?"a.t.m.":"A.T.M."},calendar:{sameDay:"[Hodiaŭ je] LT",nextDay:"[Morgaŭ je] LT",nextWeek:"dddd[n je] LT",lastDay:"[Hieraŭ je] LT",lastWeek:"[pasintan] dddd[n je] LT",sameElse:"L"},relativeTime:{future:"post %s",past:"antaŭ %s",s:"kelkaj sekundoj",ss:"%d sekundoj",m:"unu minuto",mm:"%d minutoj",h:"unu horo",hh:"%d horoj",d:"unu tago",dd:"%d tagoj",M:"unu monato",MM:"%d monatoj",y:"unu jaro",yy:"%d jaroj"},dayOfMonthOrdinalParse:/\d{1,2}a/,ordinal:"%da",week:{dow:1,doy:7}})})(n(30381))},55251:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration -var t="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),n="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),r=[/^ene/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i,],i=/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;return e.defineLocale("es-do",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(e,r){return e?/-MMM-/.test(r)?n[e.month()]:t[e.month()]:t},monthsRegex:i,monthsShortRegex:i,monthsStrictRegex:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,monthsShortStrictRegex:/^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,monthsParse:r,longMonthsParse:r,shortMonthsParse:r,weekdays:"domingo_lunes_martes_mi\xe9rcoles_jueves_viernes_s\xe1bado".split("_"),weekdaysShort:"dom._lun._mar._mi\xe9._jue._vie._s\xe1b.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_s\xe1".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY h:mm A",LLLL:"dddd, D [de] MMMM [de] YYYY h:mm A"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[ma\xf1ana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un d\xeda",dd:"%d d\xedas",w:"una semana",ww:"%d semanas",M:"un mes",MM:"%d meses",y:"un a\xf1o",yy:"%d a\xf1os"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%d\xba",week:{dow:1,doy:4}})})(n(30381))},96112:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration -var t="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),n="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),r=[/^ene/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i,],i=/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;return e.defineLocale("es-mx",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(e,r){return e?/-MMM-/.test(r)?n[e.month()]:t[e.month()]:t},monthsRegex:i,monthsShortRegex:i,monthsStrictRegex:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,monthsShortStrictRegex:/^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,monthsParse:r,longMonthsParse:r,shortMonthsParse:r,weekdays:"domingo_lunes_martes_mi\xe9rcoles_jueves_viernes_s\xe1bado".split("_"),weekdaysShort:"dom._lun._mar._mi\xe9._jue._vie._s\xe1b.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_s\xe1".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[ma\xf1ana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un d\xeda",dd:"%d d\xedas",w:"una semana",ww:"%d semanas",M:"un mes",MM:"%d meses",y:"un a\xf1o",yy:"%d a\xf1os"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%d\xba",week:{dow:0,doy:4},invalidDate:"Fecha inv\xe1lida"})})(n(30381))},71146:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration -var t="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),n="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),r=[/^ene/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i,],i=/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;return e.defineLocale("es-us",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(e,r){return e?/-MMM-/.test(r)?n[e.month()]:t[e.month()]:t},monthsRegex:i,monthsShortRegex:i,monthsStrictRegex:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,monthsShortStrictRegex:/^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,monthsParse:r,longMonthsParse:r,shortMonthsParse:r,weekdays:"domingo_lunes_martes_mi\xe9rcoles_jueves_viernes_s\xe1bado".split("_"),weekdaysShort:"dom._lun._mar._mi\xe9._jue._vie._s\xe1b.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_s\xe1".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"MM/DD/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY h:mm A",LLLL:"dddd, D [de] MMMM [de] YYYY h:mm A"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[ma\xf1ana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un d\xeda",dd:"%d d\xedas",w:"una semana",ww:"%d semanas",M:"un mes",MM:"%d meses",y:"un a\xf1o",yy:"%d a\xf1os"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%d\xba",week:{dow:0,doy:6}})})(n(30381))},55655:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration -var t="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),n="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),r=[/^ene/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i,],i=/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;return e.defineLocale("es",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(e,r){return e?/-MMM-/.test(r)?n[e.month()]:t[e.month()]:t},monthsRegex:i,monthsShortRegex:i,monthsStrictRegex:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,monthsShortStrictRegex:/^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,monthsParse:r,longMonthsParse:r,shortMonthsParse:r,weekdays:"domingo_lunes_martes_mi\xe9rcoles_jueves_viernes_s\xe1bado".split("_"),weekdaysShort:"dom._lun._mar._mi\xe9._jue._vie._s\xe1b.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_s\xe1".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[ma\xf1ana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un d\xeda",dd:"%d d\xedas",w:"una semana",ww:"%d semanas",M:"un mes",MM:"%d meses",y:"un a\xf1o",yy:"%d a\xf1os"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%d\xba",week:{dow:1,doy:4},invalidDate:"Fecha inv\xe1lida"})})(n(30381))},5603:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration -function t(e,t,n,r){var i={s:["m\xf5ne sekundi","m\xf5ni sekund","paar sekundit"],ss:[e+"sekundi",e+"sekundit"],m:["\xfche minuti","\xfcks minut"],mm:[e+" minuti",e+" minutit"],h:["\xfche tunni","tund aega","\xfcks tund"],hh:[e+" tunni",e+" tundi"],d:["\xfche p\xe4eva","\xfcks p\xe4ev"],M:["kuu aja","kuu aega","\xfcks kuu"],MM:[e+" kuu",e+" kuud"],y:["\xfche aasta","aasta","\xfcks aasta"],yy:[e+" aasta",e+" aastat"]};return t?i[n][2]?i[n][2]:i[n][1]:r?i[n][0]:i[n][1]}return e.defineLocale("et",{months:"jaanuar_veebruar_m\xe4rts_aprill_mai_juuni_juuli_august_september_oktoober_november_detsember".split("_"),monthsShort:"jaan_veebr_m\xe4rts_apr_mai_juuni_juuli_aug_sept_okt_nov_dets".split("_"),weekdays:"p\xfchap\xe4ev_esmasp\xe4ev_teisip\xe4ev_kolmap\xe4ev_neljap\xe4ev_reede_laup\xe4ev".split("_"),weekdaysShort:"P_E_T_K_N_R_L".split("_"),weekdaysMin:"P_E_T_K_N_R_L".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[T\xe4na,] LT",nextDay:"[Homme,] LT",nextWeek:"[J\xe4rgmine] dddd LT",lastDay:"[Eile,] LT",lastWeek:"[Eelmine] dddd LT",sameElse:"L"},relativeTime:{future:"%s p\xe4rast",past:"%s tagasi",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:"%d p\xe4eva",M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})})(n(30381))},77763:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("eu",{months:"urtarrila_otsaila_martxoa_apirila_maiatza_ekaina_uztaila_abuztua_iraila_urria_azaroa_abendua".split("_"),monthsShort:"urt._ots._mar._api._mai._eka._uzt._abu._ira._urr._aza._abe.".split("_"),monthsParseExact:!0,weekdays:"igandea_astelehena_asteartea_asteazkena_osteguna_ostirala_larunbata".split("_"),weekdaysShort:"ig._al._ar._az._og._ol._lr.".split("_"),weekdaysMin:"ig_al_ar_az_og_ol_lr".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY[ko] MMMM[ren] D[a]",LLL:"YYYY[ko] MMMM[ren] D[a] HH:mm",LLLL:"dddd, YYYY[ko] MMMM[ren] D[a] HH:mm",l:"YYYY-M-D",ll:"YYYY[ko] MMM D[a]",lll:"YYYY[ko] MMM D[a] HH:mm",llll:"ddd, YYYY[ko] MMM D[a] HH:mm"},calendar:{sameDay:"[gaur] LT[etan]",nextDay:"[bihar] LT[etan]",nextWeek:"dddd LT[etan]",lastDay:"[atzo] LT[etan]",lastWeek:"[aurreko] dddd LT[etan]",sameElse:"L"},relativeTime:{future:"%s barru",past:"duela %s",s:"segundo batzuk",ss:"%d segundo",m:"minutu bat",mm:"%d minutu",h:"ordu bat",hh:"%d ordu",d:"egun bat",dd:"%d egun",M:"hilabete bat",MM:"%d hilabete",y:"urte bat",yy:"%d urte"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})})(n(30381))},76959:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration -var t={1:"۱",2:"۲",3:"۳",4:"۴",5:"۵",6:"۶",7:"۷",8:"۸",9:"۹",0:"۰"},n={"۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9","۰":"0"};return e.defineLocale("fa",{months:"ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"),monthsShort:"ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"),weekdays:"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_جمعه_شنبه".split("_"),weekdaysShort:"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_جمعه_شنبه".split("_"),weekdaysMin:"ی_د_س_چ_پ_ج_ش".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},meridiemParse:/قبل از ظهر|بعد از ظهر/,isPM:function(e){return/بعد از ظهر/.test(e)},meridiem:function(e,t,n){return e<12?"قبل از ظهر":"بعد از ظهر"},calendar:{sameDay:"[امروز ساعت] LT",nextDay:"[فردا ساعت] LT",nextWeek:"dddd [ساعت] LT",lastDay:"[دیروز ساعت] LT",lastWeek:"dddd [پیش] [ساعت] LT",sameElse:"L"},relativeTime:{future:"در %s",past:"%s پیش",s:"چند ثانیه",ss:"%d ثانیه",m:"یک دقیقه",mm:"%d دقیقه",h:"یک ساعت",hh:"%d ساعت",d:"یک روز",dd:"%d روز",M:"یک ماه",MM:"%d ماه",y:"یک سال",yy:"%d سال"},preparse:function(e){return e.replace(/[۰-۹]/g,function(e){return n[e]}).replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]}).replace(/,/g,"،")},dayOfMonthOrdinalParse:/\d{1,2}م/,ordinal:"%dم",week:{dow:6,doy:12}})})(n(30381))},11897:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration -var t="nolla yksi kaksi kolme nelj\xe4 viisi kuusi seitsem\xe4n kahdeksan yhdeks\xe4n".split(" "),n=["nolla","yhden","kahden","kolmen","nelj\xe4n","viiden","kuuden",t[7],t[8],t[9],];function r(e,t,n,r){var a="";switch(n){case"s":return r?"muutaman sekunnin":"muutama sekunti";case"ss":a=r?"sekunnin":"sekuntia";break;case"m":return r?"minuutin":"minuutti";case"mm":a=r?"minuutin":"minuuttia";break;case"h":return r?"tunnin":"tunti";case"hh":a=r?"tunnin":"tuntia";break;case"d":return r?"p\xe4iv\xe4n":"p\xe4iv\xe4";case"dd":a=r?"p\xe4iv\xe4n":"p\xe4iv\xe4\xe4";break;case"M":return r?"kuukauden":"kuukausi";case"MM":a=r?"kuukauden":"kuukautta";break;case"y":return r?"vuoden":"vuosi";case"yy":a=r?"vuoden":"vuotta"}return i(e,r)+" "+a}function i(e,r){return e<10?r?n[e]:t[e]:e}return e.defineLocale("fi",{months:"tammikuu_helmikuu_maaliskuu_huhtikuu_toukokuu_kes\xe4kuu_hein\xe4kuu_elokuu_syyskuu_lokakuu_marraskuu_joulukuu".split("_"),monthsShort:"tammi_helmi_maalis_huhti_touko_kes\xe4_hein\xe4_elo_syys_loka_marras_joulu".split("_"),weekdays:"sunnuntai_maanantai_tiistai_keskiviikko_torstai_perjantai_lauantai".split("_"),weekdaysShort:"su_ma_ti_ke_to_pe_la".split("_"),weekdaysMin:"su_ma_ti_ke_to_pe_la".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD.MM.YYYY",LL:"Do MMMM[ta] YYYY",LLL:"Do MMMM[ta] YYYY, [klo] HH.mm",LLLL:"dddd, Do MMMM[ta] YYYY, [klo] HH.mm",l:"D.M.YYYY",ll:"Do MMM YYYY",lll:"Do MMM YYYY, [klo] HH.mm",llll:"ddd, Do MMM YYYY, [klo] HH.mm"},calendar:{sameDay:"[t\xe4n\xe4\xe4n] [klo] LT",nextDay:"[huomenna] [klo] LT",nextWeek:"dddd [klo] LT",lastDay:"[eilen] [klo] LT",lastWeek:"[viime] dddd[na] [klo] LT",sameElse:"L"},relativeTime:{future:"%s p\xe4\xe4st\xe4",past:"%s sitten",s:r,ss:r,m:r,mm:r,h:r,hh:r,d:r,dd:r,M:r,MM:r,y:r,yy:r},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})})(n(30381))},42549:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("fil",{months:"Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre".split("_"),monthsShort:"Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis".split("_"),weekdays:"Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado".split("_"),weekdaysShort:"Lin_Lun_Mar_Miy_Huw_Biy_Sab".split("_"),weekdaysMin:"Li_Lu_Ma_Mi_Hu_Bi_Sab".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"MM/D/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY HH:mm",LLLL:"dddd, MMMM DD, YYYY HH:mm"},calendar:{sameDay:"LT [ngayong araw]",nextDay:"[Bukas ng] LT",nextWeek:"LT [sa susunod na] dddd",lastDay:"LT [kahapon]",lastWeek:"LT [noong nakaraang] dddd",sameElse:"L"},relativeTime:{future:"sa loob ng %s",past:"%s ang nakalipas",s:"ilang segundo",ss:"%d segundo",m:"isang minuto",mm:"%d minuto",h:"isang oras",hh:"%d oras",d:"isang araw",dd:"%d araw",M:"isang buwan",MM:"%d buwan",y:"isang taon",yy:"%d taon"},dayOfMonthOrdinalParse:/\d{1,2}/,ordinal:function(e){return e},week:{dow:1,doy:4}})})(n(30381))},94694:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("fo",{months:"januar_februar_mars_apr\xedl_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_"),weekdays:"sunnudagur_m\xe1nadagur_t\xfdsdagur_mikudagur_h\xf3sdagur_fr\xedggjadagur_leygardagur".split("_"),weekdaysShort:"sun_m\xe1n_t\xfds_mik_h\xf3s_fr\xed_ley".split("_"),weekdaysMin:"su_m\xe1_t\xfd_mi_h\xf3_fr_le".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D. MMMM, YYYY HH:mm"},calendar:{sameDay:"[\xcd dag kl.] LT",nextDay:"[\xcd morgin kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[\xcd gj\xe1r kl.] LT",lastWeek:"[s\xed\xf0stu] dddd [kl] LT",sameElse:"L"},relativeTime:{future:"um %s",past:"%s s\xed\xf0ani",s:"f\xe1 sekund",ss:"%d sekundir",m:"ein minuttur",mm:"%d minuttir",h:"ein t\xedmi",hh:"%d t\xedmar",d:"ein dagur",dd:"%d dagar",M:"ein m\xe1na\xf0ur",MM:"%d m\xe1na\xf0ir",y:"eitt \xe1r",yy:"%d \xe1r"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})})(n(30381))},63049:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("fr-ca",{months:"janvier_f\xe9vrier_mars_avril_mai_juin_juillet_ao\xfbt_septembre_octobre_novembre_d\xe9cembre".split("_"),monthsShort:"janv._f\xe9vr._mars_avr._mai_juin_juil._ao\xfbt_sept._oct._nov._d\xe9c.".split("_"),monthsParseExact:!0,weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourd’hui \xe0] LT",nextDay:"[Demain \xe0] LT",nextWeek:"dddd [\xe0] LT",lastDay:"[Hier \xe0] LT",lastWeek:"dddd [dernier \xe0] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",ss:"%d secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},dayOfMonthOrdinalParse:/\d{1,2}(er|e)/,ordinal:function(e,t){switch(t){default:case"M":case"Q":case"D":case"DDD":case"d":return e+(1===e?"er":"e");case"w":case"W":return e+(1===e?"re":"e")}}})})(n(30381))},52330:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("fr-ch",{months:"janvier_f\xe9vrier_mars_avril_mai_juin_juillet_ao\xfbt_septembre_octobre_novembre_d\xe9cembre".split("_"),monthsShort:"janv._f\xe9vr._mars_avr._mai_juin_juil._ao\xfbt_sept._oct._nov._d\xe9c.".split("_"),monthsParseExact:!0,weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourd’hui \xe0] LT",nextDay:"[Demain \xe0] LT",nextWeek:"dddd [\xe0] LT",lastDay:"[Hier \xe0] LT",lastWeek:"dddd [dernier \xe0] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",ss:"%d secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},dayOfMonthOrdinalParse:/\d{1,2}(er|e)/,ordinal:function(e,t){switch(t){default:case"M":case"Q":case"D":case"DDD":case"d":return e+(1===e?"er":"e");case"w":case"W":return e+(1===e?"re":"e")}},week:{dow:1,doy:4}})})(n(30381))},94470:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration -var t=/^(janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i,n=/(janv\.?|févr\.?|mars|avr\.?|mai|juin|juil\.?|août|sept\.?|oct\.?|nov\.?|déc\.?)/i,r=/(janv\.?|févr\.?|mars|avr\.?|mai|juin|juil\.?|août|sept\.?|oct\.?|nov\.?|déc\.?|janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i,i=[/^janv/i,/^févr/i,/^mars/i,/^avr/i,/^mai/i,/^juin/i,/^juil/i,/^août/i,/^sept/i,/^oct/i,/^nov/i,/^déc/i,];return e.defineLocale("fr",{months:"janvier_f\xe9vrier_mars_avril_mai_juin_juillet_ao\xfbt_septembre_octobre_novembre_d\xe9cembre".split("_"),monthsShort:"janv._f\xe9vr._mars_avr._mai_juin_juil._ao\xfbt_sept._oct._nov._d\xe9c.".split("_"),monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:t,monthsShortStrictRegex:n,monthsParse:i,longMonthsParse:i,shortMonthsParse:i,weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourd’hui \xe0] LT",nextDay:"[Demain \xe0] LT",nextWeek:"dddd [\xe0] LT",lastDay:"[Hier \xe0] LT",lastWeek:"dddd [dernier \xe0] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",ss:"%d secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",w:"une semaine",ww:"%d semaines",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},dayOfMonthOrdinalParse:/\d{1,2}(er|)/,ordinal:function(e,t){switch(t){case"D":return e+(1===e?"er":"");default:case"M":case"Q":case"DDD":case"d":return e+(1===e?"er":"e");case"w":case"W":return e+(1===e?"re":"e")}},week:{dow:1,doy:4}})})(n(30381))},5044:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration -var t="jan._feb._mrt._apr._mai_jun._jul._aug._sep._okt._nov._des.".split("_"),n="jan_feb_mrt_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_");return e.defineLocale("fy",{months:"jannewaris_febrewaris_maart_april_maaie_juny_july_augustus_septimber_oktober_novimber_desimber".split("_"),monthsShort:function(e,r){return e?/-MMM-/.test(r)?n[e.month()]:t[e.month()]:t},monthsParseExact:!0,weekdays:"snein_moandei_tiisdei_woansdei_tongersdei_freed_sneon".split("_"),weekdaysShort:"si._mo._ti._wo._to._fr._so.".split("_"),weekdaysMin:"Si_Mo_Ti_Wo_To_Fr_So".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[hjoed om] LT",nextDay:"[moarn om] LT",nextWeek:"dddd [om] LT",lastDay:"[juster om] LT",lastWeek:"[\xf4fr\xfbne] dddd [om] LT",sameElse:"L"},relativeTime:{future:"oer %s",past:"%s lyn",s:"in pear sekonden",ss:"%d sekonden",m:"ien min\xfat",mm:"%d minuten",h:"ien oere",hh:"%d oeren",d:"ien dei",dd:"%d dagen",M:"ien moanne",MM:"%d moannen",y:"ien jier",yy:"%d jierren"},dayOfMonthOrdinalParse:/\d{1,2}(ste|de)/,ordinal:function(e){return e+(1===e||8===e||e>=20?"ste":"de")},week:{dow:1,doy:4}})})(n(30381))},29295:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration -var t=["Ean\xe1ir","Feabhra","M\xe1rta","Aibre\xe1n","Bealtaine","Meitheamh","I\xfail","L\xfanasa","Me\xe1n F\xf3mhair","Deireadh F\xf3mhair","Samhain","Nollaig",],n=["Ean","Feabh","M\xe1rt","Aib","Beal","Meith","I\xfail","L\xfan","M.F.","D.F.","Samh","Noll",],r=["D\xe9 Domhnaigh","D\xe9 Luain","D\xe9 M\xe1irt","D\xe9 C\xe9adaoin","D\xe9ardaoin","D\xe9 hAoine","D\xe9 Sathairn",],i=["Domh","Luan","M\xe1irt","C\xe9ad","D\xe9ar","Aoine","Sath"],a=["Do","Lu","M\xe1","C\xe9","D\xe9","A","Sa"];return e.defineLocale("ga",{months:t,monthsShort:n,monthsParseExact:!0,weekdays:r,weekdaysShort:i,weekdaysMin:a,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Inniu ag] LT",nextDay:"[Am\xe1rach ag] LT",nextWeek:"dddd [ag] LT",lastDay:"[Inn\xe9 ag] LT",lastWeek:"dddd [seo caite] [ag] LT",sameElse:"L"},relativeTime:{future:"i %s",past:"%s \xf3 shin",s:"c\xfapla soicind",ss:"%d soicind",m:"n\xf3im\xe9ad",mm:"%d n\xf3im\xe9ad",h:"uair an chloig",hh:"%d uair an chloig",d:"l\xe1",dd:"%d l\xe1",M:"m\xed",MM:"%d m\xedonna",y:"bliain",yy:"%d bliain"},dayOfMonthOrdinalParse:/\d{1,2}(d|na|mh)/,ordinal:function(e){var t=1===e?"d":e%10==2?"na":"mh";return e+t},week:{dow:1,doy:4}})})(n(30381))},2101:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration -var t=["Am Faoilleach","An Gearran","Am M\xe0rt","An Giblean","An C\xe8itean","An t-\xd2gmhios","An t-Iuchar","An L\xf9nastal","An t-Sultain","An D\xe0mhair","An t-Samhain","An D\xf9bhlachd",],n=["Faoi","Gear","M\xe0rt","Gibl","C\xe8it","\xd2gmh","Iuch","L\xf9n","Sult","D\xe0mh","Samh","D\xf9bh",],r=["Did\xf2mhnaich","Diluain","Dim\xe0irt","Diciadain","Diardaoin","Dihaoine","Disathairne",],i=["Did","Dil","Dim","Dic","Dia","Dih","Dis"],a=["D\xf2","Lu","M\xe0","Ci","Ar","Ha","Sa"];return e.defineLocale("gd",{months:t,monthsShort:n,monthsParseExact:!0,weekdays:r,weekdaysShort:i,weekdaysMin:a,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[An-diugh aig] LT",nextDay:"[A-m\xe0ireach aig] LT",nextWeek:"dddd [aig] LT",lastDay:"[An-d\xe8 aig] LT",lastWeek:"dddd [seo chaidh] [aig] LT",sameElse:"L"},relativeTime:{future:"ann an %s",past:"bho chionn %s",s:"beagan diogan",ss:"%d diogan",m:"mionaid",mm:"%d mionaidean",h:"uair",hh:"%d uairean",d:"latha",dd:"%d latha",M:"m\xecos",MM:"%d m\xecosan",y:"bliadhna",yy:"%d bliadhna"},dayOfMonthOrdinalParse:/\d{1,2}(d|na|mh)/,ordinal:function(e){var t=1===e?"d":e%10==2?"na":"mh";return e+t},week:{dow:1,doy:4}})})(n(30381))},38794:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("gl",{months:"xaneiro_febreiro_marzo_abril_maio_xu\xf1o_xullo_agosto_setembro_outubro_novembro_decembro".split("_"),monthsShort:"xan._feb._mar._abr._mai._xu\xf1._xul._ago._set._out._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"domingo_luns_martes_m\xe9rcores_xoves_venres_s\xe1bado".split("_"),weekdaysShort:"dom._lun._mar._m\xe9r._xov._ven._s\xe1b.".split("_"),weekdaysMin:"do_lu_ma_m\xe9_xo_ve_s\xe1".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},calendar:{sameDay:function(){return"[hoxe "+(1!==this.hours()?"\xe1s":"\xe1")+"] LT"},nextDay:function(){return"[ma\xf1\xe1 "+(1!==this.hours()?"\xe1s":"\xe1")+"] LT"},nextWeek:function(){return"dddd ["+(1!==this.hours()?"\xe1s":"a")+"] LT"},lastDay:function(){return"[onte "+(1!==this.hours()?"\xe1":"a")+"] LT"},lastWeek:function(){return"[o] dddd [pasado "+(1!==this.hours()?"\xe1s":"a")+"] LT"},sameElse:"L"},relativeTime:{future:function(e){return 0===e.indexOf("un")?"n"+e:"en "+e},past:"hai %s",s:"uns segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"unha hora",hh:"%d horas",d:"un d\xeda",dd:"%d d\xedas",M:"un mes",MM:"%d meses",y:"un ano",yy:"%d anos"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%d\xba",week:{dow:1,doy:4}})})(n(30381))},27884:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration -function t(e,t,n,r){var i={s:["थोडया सॅकंडांनी","थोडे सॅकंड"],ss:[e+" सॅकंडांनी",e+" सॅकंड"],m:["एका मिणटान","एक मिनूट"],mm:[e+" मिणटांनी",e+" मिणटां"],h:["एका वरान","एक वर"],hh:[e+" वरांनी",e+" वरां"],d:["एका दिसान","एक दीस"],dd:[e+" दिसांनी",e+" दीस"],M:["एका म्हयन्यान","एक म्हयनो"],MM:[e+" म्हयन्यानी",e+" म्हयने"],y:["एका वर्सान","एक वर्स"],yy:[e+" वर्सांनी",e+" वर्सां"]};return r?i[n][0]:i[n][1]}return e.defineLocale("gom-deva",{months:{standalone:"जानेवारी_फेब्रुवारी_मार्च_एप्रील_मे_जून_जुलय_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर".split("_"),format:"जानेवारीच्या_फेब्रुवारीच्या_मार्चाच्या_एप्रीलाच्या_मेयाच्या_जूनाच्या_जुलयाच्या_ऑगस्टाच्या_सप्टेंबराच्या_ऑक्टोबराच्या_नोव्हेंबराच्या_डिसेंबराच्या".split("_"),isFormat:/MMMM(\s)+D[oD]?/},monthsShort:"जाने._फेब्रु._मार्च_एप्री._मे_जून_जुल._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.".split("_"),monthsParseExact:!0,weekdays:"आयतार_सोमार_मंगळार_बुधवार_बिरेस्तार_सुक्रार_शेनवार".split("_"),weekdaysShort:"आयत._सोम._मंगळ._बुध._ब्रेस्त._सुक्र._शेन.".split("_"),weekdaysMin:"आ_सो_मं_बु_ब्रे_सु_शे".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"A h:mm [वाजतां]",LTS:"A h:mm:ss [वाजतां]",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY A h:mm [वाजतां]",LLLL:"dddd, MMMM Do, YYYY, A h:mm [वाजतां]",llll:"ddd, D MMM YYYY, A h:mm [वाजतां]"},calendar:{sameDay:"[आयज] LT",nextDay:"[फाल्यां] LT",nextWeek:"[फुडलो] dddd[,] LT",lastDay:"[काल] LT",lastWeek:"[फाटलो] dddd[,] LT",sameElse:"L"},relativeTime:{future:"%s",past:"%s आदीं",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}(वेर)/,ordinal:function(e,t){return"D"===t?e+"वेर":e},week:{dow:0,doy:3},meridiemParse:/राती|सकाळीं|दनपारां|सांजे/,meridiemHour:function(e,t){return(12===e&&(e=0),"राती"===t)?e<4?e:e+12:"सकाळीं"===t?e:"दनपारां"===t?e>12?e:e+12:"सांजे"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"राती":e<12?"सकाळीं":e<16?"दनपारां":e<20?"सांजे":"राती"}})})(n(30381))},23168:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration -function t(e,t,n,r){var i={s:["thoddea sekondamni","thodde sekond"],ss:[e+" sekondamni",e+" sekond"],m:["eka mintan","ek minut"],mm:[e+" mintamni",e+" mintam"],h:["eka voran","ek vor"],hh:[e+" voramni",e+" voram"],d:["eka disan","ek dis"],dd:[e+" disamni",e+" dis"],M:["eka mhoinean","ek mhoino"],MM:[e+" mhoineamni",e+" mhoine"],y:["eka vorsan","ek voros"],yy:[e+" vorsamni",e+" vorsam"]};return r?i[n][0]:i[n][1]}return e.defineLocale("gom-latn",{months:{standalone:"Janer_Febrer_Mars_Abril_Mai_Jun_Julai_Agost_Setembr_Otubr_Novembr_Dezembr".split("_"),format:"Janerachea_Febrerachea_Marsachea_Abrilachea_Maiachea_Junachea_Julaiachea_Agostachea_Setembrachea_Otubrachea_Novembrachea_Dezembrachea".split("_"),isFormat:/MMMM(\s)+D[oD]?/},monthsShort:"Jan._Feb._Mars_Abr._Mai_Jun_Jul._Ago._Set._Otu._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Aitar_Somar_Mongllar_Budhvar_Birestar_Sukrar_Son'var".split("_"),weekdaysShort:"Ait._Som._Mon._Bud._Bre._Suk._Son.".split("_"),weekdaysMin:"Ai_Sm_Mo_Bu_Br_Su_Sn".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"A h:mm [vazta]",LTS:"A h:mm:ss [vazta]",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY A h:mm [vazta]",LLLL:"dddd, MMMM Do, YYYY, A h:mm [vazta]",llll:"ddd, D MMM YYYY, A h:mm [vazta]"},calendar:{sameDay:"[Aiz] LT",nextDay:"[Faleam] LT",nextWeek:"[Fuddlo] dddd[,] LT",lastDay:"[Kal] LT",lastWeek:"[Fattlo] dddd[,] LT",sameElse:"L"},relativeTime:{future:"%s",past:"%s adim",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}(er)/,ordinal:function(e,t){return"D"===t?e+"er":e},week:{dow:0,doy:3},meridiemParse:/rati|sokallim|donparam|sanje/,meridiemHour:function(e,t){return(12===e&&(e=0),"rati"===t)?e<4?e:e+12:"sokallim"===t?e:"donparam"===t?e>12?e:e+12:"sanje"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"rati":e<12?"sokallim":e<16?"donparam":e<20?"sanje":"rati"}})})(n(30381))},95349:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration -var t={1:"૧",2:"૨",3:"૩",4:"૪",5:"૫",6:"૬",7:"૭",8:"૮",9:"૯",0:"૦"},n={"૧":"1","૨":"2","૩":"3","૪":"4","૫":"5","૬":"6","૭":"7","૮":"8","૯":"9","૦":"0"};return e.defineLocale("gu",{months:"જાન્યુઆરી_ફેબ્રુઆરી_માર્ચ_એપ્રિલ_મે_જૂન_જુલાઈ_ઑગસ્ટ_સપ્ટેમ્બર_ઑક્ટ્બર_નવેમ્બર_ડિસેમ્બર".split("_"),monthsShort:"જાન્યુ._ફેબ્રુ._માર્ચ_એપ્રિ._મે_જૂન_જુલા._ઑગ._સપ્ટે._ઑક્ટ્._નવે._ડિસે.".split("_"),monthsParseExact:!0,weekdays:"રવિવાર_સોમવાર_મંગળવાર_બુધ્વાર_ગુરુવાર_શુક્રવાર_શનિવાર".split("_"),weekdaysShort:"રવિ_સોમ_મંગળ_બુધ્_ગુરુ_શુક્ર_શનિ".split("_"),weekdaysMin:"ર_સો_મં_બુ_ગુ_શુ_શ".split("_"),longDateFormat:{LT:"A h:mm વાગ્યે",LTS:"A h:mm:ss વાગ્યે",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm વાગ્યે",LLLL:"dddd, D MMMM YYYY, A h:mm વાગ્યે"},calendar:{sameDay:"[આજ] LT",nextDay:"[કાલે] LT",nextWeek:"dddd, LT",lastDay:"[ગઇકાલે] LT",lastWeek:"[પાછલા] dddd, LT",sameElse:"L"},relativeTime:{future:"%s મા",past:"%s પહેલા",s:"અમુક પળો",ss:"%d સેકંડ",m:"એક મિનિટ",mm:"%d મિનિટ",h:"એક કલાક",hh:"%d કલાક",d:"એક દિવસ",dd:"%d દિવસ",M:"એક મહિનો",MM:"%d મહિનો",y:"એક વર્ષ",yy:"%d વર્ષ"},preparse:function(e){return e.replace(/[૧૨૩૪૫૬૭૮૯૦]/g,function(e){return n[e]})},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]})},meridiemParse:/રાત|બપોર|સવાર|સાંજ/,meridiemHour:function(e,t){return(12===e&&(e=0),"રાત"===t)?e<4?e:e+12:"સવાર"===t?e:"બપોર"===t?e>=10?e:e+12:"સાંજ"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"રાત":e<10?"સવાર":e<17?"બપોર":e<20?"સાંજ":"રાત"},week:{dow:0,doy:6}})})(n(30381))},24206:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("he",{months:"ינואר_פברואר_מרץ_אפריל_מאי_יוני_יולי_אוגוסט_ספטמבר_אוקטובר_נובמבר_דצמבר".split("_"),monthsShort:"ינו׳_פבר׳_מרץ_אפר׳_מאי_יוני_יולי_אוג׳_ספט׳_אוק׳_נוב׳_דצמ׳".split("_"),weekdays:"ראשון_שני_שלישי_רביעי_חמישי_שישי_שבת".split("_"),weekdaysShort:"א׳_ב׳_ג׳_ד׳_ה׳_ו׳_ש׳".split("_"),weekdaysMin:"א_ב_ג_ד_ה_ו_ש".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [ב]MMMM YYYY",LLL:"D [ב]MMMM YYYY HH:mm",LLLL:"dddd, D [ב]MMMM YYYY HH:mm",l:"D/M/YYYY",ll:"D MMM YYYY",lll:"D MMM YYYY HH:mm",llll:"ddd, D MMM YYYY HH:mm"},calendar:{sameDay:"[היום ב־]LT",nextDay:"[מחר ב־]LT",nextWeek:"dddd [בשעה] LT",lastDay:"[אתמול ב־]LT",lastWeek:"[ביום] dddd [האחרון בשעה] LT",sameElse:"L"},relativeTime:{future:"בעוד %s",past:"לפני %s",s:"מספר שניות",ss:"%d שניות",m:"דקה",mm:"%d דקות",h:"שעה",hh:function(e){return 2===e?"שעתיים":e+" שעות"},d:"יום",dd:function(e){return 2===e?"יומיים":e+" ימים"},M:"חודש",MM:function(e){return 2===e?"חודשיים":e+" חודשים"},y:"שנה",yy:function(e){return 2===e?"שנתיים":e%10==0&&10!==e?e+" שנה":e+" שנים"}},meridiemParse:/אחה"צ|לפנה"צ|אחרי הצהריים|לפני הצהריים|לפנות בוקר|בבוקר|בערב/i,isPM:function(e){return/^(אחה"צ|אחרי הצהריים|בערב)$/.test(e)},meridiem:function(e,t,n){return e<5?"לפנות בוקר":e<10?"בבוקר":e<12?n?'לפנה"צ':"לפני הצהריים":e<18?n?'אחה"צ':"אחרי הצהריים":"בערב"}})})(n(30381))},30094:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration -var t={1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"},n={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"},r=[/^जन/i,/^फ़र|फर/i,/^मार्च/i,/^अप्रै/i,/^मई/i,/^जून/i,/^जुल/i,/^अग/i,/^सितं|सित/i,/^अक्टू/i,/^नव|नवं/i,/^दिसं|दिस/i,],i=[/^जन/i,/^फ़र/i,/^मार्च/i,/^अप्रै/i,/^मई/i,/^जून/i,/^जुल/i,/^अग/i,/^सित/i,/^अक्टू/i,/^नव/i,/^दिस/i,];return e.defineLocale("hi",{months:{format:"जनवरी_फ़रवरी_मार्च_अप्रैल_मई_जून_जुलाई_अगस्त_सितम्बर_अक्टूबर_नवम्बर_दिसम्बर".split("_"),standalone:"जनवरी_फरवरी_मार्च_अप्रैल_मई_जून_जुलाई_अगस्त_सितंबर_अक्टूबर_नवंबर_दिसंबर".split("_")},monthsShort:"जन._फ़र._मार्च_अप्रै._मई_जून_जुल._अग._सित._अक्टू._नव._दिस.".split("_"),weekdays:"रविवार_सोमवार_मंगलवार_बुधवार_गुरूवार_शुक्रवार_शनिवार".split("_"),weekdaysShort:"रवि_सोम_मंगल_बुध_गुरू_शुक्र_शनि".split("_"),weekdaysMin:"र_सो_मं_बु_गु_शु_श".split("_"),longDateFormat:{LT:"A h:mm बजे",LTS:"A h:mm:ss बजे",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm बजे",LLLL:"dddd, D MMMM YYYY, A h:mm बजे"},monthsParse:r,longMonthsParse:r,shortMonthsParse:i,monthsRegex:/^(जनवरी|जन\.?|फ़रवरी|फरवरी|फ़र\.?|मार्च?|अप्रैल|अप्रै\.?|मई?|जून?|जुलाई|जुल\.?|अगस्त|अग\.?|सितम्बर|सितंबर|सित\.?|अक्टूबर|अक्टू\.?|नवम्बर|नवंबर|नव\.?|दिसम्बर|दिसंबर|दिस\.?)/i,monthsShortRegex:/^(जनवरी|जन\.?|फ़रवरी|फरवरी|फ़र\.?|मार्च?|अप्रैल|अप्रै\.?|मई?|जून?|जुलाई|जुल\.?|अगस्त|अग\.?|सितम्बर|सितंबर|सित\.?|अक्टूबर|अक्टू\.?|नवम्बर|नवंबर|नव\.?|दिसम्बर|दिसंबर|दिस\.?)/i,monthsStrictRegex:/^(जनवरी?|फ़रवरी|फरवरी?|मार्च?|अप्रैल?|मई?|जून?|जुलाई?|अगस्त?|सितम्बर|सितंबर|सित?\.?|अक्टूबर|अक्टू\.?|नवम्बर|नवंबर?|दिसम्बर|दिसंबर?)/i,monthsShortStrictRegex:/^(जन\.?|फ़र\.?|मार्च?|अप्रै\.?|मई?|जून?|जुल\.?|अग\.?|सित\.?|अक्टू\.?|नव\.?|दिस\.?)/i,calendar:{sameDay:"[आज] LT",nextDay:"[कल] LT",nextWeek:"dddd, LT",lastDay:"[कल] LT",lastWeek:"[पिछले] dddd, LT",sameElse:"L"},relativeTime:{future:"%s में",past:"%s पहले",s:"कुछ ही क्षण",ss:"%d सेकंड",m:"एक मिनट",mm:"%d मिनट",h:"एक घंटा",hh:"%d घंटे",d:"एक दिन",dd:"%d दिन",M:"एक महीने",MM:"%d महीने",y:"एक वर्ष",yy:"%d वर्ष"},preparse:function(e){return e.replace(/[१२३४५६७८९०]/g,function(e){return n[e]})},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]})},meridiemParse:/रात|सुबह|दोपहर|शाम/,meridiemHour:function(e,t){return(12===e&&(e=0),"रात"===t)?e<4?e:e+12:"सुबह"===t?e:"दोपहर"===t?e>=10?e:e+12:"शाम"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"रात":e<10?"सुबह":e<17?"दोपहर":e<20?"शाम":"रात"},week:{dow:0,doy:6}})})(n(30381))},30316:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration -function t(e,t,n){var r=e+" ";switch(n){case"ss":return 1===e?r+="sekunda":2===e||3===e||4===e?r+="sekunde":r+="sekundi",r;case"m":return t?"jedna minuta":"jedne minute";case"mm":return 1===e?r+="minuta":2===e||3===e||4===e?r+="minute":r+="minuta",r;case"h":return t?"jedan sat":"jednog sata";case"hh":return 1===e?r+="sat":2===e||3===e||4===e?r+="sata":r+="sati",r;case"dd":return 1===e?r+="dan":r+="dana",r;case"MM":return 1===e?r+="mjesec":2===e||3===e||4===e?r+="mjeseca":r+="mjeseci",r;case"yy":return 1===e?r+="godina":2===e||3===e||4===e?r+="godine":r+="godina",r}}return e.defineLocale("hr",{months:{format:"siječnja_veljače_ožujka_travnja_svibnja_lipnja_srpnja_kolovoza_rujna_listopada_studenoga_prosinca".split("_"),standalone:"siječanj_veljača_ožujak_travanj_svibanj_lipanj_srpanj_kolovoz_rujan_listopad_studeni_prosinac".split("_")},monthsShort:"sij._velj._ožu._tra._svi._lip._srp._kol._ruj._lis._stu._pro.".split("_"),monthsParseExact:!0,weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"Do MMMM YYYY",LLL:"Do MMMM YYYY H:mm",LLLL:"dddd, Do MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[jučer u] LT",lastWeek:function(){switch(this.day()){case 0:return"[prošlu] [nedjelju] [u] LT";case 3:return"[prošlu] [srijedu] [u] LT";case 6:return"[prošle] [subote] [u] LT";case 1:case 2:case 4:case 5:return"[prošli] dddd [u] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"par sekundi",ss:t,m:t,mm:t,h:t,hh:t,d:"dan",dd:t,M:"mjesec",MM:t,y:"godinu",yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})})(n(30381))},22138:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration -var t="vas\xe1rnap h\xe9tfőn kedden szerd\xe1n cs\xfct\xf6rt\xf6k\xf6n p\xe9nteken szombaton".split(" ");function n(e,t,n,r){var i=e;switch(n){case"s":return r||t?"n\xe9h\xe1ny m\xe1sodperc":"n\xe9h\xe1ny m\xe1sodperce";case"ss":return i+(r||t)?" m\xe1sodperc":" m\xe1sodperce";case"m":return"egy"+(r||t?" perc":" perce");case"mm":return i+(r||t?" perc":" perce");case"h":return"egy"+(r||t?" \xf3ra":" \xf3r\xe1ja");case"hh":return i+(r||t?" \xf3ra":" \xf3r\xe1ja");case"d":return"egy"+(r||t?" nap":" napja");case"dd":return i+(r||t?" nap":" napja");case"M":return"egy"+(r||t?" h\xf3nap":" h\xf3napja");case"MM":return i+(r||t?" h\xf3nap":" h\xf3napja");case"y":return"egy"+(r||t?" \xe9v":" \xe9ve");case"yy":return i+(r||t?" \xe9v":" \xe9ve")}return""}function r(e){return(e?"":"[m\xfalt] ")+"["+t[this.day()]+"] LT[-kor]"}return e.defineLocale("hu",{months:"janu\xe1r_febru\xe1r_m\xe1rcius_\xe1prilis_m\xe1jus_j\xfanius_j\xfalius_augusztus_szeptember_okt\xf3ber_november_december".split("_"),monthsShort:"jan._feb._m\xe1rc._\xe1pr._m\xe1j._j\xfan._j\xfal._aug._szept._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"vas\xe1rnap_h\xe9tfő_kedd_szerda_cs\xfct\xf6rt\xf6k_p\xe9ntek_szombat".split("_"),weekdaysShort:"vas_h\xe9t_kedd_sze_cs\xfct_p\xe9n_szo".split("_"),weekdaysMin:"v_h_k_sze_cs_p_szo".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"YYYY.MM.DD.",LL:"YYYY. MMMM D.",LLL:"YYYY. MMMM D. H:mm",LLLL:"YYYY. MMMM D., dddd H:mm"},meridiemParse:/de|du/i,isPM:function(e){return"u"===e.charAt(1).toLowerCase()},meridiem:function(e,t,n){return e<12?!0===n?"de":"DE":!0===n?"du":"DU"},calendar:{sameDay:"[ma] LT[-kor]",nextDay:"[holnap] LT[-kor]",nextWeek:function(){return r.call(this,!0)},lastDay:"[tegnap] LT[-kor]",lastWeek:function(){return r.call(this,!1)},sameElse:"L"},relativeTime:{future:"%s m\xfalva",past:"%s",s:n,ss:n,m:n,mm:n,h:n,hh:n,d:n,dd:n,M:n,MM:n,y:n,yy:n},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})})(n(30381))},11423:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("hy-am",{months:{format:"հունվարի_փետրվարի_մարտի_ապրիլի_մայիսի_հունիսի_հուլիսի_օգոստոսի_սեպտեմբերի_հոկտեմբերի_նոյեմբերի_դեկտեմբերի".split("_"),standalone:"հունվար_փետրվար_մարտ_ապրիլ_մայիս_հունիս_հուլիս_օգոստոս_սեպտեմբեր_հոկտեմբեր_նոյեմբեր_դեկտեմբեր".split("_")},monthsShort:"հնվ_փտր_մրտ_ապր_մյս_հնս_հլս_օգս_սպտ_հկտ_նմբ_դկտ".split("_"),weekdays:"կիրակի_երկուշաբթի_երեքշաբթի_չորեքշաբթի_հինգշաբթի_ուրբաթ_շաբաթ".split("_"),weekdaysShort:"կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ".split("_"),weekdaysMin:"կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY թ.",LLL:"D MMMM YYYY թ., HH:mm",LLLL:"dddd, D MMMM YYYY թ., HH:mm"},calendar:{sameDay:"[այսօր] LT",nextDay:"[վաղը] LT",lastDay:"[երեկ] LT",nextWeek:function(){return"dddd [օրը ժամը] LT"},lastWeek:function(){return"[անցած] dddd [օրը ժամը] LT"},sameElse:"L"},relativeTime:{future:"%s հետո",past:"%s առաջ",s:"մի քանի վայրկյան",ss:"%d վայրկյան",m:"րոպե",mm:"%d րոպե",h:"ժամ",hh:"%d ժամ",d:"օր",dd:"%d օր",M:"ամիս",MM:"%d ամիս",y:"տարի",yy:"%d տարի"},meridiemParse:/գիշերվա|առավոտվա|ցերեկվա|երեկոյան/,isPM:function(e){return/^(ցերեկվա|երեկոյան)$/.test(e)},meridiem:function(e){return e<4?"գիշերվա":e<12?"առավոտվա":e<17?"ցերեկվա":"երեկոյան"},dayOfMonthOrdinalParse:/\d{1,2}|\d{1,2}-(ին|րդ)/,ordinal:function(e,t){switch(t){case"DDD":case"w":case"W":case"DDDo":if(1===e)return e+"-ին";return e+"-րդ";default:return e}},week:{dow:1,doy:7}})})(n(30381))},29218:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("id",{months:"Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_November_Desember".split("_"),monthsShort:"Jan_Feb_Mar_Apr_Mei_Jun_Jul_Agt_Sep_Okt_Nov_Des".split("_"),weekdays:"Minggu_Senin_Selasa_Rabu_Kamis_Jumat_Sabtu".split("_"),weekdaysShort:"Min_Sen_Sel_Rab_Kam_Jum_Sab".split("_"),weekdaysMin:"Mg_Sn_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|siang|sore|malam/,meridiemHour:function(e,t){return(12===e&&(e=0),"pagi"===t)?e:"siang"===t?e>=11?e:e+12:"sore"===t||"malam"===t?e+12:void 0},meridiem:function(e,t,n){return e<11?"pagi":e<15?"siang":e<19?"sore":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Besok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kemarin pukul] LT",lastWeek:"dddd [lalu pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lalu",s:"beberapa detik",ss:"%d detik",m:"semenit",mm:"%d menit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:0,doy:6}})})(n(30381))},90135:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration -function t(e){if(e%100==11);else if(e%10==1)return!1;return!0}function n(e,n,r,i){var a=e+" ";switch(r){case"s":return n||i?"nokkrar sek\xfandur":"nokkrum sek\xfandum";case"ss":if(t(e))return a+(n||i?"sek\xfandur":"sek\xfandum");return a+"sek\xfanda";case"m":return n?"m\xedn\xfata":"m\xedn\xfatu";case"mm":if(t(e))return a+(n||i?"m\xedn\xfatur":"m\xedn\xfatum");if(n)return a+"m\xedn\xfata";return a+"m\xedn\xfatu";case"hh":if(t(e))return a+(n||i?"klukkustundir":"klukkustundum");return a+"klukkustund";case"d":if(n)return"dagur";return i?"dag":"degi";case"dd":if(t(e)){if(n)return a+"dagar";return a+(i?"daga":"d\xf6gum")}if(n)return a+"dagur";return a+(i?"dag":"degi");case"M":if(n)return"m\xe1nu\xf0ur";return i?"m\xe1nu\xf0":"m\xe1nu\xf0i";case"MM":if(t(e)){if(n)return a+"m\xe1nu\xf0ir";return a+(i?"m\xe1nu\xf0i":"m\xe1nu\xf0um")}if(n)return a+"m\xe1nu\xf0ur";return a+(i?"m\xe1nu\xf0":"m\xe1nu\xf0i");case"y":return n||i?"\xe1r":"\xe1ri";case"yy":if(t(e))return a+(n||i?"\xe1r":"\xe1rum");return a+(n||i?"\xe1r":"\xe1ri")}}return e.defineLocale("is",{months:"jan\xfaar_febr\xfaar_mars_apr\xedl_ma\xed_j\xfan\xed_j\xfal\xed_\xe1g\xfast_september_okt\xf3ber_n\xf3vember_desember".split("_"),monthsShort:"jan_feb_mar_apr_ma\xed_j\xfan_j\xfal_\xe1g\xfa_sep_okt_n\xf3v_des".split("_"),weekdays:"sunnudagur_m\xe1nudagur_\xferi\xf0judagur_mi\xf0vikudagur_fimmtudagur_f\xf6studagur_laugardagur".split("_"),weekdaysShort:"sun_m\xe1n_\xferi_mi\xf0_fim_f\xf6s_lau".split("_"),weekdaysMin:"Su_M\xe1_\xder_Mi_Fi_F\xf6_La".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] H:mm",LLLL:"dddd, D. MMMM YYYY [kl.] H:mm"},calendar:{sameDay:"[\xed dag kl.] LT",nextDay:"[\xe1 morgun kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[\xed g\xe6r kl.] LT",lastWeek:"[s\xed\xf0asta] dddd [kl.] LT",sameElse:"L"},relativeTime:{future:"eftir %s",past:"fyrir %s s\xed\xf0an",s:n,ss:n,m:n,mm:n,h:"klukkustund",hh:n,d:n,dd:n,M:n,MM:n,y:n,yy:n},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})})(n(30381))},10150:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("it-ch",{months:"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"),monthsShort:"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"),weekdays:"domenica_luned\xec_marted\xec_mercoled\xec_gioved\xec_venerd\xec_sabato".split("_"),weekdaysShort:"dom_lun_mar_mer_gio_ven_sab".split("_"),weekdaysMin:"do_lu_ma_me_gi_ve_sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Oggi alle] LT",nextDay:"[Domani alle] LT",nextWeek:"dddd [alle] LT",lastDay:"[Ieri alle] LT",lastWeek:function(){return 0===this.day()?"[la scorsa] dddd [alle] LT":"[lo scorso] dddd [alle] LT"},sameElse:"L"},relativeTime:{future:function(e){return(/^[0-9].+$/.test(e)?"tra":"in")+" "+e},past:"%s fa",s:"alcuni secondi",ss:"%d secondi",m:"un minuto",mm:"%d minuti",h:"un'ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%d\xba",week:{dow:1,doy:4}})})(n(30381))},90626:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("it",{months:"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"),monthsShort:"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"),weekdays:"domenica_luned\xec_marted\xec_mercoled\xec_gioved\xec_venerd\xec_sabato".split("_"),weekdaysShort:"dom_lun_mar_mer_gio_ven_sab".split("_"),weekdaysMin:"do_lu_ma_me_gi_ve_sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:function(){return"[Oggi a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT"},nextDay:function(){return"[Domani a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT"},nextWeek:function(){return"dddd [a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT"},lastDay:function(){return"[Ieri a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT"},lastWeek:function(){return 0===this.day()?"[La scorsa] dddd [a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT":"[Lo scorso] dddd [a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT"},sameElse:"L"},relativeTime:{future:"tra %s",past:"%s fa",s:"alcuni secondi",ss:"%d secondi",m:"un minuto",mm:"%d minuti",h:"un'ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",w:"una settimana",ww:"%d settimane",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%d\xba",week:{dow:1,doy:4}})})(n(30381))},39183:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("ja",{eras:[{since:"2019-05-01",offset:1,name:"令和",narrow:"㋿",abbr:"R"},{since:"1989-01-08",until:"2019-04-30",offset:1,name:"平成",narrow:"㍻",abbr:"H"},{since:"1926-12-25",until:"1989-01-07",offset:1,name:"昭和",narrow:"㍼",abbr:"S"},{since:"1912-07-30",until:"1926-12-24",offset:1,name:"大正",narrow:"㍽",abbr:"T"},{since:"1873-01-01",until:"1912-07-29",offset:6,name:"明治",narrow:"㍾",abbr:"M"},{since:"0001-01-01",until:"1873-12-31",offset:1,name:"西暦",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"紀元前",narrow:"BC",abbr:"BC"},],eraYearOrdinalRegex:/(元|\d+)年/,eraYearOrdinalParse:function(e,t){return"元"===t[1]?1:parseInt(t[1]||e,10)},months:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"日曜日_月曜日_火曜日_水曜日_木曜日_金曜日_土曜日".split("_"),weekdaysShort:"日_月_火_水_木_金_土".split("_"),weekdaysMin:"日_月_火_水_木_金_土".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日 dddd HH:mm",l:"YYYY/MM/DD",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日(ddd) HH:mm"},meridiemParse:/午前|午後/i,isPM:function(e){return"午後"===e},meridiem:function(e,t,n){return e<12?"午前":"午後"},calendar:{sameDay:"[今日] LT",nextDay:"[明日] LT",nextWeek:function(e){return e.week()!==this.week()?"[来週]dddd LT":"dddd LT"},lastDay:"[昨日] LT",lastWeek:function(e){return this.week()!==e.week()?"[先週]dddd LT":"dddd LT"},sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}日/,ordinal:function(e,t){switch(t){case"y":return 1===e?"元年":e+"年";case"d":case"D":case"DDD":return e+"日";default:return e}},relativeTime:{future:"%s後",past:"%s前",s:"数秒",ss:"%d秒",m:"1分",mm:"%d分",h:"1時間",hh:"%d時間",d:"1日",dd:"%d日",M:"1ヶ月",MM:"%dヶ月",y:"1年",yy:"%d年"}})})(n(30381))},24286:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("jv",{months:"Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_Nopember_Desember".split("_"),monthsShort:"Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nop_Des".split("_"),weekdays:"Minggu_Senen_Seloso_Rebu_Kemis_Jemuwah_Septu".split("_"),weekdaysShort:"Min_Sen_Sel_Reb_Kem_Jem_Sep".split("_"),weekdaysMin:"Mg_Sn_Sl_Rb_Km_Jm_Sp".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/enjing|siyang|sonten|ndalu/,meridiemHour:function(e,t){return(12===e&&(e=0),"enjing"===t)?e:"siyang"===t?e>=11?e:e+12:"sonten"===t||"ndalu"===t?e+12:void 0},meridiem:function(e,t,n){return e<11?"enjing":e<15?"siyang":e<19?"sonten":"ndalu"},calendar:{sameDay:"[Dinten puniko pukul] LT",nextDay:"[Mbenjang pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kala wingi pukul] LT",lastWeek:"dddd [kepengker pukul] LT",sameElse:"L"},relativeTime:{future:"wonten ing %s",past:"%s ingkang kepengker",s:"sawetawis detik",ss:"%d detik",m:"setunggal menit",mm:"%d menit",h:"setunggal jam",hh:"%d jam",d:"sedinten",dd:"%d dinten",M:"sewulan",MM:"%d wulan",y:"setaun",yy:"%d taun"},week:{dow:1,doy:7}})})(n(30381))},12105:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("ka",{months:"იანვარი_თებერვალი_მარტი_აპრილი_მაისი_ივნისი_ივლისი_აგვისტო_სექტემბერი_ოქტომბერი_ნოემბერი_დეკემბერი".split("_"),monthsShort:"იან_თებ_მარ_აპრ_მაი_ივნ_ივლ_აგვ_სექ_ოქტ_ნოე_დეკ".split("_"),weekdays:{standalone:"კვირა_ორშაბათი_სამშაბათი_ოთხშაბათი_ხუთშაბათი_პარასკევი_შაბათი".split("_"),format:"კვირას_ორშაბათს_სამშაბათს_ოთხშაბათს_ხუთშაბათს_პარასკევს_შაბათს".split("_"),isFormat:/(წინა|შემდეგ)/},weekdaysShort:"კვი_ორშ_სამ_ოთხ_ხუთ_პარ_შაბ".split("_"),weekdaysMin:"კვ_ორ_სა_ოთ_ხუ_პა_შა".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[დღეს] LT[-ზე]",nextDay:"[ხვალ] LT[-ზე]",lastDay:"[გუშინ] LT[-ზე]",nextWeek:"[შემდეგ] dddd LT[-ზე]",lastWeek:"[წინა] dddd LT-ზე",sameElse:"L"},relativeTime:{future:function(e){return e.replace(/(წამ|წუთ|საათ|წელ|დღ|თვ)(ი|ე)/,function(e,t,n){return"ი"===n?t+"ში":t+n+"ში"})},past:function(e){return/(წამი|წუთი|საათი|დღე|თვე)/.test(e)?e.replace(/(ი|ე)$/,"ის წინ"):/წელი/.test(e)?e.replace(/წელი$/,"წლის წინ"):e},s:"რამდენიმე წამი",ss:"%d წამი",m:"წუთი",mm:"%d წუთი",h:"საათი",hh:"%d საათი",d:"დღე",dd:"%d დღე",M:"თვე",MM:"%d თვე",y:"წელი",yy:"%d წელი"},dayOfMonthOrdinalParse:/0|1-ლი|მე-\d{1,2}|\d{1,2}-ე/,ordinal:function(e){return 0===e?e:1===e?e+"-ლი":e<20||e<=100&&e%20==0||e%100==0?"მე-"+e:e+"-ე"},week:{dow:1,doy:7}})})(n(30381))},47772:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration -var t={0:"-ші",1:"-ші",2:"-ші",3:"-ші",4:"-ші",5:"-ші",6:"-шы",7:"-ші",8:"-ші",9:"-шы",10:"-шы",20:"-шы",30:"-шы",40:"-шы",50:"-ші",60:"-шы",70:"-ші",80:"-ші",90:"-шы",100:"-ші"};return e.defineLocale("kk",{months:"қаңтар_ақпан_наурыз_сәуір_мамыр_маусым_шілде_тамыз_қыркүйек_қазан_қараша_желтоқсан".split("_"),monthsShort:"қаң_ақп_нау_сәу_мам_мау_шіл_там_қыр_қаз_қар_жел".split("_"),weekdays:"жексенбі_дүйсенбі_сейсенбі_сәрсенбі_бейсенбі_жұма_сенбі".split("_"),weekdaysShort:"жек_дүй_сей_сәр_бей_жұм_сен".split("_"),weekdaysMin:"жк_дй_сй_ср_бй_жм_сн".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Бүгін сағат] LT",nextDay:"[Ертең сағат] LT",nextWeek:"dddd [сағат] LT",lastDay:"[Кеше сағат] LT",lastWeek:"[Өткен аптаның] dddd [сағат] LT",sameElse:"L"},relativeTime:{future:"%s ішінде",past:"%s бұрын",s:"бірнеше секунд",ss:"%d секунд",m:"бір минут",mm:"%d минут",h:"бір сағат",hh:"%d сағат",d:"бір күн",dd:"%d күн",M:"бір ай",MM:"%d ай",y:"бір жыл",yy:"%d жыл"},dayOfMonthOrdinalParse:/\d{1,2}-(ші|шы)/,ordinal:function(e){var n=e%10,r=e>=100?100:null;return e+(t[e]||t[n]||t[r])},week:{dow:1,doy:7}})})(n(30381))},18758:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration -var t={1:"១",2:"២",3:"៣",4:"៤",5:"៥",6:"៦",7:"៧",8:"៨",9:"៩",0:"០"},n={"១":"1","២":"2","៣":"3","៤":"4","៥":"5","៦":"6","៧":"7","៨":"8","៩":"9","០":"0"};return e.defineLocale("km",{months:"មករា_កុម្ភៈ_មីនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ".split("_"),monthsShort:"មករា_កុម្ភៈ_មីនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ".split("_"),weekdays:"អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍".split("_"),weekdaysShort:"អា_ច_អ_ព_ព្រ_សុ_ស".split("_"),weekdaysMin:"អា_ច_អ_ព_ព្រ_សុ_ស".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},meridiemParse:/ព្រឹក|ល្ងាច/,isPM:function(e){return"ល្ងាច"===e},meridiem:function(e,t,n){return e<12?"ព្រឹក":"ល្ងាច"},calendar:{sameDay:"[ថ្ងៃនេះ ម៉ោង] LT",nextDay:"[ស្អែក ម៉ោង] LT",nextWeek:"dddd [ម៉ោង] LT",lastDay:"[ម្សិលមិញ ម៉ោង] LT",lastWeek:"dddd [សប្តាហ៍មុន] [ម៉ោង] LT",sameElse:"L"},relativeTime:{future:"%sទៀត",past:"%sមុន",s:"ប៉ុន្មានវិនាទី",ss:"%d វិនាទី",m:"មួយនាទី",mm:"%d នាទី",h:"មួយម៉ោង",hh:"%d ម៉ោង",d:"មួយថ្ងៃ",dd:"%d ថ្ងៃ",M:"មួយខែ",MM:"%d ខែ",y:"មួយឆ្នាំ",yy:"%d ឆ្នាំ"},dayOfMonthOrdinalParse:/ទី\d{1,2}/,ordinal:"ទី%d",preparse:function(e){return e.replace(/[១២៣៤៥៦៧៨៩០]/g,function(e){return n[e]})},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]})},week:{dow:1,doy:4}})})(n(30381))},79282:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration -var t={1:"೧",2:"೨",3:"೩",4:"೪",5:"೫",6:"೬",7:"೭",8:"೮",9:"೯",0:"೦"},n={"೧":"1","೨":"2","೩":"3","೪":"4","೫":"5","೬":"6","೭":"7","೮":"8","೯":"9","೦":"0"};return e.defineLocale("kn",{months:"ಜನವರಿ_ಫೆಬ್ರವರಿ_ಮಾರ್ಚ್_ಏಪ್ರಿಲ್_ಮೇ_ಜೂನ್_ಜುಲೈ_ಆಗಸ್ಟ್_ಸೆಪ್ಟೆಂಬರ್_ಅಕ್ಟೋಬರ್_ನವೆಂಬರ್_ಡಿಸೆಂಬರ್".split("_"),monthsShort:"ಜನ_ಫೆಬ್ರ_ಮಾರ್ಚ್_ಏಪ್ರಿಲ್_ಮೇ_ಜೂನ್_ಜುಲೈ_ಆಗಸ್ಟ್_ಸೆಪ್ಟೆಂ_ಅಕ್ಟೋ_ನವೆಂ_ಡಿಸೆಂ".split("_"),monthsParseExact:!0,weekdays:"ಭಾನುವಾರ_ಸೋಮವಾರ_ಮಂಗಳವಾರ_ಬುಧವಾರ_ಗುರುವಾರ_ಶುಕ್ರವಾರ_ಶನಿವಾರ".split("_"),weekdaysShort:"ಭಾನು_ಸೋಮ_ಮಂಗಳ_ಬುಧ_ಗುರು_ಶುಕ್ರ_ಶನಿ".split("_"),weekdaysMin:"ಭಾ_ಸೋ_ಮಂ_ಬು_ಗು_ಶು_ಶ".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},calendar:{sameDay:"[ಇಂದು] LT",nextDay:"[ನಾಳೆ] LT",nextWeek:"dddd, LT",lastDay:"[ನಿನ್ನೆ] LT",lastWeek:"[ಕೊನೆಯ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s ನಂತರ",past:"%s ಹಿಂದೆ",s:"ಕೆಲವು ಕ್ಷಣಗಳು",ss:"%d ಸೆಕೆಂಡುಗಳು",m:"ಒಂದು ನಿಮಿಷ",mm:"%d ನಿಮಿಷ",h:"ಒಂದು ಗಂಟೆ",hh:"%d ಗಂಟೆ",d:"ಒಂದು ದಿನ",dd:"%d ದಿನ",M:"ಒಂದು ತಿಂಗಳು",MM:"%d ತಿಂಗಳು",y:"ಒಂದು ವರ್ಷ",yy:"%d ವರ್ಷ"},preparse:function(e){return e.replace(/[೧೨೩೪೫೬೭೮೯೦]/g,function(e){return n[e]})},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]})},meridiemParse:/ರಾತ್ರಿ|ಬೆಳಿಗ್ಗೆ|ಮಧ್ಯಾಹ್ನ|ಸಂಜೆ/,meridiemHour:function(e,t){return(12===e&&(e=0),"ರಾತ್ರಿ"===t)?e<4?e:e+12:"ಬೆಳಿಗ್ಗೆ"===t?e:"ಮಧ್ಯಾಹ್ನ"===t?e>=10?e:e+12:"ಸಂಜೆ"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"ರಾತ್ರಿ":e<10?"ಬೆಳಿಗ್ಗೆ":e<17?"ಮಧ್ಯಾಹ್ನ":e<20?"ಸಂಜೆ":"ರಾತ್ರಿ"},dayOfMonthOrdinalParse:/\d{1,2}(ನೇ)/,ordinal:function(e){return e+"ನೇ"},week:{dow:0,doy:6}})})(n(30381))},33730:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("ko",{months:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),monthsShort:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),weekdays:"일요일_월요일_화요일_수요일_목요일_금요일_토요일".split("_"),weekdaysShort:"일_월_화_수_목_금_토".split("_"),weekdaysMin:"일_월_화_수_목_금_토".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"YYYY.MM.DD.",LL:"YYYY년 MMMM D일",LLL:"YYYY년 MMMM D일 A h:mm",LLLL:"YYYY년 MMMM D일 dddd A h:mm",l:"YYYY.MM.DD.",ll:"YYYY년 MMMM D일",lll:"YYYY년 MMMM D일 A h:mm",llll:"YYYY년 MMMM D일 dddd A h:mm"},calendar:{sameDay:"오늘 LT",nextDay:"내일 LT",nextWeek:"dddd LT",lastDay:"어제 LT",lastWeek:"지난주 dddd LT",sameElse:"L"},relativeTime:{future:"%s 후",past:"%s 전",s:"몇 초",ss:"%d초",m:"1분",mm:"%d분",h:"한 시간",hh:"%d시간",d:"하루",dd:"%d일",M:"한 달",MM:"%d달",y:"일 년",yy:"%d년"},dayOfMonthOrdinalParse:/\d{1,2}(일|월|주)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"일";case"M":return e+"월";case"w":case"W":return e+"주";default:return e}},meridiemParse:/오전|오후/,isPM:function(e){return"오후"===e},meridiem:function(e,t,n){return e<12?"오전":"오후"}})})(n(30381))},1408:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration -var t={1:"١",2:"٢",3:"٣",4:"٤",5:"٥",6:"٦",7:"٧",8:"٨",9:"٩",0:"٠"},n={"١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","٠":"0"},r=["کانونی دووەم","شوبات","ئازار","نیسان","ئایار","حوزەیران","تەمموز","ئاب","ئەیلوول","تشرینی یەكەم","تشرینی دووەم","كانونی یەکەم",];return e.defineLocale("ku",{months:r,monthsShort:r,weekdays:"یه‌كشه‌ممه‌_دووشه‌ممه‌_سێشه‌ممه‌_چوارشه‌ممه‌_پێنجشه‌ممه‌_هه‌ینی_شه‌ممه‌".split("_"),weekdaysShort:"یه‌كشه‌م_دووشه‌م_سێشه‌م_چوارشه‌م_پێنجشه‌م_هه‌ینی_شه‌ممه‌".split("_"),weekdaysMin:"ی_د_س_چ_پ_ه_ش".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},meridiemParse:/ئێواره‌|به‌یانی/,isPM:function(e){return/ئێواره‌/.test(e)},meridiem:function(e,t,n){return e<12?"به‌یانی":"ئێواره‌"},calendar:{sameDay:"[ئه‌مرۆ كاتژمێر] LT",nextDay:"[به‌یانی كاتژمێر] LT",nextWeek:"dddd [كاتژمێر] LT",lastDay:"[دوێنێ كاتژمێر] LT",lastWeek:"dddd [كاتژمێر] LT",sameElse:"L"},relativeTime:{future:"له‌ %s",past:"%s",s:"چه‌ند چركه‌یه‌ك",ss:"چركه‌ %d",m:"یه‌ك خوله‌ك",mm:"%d خوله‌ك",h:"یه‌ك كاتژمێر",hh:"%d كاتژمێر",d:"یه‌ك ڕۆژ",dd:"%d ڕۆژ",M:"یه‌ك مانگ",MM:"%d مانگ",y:"یه‌ك ساڵ",yy:"%d ساڵ"},preparse:function(e){return e.replace(/[١٢٣٤٥٦٧٨٩٠]/g,function(e){return n[e]}).replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]}).replace(/,/g,"،")},week:{dow:6,doy:12}})})(n(30381))},33291:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration -var t={0:"-чү",1:"-чи",2:"-чи",3:"-чү",4:"-чү",5:"-чи",6:"-чы",7:"-чи",8:"-чи",9:"-чу",10:"-чу",20:"-чы",30:"-чу",40:"-чы",50:"-чү",60:"-чы",70:"-чи",80:"-чи",90:"-чу",100:"-чү"};return e.defineLocale("ky",{months:"январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_"),monthsShort:"янв_фев_март_апр_май_июнь_июль_авг_сен_окт_ноя_дек".split("_"),weekdays:"Жекшемби_Дүйшөмбү_Шейшемби_Шаршемби_Бейшемби_Жума_Ишемби".split("_"),weekdaysShort:"Жек_Дүй_Шей_Шар_Бей_Жум_Ише".split("_"),weekdaysMin:"Жк_Дй_Шй_Шр_Бй_Жм_Иш".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Бүгүн саат] LT",nextDay:"[Эртең саат] LT",nextWeek:"dddd [саат] LT",lastDay:"[Кечээ саат] LT",lastWeek:"[Өткөн аптанын] dddd [күнү] [саат] LT",sameElse:"L"},relativeTime:{future:"%s ичинде",past:"%s мурун",s:"бирнече секунд",ss:"%d секунд",m:"бир мүнөт",mm:"%d мүнөт",h:"бир саат",hh:"%d саат",d:"бир күн",dd:"%d күн",M:"бир ай",MM:"%d ай",y:"бир жыл",yy:"%d жыл"},dayOfMonthOrdinalParse:/\d{1,2}-(чи|чы|чү|чу)/,ordinal:function(e){var n=e%10,r=e>=100?100:null;return e+(t[e]||t[n]||t[r])},week:{dow:1,doy:7}})})(n(30381))},36841:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration -function t(e,t,n,r){var i={m:["eng Minutt","enger Minutt"],h:["eng Stonn","enger Stonn"],d:["een Dag","engem Dag"],M:["ee Mount","engem Mount"],y:["ee Joer","engem Joer"]};return t?i[n][0]:i[n][1]}function n(e){return i(e.substr(0,e.indexOf(" ")))?"a "+e:"an "+e}function r(e){return i(e.substr(0,e.indexOf(" ")))?"viru "+e:"virun "+e}function i(e){if(e=parseInt(e,10),isNaN(e))return!1;if(e<0)return!0;if(e<10)return!!(4<=e)&&!!(e<=7);if(e<100){var t=e%10,n=e/10;return 0===t?i(n):i(t)}if(!(e<1e4))return i(e/=1e3);for(;e>=10;)e/=10;return i(e)}return e.defineLocale("lb",{months:"Januar_Februar_M\xe4erz_Abr\xebll_Mee_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Febr._Mrz._Abr._Mee_Jun._Jul._Aug._Sept._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonndeg_M\xe9indeg_D\xebnschdeg_M\xebttwoch_Donneschdeg_Freideg_Samschdeg".split("_"),weekdaysShort:"So._M\xe9._D\xeb._M\xeb._Do._Fr._Sa.".split("_"),weekdaysMin:"So_M\xe9_D\xeb_M\xeb_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm [Auer]",LTS:"H:mm:ss [Auer]",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm [Auer]",LLLL:"dddd, D. MMMM YYYY H:mm [Auer]"},calendar:{sameDay:"[Haut um] LT",sameElse:"L",nextDay:"[Muer um] LT",nextWeek:"dddd [um] LT",lastDay:"[G\xebschter um] LT",lastWeek:function(){switch(this.day()){case 2:case 4:return"[Leschten] dddd [um] LT";default:return"[Leschte] dddd [um] LT"}}},relativeTime:{future:n,past:r,s:"e puer Sekonnen",ss:"%d Sekonnen",m:t,mm:"%d Minutten",h:t,hh:"%d Stonnen",d:t,dd:"%d Deeg",M:t,MM:"%d M\xe9int",y:t,yy:"%d Joer"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})})(n(30381))},55466:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("lo",{months:"ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ".split("_"),monthsShort:"ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ".split("_"),weekdays:"ອາທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ".split("_"),weekdaysShort:"ທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ".split("_"),weekdaysMin:"ທ_ຈ_ອຄ_ພ_ພຫ_ສກ_ສ".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"ວັນdddd D MMMM YYYY HH:mm"},meridiemParse:/ຕອນເຊົ້າ|ຕອນແລງ/,isPM:function(e){return"ຕອນແລງ"===e},meridiem:function(e,t,n){return e<12?"ຕອນເຊົ້າ":"ຕອນແລງ"},calendar:{sameDay:"[ມື້ນີ້ເວລາ] LT",nextDay:"[ມື້ອື່ນເວລາ] LT",nextWeek:"[ວັນ]dddd[ໜ້າເວລາ] LT",lastDay:"[ມື້ວານນີ້ເວລາ] LT",lastWeek:"[ວັນ]dddd[ແລ້ວນີ້ເວລາ] LT",sameElse:"L"},relativeTime:{future:"ອີກ %s",past:"%sຜ່ານມາ",s:"ບໍ່ເທົ່າໃດວິນາທີ",ss:"%d ວິນາທີ",m:"1 ນາທີ",mm:"%d ນາທີ",h:"1 ຊົ່ວໂມງ",hh:"%d ຊົ່ວໂມງ",d:"1 ມື້",dd:"%d ມື້",M:"1 ເດືອນ",MM:"%d ເດືອນ",y:"1 ປີ",yy:"%d ປີ"},dayOfMonthOrdinalParse:/(ທີ່)\d{1,2}/,ordinal:function(e){return"ທີ່"+e}})})(n(30381))},57010:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration -var t={ss:"sekundė_sekundžių_sekundes",m:"minutė_minutės_minutę",mm:"minutės_minučių_minutes",h:"valanda_valandos_valandą",hh:"valandos_valandų_valandas",d:"diena_dienos_dieną",dd:"dienos_dienų_dienas",M:"mėnuo_mėnesio_mėnesį",MM:"mėnesiai_mėnesių_mėnesius",y:"metai_metų_metus",yy:"metai_metų_metus"};function n(e,t,n,r){return t?"kelios sekundės":r?"kelių sekundžių":"kelias sekundes"}function r(e,t,n,r){return t?a(n)[0]:r?a(n)[1]:a(n)[2]}function i(e){return e%10==0||e>10&&e<20}function a(e){return t[e].split("_")}function o(e,t,n,o){var s=e+" ";return 1===e?s+r(e,t,n[0],o):t?s+(i(e)?a(n)[1]:a(n)[0]):o?s+a(n)[1]:s+(i(e)?a(n)[1]:a(n)[2])}return e.defineLocale("lt",{months:{format:"sausio_vasario_kovo_balandžio_gegužės_birželio_liepos_rugpjūčio_rugsėjo_spalio_lapkričio_gruodžio".split("_"),standalone:"sausis_vasaris_kovas_balandis_gegužė_birželis_liepa_rugpjūtis_rugsėjis_spalis_lapkritis_gruodis".split("_"),isFormat:/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?|MMMM?(\[[^\[\]]*\]|\s)+D[oD]?/},monthsShort:"sau_vas_kov_bal_geg_bir_lie_rgp_rgs_spa_lap_grd".split("_"),weekdays:{format:"sekmadienį_pirmadienį_antradienį_trečiadienį_ketvirtadienį_penktadienį_šeštadienį".split("_"),standalone:"sekmadienis_pirmadienis_antradienis_trečiadienis_ketvirtadienis_penktadienis_šeštadienis".split("_"),isFormat:/dddd HH:mm/},weekdaysShort:"Sek_Pir_Ant_Tre_Ket_Pen_Šeš".split("_"),weekdaysMin:"S_P_A_T_K_Pn_Š".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY [m.] MMMM D [d.]",LLL:"YYYY [m.] MMMM D [d.], HH:mm [val.]",LLLL:"YYYY [m.] MMMM D [d.], dddd, HH:mm [val.]",l:"YYYY-MM-DD",ll:"YYYY [m.] MMMM D [d.]",lll:"YYYY [m.] MMMM D [d.], HH:mm [val.]",llll:"YYYY [m.] MMMM D [d.], ddd, HH:mm [val.]"},calendar:{sameDay:"[Šiandien] LT",nextDay:"[Rytoj] LT",nextWeek:"dddd LT",lastDay:"[Vakar] LT",lastWeek:"[Praėjusį] dddd LT",sameElse:"L"},relativeTime:{future:"po %s",past:"prieš %s",s:n,ss:o,m:r,mm:o,h:r,hh:o,d:r,dd:o,M:r,MM:o,y:r,yy:o},dayOfMonthOrdinalParse:/\d{1,2}-oji/,ordinal:function(e){return e+"-oji"},week:{dow:1,doy:4}})})(n(30381))},37595:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration -var t={ss:"sekundes_sekundēm_sekunde_sekundes".split("_"),m:"minūtes_minūtēm_minūte_minūtes".split("_"),mm:"minūtes_minūtēm_minūte_minūtes".split("_"),h:"stundas_stundām_stunda_stundas".split("_"),hh:"stundas_stundām_stunda_stundas".split("_"),d:"dienas_dienām_diena_dienas".split("_"),dd:"dienas_dienām_diena_dienas".split("_"),M:"mēneša_mēnešiem_mēnesis_mēneši".split("_"),MM:"mēneša_mēnešiem_mēnesis_mēneši".split("_"),y:"gada_gadiem_gads_gadi".split("_"),yy:"gada_gadiem_gads_gadi".split("_")};function n(e,t,n){return n?t%10==1&&t%100!=11?e[2]:e[3]:t%10==1&&t%100!=11?e[0]:e[1]}function r(e,r,i){return e+" "+n(t[i],e,r)}function i(e,r,i){return n(t[i],e,r)}function a(e,t){return t?"dažas sekundes":"dažām sekundēm"}return e.defineLocale("lv",{months:"janvāris_februāris_marts_aprīlis_maijs_jūnijs_jūlijs_augusts_septembris_oktobris_novembris_decembris".split("_"),monthsShort:"jan_feb_mar_apr_mai_jūn_jūl_aug_sep_okt_nov_dec".split("_"),weekdays:"svētdiena_pirmdiena_otrdiena_trešdiena_ceturtdiena_piektdiena_sestdiena".split("_"),weekdaysShort:"Sv_P_O_T_C_Pk_S".split("_"),weekdaysMin:"Sv_P_O_T_C_Pk_S".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY.",LL:"YYYY. [gada] D. MMMM",LLL:"YYYY. [gada] D. MMMM, HH:mm",LLLL:"YYYY. [gada] D. MMMM, dddd, HH:mm"},calendar:{sameDay:"[Šodien pulksten] LT",nextDay:"[Rīt pulksten] LT",nextWeek:"dddd [pulksten] LT",lastDay:"[Vakar pulksten] LT",lastWeek:"[Pagājušā] dddd [pulksten] LT",sameElse:"L"},relativeTime:{future:"pēc %s",past:"pirms %s",s:a,ss:r,m:i,mm:r,h:i,hh:r,d:i,dd:r,M:i,MM:r,y:i,yy:r},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})})(n(30381))},39861:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration -var t={words:{ss:["sekund","sekunda","sekundi"],m:["jedan minut","jednog minuta"],mm:["minut","minuta","minuta"],h:["jedan sat","jednog sata"],hh:["sat","sata","sati"],dd:["dan","dana","dana"],MM:["mjesec","mjeseca","mjeseci"],yy:["godina","godine","godina"]},correctGrammaticalCase:function(e,t){return 1===e?t[0]:e>=2&&e<=4?t[1]:t[2]},translate:function(e,n,r){var i=t.words[r];return 1===r.length?n?i[0]:i[1]:e+" "+t.correctGrammaticalCase(e,i)}};return e.defineLocale("me",{months:"januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar".split("_"),monthsShort:"jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sjutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[juče u] LT",lastWeek:function(){return["[prošle] [nedjelje] [u] LT","[prošlog] [ponedjeljka] [u] LT","[prošlog] [utorka] [u] LT","[prošle] [srijede] [u] LT","[prošlog] [četvrtka] [u] LT","[prošlog] [petka] [u] LT","[prošle] [subote] [u] LT",][this.day()]},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"nekoliko sekundi",ss:t.translate,m:t.translate,mm:t.translate,h:t.translate,hh:t.translate,d:"dan",dd:t.translate,M:"mjesec",MM:t.translate,y:"godinu",yy:t.translate},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})})(n(30381))},35493:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("mi",{months:"Kohi-tāte_Hui-tanguru_Poutū-te-rangi_Paenga-whāwhā_Haratua_Pipiri_Hōngoingoi_Here-turi-kōkā_Mahuru_Whiringa-ā-nuku_Whiringa-ā-rangi_Hakihea".split("_"),monthsShort:"Kohi_Hui_Pou_Pae_Hara_Pipi_Hōngoi_Here_Mahu_Whi-nu_Whi-ra_Haki".split("_"),monthsRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,monthsStrictRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,monthsShortRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,monthsShortStrictRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,2}/i,weekdays:"Rātapu_Mane_Tūrei_Wenerei_Tāite_Paraire_Hātarei".split("_"),weekdaysShort:"Ta_Ma_Tū_We_Tāi_Pa_Hā".split("_"),weekdaysMin:"Ta_Ma_Tū_We_Tāi_Pa_Hā".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [i] HH:mm",LLLL:"dddd, D MMMM YYYY [i] HH:mm"},calendar:{sameDay:"[i teie mahana, i] LT",nextDay:"[apopo i] LT",nextWeek:"dddd [i] LT",lastDay:"[inanahi i] LT",lastWeek:"dddd [whakamutunga i] LT",sameElse:"L"},relativeTime:{future:"i roto i %s",past:"%s i mua",s:"te hēkona ruarua",ss:"%d hēkona",m:"he meneti",mm:"%d meneti",h:"te haora",hh:"%d haora",d:"he ra",dd:"%d ra",M:"he marama",MM:"%d marama",y:"he tau",yy:"%d tau"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%d\xba",week:{dow:1,doy:4}})})(n(30381))},95966:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("mk",{months:"јануари_февруари_март_април_мај_јуни_јули_август_септември_октомври_ноември_декември".split("_"),monthsShort:"јан_фев_мар_апр_мај_јун_јул_авг_сеп_окт_ное_дек".split("_"),weekdays:"недела_понеделник_вторник_среда_четврток_петок_сабота".split("_"),weekdaysShort:"нед_пон_вто_сре_чет_пет_саб".split("_"),weekdaysMin:"нe_пo_вт_ср_че_пе_сa".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[Денес во] LT",nextDay:"[Утре во] LT",nextWeek:"[Во] dddd [во] LT",lastDay:"[Вчера во] LT",lastWeek:function(){switch(this.day()){case 0:case 3:case 6:return"[Изминатата] dddd [во] LT";case 1:case 2:case 4:case 5:return"[Изминатиот] dddd [во] LT"}},sameElse:"L"},relativeTime:{future:"за %s",past:"пред %s",s:"неколку секунди",ss:"%d секунди",m:"една минута",mm:"%d минути",h:"еден час",hh:"%d часа",d:"еден ден",dd:"%d дена",M:"еден месец",MM:"%d месеци",y:"една година",yy:"%d години"},dayOfMonthOrdinalParse:/\d{1,2}-(ев|ен|ти|ви|ри|ми)/,ordinal:function(e){var t=e%10,n=e%100;if(0===e)return e+"-ев";if(0===n)return e+"-ен";if(n>10&&n<20)return e+"-ти";if(1===t)return e+"-ви";if(2===t)return e+"-ри";else if(7===t||8===t)return e+"-ми";else return e+"-ти"},week:{dow:1,doy:7}})})(n(30381))},87341:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("ml",{months:"ജനുവരി_ഫെബ്രുവരി_മാർച്ച്_ഏപ്രിൽ_മേയ്_ജൂൺ_ജൂലൈ_ഓഗസ്റ്റ്_സെപ്റ്റംബർ_ഒക്ടോബർ_നവംബർ_ഡിസംബർ".split("_"),monthsShort:"ജനു._ഫെബ്രു._മാർ._ഏപ്രി._മേയ്_ജൂൺ_ജൂലൈ._ഓഗ._സെപ്റ്റ._ഒക്ടോ._നവം._ഡിസം.".split("_"),monthsParseExact:!0,weekdays:"ഞായറാഴ്ച_തിങ്കളാഴ്ച_ചൊവ്വാഴ്ച_ബുധനാഴ്ച_വ്യാഴാഴ്ച_വെള്ളിയാഴ്ച_ശനിയാഴ്ച".split("_"),weekdaysShort:"ഞായർ_തിങ്കൾ_ചൊവ്വ_ബുധൻ_വ്യാഴം_വെള്ളി_ശനി".split("_"),weekdaysMin:"ഞാ_തി_ചൊ_ബു_വ്യാ_വെ_ശ".split("_"),longDateFormat:{LT:"A h:mm -നു",LTS:"A h:mm:ss -നു",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm -നു",LLLL:"dddd, D MMMM YYYY, A h:mm -നു"},calendar:{sameDay:"[ഇന്ന്] LT",nextDay:"[നാളെ] LT",nextWeek:"dddd, LT",lastDay:"[ഇന്നലെ] LT",lastWeek:"[കഴിഞ്ഞ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s കഴിഞ്ഞ്",past:"%s മുൻപ്",s:"അൽപ നിമിഷങ്ങൾ",ss:"%d സെക്കൻഡ്",m:"ഒരു മിനിറ്റ്",mm:"%d മിനിറ്റ്",h:"ഒരു മണിക്കൂർ",hh:"%d മണിക്കൂർ",d:"ഒരു ദിവസം",dd:"%d ദിവസം",M:"ഒരു മാസം",MM:"%d മാസം",y:"ഒരു വർഷം",yy:"%d വർഷം"},meridiemParse:/രാത്രി|രാവിലെ|ഉച്ച കഴിഞ്ഞ്|വൈകുന്നേരം|രാത്രി/i,meridiemHour:function(e,t){return(12===e&&(e=0),"രാത്രി"===t&&e>=4||"ഉച്ച കഴിഞ്ഞ്"===t||"വൈകുന്നേരം"===t)?e+12:e},meridiem:function(e,t,n){return e<4?"രാത്രി":e<12?"രാവിലെ":e<17?"ഉച്ച കഴിഞ്ഞ്":e<20?"വൈകുന്നേരം":"രാത്രി"}})})(n(30381))},5115:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration -function t(e,t,n,r){switch(n){case"s":return t?"хэдхэн секунд":"хэдхэн секундын";case"ss":return e+(t?" секунд":" секундын");case"m":case"mm":return e+(t?" минут":" минутын");case"h":case"hh":return e+(t?" цаг":" цагийн");case"d":case"dd":return e+(t?" өдөр":" өдрийн");case"M":case"MM":return e+(t?" сар":" сарын");case"y":case"yy":return e+(t?" жил":" жилийн");default:return e}}return e.defineLocale("mn",{months:"Нэгдүгээр сар_Хоёрдугаар сар_Гуравдугаар сар_Дөрөвдүгээр сар_Тавдугаар сар_Зургадугаар сар_Долдугаар сар_Наймдугаар сар_Есдүгээр сар_Аравдугаар сар_Арван нэгдүгээр сар_Арван хоёрдугаар сар".split("_"),monthsShort:"1 сар_2 сар_3 сар_4 сар_5 сар_6 сар_7 сар_8 сар_9 сар_10 сар_11 сар_12 сар".split("_"),monthsParseExact:!0,weekdays:"Ням_Даваа_Мягмар_Лхагва_Пүрэв_Баасан_Бямба".split("_"),weekdaysShort:"Ням_Дав_Мяг_Лха_Пүр_Баа_Бям".split("_"),weekdaysMin:"Ня_Да_Мя_Лх_Пү_Ба_Бя".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY оны MMMMын D",LLL:"YYYY оны MMMMын D HH:mm",LLLL:"dddd, YYYY оны MMMMын D HH:mm"},meridiemParse:/ҮӨ|ҮХ/i,isPM:function(e){return"ҮХ"===e},meridiem:function(e,t,n){return e<12?"ҮӨ":"ҮХ"},calendar:{sameDay:"[Өнөөдөр] LT",nextDay:"[Маргааш] LT",nextWeek:"[Ирэх] dddd LT",lastDay:"[Өчигдөр] LT",lastWeek:"[Өнгөрсөн] dddd LT",sameElse:"L"},relativeTime:{future:"%s дараа",past:"%s өмнө",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2} өдөр/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+" өдөр";default:return e}}})})(n(30381))},10370:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration -var t={1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"},n={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"};function r(e,t,n,r){var i="";if(t)switch(n){case"s":i="काही सेकंद";break;case"ss":i="%d सेकंद";break;case"m":i="एक मिनिट";break;case"mm":i="%d मिनिटे";break;case"h":i="एक तास";break;case"hh":i="%d तास";break;case"d":i="एक दिवस";break;case"dd":i="%d दिवस";break;case"M":i="एक महिना";break;case"MM":i="%d महिने";break;case"y":i="एक वर्ष";break;case"yy":i="%d वर्षे"}else switch(n){case"s":i="काही सेकंदां";break;case"ss":i="%d सेकंदां";break;case"m":i="एका मिनिटा";break;case"mm":i="%d मिनिटां";break;case"h":i="एका तासा";break;case"hh":i="%d तासां";break;case"d":i="एका दिवसा";break;case"dd":i="%d दिवसां";break;case"M":i="एका महिन्या";break;case"MM":i="%d महिन्यां";break;case"y":i="एका वर्षा";break;case"yy":i="%d वर्षां"}return i.replace(/%d/i,e)}return e.defineLocale("mr",{months:"जानेवारी_फेब्रुवारी_मार्च_एप्रिल_मे_जून_जुलै_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर".split("_"),monthsShort:"जाने._फेब्रु._मार्च._एप्रि._मे._जून._जुलै._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.".split("_"),monthsParseExact:!0,weekdays:"रविवार_सोमवार_मंगळवार_बुधवार_गुरूवार_शुक्रवार_शनिवार".split("_"),weekdaysShort:"रवि_सोम_मंगळ_बुध_गुरू_शुक्र_शनि".split("_"),weekdaysMin:"र_सो_मं_बु_गु_शु_श".split("_"),longDateFormat:{LT:"A h:mm वाजता",LTS:"A h:mm:ss वाजता",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm वाजता",LLLL:"dddd, D MMMM YYYY, A h:mm वाजता"},calendar:{sameDay:"[आज] LT",nextDay:"[उद्या] LT",nextWeek:"dddd, LT",lastDay:"[काल] LT",lastWeek:"[मागील] dddd, LT",sameElse:"L"},relativeTime:{future:"%sमध्ये",past:"%sपूर्वी",s:r,ss:r,m:r,mm:r,h:r,hh:r,d:r,dd:r,M:r,MM:r,y:r,yy:r},preparse:function(e){return e.replace(/[१२३४५६७८९०]/g,function(e){return n[e]})},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]})},meridiemParse:/पहाटे|सकाळी|दुपारी|सायंकाळी|रात्री/,meridiemHour:function(e,t){return(12===e&&(e=0),"पहाटे"===t||"सकाळी"===t)?e:"दुपारी"===t||"सायंकाळी"===t||"रात्री"===t?e>=12?e:e+12:void 0},meridiem:function(e,t,n){return e>=0&&e<6?"पहाटे":e<12?"सकाळी":e<17?"दुपारी":e<20?"सायंकाळी":"रात्री"},week:{dow:0,doy:6}})})(n(30381))},41237:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("ms-my",{months:"Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis".split("_"),weekdays:"Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu".split("_"),weekdaysShort:"Ahd_Isn_Sel_Rab_Kha_Jum_Sab".split("_"),weekdaysMin:"Ah_Is_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|tengahari|petang|malam/,meridiemHour:function(e,t){return(12===e&&(e=0),"pagi"===t)?e:"tengahari"===t?e>=11?e:e+12:"petang"===t||"malam"===t?e+12:void 0},meridiem:function(e,t,n){return e<11?"pagi":e<15?"tengahari":e<19?"petang":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Esok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kelmarin pukul] LT",lastWeek:"dddd [lepas pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lepas",s:"beberapa saat",ss:"%d saat",m:"seminit",mm:"%d minit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:1,doy:7}})})(n(30381))},9847:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("ms",{months:"Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis".split("_"),weekdays:"Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu".split("_"),weekdaysShort:"Ahd_Isn_Sel_Rab_Kha_Jum_Sab".split("_"),weekdaysMin:"Ah_Is_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|tengahari|petang|malam/,meridiemHour:function(e,t){return(12===e&&(e=0),"pagi"===t)?e:"tengahari"===t?e>=11?e:e+12:"petang"===t||"malam"===t?e+12:void 0},meridiem:function(e,t,n){return e<11?"pagi":e<15?"tengahari":e<19?"petang":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Esok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kelmarin pukul] LT",lastWeek:"dddd [lepas pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lepas",s:"beberapa saat",ss:"%d saat",m:"seminit",mm:"%d minit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:1,doy:7}})})(n(30381))},72126:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("mt",{months:"Jannar_Frar_Marzu_April_Mejju_Ġunju_Lulju_Awwissu_Settembru_Ottubru_Novembru_Diċembru".split("_"),monthsShort:"Jan_Fra_Mar_Apr_Mej_Ġun_Lul_Aww_Set_Ott_Nov_Diċ".split("_"),weekdays:"Il-Ħadd_It-Tnejn_It-Tlieta_L-Erbgħa_Il-Ħamis_Il-Ġimgħa_Is-Sibt".split("_"),weekdaysShort:"Ħad_Tne_Tli_Erb_Ħam_Ġim_Sib".split("_"),weekdaysMin:"Ħa_Tn_Tl_Er_Ħa_Ġi_Si".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Illum fil-]LT",nextDay:"[Għada fil-]LT",nextWeek:"dddd [fil-]LT",lastDay:"[Il-bieraħ fil-]LT",lastWeek:"dddd [li għadda] [fil-]LT",sameElse:"L"},relativeTime:{future:"f’ %s",past:"%s ilu",s:"ftit sekondi",ss:"%d sekondi",m:"minuta",mm:"%d minuti",h:"siegħa",hh:"%d siegħat",d:"ġurnata",dd:"%d ġranet",M:"xahar",MM:"%d xhur",y:"sena",yy:"%d sni"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%d\xba",week:{dow:1,doy:4}})})(n(30381))},56165:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration -var t={1:"၁",2:"၂",3:"၃",4:"၄",5:"၅",6:"၆",7:"၇",8:"၈",9:"၉",0:"၀"},n={"၁":"1","၂":"2","၃":"3","၄":"4","၅":"5","၆":"6","၇":"7","၈":"8","၉":"9","၀":"0"};return e.defineLocale("my",{months:"ဇန်နဝါရီ_ဖေဖော်ဝါရီ_မတ်_ဧပြီ_မေ_ဇွန်_ဇူလိုင်_သြဂုတ်_စက်တင်ဘာ_အောက်တိုဘာ_နိုဝင်ဘာ_ဒီဇင်ဘာ".split("_"),monthsShort:"ဇန်_ဖေ_မတ်_ပြီ_မေ_ဇွန်_လိုင်_သြ_စက်_အောက်_နို_ဒီ".split("_"),weekdays:"တနင်္ဂနွေ_တနင်္လာ_အင်္ဂါ_ဗုဒ္ဓဟူး_ကြာသပတေး_သောကြာ_စနေ".split("_"),weekdaysShort:"နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ".split("_"),weekdaysMin:"နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[ယနေ.] LT [မှာ]",nextDay:"[မနက်ဖြန်] LT [မှာ]",nextWeek:"dddd LT [မှာ]",lastDay:"[မနေ.က] LT [မှာ]",lastWeek:"[ပြီးခဲ့သော] dddd LT [မှာ]",sameElse:"L"},relativeTime:{future:"လာမည့် %s မှာ",past:"လွန်ခဲ့သော %s က",s:"စက္ကန်.အနည်းငယ်",ss:"%d စက္ကန့်",m:"တစ်မိနစ်",mm:"%d မိနစ်",h:"တစ်နာရီ",hh:"%d နာရီ",d:"တစ်ရက်",dd:"%d ရက်",M:"တစ်လ",MM:"%d လ",y:"တစ်နှစ်",yy:"%d နှစ်"},preparse:function(e){return e.replace(/[၁၂၃၄၅၆၇၈၉၀]/g,function(e){return n[e]})},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]})},week:{dow:1,doy:4}})})(n(30381))},64924:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("nb",{months:"januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan._feb._mars_apr._mai_juni_juli_aug._sep._okt._nov._des.".split("_"),monthsParseExact:!0,weekdays:"s\xf8ndag_mandag_tirsdag_onsdag_torsdag_fredag_l\xf8rdag".split("_"),weekdaysShort:"s\xf8._ma._ti._on._to._fr._l\xf8.".split("_"),weekdaysMin:"s\xf8_ma_ti_on_to_fr_l\xf8".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] HH:mm",LLLL:"dddd D. MMMM YYYY [kl.] HH:mm"},calendar:{sameDay:"[i dag kl.] LT",nextDay:"[i morgen kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[i g\xe5r kl.] LT",lastWeek:"[forrige] dddd [kl.] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"%s siden",s:"noen sekunder",ss:"%d sekunder",m:"ett minutt",mm:"%d minutter",h:"en time",hh:"%d timer",d:"en dag",dd:"%d dager",w:"en uke",ww:"%d uker",M:"en m\xe5ned",MM:"%d m\xe5neder",y:"ett \xe5r",yy:"%d \xe5r"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})})(n(30381))},16744:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration -var t={1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"},n={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"};return e.defineLocale("ne",{months:"जनवरी_फेब्रुवरी_मार्च_अप्रिल_मई_जुन_जुलाई_अगष्ट_सेप्टेम्बर_अक्टोबर_नोभेम्बर_डिसेम्बर".split("_"),monthsShort:"जन._फेब्रु._मार्च_अप्रि._मई_जुन_जुलाई._अग._सेप्ट._अक्टो._नोभे._डिसे.".split("_"),monthsParseExact:!0,weekdays:"आइतबार_सोमबार_मङ्गलबार_बुधबार_बिहिबार_शुक्रबार_शनिबार".split("_"),weekdaysShort:"आइत._सोम._मङ्गल._बुध._बिहि._शुक्र._शनि.".split("_"),weekdaysMin:"आ._सो._मं._बु._बि._शु._श.".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"Aको h:mm बजे",LTS:"Aको h:mm:ss बजे",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, Aको h:mm बजे",LLLL:"dddd, D MMMM YYYY, Aको h:mm बजे"},preparse:function(e){return e.replace(/[१२३४५६७८९०]/g,function(e){return n[e]})},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]})},meridiemParse:/राति|बिहान|दिउँसो|साँझ/,meridiemHour:function(e,t){return(12===e&&(e=0),"राति"===t)?e<4?e:e+12:"बिहान"===t?e:"दिउँसो"===t?e>=10?e:e+12:"साँझ"===t?e+12:void 0},meridiem:function(e,t,n){return e<3?"राति":e<12?"बिहान":e<16?"दिउँसो":e<20?"साँझ":"राति"},calendar:{sameDay:"[आज] LT",nextDay:"[भोलि] LT",nextWeek:"[आउँदो] dddd[,] LT",lastDay:"[हिजो] LT",lastWeek:"[गएको] dddd[,] LT",sameElse:"L"},relativeTime:{future:"%sमा",past:"%s अगाडि",s:"केही क्षण",ss:"%d सेकेण्ड",m:"एक मिनेट",mm:"%d मिनेट",h:"एक घण्टा",hh:"%d घण्टा",d:"एक दिन",dd:"%d दिन",M:"एक महिना",MM:"%d महिना",y:"एक बर्ष",yy:"%d बर्ष"},week:{dow:0,doy:6}})})(n(30381))},59814:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration -var t="jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.".split("_"),n="jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec".split("_"),r=[/^jan/i,/^feb/i,/^maart|mrt.?$/i,/^apr/i,/^mei$/i,/^jun[i.]?$/i,/^jul[i.]?$/i,/^aug/i,/^sep/i,/^okt/i,/^nov/i,/^dec/i,],i=/^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december|jan\.?|feb\.?|mrt\.?|apr\.?|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i;return e.defineLocale("nl-be",{months:"januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december".split("_"),monthsShort:function(e,r){return e?/-MMM-/.test(r)?n[e.month()]:t[e.month()]:t},monthsRegex:i,monthsShortRegex:i,monthsStrictRegex:/^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december)/i,monthsShortStrictRegex:/^(jan\.?|feb\.?|mrt\.?|apr\.?|mei|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i,monthsParse:r,longMonthsParse:r,shortMonthsParse:r,weekdays:"zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag".split("_"),weekdaysShort:"zo._ma._di._wo._do._vr._za.".split("_"),weekdaysMin:"zo_ma_di_wo_do_vr_za".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[vandaag om] LT",nextDay:"[morgen om] LT",nextWeek:"dddd [om] LT",lastDay:"[gisteren om] LT",lastWeek:"[afgelopen] dddd [om] LT",sameElse:"L"},relativeTime:{future:"over %s",past:"%s geleden",s:"een paar seconden",ss:"%d seconden",m:"\xe9\xe9n minuut",mm:"%d minuten",h:"\xe9\xe9n uur",hh:"%d uur",d:"\xe9\xe9n dag",dd:"%d dagen",M:"\xe9\xe9n maand",MM:"%d maanden",y:"\xe9\xe9n jaar",yy:"%d jaar"},dayOfMonthOrdinalParse:/\d{1,2}(ste|de)/,ordinal:function(e){return e+(1===e||8===e||e>=20?"ste":"de")},week:{dow:1,doy:4}})})(n(30381))},93901:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration -var t="jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.".split("_"),n="jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec".split("_"),r=[/^jan/i,/^feb/i,/^maart|mrt.?$/i,/^apr/i,/^mei$/i,/^jun[i.]?$/i,/^jul[i.]?$/i,/^aug/i,/^sep/i,/^okt/i,/^nov/i,/^dec/i,],i=/^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december|jan\.?|feb\.?|mrt\.?|apr\.?|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i;return e.defineLocale("nl",{months:"januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december".split("_"),monthsShort:function(e,r){return e?/-MMM-/.test(r)?n[e.month()]:t[e.month()]:t},monthsRegex:i,monthsShortRegex:i,monthsStrictRegex:/^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december)/i,monthsShortStrictRegex:/^(jan\.?|feb\.?|mrt\.?|apr\.?|mei|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i,monthsParse:r,longMonthsParse:r,shortMonthsParse:r,weekdays:"zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag".split("_"),weekdaysShort:"zo._ma._di._wo._do._vr._za.".split("_"),weekdaysMin:"zo_ma_di_wo_do_vr_za".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[vandaag om] LT",nextDay:"[morgen om] LT",nextWeek:"dddd [om] LT",lastDay:"[gisteren om] LT",lastWeek:"[afgelopen] dddd [om] LT",sameElse:"L"},relativeTime:{future:"over %s",past:"%s geleden",s:"een paar seconden",ss:"%d seconden",m:"\xe9\xe9n minuut",mm:"%d minuten",h:"\xe9\xe9n uur",hh:"%d uur",d:"\xe9\xe9n dag",dd:"%d dagen",w:"\xe9\xe9n week",ww:"%d weken",M:"\xe9\xe9n maand",MM:"%d maanden",y:"\xe9\xe9n jaar",yy:"%d jaar"},dayOfMonthOrdinalParse:/\d{1,2}(ste|de)/,ordinal:function(e){return e+(1===e||8===e||e>=20?"ste":"de")},week:{dow:1,doy:4}})})(n(30381))},83877:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("nn",{months:"januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan._feb._mars_apr._mai_juni_juli_aug._sep._okt._nov._des.".split("_"),monthsParseExact:!0,weekdays:"sundag_m\xe5ndag_tysdag_onsdag_torsdag_fredag_laurdag".split("_"),weekdaysShort:"su._m\xe5._ty._on._to._fr._lau.".split("_"),weekdaysMin:"su_m\xe5_ty_on_to_fr_la".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] H:mm",LLLL:"dddd D. MMMM YYYY [kl.] HH:mm"},calendar:{sameDay:"[I dag klokka] LT",nextDay:"[I morgon klokka] LT",nextWeek:"dddd [klokka] LT",lastDay:"[I g\xe5r klokka] LT",lastWeek:"[F\xf8reg\xe5ande] dddd [klokka] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"%s sidan",s:"nokre sekund",ss:"%d sekund",m:"eit minutt",mm:"%d minutt",h:"ein time",hh:"%d timar",d:"ein dag",dd:"%d dagar",w:"ei veke",ww:"%d veker",M:"ein m\xe5nad",MM:"%d m\xe5nader",y:"eit \xe5r",yy:"%d \xe5r"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})})(n(30381))},92135:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("oc-lnc",{months:{standalone:"geni\xe8r_febri\xe8r_mar\xe7_abril_mai_junh_julhet_agost_setembre_oct\xf2bre_novembre_decembre".split("_"),format:"de geni\xe8r_de febri\xe8r_de mar\xe7_d'abril_de mai_de junh_de julhet_d'agost_de setembre_d'oct\xf2bre_de novembre_de decembre".split("_"),isFormat:/D[oD]?(\s)+MMMM/},monthsShort:"gen._febr._mar\xe7_abr._mai_junh_julh._ago._set._oct._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"dimenge_diluns_dimars_dim\xe8cres_dij\xf2us_divendres_dissabte".split("_"),weekdaysShort:"dg._dl._dm._dc._dj._dv._ds.".split("_"),weekdaysMin:"dg_dl_dm_dc_dj_dv_ds".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM [de] YYYY",ll:"D MMM YYYY",LLL:"D MMMM [de] YYYY [a] H:mm",lll:"D MMM YYYY, H:mm",LLLL:"dddd D MMMM [de] YYYY [a] H:mm",llll:"ddd D MMM YYYY, H:mm"},calendar:{sameDay:"[u\xe8i a] LT",nextDay:"[deman a] LT",nextWeek:"dddd [a] LT",lastDay:"[i\xe8r a] LT",lastWeek:"dddd [passat a] LT",sameElse:"L"},relativeTime:{future:"d'aqu\xed %s",past:"fa %s",s:"unas segondas",ss:"%d segondas",m:"una minuta",mm:"%d minutas",h:"una ora",hh:"%d oras",d:"un jorn",dd:"%d jorns",M:"un mes",MM:"%d meses",y:"un an",yy:"%d ans"},dayOfMonthOrdinalParse:/\d{1,2}(r|n|t|è|a)/,ordinal:function(e,t){var n=1===e?"r":2===e?"n":3===e?"r":4===e?"t":"\xe8";return("w"===t||"W"===t)&&(n="a"),e+n},week:{dow:1,doy:4}})})(n(30381))},15858:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration -var t={1:"੧",2:"੨",3:"੩",4:"੪",5:"੫",6:"੬",7:"੭",8:"੮",9:"੯",0:"੦"},n={"੧":"1","੨":"2","੩":"3","੪":"4","੫":"5","੬":"6","੭":"7","੮":"8","੯":"9","੦":"0"};return e.defineLocale("pa-in",{months:"ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ".split("_"),monthsShort:"ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ".split("_"),weekdays:"ਐਤਵਾਰ_ਸੋਮਵਾਰ_ਮੰਗਲਵਾਰ_ਬੁਧਵਾਰ_ਵੀਰਵਾਰ_ਸ਼ੁੱਕਰਵਾਰ_ਸ਼ਨੀਚਰਵਾਰ".split("_"),weekdaysShort:"ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ".split("_"),weekdaysMin:"ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ".split("_"),longDateFormat:{LT:"A h:mm ਵਜੇ",LTS:"A h:mm:ss ਵਜੇ",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm ਵਜੇ",LLLL:"dddd, D MMMM YYYY, A h:mm ਵਜੇ"},calendar:{sameDay:"[ਅਜ] LT",nextDay:"[ਕਲ] LT",nextWeek:"[ਅਗਲਾ] dddd, LT",lastDay:"[ਕਲ] LT",lastWeek:"[ਪਿਛਲੇ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s ਵਿੱਚ",past:"%s ਪਿਛਲੇ",s:"ਕੁਝ ਸਕਿੰਟ",ss:"%d ਸਕਿੰਟ",m:"ਇਕ ਮਿੰਟ",mm:"%d ਮਿੰਟ",h:"ਇੱਕ ਘੰਟਾ",hh:"%d ਘੰਟੇ",d:"ਇੱਕ ਦਿਨ",dd:"%d ਦਿਨ",M:"ਇੱਕ ਮਹੀਨਾ",MM:"%d ਮਹੀਨੇ",y:"ਇੱਕ ਸਾਲ",yy:"%d ਸਾਲ"},preparse:function(e){return e.replace(/[੧੨੩੪੫੬੭੮੯੦]/g,function(e){return n[e]})},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]})},meridiemParse:/ਰਾਤ|ਸਵੇਰ|ਦੁਪਹਿਰ|ਸ਼ਾਮ/,meridiemHour:function(e,t){return(12===e&&(e=0),"ਰਾਤ"===t)?e<4?e:e+12:"ਸਵੇਰ"===t?e:"ਦੁਪਹਿਰ"===t?e>=10?e:e+12:"ਸ਼ਾਮ"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"ਰਾਤ":e<10?"ਸਵੇਰ":e<17?"ਦੁਪਹਿਰ":e<20?"ਸ਼ਾਮ":"ਰਾਤ"},week:{dow:0,doy:6}})})(n(30381))},64495:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration -var t="styczeń_luty_marzec_kwiecień_maj_czerwiec_lipiec_sierpień_wrzesień_październik_listopad_grudzień".split("_"),n="stycznia_lutego_marca_kwietnia_maja_czerwca_lipca_sierpnia_września_października_listopada_grudnia".split("_"),r=[/^sty/i,/^lut/i,/^mar/i,/^kwi/i,/^maj/i,/^cze/i,/^lip/i,/^sie/i,/^wrz/i,/^paź/i,/^lis/i,/^gru/i,];function i(e){return e%10<5&&e%10>1&&~~(e/10)%10!=1}function a(e,t,n){var r=e+" ";switch(n){case"ss":return r+(i(e)?"sekundy":"sekund");case"m":return t?"minuta":"minutę";case"mm":return r+(i(e)?"minuty":"minut");case"h":return t?"godzina":"godzinę";case"hh":return r+(i(e)?"godziny":"godzin");case"ww":return r+(i(e)?"tygodnie":"tygodni");case"MM":return r+(i(e)?"miesiące":"miesięcy");case"yy":return r+(i(e)?"lata":"lat")}}return e.defineLocale("pl",{months:function(e,r){return e?/D MMMM/.test(r)?n[e.month()]:t[e.month()]:t},monthsShort:"sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru".split("_"),monthsParse:r,longMonthsParse:r,shortMonthsParse:r,weekdays:"niedziela_poniedziałek_wtorek_środa_czwartek_piątek_sobota".split("_"),weekdaysShort:"ndz_pon_wt_śr_czw_pt_sob".split("_"),weekdaysMin:"Nd_Pn_Wt_Śr_Cz_Pt_So".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Dziś o] LT",nextDay:"[Jutro o] LT",nextWeek:function(){switch(this.day()){case 0:return"[W niedzielę o] LT";case 2:return"[We wtorek o] LT";case 3:return"[W środę o] LT";case 6:return"[W sobotę o] LT";default:return"[W] dddd [o] LT"}},lastDay:"[Wczoraj o] LT",lastWeek:function(){switch(this.day()){case 0:return"[W zeszłą niedzielę o] LT";case 3:return"[W zeszłą środę o] LT";case 6:return"[W zeszłą sobotę o] LT";default:return"[W zeszły] dddd [o] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"%s temu",s:"kilka sekund",ss:a,m:a,mm:a,h:a,hh:a,d:"1 dzień",dd:"%d dni",w:"tydzień",ww:a,M:"miesiąc",MM:a,y:"rok",yy:a},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})})(n(30381))},57971:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("pt-br",{months:"janeiro_fevereiro_mar\xe7o_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro".split("_"),monthsShort:"jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez".split("_"),weekdays:"domingo_segunda-feira_ter\xe7a-feira_quarta-feira_quinta-feira_sexta-feira_s\xe1bado".split("_"),weekdaysShort:"dom_seg_ter_qua_qui_sex_s\xe1b".split("_"),weekdaysMin:"do_2\xaa_3\xaa_4\xaa_5\xaa_6\xaa_s\xe1".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY [\xe0s] HH:mm",LLLL:"dddd, D [de] MMMM [de] YYYY [\xe0s] HH:mm"},calendar:{sameDay:"[Hoje \xe0s] LT",nextDay:"[Amanh\xe3 \xe0s] LT",nextWeek:"dddd [\xe0s] LT",lastDay:"[Ontem \xe0s] LT",lastWeek:function(){return 0===this.day()||6===this.day()?"[\xdaltimo] dddd [\xe0s] LT":"[\xdaltima] dddd [\xe0s] LT"},sameElse:"L"},relativeTime:{future:"em %s",past:"h\xe1 %s",s:"poucos segundos",ss:"%d segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",M:"um m\xeas",MM:"%d meses",y:"um ano",yy:"%d anos"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%d\xba",invalidDate:"Data inv\xe1lida"})})(n(30381))},89520:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("pt",{months:"janeiro_fevereiro_mar\xe7o_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro".split("_"),monthsShort:"jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez".split("_"),weekdays:"Domingo_Segunda-feira_Ter\xe7a-feira_Quarta-feira_Quinta-feira_Sexta-feira_S\xe1bado".split("_"),weekdaysShort:"Dom_Seg_Ter_Qua_Qui_Sex_S\xe1b".split("_"),weekdaysMin:"Do_2\xaa_3\xaa_4\xaa_5\xaa_6\xaa_S\xe1".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY HH:mm",LLLL:"dddd, D [de] MMMM [de] YYYY HH:mm"},calendar:{sameDay:"[Hoje \xe0s] LT",nextDay:"[Amanh\xe3 \xe0s] LT",nextWeek:"dddd [\xe0s] LT",lastDay:"[Ontem \xe0s] LT",lastWeek:function(){return 0===this.day()||6===this.day()?"[\xdaltimo] dddd [\xe0s] LT":"[\xdaltima] dddd [\xe0s] LT"},sameElse:"L"},relativeTime:{future:"em %s",past:"h\xe1 %s",s:"segundos",ss:"%d segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",w:"uma semana",ww:"%d semanas",M:"um m\xeas",MM:"%d meses",y:"um ano",yy:"%d anos"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%d\xba",week:{dow:1,doy:4}})})(n(30381))},96459:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration -function t(e,t,n){var r=" ";return(e%100>=20||e>=100&&e%100==0)&&(r=" de "),e+r+({ss:"secunde",mm:"minute",hh:"ore",dd:"zile",ww:"săptăm\xe2ni",MM:"luni",yy:"ani"})[n]}return e.defineLocale("ro",{months:"ianuarie_februarie_martie_aprilie_mai_iunie_iulie_august_septembrie_octombrie_noiembrie_decembrie".split("_"),monthsShort:"ian._feb._mart._apr._mai_iun._iul._aug._sept._oct._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"duminică_luni_marți_miercuri_joi_vineri_s\xe2mbătă".split("_"),weekdaysShort:"Dum_Lun_Mar_Mie_Joi_Vin_S\xe2m".split("_"),weekdaysMin:"Du_Lu_Ma_Mi_Jo_Vi_S\xe2".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[azi la] LT",nextDay:"[m\xe2ine la] LT",nextWeek:"dddd [la] LT",lastDay:"[ieri la] LT",lastWeek:"[fosta] dddd [la] LT",sameElse:"L"},relativeTime:{future:"peste %s",past:"%s \xeen urmă",s:"c\xe2teva secunde",ss:t,m:"un minut",mm:t,h:"o oră",hh:t,d:"o zi",dd:t,w:"o săptăm\xe2nă",ww:t,M:"o lună",MM:t,y:"un an",yy:t},week:{dow:1,doy:7}})})(n(30381))},21793:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration -function t(e,t){var n=e.split("_");return t%10==1&&t%100!=11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}function n(e,n,r){var i={ss:n?"секунда_секунды_секунд":"секунду_секунды_секунд",mm:n?"минута_минуты_минут":"минуту_минуты_минут",hh:"час_часа_часов",dd:"день_дня_дней",ww:"неделя_недели_недель",MM:"месяц_месяца_месяцев",yy:"год_года_лет"};return"m"===r?n?"минута":"минуту":e+" "+t(i[r],+e)}var r=[/^янв/i,/^фев/i,/^мар/i,/^апр/i,/^ма[йя]/i,/^июн/i,/^июл/i,/^авг/i,/^сен/i,/^окт/i,/^ноя/i,/^дек/i,];return e.defineLocale("ru",{months:{format:"января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря".split("_"),standalone:"январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_")},monthsShort:{format:"янв._февр._мар._апр._мая_июня_июля_авг._сент._окт._нояб._дек.".split("_"),standalone:"янв._февр._март_апр._май_июнь_июль_авг._сент._окт._нояб._дек.".split("_")},weekdays:{standalone:"воскресенье_понедельник_вторник_среда_четверг_пятница_суббота".split("_"),format:"воскресенье_понедельник_вторник_среду_четверг_пятницу_субботу".split("_"),isFormat:/\[ ?[Вв] ?(?:прошлую|следующую|эту)? ?] ?dddd/},weekdaysShort:"вс_пн_вт_ср_чт_пт_сб".split("_"),weekdaysMin:"вс_пн_вт_ср_чт_пт_сб".split("_"),monthsParse:r,longMonthsParse:r,shortMonthsParse:r,monthsRegex:/^(январ[ья]|янв\.?|феврал[ья]|февр?\.?|марта?|мар\.?|апрел[ья]|апр\.?|ма[йя]|июн[ья]|июн\.?|июл[ья]|июл\.?|августа?|авг\.?|сентябр[ья]|сент?\.?|октябр[ья]|окт\.?|ноябр[ья]|нояб?\.?|декабр[ья]|дек\.?)/i,monthsShortRegex:/^(январ[ья]|янв\.?|феврал[ья]|февр?\.?|марта?|мар\.?|апрел[ья]|апр\.?|ма[йя]|июн[ья]|июн\.?|июл[ья]|июл\.?|августа?|авг\.?|сентябр[ья]|сент?\.?|октябр[ья]|окт\.?|ноябр[ья]|нояб?\.?|декабр[ья]|дек\.?)/i,monthsStrictRegex:/^(январ[яь]|феврал[яь]|марта?|апрел[яь]|ма[яй]|июн[яь]|июл[яь]|августа?|сентябр[яь]|октябр[яь]|ноябр[яь]|декабр[яь])/i,monthsShortStrictRegex:/^(янв\.|февр?\.|мар[т.]|апр\.|ма[яй]|июн[ья.]|июл[ья.]|авг\.|сент?\.|окт\.|нояб?\.|дек\.)/i,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., H:mm",LLLL:"dddd, D MMMM YYYY г., H:mm"},calendar:{sameDay:"[Сегодня, в] LT",nextDay:"[Завтра, в] LT",lastDay:"[Вчера, в] LT",nextWeek:function(e){if(e.week()===this.week())return 2===this.day()?"[Во] dddd, [в] LT":"[В] dddd, [в] LT";switch(this.day()){case 0:return"[В следующее] dddd, [в] LT";case 1:case 2:case 4:return"[В следующий] dddd, [в] LT";case 3:case 5:case 6:return"[В следующую] dddd, [в] LT"}},lastWeek:function(e){if(e.week()===this.week())return 2===this.day()?"[Во] dddd, [в] LT":"[В] dddd, [в] LT";switch(this.day()){case 0:return"[В прошлое] dddd, [в] LT";case 1:case 2:case 4:return"[В прошлый] dddd, [в] LT";case 3:case 5:case 6:return"[В прошлую] dddd, [в] LT"}},sameElse:"L"},relativeTime:{future:"через %s",past:"%s назад",s:"несколько секунд",ss:n,m:n,mm:n,h:"час",hh:n,d:"день",dd:n,w:"неделя",ww:n,M:"месяц",MM:n,y:"год",yy:n},meridiemParse:/ночи|утра|дня|вечера/i,isPM:function(e){return/^(дня|вечера)$/.test(e)},meridiem:function(e,t,n){return e<4?"ночи":e<12?"утра":e<17?"дня":"вечера"},dayOfMonthOrdinalParse:/\d{1,2}-(й|го|я)/,ordinal:function(e,t){switch(t){case"M":case"d":case"DDD":return e+"-й";case"D":return e+"-го";case"w":case"W":return e+"-я";default:return e}},week:{dow:1,doy:4}})})(n(30381))},40950:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration -var t=["جنوري","فيبروري","مارچ","اپريل","مئي","جون","جولاءِ","آگسٽ","سيپٽمبر","آڪٽوبر","نومبر","ڊسمبر",],n=["آچر","سومر","اڱارو","اربع","خميس","جمع","ڇنڇر"];return e.defineLocale("sd",{months:t,monthsShort:t,weekdays:n,weekdaysShort:n,weekdaysMin:n,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd، D MMMM YYYY HH:mm"},meridiemParse:/صبح|شام/,isPM:function(e){return"شام"===e},meridiem:function(e,t,n){return e<12?"صبح":"شام"},calendar:{sameDay:"[اڄ] LT",nextDay:"[سڀاڻي] LT",nextWeek:"dddd [اڳين هفتي تي] LT",lastDay:"[ڪالهه] LT",lastWeek:"[گزريل هفتي] dddd [تي] LT",sameElse:"L"},relativeTime:{future:"%s پوء",past:"%s اڳ",s:"چند سيڪنڊ",ss:"%d سيڪنڊ",m:"هڪ منٽ",mm:"%d منٽ",h:"هڪ ڪلاڪ",hh:"%d ڪلاڪ",d:"هڪ ڏينهن",dd:"%d ڏينهن",M:"هڪ مهينو",MM:"%d مهينا",y:"هڪ سال",yy:"%d سال"},preparse:function(e){return e.replace(/،/g,",")},postformat:function(e){return e.replace(/,/g,"،")},week:{dow:1,doy:4}})})(n(30381))},10490:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("se",{months:"ođđajagem\xe1nnu_guovvam\xe1nnu_njukčam\xe1nnu_cuoŋom\xe1nnu_miessem\xe1nnu_geassem\xe1nnu_suoidnem\xe1nnu_borgem\xe1nnu_čakčam\xe1nnu_golggotm\xe1nnu_sk\xe1bmam\xe1nnu_juovlam\xe1nnu".split("_"),monthsShort:"ođđj_guov_njuk_cuo_mies_geas_suoi_borg_čakč_golg_sk\xe1b_juov".split("_"),weekdays:"sotnabeaivi_vuoss\xe1rga_maŋŋeb\xe1rga_gaskavahkku_duorastat_bearjadat_l\xe1vvardat".split("_"),weekdaysShort:"sotn_vuos_maŋ_gask_duor_bear_l\xe1v".split("_"),weekdaysMin:"s_v_m_g_d_b_L".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"MMMM D. [b.] YYYY",LLL:"MMMM D. [b.] YYYY [ti.] HH:mm",LLLL:"dddd, MMMM D. [b.] YYYY [ti.] HH:mm"},calendar:{sameDay:"[otne ti] LT",nextDay:"[ihttin ti] LT",nextWeek:"dddd [ti] LT",lastDay:"[ikte ti] LT",lastWeek:"[ovddit] dddd [ti] LT",sameElse:"L"},relativeTime:{future:"%s geažes",past:"maŋit %s",s:"moadde sekunddat",ss:"%d sekunddat",m:"okta minuhta",mm:"%d minuhtat",h:"okta diimmu",hh:"%d diimmut",d:"okta beaivi",dd:"%d beaivvit",M:"okta m\xe1nnu",MM:"%d m\xe1nut",y:"okta jahki",yy:"%d jagit"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})})(n(30381))},90124:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("si",{months:"ජනවාරි_පෙබරවාරි_මාර්තු_අප්‍රේල්_මැයි_ජූනි_ජූලි_අගෝස්තු_සැප්තැම්බර්_ඔක්තෝබර්_නොවැම්බර්_දෙසැම්බර්".split("_"),monthsShort:"ජන_පෙබ_මාර්_අප්_මැයි_ජූනි_ජූලි_අගෝ_සැප්_ඔක්_නොවැ_දෙසැ".split("_"),weekdays:"ඉරිදා_සඳුදා_අඟහරුවාදා_බදාදා_බ්‍රහස්පතින්දා_සිකුරාදා_සෙනසුරාදා".split("_"),weekdaysShort:"ඉරි_සඳු_අඟ_බදා_බ්‍රහ_සිකු_සෙන".split("_"),weekdaysMin:"ඉ_ස_අ_බ_බ්‍ර_සි_සෙ".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"a h:mm",LTS:"a h:mm:ss",L:"YYYY/MM/DD",LL:"YYYY MMMM D",LLL:"YYYY MMMM D, a h:mm",LLLL:"YYYY MMMM D [වැනි] dddd, a h:mm:ss"},calendar:{sameDay:"[අද] LT[ට]",nextDay:"[හෙට] LT[ට]",nextWeek:"dddd LT[ට]",lastDay:"[ඊයේ] LT[ට]",lastWeek:"[පසුගිය] dddd LT[ට]",sameElse:"L"},relativeTime:{future:"%sකින්",past:"%sකට පෙර",s:"තත්පර කිහිපය",ss:"තත්පර %d",m:"මිනිත්තුව",mm:"මිනිත්තු %d",h:"පැය",hh:"පැය %d",d:"දිනය",dd:"දින %d",M:"මාසය",MM:"මාස %d",y:"වසර",yy:"වසර %d"},dayOfMonthOrdinalParse:/\d{1,2} වැනි/,ordinal:function(e){return e+" වැනි"},meridiemParse:/පෙර වරු|පස් වරු|පෙ.ව|ප.ව./,isPM:function(e){return"ප.ව."===e||"පස් වරු"===e},meridiem:function(e,t,n){return e>11?n?"ප.ව.":"පස් වරු":n?"පෙ.ව.":"පෙර වරු"}})})(n(30381))},64249:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration -var t="janu\xe1r_febru\xe1r_marec_apr\xedl_m\xe1j_j\xfan_j\xfal_august_september_okt\xf3ber_november_december".split("_"),n="jan_feb_mar_apr_m\xe1j_j\xfan_j\xfal_aug_sep_okt_nov_dec".split("_");function r(e){return e>1&&e<5}function i(e,t,n,i){var a=e+" ";switch(n){case"s":return t||i?"p\xe1r sek\xfand":"p\xe1r sekundami";case"ss":if(t||i)return a+(r(e)?"sekundy":"sek\xfand");return a+"sekundami";case"m":return t?"min\xfata":i?"min\xfatu":"min\xfatou";case"mm":if(t||i)return a+(r(e)?"min\xfaty":"min\xfat");return a+"min\xfatami";case"h":return t?"hodina":i?"hodinu":"hodinou";case"hh":if(t||i)return a+(r(e)?"hodiny":"hod\xedn");return a+"hodinami";case"d":return t||i?"deň":"dňom";case"dd":if(t||i)return a+(r(e)?"dni":"dn\xed");return a+"dňami";case"M":return t||i?"mesiac":"mesiacom";case"MM":if(t||i)return a+(r(e)?"mesiace":"mesiacov");return a+"mesiacmi";case"y":return t||i?"rok":"rokom";case"yy":if(t||i)return a+(r(e)?"roky":"rokov");return a+"rokmi"}}return e.defineLocale("sk",{months:t,monthsShort:n,weekdays:"nedeľa_pondelok_utorok_streda_štvrtok_piatok_sobota".split("_"),weekdaysShort:"ne_po_ut_st_št_pi_so".split("_"),weekdaysMin:"ne_po_ut_st_št_pi_so".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd D. MMMM YYYY H:mm"},calendar:{sameDay:"[dnes o] LT",nextDay:"[zajtra o] LT",nextWeek:function(){switch(this.day()){case 0:return"[v nedeľu o] LT";case 1:case 2:return"[v] dddd [o] LT";case 3:return"[v stredu o] LT";case 4:return"[vo štvrtok o] LT";case 5:return"[v piatok o] LT";case 6:return"[v sobotu o] LT"}},lastDay:"[včera o] LT",lastWeek:function(){switch(this.day()){case 0:return"[minul\xfa nedeľu o] LT";case 1:case 2:case 4:case 5:return"[minul\xfd] dddd [o] LT";case 3:return"[minul\xfa stredu o] LT";case 6:return"[minul\xfa sobotu o] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"pred %s",s:i,ss:i,m:i,mm:i,h:i,hh:i,d:i,dd:i,M:i,MM:i,y:i,yy:i},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})})(n(30381))},14985:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration -function t(e,t,n,r){var i=e+" ";switch(n){case"s":return t||r?"nekaj sekund":"nekaj sekundami";case"ss":return 1===e?i+=t?"sekundo":"sekundi":2===e?i+=t||r?"sekundi":"sekundah":e<5?i+=t||r?"sekunde":"sekundah":i+="sekund",i;case"m":return t?"ena minuta":"eno minuto";case"mm":return 1===e?i+=t?"minuta":"minuto":2===e?i+=t||r?"minuti":"minutama":e<5?i+=t||r?"minute":"minutami":i+=t||r?"minut":"minutami",i;case"h":return t?"ena ura":"eno uro";case"hh":return 1===e?i+=t?"ura":"uro":2===e?i+=t||r?"uri":"urama":e<5?i+=t||r?"ure":"urami":i+=t||r?"ur":"urami",i;case"d":return t||r?"en dan":"enim dnem";case"dd":return 1===e?i+=t||r?"dan":"dnem":2===e?i+=t||r?"dni":"dnevoma":i+=t||r?"dni":"dnevi",i;case"M":return t||r?"en mesec":"enim mesecem";case"MM":return 1===e?i+=t||r?"mesec":"mesecem":2===e?i+=t||r?"meseca":"mesecema":e<5?i+=t||r?"mesece":"meseci":i+=t||r?"mesecev":"meseci",i;case"y":return t||r?"eno leto":"enim letom";case"yy":return 1===e?i+=t||r?"leto":"letom":2===e?i+=t||r?"leti":"letoma":e<5?i+=t||r?"leta":"leti":i+=t||r?"let":"leti",i}}return e.defineLocale("sl",{months:"januar_februar_marec_april_maj_junij_julij_avgust_september_oktober_november_december".split("_"),monthsShort:"jan._feb._mar._apr._maj._jun._jul._avg._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedelja_ponedeljek_torek_sreda_četrtek_petek_sobota".split("_"),weekdaysShort:"ned._pon._tor._sre._čet._pet._sob.".split("_"),weekdaysMin:"ne_po_to_sr_če_pe_so".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD. MM. YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danes ob] LT",nextDay:"[jutri ob] LT",nextWeek:function(){switch(this.day()){case 0:return"[v] [nedeljo] [ob] LT";case 3:return"[v] [sredo] [ob] LT";case 6:return"[v] [soboto] [ob] LT";case 1:case 2:case 4:case 5:return"[v] dddd [ob] LT"}},lastDay:"[včeraj ob] LT",lastWeek:function(){switch(this.day()){case 0:return"[prejšnjo] [nedeljo] [ob] LT";case 3:return"[prejšnjo] [sredo] [ob] LT";case 6:return"[prejšnjo] [soboto] [ob] LT";case 1:case 2:case 4:case 5:return"[prejšnji] dddd [ob] LT"}},sameElse:"L"},relativeTime:{future:"čez %s",past:"pred %s",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})})(n(30381))},51104:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("sq",{months:"Janar_Shkurt_Mars_Prill_Maj_Qershor_Korrik_Gusht_Shtator_Tetor_N\xebntor_Dhjetor".split("_"),monthsShort:"Jan_Shk_Mar_Pri_Maj_Qer_Kor_Gus_Sht_Tet_N\xebn_Dhj".split("_"),weekdays:"E Diel_E H\xebn\xeb_E Mart\xeb_E M\xebrkur\xeb_E Enjte_E Premte_E Shtun\xeb".split("_"),weekdaysShort:"Die_H\xebn_Mar_M\xebr_Enj_Pre_Sht".split("_"),weekdaysMin:"D_H_Ma_M\xeb_E_P_Sh".split("_"),weekdaysParseExact:!0,meridiemParse:/PD|MD/,isPM:function(e){return"M"===e.charAt(0)},meridiem:function(e,t,n){return e<12?"PD":"MD"},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Sot n\xeb] LT",nextDay:"[Nes\xebr n\xeb] LT",nextWeek:"dddd [n\xeb] LT",lastDay:"[Dje n\xeb] LT",lastWeek:"dddd [e kaluar n\xeb] LT",sameElse:"L"},relativeTime:{future:"n\xeb %s",past:"%s m\xeb par\xeb",s:"disa sekonda",ss:"%d sekonda",m:"nj\xeb minut\xeb",mm:"%d minuta",h:"nj\xeb or\xeb",hh:"%d or\xeb",d:"nj\xeb dit\xeb",dd:"%d dit\xeb",M:"nj\xeb muaj",MM:"%d muaj",y:"nj\xeb vit",yy:"%d vite"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})})(n(30381))},79915:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration -var t={words:{ss:["секунда","секунде","секунди"],m:["један минут","једне минуте"],mm:["минут","минуте","минута"],h:["један сат","једног сата"],hh:["сат","сата","сати"],dd:["дан","дана","дана"],MM:["месец","месеца","месеци"],yy:["година","године","година"]},correctGrammaticalCase:function(e,t){return 1===e?t[0]:e>=2&&e<=4?t[1]:t[2]},translate:function(e,n,r){var i=t.words[r];return 1===r.length?n?i[0]:i[1]:e+" "+t.correctGrammaticalCase(e,i)}};return e.defineLocale("sr-cyrl",{months:"јануар_фебруар_март_април_мај_јун_јул_август_септембар_октобар_новембар_децембар".split("_"),monthsShort:"јан._феб._мар._апр._мај_јун_јул_авг._сеп._окт._нов._дец.".split("_"),monthsParseExact:!0,weekdays:"недеља_понедељак_уторак_среда_четвртак_петак_субота".split("_"),weekdaysShort:"нед._пон._уто._сре._чет._пет._суб.".split("_"),weekdaysMin:"не_по_ут_ср_че_пе_су".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D. M. YYYY.",LL:"D. MMMM YYYY.",LLL:"D. MMMM YYYY. H:mm",LLLL:"dddd, D. MMMM YYYY. H:mm"},calendar:{sameDay:"[данас у] LT",nextDay:"[сутра у] LT",nextWeek:function(){switch(this.day()){case 0:return"[у] [недељу] [у] LT";case 3:return"[у] [среду] [у] LT";case 6:return"[у] [суботу] [у] LT";case 1:case 2:case 4:case 5:return"[у] dddd [у] LT"}},lastDay:"[јуче у] LT",lastWeek:function(){return["[прошле] [недеље] [у] LT","[прошлог] [понедељка] [у] LT","[прошлог] [уторка] [у] LT","[прошле] [среде] [у] LT","[прошлог] [четвртка] [у] LT","[прошлог] [петка] [у] LT","[прошле] [суботе] [у] LT",][this.day()]},sameElse:"L"},relativeTime:{future:"за %s",past:"пре %s",s:"неколико секунди",ss:t.translate,m:t.translate,mm:t.translate,h:t.translate,hh:t.translate,d:"дан",dd:t.translate,M:"месец",MM:t.translate,y:"годину",yy:t.translate},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})})(n(30381))},49131:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration -var t={words:{ss:["sekunda","sekunde","sekundi"],m:["jedan minut","jedne minute"],mm:["minut","minute","minuta"],h:["jedan sat","jednog sata"],hh:["sat","sata","sati"],dd:["dan","dana","dana"],MM:["mesec","meseca","meseci"],yy:["godina","godine","godina"]},correctGrammaticalCase:function(e,t){return 1===e?t[0]:e>=2&&e<=4?t[1]:t[2]},translate:function(e,n,r){var i=t.words[r];return 1===r.length?n?i[0]:i[1]:e+" "+t.correctGrammaticalCase(e,i)}};return e.defineLocale("sr",{months:"januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar".split("_"),monthsShort:"jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedelja_ponedeljak_utorak_sreda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sre._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D. M. YYYY.",LL:"D. MMMM YYYY.",LLL:"D. MMMM YYYY. H:mm",LLLL:"dddd, D. MMMM YYYY. H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedelju] [u] LT";case 3:return"[u] [sredu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[juče u] LT",lastWeek:function(){return["[prošle] [nedelje] [u] LT","[prošlog] [ponedeljka] [u] LT","[prošlog] [utorka] [u] LT","[prošle] [srede] [u] LT","[prošlog] [četvrtka] [u] LT","[prošlog] [petka] [u] LT","[prošle] [subote] [u] LT",][this.day()]},sameElse:"L"},relativeTime:{future:"za %s",past:"pre %s",s:"nekoliko sekundi",ss:t.translate,m:t.translate,mm:t.translate,h:t.translate,hh:t.translate,d:"dan",dd:t.translate,M:"mesec",MM:t.translate,y:"godinu",yy:t.translate},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})})(n(30381))},85893:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("ss",{months:"Bhimbidvwane_Indlovana_Indlov'lenkhulu_Mabasa_Inkhwekhweti_Inhlaba_Kholwane_Ingci_Inyoni_Imphala_Lweti_Ingongoni".split("_"),monthsShort:"Bhi_Ina_Inu_Mab_Ink_Inh_Kho_Igc_Iny_Imp_Lwe_Igo".split("_"),weekdays:"Lisontfo_Umsombuluko_Lesibili_Lesitsatfu_Lesine_Lesihlanu_Umgcibelo".split("_"),weekdaysShort:"Lis_Umb_Lsb_Les_Lsi_Lsh_Umg".split("_"),weekdaysMin:"Li_Us_Lb_Lt_Ls_Lh_Ug".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Namuhla nga] LT",nextDay:"[Kusasa nga] LT",nextWeek:"dddd [nga] LT",lastDay:"[Itolo nga] LT",lastWeek:"dddd [leliphelile] [nga] LT",sameElse:"L"},relativeTime:{future:"nga %s",past:"wenteka nga %s",s:"emizuzwana lomcane",ss:"%d mzuzwana",m:"umzuzu",mm:"%d emizuzu",h:"lihora",hh:"%d emahora",d:"lilanga",dd:"%d emalanga",M:"inyanga",MM:"%d tinyanga",y:"umnyaka",yy:"%d iminyaka"},meridiemParse:/ekuseni|emini|entsambama|ebusuku/,meridiem:function(e,t,n){return e<11?"ekuseni":e<15?"emini":e<19?"entsambama":"ebusuku"},meridiemHour:function(e,t){return(12===e&&(e=0),"ekuseni"===t)?e:"emini"===t?e>=11?e:e+12:"entsambama"===t||"ebusuku"===t?0===e?0:e+12:void 0},dayOfMonthOrdinalParse:/\d{1,2}/,ordinal:"%d",week:{dow:1,doy:4}})})(n(30381))},98760:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("sv",{months:"januari_februari_mars_april_maj_juni_juli_augusti_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"),weekdays:"s\xf6ndag_m\xe5ndag_tisdag_onsdag_torsdag_fredag_l\xf6rdag".split("_"),weekdaysShort:"s\xf6n_m\xe5n_tis_ons_tor_fre_l\xf6r".split("_"),weekdaysMin:"s\xf6_m\xe5_ti_on_to_fr_l\xf6".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [kl.] HH:mm",LLLL:"dddd D MMMM YYYY [kl.] HH:mm",lll:"D MMM YYYY HH:mm",llll:"ddd D MMM YYYY HH:mm"},calendar:{sameDay:"[Idag] LT",nextDay:"[Imorgon] LT",lastDay:"[Ig\xe5r] LT",nextWeek:"[P\xe5] dddd LT",lastWeek:"[I] dddd[s] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"f\xf6r %s sedan",s:"n\xe5gra sekunder",ss:"%d sekunder",m:"en minut",mm:"%d minuter",h:"en timme",hh:"%d timmar",d:"en dag",dd:"%d dagar",M:"en m\xe5nad",MM:"%d m\xe5nader",y:"ett \xe5r",yy:"%d \xe5r"},dayOfMonthOrdinalParse:/\d{1,2}(\:e|\:a)/,ordinal:function(e){var t=e%10,n=1==~~(e%100/10)?":e":1===t?":a":2===t?":a":":e";return e+n},week:{dow:1,doy:4}})})(n(30381))},91172:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("sw",{months:"Januari_Februari_Machi_Aprili_Mei_Juni_Julai_Agosti_Septemba_Oktoba_Novemba_Desemba".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ago_Sep_Okt_Nov_Des".split("_"),weekdays:"Jumapili_Jumatatu_Jumanne_Jumatano_Alhamisi_Ijumaa_Jumamosi".split("_"),weekdaysShort:"Jpl_Jtat_Jnne_Jtan_Alh_Ijm_Jmos".split("_"),weekdaysMin:"J2_J3_J4_J5_Al_Ij_J1".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"hh:mm A",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[leo saa] LT",nextDay:"[kesho saa] LT",nextWeek:"[wiki ijayo] dddd [saat] LT",lastDay:"[jana] LT",lastWeek:"[wiki iliyopita] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s baadaye",past:"tokea %s",s:"hivi punde",ss:"sekunde %d",m:"dakika moja",mm:"dakika %d",h:"saa limoja",hh:"masaa %d",d:"siku moja",dd:"siku %d",M:"mwezi mmoja",MM:"miezi %d",y:"mwaka mmoja",yy:"miaka %d"},week:{dow:1,doy:7}})})(n(30381))},27333:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration -var t={1:"௧",2:"௨",3:"௩",4:"௪",5:"௫",6:"௬",7:"௭",8:"௮",9:"௯",0:"௦"},n={"௧":"1","௨":"2","௩":"3","௪":"4","௫":"5","௬":"6","௭":"7","௮":"8","௯":"9","௦":"0"};return e.defineLocale("ta",{months:"ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்".split("_"),monthsShort:"ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்".split("_"),weekdays:"ஞாயிற்றுக்கிழமை_திங்கட்கிழமை_செவ்வாய்கிழமை_புதன்கிழமை_வியாழக்கிழமை_வெள்ளிக்கிழமை_சனிக்கிழமை".split("_"),weekdaysShort:"ஞாயிறு_திங்கள்_செவ்வாய்_புதன்_வியாழன்_வெள்ளி_சனி".split("_"),weekdaysMin:"ஞா_தி_செ_பு_வி_வெ_ச".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, HH:mm",LLLL:"dddd, D MMMM YYYY, HH:mm"},calendar:{sameDay:"[இன்று] LT",nextDay:"[நாளை] LT",nextWeek:"dddd, LT",lastDay:"[நேற்று] LT",lastWeek:"[கடந்த வாரம்] dddd, LT",sameElse:"L"},relativeTime:{future:"%s இல்",past:"%s முன்",s:"ஒரு சில விநாடிகள்",ss:"%d விநாடிகள்",m:"ஒரு நிமிடம்",mm:"%d நிமிடங்கள்",h:"ஒரு மணி நேரம்",hh:"%d மணி நேரம்",d:"ஒரு நாள்",dd:"%d நாட்கள்",M:"ஒரு மாதம்",MM:"%d மாதங்கள்",y:"ஒரு வருடம்",yy:"%d ஆண்டுகள்"},dayOfMonthOrdinalParse:/\d{1,2}வது/,ordinal:function(e){return e+"வது"},preparse:function(e){return e.replace(/[௧௨௩௪௫௬௭௮௯௦]/g,function(e){return n[e]})},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]})},meridiemParse:/யாமம்|வைகறை|காலை|நண்பகல்|எற்பாடு|மாலை/,meridiem:function(e,t,n){if(e<2)return" யாமம்";if(e<6)return" வைகறை";if(e<10)return" காலை";if(e<14)return" நண்பகல்";if(e<18)return" எற்பாடு";else if(e<22)return" மாலை";else return" யாமம்"},meridiemHour:function(e,t){return(12===e&&(e=0),"யாமம்"===t)?e<2?e:e+12:"வைகறை"===t||"காலை"===t?e:"நண்பகல்"===t?e>=10?e:e+12:e+12},week:{dow:0,doy:6}})})(n(30381))},23110:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("te",{months:"జనవరి_ఫిబ్రవరి_మార్చి_ఏప్రిల్_మే_జూన్_జులై_ఆగస్టు_సెప్టెంబర్_అక్టోబర్_నవంబర్_డిసెంబర్".split("_"),monthsShort:"జన._ఫిబ్ర._మార్చి_ఏప్రి._మే_జూన్_జులై_ఆగ._సెప్._అక్టో._నవ._డిసె.".split("_"),monthsParseExact:!0,weekdays:"ఆదివారం_సోమవారం_మంగళవారం_బుధవారం_గురువారం_శుక్రవారం_శనివారం".split("_"),weekdaysShort:"ఆది_సోమ_మంగళ_బుధ_గురు_శుక్ర_శని".split("_"),weekdaysMin:"ఆ_సో_మం_బు_గు_శు_శ".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},calendar:{sameDay:"[నేడు] LT",nextDay:"[రేపు] LT",nextWeek:"dddd, LT",lastDay:"[నిన్న] LT",lastWeek:"[గత] dddd, LT",sameElse:"L"},relativeTime:{future:"%s లో",past:"%s క్రితం",s:"కొన్ని క్షణాలు",ss:"%d సెకన్లు",m:"ఒక నిమిషం",mm:"%d నిమిషాలు",h:"ఒక గంట",hh:"%d గంటలు",d:"ఒక రోజు",dd:"%d రోజులు",M:"ఒక నెల",MM:"%d నెలలు",y:"ఒక సంవత్సరం",yy:"%d సంవత్సరాలు"},dayOfMonthOrdinalParse:/\d{1,2}వ/,ordinal:"%dవ",meridiemParse:/రాత్రి|ఉదయం|మధ్యాహ్నం|సాయంత్రం/,meridiemHour:function(e,t){return(12===e&&(e=0),"రాత్రి"===t)?e<4?e:e+12:"ఉదయం"===t?e:"మధ్యాహ్నం"===t?e>=10?e:e+12:"సాయంత్రం"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"రాత్రి":e<10?"ఉదయం":e<17?"మధ్యాహ్నం":e<20?"సాయంత్రం":"రాత్రి"},week:{dow:0,doy:6}})})(n(30381))},52095:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("tet",{months:"Janeiru_Fevereiru_Marsu_Abril_Maiu_Ju\xf1u_Jullu_Agustu_Setembru_Outubru_Novembru_Dezembru".split("_"),monthsShort:"Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez".split("_"),weekdays:"Domingu_Segunda_Tersa_Kuarta_Kinta_Sesta_Sabadu".split("_"),weekdaysShort:"Dom_Seg_Ters_Kua_Kint_Sest_Sab".split("_"),weekdaysMin:"Do_Seg_Te_Ku_Ki_Ses_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Ohin iha] LT",nextDay:"[Aban iha] LT",nextWeek:"dddd [iha] LT",lastDay:"[Horiseik iha] LT",lastWeek:"dddd [semana kotuk] [iha] LT",sameElse:"L"},relativeTime:{future:"iha %s",past:"%s liuba",s:"segundu balun",ss:"segundu %d",m:"minutu ida",mm:"minutu %d",h:"oras ida",hh:"oras %d",d:"loron ida",dd:"loron %d",M:"fulan ida",MM:"fulan %d",y:"tinan ida",yy:"tinan %d"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10,n=1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th";return e+n},week:{dow:1,doy:4}})})(n(30381))},27321:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration -var t={0:"-ум",1:"-ум",2:"-юм",3:"-юм",4:"-ум",5:"-ум",6:"-ум",7:"-ум",8:"-ум",9:"-ум",10:"-ум",12:"-ум",13:"-ум",20:"-ум",30:"-юм",40:"-ум",50:"-ум",60:"-ум",70:"-ум",80:"-ум",90:"-ум",100:"-ум"};return e.defineLocale("tg",{months:{format:"январи_феврали_марти_апрели_майи_июни_июли_августи_сентябри_октябри_ноябри_декабри".split("_"),standalone:"январ_феврал_март_апрел_май_июн_июл_август_сентябр_октябр_ноябр_декабр".split("_")},monthsShort:"янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек".split("_"),weekdays:"якшанбе_душанбе_сешанбе_чоршанбе_панҷшанбе_ҷумъа_шанбе".split("_"),weekdaysShort:"яшб_дшб_сшб_чшб_пшб_ҷум_шнб".split("_"),weekdaysMin:"яш_дш_сш_чш_пш_ҷм_шб".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Имрӯз соати] LT",nextDay:"[Фардо соати] LT",lastDay:"[Дирӯз соати] LT",nextWeek:"dddd[и] [ҳафтаи оянда соати] LT",lastWeek:"dddd[и] [ҳафтаи гузашта соати] LT",sameElse:"L"},relativeTime:{future:"баъди %s",past:"%s пеш",s:"якчанд сония",m:"як дақиқа",mm:"%d дақиқа",h:"як соат",hh:"%d соат",d:"як рӯз",dd:"%d рӯз",M:"як моҳ",MM:"%d моҳ",y:"як сол",yy:"%d сол"},meridiemParse:/шаб|субҳ|рӯз|бегоҳ/,meridiemHour:function(e,t){return(12===e&&(e=0),"шаб"===t)?e<4?e:e+12:"субҳ"===t?e:"рӯз"===t?e>=11?e:e+12:"бегоҳ"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"шаб":e<11?"субҳ":e<16?"рӯз":e<19?"бегоҳ":"шаб"},dayOfMonthOrdinalParse:/\d{1,2}-(ум|юм)/,ordinal:function(e){var n=e%10,r=e>=100?100:null;return e+(t[e]||t[n]||t[r])},week:{dow:1,doy:7}})})(n(30381))},9041:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("th",{months:"มกราคม_กุมภาพันธ์_มีนาคม_เมษายน_พฤษภาคม_มิถุนายน_กรกฎาคม_สิงหาคม_กันยายน_ตุลาคม_พฤศจิกายน_ธันวาคม".split("_"),monthsShort:"ม.ค._ก.พ._มี.ค._เม.ย._พ.ค._มิ.ย._ก.ค._ส.ค._ก.ย._ต.ค._พ.ย._ธ.ค.".split("_"),monthsParseExact:!0,weekdays:"อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัสบดี_ศุกร์_เสาร์".split("_"),weekdaysShort:"อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัส_ศุกร์_เสาร์".split("_"),weekdaysMin:"อา._จ._อ._พ._พฤ._ศ._ส.".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY เวลา H:mm",LLLL:"วันddddที่ D MMMM YYYY เวลา H:mm"},meridiemParse:/ก่อนเที่ยง|หลังเที่ยง/,isPM:function(e){return"หลังเที่ยง"===e},meridiem:function(e,t,n){return e<12?"ก่อนเที่ยง":"หลังเที่ยง"},calendar:{sameDay:"[วันนี้ เวลา] LT",nextDay:"[พรุ่งนี้ เวลา] LT",nextWeek:"dddd[หน้า เวลา] LT",lastDay:"[เมื่อวานนี้ เวลา] LT",lastWeek:"[วัน]dddd[ที่แล้ว เวลา] LT",sameElse:"L"},relativeTime:{future:"อีก %s",past:"%sที่แล้ว",s:"ไม่กี่วินาที",ss:"%d วินาที",m:"1 นาที",mm:"%d นาที",h:"1 ชั่วโมง",hh:"%d ชั่วโมง",d:"1 วัน",dd:"%d วัน",w:"1 สัปดาห์",ww:"%d สัปดาห์",M:"1 เดือน",MM:"%d เดือน",y:"1 ปี",yy:"%d ปี"}})})(n(30381))},19005:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration -var t={1:"'inji",5:"'inji",8:"'inji",70:"'inji",80:"'inji",2:"'nji",7:"'nji",20:"'nji",50:"'nji",3:"'\xfcnji",4:"'\xfcnji",100:"'\xfcnji",6:"'njy",9:"'unjy",10:"'unjy",30:"'unjy",60:"'ynjy",90:"'ynjy"};return e.defineLocale("tk",{months:"\xddanwar_Fewral_Mart_Aprel_Ma\xfd_I\xfdun_I\xfdul_Awgust_Sent\xfdabr_Okt\xfdabr_No\xfdabr_Dekabr".split("_"),monthsShort:"\xddan_Few_Mar_Apr_Ma\xfd_I\xfdn_I\xfdl_Awg_Sen_Okt_No\xfd_Dek".split("_"),weekdays:"\xddekşenbe_Duşenbe_Sişenbe_\xc7arşenbe_Penşenbe_Anna_Şenbe".split("_"),weekdaysShort:"\xddek_Duş_Siş_\xc7ar_Pen_Ann_Şen".split("_"),weekdaysMin:"\xddk_Dş_Sş_\xc7r_Pn_An_Şn".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[bug\xfcn sagat] LT",nextDay:"[ertir sagat] LT",nextWeek:"[indiki] dddd [sagat] LT",lastDay:"[d\xfc\xfdn] LT",lastWeek:"[ge\xe7en] dddd [sagat] LT",sameElse:"L"},relativeTime:{future:"%s soň",past:"%s \xf6ň",s:"birn\xe4\xe7e sekunt",m:"bir minut",mm:"%d minut",h:"bir sagat",hh:"%d sagat",d:"bir g\xfcn",dd:"%d g\xfcn",M:"bir a\xfd",MM:"%d a\xfd",y:"bir \xfdyl",yy:"%d \xfdyl"},ordinal:function(e,n){switch(n){case"d":case"D":case"Do":case"DD":return e;default:if(0===e)return e+"'unjy";var r=e%10,i=e%100-r,a=e>=100?100:null;return e+(t[r]||t[i]||t[a])}},week:{dow:1,doy:7}})})(n(30381))},75768:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("tl-ph",{months:"Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre".split("_"),monthsShort:"Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis".split("_"),weekdays:"Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado".split("_"),weekdaysShort:"Lin_Lun_Mar_Miy_Huw_Biy_Sab".split("_"),weekdaysMin:"Li_Lu_Ma_Mi_Hu_Bi_Sab".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"MM/D/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY HH:mm",LLLL:"dddd, MMMM DD, YYYY HH:mm"},calendar:{sameDay:"LT [ngayong araw]",nextDay:"[Bukas ng] LT",nextWeek:"LT [sa susunod na] dddd",lastDay:"LT [kahapon]",lastWeek:"LT [noong nakaraang] dddd",sameElse:"L"},relativeTime:{future:"sa loob ng %s",past:"%s ang nakalipas",s:"ilang segundo",ss:"%d segundo",m:"isang minuto",mm:"%d minuto",h:"isang oras",hh:"%d oras",d:"isang araw",dd:"%d araw",M:"isang buwan",MM:"%d buwan",y:"isang taon",yy:"%d taon"},dayOfMonthOrdinalParse:/\d{1,2}/,ordinal:function(e){return e},week:{dow:1,doy:4}})})(n(30381))},89444:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration -var t="pagh_wa’_cha’_wej_loS_vagh_jav_Soch_chorgh_Hut".split("_");function n(e){var t=e;return -1!==e.indexOf("jaj")?t.slice(0,-3)+"leS":-1!==e.indexOf("jar")?t.slice(0,-3)+"waQ":-1!==e.indexOf("DIS")?t.slice(0,-3)+"nem":t+" pIq"}function r(e){var t=e;return -1!==e.indexOf("jaj")?t.slice(0,-3)+"Hu’":-1!==e.indexOf("jar")?t.slice(0,-3)+"wen":-1!==e.indexOf("DIS")?t.slice(0,-3)+"ben":t+" ret"}function i(e,t,n,r){var i=a(e);switch(n){case"ss":return i+" lup";case"mm":return i+" tup";case"hh":return i+" rep";case"dd":return i+" jaj";case"MM":return i+" jar";case"yy":return i+" DIS"}}function a(e){var n=Math.floor(e%1e3/100),r=Math.floor(e%100/10),i=e%10,a="";return n>0&&(a+=t[n]+"vatlh"),r>0&&(a+=(""!==a?" ":"")+t[r]+"maH"),i>0&&(a+=(""!==a?" ":"")+t[i]),""===a?"pagh":a}return e.defineLocale("tlh",{months:"tera’ jar wa’_tera’ jar cha’_tera’ jar wej_tera’ jar loS_tera’ jar vagh_tera’ jar jav_tera’ jar Soch_tera’ jar chorgh_tera’ jar Hut_tera’ jar wa’maH_tera’ jar wa’maH wa’_tera’ jar wa’maH cha’".split("_"),monthsShort:"jar wa’_jar cha’_jar wej_jar loS_jar vagh_jar jav_jar Soch_jar chorgh_jar Hut_jar wa’maH_jar wa’maH wa’_jar wa’maH cha’".split("_"),monthsParseExact:!0,weekdays:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),weekdaysShort:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),weekdaysMin:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[DaHjaj] LT",nextDay:"[wa’leS] LT",nextWeek:"LLL",lastDay:"[wa’Hu’] LT",lastWeek:"LLL",sameElse:"L"},relativeTime:{future:n,past:r,s:"puS lup",ss:i,m:"wa’ tup",mm:i,h:"wa’ rep",hh:i,d:"wa’ jaj",dd:i,M:"wa’ jar",MM:i,y:"wa’ DIS",yy:i},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})})(n(30381))},72397:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration -var t={1:"'inci",5:"'inci",8:"'inci",70:"'inci",80:"'inci",2:"'nci",7:"'nci",20:"'nci",50:"'nci",3:"'\xfcnc\xfc",4:"'\xfcnc\xfc",100:"'\xfcnc\xfc",6:"'ncı",9:"'uncu",10:"'uncu",30:"'uncu",60:"'ıncı",90:"'ıncı"};return e.defineLocale("tr",{months:"Ocak_Şubat_Mart_Nisan_Mayıs_Haziran_Temmuz_Ağustos_Eyl\xfcl_Ekim_Kasım_Aralık".split("_"),monthsShort:"Oca_Şub_Mar_Nis_May_Haz_Tem_Ağu_Eyl_Eki_Kas_Ara".split("_"),weekdays:"Pazar_Pazartesi_Salı_\xc7arşamba_Perşembe_Cuma_Cumartesi".split("_"),weekdaysShort:"Paz_Pts_Sal_\xc7ar_Per_Cum_Cts".split("_"),weekdaysMin:"Pz_Pt_Sa_\xc7a_Pe_Cu_Ct".split("_"),meridiem:function(e,t,n){return e<12?n?"\xf6\xf6":"\xd6\xd6":n?"\xf6s":"\xd6S"},meridiemParse:/öö|ÖÖ|ös|ÖS/,isPM:function(e){return"\xf6s"===e||"\xd6S"===e},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[bug\xfcn saat] LT",nextDay:"[yarın saat] LT",nextWeek:"[gelecek] dddd [saat] LT",lastDay:"[d\xfcn] LT",lastWeek:"[ge\xe7en] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s sonra",past:"%s \xf6nce",s:"birka\xe7 saniye",ss:"%d saniye",m:"bir dakika",mm:"%d dakika",h:"bir saat",hh:"%d saat",d:"bir g\xfcn",dd:"%d g\xfcn",w:"bir hafta",ww:"%d hafta",M:"bir ay",MM:"%d ay",y:"bir yıl",yy:"%d yıl"},ordinal:function(e,n){switch(n){case"d":case"D":case"Do":case"DD":return e;default:if(0===e)return e+"'ıncı";var r=e%10,i=e%100-r,a=e>=100?100:null;return e+(t[r]||t[i]||t[a])}},week:{dow:1,doy:7}})})(n(30381))},28254:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration -var t=e.defineLocale("tzl",{months:"Januar_Fevraglh_Mar\xe7_Avr\xefu_Mai_G\xfcn_Julia_Guscht_Setemvar_Listop\xe4ts_Noemvar_Zecemvar".split("_"),monthsShort:"Jan_Fev_Mar_Avr_Mai_G\xfcn_Jul_Gus_Set_Lis_Noe_Zec".split("_"),weekdays:"S\xfaladi_L\xfane\xe7i_Maitzi_M\xe1rcuri_Xh\xfaadi_Vi\xe9ner\xe7i_S\xe1turi".split("_"),weekdaysShort:"S\xfal_L\xfan_Mai_M\xe1r_Xh\xfa_Vi\xe9_S\xe1t".split("_"),weekdaysMin:"S\xfa_L\xfa_Ma_M\xe1_Xh_Vi_S\xe1".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD.MM.YYYY",LL:"D. MMMM [dallas] YYYY",LLL:"D. MMMM [dallas] YYYY HH.mm",LLLL:"dddd, [li] D. MMMM [dallas] YYYY HH.mm"},meridiemParse:/d\'o|d\'a/i,isPM:function(e){return"d'o"===e.toLowerCase()},meridiem:function(e,t,n){return e>11?n?"d'o":"D'O":n?"d'a":"D'A"},calendar:{sameDay:"[oxhi \xe0] LT",nextDay:"[dem\xe0 \xe0] LT",nextWeek:"dddd [\xe0] LT",lastDay:"[ieiri \xe0] LT",lastWeek:"[s\xfcr el] dddd [lasteu \xe0] LT",sameElse:"L"},relativeTime:{future:"osprei %s",past:"ja%s",s:n,ss:n,m:n,mm:n,h:n,hh:n,d:n,dd:n,M:n,MM:n,y:n,yy:n},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}});function n(e,t,n,r){var i={s:["viensas secunds","'iensas secunds"],ss:[e+" secunds",""+e+" secunds"],m:["'n m\xedut","'iens m\xedut"],mm:[e+" m\xeduts",""+e+" m\xeduts"],h:["'n \xfeora","'iensa \xfeora"],hh:[e+" \xfeoras",""+e+" \xfeoras"],d:["'n ziua","'iensa ziua"],dd:[e+" ziuas",""+e+" ziuas"],M:["'n mes","'iens mes"],MM:[e+" mesen",""+e+" mesen"],y:["'n ar","'iens ar"],yy:[e+" ars",""+e+" ars"]};return r?i[n][0]:t?i[n][0]:i[n][1]}return t})(n(30381))},30699:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("tzm-latn",{months:"innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir".split("_"),monthsShort:"innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir".split("_"),weekdays:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),weekdaysShort:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),weekdaysMin:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[asdkh g] LT",nextDay:"[aska g] LT",nextWeek:"dddd [g] LT",lastDay:"[assant g] LT",lastWeek:"dddd [g] LT",sameElse:"L"},relativeTime:{future:"dadkh s yan %s",past:"yan %s",s:"imik",ss:"%d imik",m:"minuḍ",mm:"%d minuḍ",h:"saɛa",hh:"%d tassaɛin",d:"ass",dd:"%d ossan",M:"ayowr",MM:"%d iyyirn",y:"asgas",yy:"%d isgasn"},week:{dow:6,doy:12}})})(n(30381))},51106:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("tzm",{months:"ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ".split("_"),monthsShort:"ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ".split("_"),weekdays:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),weekdaysShort:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),weekdaysMin:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[ⴰⵙⴷⵅ ⴴ] LT",nextDay:"[ⴰⵙⴽⴰ ⴴ] LT",nextWeek:"dddd [ⴴ] LT",lastDay:"[ⴰⵚⴰⵏⵜ ⴴ] LT",lastWeek:"dddd [ⴴ] LT",sameElse:"L"},relativeTime:{future:"ⴷⴰⴷⵅ ⵙ ⵢⴰⵏ %s",past:"ⵢⴰⵏ %s",s:"ⵉⵎⵉⴽ",ss:"%d ⵉⵎⵉⴽ",m:"ⵎⵉⵏⵓⴺ",mm:"%d ⵎⵉⵏⵓⴺ",h:"ⵙⴰⵄⴰ",hh:"%d ⵜⴰⵙⵙⴰⵄⵉⵏ",d:"ⴰⵙⵙ",dd:"%d oⵙⵙⴰⵏ",M:"ⴰⵢoⵓⵔ",MM:"%d ⵉⵢⵢⵉⵔⵏ",y:"ⴰⵙⴳⴰⵙ",yy:"%d ⵉⵙⴳⴰⵙⵏ"},week:{dow:6,doy:12}})})(n(30381))},9288:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("ug-cn",{months:"يانۋار_فېۋرال_مارت_ئاپرېل_ماي_ئىيۇن_ئىيۇل_ئاۋغۇست_سېنتەبىر_ئۆكتەبىر_نويابىر_دېكابىر".split("_"),monthsShort:"يانۋار_فېۋرال_مارت_ئاپرېل_ماي_ئىيۇن_ئىيۇل_ئاۋغۇست_سېنتەبىر_ئۆكتەبىر_نويابىر_دېكابىر".split("_"),weekdays:"يەكشەنبە_دۈشەنبە_سەيشەنبە_چارشەنبە_پەيشەنبە_جۈمە_شەنبە".split("_"),weekdaysShort:"يە_دۈ_سە_چا_پە_جۈ_شە".split("_"),weekdaysMin:"يە_دۈ_سە_چا_پە_جۈ_شە".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY-يىلىM-ئاينىڭD-كۈنى",LLL:"YYYY-يىلىM-ئاينىڭD-كۈنى، HH:mm",LLLL:"dddd، YYYY-يىلىM-ئاينىڭD-كۈنى، HH:mm"},meridiemParse:/يېرىم كېچە|سەھەر|چۈشتىن بۇرۇن|چۈش|چۈشتىن كېيىن|كەچ/,meridiemHour:function(e,t){return(12===e&&(e=0),"يېرىم كېچە"===t||"سەھەر"===t||"چۈشتىن بۇرۇن"===t)?e:"چۈشتىن كېيىن"===t||"كەچ"===t?e+12:e>=11?e:e+12},meridiem:function(e,t,n){var r=100*e+t;if(r<600)return"يېرىم كېچە";if(r<900)return"سەھەر";if(r<1130)return"چۈشتىن بۇرۇن";if(r<1230)return"چۈش";if(r<1800)return"چۈشتىن كېيىن";else return"كەچ"},calendar:{sameDay:"[بۈگۈن سائەت] LT",nextDay:"[ئەتە سائەت] LT",nextWeek:"[كېلەركى] dddd [سائەت] LT",lastDay:"[تۆنۈگۈن] LT",lastWeek:"[ئالدىنقى] dddd [سائەت] LT",sameElse:"L"},relativeTime:{future:"%s كېيىن",past:"%s بۇرۇن",s:"نەچچە سېكونت",ss:"%d سېكونت",m:"بىر مىنۇت",mm:"%d مىنۇت",h:"بىر سائەت",hh:"%d سائەت",d:"بىر كۈن",dd:"%d كۈن",M:"بىر ئاي",MM:"%d ئاي",y:"بىر يىل",yy:"%d يىل"},dayOfMonthOrdinalParse:/\d{1,2}(-كۈنى|-ئاي|-ھەپتە)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"-كۈنى";case"w":case"W":return e+"-ھەپتە";default:return e}},preparse:function(e){return e.replace(/،/g,",")},postformat:function(e){return e.replace(/,/g,"،")},week:{dow:1,doy:7}})})(n(30381))},67691:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration -function t(e,t){var n=e.split("_");return t%10==1&&t%100!=11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}function n(e,n,r){var i={ss:n?"секунда_секунди_секунд":"секунду_секунди_секунд",mm:n?"хвилина_хвилини_хвилин":"хвилину_хвилини_хвилин",hh:n?"година_години_годин":"годину_години_годин",dd:"день_дні_днів",MM:"місяць_місяці_місяців",yy:"рік_роки_років"};return"m"===r?n?"хвилина":"хвилину":"h"===r?n?"година":"годину":e+" "+t(i[r],+e)}function r(e,t){var n,r={nominative:"неділя_понеділок_вівторок_середа_четвер_п’ятниця_субота".split("_"),accusative:"неділю_понеділок_вівторок_середу_четвер_п’ятницю_суботу".split("_"),genitive:"неділі_понеділка_вівторка_середи_четверга_п’ятниці_суботи".split("_")};return!0===e?r.nominative.slice(1,7).concat(r.nominative.slice(0,1)):e?r[n=/(\[[ВвУу]\]) ?dddd/.test(t)?"accusative":/\[?(?:минулої|наступної)? ?\] ?dddd/.test(t)?"genitive":"nominative"][e.day()]:r.nominative}function i(e){return function(){return e+"о"+(11===this.hours()?"б":"")+"] LT"}}return e.defineLocale("uk",{months:{format:"січня_лютого_березня_квітня_травня_червня_липня_серпня_вересня_жовтня_листопада_грудня".split("_"),standalone:"січень_лютий_березень_квітень_травень_червень_липень_серпень_вересень_жовтень_листопад_грудень".split("_")},monthsShort:"січ_лют_бер_квіт_трав_черв_лип_серп_вер_жовт_лист_груд".split("_"),weekdays:r,weekdaysShort:"нд_пн_вт_ср_чт_пт_сб".split("_"),weekdaysMin:"нд_пн_вт_ср_чт_пт_сб".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY р.",LLL:"D MMMM YYYY р., HH:mm",LLLL:"dddd, D MMMM YYYY р., HH:mm"},calendar:{sameDay:i("[Сьогодні "),nextDay:i("[Завтра "),lastDay:i("[Вчора "),nextWeek:i("[У] dddd ["),lastWeek:function(){switch(this.day()){case 0:case 3:case 5:case 6:return i("[Минулої] dddd [").call(this);case 1:case 2:case 4:return i("[Минулого] dddd [").call(this)}},sameElse:"L"},relativeTime:{future:"за %s",past:"%s тому",s:"декілька секунд",ss:n,m:n,mm:n,h:"годину",hh:n,d:"день",dd:n,M:"місяць",MM:n,y:"рік",yy:n},meridiemParse:/ночі|ранку|дня|вечора/,isPM:function(e){return/^(дня|вечора)$/.test(e)},meridiem:function(e,t,n){return e<4?"ночі":e<12?"ранку":e<17?"дня":"вечора"},dayOfMonthOrdinalParse:/\d{1,2}-(й|го)/,ordinal:function(e,t){switch(t){case"M":case"d":case"DDD":case"w":case"W":return e+"-й";case"D":return e+"-го";default:return e}},week:{dow:1,doy:7}})})(n(30381))},13795:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration -var t=["جنوری","فروری","مارچ","اپریل","مئی","جون","جولائی","اگست","ستمبر","اکتوبر","نومبر","دسمبر",],n=["اتوار","پیر","منگل","بدھ","جمعرات","جمعہ","ہفتہ"];return e.defineLocale("ur",{months:t,monthsShort:t,weekdays:n,weekdaysShort:n,weekdaysMin:n,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd، D MMMM YYYY HH:mm"},meridiemParse:/صبح|شام/,isPM:function(e){return"شام"===e},meridiem:function(e,t,n){return e<12?"صبح":"شام"},calendar:{sameDay:"[آج بوقت] LT",nextDay:"[کل بوقت] LT",nextWeek:"dddd [بوقت] LT",lastDay:"[گذشتہ روز بوقت] LT",lastWeek:"[گذشتہ] dddd [بوقت] LT",sameElse:"L"},relativeTime:{future:"%s بعد",past:"%s قبل",s:"چند سیکنڈ",ss:"%d سیکنڈ",m:"ایک منٹ",mm:"%d منٹ",h:"ایک گھنٹہ",hh:"%d گھنٹے",d:"ایک دن",dd:"%d دن",M:"ایک ماہ",MM:"%d ماہ",y:"ایک سال",yy:"%d سال"},preparse:function(e){return e.replace(/،/g,",")},postformat:function(e){return e.replace(/,/g,"،")},week:{dow:1,doy:4}})})(n(30381))},60588:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("uz-latn",{months:"Yanvar_Fevral_Mart_Aprel_May_Iyun_Iyul_Avgust_Sentabr_Oktabr_Noyabr_Dekabr".split("_"),monthsShort:"Yan_Fev_Mar_Apr_May_Iyun_Iyul_Avg_Sen_Okt_Noy_Dek".split("_"),weekdays:"Yakshanba_Dushanba_Seshanba_Chorshanba_Payshanba_Juma_Shanba".split("_"),weekdaysShort:"Yak_Dush_Sesh_Chor_Pay_Jum_Shan".split("_"),weekdaysMin:"Ya_Du_Se_Cho_Pa_Ju_Sha".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"D MMMM YYYY, dddd HH:mm"},calendar:{sameDay:"[Bugun soat] LT [da]",nextDay:"[Ertaga] LT [da]",nextWeek:"dddd [kuni soat] LT [da]",lastDay:"[Kecha soat] LT [da]",lastWeek:"[O'tgan] dddd [kuni soat] LT [da]",sameElse:"L"},relativeTime:{future:"Yaqin %s ichida",past:"Bir necha %s oldin",s:"soniya",ss:"%d soniya",m:"bir daqiqa",mm:"%d daqiqa",h:"bir soat",hh:"%d soat",d:"bir kun",dd:"%d kun",M:"bir oy",MM:"%d oy",y:"bir yil",yy:"%d yil"},week:{dow:1,doy:7}})})(n(30381))},6791:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("uz",{months:"январ_феврал_март_апрел_май_июн_июл_август_сентябр_октябр_ноябр_декабр".split("_"),monthsShort:"янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек".split("_"),weekdays:"Якшанба_Душанба_Сешанба_Чоршанба_Пайшанба_Жума_Шанба".split("_"),weekdaysShort:"Якш_Душ_Сеш_Чор_Пай_Жум_Шан".split("_"),weekdaysMin:"Як_Ду_Се_Чо_Па_Жу_Ша".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"D MMMM YYYY, dddd HH:mm"},calendar:{sameDay:"[Бугун соат] LT [да]",nextDay:"[Эртага] LT [да]",nextWeek:"dddd [куни соат] LT [да]",lastDay:"[Кеча соат] LT [да]",lastWeek:"[Утган] dddd [куни соат] LT [да]",sameElse:"L"},relativeTime:{future:"Якин %s ичида",past:"Бир неча %s олдин",s:"фурсат",ss:"%d фурсат",m:"бир дакика",mm:"%d дакика",h:"бир соат",hh:"%d соат",d:"бир кун",dd:"%d кун",M:"бир ой",MM:"%d ой",y:"бир йил",yy:"%d йил"},week:{dow:1,doy:7}})})(n(30381))},65666:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("vi",{months:"th\xe1ng 1_th\xe1ng 2_th\xe1ng 3_th\xe1ng 4_th\xe1ng 5_th\xe1ng 6_th\xe1ng 7_th\xe1ng 8_th\xe1ng 9_th\xe1ng 10_th\xe1ng 11_th\xe1ng 12".split("_"),monthsShort:"Thg 01_Thg 02_Thg 03_Thg 04_Thg 05_Thg 06_Thg 07_Thg 08_Thg 09_Thg 10_Thg 11_Thg 12".split("_"),monthsParseExact:!0,weekdays:"chủ nhật_thứ hai_thứ ba_thứ tư_thứ năm_thứ s\xe1u_thứ bảy".split("_"),weekdaysShort:"CN_T2_T3_T4_T5_T6_T7".split("_"),weekdaysMin:"CN_T2_T3_T4_T5_T6_T7".split("_"),weekdaysParseExact:!0,meridiemParse:/sa|ch/i,isPM:function(e){return/^ch$/i.test(e)},meridiem:function(e,t,n){return e<12?n?"sa":"SA":n?"ch":"CH"},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM [năm] YYYY",LLL:"D MMMM [năm] YYYY HH:mm",LLLL:"dddd, D MMMM [năm] YYYY HH:mm",l:"DD/M/YYYY",ll:"D MMM YYYY",lll:"D MMM YYYY HH:mm",llll:"ddd, D MMM YYYY HH:mm"},calendar:{sameDay:"[H\xf4m nay l\xfac] LT",nextDay:"[Ng\xe0y mai l\xfac] LT",nextWeek:"dddd [tuần tới l\xfac] LT",lastDay:"[H\xf4m qua l\xfac] LT",lastWeek:"dddd [tuần trước l\xfac] LT",sameElse:"L"},relativeTime:{future:"%s tới",past:"%s trước",s:"v\xe0i gi\xe2y",ss:"%d gi\xe2y",m:"một ph\xfat",mm:"%d ph\xfat",h:"một giờ",hh:"%d giờ",d:"một ng\xe0y",dd:"%d ng\xe0y",w:"một tuần",ww:"%d tuần",M:"một th\xe1ng",MM:"%d th\xe1ng",y:"một năm",yy:"%d năm"},dayOfMonthOrdinalParse:/\d{1,2}/,ordinal:function(e){return e},week:{dow:1,doy:4}})})(n(30381))},14378:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("x-pseudo",{months:"J~\xe1\xf1\xfa\xe1~r\xfd_F~\xe9br\xfa~\xe1r\xfd_~M\xe1rc~h_\xc1p~r\xedl_~M\xe1\xfd_~J\xfa\xf1\xe9~_J\xfal~\xfd_\xc1\xfa~g\xfast~_S\xe9p~t\xe9mb~\xe9r_\xd3~ct\xf3b~\xe9r_\xd1~\xf3v\xe9m~b\xe9r_~D\xe9c\xe9~mb\xe9r".split("_"),monthsShort:"J~\xe1\xf1_~F\xe9b_~M\xe1r_~\xc1pr_~M\xe1\xfd_~J\xfa\xf1_~J\xfal_~\xc1\xfag_~S\xe9p_~\xd3ct_~\xd1\xf3v_~D\xe9c".split("_"),monthsParseExact:!0,weekdays:"S~\xfa\xf1d\xe1~\xfd_M\xf3~\xf1d\xe1\xfd~_T\xfa\xe9~sd\xe1\xfd~_W\xe9d~\xf1\xe9sd~\xe1\xfd_T~h\xfars~d\xe1\xfd_~Fr\xedd~\xe1\xfd_S~\xe1t\xfar~d\xe1\xfd".split("_"),weekdaysShort:"S~\xfa\xf1_~M\xf3\xf1_~T\xfa\xe9_~W\xe9d_~Th\xfa_~Fr\xed_~S\xe1t".split("_"),weekdaysMin:"S~\xfa_M\xf3~_T\xfa_~W\xe9_T~h_Fr~_S\xe1".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[T~\xf3d\xe1~\xfd \xe1t] LT",nextDay:"[T~\xf3m\xf3~rr\xf3~w \xe1t] LT",nextWeek:"dddd [\xe1t] LT",lastDay:"[\xdd~\xe9st~\xe9rd\xe1~\xfd \xe1t] LT",lastWeek:"[L~\xe1st] dddd [\xe1t] LT",sameElse:"L"},relativeTime:{future:"\xed~\xf1 %s",past:"%s \xe1~g\xf3",s:"\xe1 ~f\xe9w ~s\xe9c\xf3~\xf1ds",ss:"%d s~\xe9c\xf3\xf1~ds",m:"\xe1 ~m\xed\xf1~\xfat\xe9",mm:"%d m~\xed\xf1\xfa~t\xe9s",h:"\xe1~\xf1 h\xf3~\xfar",hh:"%d h~\xf3\xfars",d:"\xe1 ~d\xe1\xfd",dd:"%d d~\xe1\xfds",M:"\xe1 ~m\xf3\xf1~th",MM:"%d m~\xf3\xf1t~hs",y:"\xe1 ~\xfd\xe9\xe1r",yy:"%d \xfd~\xe9\xe1rs"},dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10,n=1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th";return e+n},week:{dow:1,doy:4}})})(n(30381))},75805:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("yo",{months:"Sẹ́rẹ́_Èrèlè_Ẹrẹ̀nà_Ìgbé_Èbibi_Òkùdu_Agẹmo_Ògún_Owewe_Ọ̀wàrà_Bélú_Ọ̀pẹ̀̀".split("_"),monthsShort:"Sẹ́r_Èrl_Ẹrn_Ìgb_Èbi_Òkù_Agẹ_Ògú_Owe_Ọ̀wà_Bél_Ọ̀pẹ̀̀".split("_"),weekdays:"Àìkú_Ajé_Ìsẹ́gun_Ọjọ́rú_Ọjọ́bọ_Ẹtì_Àbámẹ́ta".split("_"),weekdaysShort:"Àìk_Ajé_Ìsẹ́_Ọjr_Ọjb_Ẹtì_Àbá".split("_"),weekdaysMin:"Àì_Aj_Ìs_Ọr_Ọb_Ẹt_Àb".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Ònì ni] LT",nextDay:"[Ọ̀la ni] LT",nextWeek:"dddd [Ọsẹ̀ tón'bọ] [ni] LT",lastDay:"[Àna ni] LT",lastWeek:"dddd [Ọsẹ̀ tólọ́] [ni] LT",sameElse:"L"},relativeTime:{future:"ní %s",past:"%s kọjá",s:"ìsẹjú aayá die",ss:"aayá %d",m:"ìsẹjú kan",mm:"ìsẹjú %d",h:"wákati kan",hh:"wákati %d",d:"ọjọ́ kan",dd:"ọjọ́ %d",M:"osù kan",MM:"osù %d",y:"ọdún kan",yy:"ọdún %d"},dayOfMonthOrdinalParse:/ọjọ́\s\d{1,2}/,ordinal:"ọjọ́ %d",week:{dow:1,doy:4}})})(n(30381))},83839:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("zh-cn",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah点mm分",LLLL:"YYYY年M月D日ddddAh点mm分",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){return(12===e&&(e=0),"凌晨"===t||"早上"===t||"上午"===t)?e:"下午"===t||"晚上"===t?e+12:e>=11?e:e+12},meridiem:function(e,t,n){var r=100*e+t;if(r<600)return"凌晨";if(r<900)return"早上";if(r<1130)return"上午";if(r<1230)return"中午";if(r<1800)return"下午";else return"晚上"},calendar:{sameDay:"[今天]LT",nextDay:"[明天]LT",nextWeek:function(e){return e.week()!==this.week()?"[下]dddLT":"[本]dddLT"},lastDay:"[昨天]LT",lastWeek:function(e){return this.week()!==e.week()?"[上]dddLT":"[本]dddLT"},sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|周)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"周";default:return e}},relativeTime:{future:"%s后",past:"%s前",s:"几秒",ss:"%d 秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",w:"1 周",ww:"%d 周",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},week:{dow:1,doy:4}})})(n(30381))},55726:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("zh-hk",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"週日_週一_週二_週三_週四_週五_週六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日dddd HH:mm",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){return(12===e&&(e=0),"凌晨"===t||"早上"===t||"上午"===t)?e:"中午"===t?e>=11?e:e+12:"下午"===t||"晚上"===t?e+12:void 0},meridiem:function(e,t,n){var r=100*e+t;if(r<600)return"凌晨";if(r<900)return"早上";if(r<1200)return"上午";if(1200===r)return"中午";if(r<1800)return"下午";else return"晚上"},calendar:{sameDay:"[今天]LT",nextDay:"[明天]LT",nextWeek:"[下]ddddLT",lastDay:"[昨天]LT",lastWeek:"[上]ddddLT",sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|週)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"週";default:return e}},relativeTime:{future:"%s後",past:"%s前",s:"幾秒",ss:"%d 秒",m:"1 分鐘",mm:"%d 分鐘",h:"1 小時",hh:"%d 小時",d:"1 天",dd:"%d 天",M:"1 個月",MM:"%d 個月",y:"1 年",yy:"%d 年"}})})(n(30381))},99807:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("zh-mo",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"週日_週一_週二_週三_週四_週五_週六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日dddd HH:mm",l:"D/M/YYYY",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){return(12===e&&(e=0),"凌晨"===t||"早上"===t||"上午"===t)?e:"中午"===t?e>=11?e:e+12:"下午"===t||"晚上"===t?e+12:void 0},meridiem:function(e,t,n){var r=100*e+t;if(r<600)return"凌晨";if(r<900)return"早上";if(r<1130)return"上午";if(r<1230)return"中午";if(r<1800)return"下午";else return"晚上"},calendar:{sameDay:"[今天] LT",nextDay:"[明天] LT",nextWeek:"[下]dddd LT",lastDay:"[昨天] LT",lastWeek:"[上]dddd LT",sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|週)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"週";default:return e}},relativeTime:{future:"%s內",past:"%s前",s:"幾秒",ss:"%d 秒",m:"1 分鐘",mm:"%d 分鐘",h:"1 小時",hh:"%d 小時",d:"1 天",dd:"%d 天",M:"1 個月",MM:"%d 個月",y:"1 年",yy:"%d 年"}})})(n(30381))},74152:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("zh-tw",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"週日_週一_週二_週三_週四_週五_週六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日dddd HH:mm",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){return(12===e&&(e=0),"凌晨"===t||"早上"===t||"上午"===t)?e:"中午"===t?e>=11?e:e+12:"下午"===t||"晚上"===t?e+12:void 0},meridiem:function(e,t,n){var r=100*e+t;if(r<600)return"凌晨";if(r<900)return"早上";if(r<1130)return"上午";if(r<1230)return"中午";if(r<1800)return"下午";else return"晚上"},calendar:{sameDay:"[今天] LT",nextDay:"[明天] LT",nextWeek:"[下]dddd LT",lastDay:"[昨天] LT",lastWeek:"[上]dddd LT",sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|週)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"週";default:return e}},relativeTime:{future:"%s後",past:"%s前",s:"幾秒",ss:"%d 秒",m:"1 分鐘",mm:"%d 分鐘",h:"1 小時",hh:"%d 小時",d:"1 天",dd:"%d 天",M:"1 個月",MM:"%d 個月",y:"1 年",yy:"%d 年"}})})(n(30381))},46700(e,t,n){var r={"./af":42786,"./af.js":42786,"./ar":30867,"./ar-dz":14130,"./ar-dz.js":14130,"./ar-kw":96135,"./ar-kw.js":96135,"./ar-ly":56440,"./ar-ly.js":56440,"./ar-ma":47702,"./ar-ma.js":47702,"./ar-sa":16040,"./ar-sa.js":16040,"./ar-tn":37100,"./ar-tn.js":37100,"./ar.js":30867,"./az":31083,"./az.js":31083,"./be":9808,"./be.js":9808,"./bg":68338,"./bg.js":68338,"./bm":67438,"./bm.js":67438,"./bn":8905,"./bn-bd":76225,"./bn-bd.js":76225,"./bn.js":8905,"./bo":11560,"./bo.js":11560,"./br":1278,"./br.js":1278,"./bs":80622,"./bs.js":80622,"./ca":2468,"./ca.js":2468,"./cs":5822,"./cs.js":5822,"./cv":50877,"./cv.js":50877,"./cy":47373,"./cy.js":47373,"./da":24780,"./da.js":24780,"./de":59740,"./de-at":60217,"./de-at.js":60217,"./de-ch":60894,"./de-ch.js":60894,"./de.js":59740,"./dv":5300,"./dv.js":5300,"./el":50837,"./el.js":50837,"./en-au":78348,"./en-au.js":78348,"./en-ca":77925,"./en-ca.js":77925,"./en-gb":22243,"./en-gb.js":22243,"./en-ie":46436,"./en-ie.js":46436,"./en-il":47207,"./en-il.js":47207,"./en-in":44175,"./en-in.js":44175,"./en-nz":76319,"./en-nz.js":76319,"./en-sg":31662,"./en-sg.js":31662,"./eo":92915,"./eo.js":92915,"./es":55655,"./es-do":55251,"./es-do.js":55251,"./es-mx":96112,"./es-mx.js":96112,"./es-us":71146,"./es-us.js":71146,"./es.js":55655,"./et":5603,"./et.js":5603,"./eu":77763,"./eu.js":77763,"./fa":76959,"./fa.js":76959,"./fi":11897,"./fi.js":11897,"./fil":42549,"./fil.js":42549,"./fo":94694,"./fo.js":94694,"./fr":94470,"./fr-ca":63049,"./fr-ca.js":63049,"./fr-ch":52330,"./fr-ch.js":52330,"./fr.js":94470,"./fy":5044,"./fy.js":5044,"./ga":29295,"./ga.js":29295,"./gd":2101,"./gd.js":2101,"./gl":38794,"./gl.js":38794,"./gom-deva":27884,"./gom-deva.js":27884,"./gom-latn":23168,"./gom-latn.js":23168,"./gu":95349,"./gu.js":95349,"./he":24206,"./he.js":24206,"./hi":30094,"./hi.js":30094,"./hr":30316,"./hr.js":30316,"./hu":22138,"./hu.js":22138,"./hy-am":11423,"./hy-am.js":11423,"./id":29218,"./id.js":29218,"./is":90135,"./is.js":90135,"./it":90626,"./it-ch":10150,"./it-ch.js":10150,"./it.js":90626,"./ja":39183,"./ja.js":39183,"./jv":24286,"./jv.js":24286,"./ka":12105,"./ka.js":12105,"./kk":47772,"./kk.js":47772,"./km":18758,"./km.js":18758,"./kn":79282,"./kn.js":79282,"./ko":33730,"./ko.js":33730,"./ku":1408,"./ku.js":1408,"./ky":33291,"./ky.js":33291,"./lb":36841,"./lb.js":36841,"./lo":55466,"./lo.js":55466,"./lt":57010,"./lt.js":57010,"./lv":37595,"./lv.js":37595,"./me":39861,"./me.js":39861,"./mi":35493,"./mi.js":35493,"./mk":95966,"./mk.js":95966,"./ml":87341,"./ml.js":87341,"./mn":5115,"./mn.js":5115,"./mr":10370,"./mr.js":10370,"./ms":9847,"./ms-my":41237,"./ms-my.js":41237,"./ms.js":9847,"./mt":72126,"./mt.js":72126,"./my":56165,"./my.js":56165,"./nb":64924,"./nb.js":64924,"./ne":16744,"./ne.js":16744,"./nl":93901,"./nl-be":59814,"./nl-be.js":59814,"./nl.js":93901,"./nn":83877,"./nn.js":83877,"./oc-lnc":92135,"./oc-lnc.js":92135,"./pa-in":15858,"./pa-in.js":15858,"./pl":64495,"./pl.js":64495,"./pt":89520,"./pt-br":57971,"./pt-br.js":57971,"./pt.js":89520,"./ro":96459,"./ro.js":96459,"./ru":21793,"./ru.js":21793,"./sd":40950,"./sd.js":40950,"./se":10490,"./se.js":10490,"./si":90124,"./si.js":90124,"./sk":64249,"./sk.js":64249,"./sl":14985,"./sl.js":14985,"./sq":51104,"./sq.js":51104,"./sr":49131,"./sr-cyrl":79915,"./sr-cyrl.js":79915,"./sr.js":49131,"./ss":85893,"./ss.js":85893,"./sv":98760,"./sv.js":98760,"./sw":91172,"./sw.js":91172,"./ta":27333,"./ta.js":27333,"./te":23110,"./te.js":23110,"./tet":52095,"./tet.js":52095,"./tg":27321,"./tg.js":27321,"./th":9041,"./th.js":9041,"./tk":19005,"./tk.js":19005,"./tl-ph":75768,"./tl-ph.js":75768,"./tlh":89444,"./tlh.js":89444,"./tr":72397,"./tr.js":72397,"./tzl":28254,"./tzl.js":28254,"./tzm":51106,"./tzm-latn":30699,"./tzm-latn.js":30699,"./tzm.js":51106,"./ug-cn":9288,"./ug-cn.js":9288,"./uk":67691,"./uk.js":67691,"./ur":13795,"./ur.js":13795,"./uz":6791,"./uz-latn":60588,"./uz-latn.js":60588,"./uz.js":6791,"./vi":65666,"./vi.js":65666,"./x-pseudo":14378,"./x-pseudo.js":14378,"./yo":75805,"./yo.js":75805,"./zh-cn":83839,"./zh-cn.js":83839,"./zh-hk":55726,"./zh-hk.js":55726,"./zh-mo":99807,"./zh-mo.js":99807,"./zh-tw":74152,"./zh-tw.js":74152};function i(e){return n(a(e))}function a(e){if(!n.o(r,e)){var t=Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return r[e]}i.keys=function(){return Object.keys(r)},i.resolve=a,e.exports=i,i.id=46700},30381:function(e,t,n){var r,i;e=n.nmd(e),r=this,i=function(){"use strict";function t(){return em.apply(null,arguments)}function r(e){em=e}function i(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function a(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function o(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function s(e){var t;if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(e).length;for(t in e)if(o(e,t))return!1;return!0}function u(e){return void 0===e}function c(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)}function l(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function f(e,t){var n,r=[];for(n=0;n>>0;for(t=0;t0)for(n=0;n=0?n?"+":"":"-")+Math.pow(10,Math.max(0,t-i.length)).toString().substr(1)+i}var R=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,j=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,F={},Y={};function B(e,t,n,r){var i=r;"string"==typeof r&&(i=function(){return this[r]()}),e&&(Y[e]=i),t&&(Y[t[0]]=function(){return P(i.apply(this,arguments),t[1],t[2])}),n&&(Y[n]=function(){return this.localeData().ordinal(i.apply(this,arguments),e)})}function U(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function H(e){var t,n,r=e.match(R);for(t=0,n=r.length;t=0&&j.test(e);)e=e.replace(j,r),j.lastIndex=0,n-=1;return e}var G={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function W(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.match(R).map(function(e){return"MMMM"===e||"MM"===e||"DD"===e||"dddd"===e?e.slice(1):e}).join(""),this._longDateFormat[e])}var K="Invalid date";function V(){return this._invalidDate}var q="%d",Z=/\d{1,2}/;function X(e){return this._ordinal.replace("%d",e)}var J={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function Q(e,t,n,r){var i=this._relativeTime[n];return A(i)?i(e,t,n,r):i.replace(/%d/i,e)}function ee(e,t){var n=this._relativeTime[e>0?"future":"past"];return A(n)?n(t):n.replace(/%s/i,t)}var et={};function en(e,t){var n=e.toLowerCase();et[n]=et[n+"s"]=et[t]=e}function er(e){return"string"==typeof e?et[e]||et[e.toLowerCase()]:void 0}function ei(e){var t,n,r={};for(n in e)o(e,n)&&(t=er(n))&&(r[t]=e[n]);return r}var ea={};function eo(e,t){ea[e]=t}function es(e){var t,n=[];for(t in e)o(e,t)&&n.push({unit:t,priority:ea[t]});return n.sort(function(e,t){return e.priority-t.priority}),n}function eu(e){return e%4==0&&e%100!=0||e%400==0}function ec(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function el(e){var t=+e,n=0;return 0!==t&&isFinite(t)&&(n=ec(t)),n}function ef(e,n){return function(r){return null!=r?(eh(this,e,r),t.updateOffset(this,n),this):ed(this,e)}}function ed(e,t){return e.isValid()?e._d["get"+(e._isUTC?"UTC":"")+t]():NaN}function eh(e,t,n){e.isValid()&&!isNaN(n)&&("FullYear"===t&&eu(e.year())&&1===e.month()&&29===e.date()?(n=el(n),e._d["set"+(e._isUTC?"UTC":"")+t](n,e.month(),e0(n,e.month()))):e._d["set"+(e._isUTC?"UTC":"")+t](n))}function ep(e){return A(this[e=er(e)])?this[e]():this}function eb(e,t){if("object"==typeof e){e=ei(e);var n,r=es(e);for(n=0;n68?1900:2e3)};var tu=ef("FullYear",!0);function tc(){return eu(this.year())}function tl(e,t,n,r,i,a,o){var s;return e<100&&e>=0?(s=new Date(e+400,t,n,r,i,a,o),isFinite(s.getFullYear())&&s.setFullYear(e)):s=new Date(e,t,n,r,i,a,o),s}function tf(e){var t,n;return e<100&&e>=0?(n=Array.prototype.slice.call(arguments),n[0]=e+400,t=new Date(Date.UTC.apply(null,n)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)):t=new Date(Date.UTC.apply(null,arguments)),t}function td(e,t,n){var r=7+t-n;return-((7+tf(e,0,r).getUTCDay()-t)%7)+r-1}function th(e,t,n,r,i){var a,o,s=(7+n-r)%7,u=td(e,r,i),c=1+7*(t-1)+s+u;return c<=0?o=ts(a=e-1)+c:c>ts(e)?(a=e+1,o=c-ts(e)):(a=e,o=c),{year:a,dayOfYear:o}}function tp(e,t,n){var r,i,a=td(e.year(),t,n),o=Math.floor((e.dayOfYear()-a-1)/7)+1;return o<1?r=o+tb(i=e.year()-1,t,n):o>tb(e.year(),t,n)?(r=o-tb(e.year(),t,n),i=e.year()+1):(i=e.year(),r=o),{week:r,year:i}}function tb(e,t,n){var r=td(e,t,n),i=td(e+1,t,n);return(ts(e)-r+i)/7}function tm(e){return tp(e,this._week.dow,this._week.doy).week}B("w",["ww",2],"wo","week"),B("W",["WW",2],"Wo","isoWeek"),en("week","w"),en("isoWeek","W"),eo("week",5),eo("isoWeek",5),ej("w",ex),ej("ww",ex,e_),ej("W",ex),ej("WW",ex,e_),e$(["w","ww","W","WW"],function(e,t,n,r){t[r.substr(0,1)]=el(e)});var tg={dow:0,doy:6};function tv(){return this._week.dow}function ty(){return this._week.doy}function tw(e){var t=this.localeData().week(this);return null==e?t:this.add((e-t)*7,"d")}function t_(e){var t=tp(this,1,4).week;return null==e?t:this.add((e-t)*7,"d")}function tE(e,t){return"string"!=typeof e?e:isNaN(e)?"number"==typeof(e=t.weekdaysParse(e))?e:null:parseInt(e,10)}function tS(e,t){return"string"==typeof e?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}function tk(e,t){return e.slice(t,7).concat(e.slice(0,t))}B("d",0,"do","day"),B("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),B("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),B("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),B("e",0,0,"weekday"),B("E",0,0,"isoWeekday"),en("day","d"),en("weekday","e"),en("isoWeekday","E"),eo("day",11),eo("weekday",11),eo("isoWeekday",11),ej("d",ex),ej("e",ex),ej("E",ex),ej("dd",function(e,t){return t.weekdaysMinRegex(e)}),ej("ddd",function(e,t){return t.weekdaysShortRegex(e)}),ej("dddd",function(e,t){return t.weekdaysRegex(e)}),e$(["dd","ddd","dddd"],function(e,t,n,r){var i=n._locale.weekdaysParse(e,r,n._strict);null!=i?t.d=i:b(n).invalidWeekday=e}),e$(["d","e","E"],function(e,t,n,r){t[r]=el(e)});var tx="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),tT="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),tM="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),tO=eR,tA=eR,tL=eR;function tC(e,t){var n=i(this._weekdays)?this._weekdays:this._weekdays[e&&!0!==e&&this._weekdays.isFormat.test(t)?"format":"standalone"];return!0===e?tk(n,this._week.dow):e?n[e.day()]:n}function tI(e){return!0===e?tk(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort}function tD(e){return!0===e?tk(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin}function tN(e,t,n){var r,i,a,o=e.toLocaleLowerCase();if(!this._weekdaysParse)for(r=0,this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[];r<7;++r)a=h([2e3,1]).day(r),this._minWeekdaysParse[r]=this.weekdaysMin(a,"").toLocaleLowerCase(),this._shortWeekdaysParse[r]=this.weekdaysShort(a,"").toLocaleLowerCase(),this._weekdaysParse[r]=this.weekdays(a,"").toLocaleLowerCase();return n?"dddd"===t?-1!==(i=tX.call(this._weekdaysParse,o))?i:null:"ddd"===t?-1!==(i=tX.call(this._shortWeekdaysParse,o))?i:null:-1!==(i=tX.call(this._minWeekdaysParse,o))?i:null:"dddd"===t?-1!==(i=tX.call(this._weekdaysParse,o))||-1!==(i=tX.call(this._shortWeekdaysParse,o))?i:-1!==(i=tX.call(this._minWeekdaysParse,o))?i:null:"ddd"===t?-1!==(i=tX.call(this._shortWeekdaysParse,o))||-1!==(i=tX.call(this._weekdaysParse,o))?i:-1!==(i=tX.call(this._minWeekdaysParse,o))?i:null:-1!==(i=tX.call(this._minWeekdaysParse,o))||-1!==(i=tX.call(this._weekdaysParse,o))?i:-1!==(i=tX.call(this._shortWeekdaysParse,o))?i:null}function tP(e,t,n){var r,i,a;if(this._weekdaysParseExact)return tN.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),r=0;r<7;r++){if(i=h([2e3,1]).day(r),n&&!this._fullWeekdaysParse[r]&&(this._fullWeekdaysParse[r]=RegExp("^"+this.weekdays(i,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[r]=RegExp("^"+this.weekdaysShort(i,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[r]=RegExp("^"+this.weekdaysMin(i,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[r]||(a="^"+this.weekdays(i,"")+"|^"+this.weekdaysShort(i,"")+"|^"+this.weekdaysMin(i,""),this._weekdaysParse[r]=RegExp(a.replace(".",""),"i")),n&&"dddd"===t&&this._fullWeekdaysParse[r].test(e))return r;if(n&&"ddd"===t&&this._shortWeekdaysParse[r].test(e))return r;if(n&&"dd"===t&&this._minWeekdaysParse[r].test(e))return r;else if(!n&&this._weekdaysParse[r].test(e))return r}}function tR(e){if(!this.isValid())return null!=e?this:NaN;var t=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=e?(e=tE(e,this.localeData()),this.add(e-t,"d")):t}function tj(e){if(!this.isValid())return null!=e?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return null==e?t:this.add(e-t,"d")}function tF(e){if(!this.isValid())return null!=e?this:NaN;if(null==e)return this.day()||7;var t=tS(e,this.localeData());return this.day(this.day()%7?t:t-7)}function tY(e){return this._weekdaysParseExact?(o(this,"_weekdaysRegex")||tH.call(this),e)?this._weekdaysStrictRegex:this._weekdaysRegex:(o(this,"_weekdaysRegex")||(this._weekdaysRegex=tO),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)}function tB(e){return this._weekdaysParseExact?(o(this,"_weekdaysRegex")||tH.call(this),e)?this._weekdaysShortStrictRegex:this._weekdaysShortRegex:(o(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=tA),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function tU(e){return this._weekdaysParseExact?(o(this,"_weekdaysRegex")||tH.call(this),e)?this._weekdaysMinStrictRegex:this._weekdaysMinRegex:(o(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=tL),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function tH(){function e(e,t){return t.length-e.length}var t,n,r,i,a,o=[],s=[],u=[],c=[];for(t=0;t<7;t++)n=h([2e3,1]).day(t),r=eB(this.weekdaysMin(n,"")),i=eB(this.weekdaysShort(n,"")),a=eB(this.weekdays(n,"")),o.push(r),s.push(i),u.push(a),c.push(r),c.push(i),c.push(a);o.sort(e),s.sort(e),u.sort(e),c.sort(e),this._weekdaysRegex=RegExp("^("+c.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=RegExp("^("+u.join("|")+")","i"),this._weekdaysShortStrictRegex=RegExp("^("+s.join("|")+")","i"),this._weekdaysMinStrictRegex=RegExp("^("+o.join("|")+")","i")}function t$(){return this.hours()%12||12}function tz(){return this.hours()||24}function tG(e,t){B(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}function tW(e,t){return t._meridiemParse}function tK(e){return"p"===(e+"").toLowerCase().charAt(0)}B("H",["HH",2],0,"hour"),B("h",["hh",2],0,t$),B("k",["kk",2],0,tz),B("hmm",0,0,function(){return""+t$.apply(this)+P(this.minutes(),2)}),B("hmmss",0,0,function(){return""+t$.apply(this)+P(this.minutes(),2)+P(this.seconds(),2)}),B("Hmm",0,0,function(){return""+this.hours()+P(this.minutes(),2)}),B("Hmmss",0,0,function(){return""+this.hours()+P(this.minutes(),2)+P(this.seconds(),2)}),tG("a",!0),tG("A",!1),en("hour","h"),eo("hour",13),ej("a",tW),ej("A",tW),ej("H",ex),ej("h",ex),ej("k",ex),ej("HH",ex,e_),ej("hh",ex,e_),ej("kk",ex,e_),ej("hmm",eT),ej("hmmss",eM),ej("Hmm",eT),ej("Hmmss",eM),eH(["H","HH"],eV),eH(["k","kk"],function(e,t,n){var r=el(e);t[eV]=24===r?0:r}),eH(["a","A"],function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e}),eH(["h","hh"],function(e,t,n){t[eV]=el(e),b(n).bigHour=!0}),eH("hmm",function(e,t,n){var r=e.length-2;t[eV]=el(e.substr(0,r)),t[eq]=el(e.substr(r)),b(n).bigHour=!0}),eH("hmmss",function(e,t,n){var r=e.length-4,i=e.length-2;t[eV]=el(e.substr(0,r)),t[eq]=el(e.substr(r,2)),t[eZ]=el(e.substr(i)),b(n).bigHour=!0}),eH("Hmm",function(e,t,n){var r=e.length-2;t[eV]=el(e.substr(0,r)),t[eq]=el(e.substr(r))}),eH("Hmmss",function(e,t,n){var r=e.length-4,i=e.length-2;t[eV]=el(e.substr(0,r)),t[eq]=el(e.substr(r,2)),t[eZ]=el(e.substr(i))});var tV=/[ap]\.?m?\.?/i,tq=ef("Hours",!0);function tZ(e,t,n){return e>11?n?"pm":"PM":n?"am":"AM"}var tX,tJ,tQ={calendar:D,longDateFormat:G,invalidDate:K,ordinal:q,dayOfMonthOrdinalParse:Z,relativeTime:J,months:e2,monthsShort:e3,week:tg,weekdays:tx,weekdaysMin:tM,weekdaysShort:tT,meridiemParse:tV},t1={},t0={};function t2(e,t){var n,r=Math.min(e.length,t.length);for(n=0;n0;){if(r=t6(i.slice(0,t).join("-")))return r;if(n&&n.length>=t&&t2(i,n)>=t-1)break;t--}a++}return tJ}function t6(t){var r,i=null;if(void 0===t1[t]&&e&&e.exports)try{i=tJ._abbr,r=void 0,n(46700)("./"+t),t5(i)}catch(a){t1[t]=null}return t1[t]}function t5(e,t){var n;return e&&((n=u(t)?t7(e):t8(e,t))?tJ=n:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),tJ._abbr}function t8(e,t){if(null===t)return delete t1[e],null;var n,r=tQ;if(t.abbr=e,null!=t1[e])O("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),r=t1[e]._config;else if(null!=t.parentLocale){if(null!=t1[t.parentLocale])r=t1[t.parentLocale]._config;else{if(null==(n=t6(t.parentLocale)))return t0[t.parentLocale]||(t0[t.parentLocale]=[]),t0[t.parentLocale].push({name:e,config:t}),null;r=n._config}}return t1[e]=new I(C(r,t)),t0[e]&&t0[e].forEach(function(e){t8(e.name,e.config)}),t5(e),t1[e]}function t9(e,t){if(null!=t){var n,r,i=tQ;null!=t1[e]&&null!=t1[e].parentLocale?t1[e].set(C(t1[e]._config,t)):(null!=(r=t6(e))&&(i=r._config),t=C(i,t),null==r&&(t.abbr=e),(n=new I(t)).parentLocale=t1[e],t1[e]=n),t5(e)}else null!=t1[e]&&(null!=t1[e].parentLocale?(t1[e]=t1[e].parentLocale,e===t5()&&t5(e)):null!=t1[e]&&delete t1[e]);return t1[e]}function t7(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return tJ;if(!i(e)){if(t=t6(e))return t;e=[e]}return t4(e)}function ne(){return ev(t1)}function nt(e){var t,n=e._a;return n&&-2===b(e).overflow&&(t=n[eW]<0||n[eW]>11?eW:n[eK]<1||n[eK]>e0(n[eG],n[eW])?eK:n[eV]<0||n[eV]>24||24===n[eV]&&(0!==n[eq]||0!==n[eZ]||0!==n[eX])?eV:n[eq]<0||n[eq]>59?eq:n[eZ]<0||n[eZ]>59?eZ:n[eX]<0||n[eX]>999?eX:-1,b(e)._overflowDayOfYear&&(teK)&&(t=eK),b(e)._overflowWeeks&&-1===t&&(t=eJ),b(e)._overflowWeekday&&-1===t&&(t=eQ),b(e).overflow=t),e}var nn=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,nr=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,ni=/Z|[+-]\d\d(?::?\d\d)?/,na=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1],],no=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/],],ns=/^\/?Date\((-?\d+)/i,nu=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,nc={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function nl(e){var t,n,r,i,a,o,s=e._i,u=nn.exec(s)||nr.exec(s);if(u){for(t=0,b(e).iso=!0,n=na.length;tts(a)||0===e._dayOfYear)&&(b(e)._overflowDayOfYear=!0),n=tf(a,0,e._dayOfYear),e._a[eW]=n.getUTCMonth(),e._a[eK]=n.getUTCDate()),t=0;t<3&&null==e._a[t];++t)e._a[t]=o[t]=r[t];for(;t<7;t++)e._a[t]=o[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[eV]&&0===e._a[eq]&&0===e._a[eZ]&&0===e._a[eX]&&(e._nextDay=!0,e._a[eV]=0),e._d=(e._useUTC?tf:tl).apply(null,o),i=e._useUTC?e._d.getUTCDay():e._d.getDay(),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[eV]=24),e._w&&void 0!==e._w.d&&e._w.d!==i&&(b(e).weekdayMismatch=!0)}}function n_(e){var t,n,r,i,a,o,s,u,c;null!=(t=e._w).GG||null!=t.W||null!=t.E?(a=1,o=4,n=nv(t.GG,e._a[eG],tp(nL(),1,4).year),r=nv(t.W,1),((i=nv(t.E,1))<1||i>7)&&(u=!0)):(a=e._locale._week.dow,o=e._locale._week.doy,c=tp(nL(),a,o),n=nv(t.gg,e._a[eG],c.year),r=nv(t.w,c.week),null!=t.d?((i=t.d)<0||i>6)&&(u=!0):null!=t.e?(i=t.e+a,(t.e<0||t.e>6)&&(u=!0)):i=a),r<1||r>tb(n,a,o)?b(e)._overflowWeeks=!0:null!=u?b(e)._overflowWeekday=!0:(s=th(n,r,i,a,o),e._a[eG]=s.year,e._dayOfYear=s.dayOfYear)}function nE(e){if(e._f===t.ISO_8601){nl(e);return}if(e._f===t.RFC_2822){nm(e);return}e._a=[],b(e).empty=!0;var n,r,i,a,o,s,u=""+e._i,c=u.length,l=0;for(n=0,i=z(e._f,e._locale).match(R)||[];n0&&b(e).unusedInput.push(o),u=u.slice(u.indexOf(r)+r.length),l+=r.length),Y[a]?(r?b(e).empty=!1:b(e).unusedTokens.push(a),ez(a,r,e)):e._strict&&!r&&b(e).unusedTokens.push(a);b(e).charsLeftOver=c-l,u.length>0&&b(e).unusedInput.push(u),e._a[eV]<=12&&!0===b(e).bigHour&&e._a[eV]>0&&(b(e).bigHour=void 0),b(e).parsedDateParts=e._a.slice(0),b(e).meridiem=e._meridiem,e._a[eV]=nS(e._locale,e._a[eV],e._meridiem),null!==(s=b(e).era)&&(e._a[eG]=e._locale.erasConvertYear(s,e._a[eG])),nw(e),nt(e)}function nS(e,t,n){var r;return null==n?t:null!=e.meridiemHour?e.meridiemHour(t,n):(null!=e.isPM&&((r=e.isPM(n))&&t<12&&(t+=12),r||12!==t||(t=0)),t)}function nk(e){var t,n,r,i,a,o,s=!1;if(0===e._f.length){b(e).invalidFormat=!0,e._d=new Date(NaN);return}for(i=0;ithis?this:e:g()});function nD(e,t){var n,r;if(1===t.length&&i(t[0])&&(t=t[0]),!t.length)return nL();for(r=1,n=t[0];rMath.abs(e)&&!r&&(e*=60);return!this._isUTC&&n&&(i=nq(this)),this._offset=e,this._isUTC=!0,null!=i&&this.add(i,"m"),a===e||(!n||this._changeInProgress?ri(this,n7(e-a,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,t.updateOffset(this,!0),this._changeInProgress=null)),this}function nX(e,t){return null!=e?("string"!=typeof e&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}function nJ(e){return this.utcOffset(0,e)}function nQ(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(nq(this),"m")),this}function n1(){if(null!=this._tzm)this.utcOffset(this._tzm,!1,!0);else if("string"==typeof this._i){var e=nK(eD,this._i);null!=e?this.utcOffset(e):this.utcOffset(0,!0)}return this}function n0(e){return!!this.isValid()&&(e=e?nL(e).utcOffset():0,(this.utcOffset()-e)%60==0)}function n2(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function n3(){if(!u(this._isDSTShifted))return this._isDSTShifted;var e,t={};return E(t,this),(t=nM(t))._a?(e=t._isUTC?h(t._a):nL(t._a),this._isDSTShifted=this.isValid()&&nz(t._a,e.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function n4(){return!!this.isValid()&&!this._isUTC}function n6(){return!!this.isValid()&&this._isUTC}function n5(){return!!this.isValid()&&this._isUTC&&0===this._offset}t.updateOffset=function(){};var n8=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,n9=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function n7(e,t){var n,r,i,a=e,s=null;return nH(e)?a={ms:e._milliseconds,d:e._days,M:e._months}:c(e)||!isNaN(+e)?(a={},t?a[t]=+e:a.milliseconds=+e):(s=n8.exec(e))?(n="-"===s[1]?-1:1,a={y:0,d:el(s[eK])*n,h:el(s[eV])*n,m:el(s[eq])*n,s:el(s[eZ])*n,ms:el(n$(1e3*s[eX]))*n}):(s=n9.exec(e))?(n="-"===s[1]?-1:1,a={y:re(s[2],n),M:re(s[3],n),w:re(s[4],n),d:re(s[5],n),h:re(s[6],n),m:re(s[7],n),s:re(s[8],n)}):null==a?a={}:"object"==typeof a&&("from"in a||"to"in a)&&(i=rn(nL(a.from),nL(a.to)),(a={}).ms=i.milliseconds,a.M=i.months),r=new nU(a),nH(e)&&o(e,"_locale")&&(r._locale=e._locale),nH(e)&&o(e,"_isValid")&&(r._isValid=e._isValid),r}function re(e,t){var n=e&&parseFloat(e.replace(",","."));return(isNaN(n)?0:n)*t}function rt(e,t){var n={};return n.months=t.month()-e.month()+(t.year()-e.year())*12,e.clone().add(n.months,"M").isAfter(t)&&--n.months,n.milliseconds=+t-+e.clone().add(n.months,"M"),n}function rn(e,t){var n;return e.isValid()&&t.isValid()?(t=nV(t,e),e.isBefore(t)?n=rt(e,t):((n=rt(t,e)).milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function rr(e,t){return function(n,r){var i,a;return null===r||isNaN(+r)||(O(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),a=n,n=r,r=a),i=n7(n,r),ri(this,i,e),this}}function ri(e,n,r,i){var a=n._milliseconds,o=n$(n._days),s=n$(n._months);e.isValid()&&(i=null==i||i,s&&tt(e,ed(e,"Month")+s*r),o&&eh(e,"Date",ed(e,"Date")+o*r),a&&e._d.setTime(e._d.valueOf()+a*r),i&&t.updateOffset(e,o||s))}n7.fn=nU.prototype,n7.invalid=nB;var ra=rr(1,"add"),ro=rr(-1,"subtract");function rs(e){return"string"==typeof e||e instanceof String}function ru(e){return k(e)||l(e)||rs(e)||c(e)||rl(e)||rc(e)||null==e}function rc(e){var t,n,r=a(e)&&!s(e),i=!1,u=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms",];for(t=0;tn.valueOf():n.valueOf()n.year()||n.year()>9999?$(n,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):A(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+6e4*this.utcOffset()).toISOString().replace("Z",$(n,"Z")):$(n,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function rx(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e,t,n,r,i="moment",a="";return this.isLocal()||(i=0===this.utcOffset()?"moment.utc":"moment.parseZone",a="Z"),e="["+i+'("]',t=0<=this.year()&&9999>=this.year()?"YYYY":"YYYYYY",n="-MM-DD[T]HH:mm:ss.SSS",r=a+'[")]',this.format(e+t+n+r)}function rT(e){e||(e=this.isUtc()?t.defaultFormatUtc:t.defaultFormat);var n=$(this,e);return this.localeData().postformat(n)}function rM(e,t){return this.isValid()&&(k(e)&&e.isValid()||nL(e).isValid())?n7({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function rO(e){return this.from(nL(),e)}function rA(e,t){return this.isValid()&&(k(e)&&e.isValid()||nL(e).isValid())?n7({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function rL(e){return this.to(nL(),e)}function rC(e){var t;return void 0===e?this._locale._abbr:(null!=(t=t7(e))&&(this._locale=t),this)}t.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",t.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var rI=T("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){return void 0===e?this.localeData():this.locale(e)});function rD(){return this._locale}var rN=1e3,rP=60*rN,rR=60*rP,rj=3506328*rR;function rF(e,t){return(e%t+t)%t}function rY(e,t,n){return e<100&&e>=0?new Date(e+400,t,n)-rj:new Date(e,t,n).valueOf()}function rB(e,t,n){return e<100&&e>=0?Date.UTC(e+400,t,n)-rj:Date.UTC(e,t,n)}function rU(e){var n,r;if(void 0===(e=er(e))||"millisecond"===e||!this.isValid())return this;switch(r=this._isUTC?rB:rY,e){case"year":n=r(this.year(),0,1);break;case"quarter":n=r(this.year(),this.month()-this.month()%3,1);break;case"month":n=r(this.year(),this.month(),1);break;case"week":n=r(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":n=r(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":n=r(this.year(),this.month(),this.date());break;case"hour":n=this._d.valueOf(),n-=rF(n+(this._isUTC?0:this.utcOffset()*rP),rR);break;case"minute":n=this._d.valueOf(),n-=rF(n,rP);break;case"second":n=this._d.valueOf(),n-=rF(n,rN)}return this._d.setTime(n),t.updateOffset(this,!0),this}function rH(e){var n,r;if(void 0===(e=er(e))||"millisecond"===e||!this.isValid())return this;switch(r=this._isUTC?rB:rY,e){case"year":n=r(this.year()+1,0,1)-1;break;case"quarter":n=r(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":n=r(this.year(),this.month()+1,1)-1;break;case"week":n=r(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":n=r(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":n=r(this.year(),this.month(),this.date()+1)-1;break;case"hour":n=this._d.valueOf(),n+=rR-rF(n+(this._isUTC?0:this.utcOffset()*rP),rR)-1;break;case"minute":n=this._d.valueOf(),n+=rP-rF(n,rP)-1;break;case"second":n=this._d.valueOf(),n+=rN-rF(n,rN)-1}return this._d.setTime(n),t.updateOffset(this,!0),this}function r$(){return this._d.valueOf()-6e4*(this._offset||0)}function rz(){return Math.floor(this.valueOf()/1e3)}function rG(){return new Date(this.valueOf())}function rW(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond(),]}function rK(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}}function rV(){return this.isValid()?this.toISOString():null}function rq(){return m(this)}function rZ(){return d({},b(this))}function rX(){return b(this).overflow}function rJ(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}function rQ(e,n){var r,i,a,o=this._eras||t7("en")._eras;for(r=0,i=o.length;r=0)return u[r]}function r0(e,n){var r=e.since<=e.until?1:-1;return void 0===n?t(e.since).year():t(e.since).year()+(n-e.offset)*r}function r2(){var e,t,n,r=this.localeData().eras();for(e=0,t=r.length;ea&&(t=a),ip.call(this,e,t,n,r,i))}function ip(e,t,n,r,i){var a=th(e,t,n,r,i),o=tf(a.year,0,a.dayOfYear);return this.year(o.getUTCFullYear()),this.month(o.getUTCMonth()),this.date(o.getUTCDate()),this}function ib(e){return null==e?Math.ceil((this.month()+1)/3):this.month((e-1)*3+this.month()%3)}B("N",0,0,"eraAbbr"),B("NN",0,0,"eraAbbr"),B("NNN",0,0,"eraAbbr"),B("NNNN",0,0,"eraName"),B("NNNNN",0,0,"eraNarrow"),B("y",["y",1],"yo","eraYear"),B("y",["yy",2],0,"eraYear"),B("y",["yyy",3],0,"eraYear"),B("y",["yyyy",4],0,"eraYear"),ej("N",r7),ej("NN",r7),ej("NNN",r7),ej("NNNN",ie),ej("NNNNN",it),eH(["N","NN","NNN","NNNN","NNNNN"],function(e,t,n,r){var i=n._locale.erasParse(e,r,n._strict);i?b(n).era=i:b(n).invalidEra=e}),ej("y",eC),ej("yy",eC),ej("yyy",eC),ej("yyyy",eC),ej("yo",ir),eH(["y","yy","yyy","yyyy"],eG),eH(["yo"],function(e,t,n,r){var i;n._locale._eraYearOrdinalRegex&&(i=e.match(n._locale._eraYearOrdinalRegex)),n._locale.eraYearOrdinalParse?t[eG]=n._locale.eraYearOrdinalParse(e,i):t[eG]=parseInt(e,10)}),B(0,["gg",2],0,function(){return this.weekYear()%100}),B(0,["GG",2],0,function(){return this.isoWeekYear()%100}),ia("gggg","weekYear"),ia("ggggg","weekYear"),ia("GGGG","isoWeekYear"),ia("GGGGG","isoWeekYear"),en("weekYear","gg"),en("isoWeekYear","GG"),eo("weekYear",1),eo("isoWeekYear",1),ej("G",eI),ej("g",eI),ej("GG",ex,e_),ej("gg",ex,e_),ej("GGGG",eA,eS),ej("gggg",eA,eS),ej("GGGGG",eL,ek),ej("ggggg",eL,ek),e$(["gggg","ggggg","GGGG","GGGGG"],function(e,t,n,r){t[r.substr(0,2)]=el(e)}),e$(["gg","GG"],function(e,n,r,i){n[i]=t.parseTwoDigitYear(e)}),B("Q",0,"Qo","quarter"),en("quarter","Q"),eo("quarter",7),ej("Q",ew),eH("Q",function(e,t){t[eW]=(el(e)-1)*3}),B("D",["DD",2],"Do","date"),en("date","D"),eo("date",9),ej("D",ex),ej("DD",ex,e_),ej("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient}),eH(["D","DD"],eK),eH("Do",function(e,t){t[eK]=el(e.match(ex)[0])});var im=ef("Date",!0);function ig(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==e?t:this.add(e-t,"d")}B("DDD",["DDDD",3],"DDDo","dayOfYear"),en("dayOfYear","DDD"),eo("dayOfYear",4),ej("DDD",eO),ej("DDDD",eE),eH(["DDD","DDDD"],function(e,t,n){n._dayOfYear=el(e)}),B("m",["mm",2],0,"minute"),en("minute","m"),eo("minute",14),ej("m",ex),ej("mm",ex,e_),eH(["m","mm"],eq);var iv=ef("Minutes",!1);B("s",["ss",2],0,"second"),en("second","s"),eo("second",15),ej("s",ex),ej("ss",ex,e_),eH(["s","ss"],eZ);var iy=ef("Seconds",!1);for(B("S",0,0,function(){return~~(this.millisecond()/100)}),B(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),B(0,["SSS",3],0,"millisecond"),B(0,["SSSS",4],0,function(){return 10*this.millisecond()}),B(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),B(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),B(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),B(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),B(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),en("millisecond","ms"),eo("millisecond",16),ej("S",eO,ew),ej("SS",eO,e_),ej("SSS",eO,eE),v="SSSS";v.length<=9;v+="S")ej(v,eC);function iw(e,t){t[eX]=el(("0."+e)*1e3)}for(v="S";v.length<=9;v+="S")eH(v,iw);function i_(){return this._isUTC?"UTC":""}function iE(){return this._isUTC?"Coordinated Universal Time":""}y=ef("Milliseconds",!1),B("z",0,0,"zoneAbbr"),B("zz",0,0,"zoneName");var iS=S.prototype;function ik(e){return nL(1e3*e)}function ix(){return nL.apply(null,arguments).parseZone()}function iT(e){return e}iS.add=ra,iS.calendar=rh,iS.clone=rp,iS.diff=r_,iS.endOf=rH,iS.format=rT,iS.from=rM,iS.fromNow=rO,iS.to=rA,iS.toNow=rL,iS.get=ep,iS.invalidAt=rX,iS.isAfter=rb,iS.isBefore=rm,iS.isBetween=rg,iS.isSame=rv,iS.isSameOrAfter=ry,iS.isSameOrBefore=rw,iS.isValid=rq,iS.lang=rI,iS.locale=rC,iS.localeData=rD,iS.max=nI,iS.min=nC,iS.parsingFlags=rZ,iS.set=eb,iS.startOf=rU,iS.subtract=ro,iS.toArray=rW,iS.toObject=rK,iS.toDate=rG,iS.toISOString=rk,iS.inspect=rx,"undefined"!=typeof Symbol&&null!=Symbol.for&&(iS[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),iS.toJSON=rV,iS.toString=rS,iS.unix=rz,iS.valueOf=r$,iS.creationData=rJ,iS.eraName=r2,iS.eraNarrow=r3,iS.eraAbbr=r4,iS.eraYear=r6,iS.year=tu,iS.isLeapYear=tc,iS.weekYear=io,iS.isoWeekYear=is,iS.quarter=iS.quarters=ib,iS.month=tn,iS.daysInMonth=tr,iS.week=iS.weeks=tw,iS.isoWeek=iS.isoWeeks=t_,iS.weeksInYear=il,iS.weeksInWeekYear=id,iS.isoWeeksInYear=iu,iS.isoWeeksInISOWeekYear=ic,iS.date=im,iS.day=iS.days=tR,iS.weekday=tj,iS.isoWeekday=tF,iS.dayOfYear=ig,iS.hour=iS.hours=tq,iS.minute=iS.minutes=iv,iS.second=iS.seconds=iy,iS.millisecond=iS.milliseconds=y,iS.utcOffset=nZ,iS.utc=nJ,iS.local=nQ,iS.parseZone=n1,iS.hasAlignedHourOffset=n0,iS.isDST=n2,iS.isLocal=n4,iS.isUtcOffset=n6,iS.isUtc=n5,iS.isUTC=n5,iS.zoneAbbr=i_,iS.zoneName=iE,iS.dates=T("dates accessor is deprecated. Use date instead.",im),iS.months=T("months accessor is deprecated. Use month instead",tn),iS.years=T("years accessor is deprecated. Use year instead",tu),iS.zone=T("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",nX),iS.isDSTShifted=T("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",n3);var iM=I.prototype;function iO(e,t,n,r){var i=t7(),a=h().set(r,t);return i[n](a,e)}function iA(e,t,n){if(c(e)&&(t=e,e=void 0),e=e||"",null!=t)return iO(e,t,n,"month");var r,i=[];for(r=0;r<12;r++)i[r]=iO(e,r,n,"month");return i}function iL(e,t,n,r){"boolean"==typeof e?(c(t)&&(n=t,t=void 0),t=t||""):(n=t=e,e=!1,c(t)&&(n=t,t=void 0),t=t||"");var i,a=t7(),o=e?a._week.dow:0,s=[];if(null!=n)return iO(t,(n+o)%7,r,"day");for(i=0;i<7;i++)s[i]=iO(t,(i+o)%7,r,"day");return s}function iC(e,t){return iA(e,t,"months")}function iI(e,t){return iA(e,t,"monthsShort")}function iD(e,t,n){return iL(e,t,n,"weekdays")}function iN(e,t,n){return iL(e,t,n,"weekdaysShort")}function iP(e,t,n){return iL(e,t,n,"weekdaysMin")}iM.calendar=N,iM.longDateFormat=W,iM.invalidDate=V,iM.ordinal=X,iM.preparse=iT,iM.postformat=iT,iM.relativeTime=Q,iM.pastFuture=ee,iM.set=L,iM.eras=rQ,iM.erasParse=r1,iM.erasConvertYear=r0,iM.erasAbbrRegex=r8,iM.erasNameRegex=r5,iM.erasNarrowRegex=r9,iM.months=e8,iM.monthsShort=e9,iM.monthsParse=te,iM.monthsRegex=ta,iM.monthsShortRegex=ti,iM.week=tm,iM.firstDayOfYear=ty,iM.firstDayOfWeek=tv,iM.weekdays=tC,iM.weekdaysMin=tD,iM.weekdaysShort=tI,iM.weekdaysParse=tP,iM.weekdaysRegex=tY,iM.weekdaysShortRegex=tB,iM.weekdaysMinRegex=tU,iM.isPM=tK,iM.meridiem=tZ,t5("en",{eras:[{since:"0001-01-01",until:Infinity,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"},],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10,n=1===el(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th";return e+n}}),t.lang=T("moment.lang is deprecated. Use moment.locale instead.",t5),t.langData=T("moment.langData is deprecated. Use moment.localeData instead.",t7);var iR=Math.abs;function ij(){var e=this._data;return this._milliseconds=iR(this._milliseconds),this._days=iR(this._days),this._months=iR(this._months),e.milliseconds=iR(e.milliseconds),e.seconds=iR(e.seconds),e.minutes=iR(e.minutes),e.hours=iR(e.hours),e.months=iR(e.months),e.years=iR(e.years),this}function iF(e,t,n,r){var i=n7(t,n);return e._milliseconds+=r*i._milliseconds,e._days+=r*i._days,e._months+=r*i._months,e._bubble()}function iY(e,t){return iF(this,e,t,1)}function iB(e,t){return iF(this,e,t,-1)}function iU(e){return e<0?Math.floor(e):Math.ceil(e)}function iH(){var e,t,n,r,i,a=this._milliseconds,o=this._days,s=this._months,u=this._data;return a>=0&&o>=0&&s>=0||a<=0&&o<=0&&s<=0||(a+=864e5*iU(iz(s)+o),o=0,s=0),u.milliseconds=a%1e3,e=ec(a/1e3),u.seconds=e%60,t=ec(e/60),u.minutes=t%60,n=ec(t/60),u.hours=n%24,o+=ec(n/24),s+=i=ec(i$(o)),o-=iU(iz(i)),r=ec(s/12),s%=12,u.days=o,u.months=s,u.years=r,this}function i$(e){return 4800*e/146097}function iz(e){return 146097*e/4800}function iG(e){if(!this.isValid())return NaN;var t,n,r=this._milliseconds;if("month"===(e=er(e))||"quarter"===e||"year"===e)switch(t=this._days+r/864e5,n=this._months+i$(t),e){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(t=this._days+Math.round(iz(this._months)),e){case"week":return t/7+r/6048e5;case"day":return t+r/864e5;case"hour":return 24*t+r/36e5;case"minute":return 1440*t+r/6e4;case"second":return 86400*t+r/1e3;case"millisecond":return Math.floor(864e5*t)+r;default:throw Error("Unknown unit "+e)}}function iW(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*el(this._months/12):NaN}function iK(e){return function(){return this.as(e)}}var iV=iK("ms"),iq=iK("s"),iZ=iK("m"),iX=iK("h"),iJ=iK("d"),iQ=iK("w"),i1=iK("M"),i0=iK("Q"),i2=iK("y");function i3(){return n7(this)}function i4(e){return e=er(e),this.isValid()?this[e+"s"]():NaN}function i6(e){return function(){return this.isValid()?this._data[e]:NaN}}var i5=i6("milliseconds"),i8=i6("seconds"),i9=i6("minutes"),i7=i6("hours"),ae=i6("days"),at=i6("months"),an=i6("years");function ar(){return ec(this.days()/7)}var ai=Math.round,aa={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function ao(e,t,n,r,i){return i.relativeTime(t||1,!!n,e,r)}function as(e,t,n,r){var i=n7(e).abs(),a=ai(i.as("s")),o=ai(i.as("m")),s=ai(i.as("h")),u=ai(i.as("d")),c=ai(i.as("M")),l=ai(i.as("w")),f=ai(i.as("y")),d=a<=n.ss&&["s",a]||a0,d[4]=r,ao.apply(null,d)}function au(e){return void 0===e?ai:"function"==typeof e&&(ai=e,!0)}function ac(e,t){return void 0!==aa[e]&&(void 0===t?aa[e]:(aa[e]=t,"s"===e&&(aa.ss=t-1),!0))}function al(e,t){if(!this.isValid())return this.localeData().invalidDate();var n,r,i=!1,a=aa;return"object"==typeof e&&(t=e,e=!1),"boolean"==typeof e&&(i=e),"object"==typeof t&&(a=Object.assign({},aa,t),null!=t.s&&null==t.ss&&(a.ss=t.s-1)),r=as(this,!i,a,n=this.localeData()),i&&(r=n.pastFuture(+this,r)),n.postformat(r)}var af=Math.abs;function ad(e){return(e>0)-(e<0)||+e}function ah(){if(!this.isValid())return this.localeData().invalidDate();var e,t,n,r,i,a,o,s,u=af(this._milliseconds)/1e3,c=af(this._days),l=af(this._months),f=this.asSeconds();return f?(e=ec(u/60),t=ec(e/60),u%=60,e%=60,n=ec(l/12),l%=12,r=u?u.toFixed(3).replace(/\.?0+$/,""):"",i=f<0?"-":"",a=ad(this._months)!==ad(f)?"-":"",o=ad(this._days)!==ad(f)?"-":"",s=ad(this._milliseconds)!==ad(f)?"-":"",i+"P"+(n?a+n+"Y":"")+(l?a+l+"M":"")+(c?o+c+"D":"")+(t||e||u?"T":"")+(t?s+t+"H":"")+(e?s+e+"M":"")+(u?s+r+"S":"")):"P0D"}var ap=nU.prototype;return ap.isValid=nY,ap.abs=ij,ap.add=iY,ap.subtract=iB,ap.as=iG,ap.asMilliseconds=iV,ap.asSeconds=iq,ap.asMinutes=iZ,ap.asHours=iX,ap.asDays=iJ,ap.asWeeks=iQ,ap.asMonths=i1,ap.asQuarters=i0,ap.asYears=i2,ap.valueOf=iW,ap._bubble=iH,ap.clone=i3,ap.get=i4,ap.milliseconds=i5,ap.seconds=i8,ap.minutes=i9,ap.hours=i7,ap.days=ae,ap.weeks=ar,ap.months=at,ap.years=an,ap.humanize=al,ap.toISOString=ah,ap.toString=ah,ap.toJSON=ah,ap.locale=rC,ap.localeData=rD,ap.toIsoString=T("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",ah),ap.lang=rI,B("X",0,0,"unix"),B("x",0,0,"valueOf"),ej("x",eI),ej("X",eP),eH("X",function(e,t,n){n._d=new Date(1e3*parseFloat(e))}),eH("x",function(e,t,n){n._d=new Date(el(e))}),//! moment.js -t.version="2.29.1",r(nL),t.fn=iS,t.min=nN,t.max=nP,t.now=nR,t.utc=h,t.unix=ik,t.months=iC,t.isDate=l,t.locale=t5,t.invalid=g,t.duration=n7,t.isMoment=k,t.weekdays=iD,t.parseZone=ix,t.localeData=t7,t.isDuration=nH,t.monthsShort=iI,t.weekdaysMin=iP,t.defineLocale=t8,t.updateLocale=t9,t.locales=ne,t.weekdaysShort=iN,t.normalizeUnits=er,t.relativeTimeRounding=au,t.relativeTimeThreshold=ac,t.calendarFormat=rd,t.prototype=iS,t.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},t},e.exports=i()},46417(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,r=!!("undefined"!=typeof window&&window.document&&window.document.createElement);function i(e){n=e}function a(){if(n)return n;if(!r||!window.document.body)return"indeterminate";var e=window.document.createElement("div");return e.appendChild(document.createTextNode("ABCD")),e.dir="rtl",e.style.fontSize="14px",e.style.width="4px",e.style.height="1px",e.style.position="absolute",e.style.top="-1000px",e.style.overflow="scroll",document.body.appendChild(e),n="reverse",e.scrollLeft>0?n="default":(e.scrollLeft=1,0===e.scrollLeft&&(n="negative")),document.body.removeChild(e),n}function o(e,t){var n=e.scrollLeft;if("rtl"!==t)return n;var r=a();if("indeterminate"===r)return Number.NaN;switch(r){case"negative":return e.scrollWidth-e.clientWidth+n;case"reverse":return e.scrollWidth-e.clientWidth-n}return n}function s(e,t,n){if("rtl"!==n){e.scrollLeft=t;return}var r=a();if("indeterminate"!==r)switch(r){case"negative":e.scrollLeft=e.clientWidth-e.scrollWidth+t;break;case"reverse":e.scrollLeft=e.scrollWidth-e.clientWidth-t;break;default:e.scrollLeft=t}}t._setScrollType=i,t.detectScrollType=a,t.getNormalizedScrollLeft=o,t.setNormalizedScrollLeft=s},27418(e){"use strict";/* -object-assign -(c) Sindre Sorhus -@license MIT -*/ var t=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;function i(e){if(null==e)throw TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function a(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;var r=Object.getOwnPropertyNames(t).map(function(e){return t[e]});if("0123456789"!==r.join(""))return!1;var i={};if("abcdefghijklmnopqrst".split("").forEach(function(e){i[e]=e}),"abcdefghijklmnopqrst"!==Object.keys(Object.assign({},i)).join(""))return!1;return!0}catch(a){return!1}}e.exports=a()?Object.assign:function(e,a){for(var o,s,u=i(e),c=1;c65535&&(Y-=65536,G+=l(Y>>>10|55296),Y=56320|1023&Y),Y=G+l(Y))):q!==x&&$(D,Q)),Y?(ew(),X=ev(),ed=ee-1,ep+=ee-V+1,eg.push(Y),J=ev(),J.offset++,ei&&ei.call(es,Y,{start:X,end:J},e.slice(V-1,ee)),X=J):(em+=d=e.slice(V-1,ee),ep+=d.length,ed=ee-1)}else 10===F&&(eb++,eh++,ep=0),F==F?(em+=l(F),ep++):ew();return eg.join("");function ev(){return{line:eb,column:ep,offset:ed+(ec.offset||0)}}function ey(e,t){var n=ev();n.column+=t,n.offset+=t,ea.call(eu,j[e],n,e)}function ew(){em&&(eg.push(em),er&&er.call(eo,em,{start:X,end:ev()}),em="")}}function B(e){return e>=55296&&e<=57343||e>1114111}function U(e){return e>=1&&e<=8||11===e||e>=13&&e<=31||e>=127&&e<=159||e>=64976&&e<=65007||(65535&e)==65535||(65535&e)==65534}j[L]="Named character references must be terminated by a semicolon",j[C]="Numeric character references must be terminated by a semicolon",j[I]="Named character references cannot be empty",j[D]="Numeric character references cannot be empty",j[N]="Named character references must be known",j[P]="Numeric character references cannot be disallowed",j[R]="Numeric character references cannot be outside the permissible Unicode range"},14779(e){e.exports=b,e.exports.match=a,e.exports.regexpToFunction=o,e.exports.parse=r,e.exports.compile=i,e.exports.tokensToFunction=s,e.exports.tokensToRegExp=p;var t="/",n=RegExp("(\\\\.)|(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?","g");function r(e,r){for(var i,a=[],o=0,s=0,l="",f=r&&r.delimiter||t,d=r&&r.whitelist||void 0,h=!1;null!==(i=n.exec(e));){var p=i[0],b=i[1],m=i.index;if(l+=e.slice(s,m),s=m+p.length,b){l+=b[1],h=!0;continue}var g="",v=i[2],y=i[3],w=i[4],_=i[5];if(!h&&l.length){var E=l.length-1,S=l[E];(!d||d.indexOf(S)>-1)&&(g=S,l=l.slice(0,E))}l&&(a.push(l),l="",h=!1);var k="+"===_||"*"===_,x="?"===_||"*"===_,T=y||w,M=g||f;a.push({name:v||o++,prefix:g,delimiter:M,optional:x,repeat:k,pattern:T?c(T):"[^"+u(M===f?M:M+f)+"]+?"})}return(l||seM});/**! - * @fileOverview Kickass library to create and place poppers near their reference elements. - * @version 1.16.0 - * @license - * Copyright (c) 2016 Federico Zivolo and contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ var r="undefined"!=typeof window&&"undefined"!=typeof document&&"undefined"!=typeof navigator,i=function(){for(var e=["Edge","Trident","Firefox"],t=0;t=0)return 1;return 0}();function a(e){var t=!1;return function(){!t&&(t=!0,window.Promise.resolve().then(function(){t=!1,e()}))}}function o(e){var t=!1;return function(){t||(t=!0,setTimeout(function(){t=!1,e()},i))}}var s=r&&window.Promise?a:o;function u(e){var t={};return e&&"[object Function]"===t.toString.call(e)}function c(e,t){if(1!==e.nodeType)return[];var n=e.ownerDocument.defaultView.getComputedStyle(e,null);return t?n[t]:n}function l(e){return"HTML"===e.nodeName?e:e.parentNode||e.host}function f(e){if(!e)return document.body;switch(e.nodeName){case"HTML":case"BODY":return e.ownerDocument.body;case"#document":return e.body}var t=c(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/(auto|scroll|overlay)/.test(n+i+r)?e:f(l(e))}function d(e){return e&&e.referenceNode?e.referenceNode:e}var h=r&&!!(window.MSInputMethodContext&&document.documentMode),p=r&&/MSIE 10/.test(navigator.userAgent);function b(e){return 11===e?h:10===e?p:h||p}function m(e){if(!e)return document.documentElement;for(var t=b(10)?document.body:null,n=e.offsetParent||null;n===t&&e.nextElementSibling;)n=(e=e.nextElementSibling).offsetParent;var r=n&&n.nodeName;return r&&"BODY"!==r&&"HTML"!==r?-1!==["TH","TD","TABLE"].indexOf(n.nodeName)&&"static"===c(n,"position")?m(n):n:e?e.ownerDocument.documentElement:document.documentElement}function g(e){var t=e.nodeName;return"BODY"!==t&&("HTML"===t||m(e.firstElementChild)===e)}function v(e){return null!==e.parentNode?v(e.parentNode):e}function y(e,t){if(!e||!e.nodeType||!t||!t.nodeType)return document.documentElement;var n=e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING,r=n?e:t,i=n?t:e,a=document.createRange();a.setStart(r,0),a.setEnd(i,0);var o=a.commonAncestorContainer;if(e!==o&&t!==o||r.contains(i))return g(o)?o:m(o);var s=v(e);return s.host?y(s.host,t):y(e,v(t).host)}function w(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"top",n="top"===t?"scrollTop":"scrollLeft",r=e.nodeName;if("BODY"===r||"HTML"===r){var i=e.ownerDocument.documentElement;return(e.ownerDocument.scrollingElement||i)[n]}return e[n]}function _(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=w(t,"top"),i=w(t,"left"),a=n?-1:1;return e.top+=r*a,e.bottom+=r*a,e.left+=i*a,e.right+=i*a,e}function E(e,t){var n="x"===t?"Left":"Top",r="Left"===n?"Right":"Bottom";return parseFloat(e["border"+n+"Width"],10)+parseFloat(e["border"+r+"Width"],10)}function S(e,t,n,r){return Math.max(t["offset"+e],t["scroll"+e],n["client"+e],n["offset"+e],n["scroll"+e],b(10)?parseInt(n["offset"+e])+parseInt(r["margin"+("Height"===e?"Top":"Left")])+parseInt(r["margin"+("Height"===e?"Bottom":"Right")]):0)}function k(e){var t=e.body,n=e.documentElement,r=b(10)&&getComputedStyle(n);return{height:S("Height",t,n,r),width:S("Width",t,n,r)}}var x=function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")},T=function(){function e(e,t){for(var n=0;n2&&void 0!==arguments[2]&&arguments[2],r=b(10),i="HTML"===t.nodeName,a=L(e),o=L(t),s=f(e),u=c(t),l=parseFloat(u.borderTopWidth,10),d=parseFloat(u.borderLeftWidth,10);n&&i&&(o.top=Math.max(o.top,0),o.left=Math.max(o.left,0));var h=A({top:a.top-o.top-l,left:a.left-o.left-d,width:a.width,height:a.height});if(h.marginTop=0,h.marginLeft=0,!r&&i){var p=parseFloat(u.marginTop,10),m=parseFloat(u.marginLeft,10);h.top-=l-p,h.bottom-=l-p,h.left-=d-m,h.right-=d-m,h.marginTop=p,h.marginLeft=m}return(r&&!n?t.contains(s):t===s&&"BODY"!==s.nodeName)&&(h=_(h,t)),h}function I(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e.ownerDocument.documentElement,r=C(e,n),i=Math.max(n.clientWidth,window.innerWidth||0),a=Math.max(n.clientHeight,window.innerHeight||0),o=t?0:w(n),s=t?0:w(n,"left");return A({top:o-r.top+r.marginTop,left:s-r.left+r.marginLeft,width:i,height:a})}function D(e){var t=e.nodeName;if("BODY"===t||"HTML"===t)return!1;if("fixed"===c(e,"position"))return!0;var n=l(e);return!!n&&D(n)}function N(e){if(!e||!e.parentElement||b())return document.documentElement;for(var t=e.parentElement;t&&"none"===c(t,"transform");)t=t.parentElement;return t||document.documentElement}function P(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],a={top:0,left:0},o=i?N(e):y(e,d(t));if("viewport"===r)a=I(o,i);else{var s=void 0;"scrollParent"===r?"BODY"===(s=f(l(t))).nodeName&&(s=e.ownerDocument.documentElement):s="window"===r?e.ownerDocument.documentElement:r;var u=C(s,o,i);if("HTML"!==s.nodeName||D(o))a=u;else{var c=k(e.ownerDocument),h=c.height,p=c.width;a.top+=u.top-u.marginTop,a.bottom=h+u.top,a.left+=u.left-u.marginLeft,a.right=p+u.left}}var b="number"==typeof(n=n||0);return a.left+=b?n:n.left||0,a.top+=b?n:n.top||0,a.right-=b?n:n.right||0,a.bottom-=b?n:n.bottom||0,a}function R(e){var t;return e.width*e.height}function j(e,t,n,r,i){var a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;if(-1===e.indexOf("auto"))return e;var o=P(n,r,a,i),s={top:{width:o.width,height:t.top-o.top},right:{width:o.right-t.right,height:o.height},bottom:{width:o.width,height:o.bottom-t.bottom},left:{width:t.left-o.left,height:o.height}},u=Object.keys(s).map(function(e){return O({key:e},s[e],{area:R(s[e])})}).sort(function(e,t){return t.area-e.area}),c=u.filter(function(e){var t=e.width,r=e.height;return t>=n.clientWidth&&r>=n.clientHeight}),l=c.length>0?c[0].key:u[0].key,f=e.split("-")[1];return l+(f?"-"+f:"")}function F(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,i=r?N(t):y(t,d(n));return C(n,i,r)}function Y(e){var t=e.ownerDocument.defaultView.getComputedStyle(e),n=parseFloat(t.marginTop||0)+parseFloat(t.marginBottom||0),r=parseFloat(t.marginLeft||0)+parseFloat(t.marginRight||0);return{width:e.offsetWidth+r,height:e.offsetHeight+n}}function B(e){var t={left:"right",right:"left",bottom:"top",top:"bottom"};return e.replace(/left|right|bottom|top/g,function(e){return t[e]})}function U(e,t,n){n=n.split("-")[0];var r=Y(e),i={width:r.width,height:r.height},a=-1!==["right","left"].indexOf(n),o=a?"top":"left",s=a?"left":"top",u=a?"height":"width",c=a?"width":"height";return i[o]=t[o]+t[u]/2-r[u]/2,n===s?i[s]=t[s]-r[c]:i[s]=t[B(s)],i}function H(e,t){return Array.prototype.find?e.find(t):e.filter(t)[0]}function $(e,t,n){if(Array.prototype.findIndex)return e.findIndex(function(e){return e[t]===n});var r=H(e,function(e){return e[t]===n});return e.indexOf(r)}function z(e,t,n){return(void 0===n?e:e.slice(0,$(e,"name",n))).forEach(function(e){e.function&&console.warn("`modifier.function` is deprecated, use `modifier.fn`!");var n=e.function||e.fn;e.enabled&&u(n)&&(t.offsets.popper=A(t.offsets.popper),t.offsets.reference=A(t.offsets.reference),t=n(t,e))}),t}function G(){if(!this.state.isDestroyed){var e={instance:this,styles:{},arrowStyles:{},attributes:{},flipped:!1,offsets:{}};e.offsets.reference=F(this.state,this.popper,this.reference,this.options.positionFixed),e.placement=j(this.options.placement,e.offsets.reference,this.popper,this.reference,this.options.modifiers.flip.boundariesElement,this.options.modifiers.flip.padding),e.originalPlacement=e.placement,e.positionFixed=this.options.positionFixed,e.offsets.popper=U(this.popper,e.offsets.reference,e.placement),e.offsets.popper.position=this.options.positionFixed?"fixed":"absolute",e=z(this.modifiers,e),this.state.isCreated?this.options.onUpdate(e):(this.state.isCreated=!0,this.options.onCreate(e))}}function W(e,t){return e.some(function(e){var n=e.name;return e.enabled&&n===t})}function K(e){for(var t=[!1,"ms","Webkit","Moz","O"],n=e.charAt(0).toUpperCase()+e.slice(1),r=0;ro[p]&&(e.offsets.popper[d]+=s[d]+b-o[p]),e.offsets.popper=A(e.offsets.popper);var m=s[d]+s[l]/2-b/2,g=c(e.instance.popper),v=parseFloat(g["margin"+f],10),y=parseFloat(g["border"+f+"Width"],10),w=m-e.offsets.popper[d]-v-y;return w=Math.max(Math.min(o[l]-b,w),0),e.arrowElement=r,e.offsets.arrow=(M(n={},d,Math.round(w)),M(n,h,""),n),e}function ef(e){return"end"===e?"start":"start"===e?"end":e}var ed=["auto-start","auto","auto-end","top-start","top","top-end","right-start","right","right-end","bottom-end","bottom","bottom-start","left-end","left","left-start"],eh=ed.slice(3);function ep(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=eh.indexOf(e),r=eh.slice(n+1).concat(eh.slice(0,n));return t?r.reverse():r}var eb={FLIP:"flip",CLOCKWISE:"clockwise",COUNTERCLOCKWISE:"counterclockwise"};function em(e,t){if(W(e.instance.modifiers,"inner")||e.flipped&&e.placement===e.originalPlacement)return e;var n=P(e.instance.popper,e.instance.reference,t.padding,t.boundariesElement,e.positionFixed),r=e.placement.split("-")[0],i=B(r),a=e.placement.split("-")[1]||"",o=[];switch(t.behavior){case eb.FLIP:o=[r,i];break;case eb.CLOCKWISE:o=ep(r);break;case eb.COUNTERCLOCKWISE:o=ep(r,!0);break;default:o=t.behavior}return o.forEach(function(s,u){if(r!==s||o.length===u+1)return e;i=B(r=e.placement.split("-")[0]);var c=e.offsets.popper,l=e.offsets.reference,f=Math.floor,d="left"===r&&f(c.right)>f(l.left)||"right"===r&&f(c.left)f(l.top)||"bottom"===r&&f(c.top)f(n.right),b=f(c.top)f(n.bottom),g="left"===r&&h||"right"===r&&p||"top"===r&&b||"bottom"===r&&m,v=-1!==["top","bottom"].indexOf(r),y=!!t.flipVariations&&(v&&"start"===a&&h||v&&"end"===a&&p||!v&&"start"===a&&b||!v&&"end"===a&&m),w=!!t.flipVariationsByContent&&(v&&"start"===a&&p||v&&"end"===a&&h||!v&&"start"===a&&m||!v&&"end"===a&&b),_=y||w;(d||g||_)&&(e.flipped=!0,(d||g)&&(r=o[u+1]),_&&(a=ef(a)),e.placement=r+(a?"-"+a:""),e.offsets.popper=O({},e.offsets.popper,U(e.instance.popper,e.offsets.reference,e.placement)),e=z(e.instance.modifiers,e,"flip"))}),e}function eg(e){var t=e.offsets,n=t.popper,r=t.reference,i=e.placement.split("-")[0],a=Math.floor,o=-1!==["top","bottom"].indexOf(i),s=o?"right":"bottom",u=o?"left":"top",c=o?"width":"height";return n[s]a(r[s])&&(e.offsets.popper[u]=a(r[s])),e}function ev(e,t,n,r){var i=e.match(/((?:\-|\+)?\d*\.?\d*)(.*)/),a=+i[1],o=i[2];if(!a)return e;if(0===o.indexOf("%")){var s=void 0;return A(s="%p"===o?n:r)[t]/100*a}if("vh"!==o&&"vw"!==o)return a;var u=void 0;return(u="vh"===o?Math.max(document.documentElement.clientHeight,window.innerHeight||0):Math.max(document.documentElement.clientWidth,window.innerWidth||0))/100*a}function ey(e,t,n,r){var i=[0,0],a=-1!==["right","left"].indexOf(r),o=e.split(/(\+|\-)/).map(function(e){return e.trim()}),s=o.indexOf(H(o,function(e){return -1!==e.search(/,|\s/)}));o[s]&&-1===o[s].indexOf(",")&&console.warn("Offsets separated by white space(s) are deprecated, use a comma (,) instead.");var u=/\s*,\s*|\s+/,c=-1!==s?[o.slice(0,s).concat([o[s].split(u)[0]]),[o[s].split(u)[1]].concat(o.slice(s+1))]:[o];return(c=c.map(function(e,r){var i=(1===r?!a:a)?"height":"width",o=!1;return e.reduce(function(e,t){return""===e[e.length-1]&&-1!==["+","-"].indexOf(t)?(e[e.length-1]=t,o=!0,e):o?(e[e.length-1]+=t,o=!1,e):e.concat(t)},[]).map(function(e){return ev(e,i,t,n)})})).forEach(function(e,t){e.forEach(function(n,r){et(n)&&(i[t]+=n*("-"===e[r-1]?-1:1))})}),i}function ew(e,t){var n=t.offset,r=e.placement,i=e.offsets,a=i.popper,o=i.reference,s=r.split("-")[0],u=void 0;return u=et(+n)?[+n,0]:ey(n,a,o,s),"left"===s?(a.top+=u[0],a.left-=u[1]):"right"===s?(a.top+=u[0],a.left+=u[1]):"top"===s?(a.left+=u[0],a.top-=u[1]):"bottom"===s&&(a.left+=u[0],a.top+=u[1]),e.popper=a,e}function e_(e,t){var n=t.boundariesElement||m(e.instance.popper);e.instance.reference===n&&(n=m(n));var r=K("transform"),i=e.instance.popper.style,a=i.top,o=i.left,s=i[r];i.top="",i.left="",i[r]="";var u=P(e.instance.popper,e.instance.reference,t.padding,n,e.positionFixed);i.top=a,i.left=o,i[r]=s,t.boundaries=u;var c=t.priority,l=e.offsets.popper,f={primary:function(e){var n=l[e];return l[e]u[e]&&!t.escapeWithReference&&(r=Math.min(l[n],u[e]-("right"===e?l.width:l.height))),M({},n,r)}};return c.forEach(function(e){l=O({},l,f[-1!==["left","top"].indexOf(e)?"primary":"secondary"](e))}),e.offsets.popper=l,e}function eE(e){var t=e.placement,n=t.split("-")[0],r=t.split("-")[1];if(r){var i=e.offsets,a=i.reference,o=i.popper,s=-1!==["bottom","top"].indexOf(n),u=s?"left":"top",c=s?"width":"height",l={start:M({},u,a[u]),end:M({},u,a[u]+a[c]-o[c])};e.offsets.popper=O({},o,l[r])}return e}function eS(e){if(!ec(e.instance.modifiers,"hide","preventOverflow"))return e;var t=e.offsets.reference,n=H(e.instance.modifiers,function(e){return"preventOverflow"===e.name}).boundaries;if(t.bottomn.right||t.top>n.bottom||t.right2&&void 0!==arguments[2]?arguments[2]:{};x(this,e),this.scheduleUpdate=function(){return requestAnimationFrame(r.update)},this.update=s(this.update.bind(this)),this.options=O({},e.Defaults,i),this.state={isDestroyed:!1,isCreated:!1,scrollParents:[]},this.reference=t&&t.jquery?t[0]:t,this.popper=n&&n.jquery?n[0]:n,this.options.modifiers={},Object.keys(O({},e.Defaults.modifiers,i.modifiers)).forEach(function(t){r.options.modifiers[t]=O({},e.Defaults.modifiers[t]||{},i.modifiers?i.modifiers[t]:{})}),this.modifiers=Object.keys(this.options.modifiers).map(function(e){return O({name:e},r.options.modifiers[e])}).sort(function(e,t){return e.order-t.order}),this.modifiers.forEach(function(e){e.enabled&&u(e.onLoad)&&e.onLoad(r.reference,r.popper,r.options,e,r.state)}),this.update();var a=this.options.eventsEnabled;a&&this.enableEventListeners(),this.state.eventsEnabled=a}return T(e,[{key:"update",value:function(){return G.call(this)}},{key:"destroy",value:function(){return V.call(this)}},{key:"enableEventListeners",value:function(){return J.call(this)}},{key:"disableEventListeners",value:function(){return ee.call(this)}}]),e}();eT.Utils=("undefined"!=typeof window?window:n.g).PopperUtils,eT.placements=ed,eT.Defaults=ex;let eM=eT},92703(e,t,n){"use strict";var r=n(50414);function i(){}function a(){}a.resetWarningCache=i,e.exports=function(){function e(e,t,n,i,a,o){if(o!==r){var s=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:a,resetWarningCache:i};return n.PropTypes=n,n}},45697(e,t,n){e.exports=n(92703)()},50414(e){"use strict";var t="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";e.exports=t},55760(e){"use strict";function t(e){this._maxSize=e,this.clear()}t.prototype.clear=function(){this._size=0,this._values=Object.create(null)},t.prototype.get=function(e){return this._values[e]},t.prototype.set=function(e,t){return this._size>=this._maxSize&&this.clear(),!(e in this._values)&&this._size++,this._values[e]=t};var n=/[^.^\]^[]+|(?=\[\]|\.\.)/g,r=/^\d+$/,i=/^\d/,a=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,o=/^\s*(['"]?)(.*?)(\1)\s*$/,s=512,u=new t(s),c=new t(s),l=new t(s);function f(e){return u.get(e)||u.set(e,d(e).map(function(e){return e.replace(o,"$2")}))}function d(e){return e.match(n)}function h(e,t,n){var r,i,a,o,s=e.length;for(i=0;i4&&n.slice(0,4)===o&&s.test(t)&&("-"===t.charAt(4)?u=f(t):t=d(t),c=i),new c(u,t))}function f(e){var t=e.slice(5).replace(u,p);return o+t.charAt(0).toUpperCase()+t.slice(1)}function d(e){var t=e.slice(4);return u.test(t)?e:("-"!==(t=t.replace(c,h)).charAt(0)&&(t="-"+t),o+t)}function h(e){return"-"+e.toLowerCase()}function p(e){return e.charAt(1).toUpperCase()}},97247(e,t,n){"use strict";var r=n(19940),i=n(8289),a=n(5812),o=n(94397),s=n(67716),u=n(61805);e.exports=r([a,i,o,s,u])},67716(e,t,n){"use strict";var r=n(17e3),i=n(17596),a=r.booleanish,o=r.number,s=r.spaceSeparated;function u(e,t){return"role"===t?t:"aria-"+t.slice(4).toLowerCase()}e.exports=i({transform:u,properties:{ariaActiveDescendant:null,ariaAtomic:a,ariaAutoComplete:null,ariaBusy:a,ariaChecked:a,ariaColCount:o,ariaColIndex:o,ariaColSpan:o,ariaControls:s,ariaCurrent:null,ariaDescribedBy:s,ariaDetails:null,ariaDisabled:a,ariaDropEffect:s,ariaErrorMessage:null,ariaExpanded:a,ariaFlowTo:s,ariaGrabbed:a,ariaHasPopup:null,ariaHidden:a,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:s,ariaLevel:o,ariaLive:null,ariaModal:a,ariaMultiLine:a,ariaMultiSelectable:a,ariaOrientation:null,ariaOwns:s,ariaPlaceholder:null,ariaPosInSet:o,ariaPressed:a,ariaReadOnly:a,ariaRelevant:null,ariaRequired:a,ariaRoleDescription:s,ariaRowCount:o,ariaRowIndex:o,ariaRowSpan:o,ariaSelected:a,ariaSetSize:o,ariaSort:null,ariaValueMax:o,ariaValueMin:o,ariaValueNow:o,ariaValueText:null,role:null}})},61805(e,t,n){"use strict";var r=n(17e3),i=n(17596),a=n(10855),o=r.boolean,s=r.overloadedBoolean,u=r.booleanish,c=r.number,l=r.spaceSeparated,f=r.commaSeparated;e.exports=i({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:a,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:f,acceptCharset:l,accessKey:l,action:null,allow:null,allowFullScreen:o,allowPaymentRequest:o,allowUserMedia:o,alt:null,as:null,async:o,autoCapitalize:null,autoComplete:l,autoFocus:o,autoPlay:o,capture:o,charSet:null,checked:o,cite:null,className:l,cols:c,colSpan:null,content:null,contentEditable:u,controls:o,controlsList:l,coords:c|f,crossOrigin:null,data:null,dateTime:null,decoding:null,default:o,defer:o,dir:null,dirName:null,disabled:o,download:s,draggable:u,encType:null,enterKeyHint:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:o,formTarget:null,headers:l,height:c,hidden:o,high:c,href:null,hrefLang:null,htmlFor:l,httpEquiv:l,id:null,imageSizes:null,imageSrcSet:f,inputMode:null,integrity:null,is:null,isMap:o,itemId:null,itemProp:l,itemRef:l,itemScope:o,itemType:l,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:o,low:c,manifest:null,max:null,maxLength:c,media:null,method:null,min:null,minLength:c,multiple:o,muted:o,name:null,nonce:null,noModule:o,noValidate:o,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforePrint:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextMenu:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:o,optimum:c,pattern:null,ping:l,placeholder:null,playsInline:o,poster:null,preload:null,readOnly:o,referrerPolicy:null,rel:l,required:o,reversed:o,rows:c,rowSpan:c,sandbox:l,scope:null,scoped:o,seamless:o,selected:o,shape:null,size:c,sizes:null,slot:null,span:c,spellCheck:u,src:null,srcDoc:null,srcLang:null,srcSet:f,start:c,step:null,style:null,tabIndex:c,target:null,title:null,translate:null,type:null,typeMustMatch:o,useMap:null,value:u,width:c,wrap:null,align:null,aLink:null,archive:l,axis:null,background:null,bgColor:null,border:c,borderColor:null,bottomMargin:c,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:o,declare:o,event:null,face:null,frame:null,frameBorder:null,hSpace:c,leftMargin:c,link:null,longDesc:null,lowSrc:null,marginHeight:c,marginWidth:c,noResize:o,noHref:o,noShade:o,noWrap:o,object:null,profile:null,prompt:null,rev:null,rightMargin:c,rules:null,scheme:null,scrolling:u,standby:null,summary:null,text:null,topMargin:c,valueType:null,version:null,vAlign:null,vLink:null,vSpace:c,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:o,disableRemotePlayback:o,prefix:null,property:null,results:c,security:null,unselectable:null}})},10855(e,t,n){"use strict";var r=n(28740);function i(e,t){return r(e,t.toLowerCase())}e.exports=i},28740(e){"use strict";function t(e,t){return t in e?e[t]:t}e.exports=t},17596(e,t,n){"use strict";var r=n(66632),i=n(99607),a=n(81674);function o(e){var t,n,o=e.space,s=e.mustUseProperty||[],u=e.attributes||{},c=e.properties,l=e.transform,f={},d={};for(t in c)n=new a(t,l(u,t),c[t],o),-1!==s.indexOf(t)&&(n.mustUseProperty=!0),f[t]=n,d[r(t)]=t,d[r(n.attribute)]=t;return new i(f,d,o)}e.exports=o},81674(e,t,n){"use strict";var r=n(57643),i=n(17e3);e.exports=s,s.prototype=new r,s.prototype.defined=!0;var a=["boolean","booleanish","overloadedBoolean","number","commaSeparated","spaceSeparated","commaOrSpaceSeparated"],o=a.length;function s(e,t,n,s){var c,l=-1;for(u(this,"space",s),r.call(this,e,t);++l=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function l(e,t){if(null==e)return{};var n,r,i={},a=Object.keys(e);for(r=0;r=0||(i[n]=e[n]);return i}function f(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function d(e,t){for(var n=0;n1&&void 0!==arguments[1]&&arguments[1];return n._tick((0,d.updateNodeHighlightedValue)(n.state.nodes,n.state.links,n.state.config,e,t))}),O(S(n),"_tick",function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return t?n.setState(e,t):n.setState(e)}),O(S(n),"_zoomConfig",function(){var e=(0,o.select)("#".concat(n.state.id,"-").concat(u.default.GRAPH_WRAPPER_ID)),t=(0,s.zoom)().scaleExtent([n.state.config.minZoom,n.state.config.maxZoom]);n.state.config.freezeAllDragEvents||t.on("zoom",n._zoomed),null!==n.state.config.initialZoom&&t.scaleTo(e,n.state.config.initialZoom),e.call(t).on("dblclick.zoom",null)}),O(S(n),"_zoomed",function(){var e=o.event.transform;(0,o.selectAll)("#".concat(n.state.id,"-").concat(u.default.GRAPH_CONTAINER_ID)).attr("transform",e),n.state.config.panAndZoom&&n.setState({transform:e.k}),n.debouncedOnZoomChange&&n.state.previousZoom!==e.k&&(n.debouncedOnZoomChange(n.state.previousZoom,e.k),n.setState({previousZoom:e.k}))}),O(S(n),"onClickGraph",function(e){n.state.enableFocusAnimation&&n.setState({enableFocusAnimation:!1});var t,r,i,a=e.target&&e.target.tagName,o=null==e?void 0:null===(t=e.target)||void 0===t?void 0:null===(r=t.attributes)||void 0===r?void 0:null===(i=r.name)||void 0===i?void 0:i.value,s="svg-container-".concat(n.state.id);"SVG"===a.toUpperCase()&&o===s&&n.props.onClickGraph&&n.props.onClickGraph(e)}),O(S(n),"onClickNode",function(e){var t=n.state.nodes[e];if(n.state.config.collapsible){var r=(0,f.getTargetLeafConnections)(e,n.state.links,n.state.config),i=(0,f.toggleLinksMatrixConnections)(n.state.links,r,n.state.config),a=(0,f.toggleLinksConnections)(n.state.d3Links,i),o=null==r?void 0:r["0"],s=!1;o&&(s=1===i[o.source][o.target]),n._tick({links:i,d3Links:a},function(){n.props.onClickNode&&n.props.onClickNode(e,t),s&&n._graphNodeDragConfig()})}else n.nodeClickTimer?(n.props.onDoubleClickNode&&n.props.onDoubleClickNode(e,t),n.nodeClickTimer=clearTimeout(n.nodeClickTimer)):n.nodeClickTimer=setTimeout(function(){n.props.onClickNode&&n.props.onClickNode(e,t),n.nodeClickTimer=null},u.default.TTL_DOUBLE_CLICK_IN_MS)}),O(S(n),"onRightClickNode",function(e,t){var r=n.state.nodes[t];n.props.onRightClickNode&&n.props.onRightClickNode(e,t,r)}),O(S(n),"onMouseOverNode",function(e){if(!n.isDraggingNode){var t=n.state.nodes[e];n.props.onMouseOverNode&&n.props.onMouseOverNode(e,t),n.state.config.nodeHighlightBehavior&&n._setNodeHighlightedValue(e,!0)}}),O(S(n),"onMouseOutNode",function(e){if(!n.isDraggingNode){var t=n.state.nodes[e];n.props.onMouseOutNode&&n.props.onMouseOutNode(e,t),n.state.config.nodeHighlightBehavior&&n._setNodeHighlightedValue(e,!1)}}),O(S(n),"onMouseOverLink",function(e,t){if(n.props.onMouseOverLink&&n.props.onMouseOverLink(e,t),n.state.config.linkHighlightBehavior){var r={source:e,target:t};n._tick({highlightedLink:r})}}),O(S(n),"onMouseOutLink",function(e,t){if(n.props.onMouseOutLink&&n.props.onMouseOutLink(e,t),n.state.config.linkHighlightBehavior){var r=void 0;n._tick({highlightedLink:r})}}),O(S(n),"onNodePositionChange",function(e){if(n.props.onNodePositionChange){var t=e.id,r=e.x,i=e.y;n.props.onNodePositionChange(t,r,i)}}),O(S(n),"pauseSimulation",function(){return n.state.simulation.stop()}),O(S(n),"resetNodesPositions",function(){if(!n.state.config.staticGraph){var e=(0,d.initializeNodes)(n.props.data.nodes);for(var t in n.state.nodes){var r=n.state.nodes[t];if(r.fx&&r.fy&&(Reflect.deleteProperty(r,"fx"),Reflect.deleteProperty(r,"fy")),t in e){var i=e[t];r.x=i.x,r.y=i.y}}n.state.simulation.alphaTarget(n.state.config.d3.alphaTarget).restart(),n._tick()}}),O(S(n),"restartSimulation",function(){return!n.state.config.staticGraph&&n.state.simulation.restart()}),n.props.id||(0,p.throwErr)(n.constructor.name,l.default.GRAPH_NO_ID_PROP),n.focusAnimationTimeout=null,n.nodeClickTimer=null,n.isDraggingNode=!1,n.state=(0,d.initializeGraphState)(n.props,n.state),n.debouncedOnZoomChange=n.props.onZoomChange?(0,p.debounce)(n.props.onZoomChange,100):null,n}return T(t,e),x(t,[{key:"_graphLinkForceConfig",value:function(){var e=(0,a.forceLink)(this.state.d3Links).id(function(e){return e.id}).distance(this.state.config.d3.linkLength).strength(this.state.config.d3.linkStrength);this.state.simulation.force(u.default.LINK_CLASS_NAME,e)}},{key:"_graphNodeDragConfig",value:function(){var e=(0,i.drag)().on("start",this._onDragStart).on("drag",this._onDragMove).on("end",this._onDragEnd);(0,o.select)("#".concat(this.state.id,"-").concat(u.default.GRAPH_WRAPPER_ID)).selectAll(".node").call(e)}},{key:"_graphBindD3ToReactComponent",value:function(){this.state.config.d3.disableLinkForce||(this.state.simulation.nodes(this.state.d3Nodes).on("tick",this._tick),this._graphLinkForceConfig()),this.state.config.freezeAllDragEvents||this._graphNodeDragConfig()}}]),x(t,[{key:"UNSAFE_componentWillReceiveProps",value:function(e){var t=(0,d.checkForGraphElementsChanges)(e,this.state),n=t.graphElementsUpdated,r=t.newGraphElements,i=n?(0,d.initializeGraphState)(e,this.state):this.state,a=e.config||{},o=(0,d.checkForGraphConfigChanges)(e,this.state),s=o.configUpdated,l=o.d3ConfigUpdated,f=s?(0,p.merge)(c.default,a):this.state.config;r&&this.pauseSimulation();var h=a.panAndZoom!==this.state.config.panAndZoom?1:this.state.transform,b=e.data.focusedNodeId,m=this.state.d3Nodes.find(function(e){return"".concat(e.id)==="".concat(b)}),g="".concat(this.state.id,"-").concat(u.default.GRAPH_WRAPPER_ID),v=(0,d.getCenterAndZoomTransformation)(m,this.state.config,g)||this.state.focusTransformation,w=this.props.data.focusedNodeId!==e.data.focusedNodeId;e.onZoomChange&&(this.debouncedOnZoomChange=(0,p.debounce)(e.onZoomChange,100)),this.setState(y({},i,{config:f,configUpdated:s,d3ConfigUpdated:l,newGraphElements:r,transform:h,focusedNodeId:b,enableFocusAnimation:w,focusTransformation:v}))}},{key:"componentDidUpdate",value:function(){(this.state.config.staticGraph||this.state.config.staticGraphWithDragAndDrop)&&this.pauseSimulation(),!this.state.config.staticGraph&&(this.state.newGraphElements||this.state.d3ConfigUpdated)?(this._graphBindD3ToReactComponent(),this.state.config.staticGraphWithDragAndDrop||this.restartSimulation(),this.setState({newGraphElements:!1,d3ConfigUpdated:!1})):this.state.configUpdated&&this._graphNodeDragConfig(),this.state.configUpdated&&(this._zoomConfig(),this.setState({configUpdated:!1}))}},{key:"componentDidMount",value:function(){this.state.config.staticGraph||this._graphBindD3ToReactComponent(),this._zoomConfig()}},{key:"componentWillUnmount",value:function(){this.pauseSimulation(),this.nodeClickTimer&&(clearTimeout(this.nodeClickTimer),this.nodeClickTimer=null),this.focusAnimationTimeout&&(clearTimeout(this.focusAnimationTimeout),this.focusAnimationTimeout=null)}},{key:"render",value:function(){var e=(0,h.renderGraph)(this.state.nodes,{onClickNode:this.onClickNode,onDoubleClickNode:this.onDoubleClickNode,onRightClickNode:this.onRightClickNode,onMouseOverNode:this.onMouseOverNode,onMouseOut:this.onMouseOutNode},this.state.d3Links,this.state.links,{onClickLink:this.props.onClickLink,onRightClickLink:this.props.onRightClickLink,onMouseOverLink:this.onMouseOverLink,onMouseOutLink:this.onMouseOutLink},this.state.config,this.state.highlightedNode,this.state.highlightedLink,this.state.transform),t=e.nodes,n=e.links,i=e.defs,a={height:this.state.config.height,width:this.state.config.width},o=this._generateFocusAnimationProps();return r.default.createElement("div",{id:"".concat(this.state.id,"-").concat(u.default.GRAPH_WRAPPER_ID)},r.default.createElement("svg",{name:"svg-container-".concat(this.state.id),style:a,onClick:this.onClickGraph},i,r.default.createElement("g",g({id:"".concat(this.state.id,"-").concat(u.default.GRAPH_CONTAINER_ID)},o),n,t)))}}]),t}(r.default.Component);t.default=A},37973(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.computeNodeDegree=l,t.getTargetLeafConnections=f,t.isNodeVisible=d,t.toggleLinksConnections=h,t.toggleLinksMatrixConnections=p;var r=n(52694);function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function a(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{};return Object.keys(t).reduce(function(n,r){return t[r]?Object.keys(t[r]).reduce(function(n,i){return e===r&&(n.outDegree+=t[e][i]),e===i&&(n.inDegree+=t[r][e]),n},n):n},{inDegree:0,outDegree:0})}function f(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,r=n.directed;return(t[e]?Object.keys(t[e]):[]).reduce(function(n,i){return c(i,t,r)&&n.push({source:e,target:i}),n},[])}function d(e,t,n){if(!t[e])return!1;if(t[e]._orphan)return!0;var r=l(e,n),i=r.inDegree,a=r.outDegree;return i>0||a>0}function h(e,t){return e.map(function(e){var n=e.source,i=e.target,o=(0,r.getId)(n),s=(0,r.getId)(i);return a({},e,{isHidden:!(t&&t[o]&&t[o][s])})})}function p(e,t,n){var r=n.directed;return t.reduce(function(e,t){e[t.source]||(e[t.source]={}),e[t.source][t.target]||(e[t.source][t.target]=0);var n=0===e[t.source][t.target]?1:0;return e[t.source][t.target]=n,r||(e[t.target][t.source]=n),e},a({},e))}n(69901)},99182(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.buildLinkProps=h,t.buildNodeProps=p;var r=s(n(53880)),i=n(37109),a=n(80362),o=n(52694);function s(e){return e&&e.__esModule?e:{default:e}}function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function c(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0,a=arguments.length>4?arguments[4]:void 0,o=arguments.length>5?arguments[5]:void 0,s=e.highlighted||e.id===(a&&a.source)||e.id===(a&&a.target),u=d(e,i,a,t),l=e.color||t.node.color;s&&t.node.highlightColor!==r.default.KEYWORDS.SAME&&(l=t.node.highlightColor);var h=e.strokeColor||t.node.strokeColor;s&&t.node.highlightStrokeColor!==r.default.KEYWORDS.SAME&&(h=t.node.highlightStrokeColor);var p=e[t.node.labelProperty]||e.id;"function"==typeof t.node.labelProperty&&(p=t.node.labelProperty(e));var b=e.labelPosition||t.node.labelPosition,m=e.strokeWidth||t.node.strokeWidth;s&&t.node.highlightStrokeWidth!==r.default.KEYWORDS.SAME&&(m=t.node.highlightStrokeWidth);var g=1/o,v=e.size||t.node.size,y="object"!==f(v),w=0;y?w=v:"top"===b||"bottom"===b?w=v.height:("right"===b||"left"===b)&&(w=v.width);var _=e.fontSize||t.node.fontSize,E=e.highlightFontSize||t.node.highlightFontSize,S=s?E:_,k=S*g+w/100+1.5,x=e.svg||t.node.svg,T=e.fontColor||t.node.fontColor,M=t.node.renderLabel;return void 0!==e.renderLabel&&"boolean"==typeof e.renderLabel&&(M=e.renderLabel),c({},e,{className:r.default.NODE_CLASS_NAME,cursor:t.node.mouseCursor,cx:(null==e?void 0:e.x)||"0",cy:(null==e?void 0:e.y)||"0",dx:k,fill:l,fontColor:T,fontSize:S*g,fontWeight:s?t.node.highlightFontWeight:t.node.fontWeight,id:e.id,label:p,labelPosition:b,opacity:u,overrideGlobalViewGenerator:!e.viewGenerator&&e.svg,renderLabel:M,size:y?v*g:{height:v.height*g,width:v.width*g},stroke:h,strokeWidth:m*g,svg:x,type:e.symbolType||t.node.symbolType,viewGenerator:e.viewGenerator||t.node.viewGenerator,onClickNode:n.onClickNode,onMouseOut:n.onMouseOut,onMouseOverNode:n.onMouseOverNode,onRightClickNode:n.onRightClickNode})}},98510(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n={automaticRearrangeAfterDropNode:!1,collapsible:!1,directed:!1,focusAnimationDuration:.75,focusZoom:1,freezeAllDragEvents:!1,height:400,highlightDegree:1,highlightOpacity:1,linkHighlightBehavior:!1,maxZoom:8,minZoom:.1,initialZoom:null,nodeHighlightBehavior:!1,panAndZoom:!1,staticGraph:!1,staticGraphWithDragAndDrop:!1,width:800,d3:{alphaTarget:.05,gravity:-100,linkLength:100,linkStrength:1,disableLinkForce:!1},node:{color:"#d3d3d3",fontColor:"black",fontSize:8,fontWeight:"normal",highlightColor:"SAME",highlightFontSize:8,highlightFontWeight:"normal",highlightStrokeColor:"SAME",highlightStrokeWidth:"SAME",labelProperty:"id",labelPosition:null,mouseCursor:"pointer",opacity:1,renderLabel:!0,size:200,strokeColor:"none",strokeWidth:1.5,svg:"",symbolType:"circle",viewGenerator:null},link:{color:"#d3d3d3",fontColor:"black",fontSize:8,fontWeight:"normal",highlightColor:"SAME",highlightFontSize:8,highlightFontWeight:"normal",labelProperty:"label",mouseCursor:"pointer",opacity:1,renderLabel:!1,semanticStrokeWidth:!1,strokeWidth:1.5,markerHeight:6,markerWidth:6,type:"STRAIGHT",strokeDasharray:0,strokeDashoffset:0,strokeLinecap:"butt"}};t.default=n},53880(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=i(n(11041));function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function o(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:[],r=arguments.length>3?arguments[3]:void 0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},a=n.find(function(t){return t.source.id===e.source&&t.target.id===e.target}),o=a&&(0,c.pick)(a,m),s=(0,c.antiPick)(e,["source","target"]);if(o){var u=i.config&&Object.prototype.hasOwnProperty.call(i.config,"directed")&&r.directed!==i.config.directed,l=h({index:t},o,{},s);return u?h({},l,{isHidden:!1}):r.collapsible?l:h({},l,{isHidden:!1})}var f=!1,d={id:e.source,highlighted:f},p={id:e.target,highlighted:f};return h({index:t,source:d,target:p},s)}function _(e,t){return Object.keys(e).reduce(function(n,r){var i=(0,l.computeNodeDegree)(r,t),a=i.inDegree,o=i.outDegree,s=e[r],u=0===a&&0===o?h({},s,{_orphan:!0}):s;return n[r]=u,n},{})}function E(e){e.nodes&&e.nodes.length||((0,c.logWarning)("Graph",u.default.INSUFFICIENT_DATA),e.nodes=[]),e.links||((0,c.logWarning)("Graph",u.default.INSUFFICIENT_LINKS),e.links=[]);for(var t=e.links.length,n=function(t){var n=e.links[t];e.nodes.find(function(e){return e.id===n.source})||(0,c.throwErr)("Graph","".concat(u.default.INVALID_LINKS,' - "').concat(n.source,'" is not a valid source node id')),e.nodes.find(function(e){return e.id===n.target})||(0,c.throwErr)("Graph","".concat(u.default.INVALID_LINKS,' - "').concat(n.target,'" is not a valid target node id')),n&&void 0!==n.value&&"number"!=typeof n.value&&(0,c.throwErr)("Graph","".concat(u.default.INVALID_LINK_VALUE,' - found in link with source "').concat(n.source,'" and target "').concat(n.target,'"'))},r=0;rx?o.focusZoom=x:T4&&void 0!==arguments[4]&&arguments[4],a=i?r:"",o=h({},e[r],{highlighted:i}),s=h({},e,p({},r,o));return t[r]&&0!==n.highlightDegree&&(s=Object.keys(t[r]).reduce(function(e,t){var n=h({},s[t],{highlighted:i});return e[t]=n,e},s)),{nodes:s,highlightedNode:a}}function I(e){var t=Math.sqrt(Math.pow(e.x,2)+Math.pow(e.y,2));return 0===t?e:{x:e.x/t,y:e.y/t}}var D=new Set([o.default.SYMBOLS.CIRCLE]);function N(e,t,n,r){var i=e.sourceId,a=e.targetId,s=e.sourceCoords,u=void 0===s?{}:s,c=e.targetCoords,l=void 0===c?{}:c,f=null==t?void 0:t[i],d=null==t?void 0:t[a];if(!f||!d||(null===(_=n.node)||void 0===_?void 0:_.viewGenerator)||(null==f?void 0:f.viewGenerator)||(null==d?void 0:d.viewGenerator))return{sourceCoords:u,targetCoords:l};var h=f.symbolType||(null===(E=n.node)||void 0===E?void 0:E.symbolType),p=d.symbolType||(null===(S=n.node)||void 0===S?void 0:S.symbolType);if(!D.has(h)&&!D.has(p))return{sourceCoords:u,targetCoords:l};var b=u.x,m=u.y,g=l.x,v=l.y,y=I({x:g-b,y:v-m});if(h===o.default.SYMBOLS.CIRCLE){var w=(null==f?void 0:f.size)||n.node.size;b+=(w=.95*Math.sqrt(w/Math.PI))*y.x,m+=w*y.y}if(p===o.default.SYMBOLS.CIRCLE){var _,E,S,k,x,T=r*Math.min((null===(k=n.link)||void 0===k?void 0:k.markerWidth)||0,(null===(x=n.link)||void 0===x?void 0:x.markerHeight)||0),M=(null==d?void 0:d.size)||n.node.size;g-=((M=.95*Math.sqrt(M/Math.PI))+(n.directed?T:0))*y.x,v-=(M+(n.directed?T:0))*y.y}return{sourceCoords:{x:b,y:m},targetCoords:{x:g,y:v}}}},75791(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.renderGraph=E;var r=h(n(67294)),i=h(n(53880)),a=n(7619),o=h(n(33938)),s=h(n(61740)),u=h(n(28017)),c=n(99182),l=n(52694),f=n(37973),d=n(80362);function h(e){return e&&e.__esModule?e:{default:e}}function p(){return(p=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:i.LINE_TYPES.STRAIGHT,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],o=e.x,s=e.y,u=p(i.LINE_TYPES[n]||i.LINE_TYPES.STRAIGHT),c=[].concat(a(r),[t]),l=c.map(function(t,n){var r,i=t.x,a=t.y,o=n>0?c[n-1]:e,s=u(o.x,o.y,i,a);return" A".concat(s,",").concat(s," 0 0,1 ").concat(i,",").concat(a)}).join("");return"M".concat(o,",").concat(s).concat(l)}},28017(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=i(n(67294));function i(e){return e&&e.__esModule?e:{default:e}}function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function s(e,t){for(var n=0;n=t&&e0&&void 0!==arguments[0]?arguments[0]:i.default.DEFAULT_NODE_SIZE,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i.default.SYMBOLS.CIRCLE;return(0,r.symbol)().size(function(){return e}).type(function(){return o(t)})()}function u(e,t){switch(t){case"right":return{dx:e?"".concat(e):i.default.NODE_LABEL_DX,dy:"0",dominantBaseline:"middle",textAnchor:"start"};case"left":return{dx:e?"".concat(-e):"-".concat(i.default.NODE_LABEL_DX),dy:"0",dominantBaseline:"middle",textAnchor:"end"};case"top":return{dx:"0",dy:e?"".concat(-e):"-".concat(i.default.NODE_LABEL_DX),dominantBaseline:"baseline",textAnchor:"middle"};case"bottom":return{dx:"0",dy:e?"".concat(e):i.default.NODE_LABEL_DX,dominantBaseline:"hanging",textAnchor:"middle"};case"center":return{dx:"0",dy:"0",dominantBaseline:"middle",textAnchor:"middle"};default:return{dx:e?"".concat(e):i.default.NODE_LABEL_DX,dy:i.default.NODE_LABEL_DY}}}var c={buildSvgSymbol:s,getLabelPlacementProps:u};t.default=c},11041(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n={SYMBOLS:{CIRCLE:"circle",CROSS:"cross",DIAMOND:"diamond",SQUARE:"square",STAR:"star",TRIANGLE:"triangle",WYE:"wye"}};t.default=n},34214(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n={GRAPH_NO_ID_PROP:"id prop not defined! id property is mandatory and it should be unique.",INSUFFICIENT_LINKS:"you are passing invalid data to react-d3-graph. You must include a links array, even if empty, in the data object you're passing down to the component.",INVALID_LINKS:"you provided a invalid links data structure. Links source and target attributes must point to an existent node",INSUFFICIENT_DATA:"you have not provided enough data for react-d3-graph to render something. You need to provide at least one node",INVALID_LINK_VALUE:"links 'value' attribute must be of type number"};t.default=n},94164(e,t,n){"use strict";r={value:!0},Object.defineProperty(t,"kJ",{enumerable:!0,get:function(){return i.default}}),r={enumerable:!0,get:function(){return a.default}},r={enumerable:!0,get:function(){return o.default}};var r,i=s(n(82623)),a=s(n(61740)),o=s(n(33938));function s(e){return e&&e.__esModule?e:{default:e}}},69901(e,t){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.isDeepEqual=a,t.isEmptyObject=o,t.deepClone=s,t.merge=u,t.pick=c,t.antiPick=l,t.debounce=f,t.throwErr=h,t.logError=p,t.logWarning=b;var r=20;function i(e,t){return!!e&&Object.prototype.hasOwnProperty.call(e,t)&&"object"===n(e[t])&&null!==e[t]&&!o(e[t])}function a(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,s=[];if(0===n&&e===t)return!0;if(o(e)&&!o(t)||!o(e)&&o(t))return!1;var u=Object.keys(e),c=Object.keys(t);if(u.length!==c.length)return!1;for(var l=0,f=u;l1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=Object.keys(e),o=0,u=a;o0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a={};if(0===Object.keys(e||{}).length)return t&&!o(t)?t:{};for(var s=0,c=Object.keys(e);s1&&void 0!==arguments[1]?arguments[1]:[];return t.reduce(function(t,n){return Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]),t},{})}function l(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=Object.keys(e).filter(function(e){return!t.includes(e)});return c(e,n)}function f(e,t){var n;return function(){for(var r=arguments.length,i=Array(r),a=0;a0&&void 0!==arguments[0]?arguments[0]:"N/A",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"N/A";return"react-d3-graph :: ".concat(e," :: ").concat(t)}function h(e,t){throw Error(d(e,t))}function p(e,t){console.error(d(e,t))}function b(e,t){var n="react-d3-graph :: ".concat(e," :: ").concat(t);console.warn(n)}},64448(e,t,n){"use strict";/** @license React v16.12.0 - * react-dom.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ var r,i,a,o,s,u=n(67294),c=n(27418),l=n(63840);function f(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;nt}return!1}function eM(e,t,n,r,i,a){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=a}var eO={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){eO[e]=new eM(e,0,!1,e,null,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];eO[t]=new eM(t,1,!1,e[1],null,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){eO[e]=new eM(e,2,!1,e.toLowerCase(),null,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){eO[e]=new eM(e,2,!1,e,null,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){eO[e]=new eM(e,3,!1,e.toLowerCase(),null,!1)}),["checked","multiple","muted","selected"].forEach(function(e){eO[e]=new eM(e,3,!0,e,null,!1)}),["capture","download"].forEach(function(e){eO[e]=new eM(e,4,!1,e,null,!1)}),["cols","rows","size","span"].forEach(function(e){eO[e]=new eM(e,6,!1,e,null,!1)}),["rowSpan","start"].forEach(function(e){eO[e]=new eM(e,5,!1,e.toLowerCase(),null,!1)});var eA=/[\-:]([a-z])/g;function eL(e){return e[1].toUpperCase()}function eC(e){switch(typeof e){case"boolean":case"number":case"object":case"string":case"undefined":return e;default:return""}}function eI(e,t,n,r){var i=eO.hasOwnProperty(t)?eO[t]:null;(null!==i?0===i.type:!r&&2=t.length))throw Error(f(93));t=t[0]}n=t}null==n&&(n="")}e._wrapperState={initialValue:eC(n)}}function eV(e,t){var n=eC(t.value),r=eC(t.defaultValue);null!=n&&((n=""+n)!==e.value&&(e.value=n),null==t.defaultValue&&e.defaultValue!==n&&(e.defaultValue=n)),null!=r&&(e.defaultValue=""+r)}function eq(e){var t=e.textContent;t===e._wrapperState.initialValue&&""!==t&&null!==t&&(e.value=t)}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(eA,eL);eO[t]=new eM(t,1,!1,e,null,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(eA,eL);eO[t]=new eM(t,1,!1,e,"http://www.w3.org/1999/xlink",!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(eA,eL);eO[t]=new eM(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1)}),["tabIndex","crossOrigin"].forEach(function(e){eO[e]=new eM(e,1,!1,e.toLowerCase(),null,!1)}),eO.xlinkHref=new eM("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0),["src","href","action","formAction"].forEach(function(e){eO[e]=new eM(e,1,!1,e.toLowerCase(),null,!0)});var eZ={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg"};function eX(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function eJ(e,t){return null==e||"http://www.w3.org/1999/xhtml"===e?eX(t):"http://www.w3.org/2000/svg"===e&&"foreignObject"===t?"http://www.w3.org/1999/xhtml":e}var eQ,e1,e0=(eQ=function(e,t){if(e.namespaceURI!==eZ.svg||"innerHTML"in e)e.innerHTML=t;else{for((e1=e1||document.createElement("div")).innerHTML=""+t.valueOf().toString()+"",t=e1.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}},"undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction?function(e,t,n,r){MSApp.execUnsafeLocalFunction(function(){return eQ(e,t,n,r)})}:eQ);function e2(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType){n.nodeValue=t;return}}e.textContent=t}function e3(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var e4={animationend:e3("Animation","AnimationEnd"),animationiteration:e3("Animation","AnimationIteration"),animationstart:e3("Animation","AnimationStart"),transitionend:e3("Transition","TransitionEnd")},e6={},e5={};function e8(e){if(e6[e])return e6[e];if(!e4[e])return e;var t,n=e4[e];for(t in n)if(n.hasOwnProperty(t)&&t in e5)return e6[e]=n[t];return e}eo&&(e5=document.createElement("div").style,"AnimationEvent"in window||(delete e4.animationend.animation,delete e4.animationiteration.animation,delete e4.animationstart.animation),"TransitionEvent"in window||delete e4.transitionend.transition);var e9=e8("animationend"),e7=e8("animationiteration"),te=e8("animationstart"),tt=e8("transitionend"),tn="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange seeked seeking stalled suspend timeupdate volumechange waiting".split(" ");function tr(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do 0!=(1026&(t=e).effectTag)&&(n=t.return),e=t.return;while(e)}return 3===t.tag?n:null}function ti(e){if(13===e.tag){var t=e.memoizedState;if(null===t&&null!==(e=e.alternate)&&(t=e.memoizedState),null!==t)return t.dehydrated}return null}function ta(e){if(tr(e)!==e)throw Error(f(188))}function to(e){var t=e.alternate;if(!t){if(null===(t=tr(e)))throw Error(f(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(null===i)break;var a=i.alternate;if(null===a){if(null!==(r=i.return)){n=r;continue}break}if(i.child===a.child){for(a=i.child;a;){if(a===n)return ta(i),e;if(a===r)return ta(i),t;a=a.sibling}throw Error(f(188))}if(n.return!==r.return)n=i,r=a;else{for(var o=!1,s=i.child;s;){if(s===n){o=!0,n=i,r=a;break}if(s===r){o=!0,r=i,n=a;break}s=s.sibling}if(!o){for(s=a.child;s;){if(s===n){o=!0,n=a,r=i;break}if(s===r){o=!0,r=a,n=i;break}s=s.sibling}if(!o)throw Error(f(189))}}if(n.alternate!==r)throw Error(f(190))}if(3!==n.tag)throw Error(f(188));return n.stateNode.current===n?e:t}function ts(e){if(!(e=to(e)))return null;for(var t=e;;){if(5===t.tag||6===t.tag)return t;if(t.child)t.child.return=t,t=t.child;else{if(t===e)break;for(;!t.sibling;){if(!t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}}return null}var tu,tc,tl,tf=!1,td=[],th=null,tp=null,tb=null,tm=new Map,tg=new Map,tv=[],ty="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput close cancel copy cut paste click change contextmenu reset submit".split(" "),tw="focus blur dragenter dragleave mouseover mouseout pointerover pointerout gotpointercapture lostpointercapture".split(" ");function t_(e){var t=nA(e);ty.forEach(function(n){nL(n,e,t)}),tw.forEach(function(n){nL(n,e,t)})}function tE(e,t,n,r){return{blockedOn:e,topLevelType:t,eventSystemFlags:32|n,nativeEvent:r}}function tS(e,t){switch(e){case"focus":case"blur":th=null;break;case"dragenter":case"dragleave":tp=null;break;case"mouseover":case"mouseout":tb=null;break;case"pointerover":case"pointerout":tm.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":tg.delete(t.pointerId)}}function tk(e,t,n,r,i){return null===e||e.nativeEvent!==i?(e=tE(t,n,r,i),null!==t&&null!==(t=n7(t))&&tc(t),e):(e.eventSystemFlags|=r,e)}function tx(e,t,n,r){switch(t){case"focus":return th=tk(th,e,t,n,r),!0;case"dragenter":return tp=tk(tp,e,t,n,r),!0;case"mouseover":return tb=tk(tb,e,t,n,r),!0;case"pointerover":var i=r.pointerId;return tm.set(i,tk(tm.get(i)||null,e,t,n,r)),!0;case"gotpointercapture":return i=r.pointerId,tg.set(i,tk(tg.get(i)||null,e,t,n,r)),!0}return!1}function tT(e){var t=n9(e.target);if(null!==t){var n=tr(t);if(null!==n){if(13===(t=n.tag)){if(null!==(t=ti(n))){e.blockedOn=t,l.unstable_runWithPriority(e.priority,function(){tl(n)});return}}else if(3===t&&n.stateNode.hydrate){e.blockedOn=3===n.tag?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function tM(e){if(null!==e.blockedOn)return!1;var t=nT(e.topLevelType,e.eventSystemFlags,e.nativeEvent);if(null!==t){var n=n7(t);return null!==n&&tc(n),e.blockedOn=t,!1}return!0}function tO(e,t,n){tM(e)&&n.delete(t)}function tA(){for(tf=!1;0this.eventPool.length&&this.eventPool.push(e)}function tz(e){e.eventPool=[],e.getPooled=tH,e.release=t$}c(tU.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=tY)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=tY)},persist:function(){this.isPersistent=tY},isPersistent:tB,destructor:function(){var e,t=this.constructor.Interface;for(e in t)this[e]=null;this.nativeEvent=this._targetInst=this.dispatchConfig=null,this.isPropagationStopped=this.isDefaultPrevented=tB,this._dispatchInstances=this._dispatchListeners=null}}),tU.Interface={type:null,target:null,currentTarget:function(){return null},eventPhase:null,bubbles:null,cancelable:null,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:null,isTrusted:null},tU.extend=function(e){function t(){}function n(){return r.apply(this,arguments)}var r=this;t.prototype=r.prototype;var i=new t;return c(i,n.prototype),n.prototype=i,n.prototype.constructor=n,n.Interface=c({},r.Interface,e),n.extend=r.extend,tz(n),n},tz(tU);var tG=tU.extend({animationName:null,elapsedTime:null,pseudoElement:null}),tW=tU.extend({clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),tK=tU.extend({view:null,detail:null}),tV=tK.extend({relatedTarget:null});function tq(e){var t=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===t&&(e=13):e=t,10===e&&(e=13),32<=e||13===e?e:0}var tZ={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},tX={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},tJ={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function tQ(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=tJ[e])&&!!t[e]}function t1(){return tQ}for(var t0=tK.extend({key:function(e){if(e.key){var t=tZ[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?13===(e=tq(e))?"Enter":String.fromCharCode(e):"keydown"===e.type||"keyup"===e.type?tX[e.keyCode]||"Unidentified":""},location:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,repeat:null,locale:null,getModifierState:t1,charCode:function(e){return"keypress"===e.type?tq(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?tq(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}}),t2=0,t3=0,t4=!1,t6=!1,t5=tK.extend({screenX:null,screenY:null,clientX:null,clientY:null,pageX:null,pageY:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,getModifierState:t1,button:null,buttons:null,relatedTarget:function(e){return e.relatedTarget||(e.fromElement===e.srcElement?e.toElement:e.fromElement)},movementX:function(e){if(("movementX"in e))return e.movementX;var t=t2;return t2=e.screenX,t4?"mousemove"===e.type?e.screenX-t:0:(t4=!0,0)},movementY:function(e){if(("movementY"in e))return e.movementY;var t=t3;return t3=e.screenY,t6?"mousemove"===e.type?e.screenY-t:0:(t6=!0,0)}}),t8=t5.extend({pointerId:null,width:null,height:null,pressure:null,tangentialPressure:null,tiltX:null,tiltY:null,twist:null,pointerType:null,isPrimary:null}),t9=t5.extend({dataTransfer:null}),t7=tK.extend({touches:null,targetTouches:null,changedTouches:null,altKey:null,metaKey:null,ctrlKey:null,shiftKey:null,getModifierState:t1}),ne=tU.extend({propertyName:null,elapsedTime:null,pseudoElement:null}),nt=t5.extend({deltaX:function(e){return("deltaX"in e)?e.deltaX:("wheelDeltaX"in e)?-e.wheelDeltaX:0},deltaY:function(e){return("deltaY"in e)?e.deltaY:("wheelDeltaY"in e)?-e.wheelDeltaY:("wheelDelta"in e)?-e.wheelDelta:0},deltaZ:null,deltaMode:null}),nn=[["blur","blur",0],["cancel","cancel",0],["click","click",0],["close","close",0],["contextmenu","contextMenu",0],["copy","copy",0],["cut","cut",0],["auxclick","auxClick",0],["dblclick","doubleClick",0],["dragend","dragEnd",0],["dragstart","dragStart",0],["drop","drop",0],["focus","focus",0],["input","input",0],["invalid","invalid",0],["keydown","keyDown",0],["keypress","keyPress",0],["keyup","keyUp",0],["mousedown","mouseDown",0],["mouseup","mouseUp",0],["paste","paste",0],["pause","pause",0],["play","play",0],["pointercancel","pointerCancel",0],["pointerdown","pointerDown",0],["pointerup","pointerUp",0],["ratechange","rateChange",0],["reset","reset",0],["seeked","seeked",0],["submit","submit",0],["touchcancel","touchCancel",0],["touchend","touchEnd",0],["touchstart","touchStart",0],["volumechange","volumeChange",0],["drag","drag",1],["dragenter","dragEnter",1],["dragexit","dragExit",1],["dragleave","dragLeave",1],["dragover","dragOver",1],["mousemove","mouseMove",1],["mouseout","mouseOut",1],["mouseover","mouseOver",1],["pointermove","pointerMove",1],["pointerout","pointerOut",1],["pointerover","pointerOver",1],["scroll","scroll",1],["toggle","toggle",1],["touchmove","touchMove",1],["wheel","wheel",1],["abort","abort",2],[e9,"animationEnd",2],[e7,"animationIteration",2],[te,"animationStart",2],["canplay","canPlay",2],["canplaythrough","canPlayThrough",2],["durationchange","durationChange",2],["emptied","emptied",2],["encrypted","encrypted",2],["ended","ended",2],["error","error",2],["gotpointercapture","gotPointerCapture",2],["load","load",2],["loadeddata","loadedData",2],["loadedmetadata","loadedMetadata",2],["loadstart","loadStart",2],["lostpointercapture","lostPointerCapture",2],["playing","playing",2],["progress","progress",2],["seeking","seeking",2],["stalled","stalled",2],["suspend","suspend",2],["timeupdate","timeUpdate",2],[tt,"transitionEnd",2],["waiting","waiting",2]],nr={},ni={},na=0;na=t)return{node:r,offset:t-e};e=n}a:{for(;r;){if(r.nextSibling){r=r.nextSibling;break a}r=r.parentNode}r=void 0}r=nU(r)}}function n$(e,t){return!!e&&!!t&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?n$(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function nz(){for(var e=window,t=nB();t instanceof e.HTMLIFrameElement;){try{var n="string"==typeof t.contentWindow.location.href}catch(r){n=!1}if(n)e=t.contentWindow;else break;t=nB(e.document)}return t}function nG(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}var nW="$",nK="/$",nV="$?",nq="$!",nZ=null,nX=null;function nJ(e,t){switch(e){case"button":case"input":case"select":case"textarea":return!!t.autoFocus}return!1}function nQ(e,t){return"textarea"===e||"option"===e||"noscript"===e||"string"==typeof t.children||"number"==typeof t.children||"object"==typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var n1="function"==typeof setTimeout?setTimeout:void 0,n0="function"==typeof clearTimeout?clearTimeout:void 0;function n2(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break}return e}function n3(e){e=e.previousSibling;for(var t=0;e;){if(8===e.nodeType){var n=e.data;if(n===nW||n===nq||n===nV){if(0===t)return e;t--}else n===nK&&t++}e=e.previousSibling}return null}var n4=Math.random().toString(36).slice(2),n6="__reactInternalInstance$"+n4,n5="__reactEventHandlers$"+n4,n8="__reactContainere$"+n4;function n9(e){var t=e[n6];if(t)return t;for(var n=e.parentNode;n;){if(t=n[n8]||n[n6]){if(n=t.alternate,null!==t.child||null!==n&&null!==n.child)for(e=n3(e);null!==e;){if(n=e[n6])return n;e=n3(e)}return t}n=(e=n).parentNode}return null}function n7(e){return(e=e[n6]||e[n8])&&(5===e.tag||6===e.tag||13===e.tag||3===e.tag)?e:null}function re(e){if(5===e.tag||6===e.tag)return e.stateNode;throw Error(f(33))}function rt(e){return e[n5]||null}var rn=null,rr=null,ri=null;function ra(){if(ri)return ri;var e,t,n=rr,r=n.length,i="value"in rn?rn.value:rn.textContent,a=i.length;for(e=0;e=rl),rh=" ",rp={beforeInput:{phasedRegistrationNames:{bubbled:"onBeforeInput",captured:"onBeforeInputCapture"},dependencies:["compositionend","keypress","textInput","paste"]},compositionEnd:{phasedRegistrationNames:{bubbled:"onCompositionEnd",captured:"onCompositionEndCapture"},dependencies:"blur compositionend keydown keypress keyup mousedown".split(" ")},compositionStart:{phasedRegistrationNames:{bubbled:"onCompositionStart",captured:"onCompositionStartCapture"},dependencies:"blur compositionstart keydown keypress keyup mousedown".split(" ")},compositionUpdate:{phasedRegistrationNames:{bubbled:"onCompositionUpdate",captured:"onCompositionUpdateCapture"},dependencies:"blur compositionupdate keydown keypress keyup mousedown".split(" ")}},rb=!1;function rm(e,t){switch(e){case"keyup":return -1!==ru.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"blur":return!0;default:return!1}}function rg(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var rv=!1;function ry(e,t){switch(e){case"compositionend":return rg(t);case"keypress":if(32!==t.which)return null;return rb=!0,rh;case"textInput":return(e=t.data)===rh&&rb?null:e;default:return null}}function rw(e,t){if(rv)return"compositionend"===e||!rc&&rm(e,t)?(e=ra(),ri=rr=rn=null,rv=!1,e):null;switch(e){case"paste":default:return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=document.documentMode,rK={select:{phasedRegistrationNames:{bubbled:"onSelect",captured:"onSelectCapture"},dependencies:"blur contextmenu dragend focus keydown keyup mousedown mouseup selectionchange".split(" ")}},rV=null,rq=null,rZ=null,rX=!1;function rJ(e,t){var n=t.window===t?t.document:9===t.nodeType?t:t.ownerDocument;return rX||null==rV||rV!==nB(n)?null:(n="selectionStart"in(n=rV)&&nG(n)?{start:n.selectionStart,end:n.selectionEnd}:{anchorNode:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset},rZ&&rG(rZ,n)?null:(rZ=n,(e=tU.getPooled(rK.select,rq,e,t)).type="select",e.target=rV,tF(e),e))}var rQ={eventTypes:rK,extractEvents:function(e,t,n,r){var i,a=r.window===r?r.document:9===r.nodeType?r:r.ownerDocument;if(!(i=!a)){a:{a=nA(a),i=y.onSelect;for(var o=0;or2||(e.current=r0[r2],r0[r2]=null,r2--)}function r4(e,t){r0[++r2]=e.current,e.current=t}var r6={},r5={current:r6},r8={current:!1},r9=r6;function r7(e,t){var n=e.type.contextTypes;if(!n)return r6;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i,a={};for(i in n)a[i]=t[i];return r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=a),a}function ie(e){return null!=(e=e.childContextTypes)}function it(e){r3(r8,e),r3(r5,e)}function ir(e){r3(r8,e),r3(r5,e)}function ii(e,t,n){if(r5.current!==r6)throw Error(f(168));r4(r5,t,e),r4(r8,n,e)}function ia(e,t,n){var r=e.stateNode;if(e=t.childContextTypes,"function"!=typeof r.getChildContext)return n;for(var i in r=r.getChildContext())if(!(i in e))throw Error(f(108,ei(t)||"Unknown",i));return c({},n,{},r)}function io(e){var t=e.stateNode;return t=t&&t.__reactInternalMemoizedMergedChildContext||r6,r9=r5.current,r4(r5,t,e),r4(r8,r8.current,e),!0}function is(e,t,n){var r=e.stateNode;if(!r)throw Error(f(169));n?(t=ia(e,t,r9),r.__reactInternalMemoizedMergedChildContext=t,r3(r8,e),r3(r5,e),r4(r5,t,e)):r3(r8,e),r4(r8,n,e)}var iu=l.unstable_runWithPriority,ic=l.unstable_scheduleCallback,il=l.unstable_cancelCallback,id=l.unstable_shouldYield,ih=l.unstable_requestPaint,ip=l.unstable_now,ib=l.unstable_getCurrentPriorityLevel,im=l.unstable_ImmediatePriority,ig=l.unstable_UserBlockingPriority,iv=l.unstable_NormalPriority,iy=l.unstable_LowPriority,iw=l.unstable_IdlePriority,i_={},iE=void 0!==ih?ih:function(){},iS=null,ik=null,ix=!1,iT=ip(),iM=1e4>iT?ip:function(){return ip()-iT};function iO(){switch(ib()){case im:return 99;case ig:return 98;case iv:return 97;case iy:return 96;case iw:return 95;default:throw Error(f(332))}}function iA(e){switch(e){case 99:return im;case 98:return ig;case 97:return iv;case 96:return iy;case 95:return iw;default:throw Error(f(332))}}function iL(e,t){return e=iA(e),iu(e,t)}function iC(e,t,n){return e=iA(e),ic(e,t,n)}function iI(e){return null===iS?(iS=[e],ik=ic(im,iN)):iS.push(e),i_}function iD(){if(null!==ik){var e=ik;ik=null,il(e)}iN()}function iN(){if(!ix&&null!==iS){ix=!0;var e=0;try{var t=iS;iL(99,function(){for(;e=t&&(oo=!0),e.firstContext=null)}function iK(e,t){if(iU!==e&&!1!==t&&0!==t){if(("number"!=typeof t||1073741823===t)&&(iU=e,t=1073741823),t={context:e,observedBits:t,next:null},null===iB){if(null===iY)throw Error(f(308));iB=t,iY.dependencies={expirationTime:0,firstContext:t,responders:null}}else iB=iB.next=t}return e._currentValue}var iV=!1;function iq(e){return{baseState:e,firstUpdate:null,lastUpdate:null,firstCapturedUpdate:null,lastCapturedUpdate:null,firstEffect:null,lastEffect:null,firstCapturedEffect:null,lastCapturedEffect:null}}function iZ(e){return{baseState:e.baseState,firstUpdate:e.firstUpdate,lastUpdate:e.lastUpdate,firstCapturedUpdate:null,lastCapturedUpdate:null,firstEffect:null,lastEffect:null,firstCapturedEffect:null,lastCapturedEffect:null}}function iX(e,t){return{expirationTime:e,suspenseConfig:t,tag:0,payload:null,callback:null,next:null,nextEffect:null}}function iJ(e,t){null===e.lastUpdate?e.firstUpdate=e.lastUpdate=t:(e.lastUpdate.next=t,e.lastUpdate=t)}function iQ(e,t){var n=e.alternate;if(null===n){var r=e.updateQueue,i=null;null===r&&(r=e.updateQueue=iq(e.memoizedState))}else r=e.updateQueue,i=n.updateQueue,null===r?null===i?(r=e.updateQueue=iq(e.memoizedState),i=n.updateQueue=iq(n.memoizedState)):r=e.updateQueue=iZ(i):null===i&&(i=n.updateQueue=iZ(r));null===i||r===i?iJ(r,t):null===r.lastUpdate||null===i.lastUpdate?(iJ(r,t),iJ(i,t)):(iJ(r,t),i.lastUpdate=t)}function i1(e,t){var n=e.updateQueue;null===(n=null===n?e.updateQueue=iq(e.memoizedState):i0(e,n)).lastCapturedUpdate?n.firstCapturedUpdate=n.lastCapturedUpdate=t:(n.lastCapturedUpdate.next=t,n.lastCapturedUpdate=t)}function i0(e,t){var n=e.alternate;return null!==n&&t===n.updateQueue&&(t=e.updateQueue=iZ(t)),t}function i2(e,t,n,r,i,a){switch(n.tag){case 1:return"function"==typeof(e=n.payload)?e.call(a,r,i):e;case 3:e.effectTag=-4097&e.effectTag|64;case 0:if(null==(i="function"==typeof(e=n.payload)?e.call(a,r,i):e))break;return c({},r,i);case 2:iV=!0}return r}function i3(e,t,n,r,i){iV=!1,t=i0(e,t);for(var a=t.baseState,o=null,s=0,u=t.firstUpdate,c=a;null!==u;){var l=u.expirationTime;lb?(m=f,f=null):m=f.sibling;var g=h(i,f,s[b],u);if(null===g){null===f&&(f=m);break}e&&f&&null===g.alternate&&t(i,f),o=a(g,o,b),null===l?c=g:l.sibling=g,l=g,f=m}if(b===s.length)return n(i,f),c;if(null===f){for(;bm?(g=b,b=null):g=b.sibling;var y=h(i,b,v.value,u);if(null===y){null===b&&(b=g);break}e&&b&&null===y.alternate&&t(i,b),o=a(y,o,m),null===l?c=y:l.sibling=y,l=y,b=g}if(v.done)return n(i,b),c;if(null===b){for(;!v.done;m++,v=s.next())null!==(v=d(i,v.value,u))&&(o=a(v,o,m),null===l?c=v:l.sibling=v,l=v);return c}for(b=r(i,b);!v.done;m++,v=s.next())null!==(v=p(b,i,m,v.value,u))&&(e&&null!==v.alternate&&b.delete(null===v.key?m:v.key),o=a(v,o,m),null===l?c=v:l.sibling=v,l=v);return e&&b.forEach(function(e){return t(i,e)}),c}return function(e,r,a,s){var u="object"==typeof a&&null!==a&&a.type===z&&null===a.key;u&&(a=a.props.children);var c="object"==typeof a&&null!==a;if(c)switch(a.$$typeof){case H:a:{for(c=a.key,u=r;null!==u;){if(u.key===c){if(7===u.tag?a.type===z:u.elementType===a.type){n(e,u.sibling),(r=i(u,a.type===z?a.props.children:a.props,s)).ref=aa(e,u,a),r.return=e,e=r;break a}n(e,u);break}t(e,u),u=u.sibling}a.type===z?((r=s1(a.props.children,e.mode,s,a.key)).return=e,e=r):((s=sQ(a.type,a.key,a.props,null,e.mode,s)).ref=aa(e,r,a),s.return=e,e=s)}return o(e);case $:a:{for(u=a.key;null!==r;){if(r.key===u){if(4===r.tag&&r.stateNode.containerInfo===a.containerInfo&&r.stateNode.implementation===a.implementation){n(e,r.sibling),(r=i(r,a.children||[],s)).return=e,e=r;break a}n(e,r);break}t(e,r),r=r.sibling}(r=s2(a,e.mode,s)).return=e,e=r}return o(e)}if("string"==typeof a||"number"==typeof a)return a=""+a,null!==r&&6===r.tag?(n(e,r.sibling),(r=i(r,a,s)).return=e,e=r):(n(e,r),(r=s0(a,e.mode,s)).return=e,e=r),o(e);if(ai(a))return b(e,r,a,s);if(en(a))return m(e,r,a,s);if(c&&ao(e,a),void 0===a&&!u)switch(e.tag){case 1:case 0:throw Error(f(152,(e=e.type).displayName||e.name||"Component"))}return n(e,r)}}var au=as(!0),ac=as(!1),al={},af={current:al},ad={current:al},ah={current:al};function ap(e){if(e===al)throw Error(f(174));return e}function ab(e,t){r4(ah,t,e),r4(ad,e,e),r4(af,al,e);var n=t.nodeType;switch(n){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:eJ(null,"");break;default:t=eJ(t=(n=8===n?t.parentNode:t).namespaceURI||null,n=n.tagName)}r3(af,e),r4(af,t,e)}function am(e){r3(af,e),r3(ad,e),r3(ah,e)}function ag(e){ap(ah.current);var t=ap(af.current),n=eJ(t,e.type);t!==n&&(r4(ad,e,e),r4(af,n,e))}function av(e){ad.current===e&&(r3(af,e),r3(ad,e))}var ay={current:0};function aw(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||n.data===nV||n.data===nq))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(0!=(64&t.effectTag))return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}function a_(e,t){return{responder:e,props:t}}var aE=Y.ReactCurrentDispatcher,aS=Y.ReactCurrentBatchConfig,ak=0,ax=null,aT=null,aM=null,aO=null,aA=null,aL=null,aC=0,aI=null,aD=0,aN=!1,aP=null,aR=0;function aj(){throw Error(f(321))}function aF(e,t){if(null===t)return!1;for(var n=0;naC&&sL(aC=l)):(sA(l,u.suspenseConfig),a=u.eagerReducer===e?u.eagerState:e(a,u.action)),o=u,u=u.next}while(null!==u&&u!==r)c||(s=o,i=a),r$(a,t.memoizedState)||(oo=!0),t.memoizedState=a,t.baseUpdate=s,t.baseState=i,n.lastRenderedState=a}return[t.memoizedState,n.dispatch]}function aG(e){var t=aU();return"function"==typeof e&&(e=e()),t.memoizedState=t.baseState=e,e=(e=t.queue={last:null,dispatch:null,lastRenderedReducer:a$,lastRenderedState:e}).dispatch=a2.bind(null,ax,e),[t.memoizedState,e]}function aW(e){return az(a$,e)}function aK(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},null===aI?(aI={lastEffect:null}).lastEffect=e.next=e:null===(t=aI.lastEffect)?aI.lastEffect=e.next=e:(n=t.next,t.next=e,e.next=n,aI.lastEffect=e),e}function aV(e,t,n,r){var i=aU();aD|=e,i.memoizedState=aK(t,n,void 0,void 0===r?null:r)}function aq(e,t,n,r){var i=aH();r=void 0===r?null:r;var a=void 0;if(null!==aT){var o=aT.memoizedState;if(a=o.destroy,null!==r&&aF(r,o.deps)){aK(0,n,a,r);return}}aD|=e,i.memoizedState=aK(t,n,a,r)}function aZ(e,t){return aV(516,192,e,t)}function aX(e,t){return aq(516,192,e,t)}function aJ(e,t){return"function"==typeof t?(t(e=e()),function(){t(null)}):null!=t?(e=e(),t.current=e,function(){t.current=null}):void 0}function aQ(){}function a1(e,t){return aU().memoizedState=[e,void 0===t?null:t],e}function a0(e,t){var n=aH();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&aF(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function a2(e,t,n){if(!(25>aR))throw Error(f(301));var r=e.alternate;if(e===ax||null!==r&&r===ax){if(aN=!0,e={expirationTime:ak,suspenseConfig:null,action:n,eagerReducer:null,eagerState:null,next:null},null===aP&&(aP=new Map),void 0===(n=aP.get(t)))aP.set(t,e);else{for(t=n;null!==t.next;)t=t.next;t.next=e}}else{var i=sb(),a=i5.suspense;a={expirationTime:i=sm(i,e,a),suspenseConfig:a,action:n,eagerReducer:null,eagerState:null,next:null};var o=t.last;if(null===o)a.next=a;else{var s=o.next;null!==s&&(a.next=s),o.next=a}if(t.last=a,0===e.expirationTime&&(null===r||0===r.expirationTime)&&null!==(r=t.lastRenderedReducer))try{var u=t.lastRenderedState,c=r(u,n);if(a.eagerReducer=r,a.eagerState=c,r$(c,u))return}catch(l){}finally{}sg(e,i)}}var a3={readContext:iK,useCallback:aj,useContext:aj,useEffect:aj,useImperativeHandle:aj,useLayoutEffect:aj,useMemo:aj,useReducer:aj,useRef:aj,useState:aj,useDebugValue:aj,useResponder:aj,useDeferredValue:aj,useTransition:aj},a4={readContext:iK,useCallback:a1,useContext:iK,useEffect:aZ,useImperativeHandle:function(e,t,n){return n=null!=n?n.concat([e]):null,aV(4,36,aJ.bind(null,t,e),n)},useLayoutEffect:function(e,t){return aV(4,36,e,t)},useMemo:function(e,t){var n=aU();return t=void 0===t?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=aU();return t=void 0!==n?n(t):t,r.memoizedState=r.baseState=t,e=(e=r.queue={last:null,dispatch:null,lastRenderedReducer:e,lastRenderedState:t}).dispatch=a2.bind(null,ax,e),[r.memoizedState,e]},useRef:function(e){var t=aU();return e={current:e},t.memoizedState=e},useState:aG,useDebugValue:aQ,useResponder:a_,useDeferredValue:function(e,t){var n=aG(e),r=n[0],i=n[1];return aZ(function(){l.unstable_next(function(){var n=aS.suspense;aS.suspense=void 0===t?null:t;try{i(e)}finally{aS.suspense=n}})},[e,t]),r},useTransition:function(e){var t=aG(!1),n=t[0],r=t[1];return[a1(function(t){r(!0),l.unstable_next(function(){var n=aS.suspense;aS.suspense=void 0===e?null:e;try{r(!1),t()}finally{aS.suspense=n}})},[e,n]),n]}},a6={readContext:iK,useCallback:a0,useContext:iK,useEffect:aX,useImperativeHandle:function(e,t,n){return n=null!=n?n.concat([e]):null,aq(4,36,aJ.bind(null,t,e),n)},useLayoutEffect:function(e,t){return aq(4,36,e,t)},useMemo:function(e,t){var n=aH();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&aF(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)},useReducer:az,useRef:function(){return aH().memoizedState},useState:aW,useDebugValue:aQ,useResponder:a_,useDeferredValue:function(e,t){var n=aW(e),r=n[0],i=n[1];return aX(function(){l.unstable_next(function(){var n=aS.suspense;aS.suspense=void 0===t?null:t;try{i(e)}finally{aS.suspense=n}})},[e,t]),r},useTransition:function(e){var t=aW(!1),n=t[0],r=t[1];return[a0(function(t){r(!0),l.unstable_next(function(){var n=aS.suspense;aS.suspense=void 0===e?null:e;try{r(!1),t()}finally{aS.suspense=n}})},[e,n]),n]}},a5=null,a8=null,a9=!1;function a7(e,t){var n=sq(5,null,null,0);n.elementType="DELETED",n.type="DELETED",n.stateNode=t,n.return=e,n.effectTag=8,null!==e.lastEffect?(e.lastEffect.nextEffect=n,e.lastEffect=n):e.firstEffect=e.lastEffect=n}function oe(e,t){switch(e.tag){case 5:var n=e.type;return null!==(t=1!==t.nodeType||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t)&&(e.stateNode=t,!0);case 6:return null!==(t=""===e.pendingProps||3!==t.nodeType?null:t)&&(e.stateNode=t,!0);default:return!1}}function ot(e){if(a9){var t=a8;if(t){var n=t;if(!oe(e,t)){if(!(t=n2(n.nextSibling))||!oe(e,t)){e.effectTag=-1025&e.effectTag|2,a9=!1,a5=e;return}a7(a5,n)}a5=e,a8=n2(t.firstChild)}else e.effectTag=-1025&e.effectTag|2,a9=!1,a5=e}}function on(e){for(e=e.return;null!==e&&5!==e.tag&&3!==e.tag&&13!==e.tag;)e=e.return;a5=e}function or(e){if(e!==a5)return!1;if(!a9)return on(e),a9=!0,!1;var t=e.type;if(5!==e.tag||"head"!==t&&"body"!==t&&!nQ(t,e.memoizedProps))for(t=a8;t;)a7(e,t),t=n2(t.nextSibling);if(on(e),13===e.tag){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(f(317));a:{for(t=0,e=e.nextSibling;e;){if(8===e.nodeType){var n=e.data;if(n===nK){if(0===t){a8=n2(e.nextSibling);break a}t--}else n!==nW&&n!==nq&&n!==nV||t++}e=e.nextSibling}a8=null}}else a8=a5?n2(e.stateNode.nextSibling):null;return!0}function oi(){a8=a5=null,a9=!1}var oa=Y.ReactCurrentOwner,oo=!1;function os(e,t,n,r){t.child=null===e?ac(t,null,n,r):au(t,e.child,n,r)}function ou(e,t,n,r,i){n=n.render;var a=t.ref;return(iW(t,i),r=aY(e,t,n,r,a,i),null===e||oo)?(t.effectTag|=1,os(e,t,r,i),t.child):(t.updateQueue=e.updateQueue,t.effectTag&=-517,e.expirationTime<=i&&(e.expirationTime=0),o_(e,t,i))}function oc(e,t,n,r,i,a){if(null===e){var o=n.type;return"function"!=typeof o||sZ(o)||void 0!==o.defaultProps||null!==n.compare||void 0!==n.defaultProps?((e=sQ(n.type,null,r,null,t.mode,a)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=o,ol(e,t,o,r,i,a))}return(o=e.child,it)&&sf.set(e,t))}}function sv(e,t){e.expirationTime(e=e.nextKnownPendingLevel)?t:e:t}function sw(e){if(0!==e.lastExpiredTime)e.callbackExpirationTime=1073741823,e.callbackPriority=99,e.callbackNode=iI(sE.bind(null,e));else{var t=sy(e),n=e.callbackNode;if(0===t)null!==n&&(e.callbackNode=null,e.callbackExpirationTime=0,e.callbackPriority=90);else{var r=sb();if(r=1073741823===t?99:1===t||2===t?95:0>=(r=10*(1073741821-t)-10*(1073741821-r))?99:250>=r?98:5250>=r?97:95,null!==n){var i=e.callbackPriority;if(e.callbackExpirationTime===t&&i>=r)return;n!==i_&&il(n)}e.callbackExpirationTime=t,e.callbackPriority=r,t=1073741823===t?iI(sE.bind(null,e)):iC(r,s_.bind(null,e),{timeout:10*(1073741821-t)-iM()}),e.callbackNode=t}}}function s_(e,t){if(sp=0,t)return t=sb(),s8(e,t),sw(e),null;var n=sy(e);if(0!==n){if(t=e.callbackNode,(o0&(oK|oV))!==oG)throw Error(f(327));if(sY(),e===o2&&n===o4||sT(e,n),null!==o3){var r=o0;o0|=oK;for(var i=sO(e);;)try{sI();break}catch(a){sM(e,a)}if(iH(),o0=r,o$.current=i,o6===oZ)throw t=o5,sT(e,n),s6(e,n),sw(e),t;if(null===o3)switch(i=e.finishedWork=e.current.alternate,e.finishedExpirationTime=n,o2=null,r=o6){case oq:case oZ:throw Error(f(345));case oX:s8(e,2=n){e.lastPingedTime=n,sT(e,n);break}}if(0!==(o=sy(e))&&o!==n)break;if(0!==r&&r!==n){e.lastPingedTime=r;break}e.timeoutHandle=n1(sR.bind(null,e),i);break}sR(e);break;case oQ:if(s6(e,n),n===(r=e.lastSuspendedTime)&&(e.nextKnownPendingLevel=sP(i)),st&&(0===(i=e.lastPingedTime)||i>=n)){e.lastPingedTime=n,sT(e,n);break}if(0!==(i=sy(e))&&i!==n)break;if(0!==r&&r!==n){e.lastPingedTime=r;break}if(1073741823!==o9?r=10*(1073741821-o9)-iM():1073741823===o8?r=0:(r=10*(1073741821-o8)-5e3,n=10*(1073741821-n)-(i=iM()),0>(r=i-r)&&(r=0),n<(r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*oH(r/1960))-r)&&(r=n)),10=(r=0|s.busyMinDurationMs)?r=0:(i=0|s.busyDelayMs,r=(o=iM()-(10*(1073741821-o)-(0|s.timeoutMs||5e3)))<=i?0:i+r-o),10 component higher in the tree to provide a loading indicator or placeholder to display."+ea(i))}o6!==o1&&(o6=oX),a=ox(a,i),c=r;do{switch(c.tag){case 3:s=a,c.effectTag|=4096,c.expirationTime=t;var g=oB(c,s,t);i1(c,g);break a;case 1:s=a;var v=c.type,y=c.stateNode;if(0==(64&c.effectTag)&&("function"==typeof v.getDerivedStateFromError||null!==y&&"function"==typeof y.componentDidCatch&&(null===ss||!ss.has(y)))){c.effectTag|=4096,c.expirationTime=t;var w=oU(c,s,t);i1(c,w);break a}}c=c.return}while(null!==c)}o3=sN(o3)}catch(_){t=_;continue}break}}function sO(){var e=o$.current;return o$.current=a3,null===e?a3:e}function sA(e,t){ese&&(se=e)}function sC(){for(;null!==o3;)o3=sD(o3)}function sI(){for(;null!==o3&&!id();)o3=sD(o3)}function sD(e){var t=s(e.alternate,e,o4);return e.memoizedProps=e.pendingProps,null===t&&(t=sN(e)),oz.current=null,t}function sN(e){o3=e;do{var t=o3.alternate;if(e=o3.return,0==(2048&o3.effectTag)){a:{var n=t;t=o3;var s=o4,u=t.pendingProps;switch(t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:case 20:case 21:break;case 1:case 17:ie(t.type)&&it(t);break;case 3:am(t),ir(t),(u=t.stateNode).pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(null===n||null===n.child)&&or(t)&&oE(t),i(t);break;case 5:av(t),s=ap(ah.current);var l=t.type;if(null!==n&&null!=t.stateNode)a(n,t,l,u,s),n.ref!==t.ref&&(t.effectTag|=128);else if(u){var d=ap(af.current);if(or(t)){var h=(u=t).stateNode;n=u.type;var p=u.memoizedProps,b=s;switch(h[n6]=u,h[n5]=p,l=void 0,s=h,n){case"iframe":case"object":case"embed":nw("load",s);break;case"video":case"audio":for(h=0;h",h=p.removeChild(p.firstChild)):"string"==typeof p.is?h=h.createElement(b,{is:p.is}):(h=h.createElement(b),"select"===b&&(b=h,p.multiple?b.multiple=!0:p.size&&(b.size=p.size))):h=h.createElementNS(d,b),(p=h)[n6]=n,p[n5]=u,r(p,t,!1,!1),t.stateNode=p,b=l;var m=s,g=nj(b,n=u);switch(b){case"iframe":case"object":case"embed":nw("load",p),s=n;break;case"video":case"audio":for(s=0;su.tailExpiration&&1l&&(l=n),p>l&&(l=p),s=s.sibling;u.childExpirationTime=l}if(null!==t)return t;null!==e&&0==(2048&e.effectTag)&&(null===e.firstEffect&&(e.firstEffect=o3.firstEffect),null!==o3.lastEffect&&(null!==e.lastEffect&&(e.lastEffect.nextEffect=o3.firstEffect),e.lastEffect=o3.lastEffect),1(e=e.childExpirationTime)?t:e}function sR(e){var t=iO();return iL(99,sj.bind(null,e,t)),null}function sj(e,t){do sY();while(null!==sc)if((o0&(oK|oV))!==oG)throw Error(f(327));var n=e.finishedWork,r=e.finishedExpirationTime;if(null===n)return null;if(e.finishedWork=null,e.finishedExpirationTime=0,n===e.current)throw Error(f(177));e.callbackNode=null,e.callbackExpirationTime=0,e.callbackPriority=90,e.nextKnownPendingLevel=0;var i=sP(n);if(e.firstPendingTime=i,r<=e.lastSuspendedTime?e.firstSuspendedTime=e.lastSuspendedTime=e.nextKnownPendingLevel=0:r<=e.firstSuspendedTime&&(e.firstSuspendedTime=r-1),r<=e.lastPingedTime&&(e.lastPingedTime=0),r<=e.lastExpiredTime&&(e.lastExpiredTime=0),e===o2&&(o3=o2=null,o4=0),1s&&(l=s,s=o,o=l),l=nH(E,o),d=nH(E,s),l&&d&&(1!==k.rangeCount||k.anchorNode!==l.node||k.anchorOffset!==l.offset||k.focusNode!==d.node||k.focusOffset!==d.offset)&&((S=S.createRange()).setStart(l.node,l.offset),k.removeAllRanges(),o>s?(k.addRange(S),k.extend(d.node,d.offset)):(S.setEnd(d.node,d.offset),k.addRange(S))))),S=[],k=E;k=k.parentNode;)1===k.nodeType&&S.push({element:k,left:k.scrollLeft,top:k.scrollTop});for("function"==typeof E.focus&&E.focus(),E=0;E=n)return og(e,t,n);return r4(ay,1&ay.current,t),null!==(t=o_(e,t,n))?t.sibling:null}r4(ay,1&ay.current,t);break;case 19:if(r=t.childExpirationTime>=n,0!=(64&e.effectTag)){if(r)return ow(e,t,n);t.effectTag|=64}if(null!==(i=t.memoizedState)&&(i.rendering=null,i.tail=null),r4(ay,ay.current,t),!r)return null}return o_(e,t,n)}oo=!1}}else oo=!1;switch(t.expirationTime=0,t.tag){case 2:if(r=t.type,null!==e&&(e.alternate=null,t.alternate=null,t.effectTag|=2),e=t.pendingProps,i=r7(t,r5.current),iW(t,n),i=aY(null,t,r,e,i,n),t.effectTag|=1,"object"==typeof i&&null!==i&&"function"==typeof i.render&&void 0===i.$$typeof){if(t.tag=1,aB(),ie(r)){var a=!0;io(t)}else a=!1;t.memoizedState=null!==i.state&&void 0!==i.state?i.state:null;var o=r.getDerivedStateFromProps;"function"==typeof o&&i9(t,r,o,e),i.updater=i7,t.stateNode=i,i._reactInternalFiber=t,ar(t,r,e,n),t=op(null,t,r,!0,a,n)}else t.tag=0,os(null,t,i,n),t=t.child;return t;case 16:if(i=t.elementType,null!==e&&(e.alternate=null,t.alternate=null,t.effectTag|=2),e=t.pendingProps,er(i),1!==i._status)throw i._result;switch(i=i._result,t.type=i,a=t.tag=sX(i),e=ij(i,e),a){case 0:t=od(null,t,i,e,n);break;case 1:t=oh(null,t,i,e,n);break;case 11:t=ou(null,t,i,e,n);break;case 14:t=oc(null,t,i,ij(i.type,e),r,n);break;default:throw Error(f(306,i,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:ij(r,i),od(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:ij(r,i),oh(e,t,r,i,n);case 3:if(ob(t),null===(r=t.updateQueue))throw Error(f(282));if(i=null!==(i=t.memoizedState)?i.element:null,i3(t,r,t.pendingProps,null,n),(r=t.memoizedState.element)===i)oi(),t=o_(e,t,n);else{if((i=t.stateNode.hydrate)&&(a8=n2(t.stateNode.containerInfo.firstChild),a5=t,i=a9=!0),i)for(n=ac(t,null,r,n),t.child=n;n;)n.effectTag=-3&n.effectTag|1024,n=n.sibling;else os(e,t,r,n),oi();t=t.child}return t;case 5:return ag(t),null===e&&ot(t),r=t.type,i=t.pendingProps,a=null!==e?e.memoizedProps:null,o=i.children,nQ(r,i)?o=null:null!==a&&nQ(r,a)&&(t.effectTag|=16),of(e,t),4&t.mode&&1!==n&&i.hidden?(t.expirationTime=t.childExpirationTime=1,t=null):(os(e,t,o,n),t=t.child),t;case 6:return null===e&&ot(t),null;case 13:return og(e,t,n);case 4:return ab(t,t.stateNode.containerInfo),r=t.pendingProps,null===e?t.child=au(t,null,r,n):os(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:ij(r,i),ou(e,t,r,i,n);case 7:return os(e,t,t.pendingProps,n),t.child;case 8:case 12:return os(e,t,t.pendingProps.children,n),t.child;case 10:a:{if(r=t.type._context,i=t.pendingProps,o=t.memoizedProps,i$(t,a=i.value),null!==o){var s=o.value;if(0==(a=r$(s,a)?0:("function"==typeof r._calculateChangedBits?r._calculateChangedBits(s,a):1073741823)|0)){if(o.children===i.children&&!r8.current){t=o_(e,t,n);break a}}else for(null!==(s=t.child)&&(s.return=t);null!==s;){var u=s.dependencies;if(null!==u){o=s.child;for(var c=u.firstContext;null!==c;){if(c.context===r&&0!=(c.observedBits&a)){1===s.tag&&((c=iX(n,null)).tag=2,iQ(s,c)),s.expirationTime=t&&e<=t}function s6(e,t){var n=e.firstSuspendedTime,r=e.lastSuspendedTime;nt||0===n)&&(e.lastSuspendedTime=t),t<=e.lastPingedTime&&(e.lastPingedTime=0),t<=e.lastExpiredTime&&(e.lastExpiredTime=0)}function s5(e,t){t>e.firstPendingTime&&(e.firstPendingTime=t);var n=e.firstSuspendedTime;0!==n&&(t>=n?e.firstSuspendedTime=e.lastSuspendedTime=e.nextKnownPendingLevel=0:t>=e.lastSuspendedTime&&(e.lastSuspendedTime=t+1),t>e.nextKnownPendingLevel&&(e.nextKnownPendingLevel=t))}function s8(e,t){var n=e.lastExpiredTime;(0===n||n>t)&&(e.lastExpiredTime=t)}function s9(e,t,n,r){var i=t.current,a=sb(),o=i5.suspense;a=sm(a,i,o);a:if(n){n=n._reactInternalFiber;b:{if(tr(n)!==n||1!==n.tag)throw Error(f(170));var s=n;do{switch(s.tag){case 3:s=s.stateNode.context;break b;case 1:if(ie(s.type)){s=s.stateNode.__reactInternalMemoizedMergedChildContext;break b}}s=s.return}while(null!==s)throw Error(f(171))}if(1===n.tag){var u=n.type;if(ie(u)){n=ia(n,u,s);break a}}n=s}else n=r6;return null===t.context?t.context=n:t.pendingContext=n,(t=iX(a,o)).payload={element:e},null!==(r=void 0===r?null:r)&&(t.callback=r),iQ(i,t),sg(i,a),a}function s7(e){return(e=e.current).child?(e.child.tag,e.child.stateNode):null}function ue(e,t){null!==(e=e.memoizedState)&&null!==e.dehydrated&&e.retryTime1&&void 0!==arguments[1]?arguments[1]:this.props,n=t.target;if(n){var r=n;"string"==typeof n&&(r=window[n]),_(t,e.bind(null,r))}}},{key:"render",value:function(){return this.props.children||null}}]),t}(h.PureComponent);S.propTypes={},t.withOptions=E,t.default=S},69590(e){"use strict";var t=Array.isArray,n=Object.keys,r=Object.prototype.hasOwnProperty,i="undefined"!=typeof Element;function a(e,o){if(e===o)return!0;if(e&&o&&"object"==typeof e&&"object"==typeof o){var s,u,c,l=t(e),f=t(o);if(l&&f){if((u=e.length)!=o.length)return!1;for(s=u;0!=s--;)if(!a(e[s],o[s]))return!1;return!0}if(l!=f)return!1;var d=e instanceof Date,h=o instanceof Date;if(d!=h)return!1;if(d&&h)return e.getTime()==o.getTime();var p=e instanceof RegExp,b=o instanceof RegExp;if(p!=b)return!1;if(p&&b)return e.toString()==o.toString();var m=n(e);if((u=m.length)!==n(o).length)return!1;for(s=u;0!=s--;)if(!r.call(o,m[s]))return!1;if(i&&e instanceof Element&&o instanceof Element)return e===o;for(s=u;0!=s--;)if(("_owner"!==(c=m[s])||!e.$$typeof)&&!a(e[c],o[c]))return!1;return!0}return e!=e&&o!=o}e.exports=function(e,t){try{return a(e,t)}catch(n){if(n.message&&n.message.match(/stack|recursion/i)||-2146828260===n.number)return console.warn("Warning: react-fast-compare does not handle circular references.",n.name,n.message),!1;throw n}}},57209(e,t,n){"use strict";function r(e){return e&&"object"==typeof e&&"default"in e?e.default:e}i={value:!0};var i,a=r(n(67294));function o(e){return o.warnAboutHMRDisabled&&(o.warnAboutHMRDisabled=!0,console.error("React-Hot-Loader: misconfiguration detected, using production version in non-production environment."),console.error("React-Hot-Loader: Hot Module Replacement is not enabled.")),a.Children.only(e.children)}o.warnAboutHMRDisabled=!1;var s=function e(){return e.shouldWrapWithAppContainer?function(e){return function(t){return a.createElement(o,null,a.createElement(e,t))}}:function(e){return e}};s.shouldWrapWithAppContainer=!1;var u=function(e,t){return e===t},c=function(){},l=function(e){return e},f=function(){};t.zj=o,t.wU=s,i=u,i=c,i=l,i=f},69921(e,t){"use strict";/** @license React v16.13.1 - * react-is.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ var n="function"==typeof Symbol&&Symbol.for,r=n?Symbol.for("react.element"):60103,i=n?Symbol.for("react.portal"):60106,a=n?Symbol.for("react.fragment"):60107,o=n?Symbol.for("react.strict_mode"):60108,s=n?Symbol.for("react.profiler"):60114,u=n?Symbol.for("react.provider"):60109,c=n?Symbol.for("react.context"):60110,l=n?Symbol.for("react.async_mode"):60111,f=n?Symbol.for("react.concurrent_mode"):60111,d=n?Symbol.for("react.forward_ref"):60112,h=n?Symbol.for("react.suspense"):60113,p=n?Symbol.for("react.suspense_list"):60120,b=n?Symbol.for("react.memo"):60115,m=n?Symbol.for("react.lazy"):60116,g=n?Symbol.for("react.block"):60121,v=n?Symbol.for("react.fundamental"):60117,y=n?Symbol.for("react.responder"):60118,w=n?Symbol.for("react.scope"):60119;function _(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case l:case f:case a:case s:case o:case h:return e;default:switch(e=e&&e.$$typeof){case c:case d:case m:case b:case u:return e;default:return t}}case i:return t}}}function E(e){return _(e)===f}t.AsyncMode=l,t.ConcurrentMode=f,t.ContextConsumer=c,t.ContextProvider=u,t.Element=r,t.ForwardRef=d,t.Fragment=a,t.Lazy=m,t.Memo=b,t.Portal=i,t.Profiler=s,t.StrictMode=o,t.Suspense=h,t.isAsyncMode=function(e){return E(e)||_(e)===l},t.isConcurrentMode=E,t.isContextConsumer=function(e){return _(e)===c},t.isContextProvider=function(e){return _(e)===u},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return _(e)===d},t.isFragment=function(e){return _(e)===a},t.isLazy=function(e){return _(e)===m},t.isMemo=function(e){return _(e)===b},t.isPortal=function(e){return _(e)===i},t.isProfiler=function(e){return _(e)===s},t.isStrictMode=function(e){return _(e)===o},t.isSuspense=function(e){return _(e)===h},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===a||e===f||e===s||e===o||e===h||e===p||"object"==typeof e&&null!==e&&(e.$$typeof===m||e.$$typeof===b||e.$$typeof===u||e.$$typeof===c||e.$$typeof===d||e.$$typeof===v||e.$$typeof===y||e.$$typeof===w||e.$$typeof===g)},t.typeOf=_},59864(e,t,n){"use strict";e.exports=n(69921)},46871(e,t,n){"use strict";function r(){var e=this.constructor.getDerivedStateFromProps(this.props,this.state);null!=e&&this.setState(e)}function i(e){function t(t){var n=this.constructor.getDerivedStateFromProps(e,t);return null!=n?n:null}this.setState(t.bind(this))}function a(e,t){try{var n=this.props,r=this.state;this.props=e,this.state=t,this.__reactInternalSnapshotFlag=!0,this.__reactInternalSnapshot=this.getSnapshotBeforeUpdate(n,r)}finally{this.props=n,this.state=r}}function o(e){var t,n=e.prototype;if(!n||!n.isReactComponent)throw Error("Can only polyfill class components");if("function"!=typeof e.getDerivedStateFromProps&&"function"!=typeof n.getSnapshotBeforeUpdate)return e;var o=null,s=null,u=null;if("function"==typeof n.componentWillMount?o="componentWillMount":"function"==typeof n.UNSAFE_componentWillMount&&(o="UNSAFE_componentWillMount"),"function"==typeof n.componentWillReceiveProps?s="componentWillReceiveProps":"function"==typeof n.UNSAFE_componentWillReceiveProps&&(s="UNSAFE_componentWillReceiveProps"),"function"==typeof n.componentWillUpdate?u="componentWillUpdate":"function"==typeof n.UNSAFE_componentWillUpdate&&(u="UNSAFE_componentWillUpdate"),null!==o||null!==s||null!==u){throw Error("Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n"+(e.displayName||e.name)+" uses "+("function"==typeof e.getDerivedStateFromProps?"getDerivedStateFromProps()":"getSnapshotBeforeUpdate()")+" but also contains the following legacy lifecycles:"+(null!==o?"\n "+o:"")+(null!==s?"\n "+s:"")+(null!==u?"\n "+u:"")+"\n\nThe above lifecycles should be removed. Learn more about this warning here:\nhttps://fb.me/react-async-component-lifecycle-hooks")}if("function"==typeof e.getDerivedStateFromProps&&(n.componentWillMount=r,n.componentWillReceiveProps=i),"function"==typeof n.getSnapshotBeforeUpdate){if("function"!=typeof n.componentDidUpdate)throw Error("Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype");n.componentWillUpdate=a;var c=n.componentDidUpdate;n.componentDidUpdate=function(e,t,n){var r=this.__reactInternalSnapshotFlag?this.__reactInternalSnapshot:n;c.call(this,e,t,r)}}return e}n.r(t),n.d(t,{polyfill:()=>o}),r.__suppressDeprecationWarning=!0,i.__suppressDeprecationWarning=!0,a.__suppressDeprecationWarning=!0},37703(e,t,n){"use strict";n.d(t,{zt:()=>h,$j:()=>J,wU:()=>A,I0:()=>er,v9:()=>es});var r=n(67294),i=r.createContext(null);function a(e){e()}var o=a,s=function(e){return o=e},u=function(){return o},c={notify:function(){}};function l(){var e=u(),t=null,n=null;return{clear:function(){t=null,n=null},notify:function(){e(function(){for(var e=t;e;)e.callback(),e=e.next})},get:function(){for(var e=[],n=t;n;)e.push(n),n=n.next;return e},subscribe:function(e){var r=!0,i=n={callback:e,next:null,prev:n};return i.prev?i.prev.next=i:t=i,function(){r&&null!==t&&(r=!1,i.next?i.next.prev=i.prev:n=i.prev,i.prev?i.prev.next=i.next:t=i.next)}}}}var f=function(){function e(e,t){this.store=e,this.parentSub=t,this.unsubscribe=null,this.listeners=c,this.handleChangeWrapper=this.handleChangeWrapper.bind(this)}var t=e.prototype;return t.addNestedSub=function(e){return this.trySubscribe(),this.listeners.subscribe(e)},t.notifyNestedSubs=function(){this.listeners.notify()},t.handleChangeWrapper=function(){this.onStateChange&&this.onStateChange()},t.isSubscribed=function(){return Boolean(this.unsubscribe)},t.trySubscribe=function(){this.unsubscribe||(this.unsubscribe=this.parentSub?this.parentSub.addNestedSub(this.handleChangeWrapper):this.store.subscribe(this.handleChangeWrapper),this.listeners=l())},t.tryUnsubscribe=function(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null,this.listeners.clear(),this.listeners=c)},e}();function d(e){var t=e.store,n=e.context,a=e.children,o=(0,r.useMemo)(function(){var e=new f(t);return e.onStateChange=e.notifyNestedSubs,{store:t,subscription:e}},[t]),s=(0,r.useMemo)(function(){return t.getState()},[t]);(0,r.useEffect)(function(){var e=o.subscription;return e.trySubscribe(),s!==t.getState()&&e.notifyNestedSubs(),function(){e.tryUnsubscribe(),e.onStateChange=null}},[o,s]);var u=n||i;return r.createElement(u.Provider,{value:o},a)}let h=d;var p=n(87462),b=n(63366),m=n(8679),g=n.n(m),v=n(59864),y="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?r.useLayoutEffect:r.useEffect,w=[],_=[null,null];function E(e,t){var n=e[1];return[t.payload,n+1]}function S(e,t,n){y(function(){return e.apply(void 0,t)},n)}function k(e,t,n,r,i,a,o){e.current=r,t.current=i,n.current=!1,a.current&&(a.current=null,o())}function x(e,t,n,r,i,a,o,s,u,c){if(e){var l,f=!1,d=null,h=function(){if(!f){var e,n,l=t.getState();try{e=r(l,i.current)}catch(h){n=h,d=h}n||(d=null),e===a.current?o.current||u():(a.current=e,s.current=e,o.current=!0,c({type:"STORE_UPDATED",payload:{error:n}}))}};return n.onStateChange=h,n.trySubscribe(),h(),function(){if(f=!0,n.tryUnsubscribe(),n.onStateChange=null,d)throw d}}}var T=function(){return[null,0]};function M(e,t){void 0===t&&(t={});var n=t,a=n.getDisplayName,o=void 0===a?function(e){return"ConnectAdvanced("+e+")"}:a,s=n.methodName,u=void 0===s?"connectAdvanced":s,c=n.renderCountProp,l=void 0===c?void 0:c,d=n.shouldHandleStateChanges,h=void 0===d||d,m=n.storeKey,y=void 0===m?"store":m,M=(n.withRef,n.forwardRef),O=void 0!==M&&M,A=n.context,L=void 0===A?i:A,C=(0,b.Z)(n,["getDisplayName","methodName","renderCountProp","shouldHandleStateChanges","storeKey","withRef","forwardRef","context"]),I=L;return function(t){var n=t.displayName||t.name||"Component",i=o(n),a=(0,p.Z)({},C,{getDisplayName:o,methodName:u,renderCountProp:l,shouldHandleStateChanges:h,storeKey:y,displayName:i,wrappedComponentName:n,WrappedComponent:t}),s=C.pure;function c(t){return e(t.dispatch,a)}var d=s?r.useMemo:function(e){return e()};function m(e){var n=(0,r.useMemo)(function(){var t=e.reactReduxForwardedRef,n=(0,b.Z)(e,["reactReduxForwardedRef"]);return[e.context,t,n]},[e]),i=n[0],a=n[1],o=n[2],s=(0,r.useMemo)(function(){return i&&i.Consumer&&(0,v.isContextConsumer)(r.createElement(i.Consumer,null))?i:I},[i,I]),u=(0,r.useContext)(s),l=Boolean(e.store)&&Boolean(e.store.getState)&&Boolean(e.store.dispatch);Boolean(u)&&u.store;var m=l?e.store:u.store,g=(0,r.useMemo)(function(){return c(m)},[m]),y=(0,r.useMemo)(function(){if(!h)return _;var e=new f(m,l?null:u.subscription),t=e.notifyNestedSubs.bind(e);return[e,t]},[m,l,u]),M=y[0],O=y[1],A=(0,r.useMemo)(function(){return l?u:(0,p.Z)({},u,{subscription:M})},[l,u,M]),L=(0,r.useReducer)(E,w,T),C=L[0][0],D=L[1];if(C&&C.error)throw C.error;var N=(0,r.useRef)(),P=(0,r.useRef)(o),R=(0,r.useRef)(),j=(0,r.useRef)(!1),F=d(function(){return R.current&&o===P.current?R.current:g(m.getState(),o)},[m,C,o]);S(k,[P,N,j,o,F,R,O]),S(x,[h,m,M,g,P,N,j,R,O,D],[m,M,g]);var Y=(0,r.useMemo)(function(){return r.createElement(t,(0,p.Z)({},F,{ref:a}))},[a,t,F]);return(0,r.useMemo)(function(){return h?r.createElement(s.Provider,{value:A},Y):Y},[s,Y,A])}var M=s?r.memo(m):m;if(M.WrappedComponent=t,M.displayName=i,O){var A=r.forwardRef(function(e,t){return r.createElement(M,(0,p.Z)({},e,{reactReduxForwardedRef:t}))});return A.displayName=i,A.WrappedComponent=t,g()(A,t)}return g()(M,t)}}function O(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}function A(e,t){if(O(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var i=0;i=0;r--){var i=t[r](e);if(i)return i}return function(t,r){throw Error("Invalid value of type "+typeof e+" for "+n+" argument when connecting component "+r.wrappedComponentName+".")}}function Z(e,t){return e===t}function X(e){var t=void 0===e?{}:e,n=t.connectHOC,r=void 0===n?M:n,i=t.mapStateToPropsFactories,a=void 0===i?B:i,o=t.mapDispatchToPropsFactories,s=void 0===o?j:o,u=t.mergePropsFactories,c=void 0===u?G:u,l=t.selectorFactory,f=void 0===l?V:l;return function(e,t,n,i){void 0===i&&(i={});var o=i,u=o.pure,l=void 0===u||u,d=o.areStatesEqual,h=void 0===d?Z:d,m=o.areOwnPropsEqual,g=void 0===m?A:m,v=o.areStatePropsEqual,y=void 0===v?A:v,w=o.areMergedPropsEqual,_=void 0===w?A:w,E=(0,b.Z)(o,["pure","areStatesEqual","areOwnPropsEqual","areStatePropsEqual","areMergedPropsEqual"]),S=q(e,a,"mapStateToProps"),k=q(t,s,"mapDispatchToProps"),x=q(n,c,"mergeProps");return r(f,(0,p.Z)({methodName:"connect",getDisplayName:function(e){return"Connect("+e+")"},shouldHandleStateChanges:Boolean(e),initMapStateToProps:S,initMapDispatchToProps:k,initMergeProps:x,pure:l,areStatesEqual:h,areOwnPropsEqual:g,areStatePropsEqual:y,areMergedPropsEqual:_},E))}}let J=X();function Q(){var e;return(0,r.useContext)(i)}function ee(e){void 0===e&&(e=i);var t=e===i?Q:function(){return(0,r.useContext)(e)};return function(){return t().store}}var et=ee();function en(e){void 0===e&&(e=i);var t=e===i?et:ee(e);return function(){return t().dispatch}}var er=en(),ei=function(e,t){return e===t};function ea(e,t,n,i){var a,o=(0,r.useReducer)(function(e){return e+1},0)[1],s=(0,r.useMemo)(function(){return new f(n,i)},[n,i]),u=(0,r.useRef)(),c=(0,r.useRef)(),l=(0,r.useRef)(),d=(0,r.useRef)(),h=n.getState();try{a=e!==c.current||h!==l.current||u.current?e(h):d.current}catch(p){throw u.current&&(p.message+="\nThe error may be correlated with this previous error:\n"+u.current.stack+"\n\n"),p}return y(function(){c.current=e,l.current=h,d.current=a,u.current=void 0}),y(function(){function e(){try{var e=c.current(n.getState());if(t(e,d.current))return;d.current=e}catch(r){u.current=r}o()}return s.onStateChange=e,s.trySubscribe(),e(),function(){return s.tryUnsubscribe()}},[n,s]),a}function eo(e){void 0===e&&(e=i);var t=e===i?Q:function(){return(0,r.useContext)(e)};return function(e,n){void 0===n&&(n=ei);var i,a=t(),o=ea(e,n,a.store,a.subscription);return(0,r.useDebugValue)(o),o}}var es=eo();s(n(73935).unstable_batchedUpdates)},73727(e,t,n){"use strict";n.d(t,{VK:()=>l,rU:()=>g});var r=n(5977),i=n(51721),a=n(67294),o=n(90071),s=n(87462),u=n(63366),c=n(2177),l=function(e){function t(){for(var t,n=arguments.length,r=Array(n),i=0;iC,AW:()=>F,F0:()=>k,rs:()=>B,s6:()=>S,LX:()=>R,k6:()=>H,TH:()=>$,UO:()=>z,$B:()=>G});var r=n(51721),i=n(67294),a=n(90071),o=n(45697),s=n.n(o),u=1073741823,c="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==n.g?n.g:{};function l(){var e="__global_unique_id__";return c[e]=(c[e]||0)+1}function f(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function d(e){var t=[];return{on:function(e){t.push(e)},off:function(e){t=t.filter(function(t){return t!==e})},get:function(){return e},set:function(n,r){e=n,t.forEach(function(t){return t(e,r)})}}}function h(e){return Array.isArray(e)?e[0]:e}function p(e,t){var n,a,o="__create-react-context-"+l()+"__",c=function(e){function n(){var t;return t=e.apply(this,arguments)||this,t.emitter=d(t.props.value),t}(0,r.Z)(n,e);var i=n.prototype;return i.getChildContext=function(){var e;return(e={})[o]=this.emitter,e},i.componentWillReceiveProps=function(e){if(this.props.value!==e.value){var n,r=this.props.value,i=e.value;f(r,i)?n=0:(n="function"==typeof t?t(r,i):u,0!=(n|=0)&&this.emitter.set(e.value,n))}},i.render=function(){return this.props.children},n}(i.Component);c.childContextTypes=((n={})[o]=s().object.isRequired,n);var p=function(t){function n(){var e;return e=t.apply(this,arguments)||this,e.state={value:e.getValue()},e.onUpdate=function(t,n){((0|e.observedBits)&n)!=0&&e.setState({value:e.getValue()})},e}(0,r.Z)(n,t);var i=n.prototype;return i.componentWillReceiveProps=function(e){var t=e.observedBits;this.observedBits=null==t?u:t},i.componentDidMount=function(){this.context[o]&&this.context[o].on(this.onUpdate);var e=this.props.observedBits;this.observedBits=null==e?u:e},i.componentWillUnmount=function(){this.context[o]&&this.context[o].off(this.onUpdate)},i.getValue=function(){return this.context[o]?this.context[o].get():e},i.render=function(){return h(this.props.children)(this.state.value)},n}(i.Component);return p.contextTypes=((a={})[o]=s().object,a),{Provider:c,Consumer:p}}var b=i.createContext||p;let m=b;var g=n(2177),v=n(87462),y=n(39658),w=n.n(y);n(59864),n(63366),n(8679);var _=function(e){var t=m();return t.displayName=e,t},E=_("Router-History"),S=_("Router"),k=function(e){function t(t){var n;return(n=e.call(this,t)||this).state={location:t.history.location},n._isMounted=!1,n._pendingLocation=null,t.staticContext||(n.unlisten=t.history.listen(function(e){n._isMounted?n.setState({location:e}):n._pendingLocation=e})),n}(0,r.Z)(t,e),t.computeRootMatch=function(e){return{path:"/",url:"/",params:{},isExact:"/"===e}};var n=t.prototype;return n.componentDidMount=function(){this._isMounted=!0,this._pendingLocation&&this.setState({location:this._pendingLocation})},n.componentWillUnmount=function(){this.unlisten&&(this.unlisten(),this._isMounted=!1,this._pendingLocation=null)},n.render=function(){return i.createElement(S.Provider,{value:{history:this.props.history,location:this.state.location,match:t.computeRootMatch(this.state.location.pathname),staticContext:this.props.staticContext}},i.createElement(E.Provider,{children:this.props.children||null,value:this.props.history}))},t}(i.Component);i.Component;var x=function(e){function t(){return e.apply(this,arguments)||this}(0,r.Z)(t,e);var n=t.prototype;return n.componentDidMount=function(){this.props.onMount&&this.props.onMount.call(this,this)},n.componentDidUpdate=function(e){this.props.onUpdate&&this.props.onUpdate.call(this,this,e)},n.componentWillUnmount=function(){this.props.onUnmount&&this.props.onUnmount.call(this,this)},n.render=function(){return null},t}(i.Component),T={},M=1e4,O=0;function A(e){if(T[e])return T[e];var t=w().compile(e);return O=0||(i[n]=e[n]);return i}function l(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}n(54726);var f="unmounted";t.UNMOUNTED=f;var d="exited";t.EXITED=d;var h="entering";t.ENTERING=h;var p="entered";t.ENTERED=p;var b="exiting";t.EXITING=b;var m=function(e){function t(t,n){r=e.call(this,t,n)||this;var r,i,a=n.transitionGroup,o=a&&!a.isMounting?t.enter:t.appear;return r.appearStatus=null,t.in?o?(i=d,r.appearStatus=h):i=p:i=t.unmountOnExit||t.mountOnEnter?f:d,r.state={status:i},r.nextCallback=null,r}l(t,e);var n=t.prototype;return n.getChildContext=function(){return{transitionGroup:null}},t.getDerivedStateFromProps=function(e,t){return e.in&&t.status===f?{status:d}:null},n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(e){var t=null;if(e!==this.props){var n=this.state.status;this.props.in?n!==h&&n!==p&&(t=h):(n===h||n===p)&&(t=b)}this.updateStatus(!1,t)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var e,t,n,r=this.props.timeout;return e=t=n=r,null!=r&&"number"!=typeof r&&(e=r.exit,t=r.enter,n=void 0!==r.appear?r.appear:t),{exit:e,enter:t,appear:n}},n.updateStatus=function(e,t){if(void 0===e&&(e=!1),null!==t){this.cancelNextCallback();var n=a.default.findDOMNode(this);t===h?this.performEnter(n,e):this.performExit(n)}else this.props.unmountOnExit&&this.state.status===d&&this.setState({status:f})},n.performEnter=function(e,t){var n=this,r=this.props.enter,i=this.context.transitionGroup?this.context.transitionGroup.isMounting:t,a=this.getTimeouts(),o=i?a.appear:a.enter;if(!t&&!r){this.safeSetState({status:p},function(){n.props.onEntered(e)});return}this.props.onEnter(e,i),this.safeSetState({status:h},function(){n.props.onEntering(e,i),n.onTransitionEnd(e,o,function(){n.safeSetState({status:p},function(){n.props.onEntered(e,i)})})})},n.performExit=function(e){var t=this,n=this.props.exit,r=this.getTimeouts();if(!n){this.safeSetState({status:d},function(){t.props.onExited(e)});return}this.props.onExit(e),this.safeSetState({status:b},function(){t.props.onExiting(e),t.onTransitionEnd(e,r.exit,function(){t.safeSetState({status:d},function(){t.props.onExited(e)})})})},n.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},n.setNextCallback=function(e){var t=this,n=!0;return this.nextCallback=function(r){n&&(n=!1,t.nextCallback=null,e(r))},this.nextCallback.cancel=function(){n=!1},this.nextCallback},n.onTransitionEnd=function(e,t,n){this.setNextCallback(n);var r=null==t&&!this.props.addEndListener;if(!e||r){setTimeout(this.nextCallback,0);return}this.props.addEndListener&&this.props.addEndListener(e,this.nextCallback),null!=t&&setTimeout(this.nextCallback,t)},n.render=function(){var e=this.state.status;if(e===f)return null;var t=this.props,n=t.children,r=c(t,["children"]);if(delete r.in,delete r.mountOnEnter,delete r.unmountOnExit,delete r.appear,delete r.enter,delete r.exit,delete r.timeout,delete r.addEndListener,delete r.onEnter,delete r.onEntering,delete r.onEntered,delete r.onExit,delete r.onExiting,delete r.onExited,"function"==typeof n)return n(e,r);var a=i.default.Children.only(n);return i.default.cloneElement(a,r)},t}(i.default.Component);function g(){}m.contextTypes={transitionGroup:r.object},m.childContextTypes={transitionGroup:function(){}},m.propTypes={},m.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:g,onEntering:g,onEntered:g,onExit:g,onExiting:g,onExited:g},m.UNMOUNTED=0,m.EXITED=1,m.ENTERING=2,m.ENTERED=3,m.EXITING=4;var v=(0,o.polyfill)(m);t.default=v},92381(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r=s(n(45697)),i=s(n(67294)),a=n(46871),o=n(40537);function s(e){return e&&e.__esModule?e:{default:e}}function u(e,t){if(null==e)return{};var n,r,i={},a=Object.keys(e);for(r=0;r=0||(i[n]=e[n]);return i}function c(){return(c=Object.assign||function(e){for(var t=1;tI.length&&I.push(e)}function P(e,t,n,r){var i=typeof e;("undefined"===i||"boolean"===i)&&(e=null);var s=!1;if(null===e)s=!0;else switch(i){case"string":case"number":s=!0;break;case"object":switch(e.$$typeof){case a:case o:s=!0}}if(s)return n(r,e,""===t?"."+j(e,0):t),1;if(s=0,t=""===t?".":t+":",Array.isArray(e))for(var u=0;u2)?"one of ".concat(t," ").concat(e.slice(0,n-1).join(", "),", or ")+e[n-1]:2===n?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}function a(e,t,n){return e.substr(!n||n<0?0:+n,t.length)===t}function o(e,t,n){return(void 0===n||n>e.length)&&(n=e.length),e.substring(n-t.length,n)===t}function s(e,t,n){return"number"!=typeof n&&(n=0),!(n+t.length>e.length)&&-1!==e.indexOf(t,n)}r("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError),r("ERR_INVALID_ARG_TYPE",function(e,t,n){if("string"==typeof t&&a(t,"not ")?(r="must not be",t=t.replace(/^not /,"")):r="must be",o(e," argument"))u="The ".concat(e," ").concat(r," ").concat(i(t,"type"));else{var r,u,c=s(e,".")?"property":"argument";u='The "'.concat(e,'" ').concat(c," ").concat(r," ").concat(i(t,"type"))}return u+". Received type ".concat(typeof n)},TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"}),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"}),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.q=n},56753(e,t,n){"use strict";var r=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};e.exports=c;var i=n(79481),a=n(64229);n(35717)(c,i);for(var o=r(a.prototype),s=0;s0){if("string"==typeof t||u.objectMode||Object.getPrototypeOf(t)===a.prototype||(t=s(t)),r)u.endEmitted?S(e,new E):A(e,u,t,!0);else if(u.ended)S(e,new w);else{if(u.destroyed)return!1;u.reading=!1,u.decoder&&!n?(t=u.decoder.write(t),u.objectMode||0!==t.length?A(e,u,t,!1):j(e,u)):A(e,u,t,!1)}}else r||(u.reading=!1,j(e,u));return!u.ended&&(u.length=C?e=C:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function D(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=I(e)),e<=t.length)?e:t.ended?t.length:(t.needReadable=!0,0)}function N(e,t){if(f("onEofChunk"),!t.ended){if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,t.sync?P(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,R(e)))}}function P(e){var t=e._readableState;f("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(f("emitReadable",t.flowing),t.emittedReadable=!0,process.nextTick(R,e))}function R(e){var t=e._readableState;f("emitReadable_",t.destroyed,t.length,t.ended),!t.destroyed&&(t.length||t.ended)&&(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,z(e)}function j(e,t){t.readingMore||(t.readingMore=!0,process.nextTick(F,e,t))}function F(e,t){for(;!t.reading&&!t.ended&&(t.length0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function U(e){f("readable nexttick read 0"),e.read(0)}function H(e,t){t.resumeScheduled||(t.resumeScheduled=!0,process.nextTick($,e,t))}function $(e,t){f("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),z(e),t.flowing&&!t.reading&&e.read(0)}function z(e){var t=e._readableState;for(f("flow",t.flowing);t.flowing&&null!==e.read(););}function G(e,t){var n;return 0===t.length?null:(t.objectMode?n=t.buffer.shift():!e||e>=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):n=t.buffer.consume(e,t.decoder),n)}function W(e){var t=e._readableState;f("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,process.nextTick(K,t,e))}function K(e,t){if(f("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var n=t._writableState;(!n||n.autoDestroy&&n.finished)&&t.destroy()}}function V(e,t){for(var n=0,r=e.length;n=n.highWaterMark:n.length>0)||n.ended))return f("read: emitReadable",n.length,n.ended),0===n.length&&n.ended?W(this):P(this),null;if(0===(e=D(e,n))&&n.ended)return 0===n.length&&W(this),null;var i=n.needReadable;return f("need readable",i),(0===n.length||n.length-e0?G(e,n):null)?(n.needReadable=n.length<=n.highWaterMark,e=0):(n.length-=e,n.awaitDrain=0),0===n.length&&(n.ended||(n.needReadable=!0),r!==e&&n.ended&&W(this)),null!==t&&this.emit("data",t),t},M.prototype._read=function(e){S(this,new _("_read()"))},M.prototype.pipe=function(e,t){var n=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=e;break;case 1:i.pipes=[i.pipes,e];break;default:i.pipes.push(e)}i.pipesCount+=1,f("pipe count=%d opts=%j",i.pipesCount,t);var a=t&&!1===t.end||e===process.stdout||e===process.stderr?m:s;function o(e,t){f("onunpipe"),e===n&&t&&!1===t.hasUnpiped&&(t.hasUnpiped=!0,l())}function s(){f("onend"),e.end()}i.endEmitted?process.nextTick(a):n.once("end",a),e.on("unpipe",o);var u=Y(n);e.on("drain",u);var c=!1;function l(){f("cleanup"),e.removeListener("close",p),e.removeListener("finish",b),e.removeListener("drain",u),e.removeListener("error",h),e.removeListener("unpipe",o),n.removeListener("end",s),n.removeListener("end",m),n.removeListener("data",d),c=!0,i.awaitDrain&&(!e._writableState||e._writableState.needDrain)&&u()}function d(t){f("ondata");var r=e.write(t);f("dest.write",r),!1===r&&((1===i.pipesCount&&i.pipes===e||i.pipesCount>1&&-1!==V(i.pipes,e))&&!c&&(f("false write response, pause",i.awaitDrain),i.awaitDrain++),n.pause())}function h(t){f("onerror",t),m(),e.removeListener("error",h),0===r(e,"error")&&S(e,t)}function p(){e.removeListener("finish",b),m()}function b(){f("onfinish"),e.removeListener("close",p),m()}function m(){f("unpipe"),n.unpipe(e)}return n.on("data",d),x(e,"error",h),e.once("close",p),e.once("finish",b),e.emit("pipe",n),i.flowing||(f("pipe resume"),n.resume()),e},M.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,n)),this;if(!e){var r=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var a=0;a0,!1!==r.flowing&&this.resume()):"readable"!==e||r.endEmitted||r.readableListening||(r.readableListening=r.needReadable=!0,r.flowing=!1,r.emittedReadable=!1,f("on readable",r.length,r.reading),r.length?P(this):r.reading||process.nextTick(U,this)),n},M.prototype.addListener=M.prototype.on,M.prototype.removeListener=function(e,t){var n=i.prototype.removeListener.call(this,e,t);return"readable"===e&&process.nextTick(B,this),n},M.prototype.removeAllListeners=function(e){var t=i.prototype.removeAllListeners.apply(this,arguments);return("readable"===e||void 0===e)&&process.nextTick(B,this),t},M.prototype.resume=function(){var e=this._readableState;return e.flowing||(f("resume"),e.flowing=!e.readableListening,H(this,e)),e.paused=!1,this},M.prototype.pause=function(){return f("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(f("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},M.prototype.wrap=function(e){var t=this,n=this._readableState,r=!1;for(var i in e.on("end",function(){if(f("wrapped end"),n.decoder&&!n.ended){var e=n.decoder.end();e&&e.length&&t.push(e)}t.push(null)}),e.on("data",function(i){if(f("wrapped data"),n.decoder&&(i=n.decoder.write(i)),!n.objectMode||null!=i)(n.objectMode||i&&i.length)&&(t.push(i)||(r=!0,e.pause()))}),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var a=0;a-1))throw new E(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(T.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(T.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),T.prototype._write=function(e,t,n){n(new m("_write()"))},T.prototype._writev=null,T.prototype.end=function(e,t,n){var r=this._writableState;return"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||H(this,r,n),this},Object.defineProperty(T.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(T.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),T.prototype.destroy=d.destroy,T.prototype._undestroy=d.undestroy,T.prototype._destroy=function(e,t){t(e)}},45850(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var i,a=n(8610),o=Symbol("lastResolve"),s=Symbol("lastReject"),u=Symbol("error"),c=Symbol("ended"),l=Symbol("lastPromise"),f=Symbol("handlePromise"),d=Symbol("stream");function h(e,t){return{value:e,done:t}}function p(e){var t=e[o];if(null!==t){var n=e[d].read();null!==n&&(e[l]=null,e[o]=null,e[s]=null,t(h(n,!1)))}}function b(e){process.nextTick(p,e)}function m(e,t){return function(n,r){e.then(function(){if(t[c]){n(h(void 0,!0));return}t[f](n,r)},r)}}var g=Object.getPrototypeOf(function(){}),v=Object.setPrototypeOf((i={get stream(){return this[d]},next:function(){var e,t=this,n=this[u];if(null!==n)return Promise.reject(n);if(this[c])return Promise.resolve(h(void 0,!0));if(this[d].destroyed)return new Promise(function(e,n){process.nextTick(function(){t[u]?n(t[u]):e(h(void 0,!0))})});var r=this[l];if(r)e=new Promise(m(r,this));else{var i=this[d].read();if(null!==i)return Promise.resolve(h(i,!1));e=new Promise(this[f])}return this[l]=e,e}},r(i,Symbol.asyncIterator,function(){return this}),r(i,"return",function(){var e=this;return new Promise(function(t,n){e[d].destroy(null,function(e){if(e){n(e);return}t(h(void 0,!0))})})}),i),g),y=function(e){var t,n=Object.create(v,(r(t={},d,{value:e,writable:!0}),r(t,o,{value:null,writable:!0}),r(t,s,{value:null,writable:!0}),r(t,u,{value:null,writable:!0}),r(t,c,{value:e._readableState.endEmitted,writable:!0}),r(t,f,{value:function(e,t){var r=n[d].read();r?(n[l]=null,n[o]=null,n[s]=null,e(h(r,!1))):(n[o]=e,n[s]=t)},writable:!0}),t));return n[l]=null,a(e,function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=n[s];null!==t&&(n[l]=null,n[o]=null,n[s]=null,t(e)),n[u]=e;return}var r=n[o];null!==r&&(n[l]=null,n[o]=null,n[s]=null,r(h(void 0,!0))),n[c]=!0}),e.on("readable",b.bind(null,n)),n};e.exports=y},77086(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n}},{key:"concat",value:function(e){if(0===this.length)return c.alloc(0);for(var t=c.allocUnsafe(e>>>0),n=this.head,r=0;n;)d(n.data,t,r),r+=n.data.length,n=n.next;return t}},{key:"consume",value:function(e,t){var n;return ei.length?i.length:e;if(a===i.length?r+=i:r+=i.slice(0,e),0==(e-=a)){a===i.length?(++n,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(a));break}++n}return this.length-=n,r}},{key:"_getBuffer",value:function(e){var t=c.allocUnsafe(e),n=this.head,r=1;for(n.data.copy(t),e-=n.data.length;n=n.next;){var i=n.data,a=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,a),0==(e-=a)){a===i.length?(++r,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=i.slice(a));break}++r}return this.length-=r,t}},{key:f,value:function(e,t){return l(this,i({},t,{depth:0,customInspect:!1}))}}]),e}()},61195(e){"use strict";function t(e,t){var i=this,o=this._readableState&&this._readableState.destroyed,s=this._writableState&&this._writableState.destroyed;return o||s?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(a,this,e)):process.nextTick(a,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(e){!t&&e?i._writableState?i._writableState.errorEmitted?process.nextTick(r,i):(i._writableState.errorEmitted=!0,process.nextTick(n,i,e)):process.nextTick(n,i,e):t?(process.nextTick(r,i),t(e)):process.nextTick(r,i)}),this)}function n(e,t){a(e,t),r(e)}function r(e){(!e._writableState||e._writableState.emitClose)&&(!e._readableState||e._readableState.emitClose)&&e.emit("close")}function i(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function a(e,t){e.emit("error",t)}function o(e,t){var n=e._readableState,r=e._writableState;n&&n.autoDestroy||r&&r.autoDestroy?e.destroy(t):e.emit("error",t)}e.exports={destroy:t,undestroy:i,errorOrDestroy:o}},8610(e,t,n){"use strict";var r=n(94281).q.ERR_STREAM_PREMATURE_CLOSE;function i(e){var t=!1;return function(){if(!t){t=!0;for(var n=arguments.length,r=Array(n),i=0;i0,function(t){e||(e=t),t&&a.forEach(f),o||(a.forEach(f),i(e))})});return n.reduce(d)}e.exports=p},82457(e,t,n){"use strict";var r=n(94281).q.ERR_INVALID_OPT_VALUE;function i(e,t,n){return null!=e.highWaterMark?e.highWaterMark:t?e[n]:null}function a(e,t,n,a){var o=i(t,a,n);if(null!=o){if(!(isFinite(o)&&Math.floor(o)===o)||o<0){var s=a?n:"highWaterMark";throw new r(s,o)}return Math.floor(o)}return e.objectMode?16:16384}e.exports={getHighWaterMark:a}},22503(e,t,n){e.exports=n(17187).EventEmitter},61566(e,t){"use strict";t.__esModule=!0,t.default=void 0;var n=function(e){return"string"==typeof e?e:e?e.displayName||e.name||"Component":void 0};t.default=n},60375(e){"use strict";var t=Object.prototype.hasOwnProperty;function n(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}function r(e,r){if(n(e,r))return!0;if("object"!=typeof e||null===e||"object"!=typeof r||null===r)return!1;var i=Object.keys(e),a=Object.keys(r);if(i.length!==a.length)return!1;for(var o=0;og,DE:()=>b,UY:()=>h,qC:()=>m,MT:()=>f});var r=n(4942);function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function a(e){for(var t=1;t]?|>=?|\?=|[-+\/=])(?=\s)/,lookbehind:!0},"string-operator":{pattern:/(\s)&&?(?=\s)/,lookbehind:!0,alias:"keyword"},"token-operator":[{pattern:/(\w)(?:->?|=>|[~|{}])(?=\w)/,lookbehind:!0,alias:"punctuation"},{pattern:/[|{}]/,alias:"punctuation"}],punctuation:/[,.:()]/}}e.exports=t,t.displayName="abap",t.aliases=[]},68313(e){"use strict";function t(e){var t,n;n="(?:ALPHA|BIT|CHAR|CR|CRLF|CTL|DIGIT|DQUOTE|HEXDIG|HTAB|LF|LWSP|OCTET|SP|VCHAR|WSP)",(t=e).languages.abnf={comment:/;.*/,string:{pattern:/(?:%[is])?"[^"\n\r]*"/,greedy:!0,inside:{punctuation:/^%[is]/}},range:{pattern:/%(?:b[01]+-[01]+|d\d+-\d+|x[A-F\d]+-[A-F\d]+)/i,alias:"number"},terminal:{pattern:/%(?:b[01]+(?:\.[01]+)*|d\d+(?:\.\d+)*|x[A-F\d]+(?:\.[A-F\d]+)*)/i,alias:"number"},repetition:{pattern:/(^|[^\w-])(?:\d*\*\d*|\d+)/,lookbehind:!0,alias:"operator"},definition:{pattern:/(^[ \t]*)(?:[a-z][\w-]*|<[^<>\r\n]*>)(?=\s*=)/m,lookbehind:!0,alias:"keyword",inside:{punctuation:/<|>/}},"core-rule":{pattern:RegExp("(?:(^|[^<\\w-])"+n+"|<"+n+">)(?![\\w-])","i"),lookbehind:!0,alias:["rule","constant"],inside:{punctuation:/<|>/}},rule:{pattern:/(^|[^<\w-])[a-z][\w-]*|<[^<>\r\n]*>/i,lookbehind:!0,inside:{punctuation:/<|>/}},operator:/=\/?|\//,punctuation:/[()\[\]]/}}e.exports=t,t.displayName="abnf",t.aliases=[]},5199(e){"use strict";function t(e){e.languages.actionscript=e.languages.extend("javascript",{keyword:/\b(?:as|break|case|catch|class|const|default|delete|do|else|extends|finally|for|function|if|implements|import|in|instanceof|interface|internal|is|native|new|null|package|private|protected|public|return|super|switch|this|throw|try|typeof|use|var|void|while|with|dynamic|each|final|get|include|namespace|override|set|static)\b/,operator:/\+\+|--|(?:[+\-*\/%^]|&&?|\|\|?|<>?>?|[!=]=?)=?|[~?@]/}),e.languages.actionscript["class-name"].alias="function",e.languages.markup&&e.languages.insertBefore("actionscript","string",{xml:{pattern:/(^|[^.])<\/?\w+(?:\s+[^\s>\/=]+=("|')(?:\\[\s\S]|(?!\2)[^\\])*\2)*\s*\/?>/,lookbehind:!0,inside:e.languages.markup}})}e.exports=t,t.displayName="actionscript",t.aliases=[]},89693(e){"use strict";function t(e){e.languages.ada={comment:/--.*/,string:/"(?:""|[^"\r\f\n])*"/i,number:[{pattern:/\b\d(?:_?\d)*#[\dA-F](?:_?[\dA-F])*(?:\.[\dA-F](?:_?[\dA-F])*)?#(?:E[+-]?\d(?:_?\d)*)?/i},{pattern:/\b\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:E[+-]?\d(?:_?\d)*)?\b/i}],"attr-name":/\b'\w+/i,keyword:/\b(?:abort|abs|abstract|accept|access|aliased|all|and|array|at|begin|body|case|constant|declare|delay|delta|digits|do|else|new|return|elsif|end|entry|exception|exit|for|function|generic|goto|if|in|interface|is|limited|loop|mod|not|null|of|others|out|overriding|package|pragma|private|procedure|protected|raise|range|record|rem|renames|requeue|reverse|select|separate|some|subtype|synchronized|tagged|task|terminate|then|type|until|use|when|while|with|xor)\b/i,boolean:/\b(?:true|false)\b/i,operator:/<[=>]?|>=?|=>?|:=|\/=?|\*\*?|[&+-]/,punctuation:/\.\.?|[,;():]/,char:/'.'/,variable:/\b[a-z](?:\w)*\b/i}}e.exports=t,t.displayName="ada",t.aliases=[]},24001(e){"use strict";function t(e){var t;(t=e).languages.agda={comment:/\{-[\s\S]*?(?:-\}|$)|--.*/,string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^\\\r\n"])*"/,greedy:!0},punctuation:/[(){}⦃⦄.;@]/,"class-name":{pattern:/((?:data|record) +)\S+/,lookbehind:!0},function:{pattern:/(^[ \t]*)(?!\s)[^:\r\n]+(?=:)/m,lookbehind:!0},operator:{pattern:/(^\s*|\s)(?:[=|:∀→λ\\?_]|->)(?=\s)/,lookbehind:!0},keyword:/\b(?:Set|abstract|constructor|data|eta-equality|field|forall|hiding|import|in|inductive|infix|infixl|infixr|instance|let|macro|module|mutual|no-eta-equality|open|overlap|pattern|postulate|primitive|private|public|quote|quoteContext|quoteGoal|quoteTerm|record|renaming|rewrite|syntax|tactic|unquote|unquoteDecl|unquoteDef|using|variable|where|with)\b/}}e.exports=t,t.displayName="agda",t.aliases=[]},18018(e){"use strict";function t(e){e.languages.al={comment:/\/\/.*|\/\*[\s\S]*?\*\//,string:{pattern:/'(?:''|[^'\r\n])*'(?!')|"(?:""|[^"\r\n])*"(?!")/,greedy:!0},function:{pattern:/(\b(?:event|procedure|trigger)\s+|(?:^|[^.])\.\s*)[a-z_]\w*(?=\s*\()/i,lookbehind:!0},keyword:[/\b(?:array|asserterror|begin|break|case|do|downto|else|end|event|exit|for|foreach|function|if|implements|in|indataset|interface|internal|local|of|procedure|program|protected|repeat|runonclient|securityfiltering|suppressdispose|temporary|then|to|trigger|until|var|while|with|withevents)\b/i,/\b(?:action|actions|addafter|addbefore|addfirst|addlast|area|assembly|chartpart|codeunit|column|controladdin|cuegroup|customizes|dataitem|dataset|dotnet|elements|enum|enumextension|extends|field|fieldattribute|fieldelement|fieldgroup|fieldgroups|fields|filter|fixed|grid|group|key|keys|label|labels|layout|modify|moveafter|movebefore|movefirst|movelast|page|pagecustomization|pageextension|part|profile|query|repeater|report|requestpage|schema|separator|systempart|table|tableelement|tableextension|textattribute|textelement|type|usercontrol|value|xmlport)\b/i],number:/\b(?:0x[\da-f]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?)(?:F|U(?:LL?)?|LL?)?\b/i,boolean:/\b(?:false|true)\b/i,variable:/\b(?:Curr(?:FieldNo|Page|Report)|RequestOptionsPage|x?Rec)\b/,"class-name":/\b(?:automation|biginteger|bigtext|blob|boolean|byte|char|clienttype|code|completiontriggererrorlevel|connectiontype|database|dataclassification|datascope|date|dateformula|datetime|decimal|defaultlayout|dialog|dictionary|dotnetassembly|dotnettypedeclaration|duration|errorinfo|errortype|executioncontext|executionmode|fieldclass|fieldref|fieldtype|file|filterpagebuilder|guid|httpclient|httpcontent|httpheaders|httprequestmessage|httpresponsemessage|instream|integer|joker|jsonarray|jsonobject|jsontoken|jsonvalue|keyref|list|moduledependencyinfo|moduleinfo|none|notification|notificationscope|objecttype|option|outstream|pageresult|record|recordid|recordref|reportformat|securityfilter|sessionsettings|tableconnectiontype|tablefilter|testaction|testfield|testfilterfield|testpage|testpermissions|testrequestpage|text|textbuilder|textconst|textencoding|time|transactionmodel|transactiontype|variant|verbosity|version|view|views|webserviceactioncontext|webserviceactionresultcode|xmlattribute|xmlattributecollection|xmlcdata|xmlcomment|xmldeclaration|xmldocument|xmldocumenttype|xmlelement|xmlnamespacemanager|xmlnametable|xmlnode|xmlnodelist|xmlprocessinginstruction|xmlreadoptions|xmltext|xmlwriteoptions)\b/i,operator:/\.\.|:[=:]|[-+*/]=?|<>|[<>]=?|=|\b(?:and|div|mod|not|or|xor)\b/i,punctuation:/[()\[\]{}:.;,]/}}e.exports=t,t.displayName="al",t.aliases=[]},36363(e){"use strict";function t(e){e.languages.antlr4={comment:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,string:{pattern:/'(?:\\.|[^\\'\r\n])*'/,greedy:!0},"character-class":{pattern:/\[(?:\\.|[^\\\]\r\n])*\]/,greedy:!0,alias:"regex",inside:{range:{pattern:/([^[]|(?:^|[^\\])(?:\\\\)*\\\[)-(?!\])/,lookbehind:!0,alias:"punctuation"},escape:/\\(?:u(?:[a-fA-F\d]{4}|\{[a-fA-F\d]+\})|[pP]\{[=\w-]+\}|[^\r\nupP])/,punctuation:/[\[\]]/}},action:{pattern:/\{(?:[^{}]|\{(?:[^{}]|\{(?:[^{}]|\{[^{}]*\})*\})*\})*\}/,greedy:!0,inside:{content:{pattern:/(\{)[\s\S]+(?=\})/,lookbehind:!0},punctuation:/[{}]/}},command:{pattern:/(->\s*(?!\s))(?:\s*(?:,\s*)?\b[a-z]\w*(?:\s*\([^()\r\n]*\))?)+(?=\s*;)/i,lookbehind:!0,inside:{function:/\b\w+(?=\s*(?:[,(]|$))/,punctuation:/[,()]/}},annotation:{pattern:/@\w+(?:::\w+)*/,alias:"keyword"},label:{pattern:/#[ \t]*\w+/,alias:"punctuation"},keyword:/\b(?:catch|channels|finally|fragment|grammar|import|lexer|locals|mode|options|parser|returns|throws|tokens)\b/,definition:[{pattern:/\b[a-z]\w*(?=\s*:)/,alias:["rule","class-name"]},{pattern:/\b[A-Z]\w*(?=\s*:)/,alias:["token","constant"]}],constant:/\b[A-Z][A-Z_]*\b/,operator:/\.\.|->|[|~]|[*+?]\??/,punctuation:/[;:()=]/},e.languages.g4=e.languages.antlr4}e.exports=t,t.displayName="antlr4",t.aliases=["g4"]},35281(e){"use strict";function t(e){e.languages.apacheconf={comment:/#.*/,"directive-inline":{pattern:/(^[\t ]*)\b(?:AcceptFilter|AcceptPathInfo|AccessFileName|Action|Add(?:Alt|AltByEncoding|AltByType|Charset|DefaultCharset|Description|Encoding|Handler|Icon|IconByEncoding|IconByType|InputFilter|Language|ModuleInfo|OutputFilter|OutputFilterByType|Type)|Alias|AliasMatch|Allow(?:CONNECT|EncodedSlashes|Methods|Override|OverrideList)?|Anonymous(?:_LogEmail|_MustGiveEmail|_NoUserID|_VerifyEmail)?|AsyncRequestWorkerFactor|Auth(?:BasicAuthoritative|BasicFake|BasicProvider|BasicUseDigestAlgorithm|DBDUserPWQuery|DBDUserRealmQuery|DBMGroupFile|DBMType|DBMUserFile|Digest(?:Algorithm|Domain|NonceLifetime|Provider|Qop|ShmemSize)|Form(?:Authoritative|Body|DisableNoStore|FakeBasicAuth|Location|LoginRequiredLocation|LoginSuccessLocation|LogoutLocation|Method|Mimetype|Password|Provider|SitePassphrase|Size|Username)|GroupFile|LDAP(?:AuthorizePrefix|BindAuthoritative|BindDN|BindPassword|CharsetConfig|CompareAsUser|CompareDNOnServer|DereferenceAliases|GroupAttribute|GroupAttributeIsDN|InitialBindAsUser|InitialBindPattern|MaxSubGroupDepth|RemoteUserAttribute|RemoteUserIsDN|SearchAsUser|SubGroupAttribute|SubGroupClass|Url)|Merging|Name|Type|UserFile|nCache(?:Context|Enable|ProvideFor|SOCache|Timeout)|nzFcgiCheckAuthnProvider|nzFcgiDefineProvider|zDBDLoginToReferer|zDBDQuery|zDBDRedirectQuery|zDBMType|zSendForbiddenOnFailure)|BalancerGrowth|BalancerInherit|BalancerMember|BalancerPersist|BrowserMatch|BrowserMatchNoCase|BufferSize|BufferedLogs|CGIDScriptTimeout|CGIMapExtension|Cache(?:DefaultExpire|DetailHeader|DirLength|DirLevels|Disable|Enable|File|Header|IgnoreCacheControl|IgnoreHeaders|IgnoreNoLastMod|IgnoreQueryString|IgnoreURLSessionIdentifiers|KeyBaseURL|LastModifiedFactor|Lock|LockMaxAge|LockPath|MaxExpire|MaxFileSize|MinExpire|MinFileSize|NegotiatedDocs|QuickHandler|ReadSize|ReadTime|Root|Socache(?:MaxSize|MaxTime|MinTime|ReadSize|ReadTime)?|StaleOnError|StoreExpired|StoreNoStore|StorePrivate)|CharsetDefault|CharsetOptions|CharsetSourceEnc|CheckCaseOnly|CheckSpelling|ChrootDir|ContentDigest|CookieDomain|CookieExpires|CookieName|CookieStyle|CookieTracking|CoreDumpDirectory|CustomLog|DBDExptime|DBDInitSQL|DBDKeep|DBDMax|DBDMin|DBDParams|DBDPersist|DBDPrepareSQL|DBDriver|DTracePrivileges|Dav|DavDepthInfinity|DavGenericLockDB|DavLockDB|DavMinTimeout|DefaultIcon|DefaultLanguage|DefaultRuntimeDir|DefaultType|Define|Deflate(?:BufferSize|CompressionLevel|FilterNote|InflateLimitRequestBody|InflateRatio(?:Burst|Limit)|MemLevel|WindowSize)|Deny|DirectoryCheckHandler|DirectoryIndex|DirectoryIndexRedirect|DirectorySlash|DocumentRoot|DumpIOInput|DumpIOOutput|EnableExceptionHook|EnableMMAP|EnableSendfile|Error|ErrorDocument|ErrorLog|ErrorLogFormat|Example|ExpiresActive|ExpiresByType|ExpiresDefault|ExtFilterDefine|ExtFilterOptions|ExtendedStatus|FallbackResource|FileETag|FilterChain|FilterDeclare|FilterProtocol|FilterProvider|FilterTrace|ForceLanguagePriority|ForceType|ForensicLog|GprofDir|GracefulShutdownTimeout|Group|Header|HeaderName|Heartbeat(?:Address|Listen|MaxServers|Storage)|HostnameLookups|ISAPI(?:AppendLogToErrors|AppendLogToQuery|CacheFile|FakeAsync|LogNotSupported|ReadAheadBuffer)|IdentityCheck|IdentityCheckTimeout|ImapBase|ImapDefault|ImapMenu|Include|IncludeOptional|Index(?:HeadInsert|Ignore|IgnoreReset|Options|OrderDefault|StyleSheet)|InputSed|KeepAlive|KeepAliveTimeout|KeptBodySize|LDAP(?:CacheEntries|CacheTTL|ConnectionPoolTTL|ConnectionTimeout|LibraryDebug|OpCacheEntries|OpCacheTTL|ReferralHopLimit|Referrals|Retries|RetryDelay|SharedCacheFile|SharedCacheSize|Timeout|TrustedClientCert|TrustedGlobalCert|TrustedMode|VerifyServerCert)|LanguagePriority|Limit(?:InternalRecursion|Request(?:Body|FieldSize|Fields|Line)|XMLRequestBody)|Listen|ListenBackLog|LoadFile|LoadModule|LogFormat|LogLevel|LogMessage|LuaAuthzProvider|LuaCodeCache|Lua(?:Hook(?:AccessChecker|AuthChecker|CheckUserID|Fixups|InsertFilter|Log|MapToStorage|TranslateName|TypeChecker)|Inherit|InputFilter|MapHandler|OutputFilter|PackageCPath|PackagePath|QuickHandler|Root|Scope)|MMapFile|Max(?:ConnectionsPerChild|KeepAliveRequests|MemFree|RangeOverlaps|RangeReversals|Ranges|RequestWorkers|SpareServers|SpareThreads|Threads)|MergeTrailers|MetaDir|MetaFiles|MetaSuffix|MimeMagicFile|MinSpareServers|MinSpareThreads|ModMimeUsePathInfo|ModemStandard|MultiviewsMatch|Mutex|NWSSLTrustedCerts|NWSSLUpgradeable|NameVirtualHost|NoProxy|Options|Order|OutputSed|PassEnv|PidFile|PrivilegesMode|Protocol|ProtocolEcho|Proxy(?:AddHeaders|BadHeader|Block|Domain|ErrorOverride|ExpressDBMFile|ExpressDBMType|ExpressEnable|FtpDirCharset|FtpEscapeWildcards|FtpListOnWildcard|HTML(?:BufSize|CharsetOut|DocType|Enable|Events|Extended|Fixups|Interp|Links|Meta|StripComments|URLMap)|IOBufferSize|MaxForwards|Pass(?:Inherit|InterpolateEnv|Match|Reverse|ReverseCookieDomain|ReverseCookiePath)?|PreserveHost|ReceiveBufferSize|Remote|RemoteMatch|Requests|SCGIInternalRedirect|SCGISendfile|Set|SourceAddress|Status|Timeout|Via)|RLimitCPU|RLimitMEM|RLimitNPROC|ReadmeName|ReceiveBufferSize|Redirect|RedirectMatch|RedirectPermanent|RedirectTemp|ReflectorHeader|RemoteIP(?:Header|InternalProxy|InternalProxyList|ProxiesHeader|TrustedProxy|TrustedProxyList)|RemoveCharset|RemoveEncoding|RemoveHandler|RemoveInputFilter|RemoveLanguage|RemoveOutputFilter|RemoveType|RequestHeader|RequestReadTimeout|Require|Rewrite(?:Base|Cond|Engine|Map|Options|Rule)|SSIETag|SSIEndTag|SSIErrorMsg|SSILastModified|SSILegacyExprParser|SSIStartTag|SSITimeFormat|SSIUndefinedEcho|SSL(?:CACertificateFile|CACertificatePath|CADNRequestFile|CADNRequestPath|CARevocationCheck|CARevocationFile|CARevocationPath|CertificateChainFile|CertificateFile|CertificateKeyFile|CipherSuite|Compression|CryptoDevice|Engine|FIPS|HonorCipherOrder|InsecureRenegotiation|OCSP(?:DefaultResponder|Enable|OverrideResponder|ResponderTimeout|ResponseMaxAge|ResponseTimeSkew|UseRequestNonce)|OpenSSLConfCmd|Options|PassPhraseDialog|Protocol|Proxy(?:CACertificateFile|CACertificatePath|CARevocation(?:Check|File|Path)|CheckPeer(?:CN|Expire|Name)|CipherSuite|Engine|MachineCertificate(?:ChainFile|File|Path)|Protocol|Verify|VerifyDepth)|RandomSeed|RenegBufferSize|Require|RequireSSL|SRPUnknownUserSeed|SRPVerifierFile|Session(?:Cache|CacheTimeout|TicketKeyFile|Tickets)|Stapling(?:Cache|ErrorCacheTimeout|FakeTryLater|ForceURL|ResponderTimeout|ResponseMaxAge|ResponseTimeSkew|ReturnResponderErrors|StandardCacheTimeout)|StrictSNIVHostCheck|UseStapling|UserName|VerifyClient|VerifyDepth)|Satisfy|ScoreBoardFile|Script(?:Alias|AliasMatch|InterpreterSource|Log|LogBuffer|LogLength|Sock)?|SecureListen|SeeRequestTail|SendBufferSize|Server(?:Admin|Alias|Limit|Name|Path|Root|Signature|Tokens)|Session(?:Cookie(?:Name|Name2|Remove)|Crypto(?:Cipher|Driver|Passphrase|PassphraseFile)|DBD(?:CookieName|CookieName2|CookieRemove|DeleteLabel|InsertLabel|PerUser|SelectLabel|UpdateLabel)|Env|Exclude|Header|Include|MaxAge)?|SetEnv|SetEnvIf|SetEnvIfExpr|SetEnvIfNoCase|SetHandler|SetInputFilter|SetOutputFilter|StartServers|StartThreads|Substitute|Suexec|SuexecUserGroup|ThreadLimit|ThreadStackSize|ThreadsPerChild|TimeOut|TraceEnable|TransferLog|TypesConfig|UnDefine|UndefMacro|UnsetEnv|Use|UseCanonicalName|UseCanonicalPhysicalPort|User|UserDir|VHostCGIMode|VHostCGIPrivs|VHostGroup|VHostPrivs|VHostSecure|VHostUser|Virtual(?:DocumentRoot|ScriptAlias)(?:IP)?|WatchdogInterval|XBitHack|xml2EncAlias|xml2EncDefault|xml2StartParse)\b/im,lookbehind:!0,alias:"property"},"directive-block":{pattern:/<\/?\b(?:Auth[nz]ProviderAlias|Directory|DirectoryMatch|Else|ElseIf|Files|FilesMatch|If|IfDefine|IfModule|IfVersion|Limit|LimitExcept|Location|LocationMatch|Macro|Proxy|Require(?:All|Any|None)|VirtualHost)\b.*>/i,inside:{"directive-block":{pattern:/^<\/?\w+/,inside:{punctuation:/^<\/?/},alias:"tag"},"directive-block-parameter":{pattern:/.*[^>]/,inside:{punctuation:/:/,string:{pattern:/("|').*\1/,inside:{variable:/[$%]\{?(?:\w\.?[-+:]?)+\}?/}}},alias:"attr-value"},punctuation:/>/},alias:"tag"},"directive-flags":{pattern:/\[(?:[\w=],?)+\]/,alias:"keyword"},string:{pattern:/("|').*\1/,inside:{variable:/[$%]\{?(?:\w\.?[-+:]?)+\}?/}},variable:/[$%]\{?(?:\w\.?[-+:]?)+\}?/,regex:/\^?.*\$|\^.*\$?/}}e.exports=t,t.displayName="apacheconf",t.aliases=[]},10433(e,t,n){"use strict";var r=n(11114);function i(e){e.register(r),function(e){var t=/\b(?:abstract|activate|and|any|array|as|asc|autonomous|begin|bigdecimal|blob|boolean|break|bulk|by|byte|case|cast|catch|char|class|collect|commit|const|continue|currency|date|datetime|decimal|default|delete|desc|do|double|else|end|enum|exception|exit|export|extends|final|finally|float|for|from|global|goto|group|having|hint|if|implements|import|in|inner|insert|instanceof|int|integer|interface|into|join|like|limit|list|long|loop|map|merge|new|not|null|nulls|number|object|of|on|or|outer|override|package|parallel|pragma|private|protected|public|retrieve|return|rollback|select|set|short|sObject|sort|static|string|super|switch|synchronized|system|testmethod|then|this|throw|time|transaction|transient|trigger|try|undelete|update|upsert|using|virtual|void|webservice|when|where|while|get(?=\s*[{};])|(?:after|before)(?=\s+[a-z])|(?:inherited|with|without)\s+sharing)\b/i,n=/\b(?:(?=[a-z_]\w*\s*[<\[])|(?!))[A-Z_]\w*(?:\s*\.\s*[A-Z_]\w*)*\b(?:\s*(?:\[\s*\]|<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>))*/.source.replace(//g,function(){return t.source});function r(e){return RegExp(e.replace(//g,function(){return n}),"i")}var i={keyword:t,punctuation:/[()\[\]{};,:.<>]/};e.languages.apex={comment:e.languages.clike.comment,string:e.languages.clike.string,sql:{pattern:/((?:[=,({:]|\breturn)\s*)\[[^\[\]]*\]/i,lookbehind:!0,greedy:!0,alias:"language-sql",inside:e.languages.sql},annotation:{pattern:/@\w+\b/,alias:"punctuation"},"class-name":[{pattern:r(/(\b(?:class|enum|extends|implements|instanceof|interface|new|trigger\s+\w+\s+on)\s+)/.source),lookbehind:!0,inside:i},{pattern:r(/(\(\s*)(?=\s*\)\s*[\w(])/.source),lookbehind:!0,inside:i},{pattern:r(/(?=\s*\w+\s*[;=,(){:])/.source),inside:i}],trigger:{pattern:/(\btrigger\s+)\w+\b/i,lookbehind:!0,alias:"class-name"},keyword:t,function:/\b[a-z_]\w*(?=\s*\()/i,boolean:/\b(?:false|true)\b/i,number:/(?:\B\.\d+|\b\d+(?:\.\d+|L)?)\b/i,operator:/[!=](?:==?)?|\?\.?|&&|\|\||--|\+\+|[-+*/^&|]=?|:|<{1,3}=?/,punctuation:/[()\[\]{};,.]/}}(e)}e.exports=i,i.displayName="apex",i.aliases=[]},84039(e){"use strict";function t(e){e.languages.apl={comment:/(?:⍝|#[! ]).*$/m,string:{pattern:/'(?:[^'\r\n]|'')*'/,greedy:!0},number:/¯?(?:\d*\.?\b\d+(?:e[+¯]?\d+)?|¯|∞)(?:j¯?(?:(?:\d+(?:\.\d+)?|\.\d+)(?:e[+¯]?\d+)?|¯|∞))?/i,statement:/:[A-Z][a-z][A-Za-z]*\b/,"system-function":{pattern:/⎕[A-Z]+/i,alias:"function"},constant:/[⍬⌾#⎕⍞]/,function:/[-+×÷⌈⌊∣|⍳⍸?*⍟○!⌹<≤=>≥≠≡≢∊⍷∪∩~∨∧⍱⍲⍴,⍪⌽⊖⍉↑↓⊂⊃⊆⊇⌷⍋⍒⊤⊥⍕⍎⊣⊢⍁⍂≈⍯↗¤→]/,"monadic-operator":{pattern:/[\\\/⌿⍀¨⍨⌶&∥]/,alias:"operator"},"dyadic-operator":{pattern:/[.⍣⍠⍤∘⌸@⌺⍥]/,alias:"operator"},assignment:{pattern:/←/,alias:"keyword"},punctuation:/[\[;\]()◇⋄]/,dfn:{pattern:/[{}⍺⍵⍶⍹∇⍫:]/,alias:"builtin"}}}e.exports=t,t.displayName="apl",t.aliases=[]},71336(e){"use strict";function t(e){e.languages.applescript={comment:[/\(\*(?:\(\*(?:[^*]|\*(?!\)))*\*\)|(?!\(\*)[\s\S])*?\*\)/,/--.+/,/#.+/],string:/"(?:\\.|[^"\\\r\n])*"/,number:/(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e-?\d+)?\b/i,operator:[/[&=≠≤≥*+\-\/÷^]|[<>]=?/,/\b(?:(?:start|begin|end)s? with|(?:(?:does not|doesn't) contain|contains?)|(?:is|isn't|is not) (?:in|contained by)|(?:(?:is|isn't|is not) )?(?:greater|less) than(?: or equal)?(?: to)?|(?:(?:does not|doesn't) come|comes) (?:before|after)|(?:is|isn't|is not) equal(?: to)?|(?:(?:does not|doesn't) equal|equals|equal to|isn't|is not)|(?:a )?(?:ref(?: to)?|reference to)|(?:and|or|div|mod|as|not))\b/],keyword:/\b(?:about|above|after|against|apart from|around|aside from|at|back|before|beginning|behind|below|beneath|beside|between|but|by|considering|continue|copy|does|eighth|else|end|equal|error|every|exit|false|fifth|first|for|fourth|from|front|get|given|global|if|ignoring|in|instead of|into|is|it|its|last|local|me|middle|my|ninth|of|on|onto|out of|over|prop|property|put|repeat|return|returning|second|set|seventh|since|sixth|some|tell|tenth|that|the|then|third|through|thru|timeout|times|to|transaction|true|try|until|where|while|whose|with|without)\b/,class:{pattern:/\b(?:alias|application|boolean|class|constant|date|file|integer|list|number|POSIX file|real|record|reference|RGB color|script|text|centimetres|centimeters|feet|inches|kilometres|kilometers|metres|meters|miles|yards|square feet|square kilometres|square kilometers|square metres|square meters|square miles|square yards|cubic centimetres|cubic centimeters|cubic feet|cubic inches|cubic metres|cubic meters|cubic yards|gallons|litres|liters|quarts|grams|kilograms|ounces|pounds|degrees Celsius|degrees Fahrenheit|degrees Kelvin)\b/,alias:"builtin"},punctuation:/[{}():,¬«»《》]/}}e.exports=t,t.displayName="applescript",t.aliases=[]},4481(e){"use strict";function t(e){e.languages.aql={comment:/\/\/.*|\/\*[\s\S]*?\*\//,property:{pattern:/([{,]\s*)(?:(?!\d)\w+|(["'´`])(?:(?!\2)[^\\\r\n]|\\.)*\2)(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(["'´`])(?:(?!\1)[^\\\r\n]|\\.)*\1/,greedy:!0},variable:/@@?\w+/,keyword:[{pattern:/(\bWITH\s+)COUNT(?=\s+INTO\b)/i,lookbehind:!0},/\b(?:AGGREGATE|ALL|AND|ANY|ASC|COLLECT|DESC|DISTINCT|FILTER|FOR|GRAPH|IN|INBOUND|INSERT|INTO|K_PATHS|K_SHORTEST_PATHS|LET|LIKE|LIMIT|NONE|NOT|NULL|OR|OUTBOUND|REMOVE|REPLACE|RETURN|SHORTEST_PATH|SORT|UPDATE|UPSERT|WINDOW|WITH)\b/i,{pattern:/(^|[^\w.[])(?:KEEP|PRUNE|SEARCH|TO)\b/i,lookbehind:!0},{pattern:/(^|[^\w.[])(?:CURRENT|NEW|OLD)\b/,lookbehind:!0},{pattern:/\bOPTIONS(?=\s*\{)/i}],function:/\b(?!\d)\w+(?=\s*\()/,boolean:/\b(?:true|false)\b/i,range:{pattern:/\.\./,alias:"operator"},number:[/\b0b[01]+/i,/\b0x[0-9a-f]+/i,/(?:\B\.\d+|\b(?:0|[1-9]\d*)(?:\.\d+)?)(?:e[+-]?\d+)?/i],operator:/\*{2,}|[=!]~|[!=<>]=?|&&|\|\||[-+*/%]/,punctuation:/::|[?.:,;()[\]{}]/}}e.exports=t,t.displayName="aql",t.aliases=[]},2159(e,t,n){"use strict";var r=n(80096);function i(e){e.register(r),e.languages.arduino=e.languages.extend("cpp",{constant:/\b(?:DIGITAL_MESSAGE|FIRMATA_STRING|ANALOG_MESSAGE|REPORT_DIGITAL|REPORT_ANALOG|INPUT_PULLUP|SET_PIN_MODE|INTERNAL2V56|SYSTEM_RESET|LED_BUILTIN|INTERNAL1V1|SYSEX_START|INTERNAL|EXTERNAL|DEFAULT|OUTPUT|INPUT|HIGH|LOW)\b/,keyword:/\b(?:setup|if|else|while|do|for|return|in|instanceof|default|function|loop|goto|switch|case|new|try|throw|catch|finally|null|break|continue|boolean|bool|void|byte|word|string|String|array|int|long|integer|double)\b/,builtin:/\b(?:KeyboardController|MouseController|SoftwareSerial|EthernetServer|EthernetClient|LiquidCrystal|LiquidCrystal_I2C|RobotControl|GSMVoiceCall|EthernetUDP|EsploraTFT|HttpClient|RobotMotor|WiFiClient|GSMScanner|FileSystem|Scheduler|GSMServer|YunClient|YunServer|IPAddress|GSMClient|GSMModem|Keyboard|Ethernet|Console|GSMBand|Esplora|Stepper|Process|WiFiUDP|GSM_SMS|Mailbox|USBHost|Firmata|PImage|Client|Server|GSMPIN|FileIO|Bridge|Serial|EEPROM|Stream|Mouse|Audio|Servo|File|Task|GPRS|WiFi|Wire|TFT|GSM|SPI|SD|runShellCommandAsynchronously|analogWriteResolution|retrieveCallingNumber|printFirmwareVersion|analogReadResolution|sendDigitalPortPair|noListenOnLocalhost|readJoystickButton|setFirmwareVersion|readJoystickSwitch|scrollDisplayRight|getVoiceCallStatus|scrollDisplayLeft|writeMicroseconds|delayMicroseconds|beginTransmission|getSignalStrength|runAsynchronously|getAsynchronously|listenOnLocalhost|getCurrentCarrier|readAccelerometer|messageAvailable|sendDigitalPorts|lineFollowConfig|countryNameWrite|runShellCommand|readStringUntil|rewindDirectory|readTemperature|setClockDivider|readLightSensor|endTransmission|analogReference|detachInterrupt|countryNameRead|attachInterrupt|encryptionType|readBytesUntil|robotNameWrite|readMicrophone|robotNameRead|cityNameWrite|userNameWrite|readJoystickY|readJoystickX|mouseReleased|openNextFile|scanNetworks|noInterrupts|digitalWrite|beginSpeaker|mousePressed|isActionDone|mouseDragged|displayLogos|noAutoscroll|addParameter|remoteNumber|getModifiers|keyboardRead|userNameRead|waitContinue|processInput|parseCommand|printVersion|readNetworks|writeMessage|blinkVersion|cityNameRead|readMessage|setDataMode|parsePacket|isListening|setBitOrder|beginPacket|isDirectory|motorsWrite|drawCompass|digitalRead|clearScreen|serialEvent|rightToLeft|setTextSize|leftToRight|requestFrom|keyReleased|compassRead|analogWrite|interrupts|WiFiServer|disconnect|playMelody|parseFloat|autoscroll|getPINUsed|setPINUsed|setTimeout|sendAnalog|readSlider|analogRead|beginWrite|createChar|motorsStop|keyPressed|tempoWrite|readButton|subnetMask|debugPrint|macAddress|writeGreen|randomSeed|attachGPRS|readString|sendString|remotePort|releaseAll|mouseMoved|background|getXChange|getYChange|answerCall|getResult|voiceCall|endPacket|constrain|getSocket|writeJSON|getButton|available|connected|findUntil|readBytes|exitValue|readGreen|writeBlue|startLoop|isPressed|sendSysex|pauseMode|gatewayIP|setCursor|getOemKey|tuneWrite|noDisplay|loadImage|switchPIN|onRequest|onReceive|changePIN|playFile|noBuffer|parseInt|overflow|checkPIN|knobRead|beginTFT|bitClear|updateIR|bitWrite|position|writeRGB|highByte|writeRed|setSpeed|readBlue|noStroke|remoteIP|transfer|shutdown|hangCall|beginSMS|endWrite|attached|maintain|noCursor|checkReg|checkPUK|shiftOut|isValid|shiftIn|pulseIn|connect|println|localIP|pinMode|getIMEI|display|noBlink|process|getBand|running|beginSD|drawBMP|lowByte|setBand|release|bitRead|prepare|pointTo|readRed|setMode|noFill|remove|listen|stroke|detach|attach|noTone|exists|buffer|height|bitSet|circle|config|cursor|random|IRread|setDNS|endSMS|getKey|micros|millis|begin|print|write|ready|flush|width|isPIN|blink|clear|press|mkdir|rmdir|close|point|yield|image|BSSID|click|delay|read|text|move|peek|beep|rect|line|open|seek|fill|size|turn|stop|home|find|step|tone|sqrt|RSSI|SSID|end|bit|tan|cos|sin|pow|map|abs|max|min|get|run|put)\b/})}e.exports=i,i.displayName="arduino",i.aliases=[]},60274(e){"use strict";function t(e){e.languages.arff={comment:/%.*/,string:{pattern:/(["'])(?:\\.|(?!\1)[^\\\r\n])*\1/,greedy:!0},keyword:/@(?:attribute|data|end|relation)\b/i,number:/\b\d+(?:\.\d+)?\b/,punctuation:/[{},]/}}e.exports=t,t.displayName="arff",t.aliases=[]},18738(e){"use strict";function t(e){!function(e){var t={pattern:/(^[ \t]*)\[(?!\[)(?:(["'$`])(?:(?!\2)[^\\]|\\.)*\2|\[(?:[^\[\]\\]|\\.)*\]|[^\[\]\\"'$`]|\\.)*\]/m,lookbehind:!0,inside:{quoted:{pattern:/([$`])(?:(?!\1)[^\\]|\\.)*\1/,inside:{punctuation:/^[$`]|[$`]$/}},interpreted:{pattern:/'(?:[^'\\]|\\.)*'/,inside:{punctuation:/^'|'$/}},string:/"(?:[^"\\]|\\.)*"/,variable:/\w+(?==)/,punctuation:/^\[|\]$|,/,operator:/=/,"attr-value":/(?!^\s+$).+/}},n=e.languages.asciidoc={"comment-block":{pattern:/^(\/{4,})(?:\r?\n|\r)(?:[\s\S]*(?:\r?\n|\r))??\1/m,alias:"comment"},table:{pattern:/^\|={3,}(?:(?:\r?\n|\r(?!\n)).*)*?(?:\r?\n|\r)\|={3,}$/m,inside:{specifiers:{pattern:/(?!\|)(?:(?:(?:\d+(?:\.\d+)?|\.\d+)[+*])?(?:[<^>](?:\.[<^>])?|\.[<^>])?[a-z]*)(?=\|)/,alias:"attr-value"},punctuation:{pattern:/(^|[^\\])[|!]=*/,lookbehind:!0}}},"passthrough-block":{pattern:/^(\+{4,})(?:\r?\n|\r)(?:[\s\S]*(?:\r?\n|\r))??\1$/m,inside:{punctuation:/^\++|\++$/}},"literal-block":{pattern:/^(-{4,}|\.{4,})(?:\r?\n|\r)(?:[\s\S]*(?:\r?\n|\r))??\1$/m,inside:{punctuation:/^(?:-+|\.+)|(?:-+|\.+)$/}},"other-block":{pattern:/^(--|\*{4,}|_{4,}|={4,})(?:\r?\n|\r)(?:[\s\S]*(?:\r?\n|\r))??\1$/m,inside:{punctuation:/^(?:-+|\*+|_+|=+)|(?:-+|\*+|_+|=+)$/}},"list-punctuation":{pattern:/(^[ \t]*)(?:-|\*{1,5}|\.{1,5}|(?:[a-z]|\d+)\.|[xvi]+\))(?= )/im,lookbehind:!0,alias:"punctuation"},"list-label":{pattern:/(^[ \t]*)[a-z\d].+(?::{2,4}|;;)(?=\s)/im,lookbehind:!0,alias:"symbol"},"indented-block":{pattern:/((\r?\n|\r)\2)([ \t]+)\S.*(?:(?:\r?\n|\r)\3.+)*(?=\2{2}|$)/,lookbehind:!0},comment:/^\/\/.*/m,title:{pattern:/^.+(?:\r?\n|\r)(?:={3,}|-{3,}|~{3,}|\^{3,}|\+{3,})$|^={1,5} .+|^\.(?![\s.]).*/m,alias:"important",inside:{punctuation:/^(?:\.|=+)|(?:=+|-+|~+|\^+|\++)$/}},"attribute-entry":{pattern:/^:[^:\r\n]+:(?: .*?(?: \+(?:\r?\n|\r).*?)*)?$/m,alias:"tag"},attributes:t,hr:{pattern:/^'{3,}$/m,alias:"punctuation"},"page-break":{pattern:/^<{3,}$/m,alias:"punctuation"},admonition:{pattern:/^(?:TIP|NOTE|IMPORTANT|WARNING|CAUTION):/m,alias:"keyword"},callout:[{pattern:/(^[ \t]*)/m,lookbehind:!0,alias:"symbol"},{pattern:/<\d+>/,alias:"symbol"}],macro:{pattern:/\b[a-z\d][a-z\d-]*::?(?:[^\s\[\]]*\[(?:[^\]\\"']|(["'])(?:(?!\1)[^\\]|\\.)*\1|\\.)*\])/,inside:{function:/^[a-z\d-]+(?=:)/,punctuation:/^::?/,attributes:{pattern:/(?:\[(?:[^\]\\"']|(["'])(?:(?!\1)[^\\]|\\.)*\1|\\.)*\])/,inside:t.inside}}},inline:{pattern:/(^|[^\\])(?:(?:\B\[(?:[^\]\\"']|(["'])(?:(?!\2)[^\\]|\\.)*\2|\\.)*\])?(?:\b_(?!\s)(?: _|[^_\\\r\n]|\\.)+(?:(?:\r?\n|\r)(?: _|[^_\\\r\n]|\\.)+)*_\b|\B``(?!\s).+?(?:(?:\r?\n|\r).+?)*''\B|\B`(?!\s)(?:[^`'\s]|\s+\S)+['`]\B|\B(['*+#])(?!\s)(?: \3|(?!\3)[^\\\r\n]|\\.)+(?:(?:\r?\n|\r)(?: \3|(?!\3)[^\\\r\n]|\\.)+)*\3\B)|(?:\[(?:[^\]\\"']|(["'])(?:(?!\4)[^\\]|\\.)*\4|\\.)*\])?(?:(__|\*\*|\+\+\+?|##|\$\$|[~^]).+?(?:(?:\r?\n|\r).+?)*\5|\{[^}\r\n]+\}|\[\[\[?.+?(?:(?:\r?\n|\r).+?)*\]?\]\]|<<.+?(?:(?:\r?\n|\r).+?)*>>|\(\(\(?.+?(?:(?:\r?\n|\r).+?)*\)?\)\)))/m,lookbehind:!0,inside:{attributes:t,url:{pattern:/^(?:\[\[\[?.+?\]?\]\]|<<.+?>>)$/,inside:{punctuation:/^(?:\[\[\[?|<<)|(?:\]\]\]?|>>)$/}},"attribute-ref":{pattern:/^\{.+\}$/,inside:{variable:{pattern:/(^\{)[a-z\d,+_-]+/,lookbehind:!0},operator:/^[=?!#%@$]|!(?=[:}])/,punctuation:/^\{|\}$|::?/}},italic:{pattern:/^(['_])[\s\S]+\1$/,inside:{punctuation:/^(?:''?|__?)|(?:''?|__?)$/}},bold:{pattern:/^\*[\s\S]+\*$/,inside:{punctuation:/^\*\*?|\*\*?$/}},punctuation:/^(?:``?|\+{1,3}|##?|\$\$|[~^]|\(\(\(?)|(?:''?|\+{1,3}|##?|\$\$|[~^`]|\)?\)\))$/}},replacement:{pattern:/\((?:C|TM|R)\)/,alias:"builtin"},entity:/&#?[\da-z]{1,8};/i,"line-continuation":{pattern:/(^| )\+$/m,lookbehind:!0,alias:"punctuation"}};function r(e){e=e.split(" ");for(var t={},r=0,i=e.length;r/i,alias:"tag",inside:{"page-directive":{pattern:/<%\s*@\s*(?:Assembly|Control|Implements|Import|Master(?:Type)?|OutputCache|Page|PreviousPageType|Reference|Register)?|%>/i,alias:"tag"},rest:e.languages.markup.tag.inside}},directive:{pattern:/<%.*%>/i,alias:"tag",inside:{directive:{pattern:/<%\s*?[$=%#:]{0,2}|%>/i,alias:"tag"},rest:e.languages.csharp}}}),e.languages.aspnet.tag.pattern=/<(?!%)\/?[^\s>\/]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|[^\s'">=]+))?)*\s*\/?>/i,e.languages.insertBefore("inside","punctuation",{directive:e.languages.aspnet.directive},e.languages.aspnet.tag.inside["attr-value"]),e.languages.insertBefore("aspnet","comment",{"asp-comment":{pattern:/<%--[\s\S]*?--%>/,alias:["asp","comment"]}}),e.languages.insertBefore("aspnet",e.languages.javascript?"script":"tag",{"asp-script":{pattern:/(]*>)[\s\S]*?(?=<\/script>)/i,lookbehind:!0,alias:["asp","script"],inside:e.languages.csharp||{}}})}e.exports=i,i.displayName="aspnet",i.aliases=[]},6681(e){"use strict";function t(e){e.languages.autohotkey={comment:[{pattern:/(^|\s);.*/,lookbehind:!0},{pattern:/(^[\t ]*)\/\*(?:[\r\n](?![ \t]*\*\/)|[^\r\n])*(?:[\r\n][ \t]*\*\/)?/m,lookbehind:!0,greedy:!0}],tag:{pattern:/^([ \t]*)[^\s,`":]+(?=:[ \t]*$)/m,lookbehind:!0},string:/"(?:[^"\n\r]|"")*"/m,variable:/%\w+%/,number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/\?|\/\/?=?|:=|\|[=|]?|&[=&]?|\+[=+]?|-[=-]?|\*[=*]?|<(?:<=?|>|=)?|>>?=?|[.^!=~]=?|\b(?:AND|NOT|OR)\b/,boolean:/\b(?:true|false)\b/,selector:/\b(?:AutoTrim|BlockInput|Break|Click|ClipWait|Continue|Control|ControlClick|ControlFocus|ControlGet|ControlGetFocus|ControlGetPos|ControlGetText|ControlMove|ControlSend|ControlSendRaw|ControlSetText|CoordMode|Critical|DetectHiddenText|DetectHiddenWindows|Drive|DriveGet|DriveSpaceFree|EnvAdd|EnvDiv|EnvGet|EnvMult|EnvSet|EnvSub|EnvUpdate|Exit|ExitApp|FileAppend|FileCopy|FileCopyDir|FileCreateDir|FileCreateShortcut|FileDelete|FileEncoding|FileGetAttrib|FileGetShortcut|FileGetSize|FileGetTime|FileGetVersion|FileInstall|FileMove|FileMoveDir|FileRead|FileReadLine|FileRecycle|FileRecycleEmpty|FileRemoveDir|FileSelectFile|FileSelectFolder|FileSetAttrib|FileSetTime|FormatTime|GetKeyState|Gosub|Goto|GroupActivate|GroupAdd|GroupClose|GroupDeactivate|Gui|GuiControl|GuiControlGet|Hotkey|ImageSearch|IniDelete|IniRead|IniWrite|Input|InputBox|KeyWait|ListHotkeys|ListLines|ListVars|Loop|Menu|MouseClick|MouseClickDrag|MouseGetPos|MouseMove|MsgBox|OnExit|OutputDebug|Pause|PixelGetColor|PixelSearch|PostMessage|Process|Progress|Random|RegDelete|RegRead|RegWrite|Reload|Repeat|Return|Run|RunAs|RunWait|Send|SendEvent|SendInput|SendMessage|SendMode|SendPlay|SendRaw|SetBatchLines|SetCapslockState|SetControlDelay|SetDefaultMouseSpeed|SetEnv|SetFormat|SetKeyDelay|SetMouseDelay|SetNumlockState|SetRegView|SetScrollLockState|SetStoreCapslockMode|SetTimer|SetTitleMatchMode|SetWinDelay|SetWorkingDir|Shutdown|Sleep|Sort|SoundBeep|SoundGet|SoundGetWaveVolume|SoundPlay|SoundSet|SoundSetWaveVolume|SplashImage|SplashTextOff|SplashTextOn|SplitPath|StatusBarGetText|StatusBarWait|StringCaseSense|StringGetPos|StringLeft|StringLen|StringLower|StringMid|StringReplace|StringRight|StringSplit|StringTrimLeft|StringTrimRight|StringUpper|Suspend|SysGet|Thread|ToolTip|Transform|TrayTip|URLDownloadToFile|WinActivate|WinActivateBottom|WinClose|WinGet|WinGetActiveStats|WinGetActiveTitle|WinGetClass|WinGetPos|WinGetText|WinGetTitle|WinHide|WinKill|WinMaximize|WinMenuSelectItem|WinMinimize|WinMinimizeAll|WinMinimizeAllUndo|WinMove|WinRestore|WinSet|WinSetTitle|WinShow|WinWait|WinWaitActive|WinWaitClose|WinWaitNotActive)\b/i,constant:/\b(?:a_ahkpath|a_ahkversion|a_appdata|a_appdatacommon|a_autotrim|a_batchlines|a_caretx|a_carety|a_computername|a_controldelay|a_cursor|a_dd|a_ddd|a_dddd|a_defaultmousespeed|a_desktop|a_desktopcommon|a_detecthiddentext|a_detecthiddenwindows|a_endchar|a_eventinfo|a_exitreason|a_fileencoding|a_formatfloat|a_formatinteger|a_gui|a_guievent|a_guicontrol|a_guicontrolevent|a_guiheight|a_guiwidth|a_guix|a_guiy|a_hour|a_iconfile|a_iconhidden|a_iconnumber|a_icontip|a_index|a_ipaddress1|a_ipaddress2|a_ipaddress3|a_ipaddress4|a_is64bitos|a_isadmin|a_iscompiled|a_iscritical|a_ispaused|a_issuspended|a_isunicode|a_keydelay|a_language|a_lasterror|a_linefile|a_linenumber|a_loopfield|a_loopfileattrib|a_loopfiledir|a_loopfileext|a_loopfilefullpath|a_loopfilelongpath|a_loopfilename|a_loopfileshortname|a_loopfileshortpath|a_loopfilesize|a_loopfilesizekb|a_loopfilesizemb|a_loopfiletimeaccessed|a_loopfiletimecreated|a_loopfiletimemodified|a_loopreadline|a_loopregkey|a_loopregname|a_loopregsubkey|a_loopregtimemodified|a_loopregtype|a_mday|a_min|a_mm|a_mmm|a_mmmm|a_mon|a_mousedelay|a_msec|a_mydocuments|a_now|a_nowutc|a_numbatchlines|a_ostype|a_osversion|a_priorhotkey|a_priorkey|programfiles|a_programfiles|a_programs|a_programscommon|a_ptrsize|a_regview|a_screendpi|a_screenheight|a_screenwidth|a_scriptdir|a_scriptfullpath|a_scripthwnd|a_scriptname|a_sec|a_space|a_startmenu|a_startmenucommon|a_startup|a_startupcommon|a_stringcasesense|a_tab|a_temp|a_thisfunc|a_thishotkey|a_thislabel|a_thismenu|a_thismenuitem|a_thismenuitempos|a_tickcount|a_timeidle|a_timeidlephysical|a_timesincepriorhotkey|a_timesincethishotkey|a_titlematchmode|a_titlematchmodespeed|a_username|a_wday|a_windelay|a_windir|a_workingdir|a_yday|a_year|a_yweek|a_yyyy|clipboard|clipboardall|comspec|errorlevel)\b/i,builtin:/\b(?:abs|acos|asc|asin|atan|ceil|chr|class|comobjactive|comobjarray|comobjconnect|comobjcreate|comobjerror|comobjflags|comobjget|comobjquery|comobjtype|comobjvalue|cos|dllcall|exp|fileexist|Fileopen|floor|format|il_add|il_create|il_destroy|instr|substr|isfunc|islabel|IsObject|ln|log|lv_add|lv_delete|lv_deletecol|lv_getcount|lv_getnext|lv_gettext|lv_insert|lv_insertcol|lv_modify|lv_modifycol|lv_setimagelist|ltrim|rtrim|mod|onmessage|numget|numput|registercallback|regexmatch|regexreplace|round|sin|tan|sqrt|strlen|strreplace|sb_seticon|sb_setparts|sb_settext|strsplit|tv_add|tv_delete|tv_getchild|tv_getcount|tv_getnext|tv_get|tv_getparent|tv_getprev|tv_getselection|tv_gettext|tv_modify|varsetcapacity|winactive|winexist|__New|__Call|__Get|__Set)\b/i,symbol:/\b(?:alt|altdown|altup|appskey|backspace|browser_back|browser_favorites|browser_forward|browser_home|browser_refresh|browser_search|browser_stop|bs|capslock|ctrl|ctrlbreak|ctrldown|ctrlup|del|delete|down|end|enter|esc|escape|f1|f10|f11|f12|f13|f14|f15|f16|f17|f18|f19|f2|f20|f21|f22|f23|f24|f3|f4|f5|f6|f7|f8|f9|home|ins|insert|joy1|joy10|joy11|joy12|joy13|joy14|joy15|joy16|joy17|joy18|joy19|joy2|joy20|joy21|joy22|joy23|joy24|joy25|joy26|joy27|joy28|joy29|joy3|joy30|joy31|joy32|joy4|joy5|joy6|joy7|joy8|joy9|joyaxes|joybuttons|joyinfo|joyname|joypov|joyr|joyu|joyv|joyx|joyy|joyz|lalt|launch_app1|launch_app2|launch_mail|launch_media|lbutton|lcontrol|lctrl|left|lshift|lwin|lwindown|lwinup|mbutton|media_next|media_play_pause|media_prev|media_stop|numlock|numpad0|numpad1|numpad2|numpad3|numpad4|numpad5|numpad6|numpad7|numpad8|numpad9|numpadadd|numpadclear|numpaddel|numpaddiv|numpaddot|numpaddown|numpadend|numpadenter|numpadhome|numpadins|numpadleft|numpadmult|numpadpgdn|numpadpgup|numpadright|numpadsub|numpadup|pgdn|pgup|printscreen|ralt|rbutton|rcontrol|rctrl|right|rshift|rwin|rwindown|rwinup|scrolllock|shift|shiftdown|shiftup|space|tab|up|volume_down|volume_mute|volume_up|wheeldown|wheelleft|wheelright|wheelup|xbutton1|xbutton2)\b/i,important:/#\b(?:AllowSameLineComments|ClipboardTimeout|CommentFlag|DerefChar|ErrorStdOut|EscapeChar|HotkeyInterval|HotkeyModifierTimeout|Hotstring|If|IfTimeout|IfWinActive|IfWinExist|IfWinNotActive|IfWinNotExist|Include|IncludeAgain|InputLevel|InstallKeybdHook|InstallMouseHook|KeyHistory|MaxHotkeysPerInterval|MaxMem|MaxThreads|MaxThreadsBuffer|MaxThreadsPerHotkey|MenuMaskKey|NoEnv|NoTrayIcon|Persistent|SingleInstance|UseHook|Warn|WinActivateForce)\b/i,keyword:/\b(?:Abort|AboveNormal|Add|ahk_class|ahk_exe|ahk_group|ahk_id|ahk_pid|All|Alnum|Alpha|AltSubmit|AltTab|AltTabAndMenu|AltTabMenu|AltTabMenuDismiss|AlwaysOnTop|AutoSize|Background|BackgroundTrans|BelowNormal|between|BitAnd|BitNot|BitOr|BitShiftLeft|BitShiftRight|BitXOr|Bold|Border|Button|ByRef|Checkbox|Checked|CheckedGray|Choose|ChooseString|Close|Color|ComboBox|Contains|ControlList|Count|Date|DateTime|Days|DDL|Default|DeleteAll|Delimiter|Deref|Destroy|Digit|Disable|Disabled|DropDownList|Edit|Eject|Else|Enable|Enabled|Error|Exist|Expand|ExStyle|FileSystem|First|Flash|Float|FloatFast|Focus|Font|for|global|Grid|Group|GroupBox|GuiClose|GuiContextMenu|GuiDropFiles|GuiEscape|GuiSize|Hdr|Hidden|Hide|High|HKCC|HKCR|HKCU|HKEY_CLASSES_ROOT|HKEY_CURRENT_CONFIG|HKEY_CURRENT_USER|HKEY_LOCAL_MACHINE|HKEY_USERS|HKLM|HKU|Hours|HScroll|Icon|IconSmall|ID|IDLast|If|IfEqual|IfExist|IfGreater|IfGreaterOrEqual|IfInString|IfLess|IfLessOrEqual|IfMsgBox|IfNotEqual|IfNotExist|IfNotInString|IfWinActive|IfWinExist|IfWinNotActive|IfWinNotExist|Ignore|ImageList|in|Integer|IntegerFast|Interrupt|is|italic|Join|Label|LastFound|LastFoundExist|Limit|Lines|List|ListBox|ListView|local|Lock|Logoff|Low|Lower|Lowercase|MainWindow|Margin|Maximize|MaximizeBox|MaxSize|Minimize|MinimizeBox|MinMax|MinSize|Minutes|MonthCal|Mouse|Move|Multi|NA|No|NoActivate|NoDefault|NoHide|NoIcon|NoMainWindow|norm|Normal|NoSort|NoSortHdr|NoStandard|Not|NoTab|NoTimers|Number|Off|Ok|On|OwnDialogs|Owner|Parse|Password|Picture|Pixel|Pos|Pow|Priority|ProcessName|Radio|Range|Read|ReadOnly|Realtime|Redraw|REG_BINARY|REG_DWORD|REG_EXPAND_SZ|REG_MULTI_SZ|REG_SZ|Region|Relative|Rename|Report|Resize|Restore|Retry|RGB|Screen|Seconds|Section|Serial|SetLabel|ShiftAltTab|Show|Single|Slider|SortDesc|Standard|static|Status|StatusBar|StatusCD|strike|Style|Submit|SysMenu|Tab2|TabStop|Text|Theme|Tile|ToggleCheck|ToggleEnable|ToolWindow|Top|Topmost|TransColor|Transparent|Tray|TreeView|TryAgain|Throw|Try|Catch|Finally|Type|UnCheck|underline|Unicode|Unlock|Until|UpDown|Upper|Uppercase|UseErrorLevel|Vis|VisFirst|Visible|VScroll|Wait|WaitClose|WantCtrlA|WantF2|WantReturn|While|Wrap|Xdigit|xm|xp|xs|Yes|ym|yp|ys)\b/i,function:/[^(); \t,\n+*\-=?>:\\\/<&%\[\]]+(?=\()/m,punctuation:/[{}[\]():,]/}}e.exports=t,t.displayName="autohotkey",t.aliases=[]},53358(e){"use strict";function t(e){e.languages.autoit={comment:[/;.*/,{pattern:/(^[\t ]*)#(?:comments-start|cs)[\s\S]*?^[ \t]*#(?:comments-end|ce)/m,lookbehind:!0}],url:{pattern:/(^[\t ]*#include\s+)(?:<[^\r\n>]+>|"[^\r\n"]+")/m,lookbehind:!0},string:{pattern:/(["'])(?:\1\1|(?!\1)[^\r\n])*\1/,greedy:!0,inside:{variable:/([%$@])\w+\1/}},directive:{pattern:/(^[\t ]*)#\w+/m,lookbehind:!0,alias:"keyword"},function:/\b\w+(?=\()/,variable:/[$@]\w+/,keyword:/\b(?:Case|Const|Continue(?:Case|Loop)|Default|Dim|Do|Else(?:If)?|End(?:Func|If|Select|Switch|With)|Enum|Exit(?:Loop)?|For|Func|Global|If|In|Local|Next|Null|ReDim|Select|Static|Step|Switch|Then|To|Until|Volatile|WEnd|While|With)\b/i,number:/\b(?:0x[\da-f]+|\d+(?:\.\d+)?(?:e[+-]?\d+)?)\b/i,boolean:/\b(?:True|False)\b/i,operator:/<[=>]?|[-+*\/=&>]=?|[?^]|\b(?:And|Or|Not)\b/i,punctuation:/[\[\]().,:]/}}e.exports=t,t.displayName="autoit",t.aliases=[]},6979(e){"use strict";function t(e){!function(e){var t="\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b",n={pattern:/(^(["']?)\w+\2)[ \t]+\S.*/,lookbehind:!0,alias:"punctuation",inside:null},r={bash:n,environment:{pattern:RegExp("\\$"+t),alias:"constant"},variable:[{pattern:/\$?\(\([\s\S]+?\)\)/,greedy:!0,inside:{variable:[{pattern:/(^\$\(\([\s\S]+)\)\)/,lookbehind:!0},/^\$\(\(/],number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,punctuation:/\(\(?|\)\)?|,|;/}},{pattern:/\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,greedy:!0,inside:{variable:/^\$\(|^`|\)$|`$/}},{pattern:/\$\{[^}]+\}/,greedy:!0,inside:{operator:/:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,punctuation:/[\[\]]/,environment:{pattern:RegExp("(\\{)"+t),lookbehind:!0,alias:"constant"}}},/\$(?:\w+|[#?*!@$])/],entity:/\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|x[0-9a-fA-F]{1,2}|u[0-9a-fA-F]{4}|U[0-9a-fA-F]{8})/};e.languages.bash={shebang:{pattern:/^#!\s*\/.*/,alias:"important"},comment:{pattern:/(^|[^"{\\$])#.*/,lookbehind:!0},"function-name":[{pattern:/(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,lookbehind:!0,alias:"function"},{pattern:/\b[\w-]+(?=\s*\(\s*\)\s*\{)/,alias:"function"}],"for-or-select":{pattern:/(\b(?:for|select)\s+)\w+(?=\s+in\s)/,alias:"variable",lookbehind:!0},"assign-left":{pattern:/(^|[\s;|&]|[<>]\()\w+(?=\+?=)/,inside:{environment:{pattern:RegExp("(^|[\\s;|&]|[<>]\\()"+t),lookbehind:!0,alias:"constant"}},alias:"variable",lookbehind:!0},string:[{pattern:/((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,lookbehind:!0,greedy:!0,inside:r},{pattern:/((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,lookbehind:!0,greedy:!0,inside:{bash:n}},{pattern:/(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,lookbehind:!0,greedy:!0,inside:r},{pattern:/(^|[^$\\])'[^']*'/,lookbehind:!0,greedy:!0},{pattern:/\$'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,inside:{entity:r.entity}}],environment:{pattern:RegExp("\\$?"+t),alias:"constant"},variable:r.variable,function:{pattern:/(^|[\s;|&]|[<>]\()(?:add|apropos|apt|aptitude|apt-cache|apt-get|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,lookbehind:!0},keyword:{pattern:/(^|[\s;|&]|[<>]\()(?:if|then|else|elif|fi|for|while|in|case|esac|function|select|do|done|until)(?=$|[)\s;|&])/,lookbehind:!0},builtin:{pattern:/(^|[\s;|&]|[<>]\()(?:\.|:|break|cd|continue|eval|exec|exit|export|getopts|hash|pwd|readonly|return|shift|test|times|trap|umask|unset|alias|bind|builtin|caller|command|declare|echo|enable|help|let|local|logout|mapfile|printf|read|readarray|source|type|typeset|ulimit|unalias|set|shopt)(?=$|[)\s;|&])/,lookbehind:!0,alias:"class-name"},boolean:{pattern:/(^|[\s;|&]|[<>]\()(?:true|false)(?=$|[)\s;|&])/,lookbehind:!0},"file-descriptor":{pattern:/\B&\d\b/,alias:"important"},operator:{pattern:/\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,inside:{"file-descriptor":{pattern:/^\d/,alias:"important"}}},punctuation:/\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,number:{pattern:/(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,lookbehind:!0}},n.inside=e.languages.bash;for(var i=["comment","function-name","for-or-select","assign-left","string","environment","function","keyword","builtin","boolean","file-descriptor","operator","punctuation","number"],a=r.variable[1].inside,o=0;o?^\w +\-.])*"/i,greedy:!0},number:/(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:E[+-]?\d+)?/i,keyword:/\b(?:AS|BEEP|BLOAD|BSAVE|CALL(?: ABSOLUTE)?|CASE|CHAIN|CHDIR|CLEAR|CLOSE|CLS|COM|COMMON|CONST|DATA|DECLARE|DEF(?: FN| SEG|DBL|INT|LNG|SNG|STR)|DIM|DO|DOUBLE|ELSE|ELSEIF|END|ENVIRON|ERASE|ERROR|EXIT|FIELD|FILES|FOR|FUNCTION|GET|GOSUB|GOTO|IF|INPUT|INTEGER|IOCTL|KEY|KILL|LINE INPUT|LOCATE|LOCK|LONG|LOOP|LSET|MKDIR|NAME|NEXT|OFF|ON(?: COM| ERROR| KEY| TIMER)?|OPEN|OPTION BASE|OUT|POKE|PUT|READ|REDIM|REM|RESTORE|RESUME|RETURN|RMDIR|RSET|RUN|SHARED|SINGLE|SELECT CASE|SHELL|SLEEP|STATIC|STEP|STOP|STRING|SUB|SWAP|SYSTEM|THEN|TIMER|TO|TROFF|TRON|TYPE|UNLOCK|UNTIL|USING|VIEW PRINT|WAIT|WEND|WHILE|WRITE)(?:\$|\b)/i,function:/\b(?:ABS|ACCESS|ACOS|ANGLE|AREA|ARITHMETIC|ARRAY|ASIN|ASK|AT|ATN|BASE|BEGIN|BREAK|CAUSE|CEIL|CHR|CLIP|COLLATE|COLOR|CON|COS|COSH|COT|CSC|DATE|DATUM|DEBUG|DECIMAL|DEF|DEG|DEGREES|DELETE|DET|DEVICE|DISPLAY|DOT|ELAPSED|EPS|ERASABLE|EXLINE|EXP|EXTERNAL|EXTYPE|FILETYPE|FIXED|FP|GO|GRAPH|HANDLER|IDN|IMAGE|IN|INT|INTERNAL|IP|IS|KEYED|LBOUND|LCASE|LEFT|LEN|LENGTH|LET|LINE|LINES|LOG|LOG10|LOG2|LTRIM|MARGIN|MAT|MAX|MAXNUM|MID|MIN|MISSING|MOD|NATIVE|NUL|NUMERIC|OF|OPTION|ORD|ORGANIZATION|OUTIN|OUTPUT|PI|POINT|POINTER|POINTS|POS|PRINT|PROGRAM|PROMPT|RAD|RADIANS|RANDOMIZE|RECORD|RECSIZE|RECTYPE|RELATIVE|REMAINDER|REPEAT|REST|RETRY|REWRITE|RIGHT|RND|ROUND|RTRIM|SAME|SEC|SELECT|SEQUENTIAL|SET|SETTER|SGN|SIN|SINH|SIZE|SKIP|SQR|STANDARD|STATUS|STR|STREAM|STYLE|TAB|TAN|TANH|TEMPLATE|TEXT|THERE|TIME|TIMEOUT|TRACE|TRANSFORM|TRUNCATE|UBOUND|UCASE|USE|VAL|VARIABLE|VIEWPORT|WHEN|WINDOW|WITH|ZER|ZONEWIDTH)(?:\$|\b)/i,operator:/<[=>]?|>=?|[+\-*\/^=&]|\b(?:AND|EQV|IMP|NOT|OR|XOR)\b/i,punctuation:/[,;:()]/}}e.exports=t,t.displayName="basic",t.aliases=[]},94781(e){"use strict";function t(e){var t,n,r,i,a;n=/%%?[~:\w]+%?|!\S+!/,r={pattern:/\/[a-z?]+(?=[ :]|$):?|-[a-z]\b|--[a-z-]+\b/im,alias:"attr-name",inside:{punctuation:/:/}},i=/"(?:[\\"]"|[^"])*"(?!")/,a=/(?:\b|-)\d+\b/,(t=e).languages.batch={comment:[/^::.*/m,{pattern:/((?:^|[&(])[ \t]*)rem\b(?:[^^&)\r\n]|\^(?:\r\n|[\s\S]))*/im,lookbehind:!0}],label:{pattern:/^:.*/m,alias:"property"},command:[{pattern:/((?:^|[&(])[ \t]*)for(?: \/[a-z?](?:[ :](?:"[^"]*"|[^\s"/]\S*))?)* \S+ in \([^)]+\) do/im,lookbehind:!0,inside:{keyword:/^for\b|\b(?:in|do)\b/i,string:i,parameter:r,variable:n,number:a,punctuation:/[()',]/}},{pattern:/((?:^|[&(])[ \t]*)if(?: \/[a-z?](?:[ :](?:"[^"]*"|[^\s"/]\S*))?)* (?:not )?(?:cmdextversion \d+|defined \w+|errorlevel \d+|exist \S+|(?:"[^"]*"|(?!")(?:(?!==)\S)+)?(?:==| (?:equ|neq|lss|leq|gtr|geq) )(?:"[^"]*"|[^\s"]\S*))/im,lookbehind:!0,inside:{keyword:/^if\b|\b(?:not|cmdextversion|defined|errorlevel|exist)\b/i,string:i,parameter:r,variable:n,number:a,operator:/\^|==|\b(?:equ|neq|lss|leq|gtr|geq)\b/i}},{pattern:/((?:^|[&()])[ \t]*)else\b/im,lookbehind:!0,inside:{keyword:/^else\b/i}},{pattern:/((?:^|[&(])[ \t]*)set(?: \/[a-z](?:[ :](?:"[^"]*"|[^\s"/]\S*))?)* (?:[^^&)\r\n]|\^(?:\r\n|[\s\S]))*/im,lookbehind:!0,inside:{keyword:/^set\b/i,string:i,parameter:r,variable:[n,/\w+(?=(?:[*\/%+\-&^|]|<<|>>)?=)/],number:a,operator:/[*\/%+\-&^|]=?|<<=?|>>=?|[!~_=]/,punctuation:/[()',]/}},{pattern:/((?:^|[&(])[ \t]*@?)\w+\b(?:"(?:[\\"]"|[^"])*"(?!")|[^"^&)\r\n]|\^(?:\r\n|[\s\S]))*/im,lookbehind:!0,inside:{keyword:/^\w+\b/i,string:i,parameter:r,label:{pattern:/(^\s*):\S+/m,lookbehind:!0,alias:"property"},variable:n,number:a,operator:/\^/}}],operator:/[&@]/,punctuation:/[()']/}}e.exports=t,t.displayName="batch",t.aliases=[]},62260(e){"use strict";function t(e){e.languages.bbcode={tag:{pattern:/\[\/?[^\s=\]]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'"\]=]+))?(?:\s+[^\s=\]]+\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'"\]=]+))*\s*\]/,inside:{tag:{pattern:/^\[\/?[^\s=\]]+/,inside:{punctuation:/^\[\/?/}},"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'"\]=]+)/i,inside:{punctuation:[/^=/,{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\]/,"attr-name":/[^\s=\]]+/}}},e.languages.shortcode=e.languages.bbcode}e.exports=t,t.displayName="bbcode",t.aliases=["shortcode"]},59258(e){"use strict";function t(e){e.languages.birb=e.languages.extend("clike",{string:{pattern:/r?("|')(?:\\.|(?!\1)[^\\])*\1/,greedy:!0},"class-name":[/\b[A-Z](?:[\d_]*[a-zA-Z]\w*)?\b/,/\b[A-Z]\w*(?=\s+\w+\s*[;,=()])/],keyword:/\b(?:assert|break|case|class|const|default|else|enum|final|follows|for|grab|if|nest|next|new|noSeeb|return|static|switch|throw|var|void|while)\b/,operator:/\+\+|--|&&|\|\||<<=?|>>=?|~(?:\/=?)?|[+\-*\/%&^|=!<>]=?|\?|:/,variable:/\b[a-z_]\w*\b/}),e.languages.insertBefore("birb","function",{metadata:{pattern:/<\w+>/,greedy:!0,alias:"symbol"}})}e.exports=t,t.displayName="birb",t.aliases=[]},62890(e,t,n){"use strict";var r=n(65806);function i(e){e.register(r),e.languages.bison=e.languages.extend("c",{}),e.languages.insertBefore("bison","comment",{bison:{pattern:/^(?:[^%]|%(?!%))*%%[\s\S]*?%%/,inside:{c:{pattern:/%\{[\s\S]*?%\}|\{(?:\{[^}]*\}|[^{}])*\}/,inside:{delimiter:{pattern:/^%?\{|%?\}$/,alias:"punctuation"},"bison-variable":{pattern:/[$@](?:<[^\s>]+>)?[\w$]+/,alias:"variable",inside:{punctuation:/<|>/}},rest:e.languages.c}},comment:e.languages.c.comment,string:e.languages.c.string,property:/\S+(?=:)/,keyword:/%\w+/,number:{pattern:/(^|[^@])\b(?:0x[\da-f]+|\d+)/i,lookbehind:!0},punctuation:/%[%?]|[|:;\[\]<>]/}}})}e.exports=i,i.displayName="bison",i.aliases=[]},15958(e){"use strict";function t(e){e.languages.bnf={string:{pattern:/"[^\r\n"]*"|'[^\r\n']*'/},definition:{pattern:/<[^<>\r\n\t]+>(?=\s*::=)/,alias:["rule","keyword"],inside:{punctuation:/^<|>$/}},rule:{pattern:/<[^<>\r\n\t]+>/,inside:{punctuation:/^<|>$/}},operator:/::=|[|()[\]{}*+?]|\.{3}/},e.languages.rbnf=e.languages.bnf}e.exports=t,t.displayName="bnf",t.aliases=["rbnf"]},61321(e){"use strict";function t(e){e.languages.brainfuck={pointer:{pattern:/<|>/,alias:"keyword"},increment:{pattern:/\+/,alias:"inserted"},decrement:{pattern:/-/,alias:"deleted"},branching:{pattern:/\[|\]/,alias:"important"},operator:/[.,]/,comment:/\S+/}}e.exports=t,t.displayName="brainfuck",t.aliases=[]},77856(e){"use strict";function t(e){e.languages.brightscript={comment:/(?:\brem|').*/i,"directive-statement":{pattern:/(^[\t ]*)#(?:const|else(?:[\t ]+if)?|end[\t ]+if|error|if).*/im,lookbehind:!0,alias:"property",inside:{"error-message":{pattern:/(^#error).+/,lookbehind:!0},directive:{pattern:/^#(?:const|else(?:[\t ]+if)?|end[\t ]+if|error|if)/,alias:"keyword"},expression:{pattern:/[\s\S]+/,inside:null}}},property:{pattern:/([\r\n{,][\t ]*)(?:(?!\d)\w+|"(?:[^"\r\n]|"")*"(?!"))(?=[ \t]*:)/,lookbehind:!0,greedy:!0},string:{pattern:/"(?:[^"\r\n]|"")*"(?!")/,greedy:!0},"class-name":{pattern:/(\bAs[\t ]+)\w+/i,lookbehind:!0},keyword:/\b(?:As|Dim|Each|Else|Elseif|End|Exit|For|Function|Goto|If|In|Print|Return|Step|Stop|Sub|Then|To|While)\b/i,boolean:/\b(?:true|false)\b/i,function:/\b(?!\d)\w+(?=[\t ]*\()/i,number:/(?:\b\d+(?:\.\d+)?(?:[ed][+-]\d+)?|&h[a-f\d]+)\b[%&!#]?/i,operator:/--|\+\+|>>=?|<<=?|<>|[-+*/\\<>]=?|[:^=?]|\b(?:and|mod|not|or)\b/i,punctuation:/[.,;()[\]{}]/,constant:/\b(?:LINE_NUM)\b/i},e.languages.brightscript["directive-statement"].inside.expression.inside=e.languages.brightscript}e.exports=t,t.displayName="brightscript",t.aliases=[]},90741(e){"use strict";function t(e){e.languages.bro={comment:{pattern:/(^|[^\\$])#.*/,lookbehind:!0,inside:{italic:/\b(?:TODO|FIXME|XXX)\b/}},string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},boolean:/\b[TF]\b/,function:{pattern:/(?:function|hook|event) \w+(?:::\w+)?/,inside:{keyword:/^(?:function|hook|event)/}},variable:{pattern:/(?:global|local) \w+/i,inside:{keyword:/(?:global|local)/}},builtin:/(?:@(?:load(?:-(?:sigs|plugin))?|unload|prefixes|ifn?def|else|(?:end)?if|DIR|FILENAME))|(?:&?(?:redef|priority|log|optional|default|add_func|delete_func|expire_func|read_expire|write_expire|create_expire|synchronized|persistent|rotate_interval|rotate_size|encrypt|raw_output|mergeable|group|error_handler|type_column))/,constant:{pattern:/const \w+/i,inside:{keyword:/const/}},keyword:/\b(?:break|next|continue|alarm|using|of|add|delete|export|print|return|schedule|when|timeout|addr|any|bool|count|double|enum|file|int|interval|pattern|opaque|port|record|set|string|subnet|table|time|vector|for|if|else|in|module|function)\b/,operator:/--?|\+\+?|!=?=?|<=?|>=?|==?=?|&&|\|\|?|\?|\*|\/|~|\^|%/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,punctuation:/[{}[\];(),.:]/}}e.exports=t,t.displayName="bro",t.aliases=[]},83410(e){"use strict";function t(e){e.languages.bsl={comment:/\/\/.*/,string:[{pattern:/"(?:[^"]|"")*"(?!")/,greedy:!0},{pattern:/'(?:[^'\r\n\\]|\\.)*'/}],keyword:[{pattern:/(^|[^\w\u0400-\u0484\u0487-\u052f\u1d2b\u1d78\u2de0-\u2dff\ua640-\ua69f\ufe2e\ufe2f])(?:пока|для|новый|прервать|попытка|исключение|вызватьисключение|иначе|конецпопытки|неопределено|функция|перем|возврат|конецфункции|если|иначеесли|процедура|конецпроцедуры|тогда|знач|экспорт|конецесли|из|каждого|истина|ложь|по|цикл|конеццикла|выполнить)(?![\w\u0400-\u0484\u0487-\u052f\u1d2b\u1d78\u2de0-\u2dff\ua640-\ua69f\ufe2e\ufe2f])/i,lookbehind:!0},{pattern:/\b(?:while|for|new|break|try|except|raise|else|endtry|undefined|function|var|return|endfunction|null|if|elseif|procedure|endprocedure|then|val|export|endif|in|each|true|false|to|do|enddo|execute)\b/i}],number:{pattern:/(^(?=\d)|[^\w\u0400-\u0484\u0487-\u052f\u1d2b\u1d78\u2de0-\u2dff\ua640-\ua69f\ufe2e\ufe2f])(?:\d+(?:\.\d*)?|\.\d+)(?:E[+-]?\d+)?/i,lookbehind:!0},operator:[/[<>+\-*/]=?|[%=]/,{pattern:/(^|[^\w\u0400-\u0484\u0487-\u052f\u1d2b\u1d78\u2de0-\u2dff\ua640-\ua69f\ufe2e\ufe2f])(?:и|или|не)(?![\w\u0400-\u0484\u0487-\u052f\u1d2b\u1d78\u2de0-\u2dff\ua640-\ua69f\ufe2e\ufe2f])/i,lookbehind:!0},{pattern:/\b(?:and|or|not)\b/i}],punctuation:/\(\.|\.\)|[()\[\]:;,.]/,directive:[{pattern:/^(\s*)&.*/m,lookbehind:!0,alias:"important"},{pattern:/^\s*#.*/gm,alias:"important"}]},e.languages.oscript=e.languages.bsl}e.exports=t,t.displayName="bsl",t.aliases=[]},65806(e){"use strict";function t(e){e.languages.c=e.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:__attribute__|_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|asm|typeof|inline|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),e.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},e.languages.c.string],comment:e.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:e.languages.c}}},constant:/\b(?:__FILE__|__LINE__|__DATE__|__TIME__|__TIMESTAMP__|__func__|EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|stdin|stdout|stderr)\b/}),delete e.languages.c.boolean}e.exports=t,t.displayName="c",t.aliases=[]},33039(e){"use strict";function t(e){e.languages.cfscript=e.languages.extend("clike",{comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,inside:{annotation:{pattern:/(?:^|[^.])@[\w\.]+/,alias:"punctuation"}}},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],keyword:/\b(?:abstract|break|catch|component|continue|default|do|else|extends|final|finally|for|function|if|in|include|package|private|property|public|remote|required|rethrow|return|static|switch|throw|try|var|while|xml)\b(?!\s*=)/,operator:[/\+\+|--|&&|\|\||::|=>|[!=]==|<=?|>=?|[-+*/%&|^!=<>]=?|\?(?:\.|:)?|[?:]/,/\b(?:and|contains|eq|equal|eqv|gt|gte|imp|is|lt|lte|mod|not|or|xor)\b/],scope:{pattern:/\b(?:application|arguments|cgi|client|cookie|local|session|super|this|variables)\b/,alias:"global"},type:{pattern:/\b(?:any|array|binary|boolean|date|guid|numeric|query|string|struct|uuid|void|xml)\b/,alias:"builtin"}}),e.languages.insertBefore("cfscript","keyword",{"function-variable":{pattern:/[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"}}),delete e.languages.cfscript["class-name"],e.languages.cfc=e.languages.cfscript}e.exports=t,t.displayName="cfscript",t.aliases=[]},85082(e,t,n){"use strict";var r=n(80096);function i(e){e.register(r),e.languages.chaiscript=e.languages.extend("clike",{string:{pattern:/(^|[^\\])'(?:[^'\\]|\\[\s\S])*'/,lookbehind:!0,greedy:!0},"class-name":[{pattern:/(\bclass\s+)\w+/,lookbehind:!0},{pattern:/(\b(?:attr|def)\s+)\w+(?=\s*::)/,lookbehind:!0}],keyword:/\b(?:attr|auto|break|case|catch|class|continue|def|default|else|finally|for|fun|global|if|return|switch|this|try|var|while)\b/,number:[e.languages.cpp.number,/\b(?:Infinity|NaN)\b/],operator:/>>=?|<<=?|\|\||&&|:[:=]?|--|\+\+|[=!<>+\-*/%|&^]=?|[?~]|`[^`\r\n]{1,4}`/}),e.languages.insertBefore("chaiscript","operator",{"parameter-type":{pattern:/([,(]\s*)\w+(?=\s+\w)/,lookbehind:!0,alias:"class-name"}}),e.languages.insertBefore("chaiscript","string",{"string-interpolation":{pattern:/(^|[^\\])"(?:[^"$\\]|\\[\s\S]|\$(?!\{)|\$\{(?:[^{}]|\{(?:[^{}]|\{[^{}]*\})*\})*\})*"/,lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^{}]*\})*\})*\}/,lookbehind:!0,inside:{"interpolation-expression":{pattern:/(^\$\{)[\s\S]+(?=\}$)/,lookbehind:!0,inside:e.languages.chaiscript},"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"}}},string:/[\s\S]+/}}})}e.exports=i,i.displayName="chaiscript",i.aliases=[]},79415(e){"use strict";function t(e){e.languages.cil={comment:/\/\/.*/,string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},directive:{pattern:/(^|\W)\.[a-z]+(?=\s)/,lookbehind:!0,alias:"class-name"},variable:/\[[\w\.]+\]/,keyword:/\b(?:abstract|ansi|assembly|auto|autochar|beforefieldinit|bool|bstr|byvalstr|catch|char|cil|class|currency|date|decimal|default|enum|error|explicit|extends|extern|famandassem|family|famorassem|final(?:ly)?|float32|float64|hidebysig|iant|idispatch|implements|import|initonly|instance|u?int(?:8|16|32|64)?|interface|iunknown|literal|lpstr|lpstruct|lptstr|lpwstr|managed|method|native(?:Type)?|nested|newslot|object(?:ref)?|pinvokeimpl|private|privatescope|public|reqsecobj|rtspecialname|runtime|sealed|sequential|serializable|specialname|static|string|struct|syschar|tbstr|unicode|unmanagedexp|unsigned|value(?:type)?|variant|virtual|void)\b/,function:/\b(?:(?:constrained|unaligned|volatile|readonly|tail|no)\.)?(?:conv\.(?:[iu][1248]?|ovf\.[iu][1248]?(?:\.un)?|r\.un|r4|r8)|ldc\.(?:i4(?:\.[0-9]+|\.[mM]1|\.s)?|i8|r4|r8)|ldelem(?:\.[iu][1248]?|\.r[48]|\.ref|a)?|ldind\.(?:[iu][1248]?|r[48]|ref)|stelem\.?(?:i[1248]?|r[48]|ref)?|stind\.(?:i[1248]?|r[48]|ref)?|end(?:fault|filter|finally)|ldarg(?:\.[0-3s]|a(?:\.s)?)?|ldloc(?:\.[0-9]+|\.s)?|sub(?:\.ovf(?:\.un)?)?|mul(?:\.ovf(?:\.un)?)?|add(?:\.ovf(?:\.un)?)?|stloc(?:\.[0-3s])?|refany(?:type|val)|blt(?:\.un)?(?:\.s)?|ble(?:\.un)?(?:\.s)?|bgt(?:\.un)?(?:\.s)?|bge(?:\.un)?(?:\.s)?|unbox(?:\.any)?|init(?:blk|obj)|call(?:i|virt)?|brfalse(?:\.s)?|bne\.un(?:\.s)?|ldloca(?:\.s)?|brzero(?:\.s)?|brtrue(?:\.s)?|brnull(?:\.s)?|brinst(?:\.s)?|starg(?:\.s)?|leave(?:\.s)?|shr(?:\.un)?|rem(?:\.un)?|div(?:\.un)?|clt(?:\.un)?|alignment|ldvirtftn|castclass|beq(?:\.s)?|mkrefany|localloc|ckfinite|rethrow|ldtoken|ldsflda|cgt\.un|arglist|switch|stsfld|sizeof|newobj|newarr|ldsfld|ldnull|ldflda|isinst|throw|stobj|stfld|ldstr|ldobj|ldlen|ldftn|ldfld|cpobj|cpblk|break|br\.s|xor|shl|ret|pop|not|nop|neg|jmp|dup|cgt|ceq|box|and|or|br)\b/,boolean:/\b(?:true|false)\b/,number:/\b-?(?:0x[0-9a-f]+|[0-9]+)(?:\.[0-9a-f]+)?\b/i,punctuation:/[{}[\];(),:=]|IL_[0-9A-Za-z]+/}}e.exports=t,t.displayName="cil",t.aliases=[]},29726(e){"use strict";function t(e){e.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|interface|extends|implements|trait|instanceof|new)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/,boolean:/\b(?:true|false)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/}}e.exports=t,t.displayName="clike",t.aliases=[]},62849(e){"use strict";function t(e){e.languages.clojure={comment:/;.*/,string:{pattern:/"(?:[^"\\]|\\.)*"/,greedy:!0},operator:/(?:::|[:|'])\b[a-z][\w*+!?-]*\b/i,keyword:{pattern:/([^\w+*'?-])(?:def|if|do|let|\.\.|quote|var|->>|->|fn|loop|recur|throw|try|monitor-enter|\.|new|set!|def-|defn|defn-|defmacro|defmulti|defmethod|defstruct|defonce|declare|definline|definterface|defprotocol|==|defrecord|>=|deftype|<=|defproject|ns|\*|\+|-|\/|<|=|>|accessor|agent|agent-errors|aget|alength|all-ns|alter|and|append-child|apply|array-map|aset|aset-boolean|aset-byte|aset-char|aset-double|aset-float|aset-int|aset-long|aset-short|assert|assoc|await|await-for|bean|binding|bit-and|bit-not|bit-or|bit-shift-left|bit-shift-right|bit-xor|boolean|branch\?|butlast|byte|cast|char|children|class|clear-agent-errors|comment|commute|comp|comparator|complement|concat|conj|cons|constantly|cond|if-not|construct-proxy|contains\?|count|create-ns|create-struct|cycle|dec|deref|difference|disj|dissoc|distinct|doall|doc|dorun|doseq|dosync|dotimes|doto|double|down|drop|drop-while|edit|end\?|ensure|eval|every\?|false\?|ffirst|file-seq|filter|find|find-doc|find-ns|find-var|first|float|flush|for|fnseq|frest|gensym|get-proxy-class|get|hash-map|hash-set|identical\?|identity|if-let|import|in-ns|inc|index|insert-child|insert-left|insert-right|inspect-table|inspect-tree|instance\?|int|interleave|intersection|into|into-array|iterate|join|key|keys|keyword|keyword\?|last|lazy-cat|lazy-cons|left|lefts|line-seq|list\*|list|load|load-file|locking|long|macroexpand|macroexpand-1|make-array|make-node|map|map-invert|map\?|mapcat|max|max-key|memfn|merge|merge-with|meta|min|min-key|name|namespace|neg\?|newline|next|nil\?|node|not|not-any\?|not-every\?|not=|ns-imports|ns-interns|ns-map|ns-name|ns-publics|ns-refers|ns-resolve|ns-unmap|nth|nthrest|or|parse|partial|path|peek|pop|pos\?|pr|pr-str|print|print-str|println|println-str|prn|prn-str|project|proxy|proxy-mappings|quot|rand|rand-int|range|re-find|re-groups|re-matcher|re-matches|re-pattern|re-seq|read|read-line|reduce|ref|ref-set|refer|rem|remove|remove-method|remove-ns|rename|rename-keys|repeat|replace|replicate|resolve|rest|resultset-seq|reverse|rfirst|right|rights|root|rrest|rseq|second|select|select-keys|send|send-off|seq|seq-zip|seq\?|set|short|slurp|some|sort|sort-by|sorted-map|sorted-map-by|sorted-set|special-symbol\?|split-at|split-with|str|string\?|struct|struct-map|subs|subvec|symbol|symbol\?|sync|take|take-nth|take-while|test|time|to-array|to-array-2d|tree-seq|true\?|union|up|update-proxy|val|vals|var-get|var-set|var\?|vector|vector-zip|vector\?|when|when-first|when-let|when-not|with-local-vars|with-meta|with-open|with-out-str|xml-seq|xml-zip|zero\?|zipmap|zipper)(?=[^\w+*'?-])/,lookbehind:!0},boolean:/\b(?:true|false|nil)\b/,number:/\b[\da-f]+\b/i,punctuation:/[{}\[\](),]/}}e.exports=t,t.displayName="clojure",t.aliases=[]},55773(e){"use strict";function t(e){e.languages.cmake={comment:/#.*/,string:{pattern:/"(?:[^\\"]|\\.)*"/,greedy:!0,inside:{interpolation:{pattern:/\$\{(?:[^{}$]|\$\{[^{}$]*\})*\}/,inside:{punctuation:/\$\{|\}/,variable:/\w+/}}}},variable:/\b(?:CMAKE_\w+|\w+_(?:VERSION(?:_MAJOR|_MINOR|_PATCH|_TWEAK)?|(?:BINARY|SOURCE)_DIR|DESCRIPTION|HOMEPAGE_URL|ROOT)|(?:ANDROID|APPLE|BORLAND|BUILD_SHARED_LIBS|CACHE|CPACK_(?:ABSOLUTE_DESTINATION_FILES|COMPONENT_INCLUDE_TOPLEVEL_DIRECTORY|ERROR_ON_ABSOLUTE_INSTALL_DESTINATION|INCLUDE_TOPLEVEL_DIRECTORY|INSTALL_DEFAULT_DIRECTORY_PERMISSIONS|INSTALL_SCRIPT|PACKAGING_INSTALL_PREFIX|SET_DESTDIR|WARN_ON_ABSOLUTE_INSTALL_DESTINATION)|CTEST_(?:BINARY_DIRECTORY|BUILD_COMMAND|BUILD_NAME|BZR_COMMAND|BZR_UPDATE_OPTIONS|CHANGE_ID|CHECKOUT_COMMAND|CONFIGURATION_TYPE|CONFIGURE_COMMAND|COVERAGE_COMMAND|COVERAGE_EXTRA_FLAGS|CURL_OPTIONS|CUSTOM_(?:COVERAGE_EXCLUDE|ERROR_EXCEPTION|ERROR_MATCH|ERROR_POST_CONTEXT|ERROR_PRE_CONTEXT|MAXIMUM_FAILED_TEST_OUTPUT_SIZE|MAXIMUM_NUMBER_OF_(?:ERRORS|WARNINGS)|MAXIMUM_PASSED_TEST_OUTPUT_SIZE|MEMCHECK_IGNORE|POST_MEMCHECK|POST_TEST|PRE_MEMCHECK|PRE_TEST|TESTS_IGNORE|WARNING_EXCEPTION|WARNING_MATCH)|CVS_CHECKOUT|CVS_COMMAND|CVS_UPDATE_OPTIONS|DROP_LOCATION|DROP_METHOD|DROP_SITE|DROP_SITE_CDASH|DROP_SITE_PASSWORD|DROP_SITE_USER|EXTRA_COVERAGE_GLOB|GIT_COMMAND|GIT_INIT_SUBMODULES|GIT_UPDATE_CUSTOM|GIT_UPDATE_OPTIONS|HG_COMMAND|HG_UPDATE_OPTIONS|LABELS_FOR_SUBPROJECTS|MEMORYCHECK_(?:COMMAND|COMMAND_OPTIONS|SANITIZER_OPTIONS|SUPPRESSIONS_FILE|TYPE)|NIGHTLY_START_TIME|P4_CLIENT|P4_COMMAND|P4_OPTIONS|P4_UPDATE_OPTIONS|RUN_CURRENT_SCRIPT|SCP_COMMAND|SITE|SOURCE_DIRECTORY|SUBMIT_URL|SVN_COMMAND|SVN_OPTIONS|SVN_UPDATE_OPTIONS|TEST_LOAD|TEST_TIMEOUT|TRIGGER_SITE|UPDATE_COMMAND|UPDATE_OPTIONS|UPDATE_VERSION_ONLY|USE_LAUNCHERS)|CYGWIN|ENV|EXECUTABLE_OUTPUT_PATH|GHS-MULTI|IOS|LIBRARY_OUTPUT_PATH|MINGW|MSVC(?:10|11|12|14|60|70|71|80|90|_IDE|_TOOLSET_VERSION|_VERSION)?|MSYS|PROJECT_(?:BINARY_DIR|DESCRIPTION|HOMEPAGE_URL|NAME|SOURCE_DIR|VERSION|VERSION_(?:MAJOR|MINOR|PATCH|TWEAK))|UNIX|WIN32|WINCE|WINDOWS_PHONE|WINDOWS_STORE|XCODE|XCODE_VERSION))\b/,property:/\b(?:cxx_\w+|(?:ARCHIVE_OUTPUT_(?:DIRECTORY|NAME)|COMPILE_DEFINITIONS|COMPILE_PDB_NAME|COMPILE_PDB_OUTPUT_DIRECTORY|EXCLUDE_FROM_DEFAULT_BUILD|IMPORTED_(?:IMPLIB|LIBNAME|LINK_DEPENDENT_LIBRARIES|LINK_INTERFACE_LANGUAGES|LINK_INTERFACE_LIBRARIES|LINK_INTERFACE_MULTIPLICITY|LOCATION|NO_SONAME|OBJECTS|SONAME)|INTERPROCEDURAL_OPTIMIZATION|LIBRARY_OUTPUT_DIRECTORY|LIBRARY_OUTPUT_NAME|LINK_FLAGS|LINK_INTERFACE_LIBRARIES|LINK_INTERFACE_MULTIPLICITY|LOCATION|MAP_IMPORTED_CONFIG|OSX_ARCHITECTURES|OUTPUT_NAME|PDB_NAME|PDB_OUTPUT_DIRECTORY|RUNTIME_OUTPUT_DIRECTORY|RUNTIME_OUTPUT_NAME|STATIC_LIBRARY_FLAGS|VS_CSHARP|VS_DOTNET_REFERENCEPROP|VS_DOTNET_REFERENCE|VS_GLOBAL_SECTION_POST|VS_GLOBAL_SECTION_PRE|VS_GLOBAL|XCODE_ATTRIBUTE)_\w+|\w+_(?:CLANG_TIDY|COMPILER_LAUNCHER|CPPCHECK|CPPLINT|INCLUDE_WHAT_YOU_USE|OUTPUT_NAME|POSTFIX|VISIBILITY_PRESET)|ABSTRACT|ADDITIONAL_MAKE_CLEAN_FILES|ADVANCED|ALIASED_TARGET|ALLOW_DUPLICATE_CUSTOM_TARGETS|ANDROID_(?:ANT_ADDITIONAL_OPTIONS|API|API_MIN|ARCH|ASSETS_DIRECTORIES|GUI|JAR_DEPENDENCIES|NATIVE_LIB_DEPENDENCIES|NATIVE_LIB_DIRECTORIES|PROCESS_MAX|PROGUARD|PROGUARD_CONFIG_PATH|SECURE_PROPS_PATH|SKIP_ANT_STEP|STL_TYPE)|ARCHIVE_OUTPUT_DIRECTORY|ATTACHED_FILES|ATTACHED_FILES_ON_FAIL|AUTOGEN_(?:BUILD_DIR|ORIGIN_DEPENDS|PARALLEL|SOURCE_GROUP|TARGETS_FOLDER|TARGET_DEPENDS)|AUTOMOC|AUTOMOC_(?:COMPILER_PREDEFINES|DEPEND_FILTERS|EXECUTABLE|MACRO_NAMES|MOC_OPTIONS|SOURCE_GROUP|TARGETS_FOLDER)|AUTORCC|AUTORCC_EXECUTABLE|AUTORCC_OPTIONS|AUTORCC_SOURCE_GROUP|AUTOUIC|AUTOUIC_EXECUTABLE|AUTOUIC_OPTIONS|AUTOUIC_SEARCH_PATHS|BINARY_DIR|BUILDSYSTEM_TARGETS|BUILD_RPATH|BUILD_RPATH_USE_ORIGIN|BUILD_WITH_INSTALL_NAME_DIR|BUILD_WITH_INSTALL_RPATH|BUNDLE|BUNDLE_EXTENSION|CACHE_VARIABLES|CLEAN_NO_CUSTOM|COMMON_LANGUAGE_RUNTIME|COMPATIBLE_INTERFACE_(?:BOOL|NUMBER_MAX|NUMBER_MIN|STRING)|COMPILE_(?:DEFINITIONS|FEATURES|FLAGS|OPTIONS|PDB_NAME|PDB_OUTPUT_DIRECTORY)|COST|CPACK_DESKTOP_SHORTCUTS|CPACK_NEVER_OVERWRITE|CPACK_PERMANENT|CPACK_STARTUP_SHORTCUTS|CPACK_START_MENU_SHORTCUTS|CPACK_WIX_ACL|CROSSCOMPILING_EMULATOR|CUDA_EXTENSIONS|CUDA_PTX_COMPILATION|CUDA_RESOLVE_DEVICE_SYMBOLS|CUDA_SEPARABLE_COMPILATION|CUDA_STANDARD|CUDA_STANDARD_REQUIRED|CXX_EXTENSIONS|CXX_STANDARD|CXX_STANDARD_REQUIRED|C_EXTENSIONS|C_STANDARD|C_STANDARD_REQUIRED|DEBUG_CONFIGURATIONS|DEFINE_SYMBOL|DEFINITIONS|DEPENDS|DEPLOYMENT_ADDITIONAL_FILES|DEPLOYMENT_REMOTE_DIRECTORY|DISABLED|DISABLED_FEATURES|ECLIPSE_EXTRA_CPROJECT_CONTENTS|ECLIPSE_EXTRA_NATURES|ENABLED_FEATURES|ENABLED_LANGUAGES|ENABLE_EXPORTS|ENVIRONMENT|EXCLUDE_FROM_ALL|EXCLUDE_FROM_DEFAULT_BUILD|EXPORT_NAME|EXPORT_PROPERTIES|EXTERNAL_OBJECT|EchoString|FAIL_REGULAR_EXPRESSION|FIND_LIBRARY_USE_LIB32_PATHS|FIND_LIBRARY_USE_LIB64_PATHS|FIND_LIBRARY_USE_LIBX32_PATHS|FIND_LIBRARY_USE_OPENBSD_VERSIONING|FIXTURES_CLEANUP|FIXTURES_REQUIRED|FIXTURES_SETUP|FOLDER|FRAMEWORK|Fortran_FORMAT|Fortran_MODULE_DIRECTORY|GENERATED|GENERATOR_FILE_NAME|GENERATOR_IS_MULTI_CONFIG|GHS_INTEGRITY_APP|GHS_NO_SOURCE_GROUP_FILE|GLOBAL_DEPENDS_DEBUG_MODE|GLOBAL_DEPENDS_NO_CYCLES|GNUtoMS|HAS_CXX|HEADER_FILE_ONLY|HELPSTRING|IMPLICIT_DEPENDS_INCLUDE_TRANSFORM|IMPORTED|IMPORTED_(?:COMMON_LANGUAGE_RUNTIME|CONFIGURATIONS|GLOBAL|IMPLIB|LIBNAME|LINK_DEPENDENT_LIBRARIES|LINK_INTERFACE_(?:LANGUAGES|LIBRARIES|MULTIPLICITY)|LOCATION|NO_SONAME|OBJECTS|SONAME)|IMPORT_PREFIX|IMPORT_SUFFIX|INCLUDE_DIRECTORIES|INCLUDE_REGULAR_EXPRESSION|INSTALL_NAME_DIR|INSTALL_RPATH|INSTALL_RPATH_USE_LINK_PATH|INTERFACE_(?:AUTOUIC_OPTIONS|COMPILE_DEFINITIONS|COMPILE_FEATURES|COMPILE_OPTIONS|INCLUDE_DIRECTORIES|LINK_DEPENDS|LINK_DIRECTORIES|LINK_LIBRARIES|LINK_OPTIONS|POSITION_INDEPENDENT_CODE|SOURCES|SYSTEM_INCLUDE_DIRECTORIES)|INTERPROCEDURAL_OPTIMIZATION|IN_TRY_COMPILE|IOS_INSTALL_COMBINED|JOB_POOLS|JOB_POOL_COMPILE|JOB_POOL_LINK|KEEP_EXTENSION|LABELS|LANGUAGE|LIBRARY_OUTPUT_DIRECTORY|LINKER_LANGUAGE|LINK_(?:DEPENDS|DEPENDS_NO_SHARED|DIRECTORIES|FLAGS|INTERFACE_LIBRARIES|INTERFACE_MULTIPLICITY|LIBRARIES|OPTIONS|SEARCH_END_STATIC|SEARCH_START_STATIC|WHAT_YOU_USE)|LISTFILE_STACK|LOCATION|MACOSX_BUNDLE|MACOSX_BUNDLE_INFO_PLIST|MACOSX_FRAMEWORK_INFO_PLIST|MACOSX_PACKAGE_LOCATION|MACOSX_RPATH|MACROS|MANUALLY_ADDED_DEPENDENCIES|MEASUREMENT|MODIFIED|NAME|NO_SONAME|NO_SYSTEM_FROM_IMPORTED|OBJECT_DEPENDS|OBJECT_OUTPUTS|OSX_ARCHITECTURES|OUTPUT_NAME|PACKAGES_FOUND|PACKAGES_NOT_FOUND|PARENT_DIRECTORY|PASS_REGULAR_EXPRESSION|PDB_NAME|PDB_OUTPUT_DIRECTORY|POSITION_INDEPENDENT_CODE|POST_INSTALL_SCRIPT|PREDEFINED_TARGETS_FOLDER|PREFIX|PRE_INSTALL_SCRIPT|PRIVATE_HEADER|PROCESSORS|PROCESSOR_AFFINITY|PROJECT_LABEL|PUBLIC_HEADER|REPORT_UNDEFINED_PROPERTIES|REQUIRED_FILES|RESOURCE|RESOURCE_LOCK|RULE_LAUNCH_COMPILE|RULE_LAUNCH_CUSTOM|RULE_LAUNCH_LINK|RULE_MESSAGES|RUNTIME_OUTPUT_DIRECTORY|RUN_SERIAL|SKIP_AUTOGEN|SKIP_AUTOMOC|SKIP_AUTORCC|SKIP_AUTOUIC|SKIP_BUILD_RPATH|SKIP_RETURN_CODE|SOURCES|SOURCE_DIR|SOVERSION|STATIC_LIBRARY_FLAGS|STATIC_LIBRARY_OPTIONS|STRINGS|SUBDIRECTORIES|SUFFIX|SYMBOLIC|TARGET_ARCHIVES_MAY_BE_SHARED_LIBS|TARGET_MESSAGES|TARGET_SUPPORTS_SHARED_LIBS|TESTS|TEST_INCLUDE_FILE|TEST_INCLUDE_FILES|TIMEOUT|TIMEOUT_AFTER_MATCH|TYPE|USE_FOLDERS|VALUE|VARIABLES|VERSION|VISIBILITY_INLINES_HIDDEN|VS_(?:CONFIGURATION_TYPE|COPY_TO_OUT_DIR|DEBUGGER_(?:COMMAND|COMMAND_ARGUMENTS|ENVIRONMENT|WORKING_DIRECTORY)|DEPLOYMENT_CONTENT|DEPLOYMENT_LOCATION|DOTNET_REFERENCES|DOTNET_REFERENCES_COPY_LOCAL|GLOBAL_KEYWORD|GLOBAL_PROJECT_TYPES|GLOBAL_ROOTNAMESPACE|INCLUDE_IN_VSIX|IOT_STARTUP_TASK|KEYWORD|RESOURCE_GENERATOR|SCC_AUXPATH|SCC_LOCALPATH|SCC_PROJECTNAME|SCC_PROVIDER|SDK_REFERENCES|SHADER_(?:DISABLE_OPTIMIZATIONS|ENABLE_DEBUG|ENTRYPOINT|FLAGS|MODEL|OBJECT_FILE_NAME|OUTPUT_HEADER_FILE|TYPE|VARIABLE_NAME)|STARTUP_PROJECT|TOOL_OVERRIDE|USER_PROPS|WINRT_COMPONENT|WINRT_EXTENSIONS|WINRT_REFERENCES|XAML_TYPE)|WILL_FAIL|WIN32_EXECUTABLE|WINDOWS_EXPORT_ALL_SYMBOLS|WORKING_DIRECTORY|WRAP_EXCLUDE|XCODE_(?:EMIT_EFFECTIVE_PLATFORM_NAME|EXPLICIT_FILE_TYPE|FILE_ATTRIBUTES|LAST_KNOWN_FILE_TYPE|PRODUCT_TYPE|SCHEME_(?:ADDRESS_SANITIZER|ADDRESS_SANITIZER_USE_AFTER_RETURN|ARGUMENTS|DISABLE_MAIN_THREAD_CHECKER|DYNAMIC_LIBRARY_LOADS|DYNAMIC_LINKER_API_USAGE|ENVIRONMENT|EXECUTABLE|GUARD_MALLOC|MAIN_THREAD_CHECKER_STOP|MALLOC_GUARD_EDGES|MALLOC_SCRIBBLE|MALLOC_STACK|THREAD_SANITIZER(?:_STOP)?|UNDEFINED_BEHAVIOUR_SANITIZER(?:_STOP)?|ZOMBIE_OBJECTS))|XCTEST)\b/,keyword:/\b(?:add_compile_definitions|add_compile_options|add_custom_command|add_custom_target|add_definitions|add_dependencies|add_executable|add_library|add_link_options|add_subdirectory|add_test|aux_source_directory|break|build_command|build_name|cmake_host_system_information|cmake_minimum_required|cmake_parse_arguments|cmake_policy|configure_file|continue|create_test_sourcelist|ctest_build|ctest_configure|ctest_coverage|ctest_empty_binary_directory|ctest_memcheck|ctest_read_custom_files|ctest_run_script|ctest_sleep|ctest_start|ctest_submit|ctest_test|ctest_update|ctest_upload|define_property|else|elseif|enable_language|enable_testing|endforeach|endfunction|endif|endmacro|endwhile|exec_program|execute_process|export|export_library_dependencies|file|find_file|find_library|find_package|find_path|find_program|fltk_wrap_ui|foreach|function|get_cmake_property|get_directory_property|get_filename_component|get_property|get_source_file_property|get_target_property|get_test_property|if|include|include_directories|include_external_msproject|include_guard|include_regular_expression|install|install_files|install_programs|install_targets|link_directories|link_libraries|list|load_cache|load_command|macro|make_directory|mark_as_advanced|math|message|option|output_required_files|project|qt_wrap_cpp|qt_wrap_ui|remove|remove_definitions|return|separate_arguments|set|set_directory_properties|set_property|set_source_files_properties|set_target_properties|set_tests_properties|site_name|source_group|string|subdir_depends|subdirs|target_compile_definitions|target_compile_features|target_compile_options|target_include_directories|target_link_directories|target_link_libraries|target_link_options|target_sources|try_compile|try_run|unset|use_mangled_mesa|utility_source|variable_requires|variable_watch|while|write_file)(?=\s*\()\b/,boolean:/\b(?:ON|OFF|TRUE|FALSE)\b/,namespace:/\b(?:PROPERTIES|SHARED|PRIVATE|STATIC|PUBLIC|INTERFACE|TARGET_OBJECTS)\b/,operator:/\b(?:NOT|AND|OR|MATCHES|LESS|GREATER|EQUAL|STRLESS|STRGREATER|STREQUAL|VERSION_LESS|VERSION_EQUAL|VERSION_GREATER|DEFINED)\b/,inserted:{pattern:/\b\w+::\w+\b/,alias:"class-name"},number:/\b\d+(?:\.\d+)*\b/,function:/\b[a-z_]\w*(?=\s*\()\b/i,punctuation:/[()>}]|\$[<{]/}}e.exports=t,t.displayName="cmake",t.aliases=[]},32762(e){"use strict";function t(e){e.languages.cobol={comment:{pattern:/\*>.*|(^[ \t]*)\*.*/m,lookbehind:!0,greedy:!0},string:{pattern:/[xzgn]?(?:"(?:[^\r\n"]|"")*"(?!")|'(?:[^\r\n']|'')*'(?!'))/i,greedy:!0},level:{pattern:/(^[ \t]*)\d+\b/m,lookbehind:!0,greedy:!0,alias:"number"},"class-name":{pattern:/(\bpic(?:ture)?\s+)(?:(?:[-\w$/,:*+<>]|\.(?!\s|$))(?:\(\d+\))?)+/i,lookbehind:!0,inside:{number:{pattern:/(\()\d+/,lookbehind:!0},punctuation:/[()]/}},keyword:{pattern:/(^|[^\w-])(?:ABORT|ACCEPT|ACCESS|ADD|ADDRESS|ADVANCING|AFTER|ALIGNED|ALL|ALPHABET|ALPHABETIC|ALPHABETIC-LOWER|ALPHABETIC-UPPER|ALPHANUMERIC|ALPHANUMERIC-EDITED|ALSO|ALTER|ALTERNATE|ANY|ARE|AREA|AREAS|AS|ASCENDING|ASCII|ASSIGN|ASSOCIATED-DATA|ASSOCIATED-DATA-LENGTH|AT|ATTRIBUTE|AUTHOR|AUTO|AUTO-SKIP|BACKGROUND-COLOR|BACKGROUND-COLOUR|BASIS|BEEP|BEFORE|BEGINNING|BELL|BINARY|BIT|BLANK|BLINK|BLOCK|BOUNDS|BOTTOM|BY|BYFUNCTION|BYTITLE|CALL|CANCEL|CAPABLE|CCSVERSION|CD|CF|CH|CHAINING|CHANGED|CHANNEL|CHARACTER|CHARACTERS|CLASS|CLASS-ID|CLOCK-UNITS|CLOSE|CLOSE-DISPOSITION|COBOL|CODE|CODE-SET|COLLATING|COL|COLUMN|COM-REG|COMMA|COMMITMENT|COMMON|COMMUNICATION|COMP|COMP-1|COMP-2|COMP-3|COMP-4|COMP-5|COMPUTATIONAL|COMPUTATIONAL-1|COMPUTATIONAL-2|COMPUTATIONAL-3|COMPUTATIONAL-4|COMPUTATIONAL-5|COMPUTE|CONFIGURATION|CONTAINS|CONTENT|CONTINUE|CONTROL|CONTROL-POINT|CONTROLS|CONVENTION|CONVERTING|COPY|CORR|CORRESPONDING|COUNT|CRUNCH|CURRENCY|CURSOR|DATA|DATA-BASE|DATE|DATE-COMPILED|DATE-WRITTEN|DAY|DAY-OF-WEEK|DBCS|DE|DEBUG-CONTENTS|DEBUG-ITEM|DEBUG-LINE|DEBUG-NAME|DEBUG-SUB-1|DEBUG-SUB-2|DEBUG-SUB-3|DEBUGGING|DECIMAL-POINT|DECLARATIVES|DEFAULT|DEFAULT-DISPLAY|DEFINITION|DELETE|DELIMITED|DELIMITER|DEPENDING|DESCENDING|DESTINATION|DETAIL|DFHRESP|DFHVALUE|DISABLE|DISK|DISPLAY|DISPLAY-1|DIVIDE|DIVISION|DONTCARE|DOUBLE|DOWN|DUPLICATES|DYNAMIC|EBCDIC|EGCS|EGI|ELSE|EMI|EMPTY-CHECK|ENABLE|END|END-ACCEPT|END-ADD|END-CALL|END-COMPUTE|END-DELETE|END-DIVIDE|END-EVALUATE|END-IF|END-MULTIPLY|END-OF-PAGE|END-PERFORM|END-READ|END-RECEIVE|END-RETURN|END-REWRITE|END-SEARCH|END-START|END-STRING|END-SUBTRACT|END-UNSTRING|END-WRITE|ENDING|ENTER|ENTRY|ENTRY-PROCEDURE|ENVIRONMENT|EOP|ERASE|ERROR|EOL|EOS|ESCAPE|ESI|EVALUATE|EVENT|EVERY|EXCEPTION|EXCLUSIVE|EXHIBIT|EXIT|EXPORT|EXTEND|EXTENDED|EXTERNAL|FD|FILE|FILE-CONTROL|FILLER|FINAL|FIRST|FOOTING|FOR|FOREGROUND-COLOR|FOREGROUND-COLOUR|FROM|FULL|FUNCTION|FUNCTIONNAME|FUNCTION-POINTER|GENERATE|GOBACK|GIVING|GLOBAL|GO|GRID|GROUP|HEADING|HIGHLIGHT|HIGH-VALUE|HIGH-VALUES|I-O|I-O-CONTROL|ID|IDENTIFICATION|IF|IMPLICIT|IMPORT|IN|INDEX|INDEXED|INDICATE|INITIAL|INITIALIZE|INITIATE|INPUT|INPUT-OUTPUT|INSPECT|INSTALLATION|INTEGER|INTO|INVALID|INVOKE|IS|JUST|JUSTIFIED|KANJI|KEPT|KEY|KEYBOARD|LABEL|LANGUAGE|LAST|LB|LD|LEADING|LEFT|LEFTLINE|LENGTH|LENGTH-CHECK|LIBACCESS|LIBPARAMETER|LIBRARY|LIMIT|LIMITS|LINAGE|LINAGE-COUNTER|LINE|LINES|LINE-COUNTER|LINKAGE|LIST|LOCAL|LOCAL-STORAGE|LOCK|LONG-DATE|LONG-TIME|LOWER|LOWLIGHT|LOW-VALUE|LOW-VALUES|MEMORY|MERGE|MESSAGE|MMDDYYYY|MODE|MODULES|MORE-LABELS|MOVE|MULTIPLE|MULTIPLY|NAMED|NATIONAL|NATIONAL-EDITED|NATIVE|NEGATIVE|NETWORK|NEXT|NO|NO-ECHO|NULL|NULLS|NUMBER|NUMERIC|NUMERIC-DATE|NUMERIC-EDITED|NUMERIC-TIME|OBJECT-COMPUTER|OCCURS|ODT|OF|OFF|OMITTED|ON|OPEN|OPTIONAL|ORDER|ORDERLY|ORGANIZATION|OTHER|OUTPUT|OVERFLOW|OVERLINE|OWN|PACKED-DECIMAL|PADDING|PAGE|PAGE-COUNTER|PASSWORD|PERFORM|PF|PH|PIC|PICTURE|PLUS|POINTER|POSITION|POSITIVE|PORT|PRINTER|PRINTING|PRIVATE|PROCEDURE|PROCEDURE-POINTER|PROCEDURES|PROCEED|PROCESS|PROGRAM|PROGRAM-ID|PROGRAM-LIBRARY|PROMPT|PURGE|QUEUE|QUOTE|QUOTES|RANDOM|READER|REMOTE|RD|REAL|READ|RECEIVE|RECEIVED|RECORD|RECORDING|RECORDS|RECURSIVE|REDEFINES|REEL|REF|REFERENCE|REFERENCES|RELATIVE|RELEASE|REMAINDER|REMARKS|REMOVAL|REMOVE|RENAMES|REPLACE|REPLACING|REPORT|REPORTING|REPORTS|REQUIRED|RERUN|RESERVE|REVERSE-VIDEO|RESET|RETURN|RETURN-CODE|RETURNING|REVERSED|REWIND|REWRITE|RF|RH|RIGHT|ROUNDED|RUN|SAME|SAVE|SCREEN|SD|SEARCH|SECTION|SECURE|SECURITY|SEGMENT|SEGMENT-LIMIT|SELECT|SEND|SENTENCE|SEPARATE|SEQUENCE|SEQUENTIAL|SET|SHARED|SHAREDBYALL|SHAREDBYRUNUNIT|SHARING|SHIFT-IN|SHIFT-OUT|SHORT-DATE|SIGN|SIZE|SORT|SORT-CONTROL|SORT-CORE-SIZE|SORT-FILE-SIZE|SORT-MERGE|SORT-MESSAGE|SORT-MODE-SIZE|SORT-RETURN|SOURCE|SOURCE-COMPUTER|SPACE|SPACES|SPECIAL-NAMES|STANDARD|STANDARD-1|STANDARD-2|START|STATUS|STOP|STRING|SUB-QUEUE-1|SUB-QUEUE-2|SUB-QUEUE-3|SUBTRACT|SUM|SUPPRESS|SYMBOL|SYMBOLIC|SYNC|SYNCHRONIZED|TABLE|TALLY|TALLYING|TASK|TAPE|TERMINAL|TERMINATE|TEST|TEXT|THEN|THREAD|THREAD-LOCAL|THROUGH|THRU|TIME|TIMER|TIMES|TITLE|TO|TODAYS-DATE|TODAYS-NAME|TOP|TRAILING|TRUNCATED|TYPE|TYPEDEF|UNDERLINE|UNIT|UNSTRING|UNTIL|UP|UPON|USAGE|USE|USING|VALUE|VALUES|VARYING|VIRTUAL|WAIT|WHEN|WHEN-COMPILED|WITH|WORDS|WORKING-STORAGE|WRITE|YEAR|YYYYMMDD|YYYYDDD|ZERO-FILL|ZEROS|ZEROES)(?![\w-])/i,lookbehind:!0},boolean:{pattern:/(^|[^\w-])(?:false|true)(?![\w-])/i,lookbehind:!0},number:{pattern:/(^|[^\w-])(?:[+-]?(?:(?:\d+(?:[.,]\d+)?|[.,]\d+)(?:e[+-]?\d+)?|zero))(?![\w-])/i,lookbehind:!0},operator:[/<>|[<>]=?|[=+*/&]/,{pattern:/(^|[^\w-])(?:-|and|equal|greater|less|not|or|than)(?![\w-])/i,lookbehind:!0}],punctuation:/[.:,()]/}}e.exports=t,t.displayName="cobol",t.aliases=[]},43576(e){"use strict";function t(e){var t,n,r;n=/#(?!\{).+/,r={pattern:/#\{[^}]+\}/,alias:"variable"},(t=e).languages.coffeescript=t.languages.extend("javascript",{comment:n,string:[{pattern:/'(?:\\[\s\S]|[^\\'])*'/,greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,greedy:!0,inside:{interpolation:r}}],keyword:/\b(?:and|break|by|catch|class|continue|debugger|delete|do|each|else|extend|extends|false|finally|for|if|in|instanceof|is|isnt|let|loop|namespace|new|no|not|null|of|off|on|or|own|return|super|switch|then|this|throw|true|try|typeof|undefined|unless|until|when|while|window|with|yes|yield)\b/,"class-member":{pattern:/@(?!\d)\w+/,alias:"variable"}}),t.languages.insertBefore("coffeescript","comment",{"multiline-comment":{pattern:/###[\s\S]+?###/,alias:"comment"},"block-regex":{pattern:/\/{3}[\s\S]*?\/{3}/,alias:"regex",inside:{comment:n,interpolation:r}}}),t.languages.insertBefore("coffeescript","string",{"inline-javascript":{pattern:/`(?:\\[\s\S]|[^\\`])*`/,inside:{delimiter:{pattern:/^`|`$/,alias:"punctuation"},script:{pattern:/[\s\S]+/,alias:"language-javascript",inside:t.languages.javascript}}},"multiline-string":[{pattern:/'''[\s\S]*?'''/,greedy:!0,alias:"string"},{pattern:/"""[\s\S]*?"""/,greedy:!0,alias:"string",inside:{interpolation:r}}]}),t.languages.insertBefore("coffeescript","keyword",{property:/(?!\d)\w+(?=\s*:(?!:))/}),delete t.languages.coffeescript["template-string"],t.languages.coffee=t.languages.coffeescript}e.exports=t,t.displayName="coffeescript",t.aliases=["coffee"]},71794(e){"use strict";function t(e){e.languages.concurnas={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],langext:{pattern:/\b\w+\s*\|\|[\s\S]+?\|\|/,greedy:!0,alias:"string"},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/,lookbehind:!0},keyword:/\b(?:abstract|actor|also|annotation|assert|async|await|bool|boolean|break|byte|case|catch|changed|char|class|closed|constant|continue|def|default|del|double|elif|else|enum|every|extends|false|finally|float|for|from|global|gpudef|gpukernel|if|import|in|init|inject|int|lambda|local|long|loop|match|new|nodefault|null|of|onchange|open|out|override|package|parfor|parforsync|post|pre|private|protected|provide|provider|public|return|shared|short|single|size_t|sizeof|super|sync|this|throw|trait|trans|transient|true|try|typedef|unchecked|using|val|var|void|while|with)\b/,boolean:/\b(?:false|true)\b/,number:/\b0b[01][01_]*L?\b|\b0x(?:[\da-f_]*\.)?[\da-f_p+-]+\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfls]?/i,punctuation:/[{}[\];(),.:]/,operator:/<==|>==|=>|->|<-|<>|\^|&==|&<>|!|\?:?|\.\?|\+\+|--|[-+*/=<>]=?|\b(?:and|as|band|bor|bxor|comp|is|isnot|mod|or)\b=?/,annotation:{pattern:/@(?:\w+:)?(?:\w+|\[[^\]]+\])?/,alias:"builtin"}},e.languages.insertBefore("concurnas","langext",{string:{pattern:/[rs]?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:e.languages.concurnas},string:/[\s\S]+/}}}),e.languages.conc=e.languages.concurnas}e.exports=t,t.displayName="concurnas",t.aliases=["conc"]},1315(e){"use strict";function t(e){!function(e){for(var t=/\(\*(?:[^(*]|\((?!\*)|\*(?!\))|)*\*\)/.source,n=0;n<2;n++)t=t.replace(//g,function(){return t});t=t.replace(//g,"[]"),e.languages.coq={comment:RegExp(t),string:{pattern:/"(?:[^"]|"")*"(?!")/,greedy:!0},attribute:[{pattern:RegExp(/#\[(?:[^\]("]|"(?:[^"]|"")*"(?!")|\((?!\*)|)*\]/.source.replace(//g,function(){return t})),greedy:!0,alias:"attr-name",inside:{comment:RegExp(t),string:{pattern:/"(?:[^"]|"")*"(?!")/,greedy:!0},operator:/=/,punctuation:/^#\[|\]$|[,()]/}},{pattern:/\b(?:Cumulative|Global|Local|Monomorphic|NonCumulative|Polymorphic|Private|Program)\b/,alias:"attr-name"}],keyword:/\b(?:_|Abort|About|Add|Admit|Admitted|All|apply|Arguments|as|As|Assumptions|at|Axiom|Axioms|Back|BackTo|Backtrace|Bind|BinOp|BinOpSpec|BinRel|Blacklist|by|Canonical|Case|Cd|Check|Class|Classes|Close|Coercion|Coercions|cofix|CoFixpoint|CoInductive|Collection|Combined|Compute|Conjecture|Conjectures|Constant|Constants|Constraint|Constructors|Context|Corollary|Create|CstOp|Custom|Cut|Debug|Declare|Defined|Definition|Delimit|Dependencies|Dependent|Derive|Diffs|Drop|Elimination|else|end|End|Entry|Equality|Eval|Example|Existential|Existentials|Existing|exists|exists2|Export|Extern|Extraction|Fact|Fail|Field|File|Firstorder|fix|Fixpoint|Flags|Focus|for|forall|From|fun|Funclass|Function|Functional|GC|Generalizable|Goal|Grab|Grammar|Graph|Guarded|Haskell|Heap|Hide|Hint|HintDb|Hints|Hypotheses|Hypothesis|Identity|if|IF|Immediate|Implicit|Implicits|Import|in|Include|Induction|Inductive|Infix|Info|Initial|InjTyp|Inline|Inspect|Instance|Instances|Intro|Intros|Inversion|Inversion_clear|JSON|Language|Left|Lemma|let|Let|Lia|Libraries|Library|Load|LoadPath|Locate|Ltac|Ltac2|match|Match|measure|Method|Minimality|ML|Module|Modules|Morphism|move|Next|NoInline|Notation|Number|Obligation|Obligations|OCaml|Opaque|Open|Optimize|Parameter|Parameters|Parametric|Path|Paths|Prenex|Preterm|Primitive|Print|Profile|Projections|Proof|Prop|PropBinOp|Property|PropOp|Proposition|PropUOp|Pwd|Qed|Quit|Rec|Record|Recursive|Redirect|Reduction|Register|Relation|Remark|Remove|removed|Require|Reserved|Reset|Resolve|Restart|return|Rewrite|Right|Ring|Rings|Saturate|Save|Scheme|Scope|Scopes|Search|SearchHead|SearchPattern|SearchRewrite|Section|Separate|Set|Setoid|Show|Signatures|Solve|Solver|Sort|Sortclass|Sorted|Spec|SProp|Step|Strategies|Strategy|String|struct|Structure|SubClass|Subgraph|SuchThat|Tactic|Term|TestCompile|then|Theorem|Time|Timeout|To|Transparent|Type|Typeclasses|Types|Typing|Undelimit|Undo|Unfocus|Unfocused|Unfold|Universe|Universes|UnOp|UnOpSpec|Unshelve|using|Variable|Variables|Variant|Verbose|View|Visibility|wf|where|with|Zify)\b/,number:/\b(?:0x[a-f0-9][a-f0-9_]*(?:\.[a-f0-9_]+)?(?:p[+-]?\d[\d_]*)?|\d[\d_]*(?:\.[\d_]+)?(?:e[+-]?\d[\d_]*)?)\b/i,punct:{pattern:/@\{|\{\||\[=|:>/,alias:"punctuation"},operator:/\/\\|\\\/|\.{2,3}|:{1,2}=|\*\*|[-=]>|<(?:->?|[+:=>]|<:)|>(?:=|->)|\|[-|]?|[-!%&*+/<=>?@^~']/,punctuation:/\.\(|`\(|@\{|`\{|\{\||\[=|:>|[:.,;(){}\[\]]/}}(e)}e.exports=t,t.displayName="coq",t.aliases=[]},80096(e,t,n){"use strict";var r=n(65806);function i(e){var t,n,i;e.register(r),t=e,n=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char8_t|char16_t|char32_t|class|compl|concept|const|consteval|constexpr|constinit|const_cast|continue|co_await|co_return|co_yield|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int8_t|int16_t|int32_t|int64_t|uint8_t|uint16_t|uint32_t|uint64_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,i=/\b(?!)\w+(?:\s*\.\s*\w+)*\b/.source.replace(//g,function(){return n.source}),t.languages.cpp=t.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!)\w+/.source.replace(//g,function(){return n.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:n,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:true|false)\b/}),t.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:module|import)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/(?:\s*:\s*)?|:\s*/.source.replace(//g,function(){return i})+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),t.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b[a-z_]\w*\s*<(?:[^<>]|<(?:[^<>])*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:t.languages.cpp}}}}),t.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),t.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:t.languages.extend("cpp",{})}}),t.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},t.languages.cpp["base-clause"])}e.exports=i,i.displayName="cpp",i.aliases=[]},99176(e,t,n){"use strict";var r=n(56939);function i(e){var t;e.register(r),(t=e).languages.crystal=t.languages.extend("ruby",{keyword:[/\b(?:abstract|alias|as|asm|begin|break|case|class|def|do|else|elsif|end|ensure|enum|extend|for|fun|if|include|instance_sizeof|lib|macro|module|next|of|out|pointerof|private|protected|rescue|return|require|select|self|sizeof|struct|super|then|type|typeof|uninitialized|union|unless|until|when|while|with|yield|__DIR__|__END_LINE__|__FILE__|__LINE__)\b/,{pattern:/(\.\s*)(?:is_a|responds_to)\?/,lookbehind:!0}],number:/\b(?:0b[01_]*[01]|0o[0-7_]*[0-7]|0x[\da-fA-F_]*[\da-fA-F]|(?:\d(?:[\d_]*\d)?)(?:\.[\d_]*\d)?(?:[eE][+-]?[\d_]*\d)?)(?:_(?:[uif](?:8|16|32|64))?)?\b/}),t.languages.insertBefore("crystal","string",{attribute:{pattern:/@\[.+?\]/,alias:"attr-name",inside:{delimiter:{pattern:/^@\[|\]$/,alias:"tag"},rest:t.languages.crystal}},expansion:[{pattern:/\{\{.+?\}\}/,inside:{delimiter:{pattern:/^\{\{|\}\}$/,alias:"tag"},rest:t.languages.crystal}},{pattern:/\{%.+?%\}/,inside:{delimiter:{pattern:/^\{%|%\}$/,alias:"tag"},rest:t.languages.crystal}}]})}e.exports=i,i.displayName="crystal",i.aliases=[]},61958(e){"use strict";function t(e){!function(e){function t(e,t){return e.replace(/<<(\d+)>>/g,function(e,n){return"(?:"+t[+n]+")"})}function n(e,n,r){return RegExp(t(e,n),r||"")}function r(e,t){for(var n=0;n>/g,function(){return"(?:"+e+")"});return e.replace(/<>/g,"[^\\s\\S]")}var i={type:"bool byte char decimal double dynamic float int long object sbyte short string uint ulong ushort var void",typeDeclaration:"class enum interface struct",contextual:"add alias and ascending async await by descending from get global group into join let nameof not notnull on or orderby partial remove select set unmanaged value when where",other:"abstract as base break case catch checked const continue default delegate do else event explicit extern finally fixed for foreach goto if implicit in internal is lock namespace new null operator out override params private protected public readonly ref return sealed sizeof stackalloc static switch this throw try typeof unchecked unsafe using virtual volatile while yield"};function a(e){return"\\b(?:"+e.trim().replace(/ /g,"|")+")\\b"}var o=a(i.typeDeclaration),s=RegExp(a(i.type+" "+i.typeDeclaration+" "+i.contextual+" "+i.other)),u=a(i.typeDeclaration+" "+i.contextual+" "+i.other),c=a(i.type+" "+i.typeDeclaration+" "+i.other),l=r(/<(?:[^<>;=+\-*/%&|^]|<>)*>/.source,2),f=r(/\((?:[^()]|<>)*\)/.source,2),d=/@?\b[A-Za-z_]\w*\b/.source,h=t(/<<0>>(?:\s*<<1>>)?/.source,[d,l]),p=t(/(?!<<0>>)<<1>>(?:\s*\.\s*<<1>>)*/.source,[u,h]),b=/\[\s*(?:,\s*)*\]/.source,m=t(/<<0>>(?:\s*(?:\?\s*)?<<1>>)*(?:\s*\?)?/.source,[p,b]),g=t(/[^,()<>[\];=+\-*/%&|^]|<<0>>|<<1>>|<<2>>/.source,[l,f,b]),v=t(/\(<<0>>+(?:,<<0>>+)+\)/.source,[g]),y=t(/(?:<<0>>|<<1>>)(?:\s*(?:\?\s*)?<<2>>)*(?:\s*\?)?/.source,[v,p,b]),w={keyword:s,punctuation:/[<>()?,.:[\]]/},_=/'(?:[^\r\n'\\]|\\.|\\[Uux][\da-fA-F]{1,8})'/.source,E=/"(?:\\.|[^\\"\r\n])*"/.source,S=/@"(?:""|\\[\s\S]|[^\\"])*"(?!")/.source;e.languages.csharp=e.languages.extend("clike",{string:[{pattern:n(/(^|[^$\\])<<0>>/.source,[S]),lookbehind:!0,greedy:!0},{pattern:n(/(^|[^@$\\])<<0>>/.source,[E]),lookbehind:!0,greedy:!0},{pattern:RegExp(_),greedy:!0,alias:"character"}],"class-name":[{pattern:n(/(\busing\s+static\s+)<<0>>(?=\s*;)/.source,[p]),lookbehind:!0,inside:w},{pattern:n(/(\busing\s+<<0>>\s*=\s*)<<1>>(?=\s*;)/.source,[d,y]),lookbehind:!0,inside:w},{pattern:n(/(\busing\s+)<<0>>(?=\s*=)/.source,[d]),lookbehind:!0},{pattern:n(/(\b<<0>>\s+)<<1>>/.source,[o,h]),lookbehind:!0,inside:w},{pattern:n(/(\bcatch\s*\(\s*)<<0>>/.source,[p]),lookbehind:!0,inside:w},{pattern:n(/(\bwhere\s+)<<0>>/.source,[d]),lookbehind:!0},{pattern:n(/(\b(?:is(?:\s+not)?|as)\s+)<<0>>/.source,[m]),lookbehind:!0,inside:w},{pattern:n(/\b<<0>>(?=\s+(?!<<1>>)<<2>>(?:\s*[=,;:{)\]]|\s+(?:in|when)\b))/.source,[y,c,d]),inside:w}],keyword:s,number:/(?:\b0(?:x[\da-f_]*[\da-f]|b[01_]*[01])|(?:\B\.\d+(?:_+\d+)*|\b\d+(?:_+\d+)*(?:\.\d+(?:_+\d+)*)?)(?:e[-+]?\d+(?:_+\d+)*)?)(?:ul|lu|[dflmu])?\b/i,operator:/>>=?|<<=?|[-=]>|([-+&|])\1|~|\?\?=?|[-+*/%&|^!=<>]=?/,punctuation:/\?\.?|::|[{}[\];(),.:]/}),e.languages.insertBefore("csharp","number",{range:{pattern:/\.\./,alias:"operator"}}),e.languages.insertBefore("csharp","punctuation",{"named-parameter":{pattern:n(/([(,]\s*)<<0>>(?=\s*:)/.source,[d]),lookbehind:!0,alias:"punctuation"}}),e.languages.insertBefore("csharp","class-name",{namespace:{pattern:n(/(\b(?:namespace|using)\s+)<<0>>(?:\s*\.\s*<<0>>)*(?=\s*[;{])/.source,[d]),lookbehind:!0,inside:{punctuation:/\./}},"type-expression":{pattern:n(/(\b(?:default|typeof|sizeof)\s*\(\s*(?!\s))(?:[^()\s]|\s(?!\s)|<<0>>)*(?=\s*\))/.source,[f]),lookbehind:!0,alias:"class-name",inside:w},"return-type":{pattern:n(/<<0>>(?=\s+(?:<<1>>\s*(?:=>|[({]|\.\s*this\s*\[)|this\s*\[))/.source,[y,p]),inside:w,alias:"class-name"},"constructor-invocation":{pattern:n(/(\bnew\s+)<<0>>(?=\s*[[({])/.source,[y]),lookbehind:!0,inside:w,alias:"class-name"},"generic-method":{pattern:n(/<<0>>\s*<<1>>(?=\s*\()/.source,[d,l]),inside:{function:n(/^<<0>>/.source,[d]),generic:{pattern:RegExp(l),alias:"class-name",inside:w}}},"type-list":{pattern:n(/\b((?:<<0>>\s+<<1>>|where\s+<<2>>)\s*:\s*)(?:<<3>>|<<4>>)(?:\s*,\s*(?:<<3>>|<<4>>))*(?=\s*(?:where|[{;]|=>|$))/.source,[o,h,d,y,s.source]),lookbehind:!0,inside:{keyword:s,"class-name":{pattern:RegExp(y),greedy:!0,inside:w},punctuation:/,/}},preprocessor:{pattern:/(^[\t ]*)#.*/m,lookbehind:!0,alias:"property",inside:{directive:{pattern:/(#)\b(?:define|elif|else|endif|endregion|error|if|line|pragma|region|undef|warning)\b/,lookbehind:!0,alias:"keyword"}}}});var k=E+"|"+_,x=t(/\/(?![*/])|\/\/[^\r\n]*[\r\n]|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>/.source,[k]),T=r(t(/[^"'/()]|<<0>>|\(<>*\)/.source,[x]),2),M=/\b(?:assembly|event|field|method|module|param|property|return|type)\b/.source,O=t(/<<0>>(?:\s*\(<<1>>*\))?/.source,[p,T]);e.languages.insertBefore("csharp","class-name",{attribute:{pattern:n(/((?:^|[^\s\w>)?])\s*\[\s*)(?:<<0>>\s*:\s*)?<<1>>(?:\s*,\s*<<1>>)*(?=\s*\])/.source,[M,O]),lookbehind:!0,greedy:!0,inside:{target:{pattern:n(/^<<0>>(?=\s*:)/.source,[M]),alias:"keyword"},"attribute-arguments":{pattern:n(/\(<<0>>*\)/.source,[T]),inside:e.languages.csharp},"class-name":{pattern:RegExp(p),inside:{punctuation:/\./}},punctuation:/[:,]/}}});var A=/:[^}\r\n]+/.source,L=r(t(/[^"'/()]|<<0>>|\(<>*\)/.source,[x]),2),C=t(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[L,A]),I=r(t(/[^"'/()]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>|\(<>*\)/.source,[k]),2),D=t(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[I,A]);function N(t,r){return{interpolation:{pattern:n(/((?:^|[^{])(?:\{\{)*)<<0>>/.source,[t]),lookbehind:!0,inside:{"format-string":{pattern:n(/(^\{(?:(?![}:])<<0>>)*)<<1>>(?=\}$)/.source,[r,A]),lookbehind:!0,inside:{punctuation:/^:/}},punctuation:/^\{|\}$/,expression:{pattern:/[\s\S]+/,alias:"language-csharp",inside:e.languages.csharp}}},string:/[\s\S]+/}}e.languages.insertBefore("csharp","string",{"interpolation-string":[{pattern:n(/(^|[^\\])(?:\$@|@\$)"(?:""|\\[\s\S]|\{\{|<<0>>|[^\\{"])*"/.source,[C]),lookbehind:!0,greedy:!0,inside:N(C,L)},{pattern:n(/(^|[^@\\])\$"(?:\\.|\{\{|<<0>>|[^\\"{])*"/.source,[D]),lookbehind:!0,greedy:!0,inside:N(D,I)}]})}(e),e.languages.dotnet=e.languages.cs=e.languages.csharp}e.exports=t,t.displayName="csharp",t.aliases=["dotnet","cs"]},65447(e){"use strict";function t(e){e.languages.csp={directive:{pattern:/(^|[^-\da-z])(?:base-uri|block-all-mixed-content|(?:child|connect|default|font|frame|img|manifest|media|object|prefetch|script|style|worker)-src|disown-opener|form-action|frame-(?:ancestors|options)|input-protection(?:-(?:clip|selectors))?|navigate-to|plugin-types|policy-uri|referrer|reflected-xss|report-(?:to|uri)|require-sri-for|sandbox|(?:script|style)-src-(?:attr|elem)|upgrade-insecure-requests)(?=[^-\da-z]|$)/i,lookbehind:!0,alias:"keyword"},safe:{pattern:/'(?:deny|none|report-sample|self|strict-dynamic|top-only|(?:nonce|sha(?:256|384|512))-[-+/\w=]+)'/i,alias:"selector"},unsafe:{pattern:/(?:'unsafe-(?:allow-redirects|dynamic|eval|hash-attributes|hashed-attributes|hashes|inline)'|\*)/i,alias:"function"}}}e.exports=t,t.displayName="csp",t.aliases=[]},4762(e){"use strict";function t(e){var t,n,r,i,a;r=/("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,(t=e).languages.css.selector={pattern:t.languages.css.selector.pattern,lookbehind:!0,inside:n={"pseudo-element":/:(?:after|before|first-letter|first-line|selection)|::[-\w]+/,"pseudo-class":/:[-\w]+/,class:/\.[-\w]+/,id:/#[-\w]+/,attribute:{pattern:RegExp("\\[(?:[^[\\]\"']|"+r.source+")*\\]"),greedy:!0,inside:{punctuation:/^\[|\]$/,"case-sensitivity":{pattern:/(\s)[si]$/i,lookbehind:!0,alias:"keyword"},namespace:{pattern:/^(\s*)(?:(?!\s)[-*\w\xA0-\uFFFF])*\|(?!=)/,lookbehind:!0,inside:{punctuation:/\|$/}},"attr-name":{pattern:/^(\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+/,lookbehind:!0},"attr-value":[r,{pattern:/(=\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+(?=\s*$)/,lookbehind:!0}],operator:/[|~*^$]?=/}},"n-th":[{pattern:/(\(\s*)[+-]?\d*[\dn](?:\s*[+-]\s*\d+)?(?=\s*\))/,lookbehind:!0,inside:{number:/[\dn]+/,operator:/[+-]/}},{pattern:/(\(\s*)(?:even|odd)(?=\s*\))/i,lookbehind:!0}],combinator:/>|\+|~|\|\|/,punctuation:/[(),]/}},t.languages.css.atrule.inside["selector-function-argument"].inside=n,t.languages.insertBefore("css","property",{variable:{pattern:/(^|[^-\w\xA0-\uFFFF])--(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*/i,lookbehind:!0}}),i={pattern:/(\b\d+)(?:%|[a-z]+\b)/,lookbehind:!0},a={pattern:/(^|[^\w.-])-?(?:\d+(?:\.\d+)?|\.\d+)/,lookbehind:!0},t.languages.insertBefore("css","function",{operator:{pattern:/(\s)[+\-*\/](?=\s)/,lookbehind:!0},hexcode:{pattern:/\B#[\da-f]{3,8}\b/i,alias:"color"},color:[/\b(?:AliceBlue|AntiqueWhite|Aqua|Aquamarine|Azure|Beige|Bisque|Black|BlanchedAlmond|Blue|BlueViolet|Brown|BurlyWood|CadetBlue|Chartreuse|Chocolate|Coral|CornflowerBlue|Cornsilk|Crimson|Cyan|DarkBlue|DarkCyan|DarkGoldenRod|DarkGr[ae]y|DarkGreen|DarkKhaki|DarkMagenta|DarkOliveGreen|DarkOrange|DarkOrchid|DarkRed|DarkSalmon|DarkSeaGreen|DarkSlateBlue|DarkSlateGr[ae]y|DarkTurquoise|DarkViolet|DeepPink|DeepSkyBlue|DimGr[ae]y|DodgerBlue|FireBrick|FloralWhite|ForestGreen|Fuchsia|Gainsboro|GhostWhite|Gold|GoldenRod|Gr[ae]y|Green|GreenYellow|HoneyDew|HotPink|IndianRed|Indigo|Ivory|Khaki|Lavender|LavenderBlush|LawnGreen|LemonChiffon|LightBlue|LightCoral|LightCyan|LightGoldenRodYellow|LightGr[ae]y|LightGreen|LightPink|LightSalmon|LightSeaGreen|LightSkyBlue|LightSlateGr[ae]y|LightSteelBlue|LightYellow|Lime|LimeGreen|Linen|Magenta|Maroon|MediumAquaMarine|MediumBlue|MediumOrchid|MediumPurple|MediumSeaGreen|MediumSlateBlue|MediumSpringGreen|MediumTurquoise|MediumVioletRed|MidnightBlue|MintCream|MistyRose|Moccasin|NavajoWhite|Navy|OldLace|Olive|OliveDrab|Orange|OrangeRed|Orchid|PaleGoldenRod|PaleGreen|PaleTurquoise|PaleVioletRed|PapayaWhip|PeachPuff|Peru|Pink|Plum|PowderBlue|Purple|Red|RosyBrown|RoyalBlue|SaddleBrown|Salmon|SandyBrown|SeaGreen|SeaShell|Sienna|Silver|SkyBlue|SlateBlue|SlateGr[ae]y|Snow|SpringGreen|SteelBlue|Tan|Teal|Thistle|Tomato|Transparent|Turquoise|Violet|Wheat|White|WhiteSmoke|Yellow|YellowGreen)\b/i,{pattern:/\b(?:rgb|hsl)\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*\)\B|\b(?:rgb|hsl)a\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*,\s*(?:0|0?\.\d+|1)\s*\)\B/i,inside:{unit:i,number:a,function:/[\w-]+(?=\()/,punctuation:/[(),]/}}],entity:/\\[\da-f]{1,8}/i,unit:i,number:a})}e.exports=t,t.displayName="cssExtras",t.aliases=[]},12049(e){"use strict";function t(e){var t,n,r;n=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/,(t=e).languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:/@[\w-](?:[^;{\s]|\s+(?![\s{]))*(?:;|(?=\s*\{))/,inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+n.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+n.source+"$"),alias:"url"}}},selector:{pattern:RegExp("(^|[{}\\s])[^{}\\s](?:[^{};\"'\\s]|\\s+(?![\\s{])|"+n.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:n,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},t.languages.css.atrule.inside.rest=t.languages.css,(r=t.languages.markup)&&(r.tag.addInlined("style","css"),r.tag.addAttribute("style","css"))}e.exports=t,t.displayName="css",t.aliases=[]},78090(e){"use strict";function t(e){e.languages.csv={value:/[^\r\n,"]+|"(?:[^"]|"")*"(?!")/,punctuation:/,/}}e.exports=t,t.displayName="csv",t.aliases=[]},40315(e){"use strict";function t(e){e.languages.cypher={comment:/\/\/.*/,string:{pattern:/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/,greedy:!0},"class-name":{pattern:/(:\s*)(?:\w+|`(?:[^`\\\r\n])*`)(?=\s*[{):])/,lookbehind:!0,greedy:!0},relationship:{pattern:/(-\[\s*(?:\w+\s*|`(?:[^`\\\r\n])*`\s*)?:\s*|\|\s*:\s*)(?:\w+|`(?:[^`\\\r\n])*`)/,lookbehind:!0,greedy:!0,alias:"property"},identifier:{pattern:/`(?:[^`\\\r\n])*`/,greedy:!0,alias:"symbol"},variable:/\$\w+/,keyword:/\b(?:ADD|ALL|AND|AS|ASC|ASCENDING|ASSERT|BY|CALL|CASE|COMMIT|CONSTRAINT|CONTAINS|CREATE|CSV|DELETE|DESC|DESCENDING|DETACH|DISTINCT|DO|DROP|ELSE|END|ENDS|EXISTS|FOR|FOREACH|IN|INDEX|IS|JOIN|KEY|LIMIT|LOAD|MANDATORY|MATCH|MERGE|NODE|NOT|OF|ON|OPTIONAL|OR|ORDER(?=\s+BY)|PERIODIC|REMOVE|REQUIRE|RETURN|SCALAR|SCAN|SET|SKIP|START|STARTS|THEN|UNION|UNIQUE|UNWIND|USING|WHEN|WHERE|WITH|XOR|YIELD)\b/i,function:/\b\w+\b(?=\s*\()/,boolean:/\b(?:true|false|null)\b/i,number:/\b(?:0x[\da-fA-F]+|\d+(?:\.\d+)?(?:[eE][+-]?\d+)?)\b/,operator:/:|<--?|--?>?|<>|=~?|[<>]=?|[+*/%^|]|\.\.\.?/,punctuation:/[()[\]{},;.]/}}e.exports=t,t.displayName="cypher",t.aliases=[]},7902(e){"use strict";function t(e){e.languages.d=e.languages.extend("clike",{comment:[{pattern:/^\s*#!.+/,greedy:!0},{pattern:RegExp(/(^|[^\\])/.source+"(?:"+[/\/\+(?:\/\+(?:[^+]|\+(?!\/))*\+\/|(?!\/\+)[\s\S])*?\+\//.source,/\/\/.*/.source,/\/\*[\s\S]*?\*\//.source].join("|")+")"),lookbehind:!0,greedy:!0}],string:[{pattern:RegExp([/\b[rx]"(?:\\[\s\S]|[^\\"])*"[cwd]?/.source,/\bq"(?:\[[\s\S]*?\]|\([\s\S]*?\)|<[\s\S]*?>|\{[\s\S]*?\})"/.source,/\bq"((?!\d)\w+)$[\s\S]*?^\1"/.source,/\bq"(.)[\s\S]*?\2"/.source,/'(?:\\(?:\W|\w+)|[^\\])'/.source,/(["`])(?:\\[\s\S]|(?!\3)[^\\])*\3[cwd]?/.source].join("|"),"m"),greedy:!0},{pattern:/\bq\{(?:\{[^{}]*\}|[^{}])*\}/,greedy:!0,alias:"token-string"}],keyword:/\$|\b(?:abstract|alias|align|asm|assert|auto|body|bool|break|byte|case|cast|catch|cdouble|cent|cfloat|char|class|const|continue|creal|dchar|debug|default|delegate|delete|deprecated|do|double|else|enum|export|extern|false|final|finally|float|for|foreach|foreach_reverse|function|goto|idouble|if|ifloat|immutable|import|inout|int|interface|invariant|ireal|lazy|long|macro|mixin|module|new|nothrow|null|out|override|package|pragma|private|protected|public|pure|real|ref|return|scope|shared|short|static|struct|super|switch|synchronized|template|this|throw|true|try|typedef|typeid|typeof|ubyte|ucent|uint|ulong|union|unittest|ushort|version|void|volatile|wchar|while|with|__(?:(?:FILE|MODULE|LINE|FUNCTION|PRETTY_FUNCTION|DATE|EOF|TIME|TIMESTAMP|VENDOR|VERSION)__|gshared|traits|vector|parameters)|string|wstring|dstring|size_t|ptrdiff_t)\b/,number:[/\b0x\.?[a-f\d_]+(?:(?!\.\.)\.[a-f\d_]*)?(?:p[+-]?[a-f\d_]+)?[ulfi]{0,4}/i,{pattern:/((?:\.\.)?)(?:\b0b\.?|\b|\.)\d[\d_]*(?:(?!\.\.)\.[\d_]*)?(?:e[+-]?\d[\d_]*)?[ulfi]{0,4}/i,lookbehind:!0}],operator:/\|[|=]?|&[&=]?|\+[+=]?|-[-=]?|\.?\.\.|=[>=]?|!(?:i[ns]\b|<>?=?|>=?|=)?|\bi[ns]\b|(?:<[<>]?|>>?>?|\^\^|[*\/%^~])=?/}),e.languages.insertBefore("d","keyword",{property:/\B@\w*/}),e.languages.insertBefore("d","function",{register:{pattern:/\b(?:[ABCD][LHX]|E[ABCD]X|E?(?:BP|SP|DI|SI)|[ECSDGF]S|CR[0234]|DR[012367]|TR[3-7]|X?MM[0-7]|R[ABCD]X|[BS]PL|R[BS]P|[DS]IL|R[DS]I|R(?:[89]|1[0-5])[BWD]?|XMM(?:[89]|1[0-5])|YMM(?:1[0-5]|\d))\b|\bST(?:\([0-7]\)|\b)/,alias:"variable"}})}e.exports=t,t.displayName="d",t.aliases=[]},28651(e){"use strict";function t(e){var t,n,r,i;t=e,n=[/\b(?:async|sync|yield)\*/,/\b(?:abstract|assert|async|await|break|case|catch|class|const|continue|covariant|default|deferred|do|dynamic|else|enum|export|extension|external|extends|factory|final|finally|for|get|hide|if|implements|interface|import|in|library|mixin|new|null|on|operator|part|rethrow|return|set|show|static|super|switch|sync|this|throw|try|typedef|var|void|while|with|yield)\b/],i={pattern:RegExp((r=/(^|[^\w.])(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source)+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}}}},t.languages.dart=t.languages.extend("clike",{string:[{pattern:/r?("""|''')[\s\S]*?\1/,greedy:!0},{pattern:/r?(["'])(?:\\.|(?!\1)[^\\\r\n])*\1/,greedy:!0}],"class-name":[i,{pattern:RegExp(r+/[A-Z]\w*(?=\s+\w+\s*[;,=()])/.source),lookbehind:!0,inside:i.inside}],keyword:n,operator:/\bis!|\b(?:as|is)\b|\+\+|--|&&|\|\||<<=?|>>=?|~(?:\/=?)?|[+\-*\/%&^|=!<>]=?|\?/}),t.languages.insertBefore("dart","function",{metadata:{pattern:/@\w+/,alias:"symbol"}}),t.languages.insertBefore("dart","class-name",{generics:{pattern:/<(?:[\w\s,.&?]|<(?:[\w\s,.&?]|<(?:[\w\s,.&?]|<[\w\s,.&?]*>)*>)*>)*>/,inside:{"class-name":i,keyword:n,punctuation:/[<>(),.:]/,operator:/[?&|]/}}})}e.exports=t,t.displayName="dart",t.aliases=[]},55579(e){"use strict";function t(e){var t;(t=e).languages.dataweave={url:/\b[A-Za-z]+:\/\/[\w/:.?=&-]+|\burn:[\w:.?=&-]+/,property:{pattern:/(?:\b\w+#)?(?:"(?:\\.|[^\\"\r\n])*"|\b\w+)(?=\s*[:@])/,greedy:!0},string:{pattern:/(["'`])(?:\\[\s\S]|(?!\1)[^\\])*\1/,greedy:!0},"mime-type":/\b(?:text|audio|video|application|multipart|image)\/[\w+-]+/,date:{pattern:/\|[\w:+-]+\|/,greedy:!0},comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],regex:{pattern:/\/(?:[^\\\/\r\n]|\\[^\r\n])+\//,greedy:!0},function:/\b[A-Z_]\w*(?=\s*\()/i,number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\];(),.:@]/,operator:/<<|>>|->|[<>~=]=?|!=|--?-?|\+\+?|!|\?/,boolean:/\b(?:true|false)\b/,keyword:/\b(?:match|input|output|ns|type|update|null|if|else|using|unless|at|is|as|case|do|fun|var|not|and|or)\b/}}e.exports=t,t.displayName="dataweave",t.aliases=[]},93685(e){"use strict";function t(e){e.languages.dax={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/).*)/,lookbehind:!0},"data-field":{pattern:/'(?:[^']|'')*'(?!')(?:\[[ \w\xA0-\uFFFF]+\])?|\w+\[[ \w\xA0-\uFFFF]+\]/,alias:"symbol"},measure:{pattern:/\[[ \w\xA0-\uFFFF]+\]/,alias:"constant"},string:{pattern:/"(?:[^"]|"")*"(?!")/,greedy:!0},function:/\b(?:ABS|ACOS|ACOSH|ACOT|ACOTH|ADDCOLUMNS|ADDMISSINGITEMS|ALL|ALLCROSSFILTERED|ALLEXCEPT|ALLNOBLANKROW|ALLSELECTED|AND|APPROXIMATEDISTINCTCOUNT|ASIN|ASINH|ATAN|ATANH|AVERAGE|AVERAGEA|AVERAGEX|BETA\.DIST|BETA\.INV|BLANK|CALCULATE|CALCULATETABLE|CALENDAR|CALENDARAUTO|CEILING|CHISQ\.DIST|CHISQ\.DIST\.RT|CHISQ\.INV|CHISQ\.INV\.RT|CLOSINGBALANCEMONTH|CLOSINGBALANCEQUARTER|CLOSINGBALANCEYEAR|COALESCE|COMBIN|COMBINA|COMBINEVALUES|CONCATENATE|CONCATENATEX|CONFIDENCE\.NORM|CONFIDENCE\.T|CONTAINS|CONTAINSROW|CONTAINSSTRING|CONTAINSSTRINGEXACT|CONVERT|COS|COSH|COT|COTH|COUNT|COUNTA|COUNTAX|COUNTBLANK|COUNTROWS|COUNTX|CROSSFILTER|CROSSJOIN|CURRENCY|CURRENTGROUP|CUSTOMDATA|DATATABLE|DATE|DATEADD|DATEDIFF|DATESBETWEEN|DATESINPERIOD|DATESMTD|DATESQTD|DATESYTD|DATEVALUE|DAY|DEGREES|DETAILROWS|DISTINCT|DISTINCTCOUNT|DISTINCTCOUNTNOBLANK|DIVIDE|EARLIER|EARLIEST|EDATE|ENDOFMONTH|ENDOFQUARTER|ENDOFYEAR|EOMONTH|ERROR|EVEN|EXACT|EXCEPT|EXP|EXPON\.DIST|FACT|FALSE|FILTER|FILTERS|FIND|FIRSTDATE|FIRSTNONBLANK|FIRSTNONBLANKVALUE|FIXED|FLOOR|FORMAT|GCD|GENERATE|GENERATEALL|GENERATESERIES|GEOMEAN|GEOMEANX|GROUPBY|HASONEFILTER|HASONEVALUE|HOUR|IF|IF\.EAGER|IFERROR|IGNORE|INT|INTERSECT|ISBLANK|ISCROSSFILTERED|ISEMPTY|ISERROR|ISEVEN|ISFILTERED|ISINSCOPE|ISLOGICAL|ISNONTEXT|ISNUMBER|ISO\.CEILING|ISODD|ISONORAFTER|ISSELECTEDMEASURE|ISSUBTOTAL|ISTEXT|KEEPFILTERS|KEYWORDMATCH|LASTDATE|LASTNONBLANK|LASTNONBLANKVALUE|LCM|LEFT|LEN|LN|LOG|LOG10|LOOKUPVALUE|LOWER|MAX|MAXA|MAXX|MEDIAN|MEDIANX|MID|MIN|MINA|MINUTE|MINX|MOD|MONTH|MROUND|NATURALINNERJOIN|NATURALLEFTOUTERJOIN|NEXTDAY|NEXTMONTH|NEXTQUARTER|NEXTYEAR|NONVISUAL|NORM\.DIST|NORM\.INV|NORM\.S\.DIST|NORM\.S\.INV|NOT|NOW|ODD|OPENINGBALANCEMONTH|OPENINGBALANCEQUARTER|OPENINGBALANCEYEAR|OR|PARALLELPERIOD|PATH|PATHCONTAINS|PATHITEM|PATHITEMREVERSE|PATHLENGTH|PERCENTILE\.EXC|PERCENTILE\.INC|PERCENTILEX\.EXC|PERCENTILEX\.INC|PERMUT|PI|POISSON\.DIST|POWER|PREVIOUSDAY|PREVIOUSMONTH|PREVIOUSQUARTER|PREVIOUSYEAR|PRODUCT|PRODUCTX|QUARTER|QUOTIENT|RADIANS|RAND|RANDBETWEEN|RANK\.EQ|RANKX|RELATED|RELATEDTABLE|REMOVEFILTERS|REPLACE|REPT|RIGHT|ROLLUP|ROLLUPADDISSUBTOTAL|ROLLUPGROUP|ROLLUPISSUBTOTAL|ROUND|ROUNDDOWN|ROUNDUP|ROW|SAMEPERIODLASTYEAR|SAMPLE|SEARCH|SECOND|SELECTCOLUMNS|SELECTEDMEASURE|SELECTEDMEASUREFORMATSTRING|SELECTEDMEASURENAME|SELECTEDVALUE|SIGN|SIN|SINH|SQRT|SQRTPI|STARTOFMONTH|STARTOFQUARTER|STARTOFYEAR|STDEV\.P|STDEV\.S|STDEVX\.P|STDEVX\.S|SUBSTITUTE|SUBSTITUTEWITHINDEX|SUM|SUMMARIZE|SUMMARIZECOLUMNS|SUMX|SWITCH|T\.DIST|T\.DIST\.2T|T\.DIST\.RT|T\.INV|T\.INV\.2T|TAN|TANH|TIME|TIMEVALUE|TODAY|TOPN|TOPNPERLEVEL|TOPNSKIP|TOTALMTD|TOTALQTD|TOTALYTD|TREATAS|TRIM|TRUE|TRUNC|UNICHAR|UNICODE|UNION|UPPER|USERELATIONSHIP|USERNAME|USEROBJECTID|USERPRINCIPALNAME|UTCNOW|UTCTODAY|VALUE|VALUES|VAR\.P|VAR\.S|VARX\.P|VARX\.S|WEEKDAY|WEEKNUM|XIRR|XNPV|YEAR|YEARFRAC)(?=\s*\()/i,keyword:/\b(?:DEFINE|MEASURE|EVALUATE|ORDER\s+BY|RETURN|VAR|START\s+AT|ASC|DESC)\b/i,boolean:{pattern:/\b(?:TRUE|FALSE|NULL)\b/i,alias:"constant"},number:/\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/:=|[-+*\/=^]|&&?|\|\||<(?:=>?|<|>)?|>[>=]?|\b(?:IN|NOT)\b/i,punctuation:/[;\[\](){}`,.]/}}e.exports=t,t.displayName="dax",t.aliases=[]},13934(e){"use strict";function t(e){e.languages.dhall={comment:/--.*|\{-(?:[^-{]|-(?!\})|\{(?!-)|\{-(?:[^-{]|-(?!\})|\{(?!-))*-\})*-\}/,string:{pattern:/"(?:[^"\\]|\\.)*"|''(?:[^']|'(?!')|'''|''\$\{)*''(?!'|\$)/,greedy:!0,inside:{interpolation:{pattern:/\$\{[^{}]*\}/,inside:{expression:{pattern:/(^\$\{)[\s\S]+(?=\}$)/,lookbehind:!0,alias:"language-dhall",inside:null},punctuation:/\$\{|\}/}}}},label:{pattern:/`[^`]*`/,greedy:!0},url:{pattern:/\bhttps?:\/\/[\w.:%!$&'*+;=@~-]+(?:\/[\w.:%!$&'*+;=@~-]*)*(?:\?[/?\w.:%!$&'*+;=@~-]*)?/,greedy:!0},env:{pattern:/\benv:(?:(?!\d)\w+|"(?:[^"\\=]|\\.)*")/,greedy:!0,inside:{function:/^env/,operator:/^:/,variable:/[\s\S]+/}},hash:{pattern:/\bsha256:[\da-fA-F]{64}\b/,inside:{function:/sha256/,operator:/:/,number:/[\da-fA-F]{64}/}},keyword:/\b(?:as|assert|else|forall|if|in|let|merge|missing|then|toMap|using|with)\b|\u2200/,builtin:/\b(?:Some|None)\b/,boolean:/\b(?:False|True)\b/,number:/\bNaN\b|-?\bInfinity\b|[+-]?\b(?:0x[\da-fA-F]+|\d+(?:\.\d+)?(?:e[+-]?\d+)?)\b/,operator:/\/\\|\/\/\\\\|&&|\|\||===|[!=]=|\/\/|->|\+\+|::|[+*#@=:?<>|\\\u2227\u2a53\u2261\u2afd\u03bb\u2192]/,punctuation:/\.\.|[{}\[\](),./]/,"class-name":/\b[A-Z]\w*\b/},e.languages.dhall.string.inside.interpolation.inside.expression.inside=e.languages.dhall}e.exports=t,t.displayName="dhall",t.aliases=[]},93336(e){"use strict";function t(e){var t,n;(t=e).languages.diff={coord:[/^(?:\*{3}|-{3}|\+{3}).*$/m,/^@@.*@@$/m,/^\d.*$/m]},Object.keys(n={"deleted-sign":"-","deleted-arrow":"<","inserted-sign":"+","inserted-arrow":">",unchanged:" ",diff:"!"}).forEach(function(e){var r=n[e],i=[];/^\w+$/.test(e)||i.push(/\w+/.exec(e)[0]),"diff"===e&&i.push("bold"),t.languages.diff[e]={pattern:RegExp("^(?:["+r+"].*(?:\r\n?|\n|(?![\\s\\S])))+","m"),alias:i,inside:{line:{pattern:/(.)(?=[\s\S]).*(?:\r\n?|\n)?/,lookbehind:!0},prefix:{pattern:/[\s\S]/,alias:/\w+/.exec(e)[0]}}}}),Object.defineProperty(t.languages.diff,"PREFIXES",{value:n})}e.exports=t,t.displayName="diff",t.aliases=[]},13294(e,t,n){"use strict";var r=n(93205);function i(e){var t,n,i;e.register(r),(t=e).languages.django={comment:/^\{#[\s\S]*?#\}$/,tag:{pattern:/(^\{%[+-]?\s*)\w+/,lookbehind:!0,alias:"keyword"},delimiter:{pattern:/^\{[{%][+-]?|[+-]?[}%]\}$/,alias:"punctuation"},string:{pattern:/("|')(?:\\.|(?!\1)[^\\\r\n])*\1/,greedy:!0},filter:{pattern:/(\|)\w+/,lookbehind:!0,alias:"function"},test:{pattern:/(\bis\s+(?:not\s+)?)(?!not\b)\w+/,lookbehind:!0,alias:"function"},function:/\b[a-z_]\w+(?=\s*\()/i,keyword:/\b(?:and|as|by|else|for|if|import|in|is|loop|not|or|recursive|with|without)\b/,operator:/[-+%=]=?|!=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,number:/\b\d+(?:\.\d+)?\b/,boolean:/[Tt]rue|[Ff]alse|[Nn]one/,variable:/\b\w+?\b/,punctuation:/[{}[\](),.:;]/},n=/\{\{[\s\S]*?\}\}|\{%[\s\S]*?%\}|\{#[\s\S]*?#\}/g,i=t.languages["markup-templating"],t.hooks.add("before-tokenize",function(e){i.buildPlaceholders(e,"django",n)}),t.hooks.add("after-tokenize",function(e){i.tokenizePlaceholders(e,"django")}),t.languages.jinja2=t.languages.django,t.hooks.add("before-tokenize",function(e){i.buildPlaceholders(e,"jinja2",n)}),t.hooks.add("after-tokenize",function(e){i.tokenizePlaceholders(e,"jinja2")})}e.exports=i,i.displayName="django",i.aliases=["jinja2"]},38223(e){"use strict";function t(e){e.languages["dns-zone-file"]={comment:/;.*/,string:{pattern:/"(?:\\.|[^"\\\r\n])*"/,greedy:!0},variable:[{pattern:/(^\$ORIGIN[ \t]+)\S+/m,lookbehind:!0},{pattern:/(^|\s)@(?=\s|$)/,lookbehind:!0}],keyword:/^\$(?:ORIGIN|INCLUDE|TTL)(?=\s|$)/m,class:{pattern:/(^|\s)(?:IN|CH|CS|HS)(?=\s|$)/,lookbehind:!0,alias:"keyword"},type:{pattern:/(^|\s)(?:A|A6|AAAA|AFSDB|APL|ATMA|CAA|CDNSKEY|CDS|CERT|CNAME|DHCID|DLV|DNAME|DNSKEY|DS|EID|GID|GPOS|HINFO|HIP|IPSECKEY|ISDN|KEY|KX|LOC|MAILA|MAILB|MB|MD|MF|MG|MINFO|MR|MX|NAPTR|NB|NBSTAT|NIMLOC|NINFO|NS|NSAP|NSAP-PTR|NSEC|NSEC3|NSEC3PARAM|NULL|NXT|OPENPGPKEY|PTR|PX|RKEY|RP|RRSIG|RT|SIG|SINK|SMIMEA|SOA|SPF|SRV|SSHFP|TA|TKEY|TLSA|TSIG|TXT|UID|UINFO|UNSPEC|URI|WKS|X25)(?=\s|$)/,lookbehind:!0,alias:"keyword"},punctuation:/[()]/},e.languages["dns-zone"]=e.languages["dns-zone-file"]}e.exports=t,t.displayName="dnsZoneFile",t.aliases=[]},97266(e){"use strict";function t(e){!function(e){var t=/\\[\r\n](?:\s|\\[\r\n]|#.*(?!.))*(?![\s#]|\\[\r\n])/.source,n=/(?:[ \t]+(?![ \t])(?:)?|)/.source.replace(//g,function(){return t}),r=/"(?:[^"\\\r\n]|\\(?:\r\n|[\s\S]))*"|'(?:[^'\\\r\n]|\\(?:\r\n|[\s\S]))*'/.source,i=/--[\w-]+=(?:|(?!["'])(?:[^\s\\]|\\.)+)/.source.replace(//g,function(){return r}),a={pattern:RegExp(r),greedy:!0},o={pattern:/(^[ \t]*)#.*/m,lookbehind:!0,greedy:!0};function s(e,t){return e=e.replace(//g,function(){return i}).replace(//g,function(){return n}),RegExp(e,t)}e.languages.docker={instruction:{pattern:/(^[ \t]*)(?:ADD|ARG|CMD|COPY|ENTRYPOINT|ENV|EXPOSE|FROM|HEALTHCHECK|LABEL|MAINTAINER|ONBUILD|RUN|SHELL|STOPSIGNAL|USER|VOLUME|WORKDIR)(?=\s)(?:\\.|[^\r\n\\])*(?:\\$(?:\s|#.*$)*(?![\s#])(?:\\.|[^\r\n\\])*)*/im,lookbehind:!0,greedy:!0,inside:{options:{pattern:s(/(^(?:ONBUILD)?\w+)(?:)*/.source,"i"),lookbehind:!0,greedy:!0,inside:{property:{pattern:/(^|\s)--[\w-]+/,lookbehind:!0},string:[a,{pattern:/(=)(?!["'])(?:[^\s\\]|\\.)+/,lookbehind:!0}],operator:/\\$/m,punctuation:/=/}},keyword:[{pattern:s(/(^(?:ONBUILD)?HEALTHCHECK(?:)*)(?:CMD|NONE)\b/.source,"i"),lookbehind:!0,greedy:!0},{pattern:s(/(^(?:ONBUILD)?FROM(?:)*(?!--)[^ \t\\]+)AS/.source,"i"),lookbehind:!0,greedy:!0},{pattern:s(/(^ONBUILD)\w+/.source,"i"),lookbehind:!0,greedy:!0},{pattern:/^\w+/,greedy:!0}],comment:o,string:a,variable:/\$(?:\w+|\{[^{}"'\\]*\})/,operator:/\\$/m}},comment:o},e.languages.dockerfile=e.languages.docker}(e)}e.exports=t,t.displayName="docker",t.aliases=["dockerfile"]},80636(e){"use strict";function t(e){!function(e){var t="(?:"+[/[a-zA-Z_\x80-\uFFFF][\w\x80-\uFFFF]*/.source,/-?(?:\.\d+|\d+(?:\.\d*)?)/.source,/"[^"\\]*(?:\\[\s\S][^"\\]*)*"/.source,/<(?:[^<>]|(?!)*>/.source].join("|")+")",n={markup:{pattern:/(^<)[\s\S]+(?=>$)/,lookbehind:!0,alias:["language-markup","language-html","language-xml"],inside:e.languages.markup}};function r(e,n){return RegExp(e.replace(//g,function(){return t}),n)}e.languages.dot={comment:{pattern:/\/\/.*|\/\*[\s\S]*?\*\/|^#.*/m,greedy:!0},"graph-name":{pattern:r(/(\b(?:digraph|graph|subgraph)[ \t\r\n]+)/.source,"i"),lookbehind:!0,greedy:!0,alias:"class-name",inside:n},"attr-value":{pattern:r(/(=[ \t\r\n]*)/.source),lookbehind:!0,greedy:!0,inside:n},"attr-name":{pattern:r(/([\[;, \t\r\n])(?=[ \t\r\n]*=)/.source),lookbehind:!0,greedy:!0,inside:n},keyword:/\b(?:digraph|edge|graph|node|strict|subgraph)\b/i,"compass-point":{pattern:/(:[ \t\r\n]*)(?:[ns][ew]?|[ewc_])(?![\w\x80-\uFFFF])/,lookbehind:!0,alias:"builtin"},node:{pattern:r(/(^|[^-.\w\x80-\uFFFF\\])/.source),lookbehind:!0,greedy:!0,inside:n},operator:/[=:]|-[->]/,punctuation:/[\[\]{};,]/},e.languages.gv=e.languages.dot}(e)}e.exports=t,t.displayName="dot",t.aliases=["gv"]},36500(e){"use strict";function t(e){e.languages.ebnf={comment:/\(\*[\s\S]*?\*\)/,string:{pattern:/"[^"\r\n]*"|'[^'\r\n]*'/,greedy:!0},special:{pattern:/\?[^?\r\n]*\?/,greedy:!0,alias:"class-name"},definition:{pattern:/^([\t ]*)[a-z]\w*(?:[ \t]+[a-z]\w*)*(?=\s*=)/im,lookbehind:!0,alias:["rule","keyword"]},rule:/\b[a-z]\w*(?:[ \t]+[a-z]\w*)*\b/i,punctuation:/\([:/]|[:/]\)|[.,;()[\]{}]/,operator:/[-=|*/!]/}}e.exports=t,t.displayName="ebnf",t.aliases=[]},30296(e){"use strict";function t(e){e.languages.editorconfig={comment:/[;#].*/,section:{pattern:/(^[ \t]*)\[.+\]/m,lookbehind:!0,alias:"keyword",inside:{regex:/\\\\[\[\]{},!?.*]/,operator:/[!?]|\.\.|\*{1,2}/,punctuation:/[\[\]{},]/}},property:{pattern:/(^[ \t]*)[^\s=]+(?=[ \t]*=)/m,lookbehind:!0},value:{pattern:/=.*/,alias:"string",inside:{punctuation:/^=/}}}}e.exports=t,t.displayName="editorconfig",t.aliases=[]},50115(e){"use strict";function t(e){e.languages.eiffel={comment:/--.*/,string:[{pattern:/"([^[]*)\[[\s\S]*?\]\1"/,greedy:!0},{pattern:/"([^{]*)\{[\s\S]*?\}\1"/,greedy:!0},{pattern:/"(?:%(?:(?!\n)\s)*\n\s*%|%\S|[^%"\r\n])*"/,greedy:!0}],char:/'(?:%.|[^%'\r\n])+'/,keyword:/\b(?:across|agent|alias|all|and|attached|as|assign|attribute|check|class|convert|create|Current|debug|deferred|detachable|do|else|elseif|end|ensure|expanded|export|external|feature|from|frozen|if|implies|inherit|inspect|invariant|like|local|loop|not|note|obsolete|old|once|or|Precursor|redefine|rename|require|rescue|Result|retry|select|separate|some|then|undefine|until|variant|Void|when|xor)\b/i,boolean:/\b(?:True|False)\b/i,"class-name":{pattern:/\b[A-Z][\dA-Z_]*\b/,alias:"builtin"},number:[/\b0[xcb][\da-f](?:_*[\da-f])*\b/i,/(?:\b\d(?:_*\d)*)?\.(?:(?:\d(?:_*\d)*)?e[+-]?)?\d(?:_*\d)*\b|\b\d(?:_*\d)*\b\.?/i],punctuation:/:=|<<|>>|\(\||\|\)|->|\.(?=\w)|[{}[\];(),:?]/,operator:/\\\\|\|\.\.\||\.\.|\/[~\/=]?|[><]=?|[-+*^=~]/}}e.exports=t,t.displayName="eiffel",t.aliases=[]},20791(e,t,n){"use strict";var r=n(93205);function i(e){var t;e.register(r),(t=e).languages.ejs={delimiter:{pattern:/^<%[-_=]?|[-_]?%>$/,alias:"punctuation"},comment:/^#[\s\S]*/,"language-javascript":{pattern:/[\s\S]+/,inside:t.languages.javascript}},t.hooks.add("before-tokenize",function(e){var n=/<%(?!%)[\s\S]+?%>/g;t.languages["markup-templating"].buildPlaceholders(e,"ejs",n)}),t.hooks.add("after-tokenize",function(e){t.languages["markup-templating"].tokenizePlaceholders(e,"ejs")}),t.languages.eta=t.languages.ejs}e.exports=i,i.displayName="ejs",i.aliases=["eta"]},11974(e){"use strict";function t(e){e.languages.elixir={doc:{pattern:/@(?:doc|moduledoc)\s+(?:("""|''')[\s\S]*?\1|("|')(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2)/,inside:{attribute:/^@\w+/,string:/['"][\s\S]+/}},comment:{pattern:/#.*/m,greedy:!0},regex:{pattern:/~[rR](?:("""|''')(?:\\[\s\S]|(?!\1)[^\\])+\1|([\/|"'])(?:\\.|(?!\2)[^\\\r\n])+\2|\((?:\\.|[^\\)\r\n])+\)|\[(?:\\.|[^\\\]\r\n])+\]|\{(?:\\.|[^\\}\r\n])+\}|<(?:\\.|[^\\>\r\n])+>)[uismxfr]*/,greedy:!0},string:[{pattern:/~[cCsSwW](?:("""|''')(?:\\[\s\S]|(?!\1)[^\\])+\1|([\/|"'])(?:\\.|(?!\2)[^\\\r\n])+\2|\((?:\\.|[^\\)\r\n])+\)|\[(?:\\.|[^\\\]\r\n])+\]|\{(?:\\.|#\{[^}]+\}|#(?!\{)|[^#\\}\r\n])+\}|<(?:\\.|[^\\>\r\n])+>)[csa]?/,greedy:!0,inside:{}},{pattern:/("""|''')[\s\S]*?\1/,greedy:!0,inside:{}},{pattern:/("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0,inside:{}}],atom:{pattern:/(^|[^:]):\w+/,lookbehind:!0,alias:"symbol"},module:{pattern:/\b[A-Z]\w*\b/,alias:"class-name"},"attr-name":/\b\w+\??:(?!:)/,argument:{pattern:/(^|[^&])&\d+/,lookbehind:!0,alias:"variable"},attribute:{pattern:/@\w+/,alias:"variable"},function:/\b[_a-zA-Z]\w*[?!]?(?:(?=\s*(?:\.\s*)?\()|(?=\/\d))/,number:/\b(?:0[box][a-f\d_]+|\d[\d_]*)(?:\.[\d_]+)?(?:e[+-]?[\d_]+)?\b/i,keyword:/\b(?:after|alias|and|case|catch|cond|def(?:callback|delegate|exception|impl|macro|module|n|np|p|protocol|struct)?|do|else|end|fn|for|if|import|not|or|quote|raise|require|rescue|try|unless|unquote|use|when)\b/,boolean:/\b(?:true|false|nil)\b/,operator:[/\bin\b|&&?|\|[|>]?|\\\\|::|\.\.\.?|\+\+?|-[->]?|<[-=>]|>=|!==?|\B!|=(?:==?|[>~])?|[*\/^]/,{pattern:/([^<])<(?!<)/,lookbehind:!0},{pattern:/([^>])>(?!>)/,lookbehind:!0}],punctuation:/<<|>>|[.,%\[\]{}()]/},e.languages.elixir.string.forEach(function(t){t.inside={interpolation:{pattern:/#\{[^}]+\}/,inside:{delimiter:{pattern:/^#\{|\}$/,alias:"punctuation"},rest:e.languages.elixir}}}})}e.exports=t,t.displayName="elixir",t.aliases=[]},8645(e){"use strict";function t(e){e.languages.elm={comment:/--.*|\{-[\s\S]*?-\}/,char:{pattern:/'(?:[^\\'\r\n]|\\(?:[abfnrtv\\']|\d+|x[0-9a-fA-F]+))'/,greedy:!0},string:[{pattern:/"""[\s\S]*?"""/,greedy:!0},{pattern:/"(?:[^\\"\r\n]|\\.)*"/,greedy:!0}],"import-statement":{pattern:/(^[\t ]*)import\s+[A-Z]\w*(?:\.[A-Z]\w*)*(?:\s+as\s+(?:[A-Z]\w*)(?:\.[A-Z]\w*)*)?(?:\s+exposing\s+)?/m,lookbehind:!0,inside:{keyword:/\b(?:import|as|exposing)\b/}},keyword:/\b(?:alias|as|case|else|exposing|if|in|infixl|infixr|let|module|of|then|type)\b/,builtin:/\b(?:abs|acos|always|asin|atan|atan2|ceiling|clamp|compare|cos|curry|degrees|e|flip|floor|fromPolar|identity|isInfinite|isNaN|logBase|max|min|negate|never|not|pi|radians|rem|round|sin|sqrt|tan|toFloat|toPolar|toString|truncate|turns|uncurry|xor)\b/,number:/\b(?:\d+(?:\.\d+)?(?:e[+-]?\d+)?|0x[0-9a-f]+)\b/i,operator:/\s\.\s|[+\-/*=.$<>:&|^?%#@~!]{2,}|[+\-/*=$<>:&|^?%#@~!]/,hvariable:/\b(?:[A-Z]\w*\.)*[a-z]\w*\b/,constant:/\b(?:[A-Z]\w*\.)*[A-Z]\w*\b/,punctuation:/[{}[\]|(),.:]/}}e.exports=t,t.displayName="elm",t.aliases=[]},84790(e,t,n){"use strict";var r=n(56939),i=n(93205);function a(e){var t;e.register(r),e.register(i),(t=e).languages.erb=t.languages.extend("ruby",{}),t.languages.insertBefore("erb","comment",{delimiter:{pattern:/^<%=?|%>$/,alias:"punctuation"}}),t.hooks.add("before-tokenize",function(e){var n=/<%=?(?:[^\r\n]|[\r\n](?!=begin)|[\r\n]=begin\s(?:[^\r\n]|[\r\n](?!=end))*[\r\n]=end)+?%>/gm;t.languages["markup-templating"].buildPlaceholders(e,"erb",n)}),t.hooks.add("after-tokenize",function(e){t.languages["markup-templating"].tokenizePlaceholders(e,"erb")})}e.exports=a,a.displayName="erb",a.aliases=[]},4502(e){"use strict";function t(e){e.languages.erlang={comment:/%.+/,string:{pattern:/"(?:\\.|[^\\"\r\n])*"/,greedy:!0},"quoted-function":{pattern:/'(?:\\.|[^\\'\r\n])+'(?=\()/,alias:"function"},"quoted-atom":{pattern:/'(?:\\.|[^\\'\r\n])+'/,alias:"atom"},boolean:/\b(?:true|false)\b/,keyword:/\b(?:fun|when|case|of|end|if|receive|after|try|catch)\b/,number:[/\$\\?./,/\b\d+#[a-z0-9]+/i,/(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i],function:/\b[a-z][\w@]*(?=\()/,variable:{pattern:/(^|[^@])(?:\b|\?)[A-Z_][\w@]*/,lookbehind:!0},operator:[/[=\/<>:]=|=[:\/]=|\+\+?|--?|[=*\/!]|\b(?:bnot|div|rem|band|bor|bxor|bsl|bsr|not|and|or|xor|orelse|andalso)\b/,{pattern:/(^|[^<])<(?!<)/,lookbehind:!0},{pattern:/(^|[^>])>(?!>)/,lookbehind:!0}],atom:/\b[a-z][\w@]*/,punctuation:/[()[\]{}:;,.#|]|<<|>>/}}e.exports=t,t.displayName="erlang",t.aliases=[]},66055(e,t,n){"use strict";var r=n(59803),i=n(93205);function a(e){var t;e.register(r),e.register(i),(t=e).languages.etlua={delimiter:{pattern:/^<%[-=]?|-?%>$/,alias:"punctuation"},"language-lua":{pattern:/[\s\S]+/,inside:t.languages.lua}},t.hooks.add("before-tokenize",function(e){var n=/<%[\s\S]+?%>/g;t.languages["markup-templating"].buildPlaceholders(e,"etlua",n)}),t.hooks.add("after-tokenize",function(e){t.languages["markup-templating"].tokenizePlaceholders(e,"etlua")})}e.exports=a,a.displayName="etlua",a.aliases=[]},68876(e){"use strict";function t(e){e.languages["excel-formula"]={comment:{pattern:/(\bN\(\s*)"(?:[^"]|"")*"(?=\s*\))/i,lookbehind:!0,greedy:!0},string:{pattern:/"(?:[^"]|"")*"(?!")/,greedy:!0},reference:{pattern:/(?:'[^']*'|(?:[^\s()[\]{}<>*?"';,$&]*\[[^^\s()[\]{}<>*?"']+\])?\w+)!/,greedy:!0,alias:"string",inside:{operator:/!$/,punctuation:/'/,sheet:{pattern:/[^[\]]+$/,alias:"function"},file:{pattern:/\[[^[\]]+\]$/,inside:{punctuation:/[[\]]/}},path:/[\s\S]+/}},"function-name":{pattern:/\b[A-Z]\w*(?=\()/i,alias:"keyword"},range:{pattern:/\$?\b(?:[A-Z]+\$?\d+:\$?[A-Z]+\$?\d+|[A-Z]+:\$?[A-Z]+|\d+:\$?\d+)\b/i,alias:"property",inside:{operator:/:/,cell:/\$?[A-Z]+\$?\d+/i,column:/\$?[A-Z]+/i,row:/\$?\d+/}},cell:{pattern:/\b[A-Z]+\d+\b|\$[A-Za-z]+\$?\d+\b|\b[A-Za-z]+\$\d+\b/,alias:"property"},number:/(?:\b\d+(?:\.\d+)?|\B\.\d+)(?:e[+-]?\d+)?\b/i,boolean:/\b(?:TRUE|FALSE)\b/i,operator:/[-+*/^%=&,]|<[=>]?|>=?/,punctuation:/[[\]();{}|]/},e.languages.xlsx=e.languages.xls=e.languages["excel-formula"]}e.exports=t,t.displayName="excelFormula",t.aliases=[]},95126(e){"use strict";function t(e){var t,n,r,i,a,o,s,u;t=e,i={comment:[{pattern:/(^|\s)(?:! .*|!$)/,lookbehind:!0,inside:n={function:/\b(?:TODOS?|FIX(?:MES?)?|NOTES?|BUGS?|XX+|HACKS?|WARN(?:ING)?|\?{2,}|!{2,})\b/}},{pattern:/(^|\s)\/\*\s[\s\S]*?\*\/(?=\s|$)/,lookbehind:!0,greedy:!0,inside:n},{pattern:/(^|\s)!\[(={0,6})\[\s[\s\S]*?\]\2\](?=\s|$)/,lookbehind:!0,greedy:!0,inside:n}],number:[{pattern:/(^|\s)[+-]?\d+(?=\s|$)/,lookbehind:!0},{pattern:/(^|\s)[+-]?0(?:b[01]+|o[0-7]+|d\d+|x[\dA-F]+)(?=\s|$)/i,lookbehind:!0},{pattern:/(^|\s)[+-]?\d+\/\d+\.?(?=\s|$)/,lookbehind:!0},{pattern:/(^|\s)\+?\d+\+\d+\/\d+(?=\s|$)/,lookbehind:!0},{pattern:/(^|\s)-\d+-\d+\/\d+(?=\s|$)/,lookbehind:!0},{pattern:/(^|\s)[+-]?(?:\d*\.\d+|\d+\.\d*|\d+)(?:e[+-]?\d+)?(?=\s|$)/i,lookbehind:!0},{pattern:/(^|\s)NAN:\s+[\da-fA-F]+(?=\s|$)/,lookbehind:!0},{pattern:/(^|\s)[+-]?0(?:b1\.[01]*|o1\.[0-7]*|d1\.\d*|x1\.[\dA-F]*)p\d+(?=\s|$)/i,lookbehind:!0}],regexp:{pattern:/(^|\s)R\/\s(?:\\\S|[^\\/])*\/(?:[idmsr]*|[idmsr]+-[idmsr]+)(?=\s|$)/,lookbehind:!0,alias:"number",inside:{variable:/\\\S/,keyword:/[+?*\[\]^$(){}.|]/,operator:{pattern:/(\/)[idmsr]+(?:-[idmsr]+)?/,lookbehind:!0}}},boolean:{pattern:/(^|\s)[tf](?=\s|$)/,lookbehind:!0},"custom-string":{pattern:/(^|\s)[A-Z0-9\-]+"\s(?:\\\S|[^"\\])*"/,lookbehind:!0,greedy:!0,alias:"string",inside:{number:/\\\S|%\w|\//}},"multiline-string":[{pattern:/(^|\s)STRING:\s+\S+(?:\n|\r\n).*(?:\n|\r\n)\s*;(?=\s|$)/,lookbehind:!0,greedy:!0,alias:"string",inside:{number:(r={number:/\\[^\s']|%\w/}).number,"semicolon-or-setlocal":{pattern:/([\r\n][ \t]*);(?=\s|$)/,lookbehind:!0,alias:"function"}}},{pattern:/(^|\s)HEREDOC:\s+\S+(?:\n|\r\n).*(?:\n|\r\n)\s*\S+(?=\s|$)/,lookbehind:!0,greedy:!0,alias:"string",inside:r},{pattern:/(^|\s)\[(={0,6})\[\s[\s\S]*?\]\2\](?=\s|$)/,lookbehind:!0,greedy:!0,alias:"string",inside:r}],"special-using":{pattern:/(^|\s)USING:(?:\s\S+)*(?=\s+;(?:\s|$))/,lookbehind:!0,alias:"function",inside:{string:{pattern:/(\s)[^:\s]+/,lookbehind:!0}}},"stack-effect-delimiter":[{pattern:/(^|\s)(?:call|execute|eval)?\((?=\s)/,lookbehind:!0,alias:"operator"},{pattern:/(\s)--(?=\s)/,lookbehind:!0,alias:"operator"},{pattern:/(\s)\)(?=\s|$)/,lookbehind:!0,alias:"operator"}],combinators:{pattern:null,lookbehind:!0,alias:"keyword"},"kernel-builtin":{pattern:null,lookbehind:!0,alias:"variable"},"sequences-builtin":{pattern:null,lookbehind:!0,alias:"variable"},"math-builtin":{pattern:null,lookbehind:!0,alias:"variable"},"constructor-word":{pattern:/(^|\s)<(?!=+>|-+>)\S+>(?=\s|$)/,lookbehind:!0,alias:"keyword"},"other-builtin-syntax":{pattern:null,lookbehind:!0,alias:"operator"},"conventionally-named-word":{pattern:/(^|\s)(?!")(?:(?:set|change|with|new)-\S+|\$\S+|>[^>\s]+|[^:>\s]+>|[^>\s]+>[^>\s]+|\+[^+\s]+\+|[^?\s]+\?|\?[^?\s]+|[^>\s]+>>|>>[^>\s]+|[^<\s]+<<|\([^()\s]+\)|[^!\s]+!|[^*\s]\S*\*|[^.\s]\S*\.)(?=\s|$)/,lookbehind:!0,alias:"keyword"},"colon-syntax":{pattern:/(^|\s)(?:[A-Z0-9\-]+#?)?:{1,2}\s+(?:;\S+|(?!;)\S+)(?=\s|$)/,lookbehind:!0,greedy:!0,alias:"function"},"semicolon-or-setlocal":{pattern:/(\s)(?:;|:>)(?=\s|$)/,lookbehind:!0,alias:"function"},"curly-brace-literal-delimiter":[{pattern:/(^|\s)[a-z]*\{(?=\s)/i,lookbehind:!0,alias:"operator"},{pattern:/(\s)\}(?=\s|$)/,lookbehind:!0,alias:"operator"}],"quotation-delimiter":[{pattern:/(^|\s)\[(?=\s)/,lookbehind:!0,alias:"operator"},{pattern:/(\s)\](?=\s|$)/,lookbehind:!0,alias:"operator"}],"normal-word":{pattern:/(^|\s)[^"\s]\S*(?=\s|$)/,lookbehind:!0},string:{pattern:/"(?:\\\S|[^"\\])*"/,greedy:!0,inside:r}},a=function(e){return(e+"").replace(/([.?*+\^$\[\]\\(){}|\-])/g,"\\$1")},o=function(e){return RegExp("(^|\\s)(?:"+e.map(a).join("|")+")(?=\\s|$)")},Object.keys(s={"kernel-builtin":["or","2nipd","4drop","tuck","wrapper","nip","wrapper?","callstack>array","die","dupd","callstack","callstack?","3dup","hashcode","pick","4nip","build",">boolean","nipd","clone","5nip","eq?","?","=","swapd","2over","clear","2dup","get-retainstack","not","tuple?","dup","3nipd","call","-rotd","object","drop","assert=","assert?","-rot","execute","boa","get-callstack","curried?","3drop","pickd","overd","over","roll","3nip","swap","and","2nip","rotd","throw","(clone)","hashcode*","spin","reach","4dup","equal?","get-datastack","assert","2drop","","boolean?","identity-hashcode","identity-tuple?","null","composed?","new","5drop","rot","-roll","xor","identity-tuple","boolean"],"other-builtin-syntax":["=======","recursive","flushable",">>","<<<<<<","M\\","B","PRIVATE>","\\","======","final","inline","delimiter","deprecated",">>>>>","<<<<<<<","parse-complex","malformed-complex","read-only",">>>>>>>","call-next-method","<<","foldable","$","$[","${"],"sequences-builtin":["member-eq?","mismatch","append","assert-sequence=","longer","repetition","clone-like","3sequence","assert-sequence?","last-index-from","reversed","index-from","cut*","pad-tail","join-as","remove-eq!","concat-as","but-last","snip","nths","nth","sequence","longest","slice?","","remove-nth","tail-slice","empty?","tail*","member?","virtual-sequence?","set-length","drop-prefix","iota","unclip","bounds-error?","unclip-last-slice","non-negative-integer-expected","non-negative-integer-expected?","midpoint@","longer?","?set-nth","?first","rest-slice","prepend-as","prepend","fourth","sift","subseq-start","new-sequence","?last","like","first4","1sequence","reverse","slice","virtual@","repetition?","set-last","index","4sequence","max-length","set-second","immutable-sequence","first2","first3","supremum","unclip-slice","suffix!","insert-nth","tail","3append","short","suffix","concat","flip","immutable?","reverse!","2sequence","sum","delete-all","indices","snip-slice","","check-slice","sequence?","head","append-as","halves","sequence=","collapse-slice","?second","slice-error?","product","bounds-check?","bounds-check","immutable","virtual-exemplar","harvest","remove","pad-head","last","set-fourth","cartesian-product","remove-eq","shorten","shorter","reversed?","shorter?","shortest","head-slice","pop*","tail-slice*","but-last-slice","iota?","append!","cut-slice","new-resizable","head-slice*","sequence-hashcode","pop","set-nth","?nth","second","join","immutable-sequence?","","3append-as","virtual-sequence","subseq?","remove-nth!","length","last-index","lengthen","assert-sequence","copy","move","third","first","tail?","set-first","prefix","bounds-error","","exchange","surround","cut","min-length","set-third","push-all","head?","subseq-start-from","delete-slice","rest","sum-lengths","head*","infimum","remove!","glue","slice-error","subseq","push","replace-slice","subseq-as","unclip-last"],"math-builtin":["number=","next-power-of-2","?1+","fp-special?","imaginary-part","float>bits","number?","fp-infinity?","bignum?","fp-snan?","denominator","gcd","*","+","fp-bitwise=","-","u>=","/",">=","bitand","power-of-2?","log2-expects-positive","neg?","<","log2",">","integer?","number","bits>double","2/","zero?","bits>float","float?","shift","ratio?","rect>","even?","ratio","fp-sign","bitnot",">fixnum","complex?","/i","integer>fixnum","/f","sgn",">bignum","next-float","u<","u>","mod","recip","rational",">float","2^","integer","fixnum?","neg","fixnum","sq","bignum",">rect","bit?","fp-qnan?","simple-gcd","complex","","real",">fraction","double>bits","bitor","rem","fp-nan-payload","real-part","log2-expects-positive?","prev-float","align","unordered?","float","fp-nan?","abs","bitxor","integer>fixnum-strict","u<=","odd?","<=","/mod",">integer","real?","rational?","numerator"]}).forEach(function(e){i[e].pattern=o(s[e])}),u=["2bi","while","2tri","bi*","4dip","both?","same?","tri@","curry","prepose","3bi","?if","tri*","2keep","3keep","curried","2keepd","when","2bi*","2tri*","4keep","bi@","keepdd","do","unless*","tri-curry","if*","loop","bi-curry*","when*","2bi@","2tri@","with","2with","either?","bi","until","3dip","3curry","tri-curry*","tri-curry@","bi-curry","keepd","compose","2dip","if","3tri","unless","tuple","keep","2curry","tri","most","while*","dip","composed","bi-curry@","find-last-from","trim-head-slice","map-as","each-from","none?","trim-tail","partition","if-empty","accumulate*","reject!","find-from","accumulate-as","collector-for-as","reject","map","map-sum","accumulate!","2each-from","follow","supremum-by","map!","unless-empty","collector","padding","reduce-index","replicate-as","infimum-by","trim-tail-slice","count","find-index","filter","accumulate*!","reject-as","map-integers","map-find","reduce","selector","interleave","2map","filter-as","binary-reduce","map-index-as","find","produce","filter!","replicate","cartesian-map","cartesian-each","find-index-from","map-find-last","3map-as","3map","find-last","selector-as","2map-as","2map-reduce","accumulate","each","each-index","accumulate*-as","when-empty","all?","collector-as","push-either","new-like","collector-for","2selector","push-if","2all?","map-reduce","3each","any?","trim-slice","2reduce","change-nth","produce-as","2each","trim","trim-head","cartesian-find","map-index","if-zero","each-integer","unless-zero","(find-integer)","when-zero","find-last-integer","(all-integers?)","times","(each-integer)","find-integer","all-integers?","unless-negative","if-positive","when-positive","when-negative","unless-positive","if-negative","case","2cleave","cond>quot","case>quot","3cleave","wrong-values","to-fixed-point","alist>quot","cond","cleave","call-effect","recursive-hashcode","spread","deep-spread>quot","2||","0||","n||","0&&","2&&","3||","1||","1&&","n&&","3&&","smart-unless*","keep-inputs","reduce-outputs","smart-when*","cleave>array","smart-with","smart-apply","smart-if","inputs/outputs","output>sequence-n","map-outputs","map-reduce-outputs","dropping","output>array","smart-map-reduce","smart-2map-reduce","output>array-n","nullary","inputsequence"],i.combinators.pattern=o(u),t.languages.factor=i}e.exports=t,t.displayName="factor",t.aliases=[]},74644(e){"use strict";function t(e){var t;(t=e).languages.false={comment:{pattern:/\{[^}]*\}/},string:{pattern:/"[^"]*"/,greedy:!0},"character-code":{pattern:/'(?:[^\r]|\r\n?)/,alias:"number"},"assembler-code":{pattern:/\d+`/,alias:"important"},number:/\d+/,operator:/[-!#$%&'*+,./:;=>?@\\^_`|~ßø]/,punctuation:/\[|\]/,variable:/[a-z]/,"non-standard":{pattern:/[()!=]=?|[-+*/%]|\b(?:in|is)\b/}),delete e.languages["firestore-security-rules"]["class-name"],e.languages.insertBefore("firestore-security-rules","keyword",{path:{pattern:/(^|[\s(),])(?:\/(?:[\w\xA0-\uFFFF]+|\{[\w\xA0-\uFFFF]+(?:=\*\*)?\}|\$\([\w\xA0-\uFFFF.]+\)))+/,lookbehind:!0,greedy:!0,inside:{variable:{pattern:/\{[\w\xA0-\uFFFF]+(?:=\*\*)?\}|\$\([\w\xA0-\uFFFF.]+\)/,inside:{operator:/=/,keyword:/\*\*/,punctuation:/[.$(){}]/}},punctuation:/\//}},method:{pattern:/(\ballow\s+)[a-z]+(?:\s*,\s*[a-z]+)*(?=\s*[:;])/,lookbehind:!0,alias:"builtin",inside:{punctuation:/,/}}})}e.exports=t,t.displayName="firestoreSecurityRules",t.aliases=[]},37225(e){"use strict";function t(e){var t;(t=e).languages.flow=t.languages.extend("javascript",{}),t.languages.insertBefore("flow","keyword",{type:[{pattern:/\b(?:[Nn]umber|[Ss]tring|[Bb]oolean|Function|any|mixed|null|void)\b/,alias:"tag"}]}),t.languages.flow["function-variable"].pattern=/(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=\s*(?:function\b|(?:\([^()]*\)(?:\s*:\s*\w+)?|(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/i,delete t.languages.flow.parameter,t.languages.insertBefore("flow","operator",{"flow-punctuation":{pattern:/\{\||\|\}/,alias:"punctuation"}}),Array.isArray(t.languages.flow.keyword)||(t.languages.flow.keyword=[t.languages.flow.keyword]),t.languages.flow.keyword.unshift({pattern:/(^|[^$]\b)(?:type|opaque|declare|Class)\b(?!\$)/,lookbehind:!0},{pattern:/(^|[^$]\B)\$(?:await|Diff|Exact|Keys|ObjMap|PropertyType|Shape|Record|Supertype|Subtype|Enum)\b(?!\$)/,lookbehind:!0})}e.exports=t,t.displayName="flow",t.aliases=[]},16725(e){"use strict";function t(e){e.languages.fortran={"quoted-number":{pattern:/[BOZ](['"])[A-F0-9]+\1/i,alias:"number"},string:{pattern:/(?:\b\w+_)?(['"])(?:\1\1|&(?:\r\n?|\n)(?:[ \t]*!.*(?:\r\n?|\n)|(?![ \t]*!))|(?!\1).)*(?:\1|&)/,inside:{comment:{pattern:/(&(?:\r\n?|\n)\s*)!.*/,lookbehind:!0}}},comment:{pattern:/!.*/,greedy:!0},boolean:/\.(?:TRUE|FALSE)\.(?:_\w+)?/i,number:/(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[ED][+-]?\d+)?(?:_\w+)?/i,keyword:[/\b(?:INTEGER|REAL|DOUBLE ?PRECISION|COMPLEX|CHARACTER|LOGICAL)\b/i,/\b(?:END ?)?(?:BLOCK ?DATA|DO|FILE|FORALL|FUNCTION|IF|INTERFACE|MODULE(?! PROCEDURE)|PROGRAM|SELECT|SUBROUTINE|TYPE|WHERE)\b/i,/\b(?:ALLOCATABLE|ALLOCATE|BACKSPACE|CALL|CASE|CLOSE|COMMON|CONTAINS|CONTINUE|CYCLE|DATA|DEALLOCATE|DIMENSION|DO|END|EQUIVALENCE|EXIT|EXTERNAL|FORMAT|GO ?TO|IMPLICIT(?: NONE)?|INQUIRE|INTENT|INTRINSIC|MODULE PROCEDURE|NAMELIST|NULLIFY|OPEN|OPTIONAL|PARAMETER|POINTER|PRINT|PRIVATE|PUBLIC|READ|RETURN|REWIND|SAVE|SELECT|STOP|TARGET|WHILE|WRITE)\b/i,/\b(?:ASSIGNMENT|DEFAULT|ELEMENTAL|ELSE|ELSEWHERE|ELSEIF|ENTRY|IN|INCLUDE|INOUT|KIND|NULL|ONLY|OPERATOR|OUT|PURE|RECURSIVE|RESULT|SEQUENCE|STAT|THEN|USE)\b/i],operator:[/\*\*|\/\/|=>|[=\/]=|[<>]=?|::|[+\-*=%]|\.[A-Z]+\./i,{pattern:/(^|(?!\().)\/(?!\))/,lookbehind:!0}],punctuation:/\(\/|\/\)|[(),;:&]/}}e.exports=t,t.displayName="fortran",t.aliases=[]},95559(e){"use strict";function t(e){e.languages.fsharp=e.languages.extend("clike",{comment:[{pattern:/(^|[^\\])\(\*(?!\))[\s\S]*?\*\)/,lookbehind:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0}],string:{pattern:/(?:"""[\s\S]*?"""|@"(?:""|[^"])*"|"(?:\\[\s\S]|[^\\"])*")B?|'(?:[^\\']|\\(?:.|\d{3}|x[a-fA-F\d]{2}|u[a-fA-F\d]{4}|U[a-fA-F\d]{8}))'B?/,greedy:!0},"class-name":{pattern:/(\b(?:exception|inherit|interface|new|of|type)\s+|\w\s*:\s*|\s:\??>\s*)[.\w]+\b(?:\s*(?:->|\*)\s*[.\w]+\b)*(?!\s*[:.])/,lookbehind:!0,inside:{operator:/->|\*/,punctuation:/\./}},keyword:/\b(?:let|return|use|yield)(?:!\B|\b)|\b(?:abstract|and|as|assert|base|begin|class|default|delegate|do|done|downcast|downto|elif|else|end|exception|extern|false|finally|for|fun|function|global|if|in|inherit|inline|interface|internal|lazy|match|member|module|mutable|namespace|new|not|null|of|open|or|override|private|public|rec|select|static|struct|then|to|true|try|type|upcast|val|void|when|while|with|asr|land|lor|lsl|lsr|lxor|mod|sig|atomic|break|checked|component|const|constraint|constructor|continue|eager|event|external|fixed|functor|include|method|mixin|object|parallel|process|protected|pure|sealed|tailcall|trait|virtual|volatile)\b/,number:[/\b0x[\da-fA-F]+(?:un|lf|LF)?\b/,/\b0b[01]+(?:y|uy)?\b/,/(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[fm]|e[+-]?\d+)?\b/i,/\b\d+(?:[IlLsy]|u[lsy]?|UL)?\b/],operator:/([<>~&^])\1\1|([*.:<>&])\2|<-|->|[!=:]=|?|\??(?:<=|>=|<>|[-+*/%=<>])\??|[!?^&]|~[+~-]|:>|:\?>?/}),e.languages.insertBefore("fsharp","keyword",{preprocessor:{pattern:/(^[\t ]*)#.*/m,lookbehind:!0,alias:"property",inside:{directive:{pattern:/(^#)\b(?:else|endif|if|light|line|nowarn)\b/,lookbehind:!0,alias:"keyword"}}}}),e.languages.insertBefore("fsharp","punctuation",{"computation-expression":{pattern:/\b[_a-z]\w*(?=\s*\{)/i,alias:"keyword"}}),e.languages.insertBefore("fsharp","string",{annotation:{pattern:/\[<.+?>\]/,inside:{punctuation:/^\[<|>\]$/,"class-name":{pattern:/^\w+$|(^|;\s*)[A-Z]\w*(?=\()/,lookbehind:!0},"annotation-content":{pattern:/[\s\S]+/,inside:e.languages.fsharp}}}})}e.exports=t,t.displayName="fsharp",t.aliases=[]},82114(e,t,n){"use strict";var r=n(93205);function i(e){e.register(r),function(e){for(var t=/[^<()"']|\((?:)*\)|<(?!#--)|<#--(?:[^-]|-(?!->))*-->|"(?:[^\\"]|\\.)*"|'(?:[^\\']|\\.)*'/.source,n=0;n<2;n++)t=t.replace(//g,function(){return t});t=t.replace(//g,/[^\s\S]/.source);var r={comment:/<#--[\s\S]*?-->/,string:[{pattern:/\br("|')(?:(?!\1)[^\\]|\\.)*\1/,greedy:!0},{pattern:RegExp(/("|')(?:(?!\1|\$\{)[^\\]|\\.|\$\{(?:(?!\})(?:))*\})*\1/.source.replace(//g,function(){return t})),greedy:!0,inside:{interpolation:{pattern:RegExp(/((?:^|[^\\])(?:\\\\)*)\$\{(?:(?!\})(?:))*\}/.source.replace(//g,function(){return t})),lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:null}}}}],keyword:/\b(?:as)\b/,boolean:/\b(?:true|false)\b/,"builtin-function":{pattern:/((?:^|[^?])\?\s*)\w+/,lookbehind:!0,alias:"function"},function:/\b\w+(?=\s*\()/,number:/\b\d+(?:\.\d+)?\b/,operator:/\.\.[<*!]?|->|--|\+\+|&&|\|\||\?{1,2}|[-+*/%!=<>]=?|\b(?:gt|gte|lt|lte)\b/,punctuation:/[,;.:()[\]{}]/};r.string[1].inside.interpolation.inside.rest=r,e.languages.ftl={"ftl-comment":{pattern:/^<#--[\s\S]*/,alias:"comment"},"ftl-directive":{pattern:/^<[\s\S]+>$/,inside:{directive:{pattern:/(^<\/?)[#@][a-z]\w*/i,lookbehind:!0,alias:"keyword"},punctuation:/^<\/?|\/?>$/,content:{pattern:/\s*\S[\s\S]*/,alias:"ftl",inside:r}}},"ftl-interpolation":{pattern:/^\$\{[\s\S]*\}$/,inside:{punctuation:/^\$\{|\}$/,content:{pattern:/\s*\S[\s\S]*/,alias:"ftl",inside:r}}}},e.hooks.add("before-tokenize",function(n){var r=RegExp(/<#--[\s\S]*?-->|<\/?[#@][a-zA-Z](?:)*?>|\$\{(?:)*?\}/.source.replace(//g,function(){return t}),"gi");e.languages["markup-templating"].buildPlaceholders(n,"ftl",r)}),e.hooks.add("after-tokenize",function(t){e.languages["markup-templating"].tokenizePlaceholders(t,"ftl")})}(e)}e.exports=i,i.displayName="ftl",i.aliases=[]},12208(e){"use strict";function t(e){e.languages.gcode={comment:/;.*|\B\(.*?\)\B/,string:{pattern:/"(?:""|[^"])*"/,greedy:!0},keyword:/\b[GM]\d+(?:\.\d+)?\b/,property:/\b[A-Z]/,checksum:{pattern:/\*\d+/,alias:"punctuation"},punctuation:/:/}}e.exports=t,t.displayName="gcode",t.aliases=[]},62728(e){"use strict";function t(e){e.languages.gdscript={comment:/#.*/,string:{pattern:/@?(?:("|')(?:(?!\1)[^\n\\]|\\[\s\S])*\1(?!"|')|"""(?:[^\\]|\\[\s\S])*?""")/,greedy:!0},"class-name":{pattern:/(^(?:class_name|class|extends)[ \t]+|^export\([ \t]*|\bas[ \t]+|(?:\b(?:const|var)[ \t]|[,(])[ \t]*\w+[ \t]*:[ \t]*|->[ \t]*)[a-zA-Z_]\w*/m,lookbehind:!0},keyword:/\b(?:and|as|assert|break|breakpoint|class|class_name|const|continue|elif|else|enum|export|extends|for|func|if|in|is|master|mastersync|match|not|null|onready|or|pass|preload|puppet|puppetsync|remote|remotesync|return|self|setget|signal|static|tool|var|while|yield)\b/,function:/\b[a-z_]\w*(?=[ \t]*\()/i,variable:/\$\w+/,number:[/\b0b[01_]+\b|\b0x[\da-fA-F_]+\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.[\d_]+)(?:e[+-]?[\d_]+)?\b/,/\b(?:INF|NAN|PI|TAU)\b/],constant:/\b[A-Z][A-Z_\d]*\b/,boolean:/\b(?:false|true)\b/,operator:/->|:=|&&|\|\||<<|>>|[-+*/%&|!<>=]=?|[~^]/,punctuation:/[.:,;()[\]{}]/}}e.exports=t,t.displayName="gdscript",t.aliases=[]},81549(e){"use strict";function t(e){e.languages.gedcom={"line-value":{pattern:/(^[\t ]*\d+ +(?:@\w[\w!"$%&'()*+,\-./:;<=>?[\\\]^`{|}~\x80-\xfe #]*@ +)?\w+ ).+/m,lookbehind:!0,inside:{pointer:{pattern:/^@\w[\w!"$%&'()*+,\-./:;<=>?[\\\]^`{|}~\x80-\xfe #]*@$/,alias:"variable"}}},tag:{pattern:/(^[\t ]*\d+ +(?:@\w[\w!"$%&'()*+,\-./:;<=>?[\\\]^`{|}~\x80-\xfe #]*@ +)?)\w+/m,lookbehind:!0,alias:"string"},level:{pattern:/(^[\t ]*)\d+/m,lookbehind:!0,alias:"number"},pointer:{pattern:/@\w[\w!"$%&'()*+,\-./:;<=>?[\\\]^`{|}~\x80-\xfe #]*@/,alias:"variable"}}}e.exports=t,t.displayName="gedcom",t.aliases=[]},6024(e){"use strict";function t(e){var t,n;n=/(?:\r?\n|\r)[ \t]*\|.+\|(?:(?!\|).)*/.source,(t=e).languages.gherkin={pystring:{pattern:/("""|''')[\s\S]+?\1/,alias:"string"},comment:{pattern:/(^[ \t]*)#.*/m,lookbehind:!0},tag:{pattern:/(^[ \t]*)@\S*/m,lookbehind:!0},feature:{pattern:/((?:^|\r?\n|\r)[ \t]*)(?:Ability|Ahoy matey!|Arwedd|Aspekt|Besigheid Behoefte|Business Need|Caracteristica|Característica|Egenskab|Egenskap|Eiginleiki|Feature|Fīča|Fitur|Fonctionnalité|Fonksyonalite|Funcionalidade|Funcionalitat|Functionalitate|Funcţionalitate|Funcționalitate|Functionaliteit|Fungsi|Funkcia|Funkcija|Funkcionalitāte|Funkcionalnost|Funkcja|Funksie|Funktionalität|Funktionalitéit|Funzionalità|Hwaet|Hwæt|Jellemző|Karakteristik|laH|Lastnost|Mak|Mogucnost|Mogućnost|Moznosti|Možnosti|OH HAI|Omadus|Ominaisuus|Osobina|Özellik|perbogh|poQbogh malja'|Potrzeba biznesowa|Požadavek|Požiadavka|Pretty much|Qap|Qu'meH 'ut|Savybė|Tính năng|Trajto|Vermoë|Vlastnosť|Właściwość|Značilnost|Δυνατότητα|Λειτουργία|Могућност|Мөмкинлек|Особина|Свойство|Үзенчәлеклелек|Функционал|Функционалност|Функция|Функціонал|תכונה|خاصية|خصوصیت|صلاحیت|کاروبار کی ضرورت|وِیژگی|रूप लेख|ਖਾਸੀਅਤ|ਨਕਸ਼ ਨੁਹਾਰ|ਮੁਹਾਂਦਰਾ|గుణము|ಹೆಚ್ಚಳ|ความต้องการทางธุรกิจ|ความสามารถ|โครงหลัก|기능|フィーチャ|功能|機能):(?:[^:\r\n]+(?:\r?\n|\r|$))*/,lookbehind:!0,inside:{important:{pattern:/(:)[^\r\n]+/,lookbehind:!0},keyword:/[^:\r\n]+:/}},scenario:{pattern:/(^[ \t]*)(?:Abstract Scenario|Abstrakt Scenario|Achtergrond|Aer|Ær|Agtergrond|All y'all|Antecedentes|Antecedents|Atburðarás|Atburðarásir|Awww, look mate|B4|Background|Baggrund|Bakgrund|Bakgrunn|Bakgrunnur|Beispiele|Beispiller|Bối cảnh|Cefndir|Cenario|Cenário|Cenario de Fundo|Cenário de Fundo|Cenarios|Cenários|Contesto|Context|Contexte|Contexto|Conto|Contoh|Contone|Dæmi|Dasar|Dead men tell no tales|Delineacao do Cenario|Delineação do Cenário|Dis is what went down|Dữ liệu|Dyagram senaryo|Dyagram Senaryo|Egzanp|Ejemplos|Eksempler|Ekzemploj|Enghreifftiau|Esbozo do escenario|Escenari|Escenario|Esempi|Esquema de l'escenari|Esquema del escenario|Esquema do Cenario|Esquema do Cenário|Examples|EXAMPLZ|Exempel|Exemple|Exemples|Exemplos|First off|Fono|Forgatókönyv|Forgatókönyv vázlat|Fundo|Geçmiş|ghantoH|Grundlage|Hannergrond|Háttér|Heave to|Istorik|Juhtumid|Keadaan|Khung kịch bản|Khung tình huống|Kịch bản|Koncept|Konsep skenario|Kontèks|Kontekst|Kontekstas|Konteksts|Kontext|Konturo de la scenaro|Latar Belakang|lut|lut chovnatlh|lutmey|Lýsing Atburðarásar|Lýsing Dæma|Menggariskan Senario|MISHUN|MISHUN SRSLY|mo'|Náčrt Scenára|Náčrt Scénáře|Náčrt Scenáru|Oris scenarija|Örnekler|Osnova|Osnova Scenára|Osnova scénáře|Osnutek|Ozadje|Paraugs|Pavyzdžiai|Példák|Piemēri|Plan du scénario|Plan du Scénario|Plan senaryo|Plan Senaryo|Plang vum Szenario|Pozadí|Pozadie|Pozadina|Príklady|Příklady|Primer|Primeri|Primjeri|Przykłady|Raamstsenaarium|Reckon it's like|Rerefons|Scenár|Scénář|Scenarie|Scenarij|Scenarijai|Scenarijaus šablonas|Scenariji|Scenārijs|Scenārijs pēc parauga|Scenarijus|Scenario|Scénario|Scenario Amlinellol|Scenario Outline|Scenario Template|Scenariomal|Scenariomall|Scenarios|Scenariu|Scenariusz|Scenaro|Schema dello scenario|Se ðe|Se the|Se þe|Senario|Senaryo|Senaryo deskripsyon|Senaryo Deskripsyon|Senaryo taslağı|Shiver me timbers|Situācija|Situai|Situasie|Situasie Uiteensetting|Skenario|Skenario konsep|Skica|Structura scenariu|Structură scenariu|Struktura scenarija|Stsenaarium|Swa|Swa hwaer swa|Swa hwær swa|Szablon scenariusza|Szenario|Szenariogrundriss|Tapaukset|Tapaus|Tapausaihio|Taust|Tausta|Template Keadaan|Template Senario|Template Situai|The thing of it is|Tình huống|Variantai|Voorbeelde|Voorbeelden|Wharrimean is|Yo-ho-ho|You'll wanna|Założenia|Παραδείγματα|Περιγραφή Σεναρίου|Σενάρια|Σενάριο|Υπόβαθρο|Кереш|Контекст|Концепт|Мисаллар|Мисоллар|Основа|Передумова|Позадина|Предистория|Предыстория|Приклади|Пример|Примери|Примеры|Рамка на сценарий|Скица|Структура сценарија|Структура сценария|Структура сценарію|Сценарий|Сценарий структураси|Сценарийның төзелеше|Сценарији|Сценарио|Сценарій|Тарих|Үрнәкләр|דוגמאות|רקע|תבנית תרחיש|תרחיש|الخلفية|الگوی سناریو|امثلة|پس منظر|زمینه|سناریو|سيناريو|سيناريو مخطط|مثالیں|منظر نامے کا خاکہ|منظرنامہ|نمونه ها|उदाहरण|परिदृश्य|परिदृश्य रूपरेखा|पृष्ठभूमि|ਉਦਾਹਰਨਾਂ|ਪਟਕਥਾ|ਪਟਕਥਾ ਢਾਂਚਾ|ਪਟਕਥਾ ਰੂਪ ਰੇਖਾ|ਪਿਛੋਕੜ|ఉదాహరణలు|కథనం|నేపథ్యం|సన్నివేశం|ಉದಾಹರಣೆಗಳು|ಕಥಾಸಾರಾಂಶ|ವಿವರಣೆ|ಹಿನ್ನೆಲೆ|โครงสร้างของเหตุการณ์|ชุดของตัวอย่าง|ชุดของเหตุการณ์|แนวคิด|สรุปเหตุการณ์|เหตุการณ์|배경|시나리오|시나리오 개요|예|サンプル|シナリオ|シナリオアウトライン|シナリオテンプレ|シナリオテンプレート|テンプレ|例|例子|剧本|剧本大纲|劇本|劇本大綱|场景|场景大纲|場景|場景大綱|背景):[^:\r\n]*/m,lookbehind:!0,inside:{important:{pattern:/(:)[^\r\n]*/,lookbehind:!0},keyword:/[^:\r\n]+:/}},"table-body":{pattern:RegExp("("+n+")(?:"+n+")+"),lookbehind:!0,inside:{outline:{pattern:/<[^>]+>/,alias:"variable"},td:{pattern:/\s*[^\s|][^|]*/,alias:"string"},punctuation:/\|/}},"table-head":{pattern:RegExp(n),inside:{th:{pattern:/\s*[^\s|][^|]*/,alias:"variable"},punctuation:/\|/}},atrule:{pattern:/(^[ \t]+)(?:'ach|'a|'ej|7|a|A také|A taktiež|A tiež|A zároveň|Aber|Ac|Adott|Akkor|Ak|Aleshores|Ale|Ali|Allora|Alors|Als|Ama|Amennyiben|Amikor|Ampak|an|AN|Ananging|And y'all|And|Angenommen|Anrhegedig a|An|Apabila|Atès|Atesa|Atunci|Avast!|Aye|A|awer|Bagi|Banjur|Bet|Biết|Blimey!|Buh|But at the end of the day I reckon|But y'all|But|BUT|Cal|Când|Cando|Cand|Ce|Cuando|Če|Ða ðe|Ða|Dadas|Dada|Dados|Dado|DaH ghu' bejlu'|dann|Dann|Dano|Dan|Dar|Dat fiind|Data|Date fiind|Date|Dati fiind|Dati|Daţi fiind|Dați fiind|Dato|DEN|Den youse gotta|Dengan|De|Diberi|Diyelim ki|Donada|Donat|Donitaĵo|Do|Dun|Duota|Ðurh|Eeldades|Ef|Eğer ki|Entao|Então|Entón|Entonces|En|Epi|E|És|Etant donnée|Etant donné|Et|Étant données|Étant donnée|Étant donné|Etant données|Etant donnés|Étant donnés|Fakat|Gangway!|Gdy|Gegeben seien|Gegeben sei|Gegeven|Gegewe|ghu' noblu'|Gitt|Given y'all|Given|Givet|Givun|Ha|Cho|I CAN HAZ|In|Ir|It's just unbelievable|I|Ja|Jeśli|Jeżeli|Kadar|Kada|Kad|Kai|Kaj|Když|Keď|Kemudian|Ketika|Khi|Kiedy|Ko|Kuid|Kui|Kun|Lan|latlh|Le sa a|Let go and haul|Le|Lè sa a|Lè|Logo|Lorsqu'<|Lorsque|mä|Maar|Mais|Mając|Majd|Maka|Manawa|Mas|Ma|Menawa|Men|Mutta|Nalikaning|Nalika|Nanging|Når|När|Nato|Nhưng|Niin|Njuk|O zaman|Og|Och|Oletetaan|Onda|Ond|Oraz|Pak|Pero|Però|Podano|Pokiaľ|Pokud|Potem|Potom|Privzeto|Pryd|qaSDI'|Quando|Quand|Quan|Så|Sed|Se|Siis|Sipoze ke|Sipoze Ke|Sipoze|Si|Şi|Și|Soit|Stel|Tada|Tad|Takrat|Tak|Tapi|Ter|Tetapi|Tha the|Tha|Then y'all|Then|Thì|Thurh|Toda|Too right|ugeholl|Und|Un|Và|vaj|Vendar|Ve|wann|Wanneer|WEN|Wenn|When y'all|When|Wtedy|Wun|Y'know|Yeah nah|Yna|Youse know like when|Youse know when youse got|Y|Za predpokladu|Za předpokladu|Zadani|Zadano|Zadan|Zadate|Zadato|Zakładając|Zaradi|Zatati|Þa þe|Þa|Þá|Þegar|Þurh|Αλλά|Δεδομένου|Και|Όταν|Τότε|А також|Агар|Але|Али|Аммо|А|Әгәр|Әйтик|Әмма|Бирок|Ва|Вә|Дадено|Дано|Допустим|Если|Задате|Задати|Задато|И|І|К тому же|Када|Кад|Когато|Когда|Коли|Ләкин|Лекин|Нәтиҗәдә|Нехай|Но|Онда|Припустимо, що|Припустимо|Пусть|Также|Та|Тогда|Тоді|То|Унда|Һәм|Якщо|אבל|אזי|אז|בהינתן|וגם|כאשר|آنگاه|اذاً|اگر|اما|اور|با فرض|بالفرض|بفرض|پھر|تب|ثم|جب|عندما|فرض کیا|لكن|لیکن|متى|هنگامی|و|अगर|और|कदा|किन्तु|चूंकि|जब|तथा|तदा|तब|परन्तु|पर|यदि|ਅਤੇ|ਜਦੋਂ|ਜਿਵੇਂ ਕਿ|ਜੇਕਰ|ਤਦ|ਪਰ|అప్పుడు|ఈ పరిస్థితిలో|కాని|చెప్పబడినది|మరియు|ಆದರೆ|ನಂತರ|ನೀಡಿದ|ಮತ್ತು|ಸ್ಥಿತಿಯನ್ನು|กำหนดให้|ดังนั้น|แต่|เมื่อ|และ|그러면<|그리고<|단<|만약<|만일<|먼저<|조건<|하지만<|かつ<|しかし<|ただし<|ならば<|もし<|並且<|但し<|但是<|假如<|假定<|假設<|假设<|前提<|同时<|同時<|并且<|当<|當<|而且<|那么<|那麼<)(?=[ \t])/m,lookbehind:!0},string:{pattern:/"(?:\\.|[^"\\\r\n])*"|'(?:\\.|[^'\\\r\n])*'/,inside:{outline:{pattern:/<[^>]+>/,alias:"variable"}}},outline:{pattern:/<[^>]+>/,alias:"variable"}}}e.exports=t,t.displayName="gherkin",t.aliases=[]},13600(e){"use strict";function t(e){e.languages.git={comment:/^#.*/m,deleted:/^[-–].*/m,inserted:/^\+.*/m,string:/("|')(?:\\.|(?!\1)[^\\\r\n])*\1/m,command:{pattern:/^.*\$ git .*$/m,inside:{parameter:/\s--?\w+/m}},coord:/^@@.*@@$/m,"commit-sha1":/^commit \w{40}$/m}}e.exports=t,t.displayName="git",t.aliases=[]},3322(e,t,n){"use strict";var r=n(65806);function i(e){e.register(r),e.languages.glsl=e.languages.extend("c",{keyword:/\b(?:attribute|const|uniform|varying|buffer|shared|coherent|volatile|restrict|readonly|writeonly|atomic_uint|layout|centroid|flat|smooth|noperspective|patch|sample|break|continue|do|for|while|switch|case|default|if|else|subroutine|in|out|inout|float|double|int|void|bool|true|false|invariant|precise|discard|return|d?mat[234](?:x[234])?|[ibdu]?vec[234]|uint|lowp|mediump|highp|precision|[iu]?sampler[123]D|[iu]?samplerCube|sampler[12]DShadow|samplerCubeShadow|[iu]?sampler[12]DArray|sampler[12]DArrayShadow|[iu]?sampler2DRect|sampler2DRectShadow|[iu]?samplerBuffer|[iu]?sampler2DMS(?:Array)?|[iu]?samplerCubeArray|samplerCubeArrayShadow|[iu]?image[123]D|[iu]?image2DRect|[iu]?imageCube|[iu]?imageBuffer|[iu]?image[12]DArray|[iu]?imageCubeArray|[iu]?image2DMS(?:Array)?|struct|common|partition|active|asm|class|union|enum|typedef|template|this|resource|goto|inline|noinline|public|static|extern|external|interface|long|short|half|fixed|unsigned|superp|input|output|hvec[234]|fvec[234]|sampler3DRect|filter|sizeof|cast|namespace|using)\b/})}e.exports=i,i.displayName="glsl",i.aliases=[]},53877(e){"use strict";function t(e){e.languages.gamemakerlanguage=e.languages.gml=e.languages.extend("clike",{keyword:/\b(?:if|else|switch|case|default|break|for|repeat|while|do|until|continue|exit|return|globalvar|var|enum)\b/,number:/(?:\b0x[\da-f]+|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ulf]{0,4}/i,operator:/[-+%=]=?|!=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]|\b(?:or|and|not|with|at|xor)\b/,constant:/\b(?:self|other|all|noone|global|local|undefined|pointer_(?:invalid|null)|action_(?:stop|restart|continue|reverse)|pi|GM_build_date|GM_version|timezone_(?:local|utc)|gamespeed_(?:fps|microseconds)|ev_(?:create|destroy|step|alarm|keyboard|mouse|collision|other|draw|draw_(?:begin|end|pre|post)|keypress|keyrelease|trigger|(?:left|right|middle|no)_button|(?:left|right|middle)_press|(?:left|right|middle)_release|mouse_(?:enter|leave|wheel_up|wheel_down)|global_(?:left|right|middle)_button|global_(?:left|right|middle)_press|global_(?:left|right|middle)_release|joystick(?:1|2)_(?:left|right|up|down|button1|button2|button3|button4|button5|button6|button7|button8)|outside|boundary|game_start|game_end|room_start|room_end|no_more_lives|animation_end|end_of_path|no_more_health|user\d|step_(?:normal|begin|end)|gui|gui_begin|gui_end)|vk_(?:nokey|anykey|enter|return|shift|control|alt|escape|space|backspace|tab|pause|printscreen|left|right|up|down|home|end|delete|insert|pageup|pagedown|f\d|numpad\d|divide|multiply|subtract|add|decimal|lshift|lcontrol|lalt|rshift|rcontrol|ralt)|mb_(?:any|none|left|right|middle)|c_(?:aqua|black|blue|dkgray|fuchsia|gray|green|lime|ltgray|maroon|navy|olive|purple|red|silver|teal|white|yellow|orange)|fa_(?:left|center|right|top|middle|bottom|readonly|hidden|sysfile|volumeid|directory|archive)|pr_(?:pointlist|linelist|linestrip|trianglelist|trianglestrip|trianglefan)|bm_(?:complex|normal|add|max|subtract|zero|one|src_colour|inv_src_colour|src_color|inv_src_color|src_alpha|inv_src_alpha|dest_alpha|inv_dest_alpha|dest_colour|inv_dest_colour|dest_color|inv_dest_color|src_alpha_sat)|audio_(?:falloff_(?:none|inverse_distance|inverse_distance_clamped|linear_distance|linear_distance_clamped|exponent_distance|exponent_distance_clamped)|old_system|new_system|mono|stereo|3d)|cr_(?:default|none|arrow|cross|beam|size_nesw|size_ns|size_nwse|size_we|uparrow|hourglass|drag|appstart|handpoint|size_all)|asset_(?:object|unknown|sprite|sound|room|path|script|font|timeline|tiles|shader)|ds_type_(?:map|list|stack|queue|grid|priority)|ef_(?:explosion|ring|ellipse|firework|smoke|smokeup|star|spark|flare|cloud|rain|snow)|pt_shape_(?:pixel|disk|square|line|star|circle|ring|sphere|flare|spark|explosion|cloud|smoke|snow)|ps_(?:distr|shape)_(?:linear|gaussian|invgaussian|rectangle|ellipse|diamond|line)|ty_(?:real|string)|dll_(?:cdel|cdecl|stdcall)|matrix_(?:view|projection|world)|os_(?:win32|windows|macosx|ios|android|linux|unknown|winphone|win8native|psvita|ps4|xboxone|ps3|uwp)|browser_(?:not_a_browser|unknown|ie|firefox|chrome|safari|safari_mobile|opera|tizen|windows_store|ie_mobile)|device_ios_(?:unknown|iphone|iphone_retina|ipad|ipad_retina|iphone5|iphone6|iphone6plus)|device_(?:emulator|tablet)|display_(?:landscape|landscape_flipped|portrait|portrait_flipped)|of_challenge_(?:win|lose|tie)|leaderboard_type_(?:number|time_mins_secs)|cmpfunc_(?:never|less|equal|lessequal|greater|notequal|greaterequal|always)|cull_(?:noculling|clockwise|counterclockwise)|lighttype_(?:dir|point)|iap_(?:ev_storeload|ev_product|ev_purchase|ev_consume|ev_restore|storeload_ok|storeload_failed|status_uninitialised|status_unavailable|status_loading|status_available|status_processing|status_restoring|failed|unavailable|available|purchased|canceled|refunded)|fb_login_(?:default|fallback_to_webview|no_fallback_to_webview|forcing_webview|use_system_account|forcing_safari)|phy_joint_(?:anchor_1_x|anchor_1_y|anchor_2_x|anchor_2_y|reaction_force_x|reaction_force_y|reaction_torque|motor_speed|angle|motor_torque|max_motor_torque|translation|speed|motor_force|max_motor_force|length_1|length_2|damping_ratio|frequency|lower_angle_limit|upper_angle_limit|angle_limits|max_length|max_torque|max_force)|phy_debug_render_(?:aabb|collision_pairs|coms|core_shapes|joints|obb|shapes)|phy_particle_flag_(?:water|zombie|wall|spring|elastic|viscous|powder|tensile|colourmixing|colormixing)|phy_particle_group_flag_(?:solid|rigid)|phy_particle_data_flag_(?:typeflags|position|velocity|colour|color|category)|achievement_(?:our_info|friends_info|leaderboard_info|info|filter_(?:all_players|friends_only|favorites_only)|type_challenge|type_score_challenge|pic_loaded|show_(?:ui|profile|leaderboard|achievement|bank|friend_picker|purchase_prompt))|network_(?:socket_(?:tcp|udp|bluetooth)|type_(?:connect|disconnect|data|non_blocking_connect)|config_(?:connect_timeout|use_non_blocking_socket|enable_reliable_udp|disable_reliable_udp))|buffer_(?:fixed|grow|wrap|fast|vbuffer|network|u8|s8|u16|s16|u32|s32|u64|f16|f32|f64|bool|text|string|seek_start|seek_relative|seek_end|generalerror|outofspace|outofbounds|invalidtype)|gp_(?:face\d|shoulderl|shoulderr|shoulderlb|shoulderrb|select|start|stickl|stickr|padu|padd|padl|padr|axislh|axislv|axisrh|axisrv)|ov_(?:friends|community|players|settings|gamegroup|achievements)|lb_sort_(?:none|ascending|descending)|lb_disp_(?:none|numeric|time_sec|time_ms)|ugc_(?:result_success|filetype_(?:community|microtrans)|visibility_(?:public|friends_only|private)|query_RankedBy(?:Vote|PublicationDate|Trend|NumTimesReported|TotalVotesAsc|VotesUp|TextSearch)|query_(?:AcceptedForGameRankedByAcceptanceDate|FavoritedByFriendsRankedByPublicationDate|CreatedByFriendsRankedByPublicationDate|NotYetRated)|sortorder_CreationOrder(?:Desc|Asc)|sortorder_(?:TitleAsc|LastUpdatedDesc|SubscriptionDateDesc|VoteScoreDesc|ForModeration)|list_(?:Published|VotedOn|VotedUp|VotedDown|WillVoteLater|Favorited|Subscribed|UsedOrPlayed|Followed)|match_(?:Items|Items_Mtx|Items_ReadyToUse|Collections|Artwork|Videos|Screenshots|AllGuides|WebGuides|IntegratedGuides|UsableInGame|ControllerBindings))|vertex_usage_(?:position|colour|color|normal|texcoord|textcoord|blendweight|blendindices|psize|tangent|binormal|fog|depth|sample)|vertex_type_(?:float\d|colour|color|ubyte4)|layerelementtype_(?:undefined|background|instance|oldtilemap|sprite|tilemap|particlesystem|tile)|tile_(?:rotate|flip|mirror|index_mask)|input_type|se_(?:chorus|compressor|echo|equalizer|flanger|gargle|none|reverb)|text_type|(?:obj|scr|spr|rm)\w+)\b/,variable:/\b(?:x|y|(?:x|y)(?:previous|start)|(?:h|v)speed|direction|speed|friction|gravity|gravity_direction|path_(?:index|position|positionprevious|speed|scale|orientation|endaction)|object_index|id|solid|persistent|mask_index|instance_(?:count|id)|alarm|timeline_(?:index|position|speed|running|loop)|visible|sprite_(?:index|width|height|xoffset|yoffset)|image_(?:number|index|speed|depth|xscale|yscale|angle|alpha|blend)|bbox_(?:left|right|top|bottom)|layer|phy_(?:rotation|(?:position|linear_velocity|speed|com|collision|col_normal)_(?:x|y)|angular_(?:velocity|damping)|position_(?:x|y)previous|speed|linear_damping|bullet|fixed_rotation|active|mass|inertia|dynamic|kinematic|sleeping|collision_points)|working_directory|webgl_enabled|view_(?:(?:y|x|w|h)view|(?:y|x|w|h)port|(?:v|h)(?:speed|border)|visible|surface_id|object|enabled|current|angle)|undefined|transition_(?:steps|kind|color)|temp_directory|show_(?:score|lives|health)|secure_mode|score|room_(?:width|speed|persistent|last|height|first|caption)|room|pointer_(?:null|invalid)|os_(?:version|type|device|browser)|mouse_(?:y|x|lastbutton|button)|lives|keyboard_(?:string|lastkey|lastchar|key)|iap_data|health|gamemaker_(?:version|registered|pro)|game_(?:save|project|display)_(?:id|name)|fps_real|fps|event_(?:type|object|number|action)|error_(?:occurred|last)|display_aa|delta_time|debug_mode|cursor_sprite|current_(?:year|weekday|time|second|month|minute|hour|day)|caption_(?:score|lives|health)|browser_(?:width|height)|background_(?:yscale|y|xscale|x|width|vtiled|vspeed|visible|showcolour|showcolor|index|htiled|hspeed|height|foreground|colour|color|blend|alpha)|async_load|application_surface|argument(?:_relitive|_count|\d)|argument|global|local|self|other)\b/})}e.exports=t,t.displayName="gml",t.aliases=[]},51519(e){"use strict";function t(e){e.languages.go=e.languages.extend("clike",{string:{pattern:/(["'`])(?:\\[\s\S]|(?!\1)[^\\])*\1/,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|iota|nil|true|false)\b/,number:/(?:\b0x[a-f\d]+|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[-+]?\d+)?)i?/i,operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:bool|byte|complex(?:64|128)|error|float(?:32|64)|rune|string|u?int(?:8|16|32|64)?|uintptr|append|cap|close|complex|copy|delete|imag|len|make|new|panic|print(?:ln)?|real|recover)\b/}),delete e.languages.go["class-name"]}e.exports=t,t.displayName="go",t.aliases=[]},94055(e){"use strict";function t(e){e.languages.graphql={comment:/#.*/,description:{pattern:/(?:"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*")(?=\s*[a-z_])/i,greedy:!0,alias:"string",inside:{"language-markdown":{pattern:/(^"(?:"")?)(?!\1)[\s\S]+(?=\1$)/,lookbehind:!0,inside:e.languages.markdown}}},string:{pattern:/"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*"/,greedy:!0},number:/(?:\B-|\b)\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,boolean:/\b(?:true|false)\b/,variable:/\$[a-z_]\w*/i,directive:{pattern:/@[a-z_]\w*/i,alias:"function"},"attr-name":{pattern:/[a-z_]\w*(?=\s*(?:\((?:[^()"]|"(?:\\.|[^\\"\r\n])*")*\))?:)/i,greedy:!0},"atom-input":{pattern:/[A-Z]\w*Input(?=!?.*$)/m,alias:"class-name"},scalar:/\b(?:Boolean|Float|ID|Int|String)\b/,constant:/\b[A-Z][A-Z_\d]*\b/,"class-name":{pattern:/(\b(?:enum|implements|interface|on|scalar|type|union)\s+|&\s*|:\s*|\[)[A-Z_]\w*/,lookbehind:!0},fragment:{pattern:/(\bfragment\s+|\.{3}\s*(?!on\b))[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},"definition-mutation":{pattern:/(\bmutation\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},"definition-query":{pattern:/(\bquery\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},keyword:/\b(?:directive|enum|extend|fragment|implements|input|interface|mutation|on|query|repeatable|scalar|schema|subscription|type|union)\b/,operator:/[!=|&]|\.{3}/,"property-query":/\w+(?=\s*\()/,object:/\w+(?=\s*\{)/,punctuation:/[!(){}\[\]:=,]/,property:/\w+/},e.hooks.add("after-tokenize",function(e){if("graphql"===e.language){for(var t=e.tokens.filter(function(e){return"string"!=typeof e&&"comment"!==e.type&&"scalar"!==e.type}),n=0;n0)){var s=d(/^\{$/,/^\}$/);if(-1===s)continue;for(var u=n;u=0&&h(c,"variable-input")}}}}}function l(e){return t[n+e]}function f(e,t){t=t||0;for(var n=0;n]?|\+[+=]?|!=?|<(?:<=?|=>?)?|>(?:>>?=?|=)?|&[&=]?|\|[|=]?|\/=?|\^=?|%=?)/,lookbehind:!0},punctuation:/\.+|[{}[\];(),:$]/}),e.languages.insertBefore("groovy","string",{shebang:{pattern:/#!.+/,alias:"comment"}}),e.languages.insertBefore("groovy","punctuation",{"spock-block":/\b(?:setup|given|when|then|and|cleanup|expect|where):/}),e.languages.insertBefore("groovy","function",{annotation:{pattern:/(^|[^.])@\w+/,lookbehind:!0,alias:"punctuation"}}),e.hooks.add("wrap",function(t){if("groovy"===t.language&&"string"===t.type){var n=t.content.value[0];if("'"!=n){var r=/([^\\])(?:\$(?:\{.*?\}|[\w.]+))/;"$"===n&&(r=/([^\$])(?:\$(?:\{.*?\}|[\w.]+))/),t.content.value=t.content.value.replace(/</g,"<").replace(/&/g,"&"),t.content=e.highlight(t.content.value,{expression:{pattern:r,lookbehind:!0,inside:e.languages.groovy}}),t.classes.push("/"===n?"regex":"gstring")}}})}e.exports=t,t.displayName="groovy",t.aliases=[]},29536(e,t,n){"use strict";var r=n(56939);function i(e){e.register(r),function(e){e.languages.haml={"multiline-comment":{pattern:/((?:^|\r?\n|\r)([\t ]*))(?:\/|-#).*(?:(?:\r?\n|\r)\2[\t ].+)*/,lookbehind:!0,alias:"comment"},"multiline-code":[{pattern:/((?:^|\r?\n|\r)([\t ]*)(?:[~-]|[&!]?=)).*,[\t ]*(?:(?:\r?\n|\r)\2[\t ].*,[\t ]*)*(?:(?:\r?\n|\r)\2[\t ].+)/,lookbehind:!0,inside:e.languages.ruby},{pattern:/((?:^|\r?\n|\r)([\t ]*)(?:[~-]|[&!]?=)).*\|[\t ]*(?:(?:\r?\n|\r)\2[\t ].*\|[\t ]*)*/,lookbehind:!0,inside:e.languages.ruby}],filter:{pattern:/((?:^|\r?\n|\r)([\t ]*)):[\w-]+(?:(?:\r?\n|\r)(?:\2[\t ].+|\s*?(?=\r?\n|\r)))+/,lookbehind:!0,inside:{"filter-name":{pattern:/^:[\w-]+/,alias:"variable"}}},markup:{pattern:/((?:^|\r?\n|\r)[\t ]*)<.+/,lookbehind:!0,inside:e.languages.markup},doctype:{pattern:/((?:^|\r?\n|\r)[\t ]*)!!!(?: .+)?/,lookbehind:!0},tag:{pattern:/((?:^|\r?\n|\r)[\t ]*)[%.#][\w\-#.]*[\w\-](?:\([^)]+\)|\{(?:\{[^}]+\}|[^{}])+\}|\[[^\]]+\])*[\/<>]*/,lookbehind:!0,inside:{attributes:[{pattern:/(^|[^#])\{(?:\{[^}]+\}|[^{}])+\}/,lookbehind:!0,inside:e.languages.ruby},{pattern:/\([^)]+\)/,inside:{"attr-value":{pattern:/(=\s*)(?:"(?:\\.|[^\\"\r\n])*"|[^)\s]+)/,lookbehind:!0},"attr-name":/[\w:-]+(?=\s*!?=|\s*[,)])/,punctuation:/[=(),]/}},{pattern:/\[[^\]]+\]/,inside:e.languages.ruby}],punctuation:/[<>]/}},code:{pattern:/((?:^|\r?\n|\r)[\t ]*(?:[~-]|[&!]?=)).+/,lookbehind:!0,inside:e.languages.ruby},interpolation:{pattern:/#\{[^}]+\}/,inside:{delimiter:{pattern:/^#\{|\}$/,alias:"punctuation"},rest:e.languages.ruby}},punctuation:{pattern:/((?:^|\r?\n|\r)[\t ]*)[~=\-&!]+/,lookbehind:!0}};for(var t="((?:^|\\r?\\n|\\r)([\\t ]*)):{{filter_name}}(?:(?:\\r?\\n|\\r)(?:\\2[\\t ].+|\\s*?(?=\\r?\\n|\\r)))+",n=["css",{filter:"coffee",language:"coffeescript"},"erb","javascript","less","markdown","ruby","scss","textile"],r={},i=0,a=n.length;i@\[\\\]^`{|}~]/,variable:/[^!"#%&'()*+,\/;<=>@\[\\\]^`{|}~\s]+/},t.hooks.add("before-tokenize",function(e){var n=/\{\{\{[\s\S]+?\}\}\}|\{\{[\s\S]+?\}\}/g;t.languages["markup-templating"].buildPlaceholders(e,"handlebars",n)}),t.hooks.add("after-tokenize",function(e){t.languages["markup-templating"].tokenizePlaceholders(e,"handlebars")}),t.languages.hbs=t.languages.handlebars}e.exports=i,i.displayName="handlebars",i.aliases=["hbs"]},58090(e){"use strict";function t(e){e.languages.haskell={comment:{pattern:/(^|[^-!#$%*+=?&@|~.:<>^\\\/])(?:--(?:(?=.)[^-!#$%*+=?&@|~.:<>^\\\/].*|$)|\{-[\s\S]*?-\})/m,lookbehind:!0},char:{pattern:/'(?:[^\\']|\\(?:[abfnrtv\\"'&]|\^[A-Z@[\]^_]|NUL|SOH|STX|ETX|EOT|ENQ|ACK|BEL|BS|HT|LF|VT|FF|CR|SO|SI|DLE|DC1|DC2|DC3|DC4|NAK|SYN|ETB|CAN|EM|SUB|ESC|FS|GS|RS|US|SP|DEL|\d+|o[0-7]+|x[0-9a-fA-F]+))'/,alias:"string"},string:{pattern:/"(?:[^\\"]|\\(?:\S|\s+\\))*"/,greedy:!0},keyword:/\b(?:case|class|data|deriving|do|else|if|in|infixl|infixr|instance|let|module|newtype|of|primitive|then|type|where)\b/,"import-statement":{pattern:/(^[\t ]*)import\s+(?:qualified\s+)?(?:[A-Z][\w']*)(?:\.[A-Z][\w']*)*(?:\s+as\s+(?:[A-Z][\w']*)(?:\.[A-Z][\w']*)*)?(?:\s+hiding\b)?/m,lookbehind:!0,inside:{keyword:/\b(?:import|qualified|as|hiding)\b/}},builtin:/\b(?:abs|acos|acosh|all|and|any|appendFile|approxRational|asTypeOf|asin|asinh|atan|atan2|atanh|basicIORun|break|catch|ceiling|chr|compare|concat|concatMap|const|cos|cosh|curry|cycle|decodeFloat|denominator|digitToInt|div|divMod|drop|dropWhile|either|elem|encodeFloat|enumFrom|enumFromThen|enumFromThenTo|enumFromTo|error|even|exp|exponent|fail|filter|flip|floatDigits|floatRadix|floatRange|floor|fmap|foldl|foldl1|foldr|foldr1|fromDouble|fromEnum|fromInt|fromInteger|fromIntegral|fromRational|fst|gcd|getChar|getContents|getLine|group|head|id|inRange|index|init|intToDigit|interact|ioError|isAlpha|isAlphaNum|isAscii|isControl|isDenormalized|isDigit|isHexDigit|isIEEE|isInfinite|isLower|isNaN|isNegativeZero|isOctDigit|isPrint|isSpace|isUpper|iterate|last|lcm|length|lex|lexDigits|lexLitChar|lines|log|logBase|lookup|map|mapM|mapM_|max|maxBound|maximum|maybe|min|minBound|minimum|mod|negate|not|notElem|null|numerator|odd|or|ord|otherwise|pack|pi|pred|primExitWith|print|product|properFraction|putChar|putStr|putStrLn|quot|quotRem|range|rangeSize|read|readDec|readFile|readFloat|readHex|readIO|readInt|readList|readLitChar|readLn|readOct|readParen|readSigned|reads|readsPrec|realToFrac|recip|rem|repeat|replicate|return|reverse|round|scaleFloat|scanl|scanl1|scanr|scanr1|seq|sequence|sequence_|show|showChar|showInt|showList|showLitChar|showParen|showSigned|showString|shows|showsPrec|significand|signum|sin|sinh|snd|sort|span|splitAt|sqrt|subtract|succ|sum|tail|take|takeWhile|tan|tanh|threadToIOResult|toEnum|toInt|toInteger|toLower|toRational|toUpper|truncate|uncurry|undefined|unlines|until|unwords|unzip|unzip3|userError|words|writeFile|zip|zip3|zipWith|zipWith3)\b/,number:/\b(?:\d+(?:\.\d+)?(?:e[+-]?\d+)?|0o[0-7]+|0x[0-9a-f]+)\b/i,operator:/\s\.\s|[-!#$%*+=?&@|~:<>^\\\/]*\.[-!#$%*+=?&@|~.:<>^\\\/]+|[-!#$%*+=?&@|~.:<>^\\\/]+\.[-!#$%*+=?&@|~:<>^\\\/]*|[-!#$%*+=?&@|~:<>^\\\/]+|`(?:[A-Z][\w']*\.)*[_a-z][\w']*`/,hvariable:/\b(?:[A-Z][\w']*\.)*[_a-z][\w']*\b/,constant:/\b(?:[A-Z][\w']*\.)*[A-Z][\w']*\b/,punctuation:/[{}[\];(),.:]/},e.languages.hs=e.languages.haskell}e.exports=t,t.displayName="haskell",t.aliases=["hs"]},95121(e){"use strict";function t(e){e.languages.haxe=e.languages.extend("clike",{string:{pattern:/(["'])(?:(?!\1)[^\\]|\\[\s\S])*\1/,greedy:!0,inside:{interpolation:{pattern:/(^|[^\\])\$(?:\w+|\{[^}]+\})/,lookbehind:!0,inside:{interpolation:{pattern:/^\$\w*/,alias:"variable"}}}}},keyword:/\bthis\b|\b(?:abstract|as|break|case|cast|catch|class|continue|default|do|dynamic|else|enum|extends|extern|from|for|function|if|implements|import|in|inline|interface|macro|new|null|override|public|private|return|static|super|switch|throw|to|try|typedef|using|var|while)(?!\.)\b/,operator:/\.{3}|\+\+?|-[->]?|[=!]=?|&&?|\|\|?|<[<=]?|>[>=]?|[*\/%~^]/}),e.languages.insertBefore("haxe","class-name",{regex:{pattern:/~\/(?:[^\/\\\r\n]|\\.)+\/[igmsu]*/,greedy:!0}}),e.languages.insertBefore("haxe","keyword",{preprocessor:{pattern:/#\w+/,alias:"builtin"},metadata:{pattern:/@:?\w+/,alias:"symbol"},reification:{pattern:/\$(?:\w+|(?=\{))/,alias:"variable"}}),e.languages.haxe.string.inside.interpolation.inside.rest=e.languages.haxe,delete e.languages.haxe["class-name"]}e.exports=t,t.displayName="haxe",t.aliases=[]},59904(e){"use strict";function t(e){e.languages.hcl={comment:/(?:\/\/|#).*|\/\*[\s\S]*?(?:\*\/|$)/,heredoc:{pattern:/<<-?(\w+\b)[\s\S]*?^[ \t]*\1/m,greedy:!0,alias:"string"},keyword:[{pattern:/(?:resource|data)\s+(?:"(?:\\[\s\S]|[^\\"])*")(?=\s+"[\w-]+"\s+\{)/i,inside:{type:{pattern:/(resource|data|\s+)(?:"(?:\\[\s\S]|[^\\"])*")/i,lookbehind:!0,alias:"variable"}}},{pattern:/(?:provider|provisioner|variable|output|module|backend)\s+(?:[\w-]+|"(?:\\[\s\S]|[^\\"])*")\s+(?=\{)/i,inside:{type:{pattern:/(provider|provisioner|variable|output|module|backend)\s+(?:[\w-]+|"(?:\\[\s\S]|[^\\"])*")\s+/i,lookbehind:!0,alias:"variable"}}},/[\w-]+(?=\s+\{)/],property:[/[-\w\.]+(?=\s*=(?!=))/,/"(?:\\[\s\S]|[^\\"])+"(?=\s*[:=])/],string:{pattern:/"(?:[^\\$"]|\\[\s\S]|\$(?:(?=")|\$+(?!\$)|[^"${])|\$\{(?:[^{}"]|"(?:[^\\"]|\\[\s\S])*")*\})*"/,greedy:!0,inside:{interpolation:{pattern:/(^|[^$])\$\{(?:[^{}"]|"(?:[^\\"]|\\[\s\S])*")*\}/,lookbehind:!0,inside:{type:{pattern:/(\b(?:terraform|var|self|count|module|path|data|local)\b\.)[\w\*]+/i,lookbehind:!0,alias:"variable"},keyword:/\b(?:terraform|var|self|count|module|path|data|local)\b/i,function:/\w+(?=\()/,string:{pattern:/"(?:\\[\s\S]|[^\\"])*"/,greedy:!0},number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?(?:e[+-]?\d+)?/i,punctuation:/[!\$#%&'()*+,.\/;<=>@\[\\\]^`{|}~?:]/}}}},number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?(?:e[+-]?\d+)?/i,boolean:/\b(?:true|false)\b/i,punctuation:/[=\[\]{}]/}}e.exports=t,t.displayName="hcl",t.aliases=[]},9436(e,t,n){"use strict";var r=n(65806);function i(e){e.register(r),e.languages.hlsl=e.languages.extend("c",{"class-name":[e.languages.c["class-name"],/\b(?:AppendStructuredBuffer|BlendState|Buffer|ByteAddressBuffer|CompileShader|ComputeShader|ConsumeStructuredBuffer|DepthStencilState|DepthStencilView|DomainShader|GeometryShader|Hullshader|InputPatch|LineStream|OutputPatch|PixelShader|PointStream|RasterizerState|RenderTargetView|RWBuffer|RWByteAddressBuffer|RWStructuredBuffer|RWTexture(?:1D|1DArray|2D|2DArray|3D)|SamplerComparisonState|SamplerState|StructuredBuffer|Texture(?:1D|1DArray|2D|2DArray|2DMS|2DMSArray|3D|Cube|CubeArray)|TriangleStream|VertexShader)\b/],keyword:[/\b(?:asm|asm_fragment|auto|break|case|catch|cbuffer|centroid|char|class|column_major|compile|compile_fragment|const|const_cast|continue|default|delete|discard|do|dynamic_cast|else|enum|explicit|export|extern|for|friend|fxgroup|goto|groupshared|if|in|inline|inout|interface|line|lineadj|linear|long|matrix|mutable|namespace|new|nointerpolation|noperspective|operator|out|packoffset|pass|pixelfragment|point|precise|private|protected|public|register|reinterpret_cast|return|row_major|sample|sampler|shared|short|signed|sizeof|snorm|stateblock|stateblock_state|static|static_cast|string|struct|switch|tbuffer|technique|technique10|technique11|template|texture|this|throw|triangle|triangleadj|try|typedef|typename|uniform|union|unorm|unsigned|using|vector|vertexfragment|virtual|void|volatile|while)\b/,/\b(?:bool|double|dword|float|half|int|min(?:10float|12int|16(?:float|int|uint))|uint)(?:[1-4](?:x[1-4])?)?\b/],number:/(?:(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[eE][+-]?\d+)?|\b0x[\da-fA-F]+)[fFhHlLuU]?\b/,boolean:/\b(?:false|true)\b/})}e.exports=i,i.displayName="hlsl",i.aliases=[]},76942(e){"use strict";function t(e){e.languages.hpkp={directive:{pattern:/\b(?:(?:includeSubDomains|preload|strict)(?: |;)|pin-sha256="[a-zA-Z\d+=/]+"|(?:max-age|report-uri)=|report-to )/,alias:"keyword"},safe:{pattern:/\b\d{7,}\b/,alias:"selector"},unsafe:{pattern:/\b\d{1,6}\b/,alias:"function"}}}e.exports=t,t.displayName="hpkp",t.aliases=[]},60561(e){"use strict";function t(e){e.languages.hsts={directive:{pattern:/\b(?:max-age=|includeSubDomains|preload)/,alias:"keyword"},safe:{pattern:/\b\d{8,}\b/,alias:"selector"},unsafe:{pattern:/\b\d{1,7}\b/,alias:"function"}}}e.exports=t,t.displayName="hsts",t.aliases=[]},49660(e){"use strict";function t(e){!function(e){e.languages.http={"request-line":{pattern:/^(?:GET|HEAD|POST|PUT|DELETE|CONNECT|OPTIONS|TRACE|PATCH|PRI|SEARCH)\s(?:https?:\/\/|\/)\S*\sHTTP\/[0-9.]+/m,inside:{method:{pattern:/^[A-Z]+\b/,alias:"property"},"request-target":{pattern:/^(\s)(?:https?:\/\/|\/)\S*(?=\s)/,lookbehind:!0,alias:"url",inside:e.languages.uri},"http-version":{pattern:/^(\s)HTTP\/[0-9.]+/,lookbehind:!0,alias:"property"}}},"response-status":{pattern:/^HTTP\/[0-9.]+ \d+ .+/m,inside:{"http-version":{pattern:/^HTTP\/[0-9.]+/,alias:"property"},"status-code":{pattern:/^(\s)\d+(?=\s)/,lookbehind:!0,alias:"number"},"reason-phrase":{pattern:/^(\s).+/,lookbehind:!0,alias:"string"}}},"header-name":{pattern:/^[\w-]+:(?=.)/m,alias:"keyword"}};var t,n=e.languages,r={"application/javascript":n.javascript,"application/json":n.json||n.javascript,"application/xml":n.xml,"text/xml":n.xml,"text/html":n.html,"text/css":n.css},i={"application/json":!0,"application/xml":!0};function a(e){var t="\\w+/(?:[\\w.-]+\\+)+"+e.replace(/^[a-z]+\//,"")+"(?![+\\w.-])";return"(?:"+e+"|"+t+")"}for(var o in r)if(r[o]){t=t||{};var s=i[o]?a(o):o;t[o.replace(/\//g,"-")]={pattern:RegExp("(content-type:\\s*"+s+"(?:(?:\\r\\n?|\\n).+)*)(?:\\r?\\n|\\r){2}[\\s\\S]*","i"),lookbehind:!0,inside:r[o]}}t&&e.languages.insertBefore("http","header-name",t)}(e)}e.exports=t,t.displayName="http",t.aliases=[]},30615(e){"use strict";function t(e){e.languages.ichigojam={comment:/(?:\B'|REM)(?:[^\n\r]*)/i,string:{pattern:/"(?:""|[!#$%&'()*,\/:;<=>?^\w +\-.])*"/i,greedy:!0},number:/\B#[0-9A-F]+|\B`[01]+|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:E[+-]?\d+)?/i,keyword:/\b(?:BEEP|BPS|CASE|CLEAR|CLK|CLO|CLP|CLS|CLT|CLV|CONT|COPY|ELSE|END|FILE|FILES|FOR|GOSUB|GSB|GOTO|IF|INPUT|KBD|LED|LET|LIST|LOAD|LOCATE|LRUN|NEW|NEXT|OUT|RIGHT|PLAY|POKE|PRINT|PWM|REM|RENUM|RESET|RETURN|RTN|RUN|SAVE|SCROLL|SLEEP|SRND|STEP|STOP|SUB|TEMPO|THEN|TO|UART|VIDEO|WAIT)(?:\$|\b)/i,function:/\b(?:ABS|ANA|ASC|BIN|BTN|DEC|END|FREE|HELP|HEX|I2CR|I2CW|IN|INKEY|LEN|LINE|PEEK|RND|SCR|SOUND|STR|TICK|USR|VER|VPEEK|ZER)(?:\$|\b)/i,label:/(?:\B@\S+)/i,operator:/<[=>]?|>=?|\|\||&&|[+\-*\/=|&^~!]|\b(?:AND|NOT|OR)\b/i,punctuation:/[\[,;:()\]]/}}e.exports=t,t.displayName="ichigojam",t.aliases=[]},93865(e){"use strict";function t(e){e.languages.icon={comment:/#.*/,string:{pattern:/(["'])(?:(?!\1)[^\\\r\n_]|\\.|_(?!\1)(?:\r\n|[\s\S]))*\1/,greedy:!0},number:/\b(?:\d+r[a-z\d]+|\d+(?:\.\d+)?(?:e[+-]?\d+)?)\b|\.\d+\b/i,"builtin-keyword":{pattern:/&(?:allocated|ascii|clock|collections|cset|current|date|dateline|digits|dump|e|error(?:number|text|value)?|errout|fail|features|file|host|input|lcase|letters|level|line|main|null|output|phi|pi|pos|progname|random|regions|source|storage|subject|time|trace|ucase|version)\b/,alias:"variable"},directive:{pattern:/\$\w+/,alias:"builtin"},keyword:/\b(?:break|by|case|create|default|do|else|end|every|fail|global|if|initial|invocable|link|local|next|not|of|procedure|record|repeat|return|static|suspend|then|to|until|while)\b/,function:/\b(?!\d)\w+(?=\s*[({]|\s*!\s*\[)/,operator:/[+-]:(?!=)|(?:[\/?@^%&]|\+\+?|--?|==?=?|~==?=?|\*\*?|\|\|\|?|<(?:->?|>?=?)(?::=)?|:(?:=:?)?|[!.\\|~]/,punctuation:/[\[\](){},;]/}}e.exports=t,t.displayName="icon",t.aliases=[]},51078(e){"use strict";function t(e){!function(e){function t(e,n){return n<=0?/[]/.source:e.replace(//g,function(){return t(e,n-1)})}var n=/'[{}:=,](?:[^']|'')*'(?!')/,r={pattern:/''/,greedy:!0,alias:"operator"},i={pattern:n,greedy:!0,inside:{escape:r}},a=t(/\{(?:[^{}']|'(?![{},'])|''||)*\}/.source.replace(//g,function(){return n.source}),8),o={pattern:RegExp(a),inside:{message:{pattern:/^(\{)[\s\S]+(?=\}$)/,lookbehind:!0,inside:null},"message-delimiter":{pattern:/./,alias:"punctuation"}}};e.languages["icu-message-format"]={argument:{pattern:RegExp(a),greedy:!0,inside:{content:{pattern:/^(\{)[\s\S]+(?=\}$)/,lookbehind:!0,inside:{"argument-name":{pattern:/^(\s*)[^{}:=,\s]+/,lookbehind:!0},"choice-style":{pattern:/^(\s*,\s*choice\s*,\s*)\S(?:[\s\S]*\S)?/,lookbehind:!0,inside:{punctuation:/\|/,range:{pattern:/^(\s*)[+-]?(?:\d+(?:\.\d*)?|\u221e)\s*[<#\u2264]/,lookbehind:!0,inside:{operator:/[<#\u2264]/,number:/\S+/}},rest:null}},"plural-style":{pattern:/^(\s*,\s*(?:plural|selectordinal)\s*,\s*)\S(?:[\s\S]*\S)?/,lookbehind:!0,inside:{offset:/^offset:\s*\d+/,"nested-message":o,selector:{pattern:/=\d+|[^{}:=,\s]+/,inside:{keyword:/^(?:zero|one|two|few|many|other)$/}}}},"select-style":{pattern:/^(\s*,\s*select\s*,\s*)\S(?:[\s\S]*\S)?/,lookbehind:!0,inside:{"nested-message":o,selector:{pattern:/[^{}:=,\s]+/,inside:{keyword:/^other$/}}}},keyword:/\b(?:choice|plural|select|selectordinal)\b/,"arg-type":{pattern:/\b(?:number|date|time|spellout|ordinal|duration)\b/,alias:"keyword"},"arg-skeleton":{pattern:/(,\s*)::[^{}:=,\s]+/,lookbehind:!0},"arg-style":{pattern:/(,\s*)(?:short|medium|long|full|integer|currency|percent)(?=\s*$)/,lookbehind:!0},"arg-style-text":{pattern:RegExp(/(^\s*,\s*(?=\S))/.source+t(/(?:[^{}']|'[^']*'|\{(?:)?\})+/.source,8)+"$"),lookbehind:!0,alias:"string"},punctuation:/,/}},"argument-delimiter":{pattern:/./,alias:"operator"}}},escape:r,string:i},o.inside.message.inside=e.languages["icu-message-format"],e.languages["icu-message-format"].argument.inside.content.inside["choice-style"].inside.rest=e.languages["icu-message-format"]}(e)}e.exports=t,t.displayName="icuMessageFormat",t.aliases=[]},91178(e,t,n){"use strict";var r=n(58090);function i(e){e.register(r),e.languages.idris=e.languages.extend("haskell",{comment:{pattern:/(?:(?:--|\|\|\|).*$|\{-[\s\S]*?-\})/m},keyword:/\b(?:Type|case|class|codata|constructor|corecord|data|do|dsl|else|export|if|implementation|implicit|import|impossible|in|infix|infixl|infixr|instance|interface|let|module|mutual|namespace|of|parameters|partial|postulate|private|proof|public|quoteGoal|record|rewrite|syntax|then|total|using|where|with)\b/,"import-statement":{pattern:/(^\s*)import\s+(?:[A-Z][\w']*)(?:\.[A-Z][\w']*)*/m,lookbehind:!0},builtin:void 0}),e.languages.idr=e.languages.idris}e.exports=i,i.displayName="idris",i.aliases=["idr"]},40011(e){"use strict";function t(e){e.languages.iecst={comment:[{pattern:/(^|[^\\])(?:\/\*[\s\S]*?(?:\*\/|$)|\(\*[\s\S]*?(?:\*\)|$)|\{[\s\S]*?(?:\}|$))/,lookbehind:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":/\b(?:END_)?(?:PROGRAM|CONFIGURATION|INTERFACE|FUNCTION_BLOCK|FUNCTION|ACTION|TRANSITION|TYPE|STRUCT|(?:INITIAL_)?STEP|NAMESPACE|LIBRARY|CHANNEL|FOLDER|RESOURCE|VAR_(?:GLOBAL|INPUT|PUTPUT|IN_OUT|ACCESS|TEMP|EXTERNAL|CONFIG)|VAR|METHOD|PROPERTY)\b/i,keyword:/\b(?:(?:END_)?(?:IF|WHILE|REPEAT|CASE|FOR)|ELSE|FROM|THEN|ELSIF|DO|TO|BY|PRIVATE|PUBLIC|PROTECTED|CONSTANT|RETURN|EXIT|CONTINUE|GOTO|JMP|AT|RETAIN|NON_RETAIN|TASK|WITH|UNTIL|USING|EXTENDS|IMPLEMENTS|GET|SET|__TRY|__CATCH|__FINALLY|__ENDTRY)\b/,variable:/\b(?:AT|BOOL|BYTE|(?:D|L)?WORD|U?(?:S|D|L)?INT|L?REAL|TIME(?:_OF_DAY)?|TOD|DT|DATE(?:_AND_TIME)?|STRING|ARRAY|ANY|POINTER)\b/,symbol:/%[IQM][XBWDL][\d.]*|%[IQ][\d.]*/,number:/\b(?:16#[\da-f]+|2#[01_]+|0x[\da-f]+)\b|\b(?:T|D|DT|TOD)#[\d_shmd:]*|\b[A-Z]*#[\d.,_]*|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,boolean:/\b(?:TRUE|FALSE|NULL)\b/,function:/\w+(?=\()/,operator:/(?:S?R?:?=>?|&&?|\*\*?|<=?|>=?|[-:^/+])|\b(?:OR|AND|MOD|NOT|XOR|LE|GE|EQ|NE|GT|LT)\b/,punctuation:/[();]/,type:{pattern:/#/,alias:"selector"}}}e.exports=t,t.displayName="iecst",t.aliases=[]},12017(e){"use strict";function t(e){var t;(t=e).languages.ignore={comment:/^#.*/m,entry:{pattern:/\S(?:.*(?:(?:\\ )|\S))?/,alias:"string",inside:{operator:/^!|\*\*?|\?/,regex:{pattern:/(^|[^\\])\[[^\[\]]*\]/,lookbehind:!0},punctuation:/\//}}},t.languages.gitignore=t.languages.ignore,t.languages.hgignore=t.languages.ignore,t.languages.npmignore=t.languages.ignore}e.exports=t,t.displayName="ignore",t.aliases=["gitignore","hgignore","npmignore"]},65175(e){"use strict";function t(e){e.languages.inform7={string:{pattern:/"[^"]*"/,inside:{substitution:{pattern:/\[[^\[\]]+\]/,inside:{delimiter:{pattern:/\[|\]/,alias:"punctuation"}}}}},comment:{pattern:/\[[^\[\]]+\]/,greedy:!0},title:{pattern:/^[ \t]*(?:volume|book|part(?! of)|chapter|section|table)\b.+/im,alias:"important"},number:{pattern:/(^|[^-])(?:\b\d+(?:\.\d+)?(?:\^\d+)?(?:(?!\d)\w+)?|\b(?:one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve))\b(?!-)/i,lookbehind:!0},verb:{pattern:/(^|[^-])\b(?:applying to|are|attacking|answering|asking|be(?:ing)?|burning|buying|called|carries|carry(?! out)|carrying|climbing|closing|conceal(?:s|ing)?|consulting|contain(?:s|ing)?|cutting|drinking|dropping|eating|enclos(?:es?|ing)|entering|examining|exiting|getting|giving|going|ha(?:ve|s|ving)|hold(?:s|ing)?|impl(?:y|ies)|incorporat(?:es?|ing)|inserting|is|jumping|kissing|listening|locking|looking|mean(?:s|ing)?|opening|provid(?:es?|ing)|pulling|pushing|putting|relat(?:es?|ing)|removing|searching|see(?:s|ing)?|setting|showing|singing|sleeping|smelling|squeezing|switching|support(?:s|ing)?|swearing|taking|tasting|telling|thinking|throwing|touching|turning|tying|unlock(?:s|ing)?|var(?:y|ies|ying)|waiting|waking|waving|wear(?:s|ing)?)\b(?!-)/i,lookbehind:!0,alias:"operator"},keyword:{pattern:/(^|[^-])\b(?:after|before|carry out|check|continue the action|definition(?= *:)|do nothing|else|end (?:if|unless|the story)|every turn|if|include|instead(?: of)?|let|move|no|now|otherwise|repeat|report|resume the story|rule for|running through|say(?:ing)?|stop the action|test|try(?:ing)?|understand|unless|use|when|while|yes)\b(?!-)/i,lookbehind:!0},property:{pattern:/(^|[^-])\b(?:adjacent(?! to)|carried|closed|concealed|contained|dark|described|edible|empty|enclosed|enterable|even|female|fixed in place|full|handled|held|improper-named|incorporated|inedible|invisible|lighted|lit|lock(?:able|ed)|male|marked for listing|mentioned|negative|neuter|non-(?:empty|full|recurring)|odd|opaque|open(?:able)?|plural-named|portable|positive|privately-named|proper-named|provided|publically-named|pushable between rooms|recurring|related|rubbing|scenery|seen|singular-named|supported|swinging|switch(?:able|ed(?: on| off)?)|touch(?:able|ed)|transparent|unconcealed|undescribed|unlit|unlocked|unmarked for listing|unmentioned|unopenable|untouchable|unvisited|variable|visible|visited|wearable|worn)\b(?!-)/i,lookbehind:!0,alias:"symbol"},position:{pattern:/(^|[^-])\b(?:above|adjacent to|back side of|below|between|down|east|everywhere|front side|here|in|inside(?: from)?|north(?:east|west)?|nowhere|on(?: top of)?|other side|outside(?: from)?|parts? of|regionally in|south(?:east|west)?|through|up|west|within)\b(?!-)/i,lookbehind:!0,alias:"keyword"},type:{pattern:/(^|[^-])\b(?:actions?|activit(?:y|ies)|actors?|animals?|backdrops?|containers?|devices?|directions?|doors?|holders?|kinds?|lists?|m[ae]n|nobody|nothing|nouns?|numbers?|objects?|people|persons?|player(?:'s holdall)?|regions?|relations?|rooms?|rule(?:book)?s?|scenes?|someone|something|supporters?|tables?|texts?|things?|time|vehicles?|wom[ae]n)\b(?!-)/i,lookbehind:!0,alias:"variable"},punctuation:/[.,:;(){}]/},e.languages.inform7.string.inside.substitution.inside.rest=e.languages.inform7,e.languages.inform7.string.inside.substitution.inside.rest.text={pattern:/\S(?:\s*\S)*/,alias:"comment"}}e.exports=t,t.displayName="inform7",t.aliases=[]},14970(e){"use strict";function t(e){e.languages.ini={comment:{pattern:/(^[ \f\t\v]*)[#;][^\n\r]*/m,lookbehind:!0},header:{pattern:/(^[ \f\t\v]*)\[[^\n\r\]]*\]?/m,lookbehind:!0,inside:{"section-name":{pattern:/(^\[[ \f\t\v]*)[^ \f\t\v\]]+(?:[ \f\t\v]+[^ \f\t\v\]]+)*/,lookbehind:!0,alias:"selector"},punctuation:/\[|\]/}},key:{pattern:/(^[ \f\t\v]*)[^ \f\n\r\t\v=]+(?:[ \f\t\v]+[^ \f\n\r\t\v=]+)*(?=[ \f\t\v]*=)/m,lookbehind:!0,alias:"attr-name"},value:{pattern:/(=[ \f\t\v]*)[^ \f\n\r\t\v]+(?:[ \f\t\v]+[^ \f\n\r\t\v]+)*/,lookbehind:!0,alias:"attr-value",inside:{"inner-value":{pattern:/^("|').+(?=\1$)/,lookbehind:!0}}},punctuation:/=/}}e.exports=t,t.displayName="ini",t.aliases=[]},30764(e){"use strict";function t(e){e.languages.io={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0},{pattern:/(^|[^\\])\/\/.*/,lookbehind:!0},{pattern:/(^|[^\\])#.*/,lookbehind:!0}],"triple-quoted-string":{pattern:/"""(?:\\[\s\S]|(?!""")[^\\])*"""/,greedy:!0,alias:"string"},string:{pattern:/"(?:\\.|[^\\\r\n"])*"/,greedy:!0},keyword:/\b(?:activate|activeCoroCount|asString|block|break|catch|clone|collectGarbage|compileString|continue|do|doFile|doMessage|doString|else|elseif|exit|for|foreach|forward|getSlot|getEnvironmentVariable|hasSlot|if|ifFalse|ifNil|ifNilEval|ifTrue|isActive|isNil|isResumable|list|message|method|parent|pass|pause|perform|performWithArgList|print|println|proto|raise|raiseResumable|removeSlot|resend|resume|schedulerSleepSeconds|self|sender|setSchedulerSleepSeconds|setSlot|shallowCopy|slotNames|super|system|then|thisBlock|thisContext|call|try|type|uniqueId|updateSlot|wait|while|write|yield)\b/,builtin:/\b(?:Array|AudioDevice|AudioMixer|Block|Box|Buffer|CFunction|CGI|Color|Curses|DBM|DNSResolver|DOConnection|DOProxy|DOServer|Date|Directory|Duration|DynLib|Error|Exception|FFT|File|Fnmatch|Font|Future|GL|GLE|GLScissor|GLU|GLUCylinder|GLUQuadric|GLUSphere|GLUT|Host|Image|Importer|LinkList|List|Lobby|Locals|MD5|MP3Decoder|MP3Encoder|Map|Message|Movie|Notification|Number|Object|OpenGL|Point|Protos|Regex|SGML|SGMLElement|SGMLParser|SQLite|Server|Sequence|ShowMessage|SleepyCat|SleepyCatCursor|Socket|SocketManager|Sound|Soup|Store|String|Tree|UDPSender|UPDReceiver|URL|User|Warning|WeakLink|Random|BigNum)\b/,boolean:/\b(?:true|false|nil)\b/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e-?\d+)?/i,operator:/[=!*/%+\-^&|]=|>>?=?|<+*\-%$|,#][.:]?|[?^]\.?|[;\[]:?|[~}"i][.:]|[ACeEIjLor]\.|(?:[_\/\\qsux]|_?\d):)/,alias:"keyword"},number:/\b_?(?:(?!\d:)\d+(?:\.\d+)?(?:(?:[ejpx]|ad|ar)_?\d+(?:\.\d+)?)*(?:b_?[\da-z]+(?:\.[\da-z]+)?)?|_\b(?!\.))/,adverb:{pattern:/[~}]|[\/\\]\.?|[bfM]\.|t[.:]/,alias:"builtin"},operator:/[=a][.:]|_\./,conjunction:{pattern:/&(?:\.:?|:)?|[.:@][.:]?|[!D][.:]|[;dHT]\.|`:?|[\^LS]:|"/,alias:"variable"},punctuation:/[()]/}}e.exports=t,t.displayName="j",t.aliases=[]},15909(e){"use strict";function t(e){var t,n,r,i;t=e,n=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,i={pattern:RegExp((r=/(^|[^\w.])(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source)+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}},t.languages.java=t.languages.extend("clike",{"class-name":[i,{pattern:RegExp(r+/[A-Z]\w*(?=\s+\w+\s*[;,=()])/.source),lookbehind:!0,inside:i.inside}],keyword:n,function:[t.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0}}),t.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"}}),t.languages.insertBefore("java","class-name",{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:"punctuation"},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":i,keyword:n,punctuation:/[<>(),.:]/,operator:/[?&|]/}},namespace:{pattern:RegExp(/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(//g,function(){return n.source})),lookbehind:!0,inside:{punctuation:/\./}}})}e.exports=t,t.displayName="java",t.aliases=[]},36553(e,t,n){"use strict";var r=n(15909),i=n(9858);function a(e){var t,n,a,o;e.register(r),e.register(i),t=e,n=/(^(?:[\t ]*(?:\*\s*)*))[^*\s].*$/m,a=/#\s*\w+(?:\s*\([^()]*\))?/.source,o=/(?:\b[a-zA-Z]\w+\s*\.\s*)*\b[A-Z]\w*(?:\s*)?|/.source.replace(//g,function(){return a}),t.languages.javadoc=t.languages.extend("javadoclike",{}),t.languages.insertBefore("javadoc","keyword",{reference:{pattern:RegExp(/(@(?:exception|throws|see|link|linkplain|value)\s+(?:\*\s*)?)/.source+"(?:"+o+")"),lookbehind:!0,inside:{function:{pattern:/(#\s*)\w+(?=\s*\()/,lookbehind:!0},field:{pattern:/(#\s*)\w+/,lookbehind:!0},namespace:{pattern:/\b(?:[a-z]\w*\s*\.\s*)+/,inside:{punctuation:/\./}},"class-name":/\b[A-Z]\w*/,keyword:t.languages.java.keyword,punctuation:/[#()[\],.]/}},"class-name":{pattern:/(@param\s+)<[A-Z]\w*>/,lookbehind:!0,inside:{punctuation:/[.<>]/}},"code-section":[{pattern:/(\{@code\s+(?!\s))(?:[^\s{}]|\s+(?![\s}])|\{(?:[^{}]|\{(?:[^{}]|\{(?:[^{}]|\{[^{}]*\})*\})*\})*\})+(?=\s*\})/,lookbehind:!0,inside:{code:{pattern:n,lookbehind:!0,inside:t.languages.java,alias:"language-java"}}},{pattern:/(<(code|pre|tt)>(?!)\s*)\S(?:\S|\s+\S)*?(?=\s*<\/\2>)/,lookbehind:!0,inside:{line:{pattern:n,lookbehind:!0,inside:{tag:t.languages.markup.tag,entity:t.languages.markup.entity,code:{pattern:/.+/,inside:t.languages.java,alias:"language-java"}}}}}],tag:t.languages.markup.tag,entity:t.languages.markup.entity}),t.languages.javadoclike.addSupport("java",t.languages.javadoc)}e.exports=a,a.displayName="javadoc",a.aliases=[]},9858(e){"use strict";function t(e){!function(e){var t=e.languages.javadoclike={parameter:{pattern:/(^[\t ]*(?:\/{3}|\*|\/\*\*)\s*@(?:param|arg|arguments)\s+)\w+/m,lookbehind:!0},keyword:{pattern:/(^[\t ]*(?:\/{3}|\*|\/\*\*)\s*|\{)@[a-z][a-zA-Z-]+\b/m,lookbehind:!0},punctuation:/[{}]/};function n(t,n){var r="doc-comment",i=e.languages[t];if(i){var a=i[r];if(!a){var o={};o[r]={pattern:/(^|[^\\])\/\*\*[^/][\s\S]*?(?:\*\/|$)/,lookbehind:!0,alias:"comment"},a=(i=e.languages.insertBefore(t,"comment",o))[r]}if(a instanceof RegExp&&(a=i[r]={pattern:a}),Array.isArray(a))for(var s=0,u=a.length;s|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),e.languages.javascript["class-name"][0].pattern=/(\b(?:class|interface|extends|implements|instanceof|new)\s+)[\w.\\]+/,e.languages.insertBefore("javascript","keyword",{regex:{pattern:/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)\/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/,lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:e.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:e.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:e.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:e.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:e.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),e.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:e.languages.javascript}},string:/[\s\S]+/}}}),e.languages.markup&&(e.languages.markup.tag.addInlined("script","javascript"),e.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),e.languages.js=e.languages.javascript}e.exports=t,t.displayName="javascript",t.aliases=["js"]},11223(e){"use strict";function t(e){e.languages.javastacktrace={summary:{pattern:/^[\t ]*(?:(?:Caused by:|Suppressed:|Exception in thread "[^"]*")[\t ]+)?[\w$.]+(?::.*)?$/m,inside:{keyword:{pattern:/^(\s*)(?:(?:Caused by|Suppressed)(?=:)|Exception in thread)/m,lookbehind:!0},string:{pattern:/^(\s*)"[^"]*"/,lookbehind:!0},exceptions:{pattern:/^(:?\s*)[\w$.]+(?=:|$)/,lookbehind:!0,inside:{"class-name":/[\w$]+(?=$|:)/,namespace:/[a-z]\w*/,punctuation:/[.:]/}},message:{pattern:/(:\s*)\S.*/,lookbehind:!0,alias:"string"},punctuation:/:/}},"stack-frame":{pattern:/^[\t ]*at (?:[\w$./]|@[\w$.+-]*\/)+(?:)?\([^()]*\)/m,inside:{keyword:{pattern:/^(\s*)at(?= )/,lookbehind:!0},source:[{pattern:/(\()\w+\.\w+:\d+(?=\))/,lookbehind:!0,inside:{file:/^\w+\.\w+/,punctuation:/:/,"line-number":{pattern:/\d+/,alias:"number"}}},{pattern:/(\()[^()]*(?=\))/,lookbehind:!0,inside:{keyword:/^(?:Unknown Source|Native Method)$/}}],"class-name":/[\w$]+(?=\.(?:|[\w$]+)\()/,function:/(?:|[\w$]+)(?=\()/,"class-loader":{pattern:/(\s)[a-z]\w*(?:\.[a-z]\w*)*(?=\/[\w@$.]*\/)/,lookbehind:!0,alias:"namespace",inside:{punctuation:/\./}},module:{pattern:/([\s/])[a-z]\w*(?:\.[a-z]\w*)*(?:@[\w$.+-]*)?(?=\/)/,lookbehind:!0,inside:{version:{pattern:/(@)[\s\S]+/,lookbehind:!0,alias:"number"},punctuation:/[@.]/}},namespace:{pattern:/(?:[a-z]\w*\.)+/,inside:{punctuation:/\./}},punctuation:/[()/.]/}},more:{pattern:/^[\t ]*\.{3} \d+ [a-z]+(?: [a-z]+)*/m,inside:{punctuation:/\.{3}/,number:/\d+/,keyword:/\b[a-z]+(?: [a-z]+)*\b/}}}}e.exports=t,t.displayName="javastacktrace",t.aliases=[]},57957(e){"use strict";function t(e){e.languages.jexl={string:/(["'])(?:\\[\s\S]|(?!\1)[^\\])*\1/,transform:{pattern:/(\|\s*)[a-zA-Zа-яА-Я_\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF$][\wа-яА-Я\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF$]*/,alias:"function",lookbehind:!0},function:/[a-zA-Zа-яА-Я_\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF$][\wа-яА-Я\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF$]*\s*(?=\()/,number:/\b\d+(?:\.\d+)?\b|\B\.\d+\b/,operator:/[<>!]=?|-|\+|&&|==|\|\|?|\/\/?|[?:*^%]/,boolean:/\b(?:true|false)\b/,keyword:/\bin\b/,punctuation:/[{}[\](),.]/}}e.exports=t,t.displayName="jexl",t.aliases=[]},75807(e){"use strict";function t(e){e.languages.jolie=e.languages.extend("clike",{string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},keyword:/\b(?:include|define|is_defined|undef|main|init|outputPort|inputPort|Location|Protocol|Interfaces|RequestResponse|OneWay|type|interface|extender|throws|cset|csets|forward|Aggregates|Redirects|embedded|courier|execution|sequential|concurrent|single|scope|install|throw|comp|cH|default|global|linkIn|linkOut|synchronized|this|new|for|if|else|while|in|Jolie|Java|Javascript|nullProcess|spawn|constants|with|provide|until|exit|foreach|instanceof|over|service)\b/,number:/(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?l?/i,operator:/-[-=>]?|\+[+=]?|<[<=]?|[>=*!]=?|&&|\|\||[:?\/%^]/,punctuation:/[,.]/,builtin:/\b(?:undefined|string|int|void|long|Byte|bool|double|float|char|any)\b/,symbol:/[|;@]/}),delete e.languages.jolie["class-name"],e.languages.insertBefore("jolie","keyword",{function:{pattern:/((?:\b(?:outputPort|inputPort|in|service|courier)\b|@)\s*)\w+/,lookbehind:!0},aggregates:{pattern:/(\bAggregates\s*:\s*)(?:\w+(?:\s+with\s+\w+)?\s*,\s*)*\w+(?:\s+with\s+\w+)?/,lookbehind:!0,inside:{"with-extension":{pattern:/\bwith\s+\w+/,inside:{keyword:/\bwith\b/}},function:{pattern:/\w+/},punctuation:{pattern:/,/}}},redirects:{pattern:/(\bRedirects\s*:\s*)(?:\w+\s*=>\s*\w+\s*,\s*)*(?:\w+\s*=>\s*\w+)/,lookbehind:!0,inside:{punctuation:{pattern:/,/},function:{pattern:/\w+/},symbol:{pattern:/=>/}}}})}e.exports=t,t.displayName="jolie",t.aliases=[]},77935(e){"use strict";function t(e){var t,n,r,i,a;t=e,n=/\\\((?:[^()]|\([^()]*\))*\)/.source,r=RegExp(/"(?:[^"\r\n\\]|\\[^\r\n(]|__)*"/.source.replace(/__/g,function(){return n})),i={interpolation:{pattern:RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+n),lookbehind:!0,inside:{content:{pattern:/^(\\\()[\s\S]+(?=\)$)/,lookbehind:!0,inside:null},punctuation:/^\\\(|\)$/}}},a=t.languages.jq={comment:/#.*/,property:{pattern:RegExp(r.source+/(?=\s*:(?!:))/.source),greedy:!0,inside:i},string:{pattern:r,greedy:!0,inside:i},function:{pattern:/(\bdef\s+)[a-z_]\w+/i,lookbehind:!0},variable:/\B\$\w+/,"property-literal":{pattern:/\b[a-z_]\w*(?=\s*:(?!:))/i,alias:"property"},keyword:/\b(?:as|break|catch|def|elif|else|end|foreach|if|import|include|label|module|modulemeta|null|reduce|then|try|while)\b/,boolean:/\b(?:true|false)\b/,number:/(?:\b\d+\.|\B\.)?\b\d+(?:[eE][+-]?\d+)?\b/,operator:[{pattern:/\|=?/,alias:"pipe"},/\.\.|[!=<>]?=|\?\/\/|\/\/=?|[-+*/%]=?|[<>?]|\b(?:and|or|not)\b/],"c-style-function":{pattern:/\b[a-z_]\w*(?=\s*\()/i,alias:"function"},punctuation:/::|[()\[\]{},:;]|\.(?=\s*[\[\w$])/,dot:{pattern:/\./,alias:"important"}},i.interpolation.inside.content.inside=a}e.exports=t,t.displayName="jq",t.aliases=[]},46155(e){"use strict";function t(e){!function(e){function t(e,t){return RegExp(e.replace(//g,function(){return/(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/.source}),t)}e.languages.insertBefore("javascript","function-variable",{"method-variable":{pattern:RegExp("(\\.\\s*)"+e.languages.javascript["function-variable"].pattern.source),lookbehind:!0,alias:["function-variable","method","function","property-access"]}}),e.languages.insertBefore("javascript","function",{method:{pattern:RegExp("(\\.\\s*)"+e.languages.javascript.function.source),lookbehind:!0,alias:["function","property-access"]}}),e.languages.insertBefore("javascript","constant",{"known-class-name":[{pattern:/\b(?:(?:(?:Uint|Int)(?:8|16|32)|Uint8Clamped|Float(?:32|64))?Array|ArrayBuffer|BigInt|Boolean|DataView|Date|Error|Function|Intl|JSON|Math|Number|Object|Promise|Proxy|Reflect|RegExp|String|Symbol|(?:Weak)?(?:Set|Map)|WebAssembly)\b/,alias:"class-name"},{pattern:/\b(?:[A-Z]\w*)Error\b/,alias:"class-name"}]}),e.languages.insertBefore("javascript","keyword",{imports:{pattern:t(/(\bimport\b\s*)(?:(?:\s*,\s*(?:\*\s*as\s+|\{[^{}]*\}))?|\*\s*as\s+|\{[^{}]*\})(?=\s*\bfrom\b)/.source),lookbehind:!0,inside:e.languages.javascript},exports:{pattern:t(/(\bexport\b\s*)(?:\*(?:\s*as\s+)?(?=\s*\bfrom\b)|\{[^{}]*\})/.source),lookbehind:!0,inside:e.languages.javascript}}),e.languages.javascript.keyword.unshift({pattern:/\b(?:as|default|export|from|import)\b/,alias:"module"},{pattern:/\b(?:await|break|catch|continue|do|else|for|finally|if|return|switch|throw|try|while|yield)\b/,alias:"control-flow"},{pattern:/\bnull\b/,alias:["null","nil"]},{pattern:/\bundefined\b/,alias:"nil"}),e.languages.insertBefore("javascript","operator",{spread:{pattern:/\.{3}/,alias:"operator"},arrow:{pattern:/=>/,alias:"operator"}}),e.languages.insertBefore("javascript","punctuation",{"property-access":{pattern:t(/(\.\s*)#?/.source),lookbehind:!0},"maybe-class-name":{pattern:/(^|[^$\w\xA0-\uFFFF])[A-Z][$\w\xA0-\uFFFF]+/,lookbehind:!0},dom:{pattern:/\b(?:document|location|navigator|performance|(?:local|session)Storage|window)\b/,alias:"variable"},console:{pattern:/\bconsole(?=\s*\.)/,alias:"class-name"}});for(var n=["function","function-variable","method","method-variable","property-access"],r=0;r=h.length)return;var n=e[t];if("string"==typeof n||"string"==typeof n.content){var r=h[o],i="string"==typeof n?n:n.content,a=i.indexOf(r);if(-1!==a){++o;var s=i.substring(0,a),u=c(l[r]),f=i.substring(a+r.length),d=[];if(s&&d.push(s),d.push(u),f){var b=[f];p(b),d.push.apply(d,b)}"string"==typeof n?(e.splice.apply(e,[t,1].concat(d)),t+=d.length-1):n.content=d}}else{var m=n.content;Array.isArray(m)?p(m):p([m])}}}return o=0,p(d),new e.Token(r,d,"language-"+r,t)}e.languages.javascript["template-string"]=[o("css",/\b(?:styled(?:\([^)]*\))?(?:\s*\.\s*\w+(?:\([^)]*\))*)*|css(?:\s*\.\s*(?:global|resolve))?|createGlobalStyle|keyframes)/.source),o("html",/\bhtml|\.\s*(?:inner|outer)HTML\s*\+?=/.source),o("svg",/\bsvg/.source),o("markdown",/\b(?:md|markdown)/.source),o("graphql",/\b(?:gql|graphql(?:\s*\.\s*experimental)?)/.source),o("sql",/\bsql/.source),t].filter(Boolean);var f={javascript:!0,js:!0,typescript:!0,ts:!0,jsx:!0,tsx:!0};function d(e){return"string"==typeof e?e:Array.isArray(e)?e.map(d).join(""):d(e.content)}e.hooks.add("after-tokenize",function(t){t.language in f&&n(t.tokens);function n(t){for(var r=0,i=t.length;r\s+)?)[A-Z]\w*(?:\.[A-Z]\w*)*/.source.replace(//g,function(){return a})),lookbehind:!0,inside:{punctuation:/\./}},{pattern:RegExp("(@[a-z]+\\s+)"+a),lookbehind:!0,inside:{string:n.string,number:n.number,boolean:n.boolean,keyword:t.languages.typescript.keyword,operator:/=>|\.\.\.|[&|?:*]/,punctuation:/[.,;=<>{}()[\]]/}}],example:{pattern:/(@example\s+(?!\s))(?:[^@\s]|\s+(?!\s))+?(?=\s*(?:\*\s*)?(?:@\w|\*\/))/,lookbehind:!0,inside:{code:{pattern:/^([\t ]*(?:\*\s*)?)\S.*$/m,lookbehind:!0,inside:n,alias:"language-javascript"}}}}),t.languages.javadoclike.addSupport("javascript",t.languages.jsdoc)}e.exports=a,a.displayName="jsdoc",a.aliases=[]},45950(e){"use strict";function t(e){e.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:true|false)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}},e.languages.webmanifest=e.languages.json}e.exports=t,t.displayName="json",t.aliases=["webmanifest"]},50235(e,t,n){"use strict";var r=n(45950);function i(e){var t,n;e.register(r),n=/("|')(?:\\(?:\r\n?|\n|.)|(?!\1)[^\\\r\n])*\1/,(t=e).languages.json5=t.languages.extend("json",{property:[{pattern:RegExp(n.source+"(?=\\s*:)"),greedy:!0},{pattern:/(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/,alias:"unquoted"}],string:{pattern:n,greedy:!0},number:/[+-]?\b(?:NaN|Infinity|0x[a-fA-F\d]+)\b|[+-]?(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[eE][+-]?\d+\b)?/})}e.exports=i,i.displayName="json5",i.aliases=[]},80963(e,t,n){"use strict";var r=n(45950);function i(e){e.register(r),e.languages.jsonp=e.languages.extend("json",{punctuation:/[{}[\]();,.]/}),e.languages.insertBefore("jsonp","punctuation",{function:/(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*\()/})}e.exports=i,i.displayName="jsonp",i.aliases=[]},79358(e){"use strict";function t(e){e.languages.jsstacktrace={"error-message":{pattern:/^\S.*/m,alias:"string"},"stack-frame":{pattern:/(^[ \t]+)at[ \t].*/m,lookbehind:!0,inside:{"not-my-code":{pattern:/^at[ \t]+(?!\s)(?:node\.js||.*(?:node_modules|\(\)|\(|$|\(internal\/|\(node\.js)).*/m,alias:"comment"},filename:{pattern:/(\bat\s+(?!\s)|\()(?:[a-zA-Z]:)?[^():]+(?=:)/,lookbehind:!0,alias:"url"},function:{pattern:/(at\s+(?:new\s+)?)(?!\s)[_$a-zA-Z\xA0-\uFFFF<][.$\w\xA0-\uFFFF<>]*/,lookbehind:!0,inside:{punctuation:/\./}},punctuation:/[()]/,keyword:/\b(?:at|new)\b/,alias:{pattern:/\[(?:as\s+)?(?!\s)[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*\]/,alias:"variable"},"line-number":{pattern:/:[0-9]+(?::[0-9]+)?\b/,alias:"number",inside:{punctuation:/:/}}}}}}e.exports=t,t.displayName="jsstacktrace",t.aliases=[]},96412(e){"use strict";function t(e){!function(e){var t=e.util.clone(e.languages.javascript),n=/(?:\s|\/\/.*(?!.)|\/\*(?:[^*]|\*(?!\/))\*\/)/.source,r=/(?:\{(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])*\})/.source,i=/(?:\{*\.{3}(?:[^{}]|)*\})/.source;function a(e,t){return RegExp(e=e.replace(//g,function(){return n}).replace(//g,function(){return r}).replace(//g,function(){return i}),t)}i=a(i).source,e.languages.jsx=e.languages.extend("markup",t),e.languages.jsx.tag.pattern=a(/<\/?(?:[\w.:-]+(?:+(?:[\w.:$-]+(?:=(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s{'"/>=]+|))?|))**\/?)?>/.source),e.languages.jsx.tag.inside.tag.pattern=/^<\/?[^\s>\/]*/i,e.languages.jsx.tag.inside["attr-value"].pattern=/=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/i,e.languages.jsx.tag.inside.tag.inside["class-name"]=/^[A-Z]\w*(?:\.[A-Z]\w*)*$/,e.languages.jsx.tag.inside.comment=t.comment,e.languages.insertBefore("inside","attr-name",{spread:{pattern:a(//.source),inside:e.languages.jsx}},e.languages.jsx.tag),e.languages.insertBefore("inside","special-attr",{script:{pattern:a(/=/.source),inside:{"script-punctuation":{pattern:/^=(?=\{)/,alias:"punctuation"},rest:e.languages.jsx},alias:"language-javascript"}},e.languages.jsx.tag);var o=function(e){return e?"string"==typeof e?e:"string"==typeof e.content?e.content:e.content.map(o).join(""):""},s=function(t){for(var n=[],r=0;r0&&n[n.length-1].tagName===o(i.content[0].content[1])&&n.pop():"/>"===i.content[i.content.length-1].content||n.push({tagName:o(i.content[0].content[1]),openedBraces:0}):n.length>0&&"punctuation"===i.type&&"{"===i.content?n[n.length-1].openedBraces++:n.length>0&&n[n.length-1].openedBraces>0&&"punctuation"===i.type&&"}"===i.content?n[n.length-1].openedBraces--:a=!0),(a||"string"==typeof i)&&n.length>0&&0===n[n.length-1].openedBraces){var u=o(i);r0&&("string"==typeof t[r-1]||"plain-text"===t[r-1].type)&&(u=o(t[r-1])+u,t.splice(r-1,1),r--),t[r]=new e.Token("plain-text",u,null,u)}i.content&&"string"!=typeof i.content&&s(i.content)}};e.hooks.add("after-tokenize",function(e){("jsx"===e.language||"tsx"===e.language)&&s(e.tokens)})}(e)}e.exports=t,t.displayName="jsx",t.aliases=[]},39259(e){"use strict";function t(e){e.languages.julia={comment:{pattern:/(^|[^\\])(?:#=(?:[^#=]|=(?!#)|#(?!=)|#=(?:[^#=]|=(?!#)|#(?!=))*=#)*=#|#.*)/,lookbehind:!0},regex:{pattern:/r"(?:\\.|[^"\\\r\n])*"[imsx]{0,4}/,greedy:!0},string:{pattern:/"""[\s\S]+?"""|(?:\b\w+)?"(?:\\.|[^"\\\r\n])*"|(^|[^\w'])'(?:\\[^\r\n][^'\r\n]*|[^\\\r\n])'|`(?:[^\\`\r\n]|\\.)*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:abstract|baremodule|begin|bitstype|break|catch|ccall|const|continue|do|else|elseif|end|export|finally|for|function|global|if|immutable|import|importall|in|let|local|macro|module|print|println|quote|return|struct|try|type|typealias|using|while)\b/,boolean:/\b(?:true|false)\b/,number:/(?:\b(?=\d)|\B(?=\.))(?:0[box])?(?:[\da-f]+(?:_[\da-f]+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[efp][+-]?\d+(?:_\d+)*)?j?/i,operator:/&&|\|\||[-+*^%÷⊻&$\\]=?|\/[\/=]?|!=?=?|\|[=>]?|<(?:<=?|[=:|])?|>(?:=|>>?=?)?|==?=?|[~≠≤≥'√∛]/,punctuation:/::?|[{}[\]();,.?]/,constant:/\b(?:(?:NaN|Inf)(?:16|32|64)?|im|pi)\b|[πℯ]/}}e.exports=t,t.displayName="julia",t.aliases=[]},35760(e){"use strict";function t(e){e.languages.keyman={comment:/\bc\s.*/i,function:/\[\s*(?:(?:CTRL|SHIFT|ALT|LCTRL|RCTRL|LALT|RALT|CAPS|NCAPS)\s+)*(?:[TKU]_[\w?]+|".+?"|'.+?')\s*\]/i,string:/("|').*?\1/,bold:[/&(?:baselayout|bitmap|capsononly|capsalwaysoff|shiftfreescaps|copyright|ethnologuecode|hotkey|includecodes|keyboardversion|kmw_embedcss|kmw_embedjs|kmw_helpfile|kmw_helptext|kmw_rtl|language|layer|layoutfile|message|mnemoniclayout|name|oldcharposmatching|platform|targets|version|visualkeyboard|windowslanguages)\b/i,/\b(?:bitmap|bitmaps|caps on only|caps always off|shift frees caps|copyright|hotkey|language|layout|message|name|version)\b/i],keyword:/\b(?:any|baselayout|beep|call|context|deadkey|dk|if|index|layer|notany|nul|outs|platform|return|reset|save|set|store|use)\b/i,atrule:/\b(?:ansi|begin|unicode|group|using keys|match|nomatch)\b/i,number:/\b(?:U\+[\dA-F]+|d\d+|x[\da-f]+|\d+)\b/i,operator:/[+>\\,()]/,tag:/\$(?:keyman|kmfl|weaver|keymanweb|keymanonly):/i}}e.exports=t,t.displayName="keyman",t.aliases=[]},19715(e){"use strict";function t(e){var t,n;(t=e).languages.kotlin=t.languages.extend("clike",{keyword:{pattern:/(^|[^.])\b(?:abstract|actual|annotation|as|break|by|catch|class|companion|const|constructor|continue|crossinline|data|do|dynamic|else|enum|expect|external|final|finally|for|fun|get|if|import|in|infix|init|inline|inner|interface|internal|is|lateinit|noinline|null|object|open|operator|out|override|package|private|protected|public|reified|return|sealed|set|super|suspend|tailrec|this|throw|to|try|typealias|val|var|vararg|when|where|while)\b/,lookbehind:!0},function:[{pattern:/(?:`[^\r\n`]+`|\b\w+)(?=\s*\()/,greedy:!0},{pattern:/(\.)(?:`[^\r\n`]+`|\w+)(?=\s*\{)/,lookbehind:!0,greedy:!0}],number:/\b(?:0[xX][\da-fA-F]+(?:_[\da-fA-F]+)*|0[bB][01]+(?:_[01]+)*|\d+(?:_\d+)*(?:\.\d+(?:_\d+)*)?(?:[eE][+-]?\d+(?:_\d+)*)?[fFL]?)\b/,operator:/\+[+=]?|-[-=>]?|==?=?|!(?:!|==?)?|[\/*%<>]=?|[?:]:?|\.\.|&&|\|\||\b(?:and|inv|or|shl|shr|ushr|xor)\b/}),delete t.languages.kotlin["class-name"],t.languages.insertBefore("kotlin","string",{"raw-string":{pattern:/("""|''')[\s\S]*?\1/,alias:"string"}}),t.languages.insertBefore("kotlin","keyword",{annotation:{pattern:/\B@(?:\w+:)?(?:[A-Z]\w*|\[[^\]]+\])/,alias:"builtin"}}),t.languages.insertBefore("kotlin","function",{label:{pattern:/\b\w+@|@\w+\b/,alias:"symbol"}}),n=[{pattern:/\$\{[^}]+\}/,inside:{delimiter:{pattern:/^\$\{|\}$/,alias:"variable"},rest:t.languages.kotlin}},{pattern:/\$\w+/,alias:"variable"}],t.languages.kotlin.string.inside=t.languages.kotlin["raw-string"].inside={interpolation:n},t.languages.kt=t.languages.kotlin,t.languages.kts=t.languages.kotlin}e.exports=t,t.displayName="kotlin",t.aliases=["kt","kts"]},27614(e){"use strict";function t(e){!function(e){var t=/\s\x00-\x1f\x22-\x2f\x3a-\x3f\x5b-\x5e\x60\x7b-\x7e/.source;function n(e,n){return RegExp(e.replace(//g,t),n)}e.languages.kumir={comment:{pattern:/\|.*/},prolog:{pattern:/#.*/,greedy:!0},string:{pattern:/"[^\n\r"]*"|'[^\n\r']*'/,greedy:!0},boolean:{pattern:n(/(^|[])(?:да|нет)(?=[]|$)/.source),lookbehind:!0},"operator-word":{pattern:n(/(^|[])(?:и|или|не)(?=[]|$)/.source),lookbehind:!0,alias:"keyword"},"system-variable":{pattern:n(/(^|[])знач(?=[]|$)/.source),lookbehind:!0,alias:"keyword"},type:[{pattern:n(/(^|[])(?:вещ|лит|лог|сим|цел)(?:\x20*таб)?(?=[]|$)/.source),lookbehind:!0,alias:"builtin"},{pattern:n(/(^|[])(?:компл|сканкод|файл|цвет)(?=[]|$)/.source),lookbehind:!0,alias:"important"}],keyword:{pattern:n(/(^|[])(?:алг|арг(?:\x20*рез)?|ввод|ВКЛЮЧИТЬ|вс[её]|выбор|вывод|выход|дано|для|до|дс|если|иначе|исп|использовать|кон(?:(?:\x20+|_)исп)?|кц(?:(?:\x20+|_)при)?|надо|нач|нс|нц|от|пауза|пока|при|раза?|рез|стоп|таб|то|утв|шаг)(?=[]|$)/.source),lookbehind:!0},name:{pattern:n(/(^|[])[^\d][^]*(?:\x20+[^]+)*(?=[]|$)/.source),lookbehind:!0},number:{pattern:n(/(^|[])(?:\B\$[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)(?=[]|$)/.source,"i"),lookbehind:!0},punctuation:/:=|[(),:;\[\]]/,"operator-char":{pattern:/\*\*?|<[=>]?|>=?|[-+/=]/,alias:"operator"}},e.languages.kum=e.languages.kumir}(e)}e.exports=t,t.displayName="kumir",t.aliases=["kum"]},42876(e){"use strict";function t(e){var t,n,r;t=e,r={"equation-command":{pattern:n=/\\(?:[^a-z()[\]]|[a-z*]+)/i,alias:"regex"}},t.languages.latex={comment:/%.*/m,cdata:{pattern:/(\\begin\{((?:verbatim|lstlisting)\*?)\})[\s\S]*?(?=\\end\{\2\})/,lookbehind:!0},equation:[{pattern:/\$\$(?:\\[\s\S]|[^\\$])+\$\$|\$(?:\\[\s\S]|[^\\$])+\$|\\\([\s\S]*?\\\)|\\\[[\s\S]*?\\\]/,inside:r,alias:"string"},{pattern:/(\\begin\{((?:equation|math|eqnarray|align|multline|gather)\*?)\})[\s\S]*?(?=\\end\{\2\})/,lookbehind:!0,inside:r,alias:"string"}],keyword:{pattern:/(\\(?:begin|end|ref|cite|label|usepackage|documentclass)(?:\[[^\]]+\])?\{)[^}]+(?=\})/,lookbehind:!0},url:{pattern:/(\\url\{)[^}]+(?=\})/,lookbehind:!0},headline:{pattern:/(\\(?:part|chapter|section|subsection|frametitle|subsubsection|paragraph|subparagraph|subsubparagraph|subsubsubparagraph)\*?(?:\[[^\]]+\])?\{)[^}]+(?=\})/,lookbehind:!0,alias:"class-name"},function:{pattern:n,alias:"selector"},punctuation:/[[\]{}&]/},t.languages.tex=t.languages.latex,t.languages.context=t.languages.latex}e.exports=t,t.displayName="latex",t.aliases=["tex","context"]},2980(e,t,n){"use strict";var r=n(93205),i=n(88262);function a(e){var t,n;e.register(r),e.register(i),(t=e).languages.latte={comment:/^\{\*[\s\S]*/,ld:{pattern:/^\{(?:[=_]|\/?(?!\d|\w+\()\w+)?/,inside:{punctuation:/^\{\/?/,tag:{pattern:/.+/,alias:"important"}}},rd:{pattern:/\}$/,inside:{punctuation:/.+/}},php:{pattern:/\S(?:[\s\S]*\S)?/,alias:"language-php",inside:t.languages.php}},n=t.languages.extend("markup",{}),t.languages.insertBefore("inside","attr-value",{"n-attr":{pattern:/n:[\w-]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+))?/,inside:{"attr-name":{pattern:/^[^\s=]+/,alias:"important"},"attr-value":{pattern:/=[\s\S]+/,inside:{punctuation:[/^=/,{pattern:/^(\s*)["']|["']$/,lookbehind:!0}],php:{pattern:/\S(?:[\s\S]*\S)?/,inside:t.languages.php}}}}}},n.tag),t.hooks.add("before-tokenize",function(e){if("latte"===e.language){var r=/\{\*[\s\S]*?\*\}|\{[^'"\s{}*](?:[^"'/{}]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|\/\*(?:[^*]|\*(?!\/))*\*\/)*?\}/g;t.languages["markup-templating"].buildPlaceholders(e,"latte",r),e.grammar=n}}),t.hooks.add("after-tokenize",function(e){t.languages["markup-templating"].tokenizePlaceholders(e,"latte")})}e.exports=a,a.displayName="latte",a.aliases=[]},41701(e){"use strict";function t(e){e.languages.less=e.languages.extend("css",{comment:[/\/\*[\s\S]*?\*\//,{pattern:/(^|[^\\])\/\/.*/,lookbehind:!0}],atrule:{pattern:/@[\w-](?:\((?:[^(){}]|\([^(){}]*\))*\)|[^(){};\s]|\s+(?!\s))*?(?=\s*\{)/,inside:{punctuation:/[:()]/}},selector:{pattern:/(?:@\{[\w-]+\}|[^{};\s@])(?:@\{[\w-]+\}|\((?:[^(){}]|\([^(){}]*\))*\)|[^(){};@\s]|\s+(?!\s))*?(?=\s*\{)/,inside:{variable:/@+[\w-]+/}},property:/(?:@\{[\w-]+\}|[\w-])+(?:\+_?)?(?=\s*:)/i,operator:/[+\-*\/]/}),e.languages.insertBefore("less","property",{variable:[{pattern:/@[\w-]+\s*:/,inside:{punctuation:/:/}},/@@?[\w-]+/],"mixin-usage":{pattern:/([{;]\s*)[.#](?!\d)[\w-].*?(?=[(;])/,lookbehind:!0,alias:"function"}})}e.exports=t,t.displayName="less",t.aliases=[]},42491(e,t,n){"use strict";var r=n(9997);function i(e){e.register(r),function(e){for(var t=/\((?:[^();"#\\]|\\[\s\S]|;.*(?!.)|"(?:[^"\\]|\\.)*"|#(?:\{(?:(?!#\})[\s\S])*#\}|[^{])|)*\)/.source,n=5,r=0;r/g,function(){return t});t=t.replace(//g,/[^\s\S]/.source);var i=e.languages.lilypond={comment:/%(?:(?!\{).*|\{[\s\S]*?%\})/,"embedded-scheme":{pattern:RegExp(/(^|[=\s])#(?:"(?:[^"\\]|\\.)*"|[^\s()"]*(?:[^\s()]|))/.source.replace(//g,function(){return t}),"m"),lookbehind:!0,greedy:!0,inside:{scheme:{pattern:/^(#)[\s\S]+$/,lookbehind:!0,alias:"language-scheme",inside:{"embedded-lilypond":{pattern:/#\{[\s\S]*?#\}/,greedy:!0,inside:{punctuation:/^#\{|#\}$/,lilypond:{pattern:/[\s\S]+/,alias:"language-lilypond",inside:null}}},rest:e.languages.scheme}},punctuation:/#/}},string:{pattern:/"(?:[^"\\]|\\.)*"/,greedy:!0},"class-name":{pattern:/(\\new\s+)[\w-]+/,lookbehind:!0},keyword:{pattern:/\\[a-z][-\w]*/i,inside:{punctuation:/^\\/}},operator:/[=|]|<<|>>/,punctuation:{pattern:/(^|[a-z\d])(?:'+|,+|[_^]?-[_^]?(?:[-+^!>._]|(?=\d))|[_^]\.?|[.!])|[{}()[\]<>^~]|\\[()[\]<>\\!]|--|__/,lookbehind:!0},number:/\b\d+(?:\/\d+)?\b/};i["embedded-scheme"].inside.scheme.inside["embedded-lilypond"].inside.lilypond.inside=i,e.languages.ly=i}(e)}e.exports=i,i.displayName="lilypond",i.aliases=[]},34927(e,t,n){"use strict";var r=n(93205);function i(e){e.register(r),e.languages.liquid={comment:{pattern:/(^\{%\s*comment\s*%\})[\s\S]+(?=\{%\s*endcomment\s*%\}$)/,lookbehind:!0},delimiter:{pattern:/^\{(?:\{\{|[%\{])-?|-?(?:\}\}|[%\}])\}$/,alias:"punctuation"},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},keyword:/\b(?:as|assign|break|continue|cycle|decrement|echo|else|elsif|(?:end)?(?:capture|case|comment|for|form|if|paginate|style|raw|tablerow|unless)|in|include|increment|limit|liquid|offset|range|render|reversed|section|when|with)\b/,function:[{pattern:/(\|\s*)\w+/,lookbehind:!0,alias:"filter"},{pattern:/(\.\s*)(?:first|last|size)/,lookbehind:!0}],boolean:/\b(?:true|false|nil)\b/,range:{pattern:/\.\./,alias:"operator"},number:/\b\d+(?:\.\d+)?\b/,operator:/[!=]=|<>|[<>]=?|[|?:=-]|\b(?:and|or|contains(?=\s))\b/,punctuation:/[.,\[\]()]/},e.hooks.add("before-tokenize",function(t){var n=/\{%\s*comment\s*%\}[\s\S]*?\{%\s*endcomment\s*%\}|\{(?:%[\s\S]*?%|\{\{[\s\S]*?\}\}|\{[\s\S]*?\})\}/g,r=!1;e.languages["markup-templating"].buildPlaceholders(t,"liquid",n,function(e){var t=/^\{%-?\s*(\w+)/.exec(e);if(t){var n=t[1];if("raw"===n&&!r)return r=!0,!0;if("endraw"===n)return r=!1,!0}return!r})}),e.hooks.add("after-tokenize",function(t){e.languages["markup-templating"].tokenizePlaceholders(t,"liquid")})}e.exports=i,i.displayName="liquid",i.aliases=[]},3848(e){"use strict";function t(e){!function(e){function t(e){return RegExp("(\\()"+e+"(?=[\\s\\)])")}function n(e){return RegExp("([\\s([])"+e+"(?=[\\s)])")}var r="[-+*/_~!@$%^=<>{}\\w]+",i="&"+r,a="(\\()",o="(?=\\))",s="(?=\\s)",u={heading:{pattern:/;;;.*/,alias:["comment","title"]},comment:/;.*/,string:{pattern:/"(?:[^"\\]|\\.)*"/,greedy:!0,inside:{argument:/[-A-Z]+(?=[.,\s])/,symbol:RegExp("`"+r+"'")}},"quoted-symbol":{pattern:RegExp("#?'"+r),alias:["variable","symbol"]},"lisp-property":{pattern:RegExp(":"+r),alias:"property"},splice:{pattern:RegExp(",@?"+r),alias:["symbol","variable"]},keyword:[{pattern:RegExp(a+"(?:(?:lexical-)?let\\*?|(?:cl-)?letf|if|when|while|unless|cons|cl-loop|and|or|not|cond|setq|error|message|null|require|provide|use-package)"+s),lookbehind:!0},{pattern:RegExp(a+"(?:for|do|collect|return|finally|append|concat|in|by)"+s),lookbehind:!0}],declare:{pattern:t("declare"),lookbehind:!0,alias:"keyword"},interactive:{pattern:t("interactive"),lookbehind:!0,alias:"keyword"},boolean:{pattern:n("(?:t|nil)"),lookbehind:!0},number:{pattern:n("[-+]?\\d+(?:\\.\\d*)?"),lookbehind:!0},defvar:{pattern:RegExp(a+"def(?:var|const|custom|group)\\s+"+r),lookbehind:!0,inside:{keyword:/^def[a-z]+/,variable:RegExp(r)}},defun:{pattern:RegExp(a+"(?:cl-)?(?:defun\\*?|defmacro)\\s+"+r+"\\s+\\([\\s\\S]*?\\)"),lookbehind:!0,inside:{keyword:/^(?:cl-)?def\S+/,arguments:null,function:{pattern:RegExp("(^\\s)"+r),lookbehind:!0},punctuation:/[()]/}},lambda:{pattern:RegExp(a+"lambda\\s+\\(\\s*(?:&?"+r+"(?:\\s+&?"+r+")*\\s*)?\\)"),lookbehind:!0,inside:{keyword:/^lambda/,arguments:null,punctuation:/[()]/}},car:{pattern:RegExp(a+r),lookbehind:!0},punctuation:[/(?:['`,]?\(|[)\[\]])/,{pattern:/(\s)\.(?=\s)/,lookbehind:!0}]},c={"lisp-marker":RegExp(i),rest:{argument:{pattern:RegExp(r),alias:"variable"},varform:{pattern:RegExp(a+r+"\\s+\\S[\\s\\S]*"+o),lookbehind:!0,inside:{string:u.string,boolean:u.boolean,number:u.number,symbol:u.symbol,punctuation:/[()]/}}}},l="\\S+(?:\\s+\\S+)*",f={pattern:RegExp(a+"[\\s\\S]*"+o),lookbehind:!0,inside:{"rest-vars":{pattern:RegExp("&(?:rest|body)\\s+"+l),inside:c},"other-marker-vars":{pattern:RegExp("&(?:optional|aux)\\s+"+l),inside:c},keys:{pattern:RegExp("&key\\s+"+l+"(?:\\s+&allow-other-keys)?"),inside:c},argument:{pattern:RegExp(r),alias:"variable"},punctuation:/[()]/}};u.lambda.inside.arguments=f,u.defun.inside.arguments=e.util.clone(f),u.defun.inside.arguments.inside.sublist=f,e.languages.lisp=u,e.languages.elisp=u,e.languages.emacs=u,e.languages["emacs-lisp"]=u}(e)}e.exports=t,t.displayName="lisp",t.aliases=[]},41469(e){"use strict";function t(e){e.languages.livescript={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?\*\//,lookbehind:!0},{pattern:/(^|[^\\])#.*/,lookbehind:!0}],"interpolated-string":{pattern:/(^|[^"])("""|")(?:\\[\s\S]|(?!\2)[^\\])*\2(?!")/,lookbehind:!0,greedy:!0,inside:{variable:{pattern:/(^|[^\\])#[a-z_](?:-?[a-z]|[\d_])*/m,lookbehind:!0},interpolation:{pattern:/(^|[^\\])#\{[^}]+\}/m,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^#\{|\}$/,alias:"variable"}}},string:/[\s\S]+/}},string:[{pattern:/('''|')(?:\\[\s\S]|(?!\1)[^\\])*\1/,greedy:!0},{pattern:/<\[[\s\S]*?\]>/,greedy:!0},/\\[^\s,;\])}]+/],regex:[{pattern:/\/\/(?:\[[^\r\n\]]*\]|\\.|(?!\/\/)[^\\\[])+\/\/[gimyu]{0,5}/,greedy:!0,inside:{comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0}}},{pattern:/\/(?:\[[^\r\n\]]*\]|\\.|[^/\\\r\n\[])+\/[gimyu]{0,5}/,greedy:!0}],keyword:{pattern:/(^|(?!-).)\b(?:break|case|catch|class|const|continue|default|do|else|extends|fallthrough|finally|for(?: ever)?|function|if|implements|it|let|loop|new|null|otherwise|own|return|super|switch|that|then|this|throw|try|unless|until|var|void|when|while|yield)(?!-)\b/m,lookbehind:!0},"keyword-operator":{pattern:/(^|[^-])\b(?:(?:delete|require|typeof)!|(?:and|by|delete|export|from|import(?: all)?|in|instanceof|is(?:nt| not)?|not|of|or|til|to|typeof|with|xor)(?!-)\b)/m,lookbehind:!0,alias:"operator"},boolean:{pattern:/(^|[^-])\b(?:false|no|off|on|true|yes)(?!-)\b/m,lookbehind:!0},argument:{pattern:/(^|(?!\.&\.)[^&])&(?!&)\d*/m,lookbehind:!0,alias:"variable"},number:/\b(?:\d+~[\da-z]+|\d[\d_]*(?:\.\d[\d_]*)?(?:[a-z]\w*)?)/i,identifier:/[a-z_](?:-?[a-z]|[\d_])*/i,operator:[{pattern:/( )\.(?= )/,lookbehind:!0},/\.(?:[=~]|\.\.?)|\.(?:[&|^]|<<|>>>?)\.|:(?:=|:=?)|&&|\|[|>]|<(?:<[>=?]?|-(?:->?|>)?|\+\+?|@@?|%%?|\*\*?|!(?:~?=|--?>|~?~>)?|~(?:~?>|=)?|==?|\^\^?|[\/?]/],punctuation:/[(){}\[\]|.,:;`]/},e.languages.livescript["interpolated-string"].inside.interpolation.inside.rest=e.languages.livescript}e.exports=t,t.displayName="livescript",t.aliases=[]},73070(e){"use strict";function t(e){var t;(t=e).languages.llvm={comment:/;.*/,string:{pattern:/"[^"]*"/,greedy:!0},boolean:/\b(?:true|false)\b/,variable:/[%@!#](?:(?!\d)(?:[-$.\w]|\\[a-f\d]{2})+|\d+)/i,label:/(?!\d)(?:[-$.\w]|\\[a-f\d]{2})+:/i,type:{pattern:/\b(?:double|float|fp128|half|i[1-9]\d*|label|metadata|ppc_fp128|token|void|x86_fp80|x86_mmx)\b/,alias:"class-name"},keyword:/\b[a-z_][a-z_0-9]*\b/,number:/[+-]?\b\d+(?:\.\d+)?(?:[eE][+-]?\d+)?\b|\b0x[\dA-Fa-f]+\b|\b0xK[\dA-Fa-f]{20}\b|\b0x[ML][\dA-Fa-f]{32}\b|\b0xH[\dA-Fa-f]{4}\b/,punctuation:/[{}[\];(),.!*=<>]/}}e.exports=t,t.displayName="llvm",t.aliases=[]},35049(e){"use strict";function t(e){e.languages.log={string:{pattern:/"(?:[^"\\\r\n]|\\.)*"|'(?![st] | \w)(?:[^'\\\r\n]|\\.)*'/,greedy:!0},level:[{pattern:/\b(?:ALERT|CRIT|CRITICAL|EMERG|EMERGENCY|ERR|ERROR|FAILURE|FATAL|SEVERE)\b/,alias:["error","important"]},{pattern:/\b(?:WARN|WARNING|WRN)\b/,alias:["warning","important"]},{pattern:/\b(?:DISPLAY|INF|INFO|NOTICE|STATUS)\b/,alias:["info","keyword"]},{pattern:/\b(?:DBG|DEBUG|FINE)\b/,alias:["debug","keyword"]},{pattern:/\b(?:FINER|FINEST|TRACE|TRC|VERBOSE|VRB)\b/,alias:["trace","comment"]}],property:{pattern:/((?:^|[\]|])[ \t]*)[a-z_](?:[\w-]|\b\/\b)*(?:[. ]\(?\w(?:[\w-]|\b\/\b)*\)?)*:(?=\s)/im,lookbehind:!0},separator:{pattern:/(^|[^-+])-{3,}|={3,}|\*{3,}|- - /m,lookbehind:!0,alias:"comment"},url:/\b(?:https?|ftp|file):\/\/[^\s|,;'"]*[^\s|,;'">.]/,email:{pattern:/(^|\s)[-\w+.]+@[a-z][a-z0-9-]*(?:\.[a-z][a-z0-9-]*)+(?=\s)/,lookbehind:!0,alias:"url"},"ip-address":{pattern:/\b(?:\d{1,3}(?:\.\d{1,3}){3})\b/i,alias:"constant"},"mac-address":{pattern:/\b[a-f0-9]{2}(?::[a-f0-9]{2}){5}\b/i,alias:"constant"},domain:{pattern:/(^|\s)[a-z][a-z0-9-]*(?:\.[a-z][a-z0-9-]*)*\.[a-z][a-z0-9-]+(?=\s)/,lookbehind:!0,alias:"constant"},uuid:{pattern:/\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/i,alias:"constant"},hash:{pattern:/\b(?:[a-f0-9]{32}){1,2}\b/i,alias:"constant"},"file-path":{pattern:/\b[a-z]:[\\/][^\s|,;:(){}\[\]"']+|(^|[\s:\[\](>|])\.{0,2}\/\w[^\s|,;:(){}\[\]"']*/i,lookbehind:!0,greedy:!0,alias:"string"},date:{pattern:RegExp(/\b\d{4}[-/]\d{2}[-/]\d{2}(?:T(?=\d{1,2}:)|(?=\s\d{1,2}:))/.source+"|"+/\b\d{1,4}[-/ ](?:\d{1,2}|Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)[-/ ]\d{2,4}T?\b/.source+"|"+/\b(?:(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun)(?:\s{1,2}(?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec))?|Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s{1,2}\d{1,2}\b/.source,"i"),alias:"number"},time:{pattern:/\b\d{1,2}:\d{1,2}:\d{1,2}(?:[.,:]\d+)?(?:\s?[+-]\d{2}:?\d{2}|Z)?\b/,alias:"number"},boolean:/\b(?:true|false|null)\b/i,number:{pattern:/(^|[^.\w])(?:0x[a-f0-9]+|0o[0-7]+|0b[01]+|v?\d[\da-f]*(?:\.\d+)*(?:e[+-]?\d+)?[a-z]{0,3}\b)\b(?!\.\w)/i,lookbehind:!0},operator:/[;:?<=>~/@!$%&+\-|^(){}*#]/,punctuation:/[\[\].,]/}}e.exports=t,t.displayName="log",t.aliases=[]},8789(e){"use strict";function t(e){e.languages.lolcode={comment:[/\bOBTW\s[\s\S]*?\sTLDR\b/,/\bBTW.+/],string:{pattern:/"(?::.|[^":])*"/,inside:{variable:/:\{[^}]+\}/,symbol:[/:\([a-f\d]+\)/i,/:\[[^\]]+\]/,/:[)>o":]/]},greedy:!0},number:/(?:\B-)?(?:\b\d+(?:\.\d*)?|\B\.\d+)/,symbol:{pattern:/(^|\s)(?:A )?(?:YARN|NUMBR|NUMBAR|TROOF|BUKKIT|NOOB)(?=\s|,|$)/,lookbehind:!0,inside:{keyword:/A(?=\s)/}},label:{pattern:/((?:^|\s)(?:IM IN YR|IM OUTTA YR) )[a-zA-Z]\w*/,lookbehind:!0,alias:"string"},function:{pattern:/((?:^|\s)(?:I IZ|HOW IZ I|IZ) )[a-zA-Z]\w*/,lookbehind:!0},keyword:[{pattern:/(^|\s)(?:O HAI IM|KTHX|HAI|KTHXBYE|I HAS A|ITZ(?: A)?|R|AN|MKAY|SMOOSH|MAEK|IS NOW(?: A)?|VISIBLE|GIMMEH|O RLY\?|YA RLY|NO WAI|OIC|MEBBE|WTF\?|OMG|OMGWTF|GTFO|IM IN YR|IM OUTTA YR|FOUND YR|YR|TIL|WILE|UPPIN|NERFIN|I IZ|HOW IZ I|IF U SAY SO|SRS|HAS A|LIEK(?: A)?|IZ)(?=\s|,|$)/,lookbehind:!0},/'Z(?=\s|,|$)/],boolean:{pattern:/(^|\s)(?:WIN|FAIL)(?=\s|,|$)/,lookbehind:!0},variable:{pattern:/(^|\s)IT(?=\s|,|$)/,lookbehind:!0},operator:{pattern:/(^|\s)(?:NOT|BOTH SAEM|DIFFRINT|(?:SUM|DIFF|PRODUKT|QUOSHUNT|MOD|BIGGR|SMALLR|BOTH|EITHER|WON|ALL|ANY) OF)(?=\s|,|$)/,lookbehind:!0},punctuation:/\.{3}|…|,|!/}}e.exports=t,t.displayName="lolcode",t.aliases=[]},59803(e){"use strict";function t(e){e.languages.lua={comment:/^#!.+|--(?:\[(=*)\[[\s\S]*?\]\1\]|.*)/m,string:{pattern:/(["'])(?:(?!\1)[^\\\r\n]|\\z(?:\r\n|\s)|\\(?:\r\n|[^z]))*\1|\[(=*)\[[\s\S]*?\]\2\]/,greedy:!0},number:/\b0x[a-f\d]+(?:\.[a-f\d]*)?(?:p[+-]?\d+)?\b|\b\d+(?:\.\B|(?:\.\d*)?(?:e[+-]?\d+)?\b)|\B\.\d+(?:e[+-]?\d+)?\b/i,keyword:/\b(?:and|break|do|else|elseif|end|false|for|function|goto|if|in|local|nil|not|or|repeat|return|then|true|until|while)\b/,function:/(?!\d)\w+(?=\s*(?:[({]))/,operator:[/[-+*%^&|#]|\/\/?|<[<=]?|>[>=]?|[=~]=?/,{pattern:/(^|[^.])\.\.(?!\.)/,lookbehind:!0}],punctuation:/[\[\](){},;]|\.+|:+/}}e.exports=t,t.displayName="lua",t.aliases=[]},33055(e){"use strict";function t(e){e.languages.makefile={comment:{pattern:/(^|[^\\])#(?:\\(?:\r\n|[\s\S])|[^\\\r\n])*/,lookbehind:!0},string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},builtin:/\.[A-Z][^:#=\s]+(?=\s*:(?!=))/,symbol:{pattern:/^(?:[^:=\s]|[ \t]+(?![\s:]))+(?=\s*:(?!=))/m,inside:{variable:/\$+(?:(?!\$)[^(){}:#=\s]+|(?=[({]))/}},variable:/\$+(?:(?!\$)[^(){}:#=\s]+|\([@*%<^+?][DF]\)|(?=[({]))/,keyword:[/-include\b|\b(?:define|else|endef|endif|export|ifn?def|ifn?eq|include|override|private|sinclude|undefine|unexport|vpath)\b/,{pattern:/(\()(?:addsuffix|abspath|and|basename|call|dir|error|eval|file|filter(?:-out)?|findstring|firstword|flavor|foreach|guile|if|info|join|lastword|load|notdir|or|origin|patsubst|realpath|shell|sort|strip|subst|suffix|value|warning|wildcard|word(?:s|list)?)(?=[ \t])/,lookbehind:!0}],operator:/(?:::|[?:+!])?=|[|@]/,punctuation:/[:;(){}]/}}e.exports=t,t.displayName="makefile",t.aliases=[]},90542(e){"use strict";function t(e){!function(e){var t=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function n(e){return e=e.replace(//g,function(){return t}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+e+")")}var r=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,i=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return r}),a=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;e.languages.markdown=e.languages.extend("markup",{}),e.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"font-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:e.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+i+a+"(?:"+i+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+i+a+")(?:"+i+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(r),inside:e.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+i+")"+a+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+i+"$"),inside:{"table-header":{pattern:RegExp(r),alias:"important",inside:e.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:n(/\b__(?:(?!_)|_(?:(?!_))+_)+__\b|\*\*(?:(?!\*)|\*(?:(?!\*))+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:n(/\b_(?:(?!_)|__(?:(?!_))+__)+_\b|\*(?:(?!\*)|\*\*(?:(?!\*))+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:n(/(~~?)(?:(?!~))+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:n(/!?\[(?:(?!\]))+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\]))+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach(function(t){["url","bold","italic","strike","code-snippet"].forEach(function(n){t!==n&&(e.languages.markdown[t].inside.content.inside[n]=e.languages.markdown[n])})}),e.hooks.add("after-tokenize",function(e){("markdown"===e.language||"md"===e.language)&&t(e.tokens);function t(e){if(e&&"string"!=typeof e)for(var n=0,r=e.length;n=a.length);u++){var c=s[u];if("string"==typeof c||c.content&&"string"==typeof c.content){var l=a[i],f=n.tokenStack[l],d="string"==typeof c?c:c.content,h=t(r,l),p=d.indexOf(h);if(p>-1){++i;var b=d.substring(0,p),m=new e.Token(r,e.tokenize(f,n.grammar),"language-"+r,f),g=d.substring(p+h.length),v=[];b&&v.push.apply(v,o([b])),v.push(m),g&&v.push.apply(v,o([g])),"string"==typeof c?s.splice.apply(s,[u,1].concat(v)):c.content=v}}else c.content&&o(c.content)}return s}}}})}(e)}e.exports=t,t.displayName="markupTemplating",t.aliases=[]},2717(e){"use strict";function t(e){e.languages.markup={comment://,prolog:/<\?[\s\S]+?\?>/,doctype:{pattern:/"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^$|[[\]]/,"doctype-tag":/^DOCTYPE/,name:/[^\s<>'"]+/}},cdata://i,tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},e.languages.markup.tag.inside["attr-value"].inside.entity=e.languages.markup.entity,e.languages.markup.doctype.inside["internal-subset"].inside=e.languages.markup,e.hooks.add("wrap",function(e){"entity"===e.type&&(e.attributes.title=e.content.value.replace(/&/,"&"))}),Object.defineProperty(e.languages.markup.tag,"addInlined",{value:function(t,n){var r={};r["language-"+n]={pattern:/(^$)/i,lookbehind:!0,inside:e.languages[n]},r.cdata=/^$/i;var i={"included-cdata":{pattern://i,inside:r}};i["language-"+n]={pattern:/[\s\S]+/,inside:e.languages[n]};var a={};a[t]={pattern:RegExp(/(<__[^>]*>)(?:))*\]\]>|(?!)/.source.replace(/__/g,function(){return t}),"i"),lookbehind:!0,greedy:!0,inside:i},e.languages.insertBefore("markup","cdata",a)}}),Object.defineProperty(e.languages.markup.tag,"addAttribute",{value:function(t,n){e.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+t+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[n,"language-"+n],inside:e.languages[n]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),e.languages.html=e.languages.markup,e.languages.mathml=e.languages.markup,e.languages.svg=e.languages.markup,e.languages.xml=e.languages.extend("markup",{}),e.languages.ssml=e.languages.xml,e.languages.atom=e.languages.xml,e.languages.rss=e.languages.xml}e.exports=t,t.displayName="markup",t.aliases=["html","mathml","svg","xml","ssml","atom","rss"]},27992(e){"use strict";function t(e){e.languages.matlab={comment:[/%\{[\s\S]*?\}%/,/%.+/],string:{pattern:/\B'(?:''|[^'\r\n])*'/,greedy:!0},number:/(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[eE][+-]?\d+)?(?:[ij])?|\b[ij]\b/,keyword:/\b(?:break|case|catch|continue|else|elseif|end|for|function|if|inf|NaN|otherwise|parfor|pause|pi|return|switch|try|while)\b/,function:/\b(?!\d)\w+(?=\s*\()/,operator:/\.?[*^\/\\']|[+\-:@]|[<>=~]=?|&&?|\|\|?/,punctuation:/\.{3}|[.,;\[\](){}!]/}}e.exports=t,t.displayName="matlab",t.aliases=[]},606(e){"use strict";function t(e){e.languages.mel={comment:/\/\/.*/,code:{pattern:/`(?:\\.|[^\\`\r\n])*`/,greedy:!0,alias:"italic",inside:{delimiter:{pattern:/^`|`$/,alias:"punctuation"}}},string:{pattern:/"(?:\\.|[^\\"\r\n])*"/,greedy:!0},variable:/\$\w+/,number:/\b0x[\da-fA-F]+\b|\b\d+(?:\.\d*)?|\B\.\d+/,flag:{pattern:/-[^\d\W]\w*/,alias:"operator"},keyword:/\b(?:break|case|continue|default|do|else|float|for|global|if|in|int|matrix|proc|return|string|switch|vector|while)\b/,function:/\b\w+(?=\()|\b(?:about|abs|addAttr|addAttributeEditorNodeHelp|addDynamic|addNewShelfTab|addPP|addPanelCategory|addPrefixToName|advanceToNextDrivenKey|affectedNet|affects|aimConstraint|air|alias|aliasAttr|align|alignCtx|alignCurve|alignSurface|allViewFit|ambientLight|angle|angleBetween|animCone|animCurveEditor|animDisplay|animView|annotate|appendStringArray|applicationName|applyAttrPreset|applyTake|arcLenDimContext|arcLengthDimension|arclen|arrayMapper|art3dPaintCtx|artAttrCtx|artAttrPaintVertexCtx|artAttrSkinPaintCtx|artAttrTool|artBuildPaintMenu|artFluidAttrCtx|artPuttyCtx|artSelectCtx|artSetPaintCtx|artUserPaintCtx|assignCommand|assignInputDevice|assignViewportFactories|attachCurve|attachDeviceAttr|attachSurface|attrColorSliderGrp|attrCompatibility|attrControlGrp|attrEnumOptionMenu|attrEnumOptionMenuGrp|attrFieldGrp|attrFieldSliderGrp|attrNavigationControlGrp|attrPresetEditWin|attributeExists|attributeInfo|attributeMenu|attributeQuery|autoKeyframe|autoPlace|bakeClip|bakeFluidShading|bakePartialHistory|bakeResults|bakeSimulation|basename|basenameEx|batchRender|bessel|bevel|bevelPlus|binMembership|bindSkin|blend2|blendShape|blendShapeEditor|blendShapePanel|blendTwoAttr|blindDataType|boneLattice|boundary|boxDollyCtx|boxZoomCtx|bufferCurve|buildBookmarkMenu|buildKeyframeMenu|button|buttonManip|CBG|cacheFile|cacheFileCombine|cacheFileMerge|cacheFileTrack|camera|cameraView|canCreateManip|canvas|capitalizeString|catch|catchQuiet|ceil|changeSubdivComponentDisplayLevel|changeSubdivRegion|channelBox|character|characterMap|characterOutlineEditor|characterize|chdir|checkBox|checkBoxGrp|checkDefaultRenderGlobals|choice|circle|circularFillet|clamp|clear|clearCache|clip|clipEditor|clipEditorCurrentTimeCtx|clipSchedule|clipSchedulerOutliner|clipTrimBefore|closeCurve|closeSurface|cluster|cmdFileOutput|cmdScrollFieldExecuter|cmdScrollFieldReporter|cmdShell|coarsenSubdivSelectionList|collision|color|colorAtPoint|colorEditor|colorIndex|colorIndexSliderGrp|colorSliderButtonGrp|colorSliderGrp|columnLayout|commandEcho|commandLine|commandPort|compactHairSystem|componentEditor|compositingInterop|computePolysetVolume|condition|cone|confirmDialog|connectAttr|connectControl|connectDynamic|connectJoint|connectionInfo|constrain|constrainValue|constructionHistory|container|containsMultibyte|contextInfo|control|convertFromOldLayers|convertIffToPsd|convertLightmap|convertSolidTx|convertTessellation|convertUnit|copyArray|copyFlexor|copyKey|copySkinWeights|cos|cpButton|cpCache|cpClothSet|cpCollision|cpConstraint|cpConvClothToMesh|cpForces|cpGetSolverAttr|cpPanel|cpProperty|cpRigidCollisionFilter|cpSeam|cpSetEdit|cpSetSolverAttr|cpSolver|cpSolverTypes|cpTool|cpUpdateClothUVs|createDisplayLayer|createDrawCtx|createEditor|createLayeredPsdFile|createMotionField|createNewShelf|createNode|createRenderLayer|createSubdivRegion|cross|crossProduct|ctxAbort|ctxCompletion|ctxEditMode|ctxTraverse|currentCtx|currentTime|currentTimeCtx|currentUnit|curve|curveAddPtCtx|curveCVCtx|curveEPCtx|curveEditorCtx|curveIntersect|curveMoveEPCtx|curveOnSurface|curveSketchCtx|cutKey|cycleCheck|cylinder|dagPose|date|defaultLightListCheckBox|defaultNavigation|defineDataServer|defineVirtualDevice|deformer|deg_to_rad|delete|deleteAttr|deleteShadingGroupsAndMaterials|deleteShelfTab|deleteUI|deleteUnusedBrushes|delrandstr|detachCurve|detachDeviceAttr|detachSurface|deviceEditor|devicePanel|dgInfo|dgdirty|dgeval|dgtimer|dimWhen|directKeyCtx|directionalLight|dirmap|dirname|disable|disconnectAttr|disconnectJoint|diskCache|displacementToPoly|displayAffected|displayColor|displayCull|displayLevelOfDetail|displayPref|displayRGBColor|displaySmoothness|displayStats|displayString|displaySurface|distanceDimContext|distanceDimension|doBlur|dolly|dollyCtx|dopeSheetEditor|dot|dotProduct|doubleProfileBirailSurface|drag|dragAttrContext|draggerContext|dropoffLocator|duplicate|duplicateCurve|duplicateSurface|dynCache|dynControl|dynExport|dynExpression|dynGlobals|dynPaintEditor|dynParticleCtx|dynPref|dynRelEdPanel|dynRelEditor|dynamicLoad|editAttrLimits|editDisplayLayerGlobals|editDisplayLayerMembers|editRenderLayerAdjustment|editRenderLayerGlobals|editRenderLayerMembers|editor|editorTemplate|effector|emit|emitter|enableDevice|encodeString|endString|endsWith|env|equivalent|equivalentTol|erf|error|eval|evalDeferred|evalEcho|event|exactWorldBoundingBox|exclusiveLightCheckBox|exec|executeForEachObject|exists|exp|expression|expressionEditorListen|extendCurve|extendSurface|extrude|fcheck|fclose|feof|fflush|fgetline|fgetword|file|fileBrowserDialog|fileDialog|fileExtension|fileInfo|filetest|filletCurve|filter|filterCurve|filterExpand|filterStudioImport|findAllIntersections|findAnimCurves|findKeyframe|findMenuItem|findRelatedSkinCluster|finder|firstParentOf|fitBspline|flexor|floatEq|floatField|floatFieldGrp|floatScrollBar|floatSlider|floatSlider2|floatSliderButtonGrp|floatSliderGrp|floor|flow|fluidCacheInfo|fluidEmitter|fluidVoxelInfo|flushUndo|fmod|fontDialog|fopen|formLayout|format|fprint|frameLayout|fread|freeFormFillet|frewind|fromNativePath|fwrite|gamma|gauss|geometryConstraint|getApplicationVersionAsFloat|getAttr|getClassification|getDefaultBrush|getFileList|getFluidAttr|getInputDeviceRange|getMayaPanelTypes|getModifiers|getPanel|getParticleAttr|getPluginResource|getenv|getpid|glRender|glRenderEditor|globalStitch|gmatch|goal|gotoBindPose|grabColor|gradientControl|gradientControlNoAttr|graphDollyCtx|graphSelectContext|graphTrackCtx|gravity|grid|gridLayout|group|groupObjectsByName|HfAddAttractorToAS|HfAssignAS|HfBuildEqualMap|HfBuildFurFiles|HfBuildFurImages|HfCancelAFR|HfConnectASToHF|HfCreateAttractor|HfDeleteAS|HfEditAS|HfPerformCreateAS|HfRemoveAttractorFromAS|HfSelectAttached|HfSelectAttractors|HfUnAssignAS|hardenPointCurve|hardware|hardwareRenderPanel|headsUpDisplay|headsUpMessage|help|helpLine|hermite|hide|hilite|hitTest|hotBox|hotkey|hotkeyCheck|hsv_to_rgb|hudButton|hudSlider|hudSliderButton|hwReflectionMap|hwRender|hwRenderLoad|hyperGraph|hyperPanel|hyperShade|hypot|iconTextButton|iconTextCheckBox|iconTextRadioButton|iconTextRadioCollection|iconTextScrollList|iconTextStaticLabel|ikHandle|ikHandleCtx|ikHandleDisplayScale|ikSolver|ikSplineHandleCtx|ikSystem|ikSystemInfo|ikfkDisplayMethod|illustratorCurves|image|imfPlugins|inheritTransform|insertJoint|insertJointCtx|insertKeyCtx|insertKnotCurve|insertKnotSurface|instance|instanceable|instancer|intField|intFieldGrp|intScrollBar|intSlider|intSliderGrp|interToUI|internalVar|intersect|iprEngine|isAnimCurve|isConnected|isDirty|isParentOf|isSameObject|isTrue|isValidObjectName|isValidString|isValidUiName|isolateSelect|itemFilter|itemFilterAttr|itemFilterRender|itemFilterType|joint|jointCluster|jointCtx|jointDisplayScale|jointLattice|keyTangent|keyframe|keyframeOutliner|keyframeRegionCurrentTimeCtx|keyframeRegionDirectKeyCtx|keyframeRegionDollyCtx|keyframeRegionInsertKeyCtx|keyframeRegionMoveKeyCtx|keyframeRegionScaleKeyCtx|keyframeRegionSelectKeyCtx|keyframeRegionSetKeyCtx|keyframeRegionTrackCtx|keyframeStats|lassoContext|lattice|latticeDeformKeyCtx|launch|launchImageEditor|layerButton|layeredShaderPort|layeredTexturePort|layout|layoutDialog|lightList|lightListEditor|lightListPanel|lightlink|lineIntersection|linearPrecision|linstep|listAnimatable|listAttr|listCameras|listConnections|listDeviceAttachments|listHistory|listInputDeviceAxes|listInputDeviceButtons|listInputDevices|listMenuAnnotation|listNodeTypes|listPanelCategories|listRelatives|listSets|listTransforms|listUnselected|listerEditor|loadFluid|loadNewShelf|loadPlugin|loadPluginLanguageResources|loadPrefObjects|localizedPanelLabel|lockNode|loft|log|longNameOf|lookThru|ls|lsThroughFilter|lsType|lsUI|Mayatomr|mag|makeIdentity|makeLive|makePaintable|makeRoll|makeSingleSurface|makeTubeOn|makebot|manipMoveContext|manipMoveLimitsCtx|manipOptions|manipRotateContext|manipRotateLimitsCtx|manipScaleContext|manipScaleLimitsCtx|marker|match|max|memory|menu|menuBarLayout|menuEditor|menuItem|menuItemToShelf|menuSet|menuSetPref|messageLine|min|minimizeApp|mirrorJoint|modelCurrentTimeCtx|modelEditor|modelPanel|mouse|movIn|movOut|move|moveIKtoFK|moveKeyCtx|moveVertexAlongDirection|multiProfileBirailSurface|mute|nParticle|nameCommand|nameField|namespace|namespaceInfo|newPanelItems|newton|nodeCast|nodeIconButton|nodeOutliner|nodePreset|nodeType|noise|nonLinear|normalConstraint|normalize|nurbsBoolean|nurbsCopyUVSet|nurbsCube|nurbsEditUV|nurbsPlane|nurbsSelect|nurbsSquare|nurbsToPoly|nurbsToPolygonsPref|nurbsToSubdiv|nurbsToSubdivPref|nurbsUVSet|nurbsViewDirectionVector|objExists|objectCenter|objectLayer|objectType|objectTypeUI|obsoleteProc|oceanNurbsPreviewPlane|offsetCurve|offsetCurveOnSurface|offsetSurface|openGLExtension|openMayaPref|optionMenu|optionMenuGrp|optionVar|orbit|orbitCtx|orientConstraint|outlinerEditor|outlinerPanel|overrideModifier|paintEffectsDisplay|pairBlend|palettePort|paneLayout|panel|panelConfiguration|panelHistory|paramDimContext|paramDimension|paramLocator|parent|parentConstraint|particle|particleExists|particleInstancer|particleRenderInfo|partition|pasteKey|pathAnimation|pause|pclose|percent|performanceOptions|pfxstrokes|pickWalk|picture|pixelMove|planarSrf|plane|play|playbackOptions|playblast|plugAttr|plugNode|pluginInfo|pluginResourceUtil|pointConstraint|pointCurveConstraint|pointLight|pointMatrixMult|pointOnCurve|pointOnSurface|pointPosition|poleVectorConstraint|polyAppend|polyAppendFacetCtx|polyAppendVertex|polyAutoProjection|polyAverageNormal|polyAverageVertex|polyBevel|polyBlendColor|polyBlindData|polyBoolOp|polyBridgeEdge|polyCacheMonitor|polyCheck|polyChipOff|polyClipboard|polyCloseBorder|polyCollapseEdge|polyCollapseFacet|polyColorBlindData|polyColorDel|polyColorPerVertex|polyColorSet|polyCompare|polyCone|polyCopyUV|polyCrease|polyCreaseCtx|polyCreateFacet|polyCreateFacetCtx|polyCube|polyCut|polyCutCtx|polyCylinder|polyCylindricalProjection|polyDelEdge|polyDelFacet|polyDelVertex|polyDuplicateAndConnect|polyDuplicateEdge|polyEditUV|polyEditUVShell|polyEvaluate|polyExtrudeEdge|polyExtrudeFacet|polyExtrudeVertex|polyFlipEdge|polyFlipUV|polyForceUV|polyGeoSampler|polyHelix|polyInfo|polyInstallAction|polyLayoutUV|polyListComponentConversion|polyMapCut|polyMapDel|polyMapSew|polyMapSewMove|polyMergeEdge|polyMergeEdgeCtx|polyMergeFacet|polyMergeFacetCtx|polyMergeUV|polyMergeVertex|polyMirrorFace|polyMoveEdge|polyMoveFacet|polyMoveFacetUV|polyMoveUV|polyMoveVertex|polyNormal|polyNormalPerVertex|polyNormalizeUV|polyOptUvs|polyOptions|polyOutput|polyPipe|polyPlanarProjection|polyPlane|polyPlatonicSolid|polyPoke|polyPrimitive|polyPrism|polyProjection|polyPyramid|polyQuad|polyQueryBlindData|polyReduce|polySelect|polySelectConstraint|polySelectConstraintMonitor|polySelectCtx|polySelectEditCtx|polySeparate|polySetToFaceNormal|polySewEdge|polyShortestPathCtx|polySmooth|polySoftEdge|polySphere|polySphericalProjection|polySplit|polySplitCtx|polySplitEdge|polySplitRing|polySplitVertex|polyStraightenUVBorder|polySubdivideEdge|polySubdivideFacet|polyToSubdiv|polyTorus|polyTransfer|polyTriangulate|polyUVSet|polyUnite|polyWedgeFace|popen|popupMenu|pose|pow|preloadRefEd|print|progressBar|progressWindow|projFileViewer|projectCurve|projectTangent|projectionContext|projectionManip|promptDialog|propModCtx|propMove|psdChannelOutliner|psdEditTextureFile|psdExport|psdTextureFile|putenv|pwd|python|querySubdiv|quit|rad_to_deg|radial|radioButton|radioButtonGrp|radioCollection|radioMenuItemCollection|rampColorPort|rand|randomizeFollicles|randstate|rangeControl|readTake|rebuildCurve|rebuildSurface|recordAttr|recordDevice|redo|reference|referenceEdit|referenceQuery|refineSubdivSelectionList|refresh|refreshAE|registerPluginResource|rehash|reloadImage|removeJoint|removeMultiInstance|removePanelCategory|rename|renameAttr|renameSelectionList|renameUI|render|renderGlobalsNode|renderInfo|renderLayerButton|renderLayerParent|renderLayerPostProcess|renderLayerUnparent|renderManip|renderPartition|renderQualityNode|renderSettings|renderThumbnailUpdate|renderWindowEditor|renderWindowSelectContext|renderer|reorder|reorderDeformers|requires|reroot|resampleFluid|resetAE|resetPfxToPolyCamera|resetTool|resolutionNode|retarget|reverseCurve|reverseSurface|revolve|rgb_to_hsv|rigidBody|rigidSolver|roll|rollCtx|rootOf|rot|rotate|rotationInterpolation|roundConstantRadius|rowColumnLayout|rowLayout|runTimeCommand|runup|sampleImage|saveAllShelves|saveAttrPreset|saveFluid|saveImage|saveInitialState|saveMenu|savePrefObjects|savePrefs|saveShelf|saveToolSettings|scale|scaleBrushBrightness|scaleComponents|scaleConstraint|scaleKey|scaleKeyCtx|sceneEditor|sceneUIReplacement|scmh|scriptCtx|scriptEditorInfo|scriptJob|scriptNode|scriptTable|scriptToShelf|scriptedPanel|scriptedPanelType|scrollField|scrollLayout|sculpt|searchPathArray|seed|selLoadSettings|select|selectContext|selectCurveCV|selectKey|selectKeyCtx|selectKeyframeRegionCtx|selectMode|selectPref|selectPriority|selectType|selectedNodes|selectionConnection|separator|setAttr|setAttrEnumResource|setAttrMapping|setAttrNiceNameResource|setConstraintRestPosition|setDefaultShadingGroup|setDrivenKeyframe|setDynamic|setEditCtx|setEditor|setFluidAttr|setFocus|setInfinity|setInputDeviceMapping|setKeyCtx|setKeyPath|setKeyframe|setKeyframeBlendshapeTargetWts|setMenuMode|setNodeNiceNameResource|setNodeTypeFlag|setParent|setParticleAttr|setPfxToPolyCamera|setPluginResource|setProject|setStampDensity|setStartupMessage|setState|setToolTo|setUITemplate|setXformManip|sets|shadingConnection|shadingGeometryRelCtx|shadingLightRelCtx|shadingNetworkCompare|shadingNode|shapeCompare|shelfButton|shelfLayout|shelfTabLayout|shellField|shortNameOf|showHelp|showHidden|showManipCtx|showSelectionInTitle|showShadingGroupAttrEditor|showWindow|sign|simplify|sin|singleProfileBirailSurface|size|sizeBytes|skinCluster|skinPercent|smoothCurve|smoothTangentSurface|smoothstep|snap2to2|snapKey|snapMode|snapTogetherCtx|snapshot|soft|softMod|softModCtx|sort|sound|soundControl|source|spaceLocator|sphere|sphrand|spotLight|spotLightPreviewPort|spreadSheetEditor|spring|sqrt|squareSurface|srtContext|stackTrace|startString|startsWith|stitchAndExplodeShell|stitchSurface|stitchSurfacePoints|strcmp|stringArrayCatenate|stringArrayContains|stringArrayCount|stringArrayInsertAtIndex|stringArrayIntersector|stringArrayRemove|stringArrayRemoveAtIndex|stringArrayRemoveDuplicates|stringArrayRemoveExact|stringArrayToString|stringToStringArray|strip|stripPrefixFromName|stroke|subdAutoProjection|subdCleanTopology|subdCollapse|subdDuplicateAndConnect|subdEditUV|subdListComponentConversion|subdMapCut|subdMapSewMove|subdMatchTopology|subdMirror|subdToBlind|subdToPoly|subdTransferUVsToCache|subdiv|subdivCrease|subdivDisplaySmoothness|substitute|substituteAllString|substituteGeometry|substring|surface|surfaceSampler|surfaceShaderList|swatchDisplayPort|switchTable|symbolButton|symbolCheckBox|sysFile|system|tabLayout|tan|tangentConstraint|texLatticeDeformContext|texManipContext|texMoveContext|texMoveUVShellContext|texRotateContext|texScaleContext|texSelectContext|texSelectShortestPathCtx|texSmudgeUVContext|texWinToolCtx|text|textCurves|textField|textFieldButtonGrp|textFieldGrp|textManip|textScrollList|textToShelf|textureDisplacePlane|textureHairColor|texturePlacementContext|textureWindow|threadCount|threePointArcCtx|timeControl|timePort|timerX|toNativePath|toggle|toggleAxis|toggleWindowVisibility|tokenize|tokenizeList|tolerance|tolower|toolButton|toolCollection|toolDropped|toolHasOptions|toolPropertyWindow|torus|toupper|trace|track|trackCtx|transferAttributes|transformCompare|transformLimits|translator|trim|trunc|truncateFluidCache|truncateHairCache|tumble|tumbleCtx|turbulence|twoPointArcCtx|uiRes|uiTemplate|unassignInputDevice|undo|undoInfo|ungroup|uniform|unit|unloadPlugin|untangleUV|untitledFileName|untrim|upAxis|updateAE|userCtx|uvLink|uvSnapshot|validateShelfName|vectorize|view2dToolCtx|viewCamera|viewClipPlane|viewFit|viewHeadOn|viewLookAt|viewManip|viewPlace|viewSet|visor|volumeAxis|vortex|waitCursor|warning|webBrowser|webBrowserPrefs|whatIs|window|windowPref|wire|wireContext|workspace|wrinkle|wrinkleContext|writeTake|xbmLangPathList|xform)\b/,operator:[/\+[+=]?|-[-=]?|&&|\|\||[<>]=|[*\/!=]=?|[%^]/,{pattern:/(^|[^<])<(?!<)/,lookbehind:!0},{pattern:/(^|[^>])>(?!>)/,lookbehind:!0}],punctuation:/<<|>>|[.,:;?\[\](){}]/},e.languages.mel.code.inside.rest=e.languages.mel}e.exports=t,t.displayName="mel",t.aliases=[]},23388(e){"use strict";function t(e){e.languages.mizar={comment:/::.+/,keyword:/@proof\b|\b(?:according|aggregate|all|and|antonym|are|as|associativity|assume|asymmetry|attr|be|begin|being|by|canceled|case|cases|clusters?|coherence|commutativity|compatibility|connectedness|consider|consistency|constructors|contradiction|correctness|def|deffunc|define|definitions?|defpred|do|does|equals|end|environ|ex|exactly|existence|for|from|func|given|hence|hereby|holds|idempotence|identity|iff?|implies|involutiveness|irreflexivity|is|it|let|means|mode|non|not|notations?|now|of|or|otherwise|over|per|pred|prefix|projectivity|proof|provided|qua|reconsider|redefine|reduce|reducibility|reflexivity|registrations?|requirements|reserve|sch|schemes?|section|selector|set|sethood|st|struct|such|suppose|symmetry|synonym|take|that|the|then|theorems?|thesis|thus|to|transitivity|uniqueness|vocabular(?:y|ies)|when|where|with|wrt)\b/,parameter:{pattern:/\$(?:10|\d)/,alias:"variable"},variable:/\b\w+(?=:)/,number:/(?:\b|-)\d+\b/,operator:/\.\.\.|->|&|\.?=/,punctuation:/\(#|#\)|[,:;\[\](){}]/}}e.exports=t,t.displayName="mizar",t.aliases=[]},90596(e){"use strict";function t(e){var t,n,r,i;t=e,r=["ObjectId","Code","BinData","DBRef","Timestamp","NumberLong","NumberDecimal","MaxKey","MinKey","RegExp","ISODate","UUID"],i="(?:"+(n=(n=["$eq","$gt","$gte","$in","$lt","$lte","$ne","$nin","$and","$not","$nor","$or","$exists","$type","$expr","$jsonSchema","$mod","$regex","$text","$where","$geoIntersects","$geoWithin","$near","$nearSphere","$all","$elemMatch","$size","$bitsAllClear","$bitsAllSet","$bitsAnyClear","$bitsAnySet","$comment","$elemMatch","$meta","$slice","$currentDate","$inc","$min","$max","$mul","$rename","$set","$setOnInsert","$unset","$addToSet","$pop","$pull","$push","$pullAll","$each","$position","$slice","$sort","$bit","$addFields","$bucket","$bucketAuto","$collStats","$count","$currentOp","$facet","$geoNear","$graphLookup","$group","$indexStats","$limit","$listLocalSessions","$listSessions","$lookup","$match","$merge","$out","$planCacheStats","$project","$redact","$replaceRoot","$replaceWith","$sample","$set","$skip","$sort","$sortByCount","$unionWith","$unset","$unwind","$abs","$accumulator","$acos","$acosh","$add","$addToSet","$allElementsTrue","$and","$anyElementTrue","$arrayElemAt","$arrayToObject","$asin","$asinh","$atan","$atan2","$atanh","$avg","$binarySize","$bsonSize","$ceil","$cmp","$concat","$concatArrays","$cond","$convert","$cos","$dateFromParts","$dateToParts","$dateFromString","$dateToString","$dayOfMonth","$dayOfWeek","$dayOfYear","$degreesToRadians","$divide","$eq","$exp","$filter","$first","$floor","$function","$gt","$gte","$hour","$ifNull","$in","$indexOfArray","$indexOfBytes","$indexOfCP","$isArray","$isNumber","$isoDayOfWeek","$isoWeek","$isoWeekYear","$last","$last","$let","$literal","$ln","$log","$log10","$lt","$lte","$ltrim","$map","$max","$mergeObjects","$meta","$min","$millisecond","$minute","$mod","$month","$multiply","$ne","$not","$objectToArray","$or","$pow","$push","$radiansToDegrees","$range","$reduce","$regexFind","$regexFindAll","$regexMatch","$replaceOne","$replaceAll","$reverseArray","$round","$rtrim","$second","$setDifference","$setEquals","$setIntersection","$setIsSubset","$setUnion","$size","$sin","$slice","$split","$sqrt","$stdDevPop","$stdDevSamp","$strcasecmp","$strLenBytes","$strLenCP","$substr","$substrBytes","$substrCP","$subtract","$sum","$switch","$tan","$toBool","$toDate","$toDecimal","$toDouble","$toInt","$toLong","$toObjectId","$toString","$toLower","$toUpper","$trim","$trunc","$type","$week","$year","$zip","$comment","$explain","$hint","$max","$maxTimeMS","$min","$orderby","$query","$returnKey","$showDiskLoc","$natural"]).map(function(e){return e.replace("$","\\$")})).join("|")+")\\b",t.languages.mongodb=t.languages.extend("javascript",{}),t.languages.insertBefore("mongodb","string",{property:{pattern:/(?:(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)(?=\s*:)/,greedy:!0,inside:{keyword:RegExp("^(['\"])?"+i+"(?:\\1)?$")}}}),t.languages.mongodb.string.inside={url:{pattern:/https?:\/\/[-\w@:%.+~#=]{1,256}\.[a-z0-9()]{1,6}\b[-\w()@:%+.~#?&/=]*/i,greedy:!0},entity:{pattern:/\b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b/,greedy:!0}},t.languages.insertBefore("mongodb","constant",{builtin:{pattern:RegExp("\\b(?:"+r.join("|")+")\\b"),alias:"keyword"}})}e.exports=t,t.displayName="mongodb",t.aliases=[]},95721(e){"use strict";function t(e){e.languages.monkey={string:/"[^"\r\n]*"/,comment:[{pattern:/^#Rem\s[\s\S]*?^#End/im,greedy:!0},{pattern:/'.+/,greedy:!0}],preprocessor:{pattern:/(^[ \t]*)#.+/m,lookbehind:!0,alias:"comment"},function:/\b\w+(?=\()/,"type-char":{pattern:/(\w)[?%#$]/,lookbehind:!0,alias:"variable"},number:{pattern:/((?:\.\.)?)(?:(?:\b|\B-\.?|\B\.)\d+(?:(?!\.\.)\.\d*)?|\$[\da-f]+)/i,lookbehind:!0},keyword:/\b(?:Void|Strict|Public|Private|Property|Bool|Int|Float|String|Array|Object|Continue|Exit|Import|Extern|New|Self|Super|Try|Catch|Eachin|True|False|Extends|Abstract|Final|Select|Case|Default|Const|Local|Global|Field|Method|Function|Class|End|If|Then|Else|ElseIf|EndIf|While|Wend|Repeat|Until|Forever|For|To|Step|Next|Return|Module|Interface|Implements|Inline|Throw|Null)\b/i,operator:/\.\.|<[=>]?|>=?|:?=|(?:[+\-*\/&~|]|\b(?:Mod|Shl|Shr)\b)=?|\b(?:And|Not|Or)\b/i,punctuation:/[.,:;()\[\]]/}}e.exports=t,t.displayName="monkey",t.aliases=[]},64262(e){"use strict";function t(e){e.languages.moonscript={comment:/--.*/,string:[{pattern:/'[^']*'|\[(=*)\[[\s\S]*?\]\1\]/,greedy:!0},{pattern:/"[^"]*"/,greedy:!0,inside:{interpolation:{pattern:/#\{[^{}]*\}/,inside:{moonscript:{pattern:/(^#\{)[\s\S]+(?=\})/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/#\{|\}/,alias:"punctuation"}}}}}],"class-name":[{pattern:/(\b(?:class|extends)[ \t]+)\w+/,lookbehind:!0},/\b[A-Z]\w*/],keyword:/\b(?:class|continue|do|else|elseif|export|extends|for|from|if|import|in|local|nil|return|self|super|switch|then|unless|using|when|while|with)\b/,variable:/@@?\w*/,property:{pattern:/\b(?!\d)\w+(?=:)|(:)(?!\d)\w+/,lookbehind:!0},function:{pattern:/\b(?:_G|_VERSION|assert|collectgarbage|coroutine\.(?:running|create|resume|status|wrap|yield)|debug\.(?:debug|gethook|getinfo|getlocal|getupvalue|setlocal|setupvalue|sethook|traceback|getfenv|getmetatable|getregistry|setfenv|setmetatable)|dofile|error|getfenv|getmetatable|io\.(?:stdin|stdout|stderr|close|flush|input|lines|open|output|popen|read|tmpfile|type|write)|ipairs|load|loadfile|loadstring|math\.(?:abs|acos|asin|atan|atan2|ceil|sin|cos|tan|deg|exp|floor|log|log10|max|min|fmod|modf|cosh|sinh|tanh|pow|rad|sqrt|frexp|ldexp|random|randomseed|pi)|module|next|os\.(?:clock|date|difftime|execute|exit|getenv|remove|rename|setlocale|time|tmpname)|package\.(?:cpath|loaded|loadlib|path|preload|seeall)|pairs|pcall|print|rawequal|rawget|rawset|require|select|setfenv|setmetatable|string\.(?:byte|char|dump|find|len|lower|rep|sub|upper|format|gsub|gmatch|match|reverse)|table\.(?:maxn|concat|sort|insert|remove)|tonumber|tostring|type|unpack|xpcall)\b/,inside:{punctuation:/\./}},boolean:/\b(?:false|true)\b/,number:/(?:\B\.\d+|\b\d+\.\d+|\b\d+(?=[eE]))(?:[eE][-+]?\d+)?\b|\b(?:0x[a-fA-F\d]+|\d+)(?:U?LL)?\b/,operator:/\.{3}|[-=]>|~=|(?:[-+*/%<>!=]|\.\.)=?|[:#^]|\b(?:and|or)\b=?|\b(?:not)\b/,punctuation:/[.,()[\]{}\\]/},e.languages.moonscript.string[1].inside.interpolation.inside.moonscript.inside=e.languages.moonscript,e.languages.moon=e.languages.moonscript}e.exports=t,t.displayName="moonscript",t.aliases=["moon"]},18190(e){"use strict";function t(e){e.languages.n1ql={comment:/\/\*[\s\S]*?(?:$|\*\/)/,parameter:/\$[\w.]+/,string:{pattern:/(["'])(?:\\[\s\S]|(?!\1)[^\\]|\1\1)*\1/,greedy:!0},identifier:{pattern:/`(?:\\[\s\S]|[^\\`]|``)*`/,greedy:!0},function:/\b(?:ABS|ACOS|ARRAY_AGG|ARRAY_APPEND|ARRAY_AVG|ARRAY_CONCAT|ARRAY_CONTAINS|ARRAY_COUNT|ARRAY_DISTINCT|ARRAY_FLATTEN|ARRAY_IFNULL|ARRAY_INSERT|ARRAY_INTERSECT|ARRAY_LENGTH|ARRAY_MAX|ARRAY_MIN|ARRAY_POSITION|ARRAY_PREPEND|ARRAY_PUT|ARRAY_RANGE|ARRAY_REMOVE|ARRAY_REPEAT|ARRAY_REPLACE|ARRAY_REVERSE|ARRAY_SORT|ARRAY_STAR|ARRAY_SUM|ARRAY_SYMDIFF|ARRAY_SYMDIFFN|ARRAY_UNION|ASIN|ATAN|ATAN2|AVG|BASE64|BASE64_DECODE|BASE64_ENCODE|BITAND|BITCLEAR|BITNOT|BITOR|BITSET|BITSHIFT|BITTEST|BITXOR|CEIL|CLOCK_LOCAL|CLOCK_MILLIS|CLOCK_STR|CLOCK_TZ|CLOCK_UTC|CONTAINS|CONTAINS_TOKEN|CONTAINS_TOKEN_LIKE|CONTAINS_TOKEN_REGEXP|COS|COUNT|CURL|DATE_ADD_MILLIS|DATE_ADD_STR|DATE_DIFF_MILLIS|DATE_DIFF_STR|DATE_FORMAT_STR|DATE_PART_MILLIS|DATE_PART_STR|DATE_RANGE_MILLIS|DATE_RANGE_STR|DATE_TRUNC_MILLIS|DATE_TRUNC_STR|DECODE_JSON|DEGREES|DURATION_TO_STR|E|ENCODED_SIZE|ENCODE_JSON|EXP|FLOOR|GREATEST|HAS_TOKEN|IFINF|IFMISSING|IFMISSINGORNULL|IFNAN|IFNANORINF|IFNULL|INITCAP|ISARRAY|ISATOM|ISBOOLEAN|ISNUMBER|ISOBJECT|ISSTRING|IsBitSET|LEAST|LENGTH|LN|LOG|LOWER|LTRIM|MAX|META|MILLIS|MILLIS_TO_LOCAL|MILLIS_TO_STR|MILLIS_TO_TZ|MILLIS_TO_UTC|MILLIS_TO_ZONE_NAME|MIN|MISSINGIF|NANIF|NEGINFIF|NOW_LOCAL|NOW_MILLIS|NOW_STR|NOW_TZ|NOW_UTC|NULLIF|OBJECT_ADD|OBJECT_CONCAT|OBJECT_INNER_PAIRS|OBJECT_INNER_VALUES|OBJECT_LENGTH|OBJECT_NAMES|OBJECT_PAIRS|OBJECT_PUT|OBJECT_REMOVE|OBJECT_RENAME|OBJECT_REPLACE|OBJECT_UNWRAP|OBJECT_VALUES|PAIRS|PI|POLY_LENGTH|POSINFIF|POSITION|POWER|RADIANS|RANDOM|REGEXP_CONTAINS|REGEXP_LIKE|REGEXP_POSITION|REGEXP_REPLACE|REPEAT|REPLACE|REVERSE|ROUND|RTRIM|SIGN|SIN|SPLIT|SQRT|STR_TO_DURATION|STR_TO_MILLIS|STR_TO_TZ|STR_TO_UTC|STR_TO_ZONE_NAME|SUBSTR|SUFFIXES|SUM|TAN|TITLE|TOARRAY|TOATOM|TOBOOLEAN|TOKENS|TONUMBER|TOOBJECT|TOSTRING|TRIM|TRUNC|TYPE|UPPER|WEEKDAY_MILLIS|WEEKDAY_STR)(?=\s*\()/i,keyword:/\b(?:ALL|ALTER|ANALYZE|AS|ASC|BEGIN|BINARY|BOOLEAN|BREAK|BUCKET|BUILD|BY|CALL|CAST|CLUSTER|COLLATE|COLLECTION|COMMIT|CONNECT|CONTINUE|CORRELATE|COVER|CREATE|DATABASE|DATASET|DATASTORE|DECLARE|DECREMENT|DELETE|DERIVED|DESC|DESCRIBE|DISTINCT|DO|DROP|EACH|ELEMENT|EXCEPT|EXCLUDE|EXECUTE|EXPLAIN|FETCH|FLATTEN|FOR|FORCE|FROM|FUNCTION|GRANT|GROUP|GSI|HAVING|IF|IGNORE|ILIKE|INCLUDE|INCREMENT|INDEX|INFER|INLINE|INNER|INSERT|INTERSECT|INTO|IS|JOIN|KEY|KEYS|KEYSPACE|KNOWN|LAST|LEFT|LET|LETTING|LIMIT|LSM|MAP|MAPPING|MATCHED|MATERIALIZED|MERGE|MINUS|MISSING|NAMESPACE|NEST|NULL|NUMBER|OBJECT|OFFSET|ON|OPTION|ORDER|OUTER|OVER|PARSE|PARTITION|PASSWORD|PATH|POOL|PREPARE|PRIMARY|PRIVATE|PRIVILEGE|PROCEDURE|PUBLIC|RAW|REALM|REDUCE|RENAME|RETURN|RETURNING|REVOKE|RIGHT|ROLE|ROLLBACK|SATISFIES|SCHEMA|SELECT|SELF|SEMI|SET|SHOW|SOME|START|STATISTICS|STRING|SYSTEM|TO|TRANSACTION|TRIGGER|TRUNCATE|UNDER|UNION|UNIQUE|UNKNOWN|UNNEST|UNSET|UPDATE|UPSERT|USE|USER|USING|VALIDATE|VALUE|VALUES|VIA|VIEW|WHERE|WHILE|WITH|WORK|XOR)\b/i,boolean:/\b(?:TRUE|FALSE)\b/i,number:/(?:\b\d+\.|\B\.)\d+e[+\-]?\d+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/%]|!=|==?|\|\||<[>=]?|>=?|\b(?:AND|ANY|ARRAY|BETWEEN|CASE|ELSE|END|EVERY|EXISTS|FIRST|IN|LIKE|NOT|OR|THEN|VALUED|WHEN|WITHIN)\b/i,punctuation:/[;[\](),.{}:]/}}e.exports=t,t.displayName="n1ql",t.aliases=[]},70896(e){"use strict";function t(e){e.languages.n4js=e.languages.extend("javascript",{keyword:/\b(?:any|Array|boolean|break|case|catch|class|const|constructor|continue|debugger|declare|default|delete|do|else|enum|export|extends|false|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|module|new|null|number|package|private|protected|public|return|set|static|string|super|switch|this|throw|true|try|typeof|var|void|while|with|yield)\b/}),e.languages.insertBefore("n4js","constant",{annotation:{pattern:/@+\w+/,alias:"operator"}}),e.languages.n4jsd=e.languages.n4js}e.exports=t,t.displayName="n4js",t.aliases=["n4jsd"]},42242(e){"use strict";function t(e){e.languages["nand2tetris-hdl"]={comment:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,keyword:/\b(?:CHIP|IN|OUT|PARTS|BUILTIN|CLOCKED)\b/,boolean:/\b(?:true|false)\b/,function:/\b[A-Za-z][A-Za-z0-9]*(?=\()/,number:/\b\d+\b/,operator:/=|\.\./,punctuation:/[{}[\];(),:]/}}e.exports=t,t.displayName="nand2tetrisHdl",t.aliases=[]},37943(e){"use strict";function t(e){!function(e){var t=/\{[^\r\n\[\]{}]*\}/,n={"quoted-string":{pattern:/"(?:[^"\\]|\\.)*"/,alias:"operator"},"command-param-id":{pattern:/(\s)\w+:/,lookbehind:!0,alias:"property"},"command-param-value":[{pattern:t,alias:"selector"},{pattern:/([\t ])\S+/,lookbehind:!0,greedy:!0,alias:"operator"},{pattern:/\S(?:.*\S)?/,alias:"operator"}]};function r(e){for(var t="[]{}",n=[],r=0;r.+/m,alias:"tag",inside:{value:{pattern:/(^>\w+[\t ]+)(?!\s)[^{}\r\n]+/,lookbehind:!0,alias:"operator"},key:{pattern:/(^>)\w+/,lookbehind:!0}}},label:{pattern:/^([\t ]*)#[\t ]*\w+[\t ]*$/m,lookbehind:!0,alias:"regex"},command:{pattern:/^([\t ]*)@\w+(?=[\t ]|$).*/m,lookbehind:!0,alias:"function",inside:{"command-name":/^@\w+/,expression:{pattern:t,greedy:!0,alias:"selector"},"command-params":{pattern:/\s*\S[\s\S]*/,inside:n}}},"generic-text":{pattern:/(^[ \t]*)[^#@>;\s].*/m,lookbehind:!0,alias:"punctuation",inside:{"escaped-char":/\\[{}\[\]"]/,expression:{pattern:t,greedy:!0,alias:"selector"},"inline-command":{pattern:/\[[\t ]*\w[^\r\n\[\]]*\]/,greedy:!0,alias:"function",inside:{"command-params":{pattern:/(^\[[\t ]*\w+\b)[\s\S]+(?=\]$)/,lookbehind:!0,inside:n},"command-param-name":{pattern:/^(\[[\t ]*)\w+/,lookbehind:!0,alias:"name"},"start-stop-char":/[\[\]]/}}}}},e.languages.nani=e.languages.naniscript,e.hooks.add("after-tokenize",function(e){e.tokens.forEach(function(e){if("string"!=typeof e&&"generic-text"===e.type){var t=i(e);r(t)||(e.type="bad-line",e.content=t)}})})}(e)}e.exports=t,t.displayName="naniscript",t.aliases=[]},293(e){"use strict";function t(e){e.languages.nasm={comment:/;.*$/m,string:/(["'`])(?:\\.|(?!\1)[^\\\r\n])*\1/,label:{pattern:/(^\s*)[A-Za-z._?$][\w.?$@~#]*:/m,lookbehind:!0,alias:"function"},keyword:[/\[?BITS (?:16|32|64)\]?/,{pattern:/(^\s*)section\s*[a-z.]+:?/im,lookbehind:!0},/(?:extern|global)[^;\r\n]*/i,/(?:CPU|FLOAT|DEFAULT).*$/m],register:{pattern:/\b(?:st\d|[xyz]mm\d\d?|[cdt]r\d|r\d\d?[bwd]?|[er]?[abcd]x|[abcd][hl]|[er]?(?:bp|sp|si|di)|[cdefgs]s)\b/i,alias:"variable"},number:/(?:\b|(?=\$))(?:0[hx](?:\.[\da-f]+|[\da-f]+(?:\.[\da-f]+)?)(?:p[+-]?\d+)?|\d[\da-f]+[hx]|\$\d[\da-f]*|0[oq][0-7]+|[0-7]+[oq]|0[by][01]+|[01]+[by]|0[dt]\d+|(?:\d+(?:\.\d+)?|\.\d+)(?:\.?e[+-]?\d+)?[dt]?)\b/i,operator:/[\[\]*+\-\/%<>=&|$!]/}}e.exports=t,t.displayName="nasm",t.aliases=[]},83873(e){"use strict";function t(e){e.languages.neon={comment:{pattern:/#.*/,greedy:!0},datetime:{pattern:/(^|[[{(=:,\s])\d\d\d\d-\d\d?-\d\d?(?:(?:[Tt]| +)\d\d?:\d\d:\d\d(?:\.\d*)? *(?:Z|[-+]\d\d?(?::?\d\d)?)?)?(?=$|[\]}),\s])/,lookbehind:!0,alias:"number"},key:{pattern:/(^|[[{(,\s])[^,:=[\]{}()'"\s]+(?=\s*:(?:$|[\]}),\s])|\s*=)/,lookbehind:!0,alias:"atrule"},number:{pattern:/(^|[[{(=:,\s])[+-]?(?:0x[\da-fA-F]+|0o[0-7]+|0b[01]+|(?:\d+(?:\.\d*)?|\.?\d+)(?:[eE][+-]?\d+)?)(?=$|[\]}),:=\s])/,lookbehind:!0},boolean:{pattern:/(^|[[{(=:,\s])(?:true|false|yes|no)(?=$|[\]}),:=\s])/i,lookbehind:!0},null:{pattern:/(^|[[{(=:,\s])(?:null)(?=$|[\]}),:=\s])/i,lookbehind:!0,alias:"keyword"},string:{pattern:/(^|[[{(=:,\s])(?:('''|""")\r?\n(?:(?:[^\r\n]|\r?\n(?![\t ]*\2))*\r?\n)?[\t ]*\2|'[^'\r\n]*'|"(?:\\.|[^\\"\r\n])*")/,lookbehind:!0,greedy:!0},literal:{pattern:/(^|[[{(=:,\s])(?:[^#"',:=[\]{}()\s`-]|[:-][^"',=[\]{}()\s])(?:[^,:=\]})(\s]|:(?![\s,\]})]|$)|[ \t]+[^#,:=\]})(\s])*/,lookbehind:!0,alias:"string"},punctuation:/[,:=[\]{}()-]/}}e.exports=t,t.displayName="neon",t.aliases=[]},75932(e){"use strict";function t(e){e.languages.nevod={comment:/\/\/.*|(?:\/\*[\s\S]*?(?:\*\/|$))/,string:{pattern:/(?:"(?:""|[^"])*"(?!")|'(?:''|[^'])*'(?!'))!?\*?/,greedy:!0,inside:{"string-attrs":/!$|!\*$|\*$/}},namespace:{pattern:/(@namespace\s+)[a-zA-Z0-9\-.]+(?=\s*\{)/,lookbehind:!0},pattern:{pattern:/(@pattern\s+)?#?[a-zA-Z0-9\-.]+(?:\s*\(\s*(?:~\s*)?[a-zA-Z0-9\-.]+\s*(?:,\s*(?:~\s*)?[a-zA-Z0-9\-.]*)*\))?(?=\s*=)/,lookbehind:!0,inside:{"pattern-name":{pattern:/^#?[a-zA-Z0-9\-.]+/,alias:"class-name"},fields:{pattern:/\(.*\)/,inside:{"field-name":{pattern:/[a-zA-Z0-9\-.]+/,alias:"variable"},punctuation:/[,()]/,operator:{pattern:/~/,alias:"field-hidden-mark"}}}}},search:{pattern:/(@search\s+|#)[a-zA-Z0-9\-.]+(?:\.\*)?(?=\s*;)/,alias:"function",lookbehind:!0},keyword:/@(?:require|namespace|pattern|search|inside|outside|having|where)\b/,"standard-pattern":{pattern:/\b(?:Word|Punct|Symbol|Space|LineBreak|Start|End|Alpha|AlphaNum|Num|NumAlpha|Blank|WordBreak|Any)(?:\([a-zA-Z0-9\-.,\s+]*\))?/,inside:{"standard-pattern-name":{pattern:/^[a-zA-Z0-9\-.]+/,alias:"builtin"},quantifier:{pattern:/\b\d+(?:\s*\+|\s*-\s*\d+)?(?!\w)/,alias:"number"},"standard-pattern-attr":{pattern:/[a-zA-Z0-9\-.]+/,alias:"builtin"},punctuation:/[,()]/}},quantifier:{pattern:/\b\d+(?:\s*\+|\s*-\s*\d+)?(?!\w)/,alias:"number"},operator:[{pattern:/=/,alias:"pattern-def"},{pattern:/&/,alias:"conjunction"},{pattern:/~/,alias:"exception"},{pattern:/\?/,alias:"optionality"},{pattern:/[[\]]/,alias:"repetition"},{pattern:/[{}]/,alias:"variation"},{pattern:/[+_]/,alias:"sequence"},{pattern:/\.{2,3}/,alias:"span"}],"field-capture":[{pattern:/([a-zA-Z0-9\-.]+\s*\()\s*[a-zA-Z0-9\-.]+\s*:\s*[a-zA-Z0-9\-.]+(?:\s*,\s*[a-zA-Z0-9\-.]+\s*:\s*[a-zA-Z0-9\-.]+)*(?=\s*\))/,lookbehind:!0,inside:{"field-name":{pattern:/[a-zA-Z0-9\-.]+/,alias:"variable"},colon:/:/}},{pattern:/[a-zA-Z0-9\-.]+\s*:/,inside:{"field-name":{pattern:/[a-zA-Z0-9\-.]+/,alias:"variable"},colon:/:/}}],punctuation:/[:;,()]/,name:/[a-zA-Z0-9\-.]+/}}e.exports=t,t.displayName="nevod",t.aliases=[]},60221(e){"use strict";function t(e){var t,n;n=/\$(?:\w[a-z\d]*(?:_[^\x00-\x1F\s"'\\()$]*)?|\{[^}\s"'\\]+\})/i,(t=e).languages.nginx={comment:{pattern:/(^|[\s{};])#.*/,lookbehind:!0},directive:{pattern:/(^|\s)\w(?:[^;{}"'\\\s]|\\.|"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*'|\s+(?:#.*(?!.)|(?![#\s])))*?(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:{string:{pattern:/((?:^|[^\\])(?:\\\\)*)(?:"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*')/,lookbehind:!0,inside:{escape:{pattern:/\\["'\\nrt]/,alias:"entity"},variable:n}},comment:{pattern:/(\s)#.*/,lookbehind:!0,greedy:!0},keyword:{pattern:/^\S+/,greedy:!0},boolean:{pattern:/(\s)(?:off|on)(?!\S)/,lookbehind:!0},number:{pattern:/(\s)\d+[a-z]*(?!\S)/i,lookbehind:!0},variable:n}},punctuation:/[{};]/}}e.exports=t,t.displayName="nginx",t.aliases=[]},44188(e){"use strict";function t(e){e.languages.nim={comment:/#.*/,string:{pattern:/(?:(?:\b(?!\d)(?:\w|\\x[8-9a-fA-F][0-9a-fA-F])+)?(?:"""[\s\S]*?"""(?!")|"(?:\\[\s\S]|""|[^"\\])*")|'(?:\\(?:\d+|x[\da-fA-F]{2}|.)|[^'])')/,greedy:!0},number:/\b(?:0[xXoObB][\da-fA-F_]+|\d[\d_]*(?:(?!\.\.)\.[\d_]*)?(?:[eE][+-]?\d[\d_]*)?)(?:'?[iuf]\d*)?/,keyword:/\b(?:addr|as|asm|atomic|bind|block|break|case|cast|concept|const|continue|converter|defer|discard|distinct|do|elif|else|end|enum|except|export|finally|for|from|func|generic|if|import|include|interface|iterator|let|macro|method|mixin|nil|object|out|proc|ptr|raise|ref|return|static|template|try|tuple|type|using|var|when|while|with|without|yield)\b/,function:{pattern:/(?:(?!\d)(?:\w|\\x[8-9a-fA-F][0-9a-fA-F])+|`[^`\r\n]+`)\*?(?:\[[^\]]+\])?(?=\s*\()/,inside:{operator:/\*$/}},ignore:{pattern:/`[^`\r\n]+`/,inside:{punctuation:/`/}},operator:{pattern:/(^|[({\[](?=\.\.)|(?![({\[]\.).)(?:(?:[=+\-*\/<>@$~&%|!?^:\\]|\.\.|\.(?![)}\]]))+|\b(?:and|div|of|or|in|is|isnot|mod|not|notin|shl|shr|xor)\b)/m,lookbehind:!0},punctuation:/[({\[]\.|\.[)}\]]|[`(){}\[\],:]/}}e.exports=t,t.displayName="nim",t.aliases=[]},74426(e){"use strict";function t(e){e.languages.nix={comment:/\/\*[\s\S]*?\*\/|#.*/,string:{pattern:/"(?:[^"\\]|\\[\s\S])*"|''(?:(?!'')[\s\S]|''(?:'|\\|\$\{))*''/,greedy:!0,inside:{interpolation:{pattern:/(^|(?:^|(?!'').)[^\\])\$\{(?:[^{}]|\{[^}]*\})*\}/,lookbehind:!0,inside:{antiquotation:{pattern:/^\$(?=\{)/,alias:"variable"}}}}},url:[/\b(?:[a-z]{3,7}:\/\/)[\w\-+%~\/.:#=?&]+/,{pattern:/([^\/])(?:[\w\-+%~.:#=?&]*(?!\/\/)[\w\-+%~\/.:#=?&])?(?!\/\/)\/[\w\-+%~\/.:#=?&]*/,lookbehind:!0}],antiquotation:{pattern:/\$(?=\{)/,alias:"variable"},number:/\b\d+\b/,keyword:/\b(?:assert|builtins|else|if|in|inherit|let|null|or|then|with)\b/,function:/\b(?:abort|add|all|any|attrNames|attrValues|baseNameOf|compareVersions|concatLists|currentSystem|deepSeq|derivation|dirOf|div|elem(?:At)?|fetch(?:url|Tarball)|filter(?:Source)?|fromJSON|genList|getAttr|getEnv|hasAttr|hashString|head|import|intersectAttrs|is(?:Attrs|Bool|Function|Int|List|Null|String)|length|lessThan|listToAttrs|map|mul|parseDrvName|pathExists|read(?:Dir|File)|removeAttrs|replaceStrings|seq|sort|stringLength|sub(?:string)?|tail|throw|to(?:File|JSON|Path|String|XML)|trace|typeOf)\b|\bfoldl'\B/,boolean:/\b(?:true|false)\b/,operator:/[=!<>]=?|\+\+?|\|\||&&|\/\/|->?|[?@]/,punctuation:/[{}()[\].,:;]/},e.languages.nix.string.inside.interpolation.inside.rest=e.languages.nix}e.exports=t,t.displayName="nix",t.aliases=[]},88447(e){"use strict";function t(e){e.languages.nsis={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|[#;].*)/,lookbehind:!0},string:{pattern:/("|')(?:\\.|(?!\1)[^\\\r\n])*\1/,greedy:!0},keyword:{pattern:/(^[\t ]*)(?:Abort|Add(?:BrandingImage|Size)|AdvSplash|Allow(?:RootDirInstall|SkipFiles)|AutoCloseWindow|Banner|BG(?:Font|Gradient|Image)|BrandingText|BringToFront|Call(?:InstDLL)?|Caption|ChangeUI|CheckBitmap|ClearErrors|CompletedText|ComponentText|CopyFiles|CRCCheck|Create(?:Directory|Font|ShortCut)|Delete(?:INISec|INIStr|RegKey|RegValue)?|Detail(?:Print|sButtonText)|Dialer|Dir(?:Text|Var|Verify)|EnableWindow|Enum(?:RegKey|RegValue)|Exch|Exec(?:Shell(?:Wait)?|Wait)?|ExpandEnvStrings|File(?:BufSize|Close|ErrorText|Open|Read|ReadByte|ReadUTF16LE|ReadWord|WriteUTF16LE|Seek|Write|WriteByte|WriteWord)?|Find(?:Close|First|Next|Window)|FlushINI|Get(?:CurInstType|CurrentAddress|DlgItem|DLLVersion(?:Local)?|ErrorLevel|FileTime(?:Local)?|FullPathName|Function(?:Address|End)?|InstDirError|LabelAddress|TempFileName)|Goto|HideWindow|Icon|If(?:Abort|Errors|FileExists|RebootFlag|Silent)|InitPluginsDir|Install(?:ButtonText|Colors|Dir(?:RegKey)?)|InstProgressFlags|Inst(?:Type(?:GetText|SetText)?)|Int(?:64|Ptr)?CmpU?|Int(?:64)?Fmt|Int(?:Ptr)?Op|IsWindow|Lang(?:DLL|String)|License(?:BkColor|Data|ForceSelection|LangString|Text)|LoadLanguageFile|LockWindow|Log(?:Set|Text)|Manifest(?:DPIAware|SupportedOS)|Math|MessageBox|MiscButtonText|Name|Nop|ns(?:Dialogs|Exec)|NSISdl|OutFile|Page(?:Callbacks)?|PE(?:DllCharacteristics|SubsysVer)|Pop|Push|Quit|Read(?:EnvStr|INIStr|RegDWORD|RegStr)|Reboot|RegDLL|Rename|RequestExecutionLevel|ReserveFile|Return|RMDir|SearchPath|Section(?:End|GetFlags|GetInstTypes|GetSize|GetText|Group|In|SetFlags|SetInstTypes|SetSize|SetText)?|SendMessage|Set(?:AutoClose|BrandingImage|Compress|Compressor(?:DictSize)?|CtlColors|CurInstType|DatablockOptimize|DateSave|Details(?:Print|View)|ErrorLevel|Errors|FileAttributes|Font|OutPath|Overwrite|PluginUnload|RebootFlag|RegView|ShellVarContext|Silent)|Show(?:InstDetails|UninstDetails|Window)|Silent(?:Install|UnInstall)|Sleep|SpaceTexts|Splash|StartMenu|Str(?:CmpS?|Cpy|Len)|SubCaption|System|Unicode|Uninstall(?:ButtonText|Caption|Icon|SubCaption|Text)|UninstPage|UnRegDLL|UserInfo|Var|VI(?:AddVersionKey|FileVersion|ProductVersion)|VPatch|WindowIcon|Write(?:INIStr|Reg(?:Bin|DWORD|ExpandStr|MultiStr|None|Str)|Uninstaller)|XPStyle)\b/m,lookbehind:!0},property:/\b(?:admin|all|auto|both|colored|false|force|hide|highest|lastused|leave|listonly|none|normal|notset|off|on|open|print|show|silent|silentlog|smooth|textonly|true|user|ARCHIVE|FILE_(?:ATTRIBUTE_ARCHIVE|ATTRIBUTE_NORMAL|ATTRIBUTE_OFFLINE|ATTRIBUTE_READONLY|ATTRIBUTE_SYSTEM|ATTRIBUTE_TEMPORARY)|HK(?:(?:CR|CU|LM)(?:32|64)?|DD|PD|U)|HKEY_(?:CLASSES_ROOT|CURRENT_CONFIG|CURRENT_USER|DYN_DATA|LOCAL_MACHINE|PERFORMANCE_DATA|USERS)|ID(?:ABORT|CANCEL|IGNORE|NO|OK|RETRY|YES)|MB_(?:ABORTRETRYIGNORE|DEFBUTTON1|DEFBUTTON2|DEFBUTTON3|DEFBUTTON4|ICONEXCLAMATION|ICONINFORMATION|ICONQUESTION|ICONSTOP|OK|OKCANCEL|RETRYCANCEL|RIGHT|RTLREADING|SETFOREGROUND|TOPMOST|USERICON|YESNO)|NORMAL|OFFLINE|READONLY|SHCTX|SHELL_CONTEXT|SYSTEM|TEMPORARY)\b/,constant:/\$\{[\w\.:\^-]+\}|\$\([\w\.:\^-]+\)/i,variable:/\$\w+/i,number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/--?|\+\+?|<=?|>=?|==?=?|&&?|\|\|?|[?*\/~^%]/,punctuation:/[{}[\];(),.:]/,important:{pattern:/(^[\t ]*)!(?:addincludedir|addplugindir|appendfile|cd|define|delfile|echo|else|endif|error|execute|finalize|getdllversion|gettlbversion|ifdef|ifmacrodef|ifmacrondef|ifndef|if|include|insertmacro|macroend|macro|makensis|packhdr|pragma|searchparse|searchreplace|system|tempfile|undef|verbose|warning)\b/im,lookbehind:!0}}}e.exports=t,t.displayName="nsis",t.aliases=[]},16032(e,t,n){"use strict";var r=n(65806);function i(e){e.register(r),e.languages.objectivec=e.languages.extend("c",{string:/("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1|@"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,keyword:/\b(?:asm|typeof|inline|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|union|unsigned|void|volatile|while|in|self|super)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete e.languages.objectivec["class-name"],e.languages.objc=e.languages.objectivec}e.exports=i,i.displayName="objectivec",i.aliases=["objc"]},33607(e){"use strict";function t(e){e.languages.ocaml={comment:/\(\*[\s\S]*?\*\)/,string:[{pattern:/"(?:\\.|[^\\\r\n"])*"/,greedy:!0},{pattern:/(['`])(?:\\(?:\d+|x[\da-f]+|.)|(?!\1)[^\\\r\n])\1/i,greedy:!0}],number:/\b(?:0x[\da-f][\da-f_]+|(?:0[bo])?\d[\d_]*(?:\.[\d_]*)?(?:e[+-]?[\d_]+)?)/i,directive:{pattern:/\B#\w+/,alias:"important"},label:{pattern:/\B~\w+/,alias:"function"},"type-variable":{pattern:/\B'\w+/,alias:"function"},variant:{pattern:/`\w+/,alias:"variable"},module:{pattern:/\b[A-Z]\w+/,alias:"variable"},keyword:/\b(?:as|assert|begin|class|constraint|do|done|downto|else|end|exception|external|for|fun|function|functor|if|in|include|inherit|initializer|lazy|let|match|method|module|mutable|new|nonrec|object|of|open|private|rec|sig|struct|then|to|try|type|val|value|virtual|when|where|while|with)\b/,boolean:/\b(?:false|true)\b/,operator:/:=|[=<>@^|&+\-*\/$%!?~][!$%&*+\-.\/:<=>?@^|~]*|\b(?:and|asr|land|lor|lsl|lsr|lxor|mod|or)\b/,punctuation:/[(){}\[\]|.,:;]|\b_\b/}}e.exports=t,t.displayName="ocaml",t.aliases=[]},22001(e,t,n){"use strict";var r=n(65806);function i(e){var t,n;e.register(r),(t=e).languages.opencl=t.languages.extend("c",{keyword:/\b(?:__attribute__|(?:__)?(?:constant|global|kernel|local|private|read_only|read_write|write_only)|auto|break|case|complex|const|continue|default|do|(?:float|double)(?:16(?:x(?:1|16|2|4|8))?|1x(?:1|16|2|4|8)|2(?:x(?:1|16|2|4|8))?|3|4(?:x(?:1|16|2|4|8))?|8(?:x(?:1|16|2|4|8))?)?|else|enum|extern|for|goto|(?:u?(?:char|short|int|long)|half|quad|bool)(?:2|3|4|8|16)?|if|imaginary|inline|packed|pipe|register|restrict|return|signed|sizeof|static|struct|switch|typedef|uniform|union|unsigned|void|volatile|while)\b/,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[fuhl]{0,4}/i,boolean:/\b(?:false|true)\b/,"constant-opencl-kernel":{pattern:/\b(?:CHAR_(?:BIT|MAX|MIN)|CLK_(?:ADDRESS_(?:CLAMP(?:_TO_EDGE)?|NONE|REPEAT)|FILTER_(?:LINEAR|NEAREST)|(?:LOCAL|GLOBAL)_MEM_FENCE|NORMALIZED_COORDS_(?:FALSE|TRUE))|CL_(?:BGRA|(?:HALF_)?FLOAT|INTENSITY|LUMINANCE|A?R?G?B?[Ax]?|(?:(?:UN)?SIGNED|[US]NORM)_(?:INT(?:8|16|32))|UNORM_(?:INT_101010|SHORT_(?:555|565)))|(?:DBL|FLT|HALF)_(?:DIG|EPSILON|MANT_DIG|(?:MIN|MAX)(?:(?:_10)?_EXP)?)|FLT_RADIX|HUGE_VALF?|INFINITY|(?:INT|LONG|SCHAR|SHRT)_(?:MAX|MIN)|(?:UCHAR|USHRT|UINT|ULONG)_MAX|MAXFLOAT|M_(?:[12]_PI|2_SQRTPI|E|LN(?:2|10)|LOG(?:10|2)E?|PI(?:_[24])?|SQRT(?:1_2|2))(?:_F|_H)?|NAN)\b/,alias:"constant"}}),t.languages.insertBefore("opencl","class-name",{"builtin-type":{pattern:/\b(?:_cl_(?:command_queue|context|device_id|event|kernel|mem|platform_id|program|sampler)|cl_(?:image_format|mem_fence_flags)|clk_event_t|event_t|image(?:1d_(?:array_|buffer_)?t|2d_(?:array_(?:depth_|msaa_depth_|msaa_)?|depth_|msaa_depth_|msaa_)?t|3d_t)|intptr_t|ndrange_t|ptrdiff_t|queue_t|reserve_id_t|sampler_t|size_t|uintptr_t)\b/,alias:"keyword"}}),n={"type-opencl-host":{pattern:/\b(?:cl_(?:GLenum|GLint|GLuin|addressing_mode|bitfield|bool|buffer_create_type|build_status|channel_(?:order|type)|(?:u?(?:char|short|int|long)|float|double)(?:2|3|4|8|16)?|command_(?:queue(?:_info|_properties)?|type)|context(?:_info|_properties)?|device_(?:exec_capabilities|fp_config|id|info|local_mem_type|mem_cache_type|type)|(?:event|sampler)(?:_info)?|filter_mode|half|image_info|kernel(?:_info|_work_group_info)?|map_flags|mem(?:_flags|_info|_object_type)?|platform_(?:id|info)|profiling_info|program(?:_build_info|_info)?))\b/,alias:"keyword"},"boolean-opencl-host":{pattern:/\bCL_(?:TRUE|FALSE)\b/,alias:"boolean"},"constant-opencl-host":{pattern:/\bCL_(?:A|ABGR|ADDRESS_(?:CLAMP(?:_TO_EDGE)?|MIRRORED_REPEAT|NONE|REPEAT)|ARGB|BGRA|BLOCKING|BUFFER_CREATE_TYPE_REGION|BUILD_(?:ERROR|IN_PROGRESS|NONE|PROGRAM_FAILURE|SUCCESS)|COMMAND_(?:ACQUIRE_GL_OBJECTS|BARRIER|COPY_(?:BUFFER(?:_RECT|_TO_IMAGE)?|IMAGE(?:_TO_BUFFER)?)|FILL_(?:BUFFER|IMAGE)|MAP(?:_BUFFER|_IMAGE)|MARKER|MIGRATE(?:_SVM)?_MEM_OBJECTS|NATIVE_KERNEL|NDRANGE_KERNEL|READ_(?:BUFFER(?:_RECT)?|IMAGE)|RELEASE_GL_OBJECTS|SVM_(?:FREE|MAP|MEMCPY|MEMFILL|UNMAP)|TASK|UNMAP_MEM_OBJECT|USER|WRITE_(?:BUFFER(?:_RECT)?|IMAGE))|COMPILER_NOT_AVAILABLE|COMPILE_PROGRAM_FAILURE|COMPLETE|CONTEXT_(?:DEVICES|INTEROP_USER_SYNC|NUM_DEVICES|PLATFORM|PROPERTIES|REFERENCE_COUNT)|DEPTH(?:_STENCIL)?|DEVICE_(?:ADDRESS_BITS|AFFINITY_DOMAIN_(?:L[1-4]_CACHE|NEXT_PARTITIONABLE|NUMA)|AVAILABLE|BUILT_IN_KERNELS|COMPILER_AVAILABLE|DOUBLE_FP_CONFIG|ENDIAN_LITTLE|ERROR_CORRECTION_SUPPORT|EXECUTION_CAPABILITIES|EXTENSIONS|GLOBAL_(?:MEM_(?:CACHELINE_SIZE|CACHE_SIZE|CACHE_TYPE|SIZE)|VARIABLE_PREFERRED_TOTAL_SIZE)|HOST_UNIFIED_MEMORY|IL_VERSION|IMAGE(?:2D_MAX_(?:HEIGHT|WIDTH)|3D_MAX_(?:DEPTH|HEIGHT|WIDTH)|_BASE_ADDRESS_ALIGNMENT|_MAX_ARRAY_SIZE|_MAX_BUFFER_SIZE|_PITCH_ALIGNMENT|_SUPPORT)|LINKER_AVAILABLE|LOCAL_MEM_SIZE|LOCAL_MEM_TYPE|MAX_(?:CLOCK_FREQUENCY|COMPUTE_UNITS|CONSTANT_ARGS|CONSTANT_BUFFER_SIZE|GLOBAL_VARIABLE_SIZE|MEM_ALLOC_SIZE|NUM_SUB_GROUPS|ON_DEVICE_(?:EVENTS|QUEUES)|PARAMETER_SIZE|PIPE_ARGS|READ_IMAGE_ARGS|READ_WRITE_IMAGE_ARGS|SAMPLERS|WORK_GROUP_SIZE|WORK_ITEM_DIMENSIONS|WORK_ITEM_SIZES|WRITE_IMAGE_ARGS)|MEM_BASE_ADDR_ALIGN|MIN_DATA_TYPE_ALIGN_SIZE|NAME|NATIVE_VECTOR_WIDTH_(?:CHAR|DOUBLE|FLOAT|HALF|INT|LONG|SHORT)|NOT_(?:AVAILABLE|FOUND)|OPENCL_C_VERSION|PARENT_DEVICE|PARTITION_(?:AFFINITY_DOMAIN|BY_AFFINITY_DOMAIN|BY_COUNTS|BY_COUNTS_LIST_END|EQUALLY|FAILED|MAX_SUB_DEVICES|PROPERTIES|TYPE)|PIPE_MAX_(?:ACTIVE_RESERVATIONS|PACKET_SIZE)|PLATFORM|PREFERRED_(?:GLOBAL_ATOMIC_ALIGNMENT|INTEROP_USER_SYNC|LOCAL_ATOMIC_ALIGNMENT|PLATFORM_ATOMIC_ALIGNMENT|VECTOR_WIDTH_(?:CHAR|DOUBLE|FLOAT|HALF|INT|LONG|SHORT))|PRINTF_BUFFER_SIZE|PROFILE|PROFILING_TIMER_RESOLUTION|QUEUE_(?:ON_(?:DEVICE_(?:MAX_SIZE|PREFERRED_SIZE|PROPERTIES)|HOST_PROPERTIES)|PROPERTIES)|REFERENCE_COUNT|SINGLE_FP_CONFIG|SUB_GROUP_INDEPENDENT_FORWARD_PROGRESS|SVM_(?:ATOMICS|CAPABILITIES|COARSE_GRAIN_BUFFER|FINE_GRAIN_BUFFER|FINE_GRAIN_SYSTEM)|TYPE(?:_ACCELERATOR|_ALL|_CPU|_CUSTOM|_DEFAULT|_GPU)?|VENDOR(?:_ID)?|VERSION)|DRIVER_VERSION|EVENT_(?:COMMAND_(?:EXECUTION_STATUS|QUEUE|TYPE)|CONTEXT|REFERENCE_COUNT)|EXEC_(?:KERNEL|NATIVE_KERNEL|STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST)|FILTER_(?:LINEAR|NEAREST)|FLOAT|FP_(?:CORRECTLY_ROUNDED_DIVIDE_SQRT|DENORM|FMA|INF_NAN|ROUND_TO_INF|ROUND_TO_NEAREST|ROUND_TO_ZERO|SOFT_FLOAT)|GLOBAL|HALF_FLOAT|IMAGE_(?:ARRAY_SIZE|BUFFER|DEPTH|ELEMENT_SIZE|FORMAT|FORMAT_MISMATCH|FORMAT_NOT_SUPPORTED|HEIGHT|NUM_MIP_LEVELS|NUM_SAMPLES|ROW_PITCH|SLICE_PITCH|WIDTH)|INTENSITY|INVALID_(?:ARG_INDEX|ARG_SIZE|ARG_VALUE|BINARY|BUFFER_SIZE|BUILD_OPTIONS|COMMAND_QUEUE|COMPILER_OPTIONS|CONTEXT|DEVICE|DEVICE_PARTITION_COUNT|DEVICE_QUEUE|DEVICE_TYPE|EVENT|EVENT_WAIT_LIST|GLOBAL_OFFSET|GLOBAL_WORK_SIZE|GL_OBJECT|HOST_PTR|IMAGE_DESCRIPTOR|IMAGE_FORMAT_DESCRIPTOR|IMAGE_SIZE|KERNEL|KERNEL_ARGS|KERNEL_DEFINITION|KERNEL_NAME|LINKER_OPTIONS|MEM_OBJECT|MIP_LEVEL|OPERATION|PIPE_SIZE|PLATFORM|PROGRAM|PROGRAM_EXECUTABLE|PROPERTY|QUEUE_PROPERTIES|SAMPLER|VALUE|WORK_DIMENSION|WORK_GROUP_SIZE|WORK_ITEM_SIZE)|KERNEL_(?:ARG_(?:ACCESS_(?:NONE|QUALIFIER|READ_ONLY|READ_WRITE|WRITE_ONLY)|ADDRESS_(?:CONSTANT|GLOBAL|LOCAL|PRIVATE|QUALIFIER)|INFO_NOT_AVAILABLE|NAME|TYPE_(?:CONST|NAME|NONE|PIPE|QUALIFIER|RESTRICT|VOLATILE))|ATTRIBUTES|COMPILE_NUM_SUB_GROUPS|COMPILE_WORK_GROUP_SIZE|CONTEXT|EXEC_INFO_SVM_FINE_GRAIN_SYSTEM|EXEC_INFO_SVM_PTRS|FUNCTION_NAME|GLOBAL_WORK_SIZE|LOCAL_MEM_SIZE|LOCAL_SIZE_FOR_SUB_GROUP_COUNT|MAX_NUM_SUB_GROUPS|MAX_SUB_GROUP_SIZE_FOR_NDRANGE|NUM_ARGS|PREFERRED_WORK_GROUP_SIZE_MULTIPLE|PRIVATE_MEM_SIZE|PROGRAM|REFERENCE_COUNT|SUB_GROUP_COUNT_FOR_NDRANGE|WORK_GROUP_SIZE)|LINKER_NOT_AVAILABLE|LINK_PROGRAM_FAILURE|LOCAL|LUMINANCE|MAP_(?:FAILURE|READ|WRITE|WRITE_INVALIDATE_REGION)|MEM_(?:ALLOC_HOST_PTR|ASSOCIATED_MEMOBJECT|CONTEXT|COPY_HOST_PTR|COPY_OVERLAP|FLAGS|HOST_NO_ACCESS|HOST_PTR|HOST_READ_ONLY|HOST_WRITE_ONLY|KERNEL_READ_AND_WRITE|MAP_COUNT|OBJECT_(?:ALLOCATION_FAILURE|BUFFER|IMAGE1D|IMAGE1D_ARRAY|IMAGE1D_BUFFER|IMAGE2D|IMAGE2D_ARRAY|IMAGE3D|PIPE)|OFFSET|READ_ONLY|READ_WRITE|REFERENCE_COUNT|SIZE|SVM_ATOMICS|SVM_FINE_GRAIN_BUFFER|TYPE|USES_SVM_POINTER|USE_HOST_PTR|WRITE_ONLY)|MIGRATE_MEM_OBJECT_(?:CONTENT_UNDEFINED|HOST)|MISALIGNED_SUB_BUFFER_OFFSET|NONE|NON_BLOCKING|OUT_OF_(?:HOST_MEMORY|RESOURCES)|PIPE_(?:MAX_PACKETS|PACKET_SIZE)|PLATFORM_(?:EXTENSIONS|HOST_TIMER_RESOLUTION|NAME|PROFILE|VENDOR|VERSION)|PROFILING_(?:COMMAND_(?:COMPLETE|END|QUEUED|START|SUBMIT)|INFO_NOT_AVAILABLE)|PROGRAM_(?:BINARIES|BINARY_SIZES|BINARY_TYPE(?:_COMPILED_OBJECT|_EXECUTABLE|_LIBRARY|_NONE)?|BUILD_(?:GLOBAL_VARIABLE_TOTAL_SIZE|LOG|OPTIONS|STATUS)|CONTEXT|DEVICES|IL|KERNEL_NAMES|NUM_DEVICES|NUM_KERNELS|REFERENCE_COUNT|SOURCE)|QUEUED|QUEUE_(?:CONTEXT|DEVICE|DEVICE_DEFAULT|ON_DEVICE|ON_DEVICE_DEFAULT|OUT_OF_ORDER_EXEC_MODE_ENABLE|PROFILING_ENABLE|PROPERTIES|REFERENCE_COUNT|SIZE)|R|RA|READ_(?:ONLY|WRITE)_CACHE|RG|RGB|RGBA|RGBx|RGx|RUNNING|Rx|SAMPLER_(?:ADDRESSING_MODE|CONTEXT|FILTER_MODE|LOD_MAX|LOD_MIN|MIP_FILTER_MODE|NORMALIZED_COORDS|REFERENCE_COUNT)|(?:UN)?SIGNED_INT(?:8|16|32)|SNORM_INT(?:8|16)|SUBMITTED|SUCCESS|UNORM_INT(?:16|24|8|_101010|_101010_2)|UNORM_SHORT_(?:555|565)|VERSION_(?:1_0|1_1|1_2|2_0|2_1)|sBGRA|sRGB|sRGBA|sRGBx)\b/,alias:"constant"},"function-opencl-host":{pattern:/\bcl(?:BuildProgram|CloneKernel|CompileProgram|Create(?:Buffer|CommandQueue(?:WithProperties)?|Context|ContextFromType|Image|Image2D|Image3D|Kernel|KernelsInProgram|Pipe|ProgramWith(?:Binary|BuiltInKernels|IL|Source)|Sampler|SamplerWithProperties|SubBuffer|SubDevices|UserEvent)|Enqueue(?:(?:Barrier|Marker)(?:WithWaitList)?|Copy(?:Buffer(?:Rect|ToImage)?|Image(?:ToBuffer)?)|(?:Fill|Map)(?:Buffer|Image)|MigrateMemObjects|NDRangeKernel|NativeKernel|(?:Read|Write)(?:Buffer(?:Rect)?|Image)|SVM(?:Free|Map|MemFill|Memcpy|MigrateMem|Unmap)|Task|UnmapMemObject|WaitForEvents)|Finish|Flush|Get(?:CommandQueueInfo|ContextInfo|Device(?:AndHostTimer|IDs|Info)|Event(?:Profiling)?Info|ExtensionFunctionAddress(?:ForPlatform)?|HostTimer|ImageInfo|Kernel(?:ArgInfo|Info|SubGroupInfo|WorkGroupInfo)|MemObjectInfo|PipeInfo|Platform(?:IDs|Info)|Program(?:Build)?Info|SamplerInfo|SupportedImageFormats)|LinkProgram|(?:Release|Retain)(?:CommandQueue|Context|Device|Event|Kernel|MemObject|Program|Sampler)|SVM(?:Alloc|Free)|Set(?:CommandQueueProperty|DefaultDeviceCommandQueue|EventCallback|Kernel(?:Arg(?:SVMPointer)?|ExecInfo)|Kernel|MemObjectDestructorCallback|UserEventStatus)|Unload(?:Platform)?Compiler|WaitForEvents)\b/,alias:"function"}},t.languages.insertBefore("c","keyword",n),t.languages.cpp&&(n["type-opencl-host-cpp"]={pattern:/\b(?:Buffer|BufferGL|BufferRenderGL|CommandQueue|Context|Device|DeviceCommandQueue|EnqueueArgs|Event|Image|Image1D|Image1DArray|Image1DBuffer|Image2D|Image2DArray|Image2DGL|Image3D|Image3DGL|ImageFormat|ImageGL|Kernel|KernelFunctor|LocalSpaceArg|Memory|NDRange|Pipe|Platform|Program|Sampler|SVMAllocator|SVMTraitAtomic|SVMTraitCoarse|SVMTraitFine|SVMTraitReadOnly|SVMTraitReadWrite|SVMTraitWriteOnly|UserEvent)\b/,alias:"keyword"},t.languages.insertBefore("cpp","keyword",n))}e.exports=i,i.displayName="opencl",i.aliases=[]},22950(e){"use strict";function t(e){e.languages.openqasm={comment:/\/\*[\s\S]*?\*\/|\/\/.*/,string:{pattern:/"[^"\r\n\t]*"|'[^'\r\n\t]*'/,greedy:!0},keyword:/\b(?:barrier|boxas|boxto|break|const|continue|ctrl|def|defcal|defcalgrammar|delay|else|end|for|gate|gphase|if|in|include|inv|kernel|lengthof|let|measure|pow|reset|return|rotary|stretchinf|while|CX|OPENQASM|U)\b|#pragma\b/,"class-name":/\b(?:angle|bit|bool|creg|fixed|float|int|length|qreg|qubit|stretch|uint)\b/,function:/\b(?:sin|cos|tan|exp|ln|sqrt|rotl|rotr|popcount)\b(?=\s*\()/,constant:/\b(?:pi|tau|euler)\b|π|𝜏|ℇ/,number:{pattern:/(^|[^.\w$])(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?(?:dt|ns|us|µs|ms|s)?/i,lookbehind:!0},operator:/->|>>=?|<<=?|&&|\|\||\+\+|--|[!=<>&|~^+\-*/%]=?|@/,punctuation:/[(){}\[\];,:.]/},e.languages.qasm=e.languages.openqasm}e.exports=t,t.displayName="openqasm",t.aliases=["qasm"]},23254(e){"use strict";function t(e){e.languages.oz={comment:/\/\*[\s\S]*?\*\/|%.*/,string:{pattern:/"(?:[^"\\]|\\[\s\S])*"/,greedy:!0},atom:{pattern:/'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,alias:"builtin"},keyword:/\$|\[\]|\b(?:_|at|attr|case|catch|choice|class|cond|declare|define|dis|else(?:case|if)?|end|export|fail|false|feat|finally|from|fun|functor|if|import|in|local|lock|meth|nil|not|of|or|prepare|proc|prop|raise|require|self|skip|then|thread|true|try|unit)\b/,function:[/\b[a-z][A-Za-z\d]*(?=\()/,{pattern:/(\{)[A-Z][A-Za-z\d]*\b/,lookbehind:!0}],number:/\b(?:0[bx][\da-f]+|\d+(?:\.\d*)?(?:e~?\d+)?)\b|&(?:[^\\]|\\(?:\d{3}|.))/i,variable:/\b[A-Z][A-Za-z\d]*|`(?:[^`\\]|\\.)+`/,"attr-name":/\b\w+(?=:)/,operator:/:(?:=|::?)|<[-:=]?|=(?:=|=?:?|\\=:?|!!?|[|#+\-*\/,~^@]|\b(?:andthen|div|mod|orelse)\b/,punctuation:/[\[\](){}.:;?]/}}e.exports=t,t.displayName="oz",t.aliases=[]},92694(e){"use strict";function t(e){var t;e.languages.parigp={comment:/\/\*[\s\S]*?\*\/|\\\\.*/,string:{pattern:/"(?:[^"\\\r\n]|\\.)*"/,greedy:!0},keyword:RegExp("\\b(?:"+(t=(t=["breakpoint","break","dbg_down","dbg_err","dbg_up","dbg_x","forcomposite","fordiv","forell","forpart","forprime","forstep","forsubgroup","forvec","for","iferr","if","local","my","next","return","until","while"]).map(function(e){return e.split("").join(" *")}).join("|"))+")\\b"),function:/\b\w(?:[\w ]*\w)?(?= *\()/,number:{pattern:/((?:\. *\. *)?)(?:\b\d(?: *\d)*(?: *(?!\. *\.)\.(?: *\d)*)?|\. *\d(?: *\d)*)(?: *e *(?:[+-] *)?\d(?: *\d)*)?/i,lookbehind:!0},operator:/\. *\.|[*\/!](?: *=)?|%(?: *=|(?: *#)?(?: *')*)?|\+(?: *[+=])?|-(?: *[-=>])?|<(?: *>|(?: *<)?(?: *=)?)?|>(?: *>)?(?: *=)?|=(?: *=){0,2}|\\(?: *\/)?(?: *=)?|&(?: *&)?|\| *\||['#~^]/,punctuation:/[\[\]{}().,:;|]/}}e.exports=t,t.displayName="parigp",t.aliases=[]},43273(e){"use strict";function t(e){var t,n;n=(t=e).languages.parser=t.languages.extend("markup",{keyword:{pattern:/(^|[^^])(?:\^(?:case|eval|for|if|switch|throw)\b|@(?:BASE|CLASS|GET(?:_DEFAULT)?|OPTIONS|SET_DEFAULT|USE)\b)/,lookbehind:!0},variable:{pattern:/(^|[^^])\B\$(?:\w+|(?=[.{]))(?:(?:\.|::?)\w+)*(?:\.|::?)?/,lookbehind:!0,inside:{punctuation:/\.|:+/}},function:{pattern:/(^|[^^])\B[@^]\w+(?:(?:\.|::?)\w+)*(?:\.|::?)?/,lookbehind:!0,inside:{keyword:{pattern:/(^@)(?:GET_|SET_)/,lookbehind:!0},punctuation:/\.|:+/}},escape:{pattern:/\^(?:[$^;@()\[\]{}"':]|#[a-f\d]*)/i,alias:"builtin"},punctuation:/[\[\](){};]/}),n=t.languages.insertBefore("parser","keyword",{"parser-comment":{pattern:/(\s)#.*/,lookbehind:!0,alias:"comment"},expression:{pattern:/(^|[^^])\((?:[^()]|\((?:[^()]|\((?:[^()])*\))*\))*\)/,greedy:!0,lookbehind:!0,inside:{string:{pattern:/(^|[^^])(["'])(?:(?!\2)[^^]|\^[\s\S])*\2/,lookbehind:!0},keyword:n.keyword,variable:n.variable,function:n.function,boolean:/\b(?:true|false)\b/,number:/\b(?:0x[a-f\d]+|\d+(?:\.\d*)?(?:e[+-]?\d+)?)\b/i,escape:n.escape,operator:/[~+*\/\\%]|!(?:\|\|?|=)?|&&?|\|\|?|==|<[<=]?|>[>=]?|-[fd]?|\b(?:def|eq|ge|gt|in|is|le|lt|ne)\b/,punctuation:n.punctuation}}}),t.languages.insertBefore("inside","punctuation",{expression:n.expression,keyword:n.keyword,variable:n.variable,function:n.function,escape:n.escape,"parser-punctuation":{pattern:n.punctuation,alias:"punctuation"}},n.tag.inside["attr-value"])}e.exports=t,t.displayName="parser",t.aliases=[]},60718(e){"use strict";function t(e){e.languages.pascal={comment:[/\(\*[\s\S]+?\*\)/,/\{[\s\S]+?\}/,/\/\/.*/],string:{pattern:/(?:'(?:''|[^'\r\n])*'(?!')|#[&$%]?[a-f\d]+)+|\^[a-z]/i,greedy:!0},keyword:[{pattern:/(^|[^&])\b(?:absolute|array|asm|begin|case|const|constructor|destructor|do|downto|else|end|file|for|function|goto|if|implementation|inherited|inline|interface|label|nil|object|of|operator|packed|procedure|program|record|reintroduce|repeat|self|set|string|then|to|type|unit|until|uses|var|while|with)\b/i,lookbehind:!0},{pattern:/(^|[^&])\b(?:dispose|exit|false|new|true)\b/i,lookbehind:!0},{pattern:/(^|[^&])\b(?:class|dispinterface|except|exports|finalization|finally|initialization|inline|library|on|out|packed|property|raise|resourcestring|threadvar|try)\b/i,lookbehind:!0},{pattern:/(^|[^&])\b(?:absolute|abstract|alias|assembler|bitpacked|break|cdecl|continue|cppdecl|cvar|default|deprecated|dynamic|enumerator|experimental|export|external|far|far16|forward|generic|helper|implements|index|interrupt|iochecks|local|message|name|near|nodefault|noreturn|nostackframe|oldfpccall|otherwise|overload|override|pascal|platform|private|protected|public|published|read|register|reintroduce|result|safecall|saveregisters|softfloat|specialize|static|stdcall|stored|strict|unaligned|unimplemented|varargs|virtual|write)\b/i,lookbehind:!0}],number:[/(?:[&%]\d+|\$[a-f\d]+)/i,/\b\d+(?:\.\d+)?(?:e[+-]?\d+)?/i],operator:[/\.\.|\*\*|:=|<[<=>]?|>[>=]?|[+\-*\/]=?|[@^=]/i,{pattern:/(^|[^&])\b(?:and|as|div|exclude|in|include|is|mod|not|or|shl|shr|xor)\b/,lookbehind:!0}],punctuation:/\(\.|\.\)|[()\[\]:;,.]/},e.languages.objectpascal=e.languages.pascal}e.exports=t,t.displayName="pascal",t.aliases=["objectpascal"]},39303(e){"use strict";function t(e){var t,n,r,i,a;t=e,n=/\((?:[^()]|\((?:[^()]|\([^()]*\))*\))*\)/.source,r=/(?:\b\w+(?:)?|)/.source.replace(//g,function(){return n}),i=t.languages.pascaligo={comment:/\(\*[\s\S]+?\*\)|\/\/.*/,string:{pattern:/(["'`])(?:\\[\s\S]|(?!\1)[^\\])*\1|\^[a-z]/i,greedy:!0},"class-name":[{pattern:RegExp(/(\btype\s+\w+\s+is\s+)/.source.replace(//g,function(){return r}),"i"),lookbehind:!0,inside:null},{pattern:RegExp(/(?=\s+is\b)/.source.replace(//g,function(){return r}),"i"),inside:null},{pattern:RegExp(/(:\s*)/.source.replace(//g,function(){return r})),lookbehind:!0,inside:null}],keyword:{pattern:/(^|[^&])\b(?:begin|block|case|const|else|end|fail|for|from|function|if|is|nil|of|remove|return|skip|then|type|var|while|with)\b/i,lookbehind:!0},boolean:{pattern:/(^|[^&])\b(?:True|False)\b/i,lookbehind:!0},builtin:{pattern:/(^|[^&])\b(?:bool|int|list|map|nat|record|string|unit)\b/i,lookbehind:!0},function:/\b\w+(?=\s*\()/i,number:[/%[01]+|&[0-7]+|\$[a-f\d]+/i,/\b\d+(?:\.\d+)?(?:e[+-]?\d+)?(?:mtz|n)?/i],operator:/->|=\/=|\.\.|\*\*|:=|<[<=>]?|>[>=]?|[+\-*\/]=?|[@^=|]|\b(?:and|mod|or)\b/,punctuation:/\(\.|\.\)|[()\[\]:;,.{}]/},a=["comment","keyword","builtin","operator","punctuation"].reduce(function(e,t){return e[t]=i[t],e},{}),i["class-name"].forEach(function(e){e.inside=a})}e.exports=t,t.displayName="pascaligo",t.aliases=[]},77393(e){"use strict";function t(e){e.languages.pcaxis={string:/"[^"]*"/,keyword:{pattern:/((?:^|;)\s*)[-A-Z\d]+(?:\s*\[[-\w]+\])?(?:\s*\("[^"]*"(?:,\s*"[^"]*")*\))?(?=\s*=)/,lookbehind:!0,greedy:!0,inside:{keyword:/^[-A-Z\d]+/,language:{pattern:/^(\s*)\[[-\w]+\]/,lookbehind:!0,inside:{punctuation:/^\[|\]$/,property:/[-\w]+/}},"sub-key":{pattern:/^(\s*)\S[\s\S]*/,lookbehind:!0,inside:{parameter:{pattern:/"[^"]*"/,alias:"property"},punctuation:/^\(|\)$|,/}}}},operator:/=/,tlist:{pattern:/TLIST\s*\(\s*\w+(?:(?:\s*,\s*"[^"]*")+|\s*,\s*"[^"]*"-"[^"]*")?\s*\)/,greedy:!0,inside:{function:/^TLIST/,property:{pattern:/^(\s*\(\s*)\w+/,lookbehind:!0},string:/"[^"]*"/,punctuation:/[(),]/,operator:/-/}},punctuation:/[;,]/,number:{pattern:/(^|\s)\d+(?:\.\d+)?(?!\S)/,lookbehind:!0},boolean:/YES|NO/},e.languages.px=e.languages.pcaxis}e.exports=t,t.displayName="pcaxis",t.aliases=["px"]},19023(e){"use strict";function t(e){e.languages.peoplecode={comment:RegExp([/\/\*[\s\S]*?\*\//.source,/\bREM[^;]*;/.source,/<\*(?:[^<*]|\*(?!>)|<(?!\*)|<\*(?:(?!\*>)[\s\S])*\*>)*\*>/.source,/\/\+[\s\S]*?\+\//.source].join("|")),string:{pattern:/'(?:''|[^'\r\n])*'(?!')|"(?:""|[^"\r\n])*"(?!")/,greedy:!0},variable:/%\w+/,"function-definition":{pattern:/((?:^|[^\w-])(?:function|method)\s+)\w+/i,lookbehind:!0,alias:"function"},"class-name":{pattern:/((?:^|[^-\w])(?:as|catch|class|component|create|extends|global|implements|instance|local|of|property|returns)\s+)\w+(?::\w+)*/i,lookbehind:!0,inside:{punctuation:/:/}},keyword:/\b(?:abstract|alias|as|catch|class|component|constant|create|declare|else|end-(?:class|evaluate|for|function|get|if|method|set|try|while)|evaluate|extends|for|function|get|global|implements|import|instance|if|library|local|method|null|of|out|peopleCode|private|program|property|protected|readonly|ref|repeat|returns?|set|step|then|throw|to|try|until|value|when(?:-other)?|while)\b/i,"operator-keyword":{pattern:/\b(?:and|not|or)\b/i,alias:"operator"},function:/[_a-z]\w*(?=\s*\()/i,boolean:/\b(?:false|true)\b/i,number:/\b\d+(?:\.\d+)?\b/,operator:/<>|[<>]=?|!=|\*\*|[-+*/|=@]/,punctuation:/[:.;,()[\]]/},e.languages.pcode=e.languages.peoplecode}e.exports=t,t.displayName="peoplecode",t.aliases=["pcode"]},74212(e){"use strict";function t(e){e.languages.perl={comment:[{pattern:/(^\s*)=\w[\s\S]*?=cut.*/m,lookbehind:!0},{pattern:/(^|[^\\$])#.*/,lookbehind:!0}],string:[{pattern:/\b(?:q|qq|qx|qw)\s*([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1/,greedy:!0},{pattern:/\b(?:q|qq|qx|qw)\s+([a-zA-Z0-9])(?:(?!\1)[^\\]|\\[\s\S])*\1/,greedy:!0},{pattern:/\b(?:q|qq|qx|qw)\s*\((?:[^()\\]|\\[\s\S])*\)/,greedy:!0},{pattern:/\b(?:q|qq|qx|qw)\s*\{(?:[^{}\\]|\\[\s\S])*\}/,greedy:!0},{pattern:/\b(?:q|qq|qx|qw)\s*\[(?:[^[\]\\]|\\[\s\S])*\]/,greedy:!0},{pattern:/\b(?:q|qq|qx|qw)\s*<(?:[^<>\\]|\\[\s\S])*>/,greedy:!0},{pattern:/("|`)(?:(?!\1)[^\\]|\\[\s\S])*\1/,greedy:!0},{pattern:/'(?:[^'\\\r\n]|\\.)*'/,greedy:!0}],regex:[{pattern:/\b(?:m|qr)\s*([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1[msixpodualngc]*/,greedy:!0},{pattern:/\b(?:m|qr)\s+([a-zA-Z0-9])(?:(?!\1)[^\\]|\\[\s\S])*\1[msixpodualngc]*/,greedy:!0},{pattern:/\b(?:m|qr)\s*\((?:[^()\\]|\\[\s\S])*\)[msixpodualngc]*/,greedy:!0},{pattern:/\b(?:m|qr)\s*\{(?:[^{}\\]|\\[\s\S])*\}[msixpodualngc]*/,greedy:!0},{pattern:/\b(?:m|qr)\s*\[(?:[^[\]\\]|\\[\s\S])*\][msixpodualngc]*/,greedy:!0},{pattern:/\b(?:m|qr)\s*<(?:[^<>\\]|\\[\s\S])*>[msixpodualngc]*/,greedy:!0},{pattern:/(^|[^-]\b)(?:s|tr|y)\s*([^a-zA-Z0-9\s{(\[<])(?:(?!\2)[^\\]|\\[\s\S])*\2(?:(?!\2)[^\\]|\\[\s\S])*\2[msixpodualngcer]*/,lookbehind:!0,greedy:!0},{pattern:/(^|[^-]\b)(?:s|tr|y)\s+([a-zA-Z0-9])(?:(?!\2)[^\\]|\\[\s\S])*\2(?:(?!\2)[^\\]|\\[\s\S])*\2[msixpodualngcer]*/,lookbehind:!0,greedy:!0},{pattern:/(^|[^-]\b)(?:s|tr|y)\s*\((?:[^()\\]|\\[\s\S])*\)\s*\((?:[^()\\]|\\[\s\S])*\)[msixpodualngcer]*/,lookbehind:!0,greedy:!0},{pattern:/(^|[^-]\b)(?:s|tr|y)\s*\{(?:[^{}\\]|\\[\s\S])*\}\s*\{(?:[^{}\\]|\\[\s\S])*\}[msixpodualngcer]*/,lookbehind:!0,greedy:!0},{pattern:/(^|[^-]\b)(?:s|tr|y)\s*\[(?:[^[\]\\]|\\[\s\S])*\]\s*\[(?:[^[\]\\]|\\[\s\S])*\][msixpodualngcer]*/,lookbehind:!0,greedy:!0},{pattern:/(^|[^-]\b)(?:s|tr|y)\s*<(?:[^<>\\]|\\[\s\S])*>\s*<(?:[^<>\\]|\\[\s\S])*>[msixpodualngcer]*/,lookbehind:!0,greedy:!0},{pattern:/\/(?:[^\/\\\r\n]|\\.)*\/[msixpodualngc]*(?=\s*(?:$|[\r\n,.;})&|\-+*~<>!?^]|(?:lt|gt|le|ge|eq|ne|cmp|not|and|or|xor|x)\b))/,greedy:!0}],variable:[/[&*$@%]\{\^[A-Z]+\}/,/[&*$@%]\^[A-Z_]/,/[&*$@%]#?(?=\{)/,/[&*$@%]#?(?:(?:::)*'?(?!\d)[\w$]+(?![\w$]))+(?:::)*/i,/[&*$@%]\d+/,/(?!%=)[$@%][!"#$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~]/],filehandle:{pattern:/<(?![<=])\S*>|\b_\b/,alias:"symbol"},vstring:{pattern:/v\d+(?:\.\d+)*|\d+(?:\.\d+){2,}/,alias:"string"},function:{pattern:/sub \w+/i,inside:{keyword:/sub/}},keyword:/\b(?:any|break|continue|default|delete|die|do|else|elsif|eval|for|foreach|given|goto|if|last|local|my|next|our|package|print|redo|require|return|say|state|sub|switch|undef|unless|until|use|when|while)\b/,number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)\b/,operator:/-[rwxoRWXOezsfdlpSbctugkTBMAC]\b|\+[+=]?|-[-=>]?|\*\*?=?|\/\/?=?|=[=~>]?|~[~=]?|\|\|?=?|&&?=?|<(?:=>?|<=?)?|>>?=?|![~=]?|[%^]=?|\.(?:=|\.\.?)?|[\\?]|\bx(?:=|\b)|\b(?:lt|gt|le|ge|eq|ne|cmp|not|and|or|xor)\b/,punctuation:/[{}[\];(),:]/}}e.exports=t,t.displayName="perl",t.aliases=[]},5137(e,t,n){"use strict";var r=n(88262);function i(e){e.register(r),e.languages.insertBefore("php","variable",{this:/\$this\b/,global:/\$(?:_(?:SERVER|GET|POST|FILES|REQUEST|SESSION|ENV|COOKIE)|GLOBALS|HTTP_RAW_POST_DATA|argc|argv|php_errormsg|http_response_header)\b/,scope:{pattern:/\b[\w\\]+::/,inside:{keyword:/static|self|parent/,punctuation:/::|\\/}}})}e.exports=i,i.displayName="phpExtras",i.aliases=[]},88262(e,t,n){"use strict";var r=n(93205);function i(e){var t,n,i,a,o,s,u,c;e.register(r),n=/\/\*[\s\S]*?\*\/|\/\/.*|#(?!\[).*/,i=[{pattern:/\b(?:false|true)\b/i,alias:"boolean"},{pattern:/(::\s*)\b[a-z_]\w*\b(?!\s*\()/i,greedy:!0,lookbehind:!0},{pattern:/(\b(?:case|const)\s+)\b[a-z_]\w*(?=\s*[;=])/i,greedy:!0,lookbehind:!0},/\b(?:null)\b/i,/\b[A-Z_][A-Z0-9_]*\b(?!\s*\()/],a=/\b0b[01]+(?:_[01]+)*\b|\b0o[0-7]+(?:_[0-7]+)*\b|\b0x[\da-f]+(?:_[\da-f]+)*\b|(?:\b\d+(?:_\d+)*\.?(?:\d+(?:_\d+)*)?|\B\.\d+)(?:e[+-]?\d+)?/i,o=/|\?\?=?|\.{3}|\??->|[!=]=?=?|::|\*\*=?|--|\+\+|&&|\|\||<<|>>|[?~]|[/^|%*&<>.+-]=?/,s=/[{}\[\](),:;]/,(t=e).languages.php={delimiter:{pattern:/\?>$|^<\?(?:php(?=\s)|=)?/i,alias:"important"},comment:n,variable:/\$+(?:\w+\b|(?=\{))/i,package:{pattern:/(namespace\s+|use\s+(?:function\s+)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,lookbehind:!0,inside:{punctuation:/\\/}},"class-name-definition":{pattern:/(\b(?:class|enum|interface|trait)\s+)\b[a-z_]\w*(?!\\)\b/i,lookbehind:!0,alias:"class-name"},"function-definition":{pattern:/(\bfunction\s+)[a-z_]\w*(?=\s*\()/i,lookbehind:!0,alias:"function"},keyword:[{pattern:/(\(\s*)\b(?:bool|boolean|int|integer|float|string|object|array)\b(?=\s*\))/i,alias:"type-casting",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)\b(?:bool|int|float|string|object|array(?!\s*\()|mixed|self|static|callable|iterable|(?:null|false)(?=\s*\|))\b(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*[\w|]\|\s*)(?:null|false)\b(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b(?:bool|int|float|string|object|void|array(?!\s*\()|mixed|self|static|callable|iterable|(?:null|false)(?=\s*\|))\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?[\w|]\|\s*)(?:null|false)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/\b(?:bool|int|float|string|object|void|array(?!\s*\()|mixed|iterable|(?:null|false)(?=\s*\|))\b/i,alias:"type-declaration",greedy:!0},{pattern:/(\|\s*)(?:null|false)\b/i,alias:"type-declaration",greedy:!0,lookbehind:!0},{pattern:/\b(?:parent|self|static)(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(\byield\s+)from\b/i,lookbehind:!0},/\bclass\b/i,{pattern:/((?:^|[^\s>:]|(?:^|[^-])>|(?:^|[^:]):)\s*)\b(?:__halt_compiler|abstract|and|array|as|break|callable|case|catch|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|enum|eval|exit|extends|final|finally|fn|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|namespace|match|new|or|parent|print|private|protected|public|require|require_once|return|self|static|switch|throw|trait|try|unset|use|var|while|xor|yield)\b/i,lookbehind:!0}],"argument-name":{pattern:/([(,]\s+)\b[a-z_]\w*(?=\s*:(?!:))/i,lookbehind:!0},"class-name":[{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self|\s+static))\s+|\bcatch\s*\()\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/(\|\s*)\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/\b[a-z_]\w*(?!\\)\b(?=\s*\|)/i,greedy:!0},{pattern:/(\|\s*)(?:\\?\b[a-z_]\w*)+\b/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(?:\\?\b[a-z_]\w*)+\b(?=\s*\|)/i,alias:"class-name-fully-qualified",greedy:!0,inside:{punctuation:/\\/}},{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self\b|\s+static\b))\s+|\bcatch\s*\()(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*\$)/i,alias:"type-declaration",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-declaration"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*::)/i,alias:["class-name-fully-qualified","static-context"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/([(,?]\s*)[a-z_]\w*(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-hint"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b[a-z_]\w*(?!\\)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:["class-name-fully-qualified","return-type"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:i,function:{pattern:/(^|[^\\\w])\\?[a-z_](?:[\w\\]*\w)?(?=\s*\()/i,lookbehind:!0,inside:{punctuation:/\\/}},property:{pattern:/(->\s*)\w+/,lookbehind:!0},number:a,operator:o,punctuation:s},c=[{pattern:/<<<'([^']+)'[\r\n](?:.*[\r\n])*?\1;/,alias:"nowdoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<'[^']+'|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<'?|[';]$/}}}},{pattern:/<<<(?:"([^"]+)"[\r\n](?:.*[\r\n])*?\1;|([a-z_]\w*)[\r\n](?:.*[\r\n])*?\2;)/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<(?:"[^"]+"|[a-z_]\w*)|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<"?|[";]$/}},interpolation:u={pattern:/\{\$(?:\{(?:\{[^{}]+\}|[^{}]+)\}|[^{}])+\}|(^|[^\\{])\$+(?:\w+(?:\[[^\r\n\[\]]+\]|->\w+)?)/,lookbehind:!0,inside:t.languages.php}}},{pattern:/`(?:\\[\s\S]|[^\\`])*`/,alias:"backtick-quoted-string",greedy:!0},{pattern:/'(?:\\[\s\S]|[^\\'])*'/,alias:"single-quoted-string",greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,alias:"double-quoted-string",greedy:!0,inside:{interpolation:u}}],t.languages.insertBefore("php","variable",{string:c,attribute:{pattern:/#\[(?:[^"'\/#]|\/(?![*/])|\/\/.*$|#(?!\[).*$|\/\*(?:[^*]|\*(?!\/))*\*\/|"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*')+\](?=\s*[a-z$#])/im,greedy:!0,inside:{"attribute-content":{pattern:/^(#\[)[\s\S]+(?=\]$)/,lookbehind:!0,inside:{comment:n,string:c,"attribute-class-name":[{pattern:/([^:]|^)\b[a-z_]\w*(?!\\)\b/i,alias:"class-name",greedy:!0,lookbehind:!0},{pattern:/([^:]|^)(?:\\?\b[a-z_]\w*)+/i,alias:["class-name","class-name-fully-qualified"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:i,number:a,operator:o,punctuation:s}},delimiter:{pattern:/^#\[|\]$/,alias:"punctuation"}}}}),t.hooks.add("before-tokenize",function(e){if(/<\?/.test(e.code)){var n=/<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#(?!\[))(?:[^?\n\r]|\?(?!>))*(?=$|\?>|[\r\n])|#\[|\/\*(?:[^*]|\*(?!\/))*(?:\*\/|$))*?(?:\?>|$)/gi;t.languages["markup-templating"].buildPlaceholders(e,"php",n)}}),t.hooks.add("after-tokenize",function(e){t.languages["markup-templating"].tokenizePlaceholders(e,"php")})}e.exports=i,i.displayName="php",i.aliases=[]},63632(e,t,n){"use strict";var r=n(88262),i=n(9858);function a(e){var t,n;e.register(r),e.register(i),n=/(?:\b[a-zA-Z]\w*|[|\\[\]])+/.source,(t=e).languages.phpdoc=t.languages.extend("javadoclike",{parameter:{pattern:RegExp("(@(?:global|param|property(?:-read|-write)?|var)\\s+(?:"+n+"\\s+)?)\\$\\w+"),lookbehind:!0}}),t.languages.insertBefore("phpdoc","keyword",{"class-name":[{pattern:RegExp("(@(?:global|package|param|property(?:-read|-write)?|return|subpackage|throws|var)\\s+)"+n),lookbehind:!0,inside:{keyword:/\b(?:callback|resource|boolean|integer|double|object|string|array|false|float|mixed|bool|null|self|true|void|int)\b/,punctuation:/[|\\[\]()]/}}]}),t.languages.javadoclike.addSupport("php",t.languages.phpdoc)}e.exports=a,a.displayName="phpdoc",a.aliases=[]},59149(e,t,n){"use strict";var r=n(11114);function i(e){var t,n,i,a;e.register(r),Array.isArray(i=(n=(t=e).languages.plsql=t.languages.extend("sql",{comment:[/\/\*[\s\S]*?\*\//,/--.*/]})).keyword)||(i=n.keyword=[i]),i.unshift(/\b(?:ACCESS|AGENT|AGGREGATE|ARRAY|ARROW|AT|ATTRIBUTE|AUDIT|AUTHID|BFILE_BASE|BLOB_BASE|BLOCK|BODY|BOTH|BOUND|BYTE|CALLING|CHAR_BASE|CHARSET(?:FORM|ID)|CLOB_BASE|COLAUTH|COLLECT|CLUSTERS?|COMPILED|COMPRESS|CONSTANT|CONSTRUCTOR|CONTEXT|CRASH|CUSTOMDATUM|DANGLING|DATE_BASE|DEFINE|DETERMINISTIC|DURATION|ELEMENT|EMPTY|EXCEPTIONS?|EXCLUSIVE|EXTERNAL|FINAL|FORALL|FORM|FOUND|GENERAL|HEAP|HIDDEN|IDENTIFIED|IMMEDIATE|INCLUDING|INCREMENT|INDICATOR|INDEXES|INDICES|INFINITE|INITIAL|ISOPEN|INSTANTIABLE|INTERFACE|INVALIDATE|JAVA|LARGE|LEADING|LENGTH|LIBRARY|LIKE[24C]|LIMITED|LONG|LOOP|MAP|MAXEXTENTS|MAXLEN|MEMBER|MINUS|MLSLABEL|MULTISET|NAME|NAN|NATIVE|NEW|NOAUDIT|NOCOMPRESS|NOCOPY|NOTFOUND|NOWAIT|NUMBER(?:_BASE)?|OBJECT|OCI(?:COLL|DATE|DATETIME|DURATION|INTERVAL|LOBLOCATOR|NUMBER|RAW|REF|REFCURSOR|ROWID|STRING|TYPE)|OFFLINE|ONLINE|ONLY|OPAQUE|OPERATOR|ORACLE|ORADATA|ORGANIZATION|ORL(?:ANY|VARY)|OTHERS|OVERLAPS|OVERRIDING|PACKAGE|PARALLEL_ENABLE|PARAMETERS?|PASCAL|PCTFREE|PIPE(?:LINED)?|PRAGMA|PRIOR|PRIVATE|RAISE|RANGE|RAW|RECORD|REF|REFERENCE|REM|REMAINDER|RESULT|RESOURCE|RETURNING|REVERSE|ROW(?:ID|NUM|TYPE)|SAMPLE|SB[124]|SEGMENT|SELF|SEPARATE|SEQUENCE|SHORT|SIZE(?:_T)?|SPARSE|SQL(?:CODE|DATA|NAME|STATE)|STANDARD|STATIC|STDDEV|STORED|STRING|STRUCT|STYLE|SUBMULTISET|SUBPARTITION|SUBSTITUTABLE|SUBTYPE|SUCCESSFUL|SYNONYM|SYSDATE|TABAUTH|TDO|THE|TIMEZONE_(?:ABBR|HOUR|MINUTE|REGION)|TRAILING|TRANSAC(?:TIONAL)?|TRUSTED|UB[124]|UID|UNDER|UNTRUSTED|VALIDATE|VALIST|VARCHAR2|VARIABLE|VARIANCE|VARRAY|VIEWS|VOID|WHENEVER|WRAPPED|ZONE)\b/i),Array.isArray(a=n.operator)||(a=n.operator=[a]),a.unshift(/:=/)}e.exports=i,i.displayName="plsql",i.aliases=[]},50256(e){"use strict";function t(e){e.languages.powerquery={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:\/\/).*)/,lookbehind:!0},"quoted-identifier":{pattern:/#"(?:[^"\r\n]|"")*"(?!")/,greedy:!0,alias:"variable"},string:{pattern:/"(?:[^"\r\n]|"")*"(?!")/,greedy:!0},constant:[/\bDay\.(?:Sunday|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday)\b/,/\bTraceLevel\.(?:Critical|Error|Information|Verbose|Warning)\b/,/\bOccurrence\.(?:First|Last|All)\b/,/\bOrder\.(?:Ascending|Descending)\b/,/\bRoundingMode\.(?:AwayFromZero|Down|ToEven|TowardZero|Up)\b/,/\bMissingField\.(?:Error|Ignore|UseNull)\b/,/\bQuoteStyle\.(?:Csv|None)\b/,/\bJoinKind\.(?:Inner|LeftOuter|RightOuter|FullOuter|LeftAnti|RightAnti)\b/,/\bGroupKind\.(?:Global|Local)\b/,/\bExtraValues\.(?:List|Ignore|Error)\b/,/\bJoinAlgorithm\.(?:Dynamic|PairwiseHash|SortMerge|LeftHash|RightHash|LeftIndex|RightIndex)\b/,/\bJoinSide\.(?:Left|Right)\b/,/\bPrecision\.(?:Double|Decimal)\b/,/\bRelativePosition\.From(?:End|Start)\b/,/\bTextEncoding\.(?:Ascii|BigEndianUnicode|Unicode|Utf8|Utf16|Windows)\b/,/\b(?:Any|Binary|Date|DateTime|DateTimeZone|Duration|Int8|Int16|Int32|Int64|Function|List|Logical|None|Number|Record|Table|Text|Time)\.Type\b/,/\bnull\b/],boolean:/\b(?:true|false)\b/,keyword:/\b(?:and|as|each|else|error|if|in|is|let|meta|not|nullable|optional|or|otherwise|section|shared|then|try|type)\b|#(?:binary|date|datetime|datetimezone|duration|infinity|nan|sections|shared|table|time)\b/,function:{pattern:/(^|[^#\w.])(?!\d)[\w.]+(?=\s*\()/,lookbehind:!0},"data-type":{pattern:/\b(?:any|anynonnull|binary|date|datetime|datetimezone|duration|function|list|logical|none|number|record|table|text|time|type)\b/,alias:"variable"},number:{pattern:/\b0x[\da-f]+\b|(?:[+-]?(?:\b\d+\.)?\b\d+|[+-]\.\d+|(^|[^.])\B\.\d+)(?:e[+-]?\d+)?\b/i,lookbehind:!0},operator:/[-+*\/&?@^]|<(?:=>?|>)?|>=?|=>?|\.\.\.?/,punctuation:/[,;\[\](){}]/},e.languages.pq=e.languages.powerquery,e.languages.mscript=e.languages.powerquery}e.exports=t,t.displayName="powerquery",t.aliases=[]},61777(e){"use strict";function t(e){var t,n,r;(r=(n=(t=e).languages.powershell={comment:[{pattern:/(^|[^`])<#[\s\S]*?#>/,lookbehind:!0},{pattern:/(^|[^`])#.*/,lookbehind:!0}],string:[{pattern:/"(?:`[\s\S]|[^`"])*"/,greedy:!0,inside:{function:{pattern:/(^|[^`])\$\((?:\$\([^\r\n()]*\)|(?!\$\()[^\r\n)])*\)/,lookbehind:!0,inside:{}}}},{pattern:/'(?:[^']|'')*'/,greedy:!0}],namespace:/\[[a-z](?:\[(?:\[[^\]]*\]|[^\[\]])*\]|[^\[\]])*\]/i,boolean:/\$(?:true|false)\b/i,variable:/\$\w+\b/,function:[/\b(?:Add|Approve|Assert|Backup|Block|Checkpoint|Clear|Close|Compare|Complete|Compress|Confirm|Connect|Convert|ConvertFrom|ConvertTo|Copy|Debug|Deny|Disable|Disconnect|Dismount|Edit|Enable|Enter|Exit|Expand|Export|Find|ForEach|Format|Get|Grant|Group|Hide|Import|Initialize|Install|Invoke|Join|Limit|Lock|Measure|Merge|Move|New|Open|Optimize|Out|Ping|Pop|Protect|Publish|Push|Read|Receive|Redo|Register|Remove|Rename|Repair|Request|Reset|Resize|Resolve|Restart|Restore|Resume|Revoke|Save|Search|Select|Send|Set|Show|Skip|Sort|Split|Start|Step|Stop|Submit|Suspend|Switch|Sync|Tee|Test|Trace|Unblock|Undo|Uninstall|Unlock|Unprotect|Unpublish|Unregister|Update|Use|Wait|Watch|Where|Write)-[a-z]+\b/i,/\b(?:ac|cat|chdir|clc|cli|clp|clv|compare|copy|cp|cpi|cpp|cvpa|dbp|del|diff|dir|ebp|echo|epal|epcsv|epsn|erase|fc|fl|ft|fw|gal|gbp|gc|gci|gcs|gdr|gi|gl|gm|gp|gps|group|gsv|gu|gv|gwmi|iex|ii|ipal|ipcsv|ipsn|irm|iwmi|iwr|kill|lp|ls|measure|mi|mount|move|mp|mv|nal|ndr|ni|nv|ogv|popd|ps|pushd|pwd|rbp|rd|rdr|ren|ri|rm|rmdir|rni|rnp|rp|rv|rvpa|rwmi|sal|saps|sasv|sbp|sc|select|set|shcm|si|sl|sleep|sls|sort|sp|spps|spsv|start|sv|swmi|tee|trcm|type|write)\b/i],keyword:/\b(?:Begin|Break|Catch|Class|Continue|Data|Define|Do|DynamicParam|Else|ElseIf|End|Exit|Filter|Finally|For|ForEach|From|Function|If|InlineScript|Parallel|Param|Process|Return|Sequence|Switch|Throw|Trap|Try|Until|Using|Var|While|Workflow)\b/i,operator:{pattern:/(\W?)(?:!|-(?:eq|ne|gt|ge|lt|le|sh[lr]|not|b?(?:and|x?or)|(?:Not)?(?:Like|Match|Contains|In)|Replace|Join|is(?:Not)?|as)\b|-[-=]?|\+[+=]?|[*\/%]=?)/i,lookbehind:!0},punctuation:/[|{}[\];(),.]/}).string[0].inside).boolean=n.boolean,r.variable=n.variable,r.function.inside=n}e.exports=t,t.displayName="powershell",t.aliases=[]},3623(e){"use strict";function t(e){e.languages.processing=e.languages.extend("clike",{keyword:/\b(?:break|catch|case|class|continue|default|else|extends|final|for|if|implements|import|new|null|private|public|return|static|super|switch|this|try|void|while)\b/,operator:/<[<=]?|>[>=]?|&&?|\|\|?|[%?]|[!=+\-*\/]=?/}),e.languages.insertBefore("processing","number",{constant:/\b(?!XML\b)[A-Z][A-Z\d_]+\b/,type:{pattern:/\b(?:boolean|byte|char|color|double|float|int|[A-Z]\w*)\b/,alias:"variable"}}),e.languages.processing.function=/\b\w+(?=\s*\()/,e.languages.processing["class-name"].alias="variable"}e.exports=t,t.displayName="processing",t.aliases=[]},82707(e){"use strict";function t(e){e.languages.prolog={comment:[/%.+/,/\/\*[\s\S]*?\*\//],string:{pattern:/(["'])(?:\1\1|\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},builtin:/\b(?:fx|fy|xf[xy]?|yfx?)\b/,variable:/\b[A-Z_]\w*/,function:/\b[a-z]\w*(?:(?=\()|\/\d+)/,number:/\b\d+(?:\.\d*)?/,operator:/[:\\=><\-?*@\/;+^|!$.]+|\b(?:is|mod|not|xor)\b/,punctuation:/[(){}\[\],]/}}e.exports=t,t.displayName="prolog",t.aliases=[]},59338(e){"use strict";function t(e){var t,n,r;t=e,r=["sum","min","max","avg","group","stddev","stdvar","count","count_values","bottomk","topk","quantile"].concat(n=["on","ignoring","group_right","group_left","by","without"],["offset"]),t.languages.promql={comment:{pattern:/(^[ \t]*)#.*/m,lookbehind:!0},"vector-match":{pattern:RegExp("((?:"+n.join("|")+")\\s*)\\([^)]*\\)"),lookbehind:!0,inside:{"label-key":{pattern:/\b[^,]*\b/,alias:"attr-name"},punctuation:/[(),]/}},"context-labels":{pattern:/\{[^{}]*\}/,inside:{"label-key":{pattern:/\b[a-z_]\w*(?=\s*(?:=|![=~]))/,alias:"attr-name"},"label-value":{pattern:/(["'`])(?:\\[\s\S]|(?!\1)[^\\])*\1/,greedy:!0,alias:"attr-value"},punctuation:/\{|\}|=~?|![=~]|,/}},"context-range":[{pattern:/\[[\w\s:]+\]/,inside:{punctuation:/\[|\]|:/,"range-duration":{pattern:/\b(?:\d+(?:[smhdwy]|ms))+\b/i,alias:"number"}}},{pattern:/(\boffset\s+)\w+/,lookbehind:!0,inside:{"range-duration":{pattern:/\b(?:\d+(?:[smhdwy]|ms))+\b/i,alias:"number"}}}],keyword:RegExp("\\b(?:"+r.join("|")+")\\b","i"),function:/\b[a-z_]\w*(?=\s*\()/i,number:/[-+]?(?:(?:\b\d+(?:\.\d+)?|\B\.\d+)(?:e[-+]?\d+)?\b|\b(?:0x[0-9a-f]+|nan|inf)\b)/i,operator:/[\^*/%+-]|==|!=|<=|<|>=|>|\b(?:and|unless|or)\b/i,punctuation:/[{};()`,.[\]]/}}e.exports=t,t.displayName="promql",t.aliases=[]},56267(e){"use strict";function t(e){e.languages.properties={comment:/^[ \t]*[#!].*$/m,"attr-value":{pattern:/(^[ \t]*(?:\\(?:\r\n|[\s\S])|[^\\\s:=])+(?: *[=:] *(?! )| ))(?:\\(?:\r\n|[\s\S])|[^\\\r\n])+/m,lookbehind:!0},"attr-name":/^[ \t]*(?:\\(?:\r\n|[\s\S])|[^\\\s:=])+(?= *[=:]| )/m,punctuation:/[=:]/}}e.exports=t,t.displayName="properties",t.aliases=[]},98809(e){"use strict";function t(e){var t,n;n=/\b(?:double|float|[su]?int(?:32|64)|s?fixed(?:32|64)|bool|string|bytes)\b/,(t=e).languages.protobuf=t.languages.extend("clike",{"class-name":[{pattern:/(\b(?:enum|extend|message|service)\s+)[A-Za-z_]\w*(?=\s*\{)/,lookbehind:!0},{pattern:/(\b(?:rpc\s+\w+|returns)\s*\(\s*(?:stream\s+)?)\.?[A-Za-z_]\w*(?:\.[A-Za-z_]\w*)*(?=\s*\))/,lookbehind:!0}],keyword:/\b(?:enum|extend|extensions|import|message|oneof|option|optional|package|public|repeated|required|reserved|returns|rpc(?=\s+\w)|service|stream|syntax|to)\b(?!\s*=\s*\d)/,function:/\b[a-z_]\w*(?=\s*\()/i}),t.languages.insertBefore("protobuf","operator",{map:{pattern:/\bmap<\s*[\w.]+\s*,\s*[\w.]+\s*>(?=\s+[a-z_]\w*\s*[=;])/i,alias:"class-name",inside:{punctuation:/[<>.,]/,builtin:n}},builtin:n,"positional-class-name":{pattern:/(?:\b|\B\.)[a-z_]\w*(?:\.[a-z_]\w*)*(?=\s+[a-z_]\w*\s*[=;])/i,alias:"class-name",inside:{punctuation:/\./}},annotation:{pattern:/(\[\s*)[a-z_]\w*(?=\s*=)/i,lookbehind:!0}})}e.exports=t,t.displayName="protobuf",t.aliases=[]},37548(e){"use strict";function t(e){e.languages.psl={comment:{pattern:/#.*/,greedy:!0},string:{pattern:/"(?:\\.|[^\\"])*"/,greedy:!0,inside:{symbol:/\\[ntrbA-Z"\\]/}},"heredoc-string":{pattern:/<<<([a-zA-Z_]\w*)[\r\n](?:.*[\r\n])*?\1\b/,alias:"string",greedy:!0},keyword:/\b(?:__multi|__single|case|default|do|else|elsif|exit|export|for|foreach|function|if|last|line|local|next|requires|return|switch|until|while|word)\b/,constant:/\b(?:ALARM|CHART_ADD_GRAPH|CHART_DELETE_GRAPH|CHART_DESTROY|CHART_LOAD|CHART_PRINT|EOF|FALSE|False|false|NO|No|no|OFFLINE|OK|PSL_PROF_LOG|R_CHECK_HORIZ|R_CHECK_VERT|R_CLICKER|R_COLUMN|R_FRAME|R_ICON|R_LABEL|R_LABEL_CENTER|R_LIST_MULTIPLE|R_LIST_MULTIPLE_ND|R_LIST_SINGLE|R_LIST_SINGLE_ND|R_MENU|R_POPUP|R_POPUP_SCROLLED|R_RADIO_HORIZ|R_RADIO_VERT|R_ROW|R_SCALE_HORIZ|R_SCALE_VERT|R_SPINNER|R_TEXT_FIELD|R_TEXT_FIELD_LABEL|R_TOGGLE|TRIM_LEADING|TRIM_LEADING_AND_TRAILING|TRIM_REDUNDANT|TRIM_TRAILING|TRUE|True|true|VOID|WARN)\b/,variable:/\b(?:errno|exit_status|PslDebug)\b/,builtin:{pattern:/\b(?:acos|add_diary|annotate|annotate_get|asctime|asin|atan|atexit|ascii_to_ebcdic|batch_set|blackout|cat|ceil|chan_exists|change_state|close|code_cvt|cond_signal|cond_wait|console_type|convert_base|convert_date|convert_locale_date|cos|cosh|create|destroy_lock|dump_hist|date|destroy|difference|dget_text|dcget_text|ebcdic_to_ascii|encrypt|event_archive|event_catalog_get|event_check|event_query|event_range_manage|event_range_query|event_report|event_schedule|event_trigger|event_trigger2|execute|exists|exp|fabs|floor|fmod|full_discovery|file|fopen|ftell|fseek|grep|get_vars|getenv|get|get_chan_info|get_ranges|get_text|gethostinfo|getpid|getpname|history_get_retention|history|index|int|is_var|intersection|isnumber|internal|in_transition|join|kill|length|lines|lock|lock_info|log|loge|log10|matchline|msg_check|msg_get_format|msg_get_severity|msg_printf|msg_sprintf|ntharg|num_consoles|nthargf|nthline|nthlinef|num_bytes|print|proc_exists|process|popen|printf|pconfig|poplines|pow|PslExecute|PslFunctionCall|PslFunctionExists|PslSetOptions|random|read|readln|refresh_parameters|remote_check|remote_close|remote_event_query|remote_event_trigger|remote_file_send|remote_open|remove|replace|rindex|sec_check_priv|sec_store_get|sec_store_set|set_alarm_ranges|set_locale|share|sin|sinh|sleep|sopen|sqrt|srandom|subset|set|substr|system|sprintf|sort|snmp_agent_config|_snmp_debug|snmp_agent_stop|snmp_agent_start|snmp_h_set|snmp_h_get_next|snmp_h_get|snmp_set|snmp_walk|snmp_get_next|snmp_get|snmp_config|snmp_close|snmp_open|snmp_trap_receive|snmp_trap_ignore|snmp_trap_listen|snmp_trap_send|snmp_trap_raise_std_trap|snmp_trap_register_im|splitline|strcasecmp|str_repeat|trim|tail|tan|tanh|time|tmpnam|tolower|toupper|trace_psl_process|text_domain|unlock|unique|union|unset|va_arg|va_start|write)\b/,alias:"builtin-function"},"foreach-variable":{pattern:/(\bforeach\s+(?:(?:\w+\b|"(?:\\.|[^\\"])*")\s+){0,2})[_a-zA-Z]\w*(?=\s*\()/,lookbehind:!0,greedy:!0},function:{pattern:/\b[_a-z]\w*\b(?=\s*\()/i},number:/\b(?:0x[0-9a-f]+|[0-9]+(?:\.[0-9]+)?)\b/i,operator:/--|\+\+|&&=?|\|\|=?|<<=?|>>=?|[=!]~|[-+*/%&|^!=<>]=?|\.|[:?]/,punctuation:/[(){}\[\];,]/}}e.exports=t,t.displayName="psl",t.aliases=[]},82161(e){"use strict";function t(e){!function(e){e.languages.pug={comment:{pattern:/(^([\t ]*))\/\/.*(?:(?:\r?\n|\r)\2[\t ].+)*/m,lookbehind:!0},"multiline-script":{pattern:/(^([\t ]*)script\b.*\.[\t ]*)(?:(?:\r?\n|\r(?!\n))(?:\2[\t ].+|\s*?(?=\r?\n|\r)))+/m,lookbehind:!0,inside:e.languages.javascript},filter:{pattern:/(^([\t ]*)):.+(?:(?:\r?\n|\r(?!\n))(?:\2[\t ].+|\s*?(?=\r?\n|\r)))+/m,lookbehind:!0,inside:{"filter-name":{pattern:/^:[\w-]+/,alias:"variable"}}},"multiline-plain-text":{pattern:/(^([\t ]*)[\w\-#.]+\.[\t ]*)(?:(?:\r?\n|\r(?!\n))(?:\2[\t ].+|\s*?(?=\r?\n|\r)))+/m,lookbehind:!0},markup:{pattern:/(^[\t ]*)<.+/m,lookbehind:!0,inside:e.languages.markup},doctype:{pattern:/((?:^|\n)[\t ]*)doctype(?: .+)?/,lookbehind:!0},"flow-control":{pattern:/(^[\t ]*)(?:if|unless|else|case|when|default|each|while)\b(?: .+)?/m,lookbehind:!0,inside:{each:{pattern:/^each .+? in\b/,inside:{keyword:/\b(?:each|in)\b/,punctuation:/,/}},branch:{pattern:/^(?:if|unless|else|case|when|default|while)\b/,alias:"keyword"},rest:e.languages.javascript}},keyword:{pattern:/(^[\t ]*)(?:block|extends|include|append|prepend)\b.+/m,lookbehind:!0},mixin:[{pattern:/(^[\t ]*)mixin .+/m,lookbehind:!0,inside:{keyword:/^mixin/,function:/\w+(?=\s*\(|\s*$)/,punctuation:/[(),.]/}},{pattern:/(^[\t ]*)\+.+/m,lookbehind:!0,inside:{name:{pattern:/^\+\w+/,alias:"function"},rest:e.languages.javascript}}],script:{pattern:/(^[\t ]*script(?:(?:&[^(]+)?\([^)]+\))*[\t ]).+/m,lookbehind:!0,inside:e.languages.javascript},"plain-text":{pattern:/(^[\t ]*(?!-)[\w\-#.]*[\w\-](?:(?:&[^(]+)?\([^)]+\))*\/?[\t ]).+/m,lookbehind:!0},tag:{pattern:/(^[\t ]*)(?!-)[\w\-#.]*[\w\-](?:(?:&[^(]+)?\([^)]+\))*\/?:?/m,lookbehind:!0,inside:{attributes:[{pattern:/&[^(]+\([^)]+\)/,inside:e.languages.javascript},{pattern:/\([^)]+\)/,inside:{"attr-value":{pattern:/(=\s*(?!\s))(?:\{[^}]*\}|[^,)\r\n]+)/,lookbehind:!0,inside:e.languages.javascript},"attr-name":/[\w-]+(?=\s*!?=|\s*[,)])/,punctuation:/[!=(),]+/}}],punctuation:/:/,"attr-id":/#[\w\-]+/,"attr-class":/\.[\w\-]+/}},code:[{pattern:/(^[\t ]*(?:-|!?=)).+/m,lookbehind:!0,inside:e.languages.javascript}],punctuation:/[.\-!=|]+/};for(var t=/(^([\t ]*)):(?:(?:\r?\n|\r(?!\n))(?:\2[\t ].+|\s*?(?=\r?\n|\r)))+/.source,n=[{filter:"atpl",language:"twig"},{filter:"coffee",language:"coffeescript"},"ejs","handlebars","less","livescript","markdown",{filter:"sass",language:"scss"},"stylus"],r={},i=0,a=n.length;i",function(){return o.filter}),"m"),lookbehind:!0,inside:{"filter-name":{pattern:/^:[\w-]+/,alias:"variable"},rest:e.languages[o.language]}})}e.languages.insertBefore("pug","filter",r)}(e)}e.exports=t,t.displayName="pug",t.aliases=[]},80625(e){"use strict";function t(e){var t,n;(t=e).languages.puppet={heredoc:[{pattern:/(@\("([^"\r\n\/):]+)"(?:\/[nrts$uL]*)?\).*(?:\r?\n|\r))(?:.*(?:\r?\n|\r(?!\n)))*?[ \t]*(?:\|[ \t]*)?(?:-[ \t]*)?\2/,lookbehind:!0,alias:"string",inside:{punctuation:/(?=\S).*\S(?= *$)/}},{pattern:/(@\(([^"\r\n\/):]+)(?:\/[nrts$uL]*)?\).*(?:\r?\n|\r))(?:.*(?:\r?\n|\r(?!\n)))*?[ \t]*(?:\|[ \t]*)?(?:-[ \t]*)?\2/,lookbehind:!0,greedy:!0,alias:"string",inside:{punctuation:/(?=\S).*\S(?= *$)/}},{pattern:/@\("?(?:[^"\r\n\/):]+)"?(?:\/[nrts$uL]*)?\)/,alias:"string",inside:{punctuation:{pattern:/(\().+?(?=\))/,lookbehind:!0}}}],"multiline-comment":{pattern:/(^|[^\\])\/\*[\s\S]*?\*\//,lookbehind:!0,greedy:!0,alias:"comment"},regex:{pattern:/((?:\bnode\s+|[~=\(\[\{,]\s*|[=+]>\s*|^\s*))\/(?:[^\/\\]|\\[\s\S])+\/(?:[imx]+\b|\B)/,lookbehind:!0,greedy:!0,inside:{"extended-regex":{pattern:/^\/(?:[^\/\\]|\\[\s\S])+\/[im]*x[im]*$/,inside:{comment:/#.*/}}}},comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},string:{pattern:/(["'])(?:\$\{(?:[^'"}]|(["'])(?:(?!\2)[^\\]|\\[\s\S])*\2)+\}|\$(?!\{)|(?!\1)[^\\$]|\\[\s\S])*\1/,greedy:!0,inside:{"double-quoted":{pattern:/^"[\s\S]*"$/,inside:{}}}},variable:{pattern:/\$(?:::)?\w+(?:::\w+)*/,inside:{punctuation:/::/}},"attr-name":/(?:\b\w+|\*)(?=\s*=>)/,function:[{pattern:/(\.)(?!\d)\w+/,lookbehind:!0},/\b(?:contain|debug|err|fail|include|info|notice|realize|require|tag|warning)\b|\b(?!\d)\w+(?=\()/],number:/\b(?:0x[a-f\d]+|\d+(?:\.\d+)?(?:e-?\d+)?)\b/i,boolean:/\b(?:true|false)\b/,keyword:/\b(?:application|attr|case|class|consumes|default|define|else|elsif|function|if|import|inherits|node|private|produces|type|undef|unless)\b/,datatype:{pattern:/\b(?:Any|Array|Boolean|Callable|Catalogentry|Class|Collection|Data|Default|Enum|Float|Hash|Integer|NotUndef|Numeric|Optional|Pattern|Regexp|Resource|Runtime|Scalar|String|Struct|Tuple|Type|Undef|Variant)\b/,alias:"symbol"},operator:/=[=~>]?|![=~]?|<(?:<\|?|[=~|-])?|>[>=]?|->?|~>|\|>?>?|[*\/%+?]|\b(?:and|in|or)\b/,punctuation:/[\[\]{}().,;]|:+/},n=[{pattern:/(^|[^\\])\$\{(?:[^'"{}]|\{[^}]*\}|(["'])(?:(?!\2)[^\\]|\\[\s\S])*\2)+\}/,lookbehind:!0,inside:{"short-variable":{pattern:/(^\$\{)(?!\w+\()(?:::)?\w+(?:::\w+)*/,lookbehind:!0,alias:"variable",inside:{punctuation:/::/}},delimiter:{pattern:/^\$/,alias:"variable"},rest:t.languages.puppet}},{pattern:/(^|[^\\])\$(?:::)?\w+(?:::\w+)*/,lookbehind:!0,alias:"variable",inside:{punctuation:/::/}}],t.languages.puppet.heredoc[0].inside.interpolation=n,t.languages.puppet.string.inside["double-quoted"].inside.interpolation=n}e.exports=t,t.displayName="puppet",t.aliases=[]},88393(e){"use strict";function t(e){var t,n,r;(t=e).languages.pure={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?\*\//,lookbehind:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0},/#!.+/],"inline-lang":{pattern:/%<[\s\S]+?%>/,greedy:!0,inside:{lang:{pattern:/(^%< *)-\*-.+?-\*-/,lookbehind:!0,alias:"comment"},delimiter:{pattern:/^%<.*|%>$/,alias:"punctuation"}}},string:{pattern:/"(?:\\.|[^"\\\r\n])*"/,greedy:!0},number:{pattern:/((?:\.\.)?)(?:\b(?:inf|nan)\b|\b0x[\da-f]+|(?:\b(?:0b)?\d+(?:\.\d+)?|\B\.\d+)(?:e[+-]?\d+)?L?)/i,lookbehind:!0},keyword:/\b(?:ans|break|bt|case|catch|cd|clear|const|def|del|dump|else|end|exit|extern|false|force|help|if|infix[lr]?|interface|let|ls|mem|namespace|nonfix|NULL|of|otherwise|outfix|override|postfix|prefix|private|public|pwd|quit|run|save|show|stats|then|throw|trace|true|type|underride|using|when|with)\b/,function:/\b(?:abs|add_(?:(?:fundef|interface|macdef|typedef)(?:_at)?|addr|constdef|vardef)|all|any|applp?|arity|bigintp?|blob(?:_crc|_size|p)?|boolp?|byte_(?:matrix|pointer)|byte_c?string(?:_pointer)?|calloc|cat|catmap|ceil|char[ps]?|check_ptrtag|chr|clear_sentry|clearsym|closurep?|cmatrixp?|cols?|colcat(?:map)?|colmap|colrev|colvector(?:p|seq)?|complex(?:_float_(?:matrix|pointer)|_matrix(?:_view)?|_pointer|p)?|conj|cookedp?|cst|cstring(?:_(?:dup|list|vector))?|curry3?|cyclen?|del_(?:constdef|fundef|interface|macdef|typedef|vardef)|delete|diag(?:mat)?|dim|dmatrixp?|do|double(?:_matrix(?:_view)?|_pointer|p)?|dowith3?|drop|dropwhile|eval(?:cmd)?|exactp|filter|fix|fixity|flip|float(?:_matrix|_pointer)|floor|fold[lr]1?|frac|free|funp?|functionp?|gcd|get(?:_(?:byte|constdef|double|float|fundef|int(?:64)?|interface(?:_typedef)?|long|macdef|pointer|ptrtag|short|sentry|string|typedef|vardef))?|globsym|hash|head|id|im|imatrixp?|index|inexactp|infp|init|insert|int(?:_matrix(?:_view)?|_pointer|p)?|int64_(?:matrix|pointer)|integerp?|iteraten?|iterwhile|join|keys?|lambdap?|last(?:err(?:pos)?)?|lcd|list[2p]?|listmap|make_ptrtag|malloc|map|matcat|matrixp?|max|member|min|nanp|nargs|nmatrixp?|null|numberp?|ord|pack(?:ed)?|pointer(?:_cast|_tag|_type|p)?|pow|pred|ptrtag|put(?:_(?:byte|double|float|int(?:64)?|long|pointer|short|string))?|rationalp?|re|realp?|realloc|recordp?|redim|reduce(?:_with)?|refp?|repeatn?|reverse|rlistp?|round|rows?|rowcat(?:map)?|rowmap|rowrev|rowvector(?:p|seq)?|same|scan[lr]1?|sentry|sgn|short_(?:matrix|pointer)|slice|smatrixp?|sort|split|str|strcat|stream|stride|string(?:_(?:dup|list|vector)|p)?|subdiag(?:mat)?|submat|subseq2?|substr|succ|supdiag(?:mat)?|symbolp?|tail|take|takewhile|thunkp?|transpose|trunc|tuplep?|typep|ubyte|uint(?:64)?|ulong|uncurry3?|unref|unzip3?|update|ushort|vals?|varp?|vector(?:p|seq)?|void|zip3?|zipwith3?)\b/,special:{pattern:/\b__[a-z]+__\b/i,alias:"builtin"},operator:/(?:[!"#$%&'*+,\-.\/:<=>?@\\^`|~\u00a1-\u00bf\u00d7-\u00f7\u20d0-\u2bff]|\b_+\b)+|\b(?:and|div|mod|not|or)\b/,punctuation:/[(){}\[\];,|]/},r=/%< *-\*- *\d* *-\*-[\s\S]+?%>/.source,(n=["c",{lang:"c++",alias:"cpp"},"fortran"]).forEach(function(e){var n=e;if("string"!=typeof e&&(n=e.alias,e=e.lang),t.languages[n]){var i={};i["inline-lang-"+n]={pattern:RegExp(r.replace("",e.replace(/([.+*?\/\\(){}\[\]])/g,"\\$1")),"i"),inside:t.util.clone(t.languages.pure["inline-lang"].inside)},i["inline-lang-"+n].inside.rest=t.util.clone(t.languages[n]),t.languages.insertBefore("pure","inline-lang",i)}}),t.languages.c&&(t.languages.pure["inline-lang"].inside.rest=t.util.clone(t.languages.c))}e.exports=t,t.displayName="pure",t.aliases=[]},78404(e){"use strict";function t(e){e.languages.purebasic=e.languages.extend("clike",{comment:/;.*/,keyword:/\b(?:declarecdll|declaredll|compilerselect|compilercase|compilerdefault|compilerendselect|compilererror|enableexplicit|disableexplicit|not|and|or|xor|calldebugger|debuglevel|enabledebugger|disabledebugger|restore|read|includepath|includebinary|threaded|runtime|with|endwith|structureunion|endstructureunion|align|newlist|newmap|interface|endinterface|extends|enumeration|endenumeration|swap|foreach|continue|fakereturn|goto|gosub|return|break|module|endmodule|declaremodule|enddeclaremodule|declare|declarec|prototype|prototypec|enableasm|disableasm|dim|redim|data|datasection|enddatasection|to|procedurereturn|debug|default|case|select|endselect|as|import|endimport|importc|compilerif|compilerelse|compilerendif|compilerelseif|end|structure|endstructure|while|wend|for|next|step|if|else|elseif|endif|repeat|until|procedure|proceduredll|procedurec|procedurecdll|endprocedure|protected|shared|static|global|define|includefile|xincludefile|macro|endmacro)\b/i,function:/\b\w+(?:\.\w+)?\s*(?=\()/,number:/(?:\$[\da-f]+|\b-?(?:\d+(?:\.\d+)?|\.\d+)(?:e[+-]?\d+)?)\b/i,operator:/(?:@\*?|\?|\*)\w+|-[>-]?|\+\+?|!=?|<>?=?|==?|&&?|\|?\||[~^%?*/@]/}),e.languages.insertBefore("purebasic","keyword",{tag:/#\w+/,asm:{pattern:/(^[\t ]*)!.*/m,lookbehind:!0,alias:"tag",inside:{comment:/;.*/,string:{pattern:/(["'`])(?:\\.|(?!\1)[^\\\r\n])*\1/,greedy:!0},"label-reference-anonymous":{pattern:/(!\s*j[a-z]+\s+)@[fb]/i,lookbehind:!0,alias:"fasm-label"},"label-reference-addressed":{pattern:/(!\s*j[a-z]+\s+)[A-Z._?$@][\w.?$@~#]*/i,lookbehind:!0,alias:"fasm-label"},function:{pattern:/^([\t ]*!\s*)[\da-z]+(?=\s|$)/im,lookbehind:!0},"function-inline":{pattern:/(:\s*)[\da-z]+(?=\s)/i,lookbehind:!0,alias:"function"},label:{pattern:/^([\t ]*!\s*)[A-Za-z._?$@][\w.?$@~#]*(?=:)/m,lookbehind:!0,alias:"fasm-label"},keyword:[/\b(?:extern|global)\b[^;\r\n]*/i,/\b(?:CPU|FLOAT|DEFAULT)\b.*/],register:/\b(?:st\d|[xyz]mm\d\d?|[cdt]r\d|r\d\d?[bwd]?|[er]?[abcd]x|[abcd][hl]|[er]?(?:bp|sp|si|di)|[cdefgs]s|mm\d+)\b/i,number:/(?:\b|-|(?=\$))(?:0[hx](?:[\da-f]*\.)?[\da-f]+(?:p[+-]?\d+)?|\d[\da-f]+[hx]|\$\d[\da-f]*|0[oq][0-7]+|[0-7]+[oq]|0[by][01]+|[01]+[by]|0[dt]\d+|(?:\d+(?:\.\d+)?|\.\d+)(?:\.?e[+-]?\d+)?[dt]?)\b/i,operator:/[\[\]*+\-/%<>=&|$!,.:]/}}}),delete e.languages.purebasic["class-name"],delete e.languages.purebasic.boolean,e.languages.pbfasm=e.languages.purebasic}e.exports=t,t.displayName="purebasic",t.aliases=[]},92923(e,t,n){"use strict";var r=n(58090);function i(e){e.register(r),e.languages.purescript=e.languages.extend("haskell",{keyword:/\b(?:ado|case|class|data|derive|do|else|forall|if|in|infixl|infixr|instance|let|module|newtype|of|primitive|then|type|where)\b/,"import-statement":{pattern:/(^[\t ]*)import\s+[A-Z][\w']*(?:\.[A-Z][\w']*)*(?:\s+as\s+[A-Z][\w']*(?:\.[A-Z][\w']*)*)?(?:\s+hiding\b)?/m,lookbehind:!0,inside:{keyword:/\b(?:import|as|hiding)\b/}},builtin:/\b(?:absurd|add|ap|append|apply|between|bind|bottom|clamp|compare|comparing|compose|conj|const|degree|discard|disj|div|eq|flap|flip|gcd|identity|ifM|join|lcm|liftA1|liftM1|map|max|mempty|min|mod|mul|negate|not|notEq|one|otherwise|recip|show|sub|top|unit|unless|unlessM|void|when|whenM|zero)\b/}),e.languages.purs=e.languages.purescript}e.exports=i,i.displayName="purescript",i.aliases=["purs"]},52992(e){"use strict";function t(e){e.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0},"string-interpolation":{pattern:/(?:f|rf|fr)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|rb|br)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|rb|br)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/im,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:and|as|assert|async|await|break|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:True|False|None)\b/,number:/(?:\b(?=\d)|\B(?=\.))(?:0[bo])?(?:(?:\d|0x[\da-f])[\da-f]*(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?j?\b/i,operator:/[-+%=]=?|!=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},e.languages.python["string-interpolation"].inside.interpolation.inside.rest=e.languages.python,e.languages.py=e.languages.python}e.exports=t,t.displayName="python",t.aliases=["py"]},55762(e){"use strict";function t(e){e.languages.q={string:/"(?:\\.|[^"\\\r\n])*"/,comment:[{pattern:/([\t )\]}])\/.*/,lookbehind:!0,greedy:!0},{pattern:/(^|\r?\n|\r)\/[\t ]*(?:(?:\r?\n|\r)(?:.*(?:\r?\n|\r(?!\n)))*?(?:\\(?=[\t ]*(?:\r?\n|\r))|$)|\S.*)/,lookbehind:!0,greedy:!0},{pattern:/^\\[\t ]*(?:\r?\n|\r)[\s\S]+/m,greedy:!0},{pattern:/^#!.+/m,greedy:!0}],symbol:/`(?::\S+|[\w.]*)/,datetime:{pattern:/0N[mdzuvt]|0W[dtz]|\d{4}\.\d\d(?:m|\.\d\d(?:T(?:\d\d(?::\d\d(?::\d\d(?:[.:]\d\d\d)?)?)?)?)?[dz]?)|\d\d:\d\d(?::\d\d(?:[.:]\d\d\d)?)?[uvt]?/,alias:"number"},number:/\b(?![01]:)(?:0[wn]|0W[hj]?|0N[hje]?|0x[\da-fA-F]+|\d+(?:\.\d*)?(?:e[+-]?\d+)?[hjfeb]?)/,keyword:/\\\w+\b|\b(?:abs|acos|aj0?|all|and|any|asc|asin|asof|atan|attr|avgs?|binr?|by|ceiling|cols|cor|cos|count|cov|cross|csv|cut|delete|deltas|desc|dev|differ|distinct|div|do|dsave|ej|enlist|eval|except|exec|exit|exp|fby|fills|first|fkeys|flip|floor|from|get|getenv|group|gtime|hclose|hcount|hdel|hopen|hsym|iasc|identity|idesc|if|ij|in|insert|inter|inv|keys?|last|like|list|ljf?|load|log|lower|lsq|ltime|ltrim|mavg|maxs?|mcount|md5|mdev|med|meta|mins?|mmax|mmin|mmu|mod|msum|neg|next|not|null|or|over|parse|peach|pj|plist|prds?|prev|prior|rand|rank|ratios|raze|read0|read1|reciprocal|reval|reverse|rload|rotate|rsave|rtrim|save|scan|scov|sdev|select|set|setenv|show|signum|sin|sqrt|ssr?|string|sublist|sums?|sv|svar|system|tables|tan|til|trim|txf|type|uj|ungroup|union|update|upper|upsert|value|var|views?|vs|wavg|where|while|within|wj1?|wsum|ww|xasc|xbar|xcols?|xdesc|xexp|xgroup|xkey|xlog|xprev|xrank)\b/,adverb:{pattern:/['\/\\]:?|\beach\b/,alias:"function"},verb:{pattern:/(?:\B\.\B|\b[01]:|<[=>]?|>=?|[:+\-*%,!?~=|$&#@^]):?|\b_\b:?/,alias:"operator"},punctuation:/[(){}\[\];.]/}}e.exports=t,t.displayName="q",t.aliases=[]},4137(e){"use strict";function t(e){!function(e){for(var t=/"(?:\\.|[^\\"\r\n])*"|'(?:\\.|[^\\'\r\n])*'/.source,n=/\/\/.*(?!.)|\/\*(?:[^*]|\*(?!\/))*\*\//.source,r=/(?:[^\\()[\]{}"'/]||\/(?![*/])||\(*\)|\[*\]|\{*\}|\\[\s\S])/.source.replace(//g,function(){return t}).replace(//g,function(){return n}),i=0;i<2;i++)r=r.replace(//g,function(){return r});r=r.replace(//g,"[^\\s\\S]"),e.languages.qml={comment:{pattern:/\/\/.*|\/\*[\s\S]*?\*\//,greedy:!0},"javascript-function":{pattern:RegExp(/((?:^|;)[ \t]*)function\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*\(*\)\s*\{*\}/.source.replace(//g,function(){return r}),"m"),lookbehind:!0,greedy:!0,alias:"language-javascript",inside:e.languages.javascript},"class-name":{pattern:/((?:^|[:;])[ \t]*)(?!\d)\w+(?=[ \t]*\{|[ \t]+on\b)/m,lookbehind:!0},property:[{pattern:/((?:^|[;{])[ \t]*)(?!\d)\w+(?:\.\w+)*(?=[ \t]*:)/m,lookbehind:!0},{pattern:/((?:^|[;{])[ \t]*)property[ \t]+(?!\d)\w+(?:\.\w+)*[ \t]+(?!\d)\w+(?:\.\w+)*(?=[ \t]*:)/m,lookbehind:!0,inside:{keyword:/^property/,property:/\w+(?:\.\w+)*/}}],"javascript-expression":{pattern:RegExp(/(:[ \t]*)(?![\s;}[])(?:(?!$|[;}]))+/.source.replace(//g,function(){return r}),"m"),lookbehind:!0,greedy:!0,alias:"language-javascript",inside:e.languages.javascript},string:/"(?:\\.|[^\\"\r\n])*"/,keyword:/\b(?:as|import|on)\b/,punctuation:/[{}[\]:;,]/}}(e)}e.exports=t,t.displayName="qml",t.aliases=[]},28260(e){"use strict";function t(e){e.languages.qore=e.languages.extend("clike",{comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:\/\/|#).*)/,lookbehind:!0},string:{pattern:/("|')(?:\\[\s\S]|(?!\1)[^\\])*\1/,greedy:!0},keyword:/\b(?:abstract|any|assert|binary|bool|boolean|break|byte|case|catch|char|class|code|const|continue|data|default|do|double|else|enum|extends|final|finally|float|for|goto|hash|if|implements|import|inherits|instanceof|int|interface|long|my|native|new|nothing|null|object|our|own|private|reference|rethrow|return|short|soft(?:int|float|number|bool|string|date|list)|static|strictfp|string|sub|super|switch|synchronized|this|throw|throws|transient|try|void|volatile|while)\b/,boolean:/\b(?:true|false)\b/i,function:/\$?\b(?!\d)\w+(?=\()/,number:/\b(?:0b[01]+|0x(?:[\da-f]*\.)?[\da-fp\-]+|(?:\d+(?:\.\d+)?|\.\d+)(?:e\d+)?[df]|(?:\d+(?:\.\d+)?|\.\d+))\b/i,operator:{pattern:/(^|[^.])(?:\+[+=]?|-[-=]?|[!=](?:==?|~)?|>>?=?|<(?:=>?|<=?)?|&[&=]?|\|[|=]?|[*\/%^]=?|[~?])/,lookbehind:!0},variable:/\$(?!\d)\w+\b/})}e.exports=t,t.displayName="qore",t.aliases=[]},71360(e){"use strict";function t(e){!function(e){function t(e,t){return e.replace(/<<(\d+)>>/g,function(e,n){return"(?:"+t[+n]+")"})}function n(e,n,r){return RegExp(t(e,n),r||"")}function r(e,t){for(var n=0;n>/g,function(){return"(?:"+e+")"});return e.replace(/<>/g,"[^\\s\\S]")}var i={type:"Adj BigInt Bool Ctl Double false Int One Pauli PauliI PauliX PauliY PauliZ Qubit Range Result String true Unit Zero",other:"Adjoint adjoint apply as auto body borrow borrowing Controlled controlled distribute elif else fail fixup for function if in internal intrinsic invert is let mutable namespace new newtype open operation repeat return self set until use using while within"};function a(e){return"\\b(?:"+e.trim().replace(/ /g,"|")+")\\b"}var o=RegExp(a(i.type+" "+i.other)),s=/\b[A-Za-z_]\w*\b/.source,u=t(/<<0>>(?:\s*\.\s*<<0>>)*/.source,[s]),c={keyword:o,punctuation:/[<>()?,.:[\]]/},l=/"(?:\\.|[^\\"])*"/.source;e.languages.qsharp=e.languages.extend("clike",{comment:/\/\/.*/,string:[{pattern:n(/(^|[^$\\])<<0>>/.source,[l]),lookbehind:!0,greedy:!0}],"class-name":[{pattern:n(/(\b(?:as|open)\s+)<<0>>(?=\s*(?:;|as\b))/.source,[u]),lookbehind:!0,inside:c},{pattern:n(/(\bnamespace\s+)<<0>>(?=\s*\{)/.source,[u]),lookbehind:!0,inside:c}],keyword:o,number:/(?:\b0(?:x[\da-f]+|b[01]+|o[0-7]+)|(?:\B\.\d+|\b\d+(?:\.\d*)?)(?:e[-+]?\d+)?)l?\b/i,operator:/\band=|\bor=|\band\b|\bor\b|\bnot\b|<[-=]|[-=]>|>>>=?|<<<=?|\^\^\^=?|\|\|\|=?|&&&=?|w\/=?|~~~|[*\/+\-^=!%]=?/,punctuation:/::|[{}[\];(),.:]/}),e.languages.insertBefore("qsharp","number",{range:{pattern:/\.\./,alias:"operator"}});var f=r(t(/\{(?:[^"{}]|<<0>>|<>)*\}/.source,[l]),2);e.languages.insertBefore("qsharp","string",{"interpolation-string":{pattern:n(/\$"(?:\\.|<<0>>|[^\\"{])*"/.source,[f]),greedy:!0,inside:{interpolation:{pattern:n(/((?:^|[^\\])(?:\\\\)*)<<0>>/.source,[f]),lookbehind:!0,inside:{punctuation:/^\{|\}$/,expression:{pattern:/[\s\S]+/,alias:"language-qsharp",inside:e.languages.qsharp}}},string:/[\s\S]+/}}})}(e),e.languages.qs=e.languages.qsharp}e.exports=t,t.displayName="qsharp",t.aliases=["qs"]},29308(e){"use strict";function t(e){e.languages.r={comment:/#.*/,string:{pattern:/(['"])(?:\\.|(?!\1)[^\\\r\n])*\1/,greedy:!0},"percent-operator":{pattern:/%[^%\s]*%/,alias:"operator"},boolean:/\b(?:TRUE|FALSE)\b/,ellipsis:/\.\.(?:\.|\d+)/,number:[/\b(?:NaN|Inf)\b/,/(?:\b0x[\dA-Fa-f]+(?:\.\d*)?|\b\d+(?:\.\d*)?|\B\.\d+)(?:[EePp][+-]?\d+)?[iL]?/],keyword:/\b(?:if|else|repeat|while|function|for|in|next|break|NULL|NA|NA_integer_|NA_real_|NA_complex_|NA_character_)\b/,operator:/->?>?|<(?:=|=!]=?|::?|&&?|\|\|?|[+*\/^$@~]/,punctuation:/[(){}\[\],;]/}}e.exports=t,t.displayName="r",t.aliases=[]},32168(e,t,n){"use strict";var r=n(9997);function i(e){e.register(r),e.languages.racket=e.languages.extend("scheme",{"lambda-parameter":{pattern:/([(\[]lambda\s+[(\[])[^()\[\]'\s]+/,lookbehind:!0}}),e.languages.insertBefore("racket","string",{lang:{pattern:/^#lang.+/m,greedy:!0,alias:"keyword"}}),e.languages.rkt=e.languages.racket}e.exports=i,i.displayName="racket",i.aliases=["rkt"]},5755(e){"use strict";function t(e){e.languages.reason=e.languages.extend("clike",{string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^\\\r\n"])*"/,greedy:!0},"class-name":/\b[A-Z]\w*/,keyword:/\b(?:and|as|assert|begin|class|constraint|do|done|downto|else|end|exception|external|for|fun|function|functor|if|in|include|inherit|initializer|lazy|let|method|module|mutable|new|nonrec|object|of|open|or|private|rec|sig|struct|switch|then|to|try|type|val|virtual|when|while|with)\b/,operator:/\.{3}|:[:=]|\|>|->|=(?:==?|>)?|<=?|>=?|[|^?'#!~`]|[+\-*\/]\.?|\b(?:mod|land|lor|lxor|lsl|lsr|asr)\b/}),e.languages.insertBefore("reason","class-name",{character:{pattern:/'(?:\\x[\da-f]{2}|\\o[0-3][0-7][0-7]|\\\d{3}|\\.|[^'\\\r\n])'/,alias:"string"},constructor:{pattern:/\b[A-Z]\w*\b(?!\s*\.)/,alias:"variable"},label:{pattern:/\b[a-z]\w*(?=::)/,alias:"symbol"}}),delete e.languages.reason.function}e.exports=t,t.displayName="reason",t.aliases=[]},54105(e){"use strict";function t(e){var t,n,r,i,a,o,s,u;t=e,n={pattern:/\\[\\(){}[\]^$+*?|.]/,alias:"escape"},i={pattern:/\.|\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},a={pattern:/\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},s=RegExp((o="(?:[^\\\\-]|"+(r=/\\(?:x[\da-fA-F]{2}|u[\da-fA-F]{4}|u\{[\da-fA-F]+\}|c[a-zA-Z]|0[0-7]{0,2}|[123][0-7]{2}|.)/).source+")")+"-"+o),u={pattern:/(<|')[^<>']+(?=[>']$)/,lookbehind:!0,alias:"variable"},t.languages.regex={charset:{pattern:/((?:^|[^\\])(?:\\\\)*)\[(?:[^\\\]]|\\[\s\S])*\]/,lookbehind:!0,inside:{"charset-negation":{pattern:/(^\[)\^/,lookbehind:!0,alias:"operator"},"charset-punctuation":{pattern:/^\[|\]$/,alias:"punctuation"},range:{pattern:s,inside:{escape:r,"range-punctuation":{pattern:/-/,alias:"operator"}}},"special-escape":n,charclass:a,escape:r}},"special-escape":n,charclass:i,backreference:[{pattern:/\\(?![123][0-7]{2})[1-9]/,alias:"keyword"},{pattern:/\\k<[^<>']+>/,alias:"keyword",inside:{"group-name":u}}],anchor:{pattern:/[$^]|\\[ABbGZz]/,alias:"function"},escape:r,group:[{pattern:/\((?:\?(?:<[^<>']+>|'[^<>']+'|[>:]|:=]=?|!=|\b_\b/,punctuation:/[,;.\[\]{}()]/}}e.exports=t,t.displayName="rego",t.aliases=[]},35108(e){"use strict";function t(e){e.languages.renpy={comment:{pattern:/(^|[^\\])#.+/,lookbehind:!0},string:{pattern:/("""|''')[\s\S]+?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2|(?:^#?(?:[0-9a-fA-F]{6}|(?:[0-9a-fA-F]){3})$)/m,greedy:!0},function:/\b[a-z_]\w*(?=\()/i,property:/\b(?:insensitive|idle|hover|selected_idle|selected_hover|background|position|alt|xpos|ypos|pos|xanchor|yanchor|anchor|xalign|yalign|align|xcenter|ycenter|xofsset|yoffset|ymaximum|maximum|xmaximum|xminimum|yminimum|minimum|xsize|ysizexysize|xfill|yfill|area|antialias|black_color|bold|caret|color|first_indent|font|size|italic|justify|kerning|language|layout|line_leading|line_overlap_split|line_spacing|min_width|newline_indent|outlines|rest_indent|ruby_style|slow_cps|slow_cps_multiplier|strikethrough|text_align|underline|hyperlink_functions|vertical|hinting|foreground|left_margin|xmargin|top_margin|bottom_margin|ymargin|left_padding|right_padding|xpadding|top_padding|bottom_padding|ypadding|size_group|child|hover_sound|activate_sound|mouse|focus_mask|keyboard_focus|bar_vertical|bar_invert|bar_resizing|left_gutter|right_gutter|top_gutter|bottom_gutter|left_bar|right_bar|top_bar|bottom_bar|thumb|thumb_shadow|thumb_offset|unscrollable|spacing|first_spacing|box_reverse|box_wrap|order_reverse|fit_first|ysize|thumbnail_width|thumbnail_height|help|text_ypos|text_xpos|idle_color|hover_color|selected_idle_color|selected_hover_color|insensitive_color|alpha|insensitive_background|hover_background|zorder|value|width|xadjustment|xanchoraround|xaround|xinitial|xoffset|xzoom|yadjustment|yanchoraround|yaround|yinitial|yzoom|zoom|ground|height|text_style|text_y_fudge|selected_insensitive|has_sound|has_music|has_voice|focus|hovered|image_style|length|minwidth|mousewheel|offset|prefix|radius|range|right_margin|rotate|rotate_pad|developer|screen_width|screen_height|window_title|name|version|windows_icon|default_fullscreen|default_text_cps|default_afm_time|main_menu_music|sample_sound|enter_sound|exit_sound|save_directory|enter_transition|exit_transition|intra_transition|main_game_transition|game_main_transition|end_splash_transition|end_game_transition|after_load_transition|window_show_transition|window_hide_transition|adv_nvl_transition|nvl_adv_transition|enter_yesno_transition|exit_yesno_transition|enter_replay_transition|exit_replay_transition|say_attribute_transition|directory_name|executable_name|include_update|window_icon|modal|google_play_key|google_play_salt|drag_name|drag_handle|draggable|dragged|droppable|dropped|narrator_menu|action|default_afm_enable|version_name|version_tuple|inside|fadeout|fadein|layers|layer_clipping|linear|scrollbars|side_xpos|side_ypos|side_spacing|edgescroll|drag_joined|drag_raise|drop_shadow|drop_shadow_color|subpixel|easein|easeout|time|crop|auto|update|get_installed_packages|can_update|UpdateVersion|Update|overlay_functions|translations|window_left_padding|show_side_image|show_two_window)\b/,tag:/\b(?:label|image|menu|[hv]box|frame|text|imagemap|imagebutton|bar|vbar|screen|textbutton|buttoscreenn|fixed|grid|input|key|mousearea|side|timer|viewport|window|hotspot|hotbar|self|button|drag|draggroup|tag|mm_menu_frame|nvl|block|parallel)\b|\$/,keyword:/\b(?:as|assert|break|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|pass|print|raise|return|try|while|yield|adjustment|alignaround|allow|angle|around|box_layout|cache|changed|child_size|clicked|clipping|corner1|corner2|default|delay|exclude|scope|slow|slow_abortable|slow_done|sound|style_group|substitute|suffix|transform_anchor|transpose|unhovered|config|theme|mm_root|gm_root|rounded_window|build|disabled_text|disabled|widget_selected|widget_text|widget_hover|widget|updater|behind|call|expression|hide|init|jump|onlayer|python|renpy|scene|set|show|transform|play|queue|stop|pause|define|window|repeat|contains|choice|on|function|event|animation|clockwise|counterclockwise|circles|knot|null|None|random|has|add|use|fade|dissolve|style|store|id|voice|center|left|right|less_rounded|music|movie|clear|persistent|ui)\b/,boolean:/\b(?:[Tt]rue|[Ff]alse)\b/,number:/(?:\b(?:0[bo])?(?:(?:\d|0x[\da-f])[\da-f]*(?:\.\d*)?)|\B\.\d+)(?:e[+-]?\d+)?j?/i,operator:/[-+%=]=?|!=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]|\b(?:or|and|not|with|at)\b/,punctuation:/[{}[\];(),.:]/},e.languages.rpy=e.languages.renpy}e.exports=t,t.displayName="renpy",t.aliases=["rpy"]},46678(e){"use strict";function t(e){e.languages.rest={table:[{pattern:/(^[\t ]*)(?:\+[=-]+)+\+(?:\r?\n|\r)(?:\1[+|].+[+|](?:\r?\n|\r))+\1(?:\+[=-]+)+\+/m,lookbehind:!0,inside:{punctuation:/\||(?:\+[=-]+)+\+/}},{pattern:/(^[\t ]*)=+ [ =]*=(?:(?:\r?\n|\r)\1.+)+(?:\r?\n|\r)\1=+ [ =]*=(?=(?:\r?\n|\r){2}|\s*$)/m,lookbehind:!0,inside:{punctuation:/[=-]+/}}],"substitution-def":{pattern:/(^[\t ]*\.\. )\|(?:[^|\s](?:[^|]*[^|\s])?)\| [^:]+::/m,lookbehind:!0,inside:{substitution:{pattern:/^\|(?:[^|\s]|[^|\s][^|]*[^|\s])\|/,alias:"attr-value",inside:{punctuation:/^\||\|$/}},directive:{pattern:/( )(?! )[^:]+::/,lookbehind:!0,alias:"function",inside:{punctuation:/::$/}}}},"link-target":[{pattern:/(^[\t ]*\.\. )\[[^\]]+\]/m,lookbehind:!0,alias:"string",inside:{punctuation:/^\[|\]$/}},{pattern:/(^[\t ]*\.\. )_(?:`[^`]+`|(?:[^:\\]|\\.)+):/m,lookbehind:!0,alias:"string",inside:{punctuation:/^_|:$/}}],directive:{pattern:/(^[\t ]*\.\. )[^:]+::/m,lookbehind:!0,alias:"function",inside:{punctuation:/::$/}},comment:{pattern:/(^[\t ]*\.\.)(?:(?: .+)?(?:(?:\r?\n|\r).+)+| .+)(?=(?:\r?\n|\r){2}|$)/m,lookbehind:!0},title:[{pattern:/^(([!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~])\2+)(?:\r?\n|\r).+(?:\r?\n|\r)\1$/m,inside:{punctuation:/^[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~]+|[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~]+$/,important:/.+/}},{pattern:/(^|(?:\r?\n|\r){2}).+(?:\r?\n|\r)([!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~])\2+(?=\r?\n|\r|$)/,lookbehind:!0,inside:{punctuation:/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~]+$/,important:/.+/}}],hr:{pattern:/((?:\r?\n|\r){2})([!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~])\2{3,}(?=(?:\r?\n|\r){2})/,lookbehind:!0,alias:"punctuation"},field:{pattern:/(^[\t ]*):[^:\r\n]+:(?= )/m,lookbehind:!0,alias:"attr-name"},"command-line-option":{pattern:/(^[\t ]*)(?:[+-][a-z\d]|(?:--|\/)[a-z\d-]+)(?:[ =](?:[a-z][\w-]*|<[^<>]+>))?(?:, (?:[+-][a-z\d]|(?:--|\/)[a-z\d-]+)(?:[ =](?:[a-z][\w-]*|<[^<>]+>))?)*(?=(?:\r?\n|\r)? {2,}\S)/im,lookbehind:!0,alias:"symbol"},"literal-block":{pattern:/::(?:\r?\n|\r){2}([ \t]+)(?![ \t]).+(?:(?:\r?\n|\r)\1.+)*/,inside:{"literal-block-punctuation":{pattern:/^::/,alias:"punctuation"}}},"quoted-literal-block":{pattern:/::(?:\r?\n|\r){2}([!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~]).*(?:(?:\r?\n|\r)\1.*)*/,inside:{"literal-block-punctuation":{pattern:/^(?:::|([!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~])\1*)/m,alias:"punctuation"}}},"list-bullet":{pattern:/(^[\t ]*)(?:[*+\-•‣⁃]|\(?(?:\d+|[a-z]|[ivxdclm]+)\)|(?:\d+|[a-z]|[ivxdclm]+)\.)(?= )/im,lookbehind:!0,alias:"punctuation"},"doctest-block":{pattern:/(^[\t ]*)>>> .+(?:(?:\r?\n|\r).+)*/m,lookbehind:!0,inside:{punctuation:/^>>>/}},inline:[{pattern:/(^|[\s\-:\/'"<(\[{])(?::[^:]+:`.*?`|`.*?`:[^:]+:|(\*\*?|``?|\|)(?!\s)(?:(?!\2).)*\S\2(?=[\s\-.,:;!?\\\/'")\]}]|$))/m,lookbehind:!0,inside:{bold:{pattern:/(^\*\*).+(?=\*\*$)/,lookbehind:!0},italic:{pattern:/(^\*).+(?=\*$)/,lookbehind:!0},"inline-literal":{pattern:/(^``).+(?=``$)/,lookbehind:!0,alias:"symbol"},role:{pattern:/^:[^:]+:|:[^:]+:$/,alias:"function",inside:{punctuation:/^:|:$/}},"interpreted-text":{pattern:/(^`).+(?=`$)/,lookbehind:!0,alias:"attr-value"},substitution:{pattern:/(^\|).+(?=\|$)/,lookbehind:!0,alias:"attr-value"},punctuation:/\*\*?|``?|\|/}}],link:[{pattern:/\[[^\[\]]+\]_(?=[\s\-.,:;!?\\\/'")\]}]|$)/,alias:"string",inside:{punctuation:/^\[|\]_$/}},{pattern:/(?:\b[a-z\d]+(?:[_.:+][a-z\d]+)*_?_|`[^`]+`_?_|_`[^`]+`)(?=[\s\-.,:;!?\\\/'")\]}]|$)/i,alias:"string",inside:{punctuation:/^_?`|`$|`?_?_$/}}],punctuation:{pattern:/(^[\t ]*)(?:\|(?= |$)|(?:---?|—|\.\.|__)(?= )|\.\.$)/m,lookbehind:!0}}}e.exports=t,t.displayName="rest",t.aliases=[]},47496(e){"use strict";function t(e){e.languages.rip={comment:/#.*/,keyword:/(?:=>|->)|\b(?:class|if|else|switch|case|return|exit|try|catch|finally|raise)\b/,builtin:/@|\bSystem\b/,boolean:/\b(?:true|false)\b/,date:/\b\d{4}-\d{2}-\d{2}\b/,time:/\b\d{2}:\d{2}:\d{2}\b/,datetime:/\b\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\b/,character:/\B`[^\s`'",.:;#\/\\()<>\[\]{}]\b/,regex:{pattern:/(^|[^/])\/(?!\/)(?:\[[^\n\r\]]*\]|\\.|[^/\\\r\n\[])+\/(?=\s*(?:$|[\r\n,.;})]))/,lookbehind:!0,greedy:!0},symbol:/:[^\d\s`'",.:;#\/\\()<>\[\]{}][^\s`'",.:;#\/\\()<>\[\]{}]*/,string:{pattern:/("|')(?:\\.|(?!\1)[^\\\r\n])*\1/,greedy:!0},number:/[+-]?\b(?:\d+\.\d+|\d+)\b/,punctuation:/(?:\.{2,3})|[`,.:;=\/\\()<>\[\]{}]/,reference:/[^\d\s`'",.:;#\/\\()<>\[\]{}][^\s`'",.:;#\/\\()<>\[\]{}]*/}}e.exports=t,t.displayName="rip",t.aliases=[]},30527(e){"use strict";function t(e){e.languages.roboconf={comment:/#.*/,keyword:{pattern:/(^|\s)(?:(?:facet|instance of)(?=[ \t]+[\w-]+[ \t]*\{)|(?:external|import)\b)/,lookbehind:!0},component:{pattern:/[\w-]+(?=[ \t]*\{)/,alias:"variable"},property:/[\w.-]+(?=[ \t]*:)/,value:{pattern:/(=[ \t]*(?![ \t]))[^,;]+/,lookbehind:!0,alias:"attr-value"},optional:{pattern:/\(optional\)/,alias:"builtin"},wildcard:{pattern:/(\.)\*/,lookbehind:!0,alias:"operator"},punctuation:/[{},.;:=]/}}e.exports=t,t.displayName="roboconf",t.aliases=[]},5261(e){"use strict";function t(e){!function(e){var t={pattern:/(^[ \t]*| {2}|\t)#.*/m,lookbehind:!0,greedy:!0},n={pattern:/((?:^|[^\\])(?:\\{2})*)[$@&%]\{(?:[^{}\r\n]|\{[^{}\r\n]*\})*\}/,lookbehind:!0,inside:{punctuation:/^[$@&%]\{|\}$/}};function r(e,r){var i={};for(var a in i["section-header"]={pattern:/^ ?\*{3}.+?\*{3}/,alias:"keyword"},r)i[a]=r[a];return i.tag={pattern:/([\r\n](?: {2}|\t)[ \t]*)\[[-\w]+\]/,lookbehind:!0,inside:{punctuation:/\[|\]/}},i.variable=n,i.comment=t,{pattern:RegExp(/^ ?\*{3}[ \t]*[ \t]*\*{3}(?:.|[\r\n](?!\*{3}))*/.source.replace(//g,function(){return e}),"im"),alias:"section",inside:i}}var i={pattern:/(\[Documentation\](?: {2}|\t)[ \t]*)(?![ \t]|#)(?:.|(?:\r\n?|\n)[ \t]*\.{3})+/,lookbehind:!0,alias:"string"},a={pattern:/([\r\n] ?)(?!#)(?:\S(?:[ \t]\S)*)+/,lookbehind:!0,alias:"function",inside:{variable:n}},o={pattern:/([\r\n](?: {2}|\t)[ \t]*)(?!\[|\.{3}|#)(?:\S(?:[ \t]\S)*)+/,lookbehind:!0,inside:{variable:n}};e.languages.robotframework={settings:r("Settings",{documentation:{pattern:/([\r\n] ?Documentation(?: {2}|\t)[ \t]*)(?![ \t]|#)(?:.|(?:\r\n?|\n)[ \t]*\.{3})+/,lookbehind:!0,alias:"string"},property:{pattern:/([\r\n] ?)(?!\.{3}|#)(?:\S(?:[ \t]\S)*)+/,lookbehind:!0}}),variables:r("Variables"),"test-cases":r("Test Cases",{"test-name":a,documentation:i,property:o}),keywords:r("Keywords",{"keyword-name":a,documentation:i,property:o}),tasks:r("Tasks",{"task-name":a,documentation:i,property:o}),comment:t},e.languages.robot=e.languages.robotframework}(e)}e.exports=t,t.displayName="robotframework",t.aliases=[]},56939(e){"use strict";function t(e){var t,n;(t=e).languages.ruby=t.languages.extend("clike",{comment:[/#.*/,{pattern:/^=begin\s[\s\S]*?^=end/m,greedy:!0}],"class-name":{pattern:/(\b(?:class)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:alias|and|BEGIN|begin|break|case|class|def|define_method|defined|do|each|else|elsif|END|end|ensure|extend|for|if|in|include|module|new|next|nil|not|or|prepend|protected|private|public|raise|redo|require|rescue|retry|return|self|super|then|throw|undef|unless|until|when|while|yield)\b/}),n={pattern:/#\{[^}]+\}/,inside:{delimiter:{pattern:/^#\{|\}$/,alias:"tag"},rest:t.languages.ruby}},delete t.languages.ruby.function,t.languages.insertBefore("ruby","keyword",{regex:[{pattern:RegExp(/%r/.source+"(?:"+[/([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,/\((?:[^()\\]|\\[\s\S])*\)/.source,/\{(?:[^#{}\\]|#(?:\{[^}]+\})?|\\[\s\S])*\}/.source,/\[(?:[^\[\]\\]|\\[\s\S])*\]/.source,/<(?:[^<>\\]|\\[\s\S])*>/.source].join("|")+")"+/[egimnosux]{0,6}/.source),greedy:!0,inside:{interpolation:n}},{pattern:/(^|[^/])\/(?!\/)(?:\[[^\r\n\]]+\]|\\.|[^[/\\\r\n])+\/[egimnosux]{0,6}(?=\s*(?:$|[\r\n,.;})#]))/,lookbehind:!0,greedy:!0,inside:{interpolation:n}}],variable:/[@$]+[a-zA-Z_]\w*(?:[?!]|\b)/,symbol:{pattern:/(^|[^:]):[a-zA-Z_]\w*(?:[?!]|\b)/,lookbehind:!0},"method-definition":{pattern:/(\bdef\s+)[\w.]+/,lookbehind:!0,inside:{function:/\w+$/,rest:t.languages.ruby}}}),t.languages.insertBefore("ruby","number",{builtin:/\b(?:Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Stat|Fixnum|Float|Hash|Integer|IO|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|String|Struct|TMS|Symbol|ThreadGroup|Thread|Time|TrueClass)\b/,constant:/\b[A-Z]\w*(?:[?!]|\b)/}),t.languages.ruby.string=[{pattern:RegExp(/%[qQiIwWxs]?/.source+"(?:"+[/([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,/\((?:[^()\\]|\\[\s\S])*\)/.source,/\{(?:[^#{}\\]|#(?:\{[^}]+\})?|\\[\s\S])*\}/.source,/\[(?:[^\[\]\\]|\\[\s\S])*\]/.source,/<(?:[^<>\\]|\\[\s\S])*>/.source].join("|")+")"),greedy:!0,inside:{interpolation:n}},{pattern:/("|')(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|(?!\1)[^\\#\r\n])*\1/,greedy:!0,inside:{interpolation:n}},{pattern:/<<[-~]?([a-z_]\w*)[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?[a-z_]\w*|[a-z_]\w*$/i,alias:"symbol",inside:{punctuation:/^<<[-~]?/}},interpolation:n}},{pattern:/<<[-~]?'([a-z_]\w*)'[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?'[a-z_]\w*'|[a-z_]\w*$/i,alias:"symbol",inside:{punctuation:/^<<[-~]?'|'$/}}}}],t.languages.rb=t.languages.ruby}e.exports=t,t.displayName="ruby",t.aliases=["rb"]},83648(e){"use strict";function t(e){!function(e){for(var t=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|)*\*\//.source,n=0;n<2;n++)t=t.replace(//g,function(){return t});t=t.replace(//g,function(){return/[^\s\S]/.source}),e.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+t),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0,alias:"string"},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|Self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:[ui](?:8|16|32|64|128|size)|f(?:32|64)|bool|char|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:[iu](?:8|16|32|64|size)?|f32|f64))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<>?=?|[@?]/},e.languages.rust["closure-params"].inside.rest=e.languages.rust,e.languages.rust.attribute.inside.string=e.languages.rust.string}(e)}e.exports=t,t.displayName="rust",t.aliases=[]},16009(e){"use strict";function t(e){var t,n,r,i,a,o,s,u,c,l,f,d,h,p,b,m,g,v,y;t=e,n=/(?:"(?:""|[^"])*"(?!")|'(?:''|[^'])*'(?!'))/.source,r=/\b(?:\d[\da-f]*x|\d+(?:\.\d+)?(?:e[+-]?\d+)?)\b/i,i={pattern:RegExp(n+"[bx]"),alias:"number"},a={pattern:/&[a-z_]\w*/i},o={pattern:/((?:^|\s|=|\())%(?:ABORT|BY|CMS|COPY|DISPLAY|DO|ELSE|END|EVAL|GLOBAL|GO|GOTO|IF|INC|INCLUDE|INDEX|INPUT|KTRIM|LENGTH|LET|LIST|LOCAL|PUT|QKTRIM|QSCAN|QSUBSTR|QSYSFUNC|QUPCASE|RETURN|RUN|SCAN|SUBSTR|SUPERQ|SYMDEL|SYMGLOBL|SYMLOCAL|SYMEXIST|SYSCALL|SYSEVALF|SYSEXEC|SYSFUNC|SYSGET|SYSRPUT|THEN|TO|TSO|UNQUOTE|UNTIL|UPCASE|WHILE|WINDOW)\b/i,lookbehind:!0,alias:"keyword"},s={pattern:/(^|\s)(?:proc\s+\w+|quit|run|data(?!=))\b/i,alias:"keyword",lookbehind:!0},u=[/\/\*[\s\S]*?\*\//,{pattern:/(^[ \t]*|;\s*)\*[^;]*;/m,lookbehind:!0}],c={pattern:RegExp(n),greedy:!0},d={function:f={pattern:/%?\b\w+(?=\()/,alias:"keyword"},"arg-value":{pattern:/(=\s*)[A-Z\.]+/i,lookbehind:!0},operator:/=/,"macro-variable":a,arg:{pattern:/[A-Z]+/i,alias:"keyword"},number:r,"numeric-constant":i,punctuation:l=/[$%@.(){}\[\];,\\]/,string:c},h={pattern:/\b(?:format|put)\b=?[\w'$.]+/im,inside:{keyword:/^(?:format|put)(?==)/i,equals:/=/,format:{pattern:/(?:\w|\$\d)+\.\d?/i,alias:"number"}}},p={pattern:/\b(?:format|put)\s+[\w']+(?:\s+[$.\w]+)+(?=;)/i,inside:{keyword:/^(?:format|put)/i,format:{pattern:/[\w$]+\.\d?/,alias:"number"}}},b={pattern:/((?:^|\s)=?)(?:catname|checkpoint execute_always|dm|endsas|filename|footnote|%include|libname|%list|lock|missing|options|page|resetline|%run|sasfile|skip|sysecho|title\d?)\b/i,lookbehind:!0,alias:"keyword"},m={pattern:/(^|\s)(?:submit(?:\s+(?:load|parseonly|norun))?|endsubmit)\b/i,lookbehind:!0,alias:"keyword"},g=/accessControl|cdm|aggregation|aStore|ruleMining|audio|autotune|bayesianNetClassifier|bioMedImage|boolRule|builtins|cardinality|sccasl|clustering|copula|countreg|dataDiscovery|dataPreprocess|dataSciencePilot|dataStep|decisionTree|deepLearn|deepNeural|varReduce|simSystem|ds2|deduplication|ecm|entityRes|espCluster|explainModel|factmac|fastKnn|fcmpact|fedSql|freqTab|gam|gleam|graphSemiSupLearn|gVarCluster|hiddenMarkovModel|hyperGroup|image|iml|ica|kernalPca|langModel|ldaTopic|sparseML|mlTools|mixed|modelPublishing|mbc|network|optNetwork|neuralNet|nonlinear|nmf|nonParametricBayes|optimization|panel|pls|percentile|pca|phreg|qkb|qlim|quantreg|recommend|tsReconcile|deepRnn|regression|reinforcementLearn|robustPca|sampling|sparkEmbeddedProcess|search(?:Analytics)?|sentimentAnalysis|sequence|configuration|session(?:Prop)?|severity|simple|smartData|sandwich|spatialreg|stabilityMonitoring|spc|loadStreams|svDataDescription|svm|table|conditionalRandomFields|text(?:Rule(?:Develop|Score)|Mining|Parse|Topic|Util|Filters|Frequency)|tsInfo|timeData|transpose|uniTimeSeries/.source,v={pattern:RegExp(/(^|\s)(?:action\s+)?(?:)\.[a-z]+\b[^;]+/.source.replace(//g,function(){return g}),"i"),lookbehind:!0,inside:{keyword:RegExp(/(?:)\.[a-z]+\b/.source.replace(//g,function(){return g}),"i"),action:{pattern:/(?:action)/i,alias:"keyword"},comment:u,function:f,"arg-value":d["arg-value"],operator:d.operator,argument:d.arg,number:r,"numeric-constant":i,punctuation:l,string:c}},y={pattern:/((?:^|\s)=?)(?:after|analysis|and|array|barchart|barwidth|begingraph|by|call|cas|cbarline|cfill|class(?:lev)?|close|column|computed?|contains|continue|data(?==)|define|delete|describe|document|do\s+over|do|dol|drop|dul|end(?:source|comp)?|entryTitle|else|eval(?:uate)?|exec(?:ute)?|exit|fill(?:attrs)?|file(?:name)?|flist|fnc|function(?:list)?|goto|global|group(?:by)?|headline|headskip|histogram|if|infile|keep|keylabel|keyword|label|layout|leave|legendlabel|length|libname|loadactionset|merge|midpoints|name|noobs|nowd|_?null_|ods|options|or|otherwise|out(?:put)?|over(?:lay)?|plot|put|print|raise|ranexp|rannor|rbreak|retain|return|select|set|session|sessref|source|statgraph|sum|summarize|table|temp|terminate|then\s+do|then|title\d?|to|var|when|where|xaxisopts|yaxisopts|y2axisopts)\b/i,lookbehind:!0},t.languages.sas={datalines:{pattern:/^([ \t]*)(?:(?:data)?lines|cards);[\s\S]+?^[ \t]*;/im,lookbehind:!0,alias:"string",inside:{keyword:{pattern:/^(?:(?:data)?lines|cards)/i},punctuation:/;/}},"proc-sql":{pattern:/(^proc\s+(?:fed)?sql(?:\s+[\w|=]+)?;)[\s\S]+?(?=^(?:proc\s+\w+|quit|run|data);|(?![\s\S]))/im,lookbehind:!0,inside:{sql:{pattern:RegExp(/^[ \t]*(?:select|alter\s+table|(?:create|describe|drop)\s+(?:index|table(?:\s+constraints)?|view)|create\s+unique\s+index|insert\s+into|update)(?:|[^;"'])+;/.source.replace(//g,function(){return n}),"im"),alias:"language-sql",inside:t.languages.sql},"global-statements":b,"sql-statements":{pattern:/(^|\s)(?:disconnect\s+from|exec(?:ute)?|begin|commit|rollback|reset|validate)\b/i,lookbehind:!0,alias:"keyword"},number:r,"numeric-constant":i,punctuation:l,string:c}},"proc-groovy":{pattern:/(^proc\s+groovy(?:\s+[\w|=]+)?;)[\s\S]+?(?=^(?:proc\s+\w+|quit|run|data);|(?![\s\S]))/im,lookbehind:!0,inside:{comment:u,groovy:{pattern:RegExp(/(^[ \t]*submit(?:\s+(?:load|parseonly|norun))?)(?:|[^"'])+?(?=endsubmit;)/.source.replace(//g,function(){return n}),"im"),lookbehind:!0,alias:"language-groovy",inside:t.languages.groovy},keyword:y,"submit-statement":m,"global-statements":b,number:r,"numeric-constant":i,punctuation:l,string:c}},"proc-lua":{pattern:/(^proc\s+lua(?:\s+[\w|=]+)?;)[\s\S]+?(?=^(?:proc\s+\w+|quit|run|data);|(?![\s\S]))/im,lookbehind:!0,inside:{comment:u,lua:{pattern:RegExp(/(^[ \t]*submit(?:\s+(?:load|parseonly|norun))?)(?:|[^"'])+?(?=endsubmit;)/.source.replace(//g,function(){return n}),"im"),lookbehind:!0,alias:"language-lua",inside:t.languages.lua},keyword:y,"submit-statement":m,"global-statements":b,number:r,"numeric-constant":i,punctuation:l,string:c}},"proc-cas":{pattern:/(^proc\s+cas(?:\s+[\w|=]+)?;)[\s\S]+?(?=^(?:proc\s+\w+|quit|data);|(?![\s\S]))/im,lookbehind:!0,inside:{comment:u,"statement-var":{pattern:/((?:^|\s)=?)saveresult\s[^;]+/im,lookbehind:!0,inside:{statement:{pattern:/^saveresult\s+\S+/i,inside:{keyword:/^(?:saveresult)/i}},rest:d}},"cas-actions":v,statement:{pattern:/((?:^|\s)=?)(?:default|(?:un)?set|on|output|upload)[^;]+/im,lookbehind:!0,inside:d},step:s,keyword:y,function:f,format:h,altformat:p,"global-statements":b,number:r,"numeric-constant":i,punctuation:l,string:c}},"proc-args":{pattern:RegExp(/(^proc\s+\w+\s+)(?!\s)(?:[^;"']|)+;/.source.replace(//g,function(){return n}),"im"),lookbehind:!0,inside:d},"macro-keyword":o,"macro-variable":a,"macro-string-functions":{pattern:/((?:^|\s|=))%(?:NRBQUOTE|NRQUOTE|NRSTR|BQUOTE|QUOTE|STR)\(.*?(?:[^%]\))/i,lookbehind:!0,inside:{function:{pattern:/%(?:NRBQUOTE|NRQUOTE|NRSTR|BQUOTE|QUOTE|STR)/i,alias:"keyword"},"macro-keyword":o,"macro-variable":a,"escaped-char":{pattern:/%['"()<>=¬^~;,#]/i},punctuation:l}},"macro-declaration":{pattern:/^%macro[^;]+(?=;)/im,inside:{keyword:/%macro/i}},"macro-end":{pattern:/^%mend[^;]+(?=;)/im,inside:{keyword:/%mend/i}},macro:{pattern:/%_\w+(?=\()/,alias:"keyword"},input:{pattern:/\binput\s[-\w\s/*.$&]+;/i,inside:{input:{alias:"keyword",pattern:/^input/i},comment:u,number:r,"numeric-constant":i}},"options-args":{pattern:/(^options)[-'"|/\\<>*+=:()\w\s]*(?=;)/im,lookbehind:!0,inside:d},"cas-actions":v,comment:u,function:f,format:h,altformat:p,"numeric-constant":i,datetime:{pattern:RegExp(n+"(?:dt?|t)"),alias:"number"},string:c,step:s,keyword:y,"operator-keyword":{pattern:/\b(?:eq|ne|gt|lt|ge|le|in|not)\b/i,alias:"operator"},number:r,operator:/\*\*?|\|\|?|!!?|¦¦?|<[>=]?|>[<=]?|[-+\/=&]|[~¬^]=?/i,punctuation:l}}e.exports=t,t.displayName="sas",t.aliases=[]},41720(e){"use strict";function t(e){var t,n,r;(t=e).languages.sass=t.languages.extend("css",{comment:{pattern:/^([ \t]*)\/[\/*].*(?:(?:\r?\n|\r)\1[ \t].+)*/m,lookbehind:!0}}),t.languages.insertBefore("sass","atrule",{"atrule-line":{pattern:/^(?:[ \t]*)[@+=].+/m,inside:{atrule:/(?:@[\w-]+|[+=])/m}}}),delete t.languages.sass.atrule,n=/\$[-\w]+|#\{\$[-\w]+\}/,r=[/[+*\/%]|[=!]=|<=?|>=?|\b(?:and|or|not)\b/,{pattern:/(\s)-(?=\s)/,lookbehind:!0}],t.languages.insertBefore("sass","property",{"variable-line":{pattern:/^[ \t]*\$.+/m,inside:{punctuation:/:/,variable:n,operator:r}},"property-line":{pattern:/^[ \t]*(?:[^:\s]+ *:.*|:[^:\s].*)/m,inside:{property:[/[^:\s]+(?=\s*:)/,{pattern:/(:)[^:\s]+/,lookbehind:!0}],punctuation:/:/,variable:n,operator:r,important:t.languages.sass.important}}}),delete t.languages.sass.property,delete t.languages.sass.important,t.languages.insertBefore("sass","punctuation",{selector:{pattern:/([ \t]*)\S(?:,[^,\r\n]+|[^,\r\n]*)(?:,[^,\r\n]+)*(?:,(?:\r?\n|\r)\1[ \t]+\S(?:,[^,\r\n]+|[^,\r\n]*)(?:,[^,\r\n]+)*)*/,lookbehind:!0}})}e.exports=t,t.displayName="sass",t.aliases=[]},6054(e,t,n){"use strict";var r=n(15909);function i(e){e.register(r),e.languages.scala=e.languages.extend("java",{"triple-quoted-string":{pattern:/"""[\s\S]*?"""/,greedy:!0,alias:"string"},string:{pattern:/("|')(?:\\.|(?!\1)[^\\\r\n])*\1/,greedy:!0},keyword:/<-|=>|\b(?:abstract|case|catch|class|def|do|else|extends|final|finally|for|forSome|if|implicit|import|lazy|match|new|null|object|override|package|private|protected|return|sealed|self|super|this|throw|trait|try|type|val|var|while|with|yield)\b/,number:/\b0x(?:[\da-f]*\.)?[\da-f]+|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e\d+)?[dfl]?/i,builtin:/\b(?:String|Int|Long|Short|Byte|Boolean|Double|Float|Char|Any|AnyRef|AnyVal|Unit|Nothing)\b/,symbol:/'[^\d\s\\]\w*/}),delete e.languages.scala["class-name"],delete e.languages.scala.function}e.exports=i,i.displayName="scala",i.aliases=[]},9997(e){"use strict";function t(e){!function(e){e.languages.scheme={comment:/;.*|#;\s*(?:\((?:[^()]|\([^()]*\))*\)|\[(?:[^\[\]]|\[[^\[\]]*\])*\])|#\|(?:[^#|]|#(?!\|)|\|(?!#)|#\|(?:[^#|]|#(?!\|)|\|(?!#))*\|#)*\|#/,string:{pattern:/"(?:[^"\\]|\\.)*"/,greedy:!0},symbol:{pattern:/'[^()\[\]#'\s]+/,greedy:!0},character:{pattern:/#\\(?:[ux][a-fA-F\d]+\b|[-a-zA-Z]+\b|[\uD800-\uDBFF][\uDC00-\uDFFF]|\S)/,greedy:!0,alias:"string"},"lambda-parameter":[{pattern:/((?:^|[^'`#])[(\[]lambda\s+)(?:[^|()\[\]'\s]+|\|(?:[^\\|]|\\.)*\|)/,lookbehind:!0},{pattern:/((?:^|[^'`#])[(\[]lambda\s+[(\[])[^()\[\]']+/,lookbehind:!0}],keyword:{pattern:/((?:^|[^'`#])[(\[])(?:begin|case(?:-lambda)?|cond(?:-expand)?|define(?:-library|-macro|-record-type|-syntax|-values)?|defmacro|delay(?:-force)?|do|else|export|except|guard|if|import|include(?:-ci|-library-declarations)?|lambda|let(?:rec)?(?:-syntax|-values|\*)?|let\*-values|only|parameterize|prefix|(?:quasi-?)?quote|rename|set!|syntax-(?:case|rules)|unless|unquote(?:-splicing)?|when)(?=[()\[\]\s]|$)/,lookbehind:!0},builtin:{pattern:/((?:^|[^'`#])[(\[])(?:abs|and|append|apply|assoc|ass[qv]|binary-port\?|boolean=?\?|bytevector(?:-append|-copy|-copy!|-length|-u8-ref|-u8-set!|\?)?|caar|cadr|call-with-(?:current-continuation|port|values)|call\/cc|car|cdar|cddr|cdr|ceiling|char(?:->integer|-ready\?|\?|<\?|<=\?|=\?|>\?|>=\?)|close-(?:input-port|output-port|port)|complex\?|cons|current-(?:error|input|output)-port|denominator|dynamic-wind|eof-object\??|eq\?|equal\?|eqv\?|error|error-object(?:-irritants|-message|\?)|eval|even\?|exact(?:-integer-sqrt|-integer\?|\?)?|expt|features|file-error\?|floor(?:-quotient|-remainder|\/)?|flush-output-port|for-each|gcd|get-output-(?:bytevector|string)|inexact\??|input-port(?:-open\?|\?)|integer(?:->char|\?)|lcm|length|list(?:->string|->vector|-copy|-ref|-set!|-tail|\?)?|make-(?:bytevector|list|parameter|string|vector)|map|max|member|memq|memv|min|modulo|negative\?|newline|not|null\?|number(?:->string|\?)|numerator|odd\?|open-(?:input|output)-(?:bytevector|string)|or|output-port(?:-open\?|\?)|pair\?|peek-char|peek-u8|port\?|positive\?|procedure\?|quotient|raise|raise-continuable|rational\?|rationalize|read-(?:bytevector|bytevector!|char|error\?|line|string|u8)|real\?|remainder|reverse|round|set-c[ad]r!|square|string(?:->list|->number|->symbol|->utf8|->vector|-append|-copy|-copy!|-fill!|-for-each|-length|-map|-ref|-set!|\?|<\?|<=\?|=\?|>\?|>=\?)?|substring|symbol(?:->string|\?|=\?)|syntax-error|textual-port\?|truncate(?:-quotient|-remainder|\/)?|u8-ready\?|utf8->string|values|vector(?:->list|->string|-append|-copy|-copy!|-fill!|-for-each|-length|-map|-ref|-set!|\?)?|with-exception-handler|write-(?:bytevector|char|string|u8)|zero\?)(?=[()\[\]\s]|$)/,lookbehind:!0},operator:{pattern:/((?:^|[^'`#])[(\[])(?:[-+*%/]|[<>]=?|=>?)(?=[()\[\]\s]|$)/,lookbehind:!0},number:{pattern:RegExp(t({"":/\d+(?:\/\d+)|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?/.source,"":/[+-]?|[+-](?:inf|nan)\.0/.source,"":/[+-](?:|(?:inf|nan)\.0)?i/.source,"":/(?:@|)?|/.source,"":/(?:#d(?:#[ei])?|#[ei](?:#d)?)?/.source,"":/[0-9a-f]+(?:\/[0-9a-f]+)?/.source,"":/[+-]?|[+-](?:inf|nan)\.0/.source,"":/[+-](?:|(?:inf|nan)\.0)?i/.source,"":/(?:@|)?|/.source,"":/#[box](?:#[ei])?|(?:#[ei])?#[box]/.source,"":/(^|[()\[\]\s])(?:|)(?=[()\[\]\s]|$)/.source}),"i"),lookbehind:!0},boolean:{pattern:/(^|[()\[\]\s])#(?:[ft]|false|true)(?=[()\[\]\s]|$)/,lookbehind:!0},function:{pattern:/((?:^|[^'`#])[(\[])(?:[^|()\[\]'\s]+|\|(?:[^\\|]|\\.)*\|)(?=[()\[\]\s]|$)/,lookbehind:!0},identifier:{pattern:/(^|[()\[\]\s])\|(?:[^\\|]|\\.)*\|(?=[()\[\]\s]|$)/,lookbehind:!0,greedy:!0},punctuation:/[()\[\]']/};function t(e){for(var t in e)e[t]=e[t].replace(/<[\w\s]+>/g,function(t){return"(?:"+e[t].trim()+")"});return e[t]}}(e)}e.exports=t,t.displayName="scheme",t.aliases=[]},24296(e){"use strict";function t(e){e.languages.scss=e.languages.extend("css",{comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,lookbehind:!0},atrule:{pattern:/@[\w-](?:\([^()]+\)|[^()\s]|\s+(?!\s))*?(?=\s+[{;])/,inside:{rule:/@[\w-]+/}},url:/(?:[-a-z]+-)?url(?=\()/i,selector:{pattern:/(?=\S)[^@;{}()]?(?:[^@;{}()\s]|\s+(?!\s)|#\{\$[-\w]+\})+(?=\s*\{(?:\}|\s|[^}][^:{}]*[:{][^}]))/m,inside:{parent:{pattern:/&/,alias:"important"},placeholder:/%[-\w]+/,variable:/\$[-\w]+|#\{\$[-\w]+\}/}},property:{pattern:/(?:[-\w]|\$[-\w]|#\{\$[-\w]+\})+(?=\s*:)/,inside:{variable:/\$[-\w]+|#\{\$[-\w]+\}/}}}),e.languages.insertBefore("scss","atrule",{keyword:[/@(?:if|else(?: if)?|forward|for|each|while|import|use|extend|debug|warn|mixin|include|function|return|content)\b/i,{pattern:/( )(?:from|through)(?= )/,lookbehind:!0}]}),e.languages.insertBefore("scss","important",{variable:/\$[-\w]+|#\{\$[-\w]+\}/}),e.languages.insertBefore("scss","function",{"module-modifier":{pattern:/\b(?:as|with|show|hide)\b/i,alias:"keyword"},placeholder:{pattern:/%[-\w]+/,alias:"selector"},statement:{pattern:/\B!(?:default|optional)\b/i,alias:"keyword"},boolean:/\b(?:true|false)\b/,null:{pattern:/\bnull\b/,alias:"keyword"},operator:{pattern:/(\s)(?:[-+*\/%]|[=!]=|<=?|>=?|and|or|not)(?=\s)/,lookbehind:!0}}),e.languages.scss.atrule.inside.rest=e.languages.scss}e.exports=t,t.displayName="scss",t.aliases=[]},49246(e,t,n){"use strict";var r=n(6979);function i(e){var t,n;e.register(r),n=[/"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/.source,/'[^']*'/.source,/\$'(?:[^'\\]|\\[\s\S])*'/.source,/<<-?\s*(["']?)(\w+)\1\s[\s\S]*?[\r\n]\2/.source].join("|"),(t=e).languages["shell-session"]={command:{pattern:RegExp(/^(?:[^\s@:$#*!/\\]+@[^\r\n@:$#*!/\\]+(?::[^\0-\x1F$#*?"<>:;|]+)?|[^\0-\x1F$#*?"<>@:;|]+)?/.source+/[$#]/.source+/(?:[^\\\r\n'"<$]|\\(?:[^\r]|\r\n?)|\$(?!')|<>)+/.source.replace(/<>/g,function(){return n}),"m"),greedy:!0,inside:{info:{pattern:/^[^#$]+/,alias:"punctuation",inside:{user:/^[^\s@:$#*!/\\]+@[^\r\n@:$#*!/\\]+/,punctuation:/:/,path:/[\s\S]+/}},bash:{pattern:/(^[$#]\s*)\S[\s\S]*/,lookbehind:!0,alias:"language-bash",inside:t.languages.bash},"shell-symbol":{pattern:/^[$#]/,alias:"important"}}},output:/.(?:.*(?:[\r\n]|.$))*/},t.languages["sh-session"]=t.languages.shellsession=t.languages["shell-session"]}e.exports=i,i.displayName="shellSession",i.aliases=[]},18890(e){"use strict";function t(e){e.languages.smali={comment:/#.*/,string:{pattern:/"(?:[^\r\n\\"]|\\.)*"|'(?:[^\r\n\\']|\\(?:.|u[\da-fA-F]{4}))'/,greedy:!0},"class-name":{pattern:/(^|[^L])L(?:(?:\w+|`[^`\r\n]*`)\/)*(?:[\w$]+|`[^`\r\n]*`)(?=\s*;)/,lookbehind:!0,inside:{"class-name":{pattern:/(^L|\/)(?:[\w$]+|`[^`\r\n]*`)$/,lookbehind:!0},namespace:{pattern:/^(L)(?:(?:\w+|`[^`\r\n]*`)\/)+/,lookbehind:!0,inside:{punctuation:/\//}},builtin:/^L/}},builtin:[{pattern:/([();\[])[BCDFIJSVZ]+/,lookbehind:!0},{pattern:/([\w$>]:)[BCDFIJSVZ]/,lookbehind:!0}],keyword:[{pattern:/(\.end\s+)[\w-]+/,lookbehind:!0},{pattern:/(^|[^\w.-])\.(?!\d)[\w-]+/,lookbehind:!0},{pattern:/(^|[^\w.-])(?:abstract|annotation|bridge|constructor|enum|final|interface|private|protected|public|runtime|static|synthetic|system|transient)(?![\w.-])/,lookbehind:!0}],function:{pattern:/(^|[^\w.-])(?:\w+|<[\w$-]+>)(?=\()/,lookbehind:!0},field:{pattern:/[\w$]+(?=:)/,alias:"variable"},register:{pattern:/(^|[^\w.-])[vp]\d(?![\w.-])/,lookbehind:!0,alias:"variable"},boolean:{pattern:/(^|[^\w.-])(?:true|false)(?![\w.-])/,lookbehind:!0},number:{pattern:/(^|[^/\w.-])-?(?:NAN|INFINITY|0x(?:[\dA-F]+(?:\.[\dA-F]*)?|\.[\dA-F]+)(?:p[+-]?[\dA-F]+)?|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?)[dflst]?(?![\w.-])/i,lookbehind:!0},label:{pattern:/(:)\w+/,lookbehind:!0,alias:"property"},operator:/->|\.\.|[\[=]/,punctuation:/[{}(),;:]/}}e.exports=t,t.displayName="smali",t.aliases=[]},11037(e){"use strict";function t(e){e.languages.smalltalk={comment:/"(?:""|[^"])*"/,character:{pattern:/\$./,alias:"string"},string:/'(?:''|[^'])*'/,symbol:/#[\da-z]+|#(?:-|([+\/\\*~<>=@%|&?!])\1?)|#(?=\()/i,"block-arguments":{pattern:/(\[\s*):[^\[|]*\|/,lookbehind:!0,inside:{variable:/:[\da-z]+/i,punctuation:/\|/}},"temporary-variables":{pattern:/\|[^|]+\|/,inside:{variable:/[\da-z]+/i,punctuation:/\|/}},keyword:/\b(?:nil|true|false|self|super|new)\b/,number:[/\d+r-?[\dA-Z]+(?:\.[\dA-Z]+)?(?:e-?\d+)?/,/\b\d+(?:\.\d+)?(?:e-?\d+)?/],operator:/[<=]=?|:=|~[~=]|\/\/?|\\\\|>[>=]?|[!^+\-*&|,@]/,punctuation:/[.;:?\[\](){}]/}}e.exports=t,t.displayName="smalltalk",t.aliases=[]},64020(e,t,n){"use strict";var r=n(93205);function i(e){var t;e.register(r),(t=e).languages.smarty={comment:/\{\*[\s\S]*?\*\}/,delimiter:{pattern:/^\{|\}$/i,alias:"punctuation"},string:/(["'])(?:\\.|(?!\1)[^\\\r\n])*\1/,number:/\b0x[\dA-Fa-f]+|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee][-+]?\d+)?/,variable:[/\$(?!\d)\w+/,/#(?!\d)\w+#/,{pattern:/(\.|->)(?!\d)\w+/,lookbehind:!0},{pattern:/(\[)(?!\d)\w+(?=\])/,lookbehind:!0}],function:[{pattern:/(\|\s*)@?(?!\d)\w+/,lookbehind:!0},/^\/?(?!\d)\w+/,/(?!\d)\w+(?=\()/],"attr-name":{pattern:/\w+\s*=\s*(?:(?!\d)\w+)?/,inside:{variable:{pattern:/(=\s*)(?!\d)\w+/,lookbehind:!0},operator:/=/}},punctuation:[/[\[\]().,:`]|->/],operator:[/[+\-*\/%]|==?=?|[!<>]=?|&&|\|\|?/,/\bis\s+(?:not\s+)?(?:div|even|odd)(?:\s+by)?\b/,/\b(?:eq|neq?|gt|lt|gt?e|lt?e|not|mod|or|and)\b/],keyword:/\b(?:false|off|on|no|true|yes)\b/},t.hooks.add("before-tokenize",function(e){var n=/\{\*[\s\S]*?\*\}|\{[\s\S]+?\}/g,r="{literal}",i="{/literal}",a=!1;t.languages["markup-templating"].buildPlaceholders(e,"smarty",n,function(e){return e===i&&(a=!1),!a&&(e===r&&(a=!0),!0)})}),t.hooks.add("after-tokenize",function(e){t.languages["markup-templating"].tokenizePlaceholders(e,"smarty")})}e.exports=i,i.displayName="smarty",i.aliases=[]},49760(e){"use strict";function t(e){var t,n;n=/\b(?:abstype|and|andalso|as|case|datatype|do|else|end|eqtype|exception|fn|fun|functor|handle|if|in|include|infix|infixr|let|local|nonfix|of|op|open|orelse|raise|rec|sharing|sig|signature|struct|structure|then|type|val|where|while|with|withtype)\b/i,(t=e).languages.sml={comment:/\(\*(?:[^*(]|\*(?!\))|\((?!\*)|\(\*(?:[^*(]|\*(?!\))|\((?!\*))*\*\))*\*\)/,string:{pattern:/#?"(?:[^"\\]|\\.)*"/,greedy:!0},"class-name":[{pattern:RegExp(/((?:^|[^:]):\s*)(?:\s*(?:(?:\*|->)\s*|,\s*(?:(?=)|(?!)\s+)))*/.source.replace(//g,function(){return/\s*(?:[*,]|->)/.source}).replace(//g,function(){return/(?:'[\w']*||\((?:[^()]|\([^()]*\))*\)|\{(?:[^{}]|\{[^{}]*\})*\})(?:\s+)*/.source}).replace(//g,function(){return/(?!)[a-z\d_][\w'.]*/.source}).replace(//g,function(){return n.source}),"i"),lookbehind:!0,greedy:!0,inside:null},{pattern:/((?:^|[^\w'])(?:datatype|exception|functor|signature|structure|type)\s+)[a-z_][\w'.]*/i,lookbehind:!0}],function:{pattern:/((?:^|[^\w'])fun\s+)[a-z_][\w'.]*/i,lookbehind:!0},keyword:n,variable:{pattern:/(^|[^\w'])'[\w']*/,lookbehind:!0},number:/~?\b(?:\d+(?:\.\d+)?(?:e~?\d+)?|0x[\da-f]+)\b/i,word:{pattern:/\b0w(?:\d+|x[\da-f]+)\b/i,alias:"constant"},boolean:/\b(?:false|true)\b/i,operator:/\.\.\.|:[>=:]|=>?|->|[<>]=?|[!+\-*/^#|@~]/,punctuation:/[(){}\[\].:,;]/},t.languages.sml["class-name"][0].inside=t.languages.sml,t.languages.smlnj=t.languages.sml}e.exports=t,t.displayName="sml",t.aliases=["smlnj"]},33351(e){"use strict";function t(e){e.languages.solidity=e.languages.extend("clike",{"class-name":{pattern:/(\b(?:contract|enum|interface|library|new|struct|using)\s+)(?!\d)[\w$]+/,lookbehind:!0},keyword:/\b(?:_|anonymous|as|assembly|assert|break|calldata|case|constant|constructor|continue|contract|default|delete|do|else|emit|enum|event|external|for|from|function|if|import|indexed|inherited|interface|internal|is|let|library|mapping|memory|modifier|new|payable|pragma|private|public|pure|require|returns?|revert|selfdestruct|solidity|storage|struct|suicide|switch|this|throw|using|var|view|while)\b/,operator:/=>|->|:=|=:|\*\*|\+\+|--|\|\||&&|<<=?|>>=?|[-+*/%^&|<>!=]=?|[~?]/}),e.languages.insertBefore("solidity","keyword",{builtin:/\b(?:address|bool|string|u?int(?:8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?|byte|bytes(?:[1-9]|[12]\d|3[0-2])?)\b/}),e.languages.insertBefore("solidity","number",{version:{pattern:/([<>]=?|\^)\d+\.\d+\.\d+\b/,lookbehind:!0,alias:"number"}}),e.languages.sol=e.languages.solidity}e.exports=t,t.displayName="solidity",t.aliases=["sol"]},13570(e){"use strict";function t(e){var t,n;n={pattern:/\{[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}\}/i,alias:"constant",inside:{punctuation:/[{}]/}},(t=e).languages["solution-file"]={comment:{pattern:/#.*/,greedy:!0},string:{pattern:/"[^"\r\n]*"|'[^'\r\n]*'/,greedy:!0,inside:{guid:n}},object:{pattern:/^([ \t]*)(?:([A-Z]\w*)\b(?=.*(?:\r\n?|\n)(?:\1[ \t].*(?:\r\n?|\n))*\1End\2(?=[ \t]*$))|End[A-Z]\w*(?=[ \t]*$))/m,lookbehind:!0,greedy:!0,alias:"keyword"},property:{pattern:/^([ \t]*)(?!\s)[^\r\n"#=()]*[^\s"#=()](?=\s*=)/m,lookbehind:!0,inside:{guid:n}},guid:n,number:/\b\d+(?:\.\d+)*\b/,boolean:/\b(?:FALSE|TRUE)\b/,operator:/=/,punctuation:/[(),]/},t.languages.sln=t.languages["solution-file"]}e.exports=t,t.displayName="solutionFile",t.aliases=[]},38181(e,t,n){"use strict";var r=n(93205);function i(e){var t,n,i;e.register(r),n=/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,i=/\b\d+(?:\.\d+)?(?:[eE][+-]?\d+)?\b|\b0x[\dA-F]+\b/,(t=e).languages.soy={comment:[/\/\*[\s\S]*?\*\//,{pattern:/(\s)\/\/.*/,lookbehind:!0,greedy:!0}],"command-arg":{pattern:/(\{+\/?\s*(?:alias|call|delcall|delpackage|deltemplate|namespace|template)\s+)\.?[\w.]+/,lookbehind:!0,alias:"string",inside:{punctuation:/\./}},parameter:{pattern:/(\{+\/?\s*@?param\??\s+)\.?[\w.]+/,lookbehind:!0,alias:"variable"},keyword:[{pattern:/(\{+\/?[^\S\r\n]*)(?:\\[nrt]|alias|call|case|css|default|delcall|delpackage|deltemplate|else(?:if)?|fallbackmsg|for(?:each)?|if(?:empty)?|lb|let|literal|msg|namespace|nil|@?param\??|rb|sp|switch|template|xid)/,lookbehind:!0},/\b(?:any|as|attributes|bool|css|float|in|int|js|html|list|map|null|number|string|uri)\b/],delimiter:{pattern:/^\{+\/?|\/?\}+$/,alias:"punctuation"},property:/\w+(?==)/,variable:{pattern:/\$[^\W\d]\w*(?:\??(?:\.\w+|\[[^\]]+\]))*/,inside:{string:{pattern:n,greedy:!0},number:i,punctuation:/[\[\].?]/}},string:{pattern:n,greedy:!0},function:[/\w+(?=\()/,{pattern:/(\|[^\S\r\n]*)\w+/,lookbehind:!0}],boolean:/\b(?:true|false)\b/,number:i,operator:/\?:?|<=?|>=?|==?|!=|[+*/%-]|\b(?:and|not|or)\b/,punctuation:/[{}()\[\]|.,:]/},t.hooks.add("before-tokenize",function(e){var n=/\{\{.+?\}\}|\{.+?\}|\s\/\/.*|\/\*[\s\S]*?\*\//g,r="{literal}",i="{/literal}",a=!1;t.languages["markup-templating"].buildPlaceholders(e,"soy",n,function(e){return e===i&&(a=!1),!a&&(e===r&&(a=!0),!0)})}),t.hooks.add("after-tokenize",function(e){t.languages["markup-templating"].tokenizePlaceholders(e,"soy")})}e.exports=i,i.displayName="soy",i.aliases=[]},98774(e,t,n){"use strict";var r=n(24691);function i(e){e.register(r),e.languages.sparql=e.languages.extend("turtle",{boolean:/\b(?:true|false)\b/i,variable:{pattern:/[?$]\w+/,greedy:!0}}),e.languages.insertBefore("sparql","punctuation",{keyword:[/\b(?:A|ADD|ALL|AS|ASC|ASK|BNODE|BY|CLEAR|CONSTRUCT|COPY|CREATE|DATA|DEFAULT|DELETE|DESC|DESCRIBE|DISTINCT|DROP|EXISTS|FILTER|FROM|GROUP|HAVING|INSERT|INTO|LIMIT|LOAD|MINUS|MOVE|NAMED|NOT|NOW|OFFSET|OPTIONAL|ORDER|RAND|REDUCED|SELECT|SEPARATOR|SERVICE|SILENT|STRUUID|UNION|USING|UUID|VALUES|WHERE)\b/i,/\b(?:ABS|AVG|BIND|BOUND|CEIL|COALESCE|CONCAT|CONTAINS|COUNT|DATATYPE|DAY|ENCODE_FOR_URI|FLOOR|GROUP_CONCAT|HOURS|IF|IRI|isBLANK|isIRI|isLITERAL|isNUMERIC|isURI|LANG|LANGMATCHES|LCASE|MAX|MD5|MIN|MINUTES|MONTH|ROUND|REGEX|REPLACE|sameTerm|SAMPLE|SECONDS|SHA1|SHA256|SHA384|SHA512|STR|STRAFTER|STRBEFORE|STRDT|STRENDS|STRLANG|STRLEN|STRSTARTS|SUBSTR|SUM|TIMEZONE|TZ|UCASE|URI|YEAR)\b(?=\s*\()/i,/\b(?:GRAPH|BASE|PREFIX)\b/i]}),e.languages.rq=e.languages.sparql}e.exports=i,i.displayName="sparql",i.aliases=["rq"]},22855(e){"use strict";function t(e){e.languages["splunk-spl"]={comment:/`comment\("(?:\\.|[^\\"])*"\)`/,string:{pattern:/"(?:\\.|[^\\"])*"/,greedy:!0},keyword:/\b(?:abstract|accum|addcoltotals|addinfo|addtotals|analyzefields|anomalies|anomalousvalue|anomalydetection|append|appendcols|appendcsv|appendlookup|appendpipe|arules|associate|audit|autoregress|bin|bucket|bucketdir|chart|cluster|cofilter|collect|concurrency|contingency|convert|correlate|datamodel|dbinspect|dedup|delete|delta|diff|erex|eval|eventcount|eventstats|extract|fieldformat|fields|fieldsummary|filldown|fillnull|findtypes|folderize|foreach|format|from|gauge|gentimes|geom|geomfilter|geostats|head|highlight|history|iconify|input|inputcsv|inputlookup|iplocation|join|kmeans|kv|kvform|loadjob|localize|localop|lookup|makecontinuous|makemv|makeresults|map|mcollect|metadata|metasearch|meventcollect|mstats|multikv|multisearch|mvcombine|mvexpand|nomv|outlier|outputcsv|outputlookup|outputtext|overlap|pivot|predict|rangemap|rare|regex|relevancy|reltime|rename|replace|rest|return|reverse|rex|rtorder|run|savedsearch|script|scrub|search|searchtxn|selfjoin|sendemail|set|setfields|sichart|sirare|sistats|sitimechart|sitop|sort|spath|stats|strcat|streamstats|table|tags|tail|timechart|timewrap|top|transaction|transpose|trendline|tscollect|tstats|typeahead|typelearner|typer|union|uniq|untable|where|x11|xmlkv|xmlunescape|xpath|xyseries)\b/i,"operator-word":{pattern:/\b(?:and|as|by|not|or|xor)\b/i,alias:"operator"},function:/\b\w+(?=\s*\()/,property:/\b\w+(?=\s*=(?!=))/,date:{pattern:/\b\d{1,2}\/\d{1,2}\/\d{1,4}(?:(?::\d{1,2}){3})?\b/,alias:"number"},number:/\b\d+(?:\.\d+)?\b/,boolean:/\b(?:f|false|t|true)\b/i,operator:/[<>=]=?|[-+*/%|]/,punctuation:/[()[\],]/}}e.exports=t,t.displayName="splunkSpl",t.aliases=[]},29611(e){"use strict";function t(e){e.languages.sqf=e.languages.extend("clike",{string:{pattern:/"(?:(?:"")?[^"])*"(?!")|'(?:[^'])*'/,greedy:!0},keyword:/\b(?:breakOut|breakTo|call|case|catch|default|do|echo|else|execVM|execFSM|exitWith|for|forEach|forEachMember|forEachMemberAgent|forEachMemberTeam|from|goto|if|nil|preprocessFile|preprocessFileLineNumbers|private|scopeName|spawn|step|switch|then|throw|to|try|while|with)\b/i,boolean:/\b(?:true|false)\b/i,function:/\b(?:abs|accTime|acos|action|actionIDs|actionKeys|actionKeysImages|actionKeysNames|actionKeysNamesArray|actionName|actionParams|activateAddons|activatedAddons|activateKey|add3DENConnection|add3DENEventHandler|add3DENLayer|addAction|addBackpack|addBackpackCargo|addBackpackCargoGlobal|addBackpackGlobal|addCamShake|addCuratorAddons|addCuratorCameraArea|addCuratorEditableObjects|addCuratorEditingArea|addCuratorPoints|addEditorObject|addEventHandler|addForce|addForceGeneratorRTD|addGoggles|addGroupIcon|addHandgunItem|addHeadgear|addItem|addItemCargo|addItemCargoGlobal|addItemPool|addItemToBackpack|addItemToUniform|addItemToVest|addLiveStats|addMagazine|addMagazineAmmoCargo|addMagazineCargo|addMagazineCargoGlobal|addMagazineGlobal|addMagazinePool|addMagazines|addMagazineTurret|addMenu|addMenuItem|addMissionEventHandler|addMPEventHandler|addMusicEventHandler|addOwnedMine|addPlayerScores|addPrimaryWeaponItem|addPublicVariableEventHandler|addRating|addResources|addScore|addScoreSide|addSecondaryWeaponItem|addSwitchableUnit|addTeamMember|addToRemainsCollector|addTorque|addUniform|addVehicle|addVest|addWaypoint|addWeapon|addWeaponCargo|addWeaponCargoGlobal|addWeaponGlobal|addWeaponItem|addWeaponPool|addWeaponTurret|admin|agent|agents|AGLToASL|aimedAtTarget|aimPos|airDensityCurveRTD|airDensityRTD|airplaneThrottle|airportSide|AISFinishHeal|alive|all3DENEntities|allAirports|allControls|allCurators|allCutLayers|allDead|allDeadMen|allDisplays|allGroups|allMapMarkers|allMines|allMissionObjects|allow3DMode|allowCrewInImmobile|allowCuratorLogicIgnoreAreas|allowDamage|allowDammage|allowFileOperations|allowFleeing|allowGetIn|allowSprint|allPlayers|allSimpleObjects|allSites|allTurrets|allUnits|allUnitsUAV|allVariables|ammo|ammoOnPylon|animate|animateBay|animateDoor|animatePylon|animateSource|animationNames|animationPhase|animationSourcePhase|animationState|append|apply|armoryPoints|arrayIntersect|asin|ASLToAGL|ASLToATL|assert|assignAsCargo|assignAsCargoIndex|assignAsCommander|assignAsDriver|assignAsGunner|assignAsTurret|assignCurator|assignedCargo|assignedCommander|assignedDriver|assignedGunner|assignedItems|assignedTarget|assignedTeam|assignedVehicle|assignedVehicleRole|assignItem|assignTeam|assignToAirport|atan|atan2|atg|ATLToASL|attachedObject|attachedObjects|attachedTo|attachObject|attachTo|attackEnabled|backpack|backpackCargo|backpackContainer|backpackItems|backpackMagazines|backpackSpaceFor|behaviour|benchmark|binocular|blufor|boundingBox|boundingBoxReal|boundingCenter|briefingName|buildingExit|buildingPos|buldozer_EnableRoadDiag|buldozer_IsEnabledRoadDiag|buldozer_LoadNewRoads|buldozer_reloadOperMap|buttonAction|buttonSetAction|cadetMode|callExtension|camCommand|camCommit|camCommitPrepared|camCommitted|camConstuctionSetParams|camCreate|camDestroy|cameraEffect|cameraEffectEnableHUD|cameraInterest|cameraOn|cameraView|campaignConfigFile|camPreload|camPreloaded|camPrepareBank|camPrepareDir|camPrepareDive|camPrepareFocus|camPrepareFov|camPrepareFovRange|camPreparePos|camPrepareRelPos|camPrepareTarget|camSetBank|camSetDir|camSetDive|camSetFocus|camSetFov|camSetFovRange|camSetPos|camSetRelPos|camSetTarget|camTarget|camUseNVG|canAdd|canAddItemToBackpack|canAddItemToUniform|canAddItemToVest|cancelSimpleTaskDestination|canFire|canMove|canSlingLoad|canStand|canSuspend|canTriggerDynamicSimulation|canUnloadInCombat|canVehicleCargo|captive|captiveNum|cbChecked|cbSetChecked|ceil|channelEnabled|cheatsEnabled|checkAIFeature|checkVisibility|civilian|className|clear3DENAttribute|clear3DENInventory|clearAllItemsFromBackpack|clearBackpackCargo|clearBackpackCargoGlobal|clearForcesRTD|clearGroupIcons|clearItemCargo|clearItemCargoGlobal|clearItemPool|clearMagazineCargo|clearMagazineCargoGlobal|clearMagazinePool|clearOverlay|clearRadio|clearVehicleInit|clearWeaponCargo|clearWeaponCargoGlobal|clearWeaponPool|clientOwner|closeDialog|closeDisplay|closeOverlay|collapseObjectTree|collect3DENHistory|collectiveRTD|combatMode|commandArtilleryFire|commandChat|commander|commandFire|commandFollow|commandFSM|commandGetOut|commandingMenu|commandMove|commandRadio|commandStop|commandSuppressiveFire|commandTarget|commandWatch|comment|commitOverlay|compile|compileFinal|completedFSM|composeText|configClasses|configFile|configHierarchy|configName|configNull|configProperties|configSourceAddonList|configSourceMod|configSourceModList|confirmSensorTarget|connectTerminalToUAV|controlNull|controlsGroupCtrl|copyFromClipboard|copyToClipboard|copyWaypoints|cos|count|countEnemy|countFriendly|countSide|countType|countUnknown|create3DENComposition|create3DENEntity|createAgent|createCenter|createDialog|createDiaryLink|createDiaryRecord|createDiarySubject|createDisplay|createGearDialog|createGroup|createGuardedPoint|createLocation|createMarker|createMarkerLocal|createMenu|createMine|createMissionDisplay|createMPCampaignDisplay|createSimpleObject|createSimpleTask|createSite|createSoundSource|createTask|createTeam|createTrigger|createUnit|createVehicle|createVehicleCrew|createVehicleLocal|crew|ctAddHeader|ctAddRow|ctClear|ctCurSel|ctData|ctFindHeaderRows|ctFindRowHeader|ctHeaderControls|ctHeaderCount|ctRemoveHeaders|ctRemoveRows|ctrlActivate|ctrlAddEventHandler|ctrlAngle|ctrlAutoScrollDelay|ctrlAutoScrollRewind|ctrlAutoScrollSpeed|ctrlChecked|ctrlClassName|ctrlCommit|ctrlCommitted|ctrlCreate|ctrlDelete|ctrlEnable|ctrlEnabled|ctrlFade|ctrlHTMLLoaded|ctrlIDC|ctrlIDD|ctrlMapAnimAdd|ctrlMapAnimClear|ctrlMapAnimCommit|ctrlMapAnimDone|ctrlMapCursor|ctrlMapMouseOver|ctrlMapScale|ctrlMapScreenToWorld|ctrlMapWorldToScreen|ctrlModel|ctrlModelDirAndUp|ctrlModelScale|ctrlParent|ctrlParentControlsGroup|ctrlPosition|ctrlRemoveAllEventHandlers|ctrlRemoveEventHandler|ctrlScale|ctrlSetActiveColor|ctrlSetAngle|ctrlSetAutoScrollDelay|ctrlSetAutoScrollRewind|ctrlSetAutoScrollSpeed|ctrlSetBackgroundColor|ctrlSetChecked|ctrlSetDisabledColor|ctrlSetEventHandler|ctrlSetFade|ctrlSetFocus|ctrlSetFont|ctrlSetFontH1|ctrlSetFontH1B|ctrlSetFontH2|ctrlSetFontH2B|ctrlSetFontH3|ctrlSetFontH3B|ctrlSetFontH4|ctrlSetFontH4B|ctrlSetFontH5|ctrlSetFontH5B|ctrlSetFontH6|ctrlSetFontH6B|ctrlSetFontHeight|ctrlSetFontHeightH1|ctrlSetFontHeightH2|ctrlSetFontHeightH3|ctrlSetFontHeightH4|ctrlSetFontHeightH5|ctrlSetFontHeightH6|ctrlSetFontHeightSecondary|ctrlSetFontP|ctrlSetFontPB|ctrlSetFontSecondary|ctrlSetForegroundColor|ctrlSetModel|ctrlSetModelDirAndUp|ctrlSetModelScale|ctrlSetPixelPrecision|ctrlSetPosition|ctrlSetScale|ctrlSetStructuredText|ctrlSetText|ctrlSetTextColor|ctrlSetTextColorSecondary|ctrlSetTextSecondary|ctrlSetTooltip|ctrlSetTooltipColorBox|ctrlSetTooltipColorShade|ctrlSetTooltipColorText|ctrlShow|ctrlShown|ctrlText|ctrlTextHeight|ctrlTextSecondary|ctrlTextWidth|ctrlType|ctrlVisible|ctRowControls|ctRowCount|ctSetCurSel|ctSetData|ctSetHeaderTemplate|ctSetRowTemplate|ctSetValue|ctValue|curatorAddons|curatorCamera|curatorCameraArea|curatorCameraAreaCeiling|curatorCoef|curatorEditableObjects|curatorEditingArea|curatorEditingAreaType|curatorMouseOver|curatorPoints|curatorRegisteredObjects|curatorSelected|curatorWaypointCost|current3DENOperation|currentChannel|currentCommand|currentMagazine|currentMagazineDetail|currentMagazineDetailTurret|currentMagazineTurret|currentMuzzle|currentNamespace|currentTask|currentTasks|currentThrowable|currentVisionMode|currentWaypoint|currentWeapon|currentWeaponMode|currentWeaponTurret|currentZeroing|cursorObject|cursorTarget|customChat|customRadio|cutFadeOut|cutObj|cutRsc|cutText|damage|date|dateToNumber|daytime|deActivateKey|debriefingText|debugFSM|debugLog|deg|delete3DENEntities|deleteAt|deleteCenter|deleteCollection|deleteEditorObject|deleteGroup|deleteGroupWhenEmpty|deleteIdentity|deleteLocation|deleteMarker|deleteMarkerLocal|deleteRange|deleteResources|deleteSite|deleteStatus|deleteTeam|deleteVehicle|deleteVehicleCrew|deleteWaypoint|detach|detectedMines|diag_activeMissionFSMs|diag_activeScripts|diag_activeSQFScripts|diag_activeSQSScripts|diag_captureFrame|diag_captureFrameToFile|diag_captureSlowFrame|diag_codePerformance|diag_drawMode|diag_dynamicSimulationEnd|diag_enable|diag_enabled|diag_fps|diag_fpsMin|diag_frameNo|diag_lightNewLoad|diag_list|diag_log|diag_logSlowFrame|diag_mergeConfigFile|diag_recordTurretLimits|diag_setLightNew|diag_tickTime|diag_toggle|dialog|diarySubjectExists|didJIP|didJIPOwner|difficulty|difficultyEnabled|difficultyEnabledRTD|difficultyOption|direction|directSay|disableAI|disableCollisionWith|disableConversation|disableDebriefingStats|disableMapIndicators|disableNVGEquipment|disableRemoteSensors|disableSerialization|disableTIEquipment|disableUAVConnectability|disableUserInput|displayAddEventHandler|displayCtrl|displayNull|displayParent|displayRemoveAllEventHandlers|displayRemoveEventHandler|displaySetEventHandler|dissolveTeam|distance|distance2D|distanceSqr|distributionRegion|do3DENAction|doArtilleryFire|doFire|doFollow|doFSM|doGetOut|doMove|doorPhase|doStop|doSuppressiveFire|doTarget|doWatch|drawArrow|drawEllipse|drawIcon|drawIcon3D|drawLine|drawLine3D|drawLink|drawLocation|drawPolygon|drawRectangle|drawTriangle|driver|drop|dynamicSimulationDistance|dynamicSimulationDistanceCoef|dynamicSimulationEnabled|dynamicSimulationSystemEnabled|east|edit3DENMissionAttributes|editObject|editorSetEventHandler|effectiveCommander|emptyPositions|enableAI|enableAIFeature|enableAimPrecision|enableAttack|enableAudioFeature|enableAutoStartUpRTD|enableAutoTrimRTD|enableCamShake|enableCaustics|enableChannel|enableCollisionWith|enableCopilot|enableDebriefingStats|enableDiagLegend|enableDynamicSimulation|enableDynamicSimulationSystem|enableEndDialog|enableEngineArtillery|enableEnvironment|enableFatigue|enableGunLights|enableInfoPanelComponent|enableIRLasers|enableMimics|enablePersonTurret|enableRadio|enableReload|enableRopeAttach|enableSatNormalOnDetail|enableSaving|enableSentences|enableSimulation|enableSimulationGlobal|enableStamina|enableStressDamage|enableTeamSwitch|enableTraffic|enableUAVConnectability|enableUAVWaypoints|enableVehicleCargo|enableVehicleSensor|enableWeaponDisassembly|endl|endLoadingScreen|endMission|engineOn|enginesIsOnRTD|enginesPowerRTD|enginesRpmRTD|enginesTorqueRTD|entities|environmentEnabled|estimatedEndServerTime|estimatedTimeLeft|evalObjectArgument|everyBackpack|everyContainer|exec|execEditorScript|exp|expectedDestination|exportJIPMessages|eyeDirection|eyePos|face|faction|fadeMusic|fadeRadio|fadeSound|fadeSpeech|failMission|fillWeaponsFromPool|find|findCover|findDisplay|findEditorObject|findEmptyPosition|findEmptyPositionReady|findIf|findNearestEnemy|finishMissionInit|finite|fire|fireAtTarget|firstBackpack|flag|flagAnimationPhase|flagOwner|flagSide|flagTexture|fleeing|floor|flyInHeight|flyInHeightASL|fog|fogForecast|fogParams|forceAddUniform|forceAtPositionRTD|forcedMap|forceEnd|forceFlagTexture|forceFollowRoad|forceGeneratorRTD|forceMap|forceRespawn|forceSpeed|forceWalk|forceWeaponFire|forceWeatherChange|forgetTarget|format|formation|formationDirection|formationLeader|formationMembers|formationPosition|formationTask|formatText|formLeader|freeLook|fromEditor|fuel|fullCrew|gearIDCAmmoCount|gearSlotAmmoCount|gearSlotData|get3DENActionState|get3DENAttribute|get3DENCamera|get3DENConnections|get3DENEntity|get3DENEntityID|get3DENGrid|get3DENIconsVisible|get3DENLayerEntities|get3DENLinesVisible|get3DENMissionAttribute|get3DENMouseOver|get3DENSelected|getAimingCoef|getAllEnvSoundControllers|getAllHitPointsDamage|getAllOwnedMines|getAllSoundControllers|getAmmoCargo|getAnimAimPrecision|getAnimSpeedCoef|getArray|getArtilleryAmmo|getArtilleryComputerSettings|getArtilleryETA|getAssignedCuratorLogic|getAssignedCuratorUnit|getBackpackCargo|getBleedingRemaining|getBurningValue|getCameraViewDirection|getCargoIndex|getCenterOfMass|getClientState|getClientStateNumber|getCompatiblePylonMagazines|getConnectedUAV|getContainerMaxLoad|getCursorObjectParams|getCustomAimCoef|getDammage|getDescription|getDir|getDirVisual|getDLCAssetsUsage|getDLCAssetsUsageByName|getDLCs|getDLCUsageTime|getEditorCamera|getEditorMode|getEditorObjectScope|getElevationOffset|getEngineTargetRpmRTD|getEnvSoundController|getFatigue|getFieldManualStartPage|getForcedFlagTexture|getFriend|getFSMVariable|getFuelCargo|getGroupIcon|getGroupIconParams|getGroupIcons|getHideFrom|getHit|getHitIndex|getHitPointDamage|getItemCargo|getMagazineCargo|getMarkerColor|getMarkerPos|getMarkerSize|getMarkerType|getMass|getMissionConfig|getMissionConfigValue|getMissionDLCs|getMissionLayerEntities|getMissionLayers|getModelInfo|getMousePosition|getMusicPlayedTime|getNumber|getObjectArgument|getObjectChildren|getObjectDLC|getObjectMaterials|getObjectProxy|getObjectTextures|getObjectType|getObjectViewDistance|getOxygenRemaining|getPersonUsedDLCs|getPilotCameraDirection|getPilotCameraPosition|getPilotCameraRotation|getPilotCameraTarget|getPlateNumber|getPlayerChannel|getPlayerScores|getPlayerUID|getPlayerUIDOld|getPos|getPosASL|getPosASLVisual|getPosASLW|getPosATL|getPosATLVisual|getPosVisual|getPosWorld|getPylonMagazines|getRelDir|getRelPos|getRemoteSensorsDisabled|getRepairCargo|getResolution|getRotorBrakeRTD|getShadowDistance|getShotParents|getSlingLoad|getSoundController|getSoundControllerResult|getSpeed|getStamina|getStatValue|getSuppression|getTerrainGrid|getTerrainHeightASL|getText|getTotalDLCUsageTime|getTrimOffsetRTD|getUnitLoadout|getUnitTrait|getUserMFDText|getUserMFDValue|getVariable|getVehicleCargo|getWeaponCargo|getWeaponSway|getWingsOrientationRTD|getWingsPositionRTD|getWPPos|glanceAt|globalChat|globalRadio|goggles|group|groupChat|groupFromNetId|groupIconSelectable|groupIconsVisible|groupId|groupOwner|groupRadio|groupSelectedUnits|groupSelectUnit|grpNull|gunner|gusts|halt|handgunItems|handgunMagazine|handgunWeapon|handsHit|hasInterface|hasPilotCamera|hasWeapon|hcAllGroups|hcGroupParams|hcLeader|hcRemoveAllGroups|hcRemoveGroup|hcSelected|hcSelectGroup|hcSetGroup|hcShowBar|hcShownBar|headgear|hideBody|hideObject|hideObjectGlobal|hideSelection|hint|hintC|hintCadet|hintSilent|hmd|hostMission|htmlLoad|HUDMovementLevels|humidity|image|importAllGroups|importance|in|inArea|inAreaArray|incapacitatedState|independent|inflame|inflamed|infoPanel|infoPanelComponentEnabled|infoPanelComponents|infoPanels|inGameUISetEventHandler|inheritsFrom|initAmbientLife|inPolygon|inputAction|inRangeOfArtillery|insertEditorObject|intersect|is3DEN|is3DENMultiplayer|isAbleToBreathe|isAgent|isAimPrecisionEnabled|isArray|isAutoHoverOn|isAutonomous|isAutoStartUpEnabledRTD|isAutotest|isAutoTrimOnRTD|isBleeding|isBurning|isClass|isCollisionLightOn|isCopilotEnabled|isDamageAllowed|isDedicated|isDLCAvailable|isEngineOn|isEqualTo|isEqualType|isEqualTypeAll|isEqualTypeAny|isEqualTypeArray|isEqualTypeParams|isFilePatchingEnabled|isFlashlightOn|isFlatEmpty|isForcedWalk|isFormationLeader|isGroupDeletedWhenEmpty|isHidden|isInRemainsCollector|isInstructorFigureEnabled|isIRLaserOn|isKeyActive|isKindOf|isLaserOn|isLightOn|isLocalized|isManualFire|isMarkedForCollection|isMultiplayer|isMultiplayerSolo|isNil|isNull|isNumber|isObjectHidden|isObjectRTD|isOnRoad|isPipEnabled|isPlayer|isRealTime|isRemoteExecuted|isRemoteExecutedJIP|isServer|isShowing3DIcons|isSimpleObject|isSprintAllowed|isStaminaEnabled|isSteamMission|isStreamFriendlyUIEnabled|isStressDamageEnabled|isText|isTouchingGround|isTurnedOut|isTutHintsEnabled|isUAVConnectable|isUAVConnected|isUIContext|isUniformAllowed|isVehicleCargo|isVehicleRadarOn|isVehicleSensorEnabled|isWalking|isWeaponDeployed|isWeaponRested|itemCargo|items|itemsWithMagazines|join|joinAs|joinAsSilent|joinSilent|joinString|kbAddDatabase|kbAddDatabaseTargets|kbAddTopic|kbHasTopic|kbReact|kbRemoveTopic|kbTell|kbWasSaid|keyImage|keyName|knowsAbout|land|landAt|landResult|language|laserTarget|lbAdd|lbClear|lbColor|lbColorRight|lbCurSel|lbData|lbDelete|lbIsSelected|lbPicture|lbPictureRight|lbSelection|lbSetColor|lbSetColorRight|lbSetCurSel|lbSetData|lbSetPicture|lbSetPictureColor|lbSetPictureColorDisabled|lbSetPictureColorSelected|lbSetPictureRight|lbSetPictureRightColor|lbSetPictureRightColorDisabled|lbSetPictureRightColorSelected|lbSetSelectColor|lbSetSelectColorRight|lbSetSelected|lbSetText|lbSetTextRight|lbSetTooltip|lbSetValue|lbSize|lbSort|lbSortByValue|lbText|lbTextRight|lbValue|leader|leaderboardDeInit|leaderboardGetRows|leaderboardInit|leaderboardRequestRowsFriends|leaderboardRequestRowsGlobal|leaderboardRequestRowsGlobalAroundUser|leaderboardsRequestUploadScore|leaderboardsRequestUploadScoreKeepBest|leaderboardState|leaveVehicle|libraryCredits|libraryDisclaimers|lifeState|lightAttachObject|lightDetachObject|lightIsOn|lightnings|limitSpeed|linearConversion|lineBreak|lineIntersects|lineIntersectsObjs|lineIntersectsSurfaces|lineIntersectsWith|linkItem|list|listObjects|listRemoteTargets|listVehicleSensors|ln|lnbAddArray|lnbAddColumn|lnbAddRow|lnbClear|lnbColor|lnbColorRight|lnbCurSelRow|lnbData|lnbDeleteColumn|lnbDeleteRow|lnbGetColumnsPosition|lnbPicture|lnbPictureRight|lnbSetColor|lnbSetColorRight|lnbSetColumnsPos|lnbSetCurSelRow|lnbSetData|lnbSetPicture|lnbSetPictureColor|lnbSetPictureColorRight|lnbSetPictureColorSelected|lnbSetPictureColorSelectedRight|lnbSetPictureRight|lnbSetText|lnbSetTextRight|lnbSetValue|lnbSize|lnbSort|lnbSortByValue|lnbText|lnbTextRight|lnbValue|load|loadAbs|loadBackpack|loadFile|loadGame|loadIdentity|loadMagazine|loadOverlay|loadStatus|loadUniform|loadVest|local|localize|locationNull|locationPosition|lock|lockCameraTo|lockCargo|lockDriver|locked|lockedCargo|lockedDriver|lockedTurret|lockIdentity|lockTurret|lockWP|log|logEntities|logNetwork|logNetworkTerminate|lookAt|lookAtPos|magazineCargo|magazines|magazinesAllTurrets|magazinesAmmo|magazinesAmmoCargo|magazinesAmmoFull|magazinesDetail|magazinesDetailBackpack|magazinesDetailUniform|magazinesDetailVest|magazinesTurret|magazineTurretAmmo|mapAnimAdd|mapAnimClear|mapAnimCommit|mapAnimDone|mapCenterOnCamera|mapGridPosition|markAsFinishedOnSteam|markerAlpha|markerBrush|markerColor|markerDir|markerPos|markerShape|markerSize|markerText|markerType|max|members|menuAction|menuAdd|menuChecked|menuClear|menuCollapse|menuData|menuDelete|menuEnable|menuEnabled|menuExpand|menuHover|menuPicture|menuSetAction|menuSetCheck|menuSetData|menuSetPicture|menuSetValue|menuShortcut|menuShortcutText|menuSize|menuSort|menuText|menuURL|menuValue|min|mineActive|mineDetectedBy|missionConfigFile|missionDifficulty|missionName|missionNamespace|missionStart|missionVersion|modelToWorld|modelToWorldVisual|modelToWorldVisualWorld|modelToWorldWorld|modParams|moonIntensity|moonPhase|morale|move|move3DENCamera|moveInAny|moveInCargo|moveInCommander|moveInDriver|moveInGunner|moveInTurret|moveObjectToEnd|moveOut|moveTime|moveTo|moveToCompleted|moveToFailed|musicVolume|name|nameSound|nearEntities|nearestBuilding|nearestLocation|nearestLocations|nearestLocationWithDubbing|nearestObject|nearestObjects|nearestTerrainObjects|nearObjects|nearObjectsReady|nearRoads|nearSupplies|nearTargets|needReload|netId|netObjNull|newOverlay|nextMenuItemIndex|nextWeatherChange|nMenuItems|numberOfEnginesRTD|numberToDate|objectCurators|objectFromNetId|objectParent|objNull|objStatus|onBriefingGear|onBriefingGroup|onBriefingNotes|onBriefingPlan|onBriefingTeamSwitch|onCommandModeChanged|onDoubleClick|onEachFrame|onGroupIconClick|onGroupIconOverEnter|onGroupIconOverLeave|onHCGroupSelectionChanged|onMapSingleClick|onPlayerConnected|onPlayerDisconnected|onPreloadFinished|onPreloadStarted|onShowNewObject|onTeamSwitch|openCuratorInterface|openDLCPage|openDSInterface|openMap|openSteamApp|openYoutubeVideo|opfor|orderGetIn|overcast|overcastForecast|owner|param|params|parseNumber|parseSimpleArray|parseText|parsingNamespace|particlesQuality|pi|pickWeaponPool|pitch|pixelGrid|pixelGridBase|pixelGridNoUIScale|pixelH|pixelW|playableSlotsNumber|playableUnits|playAction|playActionNow|player|playerRespawnTime|playerSide|playersNumber|playGesture|playMission|playMove|playMoveNow|playMusic|playScriptedMission|playSound|playSound3D|position|positionCameraToWorld|posScreenToWorld|posWorldToScreen|ppEffectAdjust|ppEffectCommit|ppEffectCommitted|ppEffectCreate|ppEffectDestroy|ppEffectEnable|ppEffectEnabled|ppEffectForceInNVG|precision|preloadCamera|preloadObject|preloadSound|preloadTitleObj|preloadTitleRsc|primaryWeapon|primaryWeaponItems|primaryWeaponMagazine|priority|processDiaryLink|processInitCommands|productVersion|profileName|profileNamespace|profileNameSteam|progressLoadingScreen|progressPosition|progressSetPosition|publicVariable|publicVariableClient|publicVariableServer|pushBack|pushBackUnique|putWeaponPool|queryItemsPool|queryMagazinePool|queryWeaponPool|rad|radioChannelAdd|radioChannelCreate|radioChannelRemove|radioChannelSetCallSign|radioChannelSetLabel|radioVolume|rain|rainbow|random|rank|rankId|rating|rectangular|registeredTasks|registerTask|reload|reloadEnabled|remoteControl|remoteExec|remoteExecCall|remoteExecutedOwner|remove3DENConnection|remove3DENEventHandler|remove3DENLayer|removeAction|removeAll3DENEventHandlers|removeAllActions|removeAllAssignedItems|removeAllContainers|removeAllCuratorAddons|removeAllCuratorCameraAreas|removeAllCuratorEditingAreas|removeAllEventHandlers|removeAllHandgunItems|removeAllItems|removeAllItemsWithMagazines|removeAllMissionEventHandlers|removeAllMPEventHandlers|removeAllMusicEventHandlers|removeAllOwnedMines|removeAllPrimaryWeaponItems|removeAllWeapons|removeBackpack|removeBackpackGlobal|removeCuratorAddons|removeCuratorCameraArea|removeCuratorEditableObjects|removeCuratorEditingArea|removeDrawIcon|removeDrawLinks|removeEventHandler|removeFromRemainsCollector|removeGoggles|removeGroupIcon|removeHandgunItem|removeHeadgear|removeItem|removeItemFromBackpack|removeItemFromUniform|removeItemFromVest|removeItems|removeMagazine|removeMagazineGlobal|removeMagazines|removeMagazinesTurret|removeMagazineTurret|removeMenuItem|removeMissionEventHandler|removeMPEventHandler|removeMusicEventHandler|removeOwnedMine|removePrimaryWeaponItem|removeSecondaryWeaponItem|removeSimpleTask|removeSwitchableUnit|removeTeamMember|removeUniform|removeVest|removeWeapon|removeWeaponAttachmentCargo|removeWeaponCargo|removeWeaponGlobal|removeWeaponTurret|reportRemoteTarget|requiredVersion|resetCamShake|resetSubgroupDirection|resistance|resize|resources|respawnVehicle|restartEditorCamera|reveal|revealMine|reverse|reversedMouseY|roadAt|roadsConnectedTo|roleDescription|ropeAttachedObjects|ropeAttachedTo|ropeAttachEnabled|ropeAttachTo|ropeCreate|ropeCut|ropeDestroy|ropeDetach|ropeEndPosition|ropeLength|ropes|ropeUnwind|ropeUnwound|rotorsForcesRTD|rotorsRpmRTD|round|runInitScript|safeZoneH|safeZoneW|safeZoneWAbs|safeZoneX|safeZoneXAbs|safeZoneY|save3DENInventory|saveGame|saveIdentity|saveJoysticks|saveOverlay|saveProfileNamespace|saveStatus|saveVar|savingEnabled|say|say2D|say3D|score|scoreSide|screenshot|screenToWorld|scriptDone|scriptName|scriptNull|scudState|secondaryWeapon|secondaryWeaponItems|secondaryWeaponMagazine|select|selectBestPlaces|selectDiarySubject|selectedEditorObjects|selectEditorObject|selectionNames|selectionPosition|selectLeader|selectMax|selectMin|selectNoPlayer|selectPlayer|selectRandom|selectRandomWeighted|selectWeapon|selectWeaponTurret|sendAUMessage|sendSimpleCommand|sendTask|sendTaskResult|sendUDPMessage|serverCommand|serverCommandAvailable|serverCommandExecutable|serverName|serverTime|set|set3DENAttribute|set3DENAttributes|set3DENGrid|set3DENIconsVisible|set3DENLayer|set3DENLinesVisible|set3DENLogicType|set3DENMissionAttribute|set3DENMissionAttributes|set3DENModelsVisible|set3DENObjectType|set3DENSelected|setAccTime|setActualCollectiveRTD|setAirplaneThrottle|setAirportSide|setAmmo|setAmmoCargo|setAmmoOnPylon|setAnimSpeedCoef|setAperture|setApertureNew|setArmoryPoints|setAttributes|setAutonomous|setBehaviour|setBleedingRemaining|setBrakesRTD|setCameraInterest|setCamShakeDefParams|setCamShakeParams|setCamUseTI|setCaptive|setCenterOfMass|setCollisionLight|setCombatMode|setCompassOscillation|setConvoySeparation|setCuratorCameraAreaCeiling|setCuratorCoef|setCuratorEditingAreaType|setCuratorWaypointCost|setCurrentChannel|setCurrentTask|setCurrentWaypoint|setCustomAimCoef|setCustomWeightRTD|setDamage|setDammage|setDate|setDebriefingText|setDefaultCamera|setDestination|setDetailMapBlendPars|setDir|setDirection|setDrawIcon|setDriveOnPath|setDropInterval|setDynamicSimulationDistance|setDynamicSimulationDistanceCoef|setEditorMode|setEditorObjectScope|setEffectCondition|setEngineRpmRTD|setFace|setFaceAnimation|setFatigue|setFeatureType|setFlagAnimationPhase|setFlagOwner|setFlagSide|setFlagTexture|setFog|setForceGeneratorRTD|setFormation|setFormationTask|setFormDir|setFriend|setFromEditor|setFSMVariable|setFuel|setFuelCargo|setGroupIcon|setGroupIconParams|setGroupIconsSelectable|setGroupIconsVisible|setGroupId|setGroupIdGlobal|setGroupOwner|setGusts|setHideBehind|setHit|setHitIndex|setHitPointDamage|setHorizonParallaxCoef|setHUDMovementLevels|setIdentity|setImportance|setInfoPanel|setLeader|setLightAmbient|setLightAttenuation|setLightBrightness|setLightColor|setLightDayLight|setLightFlareMaxDistance|setLightFlareSize|setLightIntensity|setLightnings|setLightUseFlare|setLocalWindParams|setMagazineTurretAmmo|setMarkerAlpha|setMarkerAlphaLocal|setMarkerBrush|setMarkerBrushLocal|setMarkerColor|setMarkerColorLocal|setMarkerDir|setMarkerDirLocal|setMarkerPos|setMarkerPosLocal|setMarkerShape|setMarkerShapeLocal|setMarkerSize|setMarkerSizeLocal|setMarkerText|setMarkerTextLocal|setMarkerType|setMarkerTypeLocal|setMass|setMimic|setMousePosition|setMusicEffect|setMusicEventHandler|setName|setNameSound|setObjectArguments|setObjectMaterial|setObjectMaterialGlobal|setObjectProxy|setObjectTexture|setObjectTextureGlobal|setObjectViewDistance|setOvercast|setOwner|setOxygenRemaining|setParticleCircle|setParticleClass|setParticleFire|setParticleParams|setParticleRandom|setPilotCameraDirection|setPilotCameraRotation|setPilotCameraTarget|setPilotLight|setPiPEffect|setPitch|setPlateNumber|setPlayable|setPlayerRespawnTime|setPos|setPosASL|setPosASL2|setPosASLW|setPosATL|setPosition|setPosWorld|setPylonLoadOut|setPylonsPriority|setRadioMsg|setRain|setRainbow|setRandomLip|setRank|setRectangular|setRepairCargo|setRotorBrakeRTD|setShadowDistance|setShotParents|setSide|setSimpleTaskAlwaysVisible|setSimpleTaskCustomData|setSimpleTaskDescription|setSimpleTaskDestination|setSimpleTaskTarget|setSimpleTaskType|setSimulWeatherLayers|setSize|setSkill|setSlingLoad|setSoundEffect|setSpeaker|setSpeech|setSpeedMode|setStamina|setStaminaScheme|setStatValue|setSuppression|setSystemOfUnits|setTargetAge|setTaskMarkerOffset|setTaskResult|setTaskState|setTerrainGrid|setText|setTimeMultiplier|setTitleEffect|setToneMapping|setToneMappingParams|setTrafficDensity|setTrafficDistance|setTrafficGap|setTrafficSpeed|setTriggerActivation|setTriggerArea|setTriggerStatements|setTriggerText|setTriggerTimeout|setTriggerType|setType|setUnconscious|setUnitAbility|setUnitLoadout|setUnitPos|setUnitPosWeak|setUnitRank|setUnitRecoilCoefficient|setUnitTrait|setUnloadInCombat|setUserActionText|setUserMFDText|setUserMFDValue|setVariable|setVectorDir|setVectorDirAndUp|setVectorUp|setVehicleAmmo|setVehicleAmmoDef|setVehicleArmor|setVehicleCargo|setVehicleId|setVehicleInit|setVehicleLock|setVehiclePosition|setVehicleRadar|setVehicleReceiveRemoteTargets|setVehicleReportOwnPosition|setVehicleReportRemoteTargets|setVehicleTIPars|setVehicleVarName|setVelocity|setVelocityModelSpace|setVelocityTransformation|setViewDistance|setVisibleIfTreeCollapsed|setWantedRpmRTD|setWaves|setWaypointBehaviour|setWaypointCombatMode|setWaypointCompletionRadius|setWaypointDescription|setWaypointForceBehaviour|setWaypointFormation|setWaypointHousePosition|setWaypointLoiterRadius|setWaypointLoiterType|setWaypointName|setWaypointPosition|setWaypointScript|setWaypointSpeed|setWaypointStatements|setWaypointTimeout|setWaypointType|setWaypointVisible|setWeaponReloadingTime|setWind|setWindDir|setWindForce|setWindStr|setWingForceScaleRTD|setWPPos|show3DIcons|showChat|showCinemaBorder|showCommandingMenu|showCompass|showCuratorCompass|showGPS|showHUD|showLegend|showMap|shownArtilleryComputer|shownChat|shownCompass|shownCuratorCompass|showNewEditorObject|shownGPS|shownHUD|shownMap|shownPad|shownRadio|shownScoretable|shownUAVFeed|shownWarrant|shownWatch|showPad|showRadio|showScoretable|showSubtitles|showUAVFeed|showWarrant|showWatch|showWaypoint|showWaypoints|side|sideAmbientLife|sideChat|sideEmpty|sideEnemy|sideFriendly|sideLogic|sideRadio|sideUnknown|simpleTasks|simulationEnabled|simulCloudDensity|simulCloudOcclusion|simulInClouds|simulWeatherSync|sin|size|sizeOf|skill|skillFinal|skipTime|sleep|sliderPosition|sliderRange|sliderSetPosition|sliderSetRange|sliderSetSpeed|sliderSpeed|slingLoadAssistantShown|soldierMagazines|someAmmo|sort|soundVolume|speaker|speed|speedMode|splitString|sqrt|squadParams|stance|startLoadingScreen|stop|stopEngineRTD|stopped|str|sunOrMoon|supportInfo|suppressFor|surfaceIsWater|surfaceNormal|surfaceType|swimInDepth|switchableUnits|switchAction|switchCamera|switchGesture|switchLight|switchMove|synchronizedObjects|synchronizedTriggers|synchronizedWaypoints|synchronizeObjectsAdd|synchronizeObjectsRemove|synchronizeTrigger|synchronizeWaypoint|systemChat|systemOfUnits|tan|targetKnowledge|targets|targetsAggregate|targetsQuery|taskAlwaysVisible|taskChildren|taskCompleted|taskCustomData|taskDescription|taskDestination|taskHint|taskMarkerOffset|taskNull|taskParent|taskResult|taskState|taskType|teamMember|teamMemberNull|teamName|teams|teamSwitch|teamSwitchEnabled|teamType|terminate|terrainIntersect|terrainIntersectASL|terrainIntersectAtASL|text|textLog|textLogFormat|tg|time|timeMultiplier|titleCut|titleFadeOut|titleObj|titleRsc|titleText|toArray|toFixed|toLower|toString|toUpper|triggerActivated|triggerActivation|triggerArea|triggerAttachedVehicle|triggerAttachObject|triggerAttachVehicle|triggerDynamicSimulation|triggerStatements|triggerText|triggerTimeout|triggerTimeoutCurrent|triggerType|turretLocal|turretOwner|turretUnit|tvAdd|tvClear|tvCollapse|tvCollapseAll|tvCount|tvCurSel|tvData|tvDelete|tvExpand|tvExpandAll|tvPicture|tvPictureRight|tvSetColor|tvSetCurSel|tvSetData|tvSetPicture|tvSetPictureColor|tvSetPictureColorDisabled|tvSetPictureColorSelected|tvSetPictureRight|tvSetPictureRightColor|tvSetPictureRightColorDisabled|tvSetPictureRightColorSelected|tvSetSelectColor|tvSetText|tvSetTooltip|tvSetValue|tvSort|tvSortByValue|tvText|tvTooltip|tvValue|type|typeName|typeOf|UAVControl|uiNamespace|uiSleep|unassignCurator|unassignItem|unassignTeam|unassignVehicle|underwater|uniform|uniformContainer|uniformItems|uniformMagazines|unitAddons|unitAimPosition|unitAimPositionVisual|unitBackpack|unitIsUAV|unitPos|unitReady|unitRecoilCoefficient|units|unitsBelowHeight|unlinkItem|unlockAchievement|unregisterTask|updateDrawIcon|updateMenuItem|updateObjectTree|useAIOperMapObstructionTest|useAISteeringComponent|useAudioTimeForMoves|userInputDisabled|vectorAdd|vectorCos|vectorCrossProduct|vectorDiff|vectorDir|vectorDirVisual|vectorDistance|vectorDistanceSqr|vectorDotProduct|vectorFromTo|vectorMagnitude|vectorMagnitudeSqr|vectorModelToWorld|vectorModelToWorldVisual|vectorMultiply|vectorNormalized|vectorUp|vectorUpVisual|vectorWorldToModel|vectorWorldToModelVisual|vehicle|vehicleCargoEnabled|vehicleChat|vehicleRadio|vehicleReceiveRemoteTargets|vehicleReportOwnPosition|vehicleReportRemoteTargets|vehicles|vehicleVarName|velocity|velocityModelSpace|verifySignature|vest|vestContainer|vestItems|vestMagazines|viewDistance|visibleCompass|visibleGPS|visibleMap|visiblePosition|visiblePositionASL|visibleScoretable|visibleWatch|waitUntil|waves|waypointAttachedObject|waypointAttachedVehicle|waypointAttachObject|waypointAttachVehicle|waypointBehaviour|waypointCombatMode|waypointCompletionRadius|waypointDescription|waypointForceBehaviour|waypointFormation|waypointHousePosition|waypointLoiterRadius|waypointLoiterType|waypointName|waypointPosition|waypoints|waypointScript|waypointsEnabledUAV|waypointShow|waypointSpeed|waypointStatements|waypointTimeout|waypointTimeoutCurrent|waypointType|waypointVisible|weaponAccessories|weaponAccessoriesCargo|weaponCargo|weaponDirection|weaponInertia|weaponLowered|weapons|weaponsItems|weaponsItemsCargo|weaponState|weaponsTurret|weightRTD|west|WFSideText|wind|windDir|windRTD|windStr|wingsForcesRTD|worldName|worldSize|worldToModel|worldToModelVisual|worldToScreen)\b/i,number:/(?:\$|\b0x)[\da-f]+\b|(?:\B\.\d+|\b\d+(?:\.\d+)?)(?:e[+-]?\d+)?\b/i,operator:/##|>>|&&|\|\||[!=<>]=?|[-+*/%#^]|\b(?:and|mod|not|or)\b/i,"magic-variable":{pattern:/\b(?:_exception|_fnc_scriptName|_fnc_scriptNameParent|_forEachIndex|_this|_thisEventHandler|_thisFSM|_thisScript|_x|this|thisList|thisTrigger)\b/i,alias:"keyword"},constant:/\bDIK(?:_[a-z\d]+)+\b/i}),e.languages.insertBefore("sqf","string",{macro:{pattern:/(^[ \t]*)#[a-z](?:[^\r\n\\]|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{directive:{pattern:/#[a-z]+\b/i,alias:"keyword"},comment:e.languages.sqf.comment}}}),delete e.languages.sqf["class-name"]}e.exports=t,t.displayName="sqf",t.aliases=[]},11114(e){"use strict";function t(e){e.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:_INSERT|COL)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:S|ING)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:TRUE|FALSE|NULL)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|IN|ILIKE|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/}}e.exports=t,t.displayName="sql",t.aliases=[]},67386(e){"use strict";function t(e){e.languages.squirrel=e.languages.extend("clike",{comment:[e.languages.clike.comment[0],{pattern:/(^|[^\\:])(?:\/\/|#).*/,lookbehind:!0,greedy:!0}],string:[{pattern:/(^|[^\\"'@])(?:@"(?:[^"]|"")*"(?!")|"(?:[^\\\r\n"]|\\.)*")/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\"'])'(?:[^\\']|\\(?:[xuU][0-9a-fA-F]{0,8}|[\s\S]))'/,lookbehind:!0,greedy:!0}],"class-name":{pattern:/(\b(?:class|enum|extends|instanceof)\s+)\w+(?:\.\w+)*/,lookbehind:!0,inside:{punctuation:/\./}},keyword:/\b(?:base|break|case|catch|class|clone|const|constructor|continue|default|delete|else|enum|extends|for|foreach|function|if|in|instanceof|local|null|resume|return|static|switch|this|throw|try|typeof|while|yield|__LINE__|__FILE__)\b/,number:/\b(?:0x[0-9a-fA-F]+|\d+(?:\.(?:\d+|[eE][+-]?\d+))?)\b/,operator:/\+\+|--|<=>|<[-<]|>>>?|&&?|\|\|?|[-+*/%!=<>]=?|[~^]|::?/,punctuation:/[(){}\[\],;.]/}),e.languages.insertBefore("squirrel","operator",{"attribute-punctuation":{pattern:/<\/|\/>/,alias:"important"},lambda:{pattern:/@(?=\()/,alias:"operator"}})}e.exports=t,t.displayName="squirrel",t.aliases=[]},28067(e){"use strict";function t(e){e.languages.stan={comment:/\/\/.*|\/\*[\s\S]*?\*\/|#(?!include).*/,string:{pattern:/"[\x20\x21\x23-\x5B\x5D-\x7E]*"/,greedy:!0},directive:{pattern:/^([ \t]*)#include\b.*/m,lookbehind:!0,alias:"property"},"function-arg":{pattern:/(\b(?:algebra_solver|integrate_1d|integrate_ode|integrate_ode_bdf|integrate_ode_rk45|map_rect)\s*\(\s*)[a-zA-Z]\w*/,lookbehind:!0,alias:"function"},constraint:{pattern:/(\b(?:int|matrix|real|row_vector|vector)\s*)<[^<>]*>/,lookbehind:!0,inside:{expression:{pattern:/(=\s*)\S(?:\S|\s+(?!\s))*?(?=\s*(?:>$|,\s*\w+\s*=))/,lookbehind:!0,inside:null},property:/\b[a-z]\w*(?=\s*=)/i,operator:/=/,punctuation:/^<|>$|,/}},keyword:[/\b(?:break|cholesky_factor_corr|cholesky_factor_cov|continue|corr_matrix|cov_matrix|data|else|for|functions|generated|if|in|increment_log_prob|int|matrix|model|ordered|parameters|positive_ordered|print|quantities|real|reject|return|row_vector|simplex|target|transformed|unit_vector|vector|void|while)\b/,/\b(?:algebra_solver|integrate_1d|integrate_ode|integrate_ode_bdf|integrate_ode_rk45|map_rect)\b/],function:/\b[a-z]\w*(?=\s*\()/i,number:/(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:E[+-]?\d+)?\b/i,boolean:/\b(?:false|true)\b/,operator:/<-|\.[*/]=?|\|\|?|&&|[!=<>+\-*/]=?|['^%~?:]/,punctuation:/[()\[\]{},;]/},e.languages.stan.constraint.inside.expression.inside=e.languages.stan}e.exports=t,t.displayName="stan",t.aliases=[]},49168(e){"use strict";function t(e){var t,n,r,i;t=e,(i={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,lookbehind:!0},url:{pattern:/\burl\((["']?).*?\1\)/i,greedy:!0},string:{pattern:/("|')(?:(?!\1)[^\\\r\n]|\\(?:\r\n|[\s\S]))*\1/,greedy:!0},interpolation:null,func:null,important:/\B!(?:important|optional)\b/i,keyword:{pattern:/(^|\s+)(?:(?:if|else|for|return|unless)(?=\s|$)|@[\w-]+)/,lookbehind:!0},hexcode:/#[\da-f]{3,6}/i,color:[/\b(?:AliceBlue|AntiqueWhite|Aqua|Aquamarine|Azure|Beige|Bisque|Black|BlanchedAlmond|Blue|BlueViolet|Brown|BurlyWood|CadetBlue|Chartreuse|Chocolate|Coral|CornflowerBlue|Cornsilk|Crimson|Cyan|DarkBlue|DarkCyan|DarkGoldenRod|DarkGr[ae]y|DarkGreen|DarkKhaki|DarkMagenta|DarkOliveGreen|DarkOrange|DarkOrchid|DarkRed|DarkSalmon|DarkSeaGreen|DarkSlateBlue|DarkSlateGr[ae]y|DarkTurquoise|DarkViolet|DeepPink|DeepSkyBlue|DimGr[ae]y|DodgerBlue|FireBrick|FloralWhite|ForestGreen|Fuchsia|Gainsboro|GhostWhite|Gold|GoldenRod|Gr[ae]y|Green|GreenYellow|HoneyDew|HotPink|IndianRed|Indigo|Ivory|Khaki|Lavender|LavenderBlush|LawnGreen|LemonChiffon|LightBlue|LightCoral|LightCyan|LightGoldenRodYellow|LightGr[ae]y|LightGreen|LightPink|LightSalmon|LightSeaGreen|LightSkyBlue|LightSlateGr[ae]y|LightSteelBlue|LightYellow|Lime|LimeGreen|Linen|Magenta|Maroon|MediumAquaMarine|MediumBlue|MediumOrchid|MediumPurple|MediumSeaGreen|MediumSlateBlue|MediumSpringGreen|MediumTurquoise|MediumVioletRed|MidnightBlue|MintCream|MistyRose|Moccasin|NavajoWhite|Navy|OldLace|Olive|OliveDrab|Orange|OrangeRed|Orchid|PaleGoldenRod|PaleGreen|PaleTurquoise|PaleVioletRed|PapayaWhip|PeachPuff|Peru|Pink|Plum|PowderBlue|Purple|Red|RosyBrown|RoyalBlue|SaddleBrown|Salmon|SandyBrown|SeaGreen|SeaShell|Sienna|Silver|SkyBlue|SlateBlue|SlateGr[ae]y|Snow|SpringGreen|SteelBlue|Tan|Teal|Thistle|Tomato|Transparent|Turquoise|Violet|Wheat|White|WhiteSmoke|Yellow|YellowGreen)\b/i,{pattern:/\b(?:rgb|hsl)\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*\)\B|\b(?:rgb|hsl)a\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*,\s*(?:0|0?\.\d+|1)\s*\)\B/i,inside:{unit:n={pattern:/(\b\d+)(?:%|[a-z]+)/,lookbehind:!0},number:r={pattern:/(^|[^\w.-])-?(?:\d+(?:\.\d+)?|\.\d+)/,lookbehind:!0},function:/[\w-]+(?=\()/,punctuation:/[(),]/}}],entity:/\\[\da-f]{1,8}/i,unit:n,boolean:/\b(?:true|false)\b/,operator:[/~|[+!\/%<>?=]=?|[-:]=|\*[*=]?|\.{2,3}|&&|\|\||\B-\B|\b(?:and|in|is(?: a| defined| not|nt)?|not|or)\b/],number:r,punctuation:/[{}()\[\];:,]/}).interpolation={pattern:/\{[^\r\n}:]+\}/,alias:"variable",inside:{delimiter:{pattern:/^\{|\}$/,alias:"punctuation"},rest:i}},i.func={pattern:/[\w-]+\([^)]*\).*/,inside:{function:/^[^(]+/,rest:i}},t.languages.stylus={"atrule-declaration":{pattern:/(^[ \t]*)@.+/m,lookbehind:!0,inside:{atrule:/^@[\w-]+/,rest:i}},"variable-declaration":{pattern:/(^[ \t]*)[\w$-]+\s*.?=[ \t]*(?:\{[^{}]*\}|\S.*|$)/m,lookbehind:!0,inside:{variable:/^\S+/,rest:i}},statement:{pattern:/(^[ \t]*)(?:if|else|for|return|unless)[ \t].+/m,lookbehind:!0,inside:{keyword:/^\S+/,rest:i}},"property-declaration":{pattern:/((?:^|\{)([ \t]*))(?:[\w-]|\{[^}\r\n]+\})+(?:\s*:\s*|[ \t]+)(?!\s)[^{\r\n]*(?:;|[^{\r\n,]$(?!(?:\r?\n|\r)(?:\{|\2[ \t])))/m,lookbehind:!0,inside:{property:{pattern:/^[^\s:]+/,inside:{interpolation:i.interpolation}},rest:i}},selector:{pattern:/(^[ \t]*)(?:(?=\S)(?:[^{}\r\n:()]|::?[\w-]+(?:\([^)\r\n]*\)|(?![\w-]))|\{[^}\r\n]+\})+)(?:(?:\r?\n|\r)(?:\1(?:(?=\S)(?:[^{}\r\n:()]|::?[\w-]+(?:\([^)\r\n]*\)|(?![\w-]))|\{[^}\r\n]+\})+)))*(?:,$|\{|(?=(?:\r?\n|\r)(?:\{|\1[ \t])))/m,lookbehind:!0,inside:{interpolation:i.interpolation,comment:i.comment,punctuation:/[{},]/}},func:i.func,string:i.string,comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,lookbehind:!0,greedy:!0},interpolation:i.interpolation,punctuation:/[{}()\[\];:.]/}}e.exports=t,t.displayName="stylus",t.aliases=[]},23651(e){"use strict";function t(e){e.languages.swift=e.languages.extend("clike",{string:{pattern:/("|')(?:\\(?:\((?:[^()]|\([^)]+\))+\)|\r\n|[^(])|(?!\1)[^\\\r\n])*\1/,greedy:!0,inside:{interpolation:{pattern:/\\\((?:[^()]|\([^)]+\))+\)/,inside:{delimiter:{pattern:/^\\\(|\)$/,alias:"variable"}}}}},keyword:/\b(?:as|associativity|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic(?:Type)?|else|enum|extension|fallthrough|final|for|func|get|guard|if|import|in|infix|init|inout|internal|is|lazy|left|let|mutating|new|none|nonmutating|operator|optional|override|postfix|precedence|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|Self|set|some|static|struct|subscript|super|switch|throws?|try|Type|typealias|unowned|unsafe|var|weak|where|while|willSet|__(?:COLUMN__|FILE__|FUNCTION__|LINE__))\b/,number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,constant:/\b(?:nil|[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,atrule:/@\b(?:IB(?:Outlet|Designable|Action|Inspectable)|class_protocol|exported|noreturn|NS(?:Copying|Managed)|objc|UIApplicationMain|auto_closure)\b/,builtin:/\b(?:[A-Z]\S+|abs|advance|alignof(?:Value)?|assert|contains|count(?:Elements)?|debugPrint(?:ln)?|distance|drop(?:First|Last)|dump|enumerate|equal|filter|find|first|getVaList|indices|isEmpty|join|last|lexicographicalCompare|map|max(?:Element)?|min(?:Element)?|numericCast|overlaps|partition|print(?:ln)?|reduce|reflect|reverse|sizeof(?:Value)?|sort(?:ed)?|split|startsWith|stride(?:of(?:Value)?)?|suffix|swap|toDebugString|toString|transcode|underestimateCount|unsafeBitCast|with(?:ExtendedLifetime|Unsafe(?:MutablePointers?|Pointers?)|VaList))\b/}),e.languages.swift.string.inside.interpolation.inside.rest=e.languages.swift}e.exports=t,t.displayName="swift",t.aliases=[]},32268(e,t,n){"use strict";var r=n(2329),i=n(61958);function a(e){e.register(r),e.register(i),e.languages.t4=e.languages["t4-cs"]=e.languages["t4-templating"].createT4("csharp")}e.exports=a,a.displayName="t4Cs",a.aliases=[]},2329(e){"use strict";function t(e){!function(e){function t(e,t,n){return{pattern:RegExp("<#"+e+"[\\s\\S]*?#>"),alias:"block",inside:{delimiter:{pattern:RegExp("^<#"+e+"|#>$"),alias:"important"},content:{pattern:/[\s\S]+/,inside:t,alias:n}}}}function n(n){var r=e.languages[n],i="language-"+n;return{block:{pattern:/<#[\s\S]+?#>/,inside:{directive:t("@",{"attr-value":{pattern:/=(?:("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|[^\s'">=]+)/,inside:{punctuation:/^=|^["']|["']$/}},keyword:/\b\w+(?=\s)/,"attr-name":/\b\w+/}),expression:t("=",r,i),"class-feature":t("\\+",r,i),standard:t("",r,i)}}}}e.languages["t4-templating"]=Object.defineProperty({},"createT4",{value:n})}(e)}e.exports=t,t.displayName="t4Templating",t.aliases=[]},82996(e,t,n){"use strict";var r=n(2329),i=n(53813);function a(e){e.register(r),e.register(i),e.languages["t4-vb"]=e.languages["t4-templating"].createT4("vbnet")}e.exports=a,a.displayName="t4Vb",a.aliases=[]},17290(e,t,n){"use strict";var r=n(65039);function i(e){e.register(r),e.languages.tap={fail:/not ok[^#{\n\r]*/,pass:/ok[^#{\n\r]*/,pragma:/pragma [+-][a-z]+/,bailout:/bail out!.*/i,version:/TAP version \d+/i,plan:/\b\d+\.\.\d+(?: +#.*)?/,subtest:{pattern:/# Subtest(?:: .*)?/,greedy:!0},punctuation:/[{}]/,directive:/#.*/,yamlish:{pattern:/(^[ \t]*)---[\s\S]*?[\r\n][ \t]*\.\.\.$/m,lookbehind:!0,inside:e.languages.yaml,alias:"language-yaml"}}}e.exports=i,i.displayName="tap",i.aliases=[]},67989(e){"use strict";function t(e){e.languages.tcl={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0},string:{pattern:/"(?:[^"\\\r\n]|\\(?:\r\n|[\s\S]))*"/,greedy:!0},variable:[{pattern:/(\$)(?:::)?(?:[a-zA-Z0-9]+::)*\w+/,lookbehind:!0},{pattern:/(\$)\{[^}]+\}/,lookbehind:!0},{pattern:/(^[\t ]*set[ \t]+)(?:::)?(?:[a-zA-Z0-9]+::)*\w+/m,lookbehind:!0}],function:{pattern:/(^[\t ]*proc[ \t]+)\S+/m,lookbehind:!0},builtin:[{pattern:/(^[\t ]*)(?:proc|return|class|error|eval|exit|for|foreach|if|switch|while|break|continue)\b/m,lookbehind:!0},/\b(?:elseif|else)\b/],scope:{pattern:/(^[\t ]*)(?:global|upvar|variable)\b/m,lookbehind:!0,alias:"constant"},keyword:{pattern:/(^[\t ]*|\[)(?:after|append|apply|array|auto_(?:execok|import|load|mkindex|qualify|reset)|automkindex_old|bgerror|binary|catch|cd|chan|clock|close|concat|dde|dict|encoding|eof|exec|expr|fblocked|fconfigure|fcopy|file(?:event|name)?|flush|gets|glob|history|http|incr|info|interp|join|lappend|lassign|lindex|linsert|list|llength|load|lrange|lrepeat|lreplace|lreverse|lsearch|lset|lsort|math(?:func|op)|memory|msgcat|namespace|open|package|parray|pid|pkg_mkIndex|platform|puts|pwd|re_syntax|read|refchan|regexp|registry|regsub|rename|Safe_Base|scan|seek|set|socket|source|split|string|subst|Tcl|tcl(?:_endOfWord|_findLibrary|startOf(?:Next|Previous)Word|wordBreak(?:After|Before)|test|vars)|tell|time|tm|trace|unknown|unload|unset|update|uplevel|vwait)\b/m,lookbehind:!0},operator:/!=?|\*\*?|==|&&?|\|\|?|<[=<]?|>[=>]?|[-+~\/%?^]|\b(?:eq|ne|in|ni)\b/,punctuation:/[{}()\[\]]/}}e.exports=t,t.displayName="tcl",t.aliases=[]},31065(e){"use strict";function t(e){!function(e){var t=/\([^|()\n]+\)|\[[^\]\n]+\]|\{[^}\n]+\}/.source,n=/\)|\((?![^|()\n]+\))/.source;function r(e,r){return RegExp(e.replace(//g,function(){return"(?:"+t+")"}).replace(//g,function(){return"(?:"+n+")"}),r||"")}var i={css:{pattern:/\{[^{}]+\}/,inside:{rest:e.languages.css}},"class-id":{pattern:/(\()[^()]+(?=\))/,lookbehind:!0,alias:"attr-value"},lang:{pattern:/(\[)[^\[\]]+(?=\])/,lookbehind:!0,alias:"attr-value"},punctuation:/[\\\/]\d+|\S/},a=e.languages.textile=e.languages.extend("markup",{phrase:{pattern:/(^|\r|\n)\S[\s\S]*?(?=$|\r?\n\r?\n|\r\r)/,lookbehind:!0,inside:{"block-tag":{pattern:r(/^[a-z]\w*(?:||[<>=])*\./.source),inside:{modifier:{pattern:r(/(^[a-z]\w*)(?:||[<>=])+(?=\.)/.source),lookbehind:!0,inside:i},tag:/^[a-z]\w*/,punctuation:/\.$/}},list:{pattern:r(/^[*#]+*\s+\S.*/.source,"m"),inside:{modifier:{pattern:r(/(^[*#]+)+/.source),lookbehind:!0,inside:i},punctuation:/^[*#]+/}},table:{pattern:r(/^(?:(?:||[<>=^~])+\.\s*)?(?:\|(?:(?:||[<>=^~_]|[\\/]\d+)+\.|(?!(?:||[<>=^~_]|[\\/]\d+)+\.))[^|]*)+\|/.source,"m"),inside:{modifier:{pattern:r(/(^|\|(?:\r?\n|\r)?)(?:||[<>=^~_]|[\\/]\d+)+(?=\.)/.source),lookbehind:!0,inside:i},punctuation:/\||^\./}},inline:{pattern:r(/(^|[^a-zA-Z\d])(\*\*|__|\?\?|[*_%@+\-^~])*.+?\2(?![a-zA-Z\d])/.source),lookbehind:!0,inside:{bold:{pattern:r(/(^(\*\*?)*).+?(?=\2)/.source),lookbehind:!0},italic:{pattern:r(/(^(__?)*).+?(?=\2)/.source),lookbehind:!0},cite:{pattern:r(/(^\?\?*).+?(?=\?\?)/.source),lookbehind:!0,alias:"string"},code:{pattern:r(/(^@*).+?(?=@)/.source),lookbehind:!0,alias:"keyword"},inserted:{pattern:r(/(^\+*).+?(?=\+)/.source),lookbehind:!0},deleted:{pattern:r(/(^-*).+?(?=-)/.source),lookbehind:!0},span:{pattern:r(/(^%*).+?(?=%)/.source),lookbehind:!0},modifier:{pattern:r(/(^\*\*|__|\?\?|[*_%@+\-^~])+/.source),lookbehind:!0,inside:i},punctuation:/[*_%?@+\-^~]+/}},"link-ref":{pattern:/^\[[^\]]+\]\S+$/m,inside:{string:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0},url:{pattern:/(^\])\S+$/,lookbehind:!0},punctuation:/[\[\]]/}},link:{pattern:r(/"*[^"]+":.+?(?=[^\w/]?(?:\s|$))/.source),inside:{text:{pattern:r(/(^"*)[^"]+(?=")/.source),lookbehind:!0},modifier:{pattern:r(/(^")+/.source),lookbehind:!0,inside:i},url:{pattern:/(:).+/,lookbehind:!0},punctuation:/[":]/}},image:{pattern:r(/!(?:||[<>=])*(?![<>=])[^!\s()]+(?:\([^)]+\))?!(?::.+?(?=[^\w/]?(?:\s|$)))?/.source),inside:{source:{pattern:r(/(^!(?:||[<>=])*)(?![<>=])[^!\s()]+(?:\([^)]+\))?(?=!)/.source),lookbehind:!0,alias:"url"},modifier:{pattern:r(/(^!)(?:||[<>=])+/.source),lookbehind:!0,inside:i},url:{pattern:/(:).+/,lookbehind:!0},punctuation:/[!:]/}},footnote:{pattern:/\b\[\d+\]/,alias:"comment",inside:{punctuation:/\[|\]/}},acronym:{pattern:/\b[A-Z\d]+\([^)]+\)/,inside:{comment:{pattern:/(\()[^()]+(?=\))/,lookbehind:!0},punctuation:/[()]/}},mark:{pattern:/\b\((?:TM|R|C)\)/,alias:"comment",inside:{punctuation:/[()]/}}}}}),o=a.phrase.inside,s={inline:o.inline,link:o.link,image:o.image,footnote:o.footnote,acronym:o.acronym,mark:o.mark};a.tag.pattern=/<\/?(?!\d)[a-z0-9]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|[^\s'">=]+))?)*\s*\/?>/i;var u=o.inline.inside;u.bold.inside=s,u.italic.inside=s,u.inserted.inside=s,u.deleted.inside=s,u.span.inside=s;var c=o.table.inside;c.inline=s.inline,c.link=s.link,c.image=s.image,c.footnote=s.footnote,c.acronym=s.acronym,c.mark=s.mark}(e)}e.exports=t,t.displayName="textile",t.aliases=[]},85572(e){"use strict";function t(e){!function(e){var t=/(?:[\w-]+|'[^'\n\r]*'|"(?:\\.|[^\\"\r\n])*")/.source;function n(e){return e.replace(/__/g,function(){return t})}e.languages.toml={comment:{pattern:/#.*/,greedy:!0},table:{pattern:RegExp(n(/(^[\t ]*\[\s*(?:\[\s*)?)__(?:\s*\.\s*__)*(?=\s*\])/.source),"m"),lookbehind:!0,greedy:!0,alias:"class-name"},key:{pattern:RegExp(n(/(^[\t ]*|[{,]\s*)__(?:\s*\.\s*__)*(?=\s*=)/.source),"m"),lookbehind:!0,greedy:!0,alias:"property"},string:{pattern:/"""(?:\\[\s\S]|[^\\])*?"""|'''[\s\S]*?'''|'[^'\n\r]*'|"(?:\\.|[^\\"\r\n])*"/,greedy:!0},date:[{pattern:/\b\d{4}-\d{2}-\d{2}(?:[T\s]\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})?)?\b/i,alias:"number"},{pattern:/\b\d{2}:\d{2}:\d{2}(?:\.\d+)?\b/,alias:"number"}],number:/(?:\b0(?:x[\da-zA-Z]+(?:_[\da-zA-Z]+)*|o[0-7]+(?:_[0-7]+)*|b[10]+(?:_[10]+)*))\b|[-+]?\b\d+(?:_\d+)*(?:\.\d+(?:_\d+)*)?(?:[eE][+-]?\d+(?:_\d+)*)?\b|[-+]?\b(?:inf|nan)\b/,boolean:/\b(?:true|false)\b/,punctuation:/[.,=[\]{}]/}}(e)}e.exports=t,t.displayName="toml",t.aliases=[]},87041(e,t,n){"use strict";var r=n(96412),i=n(4979);function a(e){var t,n,a;e.register(r),e.register(i),n=(t=e).util.clone(t.languages.typescript),t.languages.tsx=t.languages.extend("jsx",n),(a=t.languages.tsx.tag).pattern=RegExp(/(^|[^\w$]|(?=<\/))/.source+"(?:"+a.pattern.source+")",a.pattern.flags),a.lookbehind=!0}e.exports=a,a.displayName="tsx",a.aliases=[]},61028(e,t,n){"use strict";var r=n(93205);function i(e){var t;e.register(r),(t=e).languages.tt2=t.languages.extend("clike",{comment:/#.*|\[%#[\s\S]*?%\]/,keyword:/\b(?:BLOCK|CALL|CASE|CATCH|CLEAR|DEBUG|DEFAULT|ELSE|ELSIF|END|FILTER|FINAL|FOREACH|GET|IF|IN|INCLUDE|INSERT|LAST|MACRO|META|NEXT|PERL|PROCESS|RAWPERL|RETURN|SET|STOP|TAGS|THROW|TRY|SWITCH|UNLESS|USE|WHILE|WRAPPER)\b/,punctuation:/[[\]{},()]/}),t.languages.insertBefore("tt2","number",{operator:/=[>=]?|!=?|<=?|>=?|&&|\|\|?|\b(?:and|or|not)\b/,variable:{pattern:/\b[a-z]\w*(?:\s*\.\s*(?:\d+|\$?[a-z]\w*))*\b/i}}),t.languages.insertBefore("tt2","keyword",{delimiter:{pattern:/^(?:\[%|%%)-?|-?%\]$/,alias:"punctuation"}}),t.languages.insertBefore("tt2","string",{"single-quoted-string":{pattern:/'[^\\']*(?:\\[\s\S][^\\']*)*'/,greedy:!0,alias:"string"},"double-quoted-string":{pattern:/"[^\\"]*(?:\\[\s\S][^\\"]*)*"/,greedy:!0,alias:"string",inside:{variable:{pattern:/\$(?:[a-z]\w*(?:\.(?:\d+|\$?[a-z]\w*))*)/i}}}}),delete t.languages.tt2.string,t.hooks.add("before-tokenize",function(e){var n=/\[%[\s\S]+?%\]/g;t.languages["markup-templating"].buildPlaceholders(e,"tt2",n)}),t.hooks.add("after-tokenize",function(e){t.languages["markup-templating"].tokenizePlaceholders(e,"tt2")})}e.exports=i,i.displayName="tt2",i.aliases=[]},24691(e){"use strict";function t(e){e.languages.turtle={comment:{pattern:/#.*/,greedy:!0},"multiline-string":{pattern:/"""(?:(?:""?)?(?:[^"\\]|\\.))*"""|'''(?:(?:''?)?(?:[^'\\]|\\.))*'''/,greedy:!0,alias:"string",inside:{comment:/#.*/}},string:{pattern:/"(?:[^\\"\r\n]|\\.)*"|'(?:[^\\'\r\n]|\\.)*'/,greedy:!0},url:{pattern:/<(?:[^\x00-\x20<>"{}|^`\\]|\\(?:u[\da-fA-F]{4}|U[\da-fA-F]{8}))*>/,greedy:!0,inside:{punctuation:/[<>]/}},function:{pattern:/(?:(?![-.\d\xB7])[-.\w\xB7\xC0-\uFFFD]+)?:(?:(?![-.])(?:[-.:\w\xC0-\uFFFD]|%[\da-f]{2}|\\.)+)?/i,inside:{"local-name":{pattern:/([^:]*:)[\s\S]+/,lookbehind:!0},prefix:{pattern:/[\s\S]+/,inside:{punctuation:/:/}}}},number:/[+-]?\b\d+(?:\.\d*)?(?:e[+-]?\d+)?/i,punctuation:/[{}.,;()[\]]|\^\^/,boolean:/\b(?:true|false)\b/,keyword:[/(?:\ba|@prefix|@base)\b|=/,/\b(?:graph|base|prefix)\b/i],tag:{pattern:/@[a-z]+(?:-[a-z\d]+)*/i,inside:{punctuation:/@/}}},e.languages.trig=e.languages.turtle}e.exports=t,t.displayName="turtle",t.aliases=[]},19892(e){"use strict";function t(e){e.languages.twig={comment:/\{#[\s\S]*?#\}/,tag:{pattern:/\{\{[\s\S]*?\}\}|\{%[\s\S]*?%\}/,inside:{ld:{pattern:/^(?:\{\{-?|\{%-?\s*\w+)/,inside:{punctuation:/^(?:\{\{|\{%)-?/,keyword:/\w+/}},rd:{pattern:/-?(?:%\}|\}\})$/,inside:{punctuation:/.+/}},string:{pattern:/("|')(?:\\.|(?!\1)[^\\\r\n])*\1/,inside:{punctuation:/^['"]|['"]$/}},keyword:/\b(?:even|if|odd)\b/,boolean:/\b(?:true|false|null)\b/,number:/\b0x[\dA-Fa-f]+|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee][-+]?\d+)?/,operator:[{pattern:/(\s)(?:and|b-and|b-xor|b-or|ends with|in|is|matches|not|or|same as|starts with)(?=\s)/,lookbehind:!0},/[=<>]=?|!=|\*\*?|\/\/?|\?:?|[-+~%|]/],property:/\b[a-zA-Z_]\w*\b/,punctuation:/[()\[\]{}:.,]/}},other:{pattern:/\S(?:[\s\S]*\S)?/,inside:e.languages.markup}}}e.exports=t,t.displayName="twig",t.aliases=[]},4979(e){"use strict";function t(e){var t,n;(t=e).languages.typescript=t.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:string|Function|any|number|boolean|Array|symbol|console|Promise|unknown|never)\b/}),t.languages.typescript.keyword.push(/\b(?:abstract|as|declare|implements|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)(?!\s*[^\s_${}*a-zA-Z\xA0-\uFFFF])/),delete t.languages.typescript.parameter,delete(n=t.languages.extend("typescript",{}))["class-name"],t.languages.typescript["class-name"].inside=n,t.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:n}}}}),t.languages.ts=t.languages.typescript}e.exports=t,t.displayName="typescript",t.aliases=["ts"]},23159(e){"use strict";function t(e){var t,n;n=/\b(?:ACT|ACTIFSUB|CARRAY|CASE|CLEARGIF|COA|COA_INT|CONSTANTS|CONTENT|CUR|EDITPANEL|EFFECT|EXT|FILE|FLUIDTEMPLATE|FORM|FRAME|FRAMESET|GIFBUILDER|GMENU|GMENU_FOLDOUT|GMENU_LAYERS|GP|HMENU|HRULER|HTML|IENV|IFSUB|IMAGE|IMGMENU|IMGMENUITEM|IMGTEXT|IMG_RESOURCE|INCLUDE_TYPOSCRIPT|JSMENU|JSMENUITEM|LLL|LOAD_REGISTER|NO|PAGE|RECORDS|RESTORE_REGISTER|TEMPLATE|TEXT|TMENU|TMENUITEM|TMENU_LAYERS|USER|USER_INT|_GIFBUILDER|global|globalString|globalVar)\b/,(t=e).languages.typoscript={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0},{pattern:/(^|[^\\:= \t]|(?:^|[^= \t])[ \t]+)\/\/.*/,lookbehind:!0,greedy:!0},{pattern:/(^|[^"'])#.*/,lookbehind:!0,greedy:!0}],function:[{pattern://,inside:{string:{pattern:/"[^"\r\n]*"|'[^'\r\n]*'/,inside:{keyword:n}},keyword:{pattern:/INCLUDE_TYPOSCRIPT/}}},{pattern:/@import\s*(?:"[^"\r\n]*"|'[^'\r\n]*')/,inside:{string:/"[^"\r\n]*"|'[^'\r\n]*'/}}],string:{pattern:/^([^=]*=[< ]?)(?:(?!\]\n).)*/,lookbehind:!0,inside:{function:/\{\$.*\}/,keyword:n,number:/^[0-9]+$/,punctuation:/[,|:]/}},keyword:n,number:{pattern:/\b[0-9]+\s*[.{=]/,inside:{operator:/[.{=]/}},tag:{pattern:/\.?[-\w\\]+\.?/,inside:{punctuation:/\./}},punctuation:/[{}[\];(),.:|]/,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/},t.languages.tsconfig=t.languages.typoscript}e.exports=t,t.displayName="typoscript",t.aliases=["tsconfig"]},34966(e){"use strict";function t(e){e.languages.unrealscript={comment:/\/\/.*|\/\*[\s\S]*?\*\//,string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},category:{pattern:/(\b(?:(?:autoexpand|hide|show)categories|var)\s*\()[^()]+(?=\))/,lookbehind:!0,greedy:!0,alias:"property"},metadata:{pattern:/(\w\s*)<\s*\w+\s*=[^<>|=\r\n]+(?:\|\s*\w+\s*=[^<>|=\r\n]+)*>/,lookbehind:!0,greedy:!0,inside:{property:/\b\w+(?=\s*=)/,operator:/=/,punctuation:/[<>|]/}},macro:{pattern:/`\w+/,alias:"property"},"class-name":{pattern:/(\b(?:class|enum|extends|interface|state(?:\(\))?|struct|within)\s+)\w+/,lookbehind:!0},keyword:/\b(?:abstract|actor|array|auto|autoexpandcategories|bool|break|byte|case|class|classgroup|client|coerce|collapsecategories|config|const|continue|default|defaultproperties|delegate|dependson|deprecated|do|dontcollapsecategories|editconst|editinlinenew|else|enum|event|exec|export|extends|final|float|for|forcescriptorder|foreach|function|goto|guid|hidecategories|hidedropdown|if|ignores|implements|inherits|input|int|interface|iterator|latent|local|material|name|native|nativereplication|noexport|nontransient|noteditinlinenew|notplaceable|operator|optional|out|pawn|perobjectconfig|perobjectlocalized|placeable|postoperator|preoperator|private|protected|reliable|replication|return|server|showcategories|simulated|singular|state|static|string|struct|structdefault|structdefaultproperties|switch|texture|transient|travel|unreliable|until|var|vector|while|within)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,boolean:/\b(?:false|true)\b/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/>>|<<|--|\+\+|\*\*|[-+*/~!=<>$@]=?|&&?|\|\|?|\^\^?|[?:%]|\b(?:Cross|Dot|ClockwiseFrom)\b/,punctuation:/[()[\]{};,.]/},e.languages.uc=e.languages.uscript=e.languages.unrealscript}e.exports=t,t.displayName="unrealscript",t.aliases=["uc","uscript"]},38521(e){"use strict";function t(e){e.languages.uri={scheme:{pattern:/^[a-z][a-z0-9+.-]*:/im,greedy:!0,inside:{"scheme-delimiter":/:$/}},fragment:{pattern:/#[\w\-.~!$&'()*+,;=%:@/?]*/,inside:{"fragment-delimiter":/^#/}},query:{pattern:/\?[\w\-.~!$&'()*+,;=%:@/?]*/,inside:{"query-delimiter":{pattern:/^\?/,greedy:!0},"pair-delimiter":/[&;]/,pair:{pattern:/^[^=][\s\S]*/,inside:{key:/^[^=]+/,value:{pattern:/(^=)[\s\S]+/,lookbehind:!0}}}}},authority:{pattern:RegExp(/^\/\//.source+/(?:[\w\-.~!$&'()*+,;=%:]*@)?/.source+("(?:"+/\[(?:[0-9a-fA-F:.]{2,48}|v[0-9a-fA-F]+\.[\w\-.~!$&'()*+,;=]+)\]/.source+"|")+/[\w\-.~!$&'()*+,;=%]*/.source+")"+/(?::\d*)?/.source,"m"),inside:{"authority-delimiter":/^\/\//,"user-info-segment":{pattern:/^[\w\-.~!$&'()*+,;=%:]*@/,inside:{"user-info-delimiter":/@$/,"user-info":/^[\w\-.~!$&'()*+,;=%:]+/}},"port-segment":{pattern:/:\d*$/,inside:{"port-delimiter":/^:/,port:/^\d+/}},host:{pattern:/[\s\S]+/,inside:{"ip-literal":{pattern:/^\[[\s\S]+\]$/,inside:{"ip-literal-delimiter":/^\[|\]$/,"ipv-future":/^v[\s\S]+/,"ipv6-address":/^[\s\S]+/}},"ipv4-address":/^(?:(?:[03-9]\d?|[12]\d{0,2})\.){3}(?:[03-9]\d?|[12]{0,2})$/}}}},path:{pattern:/^[\w\-.~!$&'()*+,;=%:@/]+/m,inside:{"path-separator":/\//}}},e.languages.url=e.languages.uri}e.exports=t,t.displayName="uri",t.aliases=["url"]},7255(e){"use strict";function t(e){var t,n;n={pattern:/[\s\S]+/,inside:null},(t=e).languages.v=t.languages.extend("clike",{string:[{pattern:/`(?:\\`|\\?[^`]{1,2})`/,alias:"rune"},{pattern:/r?(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,alias:"quoted-string",greedy:!0,inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:\{[^{}]*\}|\w+(?:\.\w+(?:\([^\(\)]*\))?|\[[^\[\]]+\])*)/,lookbehind:!0,inside:{"interpolation-variable":{pattern:/^\$\w[\s\S]*$/,alias:"variable"},"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},"interpolation-expression":n}}}}],"class-name":{pattern:/(\b(?:enum|interface|struct|type)\s+)(?:C\.)?\w+/,lookbehind:!0},keyword:/(?:\b(?:as|asm|assert|atomic|break|chan|const|continue|defer|else|embed|enum|fn|for|__global|go(?:to)?|if|import|in|interface|is|lock|match|module|mut|none|or|pub|return|rlock|select|shared|sizeof|static|struct|type(?:of)?|union|unsafe)|\$(?:if|else|for)|#(?:include|flag))\b/,number:/\b(?:0x[a-f\d]+(?:_[a-f\d]+)*|0b[01]+(?:_[01]+)*|0o[0-7]+(?:_[0-7]+)*|\d+(?:_\d+)*(?:\.\d+(?:_\d+)*)?)\b/i,operator:/~|\?|[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\.?/,builtin:/\b(?:any(?:_int|_float)?|bool|byte(?:ptr)?|charptr|f(?:32|64)|i(?:8|16|nt|64|128)|rune|size_t|string|u(?:16|32|64|128)|voidptr)\b/}),n.inside=t.languages.v,t.languages.insertBefore("v","operator",{attribute:{pattern:/(^[\t ]*)\[(?:deprecated|unsafe_fn|typedef|live|inline|flag|ref_only|windows_stdcall|direct_array_access)\]/m,lookbehind:!0,alias:"annotation",inside:{punctuation:/[\[\]]/,keyword:/\w+/}},generic:{pattern:/<\w+>(?=\s*[\)\{])/,inside:{punctuation:/[<>]/,"class-name":/\w+/}}}),t.languages.insertBefore("v","function",{"generic-function":{pattern:/\b\w+\s*<\w+>(?=\()/,inside:{function:/^\w+/,generic:{pattern:/<\w+>/,inside:t.languages.v.generic.inside}}}})}e.exports=t,t.displayName="v",t.aliases=[]},28173(e){"use strict";function t(e){e.languages.vala=e.languages.extend("clike",{"class-name":[{pattern:/\b[A-Z]\w*(?:\.\w+)*\b(?=(?:\?\s+|\*?\s+\*?)\w)/,inside:{punctuation:/\./}},{pattern:/(\[)[A-Z]\w*(?:\.\w+)*\b/,lookbehind:!0,inside:{punctuation:/\./}},{pattern:/(\b(?:class|interface)\s+[A-Z]\w*(?:\.\w+)*\s*:\s*)[A-Z]\w*(?:\.\w+)*\b/,lookbehind:!0,inside:{punctuation:/\./}},{pattern:/((?:\b(?:class|interface|new|struct|enum)\s+)|(?:catch\s+\())[A-Z]\w*(?:\.\w+)*\b/,lookbehind:!0,inside:{punctuation:/\./}}],keyword:/\b(?:bool|char|double|float|null|size_t|ssize_t|string|unichar|void|int|int8|int16|int32|int64|long|short|uchar|uint|uint8|uint16|uint32|uint64|ulong|ushort|class|delegate|enum|errordomain|interface|namespace|struct|break|continue|do|for|foreach|return|while|else|if|switch|assert|case|default|abstract|const|dynamic|ensures|extern|inline|internal|override|private|protected|public|requires|signal|static|virtual|volatile|weak|async|owned|unowned|try|catch|finally|throw|as|base|construct|delete|get|in|is|lock|new|out|params|ref|sizeof|set|this|throws|typeof|using|value|var|yield)\b/i,function:/\b\w+(?=\s*\()/,number:/(?:\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)(?:f|u?l?)?/i,operator:/\+\+|--|&&|\|\||<<=?|>>=?|=>|->|~|[+\-*\/%&^|=!<>]=?|\?\??|\.\.\./,punctuation:/[{}[\];(),.:]/,constant:/\b[A-Z0-9_]+\b/}),e.languages.insertBefore("vala","string",{"raw-string":{pattern:/"""[\s\S]*?"""/,greedy:!0,alias:"string"},"template-string":{pattern:/@"[\s\S]*?"/,greedy:!0,inside:{interpolation:{pattern:/\$(?:\([^)]*\)|[a-zA-Z]\w*)/,inside:{delimiter:{pattern:/^\$\(?|\)$/,alias:"punctuation"},rest:e.languages.vala}},string:/[\s\S]+/}}}),e.languages.insertBefore("vala","keyword",{regex:{pattern:/\/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[imsx]{0,4}(?=\s*(?:$|[\r\n,.;})\]]))/,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:e.languages.regex},"regex-delimiter":/^\//,"regex-flags":/^[a-z]+$/}}})}e.exports=t,t.displayName="vala",t.aliases=[]},53813(e,t,n){"use strict";var r=n(46241);function i(e){e.register(r),e.languages.vbnet=e.languages.extend("basic",{comment:[{pattern:/(?:!|REM\b).+/i,inside:{keyword:/^REM/i}},{pattern:/(^|[^\\:])'.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(^|[^"])"(?:""|[^"])*"(?!")/i,lookbehind:!0,greedy:!0},keyword:/(?:\b(?:ADDHANDLER|ADDRESSOF|ALIAS|AND|ANDALSO|AS|BEEP|BLOAD|BOOLEAN|BSAVE|BYREF|BYTE|BYVAL|CALL(?: ABSOLUTE)?|CASE|CATCH|CBOOL|CBYTE|CCHAR|CDATE|CDEC|CDBL|CHAIN|CHAR|CHDIR|CINT|CLASS|CLEAR|CLNG|CLOSE|CLS|COBJ|COM|COMMON|CONST|CONTINUE|CSBYTE|CSHORT|CSNG|CSTR|CTYPE|CUINT|CULNG|CUSHORT|DATA|DATE|DECIMAL|DECLARE|DEFAULT|DEF(?: FN| SEG|DBL|INT|LNG|SNG|STR)|DELEGATE|DIM|DIRECTCAST|DO|DOUBLE|ELSE|ELSEIF|END|ENUM|ENVIRON|ERASE|ERROR|EVENT|EXIT|FALSE|FIELD|FILES|FINALLY|FOR(?: EACH)?|FRIEND|FUNCTION|GET|GETTYPE|GETXMLNAMESPACE|GLOBAL|GOSUB|GOTO|HANDLES|IF|IMPLEMENTS|IMPORTS|IN|INHERITS|INPUT|INTEGER|INTERFACE|IOCTL|IS|ISNOT|KEY|KILL|LINE INPUT|LET|LIB|LIKE|LOCATE|LOCK|LONG|LOOP|LSET|ME|MKDIR|MOD|MODULE|MUSTINHERIT|MUSTOVERRIDE|MYBASE|MYCLASS|NAME|NAMESPACE|NARROWING|NEW|NEXT|NOT|NOTHING|NOTINHERITABLE|NOTOVERRIDABLE|OBJECT|OF|OFF|ON(?: COM| ERROR| KEY| TIMER)?|OPERATOR|OPEN|OPTION(?: BASE)?|OPTIONAL|OR|ORELSE|OUT|OVERLOADS|OVERRIDABLE|OVERRIDES|PARAMARRAY|PARTIAL|POKE|PRIVATE|PROPERTY|PROTECTED|PUBLIC|PUT|RAISEEVENT|READ|READONLY|REDIM|REM|REMOVEHANDLER|RESTORE|RESUME|RETURN|RMDIR|RSET|RUN|SBYTE|SELECT(?: CASE)?|SET|SHADOWS|SHARED|SHORT|SINGLE|SHELL|SLEEP|STATIC|STEP|STOP|STRING|STRUCTURE|SUB|SYNCLOCK|SWAP|SYSTEM|THEN|THROW|TIMER|TO|TROFF|TRON|TRUE|TRY|TRYCAST|TYPE|TYPEOF|UINTEGER|ULONG|UNLOCK|UNTIL|USHORT|USING|VIEW PRINT|WAIT|WEND|WHEN|WHILE|WIDENING|WITH|WITHEVENTS|WRITE|WRITEONLY|XOR)|\B(?:#CONST|#ELSE|#ELSEIF|#END|#IF))(?:\$|\b)/i,punctuation:/[,;:(){}]/})}e.exports=i,i.displayName="vbnet",i.aliases=[]},46891(e){"use strict";function t(e){var t,n;(t=e).languages.velocity=t.languages.extend("markup",{}),(n={variable:{pattern:/(^|[^\\](?:\\\\)*)\$!?(?:[a-z][\w-]*(?:\([^)]*\))?(?:\.[a-z][\w-]*(?:\([^)]*\))?|\[[^\]]+\])*|\{[^}]+\})/i,lookbehind:!0,inside:{}},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},number:/\b\d+\b/,boolean:/\b(?:true|false)\b/,operator:/[=!<>]=?|[+*/%-]|&&|\|\||\.\.|\b(?:eq|g[et]|l[et]|n(?:e|ot))\b/,punctuation:/[(){}[\]:,.]/}).variable.inside={string:n.string,function:{pattern:/([^\w-])[a-z][\w-]*(?=\()/,lookbehind:!0},number:n.number,boolean:n.boolean,punctuation:n.punctuation},t.languages.insertBefore("velocity","comment",{unparsed:{pattern:/(^|[^\\])#\[\[[\s\S]*?\]\]#/,lookbehind:!0,greedy:!0,inside:{punctuation:/^#\[\[|\]\]#$/}},"velocity-comment":[{pattern:/(^|[^\\])#\*[\s\S]*?\*#/,lookbehind:!0,greedy:!0,alias:"comment"},{pattern:/(^|[^\\])##.*/,lookbehind:!0,greedy:!0,alias:"comment"}],directive:{pattern:/(^|[^\\](?:\\\\)*)#@?(?:[a-z][\w-]*|\{[a-z][\w-]*\})(?:\s*\((?:[^()]|\([^()]*\))*\))?/i,lookbehind:!0,inside:{keyword:{pattern:/^#@?(?:[a-z][\w-]*|\{[a-z][\w-]*\})|\bin\b/,inside:{punctuation:/[{}]/}},rest:n}},variable:n.variable}),t.languages.velocity.tag.inside["attr-value"].inside.rest=t.languages.velocity}e.exports=t,t.displayName="velocity",t.aliases=[]},91824(e){"use strict";function t(e){e.languages.verilog={comment:/\/\/.*|\/\*[\s\S]*?\*\//,string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},property:/\B\$\w+\b/,constant:/\B`\w+\b/,function:/\b\w+(?=\()/,keyword:/\b(?:alias|and|assert|assign|assume|automatic|before|begin|bind|bins|binsof|bit|break|buf|bufif0|bufif1|byte|class|case|casex|casez|cell|chandle|clocking|cmos|config|const|constraint|context|continue|cover|covergroup|coverpoint|cross|deassign|default|defparam|design|disable|dist|do|edge|else|end|endcase|endclass|endclocking|endconfig|endfunction|endgenerate|endgroup|endinterface|endmodule|endpackage|endprimitive|endprogram|endproperty|endspecify|endsequence|endtable|endtask|enum|event|expect|export|extends|extern|final|first_match|for|force|foreach|forever|fork|forkjoin|function|generate|genvar|highz0|highz1|if|iff|ifnone|ignore_bins|illegal_bins|import|incdir|include|initial|inout|input|inside|instance|int|integer|interface|intersect|join|join_any|join_none|large|liblist|library|local|localparam|logic|longint|macromodule|matches|medium|modport|module|nand|negedge|new|nmos|nor|noshowcancelled|not|notif0|notif1|null|or|output|package|packed|parameter|pmos|posedge|primitive|priority|program|property|protected|pull0|pull1|pulldown|pullup|pulsestyle_onevent|pulsestyle_ondetect|pure|rand|randc|randcase|randsequence|rcmos|real|realtime|ref|reg|release|repeat|return|rnmos|rpmos|rtran|rtranif0|rtranif1|scalared|sequence|shortint|shortreal|showcancelled|signed|small|solve|specify|specparam|static|string|strong0|strong1|struct|super|supply0|supply1|table|tagged|task|this|throughout|time|timeprecision|timeunit|tran|tranif0|tranif1|tri|tri0|tri1|triand|trior|trireg|type|typedef|union|unique|unsigned|use|uwire|var|vectored|virtual|void|wait|wait_order|wand|weak0|weak1|while|wildcard|wire|with|within|wor|xnor|xor)\b/,important:/\b(?:always_latch|always_comb|always_ff|always)\b ?@?/,number:/\B##?\d+|(?:\b\d+)?'[odbh] ?[\da-fzx_?]+|\b(?:\d*[._])?\d+(?:e[-+]?\d+)?/i,operator:/[-+{}^~%*\/?=!<>&|]+/,punctuation:/[[\];(),.:]/}}e.exports=t,t.displayName="verilog",t.aliases=[]},9447(e){"use strict";function t(e){e.languages.vhdl={comment:/--.+/,"vhdl-vectors":{pattern:/\b[oxb]"[\da-f_]+"|"[01uxzwlh-]+"/i,alias:"number"},"quoted-function":{pattern:/"\S+?"(?=\()/,alias:"function"},string:/"(?:[^\\"\r\n]|\\(?:\r\n|[\s\S]))*"/,constant:/\b(?:use|library)\b/i,keyword:/\b(?:'active|'ascending|'base|'delayed|'driving|'driving_value|'event|'high|'image|'instance_name|'last_active|'last_event|'last_value|'left|'leftof|'length|'low|'path_name|'pos|'pred|'quiet|'range|'reverse_range|'right|'rightof|'simple_name|'stable|'succ|'transaction|'val|'value|access|after|alias|all|architecture|array|assert|attribute|begin|block|body|buffer|bus|case|component|configuration|constant|disconnect|downto|else|elsif|end|entity|exit|file|for|function|generate|generic|group|guarded|if|impure|in|inertial|inout|is|label|library|linkage|literal|loop|map|new|next|null|of|on|open|others|out|package|port|postponed|procedure|process|pure|range|record|register|reject|report|return|select|severity|shared|signal|subtype|then|to|transport|type|unaffected|units|until|use|variable|wait|when|while|with)\b/i,boolean:/\b(?:true|false)\b/i,function:/\w+(?=\()/,number:/'[01uxzwlh-]'|\b(?:\d+#[\da-f_.]+#|\d[\d_.]*)(?:e[-+]?\d+)?/i,operator:/[<>]=?|:=|[-+*/&=]|\b(?:abs|not|mod|rem|sll|srl|sla|sra|rol|ror|and|or|nand|xnor|xor|nor)\b/i,punctuation:/[{}[\];(),.:]/}}e.exports=t,t.displayName="vhdl",t.aliases=[]},53062(e){"use strict";function t(e){e.languages.vim={string:/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\r\n]|'')*'/,comment:/".*/,function:/\b\w+(?=\()/,keyword:/\b(?:ab|abbreviate|abc|abclear|abo|aboveleft|al|all|arga|argadd|argd|argdelete|argdo|arge|argedit|argg|argglobal|argl|arglocal|ar|args|argu|argument|as|ascii|bad|badd|ba|ball|bd|bdelete|be|bel|belowright|bf|bfirst|bl|blast|bm|bmodified|bn|bnext|bN|bNext|bo|botright|bp|bprevious|brea|break|breaka|breakadd|breakd|breakdel|breakl|breaklist|br|brewind|bro|browse|bufdo|b|buffer|buffers|bun|bunload|bw|bwipeout|ca|cabbrev|cabc|cabclear|caddb|caddbuffer|cad|caddexpr|caddf|caddfile|cal|call|cat|catch|cb|cbuffer|cc|ccl|cclose|cd|ce|center|cex|cexpr|cf|cfile|cfir|cfirst|cgetb|cgetbuffer|cgete|cgetexpr|cg|cgetfile|c|change|changes|chd|chdir|che|checkpath|checkt|checktime|cla|clast|cl|clist|clo|close|cmapc|cmapclear|cnew|cnewer|cn|cnext|cN|cNext|cnf|cnfile|cNfcNfile|cnorea|cnoreabbrev|col|colder|colo|colorscheme|comc|comclear|comp|compiler|conf|confirm|con|continue|cope|copen|co|copy|cpf|cpfile|cp|cprevious|cq|cquit|cr|crewind|cuna|cunabbrev|cu|cunmap|cw|cwindow|debugg|debuggreedy|delc|delcommand|d|delete|delf|delfunction|delm|delmarks|diffg|diffget|diffoff|diffpatch|diffpu|diffput|diffsplit|diffthis|diffu|diffupdate|dig|digraphs|di|display|dj|djump|dl|dlist|dr|drop|ds|dsearch|dsp|dsplit|earlier|echoe|echoerr|echom|echomsg|echon|e|edit|el|else|elsei|elseif|em|emenu|endfo|endfor|endf|endfunction|endfun|en|endif|endt|endtry|endw|endwhile|ene|enew|ex|exi|exit|exu|exusage|f|file|files|filetype|fina|finally|fin|find|fini|finish|fir|first|fix|fixdel|fo|fold|foldc|foldclose|folddoc|folddoclosed|foldd|folddoopen|foldo|foldopen|for|fu|fun|function|go|goto|gr|grep|grepa|grepadd|ha|hardcopy|h|help|helpf|helpfind|helpg|helpgrep|helpt|helptags|hid|hide|his|history|ia|iabbrev|iabc|iabclear|if|ij|ijump|il|ilist|imapc|imapclear|in|inorea|inoreabbrev|isearch|isp|isplit|iuna|iunabbrev|iu|iunmap|j|join|ju|jumps|k|keepalt|keepj|keepjumps|kee|keepmarks|laddb|laddbuffer|lad|laddexpr|laddf|laddfile|lan|language|la|last|later|lb|lbuffer|lc|lcd|lch|lchdir|lcl|lclose|let|left|lefta|leftabove|lex|lexpr|lf|lfile|lfir|lfirst|lgetb|lgetbuffer|lgete|lgetexpr|lg|lgetfile|lgr|lgrep|lgrepa|lgrepadd|lh|lhelpgrep|l|list|ll|lla|llast|lli|llist|lmak|lmake|lm|lmap|lmapc|lmapclear|lnew|lnewer|lne|lnext|lN|lNext|lnf|lnfile|lNf|lNfile|ln|lnoremap|lo|loadview|loc|lockmarks|lockv|lockvar|lol|lolder|lop|lopen|lpf|lpfile|lp|lprevious|lr|lrewind|ls|lt|ltag|lu|lunmap|lv|lvimgrep|lvimgrepa|lvimgrepadd|lw|lwindow|mak|make|ma|mark|marks|mat|match|menut|menutranslate|mk|mkexrc|mks|mksession|mksp|mkspell|mkvie|mkview|mkv|mkvimrc|mod|mode|m|move|mzf|mzfile|mz|mzscheme|nbkey|new|n|next|N|Next|nmapc|nmapclear|noh|nohlsearch|norea|noreabbrev|nu|number|nun|nunmap|omapc|omapclear|on|only|o|open|opt|options|ou|ounmap|pc|pclose|ped|pedit|pe|perl|perld|perldo|po|pop|popu|popup|pp|ppop|pre|preserve|prev|previous|p|print|P|Print|profd|profdel|prof|profile|promptf|promptfind|promptr|promptrepl|ps|psearch|pta|ptag|ptf|ptfirst|ptj|ptjump|ptl|ptlast|ptn|ptnext|ptN|ptNext|ptp|ptprevious|ptr|ptrewind|pts|ptselect|pu|put|pw|pwd|pyf|pyfile|py|python|qa|qall|q|quit|quita|quitall|r|read|rec|recover|redi|redir|red|redo|redr|redraw|redraws|redrawstatus|reg|registers|res|resize|ret|retab|retu|return|rew|rewind|ri|right|rightb|rightbelow|rub|ruby|rubyd|rubydo|rubyf|rubyfile|ru|runtime|rv|rviminfo|sal|sall|san|sandbox|sa|sargument|sav|saveas|sba|sball|sbf|sbfirst|sbl|sblast|sbm|sbmodified|sbn|sbnext|sbN|sbNext|sbp|sbprevious|sbr|sbrewind|sb|sbuffer|scripte|scriptencoding|scrip|scriptnames|se|set|setf|setfiletype|setg|setglobal|setl|setlocal|sf|sfind|sfir|sfirst|sh|shell|sign|sil|silent|sim|simalt|sla|slast|sl|sleep|sm|smagic|smap|smapc|smapclear|sme|smenu|sn|snext|sN|sNext|sni|sniff|sno|snomagic|snor|snoremap|snoreme|snoremenu|sor|sort|so|source|spelld|spelldump|spe|spellgood|spelli|spellinfo|spellr|spellrepall|spellu|spellundo|spellw|spellwrong|sp|split|spr|sprevious|sre|srewind|sta|stag|startg|startgreplace|star|startinsert|startr|startreplace|stj|stjump|st|stop|stopi|stopinsert|sts|stselect|sun|sunhide|sunm|sunmap|sus|suspend|sv|sview|syncbind|t|tab|tabc|tabclose|tabd|tabdo|tabe|tabedit|tabf|tabfind|tabfir|tabfirst|tabl|tablast|tabm|tabmove|tabnew|tabn|tabnext|tabN|tabNext|tabo|tabonly|tabp|tabprevious|tabr|tabrewind|tabs|ta|tag|tags|tc|tcl|tcld|tcldo|tclf|tclfile|te|tearoff|tf|tfirst|th|throw|tj|tjump|tl|tlast|tm|tmenu|tn|tnext|tN|tNext|to|topleft|tp|tprevious|tr|trewind|try|ts|tselect|tu|tunmenu|una|unabbreviate|u|undo|undoj|undojoin|undol|undolist|unh|unhide|unlet|unlo|unlockvar|unm|unmap|up|update|verb|verbose|ve|version|vert|vertical|vie|view|vim|vimgrep|vimgrepa|vimgrepadd|vi|visual|viu|viusage|vmapc|vmapclear|vne|vnew|vs|vsplit|vu|vunmap|wa|wall|wh|while|winc|wincmd|windo|winp|winpos|win|winsize|wn|wnext|wN|wNext|wp|wprevious|wq|wqa|wqall|w|write|ws|wsverb|wv|wviminfo|X|xa|xall|x|xit|xm|xmap|xmapc|xmapclear|xme|xmenu|XMLent|XMLns|xn|xnoremap|xnoreme|xnoremenu|xu|xunmap|y|yank)\b/,builtin:/\b(?:autocmd|acd|ai|akm|aleph|allowrevins|altkeymap|ambiwidth|ambw|anti|antialias|arab|arabic|arabicshape|ari|arshape|autochdir|autoindent|autoread|autowrite|autowriteall|aw|awa|background|backspace|backup|backupcopy|backupdir|backupext|backupskip|balloondelay|ballooneval|balloonexpr|bdir|bdlay|beval|bex|bexpr|bg|bh|bin|binary|biosk|bioskey|bk|bkc|bomb|breakat|brk|browsedir|bs|bsdir|bsk|bt|bufhidden|buflisted|buftype|casemap|ccv|cdpath|cedit|cfu|ch|charconvert|ci|cin|cindent|cink|cinkeys|cino|cinoptions|cinw|cinwords|clipboard|cmdheight|cmdwinheight|cmp|cms|columns|com|comments|commentstring|compatible|complete|completefunc|completeopt|consk|conskey|copyindent|cot|cpo|cpoptions|cpt|cscopepathcomp|cscopeprg|cscopequickfix|cscopetag|cscopetagorder|cscopeverbose|cspc|csprg|csqf|cst|csto|csverb|cuc|cul|cursorcolumn|cursorline|cwh|debug|deco|def|define|delcombine|dex|dg|dict|dictionary|diff|diffexpr|diffopt|digraph|dip|dir|directory|dy|ea|ead|eadirection|eb|ed|edcompatible|ef|efm|ei|ek|enc|encoding|endofline|eol|ep|equalalways|equalprg|errorbells|errorfile|errorformat|esckeys|et|eventignore|expandtab|exrc|fcl|fcs|fdc|fde|fdi|fdl|fdls|fdm|fdn|fdo|fdt|fen|fenc|fencs|fex|ff|ffs|fileencoding|fileencodings|fileformat|fileformats|fillchars|fk|fkmap|flp|fml|fmr|foldcolumn|foldenable|foldexpr|foldignore|foldlevel|foldlevelstart|foldmarker|foldmethod|foldminlines|foldnestmax|foldtext|formatexpr|formatlistpat|formatoptions|formatprg|fp|fs|fsync|ft|gcr|gd|gdefault|gfm|gfn|gfs|gfw|ghr|gp|grepformat|grepprg|gtl|gtt|guicursor|guifont|guifontset|guifontwide|guiheadroom|guioptions|guipty|guitablabel|guitabtooltip|helpfile|helpheight|helplang|hf|hh|hi|hidden|highlight|hk|hkmap|hkmapp|hkp|hl|hlg|hls|hlsearch|ic|icon|iconstring|ignorecase|im|imactivatekey|imak|imc|imcmdline|imd|imdisable|imi|iminsert|ims|imsearch|inc|include|includeexpr|incsearch|inde|indentexpr|indentkeys|indk|inex|inf|infercase|insertmode|isf|isfname|isi|isident|isk|iskeyword|isprint|joinspaces|js|key|keymap|keymodel|keywordprg|km|kmp|kp|langmap|langmenu|laststatus|lazyredraw|lbr|lcs|linebreak|lines|linespace|lisp|lispwords|listchars|loadplugins|lpl|lsp|lz|macatsui|magic|makeef|makeprg|matchpairs|matchtime|maxcombine|maxfuncdepth|maxmapdepth|maxmem|maxmempattern|maxmemtot|mco|mef|menuitems|mfd|mh|mis|mkspellmem|ml|mls|mm|mmd|mmp|mmt|modeline|modelines|modifiable|modified|more|mouse|mousef|mousefocus|mousehide|mousem|mousemodel|mouses|mouseshape|mouset|mousetime|mp|mps|msm|mzq|mzquantum|nf|nrformats|numberwidth|nuw|odev|oft|ofu|omnifunc|opendevice|operatorfunc|opfunc|osfiletype|pa|para|paragraphs|paste|pastetoggle|patchexpr|patchmode|path|pdev|penc|pex|pexpr|pfn|ph|pheader|pi|pm|pmbcs|pmbfn|popt|preserveindent|previewheight|previewwindow|printdevice|printencoding|printexpr|printfont|printheader|printmbcharset|printmbfont|printoptions|prompt|pt|pumheight|pvh|pvw|qe|quoteescape|readonly|remap|report|restorescreen|revins|rightleft|rightleftcmd|rl|rlc|ro|rs|rtp|ruf|ruler|rulerformat|runtimepath|sbo|sc|scb|scr|scroll|scrollbind|scrolljump|scrolloff|scrollopt|scs|sect|sections|secure|sel|selection|selectmode|sessionoptions|sft|shcf|shellcmdflag|shellpipe|shellquote|shellredir|shellslash|shelltemp|shelltype|shellxquote|shiftround|shiftwidth|shm|shortmess|shortname|showbreak|showcmd|showfulltag|showmatch|showmode|showtabline|shq|si|sidescroll|sidescrolloff|siso|sj|slm|smartcase|smartindent|smarttab|smc|smd|softtabstop|sol|spc|spell|spellcapcheck|spellfile|spelllang|spellsuggest|spf|spl|splitbelow|splitright|sps|sr|srr|ss|ssl|ssop|stal|startofline|statusline|stl|stmp|su|sua|suffixes|suffixesadd|sw|swapfile|swapsync|swb|swf|switchbuf|sws|sxq|syn|synmaxcol|syntax|tabline|tabpagemax|tabstop|tagbsearch|taglength|tagrelative|tagstack|tal|tb|tbi|tbidi|tbis|tbs|tenc|term|termbidi|termencoding|terse|textauto|textmode|textwidth|tgst|thesaurus|tildeop|timeout|timeoutlen|title|titlelen|titleold|titlestring|toolbar|toolbariconsize|top|tpm|tsl|tsr|ttimeout|ttimeoutlen|ttm|tty|ttybuiltin|ttyfast|ttym|ttymouse|ttyscroll|ttytype|tw|tx|uc|ul|undolevels|updatecount|updatetime|ut|vb|vbs|vdir|verbosefile|vfile|viewdir|viewoptions|viminfo|virtualedit|visualbell|vop|wak|warn|wb|wc|wcm|wd|weirdinvert|wfh|wfw|whichwrap|wi|wig|wildchar|wildcharm|wildignore|wildmenu|wildmode|wildoptions|wim|winaltkeys|window|winfixheight|winfixwidth|winheight|winminheight|winminwidth|winwidth|wiv|wiw|wm|wmh|wmnu|wmw|wop|wrap|wrapmargin|wrapscan|writeany|writebackup|writedelay|ww|noacd|noai|noakm|noallowrevins|noaltkeymap|noanti|noantialias|noar|noarab|noarabic|noarabicshape|noari|noarshape|noautochdir|noautoindent|noautoread|noautowrite|noautowriteall|noaw|noawa|nobackup|noballooneval|nobeval|nobin|nobinary|nobiosk|nobioskey|nobk|nobl|nobomb|nobuflisted|nocf|noci|nocin|nocindent|nocompatible|noconfirm|noconsk|noconskey|nocopyindent|nocp|nocscopetag|nocscopeverbose|nocst|nocsverb|nocuc|nocul|nocursorcolumn|nocursorline|nodeco|nodelcombine|nodg|nodiff|nodigraph|nodisable|noea|noeb|noed|noedcompatible|noek|noendofline|noeol|noequalalways|noerrorbells|noesckeys|noet|noex|noexpandtab|noexrc|nofen|nofk|nofkmap|nofoldenable|nogd|nogdefault|noguipty|nohid|nohidden|nohk|nohkmap|nohkmapp|nohkp|nohls|noic|noicon|noignorecase|noim|noimc|noimcmdline|noimd|noincsearch|noinf|noinfercase|noinsertmode|nois|nojoinspaces|nojs|nolazyredraw|nolbr|nolinebreak|nolisp|nolist|noloadplugins|nolpl|nolz|noma|nomacatsui|nomagic|nomh|noml|nomod|nomodeline|nomodifiable|nomodified|nomore|nomousef|nomousefocus|nomousehide|nonu|nonumber|noodev|noopendevice|nopaste|nopi|nopreserveindent|nopreviewwindow|noprompt|nopvw|noreadonly|noremap|norestorescreen|norevins|nori|norightleft|norightleftcmd|norl|norlc|noro|nors|noru|noruler|nosb|nosc|noscb|noscrollbind|noscs|nosecure|nosft|noshellslash|noshelltemp|noshiftround|noshortname|noshowcmd|noshowfulltag|noshowmatch|noshowmode|nosi|nosm|nosmartcase|nosmartindent|nosmarttab|nosmd|nosn|nosol|nospell|nosplitbelow|nosplitright|nospr|nosr|nossl|nosta|nostartofline|nostmp|noswapfile|noswf|nota|notagbsearch|notagrelative|notagstack|notbi|notbidi|notbs|notermbidi|noterse|notextauto|notextmode|notf|notgst|notildeop|notimeout|notitle|noto|notop|notr|nottimeout|nottybuiltin|nottyfast|notx|novb|novisualbell|nowa|nowarn|nowb|noweirdinvert|nowfh|nowfw|nowildmenu|nowinfixheight|nowinfixwidth|nowiv|nowmnu|nowrap|nowrapscan|nowrite|nowriteany|nowritebackup|nows|invacd|invai|invakm|invallowrevins|invaltkeymap|invanti|invantialias|invar|invarab|invarabic|invarabicshape|invari|invarshape|invautochdir|invautoindent|invautoread|invautowrite|invautowriteall|invaw|invawa|invbackup|invballooneval|invbeval|invbin|invbinary|invbiosk|invbioskey|invbk|invbl|invbomb|invbuflisted|invcf|invci|invcin|invcindent|invcompatible|invconfirm|invconsk|invconskey|invcopyindent|invcp|invcscopetag|invcscopeverbose|invcst|invcsverb|invcuc|invcul|invcursorcolumn|invcursorline|invdeco|invdelcombine|invdg|invdiff|invdigraph|invdisable|invea|inveb|inved|invedcompatible|invek|invendofline|inveol|invequalalways|inverrorbells|invesckeys|invet|invex|invexpandtab|invexrc|invfen|invfk|invfkmap|invfoldenable|invgd|invgdefault|invguipty|invhid|invhidden|invhk|invhkmap|invhkmapp|invhkp|invhls|invhlsearch|invic|invicon|invignorecase|invim|invimc|invimcmdline|invimd|invincsearch|invinf|invinfercase|invinsertmode|invis|invjoinspaces|invjs|invlazyredraw|invlbr|invlinebreak|invlisp|invlist|invloadplugins|invlpl|invlz|invma|invmacatsui|invmagic|invmh|invml|invmod|invmodeline|invmodifiable|invmodified|invmore|invmousef|invmousefocus|invmousehide|invnu|invnumber|invodev|invopendevice|invpaste|invpi|invpreserveindent|invpreviewwindow|invprompt|invpvw|invreadonly|invremap|invrestorescreen|invrevins|invri|invrightleft|invrightleftcmd|invrl|invrlc|invro|invrs|invru|invruler|invsb|invsc|invscb|invscrollbind|invscs|invsecure|invsft|invshellslash|invshelltemp|invshiftround|invshortname|invshowcmd|invshowfulltag|invshowmatch|invshowmode|invsi|invsm|invsmartcase|invsmartindent|invsmarttab|invsmd|invsn|invsol|invspell|invsplitbelow|invsplitright|invspr|invsr|invssl|invsta|invstartofline|invstmp|invswapfile|invswf|invta|invtagbsearch|invtagrelative|invtagstack|invtbi|invtbidi|invtbs|invtermbidi|invterse|invtextauto|invtextmode|invtf|invtgst|invtildeop|invtimeout|invtitle|invto|invtop|invtr|invttimeout|invttybuiltin|invttyfast|invtx|invvb|invvisualbell|invwa|invwarn|invwb|invweirdinvert|invwfh|invwfw|invwildmenu|invwinfixheight|invwinfixwidth|invwiv|invwmnu|invwrap|invwrapscan|invwrite|invwriteany|invwritebackup|invws|t_AB|t_AF|t_al|t_AL|t_bc|t_cd|t_ce|t_Ce|t_cl|t_cm|t_Co|t_cs|t_Cs|t_CS|t_CV|t_da|t_db|t_dl|t_DL|t_EI|t_F1|t_F2|t_F3|t_F4|t_F5|t_F6|t_F7|t_F8|t_F9|t_fs|t_IE|t_IS|t_k1|t_K1|t_k2|t_k3|t_K3|t_k4|t_K4|t_k5|t_K5|t_k6|t_K6|t_k7|t_K7|t_k8|t_K8|t_k9|t_K9|t_KA|t_kb|t_kB|t_KB|t_KC|t_kd|t_kD|t_KD|t_ke|t_KE|t_KF|t_KG|t_kh|t_KH|t_kI|t_KI|t_KJ|t_KK|t_kl|t_KL|t_kN|t_kP|t_kr|t_ks|t_ku|t_le|t_mb|t_md|t_me|t_mr|t_ms|t_nd|t_op|t_RI|t_RV|t_Sb|t_se|t_Sf|t_SI|t_so|t_sr|t_te|t_ti|t_ts|t_ue|t_us|t_ut|t_vb|t_ve|t_vi|t_vs|t_WP|t_WS|t_xs|t_ZH|t_ZR)\b/,number:/\b(?:0x[\da-f]+|\d+(?:\.\d+)?)\b/i,operator:/\|\||&&|[-+.]=?|[=!](?:[=~][#?]?)?|[<>]=?[#?]?|[*\/%?]|\b(?:is(?:not)?)\b/,punctuation:/[{}[\](),;:]/}}e.exports=t,t.displayName="vim",t.aliases=[]},46215(e){"use strict";function t(e){e.languages["visual-basic"]={comment:{pattern:/(?:['‘’]|REM\b)(?:[^\r\n_]|_(?:\r\n?|\n)?)*/i,inside:{keyword:/^REM/i}},directive:{pattern:/#(?:Const|Else|ElseIf|End|ExternalChecksum|ExternalSource|If|Region)(?:[^\S\r\n]_[^\S\r\n]*(?:\r\n?|\n)|.)+/i,alias:"comment",greedy:!0},string:{pattern:/\$?["“”](?:["“”]{2}|[^"“”])*["“”]C?/i,greedy:!0},date:{pattern:/#[^\S\r\n]*(?:\d+([/-])\d+\1\d+(?:[^\S\r\n]+(?:\d+[^\S\r\n]*(?:AM|PM)|\d+:\d+(?::\d+)?(?:[^\S\r\n]*(?:AM|PM))?))?|\d+[^\S\r\n]*(?:AM|PM)|\d+:\d+(?::\d+)?(?:[^\S\r\n]*(?:AM|PM))?)[^\S\r\n]*#/i,alias:"builtin"},number:/(?:(?:\b\d+(?:\.\d+)?|\.\d+)(?:E[+-]?\d+)?|&[HO][\dA-F]+)(?:U?[ILS]|[FRD])?/i,boolean:/\b(?:True|False|Nothing)\b/i,keyword:/\b(?:AddHandler|AddressOf|Alias|And(?:Also)?|As|Boolean|ByRef|Byte|ByVal|Call|Case|Catch|C(?:Bool|Byte|Char|Date|Dbl|Dec|Int|Lng|Obj|SByte|Short|Sng|Str|Type|UInt|ULng|UShort)|Char|Class|Const|Continue|Currency|Date|Decimal|Declare|Default|Delegate|Dim|DirectCast|Do|Double|Each|Else(?:If)?|End(?:If)?|Enum|Erase|Error|Event|Exit|Finally|For|Friend|Function|Get(?:Type|XMLNamespace)?|Global|GoSub|GoTo|Handles|If|Implements|Imports|In|Inherits|Integer|Interface|Is|IsNot|Let|Lib|Like|Long|Loop|Me|Mod|Module|Must(?:Inherit|Override)|My(?:Base|Class)|Namespace|Narrowing|New|Next|Not(?:Inheritable|Overridable)?|Object|Of|On|Operator|Option(?:al)?|Or(?:Else)?|Out|Overloads|Overridable|Overrides|ParamArray|Partial|Private|Property|Protected|Public|RaiseEvent|ReadOnly|ReDim|RemoveHandler|Resume|Return|SByte|Select|Set|Shadows|Shared|short|Single|Static|Step|Stop|String|Structure|Sub|SyncLock|Then|Throw|To|Try|TryCast|Type|TypeOf|U(?:Integer|Long|Short)|Using|Variant|Wend|When|While|Widening|With(?:Events)?|WriteOnly|Until|Xor)\b/i,operator:[/[+\-*/\\^<=>&#@$%!]/,{pattern:/([^\S\r\n])_(?=[^\S\r\n]*[\r\n])/,lookbehind:!0}],punctuation:/[{}().,:?]/},e.languages.vb=e.languages["visual-basic"],e.languages.vba=e.languages["visual-basic"]}e.exports=t,t.displayName="visualBasic",t.aliases=[]},10784(e){"use strict";function t(e){e.languages.warpscript={comment:/#.*|\/\/.*|\/\*[\s\S]*?\*\//,string:{pattern:/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'|<'(?:[^\\']|'(?!>)|\\.)*'>/,greedy:!0},variable:/\$\S+/,macro:{pattern:/@\S+/,alias:"property"},keyword:/\b(?:BREAK|CHECKMACRO|CONTINUE|CUDF|DEFINED|DEFINEDMACRO|EVAL|FAIL|FOR|FOREACH|FORSTEP|IFT|IFTE|MSGFAIL|NRETURN|RETHROW|RETURN|SWITCH|TRY|UDF|UNTIL|WHILE)\b/,number:/[+-]?\b(?:NaN|Infinity|\d+(?:\.\d*)?(?:[Ee][+-]?\d+)?|0x[\da-fA-F]+|0b[01]+)\b/,boolean:/\b(?:false|true|F|T)\b/,punctuation:/<%|%>|[{}[\]()]/,operator:/==|&&?|\|\|?|\*\*?|>>>?|<<|[<>!~]=?|[-/%^]|\+!?|\b(?:AND|NOT|OR)\b/}}e.exports=t,t.displayName="warpscript",t.aliases=[]},17684(e){"use strict";function t(e){e.languages.wasm={comment:[/\(;[\s\S]*?;\)/,{pattern:/;;.*/,greedy:!0}],string:{pattern:/"(?:\\[\s\S]|[^"\\])*"/,greedy:!0},keyword:[{pattern:/\b(?:align|offset)=/,inside:{operator:/=/}},{pattern:/\b(?:(?:f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))?|memory\.(?:grow|size))\b/,inside:{punctuation:/\./}},/\b(?:anyfunc|block|br(?:_if|_table)?|call(?:_indirect)?|data|drop|elem|else|end|export|func|get_(?:global|local)|global|if|import|local|loop|memory|module|mut|nop|offset|param|result|return|select|set_(?:global|local)|start|table|tee_local|then|type|unreachable)\b/],variable:/\$[\w!#$%&'*+\-./:<=>?@\\^`|~]+/i,number:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/,punctuation:/[()]/}}e.exports=t,t.displayName="wasm",t.aliases=[]},18191(e){"use strict";function t(e){e.languages.wiki=e.languages.extend("markup",{"block-comment":{pattern:/(^|[^\\])\/\*[\s\S]*?\*\//,lookbehind:!0,alias:"comment"},heading:{pattern:/^(=+)[^=\r\n].*?\1/m,inside:{punctuation:/^=+|=+$/,important:/.+/}},emphasis:{pattern:/('{2,5}).+?\1/,inside:{"bold-italic":{pattern:/(''''').+?(?=\1)/,lookbehind:!0,alias:["bold","italic"]},bold:{pattern:/(''')[^'](?:.*?[^'])?(?=\1)/,lookbehind:!0},italic:{pattern:/('')[^'](?:.*?[^'])?(?=\1)/,lookbehind:!0},punctuation:/^''+|''+$/}},hr:{pattern:/^-{4,}/m,alias:"punctuation"},url:[/ISBN +(?:97[89][ -]?)?(?:\d[ -]?){9}[\dx]\b|(?:RFC|PMID) +\d+/i,/\[\[.+?\]\]|\[.+?\]/],variable:[/__[A-Z]+__/,/\{{3}.+?\}{3}/,/\{\{.+?\}\}/],symbol:[/^#redirect/im,/~{3,5}/],"table-tag":{pattern:/((?:^|[|!])[|!])[^|\r\n]+\|(?!\|)/m,lookbehind:!0,inside:{"table-bar":{pattern:/\|$/,alias:"punctuation"},rest:e.languages.markup.tag.inside}},punctuation:/^(?:\{\||\|\}|\|-|[*#:;!|])|\|\||!!/m}),e.languages.insertBefore("wiki","tag",{nowiki:{pattern:/<(nowiki|pre|source)\b[^>]*>[\s\S]*?<\/\1>/i,inside:{tag:{pattern:/<(?:nowiki|pre|source)\b[^>]*>|<\/(?:nowiki|pre|source)>/i,inside:e.languages.markup.tag.inside}}}})}e.exports=t,t.displayName="wiki",t.aliases=[]},75242(e){"use strict";function t(e){e.languages.wolfram={comment:/\(\*(?:\(\*(?:[^*]|\*(?!\)))*\*\)|(?!\(\*)[\s\S])*?\*\)/,string:{pattern:/"(?:\\.|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:Abs|AbsArg|Accuracy|Block|Do|For|Function|If|Manipulate|Module|Nest|NestList|None|Return|Switch|Table|Which|While)\b/,context:{pattern:/\w+`+\w*/,alias:"class-name"},blank:{pattern:/\b\w+_\b/,alias:"regex"},"global-variable":{pattern:/\$\w+/,alias:"variable"},boolean:/\b(?:True|False)\b/,number:/(?:\b(?=\d)|\B(?=\.))(?:0[bo])?(?:(?:\d|0x[\da-f])[\da-f]*(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?j?\b/i,operator:/\/\.|;|=\.|\^=|\^:=|:=|<<|>>|<\||\|>|:>|\|->|->|<-|@@@|@@|@|\/@|=!=|===|==|=|\+|-|\^|\[\/-+%=\]=?|!=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[\|{}[\];(),.:]/},e.languages.mathematica=e.languages.wolfram,e.languages.wl=e.languages.wolfram,e.languages.nb=e.languages.wolfram}e.exports=t,t.displayName="wolfram",t.aliases=["mathematica","wl","nb"]},97202(e){"use strict";function t(e){var t;(t=e).languages.xeora=t.languages.extend("markup",{constant:{pattern:/\$(?:DomainContents|PageRenderDuration)\$/,inside:{punctuation:{pattern:/\$/}}},variable:{pattern:/\$@?(?:#+|[-+*~=^])?[\w.]+\$/,inside:{punctuation:{pattern:/[$.]/},operator:{pattern:/#+|[-+*~=^@]/}}},"function-inline":{pattern:/\$F:[-\w.]+\?[-\w.]+(?:,(?:(?:@[-#]*\w+\.[\w+.]\.*)*\|)*(?:(?:[\w+]|[-#*.~^]+[\w+]|=\S)(?:[^$=]|=+[^=])*=*|(?:@[-#]*\w+\.[\w+.]\.*)+(?:(?:[\w+]|[-#*~^][-#*.~^]*[\w+]|=\S)(?:[^$=]|=+[^=])*=*)?)?)?\$/,inside:{variable:{pattern:/(?:[,|])@?(?:#+|[-+*~=^])?[\w.]+/,inside:{punctuation:{pattern:/[,.|]/},operator:{pattern:/#+|[-+*~=^@]/}}},punctuation:{pattern:/\$\w:|[$:?.,|]/}},alias:"function"},"function-block":{pattern:/\$XF:\{[-\w.]+\?[-\w.]+(?:,(?:(?:@[-#]*\w+\.[\w+.]\.*)*\|)*(?:(?:[\w+]|[-#*.~^]+[\w+]|=\S)(?:[^$=]|=+[^=])*=*|(?:@[-#]*\w+\.[\w+.]\.*)+(?:(?:[\w+]|[-#*~^][-#*.~^]*[\w+]|=\S)(?:[^$=]|=+[^=])*=*)?)?)?\}:XF\$/,inside:{punctuation:{pattern:/[$:{}?.,|]/}},alias:"function"},"directive-inline":{pattern:/\$\w(?:#\d+\+?)?(?:\[[-\w.]+\])?:[-\/\w.]+\$/,inside:{punctuation:{pattern:/\$(?:\w:|C(?:\[|#\d))?|[:{[\]]/,inside:{tag:{pattern:/#\d/}}}},alias:"function"},"directive-block-open":{pattern:/\$\w+:\{|\$\w(?:#\d+\+?)?(?:\[[-\w.]+\])?:[-\w.]+:\{(?:![A-Z]+)?/,inside:{punctuation:{pattern:/\$(?:\w:|C(?:\[|#\d))?|[:{[\]]/,inside:{tag:{pattern:/#\d/}}},attribute:{pattern:/![A-Z]+$/,inside:{punctuation:{pattern:/!/}},alias:"keyword"}},alias:"function"},"directive-block-separator":{pattern:/\}:[-\w.]+:\{/,inside:{punctuation:{pattern:/[:{}]/}},alias:"function"},"directive-block-close":{pattern:/\}:[-\w.]+\$/,inside:{punctuation:{pattern:/[:{}$]/}},alias:"function"}}),t.languages.insertBefore("inside","punctuation",{variable:t.languages.xeora["function-inline"].inside.variable},t.languages.xeora["function-block"]),t.languages.xeoracube=t.languages.xeora}e.exports=t,t.displayName="xeora",t.aliases=["xeoracube"]},13808(e){"use strict";function t(e){!function(e){function t(t,n){e.languages[t]&&e.languages.insertBefore(t,"comment",{"doc-comment":n})}var n=e.languages.markup.tag,r={pattern:/\/\/\/.*/,greedy:!0,alias:"comment",inside:{tag:n}},i={pattern:/'''.*/,greedy:!0,alias:"comment",inside:{tag:n}};t("csharp",r),t("fsharp",r),t("vbnet",i)}(e)}e.exports=t,t.displayName="xmlDoc",t.aliases=[]},21301(e){"use strict";function t(e){e.languages.xojo={comment:{pattern:/(?:'|\/\/|Rem\b).+/i},string:{pattern:/"(?:""|[^"])*"/,greedy:!0},number:[/(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:E[+-]?\d+)?/i,/&[bchou][a-z\d]+/i],symbol:/#(?:If|Else|ElseIf|Endif|Pragma)\b/i,keyword:/\b(?:AddHandler|App|Array|As(?:signs)?|Auto|By(?:Ref|Val)|Boolean|Break|Byte|Call|Case|Catch|CFStringRef|CGFloat|Class|Color|Const|Continue|CString|Currency|CurrentMethodName|Declare|Delegate|Dim|Do(?:uble|wnTo)?|Each|Else(?:If)?|End|Enumeration|Event|Exception|Exit|Extends|False|Finally|For|Function|Get|GetTypeInfo|Global|GOTO|If|Implements|In|Inherits|Int(?:erface|eger|8|16|32|64)?|Lib|Loop|Me|Module|Next|Nil|Object|Optional|OSType|ParamArray|Private|Property|Protected|PString|Ptr|Raise(?:Event)?|ReDim|RemoveHandler|Return|Select(?:or)?|Self|Set|Single|Shared|Short|Soft|Static|Step|String|Sub|Super|Text|Then|To|True|Try|Ubound|UInt(?:eger|8|16|32|64)?|Until|Using|Var(?:iant)?|Wend|While|WindowPtr|WString)\b/i,operator:/<[=>]?|>=?|[+\-*\/\\^=]|\b(?:AddressOf|And|Ctype|IsA?|Mod|New|Not|Or|Xor|WeakAddressOf)\b/i,punctuation:/[.,;:()]/}}e.exports=t,t.displayName="xojo",t.aliases=[]},20349(e){"use strict";function t(e){var t,n,r;(t=e).languages.xquery=t.languages.extend("markup",{"xquery-comment":{pattern:/\(:[\s\S]*?:\)/,greedy:!0,alias:"comment"},string:{pattern:/(["'])(?:\1\1|(?!\1)[\s\S])*\1/,greedy:!0},extension:{pattern:/\(#.+?#\)/,alias:"symbol"},variable:/\$[-\w:]+/,axis:{pattern:/(^|[^-])(?:ancestor(?:-or-self)?|attribute|child|descendant(?:-or-self)?|following(?:-sibling)?|parent|preceding(?:-sibling)?|self)(?=::)/,lookbehind:!0,alias:"operator"},"keyword-operator":{pattern:/(^|[^:-])\b(?:and|castable as|div|eq|except|ge|gt|idiv|instance of|intersect|is|le|lt|mod|ne|or|union)\b(?=$|[^:-])/,lookbehind:!0,alias:"operator"},keyword:{pattern:/(^|[^:-])\b(?:as|ascending|at|base-uri|boundary-space|case|cast as|collation|construction|copy-namespaces|declare|default|descending|else|empty (?:greatest|least)|encoding|every|external|for|function|if|import|in|inherit|lax|let|map|module|namespace|no-inherit|no-preserve|option|order(?: by|ed|ing)?|preserve|return|satisfies|schema|some|stable|strict|strip|then|to|treat as|typeswitch|unordered|validate|variable|version|where|xquery)\b(?=$|[^:-])/,lookbehind:!0},function:/[\w-]+(?::[\w-]+)*(?=\s*\()/,"xquery-element":{pattern:/(element\s+)[\w-]+(?::[\w-]+)*/,lookbehind:!0,alias:"tag"},"xquery-attribute":{pattern:/(attribute\s+)[\w-]+(?::[\w-]+)*/,lookbehind:!0,alias:"attr-name"},builtin:{pattern:/(^|[^:-])\b(?:attribute|comment|document|element|processing-instruction|text|xs:(?:anyAtomicType|anyType|anyURI|base64Binary|boolean|byte|date|dateTime|dayTimeDuration|decimal|double|duration|ENTITIES|ENTITY|float|gDay|gMonth|gMonthDay|gYear|gYearMonth|hexBinary|ID|IDREFS?|int|integer|language|long|Name|NCName|negativeInteger|NMTOKENS?|nonNegativeInteger|nonPositiveInteger|normalizedString|NOTATION|positiveInteger|QName|short|string|time|token|unsigned(?:Byte|Int|Long|Short)|untyped(?:Atomic)?|yearMonthDuration))\b(?=$|[^:-])/,lookbehind:!0},number:/\b\d+(?:\.\d+)?(?:E[+-]?\d+)?/,operator:[/[+*=?|@]|\.\.?|:=|!=|<[=<]?|>[=>]?/,{pattern:/(\s)-(?=\s)/,lookbehind:!0}],punctuation:/[[\](){},;:/]/}),t.languages.xquery.tag.pattern=/<\/?(?!\d)[^\s>\/=$<%]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\[\s\S]|\{(?!\{)(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])+\}|(?!\1)[^\\])*\1|[^\s'">=]+))?)*\s*\/?>/i,t.languages.xquery.tag.inside["attr-value"].pattern=/=(?:("|')(?:\\[\s\S]|\{(?!\{)(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])+\}|(?!\1)[^\\])*\1|[^\s'">=]+)/i,t.languages.xquery.tag.inside["attr-value"].inside.punctuation=/^="|"$/,t.languages.xquery.tag.inside["attr-value"].inside.expression={pattern:/\{(?!\{)(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])+\}/,inside:t.languages.xquery,alias:"language-xquery"},n=function(e){return"string"==typeof e?e:"string"==typeof e.content?e.content:e.content.map(n).join("")},r=function(e){for(var i=[],a=0;a0&&i[i.length-1].tagName===n(o.content[0].content[1])&&i.pop():"/>"===o.content[o.content.length-1].content||i.push({tagName:n(o.content[0].content[1]),openedBraces:0}):!(i.length>0)||"punctuation"!==o.type||"{"!==o.content||e[a+1]&&"punctuation"===e[a+1].type&&"{"===e[a+1].content||e[a-1]&&"plain-text"===e[a-1].type&&"{"===e[a-1].content?i.length>0&&i[i.length-1].openedBraces>0&&"punctuation"===o.type&&"}"===o.content?i[i.length-1].openedBraces--:"comment"!==o.type&&(s=!0):i[i.length-1].openedBraces++),(s||"string"==typeof o)&&i.length>0&&0===i[i.length-1].openedBraces){var u=n(o);a0&&("string"==typeof e[a-1]||"plain-text"===e[a-1].type)&&(u=n(e[a-1])+u,e.splice(a-1,1),a--),/^\s+$/.test(u)?e[a]=u:e[a]=new t.Token("plain-text",u,null,u)}o.content&&"string"!=typeof o.content&&r(o.content)}},t.hooks.add("after-tokenize",function(e){"xquery"===e.language&&r(e.tokens)})}e.exports=t,t.displayName="xquery",t.aliases=[]},65039(e){"use strict";function t(e){!function(e){var t=/[*&][^\s[\]{},]+/,n=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,r="(?:"+n.source+"(?:[ ]+"+t.source+")?|"+t.source+"(?:[ ]+"+n.source+")?)",i=/(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-])(?:[ \t]*(?:(?![#:])|:))*/.source.replace(//g,function(){return/[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source}),a=/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;function o(e,t){return t=(t||"").replace(/m/g,"")+"m",RegExp(/([:\-,[{]\s*(?:\s<>[ \t]+)?)(?:<>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<>/g,function(){return r}).replace(/<>/g,function(){return e}),t)}e.languages.yaml={scalar:{pattern:RegExp(/([\-:]\s*(?:\s<>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<>/g,function(){return r})),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<>[ \t]+)?)<>(?=\s*:\s)/.source.replace(/<>/g,function(){return r}).replace(/<>/g,function(){return"(?:"+i+"|"+a+")"})),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:o(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),lookbehind:!0,alias:"number"},boolean:{pattern:o(/true|false/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:o(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:o(a),lookbehind:!0,greedy:!0},number:{pattern:o(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source,"i"),lookbehind:!0},tag:n,important:t,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},e.languages.yml=e.languages.yaml}(e)}e.exports=t,t.displayName="yaml",t.aliases=["yml"]},80741(e){"use strict";function t(e){e.languages.yang={comment:/\/\*[\s\S]*?\*\/|\/\/.*/,string:{pattern:/"(?:[^\\"]|\\.)*"|'[^']*'/,greedy:!0},keyword:{pattern:/(^|[{};\r\n][ \t]*)[a-z_][\w.-]*/i,lookbehind:!0},namespace:{pattern:/(\s)[a-z_][\w.-]*(?=:)/i,lookbehind:!0},boolean:/\b(?:false|true)\b/,operator:/\+/,punctuation:/[{};:]/}}e.exports=t,t.displayName="yang",t.aliases=[]},86528(e){"use strict";function t(e){!function(e){function t(e){return function(){return e}}var n=/\b(?:align|allowzero|and|asm|async|await|break|cancel|catch|comptime|const|continue|defer|else|enum|errdefer|error|export|extern|fn|for|if|inline|linksection|nakedcc|noalias|null|or|orelse|packed|promise|pub|resume|return|stdcallcc|struct|suspend|switch|test|threadlocal|try|undefined|union|unreachable|usingnamespace|var|volatile|while)\b/,r="\\b(?!"+n.source+")(?!\\d)\\w+\\b",i=/align\s*\((?:[^()]|\([^()]*\))*\)/.source,a=/(?:\?|\bpromise->|(?:\[[^[\]]*\]|\*(?!\*)|\*\*)(?:\s*|\s*const\b|\s*volatile\b|\s*allowzero\b)*)/.source.replace(//g,t(i)),o=/(?:\bpromise\b|(?:\berror\.)?(?:\.)*(?!\s+))/.source.replace(//g,t(r)),s="(?!\\s)(?:!?\\s*(?:"+a+"\\s*)*"+o+")+";e.languages.zig={comment:[{pattern:/\/{3}.*/,alias:"doc-comment"},/\/{2}.*/],string:[{pattern:/(^|[^\\@])c?"(?:[^"\\\r\n]|\\.)*"/,lookbehind:!0,greedy:!0},{pattern:/([\r\n])([ \t]+c?\\{2}).*(?:(?:\r\n?|\n)\2.*)*/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\])'(?:[^'\\\r\n]|\\(?:.|x[a-fA-F\d]{2}|u\{[a-fA-F\d]{1,6}\}))'/,lookbehind:!0,greedy:!0}],builtin:/\B@(?!\d)\w+(?=\s*\()/,label:{pattern:/(\b(?:break|continue)\s*:\s*)\w+\b|\b(?!\d)\w+\b(?=\s*:\s*(?:\{|while\b))/,lookbehind:!0},"class-name":[/\b(?!\d)\w+(?=\s*=\s*(?:(?:extern|packed)\s+)?(?:enum|struct|union)\s*[({])/,{pattern:RegExp(/(:\s*)(?=\s*(?:\s*)?[=;,)])|(?=\s*(?:\s*)?\{)/.source.replace(//g,t(s)).replace(//g,t(i))),lookbehind:!0,inside:null},{pattern:RegExp(/(\)\s*)(?=\s*(?:\s*)?;)/.source.replace(//g,t(s)).replace(//g,t(i))),lookbehind:!0,inside:null}],"builtin-types":{pattern:/\b(?:anyerror|bool|c_u?(?:short|int|long|longlong)|c_longdouble|c_void|comptime_(?:float|int)|[iu](?:8|16|32|64|128|size)|f(?:16|32|64|128)|noreturn|type|void)\b/,alias:"keyword"},keyword:n,function:/\b(?!\d)\w+(?=\s*\()/,number:/\b(?:0b[01]+|0o[0-7]+|0x[a-fA-F\d]+(?:\.[a-fA-F\d]*)?(?:[pP][+-]?[a-fA-F\d]+)?|\d+(?:\.\d*)?(?:[eE][+-]?\d+)?)\b/,boolean:/\b(?:false|true)\b/,operator:/\.[*?]|\.{2,3}|[-=]>|\*\*|\+\+|\|\||(?:<<|>>|[-+*]%|[-+*/%^&|<>!=])=?|[?~]/,punctuation:/[.:,;(){}[\]]/},e.languages.zig["class-name"].forEach(function(t){null===t.inside&&(t.inside=e.languages.zig)})}(e)}e.exports=t,t.displayName="zig",t.aliases=[]},59216(e,t,n){var r=function(e){var t=/\blang(?:uage)?-([\w-]+)\b/i,n=0,r={},i={manual:e.Prism&&e.Prism.manual,disableWorkerMessageHandler:e.Prism&&e.Prism.disableWorkerMessageHandler,util:{encode:function e(t){return t instanceof a?new a(t.type,e(t.content),t.alias):Array.isArray(t)?t.map(e):t.replace(/&/g,"&").replace(/=f.reach));S+=E.value.length,E=E.next){var k,x=E.value;if(t.length>e.length)return;if(!(x instanceof a)){var T=1;if(v){if(!(k=o(_,S,e,g)))break;var M=k.index,O=k.index+k[0].length,A=S;for(A+=E.value.length;M>=A;)A+=(E=E.next).value.length;if(A-=E.value.length,S=A,E.value instanceof a)continue;for(var L=E;L!==t.tail&&(Af.reach&&(f.reach=N);var P=E.prev;I&&(P=c(t,P,I),S+=I.length),l(t,P,T);var R=new a(d,m?i.tokenize(C,m):C,y,C);if(E=c(t,P,R),D&&c(t,E,D),T>1){var j={cause:d+","+p,reach:N};s(e,t,n,E.prev,S,j),f&&j.reach>f.reach&&(f.reach=j.reach)}}}}}}function u(){var e={value:null,prev:null,next:null},t={value:null,prev:e,next:null};e.next=t,this.head=e,this.tail=t,this.length=0}function c(e,t,n){var r=t.next,i={value:n,prev:t,next:r};return t.next=i,r.prev=i,e.length++,i}function l(e,t,n){for(var r=t.next,i=0;i"+a.content+""},!e.document)return e.addEventListener&&(i.disableWorkerMessageHandler||e.addEventListener("message",function(t){var n=JSON.parse(t.data),r=n.language,a=n.code,o=n.immediateClose;e.postMessage(i.highlight(a,i.languages[r],r)),o&&e.close()},!1)),i;var d=i.util.currentScript();function h(){i.manual||i.highlightAll()}if(d&&(i.filename=d.src,d.hasAttribute("data-manual")&&(i.manual=!0)),!i.manual){var p=document.readyState;"loading"===p||"interactive"===p&&d&&d.defer?document.addEventListener("DOMContentLoaded",h):window.requestAnimationFrame?window.requestAnimationFrame(h):window.setTimeout(h,16)}return i}("undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{});e.exports&&(e.exports=r),void 0!==n.g&&(n.g.Prism=r)},60053(e,t){"use strict";if(/** @license React v0.18.0 - * scheduler.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ Object.defineProperty(t,"__esModule",{value:!0}),"undefined"==typeof window||"function"!=typeof MessageChannel){var n,r,i,a,o,s=null,u=null,c=function(){if(null!==s)try{var e=t.unstable_now();s(!0,e),s=null}catch(n){throw setTimeout(c,0),n}},l=Date.now();t.unstable_now=function(){return Date.now()-l},n=function(e){null!==s?setTimeout(n,0,e):(s=e,setTimeout(c,0))},r=function(e,t){u=setTimeout(e,t)},i=function(){clearTimeout(u)},a=function(){return!1},o=t.unstable_forceFrameRate=function(){}}else{var f=window.performance,d=window.Date,h=window.setTimeout,p=window.clearTimeout;if("undefined"!=typeof console){var b=window.cancelAnimationFrame;"function"!=typeof window.requestAnimationFrame&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills"),"function"!=typeof b&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills")}if("object"==typeof f&&"function"==typeof f.now)t.unstable_now=function(){return f.now()};else{var m=d.now();t.unstable_now=function(){return d.now()-m}}var g=!1,v=null,y=-1,w=5,_=0;a=function(){return t.unstable_now()>=_},o=function(){},t.unstable_forceFrameRate=function(e){0>e||125M(o,n))void 0!==u&&0>M(u,o)?(e[r]=u,e[s]=n,r=s):(e[r]=o,e[a]=n,r=a);else if(void 0!==u&&0>M(u,n))e[r]=u,e[s]=n,r=s;else break a}}return t}return null}function M(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}var O=[],A=[],L=1,C=null,I=3,D=!1,N=!1,P=!1;function R(e){for(var t=x(A);null!==t;){if(null===t.callback)T(A);else if(t.startTime<=e)T(A),t.sortIndex=t.expirationTime,k(O,t);else break;t=x(A)}}function j(e){if(P=!1,R(e),!N){if(null!==x(O))N=!0,n(F);else{var t=x(A);null!==t&&r(j,t.startTime-e)}}}function F(e,n){N=!1,P&&(P=!1,i()),D=!0;var o=I;try{for(R(n),C=x(O);null!==C&&(!(C.expirationTime>n)||e&&!a());){var s=C.callback;if(null!==s){C.callback=null,I=C.priorityLevel;var u=s(C.expirationTime<=n);n=t.unstable_now(),"function"==typeof u?C.callback=u:C===x(O)&&T(O),R(n)}else T(O);C=x(O)}if(null!==C)var c=!0;else{var l=x(A);null!==l&&r(j,l.startTime-n),c=!1}return c}finally{C=null,I=o,D=!1}}function Y(e){switch(e){case 1:return -1;case 2:return 250;case 5:return 1073741823;case 4:return 1e4;default:return 5e3}}var B=o;t.unstable_ImmediatePriority=1,t.unstable_UserBlockingPriority=2,t.unstable_NormalPriority=3,t.unstable_IdlePriority=5,t.unstable_LowPriority=4,t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=I;I=e;try{return t()}finally{I=n}},t.unstable_next=function(e){switch(I){case 1:case 2:case 3:var t=3;break;default:t=I}var n=I;I=t;try{return e()}finally{I=n}},t.unstable_scheduleCallback=function(e,a,o){var s=t.unstable_now();if("object"==typeof o&&null!==o){var u=o.delay;u="number"==typeof u&&0s?(e.sortIndex=u,k(A,e),null===x(O)&&e===x(A)&&(P?i():P=!0,r(j,u-s))):(e.sortIndex=o,k(O,e),N||D||(N=!0,n(F))),e},t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_wrapCallback=function(e){var t=I;return function(){var n=I;I=t;try{return e.apply(this,arguments)}finally{I=n}}},t.unstable_getCurrentPriorityLevel=function(){return I},t.unstable_shouldYield=function(){var e=t.unstable_now();R(e);var n=x(O);return n!==C&&null!==C&&null!==n&&null!==n.callback&&n.startTime<=e&&n.expirationTime>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function c(e,t,n){var r=t.length-1;if(r=0?(i>0&&(e.lastNeed=i-1),i):--r=0?(i>0&&(e.lastNeed=i-2),i):--r=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0}function l(e,t,n){if((192&t[0])!=128)return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if((192&t[1])!=128)return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&(192&t[2])!=128)return e.lastNeed=2,"�"}}function f(e){var t=this.lastTotal-this.lastNeed,n=l(this,e,t);return void 0!==n?n:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):void(e.copy(this.lastChar,t,0,e.length),this.lastNeed-=e.length)}function d(e,t){var n=c(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=n;var r=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString("utf8",t,r)}function h(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t}function p(e,t){if((e.length-t)%2==0){var n=e.toString("utf16le",t);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function b(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,n)}return t}function m(e,t){var n=(e.length-t)%3;return 0===n?e.toString("base64",t):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-n))}function g(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function v(e){return e.toString(this.encoding)}function y(e){return e&&e.length?this.write(e):""}t.s=s,s.prototype.write=function(e){var t,n;if(0===e.length)return"";if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n */ var r=n(48764),i=r.Buffer;function a(e,t){for(var n in e)t[n]=e[n]}function o(e,t,n){return i(e,t,n)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=r:(a(r,t),t.Buffer=o),o.prototype=Object.create(i.prototype),a(i,o),o.from=function(e,t,n){if("number"==typeof e)throw TypeError("Argument must not be a number");return i(e,t,n)},o.alloc=function(e,t,n){if("number"!=typeof e)throw TypeError("Argument must be a number");var r=i(e);return void 0!==t?"string"==typeof n?r.fill(t,n):r.fill(t):r.fill(0),r},o.allocUnsafe=function(e){if("number"!=typeof e)throw TypeError("Argument must be a number");return i(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw TypeError("Argument must be a number");return r.SlowBuffer(e)}},93379(e,t,n){"use strict";var r,i,a=function(){return void 0===r&&(r=Boolean(window&&document&&document.all&&!window.atob)),r},o=(i={},function(e){if(void 0===i[e]){var t=document.querySelector(e);if(window.HTMLIFrameElement&&t instanceof window.HTMLIFrameElement)try{t=t.contentDocument.head}catch(n){t=null}i[e]=t}return i[e]}),s=[];function u(e){for(var t=-1,n=0;nOW});var r,i,a,o,s,u,c,l=n(67294),f=n.t(l,2),d=n(39814),h=n(5977),p=n(57209),b=n(32316),m=n(95880),g=n(17051),v=n(71381),y=n(81701),w=n(3022),_=n(60323),E=n(87591),S=n(25649),k=n(28902),x=n(71426),T=n(48884),M=n(94184),O=n.n(M),A=n(37703),L=n(73935),C=function(){if("undefined"!=typeof Map)return Map;function e(e,t){var n=-1;return e.some(function(e,r){return e[0]===t&&(n=r,!0)}),n}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(t){var n=e(this.__entries__,t),r=this.__entries__[n];return r&&r[1]},t.prototype.set=function(t,n){var r=e(this.__entries__,t);~r?this.__entries__[r][1]=n:this.__entries__.push([t,n])},t.prototype.delete=function(t){var n=this.__entries__,r=e(n,t);~r&&n.splice(r,1)},t.prototype.has=function(t){return!!~e(this.__entries__,t)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(e,t){void 0===t&&(t=null);for(var n=0,r=this.__entries__;n0},e.prototype.connect_=function(){I&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),Y?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){I&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(e){var t=e.propertyName,n=void 0===t?"":t;F.some(function(e){return!!~n.indexOf(e)})&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),U=function(e,t){for(var n=0,r=Object.keys(t);n0},e}(),er="undefined"!=typeof WeakMap?new WeakMap:new C,ei=function(){function e(t){if(!(this instanceof e))throw TypeError("Cannot call a class as a function.");if(!arguments.length)throw TypeError("1 argument required, but only 0 present.");var n=B.getInstance(),r=new en(t,n,this);er.set(this,r)}return e}();["observe","unobserve","disconnect"].forEach(function(e){ei.prototype[e]=function(){var t;return(t=er.get(this))[e].apply(t,arguments)}});var ea=void 0!==D.ResizeObserver?D.ResizeObserver:ei;let eo=ea;var es=function(e){var t=[],n=null,r=function(){for(var r=arguments.length,i=Array(r),a=0;a=t||n<0||f&&r>=a}function g(){var e=eb();if(m(e))return v(e);s=setTimeout(g,b(e))}function v(e){return(s=void 0,d&&r)?h(e):(r=i=void 0,o)}function y(){void 0!==s&&clearTimeout(s),c=0,r=u=i=s=void 0}function w(){return void 0===s?o:v(eb())}function _(){var e=eb(),n=m(e);if(r=arguments,i=this,u=e,n){if(void 0===s)return p(u);if(f)return clearTimeout(s),s=setTimeout(g,t),h(u)}return void 0===s&&(s=setTimeout(g,t)),o}return t=ez(t)||0,ed(n)&&(l=!!n.leading,a=(f="maxWait"in n)?eW(ez(n.maxWait)||0,t):a,d="trailing"in n?!!n.trailing:d),_.cancel=y,_.flush=w,_}let eq=eV;var eZ="Expected a function";function eX(e,t,n){var r=!0,i=!0;if("function"!=typeof e)throw TypeError(eZ);return ed(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),eq(e,t,{leading:r,maxWait:t,trailing:i})}let eJ=eX;var eQ={debounce:eq,throttle:eJ},e1=function(e){return eQ[e]},e0=function(e){return"function"==typeof e},e2=function(){return"undefined"==typeof window},e3=function(e){return e instanceof Element||e instanceof HTMLDocument};function e4(e){return(e4="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function e6(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function e5(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=Array(t);ne.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&l.createElement(tG.Z,{variant:"indeterminate",classes:r}))};tK.propTypes={fetchCount:el().number.isRequired};let tV=(0,b.withStyles)(tW)(tK);var tq=n(5536);let tZ=n.p+"ba8bbf16ebf8e1d05bef.svg";function tX(){return(tX=Object.assign||function(e){for(var t=1;t120){for(var d=Math.floor(u/80),h=u%80,p=[],b=0;b0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),null!=s&&s.stack)?(Object.defineProperty(nf(b),"stack",{value:s.stack,writable:!0,configurable:!0}),nl(b)):(Error.captureStackTrace?Error.captureStackTrace(nf(b),n):Object.defineProperty(nf(b),"stack",{value:Error().stack,writable:!0,configurable:!0}),b)}return ns(n,[{key:"toString",value:function(){return nw(this)}},{key:t4.YF,get:function(){return"Object"}}]),n}(nd(Error));function ny(e){return void 0===e||0===e.length?void 0:e}function nw(e){var t=e.message;if(e.nodes)for(var n=0,r=e.nodes;n",EOF:"",BANG:"!",DOLLAR:"$",AMP:"&",PAREN_L:"(",PAREN_R:")",SPREAD:"...",COLON:":",EQUALS:"=",AT:"@",BRACKET_L:"[",BRACKET_R:"]",BRACE_L:"{",PIPE:"|",BRACE_R:"}",NAME:"Name",INT:"Int",FLOAT:"Float",STRING:"String",BLOCK_STRING:"BlockString",COMMENT:"Comment"}),nx=n(10143),nT=Object.freeze({QUERY:"QUERY",MUTATION:"MUTATION",SUBSCRIPTION:"SUBSCRIPTION",FIELD:"FIELD",FRAGMENT_DEFINITION:"FRAGMENT_DEFINITION",FRAGMENT_SPREAD:"FRAGMENT_SPREAD",INLINE_FRAGMENT:"INLINE_FRAGMENT",VARIABLE_DEFINITION:"VARIABLE_DEFINITION",SCHEMA:"SCHEMA",SCALAR:"SCALAR",OBJECT:"OBJECT",FIELD_DEFINITION:"FIELD_DEFINITION",ARGUMENT_DEFINITION:"ARGUMENT_DEFINITION",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",ENUM_VALUE:"ENUM_VALUE",INPUT_OBJECT:"INPUT_OBJECT",INPUT_FIELD_DEFINITION:"INPUT_FIELD_DEFINITION"}),nM=n(87392),nO=function(){function e(e){var t=new nS.WU(nk.SOF,0,0,0,0,null);this.source=e,this.lastToken=t,this.token=t,this.line=1,this.lineStart=0}var t=e.prototype;return t.advance=function(){return this.lastToken=this.token,this.token=this.lookahead()},t.lookahead=function(){var e,t=this.token;if(t.kind!==nk.EOF)do t=null!==(e=t.next)&&void 0!==e?e:t.next=nC(this,t);while(t.kind===nk.COMMENT)return t},e}();function nA(e){return e===nk.BANG||e===nk.DOLLAR||e===nk.AMP||e===nk.PAREN_L||e===nk.PAREN_R||e===nk.SPREAD||e===nk.COLON||e===nk.EQUALS||e===nk.AT||e===nk.BRACKET_L||e===nk.BRACKET_R||e===nk.BRACE_L||e===nk.PIPE||e===nk.BRACE_R}function nL(e){return isNaN(e)?nk.EOF:e<127?JSON.stringify(String.fromCharCode(e)):'"\\u'.concat(("00"+e.toString(16).toUpperCase()).slice(-4),'"')}function nC(e,t){for(var n=e.source,r=n.body,i=r.length,a=t.end;a31||9===a))return new nS.WU(nk.COMMENT,t,s,n,r,i,o.slice(t+1,s))}function nN(e,t,n,r,i,a){var o=e.body,s=n,u=t,c=!1;if(45===s&&(s=o.charCodeAt(++u)),48===s){if((s=o.charCodeAt(++u))>=48&&s<=57)throw n_(e,u,"Invalid number, unexpected digit after 0: ".concat(nL(s),"."))}else u=nP(e,u,s),s=o.charCodeAt(u);if(46===s&&(c=!0,s=o.charCodeAt(++u),u=nP(e,u,s),s=o.charCodeAt(u)),(69===s||101===s)&&(c=!0,(43===(s=o.charCodeAt(++u))||45===s)&&(s=o.charCodeAt(++u)),u=nP(e,u,s),s=o.charCodeAt(u)),46===s||nU(s))throw n_(e,u,"Invalid number, expected digit but got: ".concat(nL(s),"."));return new nS.WU(c?nk.FLOAT:nk.INT,t,u,r,i,a,o.slice(t,u))}function nP(e,t,n){var r=e.body,i=t,a=n;if(a>=48&&a<=57){do a=r.charCodeAt(++i);while(a>=48&&a<=57)return i}throw n_(e,i,"Invalid number, expected digit but got: ".concat(nL(a),"."))}function nR(e,t,n,r,i){for(var a=e.body,o=t+1,s=o,u=0,c="";o=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function nB(e,t,n,r,i){for(var a=e.body,o=a.length,s=t+1,u=0;s!==o&&!isNaN(u=a.charCodeAt(s))&&(95===u||u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122);)++s;return new nS.WU(nk.NAME,t,s,n,r,i,a.slice(t,s))}function nU(e){return 95===e||e>=65&&e<=90||e>=97&&e<=122}function nH(e,t){return new n$(e,t).parseDocument()}var n$=function(){function e(e,t){var n=(0,nx.T)(e)?e:new nx.H(e);this._lexer=new nO(n),this._options=t}var t=e.prototype;return t.parseName=function(){var e=this.expectToken(nk.NAME);return{kind:nE.h.NAME,value:e.value,loc:this.loc(e)}},t.parseDocument=function(){var e=this._lexer.token;return{kind:nE.h.DOCUMENT,definitions:this.many(nk.SOF,this.parseDefinition,nk.EOF),loc:this.loc(e)}},t.parseDefinition=function(){if(this.peek(nk.NAME))switch(this._lexer.token.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"schema":case"scalar":case"type":case"interface":case"union":case"enum":case"input":case"directive":return this.parseTypeSystemDefinition();case"extend":return this.parseTypeSystemExtension()}else if(this.peek(nk.BRACE_L))return this.parseOperationDefinition();else if(this.peekDescription())return this.parseTypeSystemDefinition();throw this.unexpected()},t.parseOperationDefinition=function(){var e,t=this._lexer.token;if(this.peek(nk.BRACE_L))return{kind:nE.h.OPERATION_DEFINITION,operation:"query",name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet(),loc:this.loc(t)};var n=this.parseOperationType();return this.peek(nk.NAME)&&(e=this.parseName()),{kind:nE.h.OPERATION_DEFINITION,operation:n,name:e,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(t)}},t.parseOperationType=function(){var e=this.expectToken(nk.NAME);switch(e.value){case"query":return"query";case"mutation":return"mutation";case"subscription":return"subscription"}throw this.unexpected(e)},t.parseVariableDefinitions=function(){return this.optionalMany(nk.PAREN_L,this.parseVariableDefinition,nk.PAREN_R)},t.parseVariableDefinition=function(){var e=this._lexer.token;return{kind:nE.h.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(nk.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(nk.EQUALS)?this.parseValueLiteral(!0):void 0,directives:this.parseDirectives(!0),loc:this.loc(e)}},t.parseVariable=function(){var e=this._lexer.token;return this.expectToken(nk.DOLLAR),{kind:nE.h.VARIABLE,name:this.parseName(),loc:this.loc(e)}},t.parseSelectionSet=function(){var e=this._lexer.token;return{kind:nE.h.SELECTION_SET,selections:this.many(nk.BRACE_L,this.parseSelection,nk.BRACE_R),loc:this.loc(e)}},t.parseSelection=function(){return this.peek(nk.SPREAD)?this.parseFragment():this.parseField()},t.parseField=function(){var e,t,n=this._lexer.token,r=this.parseName();return this.expectOptionalToken(nk.COLON)?(e=r,t=this.parseName()):t=r,{kind:nE.h.FIELD,alias:e,name:t,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(nk.BRACE_L)?this.parseSelectionSet():void 0,loc:this.loc(n)}},t.parseArguments=function(e){var t=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(nk.PAREN_L,t,nk.PAREN_R)},t.parseArgument=function(){var e=this._lexer.token,t=this.parseName();return this.expectToken(nk.COLON),{kind:nE.h.ARGUMENT,name:t,value:this.parseValueLiteral(!1),loc:this.loc(e)}},t.parseConstArgument=function(){var e=this._lexer.token;return{kind:nE.h.ARGUMENT,name:this.parseName(),value:(this.expectToken(nk.COLON),this.parseValueLiteral(!0)),loc:this.loc(e)}},t.parseFragment=function(){var e=this._lexer.token;this.expectToken(nk.SPREAD);var t=this.expectOptionalKeyword("on");return!t&&this.peek(nk.NAME)?{kind:nE.h.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1),loc:this.loc(e)}:{kind:nE.h.INLINE_FRAGMENT,typeCondition:t?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(e)}},t.parseFragmentDefinition=function(){var e,t=this._lexer.token;return(this.expectKeyword("fragment"),(null===(e=this._options)||void 0===e?void 0:e.experimentalFragmentVariables)===!0)?{kind:nE.h.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(t)}:{kind:nE.h.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(t)}},t.parseFragmentName=function(){if("on"===this._lexer.token.value)throw this.unexpected();return this.parseName()},t.parseValueLiteral=function(e){var t=this._lexer.token;switch(t.kind){case nk.BRACKET_L:return this.parseList(e);case nk.BRACE_L:return this.parseObject(e);case nk.INT:return this._lexer.advance(),{kind:nE.h.INT,value:t.value,loc:this.loc(t)};case nk.FLOAT:return this._lexer.advance(),{kind:nE.h.FLOAT,value:t.value,loc:this.loc(t)};case nk.STRING:case nk.BLOCK_STRING:return this.parseStringLiteral();case nk.NAME:switch(this._lexer.advance(),t.value){case"true":return{kind:nE.h.BOOLEAN,value:!0,loc:this.loc(t)};case"false":return{kind:nE.h.BOOLEAN,value:!1,loc:this.loc(t)};case"null":return{kind:nE.h.NULL,loc:this.loc(t)};default:return{kind:nE.h.ENUM,value:t.value,loc:this.loc(t)}}case nk.DOLLAR:if(!e)return this.parseVariable()}throw this.unexpected()},t.parseStringLiteral=function(){var e=this._lexer.token;return this._lexer.advance(),{kind:nE.h.STRING,value:e.value,block:e.kind===nk.BLOCK_STRING,loc:this.loc(e)}},t.parseList=function(e){var t=this,n=this._lexer.token,r=function(){return t.parseValueLiteral(e)};return{kind:nE.h.LIST,values:this.any(nk.BRACKET_L,r,nk.BRACKET_R),loc:this.loc(n)}},t.parseObject=function(e){var t=this,n=this._lexer.token,r=function(){return t.parseObjectField(e)};return{kind:nE.h.OBJECT,fields:this.any(nk.BRACE_L,r,nk.BRACE_R),loc:this.loc(n)}},t.parseObjectField=function(e){var t=this._lexer.token,n=this.parseName();return this.expectToken(nk.COLON),{kind:nE.h.OBJECT_FIELD,name:n,value:this.parseValueLiteral(e),loc:this.loc(t)}},t.parseDirectives=function(e){for(var t=[];this.peek(nk.AT);)t.push(this.parseDirective(e));return t},t.parseDirective=function(e){var t=this._lexer.token;return this.expectToken(nk.AT),{kind:nE.h.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(e),loc:this.loc(t)}},t.parseTypeReference=function(){var e,t=this._lexer.token;return(this.expectOptionalToken(nk.BRACKET_L)?(e=this.parseTypeReference(),this.expectToken(nk.BRACKET_R),e={kind:nE.h.LIST_TYPE,type:e,loc:this.loc(t)}):e=this.parseNamedType(),this.expectOptionalToken(nk.BANG))?{kind:nE.h.NON_NULL_TYPE,type:e,loc:this.loc(t)}:e},t.parseNamedType=function(){var e=this._lexer.token;return{kind:nE.h.NAMED_TYPE,name:this.parseName(),loc:this.loc(e)}},t.parseTypeSystemDefinition=function(){var e=this.peekDescription()?this._lexer.lookahead():this._lexer.token;if(e.kind===nk.NAME)switch(e.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}throw this.unexpected(e)},t.peekDescription=function(){return this.peek(nk.STRING)||this.peek(nk.BLOCK_STRING)},t.parseDescription=function(){if(this.peekDescription())return this.parseStringLiteral()},t.parseSchemaDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("schema");var n=this.parseDirectives(!0),r=this.many(nk.BRACE_L,this.parseOperationTypeDefinition,nk.BRACE_R);return{kind:nE.h.SCHEMA_DEFINITION,description:t,directives:n,operationTypes:r,loc:this.loc(e)}},t.parseOperationTypeDefinition=function(){var e=this._lexer.token,t=this.parseOperationType();this.expectToken(nk.COLON);var n=this.parseNamedType();return{kind:nE.h.OPERATION_TYPE_DEFINITION,operation:t,type:n,loc:this.loc(e)}},t.parseScalarTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("scalar");var n=this.parseName(),r=this.parseDirectives(!0);return{kind:nE.h.SCALAR_TYPE_DEFINITION,description:t,name:n,directives:r,loc:this.loc(e)}},t.parseObjectTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("type");var n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseDirectives(!0),a=this.parseFieldsDefinition();return{kind:nE.h.OBJECT_TYPE_DEFINITION,description:t,name:n,interfaces:r,directives:i,fields:a,loc:this.loc(e)}},t.parseImplementsInterfaces=function(){var e;if(!this.expectOptionalKeyword("implements"))return[];if((null===(e=this._options)||void 0===e?void 0:e.allowLegacySDLImplementsInterfaces)===!0){var t=[];this.expectOptionalToken(nk.AMP);do t.push(this.parseNamedType());while(this.expectOptionalToken(nk.AMP)||this.peek(nk.NAME))return t}return this.delimitedMany(nk.AMP,this.parseNamedType)},t.parseFieldsDefinition=function(){var e;return(null===(e=this._options)||void 0===e?void 0:e.allowLegacySDLEmptyFields)===!0&&this.peek(nk.BRACE_L)&&this._lexer.lookahead().kind===nk.BRACE_R?(this._lexer.advance(),this._lexer.advance(),[]):this.optionalMany(nk.BRACE_L,this.parseFieldDefinition,nk.BRACE_R)},t.parseFieldDefinition=function(){var e=this._lexer.token,t=this.parseDescription(),n=this.parseName(),r=this.parseArgumentDefs();this.expectToken(nk.COLON);var i=this.parseTypeReference(),a=this.parseDirectives(!0);return{kind:nE.h.FIELD_DEFINITION,description:t,name:n,arguments:r,type:i,directives:a,loc:this.loc(e)}},t.parseArgumentDefs=function(){return this.optionalMany(nk.PAREN_L,this.parseInputValueDef,nk.PAREN_R)},t.parseInputValueDef=function(){var e,t=this._lexer.token,n=this.parseDescription(),r=this.parseName();this.expectToken(nk.COLON);var i=this.parseTypeReference();this.expectOptionalToken(nk.EQUALS)&&(e=this.parseValueLiteral(!0));var a=this.parseDirectives(!0);return{kind:nE.h.INPUT_VALUE_DEFINITION,description:n,name:r,type:i,defaultValue:e,directives:a,loc:this.loc(t)}},t.parseInterfaceTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("interface");var n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseDirectives(!0),a=this.parseFieldsDefinition();return{kind:nE.h.INTERFACE_TYPE_DEFINITION,description:t,name:n,interfaces:r,directives:i,fields:a,loc:this.loc(e)}},t.parseUnionTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("union");var n=this.parseName(),r=this.parseDirectives(!0),i=this.parseUnionMemberTypes();return{kind:nE.h.UNION_TYPE_DEFINITION,description:t,name:n,directives:r,types:i,loc:this.loc(e)}},t.parseUnionMemberTypes=function(){return this.expectOptionalToken(nk.EQUALS)?this.delimitedMany(nk.PIPE,this.parseNamedType):[]},t.parseEnumTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("enum");var n=this.parseName(),r=this.parseDirectives(!0),i=this.parseEnumValuesDefinition();return{kind:nE.h.ENUM_TYPE_DEFINITION,description:t,name:n,directives:r,values:i,loc:this.loc(e)}},t.parseEnumValuesDefinition=function(){return this.optionalMany(nk.BRACE_L,this.parseEnumValueDefinition,nk.BRACE_R)},t.parseEnumValueDefinition=function(){var e=this._lexer.token,t=this.parseDescription(),n=this.parseName(),r=this.parseDirectives(!0);return{kind:nE.h.ENUM_VALUE_DEFINITION,description:t,name:n,directives:r,loc:this.loc(e)}},t.parseInputObjectTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("input");var n=this.parseName(),r=this.parseDirectives(!0),i=this.parseInputFieldsDefinition();return{kind:nE.h.INPUT_OBJECT_TYPE_DEFINITION,description:t,name:n,directives:r,fields:i,loc:this.loc(e)}},t.parseInputFieldsDefinition=function(){return this.optionalMany(nk.BRACE_L,this.parseInputValueDef,nk.BRACE_R)},t.parseTypeSystemExtension=function(){var e=this._lexer.lookahead();if(e.kind===nk.NAME)switch(e.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(e)},t.parseSchemaExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");var t=this.parseDirectives(!0),n=this.optionalMany(nk.BRACE_L,this.parseOperationTypeDefinition,nk.BRACE_R);if(0===t.length&&0===n.length)throw this.unexpected();return{kind:nE.h.SCHEMA_EXTENSION,directives:t,operationTypes:n,loc:this.loc(e)}},t.parseScalarTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");var t=this.parseName(),n=this.parseDirectives(!0);if(0===n.length)throw this.unexpected();return{kind:nE.h.SCALAR_TYPE_EXTENSION,name:t,directives:n,loc:this.loc(e)}},t.parseObjectTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");var t=this.parseName(),n=this.parseImplementsInterfaces(),r=this.parseDirectives(!0),i=this.parseFieldsDefinition();if(0===n.length&&0===r.length&&0===i.length)throw this.unexpected();return{kind:nE.h.OBJECT_TYPE_EXTENSION,name:t,interfaces:n,directives:r,fields:i,loc:this.loc(e)}},t.parseInterfaceTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");var t=this.parseName(),n=this.parseImplementsInterfaces(),r=this.parseDirectives(!0),i=this.parseFieldsDefinition();if(0===n.length&&0===r.length&&0===i.length)throw this.unexpected();return{kind:nE.h.INTERFACE_TYPE_EXTENSION,name:t,interfaces:n,directives:r,fields:i,loc:this.loc(e)}},t.parseUnionTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");var t=this.parseName(),n=this.parseDirectives(!0),r=this.parseUnionMemberTypes();if(0===n.length&&0===r.length)throw this.unexpected();return{kind:nE.h.UNION_TYPE_EXTENSION,name:t,directives:n,types:r,loc:this.loc(e)}},t.parseEnumTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");var t=this.parseName(),n=this.parseDirectives(!0),r=this.parseEnumValuesDefinition();if(0===n.length&&0===r.length)throw this.unexpected();return{kind:nE.h.ENUM_TYPE_EXTENSION,name:t,directives:n,values:r,loc:this.loc(e)}},t.parseInputObjectTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");var t=this.parseName(),n=this.parseDirectives(!0),r=this.parseInputFieldsDefinition();if(0===n.length&&0===r.length)throw this.unexpected();return{kind:nE.h.INPUT_OBJECT_TYPE_EXTENSION,name:t,directives:n,fields:r,loc:this.loc(e)}},t.parseDirectiveDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("directive"),this.expectToken(nk.AT);var n=this.parseName(),r=this.parseArgumentDefs(),i=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");var a=this.parseDirectiveLocations();return{kind:nE.h.DIRECTIVE_DEFINITION,description:t,name:n,arguments:r,repeatable:i,locations:a,loc:this.loc(e)}},t.parseDirectiveLocations=function(){return this.delimitedMany(nk.PIPE,this.parseDirectiveLocation)},t.parseDirectiveLocation=function(){var e=this._lexer.token,t=this.parseName();if(void 0!==nT[t.value])return t;throw this.unexpected(e)},t.loc=function(e){var t;if((null===(t=this._options)||void 0===t?void 0:t.noLocation)!==!0)return new nS.Ye(e,this._lexer.lastToken,this._lexer.source)},t.peek=function(e){return this._lexer.token.kind===e},t.expectToken=function(e){var t=this._lexer.token;if(t.kind===e)return this._lexer.advance(),t;throw n_(this._lexer.source,t.start,"Expected ".concat(nG(e),", found ").concat(nz(t),"."))},t.expectOptionalToken=function(e){var t=this._lexer.token;if(t.kind===e)return this._lexer.advance(),t},t.expectKeyword=function(e){var t=this._lexer.token;if(t.kind===nk.NAME&&t.value===e)this._lexer.advance();else throw n_(this._lexer.source,t.start,'Expected "'.concat(e,'", found ').concat(nz(t),"."))},t.expectOptionalKeyword=function(e){var t=this._lexer.token;return t.kind===nk.NAME&&t.value===e&&(this._lexer.advance(),!0)},t.unexpected=function(e){var t=null!=e?e:this._lexer.token;return n_(this._lexer.source,t.start,"Unexpected ".concat(nz(t),"."))},t.any=function(e,t,n){this.expectToken(e);for(var r=[];!this.expectOptionalToken(n);)r.push(t.call(this));return r},t.optionalMany=function(e,t,n){if(this.expectOptionalToken(e)){var r=[];do r.push(t.call(this));while(!this.expectOptionalToken(n))return r}return[]},t.many=function(e,t,n){this.expectToken(e);var r=[];do r.push(t.call(this));while(!this.expectOptionalToken(n))return r},t.delimitedMany=function(e,t){this.expectOptionalToken(e);var n=[];do n.push(t.call(this));while(this.expectOptionalToken(e))return n},e}();function nz(e){var t=e.value;return nG(e.kind)+(null!=t?' "'.concat(t,'"'):"")}function nG(e){return nA(e)?'"'.concat(e,'"'):e}var nW=new Map,nK=new Map,nV=!0,nq=!1;function nZ(e){return e.replace(/[\s,]+/g," ").trim()}function nX(e){return nZ(e.source.body.substring(e.start,e.end))}function nJ(e){var t=new Set,n=[];return e.definitions.forEach(function(e){if("FragmentDefinition"===e.kind){var r=e.name.value,i=nX(e.loc),a=nK.get(r);a&&!a.has(i)?nV&&console.warn("Warning: fragment with name "+r+" already exists.\ngraphql-tag enforces all fragment names across your application to be unique; read more about\nthis in the docs: http://dev.apollodata.com/core/fragments.html#unique-names"):a||nK.set(r,a=new Set),a.add(i),t.has(i)||(t.add(i),n.push(e))}else n.push(e)}),(0,t0.pi)((0,t0.pi)({},e),{definitions:n})}function nQ(e){var t=new Set(e.definitions);t.forEach(function(e){e.loc&&delete e.loc,Object.keys(e).forEach(function(n){var r=e[n];r&&"object"==typeof r&&t.add(r)})});var n=e.loc;return n&&(delete n.startToken,delete n.endToken),e}function n1(e){var t=nZ(e);if(!nW.has(t)){var n=nH(e,{experimentalFragmentVariables:nq,allowLegacyFragmentVariables:nq});if(!n||"Document"!==n.kind)throw Error("Not a valid GraphQL document.");nW.set(t,nQ(nJ(n)))}return nW.get(t)}function n0(e){for(var t=[],n=1;n, or pass an ApolloClient instance in via options.'):(0,n9.kG)(!!n,32),n}var rp=n(10542),rb=n(53712),rm=n(21436),rg=Object.prototype.hasOwnProperty;function rv(e,t){return void 0===t&&(t=Object.create(null)),ry(rh(t.client),e).useQuery(t)}function ry(e,t){var n=(0,l.useRef)();n.current&&e===n.current.client&&t===n.current.query||(n.current=new rw(e,t,n.current));var r=n.current,i=(0,l.useState)(0),a=(i[0],i[1]);return r.forceUpdate=function(){a(function(e){return e+1})},r}var rw=function(){function e(e,t,n){this.client=e,this.query=t,this.ssrDisabledResult=(0,rp.J)({loading:!0,data:void 0,error:void 0,networkStatus:ru.I.loading}),this.skipStandbyResult=(0,rp.J)({loading:!1,data:void 0,error:void 0,networkStatus:ru.I.ready}),this.toQueryResultCache=new(n7.mr?WeakMap:Map),rd(t,r.Query);var i=n&&n.result,a=i&&i.data;a&&(this.previousData=a)}return e.prototype.forceUpdate=function(){__DEV__&&n9.kG.warn("Calling default no-op implementation of InternalState#forceUpdate")},e.prototype.executeQuery=function(e){var t,n=this;e.query&&Object.assign(this,{query:e.query}),this.watchQueryOptions=this.createWatchQueryOptions(this.queryHookOptions=e);var r=this.observable.reobserveAsConcast(this.getObsQueryOptions());return this.previousData=(null===(t=this.result)||void 0===t?void 0:t.data)||this.previousData,this.result=void 0,this.forceUpdate(),new Promise(function(e){var t;r.subscribe({next:function(e){t=e},error:function(){e(n.toQueryResult(n.observable.getCurrentResult()))},complete:function(){e(n.toQueryResult(t))}})})},e.prototype.useQuery=function(e){var t=this;this.renderPromises=(0,l.useContext)((0,ro.K)()).renderPromises,this.useOptions(e);var n=this.useObservableQuery(),r=rt((0,l.useCallback)(function(){if(t.renderPromises)return function(){};var e=function(){var e=t.result,r=n.getCurrentResult();!(e&&e.loading===r.loading&&e.networkStatus===r.networkStatus&&(0,ri.D)(e.data,r.data))&&t.setResult(r)},r=function(a){var o=n.last;i.unsubscribe();try{n.resetLastResults(),i=n.subscribe(e,r)}finally{n.last=o}if(!rg.call(a,"graphQLErrors"))throw a;var s=t.result;(!s||s&&s.loading||!(0,ri.D)(a,s.error))&&t.setResult({data:s&&s.data,error:a,loading:!1,networkStatus:ru.I.error})},i=n.subscribe(e,r);return function(){return setTimeout(function(){return i.unsubscribe()})}},[n,this.renderPromises,this.client.disableNetworkFetches,]),function(){return t.getCurrentResult()},function(){return t.getCurrentResult()});return this.unsafeHandlePartialRefetch(r),this.toQueryResult(r)},e.prototype.useOptions=function(t){var n,r=this.createWatchQueryOptions(this.queryHookOptions=t),i=this.watchQueryOptions;!(0,ri.D)(r,i)&&(this.watchQueryOptions=r,i&&this.observable&&(this.observable.reobserve(this.getObsQueryOptions()),this.previousData=(null===(n=this.result)||void 0===n?void 0:n.data)||this.previousData,this.result=void 0)),this.onCompleted=t.onCompleted||e.prototype.onCompleted,this.onError=t.onError||e.prototype.onError,(this.renderPromises||this.client.disableNetworkFetches)&&!1===this.queryHookOptions.ssr&&!this.queryHookOptions.skip?this.result=this.ssrDisabledResult:this.queryHookOptions.skip||"standby"===this.watchQueryOptions.fetchPolicy?this.result=this.skipStandbyResult:(this.result===this.ssrDisabledResult||this.result===this.skipStandbyResult)&&(this.result=void 0)},e.prototype.getObsQueryOptions=function(){var e=[],t=this.client.defaultOptions.watchQuery;return t&&e.push(t),this.queryHookOptions.defaultOptions&&e.push(this.queryHookOptions.defaultOptions),e.push((0,rb.o)(this.observable&&this.observable.options,this.watchQueryOptions)),e.reduce(ra.J)},e.prototype.createWatchQueryOptions=function(e){void 0===e&&(e={});var t,n=e.skip,r=Object.assign((e.ssr,e.onCompleted,e.onError,e.defaultOptions,(0,t0._T)(e,["skip","ssr","onCompleted","onError","defaultOptions"])),{query:this.query});if(this.renderPromises&&("network-only"===r.fetchPolicy||"cache-and-network"===r.fetchPolicy)&&(r.fetchPolicy="cache-first"),r.variables||(r.variables={}),n){var i=r.fetchPolicy,a=void 0===i?this.getDefaultFetchPolicy():i,o=r.initialFetchPolicy;Object.assign(r,{initialFetchPolicy:void 0===o?a:o,fetchPolicy:"standby"})}else r.fetchPolicy||(r.fetchPolicy=(null===(t=this.observable)||void 0===t?void 0:t.options.initialFetchPolicy)||this.getDefaultFetchPolicy());return r},e.prototype.getDefaultFetchPolicy=function(){var e,t;return(null===(e=this.queryHookOptions.defaultOptions)||void 0===e?void 0:e.fetchPolicy)||(null===(t=this.client.defaultOptions.watchQuery)||void 0===t?void 0:t.fetchPolicy)||"cache-first"},e.prototype.onCompleted=function(e){},e.prototype.onError=function(e){},e.prototype.useObservableQuery=function(){var e=this.observable=this.renderPromises&&this.renderPromises.getSSRObservable(this.watchQueryOptions)||this.observable||this.client.watchQuery(this.getObsQueryOptions());this.obsQueryFields=(0,l.useMemo)(function(){return{refetch:e.refetch.bind(e),reobserve:e.reobserve.bind(e),fetchMore:e.fetchMore.bind(e),updateQuery:e.updateQuery.bind(e),startPolling:e.startPolling.bind(e),stopPolling:e.stopPolling.bind(e),subscribeToMore:e.subscribeToMore.bind(e)}},[e]);var t=!(!1===this.queryHookOptions.ssr||this.queryHookOptions.skip);return this.renderPromises&&t&&(this.renderPromises.registerSSRObservable(e),e.getCurrentResult().loading&&this.renderPromises.addObservableQueryPromise(e)),e},e.prototype.setResult=function(e){var t=this.result;t&&t.data&&(this.previousData=t.data),this.result=e,this.forceUpdate(),this.handleErrorOrCompleted(e)},e.prototype.handleErrorOrCompleted=function(e){var t=this;if(!e.loading){var n=this.toApolloError(e);Promise.resolve().then(function(){n?t.onError(n):e.data&&t.onCompleted(e.data)}).catch(function(e){__DEV__&&n9.kG.warn(e)})}},e.prototype.toApolloError=function(e){return(0,rm.O)(e.errors)?new rs.cA({graphQLErrors:e.errors}):e.error},e.prototype.getCurrentResult=function(){return this.result||this.handleErrorOrCompleted(this.result=this.observable.getCurrentResult()),this.result},e.prototype.toQueryResult=function(e){var t=this.toQueryResultCache.get(e);if(t)return t;var n=e.data,r=(e.partial,(0,t0._T)(e,["data","partial"]));return this.toQueryResultCache.set(e,t=(0,t0.pi)((0,t0.pi)((0,t0.pi)({data:n},r),this.obsQueryFields),{client:this.client,observable:this.observable,variables:this.observable.variables,called:!this.queryHookOptions.skip,previousData:this.previousData})),!t.error&&(0,rm.O)(e.errors)&&(t.error=new rs.cA({graphQLErrors:e.errors})),t},e.prototype.unsafeHandlePartialRefetch=function(e){e.partial&&this.queryHookOptions.partialRefetch&&!e.loading&&(!e.data||0===Object.keys(e.data).length)&&"cache-only"!==this.observable.options.fetchPolicy&&(Object.assign(e,{loading:!0,networkStatus:ru.I.refetch}),this.observable.refetch())},e}();function r_(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);ne.length)&&(t=e.length);for(var n=0,r=Array(t);ne.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&void 0!==arguments[0]?arguments[0]:{};return rv(iH,e)},iz=function(){var e=ij(),t=parseInt(e.get("page")||"1",10),n=parseInt(e.get("per")||"50",10),r=i$({variables:{offset:(t-1)*n,limit:n},fetchPolicy:"network-only"}),i=r.data,a=r.loading,o=r.error;return a?l.createElement(iR,null):o?l.createElement(iD,{error:o}):i?l.createElement(iI,{chains:i.chains.results,page:t,pageSize:n,total:i.chains.metadata.total}):null},iG=n(67932),iW=n(8126),iK="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function iV(e){if(iq())return Intl.DateTimeFormat.supportedLocalesOf(e)[0]}function iq(){return("undefined"==typeof Intl?"undefined":iK(Intl))==="object"&&"function"==typeof Intl.DateTimeFormat}var iZ="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},iX=function(){function e(e,t){for(var n=0;n=i.length)break;s=i[o++]}else{if((o=i.next()).done)break;s=o.value}var s,u=s;if((void 0===e?"undefined":iZ(e))!=="object")return;e=e[u]}return e}},{key:"put",value:function(){for(var e=arguments.length,t=Array(e),n=0;n=o.length)break;c=o[u++]}else{if((u=o.next()).done)break;c=u.value}var c,l=c;"object"!==iZ(a[l])&&(a[l]={}),a=a[l]}return a[i]=r}}]),e}();let i1=iQ;var i0=new i1;function i2(e,t){if(!iq())return function(e){return e.toString()};var n=i4(e),r=JSON.stringify(t),i=i0.get(String(n),r)||i0.put(String(n),r,new Intl.DateTimeFormat(n,t));return function(e){return i.format(e)}}var i3={};function i4(e){var t=e.toString();return i3[t]?i3[t]:i3[t]=iV(e)}var i6="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function i5(e){return i8(e)?e:new Date(e)}function i8(e){return e instanceof Date||i9(e)}function i9(e){return(void 0===e?"undefined":i6(e))==="object"&&"function"==typeof e.getTime}var i7=n(54087),ae=n.n(i7);function at(e,t){if(0===e.length)return 0;for(var n=0,r=e.length-1,i=void 0;n<=r;){var a=t(e[i=Math.floor((r+n)/2)]);if(0===a)return i;if(a<0){if((n=i+1)>r)return n}else if((r=i-1)=t.nextUpdateTime)aa(t,this.instances);else break}},scheduleNextTick:function(){var e=this;this.scheduledTick=ae()(function(){e.tick(),e.scheduleNextTick()})},start:function(){this.scheduleNextTick()},stop:function(){ae().cancel(this.scheduledTick)}};function ai(e){var t=an(e.getNextValue(),2),n=t[0],r=t[1];e.setValue(n),e.nextUpdateTime=r}function aa(e,t){ai(e),as(t,e),ao(t,e)}function ao(e,t){var n=au(e,t);e.splice(n,0,t)}function as(e,t){var n=e.indexOf(t);e.splice(n,1)}function au(e,t){var n=t.nextUpdateTime;return at(e,function(e){return e.nextUpdateTime===n?0:e.nextUpdateTime>n?1:-1})}var ac=(0,ec.oneOfType)([(0,ec.shape)({minTime:ec.number,formatAs:ec.string.isRequired}),(0,ec.shape)({test:ec.func,formatAs:ec.string.isRequired}),(0,ec.shape)({minTime:ec.number,format:ec.func.isRequired}),(0,ec.shape)({test:ec.func,format:ec.func.isRequired})]),al=(0,ec.oneOfType)([ec.string,(0,ec.shape)({steps:(0,ec.arrayOf)(ac).isRequired,labels:(0,ec.oneOfType)([ec.string,(0,ec.arrayOf)(ec.string)]).isRequired,round:ec.string})]),af=Object.assign||function(e){for(var t=1;t=0)&&Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function ap(e){var t=e.date,n=e.future,r=e.timeStyle,i=e.round,a=e.minTimeLeft,o=e.tooltip,s=e.component,u=e.container,c=e.wrapperComponent,f=e.wrapperProps,d=e.locale,h=e.locales,p=e.formatVerboseDate,b=e.verboseDateFormat,m=e.updateInterval,g=e.tick,v=ah(e,["date","future","timeStyle","round","minTimeLeft","tooltip","component","container","wrapperComponent","wrapperProps","locale","locales","formatVerboseDate","verboseDateFormat","updateInterval","tick"]),y=(0,l.useMemo)(function(){return d&&(h=[d]),h.concat(iW.Z.getDefaultLocale())},[d,h]),w=(0,l.useMemo)(function(){return new iW.Z(y)},[y]);t=(0,l.useMemo)(function(){return i5(t)},[t]);var _=(0,l.useCallback)(function(){var e=Date.now(),o=void 0;if(n&&e>=t.getTime()&&(e=t.getTime(),o=!0),void 0!==a){var s=t.getTime()-1e3*a;e>s&&(e=s,o=!0)}var u=w.format(t,r,{getTimeToNextUpdate:!0,now:e,future:n,round:i}),c=ad(u,2),l=c[0],f=c[1];return f=o?ag:m||f||6e4,[l,e+f]},[t,n,r,m,i,a,w]),E=(0,l.useRef)();E.current=_;var S=(0,l.useMemo)(_,[]),k=ad(S,2),x=k[0],T=k[1],M=(0,l.useState)(x),O=ad(M,2),A=O[0],L=O[1],C=ad((0,l.useState)(),2),I=C[0],D=C[1],N=(0,l.useRef)();(0,l.useEffect)(function(){if(g)return N.current=ar.add({getNextValue:function(){return E.current()},setValue:L,nextUpdateTime:T}),function(){return N.current.stop()}},[g]),(0,l.useEffect)(function(){if(N.current)N.current.forceUpdate();else{var e=_(),t=ad(e,1)[0];L(t)}},[_]),(0,l.useEffect)(function(){D(!0)},[]);var P=(0,l.useMemo)(function(){if("undefined"!=typeof window)return i2(y,b)},[y,b]),R=(0,l.useMemo)(function(){if("undefined"!=typeof window)return p?p(t):P(t)},[t,p,P]),j=l.createElement(s,af({date:t,verboseDate:I?R:void 0,tooltip:o},v),A),F=c||u;return F?l.createElement(F,af({},f,{verboseDate:I?R:void 0}),j):j}ap.propTypes={date:el().oneOfType([el().instanceOf(Date),el().number]).isRequired,locale:el().string,locales:el().arrayOf(el().string),future:el().bool,timeStyle:al,round:el().string,minTimeLeft:el().number,component:el().elementType.isRequired,tooltip:el().bool.isRequired,formatVerboseDate:el().func,verboseDateFormat:el().object,updateInterval:el().oneOfType([el().number,el().arrayOf(el().shape({threshold:el().number,interval:el().number.isRequired}))]),tick:el().bool,wrapperComponent:el().func,wrapperProps:el().object},ap.defaultProps={locales:[],component:av,tooltip:!0,verboseDateFormat:{weekday:"long",day:"numeric",month:"long",year:"numeric",hour:"numeric",minute:"2-digit",second:"2-digit"},tick:!0},ap=l.memo(ap);let ab=ap;var am,ag=31536e9;function av(e){var t=e.date,n=e.verboseDate,r=e.tooltip,i=e.children,a=ah(e,["date","verboseDate","tooltip","children"]),o=(0,l.useMemo)(function(){return t.toISOString()},[t]);return l.createElement("time",af({},a,{dateTime:o,title:r?n:void 0}),i)}av.propTypes={date:el().instanceOf(Date).isRequired,verboseDate:el().string,tooltip:el().bool.isRequired,children:el().string.isRequired};var ay=n(30381),aw=n.n(ay),a_=n(31657);function aE(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function aS(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=Array(t);ne.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]0?new rs.cA({graphQLErrors:i}):void 0;if(u===s.current.mutationId&&!c.ignoreResults){var f={called:!0,loading:!1,data:r,error:l,client:a};s.current.isMounted&&!(0,ri.D)(s.current.result,f)&&o(s.current.result=f)}var d=e.onCompleted||(null===(n=s.current.options)||void 0===n?void 0:n.onCompleted);return null==d||d(t.data,c),t}).catch(function(t){if(u===s.current.mutationId&&s.current.isMounted){var n,r={loading:!1,error:t,data:void 0,called:!0,client:a};(0,ri.D)(s.current.result,r)||o(s.current.result=r)}var i=e.onError||(null===(n=s.current.options)||void 0===n?void 0:n.onError);if(i)return i(t,c),{data:void 0,errors:t};throw t})},[]),c=(0,l.useCallback)(function(){s.current.isMounted&&o({called:!1,loading:!1,client:n})},[]);return(0,l.useEffect)(function(){return s.current.isMounted=!0,function(){s.current.isMounted=!1}},[]),[u,(0,t0.pi)({reset:c},a)]}var os=n(59067),ou=n(28428),oc=n(11186),ol=n(78513);function of(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var od=function(e){return(0,b.createStyles)({paper:{display:"flex",margin:"".concat(2.5*e.spacing.unit,"px 0"),padding:"".concat(3*e.spacing.unit,"px ").concat(3.5*e.spacing.unit,"px")},content:{flex:1,width:"100%"},actions:of({marginTop:-(1.5*e.spacing.unit),marginLeft:-(4*e.spacing.unit)},e.breakpoints.up("sm"),{marginLeft:0,marginRight:-(1.5*e.spacing.unit)}),itemBlock:{border:"1px solid rgba(224, 224, 224, 1)",borderRadius:e.shape.borderRadius,padding:2*e.spacing.unit,marginTop:e.spacing.unit},itemBlockText:{overflowWrap:"anywhere"}})},oh=(0,b.withStyles)(od)(function(e){var t=e.actions,n=e.children,r=e.classes;return l.createElement(ii.default,{className:r.paper},l.createElement("div",{className:r.content},n),t&&l.createElement("div",{className:r.actions},t))}),op=function(e){var t=e.title;return l.createElement(x.default,{variant:"subtitle2",gutterBottom:!0},t)},ob=function(e){var t=e.children,n=e.value;return l.createElement(x.default,{variant:"body1",noWrap:!0},t||n)},om=(0,b.withStyles)(od)(function(e){var t=e.children,n=e.classes,r=e.value;return l.createElement("div",{className:n.itemBlock},l.createElement(x.default,{variant:"body1",className:n.itemBlockText},t||r))});function og(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);ne.length)&&(t=e.length);for(var n=0,r=Array(t);ne.length)&&(t=e.length);for(var n=0,r=Array(t);ne.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]-1}let sq=sV;function sZ(e,t){var n=this.__data__,r=sH(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}let sX=sZ;function sJ(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t-1&&e%1==0&&e-1&&e%1==0&&e<=cC}let cD=cI;var cN="[object Arguments]",cP="[object Array]",cR="[object Boolean]",cj="[object Date]",cF="[object Error]",cY="[object Function]",cB="[object Map]",cU="[object Number]",cH="[object Object]",c$="[object RegExp]",cz="[object Set]",cG="[object String]",cW="[object WeakMap]",cK="[object ArrayBuffer]",cV="[object DataView]",cq="[object Float64Array]",cZ="[object Int8Array]",cX="[object Int16Array]",cJ="[object Int32Array]",cQ="[object Uint8Array]",c1="[object Uint8ClampedArray]",c0="[object Uint16Array]",c2="[object Uint32Array]",c3={};function c4(e){return eD(e)&&cD(e.length)&&!!c3[eC(e)]}c3["[object Float32Array]"]=c3[cq]=c3[cZ]=c3[cX]=c3[cJ]=c3[cQ]=c3[c1]=c3[c0]=c3[c2]=!0,c3[cN]=c3[cP]=c3[cK]=c3[cR]=c3[cV]=c3[cj]=c3[cF]=c3[cY]=c3[cB]=c3[cU]=c3[cH]=c3[c$]=c3[cz]=c3[cG]=c3[cW]=!1;let c6=c4;function c5(e){return function(t){return e(t)}}let c8=c5;var c9=n(79730),c7=c9.Z&&c9.Z.isTypedArray,le=c7?c8(c7):c6;let lt=le;var ln=Object.prototype.hasOwnProperty;function lr(e,t){var n=cx(e),r=!n&&cS(e),i=!n&&!r&&(0,cT.Z)(e),a=!n&&!r&&!i&<(e),o=n||r||i||a,s=o?cb(e.length,String):[],u=s.length;for(var c in e)(t||ln.call(e,c))&&!(o&&("length"==c||i&&("offset"==c||"parent"==c)||a&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||cL(c,u)))&&s.push(c);return s}let li=lr;var la=Object.prototype;function lo(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||la)}let ls=lo;var lu=sT(Object.keys,Object);let lc=lu;var ll=Object.prototype.hasOwnProperty;function lf(e){if(!ls(e))return lc(e);var t=[];for(var n in Object(e))ll.call(e,n)&&"constructor"!=n&&t.push(n);return t}let ld=lf;function lh(e){return null!=e&&cD(e.length)&&!ur(e)}let lp=lh;function lb(e){return lp(e)?li(e):ld(e)}let lm=lb;function lg(e,t){return e&&ch(t,lm(t),e)}let lv=lg;function ly(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}let lw=ly;var l_=Object.prototype.hasOwnProperty;function lE(e){if(!ed(e))return lw(e);var t=ls(e),n=[];for(var r in e)"constructor"==r&&(t||!l_.call(e,r))||n.push(r);return n}let lS=lE;function lk(e){return lp(e)?li(e,!0):lS(e)}let lx=lk;function lT(e,t){return e&&ch(t,lx(t),e)}let lM=lT;var lO=n(42896);function lA(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n=0||(i[n]=e[n]);return i}function hu(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var hc=function(e){return Array.isArray(e)&&0===e.length},hl=function(e){return"function"==typeof e},hf=function(e){return null!==e&&"object"==typeof e},hd=function(e){return String(Math.floor(Number(e)))===e},hh=function(e){return"[object String]"===Object.prototype.toString.call(e)},hp=function(e){return 0===l.Children.count(e)},hb=function(e){return hf(e)&&hl(e.then)};function hm(e,t,n,r){void 0===r&&(r=0);for(var i=d8(t);e&&r=0?[]:{}}}return(0===a?e:i)[o[a]]===n?e:(void 0===n?delete i[o[a]]:i[o[a]]=n,0===a&&void 0===n&&delete r[o[a]],r)}function hv(e,t,n,r){void 0===n&&(n=new WeakMap),void 0===r&&(r={});for(var i=0,a=Object.keys(e);i0?t.map(function(t){return x(t,hm(e,t))}):[Promise.resolve("DO_NOT_DELETE_YOU_WILL_BE_FIRED")]).then(function(e){return e.reduce(function(e,n,r){return"DO_NOT_DELETE_YOU_WILL_BE_FIRED"===n||n&&(e=hg(e,t[r],n)),e},{})})},[x]),M=(0,l.useCallback)(function(e){return Promise.all([T(e),h.validationSchema?k(e):{},h.validate?S(e):{}]).then(function(e){var t=e[0],n=e[1],r=e[2];return sk.all([t,n,r],{arrayMerge:hL})})},[h.validate,h.validationSchema,T,S,k]),O=hN(function(e){return void 0===e&&(e=_.values),E({type:"SET_ISVALIDATING",payload:!0}),M(e).then(function(e){return v.current&&(E({type:"SET_ISVALIDATING",payload:!1}),sd()(_.errors,e)||E({type:"SET_ERRORS",payload:e})),e})});(0,l.useEffect)(function(){o&&!0===v.current&&sd()(p.current,h.initialValues)&&O(p.current)},[o,O]);var A=(0,l.useCallback)(function(e){var t=e&&e.values?e.values:p.current,n=e&&e.errors?e.errors:b.current?b.current:h.initialErrors||{},r=e&&e.touched?e.touched:m.current?m.current:h.initialTouched||{},i=e&&e.status?e.status:g.current?g.current:h.initialStatus;p.current=t,b.current=n,m.current=r,g.current=i;var a=function(){E({type:"RESET_FORM",payload:{isSubmitting:!!e&&!!e.isSubmitting,errors:n,touched:r,status:i,values:t,isValidating:!!e&&!!e.isValidating,submitCount:e&&e.submitCount&&"number"==typeof e.submitCount?e.submitCount:0}})};if(h.onReset){var o=h.onReset(_.values,V);hb(o)?o.then(a):a()}else a()},[h.initialErrors,h.initialStatus,h.initialTouched]);(0,l.useEffect)(function(){!0===v.current&&!sd()(p.current,h.initialValues)&&(c&&(p.current=h.initialValues,A()),o&&O(p.current))},[c,h.initialValues,A,o,O]),(0,l.useEffect)(function(){c&&!0===v.current&&!sd()(b.current,h.initialErrors)&&(b.current=h.initialErrors||hS,E({type:"SET_ERRORS",payload:h.initialErrors||hS}))},[c,h.initialErrors]),(0,l.useEffect)(function(){c&&!0===v.current&&!sd()(m.current,h.initialTouched)&&(m.current=h.initialTouched||hk,E({type:"SET_TOUCHED",payload:h.initialTouched||hk}))},[c,h.initialTouched]),(0,l.useEffect)(function(){c&&!0===v.current&&!sd()(g.current,h.initialStatus)&&(g.current=h.initialStatus,E({type:"SET_STATUS",payload:h.initialStatus}))},[c,h.initialStatus,h.initialTouched]);var L=hN(function(e){if(y.current[e]&&hl(y.current[e].validate)){var t=hm(_.values,e),n=y.current[e].validate(t);return hb(n)?(E({type:"SET_ISVALIDATING",payload:!0}),n.then(function(e){return e}).then(function(t){E({type:"SET_FIELD_ERROR",payload:{field:e,value:t}}),E({type:"SET_ISVALIDATING",payload:!1})})):(E({type:"SET_FIELD_ERROR",payload:{field:e,value:n}}),Promise.resolve(n))}return h.validationSchema?(E({type:"SET_ISVALIDATING",payload:!0}),k(_.values,e).then(function(e){return e}).then(function(t){E({type:"SET_FIELD_ERROR",payload:{field:e,value:t[e]}}),E({type:"SET_ISVALIDATING",payload:!1})})):Promise.resolve()}),C=(0,l.useCallback)(function(e,t){var n=t.validate;y.current[e]={validate:n}},[]),I=(0,l.useCallback)(function(e){delete y.current[e]},[]),D=hN(function(e,t){return E({type:"SET_TOUCHED",payload:e}),(void 0===t?i:t)?O(_.values):Promise.resolve()}),N=(0,l.useCallback)(function(e){E({type:"SET_ERRORS",payload:e})},[]),P=hN(function(e,t){var r=hl(e)?e(_.values):e;return E({type:"SET_VALUES",payload:r}),(void 0===t?n:t)?O(r):Promise.resolve()}),R=(0,l.useCallback)(function(e,t){E({type:"SET_FIELD_ERROR",payload:{field:e,value:t}})},[]),j=hN(function(e,t,r){return E({type:"SET_FIELD_VALUE",payload:{field:e,value:t}}),(void 0===r?n:r)?O(hg(_.values,e,t)):Promise.resolve()}),F=(0,l.useCallback)(function(e,t){var n,r=t,i=e;if(!hh(e)){e.persist&&e.persist();var a=e.target?e.target:e.currentTarget,o=a.type,s=a.name,u=a.id,c=a.value,l=a.checked,f=(a.outerHTML,a.options),d=a.multiple;r=t||s||u,i=/number|range/.test(o)?(n=parseFloat(c),isNaN(n)?"":n):/checkbox/.test(o)?hI(hm(_.values,r),l,c):d?hC(f):c}r&&j(r,i)},[j,_.values]),Y=hN(function(e){if(hh(e))return function(t){return F(t,e)};F(e)}),B=hN(function(e,t,n){return void 0===t&&(t=!0),E({type:"SET_FIELD_TOUCHED",payload:{field:e,value:t}}),(void 0===n?i:n)?O(_.values):Promise.resolve()}),U=(0,l.useCallback)(function(e,t){e.persist&&e.persist();var n,r=e.target,i=r.name,a=r.id;r.outerHTML,B(t||i||a,!0)},[B]),H=hN(function(e){if(hh(e))return function(t){return U(t,e)};U(e)}),$=(0,l.useCallback)(function(e){hl(e)?E({type:"SET_FORMIK_STATE",payload:e}):E({type:"SET_FORMIK_STATE",payload:function(){return e}})},[]),z=(0,l.useCallback)(function(e){E({type:"SET_STATUS",payload:e})},[]),G=(0,l.useCallback)(function(e){E({type:"SET_ISSUBMITTING",payload:e})},[]),W=hN(function(){return E({type:"SUBMIT_ATTEMPT"}),O().then(function(e){var t,n=e instanceof Error;if(!n&&0===Object.keys(e).length){try{if(void 0===(t=q()))return}catch(r){throw r}return Promise.resolve(t).then(function(e){return v.current&&E({type:"SUBMIT_SUCCESS"}),e}).catch(function(e){if(v.current)throw E({type:"SUBMIT_FAILURE"}),e})}if(v.current&&(E({type:"SUBMIT_FAILURE"}),n))throw e})}),K=hN(function(e){e&&e.preventDefault&&hl(e.preventDefault)&&e.preventDefault(),e&&e.stopPropagation&&hl(e.stopPropagation)&&e.stopPropagation(),W().catch(function(e){console.warn("Warning: An unhandled error was caught from submitForm()",e)})}),V={resetForm:A,validateForm:O,validateField:L,setErrors:N,setFieldError:R,setFieldTouched:B,setFieldValue:j,setStatus:z,setSubmitting:G,setTouched:D,setValues:P,setFormikState:$,submitForm:W},q=hN(function(){return f(_.values,V)}),Z=hN(function(e){e&&e.preventDefault&&hl(e.preventDefault)&&e.preventDefault(),e&&e.stopPropagation&&hl(e.stopPropagation)&&e.stopPropagation(),A()}),X=(0,l.useCallback)(function(e){return{value:hm(_.values,e),error:hm(_.errors,e),touched:!!hm(_.touched,e),initialValue:hm(p.current,e),initialTouched:!!hm(m.current,e),initialError:hm(b.current,e)}},[_.errors,_.touched,_.values]),J=(0,l.useCallback)(function(e){return{setValue:function(t,n){return j(e,t,n)},setTouched:function(t,n){return B(e,t,n)},setError:function(t){return R(e,t)}}},[j,B,R]),Q=(0,l.useCallback)(function(e){var t=hf(e),n=t?e.name:e,r=hm(_.values,n),i={name:n,value:r,onChange:Y,onBlur:H};if(t){var a=e.type,o=e.value,s=e.as,u=e.multiple;"checkbox"===a?void 0===o?i.checked=!!r:(i.checked=!!(Array.isArray(r)&&~r.indexOf(o)),i.value=o):"radio"===a?(i.checked=r===o,i.value=o):"select"===s&&u&&(i.value=i.value||[],i.multiple=!0)}return i},[H,Y,_.values]),ee=(0,l.useMemo)(function(){return!sd()(p.current,_.values)},[p.current,_.values]),et=(0,l.useMemo)(function(){return void 0!==s?ee?_.errors&&0===Object.keys(_.errors).length:!1!==s&&hl(s)?s(h):s:_.errors&&0===Object.keys(_.errors).length},[s,ee,_.errors,h]);return ha({},_,{initialValues:p.current,initialErrors:b.current,initialTouched:m.current,initialStatus:g.current,handleBlur:H,handleChange:Y,handleReset:Z,handleSubmit:K,resetForm:A,setErrors:N,setFormikState:$,setFieldTouched:B,setFieldValue:j,setFieldError:R,setStatus:z,setSubmitting:G,setTouched:D,setValues:P,submitForm:W,validateForm:O,validateField:L,isValid:et,dirty:ee,unregisterField:I,registerField:C,getFieldProps:Q,getFieldMeta:X,getFieldHelpers:J,validateOnBlur:i,validateOnChange:n,validateOnMount:o})}function hT(e){var t=hx(e),n=e.component,r=e.children,i=e.render,a=e.innerRef;return(0,l.useImperativeHandle)(a,function(){return t}),(0,l.createElement)(hw,{value:t},n?(0,l.createElement)(n,t):i?i(t):r?hl(r)?r(t):hp(r)?null:l.Children.only(r):null)}function hM(e){var t={};if(e.inner){if(0===e.inner.length)return hg(t,e.path,e.message);for(var n=e.inner,r=Array.isArray(n),i=0,n=r?n:n[Symbol.iterator]();;){if(r){if(i>=n.length)break;a=n[i++]}else{if((i=n.next()).done)break;a=i.value}var a,o=a;hm(t,o.path)||(t=hg(t,o.path,o.message))}}return t}function hO(e,t,n,r){void 0===n&&(n=!1),void 0===r&&(r={});var i=hA(e);return t[n?"validateSync":"validate"](i,{abortEarly:!1,context:r})}function hA(e){var t=Array.isArray(e)?[]:{};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=String(n);!0===Array.isArray(e[r])?t[r]=e[r].map(function(e){return!0===Array.isArray(e)||sR(e)?hA(e):""!==e?e:void 0}):sR(e[r])?t[r]=hA(e[r]):t[r]=""!==e[r]?e[r]:void 0}return t}function hL(e,t,n){var r=e.slice();return t.forEach(function(t,i){if(void 0===r[i]){var a=!1!==n.clone&&n.isMergeableObject(t);r[i]=a?sk(Array.isArray(t)?[]:{},t,n):t}else n.isMergeableObject(t)?r[i]=sk(e[i],t,n):-1===e.indexOf(t)&&r.push(t)}),r}function hC(e){return Array.from(e).filter(function(e){return e.selected}).map(function(e){return e.value})}function hI(e,t,n){if("boolean"==typeof e)return Boolean(t);var r=[],i=!1,a=-1;if(Array.isArray(e))r=e,i=(a=e.indexOf(n))>=0;else if(!n||"true"==n||"false"==n)return Boolean(t);return t&&n&&!i?r.concat(n):i?r.slice(0,a).concat(r.slice(a+1)):r}var hD="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?l.useLayoutEffect:l.useEffect;function hN(e){var t=(0,l.useRef)(e);return hD(function(){t.current=e}),(0,l.useCallback)(function(){for(var e=arguments.length,n=Array(e),r=0;re?t:e},0);return Array.from(ha({},e,{length:t+1}))};(function(e){function t(t){var n;return(n=e.call(this,t)||this).updateArrayField=function(e,t,r){var i=n.props,a=i.name;(0,i.formik.setFormikState)(function(n){var i="function"==typeof r?r:e,o="function"==typeof t?t:e,s=hg(n.values,a,e(hm(n.values,a))),u=r?i(hm(n.errors,a)):void 0,c=t?o(hm(n.touched,a)):void 0;return hc(u)&&(u=void 0),hc(c)&&(c=void 0),ha({},n,{values:s,errors:r?hg(n.errors,a,u):n.errors,touched:t?hg(n.touched,a,c):n.touched})})},n.push=function(e){return n.updateArrayField(function(t){return[].concat(hU(t),[hi(e)])},!1,!1)},n.handlePush=function(e){return function(){return n.push(e)}},n.swap=function(e,t){return n.updateArrayField(function(n){return hF(n,e,t)},!0,!0)},n.handleSwap=function(e,t){return function(){return n.swap(e,t)}},n.move=function(e,t){return n.updateArrayField(function(n){return hj(n,e,t)},!0,!0)},n.handleMove=function(e,t){return function(){return n.move(e,t)}},n.insert=function(e,t){return n.updateArrayField(function(n){return hY(n,e,t)},function(t){return hY(t,e,null)},function(t){return hY(t,e,null)})},n.handleInsert=function(e,t){return function(){return n.insert(e,t)}},n.replace=function(e,t){return n.updateArrayField(function(n){return hB(n,e,t)},!1,!1)},n.handleReplace=function(e,t){return function(){return n.replace(e,t)}},n.unshift=function(e){var t=-1;return n.updateArrayField(function(n){var r=n?[e].concat(n):[e];return t<0&&(t=r.length),r},function(e){var n=e?[null].concat(e):[null];return t<0&&(t=n.length),n},function(e){var n=e?[null].concat(e):[null];return t<0&&(t=n.length),n}),t},n.handleUnshift=function(e){return function(){return n.unshift(e)}},n.handleRemove=function(e){return function(){return n.remove(e)}},n.handlePop=function(){return function(){return n.pop()}},n.remove=n.remove.bind(hu(n)),n.pop=n.pop.bind(hu(n)),n}ho(t,e);var n=t.prototype;return n.componentDidUpdate=function(e){this.props.validateOnChange&&this.props.formik.validateOnChange&&!sd()(hm(e.formik.values,e.name),hm(this.props.formik.values,this.props.name))&&this.props.formik.validateForm(this.props.formik.values)},n.remove=function(e){var t;return this.updateArrayField(function(n){var r=n?hU(n):[];return t||(t=r[e]),hl(r.splice)&&r.splice(e,1),r},!0,!0),t},n.pop=function(){var e;return this.updateArrayField(function(t){var n=t;return e||(e=n&&n.pop&&n.pop()),n},!0,!0),e},n.render=function(){var e={push:this.push,pop:this.pop,swap:this.swap,move:this.move,insert:this.insert,replace:this.replace,unshift:this.unshift,remove:this.remove,handlePush:this.handlePush,handlePop:this.handlePop,handleSwap:this.handleSwap,handleMove:this.handleMove,handleInsert:this.handleInsert,handleReplace:this.handleReplace,handleUnshift:this.handleUnshift,handleRemove:this.handleRemove},t=this.props,n=t.component,r=t.render,i=t.children,a=t.name,o=hs(t.formik,["validate","validationSchema"]),s=ha({},e,{form:o,name:a});return n?(0,l.createElement)(n,s):r?r(s):i?"function"==typeof i?i(s):hp(i)?null:l.Children.only(i):null},t})(l.Component).defaultProps={validateOnChange:!0},l.Component,l.Component;var hH=n(24802),h$=n(71209),hz=n(91750),hG=n(11970),hW=n(4689),hK=n(67598),hV=function(){return(hV=Object.assign||function(e){for(var t,n=1,r=arguments.length;nt.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,r=Object.getOwnPropertySymbols(e);it.indexOf(r[i])&&(n[r[i]]=e[r[i]]);return n}function hZ(e){var t=e.disabled,n=e.field,r=n.onBlur,i=hq(n,["onBlur"]),a=e.form,o=a.isSubmitting,s=a.touched,u=a.errors,c=e.onBlur,l=e.helperText,f=hq(e,["disabled","field","form","onBlur","helperText"]),d=hm(u,i.name),h=hm(s,i.name)&&!!d;return hV(hV({variant:f.variant,error:h,helperText:h?d:l,disabled:null!=t?t:o,onBlur:null!=c?c:function(e){r(null!=e?e:i.name)}},i),f)}function hX(e){var t=e.children,n=hq(e,["children"]);return(0,l.createElement)(iw.Z,hV({},hZ(n)),t)}function hJ(e){var t=e.disabled,n=e.field,r=n.onBlur,i=hq(n,["onBlur"]),a=e.form.isSubmitting,o=(e.type,e.onBlur),s=hq(e,["disabled","field","form","type","onBlur"]);return hV(hV({disabled:null!=t?t:a,onBlur:null!=o?o:function(e){r(null!=e?e:i.name)}},i),s)}function hQ(e){return(0,l.createElement)(hH.Z,hV({},hJ(e)))}function h1(e){var t,n=e.disabled,r=e.field,i=r.onBlur,a=hq(r,["onBlur"]),o=e.form.isSubmitting,s=(e.type,e.onBlur),u=hq(e,["disabled","field","form","type","onBlur"]);return hV(hV({disabled:null!=n?n:o,indeterminate:!Array.isArray(a.value)&&null==a.value,onBlur:null!=s?s:function(e){i(null!=e?e:a.name)}},a),u)}function h0(e){return(0,l.createElement)(h$.Z,hV({},h1(e)))}function h2(e){var t=e.Label,n=hq(e,["Label"]);return(0,l.createElement)(hz.Z,hV({control:(0,l.createElement)(h$.Z,hV({},h1(n)))},t))}function h3(e){var t=e.disabled,n=e.field,r=n.onBlur,i=hq(n,["onBlur"]),a=e.form.isSubmitting,o=e.onBlur,s=hq(e,["disabled","field","form","onBlur"]);return hV(hV({disabled:null!=t?t:a,onBlur:null!=o?o:function(e){r(null!=e?e:i.name)}},i),s)}function h4(e){return(0,l.createElement)(hG.default,hV({},h3(e)))}function h6(e){var t=e.field,n=t.onBlur,r=hq(t,["onBlur"]),i=(e.form,e.onBlur),a=hq(e,["field","form","onBlur"]);return hV(hV({onBlur:null!=i?i:function(e){n(null!=e?e:r.name)}},r),a)}function h5(e){return(0,l.createElement)(hW.Z,hV({},h6(e)))}function h8(e){var t=e.disabled,n=e.field,r=n.onBlur,i=hq(n,["onBlur"]),a=e.form.isSubmitting,o=e.onBlur,s=hq(e,["disabled","field","form","onBlur"]);return hV(hV({disabled:null!=t?t:a,onBlur:null!=o?o:function(e){r(null!=e?e:i.name)}},i),s)}function h9(e){return(0,l.createElement)(hK.default,hV({},h8(e)))}hX.displayName="FormikMaterialUITextField",hQ.displayName="FormikMaterialUISwitch",h0.displayName="FormikMaterialUICheckbox",h2.displayName="FormikMaterialUICheckboxWithLabel",h4.displayName="FormikMaterialUISelect",h5.displayName="FormikMaterialUIRadioGroup",h9.displayName="FormikMaterialUIInputBase";try{a=Map}catch(h7){}try{o=Set}catch(pe){}function pt(e,t,n){if(!e||"object"!=typeof e||"function"==typeof e)return e;if(e.nodeType&&"cloneNode"in e)return e.cloneNode(!0);if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp)return RegExp(e);if(Array.isArray(e))return e.map(pn);if(a&&e instanceof a)return new Map(Array.from(e.entries()));if(o&&e instanceof o)return new Set(Array.from(e.values()));if(e instanceof Object){t.push(e);var r=Object.create(e);for(var i in n.push(r),e){var s=t.findIndex(function(t){return t===e[i]});r[i]=s>-1?n[s]:pt(e[i],t,n)}return r}return e}function pn(e){return pt(e,[],[])}let pr=Object.prototype.toString,pi=Error.prototype.toString,pa=RegExp.prototype.toString,po="undefined"!=typeof Symbol?Symbol.prototype.toString:()=>"",ps=/^Symbol\((.*)\)(.*)$/;function pu(e){if(e!=+e)return"NaN";let t=0===e&&1/e<0;return t?"-0":""+e}function pc(e,t=!1){if(null==e||!0===e||!1===e)return""+e;let n=typeof e;if("number"===n)return pu(e);if("string"===n)return t?`"${e}"`:e;if("function"===n)return"[Function "+(e.name||"anonymous")+"]";if("symbol"===n)return po.call(e).replace(ps,"Symbol($1)");let r=pr.call(e).slice(8,-1);return"Date"===r?isNaN(e.getTime())?""+e:e.toISOString(e):"Error"===r||e instanceof Error?"["+pi.call(e)+"]":"RegExp"===r?pa.call(e):null}function pl(e,t){let n=pc(e,t);return null!==n?n:JSON.stringify(e,function(e,n){let r=pc(this[e],t);return null!==r?r:n},2)}let pf={default:"${path} is invalid",required:"${path} is a required field",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType({path:e,type:t,value:n,originalValue:r}){let i=null!=r&&r!==n,a=`${e} must be a \`${t}\` type, but the final value was: \`${pl(n,!0)}\``+(i?` (cast from the value \`${pl(r,!0)}\`).`:".");return null===n&&(a+='\n If "null" is intended as an empty value be sure to mark the schema as `.nullable()`'),a},defined:"${path} must be defined"},pd={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},ph={min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},pp={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},pb={isValue:"${path} field must be ${value}"},pm={noUnknown:"${path} field has unspecified keys: ${unknown}"},pg={min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must be have ${length} items"};Object.assign(Object.create(null),{mixed:pf,string:pd,number:ph,date:pp,object:pm,array:pg,boolean:pb});var pv=n(18721),py=n.n(pv);let pw=e=>e&&e.__isYupSchema__;class p_{constructor(e,t){if(this.refs=e,this.refs=e,"function"==typeof t){this.fn=t;return}if(!py()(t,"is"))throw TypeError("`is:` is required for `when()` conditions");if(!t.then&&!t.otherwise)throw TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:n,then:r,otherwise:i}=t,a="function"==typeof n?n:(...e)=>e.every(e=>e===n);this.fn=function(...e){let t=e.pop(),n=e.pop(),o=a(...e)?r:i;if(o)return"function"==typeof o?o(n):n.concat(o.resolve(t))}}resolve(e,t){let n=this.refs.map(e=>e.getValue(null==t?void 0:t.value,null==t?void 0:t.parent,null==t?void 0:t.context)),r=this.fn.apply(e,n.concat(e,t));if(void 0===r||r===e)return e;if(!pw(r))throw TypeError("conditions must return a schema object");return r.resolve(t)}}let pE=p_;function pS(e){return null==e?[]:[].concat(e)}function pk(){return(pk=Object.assign||function(e){for(var t=1;tpl(t[n])):"function"==typeof e?e(t):e}static isError(e){return e&&"ValidationError"===e.name}constructor(e,t,n,r){super(),this.name="ValidationError",this.value=t,this.path=n,this.type=r,this.errors=[],this.inner=[],pS(e).forEach(e=>{pT.isError(e)?(this.errors.push(...e.errors),this.inner=this.inner.concat(e.inner.length?e.inner:e)):this.errors.push(e)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0],Error.captureStackTrace&&Error.captureStackTrace(this,pT)}}let pM=e=>{let t=!1;return(...n)=>{t||(t=!0,e(...n))}};function pO(e,t){let{endEarly:n,tests:r,args:i,value:a,errors:o,sort:s,path:u}=e,c=pM(t),l=r.length,f=[];if(o=o||[],!l)return o.length?c(new pT(o,a,u)):c(null,a);for(let d=0;d=0||(i[n]=e[n]);return i}function pR(e){function t(t,n){let{value:r,path:i="",label:a,options:o,originalValue:s,sync:u}=t,c=pP(t,["value","path","label","options","originalValue","sync"]),{name:l,test:f,params:d,message:h}=e,{parent:p,context:b}=o;function m(e){return pD.isRef(e)?e.getValue(r,p,b):e}function g(e={}){let t=pL()(pN({value:r,originalValue:s,label:a,path:e.path||i},d,e.params),m),n=new pT(pT.formatError(e.message||h,t),r,t.path,e.type||l);return n.params=t,n}let v=pN({path:i,parent:p,type:l,createError:g,resolve:m,options:o,originalValue:s},c);if(!u){try{Promise.resolve(f.call(v,r,v)).then(e=>{pT.isError(e)?n(e):e?n(null,e):n(g())})}catch(y){n(y)}return}let w;try{var _;if(w=f.call(v,r,v),"function"==typeof(null==(_=w)?void 0:_.then))throw Error(`Validation test of type: "${v.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`)}catch(E){n(E);return}pT.isError(w)?n(w):w?n(null,w):n(g())}return t.OPTIONS=e,t}pD.prototype.__isYupRef=!0;let pj=e=>e.substr(0,e.length-1).substr(1);function pF(e,t,n,r=n){let i,a,o;return t?((0,pC.forEach)(t,(s,u,c)=>{let l=u?pj(s):s;if((e=e.resolve({context:r,parent:i,value:n})).innerType){let f=c?parseInt(l,10):0;if(n&&f>=n.length)throw Error(`Yup.reach cannot resolve an array item at index: ${s}, in the path: ${t}. because there is no value at that index. `);i=n,n=n&&n[f],e=e.innerType}if(!c){if(!e.fields||!e.fields[l])throw Error(`The schema does not contain the path: ${t}. (failed at: ${o} which is a type: "${e._type}")`);i=n,n=n&&n[l],e=e.fields[l]}a=l,o=u?"["+s+"]":"."+s}),{schema:e,parent:i,parentPath:a}):{parent:i,parentPath:t,schema:e}}class pY{constructor(){this.list=new Set,this.refs=new Map}get size(){return this.list.size+this.refs.size}describe(){let e=[];for(let t of this.list)e.push(t);for(let[,n]of this.refs)e.push(n.describe());return e}toArray(){return Array.from(this.list).concat(Array.from(this.refs.values()))}add(e){pD.isRef(e)?this.refs.set(e.key,e):this.list.add(e)}delete(e){pD.isRef(e)?this.refs.delete(e.key):this.list.delete(e)}has(e,t){if(this.list.has(e))return!0;let n,r=this.refs.values();for(;!(n=r.next()).done;)if(t(n.value)===e)return!0;return!1}clone(){let e=new pY;return e.list=new Set(this.list),e.refs=new Map(this.refs),e}merge(e,t){let n=this.clone();return e.list.forEach(e=>n.add(e)),e.refs.forEach(e=>n.add(e)),t.list.forEach(e=>n.delete(e)),t.refs.forEach(e=>n.delete(e)),n}}function pB(){return(pB=Object.assign||function(e){for(var t=1;t{this.typeError(pf.notType)}),this.type=(null==e?void 0:e.type)||"mixed",this.spec=pB({strip:!1,strict:!1,abortEarly:!0,recursive:!0,nullable:!1,presence:"optional"},null==e?void 0:e.spec)}get _type(){return this.type}_typeCheck(e){return!0}clone(e){if(this._mutate)return e&&Object.assign(this.spec,e),this;let t=Object.create(Object.getPrototypeOf(this));return t.type=this.type,t._typeError=this._typeError,t._whitelistError=this._whitelistError,t._blacklistError=this._blacklistError,t._whitelist=this._whitelist.clone(),t._blacklist=this._blacklist.clone(),t.exclusiveTests=pB({},this.exclusiveTests),t.deps=[...this.deps],t.conditions=[...this.conditions],t.tests=[...this.tests],t.transforms=[...this.transforms],t.spec=pn(pB({},this.spec,e)),t}label(e){var t=this.clone();return t.spec.label=e,t}meta(...e){if(0===e.length)return this.spec.meta;let t=this.clone();return t.spec.meta=Object.assign(t.spec.meta||{},e[0]),t}withMutation(e){let t=this._mutate;this._mutate=!0;let n=e(this);return this._mutate=t,n}concat(e){if(!e||e===this)return this;if(e.type!==this.type&&"mixed"!==this.type)throw TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${e.type}`);let t=this,n=e.clone(),r=pB({},t.spec,n.spec);return n.spec=r,n._typeError||(n._typeError=t._typeError),n._whitelistError||(n._whitelistError=t._whitelistError),n._blacklistError||(n._blacklistError=t._blacklistError),n._whitelist=t._whitelist.merge(e._whitelist,e._blacklist),n._blacklist=t._blacklist.merge(e._blacklist,e._whitelist),n.tests=t.tests,n.exclusiveTests=t.exclusiveTests,n.withMutation(t=>{e.tests.forEach(e=>{t.test(e.OPTIONS)})}),n}isType(e){return!!this.spec.nullable&&null===e||this._typeCheck(e)}resolve(e){let t=this;if(t.conditions.length){let n=t.conditions;(t=t.clone()).conditions=[],t=(t=n.reduce((t,n)=>n.resolve(t,e),t)).resolve(e)}return t}cast(e,t={}){let n=this.resolve(pB({value:e},t)),r=n._cast(e,t);if(void 0!==e&&!1!==t.assert&&!0!==n.isType(r)){let i=pl(e),a=pl(r);throw TypeError(`The value of ${t.path||"field"} could not be cast to a value that satisfies the schema type: "${n._type}". - -attempted value: ${i} -`+(a!==i?`result of cast: ${a}`:""))}return r}_cast(e,t){let n=void 0===e?e:this.transforms.reduce((t,n)=>n.call(this,t,e,this),e);return void 0===n&&(n=this.getDefault()),n}_validate(e,t={},n){let{sync:r,path:i,from:a=[],originalValue:o=e,strict:s=this.spec.strict,abortEarly:u=this.spec.abortEarly}=t,c=e;s||(c=this._cast(c,pB({assert:!1},t)));let l={value:c,path:i,options:t,originalValue:o,schema:this,label:this.spec.label,sync:r,from:a},f=[];this._typeError&&f.push(this._typeError),this._whitelistError&&f.push(this._whitelistError),this._blacklistError&&f.push(this._blacklistError),pO({args:l,value:c,path:i,sync:r,tests:f,endEarly:u},e=>{if(e)return void n(e,c);pO({tests:this.tests,args:l,path:i,sync:r,value:c,endEarly:u},n)})}validate(e,t,n){let r=this.resolve(pB({},t,{value:e}));return"function"==typeof n?r._validate(e,t,n):new Promise((n,i)=>r._validate(e,t,(e,t)=>{e?i(e):n(t)}))}validateSync(e,t){let n;return this.resolve(pB({},t,{value:e}))._validate(e,pB({},t,{sync:!0}),(e,t)=>{if(e)throw e;n=t}),n}isValid(e,t){return this.validate(e,t).then(()=>!0,e=>{if(pT.isError(e))return!1;throw e})}isValidSync(e,t){try{return this.validateSync(e,t),!0}catch(n){if(pT.isError(n))return!1;throw n}}_getDefault(){let e=this.spec.default;return null==e?e:"function"==typeof e?e.call(this):pn(e)}getDefault(e){return this.resolve(e||{})._getDefault()}default(e){return 0===arguments.length?this._getDefault():this.clone({default:e})}strict(e=!0){var t=this.clone();return t.spec.strict=e,t}_isPresent(e){return null!=e}defined(e=pf.defined){return this.test({message:e,name:"defined",exclusive:!0,test:e=>void 0!==e})}required(e=pf.required){return this.clone({presence:"required"}).withMutation(t=>t.test({message:e,name:"required",exclusive:!0,test(e){return this.schema._isPresent(e)}}))}notRequired(){var e=this.clone({presence:"optional"});return e.tests=e.tests.filter(e=>"required"!==e.OPTIONS.name),e}nullable(e=!0){return this.clone({nullable:!1!==e})}transform(e){var t=this.clone();return t.transforms.push(e),t}test(...e){let t;if(void 0===(t=1===e.length?"function"==typeof e[0]?{test:e[0]}:e[0]:2===e.length?{name:e[0],test:e[1]}:{name:e[0],message:e[1],test:e[2]}).message&&(t.message=pf.default),"function"!=typeof t.test)throw TypeError("`test` is a required parameters");let n=this.clone(),r=pR(t),i=t.exclusive||t.name&&!0===n.exclusiveTests[t.name];if(t.exclusive&&!t.name)throw TypeError("Exclusive tests must provide a unique `name` identifying the test");return t.name&&(n.exclusiveTests[t.name]=!!t.exclusive),n.tests=n.tests.filter(e=>e.OPTIONS.name!==t.name||!i&&e.OPTIONS.test!==r.OPTIONS.test),n.tests.push(r),n}when(e,t){Array.isArray(e)||"string"==typeof e||(t=e,e=".");let n=this.clone(),r=pS(e).map(e=>new pD(e));return r.forEach(e=>{e.isSibling&&n.deps.push(e.key)}),n.conditions.push(new pE(r,t)),n}typeError(e){var t=this.clone();return t._typeError=pR({message:e,name:"typeError",test(e){return!!(void 0===e||this.schema.isType(e))||this.createError({params:{type:this.schema._type}})}}),t}oneOf(e,t=pf.oneOf){var n=this.clone();return e.forEach(e=>{n._whitelist.add(e),n._blacklist.delete(e)}),n._whitelistError=pR({message:t,name:"oneOf",test(e){if(void 0===e)return!0;let t=this.schema._whitelist;return!!t.has(e,this.resolve)||this.createError({params:{values:t.toArray().join(", ")}})}}),n}notOneOf(e,t=pf.notOneOf){var n=this.clone();return e.forEach(e=>{n._blacklist.add(e),n._whitelist.delete(e)}),n._blacklistError=pR({message:t,name:"notOneOf",test(e){let t=this.schema._blacklist;return!t.has(e,this.resolve)||this.createError({params:{values:t.toArray().join(", ")}})}}),n}strip(e=!0){let t=this.clone();return t.spec.strip=e,t}describe(){let e=this.clone(),{label:t,meta:n}=e.spec,r={meta:n,label:t,type:e.type,oneOf:e._whitelist.describe(),notOneOf:e._blacklist.describe(),tests:e.tests.map(e=>({name:e.OPTIONS.name,params:e.OPTIONS.params})).filter((e,t,n)=>n.findIndex(t=>t.name===e.name)===t)};return r}}for(let pH of(pU.prototype.__isYupSchema__=!0,["validate","validateSync"]))pU.prototype[`${pH}At`]=function(e,t,n={}){let{parent:r,parentPath:i,schema:a}=pF(this,e,t,n.context);return a[pH](r&&r[i],pB({},n,{parent:r,path:e}))};for(let p$ of["equals","is"])pU.prototype[p$]=pU.prototype.oneOf;for(let pz of["not","nope"])pU.prototype[pz]=pU.prototype.notOneOf;pU.prototype.optional=pU.prototype.notRequired;let pG=pU;function pW(){return new pG}pW.prototype=pG.prototype;let pK=e=>null==e;function pV(){return new pq}class pq extends pU{constructor(){super({type:"boolean"}),this.withMutation(()=>{this.transform(function(e){if(!this.isType(e)){if(/^(true|1)$/i.test(String(e)))return!0;if(/^(false|0)$/i.test(String(e)))return!1}return e})})}_typeCheck(e){return e instanceof Boolean&&(e=e.valueOf()),"boolean"==typeof e}isTrue(e=pb.isValue){return this.test({message:e,name:"is-value",exclusive:!0,params:{value:"true"},test:e=>pK(e)||!0===e})}isFalse(e=pb.isValue){return this.test({message:e,name:"is-value",exclusive:!0,params:{value:"false"},test:e=>pK(e)||!1===e})}}pV.prototype=pq.prototype;let pZ=/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i,pX=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,pJ=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,pQ=e=>pK(e)||e===e.trim(),p1=({}).toString();function p0(){return new p2}class p2 extends pU{constructor(){super({type:"string"}),this.withMutation(()=>{this.transform(function(e){if(this.isType(e)||Array.isArray(e))return e;let t=null!=e&&e.toString?e.toString():e;return t===p1?e:t})})}_typeCheck(e){return e instanceof String&&(e=e.valueOf()),"string"==typeof e}_isPresent(e){return super._isPresent(e)&&!!e.length}length(e,t=pd.length){return this.test({message:t,name:"length",exclusive:!0,params:{length:e},test(t){return pK(t)||t.length===this.resolve(e)}})}min(e,t=pd.min){return this.test({message:t,name:"min",exclusive:!0,params:{min:e},test(t){return pK(t)||t.length>=this.resolve(e)}})}max(e,t=pd.max){return this.test({name:"max",exclusive:!0,message:t,params:{max:e},test(t){return pK(t)||t.length<=this.resolve(e)}})}matches(e,t){let n=!1,r,i;return t&&("object"==typeof t?{excludeEmptyString:n=!1,message:r,name:i}=t:r=t),this.test({name:i||"matches",message:r||pd.matches,params:{regex:e},test:t=>pK(t)||""===t&&n||-1!==t.search(e)})}email(e=pd.email){return this.matches(pZ,{name:"email",message:e,excludeEmptyString:!0})}url(e=pd.url){return this.matches(pX,{name:"url",message:e,excludeEmptyString:!0})}uuid(e=pd.uuid){return this.matches(pJ,{name:"uuid",message:e,excludeEmptyString:!1})}ensure(){return this.default("").transform(e=>null===e?"":e)}trim(e=pd.trim){return this.transform(e=>null!=e?e.trim():e).test({message:e,name:"trim",test:pQ})}lowercase(e=pd.lowercase){return this.transform(e=>pK(e)?e:e.toLowerCase()).test({message:e,name:"string_case",exclusive:!0,test:e=>pK(e)||e===e.toLowerCase()})}uppercase(e=pd.uppercase){return this.transform(e=>pK(e)?e:e.toUpperCase()).test({message:e,name:"string_case",exclusive:!0,test:e=>pK(e)||e===e.toUpperCase()})}}p0.prototype=p2.prototype;let p3=e=>e!=+e;function p4(){return new p6}class p6 extends pU{constructor(){super({type:"number"}),this.withMutation(()=>{this.transform(function(e){let t=e;if("string"==typeof t){if(""===(t=t.replace(/\s/g,"")))return NaN;t=+t}return this.isType(t)?t:parseFloat(t)})})}_typeCheck(e){return e instanceof Number&&(e=e.valueOf()),"number"==typeof e&&!p3(e)}min(e,t=ph.min){return this.test({message:t,name:"min",exclusive:!0,params:{min:e},test(t){return pK(t)||t>=this.resolve(e)}})}max(e,t=ph.max){return this.test({message:t,name:"max",exclusive:!0,params:{max:e},test(t){return pK(t)||t<=this.resolve(e)}})}lessThan(e,t=ph.lessThan){return this.test({message:t,name:"max",exclusive:!0,params:{less:e},test(t){return pK(t)||tthis.resolve(e)}})}positive(e=ph.positive){return this.moreThan(0,e)}negative(e=ph.negative){return this.lessThan(0,e)}integer(e=ph.integer){return this.test({name:"integer",message:e,test:e=>pK(e)||Number.isInteger(e)})}truncate(){return this.transform(e=>pK(e)?e:0|e)}round(e){var t,n=["ceil","floor","round","trunc"];if("trunc"===(e=(null==(t=e)?void 0:t.toLowerCase())||"round"))return this.truncate();if(-1===n.indexOf(e.toLowerCase()))throw TypeError("Only valid options for round() are: "+n.join(", "));return this.transform(t=>pK(t)?t:Math[e](t))}}p4.prototype=p6.prototype;var p5=/^(\d{4}|[+\-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,\.](\d{1,}))?)?(?:(Z)|([+\-])(\d{2})(?::?(\d{2}))?)?)?$/;function p8(e){var t,n,r=[1,4,5,6,7,10,11],i=0;if(n=p5.exec(e)){for(var a,o=0;a=r[o];++o)n[a]=+n[a]||0;n[2]=(+n[2]||1)-1,n[3]=+n[3]||1,n[7]=n[7]?String(n[7]).substr(0,3):0,(void 0===n[8]||""===n[8])&&(void 0===n[9]||""===n[9])?t=+new Date(n[1],n[2],n[3],n[4],n[5],n[6],n[7]):("Z"!==n[8]&&void 0!==n[9]&&(i=60*n[10]+n[11],"+"===n[9]&&(i=0-i)),t=Date.UTC(n[1],n[2],n[3],n[4],n[5]+i,n[6],n[7]))}else t=Date.parse?Date.parse(e):NaN;return t}let p9=new Date(""),p7=e=>"[object Date]"===Object.prototype.toString.call(e);function be(){return new bt}class bt extends pU{constructor(){super({type:"date"}),this.withMutation(()=>{this.transform(function(e){return this.isType(e)?e:(e=p8(e),isNaN(e)?p9:new Date(e))})})}_typeCheck(e){return p7(e)&&!isNaN(e.getTime())}prepareParam(e,t){let n;if(pD.isRef(e))n=e;else{let r=this.cast(e);if(!this._typeCheck(r))throw TypeError(`\`${t}\` must be a Date or a value that can be \`cast()\` to a Date`);n=r}return n}min(e,t=pp.min){let n=this.prepareParam(e,"min");return this.test({message:t,name:"min",exclusive:!0,params:{min:e},test(e){return pK(e)||e>=this.resolve(n)}})}max(e,t=pp.max){var n=this.prepareParam(e,"max");return this.test({message:t,name:"max",exclusive:!0,params:{max:e},test(e){return pK(e)||e<=this.resolve(n)}})}}bt.INVALID_DATE=p9,be.prototype=bt.prototype,be.INVALID_DATE=p9;var bn=n(11865),br=n.n(bn),bi=n(68929),ba=n.n(bi),bo=n(67523),bs=n.n(bo),bu=n(94633),bc=n.n(bu);function bl(e,t=[]){let n=[],r=[];function i(e,i){var a=(0,pC.split)(e)[0];~r.indexOf(a)||r.push(a),~t.indexOf(`${i}-${a}`)||n.push([i,a])}for(let a in e)if(py()(e,a)){let o=e[a];~r.indexOf(a)||r.push(a),pD.isRef(o)&&o.isSibling?i(o.path,a):pw(o)&&"deps"in o&&o.deps.forEach(e=>i(e,a))}return bc().array(r,n).reverse()}function bf(e,t){let n=1/0;return e.some((e,r)=>{var i;if((null==(i=t.path)?void 0:i.indexOf(e))!==-1)return n=r,!0}),n}function bd(e){return(t,n)=>bf(e,t)-bf(e,n)}function bh(){return(bh=Object.assign||function(e){for(var t=1;t"[object Object]"===Object.prototype.toString.call(e);function bb(e,t){let n=Object.keys(e.fields);return Object.keys(t).filter(e=>-1===n.indexOf(e))}let bm=bd([]);class bg extends pU{constructor(e){super({type:"object"}),this.fields=Object.create(null),this._sortErrors=bm,this._nodes=[],this._excludedEdges=[],this.withMutation(()=>{this.transform(function(e){if("string"==typeof e)try{e=JSON.parse(e)}catch(t){e=null}return this.isType(e)?e:null}),e&&this.shape(e)})}_typeCheck(e){return bp(e)||"function"==typeof e}_cast(e,t={}){var n;let r=super._cast(e,t);if(void 0===r)return this.getDefault();if(!this._typeCheck(r))return r;let i=this.fields,a=null!=(n=t.stripUnknown)?n:this.spec.noUnknown,o=this._nodes.concat(Object.keys(r).filter(e=>-1===this._nodes.indexOf(e))),s={},u=bh({},t,{parent:s,__validating:t.__validating||!1}),c=!1;for(let l of o){let f=i[l],d=py()(r,l);if(f){let h,p=r[l];u.path=(t.path?`${t.path}.`:"")+l;let b="spec"in(f=f.resolve({value:p,context:t.context,parent:s}))?f.spec:void 0,m=null==b?void 0:b.strict;if(null==b?void 0:b.strip){c=c||l in r;continue}void 0!==(h=t.__validating&&m?r[l]:f.cast(r[l],u))&&(s[l]=h)}else d&&!a&&(s[l]=r[l]);s[l]!==r[l]&&(c=!0)}return c?s:r}_validate(e,t={},n){let r=[],{sync:i,from:a=[],originalValue:o=e,abortEarly:s=this.spec.abortEarly,recursive:u=this.spec.recursive}=t;a=[{schema:this,value:o},...a],t.__validating=!0,t.originalValue=o,t.from=a,super._validate(e,t,(e,c)=>{if(e){if(!pT.isError(e)||s)return void n(e,c);r.push(e)}if(!u||!bp(c)){n(r[0]||null,c);return}o=o||c;let l=this._nodes.map(e=>(n,r)=>{let i=-1===e.indexOf(".")?(t.path?`${t.path}.`:"")+e:`${t.path||""}["${e}"]`,s=this.fields[e];if(s&&"validate"in s){s.validate(c[e],bh({},t,{path:i,from:a,strict:!0,parent:c,originalValue:o[e]}),r);return}r(null)});pO({sync:i,tests:l,value:c,errors:r,endEarly:s,sort:this._sortErrors,path:t.path},n)})}clone(e){let t=super.clone(e);return t.fields=bh({},this.fields),t._nodes=this._nodes,t._excludedEdges=this._excludedEdges,t._sortErrors=this._sortErrors,t}concat(e){let t=super.concat(e),n=t.fields;for(let[r,i]of Object.entries(this.fields)){let a=n[r];void 0===a?n[r]=i:a instanceof pU&&i instanceof pU&&(n[r]=i.concat(a))}return t.withMutation(()=>t.shape(n))}getDefaultFromShape(){let e={};return this._nodes.forEach(t=>{let n=this.fields[t];e[t]="default"in n?n.getDefault():void 0}),e}_getDefault(){return"default"in this.spec?super._getDefault():this._nodes.length?this.getDefaultFromShape():void 0}shape(e,t=[]){let n=this.clone(),r=Object.assign(n.fields,e);if(n.fields=r,n._sortErrors=bd(Object.keys(r)),t.length){Array.isArray(t[0])||(t=[t]);let i=t.map(([e,t])=>`${e}-${t}`);n._excludedEdges=n._excludedEdges.concat(i)}return n._nodes=bl(r,n._excludedEdges),n}pick(e){let t={};for(let n of e)this.fields[n]&&(t[n]=this.fields[n]);return this.clone().withMutation(e=>(e.fields={},e.shape(t)))}omit(e){let t=this.clone(),n=t.fields;for(let r of(t.fields={},e))delete n[r];return t.withMutation(()=>t.shape(n))}from(e,t,n){let r=(0,pC.getter)(e,!0);return this.transform(i=>{if(null==i)return i;let a=i;return py()(i,e)&&(a=bh({},i),n||delete a[e],a[t]=r(i)),a})}noUnknown(e=!0,t=pm.noUnknown){"string"==typeof e&&(t=e,e=!0);let n=this.test({name:"noUnknown",exclusive:!0,message:t,test(t){if(null==t)return!0;let n=bb(this.schema,t);return!e||0===n.length||this.createError({params:{unknown:n.join(", ")}})}});return n.spec.noUnknown=e,n}unknown(e=!0,t=pm.noUnknown){return this.noUnknown(!e,t)}transformKeys(e){return this.transform(t=>t&&bs()(t,(t,n)=>e(n)))}camelCase(){return this.transformKeys(ba())}snakeCase(){return this.transformKeys(br())}constantCase(){return this.transformKeys(e=>br()(e).toUpperCase())}describe(){let e=super.describe();return e.fields=pL()(this.fields,e=>e.describe()),e}}function bv(e){return new bg(e)}function by(){return(by=Object.assign||function(e){for(var t=1;t{this.transform(function(e){if("string"==typeof e)try{e=JSON.parse(e)}catch(t){e=null}return this.isType(e)?e:null})})}_typeCheck(e){return Array.isArray(e)}get _subType(){return this.innerType}_cast(e,t){let n=super._cast(e,t);if(!this._typeCheck(n)||!this.innerType)return n;let r=!1,i=n.map((e,n)=>{let i=this.innerType.cast(e,by({},t,{path:`${t.path||""}[${n}]`}));return i!==e&&(r=!0),i});return r?i:n}_validate(e,t={},n){var r,i;let a=[],o=t.sync,s=t.path,u=this.innerType,c=null!=(r=t.abortEarly)?r:this.spec.abortEarly,l=null!=(i=t.recursive)?i:this.spec.recursive,f=null!=t.originalValue?t.originalValue:e;super._validate(e,t,(e,r)=>{if(e){if(!pT.isError(e)||c)return void n(e,r);a.push(e)}if(!l||!u||!this._typeCheck(r)){n(a[0]||null,r);return}f=f||r;let i=Array(r.length);for(let d=0;du.validate(h,b,t)}pO({sync:o,path:s,value:r,errors:a,endEarly:c,tests:i},n)})}clone(e){let t=super.clone(e);return t.innerType=this.innerType,t}concat(e){let t=super.concat(e);return t.innerType=this.innerType,e.innerType&&(t.innerType=t.innerType?t.innerType.concat(e.innerType):e.innerType),t}of(e){let t=this.clone();if(!pw(e))throw TypeError("`array.of()` sub-schema must be a valid yup schema not: "+pl(e));return t.innerType=e,t}length(e,t=pg.length){return this.test({message:t,name:"length",exclusive:!0,params:{length:e},test(t){return pK(t)||t.length===this.resolve(e)}})}min(e,t){return t=t||pg.min,this.test({message:t,name:"min",exclusive:!0,params:{min:e},test(t){return pK(t)||t.length>=this.resolve(e)}})}max(e,t){return t=t||pg.max,this.test({message:t,name:"max",exclusive:!0,params:{max:e},test(t){return pK(t)||t.length<=this.resolve(e)}})}ensure(){return this.default(()=>[]).transform((e,t)=>this._typeCheck(e)?e:null==t?[]:[].concat(t))}compact(e){let t=e?(t,n,r)=>!e(t,n,r):e=>!!e;return this.transform(e=>null!=e?e.filter(t):e)}describe(){let e=super.describe();return this.innerType&&(e.innerType=this.innerType.describe()),e}nullable(e=!0){return super.nullable(e)}defined(){return super.defined()}required(e){return super.required(e)}}bw.prototype=b_.prototype;var bE=bv().shape({name:p0().required("Required"),url:p0().required("Required")}),bS=function(e){var t=e.initialValues,n=e.onSubmit,r=e.submitButtonText,i=e.nameDisabled,a=void 0!==i&&i;return l.createElement(hT,{initialValues:t,validationSchema:bE,onSubmit:n},function(e){var t=e.isSubmitting;return l.createElement(l.Fragment,null,l.createElement(hR,{"data-testid":"bridge-form",noValidate:!0},l.createElement(d.Z,{container:!0,spacing:16},l.createElement(d.Z,{item:!0,xs:12,md:7},l.createElement(hP,{component:hX,id:"name",name:"name",label:"Name",disabled:a,required:!0,fullWidth:!0,FormHelperTextProps:{"data-testid":"name-helper-text"}})),l.createElement(d.Z,{item:!0,xs:12,md:7},l.createElement(hP,{component:hX,id:"url",name:"url",label:"Bridge URL",placeholder:"https://",required:!0,fullWidth:!0,FormHelperTextProps:{"data-testid":"url-helper-text"}})),l.createElement(d.Z,{item:!0,xs:12,md:7},l.createElement(d.Z,{container:!0,spacing:16},l.createElement(d.Z,{item:!0,xs:7},l.createElement(hP,{component:hX,id:"minimumContractPayment",name:"minimumContractPayment",label:"Minimum Contract Payment",placeholder:"0",fullWidth:!0,inputProps:{min:0},FormHelperTextProps:{"data-testid":"minimumContractPayment-helper-text"}})),l.createElement(d.Z,{item:!0,xs:7},l.createElement(hP,{component:hX,id:"confirmations",name:"confirmations",label:"Confirmations",placeholder:"0",type:"number",fullWidth:!0,inputProps:{min:0},FormHelperTextProps:{"data-testid":"confirmations-helper-text"}})))),l.createElement(d.Z,{item:!0,xs:12,md:7},l.createElement(ok.default,{variant:"contained",color:"primary",type:"submit",disabled:t,size:"large"},r)))))})},bk=function(e){var t=e.bridge,n=e.onSubmit,r={name:t.name,url:t.url,minimumContractPayment:t.minimumContractPayment,confirmations:t.confirmations};return l.createElement(ig,null,l.createElement(d.Z,{container:!0,spacing:40},l.createElement(d.Z,{item:!0,xs:12,md:11,lg:9},l.createElement(r5.Z,null,l.createElement(sl.Z,{title:"Edit Bridge",action:l.createElement(aA.Z,{component:tz,href:"/bridges/".concat(t.id)},"Cancel")}),l.createElement(aW.Z,null,l.createElement(bS,{nameDisabled:!0,initialValues:r,onSubmit:n,submitButtonText:"Save Bridge"}))))))};function bx(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]e.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]e.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&void 0!==arguments[0]&&arguments[0],t=e?function(){return l.createElement(x.default,{variant:"body1"},"Loading...")}:function(){return null};return{isLoading:e,LoadingPlaceholder:t}},mc=n(76023);function ml(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]e.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function mB(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n=4?[e[0],e[1],e[2],e[3],"".concat(e[0],".").concat(e[1]),"".concat(e[0],".").concat(e[2]),"".concat(e[0],".").concat(e[3]),"".concat(e[1],".").concat(e[0]),"".concat(e[1],".").concat(e[2]),"".concat(e[1],".").concat(e[3]),"".concat(e[2],".").concat(e[0]),"".concat(e[2],".").concat(e[1]),"".concat(e[2],".").concat(e[3]),"".concat(e[3],".").concat(e[0]),"".concat(e[3],".").concat(e[1]),"".concat(e[3],".").concat(e[2]),"".concat(e[0],".").concat(e[1],".").concat(e[2]),"".concat(e[0],".").concat(e[1],".").concat(e[3]),"".concat(e[0],".").concat(e[2],".").concat(e[1]),"".concat(e[0],".").concat(e[2],".").concat(e[3]),"".concat(e[0],".").concat(e[3],".").concat(e[1]),"".concat(e[0],".").concat(e[3],".").concat(e[2]),"".concat(e[1],".").concat(e[0],".").concat(e[2]),"".concat(e[1],".").concat(e[0],".").concat(e[3]),"".concat(e[1],".").concat(e[2],".").concat(e[0]),"".concat(e[1],".").concat(e[2],".").concat(e[3]),"".concat(e[1],".").concat(e[3],".").concat(e[0]),"".concat(e[1],".").concat(e[3],".").concat(e[2]),"".concat(e[2],".").concat(e[0],".").concat(e[1]),"".concat(e[2],".").concat(e[0],".").concat(e[3]),"".concat(e[2],".").concat(e[1],".").concat(e[0]),"".concat(e[2],".").concat(e[1],".").concat(e[3]),"".concat(e[2],".").concat(e[3],".").concat(e[0]),"".concat(e[2],".").concat(e[3],".").concat(e[1]),"".concat(e[3],".").concat(e[0],".").concat(e[1]),"".concat(e[3],".").concat(e[0],".").concat(e[2]),"".concat(e[3],".").concat(e[1],".").concat(e[0]),"".concat(e[3],".").concat(e[1],".").concat(e[2]),"".concat(e[3],".").concat(e[2],".").concat(e[0]),"".concat(e[3],".").concat(e[2],".").concat(e[1]),"".concat(e[0],".").concat(e[1],".").concat(e[2],".").concat(e[3]),"".concat(e[0],".").concat(e[1],".").concat(e[3],".").concat(e[2]),"".concat(e[0],".").concat(e[2],".").concat(e[1],".").concat(e[3]),"".concat(e[0],".").concat(e[2],".").concat(e[3],".").concat(e[1]),"".concat(e[0],".").concat(e[3],".").concat(e[1],".").concat(e[2]),"".concat(e[0],".").concat(e[3],".").concat(e[2],".").concat(e[1]),"".concat(e[1],".").concat(e[0],".").concat(e[2],".").concat(e[3]),"".concat(e[1],".").concat(e[0],".").concat(e[3],".").concat(e[2]),"".concat(e[1],".").concat(e[2],".").concat(e[0],".").concat(e[3]),"".concat(e[1],".").concat(e[2],".").concat(e[3],".").concat(e[0]),"".concat(e[1],".").concat(e[3],".").concat(e[0],".").concat(e[2]),"".concat(e[1],".").concat(e[3],".").concat(e[2],".").concat(e[0]),"".concat(e[2],".").concat(e[0],".").concat(e[1],".").concat(e[3]),"".concat(e[2],".").concat(e[0],".").concat(e[3],".").concat(e[1]),"".concat(e[2],".").concat(e[1],".").concat(e[0],".").concat(e[3]),"".concat(e[2],".").concat(e[1],".").concat(e[3],".").concat(e[0]),"".concat(e[2],".").concat(e[3],".").concat(e[0],".").concat(e[1]),"".concat(e[2],".").concat(e[3],".").concat(e[1],".").concat(e[0]),"".concat(e[3],".").concat(e[0],".").concat(e[1],".").concat(e[2]),"".concat(e[3],".").concat(e[0],".").concat(e[2],".").concat(e[1]),"".concat(e[3],".").concat(e[1],".").concat(e[0],".").concat(e[2]),"".concat(e[3],".").concat(e[1],".").concat(e[2],".").concat(e[0]),"".concat(e[3],".").concat(e[2],".").concat(e[0],".").concat(e[1]),"".concat(e[3],".").concat(e[2],".").concat(e[1],".").concat(e[0])]:void 0}var mZ={};function mX(e){if(0===e.length||1===e.length)return e;var t=e.join(".");return mZ[t]||(mZ[t]=mq(e)),mZ[t]}function mJ(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;return mX(e.filter(function(e){return"token"!==e})).reduce(function(e,t){return mK({},e,n[t])},t)}function mQ(e){return e.join(" ")}function m1(e,t){var n=0;return function(r){return n+=1,r.map(function(r,i){return m0({node:r,stylesheet:e,useInlineStyles:t,key:"code-segment-".concat(n,"-").concat(i)})})}}function m0(e){var t=e.node,n=e.stylesheet,r=e.style,i=void 0===r?{}:r,a=e.useInlineStyles,o=e.key,s=t.properties,u=t.type,c=t.tagName,f=t.value;if("text"===u)return f;if(c){var d,h=m1(n,a);if(a){var p=Object.keys(n).reduce(function(e,t){return t.split(".").forEach(function(t){e.includes(t)||e.push(t)}),e},[]),b=s.className&&s.className.includes("token")?["token"]:[],m=s.className&&b.concat(s.className.filter(function(e){return!p.includes(e)}));d=mK({},s,{className:mQ(m)||void 0,style:mJ(s.className,Object.assign({},s.style,i),n)})}else d=mK({},s,{className:mQ(s.className)});var g=h(t.children);return l.createElement(c,(0,mV.Z)({key:o},d),g)}}let m2=function(e,t){return -1!==e.listLanguages().indexOf(t)};var m3=/\n/g;function m4(e){return e.match(m3)}function m6(e){var t=e.lines,n=e.startingLineNumber,r=e.style;return t.map(function(e,t){var i=t+n;return l.createElement("span",{key:"line-".concat(t),className:"react-syntax-highlighter-line-number",style:"function"==typeof r?r(i):r},"".concat(i,"\n"))})}function m5(e){var t=e.codeString,n=e.codeStyle,r=e.containerStyle,i=void 0===r?{float:"left",paddingRight:"10px"}:r,a=e.numberStyle,o=void 0===a?{}:a,s=e.startingLineNumber;return l.createElement("code",{style:Object.assign({},n,i)},m6({lines:t.replace(/\n$/,"").split("\n"),style:o,startingLineNumber:s}))}function m8(e){return"".concat(e.toString().length,".25em")}function m9(e,t){return{type:"element",tagName:"span",properties:{key:"line-number--".concat(e),className:["comment","linenumber","react-syntax-highlighter-line-number"],style:t},children:[{type:"text",value:e}]}}function m7(e,t,n){var r,i={display:"inline-block",minWidth:m8(n),paddingRight:"1em",textAlign:"right",userSelect:"none"};return mK({},i,"function"==typeof e?e(t):e)}function ge(e){var t=e.children,n=e.lineNumber,r=e.lineNumberStyle,i=e.largestLineNumber,a=e.showInlineLineNumbers,o=e.lineProps,s=void 0===o?{}:o,u=e.className,c=void 0===u?[]:u,l=e.showLineNumbers,f=e.wrapLongLines,d="function"==typeof s?s(n):s;if(d.className=c,n&&a){var h=m7(r,n,i);t.unshift(m9(n,h))}return f&l&&(d.style=mK({},d.style,{display:"flex"})),{type:"element",tagName:"span",properties:d,children:t}}function gt(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=0;r2&&void 0!==arguments[2]?arguments[2]:[];return ge({children:e,lineNumber:t,lineNumberStyle:s,largestLineNumber:o,showInlineLineNumbers:i,lineProps:n,className:a,showLineNumbers:r,wrapLongLines:u})}function b(e,t){if(r&&t&&i){var n=m7(s,t,o);e.unshift(m9(t,n))}return e}function m(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return t||r.length>0?p(e,n,r):b(e,n)}for(var g=function(){var e=l[h],t=e.children[0].value;if(m4(t)){var n=t.split("\n");n.forEach(function(t,i){var o=r&&f.length+a,s={type:"text",value:"".concat(t,"\n")};if(0===i){var u=l.slice(d+1,h).concat(ge({children:[s],className:e.properties.className})),c=m(u,o);f.push(c)}else if(i===n.length-1){if(l[h+1]&&l[h+1].children&&l[h+1].children[0]){var p={type:"text",value:"".concat(t)},b=ge({children:[p],className:e.properties.className});l.splice(h+1,0,b)}else{var g=[s],v=m(g,o,e.properties.className);f.push(v)}}else{var y=[s],w=m(y,o,e.properties.className);f.push(w)}}),d=h}h++};h code[class*="language-"]':{background:"#f5f2f0",padding:".1em",borderRadius:".3em",whiteSpace:"normal"},comment:{color:"slategray"},prolog:{color:"slategray"},doctype:{color:"slategray"},cdata:{color:"slategray"},punctuation:{color:"#999"},namespace:{Opacity:".7"},property:{color:"#905"},tag:{color:"#905"},boolean:{color:"#905"},number:{color:"#905"},constant:{color:"#905"},symbol:{color:"#905"},deleted:{color:"#905"},selector:{color:"#690"},"attr-name":{color:"#690"},string:{color:"#690"},char:{color:"#690"},builtin:{color:"#690"},inserted:{color:"#690"},operator:{color:"#9a6e3a",background:"hsla(0, 0%, 100%, .5)"},entity:{color:"#9a6e3a",background:"hsla(0, 0%, 100%, .5)",cursor:"help"},url:{color:"#9a6e3a",background:"hsla(0, 0%, 100%, .5)"},".language-css .token.string":{color:"#9a6e3a",background:"hsla(0, 0%, 100%, .5)"},".style .token.string":{color:"#9a6e3a",background:"hsla(0, 0%, 100%, .5)"},atrule:{color:"#07a"},"attr-value":{color:"#07a"},keyword:{color:"#07a"},function:{color:"#DD4A68"},"class-name":{color:"#DD4A68"},regex:{color:"#e90"},important:{color:"#e90",fontWeight:"bold"},variable:{color:"#e90"},bold:{fontWeight:"bold"},italic:{fontStyle:"italic"}};var gu=n(98695),gc=n.n(gu);let gl=["abap","abnf","actionscript","ada","agda","al","antlr4","apacheconf","apl","applescript","aql","arduino","arff","asciidoc","asm6502","aspnet","autohotkey","autoit","bash","basic","batch","bbcode","birb","bison","bnf","brainfuck","brightscript","bro","bsl","c","cil","clike","clojure","cmake","coffeescript","concurnas","cpp","crystal","csharp","csp","css-extras","css","cypher","d","dart","dax","dhall","diff","django","dns-zone-file","docker","ebnf","editorconfig","eiffel","ejs","elixir","elm","erb","erlang","etlua","excel-formula","factor","firestore-security-rules","flow","fortran","fsharp","ftl","gcode","gdscript","gedcom","gherkin","git","glsl","gml","go","graphql","groovy","haml","handlebars","haskell","haxe","hcl","hlsl","hpkp","hsts","http","ichigojam","icon","iecst","ignore","inform7","ini","io","j","java","javadoc","javadoclike","javascript","javastacktrace","jolie","jq","js-extras","js-templates","jsdoc","json","json5","jsonp","jsstacktrace","jsx","julia","keyman","kotlin","latex","latte","less","lilypond","liquid","lisp","livescript","llvm","lolcode","lua","makefile","markdown","markup-templating","markup","matlab","mel","mizar","mongodb","monkey","moonscript","n1ql","n4js","nand2tetris-hdl","naniscript","nasm","neon","nginx","nim","nix","nsis","objectivec","ocaml","opencl","oz","parigp","parser","pascal","pascaligo","pcaxis","peoplecode","perl","php-extras","php","phpdoc","plsql","powerquery","powershell","processing","prolog","properties","protobuf","pug","puppet","pure","purebasic","purescript","python","q","qml","qore","r","racket","reason","regex","renpy","rest","rip","roboconf","robotframework","ruby","rust","sas","sass","scala","scheme","scss","shell-session","smali","smalltalk","smarty","sml","solidity","solution-file","soy","sparql","splunk-spl","sqf","sql","stan","stylus","swift","t4-cs","t4-templating","t4-vb","tap","tcl","textile","toml","tsx","tt2","turtle","twig","typescript","typoscript","unrealscript","vala","vbnet","velocity","verilog","vhdl","vim","visual-basic","warpscript","wasm","wiki","xeora","xml-doc","xojo","xquery","yaml","yang","zig"];var gf=go(gc(),gs);gf.supportedLanguages=gl;let gd=gf;var gh=n(64566);function gp(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function gb(){var e=gp(["\n query FetchConfigV2 {\n configv2 {\n user\n effective\n }\n }\n"]);return gb=function(){return e},e}var gm=n0(gb()),gg=function(e){var t=e.children;return l.createElement(ir.Z,null,l.createElement(r7.default,{component:"th",scope:"row",colSpan:3},t))},gv=function(){return l.createElement(gg,null,"...")},gy=function(e){var t=e.children;return l.createElement(gg,null,t)},gw=function(e){var t=e.loading,n=e.toml,r=e.error,i=void 0===r?"":r,a=e.title,o=e.expanded;if(i)return l.createElement(gy,null,i);if(t)return l.createElement(gv,null);a||(a="TOML");var s={display:"block"};return l.createElement(x.default,null,l.createElement(mP.Z,{defaultExpanded:o},l.createElement(mR.Z,{expandIcon:l.createElement(gh.Z,null)},a),l.createElement(mj.Z,{style:s},l.createElement(gd,{language:"toml",style:gs},n))))},g_=function(){var e=rv(gm,{fetchPolicy:"cache-and-network"}),t=e.data,n=e.loading,r=e.error;return(null==t?void 0:t.configv2.effective)=="N/A"?l.createElement(l.Fragment,null,l.createElement(d.Z,{item:!0,xs:12},l.createElement(r5.Z,null,l.createElement(sl.Z,{title:"TOML Configuration"}),l.createElement(gw,{title:"V2 config dump:",error:null==r?void 0:r.message,loading:n,toml:null==t?void 0:t.configv2.user,showHead:!0})))):l.createElement(l.Fragment,null,l.createElement(d.Z,{container:!0},l.createElement(d.Z,{item:!0,xs:12},l.createElement(r5.Z,null,l.createElement(sl.Z,{title:"TOML Configuration"}),l.createElement(gw,{title:"User specified:",error:null==r?void 0:r.message,loading:n,toml:null==t?void 0:t.configv2.user,showHead:!0,expanded:!0}),l.createElement(gw,{title:"Effective (with defaults):",error:null==r?void 0:r.message,loading:n,toml:null==t?void 0:t.configv2.effective,showHead:!0})))))},gE=n(34823),gS=function(e){return(0,b.createStyles)({cell:{paddingTop:1.5*e.spacing.unit,paddingBottom:1.5*e.spacing.unit}})},gk=(0,b.withStyles)(gS)(function(e){var t=e.classes,n=(0,A.I0)();(0,l.useEffect)(function(){n((0,ty.DQ)())});var r=(0,A.v9)(gE.N,A.wU);return l.createElement(r5.Z,null,l.createElement(sl.Z,{title:"Node"}),l.createElement(r8.Z,null,l.createElement(r9.Z,null,l.createElement(ir.Z,null,l.createElement(r7.default,{className:t.cell},l.createElement(x.default,null,"Version"),l.createElement(x.default,{variant:"subtitle1",color:"textSecondary"},r.version))),l.createElement(ir.Z,null,l.createElement(r7.default,{className:t.cell},l.createElement(x.default,null,"SHA"),l.createElement(x.default,{variant:"subtitle1",color:"textSecondary"},r.commitSHA))))))}),gx=function(){return l.createElement(ig,null,l.createElement(d.Z,{container:!0},l.createElement(d.Z,{item:!0,sm:12,md:8},l.createElement(d.Z,{container:!0},l.createElement(g_,null))),l.createElement(d.Z,{item:!0,sm:12,md:4},l.createElement(d.Z,{container:!0},l.createElement(d.Z,{item:!0,xs:12},l.createElement(gk,null)),l.createElement(d.Z,{item:!0,xs:12},l.createElement(mN,null)),l.createElement(d.Z,{item:!0,xs:12},l.createElement(mE,null))))))},gT=function(){return l.createElement(gx,null)},gM=function(){return l.createElement(gT,null)},gO=n(44431),gA=1e18,gL=function(e){return new gO.BigNumber(e).dividedBy(gA).toFixed(8)},gC=function(e){var t=e.keys,n=e.chainID,r=e.hideHeaderTitle;return l.createElement(l.Fragment,null,l.createElement(sl.Z,{title:!r&&"Account Balances",subheader:"Chain ID "+n}),l.createElement(aW.Z,null,l.createElement(w.default,{dense:!1,disablePadding:!0},t&&t.map(function(e,r){return l.createElement(l.Fragment,null,l.createElement(_.default,{disableGutters:!0,key:["acc-balance",n.toString(),r.toString()].join("-")},l.createElement(E.Z,{primary:l.createElement(l.Fragment,null,l.createElement(d.Z,{container:!0,spacing:16},l.createElement(d.Z,{item:!0,xs:12},l.createElement(op,{title:"Address"}),l.createElement(ob,{value:e.address})),l.createElement(d.Z,{item:!0,xs:6},l.createElement(op,{title:"Native Token Balance"}),l.createElement(ob,{value:e.ethBalance||"--"})),l.createElement(d.Z,{item:!0,xs:6},l.createElement(op,{title:"LINK Balance"}),l.createElement(ob,{value:e.linkBalance?gL(e.linkBalance):"--"}))))})),r+1s&&l.createElement(gB.Z,null,l.createElement(ir.Z,null,l.createElement(r7.default,{className:r.footer},l.createElement(aA.Z,{href:"/runs",component:tz},"View More"))))))});function vt(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function vn(){var e=vt(["\n ","\n query FetchRecentJobRuns($offset: Int, $limit: Int) {\n jobRuns(offset: $offset, limit: $limit) {\n results {\n ...RecentJobRunsPayload_ResultsFields\n }\n metadata {\n total\n }\n }\n }\n"]);return vn=function(){return e},e}var vr=5,vi=n0(vn(),g9),va=function(){var e=rv(vi,{variables:{offset:0,limit:vr},fetchPolicy:"cache-and-network"}),t=e.data,n=e.loading,r=e.error;return l.createElement(ve,{data:t,errorMsg:null==r?void 0:r.message,loading:n,maxRunsSize:vr})},vo=function(e){return(0,b.createStyles)({style:{textAlign:"center",padding:2.5*e.spacing.unit,position:"fixed",left:"0",bottom:"0",width:"100%",borderRadius:0},bareAnchor:{color:e.palette.common.black,textDecoration:"none"}})},vs=(0,b.withStyles)(vo)(function(e){var t=e.classes,n=(0,A.v9)(gE.N,A.wU),r=(0,A.I0)();return(0,l.useEffect)(function(){r((0,ty.DQ)())}),l.createElement(ii.default,{className:t.style},l.createElement(x.default,null,"Chainlink Node ",n.version," at commit"," ",l.createElement("a",{target:"_blank",rel:"noopener noreferrer",href:"https://github.com/smartcontractkit/chainlink/commit/".concat(n.commitSHA),className:t.bareAnchor},n.commitSHA)))}),vu=function(e){return(0,b.createStyles)({cell:{borderColor:e.palette.divider,borderTop:"1px solid",borderBottom:"none",paddingTop:2*e.spacing.unit,paddingBottom:2*e.spacing.unit,paddingLeft:2*e.spacing.unit},block:{display:"block"},overflowEllipsis:{textOverflow:"ellipsis",overflow:"hidden"}})},vc=(0,b.withStyles)(vu)(function(e){var t=e.classes,n=e.job;return l.createElement(ir.Z,null,l.createElement(r7.default,{scope:"row",className:t.cell},l.createElement(d.Z,{container:!0,spacing:0},l.createElement(d.Z,{item:!0,xs:12},l.createElement(ih,{href:"/jobs/".concat(n.id),classes:{linkContent:t.block}},l.createElement(x.default,{className:t.overflowEllipsis,variant:"body1",component:"span",color:"primary"},n.name||n.id))),l.createElement(d.Z,{item:!0,xs:12},l.createElement(x.default,{variant:"body1",color:"textSecondary"},"Created ",l.createElement(aO,{tooltip:!0},n.createdAt))))))});function vl(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function vf(){var e=vl(["\n fragment RecentJobsPayload_ResultsFields on Job {\n id\n name\n createdAt\n }\n"]);return vf=function(){return e},e}var vd=n0(vf()),vh=function(){return(0,b.createStyles)({cardHeader:{borderBottom:0},table:{tableLayout:"fixed"}})},vp=(0,b.withStyles)(vh)(function(e){var t,n,r=e.classes,i=e.data,a=e.errorMsg,o=e.loading;return l.createElement(r5.Z,null,l.createElement(sl.Z,{title:"Recent Jobs",className:r.cardHeader}),l.createElement(r8.Z,{className:r.table},l.createElement(r9.Z,null,l.createElement(g$,{visible:o}),l.createElement(gz,{visible:(null===(t=null==i?void 0:i.jobs.results)||void 0===t?void 0:t.length)===0},"No recently created jobs"),l.createElement(gU,{msg:a}),null===(n=null==i?void 0:i.jobs.results)||void 0===n?void 0:n.map(function(e,t){return l.createElement(vc,{job:e,key:t})}))))});function vb(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function vm(){var e=vb(["\n ","\n query FetchRecentJobs($offset: Int, $limit: Int) {\n jobs(offset: $offset, limit: $limit) {\n results {\n ...RecentJobsPayload_ResultsFields\n }\n }\n }\n"]);return vm=function(){return e},e}var vg=5,vv=n0(vm(),vd),vy=function(){var e=rv(vv,{variables:{offset:0,limit:vg},fetchPolicy:"cache-and-network"}),t=e.data,n=e.loading,r=e.error;return l.createElement(vp,{data:t,errorMsg:null==r?void 0:r.message,loading:n})},vw=function(){return l.createElement(ig,null,l.createElement(d.Z,{container:!0},l.createElement(d.Z,{item:!0,xs:8},l.createElement(va,null)),l.createElement(d.Z,{item:!0,xs:4},l.createElement(d.Z,{container:!0},l.createElement(d.Z,{item:!0,xs:12},l.createElement(gY,null)),l.createElement(d.Z,{item:!0,xs:12},l.createElement(vy,null))))),l.createElement(vs,null))},v_=function(){return l.createElement(vw,null)},vE=function(){return l.createElement(v_,null)},vS=n(87239),vk=function(e){switch(e){case"DirectRequestSpec":return"Direct Request";case"FluxMonitorSpec":return"Flux Monitor";default:return e.replace(/Spec$/,"")}},vx=n(5022),vT=n(78718),vM=n.n(vT);function vO(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n1?t-1:0),r=1;r1?t-1:0),r=1;re.length)&&(t=e.length);for(var n=0,r=Array(t);ne.length)&&(t=e.length);for(var n=0,r=Array(t);ne.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&n.map(function(e){return l.createElement(ir.Z,{key:e.id,style:{cursor:"pointer"},onClick:function(){return r.push("/runs/".concat(e.id))}},l.createElement(r7.default,{className:t.idCell,scope:"row"},l.createElement("div",{className:t.runDetails},l.createElement(x.default,{variant:"h5",color:"primary",component:"span"},e.id))),l.createElement(r7.default,{className:t.stampCell},l.createElement(x.default,{variant:"body1",color:"textSecondary",className:t.stamp},"Created ",l.createElement(aO,{tooltip:!0},e.createdAt))),l.createElement(r7.default,{className:t.statusCell,scope:"row"},l.createElement(x.default,{variant:"body1",className:O()(t.status,yh(t,e.status))},e.status.toLowerCase())))})))}),yb=n(16839),ym=n.n(yb);function yg(e){var t=e.replace(/\w+\s*=\s*<([^>]|[\r\n])*>/g,""),n=ym().read(t),r=n.edges();return n.nodes().map(function(e){var t={id:e,parentIds:r.filter(function(t){return t.w===e}).map(function(e){return e.v})};return Object.keys(n.node(e)).length>0&&(t.attributes=n.node(e)),t})}var yv=n(94164),yy=function(e){var t=e.data,n=[];return(null==t?void 0:t.attributes)&&Object.keys(t.attributes).forEach(function(e){var r;n.push(l.createElement("div",{key:e},l.createElement(x.default,{variant:"body1",color:"textSecondary",component:"div"},l.createElement("b",null,e,":")," ",null===(r=t.attributes)||void 0===r?void 0:r[e])))}),l.createElement("div",null,t&&l.createElement(x.default,{variant:"body1",color:"textPrimary"},l.createElement("b",null,t.id)),n)},yw=n(73343),y_=n(3379),yE=n.n(y_);function yS(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);nwindow.innerWidth?u-r.getBoundingClientRect().width-a:u+a,n=c+r.getBoundingClientRect().height+i>window.innerHeight?c-r.getBoundingClientRect().height-a:c+a,r.style.opacity=String(1),r.style.top="".concat(n,"px"),r.style.left="".concat(t,"px"),r.style.zIndex=String(1)}},h=function(e){var t=document.getElementById("tooltip-d3-chart-".concat(e));t&&(t.style.opacity=String(0),t.style.zIndex=String(-1))};return l.createElement("div",{style:{fontFamily:"sans-serif",fontWeight:"normal"}},l.createElement(yv.kJ,{id:"task-list-graph-d3",data:i,config:s,onMouseOverNode:d,onMouseOutNode:h},"D3 chart"),n.map(function(e){return l.createElement("div",{key:"d3-tooltip-key-".concat(e.id),id:"tooltip-d3-chart-".concat(e.id),style:{position:"absolute",opacity:"0",border:"1px solid rgba(0, 0, 0, 0.1)",padding:yw.r.spacing.unit,background:"white",borderRadius:5,zIndex:-1,inlineSize:"min-content"}},l.createElement(yy,{data:e}))}))};function yL(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);nyY&&l.createElement("div",{className:t.runDetails},l.createElement(aA.Z,{href:"/jobs/".concat(n.id,"/runs"),component:tz},"View more")))),l.createElement(d.Z,{item:!0,xs:12,sm:6},l.createElement(yF,{observationSource:n.observationSource})))});function yH(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);ne.length)&&(t=e.length);for(var n=0,r=Array(t);ne.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]e.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&void 0!==arguments[0]?arguments[0]:"";try{return vx.parse(e),!0}catch(t){return!1}})}),wW=function(e){var t=e.initialValues,n=e.onSubmit,r=e.onTOMLChange;return l.createElement(hT,{initialValues:t,validationSchema:wG,onSubmit:n},function(e){var t=e.isSubmitting,n=e.values;return r&&r(n.toml),l.createElement(hR,{"data-testid":"job-form",noValidate:!0},l.createElement(d.Z,{container:!0,spacing:16},l.createElement(d.Z,{item:!0,xs:12},l.createElement(hP,{component:hX,id:"toml",name:"toml",label:"Job Spec (TOML)",required:!0,fullWidth:!0,multiline:!0,rows:10,rowsMax:25,variant:"outlined",autoComplete:"off",FormHelperTextProps:{"data-testid":"toml-helper-text"}})),l.createElement(d.Z,{item:!0,xs:12,md:7},l.createElement(ok.default,{variant:"contained",color:"primary",type:"submit",disabled:t,size:"large"},"Create Job"))))})},wK=n(50109),wV="persistSpec";function wq(e){var t=e.query,n=new URLSearchParams(t).get("definition");return n?(wK.t8(wV,n),{toml:n}):{toml:wK.U2(wV)||""}}var wZ=function(e){var t=e.onSubmit,n=e.onTOMLChange,r=wq({query:(0,h.TH)().search}),i=function(e){var t=e.replace(/[\u200B-\u200D\uFEFF]/g,"");wK.t8("".concat(wV),t),n&&n(t)};return l.createElement(r5.Z,null,l.createElement(sl.Z,{title:"New Job"}),l.createElement(aW.Z,null,l.createElement(wW,{initialValues:r,onSubmit:t,onTOMLChange:i})))};function wX(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);ne.length)&&(t=e.length);for(var n=0,r=Array(t);ne.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]e.length)&&(t=e.length);for(var n=0,r=Array(t);n1&&void 0!==arguments[1]?arguments[1]:{},n=t.start,r=void 0===n?6:n,i=t.end,a=void 0===i?4:i;return e.substring(0,r)+"..."+e.substring(e.length-a)}function _M(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]0&&void 0!==arguments[0]?arguments[0]:{};return rv(_W,e)},_V=function(){var e=_K({fetchPolicy:"cache-and-network"}),t=e.data,n=e.loading,r=e.error,i=e.refetch;return l.createElement(_U,{loading:n,data:t,errorMsg:null==r?void 0:r.message,refetch:i})},_q=function(e){var t=e.csaKey;return l.createElement(ir.Z,{hover:!0},l.createElement(r7.default,null,l.createElement(x.default,{variant:"body1"},t.publicKey," ",l.createElement(_x,{data:t.publicKey}))))};function _Z(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function _X(){var e=_Z(["\n fragment CSAKeysPayload_ResultsFields on CSAKey {\n id\n publicKey\n }\n"]);return _X=function(){return e},e}var _J=n0(_X()),_Q=function(e){var t,n,r,i=e.data,a=e.errorMsg,o=e.loading,s=e.onCreate;return l.createElement(r5.Z,null,l.createElement(sl.Z,{action:(null===(t=null==i?void 0:i.csaKeys.results)||void 0===t?void 0:t.length)===0&&l.createElement(ok.default,{variant:"outlined",color:"primary",onClick:s},"New CSA Key"),title:"CSA Key",subheader:"Manage your CSA Key"}),l.createElement(r8.Z,null,l.createElement(ie.Z,null,l.createElement(ir.Z,null,l.createElement(r7.default,null,"Public Key"))),l.createElement(r9.Z,null,l.createElement(g$,{visible:o}),l.createElement(gz,{visible:(null===(n=null==i?void 0:i.csaKeys.results)||void 0===n?void 0:n.length)===0}),l.createElement(gU,{msg:a}),null===(r=null==i?void 0:i.csaKeys.results)||void 0===r?void 0:r.map(function(e,t){return l.createElement(_q,{csaKey:e,key:t})}))))};function _1(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]e.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]0&&void 0!==arguments[0]?arguments[0]:{};return rv(EM,e)};function EA(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]0&&void 0!==arguments[0]?arguments[0]:{};return rv(EJ,e)},E3=function(){return oo(EQ)},E4=function(){return oo(E1)},E6=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return rv(E0,e)};function E5(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);ne.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]e.length)&&(t=e.length);for(var n=0,r=Array(t);ne.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]e.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]0&&void 0!==arguments[0]?arguments[0]:{};return rv(SK,e)};function Sq(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]e.length)&&(t=e.length);for(var n=0,r=Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function kV(e,t){if(null==e)return{};var n,r,i={},a=Object.keys(e);for(r=0;r=0||(i[n]=e[n]);return i}var kq=function(e){var t=e.run,n=l.useMemo(function(){var e=t.inputs,n=t.outputs,r=t.taskRuns,i=kK(t,["inputs","outputs","taskRuns"]),a={};try{a=JSON.parse(e)}catch(o){a={}}return kW(kz({},i),{inputs:a,outputs:n,taskRuns:r})},[t]);return l.createElement(r5.Z,null,l.createElement(aW.Z,null,l.createElement(kH,{object:n})))};function kZ(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kX(e){for(var t=1;t0&&l.createElement(kr,{errors:t.allErrors})),l.createElement(d.Z,{item:!0,xs:12},l.createElement(h.rs,null,l.createElement(h.AW,{path:"".concat(n,"/json")},l.createElement(kq,{run:t})),l.createElement(h.AW,{path:n},t.taskRuns.length>0&&l.createElement(kN,{taskRuns:t.taskRuns,observationSource:t.job.observationSource}))))))))};function k5(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function k8(){var e=k5(["\n ","\n query FetchJobRun($id: ID!) {\n jobRun(id: $id) {\n __typename\n ... on JobRun {\n ...JobRunPayload_Fields\n }\n ... on NotFoundError {\n message\n }\n }\n }\n"]);return k8=function(){return e},e}var k9=n0(k8(),k4),k7=function(){var e=rv(k9,{variables:{id:(0,h.UO)().id}}),t=e.data,n=e.loading,r=e.error;if(n)return l.createElement(iR,null);if(r)return l.createElement(iD,{error:r});var i=null==t?void 0:t.jobRun;switch(null==i?void 0:i.__typename){case"JobRun":return l.createElement(k6,{run:i});case"NotFoundError":return l.createElement(oa,null);default:return null}};function xe(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function xt(){var e=xe(["\n fragment JobRunsPayload_ResultsFields on JobRun {\n id\n allErrors\n createdAt\n finishedAt\n status\n job {\n id\n }\n }\n"]);return xt=function(){return e},e}var xn=n0(xt()),xr=function(e){var t=e.loading,n=e.data,r=e.page,i=e.pageSize,a=(0,h.k6)(),o=l.useMemo(function(){return null==n?void 0:n.jobRuns.results.map(function(e){var t,n=e.allErrors,r=e.id,i=e.createdAt;return{id:r,createdAt:i,errors:n,finishedAt:e.finishedAt,status:e.status}})},[n]);return l.createElement(ig,null,l.createElement(d.Z,{container:!0,spacing:32},l.createElement(d.Z,{item:!0,xs:12},l.createElement(iy,null,"Job Runs")),t&&l.createElement(iR,null),n&&o&&l.createElement(d.Z,{item:!0,xs:12},l.createElement(r5.Z,null,l.createElement(yp,{runs:o}),l.createElement(it.Z,{component:"div",count:n.jobRuns.metadata.total,rowsPerPage:i,rowsPerPageOptions:[i],page:r-1,onChangePage:function(e,t){a.push("/runs?page=".concat(t+1,"&per=").concat(i))},onChangeRowsPerPage:function(){},backIconButtonProps:{"aria-label":"prev-page"},nextIconButtonProps:{"aria-label":"next-page"}})))))};function xi(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function xa(){var e=xi(["\n ","\n query FetchJobRuns($offset: Int, $limit: Int) {\n jobRuns(offset: $offset, limit: $limit) {\n results {\n ...JobRunsPayload_ResultsFields\n }\n metadata {\n total\n }\n }\n }\n"]);return xa=function(){return e},e}var xo=n0(xa(),xn),xs=function(){var e=ij(),t=parseInt(e.get("page")||"1",10),n=parseInt(e.get("per")||"25",10),r=rv(xo,{variables:{offset:(t-1)*n,limit:n},fetchPolicy:"cache-and-network"}),i=r.data,a=r.loading,o=r.error;return o?l.createElement(iD,{error:o}):l.createElement(xr,{loading:a,data:i,page:t,pageSize:n})},xu=function(){var e=(0,h.$B)().path;return l.createElement(h.rs,null,l.createElement(h.AW,{exact:!0,path:e},l.createElement(xs,null)),l.createElement(h.AW,{path:"".concat(e,"/:id")},l.createElement(k7,null)))},xc=bv().shape({name:p0().required("Required"),uri:p0().required("Required"),publicKey:p0().required("Required")}),xl=function(e){var t=e.initialValues,n=e.onSubmit;return l.createElement(hT,{initialValues:t,validationSchema:xc,onSubmit:n},function(e){var t=e.isSubmitting,n=e.submitForm;return l.createElement(hR,{"data-testid":"feeds-manager-form"},l.createElement(d.Z,{container:!0,spacing:16},l.createElement(d.Z,{item:!0,xs:12,md:6},l.createElement(hP,{component:hX,id:"name",name:"name",label:"Name",required:!0,fullWidth:!0,FormHelperTextProps:{"data-testid":"name-helper-text"}})),l.createElement(d.Z,{item:!0,xs:!1,md:6}),l.createElement(d.Z,{item:!0,xs:12,md:6},l.createElement(hP,{component:hX,id:"uri",name:"uri",label:"URI",required:!0,fullWidth:!0,helperText:"Provided by the Feeds Manager operator",FormHelperTextProps:{"data-testid":"uri-helper-text"}})),l.createElement(d.Z,{item:!0,xs:12,md:6},l.createElement(hP,{component:hX,id:"publicKey",name:"publicKey",label:"Public Key",required:!0,fullWidth:!0,helperText:"Provided by the Feeds Manager operator",FormHelperTextProps:{"data-testid":"publicKey-helper-text"}})),l.createElement(d.Z,{item:!0,xs:12},l.createElement(ok.default,{variant:"contained",color:"primary",disabled:t,onClick:n},"Submit"))))})},xf=function(e){var t=e.data,n=e.onSubmit,r={name:t.name,uri:t.uri,publicKey:t.publicKey};return l.createElement(d.Z,{container:!0},l.createElement(d.Z,{item:!0,xs:12,md:11,lg:9},l.createElement(r5.Z,null,l.createElement(sl.Z,{title:"Edit Feeds Manager"}),l.createElement(aW.Z,null,l.createElement(xl,{initialValues:r,onSubmit:n})))))};function xd(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function xh(){var e=xd(["\n query FetchFeedsManagers {\n feedsManagers {\n results {\n __typename\n id\n name\n uri\n publicKey\n isConnectionActive\n createdAt\n }\n }\n }\n"]);return xh=function(){return e},e}var xp=n0(xh()),xb=function(){return rv(xp)};function xm(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]e.length)&&(t=e.length);for(var n=0,r=Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function xF(e,t){if(null==e)return{};var n,r,i={},a=Object.keys(e);for(r=0;r=0||(i[n]=e[n]);return i}function xY(e,t){return xD(e)||xP(e,t)||xB(e,t)||xR()}function xB(e,t){if(e){if("string"==typeof e)return xI(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return xI(e,t)}}var xU=function(e){return"SN_MAIN"===e||"SN_SEPOLIA"===e},xH=bv().shape({chainID:p0().required("Required"),chainType:p0().required("Required"),accountAddr:p0().required("Required"),accountAddrPubKey:p0().nullable(),adminAddr:p0().required("Required"),ocr1Multiaddr:p0().when(["ocr1Enabled","ocr1IsBootstrap"],{is:function(e,t){return e&&t},then:p0().required("Required").nullable()}).nullable(),ocr1P2PPeerID:p0().when(["ocr1Enabled","ocr1IsBootstrap"],{is:function(e,t){return e&&!t},then:p0().required("Required").nullable()}).nullable(),ocr1KeyBundleID:p0().when(["ocr1Enabled","ocr1IsBootstrap"],{is:function(e,t){return e&&!t},then:p0().required("Required").nullable()}).nullable(),ocr2Multiaddr:p0().when(["ocr2Enabled","ocr2IsBootstrap"],{is:function(e,t){return e&&t},then:p0().required("Required").nullable()}).nullable(),ocr2P2PPeerID:p0().when(["ocr2Enabled","ocr2IsBootstrap"],{is:function(e,t){return e&&!t},then:p0().required("Required").nullable()}).nullable(),ocr2KeyBundleID:p0().when(["ocr2Enabled","ocr2IsBootstrap"],{is:function(e,t){return e&&!t},then:p0().required("Required").nullable()}).nullable(),ocr2CommitPluginEnabled:pV().required("Required"),ocr2ExecutePluginEnabled:pV().required("Required"),ocr2MedianPluginEnabled:pV().required("Required"),ocr2MercuryPluginEnabled:pV().required("Required"),ocr2ForwarderAddress:p0().nullable()}),x$=function(e){return(0,b.createStyles)({supportedJobOptionsPaper:{padding:2*e.spacing.unit}})},xz=function(e){var t=e.chainAccounts,n=xj(e,["chainAccounts"]),r=h_(),i=r.values,a=i.chainID,o=i.accountAddr,s=r.setFieldValue,u=xY(l.useState(!1),2),c=u[0],f=u[1],d=l.useRef();l.useEffect(function(){d.current=a},[a]),l.useEffect(function(){a!==d.current&&(s(n.name,""),f(!1))},[a,s,n.name]);var h=function(e){var t=e.target.value;"custom"===t?(f(!0),s(n.name,"")):(f(!1),s(n.name,t))};return l.createElement(l.Fragment,null,!xU(a)&&l.createElement(hP,xN({},n,{select:!0,value:c?"custom":o,onChange:h}),t.map(function(e){return l.createElement(tE.default,{key:e.address,value:e.address},e.address)})),xU(a)&&l.createElement(hP,{component:hX,id:"accountAddr",name:"accountAddr",label:"Enter your account address",inputProps:{"data-testid":"customAccountAddr-input"},helperText:"The account address used for this chain",required:!0,fullWidth:!0}),xU(a)&&l.createElement("div",null,l.createElement(hP,{component:hX,id:"accountAddrPubKey",name:"accountAddrPubKey",label:"Account Address Public Key",required:!0,fullWidth:!0,helperText:"The public key for your account address",FormHelperTextProps:{"data-testid":"accountAddrPubKey-helper-text"}})))},xG=(0,b.withStyles)(x$)(function(e){var t=e.classes,n=e.editing,r=void 0!==n&&n,i=e.innerRef,a=e.initialValues,o=e.onSubmit,s=e.chainIDs,u=void 0===s?[]:s,c=e.accounts,f=void 0===c?[]:c,h=e.p2pKeys,p=void 0===h?[]:h,b=e.ocrKeys,m=void 0===b?[]:b,g=e.ocr2Keys,v=void 0===g?[]:g,y=e.showSubmit,w=void 0!==y&&y;return l.createElement(hT,{innerRef:i,initialValues:a,validationSchema:xH,onSubmit:o},function(e){var n=e.values,i=f.filter(function(e){return e.chain.id==n.chainID&&!e.isDisabled});return l.createElement(hR,{"data-testid":"feeds-manager-form",id:"chain-configuration-form",noValidate:!0},l.createElement(d.Z,{container:!0,spacing:16},l.createElement(d.Z,{item:!0,xs:12,md:6},l.createElement(hP,{component:hX,id:"chainType",name:"chainType",label:"Chain Type",select:!0,required:!0,fullWidth:!0,disabled:!0},l.createElement(tE.default,{key:"EVM",value:"EVM"},"EVM"))),l.createElement(d.Z,{item:!0,xs:12,md:6},l.createElement(hP,{component:hX,id:"chainID",name:"chainID",label:"Chain ID",required:!0,fullWidth:!0,select:!0,disabled:r,inputProps:{"data-testid":"chainID-input"},FormHelperTextProps:{"data-testid":"chainID-helper-text"}},u.map(function(e){return l.createElement(tE.default,{key:e,value:e},e)}))),l.createElement(d.Z,{item:!0,xs:12,md:6},l.createElement(xz,{component:hX,id:"accountAddr",name:"accountAddr",label:"Account Address",inputProps:{"data-testid":"accountAddr-input"},required:!0,fullWidth:!0,select:!0,helperText:"The account address used for this chain",chainAccounts:i,FormHelperTextProps:{"data-testid":"accountAddr-helper-text"}})),l.createElement(d.Z,{item:!0,xs:12,md:6},l.createElement(hP,{component:hX,id:"adminAddr",name:"adminAddr",label:"Admin Address",required:!0,fullWidth:!0,helperText:"The address used for LINK payments",FormHelperTextProps:{"data-testid":"adminAddr-helper-text"}})),l.createElement(d.Z,{item:!0,xs:12},l.createElement(x.default,null,"Supported Job Types")),l.createElement(d.Z,{item:!0,xs:12},l.createElement(hP,{component:h2,name:"fluxMonitorEnabled",type:"checkbox",Label:{label:"Flux Monitor"}})),l.createElement(d.Z,{item:!0,xs:12},l.createElement(hP,{component:h2,name:"ocr1Enabled",type:"checkbox",Label:{label:"OCR"}}),n.ocr1Enabled&&l.createElement(ii.default,{className:t.supportedJobOptionsPaper},l.createElement(d.Z,{container:!0,spacing:8},l.createElement(l.Fragment,null,l.createElement(d.Z,{item:!0,xs:12},l.createElement(hP,{component:h2,name:"ocr1IsBootstrap",type:"checkbox",Label:{label:"Is this node running as a bootstrap peer?"}})),n.ocr1IsBootstrap?l.createElement(d.Z,{item:!0,xs:12},l.createElement(hP,{component:hX,id:"ocr1Multiaddr",name:"ocr1Multiaddr",label:"Multiaddr",required:!0,fullWidth:!0,helperText:"The OCR Multiaddr which oracles use to query for network information",FormHelperTextProps:{"data-testid":"ocr1Multiaddr-helper-text"}})):l.createElement(l.Fragment,null,l.createElement(d.Z,{item:!0,xs:12,md:6},l.createElement(hP,{component:hX,id:"ocr1P2PPeerID",name:"ocr1P2PPeerID",label:"Peer ID",select:!0,required:!0,fullWidth:!0,helperText:"The Peer ID used for this chain",FormHelperTextProps:{"data-testid":"ocr1P2PPeerID-helper-text"}},p.map(function(e){return l.createElement(tE.default,{key:e.peerID,value:e.peerID},e.peerID)}))),l.createElement(d.Z,{item:!0,xs:12,md:6},l.createElement(hP,{component:hX,id:"ocr1KeyBundleID",name:"ocr1KeyBundleID",label:"Key Bundle ID",select:!0,required:!0,fullWidth:!0,helperText:"The OCR Key Bundle ID used for this chain",FormHelperTextProps:{"data-testid":"ocr1KeyBundleID-helper-text"}},m.map(function(e){return l.createElement(tE.default,{key:e.id,value:e.id},e.id)})))))))),l.createElement(d.Z,{item:!0,xs:12},l.createElement(hP,{component:h2,name:"ocr2Enabled",type:"checkbox",Label:{label:"OCR2"}}),n.ocr2Enabled&&l.createElement(ii.default,{className:t.supportedJobOptionsPaper},l.createElement(d.Z,{container:!0,spacing:8},l.createElement(l.Fragment,null,l.createElement(d.Z,{item:!0,xs:12},l.createElement(hP,{component:h2,name:"ocr2IsBootstrap",type:"checkbox",Label:{label:"Is this node running as a bootstrap peer?"}})),n.ocr2IsBootstrap?l.createElement(d.Z,{item:!0,xs:12},l.createElement(hP,{component:hX,id:"ocr2Multiaddr",name:"ocr2Multiaddr",label:"Multiaddr",required:!0,fullWidth:!0,helperText:"The OCR2 Multiaddr which oracles use to query for network information",FormHelperTextProps:{"data-testid":"ocr2Multiaddr-helper-text"}})):l.createElement(l.Fragment,null,l.createElement(d.Z,{item:!0,xs:12,md:6},l.createElement(hP,{component:hX,id:"ocr2P2PPeerID",name:"ocr2P2PPeerID",label:"Peer ID",select:!0,required:!0,fullWidth:!0,helperText:"The Peer ID used for this chain",FormHelperTextProps:{"data-testid":"ocr2P2PPeerID-helper-text"}},p.map(function(e){return l.createElement(tE.default,{key:e.peerID,value:e.peerID},e.peerID)}))),l.createElement(d.Z,{item:!0,xs:12,md:6},l.createElement(hP,{component:hX,id:"ocr2KeyBundleID",name:"ocr2KeyBundleID",label:"Key Bundle ID",select:!0,required:!0,fullWidth:!0,helperText:"The OCR2 Key Bundle ID used for this chain",FormHelperTextProps:{"data-testid":"ocr2KeyBundleID-helper-text"}},v.map(function(e){return l.createElement(tE.default,{key:e.id,value:e.id},e.id)}))),l.createElement(d.Z,{item:!0,xs:12},l.createElement(x.default,null,"Supported Plugins")),l.createElement(d.Z,{item:!0,xs:6},l.createElement(hP,{component:h2,name:"ocr2CommitPluginEnabled",type:"checkbox",Label:{label:"Commit"}})),l.createElement(d.Z,{item:!0,xs:6},l.createElement(hP,{component:h2,name:"ocr2ExecutePluginEnabled",type:"checkbox",Label:{label:"Execute"}})),l.createElement(d.Z,{item:!0,xs:6},l.createElement(hP,{component:h2,name:"ocr2RebalancerPluginEnabled",type:"checkbox",Label:{label:"Rebalancer"}})),l.createElement(d.Z,{item:!0,xs:6},l.createElement(hP,{component:h2,name:"ocr2MedianPluginEnabled",type:"checkbox",Label:{label:"Median"}})),l.createElement(d.Z,{item:!0,xs:6},l.createElement(hP,{component:h2,name:"ocr2MercuryPluginEnabled",type:"checkbox",Label:{label:"Mercury"}})),l.createElement(d.Z,{item:!0,xs:12,md:12},l.createElement(hP,{component:hX,id:"ocr2ForwarderAddress",name:"ocr2ForwarderAddress",label:"Forwarder Address (optional)",fullWidth:!0,helperText:"The forwarder address from the Operator Forwarder Contract",FormHelperTextProps:{"data-testid":"ocr2ForwarderAddress-helper-text"}}))))))),w&&l.createElement(d.Z,{item:!0,xs:12,md:7},l.createElement(ok.default,{variant:"contained",color:"primary",type:"submit",size:"large"},"Submit"))))})}),xW=function(e){var t=e.onClose,n=e.open,r=e.onSubmit,i=l.useRef(),a=i$({fetchPolicy:"network-only"}).data,o=_K({fetchPolicy:"cache-and-network"}).data,s=SV({fetchPolicy:"cache-and-network"}).data,u=EO({fetchPolicy:"cache-and-network"}).data,c=E2({fetchPolicy:"cache-and-network"}).data,f={chainID:"",chainType:"EVM",accountAddr:"",adminAddr:"",accountAddrPubKey:"",fluxMonitorEnabled:!1,ocr1Enabled:!1,ocr1IsBootstrap:!1,ocr1Multiaddr:"",ocr1P2PPeerID:"",ocr1KeyBundleID:"",ocr2Enabled:!1,ocr2IsBootstrap:!1,ocr2Multiaddr:"",ocr2P2PPeerID:"",ocr2KeyBundleID:"",ocr2CommitPluginEnabled:!1,ocr2ExecutePluginEnabled:!1,ocr2MedianPluginEnabled:!1,ocr2MercuryPluginEnabled:!1,ocr2RebalancerPluginEnabled:!1,ocr2ForwarderAddress:""},d=a?a.chains.results.map(function(e){return e.id}):[],h=o?o.ethKeys.results:[],p=s?s.p2pKeys.results:[],b=u?u.ocrKeyBundles.results:[],m=c?c.ocr2KeyBundles.results:[];return l.createElement(aD.Z,{onClose:t,open:n,disableBackdropClick:!0},l.createElement(oO.Z,{disableTypography:!0},l.createElement(x.default,{variant:"body2"},"New Supported Chain")),l.createElement(oT.Z,null,l.createElement(xG,{innerRef:i,initialValues:f,onSubmit:r,chainIDs:d,accounts:h,p2pKeys:p,ocrKeys:b,ocr2Keys:m})),l.createElement(ox.Z,null,l.createElement(ok.default,{onClick:t},"Cancel"),l.createElement(ok.default,{color:"primary",type:"submit",form:"chain-configuration-form",variant:"contained"},"Submit")))},xK=function(e){var t=e.cfg,n=e.onClose,r=e.open,i=e.onSubmit,a=l.useRef(),o=i$({fetchPolicy:"network-only"}).data,s=_K({fetchPolicy:"cache-and-network"}).data,u=SV({fetchPolicy:"cache-and-network"}).data,c=EO({fetchPolicy:"cache-and-network"}).data,f=E2({fetchPolicy:"cache-and-network"}).data;if(!t)return null;var d={chainID:t.chainID,chainType:"EVM",accountAddr:t.accountAddr,adminAddr:t.adminAddr,accountAddrPubKey:t.accountAddrPubKey,fluxMonitorEnabled:t.fluxMonitorJobConfig.enabled,ocr1Enabled:t.ocr1JobConfig.enabled,ocr1IsBootstrap:t.ocr1JobConfig.isBootstrap,ocr1Multiaddr:t.ocr1JobConfig.multiaddr,ocr1P2PPeerID:t.ocr1JobConfig.p2pPeerID,ocr1KeyBundleID:t.ocr1JobConfig.keyBundleID,ocr2Enabled:t.ocr2JobConfig.enabled,ocr2IsBootstrap:t.ocr2JobConfig.isBootstrap,ocr2Multiaddr:t.ocr2JobConfig.multiaddr,ocr2P2PPeerID:t.ocr2JobConfig.p2pPeerID,ocr2KeyBundleID:t.ocr2JobConfig.keyBundleID,ocr2CommitPluginEnabled:t.ocr2JobConfig.plugins.commit,ocr2ExecutePluginEnabled:t.ocr2JobConfig.plugins.execute,ocr2MedianPluginEnabled:t.ocr2JobConfig.plugins.median,ocr2MercuryPluginEnabled:t.ocr2JobConfig.plugins.mercury,ocr2RebalancerPluginEnabled:t.ocr2JobConfig.plugins.rebalancer,ocr2ForwarderAddress:t.ocr2JobConfig.forwarderAddress},h=o?o.chains.results.map(function(e){return e.id}):[],p=s?s.ethKeys.results:[],b=u?u.p2pKeys.results:[],m=c?c.ocrKeyBundles.results:[],g=f?f.ocr2KeyBundles.results:[];return l.createElement(aD.Z,{onClose:n,open:r,disableBackdropClick:!0},l.createElement(oO.Z,{disableTypography:!0},l.createElement(x.default,{variant:"body2"},"Edit Supported Chain")),l.createElement(oT.Z,null,l.createElement(xG,{innerRef:a,initialValues:d,onSubmit:i,chainIDs:h,accounts:p,p2pKeys:b,ocrKeys:m,ocr2Keys:g,editing:!0})),l.createElement(ox.Z,null,l.createElement(ok.default,{onClick:n},"Cancel"),l.createElement(ok.default,{color:"primary",type:"submit",form:"chain-configuration-form",variant:"contained"},"Submit")))};function xV(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function xq(){var e=xV(["\n fragment FeedsManager_ChainConfigFields on FeedsManagerChainConfig {\n id\n chainID\n chainType\n accountAddr\n adminAddr\n accountAddrPubKey\n fluxMonitorJobConfig {\n enabled\n }\n ocr1JobConfig {\n enabled\n isBootstrap\n multiaddr\n p2pPeerID\n keyBundleID\n }\n ocr2JobConfig {\n enabled\n isBootstrap\n multiaddr\n forwarderAddress\n p2pPeerID\n keyBundleID\n plugins {\n commit\n execute\n median\n mercury\n rebalancer\n }\n }\n }\n"]);return xq=function(){return e},e}function xZ(){var e=xV(["\n ","\n fragment FeedsManagerFields on FeedsManager {\n id\n name\n uri\n publicKey\n isConnectionActive\n chainConfigs {\n ...FeedsManager_ChainConfigFields\n }\n }\n"]);return xZ=function(){return e},e}function xX(){var e=xV(["\n fragment FeedsManager_JobProposalsFields on JobProposal {\n id\n name\n externalJobID\n remoteUUID\n status\n pendingUpdate\n latestSpec {\n createdAt\n version\n }\n }\n"]);return xX=function(){return e},e}function xJ(){var e=xV(["\n ","\n ","\n fragment FeedsManagerPayload_ResultsFields on FeedsManager {\n ...FeedsManagerFields\n jobProposals {\n ...FeedsManager_JobProposalsFields\n }\n }\n"]);return xJ=function(){return e},e}function xQ(){var e=xV(["\n ","\n query FetchFeedManagersWithProposals {\n feedsManagers {\n results {\n ...FeedsManagerPayload_ResultsFields\n }\n }\n }\n"]);return xQ=function(){return e},e}var x1=n0(xq()),x0=n0(xZ(),x1),x2=n0(xX()),x3=n0(xJ(),x0,x2),x4=n0(xQ(),x3),x6=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return rv(x4,e)};function x5(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]e.length)&&(t=e.length);for(var n=0,r=Array(t);ne.length)&&(t=e.length);for(var n=0,r=Array(t);n0?n.feedsManagers.results[0]:void 0;return n&&a?l.createElement(TZ,{manager:a}):l.createElement(h.l_,{to:{pathname:"/feeds_manager/new",state:{from:e}}})},TJ={name:"Chainlink Feeds Manager",uri:"",publicKey:""},TQ=function(e){var t=e.onSubmit;return l.createElement(d.Z,{container:!0},l.createElement(d.Z,{item:!0,xs:12,md:11,lg:9},l.createElement(r5.Z,null,l.createElement(sl.Z,{title:"Register Feeds Manager"}),l.createElement(aW.Z,null,l.createElement(xl,{initialValues:TJ,onSubmit:t})))))};function T1(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]e.length)&&(t=e.length);for(var n=0,r=Array(t);nt.version?e:t})},[o]),g=l.useMemo(function(){return ME(o).sort(function(e,t){return t.version-e.version})},[o]),v=function(e,t,n){switch(e){case"PENDING":return l.createElement(l.Fragment,null,l.createElement(ok.default,{variant:"text",color:"secondary",onClick:function(){return b("reject",t)}},"Reject"),m.id===t&&"DELETED"!==n.status&&"REVOKED"!==n.status&&l.createElement(ok.default,{variant:"contained",color:"primary",onClick:function(){return b("approve",t)}},"Approve"),m.id===t&&"DELETED"===n.status&&n.pendingUpdate&&l.createElement(l.Fragment,null,l.createElement(ok.default,{variant:"contained",color:"primary",onClick:function(){return b("cancel",t)}},"Cancel"),l.createElement(x.default,{color:"error"},"This proposal was deleted. Cancel the spec to delete any running jobs")));case"APPROVED":return l.createElement(l.Fragment,null,l.createElement(ok.default,{variant:"contained",onClick:function(){return b("cancel",t)}},"Cancel"),"DELETED"===n.status&&n.pendingUpdate&&l.createElement(x.default,{color:"error"},"This proposal was deleted. Cancel the spec to delete any running jobs"));case"CANCELLED":if(m.id===t&&"DELETED"!==n.status&&"REVOKED"!==n.status)return l.createElement(ok.default,{variant:"contained",color:"primary",onClick:function(){return b("approve",t)}},"Approve");return null;default:return null}};return l.createElement("div",null,g.map(function(e,n){return l.createElement(mP.Z,{defaultExpanded:0===n,key:n},l.createElement(mR.Z,{expandIcon:l.createElement(gh.Z,null)},l.createElement(x.default,{className:t.versionText},"Version ",e.version),l.createElement(Es.Z,{label:e.status,color:"APPROVED"===e.status?"primary":"default",variant:"REJECTED"===e.status||"CANCELLED"===e.status?"outlined":"default"}),l.createElement("div",{className:t.proposedAtContainer},l.createElement(x.default,null,"Proposed ",l.createElement(aO,{tooltip:!0},e.createdAt)))),l.createElement(mj.Z,{className:t.expansionPanelDetails},l.createElement("div",{className:t.actions},l.createElement("div",{className:t.editContainer},0===n&&("PENDING"===e.status||"CANCELLED"===e.status)&&"DELETED"!==s.status&&"REVOKED"!==s.status&&l.createElement(ok.default,{variant:"contained",onClick:function(){return p(!0)}},"Edit")),l.createElement("div",{className:t.actionsContainer},v(e.status,e.id,s))),l.createElement(gd,{language:"toml",style:gs,"data-testid":"codeblock"},e.definition)))}),l.createElement(oC,{open:null!=c,title:c?MM[c.action].title:"",body:c?MM[c.action].body:"",onConfirm:function(){if(c){switch(c.action){case"approve":n(c.id);break;case"cancel":r(c.id);break;case"reject":i(c.id)}f(null)}},cancelButtonText:"Cancel",onCancel:function(){return f(null)}}),l.createElement(Md,{open:h,onClose:function(){return p(!1)},initialValues:{definition:m.definition,id:m.id},onSubmit:a}))});function MA(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function ML(){var e=MA(["\n ","\n fragment JobProposalPayloadFields on JobProposal {\n id\n externalJobID\n remoteUUID\n jobID\n specs {\n ...JobProposal_SpecsFields\n }\n status\n pendingUpdate\n }\n"]);return ML=function(){return e},e}var MC=n0(ML(),Mx),MI=function(e){var t=e.onApprove,n=e.onCancel,r=e.onReject,i=e.onUpdateSpec,a=e.proposal;return l.createElement(ig,null,l.createElement(d.Z,{container:!0,spacing:32},l.createElement(d.Z,{item:!0,xs:9},l.createElement(iy,null,"Job Proposal #",a.id))),l.createElement(Mo,{proposal:a}),l.createElement(d.Z,{container:!0,spacing:32},l.createElement(d.Z,{item:!0,xs:9},l.createElement(Tq,null,"Specs"))),l.createElement(d.Z,{container:!0,spacing:32},l.createElement(d.Z,{item:!0,xs:12},l.createElement(MO,{proposal:a,specs:a.specs,onReject:r,onApprove:t,onCancel:n,onUpdateSpec:i}))))};function MD(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]e.length)&&(t=e.length);for(var n=0,r=Array(t);ne.length)&&(t=e.length);for(var n=0,r=Array(t);nU,tA:()=>$,KL:()=>H,Iw:()=>V,DQ:()=>W,cB:()=>T,LO:()=>M,t5:()=>k,qt:()=>x,Jc:()=>C,L7:()=>Y,EO:()=>B});var r,i,a=n(66289),o=n(41800),s=n.n(o),u=n(67932);(i=r||(r={})).IN_PROGRESS="in_progress",i.PENDING_INCOMING_CONFIRMATIONS="pending_incoming_confirmations",i.PENDING_CONNECTION="pending_connection",i.PENDING_BRIDGE="pending_bridge",i.PENDING_SLEEP="pending_sleep",i.ERRORED="errored",i.COMPLETED="completed";var c=n(87013),l=n(19084),f=n(34823);function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]j,v2:()=>F});var r=n(66289);function i(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}var a="/sessions",o="/sessions",s=function e(t){var n=this;i(this,e),this.api=t,this.createSession=function(e){return n.create(e)},this.destroySession=function(){return n.destroy()},this.create=this.api.createResource(a),this.destroy=this.api.deleteResource(o)};function u(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}var c="/v2/bulk_delete_runs",l=function e(t){var n=this;u(this,e),this.api=t,this.bulkDeleteJobRuns=function(e){return n.destroy(e)},this.destroy=this.api.deleteResource(c)};function f(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}var d="/v2/chains/evm",h="".concat(d,"/:id"),p=function e(t){var n=this;f(this,e),this.api=t,this.getChains=function(){return n.index()},this.createChain=function(e){return n.create(e)},this.destroyChain=function(e){return n.destroy(void 0,{id:e})},this.updateChain=function(e,t){return n.update(t,{id:e})},this.index=this.api.fetchResource(d),this.create=this.api.createResource(d),this.destroy=this.api.deleteResource(h),this.update=this.api.updateResource(h)};function b(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}var m="/v2/keys/evm/chain",g=function e(t){var n=this;b(this,e),this.api=t,this.chain=function(e){var t=new URLSearchParams;t.append("address",e.address),t.append("evmChainID",e.evmChainID),null!==e.nextNonce&&t.append("nextNonce",e.nextNonce),null!==e.abandon&&t.append("abandon",String(e.abandon)),null!==e.enabled&&t.append("enabled",String(e.enabled));var r=m+"?"+t.toString();return n.api.createResource(r)()}};function v(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}var y="/v2/jobs",w="".concat(y,"/:specId/runs"),_=function e(t){var n=this;v(this,e),this.api=t,this.createJobRunV2=function(e,t){return n.post(t,{specId:e})},this.post=this.api.createResource(w,!0)};function E(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}var S="/v2/log",k=function e(t){var n=this;E(this,e),this.api=t,this.getLogConfig=function(){return n.show()},this.updateLogConfig=function(e){return n.update(e)},this.show=this.api.fetchResource(S),this.update=this.api.updateResource(S)};function x(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}var T="/v2/nodes",M=function e(t){var n=this;x(this,e),this.api=t,this.getNodes=function(){return n.index()},this.createNode=function(e){return n.create(e)},this.index=this.api.fetchResource(T),this.create=this.api.createResource(T)};function O(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}var A="/v2/enroll_webauthn",L=function e(t){var n=this;O(this,e),this.api=t,this.beginKeyRegistration=function(e){return n.create(e)},this.finishKeyRegistration=function(e){return n.put(e)},this.create=this.api.fetchResource(A),this.put=this.api.createResource(A)};function C(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}var I="/v2/build_info",D=function e(t){var n=this;C(this,e),this.api=t,this.show=function(){return n.api.GET(I)()}};function N(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}var P=function e(t){N(this,e),this.api=t,this.buildInfo=new D(this.api),this.bulkDeleteRuns=new l(this.api),this.chains=new p(this.api),this.logConfig=new k(this.api),this.nodes=new M(this.api),this.jobs=new _(this.api),this.webauthn=new L(this.api),this.evmKeys=new g(this.api)},R=new r.V0({base:void 0}),j=new s(R),F=new P(R)},1398(e,t,n){"use strict";n.d(t,{Z:()=>d});var r=n(67294),i=n(32316),a=n(83638),o=n(94184),s=n.n(o);function u(){return(u=Object.assign||function(e){for(var t=1;tc});var r=n(67294),i=n(32316);function a(){return(a=Object.assign||function(e){for(var t=1;tx,jK:()=>v});var r=n(67294),i=n(37703),a=n(45697),o=n.n(a),s=n(82204),u=n(71426),c=n(94184),l=n.n(c),f=n(32316),d=function(e){var t=e.palette.success||{},n=e.palette.warning||{};return{base:{paddingLeft:5*e.spacing.unit,paddingRight:5*e.spacing.unit},success:{backgroundColor:t.main,color:t.contrastText},error:{backgroundColor:e.palette.error.dark,color:e.palette.error.contrastText},warning:{backgroundColor:n.contrastText,color:n.main}}},h=function(e){var t,n=e.success,r=e.error,i=e.warning,a=e.classes,o=e.className;return n?t=a.success:r?t=a.error:i&&(t=a.warning),l()(a.base,o,t)},p=function(e){return r.createElement(s.Z,{className:h(e),square:!0},r.createElement(u.default,{variant:"body2",color:"inherit",component:"div"},e.children))};p.defaultProps={success:!1,error:!1,warning:!1},p.propTypes={success:o().bool,error:o().bool,warning:o().bool};let b=(0,f.withStyles)(d)(p);var m=function(){return r.createElement(r.Fragment,null,"Unhandled error. Please help us by opening a"," ",r.createElement("a",{href:"https://github.com/smartcontractkit/chainlink/issues/new"},"bug report"))};let g=m;function v(e){return"string"==typeof e?e:e.component?e.component(e.props):r.createElement(g,null)}function y(e,t){var n;return n="string"==typeof e?e:e.component?e.component(e.props):r.createElement(g,null),r.createElement("p",{key:t},n)}var w=function(e){var t=e.notifications;return r.createElement(b,{error:!0},t.map(y))},_=function(e){var t=e.notifications;return r.createElement(b,{success:!0},t.map(y))},E=function(e){var t=e.errors,n=e.successes;return r.createElement("div",null,(null==t?void 0:t.length)>0&&r.createElement(w,{notifications:t}),n.length>0&&r.createElement(_,{notifications:n}))},S=function(e){return{errors:e.notifications.errors,successes:e.notifications.successes}},k=(0,i.$j)(S)(E);let x=k},9409(e,t,n){"use strict";n.d(t,{ZP:()=>j});var r=n(67294),i=n(37703),a=n(5977),o=n(32316),s=n(1398),u=n(82204),c=n(30060),l=n(71426),f=n(60520),d=n(39814),h=n(57209),p=n(26842),b=n(3950),m=n(5536),g=n(45697),v=n.n(g);let y=n.p+"9f6d832ef97e8493764e.svg";function w(){return(w=Object.assign||function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&_.map(function(e,t){return r.createElement(d.Z,{item:!0,xs:12,key:t},r.createElement(u.Z,{raised:!1,className:v.error},r.createElement(c.Z,null,r.createElement(l.default,{variant:"body1",className:v.errorText},(0,b.jK)(e)))))}),r.createElement(d.Z,{item:!0,xs:12},r.createElement(f.Z,{id:"email",label:"Email",margin:"normal",value:n,onChange:m("email"),error:_.length>0,variant:"outlined",fullWidth:!0})),r.createElement(d.Z,{item:!0,xs:12},r.createElement(f.Z,{id:"password",label:"Password",type:"password",autoComplete:"password",margin:"normal",value:h,onChange:m("password"),error:_.length>0,variant:"outlined",fullWidth:!0})),r.createElement(d.Z,{item:!0,xs:12},r.createElement(d.Z,{container:!0,spacing:0,justify:"center"},r.createElement(d.Z,{item:!0},r.createElement(s.Z,{type:"submit",variant:"primary"},"Access Account")))),y&&r.createElement(l.default,{variant:"body1",color:"textSecondary"},"Signing in...")))))))},P=function(e){return{fetching:e.authentication.fetching,authenticated:e.authentication.allowed,errors:e.notifications.errors}},R=(0,i.$j)(P,x({submitSignIn:p.L7}))(N);let j=(0,h.wU)(e)((0,o.withStyles)(D)(R))},16353(e,t,n){"use strict";n.d(t,{ZP:()=>H,rH:()=>U});var r,i=n(37703),a=n(97779),o=n(9541),s=n(19084);function u(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:h,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case s.Mk.RECEIVE_SIGNOUT_SUCCESS:case s.Mk.RECEIVE_SIGNIN_SUCCESS:var n={allowed:t.authenticated};return o.Ks(n),f(c({},e,n),{errors:[]});case s.Mk.RECEIVE_SIGNIN_FAIL:var r={allowed:!1};return o.Ks(r),f(c({},e,r),{errors:[]});case s.Mk.RECEIVE_SIGNIN_ERROR:case s.Mk.RECEIVE_SIGNOUT_ERROR:var i={allowed:!1};return o.Ks(i),f(c({},e,i),{errors:t.errors||[]});default:return e}};let b=p;function m(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function g(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:_,t=arguments.length>1?arguments[1]:void 0;return t.type?t.type.startsWith(r.REQUEST)?y(g({},e),{count:e.count+1}):t.type.startsWith(r.RECEIVE)?y(g({},e),{count:Math.max(e.count-1,0)}):t.type.startsWith(r.RESPONSE)?y(g({},e),{count:Math.max(e.count-1,0)}):t.type===s.di.REDIRECT?y(g({},e),{count:0}):e:e};let S=E;function k(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function x(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:O,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case s.di.MATCH_ROUTE:return M(x({},O),{currentUrl:t.pathname});case s.Ih.NOTIFY_SUCCESS:var n={component:t.component,props:t.props};return M(x({},e),{successes:[n],errors:[]});case s.Ih.NOTIFY_SUCCESS_MSG:return M(x({},e),{successes:[t.msg],errors:[]});case s.Ih.NOTIFY_ERROR:var r=t.error.errors,i=null==r?void 0:r.map(function(e){return L(t,e)});return M(x({},e),{successes:[],errors:i});case s.Ih.NOTIFY_ERROR_MSG:return M(x({},e),{successes:[],errors:[t.msg]});case s.Mk.RECEIVE_SIGNIN_FAIL:return M(x({},e),{successes:[],errors:["Your email or password is incorrect. Please try again"]});default:return e}};function L(e,t){return{component:e.component,props:{msg:t.detail}}}let C=A;function I(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function D(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:R,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case s.di.REDIRECT:return P(D({},e),{to:t.to});case s.di.MATCH_ROUTE:return P(D({},e),{to:void 0});default:return e}};let F=j;var Y=n(87013),B=(0,a.UY)({authentication:b,fetching:S,notifications:C,redirect:F,buildInfo:Y.Z});B(void 0,{type:"INITIAL_STATE"});var U=i.v9;let H=B},19084(e,t,n){"use strict";var r,i,a,o,s,u,c,l,f,d;n.d(t,{Ih:()=>i,Mk:()=>a,Y0:()=>s,di:()=>r,jp:()=>o}),n(67294),(u=r||(r={})).REDIRECT="REDIRECT",u.MATCH_ROUTE="MATCH_ROUTE",(c=i||(i={})).NOTIFY_SUCCESS="NOTIFY_SUCCESS",c.NOTIFY_SUCCESS_MSG="NOTIFY_SUCCESS_MSG",c.NOTIFY_ERROR="NOTIFY_ERROR",c.NOTIFY_ERROR_MSG="NOTIFY_ERROR_MSG",(l=a||(a={})).REQUEST_SIGNIN="REQUEST_SIGNIN",l.RECEIVE_SIGNIN_SUCCESS="RECEIVE_SIGNIN_SUCCESS",l.RECEIVE_SIGNIN_FAIL="RECEIVE_SIGNIN_FAIL",l.RECEIVE_SIGNIN_ERROR="RECEIVE_SIGNIN_ERROR",l.RECEIVE_SIGNOUT_SUCCESS="RECEIVE_SIGNOUT_SUCCESS",l.RECEIVE_SIGNOUT_ERROR="RECEIVE_SIGNOUT_ERROR",(f=o||(o={})).RECEIVE_CREATE_ERROR="RECEIVE_CREATE_ERROR",f.RECEIVE_CREATE_SUCCESS="RECEIVE_CREATE_SUCCESS",f.RECEIVE_DELETE_ERROR="RECEIVE_DELETE_ERROR",f.RECEIVE_DELETE_SUCCESS="RECEIVE_DELETE_SUCCESS",f.RECEIVE_UPDATE_ERROR="RECEIVE_UPDATE_ERROR",f.RECEIVE_UPDATE_SUCCESS="RECEIVE_UPDATE_SUCCESS",f.REQUEST_CREATE="REQUEST_CREATE",f.REQUEST_DELETE="REQUEST_DELETE",f.REQUEST_UPDATE="REQUEST_UPDATE",f.UPSERT_CONFIGURATION="UPSERT_CONFIGURATION",f.UPSERT_JOB_RUN="UPSERT_JOB_RUN",f.UPSERT_JOB_RUNS="UPSERT_JOB_RUNS",f.UPSERT_TRANSACTION="UPSERT_TRANSACTION",f.UPSERT_TRANSACTIONS="UPSERT_TRANSACTIONS",f.UPSERT_BUILD_INFO="UPSERT_BUILD_INFO",(d=s||(s={})).FETCH_BUILD_INFO_REQUESTED="FETCH_BUILD_INFO_REQUESTED",d.FETCH_BUILD_INFO_SUCCEEDED="FETCH_BUILD_INFO_SUCCEEDED",d.FETCH_BUILD_INFO_FAILED="FETCH_BUILD_INFO_FAILED"},87013(e,t,n){"use strict";n.d(t,{Y:()=>o,Z:()=>u});var r=n(19084);function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:o,t=arguments.length>1?arguments[1]:void 0;return t.type===r.Y0.FETCH_BUILD_INFO_SUCCEEDED?a({},t.buildInfo):e};let u=s},34823(e,t,n){"use strict";n.d(t,{N:()=>r});var r=function(e){return e.buildInfo}},73343(e,t,n){"use strict";n.d(t,{r:()=>u});var r=n(19350),i=n(32316),a=n(59114),o=n(5324),s={props:{MuiGrid:{spacing:3*o.default.unit},MuiCardHeader:{titleTypographyProps:{color:"secondary"}}},palette:{action:{hoverOpacity:.3},primary:{light:"#E5F1FF",main:"#3c40c6",contrastText:"#fff"},secondary:{main:"#3d5170"},success:{light:"#e8faf1",main:r.ek.A700,dark:r.ek[700],contrastText:r.y0.white},warning:{light:"#FFFBF1",main:"#fff6b6",contrastText:"#fad27a"},error:{light:"#ffdada",main:"#f44336",dark:"#d32f2f",contrastText:"#fff"},background:{default:"#f5f6f8",appBar:"#3c40c6"},text:{primary:(0,a.darken)(r.BA.A700,.7),secondary:"#818ea3"},listPendingStatus:{background:"#fef7e5",color:"#fecb4c"},listCompletedStatus:{background:"#e9faf2",color:"#4ed495"}},shape:{borderRadius:o.default.unit},overrides:{MuiButton:{root:{borderRadius:o.default.unit/2,textTransform:"none"},sizeLarge:{padding:void 0,fontSize:void 0,paddingTop:o.default.unit,paddingBottom:o.default.unit,paddingLeft:5*o.default.unit,paddingRight:5*o.default.unit}},MuiTableCell:{body:{fontSize:"1rem"},head:{fontSize:"1rem",fontWeight:400}},MuiCardHeader:{root:{borderBottom:"1px solid rgba(0, 0, 0, 0.12)"},action:{marginTop:-2,marginRight:0,"& >*":{marginLeft:2*o.default.unit}},subheader:{marginTop:.5*o.default.unit}}},typography:{useNextVariants:!0,fontFamily:"-apple-system,BlinkMacSystemFont,Roboto,Helvetica,Arial,sans-serif",button:{textTransform:"none",fontSize:"1.2em"},body1:{fontSize:"1.0rem",fontWeight:400,lineHeight:"1.46429em",color:"rgba(0, 0, 0, 0.87)",letterSpacing:-.4},body2:{fontSize:"1.0rem",fontWeight:500,lineHeight:"1.71429em",color:"rgba(0, 0, 0, 0.87)",letterSpacing:-.4},body1Next:{color:"rgb(29, 29, 29)",fontWeight:400,fontSize:"1rem",lineHeight:1.5,letterSpacing:-.4},body2Next:{color:"rgb(29, 29, 29)",fontWeight:400,fontSize:"0.875rem",lineHeight:1.5,letterSpacing:-.4},display1:{color:"#818ea3",fontSize:"2.125rem",fontWeight:400,lineHeight:"1.20588em",letterSpacing:-.4},display2:{color:"#818ea3",fontSize:"2.8125rem",fontWeight:400,lineHeight:"1.13333em",marginLeft:"-.02em",letterSpacing:-.4},display3:{color:"#818ea3",fontSize:"3.5rem",fontWeight:400,lineHeight:"1.30357em",marginLeft:"-.02em",letterSpacing:-.4},display4:{fontSize:14,fontWeightLight:300,fontWeightMedium:500,fontWeightRegular:400,letterSpacing:-.4},h1:{color:"rgb(29, 29, 29)",fontSize:"6rem",fontWeight:300,lineHeight:1},h2:{color:"rgb(29, 29, 29)",fontSize:"3.75rem",fontWeight:300,lineHeight:1},h3:{color:"rgb(29, 29, 29)",fontSize:"3rem",fontWeight:400,lineHeight:1.04},h4:{color:"rgb(29, 29, 29)",fontSize:"2.125rem",fontWeight:400,lineHeight:1.17},h5:{color:"rgb(29, 29, 29)",fontSize:"1.5rem",fontWeight:400,lineHeight:1.33,letterSpacing:-.4},h6:{fontSize:"0.8rem",fontWeight:450,lineHeight:"1.71429em",color:"rgba(0, 0, 0, 0.87)",letterSpacing:-.4},subheading:{color:"rgb(29, 29, 29)",fontSize:"1rem",fontWeight:400,lineHeight:"1.5em",letterSpacing:-.4},subtitle1:{color:"rgb(29, 29, 29)",fontSize:"1rem",fontWeight:400,lineHeight:1.75,letterSpacing:-.4},subtitle2:{color:"rgb(29, 29, 29)",fontSize:"0.875rem",fontWeight:500,lineHeight:1.57,letterSpacing:-.4}},shadows:["none","0px 1px 3px 0px rgba(0, 0, 0, 0.1),0px 1px 1px 0px rgba(0, 0, 0, 0.04),0px 2px 1px -1px rgba(0, 0, 0, 0.02)","0px 1px 5px 0px rgba(0, 0, 0, 0.1),0px 2px 2px 0px rgba(0, 0, 0, 0.04),0px 3px 1px -2px rgba(0, 0, 0, 0.02)","0px 1px 8px 0px rgba(0, 0, 0, 0.1),0px 3px 4px 0px rgba(0, 0, 0, 0.04),0px 3px 3px -2px rgba(0, 0, 0, 0.02)","0px 2px 4px -1px rgba(0, 0, 0, 0.1),0px 4px 5px 0px rgba(0, 0, 0, 0.04),0px 1px 10px 0px rgba(0, 0, 0, 0.02)","0px 3px 5px -1px rgba(0, 0, 0, 0.1),0px 5px 8px 0px rgba(0, 0, 0, 0.04),0px 1px 14px 0px rgba(0, 0, 0, 0.02)","0px 3px 5px -1px rgba(0, 0, 0, 0.1),0px 6px 10px 0px rgba(0, 0, 0, 0.04),0px 1px 18px 0px rgba(0, 0, 0, 0.02)","0px 4px 5px -2px rgba(0, 0, 0, 0.1),0px 7px 10px 1px rgba(0, 0, 0, 0.04),0px 2px 16px 1px rgba(0, 0, 0, 0.02)","0px 5px 5px -3px rgba(0, 0, 0, 0.1),0px 8px 10px 1px rgba(0, 0, 0, 0.04),0px 3px 14px 2px rgba(0, 0, 0, 0.02)","0px 5px 6px -3px rgba(0, 0, 0, 0.1),0px 9px 12px 1px rgba(0, 0, 0, 0.04),0px 3px 16px 2px rgba(0, 0, 0, 0.02)","0px 6px 6px -3px rgba(0, 0, 0, 0.1),0px 10px 14px 1px rgba(0, 0, 0, 0.04),0px 4px 18px 3px rgba(0, 0, 0, 0.02)","0px 6px 7px -4px rgba(0, 0, 0, 0.1),0px 11px 15px 1px rgba(0, 0, 0, 0.04),0px 4px 20px 3px rgba(0, 0, 0, 0.02)","0px 7px 8px -4px rgba(0, 0, 0, 0.1),0px 12px 17px 2px rgba(0, 0, 0, 0.04),0px 5px 22px 4px rgba(0, 0, 0, 0.02)","0px 7px 8px -4px rgba(0, 0, 0, 0.1),0px 13px 19px 2px rgba(0, 0, 0, 0.04),0px 5px 24px 4px rgba(0, 0, 0, 0.02)","0px 7px 9px -4px rgba(0, 0, 0, 0.1),0px 14px 21px 2px rgba(0, 0, 0, 0.04),0px 5px 26px 4px rgba(0, 0, 0, 0.02)","0px 8px 9px -5px rgba(0, 0, 0, 0.1),0px 15px 22px 2px rgba(0, 0, 0, 0.04),0px 6px 28px 5px rgba(0, 0, 0, 0.02)","0px 8px 10px -5px rgba(0, 0, 0, 0.1),0px 16px 24px 2px rgba(0, 0, 0, 0.04),0px 6px 30px 5px rgba(0, 0, 0, 0.02)","0px 8px 11px -5px rgba(0, 0, 0, 0.1),0px 17px 26px 2px rgba(0, 0, 0, 0.04),0px 6px 32px 5px rgba(0, 0, 0, 0.02)","0px 9px 11px -5px rgba(0, 0, 0, 0.1),0px 18px 28px 2px rgba(0, 0, 0, 0.04),0px 7px 34px 6px rgba(0, 0, 0, 0.02)","0px 9px 12px -6px rgba(0, 0, 0, 0.1),0px 19px 29px 2px rgba(0, 0, 0, 0.04),0px 7px 36px 6px rgba(0, 0, 0, 0.02)","0px 10px 13px -6px rgba(0, 0, 0, 0.1),0px 20px 31px 3px rgba(0, 0, 0, 0.04),0px 8px 38px 7px rgba(0, 0, 0, 0.02)","0px 10px 13px -6px rgba(0, 0, 0, 0.1),0px 21px 33px 3px rgba(0, 0, 0, 0.04),0px 8px 40px 7px rgba(0, 0, 0, 0.02)","0px 10px 14px -6px rgba(0, 0, 0, 0.1),0px 22px 35px 3px rgba(0, 0, 0, 0.04),0px 8px 42px 7px rgba(0, 0, 0, 0.02)","0px 11px 14px -7px rgba(0, 0, 0, 0.1),0px 23px 36px 3px rgba(0, 0, 0, 0.04),0px 9px 44px 8px rgba(0, 0, 0, 0.02)","0px 11px 15px -7px rgba(0, 0, 0, 0.1),0px 24px 38px 3px rgba(0, 0, 0, 0.04),0px 9px 46px 8px rgba(0, 0, 0, 0.02)",]},u=(0,i.createMuiTheme)(s)},66289(e,t,n){"use strict";function r(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function i(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function a(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}function o(e,t,n){return(o=a()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&f(i,n.prototype),i}).apply(null,arguments)}function s(e){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function u(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&f(e,t)}function c(e){return -1!==Function.toString.call(e).indexOf("[native code]")}function l(e,t){return t&&("object"===p(t)||"function"==typeof t)?t:r(e)}function f(e,t){return(f=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}n.d(t,{V0:()=>B,_7:()=>v});var d,h,p=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function b(e){var t="function"==typeof Map?new Map:void 0;return(b=function(e){if(null===e||!c(e))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return o(e,arguments,s(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),f(n,e)})(e)}function m(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}function g(e){var t=m();return function(){var n,r=s(e);if(t){var i=s(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return l(this,n)}}var v=function(e){u(n,e);var t=g(n);function n(e){var r;return i(this,n),(r=t.call(this,"AuthenticationError(".concat(e.statusText,")"))).errors=[{status:e.status,detail:e},],r}return n}(b(Error)),y=function(e){u(n,e);var t=g(n);function n(e){var r,a=e.errors;return i(this,n),(r=t.call(this,"BadRequestError")).errors=a,r}return n}(b(Error)),w=function(e){u(n,e);var t=g(n);function n(e){var r;return i(this,n),(r=t.call(this,"UnprocessableEntityError")).errors=e,r}return n}(b(Error)),_=function(e){u(n,e);var t=g(n);function n(e){var r;return i(this,n),(r=t.call(this,"ServerError")).errors=e,r}return n}(b(Error)),E=function(e){u(n,e);var t=g(n);function n(e){var r,a=e.errors;return i(this,n),(r=t.call(this,"ConflictError")).errors=a,r}return n}(b(Error)),S=function(e){u(n,e);var t=g(n);function n(e){var r;return i(this,n),(r=t.call(this,"UnknownResponseError(".concat(e.statusText,")"))).errors=[{status:e.status,detail:e.statusText},],r}return n}(b(Error));function k(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2e4;return Promise.race([fetch(e,t),new Promise(function(e,t){return setTimeout(function(){return t(Error("timeout"))},n)}),])}function x(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]=200&&e.status<300))return[3,2];return[2,e.json()];case 2:if(400!==e.status)return[3,3];return[2,e.json().then(function(e){throw new y(e)})];case 3:if(401!==e.status)return[3,4];throw new v(e);case 4:if(422!==e.status)return[3,6];return[4,$(e)];case 5:throw n=i.sent(),new w(n);case 6:if(409!==e.status)return[3,7];return[2,e.json().then(function(e){throw new E(e)})];case 7:if(!(e.status>=500))return[3,9];return[4,$(e)];case 8:throw r=i.sent(),new _(r);case 9:throw new S(e);case 10:return[2]}})})).apply(this,arguments)}function $(e){return z.apply(this,arguments)}function z(){return(z=j(function(e){return Y(this,function(t){return[2,e.json().then(function(t){return t.errors?t.errors.map(function(t){return{status:e.status,detail:t.detail}}):G(e)}).catch(function(){return G(e)})]})})).apply(this,arguments)}function G(e){return[{status:e.status,detail:e.statusText},]}},50109(e,t,n){"use strict";n.d(t,{LK:()=>o,U2:()=>i,eT:()=>s,t8:()=>a});var r=n(12795);function i(e){return r.ZP.getItem("chainlink.".concat(e))}function a(e,t){r.ZP.setItem("chainlink.".concat(e),t)}function o(e){var t=i(e),n={};if(t)try{return JSON.parse(t)}catch(r){}return n}function s(e,t){a(e,JSON.stringify(t))}},9541(e,t,n){"use strict";n.d(t,{Ks:()=>u,Tp:()=>a,iR:()=>o,pm:()=>s});var r=n(50109),i="persistURL";function a(){return r.U2(i)||""}function o(e){r.t8(i,e)}function s(){return r.LK("authentication")}function u(e){r.eT("authentication",e)}},67121(e,t,n){"use strict";function r(e){var t,n=e.Symbol;return"function"==typeof n?n.observable?t=n.observable:(t=n("observable"),n.observable=t):t="@@observable",t}n.r(t),n.d(t,{default:()=>o}),e=n.hmd(e),i="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==n.g?n.g:e;var i,a=r(i);let o=a},2177(e,t,n){"use strict";n.d(t,{Z:()=>o});var r=!0,i="Invariant failed";function a(e,t){if(!e){if(r)throw Error(i);throw Error(i+": "+(t||""))}}let o=a},11742(e){e.exports=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,n=[],r=0;ru,ZT:()=>i,_T:()=>o,ev:()=>c,mG:()=>s,pi:()=>a});var r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function i(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var a=function(){return(a=Object.assign||function(e){for(var t,n=1,r=arguments.length;nt.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,r=Object.getOwnPropertySymbols(e);it.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function s(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||(n=Promise))(function(n,a){function o(e){try{u(r.next(e))}catch(t){a(t)}}function s(e){try{u(r.throw(e))}catch(t){a(t)}}function u(e){e.done?n(e.value):i(e.value).then(o,s)}u((r=r.apply(e,t||[])).next())})}function u(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(e){return function(t){return u([e,t])}}function u(a){if(n)throw TypeError("Generator is already executing.");for(;o;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,r=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(i=(i=o.trys).length>0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]r})},94927(e,t,n){function r(e,t){if(i("noDeprecation"))return e;var n=!1;function r(){if(!n){if(i("throwDeprecation"))throw Error(t);i("traceDeprecation")?console.trace(t):console.warn(t),n=!0}return e.apply(this,arguments)}return r}function i(e){try{if(!n.g.localStorage)return!1}catch(t){return!1}var r=n.g.localStorage[e];return null!=r&&"true"===String(r).toLowerCase()}e.exports=r},42473(e){"use strict";var t=function(){};e.exports=t},84763(e){e.exports=Worker},47529(e){e.exports=n;var t=Object.prototype.hasOwnProperty;function n(){for(var e={},n=0;ne.length)&&(t=e.length);for(var n=0,r=Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports},7071(e){function t(e,t){if(null==e)return{};var n,r,i={},a=Object.keys(e);for(r=0;r=0||(i[n]=e[n]);return i}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},94993(e,t,n){var r=n(18698).default,i=n(66115);function a(e,t){if(t&&("object"===r(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return i(e)}e.exports=a,e.exports.__esModule=!0,e.exports.default=e.exports},6015(e){function t(n,r){return e.exports=t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n,r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},861(e,t,n){var r=n(63405),i=n(79498),a=n(86116),o=n(42281);function s(e){return r(e)||i(e)||a(e)||o()}e.exports=s,e.exports.__esModule=!0,e.exports.default=e.exports},18698(e){function t(n){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},86116(e,t,n){var r=n(73897);function i(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return r(e,t)}}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports},1644(e,t,n){"use strict";var r,i;function a(e){return!!e&&e<7}n.d(t,{I:()=>r,O:()=>a}),(i=r||(r={}))[i.loading=1]="loading",i[i.setVariables=2]="setVariables",i[i.fetchMore=3]="fetchMore",i[i.refetch=4]="refetch",i[i.poll=6]="poll",i[i.ready=7]="ready",i[i.error=8]="error"},30990(e,t,n){"use strict";n.d(t,{MS:()=>s,YG:()=>a,cA:()=>c,ls:()=>o});var r=n(70655);n(83952);var i=n(13154),a=Symbol();function o(e){return!!e.extensions&&Array.isArray(e.extensions[a])}function s(e){return e.hasOwnProperty("graphQLErrors")}var u=function(e){var t=(0,r.ev)((0,r.ev)((0,r.ev)([],e.graphQLErrors,!0),e.clientErrors,!0),e.protocolErrors,!0);return e.networkError&&t.push(e.networkError),t.map(function(e){return(0,i.s)(e)&&e.message||"Error message not found."}).join("\n")},c=function(e){function t(n){var r=n.graphQLErrors,i=n.protocolErrors,a=n.clientErrors,o=n.networkError,s=n.errorMessage,c=n.extraInfo,l=e.call(this,s)||this;return l.name="ApolloError",l.graphQLErrors=r||[],l.protocolErrors=i||[],l.clientErrors=a||[],l.networkError=o||null,l.message=s||u(l),l.extraInfo=c,l.__proto__=t.prototype,l}return(0,r.ZT)(t,e),t}(Error)},85317(e,t,n){"use strict";n.d(t,{K:()=>a});var r=n(67294),i=n(30320).aS?Symbol.for("__APOLLO_CONTEXT__"):"__APOLLO_CONTEXT__";function a(){var e=r.createContext[i];return e||(Object.defineProperty(r.createContext,i,{value:e=r.createContext({}),enumerable:!1,writable:!1,configurable:!0}),e.displayName="ApolloContext"),e}},21436(e,t,n){"use strict";n.d(t,{O:()=>i,k:()=>r});var r=Array.isArray;function i(e){return Array.isArray(e)&&e.length>0}},30320(e,t,n){"use strict";n.d(t,{DN:()=>s,JC:()=>l,aS:()=>o,mr:()=>i,sy:()=>a});var r=n(83952),i="function"==typeof WeakMap&&"ReactNative"!==(0,r.wY)(function(){return navigator.product}),a="function"==typeof WeakSet,o="function"==typeof Symbol&&"function"==typeof Symbol.for,s=o&&Symbol.asyncIterator,u="function"==typeof(0,r.wY)(function(){return window.document.createElement}),c=(0,r.wY)(function(){return navigator.userAgent.indexOf("jsdom")>=0})||!1,l=u&&!c},53712(e,t,n){"use strict";function r(){for(var e=[],t=0;tr})},10542(e,t,n){"use strict";n.d(t,{J:()=>o}),n(83952);var r=n(13154);function i(e){var t=new Set([e]);return t.forEach(function(e){(0,r.s)(e)&&a(e)===e&&Object.getOwnPropertyNames(e).forEach(function(n){(0,r.s)(e[n])&&t.add(e[n])})}),e}function a(e){if(__DEV__&&!Object.isFrozen(e))try{Object.freeze(e)}catch(t){if(t instanceof TypeError)return null;throw t}return e}function o(e){return __DEV__&&i(e),e}},14012(e,t,n){"use strict";n.d(t,{J:()=>a});var r=n(70655),i=n(53712);function a(e,t){return(0,i.o)(e,t,t.variables&&{variables:(0,r.pi)((0,r.pi)({},e&&e.variables),t.variables)})}},13154(e,t,n){"use strict";function r(e){return null!==e&&"object"==typeof e}n.d(t,{s:()=>r})},83952(e,t,n){"use strict";n.d(t,{ej:()=>u,kG:()=>c,wY:()=>h});var r,i=n(70655),a="Invariant Violation",o=Object.setPrototypeOf,s=void 0===o?function(e,t){return e.__proto__=t,e}:o,u=function(e){function t(n){void 0===n&&(n=a);var r=e.call(this,"number"==typeof n?a+": "+n+" (see https://github.com/apollographql/invariant-packages)":n)||this;return r.framesToPop=1,r.name=a,s(r,t.prototype),r}return(0,i.ZT)(t,e),t}(Error);function c(e,t){if(!e)throw new u(t)}var l=["debug","log","warn","error","silent"],f=l.indexOf("log");function d(e){return function(){if(l.indexOf(e)>=f)return(console[e]||console.log).apply(console,arguments)}}function h(e){try{return e()}catch(t){}}(r=c||(c={})).debug=d("debug"),r.log=d("log"),r.warn=d("warn"),r.error=d("error");let p=h(function(){return globalThis})||h(function(){return window})||h(function(){return self})||h(function(){return global})||h(function(){return h.constructor("return this")()});var b="__",m=[b,b].join("DEV");function g(){try{return Boolean(__DEV__)}catch(e){return Object.defineProperty(p,m,{value:"production"!==h(function(){return"production"}),enumerable:!1,configurable:!0,writable:!0}),p[m]}}let v=g();function y(e){try{return e()}catch(t){}}var w=y(function(){return globalThis})||y(function(){return window})||y(function(){return self})||y(function(){return global})||y(function(){return y.constructor("return this")()}),_=!1;function E(){!w||y(function(){return"production"})||y(function(){return process})||(Object.defineProperty(w,"process",{value:{env:{NODE_ENV:"production"}},configurable:!0,enumerable:!1,writable:!0}),_=!0)}function S(){_&&(delete w.process,_=!1)}E();var k=n(10143);function x(){return k.H,S()}function T(){__DEV__?c("boolean"==typeof v,v):c("boolean"==typeof v,39)}x(),T()},4942(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n.d(t,{Z:()=>r})},87462(e,t,n){"use strict";function r(){return(r=Object.assign?Object.assign.bind():function(e){for(var t=1;tr})},51721(e,t,n){"use strict";function r(e,t){return(r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function i(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,r(e,t)}n.d(t,{Z:()=>i})},63366(e,t,n){"use strict";function r(e,t){if(null==e)return{};var n,r,i={},a=Object.keys(e);for(r=0;r=0||(i[n]=e[n]);return i}n.d(t,{Z:()=>r})},25821(e,t,n){"use strict";n.d(t,{Z:()=>s});var r=n(45695);function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var a=10,o=2;function s(e){return u(e,[])}function u(e,t){switch(i(e)){case"string":return JSON.stringify(e);case"function":return e.name?"[function ".concat(e.name,"]"):"[function]";case"object":if(null===e)return"null";return c(e,t);default:return String(e)}}function c(e,t){if(-1!==t.indexOf(e))return"[Circular]";var n=[].concat(t,[e]),r=d(e);if(void 0!==r){var i=r.call(e);if(i!==e)return"string"==typeof i?i:u(i,n)}else if(Array.isArray(e))return f(e,n);return l(e,n)}function l(e,t){var n=Object.keys(e);return 0===n.length?"{}":t.length>o?"["+h(e)+"]":"{ "+n.map(function(n){var r=u(e[n],t);return n+": "+r}).join(", ")+" }"}function f(e,t){if(0===e.length)return"[]";if(t.length>o)return"[Array]";for(var n=Math.min(a,e.length),r=e.length-n,i=[],s=0;s1&&i.push("... ".concat(r," more items")),"["+i.join(", ")+"]"}function d(e){var t=e[String(r.Z)];return"function"==typeof t?t:"function"==typeof e.inspect?e.inspect:void 0}function h(e){var t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===t&&"function"==typeof e.constructor){var n=e.constructor.name;if("string"==typeof n&&""!==n)return n}return t}},45695(e,t,n){"use strict";n.d(t,{Z:()=>i});var r="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):void 0;let i=r},25217(e,t,n){"use strict";function r(e,t){if(!Boolean(e))throw Error(null!=t?t:"Unexpected invariant triggered.")}n.d(t,{Ye:()=>o,WU:()=>s,UG:()=>u});var i=n(45695);function a(e){var t=e.prototype.toJSON;"function"==typeof t||r(0),e.prototype.inspect=t,i.Z&&(e.prototype[i.Z]=t)}var o=function(){function e(e,t,n){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=n}return e.prototype.toJSON=function(){return{start:this.start,end:this.end}},e}();a(o);var s=function(){function e(e,t,n,r,i,a,o){this.kind=e,this.start=t,this.end=n,this.line=r,this.column=i,this.value=o,this.prev=a,this.next=null}return e.prototype.toJSON=function(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}},e}();function u(e){return null!=e&&"string"==typeof e.kind}a(s)},87392(e,t,n){"use strict";function r(e){var t=e.split(/\r\n|[\n\r]/g),n=a(e);if(0!==n)for(var r=1;ro&&i(t[s-1]);)--s;return t.slice(o,s).join("\n")}function i(e){for(var t=0;t1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=-1===e.indexOf("\n"),i=" "===e[0]||" "===e[0],a='"'===e[e.length-1],o="\\"===e[e.length-1],s=!r||a||o||n,u="";return s&&!(r&&i)&&(u+="\n"+t),u+=t?e.replace(/\n/g,"\n"+t):e,s&&(u+="\n"),'"""'+u.replace(/"""/g,'\\"""')+'"""'}n.d(t,{LZ:()=>o,W7:()=>r})},97359(e,t,n){"use strict";n.d(t,{h:()=>r});var r=Object.freeze({NAME:"Name",DOCUMENT:"Document",OPERATION_DEFINITION:"OperationDefinition",VARIABLE_DEFINITION:"VariableDefinition",SELECTION_SET:"SelectionSet",FIELD:"Field",ARGUMENT:"Argument",FRAGMENT_SPREAD:"FragmentSpread",INLINE_FRAGMENT:"InlineFragment",FRAGMENT_DEFINITION:"FragmentDefinition",VARIABLE:"Variable",INT:"IntValue",FLOAT:"FloatValue",STRING:"StringValue",BOOLEAN:"BooleanValue",NULL:"NullValue",ENUM:"EnumValue",LIST:"ListValue",OBJECT:"ObjectValue",OBJECT_FIELD:"ObjectField",DIRECTIVE:"Directive",NAMED_TYPE:"NamedType",LIST_TYPE:"ListType",NON_NULL_TYPE:"NonNullType",SCHEMA_DEFINITION:"SchemaDefinition",OPERATION_TYPE_DEFINITION:"OperationTypeDefinition",SCALAR_TYPE_DEFINITION:"ScalarTypeDefinition",OBJECT_TYPE_DEFINITION:"ObjectTypeDefinition",FIELD_DEFINITION:"FieldDefinition",INPUT_VALUE_DEFINITION:"InputValueDefinition",INTERFACE_TYPE_DEFINITION:"InterfaceTypeDefinition",UNION_TYPE_DEFINITION:"UnionTypeDefinition",ENUM_TYPE_DEFINITION:"EnumTypeDefinition",ENUM_VALUE_DEFINITION:"EnumValueDefinition",INPUT_OBJECT_TYPE_DEFINITION:"InputObjectTypeDefinition",DIRECTIVE_DEFINITION:"DirectiveDefinition",SCHEMA_EXTENSION:"SchemaExtension",SCALAR_TYPE_EXTENSION:"ScalarTypeExtension",OBJECT_TYPE_EXTENSION:"ObjectTypeExtension",INTERFACE_TYPE_EXTENSION:"InterfaceTypeExtension",UNION_TYPE_EXTENSION:"UnionTypeExtension",ENUM_TYPE_EXTENSION:"EnumTypeExtension",INPUT_OBJECT_TYPE_EXTENSION:"InputObjectTypeExtension"})},10143(e,t,n){"use strict";n.d(t,{H:()=>c,T:()=>l});var r=n(99763),i=n(25821);function a(e,t){if(!Boolean(e))throw Error(t)}let o=function(e,t){return e instanceof t};function s(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:"GraphQL request",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{line:1,column:1};"string"==typeof e||a(0,"Body must be a string. Received: ".concat((0,i.Z)(e),".")),this.body=e,this.name=t,this.locationOffset=n,this.locationOffset.line>0||a(0,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||a(0,"column in locationOffset is 1-indexed and must be positive.")}return u(e,[{key:r.YF,get:function(){return"Source"}}]),e}();function l(e){return o(e,c)}},99763(e,t,n){"use strict";n.d(t,{YF:()=>r});var r="function"==typeof Symbol&&null!=Symbol.toStringTag?Symbol.toStringTag:"@@toStringTag"},37452(e){"use strict";e.exports=JSON.parse('{"AElig":"\xc6","AMP":"&","Aacute":"\xc1","Acirc":"\xc2","Agrave":"\xc0","Aring":"\xc5","Atilde":"\xc3","Auml":"\xc4","COPY":"\xa9","Ccedil":"\xc7","ETH":"\xd0","Eacute":"\xc9","Ecirc":"\xca","Egrave":"\xc8","Euml":"\xcb","GT":">","Iacute":"\xcd","Icirc":"\xce","Igrave":"\xcc","Iuml":"\xcf","LT":"<","Ntilde":"\xd1","Oacute":"\xd3","Ocirc":"\xd4","Ograve":"\xd2","Oslash":"\xd8","Otilde":"\xd5","Ouml":"\xd6","QUOT":"\\"","REG":"\xae","THORN":"\xde","Uacute":"\xda","Ucirc":"\xdb","Ugrave":"\xd9","Uuml":"\xdc","Yacute":"\xdd","aacute":"\xe1","acirc":"\xe2","acute":"\xb4","aelig":"\xe6","agrave":"\xe0","amp":"&","aring":"\xe5","atilde":"\xe3","auml":"\xe4","brvbar":"\xa6","ccedil":"\xe7","cedil":"\xb8","cent":"\xa2","copy":"\xa9","curren":"\xa4","deg":"\xb0","divide":"\xf7","eacute":"\xe9","ecirc":"\xea","egrave":"\xe8","eth":"\xf0","euml":"\xeb","frac12":"\xbd","frac14":"\xbc","frac34":"\xbe","gt":">","iacute":"\xed","icirc":"\xee","iexcl":"\xa1","igrave":"\xec","iquest":"\xbf","iuml":"\xef","laquo":"\xab","lt":"<","macr":"\xaf","micro":"\xb5","middot":"\xb7","nbsp":"\xa0","not":"\xac","ntilde":"\xf1","oacute":"\xf3","ocirc":"\xf4","ograve":"\xf2","ordf":"\xaa","ordm":"\xba","oslash":"\xf8","otilde":"\xf5","ouml":"\xf6","para":"\xb6","plusmn":"\xb1","pound":"\xa3","quot":"\\"","raquo":"\xbb","reg":"\xae","sect":"\xa7","shy":"\xad","sup1":"\xb9","sup2":"\xb2","sup3":"\xb3","szlig":"\xdf","thorn":"\xfe","times":"\xd7","uacute":"\xfa","ucirc":"\xfb","ugrave":"\xf9","uml":"\xa8","uuml":"\xfc","yacute":"\xfd","yen":"\xa5","yuml":"\xff"}')},93580(e){"use strict";e.exports=JSON.parse('{"0":"�","128":"€","130":"‚","131":"ƒ","132":"„","133":"…","134":"†","135":"‡","136":"ˆ","137":"‰","138":"Š","139":"‹","140":"Œ","142":"Ž","145":"‘","146":"’","147":"“","148":"”","149":"•","150":"–","151":"—","152":"˜","153":"™","154":"š","155":"›","156":"œ","158":"ž","159":"Ÿ"}')},67946(e){"use strict";e.exports=JSON.parse('{"locale":"en","long":{"year":{"previous":"last year","current":"this year","next":"next year","past":{"one":"{0} year ago","other":"{0} years ago"},"future":{"one":"in {0} year","other":"in {0} years"}},"quarter":{"previous":"last quarter","current":"this quarter","next":"next quarter","past":{"one":"{0} quarter ago","other":"{0} quarters ago"},"future":{"one":"in {0} quarter","other":"in {0} quarters"}},"month":{"previous":"last month","current":"this month","next":"next month","past":{"one":"{0} month ago","other":"{0} months ago"},"future":{"one":"in {0} month","other":"in {0} months"}},"week":{"previous":"last week","current":"this week","next":"next week","past":{"one":"{0} week ago","other":"{0} weeks ago"},"future":{"one":"in {0} week","other":"in {0} weeks"}},"day":{"previous":"yesterday","current":"today","next":"tomorrow","past":{"one":"{0} day ago","other":"{0} days ago"},"future":{"one":"in {0} day","other":"in {0} days"}},"hour":{"current":"this hour","past":{"one":"{0} hour ago","other":"{0} hours ago"},"future":{"one":"in {0} hour","other":"in {0} hours"}},"minute":{"current":"this minute","past":{"one":"{0} minute ago","other":"{0} minutes ago"},"future":{"one":"in {0} minute","other":"in {0} minutes"}},"second":{"current":"now","past":{"one":"{0} second ago","other":"{0} seconds ago"},"future":{"one":"in {0} second","other":"in {0} seconds"}}},"short":{"year":{"previous":"last yr.","current":"this yr.","next":"next yr.","past":"{0} yr. ago","future":"in {0} yr."},"quarter":{"previous":"last qtr.","current":"this qtr.","next":"next qtr.","past":{"one":"{0} qtr. ago","other":"{0} qtrs. ago"},"future":{"one":"in {0} qtr.","other":"in {0} qtrs."}},"month":{"previous":"last mo.","current":"this mo.","next":"next mo.","past":"{0} mo. ago","future":"in {0} mo."},"week":{"previous":"last wk.","current":"this wk.","next":"next wk.","past":"{0} wk. ago","future":"in {0} wk."},"day":{"previous":"yesterday","current":"today","next":"tomorrow","past":{"one":"{0} day ago","other":"{0} days ago"},"future":{"one":"in {0} day","other":"in {0} days"}},"hour":{"current":"this hour","past":"{0} hr. ago","future":"in {0} hr."},"minute":{"current":"this minute","past":"{0} min. ago","future":"in {0} min."},"second":{"current":"now","past":"{0} sec. ago","future":"in {0} sec."}},"narrow":{"year":{"previous":"last yr.","current":"this yr.","next":"next yr.","past":"{0} yr. ago","future":"in {0} yr."},"quarter":{"previous":"last qtr.","current":"this qtr.","next":"next qtr.","past":{"one":"{0} qtr. ago","other":"{0} qtrs. ago"},"future":{"one":"in {0} qtr.","other":"in {0} qtrs."}},"month":{"previous":"last mo.","current":"this mo.","next":"next mo.","past":"{0} mo. ago","future":"in {0} mo."},"week":{"previous":"last wk.","current":"this wk.","next":"next wk.","past":"{0} wk. ago","future":"in {0} wk."},"day":{"previous":"yesterday","current":"today","next":"tomorrow","past":{"one":"{0} day ago","other":"{0} days ago"},"future":{"one":"in {0} day","other":"in {0} days"}},"hour":{"current":"this hour","past":"{0} hr. ago","future":"in {0} hr."},"minute":{"current":"this minute","past":"{0} min. ago","future":"in {0} min."},"second":{"current":"now","past":"{0} sec. ago","future":"in {0} sec."}},"now":{"now":{"current":"now","future":"in a moment","past":"just now"}},"mini":{"year":"{0}yr","month":"{0}mo","week":"{0}wk","day":"{0}d","hour":"{0}h","minute":"{0}m","second":"{0}s","now":"now"},"short-time":{"year":"{0} yr.","month":"{0} mo.","week":"{0} wk.","day":{"one":"{0} day","other":"{0} days"},"hour":"{0} hr.","minute":"{0} min.","second":"{0} sec."},"long-time":{"year":{"one":"{0} year","other":"{0} years"},"month":{"one":"{0} month","other":"{0} months"},"week":{"one":"{0} week","other":"{0} weeks"},"day":{"one":"{0} day","other":"{0} days"},"hour":{"one":"{0} hour","other":"{0} hours"},"minute":{"one":"{0} minute","other":"{0} minutes"},"second":{"one":"{0} second","other":"{0} seconds"}}}')}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var n=__webpack_module_cache__[e]={id:e,loaded:!1,exports:{}};return __webpack_modules__[e].call(n.exports,n,n.exports,__webpack_require__),n.loaded=!0,n.exports}__webpack_require__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},(()=>{var e,t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__;__webpack_require__.t=function(n,r){if(1&r&&(n=this(n)),8&r||"object"==typeof n&&n&&(4&r&&n.__esModule||16&r&&"function"==typeof n.then))return n;var i=Object.create(null);__webpack_require__.r(i);var a={};e=e||[null,t({}),t([]),t(t)];for(var o=2&r&&n;"object"==typeof o&&!~e.indexOf(o);o=t(o))Object.getOwnPropertyNames(o).forEach(e=>a[e]=()=>n[e]);return a.default=()=>n,__webpack_require__.d(i,a),i}})(),__webpack_require__.d=(e,t)=>{for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.hmd=e=>((e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set(){throw Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e),__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),__webpack_require__.p="/assets/",__webpack_require__.nc=void 0;var __webpack_exports__={};(()=>{"use strict";var e,t,n,r,i=__webpack_require__(32316),a=__webpack_require__(8126),o=__webpack_require__(5690),s=__webpack_require__(30381),u=__webpack_require__.n(s),c=__webpack_require__(67294),l=__webpack_require__(73935),f=__webpack_require__.n(l),d=__webpack_require__(57209),h=__webpack_require__(37703),p=__webpack_require__(97779),b=__webpack_require__(28500);function m(e){return function(t){var n=t.dispatch,r=t.getState;return function(t){return function(i){return"function"==typeof i?i(n,r,e):t(i)}}}}var g=m();g.withExtraArgument=m;let v=g;var y=__webpack_require__(76489);function w(e){return function(t){return function(n){return function(r){n(r);var i=e||document&&document.cookie||"",a=t.getState();if("MATCH_ROUTE"===r.type&&"/signin"!==a.notifications.currentUrl){var o=(0,y.Q)(i);if(o.explorer)try{var s=JSON.parse(o.explorer);if("error"===s.status){var u=_(s.url);n({type:"NOTIFY_ERROR_MSG",msg:u})}}catch(c){n({type:"NOTIFY_ERROR_MSG",msg:"Invalid explorer status"})}}}}}}function _(e){var t="Can't connect to explorer: ".concat(e);return e.match(/^wss?:.+/)?t:"".concat(t,". You must use a websocket.")}var E=__webpack_require__(16353);function S(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function ei(e,t){if(e){if("string"==typeof e)return ea(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ea(e,t)}}function ea(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n1,i=!1,a=arguments[1],o=a;return new n(function(n){return t.subscribe({next:function(t){var a=!i;if(i=!0,!a||r)try{o=e(o,t)}catch(s){return n.error(s)}else o=t},error:function(e){n.error(e)},complete:function(){if(!i&&!r)return n.error(TypeError("Cannot reduce an empty sequence"));n.next(o),n.complete()}})})},t.concat=function(){for(var e=this,t=arguments.length,n=Array(t),r=0;r=0&&i.splice(e,1),o()}});i.push(s)},error:function(e){r.error(e)},complete:function(){o()}});function o(){a.closed&&0===i.length&&r.complete()}return function(){i.forEach(function(e){return e.unsubscribe()}),a.unsubscribe()}})},t[ed]=function(){return this},e.from=function(t){var n="function"==typeof this?this:e;if(null==t)throw TypeError(t+" is not an object");var r=ep(t,ed);if(r){var i=r.call(t);if(Object(i)!==i)throw TypeError(i+" is not an object");return em(i)&&i.constructor===n?i:new n(function(e){return i.subscribe(e)})}if(ec("iterator")&&(r=ep(t,ef)))return new n(function(e){ev(function(){if(!e.closed){for(var n,i=er(r.call(t));!(n=i()).done;){var a=n.value;if(e.next(a),e.closed)return}e.complete()}})});if(Array.isArray(t))return new n(function(e){ev(function(){if(!e.closed){for(var n=0;n0))return n.connection.key;var r=n.connection.filter?n.connection.filter:[];r.sort();var i={};return r.forEach(function(e){i[e]=t[e]}),"".concat(n.connection.key,"(").concat(eV(i),")")}var a=e;if(t){var o=eV(t);a+="(".concat(o,")")}return n&&Object.keys(n).forEach(function(e){-1===eW.indexOf(e)&&(n[e]&&Object.keys(n[e]).length?a+="@".concat(e,"(").concat(eV(n[e]),")"):a+="@".concat(e))}),a},{setStringify:function(e){var t=eV;return eV=e,t}}),eV=function(e){return JSON.stringify(e,eq)};function eq(e,t){return(0,eO.s)(t)&&!Array.isArray(t)&&(t=Object.keys(t).sort().reduce(function(e,n){return e[n]=t[n],e},{})),t}function eZ(e,t){if(e.arguments&&e.arguments.length){var n={};return e.arguments.forEach(function(e){var r;return ez(n,e.name,e.value,t)}),n}return null}function eX(e){return e.alias?e.alias.value:e.name.value}function eJ(e,t,n){for(var r,i=0,a=t.selections;it.indexOf(i))throw __DEV__?new Q.ej("illegal argument: ".concat(i)):new Q.ej(27)}return e}function tt(e,t){return t?t(e):eT.of()}function tn(e){return"function"==typeof e?new ta(e):e}function tr(e){return e.request.length<=1}var ti=function(e){function t(t,n){var r=e.call(this,t)||this;return r.link=n,r}return(0,en.ZT)(t,e),t}(Error),ta=function(){function e(e){e&&(this.request=e)}return e.empty=function(){return new e(function(){return eT.of()})},e.from=function(t){return 0===t.length?e.empty():t.map(tn).reduce(function(e,t){return e.concat(t)})},e.split=function(t,n,r){var i=tn(n),a=tn(r||new e(tt));return new e(tr(i)&&tr(a)?function(e){return t(e)?i.request(e)||eT.of():a.request(e)||eT.of()}:function(e,n){return t(e)?i.request(e,n)||eT.of():a.request(e,n)||eT.of()})},e.execute=function(e,t){return e.request(eM(t.context,e7(te(t))))||eT.of()},e.concat=function(t,n){var r=tn(t);if(tr(r))return __DEV__&&Q.kG.warn(new ti("You are calling concat on a terminating link, which will have no effect",r)),r;var i=tn(n);return new e(tr(i)?function(e){return r.request(e,function(e){return i.request(e)||eT.of()})||eT.of()}:function(e,t){return r.request(e,function(e){return i.request(e,t)||eT.of()})||eT.of()})},e.prototype.split=function(t,n,r){return this.concat(e.split(t,n,r||new e(tt)))},e.prototype.concat=function(t){return e.concat(this,t)},e.prototype.request=function(e,t){throw __DEV__?new Q.ej("request is not implemented"):new Q.ej(22)},e.prototype.onError=function(e,t){if(t&&t.error)return t.error(e),!1;throw e},e.prototype.setOnError=function(e){return this.onError=e,this},e}(),to=__webpack_require__(25821),ts=__webpack_require__(25217),tu={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]},tc=Object.freeze({});function tl(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:tu,r=void 0,i=Array.isArray(e),a=[e],o=-1,s=[],u=void 0,c=void 0,l=void 0,f=[],d=[],h=e;do{var p,b=++o===a.length,m=b&&0!==s.length;if(b){if(c=0===d.length?void 0:f[f.length-1],u=l,l=d.pop(),m){if(i)u=u.slice();else{for(var g={},v=0,y=Object.keys(u);v1)for(var r=new tB,i=1;i=0;--a){var o=i[a],s=isNaN(+o)?{}:[];s[o]=t,t=s}n=r.merge(n,t)}),n}var tW=Object.prototype.hasOwnProperty;function tK(e,t){var n,r,i,a,o;return(0,en.mG)(this,void 0,void 0,function(){var s,u,c,l,f,d,h,p,b,m,g,v,y,w,_,E,S,k,x,T,M,O,A;return(0,en.Jh)(this,function(L){switch(L.label){case 0:if(void 0===TextDecoder)throw Error("TextDecoder must be defined in the environment: please import a polyfill.");s=new TextDecoder("utf-8"),u=null===(n=e.headers)||void 0===n?void 0:n.get("content-type"),c="boundary=",l=(null==u?void 0:u.includes(c))?null==u?void 0:u.substring((null==u?void 0:u.indexOf(c))+c.length).replace(/['"]/g,"").replace(/\;(.*)/gm,"").trim():"-",f="\r\n--".concat(l),d="",h=tI(e),p=!0,L.label=1;case 1:if(!p)return[3,3];return[4,h.next()];case 2:for(m=(b=L.sent()).value,g=b.done,v="string"==typeof m?m:s.decode(m),y=d.length-f.length+1,p=!g,d+=v,w=d.indexOf(f,y);w>-1;){if(_=void 0,_=(O=[d.slice(0,w),d.slice(w+f.length),])[0],d=O[1],E=_.indexOf("\r\n\r\n"),(k=(S=tV(_.slice(0,E)))["content-type"])&&-1===k.toLowerCase().indexOf("application/json"))throw Error("Unsupported patch content type: application/json is required.");if(x=_.slice(E))try{T=tq(e,x),Object.keys(T).length>1||"data"in T||"incremental"in T||"errors"in T||"payload"in T?tz(T)?(M={},"payload"in T&&(M=(0,en.pi)({},T.payload)),"errors"in T&&(M=(0,en.pi)((0,en.pi)({},M),{extensions:(0,en.pi)((0,en.pi)({},"extensions"in M?M.extensions:null),((A={})[tN.YG]=T.errors,A))})),null===(r=t.next)||void 0===r||r.call(t,M)):null===(i=t.next)||void 0===i||i.call(t,T):1===Object.keys(T).length&&"hasNext"in T&&!T.hasNext&&(null===(a=t.complete)||void 0===a||a.call(t))}catch(C){tZ(C,t)}w=d.indexOf(f)}return[3,1];case 3:return null===(o=t.complete)||void 0===o||o.call(t),[2]}})})}function tV(e){var t={};return e.split("\n").forEach(function(e){var n=e.indexOf(":");if(n>-1){var r=e.slice(0,n).trim().toLowerCase(),i=e.slice(n+1).trim();t[r]=i}}),t}function tq(e,t){e.status>=300&&tD(e,function(){try{return JSON.parse(t)}catch(e){return t}}(),"Response not successful: Received status code ".concat(e.status));try{return JSON.parse(t)}catch(n){var r=n;throw r.name="ServerParseError",r.response=e,r.statusCode=e.status,r.bodyText=t,r}}function tZ(e,t){var n,r;"AbortError"!==e.name&&(e.result&&e.result.errors&&e.result.data&&(null===(n=t.next)||void 0===n||n.call(t,e.result)),null===(r=t.error)||void 0===r||r.call(t,e))}function tX(e,t,n){tJ(t)(e).then(function(e){var t,r;null===(t=n.next)||void 0===t||t.call(n,e),null===(r=n.complete)||void 0===r||r.call(n)}).catch(function(e){return tZ(e,n)})}function tJ(e){return function(t){return t.text().then(function(e){return tq(t,e)}).then(function(n){return t.status>=300&&tD(t,n,"Response not successful: Received status code ".concat(t.status)),Array.isArray(n)||tW.call(n,"data")||tW.call(n,"errors")||tD(t,n,"Server response was missing for query '".concat(Array.isArray(e)?e.map(function(e){return e.operationName}):e.operationName,"'.")),n})}}var tQ=function(e){if(!e&&"undefined"==typeof fetch)throw __DEV__?new Q.ej("\n\"fetch\" has not been found globally and no fetcher has been configured. To fix this, install a fetch package (like https://www.npmjs.com/package/cross-fetch), instantiate the fetcher, and pass it into your HttpLink constructor. For example:\n\nimport fetch from 'cross-fetch';\nimport { ApolloClient, HttpLink } from '@apollo/client';\nconst client = new ApolloClient({\n link: new HttpLink({ uri: '/graphql', fetch })\n});\n "):new Q.ej(23)},t1=__webpack_require__(87392);function t0(e){return tl(e,{leave:t3})}var t2=80,t3={Name:function(e){return e.value},Variable:function(e){return"$"+e.name},Document:function(e){return t6(e.definitions,"\n\n")+"\n"},OperationDefinition:function(e){var t=e.operation,n=e.name,r=t8("(",t6(e.variableDefinitions,", "),")"),i=t6(e.directives," "),a=e.selectionSet;return n||i||r||"query"!==t?t6([t,t6([n,r]),i,a]," "):a},VariableDefinition:function(e){var t=e.variable,n=e.type,r=e.defaultValue,i=e.directives;return t+": "+n+t8(" = ",r)+t8(" ",t6(i," "))},SelectionSet:function(e){return t5(e.selections)},Field:function(e){var t=e.alias,n=e.name,r=e.arguments,i=e.directives,a=e.selectionSet,o=t8("",t,": ")+n,s=o+t8("(",t6(r,", "),")");return s.length>t2&&(s=o+t8("(\n",t9(t6(r,"\n")),"\n)")),t6([s,t6(i," "),a]," ")},Argument:function(e){var t;return e.name+": "+e.value},FragmentSpread:function(e){var t;return"..."+e.name+t8(" ",t6(e.directives," "))},InlineFragment:function(e){var t=e.typeCondition,n=e.directives,r=e.selectionSet;return t6(["...",t8("on ",t),t6(n," "),r]," ")},FragmentDefinition:function(e){var t=e.name,n=e.typeCondition,r=e.variableDefinitions,i=e.directives,a=e.selectionSet;return"fragment ".concat(t).concat(t8("(",t6(r,", "),")")," ")+"on ".concat(n," ").concat(t8("",t6(i," ")," "))+a},IntValue:function(e){return e.value},FloatValue:function(e){return e.value},StringValue:function(e,t){var n=e.value;return e.block?(0,t1.LZ)(n,"description"===t?"":" "):JSON.stringify(n)},BooleanValue:function(e){return e.value?"true":"false"},NullValue:function(){return"null"},EnumValue:function(e){return e.value},ListValue:function(e){return"["+t6(e.values,", ")+"]"},ObjectValue:function(e){return"{"+t6(e.fields,", ")+"}"},ObjectField:function(e){var t;return e.name+": "+e.value},Directive:function(e){var t;return"@"+e.name+t8("(",t6(e.arguments,", "),")")},NamedType:function(e){return e.name},ListType:function(e){return"["+e.type+"]"},NonNullType:function(e){return e.type+"!"},SchemaDefinition:t4(function(e){var t=e.directives,n=e.operationTypes;return t6(["schema",t6(t," "),t5(n)]," ")}),OperationTypeDefinition:function(e){var t;return e.operation+": "+e.type},ScalarTypeDefinition:t4(function(e){var t;return t6(["scalar",e.name,t6(e.directives," ")]," ")}),ObjectTypeDefinition:t4(function(e){var t=e.name,n=e.interfaces,r=e.directives,i=e.fields;return t6(["type",t,t8("implements ",t6(n," & ")),t6(r," "),t5(i)]," ")}),FieldDefinition:t4(function(e){var t=e.name,n=e.arguments,r=e.type,i=e.directives;return t+(ne(n)?t8("(\n",t9(t6(n,"\n")),"\n)"):t8("(",t6(n,", "),")"))+": "+r+t8(" ",t6(i," "))}),InputValueDefinition:t4(function(e){var t=e.name,n=e.type,r=e.defaultValue,i=e.directives;return t6([t+": "+n,t8("= ",r),t6(i," ")]," ")}),InterfaceTypeDefinition:t4(function(e){var t=e.name,n=e.interfaces,r=e.directives,i=e.fields;return t6(["interface",t,t8("implements ",t6(n," & ")),t6(r," "),t5(i)]," ")}),UnionTypeDefinition:t4(function(e){var t=e.name,n=e.directives,r=e.types;return t6(["union",t,t6(n," "),r&&0!==r.length?"= "+t6(r," | "):""]," ")}),EnumTypeDefinition:t4(function(e){var t=e.name,n=e.directives,r=e.values;return t6(["enum",t,t6(n," "),t5(r)]," ")}),EnumValueDefinition:t4(function(e){var t;return t6([e.name,t6(e.directives," ")]," ")}),InputObjectTypeDefinition:t4(function(e){var t=e.name,n=e.directives,r=e.fields;return t6(["input",t,t6(n," "),t5(r)]," ")}),DirectiveDefinition:t4(function(e){var t=e.name,n=e.arguments,r=e.repeatable,i=e.locations;return"directive @"+t+(ne(n)?t8("(\n",t9(t6(n,"\n")),"\n)"):t8("(",t6(n,", "),")"))+(r?" repeatable":"")+" on "+t6(i," | ")}),SchemaExtension:function(e){var t=e.directives,n=e.operationTypes;return t6(["extend schema",t6(t," "),t5(n)]," ")},ScalarTypeExtension:function(e){var t;return t6(["extend scalar",e.name,t6(e.directives," ")]," ")},ObjectTypeExtension:function(e){var t=e.name,n=e.interfaces,r=e.directives,i=e.fields;return t6(["extend type",t,t8("implements ",t6(n," & ")),t6(r," "),t5(i)]," ")},InterfaceTypeExtension:function(e){var t=e.name,n=e.interfaces,r=e.directives,i=e.fields;return t6(["extend interface",t,t8("implements ",t6(n," & ")),t6(r," "),t5(i)]," ")},UnionTypeExtension:function(e){var t=e.name,n=e.directives,r=e.types;return t6(["extend union",t,t6(n," "),r&&0!==r.length?"= "+t6(r," | "):""]," ")},EnumTypeExtension:function(e){var t=e.name,n=e.directives,r=e.values;return t6(["extend enum",t,t6(n," "),t5(r)]," ")},InputObjectTypeExtension:function(e){var t=e.name,n=e.directives,r=e.fields;return t6(["extend input",t,t6(n," "),t5(r)]," ")}};function t4(e){return function(t){return t6([t.description,e(t)],"\n")}}function t6(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return null!==(t=null==e?void 0:e.filter(function(e){return e}).join(n))&&void 0!==t?t:""}function t5(e){return t8("{\n",t9(t6(e,"\n")),"\n}")}function t8(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return null!=t&&""!==t?e+t+n:""}function t9(e){return t8(" ",e.replace(/\n/g,"\n "))}function t7(e){return -1!==e.indexOf("\n")}function ne(e){return null!=e&&e.some(t7)}var nt,nn,nr,ni={http:{includeQuery:!0,includeExtensions:!1,preserveHeaderCase:!1},headers:{accept:"*/*","content-type":"application/json"},options:{method:"POST"}},na=function(e,t){return t(e)};function no(e,t){for(var n=[],r=2;rObject.create(null),{forEach:nv,slice:ny}=Array.prototype,{hasOwnProperty:nw}=Object.prototype;class n_{constructor(e=!0,t=ng){this.weakness=e,this.makeData=t}lookup(...e){return this.lookupArray(e)}lookupArray(e){let t=this;return nv.call(e,e=>t=t.getChildTrie(e)),nw.call(t,"data")?t.data:t.data=this.makeData(ny.call(e))}peek(...e){return this.peekArray(e)}peekArray(e){let t=this;for(let n=0,r=e.length;t&&n=0;--o)t.definitions[o].kind===nL.h.OPERATION_DEFINITION&&++a;var s=nN(e),u=e.some(function(e){return e.remove}),c=function(e){return u&&e&&e.some(s)},l=new Map,f=!1,d={enter:function(e){if(c(e.directives))return f=!0,null}},h=tl(t,{Field:d,InlineFragment:d,VariableDefinition:{enter:function(){return!1}},Variable:{enter:function(e,t,n,r,a){var o=i(a);o&&o.variables.add(e.name.value)}},FragmentSpread:{enter:function(e,t,n,r,a){if(c(e.directives))return f=!0,null;var o=i(a);o&&o.fragmentSpreads.add(e.name.value)}},FragmentDefinition:{enter:function(e,t,n,r){l.set(JSON.stringify(r),e)},leave:function(e,t,n,i){return e===l.get(JSON.stringify(i))?e:a>0&&e.selectionSet.selections.every(function(e){return e.kind===nL.h.FIELD&&"__typename"===e.name.value})?(r(e.name.value).removed=!0,f=!0,null):void 0}},Directive:{leave:function(e){if(s(e))return f=!0,null}}});if(!f)return t;var p=function(e){return e.transitiveVars||(e.transitiveVars=new Set(e.variables),e.removed||e.fragmentSpreads.forEach(function(t){p(r(t)).transitiveVars.forEach(function(t){e.transitiveVars.add(t)})})),e},b=new Set;h.definitions.forEach(function(e){e.kind===nL.h.OPERATION_DEFINITION?p(n(e.name&&e.name.value)).fragmentSpreads.forEach(function(e){b.add(e)}):e.kind!==nL.h.FRAGMENT_DEFINITION||0!==a||r(e.name.value).removed||b.add(e.name.value)}),b.forEach(function(e){p(r(e)).fragmentSpreads.forEach(function(e){b.add(e)})});var m=function(e){return!!(!b.has(e)||r(e).removed)},g={enter:function(e){if(m(e.name.value))return null}};return nD(tl(h,{FragmentSpread:g,FragmentDefinition:g,OperationDefinition:{leave:function(e){if(e.variableDefinitions){var t=p(n(e.name&&e.name.value)).transitiveVars;if(t.size0},t.prototype.tearDownQuery=function(){this.isTornDown||(this.concast&&this.observer&&(this.concast.removeObserver(this.observer),delete this.concast,delete this.observer),this.stopPolling(),this.subscriptions.forEach(function(e){return e.unsubscribe()}),this.subscriptions.clear(),this.queryManager.stopQuery(this.queryId),this.observers.clear(),this.isTornDown=!0)},t}(eT);function n4(e){var t=e.options,n=t.fetchPolicy,r=t.nextFetchPolicy;return"cache-and-network"===n||"network-only"===n?e.reobserve({fetchPolicy:"cache-first",nextFetchPolicy:function(){return(this.nextFetchPolicy=r,"function"==typeof r)?r.apply(this,arguments):n}}):e.reobserve()}function n6(e){__DEV__&&Q.kG.error("Unhandled error",e.message,e.stack)}function n5(e){__DEV__&&e&&__DEV__&&Q.kG.debug("Missing cache result fields: ".concat(JSON.stringify(e)),e)}function n8(e){return"network-only"===e||"no-cache"===e||"standby"===e}nK(n3);function n9(e){return e.kind===nL.h.FIELD||e.kind===nL.h.FRAGMENT_SPREAD||e.kind===nL.h.INLINE_FRAGMENT}function n7(e){return e.kind===Kind.SCALAR_TYPE_DEFINITION||e.kind===Kind.OBJECT_TYPE_DEFINITION||e.kind===Kind.INTERFACE_TYPE_DEFINITION||e.kind===Kind.UNION_TYPE_DEFINITION||e.kind===Kind.ENUM_TYPE_DEFINITION||e.kind===Kind.INPUT_OBJECT_TYPE_DEFINITION}function re(e){return e.kind===Kind.SCALAR_TYPE_EXTENSION||e.kind===Kind.OBJECT_TYPE_EXTENSION||e.kind===Kind.INTERFACE_TYPE_EXTENSION||e.kind===Kind.UNION_TYPE_EXTENSION||e.kind===Kind.ENUM_TYPE_EXTENSION||e.kind===Kind.INPUT_OBJECT_TYPE_EXTENSION}var rt=function(){return Object.create(null)},rn=Array.prototype,rr=rn.forEach,ri=rn.slice,ra=function(){function e(e,t){void 0===e&&(e=!0),void 0===t&&(t=rt),this.weakness=e,this.makeData=t}return e.prototype.lookup=function(){for(var e=[],t=0;tclass{constructor(){this.id=["slot",rc++,Date.now(),Math.random().toString(36).slice(2),].join(":")}hasValue(){for(let e=rs;e;e=e.parent)if(this.id in e.slots){let t=e.slots[this.id];if(t===ru)break;return e!==rs&&(rs.slots[this.id]=t),!0}return rs&&(rs.slots[this.id]=ru),!1}getValue(){if(this.hasValue())return rs.slots[this.id]}withValue(e,t,n,r){let i={__proto__:null,[this.id]:e},a=rs;rs={parent:a,slots:i};try{return t.apply(r,n)}finally{rs=a}}static bind(e){let t=rs;return function(){let n=rs;try{return rs=t,e.apply(this,arguments)}finally{rs=n}}}static noContext(e,t,n){if(!rs)return e.apply(n,t);{let r=rs;try{return rs=null,e.apply(n,t)}finally{rs=r}}}};function rf(e){try{return e()}catch(t){}}let rd="@wry/context:Slot",rh=rf(()=>globalThis)||rf(()=>global)||Object.create(null),rp=rh,rb=rp[rd]||Array[rd]||function(e){try{Object.defineProperty(rp,rd,{value:e,enumerable:!1,writable:!1,configurable:!0})}finally{return e}}(rl()),{bind:rm,noContext:rg}=rb;function rv(){}var ry=function(){function e(e,t){void 0===e&&(e=1/0),void 0===t&&(t=rv),this.max=e,this.dispose=t,this.map=new Map,this.newest=null,this.oldest=null}return e.prototype.has=function(e){return this.map.has(e)},e.prototype.get=function(e){var t=this.getNode(e);return t&&t.value},e.prototype.getNode=function(e){var t=this.map.get(e);if(t&&t!==this.newest){var n=t.older,r=t.newer;r&&(r.older=n),n&&(n.newer=r),t.older=this.newest,t.older.newer=t,t.newer=null,this.newest=t,t===this.oldest&&(this.oldest=r)}return t},e.prototype.set=function(e,t){var n=this.getNode(e);return n?n.value=t:(n={key:e,value:t,newer:null,older:this.newest},this.newest&&(this.newest.newer=n),this.newest=n,this.oldest=this.oldest||n,this.map.set(e,n),n.value)},e.prototype.clean=function(){for(;this.oldest&&this.map.size>this.max;)this.delete(this.oldest.key)},e.prototype.delete=function(e){var t=this.map.get(e);return!!t&&(t===this.newest&&(this.newest=t.older),t===this.oldest&&(this.oldest=t.newer),t.newer&&(t.newer.older=t.older),t.older&&(t.older.newer=t.newer),this.map.delete(e),this.dispose(t.value,e),!0)},e}(),rw=new rb,r_=Object.prototype.hasOwnProperty,rE=void 0===(n=Array.from)?function(e){var t=[];return e.forEach(function(e){return t.push(e)}),t}:n;function rS(e){var t=e.unsubscribe;"function"==typeof t&&(e.unsubscribe=void 0,t())}var rk=[],rx=100;function rT(e,t){if(!e)throw Error(t||"assertion failure")}function rM(e,t){var n=e.length;return n>0&&n===t.length&&e[n-1]===t[n-1]}function rO(e){switch(e.length){case 0:throw Error("unknown value");case 1:return e[0];case 2:throw e[1]}}function rA(e){return e.slice(0)}var rL=function(){function e(t){this.fn=t,this.parents=new Set,this.childValues=new Map,this.dirtyChildren=null,this.dirty=!0,this.recomputing=!1,this.value=[],this.deps=null,++e.count}return e.prototype.peek=function(){if(1===this.value.length&&!rN(this))return rC(this),this.value[0]},e.prototype.recompute=function(e){return rT(!this.recomputing,"already recomputing"),rC(this),rN(this)?rI(this,e):rO(this.value)},e.prototype.setDirty=function(){this.dirty||(this.dirty=!0,this.value.length=0,rR(this),rS(this))},e.prototype.dispose=function(){var e=this;this.setDirty(),rH(this),rF(this,function(t,n){t.setDirty(),r$(t,e)})},e.prototype.forget=function(){this.dispose()},e.prototype.dependOn=function(e){e.add(this),this.deps||(this.deps=rk.pop()||new Set),this.deps.add(e)},e.prototype.forgetDeps=function(){var e=this;this.deps&&(rE(this.deps).forEach(function(t){return t.delete(e)}),this.deps.clear(),rk.push(this.deps),this.deps=null)},e.count=0,e}();function rC(e){var t=rw.getValue();if(t)return e.parents.add(t),t.childValues.has(e)||t.childValues.set(e,[]),rN(e)?rY(t,e):rB(t,e),t}function rI(e,t){return rH(e),rw.withValue(e,rD,[e,t]),rz(e,t)&&rP(e),rO(e.value)}function rD(e,t){e.recomputing=!0,e.value.length=0;try{e.value[0]=e.fn.apply(null,t)}catch(n){e.value[1]=n}e.recomputing=!1}function rN(e){return e.dirty||!!(e.dirtyChildren&&e.dirtyChildren.size)}function rP(e){e.dirty=!1,!rN(e)&&rj(e)}function rR(e){rF(e,rY)}function rj(e){rF(e,rB)}function rF(e,t){var n=e.parents.size;if(n)for(var r=rE(e.parents),i=0;i0&&e.childValues.forEach(function(t,n){r$(e,n)}),e.forgetDeps(),rT(null===e.dirtyChildren)}function r$(e,t){t.parents.delete(e),e.childValues.delete(t),rU(e,t)}function rz(e,t){if("function"==typeof e.subscribe)try{rS(e),e.unsubscribe=e.subscribe.apply(null,t)}catch(n){return e.setDirty(),!1}return!0}var rG={setDirty:!0,dispose:!0,forget:!0};function rW(e){var t=new Map,n=e&&e.subscribe;function r(e){var r=rw.getValue();if(r){var i=t.get(e);i||t.set(e,i=new Set),r.dependOn(i),"function"==typeof n&&(rS(i),i.unsubscribe=n(e))}}return r.dirty=function(e,n){var r=t.get(e);if(r){var i=n&&r_.call(rG,n)?n:"setDirty";rE(r).forEach(function(e){return e[i]()}),t.delete(e),rS(r)}},r}function rK(){var e=new ra("function"==typeof WeakMap);return function(){return e.lookupArray(arguments)}}var rV=rK(),rq=new Set;function rZ(e,t){void 0===t&&(t=Object.create(null));var n=new ry(t.max||65536,function(e){return e.dispose()}),r=t.keyArgs,i=t.makeCacheKey||rK(),a=function(){var a=i.apply(null,r?r.apply(null,arguments):arguments);if(void 0===a)return e.apply(null,arguments);var o=n.get(a);o||(n.set(a,o=new rL(e)),o.subscribe=t.subscribe,o.forget=function(){return n.delete(a)});var s=o.recompute(Array.prototype.slice.call(arguments));return n.set(a,o),rq.add(n),rw.hasValue()||(rq.forEach(function(e){return e.clean()}),rq.clear()),s};function o(e){var t=n.get(e);t&&t.setDirty()}function s(e){var t=n.get(e);if(t)return t.peek()}function u(e){return n.delete(e)}return Object.defineProperty(a,"size",{get:function(){return n.map.size},configurable:!1,enumerable:!1}),a.dirtyKey=o,a.dirty=function(){o(i.apply(null,arguments))},a.peekKey=s,a.peek=function(){return s(i.apply(null,arguments))},a.forgetKey=u,a.forget=function(){return u(i.apply(null,arguments))},a.makeCacheKey=i,a.getKey=r?function(){return i.apply(null,r.apply(null,arguments))}:i,Object.freeze(a)}var rX=new rb,rJ=new WeakMap;function rQ(e){var t=rJ.get(e);return t||rJ.set(e,t={vars:new Set,dep:rW()}),t}function r1(e){rQ(e).vars.forEach(function(t){return t.forgetCache(e)})}function r0(e){rQ(e).vars.forEach(function(t){return t.attachCache(e)})}function r2(e){var t=new Set,n=new Set,r=function(a){if(arguments.length>0){if(e!==a){e=a,t.forEach(function(e){rQ(e).dep.dirty(r),r3(e)});var o=Array.from(n);n.clear(),o.forEach(function(t){return t(e)})}}else{var s=rX.getValue();s&&(i(s),rQ(s).dep(r))}return e};r.onNextChange=function(e){return n.add(e),function(){n.delete(e)}};var i=r.attachCache=function(e){return t.add(e),rQ(e).vars.add(r),r};return r.forgetCache=function(e){return t.delete(e)},r}function r3(e){e.broadcastWatches&&e.broadcastWatches()}var r4=function(){function e(e){var t=e.cache,n=e.client,r=e.resolvers,i=e.fragmentMatcher;this.selectionsToResolveCache=new WeakMap,this.cache=t,n&&(this.client=n),r&&this.addResolvers(r),i&&this.setFragmentMatcher(i)}return e.prototype.addResolvers=function(e){var t=this;this.resolvers=this.resolvers||{},Array.isArray(e)?e.forEach(function(e){t.resolvers=tj(t.resolvers,e)}):this.resolvers=tj(this.resolvers,e)},e.prototype.setResolvers=function(e){this.resolvers={},this.addResolvers(e)},e.prototype.getResolvers=function(){return this.resolvers||{}},e.prototype.runResolvers=function(e){var t=e.document,n=e.remoteResult,r=e.context,i=e.variables,a=e.onlyRunForcedResolvers,o=void 0!==a&&a;return(0,en.mG)(this,void 0,void 0,function(){return(0,en.Jh)(this,function(e){return t?[2,this.resolveDocument(t,n.data,r,i,this.fragmentMatcher,o).then(function(e){return(0,en.pi)((0,en.pi)({},n),{data:e.result})})]:[2,n]})})},e.prototype.setFragmentMatcher=function(e){this.fragmentMatcher=e},e.prototype.getFragmentMatcher=function(){return this.fragmentMatcher},e.prototype.clientQuery=function(e){return tb(["client"],e)&&this.resolvers?e:null},e.prototype.serverQuery=function(e){return n$(e)},e.prototype.prepareContext=function(e){var t=this.cache;return(0,en.pi)((0,en.pi)({},e),{cache:t,getCacheKey:function(e){return t.identify(e)}})},e.prototype.addExportedVariables=function(e,t,n){return void 0===t&&(t={}),void 0===n&&(n={}),(0,en.mG)(this,void 0,void 0,function(){return(0,en.Jh)(this,function(r){return e?[2,this.resolveDocument(e,this.buildRootValueFromCache(e,t)||{},this.prepareContext(n),t).then(function(e){return(0,en.pi)((0,en.pi)({},t),e.exportedVariables)})]:[2,(0,en.pi)({},t)]})})},e.prototype.shouldForceResolvers=function(e){var t=!1;return tl(e,{Directive:{enter:function(e){if("client"===e.name.value&&e.arguments&&(t=e.arguments.some(function(e){return"always"===e.name.value&&"BooleanValue"===e.value.kind&&!0===e.value.value})))return tc}}}),t},e.prototype.buildRootValueFromCache=function(e,t){return this.cache.diff({query:nH(e),variables:t,returnPartialData:!0,optimistic:!1}).result},e.prototype.resolveDocument=function(e,t,n,r,i,a){return void 0===n&&(n={}),void 0===r&&(r={}),void 0===i&&(i=function(){return!0}),void 0===a&&(a=!1),(0,en.mG)(this,void 0,void 0,function(){var o,s,u,c,l,f,d,h,p,b,m;return(0,en.Jh)(this,function(g){return o=e8(e),s=e4(e),u=eL(s),c=this.collectSelectionsToResolve(o,u),f=(l=o.operation)?l.charAt(0).toUpperCase()+l.slice(1):"Query",d=this,h=d.cache,p=d.client,b={fragmentMap:u,context:(0,en.pi)((0,en.pi)({},n),{cache:h,client:p}),variables:r,fragmentMatcher:i,defaultOperationType:f,exportedVariables:{},selectionsToResolve:c,onlyRunForcedResolvers:a},m=!1,[2,this.resolveSelectionSet(o.selectionSet,m,t,b).then(function(e){return{result:e,exportedVariables:b.exportedVariables}})]})})},e.prototype.resolveSelectionSet=function(e,t,n,r){return(0,en.mG)(this,void 0,void 0,function(){var i,a,o,s,u,c=this;return(0,en.Jh)(this,function(l){return i=r.fragmentMap,a=r.context,o=r.variables,s=[n],u=function(e){return(0,en.mG)(c,void 0,void 0,function(){var u,c;return(0,en.Jh)(this,function(l){return(t||r.selectionsToResolve.has(e))&&td(e,o)?eQ(e)?[2,this.resolveField(e,t,n,r).then(function(t){var n;void 0!==t&&s.push(((n={})[eX(e)]=t,n))})]:(e1(e)?u=e:(u=i[e.name.value],__DEV__?(0,Q.kG)(u,"No fragment named ".concat(e.name.value)):(0,Q.kG)(u,11)),u&&u.typeCondition&&(c=u.typeCondition.name.value,r.fragmentMatcher(n,c,a)))?[2,this.resolveSelectionSet(u.selectionSet,t,n,r).then(function(e){s.push(e)})]:[2]:[2]})})},[2,Promise.all(e.selections.map(u)).then(function(){return tF(s)})]})})},e.prototype.resolveField=function(e,t,n,r){return(0,en.mG)(this,void 0,void 0,function(){var i,a,o,s,u,c,l,f,d,h=this;return(0,en.Jh)(this,function(p){return n?(i=r.variables,a=e.name.value,o=eX(e),s=a!==o,c=Promise.resolve(u=n[o]||n[a]),(!r.onlyRunForcedResolvers||this.shouldForceResolvers(e))&&(l=n.__typename||r.defaultOperationType,(f=this.resolvers&&this.resolvers[l])&&(d=f[s?a:o])&&(c=Promise.resolve(rX.withValue(this.cache,d,[n,eZ(e,i),r.context,{field:e,fragmentMap:r.fragmentMap},])))),[2,c.then(function(n){if(void 0===n&&(n=u),e.directives&&e.directives.forEach(function(e){"export"===e.name.value&&e.arguments&&e.arguments.forEach(function(e){"as"===e.name.value&&"StringValue"===e.value.kind&&(r.exportedVariables[e.value.value]=n)})}),!e.selectionSet||null==n)return n;var i,a,o=null!==(a=null===(i=e.directives)||void 0===i?void 0:i.some(function(e){return"client"===e.name.value}))&&void 0!==a&&a;return Array.isArray(n)?h.resolveSubSelectedArray(e,t||o,n,r):e.selectionSet?h.resolveSelectionSet(e.selectionSet,t||o,n,r):void 0})]):[2,null]})})},e.prototype.resolveSubSelectedArray=function(e,t,n,r){var i=this;return Promise.all(n.map(function(n){return null===n?null:Array.isArray(n)?i.resolveSubSelectedArray(e,t,n,r):e.selectionSet?i.resolveSelectionSet(e.selectionSet,t,n,r):void 0}))},e.prototype.collectSelectionsToResolve=function(e,t){var n=function(e){return!Array.isArray(e)},r=this.selectionsToResolveCache;function i(e){if(!r.has(e)){var a=new Set;r.set(e,a),tl(e,{Directive:function(e,t,r,i,o){"client"===e.name.value&&o.forEach(function(e){n(e)&&n9(e)&&a.add(e)})},FragmentSpread:function(e,r,o,s,u){var c=t[e.name.value];__DEV__?(0,Q.kG)(c,"No fragment named ".concat(e.name.value)):(0,Q.kG)(c,12);var l=i(c);l.size>0&&(u.forEach(function(e){n(e)&&n9(e)&&a.add(e)}),a.add(e),l.forEach(function(e){a.add(e)}))}})}return r.get(e)}return i(e)},e}(),r6=new(t_.mr?WeakMap:Map);function r5(e,t){var n=e[t];"function"==typeof n&&(e[t]=function(){return r6.set(e,(r6.get(e)+1)%1e15),n.apply(this,arguments)})}function r8(e){e.notifyTimeout&&(clearTimeout(e.notifyTimeout),e.notifyTimeout=void 0)}var r9=function(){function e(e,t){void 0===t&&(t=e.generateQueryId()),this.queryId=t,this.listeners=new Set,this.document=null,this.lastRequestId=1,this.subscriptions=new Set,this.stopped=!1,this.dirty=!1,this.observableQuery=null;var n=this.cache=e.cache;r6.has(n)||(r6.set(n,0),r5(n,"evict"),r5(n,"modify"),r5(n,"reset"))}return e.prototype.init=function(e){var t=e.networkStatus||nZ.I.loading;return this.variables&&this.networkStatus!==nZ.I.loading&&!(0,nm.D)(this.variables,e.variables)&&(t=nZ.I.setVariables),(0,nm.D)(e.variables,this.variables)||(this.lastDiff=void 0),Object.assign(this,{document:e.document,variables:e.variables,networkError:null,graphQLErrors:this.graphQLErrors||[],networkStatus:t}),e.observableQuery&&this.setObservableQuery(e.observableQuery),e.lastRequestId&&(this.lastRequestId=e.lastRequestId),this},e.prototype.reset=function(){r8(this),this.dirty=!1},e.prototype.getDiff=function(e){void 0===e&&(e=this.variables);var t=this.getDiffOptions(e);if(this.lastDiff&&(0,nm.D)(t,this.lastDiff.options))return this.lastDiff.diff;this.updateWatch(this.variables=e);var n=this.observableQuery;if(n&&"no-cache"===n.options.fetchPolicy)return{complete:!1};var r=this.cache.diff(t);return this.updateLastDiff(r,t),r},e.prototype.updateLastDiff=function(e,t){this.lastDiff=e?{diff:e,options:t||this.getDiffOptions()}:void 0},e.prototype.getDiffOptions=function(e){var t;return void 0===e&&(e=this.variables),{query:this.document,variables:e,returnPartialData:!0,optimistic:!0,canonizeResults:null===(t=this.observableQuery)||void 0===t?void 0:t.options.canonizeResults}},e.prototype.setDiff=function(e){var t=this,n=this.lastDiff&&this.lastDiff.diff;this.updateLastDiff(e),this.dirty||(0,nm.D)(n&&n.result,e&&e.result)||(this.dirty=!0,this.notifyTimeout||(this.notifyTimeout=setTimeout(function(){return t.notify()},0)))},e.prototype.setObservableQuery=function(e){var t=this;e!==this.observableQuery&&(this.oqListener&&this.listeners.delete(this.oqListener),this.observableQuery=e,e?(e.queryInfo=this,this.listeners.add(this.oqListener=function(){t.getDiff().fromOptimisticTransaction?e.observe():n4(e)})):delete this.oqListener)},e.prototype.notify=function(){var e=this;r8(this),this.shouldNotify()&&this.listeners.forEach(function(t){return t(e)}),this.dirty=!1},e.prototype.shouldNotify=function(){if(!this.dirty||!this.listeners.size)return!1;if((0,nZ.O)(this.networkStatus)&&this.observableQuery){var e=this.observableQuery.options.fetchPolicy;if("cache-only"!==e&&"cache-and-network"!==e)return!1}return!0},e.prototype.stop=function(){if(!this.stopped){this.stopped=!0,this.reset(),this.cancel(),this.cancel=e.prototype.cancel,this.subscriptions.forEach(function(e){return e.unsubscribe()});var t=this.observableQuery;t&&t.stopPolling()}},e.prototype.cancel=function(){},e.prototype.updateWatch=function(e){var t=this;void 0===e&&(e=this.variables);var n=this.observableQuery;if(!n||"no-cache"!==n.options.fetchPolicy){var r=(0,en.pi)((0,en.pi)({},this.getDiffOptions(e)),{watcher:this,callback:function(e){return t.setDiff(e)}});this.lastWatch&&(0,nm.D)(r,this.lastWatch)||(this.cancel(),this.cancel=this.cache.watch(this.lastWatch=r))}},e.prototype.resetLastWrite=function(){this.lastWrite=void 0},e.prototype.shouldWrite=function(e,t){var n=this.lastWrite;return!(n&&n.dmCount===r6.get(this.cache)&&(0,nm.D)(t,n.variables)&&(0,nm.D)(e.data,n.result.data))},e.prototype.markResult=function(e,t,n,r){var i=this,a=new tB,o=(0,tP.O)(e.errors)?e.errors.slice(0):[];if(this.reset(),"incremental"in e&&(0,tP.O)(e.incremental)){var s=tG(this.getDiff().result,e);e.data=s}else if("hasNext"in e&&e.hasNext){var u=this.getDiff();e.data=a.merge(u.result,e.data)}this.graphQLErrors=o,"no-cache"===n.fetchPolicy?this.updateLastDiff({result:e.data,complete:!0},this.getDiffOptions(n.variables)):0!==r&&(r7(e,n.errorPolicy)?this.cache.performTransaction(function(a){if(i.shouldWrite(e,n.variables))a.writeQuery({query:t,data:e.data,variables:n.variables,overwrite:1===r}),i.lastWrite={result:e,variables:n.variables,dmCount:r6.get(i.cache)};else if(i.lastDiff&&i.lastDiff.diff.complete){e.data=i.lastDiff.diff.result;return}var o=i.getDiffOptions(n.variables),s=a.diff(o);i.stopped||i.updateWatch(n.variables),i.updateLastDiff(s,o),s.complete&&(e.data=s.result)}):this.lastWrite=void 0)},e.prototype.markReady=function(){return this.networkError=null,this.networkStatus=nZ.I.ready},e.prototype.markError=function(e){return this.networkStatus=nZ.I.error,this.lastWrite=void 0,this.reset(),e.graphQLErrors&&(this.graphQLErrors=e.graphQLErrors),e.networkError&&(this.networkError=e.networkError),e},e}();function r7(e,t){void 0===t&&(t="none");var n="ignore"===t||"all"===t,r=!nO(e);return!r&&n&&e.data&&(r=!0),r}var ie=Object.prototype.hasOwnProperty,it=function(){function e(e){var t=e.cache,n=e.link,r=e.defaultOptions,i=e.queryDeduplication,a=void 0!==i&&i,o=e.onBroadcast,s=e.ssrMode,u=void 0!==s&&s,c=e.clientAwareness,l=void 0===c?{}:c,f=e.localState,d=e.assumeImmutableResults;this.clientAwareness={},this.queries=new Map,this.fetchCancelFns=new Map,this.transformCache=new(t_.mr?WeakMap:Map),this.queryIdCounter=1,this.requestIdCounter=1,this.mutationIdCounter=1,this.inFlightLinkObservables=new Map,this.cache=t,this.link=n,this.defaultOptions=r||Object.create(null),this.queryDeduplication=a,this.clientAwareness=l,this.localState=f||new r4({cache:t}),this.ssrMode=u,this.assumeImmutableResults=!!d,(this.onBroadcast=o)&&(this.mutationStore=Object.create(null))}return e.prototype.stop=function(){var e=this;this.queries.forEach(function(t,n){e.stopQueryNoBroadcast(n)}),this.cancelPendingFetches(__DEV__?new Q.ej("QueryManager stopped while query was in flight"):new Q.ej(14))},e.prototype.cancelPendingFetches=function(e){this.fetchCancelFns.forEach(function(t){return t(e)}),this.fetchCancelFns.clear()},e.prototype.mutate=function(e){var t,n,r=e.mutation,i=e.variables,a=e.optimisticResponse,o=e.updateQueries,s=e.refetchQueries,u=void 0===s?[]:s,c=e.awaitRefetchQueries,l=void 0!==c&&c,f=e.update,d=e.onQueryUpdated,h=e.fetchPolicy,p=void 0===h?(null===(t=this.defaultOptions.mutate)||void 0===t?void 0:t.fetchPolicy)||"network-only":h,b=e.errorPolicy,m=void 0===b?(null===(n=this.defaultOptions.mutate)||void 0===n?void 0:n.errorPolicy)||"none":b,g=e.keepRootFields,v=e.context;return(0,en.mG)(this,void 0,void 0,function(){var e,t,n,s,c,h;return(0,en.Jh)(this,function(b){switch(b.label){case 0:if(__DEV__?(0,Q.kG)(r,"mutation option is required. You must specify your GraphQL document in the mutation option."):(0,Q.kG)(r,15),__DEV__?(0,Q.kG)("network-only"===p||"no-cache"===p,"Mutations support only 'network-only' or 'no-cache' fetchPolicy strings. The default `network-only` behavior automatically writes mutation results to the cache. Passing `no-cache` skips the cache write."):(0,Q.kG)("network-only"===p||"no-cache"===p,16),e=this.generateMutationId(),n=(t=this.transform(r)).document,s=t.hasClientExports,r=this.cache.transformForLink(n),i=this.getVariables(r,i),!s)return[3,2];return[4,this.localState.addExportedVariables(r,i,v)];case 1:i=b.sent(),b.label=2;case 2:return c=this.mutationStore&&(this.mutationStore[e]={mutation:r,variables:i,loading:!0,error:null}),a&&this.markMutationOptimistic(a,{mutationId:e,document:r,variables:i,fetchPolicy:p,errorPolicy:m,context:v,updateQueries:o,update:f,keepRootFields:g}),this.broadcastQueries(),h=this,[2,new Promise(function(t,n){return nM(h.getObservableFromLink(r,(0,en.pi)((0,en.pi)({},v),{optimisticResponse:a}),i,!1),function(t){if(nO(t)&&"none"===m)throw new tN.cA({graphQLErrors:nA(t)});c&&(c.loading=!1,c.error=null);var n=(0,en.pi)({},t);return"function"==typeof u&&(u=u(n)),"ignore"===m&&nO(n)&&delete n.errors,h.markMutationResult({mutationId:e,result:n,document:r,variables:i,fetchPolicy:p,errorPolicy:m,context:v,update:f,updateQueries:o,awaitRefetchQueries:l,refetchQueries:u,removeOptimistic:a?e:void 0,onQueryUpdated:d,keepRootFields:g})}).subscribe({next:function(e){h.broadcastQueries(),"hasNext"in e&&!1!==e.hasNext||t(e)},error:function(t){c&&(c.loading=!1,c.error=t),a&&h.cache.removeOptimistic(e),h.broadcastQueries(),n(t instanceof tN.cA?t:new tN.cA({networkError:t}))}})})]}})})},e.prototype.markMutationResult=function(e,t){var n=this;void 0===t&&(t=this.cache);var r=e.result,i=[],a="no-cache"===e.fetchPolicy;if(!a&&r7(r,e.errorPolicy)){if(tU(r)||i.push({result:r.data,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}),tU(r)&&(0,tP.O)(r.incremental)){var o=t.diff({id:"ROOT_MUTATION",query:this.transform(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0}),s=void 0;o.result&&(s=tG(o.result,r)),void 0!==s&&(r.data=s,i.push({result:s,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}))}var u=e.updateQueries;u&&this.queries.forEach(function(e,a){var o=e.observableQuery,s=o&&o.queryName;if(s&&ie.call(u,s)){var c,l=u[s],f=n.queries.get(a),d=f.document,h=f.variables,p=t.diff({query:d,variables:h,returnPartialData:!0,optimistic:!1}),b=p.result;if(p.complete&&b){var m=l(b,{mutationResult:r,queryName:d&&e3(d)||void 0,queryVariables:h});m&&i.push({result:m,dataId:"ROOT_QUERY",query:d,variables:h})}}})}if(i.length>0||e.refetchQueries||e.update||e.onQueryUpdated||e.removeOptimistic){var c=[];if(this.refetchQueries({updateCache:function(t){a||i.forEach(function(e){return t.write(e)});var o=e.update,s=!t$(r)||tU(r)&&!r.hasNext;if(o){if(!a){var u=t.diff({id:"ROOT_MUTATION",query:n.transform(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0});u.complete&&("incremental"in(r=(0,en.pi)((0,en.pi)({},r),{data:u.result}))&&delete r.incremental,"hasNext"in r&&delete r.hasNext)}s&&o(t,r,{context:e.context,variables:e.variables})}a||e.keepRootFields||!s||t.modify({id:"ROOT_MUTATION",fields:function(e,t){var n=t.fieldName,r=t.DELETE;return"__typename"===n?e:r}})},include:e.refetchQueries,optimistic:!1,removeOptimistic:e.removeOptimistic,onQueryUpdated:e.onQueryUpdated||null}).forEach(function(e){return c.push(e)}),e.awaitRefetchQueries||e.onQueryUpdated)return Promise.all(c).then(function(){return r})}return Promise.resolve(r)},e.prototype.markMutationOptimistic=function(e,t){var n=this,r="function"==typeof e?e(t.variables):e;return this.cache.recordOptimisticTransaction(function(e){try{n.markMutationResult((0,en.pi)((0,en.pi)({},t),{result:{data:r}}),e)}catch(i){__DEV__&&Q.kG.error(i)}},t.mutationId)},e.prototype.fetchQuery=function(e,t,n){return this.fetchQueryObservable(e,t,n).promise},e.prototype.getQueryStore=function(){var e=Object.create(null);return this.queries.forEach(function(t,n){e[n]={variables:t.variables,networkStatus:t.networkStatus,networkError:t.networkError,graphQLErrors:t.graphQLErrors}}),e},e.prototype.resetErrors=function(e){var t=this.queries.get(e);t&&(t.networkError=void 0,t.graphQLErrors=[])},e.prototype.transform=function(e){var t=this.transformCache;if(!t.has(e)){var n=this.cache.transformDocument(e),r=nY(n),i=this.localState.clientQuery(n),a=r&&this.localState.serverQuery(r),o={document:n,hasClientExports:tm(n),hasForcedResolvers:this.localState.shouldForceResolvers(n),clientQuery:i,serverQuery:a,defaultVars:e9(e2(n)),asQuery:(0,en.pi)((0,en.pi)({},n),{definitions:n.definitions.map(function(e){return"OperationDefinition"===e.kind&&"query"!==e.operation?(0,en.pi)((0,en.pi)({},e),{operation:"query"}):e})})},s=function(e){e&&!t.has(e)&&t.set(e,o)};s(e),s(n),s(i),s(a)}return t.get(e)},e.prototype.getVariables=function(e,t){return(0,en.pi)((0,en.pi)({},this.transform(e).defaultVars),t)},e.prototype.watchQuery=function(e){void 0===(e=(0,en.pi)((0,en.pi)({},e),{variables:this.getVariables(e.query,e.variables)})).notifyOnNetworkStatusChange&&(e.notifyOnNetworkStatusChange=!1);var t=new r9(this),n=new n3({queryManager:this,queryInfo:t,options:e});return this.queries.set(n.queryId,t),t.init({document:n.query,observableQuery:n,variables:n.variables}),n},e.prototype.query=function(e,t){var n=this;return void 0===t&&(t=this.generateQueryId()),__DEV__?(0,Q.kG)(e.query,"query option is required. You must specify your GraphQL document in the query option."):(0,Q.kG)(e.query,17),__DEV__?(0,Q.kG)("Document"===e.query.kind,'You must wrap the query string in a "gql" tag.'):(0,Q.kG)("Document"===e.query.kind,18),__DEV__?(0,Q.kG)(!e.returnPartialData,"returnPartialData option only supported on watchQuery."):(0,Q.kG)(!e.returnPartialData,19),__DEV__?(0,Q.kG)(!e.pollInterval,"pollInterval option only supported on watchQuery."):(0,Q.kG)(!e.pollInterval,20),this.fetchQuery(t,e).finally(function(){return n.stopQuery(t)})},e.prototype.generateQueryId=function(){return String(this.queryIdCounter++)},e.prototype.generateRequestId=function(){return this.requestIdCounter++},e.prototype.generateMutationId=function(){return String(this.mutationIdCounter++)},e.prototype.stopQueryInStore=function(e){this.stopQueryInStoreNoBroadcast(e),this.broadcastQueries()},e.prototype.stopQueryInStoreNoBroadcast=function(e){var t=this.queries.get(e);t&&t.stop()},e.prototype.clearStore=function(e){return void 0===e&&(e={discardWatches:!0}),this.cancelPendingFetches(__DEV__?new Q.ej("Store reset while query was in flight (not completed in link chain)"):new Q.ej(21)),this.queries.forEach(function(e){e.observableQuery?e.networkStatus=nZ.I.loading:e.stop()}),this.mutationStore&&(this.mutationStore=Object.create(null)),this.cache.reset(e)},e.prototype.getObservableQueries=function(e){var t=this;void 0===e&&(e="active");var n=new Map,r=new Map,i=new Set;return Array.isArray(e)&&e.forEach(function(e){"string"==typeof e?r.set(e,!1):eN(e)?r.set(t.transform(e).document,!1):(0,eO.s)(e)&&e.query&&i.add(e)}),this.queries.forEach(function(t,i){var a=t.observableQuery,o=t.document;if(a){if("all"===e){n.set(i,a);return}var s=a.queryName;if("standby"===a.options.fetchPolicy||"active"===e&&!a.hasObservers())return;("active"===e||s&&r.has(s)||o&&r.has(o))&&(n.set(i,a),s&&r.set(s,!0),o&&r.set(o,!0))}}),i.size&&i.forEach(function(e){var r=nG("legacyOneTimeQuery"),i=t.getQuery(r).init({document:e.query,variables:e.variables}),a=new n3({queryManager:t,queryInfo:i,options:(0,en.pi)((0,en.pi)({},e),{fetchPolicy:"network-only"})});(0,Q.kG)(a.queryId===r),i.setObservableQuery(a),n.set(r,a)}),__DEV__&&r.size&&r.forEach(function(e,t){!e&&__DEV__&&Q.kG.warn("Unknown query ".concat("string"==typeof t?"named ":"").concat(JSON.stringify(t,null,2)," requested in refetchQueries options.include array"))}),n},e.prototype.reFetchObservableQueries=function(e){var t=this;void 0===e&&(e=!1);var n=[];return this.getObservableQueries(e?"all":"active").forEach(function(r,i){var a=r.options.fetchPolicy;r.resetLastResults(),(e||"standby"!==a&&"cache-only"!==a)&&n.push(r.refetch()),t.getQuery(i).setDiff(null)}),this.broadcastQueries(),Promise.all(n)},e.prototype.setObservableQuery=function(e){this.getQuery(e.queryId).setObservableQuery(e)},e.prototype.startGraphQLSubscription=function(e){var t=this,n=e.query,r=e.fetchPolicy,i=e.errorPolicy,a=e.variables,o=e.context,s=void 0===o?{}:o;n=this.transform(n).document,a=this.getVariables(n,a);var u=function(e){return t.getObservableFromLink(n,s,e).map(function(a){"no-cache"!==r&&(r7(a,i)&&t.cache.write({query:n,result:a.data,dataId:"ROOT_SUBSCRIPTION",variables:e}),t.broadcastQueries());var o=nO(a),s=(0,tN.ls)(a);if(o||s){var u={};throw o&&(u.graphQLErrors=a.errors),s&&(u.protocolErrors=a.extensions[tN.YG]),new tN.cA(u)}return a})};if(this.transform(n).hasClientExports){var c=this.localState.addExportedVariables(n,a,s).then(u);return new eT(function(e){var t=null;return c.then(function(n){return t=n.subscribe(e)},e.error),function(){return t&&t.unsubscribe()}})}return u(a)},e.prototype.stopQuery=function(e){this.stopQueryNoBroadcast(e),this.broadcastQueries()},e.prototype.stopQueryNoBroadcast=function(e){this.stopQueryInStoreNoBroadcast(e),this.removeQuery(e)},e.prototype.removeQuery=function(e){this.fetchCancelFns.delete(e),this.queries.has(e)&&(this.getQuery(e).stop(),this.queries.delete(e))},e.prototype.broadcastQueries=function(){this.onBroadcast&&this.onBroadcast(),this.queries.forEach(function(e){return e.notify()})},e.prototype.getLocalState=function(){return this.localState},e.prototype.getObservableFromLink=function(e,t,n,r){var i,a,o=this;void 0===r&&(r=null!==(i=null==t?void 0:t.queryDeduplication)&&void 0!==i?i:this.queryDeduplication);var s=this.transform(e).serverQuery;if(s){var u=this,c=u.inFlightLinkObservables,l=u.link,f={query:s,variables:n,operationName:e3(s)||void 0,context:this.prepareContext((0,en.pi)((0,en.pi)({},t),{forceFetch:!r}))};if(t=f.context,r){var d=c.get(s)||new Map;c.set(s,d);var h=nx(n);if(!(a=d.get(h))){var p=new nq([np(l,f)]);d.set(h,a=p),p.beforeNext(function(){d.delete(h)&&d.size<1&&c.delete(s)})}}else a=new nq([np(l,f)])}else a=new nq([eT.of({data:{}})]),t=this.prepareContext(t);var b=this.transform(e).clientQuery;return b&&(a=nM(a,function(e){return o.localState.runResolvers({document:b,remoteResult:e,context:t,variables:n})})),a},e.prototype.getResultsFromLink=function(e,t,n){var r=e.lastRequestId=this.generateRequestId(),i=this.cache.transformForLink(this.transform(e.document).document);return nM(this.getObservableFromLink(i,n.context,n.variables),function(a){var o=nA(a),s=o.length>0;if(r>=e.lastRequestId){if(s&&"none"===n.errorPolicy)throw e.markError(new tN.cA({graphQLErrors:o}));e.markResult(a,i,n,t),e.markReady()}var u={data:a.data,loading:!1,networkStatus:nZ.I.ready};return s&&"ignore"!==n.errorPolicy&&(u.errors=o,u.networkStatus=nZ.I.error),u},function(t){var n=(0,tN.MS)(t)?t:new tN.cA({networkError:t});throw r>=e.lastRequestId&&e.markError(n),n})},e.prototype.fetchQueryObservable=function(e,t,n){return this.fetchConcastWithInfo(e,t,n).concast},e.prototype.fetchConcastWithInfo=function(e,t,n){var r,i,a=this;void 0===n&&(n=nZ.I.loading);var o=this.transform(t.query).document,s=this.getVariables(o,t.variables),u=this.getQuery(e),c=this.defaultOptions.watchQuery,l=t.fetchPolicy,f=void 0===l?c&&c.fetchPolicy||"cache-first":l,d=t.errorPolicy,h=void 0===d?c&&c.errorPolicy||"none":d,p=t.returnPartialData,b=void 0!==p&&p,m=t.notifyOnNetworkStatusChange,g=void 0!==m&&m,v=t.context,y=void 0===v?{}:v,w=Object.assign({},t,{query:o,variables:s,fetchPolicy:f,errorPolicy:h,returnPartialData:b,notifyOnNetworkStatusChange:g,context:y}),_=function(e){w.variables=e;var r=a.fetchQueryByPolicy(u,w,n);return"standby"!==w.fetchPolicy&&r.sources.length>0&&u.observableQuery&&u.observableQuery.applyNextFetchPolicy("after-fetch",t),r},E=function(){return a.fetchCancelFns.delete(e)};if(this.fetchCancelFns.set(e,function(e){E(),setTimeout(function(){return r.cancel(e)})}),this.transform(w.query).hasClientExports)r=new nq(this.localState.addExportedVariables(w.query,w.variables,w.context).then(_).then(function(e){return e.sources})),i=!0;else{var S=_(w.variables);i=S.fromLink,r=new nq(S.sources)}return r.promise.then(E,E),{concast:r,fromLink:i}},e.prototype.refetchQueries=function(e){var t=this,n=e.updateCache,r=e.include,i=e.optimistic,a=void 0!==i&&i,o=e.removeOptimistic,s=void 0===o?a?nG("refetchQueries"):void 0:o,u=e.onQueryUpdated,c=new Map;r&&this.getObservableQueries(r).forEach(function(e,n){c.set(n,{oq:e,lastDiff:t.getQuery(n).getDiff()})});var l=new Map;return n&&this.cache.batch({update:n,optimistic:a&&s||!1,removeOptimistic:s,onWatchUpdated:function(e,t,n){var r=e.watcher instanceof r9&&e.watcher.observableQuery;if(r){if(u){c.delete(r.queryId);var i=u(r,t,n);return!0===i&&(i=r.refetch()),!1!==i&&l.set(r,i),i}null!==u&&c.set(r.queryId,{oq:r,lastDiff:n,diff:t})}}}),c.size&&c.forEach(function(e,n){var r,i=e.oq,a=e.lastDiff,o=e.diff;if(u){if(!o){var s=i.queryInfo;s.reset(),o=s.getDiff()}r=u(i,o,a)}u&&!0!==r||(r=i.refetch()),!1!==r&&l.set(i,r),n.indexOf("legacyOneTimeQuery")>=0&&t.stopQueryNoBroadcast(n)}),s&&this.cache.removeOptimistic(s),l},e.prototype.fetchQueryByPolicy=function(e,t,n){var r=this,i=t.query,a=t.variables,o=t.fetchPolicy,s=t.refetchWritePolicy,u=t.errorPolicy,c=t.returnPartialData,l=t.context,f=t.notifyOnNetworkStatusChange,d=e.networkStatus;e.init({document:this.transform(i).document,variables:a,networkStatus:n});var h=function(){return e.getDiff(a)},p=function(t,n){void 0===n&&(n=e.networkStatus||nZ.I.loading);var o=t.result;!__DEV__||c||(0,nm.D)(o,{})||n5(t.missing);var s=function(e){return eT.of((0,en.pi)({data:e,loading:(0,nZ.O)(n),networkStatus:n},t.complete?null:{partial:!0}))};return o&&r.transform(i).hasForcedResolvers?r.localState.runResolvers({document:i,remoteResult:{data:o},context:l,variables:a,onlyRunForcedResolvers:!0}).then(function(e){return s(e.data||void 0)}):"none"===u&&n===nZ.I.refetch&&Array.isArray(t.missing)?s(void 0):s(o)},b="no-cache"===o?0:n===nZ.I.refetch&&"merge"!==s?1:2,m=function(){return r.getResultsFromLink(e,b,{variables:a,context:l,fetchPolicy:o,errorPolicy:u})},g=f&&"number"==typeof d&&d!==n&&(0,nZ.O)(n);switch(o){default:case"cache-first":var v=h();if(v.complete)return{fromLink:!1,sources:[p(v,e.markReady())]};if(c||g)return{fromLink:!0,sources:[p(v),m()]};return{fromLink:!0,sources:[m()]};case"cache-and-network":var v=h();if(v.complete||c||g)return{fromLink:!0,sources:[p(v),m()]};return{fromLink:!0,sources:[m()]};case"cache-only":return{fromLink:!1,sources:[p(h(),e.markReady())]};case"network-only":if(g)return{fromLink:!0,sources:[p(h()),m()]};return{fromLink:!0,sources:[m()]};case"no-cache":if(g)return{fromLink:!0,sources:[p(e.getDiff()),m(),]};return{fromLink:!0,sources:[m()]};case"standby":return{fromLink:!1,sources:[]}}},e.prototype.getQuery=function(e){return e&&!this.queries.has(e)&&this.queries.set(e,new r9(this,e)),this.queries.get(e)},e.prototype.prepareContext=function(e){void 0===e&&(e={});var t=this.localState.prepareContext(e);return(0,en.pi)((0,en.pi)({},t),{clientAwareness:this.clientAwareness})},e}(),ir=__webpack_require__(14012),ii=!1,ia=function(){function e(e){var t=this;this.resetStoreCallbacks=[],this.clearStoreCallbacks=[];var n=e.uri,r=e.credentials,i=e.headers,a=e.cache,o=e.ssrMode,s=void 0!==o&&o,u=e.ssrForceFetchDelay,c=void 0===u?0:u,l=e.connectToDevTools,f=void 0===l?"object"==typeof window&&!window.__APOLLO_CLIENT__&&__DEV__:l,d=e.queryDeduplication,h=void 0===d||d,p=e.defaultOptions,b=e.assumeImmutableResults,m=void 0!==b&&b,g=e.resolvers,v=e.typeDefs,y=e.fragmentMatcher,w=e.name,_=e.version,E=e.link;if(E||(E=n?new nh({uri:n,credentials:r,headers:i}):ta.empty()),!a)throw __DEV__?new Q.ej("To initialize Apollo Client, you must specify a 'cache' property in the options object. \nFor more information, please visit: https://go.apollo.dev/c/docs"):new Q.ej(9);if(this.link=E,this.cache=a,this.disableNetworkFetches=s||c>0,this.queryDeduplication=h,this.defaultOptions=p||Object.create(null),this.typeDefs=v,c&&setTimeout(function(){return t.disableNetworkFetches=!1},c),this.watchQuery=this.watchQuery.bind(this),this.query=this.query.bind(this),this.mutate=this.mutate.bind(this),this.resetStore=this.resetStore.bind(this),this.reFetchObservableQueries=this.reFetchObservableQueries.bind(this),f&&"object"==typeof window&&(window.__APOLLO_CLIENT__=this),!ii&&f&&__DEV__&&(ii=!0,"undefined"!=typeof window&&window.document&&window.top===window.self&&!window.__APOLLO_DEVTOOLS_GLOBAL_HOOK__)){var S=window.navigator,k=S&&S.userAgent,x=void 0;"string"==typeof k&&(k.indexOf("Chrome/")>-1?x="https://chrome.google.com/webstore/detail/apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm":k.indexOf("Firefox/")>-1&&(x="https://addons.mozilla.org/en-US/firefox/addon/apollo-developer-tools/")),x&&__DEV__&&Q.kG.log("Download the Apollo DevTools for a better development experience: "+x)}this.version=nb,this.localState=new r4({cache:a,client:this,resolvers:g,fragmentMatcher:y}),this.queryManager=new it({cache:this.cache,link:this.link,defaultOptions:this.defaultOptions,queryDeduplication:h,ssrMode:s,clientAwareness:{name:w,version:_},localState:this.localState,assumeImmutableResults:m,onBroadcast:f?function(){t.devToolsHookCb&&t.devToolsHookCb({action:{},state:{queries:t.queryManager.getQueryStore(),mutations:t.queryManager.mutationStore||{}},dataWithOptimisticResults:t.cache.extract(!0)})}:void 0})}return e.prototype.stop=function(){this.queryManager.stop()},e.prototype.watchQuery=function(e){return this.defaultOptions.watchQuery&&(e=(0,ir.J)(this.defaultOptions.watchQuery,e)),this.disableNetworkFetches&&("network-only"===e.fetchPolicy||"cache-and-network"===e.fetchPolicy)&&(e=(0,en.pi)((0,en.pi)({},e),{fetchPolicy:"cache-first"})),this.queryManager.watchQuery(e)},e.prototype.query=function(e){return this.defaultOptions.query&&(e=(0,ir.J)(this.defaultOptions.query,e)),__DEV__?(0,Q.kG)("cache-and-network"!==e.fetchPolicy,"The cache-and-network fetchPolicy does not work with client.query, because client.query can only return a single result. Please use client.watchQuery to receive multiple results from the cache and the network, or consider using a different fetchPolicy, such as cache-first or network-only."):(0,Q.kG)("cache-and-network"!==e.fetchPolicy,10),this.disableNetworkFetches&&"network-only"===e.fetchPolicy&&(e=(0,en.pi)((0,en.pi)({},e),{fetchPolicy:"cache-first"})),this.queryManager.query(e)},e.prototype.mutate=function(e){return this.defaultOptions.mutate&&(e=(0,ir.J)(this.defaultOptions.mutate,e)),this.queryManager.mutate(e)},e.prototype.subscribe=function(e){return this.queryManager.startGraphQLSubscription(e)},e.prototype.readQuery=function(e,t){return void 0===t&&(t=!1),this.cache.readQuery(e,t)},e.prototype.readFragment=function(e,t){return void 0===t&&(t=!1),this.cache.readFragment(e,t)},e.prototype.writeQuery=function(e){var t=this.cache.writeQuery(e);return!1!==e.broadcast&&this.queryManager.broadcastQueries(),t},e.prototype.writeFragment=function(e){var t=this.cache.writeFragment(e);return!1!==e.broadcast&&this.queryManager.broadcastQueries(),t},e.prototype.__actionHookForDevTools=function(e){this.devToolsHookCb=e},e.prototype.__requestRaw=function(e){return np(this.link,e)},e.prototype.resetStore=function(){var e=this;return Promise.resolve().then(function(){return e.queryManager.clearStore({discardWatches:!1})}).then(function(){return Promise.all(e.resetStoreCallbacks.map(function(e){return e()}))}).then(function(){return e.reFetchObservableQueries()})},e.prototype.clearStore=function(){var e=this;return Promise.resolve().then(function(){return e.queryManager.clearStore({discardWatches:!0})}).then(function(){return Promise.all(e.clearStoreCallbacks.map(function(e){return e()}))})},e.prototype.onResetStore=function(e){var t=this;return this.resetStoreCallbacks.push(e),function(){t.resetStoreCallbacks=t.resetStoreCallbacks.filter(function(t){return t!==e})}},e.prototype.onClearStore=function(e){var t=this;return this.clearStoreCallbacks.push(e),function(){t.clearStoreCallbacks=t.clearStoreCallbacks.filter(function(t){return t!==e})}},e.prototype.reFetchObservableQueries=function(e){return this.queryManager.reFetchObservableQueries(e)},e.prototype.refetchQueries=function(e){var t=this.queryManager.refetchQueries(e),n=[],r=[];t.forEach(function(e,t){n.push(t),r.push(e)});var i=Promise.all(r);return i.queries=n,i.results=r,i.catch(function(e){__DEV__&&Q.kG.debug("In client.refetchQueries, Promise.all promise rejected with error ".concat(e))}),i},e.prototype.getObservableQueries=function(e){return void 0===e&&(e="active"),this.queryManager.getObservableQueries(e)},e.prototype.extract=function(e){return this.cache.extract(e)},e.prototype.restore=function(e){return this.cache.restore(e)},e.prototype.addResolvers=function(e){this.localState.addResolvers(e)},e.prototype.setResolvers=function(e){this.localState.setResolvers(e)},e.prototype.getResolvers=function(){return this.localState.getResolvers()},e.prototype.setLocalStateFragmentMatcher=function(e){this.localState.setFragmentMatcher(e)},e.prototype.setLink=function(e){this.link=this.queryManager.link=e},e}(),io=function(){function e(){this.getFragmentDoc=rZ(eA)}return e.prototype.batch=function(e){var t,n=this,r="string"==typeof e.optimistic?e.optimistic:!1===e.optimistic?null:void 0;return this.performTransaction(function(){return t=e.update(n)},r),t},e.prototype.recordOptimisticTransaction=function(e,t){this.performTransaction(e,t)},e.prototype.transformDocument=function(e){return e},e.prototype.transformForLink=function(e){return e},e.prototype.identify=function(e){},e.prototype.gc=function(){return[]},e.prototype.modify=function(e){return!1},e.prototype.readQuery=function(e,t){return void 0===t&&(t=!!e.optimistic),this.read((0,en.pi)((0,en.pi)({},e),{rootId:e.id||"ROOT_QUERY",optimistic:t}))},e.prototype.readFragment=function(e,t){return void 0===t&&(t=!!e.optimistic),this.read((0,en.pi)((0,en.pi)({},e),{query:this.getFragmentDoc(e.fragment,e.fragmentName),rootId:e.id,optimistic:t}))},e.prototype.writeQuery=function(e){var t=e.id,n=e.data,r=(0,en._T)(e,["id","data"]);return this.write(Object.assign(r,{dataId:t||"ROOT_QUERY",result:n}))},e.prototype.writeFragment=function(e){var t=e.id,n=e.data,r=e.fragment,i=e.fragmentName,a=(0,en._T)(e,["id","data","fragment","fragmentName"]);return this.write(Object.assign(a,{query:this.getFragmentDoc(r,i),dataId:t,result:n}))},e.prototype.updateQuery=function(e,t){return this.batch({update:function(n){var r=n.readQuery(e),i=t(r);return null==i?r:(n.writeQuery((0,en.pi)((0,en.pi)({},e),{data:i})),i)}})},e.prototype.updateFragment=function(e,t){return this.batch({update:function(n){var r=n.readFragment(e),i=t(r);return null==i?r:(n.writeFragment((0,en.pi)((0,en.pi)({},e),{data:i})),i)}})},e}(),is=function(e){function t(n,r,i,a){var o,s=e.call(this,n)||this;if(s.message=n,s.path=r,s.query=i,s.variables=a,Array.isArray(s.path)){s.missing=s.message;for(var u=s.path.length-1;u>=0;--u)s.missing=((o={})[s.path[u]]=s.missing,o)}else s.missing=s.path;return s.__proto__=t.prototype,s}return(0,en.ZT)(t,e),t}(Error),iu=__webpack_require__(10542),ic=Object.prototype.hasOwnProperty;function il(e){return null==e}function id(e,t){var n=e.__typename,r=e.id,i=e._id;if("string"==typeof n&&(t&&(t.keyObject=il(r)?il(i)?void 0:{_id:i}:{id:r}),il(r)&&!il(i)&&(r=i),!il(r)))return"".concat(n,":").concat("number"==typeof r||"string"==typeof r?r:JSON.stringify(r))}var ih={dataIdFromObject:id,addTypename:!0,resultCaching:!0,canonizeResults:!1};function ip(e){return(0,n1.o)(ih,e)}function ib(e){var t=e.canonizeResults;return void 0===t?ih.canonizeResults:t}function im(e,t){return eD(t)?e.get(t.__ref,"__typename"):t&&t.__typename}var ig=/^[_a-z][_0-9a-z]*/i;function iv(e){var t=e.match(ig);return t?t[0]:e}function iy(e,t,n){return!!(0,eO.s)(t)&&((0,tP.k)(t)?t.every(function(t){return iy(e,t,n)}):e.selections.every(function(e){if(eQ(e)&&td(e,n)){var r=eX(e);return ic.call(t,r)&&(!e.selectionSet||iy(e.selectionSet,t[r],n))}return!0}))}function iw(e){return(0,eO.s)(e)&&!eD(e)&&!(0,tP.k)(e)}function i_(){return new tB}function iE(e,t){var n=eL(e4(e));return{fragmentMap:n,lookupFragment:function(e){var r=n[e];return!r&&t&&(r=t.lookup(e)),r||null}}}var iS=Object.create(null),ik=function(){return iS},ix=Object.create(null),iT=function(){function e(e,t){var n=this;this.policies=e,this.group=t,this.data=Object.create(null),this.rootIds=Object.create(null),this.refs=Object.create(null),this.getFieldValue=function(e,t){return(0,iu.J)(eD(e)?n.get(e.__ref,t):e&&e[t])},this.canRead=function(e){return eD(e)?n.has(e.__ref):"object"==typeof e},this.toReference=function(e,t){if("string"==typeof e)return eI(e);if(eD(e))return e;var r=n.policies.identify(e)[0];if(r){var i=eI(r);return t&&n.merge(r,e),i}}}return e.prototype.toObject=function(){return(0,en.pi)({},this.data)},e.prototype.has=function(e){return void 0!==this.lookup(e,!0)},e.prototype.get=function(e,t){if(this.group.depend(e,t),ic.call(this.data,e)){var n=this.data[e];if(n&&ic.call(n,t))return n[t]}return"__typename"===t&&ic.call(this.policies.rootTypenamesById,e)?this.policies.rootTypenamesById[e]:this instanceof iL?this.parent.get(e,t):void 0},e.prototype.lookup=function(e,t){return(t&&this.group.depend(e,"__exists"),ic.call(this.data,e))?this.data[e]:this instanceof iL?this.parent.lookup(e,t):this.policies.rootTypenamesById[e]?Object.create(null):void 0},e.prototype.merge=function(e,t){var n,r=this;eD(e)&&(e=e.__ref),eD(t)&&(t=t.__ref);var i="string"==typeof e?this.lookup(n=e):e,a="string"==typeof t?this.lookup(n=t):t;if(a){__DEV__?(0,Q.kG)("string"==typeof n,"store.merge expects a string ID"):(0,Q.kG)("string"==typeof n,1);var o=new tB(iI).merge(i,a);if(this.data[n]=o,o!==i&&(delete this.refs[n],this.group.caching)){var s=Object.create(null);i||(s.__exists=1),Object.keys(a).forEach(function(e){if(!i||i[e]!==o[e]){s[e]=1;var t=iv(e);t===e||r.policies.hasKeyArgs(o.__typename,t)||(s[t]=1),void 0!==o[e]||r instanceof iL||delete o[e]}}),s.__typename&&!(i&&i.__typename)&&this.policies.rootTypenamesById[n]===o.__typename&&delete s.__typename,Object.keys(s).forEach(function(e){return r.group.dirty(n,e)})}}},e.prototype.modify=function(e,t){var n=this,r=this.lookup(e);if(r){var i=Object.create(null),a=!1,o=!0,s={DELETE:iS,INVALIDATE:ix,isReference:eD,toReference:this.toReference,canRead:this.canRead,readField:function(t,r){return n.policies.readField("string"==typeof t?{fieldName:t,from:r||eI(e)}:t,{store:n})}};if(Object.keys(r).forEach(function(u){var c=iv(u),l=r[u];if(void 0!==l){var f="function"==typeof t?t:t[u]||t[c];if(f){var d=f===ik?iS:f((0,iu.J)(l),(0,en.pi)((0,en.pi)({},s),{fieldName:c,storeFieldName:u,storage:n.getStorage(e,u)}));d===ix?n.group.dirty(e,u):(d===iS&&(d=void 0),d!==l&&(i[u]=d,a=!0,l=d))}void 0!==l&&(o=!1)}}),a)return this.merge(e,i),o&&(this instanceof iL?this.data[e]=void 0:delete this.data[e],this.group.dirty(e,"__exists")),!0}return!1},e.prototype.delete=function(e,t,n){var r,i=this.lookup(e);if(i){var a=this.getFieldValue(i,"__typename"),o=t&&n?this.policies.getStoreFieldName({typename:a,fieldName:t,args:n}):t;return this.modify(e,o?((r={})[o]=ik,r):ik)}return!1},e.prototype.evict=function(e,t){var n=!1;return e.id&&(ic.call(this.data,e.id)&&(n=this.delete(e.id,e.fieldName,e.args)),this instanceof iL&&this!==t&&(n=this.parent.evict(e,t)||n),(e.fieldName||n)&&this.group.dirty(e.id,e.fieldName||"__exists")),n},e.prototype.clear=function(){this.replace(null)},e.prototype.extract=function(){var e=this,t=this.toObject(),n=[];return this.getRootIdSet().forEach(function(t){ic.call(e.policies.rootTypenamesById,t)||n.push(t)}),n.length&&(t.__META={extraRootIds:n.sort()}),t},e.prototype.replace=function(e){var t=this;if(Object.keys(this.data).forEach(function(n){e&&ic.call(e,n)||t.delete(n)}),e){var n=e.__META,r=(0,en._T)(e,["__META"]);Object.keys(r).forEach(function(e){t.merge(e,r[e])}),n&&n.extraRootIds.forEach(this.retain,this)}},e.prototype.retain=function(e){return this.rootIds[e]=(this.rootIds[e]||0)+1},e.prototype.release=function(e){if(this.rootIds[e]>0){var t=--this.rootIds[e];return t||delete this.rootIds[e],t}return 0},e.prototype.getRootIdSet=function(e){return void 0===e&&(e=new Set),Object.keys(this.rootIds).forEach(e.add,e),this instanceof iL?this.parent.getRootIdSet(e):Object.keys(this.policies.rootTypenamesById).forEach(e.add,e),e},e.prototype.gc=function(){var e=this,t=this.getRootIdSet(),n=this.toObject();t.forEach(function(r){ic.call(n,r)&&(Object.keys(e.findChildRefIds(r)).forEach(t.add,t),delete n[r])});var r=Object.keys(n);if(r.length){for(var i=this;i instanceof iL;)i=i.parent;r.forEach(function(e){return i.delete(e)})}return r},e.prototype.findChildRefIds=function(e){if(!ic.call(this.refs,e)){var t=this.refs[e]=Object.create(null),n=this.data[e];if(!n)return t;var r=new Set([n]);r.forEach(function(e){eD(e)&&(t[e.__ref]=!0),(0,eO.s)(e)&&Object.keys(e).forEach(function(t){var n=e[t];(0,eO.s)(n)&&r.add(n)})})}return this.refs[e]},e.prototype.makeCacheKey=function(){return this.group.keyMaker.lookupArray(arguments)},e}(),iM=function(){function e(e,t){void 0===t&&(t=null),this.caching=e,this.parent=t,this.d=null,this.resetCaching()}return e.prototype.resetCaching=function(){this.d=this.caching?rW():null,this.keyMaker=new n_(t_.mr)},e.prototype.depend=function(e,t){if(this.d){this.d(iO(e,t));var n=iv(t);n!==t&&this.d(iO(e,n)),this.parent&&this.parent.depend(e,t)}},e.prototype.dirty=function(e,t){this.d&&this.d.dirty(iO(e,t),"__exists"===t?"forget":"setDirty")},e}();function iO(e,t){return t+"#"+e}function iA(e,t){iD(e)&&e.group.depend(t,"__exists")}!function(e){var t=function(e){function t(t){var n=t.policies,r=t.resultCaching,i=void 0===r||r,a=t.seed,o=e.call(this,n,new iM(i))||this;return o.stump=new iC(o),o.storageTrie=new n_(t_.mr),a&&o.replace(a),o}return(0,en.ZT)(t,e),t.prototype.addLayer=function(e,t){return this.stump.addLayer(e,t)},t.prototype.removeLayer=function(){return this},t.prototype.getStorage=function(){return this.storageTrie.lookupArray(arguments)},t}(e);e.Root=t}(iT||(iT={}));var iL=function(e){function t(t,n,r,i){var a=e.call(this,n.policies,i)||this;return a.id=t,a.parent=n,a.replay=r,a.group=i,r(a),a}return(0,en.ZT)(t,e),t.prototype.addLayer=function(e,n){return new t(e,this,n,this.group)},t.prototype.removeLayer=function(e){var t=this,n=this.parent.removeLayer(e);return e===this.id?(this.group.caching&&Object.keys(this.data).forEach(function(e){var r=t.data[e],i=n.lookup(e);i?r?r!==i&&Object.keys(r).forEach(function(n){(0,nm.D)(r[n],i[n])||t.group.dirty(e,n)}):(t.group.dirty(e,"__exists"),Object.keys(i).forEach(function(n){t.group.dirty(e,n)})):t.delete(e)}),n):n===this.parent?this:n.addLayer(this.id,this.replay)},t.prototype.toObject=function(){return(0,en.pi)((0,en.pi)({},this.parent.toObject()),this.data)},t.prototype.findChildRefIds=function(t){var n=this.parent.findChildRefIds(t);return ic.call(this.data,t)?(0,en.pi)((0,en.pi)({},n),e.prototype.findChildRefIds.call(this,t)):n},t.prototype.getStorage=function(){for(var e=this.parent;e.parent;)e=e.parent;return e.getStorage.apply(e,arguments)},t}(iT),iC=function(e){function t(t){return e.call(this,"EntityStore.Stump",t,function(){},new iM(t.group.caching,t.group))||this}return(0,en.ZT)(t,e),t.prototype.removeLayer=function(){return this},t.prototype.merge=function(){return this.parent.merge.apply(this.parent,arguments)},t}(iL);function iI(e,t,n){var r=e[n],i=t[n];return(0,nm.D)(r,i)?r:i}function iD(e){return!!(e instanceof iT&&e.group.caching)}function iN(e){return[e.selectionSet,e.objectOrReference,e.context,e.context.canonizeResults,]}var iP=function(){function e(e){var t=this;this.knownResults=new(t_.mr?WeakMap:Map),this.config=(0,n1.o)(e,{addTypename:!1!==e.addTypename,canonizeResults:ib(e)}),this.canon=e.canon||new nk,this.executeSelectionSet=rZ(function(e){var n,r=e.context.canonizeResults,i=iN(e);i[3]=!r;var a=(n=t.executeSelectionSet).peek.apply(n,i);return a?r?(0,en.pi)((0,en.pi)({},a),{result:t.canon.admit(a.result)}):a:(iA(e.context.store,e.enclosingRef.__ref),t.execSelectionSetImpl(e))},{max:this.config.resultCacheMaxSize,keyArgs:iN,makeCacheKey:function(e,t,n,r){if(iD(n.store))return n.store.makeCacheKey(e,eD(t)?t.__ref:t,n.varString,r)}}),this.executeSubSelectedArray=rZ(function(e){return iA(e.context.store,e.enclosingRef.__ref),t.execSubSelectedArrayImpl(e)},{max:this.config.resultCacheMaxSize,makeCacheKey:function(e){var t=e.field,n=e.array,r=e.context;if(iD(r.store))return r.store.makeCacheKey(t,n,r.varString)}})}return e.prototype.resetCanon=function(){this.canon=new nk},e.prototype.diffQueryAgainstStore=function(e){var t,n=e.store,r=e.query,i=e.rootId,a=void 0===i?"ROOT_QUERY":i,o=e.variables,s=e.returnPartialData,u=void 0===s||s,c=e.canonizeResults,l=void 0===c?this.config.canonizeResults:c,f=this.config.cache.policies;o=(0,en.pi)((0,en.pi)({},e9(e6(r))),o);var d=eI(a),h=this.executeSelectionSet({selectionSet:e8(r).selectionSet,objectOrReference:d,enclosingRef:d,context:(0,en.pi)({store:n,query:r,policies:f,variables:o,varString:nx(o),canonizeResults:l},iE(r,this.config.fragments))});if(h.missing&&(t=[new is(iR(h.missing),h.missing,r,o)],!u))throw t[0];return{result:h.result,complete:!t,missing:t}},e.prototype.isFresh=function(e,t,n,r){if(iD(r.store)&&this.knownResults.get(e)===n){var i=this.executeSelectionSet.peek(n,t,r,this.canon.isKnown(e));if(i&&e===i.result)return!0}return!1},e.prototype.execSelectionSetImpl=function(e){var t,n=this,r=e.selectionSet,i=e.objectOrReference,a=e.enclosingRef,o=e.context;if(eD(i)&&!o.policies.rootTypenamesById[i.__ref]&&!o.store.has(i.__ref))return{result:this.canon.empty,missing:"Dangling reference to missing ".concat(i.__ref," object")};var s=o.variables,u=o.policies,c=o.store.getFieldValue(i,"__typename"),l=[],f=new tB;function d(e,n){var r;return e.missing&&(t=f.merge(t,((r={})[n]=e.missing,r))),e.result}this.config.addTypename&&"string"==typeof c&&!u.rootIdsByTypename[c]&&l.push({__typename:c});var h=new Set(r.selections);h.forEach(function(e){var r,p;if(td(e,s)){if(eQ(e)){var b=u.readField({fieldName:e.name.value,field:e,variables:o.variables,from:i},o),m=eX(e);void 0===b?nj.added(e)||(t=f.merge(t,((r={})[m]="Can't find field '".concat(e.name.value,"' on ").concat(eD(i)?i.__ref+" object":"object "+JSON.stringify(i,null,2)),r))):(0,tP.k)(b)?b=d(n.executeSubSelectedArray({field:e,array:b,enclosingRef:a,context:o}),m):e.selectionSet?null!=b&&(b=d(n.executeSelectionSet({selectionSet:e.selectionSet,objectOrReference:b,enclosingRef:eD(b)?b:a,context:o}),m)):o.canonizeResults&&(b=n.canon.pass(b)),void 0!==b&&l.push(((p={})[m]=b,p))}else{var g=eC(e,o.lookupFragment);if(!g&&e.kind===nL.h.FRAGMENT_SPREAD)throw __DEV__?new Q.ej("No fragment named ".concat(e.name.value)):new Q.ej(5);g&&u.fragmentMatches(g,c)&&g.selectionSet.selections.forEach(h.add,h)}}});var p={result:tF(l),missing:t},b=o.canonizeResults?this.canon.admit(p):(0,iu.J)(p);return b.result&&this.knownResults.set(b.result,r),b},e.prototype.execSubSelectedArrayImpl=function(e){var t,n=this,r=e.field,i=e.array,a=e.enclosingRef,o=e.context,s=new tB;function u(e,n){var r;return e.missing&&(t=s.merge(t,((r={})[n]=e.missing,r))),e.result}return r.selectionSet&&(i=i.filter(o.store.canRead)),i=i.map(function(e,t){return null===e?null:(0,tP.k)(e)?u(n.executeSubSelectedArray({field:r,array:e,enclosingRef:a,context:o}),t):r.selectionSet?u(n.executeSelectionSet({selectionSet:r.selectionSet,objectOrReference:e,enclosingRef:eD(e)?e:a,context:o}),t):(__DEV__&&ij(o.store,r,e),e)}),{result:o.canonizeResults?this.canon.admit(i):i,missing:t}},e}();function iR(e){try{JSON.stringify(e,function(e,t){if("string"==typeof t)throw t;return t})}catch(t){return t}}function ij(e,t,n){if(!t.selectionSet){var r=new Set([n]);r.forEach(function(n){(0,eO.s)(n)&&(__DEV__?(0,Q.kG)(!eD(n),"Missing selection set for object of type ".concat(im(e,n)," returned for query field ").concat(t.name.value)):(0,Q.kG)(!eD(n),6),Object.values(n).forEach(r.add,r))})}}function iF(e){var t=nG("stringifyForDisplay");return JSON.stringify(e,function(e,n){return void 0===n?t:n}).split(JSON.stringify(t)).join("")}var iY=Object.create(null);function iB(e){var t=JSON.stringify(e);return iY[t]||(iY[t]=Object.create(null))}function iU(e){var t=iB(e);return t.keyFieldsFn||(t.keyFieldsFn=function(t,n){var r=function(e,t){return n.readField(t,e)},i=n.keyObject=i$(e,function(e){var i=iW(n.storeObject,e,r);return void 0===i&&t!==n.storeObject&&ic.call(t,e[0])&&(i=iW(t,e,iG)),__DEV__?(0,Q.kG)(void 0!==i,"Missing field '".concat(e.join("."),"' while extracting keyFields from ").concat(JSON.stringify(t))):(0,Q.kG)(void 0!==i,2),i});return"".concat(n.typename,":").concat(JSON.stringify(i))})}function iH(e){var t=iB(e);return t.keyArgsFn||(t.keyArgsFn=function(t,n){var r=n.field,i=n.variables,a=n.fieldName,o=JSON.stringify(i$(e,function(e){var n=e[0],a=n.charAt(0);if("@"===a){if(r&&(0,tP.O)(r.directives)){var o=n.slice(1),s=r.directives.find(function(e){return e.name.value===o}),u=s&&eZ(s,i);return u&&iW(u,e.slice(1))}return}if("$"===a){var c=n.slice(1);if(i&&ic.call(i,c)){var l=e.slice(0);return l[0]=c,iW(i,l)}return}if(t)return iW(t,e)}));return(t||"{}"!==o)&&(a+=":"+o),a})}function i$(e,t){var n=new tB;return iz(e).reduce(function(e,r){var i,a=t(r);if(void 0!==a){for(var o=r.length-1;o>=0;--o)a=((i={})[r[o]]=a,i);e=n.merge(e,a)}return e},Object.create(null))}function iz(e){var t=iB(e);if(!t.paths){var n=t.paths=[],r=[];e.forEach(function(t,i){(0,tP.k)(t)?(iz(t).forEach(function(e){return n.push(r.concat(e))}),r.length=0):(r.push(t),(0,tP.k)(e[i+1])||(n.push(r.slice(0)),r.length=0))})}return t.paths}function iG(e,t){return e[t]}function iW(e,t,n){return n=n||iG,iK(t.reduce(function e(t,r){return(0,tP.k)(t)?t.map(function(t){return e(t,r)}):t&&n(t,r)},e))}function iK(e){return(0,eO.s)(e)?(0,tP.k)(e)?e.map(iK):i$(Object.keys(e).sort(),function(t){return iW(e,t)}):e}function iV(e){return void 0!==e.args?e.args:e.field?eZ(e.field,e.variables):null}eK.setStringify(nx);var iq=function(){},iZ=function(e,t){return t.fieldName},iX=function(e,t,n){return(0,n.mergeObjects)(e,t)},iJ=function(e,t){return t},iQ=function(){function e(e){this.config=e,this.typePolicies=Object.create(null),this.toBeAdded=Object.create(null),this.supertypeMap=new Map,this.fuzzySubtypes=new Map,this.rootIdsByTypename=Object.create(null),this.rootTypenamesById=Object.create(null),this.usingPossibleTypes=!1,this.config=(0,en.pi)({dataIdFromObject:id},e),this.cache=this.config.cache,this.setRootTypename("Query"),this.setRootTypename("Mutation"),this.setRootTypename("Subscription"),e.possibleTypes&&this.addPossibleTypes(e.possibleTypes),e.typePolicies&&this.addTypePolicies(e.typePolicies)}return e.prototype.identify=function(e,t){var n,r,i=this,a=t&&(t.typename||(null===(n=t.storeObject)||void 0===n?void 0:n.__typename))||e.__typename;if(a===this.rootTypenamesById.ROOT_QUERY)return["ROOT_QUERY"];for(var o=t&&t.storeObject||e,s=(0,en.pi)((0,en.pi)({},t),{typename:a,storeObject:o,readField:t&&t.readField||function(){var e=i0(arguments,o);return i.readField(e,{store:i.cache.data,variables:e.variables})}}),u=a&&this.getTypePolicy(a),c=u&&u.keyFn||this.config.dataIdFromObject;c;){var l=c((0,en.pi)((0,en.pi)({},e),o),s);if((0,tP.k)(l))c=iU(l);else{r=l;break}}return r=r?String(r):void 0,s.keyObject?[r,s.keyObject]:[r]},e.prototype.addTypePolicies=function(e){var t=this;Object.keys(e).forEach(function(n){var r=e[n],i=r.queryType,a=r.mutationType,o=r.subscriptionType,s=(0,en._T)(r,["queryType","mutationType","subscriptionType"]);i&&t.setRootTypename("Query",n),a&&t.setRootTypename("Mutation",n),o&&t.setRootTypename("Subscription",n),ic.call(t.toBeAdded,n)?t.toBeAdded[n].push(s):t.toBeAdded[n]=[s]})},e.prototype.updateTypePolicy=function(e,t){var n=this,r=this.getTypePolicy(e),i=t.keyFields,a=t.fields;function o(e,t){e.merge="function"==typeof t?t:!0===t?iX:!1===t?iJ:e.merge}o(r,t.merge),r.keyFn=!1===i?iq:(0,tP.k)(i)?iU(i):"function"==typeof i?i:r.keyFn,a&&Object.keys(a).forEach(function(t){var r=n.getFieldPolicy(e,t,!0),i=a[t];if("function"==typeof i)r.read=i;else{var s=i.keyArgs,u=i.read,c=i.merge;r.keyFn=!1===s?iZ:(0,tP.k)(s)?iH(s):"function"==typeof s?s:r.keyFn,"function"==typeof u&&(r.read=u),o(r,c)}r.read&&r.merge&&(r.keyFn=r.keyFn||iZ)})},e.prototype.setRootTypename=function(e,t){void 0===t&&(t=e);var n="ROOT_"+e.toUpperCase(),r=this.rootTypenamesById[n];t!==r&&(__DEV__?(0,Q.kG)(!r||r===e,"Cannot change root ".concat(e," __typename more than once")):(0,Q.kG)(!r||r===e,3),r&&delete this.rootIdsByTypename[r],this.rootIdsByTypename[t]=n,this.rootTypenamesById[n]=t)},e.prototype.addPossibleTypes=function(e){var t=this;this.usingPossibleTypes=!0,Object.keys(e).forEach(function(n){t.getSupertypeSet(n,!0),e[n].forEach(function(e){t.getSupertypeSet(e,!0).add(n);var r=e.match(ig);r&&r[0]===e||t.fuzzySubtypes.set(e,RegExp(e))})})},e.prototype.getTypePolicy=function(e){var t=this;if(!ic.call(this.typePolicies,e)){var n=this.typePolicies[e]=Object.create(null);n.fields=Object.create(null);var r=this.supertypeMap.get(e);r&&r.size&&r.forEach(function(e){var r=t.getTypePolicy(e),i=r.fields;Object.assign(n,(0,en._T)(r,["fields"])),Object.assign(n.fields,i)})}var i=this.toBeAdded[e];return i&&i.length&&i.splice(0).forEach(function(n){t.updateTypePolicy(e,n)}),this.typePolicies[e]},e.prototype.getFieldPolicy=function(e,t,n){if(e){var r=this.getTypePolicy(e).fields;return r[t]||n&&(r[t]=Object.create(null))}},e.prototype.getSupertypeSet=function(e,t){var n=this.supertypeMap.get(e);return!n&&t&&this.supertypeMap.set(e,n=new Set),n},e.prototype.fragmentMatches=function(e,t,n,r){var i=this;if(!e.typeCondition)return!0;if(!t)return!1;var a=e.typeCondition.name.value;if(t===a)return!0;if(this.usingPossibleTypes&&this.supertypeMap.has(a))for(var o=this.getSupertypeSet(t,!0),s=[o],u=function(e){var t=i.getSupertypeSet(e,!1);t&&t.size&&0>s.indexOf(t)&&s.push(t)},c=!!(n&&this.fuzzySubtypes.size),l=!1,f=0;f1?a:t}:(r=(0,en.pi)({},i),ic.call(r,"from")||(r.from=t)),__DEV__&&void 0===r.from&&__DEV__&&Q.kG.warn("Undefined 'from' passed to readField with arguments ".concat(iF(Array.from(e)))),void 0===r.variables&&(r.variables=n),r}function i2(e){return function(t,n){if((0,tP.k)(t)||(0,tP.k)(n))throw __DEV__?new Q.ej("Cannot automatically merge arrays"):new Q.ej(4);if((0,eO.s)(t)&&(0,eO.s)(n)){var r=e.getFieldValue(t,"__typename"),i=e.getFieldValue(n,"__typename");if(r&&i&&r!==i)return n;if(eD(t)&&iw(n))return e.merge(t.__ref,n),t;if(iw(t)&&eD(n))return e.merge(t,n.__ref),n;if(iw(t)&&iw(n))return(0,en.pi)((0,en.pi)({},t),n)}return n}}function i3(e,t,n){var r="".concat(t).concat(n),i=e.flavors.get(r);return i||e.flavors.set(r,i=e.clientOnly===t&&e.deferred===n?e:(0,en.pi)((0,en.pi)({},e),{clientOnly:t,deferred:n})),i}var i4=function(){function e(e,t,n){this.cache=e,this.reader=t,this.fragments=n}return e.prototype.writeToStore=function(e,t){var n=this,r=t.query,i=t.result,a=t.dataId,o=t.variables,s=t.overwrite,u=e2(r),c=i_();o=(0,en.pi)((0,en.pi)({},e9(u)),o);var l=(0,en.pi)((0,en.pi)({store:e,written:Object.create(null),merge:function(e,t){return c.merge(e,t)},variables:o,varString:nx(o)},iE(r,this.fragments)),{overwrite:!!s,incomingById:new Map,clientOnly:!1,deferred:!1,flavors:new Map}),f=this.processSelectionSet({result:i||Object.create(null),dataId:a,selectionSet:u.selectionSet,mergeTree:{map:new Map},context:l});if(!eD(f))throw __DEV__?new Q.ej("Could not identify object ".concat(JSON.stringify(i))):new Q.ej(7);return l.incomingById.forEach(function(t,r){var i=t.storeObject,a=t.mergeTree,o=t.fieldNodeSet,s=eI(r);if(a&&a.map.size){var u=n.applyMerges(a,s,i,l);if(eD(u))return;i=u}if(__DEV__&&!l.overwrite){var c=Object.create(null);o.forEach(function(e){e.selectionSet&&(c[e.name.value]=!0)});var f=function(e){return!0===c[iv(e)]},d=function(e){var t=a&&a.map.get(e);return Boolean(t&&t.info&&t.info.merge)};Object.keys(i).forEach(function(e){f(e)&&!d(e)&&at(s,i,e,l.store)})}e.merge(r,i)}),e.retain(f.__ref),f},e.prototype.processSelectionSet=function(e){var t=this,n=e.dataId,r=e.result,i=e.selectionSet,a=e.context,o=e.mergeTree,s=this.cache.policies,u=Object.create(null),c=n&&s.rootTypenamesById[n]||eJ(r,i,a.fragmentMap)||n&&a.store.get(n,"__typename");"string"==typeof c&&(u.__typename=c);var l=function(){var e=i0(arguments,u,a.variables);if(eD(e.from)){var t=a.incomingById.get(e.from.__ref);if(t){var n=s.readField((0,en.pi)((0,en.pi)({},e),{from:t.storeObject}),a);if(void 0!==n)return n}}return s.readField(e,a)},f=new Set;this.flattenFields(i,r,a,c).forEach(function(e,n){var i,a=r[eX(n)];if(f.add(n),void 0!==a){var d=s.getStoreFieldName({typename:c,fieldName:n.name.value,field:n,variables:e.variables}),h=i5(o,d),p=t.processFieldValue(a,n,n.selectionSet?i3(e,!1,!1):e,h),b=void 0;n.selectionSet&&(eD(p)||iw(p))&&(b=l("__typename",p));var m=s.getMergeFunction(c,n.name.value,b);m?h.info={field:n,typename:c,merge:m}:i7(o,d),u=e.merge(u,((i={})[d]=p,i))}else __DEV__&&!e.clientOnly&&!e.deferred&&!nj.added(n)&&!s.getReadFunction(c,n.name.value)&&__DEV__&&Q.kG.error("Missing field '".concat(eX(n),"' while writing result ").concat(JSON.stringify(r,null,2)).substring(0,1e3))});try{var d=s.identify(r,{typename:c,selectionSet:i,fragmentMap:a.fragmentMap,storeObject:u,readField:l}),h=d[0],p=d[1];n=n||h,p&&(u=a.merge(u,p))}catch(b){if(!n)throw b}if("string"==typeof n){var m=eI(n),g=a.written[n]||(a.written[n]=[]);if(g.indexOf(i)>=0||(g.push(i),this.reader&&this.reader.isFresh(r,m,i,a)))return m;var v=a.incomingById.get(n);return v?(v.storeObject=a.merge(v.storeObject,u),v.mergeTree=i8(v.mergeTree,o),f.forEach(function(e){return v.fieldNodeSet.add(e)})):a.incomingById.set(n,{storeObject:u,mergeTree:i9(o)?void 0:o,fieldNodeSet:f}),m}return u},e.prototype.processFieldValue=function(e,t,n,r){var i=this;return t.selectionSet&&null!==e?(0,tP.k)(e)?e.map(function(e,a){var o=i.processFieldValue(e,t,n,i5(r,a));return i7(r,a),o}):this.processSelectionSet({result:e,selectionSet:t.selectionSet,context:n,mergeTree:r}):__DEV__?nJ(e):e},e.prototype.flattenFields=function(e,t,n,r){void 0===r&&(r=eJ(t,e,n.fragmentMap));var i=new Map,a=this.cache.policies,o=new n_(!1);return function e(s,u){var c=o.lookup(s,u.clientOnly,u.deferred);c.visited||(c.visited=!0,s.selections.forEach(function(o){if(td(o,n.variables)){var s=u.clientOnly,c=u.deferred;if(!(s&&c)&&(0,tP.O)(o.directives)&&o.directives.forEach(function(e){var t=e.name.value;if("client"===t&&(s=!0),"defer"===t){var r=eZ(e,n.variables);r&&!1===r.if||(c=!0)}}),eQ(o)){var l=i.get(o);l&&(s=s&&l.clientOnly,c=c&&l.deferred),i.set(o,i3(n,s,c))}else{var f=eC(o,n.lookupFragment);if(!f&&o.kind===nL.h.FRAGMENT_SPREAD)throw __DEV__?new Q.ej("No fragment named ".concat(o.name.value)):new Q.ej(8);f&&a.fragmentMatches(f,r,t,n.variables)&&e(f.selectionSet,i3(n,s,c))}}}))}(e,n),i},e.prototype.applyMerges=function(e,t,n,r,i){var a=this;if(e.map.size&&!eD(n)){var o,s,u=!(0,tP.k)(n)&&(eD(t)||iw(t))?t:void 0,c=n;u&&!i&&(i=[eD(u)?u.__ref:u]);var l=function(e,t){return(0,tP.k)(e)?"number"==typeof t?e[t]:void 0:r.store.getFieldValue(e,String(t))};e.map.forEach(function(e,t){var n=l(u,t),o=l(c,t);if(void 0!==o){i&&i.push(t);var f=a.applyMerges(e,n,o,r,i);f!==o&&(s=s||new Map).set(t,f),i&&(0,Q.kG)(i.pop()===t)}}),s&&(n=(0,tP.k)(c)?c.slice(0):(0,en.pi)({},c),s.forEach(function(e,t){n[t]=e}))}return e.info?this.cache.policies.runMergeFunction(t,n,e.info,r,i&&(o=r.store).getStorage.apply(o,i)):n},e}(),i6=[];function i5(e,t){var n=e.map;return n.has(t)||n.set(t,i6.pop()||{map:new Map}),n.get(t)}function i8(e,t){if(e===t||!t||i9(t))return e;if(!e||i9(e))return t;var n=e.info&&t.info?(0,en.pi)((0,en.pi)({},e.info),t.info):e.info||t.info,r=e.map.size&&t.map.size,i=r?new Map:e.map.size?e.map:t.map,a={info:n,map:i};if(r){var o=new Set(t.map.keys());e.map.forEach(function(e,n){a.map.set(n,i8(e,t.map.get(n))),o.delete(n)}),o.forEach(function(n){a.map.set(n,i8(t.map.get(n),e.map.get(n)))})}return a}function i9(e){return!e||!(e.info||e.map.size)}function i7(e,t){var n=e.map,r=n.get(t);r&&i9(r)&&(i6.push(r),n.delete(t))}var ae=new Set;function at(e,t,n,r){var i=function(e){var t=r.getFieldValue(e,n);return"object"==typeof t&&t},a=i(e);if(a){var o=i(t);if(!(!o||eD(a)||(0,nm.D)(a,o)||Object.keys(a).every(function(e){return void 0!==r.getFieldValue(o,e)}))){var s=r.getFieldValue(e,"__typename")||r.getFieldValue(t,"__typename"),u=iv(n),c="".concat(s,".").concat(u);if(!ae.has(c)){ae.add(c);var l=[];(0,tP.k)(a)||(0,tP.k)(o)||[a,o].forEach(function(e){var t=r.getFieldValue(e,"__typename");"string"!=typeof t||l.includes(t)||l.push(t)}),__DEV__&&Q.kG.warn("Cache data may be lost when replacing the ".concat(u," field of a ").concat(s," object.\n\nThis could cause additional (usually avoidable) network requests to fetch data that were otherwise cached.\n\nTo address this problem (which is not a bug in Apollo Client), ").concat(l.length?"either ensure all objects of type "+l.join(" and ")+" have an ID or a custom merge function, or ":"","define a custom merge function for the ").concat(c," field, so InMemoryCache can safely merge these objects:\n\n existing: ").concat(JSON.stringify(a).slice(0,1e3),"\n incoming: ").concat(JSON.stringify(o).slice(0,1e3),"\n\nFor more information about these options, please refer to the documentation:\n\n * Ensuring entity objects have IDs: https://go.apollo.dev/c/generating-unique-identifiers\n * Defining custom merge functions: https://go.apollo.dev/c/merging-non-normalized-objects\n"))}}}}var an=function(e){function t(t){void 0===t&&(t={});var n=e.call(this)||this;return n.watches=new Set,n.typenameDocumentCache=new Map,n.makeVar=r2,n.txCount=0,n.config=ip(t),n.addTypename=!!n.config.addTypename,n.policies=new iQ({cache:n,dataIdFromObject:n.config.dataIdFromObject,possibleTypes:n.config.possibleTypes,typePolicies:n.config.typePolicies}),n.init(),n}return(0,en.ZT)(t,e),t.prototype.init=function(){var e=this.data=new iT.Root({policies:this.policies,resultCaching:this.config.resultCaching});this.optimisticData=e.stump,this.resetResultCache()},t.prototype.resetResultCache=function(e){var t=this,n=this.storeReader,r=this.config.fragments;this.storeWriter=new i4(this,this.storeReader=new iP({cache:this,addTypename:this.addTypename,resultCacheMaxSize:this.config.resultCacheMaxSize,canonizeResults:ib(this.config),canon:e?void 0:n&&n.canon,fragments:r}),r),this.maybeBroadcastWatch=rZ(function(e,n){return t.broadcastWatch(e,n)},{max:this.config.resultCacheMaxSize,makeCacheKey:function(e){var n=e.optimistic?t.optimisticData:t.data;if(iD(n)){var r=e.optimistic,i=e.id,a=e.variables;return n.makeCacheKey(e.query,e.callback,nx({optimistic:r,id:i,variables:a}))}}}),new Set([this.data.group,this.optimisticData.group,]).forEach(function(e){return e.resetCaching()})},t.prototype.restore=function(e){return this.init(),e&&this.data.replace(e),this},t.prototype.extract=function(e){return void 0===e&&(e=!1),(e?this.optimisticData:this.data).extract()},t.prototype.read=function(e){var t=e.returnPartialData,n=void 0!==t&&t;try{return this.storeReader.diffQueryAgainstStore((0,en.pi)((0,en.pi)({},e),{store:e.optimistic?this.optimisticData:this.data,config:this.config,returnPartialData:n})).result||null}catch(r){if(r instanceof is)return null;throw r}},t.prototype.write=function(e){try{return++this.txCount,this.storeWriter.writeToStore(this.data,e)}finally{--this.txCount||!1===e.broadcast||this.broadcastWatches()}},t.prototype.modify=function(e){if(ic.call(e,"id")&&!e.id)return!1;var t=e.optimistic?this.optimisticData:this.data;try{return++this.txCount,t.modify(e.id||"ROOT_QUERY",e.fields)}finally{--this.txCount||!1===e.broadcast||this.broadcastWatches()}},t.prototype.diff=function(e){return this.storeReader.diffQueryAgainstStore((0,en.pi)((0,en.pi)({},e),{store:e.optimistic?this.optimisticData:this.data,rootId:e.id||"ROOT_QUERY",config:this.config}))},t.prototype.watch=function(e){var t=this;return this.watches.size||r0(this),this.watches.add(e),e.immediate&&this.maybeBroadcastWatch(e),function(){t.watches.delete(e)&&!t.watches.size&&r1(t),t.maybeBroadcastWatch.forget(e)}},t.prototype.gc=function(e){nx.reset();var t=this.optimisticData.gc();return e&&!this.txCount&&(e.resetResultCache?this.resetResultCache(e.resetResultIdentities):e.resetResultIdentities&&this.storeReader.resetCanon()),t},t.prototype.retain=function(e,t){return(t?this.optimisticData:this.data).retain(e)},t.prototype.release=function(e,t){return(t?this.optimisticData:this.data).release(e)},t.prototype.identify=function(e){if(eD(e))return e.__ref;try{return this.policies.identify(e)[0]}catch(t){__DEV__&&Q.kG.warn(t)}},t.prototype.evict=function(e){if(!e.id){if(ic.call(e,"id"))return!1;e=(0,en.pi)((0,en.pi)({},e),{id:"ROOT_QUERY"})}try{return++this.txCount,this.optimisticData.evict(e,this.data)}finally{--this.txCount||!1===e.broadcast||this.broadcastWatches()}},t.prototype.reset=function(e){var t=this;return this.init(),nx.reset(),e&&e.discardWatches?(this.watches.forEach(function(e){return t.maybeBroadcastWatch.forget(e)}),this.watches.clear(),r1(this)):this.broadcastWatches(),Promise.resolve()},t.prototype.removeOptimistic=function(e){var t=this.optimisticData.removeLayer(e);t!==this.optimisticData&&(this.optimisticData=t,this.broadcastWatches())},t.prototype.batch=function(e){var t,n=this,r=e.update,i=e.optimistic,a=void 0===i||i,o=e.removeOptimistic,s=e.onWatchUpdated,u=function(e){var i=n,a=i.data,o=i.optimisticData;++n.txCount,e&&(n.data=n.optimisticData=e);try{return t=r(n)}finally{--n.txCount,n.data=a,n.optimisticData=o}},c=new Set;return s&&!this.txCount&&this.broadcastWatches((0,en.pi)((0,en.pi)({},e),{onWatchUpdated:function(e){return c.add(e),!1}})),"string"==typeof a?this.optimisticData=this.optimisticData.addLayer(a,u):!1===a?u(this.data):u(),"string"==typeof o&&(this.optimisticData=this.optimisticData.removeLayer(o)),s&&c.size?(this.broadcastWatches((0,en.pi)((0,en.pi)({},e),{onWatchUpdated:function(e,t){var n=s.call(this,e,t);return!1!==n&&c.delete(e),n}})),c.size&&c.forEach(function(e){return n.maybeBroadcastWatch.dirty(e)})):this.broadcastWatches(e),t},t.prototype.performTransaction=function(e,t){return this.batch({update:e,optimistic:t||null!==t})},t.prototype.transformDocument=function(e){if(this.addTypename){var t=this.typenameDocumentCache.get(e);return t||(t=nj(e),this.typenameDocumentCache.set(e,t),this.typenameDocumentCache.set(t,t)),t}return e},t.prototype.transformForLink=function(e){var t=this.config.fragments;return t?t.transform(e):e},t.prototype.broadcastWatches=function(e){var t=this;this.txCount||this.watches.forEach(function(n){return t.maybeBroadcastWatch(n,e)})},t.prototype.broadcastWatch=function(e,t){var n=e.lastDiff,r=this.diff(e);(!t||(e.optimistic&&"string"==typeof t.optimistic&&(r.fromOptimisticTransaction=!0),!t.onWatchUpdated||!1!==t.onWatchUpdated.call(this,e,r,n)))&&(n&&(0,nm.D)(n.result,r.result)||e.callback(e.lastDiff=r,n))},t}(io),ar={possibleTypes:{ApproveJobProposalSpecPayload:["ApproveJobProposalSpecSuccess","JobAlreadyExistsError","NotFoundError"],BridgePayload:["Bridge","NotFoundError"],CancelJobProposalSpecPayload:["CancelJobProposalSpecSuccess","NotFoundError"],ChainPayload:["Chain","NotFoundError"],CreateAPITokenPayload:["CreateAPITokenSuccess","InputErrors"],CreateBridgePayload:["CreateBridgeSuccess"],CreateCSAKeyPayload:["CSAKeyExistsError","CreateCSAKeySuccess"],CreateFeedsManagerChainConfigPayload:["CreateFeedsManagerChainConfigSuccess","InputErrors","NotFoundError"],CreateFeedsManagerPayload:["CreateFeedsManagerSuccess","InputErrors","NotFoundError","SingleFeedsManagerError"],CreateJobPayload:["CreateJobSuccess","InputErrors"],CreateOCR2KeyBundlePayload:["CreateOCR2KeyBundleSuccess"],CreateOCRKeyBundlePayload:["CreateOCRKeyBundleSuccess"],CreateP2PKeyPayload:["CreateP2PKeySuccess"],DeleteAPITokenPayload:["DeleteAPITokenSuccess","InputErrors"],DeleteBridgePayload:["DeleteBridgeConflictError","DeleteBridgeInvalidNameError","DeleteBridgeSuccess","NotFoundError"],DeleteCSAKeyPayload:["DeleteCSAKeySuccess","NotFoundError"],DeleteFeedsManagerChainConfigPayload:["DeleteFeedsManagerChainConfigSuccess","NotFoundError"],DeleteJobPayload:["DeleteJobSuccess","NotFoundError"],DeleteOCR2KeyBundlePayload:["DeleteOCR2KeyBundleSuccess","NotFoundError"],DeleteOCRKeyBundlePayload:["DeleteOCRKeyBundleSuccess","NotFoundError"],DeleteP2PKeyPayload:["DeleteP2PKeySuccess","NotFoundError"],DeleteVRFKeyPayload:["DeleteVRFKeySuccess","NotFoundError"],DismissJobErrorPayload:["DismissJobErrorSuccess","NotFoundError"],Error:["CSAKeyExistsError","DeleteBridgeConflictError","DeleteBridgeInvalidNameError","InputError","JobAlreadyExistsError","NotFoundError","RunJobCannotRunError","SingleFeedsManagerError"],EthTransactionPayload:["EthTransaction","NotFoundError"],FeaturesPayload:["Features"],FeedsManagerPayload:["FeedsManager","NotFoundError"],GetSQLLoggingPayload:["SQLLogging"],GlobalLogLevelPayload:["GlobalLogLevel"],JobPayload:["Job","NotFoundError"],JobProposalPayload:["JobProposal","NotFoundError"],JobRunPayload:["JobRun","NotFoundError"],JobSpec:["BlockHeaderFeederSpec","BlockhashStoreSpec","BootstrapSpec","CronSpec","DirectRequestSpec","FluxMonitorSpec","GatewaySpec","KeeperSpec","OCR2Spec","OCRSpec","StandardCapabilitiesSpec","VRFSpec","WebhookSpec","WorkflowSpec"],NodePayload:["Node","NotFoundError"],PaginatedPayload:["BridgesPayload","ChainsPayload","EthTransactionAttemptsPayload","EthTransactionsPayload","JobRunsPayload","JobsPayload","NodesPayload"],RejectJobProposalSpecPayload:["NotFoundError","RejectJobProposalSpecSuccess"],RunJobPayload:["NotFoundError","RunJobCannotRunError","RunJobSuccess"],SetGlobalLogLevelPayload:["InputErrors","SetGlobalLogLevelSuccess"],SetSQLLoggingPayload:["SetSQLLoggingSuccess"],SetServicesLogLevelsPayload:["InputErrors","SetServicesLogLevelsSuccess"],UpdateBridgePayload:["NotFoundError","UpdateBridgeSuccess"],UpdateFeedsManagerChainConfigPayload:["InputErrors","NotFoundError","UpdateFeedsManagerChainConfigSuccess"],UpdateFeedsManagerPayload:["InputErrors","NotFoundError","UpdateFeedsManagerSuccess"],UpdateJobProposalSpecDefinitionPayload:["NotFoundError","UpdateJobProposalSpecDefinitionSuccess"],UpdatePasswordPayload:["InputErrors","UpdatePasswordSuccess"],VRFKeyPayload:["NotFoundError","VRFKeySuccess"]}};let ai=ar;var aa=(r=void 0,location.origin),ao=new nh({uri:"".concat(aa,"/query"),credentials:"include"}),as=new ia({cache:new an({possibleTypes:ai.possibleTypes}),link:ao});if(a.Z.locale(o),u().defaultFormat="YYYY-MM-DD h:mm:ss A","undefined"!=typeof document){var au,ac,al=f().hydrate;ac=X,al(c.createElement(et,{client:as},c.createElement(d.zj,null,c.createElement(i.MuiThemeProvider,{theme:J.r},c.createElement(ac,null)))),document.getElementById("root"))}})()})(); \ No newline at end of file diff --git a/core/web/assets/main.6f07a88cfc748f57e21d.js.gz b/core/web/assets/main.6f07a88cfc748f57e21d.js.gz deleted file mode 100644 index 1a833982299..00000000000 Binary files a/core/web/assets/main.6f07a88cfc748f57e21d.js.gz and /dev/null differ diff --git a/core/web/assets/main.84f90f8fc23465846aa7.js b/core/web/assets/main.84f90f8fc23465846aa7.js new file mode 100644 index 00000000000..f9770459bef --- /dev/null +++ b/core/web/assets/main.84f90f8fc23465846aa7.js @@ -0,0 +1,174 @@ +(()=>{var __webpack_modules__={98925(e,t,n){"use strict";let r=n(98633),i=n.g.Date;class a extends i{constructor(e){super(e),this.isDate=!0}toISOString(){return`${this.getUTCFullYear()}-${r(2,this.getUTCMonth()+1)}-${r(2,this.getUTCDate())}`}}e.exports=e=>{let t=new a(e);if(!isNaN(t))return t;throw TypeError("Invalid Datetime")}},86595(e,t,n){"use strict";let r=n(98633);class i extends Date{constructor(e){super(e+"Z"),this.isFloating=!0}toISOString(){let e=`${this.getUTCFullYear()}-${r(2,this.getUTCMonth()+1)}-${r(2,this.getUTCDate())}`,t=`${r(2,this.getUTCHours())}:${r(2,this.getUTCMinutes())}:${r(2,this.getUTCSeconds())}.${r(3,this.getUTCMilliseconds())}`;return`${e}T${t}`}}e.exports=e=>{let t=new i(e);if(!isNaN(t))return t;throw TypeError("Invalid Datetime")}},76114(e){"use strict";e.exports=e=>{let t=new Date(e);if(!isNaN(t))return t;throw TypeError("Invalid Datetime")}},99439(e,t,n){"use strict";let r=n(98633);class i extends Date{constructor(e){super(`0000-01-01T${e}Z`),this.isTime=!0}toISOString(){return`${r(2,this.getUTCHours())}:${r(2,this.getUTCMinutes())}:${r(2,this.getUTCSeconds())}.${r(3,this.getUTCMilliseconds())}`}}e.exports=e=>{let t=new i(e);if(!isNaN(t))return t;throw TypeError("Invalid Datetime")}},98633(e){"use strict";e.exports=(e,t)=>{for(t=String(t);t.length{let t=new TomlError(e.message);return t.code=e.code,t.wrapped=e,t},module.exports.TomlError=TomlError;let createDateTime=__webpack_require__(76114),createDateTimeFloat=__webpack_require__(86595),createDate=__webpack_require__(98925),createTime=__webpack_require__(99439),CTRL_I=9,CTRL_J=10,CTRL_M=13,CTRL_CHAR_BOUNDARY=31,CHAR_SP=32,CHAR_QUOT=34,CHAR_NUM=35,CHAR_APOS=39,CHAR_PLUS=43,CHAR_COMMA=44,CHAR_HYPHEN=45,CHAR_PERIOD=46,CHAR_0=48,CHAR_1=49,CHAR_7=55,CHAR_9=57,CHAR_COLON=58,CHAR_EQUALS=61,CHAR_A=65,CHAR_E=69,CHAR_F=70,CHAR_T=84,CHAR_U=85,CHAR_Z=90,CHAR_LOWBAR=95,CHAR_a=97,CHAR_b=98,CHAR_e=101,CHAR_f=102,CHAR_i=105,CHAR_l=108,CHAR_n=110,CHAR_o=111,CHAR_r=114,CHAR_s=115,CHAR_t=116,CHAR_u=117,CHAR_x=120,CHAR_z=122,CHAR_LCUB=123,CHAR_RCUB=125,CHAR_LSQB=91,CHAR_BSOL=92,CHAR_RSQB=93,CHAR_DEL=127,SURROGATE_FIRST=55296,SURROGATE_LAST=57343,escapes={[CHAR_b]:"\b",[CHAR_t]:" ",[CHAR_n]:"\n",[CHAR_f]:"\f",[CHAR_r]:"\r",[CHAR_QUOT]:'"',[CHAR_BSOL]:"\\"};function isDigit(e){return e>=CHAR_0&&e<=CHAR_9}function isHexit(e){return e>=CHAR_A&&e<=CHAR_F||e>=CHAR_a&&e<=CHAR_f||e>=CHAR_0&&e<=CHAR_9}function isBit(e){return e===CHAR_1||e===CHAR_0}function isOctit(e){return e>=CHAR_0&&e<=CHAR_7}function isAlphaNumQuoteHyphen(e){return e>=CHAR_A&&e<=CHAR_Z||e>=CHAR_a&&e<=CHAR_z||e>=CHAR_0&&e<=CHAR_9||e===CHAR_APOS||e===CHAR_QUOT||e===CHAR_LOWBAR||e===CHAR_HYPHEN}function isAlphaNumHyphen(e){return e>=CHAR_A&&e<=CHAR_Z||e>=CHAR_a&&e<=CHAR_z||e>=CHAR_0&&e<=CHAR_9||e===CHAR_LOWBAR||e===CHAR_HYPHEN}let _type=Symbol("type"),_declared=Symbol("declared"),hasOwnProperty=Object.prototype.hasOwnProperty,defineProperty=Object.defineProperty,descriptor={configurable:!0,enumerable:!0,writable:!0,value:void 0};function hasKey(e,t){return!!hasOwnProperty.call(e,t)||("__proto__"===t&&defineProperty(e,"__proto__",descriptor),!1)}let INLINE_TABLE=Symbol("inline-table");function InlineTable(){return Object.defineProperties({},{[_type]:{value:INLINE_TABLE}})}function isInlineTable(e){return null!==e&&"object"==typeof e&&e[_type]===INLINE_TABLE}let TABLE=Symbol("table");function Table(){return Object.defineProperties({},{[_type]:{value:TABLE},[_declared]:{value:!1,writable:!0}})}function isTable(e){return null!==e&&"object"==typeof e&&e[_type]===TABLE}let _contentType=Symbol("content-type"),INLINE_LIST=Symbol("inline-list");function InlineList(e){return Object.defineProperties([],{[_type]:{value:INLINE_LIST},[_contentType]:{value:e}})}function isInlineList(e){return null!==e&&"object"==typeof e&&e[_type]===INLINE_LIST}let LIST=Symbol("list");function List(){return Object.defineProperties([],{[_type]:{value:LIST}})}function isList(e){return null!==e&&"object"==typeof e&&e[_type]===LIST}let _custom;try{let utilInspect=eval("require('util').inspect");_custom=utilInspect.custom}catch(_){}let _inspect=_custom||"inspect";class BoxedBigInt{constructor(e){try{this.value=__webpack_require__.g.BigInt.asIntN(64,e)}catch(t){this.value=null}Object.defineProperty(this,_type,{value:INTEGER})}isNaN(){return null===this.value}toString(){return String(this.value)}[_inspect](){return`[BigInt: ${this.toString()}]}`}valueOf(){return this.value}}let INTEGER=Symbol("integer");function Integer(e){let t=Number(e);return(Object.is(t,-0)&&(t=0),__webpack_require__.g.BigInt&&!Number.isSafeInteger(t))?new BoxedBigInt(e):Object.defineProperties(new Number(t),{isNaN:{value:function(){return isNaN(this)}},[_type]:{value:INTEGER},[_inspect]:{value:()=>`[Integer: ${e}]`}})}function isInteger(e){return null!==e&&"object"==typeof e&&e[_type]===INTEGER}let FLOAT=Symbol("float");function Float(e){return Object.defineProperties(new Number(e),{[_type]:{value:FLOAT},[_inspect]:{value:()=>`[Float: ${e}]`}})}function isFloat(e){return null!==e&&"object"==typeof e&&e[_type]===FLOAT}function tomlType(e){let t=typeof e;if("object"===t){if(null===e)return"null";if(e instanceof Date)return"datetime";if(_type in e)switch(e[_type]){case INLINE_TABLE:return"inline-table";case INLINE_LIST:return"inline-list";case TABLE:return"table";case LIST:return"list";case FLOAT:return"float";case INTEGER:return"integer"}}return t}function makeParserClass(e){class t extends e{constructor(){super(),this.ctx=this.obj=Table()}atEndOfWord(){return this.char===CHAR_NUM||this.char===CTRL_I||this.char===CHAR_SP||this.atEndOfLine()}atEndOfLine(){return this.char===e.END||this.char===CTRL_J||this.char===CTRL_M}parseStart(){if(this.char===e.END)return null;if(this.char===CHAR_LSQB)return this.call(this.parseTableOrList);if(this.char===CHAR_NUM)return this.call(this.parseComment);if(this.char===CTRL_J||this.char===CHAR_SP||this.char===CTRL_I||this.char===CTRL_M)return null;if(isAlphaNumQuoteHyphen(this.char))return this.callNow(this.parseAssignStatement);else throw this.error(new TomlError(`Unknown character "${this.char}"`))}parseWhitespaceToEOL(){if(this.char===CHAR_SP||this.char===CTRL_I||this.char===CTRL_M)return null;if(this.char===CHAR_NUM)return this.goto(this.parseComment);if(this.char===e.END||this.char===CTRL_J)return this.return();throw this.error(new TomlError("Unexpected character, expected only whitespace or comments till end of line"))}parseAssignStatement(){return this.callNow(this.parseAssign,this.recordAssignStatement)}recordAssignStatement(e){let t=this.ctx,n=e.key.pop();for(let r of e.key){if(hasKey(t,r)&&!isTable(t[r]))throw this.error(new TomlError("Can't redefine existing key"));t=t[r]=t[r]||Table()}if(hasKey(t,n))throw this.error(new TomlError("Can't redefine existing key"));return t[_declared]=!0,isInteger(e.value)||isFloat(e.value)?t[n]=e.value.valueOf():t[n]=e.value,this.goto(this.parseWhitespaceToEOL)}parseAssign(){return this.callNow(this.parseKeyword,this.recordAssignKeyword)}recordAssignKeyword(e){return this.state.resultTable?this.state.resultTable.push(e):this.state.resultTable=[e],this.goto(this.parseAssignKeywordPreDot)}parseAssignKeywordPreDot(){return this.char===CHAR_PERIOD?this.next(this.parseAssignKeywordPostDot):this.char!==CHAR_SP&&this.char!==CTRL_I?this.goto(this.parseAssignEqual):void 0}parseAssignKeywordPostDot(){if(this.char!==CHAR_SP&&this.char!==CTRL_I)return this.callNow(this.parseKeyword,this.recordAssignKeyword)}parseAssignEqual(){if(this.char===CHAR_EQUALS)return this.next(this.parseAssignPreValue);throw this.error(new TomlError('Invalid character, expected "="'))}parseAssignPreValue(){return this.char===CHAR_SP||this.char===CTRL_I?null:this.callNow(this.parseValue,this.recordAssignValue)}recordAssignValue(e){return this.returnNow({key:this.state.resultTable,value:e})}parseComment(){do{if(this.char===e.END||this.char===CTRL_J)return this.return();if(this.char===CHAR_DEL||this.char<=CTRL_CHAR_BOUNDARY&&this.char!==CTRL_I)throw this.errorControlCharIn("comments")}while(this.nextChar())}parseTableOrList(){if(this.char!==CHAR_LSQB)return this.goto(this.parseTable);this.next(this.parseList)}parseTable(){return this.ctx=this.obj,this.goto(this.parseTableNext)}parseTableNext(){return this.char===CHAR_SP||this.char===CTRL_I?null:this.callNow(this.parseKeyword,this.parseTableMore)}parseTableMore(e){if(this.char===CHAR_SP||this.char===CTRL_I)return null;if(this.char===CHAR_RSQB){if(hasKey(this.ctx,e)&&(!isTable(this.ctx[e])||this.ctx[e][_declared]))throw this.error(new TomlError("Can't redefine existing key"));return this.ctx=this.ctx[e]=this.ctx[e]||Table(),this.ctx[_declared]=!0,this.next(this.parseWhitespaceToEOL)}if(this.char===CHAR_PERIOD){if(hasKey(this.ctx,e)){if(isTable(this.ctx[e]))this.ctx=this.ctx[e];else if(isList(this.ctx[e]))this.ctx=this.ctx[e][this.ctx[e].length-1];else throw this.error(new TomlError("Can't redefine existing key"))}else this.ctx=this.ctx[e]=Table();return this.next(this.parseTableNext)}throw this.error(new TomlError("Unexpected character, expected whitespace, . or ]"))}parseList(){return this.ctx=this.obj,this.goto(this.parseListNext)}parseListNext(){return this.char===CHAR_SP||this.char===CTRL_I?null:this.callNow(this.parseKeyword,this.parseListMore)}parseListMore(e){if(this.char===CHAR_SP||this.char===CTRL_I)return null;if(this.char===CHAR_RSQB){if(hasKey(this.ctx,e)||(this.ctx[e]=List()),isInlineList(this.ctx[e]))throw this.error(new TomlError("Can't extend an inline array"));if(isList(this.ctx[e])){let t=Table();this.ctx[e].push(t),this.ctx=t}else throw this.error(new TomlError("Can't redefine an existing key"));return this.next(this.parseListEnd)}if(this.char===CHAR_PERIOD){if(hasKey(this.ctx,e)){if(isInlineList(this.ctx[e]))throw this.error(new TomlError("Can't extend an inline array"));if(isInlineTable(this.ctx[e]))throw this.error(new TomlError("Can't extend an inline table"));else if(isList(this.ctx[e]))this.ctx=this.ctx[e][this.ctx[e].length-1];else if(isTable(this.ctx[e]))this.ctx=this.ctx[e];else throw this.error(new TomlError("Can't redefine an existing key"))}else this.ctx=this.ctx[e]=Table();return this.next(this.parseListNext)}throw this.error(new TomlError("Unexpected character, expected whitespace, . or ]"))}parseListEnd(e){if(this.char===CHAR_RSQB)return this.next(this.parseWhitespaceToEOL);throw this.error(new TomlError("Unexpected character, expected whitespace, . or ]"))}parseValue(){if(this.char===e.END)throw this.error(new TomlError("Key without value"));if(this.char===CHAR_QUOT)return this.next(this.parseDoubleString);if(this.char===CHAR_APOS)return this.next(this.parseSingleString);if(this.char===CHAR_HYPHEN||this.char===CHAR_PLUS)return this.goto(this.parseNumberSign);if(this.char===CHAR_i)return this.next(this.parseInf);if(this.char===CHAR_n)return this.next(this.parseNan);if(isDigit(this.char))return this.goto(this.parseNumberOrDateTime);else if(this.char===CHAR_t||this.char===CHAR_f)return this.goto(this.parseBoolean);else if(this.char===CHAR_LSQB)return this.call(this.parseInlineList,this.recordValue);else if(this.char===CHAR_LCUB)return this.call(this.parseInlineTable,this.recordValue);else throw this.error(new TomlError("Unexpected character, expecting string, number, datetime, boolean, inline array or inline table"))}recordValue(e){return this.returnNow(e)}parseInf(){if(this.char===CHAR_n)return this.next(this.parseInf2);throw this.error(new TomlError('Unexpected character, expected "inf", "+inf" or "-inf"'))}parseInf2(){if(this.char===CHAR_f)return"-"===this.state.buf?this.return(-1/0):this.return(1/0);throw this.error(new TomlError('Unexpected character, expected "inf", "+inf" or "-inf"'))}parseNan(){if(this.char===CHAR_a)return this.next(this.parseNan2);throw this.error(new TomlError('Unexpected character, expected "nan"'))}parseNan2(){if(this.char===CHAR_n)return this.return(NaN);throw this.error(new TomlError('Unexpected character, expected "nan"'))}parseKeyword(){return this.char===CHAR_QUOT?this.next(this.parseBasicString):this.char===CHAR_APOS?this.next(this.parseLiteralString):this.goto(this.parseBareKey)}parseBareKey(){do{if(this.char===e.END)throw this.error(new TomlError("Key ended without value"));if(isAlphaNumHyphen(this.char))this.consume();else if(0!==this.state.buf.length)return this.returnNow();else throw this.error(new TomlError("Empty bare keys are not allowed"))}while(this.nextChar())}parseSingleString(){return this.char===CHAR_APOS?this.next(this.parseLiteralMultiStringMaybe):this.goto(this.parseLiteralString)}parseLiteralString(){do{if(this.char===CHAR_APOS)return this.return();if(this.atEndOfLine())throw this.error(new TomlError("Unterminated string"));if(this.char===CHAR_DEL||this.char<=CTRL_CHAR_BOUNDARY&&this.char!==CTRL_I)throw this.errorControlCharIn("strings");else this.consume()}while(this.nextChar())}parseLiteralMultiStringMaybe(){return this.char===CHAR_APOS?this.next(this.parseLiteralMultiString):this.returnNow()}parseLiteralMultiString(){return this.char===CTRL_M?null:this.char===CTRL_J?this.next(this.parseLiteralMultiStringContent):this.goto(this.parseLiteralMultiStringContent)}parseLiteralMultiStringContent(){do{if(this.char===CHAR_APOS)return this.next(this.parseLiteralMultiEnd);if(this.char===e.END)throw this.error(new TomlError("Unterminated multi-line string"));if(this.char===CHAR_DEL||this.char<=CTRL_CHAR_BOUNDARY&&this.char!==CTRL_I&&this.char!==CTRL_J&&this.char!==CTRL_M)throw this.errorControlCharIn("strings");else this.consume()}while(this.nextChar())}parseLiteralMultiEnd(){return this.char===CHAR_APOS?this.next(this.parseLiteralMultiEnd2):(this.state.buf+="'",this.goto(this.parseLiteralMultiStringContent))}parseLiteralMultiEnd2(){return this.char===CHAR_APOS?this.next(this.parseLiteralMultiEnd3):(this.state.buf+="''",this.goto(this.parseLiteralMultiStringContent))}parseLiteralMultiEnd3(){return this.char===CHAR_APOS?(this.state.buf+="'",this.next(this.parseLiteralMultiEnd4)):this.returnNow()}parseLiteralMultiEnd4(){return this.char===CHAR_APOS?(this.state.buf+="'",this.return()):this.returnNow()}parseDoubleString(){return this.char===CHAR_QUOT?this.next(this.parseMultiStringMaybe):this.goto(this.parseBasicString)}parseBasicString(){do{if(this.char===CHAR_BSOL)return this.call(this.parseEscape,this.recordEscapeReplacement);if(this.char===CHAR_QUOT)return this.return();if(this.atEndOfLine())throw this.error(new TomlError("Unterminated string"));else if(this.char===CHAR_DEL||this.char<=CTRL_CHAR_BOUNDARY&&this.char!==CTRL_I)throw this.errorControlCharIn("strings");else this.consume()}while(this.nextChar())}recordEscapeReplacement(e){return this.state.buf+=e,this.goto(this.parseBasicString)}parseMultiStringMaybe(){return this.char===CHAR_QUOT?this.next(this.parseMultiString):this.returnNow()}parseMultiString(){return this.char===CTRL_M?null:this.char===CTRL_J?this.next(this.parseMultiStringContent):this.goto(this.parseMultiStringContent)}parseMultiStringContent(){do{if(this.char===CHAR_BSOL)return this.call(this.parseMultiEscape,this.recordMultiEscapeReplacement);if(this.char===CHAR_QUOT)return this.next(this.parseMultiEnd);if(this.char===e.END)throw this.error(new TomlError("Unterminated multi-line string"));else if(this.char===CHAR_DEL||this.char<=CTRL_CHAR_BOUNDARY&&this.char!==CTRL_I&&this.char!==CTRL_J&&this.char!==CTRL_M)throw this.errorControlCharIn("strings");else this.consume()}while(this.nextChar())}errorControlCharIn(e){let t="\\u00";return this.char<16&&(t+="0"),t+=this.char.toString(16),this.error(new TomlError(`Control characters (codes < 0x1f and 0x7f) are not allowed in ${e}, use ${t} instead`))}recordMultiEscapeReplacement(e){return this.state.buf+=e,this.goto(this.parseMultiStringContent)}parseMultiEnd(){return this.char===CHAR_QUOT?this.next(this.parseMultiEnd2):(this.state.buf+='"',this.goto(this.parseMultiStringContent))}parseMultiEnd2(){return this.char===CHAR_QUOT?this.next(this.parseMultiEnd3):(this.state.buf+='""',this.goto(this.parseMultiStringContent))}parseMultiEnd3(){return this.char===CHAR_QUOT?(this.state.buf+='"',this.next(this.parseMultiEnd4)):this.returnNow()}parseMultiEnd4(){return this.char===CHAR_QUOT?(this.state.buf+='"',this.return()):this.returnNow()}parseMultiEscape(){return this.char===CTRL_M||this.char===CTRL_J?this.next(this.parseMultiTrim):this.char===CHAR_SP||this.char===CTRL_I?this.next(this.parsePreMultiTrim):this.goto(this.parseEscape)}parsePreMultiTrim(){if(this.char===CHAR_SP||this.char===CTRL_I)return null;if(this.char===CTRL_M||this.char===CTRL_J)return this.next(this.parseMultiTrim);throw this.error(new TomlError("Can't escape whitespace"))}parseMultiTrim(){return this.char===CTRL_J||this.char===CHAR_SP||this.char===CTRL_I||this.char===CTRL_M?null:this.returnNow()}parseEscape(){if(this.char in escapes)return this.return(escapes[this.char]);if(this.char===CHAR_u)return this.call(this.parseSmallUnicode,this.parseUnicodeReturn);if(this.char===CHAR_U)return this.call(this.parseLargeUnicode,this.parseUnicodeReturn);throw this.error(new TomlError("Unknown escape character: "+this.char))}parseUnicodeReturn(e){try{let t=parseInt(e,16);if(t>=SURROGATE_FIRST&&t<=SURROGATE_LAST)throw this.error(new TomlError("Invalid unicode, character in range 0xD800 - 0xDFFF is reserved"));return this.returnNow(String.fromCodePoint(t))}catch(n){throw this.error(TomlError.wrap(n))}}parseSmallUnicode(){if(isHexit(this.char)){if(this.consume(),this.state.buf.length>=4)return this.return()}else throw this.error(new TomlError("Invalid character in unicode sequence, expected hex"))}parseLargeUnicode(){if(isHexit(this.char)){if(this.consume(),this.state.buf.length>=8)return this.return()}else throw this.error(new TomlError("Invalid character in unicode sequence, expected hex"))}parseNumberSign(){return this.consume(),this.next(this.parseMaybeSignedInfOrNan)}parseMaybeSignedInfOrNan(){return this.char===CHAR_i?this.next(this.parseInf):this.char===CHAR_n?this.next(this.parseNan):this.callNow(this.parseNoUnder,this.parseNumberIntegerStart)}parseNumberIntegerStart(){return this.char===CHAR_0?(this.consume(),this.next(this.parseNumberIntegerExponentOrDecimal)):this.goto(this.parseNumberInteger)}parseNumberIntegerExponentOrDecimal(){return this.char===CHAR_PERIOD?(this.consume(),this.call(this.parseNoUnder,this.parseNumberFloat)):this.char===CHAR_E||this.char===CHAR_e?(this.consume(),this.next(this.parseNumberExponentSign)):this.returnNow(Integer(this.state.buf))}parseNumberInteger(){if(isDigit(this.char))this.consume();else{if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnder);if(this.char===CHAR_E||this.char===CHAR_e)return this.consume(),this.next(this.parseNumberExponentSign);if(this.char===CHAR_PERIOD)return this.consume(),this.call(this.parseNoUnder,this.parseNumberFloat);let e=Integer(this.state.buf);if(!e.isNaN())return this.returnNow(e);throw this.error(new TomlError("Invalid number"))}}parseNoUnder(){if(this.char===CHAR_LOWBAR||this.char===CHAR_PERIOD||this.char===CHAR_E||this.char===CHAR_e)throw this.error(new TomlError("Unexpected character, expected digit"));if(this.atEndOfWord())throw this.error(new TomlError("Incomplete number"));return this.returnNow()}parseNoUnderHexOctBinLiteral(){if(this.char===CHAR_LOWBAR||this.char===CHAR_PERIOD)throw this.error(new TomlError("Unexpected character, expected digit"));if(this.atEndOfWord())throw this.error(new TomlError("Incomplete number"));return this.returnNow()}parseNumberFloat(){if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnder,this.parseNumberFloat);if(isDigit(this.char))this.consume();else if(this.char===CHAR_E||this.char===CHAR_e)return this.consume(),this.next(this.parseNumberExponentSign);else return this.returnNow(Float(this.state.buf))}parseNumberExponentSign(){if(isDigit(this.char))return this.goto(this.parseNumberExponent);if(this.char===CHAR_HYPHEN||this.char===CHAR_PLUS)this.consume(),this.call(this.parseNoUnder,this.parseNumberExponent);else throw this.error(new TomlError("Unexpected character, expected -, + or digit"))}parseNumberExponent(){if(isDigit(this.char))this.consume();else if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnder);else return this.returnNow(Float(this.state.buf))}parseNumberOrDateTime(){return this.char===CHAR_0?(this.consume(),this.next(this.parseNumberBaseOrDateTime)):this.goto(this.parseNumberOrDateTimeOnly)}parseNumberOrDateTimeOnly(){if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnder,this.parseNumberInteger);if(isDigit(this.char))this.consume(),this.state.buf.length>4&&this.next(this.parseNumberInteger);else if(this.char===CHAR_E||this.char===CHAR_e)return this.consume(),this.next(this.parseNumberExponentSign);else if(this.char===CHAR_PERIOD)return this.consume(),this.call(this.parseNoUnder,this.parseNumberFloat);else if(this.char===CHAR_HYPHEN)return this.goto(this.parseDateTime);else if(this.char===CHAR_COLON)return this.goto(this.parseOnlyTimeHour);else return this.returnNow(Integer(this.state.buf))}parseDateTimeOnly(){if(this.state.buf.length<4){if(isDigit(this.char))return this.consume();if(this.char===CHAR_COLON)return this.goto(this.parseOnlyTimeHour);throw this.error(new TomlError("Expected digit while parsing year part of a date"))}if(this.char===CHAR_HYPHEN)return this.goto(this.parseDateTime);throw this.error(new TomlError("Expected hyphen (-) while parsing year part of date"))}parseNumberBaseOrDateTime(){if(this.char===CHAR_b)return this.consume(),this.call(this.parseNoUnderHexOctBinLiteral,this.parseIntegerBin);if(this.char===CHAR_o)return this.consume(),this.call(this.parseNoUnderHexOctBinLiteral,this.parseIntegerOct);if(this.char===CHAR_x)return this.consume(),this.call(this.parseNoUnderHexOctBinLiteral,this.parseIntegerHex);if(this.char===CHAR_PERIOD)return this.goto(this.parseNumberInteger);if(isDigit(this.char))return this.goto(this.parseDateTimeOnly);else return this.returnNow(Integer(this.state.buf))}parseIntegerHex(){if(isHexit(this.char))this.consume();else{if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnderHexOctBinLiteral);let e=Integer(this.state.buf);if(!e.isNaN())return this.returnNow(e);throw this.error(new TomlError("Invalid number"))}}parseIntegerOct(){if(isOctit(this.char))this.consume();else{if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnderHexOctBinLiteral);let e=Integer(this.state.buf);if(!e.isNaN())return this.returnNow(e);throw this.error(new TomlError("Invalid number"))}}parseIntegerBin(){if(isBit(this.char))this.consume();else{if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnderHexOctBinLiteral);let e=Integer(this.state.buf);if(!e.isNaN())return this.returnNow(e);throw this.error(new TomlError("Invalid number"))}}parseDateTime(){if(this.state.buf.length<4)throw this.error(new TomlError("Years less than 1000 must be zero padded to four characters"));return this.state.result=this.state.buf,this.state.buf="",this.next(this.parseDateMonth)}parseDateMonth(){if(this.char===CHAR_HYPHEN){if(this.state.buf.length<2)throw this.error(new TomlError("Months less than 10 must be zero padded to two characters"));return this.state.result+="-"+this.state.buf,this.state.buf="",this.next(this.parseDateDay)}if(isDigit(this.char))this.consume();else throw this.error(new TomlError("Incomplete datetime"))}parseDateDay(){if(this.char===CHAR_T||this.char===CHAR_SP){if(this.state.buf.length<2)throw this.error(new TomlError("Days less than 10 must be zero padded to two characters"));return this.state.result+="-"+this.state.buf,this.state.buf="",this.next(this.parseStartTimeHour)}if(this.atEndOfWord())return this.returnNow(createDate(this.state.result+"-"+this.state.buf));if(isDigit(this.char))this.consume();else throw this.error(new TomlError("Incomplete datetime"))}parseStartTimeHour(){return this.atEndOfWord()?this.returnNow(createDate(this.state.result)):this.goto(this.parseTimeHour)}parseTimeHour(){if(this.char===CHAR_COLON){if(this.state.buf.length<2)throw this.error(new TomlError("Hours less than 10 must be zero padded to two characters"));return this.state.result+="T"+this.state.buf,this.state.buf="",this.next(this.parseTimeMin)}if(isDigit(this.char))this.consume();else throw this.error(new TomlError("Incomplete datetime"))}parseTimeMin(){if(this.state.buf.length<2&&isDigit(this.char))this.consume();else if(2===this.state.buf.length&&this.char===CHAR_COLON)return this.state.result+=":"+this.state.buf,this.state.buf="",this.next(this.parseTimeSec);else throw this.error(new TomlError("Incomplete datetime"))}parseTimeSec(){if(isDigit(this.char)){if(this.consume(),2===this.state.buf.length)return this.state.result+=":"+this.state.buf,this.state.buf="",this.next(this.parseTimeZoneOrFraction)}else throw this.error(new TomlError("Incomplete datetime"))}parseOnlyTimeHour(){if(this.char===CHAR_COLON){if(this.state.buf.length<2)throw this.error(new TomlError("Hours less than 10 must be zero padded to two characters"));return this.state.result=this.state.buf,this.state.buf="",this.next(this.parseOnlyTimeMin)}throw this.error(new TomlError("Incomplete time"))}parseOnlyTimeMin(){if(this.state.buf.length<2&&isDigit(this.char))this.consume();else if(2===this.state.buf.length&&this.char===CHAR_COLON)return this.state.result+=":"+this.state.buf,this.state.buf="",this.next(this.parseOnlyTimeSec);else throw this.error(new TomlError("Incomplete time"))}parseOnlyTimeSec(){if(isDigit(this.char)){if(this.consume(),2===this.state.buf.length)return this.next(this.parseOnlyTimeFractionMaybe)}else throw this.error(new TomlError("Incomplete time"))}parseOnlyTimeFractionMaybe(){if(this.state.result+=":"+this.state.buf,this.char!==CHAR_PERIOD)return this.return(createTime(this.state.result));this.state.buf="",this.next(this.parseOnlyTimeFraction)}parseOnlyTimeFraction(){if(isDigit(this.char))this.consume();else if(this.atEndOfWord()){if(0===this.state.buf.length)throw this.error(new TomlError("Expected digit in milliseconds"));return this.returnNow(createTime(this.state.result+"."+this.state.buf))}else throw this.error(new TomlError("Unexpected character in datetime, expected period (.), minus (-), plus (+) or Z"))}parseTimeZoneOrFraction(){if(this.char===CHAR_PERIOD)this.consume(),this.next(this.parseDateTimeFraction);else if(this.char===CHAR_HYPHEN||this.char===CHAR_PLUS)this.consume(),this.next(this.parseTimeZoneHour);else if(this.char===CHAR_Z)return this.consume(),this.return(createDateTime(this.state.result+this.state.buf));else if(this.atEndOfWord())return this.returnNow(createDateTimeFloat(this.state.result+this.state.buf));else throw this.error(new TomlError("Unexpected character in datetime, expected period (.), minus (-), plus (+) or Z"))}parseDateTimeFraction(){if(isDigit(this.char))this.consume();else if(1===this.state.buf.length)throw this.error(new TomlError("Expected digit in milliseconds"));else if(this.char===CHAR_HYPHEN||this.char===CHAR_PLUS)this.consume(),this.next(this.parseTimeZoneHour);else if(this.char===CHAR_Z)return this.consume(),this.return(createDateTime(this.state.result+this.state.buf));else if(this.atEndOfWord())return this.returnNow(createDateTimeFloat(this.state.result+this.state.buf));else throw this.error(new TomlError("Unexpected character in datetime, expected period (.), minus (-), plus (+) or Z"))}parseTimeZoneHour(){if(isDigit(this.char)){if(this.consume(),/\d\d$/.test(this.state.buf))return this.next(this.parseTimeZoneSep)}else throw this.error(new TomlError("Unexpected character in datetime, expected digit"))}parseTimeZoneSep(){if(this.char===CHAR_COLON)this.consume(),this.next(this.parseTimeZoneMin);else throw this.error(new TomlError("Unexpected character in datetime, expected colon"))}parseTimeZoneMin(){if(isDigit(this.char)){if(this.consume(),/\d\d$/.test(this.state.buf))return this.return(createDateTime(this.state.result+this.state.buf))}else throw this.error(new TomlError("Unexpected character in datetime, expected digit"))}parseBoolean(){return this.char===CHAR_t?(this.consume(),this.next(this.parseTrue_r)):this.char===CHAR_f?(this.consume(),this.next(this.parseFalse_a)):void 0}parseTrue_r(){if(this.char===CHAR_r)return this.consume(),this.next(this.parseTrue_u);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseTrue_u(){if(this.char===CHAR_u)return this.consume(),this.next(this.parseTrue_e);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseTrue_e(){if(this.char===CHAR_e)return this.return(!0);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseFalse_a(){if(this.char===CHAR_a)return this.consume(),this.next(this.parseFalse_l);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseFalse_l(){if(this.char===CHAR_l)return this.consume(),this.next(this.parseFalse_s);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseFalse_s(){if(this.char===CHAR_s)return this.consume(),this.next(this.parseFalse_e);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseFalse_e(){if(this.char===CHAR_e)return this.return(!1);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseInlineList(){if(this.char===CHAR_SP||this.char===CTRL_I||this.char===CTRL_M||this.char===CTRL_J)return null;if(this.char===e.END)throw this.error(new TomlError("Unterminated inline array"));return this.char===CHAR_NUM?this.call(this.parseComment):this.char===CHAR_RSQB?this.return(this.state.resultArr||InlineList()):this.callNow(this.parseValue,this.recordInlineListValue)}recordInlineListValue(e){return this.state.resultArr||(this.state.resultArr=InlineList(tomlType(e))),isFloat(e)||isInteger(e)?this.state.resultArr.push(e.valueOf()):this.state.resultArr.push(e),this.goto(this.parseInlineListNext)}parseInlineListNext(){if(this.char===CHAR_SP||this.char===CTRL_I||this.char===CTRL_M||this.char===CTRL_J)return null;if(this.char===CHAR_NUM)return this.call(this.parseComment);if(this.char===CHAR_COMMA)return this.next(this.parseInlineList);if(this.char===CHAR_RSQB)return this.goto(this.parseInlineList);throw this.error(new TomlError("Invalid character, expected whitespace, comma (,) or close bracket (])"))}parseInlineTable(){if(this.char===CHAR_SP||this.char===CTRL_I)return null;if(this.char===e.END||this.char===CHAR_NUM||this.char===CTRL_J||this.char===CTRL_M)throw this.error(new TomlError("Unterminated inline array"));return this.char===CHAR_RCUB?this.return(this.state.resultTable||InlineTable()):(this.state.resultTable||(this.state.resultTable=InlineTable()),this.callNow(this.parseAssign,this.recordInlineTableValue))}recordInlineTableValue(e){let t=this.state.resultTable,n=e.key.pop();for(let r of e.key){if(hasKey(t,r)&&(!isTable(t[r])||t[r][_declared]))throw this.error(new TomlError("Can't redefine existing key"));t=t[r]=t[r]||Table()}if(hasKey(t,n))throw this.error(new TomlError("Can't redefine existing key"));return isInteger(e.value)||isFloat(e.value)?t[n]=e.value.valueOf():t[n]=e.value,this.goto(this.parseInlineTableNext)}parseInlineTableNext(){if(this.char===CHAR_SP||this.char===CTRL_I)return null;if(this.char===e.END||this.char===CHAR_NUM||this.char===CTRL_J||this.char===CTRL_M)throw this.error(new TomlError("Unterminated inline array"));if(this.char===CHAR_COMMA)return this.next(this.parseInlineTablePostComma);if(this.char===CHAR_RCUB)return this.goto(this.parseInlineTable);throw this.error(new TomlError("Invalid character, expected whitespace, comma (,) or close bracket (])"))}parseInlineTablePostComma(){if(this.char===CHAR_SP||this.char===CTRL_I)return null;if(this.char===e.END||this.char===CHAR_NUM||this.char===CTRL_J||this.char===CTRL_M)throw this.error(new TomlError("Unterminated inline array"));if(this.char===CHAR_COMMA)throw this.error(new TomlError("Empty elements in inline tables are not permitted"));if(this.char!==CHAR_RCUB)return this.goto(this.parseInlineTable);throw this.error(new TomlError("Trailing commas in inline tables are not permitted"))}}return t}},90560(e,t,n){"use strict";e.exports=a;let r=n(8676),i=n(22418);function a(e,t){t||(t={});let n=0,a=t.blocksize||40960,o=new r;return new Promise((e,t)=>{setImmediate(s,n,a,e,t)});function s(t,n,r,a){if(t>=e.length)try{return r(o.finish())}catch(u){return a(i(u,e))}try{o.parse(e.slice(t,t+n)),setImmediate(s,t+n,n,r,a)}catch(c){a(i(c,e))}}}},22418(e){"use strict";function t(e,t){if(null==e.pos||null==e.line)return e;let n=e.message;if(n+=` at row ${e.line+1}, col ${e.col+1}, pos ${e.pos}: +`,t&&t.split){let r=t.split(/\n/),i=String(Math.min(r.length,e.line+3)).length,a=" ";for(;a.length "+r[o]+"\n",n+=a+" ";for(let u=0;u{let i,a=!1,o=!1;function s(){if(a=!0,!i)try{n(t.finish())}catch(e){r(e)}}function u(e){o=!0,r(e)}function c(){i=!0;let n;for(;null!==(n=e.read());)try{t.parse(n)}catch(r){return u(r)}if(i=!1,a)return s();o||e.once("readable",c)}e.once("end",s),e.once("error",u),c()})}function s(){let e=new i;return new r.Transform({objectMode:!0,transform(t,n,r){try{e.parse(t.toString(n))}catch(i){this.emit("error",i)}r()},flush(t){try{this.push(e.finish())}catch(n){this.emit("error",n)}t()}})}},56530(e,t,n){"use strict";e.exports=a;let r=n(8676),i=n(22418);function a(e){n.g.Buffer&&n.g.Buffer.isBuffer(e)&&(e=e.toString("utf8"));let t=new r;try{return t.parse(e),t.finish()}catch(a){throw i(a,e)}}},83512(e,t,n){"use strict";e.exports=n(56530),e.exports.async=n(90560),e.exports.stream=n(6435),e.exports.prettyError=n(22418)},36921(e){"use strict";function t(e){if(null===e)throw n("null");if(void 0===e)throw n("undefined");if("object"!=typeof e)throw n(typeof e);if("function"==typeof e.toJSON&&(e=e.toJSON()),null==e)return null;let t=u(e);if("table"!==t)throw n(t);return o("","",e)}function n(e){return Error("Can only stringify objects, not "+e)}function r(e){return Object.keys(e).filter(t=>s(e[t]))}function i(e){return Object.keys(e).filter(t=>!s(e[t]))}function a(e){let t=Array.isArray(e)?[]:Object.prototype.hasOwnProperty.call(e,"__proto__")?{["__proto__"]:void 0}:{};for(let n of Object.keys(e))!e[n]||"function"!=typeof e[n].toJSON||"toISOString"in e[n]?t[n]=e[n]:t[n]=e[n].toJSON();return t}function o(e,t,n){let o,s;o=r(n=a(n)),s=i(n);let l=[],f=t||"";o.forEach(e=>{var t=u(n[e]);"undefined"!==t&&"null"!==t&&l.push(f+c(e)+" = "+b(n[e],!0))}),l.length>0&&l.push("");let d=e&&o.length>0?t+" ":"";return s.forEach(t=>{l.push(S(e,d,t,n[t]))}),l.join("\n")}function s(e){switch(u(e)){case"undefined":case"null":case"integer":case"nan":case"float":case"boolean":case"string":case"datetime":return!0;case"array":return 0===e.length||"table"!==u(e[0]);case"table":return 0===Object.keys(e).length;default:return!1}}function u(e){if(void 0===e)return"undefined";if(null===e)return"null";if("bigint"==typeof e||Number.isInteger(e)&&!Object.is(e,-0))return"integer";if("number"==typeof e)return"float";if("boolean"==typeof e)return"boolean";else if("string"==typeof e)return"string";else if("toISOString"in e)return isNaN(e)?"undefined":"datetime";else if(Array.isArray(e))return"array";else return"table"}function c(e){let t=String(e);return/^[-A-Za-z0-9_]+$/.test(t)?t:l(t)}function l(e){return'"'+h(e).replace(/"/g,'\\"')+'"'}function f(e){return"'"+e+"'"}function d(e,t){for(;t.length"\\u"+d(4,e.codePointAt(0).toString(16)))}function p(e){let t=e.split(/\n/).map(e=>h(e).replace(/"(?="")/g,'\\"')).join("\n");return'"'===t.slice(-1)&&(t+="\\\n"),'"""\n'+t+'"""'}function b(e,t){let n=u(e);return"string"===n&&(t&&/\n/.test(e)?n="string-multiline":!/[\b\t\n\f\r']/.test(e)&&/"/.test(e)&&(n="string-literal")),m(e,n)}function m(e,t){switch(t||(t=u(e)),t){case"string-multiline":return p(e);case"string":return l(e);case"string-literal":return f(e);case"integer":return g(e);case"float":return v(e);case"boolean":return y(e);case"datetime":return w(e);case"array":return _(e.filter(e=>"null"!==u(e)&&"undefined"!==u(e)&&"nan"!==u(e)));case"table":return E(e);default:throw n(t)}}function g(e){return String(e).replace(/\B(?=(\d{3})+(?!\d))/g,"_")}function v(e){if(e===1/0)return"inf";if(e===-1/0)return"-inf";if(Object.is(e,NaN))return"nan";if(Object.is(e,-0))return"-0.0";let[t,n]=String(e).split(".");return g(t)+"."+n}function y(e){return String(e)}function w(e){return e.toISOString()}function _(e){e=a(e);let t="[",n=e.map(e=>m(e));return n.join(", ").length>60||/\n/.test(n)?t+="\n "+n.join(",\n ")+"\n":t+=" "+n.join(", ")+(n.length>0?" ":""),t+"]"}function E(e){e=a(e);let t=[];return Object.keys(e).forEach(n=>{t.push(c(n)+" = "+b(e[n],!1))}),"{ "+t.join(", ")+(t.length>0?" ":"")+"}"}function S(e,t,r,i){let a=u(i);if("array"===a)return k(e,t,r,i);if("table"===a)return x(e,t,r,i);throw n(a)}function k(e,t,r,i){i=a(i);let s=u(i[0]);if("table"!==s)throw n(s);let l=e+c(r),f="";return i.forEach(e=>{f.length>0&&(f+="\n"),f+=t+"[["+l+"]]\n",f+=o(l+".",t,e)}),f}function x(e,t,n,i){let a=e+c(n),s="";return r(i).length>0&&(s+=t+"["+a+"]\n"),s+o(a+".",t,i)}e.exports=t,e.exports.value=m},5022(e,t,n){"use strict";t.parse=n(83512),t.stringify=n(36921)},46515(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.styles=void 0;var i=r(n(10434)),a=r(n(38416)),o=r(n(70215)),s=r(n(67294));r(n(45697));var u=r(n(94184)),c=r(n(78252)),l=n(98741),f=r(n(68821)),d=function(e){var t="light"===e.palette.type?e.palette.grey[100]:e.palette.grey[900];return{root:{display:"flex",flexDirection:"column",width:"100%",boxSizing:"border-box",zIndex:e.zIndex.appBar,flexShrink:0},positionFixed:{position:"fixed",top:0,left:"auto",right:0},positionAbsolute:{position:"absolute",top:0,left:"auto",right:0},positionSticky:{position:"sticky",top:0,left:"auto",right:0},positionStatic:{position:"static"},positionRelative:{position:"relative"},colorDefault:{backgroundColor:t,color:e.palette.getContrastText(t)},colorPrimary:{backgroundColor:e.palette.primary.main,color:e.palette.primary.contrastText},colorSecondary:{backgroundColor:e.palette.secondary.main,color:e.palette.secondary.contrastText}}};function h(e){var t,n=e.children,r=e.classes,c=e.className,d=e.color,h=e.position,p=(0,o.default)(e,["children","classes","className","color","position"]),b=(0,u.default)(r.root,r["position".concat((0,l.capitalize)(h))],(t={},(0,a.default)(t,r["color".concat((0,l.capitalize)(d))],"inherit"!==d),(0,a.default)(t,"mui-fixed","fixed"===h),t),c);return s.default.createElement(f.default,(0,i.default)({square:!0,component:"header",elevation:4,className:b},p),n)}t.styles=d,h.defaultProps={color:"primary",position:"fixed"};var p=(0,c.default)(d,{name:"MuiAppBar"})(h);t.default=p},95880(e,t,n){"use strict";var r,i=n(64836);r={value:!0},Object.defineProperty(t,"Z",{enumerable:!0,get:function(){return a.default}});var a=i(n(46515))},68477(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.styles=void 0;var i=r(n(38416)),a=r(n(10434)),o=r(n(70215)),s=r(n(67294));r(n(45697));var u=r(n(94184));n(55252);var c=r(n(78252)),l=function(e){return{root:{position:"relative",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,width:40,height:40,fontFamily:e.typography.fontFamily,fontSize:e.typography.pxToRem(20),borderRadius:"50%",overflow:"hidden",userSelect:"none"},colorDefault:{color:e.palette.background.default,backgroundColor:"light"===e.palette.type?e.palette.grey[400]:e.palette.grey[600]},img:{width:"100%",height:"100%",textAlign:"center",objectFit:"cover"}}};function f(e){var t=e.alt,n=e.children,r=e.childrenClassName,c=e.classes,l=e.className,f=e.component,d=e.imgProps,h=e.sizes,p=e.src,b=e.srcSet,m=(0,o.default)(e,["alt","children","childrenClassName","classes","className","component","imgProps","sizes","src","srcSet"]),g=null,v=p||b;return g=v?s.default.createElement("img",(0,a.default)({alt:t,src:p,srcSet:b,sizes:h,className:c.img},d)):r&&s.default.isValidElement(n)?s.default.cloneElement(n,{className:(0,u.default)(r,n.props.className)}):n,s.default.createElement(f,(0,a.default)({className:(0,u.default)(c.root,c.system,(0,i.default)({},c.colorDefault,!v),l)},m),g)}t.styles=l,f.defaultProps={component:"div"};var d=(0,c.default)(l,{name:"MuiAvatar"})(f);t.default=d},90338(e,t,n){"use strict";var r,i=n(64836);r={value:!0},Object.defineProperty(t,"Z",{enumerable:!0,get:function(){return a.default}});var a=i(n(68477))},9211(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.styles=void 0;var i=r(n(10434)),a=r(n(38416)),o=r(n(70215)),s=r(n(67294));r(n(45697));var u=r(n(94184)),c=r(n(78252)),l=r(n(46408)),f={root:{zIndex:-1,position:"fixed",right:0,bottom:0,top:0,left:0,backgroundColor:"rgba(0, 0, 0, 0.5)",WebkitTapHighlightColor:"transparent",touchAction:"none"},invisible:{backgroundColor:"transparent"}};function d(e){var t=e.classes,n=e.className,r=e.invisible,c=e.open,f=e.transitionDuration,d=(0,o.default)(e,["classes","className","invisible","open","transitionDuration"]);return s.default.createElement(l.default,(0,i.default)({in:c,timeout:f},d),s.default.createElement("div",{className:(0,u.default)(t.root,(0,a.default)({},t.invisible,r),n),"aria-hidden":"true"}))}t.styles=f,d.defaultProps={invisible:!1};var h=(0,c.default)(f,{name:"MuiBackdrop"})(d);t.default=h},14983(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return i.default}});var i=r(n(9211))},84732(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.styles=void 0;var i=r(n(10434)),a=r(n(38416)),o=r(n(70215)),s=r(n(67294));r(n(45697));var u=r(n(94184));n(55252);var c=r(n(78252)),l=n(98741),f=10,d=function(e){return{root:{position:"relative",display:"inline-flex",verticalAlign:"middle"},badge:{display:"flex",flexDirection:"row",flexWrap:"wrap",justifyContent:"center",alignContent:"center",alignItems:"center",position:"absolute",top:0,right:0,boxSizing:"border-box",fontFamily:e.typography.fontFamily,fontWeight:e.typography.fontWeightMedium,fontSize:e.typography.pxToRem(12),minWidth:2*f,padding:"0 4px",height:2*f,borderRadius:f,backgroundColor:e.palette.color,color:e.palette.textColor,zIndex:1,transform:"scale(1) translate(50%, -50%)",transformOrigin:"100% 0%",transition:e.transitions.create("transform",{easing:e.transitions.easing.easeInOut,duration:e.transitions.duration.enteringScreen})},colorPrimary:{backgroundColor:e.palette.primary.main,color:e.palette.primary.contrastText},colorSecondary:{backgroundColor:e.palette.secondary.main,color:e.palette.secondary.contrastText},colorError:{backgroundColor:e.palette.error.main,color:e.palette.error.contrastText},invisible:{transition:e.transitions.create("transform",{easing:e.transitions.easing.easeInOut,duration:e.transitions.duration.leavingScreen}),transform:"scale(0) translate(50%, -50%)",transformOrigin:"100% 0%"},dot:{height:6,minWidth:6,padding:0}}};function h(e){var t,n=e.badgeContent,r=e.children,c=e.classes,f=e.className,d=e.color,h=e.component,p=e.invisible,b=e.showZero,m=e.max,g=e.variant,v=(0,o.default)(e,["badgeContent","children","classes","className","color","component","invisible","showZero","max","variant"]),y=p;null!=p||0!==Number(n)||b||(y=!0);var w=(0,u.default)(c.badge,(t={},(0,a.default)(t,c["color".concat((0,l.capitalize)(d))],"default"!==d),(0,a.default)(t,c.invisible,y),(0,a.default)(t,c.dot,"dot"===g),t)),_="";return"dot"!==g&&(_=n>m?"".concat(m,"+"):n),s.default.createElement(h,(0,i.default)({className:(0,u.default)(c.root,f)},v),r,s.default.createElement("span",{className:w},_))}t.styles=d,h.defaultProps={color:"default",component:"span",max:99,showZero:!1,variant:"standard"};var p=(0,c.default)(d,{name:"MuiBadge"})(h);t.default=p},70398(e,t,n){"use strict";var r,i=n(64836);r={value:!0},Object.defineProperty(t,"Z",{enumerable:!0,get:function(){return a.default}});var a=i(n(84732))},21783(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.styles=void 0;var i=r(n(38416)),a=r(n(70215)),o=r(n(10434)),s=r(n(67294));r(n(45697));var u=r(n(94184));n(55252);var c=r(n(78252)),l=n(59114),f=r(n(16070)),d=n(98741),h=function(e){return{root:(0,o.default)({lineHeight:1.75},e.typography.button,{boxSizing:"border-box",minWidth:64,padding:"6px 16px",borderRadius:e.shape.borderRadius,color:e.palette.text.primary,transition:e.transitions.create(["background-color","box-shadow","border"],{duration:e.transitions.duration.short}),"&:hover":{textDecoration:"none",backgroundColor:(0,l.fade)(e.palette.text.primary,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"},"&$disabled":{backgroundColor:"transparent"}},"&$disabled":{color:e.palette.action.disabled}}),label:{width:"100%",display:"inherit",alignItems:"inherit",justifyContent:"inherit"},text:{padding:"6px 8px"},textPrimary:{color:e.palette.primary.main,"&:hover":{backgroundColor:(0,l.fade)(e.palette.primary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},textSecondary:{color:e.palette.secondary.main,"&:hover":{backgroundColor:(0,l.fade)(e.palette.secondary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},flat:{},flatPrimary:{},flatSecondary:{},outlined:{padding:"5px 16px",border:"1px solid ".concat("light"===e.palette.type?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)"),"&$disabled":{border:"1px solid ".concat(e.palette.action.disabled)}},outlinedPrimary:{color:e.palette.primary.main,border:"1px solid ".concat((0,l.fade)(e.palette.primary.main,.5)),"&:hover":{border:"1px solid ".concat(e.palette.primary.main),backgroundColor:(0,l.fade)(e.palette.primary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},outlinedSecondary:{color:e.palette.secondary.main,border:"1px solid ".concat((0,l.fade)(e.palette.secondary.main,.5)),"&:hover":{border:"1px solid ".concat(e.palette.secondary.main),backgroundColor:(0,l.fade)(e.palette.secondary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},"&$disabled":{border:"1px solid ".concat(e.palette.action.disabled)}},contained:{color:e.palette.getContrastText(e.palette.grey[300]),backgroundColor:e.palette.grey[300],boxShadow:e.shadows[2],"&$focusVisible":{boxShadow:e.shadows[6]},"&:active":{boxShadow:e.shadows[8]},"&$disabled":{color:e.palette.action.disabled,boxShadow:e.shadows[0],backgroundColor:e.palette.action.disabledBackground},"&:hover":{backgroundColor:e.palette.grey.A100,"@media (hover: none)":{backgroundColor:e.palette.grey[300]},"&$disabled":{backgroundColor:e.palette.action.disabledBackground}}},containedPrimary:{color:e.palette.primary.contrastText,backgroundColor:e.palette.primary.main,"&:hover":{backgroundColor:e.palette.primary.dark,"@media (hover: none)":{backgroundColor:e.palette.primary.main}}},containedSecondary:{color:e.palette.secondary.contrastText,backgroundColor:e.palette.secondary.main,"&:hover":{backgroundColor:e.palette.secondary.dark,"@media (hover: none)":{backgroundColor:e.palette.secondary.main}}},raised:{},raisedPrimary:{},raisedSecondary:{},fab:{borderRadius:"50%",padding:0,minWidth:0,width:56,height:56,boxShadow:e.shadows[6],"&:active":{boxShadow:e.shadows[12]}},extendedFab:{borderRadius:24,padding:"0 16px",width:"auto",minWidth:48,height:48},focusVisible:{},disabled:{},colorInherit:{color:"inherit",borderColor:"currentColor"},mini:{width:40,height:40},sizeSmall:{padding:"4px 8px",minWidth:64,fontSize:e.typography.pxToRem(13)},sizeLarge:{padding:"8px 24px",fontSize:e.typography.pxToRem(15)},fullWidth:{width:"100%"}}};function p(e){var t,n=e.children,r=e.classes,c=e.className,l=e.color,h=e.disabled,p=e.disableFocusRipple,b=e.focusVisibleClassName,m=e.fullWidth,g=e.mini,v=e.size,y=e.variant,w=(0,a.default)(e,["children","classes","className","color","disabled","disableFocusRipple","focusVisibleClassName","fullWidth","mini","size","variant"]),_="fab"===y||"extendedFab"===y,E="contained"===y||"raised"===y,S="text"===y||"flat"===y,k=(0,u.default)(r.root,(t={},(0,i.default)(t,r.fab,_),(0,i.default)(t,r.mini,_&&g),(0,i.default)(t,r.extendedFab,"extendedFab"===y),(0,i.default)(t,r.text,S),(0,i.default)(t,r.textPrimary,S&&"primary"===l),(0,i.default)(t,r.textSecondary,S&&"secondary"===l),(0,i.default)(t,r.flat,S),(0,i.default)(t,r.flatPrimary,S&&"primary"===l),(0,i.default)(t,r.flatSecondary,S&&"secondary"===l),(0,i.default)(t,r.contained,E||_),(0,i.default)(t,r.containedPrimary,(E||_)&&"primary"===l),(0,i.default)(t,r.containedSecondary,(E||_)&&"secondary"===l),(0,i.default)(t,r.raised,E||_),(0,i.default)(t,r.raisedPrimary,(E||_)&&"primary"===l),(0,i.default)(t,r.raisedSecondary,(E||_)&&"secondary"===l),(0,i.default)(t,r.outlined,"outlined"===y),(0,i.default)(t,r.outlinedPrimary,"outlined"===y&&"primary"===l),(0,i.default)(t,r.outlinedSecondary,"outlined"===y&&"secondary"===l),(0,i.default)(t,r["size".concat((0,d.capitalize)(v))],"medium"!==v),(0,i.default)(t,r.disabled,h),(0,i.default)(t,r.fullWidth,m),(0,i.default)(t,r.colorInherit,"inherit"===l),t),c);return s.default.createElement(f.default,(0,o.default)({className:k,disabled:h,focusRipple:!p,focusVisibleClassName:(0,u.default)(r.focusVisible,b)},w),s.default.createElement("span",{className:r.label},n))}t.styles=h,p.defaultProps={color:"default",component:"button",disabled:!1,disableFocusRipple:!1,fullWidth:!1,mini:!1,size:"medium",type:"button",variant:"text"};var b=(0,c.default)(h,{name:"MuiButton"})(p);t.default=b},83638(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return i.default}});var i=r(n(21783))},74610(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.styles=void 0;var i=r(n(10434)),a=r(n(38416)),o=r(n(70215)),s=r(n(56690)),u=r(n(89728)),c=r(n(94993)),l=r(n(73808)),f=r(n(61655)),d=r(n(66115)),h=r(n(67294));r(n(45697));var p=r(n(73935)),b=r(n(94184));n(55252);var m=r(n(62614)),g=r(n(78252)),v=r(n(78582)),y=n(32252),w=r(n(65406)),_=r(n(83673)),E={root:{display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:"none",border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle","-moz-appearance":"none","-webkit-appearance":"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},"&$disabled":{pointerEvents:"none",cursor:"default"}},disabled:{},focusVisible:{}};t.styles=E;var S=function(e){function t(){(0,s.default)(this,t);for(var e,n,r=arguments.length,i=Array(r),a=0;a0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=arguments.length>2?arguments[2]:void 0,u=o.pulsate,c=void 0!==u&&u,l=o.center,f=void 0===l?n.props.center||o.pulsate:l,h=o.fakeElement,b=void 0!==h&&h;if("mousedown"===a.type&&n.ignoringMouseDown){n.ignoringMouseDown=!1;return}"touchstart"===a.type&&(n.ignoringMouseDown=!0);var m=b?null:p.default.findDOMNode((0,d.default)((0,d.default)(n))),g=m?m.getBoundingClientRect():{width:0,height:0,left:0,top:0};if(!f&&(0!==a.clientX||0!==a.clientY)&&(a.clientX||a.touches)){var v=a.clientX?a.clientX:a.touches[0].clientX,y=a.clientY?a.clientY:a.touches[0].clientY;t=Math.round(v-g.left),r=Math.round(y-g.top)}else t=Math.round(g.width/2),r=Math.round(g.height/2);if(f)(i=Math.sqrt((2*Math.pow(g.width,2)+Math.pow(g.height,2))/3))%2==0&&(i+=1);else{i=Math.sqrt(Math.pow(2*Math.max(Math.abs((m?m.clientWidth:0)-t),t)+2,2)+Math.pow(2*Math.max(Math.abs((m?m.clientHeight:0)-r),r)+2,2))}a.touches?(n.startTimerCommit=function(){n.startCommit({pulsate:c,rippleX:t,rippleY:r,rippleSize:i,cb:s})},n.startTimer=setTimeout(function(){n.startTimerCommit&&(n.startTimerCommit(),n.startTimerCommit=null)},w)):n.startCommit({pulsate:c,rippleX:t,rippleY:r,rippleSize:i,cb:s})},n.startCommit=function(e){var t=e.pulsate,r=e.rippleX,i=e.rippleY,a=e.rippleSize,s=e.cb;n.setState(function(e){return{nextKey:e.nextKey+1,ripples:[].concat((0,o.default)(e.ripples),[h.default.createElement(v.default,{key:e.nextKey,classes:n.props.classes,timeout:{exit:y,enter:y},pulsate:t,rippleX:r,rippleY:i,rippleSize:a})])}},s)},n.stop=function(e,t){clearTimeout(n.startTimer);var r=n.state.ripples;if("touchend"===e.type&&n.startTimerCommit){e.persist(),n.startTimerCommit(),n.startTimerCommit=null,n.startTimer=setTimeout(function(){n.stop(e,t)});return}n.startTimerCommit=null,r&&r.length&&n.setState({ripples:r.slice(1)},t)},n}return(0,f.default)(t,e),(0,u.default)(t,[{key:"componentWillUnmount",value:function(){clearTimeout(this.startTimer)}},{key:"render",value:function(){var e=this.props,t=(e.center,e.classes),n=e.className,r=(0,a.default)(e,["center","classes","className"]);return h.default.createElement(b.default,(0,i.default)({component:"span",enter:!0,exit:!0,className:(0,m.default)(t.root,n)},r),this.state.ripples)}}]),t}(h.default.PureComponent);E.defaultProps={center:!1};var S=(0,g.default)(_,{flip:!1,name:"MuiTouchRipple"})(E);t.default=S},83673(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=function(e,t,n,r){return function(i){r&&r.call(e,i);var a=!1;return i.defaultPrevented&&(a=!0),e.props.disableTouchRipple&&"Blur"!==t&&(a=!0),!a&&e.ripple&&e.ripple[n](i),"function"==typeof e.props["on".concat(t)]&&e.props["on".concat(t)](i),!0}};"undefined"==typeof window&&(n=function(){return function(){}});var r=n;t.default=r},32252(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.detectFocusVisible=s,t.listenForFocusKeys=f,r(n(42473));var i=r(n(16143)),a={focusKeyPressed:!1,keyUpEventTimeout:-1};function o(e){for(var t=e.activeElement;t&&t.shadowRoot&&t.shadowRoot.activeElement;)t=t.shadowRoot.activeElement;return t}function s(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;e.focusVisibleTimeout=setTimeout(function(){var u=(0,i.default)(t),c=o(u);a.focusKeyPressed&&(c===t||t.contains(c))?n():r-1}var l=function(e){c(e)&&(a.focusKeyPressed=!0,clearTimeout(a.keyUpEventTimeout),a.keyUpEventTimeout=setTimeout(function(){a.focusKeyPressed=!1},500))};function f(e){e.addEventListener("keyup",l)}},16070(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return i.default}});var i=r(n(74610))},46003(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.styles=void 0;var i=r(n(10434)),a=r(n(70215)),o=r(n(67294));r(n(45697));var s=r(n(94184)),u=r(n(68821)),c=r(n(78252)),l={root:{overflow:"hidden"}};function f(e){var t=e.classes,n=e.className,r=e.raised,c=(0,a.default)(e,["classes","className","raised"]);return o.default.createElement(u.default,(0,i.default)({className:(0,s.default)(t.root,n),elevation:r?8:1},c))}t.styles=l,f.defaultProps={raised:!1};var d=(0,c.default)(l,{name:"MuiCard"})(f);t.default=d},82204(e,t,n){"use strict";var r,i=n(64836);r={value:!0},Object.defineProperty(t,"Z",{enumerable:!0,get:function(){return a.default}});var a=i(n(46003))},5780(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.styles=void 0;var i=r(n(10434)),a=r(n(70215)),o=r(n(67294));r(n(45697));var s=r(n(94184));n(55252);var u=r(n(78252)),c={root:{padding:16,"&:last-child":{paddingBottom:24}}};function l(e){var t=e.classes,n=e.className,r=e.component,u=(0,a.default)(e,["classes","className","component"]);return o.default.createElement(r,(0,i.default)({className:(0,s.default)(t.root,n)},u))}t.styles=c,l.defaultProps={component:"div"};var f=(0,u.default)(c,{name:"MuiCardContent"})(l);t.default=f},30060(e,t,n){"use strict";var r,i=n(64836);r={value:!0},Object.defineProperty(t,"Z",{enumerable:!0,get:function(){return a.default}});var a=i(n(5780))},50704(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.styles=void 0;var i=r(n(10434)),a=r(n(70215)),o=r(n(67294));r(n(45697));var s=r(n(94184));n(55252);var u=r(n(78252)),c=r(n(71426)),l={root:{display:"flex",alignItems:"center",padding:16},avatar:{flex:"0 0 auto",marginRight:16},action:{flex:"0 0 auto",alignSelf:"flex-start",marginTop:-8,marginRight:-8},content:{flex:"1 1 auto"},title:{},subheader:{}};function f(e){var t=e.action,n=e.avatar,r=e.classes,u=e.className,l=e.component,f=e.disableTypography,d=e.subheader,h=e.subheaderTypographyProps,p=e.title,b=e.titleTypographyProps,m=(0,a.default)(e,["action","avatar","classes","className","component","disableTypography","subheader","subheaderTypographyProps","title","titleTypographyProps"]),g=p;null==g||g.type===c.default||f||(g=o.default.createElement(c.default,(0,i.default)({variant:n?"body2":"headline",internalDeprecatedVariant:!0,className:r.title,component:"span"},b),g));var v=d;return null==v||v.type===c.default||f||(v=o.default.createElement(c.default,(0,i.default)({variant:n?"body2":"body1",className:r.subheader,color:"textSecondary",component:"span"},h),v)),o.default.createElement(l,(0,i.default)({className:(0,s.default)(r.root,u)},m),n&&o.default.createElement("div",{className:r.avatar},n),o.default.createElement("div",{className:r.content},g,v),t&&o.default.createElement("div",{className:r.action},t))}t.styles=l,f.defaultProps={component:"div",disableTypography:!1};var d=(0,u.default)(l,{name:"MuiCardHeader"})(f);t.default=d},52658(e,t,n){"use strict";var r,i=n(64836);r={value:!0},Object.defineProperty(t,"Z",{enumerable:!0,get:function(){return a.default}});var a=i(n(50704))},82811(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.styles=void 0;var i=r(n(10434)),a=r(n(38416)),o=r(n(70215)),s=r(n(67294));r(n(45697));var u=r(n(94184)),c=r(n(85609)),l=r(n(42159)),f=r(n(41549)),d=r(n(61486)),h=n(98741),p=r(n(78252)),b=function(e){return{root:{color:e.palette.text.secondary},checked:{},disabled:{},indeterminate:{},colorPrimary:{"&$checked":{color:e.palette.primary.main},"&$disabled":{color:e.palette.action.disabled}},colorSecondary:{"&$checked":{color:e.palette.secondary.main},"&$disabled":{color:e.palette.action.disabled}}}};function m(e){var t=e.checkedIcon,n=e.classes,r=e.className,l=e.color,f=e.icon,d=e.indeterminate,p=e.indeterminateIcon,b=e.inputProps,m=(0,o.default)(e,["checkedIcon","classes","className","color","icon","indeterminate","indeterminateIcon","inputProps"]);return s.default.createElement(c.default,(0,i.default)({type:"checkbox",checkedIcon:d?p:t,className:(0,u.default)((0,a.default)({},n.indeterminate,d),r),classes:{root:(0,u.default)(n.root,n["color".concat((0,h.capitalize)(l))]),checked:n.checked,disabled:n.disabled},inputProps:(0,i.default)({"data-indeterminate":d},b),icon:d?p:f},m))}t.styles=b,m.defaultProps={checkedIcon:s.default.createElement(f.default,null),color:"secondary",icon:s.default.createElement(l.default,null),indeterminate:!1,indeterminateIcon:s.default.createElement(d.default,null)};var g=(0,p.default)(b,{name:"MuiCheckbox"})(m);t.default=g},71209(e,t,n){"use strict";var r,i=n(64836);r={value:!0},Object.defineProperty(t,"Z",{enumerable:!0,get:function(){return a.default}});var a=i(n(82811))},16444(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.styles=void 0;var i=r(n(10434)),a=r(n(38416)),o=r(n(70215)),s=r(n(56690)),u=r(n(89728)),c=r(n(94993)),l=r(n(73808)),f=r(n(61655)),d=r(n(67294));r(n(45697));var h=r(n(94184));r(n(42473)),n(55252);var p=r(n(99781)),b=r(n(78252)),m=n(59114);r(n(21677));var g=n(98741);n(68477);var v=function(e){var t=32,n="light"===e.palette.type?e.palette.grey[300]:e.palette.grey[700],r=(0,m.fade)(e.palette.text.primary,.26);return{root:{fontFamily:e.typography.fontFamily,fontSize:e.typography.pxToRem(13),display:"inline-flex",alignItems:"center",justifyContent:"center",height:t,color:e.palette.getContrastText(n),backgroundColor:n,borderRadius:t/2,whiteSpace:"nowrap",transition:e.transitions.create(["background-color","box-shadow"]),cursor:"default",outline:"none",textDecoration:"none",border:"none",padding:0,verticalAlign:"middle",boxSizing:"border-box"},colorPrimary:{backgroundColor:e.palette.primary.main,color:e.palette.primary.contrastText},colorSecondary:{backgroundColor:e.palette.secondary.main,color:e.palette.secondary.contrastText},clickable:{WebkitTapHighlightColor:"transparent",cursor:"pointer","&:hover, &:focus":{backgroundColor:(0,m.emphasize)(n,.08)},"&:active":{boxShadow:e.shadows[1],backgroundColor:(0,m.emphasize)(n,.12)}},clickableColorPrimary:{"&:hover, &:focus":{backgroundColor:(0,m.emphasize)(e.palette.primary.main,.08)},"&:active":{backgroundColor:(0,m.emphasize)(e.palette.primary.main,.12)}},clickableColorSecondary:{"&:hover, &:focus":{backgroundColor:(0,m.emphasize)(e.palette.secondary.main,.08)},"&:active":{backgroundColor:(0,m.emphasize)(e.palette.secondary.main,.12)}},deletable:{"&:focus":{backgroundColor:(0,m.emphasize)(n,.08)}},deletableColorPrimary:{"&:focus":{backgroundColor:(0,m.emphasize)(e.palette.primary.main,.2)}},deletableColorSecondary:{"&:focus":{backgroundColor:(0,m.emphasize)(e.palette.secondary.main,.2)}},outlined:{backgroundColor:"transparent",border:"1px solid ".concat("light"===e.palette.type?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)"),"$clickable&:hover, $clickable&:focus, $deletable&:focus":{backgroundColor:(0,m.fade)(e.palette.text.primary,e.palette.action.hoverOpacity)},"& $avatar":{marginLeft:-1}},outlinedPrimary:{color:e.palette.primary.main,border:"1px solid ".concat(e.palette.primary.main),"$clickable&:hover, $clickable&:focus, $deletable&:focus":{backgroundColor:(0,m.fade)(e.palette.primary.main,e.palette.action.hoverOpacity)}},outlinedSecondary:{color:e.palette.secondary.main,border:"1px solid ".concat(e.palette.secondary.main),"$clickable&:hover, $clickable&:focus, $deletable&:focus":{backgroundColor:(0,m.fade)(e.palette.secondary.main,e.palette.action.hoverOpacity)}},avatar:{marginRight:-4,width:t,height:t,color:"light"===e.palette.type?e.palette.grey[700]:e.palette.grey[300],fontSize:e.typography.pxToRem(16)},avatarColorPrimary:{color:e.palette.primary.contrastText,backgroundColor:e.palette.primary.dark},avatarColorSecondary:{color:e.palette.secondary.contrastText,backgroundColor:e.palette.secondary.dark},avatarChildren:{width:19,height:19},icon:{color:"light"===e.palette.type?e.palette.grey[700]:e.palette.grey[300],marginLeft:4,marginRight:-8},iconColorPrimary:{color:"inherit"},iconColorSecondary:{color:"inherit"},label:{display:"flex",alignItems:"center",paddingLeft:12,paddingRight:12,userSelect:"none",whiteSpace:"nowrap",cursor:"inherit"},deleteIcon:{WebkitTapHighlightColor:"transparent",color:r,cursor:"pointer",height:"auto",margin:"0 4px 0 -8px","&:hover":{color:(0,m.fade)(r,.4)}},deleteIconColorPrimary:{color:(0,m.fade)(e.palette.primary.contrastText,.7),"&:hover, &:active":{color:e.palette.primary.contrastText}},deleteIconColorSecondary:{color:(0,m.fade)(e.palette.secondary.contrastText,.7),"&:hover, &:active":{color:e.palette.secondary.contrastText}},deleteIconOutlinedColorPrimary:{color:(0,m.fade)(e.palette.primary.main,.7),"&:hover, &:active":{color:e.palette.primary.main}},deleteIconOutlinedColorSecondary:{color:(0,m.fade)(e.palette.secondary.main,.7),"&:hover, &:active":{color:e.palette.secondary.main}}}};t.styles=v;var y=function(e){function t(){(0,s.default)(this,t);for(var e,n,r=arguments.length,i=Array(r),a=0;a :last-child":{paddingRight:32},"&$expanded":{margin:"20px 0"}},expandIcon:{position:"absolute",top:"50%",right:8,transform:"translateY(-50%) rotate(0deg)",transition:e.transitions.create("transform",t),"&:hover":{backgroundColor:"transparent"},"&$expanded":{transform:"translateY(-50%) rotate(180deg)"}}}};t.styles=g;var v=function(e){function t(){(0,s.default)(this,t);for(var e,n,r=arguments.length,i=Array(r),a=0;a $item":{padding:e/2}})}),n}var b=function(e){return(0,o.default)({container:{boxSizing:"border-box",display:"flex",flexWrap:"wrap",width:"100%"},item:{boxSizing:"border-box",margin:"0"},zeroMinWidth:{minWidth:0},"direction-xs-column":{flexDirection:"column"},"direction-xs-column-reverse":{flexDirection:"column-reverse"},"direction-xs-row-reverse":{flexDirection:"row-reverse"},"wrap-xs-nowrap":{flexWrap:"nowrap"},"wrap-xs-wrap-reverse":{flexWrap:"wrap-reverse"},"align-items-xs-center":{alignItems:"center"},"align-items-xs-flex-start":{alignItems:"flex-start"},"align-items-xs-flex-end":{alignItems:"flex-end"},"align-items-xs-baseline":{alignItems:"baseline"},"align-content-xs-center":{alignContent:"center"},"align-content-xs-flex-start":{alignContent:"flex-start"},"align-content-xs-flex-end":{alignContent:"flex-end"},"align-content-xs-space-between":{alignContent:"space-between"},"align-content-xs-space-around":{alignContent:"space-around"},"justify-xs-center":{justifyContent:"center"},"justify-xs-flex-end":{justifyContent:"flex-end"},"justify-xs-space-between":{justifyContent:"space-between"},"justify-xs-space-around":{justifyContent:"space-around"},"justify-xs-space-evenly":{justifyContent:"space-evenly"}},p(e,"xs"),l.keys.reduce(function(t,n){return h(t,e,n),t},{}))};function m(e){var t,n=e.alignContent,r=e.alignItems,c=e.classes,l=e.className,f=e.component,d=e.container,h=e.direction,p=e.item,b=e.justify,g=e.lg,v=e.md,y=e.sm,w=e.spacing,_=e.wrap,E=e.xl,S=e.xs,k=e.zeroMinWidth,x=(0,a.default)(e,["alignContent","alignItems","classes","className","component","container","direction","item","justify","lg","md","sm","spacing","wrap","xl","xs","zeroMinWidth"]),T=(0,u.default)((t={},(0,i.default)(t,c.container,d),(0,i.default)(t,c.item,p),(0,i.default)(t,c.zeroMinWidth,k),(0,i.default)(t,c["spacing-xs-".concat(String(w))],d&&0!==w),(0,i.default)(t,c["direction-xs-".concat(String(h))],h!==m.defaultProps.direction),(0,i.default)(t,c["wrap-xs-".concat(String(_))],_!==m.defaultProps.wrap),(0,i.default)(t,c["align-items-xs-".concat(String(r))],r!==m.defaultProps.alignItems),(0,i.default)(t,c["align-content-xs-".concat(String(n))],n!==m.defaultProps.alignContent),(0,i.default)(t,c["justify-xs-".concat(String(b))],b!==m.defaultProps.justify),(0,i.default)(t,c["grid-xs-".concat(String(S))],!1!==S),(0,i.default)(t,c["grid-sm-".concat(String(y))],!1!==y),(0,i.default)(t,c["grid-md-".concat(String(v))],!1!==v),(0,i.default)(t,c["grid-lg-".concat(String(g))],!1!==g),(0,i.default)(t,c["grid-xl-".concat(String(E))],!1!==E),t),l);return s.default.createElement(f,(0,o.default)({className:T},x))}t.styles=b,m.defaultProps={alignContent:"stretch",alignItems:"stretch",component:"div",container:!1,direction:"row",item:!1,justify:"flex-start",lg:!1,md:!1,sm:!1,spacing:0,wrap:"wrap",xl:!1,xs:!1,zeroMinWidth:!1};var g,v=(0,c.default)(b,{name:"MuiGrid"})(m);t.default=v},39814(e,t,n){"use strict";var r,i=n(64836);r={value:!0},Object.defineProperty(t,"Z",{enumerable:!0,get:function(){return a.default}});var a=i(n(27973))},57205(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(10434)),a=r(n(70215)),o=r(n(56690)),s=r(n(89728)),u=r(n(94993)),c=r(n(73808)),l=r(n(61655)),f=r(n(67294));r(n(45697));var d=r(n(60644)),h=r(n(82313)),p=n(41929);function b(e){return"scale(".concat(e,", ").concat(Math.pow(e,2),")")}var m={entering:{opacity:1,transform:b(1)},entered:{opacity:1,transform:"".concat(b(1)," translateZ(0)")}},g=function(e){function t(){(0,o.default)(this,t);for(var e,n,r=arguments.length,i=Array(r),a=0;a=Number(e.rows)&&(n=Math.min(Number(e.rowsMax)*t,n)),n=Math.max(n,t),Math.abs(this.state.height-n)>1&&this.setState({height:n}))}}},{key:"render",value:function(){var e=this.props,t=e.classes,n=e.className,r=e.defaultValue,o=(e.onChange,e.rows),s=(e.rowsMax,e.style),u=(e.textareaRef,e.value),c=(0,a.default)(e,["classes","className","defaultValue","onChange","rows","rowsMax","style","textareaRef","value"]);return f.default.createElement("div",{className:t.root},f.default.createElement(p.default,{target:"window",onResize:this.handleResize}),f.default.createElement("textarea",{"aria-hidden":"true",className:(0,d.default)(t.textarea,t.shadow),readOnly:!0,ref:this.handleRefSinglelineShadow,rows:"1",tabIndex:-1,value:""}),f.default.createElement("textarea",{"aria-hidden":"true",className:(0,d.default)(t.textarea,t.shadow),defaultValue:r,readOnly:!0,ref:this.handleRefShadow,rows:o,tabIndex:-1,value:u}),f.default.createElement("textarea",(0,i.default)({rows:o,className:(0,d.default)(t.textarea,n),defaultValue:r,value:u,onChange:this.handleChange,ref:this.handleRefInput,style:(0,i.default)({height:this.state.height},s)},c)))}}]),t}(f.default.Component);y.defaultProps={rows:1};var w=(0,b.default)(v,{name:"MuiPrivateTextarea"})(y);t.default=w},67598(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return i.default}});var i=r(n(62010))},78586(e,t){"use strict";function n(e){return null!=e&&!(Array.isArray(e)&&0===e.length)}function r(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return e&&(n(e.value)&&""!==e.value||t&&n(e.defaultValue)&&""!==e.defaultValue)}function i(e){return e.startAdornment}Object.defineProperty(t,"__esModule",{value:!0}),t.hasValue=n,t.isFilled=r,t.isAdornedStart=i},56030(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.styles=void 0;var i=r(n(10434)),a=r(n(38416)),o=r(n(70215)),s=r(n(67294));r(n(45697));var u=r(n(94184)),c=r(n(58189)),l=r(n(52598)),f=r(n(78252)),d=r(n(69645)),h=function(e){return{root:{transformOrigin:"top left"},focused:{},disabled:{},error:{},required:{},formControl:{position:"absolute",left:0,top:0,transform:"translate(0, 24px) scale(1)"},marginDense:{transform:"translate(0, 21px) scale(1)"},shrink:{transform:"translate(0, 1.5px) scale(0.75)",transformOrigin:"top left"},animated:{transition:e.transitions.create(["color","transform"],{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut})},filled:{zIndex:1,pointerEvents:"none",transform:"translate(12px, 20px) scale(1)","&$marginDense":{transform:"translate(12px, 17px) scale(1)"},"&$shrink":{transform:"translate(12px, 10px) scale(0.75)","&$marginDense":{transform:"translate(12px, 7px) scale(0.75)"}}},outlined:{zIndex:1,pointerEvents:"none",transform:"translate(14px, 20px) scale(1)","&$marginDense":{transform:"translate(14px, 17px) scale(1)"},"&$shrink":{transform:"translate(14px, -6px) scale(0.75)"}}}};function p(e){var t,n=e.children,r=e.classes,l=e.className,f=e.disableAnimation,h=e.FormLabelClasses,p=(e.margin,e.muiFormControl),b=e.shrink,m=(e.variant,(0,o.default)(e,["children","classes","className","disableAnimation","FormLabelClasses","margin","muiFormControl","shrink","variant"])),g=b;void 0===g&&p&&(g=p.filled||p.focused||p.adornedStart);var v=(0,c.default)({props:e,muiFormControl:p,states:["margin","variant"]}),y=(0,u.default)(r.root,(t={},(0,a.default)(t,r.formControl,p),(0,a.default)(t,r.animated,!f),(0,a.default)(t,r.shrink,g),(0,a.default)(t,r.marginDense,"dense"===v.margin),(0,a.default)(t,r.filled,"filled"===v.variant),(0,a.default)(t,r.outlined,"outlined"===v.variant),t),l);return s.default.createElement(d.default,(0,i.default)({"data-shrink":g,className:y,classes:(0,i.default)({focused:r.focused,disabled:r.disabled,error:r.error,required:r.required},h)},m),n)}t.styles=h,p.defaultProps={disableAnimation:!1};var b=(0,f.default)(h,{name:"MuiInputLabel"})((0,l.default)(p));t.default=b},23153(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return i.default}});var i=r(n(56030))},46616(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.styles=void 0;var i=r(n(10434)),a=r(n(38416)),o=r(n(70215)),s=r(n(67294));r(n(45697));var u=r(n(94184));r(n(42473));var c=r(n(78252)),l=n(59114),f=4,d=function(e){return{root:{position:"relative",overflow:"hidden",height:4},colorPrimary:{backgroundColor:(0,l.lighten)(e.palette.primary.light,.6)},colorSecondary:{backgroundColor:(0,l.lighten)(e.palette.secondary.light,.4)},determinate:{},indeterminate:{},buffer:{backgroundColor:"transparent"},query:{transform:"rotate(180deg)"},dashed:{position:"absolute",marginTop:0,height:"100%",width:"100%",animation:"buffer 3s infinite linear",animationName:"$buffer"},dashedColorPrimary:{backgroundImage:"radial-gradient(".concat((0,l.lighten)(e.palette.primary.light,.6)," 0%, ").concat((0,l.lighten)(e.palette.primary.light,.6)," 16%, transparent 42%)"),backgroundSize:"10px 10px",backgroundPosition:"0px -23px"},dashedColorSecondary:{backgroundImage:"radial-gradient(".concat((0,l.lighten)(e.palette.secondary.light,.4)," 0%, ").concat((0,l.lighten)(e.palette.secondary.light,.6)," 16%, transparent 42%)"),backgroundSize:"10px 10px",backgroundPosition:"0px -23px"},bar:{width:"100%",position:"absolute",left:0,bottom:0,top:0,transition:"transform 0.2s linear",transformOrigin:"left"},barColorPrimary:{backgroundColor:e.palette.primary.main},barColorSecondary:{backgroundColor:e.palette.secondary.main},bar1Indeterminate:{width:"auto",animation:"mui-indeterminate1 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite",animationName:"$mui-indeterminate1"},bar1Determinate:{transition:"transform .".concat(f,"s linear")},bar1Buffer:{zIndex:1,transition:"transform .".concat(f,"s linear")},bar2Indeterminate:{width:"auto",animation:"mui-indeterminate2 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) infinite",animationName:"$mui-indeterminate2",animationDelay:"1.15s"},bar2Buffer:{transition:"transform .".concat(f,"s linear")},"@keyframes mui-indeterminate1":{"0%":{left:"-35%",right:"100%"},"60%":{left:"100%",right:"-90%"},"100%":{left:"100%",right:"-90%"}},"@keyframes mui-indeterminate2":{"0%":{left:"-200%",right:"100%"},"60%":{left:"107%",right:"-8%"},"100%":{left:"107%",right:"-8%"}},"@keyframes buffer":{"0%":{opacity:1,backgroundPosition:"0px -23px"},"50%":{opacity:0,backgroundPosition:"0px -23px"},"100%":{opacity:1,backgroundPosition:"-200px -23px"}}}};function h(e){var t,n,r,c,l=e.classes,f=e.className,d=e.color,h=e.value,p=e.valueBuffer,b=e.variant,m=(0,o.default)(e,["classes","className","color","value","valueBuffer","variant"]),g=(0,u.default)(l.root,(t={},(0,a.default)(t,l.colorPrimary,"primary"===d),(0,a.default)(t,l.colorSecondary,"secondary"===d),(0,a.default)(t,l.determinate,"determinate"===b),(0,a.default)(t,l.indeterminate,"indeterminate"===b),(0,a.default)(t,l.buffer,"buffer"===b),(0,a.default)(t,l.query,"query"===b),t),f),v=(0,u.default)(l.dashed,(n={},(0,a.default)(n,l.dashedColorPrimary,"primary"===d),(0,a.default)(n,l.dashedColorSecondary,"secondary"===d),n)),y=(0,u.default)(l.bar,(r={},(0,a.default)(r,l.barColorPrimary,"primary"===d),(0,a.default)(r,l.barColorSecondary,"secondary"===d),(0,a.default)(r,l.bar1Indeterminate,"indeterminate"===b||"query"===b),(0,a.default)(r,l.bar1Determinate,"determinate"===b),(0,a.default)(r,l.bar1Buffer,"buffer"===b),r)),w=(0,u.default)(l.bar,(c={},(0,a.default)(c,l.barColorPrimary,"primary"===d&&"buffer"!==b),(0,a.default)(c,l.colorPrimary,"primary"===d&&"buffer"===b),(0,a.default)(c,l.barColorSecondary,"secondary"===d&&"buffer"!==b),(0,a.default)(c,l.colorSecondary,"secondary"===d&&"buffer"===b),(0,a.default)(c,l.bar2Indeterminate,"indeterminate"===b||"query"===b),(0,a.default)(c,l.bar2Buffer,"buffer"===b),c)),_={},E={bar1:{},bar2:{}};return("determinate"===b||"buffer"===b)&&void 0!==h&&(_["aria-valuenow"]=Math.round(h),E.bar1.transform="scaleX(".concat(h/100,")")),"buffer"===b&&void 0!==p&&(E.bar2.transform="scaleX(".concat((p||0)/100,")")),s.default.createElement("div",(0,i.default)({className:g,role:"progressbar"},_,m),"buffer"===b?s.default.createElement("div",{className:v}):null,s.default.createElement("div",{className:y,style:E.bar1}),"determinate"===b?null:s.default.createElement("div",{className:w,style:E.bar2}))}t.styles=d,h.defaultProps={color:"primary",variant:"indeterminate"};var p=(0,c.default)(d,{name:"MuiLinearProgress"})(h);t.default=p},79424(e,t,n){"use strict";var r,i=n(64836);r={value:!0},Object.defineProperty(t,"Z",{enumerable:!0,get:function(){return a.default}});var a=i(n(46616))},74080(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.styles=void 0;var i=r(n(10434)),a=r(n(38416)),o=r(n(70215)),s=r(n(67294));r(n(45697));var u=r(n(94184));n(55252);var c=r(n(78252)),l=r(n(47457)),f={root:{listStyle:"none",margin:0,padding:0,position:"relative"},padding:{paddingTop:8,paddingBottom:8},dense:{paddingTop:4,paddingBottom:4},subheader:{paddingTop:0}};function d(e){var t,n=e.children,r=e.classes,c=e.className,f=e.component,d=e.dense,h=e.disablePadding,p=e.subheader,b=(0,o.default)(e,["children","classes","className","component","dense","disablePadding","subheader"]);return s.default.createElement(f,(0,i.default)({className:(0,u.default)(r.root,(t={},(0,a.default)(t,r.dense,d&&!h),(0,a.default)(t,r.padding,!h),(0,a.default)(t,r.subheader,p),t),c)},b),s.default.createElement(l.default.Provider,{value:{dense:d}},p,n))}t.styles=f,d.defaultProps={component:"ul",dense:!1,disablePadding:!1};var h=(0,c.default)(f,{name:"MuiList"})(d);t.default=h},47457(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(67294)).default.createContext({});t.default=i},3022(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return i.default}});var i=r(n(74080))},29936(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.styles=void 0;var i=r(n(10434)),a=r(n(38416)),o=r(n(70215)),s=r(n(67294));r(n(45697));var u=r(n(94184));n(55252);var c=r(n(78252)),l=r(n(16070)),f=n(44370),d=r(n(671)),h=function(e){return{root:{display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",width:"100%",boxSizing:"border-box",textAlign:"left",paddingTop:11,paddingBottom:11,"&$selected, &$selected:hover, &$selected:focus":{backgroundColor:e.palette.action.selected}},container:{position:"relative"},focusVisible:{},default:{},dense:{paddingTop:8,paddingBottom:8},alignItemsFlexStart:{alignItems:"flex-start"},disabled:{opacity:.5},divider:{borderBottom:"1px solid ".concat(e.palette.divider),backgroundClip:"padding-box"},gutters:{paddingLeft:16,paddingRight:16},button:{transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest}),"&:hover":{textDecoration:"none",backgroundColor:e.palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},"&:focus":{backgroundColor:e.palette.action.hover}},secondaryAction:{paddingRight:32},selected:{}}};function p(e){var t=e.alignItems,n=e.button,r=e.children,c=e.classes,h=e.className,p=e.component,b=e.ContainerComponent,m=e.ContainerProps,g=(m=void 0===m?{}:m).className,v=(0,o.default)(m,["className"]),y=e.dense,w=e.disabled,_=e.disableGutters,E=e.divider,S=e.focusVisibleClassName,k=e.selected,x=(0,o.default)(e,["alignItems","button","children","classes","className","component","ContainerComponent","ContainerProps","dense","disabled","disableGutters","divider","focusVisibleClassName","selected"]);return s.default.createElement(d.default,{dense:y,alignItems:t},function(e){var o,d=e.dense,m=s.default.Children.toArray(r),y=m.some(function(e){return(0,f.isMuiElement)(e,["ListItemAvatar"])}),T=m.length&&(0,f.isMuiElement)(m[m.length-1],["ListItemSecondaryAction"]),M=(0,u.default)(c.root,c.default,(o={},(0,a.default)(o,c.dense,d||y),(0,a.default)(o,c.gutters,!_),(0,a.default)(o,c.divider,E),(0,a.default)(o,c.disabled,w),(0,a.default)(o,c.button,n),(0,a.default)(o,c.alignItemsFlexStart,"flex-start"===t),(0,a.default)(o,c.secondaryAction,T),(0,a.default)(o,c.selected,k),o),h),O=(0,i.default)({className:M,disabled:w},x),A=p||"li";return(n&&(O.component=p||"div",O.focusVisibleClassName=(0,u.default)(c.focusVisible,S),A=l.default),T)?(A=O.component||p?A:"div","li"===b&&("li"===A?A="div":"li"===O.component&&(O.component="div")),s.default.createElement(b,(0,i.default)({className:(0,u.default)(c.container,g)},v),s.default.createElement(A,O,m),m.pop())):s.default.createElement(A,O,m)})}t.styles=h,p.defaultProps={alignItems:"center",button:!1,ContainerComponent:"li",dense:!1,disabled:!1,disableGutters:!1,divider:!1,selected:!1};var b=(0,c.default)(h,{name:"MuiListItem"})(p);t.default=b},671(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(67294));r(n(45697));var a=r(n(47457));function o(e){var t=e.alignItems,n=e.children,r=e.dense;return i.default.createElement(a.default.Consumer,null,function(e){var o={dense:r||e.dense||!1,alignItems:t};return i.default.createElement(a.default.Provider,{value:o},n(o))})}var s=o;t.default=s},60323(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return i.default}});var i=r(n(29936))},69394(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.styles=void 0;var i=r(n(10434)),a=r(n(70215)),o=r(n(67294));r(n(45697));var s=r(n(94184)),u=r(n(78252)),c=function(e){return{root:{marginRight:16,color:e.palette.action.active,flexShrink:0,display:"inline-flex"}}};function l(e){var t=e.children,n=e.classes,r=e.className,u=(0,a.default)(e,["children","classes","className"]);return o.default.createElement("div",(0,i.default)({className:(0,s.default)(n.root,r)},u),t)}t.styles=c;var f=(0,u.default)(c,{name:"MuiListItemIcon"})(l);t.default=f},11186(e,t,n){"use strict";var r,i=n(64836);r={value:!0},Object.defineProperty(t,"Z",{enumerable:!0,get:function(){return a.default}});var a=i(n(69394))},73390(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.styles=void 0;var i=r(n(10434)),a=r(n(38416)),o=r(n(70215)),s=r(n(67294));r(n(45697));var u=r(n(94184)),c=r(n(78252)),l=r(n(71426)),f=r(n(47457)),d=function(e){return{root:{flex:"1 1 auto",minWidth:0,padding:"0 16px","&:first-child":{paddingLeft:0}},inset:{"&:first-child":{paddingLeft:56}},dense:{fontSize:e.typography.pxToRem(13)},primary:{"&$textDense":{fontSize:"inherit"}},secondary:{"&$textDense":{fontSize:"inherit"}},textDense:{}}};function h(e){var t=e.children,n=e.classes,r=e.className,c=e.disableTypography,d=e.inset,h=e.primary,p=e.primaryTypographyProps,b=e.secondary,m=e.secondaryTypographyProps,g=e.theme,v=(0,o.default)(e,["children","classes","className","disableTypography","inset","primary","primaryTypographyProps","secondary","secondaryTypographyProps","theme"]);return s.default.createElement(f.default.Consumer,null,function(e){var o,f=e.dense,y=null!=h?h:t;null==y||y.type===l.default||c||(y=s.default.createElement(l.default,(0,i.default)({variant:g.typography.useNextVariants?"body1":"subheading",className:(0,u.default)(n.primary,(0,a.default)({},n.textDense,f)),component:"span"},p),y));var w=b;return null==w||w.type===l.default||c||(w=s.default.createElement(l.default,(0,i.default)({className:(0,u.default)(n.secondary,(0,a.default)({},n.textDense,f)),color:"textSecondary"},m),w)),s.default.createElement("div",(0,i.default)({className:(0,u.default)(n.root,(o={},(0,a.default)(o,n.dense,f),(0,a.default)(o,n.inset,d),o),r)},v),y,w)})}t.styles=d,h.defaultProps={disableTypography:!1,inset:!1};var p=(0,c.default)(d,{name:"MuiListItemText",withTheme:!0})(h);t.default=p},87591(e,t,n){"use strict";var r,i=n(64836);r={value:!0},Object.defineProperty(t,"Z",{enumerable:!0,get:function(){return a.default}});var a=i(n(73390))},95890(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.styles=void 0;var i=r(n(10434)),a=r(n(70215)),o=r(n(56690)),s=r(n(89728)),u=r(n(94993)),c=r(n(73808)),l=r(n(61655)),f=r(n(67294));r(n(45697));var d=r(n(73935)),h=r(n(44825)),p=r(n(78252)),b=r(n(50810)),m=r(n(34980)),g={vertical:"top",horizontal:"right"},v={vertical:"top",horizontal:"left"},y={paper:{maxHeight:"calc(100% - 96px)",WebkitOverflowScrolling:"touch"}};t.styles=y;var w=function(e){function t(){(0,o.default)(this,t);for(var e,n,r=arguments.length,i=Array(r),a=0;a=0?t.children[e].focus():t.firstChild.focus())}},{key:"resetTabIndex",value:function(){for(var e=this.listRef,t=(0,h.default)(e).activeElement,n=[],r=0;r0&&void 0!==arguments[0]?arguments[0]:{};(0,i.default)(this,e);var n=t.hideSiblingNodes,r=void 0===n||n,a=t.handleContainerOverflow,o=void 0===a||a;this.hideSiblingNodes=r,this.handleContainerOverflow=o,this.modals=[],this.data=[]}return(0,a.default)(e,[{key:"add",value:function(e,t){var n=this.modals.indexOf(e);if(-1!==n)return n;n=this.modals.length,this.modals.push(e),e.modalRef&&(0,l.ariaHidden)(e.modalRef,!1),this.hideSiblingNodes&&(0,l.ariaHiddenSiblings)(t,e.mountNode,e.modalRef,!0);var r=f(this.data,function(e){return e.container===t});if(-1!==r)return this.data[r].modals.push(e),n;var i={modals:[e],container:t,overflowing:(0,c.default)(t),prevPaddings:[]};return this.data.push(i),n}},{key:"mount",value:function(e){var t=f(this.data,function(t){return -1!==t.modals.indexOf(e)}),n=this.data[t];!n.style&&this.handleContainerOverflow&&h(n)}},{key:"remove",value:function(e){var t=this.modals.indexOf(e);if(-1===t)return t;var n=f(this.data,function(t){return -1!==t.modals.indexOf(e)}),r=this.data[n];if(r.modals.splice(r.modals.indexOf(e),1),this.modals.splice(t,1),0===r.modals.length)this.handleContainerOverflow&&p(r),e.modalRef&&(0,l.ariaHidden)(e.modalRef,!0),this.hideSiblingNodes&&(0,l.ariaHiddenSiblings)(r.container,e.mountNode,e.modalRef,!1),this.data.splice(n,1);else if(this.hideSiblingNodes){var i=r.modals[r.modals.length-1];i.modalRef&&(0,l.ariaHidden)(i.modalRef,!1)}return t}},{key:"isTopModal",value:function(e){return!!this.modals.length&&this.modals[this.modals.length-1]===e}}]),e}();t.default=b},55536(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(t,"ModalManager",{enumerable:!0,get:function(){return a.default}});var i=r(n(58228)),a=r(n(2158))},16575(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.isBody=s,t.default=u;var i=r(n(7624)),a=r(n(16143)),o=r(n(62614));function s(e){return e&&"body"===e.tagName.toLowerCase()}function u(e){var t=(0,a.default)(e),n=(0,o.default)(t);if(!(0,i.default)(t)&&!s(e))return e.scrollHeight>e.clientHeight;var r=n.getComputedStyle(t.body),u=parseInt(r.getPropertyValue("margin-left"),10),c=parseInt(r.getPropertyValue("margin-right"),10);return u+t.body.clientWidth+c0?.75*r+8:0;return s.default.createElement("fieldset",(0,a.default)({"aria-hidden":!0,style:(0,a.default)((0,i.default)({},"padding".concat((0,l.capitalize)(p)),8+(c?0:b/2)),f),className:(0,u.default)(t.root,n)},h),s.default.createElement("legend",{className:t.legend,style:{width:c?b:.01}},s.default.createElement("span",{dangerouslySetInnerHTML:{__html:"​"}})))}t.styles=f;var h=(0,c.withStyles)(f,{name:"MuiPrivateNotchedOutline",withTheme:!0})(d);t.default=h},96405(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.styles=void 0;var i=r(n(10434)),a=r(n(70215)),o=r(n(67294));r(n(45697));var s=r(n(94184));n(55252);var u=r(n(67598)),c=r(n(21142)),l=r(n(78252)),f=function(e){var t="light"===e.palette.type?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{root:{position:"relative","& $notchedOutline":{borderColor:t},"&:hover:not($disabled):not($focused):not($error) $notchedOutline":{borderColor:e.palette.text.primary,"@media (hover: none)":{borderColor:t}},"&$focused $notchedOutline":{borderColor:e.palette.primary.main,borderWidth:2},"&$error $notchedOutline":{borderColor:e.palette.error.main},"&$disabled $notchedOutline":{borderColor:e.palette.action.disabled}},focused:{},disabled:{},adornedStart:{paddingLeft:14},adornedEnd:{paddingRight:14},error:{},multiline:{padding:"18.5px 14px",boxSizing:"border-box"},notchedOutline:{},input:{padding:"18.5px 14px"},inputMarginDense:{paddingTop:15,paddingBottom:15},inputMultiline:{padding:0},inputAdornedStart:{paddingLeft:0},inputAdornedEnd:{paddingRight:0}}};function d(e){var t=e.classes,n=e.labelWidth,r=e.notched,l=(0,a.default)(e,["classes","labelWidth","notched"]);return o.default.createElement(u.default,(0,i.default)({renderPrefix:function(e){return o.default.createElement(c.default,{className:t.notchedOutline,labelWidth:n,notched:void 0!==r?r:Boolean(e.startAdornment||e.filled||e.focused)})},classes:(0,i.default)({},t,{root:(0,s.default)(t.root,t.underline),notchedOutline:null})},l))}t.styles=f,u.default.defaultProps={fullWidth:!1,inputComponent:"input",multiline:!1,type:"text"},d.muiName="Input";var h=(0,l.default)(f,{name:"MuiOutlinedInput"})(d);t.default=h},59537(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return i.default}});var i=r(n(96405))},30083(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.styles=void 0;var i=r(n(38416)),a=r(n(70215)),o=r(n(10434)),s=r(n(67294));r(n(45697));var u=r(n(94184));r(n(42473)),n(55252);var c=r(n(78252)),l=function(e){var t={};return e.shadows.forEach(function(e,n){t["elevation".concat(n)]={boxShadow:e}}),(0,o.default)({root:{backgroundColor:e.palette.background.paper},rounded:{borderRadius:e.shape.borderRadius}},t)};function f(e){var t=e.classes,n=e.className,r=e.component,c=e.square,l=e.elevation,f=(0,a.default)(e,["classes","className","component","square","elevation"]),d=(0,u.default)(t.root,t["elevation".concat(l)],(0,i.default)({},t.rounded,!c),n);return s.default.createElement(r,(0,o.default)({className:d},f))}t.styles=l,f.defaultProps={component:"div",elevation:2,square:!1};var d=(0,c.default)(l,{name:"MuiPaper"})(f);t.default=d},68821(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return i.default}});var i=r(n(30083))},64224(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.styles=void 0;var i=r(n(10434)),a=r(n(70215)),o=r(n(56690)),s=r(n(89728)),u=r(n(94993)),c=r(n(73808)),l=r(n(61655)),f=r(n(67294));r(n(45697));var d=r(n(73935));r(n(42473));var h=r(n(20296)),p=r(n(96421));n(55252);var b=r(n(16143)),m=r(n(62614)),g=n(98741),v=r(n(78252)),y=r(n(55536)),w=r(n(261)),_=r(n(68821));function E(e,t){var n=0;return"number"==typeof t?n=t:"center"===t?n=e.height/2:"bottom"===t&&(n=e.height),n}function S(e,t){var n=0;return"number"==typeof t?n=t:"center"===t?n=e.width/2:"right"===t&&(n=e.width),n}function k(e){return[e.horizontal,e.vertical].map(function(e){return"number"==typeof e?"".concat(e,"px"):e}).join(" ")}function x(e,t){for(var n=t,r=0;n&&n!==e;)r+=(n=n.parentNode).scrollTop;return r}function T(e){return"function"==typeof e?e():e}var M={paper:{position:"absolute",overflowY:"auto",overflowX:"hidden",minWidth:16,minHeight:16,maxWidth:"calc(100% - 32px)",maxHeight:"calc(100% - 32px)",outline:"none"}};t.styles=M;var O=function(e){function t(){var e;return(0,o.default)(this,t),(e=(0,u.default)(this,(0,c.default)(t).call(this))).handleGetOffsetTop=E,e.handleGetOffsetLeft=S,e.componentWillUnmount=function(){e.handleResize.clear()},e.setPositioningStyles=function(t){var n=e.getPositioningStyle(t);null!==n.top&&(t.style.top=n.top),null!==n.left&&(t.style.left=n.left),t.style.transformOrigin=n.transformOrigin},e.getPositioningStyle=function(t){var n=e.props,r=n.anchorEl,i=n.anchorReference,a=n.marginThreshold,o=e.getContentAnchorOffset(t),s={width:t.offsetWidth,height:t.offsetHeight},u=e.getTransformOrigin(s,o);if("none"===i)return{top:null,left:null,transformOrigin:k(u)};var c=e.getAnchorOffset(o),l=c.top-u.vertical,f=c.left-u.horizontal,d=l+s.height,h=f+s.width,p=(0,m.default)(T(r)),b=p.innerHeight-a,g=p.innerWidth-a;if(lb){var y=d-b;l-=y,u.vertical+=y}if(fg){var _=h-g;f-=_,u.horizontal+=_}return{top:"".concat(l,"px"),left:"".concat(f,"px"),transformOrigin:k(u)}},e.handleEntering=function(t){e.props.onEntering&&e.props.onEntering(t),e.setPositioningStyles(t)},"undefined"!=typeof window&&(e.handleResize=(0,h.default)(function(){e.props.open&&e.setPositioningStyles(e.paperRef)},166)),e}return(0,l.default)(t,e),(0,s.default)(t,[{key:"componentDidMount",value:function(){this.props.action&&this.props.action({updatePosition:this.handleResize})}},{key:"getAnchorOffset",value:function(e){var t=this.props,n=t.anchorEl,r=t.anchorOrigin,i=t.anchorReference,a=t.anchorPosition;if("anchorPosition"===i)return a;var o=(T(n)||(0,b.default)(this.paperRef).body).getBoundingClientRect(),s=0===e?r.vertical:"center";return{top:o.top+this.handleGetOffsetTop(o,s),left:o.left+this.handleGetOffsetLeft(o,r.horizontal)}}},{key:"getContentAnchorOffset",value:function(e){var t=this.props,n=t.getContentAnchorEl,r=t.anchorReference,i=0;if(n&&"anchorEl"===r){var a=n(e);if(a&&e.contains(a)){var o=x(e,a);i=a.offsetTop+a.clientHeight/2-o||0}}return i}},{key:"getTransformOrigin",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.props.transformOrigin;return{vertical:this.handleGetOffsetTop(e,n.vertical)+t,horizontal:this.handleGetOffsetLeft(e,n.horizontal)}}},{key:"render",value:function(){var e=this,t=this.props,n=(t.action,t.anchorEl),r=(t.anchorOrigin,t.anchorPosition,t.anchorReference,t.children),o=t.classes,s=t.container,u=t.elevation,c=(t.getContentAnchorEl,t.marginThreshold,t.ModalClasses),l=t.onEnter,h=t.onEntered,m=(t.onEntering,t.onExit),v=t.onExited,w=t.onExiting,E=t.open,S=t.PaperProps,k=t.role,x=(t.transformOrigin,t.TransitionComponent),M=t.transitionDuration,O=t.TransitionProps,A=void 0===O?{}:O,L=(0,a.default)(t,["action","anchorEl","anchorOrigin","anchorPosition","anchorReference","children","classes","container","elevation","getContentAnchorEl","marginThreshold","ModalClasses","onEnter","onEntered","onEntering","onExit","onExited","onExiting","open","PaperProps","role","transformOrigin","TransitionComponent","transitionDuration","TransitionProps"]),C=M;"auto"!==M||x.muiSupportAuto||(C=void 0);var I=s||(n?(0,b.default)(T(n)).body:void 0);return f.default.createElement(y.default,(0,i.default)({classes:c,container:I,open:E,BackdropProps:{invisible:!0}},L),f.default.createElement(x,(0,i.default)({appear:!0,in:E,onEnter:l,onEntered:h,onExit:m,onExited:v,onExiting:w,role:k,timeout:C},A,{onEntering:(0,g.createChainedFunction)(this.handleEntering,A.onEntering)}),f.default.createElement(_.default,(0,i.default)({className:o.paper,elevation:u,ref:function(t){e.paperRef=d.default.findDOMNode(t)}},S),f.default.createElement(p.default,{target:"window",onResize:this.handleResize}),r)))}}]),t}(f.default.Component);O.defaultProps={anchorReference:"anchorEl",anchorOrigin:{vertical:"top",horizontal:"left"},elevation:8,marginThreshold:16,transformOrigin:{vertical:"top",horizontal:"left"},TransitionComponent:w.default,transitionDuration:"auto"};var A=(0,v.default)(M,{name:"MuiPopover"})(O);t.default=A},50810(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return i.default}});var i=r(n(64224))},24693(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(70215)),a=r(n(10434)),o=r(n(56690)),s=r(n(89728)),u=r(n(94993)),c=r(n(73808)),l=r(n(61655)),f=r(n(66115)),d=r(n(67294)),h=r(n(73935));r(n(45697));var p=r(n(28981)),b=r(n(25649));function m(e){if("rtl"!==("undefined"!=typeof window&&document.body.getAttribute("dir")||"ltr"))return e;switch(e){case"bottom-end":return"bottom-start";case"bottom-start":return"bottom-end";case"top-end":return"top-start";case"top-start":return"top-end";default:return e}}function g(e){return"function"==typeof e?e():e}var v=function(e){function t(e){var n;return(0,o.default)(this,t),(n=(0,u.default)(this,(0,c.default)(t).call(this))).handleOpen=function(){var e=n.props,t=e.anchorEl,r=e.modifiers,i=e.open,o=e.placement,s=e.popperOptions,u=void 0===s?{}:s,c=e.disablePortal,l=h.default.findDOMNode((0,f.default)((0,f.default)(n)));l&&t&&i&&(n.popper&&(n.popper.destroy(),n.popper=null),n.popper=new p.default(g(t),l,(0,a.default)({placement:m(o)},u,{modifiers:(0,a.default)({},c?{}:{preventOverflow:{boundariesElement:"window"}},r,u.modifiers),onCreate:n.handlePopperUpdate,onUpdate:n.handlePopperUpdate})))},n.handlePopperUpdate=function(e){e.placement!==n.state.placement&&n.setState({placement:e.placement})},n.handleExited=function(){n.setState({exited:!0}),n.handleClose()},n.handleClose=function(){n.popper&&(n.popper.destroy(),n.popper=null)},n.state={exited:!e.open},n}return(0,l.default)(t,e),(0,s.default)(t,[{key:"componentDidUpdate",value:function(e){e.open===this.props.open||this.props.open||this.props.transition||this.handleClose(),(e.open!==this.props.open||e.anchorEl!==this.props.anchorEl||e.popperOptions!==this.props.popperOptions||e.modifiers!==this.props.modifiers||e.disablePortal!==this.props.disablePortal||e.placement!==this.props.placement)&&this.handleOpen()}},{key:"componentWillUnmount",value:function(){this.handleClose()}},{key:"render",value:function(){var e=this.props,t=(e.anchorEl,e.children),n=e.container,r=e.disablePortal,o=e.keepMounted,s=(e.modifiers,e.open),u=e.placement,c=(e.popperOptions,e.transition),l=(0,i.default)(e,["anchorEl","children","container","disablePortal","keepMounted","modifiers","open","placement","popperOptions","transition"]),f=this.state,h=f.exited,p=f.placement;if(!o&&!s&&(!c||h))return null;var g={placement:p||m(u)};return c&&(g.TransitionProps={in:s,onExited:this.handleExited}),d.default.createElement(b.default,{onRendered:this.handleOpen,disablePortal:r,container:n},d.default.createElement("div",(0,a.default)({role:"tooltip",style:{position:"absolute"}},l),"function"==typeof t?t(g):t))}}],[{key:"getDerivedStateFromProps",value:function(e){return e.open?{exited:!1}:e.transition?null:{exited:!0}}}]),t}(d.default.Component);v.defaultProps={disablePortal:!1,placement:"bottom",transition:!1};var y=v;t.default=y},60111(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return i.default}});var i=r(n(24693))},92261(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(56690)),a=r(n(89728)),o=r(n(94993)),s=r(n(73808)),u=r(n(61655)),c=r(n(67294)),l=r(n(73935));r(n(45697));var f=r(n(16143));function d(e,t){return e="function"==typeof e?e():e,l.default.findDOMNode(e)||t}function h(e){return(0,f.default)(l.default.findDOMNode(e))}n(55252);var p=function(e){function t(){(0,i.default)(this,t);for(var e,n,r=arguments.length,a=Array(r),u=0;u1;n.state.labelWrapped!==e&&n.setState({labelWrapped:e})}},n}return(0,c.default)(t,e),(0,o.default)(t,[{key:"componentDidMount",value:function(){this.checkTextWrap()}},{key:"componentDidUpdate",value:function(e,t){this.state.labelWrapped===t.labelWrapped&&this.checkTextWrap()}},{key:"render",value:function(){var e,t,n=this,r=this.props,a=r.classes,o=r.className,s=r.disabled,u=r.fullWidth,c=r.icon,p=r.indicator,g=r.label,v=(r.onChange,r.selected),y=r.textColor,w=(r.value,(0,i.default)(r,["classes","className","disabled","fullWidth","icon","indicator","label","onChange","selected","textColor","value"]));return void 0!==g&&(e=d.default.createElement("span",{className:a.labelContainer},d.default.createElement("span",{className:(0,h.default)(a.label,(0,l.default)({},a.labelWrapped,this.state.labelWrapped)),ref:function(e){n.labelRef=e}},g))),d.default.createElement(b.default,(0,f.default)({focusRipple:!0,className:(0,h.default)(a.root,a["textColor".concat((0,m.capitalize)(y))],(t={},(0,l.default)(t,a.disabled,s),(0,l.default)(t,a.selected,v),(0,l.default)(t,a.labelIcon,c&&e),(0,l.default)(t,a.fullWidth,u),t),o),role:"tab","aria-selected":v,disabled:s},w,{onClick:this.handleChange}),d.default.createElement("span",{className:a.wrapper},c,e),p)}}]),t}(d.default.Component);v.defaultProps={disabled:!1,textColor:"inherit"};var y=(0,p.default)(g,{name:"MuiTab"})(v);t.default=y},75759(e,t,n){"use strict";var r,i=n(64836);r={value:!0},Object.defineProperty(t,"Z",{enumerable:!0,get:function(){return a.default}});var a=i(n(70201))},7575(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.styles=void 0;var i=r(n(10434)),a=r(n(70215)),o=r(n(56690)),s=r(n(89728)),u=r(n(94993)),c=r(n(73808)),l=r(n(61655)),f=r(n(67294));r(n(45697));var d=r(n(94184));n(55252);var h=r(n(78252)),p=r(n(82577)),b=function(e){return{root:{display:"table",fontFamily:e.typography.fontFamily,width:"100%",borderCollapse:"collapse",borderSpacing:0}}};t.styles=b;var m=function(e){function t(){(0,o.default)(this,t);for(var e,n,r=arguments.length,i=Array(r),a=0;ai&&n(null,i)}},{key:"render",value:function(){var e,t=this.props,n=t.ActionsComponent,r=t.backIconButtonProps,o=t.classes,s=t.colSpan,u=t.component,c=t.count,l=t.labelDisplayedRows,d=t.labelRowsPerPage,y=t.nextIconButtonProps,w=t.onChangePage,_=t.onChangeRowsPerPage,E=t.page,S=t.rowsPerPage,k=t.rowsPerPageOptions,x=t.SelectProps,T=void 0===x?{}:x,M=(0,a.default)(t,["ActionsComponent","backIconButtonProps","classes","colSpan","component","count","labelDisplayedRows","labelRowsPerPage","nextIconButtonProps","onChangePage","onChangeRowsPerPage","page","rowsPerPage","rowsPerPageOptions","SelectProps"]);(u===m.default||"td"===u)&&(e=s||1e3);var O=T.native?"option":p.default;return f.default.createElement(u,(0,i.default)({className:o.root,colSpan:e},M),f.default.createElement(g.default,{className:o.toolbar},f.default.createElement("div",{className:o.spacer}),k.length>1&&f.default.createElement(v.default,{color:"inherit",variant:"caption",className:o.caption},d),k.length>1&&f.default.createElement(b.default,(0,i.default)({classes:{root:o.selectRoot,select:o.select,icon:o.selectIcon},input:f.default.createElement(h.default,{className:o.input}),value:S,onChange:_},T),k.map(function(e){return f.default.createElement(O,{className:o.menuItem,key:e,value:e},e)})),f.default.createElement(v.default,{color:"inherit",variant:"caption",className:o.caption},l({from:0===c?0:E*S+1,to:Math.min(c,(E+1)*S),count:c,page:E})),f.default.createElement(n,{className:o.actions,backIconButtonProps:r,count:c,nextIconButtonProps:y,onChangePage:w,page:E,rowsPerPage:S})))}}]),t}(f.default.Component);_.defaultProps={ActionsComponent:y.default,component:m.default,labelDisplayedRows:function(e){var t=e.from,n=e.to,r=e.count;return"".concat(t,"-").concat(n," of ").concat(r)},labelRowsPerPage:"Rows per page:",rowsPerPageOptions:[10,25,50,100]};var E=(0,d.default)(w,{name:"MuiTablePagination"})(_);t.default=E},32844(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(10434)),a=r(n(70215)),o=r(n(56690)),s=r(n(89728)),u=r(n(94993)),c=r(n(73808)),l=r(n(61655)),f=r(n(67294));r(n(45697));var d=r(n(86861)),h=r(n(43836)),p=r(n(82313)),b=r(n(81701)),m=f.default.createElement(h.default,null),g=f.default.createElement(d.default,null),v=f.default.createElement(d.default,null),y=f.default.createElement(h.default,null),w=function(e){function t(){(0,o.default)(this,t);for(var e,n,r=arguments.length,i=Array(r),a=0;a=Math.ceil(n/s)-1,color:"inherit"},r),"rtl"===u.direction?v:y))}}]),t}(f.default.Component),_=(0,p.default)()(w);t.default=_},18217(e,t,n){"use strict";var r,i=n(64836);r={value:!0},Object.defineProperty(t,"Z",{enumerable:!0,get:function(){return a.default}});var a=i(n(71744))},86424(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.styles=void 0;var i=r(n(10434)),a=r(n(38416)),o=r(n(70215)),s=r(n(67294));r(n(45697));var u=r(n(94184));n(55252);var c=r(n(78252)),l=r(n(27628)),f=function(e){return{root:{color:"inherit",display:"table-row",height:48,verticalAlign:"middle",outline:"none","&$selected":{backgroundColor:"light"===e.palette.type?"rgba(0, 0, 0, 0.04)":"rgba(255, 255, 255, 0.08)"},"&$hover:hover":{backgroundColor:"light"===e.palette.type?"rgba(0, 0, 0, 0.07)":"rgba(255, 255, 255, 0.14)"}},selected:{},hover:{},head:{height:56},footer:{height:56}}};function d(e){var t=e.classes,n=e.className,r=e.component,c=e.hover,f=e.selected,d=(0,o.default)(e,["classes","className","component","hover","selected"]);return s.default.createElement(l.default.Consumer,null,function(e){var o,l=(0,u.default)(t.root,(o={},(0,a.default)(o,t.head,e&&"head"===e.variant),(0,a.default)(o,t.footer,e&&"footer"===e.variant),(0,a.default)(o,t.hover,c),(0,a.default)(o,t.selected,f),o),n);return s.default.createElement(r,(0,i.default)({className:l},d))})}t.styles=f,d.defaultProps={component:"tr",hover:!1,selected:!1};var h=(0,c.default)(f,{name:"MuiTableRow"})(d);t.default=h},17175(e,t,n){"use strict";var r,i=n(64836);r={value:!0},Object.defineProperty(t,"Z",{enumerable:!0,get:function(){return a.default}});var a=i(n(86424))},28550(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(56690)),a=r(n(89728)),o=r(n(94993)),s=r(n(73808)),u=r(n(61655)),c=r(n(67294));r(n(45697));var l,f=r(n(96421)),d=r(n(20296)),h={width:90,height:90,position:"absolute",top:-9e3,overflow:"scroll",msOverflowStyle:"scrollbar"},p=function(e){function t(){var e;return(0,i.default)(this,t),(e=(0,o.default)(this,(0,s.default)(t).call(this))).handleRef=function(t){e.nodeRef=t},e.setMeasurements=function(){var t=e.nodeRef;t&&(e.scrollbarHeight=t.offsetHeight-t.clientHeight)},"undefined"!=typeof window&&(e.handleResize=(0,d.default)(function(){var t=e.scrollbarHeight;e.setMeasurements(),t!==e.scrollbarHeight&&e.props.onChange(e.scrollbarHeight)},166)),e}return(0,u.default)(t,e),(0,a.default)(t,[{key:"componentDidMount",value:function(){this.setMeasurements(),this.props.onChange(this.scrollbarHeight)}},{key:"componentWillUnmount",value:function(){this.handleResize.clear()}},{key:"render",value:function(){return c.default.createElement(c.default.Fragment,null,c.default.createElement(f.default,{target:"window",onResize:this.handleResize}),c.default.createElement("div",{style:h,ref:this.handleRef}))}}]),t}(c.default.Component);t.default=p},12417(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.styles=void 0;var i=r(n(10434)),a=r(n(70215)),o=r(n(67294));r(n(45697));var s=r(n(94184)),u=r(n(78252)),c=n(98741),l=function(e){return{root:{position:"absolute",height:2,bottom:0,width:"100%",transition:e.transitions.create()},colorPrimary:{backgroundColor:e.palette.primary.main},colorSecondary:{backgroundColor:e.palette.secondary.main}}};function f(e){var t=e.classes,n=e.className,r=e.color,u=(0,a.default)(e,["classes","className","color"]);return o.default.createElement("span",(0,i.default)({className:(0,s.default)(t.root,t["color".concat((0,c.capitalize)(r))],n)},u))}t.styles=l;var d=(0,u.default)(l,{name:"MuiPrivateTabIndicator"})(f);t.default=d},69583(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.styles=void 0;var i=r(n(10434)),a=r(n(70215)),o=r(n(67294));r(n(45697));var s=r(n(94184)),u=r(n(86861)),c=r(n(43836)),l=r(n(78252)),f=r(n(16070)),d={root:{color:"inherit",width:56,flexShrink:0}};t.styles=d;var h=o.default.createElement(u.default,null),p=o.default.createElement(c.default,null);function b(e){var t=e.classes,n=e.className,r=e.direction,u=e.onClick,c=e.visible,l=(0,a.default)(e,["classes","className","direction","onClick","visible"]),d=(0,s.default)(t.root,n);return c?o.default.createElement(f.default,(0,i.default)({className:d,onClick:u,tabIndex:-1},l),"left"===r?h:p):o.default.createElement("div",{className:d})}b.defaultProps={visible:!0};var m=(0,l.default)(d,{name:"MuiPrivateTabScrollButton"})(b);t.default=m},89172(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.styles=void 0;var i=r(n(10434)),a=r(n(70215)),o=r(n(56690)),s=r(n(89728)),u=r(n(94993)),c=r(n(73808)),l=r(n(61655)),f=r(n(38416)),d=r(n(67294));r(n(45697)),r(n(42473));var h=r(n(94184)),p=r(n(96421)),b=r(n(20296)),m=n(46417);n(55252);var g=r(n(13329)),v=r(n(28550)),y=r(n(78252)),w=r(n(12417)),_=r(n(69583));r(n(346));var E=function(e){return{root:{overflow:"hidden",minHeight:48,WebkitOverflowScrolling:"touch"},flexContainer:{display:"flex"},centered:{justifyContent:"center"},scroller:{position:"relative",display:"inline-block",flex:"1 1 auto",whiteSpace:"nowrap"},fixed:{overflowX:"hidden",width:"100%"},scrollable:{overflowX:"scroll"},scrollButtons:{},scrollButtonsAuto:(0,f.default)({},e.breakpoints.down("xs"),{display:"none"}),indicator:{}}};t.styles=E;var S=function(e){function t(){var e;return(0,o.default)(this,t),(e=(0,u.default)(this,(0,c.default)(t).call(this))).state={indicatorStyle:{},scrollerStyle:{marginBottom:0},showLeftScroll:!1,showRightScroll:!1,mounted:!1},e.getConditionalElements=function(){var t=e.props,n=t.classes,r=t.scrollable,i=t.ScrollButtonComponent,a=t.scrollButtons,o=t.theme,s=t.variant,u={},c="scrollable"===s||r;u.scrollbarSizeListener=c?d.default.createElement(v.default,{onChange:e.handleScrollbarSizeChange}):null;var l=c&&("auto"===a||"on"===a);return u.scrollButtonLeft=l?d.default.createElement(i,{direction:o&&"rtl"===o.direction?"right":"left",onClick:e.handleLeftScrollClick,visible:e.state.showLeftScroll,className:(0,h.default)(n.scrollButtons,(0,f.default)({},n.scrollButtonsAuto,"auto"===a))}):null,u.scrollButtonRight=l?d.default.createElement(i,{direction:o&&"rtl"===o.direction?"left":"right",onClick:e.handleRightScrollClick,visible:e.state.showRightScroll,className:(0,h.default)(n.scrollButtons,(0,f.default)({},n.scrollButtonsAuto,"auto"===a))}):null,u},e.getTabsMeta=function(t,n){if(e.tabsRef){var r,i,a=e.tabsRef.getBoundingClientRect();r={clientWidth:e.tabsRef.clientWidth,scrollLeft:e.tabsRef.scrollLeft,scrollLeftNormalized:(0,m.getNormalizedScrollLeft)(e.tabsRef,n),scrollWidth:e.tabsRef.scrollWidth,left:a.left,right:a.right}}if(e.tabsRef&&!1!==t){var o=e.tabsRef.children[0].children;if(o.length>0){var s=o[e.valueToIndex.get(t)];i=s?s.getBoundingClientRect():null}}return{tabsMeta:r,tabMeta:i}},e.handleLeftScrollClick=function(){e.moveTabsScroll(-e.tabsRef.clientWidth)},e.handleRightScrollClick=function(){e.moveTabsScroll(e.tabsRef.clientWidth)},e.handleScrollbarSizeChange=function(t){e.setState({scrollerStyle:{marginBottom:-t}})},e.moveTabsScroll=function(t){var n=e.props.theme,r="rtl"===n.direction?-1:1,i=e.tabsRef.scrollLeft+t*r,a="rtl"===n.direction&&"reverse"===(0,m.detectScrollType)()?-1:1;e.scroll(a*i)},e.scrollSelectedIntoView=function(){var t=e.props,n=t.theme,r=t.value,i=e.getTabsMeta(r,n.direction),a=i.tabsMeta,o=i.tabMeta;if(o&&a){if(o.lefta.right){var u=a.scrollLeft+(o.right-a.right);e.scroll(u)}}},e.scroll=function(t){(0,g.default)("scrollLeft",e.tabsRef,t)},e.updateScrollButtonState=function(){var t=e.props,n=t.scrollable,r=t.scrollButtons,i=t.theme;if(("scrollable"===t.variant||n)&&"off"!==r){var a=e.tabsRef,o=a.scrollWidth,s=a.clientWidth,u=(0,m.getNormalizedScrollLeft)(e.tabsRef,i.direction),c="rtl"===i.direction?o>s+u:u>0,l="rtl"===i.direction?u>0:o>s+u;(c!==e.state.showLeftScroll||l!==e.state.showRightScroll)&&e.setState({showLeftScroll:c,showRightScroll:l})}},"undefined"!=typeof window&&(e.handleResize=(0,b.default)(function(){e.updateIndicatorState(e.props),e.updateScrollButtonState()},166),e.handleTabsScroll=(0,b.default)(function(){e.updateScrollButtonState()},166)),e}return(0,l.default)(t,e),(0,s.default)(t,[{key:"componentDidMount",value:function(){this.setState({mounted:!0}),this.updateIndicatorState(this.props),this.updateScrollButtonState(),this.props.action&&this.props.action({updateIndicator:this.handleResize})}},{key:"componentDidUpdate",value:function(e,t){this.updateIndicatorState(this.props),this.updateScrollButtonState(),this.state.indicatorStyle!==t.indicatorStyle&&this.scrollSelectedIntoView()}},{key:"componentWillUnmount",value:function(){this.handleResize.clear(),this.handleTabsScroll.clear()}},{key:"updateIndicatorState",value:function(e){var t=e.theme,n=e.value,r=this.getTabsMeta(n,t.direction),i=r.tabsMeta,a=r.tabMeta,o=0;if(a&&i){var s="rtl"===t.direction?i.scrollLeftNormalized+i.clientWidth-i.scrollWidth:i.scrollLeft;o=Math.round(a.left-i.left+s)}var u={left:o,width:a?Math.round(a.width):0};u.left===this.state.indicatorStyle.left&&u.width===this.state.indicatorStyle.width||isNaN(u.left)||isNaN(u.width)||this.setState({indicatorStyle:u})}},{key:"render",value:function(){var e,t=this,n=this.props,r=(n.action,n.centered),o=n.children,s=n.classes,u=n.className,c=n.component,l=n.fullWidth,b=void 0!==l&&l,m=n.indicatorColor,g=n.onChange,v=n.scrollable,y=void 0!==v&&v,_=(n.ScrollButtonComponent,n.scrollButtons,n.TabIndicatorProps),E=void 0===_?{}:_,S=n.textColor,k=(n.theme,n.value),x=n.variant,T=(0,a.default)(n,["action","centered","children","classes","className","component","fullWidth","indicatorColor","onChange","scrollable","ScrollButtonComponent","scrollButtons","TabIndicatorProps","textColor","theme","value","variant"]),M="scrollable"===x||y,O=(0,h.default)(s.root,u),A=(0,h.default)(s.flexContainer,(0,f.default)({},s.centered,r&&!M)),L=(0,h.default)(s.scroller,(e={},(0,f.default)(e,s.fixed,!M),(0,f.default)(e,s.scrollable,M),e)),C=d.default.createElement(w.default,(0,i.default)({className:s.indicator,color:m},E,{style:(0,i.default)({},this.state.indicatorStyle,E.style)}));this.valueToIndex=new Map;var I=0,D=d.default.Children.map(o,function(e){if(!d.default.isValidElement(e))return null;var n=void 0===e.props.value?I:e.props.value;t.valueToIndex.set(n,I);var r=n===k;return I+=1,d.default.cloneElement(e,{fullWidth:"fullWidth"===x||b,indicator:r&&!t.state.mounted&&C,selected:r,onChange:g,textColor:S,value:n})}),N=this.getConditionalElements();return d.default.createElement(c,(0,i.default)({className:O},T),d.default.createElement(p.default,{target:"window",onResize:this.handleResize}),N.scrollbarSizeListener,d.default.createElement("div",{className:s.flexContainer},N.scrollButtonLeft,d.default.createElement("div",{className:L,style:this.state.scrollerStyle,ref:function(e){t.tabsRef=e},role:"tablist",onScroll:this.handleTabsScroll},d.default.createElement("div",{className:A},D),this.state.mounted&&C),N.scrollButtonRight))}}]),t}(d.default.Component);S.defaultProps={centered:!1,component:"div",indicatorColor:"secondary",ScrollButtonComponent:_.default,scrollButtons:"auto",textColor:"inherit",variant:"standard"};var k=(0,y.default)(E,{name:"MuiTabs",withTheme:!0})(S);t.default=k},12794(e,t,n){"use strict";var r,i=n(64836);r={value:!0},Object.defineProperty(t,"Z",{enumerable:!0,get:function(){return a.default}});var a=i(n(89172))},78592(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(10434)),a=r(n(70215)),o=r(n(56690)),s=r(n(89728)),u=r(n(94993)),c=r(n(73808)),l=r(n(61655)),f=r(n(67294)),d=r(n(73935));r(n(42473)),r(n(45697));var h=r(n(54846)),p=r(n(1402)),b=r(n(59537)),m=r(n(23153)),g=r(n(85461)),v=r(n(76023)),y=r(n(11970)),w={standard:h.default,filled:p.default,outlined:b.default},_=function(e){function t(e){var n;return(0,o.default)(this,t),(n=(0,u.default)(this,(0,c.default)(t).call(this,e))).labelRef=f.default.createRef(),n}return(0,l.default)(t,e),(0,s.default)(t,[{key:"componentDidMount",value:function(){"outlined"===this.props.variant&&(this.labelNode=d.default.findDOMNode(this.labelRef.current),this.forceUpdate())}},{key:"render",value:function(){var e=this.props,t=e.autoComplete,n=e.autoFocus,r=e.children,o=e.className,s=e.defaultValue,u=e.error,c=e.FormHelperTextProps,l=e.fullWidth,d=e.helperText,h=e.id,p=e.InputLabelProps,b=e.inputProps,_=e.InputProps,E=e.inputRef,S=e.label,k=e.multiline,x=e.name,T=e.onBlur,M=e.onChange,O=e.onFocus,A=e.placeholder,L=e.required,C=e.rows,I=e.rowsMax,D=e.select,N=e.SelectProps,P=e.type,R=e.value,j=e.variant,F=(0,a.default)(e,["autoComplete","autoFocus","children","className","defaultValue","error","FormHelperTextProps","fullWidth","helperText","id","InputLabelProps","inputProps","InputProps","inputRef","label","multiline","name","onBlur","onChange","onFocus","placeholder","required","rows","rowsMax","select","SelectProps","type","value","variant"]),Y={};"outlined"===j&&(p&&void 0!==p.shrink&&(Y.notched=p.shrink),Y.labelWidth=this.labelNode&&this.labelNode.offsetWidth||0);var B=d&&h?"".concat(h,"-helper-text"):void 0,U=w[j],H=f.default.createElement(U,(0,i.default)({"aria-describedby":B,autoComplete:t,autoFocus:n,defaultValue:s,fullWidth:l,multiline:k,name:x,rows:C,rowsMax:I,type:P,value:R,id:h,inputRef:E,onBlur:T,onChange:M,onFocus:O,placeholder:A,inputProps:b},Y,_));return f.default.createElement(g.default,(0,i.default)({className:o,error:u,fullWidth:l,required:L,variant:j},F),S&&f.default.createElement(m.default,(0,i.default)({htmlFor:h,ref:this.labelRef},p),S),D?f.default.createElement(y.default,(0,i.default)({"aria-describedby":B,value:R,input:H},N),r):H,d&&f.default.createElement(v.default,(0,i.default)({id:B},c),d))}}]),t}(f.default.Component);_.defaultProps={required:!1,select:!1,variant:"standard"};var E=_;t.default=E},60520(e,t,n){"use strict";var r,i=n(64836);r={value:!0},Object.defineProperty(t,"Z",{enumerable:!0,get:function(){return a.default}});var a=i(n(78592))},48596(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.styles=void 0;var i=r(n(10434)),a=r(n(38416)),o=r(n(70215)),s=r(n(67294));r(n(45697));var u=r(n(94184)),c=r(n(78252)),l=function(e){return{root:{position:"relative",display:"flex",alignItems:"center"},gutters:e.mixins.gutters(),regular:e.mixins.toolbar,dense:{minHeight:48}}};function f(e){var t=e.children,n=e.classes,r=e.className,c=e.disableGutters,l=e.variant,f=(0,o.default)(e,["children","classes","className","disableGutters","variant"]),d=(0,u.default)(n.root,n[l],(0,a.default)({},n.gutters,!c),r);return s.default.createElement("div",(0,i.default)({className:d},f),t)}t.styles=l,f.defaultProps={disableGutters:!1,variant:"regular"};var d=(0,c.default)(l,{name:"MuiToolbar"})(f);t.default=d},28902(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return i.default}});var i=r(n(48596))},83065(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.styles=void 0;var i=r(n(10434)),a=r(n(70215)),o=r(n(56690)),s=r(n(89728)),u=r(n(94993)),c=r(n(73808)),l=r(n(61655)),f=r(n(38416)),d=r(n(67294));r(n(45697)),r(n(42473));var h=r(n(94184));n(55252);var p=r(n(39737)),b=r(n(78252)),m=n(98741),g=r(n(261)),v=r(n(60111)),y=function(e){return{popper:{zIndex:e.zIndex.tooltip,opacity:.9,pointerEvents:"none"},popperInteractive:{pointerEvents:"auto"},tooltip:{backgroundColor:e.palette.grey[700],borderRadius:e.shape.borderRadius,color:e.palette.common.white,fontFamily:e.typography.fontFamily,padding:"4px 8px",fontSize:e.typography.pxToRem(10),lineHeight:"".concat(e.typography.round(1.4),"em"),maxWidth:300},touch:{padding:"8px 16px",fontSize:e.typography.pxToRem(14),lineHeight:"".concat(e.typography.round(16/14),"em")},tooltipPlacementLeft:(0,f.default)({transformOrigin:"right center",margin:"0 24px "},e.breakpoints.up("sm"),{margin:"0 14px"}),tooltipPlacementRight:(0,f.default)({transformOrigin:"left center",margin:"0 24px"},e.breakpoints.up("sm"),{margin:"0 14px"}),tooltipPlacementTop:(0,f.default)({transformOrigin:"center bottom",margin:"24px 0"},e.breakpoints.up("sm"),{margin:"14px 0"}),tooltipPlacementBottom:(0,f.default)({transformOrigin:"center top",margin:"24px 0"},e.breakpoints.up("sm"),{margin:"14px 0"})}};t.styles=y;var w=function(e){function t(e){var n;return(0,o.default)(this,t),(n=(0,u.default)(this,(0,c.default)(t).call(this))).ignoreNonTouchEvents=!1,n.onRootRef=function(e){n.childrenRef=e},n.handleFocus=function(e){n.childrenRef||(n.childrenRef=e.currentTarget),n.handleEnter(e);var t=n.props.children.props;t.onFocus&&t.onFocus(e)},n.handleEnter=function(e){var t=n.props,r=t.children,i=t.enterDelay,a=r.props;"mouseover"===e.type&&a.onMouseOver&&a.onMouseOver(e),(!n.ignoreNonTouchEvents||"touchstart"===e.type)&&(n.childrenRef.setAttribute("title",""),clearTimeout(n.enterTimer),clearTimeout(n.leaveTimer),i?(e.persist(),n.enterTimer=setTimeout(function(){n.handleOpen(e)},i)):n.handleOpen(e))},n.handleOpen=function(e){n.isControlled||n.state.open||n.setState({open:!0}),n.props.onOpen&&n.props.onOpen(e)},n.handleLeave=function(e){var t=n.props,r=t.children,i=t.leaveDelay,a=r.props;"blur"===e.type&&a.onBlur&&a.onBlur(e),"mouseleave"===e.type&&a.onMouseLeave&&a.onMouseLeave(e),clearTimeout(n.enterTimer),clearTimeout(n.leaveTimer),i?(e.persist(),n.leaveTimer=setTimeout(function(){n.handleClose(e)},i)):n.handleClose(e)},n.handleClose=function(e){n.isControlled||n.setState({open:!1}),n.props.onClose&&n.props.onClose(e),clearTimeout(n.closeTimer),n.closeTimer=setTimeout(function(){n.ignoreNonTouchEvents=!1},n.props.theme.transitions.duration.shortest)},n.handleTouchStart=function(e){n.ignoreNonTouchEvents=!0;var t=n.props,r=t.children,i=t.enterTouchDelay;r.props.onTouchStart&&r.props.onTouchStart(e),clearTimeout(n.leaveTimer),clearTimeout(n.closeTimer),clearTimeout(n.touchTimer),e.persist(),n.touchTimer=setTimeout(function(){n.handleEnter(e)},i)},n.handleTouchEnd=function(e){var t=n.props,r=t.children,i=t.leaveTouchDelay;r.props.onTouchEnd&&r.props.onTouchEnd(e),clearTimeout(n.touchTimer),clearTimeout(n.leaveTimer),e.persist(),n.leaveTimer=setTimeout(function(){n.handleClose(e)},i)},n.isControlled=null!=e.open,n.state={open:null},n.isControlled||(n.state.open=!1),n}return(0,l.default)(t,e),(0,s.default)(t,[{key:"componentDidMount",value:function(){this.defaultId="mui-tooltip-".concat(Math.round(1e5*Math.random())),this.props.open&&this.forceUpdate()}},{key:"componentWillUnmount",value:function(){clearTimeout(this.closeTimer),clearTimeout(this.enterTimer),clearTimeout(this.focusTimer),clearTimeout(this.leaveTimer),clearTimeout(this.touchTimer)}},{key:"render",value:function(){var e=this,t=this.props,n=t.children,r=t.classes,o=t.disableFocusListener,s=t.disableHoverListener,u=t.disableTouchListener,c=(t.enterDelay,t.enterTouchDelay,t.id),l=t.interactive,b=(t.leaveDelay,t.leaveTouchDelay,t.onClose,t.onOpen,t.open),g=t.placement,y=t.PopperProps,w=t.theme,_=t.title,E=t.TransitionComponent,S=t.TransitionProps,k=(0,a.default)(t,["children","classes","disableFocusListener","disableHoverListener","disableTouchListener","enterDelay","enterTouchDelay","id","interactive","leaveDelay","leaveTouchDelay","onClose","onOpen","open","placement","PopperProps","theme","title","TransitionComponent","TransitionProps"]),x=this.isControlled?b:this.state.open;""===_&&(x=!1);var T=!x&&!s,M=(0,i.default)({"aria-describedby":x?c||this.defaultId:null,title:T&&"string"==typeof _?_:null},k,n.props,{className:(0,h.default)(k.className,n.props.className)});u||(M.onTouchStart=this.handleTouchStart,M.onTouchEnd=this.handleTouchEnd),s||(M.onMouseOver=this.handleEnter,M.onMouseLeave=this.handleLeave),o||(M.onFocus=this.handleFocus,M.onBlur=this.handleLeave);var O=l?{onMouseOver:M.onMouseOver,onMouseLeave:M.onMouseLeave,onFocus:M.onFocus,onBlur:M.onBlur}:{};return d.default.createElement(d.default.Fragment,null,d.default.createElement(p.default,{rootRef:this.onRootRef},d.default.cloneElement(n,M)),d.default.createElement(v.default,(0,i.default)({className:(0,h.default)(r.popper,(0,f.default)({},r.popperInteractive,l)),placement:g,anchorEl:this.childrenRef,open:x,id:M["aria-describedby"],transition:!0},O,y),function(t){var n=t.placement,a=t.TransitionProps;return d.default.createElement(E,(0,i.default)({timeout:w.transitions.duration.shorter},a,S),d.default.createElement("div",{className:(0,h.default)(r.tooltip,(0,f.default)({},r.touch,e.ignoreNonTouchEvents),r["tooltipPlacement".concat((0,m.capitalize)(n.split("-")[0]))])},_))}))}}]),t}(d.default.Component);w.defaultProps={disableFocusListener:!1,disableHoverListener:!1,disableTouchListener:!1,enterDelay:0,enterTouchDelay:1e3,interactive:!1,leaveDelay:0,leaveTouchDelay:1500,placement:"bottom",TransitionComponent:g.default};var _=(0,b.default)(y,{name:"MuiTooltip",withTheme:!0})(w);t.default=_},31657(e,t,n){"use strict";var r,i=n(64836);r={value:!0},Object.defineProperty(t,"Z",{enumerable:!0,get:function(){return a.default}});var a=i(n(83065))},49476(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.styles=void 0;var i=r(n(10434)),a=r(n(38416)),o=r(n(70215)),s=r(n(67294));r(n(45697));var u=r(n(94184));n(55252);var c=r(n(78252)),l=n(98741),f=function(e){return{root:{display:"block",margin:0},display4:e.typography.display4,display3:e.typography.display3,display2:e.typography.display2,display1:e.typography.display1,headline:e.typography.headline,title:e.typography.title,subheading:e.typography.subheading,body2:e.typography.body2,body1:e.typography.body1,caption:e.typography.caption,button:e.typography.button,h1:e.typography.h1,h2:e.typography.h2,h3:e.typography.h3,h4:e.typography.h4,h5:e.typography.h5,h6:e.typography.h6,subtitle1:e.typography.subtitle1,subtitle2:e.typography.subtitle2,overline:e.typography.overline,srOnly:{position:"absolute",height:1,width:1,overflow:"hidden"},alignLeft:{textAlign:"left"},alignCenter:{textAlign:"center"},alignRight:{textAlign:"right"},alignJustify:{textAlign:"justify"},noWrap:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},gutterBottom:{marginBottom:"0.35em"},paragraph:{marginBottom:16},colorInherit:{color:"inherit"},colorPrimary:{color:e.palette.primary.main},colorSecondary:{color:e.palette.secondary.main},colorTextPrimary:{color:e.palette.text.primary},colorTextSecondary:{color:e.palette.text.secondary},colorError:{color:e.palette.error.main},inline:{display:"inline"}}};t.styles=f;var d={display4:"h1",display3:"h2",display2:"h3",display1:"h4",headline:"h5",title:"h6",subheading:"subtitle1"};function h(e,t){var n=e.typography,r=t;return r||(r=n.useNextVariants?"body2":"body1"),n.useNextVariants&&(r=d[r]||r),r}var p={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p",display4:"h1",display3:"h1",display2:"h1",display1:"h1",headline:"h1",title:"h2",subheading:"h3"};function b(e){var t,n=e.align,r=e.classes,c=e.className,f=e.color,d=e.component,b=e.gutterBottom,m=e.headlineMapping,g=e.inline,v=(e.internalDeprecatedVariant,e.noWrap),y=e.paragraph,w=e.theme,_=e.variant,E=(0,o.default)(e,["align","classes","className","color","component","gutterBottom","headlineMapping","inline","internalDeprecatedVariant","noWrap","paragraph","theme","variant"]),S=h(w,_),k=(0,u.default)(r.root,(t={},(0,a.default)(t,r[S],"inherit"!==S),(0,a.default)(t,r["color".concat((0,l.capitalize)(f))],"default"!==f),(0,a.default)(t,r.noWrap,v),(0,a.default)(t,r.gutterBottom,b),(0,a.default)(t,r.paragraph,y),(0,a.default)(t,r["align".concat((0,l.capitalize)(n))],"inherit"!==n),(0,a.default)(t,r.inline,g),t),c),x=d||(y?"p":m[S]||p[S])||"span";return s.default.createElement(x,(0,i.default)({className:k},E))}b.defaultProps={align:"inherit",color:"default",gutterBottom:!1,headlineMapping:p,inline:!1,noWrap:!1,paragraph:!1};var m=(0,c.default)(f,{name:"MuiTypography",withTheme:!0})(b);t.default=m},71426(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return i.default}});var i=r(n(49476))},8070(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n={50:"#fff8e1",100:"#ffecb3",200:"#ffe082",300:"#ffd54f",400:"#ffca28",500:"#ffc107",600:"#ffb300",700:"#ffa000",800:"#ff8f00",900:"#ff6f00",A100:"#ffe57f",A200:"#ffd740",A400:"#ffc400",A700:"#ffab00"};t.default=n},63259(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n={50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",A100:"#82b1ff",A200:"#448aff",A400:"#2979ff",A700:"#2962ff"};t.default=n},38236(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n={50:"#eceff1",100:"#cfd8dc",200:"#b0bec5",300:"#90a4ae",400:"#78909c",500:"#607d8b",600:"#546e7a",700:"#455a64",800:"#37474f",900:"#263238",A100:"#cfd8dc",A200:"#b0bec5",A400:"#78909c",A700:"#455a64"};t.default=n},60169(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n={50:"#efebe9",100:"#d7ccc8",200:"#bcaaa4",300:"#a1887f",400:"#8d6e63",500:"#795548",600:"#6d4c41",700:"#5d4037",800:"#4e342e",900:"#3e2723",A100:"#d7ccc8",A200:"#bcaaa4",A400:"#8d6e63",A700:"#5d4037"};t.default=n},515(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n={black:"#000",white:"#fff"};t.default=n},57646(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n={50:"#e0f7fa",100:"#b2ebf2",200:"#80deea",300:"#4dd0e1",400:"#26c6da",500:"#00bcd4",600:"#00acc1",700:"#0097a7",800:"#00838f",900:"#006064",A100:"#84ffff",A200:"#18ffff",A400:"#00e5ff",A700:"#00b8d4"};t.default=n},50173(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n={50:"#fbe9e7",100:"#ffccbc",200:"#ffab91",300:"#ff8a65",400:"#ff7043",500:"#ff5722",600:"#f4511e",700:"#e64a19",800:"#d84315",900:"#bf360c",A100:"#ff9e80",A200:"#ff6e40",A400:"#ff3d00",A700:"#dd2c00"};t.default=n},45018(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n={50:"#ede7f6",100:"#d1c4e9",200:"#b39ddb",300:"#9575cd",400:"#7e57c2",500:"#673ab7",600:"#5e35b1",700:"#512da8",800:"#4527a0",900:"#311b92",A100:"#b388ff",A200:"#7c4dff",A400:"#651fff",A700:"#6200ea"};t.default=n},47559(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",A100:"#b9f6ca",A200:"#69f0ae",A400:"#00e676",A700:"#00c853"};t.default=n},70167(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#d5d5d5",A200:"#aaaaaa",A400:"#303030",A700:"#616161"};t.default=n},19350(e,t,n){"use strict";var r,i=n(64836);r={value:!0},Object.defineProperty(t,"y0",{enumerable:!0,get:function(){return a.default}}),r={enumerable:!0,get:function(){return o.default}},r={enumerable:!0,get:function(){return s.default}},r={enumerable:!0,get:function(){return u.default}},r={enumerable:!0,get:function(){return c.default}},r={enumerable:!0,get:function(){return l.default}},r={enumerable:!0,get:function(){return f.default}},r={enumerable:!0,get:function(){return d.default}},r={enumerable:!0,get:function(){return h.default}},r={enumerable:!0,get:function(){return p.default}},Object.defineProperty(t,"ek",{enumerable:!0,get:function(){return b.default}}),r={enumerable:!0,get:function(){return m.default}},r={enumerable:!0,get:function(){return g.default}},r={enumerable:!0,get:function(){return v.default}},r={enumerable:!0,get:function(){return y.default}},r={enumerable:!0,get:function(){return w.default}},r={enumerable:!0,get:function(){return _.default}},r={enumerable:!0,get:function(){return E.default}},Object.defineProperty(t,"BA",{enumerable:!0,get:function(){return S.default}}),r={enumerable:!0,get:function(){return k.default}};var a=i(n(515)),o=i(n(83165)),s=i(n(124)),u=i(n(18118)),c=i(n(45018)),l=i(n(78768)),f=i(n(63259)),d=i(n(4923)),h=i(n(57646)),p=i(n(91605)),b=i(n(47559)),m=i(n(40192)),g=i(n(98567)),v=i(n(74578)),y=i(n(8070)),w=i(n(36594)),_=i(n(50173)),E=i(n(60169)),S=i(n(70167)),k=i(n(38236))},78768(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n={50:"#e8eaf6",100:"#c5cae9",200:"#9fa8da",300:"#7986cb",400:"#5c6bc0",500:"#3f51b5",600:"#3949ab",700:"#303f9f",800:"#283593",900:"#1a237e",A100:"#8c9eff",A200:"#536dfe",A400:"#3d5afe",A700:"#304ffe"};t.default=n},4923(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n={50:"#e1f5fe",100:"#b3e5fc",200:"#81d4fa",300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",600:"#039be5",700:"#0288d1",800:"#0277bd",900:"#01579b",A100:"#80d8ff",A200:"#40c4ff",A400:"#00b0ff",A700:"#0091ea"};t.default=n},40192(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n={50:"#f1f8e9",100:"#dcedc8",200:"#c5e1a5",300:"#aed581",400:"#9ccc65",500:"#8bc34a",600:"#7cb342",700:"#689f38",800:"#558b2f",900:"#33691e",A100:"#ccff90",A200:"#b2ff59",A400:"#76ff03",A700:"#64dd17"};t.default=n},98567(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n={50:"#f9fbe7",100:"#f0f4c3",200:"#e6ee9c",300:"#dce775",400:"#d4e157",500:"#cddc39",600:"#c0ca33",700:"#afb42b",800:"#9e9d24",900:"#827717",A100:"#f4ff81",A200:"#eeff41",A400:"#c6ff00",A700:"#aeea00"};t.default=n},36594(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n={50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",A100:"#ffd180",A200:"#ffab40",A400:"#ff9100",A700:"#ff6d00"};t.default=n},124(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n={50:"#fce4ec",100:"#f8bbd0",200:"#f48fb1",300:"#f06292",400:"#ec407a",500:"#e91e63",600:"#d81b60",700:"#c2185b",800:"#ad1457",900:"#880e4f",A100:"#ff80ab",A200:"#ff4081",A400:"#f50057",A700:"#c51162"};t.default=n},18118(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n={50:"#f3e5f5",100:"#e1bee7",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",600:"#8e24aa",700:"#7b1fa2",800:"#6a1b9a",900:"#4a148c",A100:"#ea80fc",A200:"#e040fb",A400:"#d500f9",A700:"#aa00ff"};t.default=n},83165(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",A100:"#ff8a80",A200:"#ff5252",A400:"#ff1744",A700:"#d50000"};t.default=n},91605(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n={50:"#e0f2f1",100:"#b2dfdb",200:"#80cbc4",300:"#4db6ac",400:"#26a69a",500:"#009688",600:"#00897b",700:"#00796b",800:"#00695c",900:"#004d40",A100:"#a7ffeb",A200:"#64ffda",A400:"#1de9b6",A700:"#00bfa5"};t.default=n},74578(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n={50:"#fffde7",100:"#fff9c4",200:"#fff59d",300:"#fff176",400:"#ffee58",500:"#ffeb3b",600:"#fdd835",700:"#fbc02d",800:"#f9a825",900:"#f57f17",A100:"#ffff8d",A200:"#ffff00",A400:"#ffea00",A700:"#ffd600"};t.default=n},85609(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.styles=void 0;var i=r(n(10434)),a=r(n(38416)),o=r(n(70215)),s=r(n(56690)),u=r(n(89728)),c=r(n(94993)),l=r(n(73808)),f=r(n(61655)),d=r(n(67294));r(n(45697));var h=r(n(94184)),p=r(n(52598)),b=r(n(78252)),m=r(n(81701)),g={root:{display:"inline-flex",alignItems:"center",transition:"none","&:hover":{backgroundColor:"transparent"}},checked:{},disabled:{},input:{cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0}};t.styles=g;var v=function(e){function t(e){var n;return(0,s.default)(this,t),(n=(0,c.default)(this,(0,l.default)(t).call(this))).handleFocus=function(e){n.props.onFocus&&n.props.onFocus(e);var t=n.props.muiFormControl;t&&t.onFocus&&t.onFocus(e)},n.handleBlur=function(e){n.props.onBlur&&n.props.onBlur(e);var t=n.props.muiFormControl;t&&t.onBlur&&t.onBlur(e)},n.handleInputChange=function(e){var t=e.target.checked;n.isControlled||n.setState({checked:t}),n.props.onChange&&n.props.onChange(e,t)},n.isControlled=null!=e.checked,n.state={},n.isControlled||(n.state.checked=void 0!==e.defaultChecked&&e.defaultChecked),n}return(0,f.default)(t,e),(0,u.default)(t,[{key:"render",value:function(){var e,t=this.props,n=t.autoFocus,r=t.checked,s=t.checkedIcon,u=t.classes,c=t.className,l=t.defaultChecked,f=t.disabled,p=t.icon,b=t.id,g=t.inputProps,v=t.inputRef,y=t.muiFormControl,w=t.name,_=(t.onBlur,t.onChange,t.onFocus,t.readOnly),E=t.required,S=t.tabIndex,k=t.type,x=t.value,T=(0,o.default)(t,["autoFocus","checked","checkedIcon","classes","className","defaultChecked","disabled","icon","id","inputProps","inputRef","muiFormControl","name","onBlur","onChange","onFocus","readOnly","required","tabIndex","type","value"]),M=f;y&&void 0===M&&(M=y.disabled);var O=this.isControlled?r:this.state.checked,A="checkbox"===k||"radio"===k;return d.default.createElement(m.default,(0,i.default)({component:"span",className:(0,h.default)(u.root,(e={},(0,a.default)(e,u.checked,O),(0,a.default)(e,u.disabled,M),e),c),disabled:M,tabIndex:null,role:void 0,onFocus:this.handleFocus,onBlur:this.handleBlur},T),O?s:p,d.default.createElement("input",(0,i.default)({autoFocus:n,checked:r,defaultChecked:l,className:u.input,disabled:M,id:A&&b,name:w,onChange:this.handleInputChange,readOnly:_,ref:v,required:E,tabIndex:S,type:k,value:x},g)))}}]),t}(d.default.Component),y=(0,b.default)(g,{name:"MuiPrivateSwitchBase"})((0,p.default)(v));t.default=y},13329(e,t){"use strict";function n(e){return(1+Math.sin(Math.PI*e-Math.PI/2))/2}function r(e,t,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:function(){},o=i.ease,s=void 0===o?n:o,u=i.duration,c=void 0===u?300:u,l=null,f=t[e],d=!1,h=function(){d=!0},p=function n(i){if(d){a(Error("Animation cancelled"));return}null===l&&(l=i);var o=Math.min(1,(i-l)/c);if(t[e]=s(o)*(r-f)+f,o>=1){requestAnimationFrame(function(){a(null)});return}requestAnimationFrame(n)};return f===r?(a(Error("Element already at target position")),h):(requestAnimationFrame(p),h)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r;t.default=i},74622(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(67294)),a=r(n(46949)),o=r(n(40577)),s=i.default.createElement("path",{d:"M7 10l5 5 5-5z"}),u=function(e){return i.default.createElement(o.default,e,s)};(u=(0,a.default)(u)).muiName="SvgIcon";var c=u;t.default=c},99781(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(67294)),a=r(n(46949)),o=r(n(40577)),s=i.default.createElement("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}),u=function(e){return i.default.createElement(o.default,e,s)};(u=(0,a.default)(u)).muiName="SvgIcon";var c=u;t.default=c},41549(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(67294)),a=r(n(46949)),o=r(n(40577)),s=i.default.createElement("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"}),u=function(e){return i.default.createElement(o.default,e,s)};(u=(0,a.default)(u)).muiName="SvgIcon";var c=u;t.default=c},42159(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(67294)),a=r(n(46949)),o=r(n(40577)),s=i.default.createElement("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"}),u=function(e){return i.default.createElement(o.default,e,s)};(u=(0,a.default)(u)).muiName="SvgIcon";var c=u;t.default=c},61486(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(67294)),a=r(n(46949)),o=r(n(40577)),s=i.default.createElement("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z"}),u=function(e){return i.default.createElement(o.default,e,s)};(u=(0,a.default)(u)).muiName="SvgIcon";var c=u;t.default=c},86861(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(67294)),a=r(n(46949)),o=r(n(40577)),s=i.default.createElement("path",{d:"M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"}),u=function(e){return i.default.createElement(o.default,e,s)};(u=(0,a.default)(u)).muiName="SvgIcon";var c=u;t.default=c},43836(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(67294)),a=r(n(46949)),o=r(n(40577)),s=i.default.createElement("path",{d:"M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z"}),u=function(e){return i.default.createElement(o.default,e,s)};(u=(0,a.default)(u)).muiName="SvgIcon";var c=u;t.default=c},93078(e,t,n){"use strict";/*! + * is-plain-object + * + * Copyright (c) 2014-2017, Jon Schlinkert. + * Released under the MIT License. + */ var r=n(47798);function i(e){return!0===r(e)&&"[object Object]"===Object.prototype.toString.call(e)}e.exports=function(e){var t,n;return!1!==i(e)&&"function"==typeof(t=e.constructor)&&!1!==i(n=t.prototype)&&!1!==n.hasOwnProperty("isPrototypeOf")}},72366(e,t,n){"use strict";var r=n(75263),i=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.MuiThemeProviderOld=void 0;var a=i(n(10434)),o=i(n(38416)),s=i(n(56690)),u=i(n(89728)),c=i(n(94993)),l=i(n(73808)),f=i(n(61655)),d=i(n(67294)),h=i(n(45697));i(n(42473));var p=i(n(43890)),b=n(55252),m=r(n(51067)),g=function(e){function t(e,n){var r;return(0,s.default)(this,t),(r=(0,c.default)(this,(0,l.default)(t).call(this))).broadcast=(0,p.default)(),r.outerTheme=m.default.initial(n),r.broadcast.setState(r.mergeOuterLocalTheme(e.theme)),r}return(0,f.default)(t,e),(0,u.default)(t,[{key:"getChildContext",value:function(){var e,t=this.props,n=t.disableStylesGeneration,r=t.sheetsCache,i=t.sheetsManager,a=this.context.muiThemeProviderOptions||{};return void 0!==n&&(a.disableStylesGeneration=n),void 0!==r&&(a.sheetsCache=r),void 0!==i&&(a.sheetsManager=i),e={},(0,o.default)(e,m.CHANNEL,this.broadcast),(0,o.default)(e,"muiThemeProviderOptions",a),e}},{key:"componentDidMount",value:function(){var e=this;this.unsubscribeId=m.default.subscribe(this.context,function(t){e.outerTheme=t,e.broadcast.setState(e.mergeOuterLocalTheme(e.props.theme))})}},{key:"componentDidUpdate",value:function(e){this.props.theme!==e.theme&&this.broadcast.setState(this.mergeOuterLocalTheme(this.props.theme))}},{key:"componentWillUnmount",value:function(){null!==this.unsubscribeId&&m.default.unsubscribe(this.context,this.unsubscribeId)}},{key:"mergeOuterLocalTheme",value:function(e){return"function"==typeof e?e(this.outerTheme):this.outerTheme?(0,a.default)({},this.outerTheme,e):e}},{key:"render",value:function(){return this.props.children}}]),t}(d.default.Component);t.MuiThemeProviderOld=g,g.childContextTypes=(0,a.default)({},m.default.contextTypes,{muiThemeProviderOptions:h.default.object}),g.contextTypes=(0,a.default)({},m.default.contextTypes,{muiThemeProviderOptions:h.default.object}),b.ponyfillGlobal.__MUI_STYLES__||(b.ponyfillGlobal.__MUI_STYLES__={}),b.ponyfillGlobal.__MUI_STYLES__.MuiThemeProvider||(b.ponyfillGlobal.__MUI_STYLES__.MuiThemeProvider=g);var v=b.ponyfillGlobal.__MUI_STYLES__.MuiThemeProvider;t.default=v},59114(e,t,n){"use strict";var r=n(64836);function i(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return en?n:e}function a(e){e=e.substr(1);var t=RegExp(".{1,".concat(e.length/3,"}"),"g"),n=e.match(t);return n&&1===n[0].length&&(n=n.map(function(e){return e+e})),n?"rgb(".concat(n.map(function(e){return parseInt(e,16)}).join(", "),")"):""}function o(e){if(0===e.indexOf("#"))return e;function t(e){var t=e.toString(16);return 1===t.length?"0".concat(t):t}var n=s(e).values;return n=n.map(function(e){return t(e)}),"#".concat(n.join(""))}function s(e){if("#"===e.charAt(0))return s(a(e));var t=e.indexOf("("),n=e.substring(0,t),r=e.substring(t+1,e.length-1).split(",");return r=r.map(function(e){return parseFloat(e)}),{type:n,values:r}}function u(e){var t=e.type,n=e.values;return -1!==t.indexOf("rgb")&&(n=n.map(function(e,t){return t<3?parseInt(e,10):e})),-1!==t.indexOf("hsl")&&(n[1]="".concat(n[1],"%"),n[2]="".concat(n[2],"%")),"".concat(e.type,"(").concat(n.join(", "),")")}function c(e,t){var n=l(e),r=l(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function l(e){var t=s(e);if(-1!==t.type.indexOf("rgb")){var n=t.values.map(function(e){return(e/=255)<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)});return Number((.2126*n[0]+.7152*n[1]+.0722*n[2]).toFixed(3))}return t.values[2]/100}function f(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.15;return l(e)>.5?h(e,t):p(e,t)}function d(e,t){return e?(e=s(e),t=i(t),("rgb"===e.type||"hsl"===e.type)&&(e.type+="a"),e.values[3]=t,u(e)):e}function h(e,t){if(!e)return e;if(e=s(e),t=i(t),-1!==e.type.indexOf("hsl"))e.values[2]*=1-t;else if(-1!==e.type.indexOf("rgb"))for(var n=0;n<3;n+=1)e.values[n]*=1-t;return u(e)}function p(e,t){if(!e)return e;if(e=s(e),t=i(t),-1!==e.type.indexOf("hsl"))e.values[2]+=(100-e.values[2])*t;else if(-1!==e.type.indexOf("rgb"))for(var n=0;n<3;n+=1)e.values[n]+=(255-e.values[n])*t;return u(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.convertHexToRGB=a,t.rgbToHex=o,t.decomposeColor=s,t.recomposeColor=u,t.getContrastRatio=c,t.getLuminance=l,t.emphasize=f,t.fade=d,t.darken=h,t.lighten=p,r(n(42473))},94811(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=s,t.keys=void 0;var i=r(n(10434)),a=r(n(70215)),o=["xs","sm","md","lg","xl"];function s(e){var t=e.values,n=void 0===t?{xs:0,sm:600,md:960,lg:1280,xl:1920}:t,r=e.unit,s=void 0===r?"px":r,u=e.step,c=void 0===u?5:u,l=(0,a.default)(e,["values","unit","step"]);function f(e){var t="number"==typeof n[e]?n[e]:e;return"@media (min-width:".concat(t).concat(s,")")}function d(e){var t=o.indexOf(e)+1,r=n[o[t]];if(t===o.length)return f("xs");var i="number"==typeof r&&t>0?r:e;return"@media (max-width:".concat(i-c/100).concat(s,")")}function h(e,t){var r=o.indexOf(t)+1;return r===o.length?f(e):"@media (min-width:".concat(n[e]).concat(s,") and ")+"(max-width:".concat(n[o[r]]-c/100).concat(s,")")}function p(e){return h(e,e)}function b(e){return n[e]}return(0,i.default)({keys:o,values:n,up:f,down:d,between:h,only:p,width:b},l)}t.keys=o},20237(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=o,r(n(42473));var i=/([[\].#*$><+~=|^:(),"'`\s])/g;function a(e){var t;return String(e).replace(i,"-")}function o(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.dangerouslyUseGlobalCSS,n=void 0!==t&&t,r=e.productionPrefix,i=void 0===r?"jss":r,o=e.seed,s=void 0===o?"":o,u=0;return function(e,t){return(u+=1,n&&t&&t.options.name)?"".concat(a(t.options.name),"-").concat(e.key):"".concat(i).concat(s).concat(u)}}},40226(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var i=r(n(38416)),a=r(n(10434));function o(e,t,n){var r;return(0,a.default)({gutters:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,a.default)({paddingLeft:2*t.unit,paddingRight:2*t.unit},n,(0,i.default)({},e.up("sm"),(0,a.default)({paddingLeft:3*t.unit,paddingRight:3*t.unit},n[e.up("sm")])))},toolbar:(r={minHeight:56},(0,i.default)(r,"".concat(e.up("xs")," and (orientation: landscape)"),{minHeight:48}),(0,i.default)(r,e.up("sm"),{minHeight:64}),r)},n)}},71615(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,r(n(38416));var i=r(n(10434)),a=r(n(70215)),o=r(n(94863)),s=r(n(93078));r(n(42473));var u=r(n(94811)),c=r(n(40226)),l=r(n(21091)),f=r(n(45184)),d=r(n(80743)),h=r(n(59591)),p=r(n(5324)),b=r(n(15406)),m=r(n(88676));function g(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.breakpoints,r=void 0===n?{}:n,g=t.mixins,v=void 0===g?{}:g,y=t.palette,w=void 0===y?{}:y,_=t.shadows,E=t.spacing,S=void 0===E?{}:E,k=t.typography,x=void 0===k?{}:k,T=(0,a.default)(t,["breakpoints","mixins","palette","shadows","spacing","typography"]),M=(0,l.default)(w),O=(0,u.default)(r),A=(0,i.default)({},p.default,S);return(0,i.default)({breakpoints:O,direction:"ltr",mixins:(0,c.default)(O,A,v),overrides:{},palette:M,props:{},shadows:_||d.default,typography:(0,f.default)(M,x)},(0,o.default)({shape:h.default,spacing:A,transitions:b.default,zIndex:m.default},T,{isMergeableObject:s.default}))}var v=g;t.default=v},21091(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=m,t.dark=t.light=void 0;var i=r(n(10434)),a=r(n(70215));r(n(42473));var o=r(n(94863)),s=r(n(78768)),u=r(n(124)),c=r(n(70167)),l=r(n(83165)),f=r(n(515)),d=n(59114),h={text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.54)",disabled:"rgba(0, 0, 0, 0.38)",hint:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:f.default.white,default:c.default[50]},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.08)",hoverOpacity:.08,selected:"rgba(0, 0, 0, 0.14)",disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)"}};t.light=h;var p={text:{primary:f.default.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",hint:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:c.default[800],default:"#303030"},action:{active:f.default.white,hover:"rgba(255, 255, 255, 0.1)",hoverOpacity:.1,selected:"rgba(255, 255, 255, 0.2)",disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)"}};function b(e,t,n,r){e[t]||(e.hasOwnProperty(n)?e[t]=e[n]:"light"===t?e.light=(0,d.lighten)(e.main,r):"dark"===t&&(e.dark=(0,d.darken)(e.main,1.5*r)))}function m(e){var t=e.primary,n=void 0===t?{light:s.default[300],main:s.default[500],dark:s.default[700]}:t,r=e.secondary,m=void 0===r?{light:u.default.A200,main:u.default.A400,dark:u.default.A700}:r,g=e.error,v=void 0===g?{light:l.default[300],main:l.default[500],dark:l.default[700]}:g,y=e.type,w=void 0===y?"light":y,_=e.contrastThreshold,E=void 0===_?3:_,S=e.tonalOffset,k=void 0===S?.2:S,x=(0,a.default)(e,["primary","secondary","error","type","contrastThreshold","tonalOffset"]);function T(e){var t;return(0,d.getContrastRatio)(e,p.text.primary)>=E?p.text.primary:h.text.primary}function M(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:500,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:300,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:700;return!e.main&&e[t]&&(e.main=e[t]),b(e,"light",n,k),b(e,"dark",r,k),e.contrastText||(e.contrastText=T(e.main)),e}M(n),M(m,"A400","A200","A700"),M(v);var O={dark:p,light:h};return(0,o.default)((0,i.default)({common:f.default,type:w,primary:n,secondary:m,error:v,grey:c.default,contrastThreshold:E,getContrastText:T,augmentColor:M,tonalOffset:k},O[w]),x,{clone:!1})}t.dark=p},16059(e,t){"use strict";function n(e){return e}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n},45184(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=f;var i=r(n(10434)),a=r(n(70215)),o=r(n(94863));r(n(42473));var s=n(55252);function u(e){return Math.round(1e5*e)/1e5}var c={textTransform:"uppercase"},l='"Roboto", "Helvetica", "Arial", sans-serif';function f(e,t){var n="function"==typeof t?t(e):t,r=n.fontFamily,f=void 0===r?l:r,d=n.fontSize,h=void 0===d?14:d,p=n.fontWeightLight,b=void 0===p?300:p,m=n.fontWeightRegular,g=void 0===m?400:m,v=n.fontWeightMedium,y=void 0===v?500:v,w=n.htmlFontSize,_=void 0===w?16:w,E=n.useNextVariants,S=void 0===E?Boolean(s.ponyfillGlobal.__MUI_USE_NEXT_TYPOGRAPHY_VARIANTS__):E,k=(n.suppressWarning,n.allVariants),x=(0,a.default)(n,["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","htmlFontSize","useNextVariants","suppressWarning","allVariants"]),T=h/14,M=function(e){return"".concat(e/_*T,"rem")},O=function(t,n,r,a,o){return(0,i.default)({color:e.text.primary,fontFamily:f,fontWeight:t,fontSize:M(n),lineHeight:r},f===l?{letterSpacing:"".concat(u(a/n),"em")}:{},o,k)},A={h1:O(b,96,1,-1.5),h2:O(b,60,1,-.5),h3:O(g,48,1.04,0),h4:O(g,34,1.17,.25),h5:O(g,24,1.33,0),h6:O(y,20,1.6,.15),subtitle1:O(g,16,1.75,.15),subtitle2:O(y,14,1.57,.1),body1Next:O(g,16,1.5,.15),body2Next:O(g,14,1.5,.15),buttonNext:O(y,14,1.75,.4,c),captionNext:O(g,12,1.66,.4),overline:O(g,12,2.66,1,c)},L={display4:(0,i.default)({fontSize:M(112),fontWeight:b,fontFamily:f,letterSpacing:"-.04em",lineHeight:"".concat(u(128/112),"em"),marginLeft:"-.04em",color:e.text.secondary},k),display3:(0,i.default)({fontSize:M(56),fontWeight:g,fontFamily:f,letterSpacing:"-.02em",lineHeight:"".concat(u(73/56),"em"),marginLeft:"-.02em",color:e.text.secondary},k),display2:(0,i.default)({fontSize:M(45),fontWeight:g,fontFamily:f,lineHeight:"".concat(u(51/45),"em"),marginLeft:"-.02em",color:e.text.secondary},k),display1:(0,i.default)({fontSize:M(34),fontWeight:g,fontFamily:f,lineHeight:"".concat(u(41/34),"em"),color:e.text.secondary},k),headline:(0,i.default)({fontSize:M(24),fontWeight:g,fontFamily:f,lineHeight:"".concat(u(32.5/24),"em"),color:e.text.primary},k),title:(0,i.default)({fontSize:M(21),fontWeight:y,fontFamily:f,lineHeight:"".concat(u(24.5/21),"em"),color:e.text.primary},k),subheading:(0,i.default)({fontSize:M(16),fontWeight:g,fontFamily:f,lineHeight:"".concat(u(1.5),"em"),color:e.text.primary},k),body2:(0,i.default)({fontSize:M(14),fontWeight:y,fontFamily:f,lineHeight:"".concat(u(24/14),"em"),color:e.text.primary},k),body1:(0,i.default)({fontSize:M(14),fontWeight:g,fontFamily:f,lineHeight:"".concat(u(20.5/14),"em"),color:e.text.primary},k),caption:(0,i.default)({fontSize:M(12),fontWeight:g,fontFamily:f,lineHeight:"".concat(u(1.375),"em"),color:e.text.secondary},k),button:(0,i.default)({fontSize:M(14),textTransform:"uppercase",fontWeight:y,fontFamily:f,color:e.text.primary},k)};return(0,o.default)((0,i.default)({pxToRem:M,round:u,fontFamily:f,fontSize:h,fontWeightLight:b,fontWeightRegular:g,fontWeightMedium:y},L,A,S?{body1:A.body1Next,body2:A.body2Next,button:A.buttonNext,caption:A.captionNext}:{},{useNextVariants:S}),x,{clone:!1})}},42458(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(10434));r(n(18698)),r(n(42473));var a=r(n(94863));function o(e,t){return t}function s(e){var t="function"==typeof e;function n(n,r){var s=t?e(n):e;if(!r||!n.overrides||!n.overrides[r])return s;var u=n.overrides[r],c=(0,i.default)({},s);return Object.keys(u).forEach(function(e){c[e]=(0,a.default)(c[e],u[e],{arrayMerge:o})}),c}return{create:n,options:{},themingEnabled:t}}var u=s;t.default=u},58057(e,t){"use strict";function n(e){var t,n=e.theme,r=e.name,i=e.props;if(!n.props||!r||!n.props[r])return i;var a=n.props[r];for(t in a)void 0===i[t]&&(i[t]=a[t]);return i}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n;t.default=r},32316(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"createGenerateClassName",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(t,"createMuiTheme",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(t,"jssPreset",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"MuiThemeProvider",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(t,"createStyles",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(t,"withStyles",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(t,"withTheme",{enumerable:!0,get:function(){return l.default}});var i=r(n(20237)),a=r(n(71615)),o=r(n(9399)),s=r(n(72366)),u=r(n(16059)),c=r(n(78252)),l=r(n(82313))},9399(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(29059)),a=r(n(28752)),o=r(n(35828)),s=r(n(50462)),u=r(n(65926)),c=r(n(89347));function l(){return{plugins:[(0,i.default)(),(0,a.default)(),(0,o.default)(),(0,s.default)(),"undefined"==typeof window?null:(0,u.default)(),(0,c.default)()]}}var f=l;t.default=f},35199(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(10434));function a(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.baseClasses,n=e.newClasses;if(e.Component,!n)return t;var r=(0,i.default)({},t);return Object.keys(n).forEach(function(e){n[e]&&(r[e]="".concat(t[e]," ").concat(n[e]))}),r}r(n(42473)),n(55252);var o=a;t.default=o},88693(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n={set:function(e,t,n,r){var i=e.get(t);i||(i=new Map,e.set(t,i)),i.set(n,r)},get:function(e,t,n){var r=e.get(t);return r?r.get(n):void 0},delete:function(e,t,n){e.get(t).delete(n)}};t.default=n},31898(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n={jss:"64a55d578f856d258dc345b094a2a2b3",sheetsRegistry:"d4bd0baacbc52bbd48bbb9eb24344ecd",sheetOptions:"6fc570d6bd61383819d0f9e7407c452d"};t.default=n},80743(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=.2,r=.14,i=.12;function a(){return["".concat(arguments.length<=0?void 0:arguments[0],"px ").concat(arguments.length<=1?void 0:arguments[1],"px ").concat(arguments.length<=2?void 0:arguments[2],"px ").concat(arguments.length<=3?void 0:arguments[3],"px rgba(0,0,0,").concat(n,")"),"".concat(arguments.length<=4?void 0:arguments[4],"px ").concat(arguments.length<=5?void 0:arguments[5],"px ").concat(arguments.length<=6?void 0:arguments[6],"px ").concat(arguments.length<=7?void 0:arguments[7],"px rgba(0,0,0,").concat(r,")"),"".concat(arguments.length<=8?void 0:arguments[8],"px ").concat(arguments.length<=9?void 0:arguments[9],"px ").concat(arguments.length<=10?void 0:arguments[10],"px ").concat(arguments.length<=11?void 0:arguments[11],"px rgba(0,0,0,").concat(i,")")].join(",")}var o=["none",a(0,1,3,0,0,1,1,0,0,2,1,-1),a(0,1,5,0,0,2,2,0,0,3,1,-2),a(0,1,8,0,0,3,4,0,0,3,3,-2),a(0,2,4,-1,0,4,5,0,0,1,10,0),a(0,3,5,-1,0,5,8,0,0,1,14,0),a(0,3,5,-1,0,6,10,0,0,1,18,0),a(0,4,5,-2,0,7,10,1,0,2,16,1),a(0,5,5,-3,0,8,10,1,0,3,14,2),a(0,5,6,-3,0,9,12,1,0,3,16,2),a(0,6,6,-3,0,10,14,1,0,4,18,3),a(0,6,7,-4,0,11,15,1,0,4,20,3),a(0,7,8,-4,0,12,17,2,0,5,22,4),a(0,7,8,-4,0,13,19,2,0,5,24,4),a(0,7,9,-4,0,14,21,2,0,5,26,4),a(0,8,9,-5,0,15,22,2,0,6,28,5),a(0,8,10,-5,0,16,24,2,0,6,30,5),a(0,8,11,-5,0,17,26,2,0,6,32,5),a(0,9,11,-5,0,18,28,2,0,7,34,6),a(0,9,12,-6,0,19,29,2,0,7,36,6),a(0,10,13,-6,0,20,31,3,0,8,38,7),a(0,10,13,-6,0,21,33,3,0,8,40,7),a(0,10,14,-6,0,22,35,3,0,8,42,7),a(0,11,14,-7,0,23,36,3,0,9,44,8),a(0,11,15,-7,0,24,38,3,0,9,46,8)];t.default=o},59591(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n={borderRadius:4};t.default=n},5324(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n={unit:8};t.default=n},51067(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.CHANNEL=void 0;var i=r(n(38416)),a="__THEMING__";t.CHANNEL=a;var o={contextTypes:(0,i.default)({},a,function(){}),initial:function(e){return e[a]?e[a].getState():null},subscribe:function(e,t){return e[a]?e[a].subscribe(t):null},unsubscribe:function(e,t){e[a]&&e[a].unsubscribe(t)}};t.default=o},15406(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.isNumber=t.isString=t.formatMs=t.duration=t.easing=void 0;var i=r(n(70215));r(n(42473));var a={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"};t.easing=a;var o={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};t.duration=o;var s=function(e){return"".concat(Math.round(e),"ms")};t.formatMs=s;var u=function(e){return"string"==typeof e};t.isString=u;var c=function(e){return!isNaN(parseFloat(e))};t.isNumber=c;var l={easing:a,duration:o,create:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["all"],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.duration,r=void 0===n?o.standard:n,u=t.easing,c=void 0===u?a.easeInOut:u,l=t.delay,f=void 0===l?0:l;return(0,i.default)(t,["duration","easing","delay"]),(Array.isArray(e)?e:[e]).map(function(e){return"".concat(e," ").concat("string"==typeof r?r:s(r)," ").concat(c," ").concat("string"==typeof f?f:s(f))}).join(",")},getAutoHeightDuration:function(e){if(!e)return 0;var t=e/36;return Math.round((4+15*Math.pow(t,.25)+t/5)*10)}};t.default=l},78252(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.sheetsManager=void 0;var i=r(n(38416)),a=r(n(10434)),o=r(n(56690)),s=r(n(89728)),u=r(n(94993)),c=r(n(73808)),l=r(n(61655)),f=r(n(70215)),d=r(n(67294)),h=r(n(45697));r(n(42473));var p=r(n(8679)),b=n(55252),m=n(55690),g=r(n(31898)),v=r(n(9399)),y=r(n(35199)),w=r(n(88693)),_=r(n(71615)),E=r(n(51067)),S=r(n(20237)),k=r(n(42458)),x=r(n(58057)),T=(0,m.create)((0,v.default)()),M=(0,S.default)(),O=-1e11,A=new Map;t.sheetsManager=A;var L={},C=(0,_.default)({typography:{suppressWarning:!0}}),I=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(n){var r,b=t.withTheme,m=void 0!==b&&b,v=t.flip,_=void 0===v?null:v,S=t.name,I=(0,f.default)(t,["withTheme","flip","name"]),D=(0,k.default)(e),N=D.themingEnabled||"string"==typeof S||m;O+=1,D.options.index=O;var P=function(e){function t(e,n){(0,o.default)(this,t),(r=(0,u.default)(this,(0,c.default)(t).call(this,e,n))).jss=n[g.default.jss]||T,r.sheetsManager=A,r.unsubscribeId=null;var r,i=n.muiThemeProviderOptions;return i&&(i.sheetsManager&&(r.sheetsManager=i.sheetsManager),r.sheetsCache=i.sheetsCache,r.disableStylesGeneration=i.disableStylesGeneration),r.stylesCreatorSaved=D,r.sheetOptions=(0,a.default)({generateClassName:M},n[g.default.sheetOptions]),r.theme=N?E.default.initial(n)||C:L,r.attach(r.theme),r.cacheClasses={value:null,lastProp:null,lastJSS:{}},r}return(0,l.default)(t,e),(0,s.default)(t,[{key:"componentDidMount",value:function(){var e=this;N&&(this.unsubscribeId=E.default.subscribe(this.context,function(t){var n=e.theme;e.theme=t,e.attach(e.theme),e.setState({},function(){e.detach(n)})}))}},{key:"componentDidUpdate",value:function(){this.stylesCreatorSaved}},{key:"componentWillUnmount",value:function(){this.detach(this.theme),null!==this.unsubscribeId&&E.default.unsubscribe(this.context,this.unsubscribeId)}},{key:"getClasses",value:function(){if(this.disableStylesGeneration)return this.props.classes||{};var e=!1,t=w.default.get(this.sheetsManager,this.stylesCreatorSaved,this.theme);return t.sheet.classes!==this.cacheClasses.lastJSS&&(this.cacheClasses.lastJSS=t.sheet.classes,e=!0),this.props.classes!==this.cacheClasses.lastProp&&(this.cacheClasses.lastProp=this.props.classes,e=!0),e&&(this.cacheClasses.value=(0,y.default)({baseClasses:this.cacheClasses.lastJSS,newClasses:this.props.classes,Component:n})),this.cacheClasses.value}},{key:"attach",value:function(e){if(!this.disableStylesGeneration){var t=this.stylesCreatorSaved,n=w.default.get(this.sheetsManager,t,e);if(n||(n={refs:0,sheet:null},w.default.set(this.sheetsManager,t,e,n)),0===n.refs){this.sheetsCache&&(r=w.default.get(this.sheetsCache,t,e)),!r&&((r=this.createSheet(e)).attach(),this.sheetsCache&&w.default.set(this.sheetsCache,t,e,r)),n.sheet=r;var r,i=this.context[g.default.sheetsRegistry];i&&i.add(r)}n.refs+=1}}},{key:"createSheet",value:function(e){var t=this.stylesCreatorSaved.create(e,S),r=S;return this.jss.createStyleSheet(t,(0,a.default)({meta:r,classNamePrefix:r,flip:"boolean"==typeof _?_:"rtl"===e.direction,link:!1},this.sheetOptions,this.stylesCreatorSaved.options,{name:S||n.displayName},I))}},{key:"detach",value:function(e){if(!this.disableStylesGeneration){var t=w.default.get(this.sheetsManager,this.stylesCreatorSaved,e);if(t.refs-=1,0===t.refs){w.default.delete(this.sheetsManager,this.stylesCreatorSaved,e),this.jss.removeStyleSheet(t.sheet);var n=this.context[g.default.sheetsRegistry];n&&n.remove(t.sheet)}}}},{key:"render",value:function(){var e=this.props,t=(e.classes,e.innerRef),r=(0,f.default)(e,["classes","innerRef"]),i=(0,x.default)({theme:this.theme,name:S,props:r});return m&&!i.theme&&(i.theme=this.theme),d.default.createElement(n,(0,a.default)({},i,{classes:this.getClasses(),ref:t}))}}]),t}(d.default.Component);return P.contextTypes=(0,a.default)((r={muiThemeProviderOptions:h.default.object},(0,i.default)(r,g.default.jss,h.default.object),(0,i.default)(r,g.default.sheetOptions,h.default.object),(0,i.default)(r,g.default.sheetsRegistry,h.default.object),r),N?E.default.contextTypes:{}),(0,p.default)(P,n),P}};b.ponyfillGlobal.__MUI_STYLES__||(b.ponyfillGlobal.__MUI_STYLES__={}),b.ponyfillGlobal.__MUI_STYLES__.withStyles||(b.ponyfillGlobal.__MUI_STYLES__.withStyles=I);var D=function(e,t){return b.ponyfillGlobal.__MUI_STYLES__.withStyles(e,(0,a.default)({defaultTheme:C},t))};t.default=D},82313(e,t,n){"use strict";var r,i=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=i(n(10434)),o=i(n(70215)),s=i(n(56690)),u=i(n(89728)),c=i(n(94993)),l=i(n(73808)),f=i(n(61655)),d=i(n(67294));i(n(45697));var h=i(n(8679)),p=n(55252),b=i(n(71615)),m=i(n(51067));function g(){return r||(r=(0,b.default)({typography:{suppressWarning:!0}}))}var v=function(){return function(e){var t=function(t){function n(e,t){var r;return(0,s.default)(this,n),(r=(0,c.default)(this,(0,l.default)(n).call(this))).state={theme:m.default.initial(t)||g()},r}return(0,f.default)(n,t),(0,u.default)(n,[{key:"componentDidMount",value:function(){var e=this;this.unsubscribeId=m.default.subscribe(this.context,function(t){e.setState({theme:t})})}},{key:"componentWillUnmount",value:function(){null!==this.unsubscribeId&&m.default.unsubscribe(this.context,this.unsubscribeId)}},{key:"render",value:function(){var t=this.props,n=t.innerRef,r=(0,o.default)(t,["innerRef"]);return d.default.createElement(e,(0,a.default)({theme:this.state.theme,ref:n},r))}}]),n}(d.default.Component);return t.contextTypes=m.default.contextTypes,(0,h.default)(t,e),t}};p.ponyfillGlobal.__MUI_STYLES__||(p.ponyfillGlobal.__MUI_STYLES__={}),p.ponyfillGlobal.__MUI_STYLES__.withTheme||(p.ponyfillGlobal.__MUI_STYLES__.withTheme=v);var y=p.ponyfillGlobal.__MUI_STYLES__.withTheme;t.default=y},88676(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n={mobileStepper:1e3,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500};t.default=n},41929(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getTransitionProps=r,t.reflow=void 0;var n=function(e){return e.scrollTop};function r(e,t){var n=e.timeout,r=e.style,i=void 0===r?{}:r;return{duration:i.transitionDuration||"number"==typeof n?n:n[t.mode],delay:i.transitionDelay}}t.reflow=n},346(e,t){"use strict";function n(e,t){return function(){return null}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n;t.default=r},98741(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.capitalize=a,t.contains=o,t.findIndex=s,t.find=u,t.createChainedFunction=c;var i=r(n(18698));function a(e){return e.charAt(0).toUpperCase()+e.slice(1)}function o(e,t){return Object.keys(t).every(function(n){return e.hasOwnProperty(n)&&e[n]===t[n]})}function s(e,t){for(var n=(0,i.default)(t),r=0;r-1?e[n]:void 0}function c(){for(var e=arguments.length,t=Array(e),n=0;n1&&void 0!==arguments[1]?arguments[1]:window,n=(0,i.default)(e);return n.defaultView||n.parentView||t}var o=a;t.default=o},44370(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.cloneElementWithClassName=o,t.cloneChildrenWithClassName=s,t.isMuiElement=u,t.setRef=c;var i=r(n(67294)),a=r(n(94184));function o(e,t){return i.default.cloneElement(e,{className:(0,a.default)(e.props.className,t)})}function s(e,t){return i.default.Children.map(e,function(e){return i.default.isValidElement(e)&&o(e,t)})}function u(e,t){return i.default.isValidElement(e)&&-1!==t.indexOf(e.type.muiName)}function c(e,t){"function"==typeof e?e(t):e&&(e.current=t)}},47348(e,t){"use strict";function n(e){return function(){return null}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n;t.default=r},21677(e,t){"use strict";function n(e,t,n,r,i){return null}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n;t.default=r},78290(e,t,n){"use strict";var r=n(75263);Object.defineProperty(t,"__esModule",{value:!0});var i={};Object.defineProperty(t,"default",{enumerable:!0,get:function(){return a.default}});var a=r(n(88446));Object.keys(a).forEach(function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(i,e)||Object.defineProperty(t,e,{enumerable:!0,get:function(){return a[e]}}))})},88446(e,t,n){"use strict";var r=n(64836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.isWidthDown=t.isWidthUp=void 0;var i=r(n(10434)),a=r(n(70215)),o=r(n(56690)),s=r(n(89728)),u=r(n(94993)),c=r(n(73808)),l=r(n(61655)),f=r(n(67294));r(n(45697));var d=r(n(96421)),h=r(n(20296));n(55252);var p=r(n(8679)),b=r(n(82313)),m=n(94811),g=r(n(58057)),v=function(e,t){var n=!(arguments.length>2)||void 0===arguments[2]||arguments[2];return n?m.keys.indexOf(e)<=m.keys.indexOf(t):m.keys.indexOf(e)2)||void 0===arguments[2]||arguments[2];return n?m.keys.indexOf(t)<=m.keys.indexOf(e):m.keys.indexOf(t)0&&void 0!==arguments[0]?arguments[0]:{};return function(t){var n=e.withTheme,r=void 0!==n&&n,v=e.noSSR,y=void 0!==v&&v,w=e.initialWidth,_=e.resizeInterval,E=void 0===_?166:_,S=function(e){function n(e){var t;return(0,o.default)(this,n),(t=(0,u.default)(this,(0,c.default)(n).call(this,e))).state={width:y?t.getWidth():void 0},"undefined"!=typeof window&&(t.handleResize=(0,h.default)(function(){var e=t.getWidth();e!==t.state.width&&t.setState({width:e})},E)),t}return(0,l.default)(n,e),(0,s.default)(n,[{key:"componentDidMount",value:function(){var e=this.getWidth();e!==this.state.width&&this.setState({width:e})}},{key:"componentWillUnmount",value:function(){this.handleResize.clear()}},{key:"getWidth",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.innerWidth,t=this.props.theme.breakpoints,n=null,r=1;null===n&&ri.Z,componentPropType:()=>r.Z,exactProp:()=>a.ZP,getDisplayName:()=>o.ZP,ponyfillGlobal:()=>s.Z});var r=n(78728),i=n(5477),a=n(43781),o=n(25189),s=n(34712);/** @license Material-UI v3.0.0-alpha.3 + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ },34712(e,t){"use strict";n={value:!0},t.Z=void 0;var n,r="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();t.Z=r},82152(e,t,n){"use strict";n.d(t,{D:()=>u});var r=Object.prototype,i=r.toString,a=r.hasOwnProperty,o=Function.prototype.toString,s=new Map;function u(e,t){try{return c(e,t)}finally{s.clear()}}function c(e,t){if(e===t)return!0;var n=i.call(e),r=i.call(t);if(n!==r)return!1;switch(n){case"[object Array]":if(e.length!==t.length)break;case"[object Object]":if(p(e,t))return!0;var s=l(e),u=l(t),f=s.length;if(f!==u.length)break;for(var b=0;b=0&&e.indexOf(t,n)===n}function p(e,t){var n=s.get(e);if(n){if(n.has(t))return!0}else s.set(e,n=new Set);return n.add(t),!1}},79742(e,t){"use strict";t.byteLength=c,t.toByteArray=f,t.fromByteArray=p;for(var n=[],r=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,s=a.length;o0)throw Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");-1===n&&(n=t);var r=n===t?0:4-n%4;return[n,r]}function c(e){var t=u(e),n=t[0],r=t[1];return(n+r)*3/4-r}function l(e,t,n){return(t+n)*3/4-n}function f(e){var t,n,a=u(e),o=a[0],s=a[1],c=new i(l(e,o,s)),f=0,d=s>0?o-4:o;for(n=0;n>16&255,c[f++]=t>>8&255,c[f++]=255&t;return 2===s&&(t=r[e.charCodeAt(n)]<<2|r[e.charCodeAt(n+1)]>>4,c[f++]=255&t),1===s&&(t=r[e.charCodeAt(n)]<<10|r[e.charCodeAt(n+1)]<<4|r[e.charCodeAt(n+2)]>>2,c[f++]=t>>8&255,c[f++]=255&t),c}function d(e){return n[e>>18&63]+n[e>>12&63]+n[e>>6&63]+n[63&e]}function h(e,t,n){for(var r,i=[],a=t;au?u:s+o));return 1===i?a.push(n[(t=e[r-1])>>2]+n[t<<4&63]+"=="):2===i&&a.push(n[(t=(e[r-2]<<8)+e[r-1])>>10]+n[t>>4&63]+n[t<<2&63]+"="),a.join("")}r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63},44431:function(e,t,n){var r;!function(i){"use strict";var a,o=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,s=Math.ceil,u=Math.floor,c="[BigNumber Error] ",l=c+"Number primitive has more than 15 significant digits: ",f=1e14,d=14,h=9007199254740991,p=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],b=1e7,m=1e9;function g(e){var t,n,r,i,a,x,T,M,O,A,L=$.prototype={constructor:$,toString:null,valueOf:null},C=new $(1),I=20,D=4,N=-7,P=21,R=-1e7,j=1e7,F=!1,Y=1,B=0,U={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:"\xa0",suffix:""},H="0123456789abcdefghijklmnopqrstuvwxyz";function $(e,t){var n,r,i,a,s,c,f,p,b=this;if(!(b instanceof $))return new $(e,t);if(null==t){if(e&&!0===e._isBigNumber){b.s=e.s,!e.c||e.e>j?b.c=b.e=null:e.e=10;s/=10,a++);a>j?b.c=b.e=null:(b.e=a,b.c=[e]);return}p=String(e)}else{if(!o.test(p=String(e)))return A(b,p,c);b.s=45==p.charCodeAt(0)?(p=p.slice(1),-1):1}(a=p.indexOf("."))>-1&&(p=p.replace(".","")),(s=p.search(/e/i))>0?(a<0&&(a=s),a+=+p.slice(s+1),p=p.substring(0,s)):a<0&&(a=p.length)}else{if(_(t,2,H.length,"Base"),10==t)return b=new $(e),K(b,I+b.e+1,D);if(p=String(e),c="number"==typeof e){if(0*e!=0)return A(b,p,c,t);if(b.s=1/e<0?(p=p.slice(1),-1):1,$.DEBUG&&p.replace(/^0\.0*|\./,"").length>15)throw Error(l+e)}else b.s=45===p.charCodeAt(0)?(p=p.slice(1),-1):1;for(n=H.slice(0,t),a=s=0,f=p.length;sn.indexOf(r=p.charAt(s))){if("."==r){if(s>a){a=f;continue}}else if(!i&&(p==p.toUpperCase()&&(p=p.toLowerCase())||p==p.toLowerCase()&&(p=p.toUpperCase()))){i=!0,s=-1,a=0;continue}return A(b,String(e),c,t)}c=!1,(a=(p=O(p,t,10,b.s)).indexOf("."))>-1?p=p.replace(".",""):a=p.length}for(s=0;48===p.charCodeAt(s);s++);for(f=p.length;48===p.charCodeAt(--f););if(p=p.slice(s,++f)){if(f-=s,c&&$.DEBUG&&f>15&&(e>h||e!==u(e)))throw Error(l+b.s*e);if((a=a-s-1)>j)b.c=b.e=null;else if(a=P)?S(u,o):k(u,o,"0");else if(a=(e=K(new $(e),t,n)).e,s=(u=y(e.c)).length,1==r||2==r&&(t<=a||a<=N)){for(;ss){if(--t>0)for(u+=".";t--;u+="0");}else if((t+=a-s)>0)for(a+1==s&&(u+=".");t--;u+="0");return e.s<0&&i?"-"+u:u}function G(e,t){for(var n,r=1,i=new $(e[0]);r=10;i/=10,r++);return(n=r+n*d-1)>j?e.c=e.e=null:n=10;c/=10,i++);if((a=t-i)<0)a+=d,o=t,b=(l=m[h=0])/g[i-o-1]%10|0;else if((h=s((a+1)/d))>=m.length){if(r){for(;m.length<=h;m.push(0));l=b=0,i=1,a%=d,o=a-d+1}else break out}else{for(i=1,l=c=m[h];c>=10;c/=10,i++);a%=d,b=(o=a-d+i)<0?0:l/g[i-o-1]%10|0}if(r=r||t<0||null!=m[h+1]||(o<0?l:l%g[i-o-1]),r=n<4?(b||r)&&(0==n||n==(e.s<0?3:2)):b>5||5==b&&(4==n||r||6==n&&(a>0?o>0?l/g[i-o]:0:m[h-1])%10&1||n==(e.s<0?8:7)),t<1||!m[0])return m.length=0,r?(t-=e.e+1,m[0]=g[(d-t%d)%d],e.e=-t||0):m[0]=e.e=0,e;if(0==a?(m.length=h,c=1,h--):(m.length=h+1,c=g[d-a],m[h]=o>0?u(l/g[i-o]%g[o])*c:0),r)for(;;){if(0==h){for(a=1,o=m[0];o>=10;o/=10,a++);for(o=m[0]+=c,c=1;o>=10;o/=10,c++);a!=c&&(e.e++,m[0]==f&&(m[0]=1));break}if(m[h]+=c,m[h]!=f)break;m[h--]=0,c=1}for(a=m.length;0===m[--a];m.pop());}e.e>j?e.c=e.e=null:e.e=P?S(t,n):k(t,n,"0"),e.s<0?"-"+t:t)}return $.clone=g,$.ROUND_UP=0,$.ROUND_DOWN=1,$.ROUND_CEIL=2,$.ROUND_FLOOR=3,$.ROUND_HALF_UP=4,$.ROUND_HALF_DOWN=5,$.ROUND_HALF_EVEN=6,$.ROUND_HALF_CEIL=7,$.ROUND_HALF_FLOOR=8,$.EUCLID=9,$.config=$.set=function(e){var t,n;if(null!=e){if("object"==typeof e){if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(_(n=e[t],0,m,t),I=n),e.hasOwnProperty(t="ROUNDING_MODE")&&(_(n=e[t],0,8,t),D=n),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((n=e[t])&&n.pop?(_(n[0],-m,0,t),_(n[1],0,m,t),N=n[0],P=n[1]):(_(n,-m,m,t),N=-(P=n<0?-n:n))),e.hasOwnProperty(t="RANGE")){if((n=e[t])&&n.pop)_(n[0],-m,-1,t),_(n[1],1,m,t),R=n[0],j=n[1];else if(_(n,-m,m,t),n)R=-(j=n<0?-n:n);else throw Error(c+t+" cannot be zero: "+n)}if(e.hasOwnProperty(t="CRYPTO")){if(!!(n=e[t])===n){if(n){if("undefined"!=typeof crypto&&crypto&&(crypto.getRandomValues||crypto.randomBytes))F=n;else throw F=!n,Error(c+"crypto unavailable")}else F=n}else throw Error(c+t+" not true or false: "+n)}if(e.hasOwnProperty(t="MODULO_MODE")&&(_(n=e[t],0,9,t),Y=n),e.hasOwnProperty(t="POW_PRECISION")&&(_(n=e[t],0,m,t),B=n),e.hasOwnProperty(t="FORMAT")){if("object"==typeof(n=e[t]))U=n;else throw Error(c+t+" not an object: "+n)}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(n=e[t])||/^.?$|[+\-.\s]|(.).*\1/.test(n))throw Error(c+t+" invalid: "+n);H=n}}else throw Error(c+"Object expected: "+e)}return{DECIMAL_PLACES:I,ROUNDING_MODE:D,EXPONENTIAL_AT:[N,P],RANGE:[R,j],CRYPTO:F,MODULO_MODE:Y,POW_PRECISION:B,FORMAT:U,ALPHABET:H}},$.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!$.DEBUG)return!0;var t,n,r=e.c,i=e.e,a=e.s;out:if("[object Array]"==({}).toString.call(r)){if((1===a||-1===a)&&i>=-m&&i<=m&&i===u(i)){if(0===r[0]){if(0===i&&1===r.length)return!0;break out}if((t=(i+1)%d)<1&&(t+=d),String(r[0]).length==t){for(t=0;t=f||n!==u(n))break out;if(0!==n)return!0}}}else if(null===r&&null===i&&(null===a||1===a||-1===a))return!0;throw Error(c+"Invalid BigNumber: "+e)},$.maximum=$.max=function(){return G(arguments,L.lt)},$.minimum=$.min=function(){return G(arguments,L.gt)},$.random=(n=Math.random()*(t=9007199254740992)&2097151?function(){return u(Math.random()*t)}:function(){return(1073741824*Math.random()|0)*8388608+(8388608*Math.random()|0)},function(e){var t,r,i,a,o,l=0,f=[],h=new $(C);if(null==e?e=I:_(e,0,m),a=s(e/d),F){if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(a*=2));l>>11))>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),t[l]=r[0],t[l+1]=r[1]):(f.push(o%1e14),l+=2);l=a/2}else if(crypto.randomBytes){for(t=crypto.randomBytes(a*=7);l=9e15?crypto.randomBytes(7).copy(t,l):(f.push(o%1e14),l+=7);l=a/7}else throw F=!1,Error(c+"crypto unavailable")}if(!F)for(;l=10;o/=10,l++);ln-1&&(null==o[i+1]&&(o[i+1]=0),o[i+1]+=o[i]/n|0,o[i]%=n)}return o.reverse()}return function(n,r,i,a,o){var s,u,c,l,f,d,h,p,b=n.indexOf("."),m=I,g=D;for(b>=0&&(l=B,B=0,n=n.replace(".",""),d=(p=new $(r)).pow(n.length-b),B=l,p.c=t(k(y(d.c),d.e,"0"),10,i,e),p.e=p.c.length),c=l=(h=t(n,r,i,o?(s=H,e):(s=e,H))).length;0==h[--l];h.pop());if(!h[0])return s.charAt(0);if(b<0?--c:(d.c=h,d.e=c,d.s=a,h=(d=M(d,p,m,g,i)).c,f=d.r,c=d.e),b=h[u=c+m+1],l=i/2,f=f||u<0||null!=h[u+1],f=g<4?(null!=b||f)&&(0==g||g==(d.s<0?3:2)):b>l||b==l&&(4==g||f||6==g&&1&h[u-1]||g==(d.s<0?8:7)),u<1||!h[0])n=f?k(s.charAt(1),-m,s.charAt(0)):s.charAt(0);else{if(h.length=u,f)for(--i;++h[--u]>i;)h[u]=0,u||(++c,h=[1].concat(h));for(l=h.length;!h[--l];);for(b=0,n="";b<=l;n+=s.charAt(h[b++]));n=k(n,c,s.charAt(0))}return n}}(),M=function(){function e(e,t,n){var r,i,a,o,s=0,u=e.length,c=t%b,l=t/b|0;for(e=e.slice();u--;)r=l*(a=e[u]%b)+(o=e[u]/b|0)*c,s=((i=c*a+r%b*b+s)/n|0)+(r/b|0)+l*o,e[u]=i%n;return s&&(e=[s].concat(e)),e}function t(e,t,n,r){var i,a;if(n!=r)a=n>r?1:-1;else for(i=a=0;it[i]?1:-1;break}return a}function n(e,t,n,r){for(var i=0;n--;)e[n]-=i,i=e[n]1;e.splice(0,1));}return function(r,i,a,o,s){var c,l,h,p,b,m,g,y,w,_,E,S,k,x,T,M,O,A=r.s==i.s?1:-1,L=r.c,C=i.c;if(!L||!L[0]||!C||!C[0])return new $(r.s&&i.s&&(L?!C||L[0]!=C[0]:C)?L&&0==L[0]||!C?0*A:A/0:NaN);for(w=(y=new $(A)).c=[],A=a+(l=r.e-i.e)+1,s||(s=f,l=v(r.e/d)-v(i.e/d),A=A/d|0),h=0;C[h]==(L[h]||0);h++);if(C[h]>(L[h]||0)&&l--,A<0)w.push(1),p=!0;else{for(x=L.length,M=C.length,h=0,A+=2,(b=u(s/(C[0]+1)))>1&&(C=e(C,b,s),L=e(L,b,s),M=C.length,x=L.length),k=M,E=(_=L.slice(0,M)).length;E=s/2&&T++;do{if(b=0,(c=t(C,_,M,E))<0){if(S=_[0],M!=E&&(S=S*s+(_[1]||0)),(b=u(S/T))>1)for(b>=s&&(b=s-1),g=(m=e(C,b,s)).length,E=_.length;1==t(m,_,g,E);)b--,n(m,Mt(C,_,M,E);)b++,n(_,M=10;A/=10,h++);K(y,a+(y.e=h+l*d-1)+1,o,p)}else y.e=l,y.r=+p;return y}}(),A=(r=/^(-?)0([xbo])(?=\w[\w.]*$)/i,i=/^([^.]+)\.$/,a=/^\.([^.]+)$/,x=/^-?(Infinity|NaN)$/,T=/^\s*\+(?=[\w.])|^\s+|\s+$/g,function(e,t,n,o){var s,u=n?t:t.replace(T,"");if(x.test(u))e.s=isNaN(u)?null:u<0?-1:1;else{if(!n&&(u=u.replace(r,function(e,t,n){return s="x"==(n=n.toLowerCase())?16:"b"==n?2:8,o&&o!=s?e:t}),o&&(s=o,u=u.replace(i,"$1").replace(a,"0.$1")),t!=u))return new $(u,s);if($.DEBUG)throw Error(c+"Not a"+(o?" base "+o:"")+" number: "+t);e.s=null}e.c=e.e=null}),L.absoluteValue=L.abs=function(){var e=new $(this);return e.s<0&&(e.s=1),e},L.comparedTo=function(e,t){return w(this,new $(e,t))},L.decimalPlaces=L.dp=function(e,t){var n,r,i,a=this;if(null!=e)return _(e,0,m),null==t?t=D:_(t,0,8),K(new $(a),e+a.e+1,t);if(!(n=a.c))return null;if(r=((i=n.length-1)-v(this.e/d))*d,i=n[i])for(;i%10==0;i/=10,r--);return r<0&&(r=0),r},L.dividedBy=L.div=function(e,t){return M(this,new $(e,t),I,D)},L.dividedToIntegerBy=L.idiv=function(e,t){return M(this,new $(e,t),0,1)},L.exponentiatedBy=L.pow=function(e,t){var n,r,i,a,o,l,f,h,p,b=this;if((e=new $(e)).c&&!e.isInteger())throw Error(c+"Exponent not an integer: "+V(e));if(null!=t&&(t=new $(t)),l=e.e>14,!b.c||!b.c[0]||1==b.c[0]&&!b.e&&1==b.c.length||!e.c||!e.c[0])return p=new $(Math.pow(+V(b),l?2-E(e):+V(e))),t?p.mod(t):p;if(f=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new $(NaN);(r=!f&&b.isInteger()&&t.isInteger())&&(b=b.mod(t))}else{if(e.e>9&&(b.e>0||b.e<-1||(0==b.e?b.c[0]>1||l&&b.c[1]>=24e7:b.c[0]<8e13||l&&b.c[0]<=9999975e7)))return a=(b.s<0&&E(e),-0),b.e>-1&&(a=1/a),new $(f?1/a:a);B&&(a=s(B/d+2))}for(l?(n=new $(.5),f&&(e.s=1),h=E(e)):h=(i=Math.abs(+V(e)))%2,p=new $(C);;){if(h){if(!(p=p.times(b)).c)break;a?p.c.length>a&&(p.c.length=a):r&&(p=p.mod(t))}if(i){if(0===(i=u(i/2)))break;h=i%2}else if(K(e=e.times(n),e.e+1,1),e.e>14)h=E(e);else{if(0==(i=+V(e)))break;h=i%2}b=b.times(b),a?b.c&&b.c.length>a&&(b.c.length=a):r&&(b=b.mod(t))}return r?p:(f&&(p=C.div(p)),t?p.mod(t):a?K(p,B,D,o):p)},L.integerValue=function(e){var t=new $(this);return null==e?e=D:_(e,0,8),K(t,t.e+1,e)},L.isEqualTo=L.eq=function(e,t){return 0===w(this,new $(e,t))},L.isFinite=function(){return!!this.c},L.isGreaterThan=L.gt=function(e,t){return w(this,new $(e,t))>0},L.isGreaterThanOrEqualTo=L.gte=function(e,t){return 1===(t=w(this,new $(e,t)))||0===t},L.isInteger=function(){return!!this.c&&v(this.e/d)>this.c.length-2},L.isLessThan=L.lt=function(e,t){return 0>w(this,new $(e,t))},L.isLessThanOrEqualTo=L.lte=function(e,t){return -1===(t=w(this,new $(e,t)))||0===t},L.isNaN=function(){return!this.s},L.isNegative=function(){return this.s<0},L.isPositive=function(){return this.s>0},L.isZero=function(){return!!this.c&&0==this.c[0]},L.minus=function(e,t){var n,r,i,a,o=this,s=o.s;if(t=(e=new $(e,t)).s,!s||!t)return new $(NaN);if(s!=t)return e.s=-t,o.plus(e);var u=o.e/d,c=e.e/d,l=o.c,h=e.c;if(!u||!c){if(!l||!h)return l?(e.s=-t,e):new $(h?o:NaN);if(!l[0]||!h[0])return h[0]?(e.s=-t,e):new $(l[0]?o:-0)}if(u=v(u),c=v(c),l=l.slice(),s=u-c){for((a=s<0)?(s=-s,i=l):(c=u,i=h),i.reverse(),t=s;t--;i.push(0));i.reverse()}else for(r=(a=(s=l.length)<(t=h.length))?s:t,s=t=0;t0)for(;t--;l[n++]=0);for(t=f-1;r>s;){if(l[--r]=0;){for(n=0,p=S[i]%w,m=S[i]/w|0,a=i+(o=u);a>i;)s=m*(c=E[--o]%w)+(l=E[o]/w|0)*p,n=((c=p*c+s%w*w+g[a]+n)/y|0)+(s/w|0)+m*l,g[a--]=c%y;g[a]=n}return n?++r:g.splice(0,1),W(e,g,r)},L.negated=function(){var e=new $(this);return e.s=-e.s||null,e},L.plus=function(e,t){var n,r=this,i=r.s;if(t=(e=new $(e,t)).s,!i||!t)return new $(NaN);if(i!=t)return e.s=-t,r.minus(e);var a=r.e/d,o=e.e/d,s=r.c,u=e.c;if(!a||!o){if(!s||!u)return new $(i/0);if(!s[0]||!u[0])return u[0]?e:new $(s[0]?r:0*i)}if(a=v(a),o=v(o),s=s.slice(),i=a-o){for(i>0?(o=a,n=u):(i=-i,n=s),n.reverse();i--;n.push(0));n.reverse()}for((i=s.length)-(t=u.length)<0&&(n=u,u=s,s=n,t=i),i=0;t;)i=(s[--t]=s[t]+u[t]+i)/f|0,s[t]=f===s[t]?0:s[t]%f;return i&&(s=[i].concat(s),++o),W(e,s,o)},L.precision=L.sd=function(e,t){var n,r,i,a=this;if(null!=e&&!!e!==e)return _(e,1,m),null==t?t=D:_(t,0,8),K(new $(a),e,t);if(!(n=a.c))return null;if(r=(i=n.length-1)*d+1,i=n[i]){for(;i%10==0;i/=10,r--);for(i=n[0];i>=10;i/=10,r++);}return e&&a.e+1>r&&(r=a.e+1),r},L.shiftedBy=function(e){return _(e,-h,h),this.times("1e"+e)},L.squareRoot=L.sqrt=function(){var e,t,n,r,i,a=this,o=a.c,s=a.s,u=a.e,c=I+4,l=new $("0.5");if(1!==s||!o||!o[0])return new $(!s||s<0&&(!o||o[0])?NaN:o?a:1/0);if(0==(s=Math.sqrt(+V(a)))||s==1/0?(((t=y(o)).length+u)%2==0&&(t+="0"),s=Math.sqrt(+t),u=v((u+1)/2)-(u<0||u%2),t=s==1/0?"5e"+u:(t=s.toExponential()).slice(0,t.indexOf("e")+1)+u,n=new $(t)):n=new $(s+""),n.c[0]){for((s=(u=n.e)+c)<3&&(s=0);;)if(i=n,n=l.times(i.plus(M(a,i,c,1))),y(i.c).slice(0,s)===(t=y(n.c)).slice(0,s)){if(n.e0&&b>0){for(a=b%s||s,f=p.substr(0,a);a0&&(f+=l+p.slice(a)),h&&(f="-"+f)}r=d?f+(n.decimalSeparator||"")+((u=+n.fractionGroupSize)?d.replace(RegExp("\\d{"+u+"}\\B","g"),"$&"+(n.fractionGroupSeparator||"")):d):f}return(n.prefix||"")+r+(n.suffix||"")},L.toFraction=function(e){var t,n,r,i,a,o,s,u,l,f,h,b,m=this,g=m.c;if(null!=e&&(!(s=new $(e)).isInteger()&&(s.c||1!==s.s)||s.lt(C)))throw Error(c+"Argument "+(s.isInteger()?"out of range: ":"not an integer: ")+V(s));if(!g)return new $(m);for(t=new $(C),l=n=new $(C),r=u=new $(C),b=y(g),a=t.e=b.length-m.e-1,t.c[0]=p[(o=a%d)<0?d+o:o],e=!e||s.comparedTo(t)>0?a>0?t:l:s,o=j,j=1/0,s=new $(b),u.c[0]=0;f=M(s,t,0,1),1!=(i=n.plus(f.times(r))).comparedTo(e);)n=r,r=i,l=u.plus(f.times(i=l)),u=i,t=s.minus(f.times(i=t)),s=i;return i=M(e.minus(n),r,0,1),u=u.plus(i.times(l)),n=n.plus(i.times(r)),u.s=l.s=m.s,a*=2,h=1>M(l,r,a,D).minus(m).abs().comparedTo(M(u,n,a,D).minus(m).abs())?[l,r]:[u,n],j=o,h},L.toNumber=function(){return+V(this)},L.toPrecision=function(e,t){return null!=e&&_(e,1,m),z(this,e,t,2)},L.toString=function(e){var t,n=this,r=n.s,i=n.e;return null===i?r?(t="Infinity",r<0&&(t="-"+t)):t="NaN":(null==e?t=i<=N||i>=P?S(y(n.c),i):k(y(n.c),i,"0"):10===e?(n=K(new $(n),I+i+1,D),t=k(y(n.c),n.e,"0")):(_(e,2,H.length,"Base"),t=O(k(y(n.c),i,"0"),10,e,r,!0)),r<0&&n.c[0]&&(t="-"+t)),t},L.valueOf=L.toJSON=function(){return V(this)},L._isBigNumber=!0,null!=e&&$.set(e),$}function v(e){var t=0|e;return e>0||e===t?t:t-1}function y(e){for(var t,n,r=1,i=e.length,a=e[0]+"";rc^n?1:-1;for(o=0,s=(u=i.length)<(c=a.length)?u:c;oa[o]^n?1:-1;return u==c?0:u>c^n?1:-1}function _(e,t,n,r){if(en||e!==u(e))throw Error(c+(r||"Argument")+("number"==typeof e?en?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function E(e){var t=e.c.length-1;return v(e.e/d)==t&&e.c[t]%2!=0}function S(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function k(e,t,n){var r,i;if(t<0){for(i=n+".";++t;i+=n);e=i+e}else if(r=e.length,++t>r){for(i=n,t-=r;--t;i+=n);e+=i}else ti});let i=r},48764(e,t,n){"use strict";/*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + */ var r=n(79742),i=n(80645),a="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=c,t.SlowBuffer=w,t.INSPECT_MAX_BYTES=50;var o=2147483647;function s(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(n){return!1}}function u(e){if(e>o)throw RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,c.prototype),t}function c(e,t,n){if("number"==typeof e){if("string"==typeof t)throw TypeError('The "string" argument must be of type string. Received type number');return h(e)}return l(e,t,n)}function l(e,t,n){if("string"==typeof e)return p(e,t);if(ArrayBuffer.isView(e))return m(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(X(e,ArrayBuffer)||e&&X(e.buffer,ArrayBuffer)||"undefined"!=typeof SharedArrayBuffer&&(X(e,SharedArrayBuffer)||e&&X(e.buffer,SharedArrayBuffer)))return g(e,t,n);if("number"==typeof e)throw TypeError('The "value" argument must not be of type number. Received type number');var r=e.valueOf&&e.valueOf();if(null!=r&&r!==e)return c.from(r,t,n);var i=v(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return c.from(e[Symbol.toPrimitive]("string"),t,n);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function f(e){if("number"!=typeof e)throw TypeError('"size" argument must be of type number');if(e<0)throw RangeError('The value "'+e+'" is invalid for option "size"')}function d(e,t,n){return(f(e),e<=0)?u(e):void 0!==t?"string"==typeof n?u(e).fill(t,n):u(e).fill(t):u(e)}function h(e){return f(e),u(e<0?0:0|y(e))}function p(e,t){if(("string"!=typeof t||""===t)&&(t="utf8"),!c.isEncoding(t))throw TypeError("Unknown encoding: "+t);var n=0|_(e,t),r=u(n),i=r.write(e,t);return i!==n&&(r=r.slice(0,i)),r}function b(e){for(var t=e.length<0?0:0|y(e.length),n=u(t),r=0;r=o)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return 0|e}function w(e){return+e!=e&&(e=0),c.alloc(+e)}function _(e,t){if(c.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||X(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var n=e.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===n)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return W(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return q(e).length;default:if(i)return r?-1:W(e).length;t=(""+t).toLowerCase(),i=!0}}function E(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length||((void 0===n||n>this.length)&&(n=this.length),n<=0||(n>>>=0)<=(t>>>=0)))return"";for(e||(e="utf8");;)switch(e){case"hex":return j(this,t,n);case"utf8":case"utf-8":return I(this,t,n);case"ascii":return P(this,t,n);case"latin1":case"binary":return R(this,t,n);case"base64":return C(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return F(this,t,n);default:if(r)throw TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function S(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function k(e,t,n,r,i){if(0===e.length)return -1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),J(n=+n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return -1;n=e.length-1}else if(n<0){if(!i)return -1;n=0}if("string"==typeof t&&(t=c.from(t,r)),c.isBuffer(t))return 0===t.length?-1:x(e,t,n,r,i);if("number"==typeof t)return(t&=255,"function"==typeof Uint8Array.prototype.indexOf)?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):x(e,[t],n,r,i);throw TypeError("val must be string, number or Buffer")}function x(e,t,n,r,i){var a,o=1,s=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return -1;o=2,s/=2,u/=2,n/=2}function c(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(i){var l=-1;for(a=n;as&&(n=s-u),a=n;a>=0;a--){for(var f=!0,d=0;di&&(r=i):r=i;var a=t.length;r>a/2&&(r=a/2);for(var o=0;o239?4:c>223?3:c>191?2:1;if(i+f<=n)switch(f){case 1:c<128&&(l=c);break;case 2:(192&(a=e[i+1]))==128&&(u=(31&c)<<6|63&a)>127&&(l=u);break;case 3:a=e[i+1],o=e[i+2],(192&a)==128&&(192&o)==128&&(u=(15&c)<<12|(63&a)<<6|63&o)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:a=e[i+1],o=e[i+2],s=e[i+3],(192&a)==128&&(192&o)==128&&(192&s)==128&&(u=(15&c)<<18|(63&a)<<12|(63&o)<<6|63&s)>65535&&u<1114112&&(l=u)}null===l?(l=65533,f=1):l>65535&&(l-=65536,r.push(l>>>10&1023|55296),l=56320|1023&l),r.push(l),i+=f}return N(r)}t.kMaxLength=o,c.TYPED_ARRAY_SUPPORT=s(),c.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(c.prototype,"parent",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.buffer}}),Object.defineProperty(c.prototype,"offset",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.byteOffset}}),c.poolSize=8192,c.from=function(e,t,n){return l(e,t,n)},Object.setPrototypeOf(c.prototype,Uint8Array.prototype),Object.setPrototypeOf(c,Uint8Array),c.alloc=function(e,t,n){return d(e,t,n)},c.allocUnsafe=function(e){return h(e)},c.allocUnsafeSlow=function(e){return h(e)},c.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==c.prototype},c.compare=function(e,t){if(X(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),X(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),!c.isBuffer(e)||!c.isBuffer(t))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var n=e.length,r=t.length,i=0,a=Math.min(n,r);ir.length?c.from(a).copy(r,i):Uint8Array.prototype.set.call(r,a,i);else if(c.isBuffer(a))a.copy(r,i);else throw TypeError('"list" argument must be an Array of Buffers');i+=a.length}return r},c.byteLength=_,c.prototype._isBuffer=!0,c.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;tn&&(e+=" ... "),""},a&&(c.prototype[a]=c.prototype.inspect),c.prototype.compare=function(e,t,n,r,i){if(X(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(e))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return -1;if(t>=n)return 1;if(t>>>=0,n>>>=0,r>>>=0,i>>>=0,this===e)return 0;for(var a=i-r,o=n-t,s=Math.min(a,o),u=this.slice(r,i),l=e.slice(t,n),f=0;f>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var i=this.length-t;if((void 0===n||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var a=!1;;)switch(r){case"hex":return T(this,e,t,n);case"utf8":case"utf-8":return M(this,e,t,n);case"ascii":case"latin1":case"binary":return O(this,e,t,n);case"base64":return A(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L(this,e,t,n);default:if(a)throw TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),a=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var D=4096;function N(e){var t=e.length;if(t<=D)return String.fromCharCode.apply(String,e);for(var n="",r=0;rr)&&(n=r);for(var i="",a=t;an)throw RangeError("Trying to access beyond buffer length")}function B(e,t,n,r,i,a){if(!c.isBuffer(e))throw TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw RangeError("Index out of range")}function U(e,t,n,r,i,a){if(n+r>e.length||n<0)throw RangeError("Index out of range")}function H(e,t,n,r,a){return t=+t,n>>>=0,a||U(e,t,n,4,34028234663852886e22,-34028234663852886e22),i.write(e,t,n,r,23,4),n+4}function $(e,t,n,r,a){return t=+t,n>>>=0,a||U(e,t,n,8,17976931348623157e292,-17976931348623157e292),i.write(e,t,n,r,52,8),n+8}c.prototype.slice=function(e,t){var n=this.length;e=~~e,t=void 0===t?n:~~t,e<0?(e+=n)<0&&(e=0):e>n&&(e=n),t<0?(t+=n)<0&&(t=0):t>n&&(t=n),t>>=0,t>>>=0,n||Y(e,t,this.length);for(var r=this[e],i=1,a=0;++a>>=0,t>>>=0,n||Y(e,t,this.length);for(var r=this[e+--t],i=1;t>0&&(i*=256);)r+=this[e+--t]*i;return r},c.prototype.readUint8=c.prototype.readUInt8=function(e,t){return e>>>=0,t||Y(e,1,this.length),this[e]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(e,t){return e>>>=0,t||Y(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(e,t){return e>>>=0,t||Y(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(e,t){return e>>>=0,t||Y(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(e,t){return e>>>=0,t||Y(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||Y(e,t,this.length);for(var r=this[e],i=1,a=0;++a=(i*=128)&&(r-=Math.pow(2,8*t)),r},c.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||Y(e,t,this.length);for(var r=t,i=1,a=this[e+--r];r>0&&(i*=256);)a+=this[e+--r]*i;return a>=(i*=128)&&(a-=Math.pow(2,8*t)),a},c.prototype.readInt8=function(e,t){return(e>>>=0,t||Y(e,1,this.length),128&this[e])?-((255-this[e]+1)*1):this[e]},c.prototype.readInt16LE=function(e,t){e>>>=0,t||Y(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt16BE=function(e,t){e>>>=0,t||Y(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt32LE=function(e,t){return e>>>=0,t||Y(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return e>>>=0,t||Y(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readFloatLE=function(e,t){return e>>>=0,t||Y(e,4,this.length),i.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||Y(e,4,this.length),i.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||Y(e,8,this.length),i.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||Y(e,8,this.length),i.read(this,e,!1,52,8)},c.prototype.writeUintLE=c.prototype.writeUIntLE=function(e,t,n,r){if(e=+e,t>>>=0,n>>>=0,!r){var i=Math.pow(2,8*n)-1;B(this,e,t,n,i,0)}var a=1,o=0;for(this[t]=255&e;++o>>=0,n>>>=0,!r){var i=Math.pow(2,8*n)-1;B(this,e,t,n,i,0)}var a=n-1,o=1;for(this[t+a]=255&e;--a>=0&&(o*=256);)this[t+a]=e/o&255;return t+n},c.prototype.writeUint8=c.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||B(this,e,t,1,255,0),this[t]=255&e,t+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||B(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||B(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||B(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||B(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var i=Math.pow(2,8*n-1);B(this,e,t,n,i-1,-i)}var a=0,o=1,s=0;for(this[t]=255&e;++a>0)-s&255;return t+n},c.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var i=Math.pow(2,8*n-1);B(this,e,t,n,i-1,-i)}var a=n-1,o=1,s=0;for(this[t+a]=255&e;--a>=0&&(o*=256);)e<0&&0===s&&0!==this[t+a+1]&&(s=1),this[t+a]=(e/o>>0)-s&255;return t+n},c.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||B(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||B(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||B(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||B(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},c.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||B(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeFloatLE=function(e,t,n){return H(this,e,t,!0,n)},c.prototype.writeFloatBE=function(e,t,n){return H(this,e,t,!1,n)},c.prototype.writeDoubleLE=function(e,t,n){return $(this,e,t,!0,n)},c.prototype.writeDoubleBE=function(e,t,n){return $(this,e,t,!1,n)},c.prototype.copy=function(e,t,n,r){if(!c.isBuffer(e))throw TypeError("argument should be a Buffer");if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw RangeError("Index out of range");if(r<0)throw RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(i=t;i55295&&n<57344){if(!i){if(n>56319||o+1===r){(t-=3)>-1&&a.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&a.push(239,191,189),i=n;continue}n=(i-55296<<10|n-56320)+65536}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;a.push(n)}else if(n<2048){if((t-=2)<0)break;a.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;a.push(n>>12|224,n>>6&63|128,63&n|128)}else if(n<1114112){if((t-=4)<0)break;a.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}else throw Error("Invalid code point")}return a}function K(e){for(var t=[],n=0;n>8,a.push(i=n%256),a.push(r);return a}function q(e){return r.toByteArray(G(e))}function Z(e,t,n,r){for(var i=0;i=t.length)&&!(i>=e.length);++i)t[i+n]=e[i];return i}function X(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function J(e){return e!=e}var Q=function(){for(var e="0123456789abcdef",t=Array(256),n=0;n<16;++n)for(var r=16*n,i=0;i<16;++i)t[r+i]=e[n]+e[i];return t}()},94184(e,t){var n,r; /*! + Copyright (c) 2018 Jed Watson. + Licensed under the MIT License (MIT), see + http://jedwatson.github.io/classnames +*/ !function(){"use strict";var i={}.hasOwnProperty;function a(){for(var e=[],t=0;t>8&255]},F=function(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]},Y=function(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]},B=function(e){return N(e,23,4)},U=function(e){return N(e,52,8)},H=function(e,t){g(e[x],t,{get:function(){return _(this)[t]}})},$=function(e,t,n,r){var i=d(n),a=_(e);if(i+t>a.byteLength)throw D(M);var o=_(a.buffer).bytes,s=i+a.byteOffset,u=o.slice(s,s+t);return r?u:u.reverse()},z=function(e,t,n,r,i,a){var o=d(n),s=_(e);if(o+t>s.byteLength)throw D(M);for(var u=_(s.buffer).bytes,c=o+s.byteOffset,l=r(+i),f=0;fV;)(G=K[V++])in A||o(A,G,O[G]);W.constructor=A}b&&p(C)!==I&&b(C,I);var q=new L(new A(2)),Z=C.setInt8;q.setInt8(0,2147483648),q.setInt8(1,2147483649),(q.getInt8(0)||!q.getInt8(1))&&s(C,{setInt8:function(e,t){Z.call(this,e,t<<24>>24)},setUint8:function(e,t){Z.call(this,e,t<<24>>24)}},{unsafe:!0})}else A=function(e){c(this,A,S);var t=d(e);E(this,{bytes:v.call(Array(t),0),byteLength:t}),i||(this.byteLength=t)},L=function(e,t,n){c(this,L,k),c(e,A,k);var r=_(e).byteLength,a=l(t);if(a<0||a>r)throw D("Wrong offset");if(n=void 0===n?r-a:f(n),a+n>r)throw D(T);E(this,{buffer:e,byteLength:n,byteOffset:a}),i||(this.buffer=e,this.byteLength=n,this.byteOffset=a)},i&&(H(A,"byteLength"),H(L,"buffer"),H(L,"byteLength"),H(L,"byteOffset")),s(L[x],{getInt8:function(e){return $(this,1,e)[0]<<24>>24},getUint8:function(e){return $(this,1,e)[0]},getInt16:function(e){var t=$(this,2,e,arguments.length>1?arguments[1]:void 0);return(t[1]<<8|t[0])<<16>>16},getUint16:function(e){var t=$(this,2,e,arguments.length>1?arguments[1]:void 0);return t[1]<<8|t[0]},getInt32:function(e){return Y($(this,4,e,arguments.length>1?arguments[1]:void 0))},getUint32:function(e){return Y($(this,4,e,arguments.length>1?arguments[1]:void 0))>>>0},getFloat32:function(e){return P($(this,4,e,arguments.length>1?arguments[1]:void 0),23)},getFloat64:function(e){return P($(this,8,e,arguments.length>1?arguments[1]:void 0),52)},setInt8:function(e,t){z(this,1,e,R,t)},setUint8:function(e,t){z(this,1,e,R,t)},setInt16:function(e,t){z(this,2,e,j,t,arguments.length>2?arguments[2]:void 0)},setUint16:function(e,t){z(this,2,e,j,t,arguments.length>2?arguments[2]:void 0)},setInt32:function(e,t){z(this,4,e,F,t,arguments.length>2?arguments[2]:void 0)},setUint32:function(e,t){z(this,4,e,F,t,arguments.length>2?arguments[2]:void 0)},setFloat32:function(e,t){z(this,4,e,B,t,arguments.length>2?arguments[2]:void 0)},setFloat64:function(e,t){z(this,8,e,U,t,arguments.length>2?arguments[2]:void 0)}});y(A,S),y(L,k),e.exports={ArrayBuffer:A,DataView:L}},1048(e,t,n){"use strict";var r=n(47908),i=n(51400),a=n(17466),o=Math.min;e.exports=[].copyWithin||function(e,t){var n=r(this),s=a(n.length),u=i(e,s),c=i(t,s),l=arguments.length>2?arguments[2]:void 0,f=o((void 0===l?s:i(l,s))-c,s-u),d=1;for(c0;)c in n?n[u]=n[c]:delete n[u],u+=d,c+=d;return n}},21285(e,t,n){"use strict";var r=n(47908),i=n(51400),a=n(17466);e.exports=function(e){for(var t=r(this),n=a(t.length),o=arguments.length,s=i(o>1?arguments[1]:void 0,n),u=o>2?arguments[2]:void 0,c=void 0===u?n:i(u,n);c>s;)t[s++]=e;return t}},18533(e,t,n){"use strict";var r=n(42092).forEach,i=n(9341)("forEach");e.exports=i?[].forEach:function(e){return r(this,e,arguments.length>1?arguments[1]:void 0)}},97745(e){e.exports=function(e,t){for(var n=0,r=t.length,i=new e(r);r>n;)i[n]=t[n++];return i}},48457(e,t,n){"use strict";var r=n(49974),i=n(47908),a=n(53411),o=n(97659),s=n(17466),u=n(86135),c=n(18554),l=n(71246);e.exports=function(e){var t,n,f,d,h,p,b=i(e),m="function"==typeof this?this:Array,g=arguments.length,v=g>1?arguments[1]:void 0,y=void 0!==v,w=l(b),_=0;if(y&&(v=r(v,g>2?arguments[2]:void 0,2)),void 0==w||m==Array&&o(w))for(t=s(b.length),n=new m(t);t>_;_++)p=y?v(b[_],_):b[_],u(n,_,p);else for(h=(d=c(b,w)).next,n=new m;!(f=h.call(d)).done;_++)p=y?a(d,v,[f.value,_],!0):f.value,u(n,_,p);return n.length=_,n}},61386(e,t,n){var r=n(49974),i=n(68361),a=n(47908),o=n(17466),s=n(34948),u=n(70030),c=n(97745),l=[].push;e.exports=function(e,t,n,f){for(var d,h,p,b=a(e),m=i(b),g=r(t,n,3),v=u(null),y=o(m.length),w=0;y>w;w++)(h=s(g(p=m[w],w,b)))in v?l.call(v[h],p):v[h]=[p];if(f&&(d=f(b))!==Array)for(h in v)v[h]=c(d,v[h]);return v}},41318(e,t,n){var r=n(45656),i=n(17466),a=n(51400),o=function(e){return function(t,n,o){var s,u=r(t),c=i(u.length),l=a(o,c);if(e&&n!=n){for(;c>l;)if((s=u[l++])!=s)return!0}else for(;c>l;l++)if((e||l in u)&&u[l]===n)return e||l||0;return!e&&-1}};e.exports={includes:o(!0),indexOf:o(!1)}},9671(e,t,n){var r=n(49974),i=n(68361),a=n(47908),o=n(17466),s=function(e){var t=1==e;return function(n,s,u){for(var c,l,f=a(n),d=i(f),h=r(s,u,3),p=o(d.length);p-- >0;)if(l=h(c=d[p],p,f))switch(e){case 0:return c;case 1:return p}return t?-1:void 0}};e.exports={findLast:s(0),findLastIndex:s(1)}},42092(e,t,n){var r=n(49974),i=n(68361),a=n(47908),o=n(17466),s=n(65417),u=[].push,c=function(e){var t=1==e,n=2==e,c=3==e,l=4==e,f=6==e,d=7==e,h=5==e||f;return function(p,b,m,g){for(var v,y,w=a(p),_=i(w),E=r(b,m,3),S=o(_.length),k=0,x=g||s,T=t?x(p,S):n||d?x(p,0):void 0;S>k;k++)if((h||k in _)&&(y=E(v=_[k],k,w),e)){if(t)T[k]=y;else if(y)switch(e){case 3:return!0;case 5:return v;case 6:return k;case 2:u.call(T,v)}else switch(e){case 4:return!1;case 7:u.call(T,v)}}return f?-1:c||l?l:T}};e.exports={forEach:c(0),map:c(1),filter:c(2),some:c(3),every:c(4),find:c(5),findIndex:c(6),filterReject:c(7)}},86583(e,t,n){"use strict";var r=n(45656),i=n(99958),a=n(17466),o=n(9341),s=Math.min,u=[].lastIndexOf,c=!!u&&1/[1].lastIndexOf(1,-0)<0,l=o("lastIndexOf"),f=c||!l;e.exports=f?function(e){if(c)return u.apply(this,arguments)||0;var t=r(this),n=a(t.length),o=n-1;for(arguments.length>1&&(o=s(o,i(arguments[1]))),o<0&&(o=n+o);o>=0;o--)if(o in t&&t[o]===e)return o||0;return -1}:u},81194(e,t,n){var r=n(47293),i=n(5112),a=n(7392),o=i("species");e.exports=function(e){return a>=51||!r(function(){var t=[];return(t.constructor={})[o]=function(){return{foo:1}},1!==t[e](Boolean).foo})}},9341(e,t,n){"use strict";var r=n(47293);e.exports=function(e,t){var n=[][e];return!!n&&r(function(){n.call(null,t||function(){throw 1},1)})}},53671(e,t,n){var r=n(13099),i=n(47908),a=n(68361),o=n(17466),s=function(e){return function(t,n,s,u){r(n);var c=i(t),l=a(c),f=o(c.length),d=e?f-1:0,h=e?-1:1;if(s<2)for(;;){if(d in l){u=l[d],d+=h;break}if(d+=h,e?d<0:f<=d)throw TypeError("Reduce of empty array with no initial value")}for(;e?d>=0:f>d;d+=h)d in l&&(u=n(u,l[d],d,c));return u}};e.exports={left:s(!1),right:s(!0)}},94362(e){var t=Math.floor,n=function(e,a){var o=e.length,s=t(o/2);return o<8?r(e,a):i(n(e.slice(0,s),a),n(e.slice(s),a),a)},r=function(e,t){for(var n,r,i=e.length,a=1;a0;)e[r]=e[--r];r!==a++&&(e[r]=n)}return e},i=function(e,t,n){for(var r=e.length,i=t.length,a=0,o=0,s=[];a=n(e[a],t[o])?e[a++]:t[o++]):s.push(a1?arguments[1]:void 0;return(r(this),(t=void 0!==c)&&r(c),void 0==e)?new this:(n=[],t?(o=0,s=i(c,u>2?arguments[2]:void 0,2),a(e,function(e){n.push(s(e,o++))})):a(e,n.push,{that:n}),new this(n))}},82044(e){"use strict";e.exports=function(){for(var e=arguments.length,t=Array(e);e--;)t[e]=arguments[e];return new this(t)}},95631(e,t,n){"use strict";var r=n(3070).f,i=n(70030),a=n(12248),o=n(49974),s=n(25787),u=n(20408),c=n(70654),l=n(96340),f=n(19781),d=n(62423).fastKey,h=n(29909),p=h.set,b=h.getterFor;e.exports={getConstructor:function(e,t,n,c){var l=e(function(e,r){s(e,l,t),p(e,{type:t,index:i(null),first:void 0,last:void 0,size:0}),f||(e.size=0),void 0!=r&&u(r,e[c],{that:e,AS_ENTRIES:n})}),h=b(t),m=function(e,t,n){var r,i,a=h(e),o=g(e,t);return o?o.value=n:(a.last=o={index:i=d(t,!0),key:t,value:n,previous:r=a.last,next:void 0,removed:!1},a.first||(a.first=o),r&&(r.next=o),f?a.size++:e.size++,"F"!==i&&(a.index[i]=o)),e},g=function(e,t){var n,r=h(e),i=d(t);if("F"!==i)return r.index[i];for(n=r.first;n;n=n.next)if(n.key==t)return n};return a(l.prototype,{clear:function(){for(var e=this,t=h(e),n=t.index,r=t.first;r;)r.removed=!0,r.previous&&(r.previous=r.previous.next=void 0),delete n[r.index],r=r.next;t.first=t.last=void 0,f?t.size=0:e.size=0},delete:function(e){var t=this,n=h(t),r=g(t,e);if(r){var i=r.next,a=r.previous;delete n.index[r.index],r.removed=!0,a&&(a.next=i),i&&(i.previous=a),n.first==r&&(n.first=i),n.last==r&&(n.last=a),f?n.size--:t.size--}return!!r},forEach:function(e){for(var t,n=h(this),r=o(e,arguments.length>1?arguments[1]:void 0,3);t=t?t.next:n.first;)for(r(t.value,t.key,this);t&&t.removed;)t=t.previous},has:function(e){return!!g(this,e)}}),a(l.prototype,n?{get:function(e){var t=g(this,e);return t&&t.value},set:function(e,t){return m(this,0===e?0:e,t)}}:{add:function(e){return m(this,e=0===e?0:e,e)}}),f&&r(l.prototype,"size",{get:function(){return h(this).size}}),l},setStrong:function(e,t,n){var r=t+" Iterator",i=b(t),a=b(r);c(e,t,function(e,t){p(this,{type:r,target:e,state:i(e),kind:t,last:void 0})},function(){for(var e=a(this),t=e.kind,n=e.last;n&&n.removed;)n=n.previous;return e.target&&(e.last=n=n?n.next:e.state.first)?"keys"==t?{value:n.key,done:!1}:"values"==t?{value:n.value,done:!1}:{value:[n.key,n.value],done:!1}:(e.target=void 0,{value:void 0,done:!0})},n?"entries":"values",!n,!0),l(t)}}},29320(e,t,n){"use strict";var r=n(12248),i=n(62423).getWeakData,a=n(19670),o=n(70111),s=n(25787),u=n(20408),c=n(42092),l=n(86656),f=n(29909),d=f.set,h=f.getterFor,p=c.find,b=c.findIndex,m=0,g=function(e){return e.frozen||(e.frozen=new v)},v=function(){this.entries=[]},y=function(e,t){return p(e.entries,function(e){return e[0]===t})};v.prototype={get:function(e){var t=y(this,e);if(t)return t[1]},has:function(e){return!!y(this,e)},set:function(e,t){var n=y(this,e);n?n[1]=t:this.entries.push([e,t])},delete:function(e){var t=b(this.entries,function(t){return t[0]===e});return~t&&this.entries.splice(t,1),!!~t}},e.exports={getConstructor:function(e,t,n,c){var f=e(function(e,r){s(e,f,t),d(e,{type:t,id:m++,frozen:void 0}),void 0!=r&&u(r,e[c],{that:e,AS_ENTRIES:n})}),p=h(t),b=function(e,t,n){var r=p(e),o=i(a(t),!0);return!0===o?g(r).set(t,n):o[r.id]=n,e};return r(f.prototype,{delete:function(e){var t=p(this);if(!o(e))return!1;var n=i(e);return!0===n?g(t).delete(e):n&&l(n,t.id)&&delete n[t.id]},has:function(e){var t=p(this);if(!o(e))return!1;var n=i(e);return!0===n?g(t).has(e):n&&l(n,t.id)}}),r(f.prototype,n?{get:function(e){var t=p(this);if(o(e)){var n=i(e);return!0===n?g(t).get(e):n?n[t.id]:void 0}},set:function(e,t){return b(this,e,t)}}:{add:function(e){return b(this,e,!0)}}),f}}},77710(e,t,n){"use strict";var r=n(82109),i=n(17854),a=n(54705),o=n(31320),s=n(62423),u=n(20408),c=n(25787),l=n(70111),f=n(47293),d=n(17072),h=n(58003),p=n(79587);e.exports=function(e,t,n){var b=-1!==e.indexOf("Map"),m=-1!==e.indexOf("Weak"),g=b?"set":"add",v=i[e],y=v&&v.prototype,w=v,_={},E=function(e){var t=y[e];o(y,e,"add"==e?function(e){return t.call(this,0===e?0:e),this}:"delete"==e?function(e){return(!m||!!l(e))&&t.call(this,0===e?0:e)}:"get"==e?function(e){return m&&!l(e)?void 0:t.call(this,0===e?0:e)}:"has"==e?function(e){return(!m||!!l(e))&&t.call(this,0===e?0:e)}:function(e,n){return t.call(this,0===e?0:e,n),this})};if(a(e,"function"!=typeof v||!(m||y.forEach&&!f(function(){new v().entries().next()}))))w=n.getConstructor(t,e,b,g),s.enable();else if(a(e,!0)){var S=new w,k=S[g](m?{}:-0,1)!=S,x=f(function(){S.has(1)}),T=d(function(e){new v(e)}),M=!m&&f(function(){for(var e=new v,t=5;t--;)e[g](t,t);return!e.has(-0)});T||((w=t(function(t,n){c(t,w,e);var r=p(new v,t,w);return void 0!=n&&u(n,r[g],{that:r,AS_ENTRIES:b}),r})).prototype=y,y.constructor=w),(x||M)&&(E("delete"),E("has"),b&&E("get")),(M||k)&&E(g),m&&y.clear&&delete y.clear}return _[e]=w,r({global:!0,forced:w!=v},_),h(w,e),m||n.setStrong(w,e,b),w}},10313(e,t,n){var r=n(51532),i=n(4129),a=n(70030),o=n(70111),s=function(){this.object=null,this.symbol=null,this.primitives=null,this.objectsByIndex=a(null)};s.prototype.get=function(e,t){return this[e]||(this[e]=t())},s.prototype.next=function(e,t,n){var a=n?this.objectsByIndex[e]||(this.objectsByIndex[e]=new i):this.primitives||(this.primitives=new r),o=a.get(t);return o||a.set(t,o=new s),o};var u=new s;e.exports=function(){var e,t,n=u,r=arguments.length;for(e=0;e"+s+""}},24994(e,t,n){"use strict";var r=n(13383).IteratorPrototype,i=n(70030),a=n(79114),o=n(58003),s=n(97497),u=function(){return this};e.exports=function(e,t,n){var c=t+" Iterator";return e.prototype=i(r,{next:a(1,n)}),o(e,c,!1,!0),s[c]=u,e}},68880(e,t,n){var r=n(19781),i=n(3070),a=n(79114);e.exports=r?function(e,t,n){return i.f(e,t,a(1,n))}:function(e,t,n){return e[t]=n,e}},79114(e){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},86135(e,t,n){"use strict";var r=n(34948),i=n(3070),a=n(79114);e.exports=function(e,t,n){var o=r(t);o in e?i.f(e,o,a(0,n)):e[o]=n}},85573(e,t,n){"use strict";var r=n(47293),i=n(76650).start,a=Math.abs,o=Date.prototype,s=o.getTime,u=o.toISOString;e.exports=r(function(){return"0385-07-25T07:06:39.999Z"!=u.call(new Date(-5e13-1))})||!r(function(){u.call(new Date(NaN))})?function(){if(!isFinite(s.call(this)))throw RangeError("Invalid time value");var e=this,t=e.getUTCFullYear(),n=e.getUTCMilliseconds(),r=t<0?"-":t>9999?"+":"";return r+i(a(t),r?6:4,0)+"-"+i(e.getUTCMonth()+1,2,0)+"-"+i(e.getUTCDate(),2,0)+"T"+i(e.getUTCHours(),2,0)+":"+i(e.getUTCMinutes(),2,0)+":"+i(e.getUTCSeconds(),2,0)+"."+i(n,3,0)+"Z"}:u},38709(e,t,n){"use strict";var r=n(19670),i=n(92140);e.exports=function(e){if(r(this),"string"===e||"default"===e)e="string";else if("number"!==e)throw TypeError("Incorrect hint");return i(this,e)}},70654(e,t,n){"use strict";var r=n(82109),i=n(24994),a=n(79518),o=n(27674),s=n(58003),u=n(68880),c=n(31320),l=n(5112),f=n(31913),d=n(97497),h=n(13383),p=h.IteratorPrototype,b=h.BUGGY_SAFARI_ITERATORS,m=l("iterator"),g="keys",v="values",y="entries",w=function(){return this};e.exports=function(e,t,n,l,h,_,E){i(n,t,l);var S,k,x,T=function(e){if(e===h&&C)return C;if(!b&&e in A)return A[e];switch(e){case g:case v:case y:return function(){return new n(this,e)}}return function(){return new n(this)}},M=t+" Iterator",O=!1,A=e.prototype,L=A[m]||A["@@iterator"]||h&&A[h],C=!b&&L||T(h),I="Array"==t&&A.entries||L;if(I&&(S=a(I.call(new e)),p!==Object.prototype&&S.next&&(f||a(S)===p||(o?o(S,p):"function"!=typeof S[m]&&u(S,m,w)),s(S,M,!0,!0),f&&(d[M]=w))),h==v&&L&&L.name!==v&&(O=!0,C=function(){return L.call(this)}),(!f||E)&&A[m]!==C&&u(A,m,C),d[t]=C,h){if(k={values:T(v),keys:_?C:T(g),entries:T(y)},E)for(x in k)!b&&!O&&x in A||c(A,x,k[x]);else r({target:t,proto:!0,forced:b||O},k)}return k}},97235(e,t,n){var r=n(40857),i=n(86656),a=n(6061),o=n(3070).f;e.exports=function(e){var t=r.Symbol||(r.Symbol={});i(t,e)||o(t,e,{value:a.f(e)})}},19781(e,t,n){var r=n(47293);e.exports=!r(function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})},80317(e,t,n){var r=n(17854),i=n(70111),a=r.document,o=i(a)&&i(a.createElement);e.exports=function(e){return o?a.createElement(e):{}}},48324(e){e.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},68886(e,t,n){var r=n(88113).match(/firefox\/(\d+)/i);e.exports=!!r&&+r[1]},7871(e){e.exports="object"==typeof window},30256(e,t,n){var r=n(88113);e.exports=/MSIE|Trident/.test(r)},71528(e,t,n){var r=n(88113),i=n(17854);e.exports=/ipad|iphone|ipod/i.test(r)&&void 0!==i.Pebble},6833(e,t,n){var r=n(88113);e.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(r)},35268(e,t,n){var r=n(84326),i=n(17854);e.exports="process"==r(i.process)},71036(e,t,n){var r=n(88113);e.exports=/web0s(?!.*chrome)/i.test(r)},88113(e,t,n){var r=n(35005);e.exports=r("navigator","userAgent")||""},7392(e,t,n){var r,i,a=n(17854),o=n(88113),s=a.process,u=a.Deno,c=s&&s.versions||u&&u.version,l=c&&c.v8;l?i=(r=l.split("."))[0]<4?1:r[0]+r[1]:o&&(!(r=o.match(/Edge\/(\d+)/))||r[1]>=74)&&(r=o.match(/Chrome\/(\d+)/))&&(i=r[1]),e.exports=i&&+i},98008(e,t,n){var r=n(88113).match(/AppleWebKit\/(\d+)\./);e.exports=!!r&&+r[1]},80748(e){e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},82109(e,t,n){var r=n(17854),i=n(31236).f,a=n(68880),o=n(31320),s=n(83505),u=n(99920),c=n(54705);e.exports=function(e,t){var n,l,f,d,h,p,b=e.target,m=e.global,g=e.stat;if(l=m?r:g?r[b]||s(b,{}):(r[b]||{}).prototype)for(f in t){if(h=t[f],d=e.noTargetGet?(p=i(l,f))&&p.value:l[f],!(n=c(m?f:b+(g?".":"#")+f,e.forced))&&void 0!==d){if(typeof h==typeof d)continue;u(h,d)}(e.sham||d&&d.sham)&&a(h,"sham",!0),o(l,f,h,e)}}},47293(e){e.exports=function(e){try{return!!e()}catch(t){return!0}}},27007(e,t,n){"use strict";n(74916);var r=n(31320),i=n(22261),a=n(47293),o=n(5112),s=n(68880),u=o("species"),c=RegExp.prototype;e.exports=function(e,t,n,l){var f=o(e),d=!a(function(){var t={};return t[f]=function(){return 7},7!=""[e](t)}),h=d&&!a(function(){var t=!1,n=/a/;return"split"===e&&((n={}).constructor={},n.constructor[u]=function(){return n},n.flags="",n[f]=/./[f]),n.exec=function(){return t=!0,null},n[f](""),!t});if(!d||!h||n){var p=/./[f],b=t(f,""[e],function(e,t,n,r,a){var o=t.exec;return o===i||o===c.exec?d&&!a?{done:!0,value:p.call(t,n,r)}:{done:!0,value:e.call(n,t,r)}:{done:!1}});r(String.prototype,e,b[0]),r(c,f,b[1])}l&&s(c[f],"sham",!0)}},6790(e,t,n){"use strict";var r=n(43157),i=n(17466),a=n(49974),o=function(e,t,n,s,u,c,l,f){for(var d,h=u,p=0,b=!!l&&a(l,f,3);p0&&r(d))h=o(e,t,d,i(d.length),h,c-1)-1;else{if(h>=9007199254740991)throw TypeError("Exceed the acceptable array length");e[h]=d}h++}p++}return h};e.exports=o},76677(e,t,n){var r=n(47293);e.exports=!r(function(){return Object.isExtensible(Object.preventExtensions({}))})},49974(e,t,n){var r=n(13099);e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 0:return function(){return e.call(t)};case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,i){return e.call(t,n,r,i)}}return function(){return e.apply(t,arguments)}}},27065(e,t,n){"use strict";var r=n(13099),i=n(70111),a=[].slice,o={},s=function(e,t,n){if(!(t in o)){for(var r=[],i=0;i]*>)/g,s=/\$([$&'`]|\d{1,2})/g;e.exports=function(e,t,n,u,c,l){var f=n+e.length,d=u.length,h=s;return void 0!==c&&(c=r(c),h=o),a.call(l,h,function(r,a){var o;switch(a.charAt(0)){case"$":return"$";case"&":return e;case"`":return t.slice(0,n);case"'":return t.slice(f);case"<":o=c[a.slice(1,-1)];break;default:var s=+a;if(0===s)return r;if(s>d){var l=i(s/10);if(0===l)return r;if(l<=d)return void 0===u[l-1]?a.charAt(1):u[l-1]+a.charAt(1);return r}o=u[s-1]}return void 0===o?"":o})}},17854(e,t,n){var r=function(e){return e&&e.Math==Math&&e};e.exports=r("object"==typeof globalThis&&globalThis)||r("object"==typeof window&&window)||r("object"==typeof self&&self)||r("object"==typeof n.g&&n.g)||function(){return this}()||Function("return this")()},86656(e,t,n){var r=n(47908),i={}.hasOwnProperty;e.exports=Object.hasOwn||function(e,t){return i.call(r(e),t)}},3501(e){e.exports={}},842(e,t,n){var r=n(17854);e.exports=function(e,t){var n=r.console;n&&n.error&&(1===arguments.length?n.error(e):n.error(e,t))}},60490(e,t,n){var r=n(35005);e.exports=r("document","documentElement")},64664(e,t,n){var r=n(19781),i=n(47293),a=n(80317);e.exports=!r&&!i(function(){return 7!=Object.defineProperty(a("div"),"a",{get:function(){return 7}}).a})},11179(e){var t=Math.abs,n=Math.pow,r=Math.floor,i=Math.log,a=Math.LN2,o=function(e,o,s){var u,c,l,f=Array(s),d=8*s-o-1,h=(1<>1,b=23===o?n(2,-24)-n(2,-77):0,m=e<0||0===e&&1/e<0?1:0,g=0;for((e=t(e))!=e||e===1/0?(c=e!=e?1:0,u=h):(u=r(i(e)/a),e*(l=n(2,-u))<1&&(u--,l*=2),u+p>=1?e+=b/l:e+=b*n(2,1-p),e*l>=2&&(u++,l/=2),u+p>=h?(c=0,u=h):u+p>=1?(c=(e*l-1)*n(2,o),u+=p):(c=e*n(2,p-1)*n(2,o),u=0));o>=8;f[g++]=255&c,c/=256,o-=8);for(u=u<0;f[g++]=255&u,u/=256,d-=8);return f[--g]|=128*m,f},s=function(e,t){var r,i=e.length,a=8*i-t-1,o=(1<>1,u=a-7,c=i-1,l=e[c--],f=127&l;for(l>>=7;u>0;f=256*f+e[c],c--,u-=8);for(r=f&(1<<-u)-1,f>>=-u,u+=t;u>0;r=256*r+e[c],c--,u-=8);if(0===f)f=1-s;else{if(f===o)return r?NaN:l?-1/0:1/0;r+=n(2,t),f-=s}return(l?-1:1)*r*n(2,f-t)};e.exports={pack:o,unpack:s}},68361(e,t,n){var r=n(47293),i=n(84326),a="".split;e.exports=r(function(){return!Object("z").propertyIsEnumerable(0)})?function(e){return"String"==i(e)?a.call(e,""):Object(e)}:Object},79587(e,t,n){var r=n(70111),i=n(27674);e.exports=function(e,t,n){var a,o;return i&&"function"==typeof(a=t.constructor)&&a!==n&&r(o=a.prototype)&&o!==n.prototype&&i(e,o),e}},42788(e,t,n){var r=n(5465),i=Function.toString;"function"!=typeof r.inspectSource&&(r.inspectSource=function(e){return i.call(e)}),e.exports=r.inspectSource},62423(e,t,n){var r=n(82109),i=n(3501),a=n(70111),o=n(86656),s=n(3070).f,u=n(8006),c=n(1156),l=n(69711),f=n(76677),d=!1,h=l("meta"),p=0,b=Object.isExtensible||function(){return!0},m=function(e){s(e,h,{value:{objectID:"O"+p++,weakData:{}}})},g=function(e,t){if(!a(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!o(e,h)){if(!b(e))return"F";if(!t)return"E";m(e)}return e[h].objectID},v=function(e,t){if(!o(e,h)){if(!b(e))return!0;if(!t)return!1;m(e)}return e[h].weakData},y=function(e){return f&&d&&b(e)&&!o(e,h)&&m(e),e},w=function(){_.enable=function(){},d=!0;var e=u.f,t=[].splice,n={};n[h]=1,e(n).length&&(u.f=function(n){for(var r=e(n),i=0,a=r.length;ih;h++)if((b=k(e[h]))&&b instanceof l)return b;return new l(!1)}f=s(e,d)}for(m=f.next;!(g=m.call(f)).done;){try{b=k(g.value)}catch(x){c(f,"throw",x)}if("object"==typeof b&&b&&b instanceof l)return b}return new l(!1)}},99212(e,t,n){var r=n(19670);e.exports=function(e,t,n){var i,a;r(e);try{if(void 0===(i=e.return)){if("throw"===t)throw n;return n}i=i.call(e)}catch(o){a=!0,i=o}if("throw"===t)throw n;if(a)throw i;return r(i),n}},54956(e,t,n){"use strict";var r=n(40857),i=n(13099),a=n(19670),o=n(70030),s=n(68880),u=n(12248),c=n(5112),l=n(29909),f=l.set,d=l.get,h=c("toStringTag");e.exports=function(e,t){var n=function(e){e.next=i(e.iterator.next),e.done=!1,e.ignoreArg=!t,f(this,e)};return n.prototype=u(o(r.Iterator.prototype),{next:function(n){var r=d(this),i=arguments.length?[r.ignoreArg?void 0:n]:t?[]:[void 0];r.ignoreArg=!1;var a=r.done?void 0:e.call(r,i);return{done:r.done,value:a}},return:function(e){var t=d(this).iterator;t.done=!0;var n=t.return;return{done:!0,value:void 0===n?e:a(n.call(t,e)).value}},throw:function(e){var t=d(this).iterator;t.done=!0;var n=t.throw;if(void 0===n)throw e;return n.call(t,e)}}),t||s(n.prototype,h,"Generator"),n}},13383(e,t,n){"use strict";var r,i,a,o=n(47293),s=n(79518),u=n(68880),c=n(86656),l=n(5112),f=n(31913),d=l("iterator"),h=!1,p=function(){return this};[].keys&&("next"in(a=[].keys())?(i=s(s(a)))!==Object.prototype&&(r=i):h=!0);var b=void 0==r||o(function(){var e={};return r[d].call(e)!==e});b&&(r={}),f&&!b||c(r,d)||u(r,d,p),e.exports={IteratorPrototype:r,BUGGY_SAFARI_ITERATORS:h}},97497(e){e.exports={}},37502(e,t,n){"use strict";var r=n(19670);e.exports=function(e,t){var n=r(this),i=n.has(e)&&"update"in t?t.update(n.get(e),e,n):t.insert(e,n);return n.set(e,i),i}},8154(e,t,n){"use strict";var r=n(19670);e.exports=function(e,t){var n,i=r(this),a=arguments.length>2?arguments[2]:void 0;if("function"!=typeof t&&"function"!=typeof a)throw TypeError("At least one callback required");return i.has(e)?(n=i.get(e),"function"==typeof t&&(n=t(n),i.set(e,n))):"function"==typeof a&&(n=a(),i.set(e,n)),n}},66736(e){var t=Math.expm1,n=Math.exp;e.exports=!t||t(10)>22025.465794806718||22025.465794806718>t(10)||-.00000000000000002!=t(-.00000000000000002)?function(e){return 0==(e=+e)?e:e>-.000001&&e<1e-6?e+e*e/2:n(e)-1}:t},26130(e,t,n){var r=n(64310),i=Math.abs,a=Math.pow,o=a(2,-52),s=a(2,-23),u=a(2,127)*(2-s),c=a(2,-126),l=function(e){return e+1/o-1/o};e.exports=Math.fround||function(e){var t,n,a=i(e),f=r(e);return au||n!=n?f*(1/0):f*n}},26513(e){var t=Math.log;e.exports=Math.log1p||function(e){return(e=+e)>-.00000001&&e<1e-8?e-e*e/2:t(1+e)}},47103(e){e.exports=Math.scale||function(e,t,n,r,i){return 0===arguments.length||e!=e||t!=t||n!=n||r!=r||i!=i?NaN:e===1/0||e===-1/0?e:(e-t)*(i-r)/(n-t)+r}},64310(e){e.exports=Math.sign||function(e){return 0==(e=+e)||e!=e?e:e<0?-1:1}},95948(e,t,n){var r,i,a,o,s,u,c,l,f=n(17854),d=n(31236).f,h=n(20261).set,p=n(6833),b=n(71528),m=n(71036),g=n(35268),v=f.MutationObserver||f.WebKitMutationObserver,y=f.document,w=f.process,_=f.Promise,E=d(f,"queueMicrotask"),S=E&&E.value;S||(r=function(){var e,t;for(g&&(e=w.domain)&&e.exit();i;){t=i.fn,i=i.next;try{t()}catch(n){throw i?o():a=void 0,n}}a=void 0,e&&e.enter()},p||g||m||!v||!y?!b&&_&&_.resolve?((c=_.resolve(void 0)).constructor=_,l=c.then,o=function(){l.call(c,r)}):o=g?function(){w.nextTick(r)}:function(){h.call(f,r)}:(s=!0,u=y.createTextNode(""),new v(r).observe(u,{characterData:!0}),o=function(){u.data=s=!s})),e.exports=S||function(e){var t={fn:e,next:void 0};a&&(a.next=t),i||(i=t,o()),a=t}},13366(e,t,n){var r=n(17854);e.exports=r.Promise},30133(e,t,n){var r=n(7392),i=n(47293);e.exports=!!Object.getOwnPropertySymbols&&!i(function(){var e=Symbol();return!String(e)||!(Object(e) instanceof Symbol)||!Symbol.sham&&r&&r<41})},590(e,t,n){var r=n(47293),i=n(5112),a=n(31913),o=i("iterator");e.exports=!r(function(){var e=new URL("b?a=1&b=2&c=3","http://a"),t=e.searchParams,n="";return e.pathname="c%20d",t.forEach(function(e,r){t.delete("b"),n+=r+e}),a&&!e.toJSON||!t.sort||"http://a/c%20d?a=1&c=3"!==e.href||"3"!==t.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!t[o]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("http://тест").host||"#%D0%B1"!==new URL("http://a#б").hash||"a1c3"!==n||"x"!==new URL("http://x",void 0).host})},68536(e,t,n){var r=n(17854),i=n(42788),a=r.WeakMap;e.exports="function"==typeof a&&/native code/.test(i(a))},78523(e,t,n){"use strict";var r=n(13099),i=function(e){var t,n;this.promise=new e(function(e,r){if(void 0!==t||void 0!==n)throw TypeError("Bad Promise constructor");t=e,n=r}),this.resolve=r(t),this.reject=r(n)};e.exports.f=function(e){return new i(e)}},3929(e,t,n){var r=n(47850);e.exports=function(e){if(r(e))throw TypeError("The method doesn't accept regular expressions");return e}},77023(e,t,n){var r=n(17854).isFinite;e.exports=Number.isFinite||function(e){return"number"==typeof e&&r(e)}},2814(e,t,n){var r=n(17854),i=n(41340),a=n(53111).trim,o=n(81361),s=r.parseFloat,u=1/s(o+"-0")!=-1/0;e.exports=u?function(e){var t=a(i(e)),n=s(t);return 0===n&&"-"==t.charAt(0)?-0:n}:s},83009(e,t,n){var r=n(17854),i=n(41340),a=n(53111).trim,o=n(81361),s=r.parseInt,u=/^[+-]?0[Xx]/,c=8!==s(o+"08")||22!==s(o+"0x16");e.exports=c?function(e,t){var n=a(i(e));return s(n,t>>>0||(u.test(n)?16:10))}:s},80430(e,t,n){"use strict";var r=n(29909),i=n(24994),a=n(70111),o=n(36048),s=n(19781),u="Incorrect Number.range arguments",c="NumericRangeIterator",l=r.set,f=r.getterFor(c),d=i(function(e,t,n,r,i,o){if(typeof e!=r||t!==1/0&&t!==-1/0&&typeof t!=r)throw TypeError(u);if(e===1/0||e===-1/0)throw RangeError(u);var f,d=t>e,h=!1;if(void 0===n)f=void 0;else if(a(n))f=n.step,h=!!n.inclusive;else if(typeof n==r)f=n;else throw TypeError(u);if(null==f&&(f=d?o:-o),typeof f!=r)throw TypeError(u);if(f===1/0||f===-1/0||f===i&&e!==t)throw RangeError(u);var p=e!=e||t!=t||f!=f||t>e!=f>i;l(this,{type:c,start:e,end:t,step:f,inclusiveEnd:h,hitsEnd:p,currentCount:i,zero:i}),s||(this.start=e,this.end=t,this.step=f,this.inclusive=h)},c,function(){var e,t=f(this);if(t.hitsEnd)return{value:void 0,done:!0};var n=t.start,r=t.end,i=n+t.step*t.currentCount++;i===r&&(t.hitsEnd=!0);var a=t.inclusiveEnd;return(e=r>n?a?i>r:i>=r:a?r>i:r>=i)?{value:void 0,done:t.hitsEnd=!0}:{value:i,done:!1}}),h=function(e){return{get:e,set:function(){},configurable:!0,enumerable:!1}};s&&o(d.prototype,{start:h(function(){return f(this).start}),end:h(function(){return f(this).end}),inclusive:h(function(){return f(this).inclusiveEnd}),step:h(function(){return f(this).step})}),e.exports=d},21574(e,t,n){"use strict";var r=n(19781),i=n(47293),a=n(81956),o=n(25181),s=n(55296),u=n(47908),c=n(68361),l=Object.assign,f=Object.defineProperty;e.exports=!l||i(function(){if(r&&1!==l({b:1},l(f({},"a",{enumerable:!0,get:function(){f(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},n=Symbol(),i="abcdefghijklmnopqrst";return e[n]=7,i.split("").forEach(function(e){t[e]=e}),7!=l({},e)[n]||a(l({},t)).join("")!=i})?function(e,t){for(var n=u(e),i=arguments.length,l=1,f=o.f,d=s.f;i>l;)for(var h,p=c(arguments[l++]),b=f?a(p).concat(f(p)):a(p),m=b.length,g=0;m>g;)h=b[g++],(!r||d.call(p,h))&&(n[h]=p[h]);return n}:l},70030(e,t,n){var r,i=n(19670),a=n(36048),o=n(80748),s=n(3501),u=n(60490),c=n(80317),l=n(6200),f=">",d="<",h="prototype",p="script",b=l("IE_PROTO"),m=function(){},g=function(e){return d+p+f+e+d+"/"+p+f},v=function(e){e.write(g("")),e.close();var t=e.parentWindow.Object;return e=null,t},y=function(){var e,t=c("iframe"),n="java"+p+":";return t.style.display="none",u.appendChild(t),t.src=String(n),(e=t.contentWindow.document).open(),e.write(g("document.F=Object")),e.close(),e.F},w=function(){try{r=new ActiveXObject("htmlfile")}catch(e){}w="undefined"!=typeof document?document.domain&&r?v(r):y():v(r);for(var t=o.length;t--;)delete w[h][o[t]];return w()};s[b]=!0,e.exports=Object.create||function(e,t){var n;return null!==e?(m[h]=i(e),n=new m,m[h]=null,n[b]=e):n=w(),void 0===t?n:a(n,t)}},36048(e,t,n){var r=n(19781),i=n(3070),a=n(19670),o=n(81956);e.exports=r?Object.defineProperties:function(e,t){a(e);for(var n,r=o(t),s=r.length,u=0;s>u;)i.f(e,n=r[u++],t[n]);return e}},3070(e,t,n){var r=n(19781),i=n(64664),a=n(19670),o=n(34948),s=Object.defineProperty;t.f=r?s:function(e,t,n){if(a(e),t=o(t),a(n),i)try{return s(e,t,n)}catch(r){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(e[t]=n.value),e}},31236(e,t,n){var r=n(19781),i=n(55296),a=n(79114),o=n(45656),s=n(34948),u=n(86656),c=n(64664),l=Object.getOwnPropertyDescriptor;t.f=r?l:function(e,t){if(e=o(e),t=s(t),c)try{return l(e,t)}catch(n){}if(u(e,t))return a(!i.f.call(e,t),e[t])}},1156(e,t,n){var r=n(45656),i=n(8006).f,a={}.toString,o="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],s=function(e){try{return i(e)}catch(t){return o.slice()}};e.exports.f=function(e){return o&&"[object Window]"==a.call(e)?s(e):i(r(e))}},8006(e,t,n){var r=n(16324),i=n(80748).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return r(e,i)}},25181(e,t){t.f=Object.getOwnPropertySymbols},79518(e,t,n){var r=n(86656),i=n(47908),a=n(6200),o=n(49920),s=a("IE_PROTO"),u=Object.prototype;e.exports=o?Object.getPrototypeOf:function(e){return(e=i(e),r(e,s))?e[s]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?u:null}},60996(e,t,n){"use strict";var r=n(29909),i=n(24994),a=n(86656),o=n(81956),s=n(47908),u="Object Iterator",c=r.set,l=r.getterFor(u);e.exports=i(function(e,t){var n=s(e);c(this,{type:u,mode:t,object:n,keys:o(n),index:0})},"Object",function(){for(var e=l(this),t=e.keys;;){if(null===t||e.index>=t.length)return e.object=e.keys=null,{value:void 0,done:!0};var n=t[e.index++],r=e.object;if(a(r,n)){switch(e.mode){case"keys":return{value:n,done:!1};case"values":return{value:r[n],done:!1}}return{value:[n,r[n]],done:!1}}}})},16324(e,t,n){var r=n(86656),i=n(45656),a=n(41318).indexOf,o=n(3501);e.exports=function(e,t){var n,s=i(e),u=0,c=[];for(n in s)!r(o,n)&&r(s,n)&&c.push(n);for(;t.length>u;)r(s,n=t[u++])&&(~a(c,n)||c.push(n));return c}},81956(e,t,n){var r=n(16324),i=n(80748);e.exports=Object.keys||function(e){return r(e,i)}},55296(e,t){"use strict";var n={}.propertyIsEnumerable,r=Object.getOwnPropertyDescriptor,i=r&&!n.call({1:2},1);t.f=i?function(e){var t=r(this,e);return!!t&&t.enumerable}:n},69026(e,t,n){"use strict";var r=n(31913),i=n(17854),a=n(47293),o=n(98008);e.exports=r||!a(function(){if(!o||!(o<535)){var e=Math.random();__defineSetter__.call(null,e,function(){}),delete i[e]}})},27674(e,t,n){var r=n(19670),i=n(96077);e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{(e=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(n,[]),t=n instanceof Array}catch(a){}return function(n,a){return r(n),i(a),t?e.call(n,a):n.__proto__=a,n}}():void 0)},44699(e,t,n){var r=n(19781),i=n(81956),a=n(45656),o=n(55296).f,s=function(e){return function(t){for(var n,s=a(t),u=i(s),c=u.length,l=0,f=[];c>l;)n=u[l++],(!r||o.call(s,n))&&f.push(e?[n,s[n]]:s[n]);return f}};e.exports={entries:s(!0),values:s(!1)}},90288(e,t,n){"use strict";var r=n(51694),i=n(70648);e.exports=r?({}).toString:function(){return"[object "+i(this)+"]"}},92140(e,t,n){var r=n(70111);e.exports=function(e,t){var n,i;if("string"===t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e))||"function"==typeof(n=e.valueOf)&&!r(i=n.call(e))||"string"!==t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;throw TypeError("Can't convert object to primitive value")}},53887(e,t,n){var r=n(35005),i=n(8006),a=n(25181),o=n(19670);e.exports=r("Reflect","ownKeys")||function(e){var t=i.f(o(e)),n=a.f;return n?t.concat(n(e)):t}},40857(e,t,n){var r=n(17854);e.exports=r},12534(e){e.exports=function(e){try{return{error:!1,value:e()}}catch(t){return{error:!0,value:t}}}},69478(e,t,n){var r=n(19670),i=n(70111),a=n(78523);e.exports=function(e,t){if(r(e),i(t)&&t.constructor===e)return t;var n=a.f(e);return(0,n.resolve)(t),n.promise}},12248(e,t,n){var r=n(31320);e.exports=function(e,t,n){for(var i in t)r(e,i,t[i],n);return e}},31320(e,t,n){var r=n(17854),i=n(68880),a=n(86656),o=n(83505),s=n(42788),u=n(29909),c=u.get,l=u.enforce,f=String(String).split("String");(e.exports=function(e,t,n,s){var u,c=!!s&&!!s.unsafe,d=!!s&&!!s.enumerable,h=!!s&&!!s.noTargetGet;if("function"!=typeof n||("string"!=typeof t||a(n,"name")||i(n,"name",t),(u=l(n)).source||(u.source=f.join("string"==typeof t?t:""))),e===r){d?e[t]=n:o(t,n);return}c?!h&&e[t]&&(d=!0):delete e[t],d?e[t]=n:i(e,t,n)})(Function.prototype,"toString",function(){return"function"==typeof this&&c(this).source||s(this)})},38845(e,t,n){var r=n(51532),i=n(4129),a=n(72309)("metadata"),o=a.store||(a.store=new i),s=function(e,t,n){var i=o.get(e);if(!i){if(!n)return;o.set(e,i=new r)}var a=i.get(t);if(!a){if(!n)return;i.set(t,a=new r)}return a},u=function(e,t,n){var r=s(t,n,!1);return void 0!==r&&r.has(e)},c=function(e,t,n){var r=s(t,n,!1);return void 0===r?void 0:r.get(e)},l=function(e,t,n,r){s(n,r,!0).set(e,t)},f=function(e,t){var n=s(e,t,!1),r=[];return n&&n.forEach(function(e,t){r.push(t)}),r},d=function(e){return void 0===e||"symbol"==typeof e?e:String(e)};e.exports={store:o,getMap:s,has:u,get:c,set:l,keys:f,toKey:d}},97651(e,t,n){var r=n(84326),i=n(22261);e.exports=function(e,t){var n=e.exec;if("function"==typeof n){var a=n.call(e,t);if("object"!=typeof a)throw TypeError("RegExp exec method returned something other than an Object or null");return a}if("RegExp"!==r(e))throw TypeError("RegExp#exec called on incompatible receiver");return i.call(e,t)}},22261(e,t,n){"use strict";var r,i,a=n(41340),o=n(67066),s=n(52999),u=n(72309),c=n(70030),l=n(29909).get,f=n(9441),d=n(38173),h=RegExp.prototype.exec,p=u("native-string-replace",String.prototype.replace),b=h,m=(r=/a/,i=/b*/g,h.call(r,"a"),h.call(i,"a"),0!==r.lastIndex||0!==i.lastIndex),g=s.UNSUPPORTED_Y||s.BROKEN_CARET,v=void 0!==/()??/.exec("")[1];(m||v||g||f||d)&&(b=function(e){var t,n,r,i,s,u,f,d=this,y=l(d),w=a(e),_=y.raw;if(_)return _.lastIndex=d.lastIndex,t=b.call(_,w),d.lastIndex=_.lastIndex,t;var E=y.groups,S=g&&d.sticky,k=o.call(d),x=d.source,T=0,M=w;if(S&&(-1===(k=k.replace("y","")).indexOf("g")&&(k+="g"),M=w.slice(d.lastIndex),d.lastIndex>0&&(!d.multiline||d.multiline&&"\n"!==w.charAt(d.lastIndex-1))&&(x="(?: "+x+")",M=" "+M,T++),n=RegExp("^(?:"+x+")",k)),v&&(n=RegExp("^"+x+"$(?!\\s)",k)),m&&(r=d.lastIndex),i=h.call(S?n:d,M),S?i?(i.input=i.input.slice(T),i[0]=i[0].slice(T),i.index=d.lastIndex,d.lastIndex+=i[0].length):d.lastIndex=0:m&&i&&(d.lastIndex=d.global?i.index+i[0].length:r),v&&i&&i.length>1&&p.call(i[0],n,function(){for(s=1;sb)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$
c")})},84488(e){e.exports=function(e){if(void 0==e)throw TypeError("Can't call method on "+e);return e}},46465(e){e.exports=function(e,t){return e===t||e!=e&&t!=t}},81150(e){e.exports=Object.is||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}},83505(e,t,n){var r=n(17854);e.exports=function(e,t){try{Object.defineProperty(r,e,{value:t,configurable:!0,writable:!0})}catch(n){r[e]=t}return t}},96340(e,t,n){"use strict";var r=n(35005),i=n(3070),a=n(5112),o=n(19781),s=a("species");e.exports=function(e){var t=r(e),n=i.f;o&&t&&!t[s]&&n(t,s,{configurable:!0,get:function(){return this}})}},58003(e,t,n){var r=n(3070).f,i=n(86656),a=n(5112)("toStringTag");e.exports=function(e,t,n){e&&!i(e=n?e:e.prototype,a)&&r(e,a,{configurable:!0,value:t})}},6200(e,t,n){var r=n(72309),i=n(69711),a=r("keys");e.exports=function(e){return a[e]||(a[e]=i(e))}},5465(e,t,n){var r=n(17854),i=n(83505),a="__core-js_shared__",o=r[a]||i(a,{});e.exports=o},72309(e,t,n){var r=n(31913),i=n(5465);(e.exports=function(e,t){return i[e]||(i[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.17.0",mode:r?"pure":"global",copyright:"\xa9 2021 Denis Pushkarev (zloirock.ru)"})},36707(e,t,n){var r=n(19670),i=n(13099),a=n(5112)("species");e.exports=function(e,t){var n,o=r(e).constructor;return void 0===o||void 0==(n=r(o)[a])?t:i(n)}},43429(e,t,n){var r=n(47293);e.exports=function(e){return r(function(){var t=""[e]('"');return t!==t.toLowerCase()||t.split('"').length>3})}},28710(e,t,n){var r=n(99958),i=n(41340),a=n(84488),o=function(e){return function(t,n){var o,s,u=i(a(t)),c=r(n),l=u.length;return c<0||c>=l?e?"":void 0:(o=u.charCodeAt(c))<55296||o>56319||c+1===l||(s=u.charCodeAt(c+1))<56320||s>57343?e?u.charAt(c):o:e?u.slice(c,c+2):(o-55296<<10)+(s-56320)+65536}};e.exports={codeAt:o(!1),charAt:o(!0)}},54986(e,t,n){var r=n(88113);e.exports=/Version\/10(?:\.\d+){1,2}(?: [\w./]+)?(?: Mobile\/\w+)? Safari\//.test(r)},76650(e,t,n){var r=n(17466),i=n(41340),a=n(38415),o=n(84488),s=Math.ceil,u=function(e){return function(t,n,u){var c,l,f=i(o(t)),d=f.length,h=void 0===u?" ":i(u),p=r(n);return p<=d||""==h?f:(c=p-d,(l=a.call(h,s(c/h.length))).length>c&&(l=l.slice(0,c)),e?f+l:l+f)}};e.exports={start:u(!1),end:u(!0)}},33197(e){"use strict";var t=2147483647,n=36,r=1,i=26,a=38,o=700,s=72,u=128,c="-",l=/[^\0-\u007E]/,f=/[.\u3002\uFF0E\uFF61]/g,d="Overflow: input needs wider integers to process",h=n-r,p=Math.floor,b=String.fromCharCode,m=function(e){for(var t=[],n=0,r=e.length;n=55296&&i<=56319&&n>1,e+=p(e/t);e>h*i>>1;s+=n)e=p(e/h);return p(s+(h+1)*e/(e+a))},y=function(e){var a,o,l=[],f=(e=m(e)).length,h=u,y=0,w=s;for(a=0;a=h&&op((t-y)/k))throw RangeError(d);for(y+=(S-h)*k,h=S,a=0;at)throw RangeError(d);if(o==h){for(var x=y,T=n;;T+=n){var M=T<=w?r:T>=w+i?i:T-w;if(x0;(o>>>=1)&&(t+=t))1&o&&(n+=t);return n}},76091(e,t,n){var r=n(47293),i=n(81361),a="​\x85᠎";e.exports=function(e){return r(function(){return!!i[e]()||a[e]()!=a||i[e].name!==e})}},53111(e,t,n){var r=n(84488),i=n(41340),a="["+n(81361)+"]",o=RegExp("^"+a+a+"*"),s=RegExp(a+a+"*$"),u=function(e){return function(t){var n=i(r(t));return 1&e&&(n=n.replace(o,"")),2&e&&(n=n.replace(s,"")),n}};e.exports={start:u(1),end:u(2),trim:u(3)}},20261(e,t,n){var r,i,a,o,s=n(17854),u=n(47293),c=n(49974),l=n(60490),f=n(80317),d=n(6833),h=n(35268),p=s.setImmediate,b=s.clearImmediate,m=s.process,g=s.MessageChannel,v=s.Dispatch,y=0,w={},_="onreadystatechange";try{r=s.location}catch(E){}var S=function(e){if(w.hasOwnProperty(e)){var t=w[e];delete w[e],t()}},k=function(e){return function(){S(e)}},x=function(e){S(e.data)},T=function(e){s.postMessage(String(e),r.protocol+"//"+r.host)};p&&b||(p=function(e){for(var t=[],n=arguments.length,r=1;n>r;)t.push(arguments[r++]);return w[++y]=function(){("function"==typeof e?e:Function(e)).apply(void 0,t)},i(y),y},b=function(e){delete w[e]},h?i=function(e){m.nextTick(k(e))}:v&&v.now?i=function(e){v.now(k(e))}:g&&!d?(o=(a=new g).port2,a.port1.onmessage=x,i=c(o.postMessage,o,1)):s.addEventListener&&"function"==typeof postMessage&&!s.importScripts&&r&&"file:"!==r.protocol&&!u(T)?(i=T,s.addEventListener("message",x,!1)):i=_ in f("script")?function(e){l.appendChild(f("script"))[_]=function(){l.removeChild(this),S(e)}}:function(e){setTimeout(k(e),0)}),e.exports={set:p,clear:b}},50863(e,t,n){var r=n(84326);e.exports=function(e){if("number"!=typeof e&&"Number"!=r(e))throw TypeError("Incorrect invocation");return+e}},51400(e,t,n){var r=n(99958),i=Math.max,a=Math.min;e.exports=function(e,t){var n=r(e);return n<0?i(n+t,0):a(n,t)}},57067(e,t,n){var r=n(99958),i=n(17466);e.exports=function(e){if(void 0===e)return 0;var t=r(e),n=i(t);if(t!==n)throw RangeError("Wrong length or index");return n}},45656(e,t,n){var r=n(68361),i=n(84488);e.exports=function(e){return r(i(e))}},99958(e){var t=Math.ceil,n=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?n:t)(e)}},17466(e,t,n){var r=n(99958),i=Math.min;e.exports=function(e){return e>0?i(r(e),9007199254740991):0}},47908(e,t,n){var r=n(84488);e.exports=function(e){return Object(r(e))}},84590(e,t,n){var r=n(73002);e.exports=function(e,t){var n=r(e);if(n%t)throw RangeError("Wrong offset");return n}},73002(e,t,n){var r=n(99958);e.exports=function(e){var t=r(e);if(t<0)throw RangeError("The argument can't be less than 0");return t}},57593(e,t,n){var r=n(70111),i=n(52190),a=n(92140),o=n(5112)("toPrimitive");e.exports=function(e,t){if(!r(e)||i(e))return e;var n,s=e[o];if(void 0!==s){if(void 0===t&&(t="default"),!r(n=s.call(e,t))||i(n))return n;throw TypeError("Can't convert object to primitive value")}return void 0===t&&(t="number"),a(e,t)}},34948(e,t,n){var r=n(57593),i=n(52190);e.exports=function(e){var t=r(e,"string");return i(t)?t:String(t)}},51694(e,t,n){var r=n(5112)("toStringTag"),i={};i[r]="z",e.exports="[object z]"===String(i)},41340(e,t,n){var r=n(52190);e.exports=function(e){if(r(e))throw TypeError("Cannot convert a Symbol value to a string");return String(e)}},19843(e,t,n){"use strict";var r=n(82109),i=n(17854),a=n(19781),o=n(63832),s=n(90260),u=n(13331),c=n(25787),l=n(79114),f=n(68880),d=n(18730),h=n(17466),p=n(57067),b=n(84590),m=n(34948),g=n(86656),v=n(70648),y=n(70111),w=n(52190),_=n(70030),E=n(27674),S=n(8006).f,k=n(97321),x=n(42092).forEach,T=n(96340),M=n(3070),O=n(31236),A=n(29909),L=n(79587),C=A.get,I=A.set,D=M.f,N=O.f,P=Math.round,R=i.RangeError,j=u.ArrayBuffer,F=u.DataView,Y=s.NATIVE_ARRAY_BUFFER_VIEWS,B=s.TYPED_ARRAY_CONSTRUCTOR,U=s.TYPED_ARRAY_TAG,H=s.TypedArray,$=s.TypedArrayPrototype,z=s.aTypedArrayConstructor,G=s.isTypedArray,W="BYTES_PER_ELEMENT",K="Wrong length",V=function(e,t){for(var n=0,r=t.length,i=new(z(e))(r);r>n;)i[n]=t[n++];return i},q=function(e,t){D(e,t,{get:function(){return C(this)[t]}})},Z=function(e){var t;return e instanceof j||"ArrayBuffer"==(t=v(e))||"SharedArrayBuffer"==t},X=function(e,t){return G(e)&&!w(t)&&t in e&&d(+t)&&t>=0},J=function(e,t){return t=m(t),X(e,t)?l(2,e[t]):N(e,t)},Q=function(e,t,n){return(t=m(t),X(e,t)&&y(n)&&g(n,"value")&&!g(n,"get")&&!g(n,"set")&&!n.configurable&&(!g(n,"writable")||n.writable)&&(!g(n,"enumerable")||n.enumerable))?(e[t]=n.value,e):D(e,t,n)};a?(Y||(O.f=J,M.f=Q,q($,"buffer"),q($,"byteOffset"),q($,"byteLength"),q($,"length")),r({target:"Object",stat:!0,forced:!Y},{getOwnPropertyDescriptor:J,defineProperty:Q}),e.exports=function(e,t,n){var a=e.match(/\d+$/)[0]/8,s=e+(n?"Clamped":"")+"Array",u="get"+e,l="set"+e,d=i[s],m=d,g=m&&m.prototype,v={},w=function(e,t){var n=C(e);return n.view[u](t*a+n.byteOffset,!0)},M=function(e,t,r){var i=C(e);n&&(r=(r=P(r))<0?0:r>255?255:255&r),i.view[l](t*a+i.byteOffset,r,!0)},O=function(e,t){D(e,t,{get:function(){return w(this,t)},set:function(e){return M(this,t,e)},enumerable:!0})};Y?o&&(m=t(function(e,t,n,r){return c(e,m,s),L(y(t)?Z(t)?void 0!==r?new d(t,b(n,a),r):void 0!==n?new d(t,b(n,a)):new d(t):G(t)?V(m,t):k.call(m,t):new d(p(t)),e,m)}),E&&E(m,H),x(S(d),function(e){e in m||f(m,e,d[e])}),m.prototype=g):(m=t(function(e,t,n,r){c(e,m,s);var i,o,u,l=0,f=0;if(y(t)){if(Z(t)){i=t,f=b(n,a);var d=t.byteLength;if(void 0===r){if(d%a||(o=d-f)<0)throw R(K)}else if((o=h(r)*a)+f>d)throw R(K);u=o/a}else if(G(t))return V(m,t);else return k.call(m,t)}else o=(u=p(t))*a,i=new j(o);for(I(e,{buffer:i,byteOffset:f,byteLength:o,length:u,view:new F(i)});l1?arguments[1]:void 0,g=void 0!==m,v=o(p);if(void 0!=v&&!s(v))for(h=(d=a(p,v)).next,p=[];!(f=h.call(d)).done;)p.push(f.value);for(g&&b>2&&(m=u(m,arguments[2],2)),n=i(p.length),l=new(c(this))(n),t=0;n>t;t++)l[t]=g?m(p[t],t):p[t];return l}},66304(e,t,n){var r=n(90260),i=n(36707),a=r.TYPED_ARRAY_CONSTRUCTOR,o=r.aTypedArrayConstructor;e.exports=function(e){return o(i(e,e[a]))}},69711(e){var t=0,n=Math.random();e.exports=function(e){return"Symbol("+String(void 0===e?"":e)+")_"+(++t+n).toString(36)}},43307(e,t,n){var r=n(30133);e.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},6061(e,t,n){var r=n(5112);t.f=r},5112(e,t,n){var r=n(17854),i=n(72309),a=n(86656),o=n(69711),s=n(30133),u=n(43307),c=i("wks"),l=r.Symbol,f=u?l:l&&l.withoutSetter||o;e.exports=function(e){return a(c,e)&&(s||"string"==typeof c[e])||(s&&a(l,e)?c[e]=l[e]:c[e]=f("Symbol."+e)),c[e]}},81361(e){e.exports=" \n\v\f\r \xa0               \u2028\u2029\uFEFF"},9170(e,t,n){"use strict";var r=n(82109),i=n(79518),a=n(27674),o=n(70030),s=n(68880),u=n(79114),c=n(20408),l=n(41340),f=function(e,t){var n=this;if(!(n instanceof f))return new f(e,t);a&&(n=a(Error(void 0),i(n))),void 0!==t&&s(n,"message",l(t));var r=[];return c(e,r.push,{that:r}),s(n,"errors",r),n};f.prototype=o(Error.prototype,{constructor:u(5,f),message:u(5,""),name:u(5,"AggregateError")}),r({global:!0},{AggregateError:f})},18264(e,t,n){"use strict";var r=n(82109),i=n(17854),a=n(13331),o=n(96340),s="ArrayBuffer",u=a[s];r({global:!0,forced:i[s]!==u},{ArrayBuffer:u}),o(s)},76938(e,t,n){var r=n(82109),i=n(90260);r({target:"ArrayBuffer",stat:!0,forced:!i.NATIVE_ARRAY_BUFFER_VIEWS},{isView:i.isView})},39575(e,t,n){"use strict";var r=n(82109),i=n(47293),a=n(13331),o=n(19670),s=n(51400),u=n(17466),c=n(36707),l=a.ArrayBuffer,f=a.DataView,d=l.prototype.slice,h=i(function(){return!new l(2).slice(1,void 0).byteLength});r({target:"ArrayBuffer",proto:!0,unsafe:!0,forced:h},{slice:function(e,t){if(void 0!==d&&void 0===t)return d.call(o(this),e);for(var n=o(this).byteLength,r=s(e,n),i=s(void 0===t?n:t,n),a=new(c(this,l))(u(i-r)),h=new f(this),p=new f(a),b=0;r=0?r:n+r;return s<0||s>=n?void 0:t[s]}}),s("at")},92222(e,t,n){"use strict";var r=n(82109),i=n(47293),a=n(43157),o=n(70111),s=n(47908),u=n(17466),c=n(86135),l=n(65417),f=n(81194),d=n(5112),h=n(7392),p=d("isConcatSpreadable"),b=9007199254740991,m="Maximum allowed index exceeded",g=h>=51||!i(function(){var e=[];return e[p]=!1,e.concat()[0]!==e}),v=f("concat"),y=function(e){if(!o(e))return!1;var t=e[p];return void 0!==t?!!t:a(e)};r({target:"Array",proto:!0,forced:!g||!v},{concat:function(e){var t,n,r,i,a,o=s(this),f=l(o,0),d=0;for(t=-1,r=arguments.length;tb)throw TypeError(m);for(n=0;n=b)throw TypeError(m);c(f,d++,a)}return f.length=d,f}})},50545(e,t,n){var r=n(82109),i=n(1048),a=n(51223);r({target:"Array",proto:!0},{copyWithin:i}),a("copyWithin")},26541(e,t,n){"use strict";var r=n(82109),i=n(42092).every,a=n(9341)("every");r({target:"Array",proto:!0,forced:!a},{every:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}})},43290(e,t,n){var r=n(82109),i=n(21285),a=n(51223);r({target:"Array",proto:!0},{fill:i}),a("fill")},57327(e,t,n){"use strict";var r=n(82109),i=n(42092).filter,a=n(81194)("filter");r({target:"Array",proto:!0,forced:!a},{filter:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}})},34553(e,t,n){"use strict";var r=n(82109),i=n(42092).findIndex,a=n(51223),o="findIndex",s=!0;o in[]&&[,][o](function(){s=!1}),r({target:"Array",proto:!0,forced:s},{findIndex:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),a(o)},69826(e,t,n){"use strict";var r=n(82109),i=n(42092).find,a=n(51223),o="find",s=!0;o in[]&&[,][o](function(){s=!1}),r({target:"Array",proto:!0,forced:s},{find:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),a(o)},86535(e,t,n){"use strict";var r=n(82109),i=n(6790),a=n(47908),o=n(17466),s=n(13099),u=n(65417);r({target:"Array",proto:!0},{flatMap:function(e){var t,n=a(this),r=o(n.length);return s(e),(t=u(n,0)).length=i(t,n,n,r,0,1,e,arguments.length>1?arguments[1]:void 0),t}})},84944(e,t,n){"use strict";var r=n(82109),i=n(6790),a=n(47908),o=n(17466),s=n(99958),u=n(65417);r({target:"Array",proto:!0},{flat:function(){var e=arguments.length?arguments[0]:void 0,t=a(this),n=o(t.length),r=u(t,0);return r.length=i(r,t,t,n,0,void 0===e?1:s(e)),r}})},89554(e,t,n){"use strict";var r=n(82109),i=n(18533);r({target:"Array",proto:!0,forced:[].forEach!=i},{forEach:i})},91038(e,t,n){var r=n(82109),i=n(48457),a=!n(17072)(function(e){Array.from(e)});r({target:"Array",stat:!0,forced:a},{from:i})},26699(e,t,n){"use strict";var r=n(82109),i=n(41318).includes,a=n(51223);r({target:"Array",proto:!0},{includes:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),a("includes")},82772(e,t,n){"use strict";var r=n(82109),i=n(41318).indexOf,a=n(9341),o=[].indexOf,s=!!o&&1/[1].indexOf(1,-0)<0,u=a("indexOf");r({target:"Array",proto:!0,forced:s||!u},{indexOf:function(e){return s?o.apply(this,arguments)||0:i(this,e,arguments.length>1?arguments[1]:void 0)}})},79753(e,t,n){var r=n(82109),i=n(43157);r({target:"Array",stat:!0},{isArray:i})},66992(e,t,n){"use strict";var r=n(45656),i=n(51223),a=n(97497),o=n(29909),s=n(70654),u="Array Iterator",c=o.set,l=o.getterFor(u);e.exports=s(Array,"Array",function(e,t){c(this,{type:u,target:r(e),index:0,kind:t})},function(){var e=l(this),t=e.target,n=e.kind,r=e.index++;return!t||r>=t.length?(e.target=void 0,{value:void 0,done:!0}):"keys"==n?{value:r,done:!1}:"values"==n?{value:t[r],done:!1}:{value:[r,t[r]],done:!1}},"values"),a.Arguments=a.Array,i("keys"),i("values"),i("entries")},69600(e,t,n){"use strict";var r=n(82109),i=n(68361),a=n(45656),o=n(9341),s=[].join,u=i!=Object,c=o("join",",");r({target:"Array",proto:!0,forced:u||!c},{join:function(e){return s.call(a(this),void 0===e?",":e)}})},94986(e,t,n){var r=n(82109),i=n(86583);r({target:"Array",proto:!0,forced:i!==[].lastIndexOf},{lastIndexOf:i})},21249(e,t,n){"use strict";var r=n(82109),i=n(42092).map,a=n(81194)("map");r({target:"Array",proto:!0,forced:!a},{map:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}})},26572(e,t,n){"use strict";var r=n(82109),i=n(47293),a=n(86135),o=i(function(){function e(){}return!(Array.of.call(e) instanceof e)});r({target:"Array",stat:!0,forced:o},{of:function(){for(var e=0,t=arguments.length,n=new("function"==typeof this?this:Array)(t);t>e;)a(n,e,arguments[e++]);return n.length=t,n}})},96644(e,t,n){"use strict";var r=n(82109),i=n(53671).right,a=n(9341),o=n(7392),s=n(35268),u=a("reduceRight"),c=!s&&o>79&&o<83;r({target:"Array",proto:!0,forced:!u||c},{reduceRight:function(e){return i(this,e,arguments.length,arguments.length>1?arguments[1]:void 0)}})},85827(e,t,n){"use strict";var r=n(82109),i=n(53671).left,a=n(9341),o=n(7392),s=n(35268),u=a("reduce"),c=!s&&o>79&&o<83;r({target:"Array",proto:!0,forced:!u||c},{reduce:function(e){return i(this,e,arguments.length,arguments.length>1?arguments[1]:void 0)}})},65069(e,t,n){"use strict";var r=n(82109),i=n(43157),a=[].reverse,o=[1,2];r({target:"Array",proto:!0,forced:String(o)===String(o.reverse())},{reverse:function(){return i(this)&&(this.length=this.length),a.call(this)}})},47042(e,t,n){"use strict";var r=n(82109),i=n(70111),a=n(43157),o=n(51400),s=n(17466),u=n(45656),c=n(86135),l=n(5112),f=n(81194)("slice"),d=l("species"),h=[].slice,p=Math.max;r({target:"Array",proto:!0,forced:!f},{slice:function(e,t){var n,r,l,f=u(this),b=s(f.length),m=o(e,b),g=o(void 0===t?b:t,b);if(a(f)&&("function"==typeof(n=f.constructor)&&(n===Array||a(n.prototype))?n=void 0:i(n)&&null===(n=n[d])&&(n=void 0),n===Array||void 0===n))return h.call(f,m,g);for(l=0,r=new(void 0===n?Array:n)(p(g-m,0));m1?arguments[1]:void 0)}})},2707(e,t,n){"use strict";var r=n(82109),i=n(13099),a=n(47908),o=n(17466),s=n(41340),u=n(47293),c=n(94362),l=n(9341),f=n(68886),d=n(30256),h=n(7392),p=n(98008),b=[],m=b.sort,g=u(function(){b.sort(void 0)}),v=u(function(){b.sort(null)}),y=l("sort"),w=!u(function(){if(h)return h<70;if(!f||!(f>3)){if(d)return!0;if(p)return p<603;var e,t,n,r,i="";for(e=65;e<76;e++){switch(t=String.fromCharCode(e),e){case 66:case 69:case 70:case 72:n=3;break;case 68:case 71:n=4;break;default:n=2}for(r=0;r<47;r++)b.push({k:t+r,v:n})}for(b.sort(function(e,t){return t.v-e.v}),r=0;rs(n)?1:-1}};r({target:"Array",proto:!0,forced:_},{sort:function(e){void 0!==e&&i(e);var t,n,r=a(this);if(w)return void 0===e?m.call(r):m.call(r,e);var s=[],u=o(r.length);for(n=0;nh)throw TypeError(p);for(b=0,l=u(v,r);by-r+n;b--)delete v[b-1]}else if(n>r)for(b=y-r;b>w;b--)m=b+r-1,g=b+n-1,m in v?v[g]=v[m]:delete v[g];for(b=0;b94906265.62425156?s(e)+c:a(e-1+u(e-1)*u(e+1))}})},82376(e,t,n){var r=n(82109),i=Math.asinh,a=Math.log,o=Math.sqrt;function s(e){return isFinite(e=+e)&&0!=e?e<0?-s(-e):a(e+o(e*e+1)):e}r({target:"Math",stat:!0,forced:!(i&&1/i(0)>0)},{asinh:s})},73181(e,t,n){var r=n(82109),i=Math.atanh,a=Math.log;r({target:"Math",stat:!0,forced:!(i&&1/i(-0)<0)},{atanh:function(e){return 0==(e=+e)?e:a((1+e)/(1-e))/2}})},23484(e,t,n){var r=n(82109),i=n(64310),a=Math.abs,o=Math.pow;r({target:"Math",stat:!0},{cbrt:function(e){return i(e=+e)*o(a(e),1/3)}})},2388(e,t,n){var r=n(82109),i=Math.floor,a=Math.log,o=Math.LOG2E;r({target:"Math",stat:!0},{clz32:function(e){return(e>>>=0)?31-i(a(e+.5)*o):32}})},88621(e,t,n){var r=n(82109),i=n(66736),a=Math.cosh,o=Math.abs,s=Math.E;r({target:"Math",stat:!0,forced:!a||a(710)===1/0},{cosh:function(e){var t=i(o(e)-1)+1;return(t+1/(t*s*s))*(s/2)}})},60403(e,t,n){var r=n(82109),i=n(66736);r({target:"Math",stat:!0,forced:i!=Math.expm1},{expm1:i})},84755(e,t,n){var r=n(82109),i=n(26130);r({target:"Math",stat:!0},{fround:i})},25438(e,t,n){var r=n(82109),i=Math.hypot,a=Math.abs,o=Math.sqrt,s=!!i&&i(1/0,NaN)!==1/0;r({target:"Math",stat:!0,forced:s},{hypot:function(e,t){for(var n,r,i=0,s=0,u=arguments.length,c=0;s0?i+=(r=n/c)*r:i+=n;return c===1/0?1/0:c*o(i)}})},90332(e,t,n){var r=n(82109),i=n(47293),a=Math.imul,o=i(function(){return -5!=a(4294967295,5)||2!=a.length});r({target:"Math",stat:!0,forced:o},{imul:function(e,t){var n=65535,r=+e,i=+t,a=n&r,o=n&i;return 0|a*o+((n&r>>>16)*o+a*(n&i>>>16)<<16>>>0)}})},40658(e,t,n){var r=n(82109),i=Math.log,a=Math.LOG10E;r({target:"Math",stat:!0},{log10:function(e){return i(e)*a}})},40197(e,t,n){var r=n(82109),i=n(26513);r({target:"Math",stat:!0},{log1p:i})},44914(e,t,n){var r=n(82109),i=Math.log,a=Math.LN2;r({target:"Math",stat:!0},{log2:function(e){return i(e)/a}})},52420(e,t,n){var r=n(82109),i=n(64310);r({target:"Math",stat:!0},{sign:i})},60160(e,t,n){var r=n(82109),i=n(47293),a=n(66736),o=Math.abs,s=Math.exp,u=Math.E,c=i(function(){return -.00000000000000002!=Math.sinh(-.00000000000000002)});r({target:"Math",stat:!0,forced:c},{sinh:function(e){return 1>o(e=+e)?(a(e)-a(-e))/2:(s(e-1)-s(-e-1))*(u/2)}})},60970(e,t,n){var r=n(82109),i=n(66736),a=Math.exp;r({target:"Math",stat:!0},{tanh:function(e){var t=i(e=+e),n=i(-e);return t==1/0?1:n==1/0?-1:(t-n)/(a(e)+a(-e))}})},10408(e,t,n){n(58003)(Math,"Math",!0)},73689(e,t,n){var r=n(82109),i=Math.ceil,a=Math.floor;r({target:"Math",stat:!0},{trunc:function(e){return(e>0?a:i)(e)}})},9653(e,t,n){"use strict";var r=n(19781),i=n(17854),a=n(54705),o=n(31320),s=n(86656),u=n(84326),c=n(79587),l=n(52190),f=n(57593),d=n(47293),h=n(70030),p=n(8006).f,b=n(31236).f,m=n(3070).f,g=n(53111).trim,v="Number",y=i[v],w=y.prototype,_=u(h(w))==v,E=function(e){if(l(e))throw TypeError("Cannot convert a Symbol value to a number");var t,n,r,i,a,o,s,u,c=f(e,"number");if("string"==typeof c&&c.length>2){if(43===(t=(c=g(c)).charCodeAt(0))||45===t){if(88===(n=c.charCodeAt(2))||120===n)return NaN}else if(48===t){switch(c.charCodeAt(1)){case 66:case 98:r=2,i=49;break;case 79:case 111:r=8,i=55;break;default:return+c}for(s=0,o=(a=c.slice(2)).length;si)return NaN;return parseInt(a,r)}}return+c};if(a(v,!y(" 0o1")||!y("0b1")||y("+0x1"))){for(var S,k=function(e){var t=arguments.length<1?0:e,n=this;return n instanceof k&&(_?d(function(){w.valueOf.call(n)}):u(n)!=v)?c(new y(E(t)),n,k):E(t)},x=r?p(y):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger,fromString,range".split(","),T=0;x.length>T;T++)s(y,S=x[T])&&!s(k,S)&&m(k,S,b(y,S));k.prototype=w,w.constructor=k,o(i,v,k)}},93299(e,t,n){n(82109)({target:"Number",stat:!0},{EPSILON:2220446049250313e-31})},35192(e,t,n){var r=n(82109),i=n(77023);r({target:"Number",stat:!0},{isFinite:i})},33161(e,t,n){var r=n(82109),i=n(18730);r({target:"Number",stat:!0},{isInteger:i})},44048(e,t,n){n(82109)({target:"Number",stat:!0},{isNaN:function(e){return e!=e}})},78285(e,t,n){var r=n(82109),i=n(18730),a=Math.abs;r({target:"Number",stat:!0},{isSafeInteger:function(e){return i(e)&&9007199254740991>=a(e)}})},44363(e,t,n){n(82109)({target:"Number",stat:!0},{MAX_SAFE_INTEGER:9007199254740991})},55994(e,t,n){n(82109)({target:"Number",stat:!0},{MIN_SAFE_INTEGER:-9007199254740991})},61874(e,t,n){var r=n(82109),i=n(2814);r({target:"Number",stat:!0,forced:Number.parseFloat!=i},{parseFloat:i})},9494(e,t,n){var r=n(82109),i=n(83009);r({target:"Number",stat:!0,forced:Number.parseInt!=i},{parseInt:i})},56977(e,t,n){"use strict";var r=n(82109),i=n(99958),a=n(50863),o=n(38415),s=n(47293),u=1..toFixed,c=Math.floor,l=function(e,t,n){return 0===t?n:t%2==1?l(e,t-1,n*e):l(e*e,t/2,n)},f=function(e){for(var t=0,n=e;n>=4096;)t+=12,n/=4096;for(;n>=2;)t+=1,n/=2;return t},d=function(e,t,n){for(var r=-1,i=n;++r<6;)i+=t*e[r],e[r]=i%1e7,i=c(i/1e7)},h=function(e,t){for(var n=6,r=0;--n>=0;)r+=e[n],e[n]=c(r/t),r=r%t*1e7},p=function(e){for(var t=6,n="";--t>=0;)if(""!==n||0===t||0!==e[t]){var r=String(e[t]);n=""===n?r:n+o.call("0",7-r.length)+r}return n},b=!!u||!s(function(){u.call({})});r({target:"Number",proto:!0,forced:b},{toFixed:function(e){var t,n,r,s,u=a(this),c=i(e),b=[0,0,0,0,0,0],m="",g="0";if(c<0||c>20)throw RangeError("Incorrect fraction digits");if(u!=u)return"NaN";if(u<=-1e21||u>=1e21)return String(u);if(u<0&&(m="-",u=-u),u>1e-21){if(n=(t=f(u*l(2,69,1))-69)<0?u*l(2,-t,1):u/l(2,t,1),n*=4503599627370496,(t=52-t)>0){for(d(b,0,n),r=c;r>=7;)d(b,1e7,0),r-=7;for(d(b,l(10,r,1),0),r=t-1;r>=23;)h(b,8388608),r-=23;h(b,1<0?m+((s=g.length)<=c?"0."+o.call("0",c-s)+g:g.slice(0,s-c)+"."+g.slice(s-c)):m+g}})},55147(e,t,n){"use strict";var r=n(82109),i=n(47293),a=n(50863),o=1..toPrecision,s=i(function(){return"1"!==o.call(1,void 0)})||!i(function(){o.call({})});r({target:"Number",proto:!0,forced:s},{toPrecision:function(e){return void 0===e?o.call(a(this)):o.call(a(this),e)}})},19601(e,t,n){var r=n(82109),i=n(21574);r({target:"Object",stat:!0,forced:Object.assign!==i},{assign:i})},78011(e,t,n){var r=n(82109),i=n(19781),a=n(70030);r({target:"Object",stat:!0,sham:!i},{create:a})},59595(e,t,n){"use strict";var r=n(82109),i=n(19781),a=n(69026),o=n(47908),s=n(13099),u=n(3070);i&&r({target:"Object",proto:!0,forced:a},{__defineGetter__:function(e,t){u.f(o(this),e,{get:s(t),enumerable:!0,configurable:!0})}})},33321(e,t,n){var r=n(82109),i=n(19781),a=n(36048);r({target:"Object",stat:!0,forced:!i,sham:!i},{defineProperties:a})},69070(e,t,n){var r=n(82109),i=n(19781),a=n(3070);r({target:"Object",stat:!0,forced:!i,sham:!i},{defineProperty:a.f})},35500(e,t,n){"use strict";var r=n(82109),i=n(19781),a=n(69026),o=n(47908),s=n(13099),u=n(3070);i&&r({target:"Object",proto:!0,forced:a},{__defineSetter__:function(e,t){u.f(o(this),e,{set:s(t),enumerable:!0,configurable:!0})}})},69720(e,t,n){var r=n(82109),i=n(44699).entries;r({target:"Object",stat:!0},{entries:function(e){return i(e)}})},43371(e,t,n){var r=n(82109),i=n(76677),a=n(47293),o=n(70111),s=n(62423).onFreeze,u=Object.freeze,c=a(function(){u(1)});r({target:"Object",stat:!0,forced:c,sham:!i},{freeze:function(e){return u&&o(e)?u(s(e)):e}})},38559(e,t,n){var r=n(82109),i=n(20408),a=n(86135);r({target:"Object",stat:!0},{fromEntries:function(e){var t={};return i(e,function(e,n){a(t,e,n)},{AS_ENTRIES:!0}),t}})},38880(e,t,n){var r=n(82109),i=n(47293),a=n(45656),o=n(31236).f,s=n(19781),u=i(function(){o(1)}),c=!s||u;r({target:"Object",stat:!0,forced:c,sham:!s},{getOwnPropertyDescriptor:function(e,t){return o(a(e),t)}})},49337(e,t,n){var r=n(82109),i=n(19781),a=n(53887),o=n(45656),s=n(31236),u=n(86135);r({target:"Object",stat:!0,sham:!i},{getOwnPropertyDescriptors:function(e){for(var t,n,r=o(e),i=s.f,c=a(r),l={},f=0;c.length>f;)void 0!==(n=i(r,t=c[f++]))&&u(l,t,n);return l}})},36210(e,t,n){var r=n(82109),i=n(47293),a=n(1156).f,o=i(function(){return!Object.getOwnPropertyNames(1)});r({target:"Object",stat:!0,forced:o},{getOwnPropertyNames:a})},30489(e,t,n){var r=n(82109),i=n(47293),a=n(47908),o=n(79518),s=n(49920),u=i(function(){o(1)});r({target:"Object",stat:!0,forced:u,sham:!s},{getPrototypeOf:function(e){return o(a(e))}})},46314(e,t,n){var r=n(82109),i=n(86656);r({target:"Object",stat:!0},{hasOwn:i})},41825(e,t,n){var r=n(82109),i=n(47293),a=n(70111),o=Object.isExtensible,s=i(function(){o(1)});r({target:"Object",stat:!0,forced:s},{isExtensible:function(e){return!!a(e)&&(!o||o(e))}})},98410(e,t,n){var r=n(82109),i=n(47293),a=n(70111),o=Object.isFrozen,s=i(function(){o(1)});r({target:"Object",stat:!0,forced:s},{isFrozen:function(e){return!a(e)||!!o&&o(e)}})},72200(e,t,n){var r=n(82109),i=n(47293),a=n(70111),o=Object.isSealed,s=i(function(){o(1)});r({target:"Object",stat:!0,forced:s},{isSealed:function(e){return!a(e)||!!o&&o(e)}})},43304(e,t,n){var r=n(82109),i=n(81150);r({target:"Object",stat:!0},{is:i})},47941(e,t,n){var r=n(82109),i=n(47908),a=n(81956),o=n(47293)(function(){a(1)});r({target:"Object",stat:!0,forced:o},{keys:function(e){return a(i(e))}})},94869(e,t,n){"use strict";var r=n(82109),i=n(19781),a=n(69026),o=n(47908),s=n(34948),u=n(79518),c=n(31236).f;i&&r({target:"Object",proto:!0,forced:a},{__lookupGetter__:function(e){var t,n=o(this),r=s(e);do if(t=c(n,r))return t.get;while(n=u(n))}})},33952(e,t,n){"use strict";var r=n(82109),i=n(19781),a=n(69026),o=n(47908),s=n(34948),u=n(79518),c=n(31236).f;i&&r({target:"Object",proto:!0,forced:a},{__lookupSetter__:function(e){var t,n=o(this),r=s(e);do if(t=c(n,r))return t.set;while(n=u(n))}})},57227(e,t,n){var r=n(82109),i=n(70111),a=n(62423).onFreeze,o=n(76677),s=n(47293),u=Object.preventExtensions,c=s(function(){u(1)});r({target:"Object",stat:!0,forced:c,sham:!o},{preventExtensions:function(e){return u&&i(e)?u(a(e)):e}})},60514(e,t,n){var r=n(82109),i=n(70111),a=n(62423).onFreeze,o=n(76677),s=n(47293),u=Object.seal,c=s(function(){u(1)});r({target:"Object",stat:!0,forced:c,sham:!o},{seal:function(e){return u&&i(e)?u(a(e)):e}})},68304(e,t,n){var r=n(82109),i=n(27674);r({target:"Object",stat:!0},{setPrototypeOf:i})},41539(e,t,n){var r=n(51694),i=n(31320),a=n(90288);r||i(Object.prototype,"toString",a,{unsafe:!0})},26833(e,t,n){var r=n(82109),i=n(44699).values;r({target:"Object",stat:!0},{values:function(e){return i(e)}})},54678(e,t,n){var r=n(82109),i=n(2814);r({global:!0,forced:parseFloat!=i},{parseFloat:i})},91058(e,t,n){var r=n(82109),i=n(83009);r({global:!0,forced:parseInt!=i},{parseInt:i})},17922(e,t,n){"use strict";var r=n(82109),i=n(13099),a=n(78523),o=n(12534),s=n(20408);r({target:"Promise",stat:!0},{allSettled:function(e){var t=this,n=a.f(t),r=n.resolve,u=n.reject,c=o(function(){var n=i(t.resolve),a=[],o=0,u=1;s(e,function(e){var i=o++,s=!1;a.push(void 0),u++,n.call(t,e).then(function(e){!s&&(s=!0,a[i]={status:"fulfilled",value:e},--u||r(a))},function(e){!s&&(s=!0,a[i]={status:"rejected",reason:e},--u||r(a))})}),--u||r(a)});return c.error&&u(c.value),n.promise}})},34668(e,t,n){"use strict";var r=n(82109),i=n(13099),a=n(35005),o=n(78523),s=n(12534),u=n(20408),c="No one promise resolved";r({target:"Promise",stat:!0},{any:function(e){var t=this,n=o.f(t),r=n.resolve,l=n.reject,f=s(function(){var n=i(t.resolve),o=[],s=0,f=1,d=!1;u(e,function(e){var i=s++,u=!1;o.push(void 0),f++,n.call(t,e).then(function(e){u||d||(d=!0,r(e))},function(e){!u&&!d&&(u=!0,o[i]=e,--f||l(new(a("AggregateError"))(o,c)))})}),--f||l(new(a("AggregateError"))(o,c))});return f.error&&l(f.value),n.promise}})},17727(e,t,n){"use strict";var r=n(82109),i=n(31913),a=n(13366),o=n(47293),s=n(35005),u=n(36707),c=n(69478),l=n(31320),f=!!a&&o(function(){a.prototype.finally.call({then:function(){}},function(){})});if(r({target:"Promise",proto:!0,real:!0,forced:f},{finally:function(e){var t=u(this,s("Promise")),n="function"==typeof e;return this.then(n?function(n){return c(t,e()).then(function(){return n})}:e,n?function(n){return c(t,e()).then(function(){throw n})}:e)}}),!i&&"function"==typeof a){var d=s("Promise").prototype.finally;a.prototype.finally!==d&&l(a.prototype,"finally",d,{unsafe:!0})}},88674(e,t,n){"use strict";var r,i,a,o,s=n(82109),u=n(31913),c=n(17854),l=n(35005),f=n(13366),d=n(31320),h=n(12248),p=n(27674),b=n(58003),m=n(96340),g=n(70111),v=n(13099),y=n(25787),w=n(42788),_=n(20408),E=n(17072),S=n(36707),k=n(20261).set,x=n(95948),T=n(69478),M=n(842),O=n(78523),A=n(12534),L=n(29909),C=n(54705),I=n(5112),D=n(7871),N=n(35268),P=n(7392),R=I("species"),j="Promise",F=L.get,Y=L.set,B=L.getterFor(j),U=f&&f.prototype,H=f,$=U,z=c.TypeError,G=c.document,W=c.process,K=O.f,V=K,q=!!(G&&G.createEvent&&c.dispatchEvent),Z="function"==typeof PromiseRejectionEvent,X="unhandledrejection",J="rejectionhandled",Q=0,ee=1,et=2,en=1,er=2,ei=!1,ea=C(j,function(){var e=w(H),t=e!==String(H);if(!t&&66===P||u&&!$.finally)return!0;if(P>=51&&/native code/.test(e))return!1;var n=new H(function(e){e(1)}),r=function(e){e(function(){},function(){})};return(n.constructor={})[R]=r,!(ei=n.then(function(){}) instanceof r)||!t&&D&&!Z}),eo=ea||!E(function(e){H.all(e).catch(function(){})}),es=function(e){var t;return!!g(e)&&"function"==typeof(t=e.then)&&t},eu=function(e,t){if(!e.notified){e.notified=!0;var n=e.reactions;x(function(){for(var r=e.value,i=e.state==ee,a=0;n.length>a;){var o,s,u,c=n[a++],l=i?c.ok:c.fail,f=c.resolve,d=c.reject,h=c.domain;try{l?(i||(e.rejection===er&&ed(e),e.rejection=en),!0===l?o=r:(h&&h.enter(),o=l(r),h&&(h.exit(),u=!0)),o===c.promise?d(z("Promise-chain cycle")):(s=es(o))?s.call(o,f,d):f(o)):d(r)}catch(p){h&&!u&&h.exit(),d(p)}}e.reactions=[],e.notified=!1,t&&!e.rejection&&el(e)})}},ec=function(e,t,n){var r,i;q?((r=G.createEvent("Event")).promise=t,r.reason=n,r.initEvent(e,!1,!0),c.dispatchEvent(r)):r={promise:t,reason:n},!Z&&(i=c["on"+e])?i(r):e===X&&M("Unhandled promise rejection",n)},el=function(e){k.call(c,function(){var t,n=e.facade,r=e.value;if(ef(e)&&(t=A(function(){N?W.emit("unhandledRejection",r,n):ec(X,n,r)}),e.rejection=N||ef(e)?er:en,t.error))throw t.value})},ef=function(e){return e.rejection!==en&&!e.parent},ed=function(e){k.call(c,function(){var t=e.facade;N?W.emit("rejectionHandled",t):ec(J,t,e.value)})},eh=function(e,t,n){return function(r){e(t,r,n)}},ep=function(e,t,n){e.done||(e.done=!0,n&&(e=n),e.value=t,e.state=et,eu(e,!0))},eb=function(e,t,n){if(!e.done){e.done=!0,n&&(e=n);try{if(e.facade===t)throw z("Promise can't be resolved itself");var r=es(t);r?x(function(){var n={done:!1};try{r.call(t,eh(eb,n,e),eh(ep,n,e))}catch(i){ep(n,i,e)}}):(e.value=t,e.state=ee,eu(e,!1))}catch(i){ep({done:!1},i,e)}}};if(ea&&($=(H=function(e){y(this,H,j),v(e),r.call(this);var t=F(this);try{e(eh(eb,t),eh(ep,t))}catch(n){ep(t,n)}}).prototype,(r=function(e){Y(this,{type:j,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:Q,value:void 0})}).prototype=h($,{then:function(e,t){var n=B(this),r=K(S(this,H));return r.ok="function"!=typeof e||e,r.fail="function"==typeof t&&t,r.domain=N?W.domain:void 0,n.parent=!0,n.reactions.push(r),n.state!=Q&&eu(n,!1),r.promise},catch:function(e){return this.then(void 0,e)}}),i=function(){var e=new r,t=F(e);this.promise=e,this.resolve=eh(eb,t),this.reject=eh(ep,t)},O.f=K=function(e){return e===H||e===a?new i(e):V(e)},!u&&"function"==typeof f&&U!==Object.prototype)){o=U.then,ei||(d(U,"then",function(e,t){var n=this;return new H(function(e,t){o.call(n,e,t)}).then(e,t)},{unsafe:!0}),d(U,"catch",$.catch,{unsafe:!0}));try{delete U.constructor}catch(em){}p&&p(U,$)}s({global:!0,wrap:!0,forced:ea},{Promise:H}),b(H,j,!1,!0),m(j),a=l(j),s({target:j,stat:!0,forced:ea},{reject:function(e){var t=K(this);return t.reject.call(void 0,e),t.promise}}),s({target:j,stat:!0,forced:u||ea},{resolve:function(e){return T(u&&this===a?H:this,e)}}),s({target:j,stat:!0,forced:eo},{all:function(e){var t=this,n=K(t),r=n.resolve,i=n.reject,a=A(function(){var n=v(t.resolve),a=[],o=0,s=1;_(e,function(e){var u=o++,c=!1;a.push(void 0),s++,n.call(t,e).then(function(e){!c&&(c=!0,a[u]=e,--s||r(a))},i)}),--s||r(a)});return a.error&&i(a.value),n.promise},race:function(e){var t=this,n=K(t),r=n.reject,i=A(function(){var i=v(t.resolve);_(e,function(e){i.call(t,e).then(n.resolve,r)})});return i.error&&r(i.value),n.promise}})},36535(e,t,n){var r=n(82109),i=n(35005),a=n(13099),o=n(19670),s=n(47293),u=i("Reflect","apply"),c=Function.apply,l=!s(function(){u(function(){})});r({target:"Reflect",stat:!0,forced:l},{apply:function(e,t,n){return a(e),o(n),u?u(e,t,n):c.call(e,t,n)}})},12419(e,t,n){var r=n(82109),i=n(35005),a=n(13099),o=n(19670),s=n(70111),u=n(70030),c=n(27065),l=n(47293),f=i("Reflect","construct"),d=l(function(){function e(){}return!(f(function(){},[],e) instanceof e)}),h=!l(function(){f(function(){})}),p=d||h;r({target:"Reflect",stat:!0,forced:p,sham:p},{construct:function(e,t){a(e),o(t);var n=arguments.length<3?e:a(arguments[2]);if(h&&!d)return f(e,t,n);if(e==n){switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3])}var r=[null];return r.push.apply(r,t),new(c.apply(e,r))}var i=n.prototype,l=u(s(i)?i:Object.prototype),p=Function.apply.call(e,l,t);return s(p)?p:l}})},69596(e,t,n){var r=n(82109),i=n(19781),a=n(19670),o=n(34948),s=n(3070),u=n(47293)(function(){Reflect.defineProperty(s.f({},1,{value:1}),1,{value:2})});r({target:"Reflect",stat:!0,forced:u,sham:!i},{defineProperty:function(e,t,n){a(e);var r=o(t);a(n);try{return s.f(e,r,n),!0}catch(i){return!1}}})},52586(e,t,n){var r=n(82109),i=n(19670),a=n(31236).f;r({target:"Reflect",stat:!0},{deleteProperty:function(e,t){var n=a(i(e),t);return(!n||!!n.configurable)&&delete e[t]}})},95683(e,t,n){var r=n(82109),i=n(19781),a=n(19670),o=n(31236);r({target:"Reflect",stat:!0,sham:!i},{getOwnPropertyDescriptor:function(e,t){return o.f(a(e),t)}})},39361(e,t,n){var r=n(82109),i=n(19670),a=n(79518),o=n(49920);r({target:"Reflect",stat:!0,sham:!o},{getPrototypeOf:function(e){return a(i(e))}})},74819(e,t,n){var r=n(82109),i=n(70111),a=n(19670),o=n(45032),s=n(31236),u=n(79518);function c(e,t){var n,r,l=arguments.length<3?e:arguments[2];return a(e)===l?e[t]:(n=s.f(e,t))?o(n)?n.value:void 0===n.get?void 0:n.get.call(l):i(r=u(e))?c(r,t,l):void 0}r({target:"Reflect",stat:!0},{get:c})},51037(e,t,n){n(82109)({target:"Reflect",stat:!0},{has:function(e,t){return t in e}})},5898(e,t,n){var r=n(82109),i=n(19670),a=Object.isExtensible;r({target:"Reflect",stat:!0},{isExtensible:function(e){return i(e),!a||a(e)}})},67556(e,t,n){var r=n(82109),i=n(53887);r({target:"Reflect",stat:!0},{ownKeys:i})},14361(e,t,n){var r=n(82109),i=n(35005),a=n(19670),o=n(76677);r({target:"Reflect",stat:!0,sham:!o},{preventExtensions:function(e){a(e);try{var t=i("Object","preventExtensions");return t&&t(e),!0}catch(n){return!1}}})},39532(e,t,n){var r=n(82109),i=n(19670),a=n(96077),o=n(27674);o&&r({target:"Reflect",stat:!0},{setPrototypeOf:function(e,t){i(e),a(t);try{return o(e,t),!0}catch(n){return!1}}})},83593(e,t,n){var r=n(82109),i=n(19670),a=n(70111),o=n(45032),s=n(47293),u=n(3070),c=n(31236),l=n(79518),f=n(79114);function d(e,t,n){var r,s,h,p=arguments.length<4?e:arguments[3],b=c.f(i(e),t);if(!b){if(a(s=l(e)))return d(s,t,n,p);b=f(0)}if(o(b)){if(!1===b.writable||!a(p))return!1;if(r=c.f(p,t)){if(r.get||r.set||!1===r.writable)return!1;r.value=n,u.f(p,t,r)}else u.f(p,t,f(0,n))}else{if(void 0===(h=b.set))return!1;h.call(p,n)}return!0}var h=s(function(){var e=function(){},t=u.f(new e,"a",{configurable:!0});return!1!==Reflect.set(e.prototype,"a",1,t)});r({target:"Reflect",stat:!0,forced:h},{set:d})},81299(e,t,n){var r=n(82109),i=n(17854),a=n(58003);r({global:!0},{Reflect:{}}),a(i.Reflect,"Reflect",!0)},24603(e,t,n){var r=n(19781),i=n(17854),a=n(54705),o=n(79587),s=n(68880),u=n(3070).f,c=n(8006).f,l=n(47850),f=n(41340),d=n(67066),h=n(52999),p=n(31320),b=n(47293),m=n(86656),g=n(29909).enforce,v=n(96340),y=n(5112),w=n(9441),_=n(38173),E=y("match"),S=i.RegExp,k=S.prototype,x=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,T=/a/g,M=/a/g,O=new S(T)!==T,A=h.UNSUPPORTED_Y,L=r&&(!O||A||w||_||b(function(){return M[E]=!1,S(T)!=T||S(M)==M||"/a/i"!=S(T,"i")})),C=function(e){for(var t,n=e.length,r=0,i="",a=!1;r<=n;r++){if("\\"===(t=e.charAt(r))){i+=t+e.charAt(++r);continue}a||"."!==t?("["===t?a=!0:"]"===t&&(a=!1),i+=t):i+="[\\s\\S]"}return i},I=function(e){for(var t,n=e.length,r=0,i="",a=[],o={},s=!1,u=!1,c=0,l="";r<=n;r++){if("\\"===(t=e.charAt(r)))t+=e.charAt(++r);else if("]"===t)s=!1;else if(!s)switch(!0){case"["===t:s=!0;break;case"("===t:x.test(e.slice(r+1))&&(r+=2,u=!0),i+=t,c++;continue;case">"===t&&u:if(""===l||m(o,l))throw SyntaxError("Invalid capture group name");o[l]=!0,a.push([l,c]),u=!1,l="";continue}u?l+=t:i+=t}return[i,a]};if(a("RegExp",L)){for(var D=function(e,t){var n,r,i,a,u,c,h=this instanceof D,p=l(e),b=void 0===t,m=[],v=e;if(!h&&p&&b&&e.constructor===D)return e;if((p||e instanceof D)&&(e=e.source,b&&(t=("flags"in v)?v.flags:d.call(v))),e=void 0===e?"":f(e),t=void 0===t?"":f(t),v=e,w&&("dotAll"in T)&&(r=!!t&&t.indexOf("s")>-1)&&(t=t.replace(/s/g,"")),n=t,A&&("sticky"in T)&&(i=!!t&&t.indexOf("y")>-1)&&(t=t.replace(/y/g,"")),_&&(e=(a=I(e))[0],m=a[1]),u=o(S(e,t),h?this:k,D),(r||i||m.length)&&(c=g(u),r&&(c.dotAll=!0,c.raw=D(C(e),n)),i&&(c.sticky=!0),m.length&&(c.groups=m)),e!==v)try{s(u,"source",""===v?"(?:)":v)}catch(y){}return u},N=function(e){(e in D)||u(D,e,{configurable:!0,get:function(){return S[e]},set:function(t){S[e]=t}})},P=c(S),R=0;P.length>R;)N(P[R++]);k.constructor=D,D.prototype=k,p(i,"RegExp",D)}v("RegExp")},28450(e,t,n){var r=n(19781),i=n(9441),a=n(3070).f,o=n(29909).get,s=RegExp.prototype;r&&i&&a(s,"dotAll",{configurable:!0,get:function(){if(this!==s){if(this instanceof RegExp)return!!o(this).dotAll;throw TypeError("Incompatible receiver, RegExp required")}}})},74916(e,t,n){"use strict";var r=n(82109),i=n(22261);r({target:"RegExp",proto:!0,forced:/./.exec!==i},{exec:i})},92087(e,t,n){var r=n(19781),i=n(3070),a=n(67066),o=n(47293);r&&o(function(){return"sy"!==Object.getOwnPropertyDescriptor(RegExp.prototype,"flags").get.call({dotAll:!0,sticky:!0})})&&i.f(RegExp.prototype,"flags",{configurable:!0,get:a})},88386(e,t,n){var r=n(19781),i=n(52999).UNSUPPORTED_Y,a=n(3070).f,o=n(29909).get,s=RegExp.prototype;r&&i&&a(s,"sticky",{configurable:!0,get:function(){if(this!==s){if(this instanceof RegExp)return!!o(this).sticky;throw TypeError("Incompatible receiver, RegExp required")}}})},77601(e,t,n){"use strict";n(74916);var r,i,a=n(82109),o=n(70111),s=(r=!1,(i=/[ac]/).exec=function(){return r=!0,/./.exec.apply(this,arguments)},!0===i.test("abc")&&r),u=/./.test;a({target:"RegExp",proto:!0,forced:!s},{test:function(e){if("function"!=typeof this.exec)return u.call(this,e);var t=this.exec(e);if(null!==t&&!o(t))throw Error("RegExp exec method returned something other than an Object or null");return!!t}})},39714(e,t,n){"use strict";var r=n(31320),i=n(19670),a=n(41340),o=n(47293),s=n(67066),u="toString",c=RegExp.prototype,l=c[u],f=o(function(){return"/a/b"!=l.call({source:"a",flags:"b"})}),d=l.name!=u;(f||d)&&r(RegExp.prototype,u,function(){var e=i(this),t=a(e.source),n=e.flags,r=a(void 0===n&&e instanceof RegExp&&!("flags"in c)?s.call(e):n);return"/"+t+"/"+r},{unsafe:!0})},70189(e,t,n){"use strict";var r=n(77710),i=n(95631);e.exports=r("Set",function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}},i)},15218(e,t,n){"use strict";var r=n(82109),i=n(14230),a=n(43429);r({target:"String",proto:!0,forced:a("anchor")},{anchor:function(e){return i(this,"a","name",e)}})},24506(e,t,n){"use strict";var r=n(82109),i=n(84488),a=n(99958),o=n(17466),s=n(41340),u=n(47293)(function(){return"\uD842"!=="𠮷".at(0)});r({target:"String",proto:!0,forced:u},{at:function(e){var t=s(i(this)),n=o(t.length),r=a(e),u=r>=0?r:n+r;return u<0||u>=n?void 0:t.charAt(u)}})},74475(e,t,n){"use strict";var r=n(82109),i=n(14230),a=n(43429);r({target:"String",proto:!0,forced:a("big")},{big:function(){return i(this,"big","","")}})},57929(e,t,n){"use strict";var r=n(82109),i=n(14230),a=n(43429);r({target:"String",proto:!0,forced:a("blink")},{blink:function(){return i(this,"blink","","")}})},50915(e,t,n){"use strict";var r=n(82109),i=n(14230),a=n(43429);r({target:"String",proto:!0,forced:a("bold")},{bold:function(){return i(this,"b","","")}})},79841(e,t,n){"use strict";var r=n(82109),i=n(28710).codeAt;r({target:"String",proto:!0},{codePointAt:function(e){return i(this,e)}})},27852(e,t,n){"use strict";var r,i=n(82109),a=n(31236).f,o=n(17466),s=n(41340),u=n(3929),c=n(84488),l=n(84964),f=n(31913),d="".endsWith,h=Math.min,p=l("endsWith"),b=!f&&!p&&!!(r=a(String.prototype,"endsWith"))&&!r.writable;i({target:"String",proto:!0,forced:!b&&!p},{endsWith:function(e){var t=s(c(this));u(e);var n=arguments.length>1?arguments[1]:void 0,r=o(t.length),i=void 0===n?r:h(o(n),r),a=s(e);return d?d.call(t,a,i):t.slice(i-a.length,i)===a}})},29253(e,t,n){"use strict";var r=n(82109),i=n(14230),a=n(43429);r({target:"String",proto:!0,forced:a("fixed")},{fixed:function(){return i(this,"tt","","")}})},42125(e,t,n){"use strict";var r=n(82109),i=n(14230),a=n(43429);r({target:"String",proto:!0,forced:a("fontcolor")},{fontcolor:function(e){return i(this,"font","color",e)}})},78830(e,t,n){"use strict";var r=n(82109),i=n(14230),a=n(43429);r({target:"String",proto:!0,forced:a("fontsize")},{fontsize:function(e){return i(this,"font","size",e)}})},94953(e,t,n){var r=n(82109),i=n(51400),a=String.fromCharCode,o=String.fromCodePoint;r({target:"String",stat:!0,forced:!!o&&1!=o.length},{fromCodePoint:function(e){for(var t,n=[],r=arguments.length,o=0;r>o;){if(t=+arguments[o++],i(t,1114111)!==t)throw RangeError(t+" is not a valid code point");n.push(t<65536?a(t):a(((t-=65536)>>10)+55296,t%1024+56320))}return n.join("")}})},32023(e,t,n){"use strict";var r=n(82109),i=n(3929),a=n(84488),o=n(41340),s=n(84964);r({target:"String",proto:!0,forced:!s("includes")},{includes:function(e){return!!~o(a(this)).indexOf(o(i(e)),arguments.length>1?arguments[1]:void 0)}})},58734(e,t,n){"use strict";var r=n(82109),i=n(14230),a=n(43429);r({target:"String",proto:!0,forced:a("italics")},{italics:function(){return i(this,"i","","")}})},78783(e,t,n){"use strict";var r=n(28710).charAt,i=n(41340),a=n(29909),o=n(70654),s="String Iterator",u=a.set,c=a.getterFor(s);o(String,"String",function(e){u(this,{type:s,string:i(e),index:0})},function(){var e,t=c(this),n=t.string,i=t.index;return i>=n.length?{value:void 0,done:!0}:(e=r(n,i),t.index+=e.length,{value:e,done:!1})})},29254(e,t,n){"use strict";var r=n(82109),i=n(14230),a=n(43429);r({target:"String",proto:!0,forced:a("link")},{link:function(e){return i(this,"a","href",e)}})},76373(e,t,n){"use strict";var r=n(82109),i=n(24994),a=n(84488),o=n(17466),s=n(41340),u=n(13099),c=n(19670),l=n(84326),f=n(47850),d=n(67066),h=n(68880),p=n(47293),b=n(5112),m=n(36707),g=n(31530),v=n(29909),y=n(31913),w=b("matchAll"),_="RegExp String",E=_+" Iterator",S=v.set,k=v.getterFor(E),x=RegExp.prototype,T=x.exec,M="".matchAll,O=!!M&&!p(function(){"a".matchAll(/./)}),A=function(e,t){var n,r=e.exec;if("function"==typeof r){if("object"!=typeof(n=r.call(e,t)))throw TypeError("Incorrect exec result");return n}return T.call(e,t)},L=i(function(e,t,n,r){S(this,{type:E,regexp:e,string:t,global:n,unicode:r,done:!1})},_,function(){var e=k(this);if(e.done)return{value:void 0,done:!0};var t=e.regexp,n=e.string,r=A(t,n);return null===r?{value:void 0,done:e.done=!0}:e.global?(""===s(r[0])&&(t.lastIndex=g(n,o(t.lastIndex),e.unicode)),{value:r,done:!1}):(e.done=!0,{value:r,done:!1})}),C=function(e){var t,n,r,i,a,u,l=c(this),f=s(e);return t=m(l,RegExp),void 0===(n=l.flags)&&l instanceof RegExp&&!("flags"in x)&&(n=d.call(l)),r=void 0===n?"":s(n),i=new t(t===RegExp?l.source:l,r),a=!!~r.indexOf("g"),u=!!~r.indexOf("u"),i.lastIndex=o(l.lastIndex),new L(i,f,a,u)};r({target:"String",proto:!0,forced:O},{matchAll:function(e){var t,n,r,i,o=a(this);if(null!=e){if(f(e)&&!~(t=s(a("flags"in x?e.flags:d.call(e)))).indexOf("g"))throw TypeError("`.matchAll` does not allow non-global regexes");if(O)return M.apply(o,arguments);if(void 0===(r=e[w])&&y&&"RegExp"==l(e)&&(r=C),null!=r)return u(r).call(e,o)}else if(O)return M.apply(o,arguments);return n=s(o),i=RegExp(e,"g"),y?C.call(i,n):i[w](n)}}),y||w in x||h(x,w,C)},4723(e,t,n){"use strict";var r=n(27007),i=n(19670),a=n(17466),o=n(41340),s=n(84488),u=n(31530),c=n(97651);r("match",function(e,t,n){return[function(t){var n=s(this),r=void 0==t?void 0:t[e];return void 0!==r?r.call(t,n):RegExp(t)[e](o(n))},function(e){var r,s=i(this),l=o(e),f=n(t,s,l);if(f.done)return f.value;if(!s.global)return c(s,l);var d=s.unicode;s.lastIndex=0;for(var h=[],p=0;null!==(r=c(s,l));){var b=o(r[0]);h[p]=b,""===b&&(s.lastIndex=u(l,a(s.lastIndex),d)),p++}return 0===p?null:h}]})},66528(e,t,n){"use strict";var r=n(82109),i=n(76650).end,a=n(54986);r({target:"String",proto:!0,forced:a},{padEnd:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}})},83112(e,t,n){"use strict";var r=n(82109),i=n(76650).start,a=n(54986);r({target:"String",proto:!0,forced:a},{padStart:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}})},38992(e,t,n){var r=n(82109),i=n(45656),a=n(17466),o=n(41340);r({target:"String",stat:!0},{raw:function(e){for(var t=i(e.raw),n=a(t.length),r=arguments.length,s=[],u=0;n>u;)s.push(o(t[u++])),ue.length?-1:""===t?n:e.indexOf(t,n)};r({target:"String",proto:!0},{replaceAll:function(e,t){var n,r,c,b,m,g,v,y,w,_=i(this),E=0,S=0,k="";if(null!=e){if((n=a(e))&&!~(r=o(i("flags"in d?e.flags:s.call(e)))).indexOf("g"))throw TypeError("`.replaceAll` does not allow non-global regexes");if(void 0!==(c=e[f]))return c.call(e,_,t);if(l&&n)return o(_).replace(e,t)}for(b=o(_),m=o(e),(g="function"==typeof t)||(t=o(t)),y=h(1,v=m.length),E=p(b,m,0);-1!==E;)w=g?o(t(m,E,b)):u(m,b,E,[],void 0,t),k+=b.slice(S,E)+w,S=E+v,E=p(b,m,E+y);return S")});r("replace",function(e,t,n){var r=v?"$":"$0";return[function(e,n){var r=c(this),i=void 0==e?void 0:e[h];return void 0!==i?i.call(e,r,n):t.call(u(r),e,n)},function(e,i){var c=a(this),h=u(e);if("string"==typeof i&&-1===i.indexOf(r)&&-1===i.indexOf("$<")){var g=n(t,c,h,i);if(g.done)return g.value}var v="function"==typeof i;v||(i=u(i));var y=c.global;if(y){var w=c.unicode;c.lastIndex=0}for(var _=[];;){var E=d(c,h);if(null===E||(_.push(E),!y))break;""===u(E[0])&&(c.lastIndex=l(h,s(c.lastIndex),w))}for(var S="",k=0,x=0;x<_.length;x++){for(var T=u((E=_[x])[0]),M=p(b(o(E.index),h.length),0),O=[],A=1;A=k&&(S+=h.slice(k,M)+I,k=M+T.length)}return S+h.slice(k)}]},!y||!g||v)},64765(e,t,n){"use strict";var r=n(27007),i=n(19670),a=n(84488),o=n(81150),s=n(41340),u=n(97651);r("search",function(e,t,n){return[function(t){var n=a(this),r=void 0==t?void 0:t[e];return void 0!==r?r.call(t,n):RegExp(t)[e](s(n))},function(e){var r=i(this),a=s(e),c=n(t,r,a);if(c.done)return c.value;var l=r.lastIndex;o(l,0)||(r.lastIndex=0);var f=u(r,a);return o(r.lastIndex,l)||(r.lastIndex=l),null===f?-1:f.index}]})},37268(e,t,n){"use strict";var r=n(82109),i=n(14230),a=n(43429);r({target:"String",proto:!0,forced:a("small")},{small:function(){return i(this,"small","","")}})},23123(e,t,n){"use strict";var r=n(27007),i=n(47850),a=n(19670),o=n(84488),s=n(36707),u=n(31530),c=n(17466),l=n(41340),f=n(97651),d=n(22261),h=n(52999),p=n(47293),b=h.UNSUPPORTED_Y,m=[].push,g=Math.min,v=4294967295,y=!p(function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var n="ab".split(e);return 2!==n.length||"a"!==n[0]||"b"!==n[1]});r("split",function(e,t,n){var r;return r="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(e,n){var r,a,s,u=l(o(this)),c=void 0===n?v:n>>>0;if(0===c)return[];if(void 0===e)return[u];if(!i(e))return t.call(u,e,c);for(var f=[],h=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),p=0,b=RegExp(e.source,h+"g");(r=d.call(b,u))&&(!((a=b.lastIndex)>p)||(f.push(u.slice(p,r.index)),r.length>1&&r.index=c)));)b.lastIndex===r.index&&b.lastIndex++;return p===u.length?(s||!b.test(""))&&f.push(""):f.push(u.slice(p)),f.length>c?f.slice(0,c):f}:"0".split(void 0,0).length?function(e,n){return void 0===e&&0===n?[]:t.call(this,e,n)}:t,[function(t,n){var i=o(this),a=void 0==t?void 0:t[e];return void 0!==a?a.call(t,i,n):r.call(l(i),t,n)},function(e,i){var o=a(this),d=l(e),h=n(r,o,d,i,r!==t);if(h.done)return h.value;var p=s(o,RegExp),m=o.unicode,y=(o.ignoreCase?"i":"")+(o.multiline?"m":"")+(o.unicode?"u":"")+(b?"g":"y"),w=new p(b?"^(?:"+o.source+")":o,y),_=void 0===i?v:i>>>0;if(0===_)return[];if(0===d.length)return null===f(w,d)?[d]:[];for(var E=0,S=0,k=[];S1?arguments[1]:void 0,t.length)),r=s(e);return d?d.call(t,r,n):t.slice(n,n+r.length)===r}})},7397(e,t,n){"use strict";var r=n(82109),i=n(14230),a=n(43429);r({target:"String",proto:!0,forced:a("strike")},{strike:function(){return i(this,"strike","","")}})},60086(e,t,n){"use strict";var r=n(82109),i=n(14230),a=n(43429);r({target:"String",proto:!0,forced:a("sub")},{sub:function(){return i(this,"sub","","")}})},83650(e,t,n){"use strict";var r=n(82109),i=n(84488),a=n(99958),o=n(41340),s="".slice,u=Math.max,c=Math.min;r({target:"String",proto:!0},{substr:function(e,t){var n,r,l=o(i(this)),f=l.length,d=a(e);return(d===1/0&&(d=0),d<0&&(d=u(f+d,0)),(n=void 0===t?f:a(t))<=0||n===1/0)?"":(r=c(d+n,f),d>=r?"":s.call(l,d,r))}})},80623(e,t,n){"use strict";var r=n(82109),i=n(14230),a=n(43429);r({target:"String",proto:!0,forced:a("sup")},{sup:function(){return i(this,"sup","","")}})},48702(e,t,n){"use strict";var r=n(82109),i=n(53111).end,a=n(76091)("trimEnd"),o=a?function(){return i(this)}:"".trimEnd;r({target:"String",proto:!0,forced:a},{trimEnd:o,trimRight:o})},55674(e,t,n){"use strict";var r=n(82109),i=n(53111).start,a=n(76091)("trimStart"),o=a?function(){return i(this)}:"".trimStart;r({target:"String",proto:!0,forced:a},{trimStart:o,trimLeft:o})},73210(e,t,n){"use strict";var r=n(82109),i=n(53111).trim,a=n(76091);r({target:"String",proto:!0,forced:a("trim")},{trim:function(){return i(this)}})},72443(e,t,n){n(97235)("asyncIterator")},41817(e,t,n){"use strict";var r=n(82109),i=n(19781),a=n(17854),o=n(86656),s=n(70111),u=n(3070).f,c=n(99920),l=a.Symbol;if(i&&"function"==typeof l&&(!("description"in l.prototype)||void 0!==l().description)){var f={},d=function(){var e=arguments.length<1||void 0===arguments[0]?void 0:String(arguments[0]),t=this instanceof d?new l(e):void 0===e?l():l(e);return""===e&&(f[t]=!0),t};c(d,l);var h=d.prototype=l.prototype;h.constructor=d;var p=h.toString,b="Symbol(test)"==String(l("test")),m=/^Symbol\((.*)\)[^)]+$/;u(h,"description",{configurable:!0,get:function(){var e=s(this)?this.valueOf():this,t=p.call(e);if(o(f,e))return"";var n=b?t.slice(7,-1):t.replace(m,"$1");return""===n?void 0:n}}),r({global:!0,forced:!0},{Symbol:d})}},92401(e,t,n){n(97235)("hasInstance")},8722(e,t,n){n(97235)("isConcatSpreadable")},32165(e,t,n){n(97235)("iterator")},82526(e,t,n){"use strict";var r=n(82109),i=n(17854),a=n(35005),o=n(31913),s=n(19781),u=n(30133),c=n(47293),l=n(86656),f=n(43157),d=n(70111),h=n(52190),p=n(19670),b=n(47908),m=n(45656),g=n(34948),v=n(41340),y=n(79114),w=n(70030),_=n(81956),E=n(8006),S=n(1156),k=n(25181),x=n(31236),T=n(3070),M=n(55296),O=n(68880),A=n(31320),L=n(72309),C=n(6200),I=n(3501),D=n(69711),N=n(5112),P=n(6061),R=n(97235),j=n(58003),F=n(29909),Y=n(42092).forEach,B=C("hidden"),U="Symbol",H="prototype",$=N("toPrimitive"),z=F.set,G=F.getterFor(U),W=Object[H],K=i.Symbol,V=a("JSON","stringify"),q=x.f,Z=T.f,X=S.f,J=M.f,Q=L("symbols"),ee=L("op-symbols"),et=L("string-to-symbol-registry"),en=L("symbol-to-string-registry"),er=L("wks"),ei=i.QObject,ea=!ei||!ei[H]||!ei[H].findChild,eo=s&&c(function(){return 7!=w(Z({},"a",{get:function(){return Z(this,"a",{value:7}).a}})).a})?function(e,t,n){var r=q(W,t);r&&delete W[t],Z(e,t,n),r&&e!==W&&Z(W,t,r)}:Z,es=function(e,t){var n=Q[e]=w(K[H]);return z(n,{type:U,tag:e,description:t}),s||(n.description=t),n},eu=function(e,t,n){e===W&&eu(ee,t,n),p(e);var r=g(t);return(p(n),l(Q,r))?(n.enumerable?(l(e,B)&&e[B][r]&&(e[B][r]=!1),n=w(n,{enumerable:y(0,!1)})):(l(e,B)||Z(e,B,y(1,{})),e[B][r]=!0),eo(e,r,n)):Z(e,r,n)},ec=function(e,t){p(e);var n=m(t),r=_(n).concat(ep(n));return Y(r,function(t){(!s||ef.call(n,t))&&eu(e,t,n[t])}),e},el=function(e,t){return void 0===t?w(e):ec(w(e),t)},ef=function(e){var t=g(e),n=J.call(this,t);return(!(this===W&&l(Q,t))||!!l(ee,t))&&(!(n||!l(this,t)||!l(Q,t)||l(this,B)&&this[B][t])||n)},ed=function(e,t){var n=m(e),r=g(t);if(!(n===W&&l(Q,r))||l(ee,r)){var i=q(n,r);return i&&l(Q,r)&&!(l(n,B)&&n[B][r])&&(i.enumerable=!0),i}},eh=function(e){var t=X(m(e)),n=[];return Y(t,function(e){l(Q,e)||l(I,e)||n.push(e)}),n},ep=function(e){var t=e===W,n=X(t?ee:m(e)),r=[];return Y(n,function(e){l(Q,e)&&(!t||l(W,e))&&r.push(Q[e])}),r};if(u||(A((K=function(){if(this instanceof K)throw TypeError("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?v(arguments[0]):void 0,t=D(e),n=function(e){this===W&&n.call(ee,e),l(this,B)&&l(this[B],t)&&(this[B][t]=!1),eo(this,t,y(1,e))};return s&&ea&&eo(W,t,{configurable:!0,set:n}),es(t,e)})[H],"toString",function(){return G(this).tag}),A(K,"withoutSetter",function(e){return es(D(e),e)}),M.f=ef,T.f=eu,x.f=ed,E.f=S.f=eh,k.f=ep,P.f=function(e){return es(N(e),e)},s&&(Z(K[H],"description",{configurable:!0,get:function(){return G(this).description}}),o||A(W,"propertyIsEnumerable",ef,{unsafe:!0}))),r({global:!0,wrap:!0,forced:!u,sham:!u},{Symbol:K}),Y(_(er),function(e){R(e)}),r({target:U,stat:!0,forced:!u},{for:function(e){var t=v(e);if(l(et,t))return et[t];var n=K(t);return et[t]=n,en[n]=t,n},keyFor:function(e){if(!h(e))throw TypeError(e+" is not a symbol");if(l(en,e))return en[e]},useSetter:function(){ea=!0},useSimple:function(){ea=!1}}),r({target:"Object",stat:!0,forced:!u,sham:!s},{create:el,defineProperty:eu,defineProperties:ec,getOwnPropertyDescriptor:ed}),r({target:"Object",stat:!0,forced:!u},{getOwnPropertyNames:eh,getOwnPropertySymbols:ep}),r({target:"Object",stat:!0,forced:c(function(){k.f(1)})},{getOwnPropertySymbols:function(e){return k.f(b(e))}}),V){var eb=!u||c(function(){var e=K();return"[null]"!=V([e])||"{}"!=V({a:e})||"{}"!=V(Object(e))});r({target:"JSON",stat:!0,forced:eb},{stringify:function(e,t,n){for(var r,i=[e],a=1;arguments.length>a;)i.push(arguments[a++]);if(r=t,!(!d(t)&&void 0===e||h(e)))return f(t)||(t=function(e,t){if("function"==typeof r&&(t=r.call(this,e,t)),!h(t))return t}),i[1]=t,V.apply(null,i)}})}K[H][$]||O(K[H],$,K[H].valueOf),j(K,U),I[B]=!0},16066(e,t,n){n(97235)("matchAll")},69007(e,t,n){n(97235)("match")},83510(e,t,n){n(97235)("replace")},41840(e,t,n){n(97235)("search")},6982(e,t,n){n(97235)("species")},32159(e,t,n){n(97235)("split")},96649(e,t,n){n(97235)("toPrimitive")},39341(e,t,n){n(97235)("toStringTag")},60543(e,t,n){n(97235)("unscopables")},48675(e,t,n){"use strict";var r=n(90260),i=n(17466),a=n(99958),o=r.aTypedArray;(0,r.exportTypedArrayMethod)("at",function(e){var t=o(this),n=i(t.length),r=a(e),s=r>=0?r:n+r;return s<0||s>=n?void 0:t[s]})},92990(e,t,n){"use strict";var r=n(90260),i=n(1048),a=r.aTypedArray;(0,r.exportTypedArrayMethod)("copyWithin",function(e,t){return i.call(a(this),e,t,arguments.length>2?arguments[2]:void 0)})},18927(e,t,n){"use strict";var r=n(90260),i=n(42092).every,a=r.aTypedArray;(0,r.exportTypedArrayMethod)("every",function(e){return i(a(this),e,arguments.length>1?arguments[1]:void 0)})},33105(e,t,n){"use strict";var r=n(90260),i=n(21285),a=r.aTypedArray;(0,r.exportTypedArrayMethod)("fill",function(e){return i.apply(a(this),arguments)})},35035(e,t,n){"use strict";var r=n(90260),i=n(42092).filter,a=n(43074),o=r.aTypedArray;(0,r.exportTypedArrayMethod)("filter",function(e){var t=i(o(this),e,arguments.length>1?arguments[1]:void 0);return a(this,t)})},7174(e,t,n){"use strict";var r=n(90260),i=n(42092).findIndex,a=r.aTypedArray;(0,r.exportTypedArrayMethod)("findIndex",function(e){return i(a(this),e,arguments.length>1?arguments[1]:void 0)})},74345(e,t,n){"use strict";var r=n(90260),i=n(42092).find,a=r.aTypedArray;(0,r.exportTypedArrayMethod)("find",function(e){return i(a(this),e,arguments.length>1?arguments[1]:void 0)})},44197(e,t,n){n(19843)("Float32",function(e){return function(t,n,r){return e(this,t,n,r)}})},76495(e,t,n){n(19843)("Float64",function(e){return function(t,n,r){return e(this,t,n,r)}})},32846(e,t,n){"use strict";var r=n(90260),i=n(42092).forEach,a=r.aTypedArray;(0,r.exportTypedArrayMethod)("forEach",function(e){i(a(this),e,arguments.length>1?arguments[1]:void 0)})},98145(e,t,n){"use strict";var r=n(63832),i=n(90260).exportTypedArrayStaticMethod,a=n(97321);i("from",a,r)},44731(e,t,n){"use strict";var r=n(90260),i=n(41318).includes,a=r.aTypedArray;(0,r.exportTypedArrayMethod)("includes",function(e){return i(a(this),e,arguments.length>1?arguments[1]:void 0)})},77209(e,t,n){"use strict";var r=n(90260),i=n(41318).indexOf,a=r.aTypedArray;(0,r.exportTypedArrayMethod)("indexOf",function(e){return i(a(this),e,arguments.length>1?arguments[1]:void 0)})},35109(e,t,n){n(19843)("Int16",function(e){return function(t,n,r){return e(this,t,n,r)}})},65125(e,t,n){n(19843)("Int32",function(e){return function(t,n,r){return e(this,t,n,r)}})},87145(e,t,n){n(19843)("Int8",function(e){return function(t,n,r){return e(this,t,n,r)}})},96319(e,t,n){"use strict";var r=n(17854),i=n(90260),a=n(66992),o=n(5112)("iterator"),s=r.Uint8Array,u=a.values,c=a.keys,l=a.entries,f=i.aTypedArray,d=i.exportTypedArrayMethod,h=s&&s.prototype[o],p=!!h&&("values"==h.name||void 0==h.name),b=function(){return u.call(f(this))};d("entries",function(){return l.call(f(this))}),d("keys",function(){return c.call(f(this))}),d("values",b,!p),d(o,b,!p)},58867(e,t,n){"use strict";var r=n(90260),i=r.aTypedArray,a=r.exportTypedArrayMethod,o=[].join;a("join",function(e){return o.apply(i(this),arguments)})},37789(e,t,n){"use strict";var r=n(90260),i=n(86583),a=r.aTypedArray;(0,r.exportTypedArrayMethod)("lastIndexOf",function(e){return i.apply(a(this),arguments)})},33739(e,t,n){"use strict";var r=n(90260),i=n(42092).map,a=n(66304),o=r.aTypedArray;(0,r.exportTypedArrayMethod)("map",function(e){return i(o(this),e,arguments.length>1?arguments[1]:void 0,function(e,t){return new(a(e))(t)})})},95206(e,t,n){"use strict";var r=n(90260),i=n(63832),a=r.aTypedArrayConstructor;(0,r.exportTypedArrayStaticMethod)("of",function(){for(var e=0,t=arguments.length,n=new(a(this))(t);t>e;)n[e]=arguments[e++];return n},i)},14483(e,t,n){"use strict";var r=n(90260),i=n(53671).right,a=r.aTypedArray;(0,r.exportTypedArrayMethod)("reduceRight",function(e){return i(a(this),e,arguments.length,arguments.length>1?arguments[1]:void 0)})},29368(e,t,n){"use strict";var r=n(90260),i=n(53671).left,a=r.aTypedArray;(0,r.exportTypedArrayMethod)("reduce",function(e){return i(a(this),e,arguments.length,arguments.length>1?arguments[1]:void 0)})},12056(e,t,n){"use strict";var r=n(90260),i=r.aTypedArray,a=r.exportTypedArrayMethod,o=Math.floor;a("reverse",function(){for(var e,t=this,n=i(t).length,r=o(n/2),a=0;a1?arguments[1]:void 0,1),n=this.length,r=o(e),s=i(r.length),c=0;if(s+t>n)throw RangeError("Wrong length");for(;ca;)c[a]=n[a++];return c},c)},27462(e,t,n){"use strict";var r=n(90260),i=n(42092).some,a=r.aTypedArray;(0,r.exportTypedArrayMethod)("some",function(e){return i(a(this),e,arguments.length>1?arguments[1]:void 0)})},33824(e,t,n){"use strict";var r=n(90260),i=n(17854),a=n(47293),o=n(13099),s=n(17466),u=n(94362),c=n(68886),l=n(30256),f=n(7392),d=n(98008),h=r.aTypedArray,p=r.exportTypedArrayMethod,b=i.Uint16Array,m=b&&b.prototype.sort,g=!!m&&!a(function(){var e=new b(2);e.sort(null),e.sort({})}),v=!!m&&!a(function(){if(f)return f<74;if(c)return c<67;if(l)return!0;if(d)return d<602;var e,t,n=new b(516),r=Array(516);for(e=0;e<516;e++)t=e%4,n[e]=515-e,r[e]=e-2*t+3;for(n.sort(function(e,t){return(e/4|0)-(t/4|0)}),e=0;e<516;e++)if(n[e]!==r[e])return!0}),y=function(e){return function(t,n){return void 0!==e?+e(t,n)||0:n!=n?-1:t!=t?1:0===t&&0===n?1/t>0&&1/n<0?1:-1:t>n}};p("sort",function(e){var t,n=this;if(void 0!==e&&o(e),v)return m.call(n,e);h(n);var r=s(n.length),i=Array(r);for(t=0;t1?arguments[1]:void 0)}}),a("filterOut")},34286(e,t,n){"use strict";var r=n(82109),i=n(42092).filterReject,a=n(51223);r({target:"Array",proto:!0},{filterReject:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),a("filterReject")},77461(e,t,n){"use strict";var r=n(82109),i=n(9671).findLastIndex,a=n(51223);r({target:"Array",proto:!0},{findLastIndex:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),a("findLastIndex")},3048(e,t,n){"use strict";var r=n(82109),i=n(9671).findLast,a=n(51223);r({target:"Array",proto:!0},{findLast:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),a("findLast")},1999(e,t,n){"use strict";var r=n(82109),i=n(61386),a=n(77475),o=n(51223);r({target:"Array",proto:!0},{groupBy:function(e){var t=arguments.length>1?arguments[1]:void 0;return i(this,e,t,a)}}),o("groupBy")},8e4(e,t,n){var r=n(82109),i=n(43157),a=Object.isFrozen,o=function(e,t){if(!a||!i(e)||!a(e))return!1;for(var n,r=0,o=e.length;r1?arguments[1]:void 0,3);return!u(n,function(e,n,i){if(!r(n,e,t))return i()},{AS_ENTRIES:!0,IS_ITERATOR:!0,INTERRUPTED:!0}).stopped}})},71957(e,t,n){"use strict";var r=n(82109),i=n(31913),a=n(35005),o=n(19670),s=n(13099),u=n(49974),c=n(36707),l=n(54647),f=n(20408);r({target:"Map",proto:!0,real:!0,forced:i},{filter:function(e){var t=o(this),n=l(t),r=u(e,arguments.length>1?arguments[1]:void 0,3),i=new(c(t,a("Map"))),d=s(i.set);return f(n,function(e,n){r(n,e,t)&&d.call(i,e,n)},{AS_ENTRIES:!0,IS_ITERATOR:!0}),i}})},103(e,t,n){"use strict";var r=n(82109),i=n(31913),a=n(19670),o=n(49974),s=n(54647),u=n(20408);r({target:"Map",proto:!0,real:!0,forced:i},{findKey:function(e){var t=a(this),n=s(t),r=o(e,arguments.length>1?arguments[1]:void 0,3);return u(n,function(e,n,i){if(r(n,e,t))return i(e)},{AS_ENTRIES:!0,IS_ITERATOR:!0,INTERRUPTED:!0}).result}})},96306(e,t,n){"use strict";var r=n(82109),i=n(31913),a=n(19670),o=n(49974),s=n(54647),u=n(20408);r({target:"Map",proto:!0,real:!0,forced:i},{find:function(e){var t=a(this),n=s(t),r=o(e,arguments.length>1?arguments[1]:void 0,3);return u(n,function(e,n,i){if(r(n,e,t))return i(n)},{AS_ENTRIES:!0,IS_ITERATOR:!0,INTERRUPTED:!0}).result}})},8582(e,t,n){var r=n(82109),i=n(27296);r({target:"Map",stat:!0},{from:i})},90618(e,t,n){"use strict";var r=n(82109),i=n(20408),a=n(13099);r({target:"Map",stat:!0},{groupBy:function(e,t){var n=new this;a(t);var r=a(n.has),o=a(n.get),s=a(n.set);return i(e,function(e){var i=t(e);r.call(n,i)?o.call(n,i).push(e):s.call(n,i,[e])}),n}})},74592(e,t,n){"use strict";var r=n(82109),i=n(31913),a=n(19670),o=n(54647),s=n(46465),u=n(20408);r({target:"Map",proto:!0,real:!0,forced:i},{includes:function(e){return u(o(a(this)),function(t,n,r){if(s(n,e))return r()},{AS_ENTRIES:!0,IS_ITERATOR:!0,INTERRUPTED:!0}).stopped}})},88440(e,t,n){"use strict";var r=n(82109),i=n(20408),a=n(13099);r({target:"Map",stat:!0},{keyBy:function(e,t){var n=new this;a(t);var r=a(n.set);return i(e,function(e){r.call(n,t(e),e)}),n}})},58276(e,t,n){"use strict";var r=n(82109),i=n(31913),a=n(19670),o=n(54647),s=n(20408);r({target:"Map",proto:!0,real:!0,forced:i},{keyOf:function(e){return s(o(a(this)),function(t,n,r){if(n===e)return r(t)},{AS_ENTRIES:!0,IS_ITERATOR:!0,INTERRUPTED:!0}).result}})},35082(e,t,n){"use strict";var r=n(82109),i=n(31913),a=n(35005),o=n(19670),s=n(13099),u=n(49974),c=n(36707),l=n(54647),f=n(20408);r({target:"Map",proto:!0,real:!0,forced:i},{mapKeys:function(e){var t=o(this),n=l(t),r=u(e,arguments.length>1?arguments[1]:void 0,3),i=new(c(t,a("Map"))),d=s(i.set);return f(n,function(e,n){d.call(i,r(n,e,t),n)},{AS_ENTRIES:!0,IS_ITERATOR:!0}),i}})},12813(e,t,n){"use strict";var r=n(82109),i=n(31913),a=n(35005),o=n(19670),s=n(13099),u=n(49974),c=n(36707),l=n(54647),f=n(20408);r({target:"Map",proto:!0,real:!0,forced:i},{mapValues:function(e){var t=o(this),n=l(t),r=u(e,arguments.length>1?arguments[1]:void 0,3),i=new(c(t,a("Map"))),d=s(i.set);return f(n,function(e,n){d.call(i,e,r(n,e,t))},{AS_ENTRIES:!0,IS_ITERATOR:!0}),i}})},18222(e,t,n){"use strict";var r=n(82109),i=n(31913),a=n(19670),o=n(13099),s=n(20408);r({target:"Map",proto:!0,real:!0,forced:i},{merge:function(e){for(var t=a(this),n=o(t.set),r=arguments.length,i=0;i1?arguments[1]:void 0,3);return u(n,function(e,n,i){if(r(n,e,t))return i()},{AS_ENTRIES:!0,IS_ITERATOR:!0,INTERRUPTED:!0}).stopped}})},74442(e,t,n){"use strict";var r=n(82109),i=n(31913),a=n(8154);r({target:"Map",proto:!0,real:!0,forced:i},{updateOrInsert:a})},7512(e,t,n){"use strict";var r=n(82109),i=n(31913),a=n(19670),o=n(13099);r({target:"Map",proto:!0,real:!0,forced:i},{update:function(e,t){var n=a(this),r=arguments.length;o(t);var i=n.has(e);if(!i&&r<3)throw TypeError("Updating absent value");var s=i?n.get(e):o(r>2?arguments[2]:void 0)(e,n);return n.set(e,t(s,e,n)),n}})},87713(e,t,n){"use strict";var r=n(82109),i=n(31913),a=n(8154);r({target:"Map",proto:!0,real:!0,forced:i},{upsert:a})},46603(e,t,n){var r=n(82109),i=Math.min,a=Math.max;r({target:"Math",stat:!0},{clamp:function(e,t,n){return i(n,a(t,e))}})},70100(e,t,n){n(82109)({target:"Math",stat:!0},{DEG_PER_RAD:Math.PI/180})},26429(e,t,n){var r=n(82109),i=180/Math.PI;r({target:"Math",stat:!0},{degrees:function(e){return e*i}})},13187(e,t,n){var r=n(82109),i=n(47103),a=n(26130);r({target:"Math",stat:!0},{fscale:function(e,t,n,r,o){return a(i(e,t,n,r,o))}})},60092(e,t,n){n(82109)({target:"Math",stat:!0},{iaddh:function(e,t,n,r){var i=e>>>0,a=n>>>0;return(t>>>0)+(r>>>0)+((i&a|(i|a)&~(i+a>>>0))>>>31)|0}})},19041(e,t,n){n(82109)({target:"Math",stat:!0},{imulh:function(e,t){var n=65535,r=+e,i=+t,a=r&n,o=i&n,s=r>>16,u=i>>16,c=(s*o>>>0)+(a*o>>>16);return s*u+(c>>16)+((a*u>>>0)+(c&n)>>16)}})},30666(e,t,n){n(82109)({target:"Math",stat:!0},{isubh:function(e,t,n,r){var i=e>>>0,a=n>>>0;return(t>>>0)-(r>>>0)-((~i&a|~(i^a)&i-a>>>0)>>>31)|0}})},51638(e,t,n){n(82109)({target:"Math",stat:!0},{RAD_PER_DEG:180/Math.PI})},62975(e,t,n){var r=n(82109),i=Math.PI/180;r({target:"Math",stat:!0},{radians:function(e){return e*i}})},15728(e,t,n){var r=n(82109),i=n(47103);r({target:"Math",stat:!0},{scale:i})},46056(e,t,n){var r=n(82109),i=n(19670),a=n(77023),o=n(24994),s=n(29909),u="Seeded Random",c=u+" Generator",l=s.set,f=s.getterFor(c),d='Math.seededPRNG() argument should have a "seed" field with a finite value.',h=o(function(e){l(this,{type:c,seed:e%2147483647})},u,function(){var e=f(this);return{value:(1073741823&(e.seed=(1103515245*e.seed+12345)%2147483647))/1073741823,done:!1}});r({target:"Math",stat:!0,forced:!0},{seededPRNG:function(e){var t=i(e).seed;if(!a(t))throw TypeError(d);return new h(t)}})},44299(e,t,n){n(82109)({target:"Math",stat:!0},{signbit:function(e){return(e=+e)==e&&0==e?1/e==-1/0:e<0}})},5162(e,t,n){n(82109)({target:"Math",stat:!0},{umulh:function(e,t){var n=65535,r=+e,i=+t,a=r&n,o=i&n,s=r>>>16,u=i>>>16,c=(s*o>>>0)+(a*o>>>16);return s*u+(c>>>16)+((a*u>>>0)+(c&n)>>>16)}})},50292(e,t,n){"use strict";var r=n(82109),i=n(99958),a=n(83009),o="Invalid number representation",s="Invalid radix",u=/^[\da-z]+$/;r({target:"Number",stat:!0},{fromString:function(e,t){var n,r,c=1;if("string"!=typeof e)throw TypeError(o);if(!e.length||"-"==e.charAt(0)&&(c=-1,!(e=e.slice(1)).length))throw SyntaxError(o);if((n=void 0===t?10:i(t))<2||n>36)throw RangeError(s);if(!u.test(e)||(r=a(e,n)).toString(n)!==e)throw SyntaxError(o);return c*r}})},29427(e,t,n){"use strict";var r=n(82109),i=n(80430);r({target:"Number",stat:!0},{range:function(e,t,n){return new i(e,t,n,"number",0,1)}})},96936(e,t,n){n(46314)},99964(e,t,n){"use strict";var r=n(82109),i=n(60996);r({target:"Object",stat:!0},{iterateEntries:function(e){return new i(e,"entries")}})},75238(e,t,n){"use strict";var r=n(82109),i=n(60996);r({target:"Object",stat:!0},{iterateKeys:function(e){return new i(e,"keys")}})},4987(e,t,n){"use strict";var r=n(82109),i=n(60996);r({target:"Object",stat:!0},{iterateValues:function(e){return new i(e,"values")}})},1025(e,t,n){"use strict";var r=n(82109),i=n(19781),a=n(96340),o=n(13099),s=n(19670),u=n(70111),c=n(25787),l=n(3070).f,f=n(68880),d=n(12248),h=n(18554),p=n(58173),b=n(20408),m=n(842),g=n(5112),v=n(29909),y=g("observable"),w=v.get,_=v.set,E=function(e){var t=e.cleanup;if(t){e.cleanup=void 0;try{t()}catch(n){m(n)}}},S=function(e){return void 0===e.observer},k=function(e){var t=e.facade;if(!i){t.closed=!0;var n=e.subscriptionObserver;n&&(n.closed=!0)}e.observer=void 0},x=function(e,t){var n,r=_(this,{cleanup:void 0,observer:s(e),subscriptionObserver:void 0});i||(this.closed=!1);try{(n=p(e.start))&&n.call(e,this)}catch(a){m(a)}if(!S(r)){var u=r.subscriptionObserver=new T(this);try{var c=t(u),l=c;null!=c&&(r.cleanup="function"==typeof c.unsubscribe?function(){l.unsubscribe()}:o(c))}catch(f){u.error(f);return}S(r)&&E(r)}};x.prototype=d({},{unsubscribe:function(){var e=w(this);S(e)||(k(e),E(e))}}),i&&l(x.prototype,"closed",{configurable:!0,get:function(){return S(w(this))}});var T=function(e){_(this,{subscription:e}),i||(this.closed=!1)};T.prototype=d({},{next:function(e){var t=w(w(this).subscription);if(!S(t)){var n=t.observer;try{var r=p(n.next);r&&r.call(n,e)}catch(i){m(i)}}},error:function(e){var t=w(w(this).subscription);if(!S(t)){var n=t.observer;k(t);try{var r=p(n.error);r?r.call(n,e):m(e)}catch(i){m(i)}E(t)}},complete:function(){var e=w(w(this).subscription);if(!S(e)){var t=e.observer;k(e);try{var n=p(t.complete);n&&n.call(t)}catch(r){m(r)}E(e)}}}),i&&l(T.prototype,"closed",{configurable:!0,get:function(){return S(w(w(this).subscription))}});var M=function(e){c(this,M,"Observable"),_(this,{subscriber:o(e)})};d(M.prototype,{subscribe:function(e){var t=arguments.length;return new x("function"==typeof e?{next:e,error:t>1?arguments[1]:void 0,complete:t>2?arguments[2]:void 0}:u(e)?e:{},w(this).subscriber)}}),d(M,{from:function(e){var t="function"==typeof this?this:M,n=p(s(e)[y]);if(n){var r=s(n.call(e));return r.constructor===t?r:new t(function(e){return r.subscribe(e)})}var i=h(e);return new t(function(e){b(i,function(t,n){if(e.next(t),e.closed)return n()},{IS_ITERATOR:!0,INTERRUPTED:!0}),e.complete()})},of:function(){for(var e="function"==typeof this?this:M,t=arguments.length,n=Array(t),r=0;r1?arguments[1]:void 0,3);return!u(n,function(e,n){if(!r(e,e,t))return n()},{IS_ITERATOR:!0,INTERRUPTED:!0}).stopped}})},64362(e,t,n){"use strict";var r=n(82109),i=n(31913),a=n(35005),o=n(19670),s=n(13099),u=n(49974),c=n(36707),l=n(96767),f=n(20408);r({target:"Set",proto:!0,real:!0,forced:i},{filter:function(e){var t=o(this),n=l(t),r=u(e,arguments.length>1?arguments[1]:void 0,3),i=new(c(t,a("Set"))),d=s(i.add);return f(n,function(e){r(e,e,t)&&d.call(i,e)},{IS_ITERATOR:!0}),i}})},15389(e,t,n){"use strict";var r=n(82109),i=n(31913),a=n(19670),o=n(49974),s=n(96767),u=n(20408);r({target:"Set",proto:!0,real:!0,forced:i},{find:function(e){var t=a(this),n=s(t),r=o(e,arguments.length>1?arguments[1]:void 0,3);return u(n,function(e,n){if(r(e,e,t))return n(e)},{IS_ITERATOR:!0,INTERRUPTED:!0}).result}})},46006(e,t,n){var r=n(82109),i=n(27296);r({target:"Set",stat:!0},{from:i})},90401(e,t,n){"use strict";var r=n(82109),i=n(31913),a=n(35005),o=n(19670),s=n(13099),u=n(36707),c=n(20408);r({target:"Set",proto:!0,real:!0,forced:i},{intersection:function(e){var t=o(this),n=new(u(t,a("Set"))),r=s(t.has),i=s(n.add);return c(e,function(e){r.call(t,e)&&i.call(n,e)}),n}})},45164(e,t,n){"use strict";var r=n(82109),i=n(31913),a=n(19670),o=n(13099),s=n(20408);r({target:"Set",proto:!0,real:!0,forced:i},{isDisjointFrom:function(e){var t=a(this),n=o(t.has);return!s(e,function(e,r){if(!0===n.call(t,e))return r()},{INTERRUPTED:!0}).stopped}})},91238(e,t,n){"use strict";var r=n(82109),i=n(31913),a=n(35005),o=n(19670),s=n(13099),u=n(18554),c=n(20408);r({target:"Set",proto:!0,real:!0,forced:i},{isSubsetOf:function(e){var t=u(this),n=o(e),r=n.has;return"function"!=typeof r&&(n=new(a("Set"))(e),r=s(n.has)),!c(t,function(e,t){if(!1===r.call(n,e))return t()},{IS_ITERATOR:!0,INTERRUPTED:!0}).stopped}})},54837(e,t,n){"use strict";var r=n(82109),i=n(31913),a=n(19670),o=n(13099),s=n(20408);r({target:"Set",proto:!0,real:!0,forced:i},{isSupersetOf:function(e){var t=a(this),n=o(t.has);return!s(e,function(e,r){if(!1===n.call(t,e))return r()},{INTERRUPTED:!0}).stopped}})},87485(e,t,n){"use strict";var r=n(82109),i=n(31913),a=n(19670),o=n(96767),s=n(20408);r({target:"Set",proto:!0,real:!0,forced:i},{join:function(e){var t=a(this),n=o(t),r=void 0===e?",":String(e),i=[];return s(n,i.push,{that:i,IS_ITERATOR:!0}),i.join(r)}})},56767(e,t,n){"use strict";var r=n(82109),i=n(31913),a=n(35005),o=n(19670),s=n(13099),u=n(49974),c=n(36707),l=n(96767),f=n(20408);r({target:"Set",proto:!0,real:!0,forced:i},{map:function(e){var t=o(this),n=l(t),r=u(e,arguments.length>1?arguments[1]:void 0,3),i=new(c(t,a("Set"))),d=s(i.add);return f(n,function(e){d.call(i,r(e,e,t))},{IS_ITERATOR:!0}),i}})},69916(e,t,n){var r=n(82109),i=n(82044);r({target:"Set",stat:!0},{of:i})},76651(e,t,n){"use strict";var r=n(82109),i=n(31913),a=n(19670),o=n(13099),s=n(96767),u=n(20408);r({target:"Set",proto:!0,real:!0,forced:i},{reduce:function(e){var t=a(this),n=s(t),r=arguments.length<2,i=r?void 0:arguments[1];if(o(e),u(n,function(n){r?(r=!1,i=n):i=e(i,n,n,t)},{IS_ITERATOR:!0}),r)throw TypeError("Reduce of empty set with no initial value");return i}})},61437(e,t,n){"use strict";var r=n(82109),i=n(31913),a=n(19670),o=n(49974),s=n(96767),u=n(20408);r({target:"Set",proto:!0,real:!0,forced:i},{some:function(e){var t=a(this),n=s(t),r=o(e,arguments.length>1?arguments[1]:void 0,3);return u(n,function(e,n){if(r(e,e,t))return n()},{IS_ITERATOR:!0,INTERRUPTED:!0}).stopped}})},35285(e,t,n){"use strict";var r=n(82109),i=n(31913),a=n(35005),o=n(19670),s=n(13099),u=n(36707),c=n(20408);r({target:"Set",proto:!0,real:!0,forced:i},{symmetricDifference:function(e){var t=o(this),n=new(u(t,a("Set")))(t),r=s(n.delete),i=s(n.add);return c(e,function(e){r.call(n,e)||i.call(n,e)}),n}})},39865(e,t,n){"use strict";var r=n(82109),i=n(31913),a=n(35005),o=n(19670),s=n(13099),u=n(36707),c=n(20408);r({target:"Set",proto:!0,real:!0,forced:i},{union:function(e){var t=o(this),n=new(u(t,a("Set")))(t);return c(e,s(n.add),{that:n}),n}})},86035(e,t,n){"use strict";var r=n(82109),i=n(28710).charAt,a=n(47293)(function(){return"𠮷"!=="𠮷".at(0)});r({target:"String",proto:!0,forced:a},{at:function(e){return i(this,e)}})},67501(e,t,n){"use strict";var r=n(82109),i=n(24994),a=n(84488),o=n(41340),s=n(29909),u=n(28710),c=u.codeAt,l=u.charAt,f="String Iterator",d=s.set,h=s.getterFor(f),p=i(function(e){d(this,{type:f,string:e,index:0})},"String",function(){var e,t=h(this),n=t.string,r=t.index;return r>=n.length?{value:void 0,done:!0}:(e=l(n,r),t.index+=e.length,{value:{codePoint:c(e,0),position:r},done:!1})});r({target:"String",proto:!0},{codePoints:function(){return new p(o(a(this)))}})},13728(e,t,n){n(76373)},27207(e,t,n){n(68757)},609(e,t,n){n(97235)("asyncDispose")},21568(e,t,n){n(97235)("dispose")},54534(e,t,n){n(97235)("matcher")},95090(e,t,n){n(97235)("metadata")},48824(e,t,n){n(97235)("observable")},44130(e,t,n){n(97235)("patternMatch")},35954(e,t,n){n(97235)("replaceAll")},38012(e,t,n){n(48675)},26182(e,t,n){"use strict";var r=n(90260),i=n(42092).filterReject,a=n(43074),o=r.aTypedArray;(0,r.exportTypedArrayMethod)("filterOut",function(e){var t=i(o(this),e,arguments.length>1?arguments[1]:void 0);return a(this,t)})},8922(e,t,n){"use strict";var r=n(90260),i=n(42092).filterReject,a=n(43074),o=r.aTypedArray;(0,r.exportTypedArrayMethod)("filterReject",function(e){var t=i(o(this),e,arguments.length>1?arguments[1]:void 0);return a(this,t)})},1118(e,t,n){"use strict";var r=n(90260),i=n(9671).findLastIndex,a=r.aTypedArray;(0,r.exportTypedArrayMethod)("findLastIndex",function(e){return i(a(this),e,arguments.length>1?arguments[1]:void 0)})},37380(e,t,n){"use strict";var r=n(90260),i=n(9671).findLast,a=r.aTypedArray;(0,r.exportTypedArrayMethod)("findLast",function(e){return i(a(this),e,arguments.length>1?arguments[1]:void 0)})},5835(e,t,n){"use strict";var r=n(90260),i=n(61386),a=n(66304),o=r.aTypedArray;(0,r.exportTypedArrayMethod)("groupBy",function(e){var t=arguments.length>1?arguments[1]:void 0;return i(o(this),e,t,a)})},84444(e,t,n){"use strict";var r=n(90260),i=n(60956),a=n(43074),o=r.aTypedArray;(0,r.exportTypedArrayMethod)("uniqueBy",function(e){return a(this,i.call(o(this),e))})},78206(e,t,n){"use strict";var r=n(82109),i=n(31913),a=n(34092);r({target:"WeakMap",proto:!0,real:!0,forced:i},{deleteAll:function(){return a.apply(this,arguments)}})},12714(e,t,n){"use strict";var r=n(82109),i=n(31913),a=n(37502);r({target:"WeakMap",proto:!0,real:!0,forced:i},{emplace:a})},76478(e,t,n){var r=n(82109),i=n(27296);r({target:"WeakMap",stat:!0},{from:i})},79715(e,t,n){var r=n(82109),i=n(82044);r({target:"WeakMap",stat:!0},{of:i})},5964(e,t,n){"use strict";var r=n(82109),i=n(31913),a=n(8154);r({target:"WeakMap",proto:!0,real:!0,forced:i},{upsert:a})},43561(e,t,n){"use strict";var r=n(82109),i=n(31913),a=n(31501);r({target:"WeakSet",proto:!0,real:!0,forced:i},{addAll:function(){return a.apply(this,arguments)}})},32049(e,t,n){"use strict";var r=n(82109),i=n(31913),a=n(34092);r({target:"WeakSet",proto:!0,real:!0,forced:i},{deleteAll:function(){return a.apply(this,arguments)}})},86020(e,t,n){var r=n(82109),i=n(27296);r({target:"WeakSet",stat:!0},{from:i})},56585(e,t,n){var r=n(82109),i=n(82044);r({target:"WeakSet",stat:!0},{of:i})},54747(e,t,n){var r=n(17854),i=n(48324),a=n(18533),o=n(68880);for(var s in i){var u=r[s],c=u&&u.prototype;if(c&&c.forEach!==a)try{o(c,"forEach",a)}catch(l){c.forEach=a}}},33948(e,t,n){var r=n(17854),i=n(48324),a=n(66992),o=n(68880),s=n(5112),u=s("iterator"),c=s("toStringTag"),l=a.values;for(var f in i){var d=r[f],h=d&&d.prototype;if(h){if(h[u]!==l)try{o(h,u,l)}catch(p){h[u]=l}if(h[c]||o(h,c,f),i[f]){for(var b in a)if(h[b]!==a[b])try{o(h,b,a[b])}catch(m){h[b]=a[b]}}}}},84633(e,t,n){var r=n(82109),i=n(17854),a=n(20261);r({global:!0,bind:!0,enumerable:!0,forced:!i.setImmediate||!i.clearImmediate},{setImmediate:a.set,clearImmediate:a.clear})},85844(e,t,n){var r=n(82109),i=n(17854),a=n(95948),o=n(35268),s=i.process;r({global:!0,enumerable:!0,noTargetGet:!0},{queueMicrotask:function(e){var t=o&&s.domain;a(t?t.bind(e):e)}})},32564(e,t,n){var r=n(82109),i=n(17854),a=n(88113),o=[].slice,s=/MSIE .\./.test(a),u=function(e){return function(t,n){var r=arguments.length>2,i=r?o.call(arguments,2):void 0;return e(r?function(){("function"==typeof t?t:Function(t)).apply(this,i)}:t,n)}};r({global:!0,bind:!0,forced:s},{setTimeout:u(i.setTimeout),setInterval:u(i.setInterval)})},41637(e,t,n){"use strict";n(66992);var r=n(82109),i=n(35005),a=n(590),o=n(31320),s=n(12248),u=n(58003),c=n(24994),l=n(29909),f=n(25787),d=n(86656),h=n(49974),p=n(70648),b=n(19670),m=n(70111),g=n(41340),v=n(70030),y=n(79114),w=n(18554),_=n(71246),E=n(5112),S=i("fetch"),k=i("Request"),x=k&&k.prototype,T=i("Headers"),M=E("iterator"),O="URLSearchParams",A=O+"Iterator",L=l.set,C=l.getterFor(O),I=l.getterFor(A),D=/\+/g,N=[,,,,],P=function(e){return N[e-1]||(N[e-1]=RegExp("((?:%[\\da-f]{2}){"+e+"})","gi"))},R=function(e){try{return decodeURIComponent(e)}catch(t){return e}},j=function(e){var t=e.replace(D," "),n=4;try{return decodeURIComponent(t)}catch(r){for(;n;)t=t.replace(P(n--),R);return t}},F=/[!'()~]|%20/g,Y={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},B=function(e){return Y[e]},U=function(e){return encodeURIComponent(e).replace(F,B)},H=function(e,t){if(t)for(var n,r,i=t.split("&"),a=0;a0?arguments[0]:void 0,l=this,h=[];if(L(l,{type:O,entries:h,updateURL:function(){},updateSearchParams:$}),void 0!==c){if(m(c)){if("function"==typeof(e=_(c)))for(n=(t=w(c,e)).next;!(r=n.call(t)).done;){if((o=(a=(i=w(b(r.value))).next).call(i)).done||(s=a.call(i)).done||!a.call(i).done)throw TypeError("Expected sequence with length 2");h.push({key:g(o.value),value:g(s.value)})}else for(u in c)d(c,u)&&h.push({key:u,value:g(c[u])})}else H(h,"string"==typeof c?"?"===c.charAt(0)?c.slice(1):c:g(c))}},K=W.prototype;if(s(K,{append:function(e,t){z(arguments.length,2);var n=C(this);n.entries.push({key:g(e),value:g(t)}),n.updateURL()},delete:function(e){z(arguments.length,1);for(var t=C(this),n=t.entries,r=g(e),i=0;ie.key){i.splice(t,0,e);break}t===n&&i.push(e)}r.updateURL()},forEach:function(e){for(var t,n=C(this).entries,r=h(e,arguments.length>1?arguments[1]:void 0,3),i=0;i1?V(arguments[1]):{})}}),"function"==typeof k){var q=function(e){return f(this,q,"Request"),new k(e,arguments.length>1?V(arguments[1]):{})};x.constructor=q,q.prototype=x,r({global:!0,forced:!0},{Request:q})}}e.exports={URLSearchParams:W,getState:C}},60285(e,t,n){"use strict";n(78783);var r,i=n(82109),a=n(19781),o=n(590),s=n(17854),u=n(36048),c=n(31320),l=n(25787),f=n(86656),d=n(21574),h=n(48457),p=n(28710).codeAt,b=n(33197),m=n(41340),g=n(58003),v=n(41637),y=n(29909),w=s.URL,_=v.URLSearchParams,E=v.getState,S=y.set,k=y.getterFor("URL"),x=Math.floor,T=Math.pow,M="Invalid authority",O="Invalid scheme",A="Invalid host",L="Invalid port",C=/[A-Za-z]/,I=/[\d+-.A-Za-z]/,D=/\d/,N=/^0x/i,P=/^[0-7]+$/,R=/^\d+$/,j=/^[\dA-Fa-f]+$/,F=/[\0\t\n\r #%/:<>?@[\\\]^|]/,Y=/[\0\t\n\r #/:<>?@[\\\]^|]/,B=/^[\u0000-\u0020]+|[\u0000-\u0020]+$/g,U=/[\t\n\r]/g,H=function(e,t){var n,r,i;if("["==t.charAt(0)){if("]"!=t.charAt(t.length-1)||!(n=z(t.slice(1,-1))))return A;e.host=n}else if(Q(e)){if(t=b(t),F.test(t)||null===(n=$(t)))return A;e.host=n}else{if(Y.test(t))return A;for(i=0,n="",r=h(t);i4)return e;for(r=0,n=[];r1&&"0"==i.charAt(0)&&(a=N.test(i)?16:8,i=i.slice(8==a?1:2)),""===i)o=0;else{if(!(10==a?R:8==a?P:j).test(i))return e;o=parseInt(i,a)}n.push(o)}for(r=0;r=T(256,5-t))return null}else if(o>255)return null;for(r=0,s=n.pop();r6))return;for(r=0;d();){if(i=null,r>0){if("."!=d()||!(r<4))return;f++}if(!D.test(d()))return;for(;D.test(d());){if(a=parseInt(d(),10),null===i)i=a;else{if(0==i)return;i=10*i+a}if(i>255)return;f++}u[c]=256*u[c]+i,(2==++r||4==r)&&c++}if(4!=r)return;break}if(":"==d()){if(f++,!d())return}else if(d())return;u[c++]=t}if(null!==l)for(o=c-l,c=7;0!=c&&o>0;)s=u[c],u[c--]=u[l+o-1],u[l+--o]=s;else if(8!=c)return;return u},G=function(e){for(var t=null,n=1,r=null,i=0,a=0;a<8;a++)0!==e[a]?(i>n&&(t=r,n=i),r=null,i=0):(null===r&&(r=a),++i);return i>n&&(t=r,n=i),t},W=function(e){var t,n,r,i;if("number"==typeof e){for(n=0,t=[];n<4;n++)t.unshift(e%256),e=x(e/256);return t.join(".")}if("object"==typeof e){for(n=0,t="",r=G(e);n<8;n++)(!i||0!==e[n])&&(i&&(i=!1),r===n?(t+=n?":":"::",i=!0):(t+=e[n].toString(16),n<7&&(t+=":")));return"["+t+"]"}return e},K={},V=d({},K,{" ":1,'"':1,"<":1,">":1,"`":1}),q=d({},V,{"#":1,"?":1,"{":1,"}":1}),Z=d({},q,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),X=function(e,t){var n=p(e,0);return n>32&&n<127&&!f(t,e)?e:encodeURIComponent(e)},J={ftp:21,file:null,http:80,https:443,ws:80,wss:443},Q=function(e){return f(J,e.scheme)},ee=function(e){return""!=e.username||""!=e.password},et=function(e){return!e.host||e.cannotBeABaseURL||"file"==e.scheme},en=function(e,t){var n;return 2==e.length&&C.test(e.charAt(0))&&(":"==(n=e.charAt(1))||!t&&"|"==n)},er=function(e){var t;return e.length>1&&en(e.slice(0,2))&&(2==e.length||"/"===(t=e.charAt(2))||"\\"===t||"?"===t||"#"===t)},ei=function(e){var t=e.path,n=t.length;n&&("file"!=e.scheme||1!=n||!en(t[0],!0))&&t.pop()},ea=function(e){return"."===e||"%2e"===e.toLowerCase()},eo=function(e){return".."===(e=e.toLowerCase())||"%2e."===e||".%2e"===e||"%2e%2e"===e},es={},eu={},ec={},el={},ef={},ed={},eh={},ep={},eb={},em={},eg={},ev={},ey={},ew={},e_={},eE={},eS={},ek={},ex={},eT={},eM={},eO=function(e,t,n,i){var a,o,s,u,c=n||es,l=0,d="",p=!1,b=!1,m=!1;for(n||(e.scheme="",e.username="",e.password="",e.host=null,e.port=null,e.path=[],e.query=null,e.fragment=null,e.cannotBeABaseURL=!1,t=t.replace(B,"")),t=t.replace(U,""),a=h(t);l<=a.length;){switch(o=a[l],c){case es:if(o&&C.test(o))d+=o.toLowerCase(),c=eu;else{if(n)return O;c=ec;continue}break;case eu:if(o&&(I.test(o)||"+"==o||"-"==o||"."==o))d+=o.toLowerCase();else if(":"==o){if(n&&(Q(e)!=f(J,d)||"file"==d&&(ee(e)||null!==e.port)||"file"==e.scheme&&!e.host))return;if(e.scheme=d,n){Q(e)&&J[e.scheme]==e.port&&(e.port=null);return}d="","file"==e.scheme?c=ew:Q(e)&&i&&i.scheme==e.scheme?c=el:Q(e)?c=ep:"/"==a[l+1]?(c=ef,l++):(e.cannotBeABaseURL=!0,e.path.push(""),c=ex)}else{if(n)return O;d="",c=ec,l=0;continue}break;case ec:if(!i||i.cannotBeABaseURL&&"#"!=o)return O;if(i.cannotBeABaseURL&&"#"==o){e.scheme=i.scheme,e.path=i.path.slice(),e.query=i.query,e.fragment="",e.cannotBeABaseURL=!0,c=eM;break}c="file"==i.scheme?ew:ed;continue;case el:if("/"==o&&"/"==a[l+1])c=eb,l++;else{c=ed;continue}break;case ef:if("/"==o){c=em;break}c=ek;continue;case ed:if(e.scheme=i.scheme,o==r)e.username=i.username,e.password=i.password,e.host=i.host,e.port=i.port,e.path=i.path.slice(),e.query=i.query;else if("/"==o||"\\"==o&&Q(e))c=eh;else if("?"==o)e.username=i.username,e.password=i.password,e.host=i.host,e.port=i.port,e.path=i.path.slice(),e.query="",c=eT;else if("#"==o)e.username=i.username,e.password=i.password,e.host=i.host,e.port=i.port,e.path=i.path.slice(),e.query=i.query,e.fragment="",c=eM;else{e.username=i.username,e.password=i.password,e.host=i.host,e.port=i.port,e.path=i.path.slice(),e.path.pop(),c=ek;continue}break;case eh:if(Q(e)&&("/"==o||"\\"==o))c=eb;else if("/"==o)c=em;else{e.username=i.username,e.password=i.password,e.host=i.host,e.port=i.port,c=ek;continue}break;case ep:if(c=eb,"/"!=o||"/"!=d.charAt(l+1))continue;l++;break;case eb:if("/"!=o&&"\\"!=o){c=em;continue}break;case em:if("@"==o){p&&(d="%40"+d),p=!0,s=h(d);for(var g=0;g65535)return L;e.port=Q(e)&&w===J[e.scheme]?null:w,d=""}if(n)return;c=eS;continue}break;case ew:if(e.scheme="file","/"==o||"\\"==o)c=e_;else if(i&&"file"==i.scheme){if(o==r)e.host=i.host,e.path=i.path.slice(),e.query=i.query;else if("?"==o)e.host=i.host,e.path=i.path.slice(),e.query="",c=eT;else if("#"==o)e.host=i.host,e.path=i.path.slice(),e.query=i.query,e.fragment="",c=eM;else{er(a.slice(l).join(""))||(e.host=i.host,e.path=i.path.slice(),ei(e)),c=ek;continue}}else{c=ek;continue}break;case e_:if("/"==o||"\\"==o){c=eE;break}i&&"file"==i.scheme&&!er(a.slice(l).join(""))&&(en(i.path[0],!0)?e.path.push(i.path[0]):e.host=i.host),c=ek;continue;case eE:if(o==r||"/"==o||"\\"==o||"?"==o||"#"==o){if(!n&&en(d))c=ek;else if(""==d){if(e.host="",n)return;c=eS}else{if(u=H(e,d))return u;if("localhost"==e.host&&(e.host=""),n)return;d="",c=eS}continue}d+=o;break;case eS:if(Q(e)){if(c=ek,"/"!=o&&"\\"!=o)continue}else if(n||"?"!=o){if(n||"#"!=o){if(o!=r&&(c=ek,"/"!=o))continue}else e.fragment="",c=eM}else e.query="",c=eT;break;case ek:if(o==r||"/"==o||"\\"==o&&Q(e)||!n&&("?"==o||"#"==o)){if(eo(d)?(ei(e),"/"==o||"\\"==o&&Q(e)||e.path.push("")):ea(d)?"/"==o||"\\"==o&&Q(e)||e.path.push(""):("file"==e.scheme&&!e.path.length&&en(d)&&(e.host&&(e.host=""),d=d.charAt(0)+":"),e.path.push(d)),d="","file"==e.scheme&&(o==r||"?"==o||"#"==o))for(;e.path.length>1&&""===e.path[0];)e.path.shift();"?"==o?(e.query="",c=eT):"#"==o&&(e.fragment="",c=eM)}else d+=X(o,q);break;case ex:"?"==o?(e.query="",c=eT):"#"==o?(e.fragment="",c=eM):o!=r&&(e.path[0]+=X(o,K));break;case eT:n||"#"!=o?o!=r&&("'"==o&&Q(e)?e.query+="%27":"#"==o?e.query+="%23":e.query+=X(o,K)):(e.fragment="",c=eM);break;case eM:o!=r&&(e.fragment+=X(o,V))}l++}},eA=function(e){var t,n,r=l(this,eA,"URL"),i=arguments.length>1?arguments[1]:void 0,o=m(e),s=S(r,{type:"URL"});if(void 0!==i){if(i instanceof eA)t=k(i);else if(n=eO(t={},m(i)))throw TypeError(n)}if(n=eO(s,o,null,t))throw TypeError(n);var u=s.searchParams=new _,c=E(u);c.updateSearchParams(s.query),c.updateURL=function(){s.query=String(u)||null},a||(r.href=eC.call(r),r.origin=eI.call(r),r.protocol=eD.call(r),r.username=eN.call(r),r.password=eP.call(r),r.host=eR.call(r),r.hostname=ej.call(r),r.port=eF.call(r),r.pathname=eY.call(r),r.search=eB.call(r),r.searchParams=eU.call(r),r.hash=eH.call(r))},eL=eA.prototype,eC=function(){var e=k(this),t=e.scheme,n=e.username,r=e.password,i=e.host,a=e.port,o=e.path,s=e.query,u=e.fragment,c=t+":";return null!==i?(c+="//",ee(e)&&(c+=n+(r?":"+r:"")+"@"),c+=W(i),null!==a&&(c+=":"+a)):"file"==t&&(c+="//"),c+=e.cannotBeABaseURL?o[0]:o.length?"/"+o.join("/"):"",null!==s&&(c+="?"+s),null!==u&&(c+="#"+u),c},eI=function(){var e=k(this),t=e.scheme,n=e.port;if("blob"==t)try{return new eA(t.path[0]).origin}catch(r){return"null"}return"file"!=t&&Q(e)?t+"://"+W(e.host)+(null!==n?":"+n:""):"null"},eD=function(){return k(this).scheme+":"},eN=function(){return k(this).username},eP=function(){return k(this).password},eR=function(){var e=k(this),t=e.host,n=e.port;return null===t?"":null===n?W(t):W(t)+":"+n},ej=function(){var e=k(this).host;return null===e?"":W(e)},eF=function(){var e=k(this).port;return null===e?"":String(e)},eY=function(){var e=k(this),t=e.path;return e.cannotBeABaseURL?t[0]:t.length?"/"+t.join("/"):""},eB=function(){var e=k(this).query;return e?"?"+e:""},eU=function(){return k(this).searchParams},eH=function(){var e=k(this).fragment;return e?"#"+e:""},e$=function(e,t){return{get:e,set:t,configurable:!0,enumerable:!0}};if(a&&u(eL,{href:e$(eC,function(e){var t=k(this),n=m(e),r=eO(t,n);if(r)throw TypeError(r);E(t.searchParams).updateSearchParams(t.query)}),origin:e$(eI),protocol:e$(eD,function(e){var t=k(this);eO(t,m(e)+":",es)}),username:e$(eN,function(e){var t=k(this),n=h(m(e));if(!et(t)){t.username="";for(var r=0;rc});var r={value:function(){}};function i(){for(var e,t=0,n=arguments.length,r={};t=0&&(n=e.slice(r+1),e=e.slice(0,r)),e&&!t.hasOwnProperty(e))throw Error("unknown type: "+e);return{type:e,name:n}})}function s(e,t){for(var n,r=0,i=e.length;r0)for(var n,r,i=Array(n),a=0;am,dragDisable:()=>u.Z,dragEnable:()=>u.D});var r=n(92626),i=n(25109),a=n(43095),o=n(94017),s=n(24793),u=n(44266),c=n(34299);function l(e){return function(){return e}}function f(e,t,n,r,i,a,o,s,u,c){this.target=e,this.type=t,this.subject=n,this.identifier=r,this.active=i,this.x=a,this.y=o,this.dx=s,this.dy=u,this._=c}function d(){return!i.B.ctrlKey&&!i.B.button}function h(){return this.parentNode}function p(e){return null==e?{x:i.B.x,y:i.B.y}:e}function b(){return navigator.maxTouchPoints||"ontouchstart"in this}function m(){var e,t,n,m,g=d,v=h,y=p,w=b,_={},E=(0,r.Z)("start","drag","end"),S=0,k=0;function x(e){e.on("mousedown.drag",T).filter(w).on("touchstart.drag",A).on("touchmove.drag",L).on("touchend.drag touchcancel.drag",C).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function T(){if(!m&&g.apply(this,arguments)){var r=I("mouse",v.apply(this,arguments),a.Z,this,arguments);r&&((0,o.Z)(i.B.view).on("mousemove.drag",M,!0).on("mouseup.drag",O,!0),(0,u.Z)(i.B.view),(0,c.r)(),n=!1,e=i.B.clientX,t=i.B.clientY,r("start"))}}function M(){if((0,c.Z)(),!n){var r=i.B.clientX-e,a=i.B.clientY-t;n=r*r+a*a>k}_.mouse("drag")}function O(){(0,o.Z)(i.B.view).on("mousemove.drag mouseup.drag",null),(0,u.D)(i.B.view,n),(0,c.Z)(),_.mouse("end")}function A(){if(g.apply(this,arguments)){var e,t,n=i.B.changedTouches,r=v.apply(this,arguments),a=n.length;for(e=0;eo,Z:()=>a});var r=n(94017),i=n(34299);function a(e){var t=e.document.documentElement,n=(0,r.Z)(e).on("dragstart.drag",i.Z,!0);"onselectstart"in t?n.on("selectstart.drag",i.Z,!0):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function o(e,t){var n=e.document.documentElement,a=(0,r.Z)(e).on("dragstart.drag",null);t&&(a.on("click.drag",i.Z,!0),setTimeout(function(){a.on("click.drag",null)},0)),"onselectstart"in n?a.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}},34299(e,t,n){"use strict";n.d(t,{Z:()=>a,r:()=>i});var r=n(25109);function i(){r.B.stopImmediatePropagation()}function a(){r.B.preventDefault(),r.B.stopImmediatePropagation()}},9893(e,t,n){"use strict";function r(e,t){var n;function r(){var r,i,a=n.length,o=0,s=0;for(r=0;r=(a=(b+g)/2))?b=a:g=a,(l=n>=(o=(m+v)/2))?m=o:v=o,i=h,!(h=h[f=l<<1|c]))return i[f]=p,e;if(s=+e._x.call(null,h.data),u=+e._y.call(null,h.data),t===s&&n===u)return p.next=h,i?i[f]=p:e._root=p,e;do i=i?i[f]=[,,,,]:e._root=[,,,,],(c=t>=(a=(b+g)/2))?b=a:g=a,(l=n>=(o=(m+v)/2))?m=o:v=o;while((f=l<<1|c)==(d=(u>=o)<<1|s>=a))return i[d]=h,i[f]=p,e}function u(e){var t,n,r,i,a=e.length,o=Array(a),u=Array(a),c=1/0,l=1/0,f=-1/0,d=-1/0;for(n=0;nf&&(f=r),id&&(d=i));if(c>f||l>d)return this;for(this.cover(c,l).cover(f,d),n=0;ne||e>=i||r>t||t>=a;)switch(s=(th)&&!((a=u.y0)>p)&&!((o=u.x1)=v)<<1|e>=g)&&(u=b[b.length-1],b[b.length-1]=b[b.length-1-c],b[b.length-1-c]=u)}else{var y=e-+this._x.call(null,m.data),w=t-+this._y.call(null,m.data),_=y*y+w*w;if(_=(s=(p+m)/2))?p=s:m=s,(l=o>=(u=(b+g)/2))?b=u:g=u,t=h,!(h=h[f=l<<1|c]))return this;if(!h.length)break;(t[f+1&3]||t[f+2&3]||t[f+3&3])&&(n=t,d=f)}for(;h.data!==e;)if(r=h,!(h=h.next))return this;return((i=h.next)&&delete h.next,r)?(i?r.next=i:delete r.next,this):t?(i?t[f]=i:delete t[f],(h=t[0]||t[1]||t[2]||t[3])&&h===(t[3]||t[2]||t[1]||t[0])&&!h.length&&(n?n[d]=h:this._root=h),this):(this._root=i,this)}function b(e){for(var t=0,n=e.length;tr,forceCollide:()=>L,forceLink:()=>B,forceManyBody:()=>V,forceRadial:()=>q,forceSimulation:()=>K,forceX:()=>Z,forceY:()=>X});var M=k.prototype=x.prototype;function O(e){return e.x+e.vx}function A(e){return e.y+e.vy}function L(e){var t,n,r=1,o=1;function s(){for(var e,i,s,c,l,f,d,h=t.length,p=0;ps.index){var b=c-u.x-u.vx,m=l-u.y-u.vy,g=b*b+m*m;gc+p||il+p||oe.r&&(e.r=e[t].r)}function c(){if(t){var r,i,a=t.length;for(r=0,n=Array(a);r1?(null==n?s.remove(e):s.set(e,h(n)),t):s.get(e)},find:function(t,n,r){var i,a,o,s,u,c=0,l=e.length;for(null==r?r=1/0:r*=r,c=0;c1?(c.on(e,n),t):c.on(e)}}}function V(){var e,t,n,r,o=i(-30),s=1,u=1/0,c=.81;function l(r){var i,a=e.length,o=k(e,$,z).visitAfter(d);for(n=r,i=0;i=u)){(e.data!==t||e.next)&&(0===f&&(p+=(f=a())*f),0===d&&(p+=(d=a())*d),ps});var r=n(73888),i=n(31986);function a(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===i.P&&t.documentElement.namespaceURI===i.P?t.createElement(e):t.createElementNS(n,e)}}function o(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function s(e){var t=(0,r.Z)(e);return(t.local?o:a)(t)}},58556(e,t,n){"use strict";n.r(t),n.d(t,{clientPoint:()=>h.Z,create:()=>a,creator:()=>r.Z,customEvent:()=>S._H,event:()=>S.B,local:()=>s,matcher:()=>c.Z,mouse:()=>l.Z,namespace:()=>f.Z,namespaces:()=>d.Z,select:()=>i.Z,selectAll:()=>b,selection:()=>p.ZP,selector:()=>m.Z,selectorAll:()=>g.Z,style:()=>v.S,touch:()=>y.Z,touches:()=>_,window:()=>E.Z});var r=n(789),i=n(94017);function a(e){return(0,i.Z)((0,r.Z)(e).call(document.documentElement))}var o=0;function s(){return new u}function u(){this._="@"+(++o).toString(36)}u.prototype=s.prototype={constructor:u,get:function(e){for(var t=this._;!(t in e);)if(!(e=e.parentNode))return;return e[t]},set:function(e,t){return e[this._]=t},remove:function(e){return this._ in e&&delete e[this._]},toString:function(){return this._}};var c=n(3083),l=n(43095),f=n(73888),d=n(31986),h=n(42115),p=n(23817);function b(e){return"string"==typeof e?new p.Y1([document.querySelectorAll(e)],[document.documentElement]):new p.Y1([null==e?[]:e],p.Jz)}var m=n(82634),g=n(3545),v=n(49986),y=n(24793),w=n(45553);function _(e,t){null==t&&(t=(0,w.Z)().touches);for(var n=0,r=t?t.length:0,i=Array(r);nr})},43095(e,t,n){"use strict";n.d(t,{Z:()=>a});var r=n(45553),i=n(42115);function a(e){var t=(0,r.Z)();return t.changedTouches&&(t=t.changedTouches[0]),(0,i.Z)(e,t)}},73888(e,t,n){"use strict";n.d(t,{Z:()=>i});var r=n(31986);function i(e){var t=e+="",n=t.indexOf(":");return n>=0&&"xmlns"!==(t=e.slice(0,n))&&(e=e.slice(n+1)),r.Z.hasOwnProperty(t)?{space:r.Z[t],local:e}:e}},31986(e,t,n){"use strict";n.d(t,{P:()=>r,Z:()=>i});var r="http://www.w3.org/1999/xhtml";let i={svg:"http://www.w3.org/2000/svg",xhtml:r,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"}},42115(e,t,n){"use strict";function r(e,t){var n=e.ownerSVGElement||e;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=t.clientX,r.y=t.clientY,[(r=r.matrixTransform(e.getScreenCTM().inverse())).x,r.y]}var i=e.getBoundingClientRect();return[t.clientX-i.left-e.clientLeft,t.clientY-i.top-e.clientTop]}n.d(t,{Z:()=>r})},94017(e,t,n){"use strict";n.d(t,{Z:()=>i});var r=n(23817);function i(e){return"string"==typeof e?new r.Y1([[document.querySelector(e)]],[document.documentElement]):new r.Y1([[e]],r.Jz)}},23817(e,t,n){"use strict";n.d(t,{Y1:()=>eT,ZP:()=>eO,Jz:()=>ex});var r=n(82634);function i(e){"function"!=typeof e&&(e=(0,r.Z)(e));for(var t=this._groups,n=t.length,i=Array(n),a=0;a=k&&(k=S+1);!(E=y[k])&&++k=0;)(r=i[a])&&(o&&4^r.compareDocumentPosition(o)&&o.parentNode.insertBefore(r,o),o=r);return this}function _(e){function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}e||(e=E);for(var n=this._groups,r=n.length,i=Array(r),a=0;at?1:e>=t?0:NaN}function S(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function k(){var e=Array(this.size()),t=-1;return this.each(function(){e[++t]=this}),e}function x(){for(var e=this._groups,t=0,n=e.length;t1?this.each((null==t?F:"function"==typeof t?B:Y)(e,t)):this.node()[e]}function H(e){return e.trim().split(/^|\s+/)}function $(e){return e.classList||new z(e)}function z(e){this._node=e,this._names=H(e.getAttribute("class")||"")}function G(e,t){for(var n=$(e),r=-1,i=t.length;++rthis._names.indexOf(e)&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};var ec=n(789);function el(e){var t="function"==typeof e?e:(0,ec.Z)(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function ef(){return null}function ed(e,t){var n="function"==typeof e?e:(0,ec.Z)(e),i=null==t?ef:"function"==typeof t?t:(0,r.Z)(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),i.apply(this,arguments)||null)})}function eh(){var e=this.parentNode;e&&e.removeChild(this)}function ep(){return this.each(eh)}function eb(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function em(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function eg(e){return this.select(e?em:eb)}function ev(e){return arguments.length?this.property("__data__",e):this.node().__data__}var ey=n(25109),ew=n(85021);function e_(e,t,n){var r=(0,ew.Z)(e),i=r.CustomEvent;"function"==typeof i?i=new i(t,n):(i=r.document.createEvent("Event"),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function eE(e,t){return function(){return e_(this,e,t)}}function eS(e,t){return function(){return e_(this,e,t.apply(this,arguments))}}function ek(e,t){return this.each(("function"==typeof t?eS:eE)(e,t))}var ex=[null];function eT(e,t){this._groups=e,this._parents=t}function eM(){return new eT([[document.documentElement]],ex)}eT.prototype=eM.prototype={constructor:eT,select:i,selectAll:o,filter:u,data:m,enter:l,exit:g,join:v,merge:y,order:w,sort:_,call:S,nodes:k,node:x,size:T,empty:M,each:O,attr:R,style:j.Z,property:U,classed:Z,text:ee,html:ei,raise:eo,lower:eu,append:el,insert:ed,remove:ep,clone:eg,datum:ev,on:ey.ZP,dispatch:ek};let eO=eM},25109(e,t,n){"use strict";n.d(t,{B:()=>i,ZP:()=>l,_H:()=>f});var r={},i=null;function a(e,t,n){return e=o(e,t,n),function(t){var n=t.relatedTarget;n&&(n===this||8&n.compareDocumentPosition(this))||e.call(this,t)}}function o(e,t,n){return function(r){var a=i;i=r;try{e.call(this,this.__data__,t,n)}finally{i=a}}}function s(e){return e.trim().split(/^|\s+/).map(function(e){var t="",n=e.indexOf(".");return n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}})}function u(e){return function(){var t=this.__on;if(t){for(var n,r=0,i=-1,a=t.length;ru,Z:()=>s});var r=n(85021);function i(e){return function(){this.style.removeProperty(e)}}function a(e,t,n){return function(){this.style.setProperty(e,t,n)}}function o(e,t,n){return function(){var r=t.apply(this,arguments);null==r?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function s(e,t,n){return arguments.length>1?this.each((null==t?i:"function"==typeof t?o:a)(e,t,null==n?"":n)):u(this.node(),e)}function u(e,t){return e.style.getPropertyValue(t)||(0,r.Z)(e).getComputedStyle(e,null).getPropertyValue(t)}},82634(e,t,n){"use strict";function r(){}function i(e){return null==e?r:function(){return this.querySelector(e)}}n.d(t,{Z:()=>i})},3545(e,t,n){"use strict";function r(){return[]}function i(e){return null==e?r:function(){return this.querySelectorAll(e)}}n.d(t,{Z:()=>i})},45553(e,t,n){"use strict";n.d(t,{Z:()=>i});var r=n(25109);function i(){for(var e,t=r.B;e=t.sourceEvent;)t=e;return t}},24793(e,t,n){"use strict";n.d(t,{Z:()=>a});var r=n(45553),i=n(42115);function a(e,t,n){arguments.length<3&&(n=t,t=(0,r.Z)().changedTouches);for(var a,o=0,s=t?t.length:0;or})},71098(e,t,n){"use strict";n.r(t),n.d(t,{arc:()=>C,area:()=>j,areaRadial:()=>W,curveBasis:()=>eM,curveBasisClosed:()=>eA,curveBasisOpen:()=>eC,curveBundle:()=>eD,curveCardinal:()=>eR,curveCardinalClosed:()=>eF,curveCardinalOpen:()=>eB,curveCatmullRom:()=>e$,curveCatmullRomClosed:()=>eG,curveCatmullRomOpen:()=>eK,curveLinear:()=>D,curveLinearClosed:()=>eq,curveMonotoneX:()=>e3,curveMonotoneY:()=>e4,curveNatural:()=>e8,curveStep:()=>e7,curveStepAfter:()=>tt,curveStepBefore:()=>te,line:()=>R,lineRadial:()=>G,linkHorizontal:()=>et,linkRadial:()=>er,linkVertical:()=>en,pie:()=>B,pointRadial:()=>K,radialArea:()=>W,radialLine:()=>G,stack:()=>ta,stackOffsetDiverging:()=>ts,stackOffsetExpand:()=>to,stackOffsetNone:()=>tn,stackOffsetSilhouette:()=>tu,stackOffsetWiggle:()=>tc,stackOrderAppearance:()=>tl,stackOrderAscending:()=>td,stackOrderDescending:()=>tp,stackOrderInsideOut:()=>tb,stackOrderNone:()=>tr,stackOrderReverse:()=>tm,symbol:()=>eS,symbolCircle:()=>ei,symbolCross:()=>ea,symbolDiamond:()=>eu,symbolSquare:()=>ep,symbolStar:()=>eh,symbolTriangle:()=>em,symbolWye:()=>e_,symbols:()=>eE});var r=Math.PI,i=2*r,a=1e-6,o=i-a;function s(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function u(){return new s}s.prototype=u.prototype={constructor:s,moveTo:function(e,t){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(e,t){this._+="L"+(this._x1=+e)+","+(this._y1=+t)},quadraticCurveTo:function(e,t,n,r){this._+="Q"+ +e+","+ +t+","+(this._x1=+n)+","+(this._y1=+r)},bezierCurveTo:function(e,t,n,r,i,a){this._+="C"+ +e+","+ +t+","+ +n+","+ +r+","+(this._x1=+i)+","+(this._y1=+a)},arcTo:function(e,t,n,i,o){e=+e,t=+t,n=+n,i=+i,o=+o;var s=this._x1,u=this._y1,c=n-e,l=i-t,f=s-e,d=u-t,h=f*f+d*d;if(o<0)throw Error("negative radius: "+o);if(null===this._x1)this._+="M"+(this._x1=e)+","+(this._y1=t);else if(h>a){if(Math.abs(d*c-l*f)>a&&o){var p=n-s,b=i-u,m=c*c+l*l,g=Math.sqrt(m),v=Math.sqrt(h),y=o*Math.tan((r-Math.acos((m+h-(p*p+b*b))/(2*g*v)))/2),w=y/v,_=y/g;Math.abs(w-1)>a&&(this._+="L"+(e+w*f)+","+(t+w*d)),this._+="A"+o+","+o+",0,0,"+ +(d*p>f*b)+","+(this._x1=e+_*c)+","+(this._y1=t+_*l)}else this._+="L"+(this._x1=e)+","+(this._y1=t)}},arc:function(e,t,n,s,u,c){e=+e,t=+t,n=+n,c=!!c;var l=n*Math.cos(s),f=n*Math.sin(s),d=e+l,h=t+f,p=1^c,b=c?s-u:u-s;if(n<0)throw Error("negative radius: "+n);null===this._x1?this._+="M"+d+","+h:(Math.abs(this._x1-d)>a||Math.abs(this._y1-h)>a)&&(this._+="L"+d+","+h),n&&(b<0&&(b=b%i+i),b>o?this._+="A"+n+","+n+",0,1,"+p+","+(e-l)+","+(t-f)+"A"+n+","+n+",0,1,"+p+","+(this._x1=d)+","+(this._y1=h):b>a&&(this._+="A"+n+","+n+",0,"+ +(b>=r)+","+p+","+(this._x1=e+n*Math.cos(u))+","+(this._y1=t+n*Math.sin(u))))},rect:function(e,t,n,r){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)+"h"+ +n+"v"+ +r+"h"+-n+"Z"},toString:function(){return this._}};let c=u;function l(e){return function(){return e}}var f=Math.abs,d=Math.atan2,h=Math.cos,p=Math.max,b=Math.min,m=Math.sin,g=Math.sqrt,v=1e-12,y=Math.PI,w=y/2,_=2*y;function E(e){return e>1?0:e<-1?y:Math.acos(e)}function S(e){return e>=1?w:e<=-1?-w:Math.asin(e)}function k(e){return e.innerRadius}function x(e){return e.outerRadius}function T(e){return e.startAngle}function M(e){return e.endAngle}function O(e){return e&&e.padAngle}function A(e,t,n,r,i,a,o,s){var u=n-e,c=r-t,l=o-i,f=s-a,d=f*u-l*c;if(!(d*dI*I+D*D&&(T=O,M=A),{cx:T,cy:M,x01:-l,y01:-f,x11:T*(i/S-1),y11:M*(i/S-1)}}function C(){var e=k,t=x,n=l(0),r=null,i=T,a=M,o=O,s=null;function u(){var u,l,p=+e.apply(this,arguments),k=+t.apply(this,arguments),x=i.apply(this,arguments)-w,T=a.apply(this,arguments)-w,M=f(T-x),O=T>x;if(s||(s=u=c()),kv){if(M>_-v)s.moveTo(k*h(x),k*m(x)),s.arc(0,0,k,x,T,!O),p>v&&(s.moveTo(p*h(T),p*m(T)),s.arc(0,0,p,T,x,O));else{var C,I,D=x,N=T,P=x,R=T,j=M,F=M,Y=o.apply(this,arguments)/2,B=Y>v&&(r?+r.apply(this,arguments):g(p*p+k*k)),U=b(f(k-p)/2,+n.apply(this,arguments)),H=U,$=U;if(B>v){var z=S(B/p*m(Y)),G=S(B/k*m(Y));(j-=2*z)>v?(z*=O?1:-1,P+=z,R-=z):(j=0,P=R=(x+T)/2),(F-=2*G)>v?(G*=O?1:-1,D+=G,N-=G):(F=0,D=N=(x+T)/2)}var W=k*h(D),K=k*m(D),V=p*h(R),q=p*m(R);if(U>v){var Z,X=k*h(N),J=k*m(N),Q=p*h(P),ee=p*m(P);if(Mv?$>v?(C=L(Q,ee,W,K,k,$,O),I=L(X,J,V,q,k,$,O),s.moveTo(C.cx+C.x01,C.cy+C.y01),$v&&j>v?H>v?(C=L(V,q,X,J,p,-H,O),I=L(W,K,Q,ee,p,-H,O),s.lineTo(C.cx+C.x01,C.cy+C.y01),H=f;--d)s.point(g[d],v[d]);s.lineEnd(),s.areaEnd()}}m&&(g[l]=+e(h,l,u),v[l]=+n(h,l,u),s.point(t?+t(h,l,u):g[l],r?+r(h,l,u):v[l]))}if(p)return s=null,p+""||null}function f(){return R().defined(i).curve(o).context(a)}return u.x=function(n){return arguments.length?(e="function"==typeof n?n:l(+n),t=null,u):e},u.x0=function(t){return arguments.length?(e="function"==typeof t?t:l(+t),u):e},u.x1=function(e){return arguments.length?(t=null==e?null:"function"==typeof e?e:l(+e),u):t},u.y=function(e){return arguments.length?(n="function"==typeof e?e:l(+e),r=null,u):n},u.y0=function(e){return arguments.length?(n="function"==typeof e?e:l(+e),u):n},u.y1=function(e){return arguments.length?(r=null==e?null:"function"==typeof e?e:l(+e),u):r},u.lineX0=u.lineY0=function(){return f().x(e).y(n)},u.lineY1=function(){return f().x(e).y(r)},u.lineX1=function(){return f().x(t).y(n)},u.defined=function(e){return arguments.length?(i="function"==typeof e?e:l(!!e),u):i},u.curve=function(e){return arguments.length?(o=e,null!=a&&(s=o(a)),u):o},u.context=function(e){return arguments.length?(null==e?a=s=null:s=o(a=e),u):a},u}function F(e,t){return te?1:t>=e?0:NaN}function Y(e){return e}function B(){var e=Y,t=F,n=null,r=l(0),i=l(_),a=l(0);function o(o){var s,u,c,l,f,d=o.length,h=0,p=Array(d),b=Array(d),m=+r.apply(this,arguments),g=Math.min(_,Math.max(-_,i.apply(this,arguments)-m)),v=Math.min(Math.abs(g)/d,a.apply(this,arguments)),y=v*(g<0?-1:1);for(s=0;s0&&(h+=f);for(null!=t?p.sort(function(e,n){return t(b[e],b[n])}):null!=n&&p.sort(function(e,t){return n(o[e],o[t])}),s=0,c=h?(g-d*y)/h:0;s0?f*c:0)+y,b[u]={data:o[u],index:s,value:f,startAngle:m,endAngle:l,padAngle:v};return b}return o.value=function(t){return arguments.length?(e="function"==typeof t?t:l(+t),o):e},o.sortValues=function(e){return arguments.length?(t=e,n=null,o):t},o.sort=function(e){return arguments.length?(n=e,t=null,o):n},o.startAngle=function(e){return arguments.length?(r="function"==typeof e?e:l(+e),o):r},o.endAngle=function(e){return arguments.length?(i="function"==typeof e?e:l(+e),o):i},o.padAngle=function(e){return arguments.length?(a="function"==typeof e?e:l(+e),o):a},o}I.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t)}}};var U=$(D);function H(e){this._curve=e}function $(e){function t(t){return new H(e(t))}return t._curve=e,t}function z(e){var t=e.curve;return e.angle=e.x,delete e.x,e.radius=e.y,delete e.y,e.curve=function(e){return arguments.length?t($(e)):t()._curve},e}function G(){return z(R().curve(U))}function W(){var e=j().curve(U),t=e.curve,n=e.lineX0,r=e.lineX1,i=e.lineY0,a=e.lineY1;return e.angle=e.x,delete e.x,e.startAngle=e.x0,delete e.x0,e.endAngle=e.x1,delete e.x1,e.radius=e.y,delete e.y,e.innerRadius=e.y0,delete e.y0,e.outerRadius=e.y1,delete e.y1,e.lineStartAngle=function(){return z(n())},delete e.lineX0,e.lineEndAngle=function(){return z(r())},delete e.lineX1,e.lineInnerRadius=function(){return z(i())},delete e.lineY0,e.lineOuterRadius=function(){return z(a())},delete e.lineY1,e.curve=function(e){return arguments.length?t($(e)):t()._curve},e}function K(e,t){return[(t=+t)*Math.cos(e-=Math.PI/2),t*Math.sin(e)]}H.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(e,t){this._curve.point(t*Math.sin(e),-(t*Math.cos(e)))}};var V=Array.prototype.slice;function q(e){return e.source}function Z(e){return e.target}function X(e){var t=q,n=Z,r=N,i=P,a=null;function o(){var o,s=V.call(arguments),u=t.apply(this,s),l=n.apply(this,s);if(a||(a=o=c()),e(a,+r.apply(this,(s[0]=u,s)),+i.apply(this,s),+r.apply(this,(s[0]=l,s)),+i.apply(this,s)),o)return a=null,o+""||null}return o.source=function(e){return arguments.length?(t=e,o):t},o.target=function(e){return arguments.length?(n=e,o):n},o.x=function(e){return arguments.length?(r="function"==typeof e?e:l(+e),o):r},o.y=function(e){return arguments.length?(i="function"==typeof e?e:l(+e),o):i},o.context=function(e){return arguments.length?(a=null==e?null:e,o):a},o}function J(e,t,n,r,i){e.moveTo(t,n),e.bezierCurveTo(t=(t+r)/2,n,t,i,r,i)}function Q(e,t,n,r,i){e.moveTo(t,n),e.bezierCurveTo(t,n=(n+i)/2,r,n,r,i)}function ee(e,t,n,r,i){var a=K(t,n),o=K(t,n=(n+i)/2),s=K(r,n),u=K(r,i);e.moveTo(a[0],a[1]),e.bezierCurveTo(o[0],o[1],s[0],s[1],u[0],u[1])}function et(){return X(J)}function en(){return X(Q)}function er(){var e=X(ee);return e.angle=e.x,delete e.x,e.radius=e.y,delete e.y,e}let ei={draw:function(e,t){var n=Math.sqrt(t/y);e.moveTo(n,0),e.arc(0,0,n,0,_)}},ea={draw:function(e,t){var n=Math.sqrt(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}};var eo=Math.sqrt(1/3),es=2*eo;let eu={draw:function(e,t){var n=Math.sqrt(t/es),r=n*eo;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}};var ec=.8908130915292852,el=Math.sin(y/10)/Math.sin(7*y/10),ef=Math.sin(_/10)*el,ed=-Math.cos(_/10)*el;let eh={draw:function(e,t){var n=Math.sqrt(t*ec),r=ef*n,i=ed*n;e.moveTo(0,-n),e.lineTo(r,i);for(var a=1;a<5;++a){var o=_*a/5,s=Math.cos(o),u=Math.sin(o);e.lineTo(u*n,-s*n),e.lineTo(s*r-u*i,u*r+s*i)}e.closePath()}},ep={draw:function(e,t){var n=Math.sqrt(t),r=-n/2;e.rect(r,r,n,n)}};var eb=Math.sqrt(3);let em={draw:function(e,t){var n=-Math.sqrt(t/(3*eb));e.moveTo(0,2*n),e.lineTo(-eb*n,-n),e.lineTo(eb*n,-n),e.closePath()}};var eg=-.5,ev=Math.sqrt(3)/2,ey=1/Math.sqrt(12),ew=(ey/2+1)*3;let e_={draw:function(e,t){var n=Math.sqrt(t/ew),r=n/2,i=n*ey,a=r,o=n*ey+n,s=-a,u=o;e.moveTo(r,i),e.lineTo(a,o),e.lineTo(s,u),e.lineTo(eg*r-ev*i,ev*r+eg*i),e.lineTo(eg*a-ev*o,ev*a+eg*o),e.lineTo(eg*s-ev*u,ev*s+eg*u),e.lineTo(eg*r+ev*i,eg*i-ev*r),e.lineTo(eg*a+ev*o,eg*o-ev*a),e.lineTo(eg*s+ev*u,eg*u-ev*s),e.closePath()}};var eE=[ei,ea,eu,ep,eh,em,e_];function eS(){var e=l(ei),t=l(64),n=null;function r(){var r;if(n||(n=r=c()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),r)return n=null,r+""||null}return r.type=function(t){return arguments.length?(e="function"==typeof t?t:l(t),r):e},r.size=function(e){return arguments.length?(t="function"==typeof e?e:l(+e),r):t},r.context=function(e){return arguments.length?(n=null==e?null:e,r):n},r}function ek(){}function ex(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function eT(e){this._context=e}function eM(e){return new eT(e)}function eO(e){this._context=e}function eA(e){return new eO(e)}function eL(e){this._context=e}function eC(e){return new eL(e)}function eI(e,t){this._basis=new eT(e),this._beta=t}eT.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:ex(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:ex(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},eO.prototype={areaStart:ek,areaEnd:ek,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:ex(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},eL.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:ex(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},eI.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,n=e.length-1;if(n>0)for(var r,i=e[0],a=t[0],o=e[n]-i,s=t[n]-a,u=-1;++u<=n;)r=u/n,this._basis.point(this._beta*e[u]+(1-this._beta)*(i+r*o),this._beta*t[u]+(1-this._beta)*(a+r*s));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};let eD=function e(t){function n(e){return 1===t?new eT(e):new eI(e,t)}return n.beta=function(t){return e(+t)},n}(.85);function eN(e,t,n){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-n),e._x2,e._y2)}function eP(e,t){this._context=e,this._k=(1-t)/6}eP.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:eN(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:eN(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};let eR=function e(t){function n(e){return new eP(e,0)}return n.tension=function(t){return e(+t)},n}(0);function ej(e,t){this._context=e,this._k=(1-t)/6}ej.prototype={areaStart:ek,areaEnd:ek,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:eN(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};let eF=function e(t){function n(e){return new ej(e,0)}return n.tension=function(t){return e(+t)},n}(0);function eY(e,t){this._context=e,this._k=(1-t)/6}eY.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:eN(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};let eB=function e(t){function n(e){return new eY(e,0)}return n.tension=function(t){return e(+t)},n}(0);function eU(e,t,n){var r=e._x1,i=e._y1,a=e._x2,o=e._y2;if(e._l01_a>v){var s=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,u=3*e._l01_a*(e._l01_a+e._l12_a);r=(r*s-e._x0*e._l12_2a+e._x2*e._l01_2a)/u,i=(i*s-e._y0*e._l12_2a+e._y2*e._l01_2a)/u}if(e._l23_a>v){var c=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,l=3*e._l23_a*(e._l23_a+e._l12_a);a=(a*c+e._x1*e._l23_2a-t*e._l12_2a)/l,o=(o*c+e._y1*e._l23_2a-n*e._l12_2a)/l}e._context.bezierCurveTo(r,i,a,o,e._x2,e._y2)}function eH(e,t){this._context=e,this._alpha=t}eH.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:eU(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};let e$=function e(t){function n(e){return t?new eH(e,t):new eP(e,0)}return n.alpha=function(t){return e(+t)},n}(.5);function ez(e,t){this._context=e,this._alpha=t}ez.prototype={areaStart:ek,areaEnd:ek,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:eU(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};let eG=function e(t){function n(e){return t?new ez(e,t):new ej(e,0)}return n.alpha=function(t){return e(+t)},n}(.5);function eW(e,t){this._context=e,this._alpha=t}eW.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:eU(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};let eK=function e(t){function n(e){return t?new eW(e,t):new eY(e,0)}return n.alpha=function(t){return e(+t)},n}(.5);function eV(e){this._context=e}function eq(e){return new eV(e)}function eZ(e){return e<0?-1:1}function eX(e,t,n){var r=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(r||i<0&&-0),o=(n-e._y1)/(i||r<0&&-0),s=(a*i+o*r)/(r+i);return(eZ(a)+eZ(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function eJ(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function eQ(e,t,n){var r=e._x0,i=e._y0,a=e._x1,o=e._y1,s=(a-r)/3;e._context.bezierCurveTo(r+s,i+s*t,a-s,o-s*n,a,o)}function e1(e){this._context=e}function e0(e){this._context=new e2(e)}function e2(e){this._context=e}function e3(e){return new e1(e)}function e4(e){return new e0(e)}function e6(e){this._context=e}function e5(e){var t,n,r=e.length-1,i=Array(r),a=Array(r),o=Array(r);for(i[0]=0,a[0]=2,o[0]=e[0]+2*e[1],t=1;t=0;--t)i[t]=(o[t]-i[t+1])/a[t];for(t=0,a[r-1]=(e[r]+i[r-1])/2;t1)for(var n,r,i,a=1,o=e[t[0]],s=o.length;a=0;)n[t]=t;return n}function ti(e,t){return e[t]}function ta(){var e=l([]),t=tr,n=tn,r=ti;function i(i){var a,o,s=e.apply(this,arguments),u=i.length,c=s.length,l=Array(c);for(a=0;a0){for(var n,r,i,a=0,o=e[0].length;a0)for(var n,r,i,a,o,s,u=0,c=e[t[0]].length;u0?(r[0]=a,r[1]=a+=i):i<0?(r[1]=o,r[0]=o+=i):(r[0]=0,r[1]=i)}function tu(e,t){if((n=e.length)>0){for(var n,r=0,i=e[t[0]],a=i.length;r0&&(r=(n=e[t[0]]).length)>0){for(var n,r,i,a=0,o=1;oa&&(a=t,r=n);return r}function td(e){var t=e.map(th);return tr(e).sort(function(e,n){return t[e]-t[n]})}function th(e){for(var t,n=0,r=-1,i=e.length;++r=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}}this._x=e,this._y=t}}},35374(e,t,n){"use strict";n.d(t,{B7:()=>m,HT:()=>g,zO:()=>p});var r,i,a=0,o=0,s=0,u=1e3,c=0,l=0,f=0,d="object"==typeof performance&&performance.now?performance:Date,h="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function p(){return l||(h(b),l=d.now()+f)}function b(){l=0}function m(){this._call=this._time=this._next=null}function g(e,t,n){var r=new m;return r.restart(e,t,n),r}function v(){p(),++a;for(var e,t=r;t;)(e=l-t._time)>=0&&t._call.call(null,e),t=t._next;--a}function y(){l=(c=d.now())+f,a=o=0;try{v()}finally{a=0,_(),l=0}}function w(){var e=d.now(),t=e-c;t>u&&(f-=t,c=e)}function _(){for(var e,t,n=r,a=1/0;n;)n._call?(a>n._time&&(a=n._time),e=n,n=n._next):(t=n._next,n._next=null,n=e?e._next=t:r=t);i=e,E(a)}function E(e){if(!a){var t;o&&(o=clearTimeout(o)),e-l>24?(e<1/0&&(o=setTimeout(y,e-d.now()-f)),s&&(s=clearInterval(s))):(s||(c=d.now(),s=setInterval(w,u)),a=1,h(y))}}m.prototype=g.prototype={constructor:m,restart:function(e,t,n){if("function"!=typeof e)throw TypeError("callback is not a function");n=(null==n?p():+n)+(null==t?0:+t),this._next||i===this||(i?i._next=this:r=this,i=this),this._call=e,this._time=n,E()},stop:function(){this._call&&(this._call=null,this._time=1/0,E())}}},76626(e,t,n){"use strict";n.r(t),n.d(t,{zoom:()=>t6,zoomIdentity:()=>tq,zoomTransform:()=>tZ});var r,i,a,o,s=n(92626),u=n(44266),c=Math.SQRT2,l=2,f=4,d=1e-12;function h(e){return((e=Math.exp(e))+1/e)/2}function p(e){return((e=Math.exp(e))-1/e)/2}function b(e){return((e=Math.exp(2*e))-1)/(e+1)}function m(e,t){var n,r,i=e[0],a=e[1],o=e[2],s=t[0],u=t[1],m=t[2],g=s-i,v=u-a,y=g*g+v*v;if(yT)throw Error("too late; already scheduled");return n}function P(e,t){var n=R(e,t);if(n.state>A)throw Error("too late; already running");return n}function R(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw Error("transition not found");return n}function j(e,t,n){var r,i=e.__transition;function a(e){n.state=M,n.timer.restart(o,n.delay,n.time),n.delay<=e&&o(e-n.delay)}function o(a){var c,l,f,d;if(n.state!==M)return u();for(c in i)if((d=i[c]).name===n.name){if(d.state===A)return S(o);d.state===L?(d.state=I,d.timer.stop(),d.on.call("interrupt",e,e.__data__,d.index,d.group),delete i[c]):+cO&&n.state180?t+=360:t-e>180&&(e+=360),a.push({i:n.push(i(n)+"rotate(",null,r)-2,x:B(e,t)})):t&&n.push(i(n)+"rotate("+t+r)}function s(e,t,n,a){e!==t?a.push({i:n.push(i(n)+"skewX(",null,r)-2,x:B(e,t)}):t&&n.push(i(n)+"skewX("+t+r)}function u(e,t,n,r,a,o){if(e!==n||t!==r){var s=a.push(i(a)+"scale(",null,",",null,")");o.push({i:s-4,x:B(e,n)},{i:s-2,x:B(t,r)})}else(1!==n||1!==r)&&a.push(i(a)+"scale("+n+","+r+")")}return function(t,n){var r=[],i=[];return t=e(t),n=e(n),a(t.translateX,t.translateY,n.translateX,n.translateY,r,i),o(t.rotate,n.rotate,r,i),s(t.skewX,n.skewX,r,i),u(t.scaleX,t.scaleY,n.scaleX,n.scaleY,r,i),t=n=null,function(e){for(var t,n=-1,a=i.length;++n>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?e_(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?e_(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=ec.exec(e))?new ek(t[1],t[2],t[3],1):(t=el.exec(e))?new ek(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=ef.exec(e))?e_(t[1],t[2],t[3],t[4]):(t=ed.exec(e))?e_(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=eh.exec(e))?eO(t[1],t[2]/100,t[3]/100,1):(t=ep.exec(e))?eO(t[1],t[2]/100,t[3]/100,t[4]):eb.hasOwnProperty(e)?ew(eb[e]):"transparent"===e?new ek(NaN,NaN,NaN,0):null}function ew(e){return new ek(e>>16&255,e>>8&255,255&e,1)}function e_(e,t,n,r){return r<=0&&(e=t=n=NaN),new ek(e,t,n,r)}function eE(e){return(e instanceof en||(e=ey(e)),e)?(e=e.rgb(),new ek(e.r,e.g,e.b,e.opacity)):new ek}function eS(e,t,n,r){return 1===arguments.length?eE(e):new ek(e,t,n,null==r?1:r)}function ek(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function ex(){return"#"+eM(this.r)+eM(this.g)+eM(this.b)}function eT(){var e=this.opacity;return(1===(e=isNaN(e)?1:Math.max(0,Math.min(1,e)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===e?")":", "+e+")")}function eM(e){return((e=Math.max(0,Math.min(255,Math.round(e)||0)))<16?"0":"")+e.toString(16)}function eO(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new eC(e,t,n,r)}function eA(e){if(e instanceof eC)return new eC(e.h,e.s,e.l,e.opacity);if(e instanceof en||(e=ey(e)),!e)return new eC;if(e instanceof eC)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,s=a-i,u=(a+i)/2;return s?(o=t===a?(n-r)/s+(n0&&u<1?0:o,new eC(o,s,u,e.opacity)}function eL(e,t,n,r){return 1===arguments.length?eA(e):new eC(e,t,n,null==r?1:r)}function eC(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function eI(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}function eD(e,t,n,r,i){var a=e*e,o=a*e;return((1-3*e+3*a-o)*t+(4-6*a+3*o)*n+(1+3*e+3*a-3*o)*r+o*i)/6}function eN(e){var t=e.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,t-1):Math.floor(n*t),i=e[r],a=e[r+1],o=r>0?e[r-1]:2*i-a,s=r=240?e-240:e+120,i,r),eI(e,i,r),eI(e<120?e+240:e-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var e=this.opacity;return(1===(e=isNaN(e)?1:Math.max(0,Math.min(1,e)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===e?")":", "+e+")")}}));let eU=function e(t){var n=eY(1);function r(e,t){var r=n((e=eS(e)).r,(t=eS(t)).r),i=n(e.g,t.g),a=n(e.b,t.b),o=eB(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=a(t),e.opacity=o(t),e+""}}return r.gamma=e,r}(1);function eH(e){return function(t){var n,r,i=t.length,a=Array(i),o=Array(i),s=Array(i);for(n=0;na&&(i=t.slice(a,i),s[o]?s[o]+=i:s[++o]=i),(n=n[0])===(r=r[0])?s[o]?s[o]+=r:s[++o]=r:(s[++o]=null,u.push({i:o,x:B(n,r)})),a=ez.lastIndex;return a=0&&(e=e.slice(0,t)),!e||"start"===e})}function tc(e,t,n){var r,i,a=tu(t)?N:P;return function(){var o=a(this,e),s=o.on;s!==r&&(i=(r=s).copy()).on(t,n),o.on=i}}function tl(e,t){var n=this._id;return arguments.length<2?R(this.node(),n).on.on(e):this.each(tc(n,e,t))}function tf(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function td(){return this.on("end.remove",tf(this._id))}var th=n(82634);function tp(e){var t=this._name,n=this._id;"function"!=typeof e&&(e=(0,th.Z)(e));for(var r=this._groups,i=r.length,a=Array(i),o=0;or?(r+i)/2:Math.min(0,r)||Math.max(0,i),o>a?(a+o)/2:Math.min(0,a)||Math.max(0,o))}function t6(){var e,t,n=tQ,r=t1,i=t4,a=t2,o=t3,c=[0,1/0],l=[[-1/0,-1/0],[1/0,1/0]],f=250,d=m,h=(0,s.Z)("start","zoom","end"),p=500,b=150,_=0;function E(e){e.property("__zoom",t0).on("wheel.zoom",A).on("mousedown.zoom",L).on("dblclick.zoom",C).filter(o).on("touchstart.zoom",I).on("touchmove.zoom",D).on("touchend.zoom touchcancel.zoom",N).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function S(e,t){return(t=Math.max(c[0],Math.min(c[1],t)))===e.k?e:new tV(t,e.x,e.y)}function k(e,t,n){var r=t[0]-n[0]*e.k,i=t[1]-n[1]*e.k;return r===e.x&&i===e.y?e:new tV(e.k,r,i)}function x(e){return[(+e[0][0]+ +e[1][0])/2,(+e[0][1]+ +e[1][1])/2]}function T(e,t,n){e.on("start.zoom",function(){M(this,arguments).start()}).on("interrupt.zoom end.zoom",function(){M(this,arguments).end()}).tween("zoom",function(){var e=this,i=arguments,a=M(e,i),o=r.apply(e,i),s=null==n?x(o):"function"==typeof n?n.apply(e,i):n,u=Math.max(o[1][0]-o[0][0],o[1][1]-o[0][1]),c=e.__zoom,l="function"==typeof t?t.apply(e,i):t,f=d(c.invert(s).concat(u/c.k),l.invert(s).concat(u/l.k));return function(e){if(1===e)e=l;else{var t=f(e),n=u/t[2];e=new tV(n,s[0]-t[0]*n,s[1]-t[1]*n)}a.zoom(null,e)}})}function M(e,t,n){return!n&&e.__zooming||new O(e,t)}function O(e,t){this.that=e,this.args=t,this.active=0,this.extent=r.apply(e,t),this.taps=0}function A(){if(n.apply(this,arguments)){var e=M(this,arguments),t=this.__zoom,r=Math.max(c[0],Math.min(c[1],t.k*Math.pow(2,a.apply(this,arguments)))),o=(0,v.Z)(this);if(e.wheel)(e.mouse[0][0]!==o[0]||e.mouse[0][1]!==o[1])&&(e.mouse[1]=t.invert(e.mouse[0]=o)),clearTimeout(e.wheel);else{if(t.k===r)return;e.mouse=[o,t.invert(o)],F(this),e.start()}tJ(),e.wheel=setTimeout(s,b),e.zoom("mouse",i(k(S(t,r),e.mouse[0],e.mouse[1]),e.extent,l))}function s(){e.wheel=null,e.end()}}function L(){if(!t&&n.apply(this,arguments)){var e=M(this,arguments,!0),r=(0,y.Z)(g.B.view).on("mousemove.zoom",c,!0).on("mouseup.zoom",f,!0),a=(0,v.Z)(this),o=g.B.clientX,s=g.B.clientY;(0,u.Z)(g.B.view),tX(),e.mouse=[a,this.__zoom.invert(a)],F(this),e.start()}function c(){if(tJ(),!e.moved){var t=g.B.clientX-o,n=g.B.clientY-s;e.moved=t*t+n*n>_}e.zoom("mouse",i(k(e.that.__zoom,e.mouse[0]=(0,v.Z)(e.that),e.mouse[1]),e.extent,l))}function f(){r.on("mousemove.zoom mouseup.zoom",null),(0,u.D)(g.B.view,e.moved),tJ(),e.end()}}function C(){if(n.apply(this,arguments)){var e=this.__zoom,t=(0,v.Z)(this),a=e.invert(t),o=e.k*(g.B.shiftKey?.5:2),s=i(k(S(e,o),t,a),r.apply(this,arguments),l);tJ(),f>0?(0,y.Z)(this).transition().duration(f).call(T,s,t):(0,y.Z)(this).call(E.transform,s)}}function I(){if(n.apply(this,arguments)){var t,r,i,a,o=g.B.touches,s=o.length,u=M(this,arguments,g.B.changedTouches.length===s);for(tX(),r=0;r=0?i=setTimeout(r,t-c):(i=null,n||(u=e.apply(o,a),o=a=null))}null==t&&(t=100);var i,a,o,s,u,c=function(){o=this,a=arguments,s=Date.now();var c=n&&!i;return i||(i=setTimeout(r,t)),c&&(u=e.apply(o,a),o=a=null),u};return c.clear=function(){i&&(clearTimeout(i),i=null)},c.flush=function(){i&&(u=e.apply(o,a),o=a=null,clearTimeout(i),i=null)},c}t.debounce=t,e.exports=t},94863:function(e){var t,n;t=this,n=function(){"use strict";var e=function(e){return t(e)&&!n(e)};function t(e){return!!e&&"object"==typeof e}function n(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||i(e)}var r="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function i(e){return e.$$typeof===r}function a(e){return Array.isArray(e)?[]:{}}function o(e,t){return!1!==t.clone&&t.isMergeableObject(e)?d(a(e),e,t):e}function s(e,t,n){return e.concat(t).map(function(e){return o(e,n)})}function u(e,t){if(!t.customMerge)return d;var n=t.customMerge(e);return"function"==typeof n?n:d}function c(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return e.propertyIsEnumerable(t)}):[]}function l(e){return Object.keys(e).concat(c(e))}function f(e,t,n){var r={};return n.isMergeableObject(e)&&l(e).forEach(function(t){r[t]=o(e[t],n)}),l(t).forEach(function(i){n.isMergeableObject(t[i])&&e[i]?r[i]=u(i,n)(e[i],t[i],n):r[i]=o(t[i],n)}),r}function d(t,n,r){(r=r||{}).arrayMerge=r.arrayMerge||s,r.isMergeableObject=r.isMergeableObject||e;var i=Array.isArray(n);return i!==Array.isArray(t)?o(n,r):i?r.arrayMerge(t,n,r):f(t,n,r)}return d.all=function(e,t){if(!Array.isArray(e))throw Error("first argument should be an array");return e.reduce(function(e,n){return d(e,n,t)},{})},d},e.exports=n()},7624(e,t){"use strict";function n(e){return e===e.window?e:9===e.nodeType&&(e.defaultView||e.parentWindow)}t.__esModule=!0,t.default=n,e.exports=t.default},87797(e,t,n){"use strict";var r=n(64836);t.__esModule=!0,t.default=s;var i=r(n(53497)),a=/^(top|right|bottom|left)$/,o=/^([+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|))(?!px)[a-z%]+$/i;function s(e){if(!e)throw TypeError("No Element passed to `getComputedStyle()`");var t=e.ownerDocument;return"defaultView"in t?t.defaultView.opener?e.ownerDocument.defaultView.getComputedStyle(e,null):window.getComputedStyle(e,null):{getPropertyValue:function(t){var n=e.style;"float"==(t=(0,i.default)(t))&&(t="styleFloat");var r=e.currentStyle[t]||null;if(null==r&&n&&n[t]&&(r=n[t]),o.test(r)&&!a.test(t)){var s=n.left,u=e.runtimeStyle,c=u&&u.left;c&&(u.left=e.currentStyle.left),n.left="fontSize"===t?"1em":r,r=n.pixelLeft+"px",n.left=s,c&&(u.left=c)}return r}}}e.exports=t.default},10162(e,t,n){"use strict";var r=n(64836);t.__esModule=!0,t.default=l;var i=r(n(53497)),a=r(n(24403)),o=r(n(87797)),s=r(n(91760)),u=n(20702),c=r(n(43293));function l(e,t,n){var r="",l="",f=t;if("string"==typeof t){if(void 0===n)return e.style[(0,i.default)(t)]||(0,o.default)(e).getPropertyValue((0,a.default)(t));(f={})[t]=n}Object.keys(f).forEach(function(t){var n=f[t];n||0===n?(0,c.default)(t)?l+=t+"("+n+") ":r+=(0,a.default)(t)+": "+n+";":(0,s.default)(e,(0,a.default)(t))}),l&&(r+=u.transform+": "+l+";"),e.style.cssText+=";"+r}e.exports=t.default},91760(e,t){"use strict";function n(e,t){return"removeProperty"in e.style?e.style.removeProperty(t):e.style.removeAttribute(t)}t.__esModule=!0,t.default=n,e.exports=t.default},43293(e,t){"use strict";t.__esModule=!0,t.default=r;var n=/^((translate|rotate|scale)(X|Y|Z|3d)?|matrix(3d)?|perspective|skew(X|Y)?)$/i;function r(e){return!!(e&&n.test(e))}e.exports=t.default},20702(e,t,n){"use strict";var r,i,a,o,s,u,c,l,f,d,h,p=n(64836);t.__esModule=!0,t.default=t.animationEnd=t.animationDelay=t.animationTiming=t.animationDuration=t.animationName=t.transitionEnd=t.transitionDuration=t.transitionDelay=t.transitionTiming=t.transitionProperty=t.transform=void 0;var b=p(n(50139)),m="transform";if(t.transform=m,t.animationEnd=a,t.transitionEnd=i,t.transitionDelay=c,t.transitionTiming=u,t.transitionDuration=s,t.transitionProperty=o,t.animationDelay=h,t.animationTiming=d,t.animationDuration=f,t.animationName=l,b.default){var g=y();r=g.prefix,t.transitionEnd=i=g.transitionEnd,t.animationEnd=a=g.animationEnd,t.transform=m=r+"-"+m,t.transitionProperty=o=r+"-transition-property",t.transitionDuration=s=r+"-transition-duration",t.transitionDelay=c=r+"-transition-delay",t.transitionTiming=u=r+"-transition-timing-function",t.animationName=l=r+"-animation-name",t.animationDuration=f=r+"-animation-duration",t.animationTiming=d=r+"-animation-delay",t.animationDelay=h=r+"-animation-timing-function"}var v={transform:m,end:i,property:o,timing:u,delay:c,duration:s};function y(){for(var e,t,n=document.createElement("div").style,r={O:function(e){return"o"+e.toLowerCase()},Moz:function(e){return e.toLowerCase()},Webkit:function(e){return"webkit"+e},ms:function(e){return"MS"+e}},i=Object.keys(r),a="",o=0;o0&&void 0!==arguments[0]?arguments[0]:{},r=n.defaultLayoutOptions,a=void 0===r?{}:r,s=n.algorithms,u=void 0===s?["layered","stress","mrtree","radial","force","disco","sporeOverlap","sporeCompaction","rectpacking"]:s,c=n.workerFactory,l=n.workerUrl;if(i(this,e),this.defaultLayoutOptions=a,this.initialized=!1,void 0===l&&void 0===c)throw Error("Cannot construct an ELK without both 'workerUrl' and 'workerFactory'.");var f=c;void 0!==l&&void 0===c&&(f=function(e){return new Worker(e)});var d=f(l);if("function"!=typeof d.postMessage)throw TypeError("Created worker does not provide the required 'postMessage' function.");this.worker=new o(d),this.worker.postMessage({cmd:"register",algorithms:u}).then(function(e){return t.initialized=!0}).catch(console.err)}return r(e,[{key:"layout",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.layoutOptions,r=void 0===n?this.defaultLayoutOptions:n,i=t.logging,a=void 0!==i&&i,o=t.measureExecutionTime,s=void 0!==o&&o;return e?this.worker.postMessage({cmd:"layout",graph:e,layoutOptions:r,options:{logging:a,measureExecutionTime:s}}):Promise.reject(Error("Missing mandatory parameter 'graph'."))}},{key:"knownLayoutAlgorithms",value:function(){return this.worker.postMessage({cmd:"algorithms"})}},{key:"knownLayoutOptions",value:function(){return this.worker.postMessage({cmd:"options"})}},{key:"knownLayoutCategories",value:function(){return this.worker.postMessage({cmd:"categories"})}},{key:"terminateWorker",value:function(){this.worker.terminate()}}]),e}();n.default=a;var o=function(){function e(t){var n=this;if(i(this,e),void 0===t)throw Error("Missing mandatory parameter 'worker'.");this.resolvers={},this.worker=t,this.worker.onmessage=function(e){setTimeout(function(){n.receive(n,e)},0)}}return r(e,[{key:"postMessage",value:function(e){var t=this.id||0;this.id=t+1,e.id=t;var n=this;return new Promise(function(r,i){n.resolvers[t]=function(e,t){e?(n.convertGwtStyleError(e),i(e)):r(t)},n.worker.postMessage(e)})}},{key:"receive",value:function(e,t){var n=t.data,r=e.resolvers[n.id];r&&(delete e.resolvers[n.id],n.error?r(n.error):r(null,n.data))}},{key:"terminate",value:function(){this.worker.terminate&&this.worker.terminate()}},{key:"convertGwtStyleError",value:function(e){if(e){var t=e.__java$exception;t&&(t.cause&&t.cause.backingJsObject&&(e.cause=t.cause.backingJsObject,this.convertGwtStyleError(e.cause)),delete e.__java$exception)}}}]),e}()},{}],2:[function(e,t,n){"use strict";var r=e("./elk-api.js").default;Object.defineProperty(t.exports,"__esModule",{value:!0}),t.exports=r,r.default=r},{"./elk-api.js":1}]},{},[2])(2)},e.exports=t()},55273(e,t,n){"use strict";function r(){}function i(){}function a(){}function o(){}function s(){}function u(){}function c(){}function l(){}function f(){}function d(){}function h(){}function p(){}function b(){}function m(){}function g(){}function v(){}function y(){}function w(){}function _(){}function E(){}function S(){}function k(){}function x(){}function T(){}function M(){}function O(){}function A(){}function L(){}function C(){}function I(){}function D(){}function N(){}function P(){}function R(){}function j(){}function F(){}function Y(){}function B(){}function U(){}function H(){}function $(){}function z(){}function G(){}function W(){}function K(){}function V(){}function q(){}function Z(){}function X(){}function J(){}function Q(){}function ee(){}function et(){}function en(){}function er(){}function ei(){}function ea(){}function eo(){}function es(){}function eu(){}function ec(){}function el(){}function ef(){}function ed(){}function eh(){}function ep(){}function eb(){}function em(){}function eg(){}function ev(){}function ey(){}function ew(){}function e_(){}function eE(){}function eS(){}function ek(){}function ex(){}function eT(){}function eM(){}function eO(){}function eA(){}function eL(){}function eC(){}function eI(){}function eD(){}function eN(){}function eP(){}function eR(){}function ej(){}function eF(){}function eY(){}function eB(){}function eU(){}function eH(){}function e$(){}function ez(){}function eG(){}function eW(){}function eK(){}function eV(){}function eq(){}function eZ(){}function eX(){}function eJ(){}function eQ(){}function e1(){}function e0(){}function e2(){}function e3(){}function e4(){}function e6(){}function e5(){}function e8(){}function e9(){}function e7(){}function te(){}function tt(){}function tn(){}function tr(){}function ti(){}function ta(){}function to(){}function ts(){}function tu(){}function tc(){}function tl(){}function tf(){}function td(){}function th(){}function tp(){}function tb(){}function tm(){}function tg(){}function tv(){}function ty(){}function tw(){}function t_(){}function tE(){}function tS(){}function tk(){}function tx(){}function tT(){}function tM(){}function tO(){}function tA(){}function tL(){}function tC(){}function tI(){}function tD(){}function tN(){}function tP(){}function tR(){}function tj(){}function tF(){}function tY(){}function tB(){}function tU(){}function tH(){}function t$(){}function tz(){}function tG(){}function tW(){}function tK(){}function tV(){}function tq(){}function tZ(){}function tX(){}function tJ(){}function tQ(){}function t1(){}function t0(){}function t2(){}function t3(){}function t4(){}function t6(){}function t5(){}function t8(){}function t9(){}function t7(){}function ne(){}function nt(){}function nn(){}function nr(){}function ni(){}function na(){}function no(){}function ns(){}function nu(){}function nc(){}function nl(){}function nf(){}function nd(){}function nh(){}function np(){}function nb(){}function nm(){}function ng(){}function nv(){}function ny(){}function nw(){}function n_(){}function nE(){}function nS(){}function nk(){}function nx(){}function nT(){}function nM(){}function nO(){}function nA(){}function nL(){}function nC(){}function nI(){}function nD(){}function nN(){}function nP(){}function nR(){}function nj(){}function nF(){}function nY(){}function nB(){}function nU(){}function nH(){}function n$(){}function nz(){}function nG(){}function nW(){}function nK(){}function nV(){}function nq(){}function nZ(){}function nX(){}function nJ(){}function nQ(){}function n1(){}function n0(){}function n2(){}function n3(){}function n4(){}function n6(){}function n5(){}function n8(){}function n9(){}function n7(){}function re(){}function rt(){}function rn(){}function rr(){}function ri(){}function ra(){}function ro(){}function rs(){}function ru(){}function rc(){}function rl(){}function rf(){}function rd(){}function rh(){}function rp(){}function rb(){}function rm(){}function rg(){}function rv(){}function ry(){}function rw(){}function r_(){}function rE(){}function rS(){}function rk(){}function rx(){}function rT(){}function rM(){}function rO(){}function rA(){}function rL(){}function rC(){}function rI(){}function rD(){}function rN(){}function rP(){}function rR(){}function rj(){}function rF(){}function rY(){}function rB(){}function rU(){}function rH(){}function r$(){}function rz(){}function rG(){}function rW(){}function rK(){}function rV(){}function rq(){}function rZ(){}function rX(){}function rJ(){}function rQ(){}function r1(){}function r0(){}function r2(){}function r3(){}function r4(){}function r6(){}function r5(){}function r8(){}function r9(){}function r7(){}function ie(){}function it(){}function ir(){}function ii(){}function ia(){}function io(){}function is(){}function iu(){}function ic(){}function il(){}function id(){}function ih(){}function ip(){}function ib(){}function im(){}function ig(){}function iv(){}function iy(){}function iw(){}function i_(){}function iE(){}function iS(){}function ik(){}function ix(){}function iT(){}function iM(){}function iO(){}function iA(){}function iL(){}function iC(){}function iI(){}function iD(){}function iN(){}function iP(){}function iR(){}function ij(){}function iF(){}function iY(){}function iB(){}function iU(){}function iH(){}function i$(){}function iz(){}function iG(){}function iW(){}function iK(){}function iV(){}function iq(){}function iZ(){}function iX(){}function iJ(){}function iQ(){}function i1(){}function i0(){}function i2(){}function i3(){}function i4(){}function i6(){}function i5(){}function i8(){}function i9(){}function i7(){}function ae(){}function at(){}function an(){}function ar(){}function ai(){}function aa(){}function ao(){}function as(){}function au(){}function ac(){}function al(){}function af(){}function ad(){}function ah(){}function ap(){}function ab(){}function am(){}function ag(){}function av(){}function ay(){}function aw(){}function a_(){}function aE(){}function aS(){}function ak(){}function ax(){}function aT(){}function aM(){}function aO(){}function aA(){}function aL(){}function aC(){}function aI(){}function aD(){}function aN(){}function aP(){}function aR(){}function aj(){}function aF(){}function aY(){}function aB(){}function aU(){}function aH(){}function a$(){}function az(){}function aG(){}function aW(){}function aK(){}function aV(){}function aq(){}function aZ(){}function aX(){}function aJ(){}function aQ(){}function a1(){}function a0(){}function a2(){}function a3(){}function a4(){}function a6(){}function a5(){}function a8(){}function a9(){}function a7(){}function oe(){}function ot(){}function on(){}function or(){}function oi(){}function oa(){}function oo(){}function os(){}function ou(){}function oc(){}function ol(){}function of(){}function od(){}function oh(){}function op(){}function ob(){}function om(){}function og(){}function ov(){}function oy(){}function ow(){}function o_(){}function oE(){}function oS(){}function ok(){}function ox(){}function oT(){}function oM(){}function oO(){}function oA(){}function oL(){}function oC(){}function oI(){}function oD(){}function oN(){}function oP(){}function oR(){}function oj(){}function oF(){}function oY(){}function oB(){}function oU(){}function oH(){}function o$(){}function oz(){}function oG(){}function oW(){}function oK(){}function oV(){}function oq(){}function oZ(){}function oX(){}function oJ(){}function oQ(){}function o1(){}function o0(){}function o2(){}function o3(){}function o4(){}function o6(){}function o5(){}function o8(){}function o9(){}function o7(){}function se(){}function st(){}function sn(){}function sr(){}function si(){}function sa(){}function so(){}function ss(){}function su(){}function sc(){}function sl(){}function sf(){}function sd(){}function sh(){}function sp(){}function sb(){}function sm(){}function sg(){}function sv(){}function sy(){}function sw(){}function s_(){}function sE(){}function sS(){}function sk(){}function sx(){}function sT(){}function sM(){}function sO(){}function sA(){}function sL(){}function sC(){}function sI(){}function sD(){}function sN(){}function sP(){}function sR(){}function sj(){}function sF(){}function sY(){}function sB(){}function sU(){}function sH(){}function s$(){}function sz(){}function sG(){}function sW(){}function sK(){}function sV(){}function sq(){}function sZ(){}function sX(){}function sJ(){}function sQ(){}function s1(){}function s0(){}function s2(){}function s3(){}function s4(){}function s6(){}function s5(){}function s8(){}function s9(){}function s7(){}function ue(){}function ut(){}function un(){}function ur(){}function ui(){}function ua(){}function uo(){}function us(){}function uu(){}function uc(){}function ul(){}function uf(){}function ud(){}function uh(){}function up(){}function ub(){}function um(){}function ug(){}function uv(){}function uy(){}function uw(){}function u_(){}function uE(){}function uS(){}function uk(){}function ux(){}function uT(){}function uM(){}function uO(){}function uA(){}function uL(){}function uC(){}function uI(){}function uD(){}function uN(){}function uP(){}function uR(){}function uj(){}function uF(){}function uY(){}function uB(){}function uU(){}function uH(){}function u$(){}function uz(){}function uG(){}function uW(){}function uK(){}function uV(){}function uq(){}function uZ(){}function uX(){}function uJ(){}function uQ(){}function u1(){}function u0(){}function u2(){}function u3(){}function u4(){}function u6(){}function u5(){}function u8(){}function u9(){}function u7(){}function ce(){}function ct(){}function cn(e){}function cr(e){}function ci(){m4()}function ca(){eug()}function co(){epz()}function cs(){evw()}function cu(){eEg()}function cc(){eCk()}function cl(){egA()}function cf(){egq()}function cd(){_O()}function ch(){_k()}function cp(){DR()}function cb(){_A()}function cm(){erJ()}function cg(){_C()}function cv(){Xi()}function cy(){en5()}function cw(){Jb()}function c_(){Gw()}function cE(){euv()}function cS(){e_z()}function ck(){en8()}function cx(){K8()}function cT(){eBH()}function cM(){egP()}function cO(){G_()}function cA(){eBy()}function cL(){Gv()}function cC(){en9()}function cI(){eoz()}function cD(){Gx()}function cN(){JK()}function cP(){_I()}function cR(){eTK()}function cj(){egj()}function cF(){eiQ()}function cY(){e_L()}function cB(){eCT()}function cU(){ebJ()}function cH(){eTj()}function c$(){eaB()}function cz(){GS()}function cG(){eDn()}function cW(){eTU()}function cK(){eMK()}function cV(){J1()}function cq(){e_C()}function cZ(){eBB()}function cX(){euw()}function cJ(){ed6()}function cQ(){ePm()}function c1(){De()}function c0(){eiM()}function c2(){eD4()}function c3(e){BJ(e)}function c4(e){this.a=e}function c6(e){this.a=e}function c5(e){this.a=e}function c8(e){this.a=e}function c9(e){this.a=e}function c7(e){this.a=e}function le(e){this.a=e}function lt(e){this.a=e}function ln(e){this.a=e}function lr(e){this.a=e}function li(e){this.a=e}function la(e){this.a=e}function lo(e){this.a=e}function ls(e){this.a=e}function lu(e){this.a=e}function lc(e){this.a=e}function ll(e){this.a=e}function lf(e){this.a=e}function ld(e){this.a=e}function lh(e){this.a=e}function lp(e){this.a=e}function lb(e){this.b=e}function lm(e){this.c=e}function lg(e){this.a=e}function lv(e){this.a=e}function ly(e){this.a=e}function lw(e){this.a=e}function l_(e){this.a=e}function lE(e){this.a=e}function lS(e){this.a=e}function lk(e){this.a=e}function lx(e){this.a=e}function lT(e){this.a=e}function lM(e){this.a=e}function lO(e){this.a=e}function lA(e){this.a=e}function lL(e){this.a=e}function lC(e){this.a=e}function lI(e){this.a=e}function lD(e){this.a=e}function lN(){this.a=[]}function lP(e,t){e.a=t}function lR(e,t){e.a=t}function lj(e,t){e.b=t}function lF(e,t){e.b=t}function lY(e,t){e.b=t}function lB(e,t){e.j=t}function lU(e,t){e.g=t}function lH(e,t){e.i=t}function l$(e,t){e.c=t}function lz(e,t){e.d=t}function lG(e,t){e.d=t}function lW(e,t){e.c=t}function lK(e,t){e.k=t}function lV(e,t){e.c=t}function lq(e,t){e.c=t}function lZ(e,t){e.a=t}function lX(e,t){e.a=t}function lJ(e,t){e.f=t}function lQ(e,t){e.a=t}function l1(e,t){e.b=t}function l0(e,t){e.d=t}function l2(e,t){e.i=t}function l3(e,t){e.o=t}function l4(e,t){e.r=t}function l6(e,t){e.a=t}function l5(e,t){e.b=t}function l8(e,t){e.e=t}function l9(e,t){e.f=t}function l7(e,t){e.g=t}function fe(e,t){e.e=t}function ft(e,t){e.f=t}function fn(e,t){e.f=t}function fr(e,t){e.n=t}function fi(e,t){e.a=t}function fa(e,t){e.a=t}function fo(e,t){e.c=t}function fs(e,t){e.c=t}function fu(e,t){e.d=t}function fc(e,t){e.e=t}function fl(e,t){e.g=t}function ff(e,t){e.a=t}function fd(e,t){e.c=t}function fh(e,t){e.d=t}function fp(e,t){e.e=t}function fb(e,t){e.f=t}function fm(e,t){e.j=t}function fg(e,t){e.a=t}function fv(e,t){e.b=t}function fy(e,t){e.a=t}function fw(e){e.b=e.a}function f_(e){e.c=e.d.d}function fE(e){this.d=e}function fS(e){this.a=e}function fk(e){this.a=e}function fx(e){this.a=e}function fT(e){this.a=e}function fM(e){this.a=e}function fO(e){this.a=e}function fA(e){this.a=e}function fL(e){this.a=e}function fC(e){this.a=e}function fI(e){this.a=e}function fD(e){this.a=e}function fN(e){this.a=e}function fP(e){this.a=e}function fR(e){this.a=e}function fj(e){this.b=e}function fF(e){this.b=e}function fY(e){this.b=e}function fB(e){this.a=e}function fU(e){this.a=e}function fH(e){this.a=e}function f$(e){this.c=e}function fz(e){this.c=e}function fG(e){this.c=e}function fW(e){this.a=e}function fK(e){this.a=e}function fV(e){this.a=e}function fq(e){this.a=e}function fZ(e){this.a=e}function fX(e){this.a=e}function fJ(e){this.a=e}function fQ(e){this.a=e}function f1(e){this.a=e}function f0(e){this.a=e}function f2(e){this.a=e}function f3(e){this.a=e}function f4(e){this.a=e}function f6(e){this.a=e}function f5(e){this.a=e}function f8(e){this.a=e}function f9(e){this.a=e}function f7(e){this.a=e}function de(e){this.a=e}function dt(e){this.a=e}function dn(e){this.a=e}function dr(e){this.a=e}function di(e){this.a=e}function da(e){this.a=e}function ds(e){this.a=e}function du(e){this.a=e}function dc(e){this.a=e}function dl(e){this.a=e}function df(e){this.a=e}function dd(e){this.a=e}function dh(e){this.a=e}function dp(e){this.a=e}function db(e){this.a=e}function dm(e){this.a=e}function dg(e){this.a=e}function dv(e){this.a=e}function dy(e){this.a=e}function dw(e){this.a=e}function d_(e){this.a=e}function dE(e){this.a=e}function dS(e){this.a=e}function dk(e){this.a=e}function dx(e){this.a=e}function dT(e){this.a=e}function dM(e){this.a=e}function dO(e){this.e=e}function dA(e){this.a=e}function dL(e){this.a=e}function dC(e){this.a=e}function dI(e){this.a=e}function dD(e){this.a=e}function dN(e){this.a=e}function dP(e){this.a=e}function dR(e){this.a=e}function dj(e){this.a=e}function dF(e){this.a=e}function dY(e){this.a=e}function dB(e){this.a=e}function dU(e){this.a=e}function dH(e){this.a=e}function d$(e){this.a=e}function dz(e){this.a=e}function dG(e){this.a=e}function dW(e){this.a=e}function dK(e){this.a=e}function dV(e){this.a=e}function dq(e){this.a=e}function dZ(e){this.a=e}function dX(e){this.a=e}function dJ(e){this.a=e}function dQ(e){this.a=e}function d1(e){this.a=e}function d0(e){this.a=e}function d2(e){this.a=e}function d3(e){this.a=e}function d4(e){this.a=e}function d6(e){this.a=e}function d5(e){this.a=e}function d8(e){this.a=e}function d9(e){this.a=e}function d7(e){this.a=e}function he(e){this.a=e}function ht(e){this.a=e}function hn(e){this.a=e}function hr(e){this.a=e}function hi(e){this.a=e}function ha(e){this.a=e}function ho(e){this.a=e}function hs(e){this.a=e}function hu(e){this.a=e}function hc(e){this.a=e}function hl(e){this.a=e}function hf(e){this.a=e}function hd(e){this.a=e}function hh(e){this.a=e}function hp(e){this.a=e}function hb(e){this.a=e}function hm(e){this.a=e}function hg(e){this.a=e}function hv(e){this.c=e}function hy(e){this.b=e}function hw(e){this.a=e}function h_(e){this.a=e}function hE(e){this.a=e}function hS(e){this.a=e}function hk(e){this.a=e}function hx(e){this.a=e}function hT(e){this.a=e}function hM(e){this.a=e}function hO(e){this.a=e}function hA(e){this.a=e}function hL(e){this.a=e}function hC(e){this.a=e}function hI(e){this.a=e}function hD(e){this.a=e}function hN(e){this.a=e}function hP(e){this.a=e}function hR(e){this.a=e}function hj(e){this.a=e}function hF(e){this.a=e}function hY(e){this.a=e}function hB(e){this.a=e}function hU(e){this.a=e}function hH(e){this.a=e}function h$(e){this.a=e}function hz(e){this.a=e}function hG(e){this.a=e}function hW(e){this.a=e}function hK(e){this.a=e}function hV(e){this.a=e}function hq(e){this.a=e}function hZ(e){this.a=e}function hX(e){this.a=e}function hJ(e){this.a=e}function hQ(e){this.a=e}function h1(e){this.a=e}function h0(e){this.a=e}function h2(e){this.a=e}function h3(e){this.a=e}function h4(e){this.a=e}function h6(e){this.a=e}function h5(e){this.a=e}function h8(e){this.a=e}function h9(e){this.a=e}function h7(e){this.a=e}function pe(e){this.a=e}function pt(e){this.a=e}function pn(e){this.a=e}function pr(e){this.a=e}function pi(e){this.a=e}function pa(e){this.a=e}function po(e){this.a=e}function ps(e){this.a=e}function pu(e){this.a=e}function pc(e){this.a=e}function pl(e){this.a=e}function pf(e){this.a=e}function pd(e){this.a=e}function ph(e){this.a=e}function pp(e){this.a=e}function pb(e){this.a=e}function pm(e){this.a=e}function pg(e){this.a=e}function pv(e){this.a=e}function py(e){this.a=e}function pw(e){this.a=e}function p_(e){this.a=e}function pE(e){this.a=e}function pS(e){this.a=e}function pk(e){this.a=e}function px(e){this.a=e}function pT(e){this.a=e}function pM(e){this.a=e}function pO(e){this.b=e}function pA(e){this.f=e}function pL(e){this.a=e}function pC(e){this.a=e}function pI(e){this.a=e}function pD(e){this.a=e}function pN(e){this.a=e}function pP(e){this.a=e}function pR(e){this.a=e}function pj(e){this.a=e}function pF(e){this.a=e}function pY(e){this.a=e}function pB(e){this.a=e}function pU(e){this.b=e}function pH(e){this.c=e}function p$(e){this.e=e}function pz(e){this.a=e}function pG(e){this.a=e}function pW(e){this.a=e}function pK(e){this.a=e}function pV(e){this.a=e}function pq(e){this.d=e}function pZ(e){this.a=e}function pX(e){this.a=e}function pJ(e){this.e=e}function pQ(){this.a=0}function p1(){TG(this)}function p0(){Tz(this)}function p2(){Yy(this)}function p3(){UP(this)}function p4(){cn(this)}function p6(){this.c=tgK}function p5(e,t){t.Wb(e)}function p8(e,t){e.b+=t}function p9(e){e.b=new gQ}function p7(e){return e.e}function be(e){return e.a}function bt(e){return e.a}function bn(e){return e.a}function br(e){return e.a}function bi(e){return e.a}function ba(){return null}function bo(){return null}function bs(){yC(),eY2()}function bu(e){e.b.tf(e.e)}function bc(e,t){e.b=t-e.b}function bl(e,t){e.a=t-e.a}function bf(e,t){t.ad(e.a)}function bd(e,t){ekv(t,e)}function bh(e,t,n){e.Od(n,t)}function bp(e,t){e.e=t,t.b=e}function bb(e){Dn(),this.a=e}function bm(e){Dn(),this.a=e}function bg(e){Dn(),this.a=e}function bv(e){Bx(),this.a=e}function by(e){$O(),e0E.be(e)}function bw(){O6.call(this)}function b_(){O6.call(this)}function bE(){bw.call(this)}function bS(){bw.call(this)}function bk(){bw.call(this)}function bx(){bw.call(this)}function bT(){bw.call(this)}function bM(){bw.call(this)}function bO(){bw.call(this)}function bA(){bw.call(this)}function bL(){bw.call(this)}function bC(){bw.call(this)}function bI(){bw.call(this)}function bD(){this.a=this}function bN(){this.Bb|=256}function bP(){this.b=new xW}function bR(){bR=A,new p2}function bj(){bE.call(this)}function bF(e,t){e.length=t}function bY(e,t){P_(e.a,t)}function bB(e,t){eEU(e.c,t)}function bU(e,t){Yf(e.b,t)}function bH(e,t){ebB(e.a,t)}function b$(e,t){elj(e.a,t)}function bz(e,t){eam(e.e,t)}function bG(e){exZ(e.c,e.b)}function bW(e,t){e.kc().Nb(t)}function bK(e){this.a=efh(e)}function bV(){this.a=new p2}function bq(){this.a=new p2}function bZ(){this.a=new p0}function bX(){this.a=new p0}function bJ(){this.a=new p0}function bQ(){this.a=new ey}function b1(){this.a=new Z5}function b0(){this.a=new tt}function b2(){this.a=new w7}function b3(){this.a=new W8}function b4(){this.a=new zZ}function b6(){this.a=new Cz}function b5(){this.a=new p0}function b8(){this.a=new p0}function b9(){this.a=new p0}function b7(){this.a=new p0}function me(){this.d=new p0}function mt(){this.a=new bV}function mn(){this.a=new p2}function mr(){this.b=new p2}function mi(){this.b=new p0}function ma(){this.e=new p0}function mo(){this.d=new p0}function ms(){this.a=new cS}function mu(){p0.call(this)}function mc(){bZ.call(this)}function ml(){CK.call(this)}function mf(){b8.call(this)}function md(){mh.call(this)}function mh(){p4.call(this)}function mp(){p4.call(this)}function mb(){mp.call(this)}function mm(){$m.call(this)}function mg(){$m.call(this)}function mv(){mq.call(this)}function my(){mq.call(this)}function mw(){mq.call(this)}function m_(){mZ.call(this)}function mE(){_n.call(this)}function mS(){oZ.call(this)}function mk(){oZ.call(this)}function mx(){m0.call(this)}function mT(){m0.call(this)}function mM(){p2.call(this)}function mO(){p2.call(this)}function mA(){p2.call(this)}function mL(){bV.call(this)}function mC(){en0.call(this)}function mI(){bN.call(this)}function mD(){Oy.call(this)}function mN(){Oy.call(this)}function mP(){p2.call(this)}function mR(){p2.call(this)}function mj(){p2.call(this)}function mF(){sr.call(this)}function mY(){sr.call(this)}function mB(){mF.call(this)}function mU(){u7.call(this)}function mH(e){eti.call(this,e)}function m$(e){eti.call(this,e)}function mz(e){ln.call(this,e)}function mG(e){wB.call(this,e)}function mW(e){mG.call(this,e)}function mK(e){wB.call(this,e)}function mV(){this.a=new _n}function mq(){this.a=new bV}function mZ(){this.a=new p2}function mX(){this.a=new p0}function mJ(){this.j=new p0}function mQ(){this.a=new aX}function m1(){this.a=new y4}function m0(){this.a=new sn}function m2(){m2=A,e0d=new vm}function m3(){m3=A,e0f=new vb}function m4(){m4=A,e0l=new i}function m6(){m6=A,e0m=new OV}function m5(e){mG.call(this,e)}function m8(e){mG.call(this,e)}function m9(e){ql.call(this,e)}function m7(e){ql.call(this,e)}function ge(e){IJ.call(this,e)}function gt(e){eEb.call(this,e)}function gn(e){w$.call(this,e)}function gr(e){wG.call(this,e)}function gi(e){wG.call(this,e)}function ga(e){wG.call(this,e)}function go(e){Fu.call(this,e)}function gs(e){go.call(this,e)}function gu(){lD.call(this,{})}function gc(e){Og(),this.a=e}function gl(e){e.b=null,e.c=0}function gf(e,t){e.e=t,eA8(e,t)}function gd(e,t){e.a=t,eSG(e)}function gh(e,t,n){e.a[t.g]=n}function gp(e,t,n){evq(n,e,t)}function gb(e,t){In(t.i,e.n)}function gm(e,t){esW(e).td(t)}function gg(e,t){return e*e/t}function gv(e,t){return e.g-t.g}function gy(e){return new lI(e)}function gw(e){return new B_(e)}function g_(e){go.call(this,e)}function gE(e){go.call(this,e)}function gS(e){go.call(this,e)}function gk(e){Fu.call(this,e)}function gx(e){eiJ(),this.a=e}function gT(e){I7(),this.a=e}function gM(e){jK(),this.f=e}function gO(e){jK(),this.f=e}function gA(e){go.call(this,e)}function gL(e){go.call(this,e)}function gC(e){go.call(this,e)}function gI(e){go.call(this,e)}function gD(e){go.call(this,e)}function gN(e){return BJ(e),e}function gP(e){return BJ(e),e}function gR(e){return BJ(e),e}function gj(e){return BJ(e),e}function gF(e){return BJ(e),e}function gY(e){return e.b==e.c}function gB(e){return!!e&&e.b}function gU(e){return!!e&&e.k}function gH(e){return!!e&&e.j}function g$(e){BJ(e),this.a=e}function gz(e){return esR(e),e}function gG(e){Ya(e,e.length)}function gW(e){go.call(this,e)}function gK(e){go.call(this,e)}function gV(e){go.call(this,e)}function gq(e){go.call(this,e)}function gZ(e){go.call(this,e)}function gX(e){go.call(this,e)}function gJ(e){AI.call(this,e,0)}function gQ(){G$.call(this,12,3)}function g1(){g1=A,e0_=new _}function g0(){g0=A,e0y=new r}function g2(){g2=A,e0k=new b}function g3(){g3=A,e0M=new g}function g4(){throw p7(new bO)}function g6(){throw p7(new bO)}function g5(){throw p7(new bO)}function g8(){throw p7(new bO)}function g9(){throw p7(new bO)}function g7(){throw p7(new bO)}function ve(){this.a=Lq(Y8(eUd))}function vt(e){Dn(),this.a=Y8(e)}function vn(e,t){e.Td(t),t.Sd(e)}function vr(e,t){e.a.ec().Mc(t)}function vi(e,t,n){e.c.lf(t,n)}function va(e){gE.call(this,e)}function vo(e){gL.call(this,e)}function vs(){fM.call(this,"")}function vu(){fM.call(this,"")}function vc(){fM.call(this,"")}function vl(){fM.call(this,"")}function vf(e){gE.call(this,e)}function vd(e){fF.call(this,e)}function vh(e){O2.call(this,e)}function vp(e){vd.call(this,e)}function vb(){ls.call(this,null)}function vm(){ls.call(this,null)}function vg(){vg=A,$O()}function vv(){vv=A,e2d=eyz()}function vy(e){return e.a?e.b:0}function vw(e){return e.a?e.b:0}function v_(e,t){return e.a-t.a}function vE(e,t){return e.a-t.a}function vS(e,t){return e.a-t.a}function vk(e,t){return QO(e,t)}function vx(e,t){return z8(e,t)}function vT(e,t){return t in e.a}function vM(e,t){return e.f=t,e}function vO(e,t){return e.b=t,e}function vA(e,t){return e.c=t,e}function vL(e,t){return e.g=t,e}function vC(e,t){return e.a=t,e}function vI(e,t){return e.f=t,e}function vD(e,t){return e.k=t,e}function vN(e,t){return e.a=t,e}function vP(e,t){return e.e=t,e}function vR(e,t){return e.e=t,e}function vj(e,t){return e.f=t,e}function vF(e,t){e.b=!0,e.d=t}function vY(e,t){e.b=new TS(t)}function vB(e,t,n){t.td(e.a[n])}function vU(e,t,n){t.we(e.a[n])}function vH(e,t){return e.b-t.b}function v$(e,t){return e.g-t.g}function vz(e,t){return e.s-t.s}function vG(e,t){return e?0:t-1}function vW(e,t){return e?0:t-1}function vK(e,t){return e?t-1:0}function vV(e,t){return t.Yf(e)}function vq(e,t){return e.b=t,e}function vZ(e,t){return e.a=t,e}function vX(e,t){return e.c=t,e}function vJ(e,t){return e.d=t,e}function vQ(e,t){return e.e=t,e}function v1(e,t){return e.f=t,e}function v0(e,t){return e.a=t,e}function v2(e,t){return e.b=t,e}function v3(e,t){return e.c=t,e}function v4(e,t){return e.c=t,e}function v6(e,t){return e.b=t,e}function v5(e,t){return e.d=t,e}function v8(e,t){return e.e=t,e}function v9(e,t){return e.f=t,e}function v7(e,t){return e.g=t,e}function ye(e,t){return e.a=t,e}function yt(e,t){return e.i=t,e}function yn(e,t){return e.j=t,e}function yr(e,t){return e.k=t,e}function yi(e,t){return e.j=t,e}function ya(e,t){e_z(),Gc(t,e)}function yo(e,t,n){jX(e.a,t,n)}function ys(e){U9.call(this,e)}function yu(e){U9.call(this,e)}function yc(e){I3.call(this,e)}function yl(e){efB.call(this,e)}function yf(e){eta.call(this,e)}function yd(e){HO.call(this,e)}function yh(e){HO.call(this,e)}function yp(){MA.call(this,"")}function yb(){this.a=0,this.b=0}function ym(){this.b=0,this.a=0}function yg(e,t){e.b=0,enh(e,t)}function yv(e,t){e.c=t,e.b=!0}function yy(e,t){return e.c._b(t)}function yw(e){return e.e&&e.e()}function y_(e){return e?e.d:null}function yE(e,t){return ecD(e.b,t)}function yS(e){return e?e.g:null}function yk(e){return e?e.i:null}function yx(e){return LW(e),e.o}function yT(){yT=A,tmc=evO()}function yM(){yM=A,tml=ewS()}function yO(){yO=A,tgg=evL()}function yA(){yA=A,tvE=evA()}function yL(){yL=A,tvS=eSH()}function yC(){yC=A,tmF=enF()}function yI(){throw p7(new bO)}function yD(){throw p7(new bO)}function yN(){throw p7(new bO)}function yP(){throw p7(new bO)}function yR(){throw p7(new bO)}function yj(){throw p7(new bO)}function yF(e){this.a=new w9(e)}function yY(e){eF7(),eBh(this,e)}function yB(e){this.a=new FG(e)}function yU(e,t){for(;e.ye(t););}function yH(e,t){for(;e.sd(t););}function y$(e,t){return e.a+=t,e}function yz(e,t){return e.a+=t,e}function yG(e,t){return e.a+=t,e}function yW(e,t){return e.a+=t,e}function yK(e){return B1(e),e.a}function yV(e){return e.b!=e.d.c}function yq(e){return e.l|e.m<<22}function yZ(e,t){return e.d[t.p]}function yX(e,t){return eA6(e,t)}function yJ(e,t,n){e.splice(t,n)}function yQ(e){e.c?eL3(e):eL4(e)}function y1(e){this.a=0,this.b=e}function y0(){this.a=new eAs(e6I)}function y2(){this.b=new eAs(e6T)}function y3(){this.b=new eAs(e6H)}function y4(){this.b=new eAs(e6H)}function y6(){throw p7(new bO)}function y5(){throw p7(new bO)}function y8(){throw p7(new bO)}function y9(){throw p7(new bO)}function y7(){throw p7(new bO)}function we(){throw p7(new bO)}function wt(){throw p7(new bO)}function wn(){throw p7(new bO)}function wr(){throw p7(new bO)}function wi(){throw p7(new bO)}function wa(){throw p7(new bC)}function wo(){throw p7(new bC)}function ws(e){this.a=new wu(e)}function wu(e){erh(this,e,ey0())}function wc(e){return!e||BV(e)}function wl(e){return -1!=tvJ[e]}function wf(){0!=e1Z&&(e1Z=0),e1J=-1}function wd(){null==eUn&&(eUn=[])}function wh(e,t){eTl(H8(e.a),t)}function wp(e,t){eTl(H8(e.a),t)}function wb(e,t){OC.call(this,e,t)}function wm(e,t){wb.call(this,e,t)}function wg(e,t){this.b=e,this.c=t}function wv(e,t){this.b=e,this.a=t}function wy(e,t){this.a=e,this.b=t}function ww(e,t){this.a=e,this.b=t}function w_(e,t){this.a=e,this.b=t}function wE(e,t){this.a=e,this.b=t}function wS(e,t){this.a=e,this.b=t}function wk(e,t){this.a=e,this.b=t}function wx(e,t){this.a=e,this.b=t}function wT(e,t){this.a=e,this.b=t}function wM(e,t){this.b=e,this.a=t}function wO(e,t){this.b=e,this.a=t}function wA(e,t){this.b=e,this.a=t}function wL(e,t){this.b=e,this.a=t}function wC(e,t){this.f=e,this.g=t}function wI(e,t){this.e=e,this.d=t}function wD(e,t){this.g=e,this.i=t}function wN(e,t){this.a=e,this.b=t}function wP(e,t){this.a=e,this.f=t}function wR(e,t){this.b=e,this.c=t}function wj(e,t){this.a=e,this.b=t}function wF(e,t){this.a=e,this.b=t}function wY(e,t){this.a=e,this.b=t}function wB(e){Oq(e.dc()),this.c=e}function wU(e){this.b=Pp(Y8(e),83)}function wH(e){this.a=Pp(Y8(e),83)}function w$(e){this.a=Pp(Y8(e),15)}function wz(e){this.a=Pp(Y8(e),15)}function wG(e){this.b=Pp(Y8(e),47)}function wW(){this.q=new eB4.Date}function wK(){wK=A,e0V=new L}function wV(){wV=A,e2o=new T}function wq(e){return e.f.c+e.g.c}function wZ(e,t){return e.b.Hc(t)}function wX(e,t){return e.b.Ic(t)}function wJ(e,t){return e.b.Qc(t)}function wQ(e,t){return e.b.Hc(t)}function w1(e,t){return e.c.uc(t)}function w0(e,t){return e.a._b(t)}function w2(e,t){return ecX(e.c,t)}function w3(e,t){return F8(e.b,t)}function w4(e,t){return e>t&&t0}function Ei(e,t){return 0>ecd(e,t)}function Ea(e,t){return e.a.get(t)}function Eo(e,t){return t.split(e)}function Es(e,t){return F8(e.e,t)}function Eu(e){return BJ(e),!1}function Ec(e){Gq.call(this,e,21)}function El(e,t){zL.call(this,e,t)}function Ef(e,t){wC.call(this,e,t)}function Ed(e,t){wC.call(this,e,t)}function Eh(e){BT(),IJ.call(this,e)}function Ep(e,t){jA(e,e.length,t)}function Eb(e,t){Yj(e,e.length,t)}function Em(e,t,n){t.ud(e.a.Ge(n))}function Eg(e,t,n){t.we(e.a.Fe(n))}function Ev(e,t,n){t.td(e.a.Kb(n))}function Ey(e,t,n){e.Mb(n)&&t.td(n)}function Ew(e,t,n){e.splice(t,0,n)}function E_(e,t){return Aa(e.e,t)}function EE(e,t){this.d=e,this.e=t}function ES(e,t){this.b=e,this.a=t}function Ek(e,t){this.b=e,this.a=t}function Ex(e,t){this.b=e,this.a=t}function ET(e,t){this.a=e,this.b=t}function EM(e,t){this.a=e,this.b=t}function EO(e,t){this.a=e,this.b=t}function EA(e,t){this.a=e,this.b=t}function EL(e,t){this.a=e,this.b=t}function EC(e,t){this.b=e,this.a=t}function EI(e,t){this.b=e,this.a=t}function ED(e,t){wC.call(this,e,t)}function EN(e,t){wC.call(this,e,t)}function EP(e,t){wC.call(this,e,t)}function ER(e,t){wC.call(this,e,t)}function Ej(e,t){wC.call(this,e,t)}function EF(e,t){wC.call(this,e,t)}function EY(e,t){wC.call(this,e,t)}function EB(e,t){wC.call(this,e,t)}function EU(e,t){wC.call(this,e,t)}function EH(e,t){wC.call(this,e,t)}function E$(e,t){wC.call(this,e,t)}function Ez(e,t){wC.call(this,e,t)}function EG(e,t){wC.call(this,e,t)}function EW(e,t){wC.call(this,e,t)}function EK(e,t){wC.call(this,e,t)}function EV(e,t){wC.call(this,e,t)}function Eq(e,t){wC.call(this,e,t)}function EZ(e,t){wC.call(this,e,t)}function EX(e,t){this.a=e,this.b=t}function EJ(e,t){this.a=e,this.b=t}function EQ(e,t){this.a=e,this.b=t}function E1(e,t){this.a=e,this.b=t}function E0(e,t){this.a=e,this.b=t}function E2(e,t){this.a=e,this.b=t}function E3(e,t){this.a=e,this.b=t}function E4(e,t){this.a=e,this.b=t}function E6(e,t){this.a=e,this.b=t}function E5(e,t){this.b=e,this.a=t}function E8(e,t){this.b=e,this.a=t}function E9(e,t){this.b=e,this.a=t}function E7(e,t){this.b=e,this.a=t}function Se(e,t){this.c=e,this.d=t}function St(e,t){this.e=e,this.d=t}function Sn(e,t){this.a=e,this.b=t}function Sr(e,t){this.b=t,this.c=e}function Si(e,t){wC.call(this,e,t)}function Sa(e,t){wC.call(this,e,t)}function So(e,t){wC.call(this,e,t)}function Ss(e,t){wC.call(this,e,t)}function Su(e,t){wC.call(this,e,t)}function Sc(e,t){wC.call(this,e,t)}function Sl(e,t){wC.call(this,e,t)}function Sf(e,t){wC.call(this,e,t)}function Sd(e,t){wC.call(this,e,t)}function Sh(e,t){wC.call(this,e,t)}function Sp(e,t){wC.call(this,e,t)}function Sb(e,t){wC.call(this,e,t)}function Sm(e,t){wC.call(this,e,t)}function Sg(e,t){wC.call(this,e,t)}function Sv(e,t){wC.call(this,e,t)}function Sy(e,t){wC.call(this,e,t)}function Sw(e,t){wC.call(this,e,t)}function S_(e,t){wC.call(this,e,t)}function SE(e,t){wC.call(this,e,t)}function SS(e,t){wC.call(this,e,t)}function Sk(e,t){wC.call(this,e,t)}function Sx(e,t){wC.call(this,e,t)}function ST(e,t){wC.call(this,e,t)}function SM(e,t){wC.call(this,e,t)}function SO(e,t){wC.call(this,e,t)}function SA(e,t){wC.call(this,e,t)}function SL(e,t){wC.call(this,e,t)}function SC(e,t){wC.call(this,e,t)}function SI(e,t){wC.call(this,e,t)}function SD(e,t){wC.call(this,e,t)}function SN(e,t){wC.call(this,e,t)}function SP(e,t){wC.call(this,e,t)}function SR(e,t){wC.call(this,e,t)}function Sj(e,t){wC.call(this,e,t)}function SF(e,t){this.b=e,this.a=t}function SY(e,t){this.a=e,this.b=t}function SB(e,t){this.a=e,this.b=t}function SU(e,t){this.a=e,this.b=t}function SH(e,t){this.a=e,this.b=t}function S$(e,t){wC.call(this,e,t)}function Sz(e,t){wC.call(this,e,t)}function SG(e,t){this.b=e,this.d=t}function SW(e,t){wC.call(this,e,t)}function SK(e,t){wC.call(this,e,t)}function SV(e,t){this.a=e,this.b=t}function Sq(e,t){this.a=e,this.b=t}function SZ(e,t){wC.call(this,e,t)}function SX(e,t){wC.call(this,e,t)}function SJ(e,t){wC.call(this,e,t)}function SQ(e,t){wC.call(this,e,t)}function S1(e,t){wC.call(this,e,t)}function S0(e,t){wC.call(this,e,t)}function S2(e,t){wC.call(this,e,t)}function S3(e,t){wC.call(this,e,t)}function S4(e,t){wC.call(this,e,t)}function S6(e,t){wC.call(this,e,t)}function S5(e,t){wC.call(this,e,t)}function S8(e,t){wC.call(this,e,t)}function S9(e,t){wC.call(this,e,t)}function S7(e,t){wC.call(this,e,t)}function ke(e,t){wC.call(this,e,t)}function kt(e,t){wC.call(this,e,t)}function kn(e,t){return Aa(e.c,t)}function kr(e,t){return Aa(t.b,e)}function ki(e,t){return-e.b.Je(t)}function ka(e,t){return Aa(e.g,t)}function ko(e,t){wC.call(this,e,t)}function ks(e,t){wC.call(this,e,t)}function ku(e,t){this.a=e,this.b=t}function kc(e,t){this.a=e,this.b=t}function kl(e,t){this.a=e,this.b=t}function kf(e,t){wC.call(this,e,t)}function kd(e,t){wC.call(this,e,t)}function kh(e,t){wC.call(this,e,t)}function kp(e,t){wC.call(this,e,t)}function kb(e,t){wC.call(this,e,t)}function km(e,t){wC.call(this,e,t)}function kg(e,t){wC.call(this,e,t)}function kv(e,t){wC.call(this,e,t)}function ky(e,t){wC.call(this,e,t)}function kw(e,t){wC.call(this,e,t)}function k_(e,t){wC.call(this,e,t)}function kE(e,t){wC.call(this,e,t)}function kS(e,t){wC.call(this,e,t)}function kk(e,t){wC.call(this,e,t)}function kx(e,t){wC.call(this,e,t)}function kT(e,t){wC.call(this,e,t)}function kM(e,t){this.a=e,this.b=t}function kO(e,t){this.a=e,this.b=t}function kA(e,t){this.a=e,this.b=t}function kL(e,t){this.a=e,this.b=t}function kC(e,t){this.a=e,this.b=t}function kI(e,t){this.a=e,this.b=t}function kD(e,t){this.a=e,this.b=t}function kN(e,t){wC.call(this,e,t)}function kP(e,t){this.a=e,this.b=t}function kR(e,t){this.a=e,this.b=t}function kj(e,t){this.a=e,this.b=t}function kF(e,t){this.a=e,this.b=t}function kY(e,t){this.a=e,this.b=t}function kB(e,t){this.a=e,this.b=t}function kU(e,t){this.b=e,this.a=t}function kH(e,t){this.b=e,this.a=t}function k$(e,t){this.b=e,this.a=t}function kz(e,t){this.b=e,this.a=t}function kG(e,t){this.a=e,this.b=t}function kW(e,t){this.a=e,this.b=t}function kK(e,t){eOU(e.a,Pp(t,56))}function kV(e,t){QM(e.a,Pp(t,11))}function kq(e,t){return Pj(),t!=e}function kZ(){return vv(),new e2d}function kX(){Gk(),this.b=new bV}function kJ(){eAV(),this.a=new bV}function kQ(){Gy(),jG.call(this)}function k1(e,t){wC.call(this,e,t)}function k0(e,t){this.a=e,this.b=t}function k2(e,t){this.a=e,this.b=t}function k3(e,t){this.a=e,this.b=t}function k4(e,t){this.a=e,this.b=t}function k6(e,t){this.a=e,this.b=t}function k5(e,t){this.a=e,this.b=t}function k8(e,t){this.d=e,this.b=t}function k9(e,t){this.d=e,this.e=t}function k7(e,t){this.f=e,this.c=t}function xe(e,t){this.b=e,this.c=t}function xt(e,t){this.i=e,this.g=t}function xn(e,t){this.e=e,this.a=t}function xr(e,t){this.a=e,this.b=t}function xi(e,t){e.i=null,erA(e,t)}function xa(e,t){e&&Um(tmR,e,t)}function xo(e,t){return edG(e.a,t)}function xs(e){return edK(e.c,e.b)}function xu(e){return e?e.dd():null}function xc(e){return null==e?null:e}function xl(e){return typeof e===eUi}function xf(e){return typeof e===eUa}function xd(e){return typeof e===eUo}function xh(e,t){return e.Hd().Xb(t)}function xp(e,t){return ei7(e.Kc(),t)}function xb(e,t){return 0==ecd(e,t)}function xm(e,t){return ecd(e,t)>=0}function xg(e,t){return 0!=ecd(e,t)}function xv(e){return""+(BJ(e),e)}function xy(e,t){return e.substr(t)}function xw(e){return efH(e),e.d.gc()}function x_(e){return eTe(e,e.c),e}function xE(e){return Rb(null==e),e}function xS(e,t){return e.a+=""+t,e}function xk(e,t){return e.a+=""+t,e}function xx(e,t){return e.a+=""+t,e}function xT(e,t){return e.a+=""+t,e}function xM(e,t){return e.a+=""+t,e}function xO(e,t){return e.a+=""+t,e}function xA(e,t){qQ(e,t,e.a,e.a.a)}function xL(e,t){qQ(e,t,e.c.b,e.c)}function xC(e,t,n){eyc(t,eSE(e,n))}function xI(e,t,n){eyc(t,eSE(e,n))}function xD(e,t){eeS(new Ow(e),t)}function xN(e,t){e.q.setTime(Kj(t))}function xP(e,t){FH.call(this,e,t)}function xR(e,t){FH.call(this,e,t)}function xj(e,t){FH.call(this,e,t)}function xF(e){Yy(this),eij(this,e)}function xY(e){return GK(e,0),null}function xB(e){return e.a=0,e.b=0,e}function xU(e,t){return e.a=t.g+1,e}function xH(e,t){return 2==e.j[t.p]}function x$(e){return YZ(Pp(e,79))}function xz(){xz=A,e4r=euY(epE())}function xG(){xG=A,e7$=euY(eAn())}function xW(){this.b=new w9(ee0(12))}function xK(){this.b=0,this.a=!1}function xV(){this.b=0,this.a=!1}function xq(e){this.a=e,ci.call(this)}function xZ(e){this.a=e,ci.call(this)}function xX(e,t){Cm.call(this,e,t)}function xJ(e,t){Ii.call(this,e,t)}function xQ(e,t){xt.call(this,e,t)}function x1(e,t){eaN.call(this,e,t)}function x0(e,t){AA.call(this,e,t)}function x2(e,t){_6(),Um(tmU,e,t)}function x3(e,t){return Az(e.a,0,t)}function x4(e,t){return e.a.a.a.cc(t)}function x6(e,t){return xc(e)===xc(t)}function x5(e,t){return elN(e.a,t.a)}function x8(e,t){return ME(e.a,t.a)}function x9(e,t){return YM(e.a,t.a)}function x7(e,t){return e.indexOf(t)}function Te(e,t){return e==t?0:e?1:-1}function Tt(e){return e<10?"0"+e:""+e}function Tn(e){return Y8(e),new xq(e)}function Tr(e){return Mk(e.l,e.m,e.h)}function Ti(e){return zy((BJ(e),e))}function Ta(e){return zy((BJ(e),e))}function To(e,t){return ME(e.g,t.g)}function Ts(e){return typeof e===eUa}function Tu(e){return e==e9f||e==e9p}function Tc(e){return e==e9f||e==e9d}function Tl(e){return QI(e.b.b,e,0)}function Tf(e){this.a=kZ(),this.b=e}function Td(e){this.a=kZ(),this.b=e}function Th(e,t){return P_(e.a,t),t}function Tp(e,t){return P_(e.c,t),e}function Tb(e,t){return eat(e.a,t),e}function Tm(e,t){return Dj(),t.a+=e}function Tg(e,t){return Dj(),t.a+=e}function Tv(e,t){return Dj(),t.c+=e}function Ty(e,t){Qe(e,0,e.length,t)}function Tw(){fJ.call(this,new qh)}function T_(){jp.call(this,0,0,0,0)}function TE(){Hr.call(this,0,0,0,0)}function TS(e){this.a=e.a,this.b=e.b}function Tk(e){return e==tpm||e==tpg}function Tx(e){return e==tpy||e==tpb}function TT(e){return e==tss||e==tso}function TM(e){return e!=tbc&&e!=tbl}function TO(e){return e.Lg()&&e.Mg()}function TA(e){return UB(Pp(e,118))}function TL(e){return eat(new K2,e)}function TC(e,t){return new eaN(t,e)}function TI(e,t){return new eaN(t,e)}function TD(e,t,n){ent(e,t),enn(e,n)}function TN(e,t,n){ena(e,t),eni(e,n)}function TP(e,t,n){eno(e,t),ens(e,n)}function TR(e,t,n){enr(e,t),enc(e,n)}function Tj(e,t,n){enu(e,t),enl(e,n)}function TF(e,t){euc(e,t),enp(e,e.D)}function TY(e){k7.call(this,e,!0)}function TB(e,t,n){L3.call(this,e,t,n)}function TU(e){eLQ(),ead.call(this,e)}function TH(){Ef.call(this,"Head",1)}function T$(){Ef.call(this,"Tail",3)}function Tz(e){e.c=Je(e1R,eUp,1,0,5,1)}function TG(e){e.a=Je(e1R,eUp,1,8,5,1)}function TW(e){ety(e.xf(),new dh(e))}function TK(e){return null!=e?esj(e):0}function TV(e,t){return etg(t,zY(e))}function Tq(e,t){return etg(t,zY(e))}function TZ(e,t){return e[e.length]=t}function TX(e,t){return e[e.length]=t}function TJ(e){return Ph(e.b.Kc(),e.a)}function TQ(e,t){return erb(Bi(e.d),t)}function T1(e,t){return erb(Bi(e.g),t)}function T0(e,t){return erb(Bi(e.j),t)}function T2(e,t){Cm.call(this,e.b,t)}function T3(e){jp.call(this,e,e,e,e)}function T4(e){return e.b&&ePE(e),e.a}function T6(e){return e.b&&ePE(e),e.c}function T5(e,t){!e2M&&(e.b=t)}function T8(e,t,n){return Bc(e,t,n),n}function T9(e,t,n){Bc(e.c[t.g],t.g,n)}function T7(e,t,n){Pp(e.c,69).Xh(t,n)}function Me(e,t,n){TP(n,n.i+e,n.j+t)}function Mt(e,t){JL(qt(e.a),Gj(t))}function Mn(e,t){JL(QX(e.a),GF(t))}function Mr(e){eBG(),pJ.call(this,e)}function Mi(e){return null==e?0:esj(e)}function Ma(){Ma=A,tuT=new efY(e68)}function Mo(){Mo=A,new Ms,new p0}function Ms(){new p2,new p2,new p2}function Mu(){Mu=A,bR(),e0S=new p2}function Mc(){Mc=A,eB4.Math.log(2)}function Ml(){Ml=A,tgZ=(_Z(),tmE)}function Mf(){throw p7(new gW(e1O))}function Md(){throw p7(new gW(e1O))}function Mh(){throw p7(new gW(e1A))}function Mp(){throw p7(new gW(e1A))}function Mb(e){this.a=e,PS.call(this,e)}function Mm(e){this.a=e,wU.call(this,e)}function Mg(e){this.a=e,wU.call(this,e)}function Mv(e,t){jM(e.c,e.c.length,t)}function My(e){return e.at?1:0}function MS(e,t){return ecd(e,t)>0?e:t}function Mk(e,t,n){return{l:e,m:t,h:n}}function Mx(e,t){null!=e.a&&kV(t,e.a)}function MT(e){e.a=new C,e.c=new C}function MM(e){this.b=e,this.a=new p0}function MO(e){this.b=new e1,this.a=e}function MA(e){CW.call(this),this.a=e}function ML(){Ef.call(this,"Range",2)}function MC(){evR(),this.a=new eAs(e4k)}function MI(e,t){Y8(t),Uz(e).Jc(new d)}function MD(e,t){return GE(),t.n.b+=e}function MN(e,t,n){return Um(e.g,n,t)}function MP(e,t,n){return Um(e.k,n,t)}function MR(e,t){return Um(e.a,t.a,t)}function Mj(e,t,n){return eho(t,n,e.c)}function MF(e){return new kl(e.c,e.d)}function MY(e){return new kl(e.c,e.d)}function MB(e){return new kl(e.a,e.b)}function MU(e,t){return ej9(e.a,t,null)}function MH(e){Gs(e,null),Go(e,null)}function M$(e){GA(e,null),GL(e,null)}function Mz(){AA.call(this,null,null)}function MG(){AL.call(this,null,null)}function MW(e){this.a=e,p2.call(this)}function MK(e){this.b=(Hj(),new f$(e))}function MV(e){e.j=Je(e19,eUP,310,0,0,1)}function Mq(e,t,n){e.c.Vc(t,Pp(n,133))}function MZ(e,t,n){e.c.ji(t,Pp(n,133))}function MX(e,t){eRT(e),e.Gc(Pp(t,15))}function MJ(e,t){return eR4(e.c,e.b,t)}function MQ(e,t){return new O5(e.Kc(),t)}function M1(e,t){return -1!=eoD(e.Kc(),t)}function M0(e,t){return null!=e.a.Bc(t)}function M2(e){return e.Ob()?e.Pb():null}function M3(e){return ehv(e,0,e.length)}function M4(e,t){return null!=e&&ebs(e,t)}function M6(e,t){e.q.setHours(t),eNq(e,t)}function M5(e,t){e.c&&(Re(t),zd(t))}function M8(e,t,n){Pp(e.Kb(n),164).Nb(t)}function M9(e,t,n){return ejq(e,t,n),n}function M7(e,t,n){e.a=1502^t,e.b=n^e$d}function Oe(e,t,n){return e.a[t.g][n.g]}function Ot(e,t){return e.a[t.c.p][t.p]}function On(e,t){return e.e[t.c.p][t.p]}function Or(e,t){return e.c[t.c.p][t.p]}function Oi(e,t){return e.j[t.p]=eOo(t)}function Oa(e,t){return ZZ(e.f,t.tg())}function Oo(e,t){return ZZ(e.b,t.tg())}function Os(e,t){return e.a0?t*t/e:t*t*100}function Li(e,t){return e>0?t/(e*e):100*t}function La(e,t,n){return P_(t,ef6(e,n))}function Lo(e,t,n){J1(),e.Xe(t)&&n.td(e)}function Ls(e,t,n){var r;(r=e.Zc(t)).Rb(n)}function Lu(e,t,n){return e.a+=t,e.b+=n,e}function Lc(e,t,n){return e.a*=t,e.b*=n,e}function Ll(e,t,n){return e.a-=t,e.b-=n,e}function Lf(e,t){return e.a=t.a,e.b=t.b,e}function Ld(e){return e.a=-e.a,e.b=-e.b,e}function Lh(e){this.c=e,this.a=1,this.b=1}function Lp(e){this.c=e,eno(e,0),ens(e,0)}function Lb(e){_n.call(this),enD(this,e)}function Lm(e){eBp(),p9(this),this.mf(e)}function Lg(e,t){_0(),AA.call(this,e,t)}function Lv(e,t){_2(),AL.call(this,e,t)}function Ly(e,t){_2(),AL.call(this,e,t)}function Lw(e,t){_2(),Lv.call(this,e,t)}function L_(e,t,n){JY.call(this,e,t,n,2)}function LE(e,t){Ml(),jd.call(this,e,t)}function LS(e,t){Ml(),LE.call(this,e,t)}function Lk(e,t){Ml(),LE.call(this,e,t)}function Lx(e,t){Ml(),Lk.call(this,e,t)}function LT(e,t){Ml(),jd.call(this,e,t)}function LM(e,t){Ml(),LT.call(this,e,t)}function LO(e,t){Ml(),jd.call(this,e,t)}function LA(e,t){return e.c.Fc(Pp(t,133))}function LL(e,t,n){return eP8(Qq(e,t),n)}function LC(e,t,n){return t.Qk(e.e,e.c,n)}function LI(e,t,n){return t.Rk(e.e,e.c,n)}function LD(e,t){return ecv(e.e,Pp(t,49))}function LN(e,t,n){elm(QX(e.a),t,GF(n))}function LP(e,t,n){elm(qt(e.a),t,Gj(n))}function LR(e,t){t.$modCount=e.$modCount}function Lj(){Lj=A,tcV=new pO("root")}function LF(){LF=A,tmB=new mx,new mT}function LY(){this.a=new zu,this.b=new zu}function LB(){en0.call(this),this.Bb|=eH3}function LU(){wC.call(this,"GROW_TREE",0)}function LH(e){return null==e?null:eYt(e)}function L$(e){return null==e?null:eEO(e)}function Lz(e){return null==e?null:efF(e)}function LG(e){return null==e?null:efF(e)}function LW(e){null==e.o&&eMb(e)}function LK(e){return Rb(null==e||xl(e)),e}function LV(e){return Rb(null==e||xf(e)),e}function Lq(e){return Rb(null==e||xd(e)),e}function LZ(e){this.q=new eB4.Date(Kj(e))}function LX(e,t){this.c=e,wI.call(this,e,t)}function LJ(e,t){this.a=e,LX.call(this,e,t)}function LQ(e,t){this.d=e,f_(this),this.b=t}function L1(e,t){Jo.call(this,e),this.a=t}function L0(e,t){Jo.call(this,e),this.a=t}function L2(e){edL.call(this,0,0),this.f=e}function L3(e,t,n){XS.call(this,e,t,n,null)}function L4(e,t,n){XS.call(this,e,t,n,null)}function L6(e,t,n){return 0>=e.ue(t,n)?n:t}function L5(e,t,n){return 0>=e.ue(t,n)?t:n}function L8(e,t){return Pp(eef(e.b,t),149)}function L9(e,t){return Pp(eef(e.c,t),229)}function L7(e){return Pp(RJ(e.a,e.b),287)}function Ce(e){return new kl(e.c,e.d+e.a)}function Ct(e){return GE(),TT(Pp(e,197))}function Cn(){Cn=A,e4i=el8((ed5(),tbq))}function Cr(e,t){t.a?eLc(e,t):Ai(e.a,t.b)}function Ci(e,t){!e2M&&P_(e.a,t)}function Ca(e,t){return _k(),eag(t.d.i,e)}function Co(e,t){return erJ(),new eIu(t,e)}function Cs(e,t){return $C(t,ezr),e.f=t,e}function Cu(e,t,n){return n=eDg(e,t,3,n)}function Cc(e,t,n){return n=eDg(e,t,6,n)}function Cl(e,t,n){return n=eDg(e,t,9,n)}function Cf(e,t,n){++e.j,e.Ki(),X9(e,t,n)}function Cd(e,t,n){++e.j,e.Hi(t,e.oi(t,n))}function Ch(e,t,n){var r;(r=e.Zc(t)).Rb(n)}function Cp(e,t,n){return ePT(e.c,e.b,t,n)}function Cb(e,t){return(t&eUu)%e.d.length}function Cm(e,t){pO.call(this,e),this.a=t}function Cg(e,t){pH.call(this,e),this.a=t}function Cv(e,t){pH.call(this,e),this.a=t}function Cy(e,t){this.c=e,eta.call(this,t)}function Cw(e,t){this.a=e,pU.call(this,t)}function C_(e,t){this.a=e,pU.call(this,t)}function CE(e){this.a=(enG(e,eU3),new XM(e))}function CS(e){this.a=(enG(e,eU3),new XM(e))}function Ck(e){return e.a||(e.a=new h),e.a}function Cx(e){return e>8?0:e+1}function CT(e,t){return OQ(),e==t?0:e?1:-1}function CM(e,t,n){return jT(e,Pp(t,22),n)}function CO(e,t,n){return e.apply(t,n)}function CA(e,t,n){return e.a+=ehv(t,0,n),e}function CL(e,t){var n;return n=e.e,e.e=t,n}function CC(e,t){var n;(n=e[e$c]).call(e,t)}function CI(e,t){var n;(n=e[e$c]).call(e,t)}function CD(e,t){e.a.Vc(e.b,t),++e.b,e.c=-1}function CN(e){Yy(e.e),e.d.b=e.d,e.d.a=e.d}function CP(e){e.b?CP(e.b):e.f.c.zc(e.e,e.d)}function CR(e,t,n){_w(),lP(e,t.Ce(e.a,n))}function Cj(e,t){return y_(ehn(e.a,t,!0))}function CF(e,t){return y_(ehr(e.a,t,!0))}function CY(e,t){return vk(Array(t),e)}function CB(e){return String.fromCharCode(e)}function CU(e){return null==e?null:e.message}function CH(){this.a=new p0,this.b=new p0}function C$(){this.a=new tt,this.b=new bP}function Cz(){this.b=new yb,this.c=new p0}function CG(){this.d=new yb,this.e=new yb}function CW(){this.n=new yb,this.o=new yb}function CK(){this.n=new mp,this.i=new TE}function CV(){this.a=new cg,this.b=new i_}function Cq(){this.a=new p0,this.d=new p0}function CZ(){this.b=new bV,this.a=new bV}function CX(){this.b=new p2,this.a=new p2}function CJ(){this.b=new y2,this.a=new ay}function CQ(){CK.call(this),this.a=new yb}function C1(e){eaD.call(this,e,(Qu(),e2D))}function C0(e,t,n,r){jp.call(this,e,t,n,r)}function C2(e,t,n){null!=n&&ern(t,emI(e,n))}function C3(e,t,n){null!=n&&err(t,emI(e,n))}function C4(e,t,n){return n=eDg(e,t,11,n)}function C6(e,t){return e.a+=t.a,e.b+=t.b,e}function C5(e,t){return e.a-=t.a,e.b-=t.b,e}function C8(e,t){return e.n.a=(BJ(t),t+10)}function C9(e,t){return e.n.a=(BJ(t),t+10)}function C7(e,t){return t==e||ev8(eOg(t),e)}function Ie(e,t){return null==Um(e.a,t,"")}function It(e,t){return _k(),!eag(t.d.i,e)}function In(e,t){Tk(e.f)?eMi(e,t):ewz(e,t)}function Ir(e,t){var n;return t.Hh(e.a)}function Ii(e,t){gE.call(this,eJT+e+eXH+t)}function Ia(e,t,n,r){FQ.call(this,e,t,n,r)}function Io(e,t,n,r){FQ.call(this,e,t,n,r)}function Is(e,t,n,r){Io.call(this,e,t,n,r)}function Iu(e,t,n,r){F1.call(this,e,t,n,r)}function Ic(e,t,n,r){F1.call(this,e,t,n,r)}function Il(e,t,n,r){F1.call(this,e,t,n,r)}function If(e,t,n,r){Ic.call(this,e,t,n,r)}function Id(e,t,n,r){Ic.call(this,e,t,n,r)}function Ih(e,t,n,r){Il.call(this,e,t,n,r)}function Ip(e,t,n,r){Id.call(this,e,t,n,r)}function Ib(e,t,n,r){FZ.call(this,e,t,n,r)}function Im(e,t,n){this.a=e,AI.call(this,t,n)}function Ig(e,t,n){this.c=t,this.b=n,this.a=e}function Iv(e,t,n){return e.d=Pp(t.Kb(n),164)}function Iy(e,t){return e.Aj().Nh().Kh(e,t)}function Iw(e,t){return e.Aj().Nh().Ih(e,t)}function I_(e,t){return BJ(e),xc(e)===xc(t)}function IE(e,t){return BJ(e),xc(e)===xc(t)}function IS(e,t){return y_(ehn(e.a,t,!1))}function Ik(e,t){return y_(ehr(e.a,t,!1))}function Ix(e,t){return e.b.sd(new EM(e,t))}function IT(e,t){return e.b.sd(new EO(e,t))}function IM(e,t){return e.b.sd(new EA(e,t))}function IO(e,t,n){return e.lastIndexOf(t,n)}function IA(e,t,n){return elN(e[t.b],e[n.b])}function IL(e,t){return eo3(t,(eBy(),tat),e)}function IC(e,t){return ME(t.a.d.p,e.a.d.p)}function II(e,t){return ME(e.a.d.p,t.a.d.p)}function ID(e,t){return elN(e.c-e.s,t.c-t.s)}function IN(e){return e.c?QI(e.c.a,e,0):-1}function IP(e){return e<100?null:new yf(e)}function IR(e){return e==tba||e==tbs||e==tbo}function Ij(e,t){return M4(t,15)&&eCc(e.c,t)}function IF(e,t){!e2M&&t&&(e.d=t)}function IY(e,t){var n;return!!esq(e,n=t)}function IB(e,t){this.c=e,YC.call(this,e,t)}function IU(e){this.c=e,xj.call(this,eUY,0)}function IH(e,t){Px.call(this,e,e.length,t)}function I$(e,t,n){return Pp(e.c,69).lk(t,n)}function Iz(e,t,n){return Pp(e.c,69).mk(t,n)}function IG(e,t,n){return LC(e,Pp(t,332),n)}function IW(e,t,n){return LI(e,Pp(t,332),n)}function IK(e,t,n){return ey1(e,Pp(t,332),n)}function IV(e,t,n){return e_t(e,Pp(t,332),n)}function Iq(e,t){return null==t?null:ecA(e.b,t)}function IZ(e){return xf(e)?(BJ(e),e):e.ke()}function IX(e){return!isNaN(e)&&!isFinite(e)}function IJ(e){Dn(),this.a=(Hj(),new vd(e))}function IQ(e){Pj(),this.d=e,this.a=new p1}function I1(e,t,n){this.a=e,this.b=t,this.c=n}function I0(e,t,n){this.a=e,this.b=t,this.c=n}function I2(e,t,n){this.d=e,this.b=n,this.a=t}function I3(e){MT(this),HC(this),er7(this,e)}function I4(e){Tz(this),PO(this.c,0,e.Pc())}function I6(e){BH(e.a),Jl(e.c,e.b),e.b=null}function I5(e){this.a=e,wK(),eap(Date.now())}function I8(){I8=A,e2G=new r,e2W=new r}function I9(){I9=A,e2h=new I,e2p=new D}function I7(){I7=A,tmY=Je(e1R,eUp,1,0,5,1)}function De(){De=A,tgH=Je(e1R,eUp,1,0,5,1)}function Dt(){Dt=A,tg$=Je(e1R,eUp,1,0,5,1)}function Dn(){Dn=A,new bb((Hj(),Hj(),e2r))}function Dr(e){return Qu(),eeM((Qc(),e2j),e)}function Di(e){return eum(),eeM((XC(),e2$),e)}function Da(e){return epC(),eeM((qk(),e3d),e)}function Do(e){return eeR(),eeM((qx(),e3b),e)}function Ds(e){return eCp(),eeM((eaF(),e3I),e)}function Du(e){return etx(),eeM((XO(),e3R),e)}function Dc(e){return Qs(),eeM((XA(),e3B),e)}function Dl(e){return QQ(),eeM((XL(),e3z),e)}function Df(e){return eBW(),eeM((xz(),e4r),e)}function Dd(e){return eaY(),eeM((Qf(),e4l),e)}function Dh(e){return ep7(),eeM((Qd(),e4b),e)}function Dp(e){return ebe(),eeM((Qh(),e5z),e)}function Db(e){return _y(),eeM((Vt(),e5W),e)}function Dm(e){return eej(),eeM((qT(),e8h),e)}function Dg(e){return QJ(),eeM((XI(),e85),e)}function Dv(e){return e_x(),eeM((eeW(),e9a),e)}function Dy(e){return eok(),eeM((Ql(),e9b),e)}function Dw(e){return ec4(),eeM((XD(),e9T),e)}function D_(e,t){if(!e)throw p7(new gL(t))}function DE(e){return eEn(),eeM((etQ(),e9R),e)}function DS(e){jp.call(this,e.d,e.c,e.a,e.b)}function Dk(e){jp.call(this,e.d,e.c,e.a,e.b)}function Dx(e,t,n){this.b=e,this.c=t,this.a=n}function DT(e,t,n){this.b=e,this.a=t,this.c=n}function DM(e,t,n){this.a=e,this.b=t,this.c=n}function DO(e,t,n){this.a=e,this.b=t,this.c=n}function DA(e,t,n){this.a=e,this.b=t,this.c=n}function DL(e,t,n){this.a=e,this.b=t,this.c=n}function DC(e,t,n){this.b=e,this.a=t,this.c=n}function DI(e,t,n){this.e=t,this.b=e,this.d=n}function DD(e,t,n){return _w(),e.a.Od(t,n),t}function DN(e){var t;return(t=new ew).e=e,t}function DP(e){var t;return(t=new me).b=e,t}function DR(){DR=A,e9V=new nd,e9q=new nh}function Dj(){Dj=A,e76=new rB,e75=new rU}function DF(e){return eoE(),eeM((Qb(),e7X),e)}function DY(e){return eoS(),eeM((Qg(),tet),e)}function DB(e){return eLz(),eeM((ei3(),tek),e)}function DU(e){return eSg(),eeM((et2(),teI),e)}function DH(e){return Jp(),eeM((qI(),teP),e)}function D$(e){return en7(),eeM((XN(),teY),e)}function Dz(e){return ey4(),eeM((eeU(),tes),e)}function DG(e){return erX(),eeM((Xj(),teb),e)}function DW(e){return enB(),eeM((XP(),te$),e)}function DK(e){return eb5(),eeM((eeY(),teq),e)}function DV(e){return eeF(),eeM((qO(),teJ),e)}function Dq(e){return eoG(),eeM((XR(),te2),e)}function DZ(e){return eEf(),eeM((et5(),te7),e)}function DX(e){return Qx(),eeM((qA(),ttn),e)}function DJ(e){return eyd(),eeM((et4(),ttc),e)}function DQ(e){return e_3(),eeM((et3(),ttm),e)}function D1(e){return eLR(),eeM((eoH(),ttM),e)}function D0(e){return eaU(),eeM((XY(),ttC),e)}function D2(e){return Q1(),eeM((XF(),ttP),e)}function D3(e){return K5(),eeM((qD(),ttF),e)}function D4(e){return ef_(),eeM((eeH(),tnF),e)}function D6(e){return ewY(),eeM((et6(),tst),e)}function D5(e){return euJ(),eeM((XB(),tsa),e)}function D8(e){return ebk(),eeM((Qv(),tsl),e)}function D9(e){return enY(),eeM((X$(),tsR),e)}function D7(e){return eOJ(),eeM((ei2(),tsx),e)}function Ne(e){return esn(),eeM((XH(),tsA),e)}function Nt(e){return Q0(),eeM((qC(),tsI),e)}function Nn(e){return ei0(),eeM((XU(),tsB),e)}function Nr(e){return ebG(),eeM((eeB(),tsm),e)}function Ni(e){return Xo(),eeM((qL(),ts$),e)}function Na(e){return euy(),eeM((XG(),tsK),e)}function No(e){return eiO(),eeM((XW(),tsX),e)}function Ns(e){return eox(),eeM((Xz(),ts0),e)}function Nu(e){return enU(),eeM((XK(),tuo),e)}function Nc(e){return qG(),eeM((qP(),tud),e)}function Nl(e){return zs(),eeM((qR(),tu_),e)}function Nf(e){return zQ(),eeM((qj(),tuk),e)}function Nd(e){return Xa(),eeM((qN(),tu$),e)}function Nh(e){return zo(),eeM((qF(),tuX),e)}function Np(e){return egR(),eeM((Qp(),tu2),e)}function Nb(e){return eS_(),eeM((et8(),tu7),e)}function Nm(e){return z1(),eeM((qU(),tcB),e)}function Ng(e){return erZ(),eeM((qB(),tcX),e)}function Nv(e){return Kn(),eeM((qY(),tc$),e)}function Ny(e){return efx(),eeM((XV(),tc0),e)}function Nw(e){return J0(),eeM((qH(),tc4),e)}function N_(e){return eub(),eeM((Xq(),tc9),e)}function NE(e){return emC(),eeM((Qm(),tlA),e)}function NS(e){return ei1(),eeM((XX(),tlD),e)}function Nk(e){return efS(),eeM((XZ(),tlj),e)}function Nx(e){return eOB(),eeM((eeG(),tfl),e)}function NT(e){return efk(),eeM((XJ(),tfp),e)}function NM(e){return _D(),eeM((K7(),tfm),e)}function NO(e){return _N(),eeM((K9(),tfv),e)}function NA(e){return Xs(),eeM((qz(),tf_),e)}function NL(e){return eEM(),eeM((ee$(),tfM),e)}function NC(e){return _P(),eeM((Ve(),tf7),e)}function NI(e){return eoT(),eeM((q$(),tdn),e)}function ND(e){return epx(),eeM((eez(),tdb),e)}function NN(e){return eSd(),eeM((ei4(),tdk),e)}function NP(e){return ebx(),eeM((et0(),tdD),e)}function NR(e){return eyY(),eeM((et1(),tdJ),e)}function Nj(e){return eB$(),eeM((xG(),e7$),e)}function NF(e){return erq(),eeM((qM(),e9K),e)}function NY(e){return ec3(),eeM((eeK(),tpw),e)}function NB(e){return etT(),eeM((X1(),tpk),e)}function NU(e){return efE(),eeM((Q_(),tpA),e)}function NH(e){return e_a(),eeM((et7(),tpR),e)}function N$(e){return eck(),eeM((XQ(),tpK),e)}function Nz(e){return egF(),eeM((Qw(),tpJ),e)}function NG(e){return eT7(),eeM((eaj(),tp9),e)}function NW(e){return epT(),eeM((eeV(),tbi),e)}function NK(e){return ewf(),eeM((etC(),tbf),e)}function NV(e){return ekU(),eeM((et9(),tbv),e)}function Nq(e){return ed5(),eeM((QS(),tbZ),e)}function NZ(e){return eI3(),eeM((eo$(),tb5),e)}function NX(e){return eYu(),eeM((eeq(),tbB),e)}function NJ(e){return edM(),eeM((QE(),tmt),e)}function NQ(e){return eup(),eeM((Qy(),tmo),e)}function N1(e){return eTy(),eeM((ei6(),tmP),e)}function N0(e,t){return BJ(e),e+(BJ(t),t)}function N2(e,t){return wK(),JL(H8(e.a),t)}function N3(e,t){return wK(),JL(H8(e.a),t)}function N4(e,t){this.c=e,this.a=t,this.b=t-e}function N6(e,t,n){this.a=e,this.b=t,this.c=n}function N5(e,t,n){this.a=e,this.b=t,this.c=n}function N8(e,t,n){this.a=e,this.b=t,this.c=n}function N9(e,t,n){this.a=e,this.b=t,this.c=n}function N7(e,t,n){this.a=e,this.b=t,this.c=n}function Pe(e,t,n){this.e=e,this.a=t,this.c=n}function Pt(e,t,n){Ml(),zl.call(this,e,t,n)}function Pn(e,t,n){Ml(),BP.call(this,e,t,n)}function Pr(e,t,n){Ml(),BP.call(this,e,t,n)}function Pi(e,t,n){Ml(),BP.call(this,e,t,n)}function Pa(e,t,n){Ml(),Pn.call(this,e,t,n)}function Po(e,t,n){Ml(),Pn.call(this,e,t,n)}function Ps(e,t,n){Ml(),Po.call(this,e,t,n)}function Pu(e,t,n){Ml(),Pr.call(this,e,t,n)}function Pc(e,t,n){Ml(),Pi.call(this,e,t,n)}function Pl(e,t){return Y8(e),Y8(t),new wx(e,t)}function Pf(e,t){return Y8(e),Y8(t),new Rn(e,t)}function Pd(e,t){return Y8(e),Y8(t),new Rr(e,t)}function Ph(e,t){return Y8(e),Y8(t),new wM(e,t)}function Pp(e,t){return Rb(null==e||ebs(e,t)),e}function Pb(e){var t;return t=new p0,eel(t,e),t}function Pm(e){var t;return t=new bV,eel(t,e),t}function Pg(e){var t;return ein(t=new b2,e),t}function Pv(e){var t;return ein(t=new _n,e),t}function Py(e){return e.e||(e.e=new p0),e.e}function Pw(e){return e.c||(e.c=new sk),e.c}function P_(e,t){return e.c[e.c.length]=t,!0}function PE(e,t){this.c=e,this.b=t,this.a=!1}function PS(e){this.d=e,f_(this),this.b=Ft(e.d)}function Pk(){this.a=";,;",this.b="",this.c=""}function Px(e,t,n){F$.call(this,t,n),this.a=e}function PT(e,t,n){this.b=e,xP.call(this,t,n)}function PM(e,t,n){this.c=e,EE.call(this,t,n)}function PO(e,t,n){ekp(n,0,e,t,n.length,!1)}function PA(e,t,n,r,i){e.b=t,e.c=n,e.d=r,e.a=i}function PL(e,t){t&&(e.b=t,e.a=(B1(t),t.a))}function PC(e,t,n,r,i){e.d=t,e.c=n,e.a=r,e.b=i}function PI(e){var t,n;t=e.b,n=e.c,e.b=n,e.c=t}function PD(e){var t,n;n=e.d,t=e.a,e.d=t,e.a=n}function PN(e){return eal(YE(Ts(e)?eaL(e):e))}function PP(e,t){return ME(Rx(e.d),Rx(t.d))}function PR(e,t){return t==(eYu(),tbY)?e.c:e.d}function Pj(){Pj=A,tuu=(eYu(),tbY),tuc=tby}function PF(){this.b=gP(LV(epB((eCk(),e8N))))}function PY(e){return _w(),Je(e1R,eUp,1,e,5,1)}function PB(e){return new kl(e.c+e.b,e.d+e.a)}function PU(e,t){return _C(),ME(e.d.p,t.d.p)}function PH(e){return A5(0!=e.b),etw(e,e.a.a)}function P$(e){return A5(0!=e.b),etw(e,e.c.b)}function Pz(e,t){if(!e)throw p7(new gS(t))}function PG(e,t){if(!e)throw p7(new gL(t))}function PW(e,t,n){Se.call(this,e,t),this.b=n}function PK(e,t,n){k9.call(this,e,t),this.c=n}function PV(e,t,n){etn.call(this,t,n),this.d=e}function Pq(e){Dt(),sr.call(this),this.th(e)}function PZ(e,t,n){this.a=e,xQ.call(this,t,n)}function PX(e,t,n){this.a=e,xQ.call(this,t,n)}function PJ(e,t,n){k9.call(this,e,t),this.c=n}function PQ(){ZE(),BY.call(this,(_Q(),tgp))}function P1(e){return null!=e&&!efz(e,tm1,tm0)}function P0(e,t){return(elt(e)<<4|elt(t))&eHd}function P2(e,t){return U_(),eb2(e,t),new Uf(e,t)}function P3(e,t){var n;e.n&&(n=t,P_(e.f,n))}function P4(e,t,n){var r;ee3(e,t,r=new B_(n))}function P6(e,t){var n;return n=e.c,ers(e,t),n}function P5(e,t){return t<0?e.g=-1:e.g=t,e}function P8(e,t){return etN(e),e.a*=t,e.b*=t,e}function P9(e,t,n,r,i){e.c=t,e.d=n,e.b=r,e.a=i}function P7(e,t){return qQ(e,t,e.c.b,e.c),!0}function Re(e){e.a.b=e.b,e.b.a=e.a,e.a=e.b=null}function Rt(e){this.b=e,this.a=Fc(this.b.a).Ed()}function Rn(e,t){this.b=e,this.a=t,ci.call(this)}function Rr(e,t){this.a=e,this.b=t,ci.call(this)}function Ri(e,t){F$.call(this,t,1040),this.a=e}function Ra(e){return 0==e||isNaN(e)?e:e<0?-1:1}function Ro(e){return HR(),e_I(e)==z$(e_P(e))}function Rs(e){return HR(),e_P(e)==z$(e_I(e))}function Ru(e,t){return eyE(e,new Se(t.a,t.b))}function Rc(e){return!q9(e)&&e.c.i.c==e.d.i.c}function Rl(e){var t;return t=e.n,e.a.b+t.d+t.a}function Rf(e){var t;return t=e.n,e.e.b+t.d+t.a}function Rd(e){var t;return t=e.n,e.e.a+t.b+t.c}function Rh(e){return eBG(),++tyv,new jb(0,e)}function Rp(e){return e.a?e.a:Hh(e)}function Rb(e){if(!e)throw p7(new gA(null))}function Rm(){Rm=A,tvm=(Hj(),new fB(eQU))}function Rg(){Rg=A,new ebw((m2(),e0d),(m3(),e0f))}function Rv(){Rv=A,e0B=Je(e16,eUP,19,256,0,1)}function Ry(e,t,n,r){ef3.call(this,e,t,n,r,0,0)}function Rw(e,t,n){return Um(e.b,Pp(n.b,17),t)}function R_(e,t,n){return Um(e.b,Pp(n.b,17),t)}function RE(e,t){return P_(e,new kl(t.a,t.b))}function RS(e,t){return e.c=t)throw p7(new bj)}function FR(e,t,n){return Bc(t,0,R6(t[0],n[0])),t}function Fj(e,t,n){t.Ye(n,gP(LV(Bp(e.b,n)))*e.a)}function FF(e,t,n){return eLG(),eiq(e,t)&&eiq(e,n)}function FY(e){return ekU(),!e.Hc(tbp)&&!e.Hc(tbm)}function FB(e){return new kl(e.c+e.b/2,e.d+e.a/2)}function FU(e,t){return t.kh()?ecv(e.b,Pp(t,49)):t}function FH(e,t){this.e=e,this.d=(64&t)!=0?t|eUR:t}function F$(e,t){this.c=0,this.d=e,this.b=64|t|eUR}function Fz(e){this.b=new XM(11),this.a=(HF(),e)}function FG(e){this.b=null,this.a=(HF(),e||e2s)}function FW(e){this.a=ebb(e.a),this.b=new I4(e.b)}function FK(e){this.b=e,AF.call(this,e),Op(this)}function FV(e){this.b=e,AB.call(this,e),Ob(this)}function Fq(e,t,n){this.a=e,Ia.call(this,t,n,5,6)}function FZ(e,t,n,r){this.b=e,O_.call(this,t,n,r)}function FX(e,t,n,r,i){JB.call(this,e,t,n,r,i,-1)}function FJ(e,t,n,r,i){JU.call(this,e,t,n,r,i,-1)}function FQ(e,t,n,r){O_.call(this,e,t,n),this.b=r}function F1(e,t,n,r){PK.call(this,e,t,n),this.b=r}function F0(e){k7.call(this,e,!1),this.a=!1}function F2(e,t){this.b=e,lm.call(this,e.b),this.a=t}function F3(e,t){Bx(),wj.call(this,e,ecT(new g$(t)))}function F4(e,t){return eBG(),++tyv,new BR(e,t,0)}function F6(e,t){return eBG(),++tyv,new BR(6,e,t)}function F5(e,t){return IE(e.substr(0,t.length),t)}function F8(e,t){return xd(t)?$r(e,t):!!$I(e.f,t)}function F9(e,t){for(BJ(t);e.Ob();)t.td(e.Pb())}function F7(e,t,n){eLQ(),this.e=e,this.d=t,this.a=n}function Ye(e,t,n,r){var i;(i=e.i).i=t,i.a=n,i.b=r}function Yt(e){var t;for(t=e;t.f;)t=t.f;return t}function Yn(e){var t;return A5(null!=(t=eso(e))),t}function Yr(e){var t;return A5(null!=(t=elT(e))),t}function Yi(e,t){var n;return ZQ(t,n=e.a.gc()),n-t}function Ya(e,t){var n;for(n=0;n0?eB4.Math.log(e/t):-100}function YM(e,t){return 0>ecd(e,t)?-1:ecd(e,t)>0?1:0}function YO(e,t,n){return ePQ(e,Pp(t,46),Pp(n,167))}function YA(e,t){return Pp(Ff(Fc(e.a)).Xb(t),42).cd()}function YL(e,t){return eto(t,e.length),new Ri(e,t)}function YC(e,t){this.d=e,Ow.call(this,e),this.e=t}function YI(e){this.d=(BJ(e),e),this.a=0,this.c=eUY}function YD(e,t){pJ.call(this,1),this.a=e,this.b=t}function YN(e,t){return e.c?YN(e.c,t):P_(e.b,t),e}function YP(e,t,n){var r;return r=eep(e,t),V7(e,t,n),r}function YR(e,t){var n;return QO(n=e.slice(0,t),e)}function Yj(e,t,n){var r;for(r=0;r=e.g}function BL(e,t,n){var r;return r=er$(e,t,n),eCK(e,r)}function BC(e,t){var n;n=e.a.length,eep(e,n),V7(e,n,t)}function BI(e,t){var n;(n=console[e]).call(console,t)}function BD(e,t){var n;++e.j,n=e.Vi(),e.Ii(e.oi(n,t))}function BN(e,t,n){Pp(t.b,65),ety(t.a,new N5(e,n,t))}function BP(e,t,n){p$.call(this,t),this.a=e,this.b=n}function BR(e,t,n){pJ.call(this,e),this.a=t,this.b=n}function Bj(e,t,n){this.a=e,pH.call(this,t),this.b=n}function BF(e,t,n){this.a=e,K3.call(this,8,t,null,n)}function BY(e){this.a=(BJ(eJ7),eJ7),this.b=e,new mP}function BB(e){this.c=e,this.b=this.c.a,this.a=this.c.e}function BU(e){this.c=e,this.b=e.a.d.a,LR(e.a.e,this)}function BH(e){A4(-1!=e.c),e.d.$c(e.c),e.b=e.c,e.c=-1}function B$(e){return eB4.Math.sqrt(e.a*e.a+e.b*e.b)}function Bz(e,t){return FP(t,e.a.c.length),RJ(e.a,t)}function BG(e,t){return xc(e)===xc(t)||null!=e&&ecX(e,t)}function BW(e){return 0>=e?new _e:erg(e-1)}function BK(e){return!!tyb&&$r(tyb,e)}function BV(e){return e?e.dc():!e.Kc().Ob()}function Bq(e){return!e.a&&e.c?e.c.b:e.a}function BZ(e){return e.a||(e.a=new O_(e5f,e,4)),e.a}function BX(e){return e.d||(e.d=new O_(tgr,e,1)),e.d}function BJ(e){if(null==e)throw p7(new bM);return e}function BQ(e){e.c?e.c.He():(e.d=!0,eAA(e))}function B1(e){e.c?B1(e.c):(el3(e),e.d=!0)}function B0(e){UG(e.a),e.b=Je(e1R,eUp,1,e.b.length,5,1)}function B2(e,t){return ME(t.j.c.length,e.j.c.length)}function B3(e,t){e.c<0||e.b.b=0?e.Bh(n):ekN(e,t)}function B6(e){var t,n;return(t=e.c.i.c)==(n=e.d.i.c)}function B5(e){if(4!=e.p)throw p7(new bT);return e.e}function B8(e){if(3!=e.p)throw p7(new bT);return e.e}function B9(e){if(6!=e.p)throw p7(new bT);return e.f}function B7(e){if(6!=e.p)throw p7(new bT);return e.k}function Ue(e){if(3!=e.p)throw p7(new bT);return e.j}function Ut(e){if(4!=e.p)throw p7(new bT);return e.j}function Un(e){return e.b||(e.b=new pG(new mR)),e.b}function Ur(e){return -2==e.c&&fd(e,e_d(e.g,e.b)),e.c}function Ui(e,t){var n;return(n=Y5("",e)).n=t,n.i=1,n}function Ua(e,t){jB(Pp(t.b,65),e),ety(t.a,new dv(e))}function Uo(e,t){JL((e.a||(e.a=new C_(e,e)),e.a),t)}function Us(e,t){this.b=e,YC.call(this,e,t),Op(this)}function Uu(e,t){this.b=e,IB.call(this,e,t),Ob(this)}function Uc(e,t,n,r){wD.call(this,e,t),this.d=n,this.a=r}function Ul(e,t,n,r){wD.call(this,e,n),this.a=t,this.f=r}function Uf(e,t){MK.call(this,erv(Y8(e),Y8(t))),this.a=t}function Ud(){e_w.call(this,eQB,(yA(),tvE)),ejt(this)}function Uh(){e_w.call(this,eQc,(yO(),tgg)),eP3(this)}function Up(){wC.call(this,"DELAUNAY_TRIANGULATION",0)}function Ub(e){return String.fromCharCode.apply(null,e)}function Um(e,t,n){return xd(t)?Ge(e,t,n):eS8(e.f,t,n)}function Ug(e){return Hj(),e?e.ve():(HF(),HF(),e2c)}function Uv(e,t,n){return eoM(),n.pg(e,Pp(t.cd(),146))}function Uy(e,t){return Rg(),new ebw(new OK(e),new OW(t))}function Uw(e){return enG(e,eU5),ee1(eft(eft(5,e),e/10|0))}function U_(){U_=A,e0p=new gt(eow(vx(e1$,1),eUK,42,0,[]))}function UE(e){return e.d||(e.d=new fF(e.c.Cc())),e.d}function US(e){return e.a||(e.a=new vp(e.c.vc())),e.a}function Uk(e){return e.b||(e.b=new vd(e.c.ec())),e.b}function Ux(e,t){for(;t-- >0;)e=e<<1|(e<0?1:0);return e}function UT(e,t){return xc(e)===xc(t)||null!=e&&ecX(e,t)}function UM(e,t){return OQ(),Pp(t.b,19).ar&&++r,r}function Hl(e){var t,n;return etV(n=t=new p6,e),n}function Hf(e){var t,n;return e_U(n=t=new p6,e),n}function Hd(e,t){var n;return n=Bp(e.f,t),eiX(t,n),null}function Hh(e){var t;return(t=erw(e))?t:null}function Hp(e){return e.b||(e.b=new FQ(e5g,e,12,3)),e.b}function Hb(e){return null!=e&&wZ(tm$,e.toLowerCase())}function Hm(e,t){return elN(jl(e)*jc(e),jl(t)*jc(t))}function Hg(e,t){return elN(jl(e)*jc(e),jl(t)*jc(t))}function Hv(e,t){return elN(e.d.c+e.d.b/2,t.d.c+t.d.b/2)}function Hy(e,t){return elN(e.g.c+e.g.b/2,t.g.c+t.g.b/2)}function Hw(e,t,n){n.a?ens(e,t.b-e.f/2):eno(e,t.a-e.g/2)}function H_(e,t,n,r){this.a=e,this.b=t,this.c=n,this.d=r}function HE(e,t,n,r){this.a=e,this.b=t,this.c=n,this.d=r}function HS(e,t,n,r){this.e=e,this.a=t,this.c=n,this.d=r}function Hk(e,t,n,r){this.a=e,this.c=t,this.d=n,this.b=r}function Hx(e,t,n,r){Ml(),ZU.call(this,t,n,r),this.a=e}function HT(e,t,n,r){Ml(),ZU.call(this,t,n,r),this.a=e}function HM(e,t){this.a=e,LQ.call(this,e,Pp(e.d,15).Zc(t))}function HO(e){this.f=e,this.c=this.f.e,e.f>0&&evH(this)}function HA(e,t,n,r){this.b=e,this.c=r,xj.call(this,t,n)}function HL(e){return A5(e.b=0&&IE(e.substr(n,t.length),t)}function $N(e,t,n,r,i,a,o){return new qu(e.e,t,n,r,i,a,o)}function $P(e,t,n,r,i,a){this.a=e,en1.call(this,t,n,r,i,a)}function $R(e,t,n,r,i,a){this.a=e,en1.call(this,t,n,r,i,a)}function $j(e,t){this.g=e,this.d=eow(vx(e4N,1),eGW,10,0,[t])}function $F(e,t){this.e=e,this.a=e1R,this.b=eCz(t),this.c=t}function $Y(e,t){CK.call(this),etk(this),this.a=e,this.c=t}function $B(e,t,n,r){Bc(e.c[t.g],n.g,r),Bc(e.c[n.g],t.g,r)}function $U(e,t,n,r){Bc(e.c[t.g],t.g,n),Bc(e.b[t.g],t.g,r)}function $H(){return Xo(),eow(vx(e6u,1),eU4,376,0,[tsH,tsU])}function $$(){return Qx(),eow(vx(e40,1),eU4,479,0,[ttt,tte])}function $z(){return eeF(),eow(vx(e4J,1),eU4,419,0,[teZ,teX])}function $G(){return Jp(),eow(vx(e4V,1),eU4,422,0,[teD,teN])}function $W(){return K5(),eow(vx(e48,1),eU4,420,0,[ttR,ttj])}function $K(){return Q0(),eow(vx(e6a,1),eU4,421,0,[tsL,tsC])}function $V(){return qG(),eow(vx(e6v,1),eU4,523,0,[tuf,tul])}function $q(){return Xa(),eow(vx(e6k,1),eU4,520,0,[tuH,tuU])}function $Z(){return zs(),eow(vx(e6E,1),eU4,516,0,[tuw,tuy])}function $X(){return zQ(),eow(vx(e6S,1),eU4,515,0,[tuE,tuS])}function $J(){return zo(),eow(vx(e6x,1),eU4,455,0,[tuq,tuZ])}function $Q(){return Kn(),eow(vx(e6C,1),eU4,425,0,[tcH,tcU])}function $1(){return z1(),eow(vx(e6L,1),eU4,480,0,[tcF,tcY])}function $0(){return erZ(),eow(vx(e6I,1),eU4,495,0,[tcq,tcZ])}function $2(){return J0(),eow(vx(e6N,1),eU4,426,0,[tc2,tc3])}function $3(){return eoT(),eow(vx(e6V,1),eU4,429,0,[tdt,tde])}function $4(){return Xs(),eow(vx(e6G,1),eU4,430,0,[tfw,tfy])}function $6(){return epC(),eow(vx(e2Q,1),eU4,428,0,[e3f,e3l])}function $5(){return eeR(),eow(vx(e21,1),eU4,427,0,[e3h,e3p])}function $8(){return eej(),eow(vx(e4E,1),eU4,424,0,[e8f,e8d])}function $9(){return erq(),eow(vx(e4F,1),eU4,511,0,[e9W,e9G])}function $7(e,t,n,r){return n>=0?e.jh(t,n,r):e.Sg(null,n,r)}function ze(e){return 0==e.b.b?e.a.$e():PH(e.b)}function zt(e){if(5!=e.p)throw p7(new bT);return jE(e.f)}function zn(e){if(5!=e.p)throw p7(new bT);return jE(e.k)}function zr(e){return xc(e.a)===xc((eiM(),tgW))&&eR1(e),e.a}function zi(e){this.a=Pp(Y8(e),271),this.b=(Hj(),new O4(e))}function za(e,t){l6(this,new kl(e.a,e.b)),l5(this,Pv(t))}function zo(){zo=A,tuq=new SK(ezt,0),tuZ=new SK(ezn,1)}function zs(){zs=A,tuw=new Sz(ezn,0),tuy=new Sz(ezt,1)}function zu(){m8.call(this,new w9(ee0(12))),Oq(!0),this.a=2}function zc(e,t,n){eBG(),pJ.call(this,e),this.b=t,this.a=n}function zl(e,t,n){Ml(),p$.call(this,t),this.a=e,this.b=n}function zf(e){CK.call(this),etk(this),this.a=e,this.c=!0}function zd(e){var t;t=e.c.d.b,e.b=t,e.a=e.c.d,t.a=e.c.d.b=e}function zh(e){var t;enZ(e.a),TW(e.a),efJ(t=new dp(e.a))}function zp(e,t){eC_(e,!0),ety(e.e.wf(),new Dx(e,!0,t))}function zb(e,t){return qe(t),enL(e,Je(ty_,eHT,25,t,15,1),t)}function zm(e,t){return HR(),e==z$(e_I(t))||e==z$(e_P(t))}function zg(e,t){return null==t?xu($I(e.f,null)):Ea(e.g,t)}function zv(e){return 0==e.b?null:(A5(0!=e.b),etw(e,e.a.a))}function zy(e){return 0|Math.max(Math.min(e,eUu),-2147483648)}function zw(e,t){var n=e0w[e.charCodeAt(0)];return null==n?e:n}function z_(e,t){return H6(e,"set1"),H6(t,"set2"),new wF(e,t)}function zE(e,t){var n;return C6(Ld(n=et$(e.f,t)),e.f.d)}function zS(e,t){var n,r;return ej4(e,n=t,r=new H),r.d}function zk(e,t,n,r){var i;i=new CQ,t.a[n.g]=i,jT(e.b,r,i)}function zx(e,t,n){var r;(r=e.Yg(t))>=0?e.sh(r,n):eOh(e,t,n)}function zT(e,t,n){z0(),e&&Um(tmj,e,t),e&&Um(tmR,e,n)}function zM(e,t,n){this.i=new p0,this.b=e,this.g=t,this.a=n}function zO(e,t,n){this.c=new p0,this.e=e,this.f=t,this.b=n}function zA(e,t,n){this.a=new p0,this.e=e,this.f=t,this.c=n}function zL(e,t){MV(this),this.f=t,this.g=e,HD(this),this._d()}function zC(e,t){var n;n=e.q.getHours(),e.q.setDate(t),eNq(e,n)}function zI(e,t){var n;for(Y8(t),n=e.a;n;n=n.c)t.Od(n.g,n.i)}function zD(e){var t;return esb(t=new yF(ee0(e.length)),e),t}function zN(e){function t(){}return t.prototype=e||{},new t}function zP(e,t){return!!eos(e,t)&&(enP(e),!0)}function zR(e,t){if(null==t)throw p7(new bM);return ehF(e,t)}function zj(e){return e.qe()?null:(0,eUt[e.n])}function zF(e){return e.Db>>16!=3?null:Pp(e.Cb,33)}function zY(e){return e.Db>>16!=9?null:Pp(e.Cb,33)}function zB(e){return e.Db>>16!=6?null:Pp(e.Cb,79)}function zU(e){return e.Db>>16!=7?null:Pp(e.Cb,235)}function zH(e){return e.Db>>16!=7?null:Pp(e.Cb,160)}function z$(e){return e.Db>>16!=11?null:Pp(e.Cb,33)}function zz(e,t){var n;return(n=e.Yg(t))>=0?e.lh(n):exu(e,t)}function zG(e,t){var n;return n=new RZ(t),e_h(n,e),new I4(n)}function zW(e){var t;return t=e.d,t=e.si(e.f),JL(e,t),t.Ob()}function zK(e,t){return e.b+=t.b,e.c+=t.c,e.d+=t.d,e.a+=t.a,e}function zV(e,t){return eB4.Math.abs(e)0}function zZ(){this.a=new Tw,this.e=new bV,this.g=0,this.i=0}function zX(e){this.a=e,this.b=Je(e6b,eUP,1944,e.e.length,0,2)}function zJ(e,t,n){var r;r=esg(e,t,n),e.b=new erH(r.c.length)}function zQ(){zQ=A,tuE=new S$(ezh,0),tuS=new S$("UP",1)}function z1(){z1=A,tcF=new SJ(eV2,0),tcY=new SJ("FAN",1)}function z0(){z0=A,tmj=new p2,tmR=new p2,xa(e0r,new o9)}function z2(e){if(0!=e.p)throw p7(new bT);return xg(e.f,0)}function z3(e){if(0!=e.p)throw p7(new bT);return xg(e.k,0)}function z4(e){return e.Db>>16!=3?null:Pp(e.Cb,147)}function z6(e){return e.Db>>16!=6?null:Pp(e.Cb,235)}function z5(e){return e.Db>>16!=17?null:Pp(e.Cb,26)}function z8(e,t){var n=e.a=e.a||[];return n[t]||(n[t]=e.le(t))}function z9(e,t){var n;return null==(n=e.a.get(t))?[]:n}function z7(e,t){var n;n=e.q.getHours(),e.q.setMonth(t),eNq(e,n)}function Ge(e,t,n){return null==t?eS8(e.f,null,n):efi(e.g,t,n)}function Gt(e,t,n,r,i,a){return new Q$(e.e,t,e.aj(),n,r,i,a)}function Gn(e,t,n){return e.a=Az(e.a,0,t)+""+n+xy(e.a,t),e}function Gr(e,t,n){return P_(e.a,(U_(),eb2(t,n),new wD(t,n))),e}function Gi(e){return OX(e.c),e.e=e.a=e.c,e.c=e.c.c,++e.d,e.a.f}function Ga(e){return OX(e.e),e.c=e.a=e.e,e.e=e.e.e,--e.d,e.a.f}function Go(e,t){e.d&&QA(e.d.e,e),e.d=t,e.d&&P_(e.d.e,e)}function Gs(e,t){e.c&&QA(e.c.g,e),e.c=t,e.c&&P_(e.c.g,e)}function Gu(e,t){e.c&&QA(e.c.a,e),e.c=t,e.c&&P_(e.c.a,e)}function Gc(e,t){e.i&&QA(e.i.j,e),e.i=t,e.i&&P_(e.i.j,e)}function Gl(e,t,n){this.a=t,this.c=e,this.b=(Y8(n),new I4(n))}function Gf(e,t,n){this.a=t,this.c=e,this.b=(Y8(n),new I4(n))}function Gd(e,t){this.a=e,this.c=MB(this.a),this.b=new $g(t)}function Gh(e){var t;return el3(e),t=new bV,UJ(e,new di(t))}function Gp(e,t){if(e<0||e>t)throw p7(new gE(e$O+e+e$A+t))}function Gb(e,t){return jR(e.a,t)?Yl(e,Pp(t,22).g,null):null}function Gm(e){return euQ(),OQ(),0!=Pp(e.a,81).d.e}function Gg(){Gg=A,e0g=euY((m6(),eow(vx(e1W,1),eU4,538,0,[e0m])))}function Gv(){Gv=A,ts2=j0(new K2,(e_x(),e9i),(eB$(),e7N))}function Gy(){Gy=A,ts3=j0(new K2,(e_x(),e9i),(eB$(),e7N))}function Gw(){Gw=A,ts6=j0(new K2,(e_x(),e9i),(eB$(),e7N))}function G_(){G_=A,tuh=RI(new K2,(e_x(),e9i),(eB$(),e7o))}function GE(){GE=A,tug=RI(new K2,(e_x(),e9i),(eB$(),e7o))}function GS(){GS=A,tuv=RI(new K2,(e_x(),e9i),(eB$(),e7o))}function Gk(){Gk=A,tux=RI(new K2,(e_x(),e9i),(eB$(),e7o))}function Gx(){Gx=A,tcz=j0(new K2,(egR(),tu0),(eS_(),tu3))}function GT(e,t,n,r){this.c=e,this.d=r,GA(this,t),GL(this,n)}function GM(e){this.c=new _n,this.b=e.b,this.d=e.c,this.a=e.a}function GO(e){this.a=eB4.Math.cos(e),this.b=eB4.Math.sin(e)}function GA(e,t){e.a&&QA(e.a.k,e),e.a=t,e.a&&P_(e.a.k,e)}function GL(e,t){e.b&&QA(e.b.f,e),e.b=t,e.b&&P_(e.b.f,e)}function GC(e,t){BN(e,e.b,e.c),Pp(e.b.b,65),t&&Pp(t.b,65).b}function GI(e,t){elJ(e,t),M4(e.Cb,88)&&eko(Zd(Pp(e.Cb,88)),2)}function GD(e,t){M4(e.Cb,88)&&eko(Zd(Pp(e.Cb,88)),4),er3(e,t)}function GN(e,t){M4(e.Cb,179)&&(Pp(e.Cb,179).tb=null),er3(e,t)}function GP(e,t){return _4(),eec(t)?new RA(t,e):new xe(t,e)}function GR(e,t){var n,r;(r=null!=(n=t.c))&&BC(e,new B_(t.c))}function Gj(e){var t,n;return n=(yO(),t=new p6),etV(n,e),n}function GF(e){var t,n;return n=(yO(),t=new p6),etV(n,e),n}function GY(e,t){var n;return n=new By(e),t.c[t.c.length]=n,n}function GB(e,t){var n;return(n=Pp(ecA(HU(e.a),t),14))?n.gc():0}function GU(e){var t;return el3(e),etc(e,t=(HF(),HF(),e2u))}function GH(e){for(var t;;)if(t=e.Pb(),!e.Ob())return t}function G$(e,t){mK.call(this,new w9(ee0(e))),enG(t,eUN),this.a=t}function Gz(e,t,n){ec6(t,n,e.gc()),this.c=e,this.a=t,this.b=n-t}function GG(e,t,n){var r;ec6(t,n,e.c.length),r=n-t,yJ(e.c,t,r)}function GW(e,t){M7(e,jE(WM(Fv(t,24),e$b)),jE(WM(t,e$b)))}function GK(e,t){if(e<0||e>=t)throw p7(new gE(e$O+e+e$A+t))}function GV(e,t){if(e<0||e>=t)throw p7(new vf(e$O+e+e$A+t))}function Gq(e,t){this.b=(BJ(e),e),this.a=(t&eH0)==0?64|t|eUR:t}function GZ(e){TG(this),bF(this.a,esi(eB4.Math.max(8,e))<<1)}function GX(e){return esp(eow(vx(e60,1),eUP,8,0,[e.i.n,e.n,e.a]))}function GJ(){return eum(),eow(vx(e2L,1),eU4,132,0,[e2B,e2U,e2H])}function GQ(){return etx(),eow(vx(e25,1),eU4,232,0,[e3D,e3N,e3P])}function G1(){return Qs(),eow(vx(e27,1),eU4,461,0,[e3F,e3j,e3Y])}function G0(){return QQ(),eow(vx(e3t,1),eU4,462,0,[e3$,e3H,e3U])}function G2(){return ec4(),eow(vx(e4L,1),eU4,423,0,[e9x,e9k,e9S])}function G3(){return QJ(),eow(vx(e4S,1),eU4,379,0,[e84,e83,e86])}function G4(){return euJ(),eow(vx(e6e,1),eU4,378,0,[tsn,tsr,tsi])}function G6(){return en7(),eow(vx(e4q,1),eU4,314,0,[tej,teR,teF])}function G5(){return enB(),eow(vx(e4Z,1),eU4,337,0,[teB,teH,teU])}function G8(){return eoG(),eow(vx(e4Q,1),eU4,450,0,[te1,teQ,te0])}function G9(){return erX(),eow(vx(e4G,1),eU4,361,0,[tep,teh,ted])}function G7(){return Q1(),eow(vx(e45,1),eU4,303,0,[ttD,ttN,ttI])}function We(){return eaU(),eow(vx(e46,1),eU4,292,0,[ttA,ttL,ttO])}function Wt(){return enY(),eow(vx(e6o,1),eU4,452,0,[tsP,tsD,tsN])}function Wn(){return esn(),eow(vx(e6i,1),eU4,339,0,[tsM,tsT,tsO])}function Wr(){return ei0(),eow(vx(e6s,1),eU4,375,0,[tsj,tsF,tsY])}function Wi(){return eox(),eow(vx(e6f,1),eU4,377,0,[tsQ,ts1,tsJ])}function Wa(){return euy(),eow(vx(e6c,1),eU4,336,0,[tsz,tsG,tsW])}function Wo(){return eiO(),eow(vx(e6l,1),eU4,338,0,[tsZ,tsV,tsq])}function Ws(){return enU(),eow(vx(e6p,1),eU4,454,0,[tur,tui,tua])}function Wu(){return efx(),eow(vx(e6D,1),eU4,442,0,[tc1,tcJ,tcQ])}function Wc(){return eub(),eow(vx(e6P,1),eU4,380,0,[tc6,tc5,tc8])}function Wl(){return efS(),eow(vx(e6Y,1),eU4,381,0,[tlP,tlR,tlN])}function Wf(){return ei1(),eow(vx(e6j,1),eU4,293,0,[tlC,tlI,tlL])}function Wd(){return efk(),eow(vx(e6H,1),eU4,437,0,[tff,tfd,tfh])}function Wh(){return eck(),eow(vx(e67,1),eU4,334,0,[tpG,tpz,tpW])}function Wp(){return etT(),eow(vx(e65,1),eU4,272,0,[tp_,tpE,tpS])}function Wb(e,t){return eMw(e,t,M4(t,99)&&(Pp(t,18).Bb&eH3)!=0)}function Wm(e,t,n){var r;return(r=ePI(e,t,!1)).b<=t&&r.a<=n}function Wg(e,t,n){var r;(r=new ac).b=t,r.a=n,++t.b,P_(e.d,r)}function Wv(e,t){var n;return A3(!!(n=(BJ(e),e).g)),BJ(t),n(t)}function Wy(e,t){var n,r;return r=Yi(e,t),n=e.a.Zc(r),new wR(e,n)}function Ww(e){return e.Db>>16!=6?null:Pp(eTp(e),235)}function W_(e){if(2!=e.p)throw p7(new bT);return jE(e.f)&eHd}function WE(e){if(2!=e.p)throw p7(new bT);return jE(e.k)&eHd}function WS(e){return e.a==(ZE(),tvd)&&ff(e,eM0(e.g,e.b)),e.a}function Wk(e){return e.d==(ZE(),tvd)&&fh(e,eIj(e.g,e.b)),e.d}function Wx(e){return A5(e.ar?1:0}function WY(e,t){var n,r;return r=n=QP(t),Pp(Bp(e.c,r),19).a}function WB(e,t){var n;for(n=e+"";n.length0&&0==e.a[--e.d];);0==e.a[e.d++]&&(e.e=0)}function Kc(e){return e.a?0==e.e.length?e.a.a:e.a.a+""+e.e:e.c}function Kl(e){return!!e.a&&0!=QX(e.a.a).i&&!(e.b&&ebq(e.b))}function Kf(e){return!!e.u&&0!=qt(e.u.a).i&&!(e.n&&ebV(e.n))}function Kd(e){return Rj(e.e.Hd().gc()*e.c.Hd().gc(),16,new c8(e))}function Kh(e,t){return YM(eap(e.q.getTime()),eap(t.q.getTime()))}function Kp(e){return Pp(epg(e,Je(e4C,eGG,17,e.c.length,0,1)),474)}function Kb(e){return Pp(epg(e,Je(e4N,eGW,10,e.c.length,0,1)),193)}function Km(e){return GE(),!q9(e)&&!(!q9(e)&&e.c.i.c==e.d.i.c)}function Kg(e,t,n){var r;r=(Y8(e),new I4(e)),egT(new Gl(r,t,n))}function Kv(e,t,n){var r;r=(Y8(e),new I4(e)),egM(new Gf(r,t,n))}function Ky(e,t){var n;return n=1-t,e.a[n]=erj(e.a[n],n),erj(e,t)}function Kw(e,t){var n;e.e=new mQ,n=eLj(t),Mv(n,e.c),eLJ(e,n,0)}function K_(e,t,n,r){var i;(i=new od).a=t,i.b=n,i.c=r,P7(e.a,i)}function KE(e,t,n,r){var i;(i=new od).a=t,i.b=n,i.c=r,P7(e.b,i)}function KS(e){var t,n,r;return n=eI4(t=new YQ,e),eFg(t),r=n}function Kk(){var e,t,n;return P_(tg5,t=n=e=new p6),t}function Kx(e){return e.j.c=Je(e1R,eUp,1,0,5,1),UG(e.c),Uj(e.a),e}function KT(e){return(_L(),M4(e.g,10))?Pp(e.g,10):null}function KM(e){return!Uz(e).dc()&&(MI(e,new v),!0)}function KO(e){if(!("stack"in e))try{throw e}catch(t){}return e}function KA(e,t){if(e<0||e>=t)throw p7(new gE(eku(e,t)));return e}function KL(e,t,n){if(e<0||tn)throw p7(new gE(eE3(e,t,n)))}function KC(e,t){if(Yf(e.a,t),t.d)throw p7(new go(e$P));t.d=e}function KI(e,t){if(t.$modCount!=e.$modCount)throw p7(new bA)}function KD(e,t){return!!M4(t,42)&&emT(e.a,Pp(t,42))}function KN(e,t){return!!M4(t,42)&&emT(e.a,Pp(t,42))}function KP(e,t){return!!M4(t,42)&&emT(e.a,Pp(t,42))}function KR(e,t){return e.a<=e.b&&(t.ud(e.a++),!0)}function Kj(e){var t;return Ts(e)?-0==(t=e)?0:t:eem(e)}function KF(e){var t;return B1(e),t=new Y,yU(e.a,new dn(t)),t}function KY(e){var t;return B1(e),t=new F,yU(e.a,new dt(t)),t}function KB(e,t){this.a=e,fE.call(this,e),Gp(t,e.gc()),this.b=t}function KU(e){this.e=e,this.b=this.e.a.entries(),this.a=[]}function KH(e){return Rj(e.e.Hd().gc()*e.c.Hd().gc(),273,new c5(e))}function K$(e){return new XM((enG(e,eU5),ee1(eft(eft(5,e),e/10|0))))}function Kz(e){return Pp(epg(e,Je(e4j,eGK,11,e.c.length,0,1)),1943)}function KG(e,t,n){return n.f.c.length>0?YO(e.a,t,n):YO(e.b,t,n)}function KW(e,t,n){e.d&&QA(e.d.e,e),e.d=t,e.d&&jO(e.d.e,n,e)}function KK(e,t){eY6(t,e),PD(e.d),PD(Pp(e_k(e,(eBy(),taq)),207))}function KV(e,t){eY4(t,e),PI(e.d),PI(Pp(e_k(e,(eBy(),taq)),207))}function Kq(e,t){var n,r;return n=zR(e,t),r=null,n&&(r=n.fe()),r}function KZ(e,t){var n,r;return n=eep(e,t),r=null,n&&(r=n.ie()),r}function KX(e,t){var n,r;return n=zR(e,t),r=null,n&&(r=n.ie()),r}function KJ(e,t){var n,r;return n=zR(e,t),r=null,n&&(r=eSa(n)),r}function KQ(e,t,n){var r;return r=ehM(n),eIg(e.g,r,t),eIg(e.i,t,n),t}function K1(e,t,n){var r;r=ehl();try{return CO(e,t,n)}finally{Vx(r)}}function K0(e){var t;t=e.Wg(),this.a=M4(t,69)?Pp(t,69).Zh():t.Kc()}function K2(){mJ.call(this),this.j.c=Je(e1R,eUp,1,0,5,1),this.a=-1}function K3(e,t,n,r){this.d=e,this.n=t,this.g=n,this.o=r,this.p=-1}function K4(e,t,n,r){this.e=r,this.d=null,this.c=e,this.a=t,this.b=n}function K6(e,t,n){this.d=new hg(this),this.e=e,this.i=t,this.f=n}function K5(){K5=A,ttR=new S_(e$9,0),ttj=new S_("TOP_LEFT",1)}function K8(){K8=A,ts7=Uy(ell(1),ell(4)),ts9=Uy(ell(1),ell(2))}function K9(){K9=A,tfv=euY((_N(),eow(vx(e6z,1),eU4,551,0,[tfg])))}function K7(){K7=A,tfm=euY((_D(),eow(vx(e6$,1),eU4,482,0,[tfb])))}function Ve(){Ve=A,tf7=euY((_P(),eow(vx(e6K,1),eU4,530,0,[tf9])))}function Vt(){Vt=A,e5W=euY((_y(),eow(vx(e4w,1),eU4,481,0,[e5G])))}function Vn(){return eaY(),eow(vx(e3r,1),eU4,406,0,[e4c,e4o,e4s,e4u])}function Vr(){return Qu(),eow(vx(e2E,1),eU4,297,0,[e2D,e2N,e2P,e2R])}function Vi(){return ebe(),eow(vx(e4y,1),eU4,394,0,[e5U,e5B,e5H,e5$])}function Va(){return ep7(),eow(vx(e3i,1),eU4,323,0,[e4d,e4f,e4h,e4p])}function Vo(){return eok(),eow(vx(e4A,1),eU4,405,0,[e9f,e9p,e9d,e9h])}function Vs(){return eoE(),eow(vx(e4U,1),eU4,360,0,[e7Z,e7V,e7q,e7K])}function Vu(e,t,n,r){return M4(n,54)?new A7(e,t,n,r):new Fo(e,t,n,r)}function Vc(){return eoS(),eow(vx(e4$,1),eU4,411,0,[e78,e79,e77,tee])}function Vl(e){var t;return e.j==(eYu(),tbj)&&(t=eTt(e),Aa(t,tby))}function Vf(e,t){var n;Gs(n=t.a,t.c.d),Go(n,t.d.d),etH(n.a,e.n)}function Vd(e,t){return Pp(Af(FT(Pp(Zq(e.k,t),15).Oc(),tex)),113)}function Vh(e,t){return Pp(Af(FM(Pp(Zq(e.k,t),15).Oc(),tex)),113)}function Vp(e){return new Gq(eip(Pp(e.a.dd(),14).gc(),e.a.cd()),16)}function Vb(e){return M4(e,14)?Pp(e,14).dc():!e.Kc().Ob()}function Vm(e){return(_L(),M4(e.g,145))?Pp(e.g,145):null}function Vg(e){if(e.e.g!=e.b)throw p7(new bA);return!!e.c&&e.d>0}function Vv(e){return A5(e.b!=e.d.c),e.c=e.b,e.b=e.b.a,++e.a,e.c.c}function Vy(e,t){BJ(t),Bc(e.a,e.c,t),e.c=e.c+1&e.a.length-1,ega(e)}function Vw(e,t){BJ(t),e.b=e.b-1&e.a.length-1,Bc(e.a,e.b,t),ega(e)}function V_(e,t){var n;for(n=e.j.c.length;n0&&ePD(e.g,0,t,0,e.i),t}function VB(e,t){var n;return _6(),!(n=Pp(Bp(tmU,e),55))||n.wj(t)}function VU(e){if(1!=e.p)throw p7(new bT);return jE(e.f)<<24>>24}function VH(e){if(1!=e.p)throw p7(new bT);return jE(e.k)<<24>>24}function V$(e){if(7!=e.p)throw p7(new bT);return jE(e.k)<<16>>16}function Vz(e){if(7!=e.p)throw p7(new bT);return jE(e.f)<<16>>16}function VG(e){var t;for(t=0;e.Ob();)e.Pb(),t=eft(t,1);return ee1(t)}function VW(e,t){var n;return n=new vl,e.xd(n),n.a+="..",t.yd(n),n.a}function VK(e,t,n){var r;r=Pp(Bp(e.g,n),57),P_(e.a.c,new kD(t,r))}function VV(e,t,n){return F_(LV(xu($I(e.f,t))),LV(xu($I(e.f,n))))}function Vq(e,t,n){return eNA(e,t,n,M4(t,99)&&(Pp(t,18).Bb&eH3)!=0)}function VZ(e,t,n){return eN1(e,t,n,M4(t,99)&&(Pp(t,18).Bb&eH3)!=0)}function VX(e,t,n){return eMN(e,t,n,M4(t,99)&&(Pp(t,18).Bb&eH3)!=0)}function VJ(e,t){return e==(eEn(),e9N)&&t==e9N?4:e==e9N||t==e9N?8:32}function VQ(e,t){return xc(t)===xc(e)?"(this Map)":null==t?eUg:efF(t)}function V1(e,t){return Pp(null==t?xu($I(e.f,null)):Ea(e.g,t),281)}function V0(e,t,n){var r;return r=ehM(n),Um(e.b,r,t),Um(e.c,t,n),t}function V2(e,t){var n;for(n=t;n;)Lu(e,n.i,n.j),n=z$(n);return e}function V3(e,t){var n;return n=$a(Pb(new Qj(e,t))),RG(new Qj(e,t)),n}function V4(e,t){var n;return _4(),eEy(n=Pp(e,66).Mj(),t),n.Ok(t)}function V6(e,t,n,r,i){var a;a=eMW(i,n,r),P_(t,eS4(i,a)),e_X(e,i,t)}function V5(e,t,n){e.i=0,e.e=0,t!=n&&(esC(e,t,n),esL(e,t,n))}function V8(e,t){var n;n=e.q.getHours(),e.q.setFullYear(t+eHx),eNq(e,n)}function V9(e,t,n){if(n){var r=n.ee();e.a[t]=r(n)}else delete e.a[t]}function V7(e,t,n){n=n?n.ee()(n):void 0,e.a[t]=n}function qe(e){if(e<0)throw p7(new gI("Negative array size: "+e))}function qt(e){return e.n||(Zd(e),e.n=new j4(e,tgr,e),$E(e)),e.n}function qn(e){return A5(e.a=0&&e.a[n]===t[n];n--);return n<0}function qy(e,t){var n;return(euv(),0!=(n=e.j.g-t.j.g))?n:0}function qw(e,t){return(BJ(t),null!=e.a)?jN(t.Kb(e.a)):e2b}function q_(e){var t;return e?new RZ(e):(t=new Tw,ein(t,e),t)}function qE(e,t){var n;return t.b.Kb(QD(e,t.c.Ee(),n=new ds(t)))}function qS(e){ewP(),M7(this,jE(WM(Fv(e,24),e$b)),jE(WM(e,e$b)))}function qk(){qk=A,e3d=euY((epC(),eow(vx(e2Q,1),eU4,428,0,[e3f,e3l])))}function qx(){qx=A,e3b=euY((eeR(),eow(vx(e21,1),eU4,427,0,[e3h,e3p])))}function qT(){qT=A,e8h=euY((eej(),eow(vx(e4E,1),eU4,424,0,[e8f,e8d])))}function qM(){qM=A,e9K=euY((erq(),eow(vx(e4F,1),eU4,511,0,[e9W,e9G])))}function qO(){qO=A,teJ=euY((eeF(),eow(vx(e4J,1),eU4,419,0,[teZ,teX])))}function qA(){qA=A,ttn=euY((Qx(),eow(vx(e40,1),eU4,479,0,[ttt,tte])))}function qL(){qL=A,ts$=euY((Xo(),eow(vx(e6u,1),eU4,376,0,[tsH,tsU])))}function qC(){qC=A,tsI=euY((Q0(),eow(vx(e6a,1),eU4,421,0,[tsL,tsC])))}function qI(){qI=A,teP=euY((Jp(),eow(vx(e4V,1),eU4,422,0,[teD,teN])))}function qD(){qD=A,ttF=euY((K5(),eow(vx(e48,1),eU4,420,0,[ttR,ttj])))}function qN(){qN=A,tu$=euY((Xa(),eow(vx(e6k,1),eU4,520,0,[tuH,tuU])))}function qP(){qP=A,tud=euY((qG(),eow(vx(e6v,1),eU4,523,0,[tuf,tul])))}function qR(){qR=A,tu_=euY((zs(),eow(vx(e6E,1),eU4,516,0,[tuw,tuy])))}function qj(){qj=A,tuk=euY((zQ(),eow(vx(e6S,1),eU4,515,0,[tuE,tuS])))}function qF(){qF=A,tuX=euY((zo(),eow(vx(e6x,1),eU4,455,0,[tuq,tuZ])))}function qY(){qY=A,tc$=euY((Kn(),eow(vx(e6C,1),eU4,425,0,[tcH,tcU])))}function qB(){qB=A,tcX=euY((erZ(),eow(vx(e6I,1),eU4,495,0,[tcq,tcZ])))}function qU(){qU=A,tcB=euY((z1(),eow(vx(e6L,1),eU4,480,0,[tcF,tcY])))}function qH(){qH=A,tc4=euY((J0(),eow(vx(e6N,1),eU4,426,0,[tc2,tc3])))}function q$(){q$=A,tdn=euY((eoT(),eow(vx(e6V,1),eU4,429,0,[tdt,tde])))}function qz(){qz=A,tf_=euY((Xs(),eow(vx(e6G,1),eU4,430,0,[tfw,tfy])))}function qG(){qG=A,tuf=new Sj("UPPER",0),tul=new Sj("LOWER",1)}function qW(e,t){var n;H1(n=new gu,"x",t.a),H1(n,"y",t.b),BC(e,n)}function qK(e,t){var n;H1(n=new gu,"x",t.a),H1(n,"y",t.b),BC(e,n)}function qV(e,t){var n,r;r=!1;do n=eo5(e,t),r|=n;while(n)return r}function qq(e,t){var n,r;for(n=t,r=0;n>0;)r+=e.a[n],n-=n&-n;return r}function qZ(e,t){var n;for(n=t;n;)Lu(e,-n.i,-n.j),n=z$(n);return e}function qX(e,t){var n,r;for(BJ(t),r=e.Kc();r.Ob();)n=r.Pb(),t.td(n)}function qJ(e,t){var n;return n=t.cd(),new wD(n,e.e.pc(n,Pp(t.dd(),14)))}function qQ(e,t,n,r){var i;(i=new C).c=t,i.b=n,i.a=r,r.b=n.a=i,++e.b}function q1(e,t,n){var r;return r=(GK(t,e.c.length),e.c[t]),e.c[t]=n,r}function q0(e,t,n){return Pp(null==t?eS8(e.f,null,n):efi(e.g,t,n),281)}function q2(e){return e.c&&e.d?WH(e.c)+"->"+WH(e.d):"e_"+Ao(e)}function q3(e,t){return(el3(e),yK(new R1(e,new Qa(t,e.a)))).sd(e2z)}function q4(){return e_x(),eow(vx(e4k,1),eU4,356,0,[e9e,e9t,e9n,e9r,e9i])}function q6(){return eYu(),eow(vx(e5a,1),eGj,61,0,[tbF,tbw,tby,tbj,tbY])}function q5(e){return vg(),function(){return K1(e,this,arguments)}}function q8(){return Date.now?Date.now():(new Date).getTime()}function q9(e){return!!e.c&&!!e.d&&!!e.c.i&&e.c.i==e.d.i}function q7(e){if(!e.c.Sb())throw p7(new bC);return e.a=!0,e.c.Ub()}function Ze(e){e.i=0,Eb(e.b,null),Eb(e.c,null),e.a=null,e.e=null,++e.g}function Zt(e){El.call(this,null==e?eUg:efF(e),M4(e,78)?Pp(e,78):null)}function Zn(e){eBD(),p9(this),this.a=new _n,esJ(this,e),P7(this.a,e)}function Zr(){Tz(this),this.b=new kl(eHQ,eHQ),this.a=new kl(eH1,eH1)}function Zi(e,t){this.c=0,this.b=t,xR.call(this,e,17493),this.a=this.c}function Za(e){Zo(),!e2M&&(this.c=e,this.e=!0,this.a=new p0)}function Zo(){Zo=A,e2M=!0,e2x=!1,e2T=!1,e2A=!1,e2O=!1}function Zs(e,t){return!!M4(t,149)&&IE(e.c,Pp(t,149).c)}function Zu(e,t){var n;return n=0,e&&(n+=e.f.a/2),t&&(n+=t.f.a/2),n}function Zc(e,t){var n;return(n=Pp(eef(e.d,t),23))||Pp(eef(e.e,t),23)}function Zl(e){this.b=e,Ow.call(this,e),this.a=Pp(eaS(this.b.a,4),126)}function Zf(e){this.b=e,AY.call(this,e),this.a=Pp(eaS(this.b.a,4),126)}function Zd(e){return e.t||(e.t=new pR(e),elm(new gT(e),0,e.t)),e.t}function Zh(){return ec3(),eow(vx(e66,1),eU4,103,0,[tpv,tpg,tpm,tpb,tpy])}function Zp(){return epT(),eow(vx(e5n,1),eU4,249,0,[tbt,tbr,tp7,tbe,tbn])}function Zb(){return epx(),eow(vx(e6Q,1),eU4,175,0,[tdh,tdd,tdl,tdp,tdf])}function Zm(){return eEM(),eow(vx(e6W,1),eU4,316,0,[tfE,tfS,tfT,tfk,tfx])}function Zg(){return ebG(),eow(vx(e6n,1),eU4,315,0,[tsb,tsd,tsh,tsf,tsp])}function Zv(){return eb5(),eow(vx(e4X,1),eU4,335,0,[teG,tez,teK,teV,teW])}function Zy(){return eOB(),eow(vx(e6U,1),eU4,355,0,[tfo,tfa,tfu,tfs,tfc])}function Zw(){return ey4(),eow(vx(e4z,1),eU4,363,0,[ter,tea,teo,tei,ten])}function Z_(){return ef_(),eow(vx(e49,1),eU4,163,0,[tnj,tnD,tnN,tnP,tnR])}function ZE(){var e,t;ZE=A,tvf=(yO(),t=new bN),tvd=e=new mC}function ZS(e){var t;return!e.c&&M4(t=e.r,88)&&(e.c=Pp(t,26)),e.c}function Zk(e){return e.e=3,e.d=e.Yb(),2!=e.e&&(e.e=0,!0)}function Zx(e){var t,n,r;return t=e&eHH,Mk(t,n=e>>22&eHH,r=e<0?eH$:0)}function ZT(e){var t,n,r,i;for(r=0,i=(n=e).length;r0?ehe(e,t):eA9(e,-t)}function ZL(e,t){return 0==t||0==e.e?e:t>0?eA9(e,t):ehe(e,-t)}function ZC(e){if(eTk(e))return e.c=e.a,e.a.Pb();throw p7(new bC)}function ZI(e){var t,n;return t=e.c.i,n=e.d.i,t.k==(eEn(),e9C)&&n.k==e9C}function ZD(e){var t;return t=new $b,eaW(t,e),eo3(t,(eBy(),taR),null),t}function ZN(e,t,n){var r;return(r=e.Yg(t))>=0?e._g(r,n,!0):exk(e,t,n)}function ZP(e,t,n,r){var i;for(i=0;it)throw p7(new gE(eS1(e,t,"index")));return e}function Z1(e,t,n,r){var i;return i=Je(ty_,eHT,25,t,15,1),ewD(i,e,t,n,r),i}function Z0(e,t){var n;n=e.q.getHours()+(t/60|0),e.q.setMinutes(t),eNq(e,n)}function Z2(e,t){return eB4.Math.min(Jh(t.a,e.d.d.c),Jh(t.b,e.d.d.c))}function Z3(e,t){return xd(t)?null==t?eTx(e.f,null):eaK(e.g,t):eTx(e.f,t)}function Z4(e){this.c=e,this.a=new fz(this.c.a),this.b=new fz(this.c.b)}function Z6(){this.e=new p0,this.c=new p0,this.d=new p0,this.b=new p0}function Z5(){this.g=new bJ,this.b=new bJ,this.a=new p0,this.k=new p0}function Z8(e,t,n){this.a=e,this.c=t,this.d=n,P_(t.e,this),P_(n.b,this)}function Z9(e,t){xP.call(this,t.rd(),-6&t.qd()),BJ(e),this.a=e,this.b=t}function Z7(e,t){xR.call(this,t.rd(),-6&t.qd()),BJ(e),this.a=e,this.b=t}function Xe(e,t){xj.call(this,t.rd(),-6&t.qd()),BJ(e),this.a=e,this.b=t}function Xt(e,t,n){this.a=e,this.b=t,this.c=n,P_(e.t,this),P_(t.i,this)}function Xn(){this.b=new _n,this.a=new _n,this.b=new _n,this.a=new _n}function Xr(){Xr=A,tdx=new pO("org.eclipse.elk.labels.labelManager")}function Xi(){Xi=A,e7W=new Cm("separateLayerConnections",(eoE(),e7Z))}function Xa(){Xa=A,tuH=new SW("REGULAR",0),tuU=new SW("CRITICAL",1)}function Xo(){Xo=A,tsH=new SI("STACKED",0),tsU=new SI("SEQUENCED",1)}function Xs(){Xs=A,tfw=new S7("FIXED",0),tfy=new S7("CENTER_NODE",1)}function Xu(e,t){var n;return n=ejH(e,t),e.b=new erH(n.c.length),eRj(e,n)}function Xc(e,t,n){var r;return++e.e,--e.f,(r=Pp(e.d[t].$c(n),133)).dd()}function Xl(e){var t;return!e.a&&M4(t=e.r,148)&&(e.a=Pp(t,148)),e.a}function Xf(e){return e.a?e.e?Xf(e.e):null:e}function Xd(e,t){return e.pt.p?-1:0}function Xh(e,t){return BJ(t),e.c=0,"Initial capacity must not be negative")}function XO(){XO=A,e3R=euY((etx(),eow(vx(e25,1),eU4,232,0,[e3D,e3N,e3P])))}function XA(){XA=A,e3B=euY((Qs(),eow(vx(e27,1),eU4,461,0,[e3F,e3j,e3Y])))}function XL(){XL=A,e3z=euY((QQ(),eow(vx(e3t,1),eU4,462,0,[e3$,e3H,e3U])))}function XC(){XC=A,e2$=euY((eum(),eow(vx(e2L,1),eU4,132,0,[e2B,e2U,e2H])))}function XI(){XI=A,e85=euY((QJ(),eow(vx(e4S,1),eU4,379,0,[e84,e83,e86])))}function XD(){XD=A,e9T=euY((ec4(),eow(vx(e4L,1),eU4,423,0,[e9x,e9k,e9S])))}function XN(){XN=A,teY=euY((en7(),eow(vx(e4q,1),eU4,314,0,[tej,teR,teF])))}function XP(){XP=A,te$=euY((enB(),eow(vx(e4Z,1),eU4,337,0,[teB,teH,teU])))}function XR(){XR=A,te2=euY((eoG(),eow(vx(e4Q,1),eU4,450,0,[te1,teQ,te0])))}function Xj(){Xj=A,teb=euY((erX(),eow(vx(e4G,1),eU4,361,0,[tep,teh,ted])))}function XF(){XF=A,ttP=euY((Q1(),eow(vx(e45,1),eU4,303,0,[ttD,ttN,ttI])))}function XY(){XY=A,ttC=euY((eaU(),eow(vx(e46,1),eU4,292,0,[ttA,ttL,ttO])))}function XB(){XB=A,tsa=euY((euJ(),eow(vx(e6e,1),eU4,378,0,[tsn,tsr,tsi])))}function XU(){XU=A,tsB=euY((ei0(),eow(vx(e6s,1),eU4,375,0,[tsj,tsF,tsY])))}function XH(){XH=A,tsA=euY((esn(),eow(vx(e6i,1),eU4,339,0,[tsM,tsT,tsO])))}function X$(){X$=A,tsR=euY((enY(),eow(vx(e6o,1),eU4,452,0,[tsP,tsD,tsN])))}function Xz(){Xz=A,ts0=euY((eox(),eow(vx(e6f,1),eU4,377,0,[tsQ,ts1,tsJ])))}function XG(){XG=A,tsK=euY((euy(),eow(vx(e6c,1),eU4,336,0,[tsz,tsG,tsW])))}function XW(){XW=A,tsX=euY((eiO(),eow(vx(e6l,1),eU4,338,0,[tsZ,tsV,tsq])))}function XK(){XK=A,tuo=euY((enU(),eow(vx(e6p,1),eU4,454,0,[tur,tui,tua])))}function XV(){XV=A,tc0=euY((efx(),eow(vx(e6D,1),eU4,442,0,[tc1,tcJ,tcQ])))}function Xq(){Xq=A,tc9=euY((eub(),eow(vx(e6P,1),eU4,380,0,[tc6,tc5,tc8])))}function XZ(){XZ=A,tlj=euY((efS(),eow(vx(e6Y,1),eU4,381,0,[tlP,tlR,tlN])))}function XX(){XX=A,tlD=euY((ei1(),eow(vx(e6j,1),eU4,293,0,[tlC,tlI,tlL])))}function XJ(){XJ=A,tfp=euY((efk(),eow(vx(e6H,1),eU4,437,0,[tff,tfd,tfh])))}function XQ(){XQ=A,tpK=euY((eck(),eow(vx(e67,1),eU4,334,0,[tpG,tpz,tpW])))}function X1(){X1=A,tpk=euY((etT(),eow(vx(e65,1),eU4,272,0,[tp_,tpE,tpS])))}function X0(){return ewf(),eow(vx(e5r,1),eU4,98,0,[tbl,tbc,tbu,tba,tbs,tbo])}function X2(e,t){return e.o||(e.o=new JY((eBa(),tmy),e5O,e,0)),edG(e.o,t)}function X3(e){return e.g||(e.g=new o2),e.g.d||(e.g.d=new pD(e)),e.g.d}function X4(e){return e.g||(e.g=new o2),e.g.a||(e.g.a=new pN(e)),e.g.a}function X6(e){return e.g||(e.g=new o2),e.g.b||(e.g.b=new pI(e)),e.g.b}function X5(e){return e.g||(e.g=new o2),e.g.c||(e.g.c=new pP(e)),e.g.c}function X8(e,t,n){var r,i;for(r=0,i=new eaN(t,e);rn||t=0?e._g(n,!0,!0):exk(e,t,!0)}function JW(e,t){return elN(gP(LV(e_k(e,(eBU(),tnv)))),gP(LV(e_k(t,tnv))))}function JK(){JK=A,tcG=ehY(ehY(_G(new K2,(egR(),tuQ)),(eS_(),tu9)),tu4)}function JV(e,t,n){var r;return r=esg(e,t,n),e.b=new erH(r.c.length),eLI(e,r)}function Jq(e){if(e.b<=0)throw p7(new bC);return--e.b,e.a-=e.c.c,ell(e.a)}function JZ(e){var t;if(!e.a)throw p7(new UD);return t=e.a,e.a=z$(e.a),t}function JX(e){for(;!e.a;)if(!IM(e.c,new dr(e)))return!1;return!0}function JJ(e){var t;return(Y8(e),M4(e,198))?t=Pp(e,198):new lp(e)}function JQ(e){J1(),Pp(e.We((eBB(),thJ)),174).Fc((ekU(),tbb)),e.Ye(thX,null)}function J1(){J1=A,tdo=new os,tdu=new ou,tds=es0((eBB(),thX),tdo,thL,tdu)}function J0(){J0=A,tc2=new S2("LEAF_NUMBER",0),tc3=new S2("NODE_SIZE",1)}function J2(e,t,n){e.a=t,e.c=n,e.b.a.$b(),HC(e.d),e.e.a.c=Je(e1R,eUp,1,0,5,1)}function J3(e){e.a=Je(ty_,eHT,25,e.b+1,15,1),e.c=Je(ty_,eHT,25,e.b,15,1),e.d=0}function J4(e,t){e.a.ue(t.d,e.b)>0&&(P_(e.c,new PW(t.c,t.d,e.d)),e.b=t.d)}function J6(e,t){if(null==e.g||t>=e.i)throw p7(new xJ(t,e.i));return e.g[t]}function J5(e,t,n){if(euu(e,n),null!=n&&!e.wj(n))throw p7(new bS);return n}function J8(e){var t;if(e.Ek())for(t=e.i-1;t>=0;--t)etj(e,t);return VY(e)}function J9(e){var t,n;if(!e.b)return null;for(n=e.b;t=n.a[0];)n=t;return n}function J7(e,t){var n,r;return qe(t),(n=QO(r=e.slice(0,t),e)).length=t,n}function Qe(e,t,n,r){var i;r=(HF(),r||e2s),eS0(i=e.slice(t,n),e,t,n,-t,r)}function Qt(e,t,n,r,i){return t<0?exk(e,n,r):Pp(n,66).Nj().Pj(e,e.yh(),t,r,i)}function Qn(e){return M4(e,172)?""+Pp(e,172).a:null==e?null:efF(e)}function Qr(e){return M4(e,172)?""+Pp(e,172).a:null==e?null:efF(e)}function Qi(e,t){if(t.a)throw p7(new go(e$P));Yf(e.a,t),t.a=e,e.j||(e.j=t)}function Qa(e,t){xj.call(this,t.rd(),-16449&t.qd()),BJ(e),this.a=e,this.c=t}function Qo(e,t){var n,r;return r=t/e.c.Hd().gc()|0,n=t%e.c.Hd().gc(),X_(e,r,n)}function Qs(){Qs=A,e3F=new EY(ezt,0),e3j=new EY(e$9,1),e3Y=new EY(ezn,2)}function Qu(){Qu=A,e2D=new Ef("All",0),e2N=new TH,e2P=new ML,e2R=new T$}function Qc(){Qc=A,e2j=euY((Qu(),eow(vx(e2E,1),eU4,297,0,[e2D,e2N,e2P,e2R])))}function Ql(){Ql=A,e9b=euY((eok(),eow(vx(e4A,1),eU4,405,0,[e9f,e9p,e9d,e9h])))}function Qf(){Qf=A,e4l=euY((eaY(),eow(vx(e3r,1),eU4,406,0,[e4c,e4o,e4s,e4u])))}function Qd(){Qd=A,e4b=euY((ep7(),eow(vx(e3i,1),eU4,323,0,[e4d,e4f,e4h,e4p])))}function Qh(){Qh=A,e5z=euY((ebe(),eow(vx(e4y,1),eU4,394,0,[e5U,e5B,e5H,e5$])))}function Qp(){Qp=A,tu2=euY((egR(),eow(vx(e6T,1),eU4,393,0,[tuJ,tuQ,tu1,tu0])))}function Qb(){Qb=A,e7X=euY((eoE(),eow(vx(e4U,1),eU4,360,0,[e7Z,e7V,e7q,e7K])))}function Qm(){Qm=A,tlA=euY((emC(),eow(vx(e6R,1),eU4,340,0,[tlO,tlT,tlM,tlx])))}function Qg(){Qg=A,tet=euY((eoS(),eow(vx(e4$,1),eU4,411,0,[e78,e79,e77,tee])))}function Qv(){Qv=A,tsl=euY((ebk(),eow(vx(e6t,1),eU4,197,0,[tsu,tsc,tss,tso])))}function Qy(){Qy=A,tmo=euY((eup(),eow(vx(e5l,1),eU4,396,0,[tmr,tmi,tmn,tma])))}function Qw(){Qw=A,tpJ=euY((egF(),eow(vx(e5e,1),eU4,285,0,[tpX,tpV,tpq,tpZ])))}function Q_(){Q_=A,tpA=euY((efE(),eow(vx(e68,1),eU4,218,0,[tpO,tpT,tpx,tpM])))}function QE(){QE=A,tmt=euY((edM(),eow(vx(e5u,1),eU4,311,0,[tme,tb8,tb7,tb9])))}function QS(){QS=A,tbZ=euY((ed5(),eow(vx(e5o,1),eU4,374,0,[tbV,tbq,tbK,tbW])))}function Qk(){Qk=A,ePm(),tvq=eHQ,tvV=eH1,tvX=new fL(eHQ),tvZ=new fL(eH1)}function Qx(){Qx=A,ttt=new Sb(eGR,0),tte=new Sb("IMPROVE_STRAIGHTNESS",1)}function QT(e,t){return Pj(),P_(e,new kD(t,ell(t.e.c.length+t.g.c.length)))}function QM(e,t){return Pj(),P_(e,new kD(t,ell(t.e.c.length+t.g.c.length)))}function QO(e,t){return 10!=eeg(t)&&eow(esF(t),t.hm,t.__elementTypeId$,eeg(t),e),e}function QA(e,t){var n;return -1!=(n=QI(e,t,0))&&(ZV(e,n),!0)}function QL(e,t){var n;return(n=Pp(Z3(e.e,t),387))?(Re(n),n.e):null}function QC(e){var t;return Ts(e)&&!isNaN(t=0-e)?t:eal(eoQ(e))}function QI(e,t,n){for(;n=0?ebl(e,n,!0,!0):exk(e,t,!0)}function Q9(e,t){var n,r;return _L(),n=Vm(e),r=Vm(t),!!n&&!!r&&!ep6(n.k,r.k)}function Q7(e,t){eno(e,null==t||IX((BJ(t),t))||isNaN((BJ(t),t))?0:(BJ(t),t))}function eee(e,t){ens(e,null==t||IX((BJ(t),t))||isNaN((BJ(t),t))?0:(BJ(t),t))}function eet(e,t){ena(e,null==t||IX((BJ(t),t))||isNaN((BJ(t),t))?0:(BJ(t),t))}function een(e,t){eni(e,null==t||IX((BJ(t),t))||isNaN((BJ(t),t))?0:(BJ(t),t))}function eer(e){(this.q?this.q:(Hj(),Hj(),e2i)).Ac(e.q?e.q:(Hj(),Hj(),e2i))}function eei(e,t){return M4(t,99)&&(Pp(t,18).Bb&eH3)!=0?new x1(t,e):new eaN(t,e)}function eea(e,t){return M4(t,99)&&(Pp(t,18).Bb&eH3)!=0?new x1(t,e):new eaN(t,e)}function eeo(e,t){e4g=new e0,e4v=t,Pp((e4m=e).b,65),Jr(e4m,e4g,null),eRk(e4m)}function ees(e,t,n){var r;return r=e.g[t],Of(e,t,e.oi(t,n)),e.gi(t,n,r),e.ci(),r}function eeu(e,t){var n;return(n=e.Xc(t))>=0&&(e.$c(n),!0)}function eec(e){var t;return e.d!=e.r&&(t=evl(e),e.e=!!t&&t.Cj()==eJK,e.d=t),e.e}function eel(e,t){var n;for(Y8(e),Y8(t),n=!1;t.Ob();)n|=e.Fc(t.Pb());return n}function eef(e,t){var n;return(n=Pp(Bp(e.e,t),387))?(M5(e,n),n.e):null}function eed(e){var t,n;return(t=e/60|0,0==(n=e%60))?""+t:""+t+":"+n}function eeh(e,t){var n,r;return el3(e),r=new Xe(t,e.a),n=new IU(r),new R1(e,n)}function eep(e,t){var n=e.a[t],r=(eoW(),e0O)[typeof n];return r?r(n):euV(typeof n)}function eeb(e){switch(e.g){case 0:return eUu;case 1:return -1;default:return 0}}function eem(e){return 0>evy(e,(Q2(),e0D))?-As(eoQ(e)):e.l+e.m*eHG+e.h*eHW}function eeg(e){return null==e.__elementTypeCategory$?10:e.__elementTypeCategory$}function eev(e){var t;return null!=(t=0==e.b.c.length?null:RJ(e.b,0))&&erD(e,0),t}function eey(e,t){for(;t[0]=0;)++t[0]}function eew(e,t){this.e=t,this.a=eaJ(e),this.a<54?this.f=Kj(e):this.c=ep_(e)}function ee_(e,t,n,r){eBG(),pJ.call(this,26),this.c=e,this.a=t,this.d=n,this.b=r}function eeE(e,t,n){var r,i;for(i=0,r=10;ie.a[r]&&(r=n);return r}function eeI(e,t){var n;return 0==(n=efT(e.e.c,t.e.c))?elN(e.e.d,t.e.d):n}function eeD(e,t){return 0==t.e||0==e.e?e09:(exX(),eAl(e,t))}function eeN(e,t){if(!e)throw p7(new gL(eAL("Enum constant undefined: %s",t)))}function eeP(){eeP=A,e9v=new tp,e9y=new td,e9m=new ty,e9g=new tw,e9w=new t_}function eeR(){eeR=A,e3h=new ER("BY_SIZE",0),e3p=new ER("BY_SIZE_AND_SHAPE",1)}function eej(){eej=A,e8f=new EH("EADES",0),e8d=new EH("FRUCHTERMAN_REINGOLD",1)}function eeF(){eeF=A,teZ=new Sd("READING_DIRECTION",0),teX=new Sd("ROTATION",1)}function eeY(){eeY=A,teq=euY((eb5(),eow(vx(e4X,1),eU4,335,0,[teG,tez,teK,teV,teW])))}function eeB(){eeB=A,tsm=euY((ebG(),eow(vx(e6n,1),eU4,315,0,[tsb,tsd,tsh,tsf,tsp])))}function eeU(){eeU=A,tes=euY((ey4(),eow(vx(e4z,1),eU4,363,0,[ter,tea,teo,tei,ten])))}function eeH(){eeH=A,tnF=euY((ef_(),eow(vx(e49,1),eU4,163,0,[tnj,tnD,tnN,tnP,tnR])))}function ee$(){ee$=A,tfM=euY((eEM(),eow(vx(e6W,1),eU4,316,0,[tfE,tfS,tfT,tfk,tfx])))}function eez(){eez=A,tdb=euY((epx(),eow(vx(e6Q,1),eU4,175,0,[tdh,tdd,tdl,tdp,tdf])))}function eeG(){eeG=A,tfl=euY((eOB(),eow(vx(e6U,1),eU4,355,0,[tfo,tfa,tfu,tfs,tfc])))}function eeW(){eeW=A,e9a=euY((e_x(),eow(vx(e4k,1),eU4,356,0,[e9e,e9t,e9n,e9r,e9i])))}function eeK(){eeK=A,tpw=euY((ec3(),eow(vx(e66,1),eU4,103,0,[tpv,tpg,tpm,tpb,tpy])))}function eeV(){eeV=A,tbi=euY((epT(),eow(vx(e5n,1),eU4,249,0,[tbt,tbr,tp7,tbe,tbn])))}function eeq(){eeq=A,tbB=euY((eYu(),eow(vx(e5a,1),eGj,61,0,[tbF,tbw,tby,tbj,tbY])))}function eeZ(e,t){var n;return(n=Pp(Bp(e.a,t),134))||(n=new eX,Um(e.a,t,n)),n}function eeX(e){var t;return!!(t=Pp(e_k(e,(eBU(),ttU)),305))&&t.a==e}function eeJ(e){var t;return!!(t=Pp(e_k(e,(eBU(),ttU)),305))&&t.i==e}function eeQ(e,t){return BJ(t),FD(e),!!e.d.Ob()&&(t.td(e.d.Pb()),!0)}function ee1(e){return ecd(e,eUu)>0?eUu:0>ecd(e,eHt)?eHt:jE(e)}function ee0(e){return e<3?(enG(e,eU0),e+1):e=0&&t=-.01&&e.a<=ezs&&(e.a=0),e.b>=-.01&&e.b<=ezs&&(e.b=0),e}function ee6(e,t){return t==(I9(),I9(),e2p)?e.toLocaleLowerCase():e.toLowerCase()}function ee5(e){return((2&e.i)!=0?"interface ":(1&e.i)!=0?"":"class ")+(LW(e),e.o)}function ee8(e){var t,n;n=t=new mD,JL((e.q||(e.q=new FQ(tgi,e,11,10)),e.q),n)}function ee9(e,t){var n;return n=t>0?t-1:t,yr(yi(eny(P5(new mV,n),e.n),e.j),e.k)}function ee7(e,t,n,r){var i;e.j=-1,ex9(e,eSu(e,t,n),(_4(),(i=Pp(t,66).Mj()).Ok(r)))}function ete(e){this.g=e,this.f=new p0,this.a=eB4.Math.min(this.g.c.c,this.g.d.c)}function ett(e){this.b=new p0,this.a=new p0,this.c=new p0,this.d=new p0,this.e=e}function etn(e,t){this.a=new p2,this.e=new p2,this.b=(euJ(),tsi),this.c=e,this.b=t}function etr(e,t,n){CK.call(this),etk(this),this.a=e,this.c=n,this.b=t.d,this.f=t.e}function eti(e){this.d=e,this.c=e.c.vc().Kc(),this.b=null,this.a=null,this.e=(m6(),e0m)}function eta(e){if(e<0)throw p7(new gL("Illegal Capacity: "+e));this.g=this.ri(e)}function eto(e,t){if(0>e||e>t)throw p7(new va("fromIndex: 0, toIndex: "+e+e$m+t))}function ets(e){var t;if(e.a==e.b.a)throw p7(new bC);return t=e.a,e.c=t,e.a=e.a.e,t}function etu(e){var t;A4(!!e.c),t=e.c.a,etw(e.d,e.c),e.b==e.c?e.b=t:--e.a,e.c=null}function etc(e,t){var n;return el3(e),n=new HA(e,e.a.rd(),4|e.a.qd(),t),new R1(e,n)}function etl(e,t){var n,r;return(n=Pp(ecA(e.d,t),14))?(r=t,e.e.pc(r,n)):null}function etf(e,t){var n,r;for(r=e.Kc();r.Ob();)eo3(n=Pp(r.Pb(),70),(eBU(),tnt),t)}function etd(e){var t;return(t=gP(LV(e_k(e,(eBy(),tak)))))<0&&eo3(e,tak,t=0),t}function eth(e,t,n){var r;ev_(n,r=eB4.Math.max(0,e.b/2-.5),1),P_(t,new EJ(n,r))}function etp(e,t,n){var r;return zy(Ra(r=e.a.e[Pp(t.a,10).p]-e.a.e[Pp(n.a,10).p]))}function etb(e,t,n,r,i,a){var o;o=ZD(r),Gs(o,i),Go(o,a),exg(e.a,r,new DT(o,t,n.f))}function etm(e,t){var n;if(!(n=eAh(e.Tg(),t)))throw p7(new gL(eZV+t+eZX));return n}function etg(e,t){var n;for(n=e;z$(n);)if((n=z$(n))==t)return!0;return!1}function etv(e,t){var n,r,i;for(i=0,r=t.a.cd(),n=Pp(t.a.dd(),14).gc();i0&&(e.a/=t,e.b/=t),e}function etP(e){var t;return e.w?e.w:((t=Ww(e))&&!t.kh()&&(e.w=t),t)}function etR(e){var t;return null==e?null:e_e(t=Pp(e,190),t.length)}function etj(e,t){if(null==e.g||t>=e.i)throw p7(new xJ(t,e.i));return e.li(t,e.g[t])}function etF(e){var t,n;for(t=e.a.d.j,n=e.c.d.j;t!=n;)erC(e.b,t),t=elI(t);erC(e.b,t)}function etY(e){var t;for(t=0;t=14&&t<=16)),e}function etW(e,t,n){var r=function(){return e.apply(r,arguments)};return t.apply(r,n),r}function etK(e,t,n){var r,i;r=t;do i=gP(e.p[r.p])+n,e.p[r.p]=i,r=e.a[r.p];while(r!=t)}function etV(e,t){var n,r;r=e.a,n=elr(e,t,null),r==t||e.e||(n=eFr(e,t,n)),n&&n.Fi()}function etq(e,t){return Mc(),enj(eHe),eB4.Math.abs(e-t)<=eHe||e==t||isNaN(e)&&isNaN(t)}function etZ(e,t){return Mc(),enj(eHe),eB4.Math.abs(e-t)<=eHe||e==t||isNaN(e)&&isNaN(t)}function etX(e,t){return e_z(),ME(e.b.c.length-e.e.c.length,t.b.c.length-t.e.c.length)}function etJ(e,t){return yk(eif(e,t,jE(efn(eUJ,Ux(jE(efn(null==t?0:esj(t),eUQ)),15)))))}function etQ(){etQ=A,e9R=euY((eEn(),eow(vx(e4P,1),eU4,267,0,[e9N,e9D,e9C,e9P,e9I,e9L])))}function et1(){et1=A,tdJ=euY((eyY(),eow(vx(e64,1),eU4,291,0,[tdX,tdZ,tdq,tdK,tdW,tdV])))}function et0(){et0=A,tdD=euY((ebx(),eow(vx(e63,1),eU4,248,0,[tdM,tdL,tdC,tdI,tdO,tdA])))}function et2(){et2=A,teI=euY((eSg(),eow(vx(e4K,1),eU4,227,0,[teO,teL,teM,teA,teC,teT])))}function et3(){et3=A,ttm=euY((e_3(),eow(vx(e43,1),eU4,275,0,[ttp,ttf,ttb,tth,ttd,ttl])))}function et4(){et4=A,ttc=euY((eyd(),eow(vx(e42,1),eU4,274,0,[tto,tta,ttu,tti,tts,ttr])))}function et6(){et6=A,tst=euY((ewY(),eow(vx(e47,1),eU4,313,0,[to7,to8,to6,to5,tse,to9])))}function et5(){et5=A,te7=euY((eEf(),eow(vx(e41,1),eU4,276,0,[te4,te3,te5,te6,te9,te8])))}function et8(){et8=A,tu7=euY((eS_(),eow(vx(e6A,1),eU4,327,0,[tu9,tu4,tu5,tu6,tu8,tu3])))}function et9(){et9=A,tbv=euY((ekU(),eow(vx(e5i,1),eU4,273,0,[tbm,tbp,tbb,tbh,tbd,tbg])))}function et7(){et7=A,tpR=euY((e_a(),eow(vx(e69,1),eU4,312,0,[tpN,tpI,tpP,tpL,tpD,tpC])))}function ene(){return eT7(),eow(vx(e5t,1),eU4,93,0,[tp1,tpQ,tp2,tp8,tp5,tp6,tp3,tp4,tp0])}function ent(e,t){var n;n=e.a,e.a=t,(4&e.Db)!=0&&(1&e.Db)==0&&eam(e,new qo(e,0,n,e.a))}function enn(e,t){var n;n=e.b,e.b=t,(4&e.Db)!=0&&(1&e.Db)==0&&eam(e,new qo(e,1,n,e.b))}function enr(e,t){var n;n=e.b,e.b=t,(4&e.Db)!=0&&(1&e.Db)==0&&eam(e,new qo(e,3,n,e.b))}function eni(e,t){var n;n=e.f,e.f=t,(4&e.Db)!=0&&(1&e.Db)==0&&eam(e,new qo(e,3,n,e.f))}function ena(e,t){var n;n=e.g,e.g=t,(4&e.Db)!=0&&(1&e.Db)==0&&eam(e,new qo(e,4,n,e.g))}function eno(e,t){var n;n=e.i,e.i=t,(4&e.Db)!=0&&(1&e.Db)==0&&eam(e,new qo(e,5,n,e.i))}function ens(e,t){var n;n=e.j,e.j=t,(4&e.Db)!=0&&(1&e.Db)==0&&eam(e,new qo(e,6,n,e.j))}function enu(e,t){var n;n=e.j,e.j=t,(4&e.Db)!=0&&(1&e.Db)==0&&eam(e,new qo(e,1,n,e.j))}function enc(e,t){var n;n=e.c,e.c=t,(4&e.Db)!=0&&(1&e.Db)==0&&eam(e,new qo(e,4,n,e.c))}function enl(e,t){var n;n=e.k,e.k=t,(4&e.Db)!=0&&(1&e.Db)==0&&eam(e,new qo(e,2,n,e.k))}function enf(e,t){var n;n=e.d,e.d=t,(4&e.Db)!=0&&(1&e.Db)==0&&eam(e,new qs(e,2,n,e.d))}function end(e,t){var n;n=e.s,e.s=t,(4&e.Db)!=0&&(1&e.Db)==0&&eam(e,new qs(e,4,n,e.s))}function enh(e,t){var n;n=e.t,e.t=t,(4&e.Db)!=0&&(1&e.Db)==0&&eam(e,new qs(e,5,n,e.t))}function enp(e,t){var n;n=e.F,e.F=t,(4&e.Db)!=0&&(1&e.Db)==0&&eam(e,new FX(e,1,5,n,t))}function enb(e,t){var n;return(n=Pp(Bp((_6(),tmU),e),55))?n.xj(t):Je(e1R,eUp,1,t,5,1)}function enm(e,t){var n,r;return(n=t in e.a)&&(r=zR(e,t).he())?r.a:null}function eng(e,t){var n,r,i;return n=(r=(yT(),i=new o0),t&&eAu(r,t),r),eri(n,e),n}function env(e,t,n){if(euu(e,n),!e.Bk()&&null!=n&&!e.wj(n))throw p7(new bS);return n}function eny(e,t){return e.n=t,e.n?(e.f=new p0,e.e=new p0):(e.f=null,e.e=null),e}function enw(e,t,n,r,i,a){var o;return enA(n,o=Y5(e,t)),o.i=i?8:0,o.f=r,o.e=i,o.g=a,o}function en_(e,t,n,r,i){this.d=t,this.k=r,this.f=i,this.o=-1,this.p=1,this.c=e,this.a=n}function enE(e,t,n,r,i){this.d=t,this.k=r,this.f=i,this.o=-1,this.p=2,this.c=e,this.a=n}function enS(e,t,n,r,i){this.d=t,this.k=r,this.f=i,this.o=-1,this.p=6,this.c=e,this.a=n}function enk(e,t,n,r,i){this.d=t,this.k=r,this.f=i,this.o=-1,this.p=7,this.c=e,this.a=n}function enx(e,t,n,r,i){this.d=t,this.j=r,this.e=i,this.o=-1,this.p=4,this.c=e,this.a=n}function enT(e,t){var n,r,i,a;for(i=0,a=(r=t).length;i=0),0>ehP(e.d,e.c)&&(e.a=e.a-1&e.d.a.length-1,e.b=e.d.c),e.c=-1}function enR(e){return e.a<54?e.f<0?-1:e.f>0?1:0:(e.c||(e.c=euK(e.f)),e.c).e}function enj(e){if(!(e>=0))throw p7(new gL("tolerance ("+e+") must be >= 0"));return e}function enF(){return tdc||(tdc=new eC$,es4(tdc,eow(vx(e20,1),eUp,130,0,[new cZ]))),tdc}function enY(){enY=A,tsP=new SL(ezo,0),tsD=new SL("INPUT",1),tsN=new SL("OUTPUT",2)}function enB(){enB=A,teB=new Sl("ARD",0),teH=new Sl("MSD",1),teU=new Sl("MANUAL",2)}function enU(){enU=A,tur=new SR("BARYCENTER",0),tui=new SR(eG7,1),tua=new SR(eWe,2)}function enH(e,t){var n;if(n=e.gc(),t<0||t>n)throw p7(new Ii(t,n));return new IB(e,t)}function en$(e,t){var n;return M4(t,42)?e.c.Mc(t):(n=edG(e,t),ehx(e,t),n)}function enz(e,t,n){return eu2(e,t),er3(e,n),end(e,0),enh(e,1),els(e,!0),eli(e,!0),e}function enG(e,t){if(e<0)throw p7(new gL(t+" cannot be negative but was: "+e));return e}function enW(e,t){var n,r;for(n=0,r=e.gc();n0)?Pp(RJ(n.a,r-1),10):null}function ert(e,t){var n;n=e.k,e.k=t,(4&e.Db)!=0&&(1&e.Db)==0&&eam(e,new FX(e,1,2,n,e.k))}function ern(e,t){var n;n=e.f,e.f=t,(4&e.Db)!=0&&(1&e.Db)==0&&eam(e,new FX(e,1,8,n,e.f))}function err(e,t){var n;n=e.i,e.i=t,(4&e.Db)!=0&&(1&e.Db)==0&&eam(e,new FX(e,1,7,n,e.i))}function eri(e,t){var n;n=e.a,e.a=t,(4&e.Db)!=0&&(1&e.Db)==0&&eam(e,new FX(e,1,8,n,e.a))}function era(e,t){var n;n=e.b,e.b=t,(4&e.Db)!=0&&(1&e.Db)==0&&eam(e,new FX(e,1,0,n,e.b))}function ero(e,t){var n;n=e.b,e.b=t,(4&e.Db)!=0&&(1&e.Db)==0&&eam(e,new FX(e,1,0,n,e.b))}function ers(e,t){var n;n=e.c,e.c=t,(4&e.Db)!=0&&(1&e.Db)==0&&eam(e,new FX(e,1,1,n,e.c))}function eru(e,t){var n;n=e.c,e.c=t,(4&e.Db)!=0&&(1&e.Db)==0&&eam(e,new FX(e,1,1,n,e.c))}function erc(e,t){var n;n=e.c,e.c=t,(4&e.Db)!=0&&(1&e.Db)==0&&eam(e,new FX(e,1,4,n,e.c))}function erl(e,t){var n;n=e.d,e.d=t,(4&e.Db)!=0&&(1&e.Db)==0&&eam(e,new FX(e,1,1,n,e.d))}function erf(e,t){var n;n=e.D,e.D=t,(4&e.Db)!=0&&(1&e.Db)==0&&eam(e,new FX(e,1,2,n,e.D))}function erd(e,t){e.r>0&&e.c0&&0!=e.g&&erd(e.i,t/e.r*e.i.d))}function erh(e,t,n){var r;e.b=t,e.a=n,r=(512&e.a)==512?new mU:new u7,e.c=eLV(r,e.b,e.a)}function erp(e,t){return eLt(e.e,t)?(_4(),eec(t)?new RA(t,e):new xe(t,e)):new xr(t,e)}function erb(e,t){return yS(eid(e.a,t,jE(efn(eUJ,Ux(jE(efn(null==t?0:esj(t),eUQ)),15)))))}function erm(e,t,n){return Qz(e,new f8(t),new ea,new f9(n),eow(vx(e2L,1),eU4,132,0,[]))}function erg(e){var t,n;return 0>e?new _e:(t=e+1,n=new Zi(t,e),new L0(null,n))}function erv(e,t){var n;return Hj(),n=new w9(1),xd(e)?Ge(n,e,t):eS8(n.f,e,t),new f$(n)}function ery(e,t){var n,r;return(n=e.o+e.p)<(r=t.o+t.p)?-1:n==r?0:1}function erw(e){var t;return(t=e_k(e,(eBU(),tnc)),M4(t,160))?edo(Pp(t,160)):null}function er_(e){var t;return(t=esi(e=eB4.Math.max(e,2)),e>t)?(t<<=1)>0?t:eU2:t}function erE(e){switch(OZ(3!=e.e),e.e){case 2:return!1;case 0:return!0}return Zk(e)}function erS(e,t){var n;return!!M4(t,8)&&(n=Pp(t,8),e.a==n.a&&e.b==n.b)}function erk(e,t,n){var r,i,a;return a=t>>5,i=31&t,r=WM(Fy(e.n[n][a],jE(Fg(i,1))),3)}function erx(e,t){var n,r;for(r=t.vc().Kc();r.Ob();)evQ(e,(n=Pp(r.Pb(),42)).cd(),n.dd())}function erT(e,t){var n;n=new e0,Pp(t.b,65),Pp(t.b,65),Pp(t.b,65),ety(t.a,new N8(e,n,t))}function erM(e,t){var n;n=e.b,e.b=t,(4&e.Db)!=0&&(1&e.Db)==0&&eam(e,new FX(e,1,21,n,e.b))}function erO(e,t){var n;n=e.d,e.d=t,(4&e.Db)!=0&&(1&e.Db)==0&&eam(e,new FX(e,1,11,n,e.d))}function erA(e,t){var n;n=e.j,e.j=t,(4&e.Db)!=0&&(1&e.Db)==0&&eam(e,new FX(e,1,13,n,e.j))}function erL(e,t,n){var r,i,a;for(a=e.a.length-1,i=e.b,r=0;r>>31;0!=r&&(e[n]=r)}function eip(e,t){var n,r;for(Hj(),r=new p0,n=0;n0&&(this.g=this.ri(this.i+(this.i/8|0)+1),e.Qc(this.g))}function eiR(e,t){PJ.call(this,tgd,e,t),this.b=this,this.a=eAY(e.Tg(),ee2(this.e.Tg(),this.c))}function eij(e,t){var n,r;for(BJ(t),r=t.vc().Kc();r.Ob();)n=Pp(r.Pb(),42),e.zc(n.cd(),n.dd())}function eiF(e,t,n){var r;for(r=n.Kc();r.Ob();)if(!Vq(e,t,r.Pb()))return!1;return!0}function eiY(e,t,n,r,i){var a;return n&&(a=edv(t.Tg(),e.c),i=n.gh(t,-1-(-1==a?r:a),null,i)),i}function eiB(e,t,n,r,i){var a;return n&&(a=edv(t.Tg(),e.c),i=n.ih(t,-1-(-1==a?r:a),null,i)),i}function eiU(e){var t;if(-2==e.b){if(0==e.e)t=-1;else for(t=0;0==e.a[t];t++);e.b=t}return e.b}function eiH(e){switch(e.g){case 2:return eYu(),tbY;case 4:return eYu(),tby;default:return e}}function ei$(e){switch(e.g){case 1:return eYu(),tbj;case 3:return eYu(),tbw;default:return e}}function eiz(e){var t,n,r;return e.j==(eYu(),tbw)&&(t=eTt(e),n=Aa(t,tby),(r=Aa(t,tbY))||r&&n)}function eiG(e){var t,n;return t=Pp(e.e&&e.e(),9),n=Pp(YR(t,t.length),9),new I1(t,n,t.length)}function eiW(e,t){ewG(t,eG8,1),efJ(_p(new dp((__(),new U7(e,!1,!1,new tO))))),eEj(t)}function eiK(e,t){return OQ(),xd(e)?ZZ(e,Lq(t)):xf(e)?F_(e,LV(t)):xl(e)?Fw(e,LK(t)):e.wd(t)}function eiV(e,t){t.q=e,e.d=eB4.Math.max(e.d,t.r),e.b+=t.d+(0==e.a.c.length?0:e.c),P_(e.a,t)}function eiq(e,t){var n,r,i,a;return i=e.c,n=e.c+e.b,a=e.d,r=e.d+e.a,t.a>i&&t.aa&&t.b1||e.Ob())return++e.a,e.g=0,t=e.i,e.Ob(),t;throw p7(new bC)}function eaA(e){var t;return Ma(),En(tuT,e)||((t=new af).a=e,CM(tuT,e,t)),Pp(UA(tuT,e),635)}function eaL(e){var t,n,r,i;return r=0,(i=e)<0&&(i+=eHW,r=eH$),n=zy(i/eHG),Mk(t=zy(i-n*eHG),n,r)}function eaC(e){var t,n,r;for(r=0,n=new _t(e.a);n.aecd(e,0)&&(e=PN(e)),64-(0!=(t=jE(Fv(e,32)))?exv(t):exv(jE(e))+32)}function eaQ(e){var t;return t=Pp(e_k(e,(eBU(),tt1)),61),e.k==(eEn(),e9C)&&(t==(eYu(),tbY)||t==tby)}function ea1(e,t,n){var r,i;(i=Pp(e_k(e,(eBy(),taR)),74))&&(eu_(r=new mE,0,i),etH(r,n),er7(t,r))}function ea0(e,t,n){var r,i,a,o;r=(o=Bq(e)).d,i=o.c,a=e.n,t&&(a.a=a.a-r.b-i.a),n&&(a.b=a.b-r.d-i.b)}function ea2(e,t){var n,r;return(n=e.j)!=(r=t.j)?n.g-r.g:e.p==t.p?0:n==(eYu(),tbw)?e.p-t.p:t.p-e.p}function ea3(e){var t,n;for(eYp(e),n=new fz(e.d);n.a>22),i=e.h+t.h+(r>>22),Mk(n&eHH,r&eHH,i&eH$)}function eor(e,t){var n,r,i;return n=e.l-t.l,r=e.m-t.m+(n>>22),i=e.h-t.h+(r>>22),Mk(n&eHH,r&eHH,i&eH$)}function eoi(e){var t;return e<128?((t=(RH(),e0Y)[e])||(t=e0Y[e]=new fA(e)),t):new fA(e)}function eoa(e){var t;return M4(e,78)?e:((t=e&&e.__java$exception)||(t=new euq(e),by(t)),t)}function eoo(e){if(M4(e,186))return Pp(e,118);if(e)return null;throw p7(new gD(eXR))}function eos(e,t){if(null==t)return!1;for(;e.a!=e.b;)if(ecX(t,ecn(e)))return!0;return!1}function eou(e){return!!e.a.Ob()||e.a==e.d&&(e.a=new KU(e.e.f),e.a.Ob())}function eoc(e,t){var n,r;return 0!=(r=(n=t.Pc()).length)&&(PO(e.c,e.c.length,n),!0)}function eol(e,t,n){var r,i;for(i=t.vc().Kc();i.Ob();)r=Pp(i.Pb(),42),e.yc(r.cd(),r.dd(),n);return e}function eof(e,t){var n,r;for(r=new fz(e.b);r.a=0,"Negative initial capacity"),PG(t>=0,"Non-positive load factor"),Yy(this)}function eoV(e,t,n){return!(e>=128)&&(e<64?xg(WM(Fg(1,e),n),0):xg(WM(Fg(1,e-64),t),0))}function eoq(e,t){return!!e&&!!t&&e!=t&&0>efT(e.b.c,t.b.c+t.b.b)&&0>efT(t.b.c,e.b.c+e.b.b)}function eoZ(e){var t,n,r;return n=e.n,r=e.o,t=e.d,new Hr(n.a-t.b,n.b-t.d,r.a+(t.b+t.c),r.b+(t.d+t.a))}function eoX(e){var t,n,r,i;for(n=e.a,r=0,i=n.length;r(r=e.gc()))throw p7(new Ii(t,r));return e.hi()&&(n=zG(e,n)),e.Vh(t,n)}function eo2(e,t,n){return null==n?(e.q||(e.q=new p2),Z3(e.q,t)):(e.q||(e.q=new p2),Um(e.q,t,n)),e}function eo3(e,t,n){return null==n?(e.q||(e.q=new p2),Z3(e.q,t)):(e.q||(e.q=new p2),Um(e.q,t,n)),e}function eo4(e){var t,n;return n=new Z6,eaW(n,e),eo3(n,(erV(),e8j),e),t=new p2,eNY(e,n,t),eFS(e,n,t),n}function eo6(e){var t,n,r;for(eLG(),n=Je(e60,eUP,8,2,0,1),r=0,t=0;t<2;t++)r+=.5,n[t]=emh(r,e);return n}function eo5(e,t){var n,r,i,a;for(a=0,n=!1,r=e.a[t].length;a>=1);return t}function esa(e){var t,n;return 32==(n=exv(e.h))?32==(t=exv(e.m))?exv(e.l)+32:t+20-10:n-12}function eso(e){var t;return null==(t=e.a[e.b])?null:(Bc(e.a,e.b,null),e.b=e.b+1&e.a.length-1,t)}function ess(e){var t,n;return t=e.t-e.k[e.o.p]*e.d+e.j[e.o.p]>e.f,n=e.u+e.e[e.o.p]*e.d>e.f*e.s*e.d,t||n}function esu(e,t,n){var r,i;return r=new Js(t,n),i=new H,e.b=eLg(e,e.b,r,i),i.b||++e.c,e.b.b=!1,i.d}function esc(e,t,n){var r,i,a,o;for(o=ecZ(t,n),a=0,i=o.Kc();i.Ob();)r=Pp(i.Pb(),11),Um(e.c,r,ell(a++))}function esl(e){var t,n;for(n=new fz(e.a.b);n.an&&(n=e[t]);return n}function esg(e,t,n){var r;return r=new p0,eA0(e,t,r,(eYu(),tby),!0,!1),eA0(e,n,r,tbY,!1,!1),r}function esv(e,t,n){var r,i,a,o;return a=null,i=Kq(o=t,"labels"),a=(eT2((r=new kG(e,n)).a,r.b,i),i)}function esy(e,t,n,r){var i;return!(!(i=eMv(e,t,n,r))&&(i=elh(e,n,r)))||eR3(e,t,i)?i:null}function esw(e,t,n,r){var i;return!(!(i=eMy(e,t,n,r))&&(i=elp(e,n,r)))||eR3(e,t,i)?i:null}function es_(e,t){var n;for(n=0;n1||t>=0&&e.b<3)}function esP(e){var t,n,r;for(t=new mE,r=epL(e,0);r.b!=r.d.c;)n=Pp(Vv(r),8),Ls(t,0,new TS(n));return t}function esR(e){var t,n;for(n=new fz(e.a.b);n.ar?1:0}function esJ(e,t){return!!eO2(e,t)&&(exg(e.b,Pp(e_k(t,(eBU(),ttX)),21),t),P7(e.a,t),!0)}function esQ(e){var t,n;(t=Pp(e_k(e,(eBU(),tng)),10))&&(QA((n=t.c).a,t),0==n.a.c.length&&QA(Bq(t).b,n))}function es1(e){return e2M?Je(e2k,e$_,572,0,0,1):Pp(epg(e.a,Je(e2k,e$_,572,e.a.c.length,0,1)),842)}function es0(e,t,n,r){return U_(),new gt(eow(vx(e1$,1),eUK,42,0,[(eb2(e,t),new wD(e,t)),(eb2(n,r),new wD(n,r))]))}function es2(e,t,n){var r,i;return enz(i=r=new mD,t,n),JL((e.q||(e.q=new FQ(tgi,e,11,10)),e.q),i),i}function es3(e){var t,n,r,i;for(t=0,r=Je(e17,eUP,2,n=(i=Eo(tmx,e)).length,6,1);t=e.b.c.length)&&(es5(e,2*t+1),(n=2*t+2)=0&&e[r]===t[r];r--);return r<0?0:Ei(WM(e[r],eH9),WM(t[r],eH9))?-1:1}function es7(e,t){var n,r;for(r=epL(e,0);r.b!=r.d.c;)(n=Pp(Vv(r),214)).e.length>0&&(t.td(n),n.i&&elk(n))}function eue(e,t){var n,r;return r=Pp(eaS(e.a,4),126),n=Je(e5N,eJM,415,t,0,1),null!=r&&ePD(r,0,n,0,r.length),n}function eut(e,t){var n;return n=new eCg((256&e.f)!=0,e.i,e.a,e.d,(16&e.f)!=0,e.j,e.g,t),null!=e.e||(n.c=e),n}function eun(e,t){var n,r;for(r=e.Zb().Cc().Kc();r.Ob();)if((n=Pp(r.Pb(),14)).Hc(t))return!0;return!1}function eur(e,t,n,r,i){var a,o;for(o=n;o<=i;o++)for(a=t;a<=r;a++)if(emy(e,a,o))return!0;return!1}function eui(e,t,n){var r,i,a,o;for(BJ(n),o=!1,a=e.Zc(t),i=n.Kc();i.Ob();)r=i.Pb(),a.Rb(r),o=!0;return o}function eua(e,t){var n;return e===t||!!M4(t,83)&&(n=Pp(t,83),eEB(Fc(e),n.vc()))}function euo(e,t,n){var r,i;for(i=n.Kc();i.Ob();)if(r=Pp(i.Pb(),42),e.re(t,r.dd()))return!0;return!1}function eus(e,t,n){return e.d[t.p][n.p]||(ebp(e,t,n),e.d[t.p][n.p]=!0,e.d[n.p][t.p]=!0),e.a[t.p][n.p]}function euu(e,t){if(!e.ai()&&null==t)throw p7(new gL("The 'no null' constraint is violated"));return t}function euc(e,t){null==e.D&&null!=e.B&&(e.D=e.B,e.B=null),erf(e,null==t?null:(BJ(t),t)),e.C&&e.yk(null)}function eul(e,t){var n;return!!(e&&e!=t&&Ln(t,(eBU(),tt9)))&&(n=Pp(e_k(t,(eBU(),tt9)),10))!=e}function euf(e){switch(e.i){case 2:return!0;case 1:return!1;case -1:++e.c;default:return e.pl()}}function eud(e){switch(e.i){case -2:return!0;case -1:return!1;case 1:--e.c;default:return e.ql()}}function euh(e){zL.call(this,"The given string does not match the expected format for individual spacings.",e)}function eup(){eup=A,tmr=new kN("ELK",0),tmi=new kN("JSON",1),tmn=new kN("DOT",2),tma=new kN("SVG",3)}function eub(){eub=A,tc6=new S3(eGR,0),tc5=new S3("RADIAL_COMPACTION",1),tc8=new S3("WEDGE_COMPACTION",2)}function eum(){eum=A,e2B=new Ed("CONCURRENT",0),e2U=new Ed("IDENTITY_FINISH",1),e2H=new Ed("UNORDERED",2)}function eug(){eug=A,e5q=(_y(),e5G),e5V=new xX(ezj,e5q),e5K=new pO(ezF),e5Z=new pO(ezY),e5X=new pO(ezB)}function euv(){euv=A,e72=new n1,e73=new n0,e70=new n2,e71=new n3,e7J=(BJ(e7Q=new n4),new P)}function euy(){euy=A,tsz=new SD("CONSERVATIVE",0),tsG=new SD("CONSERVATIVE_SOFT",1),tsW=new SD("SLOPPY",2)}function euw(){euw=A,tpH=new T3(15),tpU=new T2((eBB(),thN),tpH),tp$=th3,tpj=td3,tpF=thx,tpB=thO,tpY=thM}function eu_(e,t,n){var r,i,a;for(r=new _n,a=epL(n,0);a.b!=a.d.c;)i=Pp(Vv(a),8),P7(r,new TS(i));eui(e,t,r)}function euE(e){var t,n,r;for(t=0,r=Je(e60,eUP,8,e.b,0,1),n=epL(e,0);n.b!=n.d.c;)r[t++]=Pp(Vv(n),8);return r}function euS(e){var t;return 0!=(t=(e.a||(e.a=new FQ(tgn,e,9,5)),e.a)).i?_K(Pp(etj(t,0),678)):null}function euk(e,t){var n;return(n=eft(e,t),Ei(WA(e,t),0)|xm(WA(e,n),0))?n:eft(eUY,WA(Fy(n,63),1))}function eux(e,t){var n;n=null!=epB((edk(),to3))&&null!=t.wg()?gP(LV(t.wg()))/gP(LV(epB(to3))):1,Um(e.b,t,n)}function euT(e,t){var n,r;return(n=Pp(e.d.Bc(t),14))?((r=e.e.hc()).Gc(n),e.e.d-=n.gc(),n.$b(),r):null}function euM(e,t){var n,r;if(0!=(r=e.c[t]))for(e.c[t]=0,e.d-=r,n=t+1;n0)return FP(t-1,e.a.c.length),ZV(e.a,t-1);throw p7(new bL)}function euA(e,t,n){if(t<0)throw p7(new gE(eq1+t));tt)throw p7(new gL(e$x+e+e$T+t));if(e<0||t>n)throw p7(new va(e$x+e+e$M+t+e$m+n))}function euC(e){if(!e.a||(8&e.a.i)==0)throw p7(new gC("Enumeration class expected for layout option "+e.f))}function euI(e){var t;++e.j,0==e.i?e.g=null:e.ieVq?e-n>eVq:n-e>eVq)}function euG(e,t){return!e||t&&!e.j||M4(e,124)&&0==Pp(e,124).a.b?0:e.Re()}function euW(e,t){return!e||t&&!e.k||M4(e,124)&&0==Pp(e,124).a.a?0:e.Se()}function euK(e){return(eLQ(),e<0)?-1!=e?new ep4(-1,-e):e03:e<=10?e06[zy(e)]:new ep4(1,e)}function euV(e){throw eoW(),p7(new gs("Unexpected typeof result '"+e+"'; please report this bug to the GWT team"))}function euq(e){g0(),MV(this),HD(this),this.e=e,eA8(this,e),this.g=null==e?eUg:efF(e),this.a="",this.b=e,this.a=""}function euZ(){this.a=new a4,this.f=new hW(this),this.b=new hK(this),this.i=new hV(this),this.e=new hq(this)}function euX(){m5.call(this,new Ju(ee0(16))),enG(2,eUN),this.b=2,this.a=new Uc(null,null,0,null),bp(this.a,this.a)}function euJ(){euJ=A,tsn=new SS("DUMMY_NODE_OVER",0),tsr=new SS("DUMMY_NODE_UNDER",1),tsi=new SS("EQUAL",2)}function euQ(){euQ=A,e9u=zD(eow(vx(e66,1),eU4,103,0,[(ec3(),tpm),tpg])),e9c=zD(eow(vx(e66,1),eU4,103,0,[tpy,tpb]))}function eu1(e){return(eYu(),tbC).Hc(e.j)?gP(LV(e_k(e,(eBU(),tnM)))):esp(eow(vx(e60,1),eUP,8,0,[e.i.n,e.n,e.a])).b}function eu0(e){var t,n,r,i;for(n=(r=e.b.a).a.ec().Kc();n.Ob();)t=Pp(n.Pb(),561),i=new eMq(t,e.e,e.f),P_(e.g,i)}function eu2(e,t){var n,r,i;r=e.nk(t,null),i=null,t&&(i=(yO(),n=new p6),etV(i,e.r)),(r=ew3(e,i,r))&&r.Fi()}function eu3(e,t){var n,r;for(r=0!=eMU(e.d,1),n=!0;n;)n=!1,n=t.c.Tf(t.e,r),n|=eAb(e,t,r,!1),r=!r;er0(e)}function eu4(e,t){var n,r,i;return r=!1,n=t.q.d,t.di&&(eyC(t.q,i),r=n!=t.q.d)),r}function eu6(e,t){var n,r,i,a,o,s,u,c;return u=t.i,c=t.j,i=(r=e.f).i,a=r.j,o=u-i,s=c-a,n=eB4.Math.sqrt(o*o+s*s)}function eu5(e,t){var n,r;return(r=ehO(e))||(tmT||(tmT=new sh),n=(eRe(),eSR(t)),JL((r=new pq(n)).Vk(),e)),r}function eu8(e,t){var n,r;return(n=Pp(e.c.Bc(t),14))?((r=e.hc()).Gc(n),e.d-=n.gc(),n.$b(),e.mc(r)):e.jc()}function eu9(e,t){var n;for(n=0;n=e.c.b:e.a<=e.c.b))throw p7(new bC);return t=e.a,e.a+=e.c.c,++e.b,ell(t)}function eci(e){var t;return t=new ete(e),Kv(e.a,e9w,new g$(eow(vx(e4M,1),eUp,369,0,[t]))),t.d&&P_(t.f,t.d),t.f}function eca(e){var t;return eaW(t=new MA(e.a),e),eo3(t,(eBU(),tnc),e),t.o.a=e.g,t.o.b=e.f,t.n.a=e.i,t.n.b=e.j,t}function eco(e,t,n,r){var i,a;for(a=e.Kc();a.Ob();)(i=Pp(a.Pb(),70)).n.a=t.a+(r.a-i.o.a)/2,i.n.b=t.b,t.b+=i.o.b+n}function ecs(e,t,n){var r,i;for(i=t.a.a.ec().Kc();i.Ob();)if($o(e,r=Pp(i.Pb(),57),n))return!0;return!1}function ecu(e){var t,n;for(n=new fz(e.r);n.a=0?t:-t;r>0;)r%2==0?(n*=n,r=r/2|0):(i*=n,r-=1);return t<0?1/i:i}function ecw(e,t){var n,r,i;for(i=1,n=e,r=t>=0?t:-t;r>0;)r%2==0?(n*=n,r=r/2|0):(i*=n,r-=1);return t<0?1/i:i}function ec_(e){var t,n,r,i;if(null!=e){for(n=0;n0&&esJ(n=Pp(RJ(e.a,e.a.c.length-1),570),t))&&P_(e.a,new Zn(t))}function ecP(e){var t,n;Dj(),t=e.d.c-e.e.c,ety((n=Pp(e.g,145)).b,new d7(t)),ety(n.c,new he(t)),qX(n.i,new ht(t))}function ecR(e){var t;return t=new vc,t.a+="VerticalSegment ",xT(t,e.e),t.a+=" ",xM(t,OU(new ve,new fz(e.k))),t.a}function ecj(e){var t;return(t=Pp(eef(e.c.c,""),229))||(t=new GM(v3(v2(new of,""),"Other")),epy(e.c.c,"",t)),t}function ecF(e){var t;return(64&e.Db)!=0?eMT(e):(t=new O1(eMT(e)),t.a+=" (name: ",xk(t,e.zb),t.a+=")",t.a)}function ecY(e,t,n){var r,i;return i=e.sb,e.sb=t,(4&e.Db)!=0&&(1&e.Db)==0&&(r=new FX(e,1,4,i,t),n?n.Ei(r):n=r),n}function ecB(e,t){var n,r,i;for(n=0,i=efr(e,t).Kc();i.Ob();)n+=null!=e_k(r=Pp(i.Pb(),11),(eBU(),tng))?1:0;return n}function ecU(e,t,n){var r,i,a;for(r=0,a=epL(e,0);a.b!=a.d.c&&!((i=gP(LV(Vv(a))))>n);)i>=t&&++r;return r}function ecH(e,t,n){var r,i;return r=new Q$(e.e,3,13,null,(i=t.c)||(eBK(),tgA),ebv(e,t),!1),n?n.Ei(r):n=r,n}function ec$(e,t,n){var r,i;return r=new Q$(e.e,4,13,(i=t.c)||(eBK(),tgA),null,ebv(e,t),!1),n?n.Ei(r):n=r,n}function ecz(e,t,n){var r,i;return i=e.r,e.r=t,(4&e.Db)!=0&&(1&e.Db)==0&&(r=new FX(e,1,8,i,e.r),n?n.Ei(r):n=r),n}function ecG(e,t){var n,r;return(r=(n=Pp(t,676)).vk())||n.wk(r=M4(t,88)?new k8(e,Pp(t,26)):new Ke(e,Pp(t,148))),r}function ecW(e,t,n){var r;e.qi(e.i+1),r=e.oi(t,n),t!=e.i&&ePD(e.g,t,e.g,t+1,e.i-t),Bc(e.g,t,r),++e.i,e.bi(t,n),e.ci()}function ecK(e,t){var n;return t.a&&(n=t.a.a.length,e.a?xM(e.a,e.b):e.a=new O0(e.d),Ka(e.a,t.a,t.d.length,n)),e}function ecV(e,t){var n,r,i,a;if(t.vi(e.a),null!=(a=Pp(eaS(e.a,8),1936)))for(r=0,i=(n=a).length;rn)throw p7(new gE(e$x+e+e$M+t+", size: "+n));if(e>t)throw p7(new gL(e$x+e+e$T+t))}function ec5(e,t,n){if(t<0)ekN(e,n);else{if(!n.Ij())throw p7(new gL(eZV+n.ne()+eZq));Pp(n,66).Nj().Vj(e,e.yh(),t)}}function ec8(e,t,n,r,i,a,o,s){var u;for(u=n;a=r||t=s.ue(e[t],e[u])?Bc(i,a++,e[t++]):Bc(i,a++,e[u++])}function ec9(e,t,n,r,i,a){this.e=new p0,this.f=(enY(),tsP),P_(this.e,e),this.d=t,this.a=n,this.b=r,this.f=i,this.c=a}function ec7(e,t){var n,r;for(r=new Ow(e);r.e!=r.i.gc();)if(n=Pp(epH(r),26),xc(t)===xc(n))return!0;return!1}function ele(e){var t,n,r,i;for(eBW(),n=epE(),r=0,i=n.length;r=65&&e<=70?e-65+10:e>=97&&e<=102?e-97+10:e>=48&&e<=57?e-48:0}function eln(e){var t;return(64&e.Db)!=0?eMT(e):(t=new O1(eMT(e)),t.a+=" (source: ",xk(t,e.d),t.a+=")",t.a)}function elr(e,t,n){var r,i;return i=e.a,e.a=t,(4&e.Db)!=0&&(1&e.Db)==0&&(r=new FX(e,1,5,i,e.a),n?ey7(n,r):n=r),n}function eli(e,t){var n;n=(256&e.Bb)!=0,t?e.Bb|=256:e.Bb&=-257,(4&e.Db)!=0&&(1&e.Db)==0&&eam(e,new ZB(e,1,2,n,t))}function ela(e,t){var n;n=(256&e.Bb)!=0,t?e.Bb|=256:e.Bb&=-257,(4&e.Db)!=0&&(1&e.Db)==0&&eam(e,new ZB(e,1,8,n,t))}function elo(e,t){var n;n=(256&e.Bb)!=0,t?e.Bb|=256:e.Bb&=-257,(4&e.Db)!=0&&(1&e.Db)==0&&eam(e,new ZB(e,1,8,n,t))}function els(e,t){var n;n=(512&e.Bb)!=0,t?e.Bb|=512:e.Bb&=-513,(4&e.Db)!=0&&(1&e.Db)==0&&eam(e,new ZB(e,1,3,n,t))}function elu(e,t){var n;n=(512&e.Bb)!=0,t?e.Bb|=512:e.Bb&=-513,(4&e.Db)!=0&&(1&e.Db)==0&&eam(e,new ZB(e,1,9,n,t))}function elc(e,t){var n;return -1==e.b&&e.a&&(n=e.a.Gj(),e.b=n?e.c.Xg(e.a.aj(),n):edv(e.c.Tg(),e.a)),e.c.Og(e.b,t)}function ell(e){var t,n;return e>-129&&e<128?(t=e+128,(n=(Rv(),e0B)[t])||(n=e0B[t]=new fC(e)),n):new fC(e)}function elf(e){var t,n;return e>-129&&e<128?(t=e+128,(n=(RU(),e0K)[t])||(n=e0K[t]=new fD(e)),n):new fD(e)}function eld(e){var t,n;return(t=e.k)==(eEn(),e9C)&&((n=Pp(e_k(e,(eBU(),tt1)),61))==(eYu(),tbw)||n==tbj)}function elh(e,t,n){var r,i,a;return(a=i=eMC(e.b,t))&&(r=Pp(eP8(Qq(e,a),""),26))?eMv(e,r,t,n):null}function elp(e,t,n){var r,i,a;return(a=i=eMC(e.b,t))&&(r=Pp(eP8(Qq(e,a),""),26))?eMy(e,r,t,n):null}function elb(e,t){var n,r;for(r=new Ow(e);r.e!=r.i.gc();)if(n=Pp(epH(r),138),xc(t)===xc(n))return!0;return!1}function elm(e,t,n){var r;if(t>(r=e.gc()))throw p7(new Ii(t,r));if(e.hi()&&e.Hc(n))throw p7(new gL(eXB));e.Xh(t,n)}function elg(e,t){var n;if(null==(n=etJ(e.i,t)))throw p7(new gK("Node did not exist in input."));return eiX(t,n),null}function elv(e,t){var n;if(n=eAh(e,t),M4(n,322))return Pp(n,34);throw p7(new gL(eZV+t+"' is not a valid attribute"))}function ely(e,t,n){var r,i;for(r=0,i=M4(t,99)&&(Pp(t,18).Bb&eH3)!=0?new x1(t,e):new eaN(t,e);rt?1:e==t?0==e?elN(1/e,1/t):0:isNaN(e)?isNaN(t)?0:1:-1}function elP(e,t){ewG(t,"Sort end labels",1),_r(UJ(eeh(new R1(null,new Gq(e.b,16)),new t2),new t3),new t4),eEj(t)}function elR(e,t,n){var r,i;return e.ej()?(i=e.fj(),r=exm(e,t,n),e.$i(e.Zi(7,ell(n),r,t,i)),r):exm(e,t,n)}function elj(e,t){var n,r,i;null==e.d?(++e.e,--e.f):(i=t.cd(),r=((n=t.Sh())&eUu)%e.d.length,Xc(e,r,eML(e,r,n,i)))}function elF(e,t){var n;n=(e.Bb&eXt)!=0,t?e.Bb|=eXt:e.Bb&=-1025,(4&e.Db)!=0&&(1&e.Db)==0&&eam(e,new ZB(e,1,10,n,t))}function elY(e,t){var n;n=(e.Bb&eH0)!=0,t?e.Bb|=eH0:e.Bb&=-4097,(4&e.Db)!=0&&(1&e.Db)==0&&eam(e,new ZB(e,1,12,n,t))}function elB(e,t){var n;n=(e.Bb&eJV)!=0,t?e.Bb|=eJV:e.Bb&=-8193,(4&e.Db)!=0&&(1&e.Db)==0&&eam(e,new ZB(e,1,15,n,t))}function elU(e,t){var n;n=(e.Bb&eJq)!=0,t?e.Bb|=eJq:e.Bb&=-2049,(4&e.Db)!=0&&(1&e.Db)==0&&eam(e,new ZB(e,1,11,n,t))}function elH(e,t){var n;return 0!=(n=elN(e.b.c,t.b.c))||0!=(n=elN(e.a.a,t.a.a))?n:elN(e.a.b,t.a.b)}function el$(e,t){var n;if(null==(n=Bp(e.k,t)))throw p7(new gK("Port did not exist in input."));return eiX(t,n),null}function elz(e){var t,n;for(n=eM$(etP(e)).Kc();n.Ob();)if(eDM(e,t=Lq(n.Pb())))return qb((_X(),tgh),t);return null}function elG(e,t){var n,r,i,a,o;for(i=0,o=eAY(e.e.Tg(),t),a=0,n=Pp(e.g,119);i>10)+eH4&eHd,t[1]=(1023&e)+56320&eHd,ehv(t,0,t.length)}function el0(e){var t,n;return(n=Pp(e_k(e,(eBy(),tal)),103))==(ec3(),tpv)?(t=gP(LV(e_k(e,tiX))))>=1?tpg:tpb:n}function el2(e){switch(Pp(e_k(e,(eBy(),tag)),218).g){case 1:return new ig;case 3:return new iE;default:return new im}}function el3(e){if(e.c)el3(e.c);else if(e.d)throw p7(new gC("Stream already terminated, can't be modified or used"))}function el4(e){var t;return(64&e.Db)!=0?eMT(e):(t=new O1(eMT(e)),t.a+=" (identifier: ",xk(t,e.k),t.a+=")",t.a)}function el6(e,t,n){var r,i;return r=(yT(),i=new oJ),ent(r,t),enn(r,n),e&&JL((e.a||(e.a=new O_(e5h,e,5)),e.a),r),r}function el5(e,t,n,r){var i,a;return BJ(r),BJ(n),null==(a=null==(i=e.xc(t))?n:_i(Pp(i,15),Pp(n,14)))?e.Bc(t):e.zc(t,a),a}function el8(e){var t,n,r,i;return n=(t=Pp(yw((i=(r=e.gm).f)==e1G?r:i),9),new I1(t,Pp(CY(t,t.length),9),0)),erC(n,e),n}function el9(e,t,n){var r,i;for(i=e.a.ec().Kc();i.Ob();)if(r=Pp(i.Pb(),10),eot(n,Pp(RJ(t,r.p),14)))return r;return null}function el7(e,t,n){var r;try{esE(e,t,n)}catch(i){if(i=eoa(i),M4(i,597))throw r=i,p7(new Zt(r));throw p7(i)}return t}function efe(e,t){var n;return Ts(e)&&Ts(t)&&eHV<(n=e-t)&&n>1,e.k=n-1>>1}function efo(){var e,t,n;ewP(),n=e2w+++Date.now(),e=zy(eB4.Math.floor(n*e$h))&e$b,t=zy(n-e*e$p),this.a=1502^e,this.b=t^e$d}function efs(e){var t,n,r;for(t=new p0,r=new fz(e.j);r.a34028234663852886e22?eHQ:t<-34028234663852886e22?eH1:t}function efp(e){return e-=e>>1&1431655765,e=((e=(e>>2&858993459)+(858993459&e))>>4)+e&252645135,e+=e>>8,63&(e+=e>>16)}function efb(e){var t,n,r,i;for(t=new CS(e.Hd().gc()),i=0,r=JJ(e.Hd().Kc());r.Ob();)Gr(t,n=r.Pb(),ell(i++));return eEA(t.a)}function efm(e,t){var n,r,i;for(i=new p2,r=t.vc().Kc();r.Ob();)Um(i,(n=Pp(r.Pb(),42)).cd(),eab(e,Pp(n.dd(),15)));return i}function efg(e,t){0==e.n.c.length&&P_(e.n,new zO(e.s,e.t,e.i)),P_(e.b,t),eml(Pp(RJ(e.n,e.n.c.length-1),211),t),eNk(e,t)}function efv(e){return(e.c!=e.b.b||e.i!=e.g.b)&&(e.a.c=Je(e1R,eUp,1,0,5,1),eoc(e.a,e.b),eoc(e.a,e.g),e.c=e.b.b,e.i=e.g.b),e.a}function efy(e,t){var n,r,i;for(i=0,r=Pp(t.Kb(e),20).Kc();r.Ob();)gN(LK(e_k(n=Pp(r.Pb(),17),(eBU(),tnE))))||++i;return i}function efw(e,t){var n,r,i;i=gP(LV(ed$(r=KT(t),(eBy(),toO)))),ev_(t,n=eB4.Math.max(0,i/2-.5),1),P_(e,new E8(t,n))}function ef_(){ef_=A,tnj=new ST(eGR,0),tnD=new ST("FIRST",1),tnN=new ST(eWi,2),tnP=new ST("LAST",3),tnR=new ST(eWa,4)}function efE(){efE=A,tpO=new kb(ezo,0),tpT=new kb("POLYLINE",1),tpx=new kb("ORTHOGONAL",2),tpM=new kb("SPLINES",3)}function efS(){efS=A,tlP=new S5("ASPECT_RATIO_DRIVEN",0),tlR=new S5("MAX_SCALE_DRIVEN",1),tlN=new S5("AREA_DRIVEN",2)}function efk(){efk=A,tff=new S9("P1_STRUCTURE",0),tfd=new S9("P2_PROCESSING_ORDER",1),tfh=new S9("P3_EXECUTION",2)}function efx(){efx=A,tc1=new S0("OVERLAP_REMOVAL",0),tcJ=new S0("COMPACTION",1),tcQ=new S0("GRAPH_SIZE_CALCULATION",2)}function efT(e,t){return Mc(),enj(eHe),eB4.Math.abs(e-t)<=eHe||e==t||isNaN(e)&&isNaN(t)?0:et?1:Te(isNaN(e),isNaN(t))}function efM(e,t){var n,r;for(n=epL(e,0);n.b!=n.d.c;){if((r=gR(LV(Vv(n))))==t)return;if(r>t){Ks(n);break}}YU(n,t)}function efO(e,t){var n,r,i,a,o;if(n=t.f,epy(e.c.d,n,t),null!=t.g)for(i=t.g,a=0,o=i.length;at&&r.ue(e[a-1],e[a])>0;--a)o=e[a],Bc(e,a,e[a-1]),Bc(e,a-1,o)}function efL(e,t,n,r){if(t<0)eOh(e,n,r);else{if(!n.Ij())throw p7(new gL(eZV+n.ne()+eZq));Pp(n,66).Nj().Tj(e,e.yh(),t,r)}}function efC(e,t){if(t==e.d)return e.e;if(t==e.e)return e.d;throw p7(new gL("Node "+t+" not part of edge "+e))}function efI(e,t){switch(t.g){case 2:return e.b;case 1:return e.c;case 4:return e.d;case 3:return e.a;default:return!1}}function efD(e,t){switch(t.g){case 2:return e.b;case 1:return e.c;case 4:return e.d;case 3:return e.a;default:return!1}}function efN(e,t,n,r){switch(t){case 3:return e.f;case 4:return e.g;case 5:return e.i;case 6:return e.j}return ec2(e,t,n,r)}function efP(e){return e.k==(eEn(),e9N)&&q3(new R1(null,new YI(new Fa(OH(efc(e).a.Kc(),new c)))),new it)}function efR(e){return null==e.e?e:(e.c||(e.c=new eCg((256&e.f)!=0,e.i,e.a,e.d,(16&e.f)!=0,e.j,e.g,null)),e.c)}function efj(e,t){return e.h==eHz&&0==e.m&&0==e.l?(t&&(e0A=Mk(0,0,0)),Tr((Q2(),e0I))):(t&&(e0A=Mk(e.l,e.m,e.h)),Mk(0,0,0))}function efF(e){var t;return Array.isArray(e)&&e.im===O?yx(esF(e))+"@"+(t=esj(e)>>>0).toString(16):e.toString()}function efY(e){var t;this.a=(t=Pp(e.e&&e.e(),9),new I1(t,Pp(CY(t,t.length),9),0)),this.b=Je(e1R,eUp,1,this.a.a.length,5,1)}function efB(e){var t,n,r;for(this.a=new Tw,r=new fz(e);r.a0&&(GV(t-1,e.length),58==e.charCodeAt(t-1))&&!efz(e,tm1,tm0)}function efz(e,t,n){var r,i;for(r=0,i=e.length;r=i)return t.c+n;return t.c+t.b.gc()}function efK(e,t){var n,r,i,a;for(LF(),r=J8(e),i=t,Qe(r,0,r.length,i),n=0;n0&&(r+=i,++n);return n>1&&(r+=e.d*(n-1)),r}function efq(e){var t,n,r;for(r=new vs,r.a+="[",t=0,n=e.gc();t0&&this.b>0&&ji(this.c,this.b,this.a)}function ef4(e){edk(),this.c=ZW(eow(vx(e6Z,1),eUp,831,0,[to2])),this.b=new p2,this.a=e,Um(this.b,to3,1),ety(to4,new h4(this))}function ef6(e,t){var n;return e.d?F8(e.b,t)?Pp(Bp(e.b,t),51):(n=t.Kf(),Um(e.b,t,n),n):t.Kf()}function ef5(e,t){var n;return xc(e)===xc(t)||!!M4(t,91)&&(n=Pp(t,91),e.e==n.e&&e.d==n.d&&qv(e,n.a))}function ef8(e){switch(eYu(),e.g){case 4:return tbw;case 1:return tby;case 3:return tbj;case 2:return tbY;default:return tbF}}function ef9(e,t){switch(t){case 3:return 0!=e.f;case 4:return 0!=e.g;case 5:return 0!=e.i;case 6:return 0!=e.j}return eaT(e,t)}function ef7(e){switch(e.g){case 0:return new aV;case 1:return new aq;default:throw p7(new gL(eqa+(null!=e.f?e.f:""+e.g)))}}function ede(e){switch(e.g){case 0:return new aK;case 1:return new aZ;default:throw p7(new gL(eWt+(null!=e.f?e.f:""+e.g)))}}function edt(e){switch(e.g){case 0:return new mZ;case 1:return new m_;default:throw p7(new gL(eqN+(null!=e.f?e.f:""+e.g)))}}function edn(e){switch(e.g){case 1:return new aU;case 2:return new LY;default:throw p7(new gL(eqa+(null!=e.f?e.f:""+e.g)))}}function edr(e){var t,n;if(e.b)return e.b;for(n=e2M?null:e.d;n;){if(t=e2M?null:n.b)return t;n=e2M?null:n.d}return _g(),e2F}function edi(e){var t,n,r;return 0==e.e?0:(t=e.d<<5,n=e.a[e.d-1],e.e<0&&(r=eiU(e))==e.d-1&&(--n,n|=0),t-=exv(n))}function eda(e){var t,n,r;return e>5,t=31&e,(r=Je(ty_,eHT,25,n+1,15,1))[n]=1<3;)i*=10,--a;e=(e+(i>>1))/i|0}return r.i=e,!0}function edl(e){return euQ(),OQ(),!!(efD(Pp(e.a,81).j,Pp(e.b,103))||0!=Pp(e.a,81).d.e&&efD(Pp(e.a,81).j,Pp(e.b,103)))}function edf(e){J1(),Pp(e.We((eBB(),thL)),174).Hc((eI3(),tb4))&&(Pp(e.We(thJ),174).Fc((ekU(),tbg)),Pp(e.We(thL),174).Mc(tb4))}function edd(e,t){var n,r;if(!t)return!1;for(n=0;n=0;--r)for(i=0,t=n[r];i>1,this.k=t-1>>1}function edC(e,t){ewG(t,"End label post-processing",1),_r(UJ(eeh(new R1(null,new Gq(e.b,16)),new tV),new tq),new tZ),eEj(t)}function edI(e,t,n){var r,i;return r=gP(e.p[t.i.p])+gP(e.d[t.i.p])+t.n.b+t.a.b,(i=gP(e.p[n.i.p])+gP(e.d[n.i.p])+n.n.b+n.a.b)-r}function edD(e,t,n){var r,i;for(i=0,r=WM(n,eH9);0!=ecd(r,0)&&i0&&(GV(0,t.length),43==t.charCodeAt(0))?t.substr(1):t)}function edR(e){var t;return null==e?null:new TU((t=ePh(e,!0)).length>0&&(GV(0,t.length),43==t.charCodeAt(0))?t.substr(1):t)}function edj(e,t){var n;return e.i>0&&(t.lengthe.i&&Bc(t,e.i,null),t}function edF(e,t,n){var r,i,a;return e.ej()?(r=e.i,a=e.fj(),ecW(e,r,t),i=e.Zi(3,null,t,r,a),n?n.Ei(i):n=i):ecW(e,e.i,t),n}function edY(e,t,n){var r,i;return r=new Q$(e.e,4,10,M4(i=t.c,88)?Pp(i,26):(eBK(),tgI),null,ebv(e,t),!1),n?n.Ei(r):n=r,n}function edB(e,t,n){var r,i;return r=new Q$(e.e,3,10,null,M4(i=t.c,88)?Pp(i,26):(eBK(),tgI),ebv(e,t),!1),n?n.Ei(r):n=r,n}function edU(e){var t;return Cn(),t=new TS(Pp(e.e.We((eBB(),thO)),8)),e.B.Hc((eI3(),tbQ))&&(t.a<=0&&(t.a=20),t.b<=0&&(t.b=20)),t}function edH(e){var t;return ebk(),t=(e.q?e.q:(Hj(),Hj(),e2i))._b((eBy(),ta0))?Pp(e_k(e,ta0),197):Pp(e_k(Bq(e),ta2),197)}function ed$(e,t){var n,r;return r=null,Ln(e,(eBy(),toD))&&(n=Pp(e_k(e,toD),94)).Xe(t)&&(r=n.We(t)),null==r&&(r=e_k(Bq(e),t)),r}function edz(e,t){var n,r,i;return!!M4(t,42)&&(r=(n=Pp(t,42)).cd(),i=ecA(e.Rc(),r),BG(i,n.dd())&&(null!=i||e.Rc()._b(r)))}function edG(e,t){var n,r,i;return e.f>0&&(e.qj(),i=((r=null==t?0:esj(t))&eUu)%e.d.length,-1!=(n=eML(e,i,r,t)))}function edW(e,t){var n,r,i;return e.f>0&&(e.qj(),i=((r=null==t?0:esj(t))&eUu)%e.d.length,n=exx(e,i,r,t))?n.dd():null}function edK(e,t){var n,r,i,a;for(i=0,a=eAY(e.e.Tg(),t),n=Pp(e.g,119);i1?WO(Fg(t.a[1],32),WM(t.a[0],eH9)):WM(t.a[0],eH9),Kj(efn(t.e,n))))}function edQ(e,t){var n;return Ts(e)&&Ts(t)&&eHV<(n=e%t)&&n>5,t&=31,r=Je(ty_,eHT,25,i=e.d+n+(0==t?0:1),15,1),ewZ(r,e.a,n,t),a=new F7(e.e,i,r),Ku(a),a}function eht(e,t,n){var r,i;r=Pp(zg(tv4,t),117),i=Pp(zg(tv6,t),117),n?(Ge(tv4,e,r),Ge(tv6,e,i)):(Ge(tv6,e,r),Ge(tv4,e,i))}function ehn(e,t,n){var r,i,a;for(i=null,a=e.b;a;){if(r=e.a.ue(t,a.d),n&&0==r)return a;r>=0?a=a.a[1]:(i=a,a=a.a[0])}return i}function ehr(e,t,n){var r,i,a;for(i=null,a=e.b;a;){if(r=e.a.ue(t,a.d),n&&0==r)return a;r<=0?a=a.a[0]:(i=a,a=a.a[1])}return i}function ehi(e,t,n,r){var i,a,o;return i=!1,ejB(e.f,n,r)&&(epn(e.f,e.a[t][n],e.a[t][r]),o=(a=e.a[t])[r],a[r]=a[n],a[n]=o,i=!0),i}function eha(e,t,n,r,i){var a,o,s;for(o=i;t.b!=t.c;)a=Pp(Yn(t),10),s=Pp(efr(a,r).Xb(0),11),e.d[s.p]=o++,n.c[n.c.length]=s;return o}function eho(e,t,n){var r,i,a,o,s;return o=e.k,s=t.k,i=LV(ed$(e,r=n[o.g][s.g])),a=LV(ed$(t,r)),eB4.Math.max((BJ(i),i),(BJ(a),a))}function ehs(e,t,n){var r,i,a,o;for(r=n/e.c.length,i=0,o=new fz(e);o.a2e3&&(e1X=e,e1J=eB4.setTimeout(wf,10)),0==e1Z++&&(eeA((g1(),e0_)),!0)}function ehf(e,t){var n,r,i;for(r=new Fa(OH(efc(e).a.Kc(),new c));eTk(r);)if((i=(n=Pp(ZC(r),17)).d.i).c==t)return!1;return!0}function ehd(e,t){var n,r;if(M4(t,245)){r=Pp(t,245);try{return n=e.vd(r),0==n}catch(i){if(i=eoa(i),!M4(i,205))throw p7(i)}}return!1}function ehh(){return Error.stackTraceLimit>0?(eB4.Error.stackTraceLimit=Error.stackTraceLimit=64,!0):"stack"in Error()}function ehp(e,t){return Mc(),Mc(),enj(eHe),(eB4.Math.abs(e-t)<=eHe||e==t||isNaN(e)&&isNaN(t)?0:et?1:Te(isNaN(e),isNaN(t)))>0}function ehb(e,t){return Mc(),Mc(),enj(eHe),(eB4.Math.abs(e-t)<=eHe||e==t||isNaN(e)&&isNaN(t)?0:et?1:Te(isNaN(e),isNaN(t)))<0}function ehm(e,t){return Mc(),Mc(),enj(eHe),(eB4.Math.abs(e-t)<=eHe||e==t||isNaN(e)&&isNaN(t)?0:et?1:Te(isNaN(e),isNaN(t)))<=0}function ehg(e,t){for(var n=0;!t[n]||""==t[n];)n++;for(var r=t[n++];neH5)return n.fh();if((r=n.Zg())||n==e)break}return r}function ehA(e){return(z0(),M4(e,156))?Pp(Bp(tmR,e0r),288).vg(e):F8(tmR,esF(e))?Pp(Bp(tmR,esF(e)),288).vg(e):null}function ehL(e){if(ehZ(eq5,e))return OQ(),e0P;if(ehZ(eq8,e))return OQ(),e0N;throw p7(new gL("Expecting true or false"))}function ehC(e,t){if(t.c==e)return t.d;if(t.d==e)return t.c;throw p7(new gL("Input edge is not connected to the input port."))}function ehI(e,t){return e.e>t.e?1:e.et.d?e.e:e.d=48&&e<48+eB4.Math.min(10,10)?e-48:e>=97&&e<97?e-97+10:e>=65&&e<65?e-65+10:-1}function ehN(e,t){var n;return xc(t)===xc(e)||!!M4(t,21)&&(n=Pp(t,21)).gc()==e.gc()&&e.Ic(n)}function ehP(e,t){var n,r,i,a;return(r=e.a.length-1,n=t-e.b&r,a=e.c-t&r,A2(n<(i=e.c-e.b&r)),n>=a)?(euD(e,t),-1):(euN(e,t),1)}function ehR(e,t){var n,r;for(n=(GV(t,e.length),e.charCodeAt(t)),r=t+1;rt.e?1:e.ft.f?1:esj(e)-esj(t)}function ehZ(e,t){return BJ(e),null!=t&&(!!IE(e,t)||e.length==t.length&&IE(e.toLowerCase(),t.toLowerCase()))}function ehX(e,t){var n,r,i,a;for(r=0,i=t.gc();r0&&0>ecd(e,128)?(t=jE(e)+128,(n=(RB(),e0H)[t])||(n=e0H[t]=new fI(e)),n):new fI(e)}function eh1(e,t){var n,r;return(n=t.Hh(e.a))&&null!=(r=Lq(edW((n.b||(n.b=new L_((eBK(),tgF),tgf,n)),n.b),eXP)))?r:t.ne()}function eh0(e,t){var n,r;return(n=t.Hh(e.a))&&null!=(r=Lq(edW((n.b||(n.b=new L_((eBK(),tgF),tgf,n)),n.b),eXP)))?r:t.ne()}function eh2(e,t){var n,r;for(Gk(),r=new Fa(OH(efs(e).a.Kc(),new c));eTk(r);)if((n=Pp(ZC(r),17)).d.i==t||n.c.i==t)return n;return null}function eh3(e,t,n){this.c=e,this.f=new p0,this.e=new yb,this.j=new R$,this.n=new R$,this.b=t,this.g=new Hr(t.c,t.d,t.b,t.a),this.a=n}function eh4(e){var t,n,r,i;for(r=0,this.a=new Tw,this.d=new bV,this.e=0,i=(n=e).length;r0)}function ept(e){var t;xc(eT9(e,(eBB(),thl)))===xc((eck(),tpG))&&(z$(e)?(t=Pp(eT9(z$(e),thl),334),ebu(e,thl,t)):ebu(e,thl,tpW))}function epn(e,t,n){var r,i;e_m(e.e,t,n,(eYu(),tbY)),e_m(e.i,t,n,tby),e.a&&(i=Pp(e_k(t,(eBU(),tnc)),11),r=Pp(e_k(n,tnc),11),WW(e.g,i,r))}function epr(e,t,n){var r,i,a;r=t.c.p,a=t.p,e.b[r][a]=new $j(e,t),n&&(e.a[r][a]=new hv(t),(i=Pp(e_k(t,(eBU(),tt9)),10))&&exg(e.d,i,t))}function epi(e,t){var n,r,i;if(P_(e8n,e),t.Fc(e),n=Pp(Bp(e8t,e),21))for(i=n.Kc();i.Ob();)-1!=QI(e8n,r=Pp(i.Pb(),33),0)||epi(r,t)}function epa(e,t,n){var r;(e2x?(edr(e),0):e2T?(_g(),0):e2A?(_g(),0):!e2O||(_g(),1))||((r=new I5(t)).b=n,eEt(e,r))}function epo(e,t){var n;n=!e.A.Hc((ed5(),tbq))||e.q==(ewf(),tbo),e.u.Hc((ekU(),tbp))?n?eY_(e,t):eF3(e,t):e.u.Hc(tbm)&&(n?eFO(e,t):eYY(e,t))}function eps(e,t){var n,r;if(++e.j,null!=t&&exM(t,n=M4(r=e.a.Cb,97)?Pp(r,97).Jg():null)){ehU(e.a,4,n);return}ehU(e.a,4,Pp(t,126))}function epu(e,t,n){return new Hr(eB4.Math.min(e.a,t.a)-n/2,eB4.Math.min(e.b,t.b)-n/2,eB4.Math.abs(e.a-t.a)+n,eB4.Math.abs(e.b-t.b)+n)}function epc(e,t){var n,r;return 0!=(n=ME(e.a.c.p,t.a.c.p))?n:0!=(r=ME(e.a.d.i.p,t.a.d.i.p))?r:ME(t.a.d.p,e.a.d.p)}function epl(e,t,n){var r,i,a,o;return(a=t.j)!=(o=n.j)?a.g-o.g:(r=e.f[t.p],i=e.f[n.p],0==r&&0==i?0:0==r?-1:0==i?1:elN(r,i))}function epf(e,t,n){var r,i,a;if(!n[t.d])for(n[t.d]=!0,i=new fz(efv(t));i.a=(i=e.length))return i;for(t=t>0?t:0;tr&&Bc(t,r,null),t}function epv(e,t){var n,r;for(r=e.a.length,t.lengthr&&Bc(t,r,null),t}function epy(e,t,n){var r,i,a;return(i=Pp(Bp(e.e,t),387))?(a=CL(i,n),M5(e,i),a):(r=new PM(e,t,n),Um(e.e,t,r),zd(r),null)}function epw(e){var t;if(null==e)return null;if(null==(t=eMI(ePh(e,!0))))throw p7(new gV("Invalid hexBinary value: '"+e+"'"));return t}function ep_(e){return(eLQ(),0>ecd(e,0))?0!=ecd(e,-1)?new ey$(-1,QC(e)):e03:0>=ecd(e,10)?e06[jE(e)]:new ey$(1,e)}function epE(){return eBW(),eow(vx(e3n,1),eU4,159,0,[e4e,e37,e4t,e30,e31,e32,e36,e34,e33,e39,e38,e35,e3J,e3X,e3Q,e3q,e3V,e3Z,e3W,e3G,e3K,e4n])}function epS(e){var t;this.d=new p0,this.j=new yb,this.g=new yb,t=e.g.b,this.f=Pp(e_k(Bq(t),(eBy(),tal)),103),this.e=gP(LV(epj(t,toN)))}function epk(e){this.b=new p0,this.e=new p0,this.d=e,this.a=!yK(UJ(new R1(null,new YI(new Z4(e.b))),new f2(new ir))).sd((_w(),e2z))}function epx(){epx=A,tdh=new ko("PARENTS",0),tdd=new ko("NODES",1),tdl=new ko("EDGES",2),tdp=new ko("PORTS",3),tdf=new ko("LABELS",4)}function epT(){epT=A,tbt=new kw("DISTRIBUTED",0),tbr=new kw("JUSTIFIED",1),tp7=new kw("BEGIN",2),tbe=new kw(e$9,3),tbn=new kw("END",4)}function epM(e){var t;switch(t=e.yi(null)){case 10:return 0;case 15:return 1;case 14:return 2;case 11:return 3;case 21:return 4}return -1}function epO(e){switch(e.g){case 1:return ec3(),tpy;case 4:return ec3(),tpm;case 2:return ec3(),tpg;case 3:return ec3(),tpb}return ec3(),tpv}function epA(e,t,n){var r;switch((r=n.q.getFullYear()-eHx+eHx)<0&&(r=-r),t){case 1:e.a+=r;break;case 2:eeE(e,r%100,2);break;default:eeE(e,r,t)}}function epL(e,t){var n,r;if(Gp(t,e.b),t>=e.b>>1)for(r=e.c,n=e.b;n>t;--n)r=r.b;else for(n=0,r=e.a.a;n=64&&t<128&&(i=WO(i,Fg(1,t-64)));return i}function epj(e,t){var n,r;return r=null,Ln(e,(eBB(),tpa))&&(n=Pp(e_k(e,tpa),94)).Xe(t)&&(r=n.We(t)),null==r&&Bq(e)&&(r=e_k(Bq(e),t)),r}function epF(e,t){var n,r,i;(r=(i=t.d.i).k)!=(eEn(),e9N)&&r!=e9L&&(n=new Fa(OH(efc(i).a.Kc(),new c)),eTk(n)&&Um(e.k,t,Pp(ZC(n),17)))}function epY(e,t){var n,r,i;return r=ee2(e.Tg(),t),(n=t-e.Ah())<0?(i=e.Yg(r))>=0?e.lh(i):exu(e,r):n<0?exu(e,r):Pp(r,66).Nj().Sj(e,e.yh(),n)}function epB(e){var t;if(!M4(e.a,4))return e.a;if(null==(t=ehA(e.a)))throw p7(new gC(eq9+e.b+"'. "+eq4+(LW(e5D),e5D.k)+eq6));return t}function epU(e){var t;if(null==e)return null;if(null==(t=eYD(ePh(e,!0))))throw p7(new gV("Invalid base64Binary value: '"+e+"'"));return t}function epH(e){var t;try{return t=e.i.Xb(e.e),e.mj(),e.g=e.e++,t}catch(n){if(n=eoa(n),M4(n,73))throw e.mj(),p7(new bC);throw p7(n)}}function ep$(e){var t;try{return t=e.c.ki(e.e),e.mj(),e.g=e.e++,t}catch(n){if(n=eoa(n),M4(n,73))throw e.mj(),p7(new bC);throw p7(n)}}function epz(){epz=A,e57=(eBB(),tpt),e53=ths,e5J=td2,e54=thN,e58=(evw(),e3y),e55=e3g,e59=e3_,e56=e3m,e51=(eug(),e5V),e5Q=e5K,e50=e5Z,e52=e5X}function epG(e){switch(_M(),this.c=new p0,this.d=e,e.g){case 0:case 2:this.a=Ug(e9_),this.b=eHQ;break;case 3:case 1:this.a=e9_,this.b=eH1}}function epW(e,t,n){var r,i;if(e.c)eno(e.c,e.c.i+t),ens(e.c,e.c.j+n);else for(i=new fz(e.b);i.a0&&(P_(e.b,new PE(t.a,n)),0<(r=t.a.length)?t.a=t.a.substr(0,0):0>r&&(t.a+=M3(Je(tyw,eHl,25,-r,15,1))))}function epq(e,t){var n,r,i;for(n=e.o,i=Pp(Pp(Zq(e.r,t),21),84).Kc();i.Ob();)(r=Pp(i.Pb(),111)).e.a=ego(r,n.a),r.e.b=n.b*gP(LV(r.b.We(e4a)))}function epZ(e,t){var n,r,i,a;return i=e.k,n=gP(LV(e_k(e,(eBU(),tnv)))),a=t.k,r=gP(LV(e_k(t,tnv))),a!=(eEn(),e9C)?-1:i!=e9C?1:n==r?0:n=0?e.hh(t,n,r):(e.eh()&&(r=(i=e.Vg())>=0?e.Qg(r):e.eh().ih(e,-1-i,null,r)),e.Sg(t,n,r))}function ep2(e,t){switch(t){case 7:e.e||(e.e=new Ih(e5g,e,7,4)),eRT(e.e);return;case 8:e.d||(e.d=new Ih(e5g,e,8,5)),eRT(e.d);return}edS(e,t)}function ep3(e,t){var n;n=e.Zc(t);try{return n.Pb()}catch(r){if(r=eoa(r),M4(r,109))throw p7(new gE("Can't get element "+t));throw p7(r)}}function ep4(e,t){this.e=e,t=0&&(n.d=e.t);break;case 3:e.t>=0&&(n.a=e.t)}e.C&&(n.b=e.C.b,n.c=e.C.c)}function ep7(){ep7=A,e4d=new EN(ezb,0),e4f=new EN(ezm,1),e4h=new EN(ezg,2),e4p=new EN(ezv,3),e4d.a=!1,e4f.a=!0,e4h.a=!1,e4p.a=!0}function ebe(){ebe=A,e5U=new ED(ezb,0),e5B=new ED(ezm,1),e5H=new ED(ezg,2),e5$=new ED(ezv,3),e5U.a=!1,e5B.a=!0,e5H.a=!1,e5$.a=!0}function ebt(e){var t;t=e.a;do(t=Pp(ZC(new Fa(OH(efu(t).a.Kc(),new c))),17).c.i).k==(eEn(),e9D)&&e.b.Fc(t);while(t.k==(eEn(),e9D))e.b=eaa(e.b)}function ebn(e){var t,n,r;for(r=e.c.a,e.p=(Y8(r),new I4(r)),n=new fz(r);n.an.b))}function ebs(e,t){return xd(e)?!!e0c[t]:e.hm?!!e.hm[t]:xf(e)?!!e0u[t]:!!xl(e)&&!!e0s[t]}function ebu(e,t,n){return null==n?(e.o||(e.o=new JY((eBa(),tmy),e5O,e,0)),ehx(e.o,t)):(e.o||(e.o=new JY((eBa(),tmy),e5O,e,0)),evQ(e.o,t,n)),e}function ebc(e,t,n,r){var i,a;a=t.Xe((eBB(),thS))?Pp(t.We(thS),21):e.j,(i=ele(a))!=(eBW(),e4n)&&(!n||ehj(i))&&eEU(eMD(e,i,r),t)}function ebl(e,t,n,r){var i,a,o;return a=ee2(e.Tg(),t),(i=t-e.Ah())<0?(o=e.Yg(a))>=0?e._g(o,n,!0):exk(e,a,n):Pp(a,66).Nj().Pj(e,e.yh(),i,n,r)}function ebf(e,t,n,r){var i,a,o;n.mh(t)&&(_4(),eec(t)?ehX(e,i=Pp(n.ah(t),153)):(a=(o=t)?Pp(r,49).xh(o):null)&&p5(n.ah(t),a))}function ebd(e){switch(e.g){case 1:return eaY(),e4c;case 3:return eaY(),e4o;case 2:return eaY(),e4u;case 4:return eaY(),e4s;default:return null}}function ebh(e){switch(typeof e){case eUo:return ebA(e);case eUa:return zy(e);case eUi:return OQ(),e?1231:1237;default:return null==e?0:Ao(e)}}function ebp(e,t,n){if(e.e)switch(e.b){case 1:HJ(e.c,t,n);break;case 0:HQ(e.c,t,n)}else V5(e.c,t,n);e.a[t.p][n.p]=e.c.i,e.a[n.p][t.p]=e.c.e}function ebb(e){var t,n;if(null==e)return null;for(t=0,n=Je(e4N,eUP,193,e.length,0,2);t=0)return i;if(e.Fk()){for(r=0;r=(i=e.gc()))throw p7(new Ii(t,i));if(e.hi()&&(r=e.Xc(n))>=0&&r!=t)throw p7(new gL(eXB));return e.mi(t,n)}function ebw(e,t){if(this.a=Pp(Y8(e),245),this.b=Pp(Y8(t),245),e.vd(t)>0||e==(m3(),e0f)||t==(m2(),e0d))throw p7(new gL("Invalid range: "+VW(e,t)))}function eb_(e){var t,n;for(this.b=new p0,this.c=e,this.a=!1,n=new fz(e.a);n.a0),(t&-t)==t)return zy(t*eMU(e,31)*4656612873077393e-25);do r=(n=eMU(e,31))%t;while(n-r+(t-1)<0)return zy(r)}function ebA(e){var t,n,r;return(I8(),null!=(r=e2W[n=":"+e]))?zy((BJ(r),r)):(t=null==(r=e2G[n])?eAC(e):zy((BJ(r),r)),HB(),e2W[n]=t,t)}function ebL(e,t,n){ewG(n,"Compound graph preprocessor",1),e.a=new zu,eFC(e,t,null),eRs(e,t),eOz(e),eo3(t,(eBU(),ttW),e.a),e.a=null,Yy(e.b),eEj(n)}function ebC(e,t,n){switch(n.g){case 1:e.a=t.a/2,e.b=0;break;case 2:e.a=t.a,e.b=t.b/2;break;case 3:e.a=t.a/2,e.b=t.b;break;case 4:e.a=0,e.b=t.b/2}}function ebI(e){var t,n,r;for(r=Pp(Zq(e.a,(ey4(),tea)),15).Kc();r.Ob();)t=egD(n=Pp(r.Pb(),101)),Yz(e,n,t[0],(erX(),ted),0),Yz(e,n,t[1],tep,1)}function ebD(e){var t,n,r;for(r=Pp(Zq(e.a,(ey4(),teo)),15).Kc();r.Ob();)t=egD(n=Pp(r.Pb(),101)),Yz(e,n,t[0],(erX(),ted),0),Yz(e,n,t[1],tep,1)}function ebN(e){switch(e.g){case 0:return null;case 1:return new er1;case 2:return new mQ;default:throw p7(new gL(eqa+(null!=e.f?e.f:""+e.g)))}}function ebP(e,t,n){var r,i;for(eod(e,t-e.s,n-e.t),i=new fz(e.n);i.a1&&(a=ebE(e,t)),a}function ebj(e){var t;return e.f&&e.f.kh()&&(t=Pp(e.f,49),e.f=Pp(ecv(e,t),82),e.f!=t&&(4&e.Db)!=0&&(1&e.Db)==0&&eam(e,new FX(e,9,8,t,e.f))),e.f}function ebF(e){var t;return e.i&&e.i.kh()&&(t=Pp(e.i,49),e.i=Pp(ecv(e,t),82),e.i!=t&&(4&e.Db)!=0&&(1&e.Db)==0&&eam(e,new FX(e,9,7,t,e.i))),e.i}function ebY(e){var t;return e.b&&(64&e.b.Db)!=0&&(t=e.b,e.b=Pp(ecv(e,t),18),e.b!=t&&(4&e.Db)!=0&&(1&e.Db)==0&&eam(e,new FX(e,9,21,t,e.b))),e.b}function ebB(e,t){var n,r,i;null==e.d?(++e.e,++e.f):(r=t.Sh(),eO1(e,e.f+1),i=(r&eUu)%e.d.length,(n=e.d[i])||(n=e.d[i]=e.uj()),n.Fc(t),++e.f)}function ebU(e,t,n){var r;return!t.Kj()&&(-2!=t.Zj()?null==(r=t.zj())?null==n:ecX(r,n):t.Hj()==e.e.Tg()&&null==n)}function ebH(){var e;enG(16,eU0),e=er_(16),this.b=Je(e1z,eU1,317,e,0,1),this.c=Je(e1z,eU1,317,e,0,1),this.a=null,this.e=null,this.i=0,this.f=e-1,this.g=0}function eb$(e){CW.call(this),this.k=(eEn(),e9N),this.j=(enG(6,eU3),new XM(6)),this.b=(enG(2,eU3),new XM(2)),this.d=new md,this.f=new mb,this.a=e}function ebz(e){var t,n;!(e.c.length<=1)&&(t=eLW(e,(eYu(),tbj)),eSe(e,Pp(t.a,19).a,Pp(t.b,19).a),n=eLW(e,tbY),eSe(e,Pp(n.a,19).a,Pp(n.b,19).a))}function ebG(){ebG=A,tsb=new Sx("SIMPLE",0),tsd=new Sx(eWg,1),tsh=new Sx("LINEAR_SEGMENTS",2),tsf=new Sx("BRANDES_KOEPF",3),tsp=new Sx(eVI,4)}function ebW(e,t,n){IR(Pp(e_k(t,(eBy(),tol)),98))||(Q3(e,t,eEC(t,n)),Q3(e,t,eEC(t,(eYu(),tbj))),Q3(e,t,eEC(t,tbw)),Hj(),Mv(t.j,new hm(e)))}function ebK(e,t,n,r){var i,a,o;for(o=(i=r?Pp(Zq(e.a,t),21):Pp(Zq(e.b,t),21)).Kc();o.Ob();)if(eL9(e,n,a=Pp(o.Pb(),33)))return!0;return!1}function ebV(e){var t,n;for(n=new Ow(e);n.e!=n.i.gc();)if((t=Pp(epH(n),87)).e||0!=(t.d||(t.d=new O_(tgr,t,1)),t.d).i)return!0;return!1}function ebq(e){var t,n;for(n=new Ow(e);n.e!=n.i.gc();)if((t=Pp(epH(n),87)).e||0!=(t.d||(t.d=new O_(tgr,t,1)),t.d).i)return!0;return!1}function ebZ(e){var t,n,r;for(t=0,r=new fz(e.c.a);r.a102?-1:e<=57?e-48:e<65?-1:e<=70?e-65+10:e<97?-1:e-97+10}function eb2(e,t){if(null==e)throw p7(new gD("null key in entry: null="+t));if(null==t)throw p7(new gD("null value in entry: "+e+"=null"))}function eb3(e,t){for(var n,r;e.Ob();)if(!t.Ob()||(n=e.Pb(),r=t.Pb(),!(xc(n)===xc(r)||null!=n&&ecX(n,r))))return!1;return!t.Ob()}function eb4(e,t){var n;return n=eow(vx(tyx,1),eH6,25,15,[euG(e.a[0],t),euG(e.a[1],t),euG(e.a[2],t)]),e.d&&(n[0]=eB4.Math.max(n[0],n[2]),n[2]=n[0]),n}function eb6(e,t){var n;return n=eow(vx(tyx,1),eH6,25,15,[euW(e.a[0],t),euW(e.a[1],t),euW(e.a[2],t)]),e.d&&(n[0]=eB4.Math.max(n[0],n[2]),n[2]=n[0]),n}function eb5(){eb5=A,teG=new Sf("GREEDY",0),tez=new Sf(eWv,1),teK=new Sf(eWg,2),teV=new Sf("MODEL_ORDER",3),teW=new Sf("GREEDY_MODEL_ORDER",4)}function eb8(e,t){var n,r,i;for(e.b[t.g]=1,r=epL(t.d,0);r.b!=r.d.c;)i=(n=Pp(Vv(r),188)).c,1==e.b[i.g]?P7(e.a,n):2==e.b[i.g]?e.b[i.g]=1:eb8(e,i)}function eb9(e,t){var n,r,i;for(i=new XM(t.gc()),r=t.Kc();r.Ob();)(n=Pp(r.Pb(),286)).c==n.f?eE6(e,n,n.c):eEQ(e,n)||(i.c[i.c.length]=n);return i}function eb7(e,t,n){var r,i,a,o,s;for(s=e.r+t,e.r+=t,e.d+=n,r=n/e.n.c.length,i=0,o=new fz(e.n);o.aa&&Bc(t,a,null),t}function emx(e,t){var n,r;if(r=e.gc(),null==t){for(n=0;n0&&(u+=i),c[l]=o,o+=s*(u+r)}function emj(e){var t,n,r;for(t=0,r=e.f,e.n=Je(tyx,eH6,25,r,15,1),e.d=Je(tyx,eH6,25,r,15,1);t0?e.c:0),++i;e.b=r,e.d=a}function emW(e,t){var n,r,i,a,o;for(r=0,i=0,n=0,o=new fz(t);o.a0?e.g:0),++n;e.c=i,e.d=r}function emK(e,t){var n;return n=eow(vx(tyx,1),eH6,25,15,[ebM(e,(etx(),e3D),t),ebM(e,e3N,t),ebM(e,e3P,t)]),e.f&&(n[0]=eB4.Math.max(n[0],n[2]),n[2]=n[0]),n}function emV(e,t,n){var r;try{eCQ(e,t+e.j,n+e.k,!1,!0)}catch(i){if(i=eoa(i),M4(i,73))throw r=i,p7(new gE(r.g+ezk+t+eUd+n+")."));throw p7(i)}}function emq(e,t,n){var r;try{eCQ(e,t+e.j,n+e.k,!0,!1)}catch(i){if(i=eoa(i),M4(i,73))throw r=i,p7(new gE(r.g+ezk+t+eUd+n+")."));throw p7(i)}}function emZ(e){var t;Ln(e,(eBy(),taZ))&&((t=Pp(e_k(e,taZ),21)).Hc((eT7(),tp1))?(t.Mc(tp1),t.Fc(tp2)):t.Hc(tp2)&&(t.Mc(tp2),t.Fc(tp1)))}function emX(e){var t;Ln(e,(eBy(),taZ))&&((t=Pp(e_k(e,taZ),21)).Hc((eT7(),tp8))?(t.Mc(tp8),t.Fc(tp6)):t.Hc(tp6)&&(t.Mc(tp6),t.Fc(tp8)))}function emJ(e,t,n){ewG(n,"Self-Loop ordering",1),_r(UQ(UJ(UJ(eeh(new R1(null,new Gq(t.b,16)),new n8),new n9),new n7),new re),new d1(e)),eEj(n)}function emQ(e,t,n,r){var i,a;for(i=t;i0&&(i.b+=t),i}function em9(e,t){var n,r,i;for(i=new yb,r=e.Kc();r.Ob();)eIn(n=Pp(r.Pb(),37),0,i.b),i.b+=n.f.b+t,i.a=eB4.Math.max(i.a,n.f.a);return i.a>0&&(i.a+=t),i}function em7(e){var t,n,r;for(r=eUu,n=new fz(e.a);n.a>16==6?e.Cb.ih(e,5,e5E,t):(r=ebY(Pp(ee2((n=Pp(eaS(e,16),26))||e.zh(),e.Db>>16),18)),e.Cb.ih(e,r.n,r.f,t))}function egr(e){$O();var t=e.e;if(t&&t.stack){var n=t.stack,r=t+"\n";return n.substring(0,r.length)==r&&(n=n.substring(r.length)),n.split("\n")}return[]}function egi(e){var t;return(t=(en4(),e0U))[e>>>28]|t[e>>24&15]<<4|t[e>>20&15]<<8|t[e>>16&15]<<12|t[e>>12&15]<<16|t[e>>8&15]<<20|t[e>>4&15]<<24|t[15&e]<<28}function ega(e){var t,n,r;e.b==e.c&&(r=e.a.length,n=esi(eB4.Math.max(8,r))<<1,0!=e.b?(t=CY(e.a,n),erL(e,t,r),e.a=t,e.b=0):bF(e.a,n),e.c=r)}function ego(e,t){var n;return(n=e.b).Xe((eBB(),thK))?n.Hf()==(eYu(),tbY)?-n.rf().a-gP(LV(n.We(thK))):t+gP(LV(n.We(thK))):n.Hf()==(eYu(),tbY)?-n.rf().a:t}function egs(e){var t;return 0!=e.b.c.length&&Pp(RJ(e.b,0),70).a?Pp(RJ(e.b,0),70).a:null!=(t=Hh(e))?t:""+(e.c?QI(e.c.a,e,0):-1)}function egu(e){var t;return 0!=e.f.c.length&&Pp(RJ(e.f,0),70).a?Pp(RJ(e.f,0),70).a:null!=(t=Hh(e))?t:""+(e.i?QI(e.i.j,e,0):-1)}function egc(e,t){var n,r;if(t<0||t>=e.gc())return null;for(n=t;n0?e.c:0),i=eB4.Math.max(i,t.d),++r;e.e=a,e.b=i}function egd(e){var t,n;if(!e.b)for(e.b=K$(Pp(e.f,118).Ag().i),n=new Ow(Pp(e.f,118).Ag());n.e!=n.i.gc();)t=Pp(epH(n),137),P_(e.b,new gO(t));return e.b}function egh(e,t){var n,r,i;if(t.dc())return LF(),LF(),tmB;for(n=new Cy(e,t.gc()),i=new Ow(e);i.e!=i.i.gc();)r=epH(i),t.Hc(r)&&JL(n,r);return n}function egp(e,t,n,r){return 0==t?r?(e.o||(e.o=new JY((eBa(),tmy),e5O,e,0)),e.o):(e.o||(e.o=new JY((eBa(),tmy),e5O,e,0)),X5(e.o)):ebl(e,t,n,r)}function egb(e){var t,n;if(e.rb)for(t=0,n=e.rb.i;t>22))>>22)<0)&&(e.l=n&eHH,e.m=r&eHH,e.h=i&eH$,!0))}function egw(e,t,n,r,i,a,o){var s,u;return!(t.Ae()&&((u=e.a.ue(n,r))<0||!i&&0==u)||t.Be()&&((s=e.a.ue(n,a))>0||!o&&0==s))}function eg_(e,t){var n;if(euv(),0!=(n=e.j.g-t.j.g))return 0;switch(e.j.g){case 2:return efy(t,e73)-efy(e,e73);case 4:return efy(e,e72)-efy(t,e72)}return 0}function egE(e){switch(e.g){case 0:return te3;case 1:return te4;case 2:return te6;case 3:return te5;case 4:return te8;case 5:return te9;default:return null}}function egS(e,t,n){var r,i;return r=(eu2(i=new mN,t),er3(i,n),JL((e.c||(e.c=new FQ(tga,e,12,10)),e.c),i),i),end(r,0),enh(r,1),els(r,!0),eli(r,!0),r}function egk(e,t){var n,r;if(t>=e.i)throw p7(new xJ(t,e.i));return++e.j,n=e.g[t],(r=e.i-t-1)>0&&ePD(e.g,t+1,e.g,t,r),Bc(e.g,--e.i,null),e.fi(t,n),e.ci(),n}function egx(e,t){var n,r;return e.Db>>16==17?e.Cb.ih(e,21,tm7,t):(r=ebY(Pp(ee2((n=Pp(eaS(e,16),26))||e.zh(),e.Db>>16),18)),e.Cb.ih(e,r.n,r.f,t))}function egT(e){var t,n,r,i;for(Hj(),Mv(e.c,e.a),i=new fz(e.c);i.an.a.c.length))throw p7(new gL("index must be >= 0 and <= layer node count"));e.c&&QA(e.c.a,e),e.c=n,n&&jO(n.a,t,e)}function egH(e,t){var n,r,i;for(r=new Fa(OH(efs(e).a.Kc(),new c));eTk(r);)return n=Pp(ZC(r),17),i=Pp(t.Kb(n),10),new c6(Y8(i.n.b+i.o.b/2));return m4(),m4(),e0l}function eg$(e,t){this.c=new p2,this.a=e,this.b=t,this.d=Pp(e_k(e,(eBU(),tnx)),304),xc(e_k(e,(eBy(),taX)))===xc((Qx(),tte))?this.e=new mg:this.e=new mm}function egz(e,t){var n,r,i,a;for(a=0,r=new fz(e);r.a>16==6?e.Cb.ih(e,6,e5g,t):(r=ebY(Pp(ee2((n=Pp(eaS(e,16),26))||(eBa(),tmp),e.Db>>16),18)),e.Cb.ih(e,r.n,r.f,t))}function eg0(e,t){var n,r;return e.Db>>16==7?e.Cb.ih(e,1,e5p,t):(r=ebY(Pp(ee2((n=Pp(eaS(e,16),26))||(eBa(),tmm),e.Db>>16),18)),e.Cb.ih(e,r.n,r.f,t))}function eg2(e,t){var n,r;return e.Db>>16==9?e.Cb.ih(e,9,e5k,t):(r=ebY(Pp(ee2((n=Pp(eaS(e,16),26))||(eBa(),tmv),e.Db>>16),18)),e.Cb.ih(e,r.n,r.f,t))}function eg3(e,t){var n,r;return e.Db>>16==5?e.Cb.ih(e,9,tgt,t):(r=ebY(Pp(ee2((n=Pp(eaS(e,16),26))||(eBK(),tgT),e.Db>>16),18)),e.Cb.ih(e,r.n,r.f,t))}function eg4(e,t){var n,r;return e.Db>>16==3?e.Cb.ih(e,0,e5y,t):(r=ebY(Pp(ee2((n=Pp(eaS(e,16),26))||(eBK(),tgy),e.Db>>16),18)),e.Cb.ih(e,r.n,r.f,t))}function eg6(e,t){var n,r;return e.Db>>16==7?e.Cb.ih(e,6,e5E,t):(r=ebY(Pp(ee2((n=Pp(eaS(e,16),26))||(eBK(),tgP),e.Db>>16),18)),e.Cb.ih(e,r.n,r.f,t))}function eg5(){this.a=new o5,this.g=new ebH,this.j=new ebH,this.b=new p2,this.d=new ebH,this.i=new ebH,this.k=new p2,this.c=new p2,this.e=new p2,this.f=new p2}function eg8(e,t,n){var r,i,a;for(n<0&&(n=0),a=e.i,i=n;ieH5)return eg7(e,r);if(r==e)return!0}}return!1}function eve(e){switch(Ab(),e.q.g){case 5:ekK(e,(eYu(),tbw)),ekK(e,tbj);break;case 4:eMz(e,(eYu(),tbw)),eMz(e,tbj);break;default:eYa(e,(eYu(),tbw)),eYa(e,tbj)}}function evt(e){switch(Ab(),e.q.g){case 5:exG(e,(eYu(),tby)),exG(e,tbY);break;case 4:epq(e,(eYu(),tby)),epq(e,tbY);break;default:eYo(e,(eYu(),tby)),eYo(e,tbY)}}function evn(e){var t,n;(t=Pp(e_k(e,(eCk(),e8O)),19))?0==(n=t.a)?eo3(e,(erV(),e8F),new efo):eo3(e,(erV(),e8F),new qS(n)):eo3(e,(erV(),e8F),new qS(1))}function evr(e,t){var n;switch(n=e.i,t.g){case 1:return-(e.n.b+e.o.b);case 2:return e.n.a-n.o.a;case 3:return e.n.b-n.o.b;case 4:return-(e.n.a+e.o.a)}return 0}function evi(e,t){switch(e.g){case 0:return t==(ef_(),tnN)?e7V:e7q;case 1:return t==(ef_(),tnN)?e7V:e7K;case 2:return t==(ef_(),tnN)?e7K:e7q;default:return e7K}}function eva(e,t){var n,r,i;for(QA(e.a,t),e.e-=t.r+(0==e.a.c.length?0:e.c),i=eqe,r=new fz(e.a);r.a>16==3?e.Cb.ih(e,12,e5k,t):(r=ebY(Pp(ee2((n=Pp(eaS(e,16),26))||(eBa(),tmh),e.Db>>16),18)),e.Cb.ih(e,r.n,r.f,t))}function evs(e,t){var n,r;return e.Db>>16==11?e.Cb.ih(e,10,e5k,t):(r=ebY(Pp(ee2((n=Pp(eaS(e,16),26))||(eBa(),tmg),e.Db>>16),18)),e.Cb.ih(e,r.n,r.f,t))}function evu(e,t){var n,r;return e.Db>>16==10?e.Cb.ih(e,11,tm7,t):(r=ebY(Pp(ee2((n=Pp(eaS(e,16),26))||(eBK(),tgD),e.Db>>16),18)),e.Cb.ih(e,r.n,r.f,t))}function evc(e,t){var n,r;return e.Db>>16==10?e.Cb.ih(e,12,tgi,t):(r=ebY(Pp(ee2((n=Pp(eaS(e,16),26))||(eBK(),tgR),e.Db>>16),18)),e.Cb.ih(e,r.n,r.f,t))}function evl(e){var t;return(1&e.Bb)==0&&e.r&&e.r.kh()&&(t=Pp(e.r,49),e.r=Pp(ecv(e,t),138),e.r!=t&&(4&e.Db)!=0&&(1&e.Db)==0&&eam(e,new FX(e,9,8,t,e.r))),e.r}function evf(e,t,n){var r;return r=eow(vx(tyx,1),eH6,25,15,[e_u(e,(etx(),e3D),t,n),e_u(e,e3N,t,n),e_u(e,e3P,t,n)]),e.f&&(r[0]=eB4.Math.max(r[0],r[2]),r[2]=r[0]),r}function evd(e,t){var n,r,i;if(0!=(i=eb9(e,t)).c.length)for(Mv(i,new nD),n=i.c.length,r=0;r>19)!=(c=t.h>>19)?c-u:(i=e.h)!=(s=t.h)?i-s:(r=e.m)!=(o=t.m)?r-o:(n=e.l)-(a=t.l)}function evw(){evw=A,e3E=(eCp(),e3A),e3_=new xX(e$J,e3E),e3w=(eeR(),e3p),e3y=new xX(e$Q,e3w),e3v=(epC(),e3f),e3g=new xX(e$1,e3v),e3m=new xX(e$0,(OQ(),!0))}function ev_(e,t,n){var r,i;r=t*n,M4(e.g,145)?(i=Vm(e)).f.d?i.f.a||(e.d.a+=r+ezs):(e.d.d-=r+ezs,e.d.a+=r+ezs):M4(e.g,10)&&(e.d.d-=r,e.d.a+=2*r)}function evE(e,t,n){var r,i,a,o,s;for(i=e[n.g],s=new fz(t.d);s.a0?e.g:0),++n;t.b=r,t.e=i}function evk(e){var t,n,r;if(r=e.b,w4(e.i,r.length)){for(n=2*r.length,e.b=Je(e1z,eU1,317,n,0,1),e.c=Je(e1z,eU1,317,n,0,1),e.f=n-1,e.i=0,t=e.a;t;t=t.c)ekT(e,t,t);++e.g}}function evx(e,t,n,r){var i,a,o,s;for(i=0;io&&(s=o/r),i>a&&(u=a/i),Ol(e,eB4.Math.min(s,u)),e}function evO(){var e,t;ePm();try{if(t=Pp(eyv((_Q(),tgp),eXe),2014))return t}catch(n){if(n=eoa(n),M4(n,102))e=n,Fi((Mo(),e));else throw p7(n)}return new o1}function evA(){var e,t;Qk();try{if(t=Pp(eyv((_Q(),tgp),eQB),2024))return t}catch(n){if(n=eoa(n),M4(n,102))e=n,Fi((Mo(),e));else throw p7(n)}return new uc}function evL(){var e,t;ePm();try{if(t=Pp(eyv((_Q(),tgp),eQc),1941))return t}catch(n){if(n=eoa(n),M4(n,102))e=n,Fi((Mo(),e));else throw p7(n)}return new sT}function evC(e,t,n){var r,i;return i=e.e,e.e=t,(4&e.Db)!=0&&(1&e.Db)==0&&(r=new FX(e,1,4,i,t),n?n.Ei(r):n=r),i!=t&&(n=t?eFr(e,eOl(e,t),n):eFr(e,e.a,n)),n}function evI(){wW.call(this),this.e=-1,this.a=!1,this.p=eHt,this.k=-1,this.c=-1,this.b=-1,this.g=!1,this.f=-1,this.j=-1,this.n=-1,this.i=-1,this.d=-1,this.o=eHt}function evD(e,t){var n,r,i;if(r=e.b.d.d,e.a||(r+=e.b.d.a),i=t.b.d.d,t.a||(i+=t.b.d.a),0==(n=elN(r,i))){if(!e.a&&t.a)return -1;if(!t.a&&e.a)return 1}return n}function evN(e,t){var n,r,i;if(r=e.b.b.d,e.a||(r+=e.b.b.a),i=t.b.b.d,t.a||(i+=t.b.b.a),0==(n=elN(r,i))){if(!e.a&&t.a)return -1;if(!t.a&&e.a)return 1}return n}function evP(e,t){var n,r,i;if(r=e.b.g.d,e.a||(r+=e.b.g.a),i=t.b.g.d,t.a||(i+=t.b.g.a),0==(n=elN(r,i))){if(!e.a&&t.a)return -1;if(!t.a&&e.a)return 1}return n}function evR(){evR=A,e88=j0(RI(RI(RI(new K2,(e_x(),e9r),(eB$(),e7f)),e9r,e7b),e9i,e7E),e9i,e97),e87=RI(RI(new K2,e9r,e9Q),e9r,e7e),e89=j0(new K2,e9i,e7n)}function evj(e){var t,n,r,i,a;for(t=Pp(e_k(e,(eBU(),ttq)),83),a=e.n,r=t.Cc().Kc();r.Ob();)i=(n=Pp(r.Pb(),306)).i,i.c+=a.a,i.d+=a.b,n.c?eL3(n):eL4(n);eo3(e,ttq,null)}function evF(e,t,n){var r,i;switch(r=(i=e.b).d,t.g){case 1:return-r.d-n;case 2:return i.o.a+r.c+n;case 3:return i.o.b+r.a+n;case 4:return-r.b-n;default:return -1}}function evY(e){var t,n,r,i,a;if(r=0,i=ezq,e.b)for(t=0;t<360;t++)n=.017453292519943295*t,eIq(e,e.d,0,0,eV7,n),(a=e.b.ig(e.d))0&&(o=(a&eUu)%e.d.length,i=exx(e,o,a,t)))?s=i.ed(n):(r=e.tj(a,t,n),e.c.Fc(r),null)}function ev1(e,t){var n,r,i,a;switch(ecG(e,t)._k()){case 3:case 2:for(i=0,a=(n=ePk(t)).i;i=0;r--)if(IE(e[r].d,t)||IE(e[r].d,n)){e.length>=r+1&&e.splice(0,r+1);break}return e}function eyt(e,t){var n;return Ts(e)&&Ts(t)&&eHV<(n=e/t)&&n0&&(e.b+=2,e.a+=r):(e.b+=1,e.a+=eB4.Math.min(r,i))}function eyc(e,t){var n,r;if(r=!1,xd(t)&&(r=!0,BC(e,new B_(Lq(t)))),!r&&M4(t,236)&&(r=!0,BC(e,(n=IZ(Pp(t,236)),new lI(n)))),!r)throw p7(new gk(eXE))}function eyl(e,t,n,r){var i,a,o;return i=new Q$(e.e,1,10,M4(o=t.c,88)?Pp(o,26):(eBK(),tgI),M4(a=n.c,88)?Pp(a,26):(eBK(),tgI),ebv(e,t),!1),r?r.Ei(i):r=i,r}function eyf(e){var t,n;switch(Pp(e_k(Bq(e),(eBy(),taP)),420).g){case 0:return t=e.n,n=e.o,new kl(t.a+n.a/2,t.b+n.b/2);case 1:return new TS(e.n);default:return null}}function eyd(){eyd=A,tto=new Sm(eGR,0),tta=new Sm("LEFTUP",1),ttu=new Sm("RIGHTUP",2),tti=new Sm("LEFTDOWN",3),tts=new Sm("RIGHTDOWN",4),ttr=new Sm("BALANCED",5)}function eyh(e,t,n){var r,i,a;if(0==(r=elN(e.a[t.p],e.a[n.p]))){if(i=Pp(e_k(t,(eBU(),tt7)),15),a=Pp(e_k(n,tt7),15),i.Hc(n))return -1;if(a.Hc(t))return 1}return r}function eyp(e){switch(e.g){case 1:return new a$;case 2:return new az;case 3:return new aH;case 0:return null;default:throw p7(new gL(eqa+(null!=e.f?e.f:""+e.g)))}}function eyb(e,t,n){switch(t){case 1:e.n||(e.n=new FQ(e5S,e,1,7)),eRT(e.n),e.n||(e.n=new FQ(e5S,e,1,7)),Y4(e.n,Pp(n,14));return;case 2:ert(e,Lq(n));return}esU(e,t,n)}function eym(e,t,n){switch(t){case 3:eni(e,gP(LV(n)));return;case 4:ena(e,gP(LV(n)));return;case 5:eno(e,gP(LV(n)));return;case 6:ens(e,gP(LV(n)));return}eyb(e,t,n)}function eyg(e,t,n){var r,i,a;(i=ew3(a=r=new mN,t,null))&&i.Fi(),er3(a,n),JL((e.c||(e.c=new FQ(tga,e,12,10)),e.c),a),end(a,0),enh(a,1),els(a,!0),eli(a,!0)}function eyv(e,t){var n,r,i;return M4(n=Ea(e.g,t),235)?((i=Pp(n,235)).Qh(),i.Nh()):M4(n,498)?i=(r=Pp(n,1938)).b:null}function eyy(e,t,n,r){var i,a;return Y8(t),Y8(n),a=Pp(Iq(e.d,t),19),QW(!!a,"Row %s not in %s",t,e.e),i=Pp(Iq(e.b,n),19),QW(!!i,"Column %s not in %s",n,e.c),eoy(e,a.a,i.a,r)}function eyw(e,t,n,r,i,a,o){var s,u,c,l,f;if(l=i[a],f=emH(s=(c=a==o-1)?r:0,l),10!=r&&eow(vx(e,o-a),t[a],n[a],s,f),!c)for(++a,u=0;u1||-1==s?(a=Pp(u,15),i.Wb(ehk(e,a))):i.Wb(eI4(e,Pp(u,56))))}function eyP(e,t,n,r){wd();var i=eUn;function a(){for(var e=0;eeVW);)i>-.000001&&++n;return n}function eyW(e,t){var n;t!=e.b?(n=null,e.b&&(n=$7(e.b,e,-4,n)),t&&(n=ep0(t,e,-4,n)),(n=ecm(e,t,n))&&n.Fi()):(4&e.Db)!=0&&(1&e.Db)==0&&eam(e,new FX(e,1,3,t,t))}function eyK(e,t){var n;t!=e.f?(n=null,e.f&&(n=$7(e.f,e,-1,n)),t&&(n=ep0(t,e,-1,n)),(n=ecg(e,t,n))&&n.Fi()):(4&e.Db)!=0&&(1&e.Db)==0&&eam(e,new FX(e,1,0,t,t))}function eyV(e){var t,n,r;if(null==e)return null;if((n=Pp(e,15)).dc())return"";for(r=new vs,t=n.Kc();t.Ob();)xk(r,(eR7(),Lq(t.Pb()))),r.a+=" ";return x3(r,r.a.length-1)}function eyq(e){var t,n,r;if(null==e)return null;if((n=Pp(e,15)).dc())return"";for(r=new vs,t=n.Kc();t.Ob();)xk(r,(eR7(),Lq(t.Pb()))),r.a+=" ";return x3(r,r.a.length-1)}function eyZ(e,t,n){var r,i;return(r=e.c[t.c.p][t.p],i=e.c[n.c.p][n.p],null!=r.a&&null!=i.a)?F_(r.a,i.a):null!=r.a?-1:null!=i.a?1:0}function eyX(e,t){var n,r,i,a,o,s;if(t)for(a=t.a.length,s=((n=new Fs(a)).b-n.a)*n.c<0?(_8(),eB3):new OR(n);s.Ob();)i=KZ(t,(o=Pp(s.Pb(),19)).a),UX((r=new pu(e)).a,i)}function eyJ(e,t){var n,r,i,a,o,s;if(t)for(a=t.a.length,s=((n=new Fs(a)).b-n.a)*n.c<0?(_8(),eB3):new OR(n);s.Ob();)i=KZ(t,(o=Pp(s.Pb(),19)).a),UZ((r=new h7(e)).a,i)}function eyQ(e){var t;if(null!=e&&e.length>0&&33==UI(e,e.length-1))try{return t=eSR(Az(e,0,e.length-1)),null==t.e}catch(n){if(n=eoa(n),!M4(n,32))throw p7(n)}return!1}function ey1(e,t,n){var r,i,a;return r=t.ak(),a=t.dd(),i=r.$j()?$N(e,3,r,null,a,eN1(e,r,a,M4(r,99)&&(Pp(r,18).Bb&eH3)!=0),!0):$N(e,1,r,r.zj(),a,-1,!0),n?n.Ei(i):n=i,n}function ey0(){var e,t,n;for(e=0,t=0;e<1;e++){if(0==(n=eTa((GV(e,1),"X".charCodeAt(e)))))throw p7(new gX("Unknown Option: "+"X".substr(e)));t|=n}return t}function ey2(e,t,n){var r,i,a;switch(i=el0(r=Bq(t)),a=new eES,Gc(a,t),n.g){case 1:ekv(a,elC(ef8(i)));break;case 2:ekv(a,ef8(i))}return eo3(a,(eBy(),toc),LV(e_k(e,toc))),a}function ey3(e){var t,n;return t=Pp(ZC(new Fa(OH(efu(e.a).a.Kc(),new c))),17),n=Pp(ZC(new Fa(OH(efc(e.a).a.Kc(),new c))),17),gN(LK(e_k(t,(eBU(),tnE))))||gN(LK(e_k(n,tnE)))}function ey4(){ey4=A,ter=new Sa("ONE_SIDE",0),tea=new Sa("TWO_SIDES_CORNER",1),teo=new Sa("TWO_SIDES_OPPOSING",2),tei=new Sa("THREE_SIDES",3),ten=new Sa("FOUR_SIDES",4)}function ey6(e,t,n,r,i){var a,o;a=Pp(qE(UJ(t.Oc(),new ih),JF(new U,new B,new en,eow(vx(e2L,1),eU4,132,0,[(eum(),e2U)]))),15),o=Pp(eay(e.b,n,r),15),0==i?o.Wc(0,a):o.Gc(a)}function ey5(e,t){var n,r,i,a,o;for(a=new fz(t.a);a.a0&&egL(this,this.c-1,(eYu(),tby)),this.c0&&e[0].length>0&&(this.c=gN(LK(e_k(Bq(e[0][0]),(eBU(),tne))))),this.a=Je(e6d,eUP,2018,e.length,0,2),this.b=Je(e6h,eUP,2019,e.length,0,2),this.d=new euX}function ewu(e){return 0!=e.c.length&&((GK(0,e.c.length),Pp(e.c[0],17)).c.i.k==(eEn(),e9D)||q3(UQ(new R1(null,new Gq(e,16)),new iJ),new iQ))}function ewc(e,t,n){return ewG(n,"Tree layout",1),Kx(e.b),Yb(e.b,(egR(),tuJ),tuJ),Yb(e.b,tuQ,tuQ),Yb(e.b,tu1,tu1),Yb(e.b,tu0,tu0),e.a=eRq(e.b,t),eAG(e,t,eiI(n,1)),eEj(n),t}function ewl(e,t){var n,r,i,a,o,s,u;for(s=eLj(t),a=t.f,u=t.g,o=eB4.Math.sqrt(a*a+u*u),i=0,r=new fz(s);r.a=0?(n=eyt(e,eHK),r=edQ(e,eHK)):(n=eyt(t=Fy(e,1),5e8),r=eft(Fg(r=edQ(t,5e8),1),WM(e,1))),WO(Fg(r,32),WM(n,eH9))}function ewM(e,t,n){var r,i;switch(r=(A5(0!=t.b),Pp(etw(t,t.a.a),8)),n.g){case 0:r.b=0;break;case 2:r.b=e.f;break;case 3:r.a=0;break;default:r.a=e.g}return YU(i=epL(t,0),r),t}function ewO(e,t,n,r){var i,a,o,s,u;switch(u=e.b,s=epd(o=(a=t.d).j,u.d[o.g],n),i=C6(MB(a.n),a.a),a.j.g){case 1:case 3:s.a+=i.a;break;case 2:case 4:s.b+=i.b}qQ(r,s,r.c.b,r.c)}function ewA(e,t,n){var r,i,a,o;for(o=QI(e.e,t,0),(a=new ma).b=n,r=new KB(e.e,o);r.b1;t>>=1)(1&t)!=0&&(r=eeD(r,n)),n=1==n.d?eeD(n,n):new eh6(eDE(n.a,n.d,Je(ty_,eHT,25,n.d<<1,15,1)));return eeD(r,n)}function ewP(){var e,t,n,r;for(t=32,ewP=A,e2v=Je(tyx,eH6,25,25,15,1),e2y=Je(tyx,eH6,25,33,15,1),r=152587890625e-16;t>=0;t--)e2y[t]=r,r*=.5;for(e=24,n=1;e>=0;e--)e2v[e]=n,n*=.5}function ewR(e){var t,n;if(gN(LK(eT9(e,(eBy(),taI))))){for(n=new Fa(OH(eOi(e).a.Kc(),new c));eTk(n);)if(t=Pp(ZC(n),79),exb(t)&&gN(LK(eT9(t,taD))))return!0}return!1}function ewj(e,t){var n,r,i;Yf(e.f,t)&&(t.b=e,r=t.c,-1!=QI(e.j,r,0)||P_(e.j,r),i=t.d,-1!=QI(e.j,i,0)||P_(e.j,i),0!=(n=t.a.b).c.length&&(e.i||(e.i=new epS(e)),ea_(e.i,n)))}function ewF(e){var t,n,r,i,a;return(r=(n=e.c.d).j)==(a=(i=e.d.d).j)?n.p=0&&IE(e.substr(t,3),"GMT")?(n[0]=t+3,eDh(e,n,r)):(t>=0&&IE(e.substr(t,3),"UTC")&&(n[0]=t+3),eDh(e,n,r))}function ewz(e,t){var n,r,i,a,o;for(a=e.g.a,o=e.g.b,r=new fz(e.d);r.an;a--)e[a]|=t[a-n-1]>>>o,e[a-1]=t[a-n-1]<=e.f)break;a.c[a.c.length]=n}return a}function ew1(e){var t,n,r,i;for(t=null,i=new fz(e.wf());i.a0&&ePD(e.g,t,e.g,t+r,s),o=n.Kc(),e.i+=r,i=0;ia&&F5(c,ee6(n[s],e2h))&&(i=s,a=u);return i>=0&&(r[0]=t+a),i}function ew8(e,t){var n;if(0!=(n=To(e.b.Hf(),t.b.Hf())))return n;switch(e.b.Hf().g){case 1:case 2:return ME(e.b.sf(),t.b.sf());case 3:case 4:return ME(t.b.sf(),e.b.sf())}return 0}function ew9(e){var t,n,r;for(r=e.e.c.length,e.a=RF(ty_,[eUP,eHT],[48,25],15,[r,r],2),n=new fz(e.c);n.a>4&15,a=15&e[r],o[i++]=tmk[n],o[i++]=tmk[a];return ehv(o,0,o.length)}function e_t(e,t,n){var r,i,a;return r=t.ak(),a=t.dd(),i=r.$j()?$N(e,4,r,a,null,eN1(e,r,a,M4(r,99)&&(Pp(r,18).Bb&eH3)!=0),!0):$N(e,r.Kj()?2:1,r,a,r.zj(),-1,!0),n?n.Ei(i):n=i,n}function e_n(e){var t,n;return e>=eH3?(t=eH4+(e-eH3>>10&1023)&eHd,n=56320+(e-eH3&1023)&eHd,String.fromCharCode(t)+""+String.fromCharCode(n)):String.fromCharCode(e&eHd)}function e_r(e,t){var n,r,i,a;return Cn(),(i=Pp(Pp(Zq(e.r,t),21),84)).gc()>=2&&(r=Pp(i.Kc().Pb(),111),n=e.u.Hc((ekU(),tbh)),a=e.u.Hc(tbg),!r.a&&!n&&(2==i.gc()||a))}function e_i(e,t,n,r,i){var a,o,s;for(a=eLx(e,t,n,r,i),s=!1;!a;)eME(e,i,!0),s=!0,a=eLx(e,t,n,r,i);s&&eME(e,i,!1),0!=(o=eoA(i)).c.length&&(e.d&&e.d.lg(o),e_i(e,i,n,r,o))}function e_a(){e_a=A,tpN=new km(eGR,0),tpI=new km("DIRECTED",1),tpP=new km("UNDIRECTED",2),tpL=new km("ASSOCIATION",3),tpD=new km("GENERALIZATION",4),tpC=new km("DEPENDENCY",5)}function e_o(e,t){var n;if(!zY(e))throw p7(new gC(eZL));switch(n=zY(e),t.g){case 1:return-(e.j+e.f);case 2:return e.i-n.g;case 3:return e.j-n.f;case 4:return-(e.i+e.g)}return 0}function e_s(e,t){var n,r;for(BJ(t),r=e.b.c.length,P_(e.b,t);r>0;){if(n=r,r=(r-1)/2|0,0>=e.a.ue(RJ(e.b,r),t))return q1(e.b,n,t),!0;q1(e.b,n,RJ(e.b,r))}return q1(e.b,r,t),!0}function e_u(e,t,n,r){var i,a;if(i=0,n)i=euW(e.a[n.g][t.g],r);else for(a=0;a=s)}function e_l(e,t,n,r){var i;if(i=!1,xd(r)&&(i=!0,P4(t,n,Lq(r))),!i&&xl(r)&&(i=!0,e_l(e,t,n,r)),!i&&M4(r,236)&&(i=!0,H1(t,n,Pp(r,236))),!i)throw p7(new gk(eXE))}function e_f(e,t){var n,r,i;if((n=t.Hh(e.a))&&null!=(i=edW((n.b||(n.b=new L_((eBK(),tgF),tgf,n)),n.b),eQe))){for(r=1;r<(eSp(),tvs).length;++r)if(IE(tvs[r],i))return r}return 0}function e_d(e,t){var n,r,i;if((n=t.Hh(e.a))&&null!=(i=edW((n.b||(n.b=new L_((eBK(),tgF),tgf,n)),n.b),eQe))){for(r=1;r<(eSp(),tvu).length;++r)if(IE(tvu[r],i))return r}return 0}function e_h(e,t){var n,r,i,a;if(BJ(t),(a=e.a.gc())0?1:0;a.a[i]!=n;)a=a.a[i],i=e.a.ue(n.d,a.d)>0?1:0;a.a[i]=r,r.b=n.b,r.a[0]=n.a[0],r.a[1]=n.a[1],n.a[0]=null,n.a[1]=null}function e_y(e){var t,n;return ekU(),t=jL(tbp,eow(vx(e5i,1),eU4,273,0,[tbm])),!(eaC(z_(t,e))>1)&&(n=jL(tbh,eow(vx(e5i,1),eU4,273,0,[tbd,tbg])),!(eaC(z_(n,e))>1))}function e_w(e,t){var n;M4(n=zg((_Q(),tgp),e),498)?Ge(tgp,e,new k6(this,t)):Ge(tgp,e,this),e_9(this,t),t==(yO(),tgg)?(this.wb=Pp(this,1939),Pp(t,1941)):this.wb=(BM(),tgv)}function e__(e){var t,n,r;if(null==e)return null;for(n=0,t=null;n=eHf?"error":r>=900?"warn":r>=800?"info":"log",e.a),e.b&&eAp(t,n,e.b,"Exception: ",!0))}function e_k(e,t){var n,r;return null!=(r=(e.q||(e.q=new p2),Bp(e.q,t)))?r:(M4(n=t.wg(),4)&&(null==n?(e.q||(e.q=new p2),Z3(e.q,t)):(e.q||(e.q=new p2),Um(e.q,t,n))),n)}function e_x(){e_x=A,e9e=new Ez("P1_CYCLE_BREAKING",0),e9t=new Ez("P2_LAYERING",1),e9n=new Ez("P3_NODE_ORDERING",2),e9r=new Ez("P4_NODE_PLACEMENT",3),e9i=new Ez("P5_EDGE_ROUTING",4)}function e_T(e,t){var n,r,i,a,o;for(r=(i=1==t?e9c:e9u).a.ec().Kc();r.Ob();)for(n=Pp(r.Pb(),103),o=Pp(Zq(e.f.c,n),21).Kc();o.Ob();)a=Pp(o.Pb(),46),QA(e.b.b,a.b),QA(e.b.a,Pp(a.b,81).d)}function e_M(e,t){var n;if(eeP(),e.c!=t.c)return elN(e.c,t.c);if(e.b==t.b||eiS(e.b,t.b)){if(n=Tu(e.b)?1:-1,e.a&&!t.a)return n;if(!e.a&&t.a)return-n}return ME(e.b.g,t.b.g)}function e_O(e,t){var n;ewG(t,"Hierarchical port position processing",1),(n=e.b).c.length>0&&eI5((GK(0,n.c.length),Pp(n.c[0],29)),e),n.c.length>1&&eI5(Pp(RJ(n,n.c.length-1),29),e),eEj(t)}function e_A(e,t){var n,r,i;if(e_Y(e,t))return!0;for(r=new fz(t);r.a=(i=e.Vi())||t<0)throw p7(new gE(eXU+t+eXH+i));if(n>=i||n<0)throw p7(new gE(eX$+n+eXH+i));return t!=n?(a=e.Ti(n),e.Hi(t,a),a):e.Oi(n)}function e_j(e){var t,n,r;if(r=e,e)for(t=0,n=e.Ug();n;n=n.Ug()){if(++t>eH5)return e_j(n);if(r=n,n==e)throw p7(new gC("There is a cycle in the containment hierarchy of "+e))}return r}function e_F(e){var t,n,r;for(r=new eaP(eUd,"[","]"),n=e.Kc();n.Ob();)ZJ(r,xc(t=n.Pb())===xc(e)?"(this Collection)":null==t?eUg:efF(t));return r.a?0==r.e.length?r.a.a:r.a.a+""+r.e:r.c}function e_Y(e,t){var n,r;if(r=!1,2>t.gc())return!1;for(n=0;n=e.charCodeAt(r));)++r;for(t=n;t>r&&(GV(t-1,e.length),32>=e.charCodeAt(t-1));)--t;return r>0||t1&&(e.j.b+=e.e)):(e.j.a+=n.a,e.j.b=eB4.Math.max(e.j.b,n.b),e.d.c.length>1&&(e.j.a+=e.e))}function e_z(){e_z=A,tec=eow(vx(e5a,1),eGj,61,0,[(eYu(),tbw),tby,tbj]),teu=eow(vx(e5a,1),eGj,61,0,[tby,tbj,tbY]),tel=eow(vx(e5a,1),eGj,61,0,[tbj,tbY,tbw]),tef=eow(vx(e5a,1),eGj,61,0,[tbY,tbw,tby])}function e_G(e,t,n,r){var i,a,o,s,u,c,l;if(o=e.c.d,s=e.d.d,o.j!=s.j)for(l=e.b,i=o.j,u=null;i!=s.j;)u=0==t?elI(i):elL(i),P7(r,C6(a=epd(i,l.d[i.g],n),c=epd(u,l.d[u.g],n))),i=u}function e_W(e,t,n,r){var i,a,o,s,u;return o=egN(e.a,t,n),s=Pp(o.a,19).a,a=Pp(o.b,19).a,r&&(u=Pp(e_k(t,(eBU(),tng)),10),i=Pp(e_k(n,tng),10),u&&i&&(V5(e.b,u,i),s+=e.b.i,a+=e.b.e)),s>a}function e_K(e){var t,n,r,i,a,o,s,u,c;for(r=0,this.a=ebb(e),this.b=new p0,i=(n=e).length;rL7(e.d).c?(e.i+=e.g.c,ed3(e.d)):L7(e.d).c>L7(e.g).c?(e.e+=e.d.c,ed3(e.g)):(e.i+=R5(e.g),e.e+=R5(e.d),ed3(e.g),ed3(e.d))}function e_X(e,t,n){var r,i,a,o;for(a=t.q,o=t.r,new GT((Xa(),tuU),t,a,1),new GT(tuU,a,o,1),i=new fz(n);i.as&&(u=s/r),i>a&&(c=a/i),o=eB4.Math.min(u,c),e.a+=o*(t.a-e.a),e.b+=o*(t.b-e.b)}function e_6(e,t,n,r,i){var a,o;for(o=!1,a=Pp(RJ(n.b,0),33);eNK(e,t,a,r,i)&&(o=!0,eyL(n,a),0!=n.b.c.length);)a=Pp(RJ(n.b,0),33);return 0==n.b.c.length&&eva(n.j,n),o&&emG(t.q),o}function e_5(e,t){var n,r,i,a;if(eLG(),t.b<2)return!1;for(r=n=Pp(Vv(a=epL(t,0)),8);a.b!=a.d.c;){if(eOV(e,r,i=Pp(Vv(a),8)))return!0;r=i}return!!eOV(e,r,n)}function e_8(e,t,n,r){var i,a;return 0==n?(e.o||(e.o=new JY((eBa(),tmy),e5O,e,0)),Iz(e.o,t,r)):(a=Pp(ee2((i=Pp(eaS(e,16),26))||e.zh(),n),66)).Nj().Rj(e,ehH(e),n-Y1(e.zh()),t,r)}function e_9(e,t){var n;t!=e.sb?(n=null,e.sb&&(n=Pp(e.sb,49).ih(e,1,e5w,n)),t&&(n=Pp(t,49).gh(e,1,e5w,n)),(n=ecY(e,t,n))&&n.Fi()):(4&e.Db)!=0&&(1&e.Db)==0&&eam(e,new FX(e,1,4,t,t))}function e_7(e,t){var n,r,i,a;if(t)i=enm(t,"x"),enr((n=new pa(e)).a,(BJ(i),i)),a=enm(t,"y"),enc((r=new po(e)).a,(BJ(a),a));else throw p7(new gK("All edge sections need an end point."))}function eEe(e,t){var n,r,i,a;if(t)i=enm(t,"x"),enu((n=new pn(e)).a,(BJ(i),i)),a=enm(t,"y"),enl((r=new pr(e)).a,(BJ(a),a));else throw p7(new gK("All edge sections need a start point."))}function eEt(e,t){var n,r,i,a,o,s,u;for(r=es1(e),a=0,s=r.length;a>22-t,i=e.h<>22-t):t<44?(n=0,r=e.l<>44-t):(n=0,r=0,i=e.l<e))return 0==t||t==e?1:0==e?0:ev5(e)/(ev5(t)*ev5(e-t));throw p7(new gL("k must be smaller than n"))}function eEh(e,t){var n,r,i,a;for(n=new TY(e);null!=n.g||n.c?null==n.g||0!=n.i&&Pp(n.g[n.i-1],47).Ob():zW(n);)if(M4(a=Pp(eM6(n),56),160))for(i=0,r=Pp(a,160);i>4],t[2*n+1]=tv0[15&a];return ehv(t,0,t.length)}function eEA(e){var t,n,r;switch(U_(),r=e.c.length){case 0:return e0p;case 1:return P2((t=Pp(ekM(new fz(e)),42)).cd(),t.dd());default:return n=Pp(epg(e,Je(e1$,eUK,42,e.c.length,0,1)),165),new gt(n)}}function eEL(e){var t,n,r,i,a,o;for(t=new p1,n=new p1,Vw(t,e),Vw(n,e);n.b!=n.c;)for(i=Pp(Yn(n),37),o=new fz(i.a);o.a0&&eIl(e,n,t),i):exV(e,t,n)}function eEN(e,t,n){var r,i,a,o;if(0!=t.b){for(r=new _n,o=epL(t,0);o.b!=o.d.c;)er7(r,eoO(a=Pp(Vv(o),86))),(i=a.e).a=Pp(e_k(a,(eR5(),tcg)),19).a,i.b=Pp(e_k(a,tcv),19).a;eEN(e,r,eiI(n,r.b/e.a|0))}}function eEP(e,t){var n,r,i,a,o;if(e.e<=t||Wm(e,e.g,t))return e.g;for(a=e.r,r=e.g,o=e.r,i=(a-r)/2+r;r+11&&(e.e.b+=e.a)):(e.e.a+=n.a,e.e.b=eB4.Math.max(e.e.b,n.b),e.d.c.length>1&&(e.e.a+=e.a))}function eEH(e){var t,n,r,i;switch(t=(i=e.i).b,r=i.j,n=i.g,i.a.g){case 0:n.a=(e.g.b.o.a-r.a)/2;break;case 1:n.a=t.d.n.a+t.d.a.a;break;case 2:n.a=t.d.n.a+t.d.a.a-r.a;break;case 3:n.b=t.d.n.b+t.d.a.b}}function eE$(e,t,n,r,i){if(rr&&(e.a=r),e.bi&&(e.b=i),e}function eEz(e){if(M4(e,149))return eAi(Pp(e,149));if(M4(e,229))return efZ(Pp(e,229));if(M4(e,23))return eEa(Pp(e,23));throw p7(new gL(eXx+e_F(new g$(eow(vx(e1R,1),eUp,1,5,[e])))))}function eEG(e,t,n,r,i){var a,o,s;for(o=0,a=!0;o>>i|n[o+r+1]<>>i,++o}return a}function eEW(e,t,n,r){var i,a,o;if(t.k==(eEn(),e9D)){for(a=new Fa(OH(efu(t).a.Kc(),new c));eTk(a);)if((o=(i=Pp(ZC(a),17)).c.i.k)==e9D&&e.c.a[i.c.i.c.p]==r&&e.c.a[t.c.p]==n)return!0}return!1}function eEK(e,t){var n,r,i,a;return t&=63,n=e.h&eH$,t<22?(a=n>>>t,i=e.m>>t|n<<22-t,r=e.l>>t|e.m<<22-t):t<44?(a=0,i=n>>>t-22,r=e.m>>t-22|e.h<<44-t):(a=0,i=0,r=n>>>t-44),Mk(r&eHH,i&eHH,a&eH$)}function eEV(e,t,n,r){var i;this.b=r,this.e=e==(enU(),tui),i=t[n],this.d=RF(tyE,[eUP,e$6],[177,25],16,[i.length,i.length],2),this.a=RF(ty_,[eUP,eHT],[48,25],15,[i.length,i.length],2),this.c=new ewo(t,n)}function eEq(e){var t,n,r;for(e.k=new G$((eYu(),eow(vx(e5a,1),eGj,61,0,[tbF,tbw,tby,tbj,tbY])).length,e.j.c.length),r=new fz(e.j);r.a=n)return eE6(e,t,r.p),!0;return!1}function eE1(e){var t;return(64&e.Db)!=0?eEp(e):(t=new O0(eZ$),e.a&&xM(xM((t.a+=' "',t),e.a),'"'),xM(yW(xM(yW(xM(yW(xM(yW((t.a+=" (",t),e.i),","),e.j)," | "),e.g),","),e.f),")"),t.a)}function eE0(e,t,n){var r,i,a,o,s;for(o=0,s=eAY(e.e.Tg(),t),i=Pp(e.g,119),r=0;on?eS1(e,n,"start index"):t<0||t>n?eS1(t,n,"end index"):eCG("end index (%s) must not be less than start index (%s)",eow(vx(e1R,1),eUp,1,5,[ell(t),ell(e)]))}function eE4(e,t){var n,r,i,a;for(r=0,i=e.length;r0&&eE8(e,a,n));t.p=0}function eE9(e){var t;this.c=new _n,this.f=e.e,this.e=e.d,this.i=e.g,this.d=e.c,this.b=e.b,this.k=e.j,this.a=e.a,e.i?this.j=e.i:this.j=(t=Pp(yw(e6Q),9),new I1(t,Pp(CY(t,t.length),9),0)),this.g=e.f}function eE7(e){var t,n,r,i;for(t=Bd(xM(new O0("Predicates."),"and"),40),n=!0,i=new fE(e);i.b0?s[o-1]:Je(e4N,eGW,10,0,0,1),i=s[o],c=o=0?e.Bh(i):ekN(e,r);else throw p7(new gL(eZV+r.ne()+eZq))}else throw p7(new gL(eZJ+t+eZQ))}else ec5(e,n,r)}function eSa(e){var t,n;if(n=null,t=!1,M4(e,204)&&(t=!0,n=Pp(e,204).a),!t&&M4(e,258)&&(t=!0,n=""+Pp(e,258).a),!t&&M4(e,483)&&(t=!0,n=""+Pp(e,483).a),!t)throw p7(new gk(eXE));return n}function eSo(e,t){var n,r;if(!e.f)return t.Ob();for(;t.Ob();)if(M4(r=(n=Pp(t.Pb(),72)).ak(),99)&&(Pp(r,18).Bb&eZ1)!=0&&(!e.e||r.Gj()!=e5d||0!=r.aj())&&null!=n.dd())return t.Ub(),!0;return!1}function eSs(e,t){var n,r;if(!e.f)return t.Sb();for(;t.Sb();)if(M4(r=(n=Pp(t.Ub(),72)).ak(),99)&&(Pp(r,18).Bb&eZ1)!=0&&(!e.e||r.Gj()!=e5d||0!=r.aj())&&null!=n.dd())return t.Pb(),!0;return!1}function eSu(e,t,n){var r,i,a,o,s,u;for(o=0,u=eAY(e.e.Tg(),t),r=0,s=e.i,i=Pp(e.g,119);o1&&(t.c[t.c.length]=a)}function eSf(e){var t,n,r,i;for(er7(n=new _n,e.o),r=new mc;0!=n.b;)(i=eYP(e,t=Pp(0==n.b?null:(A5(0!=n.b),etw(n,n.a.a)),508),!0))&&P_(r.a,t);for(;0!=r.a.c.length;)eYP(e,t=Pp(euO(r),508),!1)}function eSd(){eSd=A,tdS=new ks(ezo,0),tdm=new ks("BOOLEAN",1),tdw=new ks("INT",2),tdE=new ks("STRING",3),tdg=new ks("DOUBLE",4),tdv=new ks("ENUM",5),tdy=new ks("ENUMSET",6),td_=new ks("OBJECT",7)}function eSh(e,t){var n,r,i,a,o;r=eB4.Math.min(e.c,t.c),a=eB4.Math.min(e.d,t.d),i=eB4.Math.max(e.c+e.b,t.c+t.b),o=eB4.Math.max(e.d+e.a,t.d+t.a),i=(i/2|0))for(this.e=r?r.c:null,this.d=i;n++0;)Gi(this);this.b=t,this.a=null}function eSk(e,t){var n,r;t.a?eAk(e,t):((n=Pp(Ik(e.b,t.b),57))&&n==e.a[t.b.f]&&n.a&&n.a!=t.b.a&&n.c.Fc(t.b),(r=Pp(IS(e.b,t.b),57))&&e.a[r.f]==t.b&&r.a&&r.a!=t.b.a&&t.b.c.Fc(r),Ai(e.b,t.b))}function eSx(e,t){var n,r;if(n=Pp(UA(e.b,t),124),Pp(Pp(Zq(e.r,t),21),84).dc()){n.n.b=0,n.n.c=0;return}n.n.b=e.C.b,n.n.c=e.C.c,e.A.Hc((ed5(),tbq))&&eCD(e,t),r=ebi(e,t),eLZ(e,t)==(epT(),tbt)&&(r+=2*e.w),n.a.a=r}function eST(e,t){var n,r;if(n=Pp(UA(e.b,t),124),Pp(Pp(Zq(e.r,t),21),84).dc()){n.n.d=0,n.n.a=0;return}n.n.d=e.C.d,n.n.a=e.C.a,e.A.Hc((ed5(),tbq))&&eCN(e,t),r=eba(e,t),eLZ(e,t)==(epT(),tbt)&&(r+=2*e.w),n.a.b=r}function eSM(e,t){var n,r,i,a;for(a=new p0,r=new fz(t);r.aeB4.Math.abs(r-i))}function eSU(e,t,n){var r,i,a,o,s,u;if(null!=(s=Pp(eaS(e.a,8),1936)))for(a=0,o=(i=s).length;an.a&&(r.Hc((eyY(),tdW))?i=(t.a-n.a)/2:r.Hc(tdV)&&(i=t.a-n.a)),t.b>n.b&&(r.Hc((eyY(),tdZ))?a=(t.b-n.b)/2:r.Hc(tdq)&&(a=t.b-n.b)),e_g(e,i,a)}function eSJ(e,t,n,r,i,a,o,s,u,c,l,f,d){M4(e.Cb,88)&&eko(Zd(Pp(e.Cb,88)),4),er3(e,n),e.f=o,elY(e,s),elU(e,u),elF(e,c),elB(e,l),els(e,f),elZ(e,d),eli(e,!0),end(e,i),e.ok(a),eu2(e,t),null!=r&&(e.i=null,erA(e,r))}function eSQ(e){var t,n;if(!e.f)return e.n>0;for(;e.n>0;){if(M4(n=(t=Pp(e.k.Xb(e.n-1),72)).ak(),99)&&(Pp(n,18).Bb&eZ1)!=0&&(!e.e||n.Gj()!=e5d||0!=n.aj())&&null!=t.dd())return!0;--e.n}return!1}function eS1(e,t,n){if(e<0)return eCG(eUh,eow(vx(e1R,1),eUp,1,5,[n,ell(e)]));if(!(t<0))return eCG("%s (%s) must not be greater than size (%s)",eow(vx(e1R,1),eUp,1,5,[n,ell(e),ell(t)]));throw p7(new gL(eUb+t))}function eS0(e,t,n,r,i,a){var o,s,u,c;if((o=r-n)<7){efA(t,n,r,a);return}if(c=(u=n+i)+((s=r+i)-u>>1),eS0(t,e,u,c,-i,a),eS0(t,e,c,s,-i,a),0>=a.ue(e[c-1],e[c])){for(;n=0?e.sh(a,n):eOh(e,i,n);else throw p7(new gL(eZV+i.ne()+eZq))}else throw p7(new gL(eZJ+t+eZQ))}else efL(e,r,i,n)}function eS5(e){var t,n,r,i;if(n=Pp(e,49).qh())try{if(r=null,(t=eMC((_Q(),tgp),eDv(efR(n))))&&(i=t.rh())&&(r=i.Wk(gF(n.e))),r&&r!=e)return eS5(r)}catch(a){if(a=eoa(a),!M4(a,60))throw p7(a)}return e}function eS8(e,t,n){var r,i,a,o;if(o=null==t?0:e.b.se(t),0==(i=null==(r=e.a.get(o))?[]:r).length)e.a.set(o,i);else if(a=euj(e,t,i))return a.ed(n);return Bc(i,i.length,new EE(t,n)),++e.c,$c(e.b),null}function eS9(e,t){var n,r;return Kx(e.a),Yb(e.a,(erZ(),tcq),tcq),Yb(e.a,tcZ,tcZ),r=new K2,RI(r,tcZ,(efx(),tc1)),xc(eT9(t,(egj(),tlf)))!==xc((eub(),tc6))&&RI(r,tcZ,tcJ),RI(r,tcZ,tcQ),Tb(e.a,r),n=eRq(e.a,t)}function eS7(e){if(!e)return g3(),e0M;var t=e.valueOf?e.valueOf():e;if(t!==e){var n=e0O[typeof t];return n?n(t):euV(typeof t)}return e instanceof Array||e instanceof eB4.Array?new lL(e):new lD(e)}function eke(e,t,n){var r,i,a;switch(a=e.o,(i=(r=Pp(UA(e.p,n),244)).i).b=ek0(r),i.a=ek1(r),i.b=eB4.Math.max(i.b,a.a),i.b>a.a&&!t&&(i.b=a.a),i.c=-(i.b-a.a)/2,n.g){case 1:i.d=-i.a;break;case 3:i.d=a.b}eNE(r),eNM(r)}function ekt(e,t,n){var r,i,a;switch(a=e.o,(i=(r=Pp(UA(e.p,n),244)).i).b=ek0(r),i.a=ek1(r),i.a=eB4.Math.max(i.a,a.b),i.a>a.b&&!t&&(i.a=a.b),i.d=-(i.a-a.b)/2,n.g){case 4:i.c=-i.b;break;case 2:i.c=a.a}eNE(r),eNM(r)}function ekn(e,t){var n,r,i,a,o;if(!t.dc()){if(i=Pp(t.Xb(0),128),1==t.gc()){eA1(e,i,i,1,0,t);return}for(n=1;n0)try{i=eDa(t,eHt,eUu)}catch(a){if(a=eoa(a),M4(a,127))throw r=a,p7(new QH(r));throw p7(a)}return i<(n=(e.a||(e.a=new pK(e)),e.a)).i&&i>=0?Pp(etj(n,i),56):null}function eku(e,t){if(e<0)return eCG(eUh,eow(vx(e1R,1),eUp,1,5,["index",ell(e)]));if(!(t<0))return eCG("%s (%s) must be less than size (%s)",eow(vx(e1R,1),eUp,1,5,["index",ell(e),ell(t)]));throw p7(new gL(eUb+t))}function ekc(e){var t,n,r,i,a;if(null==e)return eUg;for(r=0,a=new eaP(eUd,"[","]"),i=(n=e).length;re.a.ue(RJ(e.b,o),RJ(e.b,a))&&(s=o),s),!(0>e.a.ue(i,RJ(e.b,r))));)q1(e.b,t,RJ(e.b,r)),t=r;q1(e.b,t,i)}function ekp(e,t,n,r,i,a){var o,s,u,c,l;for(xc(e)===xc(n)&&(e=e.slice(t,t+i),t=0),u=n,s=t,c=t+i;s0)for(o=e.c.d,s=e.d.d,i=Ol(C5(new kl(s.a,s.b),o),1/(r+1)),a=new kl(o.a,o.b),n=new fz(e.a);n.a=0?e._g(n,!0,!0):exk(e,i,!0),153),Pp(r,215).ol(t);else throw p7(new gL(eZV+t.ne()+eZq))}function ekP(e){var t,n;return e>-140737488355328&&e<0x800000000000?0==e?0:((t=e<0)&&(e=-e),n=zy(eB4.Math.floor(eB4.Math.log(e)/.6931471805599453)),(!t||e!=eB4.Math.pow(2,n))&&++n,n):eaJ(eap(e))}function ekR(e){var t,n,r,i,a,o,s;for(a=new Tw,n=new fz(e);n.a2&&s.e.b+s.j.b<=2&&(i=s,r=o),a.a.zc(i,a),i.q=r);return a}function ekj(e,t){var n,r,i;return r=new eb$(e),eaW(r,t),eo3(r,(eBU(),ttQ),t),eo3(r,(eBy(),tol),(ewf(),tbo)),eo3(r,tiq,(ebx(),tdA)),lK(r,(eEn(),e9C)),n=new eES,Gc(n,r),ekv(n,(eYu(),tbY)),i=new eES,Gc(i,r),ekv(i,tby),r}function ekF(e){switch(e.g){case 0:return new gx((enU(),tur));case 1:return new cC;case 2:return new cF;default:throw p7(new gL("No implementation is available for the crossing minimizer "+(null!=e.f?e.f:""+e.g)))}}function ekY(e,t){var n,r,i,a,o;for(e.c[t.p]=!0,P_(e.a,t),o=new fz(t.j);o.a=(a=o.gc()))o.$b();else for(r=0,i=o.Kc();r0?g6():o<0&&ekJ(e,t,-o),!0)}function ek1(e){var t,n,r,i,a,o,s;if(s=0,0==e.b){for(i=0,o=eb4(e,!0),t=0,a=(r=o).length;i0&&(s+=n,++t);t>1&&(s+=e.c*(t-1))}else s=vy(eib(U1(UJ(Yw(e.a),new eS),new ek)));return s>0?s+e.n.d+e.n.a:0}function ek0(e){var t,n,r,i,a,o,s;if(s=0,0==e.b)s=vy(eib(U1(UJ(Yw(e.a),new e_),new eE)));else{for(i=0,o=eb6(e,!0),t=0,a=(r=o).length;i0&&(s+=n,++t);t>1&&(s+=e.c*(t-1))}return s>0?s+e.n.b+e.n.c:0}function ek2(e,t){var n,r,i,a;for(n=(a=Pp(UA(e.b,t),124)).a,i=Pp(Pp(Zq(e.r,t),21),84).Kc();i.Ob();)(r=Pp(i.Pb(),111)).c&&(n.a=eB4.Math.max(n.a,Rd(r.c)));if(n.a>0)switch(t.g){case 2:a.n.c=e.s;break;case 4:a.n.b=e.s}}function ek3(e,t){var n,r,i;return 0==(n=Pp(e_k(t,(eCk(),e8M)),19).a-Pp(e_k(e,e8M),19).a)?(r=C5(MB(Pp(e_k(e,(erV(),e8P)),8)),Pp(e_k(e,e8R),8)),i=C5(MB(Pp(e_k(t,e8P),8)),Pp(e_k(t,e8R),8)),elN(r.a*r.b,i.a*i.b)):n}function ek4(e,t){var n,r,i;return 0==(n=Pp(e_k(t,(eTj(),tcD)),19).a-Pp(e_k(e,tcD),19).a)?(r=C5(MB(Pp(e_k(e,(eR5(),tce)),8)),Pp(e_k(e,tct),8)),i=C5(MB(Pp(e_k(t,tce),8)),Pp(e_k(t,tct),8)),elN(r.a*r.b,i.a*i.b)):n}function ek6(e){var t,n;return n=new vc,n.a+="e_",null!=(t=eaZ(e))&&(n.a+=""+t),e.c&&e.d&&(xM((n.a+=" ",n),egu(e.c)),xM(xT((n.a+="[",n),e.c.i),"]"),xM((n.a+=eGH,n),egu(e.d)),xM(xT((n.a+="[",n),e.d.i),"]")),n.a}function ek5(e){switch(e.g){case 0:return new cD;case 1:return new cN;case 2:return new cI;case 3:return new cP;default:throw p7(new gL("No implementation is available for the layout phase "+(null!=e.f?e.f:""+e.g)))}}function ek8(e,t,n,r,i){var a;switch(a=0,i.g){case 1:a=eB4.Math.max(0,t.b+e.b-(n.b+r));break;case 3:a=eB4.Math.max(0,-e.b-r);break;case 2:a=eB4.Math.max(0,-e.a-r);break;case 4:a=eB4.Math.max(0,t.a+e.a-(n.a+r))}return a}function ek9(e,t,n){var r,i,a,o,s;if(n)for(i=n.a.length,s=((r=new Fs(i)).b-r.a)*r.c<0?(_8(),eB3):new OR(r);s.Ob();)eXh in(a=KZ(n,(o=Pp(s.Pb(),19)).a)).a||eXp in a.a?eId(e,a,t):eBe(e,a,t),Om(Pp(Bp(e.b,ehM(a)),79))}function ek7(e){var t,n;switch(e.b){case -1:return!0;case 0:if((n=e.t)>1||-1==n||(t=evl(e))&&(_4(),t.Cj()==eJK))return e.b=-1,!0;return e.b=1,!1;default:return!1}}function exe(e,t){var n,r,i,a,o;for(i=0,r=(t.s||(t.s=new FQ(tm5,t,21,17)),t.s),a=null,o=r.i;i=0&&r=0?e._g(n,!0,!0):exk(e,i,!0),153),Pp(r,215).ll(t);throw p7(new gL(eZV+t.ne()+eZX))}function exc(){var e;return(_5(),tg8)?Pp(eMC((_Q(),tgp),eQc),1939):(x2(e1$,new ut),ej8(),e=Pp(M4(zg((_Q(),tgp),eQc),547)?zg(tgp,eQc):new Uh,547),tg8=!0,eBY(e),eB0(e),Um((_1(),tgm),e,new sM),Ge(tgp,eQc,e),e)}function exl(e,t){var n,r,i,a;e.j=-1,TO(e.e)?(n=e.i,a=0!=e.i,Zz(e,t),r=new Q$(e.e,3,e.c,null,t,n,a),i=t.Qk(e.e,e.c,null),(i=ey1(e,t,i))?(i.Ei(r),i.Fi()):eam(e.e,r)):(Zz(e,t),(i=t.Qk(e.e,e.c,null))&&i.Fi())}function exf(e,t){var n,r,i;if(i=0,(r=t[0])>=e.length)return -1;for(n=(GV(r,e.length),e.charCodeAt(r));n>=48&&n<=57&&(i=10*i+(n-48),!(++r>=e.length));)n=(GV(r,e.length),e.charCodeAt(r));return r>t[0]?t[0]=r:i=-1,i}function exd(e){var t,n,r,i,a;return i=Pp(e.a,19).a,a=Pp(e.b,19).a,n=i,r=a,t=eB4.Math.max(eB4.Math.abs(i),eB4.Math.abs(a)),i<=0&&i==a?(n=0,r=a-1):i==-t&&a!=t?(n=a,r=i,a>=0&&++n):(n=-a,r=i),new kD(ell(n),ell(r))}function exh(e,t,n,r){var i,a,o,s,u,c;for(i=0;i=0&&c>=0&&u=e.i)throw p7(new gE(eXU+t+eXH+e.i));if(n>=e.i)throw p7(new gE(eX$+n+eXH+e.i));return r=e.g[n],t!=n&&(t>16))>>16&16),e>>=t,n+=t=(r=e-256)>>16&8,e<<=t,n+=t=(r=e-eH0)>>16&4,e<<=t,n+=t=(r=e-eUR)>>16&2,e<<=t,n+2-(t=(r=e>>14)&~(r>>1)))}function exy(e){var t,n,r,i;for(HR(),e8n=new p0,e8t=new p2,e8e=new p0,t=(e.a||(e.a=new FQ(e5k,e,10,11)),e.a),eYE(t),i=new Ow(t);i.e!=i.i.gc();)r=Pp(epH(i),33),-1==QI(e8n,r,0)&&(n=new p0,P_(e8e,n),epi(r,n));return e8e}function exw(e,t,n){var r,i,a,o;e.a=n.b.d,M4(t,352)?(i=eLO(Pp(t,79),!1,!1),a=eEF(i),qX(a,r=new d_(e)),eNI(a,i),null!=t.We((eBB(),thg))&&qX(Pp(t.We(thg),74),r)):((o=Pp(t,470)).Hg(o.Dg()+e.a.a),o.Ig(o.Eg()+e.a.b))}function ex_(e,t){var n,r,i,a,o,s,u,c;for(s=1,c=gP(LV(e_k(t,(eBy(),toH)))),u=e[0].n.a+e[0].o.a+e[0].d.c+c;s=0)?n:(s=B$(C5(new kl(o.c+o.b/2,o.d+o.a/2),new kl(a.c+a.b/2,a.d+a.a/2))),-(eDz(a,o)-1)*s)}function exS(e,t,n){var r;_r(new R1(null,(n.a||(n.a=new FQ(e5v,n,6,6)),new Gq(n.a,16))),new kC(e,t)),_r(new R1(null,(n.n||(n.n=new FQ(e5S,n,1,7)),new Gq(n.n,16))),new kI(e,t)),(r=Pp(eT9(n,(eBB(),thg)),74))&&eil(r,e,t)}function exk(e,t,n){var r,i,a;if(a=eR3((eSp(),tvc),e.Tg(),t))return _4(),Pp(a,66).Oj()||(a=Wk(QZ(tvc,a))),i=Pp((r=e.Yg(a))>=0?e._g(r,!0,!0):exk(e,a,!0),153),Pp(i,215).hl(t,n);throw p7(new gL(eZV+t.ne()+eZX))}function exx(e,t,n,r){var i,a,o,s,u;if(i=e.d[t]){if(a=i.g,u=i.i,null!=r){for(s=0;s=n&&(r=t,o=(c=(u.c+u.a)/2)-n,u.c<=c-n&&(i=new N4(u.c,o),jO(e,r++,i)),(s=c+n)<=u.a&&(a=new N4(s,u.a),Gp(r,e.c.length),Ew(e.c,r,a)))}function exI(e){var t;if(e.c||null!=e.g){if(null==e.g)return!0;if(0==e.i)return!1;t=Pp(e.g[e.i-1],47)}else e.d=e.si(e.f),JL(e,e.d),t=e.d;return t==e.b&&null.km>=null.jm()?(eM6(e),exI(e)):t.Ob()}function exD(e,t,n){var r,i,a,o,s;if((s=n)||(s=P5(new mV,0)),ewG(s,eGA,1),ejY(e.c,t),1==(o=ejz(e.a,t)).gc())eRd(Pp(o.Xb(0),37),s);else for(a=1/o.gc(),i=o.Kc();i.Ob();)eRd(r=Pp(i.Pb(),37),eiI(s,a));vi(e.a,o,t),eL7(t),eEj(s)}function exN(e){if(this.a=e,e.c.i.k==(eEn(),e9C))this.c=e.c,this.d=Pp(e_k(e.c.i,(eBU(),tt1)),61);else if(e.d.i.k==e9C)this.c=e.d,this.d=Pp(e_k(e.d.i,(eBU(),tt1)),61);else throw p7(new gL("Edge "+e+" is not an external edge."))}function exP(e,t){var n,r,i;i=e.b,e.b=t,(4&e.Db)!=0&&(1&e.Db)==0&&eam(e,new FX(e,1,3,i,e.b)),t?t!=e&&(er3(e,t.zb),enf(e,t.d),erc(e,null==(n=null==(r=t.c)?t.zb:r)||IE(n,t.zb)?null:n)):(er3(e,null),enf(e,0),erc(e,null))}function exR(e){var t,n;if(!e.f)return e.n=(o=null==(n=Pp(eaS(e.a,4),126))?0:n.length))throw p7(new Ii(t,o));return i=n[t],1==o?r=null:(r=Je(e5N,eJM,415,o-1,0,1),ePD(n,0,r,0,t),(a=o-t-1)>0&&ePD(n,t+1,r,t,a)),eps(e,r),eSU(e,t,i),i}function ex$(){ex$=A,tvw=Pp(etj(H8((yL(),tvS).qb),6),34),tvg=Pp(etj(H8(tvS.qb),3),34),tvv=Pp(etj(H8(tvS.qb),4),34),tvy=Pp(etj(H8(tvS.qb),5),18),eyD(tvw),eyD(tvg),eyD(tvv),eyD(tvy),tv_=new g$(eow(vx(tm5,1),eJ4,170,0,[tvw,tvg]))}function exz(e,t){var n;this.d=new mh,this.b=t,this.e=new TS(t.qf()),n=e.u.Hc((ekU(),tbb)),e.u.Hc(tbp)?e.D?this.a=n&&!t.If():this.a=!0:e.u.Hc(tbm)&&n?this.a=!(t.zf().Kc().Ob()||t.Bf().Kc().Ob()):this.a=!1}function exG(e,t){var n,r,i,a;for(n=e.o.a,a=Pp(Pp(Zq(e.r,t),21),84).Kc();a.Ob();)(i=Pp(a.Pb(),111)).e.a=(r=i.b).Xe((eBB(),thK))?r.Hf()==(eYu(),tbY)?-r.rf().a-gP(LV(r.We(thK))):n+gP(LV(r.We(thK))):r.Hf()==(eYu(),tbY)?-r.rf().a:n}function exW(e,t){var n,r,i,a;n=Pp(e_k(e,(eBy(),tal)),103),a=Pp(eT9(t,tob),61),(i=Pp(e_k(e,tol),98))!=(ewf(),tbc)&&i!=tbl?a==(eYu(),tbF)&&(a=eNh(t,n))==tbF&&(a=ef8(n)):a=(r=eRl(t))>0?ef8(n):elC(ef8(n)),ebu(t,tob,a)}function exK(e,t){var n,r,i,a,o;for(o=e.j,t.a!=t.b&&Mv(o,new ia),i=o.c.length/2|0,r=0;r0&&eIl(e,n,t),a):null!=r.a?(eIl(e,t,n),-1):null!=i.a?(eIl(e,n,t),1):0}function exq(e,t){var n,r,i,a;e.ej()?(n=e.Vi(),a=e.fj(),++e.j,e.Hi(n,e.oi(n,t)),r=e.Zi(3,null,t,n,a),e.bj()&&(i=e.cj(t,null))?(i.Ei(r),i.Fi()):e.$i(r)):(BD(e,t),e.bj()&&(i=e.cj(t,null))&&i.Fi())}function exZ(e,t){var n,r,i,a,o;for(o=eAY(e.e.Tg(),t),i=new o7,n=Pp(e.g,119),a=e.i;--a>=0;)r=n[a],o.rl(r.ak())&&JL(i,r);!eYK(e,i)&&TO(e.e)&&bz(e,t.$j()?$N(e,6,t,(Hj(),e2r),null,-1,!1):$N(e,t.Kj()?2:1,t,null,null,-1,!1))}function exX(){var e,t;for(t=0,exX=A,e2t=Je(e0t,eUP,91,32,0,1),e2n=Je(e0t,eUP,91,32,0,1),e=1;t<=18;t++)e2t[t]=ep_(e),e2n[t]=ep_(Fg(e,t)),e=efn(e,5);for(;to)))&&(!t.q||(o=(r=t.C).c.c.a-r.o.a/2,!((i=r.n.a-n)>o))))}function exQ(e,t){var n;ewG(t,"Partition preprocessing",1),n=Pp(qE(UJ(eeh(UJ(new R1(null,new Gq(e.a,16)),new nZ),new nX),new nJ),JF(new U,new B,new en,eow(vx(e2L,1),eU4,132,0,[(eum(),e2U)]))),15),_r(n.Oc(),new nQ),eEj(t)}function ex1(e){var t,n,r,i,a,o,s;for(Gk(),n=new qh,i=new fz(e.e.b);i.a1?e.e*=gP(e.a):e.f/=gP(e.a),eu0(e),ehK(e),eCj(e),eo3(e.b,(epz(),e52),e.g)}function ex8(e,t,n){var r,i,a,o,s,u;for(r=0,u=n,t||(r=n*(e.c.length-1),u*=-1),a=new fz(e);a.a=0?(!t&&(t=new vu,r>0&&xk(t,e.substr(0,r))),t.a+="\\",Bf(t,n&eHd)):t&&Bf(t,n&eHd);return t?t.a:e}function eTh(e){var t;if(!e.a)throw p7(new gC("IDataType class expected for layout option "+e.f));if(null==(t=VN(e.a)))throw p7(new gC("Couldn't create new instance of property '"+e.f+"'. "+eq4+(LW(e5D),e5D.k)+eq6));return Pp(t,414)}function eTp(e){var t,n,r,i,a;return(a=e.eh())&&a.kh()&&(i=ecv(e,a))!=a?(n=e.Vg(),r=(t=e.Vg())>=0?e.Qg(null):e.eh().ih(e,-1-t,null,null),e.Rg(Pp(i,49),n),r&&r.Fi(),e.Lg()&&e.Mg()&&n>-1&&eam(e,new FX(e,9,n,a,i)),i):a}function eTb(e){var t,n,r,i,a,o,s,u;for(r=0,o=0,a=e.f.e;r>5)>=e.d)return e.e<0;if(n=e.a[i],t=1<<(31&t),e.e<0){if(i<(r=eiU(e)))return!1;n=r==i?-n:~n}return(n&t)!=0}function eT_(e,t,n,r){var i;Pp(n.b,65),Pp(n.b,65),Pp(r.b,65),Pp(r.b,65),P8(i=C5(MB(Pp(n.b,65).c),Pp(r.b,65).c),ekg(Pp(n.b,65),Pp(r.b,65),i)),Pp(r.b,65),Pp(r.b,65),Pp(r.b,65).c.a,i.a,Pp(r.b,65).c.b,i.b,Pp(r.b,65),ety(r.a,new N8(e,t,r))}function eTE(e,t){var n,r,i,a,o,s,u;if(a=t.e){for(o=0,n=eTp(a),r=Pp(e.g,674);o>16)),15).Xc(a))0&&(Tk(e.a.c)&&t.n.d||Tx(e.a.c)&&t.n.b||(t.g.d+=eB4.Math.max(0,r/2-.5)),Tk(e.a.c)&&t.n.a||Tx(e.a.c)&&t.n.c||(t.g.a-=r-1))}function eTO(e){var t,n,r,i,a;if(i=new p0,a=eDC(e,i),t=Pp(e_k(e,(eBU(),tng)),10))for(r=new fz(t.j);r.a>t,a=e.m>>t|n<<22-t,i=e.l>>t|e.m<<22-t):t<44?(o=r?eH$:0,a=n>>t-22,i=e.m>>t-22|n<<44-t):(o=r?eH$:0,a=r?eHH:0,i=n>>t-44),Mk(i&eHH,a&eHH,o&eH$)}function eTI(e){var t,n,r,i,a,o;for(this.c=new p0,this.d=e,r=eHQ,i=eHQ,t=eH1,n=eH1,o=epL(e,0);o.b!=o.d.c;)a=Pp(Vv(o),8),r=eB4.Math.min(r,a.a),i=eB4.Math.min(i,a.b),t=eB4.Math.max(t,a.a),n=eB4.Math.max(n,a.b);this.a=new Hr(r,i,t-r,n-i)}function eTD(e,t){var n,r,i,a,o,s;for(a=new fz(e.b);a.a0&&M4(t,42)&&(e.a.qj(),a=null==(u=(c=Pp(t,42)).cd())?0:esj(u),o=Cb(e.a,a),n=e.a.d[o])){for(s=0,r=Pp(n.g,367),l=n.i;s=2)for(t=LV((n=i.Kc()).Pb());n.Ob();)a=t,t=LV(n.Pb()),r=eB4.Math.min(r,(BJ(t),t-(BJ(a),a)));return r}function eTX(e,t){var n,r,i,a,o;qQ(r=new _n,t,r.c.b,r.c);do for(n=(A5(0!=r.b),Pp(etw(r,r.a.a),86)),e.b[n.g]=1,a=epL(n.d,0);a.b!=a.d.c;)o=(i=Pp(Vv(a),188)).c,1==e.b[o.g]?P7(e.a,i):2==e.b[o.g]?e.b[o.g]=1:qQ(r,o,r.c.b,r.c);while(0!=r.b)}function eTJ(e,t){var n,r,i;if(xc(t)===xc(Y8(e)))return!0;if(!M4(t,15)||(r=Pp(t,15),(i=e.gc())!=r.gc()))return!1;if(!M4(r,54))return eb3(e.Kc(),r.Kc());for(n=0;n0&&(i=n),o=new fz(e.f.e);o.a0?(t-=1,n-=1):r>=0&&i<0?(t+=1,n+=1):r>0&&i>=0?(t-=1,n+=1):(t+=1,n-=1),new kD(ell(t),ell(n))}function eMf(e,t){if(e.ct.c)return 1;if(e.bt.b)return 1;if(e.a!=t.a)return esj(e.a)-esj(t.a);else if(e.d==(qG(),tuf)&&t.d==tul)return -1;else if(e.d==tul&&t.d==tuf)return 1;return 0}function eMd(e,t){var n,r,i,a,o;return(o=(a=t.a).c.i==t.b?a.d:a.c,r=a.c.i==t.b?a.c:a.d,(i=edI(e.a,o,r))>0&&i0):i<0&&-i0)}function eMh(e,t,n,r){var i,a,o,s,u,c,l,f;for(i=(t-e.d)/e.c.c.length,a=0,e.a+=n,e.d=t,f=new fz(e.c);f.a>24;return o}function eMb(e){if(e.pe()){var t=e.c;t.qe()?e.o="["+t.n:t.pe()?e.o="["+t.ne():e.o="[L"+t.ne()+";",e.b=t.me()+"[]",e.k=t.oe()+"[]";return}var n=e.j,r=e.d;r=r.split("/"),e.o=ehg(".",[n,ehg("$",r)]),e.b=ehg(".",[n,ehg(".",r)]),e.k=r[r.length-1]}function eMm(e,t){var n,r,i,a,o;for(o=null,a=new fz(e.e.a);a.a=0;t-=2)for(n=0;n<=t;n+=2)(e.b[n]>e.b[n+2]||e.b[n]===e.b[n+2]&&e.b[n+1]>e.b[n+3])&&(r=e.b[n+2],e.b[n+2]=e.b[n],e.b[n]=r,r=e.b[n+3],e.b[n+3]=e.b[n+1],e.b[n+1]=r);e.c=!0}}function eMk(e,t){var n,r,i,a,o,s,u,c;for(a=(o=1==t?e9c:e9u).a.ec().Kc();a.Ob();)for(i=Pp(a.Pb(),103),u=Pp(Zq(e.f.c,i),21).Kc();u.Ob();)switch(s=Pp(u.Pb(),46),r=Pp(s.b,81),n=(c=Pp(s.a,189)).c,i.g){case 2:case 1:r.g.d+=n;break;case 4:case 3:r.g.c+=n}}function eMx(e,t){var n,r,i,a,o,s,u,c,l;for(s=0,c=-1,l=0,u=(o=e).length;s0&&++l;++c}return l}function eMT(e){var t,n;return n=new O0(yx(e.gm)),n.a+="@",xM(n,(t=esj(e)>>>0).toString(16)),e.kh()?(n.a+=" (eProxyURI: ",xT(n,e.qh()),e.$g()&&(n.a+=" eClass: ",xT(n,e.$g())),n.a+=")"):e.$g()&&(n.a+=" (eClass: ",xT(n,e.$g()),n.a+=")"),n.a}function eMM(e){var t,n,r,i;if(e.e)throw p7(new gC((LW(e2J),e$j+e2J.k+e$F)));for(e.d==(ec3(),tpv)&&eF_(e,tpm),n=new fz(e.a.a);n.a>24}return n}function eMD(e,t,n){var r,i,a;if(!(i=Pp(UA(e.i,t),306))){if(i=new etr(e.d,t,n),jT(e.i,t,i),ehj(t))Od(e.a,t.c,t.b,i);else switch(a=eSv(t),r=Pp(UA(e.p,a),244),a.g){case 1:case 3:i.j=!0,gh(r,t.b,i);break;case 4:case 2:i.k=!0,gh(r,t.c,i)}}return i}function eMN(e,t,n,r){var i,a,o,s,u,c;if(s=new o7,u=eAY(e.e.Tg(),t),i=Pp(e.g,119),_4(),Pp(t,66).Oj())for(o=0;o=0)return i;for(a=1,s=new fz(t.j);s.a0&&t.ue((GK(i-1,e.c.length),Pp(e.c[i-1],10)),a)>0;)q1(e,i,(GK(i-1,e.c.length),Pp(e.c[i-1],10))),--i;GK(i,e.c.length),e.c[i]=a}n.a=new p2,n.b=new p2}function eMj(e,t,n){var r,i,a,o,s,u,c,l;for(o=0,l=(r=Pp(t.e&&t.e(),9),new I1(r,Pp(CY(r,r.length),9),0)),s=(a=u=eIk(n,"[\\[\\]\\s,]+")).length;o0&&(Tk(e.a.c)&&t.n.d||Tx(e.a.c)&&t.n.b||(t.g.d-=eB4.Math.max(0,r/2-.5)),Tk(e.a.c)&&t.n.a||Tx(e.a.c)&&t.n.c||(t.g.a+=eB4.Math.max(0,r-1)))}function eMY(e,t,n){var r,i;if((e.c-e.b&e.a.length-1)==2)t==(eYu(),tbw)||t==tby?(etf(Pp(eso(e),15),(egF(),tpV)),etf(Pp(eso(e),15),tpq)):(etf(Pp(eso(e),15),(egF(),tpq)),etf(Pp(eso(e),15),tpV));else for(i=new UN(e);i.a!=i.b;)etf(r=Pp(ecn(i),15),n)}function eMB(e,t){var n,r,i,a,o,s,u;for(i=Pb(new pL(e)),s=new KB(i,i.c.length),a=Pb(new pL(t)),u=new KB(a,a.c.length),o=null;s.b>0&&u.b>0;)if((n=(A5(s.b>0),Pp(s.a.Xb(s.c=--s.b),33)))==(r=(A5(u.b>0),Pp(u.a.Xb(u.c=--u.b),33))))o=n;else break;return o}function eMU(e,t){var n,r,i,a,o,s;return(a=e.a*e$d+1502*e.b,s=e.b*e$d+11,a+=n=eB4.Math.floor(s*e$h),s-=n*e$p,a%=e$p,e.a=a,e.b=s,t<=24)?eB4.Math.floor(e.a*e2v[t]):((r=(i=e.a*(1<=2147483648&&(r-=eH7),r)}function eMH(e,t,n){var r,i,a,o;WY(e,t)>WY(e,n)?(r=efr(n,(eYu(),tby)),e.d=r.dc()?0:Rk(Pp(r.Xb(0),11)),o=efr(t,tbY),e.b=o.dc()?0:Rk(Pp(o.Xb(0),11))):(i=efr(n,(eYu(),tbY)),e.d=i.dc()?0:Rk(Pp(i.Xb(0),11)),a=efr(t,tby),e.b=a.dc()?0:Rk(Pp(a.Xb(0),11)))}function eM$(e){var t,n,r,i,a,o,s;if(e&&(t=e.Hh(eQc))&&null!=(o=Lq(edW((t.b||(t.b=new L_((eBK(),tgF),tgf,t)),t.b),"conversionDelegates")))){for(s=new p0,r=eIk(o,"\\w+"),i=0,a=r.length;ie.c);o++)i.a>=e.s&&(a<0&&(a=o),s=o);return u=(e.s+e.c)/2,a>=0&&(r=eIe(e,t,a,s),u=_V((GK(r,t.c.length),Pp(t.c[r],329))),exC(t,r,n)),u}function eMK(){eMK=A,tlK=new T2((eBB(),td2),1.3),tlX=thc,tfe=new T3(15),tl7=new T2(thN,tfe),tfr=new T2(tpl,15),tlV=td8,tl3=thx,tl4=thO,tl6=thL,tl2=thS,tl5=thD,tft=thJ,tl9=(eTU(),tl$),tl0=tlU,tl8=tlH,tfn=tlG,tlJ=tlB,tlQ=thb,tl1=thm,tlZ=tlY,tlq=tlF,tfi=tlW}function eMV(e,t,n){var r,i,a,o,s,u,c;for(erl(o=a=new sa,(BJ(t),t)),c=(o.b||(o.b=new L_((eBK(),tgF),tgf,o)),o.b),u=1;u0&&eRJ(this,i)}function eMZ(e,t,n,r,i,a){var o,s,u;if(!i[t.b]){for(i[t.b]=!0,(o=r)||(o=new Z6),P_(o.e,t),u=a[t.b].Kc();u.Ob();)(s=Pp(u.Pb(),282)).d!=n&&s.c!=n&&(s.c!=t&&eMZ(e,s.c,t,o,i,a),s.d!=t&&eMZ(e,s.d,t,o,i,a),P_(o.c,s),eoc(o.d,s.b));return o}return null}function eMX(e){var t,n,r,i,a,o,s;for(t=0,i=new fz(e.e);i.a=2}function eMJ(e,t){var n,r,i,a;for(ewG(t,"Self-Loop pre-processing",1),r=new fz(e.a);r.a1)&&(t=jL(tp1,eow(vx(e5t,1),eU4,93,0,[tpQ,tp2])),!(eaC(z_(t,e))>1)&&(r=jL(tp8,eow(vx(e5t,1),eU4,93,0,[tp5,tp6])),!(eaC(z_(r,e))>1)))}function eM0(e,t){var n,r,i;return(n=t.Hh(e.a))&&null!=(i=Lq(edW((n.b||(n.b=new L_((eBK(),tgF),tgf,n)),n.b),"affiliation")))?-1==(r=O9(i,e_n(35)))?elp(e,Fr(e,etP(t.Hj())),i):0==r?elp(e,null,i.substr(1)):elp(e,i.substr(0,r),i.substr(r+1)):null}function eM2(e){var t,n,r;try{return null==e?eUg:efF(e)}catch(i){if(i=eoa(i),M4(i,102))return t=i,r=yx(esF(e))+"@"+(n=(wK(),ebh(e)>>>0)).toString(16),epa(eob(),(_g(),"Exception during lenientFormat for "+r),t),"<"+r+" threw "+yx(t.gm)+">";throw p7(i)}}function eM3(e){switch(e.g){case 0:return new ck;case 1:return new cy;case 2:return new _j;case 3:return new i$;case 4:return new CZ;case 5:return new cx;default:throw p7(new gL("No implementation is available for the layerer "+(null!=e.f?e.f:""+e.g)))}}function eM4(e,t,n){var r,i,a;for(a=new fz(e.t);a.a0&&(r.b.n-=r.c,r.b.n<=0&&r.b.u>0&&P7(t,r.b));for(i=new fz(e.i);i.a0&&(r.a.u-=r.c,r.a.u<=0&&r.a.n>0&&P7(n,r.a))}function eM6(e){var t,n,r,i,a;if(null==e.g&&(e.d=e.si(e.f),JL(e,e.d),e.c))return e.f;if(i=(t=Pp(e.g[e.i-1],47)).Pb(),e.e=t,(n=e.si(i)).Ob())e.d=n,JL(e,n);else for(e.d=null;!t.Ob()&&(Bc(e.g,--e.i,null),0!=e.i);)t=r=Pp(e.g[e.i-1],47);return i}function eM5(e,t){var n,r,i,a,o,s;if(i=(r=t).ak(),eLt(e.e,i)){if(i.hi()&&Vq(e,i,r.dd()))return!1}else for(a=0,s=eAY(e.e.Tg(),i),n=Pp(e.g,119);a1||n>1)return 2;return t+n==1?2:0}function eOs(e,t,n){var r,i,a,o,s;for(ewG(n,"ELK Force",1),gN(LK(eT9(t,(eCk(),e8E))))||zh(r=new df((_q(),new gM(t)))),s=eo4(t),evn(s),esO(e,Pp(e_k(s,e8v),424)),a=(o=eNx(e.a,s)).Kc();a.Ob();)i=Pp(a.Pb(),231),eIL(e.b,i,eiI(n,1/o.gc()));s=eYC(o),eYh(s),eEj(n)}function eOu(e,t){var n,r,i,a,o;if(ewG(t,"Breaking Point Processor",1),eFM(e),gN(LK(e_k(e,(eBy(),toJ))))){for(i=new fz(e.b);i.a=0?e._g(r,!0,!0):exk(e,a,!0),153),Pp(i,215).ml(t,n)}else throw p7(new gL(eZV+t.ne()+eZq))}function eOp(e,t){var n,r,i,a,o;for(r=1,n=new p0,i=eeh(new R1(null,new Gq(e,16)),new aM),a=eeh(new R1(null,new Gq(e,16)),new aO),o=QN(Xg(U1(eAa(eow(vx(e2C,1),eUp,833,0,[i,a])),new aA)));r=2*t&&P_(n,new N4(o[r-1]+t,o[r]-t));return n}function eOb(e,t,n){ewG(n,"Eades radial",1),n.n&&t&&WG(n,KS(t),(eup(),tmr)),e.d=Pp(eT9(t,(Lj(),tcV)),33),e.c=gP(LV(eT9(t,(egj(),tl_)))),e.e=ebN(Pp(eT9(t,tlE),293)),e.a=ef7(Pp(eT9(t,tlk),426)),e.b=eyp(Pp(eT9(t,tlg),340)),evY(e),n.n&&t&&WG(n,KS(t),(eup(),tmr))}function eOm(e,t,n){var r,i,a,o,s,u,c,l;if(n)for(a=n.a.length,s=((r=new Fs(a)).b-r.a)*r.c<0?(_8(),eB3):new OR(r);s.Ob();)(i=KZ(n,(o=Pp(s.Pb(),19)).a))&&(eB9=null,u=Vj(e,(c=(yT(),l=new mk),t&&eOL(c,t),c),i),ert(u,KJ(i,eXS)),ewU(i,u),eka(i,u),esv(e,i,u))}function eOg(e){var t,n,r,i,a,o;if(!e.j){if(o=new sd,null==(a=(t=tgz).a.zc(e,t))){for(r=new Ow($E(e));r.e!=r.i.gc();)n=Pp(epH(r),26),i=eOg(n),Y4(o,i),JL(o,n);t.a.Bc(e)}euI(o),e.j=new xQ((Pp(etj(H8((BM(),tgv).o),11),18),o.i),o.g),Zd(e).b&=-33}return e.j}function eOv(e){var t,n,r,i;if(null==e)return null;if(r=ePh(e,!0),i=eQq.length,IE(r.substr(r.length-i,i),eQq)){if(4==(n=r.length)){if(43==(t=(GV(0,r.length),r.charCodeAt(0))))return tvX;if(45==t)return tvZ}else if(3==n)return tvX}return new bK(r)}function eOy(e){var t,n,r;return((n=e.l)&n-1)!=0||((r=e.m)&r-1)!=0||((t=e.h)&t-1)!=0||0==t&&0==r&&0==n?-1:0==t&&0==r&&0!=n?enq(n):0==t&&0!=r&&0==n?enq(r)+22:0!=t&&0==r&&0==n?enq(t)+44:-1}function eOw(e,t){var n,r,i,a,o;for(ewG(t,"Edge joining",1),n=gN(LK(e_k(e,(eBy(),toz)))),i=new fz(e.b);i.a1)for(i=new fz(e.a);i.a0),a.a.Xb(a.c=--a.b),CD(a,i),A5(a.becd(r,0)?(i=eHf-jE(edQ(QC(r),eHf)))==eHf&&(i=0):i=jE(edQ(r,eHf)),1==t?Bd(e,48+(i=eB4.Math.min((i+50)/100|0,9))&eHd):2==t?eeE(e,i=eB4.Math.min((i+5)/10|0,99),2):(eeE(e,i,3),t>3&&eeE(e,0,t-3))}function eOM(e){var t,n,r,i;return xc(e_k(e,(eBy(),taM)))===xc((eck(),tpz))?!e.e&&xc(e_k(e,tat))!==xc((eaU(),ttO)):(r=Pp(e_k(e,tan),292),i=gN(LK(e_k(e,tao)))||xc(e_k(e,tas))===xc((en7(),teR)),t=Pp(e_k(e,tae),19).a,n=e.a.c.length,!i&&r!=(eaU(),ttO)&&(0==t||t>n))}function eOO(e){var t,n;for(n=0;n0);n++);if(n>0&&n0);t++);return t>0&&n>16!=6&&t){if(eg7(e,t))throw p7(new gL(eZ4+ex2(e)));r=null,e.Cb&&(r=(n=e.Db>>16)>=0?eg1(e,r):e.Cb.ih(e,-1-n,null,r)),t&&(r=ep0(t,e,6,r)),(r=Cc(e,t,r))&&r.Fi()}else(4&e.Db)!=0&&(1&e.Db)==0&&eam(e,new FX(e,1,6,t,t))}function eOL(e,t){var n,r;if(t!=e.Cb||e.Db>>16!=9&&t){if(eg7(e,t))throw p7(new gL(eZ4+eC6(e)));r=null,e.Cb&&(r=(n=e.Db>>16)>=0?eg2(e,r):e.Cb.ih(e,-1-n,null,r)),t&&(r=ep0(t,e,9,r)),(r=Cl(e,t,r))&&r.Fi()}else(4&e.Db)!=0&&(1&e.Db)==0&&eam(e,new FX(e,1,9,t,t))}function eOC(e,t){var n,r;if(t!=e.Cb||e.Db>>16!=3&&t){if(eg7(e,t))throw p7(new gL(eZ4+ePY(e)));r=null,e.Cb&&(r=(n=e.Db>>16)>=0?evo(e,r):e.Cb.ih(e,-1-n,null,r)),t&&(r=ep0(t,e,12,r)),(r=Cu(e,t,r))&&r.Fi()}else(4&e.Db)!=0&&(1&e.Db)==0&&eam(e,new FX(e,1,3,t,t))}function eOI(e){var t,n,r,i,a;if(r=evl(e),null==(a=e.j)&&r)return e.$j()?null:r.zj();if(M4(r,148)){if((n=r.Aj())&&(i=n.Nh())!=e.i){if((t=Pp(r,148)).Ej())try{e.g=i.Kh(t,a)}catch(o){if(o=eoa(o),M4(o,78))e.g=null;else throw p7(o)}e.i=i}return e.g}return null}function eOD(e){var t;return t=new p0,P_(t,new EL(new kl(e.c,e.d),new kl(e.c+e.b,e.d))),P_(t,new EL(new kl(e.c,e.d),new kl(e.c,e.d+e.a))),P_(t,new EL(new kl(e.c+e.b,e.d+e.a),new kl(e.c+e.b,e.d))),P_(t,new EL(new kl(e.c+e.b,e.d+e.a),new kl(e.c,e.d+e.a))),t}function eON(e,t,n,r){var i,a,o;if(o=eyn(t,n),r.c[r.c.length]=t,-1==e.j[o.p]||2==e.j[o.p]||e.a[t.p])return r;for(e.j[o.p]=-1,a=new Fa(OH(efs(o).a.Kc(),new c));eTk(a);)if(i=Pp(ZC(a),17),!q9(i)&&!(!q9(i)&&i.c.i.c==i.d.i.c)&&i!=t)return eON(e,i,o,r);return r}function eOP(e,t,n){var r,i,a;for(a=t.a.ec().Kc();a.Ob();)i=Pp(a.Pb(),79),(r=Pp(Bp(e.b,i),266))||(z$(e_I(i))==z$(e_P(i))?eLk(e,i,n):e_I(i)==z$(e_P(i))?null==Bp(e.c,i)&&null!=Bp(e.b,e_P(i))&&eFt(e,i,n,!1):null==Bp(e.d,i)&&null!=Bp(e.b,e_I(i))&&eFt(e,i,n,!0))}function eOR(e,t){var n,r,i,a,o,s,u;for(i=e.Kc();i.Ob();)for(r=Pp(i.Pb(),10),s=new eES,Gc(s,r),ekv(s,(eYu(),tby)),eo3(s,(eBU(),tnm),(OQ(),!0)),o=t.Kc();o.Ob();)a=Pp(o.Pb(),10),u=new eES,Gc(u,a),ekv(u,tbY),eo3(u,tnm,!0),n=new $b,eo3(n,tnm,!0),Gs(n,s),Go(n,u)}function eOj(e,t,n,r){var i,a,o,s;i=ehu(e,t,n),a=ehu(e,n,t),o=Pp(Bp(e.c,t),112),s=Pp(Bp(e.c,n),112),ir.b.g&&(a.c[a.c.length]=r);return a}function eOB(){eOB=A,tfo=new S8("CANDIDATE_POSITION_LAST_PLACED_RIGHT",0),tfa=new S8("CANDIDATE_POSITION_LAST_PLACED_BELOW",1),tfu=new S8("CANDIDATE_POSITION_WHOLE_DRAWING_RIGHT",2),tfs=new S8("CANDIDATE_POSITION_WHOLE_DRAWING_BELOW",3),tfc=new S8("WHOLE_DRAWING",4)}function eOU(e,t){if(M4(t,239))return elg(e,Pp(t,33));if(M4(t,186))return el$(e,Pp(t,118));if(M4(t,354))return Hd(e,Pp(t,137));if(M4(t,352))return eNP(e,Pp(t,79));if(t)return null;else throw p7(new gL(eXx+e_F(new g$(eow(vx(e1R,1),eUp,1,5,[t])))))}function eOH(e){var t,n,r,i,a,o,s;for(a=new _n,i=new fz(e.d.a);i.a1)for(t=Al((n=new b1,++e.b,n),e.d),s=epL(a,0);s.b!=s.d.c;)o=Pp(Vv(s),121),eAx(_f(_l(_d(_c(new bQ,1),0),t),o))}function eO$(e,t){var n,r;if(t!=e.Cb||e.Db>>16!=11&&t){if(eg7(e,t))throw p7(new gL(eZ4+eC4(e)));r=null,e.Cb&&(r=(n=e.Db>>16)>=0?evs(e,r):e.Cb.ih(e,-1-n,null,r)),t&&(r=ep0(t,e,10,r)),(r=C4(e,t,r))&&r.Fi()}else(4&e.Db)!=0&&(1&e.Db)==0&&eam(e,new FX(e,1,11,t,t))}function eOz(e){var t,n,r,i;for(r=new esz(new fS(e.b).a);r.b;)n=etz(r),i=Pp(n.cd(),11),eo3(t=Pp(n.dd(),10),(eBU(),tnc),i),eo3(i,tng,t),eo3(i,tt5,(OQ(),!0)),ekv(i,Pp(e_k(t,tt1),61)),e_k(t,tt1),eo3(i.i,(eBy(),tol),(ewf(),tbu)),Pp(e_k(Bq(i.i),tt3),21).Fc((eLR(),ttS))}function eOG(e,t,n){var r,i,a,o,s,u;if(a=0,o=0,e.c)for(u=new fz(e.d.i.j);u.aa.a)?-1:i.a(u=null==e.d?0:e.d.length)))return!1;for(a=0,l=e.d,e.d=Je(e5C,eJA,63,2*u+4,0,1);a=0x7fffffffffffffff?(Q2(),e0L):(i=!1,e<0&&(i=!0,e=-e),r=0,e>=eHW&&(r=zy(e/eHW),e-=r*eHW),n=0,e>=eHG&&(n=zy(e/eHG),e-=n*eHG),a=Mk(t=zy(e),n,r),i&&esh(a),a)}function eO5(e,t){var n,r,i,a;for(n=!t||!e.u.Hc((ekU(),tbp)),a=0,i=new fz(e.e.Cf());i.a=-t&&r==t?new kD(ell(n-1),ell(r)):new kD(ell(n),ell(r-1))}function eAn(){return eB$(),eow(vx(e4B,1),eU4,77,0,[e96,e92,e95,e7d,e7C,e7m,e7j,e7_,e7A,e7s,e7x,e7w,e7L,e7r,e7Y,e9Z,e7k,e7D,e7h,e7I,e7U,e7M,e9X,e7O,e7H,e7P,e7B,e7p,e7e,e7b,e7f,e7F,e91,e99,e7v,e9Q,e7y,e7c,e7i,e7E,e7o,e93,e90,e7l,e7a,e7S,e7R,e9J,e7T,e7u,e7g,e7t,e97,e7N,e98,e7n,e94])}function eAr(e,t,n){e.d=0,e.b=0,t.k==(eEn(),e9P)&&n.k==e9P&&Pp(e_k(t,(eBU(),tnc)),10)==Pp(e_k(n,tnc),10)&&(QP(t).j==(eYu(),tbw)?eMH(e,t,n):eMH(e,n,t)),t.k==e9P&&n.k==e9D?QP(t).j==(eYu(),tbw)?e.d=1:e.b=1:n.k==e9P&&t.k==e9D&&(QP(n).j==(eYu(),tbw)?e.b=1:e.d=1),emu(e,t,n)}function eAi(e){var t,n,r,i,a,o,s,u,c,l,f;return f=ewW(e),(u=null!=(t=e.a))&&P4(f,"category",e.a),(o=!(i=wc(new fk(e.d))))&&(ee3(f,"knownOptions",c=new lN),n=new pS(c),qX(new fk(e.d),n)),(s=!(a=wc(e.g)))&&(ee3(f,"supportedFeatures",l=new lN),r=new pk(l),qX(e.g,r)),f}function eAa(e){var t,n,r,i,a,o,s,u,c;for(u=0,r=!1,t=336,n=0,a=new CE(e.length),c=(s=e).length;u>16!=7&&t){if(eg7(e,t))throw p7(new gL(eZ4+eE1(e)));r=null,e.Cb&&(r=(n=e.Db>>16)>=0?eg0(e,r):e.Cb.ih(e,-1-n,null,r)),t&&(r=Pp(t,49).gh(e,1,e5p,r)),(r=j2(e,t,r))&&r.Fi()}else(4&e.Db)!=0&&(1&e.Db)==0&&eam(e,new FX(e,1,7,t,t))}function eAc(e,t){var n,r;if(t!=e.Cb||e.Db>>16!=3&&t){if(eg7(e,t))throw p7(new gL(eZ4+eln(e)));r=null,e.Cb&&(r=(n=e.Db>>16)>=0?eg4(e,r):e.Cb.ih(e,-1-n,null,r)),t&&(r=Pp(t,49).gh(e,0,e5y,r)),(r=j3(e,t,r))&&r.Fi()}else(4&e.Db)!=0&&(1&e.Db)==0&&eam(e,new FX(e,1,3,t,t))}function eAl(e,t){var n,r,i,a,o,s,u,c,l;return(exX(),t.d>e.d&&(s=e,e=t,t=s),t.d<63)?eLm(e,t):(o=(-2&e.d)<<4,c=ZL(e,o),l=ZL(t,o),r=eNz(e,ZA(c,o)),i=eNz(t,ZA(l,o)),u=eAl(c,l),n=eAl(r,i),a=eAl(eNz(c,r),eNz(i,l)),a=eP6(eP6(a,u),n),a=ZA(a,o),u=ZA(u,o<<1),eP6(eP6(u,a),n))}function eAf(e,t,n){var r,i,a,o,s;for(o=ecZ(e,n),s=Je(e4N,eGW,10,t.length,0,1),r=0,a=o.Kc();a.Ob();)gN(LK(e_k(i=Pp(a.Pb(),11),(eBU(),tt5))))&&(s[r++]=Pp(e_k(i,tng),10));if(r=0;a+=n?1:-1)o|=t.c.Sf(u,a,n,r&&!gN(LK(e_k(t.j,(eBU(),tt2))))&&!gN(LK(e_k(t.j,(eBU(),tnS))))),o|=t.q._f(u,a,n),o|=eCA(e,u[a],n,r);return Yf(e.c,t),o}function eAm(e,t,n){var r,i,a,o,s,u,c,l,f,d;for(l=Kz(e.j),f=0,d=l.length;f1&&(e.a=!0),jU(Pp(n.b,65),C6(MB(Pp(t.b,65).c),Ol(C5(MB(Pp(n.b,65).a),Pp(t.b,65).a),i))),GC(e,t),eAy(e,n)}function eAw(e){var t,n,r,i,a,o,s;for(a=new fz(e.a.a);a.a0&&a>0?o.p=t++:r>0?o.p=n++:a>0?o.p=i++:o.p=n++}Hj(),Mv(e.j,new nG)}function eAE(e){var t,n;n=null,t=Pp(RJ(e.g,0),17);do{if(Ln(n=t.d.i,(eBU(),tna)))return Pp(e_k(n,tna),11).i;if(n.k!=(eEn(),e9N)&&eTk(new Fa(OH(efc(n).a.Kc(),new c))))t=Pp(ZC(new Fa(OH(efc(n).a.Kc(),new c))),17);else if(n.k!=e9N)return null}while(!!n&&n.k!=(eEn(),e9N))return n}function eAS(e,t){var n,r,i,a,o,s,u,c,l;for(a=1,s=t.j,o=t.g,c=em1(e,o,u=Pp(RJ(s,s.c.length-1),113),l=(GK(0,s.c.length),Pp(s.c[0],113)));ac&&(u=n,l=i,c=r);t.a=l,t.c=u}function eAk(e,t){var n,r;if(!(r=YB(e.b,t.b)))throw p7(new gC("Invalid hitboxes for scanline constraint calculation."));(eop(t.b,Pp(CF(e.b,t.b),57))||eop(t.b,Pp(Cj(e.b,t.b),57)))&&(wK(),t.b),e.a[t.b.f]=Pp(Ik(e.b,t.b),57),(n=Pp(IS(e.b,t.b),57))&&(e.a[n.f]=t.b)}function eAx(e){if(!e.a.d||!e.a.e)throw p7(new gC((LW(e23),e23.k+" must have a source and target "+(LW(e24),e24.k)+" specified.")));if(e.a.d==e.a.e)throw p7(new gC("Network simplex does not support self-loops: "+e.a+" "+e.a.d+" "+e.a.e));return Am(e.a.d.g,e.a),Am(e.a.e.b,e.a),e.a}function eAT(e,t,n){var r,i,a,o,s,u,c;for(c=new yB(new hA(e)),o=eow(vx(e4j,1),eGK,11,0,[t,n]),s=0,u=o.length;su-e.b&&su-e.a&&s0&&++h;++d}return h}function eAF(e,t){var n,r,i,a,o;for(o=Pp(e_k(t,(eTj(),tcN)),425),a=epL(t.b,0);a.b!=a.d.c;)if(i=Pp(Vv(a),86),0==e.b[i.g]){switch(o.g){case 0:eb8(e,i);break;case 1:eTX(e,i)}e.b[i.g]=2}for(r=epL(e.a,0);r.b!=r.d.c;)eds((n=Pp(Vv(r),188)).b.d,n,!0),eds(n.c.b,n,!0);eo3(t,(eR5(),tch),e.a)}function eAY(e,t){var n,r,i,a;return(_4(),t)?t==(eR7(),tvG)||(t==tvM||t==tvx||t==tvT)&&e!=tvk?new eF2(e,t):((n=(r=Pp(t,677)).pk())||(UH(QZ((eSp(),tvc),t)),n=r.pk()),a=(n.i||(n.i=new p2),n.i),(i=Pp(xu($I(a.f,e)),1942))||Um(a,e,i=new eF2(e,t)),i):tvb}function eAB(e,t){var n,r,i,a,o,s,u,c,l;for(a=0,u=Pp(e_k(e,(eBU(),tnc)),11),c=esp(eow(vx(e60,1),eUP,8,0,[u.i.n,u.n,u.a])).a,l=e.i.n.b,o=(i=n=Kp(e.e)).length;a0?a.a?n>(s=a.b.rf().a)&&(i=(n-s)/2,a.d.b=i,a.d.c=i):a.d.c=e.s+n:FY(e.u)&&((r=ew1(a.b)).c<0&&(a.d.b=-r.c),r.c+r.b>a.b.rf().a&&(a.d.c=r.c+r.b-a.b.rf().a))}function eAz(e,t){var n,r,i,a;for(ewG(t,"Semi-Interactive Crossing Minimization Processor",1),n=!1,i=new fz(e.b);i.a=0){if(t==n)return new kD(ell(-t-1),ell(-t-1));if(t==-n)return new kD(ell(-t),ell(n+1))}return eB4.Math.abs(t)>eB4.Math.abs(n)?t<0?new kD(ell(-t),ell(n)):new kD(ell(-t),ell(n+1)):new kD(ell(t+1),ell(n))}function eAK(e){var t,n;n=Pp(e_k(e,(eBy(),taY)),163),t=Pp(e_k(e,(eBU(),tt8)),303),n==(ef_(),tnN)?(eo3(e,taY,tnj),eo3(e,tt8,(Q1(),ttN))):n==tnR?(eo3(e,taY,tnj),eo3(e,tt8,(Q1(),ttI))):t==(Q1(),ttN)?(eo3(e,taY,tnN),eo3(e,tt8,ttD)):t==ttI&&(eo3(e,taY,tnR),eo3(e,tt8,ttD))}function eAV(){eAV=A,tuY=new ad,tuP=RI(new K2,(e_x(),e9n),(eB$(),e7h)),tuF=j0(RI(new K2,e9n,e7M),e9i,e7T),tuB=ehY(ehY(_G(j0(RI(new K2,e9e,e7j),e9i,e7R),e9r),e7P),e7F),tuR=j0(RI(RI(RI(new K2,e9t,e7m),e9r,e7v),e9r,e7y),e9i,e7g),tuj=j0(RI(RI(new K2,e9r,e7y),e9r,e99),e9i,e98)}function eAq(){eAq=A,tuz=RI(j0(new K2,(e_x(),e9i),(eB$(),e7t)),e9n,e7h),tuV=ehY(ehY(_G(j0(RI(new K2,e9e,e7j),e9i,e7R),e9r),e7P),e7F),tuG=j0(RI(RI(RI(new K2,e9t,e7m),e9r,e7v),e9r,e7y),e9i,e7g),tuK=RI(RI(new K2,e9n,e7M),e9i,e7T),tuW=j0(RI(RI(new K2,e9r,e7y),e9r,e99),e9i,e98)}function eAZ(e,t,n,r,i){var a,o;(q9(t)||t.c.i.c!=t.d.i.c)&&erS(esp(eow(vx(e60,1),eUP,8,0,[i.i.n,i.n,i.a])),n)||q9(t)||(t.c==i?Ls(t.a,0,new TS(n)):P7(t.a,new TS(n)),r&&!w0(e.a,n)&&((o=Pp(e_k(t,(eBy(),taR)),74))||eo3(t,taR,o=new mE),qQ(o,a=new TS(n),o.c.b,o.c),Yf(e.a,a)))}function eAX(e){var t,n;for(n=new Fa(OH(efu(e).a.Kc(),new c));eTk(n);)if((t=Pp(ZC(n),17)).c.i.k!=(eEn(),e9I))throw p7(new gq(eWr+egs(e)+"' has its layer constraint set to FIRST, but has at least one incoming edge that does not come from a FIRST_SEPARATE node. That must not happen."))}function eAJ(e,t,n){var r,i,a,o,s,u,c;if(0==(i=efp(254&e.Db)))e.Eb=n;else{if(1==i)s=Je(e1R,eUp,1,2,5,1),0==(a=emF(e,t))?(s[0]=n,s[1]=e.Eb):(s[0]=e.Eb,s[1]=n);else for(r=2,s=Je(e1R,eUp,1,i+1,5,1),o=etG(e.Eb),u=0,c=0;r<=128;r<<=1)r==t?s[c++]=n:(e.Db&r)!=0&&(s[c++]=o[u++]);e.Eb=s}e.Db|=t}function eAQ(e,t,n){var r,i,a,o;for(this.b=new p0,i=0,r=0,o=new fz(e);o.a0&&(i+=(a=Pp(RJ(this.b,0),167)).o,r+=a.p),i*=2,r*=2,t>1?i=zy(eB4.Math.ceil(i*t)):r=zy(eB4.Math.ceil(r/t)),this.a=new edL(i,r)}function eA1(e,t,n,r,i,a){var o,s,u,c,l,f,d,h,p,b,m,g;for(l=r,t.j&&t.o?(b=(h=Pp(Bp(e.f,t.A),57)).d.c+h.d.b,--l):b=t.a.c+t.a.b,f=i,n.q&&n.o?(c=(h=Pp(Bp(e.f,n.C),57)).d.c,++f):c=n.a.c,m=c-b,p=b+(s=m/(u=eB4.Math.max(2,f-l))),d=l;d=0;o+=i?1:-1){for(s=t[o],u=r==(eYu(),tby)?i?efr(s,r):eaa(efr(s,r)):i?eaa(efr(s,r)):efr(s,r),a&&(e.c[s.p]=u.gc()),f=u.Kc();f.Ob();)l=Pp(f.Pb(),11),e.d[l.p]=c++;eoc(n,u)}}function eA2(e,t,n){var r,i,a,o,s,u,c,l;for(a=gP(LV(e.b.Kc().Pb())),c=gP(LV(eaX(t.b))),l=C6(r=Ol(MB(e.a),c-n),i=Ol(MB(t.a),n-a)),Ol(l,1/(c-a)),this.a=l,this.b=new p0,s=!0,(o=e.b.Kc()).Pb();o.Ob();)u=gP(LV(o.Pb())),s&&u-n>eVW&&(this.b.Fc(n),s=!1),this.b.Fc(u);s&&this.b.Fc(n)}function eA3(e){var t,n,r,i;if(eIh(e,e.n),e.d.c.length>0){for(gG(e.c);eTT(e,Pp(Wx(new fz(e.e.a)),121))>5,t&=31,r>=e.d)return e.e<0?(eLQ(),e03):(eLQ(),e09);if(i=Je(ty_,eHT,25,(a=e.d-r)+1,15,1),eEG(i,a,e.a,r,t),e.e<0){for(n=0;n0&&e.a[n]<<32-t!=0){for(n=0;n=0)&&(!(n=eR3((eSp(),tvc),i,t))||((r=n.Zj())>1||-1==r)&&3!=Ur(QZ(tvc,n))))}function eLn(e,t,n,r){var i,a,o,s,u;return(s=ewH(Pp(etj((t.b||(t.b=new Ih(e5m,t,4,7)),t.b),0),82)),u=ewH(Pp(etj((t.c||(t.c=new Ih(e5m,t,5,8)),t.c),0),82)),z$(s)==z$(u)||etg(u,s))?null:(o=zF(t))==n?r:(a=Pp(Bp(e.a,o),10))&&(i=a.e)?i:null}function eLr(e,t){var n;switch(n=Pp(e_k(e,(eBy(),tam)),276),ewG(t,"Label side selection ("+n+")",1),n.g){case 0:eTD(e,(egF(),tpV));break;case 1:eTD(e,(egF(),tpq));break;case 2:eNW(e,(egF(),tpV));break;case 3:eNW(e,(egF(),tpq));break;case 4:eLL(e,(egF(),tpV));break;case 5:eLL(e,(egF(),tpq))}eEj(t)}function eLi(e,t,n){var r,i,a,o,s,u;if((o=e[r=vK(n,e.length)])[0].k==(eEn(),e9C))for(i=0,a=vW(n,o.length),u=t.j;i0&&(n[0]+=e.d,o-=n[0]),n[2]>0&&(n[2]+=e.d,o-=n[2]),a=eB4.Math.max(0,o),n[1]=eB4.Math.max(n[1],o),ZR(e,e3N,i.c+r.b+n[0]-(n[1]-o)/2,n),t==e3N&&(e.c.b=a,e.c.c=i.c+r.b+(a-o)/2)}function eLy(){this.c=Je(tyx,eH6,25,(eYu(),eow(vx(e5a,1),eGj,61,0,[tbF,tbw,tby,tbj,tbY])).length,15,1),this.b=Je(tyx,eH6,25,eow(vx(e5a,1),eGj,61,0,[tbF,tbw,tby,tbj,tbY]).length,15,1),this.a=Je(tyx,eH6,25,eow(vx(e5a,1),eGj,61,0,[tbF,tbw,tby,tbj,tbY]).length,15,1),Ep(this.c,eHQ),Ep(this.b,eH1),Ep(this.a,eH1)}function eLw(e,t,n){var r,i,a,o;if(t<=n?(i=t,a=n):(i=n,a=t),r=0,null==e.b)e.b=Je(ty_,eHT,25,2,15,1),e.b[0]=i,e.b[1]=a,e.c=!0;else{if(r=e.b.length,e.b[r-1]+1==i){e.b[r-1]=a;return}o=Je(ty_,eHT,25,r+2,15,1),ePD(e.b,0,o,0,r),e.b=o,e.b[r-1]>=i&&(e.c=!1,e.a=!1),e.b[r++]=i,e.b[r]=a,e.c||eMS(e)}}function eL_(e,t,n){var r,i,a,o,s,u,c;for(c=t.d,e.a=new XM(c.c.length),e.c=new p2,s=new fz(c);s.a=0?e._g(c,!1,!0):exk(e,n,!1),58);n:for(a=f.Kc();a.Ob();){for(l=0,i=Pp(a.Pb(),56);l1;)eLN(i,i.i-1);return r}function eLA(e,t){var n,r,i,a,o,s,u;for(ewG(t,"Comment post-processing",1),a=new fz(e.b);a.ae.d[o.p]&&(n+=qq(e.b,a),Vw(e.a,ell(a)));for(;!gY(e.a);)eek(e.b,Pp(Yn(e.a),19).a)}return n}function eLD(e,t,n){var r,i,a,o;for(a=(t.a||(t.a=new FQ(e5k,t,10,11)),t.a).i,i=new Ow((t.a||(t.a=new FQ(e5k,t,10,11)),t.a));i.e!=i.i.gc();)0==((r=Pp(epH(i),33)).a||(r.a=new FQ(e5k,r,10,11)),r.a).i||(a+=eLD(e,r,!1));if(n)for(o=z$(t);o;)a+=(o.a||(o.a=new FQ(e5k,o,10,11)),o.a).i,o=z$(o);return a}function eLN(e,t){var n,r,i,a;return e.ej()?(r=null,i=e.fj(),e.ij()&&(r=e.kj(e.pi(t),null)),n=e.Zi(4,a=egk(e,t),null,t,i),e.bj()&&null!=a?(r=e.dj(a,r))?(r.Ei(n),r.Fi()):e.$i(n):r?(r.Ei(n),r.Fi()):e.$i(n),a):(a=egk(e,t),e.bj()&&null!=a&&(r=e.dj(a,null))&&r.Fi(),a)}function eLP(e){var t,n,r,i,a,o,s,u,c,l;for(c=e.a,t=new bV,u=0,r=new fz(e.d);r.as.d&&(l=s.d+s.a+c));n.c.d=l,t.a.zc(n,t),u=eB4.Math.max(u,n.c.d+n.c.a)}return u}function eLR(){eLR=A,ttv=new Sv("COMMENTS",0),ttw=new Sv("EXTERNAL_PORTS",1),tt_=new Sv("HYPEREDGES",2),ttE=new Sv("HYPERNODES",3),ttS=new Sv("NON_FREE_PORTS",4),ttk=new Sv("NORTH_SOUTH_PORTS",5),ttT=new Sv(eWw,6),ttg=new Sv("CENTER_LABELS",7),tty=new Sv("END_LABELS",8),ttx=new Sv("PARTITIONS",9)}function eLj(e){var t,n,r,i,a;for(i=new p0,t=new Rq((e.a||(e.a=new FQ(e5k,e,10,11)),e.a)),r=new Fa(OH(eOi(e).a.Kc(),new c));eTk(r);)n=Pp(ZC(r),79),!M4(etj((n.b||(n.b=new Ih(e5m,n,4,7)),n.b),0),186)&&(a=ewH(Pp(etj((n.c||(n.c=new Ih(e5m,n,5,8)),n.c),0),82)),t.a._b(a)||(i.c[i.c.length]=a));return i}function eLF(e){var t,n,r,i,a,o;for(a=new bV,t=new Rq((e.a||(e.a=new FQ(e5k,e,10,11)),e.a)),i=new Fa(OH(eOi(e).a.Kc(),new c));eTk(i);)r=Pp(ZC(i),79),!M4(etj((r.b||(r.b=new Ih(e5m,r,4,7)),r.b),0),186)&&(o=ewH(Pp(etj((r.c||(r.c=new Ih(e5m,r,5,8)),r.c),0),82)),t.a._b(o)||(n=a.a.zc(o,a)));return a}function eLY(e,t,n,r,i){return r<0?((r=ew5(e,i,eow(vx(e17,1),eUP,2,6,[eHh,eHp,eHb,eHm,eHg,eHv,eHy,eHw,eH_,eHE,eHS,eHk]),t))<0&&(r=ew5(e,i,eow(vx(e17,1),eUP,2,6,["Jan","Feb","Mar","Apr",eHg,"Jun","Jul","Aug","Sep","Oct","Nov","Dec"]),t)),!(r<0)&&(n.k=r,!0)):r>0&&(n.k=r-1,!0)}function eLB(e,t,n,r,i){return r<0?((r=ew5(e,i,eow(vx(e17,1),eUP,2,6,[eHh,eHp,eHb,eHm,eHg,eHv,eHy,eHw,eH_,eHE,eHS,eHk]),t))<0&&(r=ew5(e,i,eow(vx(e17,1),eUP,2,6,["Jan","Feb","Mar","Apr",eHg,"Jun","Jul","Aug","Sep","Oct","Nov","Dec"]),t)),!(r<0)&&(n.k=r,!0)):r>0&&(n.k=r-1,!0)}function eLU(e,t,n,r,i,a){var o,s,u,c;if(s=32,r<0){if(t[0]>=e.length||43!=(s=UI(e,t[0]))&&45!=s||(++t[0],(r=exf(e,t))<0))return!1;45==s&&(r=-r)}return 32==s&&t[0]-n==2&&2==i.b&&(o=(c=(u=new wW).q.getFullYear()-eHx+eHx-80)%100,a.a=r==o,r+=(c/100|0)*100+(r=c&&(u=r);u&&(l=eB4.Math.max(l,u.a.o.a)),l>d&&(f=c,d=l)}return f}function eLV(e,t,n){var r,i,a;if(e.e=n,e.d=0,e.b=0,e.f=1,e.i=t,(16&e.e)==16&&(e.i=eIw(e.i)),e.j=e.i.length,eBM(e),a=ehT(e),e.d!=e.j)throw p7(new gX(eBJ((Mo(),eXV))));if(e.g){for(r=0;reqg?Mv(u,e.b):r<=eqg&&r>eqv?Mv(u,e.d):r<=eqv&&r>eqy?Mv(u,e.c):r<=eqy&&Mv(u,e.a),a=eLJ(e,u,a);return i}function eLQ(){var e;for(e=0,eLQ=A,e04=new XE(1,1),e05=new XE(1,10),e09=new XE(0,0),e03=new XE(-1,1),e06=eow(vx(e0t,1),eUP,91,0,[e09,e04,new XE(1,2),new XE(1,3),new XE(1,4),new XE(1,5),new XE(1,6),new XE(1,7),new XE(1,8),new XE(1,9),e05]),e08=Je(e0t,eUP,91,32,0,1);e1)&&(r=new kl(i,n.b),P7(t.a,r)),enD(t.a,eow(vx(e60,1),eUP,8,0,[d,f]))}function eL5(e){_Y(e,new ewB(vQ(vq(vJ(vX(new oc,eZA),"ELK Randomizer"),'Distributes the nodes randomly on the plane, leading to very obfuscating layouts. Can be useful to demonstrate the power of "real" layout algorithms.'),new oz))),KE(e,eZA,ezW,tb$),KE(e,eZA,eGi,15),KE(e,eZA,eGo,ell(0)),KE(e,eZA,ezG,eGt)}function eL8(){var e,t,n,r,i,a;for(t=0,eL8=A,tv1=Je(tyk,eZ9,25,255,15,1),tv0=Je(tyw,eHl,25,16,15,1);t<255;t++)tv1[t]=-1;for(n=57;n>=48;n--)tv1[n]=n-48<<24>>24;for(r=70;r>=65;r--)tv1[r]=r-65+10<<24>>24;for(i=102;i>=97;i--)tv1[i]=i-97+10<<24>>24;for(a=0;a<10;a++)tv0[a]=48+a&eHd;for(e=10;e<=15;e++)tv0[e]=65+e-10&eHd}function eL9(e,t,n){var r,i,a,o,s,u,c,l;return s=t.i-e.g/2,u=n.i-e.g/2,c=t.j-e.g/2,l=n.j-e.g/2,a=t.g+e.g/2,o=n.g+e.g/2,r=t.f+e.g/2,i=n.f+e.g/2,!!(s>19!=0)return"-"+eCr(eoQ(e));for(n=e,r="";!(0==n.l&&0==n.m&&0==n.h);){if(n=eRV(n,i=Zx(eHK),!0),t=""+yq(e0A),!(0==n.l&&0==n.m&&0==n.h))for(a=9-t.length;a>0;a--)t="0"+t;r=t+r}return r}function eCi(){if(!Object.create||!Object.getOwnPropertyNames)return!1;var e="__proto__",t=Object.create(null);return void 0===t[e]&&0==Object.getOwnPropertyNames(t).length&&(t[e]=42,42===t[e]&&0!=Object.getOwnPropertyNames(t).length)}function eCa(e){var t,n,r,i,a,o,s;for(t=!1,n=0,i=new fz(e.d.b);i.a=e.a||!ewg(t,n))return -1;if(Vb(Pp(r.Kb(t),20)))return 1;for(i=0,o=Pp(r.Kb(t),20).Kc();o.Ob();)if(-1==(s=eCu(e,u=(a=Pp(o.Pb(),17)).c.i==t?a.d.i:a.c.i,n,r))||(i=eB4.Math.max(i,s))>e.c-1)return -1;return i+1}function eCc(e,t){var n,r,i,a,o,s;if(xc(t)===xc(e))return!0;if(!M4(t,15)||(r=Pp(t,15),s=e.gc(),r.gc()!=s))return!1;if(o=r.Kc(),e.ni()){for(n=0;n0){if(e.qj(),null!=t){for(a=0;a>24;case 97:case 98:case 99:case 100:case 101:case 102:return e-97+10<<24>>24;case 65:case 66:case 67:case 68:case 69:case 70:return e-65+10<<24>>24;default:throw p7(new vo("Invalid hexadecimal"))}}function eCh(e,t,n){var r,i,a,o;for(ewG(n,"Processor order nodes",2),e.a=gP(LV(e_k(t,(eTj(),tcR)))),i=new _n,o=epL(t.b,0);o.b!=o.d.c;)gN(LK(e_k(a=Pp(Vv(o),86),(eR5(),tcm))))&&qQ(i,a,i.c.b,i.c);eRt(e,r=(A5(0!=i.b),Pp(i.a.a.c,86))),n.b||erd(n,1),eC1(e,r,0-gP(LV(e_k(r,(eR5(),tcu))))/2,0),n.b||erd(n,1),eEj(n)}function eCp(){eCp=A,e3C=new Ej("SPIRAL",0),e3T=new Ej("LINE_BY_LINE",1),e3M=new Ej("MANHATTAN",2),e3x=new Ej("JITTER",3),e3A=new Ej("QUADRANTS_LINE_BY_LINE",4),e3L=new Ej("QUADRANTS_MANHATTAN",5),e3O=new Ej("QUADRANTS_JITTER",6),e3k=new Ej("COMBINE_LINE_BY_LINE_MANHATTAN",7),e3S=new Ej("COMBINE_JITTER_MANHATTAN",8)}function eCb(e,t,n,r){var i,a,o,s,u,c;for(u=eya(e,n),c=eya(t,n),i=!1;u&&c;)if(r||egl(u,c,n))o=eya(u,n),s=eya(c,n),QB(t),QB(e),a=u.c,ejf(u,!1),ejf(c,!1),n?(egU(t,c.p,a),t.p=c.p,egU(e,u.p+1,a),e.p=u.p):(egU(e,u.p,a),e.p=u.p,egU(t,c.p+1,a),t.p=c.p),Gu(u,null),Gu(c,null),u=o,c=s,i=!0;else break;return i}function eCm(e,t,n,r){var i,a,o,s,u;for(i=!1,a=!1,s=new fz(r.j);s.a=t.length)throw p7(new gE("Greedy SwitchDecider: Free layer not in graph."));this.c=t[e],this.e=new IQ(r),er$(this.e,this.c,(eYu(),tbY)),this.i=new IQ(r),er$(this.i,this.c,tby),this.f=new jy(this.c),this.a=!a&&i.i&&!i.s&&this.c[0].k==(eEn(),e9C),this.a&&eSt(this,e,t.length)}function eC_(e,t){var n,r,i,a,o,s;a=!e.B.Hc((eI3(),tbX)),o=e.B.Hc(tb1),e.a=new edA(o,a,e.c),e.n&&HI(e.a.n,e.n),gh(e.g,(etx(),e3N),e.a),t||((r=new eh5(1,a,e.c)).n.a=e.k,jT(e.p,(eYu(),tbw),r),(i=new eh5(1,a,e.c)).n.d=e.k,jT(e.p,tbj,i),(s=new eh5(0,a,e.c)).n.c=e.k,jT(e.p,tbY,s),(n=new eh5(0,a,e.c)).n.b=e.k,jT(e.p,tby,n))}function eCE(e){var t,n,r;switch((t=Pp(e_k(e.d,(eBy(),tag)),218)).g){case 2:n=eBn(e);break;case 3:n=(r=new p0,_r(UJ(UQ(eeh(eeh(new R1(null,new Gq(e.d.b,16)),new rJ),new rQ),new r1),new rY),new ha(r)),r);break;default:throw p7(new gC("Compaction not supported for "+t+" edges."))}eRD(e,n),qX(new fk(e.g),new hr(e))}function eCS(e,t){var n;return(n=new eX,t&&eaW(n,Pp(Bp(e.a,e5p),94)),M4(t,470)&&eaW(n,Pp(Bp(e.a,e5b),94)),M4(t,354))?(eaW(n,Pp(Bp(e.a,e5S),94)),n):(M4(t,82)&&eaW(n,Pp(Bp(e.a,e5m),94)),M4(t,239))?(eaW(n,Pp(Bp(e.a,e5k),94)),n):M4(t,186)?(eaW(n,Pp(Bp(e.a,e5x),94)),n):(M4(t,352)&&eaW(n,Pp(Bp(e.a,e5g),94)),n)}function eCk(){eCk=A,e8M=new T2((eBB(),th4),ell(1)),e8D=new T2(tpl,80),e8I=new T2(tpr,5),e8p=new T2(td2,eGt),e8O=new T2(th6,ell(1)),e8C=new T2(th9,(OQ(),!0)),e8k=new T3(50),e8S=new T2(thN,e8k),e8m=thb,e8x=thV,e8b=new T2(thn,!1),e8E=thD,e8_=thL,e8w=thx,e8y=thS,e8T=thJ,e8v=(eEg(),e8i),e8N=e8c,e8g=e8r,e8A=e8o,e8L=e8u}function eCx(e){var t,n,r,i,a,o,s,u;for(u=new Zr,s=new fz(e.a);s.a0&&t=0)return!1;if(t.p=n.b,P_(n.e,t),i==(eEn(),e9D)||i==e9P){for(o=new fz(t.j);o.a1||-1==o)&&(a|=16),(i.Bb&eZ1)!=0&&(a|=64)),(n.Bb&eH3)!=0&&(a|=eJq),a|=eXt):M4(t,457)?a|=512:(r=t.Bj())&&(1&r.i)!=0&&(a|=256),(512&e.Bb)!=0&&(a|=128),a}function eCG(e,t){var n,r,i,a,o;for(i=0,e=null==e?eUg:(BJ(e),e);ie.d[s.p]&&(n+=qq(e.b,a),Vw(e.a,ell(a))):++o;for(n+=e.b.d*o;!gY(e.a);)eek(e.b,Pp(Yn(e.a),19).a)}return n}function eCV(e,t){var n;return e.f==tvm?(n=Ur(QZ((eSp(),tvc),t)),e.e?4==n&&t!=(ex$(),tvw)&&t!=(ex$(),tvg)&&t!=(ex$(),tvv)&&t!=(ex$(),tvy):2==n):!!(e.d&&(e.d.Hc(t)||e.d.Hc(Wk(QZ((eSp(),tvc),t)))||e.d.Hc(eR3((eSp(),tvc),e.b,t))))||!!(e.f&&eOq((eSp(),e.f),U$(QZ(tvc,t))))&&(n=Ur(QZ(tvc,t)),e.e?4==n:2==n)}function eCq(e,t,n,r){var i,a,o,s,u,c,l,f;return u=(o=Pp(eT9(n,(eBB(),th3)),8)).a,l=o.b+e,(i=eB4.Math.atan2(l,u))<0&&(i+=eV7),(i+=t)>eV7&&(i-=eV7),c=(s=Pp(eT9(r,th3),8)).a,f=s.b+e,(a=eB4.Math.atan2(f,c))<0&&(a+=eV7),(a+=t)>eV7&&(a-=eV7),Mc(),enj(1e-10),1e-10>=eB4.Math.abs(i-a)||i==a||isNaN(i)&&isNaN(a)?0:ia?1:Te(isNaN(i),isNaN(a))}function eCZ(e){var t,n,r,i,a,o,s;for(s=new p2,r=new fz(e.a.b);r.a=e.o)throw p7(new bj);s=t>>5,o=31&t,a=Fg(1,jE(Fg(o,1))),i?e.n[n][s]=WO(e.n[n][s],a):e.n[n][s]=WM(e.n[n][s],PN(a)),a=Fg(a,1),r?e.n[n][s]=WO(e.n[n][s],a):e.n[n][s]=WM(e.n[n][s],PN(a))}catch(u){if(u=eoa(u),M4(u,320))throw p7(new gE(ez_+e.o+"*"+e.p+ezE+t+eUd+n+ezS));throw p7(u)}}function eC1(e,t,n,r){var i,a,o;t&&(a=gP(LV(e_k(t,(eR5(),tcd))))+r,o=n+gP(LV(e_k(t,tcu)))/2,eo3(t,tcg,ell(jE(eap(eB4.Math.round(a))))),eo3(t,tcv,ell(jE(eap(eB4.Math.round(o))))),0==t.d.b||eC1(e,Pp(M2((i=epL(new hz(t).a.d,0),new hG(i))),86),n+gP(LV(e_k(t,tcu)))+e.a,r+gP(LV(e_k(t,tcc)))),null!=e_k(t,tcb)&&eC1(e,Pp(e_k(t,tcb),86),n,r))}function eC0(e,t){var n,r,i,a,o,s,u,c,l,f,d;for(i=2*gP(LV(e_k(u=Bq(t.a),(eBy(),toI)))),l=gP(LV(e_k(u,toY))),c=eB4.Math.max(i,l),a=Je(tyx,eH6,25,t.f-t.c+1,15,1),r=-c,n=0,s=t.b.Kc();s.Ob();)o=Pp(s.Pb(),10),r+=e.a[o.c.p]+c,a[n++]=r;for(r+=e.a[t.a.c.p]+c,a[n++]=r,d=new fz(t.e);d.a0&&(r=(e.n||(e.n=new FQ(e5S,e,1,7)),Pp(etj(e.n,0),137)).a)&&xM(xM((t.a+=' "',t),r),'"')),xM(yW(xM(yW(xM(yW(xM(yW((t.a+=" (",t),e.i),","),e.j)," | "),e.g),","),e.f),")"),t.a)}function eC6(e){var t,n,r;return(64&e.Db)!=0?eEp(e):(t=new O0(eZG),(n=e.k)?xM(xM((t.a+=' "',t),n),'"'):(e.n||(e.n=new FQ(e5S,e,1,7)),e.n.i>0&&(r=(e.n||(e.n=new FQ(e5S,e,1,7)),Pp(etj(e.n,0),137)).a)&&xM(xM((t.a+=' "',t),r),'"')),xM(yW(xM(yW(xM(yW(xM(yW((t.a+=" (",t),e.i),","),e.j)," | "),e.g),","),e.f),")"),t.a)}function eC5(e,t){var n,r,i,a,o,s,u;if(null==t||0==t.length)return null;if(!(i=Pp(zg(e.a,t),149))){for(r=(s=new fT(e.b).a.vc().Kc(),new fN(s));r.a.Ob();)if(o=(n=(a=Pp(r.a.Pb(),42),Pp(a.dd(),149))).c,u=t.length,IE(o.substr(o.length-u,u),t)&&(t.length==o.length||46==UI(o,o.length-t.length-1))){if(i)return null;i=n}i&&Ge(e.a,t,i)}return i}function eC8(e,t){var n,r,i,a;return(n=new eD,i=(r=Pp(qE(UQ(new R1(null,new Gq(e.f,16)),n),Qz(new q,new Z,new er,new ei,eow(vx(e2L,1),eU4,132,0,[(eum(),e2H),e2U]))),21)).gc(),a=(r=Pp(qE(UQ(new R1(null,new Gq(t.f,16)),n),Qz(new q,new Z,new er,new ei,eow(vx(e2L,1),eU4,132,0,[e2H,e2U]))),21)).gc(),ii.p?(ekv(a,tbj),a.d&&(s=a.o.b,t=a.a.b,a.a.b=s-t)):a.j==tbj&&i.p>e.p&&(ekv(a,tbw),a.d&&(s=a.o.b,t=a.a.b,a.a.b=-(s-t)));break}return i}function eIe(e,t,n,r){var i,a,o,s,u,c,l,f,d,h,p;if(a=n,n1)&&(r=new kl(i,n.b),P7(t.a,r)),enD(t.a,eow(vx(e60,1),eUP,8,0,[d,f]))}function eIy(e,t,n){var r,i,a,o,s,u;if(!t)return null;if(!(n<=-1))return ebY(Pp(ee2(e.Tg(),n),18));if(r=ee2(t.Tg(),-1-n),M4(r,99))return Pp(r,18);for(s=0,u=(o=Pp(t.ah(r),153)).gc();s0){for(i=u.length;i>0&&""==u[i-1];)--i;i=t.d.a.gc()){o=t.a.c,s=t.a.c+t.a.b,u=new kl(o+(s-o)/2,t.b),P7(Pp(t.d.a.ec().Kc().Pb(),17).a,u);continue}if((i=Pp(Bp(t.c,n),459)).b||i.c){eIv(e,n,t);continue}(a=e.d==(euy(),tsW)&&(i.d||i.e)&&exJ(e,t)&&1>=t.d.a.gc())?eFd(n,t):eL6(e,n,t)}t.k&&qX(t.d,new nn)}}function eIq(e,t,n,r,i,a){var o,s,u,c,l,f,d,h,p,b,m,g,v,y;for(s=(r+i)/2+(d=a),m=n*eB4.Math.cos(s),g=n*eB4.Math.sin(s),v=m-t.g/2,y=g-t.f/2,eno(t,v),ens(t,y),f=e.a.jg(t),(b=2*eB4.Math.acos(n/n+e.c))=40)&&eNo(e),eRi(e),eA3(e),n=elM(e),r=0;n&&r0&&P7(e.f,a)):(e.c[o]-=c+1,e.c[o]<=0&&e.a[o]>0&&P7(e.e,a))))}function eI1(e){var t,n,r,i,a,o,s,u,c;for(s=new yB(Pp(Y8(new eP),62)),c=eH1,n=new fz(e.d);n.a=0&&un?t:n;c<=f;++c)c==n?s=r++:(a=i[c],l=p.rl(a.ak()),c==t&&(u=c!=f||l?r:r-1),l&&++r);return d=Pp(elR(e,t,n),72),s!=u&&bz(e,new JU(e.e,7,o,ell(s),h.dd(),u)),d}return Pp(elR(e,t,n),72)}function eDe(e,t){var n,r,i,a,o,s,u;for(ewG(t,"Port order processing",1),u=Pp(e_k(e,(eBy(),tom)),421),r=new fz(e.b);r.a=0&&(!(s=egy(e,o))||(c<22?u.l|=1<>>1,o.m=l>>>1|(1&f)<<21,o.l=d>>>1|(1&l)<<21,--c;return n&&esh(u),a&&(r?(e0A=eoQ(e),i&&(e0A=eor(e0A,(Q2(),e0I)))):e0A=Mk(e.l,e.m,e.h)),u}function eDi(e,t){var n,r,i,a,o,s,u,c,l,f;for(c=e.e[t.c.p][t.p]+1,u=t.c.a.c.length+1,s=new fz(e.a);s.a0&&(GV(0,e.length),45==e.charCodeAt(0)||(GV(0,e.length),43==e.charCodeAt(0)))?1:0;rn)throw p7(new vo(eHJ+e+'"'));return s}function eDo(e){var t,n,r,i,a,o,s;for(o=new _n,a=new fz(e.a);a.a1)&&1==t&&Pp(e.a[e.b],10).k==(eEn(),e9I)?eD3(Pp(e.a[e.b],10),(egF(),tpV)):r&&(!n||(e.c-e.b&e.a.length-1)>1)&&1==t&&Pp(e.a[e.c-1&e.a.length-1],10).k==(eEn(),e9I)?eD3(Pp(e.a[e.c-1&e.a.length-1],10),(egF(),tpq)):(e.c-e.b&e.a.length-1)==2?(eD3(Pp(eso(e),10),(egF(),tpV)),eD3(Pp(eso(e),10),tpq)):eM9(e,i),qr(e)}function eDf(e,t,n){var r,i,a,o,s;for(a=0,i=new Ow((e.a||(e.a=new FQ(e5k,e,10,11)),e.a));i.e!=i.i.gc();)r=Pp(epH(i),33),o="",0==(r.n||(r.n=new FQ(e5S,r,1,7)),r.n).i||(o=Pp(etj((r.n||(r.n=new FQ(e5S,r,1,7)),r.n),0),137).a),eaW(s=new esH(a++,t,o),r),eo3(s,(eR5(),tcl),r),s.e.b=r.j+r.f/2,s.f.a=eB4.Math.max(r.g,1),s.e.a=r.i+r.g/2,s.f.b=eB4.Math.max(r.f,1),P7(t.b,s),eS8(n.f,r,s)}function eDd(e){var t,n,r,i,a;r=Pp(e_k(e,(eBU(),tnc)),33),a=Pp(eT9(r,(eBy(),ta4)),174).Hc((ed5(),tbq)),!e.e&&(i=Pp(e_k(e,tt3),21),t=new kl(e.f.a+e.d.b+e.d.c,e.f.b+e.d.d+e.d.a),i.Hc((eLR(),ttw))?(ebu(r,tol,(ewf(),tbo)),eYx(r,t.a,t.b,!1,!0)):gN(LK(eT9(r,ta6)))||eYx(r,t.a,t.b,!0,!0)),a?ebu(r,ta4,el8(tbq)):ebu(r,ta4,(n=Pp(yw(e5o),9),new I1(n,Pp(CY(n,n.length),9),0)))}function eDh(e,t,n){var r,i,a,o;if(t[0]>=e.length)return n.o=0,!0;switch(UI(e,t[0])){case 43:i=1;break;case 45:i=-1;break;default:return n.o=0,!0}if(++t[0],a=t[0],0==(o=exf(e,t))&&t[0]==a)return!1;if(t[0]=0&&s!=n&&(a=new FX(e,1,s,o,null),r?r.Ei(a):r=a),n>=0&&(a=new FX(e,1,n,s==n?o:null,t),r?r.Ei(a):r=a)),r}function eDv(e){var t,n,r;if(null==e.b){if(r=new vs,null!=e.i&&(xk(r,e.i),r.a+=":"),(256&e.f)!=0){for((256&e.f)!=0&&null!=e.a&&(Hb(e.i)||(r.a+="//"),xk(r,e.a)),null!=e.d&&(r.a+="/",xk(r,e.d)),(16&e.f)!=0&&(r.a+="/"),t=0,n=e.j.length;td)&&(f=(u=ePI(r,d,!1)).a,l+s+f<=t.b&&(JR(n,a-n.s),n.c=!0,JR(r,a-n.s),ebP(r,n.s,n.t+n.d+s),r.k=!0,eiV(n.q,r),h=!0,i&&(enN(t,r),r.j=t,e.c.length>o&&(eva((GK(o,e.c.length),Pp(e.c[o],200)),r),0==(GK(o,e.c.length),Pp(e.c[o],200)).a.c.length&&ZV(e,o)))),h)}function eDx(e,t){var n,r,i,a,o,s;if(ewG(t,"Partition midprocessing",1),i=new zu,_r(UJ(new R1(null,new Gq(e.a,16)),new nK),new dQ(i)),0!=i.d){for(r=(s=Pp(qE(GU((a=i.i,new R1(null,(a||(i.i=new OC(i,i.c))).Nc()))),JF(new U,new B,new en,eow(vx(e2L,1),eU4,132,0,[(eum(),e2U)]))),15)).Kc(),n=Pp(r.Pb(),19);r.Ob();)o=Pp(r.Pb(),19),eOR(Pp(Zq(i,n),21),Pp(Zq(i,o),21)),n=o;eEj(t)}}function eDT(e,t,n){var r,i,a,o,s,u,c,l;if(0==t.p){for(t.p=1,(o=n)||(i=new p0,a=(r=Pp(yw(e5a),9),new I1(r,Pp(CY(r,r.length),9),0)),o=new kD(i,a)),Pp(o.a,15).Fc(t),t.k==(eEn(),e9C)&&Pp(o.b,21).Fc(Pp(e_k(t,(eBU(),tt1)),61)),u=new fz(t.j);u.a0){if(i=Pp(e.Ab.g,1934),null==t){for(a=0;a1)for(r=new fz(i);r.an.s&&ss&&(s=i,f.c=Je(e1R,eUp,1,0,5,1)),i==s&&P_(f,new kD(n.c.i,n)));Hj(),Mv(f,e.c),jO(e.b,u.p,f)}}function eDR(e,t){var n,r,i,a,o,s,u,l,f;for(o=new fz(t.b);o.as&&(s=i,f.c=Je(e1R,eUp,1,0,5,1)),i==s&&P_(f,new kD(n.d.i,n)));Hj(),Mv(f,e.c),jO(e.f,u.p,f)}}function eDj(e){_Y(e,new ewB(vQ(vq(vJ(vX(new oc,eZn),"ELK Box"),"Algorithm for packing of unconnected boxes, i.e. graphs without edges."),new oA))),KE(e,eZn,ezW,td$),KE(e,eZn,eGi,15),KE(e,eZn,eGr,ell(0)),KE(e,eZn,eqC,epB(tdj)),KE(e,eZn,eGh,epB(tdY)),KE(e,eZn,eGd,epB(tdU)),KE(e,eZn,ezG,eZt),KE(e,eZn,eGu,epB(tdF)),KE(e,eZn,eGM,epB(tdB)),KE(e,eZn,eZr,epB(tdP)),KE(e,eZn,eVg,epB(tdR))}function eDF(e,t){var n,r,i,a,o,s,u,c,l;if(o=(i=e.i).o.a,a=i.o.b,o<=0&&a<=0)return eYu(),tbF;switch(c=e.n.a,l=e.n.b,s=e.o.a,n=e.o.b,t.g){case 2:case 1:if(c<0)return eYu(),tbY;if(c+s>o)return eYu(),tby;break;case 4:case 3:if(l<0)return eYu(),tbw;if(l+n>a)return eYu(),tbj}return(u=(c+s/2)/o)+(r=(l+n/2)/a)<=1&&u-r<=0?(eYu(),tbY):u+r>=1&&u-r>=0?(eYu(),tby):r<.5?(eYu(),tbw):(eYu(),tbj)}function eDY(e,t){var n,r,i,a,o,s,u,c,l,f,d,h,p,b;for(n=!1,l=gP(LV(e_k(t,(eBy(),toF)))),p=eHe*l,i=new fz(t.b);i.a(u=s.n.b-s.d.d+d.a)+p&&(b=f.g+d.g,d.a=(d.g*d.a+f.g*f.a)/b,d.g=b,f.f=d,n=!0)),a=s,f=d;return n}function eDB(e,t,n,r,i,a,o){var s,u,c,l,f,d;for(d=new TE,c=t.Kc();c.Ob();)for(s=Pp(c.Pb(),839),f=new fz(s.wf());f.a0?s.a?i>(c=s.b.rf().b)&&(e.v||1==s.c.d.c.length?(o=(i-c)/2,s.d.d=o,s.d.a=o):(r=((n=Pp(RJ(s.c.d,0),181).rf().b)-c)/2,s.d.d=eB4.Math.max(0,r),s.d.a=i-r-c)):s.d.a=e.t+i:FY(e.u)&&((a=ew1(s.b)).d<0&&(s.d.d=-a.d),a.d+a.a>s.b.rf().b&&(s.d.a=a.d+a.a-s.b.rf().b))}function eD$(e,t){var n;switch(eeg(e)){case 6:return xd(t);case 7:return xf(t);case 8:return xl(t);case 3:return Array.isArray(t)&&!((n=eeg(t))>=14&&n<=16);case 11:return null!=t&&typeof t===eUs;case 12:return null!=t&&(typeof t===eUr||typeof t==eUs);case 0:return ebs(t,e.__elementTypeId$);case 2:return YS(t)&&t.im!==O;case 1:return YS(t)&&t.im!==O||ebs(t,e.__elementTypeId$);default:return!0}}function eDz(e,t){var n,r,i,a;return(r=eB4.Math.min(eB4.Math.abs(e.c-(t.c+t.b)),eB4.Math.abs(e.c+e.b-t.c)),a=eB4.Math.min(eB4.Math.abs(e.d-(t.d+t.a)),eB4.Math.abs(e.d+e.a-t.d)),(n=eB4.Math.abs(e.c+e.b/2-(t.c+t.b/2)))>e.b/2+t.b/2||(i=eB4.Math.abs(e.d+e.a/2-(t.d+t.a/2)))>e.a/2+t.a/2)?1:0==n&&0==i?0:0==n?a/i+1:0==i?r/n+1:eB4.Math.min(r/n,a/i)+1}function eDG(e,t){var n,r,i,a,o,s;return(i=enR(e),s=enR(t),i!=s)?it.f?1:0:(r=e.e-t.e,(n=(e.d>0?e.d:eB4.Math.floor((e.a-1)*eH8)+1)-(t.d>0?t.d:eB4.Math.floor((t.a-1)*eH8)+1))>r+1)?i:n0&&(o=eeD(o,eN4(r))),ehI(a,o))}function eDW(e,t){var n,r,i,a,o,s,u;for(a=0,s=0,u=0,i=new fz(e.f.e);i.a0&&e.d!=(QJ(),e86)&&(s+=o*(r.d.a+e.a[t.b][r.b]*(t.d.a-r.d.a)/n)),n>0&&e.d!=(QJ(),e83)&&(u+=o*(r.d.b+e.a[t.b][r.b]*(t.d.b-r.d.b)/n)));switch(e.d.g){case 1:return new kl(s/a,t.d.b);case 2:return new kl(t.d.a,u/a);default:return new kl(s/a,u/a)}}function eDK(e,t){var n,r,i,a,o;if(euv(),o=Pp(e_k(e.i,(eBy(),tol)),98),0!=(a=e.j.g-t.j.g)||!(o==(ewf(),tba)||o==tbs||o==tbo))return 0;if(o==(ewf(),tba)&&(n=Pp(e_k(e,tof),19),r=Pp(e_k(t,tof),19),n&&r&&0!=(i=n.a-r.a)))return i;switch(e.j.g){case 1:return elN(e.n.a,t.n.a);case 2:return elN(e.n.b,t.n.b);case 3:return elN(t.n.a,e.n.a);case 4:return elN(t.n.b,e.n.b);default:throw p7(new gC(eGz))}}function eDV(e){var t,n,r,i,a,o;for(n=(e.a||(e.a=new O_(e5h,e,5)),e.a).i+2,o=new XM(n),P_(o,new kl(e.j,e.k)),_r(new R1(null,(e.a||(e.a=new O_(e5h,e,5)),new Gq(e.a,16))),new h5(o)),P_(o,new kl(e.b,e.c)),t=1;t0&&(eoY(u,!1,(ec3(),tpm)),eoY(u,!0,tpg)),ety(t.g,new E4(e,n)),Um(e.g,t,n)}function eDZ(){var e;for(e=2,eDZ=A,e0$=eow(vx(ty_,1),eHT,25,15,[-1,-1,30,19,15,13,11,11,10,9,9,8,8,8,8,7,7,7,7,7,7,7,6,6,6,6,6,6,6,6,6,6,6,6,6,6,5]),e0z=Je(ty_,eHT,25,37,15,1),e0G=eow(vx(ty_,1),eHT,25,15,[-1,-1,63,40,32,28,25,23,21,20,19,19,18,18,17,17,16,16,16,15,15,15,15,14,14,14,14,14,14,13,13,13,13,13,13,13,13]),e0W=Je(tyS,eH2,25,37,14,1);e<=36;e++)e0z[e]=zy(eB4.Math.pow(e,e0$[e])),e0W[e]=eyt(eUY,e0z[e])}function eDX(e){var t;if(1!=(e.a||(e.a=new FQ(e5v,e,6,6)),e.a).i)throw p7(new gL(eZC+(e.a||(e.a=new FQ(e5v,e,6,6)),e.a).i));return t=new mE,eoo(Pp(etj((e.b||(e.b=new Ih(e5m,e,4,7)),e.b),0),82))&&er7(t,eBE(e,eoo(Pp(etj((e.b||(e.b=new Ih(e5m,e,4,7)),e.b),0),82)),!1)),eoo(Pp(etj((e.c||(e.c=new Ih(e5m,e,5,8)),e.c),0),82))&&er7(t,eBE(e,eoo(Pp(etj((e.c||(e.c=new Ih(e5m,e,5,8)),e.c),0),82)),!0)),t}function eDJ(e,t){var n,r,i,a,o;for(i=t.d?e.a.c==(zs(),tuw)?efu(t.b):efc(t.b):e.a.c==(zs(),tuy)?efu(t.b):efc(t.b),a=!1,r=new Fa(OH(i.a.Kc(),new c));eTk(r);)if(n=Pp(ZC(r),17),!(!(o=gN(e.a.f[e.a.g[t.b.p].p]))&&!q9(n)&&n.c.i.c==n.d.i.c||gN(e.a.n[e.a.g[t.b.p].p])||gN(e.a.n[e.a.g[t.b.p].p]))&&(a=!0,w0(e.b,e.a.g[emN(n,t.b).p])))return t.c=!0,t.a=n,t;return t.c=a,t.a=null,t}function eDQ(e,t,n,r,i){var a,o,s,u,c,l,f;for(Hj(),Mv(e,new oU),s=new KB(e,0),f=new p0,a=0;s.b2*a?(l=new etD(f),c=jl(o)/jc(o),u=eY8(l,t,new mp,n,r,i,c),C6(xB(l.e),u),f.c=Je(e1R,eUp,1,0,5,1),a=0,f.c[f.c.length]=l,f.c[f.c.length]=o,a=jl(l)*jc(l)+jl(o)*jc(o)):(f.c[f.c.length]=o,a+=jl(o)*jc(o));return f}function eD1(e,t,n){var r,i,a,o,s,u,c;if(0==(r=n.gc()))return!1;if(e.ej()){if(u=e.fj(),edu(e,t,n),o=1==r?e.Zi(3,null,n.Kc().Pb(),t,u):e.Zi(5,null,n,t,u),e.bj()){for(s=r<100?null:new yf(r),a=t+r,i=t;i0){for(o=0;o>16==-15&&e.Cb.nh()&&QU(new JB(e.Cb,9,13,n,e.c,ebv(QX(Pp(e.Cb,59)),e))):M4(e.Cb,88)&&e.Db>>16==-23&&e.Cb.nh()&&(M4(t=e.c,88)||(t=(eBK(),tgI)),M4(n,88)||(n=(eBK(),tgI)),QU(new JB(e.Cb,9,10,n,t,ebv(qt(Pp(e.Cb,26)),e)))))),e.c}function eD5(e,t){var n,r,i,a,o,s,u,c,l,f;for(ewG(t,"Hypernodes processing",1),i=new fz(e.b);i.an)return i}function eNe(e,t){var n,r,i;r=0!=eMU(e.d,1),(gN(LK(e_k(t.j,(eBU(),tt2))))||gN(LK(e_k(t.j,tnS))))&&xc(e_k(t.j,(eBy(),ti8)))!==xc((esn(),tsM))?r=gN(LK(e_k(t.j,tt2))):t.c.Tf(t.e,r),eAb(e,t,r,!0),gN(LK(e_k(t.j,tnS)))&&eo3(t.j,tnS,(OQ(),!1)),gN(LK(e_k(t.j,tt2)))&&(eo3(t.j,tt2,(OQ(),!1)),eo3(t.j,tnS,!0)),n=eSY(e,t);do{if(er0(e),0==n)return 0;r=!r,i=n,eAb(e,t,r,!1),n=eSY(e,t)}while(i>n)return i}function eNt(e,t,n){var r,i,a,o,s,u,c,l,f,d,h,p;if(t==n)return!0;if(t=eTE(e,t),n=eTE(e,n),!(r=eb1(t)))return(s=t.e)==(h=n.e);if((l=eb1(n))!=r)return!!l&&(u=r.Dj())==(p=l.Dj())&&null!=u;if(a=(o=(t.d||(t.d=new O_(tgr,t,1)),t.d)).i,d=(n.d||(n.d=new O_(tgr,n,1)),n.d),a==d.i){for(c=0;c0,s=efC(t,a),n?Ag(s.b,t):Ag(s.g,t),1==efv(s).c.length&&qQ(r,s,r.c.b,r.c),i=new kD(a,t),Vw(e.o,i),QA(e.e.a,a))}function eNs(e,t){var n,r,i,a,o,s,u;return r=eB4.Math.abs(FB(e.b).a-FB(t.b).a),s=eB4.Math.abs(FB(e.b).b-FB(t.b).b),i=0,u=0,n=1,o=1,r>e.b.b/2+t.b.b/2&&(n=1-(i=eB4.Math.min(eB4.Math.abs(e.b.c-(t.b.c+t.b.b)),eB4.Math.abs(e.b.c+e.b.b-t.b.c)))/r),s>e.b.a/2+t.b.a/2&&(o=1-(u=eB4.Math.min(eB4.Math.abs(e.b.d-(t.b.d+t.b.a)),eB4.Math.abs(e.b.d+e.b.a-t.b.d)))/s),(1-(a=eB4.Math.min(n,o)))*eB4.Math.sqrt(r*r+s*s)}function eNu(e){var t,n,r,i;for(eFX(e,e.e,e.f,(zo(),tuq),!0,e.c,e.i),eFX(e,e.e,e.f,tuq,!1,e.c,e.i),eFX(e,e.e,e.f,tuZ,!0,e.c,e.i),eFX(e,e.e,e.f,tuZ,!1,e.c,e.i),eNd(e,e.c,e.e,e.f,e.i),r=new KB(e.i,0);r.b=65;n--)tvJ[n]=n-65<<24>>24;for(r=122;r>=97;r--)tvJ[r]=r-97+26<<24>>24;for(i=57;i>=48;i--)tvJ[i]=i-48+52<<24>>24;for(a=0,tvJ[43]=62,tvJ[47]=63;a<=25;a++)tvQ[a]=65+a&eHd;for(o=26,u=0;o<=51;++o,u++)tvQ[o]=97+u&eHd;for(e=52,s=0;e<=61;++e,s++)tvQ[e]=48+s&eHd;tvQ[62]=43,tvQ[63]=47}function eNf(e,t){var n,r,i,a,o,s,u,c,l,f,d,h;if(e.dc())return new yb;for(c=0,f=0,i=e.Kc();i.Ob();)a=(r=Pp(i.Pb(),37)).f,c=eB4.Math.max(c,a.a),f+=a.a*a.b;for(c=eB4.Math.max(c,eB4.Math.sqrt(f)*gP(LV(e_k(Pp(e.Kc().Pb(),37),(eBy(),tiX))))),d=0,h=0,u=0,n=t,s=e.Kc();s.Ob();)d+(l=(o=Pp(s.Pb(),37)).f).a>c&&(d=0,h+=u+t,u=0),eIn(o,d,h),n=eB4.Math.max(n,d+l.a),u=eB4.Math.max(u,l.b),d+=l.a+t;return new kl(n+t,h+u+t)}function eNd(e,t,n,r,i){var a,o,s,u,c,l,f;for(o=new fz(t);o.aa)return eYu(),tby;break;case 4:case 3:if(u<0)return eYu(),tbw;if(u+e.f>i)return eYu(),tbj}return(o=(s+e.g/2)/a)+(n=(u+e.f/2)/i)<=1&&o-n<=0?(eYu(),tbY):o+n>=1&&o-n>=0?(eYu(),tby):n<.5?(eYu(),tbw):(eYu(),tbj)}function eNp(e,t,n,r,i){var a,o;if(a=eft(WM(t[0],eH9),WM(r[0],eH9)),e[0]=jE(a),a=Fv(a,32),n>=i){for(o=1;o0&&(i.b[o++]=0,i.b[o++]=a.b[0]-1),t=1;t0&&(l0(u,u.d-i.d),i.c==(Xa(),tuU)&&lQ(u,u.a-i.d),u.d<=0&&u.i>0&&qQ(t,u,t.c.b,t.c));for(a=new fz(e.f);a.a0&&(l2(s,s.i-i.d),i.c==(Xa(),tuU)&&l1(s,s.b-i.d),s.i<=0&&s.d>0&&qQ(n,s,n.c.b,n.c))}function eNv(e,t,n){var r,i,a,o,s,u,c,l;for(ewG(n,"Processor compute fanout",1),Yy(e.b),Yy(e.a),s=null,a=epL(t.b,0);!s&&a.b!=a.d.c;)gN(LK(e_k(c=Pp(Vv(a),86),(eR5(),tcm))))&&(s=c);for(qQ(u=new _n,s,u.c.b,u.c),eYc(e,u),l=epL(t.b,0);l.b!=l.d.c;)o=Lq(e_k(c=Pp(Vv(l),86),(eR5(),tca))),eo3(c,tci,ell(i=null!=zg(e.b,o)?Pp(zg(e.b,o),19).a:0)),eo3(c,tcn,ell(r=1+(null!=zg(e.a,o)?Pp(zg(e.a,o),19).a:0)));eEj(n)}function eNy(e,t,n,r,i){var a,o,s,u,c,l,f,d,h,p;for(u=0,d=eyG(e,n);u0),r.a.Xb(r.c=--r.b),f>d+u&&BH(r);for(o=new fz(h);o.a0),r.a.Xb(r.c=--r.b)}}function eNw(){var e,t,n,r,i,a;if(eBG(),tyg)return tyg;for(e=(++tyv,new WZ(4)),ePR(e,eYB(e1_,!0)),ej0(e,eYB("M",!0)),ej0(e,eYB("C",!0)),a=(++tyv,new WZ(4)),r=0;r<11;r++)eLw(a,r,r);return t=(++tyv,new WZ(4)),ePR(t,eYB("M",!0)),eLw(t,4448,4607),eLw(t,65438,65439),i=(++tyv,new Mr(2)),eRv(i,e),eRv(i,tye),(n=(++tyv,new Mr(2))).$l(jS(a,eYB("L",!0))),n.$l(t),n=(++tyv,new qa(3,n)),tyg=n=(++tyv,new YD(i,n))}function eN_(e){var t,n;if(t=Lq(eT9(e,(eBB(),tdQ))),!eae(t,e)&&!X2(e,th5)&&(0!=(e.a||(e.a=new FQ(e5k,e,10,11)),e.a).i||gN(LK(eT9(e,thh))))){if(null==t||0==e_H(t).length){if(!eae(eG1,e))throw eFh(e,n=xM(xM(new O0("Unable to load default layout algorithm "),eG1)," for unconfigured node ")),p7(new gq(n.a))}else throw eFh(e,n=xM(xM(new O0("Layout algorithm '"),t),"' not found for ")),p7(new gq(n.a))}}function eNE(e){var t,n,r,i,a,o,s,u,c,l,f,d,h;if(n=e.i,t=e.n,0==e.b)for(h=n.c+t.b,d=n.b-t.b-t.c,o=e.a,u=0,l=o.length;u0&&(f-=r[0]+e.c,r[0]+=e.c),r[2]>0&&(f-=r[2]+e.c),r[1]=eB4.Math.max(r[1],f),jQ(e.a[1],n.c+t.b+r[0]-(r[1]-f)/2,r[1]);for(a=e.a,s=0,c=a.length;s0?(e.n.c.length-1)*e.i:0,r=new fz(e.n);r.a1)for(r=epL(i,0);r.b!=r.d.c;)for(n=Pp(Vv(r),231),a=0,u=new fz(n.e);u.a0&&(t[0]+=e.c,f-=t[0]),t[2]>0&&(f-=t[2]+e.c),t[1]=eB4.Math.max(t[1],f),j1(e.a[1],r.d+n.d+t[0]-(t[1]-f)/2,t[1]);else for(p=r.d+n.d,h=r.a-n.d-n.a,o=e.a,u=0,l=o.length;u=0&&a!=n)throw p7(new gL(eXB));for(u=0,i=0;u=efT(e.b.c,i.b.c+i.b.b)&&0>=efT(i.b.c,e.b.c+e.b.b)&&0>=efT(e.b.d,i.b.d+i.b.a)&&0>=efT(i.b.d,e.b.d+e.b.a)){if(0==efT(i.b.c,e.b.c+e.b.b)&&r.a<0||0==efT(i.b.c+i.b.b,e.b.c)&&r.a>0||0==efT(i.b.d,e.b.d+e.b.a)&&r.b<0||0==efT(i.b.d+i.b.a,e.b.d)&&r.b>0){s=0;break}}else s=eB4.Math.min(s,ekg(e,i,r));s=eB4.Math.min(s,eNC(e,a,s,r))}return s}function eNI(e,t){var n,r,i,a,o,s,u;if(e.b<2)throw p7(new gL("The vector chain must contain at least a source and a target point."));for(Tj(t,(i=(A5(0!=e.b),Pp(e.a.a.c,8))).a,i.b),u=new AF((t.a||(t.a=new O_(e5h,t,5)),t.a)),o=epL(e,1);o.agP(Ot(o.g,o.d[0]).a)?(A5(u.b>0),u.a.Xb(u.c=--u.b),CD(u,o),i=!0):s.e&&s.e.gc()>0&&(a=(s.e||(s.e=new p0),s.e).Mc(t),c=(s.e||(s.e=new p0),s.e).Mc(n),(a||c)&&((s.e||(s.e=new p0),s.e).Fc(o),++o.c));i||(r.c[r.c.length]=o)}function eNH(e){var t,n,r;if(TM(Pp(e_k(e,(eBy(),tol)),98)))for(n=new fz(e.j);n.a>>0).toString(16),n.length-2,n.length):e>=eH3?"\\v"+Az(n="0"+(t=e>>>0).toString(16),n.length-6,n.length):""+String.fromCharCode(e&eHd)}return r}function eNz(e,t){var n,r,i,a,o,s,u,c,l,f;if(o=e.e,0==(u=t.e))return e;if(0==o)return 0==t.e?t:new F7(-t.e,t.d,t.a);if((a=e.d)+(s=t.d)==2)return n=WM(e.a[0],eH9),r=WM(t.a[0],eH9),o<0&&(n=QC(n)),u<0&&(r=QC(r)),ep_(efe(n,r));if(-1==(i=a!=s?a>s?1:-1:es9(e.a,t.a,a)))f=-u,l=o==u?Z1(t.a,s,e.a,a):X7(t.a,s,e.a,a);else if(f=o,o==u){if(0==i)return eLQ(),e09;l=Z1(e.a,a,t.a,s)}else l=X7(e.a,a,t.a,s);return c=new F7(f,l.length,l),Ku(c),c}function eNG(e){var t,n,r,i,a,o;for(this.e=new p0,this.a=new p0,n=e.b-1;n<3;n++)Ls(e,0,Pp(ep3(e,0),8));if(e.b<4)throw p7(new gL("At (least dimension + 1) control points are necessary!"));for(this.b=3,this.d=!0,this.c=!1,eMO(this,e.b+this.b-1),o=new p0,a=new fz(this.e),t=0;t=t.o&&n.f<=t.f||.5*t.a<=n.f&&1.5*t.a>=n.f){if((o=Pp(RJ(t.n,t.n.c.length-1),211)).e+o.d+n.g+i<=r&&((a=Pp(RJ(t.n,t.n.c.length-1),211)).f-e.f+n.f<=e.b||1==e.a.c.length))return efg(t,n),!0;if(t.s+n.g<=r&&(t.t+t.d+n.f+i<=e.b||1==e.a.c.length))return P_(t.b,n),s=Pp(RJ(t.n,t.n.c.length-1),211),P_(t.n,new zO(t.s,s.f+s.a+t.i,t.i)),eml(Pp(RJ(t.n,t.n.c.length-1),211),n),eNk(t,n),!0}return!1}function eNV(e,t,n){var r,i,a,o;return e.ej()?(i=null,a=e.fj(),r=e.Zi(1,o=ees(e,t,n),n,t,a),e.bj()&&!(e.ni()&&null!=o?ecX(o,n):xc(o)===xc(n))?(null!=o&&(i=e.dj(o,i)),i=e.cj(n,i),e.ij()&&(i=e.lj(o,n,i)),i?(i.Ei(r),i.Fi()):e.$i(r)):(e.ij()&&(i=e.lj(o,n,i)),i?(i.Ei(r),i.Fi()):e.$i(r)),o):(o=ees(e,t,n),e.bj()&&!(e.ni()&&null!=o?ecX(o,n):xc(o)===xc(n))&&(i=null,null!=o&&(i=e.dj(o,null)),(i=e.cj(n,i))&&i.Fi()),o)}function eNq(e,t){var n,r,i,a,o,s,u,c;t%=24,e.q.getHours()!=t&&((r=new eB4.Date(e.q.getTime())).setDate(r.getDate()+1),(s=e.q.getTimezoneOffset()-r.getTimezoneOffset())>0&&(u=s/60|0,c=s%60,i=e.q.getDate(),(n=e.q.getHours())+u>=24&&++i,a=new eB4.Date(e.q.getFullYear(),e.q.getMonth(),i,t+u,e.q.getMinutes()+c,e.q.getSeconds(),e.q.getMilliseconds()),e.q.setTime(a.getTime()))),o=e.q.getTime(),e.q.setTime(o+36e5),e.q.getHours()!=t&&e.q.setTime(o)}function eNZ(e,t){var n,r,i,a,o;if(ewG(t,"Path-Like Graph Wrapping",1),0==e.b.c.length||(n=(o=(null==(i=new eTN(e)).i&&(i.i=eis(i,new iP)),gP(i.i)*i.f))/(null==i.i&&(i.i=eis(i,new iP)),gP(i.i)),i.b>n)){eEj(t);return}switch(Pp(e_k(e,(eBy(),toq)),337).g){case 2:a=new iF;break;case 0:a=new iO;break;default:a=new iY}if(r=a.Vf(e,i),!a.Wf())switch(Pp(e_k(e,to0),338).g){case 2:r=ekE(i,r);break;case 1:r=ewQ(i,r)}eRw(e,i,r),eEj(t)}function eNX(e,t){var n,r,i,a;if(GW(e.d,e.e),e.c.a.$b(),0!=gP(LV(e_k(t.j,(eBy(),ti3))))||0!=gP(LV(e_k(t.j,ti3))))for(n=ezq,xc(e_k(t.j,ti8))!==xc((esn(),tsM))&&eo3(t.j,(eBU(),tt2),(OQ(),!0)),a=Pp(e_k(t.j,to$),19).a,i=0;i(i=(GK(s+1,t.c.length),Pp(t.c[s+1],19)).a-r)&&++c,P_(o,(GK(s+c,t.c.length),Pp(t.c[s+c],19))),u+=(GK(s+c,t.c.length),Pp(t.c[s+c],19)).a-r,++n;n1&&(u>jl(s)*jc(s)/2||0==o.b)&&(f=new etD(d),l=jl(s)/jc(s),c=eY8(f,t,new mp,n,r,i,l),C6(xB(f.e),c),s=f,h.c[h.c.length]=f,u=0,d.c=Je(e1R,eUp,1,0,5,1)));return eoc(h,d),h}function eN2(e,t,n,r){var i,a,o,s,u,c,l,f,d,h,p,b;if(n.mh(t)&&(l=(h=t)?Pp(r,49).xh(h):null)){if(b=n.bh(t,e.a),(p=t.t)>1||-1==p){if(f=Pp(b,69),d=Pp(l,69),f.dc())d.$b();else for(o=!!ebY(t),a=0,s=e.a?f.Kc():f.Zh();s.Ob();)c=Pp(s.Pb(),56),(i=Pp(eef(e,c),56))?(o?-1==(u=d.Xc(i))?d.Xh(a,i):a!=u&&d.ji(a,i):d.Xh(a,i),++a):e.b&&!o&&(d.Xh(a,c),++a)}else null==b?l.Wb(null):null==(i=eef(e,b))?e.b&&!ebY(t)&&l.Wb(b):l.Wb(i)}}function eN3(e,t){var n,r,i,a,o,s,u,l;for(n=new nf,i=new Fa(OH(efu(t).a.Kc(),new c));eTk(i);)if(r=Pp(ZC(i),17),!q9(r)&&ewg(s=r.c.i,e9q)){if(-1==(l=eCu(e,s,e9q,e9V)))continue;n.b=eB4.Math.max(n.b,l),n.a||(n.a=new p0),P_(n.a,s)}for(o=new Fa(OH(efc(t).a.Kc(),new c));eTk(o);)if(a=Pp(ZC(o),17),!q9(a)&&ewg(u=a.d.i,e9V)){if(-1==(l=eCu(e,u,e9V,e9q)))continue;n.d=eB4.Math.max(n.d,l),n.c||(n.c=new p0),P_(n.c,u)}return n}function eN4(e){var t,n,r,i;if(exX(),t=zy(e),e1e6)throw p7(new g_("power of ten too big"));if(e<=eUu)return ZA(exT(e2t[1],t),t);for(i=r=exT(e2t[1],eUu),n=eap(e-eUu),t=zy(e%eUu);ecd(n,eUu)>0;)i=eeD(i,r),n=efe(n,eUu);for(i=eeD(i,exT(e2t[1],t)),i=ZA(i,eUu),n=eap(e-eUu);ecd(n,eUu)>0;)i=ZA(i,eUu),n=efe(n,eUu);return ZA(i,t)}function eN6(e,t){var n,r,i,a,o,s,u,c,l;for(ewG(t,"Hierarchical port dummy size processing",1),u=new p0,l=new p0,n=2*(r=gP(LV(e_k(e,(eBy(),toA))))),a=new fz(e.b);a.ac&&r>c)l=s,c=gP(t.p[s.p])+gP(t.d[s.p])+s.o.b+s.d.a;else{i=!1,n.n&&P3(n,"bk node placement breaks on "+s+" which should have been after "+l);break}if(!i)break}return n.n&&P3(n,t+" is feasible: "+i),i}function ePr(e,t,n,r){var i,a,o,s,u,c,l;for(s=-1,l=new fz(e);l.a=m&&e.e[u.p]>p*e.b||y>=n*m)&&(d.c[d.c.length]=s,s=new p0,er7(o,a),a.a.$b(),c-=l,h=eB4.Math.max(h,c*e.b+b),c+=y,v=y,y=0,l=0,b=0);return new kD(h,d)}function ePs(e){var t,n,r,i,a,o,s,u,c,l,f,d,h;for(n=(c=new fT(e.c.b).a.vc().Kc(),new fN(c));n.a.Ob();)null==(i=(t=(s=Pp(n.a.Pb(),42),Pp(s.dd(),149))).a)&&(i=""),(r=L9(e.c,i))||0!=i.length||(r=ecj(e)),r&&!eds(r.c,t,!1)&&P7(r.c,t);for(o=epL(e.a,0);o.b!=o.d.c;)a=Pp(Vv(o),478),l=Zc(e.c,a.a),h=Zc(e.c,a.b),l&&h&&P7(l.c,new kD(h,a.c));for(HC(e.a),d=epL(e.b,0);d.b!=d.d.c;)f=Pp(Vv(d),478),t=L8(e.c,f.a),u=Zc(e.c,f.b),t&&u&&_U(t,u,f.c);HC(e.b)}function ePu(e,t,n){var r,i,a,o,s,u,c,l,f,d,h;a=new lD(e),o=new eg5,i=(Ze(o.g),Ze(o.j),Yy(o.b),Ze(o.d),Ze(o.i),Yy(o.k),Yy(o.c),Yy(o.e),h=ekH(o,a,null),eMA(o,a),h),t&&(s=ePA(c=new lD(t)),eEh(i,eow(vx(e6q,1),eUp,527,0,[s]))),d=!1,f=!1,n&&(eXW in(c=new lD(n)).a&&(d=zR(c,eXW).ge().a),eXK in c.a&&(f=zR(c,eXK).ge().a)),l=yr(eny(new mV,d),f),eER(new or,i,l),eXW in a.a&&ee3(a,eXW,null),(d||f)&&(eNj(l,u=new gu,d,f),ee3(a,eXW,u)),r=new pp(o),esA(new TY(i),r)}function ePc(e,t,n){var r,i,a,o,s,u,c,l,f;for(u=0,o=new evI,c=eow(vx(ty_,1),eHT,25,15,[0]),i=-1,a=0,r=0;u0){if(i<0&&l.a&&(i=u,a=c[0],r=0),i>=0){if(s=l.b,u==i&&0==(s-=r++))return 0;if(!eYw(t,c,l,s,o)){u=i-1,c[0]=a;continue}}else if(i=-1,!eYw(t,c,l,0,o))return 0}else{if(i=-1,32==UI(l.c,0)){if(f=c[0],eey(t,c),c[0]>f)continue}else if($D(t,l.c,c[0])){c[0]+=l.c.length;continue}return 0}return eYn(o,n)?c[0]:0}function ePl(e){var t,n,r,i,a,o,s,u;if(!e.f){if(u=new su,s=new su,null==(o=(t=tgz).a.zc(e,t))){for(a=new Ow($E(e));a.e!=a.i.gc();)i=Pp(epH(a),26),Y4(u,ePl(i));t.a.Bc(e),t.a.gc()}for(r=(e.s||(e.s=new FQ(tm5,e,21,17)),new Ow(e.s));r.e!=r.i.gc();)n=Pp(epH(r),170),M4(n,99)&&JL(s,Pp(n,18));euI(s),e.r=new PX(e,(Pp(etj(H8((BM(),tgv).o),6),18),s.i),s.g),Y4(u,e.r),euI(u),e.f=new xQ((Pp(etj(H8(tgv.o),5),18),u.i),u.g),Zd(e).b&=-3}return e.f}function ePf(e){var t,n,r,i,a,o,s,u,c,l,f,d,h,p;for(c=0,r=Je(ty_,eHT,25,o=e.o,15,1),i=Je(ty_,eHT,25,o,15,1),t=Je(ty_,eHT,25,n=e.p,15,1),a=Je(ty_,eHT,25,n,15,1);c=0&&!emy(e,l,f);)--f;i[l]=f}for(h=0;h=0&&!emy(e,s,p);)--s;a[p]=s}for(u=0;ut[d]&&dr[u]&&eCQ(e,u,d,!1,!0)}function ePd(e){var t,n,r,i,a,o,s,u;n=gN(LK(e_k(e,(eCk(),e8b)))),a=e.a.c.d,s=e.a.d.d,n?(o=Ol(C5(new kl(s.a,s.b),a),.5),u=Ol(MB(e.e),.5),t=C5(C6(new kl(a.a,a.b),o),u),Lf(e.d,t)):(i=gP(LV(e_k(e.a,e8I))),r=e.d,a.a>=s.a?a.b>=s.b?(r.a=s.a+(a.a-s.a)/2+i,r.b=s.b+(a.b-s.b)/2-i-e.e.b):(r.a=s.a+(a.a-s.a)/2+i,r.b=a.b+(s.b-a.b)/2+i):a.b>=s.b?(r.a=a.a+(s.a-a.a)/2+i,r.b=s.b+(a.b-s.b)/2+i):(r.a=a.a+(s.a-a.a)/2+i,r.b=a.b+(s.b-a.b)/2-i-e.e.b))}function ePh(e,t){var n,r,i,a,o,s,u;if(null==e)return null;if(0==(a=e.length))return"";for(u=Je(tyw,eHl,25,a,15,1),Ji(0,a,e.length),Ji(0,a,u.length),YF(e,0,a,u,0),n=null,s=t,i=0,o=0;i0?Az(n.a,0,a-1):"":e.substr(0,a-1):n?n.a:e}function ePp(e){_Y(e,new ewB(vQ(vq(vJ(vX(new oc,ezH),"ELK DisCo"),"Layouter for arranging unconnected subgraphs. The subgraphs themselves are, by default, not laid out."),new e4))),KE(e,ezH,ez$,epB(e57)),KE(e,ezH,ezz,epB(e53)),KE(e,ezH,ezG,epB(e5J)),KE(e,ezH,ezW,epB(e54)),KE(e,ezH,e$Q,epB(e58)),KE(e,ezH,e$1,epB(e55)),KE(e,ezH,e$J,epB(e59)),KE(e,ezH,e$0,epB(e56)),KE(e,ezH,ezj,epB(e51)),KE(e,ezH,ezF,epB(e5Q)),KE(e,ezH,ezY,epB(e50)),KE(e,ezH,ezB,epB(e52))}function ePb(e,t,n,r){var i,a,o,s,u,c,l,f,d;if(a=new eb$(e),lK(a,(eEn(),e9P)),eo3(a,(eBy(),tol),(ewf(),tbo)),i=0,t){for(o=new eES,eo3(o,(eBU(),tnc),t),eo3(a,tnc,t.i),ekv(o,(eYu(),tbY)),Gc(o,a),d=Kp(t.e),l=0,f=(c=d).length;lenR(e)?1:0,n=e.e,i=(r.length,eB4.Math.abs(zy(e.e)),new vl),1==t&&(i.a+="-"),e.e>0){if((n-=r.length-t)>=0){for(i.a+="0.";n>e0Z.length;n-=e0Z.length)RX(i,e0Z);CA(i,e0Z,zy(n)),xM(i,r.substr(t))}else n=t-n,xM(i,Az(r,t,zy(n))),i.a+=".",xM(i,xy(r,zy(n)))}else{for(xM(i,r.substr(t));n<-e0Z.length;n+=e0Z.length)RX(i,e0Z);CA(i,e0Z,zy(-n))}return i.a}function ePv(e,t,n,r){var i,a,o,s,u,c,l,f,d;return(c=(u=C5(new kl(n.a,n.b),e)).a*t.b-u.b*t.a,l=t.a*r.b-t.b*r.a,f=(u.a*r.b-u.b*r.a)/l,d=c/l,0!=l)?f>=0&&f<=1&&d>=0&&d<=1?C6(new kl(e.a,e.b),Ol(new kl(t.a,t.b),f)):null:0!=c?null:(a=Jh(e,i=C6(new kl(n.a,n.b),Ol(new kl(r.a,r.b),.5))),o=Jh(C6(new kl(e.a,e.b),t),i),s=.5*eB4.Math.sqrt(r.a*r.a+r.b*r.b),at.a&&(r.Hc((eyY(),tdW))?e.c.a+=(n.a-t.a)/2:r.Hc(tdV)&&(e.c.a+=n.a-t.a)),n.b>t.b&&(r.Hc((eyY(),tdZ))?e.c.b+=(n.b-t.b)/2:r.Hc(tdq)&&(e.c.b+=n.b-t.b)),Pp(e_k(e,(eBU(),tt3)),21).Hc((eLR(),ttw))&&(n.a>t.a||n.b>t.b))for(s=new fz(e.a);s.at.a&&(r.Hc((eyY(),tdW))?e.c.a+=(n.a-t.a)/2:r.Hc(tdV)&&(e.c.a+=n.a-t.a)),n.b>t.b&&(r.Hc((eyY(),tdZ))?e.c.b+=(n.b-t.b)/2:r.Hc(tdq)&&(e.c.b+=n.b-t.b)),Pp(e_k(e,(eBU(),tt3)),21).Hc((eLR(),ttw))&&(n.a>t.a||n.b>t.b))for(o=new fz(e.a);o.at&&(i=0,a+=l.b+n,f.c[f.c.length]=l,l=new W5(a,n),r=new es$(0,l.f,l,n),enN(l,r),i=0),0==r.b.c.length||u.f>=r.o&&u.f<=r.f||.5*r.a<=u.f&&1.5*r.a>=u.f?efg(r,u):(o=new es$(r.s+r.r+n,l.f,l,n),enN(l,o),efg(o,u)),i=u.i+u.g;return f.c[f.c.length]=l,f}function ePk(e){var t,n,r,i,a,o,s,u;if(!e.a){if(e.o=null,u=new pj(e),t=new sc,null==(s=(n=tgz).a.zc(e,n))){for(o=new Ow($E(e));o.e!=o.i.gc();)a=Pp(epH(o),26),Y4(u,ePk(a));n.a.Bc(e),n.a.gc()}for(i=(e.s||(e.s=new FQ(tm5,e,21,17)),new Ow(e.s));i.e!=i.i.gc();)r=Pp(epH(i),170),M4(r,322)&&JL(t,Pp(r,34));euI(t),e.k=new PZ(e,(Pp(etj(H8((BM(),tgv).o),7),18),t.i),t.g),Y4(u,e.k),euI(u),e.a=new xQ((Pp(etj(H8(tgv.o),4),18),u.i),u.g),Zd(e).b&=-2}return e.a}function ePx(e,t,n,r,i,a,o){var s,u,c,l,f,d;return f=!1,u=eO4(n.q,t.f+t.b-n.q.f),!((d=i-(n.q.e+u-o))=(GK(a,e.c.length),Pp(e.c[a],200)).e,(!((l=(s=ePI(r,d,!1)).a)>t.b)||!!c)&&((c||l<=t.b)&&(c&&l>t.b?(n.d=l,JR(n,eEP(n,l))):(eyC(n.q,u),n.c=!0),JR(r,i-(n.s+n.r)),ebP(r,n.q.e+n.q.d,t.f),enN(t,r),e.c.length>a&&(eva((GK(a,e.c.length),Pp(e.c[a],200)),r),0==(GK(a,e.c.length),Pp(e.c[a],200)).a.c.length&&ZV(e,a)),f=!0),f))}function ePT(e,t,n,r){var i,a,o,s,u,c,l;if(l=eAY(e.e.Tg(),t),i=0,a=Pp(e.g,119),u=null,_4(),Pp(t,66).Oj()){for(s=0;se.o.a&&(l=(u-e.o.a)/2,s.b=eB4.Math.max(s.b,l),s.c=eB4.Math.max(s.c,l))}}function ePA(e){var t,n,r,i,a,o,s,u;for(a=new W9,Tp(a,(eoM(),tdr)),r=(i=erG(e,Je(e17,eUP,2,0,6,1)),new fE(new g$(new wY(e,i).b)));r.b0?e.i:0)>t&&u>0&&(a=0,o+=u+e.i,i=eB4.Math.max(i,d),r+=u+e.i,u=0,d=0,n&&(++f,P_(e.n,new zO(e.s,o,e.i))),s=0),d+=c.g+(s>0?e.i:0),u=eB4.Math.max(u,c.f),n&&eml(Pp(RJ(e.n,f),211),c),a+=c.g+(s>0?e.i:0),++s;return i=eB4.Math.max(i,d),r+=u,n&&(e.r=i,e.d=r,egf(e.j)),new Hr(e.s,e.t,i,r)}function ePD(e,t,n,r,i){var a,o,s,u,c,l,f,d,h;if(wK(),Yh(e,"src"),Yh(n,"dest"),d=esF(e),u=esF(n),Pz((4&d.i)!=0,"srcType is not an array"),Pz((4&u.i)!=0,"destType is not an array"),f=d.c,o=u.c,Pz((1&f.i)!=0?f==o:(1&o.i)==0,"Array types don't match"),h=e.length,c=n.length,t<0||r<0||i<0||t+i>h||r+i>c)throw p7(new bE);if((1&f.i)==0&&d!=u){if(l=etG(e),a=etG(n),xc(e)===xc(n)&&tr;)Bc(a,s,l[--t]);else for(s=r+i;r0&&ekp(e,t,n,r,i,!0)}function ePN(){ePN=A,e07=eow(vx(ty_,1),eHT,25,15,[eHt,1162261467,eU2,1220703125,362797056,1977326743,eU2,387420489,eHK,214358881,429981696,815730721,1475789056,170859375,268435456,410338673,612220032,893871739,128e7,1801088541,113379904,148035889,191102976,244140625,308915776,387420489,481890304,594823321,729e6,887503681,eU2,1291467969,1544804416,1838265625,60466176]),e2e=eow(vx(ty_,1),eHT,25,15,[-1,-1,31,19,15,13,11,11,10,9,9,8,8,8,8,7,7,7,7,7,7,7,6,6,6,6,6,6,6,6,6,6,6,6,6,6,5])}function ePP(e){var t,n,r,i,a,o,s,u;for(i=new fz(e.b);i.a=e.b.length?(a[i++]=o.b[r++],a[i++]=o.b[r++]):r>=o.b.length?(a[i++]=e.b[n++],a[i++]=e.b[n++]):o.b[r]0?e.i:0)),++t;for(efX(e.n,u),e.d=n,e.r=r,e.g=0,e.f=0,e.e=0,e.o=eHQ,e.p=eHQ,a=new fz(e.b);a.a0&&(i=(e.n||(e.n=new FQ(e5S,e,1,7)),Pp(etj(e.n,0),137)).a)&&xM(xM((t.a+=' "',t),i),'"')),(n=(e.b||(e.b=new Ih(e5m,e,4,7)),!(e.b.i<=1&&(e.c||(e.c=new Ih(e5m,e,5,8)),e.c.i<=1))))?(t.a+=" [",t):(t.a+=" ",t),xM(t,OU(new ve,new Ow(e.b))),n&&(t.a+="]"),t.a+=eGH,n&&(t.a+="["),xM(t,OU(new ve,new Ow(e.c))),n&&(t.a+="]"),t.a)}function ePB(e,t){var n,r,i,a,o,s,u;if(e.a){if(s=e.a.ne(),u=null,null!=s?t.a+=""+s:null!=(o=e.a.Dj())&&(-1!=(a=x7(o,e_n(91)))?(u=o.substr(a),t.a+=""+Az(null==o?eUg:(BJ(o),o),0,a)):t.a+=""+o),e.d&&0!=e.d.i){for(i=!0,t.a+="<",r=new Ow(e.d);r.e!=r.i.gc();)n=Pp(epH(r),87),i?i=!1:(t.a+=eUd,t),ePB(n,t);t.a+=">"}null!=u&&(t.a+=""+u)}else e.e?null!=(s=e.e.zb)&&(t.a+=""+s):(t.a+="?",e.b?(t.a+=" super ",ePB(e.b,t)):e.f&&(t.a+=" extends ",ePB(e.f,t)))}function ePU(e,t){var n,r,i,a,o,s,u,c,l,f,d,h,p,b,m,g,v,y,w,_,E,S,k,x,T;for(_=e.c,E=t.c,n=QI(_.a,e,0),r=QI(E.a,t,0),y=Pp(edE(e,(enY(),tsD)).Kc().Pb(),11),x=Pp(edE(e,tsN).Kc().Pb(),11),w=Pp(edE(t,tsD).Kc().Pb(),11),T=Pp(edE(t,tsN).Kc().Pb(),11),g=Kp(y.e),S=Kp(x.g),v=Kp(w.e),k=Kp(T.g),egU(e,r,E),l=0,p=(o=v).length;ll?new GT((Xa(),tuH),n,t,c-l):c>0&&l>0&&(new GT((Xa(),tuH),t,n,0),new GT(tuH,n,t,0))),o)}function ePz(e,t){var n,r,i,a,o,s;for(o=new esz(new fS(e.f.b).a);o.b;){if(a=etz(o),i=Pp(a.cd(),594),1==t){if(i.gf()!=(ec3(),tpy)&&i.gf()!=tpb)continue}else if(i.gf()!=(ec3(),tpm)&&i.gf()!=tpg)continue;switch(r=Pp(Pp(a.dd(),46).b,81),n=(s=Pp(Pp(a.dd(),46).a,189)).c,i.gf().g){case 2:r.g.c=e.e.a,r.g.b=eB4.Math.max(1,r.g.b+n);break;case 1:r.g.c=r.g.c+n,r.g.b=eB4.Math.max(1,r.g.b-n);break;case 4:r.g.d=e.e.b,r.g.a=eB4.Math.max(1,r.g.a+n);break;case 3:r.g.d=r.g.d+n,r.g.a=eB4.Math.max(1,r.g.a-n)}}}function ePG(e,t){var n,r,i,a,o,s,u,c,l,f,d,h,p,b;for(s=Je(ty_,eHT,25,t.b.c.length,15,1),c=Je(e4P,eU4,267,t.b.c.length,0,1),u=Je(e4N,eGW,10,t.b.c.length,0,1),f=e.a,d=0,h=f.length;d0&&u[r]&&(p=Mj(e.b,u[r],i)),b=eB4.Math.max(b,i.c.c.b+p);for(a=new fz(l.e);a.a1)throw p7(new gL(eQ$));u||(a=V4(t,r.Kc().Pb()),o.Fc(a))}return eo0(e,eSu(e,t,n),o)}function ePZ(e,t){var n,r,i,a;for(etY(t.b.j),_r(UQ(new R1(null,new Gq(t.d,16)),new iy),new iw),a=new fz(t.d);a.ae.o.b||(n=efr(e,tby),(s=t.d+t.a+(n.gc()-1)*o)>e.o.b)))}function eP6(e,t){var n,r,i,a,o,s,u,c,l,f,d,h,p;if(o=e.e,u=t.e,0==o)return t;if(0==u)return e;if((a=e.d)+(s=t.d)==2)return(n=WM(e.a[0],eH9),r=WM(t.a[0],eH9),o==u)?(p=jE(l=eft(n,r)),0==(h=jE(Fy(l,32)))?new XE(o,p):new F7(o,2,eow(vx(ty_,1),eHT,25,15,[p,h]))):ep_(o<0?efe(r,n):efe(n,r));if(o==u)d=o,f=a>=s?X7(e.a,a,t.a,s):X7(t.a,s,e.a,a);else{if(0==(i=a!=s?a>s?1:-1:es9(e.a,t.a,a)))return eLQ(),e09;1==i?(d=o,f=Z1(e.a,a,t.a,s)):(d=u,f=Z1(t.a,s,e.a,a))}return c=new F7(d,f.length,f),Ku(c),c}function eP5(e,t,n,r,i,a,o){var s,u,c,l,f,d,h;return f=gN(LK(e_k(t,(eBy(),taV)))),d=null,a==(enY(),tsD)&&r.c.i==n?d=r.c:a==tsN&&r.d.i==n&&(d=r.d),(c=o)&&f&&!d?(P_(c.e,r),h=eB4.Math.max(gP(LV(e_k(c.d,tak))),gP(LV(e_k(r,tak)))),eo3(c.d,tak,h)):(l=(eYu(),tbF),d?l=d.j:TM(Pp(e_k(n,tol),98))&&(l=a==tsD?tbY:tby),u=eP9(e,t,n,a,l,r),s=ZD((Bq(n),r)),a==tsD?(Gs(s,Pp(RJ(u.j,0),11)),Go(s,i)):(Gs(s,i),Go(s,Pp(RJ(u.j,0),11))),c=new ec9(r,s,u,Pp(e_k(u,(eBU(),tnc)),11),a,!d)),exg(e.a,r,new DT(c.d,t,a)),c}function eP8(e,t){var n,r,i,a,o,s,u,c,l,f;if(l=null,e.d&&(l=Pp(zg(e.d,t),138)),!l){if(f=(a=e.a.Mh()).i,!e.d||wq(e.d)!=f){for(u=new p2,e.d&&eij(u,e.d),s=c=u.f.c+u.g.c;s0?(h=(p-1)*n,s&&(h+=r),l&&(h+=r),!(h=e.b[i+1])i+=2;else if(n0)for(r=new I4(Pp(Zq(e.a,a),21)),Hj(),Mv(r,new dT(t)),i=new KB(a.b,0);i.b_)?(u=2,o=eUu):0==u?(u=1,o=S):(u=0,o=S):(h=S>=o||o-S0?1:Te(isNaN(r),isNaN(0)))>=0^(enj(eVU),(eB4.Math.abs(s)<=eVU||0==s||isNaN(s)&&isNaN(0)?0:s<0?-1:s>0?1:Te(isNaN(s),isNaN(0)))>=0))?eB4.Math.max(s,r):(enj(eVU),(eB4.Math.abs(r)<=eVU||0==r||isNaN(r)&&isNaN(0)?0:r<0?-1:r>0?1:Te(isNaN(r),isNaN(0)))>0)?eB4.Math.sqrt(s*s+r*r):-eB4.Math.sqrt(s*s+r*r)}function eRv(e,t){var n,r,i,a,o,s;if(t){if(e.a||(e.a=new bZ),2==e.e){bY(e.a,t);return}if(1==t.e){for(i=0;i=eH3?xk(n,el1(r)):Bf(n,r&eHd),o=(++tyv,new zc(10,null,0)),Yu(e.a,o,s-1)):xk(n=(o.bm().length,new vu),o.bm()),0==t.e?(r=t._l())>=eH3?xk(n,el1(r)):Bf(n,r&eHd):xk(n,t.bm()),Pp(o,521).b=n.a}}function eRy(e){var t,n,r,i,a;return null!=e.g?e.g:e.a<32?(e.g=eYS(eap(e.f),zy(e.e)),e.g):(i=eBw((e.c||(e.c=euK(e.f)),e.c),0),0==e.e)?i:(t=(e.c||(e.c=euK(e.f)),e.c).e<0?2:1,n=i.length,r=-e.e+n-t,a=new vc,a.a+=""+i,e.e>0&&r>=-6?r>=0?Gn(a,n-zy(e.e),"."):(a.a=Az(a.a,0,t-1)+"0."+xy(a.a,t-1),Gn(a,t+1,ehv(e0Z,0,-zy(r)-1))):(n-t>=1&&(Gn(a,t,"."),++n),Gn(a,n,"E"),r>0&&Gn(a,++n,"+"),Gn(a,++n,""+Fb(eap(r)))),e.g=a.a,e.g)}function eRw(e,t,n){var r,i,a,o,s,u,c,l,f,d,h,p,b,m;if(!n.dc()){for(s=0,d=0,p=Pp((r=n.Kc()).Pb(),19).a;s1&&(u=c.mg(u,e.a,s));return 1==u.c.length?Pp(RJ(u,u.c.length-1),220):2==u.c.length?eRr((GK(0,u.c.length),Pp(u.c[0],220)),(GK(1,u.c.length),Pp(u.c[1],220)),o,a):null}function eRk(e){var t,n,r,i,a,o;for(ety(e.a,new eJ),n=new fz(e.a);n.a=eB4.Math.abs(r.b)?(r.b=0,a.d+a.a>o.d&&a.do.c&&a.c0){if(t=new xt(e.i,e.g),a=(n=e.i)<100?null:new yf(n),e.ij())for(r=0;r0){for(s=e.g,c=e.i,ZG(e),a=c<100?null:new yf(c),r=0;r>13|(15&e.m)<<9,i=e.m>>4&8191,a=e.m>>17|(255&e.h)<<5,o=(1048320&e.h)>>8,s=8191&t.l,u=t.l>>13|(15&t.m)<<9,c=t.m>>4&8191,l=t.m>>17|(255&t.h)<<5,f=(1048320&t.h)>>8,k=n*s,x=r*s,T=i*s,M=a*s,O=o*s,0!=u&&(x+=n*u,T+=r*u,M+=i*u,O+=a*u),0!=c&&(T+=n*c,M+=r*c,O+=i*c),0!=l&&(M+=n*l,O+=r*l),0!=f&&(O+=n*f),d=(h=k&eHH)+(p=(511&x)<<13),m=k>>22,g=x>>9,b=m+g+(v=(262143&T)<<4)+(y=(31&M)<<17),_=T>>18,w=_+(E=M>>5)+(S=(4095&O)<<8),b+=d>>22,d&=eHH,w+=b>>22,Mk(d,b&=eHH,w&=eH$)}function eRA(e){var t,n,r,i,a,o,s;if(0!=(s=Pp(RJ(e.j,0),11)).g.c.length&&0!=s.e.c.length)throw p7(new gC("Interactive layout does not support NORTH/SOUTH ports with incoming _and_ outgoing edges."));if(0!=s.g.c.length){for(a=eHQ,n=new fz(s.g);n.a4){if(!e.wj(t))return!1;if(e.rk()){if(u=(r=(i=Pp(t,49)).Ug())==e.e&&(e.Dk()?i.Og(i.Vg(),e.zk())==e.Ak():-1-i.Vg()==e.aj()),e.Ek()&&!u&&!r&&i.Zg()){for(a=0;a0&&(c=e.n.a/a);break;case 2:case 4:(i=e.i.o.b)>0&&(c=e.n.b/i)}eo3(e,(eBU(),tnv),c)}if(u=e.o,o=e.a,r)o.a=r.a,o.b=r.b,e.d=!0;else if(t!=tbc&&t!=tbl&&s!=tbF)switch(s.g){case 1:o.a=u.a/2;break;case 2:o.a=u.a,o.b=u.b/2;break;case 3:o.a=u.a/2,o.b=u.b;break;case 4:o.b=u.b/2}else o.a=u.a/2,o.b=u.b/2}function eRP(e){var t,n,r,i,a,o,s,u,c,l;if(e.ej()){if(l=e.Vi(),u=e.fj(),l>0){if(t=new eiP(e.Gi()),a=(n=l)<100?null:new yf(n),Cf(e,n,t.g),i=1==n?e.Zi(4,etj(t,0),null,0,u):e.Zi(6,t,null,-1,u),e.bj()){for(r=new Ow(t);r.e!=r.i.gc();)a=e.dj(epH(r),a);a?(a.Ei(i),a.Fi()):e.$i(i)}else a?(a.Ei(i),a.Fi()):e.$i(i)}else Cf(e,e.Vi(),e.Wi()),e.$i(e.Zi(6,(Hj(),e2r),null,-1,u))}else if(e.bj()){if((l=e.Vi())>0){for(s=e.Wi(),c=l,Cf(e,l,s),a=c<100?null:new yf(c),r=0;re.d[o.p]&&(n+=qq(e.b,a)*Pp(u.b,19).a,Vw(e.a,ell(a)));for(;!gY(e.a);)eek(e.b,Pp(Yn(e.a),19).a)}return n}function eRF(e,t,n,r){var i,a,o,s,u,c,l,f,d,h,p,b,m;for((f=new TS(Pp(eT9(e,(e_C(),tdB)),8))).a=eB4.Math.max(f.a-n.b-n.c,0),f.b=eB4.Math.max(f.b-n.d-n.a,0),(null==(i=LV(eT9(e,tdN)))||(BJ(i),i<=0))&&(i=1.3),s=new p0,p=new Ow((e.a||(e.a=new FQ(e5k,e,10,11)),e.a));p.e!=p.i.gc();)h=Pp(epH(p),33),o=new Lp(h),s.c[s.c.length]=o;switch((d=Pp(eT9(e,tdP),311)).g){case 3:m=eDQ(s,t,f.a,f.b,(c=r,BJ(i),c));break;case 1:m=eN0(s,t,f.a,f.b,(l=r,BJ(i),l));break;default:m=eRH(s,t,f.a,f.b,(u=r,BJ(i),u))}a=new etD(m),b=eY8(a,t,n,f.a,f.b,r,(BJ(i),i)),eYx(e,b.a,b.b,!1,!0)}function eRY(e,t){var n,r,i,a;n=t.b,a=new I4(n.j),i=0,(r=n.j).c=Je(e1R,eUp,1,0,5,1),Y$(Pp(eay(e.b,(eYu(),tbw),(erX(),tep)),15),n),i=emQ(a,i,new r3,r),Y$(Pp(eay(e.b,tbw,teh),15),n),i=emQ(a,i,new r2,r),Y$(Pp(eay(e.b,tbw,ted),15),n),Y$(Pp(eay(e.b,tby,tep),15),n),Y$(Pp(eay(e.b,tby,teh),15),n),i=emQ(a,i,new r4,r),Y$(Pp(eay(e.b,tby,ted),15),n),Y$(Pp(eay(e.b,tbj,tep),15),n),i=emQ(a,i,new r6,r),Y$(Pp(eay(e.b,tbj,teh),15),n),i=emQ(a,i,new r5,r),Y$(Pp(eay(e.b,tbj,ted),15),n),Y$(Pp(eay(e.b,tbY,tep),15),n),i=emQ(a,i,new ic,r),Y$(Pp(eay(e.b,tbY,teh),15),n),Y$(Pp(eay(e.b,tbY,ted),15),n)}function eRB(e,t){var n,r,i,a,o,s,u,c,l,f,d,h,p,b;for(ewG(t,"Layer size calculation",1),l=eHQ,c=eH1,i=!1,s=new fz(e.b);s.a.5?g-=2*o*(p-.5):p<.5&&(g+=2*a*(.5-p)),g<(i=s.d.b)&&(g=i),b=s.d.c,g>m.a-b-l&&(g=m.a-b-l),s.n.a=t+g}}function eRH(e,t,n,r,i){var a,o,s,u,c,l,f,d,h,p,b,m;for(s=Je(tyx,eH6,25,e.c.length,15,1),d=new Fz(new oB),egV(d,e),c=0,b=new p0;0!=d.b.c.length;)if(o=Pp(0==d.b.c.length?null:RJ(d.b,0),157),c>1&&jl(o)*jc(o)/2>s[0]){for(a=0;as[a];)++a;p=new Gz(b,0,a+1),f=new etD(p),l=jl(o)/jc(o),u=eY8(f,t,new mp,n,r,i,l),C6(xB(f.e),u),Ja(e_s(d,f)),egV(d,h=new Gz(b,a+1,b.c.length)),b.c=Je(e1R,eUp,1,0,5,1),c=0,jA(s,s.length,0)}else null!=(m=0==d.b.c.length?null:RJ(d.b,0))&&erD(d,0),c>0&&(s[c]=s[c-1]),s[c]+=jl(o)*jc(o),++c,b.c[b.c.length]=o;return b}function eR$(e){var t,n,r,i,a;if((r=Pp(e_k(e,(eBy(),taY)),163))==(ef_(),tnN)){for(n=new Fa(OH(efu(e).a.Kc(),new c));eTk(n);)if(t=Pp(ZC(n),17),!ZI(t))throw p7(new gq(eWr+egs(e)+"' has its layer constraint set to FIRST_SEPARATE, but has at least one incoming edge. FIRST_SEPARATE nodes must not have incoming edges."))}else if(r==tnR){for(a=new Fa(OH(efc(e).a.Kc(),new c));eTk(a);)if(i=Pp(ZC(a),17),!ZI(i))throw p7(new gq(eWr+egs(e)+"' has its layer constraint set to LAST_SEPARATE, but has at least one outgoing edge. LAST_SEPARATE nodes must not have outgoing edges."))}}function eRz(e,t){var n,r,i,a,o,s,u,c,l,f,d,h,p;for(ewG(t,"Label dummy removal",1),r=gP(LV(e_k(e,(eBy(),toL)))),i=gP(LV(e_k(e,toN))),c=Pp(e_k(e,tal),103),u=new fz(e.b);u.a0&&eE8(e,s,f);for(i=new fz(f);i.a>19!=0&&(t=eoQ(t),u=!u),o=eOy(t),a=!1,i=!1,r=!1,e.h==eHz&&0==e.m&&0==e.l){if(i=!0,a=!0,-1!=o)return s=eTC(e,o),u&&esh(s),n&&(e0A=Mk(0,0,0)),s;e=Tr((Q2(),e0L)),r=!0,u=!u}else e.h>>19!=0&&(a=!0,e=eoQ(e),r=!0,u=!u);return -1!=o?esk(e,o,u,a,n):0>evy(e,t)?(n&&(e0A=a?eoQ(e):Mk(e.l,e.m,e.h)),Mk(0,0,0)):eDr(r?e:Mk(e.l,e.m,e.h),t,u,a,i,n)}function eRq(e,t){var n,r,i,a,o,s,u,c,l,f,d,h,p;if(e.e&&e.c.ct.f)&&!(t.g>e.f)){for(n=0,r=0,o=e.w.a.ec().Kc();o.Ob();)i=Pp(o.Pb(),11),euz(esp(eow(vx(e60,1),eUP,8,0,[i.i.n,i.n,i.a])).b,t.g,t.f)&&++n;for(s=e.r.a.ec().Kc();s.Ob();)i=Pp(s.Pb(),11),euz(esp(eow(vx(e60,1),eUP,8,0,[i.i.n,i.n,i.a])).b,t.g,t.f)&&--n;for(u=t.w.a.ec().Kc();u.Ob();)i=Pp(u.Pb(),11),euz(esp(eow(vx(e60,1),eUP,8,0,[i.i.n,i.n,i.a])).b,e.g,e.f)&&++r;for(a=t.r.a.ec().Kc();a.Ob();)i=Pp(a.Pb(),11),euz(esp(eow(vx(e60,1),eUP,8,0,[i.i.n,i.n,i.a])).b,e.g,e.f)&&--r;n=0)return i=efd(e,t.substr(1,o-1)),eYF(e,l=t.substr(o+1,u-(o+1)),i)}else{if(n=-1,null==e0F&&(e0F=RegExp("\\d")),e0F.test(String.fromCharCode(s))&&(n=IO(t,e_n(46),u-1))>=0){r=Pp(ZN(e,etm(e,t.substr(1,n-1)),!1),58),c=0;try{c=eDa(t.substr(n+1),eHt,eUu)}catch(d){if(d=eoa(d),M4(d,127))throw a=d,p7(new QH(a));throw p7(d)}if(c=0)return n;switch(Ur(QZ(e,n))){case 2:if(IE("",ecG(e,n.Hj()).ne())){if(u=U$(QZ(e,n)),s=UH(QZ(e,n)),l=eMv(e,t,u,s))return l;for(o=0,f=(i=eIx(e,t)).gc();o1)throw p7(new gL(eQ$));for(o=0,l=eAY(e.e.Tg(),t),r=Pp(e.g,119);o1,c=new Z4(d.b);My(c.a)||My(c.b);)f=(u=Pp(My(c.a)?Wx(c.a):Wx(c.b),17)).c==d?u.d:u.c,eB4.Math.abs(esp(eow(vx(e60,1),eUP,8,0,[f.i.n,f.n,f.a])).b-o.b)>1&&eAZ(e,u,o,a,d)}}function eR9(e){var t,n,r,i,a,o;if(i=new KB(e.e,0),r=new KB(e.a,0),e.d)for(n=0;neVW;){for(a=t,o=0;eB4.Math.abs(t-a)0),i.a.Xb(i.c=--i.b),eNy(e,e.b-o,a,r,i),A5(i.b0),r.a.Xb(r.c=--r.b)}if(!e.d)for(n=0;n0?(e.f[l.p]=h/(l.e.c.length+l.g.c.length),e.c=eB4.Math.min(e.c,e.f[l.p]),e.b=eB4.Math.max(e.b,e.f[l.p])):s&&(e.f[l.p]=h)}}function ejt(e){e.b=null,e.bb=null,e.fb=null,e.qb=null,e.a=null,e.c=null,e.d=null,e.e=null,e.f=null,e.n=null,e.M=null,e.L=null,e.Q=null,e.R=null,e.K=null,e.db=null,e.eb=null,e.g=null,e.i=null,e.j=null,e.k=null,e.gb=null,e.o=null,e.p=null,e.q=null,e.r=null,e.$=null,e.ib=null,e.S=null,e.T=null,e.t=null,e.s=null,e.u=null,e.v=null,e.w=null,e.B=null,e.A=null,e.C=null,e.D=null,e.F=null,e.G=null,e.H=null,e.I=null,e.J=null,e.P=null,e.Z=null,e.U=null,e.V=null,e.W=null,e.X=null,e.Y=null,e._=null,e.ab=null,e.cb=null,e.hb=null,e.nb=null,e.lb=null,e.mb=null,e.ob=null,e.pb=null,e.jb=null,e.kb=null,e.N=!1,e.O=!1}function ejn(e,t,n){var r,i,a,o;for(ewG(n,"Graph transformation ("+e.a+")",1),o=WC(t.a),a=new fz(t.b);a.a0&&(e.a=u+(p-1)*a,t.c.b+=e.a,t.f.b+=e.a),0!=b.a.gc()&&(p=ejF(h=new YJ(1,a),t,b,m,t.f.b+u-t.c.b))>0&&(t.f.b+=u+(p-1)*a)}function eji(e,t){var n,r,i,a;a=e.F,null==t?(e.F=null,euc(e,null)):(e.F=(BJ(t),t),-1!=(r=x7(t,e_n(60)))?(i=t.substr(0,r),-1!=x7(t,e_n(46))||IE(i,eUi)||IE(i,eJZ)||IE(i,eJX)||IE(i,eJJ)||IE(i,eJQ)||IE(i,eJ1)||IE(i,eJ0)||IE(i,eJ2)||(i=eJ3),-1!=(n=O9(t,e_n(62)))&&(i+=""+t.substr(n+1)),euc(e,i)):(i=t,-1==x7(t,e_n(46))&&(-1!=(r=x7(t,e_n(91)))&&(i=t.substr(0,r)),IE(i,eUi)||IE(i,eJZ)||IE(i,eJX)||IE(i,eJJ)||IE(i,eJQ)||IE(i,eJ1)||IE(i,eJ0)||IE(i,eJ2)?i=t:(i=eJ3,-1!=r&&(i+=""+t.substr(r)))),euc(e,i),i==t&&(e.F=e.D))),(4&e.Db)!=0&&(1&e.Db)==0&&eam(e,new FX(e,1,5,a,t))}function eja(e,t){var n,r,i,a,o,s,u,c,l,f,d,h,p,b,m,g,v,y;if(!((b=t.b.c.length)<3)){for(h=Je(ty_,eHT,25,b,15,1),f=0,l=new fz(t.b);l.ao)&&Yf(e.b,Pp(m.b,17));++s}a=o}}}function ejo(e,t){var n;if(null==t||IE(t,eUg)||0==t.length&&e.k!=(eSd(),tdy))return null;switch(e.k.g){case 1:return ehZ(t,eq5)?(OQ(),e0P):ehZ(t,eq8)?(OQ(),e0N):null;case 2:try{return ell(eDa(t,eHt,eUu))}catch(r){if(r=eoa(r),M4(r,127))return null;throw p7(r)}case 4:try{return eEu(t)}catch(i){if(i=eoa(i),M4(i,127))return null;throw p7(i)}case 3:return t;case 5:return euC(e),exs(e,t);case 6:return euC(e),eMj(e,e.a,t);case 7:try{return(n=eTh(e)).Jf(t),n}catch(a){if(a=eoa(a),M4(a,32))return null;throw p7(a)}default:throw p7(new gC("Invalid type set for this layout option."))}}function ejs(e){var t,n,r,i,a,o,s;for(eeP(),s=new b5,n=new fz(e);n.a=s.b.c)&&(s.b=t),(!s.c||t.c<=s.c.c)&&(s.d=s.c,s.c=t),(!s.e||t.d>=s.e.d)&&(s.e=t),(!s.f||t.d<=s.f.d)&&(s.f=t);return r=new epG((eok(),e9f)),Kv(e,e9y,new g$(eow(vx(e4M,1),eUp,369,0,[r]))),o=new epG(e9p),Kv(e,e9v,new g$(eow(vx(e4M,1),eUp,369,0,[o]))),i=new epG(e9d),Kv(e,e9g,new g$(eow(vx(e4M,1),eUp,369,0,[i]))),a=new epG(e9h),Kv(e,e9m,new g$(eow(vx(e4M,1),eUp,369,0,[a]))),eOk(r.c,e9f),eOk(i.c,e9d),eOk(a.c,e9h),eOk(o.c,e9p),s.a.c=Je(e1R,eUp,1,0,5,1),eoc(s.a,r.c),eoc(s.a,eaa(i.c)),eoc(s.a,a.c),eoc(s.a,eaa(o.c)),s}function eju(e){var t;switch(e.d){case 1:if(e.hj())return -2!=e.o;break;case 2:if(e.hj())return -2==e.o;break;case 3:case 5:case 4:case 6:case 7:return e.o>-2;default:return!1}switch(t=e.gj(),e.p){case 0:return null!=t&&gN(LK(t))!=xg(e.k,0);case 1:return null!=t&&Pp(t,217).a!=jE(e.k)<<24>>24;case 2:return null!=t&&Pp(t,172).a!=(jE(e.k)&eHd);case 6:return null!=t&&xg(Pp(t,162).a,e.k);case 5:return null!=t&&Pp(t,19).a!=jE(e.k);case 7:return null!=t&&Pp(t,184).a!=jE(e.k)<<16>>16;case 3:return null!=t&&gP(LV(t))!=e.j;case 4:return null!=t&&Pp(t,155).a!=e.j;default:return null==t?null!=e.n:!ecX(t,e.n)}}function ejc(e,t,n){var r,i,a,o;return e.Fk()&&e.Ek()&&(o=FU(e,Pp(n,56)),xc(o)!==xc(n))?(e.Oi(t),e.Ui(t,J5(e,t,o)),e.rk()&&(a=(i=Pp(n,49),e.Dk()?e.Bk()?i.ih(e.b,ebY(Pp(ee2($S(e.b),e.aj()),18)).n,Pp(ee2($S(e.b),e.aj()).Yj(),26).Bj(),null):i.ih(e.b,edv(i.Tg(),ebY(Pp(ee2($S(e.b),e.aj()),18))),null,null):i.ih(e.b,-1-e.aj(),null,null)),Pp(o,49).eh()||(a=(r=Pp(o,49),e.Dk()?e.Bk()?r.gh(e.b,ebY(Pp(ee2($S(e.b),e.aj()),18)).n,Pp(ee2($S(e.b),e.aj()).Yj(),26).Bj(),a):r.gh(e.b,edv(r.Tg(),ebY(Pp(ee2($S(e.b),e.aj()),18))),null,a):r.gh(e.b,-1-e.aj(),null,a))),a&&a.Fi()),TO(e.b)&&e.$i(e.Zi(9,n,o,t,!1)),o):n}function ejl(e,t,n){var r,i,a,o,s,u,c,l,f,d,h,p,b,m,g,v,y,w;for(l=gP(LV(e_k(e,(eBy(),toC)))),r=gP(LV(e_k(e,toG))),eo3(d=new oG,toC,l+r),g=(c=t).d,b=c.c.i,v=c.d.i,m=Tl(b.c),y=Tl(v.c),i=new p0,f=m;f<=y;f++)s=new eb$(e),lK(s,(eEn(),e9D)),eo3(s,(eBU(),tnc),c),eo3(s,tol,(ewf(),tbo)),eo3(s,toD,d),h=Pp(RJ(e.b,f),29),f==m?egU(s,h.a.c.length-n,h):Gu(s,h),(w=gP(LV(e_k(c,tak))))<0&&eo3(c,tak,w=0),s.o.b=w,p=eB4.Math.floor(w/2),o=new eES,ekv(o,(eYu(),tbY)),Gc(o,s),o.n.b=p,u=new eES,ekv(u,tby),Gc(u,s),u.n.b=p,Go(c,o),a=new $b,eaW(a,c),eo3(a,taR,null),Gs(a,u),Go(a,g),evT(s,c,a),i.c[i.c.length]=a,c=a;return i}function ejf(e,t){var n,r,i,a,o,s,u,c,l,f,d,h,p,b,m,g,v,y;for(u=Pp(eEC(e,(eYu(),tbY)).Kc().Pb(),11).e,h=Pp(eEC(e,tby).Kc().Pb(),11).g,s=u.c.length,y=GX(Pp(RJ(e.j,0),11));s-- >0;){for(b=(GK(0,u.c.length),Pp(u.c[0],17)),a=QI(v=(i=(GK(0,h.c.length),Pp(h.c[0],17))).d.e,i,0),KW(b,i.d,a),Gs(i,null),Go(i,null),p=b.a,t&&P7(p,new TS(y)),r=epL(i.a,0);r.b!=r.d.c;)n=Pp(Vv(r),8),P7(p,new TS(n));for(g=b.b,d=new fz(i.b);d.a0&&(o=eB4.Math.max(o,eix(e.C.b+r.d.b,i))),l=r,f=i,d=a;e.C&&e.C.c>0&&(h=d+e.C.c,c&&(h+=l.d.c),o=eB4.Math.max(o,(Mc(),enj(ezs),eB4.Math.abs(f-1)<=ezs||1==f||isNaN(f)&&isNaN(1)?0:h/(1-f)))),n.n.b=0,n.a.a=o}function ejh(e,t){var n,r,i,a,o,s,u,c,l,f,d,h;if(n=Pp(UA(e.b,t),124),(u=Pp(Pp(Zq(e.r,t),21),84)).dc()){n.n.d=0,n.n.a=0;return}for(c=e.u.Hc((ekU(),tbp)),o=0,e.A.Hc((ed5(),tbq))&&eCN(e,t),s=u.Kc(),l=null,d=0,f=0;s.Ob();)a=gP(LV((r=Pp(s.Pb(),111)).b.We((Ab(),e4a)))),i=r.b.rf().b,l?(h=f+l.d.a+e.w+r.d.d,o=eB4.Math.max(o,(Mc(),enj(ezs),eB4.Math.abs(d-a)<=ezs||d==a||isNaN(d)&&isNaN(a)?0:h/(a-d)))):e.C&&e.C.d>0&&(o=eB4.Math.max(o,eix(e.C.d+r.d.d,a))),l=r,d=a,f=i;e.C&&e.C.a>0&&(h=f+e.C.a,c&&(h+=l.d.a),o=eB4.Math.max(o,(Mc(),enj(ezs),eB4.Math.abs(d-1)<=ezs||1==d||isNaN(d)&&isNaN(1)?0:h/(1-d)))),n.n.d=0,n.a.b=o}function ejp(e,t,n){var r,i,a,o,s,u;for(o=0,this.g=e,s=t.d.length,u=n.d.length,this.d=Je(e4N,eGW,10,s+u,0,1);o0?etU(this,this.f/this.a):null!=Ot(t.g,t.d[0]).a&&null!=Ot(n.g,n.d[0]).a?etU(this,(gP(Ot(t.g,t.d[0]).a)+gP(Ot(n.g,n.d[0]).a))/2):null!=Ot(t.g,t.d[0]).a?etU(this,Ot(t.g,t.d[0]).a):null!=Ot(n.g,n.d[0]).a&&etU(this,Ot(n.g,n.d[0]).a)}function ejb(e,t){var n,r,i,a,o,s,u,c,l,f;for(e.a=new Bv(eiG(e66)),r=new fz(t.a);r.a=1&&(m-o>0&&f>=0?(u.n.a+=b,u.n.b+=a*o):m-o<0&&l>=0&&(u.n.a+=b*m,u.n.b+=a));e.o.a=t.a,e.o.b=t.b,eo3(e,(eBy(),ta4),(ed5(),r=Pp(yw(e5o),9),new I1(r,Pp(CY(r,r.length),9),0)))}function ej_(e,t,n,r,i,a){var o;if(!(null==t||!efz(t,tmJ,tmQ)))throw p7(new gL("invalid scheme: "+t));if(!e&&!(null!=n&&-1==x7(n,e_n(35))&&n.length>0&&(GV(0,n.length),47!=n.charCodeAt(0))))throw p7(new gL("invalid opaquePart: "+n));if(e&&!(null!=t&&wZ(tm$,t.toLowerCase()))&&!(null==n||!efz(n,tm1,tm0))||e&&null!=t&&wZ(tm$,t.toLowerCase())&&!eyQ(n))throw p7(new gL(eJI+n));if(!ef$(r))throw p7(new gL("invalid device: "+r));if(!ece(i))throw o=null==i?"invalid segments: null":"invalid segment: "+euR(i),p7(new gL(o));if(!(null==a||-1==x7(a,e_n(35))))throw p7(new gL("invalid query: "+a))}function ejE(e,t){var n,r,i,a,o,s,u,c,l,f,d,h,p,b,m,g;for(ewG(t,"Calculate Graph Size",1),t.n&&e&&WG(t,KS(e),(eup(),tmr)),s=ezq,u=ezq,a=eqe,o=eqe,f=new Ow((e.a||(e.a=new FQ(e5k,e,10,11)),e.a));f.e!=f.i.gc();)p=(c=Pp(epH(f),33)).i,b=c.j,g=c.g,r=c.f,i=Pp(eT9(c,(eBB(),thy)),142),s=eB4.Math.min(s,p-i.b),u=eB4.Math.min(u,b-i.d),a=eB4.Math.max(a,p+g+i.c),o=eB4.Math.max(o,b+r+i.a);for(h=Pp(eT9(e,(eBB(),thN)),116),d=new kl(s-h.b,u-h.d),l=new Ow((e.a||(e.a=new FQ(e5k,e,10,11)),e.a));l.e!=l.i.gc();)c=Pp(epH(l),33),eno(c,c.i-d.a),ens(c,c.j-d.b);m=a-s+(h.b+h.c),n=o-u+(h.d+h.a),ena(e,m),eni(e,n),t.n&&e&&WG(t,KS(e),(eup(),tmr))}function ejS(e){var t,n,r,i,a,o,s,u,c,l;for(r=new p0,o=new fz(e.e.a);o.a0){epV(e,n,0),n.a+=String.fromCharCode(r),epV(e,n,i=ehR(t,a)),a+=i-1;continue}39==r?a+11)for(b=Je(ty_,eHT,25,e.b.b.c.length,15,1),f=0,c=new fz(e.b.b);c.a=s&&i<=u)s<=i&&a<=u?(n[l++]=i,n[l++]=a,r+=2):s<=i?(n[l++]=i,n[l++]=u,e.b[r]=u+1,o+=2):a<=u?(n[l++]=s,n[l++]=a,r+=2):(n[l++]=s,n[l++]=u,e.b[r]=u+1);else if(ueHe)&&s<10)vR(e.c,new tf),ejM(e),Ym(e.c),ejv(e.f)}function ejL(e,t,n){var r,i,a,o,s,u,c,l,f,d,h,p,b,m;if(gN(LK(e_k(n,(eBy(),taI)))))for(s=new fz(n.j);s.a=2){for(o=Pp(Vv(u=epL(n,0)),8),s=Pp(Vv(u),8);s.a0&&eoY(l,!0,(ec3(),tpg)),s.k==(eEn(),e9C)&&UP(l),Um(e.f,s,t)}}function ejN(e,t,n){var r,i,a,o,s,u,c,l,f,d;switch(ewG(n,"Node promotion heuristic",1),e.g=t,eYs(e),e.q=Pp(e_k(t,(eBy(),taz)),260),l=Pp(e_k(e.g,ta$),19).a,a=new nH,e.q.g){case 2:case 1:default:eRn(e,a);break;case 3:for(e.q=(eOJ(),tsk),eRn(e,a),u=0,s=new fz(e.a);s.ae.j&&(e.q=tsv,eRn(e,a));break;case 4:for(e.q=(eOJ(),tsk),eRn(e,a),c=0,i=new fz(e.b);i.ae.k&&(e.q=ts_,eRn(e,a));break;case 6:d=zy(eB4.Math.ceil(e.f.length*l/100)),eRn(e,new dq(d));break;case 5:f=zy(eB4.Math.ceil(e.d*l/100)),eRn(e,new dZ(f))}eLC(e,t),eEj(n)}function ejP(e,t,n){var r,i,a,o;this.j=e,this.e=ewi(e),this.o=this.j.e,this.i=!!this.o,this.p=this.i?Pp(RJ(n,Bq(this.o).p),214):null,i=Pp(e_k(e,(eBU(),tt3)),21),this.g=i.Hc((eLR(),ttw)),this.b=new p0,this.d=new ed0(this.e),o=Pp(e_k(this.j,tnw),230),this.q=eaG(t,o,this.e),this.k=new zX(this),a=ZW(eow(vx(e4H,1),eUp,225,0,[this,this.d,this.k,this.q])),t!=(enU(),tur)||gN(LK(e_k(e,(eBy(),ti7))))?t==tur&&gN(LK(e_k(e,(eBy(),ti7))))?(r=new ews(this.e),a.c[a.c.length]=r,this.c=new erB(r,o,Pp(this.q,402))):this.c=new Sr(t,this):(r=new ews(this.e),a.c[a.c.length]=r,this.c=new K6(r,o,Pp(this.q,402))),P_(a,this.c),eP0(a,this.e),this.s=eY0(this.k)}function ejR(e,t){var n,r,i,a,o,s,u,c,l,f,d,h,p,b,m,g,v,y,w;for(p=(f=Pp(M2((o=epL(new hz(t).a.d,0),new hG(o))),86))?Pp(e_k(f,(eR5(),tco)),86):null,i=1;f&&p;){for(s=0,u=0,w=0,n=f,r=p;s=e.i?(++e.i,P_(e.a,ell(1)),P_(e.b,f)):(r=e.c[t.p][1],q1(e.a,l,ell(Pp(RJ(e.a,l),19).a+1-r)),q1(e.b,l,gP(LV(RJ(e.b,l)))+f-r*e.e)),(e.q==(eOJ(),tsv)&&(Pp(RJ(e.a,l),19).a>e.j||Pp(RJ(e.a,l-1),19).a>e.j)||e.q==ts_&&(gP(LV(RJ(e.b,l)))>e.k||gP(LV(RJ(e.b,l-1)))>e.k))&&(u=!1),o=new Fa(OH(efu(t).a.Kc(),new c));eTk(o);)s=(a=Pp(ZC(o),17)).c.i,e.f[s.p]==l&&(d=ejj(e,s),i+=Pp(d.a,19).a,u=u&&gN(LK(d.b)));return e.f[t.p]=l,i+=e.c[t.p][0],new kD(ell(i),(OQ(),!!u))}function ejF(e,t,n,r,i){var a,o,s,u,c,l,f,d,h,p,b,m,g;for(f=new p2,o=new p0,ekD(e,n,e.d.fg(),o,f),ekD(e,r,e.d.gg(),o,f),e.b=.2*(b=eTZ(eeh(new R1(null,new Gq(o,16)),new aL)),m=eTZ(eeh(new R1(null,new Gq(o,16)),new aC)),eB4.Math.min(b,m)),a=0,s=0;s=2&&(g=eOY(o,!0,d),e.e||(e.e=new h$(e)),ehB(e.e,g,o,e.b)),ewv(o,d),eFn(o),h=-1,l=new fz(o);l.as)}function ejU(e,t){var n,r,i,a,o,s,u,c,l,f,d,h,p,b;for(n=Pp(e_k(e,(eBy(),tol)),98),o=e.f,a=e.d,s=o.a+a.b+a.c,u=0-a.d-e.c.b,l=o.b+a.d+a.a-e.c.b,c=new p0,f=new p0,i=new fz(t);i.a0),Pp(l.a.Xb(l.c=--l.b),17));a!=r&&l.b>0;)e.a[a.p]=!0,e.a[r.p]=!0,a=(A5(l.b>0),Pp(l.a.Xb(l.c=--l.b),17));l.b>0&&BH(l)}}function ejZ(e,t,n){var r,i,a,o,s,u,c,l,f;if(e.a!=t.Aj())throw p7(new gL(eZ6+t.ne()+eZ5));if(r=ecG((eSp(),tvc),t).$k())return r.Aj().Nh().Ih(r,n);if(o=ecG(tvc,t).al()){if(null==n)return null;if((s=Pp(n,15)).dc())return"";for(f=new vs,a=s.Kc();a.Ob();)i=a.Pb(),xk(f,o.Aj().Nh().Ih(o,i)),f.a+=" ";return x3(f,f.a.length-1)}if(!(l=ecG(tvc,t).bl()).dc()){for(c=l.Kc();c.Ob();)if((u=Pp(c.Pb(),148)).wj(n))try{if(f=u.Aj().Nh().Ih(u,n),null!=f)return f}catch(d){if(d=eoa(d),!M4(d,102))throw p7(d)}throw p7(new gL("Invalid value: '"+n+"' for datatype :"+t.ne()))}return Pp(t,834).Fj(),null==n?null:M4(n,172)?""+Pp(n,172).a:esF(n)==e1Q?MU(tmS[0],Pp(n,199)):efF(n)}function ejX(e){var t,n,r,i,a,o,s,u,c,l;for(c=new _n,s=new _n,a=new fz(e);a.a-1){for(i=epL(s,0);i.b!=i.d.c;)(r=Pp(Vv(i),128)).v=o;for(;0!=s.b;)for(r=Pp(egW(s,0),128),n=new fz(r.i);n.a0&&(n+=u.n.a+u.o.a/2,++f),p=new fz(u.j);p.a0&&(n/=f),g=Je(tyx,eH6,25,r.a.c.length,15,1),s=0,c=new fz(r.a);c.a=s&&i<=u)s<=i&&a<=u?r+=2:s<=i?(e.b[r]=u+1,o+=2):a<=u?(n[l++]=i,n[l++]=s-1,r+=2):(n[l++]=i,n[l++]=s-1,e.b[r]=u+1,o+=2);else if(u0?i-=864e5:i+=864e5,u=new LZ(eft(eap(t.q.getTime()),i))),l=new vl,c=e.a.length,a=0;a=97&&r<=122||r>=65&&r<=90){for(o=a+1;o=c)throw p7(new gL("Missing trailing '"));o+10&&0==n.c&&(t||(t=new p0),t.c[t.c.length]=n);if(t)for(;0!=t.c.length;){if((n=Pp(ZV(t,0),233)).b&&n.b.c.length>0){for(a=(n.b||(n.b=new p0),new fz(n.b));a.aQI(e,n,0))return new kD(i,n)}else if(gP(Ot(i.g,i.d[0]).a)>gP(Ot(n.g,n.d[0]).a))return new kD(i,n)}for(s=(n.e||(n.e=new p0),n.e).Kc();s.Ob();)u=((o=Pp(s.Pb(),233)).b||(o.b=new p0),o.b),Gp(0,u.c.length),Ew(u.c,0,n),o.c==u.c.length&&(t.c[t.c.length]=o)}return null}function eFe(e,t){var n,r,i,a,o,s,u,c,l;if(null==e)return eUg;if(null!=(u=t.a.zc(e,t)))return"[...]";for(a=0,n=new eaP(eUd,"[","]"),o=(i=e).length;a=14&&l<=16)?t.a._b(r)?(n.a?xM(n.a,n.b):n.a=new O0(n.d),xx(n.a,"[...]")):ZJ(n,eFe(s=etG(r),c=new Rq(t))):M4(r,177)?ZJ(n,ekd(Pp(r,177))):M4(r,190)?ZJ(n,ewh(Pp(r,190))):M4(r,195)?ZJ(n,eEm(Pp(r,195))):M4(r,2012)?ZJ(n,ewp(Pp(r,2012))):M4(r,48)?ZJ(n,ekf(Pp(r,48))):M4(r,364)?ZJ(n,ekG(Pp(r,364))):M4(r,832)?ZJ(n,ekl(Pp(r,832))):M4(r,104)&&ZJ(n,ekc(Pp(r,104))):ZJ(n,null==r?eUg:efF(r));return n.a?0==n.e.length?n.a.a:n.a.a+""+n.e:n.c}function eFt(e,t,n,r){var i,a,o,s,u,c,l,f,d,h,p,b,m,g,v,y;for(s=eLO(t,!1,!1),g=eEF(s),r&&(g=esP(g)),y=gP(LV(eT9(t,(epz(),e53)))),m=(A5(0!=g.b),Pp(g.a.a.c,8)),f=Pp(ep3(g,1),8),g.b>2?(l=new p0,eoc(l,new Gz(g,1,g.b)),a=eBk(l,y+e.a),v=new eTI(a),eaW(v,t),n.c[n.c.length]=v):v=r?Pp(Bp(e.b,e_I(t)),266):Pp(Bp(e.b,e_P(t)),266),u=e_I(t),r&&(u=e_P(t)),o=eEJ(m,u),c=y+e.a,o.a?(c+=eB4.Math.abs(m.b-f.b),b=new kl(f.a,(f.b+m.b)/2)):(c+=eB4.Math.abs(m.a-f.a),b=new kl((f.a+m.a)/2,f.b)),r?Um(e.d,t,new emL(v,o,b,c)):Um(e.c,t,new emL(v,o,b,c)),Um(e.b,t,v),p=(t.n||(t.n=new FQ(e5S,t,1,7)),t.n),h=new Ow(p);h.e!=h.i.gc();)d=Pp(epH(h),137),i=eIt(e,d,!0,0,0),n.c[n.c.length]=i}function eFn(e){var t,n,r,i,a,o,s,u,c,l;for(c=new p0,s=new p0,o=new fz(e);o.a-1){for(a=new fz(s);a.a0)&&(l3(u,eB4.Math.min(u.o,i.o-1)),l2(u,u.i-1),0==u.i&&(s.c[s.c.length]=u))}}function eFr(e,t,n){var r,i,a,o,s,u,c;if(c=e.c,t||(t=tgK),e.c=t,(4&e.Db)!=0&&(1&e.Db)==0&&(u=new FX(e,1,2,c,e.c),n?n.Ei(u):n=u),c!=t){if(M4(e.Cb,284))e.Db>>16==-10?n=Pp(e.Cb,284).nk(t,n):e.Db>>16==-15&&(t||(t=(eBK(),tgA)),c||(c=(eBK(),tgA)),e.Cb.nh()&&(u=new Q$(e.Cb,1,13,c,t,ebv(QX(Pp(e.Cb,59)),e),!1),n?n.Ei(u):n=u));else if(M4(e.Cb,88))e.Db>>16==-23&&(M4(t,88)||(t=(eBK(),tgI)),M4(c,88)||(c=(eBK(),tgI)),e.Cb.nh()&&(u=new Q$(e.Cb,1,10,c,t,ebv(qt(Pp(e.Cb,26)),e),!1),n?n.Ei(u):n=u));else if(M4(e.Cb,444))for(o=((s=Pp(e.Cb,836)).b||(s.b=new pG(new mR)),s.b),a=(r=new esz(new fS(o.a).a),new pW(r));a.a.b;)n=eFr(i=Pp(etz(a.a).cd(),87),eOl(i,s),n)}return n}function eFi(e,t){var n,r,i,a,o,s,u,c,l,f,d;for(o=gN(LK(eT9(e,(eBy(),taI)))),d=Pp(eT9(e,toh),21),u=!1,c=!1,f=new Ow((e.c||(e.c=new FQ(e5x,e,9,9)),e.c));f.e!=f.i.gc()&&(!u||!c);){for(a=Pp(epH(f),118),s=0,i=Y_(enM(eow(vx(e1B,1),eUp,20,0,[(a.d||(a.d=new Ih(e5g,a,8,5)),a.d),(a.e||(a.e=new Ih(e5g,a,7,4)),a.e)])));eTk(i)&&(r=Pp(ZC(i),79),l=o&&exb(r)&&gN(LK(eT9(r,taD))),n=eRL((r.b||(r.b=new Ih(e5m,r,4,7)),r.b),a)?e==z$(ewH(Pp(etj((r.c||(r.c=new Ih(e5m,r,5,8)),r.c),0),82))):e==z$(ewH(Pp(etj((r.b||(r.b=new Ih(e5m,r,4,7)),r.b),0),82))),!((l||n)&&++s>1)););s>0?u=!0:d.Hc((ekU(),tbp))&&(a.n||(a.n=new FQ(e5S,a,1,7)),a.n).i>0&&(u=!0),s>1&&(c=!0)}u&&t.Fc((eLR(),ttw)),c&&t.Fc((eLR(),tt_))}function eFa(e){var t,n,r,i,a,o,s,u,c,l,f,d;if((d=Pp(eT9(e,(eBB(),thx)),21)).dc())return null;if(s=0,o=0,d.Hc((ed5(),tbV))){for(l=Pp(eT9(e,thV),98),r=2,n=2,i=2,a=2,t=z$(e)?Pp(eT9(z$(e),the),103):Pp(eT9(e,the),103),c=new Ow((e.c||(e.c=new FQ(e5x,e,9,9)),e.c));c.e!=c.i.gc();)if(u=Pp(epH(c),118),(f=Pp(eT9(u,th0),61))==(eYu(),tbF)&&(f=eNh(u,t),ebu(u,th0,f)),l==(ewf(),tbo))switch(f.g){case 1:r=eB4.Math.max(r,u.i+u.g);break;case 2:n=eB4.Math.max(n,u.j+u.f);break;case 3:i=eB4.Math.max(i,u.i+u.g);break;case 4:a=eB4.Math.max(a,u.j+u.f)}else switch(f.g){case 1:r+=u.g+2;break;case 2:n+=u.f+2;break;case 3:i+=u.g+2;break;case 4:a+=u.f+2}s=eB4.Math.max(r,i),o=eB4.Math.max(n,a)}return eYx(e,s,o,!0,!0)}function eFo(e,t,n,r,i){var a,o,s,u,c,l,f,d,h,p,b,m,g,v,y,w;for(v=Pp(qE(etc(UJ(new R1(null,new Gq(t.d,16)),new hc(n)),new hl(n)),JF(new U,new B,new en,eow(vx(e2L,1),eU4,132,0,[(eum(),e2U)]))),15),f=eUu,l=eHt,u=new fz(t.b.j);u.a0)?c&&(d=g.p,o?++d:--d,h=!(eOV(r=eoZ(f=Pp(RJ(g.c.a,d),10)),E,n[0])||FF(r,E,n[0]))):h=!0),p=!1,(_=t.D.i)&&_.c&&s.e&&((l=o&&_.p>0||!o&&_.p<_.c.a.c.length-1)?(d=_.p,o?--d:++d,p=!(eOV(r=eoZ(f=Pp(RJ(_.c.a,d),10)),n[0],k)||FF(r,n[0],k))):p=!0),h&&p&&P7(e.a,S),h||enD(e.a,eow(vx(e60,1),eUP,8,0,[b,m])),p||enD(e.a,eow(vx(e60,1),eUP,8,0,[w,y]))}function eFh(e,t){var n,r,i,a,o,s,u,c;if(M4(e.Ug(),160)?(eFh(Pp(e.Ug(),160),t),t.a+=" > "):t.a+="Root ",IE((n=e.Tg().zb).substr(0,3),"Elk")?xM(t,n.substr(3)):(t.a+=""+n,t),i=e.zg()){xM((t.a+=" ",t),i);return}if(M4(e,354)&&(c=Pp(e,137).a)){xM((t.a+=" ",t),c);return}for(o=new Ow(e.Ag());o.e!=o.i.gc();)if(c=(a=Pp(epH(o),137)).a){xM((t.a+=" ",t),c);return}if(M4(e,352)&&((r=Pp(e,79)).b||(r.b=new Ih(e5m,r,4,7)),0!=r.b.i&&(r.c||(r.c=new Ih(e5m,r,5,8)),0!=r.c.i))){for(t.a+=" (",s=new AF((r.b||(r.b=new Ih(e5m,r,4,7)),r.b));s.e!=s.i.gc();)s.e>0&&(t.a+=eUd),eFh(Pp(epH(s),160),t);for(t.a+=eGH,u=new AF((r.c||(r.c=new Ih(e5m,r,5,8)),r.c));u.e!=u.i.gc();)u.e>0&&(t.a+=eUd),eFh(Pp(epH(u),160),t);t.a+=")"}}function eFp(e,t,n){var r,i,a,o,s,u,c,l,f,d,h;if(a=Pp(e_k(e,(eBU(),tnc)),79)){for(r=e.a,C6(i=new TS(n),eyr(e)),eag(e.d.i,e.c.i)?(d=e.c,f=esp(eow(vx(e60,1),eUP,8,0,[d.n,d.a])),C5(f,n)):f=GX(e.c),qQ(r,f,r.a,r.a.a),h=GX(e.d),null!=e_k(e,tnC)&&C6(h,Pp(e_k(e,tnC),8)),qQ(r,h,r.c.b,r.c),etH(r,i),o=eLO(a,!0,!0),ern(o,Pp(etj((a.b||(a.b=new Ih(e5m,a,4,7)),a.b),0),82)),err(o,Pp(etj((a.c||(a.c=new Ih(e5m,a,5,8)),a.c),0),82)),eNI(r,o),l=new fz(e.b);l.a=0){for(u=null,s=new KB(l.a,c+1);s.bo?1:Te(isNaN(0),isNaN(o)))<0&&(enj(eVU),(eB4.Math.abs(o-1)<=eVU||1==o||isNaN(o)&&isNaN(1)?0:o<1?-1:o>1?1:Te(isNaN(o),isNaN(1)))<0)&&(enj(eVU),(eB4.Math.abs(0-s)<=eVU||0==s||isNaN(0)&&isNaN(s)?0:0s?1:Te(isNaN(0),isNaN(s)))<0)&&(enj(eVU),(eB4.Math.abs(s-1)<=eVU||1==s||isNaN(s)&&isNaN(1)?0:s<1?-1:s>1?1:Te(isNaN(s),isNaN(1)))<0)))}function eFg(e){var t,n,r,i,a,o,s,u,c,l,f,d,h,p,b,m,g,v,y,w,_,E;for(f=new BU(new fQ(e));f.b!=f.c.a.d;)for(b=0,s=Pp((l=JO(f)).d,56),t=Pp(l.e,56),w=(null==(o=s.Tg()).i&&eNT(o),o.i).length;b=0&&b=c.c.c.length?VJ((eEn(),e9N),e9D):VJ((eEn(),e9D),e9D),l*=2,a=n.a.g,n.a.g=eB4.Math.max(a,a+(l-a)),o=n.b.g,n.b.g=eB4.Math.max(o,o+(l-o)),i=t}}}function eFw(e,t,n,r,i){var a,o,s,u,c,l,f,d,h,p,b,m,g,v,y,w,_;for(_=Pg(e),l=new p0,f=(s=e.c.length)-1,d=s+1;0!=_.a.c;){for(;0!=n.b;)y=(A5(0!=n.b),Pp(etw(n,n.a.a),112)),zS(_.a,y),y.g=f--,eNg(y,t,n,r);for(;0!=t.b;)w=(A5(0!=t.b),Pp(etw(t,t.a.a),112)),zS(_.a,w),w.g=d++,eNg(w,t,n,r);for(c=eHt,g=(o=new C1(new Ap(new fP(_.a).a).b),new fR(o));Et(g.a.a);){if(m=(a=AJ(g.a),Pp(a.cd(),112)),!r&&m.b>0&&m.a<=0){l.c=Je(e1R,eUp,1,0,5,1),l.c[l.c.length]=m;break}(b=m.i-m.d)>=c&&(b>c&&(l.c=Je(e1R,eUp,1,0,5,1),c=b),l.c[l.c.length]=m)}0!=l.c.length&&(u=Pp(RJ(l,ebO(i,l.c.length)),112),zS(_.a,u),u.g=d++,eNg(u,t,n,r),l.c=Je(e1R,eUp,1,0,5,1))}for(v=e.c.length+1,p=new fz(e);p.a0&&(d.d+=l.n.d,d.d+=l.d),d.a>0&&(d.a+=l.n.a,d.a+=l.d),d.b>0&&(d.b+=l.n.b,d.b+=l.d),d.c>0&&(d.c+=l.n.c,d.c+=l.d),d}function eFx(e,t,n){var r,i,a,o,s,u,c,l,f,d,h,p;for(d=n.d,f=n.c,o=(a=new kl(n.f.a+n.d.b+n.d.c,n.f.b+n.d.d+n.d.a)).b,c=new fz(e.a);c.a=(l=Pp(Pp(Zq(e.r,t),21),84)).gc()||t==(eYu(),tby)||t==(eYu(),tbY)){eYY(e,t);return}for(b=e.u.Hc((ekU(),tbg)),n=t==(eYu(),tbw)?(eaY(),e4c):(eaY(),e4o),g=t==tbw?(QQ(),e3U):(QQ(),e3$),r=vN(DP(n),e.s),m=t==tbw?eHQ:eH1,c=l.Kc();c.Ob();)(s=Pp(c.Pb(),111)).c&&!(s.c.d.c.length<=0)&&(p=s.b.rf(),h=s.e,(d=(f=s.c).i).b=(a=f.n,f.e.a+a.b+a.c),d.a=(o=f.n,f.e.b+o.d+o.a),b?(d.c=h.a-(i=f.n,f.e.a+i.b+i.c)-e.s,b=!1):d.c=h.a+p.a+e.s,$C(g,ezr),f.f=g,JC(f,(Qs(),e3Y)),P_(r.d,new jH(d,elO(r,d))),m=t==tbw?eB4.Math.min(m,h.b):eB4.Math.max(m,h.b+s.b.rf().b));for(m+=t==tbw?-e.t:e.t,edp((r.e=m,r)),u=l.Kc();u.Ob();)(s=Pp(u.Pb(),111)).c&&!(s.c.d.c.length<=0)&&(d=s.c.i,d.c-=s.e.a,d.d-=s.e.b)}function eFA(e,t,n){var r;if(ewG(n,"StretchWidth layering",1),0==t.a.c.length){eEj(n);return}for(e.c=t,e.t=0,e.u=0,e.i=eHQ,e.g=eH1,e.d=gP(LV(e_k(t,(eBy(),toO)))),ebn(e),eTR(e),eTP(e),eyo(e),ed2(e),e.i=eB4.Math.max(1,e.i),e.g=eB4.Math.max(1,e.g),e.d=e.d/e.i,e.f=e.g/e.i,e.s=ebZ(e),r=new By(e.c),P_(e.c.b,r),e.r=WC(e.p),e.n=zb(e.k,e.k.length);0!=e.r.c.length;)e.o=ecu(e),!e.o||ess(e)&&0!=e.b.a.gc()?(ey5(e,r),r=new By(e.c),P_(e.c.b,r),er7(e.a,e.b),e.b.a.$b(),e.t=e.u,e.u=0):ess(e)?(e.c.b.c=Je(e1R,eUp,1,0,5,1),r=new By(e.c),P_(e.c.b,r),e.t=0,e.u=0,e.b.a.$b(),e.a.a.$b(),++e.f,e.r=WC(e.p),e.n=zb(e.k,e.k.length)):(Gu(e.o,r),QA(e.r,e.o),Yf(e.b,e.o),e.t=e.t-e.k[e.o.p]*e.d+e.j[e.o.p],e.u+=e.e[e.o.p]*e.d);t.a.c=Je(e1R,eUp,1,0,5,1),eSj(t.b),eEj(n)}function eFL(e){var t,n,r,i;for(_r(UJ(new R1(null,new Gq(e.a.b,16)),new rH),new r$),eyR(e),_r(UJ(new R1(null,new Gq(e.a.b,16)),new rz),new rG),e.c==(efE(),tpM)&&(_r(UJ(eeh(new R1(null,new Gq(new fk(e.f),1)),new rW),new rK),new hn(e)),_r(UJ(UQ(eeh(eeh(new R1(null,new Gq(e.d.b,16)),new rV),new rq),new rZ),new rX),new hi(e))),i=new kl(eHQ,eHQ),t=new kl(eH1,eH1),r=new fz(e.a.b);r.a0&&(e.c[t.c.p][t.p].d+=eMU(e.i,24)*e$h*.07000000029802322-.03500000014901161,e.c[t.c.p][t.p].a=e.c[t.c.p][t.p].d/e.c[t.c.p][t.p].b)}}function eFD(e){var t,n,r,i,a,o,s,u,c,l,f,d,h,p,b,m;for(p=new fz(e);p.ar.d,r.d=eB4.Math.max(r.d,t),s&&n&&(r.d=eB4.Math.max(r.d,r.a),r.a=r.d+i);break;case 3:n=t>r.a,r.a=eB4.Math.max(r.a,t),s&&n&&(r.a=eB4.Math.max(r.a,r.d),r.d=r.a+i);break;case 2:n=t>r.c,r.c=eB4.Math.max(r.c,t),s&&n&&(r.c=eB4.Math.max(r.b,r.c),r.b=r.c+i);break;case 4:n=t>r.b,r.b=eB4.Math.max(r.b,t),s&&n&&(r.b=eB4.Math.max(r.b,r.c),r.c=r.b+i)}}}function eFj(e){var t,n,r,i,a,o,s,u,c,l,f;for(c=new fz(e);c.a0||l.j==tbY&&l.e.c.length-l.g.c.length<0)){t=!1;break}for(i=new fz(l.g);i.a=c&&_>=m&&(d+=p.n.b+b.n.b+b.a.b-w,++s));if(n)for(o=new fz(v.e);o.a=c&&_>=m&&(d+=p.n.b+b.n.b+b.a.b-w,++s))}s>0&&(E+=d/s,++h)}h>0?(t.a=i*E/h,t.g=h):(t.a=0,t.g=0)}function eFY(e,t){var n,r,i,a,o,s,u,c,l,f,d;for(i=new fz(e.a.b);i.aeH1||t.o==tuE&&l0&&eno(g,w*E),_>0&&ens(g,_*S);for(ear(e.b,new te),t=new p0,s=new esz(new fS(e.c).a);s.b;)o=etz(s),r=Pp(o.cd(),79),n=Pp(o.dd(),395).a,i=eLO(r,!1,!1),f=ewM(e_I(r),eEF(i),n),eNI(f,i),(y=e_D(r))&&-1==QI(t,y,0)&&(t.c[t.c.length]=y,Hw(y,(A5(0!=f.b),Pp(f.a.a.c,8)),n));for(m=new esz(new fS(e.d).a);m.b;)b=etz(m),r=Pp(b.cd(),79),n=Pp(b.dd(),395).a,i=eLO(r,!1,!1),f=ewM(e_P(r),esP(eEF(i)),n),eNI(f=esP(f),i),(y=e_N(r))&&-1==QI(t,y,0)&&(t.c[t.c.length]=y,Hw(y,(A5(0!=f.b),Pp(f.c.b.c,8)),n))}function eFz(e,t,n,r){var i,a,o,s,u,c,l,f,d,h,p,b,m,g,v,y,w,_,E,S,k;if(0!=n.c.length){for(p=new p0,h=new fz(n);h.aeB4.Math.abs(v-m))continue;v1)for(h=new eRM(p,y,r),qX(y,new SV(e,h)),o.c[o.c.length]=h,f=y.a.ec().Kc();f.Ob();)QA(a,(l=Pp(f.Pb(),46)).b);if(s.a.gc()>1)for(h=new eRM(p,s,r),qX(s,new Sq(e,h)),o.c[o.c.length]=h,f=s.a.ec().Kc();f.Ob();)QA(a,(l=Pp(f.Pb(),46)).b)}}function eFJ(e){_Y(e,new ewB(vZ(vQ(vq(vJ(vX(new oc,eqp),"ELK Radial"),'A radial layout provider which is based on the algorithm of Peter Eades published in "Drawing free trees.", published by International Institute for Advanced Study of Social Information Science, Fujitsu Limited in 1991. The radial layouter takes a tree and places the nodes in radial order around the root. The nodes of the same tree level are placed on the same radius.'),new aW),eqp))),KE(e,eqp,eVT,epB(tlw)),KE(e,eqp,eGi,epB(tlS)),KE(e,eqp,eGh,epB(tlh)),KE(e,eqp,eGM,epB(tlp)),KE(e,eqp,eGd,epB(tlb)),KE(e,eqp,eGp,epB(tld)),KE(e,eqp,eGf,epB(tlm)),KE(e,eqp,eGb,epB(tly)),KE(e,eqp,eql,epB(tll)),KE(e,eqp,eqc,epB(tlf)),KE(e,eqp,eqh,epB(tlg)),KE(e,eqp,eqs,epB(tlv)),KE(e,eqp,equ,epB(tl_)),KE(e,eqp,eqf,epB(tlE)),KE(e,eqp,eqd,epB(tlk))}function eFQ(e){var t;if(this.r=U2(new ex,new eT),this.b=new efY(Pp(Y8(e5a),290)),this.p=new efY(Pp(Y8(e5a),290)),this.i=new efY(Pp(Y8(e3n),290)),this.e=e,this.o=new TS(e.rf()),this.D=e.Df()||gN(LK(e.We((eBB(),thh)))),this.A=Pp(e.We((eBB(),thx)),21),this.B=Pp(e.We(thL),21),this.q=Pp(e.We(thV),98),this.u=Pp(e.We(thJ),21),!e_y(this.u))throw p7(new gq("Invalid port label placement: "+this.u));if(this.v=gN(LK(e.We(th1))),this.j=Pp(e.We(thS),21),!eM1(this.j))throw p7(new gq("Invalid node label placement: "+this.j));this.n=Pp(egG(e,th_),116),this.k=gP(LV(egG(e,tps))),this.d=gP(LV(egG(e,tpo))),this.w=gP(LV(egG(e,tpp))),this.s=gP(LV(egG(e,tpu))),this.t=gP(LV(egG(e,tpc))),this.C=Pp(egG(e,tpd),142),this.c=2*this.d,t=!this.B.Hc((eI3(),tbX)),this.f=new eh5(0,t,0),this.g=new eh5(1,t,0),gh(this.f,(etx(),e3N),this.g)}function eF1(e,t,n,r,i){var a,o,s,u,l,f,d,h,p,b,m,g,v,y,w,_,E,S,k,x,T,M;for(w=0,b=0,p=0,h=1,y=new Ow((e.a||(e.a=new FQ(e5k,e,10,11)),e.a));y.e!=y.i.gc();)g=Pp(epH(y),33),h+=VG(new Fa(OH(eOi(g).a.Kc(),new c))),x=g.g,b=eB4.Math.max(b,x),d=g.f,p=eB4.Math.max(p,d),w+=x*d;for(m=(e.a||(e.a=new FQ(e5k,e,10,11)),e.a).i,o=w+2*r*r*h*m,a=eB4.Math.sqrt(o),u=eB4.Math.max(a*n,b),s=eB4.Math.max(a/n,p),v=new Ow((e.a||(e.a=new FQ(e5k,e,10,11)),e.a));v.e!=v.i.gc();)g=Pp(epH(v),33),T=i.b+(eMU(t,26)*e$l+eMU(t,27)*e$f)*(u-g.g),M=i.b+(eMU(t,26)*e$l+eMU(t,27)*e$f)*(s-g.f),eno(g,T),ens(g,M);for(k=u+(i.b+i.c),S=s+(i.d+i.a),E=new Ow((e.a||(e.a=new FQ(e5k,e,10,11)),e.a));E.e!=E.i.gc();)for(_=Pp(epH(E),33),f=new Fa(OH(eOi(_).a.Kc(),new c));eTk(f);)l=Pp(ZC(f),79),eTc(l)||eBv(l,t,k,S);eYx(e,k+=i.b+i.c,S+=i.d+i.a,!1,!0)}function eF0(e){var t,n,r,i,a,o,s,u,c,l,f;if(null==e)throw p7(new vo(eUg));if(c=e,a=e.length,u=!1,a>0&&(45==(t=(GV(0,e.length),e.charCodeAt(0)))||43==t)&&(e=e.substr(1),--a,u=45==t),0==a)throw p7(new vo(eHJ+c+'"'));for(;e.length>0&&(GV(0,e.length),48==e.charCodeAt(0));)e=e.substr(1),--a;if(a>(eDZ(),e0G)[10])throw p7(new vo(eHJ+c+'"'));for(i=0;i0&&(f=-parseInt(e.substr(0,r),10),e=e.substr(r),a-=r,n=!1);a>=o;){if(r=parseInt(e.substr(0,o),10),e=e.substr(o),a-=o,n)n=!1;else{if(0>ecd(f,s))throw p7(new vo(eHJ+c+'"'));f=efn(f,l)}f=efe(f,r)}if(ecd(f,0)>0||!u&&(f=QC(f),0>ecd(f,0)))throw p7(new vo(eHJ+c+'"'));return f}function eF2(e,t){var n,r,i,a,o,s,u;if(Rm(),this.a=new MW(this),this.b=e,this.c=t,this.f=Yg(QZ((eSp(),tvc),t)),this.f.dc()){if((s=ev1(tvc,e))==t)for(this.e=!0,this.d=new p0,this.f=new o6,this.f.Fc(eQB),Pp(eP8(Qq(tvc,etP(e)),""),26)==e&&this.f.Fc(Fr(tvc,etP(e))),i=eIT(tvc,e).Kc();i.Ob();)switch(Ur(QZ(tvc,r=Pp(i.Pb(),170)))){case 4:this.d.Fc(r);break;case 5:this.f.Gc(Yg(QZ(tvc,r)))}else if(_4(),Pp(t,66).Oj())for(o=0,this.e=!0,this.f=null,this.d=new p0,u=(null==e.i&&eNT(e),e.i).length;o=0&&o0&&(Pp(UA(e.b,t),124).a.b=n)}function eF4(e,t){var n,r,i,a,o,s,u,c,l,f,d,h,p,b,m,g;for(ewG(t,"Comment pre-processing",1),n=0,u=new fz(e.a);u.a0&&64!=(u=(GV(0,t.length),t.charCodeAt(0)))){if(37==u&&(f=t.lastIndexOf("%"),c=!1,0!=f&&(f==d-1||(c=(GV(f+1,t.length),46==t.charCodeAt(f+1)))))){if(y=IE("%",o=t.substr(1,f-1))?null:eYy(o),r=0,c)try{r=eDa(t.substr(f+2),eHt,eUu)}catch(w){if(w=eoa(w),M4(w,127))throw s=w,p7(new QH(s));throw p7(w)}for(m=erW(e.Wg());m.Ob();)if(M4(p=eaO(m),510)&&(v=(i=Pp(p,590)).d,(null==y?null==v:IE(y,v))&&0==r--))return i;return null}if(h=-1==(l=t.lastIndexOf("."))?t:t.substr(0,l),n=0,-1!=l)try{n=eDa(t.substr(l+1),eHt,eUu)}catch(_){if(_=eoa(_),M4(_,127))h=t;else throw p7(_)}for(h=IE("%",h)?null:eYy(h),b=erW(e.Wg());b.Ob();)if(M4(p=eaO(b),191)&&(g=(a=Pp(p,191)).ne(),(null==h?null==g:IE(h,g))&&0==n--))return a;return null}return eR2(e,t)}function eF9(e){var t,n,r,i,a,o,s,u,c,l,f,d,h,p,b,m,g,v,y,w,_,E,S,k,x,T,M;for(E=new p0,p=new fz(e.b);p.a=e.length)return{done:!0};var r=e[n++];return{value:[r,t.get(r)],done:!1}}}},eCi()||(e.prototype.createObject=function(){return{}},e.prototype.get=function(e){return this.obj[":"+e]},e.prototype.set=function(e,t){this.obj[":"+e]=t},e.prototype[e$c]=function(e){delete this.obj[":"+e]},e.prototype.keys=function(){var e=[];for(var t in this.obj)58==t.charCodeAt(0)&&e.push(t.substring(1));return e}),e}function eYt(e){var t,n,r,i,a,o,s,u,c,l,f,d,h,p,b,m;if(eNl(),null==e)return null;if(0==(f=8*e.length))return"";for(u=0,s=f%24,h=f/24|0,a=null,a=Je(tyw,eHl,25,4*(d=0!=s?h+1:h),15,1),c=0,l=0,t=0,n=0,r=0,o=0,i=0;u>24,c=(3&t)<<24>>24,p=(-128&t)==0?t>>2<<24>>24:(t>>2^192)<<24>>24,b=(-128&n)==0?n>>4<<24>>24:(n>>4^240)<<24>>24,m=(-128&r)==0?r>>6<<24>>24:(r>>6^252)<<24>>24,a[o++]=tvQ[p],a[o++]=tvQ[b|c<<4],a[o++]=tvQ[l<<2|m],a[o++]=tvQ[63&r];return 8==s?(c=(3&(t=e[i]))<<24>>24,p=(-128&t)==0?t>>2<<24>>24:(t>>2^192)<<24>>24,a[o++]=tvQ[p],a[o++]=tvQ[c<<4],a[o++]=61,a[o++]=61):16==s&&(t=e[i],l=(15&(n=e[i+1]))<<24>>24,c=(3&t)<<24>>24,p=(-128&t)==0?t>>2<<24>>24:(t>>2^192)<<24>>24,b=(-128&n)==0?n>>4<<24>>24:(n>>4^240)<<24>>24,a[o++]=tvQ[p],a[o++]=tvQ[b|c<<4],a[o++]=tvQ[l<<2],a[o++]=61),ehv(a,0,a.length)}function eYn(e,t){var n,r,i,a,o,s,u;if(0==e.e&&e.p>0&&(e.p=-(e.p-1)),e.p>eHt&&V8(t,e.p-eHx),o=t.q.getDate(),zC(t,1),e.k>=0&&z7(t,e.k),e.c>=0?zC(t,e.c):e.k>=0?(r=35-(u=new est(t.q.getFullYear()-eHx,t.q.getMonth(),35)).q.getDate(),zC(t,eB4.Math.min(r,o))):zC(t,o),e.f<0&&(e.f=t.q.getHours()),e.b>0&&e.f<12&&(e.f+=12),M6(t,24==e.f&&e.g?0:e.f),e.j>=0&&Z0(t,e.j),e.n>=0&&Jf(t,e.n),e.i>=0&&xN(t,eft(efn(eyt(eap(t.q.getTime()),eHf),eHf),e.i)),e.a&&(V8(i=new wW,i.q.getFullYear()-eHx-80),Ei(eap(t.q.getTime()),eap(i.q.getTime()))&&V8(t,i.q.getFullYear()-eHx+100)),e.d>=0){if(-1==e.c)(n=(7+e.d-t.q.getDay())%7)>3&&(n-=7),s=t.q.getMonth(),zC(t,t.q.getDate()+n),t.q.getMonth()!=s&&zC(t,t.q.getDate()+(n>0?-7:7));else if(t.q.getDay()!=e.d)return!1}return e.o>eHt&&(a=t.q.getTimezoneOffset(),xN(t,eft(eap(t.q.getTime()),(e.o-a)*60*eHf))),!0}function eYr(e,t){var n,r,i,a,o,s,u,c,l,f,d,h,p,b,m,g,v,y,w;if(i=e_k(t,(eBU(),tnc)),M4(i,239)){for(p=Pp(i,33),b=t.e,d=new TS(t.c),a=t.d,d.a+=a.b,d.b+=a.d,w=Pp(eT9(p,(eBy(),ta8)),174),Aa(w,(eI3(),tbJ))&&(h=Pp(eT9(p,ta7),116),lR(h,a.a),lG(h,a.d),lj(h,a.b),lW(h,a.c)),n=new p0,l=new fz(t.a);l.a0&&P_(e.p,f),P_(e.o,f);t-=r,p=u+t,l+=t*e.e,q1(e.a,s,ell(p)),q1(e.b,s,l),e.j=eB4.Math.max(e.j,p),e.k=eB4.Math.max(e.k,l),e.d+=t,t+=m}}function eYu(){var e;eYu=A,tbF=new kS(ezo,0),tbw=new kS(ezb,1),tby=new kS(ezm,2),tbj=new kS(ezg,3),tbY=new kS(ezv,4),tbx=(Hj(),new vd((e=Pp(yw(e5a),9),new I1(e,Pp(CY(e,e.length),9),0)))),tbT=ecO(jL(tbw,eow(vx(e5a,1),eGj,61,0,[]))),tb_=ecO(jL(tby,eow(vx(e5a,1),eGj,61,0,[]))),tbN=ecO(jL(tbj,eow(vx(e5a,1),eGj,61,0,[]))),tbR=ecO(jL(tbY,eow(vx(e5a,1),eGj,61,0,[]))),tbC=ecO(jL(tbw,eow(vx(e5a,1),eGj,61,0,[tbj]))),tbk=ecO(jL(tby,eow(vx(e5a,1),eGj,61,0,[tbY]))),tbD=ecO(jL(tbw,eow(vx(e5a,1),eGj,61,0,[tbY]))),tbM=ecO(jL(tbw,eow(vx(e5a,1),eGj,61,0,[tby]))),tbP=ecO(jL(tbj,eow(vx(e5a,1),eGj,61,0,[tbY]))),tbE=ecO(jL(tby,eow(vx(e5a,1),eGj,61,0,[tbj]))),tbL=ecO(jL(tbw,eow(vx(e5a,1),eGj,61,0,[tby,tbY]))),tbS=ecO(jL(tby,eow(vx(e5a,1),eGj,61,0,[tbj,tbY]))),tbI=ecO(jL(tbw,eow(vx(e5a,1),eGj,61,0,[tbj,tbY]))),tbO=ecO(jL(tbw,eow(vx(e5a,1),eGj,61,0,[tby,tbj]))),tbA=ecO(jL(tbw,eow(vx(e5a,1),eGj,61,0,[tby,tbj,tbY])))}function eYc(e,t){var n,r,i,a,o,s,u,c,l,f,d,h,p,b,m,g,v,y;if(0!=t.b){for(h=new _n,s=null,p=null,r=zy(eB4.Math.floor(eB4.Math.log(t.b)*eB4.Math.LOG10E)+1),u=0,y=epL(t,0);y.b!=y.d.c;)for(g=Pp(Vv(y),86),xc(p)!==xc(e_k(g,(eR5(),tca)))&&(p=Lq(e_k(g,tca)),u=0),eo3(g,tca,s=null!=p?p+WB(u++,r):WB(u++,r)),m=(i=epL(new hz(g).a.d,0),new hG(i));yV(m.a);)qQ(h,b=Pp(Vv(m.a),188).c,h.c.b,h.c),eo3(b,tca,s);for(o=0,d=new p2;o=u){A5(g.b>0),g.a.Xb(g.c=--g.b);break}b.a>c&&(i?(eoc(i.b,b.b),i.a=eB4.Math.max(i.a,b.a),BH(g)):(P_(b.b,f),b.c=eB4.Math.min(b.c,c),b.a=eB4.Math.max(b.a,u),i=b))}i||((i=new mi).c=c,i.a=u,CD(g,i),P_(i.b,f))}for(s=t.b,l=0,m=new fz(r);m.as?1:0:(e.b&&(e.b._b(a)&&(i=Pp(e.b.xc(a),19).a),e.b._b(u)&&(s=Pp(e.b.xc(u),19).a)),is?1:0);return 0!=t.e.c.length&&0!=n.g.c.length?1:-1}function eYd(e,t){var n,r,i,a,o,s,u,c,l,f,d,h,p,b,m,g,v,y,w,_,E,S;for(ewG(t,eWo,1),b=new p0,E=new p0,c=new fz(e.b);c.a0&&(w-=p),eRU(o,w),f=0,h=new fz(o.a);h.a0),s.a.Xb(s.c=--s.b)),u=.4*r*f,!a&&s.bt.d.c){if((p=e.c[t.a.d])==(g=e.c[d.a.d]))continue;eAx(_f(_l(_d(_c(new bQ,1),100),p),g))}}}}}}function eYy(e){var t,n,r,i,a,o,s,u;if(eRe(),null==e)return null;if((i=x7(e,e_n(37)))<0)return e;for(u=new O0(e.substr(0,i)),t=Je(tyk,eZ9,25,4,15,1),s=0,r=0,o=e.length;ii+2&&eoV((GV(i+1,e.length),e.charCodeAt(i+1)),tmZ,tmX)&&eoV((GV(i+2,e.length),e.charCodeAt(i+2)),tmZ,tmX)){if(n=P0((GV(i+1,e.length),e.charCodeAt(i+1)),(GV(i+2,e.length),e.charCodeAt(i+2))),i+=2,r>0?(192&n)==128?t[s++]=n<<24>>24:r=0:n>=128&&((224&n)==192?(t[s++]=n<<24>>24,r=2):(240&n)==224?(t[s++]=n<<24>>24,r=3):(248&n)==240&&(t[s++]=n<<24>>24,r=4)),r>0){if(s==r){switch(s){case 2:Bd(u,((31&t[0])<<6|63&t[1])&eHd);break;case 3:Bd(u,((15&t[0])<<12|(63&t[1])<<6|63&t[2])&eHd)}s=0,r=0}}else{for(a=0;a0){if(o+r>e.length)return!1;s=exf(e.substr(0,o+r),t)}else s=exf(e,t)}switch(a){case 71:return s=ew5(e,o,eow(vx(e17,1),eUP,2,6,[eHM,eHO]),t),i.e=s,!0;case 77:return eLY(e,t,i,s,o);case 76:return eLB(e,t,i,s,o);case 69:return eS$(e,t,o,i);case 99:return eSz(e,t,o,i);case 97:return s=ew5(e,o,eow(vx(e17,1),eUP,2,6,["AM","PM"]),t),i.b=s,!0;case 121:return eLU(e,t,o,s,n,i);case 100:if(s<=0)return!1;return i.c=s,!0;case 83:if(s<0)return!1;return edc(s,o,t[0],i);case 104:12==s&&(s=0);case 75:case 72:if(s<0)return!1;return i.f=s,i.g=!1,!0;case 107:if(s<0)return!1;return i.f=s,i.g=!0,!0;case 109:if(s<0)return!1;return i.j=s,!0;case 115:if(s<0)return!1;return i.n=s,!0;case 90:if(oE&&(p.c=E-p.b),P_(o.d,new jH(p,elO(o,p))),v=t==tbw?eB4.Math.max(v,b.b+c.b.rf().b):eB4.Math.min(v,b.b));for(v+=t==tbw?e.t:-e.t,(y=edp((o.e=v,o)))>0&&(Pp(UA(e.b,t),124).a.b=y),l=d.Kc();l.Ob();)(c=Pp(l.Pb(),111)).c&&!(c.c.d.c.length<=0)&&(p=c.c.i,p.c-=c.e.a,p.d-=c.e.b)}function eYE(e){var t,n,r,i,a,o,s,u,l,f,d,h,p;for(t=new p2,u=new Ow(e);u.e!=u.i.gc();){for(s=Pp(epH(u),33),n=new bV,Um(e8t,s,n),p=new e6,i=Pp(qE(new R1(null,new YI(new Fa(OH(eOr(s).a.Kc(),new c)))),jD(p,JF(new U,new B,new en,eow(vx(e2L,1),eU4,132,0,[(eum(),e2U)])))),83),enC(n,Pp(i.xc((OQ(),!0)),14),new e5),o=(r=Pp(qE(UJ(Pp(i.xc(!1),15).Lc(),new e8),JF(new U,new B,new en,eow(vx(e2L,1),eU4,132,0,[e2U]))),15)).Kc();o.Ob();)(h=e_D(a=Pp(o.Pb(),79)))&&((l=Pp(xu($I(t.f,h)),21))||(l=eA7(h),eS8(t.f,h,l)),er7(n,l));for(i=Pp(qE(new R1(null,new YI(new Fa(OH(eOi(s).a.Kc(),new c)))),jD(p,JF(new U,new B,new en,eow(vx(e2L,1),eU4,132,0,[e2U])))),83),enC(n,Pp(i.xc(!0),14),new e9),d=(r=Pp(qE(UJ(Pp(i.xc(!1),15).Lc(),new e7),JF(new U,new B,new en,eow(vx(e2L,1),eU4,132,0,[e2U]))),15)).Kc();d.Ob();)(h=e_N(f=Pp(d.Pb(),79)))&&((l=Pp(xu($I(t.f,h)),21))||(l=eA7(h),eS8(t.f,h,l)),er7(n,l))}}function eYS(e,t){var n,r,i,a,o,s,u,c,l,f,d,h,p,b;if(ePN(),(u=0>ecd(e,0))&&(e=QC(e)),0==ecd(e,0))switch(t){case 0:return"0";case 1:return e$e;case 2:return"0.00";case 3:return"0.000";case 4:return"0.0000";case 5:return"0.00000";case 6:return"0.000000";default:return h=new vc,t<0?(h.a+="0E+",h):(h.a+="0E",h),h.a+=t==eHt?"2147483648":""+-t,h.a}f=Je(tyw,eHl,25,(l=18)+1,15,1),n=l,b=e;do c=b,b=eyt(b,10),f[--n]=jE(eft(48,efe(c,efn(b,10))))&eHd;while(0!=ecd(b,0))if(i=efe(efe(efe(l,n),t),1),0==t)return u&&(f[--n]=45),ehv(f,n,l-n);if(t>0&&ecd(i,-6)>=0){if(ecd(i,0)>=0){for(a=n+jE(i),s=l-1;s>=a;s--)f[s+1]=f[s];return f[++a]=46,u&&(f[--n]=45),ehv(f,n,l-n+1)}for(o=2;Ei(o,eft(QC(i),1));o++)f[--n]=48;return f[--n]=46,f[--n]=48,u&&(f[--n]=45),ehv(f,n,l-n)}return p=n+1,r=l,d=new vl,u&&(d.a+="-"),r-p>=1?(Bd(d,f[n]),d.a+=".",d.a+=ehv(f,n+1,l-n-1)):d.a+=ehv(f,n,l-n),d.a+="E",ecd(i,0)>0&&(d.a+="+"),d.a+=""+Fb(i),d.a}function eYk(e,t,n){var r,i,a,o,s,u,c,l,f,d,h;if(e.e.a.$b(),e.f.a.$b(),e.c.c=Je(e1R,eUp,1,0,5,1),e.i.c=Je(e1R,eUp,1,0,5,1),e.g.a.$b(),t)for(o=new fz(t.a);o.a=1&&(_-c>0&&p>=0?(eno(f,f.i+w),ens(f,f.j+u*c)):_-c<0&&h>=0&&(eno(f,f.i+w*_),ens(f,f.j+u)));return ebu(e,(eBB(),thx),(ed5(),a=Pp(yw(e5o),9),new I1(a,Pp(CY(a,a.length),9),0))),new kl(E,l)}function eYT(e){var t,n,r,i,a,o,s,u,c,l,f,d,h,p;if(h=z$(ewH(Pp(etj((e.b||(e.b=new Ih(e5m,e,4,7)),e.b),0),82))),p=z$(ewH(Pp(etj((e.c||(e.c=new Ih(e5m,e,5,8)),e.c),0),82))),f=h==p,s=new yb,(t=Pp(eT9(e,(euw(),tpj)),74))&&t.b>=2){if(0==(e.a||(e.a=new FQ(e5v,e,6,6)),e.a).i)n=(yT(),i=new oQ),JL((e.a||(e.a=new FQ(e5v,e,6,6)),e.a),n);else if((e.a||(e.a=new FQ(e5v,e,6,6)),e.a).i>1)for(d=new AF((e.a||(e.a=new FQ(e5v,e,6,6)),e.a));d.e!=d.i.gc();)ey_(d);eNI(t,Pp(etj((e.a||(e.a=new FQ(e5v,e,6,6)),e.a),0),202))}if(f)for(r=new Ow((e.a||(e.a=new FQ(e5v,e,6,6)),e.a));r.e!=r.i.gc();)for(n=Pp(epH(r),202),c=new Ow((n.a||(n.a=new O_(e5h,n,5)),n.a));c.e!=c.i.gc();)u=Pp(epH(c),469),s.a=eB4.Math.max(s.a,u.a),s.b=eB4.Math.max(s.b,u.b);for(o=new Ow((e.n||(e.n=new FQ(e5S,e,1,7)),e.n));o.e!=o.i.gc();)a=Pp(epH(o),137),(l=Pp(eT9(a,tp$),8))&&TP(a,l.a,l.b),f&&(s.a=eB4.Math.max(s.a,a.i+a.g),s.b=eB4.Math.max(s.b,a.j+a.f));return s}function eYM(e,t,n){var r,i,a,o,s,u,c,l,f,d,h,p,b,m,g,v,y,w,_,E,k,x;for(s=0,y=t.c.length,i=new eIW(e.a,n,null,null),x=Je(tyx,eH6,25,y,15,1),b=Je(tyx,eH6,25,y,15,1),p=Je(tyx,eH6,25,y,15,1),m=0;sx[u]&&(m=u),f=new fz(e.a.b);f.ah&&(a&&(xL(E,d),xL(k,ell(c.b-1))),A=n.b,L+=d+t,d=0,l=eB4.Math.max(l,n.b+n.c+O)),eno(s,A),ens(s,L),l=eB4.Math.max(l,A+O+n.c),d=eB4.Math.max(d,f),A+=O+t;if(l=eB4.Math.max(l,r),(M=L+d+n.a)ez9,x=eB4.Math.abs(d.b-p.b)>ez9,(!n&&k&&x||n&&(k||x))&&P7(m.a,w)),er7(m.a,r),d=0==r.b?w:(A5(0!=r.b),Pp(r.c.b.c,8)),ea1(h,f,b),eiy(i)==S&&(Bq(S.i)!=i.a&&eSb(b=new yb,Bq(S.i),v),eo3(m,tnC,b)),eEw(h,m,v),l.a.zc(h,l);Gs(m,_),Go(m,S)}for(c=l.a.ec().Kc();c.Ob();)Gs(u=Pp(c.Pb(),17),null),Go(u,null);eEj(t)}function eYC(e){var t,n,r,i,a,o,s,u,c,l,f,d,h,p,b,m,g,v,y,w;if(1==e.gc())return Pp(e.Xb(0),231);if(0>=e.gc())return new Z6;for(i=e.Kc();i.Ob();){for(n=Pp(i.Pb(),231),p=0,l=eUu,f=eUu,u=eHt,c=eHt,h=new fz(n.e);h.as&&(y=0,w+=o+g,o=0),eIJ(b,n,y,w),t=eB4.Math.max(t,y+m.a),o=eB4.Math.max(o,m.b),y+=m.a+g;return b}function eYI(e,t){var n,r,i,a,o,s,u,c,l,f,d,h,p;switch(l=new mE,e.a.g){case 3:d=Pp(e_k(t.e,(eBU(),tnO)),15),h=Pp(e_k(t.j,tnO),15),p=Pp(e_k(t.f,tnO),15),n=Pp(e_k(t.e,tnT),15),r=Pp(e_k(t.j,tnT),15),i=Pp(e_k(t.f,tnT),15),o=new p0,eoc(o,d),h.Jc(new iN),eoc(o,M4(h,152)?ZK(Pp(h,152)):M4(h,131)?Pp(h,131).a:M4(h,54)?new gn(h):new w$(h)),eoc(o,p),a=new p0,eoc(a,n),eoc(a,M4(r,152)?ZK(Pp(r,152)):M4(r,131)?Pp(r,131).a:M4(r,54)?new gn(r):new w$(r)),eoc(a,i),eo3(t.f,tnO,o),eo3(t.f,tnT,a),eo3(t.f,tnA,t.f),eo3(t.e,tnO,null),eo3(t.e,tnT,null),eo3(t.j,tnO,null),eo3(t.j,tnT,null);break;case 1:er7(l,t.e.a),P7(l,t.i.n),er7(l,eaa(t.j.a)),P7(l,t.a.n),er7(l,t.f.a);break;default:er7(l,t.e.a),er7(l,eaa(t.j.a)),er7(l,t.f.a)}HC(t.f.a),er7(t.f.a,l),Gs(t.f,t.e.c),s=Pp(e_k(t.e,(eBy(),taR)),74),c=Pp(e_k(t.j,taR),74),u=Pp(e_k(t.f,taR),74),(s||c||u)&&(Yp(f=new mE,u),Yp(f,c),Yp(f,s),eo3(t.f,taR,f)),Gs(t.j,null),Go(t.j,null),Gs(t.e,null),Go(t.e,null),Gu(t.a,null),Gu(t.i,null),t.g&&eYI(e,t.g)}function eYD(e){var t,n,r,i,a,o,s,u,c,l,f,d,h,p,b,m;if(eNl(),null==e||(a=Q4(e),(p=elw(a))%4!=0))return null;if(0==(b=p/4|0))return Je(tyk,eZ9,25,0,15,1);for(f=null,t=0,n=0,r=0,i=0,o=0,s=0,u=0,c=0,h=0,d=0,l=0,f=Je(tyk,eZ9,25,3*b,15,1);h>4)<<24>>24,f[d++]=((15&n)<<4|r>>2&15)<<24>>24,f[d++]=(r<<6|i)<<24>>24}if(!wl(o=a[l++])||!wl(s=a[l++]))return null;if(t=tvJ[o],n=tvJ[s],u=a[l++],c=a[l++],-1==tvJ[u]||-1==tvJ[c])return 61==u&&61==c?(15&n)!=0?null:(m=Je(tyk,eZ9,25,3*h+1,15,1),ePD(f,0,m,0,3*h),m[d]=(t<<2|n>>4)<<24>>24,m):61==u||61!=c?null:(3&(r=tvJ[u]))!=0?null:(m=Je(tyk,eZ9,25,3*h+2,15,1),ePD(f,0,m,0,3*h),m[d++]=(t<<2|n>>4)<<24>>24,m[d]=((15&n)<<4|r>>2&15)<<24>>24,m);return r=tvJ[u],i=tvJ[c],f[d++]=(t<<2|n>>4)<<24>>24,f[d++]=((15&n)<<4|r>>2&15)<<24>>24,f[d++]=(r<<6|i)<<24>>24,f}function eYN(e,t){var n,r,i,a,o,s,u,c,l,f,d,h,p,b,m,g,v,y,w,_;for(ewG(t,eWo,1),p=Pp(e_k(e,(eBy(),tag)),218),i=new fz(e.b);i.a=2){for(b=!0,n=Pp(Wx(d=new fz(a.j)),11),h=null;d.a0&&(i=Pp(RJ(m.c.a,E-1),10),o=e.i[i.p],k=eB4.Math.ceil(Mj(e.n,i,m)),a=_.a.e-m.d.d-(o.a.e+i.o.b+i.d.a)-k),c=eHQ,E0&&S.a.e.e-S.a.a-(S.b.e.e-S.b.a)<0,p=y.a.e.e-y.a.a-(y.b.e.e-y.b.a)<0&&S.a.e.e-S.a.a-(S.b.e.e-S.b.a)>0,h=y.a.e.e+y.b.aS.b.e.e+S.a.a,w=0,!b&&!p&&(d?a+f>0?w=f:c-r>0&&(w=r):h&&(a+s>0?w=s:c-v>0&&(w=v))),_.a.e+=w,_.b&&(_.d.e+=w),!1))}function eYR(e,t,n){var r,i,a,o,s,u,c,l,f,d;if(r=new Hr(t.qf().a,t.qf().b,t.rf().a,t.rf().b),i=new TE,e.c)for(o=new fz(t.wf());o.ac&&(r.a+=M3(Je(tyw,eHl,25,-c,15,1))),r.a+="Is",x7(u,e_n(32))>=0)for(i=0;i=r.o.b/2}v?(g=Pp(e_k(r,(eBU(),tnI)),15))?d?a=g:(i=Pp(e_k(r,ttB),15))?a=g.gc()<=i.gc()?g:i:(a=new p0,eo3(r,ttB,a)):(a=new p0,eo3(r,tnI,a)):(i=Pp(e_k(r,(eBU(),ttB)),15))?f?a=i:(g=Pp(e_k(r,tnI),15))?a=i.gc()<=g.gc()?i:g:(a=new p0,eo3(r,tnI,a)):(a=new p0,eo3(r,ttB,a)),a.Fc(e),eo3(e,(eBU(),ttH),n),t.d==n?(Go(t,null),n.e.c.length+n.g.c.length==0&&Gc(n,null),esQ(n)):(Gs(t,null),n.e.c.length+n.g.c.length==0&&Gc(n,null)),HC(t.a)}function eYH(e,t){var n,r,i,a,o,s,u,l,f,d,h,p,b,m,g,v,y,w,_,E,S,k,x,T,M,O,A,L;for(y=new KB(e.b,0),f=t.Kc(),b=0,l=Pp(f.Pb(),19).a,E=0,n=new bV,k=new Tw;y.b=e.a&&(r=eN3(e,y),f=eB4.Math.max(f,r.b),_=eB4.Math.max(_,r.d),P_(s,new kD(y,r)));for(l=0,x=new p0;l0),g.a.Xb(g.c=--g.b),T=new By(e.b),CD(g,T),A5(g.b0?(c=0,m&&(c+=s),c+=(x-1)*o,y&&(c+=s),k&&y&&(c=eB4.Math.max(c,eAD(y,o,v,S))),!(c0){for(i=0,d=l<100?null:new yf(l),p=(c=new eiP(t)).g,g=Je(ty_,eHT,25,l,15,1),r=0,w=new eta(l);i=0;)if(null!=h?ecX(h,p[u]):xc(h)===xc(p[u])){g.length<=r&&(m=g,g=Je(ty_,eHT,25,2*g.length,15,1),ePD(m,0,g,0,r)),g[r++]=i,JL(w,p[u]);break v}if(xc(h)===xc(s))break}}if(c=w,p=w.g,l=r,r>g.length&&(m=g,g=Je(ty_,eHT,25,r,15,1),ePD(m,0,g,0,r)),r>0){for(a=0,y=!0;a=0;)egk(e,g[o]);if(r!=l){for(i=l;--i>=r;)egk(c,i);m=g,g=Je(ty_,eHT,25,r,15,1),ePD(m,0,g,0,r)}t=c}}}else for(t=egh(e,t),i=e.i;--i>=0;)t.Hc(e.g[i])&&(egk(e,i),y=!0);if(!y)return!1;if(null!=g){for(f=1==(n=t.gc())?Gt(e,4,t.Kc().Pb(),null,g[0],b):Gt(e,6,t,g,g[0],b),d=n<100?null:new yf(n),i=t.Kc();i.Ob();)d=IW(e,Pp(h=i.Pb(),72),d);d?(d.Ei(f),d.Fi()):eam(e.e,f)}else{for(d=IP(t.gc()),i=t.Kc();i.Ob();)d=IW(e,Pp(h=i.Pb(),72),d);d&&d.Fi()}return!0}function eYV(e,t){var n,r,i,a,o,s,u,l,f,d,h,p,b,m,g,v,y,w;for((n=new eb_(t)).a||eDc(t),l=eCx(t),u=new zu,g=new eLy,m=new fz(t.a);m.a0||n.o==tuS&&i0?(f=Pp(RJ(d.c.a,o-1),10),k=Mj(e.b,d,f),m=d.n.b-d.d.d-(f.n.b+f.o.b+f.d.a+k)):m=d.n.b-d.d.d,c=eB4.Math.min(m,c),oo?eIc(e,t,n):eIc(e,n,t),io?1:0}return r=Pp(e_k(t,(eBU(),tnu)),19).a,a=Pp(e_k(n,tnu),19).a,r>a?eIc(e,t,n):eIc(e,n,t),ra?1:0}function eYQ(e,t,n,r){var i,a,o,s,u,c,l,f,d,h,p,b,m,g,v;if(gN(LK(eT9(t,(eBB(),thI))))||(c=0!=(t.a||(t.a=new FQ(e5k,t,10,11)),t.a).i,l=!(f=ekq(t)).dc(),!c&&!l))return Hj(),Hj(),e2r;if(!(i=Pp(eT9(t,th5),149)))throw p7(new gq("Resolved algorithm is not set; apply a LayoutAlgorithmResolver before computing layout."));if(v=ka(i,(eTy(),tmC)),ept(t),!c&&l&&!v)return Hj(),Hj(),e2r;if(u=new p0,xc(eT9(t,thl))===xc((eck(),tpz))&&(ka(i,tmO)||ka(i,tmM)))for(h=eCL(e,t),er7(p=new _n,(t.a||(t.a=new FQ(e5k,t,10,11)),t.a));0!=p.b;)ept(d=Pp(0==p.b?null:(A5(0!=p.b),etw(p,p.a.a)),33)),(g=xc(eT9(d,thl))===xc(tpW))||X2(d,tdQ)&&!Zs(i,eT9(d,th5))?(s=eYQ(e,d,n,r),eoc(u,s),ebu(d,thl,tpW),eIU(d)):er7(p,(d.a||(d.a=new FQ(e5k,d,10,11)),d.a));else for(h=(t.a||(t.a=new FQ(e5k,t,10,11)),t.a).i,o=new Ow((t.a||(t.a=new FQ(e5k,t,10,11)),t.a));o.e!=o.i.gc();)a=Pp(epH(o),33),s=eYQ(e,a,n,r),eoc(u,s),eIU(a);for(m=new fz(u);m.a=0?ef8(s):elC(ef8(s)),e.Ye(tob,h)),c=new yb,d=!1,e.Xe(tou)?(Lf(c,Pp(e.We(tou),8)),d=!0):Oc(c,o.a/2,o.b/2),h.g){case 4:eo3(l,taY,(ef_(),tnN)),eo3(l,ttV,(eoG(),te0)),l.o.b=o.b,b<0&&(l.o.a=-b),ekv(f,(eYu(),tby)),d||(c.a=o.a),c.a-=o.a;break;case 2:eo3(l,taY,(ef_(),tnR)),eo3(l,ttV,(eoG(),teQ)),l.o.b=o.b,b<0&&(l.o.a=-b),ekv(f,(eYu(),tbY)),d||(c.a=0);break;case 1:eo3(l,tt8,(Q1(),ttN)),l.o.a=o.a,b<0&&(l.o.b=-b),ekv(f,(eYu(),tbj)),d||(c.b=o.b),c.b-=o.b;break;case 3:eo3(l,tt8,(Q1(),ttI)),l.o.a=o.a,b<0&&(l.o.b=-b),ekv(f,(eYu(),tbw)),d||(c.b=0)}if(Lf(f.n,c),eo3(l,tou,c),t==tba||t==tbs||t==tbo){if(p=0,t==tba&&e.Xe(tof))switch(h.g){case 1:case 2:p=Pp(e.We(tof),19).a;break;case 3:case 4:p=-Pp(e.We(tof),19).a}else switch(h.g){case 4:case 2:p=a.b,t==tbs&&(p/=i.b);break;case 1:case 3:p=a.a,t==tbs&&(p/=i.a)}eo3(l,tnv,p)}return eo3(l,tt1,h),l}function eY0(e){var t,n,r,i,a,o,s,u,l,f,d,h,p,b,m,g,v,y,w,_,E,S,k,x,T;if((n=gP(LV(e_k(e.a.j,(eBy(),tar)))))<-1||!e.a.i||IR(Pp(e_k(e.a.o,tol),98))||2>efr(e.a.o,(eYu(),tby)).gc()&&2>efr(e.a.o,tbY).gc())return!0;if(e.a.c.Rf())return!1;for(E=0,_=0,w=new p0,u=e.a.e,l=0,f=u.length;l=n}function eY2(){function n(e){var t=this;this.dispatch=function(t){var n=t.data;switch(n.cmd){case"algorithms":var r=edh((Hj(),new fF(new fT(tmF.b))));e.postMessage({id:n.id,data:r});break;case"categories":var i=edh((Hj(),new fF(new fT(tmF.c))));e.postMessage({id:n.id,data:i});break;case"options":var a=edh((Hj(),new fF(new fT(tmF.d))));e.postMessage({id:n.id,data:a});break;case"register":ejy(n.algorithms),e.postMessage({id:n.id});break;case"layout":ePu(n.graph,n.layoutOptions||{},n.options||{}),e.postMessage({id:n.id,data:n.graph})}},this.saveDispatch=function(n){try{t.dispatch(n)}catch(r){e.postMessage({id:n.data.id,error:r})}}}function r(e){var t=this;this.dispatcher=new n({postMessage:function(e){t.onmessage({data:e})}}),this.postMessage=function(e){setTimeout(function(){t.dispatcher.saveDispatch({data:e})},0)}}if(yC(),typeof document===e$E&&typeof self!==e$E){var i=new n(self);self.onmessage=i.saveDispatch}else"object"!==e$E&&e.exports&&(Object.defineProperty(t,"__esModule",{value:!0}),e.exports={default:r,Worker:r})}function eY3(e){e.N||(e.N=!0,e.b=eak(e,0),er5(e.b,0),er5(e.b,1),er5(e.b,2),e.bb=eak(e,1),er5(e.bb,0),er5(e.bb,1),e.fb=eak(e,2),er5(e.fb,3),er5(e.fb,4),er8(e.fb,5),e.qb=eak(e,3),er5(e.qb,0),er8(e.qb,1),er8(e.qb,2),er5(e.qb,3),er5(e.qb,4),er8(e.qb,5),er5(e.qb,6),e.a=eax(e,4),e.c=eax(e,5),e.d=eax(e,6),e.e=eax(e,7),e.f=eax(e,8),e.g=eax(e,9),e.i=eax(e,10),e.j=eax(e,11),e.k=eax(e,12),e.n=eax(e,13),e.o=eax(e,14),e.p=eax(e,15),e.q=eax(e,16),e.s=eax(e,17),e.r=eax(e,18),e.t=eax(e,19),e.u=eax(e,20),e.v=eax(e,21),e.w=eax(e,22),e.B=eax(e,23),e.A=eax(e,24),e.C=eax(e,25),e.D=eax(e,26),e.F=eax(e,27),e.G=eax(e,28),e.H=eax(e,29),e.J=eax(e,30),e.I=eax(e,31),e.K=eax(e,32),e.M=eax(e,33),e.L=eax(e,34),e.P=eax(e,35),e.Q=eax(e,36),e.R=eax(e,37),e.S=eax(e,38),e.T=eax(e,39),e.U=eax(e,40),e.V=eax(e,41),e.X=eax(e,42),e.W=eax(e,43),e.Y=eax(e,44),e.Z=eax(e,45),e.$=eax(e,46),e._=eax(e,47),e.ab=eax(e,48),e.cb=eax(e,49),e.db=eax(e,50),e.eb=eax(e,51),e.gb=eax(e,52),e.hb=eax(e,53),e.ib=eax(e,54),e.jb=eax(e,55),e.kb=eax(e,56),e.lb=eax(e,57),e.mb=eax(e,58),e.nb=eax(e,59),e.ob=eax(e,60),e.pb=eax(e,61))}function eY4(e,t){var n,r,i,a,o,s,u,c,l,f,d,h,p,b,m,g,v,y,w;if(v=0,0==t.f.a)for(m=new fz(e);m.ac&&0==(GK(c,t.c.length),Pp(t.c[c],200)).a.c.length;)QA(t,(GK(c,t.c.length),t.c[c]));if(!u){--a;continue}if(eDk(t,l,i,u,d,n,c,r)){f=!0;continue}if(d){if(ePx(t,l,i,u,n,c,r)){f=!0;continue}if(eu4(l,i)){i.c=!0,f=!0;continue}}else if(eu4(l,i)){i.c=!0,f=!0;continue}if(f)continue}if(eu4(l,i)){i.c=!0,f=!0,u&&(u.k=!1);continue}emG(i.q)}return f}function eY8(e,t,n,r,i,a,o){var s,u,c,l,f,d,h,p,b,m,g,v,y,w,_,E,S,k,x,T,M,O,A,L;for(b=0,T=0,c=new fz(e.b);c.ab&&(a&&(xL(E,h),xL(k,ell(l.b-1)),P_(e.d,p),s.c=Je(e1R,eUp,1,0,5,1)),A=n.b,L+=h+t,h=0,f=eB4.Math.max(f,n.b+n.c+O)),s.c[s.c.length]=u,epW(u,A,L),f=eB4.Math.max(f,A+O+n.c),h=eB4.Math.max(h,d),A+=O+t,p=u;if(eoc(e.a,s),P_(e.d,Pp(RJ(s,s.c.length-1),157)),f=eB4.Math.max(f,r),(M=L+h+n.a)1&&(o=eB4.Math.min(o,eB4.Math.abs(Pp(ep3(s.a,1),8).b-l.b)))));else for(b=new fz(t.j);b.ai&&(a=d.a-i,o=eUu,r.c=Je(e1R,eUp,1,0,5,1),i=d.a),d.a>=i&&(r.c[r.c.length]=s,s.a.b>1&&(o=eB4.Math.min(o,eB4.Math.abs(Pp(ep3(s.a,s.a.b-2),8).b-d.b)))));if(0!=r.c.length&&a>t.o.a/2&&o>t.o.b/2){for(h=new eES,Gc(h,t),ekv(h,(eYu(),tbw)),h.n.a=t.o.a/2,g=new eES,Gc(g,t),ekv(g,tbj),g.n.a=t.o.a/2,g.n.b=t.o.b,u=new fz(r);u.a=c.b?Gs(s,g):Gs(s,h)):(c=Pp(P$(s.a),8),(m=0==s.a.b?GX(s.c):Pp(AZ(s.a),8)).b>=c.b?Go(s,g):Go(s,h)),(f=Pp(e_k(s,(eBy(),taR)),74))&&eds(f,c,!0);t.n.a=i-t.o.a/2}}function eBe(e,t,n){var r,i,a,o,s,u,c,l,f,d,h,p,b,m,g,v,y,w,_,E,S,k,x,T,M,O,A,L,C,I;if(T=null,O=t,M=V0(e,VF(n),O),ert(M,KJ(O,eXS)),A=Pp(etJ(e.g,ekZ(zR(O,eXi))),33),d=zR(O,"sourcePort"),r=null,d&&(r=ekZ(d)),L=Pp(etJ(e.j,r),118),!A)throw b=(p="An edge must have a source node (edge id: '"+(s=ehM(O)))+eXO,p7(new gK(b));if(L&&!BG(zY(L),A))throw g=(m="The source port of an edge must be a port of the edge's source node (edge id: '"+(u=KJ(O,eXS)))+eXO,p7(new gK(g));if(k=(M.b||(M.b=new Ih(e5m,M,4,7)),M.b),a=null,JL(k,a=L||A),C=Pp(etJ(e.g,ekZ(zR(O,eXC))),33),h=zR(O,"targetPort"),i=null,h&&(i=ekZ(h)),I=Pp(etJ(e.j,i),118),!C)throw y=(v="An edge must have a target node (edge id: '"+(f=ehM(O)))+eXO,p7(new gK(y));if(I&&!BG(zY(I),C))throw _=(w="The target port of an edge must be a port of the edge's target node (edge id: '"+(c=KJ(O,eXS)))+eXO,p7(new gK(_));if(x=(M.c||(M.c=new Ih(e5m,M,5,8)),M.c),o=null,JL(x,o=I||C),0==(M.b||(M.b=new Ih(e5m,M,4,7)),M.b).i||0==(M.c||(M.c=new Ih(e5m,M,5,8)),M.c).i)throw S=(E=eXM+(l=KJ(O,eXS)))+eXO,p7(new gK(S));return ewU(O,M),eMu(O,M),T=esv(e,O,M)}function eBt(e,t){var n,r,i,a,o,s,u,c,l,f,d,h,p,b,m,g,v,y,w,_,E,S,k,x,T;return f=eNf(A_(e,(eYu(),tbx)),t),p=em8(A_(e,tbT),t),w=em8(A_(e,tbN),t),k=em9(A_(e,tbR),t),d=em9(A_(e,tb_),t),v=em8(A_(e,tbD),t),b=em8(A_(e,tbM),t),E=em8(A_(e,tbP),t),_=em8(A_(e,tbE),t),x=em9(A_(e,tbk),t),g=em8(A_(e,tbC),t),y=em8(A_(e,tbL),t),S=em8(A_(e,tbS),t),T=em9(A_(e,tbI),t),h=em9(A_(e,tbO),t),m=em8(A_(e,tbA),t),n=esm(eow(vx(tyx,1),eH6,25,15,[v.a,k.a,E.a,T.a])),r=esm(eow(vx(tyx,1),eH6,25,15,[p.a,f.a,w.a,m.a])),i=g.a,a=esm(eow(vx(tyx,1),eH6,25,15,[b.a,d.a,_.a,h.a])),c=esm(eow(vx(tyx,1),eH6,25,15,[v.b,p.b,b.b,y.b])),u=esm(eow(vx(tyx,1),eH6,25,15,[k.b,f.b,d.b,m.b])),l=x.b,s=esm(eow(vx(tyx,1),eH6,25,15,[E.b,w.b,_.b,S.b])),JD(A_(e,tbx),n+i,c+l),JD(A_(e,tbA),n+i,c+l),JD(A_(e,tbT),n+i,0),JD(A_(e,tbN),n+i,c+l+u),JD(A_(e,tbR),0,c+l),JD(A_(e,tb_),n+i+r,c+l),JD(A_(e,tbM),n+i+r,0),JD(A_(e,tbP),0,c+l+u),JD(A_(e,tbE),n+i+r,c+l+u),JD(A_(e,tbk),0,c),JD(A_(e,tbC),n,0),JD(A_(e,tbS),0,c+l+u),JD(A_(e,tbO),n+i+r,0),(o=new yb).a=esm(eow(vx(tyx,1),eH6,25,15,[n+r+i+a,x.a,y.a,S.a])),o.b=esm(eow(vx(tyx,1),eH6,25,15,[c+u+l+s,g.b,T.b,h.b])),o}function eBn(e){var t,n,r,i,a,o,s,u,l,f,d,h,p,b,m,g;for(m=new p0,h=new fz(e.d.b);h.ai.d.d+i.d.a?f.f.d=!0:(f.f.d=!0,f.f.a=!0))),r.b!=r.d.c&&(t=n);f&&(a=Pp(Bp(e.f,o.d.i),57),t.ba.d.d+a.d.a?f.f.d=!0:(f.f.d=!0,f.f.a=!0))}for(s=new Fa(OH(efu(p).a.Kc(),new c));eTk(s);)0!=(o=Pp(ZC(s),17)).a.b&&(t=Pp(AZ(o.a),8),o.d.j==(eYu(),tbw)&&((g=new ePe(t,new kl(t.a,i.d.d),i,o)).f.a=!0,g.a=o.d,m.c[m.c.length]=g),o.d.j==tbj&&((g=new ePe(t,new kl(t.a,i.d.d+i.d.a),i,o)).f.d=!0,g.a=o.d,m.c[m.c.length]=g))}return m}function eBr(e,t,n){var r,i,a,o,s,u,c,l,f;if(ewG(n,"Network simplex node placement",1),e.e=t,e.n=Pp(e_k(t,(eBU(),tnx)),304),eRx(e),ey9(e),_r(eeh(new R1(null,new Gq(e.e.b,16)),new i2),new hR(e)),_r(UJ(eeh(UJ(eeh(new R1(null,new Gq(e.e.b,16)),new aa),new ao),new as),new au),new hP(e)),gN(LK(e_k(e.e,(eBy(),taQ))))&&(o=eiI(n,1),ewG(o,"Straight Edges Pre-Processing",1),eFy(e),eEj(o)),ebR(e.f),a=Pp(e_k(t,to$),19).a*e.f.a.c.length,eIX(vC(vI(DN(e.f),a),!1),eiI(n,1)),0!=e.d.a.gc()){for(o=eiI(n,1),ewG(o,"Flexible Where Space Processing",1),s=Pp(Af(FM(UQ(new R1(null,new Gq(e.f.a,16)),new i3),new iZ)),19).a,c=(u=Pp(Af(FT(UQ(new R1(null,new Gq(e.f.a,16)),new i4),new iX)),19).a)-s,l=Al(new b1,e.f),f=Al(new b1,e.f),eAx(_f(_l(_c(_d(new bQ,2e4),c),l),f)),_r(UJ(UJ(Yw(e.i),new i6),new i5),new Hn(s,l,c,f)),i=e.d.a.ec().Kc();i.Ob();)(r=Pp(i.Pb(),213)).g=1;eIX(vC(vI(DN(e.f),a),!1),eiI(o,1)),eEj(o)}gN(LK(e_k(t,taQ)))&&(o=eiI(n,1),ewG(o,"Straight Edges Post-Processing",1),eSf(e),eEj(o)),ej3(e),e.e=null,e.f=null,e.i=null,e.c=null,Yy(e.k),e.j=null,e.a=null,e.o=null,e.d.a.$b(),eEj(n)}function eBi(e,t,n){var r,i,a,o,s,u,c,l,f,d,h,p,b,m,g,v,y,w,_;for(s=new fz(e.a.b);s.a0){if(r=f.gc(),c=zy(eB4.Math.floor((r+1)/2))-1,i=zy(eB4.Math.ceil((r+1)/2))-1,t.o==tuS)for(l=i;l>=c;l--)t.a[w.p]==w&&(b=Pp(f.Xb(l),46),p=Pp(b.a,10),!w0(n,b.b)&&h>e.b.e[p.p]&&(t.a[p.p]=w,t.g[w.p]=t.g[p.p],t.a[w.p]=t.g[w.p],t.f[t.g[w.p].p]=(OQ(),!!(gN(t.f[t.g[w.p].p])&w.k==(eEn(),e9D))),h=e.b.e[p.p]));else for(l=c;l<=i;l++)t.a[w.p]==w&&(g=Pp(f.Xb(l),46),m=Pp(g.a,10),!w0(n,g.b)&&h=p&&(v>p&&(h.c=Je(e1R,eUp,1,0,5,1),p=v),h.c[h.c.length]=o);0!=h.c.length&&(d=Pp(RJ(h,ebO(t,h.c.length)),128),M.a.Bc(d),d.s=b++,eM4(d,x,E),h.c=Je(e1R,eUp,1,0,5,1))}for(w=e.c.length+1,s=new fz(e);s.aT.s&&(BH(n),QA(T.i,r),r.c>0&&(r.a=T,P_(T.t,r),r.b=S,P_(S.i,r)))}function eBs(e){var t,n,r,i,a;switch(t=e.c){case 11:return e.Ml();case 12:return e.Ol();case 14:return e.Ql();case 15:return e.Tl();case 16:return e.Rl();case 17:return e.Ul();case 21:return eBM(e),eBG(),eBG(),tye;case 10:switch(e.a){case 65:return e.yl();case 90:return e.Dl();case 122:return e.Kl();case 98:return e.El();case 66:return e.zl();case 60:return e.Jl();case 62:return e.Hl()}}switch(a=eY9(e),t=e.c){case 3:return e.Zl(a);case 4:return e.Xl(a);case 5:return e.Yl(a);case 0:if(123==e.a&&e.d=48&&t<=57){for(r=t-48;i=48&&t<=57;)if((r=10*r+t-48)<0)throw p7(new gX(eBJ((Mo(),eJ_))))}else throw p7(new gX(eBJ((Mo(),eJg))));if(n=r,44==t){if(i>=e.j)throw p7(new gX(eBJ((Mo(),eJy))));if((t=UI(e.i,i++))>=48&&t<=57){for(n=t-48;i=48&&t<=57;)if((n=10*n+t-48)<0)throw p7(new gX(eBJ((Mo(),eJ_))));if(r>n)throw p7(new gX(eBJ((Mo(),eJw))))}else n=-1}if(125!=t)throw p7(new gX(eBJ((Mo(),eJv))));e.sl(i)?(a=(eBG(),eBG(),++tyv,new qa(9,a)),e.d=i+1):(a=(eBG(),eBG(),++tyv,new qa(3,a)),e.d=i),a.dm(r),a.cm(n),eBM(e)}}return a}function eBu(e,t,n,r,i){var a,o,s,u,c,l,f,d,h,p,b,m,g,v,y,w,_,E,S,k,x,T,M;for(b=new XM(t.b),w=new XM(t.b),d=new XM(t.b),k=new XM(t.b),m=new XM(t.b),S=epL(t,0);S.b!=S.d.c;)for(_=Pp(Vv(S),11),s=new fz(_.g);s.a0,g=_.g.c.length>0,c&&g?d.c[d.c.length]=_:c?b.c[b.c.length]=_:g&&(w.c[w.c.length]=_);for(p=new fz(b);p.aefT(Jh(y.d,x),Jh(y.d,y.a))&&(a.c[a.c.length]=y);for(n.c=Je(e1R,eUp,1,0,5,1),w=new fz(a);w.a1)for(p=new AF((e.a||(e.a=new FQ(e5v,e,6,6)),e.a));p.e!=p.i.gc();)ey_(p);for(o=Pp(etj((e.a||(e.a=new FQ(e5v,e,6,6)),e.a),0),202),m=A,A>_+w?m=_+w:A<_-w&&(m=_-w),g=L,L>E+b?g=E+b:L_-w&&m<_+w&&g>E-b&&gA+O?k=A+O:_L+S?x=L+S:EA-O&&kL-S&&xn&&(d=n-1),(h=P+eMU(t,24)*e$h*f-f/2)<0?h=1:h>r&&(h=r-1),i=(yT(),u=new oJ),ent(i,d),enn(i,h),JL((o.a||(o.a=new O_(e5h,o,5)),o.a),i)}function eBy(){eBy=A,tox=(eBB(),th7),toT=tpe,toM=tpt,toO=tpn,toL=tpr,toC=tpi,toN=tpo,toR=tpu,toj=tpc,toP=tps,toF=tpl,toB=tpf,toH=tpp,toD=tpa,tok=(eBH(),tih),toA=tip,toI=tib,toY=tim,tov=new T2(th4,ell(0)),toy=til,tow=tif,to_=tid,toQ=tiB,toG=tiy,toW=tiE,toq=tiL,toK=tix,toV=tiM,to0=tiG,to1=tiH,toX=tiR,toZ=tiN,toJ=tiF,ta0=tit,ta2=tin,taE=trE,taS=trx,toe=new T3(12),ta7=new T2(thN,toe),tav=(efE(),tpx),tag=new T2(tha,tav),toc=new T2(thK,0),toE=new T2(th6,ell(1)),tiX=new T2(td2,eGt),ta9=thI,tol=thV,tob=th0,tac=td7,tiq=td1,taM=thl,toS=new T2(th9,(OQ(),!0)),taI=thh,taD=thp,ta4=thx,ta8=thL,ta6=thM,tad=(ec3(),tpv),tal=new T2(the,tad),taZ=thS,taq=th_,toh=thJ,tod=thX,top=th1,tor=(epT(),tbr),new T2(thB,tor),toa=th$,too=thz,tos=thG,toi=thH,toz=tiv,taG=trZ,taz=trV,to$=tig,taY=trB,tau=trs,tas=tra,ti7=tn1,tae=tn0,tan=tn5,tat=tn2,tao=trr,taK=trJ,taV=trQ,taP=trD,ta3=tio,taJ=tr3,tax=trO,ta1=tr7,taw=trg,ta_=trw,ti9=td8,taX=tr1,ti0=tn$,ti1=tnU,tiQ=tnB,taA=trC,taO=trL,taL=trI,ta5=thO,taR=thg,tak=ths,tab=thr,tap=thn,tar=tn7,tof=thZ,tiJ=td5,taC=thd,tou=thW,tot=thR,ton=thF,taU=tr$,taH=trG,tog=th3,tiZ=tnY,ta$=trK,tam=trh,tah=trf,taW=thy,taj=trj,taQ=tr5,toU=tpd,taf=trc,tom=tiu,tay=trb,taF=trY,tai=trt,taN=thm,taB=trH,taa=trn,ti8=tnJ,ti6=tnq,ti3=tnK,ti4=tnV,ti5=tnX,ti2=tnG,taT=trA}function eBw(e,t){var n,r,i,a,o,s,u,c,l,f,d,h,p,b,m,g,v,y,w,_,E,S,k,x,T,M,O,A;if(ePN(),k=e.e,p=e.d,i=e.a,0==k)switch(t){case 0:return"0";case 1:return e$e;case 2:return"0.00";case 3:return"0.000";case 4:return"0.0000";case 5:return"0.00000";case 6:return"0.000000";default:return E=new vc,t<0?(E.a+="0E+",E):(E.a+="0E",E),E.a+=-t,E.a}if(w=Je(tyw,eHl,25,(y=10*p+1+7)+1,15,1),n=y,1==p){if((s=i[0])<0){A=WM(s,eH9);do b=A,A=eyt(A,10),w[--n]=48+jE(efe(b,efn(A,10)))&eHd;while(0!=ecd(A,0))}else{A=s;do b=A,A=A/10|0,w[--n]=48+(b-10*A)&eHd;while(0!=A)}}else{T=Je(ty_,eHT,25,p,15,1),ePD(i,0,T,0,O=p);I:for(;;){for(S=0,c=O-1;c>=0;c--)g=ewT(M=eft(Fg(S,32),WM(T[c],eH9))),T[c]=jE(g),S=jE(Fv(g,32));v=jE(S),m=n;do w[--n]=48+v%10&eHd;while(0!=(v=v/10|0)&&0!=n)for(u=0,r=9-m+n;u0;u++)w[--n]=48;for(f=O-1;0==T[f];f--)if(0==f)break I;O=f+1}for(;48==w[n];)++n}if(h=k<0,o=y-n-t-1,0==t)return h&&(w[--n]=45),ehv(w,n,y-n);if(t>0&&o>=-6){if(o>=0){for(l=n+o,d=y-1;d>=l;d--)w[d+1]=w[d];return w[++l]=46,h&&(w[--n]=45),ehv(w,n,y-n+1)}for(f=2;f<-o+1;f++)w[--n]=48;return w[--n]=46,w[--n]=48,h&&(w[--n]=45),ehv(w,n,y-n)}return x=n+1,a=y,_=new vl,h&&(_.a+="-"),a-x>=1?(Bd(_,w[n]),_.a+=".",_.a+=ehv(w,n+1,y-n-1)):_.a+=ehv(w,n,y-n),_.a+="E",o>0&&(_.a+="+"),_.a+=""+o,_.a}function eB_(e,t){var n,r,i,a,o,s,u,c,l,f,d,h,p,b,m,g,v,y,w,_,E;switch(e.c=t,e.g=new p2,n=(_q(),new gM(e.c)),efJ(r=new dp(n)),y=Lq(eT9(e.c,(e_L(),tfD))),u=Pp(eT9(e.c,tfP),316),_=Pp(eT9(e.c,tfR),429),o=Pp(eT9(e.c,tfO),482),w=Pp(eT9(e.c,tfN),430),e.j=gP(LV(eT9(e.c,tfj))),s=e.a,u.g){case 0:s=e.a;break;case 1:s=e.b;break;case 2:s=e.i;break;case 3:s=e.e;break;case 4:s=e.f;break;default:throw p7(new gL(eqN+(null!=u.f?u.f:""+u.g)))}if(e.d=new zM(s,_,o),eo3(e.d,(ei5(),e5F),LK(eT9(e.c,tfL))),e.d.c=gN(LK(eT9(e.c,tfA))),0==H9(e.c).i)return e.d;for(f=new Ow(H9(e.c));f.e!=f.i.gc();){for(h=(l=Pp(epH(f),33)).g/2,d=l.f/2,E=new kl(l.i+h,l.j+d);F8(e.g,E);)Lu(E,(eB4.Math.random()-.5)*ez9,(eB4.Math.random()-.5)*ez9);b=Pp(eT9(l,(eBB(),thy)),142),m=new Gd(E,new Hr(E.a-h-e.j/2-b.b,E.b-d-e.j/2-b.d,l.g+e.j+(b.b+b.c),l.f+e.j+(b.d+b.a))),P_(e.d.i,m),Um(e.g,E,new kD(m,l))}switch(w.g){case 0:if(null==y)e.d.d=Pp(RJ(e.d.i,0),65);else for(v=new fz(e.d.i);v.a1&&qQ(l,g,l.c.b,l.c),etu(i)));g=v}return l}function eBS(e,t,n){var r,i,a,o,s,u,c,l,f,d,h,p,b,m,g,v,y,w,_,E,S,k,x,T,M,O,A,L,C,I,D;for(ewG(n,"Greedy cycle removal",1),D=(y=t.a).c.length,e.a=Je(ty_,eHT,25,D,15,1),e.c=Je(ty_,eHT,25,D,15,1),e.b=Je(ty_,eHT,25,D,15,1),c=0,g=new fz(y);g.a0?O+1:1);for(o=new fz(E.g);o.a0?O+1:1)}0==e.c[c]?P7(e.e,b):0==e.a[c]&&P7(e.f,b),++c}for(p=-1,h=1,f=new p0,e.d=Pp(e_k(t,(eBU(),tnw)),230);D>0;){for(;0!=e.e.b;)L=Pp(PH(e.e),10),e.b[L.p]=p--,eIQ(e,L),--D;for(;0!=e.f.b;)C=Pp(PH(e.f),10),e.b[C.p]=h++,eIQ(e,C),--D;if(D>0){for(d=eHt,v=new fz(y);v.a=d&&(w>d&&(f.c=Je(e1R,eUp,1,0,5,1),d=w),f.c[f.c.length]=b);l=e.Zf(f),e.b[l.p]=h++,eIQ(e,l),--D}}for(c=0,A=y.c.length+1;ce.b[I]&&(eNF(r,!0),eo3(t,ttK,(OQ(),!0)));e.a=null,e.c=null,e.b=null,HC(e.f),HC(e.e),eEj(n)}function eBk(e,t){var n,r,i,a,o,s,u,c,l,f,d,h,p,b,m,g;for(r=new p0,s=new p0,m=t/2,h=e.gc(),i=Pp(e.Xb(0),8),g=Pp(e.Xb(1),8),p=eT6(i.a,i.b,g.a,g.b,m),P_(r,(GK(0,p.c.length),Pp(p.c[0],8))),P_(s,(GK(1,p.c.length),Pp(p.c[1],8))),c=2;c=0;u--)P7(n,(GK(u,o.c.length),Pp(o.c[u],8)));return n}function eBx(e){var t,n,r,i,a,o,s,u,c,l,f,d,h;if(o=!0,f=null,r=null,i=null,t=!1,h=tmH,c=null,a=null,(u=epm(e,s=0,tmJ,tmQ))=0&&IE(e.substr(s,2),"//")?(s+=2,u=epm(e,s,tm1,tm0),r=e.substr(s,u-s),s=u):null!=f&&(s==e.length||(GV(s,e.length),47!=e.charCodeAt(s)))&&(o=!1,-1==(u=O7(e,e_n(35),s))&&(u=e.length),r=e.substr(s,u-s),s=u);if(!n&&s0&&58==UI(l,l.length-1)&&(i=l,s=u)),s=e.j){e.a=-1,e.c=1;return}if(t=UI(e.i,e.d++),e.a=t,1==e.b){switch(t){case 92:if(r=10,e.d>=e.j)throw p7(new gX(eBJ((Mo(),eXZ))));e.a=UI(e.i,e.d++);break;case 45:(512&e.e)==512&&e.d=e.j||63!=UI(e.i,e.d))break;if(++e.d>=e.j)throw p7(new gX(eBJ((Mo(),eXX))));switch(t=UI(e.i,e.d++)){case 58:r=13;break;case 61:r=14;break;case 33:r=15;break;case 91:r=19;break;case 62:r=18;break;case 60:if(e.d>=e.j)throw p7(new gX(eBJ((Mo(),eXX))));if(61==(t=UI(e.i,e.d++)))r=16;else if(33==t)r=17;else throw p7(new gX(eBJ((Mo(),eXJ))));break;case 35:for(;e.d=e.j)throw p7(new gX(eBJ((Mo(),eXZ))));e.a=UI(e.i,e.d++);break;default:r=0}e.c=r}function eBO(e){var t,n,r,i,a,o,s,u,l,f,d,h,p,b,m,g,v,y,w,_,E,S,k,x,T,M,O,A;if((k=Pp(e_k(e,(eBy(),tol)),98))!=(ewf(),tbc)&&k!=tbl){for(p=(b=e.b).c.length,f=new XM((enG(p+2,eU5),ee1(eft(eft(5,p+2),(p+2)/10|0)))),m=new XM((enG(p+2,eU5),ee1(eft(eft(5,p+2),(p+2)/10|0)))),P_(f,new p2),P_(f,new p2),P_(m,new p0),P_(m,new p0),S=new p0,t=0;t=E||!ehf(v,r))&&(r=GY(t,f)),Gu(v,r),a=new Fa(OH(efu(v).a.Kc(),new c));eTk(a);)i=Pp(ZC(a),17),!e.a[i.p]&&(m=i.c.i,--e.e[m.p],0==e.e[m.p]&&Ja(e_s(p,m)));for(l=f.c.length-1;l>=0;--l)P_(t.b,(GK(l,f.c.length),Pp(f.c[l],29)));t.a.c=Je(e1R,eUp,1,0,5,1),eEj(n)}function eBL(e){var t,n,r,i,a,o,s,u,c;for(e.b=1,eBM(e),t=null,0==e.c&&94==e.a?(eBM(e),t=(eBG(),eBG(),++tyv,new WZ(4)),eLw(t,0,e1f),s=(++tyv,new WZ(4))):s=(eBG(),eBG(),++tyv,new WZ(4)),i=!0;1!=(c=e.c);){if(0==c&&93==e.a&&!i){t&&(ej0(t,s),s=t);break}if(n=e.a,r=!1,10==c)switch(n){case 100:case 68:case 119:case 87:case 115:case 83:ePR(s,eDu(n)),r=!0;break;case 105:case 73:case 99:case 67:(n=(ePR(s,eDu(n)),-1))<0&&(r=!0);break;case 112:case 80:if(!(u=ext(e,n)))throw p7(new gX(eBJ((Mo(),eJe))));ePR(s,u),r=!0;break;default:n=eCn(e)}else if(24==c&&!i){if(t&&(ej0(t,s),s=t),a=eBL(e),ej0(s,a),0!=e.c||93!=e.a)throw p7(new gX(eBJ((Mo(),eJi))));break}if(eBM(e),!r){if(0==c){if(91==n)throw p7(new gX(eBJ((Mo(),eJa))));if(93==n)throw p7(new gX(eBJ((Mo(),eJo))));if(45==n&&!i&&93!=e.a)throw p7(new gX(eBJ((Mo(),eJs))))}if(0!=e.c||45!=e.a||45==n&&i)eLw(s,n,n);else{if(eBM(e),1==(c=e.c))throw p7(new gX(eBJ((Mo(),eJn))));if(0==c&&93==e.a)eLw(s,n,n),eLw(s,45,45);else if(0==c&&93==e.a||24==c)throw p7(new gX(eBJ((Mo(),eJs))));else{if(o=e.a,0==c){if(91==o)throw p7(new gX(eBJ((Mo(),eJa))));if(93==o)throw p7(new gX(eBJ((Mo(),eJo))));if(45==o)throw p7(new gX(eBJ((Mo(),eJs))))}else 10==c&&(o=eCn(e));if(eBM(e),n>o)throw p7(new gX(eBJ((Mo(),eJl))));eLw(s,n,o)}}}i=!1}if(1==e.c)throw p7(new gX(eBJ((Mo(),eJn))));return eMS(s),eRo(s),e.b=0,eBM(e),s}function eBC(e){eMV(e.c,eJ7,eow(vx(e17,1),eUP,2,6,[eQd,"http://www.w3.org/2001/XMLSchema#decimal"])),eMV(e.d,eJ7,eow(vx(e17,1),eUP,2,6,[eQd,"http://www.w3.org/2001/XMLSchema#integer"])),eMV(e.e,eJ7,eow(vx(e17,1),eUP,2,6,[eQd,"http://www.w3.org/2001/XMLSchema#boolean"])),eMV(e.f,eJ7,eow(vx(e17,1),eUP,2,6,[eQd,"EBoolean",eXP,"EBoolean:Object"])),eMV(e.i,eJ7,eow(vx(e17,1),eUP,2,6,[eQd,"http://www.w3.org/2001/XMLSchema#byte"])),eMV(e.g,eJ7,eow(vx(e17,1),eUP,2,6,[eQd,"http://www.w3.org/2001/XMLSchema#hexBinary"])),eMV(e.j,eJ7,eow(vx(e17,1),eUP,2,6,[eQd,"EByte",eXP,"EByte:Object"])),eMV(e.n,eJ7,eow(vx(e17,1),eUP,2,6,[eQd,"EChar",eXP,"EChar:Object"])),eMV(e.t,eJ7,eow(vx(e17,1),eUP,2,6,[eQd,"http://www.w3.org/2001/XMLSchema#double"])),eMV(e.u,eJ7,eow(vx(e17,1),eUP,2,6,[eQd,"EDouble",eXP,"EDouble:Object"])),eMV(e.F,eJ7,eow(vx(e17,1),eUP,2,6,[eQd,"http://www.w3.org/2001/XMLSchema#float"])),eMV(e.G,eJ7,eow(vx(e17,1),eUP,2,6,[eQd,"EFloat",eXP,"EFloat:Object"])),eMV(e.I,eJ7,eow(vx(e17,1),eUP,2,6,[eQd,"http://www.w3.org/2001/XMLSchema#int"])),eMV(e.J,eJ7,eow(vx(e17,1),eUP,2,6,[eQd,"EInt",eXP,"EInt:Object"])),eMV(e.N,eJ7,eow(vx(e17,1),eUP,2,6,[eQd,"http://www.w3.org/2001/XMLSchema#long"])),eMV(e.O,eJ7,eow(vx(e17,1),eUP,2,6,[eQd,"ELong",eXP,"ELong:Object"])),eMV(e.Z,eJ7,eow(vx(e17,1),eUP,2,6,[eQd,"http://www.w3.org/2001/XMLSchema#short"])),eMV(e.$,eJ7,eow(vx(e17,1),eUP,2,6,[eQd,"EShort",eXP,"EShort:Object"])),eMV(e._,eJ7,eow(vx(e17,1),eUP,2,6,[eQd,"http://www.w3.org/2001/XMLSchema#string"]))}function eBI(e){var t,n,r,i,a,o,s,u,c,l,f,d,h,p,b,m,g,v,y,w,_,E,S,k,x,T,M,O;if(1==e.c.length)return GK(0,e.c.length),Pp(e.c[0],135);if(e.c.length<=0)return new Xn;for(u=new fz(e);u.af&&(M=0,O+=l+S,l=0),eOd(_,o,M,O),t=eB4.Math.max(t,M+E.a),l=eB4.Math.max(l,E.b),M+=E.a+S;for(w=new p2,n=new p2,x=new fz(e);x.aeMg(a))&&(f=a);for(f||(f=(GK(0,m.c.length),Pp(m.c[0],180))),b=new fz(t.b);b.a=-1900?1:0,n>=4?xM(e,eow(vx(e17,1),eUP,2,6,[eHM,eHO])[s]):xM(e,eow(vx(e17,1),eUP,2,6,["BC","AD"])[s]);break;case 121:epA(e,n,r);break;case 77:eIZ(e,n,r);break;case 107:0==(u=i.q.getHours())?eeE(e,24,n):eeE(e,u,n);break;case 83:eOT(e,n,i);break;case 69:l=r.q.getDay(),5==n?xM(e,eow(vx(e17,1),eUP,2,6,["S","M","T","W","T","F","S"])[l]):4==n?xM(e,eow(vx(e17,1),eUP,2,6,[eHA,eHL,eHC,eHI,eHD,eHN,eHP])[l]):xM(e,eow(vx(e17,1),eUP,2,6,["Sun","Mon","Tue","Wed","Thu","Fri","Sat"])[l]);break;case 97:i.q.getHours()>=12&&24>i.q.getHours()?xM(e,eow(vx(e17,1),eUP,2,6,["AM","PM"])[1]):xM(e,eow(vx(e17,1),eUP,2,6,["AM","PM"])[0]);break;case 104:0==(f=i.q.getHours()%12)?eeE(e,12,n):eeE(e,f,n);break;case 75:eeE(e,d=i.q.getHours()%12,n);break;case 72:eeE(e,h=i.q.getHours(),n);break;case 99:p=r.q.getDay(),5==n?xM(e,eow(vx(e17,1),eUP,2,6,["S","M","T","W","T","F","S"])[p]):4==n?xM(e,eow(vx(e17,1),eUP,2,6,[eHA,eHL,eHC,eHI,eHD,eHN,eHP])[p]):3==n?xM(e,eow(vx(e17,1),eUP,2,6,["Sun","Mon","Tue","Wed","Thu","Fri","Sat"])[p]):eeE(e,p,1);break;case 76:b=r.q.getMonth(),5==n?xM(e,eow(vx(e17,1),eUP,2,6,["J","F","M","A","M","J","J","A","S","O","N","D"])[b]):4==n?xM(e,eow(vx(e17,1),eUP,2,6,[eHh,eHp,eHb,eHm,eHg,eHv,eHy,eHw,eH_,eHE,eHS,eHk])[b]):3==n?xM(e,eow(vx(e17,1),eUP,2,6,["Jan","Feb","Mar","Apr",eHg,"Jun","Jul","Aug","Sep","Oct","Nov","Dec"])[b]):eeE(e,b+1,n);break;case 81:m=r.q.getMonth()/3|0,n<4?xM(e,eow(vx(e17,1),eUP,2,6,["Q1","Q2","Q3","Q4"])[m]):xM(e,eow(vx(e17,1),eUP,2,6,["1st quarter","2nd quarter","3rd quarter","4th quarter"])[m]);break;case 100:eeE(e,g=r.q.getDate(),n);break;case 109:eeE(e,c=i.q.getMinutes(),n);break;case 115:eeE(e,o=i.q.getSeconds(),n);break;case 122:n<4?xM(e,a.c[0]):xM(e,a.c[1]);break;case 118:xM(e,a.b);break;case 90:n<3?xM(e,ekA(a)):3==n?xM(e,ek$(a)):xM(e,ekz(a.a));break;default:return!1}return!0}function eBF(e,t,n,r){var i,a,o,s,u,c,l,f,d,h,p,b,m,g,v,y,w,_,E,S,k,x,T,M,O,A;if(eIi(t),u=Pp(etj((t.b||(t.b=new Ih(e5m,t,4,7)),t.b),0),82),l=Pp(etj((t.c||(t.c=new Ih(e5m,t,5,8)),t.c),0),82),s=ewH(u),c=ewH(l),o=0==(t.a||(t.a=new FQ(e5v,t,6,6)),t.a).i?null:Pp(etj((t.a||(t.a=new FQ(e5v,t,6,6)),t.a),0),202),S=Pp(Bp(e.a,s),10),M=Pp(Bp(e.a,c),10),k=null,O=null,M4(u,186)&&(M4(E=Pp(Bp(e.a,u),299),11)?k=Pp(E,11):M4(E,10)&&(S=Pp(E,10),k=Pp(RJ(S.j,0),11))),M4(l,186)&&(M4(T=Pp(Bp(e.a,l),299),11)?O=Pp(T,11):M4(T,10)&&(M=Pp(T,10),O=Pp(RJ(M.j,0),11))),!S||!M)throw p7(new gZ("The source or the target of edge "+t+" could not be found. This usually happens when an edge connects a node laid out by ELK Layered to a node in another level of hierarchy laid out by either another instance of ELK Layered or another layout algorithm alltogether. The former can be solved by setting the hierarchyHandling option to INCLUDE_CHILDREN."));for(b=new $b,eaW(b,t),eo3(b,(eBU(),tnc),t),eo3(b,(eBy(),taR),null),h=Pp(e_k(r,tt3),21),S==M&&h.Fc((eLR(),ttT)),k||(_=(enY(),tsN),x=null,o&&TM(Pp(e_k(S,tol),98))&&(V2(x=new kl(o.j,o.k),zF(t)),qZ(x,n),etg(c,s)&&(_=tsD,C6(x,S.n))),k=ePH(S,x,_,r)),O||(_=(enY(),tsD),A=null,o&&TM(Pp(e_k(M,tol),98))&&(V2(A=new kl(o.b,o.c),zF(t)),qZ(A,n)),O=ePH(M,A,_,Bq(M))),Gs(b,k),Go(b,O),(k.e.c.length>1||k.g.c.length>1||O.e.c.length>1||O.g.c.length>1)&&h.Fc((eLR(),tt_)),d=new Ow((t.n||(t.n=new FQ(e5S,t,1,7)),t.n));d.e!=d.i.gc();)if(f=Pp(epH(d),137),!gN(LK(eT9(f,ta9)))&&f.a)switch(m=eca(f),P_(b.b,m),Pp(e_k(m,tab),272).g){case 1:case 2:h.Fc((eLR(),tty));break;case 0:h.Fc((eLR(),ttg)),eo3(m,tab,(etT(),tp_))}if(a=Pp(e_k(r,tas),314),g=Pp(e_k(r,ta3),315),i=a==(en7(),teR)||g==(ebG(),tsd),o&&0!=(o.a||(o.a=new O_(e5h,o,5)),o.a).i&&i){for(v=eEF(o),p=new mE,w=epL(v,0);w.b!=w.d.c;)y=Pp(Vv(w),8),P7(p,new TS(y));eo3(b,tnl,p)}return b}function eBY(e){e.gb||(e.gb=!0,e.b=eak(e,0),er5(e.b,18),er8(e.b,19),e.a=eak(e,1),er5(e.a,1),er8(e.a,2),er8(e.a,3),er8(e.a,4),er8(e.a,5),e.o=eak(e,2),er5(e.o,8),er5(e.o,9),er8(e.o,10),er8(e.o,11),er8(e.o,12),er8(e.o,13),er8(e.o,14),er8(e.o,15),er8(e.o,16),er8(e.o,17),er8(e.o,18),er8(e.o,19),er8(e.o,20),er8(e.o,21),er8(e.o,22),er8(e.o,23),ee8(e.o),ee8(e.o),ee8(e.o),ee8(e.o),ee8(e.o),ee8(e.o),ee8(e.o),ee8(e.o),ee8(e.o),ee8(e.o),e.p=eak(e,3),er5(e.p,2),er5(e.p,3),er5(e.p,4),er5(e.p,5),er8(e.p,6),er8(e.p,7),ee8(e.p),ee8(e.p),e.q=eak(e,4),er5(e.q,8),e.v=eak(e,5),er8(e.v,9),ee8(e.v),ee8(e.v),ee8(e.v),e.w=eak(e,6),er5(e.w,2),er5(e.w,3),er5(e.w,4),er8(e.w,5),e.B=eak(e,7),er8(e.B,1),ee8(e.B),ee8(e.B),ee8(e.B),e.Q=eak(e,8),er8(e.Q,0),ee8(e.Q),e.R=eak(e,9),er5(e.R,1),e.S=eak(e,10),ee8(e.S),ee8(e.S),ee8(e.S),ee8(e.S),ee8(e.S),ee8(e.S),ee8(e.S),ee8(e.S),ee8(e.S),ee8(e.S),ee8(e.S),ee8(e.S),ee8(e.S),ee8(e.S),ee8(e.S),e.T=eak(e,11),er8(e.T,10),er8(e.T,11),er8(e.T,12),er8(e.T,13),er8(e.T,14),ee8(e.T),ee8(e.T),e.U=eak(e,12),er5(e.U,2),er5(e.U,3),er8(e.U,4),er8(e.U,5),er8(e.U,6),er8(e.U,7),ee8(e.U),e.V=eak(e,13),er8(e.V,10),e.W=eak(e,14),er5(e.W,18),er5(e.W,19),er5(e.W,20),er8(e.W,21),er8(e.W,22),er8(e.W,23),e.bb=eak(e,15),er5(e.bb,10),er5(e.bb,11),er5(e.bb,12),er5(e.bb,13),er5(e.bb,14),er5(e.bb,15),er5(e.bb,16),er8(e.bb,17),ee8(e.bb),ee8(e.bb),e.eb=eak(e,16),er5(e.eb,2),er5(e.eb,3),er5(e.eb,4),er5(e.eb,5),er5(e.eb,6),er5(e.eb,7),er8(e.eb,8),er8(e.eb,9),e.ab=eak(e,17),er5(e.ab,0),er5(e.ab,1),e.H=eak(e,18),er8(e.H,0),er8(e.H,1),er8(e.H,2),er8(e.H,3),er8(e.H,4),er8(e.H,5),ee8(e.H),e.db=eak(e,19),er8(e.db,2),e.c=eax(e,20),e.d=eax(e,21),e.e=eax(e,22),e.f=eax(e,23),e.i=eax(e,24),e.g=eax(e,25),e.j=eax(e,26),e.k=eax(e,27),e.n=eax(e,28),e.r=eax(e,29),e.s=eax(e,30),e.t=eax(e,31),e.u=eax(e,32),e.fb=eax(e,33),e.A=eax(e,34),e.C=eax(e,35),e.D=eax(e,36),e.F=eax(e,37),e.G=eax(e,38),e.I=eax(e,39),e.J=eax(e,40),e.L=eax(e,41),e.M=eax(e,42),e.N=eax(e,43),e.O=eax(e,44),e.P=eax(e,45),e.X=eax(e,46),e.Y=eax(e,47),e.Z=eax(e,48),e.$=eax(e,49),e._=eax(e,50),e.cb=eax(e,51),e.K=eax(e,52))}function eBB(){var e,t;eBB=A,tdQ=new pO(eZi),th5=new pO(eZa),td0=(ebx(),tdM),td1=new xX(eVi,td0),new pQ,td2=new xX(ezG,null),td3=new pO(eZo),td9=(eyY(),jL(tdX,eow(vx(e64,1),eU4,291,0,[tdK]))),td8=new xX(eVg,td9),td7=new xX(eVr,(OQ(),!1)),tht=(ec3(),tpv),the=new xX(eVu,tht),tho=(efE(),tpO),tha=new xX(eKB,tho),thc=new xX(eqC,!1),thf=(eck(),tpG),thl=new xX(eKP,thf),thP=new T3(12),thN=new xX(ezW,thP),thb=new xX(eGu,!1),thm=new xX(eVA,!1),thD=new xX(eGf,!1),thq=(ewf(),tbl),thV=new xX(eGc,thq),th3=new pO(eVT),th4=new pO(eGr),th6=new pO(eGo),th9=new pO(eGs),thv=new mE,thg=new xX(eVv,thv),td5=new xX(eV_,!1),thd=new xX(eVE,!1),new pO(eZs),thw=new mh,thy=new xX(eVM,thw),thI=new xX(eVt,!1),new pQ,th8=new xX(eZu,1),new xX(eZc,!0),ell(0),new xX(eZl,ell(100)),new xX(eZf,!1),ell(0),new xX(eZd,ell(4e3)),ell(0),new xX(eZh,ell(400)),new xX(eZp,!1),new xX(eZb,!1),new xX(eZm,!0),new xX(eZg,!1),td6=(edM(),tme),td4=new xX(eZr,td6),th7=new xX(eKQ,10),tpe=new xX(eK1,10),tpt=new xX(ez$,20),tpn=new xX(eK0,10),tpr=new xX(eGa,2),tpi=new xX(eK2,10),tpo=new xX(eK3,0),tps=new xX(eK5,5),tpu=new xX(eK4,1),tpc=new xX(eK6,1),tpl=new xX(eGi,20),tpf=new xX(eK8,10),tpp=new xX(eK9,10),tpa=new pO(eK7),tph=new T_,tpd=new xX(eVO,tph),thF=new pO(eVx),thj=!1,thR=new xX(eVk,thj),thE=new T3(5),th_=new xX(eVc,thE),thk=(eT7(),t=Pp(yw(e5t),9),new I1(t,Pp(CY(t,t.length),9),0)),thS=new xX(eGp,thk),thU=(epT(),tbt),thB=new xX(eVd,thU),th$=new pO(eVh),thz=new pO(eVp),thG=new pO(eVb),thH=new pO(eVm),thT=(e=Pp(yw(e5o),9),new I1(e,Pp(CY(e,e.length),9),0)),thx=new xX(eGh,thT),thC=el8((eI3(),tbQ)),thL=new xX(eGd,thC),thA=new kl(0,0),thO=new xX(eGM,thA),thM=new xX(eVs,!1),thi=(etT(),tp_),thr=new xX(eVy,thi),thn=new xX(eGl,!1),new pO(eZv),ell(1),new xX(eZy,null),thW=new pO(eVS),thZ=new pO(eVw),th2=(eYu(),tbF),th0=new xX(eVn,th2),thK=new pO(eVe),thQ=(ekU(),el8(tbm)),thJ=new xX(eGb,thQ),thX=new xX(eVl,!1),th1=new xX(eVf,!0),thh=new xX(eVa,!1),thp=new xX(eVo,!1),ths=new xX(ezz,1),thu=(e_a(),tpN),new xX(eZw,thu),thY=!0}function eBU(){var e,t;eBU=A,tnc=new pO(eGm),ttz=new pO("coordinateOrigin"),tny=new pO("processors"),tt$=new Cm("compoundNode",(OQ(),!1)),tt5=new Cm("insideConnections",!1),tnl=new pO("originalBendpoints"),tnf=new pO("originalDummyNodePosition"),tnd=new pO("originalLabelEdge"),tn_=new pO("representedLabels"),ttq=new pO("endLabels"),ttZ=new pO("endLabel.origin"),tnt=new Cm("labelSide",(egF(),tpX)),tns=new Cm("maxEdgeThickness",0),tnE=new Cm("reversed",!1),tnw=new pO(eGg),tni=new Cm("longEdgeSource",null),tna=new Cm("longEdgeTarget",null),tnr=new Cm("longEdgeHasLabelDummies",!1),tnn=new Cm("longEdgeBeforeLabelDummy",!1),ttV=new Cm("edgeConstraint",(eoG(),te1)),tt9=new pO("inLayerLayoutUnit"),tt8=new Cm("inLayerConstraint",(Q1(),ttD)),tt7=new Cm("inLayerSuccessorConstraint",new p0),tne=new Cm("inLayerSuccessorConstraintBetweenNonDummies",!1),tng=new pO("portDummy"),ttG=new Cm("crossingHint",ell(0)),tt3=new Cm("graphProperties",(t=Pp(yw(e44),9),new I1(t,Pp(CY(t,t.length),9),0))),tt1=new Cm("externalPortSide",(eYu(),tbF)),tt0=new Cm("externalPortSize",new yb),ttJ=new pO("externalPortReplacedDummies"),ttQ=new pO("externalPortReplacedDummy"),ttX=new Cm("externalPortConnections",(e=Pp(yw(e5a),9),new I1(e,Pp(CY(e,e.length),9),0))),tnv=new Cm(ezf,0),ttY=new pO("barycenterAssociates"),tnI=new pO("TopSideComments"),ttB=new pO("BottomSideComments"),ttH=new pO("CommentConnectionPort"),tt6=new Cm("inputCollect",!1),tnb=new Cm("outputCollect",!1),ttK=new Cm("cyclic",!1),ttW=new pO("crossHierarchyMap"),tnC=new pO("targetOffset"),new Cm("splineLabelSize",new yb),tnx=new pO("spacings"),tnm=new Cm("partitionConstraint",!1),ttU=new pO("breakingPoint.info"),tnA=new pO("splines.survivingEdge"),tnO=new pO("splines.route.start"),tnT=new pO("splines.edgeChain"),tnp=new pO("originalPortConstraints"),tnk=new pO("selfLoopHolder"),tnM=new pO("splines.nsPortY"),tnu=new pO("modelOrder"),tno=new pO("longEdgeTargetNode"),tt2=new Cm(eW_,!1),tnS=new Cm(eW_,!1),tt4=new pO("layerConstraints.hiddenNodes"),tnh=new pO("layerConstraints.opposidePort"),tnL=new pO("targetNode.modelOrder")}function eBH(){eBH=A,trl=(eeF(),teZ),trc=new xX(eWE,trl),trO=new xX(eWS,(OQ(),!1)),trN=(K5(),ttR),trD=new xX(eWk,trN),trJ=new xX(eWx,!1),trQ=new xX(eWT,!0),tnY=new xX(eWM,!1),tic=(Q0(),tsL),tiu=new xX(eWO,tic),ell(1),tig=new xX(eWA,ell(7)),tiv=new xX(eWL,!1),trA=new xX(eWC,!1),tru=(eb5(),teG),trs=new xX(eWI,tru),trX=(ewY(),to7),trZ=new xX(eWD,trX),trU=(ef_(),tnj),trB=new xX(eWN,trU),ell(-1),trY=new xX(eWP,ell(-1)),ell(-1),trH=new xX(eWR,ell(-1)),ell(-1),tr$=new xX(eWj,ell(4)),ell(-1),trG=new xX(eWF,ell(2)),trq=(eOJ(),tsS),trV=new xX(eWY,trq),ell(0),trK=new xX(eWB,ell(0)),trj=new xX(eWU,ell(eUu)),tro=(en7(),tej),tra=new xX(eWH,tro),tn1=new xX(eW$,!1),tn7=new xX(eWz,.1),trr=new xX(eWG,!1),ell(-1),trt=new xX(eWW,ell(-1)),ell(-1),trn=new xX(eWK,ell(-1)),ell(0),tn0=new xX(eWV,ell(40)),tn8=(eaU(),ttL),tn5=new xX(eWq,tn8),tn3=ttO,tn2=new xX(eWZ,tn3),tis=(ebG(),tsf),tio=new xX(eWX,tis),tr5=new pO(eWJ),tr0=(Qx(),tte),tr1=new xX(eWQ,tr0),tr4=(eyd(),tto),tr3=new xX(eW1,tr4),new pQ,tr7=new xX(eW0,.3),tit=new pO(eW2),tir=(ebk(),tsu),tin=new xX(eW3,tir),trv=(ei0(),tsF),trg=new xX(eW4,trv),tr_=(Xo(),tsH),trw=new xX(eW6,tr_),trS=(euy(),tsW),trE=new xX(eW5,trS),trx=new xX(eW8,.2),trb=new xX(eW9,2),tih=new xX(eW7,null),tib=new xX(eKe,10),tip=new xX(eKt,10),tim=new xX(eKn,20),ell(0),til=new xX(eKr,ell(0)),ell(0),tif=new xX(eKi,ell(0)),ell(0),tid=new xX(eKa,ell(0)),tnB=new xX(eKo,!1),tnz=(e_3(),ttp),tn$=new xX(eKs,tnz),tnH=(Jp(),teN),tnU=new xX(eKu,tnH),trC=new xX(eKc,!1),ell(0),trL=new xX(eKl,ell(16)),ell(0),trI=new xX(eKf,ell(5)),tiU=(eox(),tsQ),tiB=new xX(eKd,tiU),tiy=new xX(eKh,10),tiE=new xX(eKp,1),tiC=(enB(),teH),tiL=new xX(eKb,tiC),tix=new pO(eKm),tiO=ell(1),ell(0),tiM=new xX(eKg,tiO),tiW=(eiO(),tsV),tiG=new xX(eKv,tiW),tiH=new pO(eKy),tiR=new xX(eKw,!0),tiN=new xX(eK_,2),tiF=new xX(eKE,!0),trp=(eEf(),te8),trh=new xX(eKS,trp),trd=(eSg(),teO),trf=new xX(eKk,trd),tnQ=(esn(),tsM),tnJ=new xX(eKx,tnQ),tnX=new xX(eKT,!1),tnW=(ec4(),e9x),tnG=new xX(eKM,tnW),tnZ=(euJ(),tsn),tnq=new xX(eKO,tnZ),tnK=new xX(eKA,0),tnV=new xX(eKL,0),trR=teK,trP=teR,trz=to9,trW=to9,trF=to6,tre=(eck(),tpz),tri=tej,tn9=tej,tn4=tej,tn6=tpz,tr8=tsp,tr9=tsf,tr2=tsf,tr6=tsf,tie=tsh,tia=tsp,tii=tsp,trk=(efE(),tpM),trT=tpM,trM=tsW,trm=tpT,tiw=ts1,ti_=tsJ,tiS=ts1,tik=tsJ,tiI=ts1,tiD=tsJ,tiT=teU,tiA=teH,tiK=ts1,tiV=tsJ,ti$=ts1,tiz=tsJ,tij=tsJ,tiP=tsJ,tiY=tsJ}function eB$(){eB$=A,e96=new Eq("DIRECTION_PREPROCESSOR",0),e92=new Eq("COMMENT_PREPROCESSOR",1),e95=new Eq("EDGE_AND_LAYER_CONSTRAINT_EDGE_REVERSER",2),e7d=new Eq("INTERACTIVE_EXTERNAL_PORT_POSITIONER",3),e7C=new Eq("PARTITION_PREPROCESSOR",4),e7m=new Eq("LABEL_DUMMY_INSERTER",5),e7j=new Eq("SELF_LOOP_PREPROCESSOR",6),e7_=new Eq("LAYER_CONSTRAINT_PREPROCESSOR",7),e7A=new Eq("PARTITION_MIDPROCESSOR",8),e7s=new Eq("HIGH_DEGREE_NODE_LAYER_PROCESSOR",9),e7x=new Eq("NODE_PROMOTION",10),e7w=new Eq("LAYER_CONSTRAINT_POSTPROCESSOR",11),e7L=new Eq("PARTITION_POSTPROCESSOR",12),e7r=new Eq("HIERARCHICAL_PORT_CONSTRAINT_PROCESSOR",13),e7Y=new Eq("SEMI_INTERACTIVE_CROSSMIN_PROCESSOR",14),e9Z=new Eq("BREAKING_POINT_INSERTER",15),e7k=new Eq("LONG_EDGE_SPLITTER",16),e7D=new Eq("PORT_SIDE_PROCESSOR",17),e7h=new Eq("INVERTED_PORT_PROCESSOR",18),e7I=new Eq("PORT_LIST_SORTER",19),e7U=new Eq("SORT_BY_INPUT_ORDER_OF_MODEL",20),e7M=new Eq("NORTH_SOUTH_PORT_PREPROCESSOR",21),e9X=new Eq("BREAKING_POINT_PROCESSOR",22),e7O=new Eq(eG7,23),e7H=new Eq(eWe,24),e7P=new Eq("SELF_LOOP_PORT_RESTORER",25),e7B=new Eq("SINGLE_EDGE_GRAPH_WRAPPER",26),e7p=new Eq("IN_LAYER_CONSTRAINT_PROCESSOR",27),e7e=new Eq("END_NODE_PORT_LABEL_MANAGEMENT_PROCESSOR",28),e7b=new Eq("LABEL_AND_NODE_SIZE_PROCESSOR",29),e7f=new Eq("INNERMOST_NODE_MARGIN_CALCULATOR",30),e7F=new Eq("SELF_LOOP_ROUTER",31),e91=new Eq("COMMENT_NODE_MARGIN_CALCULATOR",32),e99=new Eq("END_LABEL_PREPROCESSOR",33),e7v=new Eq("LABEL_DUMMY_SWITCHER",34),e9Q=new Eq("CENTER_LABEL_MANAGEMENT_PROCESSOR",35),e7y=new Eq("LABEL_SIDE_SELECTOR",36),e7c=new Eq("HYPEREDGE_DUMMY_MERGER",37),e7i=new Eq("HIERARCHICAL_PORT_DUMMY_SIZE_PROCESSOR",38),e7E=new Eq("LAYER_SIZE_AND_GRAPH_HEIGHT_CALCULATOR",39),e7o=new Eq("HIERARCHICAL_PORT_POSITION_PROCESSOR",40),e93=new Eq("CONSTRAINTS_POSTPROCESSOR",41),e90=new Eq("COMMENT_POSTPROCESSOR",42),e7l=new Eq("HYPERNODE_PROCESSOR",43),e7a=new Eq("HIERARCHICAL_PORT_ORTHOGONAL_EDGE_ROUTER",44),e7S=new Eq("LONG_EDGE_JOINER",45),e7R=new Eq("SELF_LOOP_POSTPROCESSOR",46),e9J=new Eq("BREAKING_POINT_REMOVER",47),e7T=new Eq("NORTH_SOUTH_PORT_POSTPROCESSOR",48),e7u=new Eq("HORIZONTAL_COMPACTOR",49),e7g=new Eq("LABEL_DUMMY_REMOVER",50),e7t=new Eq("FINAL_SPLINE_BENDPOINTS_CALCULATOR",51),e97=new Eq("END_LABEL_SORTER",52),e7N=new Eq("REVERSED_EDGE_RESTORER",53),e98=new Eq("END_LABEL_POSTPROCESSOR",54),e7n=new Eq("HIERARCHICAL_NODE_RESIZER",55),e94=new Eq("DIRECTION_POSTPROCESSOR",56)}function eBz(e,t,n){var r,i,a,o,s,u,c,l,f,d,h,p,b,m,g,v,y,w,_,E,S,k,x,T,M,O,A,L,C,I,D,N,P,R,j,F,Y,B,U,H,$,z,G,W,K,V,q,Z,X,J,Q,ee,et,en,er,ei,ea,eo;for(I=0,X=0,P=(A=t).length;I0&&(e.a[H.p]=X++)}for(D=0,en=0,R=(L=n).length;D0;){for(H=(A5(W.b>0),Pp(W.a.Xb(W.c=--W.b),11)),G=0,s=new fz(H.e);s.a0&&(H.j==(eYu(),tbw)?(e.a[H.p]=en,++en):(e.a[H.p]=en+j+Y,++Y))}en+=Y}for(C=0,z=new p2,p=new Tw,N=(O=t).length;Cc.b&&(c.b=K)):H.i.c==Z&&(Kc.c&&(c.c=K));for(Qe(b,0,b.length,null),et=Je(ty_,eHT,25,b.length,15,1),r=Je(ty_,eHT,25,en+1,15,1),g=0;g0;)S%2>0&&(i+=ea[S+1]),S=(S-1)/2|0,++ea[S];for(w=0,x=Je(e6g,eUp,362,2*b.length,0,1);w'?":IE(eXJ,e)?"'(?<' or '(? toIndex: ",e$M=", toIndex: ",e$O="Index: ",e$A=", Size: ",e$L="org.eclipse.elk.alg.common",e$C={62:1},e$I="org.eclipse.elk.alg.common.compaction",e$D="Scanline/EventHandler",e$N="org.eclipse.elk.alg.common.compaction.oned",e$P="CNode belongs to another CGroup.",e$R="ISpacingsHandler/1",e$j="The ",e$F=" instance has been finished already.",e$Y="The direction ",e$B=" is not supported by the CGraph instance.",e$U="OneDimensionalCompactor",e$H="OneDimensionalCompactor/lambda$0$Type",e$$="Quadruplet",e$z="ScanlineConstraintCalculator",e$G="ScanlineConstraintCalculator/ConstraintsScanlineHandler",e$W="ScanlineConstraintCalculator/ConstraintsScanlineHandler/lambda$0$Type",e$K="ScanlineConstraintCalculator/Timestamp",e$V="ScanlineConstraintCalculator/lambda$0$Type",e$q={169:1,45:1},e$Z="org.eclipse.elk.alg.common.compaction.options",e$X="org.eclipse.elk.core.data",e$J="org.eclipse.elk.polyomino.traversalStrategy",e$Q="org.eclipse.elk.polyomino.lowLevelSort",e$1="org.eclipse.elk.polyomino.highLevelSort",e$0="org.eclipse.elk.polyomino.fill",e$2={130:1},e$3="polyomino",e$4="org.eclipse.elk.alg.common.networksimplex",e$6={177:1,3:1,4:1},e$5="org.eclipse.elk.alg.common.nodespacing",e$8="org.eclipse.elk.alg.common.nodespacing.cellsystem",e$9="CENTER",e$7={212:1,326:1},eze={3:1,4:1,5:1,595:1},ezt="LEFT",ezn="RIGHT",ezr="Vertical alignment cannot be null",ezi="BOTTOM",eza="org.eclipse.elk.alg.common.nodespacing.internal",ezo="UNDEFINED",ezs=.01,ezu="org.eclipse.elk.alg.common.nodespacing.internal.algorithm",ezc="LabelPlacer/lambda$0$Type",ezl="LabelPlacer/lambda$1$Type",ezf="portRatioOrPosition",ezd="org.eclipse.elk.alg.common.overlaps",ezh="DOWN",ezp="org.eclipse.elk.alg.common.polyomino",ezb="NORTH",ezm="EAST",ezg="SOUTH",ezv="WEST",ezy="org.eclipse.elk.alg.common.polyomino.structures",ezw="Direction",ez_="Grid is only of size ",ezE=". Requested point (",ezS=") is out of bounds.",ezk=" Given center based coordinates were (",ezx="org.eclipse.elk.graph.properties",ezT="IPropertyHolder",ezM={3:1,94:1,134:1},ezO="org.eclipse.elk.alg.common.spore",ezA="org.eclipse.elk.alg.common.utils",ezL={209:1},ezC="org.eclipse.elk.core",ezI="Connected Components Compaction",ezD="org.eclipse.elk.alg.disco",ezN="org.eclipse.elk.alg.disco.graph",ezP="org.eclipse.elk.alg.disco.options",ezR="CompactionStrategy",ezj="org.eclipse.elk.disco.componentCompaction.strategy",ezF="org.eclipse.elk.disco.componentCompaction.componentLayoutAlgorithm",ezY="org.eclipse.elk.disco.debug.discoGraph",ezB="org.eclipse.elk.disco.debug.discoPolys",ezU="componentCompaction",ezH="org.eclipse.elk.disco",ez$="org.eclipse.elk.spacing.componentComponent",ezz="org.eclipse.elk.edge.thickness",ezG="org.eclipse.elk.aspectRatio",ezW="org.eclipse.elk.padding",ezK="org.eclipse.elk.alg.disco.transform",ezV=1.5707963267948966,ezq=17976931348623157e292,ezZ={3:1,4:1,5:1,192:1},ezX={3:1,6:1,4:1,5:1,106:1,120:1},ezJ="org.eclipse.elk.alg.force",ezQ="ComponentsProcessor",ez1="ComponentsProcessor/1",ez0="org.eclipse.elk.alg.force.graph",ez2="Component Layout",ez3="org.eclipse.elk.alg.force.model",ez4="org.eclipse.elk.force.model",ez6="org.eclipse.elk.force.iterations",ez5="org.eclipse.elk.force.repulsivePower",ez8="org.eclipse.elk.force.temperature",ez9=.001,ez7="org.eclipse.elk.force.repulsion",eGe="org.eclipse.elk.alg.force.options",eGt=1.600000023841858,eGn="org.eclipse.elk.force",eGr="org.eclipse.elk.priority",eGi="org.eclipse.elk.spacing.nodeNode",eGa="org.eclipse.elk.spacing.edgeLabel",eGo="org.eclipse.elk.randomSeed",eGs="org.eclipse.elk.separateConnectedComponents",eGu="org.eclipse.elk.interactive",eGc="org.eclipse.elk.portConstraints",eGl="org.eclipse.elk.edgeLabels.inline",eGf="org.eclipse.elk.omitNodeMicroLayout",eGd="org.eclipse.elk.nodeSize.options",eGh="org.eclipse.elk.nodeSize.constraints",eGp="org.eclipse.elk.nodeLabels.placement",eGb="org.eclipse.elk.portLabels.placement",eGm="origin",eGg="random",eGv="boundingBox.upLeft",eGy="boundingBox.lowRight",eGw="org.eclipse.elk.stress.fixed",eG_="org.eclipse.elk.stress.desiredEdgeLength",eGE="org.eclipse.elk.stress.dimension",eGS="org.eclipse.elk.stress.epsilon",eGk="org.eclipse.elk.stress.iterationLimit",eGx="org.eclipse.elk.stress",eGT="ELK Stress",eGM="org.eclipse.elk.nodeSize.minimum",eGO="org.eclipse.elk.alg.force.stress",eGA="Layered layout",eGL="org.eclipse.elk.alg.layered",eGC="org.eclipse.elk.alg.layered.compaction.components",eGI="org.eclipse.elk.alg.layered.compaction.oned",eGD="org.eclipse.elk.alg.layered.compaction.oned.algs",eGN="org.eclipse.elk.alg.layered.compaction.recthull",eGP="org.eclipse.elk.alg.layered.components",eGR="NONE",eGj={3:1,6:1,4:1,9:1,5:1,122:1},eGF={3:1,6:1,4:1,5:1,141:1,106:1,120:1},eGY="org.eclipse.elk.alg.layered.compound",eGB={51:1},eGU="org.eclipse.elk.alg.layered.graph",eGH=" -> ",eG$="Not supported by LGraph",eGz="Port side is undefined",eGG={3:1,6:1,4:1,5:1,474:1,141:1,106:1,120:1},eGW={3:1,6:1,4:1,5:1,141:1,193:1,203:1,106:1,120:1},eGK={3:1,6:1,4:1,5:1,141:1,1943:1,203:1,106:1,120:1},eGV="([{\"' \r\n",eGq=")]}\"' \r\n",eGZ="The given string contains parts that cannot be parsed as numbers.",eGX="org.eclipse.elk.core.math",eGJ={3:1,4:1,142:1,207:1,414:1},eGQ={3:1,4:1,116:1,207:1,414:1},eG1="org.eclipse.elk.layered",eG0="org.eclipse.elk.alg.layered.graph.transform",eG2="ElkGraphImporter",eG3="ElkGraphImporter/lambda$0$Type",eG4="ElkGraphImporter/lambda$1$Type",eG6="ElkGraphImporter/lambda$2$Type",eG5="ElkGraphImporter/lambda$4$Type",eG8="Node margin calculation",eG9="org.eclipse.elk.alg.layered.intermediate",eG7="ONE_SIDED_GREEDY_SWITCH",eWe="TWO_SIDED_GREEDY_SWITCH",eWt="No implementation is available for the layout processor ",eWn="IntermediateProcessorStrategy",eWr="Node '",eWi="FIRST_SEPARATE",eWa="LAST_SEPARATE",eWo="Odd port side processing",eWs="org.eclipse.elk.alg.layered.intermediate.compaction",eWu="org.eclipse.elk.alg.layered.intermediate.greedyswitch",eWc="org.eclipse.elk.alg.layered.p3order.counting",eWl={225:1},eWf="org.eclipse.elk.alg.layered.intermediate.loops",eWd="org.eclipse.elk.alg.layered.intermediate.loops.ordering",eWh="org.eclipse.elk.alg.layered.intermediate.loops.routing",eWp="org.eclipse.elk.alg.layered.intermediate.preserveorder",eWb="org.eclipse.elk.alg.layered.intermediate.wrapping",eWm="org.eclipse.elk.alg.layered.options",eWg="INTERACTIVE",eWv="DEPTH_FIRST",eWy="EDGE_LENGTH",eWw="SELF_LOOPS",eW_="firstTryWithInitialOrder",eWE="org.eclipse.elk.layered.directionCongruency",eWS="org.eclipse.elk.layered.feedbackEdges",eWk="org.eclipse.elk.layered.interactiveReferencePoint",eWx="org.eclipse.elk.layered.mergeEdges",eWT="org.eclipse.elk.layered.mergeHierarchyEdges",eWM="org.eclipse.elk.layered.allowNonFlowPortsToSwitchSides",eWO="org.eclipse.elk.layered.portSortingStrategy",eWA="org.eclipse.elk.layered.thoroughness",eWL="org.eclipse.elk.layered.unnecessaryBendpoints",eWC="org.eclipse.elk.layered.generatePositionAndLayerIds",eWI="org.eclipse.elk.layered.cycleBreaking.strategy",eWD="org.eclipse.elk.layered.layering.strategy",eWN="org.eclipse.elk.layered.layering.layerConstraint",eWP="org.eclipse.elk.layered.layering.layerChoiceConstraint",eWR="org.eclipse.elk.layered.layering.layerId",eWj="org.eclipse.elk.layered.layering.minWidth.upperBoundOnWidth",eWF="org.eclipse.elk.layered.layering.minWidth.upperLayerEstimationScalingFactor",eWY="org.eclipse.elk.layered.layering.nodePromotion.strategy",eWB="org.eclipse.elk.layered.layering.nodePromotion.maxIterations",eWU="org.eclipse.elk.layered.layering.coffmanGraham.layerBound",eWH="org.eclipse.elk.layered.crossingMinimization.strategy",eW$="org.eclipse.elk.layered.crossingMinimization.forceNodeModelOrder",eWz="org.eclipse.elk.layered.crossingMinimization.hierarchicalSweepiness",eWG="org.eclipse.elk.layered.crossingMinimization.semiInteractive",eWW="org.eclipse.elk.layered.crossingMinimization.positionChoiceConstraint",eWK="org.eclipse.elk.layered.crossingMinimization.positionId",eWV="org.eclipse.elk.layered.crossingMinimization.greedySwitch.activationThreshold",eWq="org.eclipse.elk.layered.crossingMinimization.greedySwitch.type",eWZ="org.eclipse.elk.layered.crossingMinimization.greedySwitchHierarchical.type",eWX="org.eclipse.elk.layered.nodePlacement.strategy",eWJ="org.eclipse.elk.layered.nodePlacement.favorStraightEdges",eWQ="org.eclipse.elk.layered.nodePlacement.bk.edgeStraightening",eW1="org.eclipse.elk.layered.nodePlacement.bk.fixedAlignment",eW0="org.eclipse.elk.layered.nodePlacement.linearSegments.deflectionDampening",eW2="org.eclipse.elk.layered.nodePlacement.networkSimplex.nodeFlexibility",eW3="org.eclipse.elk.layered.nodePlacement.networkSimplex.nodeFlexibility.default",eW4="org.eclipse.elk.layered.edgeRouting.selfLoopDistribution",eW6="org.eclipse.elk.layered.edgeRouting.selfLoopOrdering",eW5="org.eclipse.elk.layered.edgeRouting.splines.mode",eW8="org.eclipse.elk.layered.edgeRouting.splines.sloppy.layerSpacingFactor",eW9="org.eclipse.elk.layered.edgeRouting.polyline.slopedEdgeZoneWidth",eW7="org.eclipse.elk.layered.spacing.baseValue",eKe="org.eclipse.elk.layered.spacing.edgeNodeBetweenLayers",eKt="org.eclipse.elk.layered.spacing.edgeEdgeBetweenLayers",eKn="org.eclipse.elk.layered.spacing.nodeNodeBetweenLayers",eKr="org.eclipse.elk.layered.priority.direction",eKi="org.eclipse.elk.layered.priority.shortness",eKa="org.eclipse.elk.layered.priority.straightness",eKo="org.eclipse.elk.layered.compaction.connectedComponents",eKs="org.eclipse.elk.layered.compaction.postCompaction.strategy",eKu="org.eclipse.elk.layered.compaction.postCompaction.constraints",eKc="org.eclipse.elk.layered.highDegreeNodes.treatment",eKl="org.eclipse.elk.layered.highDegreeNodes.threshold",eKf="org.eclipse.elk.layered.highDegreeNodes.treeHeight",eKd="org.eclipse.elk.layered.wrapping.strategy",eKh="org.eclipse.elk.layered.wrapping.additionalEdgeSpacing",eKp="org.eclipse.elk.layered.wrapping.correctionFactor",eKb="org.eclipse.elk.layered.wrapping.cutting.strategy",eKm="org.eclipse.elk.layered.wrapping.cutting.cuts",eKg="org.eclipse.elk.layered.wrapping.cutting.msd.freedom",eKv="org.eclipse.elk.layered.wrapping.validify.strategy",eKy="org.eclipse.elk.layered.wrapping.validify.forbiddenIndices",eKw="org.eclipse.elk.layered.wrapping.multiEdge.improveCuts",eK_="org.eclipse.elk.layered.wrapping.multiEdge.distancePenalty",eKE="org.eclipse.elk.layered.wrapping.multiEdge.improveWrappedEdges",eKS="org.eclipse.elk.layered.edgeLabels.sideSelection",eKk="org.eclipse.elk.layered.edgeLabels.centerLabelPlacementStrategy",eKx="org.eclipse.elk.layered.considerModelOrder.strategy",eKT="org.eclipse.elk.layered.considerModelOrder.noModelOrder",eKM="org.eclipse.elk.layered.considerModelOrder.components",eKO="org.eclipse.elk.layered.considerModelOrder.longEdgeStrategy",eKA="org.eclipse.elk.layered.considerModelOrder.crossingCounterNodeInfluence",eKL="org.eclipse.elk.layered.considerModelOrder.crossingCounterPortInfluence",eKC="layering",eKI="layering.minWidth",eKD="layering.nodePromotion",eKN="crossingMinimization",eKP="org.eclipse.elk.hierarchyHandling",eKR="crossingMinimization.greedySwitch",eKj="nodePlacement",eKF="nodePlacement.bk",eKY="edgeRouting",eKB="org.eclipse.elk.edgeRouting",eKU="spacing",eKH="priority",eK$="compaction",eKz="compaction.postCompaction",eKG="Specifies whether and how post-process compaction is applied.",eKW="highDegreeNodes",eKK="wrapping",eKV="wrapping.cutting",eKq="wrapping.validify",eKZ="wrapping.multiEdge",eKX="edgeLabels",eKJ="considerModelOrder",eKQ="org.eclipse.elk.spacing.commentComment",eK1="org.eclipse.elk.spacing.commentNode",eK0="org.eclipse.elk.spacing.edgeEdge",eK2="org.eclipse.elk.spacing.edgeNode",eK3="org.eclipse.elk.spacing.labelLabel",eK4="org.eclipse.elk.spacing.labelPortHorizontal",eK6="org.eclipse.elk.spacing.labelPortVertical",eK5="org.eclipse.elk.spacing.labelNode",eK8="org.eclipse.elk.spacing.nodeSelfLoop",eK9="org.eclipse.elk.spacing.portPort",eK7="org.eclipse.elk.spacing.individual",eVe="org.eclipse.elk.port.borderOffset",eVt="org.eclipse.elk.noLayout",eVn="org.eclipse.elk.port.side",eVr="org.eclipse.elk.debugMode",eVi="org.eclipse.elk.alignment",eVa="org.eclipse.elk.insideSelfLoops.activate",eVo="org.eclipse.elk.insideSelfLoops.yo",eVs="org.eclipse.elk.nodeSize.fixedGraphSize",eVu="org.eclipse.elk.direction",eVc="org.eclipse.elk.nodeLabels.padding",eVl="org.eclipse.elk.portLabels.nextToPortIfPossible",eVf="org.eclipse.elk.portLabels.treatAsGroup",eVd="org.eclipse.elk.portAlignment.default",eVh="org.eclipse.elk.portAlignment.north",eVp="org.eclipse.elk.portAlignment.south",eVb="org.eclipse.elk.portAlignment.west",eVm="org.eclipse.elk.portAlignment.east",eVg="org.eclipse.elk.contentAlignment",eVv="org.eclipse.elk.junctionPoints",eVy="org.eclipse.elk.edgeLabels.placement",eVw="org.eclipse.elk.port.index",eV_="org.eclipse.elk.commentBox",eVE="org.eclipse.elk.hypernode",eVS="org.eclipse.elk.port.anchor",eVk="org.eclipse.elk.partitioning.activate",eVx="org.eclipse.elk.partitioning.partition",eVT="org.eclipse.elk.position",eVM="org.eclipse.elk.margins",eVO="org.eclipse.elk.spacing.portsSurrounding",eVA="org.eclipse.elk.interactiveLayout",eVL="org.eclipse.elk.core.util",eVC={3:1,4:1,5:1,593:1},eVI="NETWORK_SIMPLEX",eVD={123:1,51:1},eVN="org.eclipse.elk.alg.layered.p1cycles",eVP="org.eclipse.elk.alg.layered.p2layers",eVR={402:1,225:1},eVj={832:1,3:1,4:1},eVF="org.eclipse.elk.alg.layered.p3order",eVY="org.eclipse.elk.alg.layered.p4nodes",eVB={3:1,4:1,5:1,840:1},eVU=1e-5,eVH="org.eclipse.elk.alg.layered.p4nodes.bk",eV$="org.eclipse.elk.alg.layered.p5edges",eVz="org.eclipse.elk.alg.layered.p5edges.orthogonal",eVG="org.eclipse.elk.alg.layered.p5edges.orthogonal.direction",eVW=1e-6,eVK="org.eclipse.elk.alg.layered.p5edges.splines",eVV=.09999999999999998,eVq=1e-8,eVZ=4.71238898038469,eVX=3.141592653589793,eVJ="org.eclipse.elk.alg.mrtree",eVQ="org.eclipse.elk.alg.mrtree.graph",eV1="org.eclipse.elk.alg.mrtree.intermediate",eV0="Set neighbors in level",eV2="DESCENDANTS",eV3="org.eclipse.elk.mrtree.weighting",eV4="org.eclipse.elk.mrtree.searchOrder",eV6="org.eclipse.elk.alg.mrtree.options",eV5="org.eclipse.elk.mrtree",eV8="org.eclipse.elk.tree",eV9="org.eclipse.elk.alg.radial",eV7=6.283185307179586,eqe=5e-324,eqt="org.eclipse.elk.alg.radial.intermediate",eqn="org.eclipse.elk.alg.radial.intermediate.compaction",eqr={3:1,4:1,5:1,106:1},eqi="org.eclipse.elk.alg.radial.intermediate.optimization",eqa="No implementation is available for the layout option ",eqo="org.eclipse.elk.alg.radial.options",eqs="org.eclipse.elk.radial.orderId",equ="org.eclipse.elk.radial.radius",eqc="org.eclipse.elk.radial.compactor",eql="org.eclipse.elk.radial.compactionStepSize",eqf="org.eclipse.elk.radial.sorter",eqd="org.eclipse.elk.radial.wedgeCriteria",eqh="org.eclipse.elk.radial.optimizationCriteria",eqp="org.eclipse.elk.radial",eqb="org.eclipse.elk.alg.radial.p1position.wedge",eqm="org.eclipse.elk.alg.radial.sorting",eqg=5.497787143782138,eqv=3.9269908169872414,eqy=2.356194490192345,eqw="org.eclipse.elk.alg.rectpacking",eq_="org.eclipse.elk.alg.rectpacking.firstiteration",eqE="org.eclipse.elk.alg.rectpacking.options",eqS="org.eclipse.elk.rectpacking.optimizationGoal",eqk="org.eclipse.elk.rectpacking.lastPlaceShift",eqx="org.eclipse.elk.rectpacking.currentPosition",eqT="org.eclipse.elk.rectpacking.desiredPosition",eqM="org.eclipse.elk.rectpacking.onlyFirstIteration",eqO="org.eclipse.elk.rectpacking.rowCompaction",eqA="org.eclipse.elk.rectpacking.expandToAspectRatio",eqL="org.eclipse.elk.rectpacking.targetWidth",eqC="org.eclipse.elk.expandNodes",eqI="org.eclipse.elk.rectpacking",eqD="org.eclipse.elk.alg.rectpacking.util",eqN="No implementation available for ",eqP="org.eclipse.elk.alg.spore",eqR="org.eclipse.elk.alg.spore.options",eqj="org.eclipse.elk.sporeCompaction",eqF="org.eclipse.elk.underlyingLayoutAlgorithm",eqY="org.eclipse.elk.processingOrder.treeConstruction",eqB="org.eclipse.elk.processingOrder.spanningTreeCostFunction",eqU="org.eclipse.elk.processingOrder.preferredRoot",eqH="org.eclipse.elk.processingOrder.rootSelection",eq$="org.eclipse.elk.structure.structureExtractionStrategy",eqz="org.eclipse.elk.compaction.compactionStrategy",eqG="org.eclipse.elk.compaction.orthogonal",eqW="org.eclipse.elk.overlapRemoval.maxIterations",eqK="org.eclipse.elk.overlapRemoval.runScanline",eqV="processingOrder",eqq="overlapRemoval",eqZ="org.eclipse.elk.sporeOverlap",eqX="org.eclipse.elk.alg.spore.p1structure",eqJ="org.eclipse.elk.alg.spore.p2processingorder",eqQ="org.eclipse.elk.alg.spore.p3execution",eq1="Invalid index: ",eq0="org.eclipse.elk.core.alg",eq2={331:1},eq3={288:1},eq4="Make sure its type is registered with the ",eq6=" utility class.",eq5="true",eq8="false",eq9="Couldn't clone property '",eq7=.05,eZe="org.eclipse.elk.core.options",eZt=1.2999999523162842,eZn="org.eclipse.elk.box",eZr="org.eclipse.elk.box.packingMode",eZi="org.eclipse.elk.algorithm",eZa="org.eclipse.elk.resolvedAlgorithm",eZo="org.eclipse.elk.bendPoints",eZs="org.eclipse.elk.labelManager",eZu="org.eclipse.elk.scaleFactor",eZc="org.eclipse.elk.animate",eZl="org.eclipse.elk.animTimeFactor",eZf="org.eclipse.elk.layoutAncestors",eZd="org.eclipse.elk.maxAnimTime",eZh="org.eclipse.elk.minAnimTime",eZp="org.eclipse.elk.progressBar",eZb="org.eclipse.elk.validateGraph",eZm="org.eclipse.elk.validateOptions",eZg="org.eclipse.elk.zoomToFit",eZv="org.eclipse.elk.font.name",eZy="org.eclipse.elk.font.size",eZw="org.eclipse.elk.edge.type",eZ_="partitioning",eZE="nodeLabels",eZS="portAlignment",eZk="nodeSize",eZx="port",eZT="portLabels",eZM="insideSelfLoops",eZO="org.eclipse.elk.fixed",eZA="org.eclipse.elk.random",eZL="port must have a parent node to calculate the port side",eZC="The edge needs to have exactly one edge section. Found: ",eZI="org.eclipse.elk.core.util.adapters",eZD="org.eclipse.emf.ecore",eZN="org.eclipse.elk.graph",eZP="EMapPropertyHolder",eZR="ElkBendPoint",eZj="ElkGraphElement",eZF="ElkConnectableShape",eZY="ElkEdge",eZB="ElkEdgeSection",eZU="EModelElement",eZH="ENamedElement",eZ$="ElkLabel",eZz="ElkNode",eZG="ElkPort",eZW={92:1,90:1},eZK="org.eclipse.emf.common.notify.impl",eZV="The feature '",eZq="' is not a valid changeable feature",eZZ="Expecting null",eZX="' is not a valid feature",eZJ="The feature ID",eZQ=" is not a valid feature ID",eZ1=32768,eZ0={105:1,92:1,90:1,56:1,49:1,97:1},eZ2="org.eclipse.emf.ecore.impl",eZ3="org.eclipse.elk.graph.impl",eZ4="Recursive containment not allowed for ",eZ6="The datatype '",eZ5="' is not a valid classifier",eZ8="The value '",eZ9={190:1,3:1,4:1},eZ7="The class '",eXe="http://www.eclipse.org/elk/ElkGraph",eXt=1024,eXn="property",eXr="value",eXi="source",eXa="properties",eXo="identifier",eXs="height",eXu="width",eXc="parent",eXl="text",eXf="children",eXd="hierarchical",eXh="sources",eXp="targets",eXb="sections",eXm="bendPoints",eXg="outgoingShape",eXv="incomingShape",eXy="outgoingSections",eXw="incomingSections",eX_="org.eclipse.emf.common.util",eXE="Severe implementation error in the Json to ElkGraph importer.",eXS="id",eXk="org.eclipse.elk.graph.json",eXx="Unhandled parameter types: ",eXT="startPoint",eXM="An edge must have at least one source and one target (edge id: '",eXO="').",eXA="Referenced edge section does not exist: ",eXL=" (edge id: '",eXC="target",eXI="sourcePoint",eXD="targetPoint",eXN="group",eXP="name",eXR="connectableShape cannot be null",eXj="edge cannot be null",eXF="Passed edge is not 'simple'.",eXY="org.eclipse.elk.graph.util",eXB="The 'no duplicates' constraint is violated",eXU="targetIndex=",eXH=", size=",eX$="sourceIndex=",eXz={3:1,4:1,20:1,28:1,52:1,14:1,15:1,54:1,67:1,63:1,58:1},eXG={3:1,4:1,20:1,28:1,52:1,14:1,47:1,15:1,54:1,67:1,63:1,58:1,588:1},eXW="logging",eXK="measureExecutionTime",eXV="parser.parse.1",eXq="parser.parse.2",eXZ="parser.next.1",eXX="parser.next.2",eXJ="parser.next.3",eXQ="parser.next.4",eX1="parser.factor.1",eX0="parser.factor.2",eX2="parser.factor.3",eX3="parser.factor.4",eX4="parser.factor.5",eX6="parser.factor.6",eX5="parser.atom.1",eX8="parser.atom.2",eX9="parser.atom.3",eX7="parser.atom.4",eJe="parser.atom.5",eJt="parser.cc.1",eJn="parser.cc.2",eJr="parser.cc.3",eJi="parser.cc.5",eJa="parser.cc.6",eJo="parser.cc.7",eJs="parser.cc.8",eJu="parser.ope.1",eJc="parser.ope.2",eJl="parser.ope.3",eJf="parser.descape.1",eJd="parser.descape.2",eJh="parser.descape.3",eJp="parser.descape.4",eJb="parser.descape.5",eJm="parser.process.1",eJg="parser.quantifier.1",eJv="parser.quantifier.2",eJy="parser.quantifier.3",eJw="parser.quantifier.4",eJ_="parser.quantifier.5",eJE="org.eclipse.emf.common.notify",eJS={415:1,672:1},eJk={3:1,4:1,20:1,28:1,52:1,14:1,15:1,67:1,58:1},eJx={366:1,143:1},eJT="index=",eJM={3:1,4:1,5:1,126:1},eJO={3:1,4:1,20:1,28:1,52:1,14:1,15:1,54:1,67:1,58:1},eJA={3:1,6:1,4:1,5:1,192:1},eJL={3:1,4:1,5:1,165:1,367:1},eJC=";/?:@&=+$,",eJI="invalid authority: ",eJD="EAnnotation",eJN="ETypedElement",eJP="EStructuralFeature",eJR="EAttribute",eJj="EClassifier",eJF="EEnumLiteral",eJY="EGenericType",eJB="EOperation",eJU="EParameter",eJH="EReference",eJ$="ETypeParameter",eJz="org.eclipse.emf.ecore.util",eJG={76:1},eJW={3:1,20:1,14:1,15:1,58:1,589:1,76:1,69:1,95:1},eJK="org.eclipse.emf.ecore.util.FeatureMap$Entry",eJV=8192,eJq=2048,eJZ="byte",eJX="char",eJJ="double",eJQ="float",eJ1="int",eJ0="long",eJ2="short",eJ3="java.lang.Object",eJ4={3:1,4:1,5:1,247:1},eJ6={3:1,4:1,5:1,673:1},eJ5={3:1,4:1,20:1,28:1,52:1,14:1,15:1,54:1,67:1,63:1,58:1,69:1},eJ8={3:1,4:1,20:1,28:1,52:1,14:1,15:1,54:1,67:1,63:1,58:1,76:1,69:1,95:1},eJ9="mixed",eJ7="http:///org/eclipse/emf/ecore/util/ExtendedMetaData",eQe="kind",eQt={3:1,4:1,5:1,674:1},eQn={3:1,4:1,20:1,28:1,52:1,14:1,15:1,67:1,58:1,76:1,69:1,95:1},eQr={20:1,28:1,52:1,14:1,15:1,58:1,69:1},eQi={47:1,125:1,279:1},eQa={72:1,332:1},eQo="The value of type '",eQs="' must be of type '",eQu=1316,eQc="http://www.eclipse.org/emf/2002/Ecore",eQl=-32768,eQf="constraints",eQd="baseType",eQh="getEStructuralFeature",eQp="getFeatureID",eQb="feature",eQm="getOperationID",eQg="operation",eQv="defaultValue",eQy="eTypeParameters",eQw="isInstance",eQ_="getEEnumLiteral",eQE="eContainingClass",eQS={55:1},eQk={3:1,4:1,5:1,119:1},eQx="org.eclipse.emf.ecore.resource",eQT={92:1,90:1,591:1,1935:1},eQM="org.eclipse.emf.ecore.resource.impl",eQO="unspecified",eQA="simple",eQL="attribute",eQC="attributeWildcard",eQI="element",eQD="elementWildcard",eQN="collapse",eQP="itemType",eQR="namespace",eQj="##targetNamespace",eQF="whiteSpace",eQY="wildcards",eQB="http://www.eclipse.org/emf/2003/XMLType",eQU="##any",eQH="uninitialized",eQ$="The multiplicity constraint is violated",eQz="org.eclipse.emf.ecore.xml.type",eQG="ProcessingInstruction",eQW="SimpleAnyType",eQK="XMLTypeDocumentRoot",eQV="org.eclipse.emf.ecore.xml.type.impl",eQq="INF",eQZ="processing",eQX="ENTITIES_._base",eQJ="minLength",eQQ="ENTITY",eQ1="NCName",eQ0="IDREFS_._base",eQ2="integer",eQ3="token",eQ4="pattern",eQ6="[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*",eQ5="\\i\\c*",eQ8="[\\i-[:]][\\c-[:]]*",eQ9="nonPositiveInteger",eQ7="maxInclusive",e1e="NMTOKEN",e1t="NMTOKENS_._base",e1n="nonNegativeInteger",e1r="minInclusive",e1i="normalizedString",e1a="unsignedByte",e1o="unsignedInt",e1s="18446744073709551615",e1u="unsignedShort",e1c="processingInstruction",e1l="org.eclipse.emf.ecore.xml.type.internal",e1f=1114111,e1d="Internal Error: shorthands: \\u",e1h="xml:isDigit",e1p="xml:isWord",e1b="xml:isSpace",e1m="xml:isNameChar",e1g="xml:isInitialNameChar",e1v="09٠٩۰۹०९০৯੦੯૦૯୦୯௧௯౦౯೦೯൦൯๐๙໐໙༠༩",e1y="AZaz\xc0\xd6\xd8\xf6\xf8ıĴľŁňŊžƀǃǍǰǴǵǺȗɐʨʻˁΆΆΈΊΌΌΎΡΣώϐϖϚϚϜϜϞϞϠϠϢϳЁЌЎяёќўҁҐӄӇӈӋӌӐӫӮӵӸӹԱՖՙՙաֆאתװײءغفيٱڷںھۀێېۓەەۥۦअहऽऽक़ॡঅঌএঐওনপরললশহড়ঢ়য়ৡৰৱਅਊਏਐਓਨਪਰਲਲ਼ਵਸ਼ਸਹਖ਼ੜਫ਼ਫ਼ੲੴઅઋઍઍએઑઓનપરલળવહઽઽૠૠଅଌଏଐଓନପରଲଳଶହଽଽଡ଼ଢ଼ୟୡஅஊஎஐஒகஙசஜஜஞடணதநபமவஷஹఅఌఎఐఒనపళవహౠౡಅಌಎಐಒನಪಳವಹೞೞೠೡഅഌഎഐഒനപഹൠൡกฮะะาำเๅກຂຄຄງຈຊຊຍຍດທນຟມຣລລວວສຫອຮະະາຳຽຽເໄཀཇཉཀྵႠჅაჶᄀᄀᄂᄃᄅᄇᄉᄉᄋᄌᄎᄒᄼᄼᄾᄾᅀᅀᅌᅌᅎᅎᅐᅐᅔᅕᅙᅙᅟᅡᅣᅣᅥᅥᅧᅧᅩᅩᅭᅮᅲᅳᅵᅵᆞᆞᆨᆨᆫᆫᆮᆯᆷᆸᆺᆺᆼᇂᇫᇫᇰᇰᇹᇹḀẛẠỹἀἕἘἝἠὅὈὍὐὗὙὙὛὛὝὝὟώᾀᾴᾶᾼιιῂῄῆῌῐΐῖΊῠῬῲῴῶῼΩΩKÅ℮℮ↀↂ〇〇〡〩ぁゔァヺㄅㄬ一龥가힣",e1w="Private Use",e1_="ASSIGNED",e1E="\0\x7f\x80\xffĀſƀɏɐʯʰ˿̀ͯͰϿЀӿ԰֏֐׿؀ۿ܀ݏހ޿ऀॿঀ৿਀੿઀૿଀୿஀௿ఀ౿ಀ೿ഀൿ඀෿฀๿຀໿ༀ࿿က႟Ⴀჿᄀᇿሀ፿Ꭰ᏿᐀ᙿ ᚟ᚠ᛿ក៿᠀᢯Ḁỿἀ῿ ⁰₟₠⃏⃐⃿℀⅏⅐↏←⇿∀⋿⌀⏿␀␿⑀⑟①⓿─╿▀▟■◿☀⛿✀➿⠀⣿⺀⻿⼀⿟⿰⿿ 〿぀ゟ゠ヿ㄀ㄯ㄰㆏㆐㆟ㆠㆿ㈀㋿㌀㏿㐀䶵一鿿ꀀ꒏꒐꓏가힣豈﫿ffﭏﭐ﷿︠︯︰﹏﹐﹯ﹰ﻾\uFEFF\uFEFF＀￯",e1S="UNASSIGNED",e1k={3:1,117:1},e1x="org.eclipse.emf.ecore.xml.type.util",e1T={3:1,4:1,5:1,368:1},e1M="org.eclipse.xtext.xbase.lib",e1O="Cannot add elements to a Range",e1A="Cannot set elements in a Range",e1L="Cannot remove elements from a Range",e1C="locale",e1I="default",e1D="user.agent",e1N=null;eB4.goog=eB4.goog||{},eB4.goog.global=eB4.goog.global||eB4,e_Q(),eTS(1,null,{},r),eUe.Fb=function(e){return x6(this,e)},eUe.Gb=function(){return this.gm},eUe.Hb=function(){return Ao(this)},eUe.Ib=function(){var e;return yx(esF(this))+"@"+(e=esj(this)>>>0).toString(16)},eUe.equals=function(e){return this.Fb(e)},eUe.hashCode=function(){return this.Hb()},eUe.toString=function(){return this.Ib()},eTS(290,1,{290:1,2026:1},ese),eUe.le=function(e){var t;return(t=new ese).i=4,e>1?t.c=z8(this,e-1):t.c=this,t},eUe.me=function(){return LW(this),this.b},eUe.ne=function(){return yx(this)},eUe.oe=function(){return LW(this),this.k},eUe.pe=function(){return(4&this.i)!=0},eUe.qe=function(){return(1&this.i)!=0},eUe.Ib=function(){return ee5(this)},eUe.i=0;var e1P=1,e1R=Y6(eUc,"Object",1),e1j=Y6(eUc,"Class",290);eTS(1998,1,eUl),Y6(eUf,"Optional",1998),eTS(1170,1998,eUl,i),eUe.Fb=function(e){return e===this},eUe.Hb=function(){return 2040732332},eUe.Ib=function(){return"Optional.absent()"},eUe.Jb=function(e){return Y8(e),m4(),e0l},Y6(eUf,"Absent",1170),eTS(628,1,{},ve),Y6(eUf,"Joiner",628);var e1F=RL(eUf,"Predicate");eTS(582,1,{169:1,582:1,3:1,45:1},c4),eUe.Mb=function(e){return es_(this,e)},eUe.Lb=function(e){return es_(this,e)},eUe.Fb=function(e){var t;return!!M4(e,582)&&(t=Pp(e,582),eT$(this.a,t.a))},eUe.Hb=function(){return esS(this.a)+306654252},eUe.Ib=function(){return eE7(this.a)},Y6(eUf,"Predicates/AndPredicate",582),eTS(408,1998,{408:1,3:1},c6),eUe.Fb=function(e){var t;return!!M4(e,408)&&(t=Pp(e,408),ecX(this.a,t.a))},eUe.Hb=function(){return 1502476572+esj(this.a)},eUe.Ib=function(){return eUm+this.a+")"},eUe.Jb=function(e){return new c6(H6(e.Kb(this.a),"the Function passed to Optional.transform() must not return null."))},Y6(eUf,"Present",408),eTS(198,1,eUv),eUe.Nb=function(e){F9(this,e)},eUe.Qb=function(){g4()},Y6(eUy,"UnmodifiableIterator",198),eTS(1978,198,eUw),eUe.Qb=function(){g4()},eUe.Rb=function(e){throw p7(new bO)},eUe.Wb=function(e){throw p7(new bO)},Y6(eUy,"UnmodifiableListIterator",1978),eTS(386,1978,eUw),eUe.Ob=function(){return this.c0},eUe.Pb=function(){if(this.c>=this.d)throw p7(new bC);return this.Xb(this.c++)},eUe.Tb=function(){return this.c},eUe.Ub=function(){if(this.c<=0)throw p7(new bC);return this.Xb(--this.c)},eUe.Vb=function(){return this.c-1},eUe.c=0,eUe.d=0,Y6(eUy,"AbstractIndexedListIterator",386),eTS(699,198,eUv),eUe.Ob=function(){return erE(this)},eUe.Pb=function(){return QR(this)},eUe.e=1,Y6(eUy,"AbstractIterator",699),eTS(1986,1,{224:1}),eUe.Zb=function(){var e;return(e=this.f)||(this.f=this.ac())},eUe.Fb=function(e){return es6(this,e)},eUe.Hb=function(){return esj(this.Zb())},eUe.dc=function(){return 0==this.gc()},eUe.ec=function(){return Fh(this)},eUe.Ib=function(){return efF(this.Zb())},Y6(eUy,"AbstractMultimap",1986),eTS(726,1986,eU_),eUe.$b=function(){enK(this)},eUe._b=function(e){return yy(this,e)},eUe.ac=function(){return new wI(this,this.c)},eUe.ic=function(e){return this.hc()},eUe.bc=function(){return new OC(this,this.c)},eUe.jc=function(){return this.mc(this.hc())},eUe.kc=function(){return new m$(this)},eUe.lc=function(){return ew4(this.c.vc().Nc(),new o,64,this.d)},eUe.cc=function(e){return Zq(this,e)},eUe.fc=function(e){return eu8(this,e)},eUe.gc=function(){return this.d},eUe.mc=function(e){return Hj(),new fF(e)},eUe.nc=function(){return new mH(this)},eUe.oc=function(){return ew4(this.c.Cc().Nc(),new a,64,this.d)},eUe.pc=function(e,t){return new XS(this,e,t,null)},eUe.d=0,Y6(eUy,"AbstractMapBasedMultimap",726),eTS(1631,726,eU_),eUe.hc=function(){return new XM(this.a)},eUe.jc=function(){return Hj(),Hj(),e2r},eUe.cc=function(e){return Pp(Zq(this,e),15)},eUe.fc=function(e){return Pp(eu8(this,e),15)},eUe.Zb=function(){return HU(this)},eUe.Fb=function(e){return es6(this,e)},eUe.qc=function(e){return Pp(Zq(this,e),15)},eUe.rc=function(e){return Pp(eu8(this,e),15)},eUe.mc=function(e){return $a(Pp(e,15))},eUe.pc=function(e,t){return Vu(this,e,Pp(t,15),null)},Y6(eUy,"AbstractListMultimap",1631),eTS(732,1,eUE),eUe.Nb=function(e){F9(this,e)},eUe.Ob=function(){return this.c.Ob()||this.e.Ob()},eUe.Pb=function(){var e;return this.e.Ob()||(e=Pp(this.c.Pb(),42),this.b=e.cd(),this.a=Pp(e.dd(),14),this.e=this.a.Kc()),this.sc(this.b,this.e.Pb())},eUe.Qb=function(){this.e.Qb(),this.a.dc()&&this.c.Qb(),--this.d.d},Y6(eUy,"AbstractMapBasedMultimap/Itr",732),eTS(1099,732,eUE,mH),eUe.sc=function(e,t){return t},Y6(eUy,"AbstractMapBasedMultimap/1",1099),eTS(1100,1,{},a),eUe.Kb=function(e){return Pp(e,14).Nc()},Y6(eUy,"AbstractMapBasedMultimap/1methodref$spliterator$Type",1100),eTS(1101,732,eUE,m$),eUe.sc=function(e,t){return new wD(e,t)},Y6(eUy,"AbstractMapBasedMultimap/2",1101);var e1Y=RL(eUS,"Map");eTS(1967,1,eUk),eUe.wc=function(e){ear(this,e)},eUe.yc=function(e,t,n){return el5(this,e,t,n)},eUe.$b=function(){this.vc().$b()},eUe.tc=function(e){return emT(this,e)},eUe._b=function(e){return!!ewt(this,e,!1)},eUe.uc=function(e){var t,n,r;for(n=this.vc().Kc();n.Ob();)if(r=(t=Pp(n.Pb(),42)).dd(),xc(e)===xc(r)||null!=e&&ecX(e,r))return!0;return!1},eUe.Fb=function(e){var t,n,r;if(e===this)return!0;if(!M4(e,83)||(r=Pp(e,83),this.gc()!=r.gc()))return!1;for(n=r.vc().Kc();n.Ob();)if(t=Pp(n.Pb(),42),!this.tc(t))return!1;return!0},eUe.xc=function(e){return xu(ewt(this,e,!1))},eUe.Hb=function(){return eoP(this.vc())},eUe.dc=function(){return 0==this.gc()},eUe.ec=function(){return new fk(this)},eUe.zc=function(e,t){throw p7(new gW("Put not supported on this map"))},eUe.Ac=function(e){eij(this,e)},eUe.Bc=function(e){return xu(ewt(this,e,!0))},eUe.gc=function(){return this.vc().gc()},eUe.Ib=function(){return ewb(this)},eUe.Cc=function(){return new fT(this)},Y6(eUS,"AbstractMap",1967),eTS(1987,1967,eUk),eUe.bc=function(){return new wU(this)},eUe.vc=function(){return Fd(this)},eUe.ec=function(){var e;return(e=this.g)||(this.g=this.bc())},eUe.Cc=function(){var e;return(e=this.i)||(this.i=new wH(this))},Y6(eUy,"Maps/ViewCachingAbstractMap",1987),eTS(389,1987,eUk,wI),eUe.xc=function(e){return etl(this,e)},eUe.Bc=function(e){return euT(this,e)},eUe.$b=function(){this.d==this.e.c?this.e.$b():RG(new RK(this))},eUe._b=function(e){return ecD(this.d,e)},eUe.Ec=function(){return new c7(this)},eUe.Dc=function(){return this.Ec()},eUe.Fb=function(e){return this===e||ecX(this.d,e)},eUe.Hb=function(){return esj(this.d)},eUe.ec=function(){return this.e.ec()},eUe.gc=function(){return this.d.gc()},eUe.Ib=function(){return efF(this.d)},Y6(eUy,"AbstractMapBasedMultimap/AsMap",389);var e1B=RL(eUc,"Iterable");eTS(28,1,eUx),eUe.Jc=function(e){qX(this,e)},eUe.Lc=function(){return this.Oc()},eUe.Nc=function(){return new Gq(this,0)},eUe.Oc=function(){return new R1(null,this.Nc())},eUe.Fc=function(e){throw p7(new gW("Add not supported on this collection"))},eUe.Gc=function(e){return er7(this,e)},eUe.$b=function(){UG(this)},eUe.Hc=function(e){return eds(this,e,!1)},eUe.Ic=function(e){return eot(this,e)},eUe.dc=function(){return 0==this.gc()},eUe.Mc=function(e){return eds(this,e,!0)},eUe.Pc=function(){return Fn(this)},eUe.Qc=function(e){return emk(this,e)},eUe.Ib=function(){return e_F(this)},Y6(eUS,"AbstractCollection",28);var e1U=RL(eUS,"Set");eTS(eUT,28,eUM),eUe.Nc=function(){return new Gq(this,1)},eUe.Fb=function(e){return ehN(this,e)},eUe.Hb=function(){return eoP(this)},Y6(eUS,"AbstractSet",eUT),eTS(1970,eUT,eUM),Y6(eUy,"Sets/ImprovedAbstractSet",1970),eTS(1971,1970,eUM),eUe.$b=function(){this.Rc().$b()},eUe.Hc=function(e){return edz(this,e)},eUe.dc=function(){return this.Rc().dc()},eUe.Mc=function(e){var t;return!!this.Hc(e)&&(t=Pp(e,42),this.Rc().ec().Mc(t.cd()))},eUe.gc=function(){return this.Rc().gc()},Y6(eUy,"Maps/EntrySet",1971),eTS(1097,1971,eUM,c7),eUe.Hc=function(e){return ecC(this.a.d.vc(),e)},eUe.Kc=function(){return new RK(this.a)},eUe.Rc=function(){return this.a},eUe.Mc=function(e){var t;return!!ecC(this.a.d.vc(),e)&&(t=Pp(e,42),ZM(this.a.e,t.cd()),!0)},eUe.Nc=function(){return Pl(this.a.d.vc().Nc(),new le(this.a))},Y6(eUy,"AbstractMapBasedMultimap/AsMap/AsMapEntries",1097),eTS(1098,1,{},le),eUe.Kb=function(e){return qJ(this.a,Pp(e,42))},Y6(eUy,"AbstractMapBasedMultimap/AsMap/AsMapEntries/0methodref$wrapEntry$Type",1098),eTS(730,1,eUE,RK),eUe.Nb=function(e){F9(this,e)},eUe.Pb=function(){var e;return e=Pp(this.b.Pb(),42),this.a=Pp(e.dd(),14),qJ(this.c,e)},eUe.Ob=function(){return this.b.Ob()},eUe.Qb=function(){eah(!!this.a),this.b.Qb(),this.c.e.d-=this.a.gc(),this.a.$b(),this.a=null},Y6(eUy,"AbstractMapBasedMultimap/AsMap/AsMapIterator",730),eTS(532,1970,eUM,wU),eUe.$b=function(){this.b.$b()},eUe.Hc=function(e){return this.b._b(e)},eUe.Jc=function(e){Y8(e),this.b.wc(new lk(e))},eUe.dc=function(){return this.b.dc()},eUe.Kc=function(){return new gr(this.b.vc().Kc())},eUe.Mc=function(e){return!!this.b._b(e)&&(this.b.Bc(e),!0)},eUe.gc=function(){return this.b.gc()},Y6(eUy,"Maps/KeySet",532),eTS(318,532,eUM,OC),eUe.$b=function(){var e;RG((e=this.b.vc().Kc(),new wg(this,e)))},eUe.Ic=function(e){return this.b.ec().Ic(e)},eUe.Fb=function(e){return this===e||ecX(this.b.ec(),e)},eUe.Hb=function(){return esj(this.b.ec())},eUe.Kc=function(){var e;return e=this.b.vc().Kc(),new wg(this,e)},eUe.Mc=function(e){var t,n;return n=0,(t=Pp(this.b.Bc(e),14))&&(n=t.gc(),t.$b(),this.a.d-=n),n>0},eUe.Nc=function(){return this.b.ec().Nc()},Y6(eUy,"AbstractMapBasedMultimap/KeySet",318),eTS(731,1,eUE,wg),eUe.Nb=function(e){F9(this,e)},eUe.Ob=function(){return this.c.Ob()},eUe.Pb=function(){return this.a=Pp(this.c.Pb(),42),this.a.cd()},eUe.Qb=function(){var e;eah(!!this.a),e=Pp(this.a.dd(),14),this.c.Qb(),this.b.a.d-=e.gc(),e.$b(),this.a=null},Y6(eUy,"AbstractMapBasedMultimap/KeySet/1",731),eTS(491,389,{83:1,161:1},LX),eUe.bc=function(){return this.Sc()},eUe.ec=function(){return this.Tc()},eUe.Sc=function(){return new wb(this.c,this.Uc())},eUe.Tc=function(){var e;return(e=this.b)||(this.b=this.Sc())},eUe.Uc=function(){return Pp(this.d,161)},Y6(eUy,"AbstractMapBasedMultimap/SortedAsMap",491),eTS(542,491,eUO,LJ),eUe.bc=function(){return new wm(this.a,Pp(Pp(this.d,161),171))},eUe.Sc=function(){return new wm(this.a,Pp(Pp(this.d,161),171))},eUe.ec=function(){var e;return Pp((e=this.b)||(this.b=new wm(this.a,Pp(Pp(this.d,161),171))),271)},eUe.Tc=function(){var e;return Pp((e=this.b)||(this.b=new wm(this.a,Pp(Pp(this.d,161),171))),271)},eUe.Uc=function(){return Pp(Pp(this.d,161),171)},Y6(eUy,"AbstractMapBasedMultimap/NavigableAsMap",542),eTS(490,318,eUA,wb),eUe.Nc=function(){return this.b.ec().Nc()},Y6(eUy,"AbstractMapBasedMultimap/SortedKeySet",490),eTS(388,490,eUL,wm),Y6(eUy,"AbstractMapBasedMultimap/NavigableKeySet",388),eTS(541,28,eUx,XS),eUe.Fc=function(e){var t,n;return efH(this),n=this.d.dc(),(t=this.d.Fc(e))&&(++this.f.d,n&&CP(this)),t},eUe.Gc=function(e){var t,n,r;return!e.dc()&&(r=(efH(this),this.d.gc()),(t=this.d.Gc(e))&&(n=this.d.gc(),this.f.d+=n-r,0==r&&CP(this)),t)},eUe.$b=function(){var e;0!=(e=(efH(this),this.d.gc()))&&(this.d.$b(),this.f.d-=e,jY(this))},eUe.Hc=function(e){return efH(this),this.d.Hc(e)},eUe.Ic=function(e){return efH(this),this.d.Ic(e)},eUe.Fb=function(e){return e===this||(efH(this),ecX(this.d,e))},eUe.Hb=function(){return efH(this),esj(this.d)},eUe.Kc=function(){return efH(this),new PS(this)},eUe.Mc=function(e){var t;return efH(this),(t=this.d.Mc(e))&&(--this.f.d,jY(this)),t},eUe.gc=function(){return xw(this)},eUe.Nc=function(){return efH(this),this.d.Nc()},eUe.Ib=function(){return efH(this),efF(this.d)},Y6(eUy,"AbstractMapBasedMultimap/WrappedCollection",541);var e1H=RL(eUS,"List");eTS(728,541,{20:1,28:1,14:1,15:1},Fo),eUe.ad=function(e){er9(this,e)},eUe.Nc=function(){return efH(this),this.d.Nc()},eUe.Vc=function(e,t){var n;efH(this),n=this.d.dc(),Pp(this.d,15).Vc(e,t),++this.a.d,n&&CP(this)},eUe.Wc=function(e,t){var n,r,i;return!t.dc()&&(i=(efH(this),this.d.gc()),(n=Pp(this.d,15).Wc(e,t))&&(r=this.d.gc(),this.a.d+=r-i,0==i&&CP(this)),n)},eUe.Xb=function(e){return efH(this),Pp(this.d,15).Xb(e)},eUe.Xc=function(e){return efH(this),Pp(this.d,15).Xc(e)},eUe.Yc=function(){return efH(this),new Mb(this)},eUe.Zc=function(e){return efH(this),new HM(this,e)},eUe.$c=function(e){var t;return efH(this),t=Pp(this.d,15).$c(e),--this.a.d,jY(this),t},eUe._c=function(e,t){return efH(this),Pp(this.d,15)._c(e,t)},eUe.bd=function(e,t){return efH(this),Vu(this.a,this.e,Pp(this.d,15).bd(e,t),this.b?this.b:this)},Y6(eUy,"AbstractMapBasedMultimap/WrappedList",728),eTS(1096,728,{20:1,28:1,14:1,15:1,54:1},A7),Y6(eUy,"AbstractMapBasedMultimap/RandomAccessWrappedList",1096),eTS(620,1,eUE,PS),eUe.Nb=function(e){F9(this,e)},eUe.Ob=function(){return UW(this),this.b.Ob()},eUe.Pb=function(){return UW(this),this.b.Pb()},eUe.Qb=function(){OG(this)},Y6(eUy,"AbstractMapBasedMultimap/WrappedCollection/WrappedIterator",620),eTS(729,620,eUC,Mb,HM),eUe.Qb=function(){OG(this)},eUe.Rb=function(e){var t;t=0==xw(this.a),(UW(this),Pp(this.b,125)).Rb(e),++this.a.a.d,t&&CP(this.a)},eUe.Sb=function(){return(UW(this),Pp(this.b,125)).Sb()},eUe.Tb=function(){return(UW(this),Pp(this.b,125)).Tb()},eUe.Ub=function(){return(UW(this),Pp(this.b,125)).Ub()},eUe.Vb=function(){return(UW(this),Pp(this.b,125)).Vb()},eUe.Wb=function(e){(UW(this),Pp(this.b,125)).Wb(e)},Y6(eUy,"AbstractMapBasedMultimap/WrappedList/WrappedListIterator",729),eTS(727,541,eUA,L3),eUe.Nc=function(){return efH(this),this.d.Nc()},Y6(eUy,"AbstractMapBasedMultimap/WrappedSortedSet",727),eTS(1095,727,eUL,TB),Y6(eUy,"AbstractMapBasedMultimap/WrappedNavigableSet",1095),eTS(1094,541,eUM,L4),eUe.Nc=function(){return efH(this),this.d.Nc()},Y6(eUy,"AbstractMapBasedMultimap/WrappedSet",1094),eTS(1103,1,{},o),eUe.Kb=function(e){return Xb(Pp(e,42))},Y6(eUy,"AbstractMapBasedMultimap/lambda$1$Type",1103),eTS(1102,1,{},lt),eUe.Kb=function(e){return new wD(this.a,e)},Y6(eUy,"AbstractMapBasedMultimap/lambda$2$Type",1102);var e1$=RL(eUS,"Map/Entry");eTS(345,1,eUI),eUe.Fb=function(e){var t;return!!M4(e,42)&&(t=Pp(e,42),BG(this.cd(),t.cd())&&BG(this.dd(),t.dd()))},eUe.Hb=function(){var e,t;return e=this.cd(),t=this.dd(),(null==e?0:esj(e))^(null==t?0:esj(t))},eUe.ed=function(e){throw p7(new bO)},eUe.Ib=function(){return this.cd()+"="+this.dd()},Y6(eUy,eUD,345),eTS(1988,28,eUx),eUe.$b=function(){this.fd().$b()},eUe.Hc=function(e){var t;return!!M4(e,42)&&(t=Pp(e,42),Kr(this.fd(),t.cd(),t.dd()))},eUe.Mc=function(e){var t;return!!M4(e,42)&&(t=Pp(e,42),Ki(this.fd(),t.cd(),t.dd()))},eUe.gc=function(){return this.fd().d},Y6(eUy,"Multimaps/Entries",1988),eTS(733,1988,eUx,ln),eUe.Kc=function(){return this.a.kc()},eUe.fd=function(){return this.a},eUe.Nc=function(){return this.a.lc()},Y6(eUy,"AbstractMultimap/Entries",733),eTS(734,733,eUM,mz),eUe.Nc=function(){return this.a.lc()},eUe.Fb=function(e){return eEB(this,e)},eUe.Hb=function(){return eie(this)},Y6(eUy,"AbstractMultimap/EntrySet",734),eTS(735,28,eUx,lr),eUe.$b=function(){this.a.$b()},eUe.Hc=function(e){return eun(this.a,e)},eUe.Kc=function(){return this.a.nc()},eUe.gc=function(){return this.a.d},eUe.Nc=function(){return this.a.oc()},Y6(eUy,"AbstractMultimap/Values",735),eTS(1989,28,{835:1,20:1,28:1,14:1}),eUe.Jc=function(e){Y8(e),Uz(this).Jc(new lS(e))},eUe.Nc=function(){var e;return ew4(e=Uz(this).Nc(),new y,64|1296&e.qd(),this.a.d)},eUe.Fc=function(e){return g6(),!0},eUe.Gc=function(e){return Y8(this),Y8(e),M4(e,543)?KM(Pp(e,835)):!e.dc()&&eel(this,e.Kc())},eUe.Hc=function(e){var t;return((t=Pp(ecA(HU(this.a),e),14))?t.gc():0)>0},eUe.Fb=function(e){return eMc(this,e)},eUe.Hb=function(){return esj(Uz(this))},eUe.dc=function(){return Uz(this).dc()},eUe.Mc=function(e){return ekJ(this,e,1)>0},eUe.Ib=function(){return efF(Uz(this))},Y6(eUy,"AbstractMultiset",1989),eTS(1991,1970,eUM),eUe.$b=function(){enK(this.a.a)},eUe.Hc=function(e){var t,n;return!!M4(e,492)&&(n=Pp(e,416),!(0>=Pp(n.a.dd(),14).gc())&&(t=GB(this.a,n.a.cd()))==Pp(n.a.dd(),14).gc())},eUe.Mc=function(e){var t,n,r,i;return!!M4(e,492)&&(t=(n=Pp(e,416)).a.cd(),0!=(r=Pp(n.a.dd(),14).gc()))&&ekQ(i=this.a,t,r)},Y6(eUy,"Multisets/EntrySet",1991),eTS(1109,1991,eUM,li),eUe.Kc=function(){return new ga(Fd(HU(this.a.a)).Kc())},eUe.gc=function(){return HU(this.a.a).gc()},Y6(eUy,"AbstractMultiset/EntrySet",1109),eTS(619,726,eU_),eUe.hc=function(){return this.gd()},eUe.jc=function(){return this.hd()},eUe.cc=function(e){return this.jd(e)},eUe.fc=function(e){return this.kd(e)},eUe.Zb=function(){var e;return(e=this.f)||(this.f=this.ac())},eUe.hd=function(){return Hj(),Hj(),e2a},eUe.Fb=function(e){return es6(this,e)},eUe.jd=function(e){return Pp(Zq(this,e),21)},eUe.kd=function(e){return Pp(eu8(this,e),21)},eUe.mc=function(e){return Hj(),new vd(Pp(e,21))},eUe.pc=function(e,t){return new L4(this,e,Pp(t,21))},Y6(eUy,"AbstractSetMultimap",619),eTS(1657,619,eU_),eUe.hc=function(){return new yB(this.b)},eUe.gd=function(){return new yB(this.b)},eUe.jc=function(){return Bo(new yB(this.b))},eUe.hd=function(){return Bo(new yB(this.b))},eUe.cc=function(e){return Pp(Pp(Zq(this,e),21),84)},eUe.jd=function(e){return Pp(Pp(Zq(this,e),21),84)},eUe.fc=function(e){return Pp(Pp(eu8(this,e),21),84)},eUe.kd=function(e){return Pp(Pp(eu8(this,e),21),84)},eUe.mc=function(e){return M4(e,271)?Bo(Pp(e,271)):(Hj(),new O4(Pp(e,84)))},eUe.Zb=function(){var e;return(e=this.f)||(this.f=M4(this.c,171)?new LJ(this,Pp(this.c,171)):M4(this.c,161)?new LX(this,Pp(this.c,161)):new wI(this,this.c))},eUe.pc=function(e,t){return M4(t,271)?new TB(this,e,Pp(t,271)):new L3(this,e,Pp(t,84))},Y6(eUy,"AbstractSortedSetMultimap",1657),eTS(1658,1657,eU_),eUe.Zb=function(){var e;return Pp(Pp((e=this.f)||(this.f=M4(this.c,171)?new LJ(this,Pp(this.c,171)):M4(this.c,161)?new LX(this,Pp(this.c,161)):new wI(this,this.c)),161),171)},eUe.ec=function(){var e;return Pp(Pp((e=this.i)||(this.i=M4(this.c,171)?new wm(this,Pp(this.c,171)):M4(this.c,161)?new wb(this,Pp(this.c,161)):new OC(this,this.c)),84),271)},eUe.bc=function(){return M4(this.c,171)?new wm(this,Pp(this.c,171)):M4(this.c,161)?new wb(this,Pp(this.c,161)):new OC(this,this.c)},Y6(eUy,"AbstractSortedKeySortedSetMultimap",1658),eTS(2010,1,{1947:1}),eUe.Fb=function(e){return ev7(this,e)},eUe.Hb=function(){var e;return eoP((e=this.g)||(this.g=new la(this)))},eUe.Ib=function(){var e;return ewb((e=this.f)||(this.f=new OP(this)))},Y6(eUy,"AbstractTable",2010),eTS(665,eUT,eUM,la),eUe.$b=function(){g5()},eUe.Hc=function(e){var t,n;return!!M4(e,468)&&(t=Pp(e,682),!!(n=Pp(ecA(Y7(this.a),xh(t.c.e,t.b)),83))&&ecC(n.vc(),new wD(xh(t.c.c,t.a),X_(t.c,t.b,t.a))))},eUe.Kc=function(){return $e(this.a)},eUe.Mc=function(e){var t,n;return!!M4(e,468)&&(t=Pp(e,682),!!(n=Pp(ecA(Y7(this.a),xh(t.c.e,t.b)),83))&&ecI(n.vc(),new wD(xh(t.c.c,t.a),X_(t.c,t.b,t.a))))},eUe.gc=function(){return R9(this.a)},eUe.Nc=function(){return KH(this.a)},Y6(eUy,"AbstractTable/CellSet",665),eTS(1928,28,eUx,lo),eUe.$b=function(){g5()},eUe.Hc=function(e){return ewx(this.a,e)},eUe.Kc=function(){return $t(this.a)},eUe.gc=function(){return R9(this.a)},eUe.Nc=function(){return Kd(this.a)},Y6(eUy,"AbstractTable/Values",1928),eTS(1632,1631,eU_),Y6(eUy,"ArrayListMultimapGwtSerializationDependencies",1632),eTS(513,1632,eU_,gQ,G$),eUe.hc=function(){return new XM(this.a)},eUe.a=0,Y6(eUy,"ArrayListMultimap",513),eTS(664,2010,{664:1,1947:1,3:1},exj),Y6(eUy,"ArrayTable",664),eTS(1924,386,eUw,OI),eUe.Xb=function(e){return new eo7(this.a,e)},Y6(eUy,"ArrayTable/1",1924),eTS(1925,1,{},c5),eUe.ld=function(e){return new eo7(this.a,e)},Y6(eUy,"ArrayTable/1methodref$getCell$Type",1925),eTS(2011,1,{682:1}),eUe.Fb=function(e){var t;return e===this||!!M4(e,468)&&(t=Pp(e,682),BG(xh(this.c.e,this.b),xh(t.c.e,t.b))&&BG(xh(this.c.c,this.a),xh(t.c.c,t.a))&&BG(X_(this.c,this.b,this.a),X_(t.c,t.b,t.a)))},eUe.Hb=function(){return euF(eow(vx(e1R,1),eUp,1,5,[xh(this.c.e,this.b),xh(this.c.c,this.a),X_(this.c,this.b,this.a)]))},eUe.Ib=function(){return"("+xh(this.c.e,this.b)+","+xh(this.c.c,this.a)+")="+X_(this.c,this.b,this.a)},Y6(eUy,"Tables/AbstractCell",2011),eTS(468,2011,{468:1,682:1},eo7),eUe.a=0,eUe.b=0,eUe.d=0,Y6(eUy,"ArrayTable/2",468),eTS(1927,1,{},c8),eUe.ld=function(e){return Qo(this.a,e)},Y6(eUy,"ArrayTable/2methodref$getValue$Type",1927),eTS(1926,386,eUw,OD),eUe.Xb=function(e){return Qo(this.a,e)},Y6(eUy,"ArrayTable/3",1926),eTS(1979,1967,eUk),eUe.$b=function(){RG(this.kc())},eUe.vc=function(){return new lx(this)},eUe.lc=function(){return new Uq(this.kc(),this.gc())},Y6(eUy,"Maps/IteratorBasedAbstractMap",1979),eTS(828,1979,eUk),eUe.$b=function(){throw p7(new bO)},eUe._b=function(e){return yE(this.c,e)},eUe.kc=function(){return new ON(this,this.c.b.c.gc())},eUe.lc=function(){return Rj(this.c.b.c.gc(),16,new c9(this))},eUe.xc=function(e){var t;return(t=Pp(Iq(this.c,e),19))?this.nd(t.a):null},eUe.dc=function(){return this.c.b.c.dc()},eUe.ec=function(){return Fl(this.c)},eUe.zc=function(e,t){var n;if(!(n=Pp(Iq(this.c,e),19)))throw p7(new gL(this.md()+" "+e+" not in "+Fl(this.c)));return this.od(n.a,t)},eUe.Bc=function(e){throw p7(new bO)},eUe.gc=function(){return this.c.b.c.gc()},Y6(eUy,"ArrayTable/ArrayMap",828),eTS(1923,1,{},c9),eUe.ld=function(e){return Bs(this.a,e)},Y6(eUy,"ArrayTable/ArrayMap/0methodref$getEntry$Type",1923),eTS(1921,345,eUI,wk),eUe.cd=function(){return OB(this.a,this.b)},eUe.dd=function(){return this.a.nd(this.b)},eUe.ed=function(e){return this.a.od(this.b,e)},eUe.b=0,Y6(eUy,"ArrayTable/ArrayMap/1",1921),eTS(1922,386,eUw,ON),eUe.Xb=function(e){return Bs(this.a,e)},Y6(eUy,"ArrayTable/ArrayMap/2",1922),eTS(1920,828,eUk,F2),eUe.md=function(){return"Column"},eUe.nd=function(e){return X_(this.b,this.a,e)},eUe.od=function(e,t){return eoy(this.b,this.a,e,t)},eUe.a=0,Y6(eUy,"ArrayTable/Row",1920),eTS(829,828,eUk,OP),eUe.nd=function(e){return new F2(this.a,e)},eUe.zc=function(e,t){return Pp(t,83),g8()},eUe.od=function(e,t){return Pp(t,83),g9()},eUe.md=function(){return"Row"},Y6(eUy,"ArrayTable/RowMap",829),eTS(1120,1,eUj,wx),eUe.qd=function(){return -262&this.a.qd()},eUe.rd=function(){return this.a.rd()},eUe.Nb=function(e){this.a.Nb(new ww(e,this.b))},eUe.sd=function(e){return this.a.sd(new wy(e,this.b))},Y6(eUy,"CollectSpliterators/1",1120),eTS(1121,1,eUF,wy),eUe.td=function(e){this.a.td(this.b.Kb(e))},Y6(eUy,"CollectSpliterators/1/lambda$0$Type",1121),eTS(1122,1,eUF,ww),eUe.td=function(e){this.a.td(this.b.Kb(e))},Y6(eUy,"CollectSpliterators/1/lambda$1$Type",1122),eTS(1123,1,eUj,K4),eUe.qd=function(){return this.a},eUe.rd=function(){return this.d&&(this.b=MS(this.b,this.d.rd())),MS(this.b,0)},eUe.Nb=function(e){this.d&&(this.d.Nb(e),this.d=null),this.c.Nb(new wv(this.e,e)),this.b=0},eUe.sd=function(e){for(;;){if(this.d&&this.d.sd(e))return xg(this.b,eUY)&&(this.b=efe(this.b,1)),!0;if(this.d=null,!this.c.sd(new w_(this,this.e)))return!1}},eUe.a=0,eUe.b=0,Y6(eUy,"CollectSpliterators/1FlatMapSpliterator",1123),eTS(1124,1,eUF,w_),eUe.td=function(e){Iv(this.a,this.b,e)},Y6(eUy,"CollectSpliterators/1FlatMapSpliterator/lambda$0$Type",1124),eTS(1125,1,eUF,wv),eUe.td=function(e){M8(this.b,this.a,e)},Y6(eUy,"CollectSpliterators/1FlatMapSpliterator/lambda$1$Type",1125),eTS(1117,1,eUj,Ig),eUe.qd=function(){return 16464|this.b},eUe.rd=function(){return this.a.rd()},eUe.Nb=function(e){this.a.xe(new wS(e,this.c))},eUe.sd=function(e){return this.a.ye(new wE(e,this.c))},eUe.b=0,Y6(eUy,"CollectSpliterators/1WithCharacteristics",1117),eTS(1118,1,eUB,wE),eUe.ud=function(e){this.a.td(this.b.ld(e))},Y6(eUy,"CollectSpliterators/1WithCharacteristics/lambda$0$Type",1118),eTS(1119,1,eUB,wS),eUe.ud=function(e){this.a.td(this.b.ld(e))},Y6(eUy,"CollectSpliterators/1WithCharacteristics/lambda$1$Type",1119),eTS(245,1,eUU),eUe.wd=function(e){return this.vd(Pp(e,245))},eUe.vd=function(e){var t;return e==(m2(),e0d)?1:e==(m3(),e0f)?-1:0!=(t=(Rg(),eiK(this.a,e.a)))?t:M4(this,519)==M4(e,519)?0:M4(this,519)?1:-1},eUe.zd=function(){return this.a},eUe.Fb=function(e){return ehd(this,e)},Y6(eUy,"Cut",245),eTS(1761,245,eUU,vb),eUe.vd=function(e){return e==this?0:1},eUe.xd=function(e){throw p7(new b_)},eUe.yd=function(e){e.a+="+∞)"},eUe.zd=function(){throw p7(new gC(eUH))},eUe.Hb=function(){return wK(),ebh(this)},eUe.Ad=function(e){return!1},eUe.Ib=function(){return"+∞"},Y6(eUy,"Cut/AboveAll",1761),eTS(519,245,{245:1,519:1,3:1,35:1},OW),eUe.xd=function(e){xT((e.a+="(",e),this.a)},eUe.yd=function(e){Bd(xT(e,this.a),93)},eUe.Hb=function(){return~esj(this.a)},eUe.Ad=function(e){return Rg(),0>eiK(this.a,e)},eUe.Ib=function(){return"/"+this.a+"\\"},Y6(eUy,"Cut/AboveValue",519),eTS(1760,245,eUU,vm),eUe.vd=function(e){return e==this?0:-1},eUe.xd=function(e){e.a+="(-∞"},eUe.yd=function(e){throw p7(new b_)},eUe.zd=function(){throw p7(new gC(eUH))},eUe.Hb=function(){return wK(),ebh(this)},eUe.Ad=function(e){return!0},eUe.Ib=function(){return"-∞"},Y6(eUy,"Cut/BelowAll",1760),eTS(1762,245,eUU,OK),eUe.xd=function(e){xT((e.a+="[",e),this.a)},eUe.yd=function(e){Bd(xT(e,this.a),41)},eUe.Hb=function(){return esj(this.a)},eUe.Ad=function(e){return Rg(),0>=eiK(this.a,e)},eUe.Ib=function(){return"\\"+this.a+"/"},Y6(eUy,"Cut/BelowValue",1762),eTS(537,1,eU$),eUe.Jc=function(e){qX(this,e)},eUe.Ib=function(){return elq(Pp(H6(this,"use Optional.orNull() instead of Optional.or(null)"),20).Kc())},Y6(eUy,"FluentIterable",537),eTS(433,537,eU$,xq),eUe.Kc=function(){return new Fa(OH(this.a.Kc(),new c))},Y6(eUy,"FluentIterable/2",433),eTS(1046,537,eU$,xZ),eUe.Kc=function(){return Y_(this)},Y6(eUy,"FluentIterable/3",1046),eTS(708,386,eUw,Oj),eUe.Xb=function(e){return this.a[e].Kc()},Y6(eUy,"FluentIterable/3/1",708),eTS(1972,1,{}),eUe.Ib=function(){return efF(this.Bd().b)},Y6(eUy,"ForwardingObject",1972),eTS(1973,1972,eUz),eUe.Bd=function(){return this.Cd()},eUe.Jc=function(e){qX(this,e)},eUe.Lc=function(){return this.Oc()},eUe.Nc=function(){return new Gq(this,0)},eUe.Oc=function(){return new R1(null,this.Nc())},eUe.Fc=function(e){return this.Cd(),yD()},eUe.Gc=function(e){return this.Cd(),yN()},eUe.$b=function(){this.Cd(),yP()},eUe.Hc=function(e){return this.Cd().Hc(e)},eUe.Ic=function(e){return this.Cd().Ic(e)},eUe.dc=function(){return this.Cd().b.dc()},eUe.Kc=function(){return this.Cd().Kc()},eUe.Mc=function(e){return this.Cd(),yR()},eUe.gc=function(){return this.Cd().b.gc()},eUe.Pc=function(){return this.Cd().Pc()},eUe.Qc=function(e){return this.Cd().Qc(e)},Y6(eUy,"ForwardingCollection",1973),eTS(1980,28,eUG),eUe.Kc=function(){return this.Ed()},eUe.Fc=function(e){throw p7(new bO)},eUe.Gc=function(e){throw p7(new bO)},eUe.$b=function(){throw p7(new bO)},eUe.Hc=function(e){return null!=e&&eds(this,e,!1)},eUe.Dd=function(){switch(this.gc()){case 0:return Bx(),Bx(),e0h;case 1:return Bx(),new Rz(Y8(this.Ed().Pb()));default:return new F3(this,this.Pc())}},eUe.Mc=function(e){throw p7(new bO)},Y6(eUy,"ImmutableCollection",1980),eTS(712,1980,eUG,bb),eUe.Kc=function(){return JJ(this.a.Kc())},eUe.Hc=function(e){return null!=e&&this.a.Hc(e)},eUe.Ic=function(e){return this.a.Ic(e)},eUe.dc=function(){return this.a.dc()},eUe.Ed=function(){return JJ(this.a.Kc())},eUe.gc=function(){return this.a.gc()},eUe.Pc=function(){return this.a.Pc()},eUe.Qc=function(e){return this.a.Qc(e)},eUe.Ib=function(){return efF(this.a)},Y6(eUy,"ForwardingImmutableCollection",712),eTS(152,1980,eUW),eUe.Kc=function(){return this.Ed()},eUe.Yc=function(){return this.Fd(0)},eUe.Zc=function(e){return this.Fd(e)},eUe.ad=function(e){er9(this,e)},eUe.Nc=function(){return new Gq(this,16)},eUe.bd=function(e,t){return this.Gd(e,t)},eUe.Vc=function(e,t){throw p7(new bO)},eUe.Wc=function(e,t){throw p7(new bO)},eUe.Fb=function(e){return eTJ(this,e)},eUe.Hb=function(){return eaI(this)},eUe.Xc=function(e){return null==e?-1:emx(this,e)},eUe.Ed=function(){return this.Fd(0)},eUe.Fd=function(e){return AR(this,e)},eUe.$c=function(e){throw p7(new bO)},eUe._c=function(e,t){throw p7(new bO)},eUe.Gd=function(e,t){var n;return ecT((n=new wz(this),new Gz(n,e,t)))},Y6(eUy,"ImmutableList",152),eTS(2006,152,eUW),eUe.Kc=function(){return JJ(this.Hd().Kc())},eUe.bd=function(e,t){return ecT(this.Hd().bd(e,t))},eUe.Hc=function(e){return null!=e&&this.Hd().Hc(e)},eUe.Ic=function(e){return this.Hd().Ic(e)},eUe.Fb=function(e){return ecX(this.Hd(),e)},eUe.Xb=function(e){return xh(this,e)},eUe.Hb=function(){return esj(this.Hd())},eUe.Xc=function(e){return this.Hd().Xc(e)},eUe.dc=function(){return this.Hd().dc()},eUe.Ed=function(){return JJ(this.Hd().Kc())},eUe.gc=function(){return this.Hd().gc()},eUe.Gd=function(e,t){return ecT(this.Hd().bd(e,t))},eUe.Pc=function(){return this.Hd().Qc(Je(e1R,eUp,1,this.Hd().gc(),5,1))},eUe.Qc=function(e){return this.Hd().Qc(e)},eUe.Ib=function(){return efF(this.Hd())},Y6(eUy,"ForwardingImmutableList",2006),eTS(714,1,eUV),eUe.vc=function(){return Fc(this)},eUe.wc=function(e){ear(this,e)},eUe.ec=function(){return Fl(this)},eUe.yc=function(e,t,n){return el5(this,e,t,n)},eUe.Cc=function(){return this.Ld()},eUe.$b=function(){throw p7(new bO)},eUe._b=function(e){return null!=this.xc(e)},eUe.uc=function(e){return this.Ld().Hc(e)},eUe.Jd=function(){return new bm(this)},eUe.Kd=function(){return new bg(this)},eUe.Fb=function(e){return eua(this,e)},eUe.Hb=function(){return Fc(this).Hb()},eUe.dc=function(){return 0==this.gc()},eUe.zc=function(e,t){return g7()},eUe.Bc=function(e){throw p7(new bO)},eUe.Ib=function(){return eEo(this)},eUe.Ld=function(){return this.e?this.e:this.e=this.Kd()},eUe.c=null,eUe.d=null,eUe.e=null,Y6(eUy,"ImmutableMap",714),eTS(715,714,eUV),eUe._b=function(e){return yE(this,e)},eUe.uc=function(e){return w1(this.b,e)},eUe.Id=function(){return ecM(new lu(this))},eUe.Jd=function(){return ecM(Uk(this.b))},eUe.Kd=function(){return Dn(),new bb(UE(this.b))},eUe.Fb=function(e){return w2(this.b,e)},eUe.xc=function(e){return Iq(this,e)},eUe.Hb=function(){return esj(this.b.c)},eUe.dc=function(){return this.b.c.dc()},eUe.gc=function(){return this.b.c.gc()},eUe.Ib=function(){return efF(this.b.c)},Y6(eUy,"ForwardingImmutableMap",715),eTS(1974,1973,eUq),eUe.Bd=function(){return this.Md()},eUe.Cd=function(){return this.Md()},eUe.Nc=function(){return new Gq(this,1)},eUe.Fb=function(e){return e===this||this.Md().Fb(e)},eUe.Hb=function(){return this.Md().Hb()},Y6(eUy,"ForwardingSet",1974),eTS(1069,1974,eUq,lu),eUe.Bd=function(){return US(this.a.b)},eUe.Cd=function(){return US(this.a.b)},eUe.Hc=function(e){if(M4(e,42)&&null==Pp(e,42).cd())return!1;try{return wQ(US(this.a.b),e)}catch(t){if(t=eoa(t),M4(t,205))return!1;throw p7(t)}},eUe.Md=function(){return US(this.a.b)},eUe.Qc=function(e){var t;return t=$L(US(this.a.b),e),US(this.a.b).b.gc()=0?"+":"")+(n/60|0),t=Tt(eB4.Math.abs(n)%60),(e_E(),e2l)[this.q.getDay()]+" "+e2f[this.q.getMonth()]+" "+Tt(this.q.getDate())+" "+Tt(this.q.getHours())+":"+Tt(this.q.getMinutes())+":"+Tt(this.q.getSeconds())+" GMT"+e+t+" "+this.q.getFullYear()};var e1Q=Y6(eUS,"Date",199);eTS(1915,199,eHB,evI),eUe.a=!1,eUe.b=0,eUe.c=0,eUe.d=0,eUe.e=0,eUe.f=0,eUe.g=!1,eUe.i=0,eUe.j=0,eUe.k=0,eUe.n=0,eUe.o=0,eUe.p=0,Y6("com.google.gwt.i18n.shared.impl","DateRecord",1915),eTS(1966,1,{}),eUe.fe=function(){return null},eUe.ge=function(){return null},eUe.he=function(){return null},eUe.ie=function(){return null},eUe.je=function(){return null},Y6(eHU,"JSONValue",1966),eTS(216,1966,{216:1},lN,lL),eUe.Fb=function(e){return!!M4(e,216)&&W$(this.a,Pp(e,216).a)},eUe.ee=function(){return be},eUe.Hb=function(){return $n(this.a)},eUe.fe=function(){return this},eUe.Ib=function(){var e,t,n;for(t=0,n=new O0("["),e=this.a.length;t0&&(n.a+=","),xT(n,eep(this,t));return n.a+="]",n.a},Y6(eHU,"JSONArray",216),eTS(483,1966,{483:1},lC),eUe.ee=function(){return bt},eUe.ge=function(){return this},eUe.Ib=function(){return OQ(),""+this.a},eUe.a=!1,Y6(eHU,"JSONBoolean",483),eTS(985,60,eHr,gs),Y6(eHU,"JSONException",985),eTS(1023,1966,{},g),eUe.ee=function(){return bo},eUe.Ib=function(){return eUg},Y6(eHU,"JSONNull",1023),eTS(258,1966,{258:1},lI),eUe.Fb=function(e){return!!M4(e,258)&&this.a==Pp(e,258).a},eUe.ee=function(){return bn},eUe.Hb=function(){return Ti(this.a)},eUe.he=function(){return this},eUe.Ib=function(){return this.a+""},eUe.a=0,Y6(eHU,"JSONNumber",258),eTS(183,1966,{183:1},gu,lD),eUe.Fb=function(e){return!!M4(e,183)&&W$(this.a,Pp(e,183).a)},eUe.ee=function(){return br},eUe.Hb=function(){return $n(this.a)},eUe.ie=function(){return this},eUe.Ib=function(){var e,t,n,r,i,a,o;for(r=0,o=new O0("{"),e=!0,i=(n=a=erG(this,Je(e17,eUP,2,0,6,1))).length;r=0?":"+this.c:"")+")"},eUe.c=0;var e19=Y6(eUc,"StackTraceElement",310);e0c={3:1,475:1,35:1,2:1};var e17=Y6(eUc,eHa,2);eTS(107,418,{475:1},vs,vu,O1),Y6(eUc,"StringBuffer",107),eTS(100,418,{475:1},vc,vl,O0),Y6(eUc,"StringBuilder",100),eTS(687,73,eHZ,vf),Y6(eUc,"StringIndexOutOfBoundsException",687),eTS(2043,1,{}),eTS(844,1,{},N),eUe.Kb=function(e){return Pp(e,78).e},Y6(eUc,"Throwable/lambda$0$Type",844),eTS(41,60,{3:1,102:1,60:1,78:1,41:1},bO,gW),Y6(eUc,"UnsupportedOperationException",41),eTS(240,236,{3:1,35:1,236:1,240:1},eew,yY),eUe.wd=function(e){return eDG(this,Pp(e,240))},eUe.ke=function(){return eEu(eRy(this))},eUe.Fb=function(e){var t;return this===e||!!M4(e,240)&&(t=Pp(e,240),this.e==t.e&&0==eDG(this,t))},eUe.Hb=function(){var e;return 0!=this.b?this.b:this.a<54?(e=eap(this.f),this.b=jE(WM(e,-1)),this.b=33*this.b+jE(WM(Fv(e,32),-1)),this.b=17*this.b+zy(this.e),this.b):(this.b=17*ect(this.c)+zy(this.e),this.b)},eUe.Ib=function(){return eRy(this)},eUe.a=0,eUe.b=0,eUe.d=0,eUe.e=0,eUe.f=0;var e0e=Y6("java.math","BigDecimal",240);eTS(91,236,{3:1,35:1,236:1,91:1},ep4,XE,F7,ey$,eh6,TU),eUe.wd=function(e){return ehI(this,Pp(e,91))},eUe.ke=function(){return eEu(eBw(this,0))},eUe.Fb=function(e){return ef5(this,e)},eUe.Hb=function(){return ect(this)},eUe.Ib=function(){return eBw(this,0)},eUe.b=-2,eUe.c=0,eUe.d=0,eUe.e=0;var e0t=Y6("java.math","BigInteger",91);eTS(488,1967,eUk),eUe.$b=function(){Yy(this)},eUe._b=function(e){return F8(this,e)},eUe.uc=function(e){return euo(this,e,this.g)||euo(this,e,this.f)},eUe.vc=function(){return new fS(this)},eUe.xc=function(e){return Bp(this,e)},eUe.zc=function(e,t){return Um(this,e,t)},eUe.Bc=function(e){return Z3(this,e)},eUe.gc=function(){return wq(this)},Y6(eUS,"AbstractHashMap",488),eTS(261,eUT,eUM,fS),eUe.$b=function(){this.a.$b()},eUe.Hc=function(e){return KN(this,e)},eUe.Kc=function(){return new esz(this.a)},eUe.Mc=function(e){var t;return!!KN(this,e)&&(t=Pp(e,42).cd(),this.a.Bc(t),!0)},eUe.gc=function(){return this.a.gc()},Y6(eUS,"AbstractHashMap/EntrySet",261),eTS(262,1,eUE,esz),eUe.Nb=function(e){F9(this,e)},eUe.Pb=function(){return etz(this)},eUe.Ob=function(){return this.b},eUe.Qb=function(){JM(this)},eUe.b=!1,Y6(eUS,"AbstractHashMap/EntrySetIterator",262),eTS(417,1,eUE,fE),eUe.Nb=function(e){F9(this,e)},eUe.Ob=function(){return Et(this)},eUe.Pb=function(){return HL(this)},eUe.Qb=function(){BH(this)},eUe.b=0,eUe.c=-1,Y6(eUS,"AbstractList/IteratorImpl",417),eTS(96,417,eUC,KB),eUe.Qb=function(){BH(this)},eUe.Rb=function(e){CD(this,e)},eUe.Sb=function(){return this.b>0},eUe.Tb=function(){return this.b},eUe.Ub=function(){return A5(this.b>0),this.a.Xb(this.c=--this.b)},eUe.Vb=function(){return this.b-1},eUe.Wb=function(e){A4(-1!=this.c),this.a._c(this.c,e)},Y6(eUS,"AbstractList/ListIteratorImpl",96),eTS(219,52,eU6,Gz),eUe.Vc=function(e,t){Gp(e,this.b),this.c.Vc(this.a+e,t),++this.b},eUe.Xb=function(e){return GK(e,this.b),this.c.Xb(this.a+e)},eUe.$c=function(e){var t;return GK(e,this.b),t=this.c.$c(this.a+e),--this.b,t},eUe._c=function(e,t){return GK(e,this.b),this.c._c(this.a+e,t)},eUe.gc=function(){return this.b},eUe.a=0,eUe.b=0,Y6(eUS,"AbstractList/SubList",219),eTS(384,eUT,eUM,fk),eUe.$b=function(){this.a.$b()},eUe.Hc=function(e){return this.a._b(e)},eUe.Kc=function(){var e;return e=this.a.vc().Kc(),new fx(e)},eUe.Mc=function(e){return!!this.a._b(e)&&(this.a.Bc(e),!0)},eUe.gc=function(){return this.a.gc()},Y6(eUS,"AbstractMap/1",384),eTS(691,1,eUE,fx),eUe.Nb=function(e){F9(this,e)},eUe.Ob=function(){return this.a.Ob()},eUe.Pb=function(){var e;return(e=Pp(this.a.Pb(),42)).cd()},eUe.Qb=function(){this.a.Qb()},Y6(eUS,"AbstractMap/1/1",691),eTS(226,28,eUx,fT),eUe.$b=function(){this.a.$b()},eUe.Hc=function(e){return this.a.uc(e)},eUe.Kc=function(){var e;return e=this.a.vc().Kc(),new fN(e)},eUe.gc=function(){return this.a.gc()},Y6(eUS,"AbstractMap/2",226),eTS(294,1,eUE,fN),eUe.Nb=function(e){F9(this,e)},eUe.Ob=function(){return this.a.Ob()},eUe.Pb=function(){var e;return(e=Pp(this.a.Pb(),42)).dd()},eUe.Qb=function(){this.a.Qb()},Y6(eUS,"AbstractMap/2/1",294),eTS(484,1,{484:1,42:1}),eUe.Fb=function(e){var t;return!!M4(e,42)&&(t=Pp(e,42),UT(this.d,t.cd())&&UT(this.e,t.dd()))},eUe.cd=function(){return this.d},eUe.dd=function(){return this.e},eUe.Hb=function(){return TK(this.d)^TK(this.e)},eUe.ed=function(e){return CL(this,e)},eUe.Ib=function(){return this.d+"="+this.e},Y6(eUS,"AbstractMap/AbstractEntry",484),eTS(383,484,{484:1,383:1,42:1},EE),Y6(eUS,"AbstractMap/SimpleEntry",383),eTS(1984,1,e$t),eUe.Fb=function(e){var t;return!!M4(e,42)&&(t=Pp(e,42),UT(this.cd(),t.cd())&&UT(this.dd(),t.dd()))},eUe.Hb=function(){return TK(this.cd())^TK(this.dd())},eUe.Ib=function(){return this.cd()+"="+this.dd()},Y6(eUS,eUD,1984),eTS(1992,1967,eUO),eUe.tc=function(e){return ZO(this,e)},eUe._b=function(e){return IY(this,e)},eUe.vc=function(){return new fj(this)},eUe.xc=function(e){var t;return xu(esq(this,t=e))},eUe.ec=function(){return new fP(this)},Y6(eUS,"AbstractNavigableMap",1992),eTS(739,eUT,eUM,fj),eUe.Hc=function(e){return M4(e,42)&&ZO(this.b,Pp(e,42))},eUe.Kc=function(){return new C1(this.b)},eUe.Mc=function(e){var t;return!!M4(e,42)&&(t=Pp(e,42),Jl(this.b,t))},eUe.gc=function(){return this.b.c},Y6(eUS,"AbstractNavigableMap/EntrySet",739),eTS(493,eUT,eUL,fP),eUe.Nc=function(){return new Ec(this)},eUe.$b=function(){gl(this.a)},eUe.Hc=function(e){return IY(this.a,e)},eUe.Kc=function(){var e;return e=new C1(new Ap(this.a).b),new fR(e)},eUe.Mc=function(e){return!!IY(this.a,e)&&(zS(this.a,e),!0)},eUe.gc=function(){return this.a.c},Y6(eUS,"AbstractNavigableMap/NavigableKeySet",493),eTS(494,1,eUE,fR),eUe.Nb=function(e){F9(this,e)},eUe.Ob=function(){return Et(this.a.a)},eUe.Pb=function(){var e;return(e=AJ(this.a)).cd()},eUe.Qb=function(){I6(this.a)},Y6(eUS,"AbstractNavigableMap/NavigableKeySet/1",494),eTS(2004,28,eUx),eUe.Fc=function(e){return Ja(e_s(this,e)),!0},eUe.Gc=function(e){return BJ(e),PG(e!=this,"Can't add a queue to itself"),er7(this,e)},eUe.$b=function(){for(;null!=eev(this););},Y6(eUS,"AbstractQueue",2004),eTS(302,28,{4:1,20:1,28:1,14:1},p1,GZ),eUe.Fc=function(e){return Vy(this,e),!0},eUe.$b=function(){qr(this)},eUe.Hc=function(e){return eos(new UN(this),e)},eUe.dc=function(){return gY(this)},eUe.Kc=function(){return new UN(this)},eUe.Mc=function(e){return zP(new UN(this),e)},eUe.gc=function(){return this.c-this.b&this.a.length-1},eUe.Nc=function(){return new Gq(this,272)},eUe.Qc=function(e){var t;return t=this.c-this.b&this.a.length-1,e.lengtht&&Bc(e,t,null),e},eUe.b=0,eUe.c=0,Y6(eUS,"ArrayDeque",302),eTS(446,1,eUE,UN),eUe.Nb=function(e){F9(this,e)},eUe.Ob=function(){return this.a!=this.b},eUe.Pb=function(){return ecn(this)},eUe.Qb=function(){enP(this)},eUe.a=0,eUe.b=0,eUe.c=-1,Y6(eUS,"ArrayDeque/IteratorImpl",446),eTS(12,52,e$n,p0,XM,I4),eUe.Vc=function(e,t){jO(this,e,t)},eUe.Fc=function(e){return P_(this,e)},eUe.Wc=function(e,t){return euP(this,e,t)},eUe.Gc=function(e){return eoc(this,e)},eUe.$b=function(){this.c=Je(e1R,eUp,1,0,5,1)},eUe.Hc=function(e){return -1!=QI(this,e,0)},eUe.Jc=function(e){ety(this,e)},eUe.Xb=function(e){return RJ(this,e)},eUe.Xc=function(e){return QI(this,e,0)},eUe.dc=function(){return 0==this.c.length},eUe.Kc=function(){return new fz(this)},eUe.$c=function(e){return ZV(this,e)},eUe.Mc=function(e){return QA(this,e)},eUe.Ud=function(e,t){GG(this,e,t)},eUe._c=function(e,t){return q1(this,e,t)},eUe.gc=function(){return this.c.length},eUe.ad=function(e){Mv(this,e)},eUe.Pc=function(){return AW(this)},eUe.Qc=function(e){return epg(this,e)};var e0n=Y6(eUS,"ArrayList",12);eTS(7,1,eUE,fz),eUe.Nb=function(e){F9(this,e)},eUe.Ob=function(){return My(this)},eUe.Pb=function(){return Wx(this)},eUe.Qb=function(){Yv(this)},eUe.a=0,eUe.b=-1,Y6(eUS,"ArrayList/1",7),eTS(2013,eB4.Function,{},S),eUe.te=function(e,t){return elN(e,t)},eTS(154,52,e$r,g$),eUe.Hc=function(e){return -1!=enW(this,e)},eUe.Jc=function(e){var t,n,r,i;for(BJ(e),n=this.a,r=0,i=n.length;r>>0).toString(16))},eUe.f=0,eUe.i=eH1;var e2X=Y6(e$N,"CNode",57);eTS(814,1,{},b6),Y6(e$N,"CNode/CNodeBuilder",814),eTS(1525,1,{},eh),eUe.Oe=function(e,t){return 0},eUe.Pe=function(e,t){return 0},Y6(e$N,e$R,1525),eTS(1790,1,{},ep),eUe.Le=function(e){var t,n,r,i,a,o,s,u,c,l,f,d,h,p,b;for(c=eHQ,r=new fz(e.a.b);r.ar.d.c||r.d.c==a.d.c&&r.d.b0?e+this.n.d+this.n.a:0},eUe.Se=function(){var e,t,n,r,i;if(i=0,this.e)this.b?i=this.b.a:this.a[1][1]&&(i=this.a[1][1].Se());else if(this.g)i=efV(this,evf(this,null,!0));else for(t=(etx(),eow(vx(e25,1),eU4,232,0,[e3D,e3N,e3P])),n=0,r=t.length;n0?i+this.n.b+this.n.c:0},eUe.Te=function(){var e,t,n,r,i;if(this.g)for(e=evf(this,null,!1),n=(etx(),eow(vx(e25,1),eU4,232,0,[e3D,e3N,e3P])),r=0,i=n.length;r0&&(r[0]+=this.d,n-=r[0]),r[2]>0&&(r[2]+=this.d,n-=r[2]),this.c.a=eB4.Math.max(0,n),this.c.d=t.d+e.d+(this.c.a-n)/2,r[1]=eB4.Math.max(r[1],n),ZP(this,e3N,t.d+e.d+r[0]-(r[1]-n)/2,r)},eUe.b=null,eUe.d=0,eUe.e=!1,eUe.f=!1,eUe.g=!1;var e28=0,e29=0;Y6(e$8,"GridContainerCell",1473),eTS(461,22,{3:1,35:1,22:1,461:1},EY);var e27=enw(e$8,"HorizontalLabelAlignment",461,e1G,G1,Dc);eTS(306,212,{212:1,306:1},zf,etr,$Y),eUe.Re=function(){return Rf(this)},eUe.Se=function(){return Rd(this)},eUe.a=0,eUe.c=!1;var e3e=Y6(e$8,"LabelCell",306);eTS(244,326,{212:1,326:1,244:1},eh5),eUe.Re=function(){return ek1(this)},eUe.Se=function(){return ek0(this)},eUe.Te=function(){eNE(this)},eUe.Ue=function(){eNM(this)},eUe.b=0,eUe.c=0,eUe.d=!1,Y6(e$8,"StripContainerCell",244),eTS(1626,1,eU9,e_),eUe.Mb=function(e){return gU(Pp(e,212))},Y6(e$8,"StripContainerCell/lambda$0$Type",1626),eTS(1627,1,{},eE),eUe.Fe=function(e){return Pp(e,212).Se()},Y6(e$8,"StripContainerCell/lambda$1$Type",1627),eTS(1628,1,eU9,eS),eUe.Mb=function(e){return gH(Pp(e,212))},Y6(e$8,"StripContainerCell/lambda$2$Type",1628),eTS(1629,1,{},ek),eUe.Fe=function(e){return Pp(e,212).Re()},Y6(e$8,"StripContainerCell/lambda$3$Type",1629),eTS(462,22,{3:1,35:1,22:1,462:1},EB);var e3t=enw(e$8,"VerticalLabelAlignment",462,e1G,G0,Dl);eTS(789,1,{},eFQ),eUe.c=0,eUe.d=0,eUe.k=0,eUe.s=0,eUe.t=0,eUe.v=!1,eUe.w=0,eUe.D=!1,Y6(eza,"NodeContext",789),eTS(1471,1,e$C,ex),eUe.ue=function(e,t){return To(Pp(e,61),Pp(t,61))},eUe.Fb=function(e){return this===e},eUe.ve=function(){return new fZ(this)},Y6(eza,"NodeContext/0methodref$comparePortSides$Type",1471),eTS(1472,1,e$C,eT),eUe.ue=function(e,t){return ew8(Pp(e,111),Pp(t,111))},eUe.Fb=function(e){return this===e},eUe.ve=function(){return new fZ(this)},Y6(eza,"NodeContext/1methodref$comparePortContexts$Type",1472),eTS(159,22,{3:1,35:1,22:1,159:1},ei_);var e3n=enw(eza,"NodeLabelLocation",159,e1G,epE,Df);eTS(111,1,{111:1},exz),eUe.a=!1,Y6(eza,"PortContext",111),eTS(1476,1,eUF,eM),eUe.td=function(e){yQ(Pp(e,306))},Y6(ezu,ezc,1476),eTS(1477,1,eU9,eO),eUe.Mb=function(e){return!!Pp(e,111).c},Y6(ezu,ezl,1477),eTS(1478,1,eUF,eA),eUe.td=function(e){yQ(Pp(e,111).c)},Y6(ezu,"LabelPlacer/lambda$2$Type",1478),eTS(1475,1,eUF,eC),eUe.td=function(e){Cn(),bu(Pp(e,111))},Y6(ezu,"NodeLabelAndSizeUtilities/lambda$0$Type",1475),eTS(790,1,eUF,Dx),eUe.td=function(e){_H(this.b,this.c,this.a,Pp(e,181))},eUe.a=!1,eUe.c=!1,Y6(ezu,"NodeLabelCellCreator/lambda$0$Type",790),eTS(1474,1,eUF,db),eUe.td=function(e){bB(this.a,Pp(e,181))},Y6(ezu,"PortContextCreator/lambda$0$Type",1474),eTS(1829,1,{},eI),Y6(ezd,"GreedyRectangleStripOverlapRemover",1829),eTS(1830,1,e$C,eL),eUe.ue=function(e,t){return Ay(Pp(e,222),Pp(t,222))},eUe.Fb=function(e){return this===e},eUe.ve=function(){return new fZ(this)},Y6(ezd,"GreedyRectangleStripOverlapRemover/0methodref$compareByYCoordinate$Type",1830),eTS(1786,1,{},me),eUe.a=5,eUe.e=0,Y6(ezd,"RectangleStripOverlapRemover",1786),eTS(1787,1,e$C,eN),eUe.ue=function(e,t){return Aw(Pp(e,222),Pp(t,222))},eUe.Fb=function(e){return this===e},eUe.ve=function(){return new fZ(this)},Y6(ezd,"RectangleStripOverlapRemover/0methodref$compareLeftRectangleBorders$Type",1787),eTS(1789,1,e$C,eP),eUe.ue=function(e,t){return YY(Pp(e,222),Pp(t,222))},eUe.Fb=function(e){return this===e},eUe.ve=function(){return new fZ(this)},Y6(ezd,"RectangleStripOverlapRemover/1methodref$compareRightRectangleBorders$Type",1789),eTS(406,22,{3:1,35:1,22:1,406:1},EU);var e3r=enw(ezd,"RectangleStripOverlapRemover/OverlapRemovalDirection",406,e1G,Vn,Dd);eTS(222,1,{222:1},jH),Y6(ezd,"RectangleStripOverlapRemover/RectangleNode",222),eTS(1788,1,eUF,dm),eUe.td=function(e){emA(this.a,Pp(e,222))},Y6(ezd,"RectangleStripOverlapRemover/lambda$1$Type",1788),eTS(1304,1,e$C,eR),eUe.ue=function(e,t){return eRu(Pp(e,167),Pp(t,167))},eUe.Fb=function(e){return this===e},eUe.ve=function(){return new fZ(this)},Y6(ezp,"PolyominoCompactor/CornerCasesGreaterThanRestComparator",1304),eTS(1307,1,{},ej),eUe.Kb=function(e){return Pp(e,324).a},Y6(ezp,"PolyominoCompactor/CornerCasesGreaterThanRestComparator/lambda$0$Type",1307),eTS(1308,1,eU9,eF),eUe.Mb=function(e){return Pp(e,323).a},Y6(ezp,"PolyominoCompactor/CornerCasesGreaterThanRestComparator/lambda$1$Type",1308),eTS(1309,1,eU9,eY),eUe.Mb=function(e){return Pp(e,323).a},Y6(ezp,"PolyominoCompactor/CornerCasesGreaterThanRestComparator/lambda$2$Type",1309),eTS(1302,1,e$C,eB),eUe.ue=function(e,t){return eC8(Pp(e,167),Pp(t,167))},eUe.Fb=function(e){return this===e},eUe.ve=function(){return new fZ(this)},Y6(ezp,"PolyominoCompactor/MinNumOfExtensionDirectionsComparator",1302),eTS(1305,1,{},eD),eUe.Kb=function(e){return Pp(e,324).a},Y6(ezp,"PolyominoCompactor/MinNumOfExtensionDirectionsComparator/lambda$0$Type",1305),eTS(767,1,e$C,eU),eUe.ue=function(e,t){return eaq(Pp(e,167),Pp(t,167))},eUe.Fb=function(e){return this===e},eUe.ve=function(){return new fZ(this)},Y6(ezp,"PolyominoCompactor/MinNumOfExtensionsComparator",767),eTS(1300,1,e$C,eH),eUe.ue=function(e,t){return ery(Pp(e,321),Pp(t,321))},eUe.Fb=function(e){return this===e},eUe.ve=function(){return new fZ(this)},Y6(ezp,"PolyominoCompactor/MinPerimeterComparator",1300),eTS(1301,1,e$C,e$),eUe.ue=function(e,t){return ebg(Pp(e,321),Pp(t,321))},eUe.Fb=function(e){return this===e},eUe.ve=function(){return new fZ(this)},Y6(ezp,"PolyominoCompactor/MinPerimeterComparatorWithShape",1301),eTS(1303,1,e$C,ez),eUe.ue=function(e,t){return eIz(Pp(e,167),Pp(t,167))},eUe.Fb=function(e){return this===e},eUe.ve=function(){return new fZ(this)},Y6(ezp,"PolyominoCompactor/SingleExtensionSideGreaterThanRestComparator",1303),eTS(1306,1,{},eG),eUe.Kb=function(e){return Pp(e,324).a},Y6(ezp,"PolyominoCompactor/SingleExtensionSideGreaterThanRestComparator/lambda$0$Type",1306),eTS(777,1,{},EC),eUe.Ce=function(e,t){return KG(this,Pp(e,46),Pp(t,167))},Y6(ezp,"SuccessorCombination",777),eTS(644,1,{},eW),eUe.Ce=function(e,t){var n;return exd((n=Pp(e,46),Pp(t,167),n))},Y6(ezp,"SuccessorJitter",644),eTS(643,1,{},eK),eUe.Ce=function(e,t){var n;return eAW((n=Pp(e,46),Pp(t,167),n))},Y6(ezp,"SuccessorLineByLine",643),eTS(568,1,{},eV),eUe.Ce=function(e,t){var n;return eMl((n=Pp(e,46),Pp(t,167),n))},Y6(ezp,"SuccessorManhattan",568),eTS(1356,1,{},eq),eUe.Ce=function(e,t){var n;return eAt((n=Pp(e,46),Pp(t,167),n))},Y6(ezp,"SuccessorMaxNormWindingInMathPosSense",1356),eTS(400,1,{},dg),eUe.Ce=function(e,t){return YO(this,e,t)},eUe.c=!1,eUe.d=!1,eUe.e=!1,eUe.f=!1,Y6(ezp,"SuccessorQuadrantsGeneric",400),eTS(1357,1,{},eZ),eUe.Kb=function(e){return Pp(e,324).a},Y6(ezp,"SuccessorQuadrantsGeneric/lambda$0$Type",1357),eTS(323,22,{3:1,35:1,22:1,323:1},EN),eUe.a=!1;var e3i=enw(ezy,ezw,323,e1G,Va,Dh);eTS(1298,1,{}),eUe.Ib=function(){var e,t,n,r,i,a;for(i=0,n=" ",e=ell(0);i=0?"b"+e+"["+q2(this.a)+"]":"b["+q2(this.a)+"]":"b_"+Ao(this)},Y6(ez0,"FBendpoint",559),eTS(282,134,{3:1,282:1,94:1,134:1},CH),eUe.Ib=function(){return q2(this)},Y6(ez0,"FEdge",282),eTS(231,134,{3:1,231:1,94:1,134:1},Z6);var e4_=Y6(ez0,"FGraph",231);eTS(447,357,{3:1,447:1,357:1,94:1,134:1},qp),eUe.Ib=function(){return null==this.b||0==this.b.length?"l["+q2(this.a)+"]":"l_"+this.b},Y6(ez0,"FLabel",447),eTS(144,357,{3:1,144:1,357:1,94:1,134:1},Bw),eUe.Ib=function(){return WH(this)},eUe.b=0,Y6(ez0,"FNode",144),eTS(2003,1,{}),eUe.bf=function(e){eD2(this,e)},eUe.cf=function(){emz(this)},eUe.d=0,Y6(ez3,"AbstractForceModel",2003),eTS(631,2003,{631:1},eaR),eUe.af=function(e,t){var n,r,i,a,o;return ekL(this.f,e,t),i=C5(MB(t.d),e.d),o=eB4.Math.sqrt(i.a*i.a+i.b*i.b),r=eB4.Math.max(0,o-B$(e.e)/2-B$(t.e)/2),a=(n=esT(this.e,e,t))>0?-YT(r,this.c)*n:Li(r,this.b)*Pp(e_k(e,(eCk(),e8M)),19).a,Ol(i,a/o),i},eUe.bf=function(e){eD2(this,e),this.a=Pp(e_k(e,(eCk(),e8g)),19).a,this.c=gP(LV(e_k(e,e8D))),this.b=gP(LV(e_k(e,e8A)))},eUe.df=function(e){return e0&&(a-=gg(r,this.a)*n),Ol(i,a*this.b/o),i},eUe.bf=function(e){var t,n,r,i,a,o,s;for(eD2(this,e),this.b=gP(LV(e_k(e,(eCk(),e8N)))),this.c=this.b/Pp(e_k(e,e8g),19).a,r=e.e.c.length,a=0,i=0,s=new fz(e.e);s.a0},eUe.a=0,eUe.b=0,eUe.c=0,Y6(ez3,"FruchtermanReingoldModel",632),eTS(849,1,e$2,cu),eUe.Qe=function(e){efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,ez4),""),"Force Model"),"Determines the model for force calculation."),e8a),(eSd(),tdv)),e4E),el8((epx(),tdh))))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,ez6),""),"Iterations"),"The number of iterations on the force model."),ell(300)),tdw),e16),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,ez5),""),"Repulsive Power"),"Determines how many bend points are added to the edge; such bend points are regarded as repelling particles in the force model"),ell(0)),tdw),e16),el8(tdl)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,ez8),""),"FR Temperature"),"The temperature is used as a scaling factor for particle displacements."),ez9),tdg),e13),el8(tdh)))),K_(e,ez8,ez4,e8l),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,ez7),""),"Eades Repulsion"),"Factor for repulsive forces in Eades' model."),5),tdg),e13),el8(tdh)))),K_(e,ez7,ez4,e8s),eYi((new cc,e))},Y6(eGe,"ForceMetaDataProvider",849),eTS(424,22,{3:1,35:1,22:1,424:1},EH);var e4E=enw(eGe,"ForceModelStrategy",424,e1G,$8,Dm);eTS(988,1,e$2,cc),eUe.Qe=function(e){eYi(e)},Y6(eGe,"ForceOptions",988),eTS(989,1,{},tr),eUe.$e=function(){return new b0},eUe._e=function(e){},Y6(eGe,"ForceOptions/ForceFactory",989),eTS(850,1,e$2,cl),eUe.Qe=function(e){efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eGw),""),"Fixed Position"),"Prevent that the node is moved by the layout algorithm."),(OQ(),!1)),(eSd(),tdm)),e11),el8((epx(),tdd))))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eG_),""),"Desired Edge Length"),"Either specified for parent nodes or for individual edges, where the latter takes higher precedence."),100),tdg),e13),jL(tdh,eow(vx(e6Q,1),eU4,175,0,[tdl]))))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eGE),""),"Layout Dimension"),"Dimensions that are permitted to be altered during layout."),e8U),tdv),e4S),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eGS),""),"Stress Epsilon"),"Termination criterion for the iterative process."),ez9),tdg),e13),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eGk),""),"Iteration Limit"),"Maximum number of performed iterations. Takes higher precedence than 'epsilon'."),ell(eUu)),tdw),e16),el8(tdh)))),ejQ((new cf,e))},Y6(eGe,"StressMetaDataProvider",850),eTS(992,1,e$2,cf),eUe.Qe=function(e){ejQ(e)},Y6(eGe,"StressOptions",992),eTS(993,1,{},ti),eUe.$e=function(){return new C$},eUe._e=function(e){},Y6(eGe,"StressOptions/StressFactory",993),eTS(1128,209,ezL,C$),eUe.Ze=function(e,t){var n,r,i,a,o;for(ewG(t,eGT,1),gN(LK(eT9(e,(egq(),e8q))))?gN(LK(eT9(e,e80)))||zh(n=new df((_q(),new gM(e)))):eOs(new b0,e,eiI(t,1)),i=eo4(e),o=(r=eNx(this.a,i)).Kc();o.Ob();)!((a=Pp(o.Pb(),231)).e.c.length<=1)&&(eRa(this.b,a),eMn(this.b),ety(a.d,new ta));i=eYC(r),eYh(i),eEj(t)},Y6(eGO,"StressLayoutProvider",1128),eTS(1129,1,eUF,ta),eUe.td=function(e){ePd(Pp(e,447))},Y6(eGO,"StressLayoutProvider/lambda$0$Type",1129),eTS(990,1,{},bP),eUe.c=0,eUe.e=0,eUe.g=0,Y6(eGO,"StressMajorization",990),eTS(379,22,{3:1,35:1,22:1,379:1},E$);var e4S=enw(eGO,"StressMajorization/Dimension",379,e1G,G3,Dg);eTS(991,1,e$C,dE),eUe.ue=function(e,t){return IA(this.a,Pp(e,144),Pp(t,144))},eUe.Fb=function(e){return this===e},eUe.ve=function(){return new fZ(this)},Y6(eGO,"StressMajorization/lambda$0$Type",991),eTS(1229,1,{},W8),Y6(eGL,"ElkLayered",1229),eTS(1230,1,eUF,to),eUe.td=function(e){exn(Pp(e,37))},Y6(eGL,"ElkLayered/lambda$0$Type",1230),eTS(1231,1,eUF,dS),eUe.td=function(e){IL(this.a,Pp(e,37))},Y6(eGL,"ElkLayered/lambda$1$Type",1231),eTS(1263,1,{},MC),Y6(eGL,"GraphConfigurator",1263),eTS(759,1,eUF,dk),eUe.td=function(e){e_1(this.a,Pp(e,10))},Y6(eGL,"GraphConfigurator/lambda$0$Type",759),eTS(760,1,{},ts),eUe.Kb=function(e){return evR(),new R1(null,new Gq(Pp(e,29).a,16))},Y6(eGL,"GraphConfigurator/lambda$1$Type",760),eTS(761,1,eUF,dx),eUe.td=function(e){e_1(this.a,Pp(e,10))},Y6(eGL,"GraphConfigurator/lambda$2$Type",761),eTS(1127,209,ezL,b3),eUe.Ze=function(e,t){var n;n=eN7(new mn,e),xc(eT9(e,(eBy(),taM)))===xc((eck(),tpz))?ef0(this.a,n,t):exD(this.a,n,t),eYr(new ch,n)},Y6(eGL,"LayeredLayoutProvider",1127),eTS(356,22,{3:1,35:1,22:1,356:1},Ez);var e4k=enw(eGL,"LayeredPhases",356,e1G,q4,Dv);eTS(1651,1,{},enX),eUe.i=0,Y6(eGC,"ComponentsToCGraphTransformer",1651),eTS(1652,1,{},tu),eUe.ef=function(e,t){return eB4.Math.min(null!=e.a?gP(e.a):e.c.i,null!=t.a?gP(t.a):t.c.i)},eUe.ff=function(e,t){return eB4.Math.min(null!=e.a?gP(e.a):e.c.i,null!=t.a?gP(t.a):t.c.i)},Y6(eGC,"ComponentsToCGraphTransformer/1",1652),eTS(81,1,{81:1}),eUe.i=0,eUe.k=!0,eUe.o=eH1;var e4x=Y6(eGI,"CNode",81);eTS(460,81,{460:1,81:1},Ah,eh3),eUe.Ib=function(){return""},Y6(eGC,"ComponentsToCGraphTransformer/CRectNode",460),eTS(1623,1,{},tc),Y6(eGC,"OneDimensionalComponentsCompaction",1623),eTS(1624,1,{},tl),eUe.Kb=function(e){return Gm(Pp(e,46))},eUe.Fb=function(e){return this===e},Y6(eGC,"OneDimensionalComponentsCompaction/lambda$0$Type",1624),eTS(1625,1,{},tf),eUe.Kb=function(e){return edl(Pp(e,46))},eUe.Fb=function(e){return this===e},Y6(eGC,"OneDimensionalComponentsCompaction/lambda$1$Type",1625),eTS(1654,1,{},Bv),Y6(eGI,"CGraph",1654),eTS(189,1,{189:1},eh4),eUe.b=0,eUe.c=0,eUe.e=0,eUe.g=!0,eUe.i=eH1,Y6(eGI,"CGroup",189),eTS(1653,1,{},tb),eUe.ef=function(e,t){return eB4.Math.max(null!=e.a?gP(e.a):e.c.i,null!=t.a?gP(t.a):t.c.i)},eUe.ff=function(e,t){return eB4.Math.max(null!=e.a?gP(e.a):e.c.i,null!=t.a?gP(t.a):t.c.i)},Y6(eGI,e$R,1653),eTS(1655,1,{},exO),eUe.d=!1;var e4T=Y6(eGI,e$U,1655);eTS(1656,1,{},tm),eUe.Kb=function(e){return _T(),OQ(),0!=Pp(Pp(e,46).a,81).d.e},eUe.Fb=function(e){return this===e},Y6(eGI,e$H,1656),eTS(823,1,{},R$),eUe.a=!1,eUe.b=!1,eUe.c=!1,eUe.d=!1,Y6(eGI,e$$,823),eTS(1825,1,{},j$),Y6(eGD,e$z,1825);var e4M=RL(eGN,e$D);eTS(1826,1,{369:1},$h),eUe.Ke=function(e){eLh(this,Pp(e,466))},Y6(eGD,e$G,1826),eTS(1827,1,e$C,tg),eUe.ue=function(e,t){return Hy(Pp(e,81),Pp(t,81))},eUe.Fb=function(e){return this===e},eUe.ve=function(){return new fZ(this)},Y6(eGD,e$W,1827),eTS(466,1,{466:1},E5),eUe.a=!1,Y6(eGD,e$K,466),eTS(1828,1,e$C,tv),eUe.ue=function(e,t){return evP(Pp(e,466),Pp(t,466))},eUe.Fb=function(e){return this===e},eUe.ve=function(){return new fZ(this)},Y6(eGD,e$V,1828),eTS(140,1,{140:1},Se,PW),eUe.Fb=function(e){var t;return null!=e&&e4O==esF(e)&&(t=Pp(e,140),UT(this.c,t.c)&&UT(this.d,t.d))},eUe.Hb=function(){return euF(eow(vx(e1R,1),eUp,1,5,[this.c,this.d]))},eUe.Ib=function(){return"("+this.c+eUd+this.d+(this.a?"cx":"")+this.b+")"},eUe.a=!0,eUe.c=0,eUe.d=0;var e4O=Y6(eGN,"Point",140);eTS(405,22,{3:1,35:1,22:1,405:1},EG);var e4A=enw(eGN,"Point/Quadrant",405,e1G,Vo,Dy);eTS(1642,1,{},b5),eUe.b=null,eUe.c=null,eUe.d=null,eUe.e=null,eUe.f=null,Y6(eGN,"RectilinearConvexHull",1642),eTS(574,1,{369:1},epG),eUe.Ke=function(e){J4(this,Pp(e,140))},eUe.b=0,Y6(eGN,"RectilinearConvexHull/MaximalElementsEventHandler",574),eTS(1644,1,e$C,th),eUe.ue=function(e,t){return U3(LV(e),LV(t))},eUe.Fb=function(e){return this===e},eUe.ve=function(){return new fZ(this)},Y6(eGN,"RectilinearConvexHull/MaximalElementsEventHandler/lambda$0$Type",1644),eTS(1643,1,{369:1},ete),eUe.Ke=function(e){eAo(this,Pp(e,140))},eUe.a=0,eUe.b=null,eUe.c=null,eUe.d=null,eUe.e=null,Y6(eGN,"RectilinearConvexHull/RectangleEventHandler",1643),eTS(1645,1,e$C,tp),eUe.ue=function(e,t){return WI(Pp(e,140),Pp(t,140))},eUe.Fb=function(e){return this===e},eUe.ve=function(){return new fZ(this)},Y6(eGN,"RectilinearConvexHull/lambda$0$Type",1645),eTS(1646,1,e$C,td),eUe.ue=function(e,t){return WD(Pp(e,140),Pp(t,140))},eUe.Fb=function(e){return this===e},eUe.ve=function(){return new fZ(this)},Y6(eGN,"RectilinearConvexHull/lambda$1$Type",1646),eTS(1647,1,e$C,ty),eUe.ue=function(e,t){return WP(Pp(e,140),Pp(t,140))},eUe.Fb=function(e){return this===e},eUe.ve=function(){return new fZ(this)},Y6(eGN,"RectilinearConvexHull/lambda$2$Type",1647),eTS(1648,1,e$C,tw),eUe.ue=function(e,t){return WN(Pp(e,140),Pp(t,140))},eUe.Fb=function(e){return this===e},eUe.ve=function(){return new fZ(this)},Y6(eGN,"RectilinearConvexHull/lambda$3$Type",1648),eTS(1649,1,e$C,t_),eUe.ue=function(e,t){return e_M(Pp(e,140),Pp(t,140))},eUe.Fb=function(e){return this===e},eUe.ve=function(){return new fZ(this)},Y6(eGN,"RectilinearConvexHull/lambda$4$Type",1649),eTS(1650,1,{},Gf),Y6(eGN,"Scanline",1650),eTS(2005,1,{}),Y6(eGP,"AbstractGraphPlacer",2005),eTS(325,1,{325:1},Lm),eUe.mf=function(e){return!!this.nf(e)&&(exg(this.b,Pp(e_k(e,(eBU(),ttX)),21),e),!0)},eUe.nf=function(e){var t,n,r,i;for(t=Pp(e_k(e,(eBU(),ttX)),21),r=(i=Pp(Zq(e9E,t),21)).Kc();r.Ob();)if(n=Pp(r.Pb(),21),!Pp(Zq(this.b,n),15).dc())return!1;return!0},Y6(eGP,"ComponentGroup",325),eTS(765,2005,{},b8),eUe.of=function(e){var t,n;for(n=new fz(this.a);n.ah&&(_=0,E+=d+i,d=0),m=o.c,eIn(o,_+m.a,E+m.b),xB(m),n=eB4.Math.max(n,_+v.a),d=eB4.Math.max(d,v.b),_+=v.a+i;if(t.f.a=n,t.f.b=E+d,gN(LK(e_k(a,tiQ)))){for(eBb(r=new tE,e,i),f=e.Kc();f.Ob();)C6(xB((l=Pp(f.Pb(),37)).c),r.e);C6(xB(t.f),r.a)}JN(t,e)},Y6(eGP,"SimpleRowGraphPlacer",1291),eTS(1292,1,e$C,tx),eUe.ue=function(e,t){return eaV(Pp(e,37),Pp(t,37))},eUe.Fb=function(e){return this===e},eUe.ve=function(){return new fZ(this)},Y6(eGP,"SimpleRowGraphPlacer/1",1292),eTS(1262,1,e$q,tT),eUe.Lb=function(e){var t;return!!(t=Pp(e_k(Pp(e,243).b,(eBy(),taR)),74))&&0!=t.b},eUe.Fb=function(e){return this===e},eUe.Mb=function(e){var t;return!!(t=Pp(e_k(Pp(e,243).b,(eBy(),taR)),74))&&0!=t.b},Y6(eGY,"CompoundGraphPostprocessor/1",1262),eTS(1261,1,eGB,mr),eUe.pf=function(e,t){ebL(this,Pp(e,37),t)},Y6(eGY,"CompoundGraphPreprocessor",1261),eTS(441,1,{441:1},ec9),eUe.c=!1,Y6(eGY,"CompoundGraphPreprocessor/ExternalPort",441),eTS(243,1,{243:1},DT),eUe.Ib=function(){return AV(this.c)+":"+ek6(this.b)},Y6(eGY,"CrossHierarchyEdge",243),eTS(763,1,e$C,dT),eUe.ue=function(e,t){return egB(this,Pp(e,243),Pp(t,243))},eUe.Fb=function(e){return this===e},eUe.ve=function(){return new fZ(this)},Y6(eGY,"CrossHierarchyEdgeComparator",763),eTS(299,134,{3:1,299:1,94:1,134:1}),eUe.p=0,Y6(eGU,"LGraphElement",299),eTS(17,299,{3:1,17:1,299:1,94:1,134:1},$b),eUe.Ib=function(){return ek6(this)};var e4C=Y6(eGU,"LEdge",17);eTS(37,299,{3:1,20:1,37:1,299:1,94:1,134:1},enJ),eUe.Jc=function(e){qX(this,e)},eUe.Kc=function(){return new fz(this.b)},eUe.Ib=function(){return 0==this.b.c.length?"G-unlayered"+e_F(this.a):0==this.a.c.length?"G-layered"+e_F(this.b):"G[layerless"+e_F(this.a)+", layers"+e_F(this.b)+"]"};var e4I=Y6(eGU,"LGraph",37);eTS(657,1,{}),eUe.qf=function(){return this.e.n},eUe.We=function(e){return e_k(this.e,e)},eUe.rf=function(){return this.e.o},eUe.sf=function(){return this.e.p},eUe.Xe=function(e){return Ln(this.e,e)},eUe.tf=function(e){this.e.n.a=e.a,this.e.n.b=e.b},eUe.uf=function(e){this.e.o.a=e.a,this.e.o.b=e.b},eUe.vf=function(e){this.e.p=e},Y6(eGU,"LGraphAdapters/AbstractLShapeAdapter",657),eTS(577,1,{839:1},dM),eUe.wf=function(){var e,t;if(!this.b)for(this.b=AH(this.a.b.c.length),t=new fz(this.a.b);t.a0&&eu7((GV(t-1,e.length),e.charCodeAt(t-1)),eGq);)--t;if(a> ",e),egu(n)),xM(xT((e.a+="[",e),n.i),"]")),e.a},eUe.c=!0,eUe.d=!1;var e4j=Y6(eGU,"LPort",11);eTS(397,1,eU$,dA),eUe.Jc=function(e){qX(this,e)},eUe.Kc=function(){var e;return e=new fz(this.a.e),new dL(e)},Y6(eGU,"LPort/1",397),eTS(1290,1,eUE,dL),eUe.Nb=function(e){F9(this,e)},eUe.Pb=function(){return Pp(Wx(this.a),17).c},eUe.Ob=function(){return My(this.a)},eUe.Qb=function(){Yv(this.a)},Y6(eGU,"LPort/1/1",1290),eTS(359,1,eU$,dC),eUe.Jc=function(e){qX(this,e)},eUe.Kc=function(){var e;return e=new fz(this.a.g),new dI(e)},Y6(eGU,"LPort/2",359),eTS(762,1,eUE,dI),eUe.Nb=function(e){F9(this,e)},eUe.Pb=function(){return Pp(Wx(this.a),17).d},eUe.Ob=function(){return My(this.a)},eUe.Qb=function(){Yv(this.a)},Y6(eGU,"LPort/2/1",762),eTS(1283,1,eU$,E6),eUe.Jc=function(e){qX(this,e)},eUe.Kc=function(){return new Z4(this)},Y6(eGU,"LPort/CombineIter",1283),eTS(201,1,eUE,Z4),eUe.Nb=function(e){F9(this,e)},eUe.Qb=function(){yI()},eUe.Ob=function(){return Ak(this)},eUe.Pb=function(){return My(this.a)?Wx(this.a):Wx(this.b)},Y6(eGU,"LPort/CombineIter/1",201),eTS(1285,1,e$q,tA),eUe.Lb=function(e){return FO(e)},eUe.Fb=function(e){return this===e},eUe.Mb=function(e){return eiA(),0!=Pp(e,11).e.c.length},Y6(eGU,"LPort/lambda$0$Type",1285),eTS(1284,1,e$q,tL),eUe.Lb=function(e){return FA(e)},eUe.Fb=function(e){return this===e},eUe.Mb=function(e){return eiA(),0!=Pp(e,11).g.c.length},Y6(eGU,"LPort/lambda$1$Type",1284),eTS(1286,1,e$q,tC),eUe.Lb=function(e){return eiA(),Pp(e,11).j==(eYu(),tbw)},eUe.Fb=function(e){return this===e},eUe.Mb=function(e){return eiA(),Pp(e,11).j==(eYu(),tbw)},Y6(eGU,"LPort/lambda$2$Type",1286),eTS(1287,1,e$q,tI),eUe.Lb=function(e){return eiA(),Pp(e,11).j==(eYu(),tby)},eUe.Fb=function(e){return this===e},eUe.Mb=function(e){return eiA(),Pp(e,11).j==(eYu(),tby)},Y6(eGU,"LPort/lambda$3$Type",1287),eTS(1288,1,e$q,tD),eUe.Lb=function(e){return eiA(),Pp(e,11).j==(eYu(),tbj)},eUe.Fb=function(e){return this===e},eUe.Mb=function(e){return eiA(),Pp(e,11).j==(eYu(),tbj)},Y6(eGU,"LPort/lambda$4$Type",1288),eTS(1289,1,e$q,tN),eUe.Lb=function(e){return eiA(),Pp(e,11).j==(eYu(),tbY)},eUe.Fb=function(e){return this===e},eUe.Mb=function(e){return eiA(),Pp(e,11).j==(eYu(),tbY)},Y6(eGU,"LPort/lambda$5$Type",1289),eTS(29,299,{3:1,20:1,299:1,29:1,94:1,134:1},By),eUe.Jc=function(e){qX(this,e)},eUe.Kc=function(){return new fz(this.a)},eUe.Ib=function(){return"L_"+QI(this.b.b,this,0)+e_F(this.a)},Y6(eGU,"Layer",29),eTS(1342,1,{},mn),Y6(eG0,eG2,1342),eTS(1346,1,{},tP),eUe.Kb=function(e){return ewH(Pp(e,82))},Y6(eG0,"ElkGraphImporter/0methodref$connectableShapeToNode$Type",1346),eTS(1349,1,{},tR),eUe.Kb=function(e){return ewH(Pp(e,82))},Y6(eG0,"ElkGraphImporter/1methodref$connectableShapeToNode$Type",1349),eTS(1343,1,eUF,dD),eUe.td=function(e){exW(this.a,Pp(e,118))},Y6(eG0,eG3,1343),eTS(1344,1,eUF,dN),eUe.td=function(e){exW(this.a,Pp(e,118))},Y6(eG0,eG4,1344),eTS(1345,1,{},tj),eUe.Kb=function(e){return new R1(null,new Gq(UF(Pp(e,79)),16))},Y6(eG0,eG6,1345),eTS(1347,1,eU9,dP),eUe.Mb=function(e){return TV(this.a,Pp(e,33))},Y6(eG0,eG5,1347),eTS(1348,1,{},tF),eUe.Kb=function(e){return new R1(null,new Gq(UY(Pp(e,79)),16))},Y6(eG0,"ElkGraphImporter/lambda$5$Type",1348),eTS(1350,1,eU9,dR),eUe.Mb=function(e){return Tq(this.a,Pp(e,33))},Y6(eG0,"ElkGraphImporter/lambda$7$Type",1350),eTS(1351,1,eU9,tY),eUe.Mb=function(e){return HH(Pp(e,79))},Y6(eG0,"ElkGraphImporter/lambda$8$Type",1351),eTS(1278,1,{},ch),Y6(eG0,"ElkGraphLayoutTransferrer",1278),eTS(1279,1,eU9,dj),eUe.Mb=function(e){return It(this.a,Pp(e,17))},Y6(eG0,"ElkGraphLayoutTransferrer/lambda$0$Type",1279),eTS(1280,1,eUF,dF),eUe.td=function(e){_k(),P_(this.a,Pp(e,17))},Y6(eG0,"ElkGraphLayoutTransferrer/lambda$1$Type",1280),eTS(1281,1,eU9,dY),eUe.Mb=function(e){return Ca(this.a,Pp(e,17))},Y6(eG0,"ElkGraphLayoutTransferrer/lambda$2$Type",1281),eTS(1282,1,eUF,dB),eUe.td=function(e){_k(),P_(this.a,Pp(e,17))},Y6(eG0,"ElkGraphLayoutTransferrer/lambda$3$Type",1282),eTS(1485,1,eGB,tB),eUe.pf=function(e,t){eiu(Pp(e,37),t)},Y6(eG9,"CommentNodeMarginCalculator",1485),eTS(1486,1,{},tU),eUe.Kb=function(e){return new R1(null,new Gq(Pp(e,29).a,16))},Y6(eG9,"CommentNodeMarginCalculator/lambda$0$Type",1486),eTS(1487,1,eUF,tH),eUe.td=function(e){ePO(Pp(e,10))},Y6(eG9,"CommentNodeMarginCalculator/lambda$1$Type",1487),eTS(1488,1,eGB,t$),eUe.pf=function(e,t){eLA(Pp(e,37),t)},Y6(eG9,"CommentPostprocessor",1488),eTS(1489,1,eGB,tz),eUe.pf=function(e,t){eF4(Pp(e,37),t)},Y6(eG9,"CommentPreprocessor",1489),eTS(1490,1,eGB,tG),eUe.pf=function(e,t){eOf(Pp(e,37),t)},Y6(eG9,"ConstraintsPostprocessor",1490),eTS(1491,1,eGB,tW),eUe.pf=function(e,t){eau(Pp(e,37),t)},Y6(eG9,"EdgeAndLayerConstraintEdgeReverser",1491),eTS(1492,1,eGB,tK),eUe.pf=function(e,t){edC(Pp(e,37),t)},Y6(eG9,"EndLabelPostprocessor",1492),eTS(1493,1,{},tV),eUe.Kb=function(e){return new R1(null,new Gq(Pp(e,29).a,16))},Y6(eG9,"EndLabelPostprocessor/lambda$0$Type",1493),eTS(1494,1,eU9,tq),eUe.Mb=function(e){return $T(Pp(e,10))},Y6(eG9,"EndLabelPostprocessor/lambda$1$Type",1494),eTS(1495,1,eUF,tZ),eUe.td=function(e){evj(Pp(e,10))},Y6(eG9,"EndLabelPostprocessor/lambda$2$Type",1495),eTS(1496,1,eGB,tX),eUe.pf=function(e,t){eSF(Pp(e,37),t)},Y6(eG9,"EndLabelPreprocessor",1496),eTS(1497,1,{},tJ),eUe.Kb=function(e){return new R1(null,new Gq(Pp(e,29).a,16))},Y6(eG9,"EndLabelPreprocessor/lambda$0$Type",1497),eTS(1498,1,eUF,DA),eUe.td=function(e){_$(this.a,this.b,this.c,Pp(e,10))},eUe.a=0,eUe.b=0,eUe.c=!1,Y6(eG9,"EndLabelPreprocessor/lambda$1$Type",1498),eTS(1499,1,eU9,tQ),eUe.Mb=function(e){return xc(e_k(Pp(e,70),(eBy(),tab)))===xc((etT(),tpS))},Y6(eG9,"EndLabelPreprocessor/lambda$2$Type",1499),eTS(1500,1,eUF,dU),eUe.td=function(e){P7(this.a,Pp(e,70))},Y6(eG9,"EndLabelPreprocessor/lambda$3$Type",1500),eTS(1501,1,eU9,t1),eUe.Mb=function(e){return xc(e_k(Pp(e,70),(eBy(),tab)))===xc((etT(),tpE))},Y6(eG9,"EndLabelPreprocessor/lambda$4$Type",1501),eTS(1502,1,eUF,dH),eUe.td=function(e){P7(this.a,Pp(e,70))},Y6(eG9,"EndLabelPreprocessor/lambda$5$Type",1502),eTS(1551,1,eGB,cd),eUe.pf=function(e,t){elP(Pp(e,37),t)},Y6(eG9,"EndLabelSorter",1551),eTS(1552,1,e$C,t0),eUe.ue=function(e,t){return epc(Pp(e,456),Pp(t,456))},eUe.Fb=function(e){return this===e},eUe.ve=function(){return new fZ(this)},Y6(eG9,"EndLabelSorter/1",1552),eTS(456,1,{456:1},HP),Y6(eG9,"EndLabelSorter/LabelGroup",456),eTS(1553,1,{},t2),eUe.Kb=function(e){return _O(),new R1(null,new Gq(Pp(e,29).a,16))},Y6(eG9,"EndLabelSorter/lambda$0$Type",1553),eTS(1554,1,eU9,t3),eUe.Mb=function(e){return _O(),Pp(e,10).k==(eEn(),e9N)},Y6(eG9,"EndLabelSorter/lambda$1$Type",1554),eTS(1555,1,eUF,t4),eUe.td=function(e){eEr(Pp(e,10))},Y6(eG9,"EndLabelSorter/lambda$2$Type",1555),eTS(1556,1,eU9,t6),eUe.Mb=function(e){return _O(),xc(e_k(Pp(e,70),(eBy(),tab)))===xc((etT(),tpE))},Y6(eG9,"EndLabelSorter/lambda$3$Type",1556),eTS(1557,1,eU9,t5),eUe.Mb=function(e){return _O(),xc(e_k(Pp(e,70),(eBy(),tab)))===xc((etT(),tpS))},Y6(eG9,"EndLabelSorter/lambda$4$Type",1557),eTS(1503,1,eGB,t8),eUe.pf=function(e,t){eP2(this,Pp(e,37))},eUe.b=0,eUe.c=0,Y6(eG9,"FinalSplineBendpointsCalculator",1503),eTS(1504,1,{},t9),eUe.Kb=function(e){return new R1(null,new Gq(Pp(e,29).a,16))},Y6(eG9,"FinalSplineBendpointsCalculator/lambda$0$Type",1504),eTS(1505,1,{},t7),eUe.Kb=function(e){return new R1(null,new YI(new Fa(OH(efc(Pp(e,10)).a.Kc(),new c))))},Y6(eG9,"FinalSplineBendpointsCalculator/lambda$1$Type",1505),eTS(1506,1,eU9,ne),eUe.Mb=function(e){return!q9(Pp(e,17))},Y6(eG9,"FinalSplineBendpointsCalculator/lambda$2$Type",1506),eTS(1507,1,eU9,nt),eUe.Mb=function(e){return Ln(Pp(e,17),(eBU(),tnO))},Y6(eG9,"FinalSplineBendpointsCalculator/lambda$3$Type",1507),eTS(1508,1,eUF,d$),eUe.td=function(e){eIV(this.a,Pp(e,128))},Y6(eG9,"FinalSplineBendpointsCalculator/lambda$4$Type",1508),eTS(1509,1,eUF,nn),eUe.td=function(e){eSj(Pp(e,17).a)},Y6(eG9,"FinalSplineBendpointsCalculator/lambda$5$Type",1509),eTS(792,1,eGB,dz),eUe.pf=function(e,t){ejn(this,Pp(e,37),t)},Y6(eG9,"GraphTransformer",792),eTS(511,22,{3:1,35:1,22:1,511:1},EV);var e4F=enw(eG9,"GraphTransformer/Mode",511,e1G,$9,NF);eTS(1510,1,eGB,nr),eUe.pf=function(e,t){eAP(Pp(e,37),t)},Y6(eG9,"HierarchicalNodeResizingProcessor",1510),eTS(1511,1,eGB,ni),eUe.pf=function(e,t){erP(Pp(e,37),t)},Y6(eG9,"HierarchicalPortConstraintProcessor",1511),eTS(1512,1,e$C,na),eUe.ue=function(e,t){return epZ(Pp(e,10),Pp(t,10))},eUe.Fb=function(e){return this===e},eUe.ve=function(){return new fZ(this)},Y6(eG9,"HierarchicalPortConstraintProcessor/NodeComparator",1512),eTS(1513,1,eGB,no),eUe.pf=function(e,t){eN6(Pp(e,37),t)},Y6(eG9,"HierarchicalPortDummySizeProcessor",1513),eTS(1514,1,eGB,ns),eUe.pf=function(e,t){eCf(this,Pp(e,37),t)},eUe.a=0,Y6(eG9,"HierarchicalPortOrthogonalEdgeRouter",1514),eTS(1515,1,e$C,nu),eUe.ue=function(e,t){return Av(Pp(e,10),Pp(t,10))},eUe.Fb=function(e){return this===e},eUe.ve=function(){return new fZ(this)},Y6(eG9,"HierarchicalPortOrthogonalEdgeRouter/1",1515),eTS(1516,1,e$C,nc),eUe.ue=function(e,t){return JW(Pp(e,10),Pp(t,10))},eUe.Fb=function(e){return this===e},eUe.ve=function(){return new fZ(this)},Y6(eG9,"HierarchicalPortOrthogonalEdgeRouter/2",1516),eTS(1517,1,eGB,nl),eUe.pf=function(e,t){e_O(Pp(e,37),t)},Y6(eG9,"HierarchicalPortPositionProcessor",1517),eTS(1518,1,eGB,cp),eUe.pf=function(e,t){eYG(this,Pp(e,37))},eUe.a=0,eUe.c=0,Y6(eG9,"HighDegreeNodeLayeringProcessor",1518),eTS(571,1,{571:1},nf),eUe.b=-1,eUe.d=-1,Y6(eG9,"HighDegreeNodeLayeringProcessor/HighDegreeNodeInformation",571),eTS(1519,1,{},nd),eUe.Kb=function(e){return DR(),efu(Pp(e,10))},eUe.Fb=function(e){return this===e},Y6(eG9,"HighDegreeNodeLayeringProcessor/lambda$0$Type",1519),eTS(1520,1,{},nh),eUe.Kb=function(e){return DR(),efc(Pp(e,10))},eUe.Fb=function(e){return this===e},Y6(eG9,"HighDegreeNodeLayeringProcessor/lambda$1$Type",1520),eTS(1526,1,eGB,np),eUe.pf=function(e,t){eD9(this,Pp(e,37),t)},Y6(eG9,"HyperedgeDummyMerger",1526),eTS(793,1,{},DL),eUe.a=!1,eUe.b=!1,eUe.c=!1,Y6(eG9,"HyperedgeDummyMerger/MergeState",793),eTS(1527,1,{},nb),eUe.Kb=function(e){return new R1(null,new Gq(Pp(e,29).a,16))},Y6(eG9,"HyperedgeDummyMerger/lambda$0$Type",1527),eTS(1528,1,{},nm),eUe.Kb=function(e){return new R1(null,new Gq(Pp(e,10).j,16))},Y6(eG9,"HyperedgeDummyMerger/lambda$1$Type",1528),eTS(1529,1,eUF,ng),eUe.td=function(e){Pp(e,11).p=-1},Y6(eG9,"HyperedgeDummyMerger/lambda$2$Type",1529),eTS(1530,1,eGB,nv),eUe.pf=function(e,t){eD5(Pp(e,37),t)},Y6(eG9,"HypernodesProcessor",1530),eTS(1531,1,eGB,ny),eUe.pf=function(e,t){eD8(Pp(e,37),t)},Y6(eG9,"InLayerConstraintProcessor",1531),eTS(1532,1,eGB,nw),eUe.pf=function(e,t){eiW(Pp(e,37),t)},Y6(eG9,"InnermostNodeMarginCalculator",1532),eTS(1533,1,eGB,n_),eUe.pf=function(e,t){eFW(this,Pp(e,37))},eUe.a=eH1,eUe.b=eH1,eUe.c=eHQ,eUe.d=eHQ;var e4Y=Y6(eG9,"InteractiveExternalPortPositioner",1533);eTS(1534,1,{},nE),eUe.Kb=function(e){return Pp(e,17).d.i},eUe.Fb=function(e){return this===e},Y6(eG9,"InteractiveExternalPortPositioner/lambda$0$Type",1534),eTS(1535,1,{},dG),eUe.Kb=function(e){return AE(this.a,LV(e))},eUe.Fb=function(e){return this===e},Y6(eG9,"InteractiveExternalPortPositioner/lambda$1$Type",1535),eTS(1536,1,{},nS),eUe.Kb=function(e){return Pp(e,17).c.i},eUe.Fb=function(e){return this===e},Y6(eG9,"InteractiveExternalPortPositioner/lambda$2$Type",1536),eTS(1537,1,{},dW),eUe.Kb=function(e){return AS(this.a,LV(e))},eUe.Fb=function(e){return this===e},Y6(eG9,"InteractiveExternalPortPositioner/lambda$3$Type",1537),eTS(1538,1,{},dK),eUe.Kb=function(e){return C8(this.a,LV(e))},eUe.Fb=function(e){return this===e},Y6(eG9,"InteractiveExternalPortPositioner/lambda$4$Type",1538),eTS(1539,1,{},dV),eUe.Kb=function(e){return C9(this.a,LV(e))},eUe.Fb=function(e){return this===e},Y6(eG9,"InteractiveExternalPortPositioner/lambda$5$Type",1539),eTS(77,22,{3:1,35:1,22:1,77:1,234:1},Eq),eUe.Kf=function(){switch(this.g){case 15:return new iA;case 22:return new iL;case 47:return new iD;case 28:case 35:return new nN;case 32:return new tB;case 42:return new t$;case 1:return new tz;case 41:return new tG;case 56:return new dz((erq(),e9W));case 0:return new dz((erq(),e9G));case 2:return new tW;case 54:return new tK;case 33:return new tX;case 51:return new t8;case 55:return new nr;case 13:return new ni;case 38:return new no;case 44:return new ns;case 40:return new nl;case 9:return new cp;case 49:return new AU;case 37:return new np;case 43:return new nv;case 27:return new ny;case 30:return new nw;case 3:return new n_;case 18:return new nx;case 29:return new nT;case 5:return new cb;case 50:return new nk;case 34:return new cm;case 36:return new nP;case 52:return new cd;case 11:return new nj;case 7:return new cv;case 39:return new nF;case 45:return new nY;case 16:return new nB;case 10:return new nU;case 48:return new n$;case 21:return new nz;case 23:return new gx((enU(),tui));case 8:return new nW;case 12:return new nV;case 4:return new nq;case 19:return new cE;case 17:return new n6;case 53:return new n5;case 6:return new rc;case 25:return new ms;case 46:return new rn;case 31:return new CV;case 14:return new rg;case 26:return new iB;case 20:return new rE;case 24:return new gx((enU(),tua));default:throw p7(new gL(eWt+(null!=this.f?this.f:""+this.g)))}};var e4B=enw(eG9,eWn,77,e1G,eAn,Nj);eTS(1540,1,eGB,nx),eUe.pf=function(e,t){eFq(Pp(e,37),t)},Y6(eG9,"InvertedPortProcessor",1540),eTS(1541,1,eGB,nT),eUe.pf=function(e,t){eIR(Pp(e,37),t)},Y6(eG9,"LabelAndNodeSizeProcessor",1541),eTS(1542,1,eU9,nM),eUe.Mb=function(e){return Pp(e,10).k==(eEn(),e9N)},Y6(eG9,"LabelAndNodeSizeProcessor/lambda$0$Type",1542),eTS(1543,1,eU9,nO),eUe.Mb=function(e){return Pp(e,10).k==(eEn(),e9C)},Y6(eG9,"LabelAndNodeSizeProcessor/lambda$1$Type",1543),eTS(1544,1,eUF,DC),eUe.td=function(e){_z(this.b,this.a,this.c,Pp(e,10))},eUe.a=!1,eUe.c=!1,Y6(eG9,"LabelAndNodeSizeProcessor/lambda$2$Type",1544),eTS(1545,1,eGB,cb),eUe.pf=function(e,t){eFu(Pp(e,37),t)},Y6(eG9,"LabelDummyInserter",1545),eTS(1546,1,e$q,nA),eUe.Lb=function(e){return xc(e_k(Pp(e,70),(eBy(),tab)))===xc((etT(),tp_))},eUe.Fb=function(e){return this===e},eUe.Mb=function(e){return xc(e_k(Pp(e,70),(eBy(),tab)))===xc((etT(),tp_))},Y6(eG9,"LabelDummyInserter/1",1546),eTS(1547,1,eGB,nk),eUe.pf=function(e,t){eRz(Pp(e,37),t)},Y6(eG9,"LabelDummyRemover",1547),eTS(1548,1,eU9,nL),eUe.Mb=function(e){return gN(LK(e_k(Pp(e,70),(eBy(),tap))))},Y6(eG9,"LabelDummyRemover/lambda$0$Type",1548),eTS(1359,1,eGB,cm),eUe.pf=function(e,t){ejC(this,Pp(e,37),t)},eUe.a=null,Y6(eG9,"LabelDummySwitcher",1359),eTS(286,1,{286:1},eIu),eUe.c=0,eUe.d=null,eUe.f=0,Y6(eG9,"LabelDummySwitcher/LabelDummyInfo",286),eTS(1360,1,{},nC),eUe.Kb=function(e){return erJ(),new R1(null,new Gq(Pp(e,29).a,16))},Y6(eG9,"LabelDummySwitcher/lambda$0$Type",1360),eTS(1361,1,eU9,nI),eUe.Mb=function(e){return erJ(),Pp(e,10).k==(eEn(),e9I)},Y6(eG9,"LabelDummySwitcher/lambda$1$Type",1361),eTS(1362,1,{},dX),eUe.Kb=function(e){return Co(this.a,Pp(e,10))},Y6(eG9,"LabelDummySwitcher/lambda$2$Type",1362),eTS(1363,1,eUF,dJ),eUe.td=function(e){BO(this.a,Pp(e,286))},Y6(eG9,"LabelDummySwitcher/lambda$3$Type",1363),eTS(1364,1,e$C,nD),eUe.ue=function(e,t){return FL(Pp(e,286),Pp(t,286))},eUe.Fb=function(e){return this===e},eUe.ve=function(){return new fZ(this)},Y6(eG9,"LabelDummySwitcher/lambda$4$Type",1364),eTS(791,1,eGB,nN),eUe.pf=function(e,t){XT(Pp(e,37),t)},Y6(eG9,"LabelManagementProcessor",791),eTS(1549,1,eGB,nP),eUe.pf=function(e,t){eLr(Pp(e,37),t)},Y6(eG9,"LabelSideSelector",1549),eTS(1550,1,eU9,nR),eUe.Mb=function(e){return gN(LK(e_k(Pp(e,70),(eBy(),tap))))},Y6(eG9,"LabelSideSelector/lambda$0$Type",1550),eTS(1558,1,eGB,nj),eUe.pf=function(e,t){eN5(Pp(e,37),t)},Y6(eG9,"LayerConstraintPostprocessor",1558),eTS(1559,1,eGB,cv),eUe.pf=function(e,t){eMr(Pp(e,37),t)},Y6(eG9,"LayerConstraintPreprocessor",1559),eTS(360,22,{3:1,35:1,22:1,360:1},EZ);var e4U=enw(eG9,"LayerConstraintPreprocessor/HiddenNodeConnections",360,e1G,Vs,DF);eTS(1560,1,eGB,nF),eUe.pf=function(e,t){eRB(Pp(e,37),t)},Y6(eG9,"LayerSizeAndGraphHeightCalculator",1560),eTS(1561,1,eGB,nY),eUe.pf=function(e,t){eOw(Pp(e,37),t)},Y6(eG9,"LongEdgeJoiner",1561),eTS(1562,1,eGB,nB),eUe.pf=function(e,t){eRf(Pp(e,37),t)},Y6(eG9,"LongEdgeSplitter",1562),eTS(1563,1,eGB,nU),eUe.pf=function(e,t){ejN(this,Pp(e,37),t)},eUe.d=0,eUe.e=0,eUe.i=0,eUe.j=0,eUe.k=0,eUe.n=0,Y6(eG9,"NodePromotion",1563),eTS(1564,1,{},nH),eUe.Kb=function(e){return Pp(e,46),OQ(),!0},eUe.Fb=function(e){return this===e},Y6(eG9,"NodePromotion/lambda$0$Type",1564),eTS(1565,1,{},dq),eUe.Kb=function(e){return UM(this.a,Pp(e,46))},eUe.Fb=function(e){return this===e},eUe.a=0,Y6(eG9,"NodePromotion/lambda$1$Type",1565),eTS(1566,1,{},dZ),eUe.Kb=function(e){return UO(this.a,Pp(e,46))},eUe.Fb=function(e){return this===e},eUe.a=0,Y6(eG9,"NodePromotion/lambda$2$Type",1566),eTS(1567,1,eGB,n$),eUe.pf=function(e,t){eYN(Pp(e,37),t)},Y6(eG9,"NorthSouthPortPostprocessor",1567),eTS(1568,1,eGB,nz),eUe.pf=function(e,t){eYd(Pp(e,37),t)},Y6(eG9,"NorthSouthPortPreprocessor",1568),eTS(1569,1,e$C,nG),eUe.ue=function(e,t){return ea2(Pp(e,11),Pp(t,11))},eUe.Fb=function(e){return this===e},eUe.ve=function(){return new fZ(this)},Y6(eG9,"NorthSouthPortPreprocessor/lambda$0$Type",1569),eTS(1570,1,eGB,nW),eUe.pf=function(e,t){eDx(Pp(e,37),t)},Y6(eG9,"PartitionMidprocessor",1570),eTS(1571,1,eU9,nK),eUe.Mb=function(e){return Ln(Pp(e,10),(eBy(),ton))},Y6(eG9,"PartitionMidprocessor/lambda$0$Type",1571),eTS(1572,1,eUF,dQ),eUe.td=function(e){H$(this.a,Pp(e,10))},Y6(eG9,"PartitionMidprocessor/lambda$1$Type",1572),eTS(1573,1,eGB,nV),eUe.pf=function(e,t){eO3(Pp(e,37),t)},Y6(eG9,"PartitionPostprocessor",1573),eTS(1574,1,eGB,nq),eUe.pf=function(e,t){exQ(Pp(e,37),t)},Y6(eG9,"PartitionPreprocessor",1574),eTS(1575,1,eU9,nZ),eUe.Mb=function(e){return Ln(Pp(e,10),(eBy(),ton))},Y6(eG9,"PartitionPreprocessor/lambda$0$Type",1575),eTS(1576,1,{},nX),eUe.Kb=function(e){return new R1(null,new YI(new Fa(OH(efc(Pp(e,10)).a.Kc(),new c))))},Y6(eG9,"PartitionPreprocessor/lambda$1$Type",1576),eTS(1577,1,eU9,nJ),eUe.Mb=function(e){return epe(Pp(e,17))},Y6(eG9,"PartitionPreprocessor/lambda$2$Type",1577),eTS(1578,1,eUF,nQ),eUe.td=function(e){eoL(Pp(e,17))},Y6(eG9,"PartitionPreprocessor/lambda$3$Type",1578),eTS(1579,1,eGB,cE),eUe.pf=function(e,t){eDe(Pp(e,37),t)},Y6(eG9,"PortListSorter",1579),eTS(1580,1,{},n1),eUe.Kb=function(e){return euv(),Pp(e,11).e},Y6(eG9,"PortListSorter/lambda$0$Type",1580),eTS(1581,1,{},n0),eUe.Kb=function(e){return euv(),Pp(e,11).g},Y6(eG9,"PortListSorter/lambda$1$Type",1581),eTS(1582,1,e$C,n2),eUe.ue=function(e,t){return qy(Pp(e,11),Pp(t,11))},eUe.Fb=function(e){return this===e},eUe.ve=function(){return new fZ(this)},Y6(eG9,"PortListSorter/lambda$2$Type",1582),eTS(1583,1,e$C,n3),eUe.ue=function(e,t){return eg_(Pp(e,11),Pp(t,11))},eUe.Fb=function(e){return this===e},eUe.ve=function(){return new fZ(this)},Y6(eG9,"PortListSorter/lambda$3$Type",1583),eTS(1584,1,e$C,n4),eUe.ue=function(e,t){return eDK(Pp(e,11),Pp(t,11))},eUe.Fb=function(e){return this===e},eUe.ve=function(){return new fZ(this)},Y6(eG9,"PortListSorter/lambda$4$Type",1584),eTS(1585,1,eGB,n6),eUe.pf=function(e,t){eT3(Pp(e,37),t)},Y6(eG9,"PortSideProcessor",1585),eTS(1586,1,eGB,n5),eUe.pf=function(e,t){eCH(Pp(e,37),t)},Y6(eG9,"ReversedEdgeRestorer",1586),eTS(1591,1,eGB,ms),eUe.pf=function(e,t){emJ(this,Pp(e,37),t)},Y6(eG9,"SelfLoopPortRestorer",1591),eTS(1592,1,{},n8),eUe.Kb=function(e){return new R1(null,new Gq(Pp(e,29).a,16))},Y6(eG9,"SelfLoopPortRestorer/lambda$0$Type",1592),eTS(1593,1,eU9,n9),eUe.Mb=function(e){return Pp(e,10).k==(eEn(),e9N)},Y6(eG9,"SelfLoopPortRestorer/lambda$1$Type",1593),eTS(1594,1,eU9,n7),eUe.Mb=function(e){return Ln(Pp(e,10),(eBU(),tnk))},Y6(eG9,"SelfLoopPortRestorer/lambda$2$Type",1594),eTS(1595,1,{},re),eUe.Kb=function(e){return Pp(e_k(Pp(e,10),(eBU(),tnk)),403)},Y6(eG9,"SelfLoopPortRestorer/lambda$3$Type",1595),eTS(1596,1,eUF,d1),eUe.td=function(e){eE_(this.a,Pp(e,403))},Y6(eG9,"SelfLoopPortRestorer/lambda$4$Type",1596),eTS(794,1,eUF,rt),eUe.td=function(e){eEq(Pp(e,101))},Y6(eG9,"SelfLoopPortRestorer/lambda$5$Type",794),eTS(1597,1,eGB,rn),eUe.pf=function(e,t){ep1(Pp(e,37),t)},Y6(eG9,"SelfLoopPostProcessor",1597),eTS(1598,1,{},rr),eUe.Kb=function(e){return new R1(null,new Gq(Pp(e,29).a,16))},Y6(eG9,"SelfLoopPostProcessor/lambda$0$Type",1598),eTS(1599,1,eU9,ri),eUe.Mb=function(e){return Pp(e,10).k==(eEn(),e9N)},Y6(eG9,"SelfLoopPostProcessor/lambda$1$Type",1599),eTS(1600,1,eU9,ra),eUe.Mb=function(e){return Ln(Pp(e,10),(eBU(),tnk))},Y6(eG9,"SelfLoopPostProcessor/lambda$2$Type",1600),eTS(1601,1,eUF,ro),eUe.td=function(e){eyi(Pp(e,10))},Y6(eG9,"SelfLoopPostProcessor/lambda$3$Type",1601),eTS(1602,1,{},rs),eUe.Kb=function(e){return new R1(null,new Gq(Pp(e,101).f,1))},Y6(eG9,"SelfLoopPostProcessor/lambda$4$Type",1602),eTS(1603,1,eUF,d0),eUe.td=function(e){Vf(this.a,Pp(e,409))},Y6(eG9,"SelfLoopPostProcessor/lambda$5$Type",1603),eTS(1604,1,eU9,ru),eUe.Mb=function(e){return!!Pp(e,101).i},Y6(eG9,"SelfLoopPostProcessor/lambda$6$Type",1604),eTS(1605,1,eUF,d2),eUe.td=function(e){gb(this.a,Pp(e,101))},Y6(eG9,"SelfLoopPostProcessor/lambda$7$Type",1605),eTS(1587,1,eGB,rc),eUe.pf=function(e,t){eMJ(Pp(e,37),t)},Y6(eG9,"SelfLoopPreProcessor",1587),eTS(1588,1,{},rl),eUe.Kb=function(e){return new R1(null,new Gq(Pp(e,101).f,1))},Y6(eG9,"SelfLoopPreProcessor/lambda$0$Type",1588),eTS(1589,1,{},rf),eUe.Kb=function(e){return Pp(e,409).a},Y6(eG9,"SelfLoopPreProcessor/lambda$1$Type",1589),eTS(1590,1,eUF,rd),eUe.td=function(e){MH(Pp(e,17))},Y6(eG9,"SelfLoopPreProcessor/lambda$2$Type",1590),eTS(1606,1,eGB,CV),eUe.pf=function(e,t){eEi(this,Pp(e,37),t)},Y6(eG9,"SelfLoopRouter",1606),eTS(1607,1,{},rh),eUe.Kb=function(e){return new R1(null,new Gq(Pp(e,29).a,16))},Y6(eG9,"SelfLoopRouter/lambda$0$Type",1607),eTS(1608,1,eU9,rp),eUe.Mb=function(e){return Pp(e,10).k==(eEn(),e9N)},Y6(eG9,"SelfLoopRouter/lambda$1$Type",1608),eTS(1609,1,eU9,rb),eUe.Mb=function(e){return Ln(Pp(e,10),(eBU(),tnk))},Y6(eG9,"SelfLoopRouter/lambda$2$Type",1609),eTS(1610,1,{},rm),eUe.Kb=function(e){return Pp(e_k(Pp(e,10),(eBU(),tnk)),403)},Y6(eG9,"SelfLoopRouter/lambda$3$Type",1610),eTS(1611,1,eUF,EX),eUe.td=function(e){Hs(this.a,this.b,Pp(e,403))},Y6(eG9,"SelfLoopRouter/lambda$4$Type",1611),eTS(1612,1,eGB,rg),eUe.pf=function(e,t){eAz(Pp(e,37),t)},Y6(eG9,"SemiInteractiveCrossMinProcessor",1612),eTS(1613,1,eU9,rv),eUe.Mb=function(e){return Pp(e,10).k==(eEn(),e9N)},Y6(eG9,"SemiInteractiveCrossMinProcessor/lambda$0$Type",1613),eTS(1614,1,eU9,ry),eUe.Mb=function(e){return R8(Pp(e,10))._b((eBy(),tog))},Y6(eG9,"SemiInteractiveCrossMinProcessor/lambda$1$Type",1614),eTS(1615,1,e$C,rw),eUe.ue=function(e,t){return erF(Pp(e,10),Pp(t,10))},eUe.Fb=function(e){return this===e},eUe.ve=function(){return new fZ(this)},Y6(eG9,"SemiInteractiveCrossMinProcessor/lambda$2$Type",1615),eTS(1616,1,{},r_),eUe.Ce=function(e,t){return H4(Pp(e,10),Pp(t,10))},Y6(eG9,"SemiInteractiveCrossMinProcessor/lambda$3$Type",1616),eTS(1618,1,eGB,rE),eUe.pf=function(e,t){eN9(Pp(e,37),t)},Y6(eG9,"SortByInputModelProcessor",1618),eTS(1619,1,eU9,rS),eUe.Mb=function(e){return 0!=Pp(e,11).g.c.length},Y6(eG9,"SortByInputModelProcessor/lambda$0$Type",1619),eTS(1620,1,eUF,d3),eUe.td=function(e){eE5(this.a,Pp(e,11))},Y6(eG9,"SortByInputModelProcessor/lambda$1$Type",1620),eTS(1693,803,{},erY),eUe.Me=function(e){var t,n,r,i;switch(this.c=e,this.a.g){case 2:t=new p0,_r(UJ(new R1(null,new Gq(this.c.a.b,16)),new rj),new E2(this,t)),eS2(this,new rT),ety(t,new rM),t.c=Je(e1R,eUp,1,0,5,1),_r(UJ(new R1(null,new Gq(this.c.a.b,16)),new rO),new d6(t)),eS2(this,new rA),ety(t,new rL),t.c=Je(e1R,eUp,1,0,5,1),n=M_(eim(U1(new R1(null,new Gq(this.c.a.b,16)),new d5(this))),new rC),_r(new R1(null,new Gq(this.c.a.a,16)),new EQ(n,t)),eS2(this,new rD),ety(t,new rk),t.c=Je(e1R,eUp,1,0,5,1);break;case 3:r=new p0,eS2(this,new rx),i=M_(eim(U1(new R1(null,new Gq(this.c.a.b,16)),new d4(this))),new rI),_r(UJ(new R1(null,new Gq(this.c.a.b,16)),new rN),new E0(i,r)),eS2(this,new rP),ety(r,new rR),r.c=Je(e1R,eUp,1,0,5,1);break;default:throw p7(new bI)}},eUe.b=0,Y6(eWs,"EdgeAwareScanlineConstraintCalculation",1693),eTS(1694,1,e$q,rx),eUe.Lb=function(e){return M4(Pp(e,57).g,145)},eUe.Fb=function(e){return this===e},eUe.Mb=function(e){return M4(Pp(e,57).g,145)},Y6(eWs,"EdgeAwareScanlineConstraintCalculation/lambda$0$Type",1694),eTS(1695,1,{},d4),eUe.Fe=function(e){return eky(this.a,Pp(e,57))},Y6(eWs,"EdgeAwareScanlineConstraintCalculation/lambda$1$Type",1695),eTS(1703,1,eU7,EJ),eUe.Vd=function(){ev_(this.a,this.b,-1)},eUe.b=0,Y6(eWs,"EdgeAwareScanlineConstraintCalculation/lambda$10$Type",1703),eTS(1705,1,e$q,rT),eUe.Lb=function(e){return M4(Pp(e,57).g,145)},eUe.Fb=function(e){return this===e},eUe.Mb=function(e){return M4(Pp(e,57).g,145)},Y6(eWs,"EdgeAwareScanlineConstraintCalculation/lambda$11$Type",1705),eTS(1706,1,eUF,rM),eUe.td=function(e){Pp(e,365).Vd()},Y6(eWs,"EdgeAwareScanlineConstraintCalculation/lambda$12$Type",1706),eTS(1707,1,eU9,rO),eUe.Mb=function(e){return M4(Pp(e,57).g,10)},Y6(eWs,"EdgeAwareScanlineConstraintCalculation/lambda$13$Type",1707),eTS(1709,1,eUF,d6),eUe.td=function(e){efw(this.a,Pp(e,57))},Y6(eWs,"EdgeAwareScanlineConstraintCalculation/lambda$14$Type",1709),eTS(1708,1,eU7,E8),eUe.Vd=function(){ev_(this.b,this.a,-1)},eUe.a=0,Y6(eWs,"EdgeAwareScanlineConstraintCalculation/lambda$15$Type",1708),eTS(1710,1,e$q,rA),eUe.Lb=function(e){return M4(Pp(e,57).g,10)},eUe.Fb=function(e){return this===e},eUe.Mb=function(e){return M4(Pp(e,57).g,10)},Y6(eWs,"EdgeAwareScanlineConstraintCalculation/lambda$16$Type",1710),eTS(1711,1,eUF,rL),eUe.td=function(e){Pp(e,365).Vd()},Y6(eWs,"EdgeAwareScanlineConstraintCalculation/lambda$17$Type",1711),eTS(1712,1,{},d5),eUe.Fe=function(e){return ekw(this.a,Pp(e,57))},Y6(eWs,"EdgeAwareScanlineConstraintCalculation/lambda$18$Type",1712),eTS(1713,1,{},rC),eUe.De=function(){return 0},Y6(eWs,"EdgeAwareScanlineConstraintCalculation/lambda$19$Type",1713),eTS(1696,1,{},rI),eUe.De=function(){return 0},Y6(eWs,"EdgeAwareScanlineConstraintCalculation/lambda$2$Type",1696),eTS(1715,1,eUF,EQ),eUe.td=function(e){jq(this.a,this.b,Pp(e,307))},eUe.a=0,Y6(eWs,"EdgeAwareScanlineConstraintCalculation/lambda$20$Type",1715),eTS(1714,1,eU7,E1),eUe.Vd=function(){eT4(this.a,this.b,-1)},eUe.b=0,Y6(eWs,"EdgeAwareScanlineConstraintCalculation/lambda$21$Type",1714),eTS(1716,1,e$q,rD),eUe.Lb=function(e){return Pp(e,57),!0},eUe.Fb=function(e){return this===e},eUe.Mb=function(e){return Pp(e,57),!0},Y6(eWs,"EdgeAwareScanlineConstraintCalculation/lambda$22$Type",1716),eTS(1717,1,eUF,rk),eUe.td=function(e){Pp(e,365).Vd()},Y6(eWs,"EdgeAwareScanlineConstraintCalculation/lambda$23$Type",1717),eTS(1697,1,eU9,rN),eUe.Mb=function(e){return M4(Pp(e,57).g,10)},Y6(eWs,"EdgeAwareScanlineConstraintCalculation/lambda$3$Type",1697),eTS(1699,1,eUF,E0),eUe.td=function(e){jZ(this.a,this.b,Pp(e,57))},eUe.a=0,Y6(eWs,"EdgeAwareScanlineConstraintCalculation/lambda$4$Type",1699),eTS(1698,1,eU7,E9),eUe.Vd=function(){ev_(this.b,this.a,-1)},eUe.a=0,Y6(eWs,"EdgeAwareScanlineConstraintCalculation/lambda$5$Type",1698),eTS(1700,1,e$q,rP),eUe.Lb=function(e){return Pp(e,57),!0},eUe.Fb=function(e){return this===e},eUe.Mb=function(e){return Pp(e,57),!0},Y6(eWs,"EdgeAwareScanlineConstraintCalculation/lambda$6$Type",1700),eTS(1701,1,eUF,rR),eUe.td=function(e){Pp(e,365).Vd()},Y6(eWs,"EdgeAwareScanlineConstraintCalculation/lambda$7$Type",1701),eTS(1702,1,eU9,rj),eUe.Mb=function(e){return M4(Pp(e,57).g,145)},Y6(eWs,"EdgeAwareScanlineConstraintCalculation/lambda$8$Type",1702),eTS(1704,1,eUF,E2),eUe.td=function(e){eth(this.a,this.b,Pp(e,57))},Y6(eWs,"EdgeAwareScanlineConstraintCalculation/lambda$9$Type",1704),eTS(1521,1,eGB,AU),eUe.pf=function(e,t){eRE(this,Pp(e,37),t)},Y6(eWs,"HorizontalGraphCompactor",1521),eTS(1522,1,{},d8),eUe.Oe=function(e,t){var n,r,i;return Q9(e,t)?0:(n=KT(e),r=KT(t),n&&n.k==(eEn(),e9C)||r&&r.k==(eEn(),e9C))?0:(i=Pp(e_k(this.a.a,(eBU(),tnx)),304),Ax(i,n?n.k:(eEn(),e9D),r?r.k:(eEn(),e9D)))},eUe.Pe=function(e,t){var n,r,i;return Q9(e,t)?1:(n=KT(e),r=KT(t),i=Pp(e_k(this.a.a,(eBU(),tnx)),304),AT(i,n?n.k:(eEn(),e9D),r?r.k:(eEn(),e9D)))},Y6(eWs,"HorizontalGraphCompactor/1",1522),eTS(1523,1,{},rF),eUe.Ne=function(e,t){return _L(),0==e.a.i},Y6(eWs,"HorizontalGraphCompactor/lambda$0$Type",1523),eTS(1524,1,{},d9),eUe.Ne=function(e,t){return HZ(this.a,e,t)},Y6(eWs,"HorizontalGraphCompactor/lambda$1$Type",1524),eTS(1664,1,{},QF),Y6(eWs,"LGraphToCGraphTransformer",1664),eTS(1672,1,eU9,rY),eUe.Mb=function(e){return null!=e},Y6(eWs,"LGraphToCGraphTransformer/0methodref$nonNull$Type",1672),eTS(1665,1,{},rB),eUe.Kb=function(e){return Dj(),efF(e_k(Pp(Pp(e,57).g,10),(eBU(),tnc)))},Y6(eWs,"LGraphToCGraphTransformer/lambda$0$Type",1665),eTS(1666,1,{},rU),eUe.Kb=function(e){return Dj(),ecR(Pp(Pp(e,57).g,145))},Y6(eWs,"LGraphToCGraphTransformer/lambda$1$Type",1666),eTS(1675,1,eU9,rH),eUe.Mb=function(e){return Dj(),M4(Pp(e,57).g,10)},Y6(eWs,"LGraphToCGraphTransformer/lambda$10$Type",1675),eTS(1676,1,eUF,r$),eUe.td=function(e){Hq(Pp(e,57))},Y6(eWs,"LGraphToCGraphTransformer/lambda$11$Type",1676),eTS(1677,1,eU9,rz),eUe.Mb=function(e){return Dj(),M4(Pp(e,57).g,145)},Y6(eWs,"LGraphToCGraphTransformer/lambda$12$Type",1677),eTS(1681,1,eUF,rG),eUe.td=function(e){ecP(Pp(e,57))},Y6(eWs,"LGraphToCGraphTransformer/lambda$13$Type",1681),eTS(1678,1,eUF,d7),eUe.td=function(e){Tm(this.a,Pp(e,8))},eUe.a=0,Y6(eWs,"LGraphToCGraphTransformer/lambda$14$Type",1678),eTS(1679,1,eUF,he),eUe.td=function(e){Tv(this.a,Pp(e,110))},eUe.a=0,Y6(eWs,"LGraphToCGraphTransformer/lambda$15$Type",1679),eTS(1680,1,eUF,ht),eUe.td=function(e){Tg(this.a,Pp(e,8))},eUe.a=0,Y6(eWs,"LGraphToCGraphTransformer/lambda$16$Type",1680),eTS(1682,1,{},rW),eUe.Kb=function(e){return Dj(),new R1(null,new YI(new Fa(OH(efc(Pp(e,10)).a.Kc(),new c))))},Y6(eWs,"LGraphToCGraphTransformer/lambda$17$Type",1682),eTS(1683,1,eU9,rK),eUe.Mb=function(e){return Dj(),q9(Pp(e,17))},Y6(eWs,"LGraphToCGraphTransformer/lambda$18$Type",1683),eTS(1684,1,eUF,hn),eUe.td=function(e){eex(this.a,Pp(e,17))},Y6(eWs,"LGraphToCGraphTransformer/lambda$19$Type",1684),eTS(1668,1,eUF,hr),eUe.td=function(e){Wj(this.a,Pp(e,145))},Y6(eWs,"LGraphToCGraphTransformer/lambda$2$Type",1668),eTS(1685,1,{},rV),eUe.Kb=function(e){return Dj(),new R1(null,new Gq(Pp(e,29).a,16))},Y6(eWs,"LGraphToCGraphTransformer/lambda$20$Type",1685),eTS(1686,1,{},rq),eUe.Kb=function(e){return Dj(),new R1(null,new YI(new Fa(OH(efc(Pp(e,10)).a.Kc(),new c))))},Y6(eWs,"LGraphToCGraphTransformer/lambda$21$Type",1686),eTS(1687,1,{},rZ),eUe.Kb=function(e){return Dj(),Pp(e_k(Pp(e,17),(eBU(),tnO)),15)},Y6(eWs,"LGraphToCGraphTransformer/lambda$22$Type",1687),eTS(1688,1,eU9,rX),eUe.Mb=function(e){return AN(Pp(e,15))},Y6(eWs,"LGraphToCGraphTransformer/lambda$23$Type",1688),eTS(1689,1,eUF,hi),eUe.td=function(e){ekn(this.a,Pp(e,15))},Y6(eWs,"LGraphToCGraphTransformer/lambda$24$Type",1689),eTS(1667,1,eUF,E3),eUe.td=function(e){VK(this.a,this.b,Pp(e,145))},Y6(eWs,"LGraphToCGraphTransformer/lambda$3$Type",1667),eTS(1669,1,{},rJ),eUe.Kb=function(e){return Dj(),new R1(null,new Gq(Pp(e,29).a,16))},Y6(eWs,"LGraphToCGraphTransformer/lambda$4$Type",1669),eTS(1670,1,{},rQ),eUe.Kb=function(e){return Dj(),new R1(null,new YI(new Fa(OH(efc(Pp(e,10)).a.Kc(),new c))))},Y6(eWs,"LGraphToCGraphTransformer/lambda$5$Type",1670),eTS(1671,1,{},r1),eUe.Kb=function(e){return Dj(),Pp(e_k(Pp(e,17),(eBU(),tnO)),15)},Y6(eWs,"LGraphToCGraphTransformer/lambda$6$Type",1671),eTS(1673,1,eUF,ha),eUe.td=function(e){exr(this.a,Pp(e,15))},Y6(eWs,"LGraphToCGraphTransformer/lambda$8$Type",1673),eTS(1674,1,eUF,E4),eUe.td=function(e){MN(this.a,this.b,Pp(e,145))},Y6(eWs,"LGraphToCGraphTransformer/lambda$9$Type",1674),eTS(1663,1,{},r0),eUe.Le=function(e){var t,n,r,i,a;for(this.a=e,this.d=new bX,this.c=Je(e24,eUp,121,this.a.a.a.c.length,0,1),this.b=0,n=new fz(this.a.a.a);n.a=b&&(P_(a,ell(l)),v=eB4.Math.max(v,y[l-1]-f),s+=p,m+=y[l-1]-m,f=y[l-1],p=u[l]),p=eB4.Math.max(p,u[l]),++l;s+=p}(h=eB4.Math.min(1/v,1/t.b/s))>r&&(r=h,n=a)}return n},eUe.Wf=function(){return!1},Y6(eWb,"MSDCutIndexHeuristic",802),eTS(1617,1,eGB,iB),eUe.pf=function(e,t){eNZ(Pp(e,37),t)},Y6(eWb,"SingleEdgeGraphWrapper",1617),eTS(227,22,{3:1,35:1,22:1,227:1},Ss);var e4K=enw(eWm,"CenterEdgeLabelPlacementStrategy",227,e1G,Jv,DU);eTS(422,22,{3:1,35:1,22:1,422:1},Su);var e4V=enw(eWm,"ConstraintCalculationStrategy",422,e1G,$G,DH);eTS(314,22,{3:1,35:1,22:1,314:1,246:1,234:1},Sc),eUe.Kf=function(){return ekF(this)},eUe.Xf=function(){return ekF(this)};var e4q=enw(eWm,"CrossingMinimizationStrategy",314,e1G,G6,D$);eTS(337,22,{3:1,35:1,22:1,337:1},Sl);var e4Z=enw(eWm,"CuttingStrategy",337,e1G,G5,DW);eTS(335,22,{3:1,35:1,22:1,335:1,246:1,234:1},Sf),eUe.Kf=function(){return eTW(this)},eUe.Xf=function(){return eTW(this)};var e4X=enw(eWm,"CycleBreakingStrategy",335,e1G,Zv,DK);eTS(419,22,{3:1,35:1,22:1,419:1},Sd);var e4J=enw(eWm,"DirectionCongruency",419,e1G,$z,DV);eTS(450,22,{3:1,35:1,22:1,450:1},Sh);var e4Q=enw(eWm,"EdgeConstraint",450,e1G,G8,Dq);eTS(276,22,{3:1,35:1,22:1,276:1},Sp);var e41=enw(eWm,"EdgeLabelSideSelection",276,e1G,JE,DZ);eTS(479,22,{3:1,35:1,22:1,479:1},Sb);var e40=enw(eWm,"EdgeStraighteningStrategy",479,e1G,$$,DX);eTS(274,22,{3:1,35:1,22:1,274:1},Sm);var e42=enw(eWm,"FixedAlignment",274,e1G,Jw,DJ);eTS(275,22,{3:1,35:1,22:1,275:1},Sg);var e43=enw(eWm,"GraphCompactionStrategy",275,e1G,Jy,DQ);eTS(256,22,{3:1,35:1,22:1,256:1},Sv);var e44=enw(eWm,"GraphProperties",256,e1G,eiT,D1);eTS(292,22,{3:1,35:1,22:1,292:1},Sy);var e46=enw(eWm,"GreedySwitchType",292,e1G,We,D0);eTS(303,22,{3:1,35:1,22:1,303:1},Sw);var e45=enw(eWm,"InLayerConstraint",303,e1G,G7,D2);eTS(420,22,{3:1,35:1,22:1,420:1},S_);var e48=enw(eWm,"InteractiveReferencePoint",420,e1G,$W,D3);eTS(163,22,{3:1,35:1,22:1,163:1},ST);var e49=enw(eWm,"LayerConstraint",163,e1G,Z_,D4);eTS(848,1,e$2,cT),eUe.Qe=function(e){efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eWE),""),"Direction Congruency"),"Specifies how drawings of the same graph with different layout directions compare to each other: either a natural reading direction is preserved or the drawings are rotated versions of each other."),trl),(eSd(),tdv)),e4J),el8((epx(),tdh))))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eWS),""),"Feedback Edges"),"Whether feedback edges should be highlighted by routing around the nodes."),(OQ(),!1)),tdm),e11),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eWk),""),"Interactive Reference Point"),"Determines which point of a node is considered by interactive layout phases."),trN),tdv),e48),el8(tdh)))),K_(e,eWk,eWI,trR),K_(e,eWk,eWH,trP),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eWx),""),"Merge Edges"),"Edges that have no ports are merged so they touch the connected nodes at the same points. When this option is disabled, one port is created for each edge directly connected to a node. When it is enabled, all such incoming edges share an input port, and all outgoing edges share an output port."),!1),tdm),e11),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eWT),""),"Merge Hierarchy-Crossing Edges"),"If hierarchical layout is active, hierarchy-crossing edges use as few hierarchical ports as possible. They are broken by the algorithm, with hierarchical ports inserted as required. Usually, one such port is created for each edge at each hierarchy crossing point. With this option set to true, we try to create as few hierarchical ports as possible in the process. In particular, all edges that form a hyperedge can share a port."),!0),tdm),e11),el8(tdh)))),efO(e,new eE9(v9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eWM),""),"Allow Non-Flow Ports To Switch Sides"),"Specifies whether non-flow ports may switch sides if their node's port constraints are either FIXED_SIDE or FIXED_ORDER. A non-flow port is a port on a side that is not part of the currently configured layout flow. For instance, given a left-to-right layout direction, north and south ports would be considered non-flow ports. Further note that the underlying criterium whether to switch sides or not solely relies on the minimization of edge crossings. Hence, edge length and other aesthetics criteria are not addressed."),!1),tdm),e11),el8(tdp)),eow(vx(e17,1),eUP,2,6,["org.eclipse.elk.layered.northOrSouthPort"])))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eWO),""),"Port Sorting Strategy"),"Only relevant for nodes with FIXED_SIDE port constraints. Determines the way a node's ports are distributed on the sides of a node if their order is not prescribed. The option is set on parent nodes."),tic),tdv),e6a),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eWA),""),"Thoroughness"),"How much effort should be spent to produce a nice layout."),ell(7)),tdw),e16),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eWL),""),"Add Unnecessary Bendpoints"),"Adds bend points even if an edge does not change direction. If true, each long edge dummy will contribute a bend point to its edges and hierarchy-crossing edges will always get a bend point where they cross hierarchy boundaries. By default, bend points are only added where an edge changes direction."),!1),tdm),e11),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eWC),""),"Generate Position and Layer IDs"),"If enabled position id and layer id are generated, which are usually only used internally when setting the interactiveLayout option. This option should be specified on the root node."),!1),tdm),e11),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eWI),"cycleBreaking"),"Cycle Breaking Strategy"),"Strategy for cycle breaking. Cycle breaking looks for cycles in the graph and determines which edges to reverse to break the cycles. Reversed edges will end up pointing to the opposite direction of regular edges (that is, reversed edges will point left if edges usually point right)."),tru),tdv),e4X),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eWD),eKC),"Node Layering Strategy"),"Strategy for node layering."),trX),tdv),e47),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eWN),eKC),"Layer Constraint"),"Determines a constraint on the placement of the node regarding the layering."),trU),tdv),e49),el8(tdd)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eWP),eKC),"Layer Choice Constraint"),"Allows to set a constraint regarding the layer placement of a node. Let i be the value of teh constraint. Assumed the drawing has n layers and i < n. If set to i, it expresses that the node should be placed in i-th layer. Should i>=n be true then the node is placed in the last layer of the drawing. Note that this option is not part of any of ELK Layered's default configurations but is only evaluated as part of the `InteractiveLayeredGraphVisitor`, which must be applied manually or used via the `DiagramLayoutEngine."),ell(-1)),tdw),e16),el8(tdd)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eWR),eKC),"Layer ID"),"Layer identifier that was calculated by ELK Layered for a node. This is only generated if interactiveLayot or generatePositionAndLayerIds is set."),ell(-1)),tdw),e16),el8(tdd)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eWj),eKI),"Upper Bound On Width [MinWidth Layerer]"),"Defines a loose upper bound on the width of the MinWidth layerer. If set to '-1' multiple values are tested and the best result is selected."),ell(4)),tdw),e16),el8(tdh)))),K_(e,eWj,eWD,trz),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eWF),eKI),"Upper Layer Estimation Scaling Factor [MinWidth Layerer]"),"Multiplied with Upper Bound On Width for defining an upper bound on the width of layers which haven't been determined yet, but whose maximum width had been (roughly) estimated by the MinWidth algorithm. Compensates for too high estimations. If set to '-1' multiple values are tested and the best result is selected."),ell(2)),tdw),e16),el8(tdh)))),K_(e,eWF,eWD,trW),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eWY),eKD),"Node Promotion Strategy"),"Reduces number of dummy nodes after layering phase (if possible)."),trq),tdv),e6r),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eWB),eKD),"Max Node Promotion Iterations"),"Limits the number of iterations for node promotion."),ell(0)),tdw),e16),el8(tdh)))),K_(e,eWB,eWY,null),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eWU),"layering.coffmanGraham"),"Layer Bound"),"The maximum number of nodes allowed per layer."),ell(eUu)),tdw),e16),el8(tdh)))),K_(e,eWU,eWD,trF),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eWH),eKN),"Crossing Minimization Strategy"),"Strategy for crossing minimization."),tro),tdv),e4q),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eW$),eKN),"Force Node Model Order"),"The node order given by the model does not change to produce a better layout. E.g. if node A is before node B in the model this is not changed during crossing minimization. This assumes that the node model order is already respected before crossing minimization. This can be achieved by setting considerModelOrder.strategy to NODES_AND_EDGES."),!1),tdm),e11),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eWz),eKN),"Hierarchical Sweepiness"),"How likely it is to use cross-hierarchy (1) vs bottom-up (-1)."),.1),tdg),e13),el8(tdh)))),K_(e,eWz,eKP,tre),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eWG),eKN),"Semi-Interactive Crossing Minimization"),"Preserves the order of nodes within a layer but still minimizes crossings between edges connecting long edge dummies. Derives the desired order from positions specified by the 'org.eclipse.elk.position' layout option. Requires a crossing minimization strategy that is able to process 'in-layer' constraints."),!1),tdm),e11),el8(tdh)))),K_(e,eWG,eWH,tri),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eWW),eKN),"Position Choice Constraint"),"Allows to set a constraint regarding the position placement of a node in a layer. Assumed the layer in which the node placed includes n other nodes and i < n. If set to i, it expresses that the node should be placed at the i-th position. Should i>=n be true then the node is placed at the last position in the layer. Note that this option is not part of any of ELK Layered's default configurations but is only evaluated as part of the `InteractiveLayeredGraphVisitor`, which must be applied manually or used via the `DiagramLayoutEngine."),ell(-1)),tdw),e16),el8(tdd)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eWK),eKN),"Position ID"),"Position within a layer that was determined by ELK Layered for a node. This is only generated if interactiveLayot or generatePositionAndLayerIds is set."),ell(-1)),tdw),e16),el8(tdd)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eWV),eKR),"Greedy Switch Activation Threshold"),"By default it is decided automatically if the greedy switch is activated or not. The decision is based on whether the size of the input graph (without dummy nodes) is smaller than the value of this option. A '0' enforces the activation."),ell(40)),tdw),e16),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eWq),eKR),"Greedy Switch Crossing Minimization"),"Greedy Switch strategy for crossing minimization. The greedy switch heuristic is executed after the regular crossing minimization as a post-processor. Note that if 'hierarchyHandling' is set to 'INCLUDE_CHILDREN', the 'greedySwitchHierarchical.type' option must be used."),tn8),tdv),e46),el8(tdh)))),K_(e,eWq,eWH,tn9),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eWZ),"crossingMinimization.greedySwitchHierarchical"),"Greedy Switch Crossing Minimization (hierarchical)"),"Activates the greedy switch heuristic in case hierarchical layout is used. The differences to the non-hierarchical case (see 'greedySwitch.type') are: 1) greedy switch is inactive by default, 3) only the option value set on the node at which hierarchical layout starts is relevant, and 2) if it's activated by the user, it properly addresses hierarchy-crossing edges."),tn3),tdv),e46),el8(tdh)))),K_(e,eWZ,eWH,tn4),K_(e,eWZ,eKP,tn6),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eWX),eKj),"Node Placement Strategy"),"Strategy for node placement."),tis),tdv),e6n),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v4(v7(v5(v8(new oN,eWJ),eKj),"Favor Straight Edges Over Balancing"),"Favor straight edges over a balanced node placement. The default behavior is determined automatically based on the used 'edgeRouting'. For an orthogonal style it is set to true, for all other styles to false."),tdm),e11),el8(tdh)))),K_(e,eWJ,eWX,tr8),K_(e,eWJ,eWX,tr9),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eWQ),eKF),"BK Edge Straightening"),"Specifies whether the Brandes Koepf node placer tries to increase the number of straight edges at the expense of diagram size. There is a subtle difference to the 'favorStraightEdges' option, which decides whether a balanced placement of the nodes is desired, or not. In bk terms this means combining the four alignments into a single balanced one, or not. This option on the other hand tries to straighten additional edges during the creation of each of the four alignments."),tr0),tdv),e40),el8(tdh)))),K_(e,eWQ,eWX,tr2),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eW1),eKF),"BK Fixed Alignment"),"Tells the BK node placer to use a certain alignment (out of its four) instead of the one producing the smallest height, or the combination of all four."),tr4),tdv),e42),el8(tdh)))),K_(e,eW1,eWX,tr6),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eW0),"nodePlacement.linearSegments"),"Linear Segments Deflection Dampening"),"Dampens the movement of nodes to keep the diagram from getting too large."),.3),tdg),e13),el8(tdh)))),K_(e,eW0,eWX,tie),efO(e,new eE9(yt(ye(yn(v4(v7(v5(v8(new oN,eW2),"nodePlacement.networkSimplex"),"Node Flexibility"),"Aims at shorter and straighter edges. Two configurations are possible: (a) allow ports to move freely on the side they are assigned to (the order is always defined beforehand), (b) additionally allow to enlarge a node wherever it helps. If this option is not configured for a node, the 'nodeFlexibility.default' value is used, which is specified for the node's parent."),tdv),e6t),el8(tdd)))),K_(e,eW2,eWX,tia),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eW3),"nodePlacement.networkSimplex.nodeFlexibility"),"Node Flexibility Default"),"Default value of the 'nodeFlexibility' option for the children of a hierarchical node."),tir),tdv),e6t),el8(tdh)))),K_(e,eW3,eWX,tii),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eW4),eKY),"Self-Loop Distribution"),"Alter the distribution of the loops around the node. It only takes effect for PortConstraints.FREE."),trv),tdv),e6s),el8(tdd)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eW6),eKY),"Self-Loop Ordering"),"Alter the ordering of the loops they can either be stacked or sequenced. It only takes effect for PortConstraints.FREE."),tr_),tdv),e6u),el8(tdd)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eW5),"edgeRouting.splines"),"Spline Routing Mode"),"Specifies the way control points are assembled for each individual edge. CONSERVATIVE ensures that edges are properly routed around the nodes but feels rather orthogonal at times. SLOPPY uses fewer control points to obtain curvier edge routes but may result in edges overlapping nodes."),trS),tdv),e6c),el8(tdh)))),K_(e,eW5,eKB,trk),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eW8),"edgeRouting.splines.sloppy"),"Sloppy Spline Layer Spacing Factor"),"Spacing factor for routing area between layers when using sloppy spline routing."),.2),tdg),e13),el8(tdh)))),K_(e,eW8,eKB,trT),K_(e,eW8,eW5,trM),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eW9),"edgeRouting.polyline"),"Sloped Edge Zone Width"),"Width of the strip to the left and to the right of each layer where the polyline edge router is allowed to refrain from ensuring that edges are routed horizontally. This prevents awkward bend points for nodes that extent almost to the edge of their layer."),2),tdg),e13),el8(tdh)))),K_(e,eW9,eKB,trm),efO(e,new eE9(yt(ye(yn(v4(v7(v5(v8(new oN,eW7),eKU),"Spacing Base Value"),"An optional base value for all other layout options of the 'spacing' group. It can be used to conveniently alter the overall 'spaciousness' of the drawing. Whenever an explicit value is set for the other layout options, this base value will have no effect. The base value is not inherited, i.e. it must be set for each hierarchical node."),tdg),e13),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eKe),eKU),"Edge Node Between Layers Spacing"),"The spacing to be preserved between nodes and edges that are routed next to the node's layer. For the spacing between nodes and edges that cross the node's layer 'spacing.edgeNode' is used."),10),tdg),e13),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eKt),eKU),"Edge Edge Between Layer Spacing"),"Spacing to be preserved between pairs of edges that are routed between the same pair of layers. Note that 'spacing.edgeEdge' is used for the spacing between pairs of edges crossing the same layer."),10),tdg),e13),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eKn),eKU),"Node Node Between Layers Spacing"),"The spacing to be preserved between any pair of nodes of two adjacent layers. Note that 'spacing.nodeNode' is used for the spacing between nodes within the layer itself."),20),tdg),e13),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eKr),eKH),"Direction Priority"),"Defines how important it is to have a certain edge point into the direction of the overall layout. This option is evaluated during the cycle breaking phase."),ell(0)),tdw),e16),el8(tdl)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eKi),eKH),"Shortness Priority"),"Defines how important it is to keep an edge as short as possible. This option is evaluated during the layering phase."),ell(0)),tdw),e16),el8(tdl)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eKa),eKH),"Straightness Priority"),"Defines how important it is to keep an edge straight, i.e. aligned with one of the two axes. This option is evaluated during node placement."),ell(0)),tdw),e16),el8(tdl)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eKo),eK$),ezI),"Tries to further compact components (disconnected sub-graphs)."),!1),tdm),e11),el8(tdh)))),K_(e,eKo,eGs,!0),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eKs),eKz),"Post Compaction Strategy"),eKG),tnz),tdv),e43),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eKu),eKz),"Post Compaction Constraint Calculation"),eKG),tnH),tdv),e4V),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eKc),eKW),"High Degree Node Treatment"),"Makes room around high degree nodes to place leafs and trees."),!1),tdm),e11),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eKl),eKW),"High Degree Node Threshold"),"Whether a node is considered to have a high degree."),ell(16)),tdw),e16),el8(tdh)))),K_(e,eKl,eKc,!0),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eKf),eKW),"High Degree Node Maximum Tree Height"),"Maximum height of a subtree connected to a high degree node to be moved to separate layers."),ell(5)),tdw),e16),el8(tdh)))),K_(e,eKf,eKc,!0),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eKd),eKK),"Graph Wrapping Strategy"),"For certain graphs and certain prescribed drawing areas it may be desirable to split the laid out graph into chunks that are placed side by side. The edges that connect different chunks are 'wrapped' around from the end of one chunk to the start of the other chunk. The points between the chunks are referred to as 'cuts'."),tiU),tdv),e6f),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eKh),eKK),"Additional Wrapped Edges Spacing"),"To visually separate edges that are wrapped from regularly routed edges an additional spacing value can be specified in form of this layout option. The spacing is added to the regular edgeNode spacing."),10),tdg),e13),el8(tdh)))),K_(e,eKh,eKd,tiw),K_(e,eKh,eKd,ti_),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eKp),eKK),"Correction Factor for Wrapping"),"At times and for certain types of graphs the executed wrapping may produce results that are consistently biased in the same fashion: either wrapping to often or to rarely. This factor can be used to correct the bias. Internally, it is simply multiplied with the 'aspect ratio' layout option."),1),tdg),e13),el8(tdh)))),K_(e,eKp,eKd,tiS),K_(e,eKp,eKd,tik),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eKb),eKV),"Cutting Strategy"),"The strategy by which the layer indexes are determined at which the layering crumbles into chunks."),tiC),tdv),e4Z),el8(tdh)))),K_(e,eKb,eKd,tiI),K_(e,eKb,eKd,tiD),efO(e,new eE9(yt(ye(yn(v4(v7(v5(v8(new oN,eKm),eKV),"Manually Specified Cuts"),"Allows the user to specify her own cuts for a certain graph."),td_),e1H),el8(tdh)))),K_(e,eKm,eKb,tiT),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eKg),"wrapping.cutting.msd"),"MSD Freedom"),"The MSD cutting strategy starts with an initial guess on the number of chunks the graph should be split into. The freedom specifies how much the strategy may deviate from this guess. E.g. if an initial number of 3 is computed, a freedom of 1 allows 2, 3, and 4 cuts."),tiO),tdw),e16),el8(tdh)))),K_(e,eKg,eKb,tiA),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eKv),eKq),"Validification Strategy"),"When wrapping graphs, one can specify indices that are not allowed as split points. The validification strategy makes sure every computed split point is allowed."),tiW),tdv),e6l),el8(tdh)))),K_(e,eKv,eKd,tiK),K_(e,eKv,eKd,tiV),efO(e,new eE9(yt(ye(yn(v4(v7(v5(v8(new oN,eKy),eKq),"Valid Indices for Wrapping"),null),td_),e1H),el8(tdh)))),K_(e,eKy,eKd,ti$),K_(e,eKy,eKd,tiz),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eKw),eKZ),"Improve Cuts"),"For general graphs it is important that not too many edges wrap backwards. Thus a compromise between evenly-distributed cuts and the total number of cut edges is sought."),!0),tdm),e11),el8(tdh)))),K_(e,eKw,eKd,tij),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eK_),eKZ),"Distance Penalty When Improving Cuts"),null),2),tdg),e13),el8(tdh)))),K_(e,eK_,eKd,tiP),K_(e,eK_,eKw,!0),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eKE),eKZ),"Improve Wrapped Edges"),"The initial wrapping is performed in a very simple way. As a consequence, edges that wrap from one chunk to another may be unnecessarily long. Activating this option tries to shorten such edges."),!0),tdm),e11),el8(tdh)))),K_(e,eKE,eKd,tiY),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eKS),eKX),"Edge Label Side Selection"),"Method to decide on edge label sides."),trp),tdv),e41),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eKk),eKX),"Edge Center Label Placement Strategy"),"Determines in which layer center labels of long edges should be placed."),trd),tdv),e4K),jL(tdh,eow(vx(e6Q,1),eU4,175,0,[tdf]))))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eKx),eKJ),"Consider Model Order"),"Preserves the order of nodes and edges in the model file if this does not lead to additional edge crossings. Depending on the strategy this is not always possible since the node and edge order might be conflicting."),tnQ),tdv),e6i),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eKT),eKJ),"No Model Order"),"Set on a node to not set a model order for this node even though it is a real node."),!1),tdm),e11),el8(tdd)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eKM),eKJ),"Consider Model Order for Components"),"If set to NONE the usual ordering strategy (by cumulative node priority and size of nodes) is used. INSIDE_PORT_SIDES orders the components with external ports only inside the groups with the same port side. FORCE_MODEL_ORDER enforces the mode order on components. This option might produce bad alignments and sub optimal drawings in terms of used area since the ordering should be respected."),tnW),tdv),e4L),el8(tdh)))),K_(e,eKM,eGs,null),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eKO),eKJ),"Long Edge Ordering Strategy"),"Indicates whether long edges are sorted under, over, or equal to nodes that have no connection to a previous layer in a left-to-right or right-to-left layout. Under and over changes to right and left in a vertical layout."),tnZ),tdv),e6e),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eKA),eKJ),"Crossing Counter Node Order Influence"),"Indicates with what percentage (1 for 100%) violations of the node model order are weighted against the crossings e.g. a value of 0.5 means two model order violations are as important as on edge crossing. This allows some edge crossings in favor of preserving the model order. It is advised to set this value to a very small positive value (e.g. 0.001) to have minimal crossing and a optimal node order. Defaults to no influence (0)."),0),tdg),e13),el8(tdh)))),K_(e,eKA,eKx,null),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eKL),eKJ),"Crossing Counter Port Order Influence"),"Indicates with what percentage (1 for 100%) violations of the port model order are weighted against the crossings e.g. a value of 0.5 means two model order violations are as important as on edge crossing. This allows some edge crossings in favor of preserving the model order. It is advised to set this value to a very small positive value (e.g. 0.001) to have minimal crossing and a optimal port order. Defaults to no influence (0)."),0),tdg),e13),el8(tdh)))),K_(e,eKL,eKx,null),eBq((new cA,e))},Y6(eWm,"LayeredMetaDataProvider",848),eTS(986,1,e$2,cA),eUe.Qe=function(e){eBq(e)},Y6(eWm,"LayeredOptions",986),eTS(987,1,{},iH),eUe.$e=function(){return new b3},eUe._e=function(e){},Y6(eWm,"LayeredOptions/LayeredFactory",987),eTS(1372,1,{}),eUe.a=0,Y6(eVL,"ElkSpacings/AbstractSpacingsBuilder",1372),eTS(779,1372,{},ef4),Y6(eWm,"LayeredSpacings/LayeredSpacingsBuilder",779),eTS(313,22,{3:1,35:1,22:1,313:1,246:1,234:1},SE),eUe.Kf=function(){return eM3(this)},eUe.Xf=function(){return eM3(this)};var e47=enw(eWm,"LayeringStrategy",313,e1G,J_,D6);eTS(378,22,{3:1,35:1,22:1,378:1},SS);var e6e=enw(eWm,"LongEdgeOrderingStrategy",378,e1G,G4,D5);eTS(197,22,{3:1,35:1,22:1,197:1},Sk);var e6t=enw(eWm,"NodeFlexibility",197,e1G,VT,D8);eTS(315,22,{3:1,35:1,22:1,315:1,246:1,234:1},Sx),eUe.Kf=function(){return eTG(this)},eUe.Xf=function(){return eTG(this)};var e6n=enw(eWm,"NodePlacementStrategy",315,e1G,Zg,Nr);eTS(260,22,{3:1,35:1,22:1,260:1},SM);var e6r=enw(eWm,"NodePromotionStrategy",260,e1G,etL,D7);eTS(339,22,{3:1,35:1,22:1,339:1},SO);var e6i=enw(eWm,"OrderingStrategy",339,e1G,Wn,Ne);eTS(421,22,{3:1,35:1,22:1,421:1},SA);var e6a=enw(eWm,"PortSortingStrategy",421,e1G,$K,Nt);eTS(452,22,{3:1,35:1,22:1,452:1},SL);var e6o=enw(eWm,"PortType",452,e1G,Wt,D9);eTS(375,22,{3:1,35:1,22:1,375:1},SC);var e6s=enw(eWm,"SelfLoopDistributionStrategy",375,e1G,Wr,Nn);eTS(376,22,{3:1,35:1,22:1,376:1},SI);var e6u=enw(eWm,"SelfLoopOrderingStrategy",376,e1G,$H,Ni);eTS(304,1,{304:1},ejm),Y6(eWm,"Spacings",304),eTS(336,22,{3:1,35:1,22:1,336:1},SD);var e6c=enw(eWm,"SplineRoutingMode",336,e1G,Wa,Na);eTS(338,22,{3:1,35:1,22:1,338:1},SN);var e6l=enw(eWm,"ValidifyStrategy",338,e1G,Wo,No);eTS(377,22,{3:1,35:1,22:1,377:1},SP);var e6f=enw(eWm,"WrappingStrategy",377,e1G,Wi,Ns);eTS(1383,1,eVD,cL),eUe.Yf=function(e){return Pp(e,37),ts2},eUe.pf=function(e,t){eRb(this,Pp(e,37),t)},Y6(eVN,"DepthFirstCycleBreaker",1383),eTS(782,1,eVD,jG),eUe.Yf=function(e){return Pp(e,37),ts3},eUe.pf=function(e,t){eBS(this,Pp(e,37),t)},eUe.Zf=function(e){return Pp(RJ(e,ebO(this.d,e.c.length)),10)},Y6(eVN,"GreedyCycleBreaker",782),eTS(1386,782,eVD,kQ),eUe.Zf=function(e){var t,n,r,i;for(i=null,t=eUu,r=new fz(e);r.a1&&(gN(LK(e_k(Bq((GK(0,e.c.length),Pp(e.c[0],10))),(eBy(),ti7))))?eMR(e,this.d,Pp(this,660)):(Hj(),Mv(e,this.d)),eaz(this.e,e))},eUe.Sf=function(e,t,n,r){var i,a,o,s,u,c,l;for(t!=ja(n,e.length)&&(a=e[t-(n?1:-1)],Xy(this.f,a,n?(enY(),tsN):(enY(),tsD))),i=e[t][0],l=!r||i.k==(eEn(),e9C),c=ZW(e[t]),this.ag(c,l,!1,n),o=0,u=new fz(c);u.a"),e0?zJ(this.a,e[t-1],e[t]):!n&&t1&&(gN(LK(e_k(Bq((GK(0,e.c.length),Pp(e.c[0],10))),(eBy(),ti7))))?eMR(e,this.d,this):(Hj(),Mv(e,this.d)),gN(LK(e_k(Bq((GK(0,e.c.length),Pp(e.c[0],10))),ti7)))||eaz(this.e,e))},Y6(eVF,"ModelOrderBarycenterHeuristic",660),eTS(1803,1,e$C,hx),eUe.ue=function(e,t){return eED(this.a,Pp(e,10),Pp(t,10))},eUe.Fb=function(e){return this===e},eUe.ve=function(){return new fZ(this)},Y6(eVF,"ModelOrderBarycenterHeuristic/lambda$0$Type",1803),eTS(1403,1,eVD,cF),eUe.Yf=function(e){var t;return Pp(e,37),t=TL(tus),RI(t,(e_x(),e9n),(eB$(),e7I)),t},eUe.pf=function(e,t){$w((Pp(e,37),t))},Y6(eVF,"NoCrossingMinimizer",1403),eTS(796,402,eVR,yu),eUe.$f=function(e,t,n){var r,i,a,o,s,u,c,l,f,d,h;switch(f=this.g,n.g){case 1:for(i=0,a=0,l=new fz(e.j);l.a1&&(i.j==(eYu(),tby)?this.b[e]=!0:i.j==tbY&&e>0&&(this.b[e-1]=!0))},eUe.f=0,Y6(eWc,"AllCrossingsCounter",1798),eTS(587,1,{},erH),eUe.b=0,eUe.d=0,Y6(eWc,"BinaryIndexedTree",587),eTS(524,1,{},IQ),Y6(eWc,"CrossingsCounter",524),eTS(1906,1,e$C,hT),eUe.ue=function(e,t){return je(this.a,Pp(e,11),Pp(t,11))},eUe.Fb=function(e){return this===e},eUe.ve=function(){return new fZ(this)},Y6(eWc,"CrossingsCounter/lambda$0$Type",1906),eTS(1907,1,e$C,hM),eUe.ue=function(e,t){return jt(this.a,Pp(e,11),Pp(t,11))},eUe.Fb=function(e){return this===e},eUe.ve=function(){return new fZ(this)},Y6(eWc,"CrossingsCounter/lambda$1$Type",1907),eTS(1908,1,e$C,hO),eUe.ue=function(e,t){return jn(this.a,Pp(e,11),Pp(t,11))},eUe.Fb=function(e){return this===e},eUe.ve=function(){return new fZ(this)},Y6(eWc,"CrossingsCounter/lambda$2$Type",1908),eTS(1909,1,e$C,hA),eUe.ue=function(e,t){return jr(this.a,Pp(e,11),Pp(t,11))},eUe.Fb=function(e){return this===e},eUe.ve=function(){return new fZ(this)},Y6(eWc,"CrossingsCounter/lambda$3$Type",1909),eTS(1910,1,eUF,hL),eUe.td=function(e){QT(this.a,Pp(e,11))},Y6(eWc,"CrossingsCounter/lambda$4$Type",1910),eTS(1911,1,eU9,hC),eUe.Mb=function(e){return kq(this.a,Pp(e,11))},Y6(eWc,"CrossingsCounter/lambda$5$Type",1911),eTS(1912,1,eUF,hI),eUe.td=function(e){kV(this,e)},Y6(eWc,"CrossingsCounter/lambda$6$Type",1912),eTS(1913,1,eUF,SF),eUe.td=function(e){var t;Pj(),Vw(this.b,(t=this.a,Pp(e,11),t))},Y6(eWc,"CrossingsCounter/lambda$7$Type",1913),eTS(826,1,e$q,iq),eUe.Lb=function(e){return Pj(),Ln(Pp(e,11),(eBU(),tng))},eUe.Fb=function(e){return this===e},eUe.Mb=function(e){return Pj(),Ln(Pp(e,11),(eBU(),tng))},Y6(eWc,"CrossingsCounter/lambda$8$Type",826),eTS(1905,1,{},hD),Y6(eWc,"HyperedgeCrossingsCounter",1905),eTS(467,1,{35:1,467:1},Cq),eUe.wd=function(e){return ehq(this,Pp(e,467))},eUe.b=0,eUe.c=0,eUe.e=0,eUe.f=0;var e6m=Y6(eWc,"HyperedgeCrossingsCounter/Hyperedge",467);eTS(362,1,{35:1,362:1},He),eUe.wd=function(e){return eMf(this,Pp(e,362))},eUe.b=0,eUe.c=0;var e6g=Y6(eWc,"HyperedgeCrossingsCounter/HyperedgeCorner",362);eTS(523,22,{3:1,35:1,22:1,523:1},Sj);var e6v=enw(eWc,"HyperedgeCrossingsCounter/HyperedgeCorner/Type",523,e1G,$V,Nc);eTS(1405,1,eVD,cO),eUe.Yf=function(e){return Pp(e_k(Pp(e,37),(eBU(),tt3)),21).Hc((eLR(),ttw))?tuh:null},eUe.pf=function(e,t){evK(this,Pp(e,37),t)},Y6(eVY,"InteractiveNodePlacer",1405),eTS(1406,1,eVD,cM),eUe.Yf=function(e){return Pp(e_k(Pp(e,37),(eBU(),tt3)),21).Hc((eLR(),ttw))?tup:null},eUe.pf=function(e,t){emS(this,Pp(e,37),t)},Y6(eVY,"LinearSegmentsNodePlacer",1406),eTS(257,1,{35:1,257:1},ma),eUe.wd=function(e){return vH(this,Pp(e,257))},eUe.Fb=function(e){var t;return!!M4(e,257)&&(t=Pp(e,257),this.b==t.b)},eUe.Hb=function(){return this.b},eUe.Ib=function(){return"ls"+e_F(this.e)},eUe.a=0,eUe.b=0,eUe.c=-1,eUe.d=-1,eUe.g=0;var e6y=Y6(eVY,"LinearSegmentsNodePlacer/LinearSegment",257);eTS(1408,1,eVD,jW),eUe.Yf=function(e){return Pp(e_k(Pp(e,37),(eBU(),tt3)),21).Hc((eLR(),ttw))?tug:null},eUe.pf=function(e,t){eBr(this,Pp(e,37),t)},eUe.b=0,eUe.g=0,Y6(eVY,"NetworkSimplexPlacer",1408),eTS(1427,1,e$C,iZ),eUe.ue=function(e,t){return ME(Pp(e,19).a,Pp(t,19).a)},eUe.Fb=function(e){return this===e},eUe.ve=function(){return new fZ(this)},Y6(eVY,"NetworkSimplexPlacer/0methodref$compare$Type",1427),eTS(1429,1,e$C,iX),eUe.ue=function(e,t){return ME(Pp(e,19).a,Pp(t,19).a)},eUe.Fb=function(e){return this===e},eUe.ve=function(){return new fZ(this)},Y6(eVY,"NetworkSimplexPlacer/1methodref$compare$Type",1429),eTS(649,1,{649:1},SY);var e6w=Y6(eVY,"NetworkSimplexPlacer/EdgeRep",649);eTS(401,1,{401:1},Ht),eUe.b=!1;var e6_=Y6(eVY,"NetworkSimplexPlacer/NodeRep",401);eTS(508,12,{3:1,4:1,20:1,28:1,52:1,12:1,14:1,15:1,54:1,508:1},mu),Y6(eVY,"NetworkSimplexPlacer/Path",508),eTS(1409,1,{},iJ),eUe.Kb=function(e){return Pp(e,17).d.i.k},Y6(eVY,"NetworkSimplexPlacer/Path/lambda$0$Type",1409),eTS(1410,1,eU9,iQ),eUe.Mb=function(e){return Pp(e,267)==(eEn(),e9D)},Y6(eVY,"NetworkSimplexPlacer/Path/lambda$1$Type",1410),eTS(1411,1,{},i1),eUe.Kb=function(e){return Pp(e,17).d.i},Y6(eVY,"NetworkSimplexPlacer/Path/lambda$2$Type",1411),eTS(1412,1,eU9,hN),eUe.Mb=function(e){return Ct(edH(Pp(e,10)))},Y6(eVY,"NetworkSimplexPlacer/Path/lambda$3$Type",1412),eTS(1413,1,eU9,i0),eUe.Mb=function(e){return RM(Pp(e,11))},Y6(eVY,"NetworkSimplexPlacer/lambda$0$Type",1413),eTS(1414,1,eUF,SB),eUe.td=function(e){MP(this.a,this.b,Pp(e,11))},Y6(eVY,"NetworkSimplexPlacer/lambda$1$Type",1414),eTS(1423,1,eUF,hP),eUe.td=function(e){ekS(this.a,Pp(e,17))},Y6(eVY,"NetworkSimplexPlacer/lambda$10$Type",1423),eTS(1424,1,{},i2),eUe.Kb=function(e){return GE(),new R1(null,new Gq(Pp(e,29).a,16))},Y6(eVY,"NetworkSimplexPlacer/lambda$11$Type",1424),eTS(1425,1,eUF,hR),eUe.td=function(e){eCe(this.a,Pp(e,10))},Y6(eVY,"NetworkSimplexPlacer/lambda$12$Type",1425),eTS(1426,1,{},i3),eUe.Kb=function(e){return GE(),ell(Pp(e,121).e)},Y6(eVY,"NetworkSimplexPlacer/lambda$13$Type",1426),eTS(1428,1,{},i4),eUe.Kb=function(e){return GE(),ell(Pp(e,121).e)},Y6(eVY,"NetworkSimplexPlacer/lambda$15$Type",1428),eTS(1430,1,eU9,i6),eUe.Mb=function(e){return GE(),Pp(e,401).c.k==(eEn(),e9N)},Y6(eVY,"NetworkSimplexPlacer/lambda$17$Type",1430),eTS(1431,1,eU9,i5),eUe.Mb=function(e){return GE(),Pp(e,401).c.j.c.length>1},Y6(eVY,"NetworkSimplexPlacer/lambda$18$Type",1431),eTS(1432,1,eUF,Hn),eUe.td=function(e){ef2(this.c,this.b,this.d,this.a,Pp(e,401))},eUe.c=0,eUe.d=0,Y6(eVY,"NetworkSimplexPlacer/lambda$19$Type",1432),eTS(1415,1,{},i8),eUe.Kb=function(e){return GE(),new R1(null,new Gq(Pp(e,29).a,16))},Y6(eVY,"NetworkSimplexPlacer/lambda$2$Type",1415),eTS(1433,1,eUF,hj),eUe.td=function(e){MD(this.a,Pp(e,11))},eUe.a=0,Y6(eVY,"NetworkSimplexPlacer/lambda$20$Type",1433),eTS(1434,1,{},i9),eUe.Kb=function(e){return GE(),new R1(null,new Gq(Pp(e,29).a,16))},Y6(eVY,"NetworkSimplexPlacer/lambda$21$Type",1434),eTS(1435,1,eUF,hF),eUe.td=function(e){Oi(this.a,Pp(e,10))},Y6(eVY,"NetworkSimplexPlacer/lambda$22$Type",1435),eTS(1436,1,eU9,i7),eUe.Mb=function(e){return Ct(e)},Y6(eVY,"NetworkSimplexPlacer/lambda$23$Type",1436),eTS(1437,1,{},ae),eUe.Kb=function(e){return GE(),new R1(null,new Gq(Pp(e,29).a,16))},Y6(eVY,"NetworkSimplexPlacer/lambda$24$Type",1437),eTS(1438,1,eU9,hY),eUe.Mb=function(e){return xH(this.a,Pp(e,10))},Y6(eVY,"NetworkSimplexPlacer/lambda$25$Type",1438),eTS(1439,1,eUF,SU),eUe.td=function(e){eSl(this.a,this.b,Pp(e,10))},Y6(eVY,"NetworkSimplexPlacer/lambda$26$Type",1439),eTS(1440,1,eU9,at),eUe.Mb=function(e){return GE(),!q9(Pp(e,17))},Y6(eVY,"NetworkSimplexPlacer/lambda$27$Type",1440),eTS(1441,1,eU9,an),eUe.Mb=function(e){return GE(),!q9(Pp(e,17))},Y6(eVY,"NetworkSimplexPlacer/lambda$28$Type",1441),eTS(1442,1,{},hB),eUe.Ce=function(e,t){return M9(this.a,Pp(e,29),Pp(t,29))},Y6(eVY,"NetworkSimplexPlacer/lambda$29$Type",1442),eTS(1416,1,{},ar),eUe.Kb=function(e){return GE(),new R1(null,new YI(new Fa(OH(efc(Pp(e,10)).a.Kc(),new c))))},Y6(eVY,"NetworkSimplexPlacer/lambda$3$Type",1416),eTS(1417,1,eU9,ai),eUe.Mb=function(e){return GE(),Km(Pp(e,17))},Y6(eVY,"NetworkSimplexPlacer/lambda$4$Type",1417),eTS(1418,1,eUF,hU),eUe.td=function(e){eNB(this.a,Pp(e,17))},Y6(eVY,"NetworkSimplexPlacer/lambda$5$Type",1418),eTS(1419,1,{},aa),eUe.Kb=function(e){return GE(),new R1(null,new Gq(Pp(e,29).a,16))},Y6(eVY,"NetworkSimplexPlacer/lambda$6$Type",1419),eTS(1420,1,eU9,ao),eUe.Mb=function(e){return GE(),Pp(e,10).k==(eEn(),e9N)},Y6(eVY,"NetworkSimplexPlacer/lambda$7$Type",1420),eTS(1421,1,{},as),eUe.Kb=function(e){return GE(),new R1(null,new YI(new Fa(OH(efs(Pp(e,10)).a.Kc(),new c))))},Y6(eVY,"NetworkSimplexPlacer/lambda$8$Type",1421),eTS(1422,1,eU9,au),eUe.Mb=function(e){return GE(),Rc(Pp(e,17))},Y6(eVY,"NetworkSimplexPlacer/lambda$9$Type",1422),eTS(1404,1,eVD,cz),eUe.Yf=function(e){return Pp(e_k(Pp(e,37),(eBU(),tt3)),21).Hc((eLR(),ttw))?tuv:null},eUe.pf=function(e,t){ePV(Pp(e,37),t)},Y6(eVY,"SimpleNodePlacer",1404),eTS(180,1,{180:1},eIW),eUe.Ib=function(){var e;return e="",this.c==(zs(),tuw)?e+=ezn:this.c==tuy&&(e+=ezt),this.o==(zQ(),tuE)?e+=ezh:this.o==tuS?e+="UP":e+="BALANCED",e},Y6(eVH,"BKAlignedLayout",180),eTS(516,22,{3:1,35:1,22:1,516:1},Sz);var e6E=enw(eVH,"BKAlignedLayout/HDirection",516,e1G,$Z,Nl);eTS(515,22,{3:1,35:1,22:1,515:1},S$);var e6S=enw(eVH,"BKAlignedLayout/VDirection",515,e1G,$X,Nf);eTS(1634,1,{},SH),Y6(eVH,"BKAligner",1634),eTS(1637,1,{},eg$),Y6(eVH,"BKCompactor",1637),eTS(654,1,{654:1},ac),eUe.a=0,Y6(eVH,"BKCompactor/ClassEdge",654),eTS(458,1,{458:1},mo),eUe.a=null,eUe.b=0,Y6(eVH,"BKCompactor/ClassNode",458),eTS(1407,1,eVD,kX),eUe.Yf=function(e){return Pp(e_k(Pp(e,37),(eBU(),tt3)),21).Hc((eLR(),ttw))?tux:null},eUe.pf=function(e,t){eBP(this,Pp(e,37),t)},eUe.d=!1,Y6(eVH,"BKNodePlacer",1407),eTS(1635,1,{},al),eUe.d=0,Y6(eVH,"NeighborhoodInformation",1635),eTS(1636,1,e$C,hH),eUe.ue=function(e,t){return etp(this,Pp(e,46),Pp(t,46))},eUe.Fb=function(e){return this===e},eUe.ve=function(){return new fZ(this)},Y6(eVH,"NeighborhoodInformation/NeighborComparator",1636),eTS(808,1,{}),Y6(eVH,"ThresholdStrategy",808),eTS(1763,808,{},mm),eUe.bg=function(e,t,n){return this.a.o==(zQ(),tuS)?eHQ:eH1},eUe.cg=function(){},Y6(eVH,"ThresholdStrategy/NullThresholdStrategy",1763),eTS(579,1,{579:1},SG),eUe.c=!1,eUe.d=!1,Y6(eVH,"ThresholdStrategy/Postprocessable",579),eTS(1764,808,{},mg),eUe.bg=function(e,t,n){var r,i,a;return(i=t==n,r=this.a.a[n.p]==t,i||r)?(a=e,this.a.c,zs(),i&&(a=ePX(this,t,!0)),isNaN(a)||isFinite(a)||!r||(a=ePX(this,n,!1)),a):e},eUe.cg=function(){for(var e,t,n,r,i;0!=this.d.b;){if((r=eDJ(this,i=Pp(zv(this.d),579))).a)e=r.a,((n=gN(this.a.f[this.a.g[i.b.p].p]))||q9(e)||e.c.i.c!=e.d.i.c)&&((t=eMd(this,i))||Th(this.e,i))}for(;0!=this.e.a.c.length;)eMd(this,Pp(euO(this.e),579))},Y6(eVH,"ThresholdStrategy/SimpleThresholdStrategy",1764),eTS(635,1,{635:1,246:1,234:1},af),eUe.Kf=function(){return eaM(this)},eUe.Xf=function(){return eaM(this)},Y6(eV$,"EdgeRouterFactory",635),eTS(1458,1,eVD,cG),eUe.Yf=function(e){return eLb(Pp(e,37))},eUe.pf=function(e,t){eP7(Pp(e,37),t)},Y6(eV$,"OrthogonalEdgeRouter",1458),eTS(1451,1,eVD,kJ),eUe.Yf=function(e){return ev4(Pp(e,37))},eUe.pf=function(e,t){eYg(this,Pp(e,37),t)},Y6(eV$,"PolylineEdgeRouter",1451),eTS(1452,1,e$q,ad),eUe.Lb=function(e){return eaQ(Pp(e,10))},eUe.Fb=function(e){return this===e},eUe.Mb=function(e){return eaQ(Pp(e,10))},Y6(eV$,"PolylineEdgeRouter/1",1452),eTS(1809,1,eU9,ah),eUe.Mb=function(e){return Pp(e,129).c==(Xa(),tuU)},Y6(eVz,"HyperEdgeCycleDetector/lambda$0$Type",1809),eTS(1810,1,{},ap),eUe.Ge=function(e){return Pp(e,129).d},Y6(eVz,"HyperEdgeCycleDetector/lambda$1$Type",1810),eTS(1811,1,eU9,ab),eUe.Mb=function(e){return Pp(e,129).c==(Xa(),tuU)},Y6(eVz,"HyperEdgeCycleDetector/lambda$2$Type",1811),eTS(1812,1,{},am),eUe.Ge=function(e){return Pp(e,129).d},Y6(eVz,"HyperEdgeCycleDetector/lambda$3$Type",1812),eTS(1813,1,{},ag),eUe.Ge=function(e){return Pp(e,129).d},Y6(eVz,"HyperEdgeCycleDetector/lambda$4$Type",1813),eTS(1814,1,{},av),eUe.Ge=function(e){return Pp(e,129).d},Y6(eVz,"HyperEdgeCycleDetector/lambda$5$Type",1814),eTS(112,1,{35:1,112:1},ea$),eUe.wd=function(e){return v$(this,Pp(e,112))},eUe.Fb=function(e){var t;return!!M4(e,112)&&(t=Pp(e,112),this.g==t.g)},eUe.Hb=function(){return this.g},eUe.Ib=function(){var e,t,n,r;for(e=new O0("{"),r=new fz(this.n);r.a"+this.b+" ("+AK(this.c)+")"},eUe.d=0,Y6(eVz,"HyperEdgeSegmentDependency",129),eTS(520,22,{3:1,35:1,22:1,520:1},SW);var e6k=enw(eVz,"HyperEdgeSegmentDependency/DependencyType",520,e1G,$q,Nd);eTS(1815,1,{},h$),Y6(eVz,"HyperEdgeSegmentSplitter",1815),eTS(1816,1,{},ym),eUe.a=0,eUe.b=0,Y6(eVz,"HyperEdgeSegmentSplitter/AreaRating",1816),eTS(329,1,{329:1},N4),eUe.a=0,eUe.b=0,eUe.c=0,Y6(eVz,"HyperEdgeSegmentSplitter/FreeArea",329),eTS(1817,1,e$C,aT),eUe.ue=function(e,t){return ID(Pp(e,112),Pp(t,112))},eUe.Fb=function(e){return this===e},eUe.ve=function(){return new fZ(this)},Y6(eVz,"HyperEdgeSegmentSplitter/lambda$0$Type",1817),eTS(1818,1,eUF,Hi),eUe.td=function(e){V6(this.a,this.d,this.c,this.b,Pp(e,112))},eUe.b=0,Y6(eVz,"HyperEdgeSegmentSplitter/lambda$1$Type",1818),eTS(1819,1,{},aM),eUe.Kb=function(e){return new R1(null,new Gq(Pp(e,112).e,16))},Y6(eVz,"HyperEdgeSegmentSplitter/lambda$2$Type",1819),eTS(1820,1,{},aO),eUe.Kb=function(e){return new R1(null,new Gq(Pp(e,112).j,16))},Y6(eVz,"HyperEdgeSegmentSplitter/lambda$3$Type",1820),eTS(1821,1,{},aA),eUe.Fe=function(e){return gP(LV(e))},Y6(eVz,"HyperEdgeSegmentSplitter/lambda$4$Type",1821),eTS(655,1,{},YJ),eUe.a=0,eUe.b=0,eUe.c=0,Y6(eVz,"OrthogonalRoutingGenerator",655),eTS(1638,1,{},aL),eUe.Kb=function(e){return new R1(null,new Gq(Pp(e,112).e,16))},Y6(eVz,"OrthogonalRoutingGenerator/lambda$0$Type",1638),eTS(1639,1,{},aC),eUe.Kb=function(e){return new R1(null,new Gq(Pp(e,112).j,16))},Y6(eVz,"OrthogonalRoutingGenerator/lambda$1$Type",1639),eTS(661,1,{}),Y6(eVG,"BaseRoutingDirectionStrategy",661),eTS(1807,661,{},mv),eUe.dg=function(e,t,n){var r,i,a,o,s,u,c,l,f,d,h,p,b;if(!e.r||e.q)for(l=t+e.o*n,c=new fz(e.n);c.aez9&&(a=l,i=e,r=new kl(f,a),P7(o.a,r),eDD(this,o,i,r,!1),(d=e.r)&&(h=gP(LV(ep3(d.e,0))),r=new kl(h,a),P7(o.a,r),eDD(this,o,i,r,!1),a=t+d.o*n,i=d,r=new kl(h,a),P7(o.a,r),eDD(this,o,i,r,!1)),r=new kl(b,a),P7(o.a,r),eDD(this,o,i,r,!1)))},eUe.eg=function(e){return e.i.n.a+e.n.a+e.a.a},eUe.fg=function(){return eYu(),tbj},eUe.gg=function(){return eYu(),tbw},Y6(eVG,"NorthToSouthRoutingStrategy",1807),eTS(1808,661,{},my),eUe.dg=function(e,t,n){var r,i,a,o,s,u,c,l,f,d,h,p,b;if(!e.r||e.q)for(l=t-e.o*n,c=new fz(e.n);c.aez9&&(a=l,i=e,r=new kl(f,a),P7(o.a,r),eDD(this,o,i,r,!1),(d=e.r)&&(h=gP(LV(ep3(d.e,0))),r=new kl(h,a),P7(o.a,r),eDD(this,o,i,r,!1),a=t-d.o*n,i=d,r=new kl(h,a),P7(o.a,r),eDD(this,o,i,r,!1)),r=new kl(b,a),P7(o.a,r),eDD(this,o,i,r,!1)))},eUe.eg=function(e){return e.i.n.a+e.n.a+e.a.a},eUe.fg=function(){return eYu(),tbw},eUe.gg=function(){return eYu(),tbj},Y6(eVG,"SouthToNorthRoutingStrategy",1808),eTS(1806,661,{},mw),eUe.dg=function(e,t,n){var r,i,a,o,s,u,c,l,f,d,h,p,b;if(!e.r||e.q)for(l=t+e.o*n,c=new fz(e.n);c.aez9&&(a=l,i=e,r=new kl(a,f),P7(o.a,r),eDD(this,o,i,r,!0),(d=e.r)&&(h=gP(LV(ep3(d.e,0))),r=new kl(a,h),P7(o.a,r),eDD(this,o,i,r,!0),a=t+d.o*n,i=d,r=new kl(a,h),P7(o.a,r),eDD(this,o,i,r,!0)),r=new kl(a,b),P7(o.a,r),eDD(this,o,i,r,!0)))},eUe.eg=function(e){return e.i.n.b+e.n.b+e.a.b},eUe.fg=function(){return eYu(),tby},eUe.gg=function(){return eYu(),tbY},Y6(eVG,"WestToEastRoutingStrategy",1806),eTS(813,1,{},eNG),eUe.Ib=function(){return e_F(this.a)},eUe.b=0,eUe.c=!1,eUe.d=!1,eUe.f=0,Y6(eVK,"NubSpline",813),eTS(407,1,{407:1},eA2,za),Y6(eVK,"NubSpline/PolarCP",407),eTS(1453,1,eVD,egt),eUe.Yf=function(e){return ewy(Pp(e,37))},eUe.pf=function(e,t){eYW(this,Pp(e,37),t)},Y6(eVK,"SplineEdgeRouter",1453),eTS(268,1,{268:1},Xt),eUe.Ib=function(){return this.a+" ->("+this.c+") "+this.b},eUe.c=0,Y6(eVK,"SplineEdgeRouter/Dependency",268),eTS(455,22,{3:1,35:1,22:1,455:1},SK);var e6x=enw(eVK,"SplineEdgeRouter/SideToProcess",455,e1G,$J,Nh);eTS(1454,1,eU9,ak),eUe.Mb=function(e){return eAq(),!Pp(e,128).o},Y6(eVK,"SplineEdgeRouter/lambda$0$Type",1454),eTS(1455,1,{},aS),eUe.Ge=function(e){return eAq(),Pp(e,128).v+1},Y6(eVK,"SplineEdgeRouter/lambda$1$Type",1455),eTS(1456,1,eUF,SV),eUe.td=function(e){Rw(this.a,this.b,Pp(e,46))},Y6(eVK,"SplineEdgeRouter/lambda$2$Type",1456),eTS(1457,1,eUF,Sq),eUe.td=function(e){R_(this.a,this.b,Pp(e,46))},Y6(eVK,"SplineEdgeRouter/lambda$3$Type",1457),eTS(128,1,{35:1,128:1},eSB,eRM),eUe.wd=function(e){return vz(this,Pp(e,128))},eUe.b=0,eUe.e=!1,eUe.f=0,eUe.g=0,eUe.j=!1,eUe.k=!1,eUe.n=0,eUe.o=!1,eUe.p=!1,eUe.q=!1,eUe.s=0,eUe.u=0,eUe.v=0,eUe.F=0,Y6(eVK,"SplineSegment",128),eTS(459,1,{459:1},ax),eUe.a=0,eUe.b=!1,eUe.c=!1,eUe.d=!1,eUe.e=!1,eUe.f=0,Y6(eVK,"SplineSegment/EdgeInformation",459),eTS(1234,1,{},ay),Y6(eVJ,ezQ,1234),eTS(1235,1,e$C,aw),eUe.ue=function(e,t){return ek4(Pp(e,135),Pp(t,135))},eUe.Fb=function(e){return this===e},eUe.ve=function(){return new fZ(this)},Y6(eVJ,ez1,1235),eTS(1233,1,{},y2),Y6(eVJ,"MrTree",1233),eTS(393,22,{3:1,35:1,22:1,393:1,246:1,234:1},SZ),eUe.Kf=function(){return ek5(this)},eUe.Xf=function(){return ek5(this)};var e6T=enw(eVJ,"TreeLayoutPhases",393,e1G,VM,Np);eTS(1130,209,ezL,CJ),eUe.Ze=function(e,t){var n,r,i,a,o,s,u;for(gN(LK(eT9(e,(eTj(),tcA))))||zh(n=new df((_q(),new gM(e)))),o=(eaW(s=new Xn,e),eo3(s,(eR5(),tcl),e),u=new p2,eDf(e,s,u),eDU(e,s,u),s),a=eDO(this.a,o),i=new fz(a);i.a"+WU(this.c):"e_"+esj(this)},Y6(eVQ,"TEdge",188),eTS(135,134,{3:1,135:1,94:1,134:1},Xn),eUe.Ib=function(){var e,t,n,r,i;for(i=null,r=epL(this.b,0);r.b!=r.d.c;)i+=(null==(n=Pp(Vv(r),86)).c||0==n.c.length?"n_"+n.g:"n_"+n.c)+"\n";for(t=epL(this.a,0);t.b!=t.d.c;)i+=((e=Pp(Vv(t),188)).b&&e.c?WU(e.b)+"->"+WU(e.c):"e_"+esj(e))+"\n";return i};var e6M=Y6(eVQ,"TGraph",135);eTS(633,502,{3:1,502:1,633:1,94:1,134:1}),Y6(eVQ,"TShape",633),eTS(86,633,{3:1,502:1,86:1,633:1,94:1,134:1},esH),eUe.Ib=function(){return WU(this)};var e6O=Y6(eVQ,"TNode",86);eTS(255,1,eU$,hz),eUe.Jc=function(e){qX(this,e)},eUe.Kc=function(){var e;return e=epL(this.a.d,0),new hG(e)},Y6(eVQ,"TNode/2",255),eTS(358,1,eUE,hG),eUe.Nb=function(e){F9(this,e)},eUe.Pb=function(){return Pp(Vv(this.a),188).c},eUe.Ob=function(){return yV(this.a)},eUe.Qb=function(){etu(this.a)},Y6(eVQ,"TNode/2/1",358),eTS(1840,1,eGB,CX),eUe.pf=function(e,t){eNv(this,Pp(e,135),t)},Y6(eV1,"FanProcessor",1840),eTS(327,22,{3:1,35:1,22:1,327:1,234:1},SX),eUe.Kf=function(){switch(this.g){case 0:return new mX;case 1:return new CX;case 2:return new aN;case 3:return new aI;case 4:return new aR;case 5:return new aj;default:throw p7(new gL(eWt+(null!=this.f?this.f:""+this.g)))}};var e6A=enw(eV1,eWn,327,e1G,JS,Nb);eTS(1843,1,eGB,aI),eUe.pf=function(e,t){eMo(this,Pp(e,135),t)},eUe.a=0,Y6(eV1,"LevelHeightProcessor",1843),eTS(1844,1,eU$,aD),eUe.Jc=function(e){qX(this,e)},eUe.Kc=function(){return Hj(),wV(),e2o},Y6(eV1,"LevelHeightProcessor/1",1844),eTS(1841,1,eGB,aN),eUe.pf=function(e,t){eSP(this,Pp(e,135),t)},eUe.a=0,Y6(eV1,"NeighborsProcessor",1841),eTS(1842,1,eU$,aP),eUe.Jc=function(e){qX(this,e)},eUe.Kc=function(){return Hj(),wV(),e2o},Y6(eV1,"NeighborsProcessor/1",1842),eTS(1845,1,eGB,aR),eUe.pf=function(e,t){eMa(this,Pp(e,135),t)},eUe.a=0,Y6(eV1,"NodePositionProcessor",1845),eTS(1839,1,eGB,mX),eUe.pf=function(e,t){eRm(this,Pp(e,135))},Y6(eV1,"RootProcessor",1839),eTS(1846,1,eGB,aj),eUe.pf=function(e,t){elE(Pp(e,135))},Y6(eV1,"Untreeifyer",1846),eTS(851,1,e$2,c$),eUe.Qe=function(e){efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eV3),""),"Weighting of Nodes"),"Which weighting to use when computing a node order."),tcE),(eSd(),tdv)),e6L),el8((epx(),tdh))))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eV4),""),"Search Order"),"Which search order to use when computing a spanning tree."),tcw),tdv),e6C),el8(tdh)))),ejG((new cH,e))},Y6(eV6,"MrTreeMetaDataProvider",851),eTS(994,1,e$2,cH),eUe.Qe=function(e){ejG(e)},Y6(eV6,"MrTreeOptions",994),eTS(995,1,{},aF),eUe.$e=function(){return new CJ},eUe._e=function(e){},Y6(eV6,"MrTreeOptions/MrtreeFactory",995),eTS(480,22,{3:1,35:1,22:1,480:1},SJ);var e6L=enw(eV6,"OrderWeighting",480,e1G,$1,Nm);eTS(425,22,{3:1,35:1,22:1,425:1},SQ);var e6C=enw(eV6,"TreeifyingOrder",425,e1G,$Q,Nv);eTS(1459,1,eVD,cD),eUe.Yf=function(e){return Pp(e,135),tcz},eUe.pf=function(e,t){eiD(this,Pp(e,135),t)},Y6("org.eclipse.elk.alg.mrtree.p1treeify","DFSTreeifyer",1459),eTS(1460,1,eVD,cN),eUe.Yf=function(e){return Pp(e,135),tcG},eUe.pf=function(e,t){eSZ(this,Pp(e,135),t)},Y6("org.eclipse.elk.alg.mrtree.p2order","NodeOrderer",1460),eTS(1461,1,eVD,cI),eUe.Yf=function(e){return Pp(e,135),tcW},eUe.pf=function(e,t){eCh(this,Pp(e,135),t)},eUe.a=0,Y6("org.eclipse.elk.alg.mrtree.p3place","NodePlacer",1461),eTS(1462,1,eVD,cP),eUe.Yf=function(e){return Pp(e,135),tcK},eUe.pf=function(e,t){evm(Pp(e,135),t)},Y6("org.eclipse.elk.alg.mrtree.p4route","EdgeRouter",1462),eTS(495,22,{3:1,35:1,22:1,495:1,246:1,234:1},S1),eUe.Kf=function(){return ede(this)},eUe.Xf=function(){return ede(this)};var e6I=enw(eV9,"RadialLayoutPhases",495,e1G,$0,Ng);eTS(1131,209,ezL,y0),eUe.Ze=function(e,t){var n,r,i,a,o,s;if(n=eS9(this,e),ewG(t,"Radial layout",n.c.length),gN(LK(eT9(e,(egj(),tlm))))||zh(r=new df((_q(),new gM(e)))),s=ewE(e),ebu(e,(Lj(),tcV),s),!s)throw p7(new gL("The given graph is not a tree!"));for(0==(i=gP(LV(eT9(e,tl_))))&&(i=ekB(e)),ebu(e,tl_,i),o=new fz(eS9(this,e));o.a0&&eu9((GV(t-1,e.length),e.charCodeAt(t-1)),eGq);)--t;if(r>=t)throw p7(new gL("The given string does not contain any numbers."));if(2!=(i=eIk(e.substr(r,t-r),",|;|\r|\n")).length)throw p7(new gL("Exactly two numbers are expected, "+i.length+" were found."));try{this.a=eEu(e_H(i[0])),this.b=eEu(e_H(i[1]))}catch(a){if(a=eoa(a),M4(a,127))throw n=a,p7(new gL(eGZ+n));throw p7(a)}},eUe.Ib=function(){return"("+this.a+","+this.b+")"},eUe.a=0,eUe.b=0;var e60=Y6(eGX,"KVector",8);eTS(74,68,{3:1,4:1,20:1,28:1,52:1,14:1,68:1,15:1,74:1,414:1},mE,yc,Lb),eUe.Pc=function(){return euE(this)},eUe.Jf=function(e){var t,n,r,i,a,o;r=eIk(e,",|;|\\(|\\)|\\[|\\]|\\{|\\}| | |\n"),HC(this);try{for(n=0,a=0,i=0,o=0;n0&&(a%2==0?i=eEu(r[n]):o=eEu(r[n]),a>0&&a%2!=0&&P7(this,new kl(i,o)),++a),++n}catch(s){if(s=eoa(s),M4(s,127))throw t=s,p7(new gL("The given string does not match the expected format for vectors."+t));throw p7(s)}},eUe.Ib=function(){var e,t,n;for(e=new O0("("),t=epL(this,0);t.b!=t.d.c;)xM(e,(n=Pp(Vv(t),8)).a+","+n.b),t.b!=t.d.c&&(e.a+="; ");return(e.a+=")",e).a};var e62=Y6(eGX,"KVectorChain",74);eTS(248,22,{3:1,35:1,22:1,248:1},kf);var e63=enw(eZe,"Alignment",248,e1G,Jg,NP);eTS(979,1,e$2,cq),eUe.Qe=function(e){eDj(e)},Y6(eZe,"BoxLayouterOptions",979),eTS(980,1,{},oA),eUe.$e=function(){return new oF},eUe._e=function(e){},Y6(eZe,"BoxLayouterOptions/BoxFactory",980),eTS(291,22,{3:1,35:1,22:1,291:1},kd);var e64=enw(eZe,"ContentAlignment",291,e1G,Jm,NR);eTS(684,1,e$2,cZ),eUe.Qe=function(e){efO(e,new eE9(yt(ye(yn(v4(v7(v5(v8(new oN,eZi),""),"Layout Algorithm"),"Select a specific layout algorithm."),(eSd(),tdE)),e17),el8((epx(),tdh))))),efO(e,new eE9(yt(ye(yn(v4(v7(v5(v8(new oN,eZa),""),"Resolved Layout Algorithm"),"Meta data associated with the selected algorithm."),td_),e6X),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eVi),""),"Alignment"),"Alignment of the selected node relative to other nodes; the exact meaning depends on the used algorithm."),td0),tdv),e63),el8(tdd)))),efO(e,new eE9(yt(ye(yn(v4(v7(v5(v8(new oN,ezG),""),"Aspect Ratio"),"The desired aspect ratio of the drawing, that is the quotient of width by height."),tdg),e13),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v4(v7(v5(v8(new oN,eZo),""),"Bend Points"),"A fixed list of bend points for the edge. This is used by the 'Fixed Layout' algorithm to specify a pre-defined routing for an edge. The vector chain must include the source point, any bend points, and the target point, so it must have at least two points."),td_),e62),el8(tdl)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eVg),""),"Content Alignment"),"Specifies how the content of a node are aligned. Each node can individually control the alignment of its contents. I.e. if a node should be aligned top left in its parent node, the parent node should specify that option."),td9),tdy),e64),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eVr),""),"Debug Mode"),"Whether additional debug information shall be generated."),(OQ(),!1)),tdm),e11),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eVu),""),ezw),"Overall direction of edges: horizontal (right / left) or vertical (down / up)."),tht),tdv),e66),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eKB),""),"Edge Routing"),"What kind of edge routing style should be applied for the content of a parent node. Algorithms may also set this option to single edges in order to mark them as splines. The bend point list of edges with this option set to SPLINES must be interpreted as control points for a piecewise cubic spline."),tho),tdv),e68),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eqC),""),"Expand Nodes"),"If active, nodes are expanded to fill the area of their parent."),!1),tdm),e11),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eKP),""),"Hierarchy Handling"),"Determines whether separate layout runs are triggered for different compound nodes in a hierarchical graph. Setting a node's hierarchy handling to `INCLUDE_CHILDREN` will lay out that node and all of its descendants in a single layout run, until a descendant is encountered which has its hierarchy handling set to `SEPARATE_CHILDREN`. In general, `SEPARATE_CHILDREN` will ensure that a new layout run is triggered for a node with that setting. Including multiple levels of hierarchy in a single layout run may allow cross-hierarchical edges to be laid out properly. If the root node is set to `INHERIT` (or not set at all), the default behavior is `SEPARATE_CHILDREN`."),thf),tdv),e67),jL(tdh,eow(vx(e6Q,1),eU4,175,0,[tdd]))))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,ezW),""),"Padding"),"The padding to be left to a parent element's border when placing child elements. This can also serve as an output option of a layout algorithm if node size calculation is setup appropriately."),thP),td_),e4R),jL(tdh,eow(vx(e6Q,1),eU4,175,0,[tdd]))))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eGu),""),"Interactive"),"Whether the algorithm should be run in interactive mode for the content of a parent node. What this means exactly depends on how the specific algorithm interprets this option. Usually in the interactive mode algorithms try to modify the current layout as little as possible."),!1),tdm),e11),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eVA),""),"interactive Layout"),"Whether the graph should be changeable interactively and by setting constraints"),!1),tdm),e11),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eGf),""),"Omit Node Micro Layout"),"Node micro layout comprises the computation of node dimensions (if requested), the placement of ports and their labels, and the placement of node labels. The functionality is implemented independent of any specific layout algorithm and shouldn't have any negative impact on the layout algorithm's performance itself. Yet, if any unforeseen behavior occurs, this option allows to deactivate the micro layout."),!1),tdm),e11),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eGc),""),"Port Constraints"),"Defines constraints of the position of the ports of a node."),thq),tdv),e5r),el8(tdd)))),efO(e,new eE9(yt(ye(yn(v4(v7(v5(v8(new oN,eVT),""),"Position"),"The position of a node, port, or label. This is used by the 'Fixed Layout' algorithm to specify a pre-defined position."),td_),e60),jL(tdd,eow(vx(e6Q,1),eU4,175,0,[tdp,tdf]))))),efO(e,new eE9(yt(ye(yn(v4(v7(v5(v8(new oN,eGr),""),"Priority"),"Defines the priority of an object; its meaning depends on the specific layout algorithm and the context where it is used."),tdw),e16),jL(tdd,eow(vx(e6Q,1),eU4,175,0,[tdl]))))),efO(e,new eE9(yt(ye(yn(v4(v7(v5(v8(new oN,eGo),""),"Randomization Seed"),"Seed used for pseudo-random number generators to control the layout algorithm. If the value is 0, the seed shall be determined pseudo-randomly (e.g. from the system time)."),tdw),e16),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v4(v7(v5(v8(new oN,eGs),""),"Separate Connected Components"),"Whether each connected component should be processed separately."),tdm),e11),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eVv),""),"Junction Points"),"This option is not used as option, but as output of the layout algorithms. It is attached to edges and determines the points where junction symbols should be drawn in order to represent hyperedges with orthogonal routing. Whether such points are computed depends on the chosen layout algorithm and edge routing style. The points are put into the vector chain with no specific order."),thv),td_),e62),el8(tdl)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eV_),""),"Comment Box"),"Whether the node should be regarded as a comment box instead of a regular node. In that case its placement should be similar to how labels are handled. Any edges incident to a comment box specify to which graph elements the comment is related."),!1),tdm),e11),el8(tdd)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eVE),""),"Hypernode"),"Whether the node should be handled as a hypernode."),!1),tdm),e11),el8(tdd)))),efO(e,new eE9(yt(ye(yn(v4(v7(v5(v8(new oN,eZs),""),"Label Manager"),"Label managers can shorten labels upon a layout algorithm's request."),td_),tyO),jL(tdh,eow(vx(e6Q,1),eU4,175,0,[tdf]))))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eVM),""),"Margins"),"Margins define additional space around the actual bounds of a graph element. For instance, ports or labels being placed on the outside of a node's border might introduce such a margin. The margin is used to guarantee non-overlap of other graph elements with those ports or labels."),thw),td_),e4D),el8(tdd)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eVt),""),"No Layout"),"No layout is done for the associated element. This is used to mark parts of a diagram to avoid their inclusion in the layout graph, or to mark parts of the layout graph to prevent layout engines from processing them. If you wish to exclude the contents of a compound node from automatic layout, while the node itself is still considered on its own layer, use the 'Fixed Layout' algorithm for that node."),!1),tdm),e11),jL(tdd,eow(vx(e6Q,1),eU4,175,0,[tdl,tdp,tdf]))))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eZu),""),"Scale Factor"),"The scaling factor to be applied to the corresponding node in recursive layout. It causes the corresponding node's size to be adjusted, and its ports and labels to be sized and placed accordingly after the layout of that node has been determined (and before the node itself and its siblings are arranged). The scaling is not reverted afterwards, so the resulting layout graph contains the adjusted size and position data. This option is currently not supported if 'Layout Hierarchy' is set."),1),tdg),e13),el8(tdd)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eZc),""),"Animate"),"Whether the shift from the old layout to the new computed layout shall be animated."),!0),tdm),e11),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eZl),""),"Animation Time Factor"),"Factor for computation of animation time. The higher the value, the longer the animation time. If the value is 0, the resulting time is always equal to the minimum defined by 'Minimal Animation Time'."),ell(100)),tdw),e16),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eZf),""),"Layout Ancestors"),"Whether the hierarchy levels on the path from the selected element to the root of the diagram shall be included in the layout process."),!1),tdm),e11),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eZd),""),"Maximal Animation Time"),"The maximal time for animations, in milliseconds."),ell(4e3)),tdw),e16),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eZh),""),"Minimal Animation Time"),"The minimal time for animations, in milliseconds."),ell(400)),tdw),e16),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eZp),""),"Progress Bar"),"Whether a progress bar shall be displayed during layout computations."),!1),tdm),e11),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eZb),""),"Validate Graph"),"Whether the graph shall be validated before any layout algorithm is applied. If this option is enabled and at least one error is found, the layout process is aborted and a message is shown to the user."),!1),tdm),e11),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eZm),""),"Validate Options"),"Whether layout options shall be validated before any layout algorithm is applied. If this option is enabled and at least one error is found, the layout process is aborted and a message is shown to the user."),!0),tdm),e11),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eZg),""),"Zoom to Fit"),"Whether the zoom level shall be set to view the whole diagram after layout."),!1),tdm),e11),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eZr),"box"),"Box Layout Mode"),"Configures the packing mode used by the {@link BoxLayoutProvider}. If SIMPLE is not required (neither priorities are used nor the interactive mode), GROUP_DEC can improve the packing and decrease the area. GROUP_MIXED and GROUP_INC may, in very specific scenarios, work better."),td6),tdv),e5u),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eKQ),eKU),"Comment Comment Spacing"),"Spacing to be preserved between a comment box and other comment boxes connected to the same node. The space left between comment boxes of different nodes is controlled by the node-node spacing."),10),tdg),e13),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eK1),eKU),"Comment Node Spacing"),"Spacing to be preserved between a node and its connected comment boxes. The space left between a node and the comments of another node is controlled by the node-node spacing."),10),tdg),e13),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,ez$),eKU),"Components Spacing"),"Spacing to be preserved between pairs of connected components. This option is only relevant if 'separateConnectedComponents' is activated."),20),tdg),e13),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eK0),eKU),"Edge Spacing"),"Spacing to be preserved between any two edges. Note that while this can somewhat easily be satisfied for the segments of orthogonally drawn edges, it is harder for general polylines or splines."),10),tdg),e13),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eGa),eKU),"Edge Label Spacing"),"The minimal distance to be preserved between a label and the edge it is associated with. Note that the placement of a label is influenced by the 'edgelabels.placement' option."),2),tdg),e13),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eK2),eKU),"Edge Node Spacing"),"Spacing to be preserved between nodes and edges."),10),tdg),e13),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eK3),eKU),"Label Spacing"),"Determines the amount of space to be left between two labels of the same graph element."),0),tdg),e13),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eK5),eKU),"Label Node Spacing"),"Spacing to be preserved between labels and the border of node they are associated with. Note that the placement of a label is influenced by the 'nodelabels.placement' option."),5),tdg),e13),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eK4),eKU),"Horizontal spacing between Label and Port"),"Horizontal spacing to be preserved between labels and the ports they are associated with. Note that the placement of a label is influenced by the 'portlabels.placement' option."),1),tdg),e13),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eK6),eKU),"Vertical spacing between Label and Port"),"Vertical spacing to be preserved between labels and the ports they are associated with. Note that the placement of a label is influenced by the 'portlabels.placement' option."),1),tdg),e13),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eGi),eKU),"Node Spacing"),"The minimal distance to be preserved between each two nodes."),20),tdg),e13),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eK8),eKU),"Node Self Loop Spacing"),"Spacing to be preserved between a node and its self loops."),10),tdg),e13),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eK9),eKU),"Port Spacing"),"Spacing between pairs of ports of the same node."),10),tdg),e13),jL(tdh,eow(vx(e6Q,1),eU4,175,0,[tdd]))))),efO(e,new eE9(yt(ye(yn(v4(v7(v5(v8(new oN,eK7),eKU),"Individual Spacing"),"Allows to specify individual spacing values for graph elements that shall be different from the value specified for the element's parent."),td_),e5c),jL(tdd,eow(vx(e6Q,1),eU4,175,0,[tdl,tdp,tdf]))))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eVO),eKU),"Additional Port Space"),"Additional space around the sets of ports on each node side. For each side of a node, this option can reserve additional space before and after the ports on each side. For example, a top spacing of 20 makes sure that the first port on the western and eastern side is 20 units away from the northern border."),tph),td_),e4D),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v4(v7(v5(v8(new oN,eVx),eZ_),"Layout Partition"),"Partition to which the node belongs. This requires Layout Partitioning to be active. Nodes with lower partition IDs will appear to the left of nodes with higher partition IDs (assuming a left-to-right layout direction)."),tdw),e16),jL(tdh,eow(vx(e6Q,1),eU4,175,0,[tdd]))))),K_(e,eVx,eVk,thY),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eVk),eZ_),"Layout Partitioning"),"Whether to activate partitioned layout. This will allow to group nodes through the Layout Partition option. a pair of nodes with different partition indices is then placed such that the node with lower index is placed to the left of the other node (with left-to-right layout direction). Depending on the layout algorithm, this may only be guaranteed to work if all nodes have a layout partition configured, or at least if edges that cross partitions are not part of a partition-crossing cycle."),thj),tdm),e11),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eVc),eZE),"Node Label Padding"),"Define padding for node labels that are placed inside of a node."),thE),td_),e4R),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eGp),eZE),"Node Label Placement"),"Hints for where node labels are to be placed; if empty, the node label's position is not modified."),thk),tdy),e5t),jL(tdd,eow(vx(e6Q,1),eU4,175,0,[tdf]))))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eVd),eZS),"Port Alignment"),"Defines the default port distribution for a node. May be overridden for each side individually."),thU),tdv),e5n),el8(tdd)))),efO(e,new eE9(yt(ye(yn(v4(v7(v5(v8(new oN,eVh),eZS),"Port Alignment (North)"),"Defines how ports on the northern side are placed, overriding the node's general port alignment."),tdv),e5n),el8(tdd)))),efO(e,new eE9(yt(ye(yn(v4(v7(v5(v8(new oN,eVp),eZS),"Port Alignment (South)"),"Defines how ports on the southern side are placed, overriding the node's general port alignment."),tdv),e5n),el8(tdd)))),efO(e,new eE9(yt(ye(yn(v4(v7(v5(v8(new oN,eVb),eZS),"Port Alignment (West)"),"Defines how ports on the western side are placed, overriding the node's general port alignment."),tdv),e5n),el8(tdd)))),efO(e,new eE9(yt(ye(yn(v4(v7(v5(v8(new oN,eVm),eZS),"Port Alignment (East)"),"Defines how ports on the eastern side are placed, overriding the node's general port alignment."),tdv),e5n),el8(tdd)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eGh),eZk),"Node Size Constraints"),"What should be taken into account when calculating a node's size. Empty size constraints specify that a node's size is already fixed and should not be changed."),thT),tdy),e5o),el8(tdd)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eGd),eZk),"Node Size Options"),"Options modifying the behavior of the size constraints set on a node. Each member of the set specifies something that should be taken into account when calculating node sizes. The empty set corresponds to no further modifications."),thC),tdy),e5s),el8(tdd)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eGM),eZk),"Node Size Minimum"),"The minimal size to which a node can be reduced."),thA),td_),e60),el8(tdd)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eVs),eZk),"Fixed Graph Size"),"By default, the fixed layout provider will enlarge a graph until it is large enough to contain its children. If this option is set, it won't do so."),!1),tdm),e11),el8(tdh)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eVy),eKX),"Edge Label Placement"),"Gives a hint on where to put edge labels."),thi),tdv),e65),el8(tdf)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eGl),eKX),"Inline Edge Labels"),"If true, an edge label is placed directly on its edge. May only apply to center edge labels. This kind of label placement is only advisable if the label's rendering is such that it is not crossed by its edge and thus stays legible."),!1),tdm),e11),el8(tdf)))),efO(e,new eE9(yt(ye(yn(v4(v7(v5(v8(new oN,eZv),"font"),"Font Name"),"Font name used for a label."),tdE),e17),el8(tdf)))),efO(e,new eE9(yt(ye(yn(v4(v7(v5(v8(new oN,eZy),"font"),"Font Size"),"Font size used for a label."),tdw),e16),el8(tdf)))),efO(e,new eE9(yt(ye(yn(v4(v7(v5(v8(new oN,eVS),eZx),"Port Anchor Offset"),"The offset to the port position where connections shall be attached."),td_),e60),el8(tdp)))),efO(e,new eE9(yt(ye(yn(v4(v7(v5(v8(new oN,eVw),eZx),"Port Index"),"The index of a port in the fixed order around a node. The order is assumed as clockwise, starting with the leftmost port on the top side. This option must be set if 'Port Constraints' is set to FIXED_ORDER and no specific positions are given for the ports. Additionally, the option 'Port Side' must be defined in this case."),tdw),e16),el8(tdp)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eVn),eZx),"Port Side"),"The side of a node on which a port is situated. This option must be set if 'Port Constraints' is set to FIXED_SIDE or FIXED_ORDER and no specific positions are given for the ports."),th2),tdv),e5a),el8(tdp)))),efO(e,new eE9(yt(ye(yn(v4(v7(v5(v8(new oN,eVe),eZx),"Port Border Offset"),"The offset of ports on the node border. With a positive offset the port is moved outside of the node, while with a negative offset the port is moved towards the inside. An offset of 0 means that the port is placed directly on the node border, i.e. if the port side is north, the port's south border touches the nodes's north border; if the port side is east, the port's west border touches the nodes's east border; if the port side is south, the port's north border touches the node's south border; if the port side is west, the port's east border touches the node's west border."),tdg),e13),el8(tdp)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eGb),eZT),"Port Label Placement"),"Decides on a placement method for port labels; if empty, the node label's position is not modified."),thQ),tdy),e5i),el8(tdd)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eVl),eZT),"Port Labels Next to Port"),"Use 'portLabels.placement': NEXT_TO_PORT_OF_POSSIBLE."),!1),tdm),e11),el8(tdd)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eVf),eZT),"Treat Port Labels as Group"),"If this option is true (default), the labels of a port will be treated as a group when it comes to centering them next to their port. If this option is false, only the first label will be centered next to the port, with the others being placed below. This only applies to labels of eastern and western ports and will have no effect if labels are not placed next to their port."),!0),tdm),e11),el8(tdd)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eVa),eZM),"Activate Inside Self Loops"),"Whether this node allows to route self loops inside of it instead of around it. If set to true, this will make the node a compound node if it isn't already, and will require the layout algorithm to support compound nodes with hierarchical ports."),!1),tdm),e11),el8(tdd)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eVo),eZM),"Inside Self Loop"),"Whether a self loop should be routed inside a node instead of around that node."),!1),tdm),e11),el8(tdl)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,ezz),"edge"),"Edge Thickness"),"The thickness of an edge. This is a hint on the line width used to draw an edge, possibly requiring more space to be reserved for it."),1),tdg),e13),el8(tdl)))),efO(e,new eE9(yt(ye(yn(v6(v4(v7(v5(v8(new oN,eZw),"edge"),"Edge Type"),"The type of an edge. This is usually used for UML class diagrams, where associations must be handled differently from generalizations."),thu),tdv),e69),el8(tdl)))),_B(e,new GM(v0(v3(v2(new of,eG1),"Layered"),'The layer-based method was introduced by Sugiyama, Tagawa and Toda in 1981. It emphasizes the direction of edges by pointing as many edges as possible into the same direction. The nodes are arranged in layers, which are sometimes called "hierarchies", and then reordered such that the number of edge crossings is minimized. Afterwards, concrete coordinates are computed for the nodes and edge bend points.'))),_B(e,new GM(v0(v3(v2(new of,"org.eclipse.elk.orthogonal"),"Orthogonal"),'Orthogonal methods that follow the "topology-shape-metrics" approach by Batini, Nardelli and Tamassia \'86. The first phase determines the topology of the drawing by applying a planarization technique, which results in a planar representation of the graph. The orthogonal shape is computed in the second phase, which aims at minimizing the number of edge bends, and is called orthogonalization. The third phase leads to concrete coordinates for nodes and edge bend points by applying a compaction method, thus defining the metrics.'))),_B(e,new GM(v0(v3(v2(new of,eGn),"Force"),"Layout algorithms that follow physical analogies by simulating a system of attractive and repulsive forces. The first successful method of this kind was proposed by Eades in 1984."))),_B(e,new GM(v0(v3(v2(new of,"org.eclipse.elk.circle"),"Circle"),"Circular layout algorithms emphasize cycles or biconnected components of a graph by arranging them in circles. This is useful if a drawing is desired where such components are clearly grouped, or where cycles are shown as prominent OPTIONS of the graph."))),_B(e,new GM(v0(v3(v2(new of,eV8),"Tree"),"Specialized layout methods for trees, i.e. acyclic graphs. The regular structure of graphs that have no undirected cycles can be emphasized using an algorithm of this type."))),_B(e,new GM(v0(v3(v2(new of,"org.eclipse.elk.planar"),"Planar"),"Algorithms that require a planar or upward planar graph. Most of these algorithms are theoretically interesting, but not practically usable."))),_B(e,new GM(v0(v3(v2(new of,eqp),"Radial"),"Radial layout algorithms usually position the nodes of the graph on concentric circles."))),eIm((new cX,e)),eDj((new cq,e)),eL5((new cJ,e))},Y6(eZe,"CoreOptions",684),eTS(103,22,{3:1,35:1,22:1,103:1},kh);var e66=enw(eZe,ezw,103,e1G,Zh,NY);eTS(272,22,{3:1,35:1,22:1,272:1},kp);var e65=enw(eZe,"EdgeLabelPlacement",272,e1G,Wp,NB);eTS(218,22,{3:1,35:1,22:1,218:1},kb);var e68=enw(eZe,"EdgeRouting",218,e1G,VC,NU);eTS(312,22,{3:1,35:1,22:1,312:1},km);var e69=enw(eZe,"EdgeType",312,e1G,Jx,NH);eTS(977,1,e$2,cX),eUe.Qe=function(e){eIm(e)},Y6(eZe,"FixedLayouterOptions",977),eTS(978,1,{},o$),eUe.$e=function(){return new oR},eUe._e=function(e){},Y6(eZe,"FixedLayouterOptions/FixedFactory",978),eTS(334,22,{3:1,35:1,22:1,334:1},kg);var e67=enw(eZe,"HierarchyHandling",334,e1G,Wh,N$);eTS(285,22,{3:1,35:1,22:1,285:1},kv);var e5e=enw(eZe,"LabelSide",285,e1G,VL,Nz);eTS(93,22,{3:1,35:1,22:1,93:1},ky);var e5t=enw(eZe,"NodeLabelPlacement",93,e1G,ene,NG);eTS(249,22,{3:1,35:1,22:1,249:1},kw);var e5n=enw(eZe,"PortAlignment",249,e1G,Zp,NW);eTS(98,22,{3:1,35:1,22:1,98:1},k_);var e5r=enw(eZe,"PortConstraints",98,e1G,X0,NK);eTS(273,22,{3:1,35:1,22:1,273:1},kE);var e5i=enw(eZe,"PortLabelPlacement",273,e1G,Jk,NV);eTS(61,22,{3:1,35:1,22:1,61:1},kS);var e5a=enw(eZe,"PortSide",61,e1G,q6,NX);eTS(981,1,e$2,cJ),eUe.Qe=function(e){eL5(e)},Y6(eZe,"RandomLayouterOptions",981),eTS(982,1,{},oz),eUe.$e=function(){return new oV},eUe._e=function(e){},Y6(eZe,"RandomLayouterOptions/RandomFactory",982),eTS(374,22,{3:1,35:1,22:1,374:1},kk);var e5o=enw(eZe,"SizeConstraint",374,e1G,VA,Nq);eTS(259,22,{3:1,35:1,22:1,259:1},kx);var e5s=enw(eZe,"SizeOptions",259,e1G,en2,NZ);eTS(370,1,{1949:1},mV),eUe.b=!1,eUe.c=0,eUe.d=-1,eUe.e=null,eUe.f=null,eUe.g=-1,eUe.j=!1,eUe.k=!1,eUe.n=!1,eUe.o=0,eUe.q=0,eUe.r=0,Y6(eVL,"BasicProgressMonitor",370),eTS(972,209,ezL,oF),eUe.Ze=function(e,t){var n,r,i,a,o,s,u,c,l;(ewG(t,"Box layout",2),i=gR(LV(eT9(e,(e_C(),tdG)))),a=Pp(eT9(e,tdH),116),n=gN(LK(eT9(e,tdj))),r=gN(LK(eT9(e,tdF))),0===Pp(eT9(e,tdP),311).g)?(o=(s=new I4((e.a||(e.a=new FQ(e5k,e,10,11)),e.a)),Hj(),Mv(s,new h3(r)),s),u=eSI(e),(null==(c=LV(eT9(e,tdN)))||(BJ(c),c<=0))&&(c=1.3),l=eYA(o,i,a,u.a,u.b,n,(BJ(c),c)),eYx(e,l.a,l.b,!1,!0)):eRF(e,i,a,n),eEj(t)},Y6(eVL,"BoxLayoutProvider",972),eTS(973,1,e$C,h3),eUe.ue=function(e,t){return eOQ(this,Pp(e,33),Pp(t,33))},eUe.Fb=function(e){return this===e},eUe.ve=function(){return new fZ(this)},eUe.a=!1,Y6(eVL,"BoxLayoutProvider/1",973),eTS(157,1,{157:1},etD,Lp),eUe.Ib=function(){return this.c?eC4(this.c):e_F(this.b)},Y6(eVL,"BoxLayoutProvider/Group",157),eTS(311,22,{3:1,35:1,22:1,311:1},kT);var e5u=enw(eVL,"BoxLayoutProvider/PackingMode",311,e1G,VI,NJ);eTS(974,1,e$C,oY),eUe.ue=function(e,t){return HK(Pp(e,157),Pp(t,157))},eUe.Fb=function(e){return this===e},eUe.ve=function(){return new fZ(this)},Y6(eVL,"BoxLayoutProvider/lambda$0$Type",974),eTS(975,1,e$C,oB),eUe.ue=function(e,t){return Hm(Pp(e,157),Pp(t,157))},eUe.Fb=function(e){return this===e},eUe.ve=function(){return new fZ(this)},Y6(eVL,"BoxLayoutProvider/lambda$1$Type",975),eTS(976,1,e$C,oU),eUe.ue=function(e,t){return Hg(Pp(e,157),Pp(t,157))},eUe.Fb=function(e){return this===e},eUe.ve=function(){return new fZ(this)},Y6(eVL,"BoxLayoutProvider/lambda$2$Type",976),eTS(1365,1,{831:1},oH),eUe.qg=function(e,t){return _R(),!M4(t,160)||yX((eoM(),Pp(e,160)),t)},Y6(eVL,"ElkSpacings/AbstractSpacingsBuilder/lambda$0$Type",1365),eTS(1366,1,eUF,h4),eUe.td=function(e){eux(this.a,Pp(e,146))},Y6(eVL,"ElkSpacings/AbstractSpacingsBuilder/lambda$1$Type",1366),eTS(1367,1,eUF,oj),eUe.td=function(e){Pp(e,94),_R()},Y6(eVL,"ElkSpacings/AbstractSpacingsBuilder/lambda$2$Type",1367),eTS(1371,1,eUF,h6),eUe.td=function(e){erQ(this.a,Pp(e,94))},Y6(eVL,"ElkSpacings/AbstractSpacingsBuilder/lambda$3$Type",1371),eTS(1369,1,eU9,kM),eUe.Mb=function(e){return esI(this.a,this.b,Pp(e,146))},Y6(eVL,"ElkSpacings/AbstractSpacingsBuilder/lambda$4$Type",1369),eTS(1368,1,eU9,kO),eUe.Mb=function(e){return Lt(this.a,this.b,Pp(e,831))},Y6(eVL,"ElkSpacings/AbstractSpacingsBuilder/lambda$5$Type",1368),eTS(1370,1,eUF,kA),eUe.td=function(e){Fj(this.a,this.b,Pp(e,146))},Y6(eVL,"ElkSpacings/AbstractSpacingsBuilder/lambda$6$Type",1370),eTS(935,1,{},oP),eUe.Kb=function(e){return TA(e)},eUe.Fb=function(e){return this===e},Y6(eVL,"ElkUtil/lambda$0$Type",935),eTS(936,1,eUF,kL),eUe.td=function(e){exS(this.a,this.b,Pp(e,79))},eUe.a=0,eUe.b=0,Y6(eVL,"ElkUtil/lambda$1$Type",936),eTS(937,1,eUF,kC),eUe.td=function(e){gp(this.a,this.b,Pp(e,202))},eUe.a=0,eUe.b=0,Y6(eVL,"ElkUtil/lambda$2$Type",937),eTS(938,1,eUF,kI),eUe.td=function(e){Me(this.a,this.b,Pp(e,137))},eUe.a=0,eUe.b=0,Y6(eVL,"ElkUtil/lambda$3$Type",938),eTS(939,1,eUF,h5),eUe.td=function(e){RE(this.a,Pp(e,469))},Y6(eVL,"ElkUtil/lambda$4$Type",939),eTS(342,1,{35:1,342:1},pQ),eUe.wd=function(e){return Os(this,Pp(e,236))},eUe.Fb=function(e){var t;return!!M4(e,342)&&(t=Pp(e,342),this.a==t.a)},eUe.Hb=function(){return zy(this.a)},eUe.Ib=function(){return this.a+" (exclusive)"},eUe.a=0,Y6(eVL,"ExclusiveBounds/ExclusiveLowerBound",342),eTS(1138,209,ezL,oR),eUe.Ze=function(e,t){var n,r,i,a,o,s,u,l,f,d,h,p,b,m,g,v,y,w,_,E,S,k,x;for(ewG(t,"Fixed Layout",1),a=Pp(eT9(e,(eBB(),tha)),218),d=0,h=0,y=new Ow((e.a||(e.a=new FQ(e5k,e,10,11)),e.a));y.e!=y.i.gc();){for(g=Pp(epH(y),33),(x=Pp(eT9(g,(euw(),tp$)),8))&&(TP(g,x.a,x.b),Pp(eT9(g,tpF),174).Hc((ed5(),tbW))&&(p=Pp(eT9(g,tpB),8)).a>0&&p.b>0&&eYx(g,p.a,p.b,!0,!0)),d=eB4.Math.max(d,g.i+g.g),h=eB4.Math.max(h,g.j+g.f),l=new Ow((g.n||(g.n=new FQ(e5S,g,1,7)),g.n));l.e!=l.i.gc();)s=Pp(epH(l),137),(x=Pp(eT9(s,tp$),8))&&TP(s,x.a,x.b),d=eB4.Math.max(d,g.i+s.i+s.g),h=eB4.Math.max(h,g.j+s.j+s.f);for(E=new Ow((g.c||(g.c=new FQ(e5x,g,9,9)),g.c));E.e!=E.i.gc();)for(_=Pp(epH(E),118),(x=Pp(eT9(_,tp$),8))&&TP(_,x.a,x.b),S=g.i+_.i,k=g.j+_.j,d=eB4.Math.max(d,S+_.g),h=eB4.Math.max(h,k+_.f),u=new Ow((_.n||(_.n=new FQ(e5S,_,1,7)),_.n));u.e!=u.i.gc();)s=Pp(epH(u),137),(x=Pp(eT9(s,tp$),8))&&TP(s,x.a,x.b),d=eB4.Math.max(d,S+s.i+s.g),h=eB4.Math.max(h,k+s.j+s.f);for(i=new Fa(OH(eOi(g).a.Kc(),new c));eTk(i);)n=Pp(ZC(i),79),f=eYT(n),d=eB4.Math.max(d,f.a),h=eB4.Math.max(h,f.b);for(r=new Fa(OH(eOr(g).a.Kc(),new c));eTk(r);)n=Pp(ZC(r),79),z$(e_I(n))!=e&&(f=eYT(n),d=eB4.Math.max(d,f.a),h=eB4.Math.max(h,f.b))}if(a==(efE(),tpx))for(v=new Ow((e.a||(e.a=new FQ(e5k,e,10,11)),e.a));v.e!=v.i.gc();)for(g=Pp(epH(v),33),r=new Fa(OH(eOi(g).a.Kc(),new c));eTk(r);)n=Pp(ZC(r),79),0==(o=eDX(n)).b?ebu(n,thg,null):ebu(n,thg,o);gN(LK(eT9(e,(euw(),tpY))))||(w=Pp(eT9(e,tpU),116),eYx(e,m=d+w.b+w.c,b=h+w.d+w.a,!0,!0)),eEj(t)},Y6(eVL,"FixedLayoutProvider",1138),eTS(373,134,{3:1,414:1,373:1,94:1,134:1},oG,eer),eUe.Jf=function(e){var t,n,r,i,a,o,s,u,c;if(e)try{for(a=u=eIk(e,";,;"),o=0,s=a.length;o>16&eHd|t^r<<16},eUe.Kc=function(){return new h8(this)},eUe.Ib=function(){return null==this.a&&null==this.b?"pair(null,null)":null==this.a?"pair(null,"+efF(this.b)+")":null==this.b?"pair("+efF(this.a)+",null)":"pair("+efF(this.a)+","+efF(this.b)+")"},Y6(eVL,"Pair",46),eTS(983,1,eUE,h8),eUe.Nb=function(e){F9(this,e)},eUe.Ob=function(){return!this.c&&(!this.b&&null!=this.a.a||null!=this.a.b)},eUe.Pb=function(){if(!this.c&&!this.b&&null!=this.a.a)return this.b=!0,this.a.a;if(!this.c&&null!=this.a.b)return this.c=!0,this.a.b;throw p7(new bC)},eUe.Qb=function(){throw this.c&&null!=this.a.b?this.a.b=null:this.b&&null!=this.a.a&&(this.a.a=null),p7(new bT)},eUe.b=!1,eUe.c=!1,Y6(eVL,"Pair/1",983),eTS(448,1,{448:1},Ho),eUe.Fb=function(e){return UT(this.a,Pp(e,448).a)&&UT(this.c,Pp(e,448).c)&&UT(this.d,Pp(e,448).d)&&UT(this.b,Pp(e,448).b)},eUe.Hb=function(){return euF(eow(vx(e1R,1),eUp,1,5,[this.a,this.c,this.d,this.b]))},eUe.Ib=function(){return"("+this.a+eUd+this.c+eUd+this.d+eUd+this.b+")"},Y6(eVL,"Quadruple",448),eTS(1126,209,ezL,oV),eUe.Ze=function(e,t){var n,r,i,a,o;if(ewG(t,"Random Layout",1),0==(e.a||(e.a=new FQ(e5k,e,10,11)),e.a).i){eEj(t);return}i=(a=Pp(eT9(e,(ed6(),tbz)),19))&&0!=a.a?new qS(a.a):new efo,n=gR(LV(eT9(e,tbU))),o=gR(LV(eT9(e,tbG))),r=Pp(eT9(e,tbH),116),eF1(e,i,n,o,r),eEj(t)},Y6(eVL,"RandomLayoutProvider",1126),eTS(553,1,{}),eUe.qf=function(){return new kl(this.f.i,this.f.j)},eUe.We=function(e){return $k(e,(eBB(),thK))?eT9(this.f,tmu):eT9(this.f,e)},eUe.rf=function(){return new kl(this.f.g,this.f.f)},eUe.sf=function(){return this.g},eUe.Xe=function(e){return X2(this.f,e)},eUe.tf=function(e){eno(this.f,e.a),ens(this.f,e.b)},eUe.uf=function(e){ena(this.f,e.a),eni(this.f,e.b)},eUe.vf=function(e){this.g=e},eUe.g=0,Y6(eZI,"ElkGraphAdapters/AbstractElkGraphElementAdapter",553),eTS(554,1,{839:1},h9),eUe.wf=function(){var e,t;if(!this.b)for(this.b=K$(UB(this.a).i),t=new Ow(UB(this.a));t.e!=t.i.gc();)e=Pp(epH(t),137),P_(this.b,new gO(e));return this.b},eUe.b=null,Y6(eZI,"ElkGraphAdapters/ElkEdgeAdapter",554),eTS(301,553,{},gM),eUe.xf=function(){return em3(this)},eUe.a=null,Y6(eZI,"ElkGraphAdapters/ElkGraphAdapter",301),eTS(630,553,{181:1},gO),Y6(eZI,"ElkGraphAdapters/ElkLabelAdapter",630),eTS(629,553,{680:1},AC),eUe.wf=function(){return em0(this)},eUe.Af=function(){var e;return(e=Pp(eT9(this.f,(eBB(),thy)),142))||(e=new mh),e},eUe.Cf=function(){return em2(this)},eUe.Ef=function(e){var t;t=new Dk(e),ebu(this.f,(eBB(),thy),t)},eUe.Ff=function(e){ebu(this.f,(eBB(),thN),new DS(e))},eUe.yf=function(){return this.d},eUe.zf=function(){var e,t;if(!this.a)for(this.a=new p0,t=new Fa(OH(eOr(Pp(this.f,33)).a.Kc(),new c));eTk(t);)e=Pp(ZC(t),79),P_(this.a,new h9(e));return this.a},eUe.Bf=function(){var e,t;if(!this.c)for(this.c=new p0,t=new Fa(OH(eOi(Pp(this.f,33)).a.Kc(),new c));eTk(t);)e=Pp(ZC(t),79),P_(this.c,new h9(e));return this.c},eUe.Df=function(){return 0!=H9(Pp(this.f,33)).i||gN(LK(Pp(this.f,33).We((eBB(),thh))))},eUe.Gf=function(){QV(this,(_q(),tms))},eUe.a=null,eUe.b=null,eUe.c=null,eUe.d=null,eUe.e=null,Y6(eZI,"ElkGraphAdapters/ElkNodeAdapter",629),eTS(1266,553,{838:1},pA),eUe.wf=function(){return egd(this)},eUe.zf=function(){var e,t;if(!this.a)for(this.a=AH(Pp(this.f,118).xg().i),t=new Ow(Pp(this.f,118).xg());t.e!=t.i.gc();)e=Pp(epH(t),79),P_(this.a,new h9(e));return this.a},eUe.Bf=function(){var e,t;if(!this.c)for(this.c=AH(Pp(this.f,118).yg().i),t=new Ow(Pp(this.f,118).yg());t.e!=t.i.gc();)e=Pp(epH(t),79),P_(this.c,new h9(e));return this.c},eUe.Hf=function(){return Pp(Pp(this.f,118).We((eBB(),th0)),61)},eUe.If=function(){var e,t,n,r,i,a,o,s;for(r=zY(Pp(this.f,118)),n=new Ow(Pp(this.f,118).yg());n.e!=n.i.gc();)for(e=Pp(epH(n),79),s=new Ow((e.c||(e.c=new Ih(e5m,e,5,8)),e.c));s.e!=s.i.gc();)if(o=Pp(epH(s),82),etg(ewH(o),r)||ewH(o)==r&&gN(LK(eT9(e,(eBB(),thp)))))return!0;for(t=new Ow(Pp(this.f,118).xg());t.e!=t.i.gc();)for(e=Pp(epH(t),79),a=new Ow((e.b||(e.b=new Ih(e5m,e,4,7)),e.b));a.e!=a.i.gc();)if(i=Pp(epH(a),82),etg(ewH(i),r))return!0;return!1},eUe.a=null,eUe.b=null,eUe.c=null,Y6(eZI,"ElkGraphAdapters/ElkPortAdapter",1266),eTS(1267,1,e$C,oq),eUe.ue=function(e,t){return eC3(Pp(e,118),Pp(t,118))},eUe.Fb=function(e){return this===e},eUe.ve=function(){return new fZ(this)},Y6(eZI,"ElkGraphAdapters/PortComparator",1267);var e5f=RL(eZD,"EObject"),e5d=RL(eZN,eZP),e5h=RL(eZN,eZR),e5p=RL(eZN,eZj),e5b=RL(eZN,"ElkShape"),e5m=RL(eZN,eZF),e5g=RL(eZN,eZY),e5v=RL(eZN,eZB),e5y=RL(eZD,eZU),e5w=RL(eZD,"EFactory"),e5_=RL(eZD,eZH),e5E=RL(eZD,"EPackage"),e5S=RL(eZN,eZ$),e5k=RL(eZN,eZz),e5x=RL(eZN,eZG);eTS(90,1,eZW),eUe.Jg=function(){return this.Kg(),null},eUe.Kg=function(){return null},eUe.Lg=function(){return this.Kg(),!1},eUe.Mg=function(){return!1},eUe.Ng=function(e){eam(this,e)},Y6(eZK,"BasicNotifierImpl",90),eTS(97,90,eZ0),eUe.nh=function(){return TO(this)},eUe.Og=function(e,t){return e},eUe.Pg=function(){throw p7(new bO)},eUe.Qg=function(e){var t;return t=ebY(Pp(ee2(this.Tg(),this.Vg()),18)),this.eh().ih(this,t.n,t.f,e)},eUe.Rg=function(e,t){throw p7(new bO)},eUe.Sg=function(e,t,n){return eDg(this,e,t,n)},eUe.Tg=function(){var e;return this.Pg()&&(e=this.Pg().ck())?e:this.zh()},eUe.Ug=function(){return eTp(this)},eUe.Vg=function(){throw p7(new bO)},eUe.Wg=function(){var e,t;return(t=this.ph().dk())||this.Pg().ik(t=(_0(),null==(e=zr(eNT(this.Tg())))?tgV:new AA(this,e))),t},eUe.Xg=function(e,t){return e},eUe.Yg=function(e){var t;return(t=e.Gj())?e.aj():edv(this.Tg(),e)},eUe.Zg=function(){var e;return(e=this.Pg())?e.fk():null},eUe.$g=function(){return this.Pg()?this.Pg().ck():null},eUe._g=function(e,t,n){return ebl(this,e,t,n)},eUe.ah=function(e){return JG(this,e)},eUe.bh=function(e,t){return ZN(this,e,t)},eUe.dh=function(){var e;return!!(e=this.Pg())&&e.gk()},eUe.eh=function(){throw p7(new bO)},eUe.fh=function(){return ehO(this)},eUe.gh=function(e,t,n,r){return ep0(this,e,t,r)},eUe.hh=function(e,t,n){var r;return(r=Pp(ee2(this.Tg(),t),66)).Nj().Qj(this,this.yh(),t-this.Ah(),e,n)},eUe.ih=function(e,t,n,r){return $7(this,e,t,r)},eUe.jh=function(e,t,n){var r;return(r=Pp(ee2(this.Tg(),t),66)).Nj().Rj(this,this.yh(),t-this.Ah(),e,n)},eUe.kh=function(){return!!this.Pg()&&!!this.Pg().ek()},eUe.lh=function(e){return epY(this,e)},eUe.mh=function(e){return zz(this,e)},eUe.oh=function(e){return eR2(this,e)},eUe.ph=function(){throw p7(new bO)},eUe.qh=function(){return this.Pg()?this.Pg().ek():null},eUe.rh=function(){return ehO(this)},eUe.sh=function(e,t){eS6(this,e,t)},eUe.th=function(e){this.ph().hk(e)},eUe.uh=function(e){this.ph().kk(e)},eUe.vh=function(e){this.ph().jk(e)},eUe.wh=function(e,t){var n,r,i,a;return(a=this.Zg())&&e&&(t=ep5(a.Vk(),this,t),a.Zk(this)),(r=this.eh())&&((eIy(this,this.eh(),this.Vg()).Bb&eH3)!=0?(i=r.fh())&&(e?a||i.Zk(this):i.Yk(this)):(t=(n=this.Vg())>=0?this.Qg(t):this.eh().ih(this,-1-n,null,t),t=this.Sg(null,-1,t))),this.uh(e),t},eUe.xh=function(e){var t,n,r,i,a,o,s,u;if((a=edv(n=this.Tg(),e))>=(t=this.Ah()))return Pp(e,66).Nj().Uj(this,this.yh(),a-t);if(a<=-1){if(o=eR3((eSp(),tvc),n,e)){if(_4(),Pp(o,66).Oj()||(o=Wk(QZ(tvc,o))),i=Pp((r=this.Yg(o))>=0?this._g(r,!0,!0):exk(this,o,!0),153),(u=o.Zj())>1||-1==u)return Pp(Pp(i,215).hl(e,!1),76)}else throw p7(new gL(eZV+e.ne()+eZX))}else if(e.$j())return Pp((r=this.Yg(e))>=0?this._g(r,!1,!0):exk(this,e,!1),76);return new k4(this,e)},eUe.yh=function(){return Q6(this)},eUe.zh=function(){return(BM(),tgv).S},eUe.Ah=function(){return Y1(this.zh())},eUe.Bh=function(e){eSi(this,e)},eUe.Ib=function(){return eMT(this)},Y6(eZ2,"BasicEObjectImpl",97),eTS(114,97,{105:1,92:1,90:1,56:1,108:1,49:1,97:1,114:1}),eUe.Ch=function(e){var t;return(t=Q5(this))[e]},eUe.Dh=function(e,t){var n;n=Q5(this),Bc(n,e,t)},eUe.Eh=function(e){var t;t=Q5(this),Bc(t,e,null)},eUe.Jg=function(){return Pp(eaS(this,4),126)},eUe.Kg=function(){throw p7(new bO)},eUe.Lg=function(){return(4&this.Db)!=0},eUe.Pg=function(){throw p7(new bO)},eUe.Fh=function(e){ehU(this,2,e)},eUe.Rg=function(e,t){this.Db=t<<16|255&this.Db,this.Fh(e)},eUe.Tg=function(){return $S(this)},eUe.Vg=function(){return this.Db>>16},eUe.Wg=function(){var e,t;return _0(),null==(t=zr(eNT((e=Pp(eaS(this,16),26))||this.zh())))?tgV:new AA(this,t)},eUe.Mg=function(){return(1&this.Db)==0},eUe.Zg=function(){return Pp(eaS(this,128),1935)},eUe.$g=function(){return Pp(eaS(this,16),26)},eUe.dh=function(){return(32&this.Db)!=0},eUe.eh=function(){return Pp(eaS(this,2),49)},eUe.kh=function(){return(64&this.Db)!=0},eUe.ph=function(){throw p7(new bO)},eUe.qh=function(){return Pp(eaS(this,64),281)},eUe.th=function(e){ehU(this,16,e)},eUe.uh=function(e){ehU(this,128,e)},eUe.vh=function(e){ehU(this,64,e)},eUe.yh=function(){return ehH(this)},eUe.Db=0,Y6(eZ2,"MinimalEObjectImpl",114),eTS(115,114,{105:1,92:1,90:1,56:1,108:1,49:1,97:1,114:1,115:1}),eUe.Fh=function(e){this.Cb=e},eUe.eh=function(){return this.Cb},Y6(eZ2,"MinimalEObjectImpl/Container",115),eTS(1985,115,{105:1,413:1,94:1,92:1,90:1,56:1,108:1,49:1,97:1,114:1,115:1}),eUe._g=function(e,t,n){return egp(this,e,t,n)},eUe.jh=function(e,t,n){return e_8(this,e,t,n)},eUe.lh=function(e){return Wz(this,e)},eUe.sh=function(e,t){esU(this,e,t)},eUe.zh=function(){return eBa(),tm_},eUe.Bh=function(e){eoF(this,e)},eUe.Ve=function(){return epD(this)},eUe.We=function(e){return eT9(this,e)},eUe.Xe=function(e){return X2(this,e)},eUe.Ye=function(e,t){return ebu(this,e,t)},Y6(eZ3,"EMapPropertyHolderImpl",1985),eTS(567,115,{105:1,469:1,92:1,90:1,56:1,108:1,49:1,97:1,114:1,115:1},oJ),eUe._g=function(e,t,n){switch(e){case 0:return this.a;case 1:return this.b}return ebl(this,e,t,n)},eUe.lh=function(e){switch(e){case 0:return 0!=this.a;case 1:return 0!=this.b}return epY(this,e)},eUe.sh=function(e,t){switch(e){case 0:ent(this,gP(LV(t)));return;case 1:enn(this,gP(LV(t)));return}eS6(this,e,t)},eUe.zh=function(){return eBa(),tmf},eUe.Bh=function(e){switch(e){case 0:ent(this,0);return;case 1:enn(this,0);return}eSi(this,e)},eUe.Ib=function(){var e;return(64&this.Db)!=0?eMT(this):(e=new O1(eMT(this)),e.a+=" (x: ",y$(e,this.a),e.a+=", y: ",y$(e,this.b),e.a+=")",e.a)},eUe.a=0,eUe.b=0,Y6(eZ3,"ElkBendPointImpl",567),eTS(723,1985,{105:1,413:1,160:1,94:1,92:1,90:1,56:1,108:1,49:1,97:1,114:1,115:1}),eUe._g=function(e,t,n){return ec2(this,e,t,n)},eUe.hh=function(e,t,n){return ew0(this,e,t,n)},eUe.jh=function(e,t,n){return ea8(this,e,t,n)},eUe.lh=function(e){return eaT(this,e)},eUe.sh=function(e,t){eyb(this,e,t)},eUe.zh=function(){return eBa(),tmb},eUe.Bh=function(e){ecx(this,e)},eUe.zg=function(){return this.k},eUe.Ag=function(){return UB(this)},eUe.Ib=function(){return el4(this)},eUe.k=null,Y6(eZ3,"ElkGraphElementImpl",723),eTS(724,723,{105:1,413:1,160:1,470:1,94:1,92:1,90:1,56:1,108:1,49:1,97:1,114:1,115:1}),eUe._g=function(e,t,n){return efN(this,e,t,n)},eUe.lh=function(e){return ef9(this,e)},eUe.sh=function(e,t){eym(this,e,t)},eUe.zh=function(){return eBa(),tmw},eUe.Bh=function(e){edS(this,e)},eUe.Bg=function(){return this.f},eUe.Cg=function(){return this.g},eUe.Dg=function(){return this.i},eUe.Eg=function(){return this.j},eUe.Fg=function(e,t){TN(this,e,t)},eUe.Gg=function(e,t){TP(this,e,t)},eUe.Hg=function(e){eno(this,e)},eUe.Ig=function(e){ens(this,e)},eUe.Ib=function(){return eEp(this)},eUe.f=0,eUe.g=0,eUe.i=0,eUe.j=0,Y6(eZ3,"ElkShapeImpl",724),eTS(725,724,{105:1,413:1,82:1,160:1,470:1,94:1,92:1,90:1,56:1,108:1,49:1,97:1,114:1,115:1}),eUe._g=function(e,t,n){return ebQ(this,e,t,n)},eUe.hh=function(e,t,n){return evZ(this,e,t,n)},eUe.jh=function(e,t,n){return evX(this,e,t,n)},eUe.lh=function(e){return esM(this,e)},eUe.sh=function(e,t){eTH(this,e,t)},eUe.zh=function(){return eBa(),tmd},eUe.Bh=function(e){ep2(this,e)},eUe.xg=function(){return this.d||(this.d=new Ih(e5g,this,8,5)),this.d},eUe.yg=function(){return this.e||(this.e=new Ih(e5g,this,7,4)),this.e},Y6(eZ3,"ElkConnectableShapeImpl",725),eTS(352,723,{105:1,413:1,79:1,160:1,352:1,94:1,92:1,90:1,56:1,108:1,49:1,97:1,114:1,115:1},oX),eUe.Qg=function(e){return evo(this,e)},eUe._g=function(e,t,n){switch(e){case 3:return zF(this);case 4:return this.b||(this.b=new Ih(e5m,this,4,7)),this.b;case 5:return this.c||(this.c=new Ih(e5m,this,5,8)),this.c;case 6:return this.a||(this.a=new FQ(e5v,this,6,6)),this.a;case 7:return OQ(),this.b||(this.b=new Ih(e5m,this,4,7)),!(this.b.i<=1)||(this.c||(this.c=new Ih(e5m,this,5,8)),!(this.c.i<=1));case 8:return OQ(),!!eTc(this);case 9:return OQ(),!!exb(this);case 10:return OQ(),this.b||(this.b=new Ih(e5m,this,4,7)),0!=this.b.i&&(this.c||(this.c=new Ih(e5m,this,5,8)),0!=this.c.i)}return ec2(this,e,t,n)},eUe.hh=function(e,t,n){var r;switch(t){case 3:return this.Cb&&(n=(r=this.Db>>16)>=0?evo(this,n):this.Cb.ih(this,-1-r,null,n)),Cu(this,Pp(e,33),n);case 4:return this.b||(this.b=new Ih(e5m,this,4,7)),edF(this.b,e,n);case 5:return this.c||(this.c=new Ih(e5m,this,5,8)),edF(this.c,e,n);case 6:return this.a||(this.a=new FQ(e5v,this,6,6)),edF(this.a,e,n)}return ew0(this,e,t,n)},eUe.jh=function(e,t,n){switch(t){case 3:return Cu(this,null,n);case 4:return this.b||(this.b=new Ih(e5m,this,4,7)),ep5(this.b,e,n);case 5:return this.c||(this.c=new Ih(e5m,this,5,8)),ep5(this.c,e,n);case 6:return this.a||(this.a=new FQ(e5v,this,6,6)),ep5(this.a,e,n)}return ea8(this,e,t,n)},eUe.lh=function(e){switch(e){case 3:return!!zF(this);case 4:return!!this.b&&0!=this.b.i;case 5:return!!this.c&&0!=this.c.i;case 6:return!!this.a&&0!=this.a.i;case 7:return this.b||(this.b=new Ih(e5m,this,4,7)),!(this.b.i<=1&&(this.c||(this.c=new Ih(e5m,this,5,8)),this.c.i<=1));case 8:return eTc(this);case 9:return exb(this);case 10:return this.b||(this.b=new Ih(e5m,this,4,7)),0!=this.b.i&&(this.c||(this.c=new Ih(e5m,this,5,8)),0!=this.c.i)}return eaT(this,e)},eUe.sh=function(e,t){switch(e){case 3:eOC(this,Pp(t,33));return;case 4:this.b||(this.b=new Ih(e5m,this,4,7)),eRT(this.b),this.b||(this.b=new Ih(e5m,this,4,7)),Y4(this.b,Pp(t,14));return;case 5:this.c||(this.c=new Ih(e5m,this,5,8)),eRT(this.c),this.c||(this.c=new Ih(e5m,this,5,8)),Y4(this.c,Pp(t,14));return;case 6:this.a||(this.a=new FQ(e5v,this,6,6)),eRT(this.a),this.a||(this.a=new FQ(e5v,this,6,6)),Y4(this.a,Pp(t,14));return}eyb(this,e,t)},eUe.zh=function(){return eBa(),tmh},eUe.Bh=function(e){switch(e){case 3:eOC(this,null);return;case 4:this.b||(this.b=new Ih(e5m,this,4,7)),eRT(this.b);return;case 5:this.c||(this.c=new Ih(e5m,this,5,8)),eRT(this.c);return;case 6:this.a||(this.a=new FQ(e5v,this,6,6)),eRT(this.a);return}ecx(this,e)},eUe.Ib=function(){return ePY(this)},Y6(eZ3,"ElkEdgeImpl",352),eTS(439,1985,{105:1,413:1,202:1,439:1,94:1,92:1,90:1,56:1,108:1,49:1,97:1,114:1,115:1},oQ),eUe.Qg=function(e){return eg1(this,e)},eUe._g=function(e,t,n){switch(e){case 1:return this.j;case 2:return this.k;case 3:return this.b;case 4:return this.c;case 5:return this.a||(this.a=new O_(e5h,this,5)),this.a;case 6:return zB(this);case 7:if(t)return ebF(this);return this.i;case 8:if(t)return ebj(this);return this.f;case 9:return this.g||(this.g=new Ih(e5v,this,9,10)),this.g;case 10:return this.e||(this.e=new Ih(e5v,this,10,9)),this.e;case 11:return this.d}return egp(this,e,t,n)},eUe.hh=function(e,t,n){var r,i,a;switch(t){case 6:return this.Cb&&(n=(i=this.Db>>16)>=0?eg1(this,n):this.Cb.ih(this,-1-i,null,n)),Cc(this,Pp(e,79),n);case 9:return this.g||(this.g=new Ih(e5v,this,9,10)),edF(this.g,e,n);case 10:return this.e||(this.e=new Ih(e5v,this,10,9)),edF(this.e,e,n)}return(a=Pp(ee2((r=Pp(eaS(this,16),26))||(eBa(),tmp),t),66)).Nj().Qj(this,ehH(this),t-Y1((eBa(),tmp)),e,n)},eUe.jh=function(e,t,n){switch(t){case 5:return this.a||(this.a=new O_(e5h,this,5)),ep5(this.a,e,n);case 6:return Cc(this,null,n);case 9:return this.g||(this.g=new Ih(e5v,this,9,10)),ep5(this.g,e,n);case 10:return this.e||(this.e=new Ih(e5v,this,10,9)),ep5(this.e,e,n)}return e_8(this,e,t,n)},eUe.lh=function(e){switch(e){case 1:return 0!=this.j;case 2:return 0!=this.k;case 3:return 0!=this.b;case 4:return 0!=this.c;case 5:return!!this.a&&0!=this.a.i;case 6:return!!zB(this);case 7:return!!this.i;case 8:return!!this.f;case 9:return!!this.g&&0!=this.g.i;case 10:return!!this.e&&0!=this.e.i;case 11:return null!=this.d}return Wz(this,e)},eUe.sh=function(e,t){switch(e){case 1:enu(this,gP(LV(t)));return;case 2:enl(this,gP(LV(t)));return;case 3:enr(this,gP(LV(t)));return;case 4:enc(this,gP(LV(t)));return;case 5:this.a||(this.a=new O_(e5h,this,5)),eRT(this.a),this.a||(this.a=new O_(e5h,this,5)),Y4(this.a,Pp(t,14));return;case 6:eOA(this,Pp(t,79));return;case 7:err(this,Pp(t,82));return;case 8:ern(this,Pp(t,82));return;case 9:this.g||(this.g=new Ih(e5v,this,9,10)),eRT(this.g),this.g||(this.g=new Ih(e5v,this,9,10)),Y4(this.g,Pp(t,14));return;case 10:this.e||(this.e=new Ih(e5v,this,10,9)),eRT(this.e),this.e||(this.e=new Ih(e5v,this,10,9)),Y4(this.e,Pp(t,14));return;case 11:erO(this,Lq(t));return}esU(this,e,t)},eUe.zh=function(){return eBa(),tmp},eUe.Bh=function(e){switch(e){case 1:enu(this,0);return;case 2:enl(this,0);return;case 3:enr(this,0);return;case 4:enc(this,0);return;case 5:this.a||(this.a=new O_(e5h,this,5)),eRT(this.a);return;case 6:eOA(this,null);return;case 7:err(this,null);return;case 8:ern(this,null);return;case 9:this.g||(this.g=new Ih(e5v,this,9,10)),eRT(this.g);return;case 10:this.e||(this.e=new Ih(e5v,this,10,9)),eRT(this.e);return;case 11:erO(this,null);return}eoF(this,e)},eUe.Ib=function(){return ex2(this)},eUe.b=0,eUe.c=0,eUe.d=null,eUe.j=0,eUe.k=0,Y6(eZ3,"ElkEdgeSectionImpl",439),eTS(150,115,{105:1,92:1,90:1,147:1,56:1,108:1,49:1,97:1,150:1,114:1,115:1}),eUe._g=function(e,t,n){var r;return 0==e?(this.Ab||(this.Ab=new FQ(tm4,this,0,3)),this.Ab):Qt(this,e-Y1(this.zh()),ee2((r=Pp(eaS(this,16),26))||this.zh(),e),t,n)},eUe.hh=function(e,t,n){var r,i;return 0==t?(this.Ab||(this.Ab=new FQ(tm4,this,0,3)),edF(this.Ab,e,n)):(i=Pp(ee2((r=Pp(eaS(this,16),26))||this.zh(),t),66)).Nj().Qj(this,ehH(this),t-Y1(this.zh()),e,n)},eUe.jh=function(e,t,n){var r,i;return 0==t?(this.Ab||(this.Ab=new FQ(tm4,this,0,3)),ep5(this.Ab,e,n)):(i=Pp(ee2((r=Pp(eaS(this,16),26))||this.zh(),t),66)).Nj().Rj(this,ehH(this),t-Y1(this.zh()),e,n)},eUe.lh=function(e){var t;return 0==e?!!this.Ab&&0!=this.Ab.i:VP(this,e-Y1(this.zh()),ee2((t=Pp(eaS(this,16),26))||this.zh(),e))},eUe.oh=function(e){return eF8(this,e)},eUe.sh=function(e,t){var n;if(0===e){this.Ab||(this.Ab=new FQ(tm4,this,0,3)),eRT(this.Ab),this.Ab||(this.Ab=new FQ(tm4,this,0,3)),Y4(this.Ab,Pp(t,14));return}efL(this,e-Y1(this.zh()),ee2((n=Pp(eaS(this,16),26))||this.zh(),e),t)},eUe.uh=function(e){ehU(this,128,e)},eUe.zh=function(){return eBK(),tgL},eUe.Bh=function(e){var t;if(0===e){this.Ab||(this.Ab=new FQ(tm4,this,0,3)),eRT(this.Ab);return}ec5(this,e-Y1(this.zh()),ee2((t=Pp(eaS(this,16),26))||this.zh(),e))},eUe.Gh=function(){this.Bb|=1},eUe.Hh=function(e){return eDM(this,e)},eUe.Bb=0,Y6(eZ2,"EModelElementImpl",150),eTS(704,150,{105:1,92:1,90:1,471:1,147:1,56:1,108:1,49:1,97:1,150:1,114:1,115:1},cQ),eUe.Ih=function(e,t){return ejZ(this,e,t)},eUe.Jh=function(e){var t,n,r,i,a;if(this.a!=etP(e)||(256&e.Bb)!=0)throw p7(new gL(eZ7+e.zb+eZ5));for(r=$E(e);0!=qt(r.a).i;){if(n=Pp(ejc(r,0,(a=(t=Pp(etj(qt(r.a),0),87)).c,M4(a,88)?Pp(a,26):(eBK(),tgI))),26),em4(n))return i=etP(n).Nh().Jh(n),Pp(i,49).th(e),i;r=$E(n)}return(null!=e.D?e.D:e.B)=="java.util.Map$Entry"?new RO(e):new Pq(e)},eUe.Kh=function(e,t){return eBd(this,e,t)},eUe._g=function(e,t,n){var r;switch(e){case 0:return this.Ab||(this.Ab=new FQ(tm4,this,0,3)),this.Ab;case 1:return this.a}return Qt(this,e-Y1((eBK(),tgM)),ee2((r=Pp(eaS(this,16),26))||tgM,e),t,n)},eUe.hh=function(e,t,n){var r,i;switch(t){case 0:return this.Ab||(this.Ab=new FQ(tm4,this,0,3)),edF(this.Ab,e,n);case 1:return this.a&&(n=Pp(this.a,49).ih(this,4,e5E,n)),ecb(this,Pp(e,235),n)}return(i=Pp(ee2((r=Pp(eaS(this,16),26))||(eBK(),tgM),t),66)).Nj().Qj(this,ehH(this),t-Y1((eBK(),tgM)),e,n)},eUe.jh=function(e,t,n){var r,i;switch(t){case 0:return this.Ab||(this.Ab=new FQ(tm4,this,0,3)),ep5(this.Ab,e,n);case 1:return ecb(this,null,n)}return(i=Pp(ee2((r=Pp(eaS(this,16),26))||(eBK(),tgM),t),66)).Nj().Rj(this,ehH(this),t-Y1((eBK(),tgM)),e,n)},eUe.lh=function(e){var t;switch(e){case 0:return!!this.Ab&&0!=this.Ab.i;case 1:return!!this.a}return VP(this,e-Y1((eBK(),tgM)),ee2((t=Pp(eaS(this,16),26))||tgM,e))},eUe.sh=function(e,t){var n;switch(e){case 0:this.Ab||(this.Ab=new FQ(tm4,this,0,3)),eRT(this.Ab),this.Ab||(this.Ab=new FQ(tm4,this,0,3)),Y4(this.Ab,Pp(t,14));return;case 1:e_B(this,Pp(t,235));return}efL(this,e-Y1((eBK(),tgM)),ee2((n=Pp(eaS(this,16),26))||tgM,e),t)},eUe.zh=function(){return eBK(),tgM},eUe.Bh=function(e){var t;switch(e){case 0:this.Ab||(this.Ab=new FQ(tm4,this,0,3)),eRT(this.Ab);return;case 1:e_B(this,null);return}ec5(this,e-Y1((eBK(),tgM)),ee2((t=Pp(eaS(this,16),26))||tgM,e))},Y6(eZ2,"EFactoryImpl",704),eTS(eXt,704,{105:1,2014:1,92:1,90:1,471:1,147:1,56:1,108:1,49:1,97:1,150:1,114:1,115:1},o1),eUe.Ih=function(e,t){switch(e.yj()){case 12:return Pp(t,146).tg();case 13:return efF(t);default:throw p7(new gL(eZ6+e.ne()+eZ5))}},eUe.Jh=function(e){var t;switch(-1==e.G&&(e.G=(t=etP(e))?ebv(t.Mh(),e):-1),e.G){case 4:return new o0;case 6:return new mS;case 7:return new mk;case 8:return new oX;case 9:return new oJ;case 10:return new oQ;case 11:return new o3;default:throw p7(new gL(eZ7+e.zb+eZ5))}},eUe.Kh=function(e,t){switch(e.yj()){case 13:case 12:return null;default:throw p7(new gL(eZ6+e.ne()+eZ5))}},Y6(eZ3,"ElkGraphFactoryImpl",eXt),eTS(438,150,{105:1,92:1,90:1,147:1,191:1,56:1,108:1,49:1,97:1,150:1,114:1,115:1}),eUe.Wg=function(){var e,t;return null==(t=zr(eNT((e=Pp(eaS(this,16),26))||this.zh())))?(_0(),_0(),tgV):new Lg(this,t)},eUe._g=function(e,t,n){var r;switch(e){case 0:return this.Ab||(this.Ab=new FQ(tm4,this,0,3)),this.Ab;case 1:return this.ne()}return Qt(this,e-Y1(this.zh()),ee2((r=Pp(eaS(this,16),26))||this.zh(),e),t,n)},eUe.lh=function(e){var t;switch(e){case 0:return!!this.Ab&&0!=this.Ab.i;case 1:return null!=this.zb}return VP(this,e-Y1(this.zh()),ee2((t=Pp(eaS(this,16),26))||this.zh(),e))},eUe.sh=function(e,t){var n;switch(e){case 0:this.Ab||(this.Ab=new FQ(tm4,this,0,3)),eRT(this.Ab),this.Ab||(this.Ab=new FQ(tm4,this,0,3)),Y4(this.Ab,Pp(t,14));return;case 1:this.Lh(Lq(t));return}efL(this,e-Y1(this.zh()),ee2((n=Pp(eaS(this,16),26))||this.zh(),e),t)},eUe.zh=function(){return eBK(),tgC},eUe.Bh=function(e){var t;switch(e){case 0:this.Ab||(this.Ab=new FQ(tm4,this,0,3)),eRT(this.Ab);return;case 1:this.Lh(null);return}ec5(this,e-Y1(this.zh()),ee2((t=Pp(eaS(this,16),26))||this.zh(),e))},eUe.ne=function(){return this.zb},eUe.Lh=function(e){er3(this,e)},eUe.Ib=function(){return ecF(this)},eUe.zb=null,Y6(eZ2,"ENamedElementImpl",438),eTS(179,438,{105:1,92:1,90:1,147:1,191:1,56:1,235:1,108:1,49:1,97:1,150:1,179:1,114:1,115:1,675:1},$y),eUe.Qg=function(e){return eg6(this,e)},eUe._g=function(e,t,n){var r;switch(e){case 0:return this.Ab||(this.Ab=new FQ(tm4,this,0,3)),this.Ab;case 1:return this.zb;case 2:return this.yb;case 3:return this.xb;case 4:return this.sb;case 5:return this.rb||(this.rb=new Fq(this,tm9,this)),this.rb;case 6:return this.vb||(this.vb=new Ia(e5E,this,6,7)),this.vb;case 7:if(t)return this.Db>>16==7?Pp(this.Cb,235):null;return zU(this)}return Qt(this,e-Y1((eBK(),tgP)),ee2((r=Pp(eaS(this,16),26))||tgP,e),t,n)},eUe.hh=function(e,t,n){var r,i,a;switch(t){case 0:return this.Ab||(this.Ab=new FQ(tm4,this,0,3)),edF(this.Ab,e,n);case 4:return this.sb&&(n=Pp(this.sb,49).ih(this,1,e5w,n)),ecY(this,Pp(e,471),n);case 5:return this.rb||(this.rb=new Fq(this,tm9,this)),edF(this.rb,e,n);case 6:return this.vb||(this.vb=new Ia(e5E,this,6,7)),edF(this.vb,e,n);case 7:return this.Cb&&(n=(i=this.Db>>16)>=0?eg6(this,n):this.Cb.ih(this,-1-i,null,n)),eDg(this,e,7,n)}return(a=Pp(ee2((r=Pp(eaS(this,16),26))||(eBK(),tgP),t),66)).Nj().Qj(this,ehH(this),t-Y1((eBK(),tgP)),e,n)},eUe.jh=function(e,t,n){var r,i;switch(t){case 0:return this.Ab||(this.Ab=new FQ(tm4,this,0,3)),ep5(this.Ab,e,n);case 4:return ecY(this,null,n);case 5:return this.rb||(this.rb=new Fq(this,tm9,this)),ep5(this.rb,e,n);case 6:return this.vb||(this.vb=new Ia(e5E,this,6,7)),ep5(this.vb,e,n);case 7:return eDg(this,null,7,n)}return(i=Pp(ee2((r=Pp(eaS(this,16),26))||(eBK(),tgP),t),66)).Nj().Rj(this,ehH(this),t-Y1((eBK(),tgP)),e,n)},eUe.lh=function(e){var t;switch(e){case 0:return!!this.Ab&&0!=this.Ab.i;case 1:return null!=this.zb;case 2:return null!=this.yb;case 3:return null!=this.xb;case 4:return!!this.sb;case 5:return!!this.rb&&0!=this.rb.i;case 6:return!!this.vb&&0!=this.vb.i;case 7:return!!zU(this)}return VP(this,e-Y1((eBK(),tgP)),ee2((t=Pp(eaS(this,16),26))||tgP,e))},eUe.oh=function(e){var t;return(t=eAd(this,e))||eF8(this,e)},eUe.sh=function(e,t){var n;switch(e){case 0:this.Ab||(this.Ab=new FQ(tm4,this,0,3)),eRT(this.Ab),this.Ab||(this.Ab=new FQ(tm4,this,0,3)),Y4(this.Ab,Pp(t,14));return;case 1:er3(this,Lq(t));return;case 2:er6(this,Lq(t));return;case 3:er4(this,Lq(t));return;case 4:e_9(this,Pp(t,471));return;case 5:this.rb||(this.rb=new Fq(this,tm9,this)),eRT(this.rb),this.rb||(this.rb=new Fq(this,tm9,this)),Y4(this.rb,Pp(t,14));return;case 6:this.vb||(this.vb=new Ia(e5E,this,6,7)),eRT(this.vb),this.vb||(this.vb=new Ia(e5E,this,6,7)),Y4(this.vb,Pp(t,14));return}efL(this,e-Y1((eBK(),tgP)),ee2((n=Pp(eaS(this,16),26))||tgP,e),t)},eUe.vh=function(e){var t,n;if(e&&this.rb)for(n=new Ow(this.rb);n.e!=n.i.gc();)t=epH(n),M4(t,351)&&(Pp(t,351).w=null);ehU(this,64,e)},eUe.zh=function(){return eBK(),tgP},eUe.Bh=function(e){var t;switch(e){case 0:this.Ab||(this.Ab=new FQ(tm4,this,0,3)),eRT(this.Ab);return;case 1:er3(this,null);return;case 2:er6(this,null);return;case 3:er4(this,null);return;case 4:e_9(this,null);return;case 5:this.rb||(this.rb=new Fq(this,tm9,this)),eRT(this.rb);return;case 6:this.vb||(this.vb=new Ia(e5E,this,6,7)),eRT(this.vb);return}ec5(this,e-Y1((eBK(),tgP)),ee2((t=Pp(eaS(this,16),26))||tgP,e))},eUe.Gh=function(){egb(this)},eUe.Mh=function(){return this.rb||(this.rb=new Fq(this,tm9,this)),this.rb},eUe.Nh=function(){return this.sb},eUe.Oh=function(){return this.ub},eUe.Ph=function(){return this.xb},eUe.Qh=function(){return this.yb},eUe.Rh=function(e){this.ub=e},eUe.Ib=function(){var e;return(64&this.Db)!=0?ecF(this):(e=new O1(ecF(this)),e.a+=" (nsURI: ",xk(e,this.yb),e.a+=", nsPrefix: ",xk(e,this.xb),e.a+=")",e.a)},eUe.xb=null,eUe.yb=null,Y6(eZ2,"EPackageImpl",179),eTS(555,179,{105:1,2016:1,555:1,92:1,90:1,147:1,191:1,56:1,235:1,108:1,49:1,97:1,150:1,179:1,114:1,115:1,675:1},eTv),eUe.q=!1,eUe.r=!1;var e5T=!1;Y6(eZ3,"ElkGraphPackageImpl",555),eTS(354,724,{105:1,413:1,160:1,137:1,470:1,354:1,94:1,92:1,90:1,56:1,108:1,49:1,97:1,114:1,115:1},o0),eUe.Qg=function(e){return eg0(this,e)},eUe._g=function(e,t,n){switch(e){case 7:return zH(this);case 8:return this.a}return efN(this,e,t,n)},eUe.hh=function(e,t,n){var r;return 7===t?(this.Cb&&(n=(r=this.Db>>16)>=0?eg0(this,n):this.Cb.ih(this,-1-r,null,n)),j2(this,Pp(e,160),n)):ew0(this,e,t,n)},eUe.jh=function(e,t,n){return 7==t?j2(this,null,n):ea8(this,e,t,n)},eUe.lh=function(e){switch(e){case 7:return!!zH(this);case 8:return!IE("",this.a)}return ef9(this,e)},eUe.sh=function(e,t){switch(e){case 7:eAu(this,Pp(t,160));return;case 8:eri(this,Lq(t));return}eym(this,e,t)},eUe.zh=function(){return eBa(),tmm},eUe.Bh=function(e){switch(e){case 7:eAu(this,null);return;case 8:eri(this,"");return}edS(this,e)},eUe.Ib=function(){return eE1(this)},eUe.a="",Y6(eZ3,"ElkLabelImpl",354),eTS(239,725,{105:1,413:1,82:1,160:1,33:1,470:1,239:1,94:1,92:1,90:1,56:1,108:1,49:1,97:1,114:1,115:1},mS),eUe.Qg=function(e){return evs(this,e)},eUe._g=function(e,t,n){switch(e){case 9:return this.c||(this.c=new FQ(e5x,this,9,9)),this.c;case 10:return this.a||(this.a=new FQ(e5k,this,10,11)),this.a;case 11:return z$(this);case 12:return this.b||(this.b=new FQ(e5g,this,12,3)),this.b;case 13:return OQ(),this.a||(this.a=new FQ(e5k,this,10,11)),this.a.i>0}return ebQ(this,e,t,n)},eUe.hh=function(e,t,n){var r;switch(t){case 9:return this.c||(this.c=new FQ(e5x,this,9,9)),edF(this.c,e,n);case 10:return this.a||(this.a=new FQ(e5k,this,10,11)),edF(this.a,e,n);case 11:return this.Cb&&(n=(r=this.Db>>16)>=0?evs(this,n):this.Cb.ih(this,-1-r,null,n)),C4(this,Pp(e,33),n);case 12:return this.b||(this.b=new FQ(e5g,this,12,3)),edF(this.b,e,n)}return evZ(this,e,t,n)},eUe.jh=function(e,t,n){switch(t){case 9:return this.c||(this.c=new FQ(e5x,this,9,9)),ep5(this.c,e,n);case 10:return this.a||(this.a=new FQ(e5k,this,10,11)),ep5(this.a,e,n);case 11:return C4(this,null,n);case 12:return this.b||(this.b=new FQ(e5g,this,12,3)),ep5(this.b,e,n)}return evX(this,e,t,n)},eUe.lh=function(e){switch(e){case 9:return!!this.c&&0!=this.c.i;case 10:return!!this.a&&0!=this.a.i;case 11:return!!z$(this);case 12:return!!this.b&&0!=this.b.i;case 13:return this.a||(this.a=new FQ(e5k,this,10,11)),this.a.i>0}return esM(this,e)},eUe.sh=function(e,t){switch(e){case 9:this.c||(this.c=new FQ(e5x,this,9,9)),eRT(this.c),this.c||(this.c=new FQ(e5x,this,9,9)),Y4(this.c,Pp(t,14));return;case 10:this.a||(this.a=new FQ(e5k,this,10,11)),eRT(this.a),this.a||(this.a=new FQ(e5k,this,10,11)),Y4(this.a,Pp(t,14));return;case 11:eO$(this,Pp(t,33));return;case 12:this.b||(this.b=new FQ(e5g,this,12,3)),eRT(this.b),this.b||(this.b=new FQ(e5g,this,12,3)),Y4(this.b,Pp(t,14));return}eTH(this,e,t)},eUe.zh=function(){return eBa(),tmg},eUe.Bh=function(e){switch(e){case 9:this.c||(this.c=new FQ(e5x,this,9,9)),eRT(this.c);return;case 10:this.a||(this.a=new FQ(e5k,this,10,11)),eRT(this.a);return;case 11:eO$(this,null);return;case 12:this.b||(this.b=new FQ(e5g,this,12,3)),eRT(this.b);return}ep2(this,e)},eUe.Ib=function(){return eC4(this)},Y6(eZ3,"ElkNodeImpl",239),eTS(186,725,{105:1,413:1,82:1,160:1,118:1,470:1,186:1,94:1,92:1,90:1,56:1,108:1,49:1,97:1,114:1,115:1},mk),eUe.Qg=function(e){return eg2(this,e)},eUe._g=function(e,t,n){return 9==e?zY(this):ebQ(this,e,t,n)},eUe.hh=function(e,t,n){var r;return 9===t?(this.Cb&&(n=(r=this.Db>>16)>=0?eg2(this,n):this.Cb.ih(this,-1-r,null,n)),Cl(this,Pp(e,33),n)):evZ(this,e,t,n)},eUe.jh=function(e,t,n){return 9==t?Cl(this,null,n):evX(this,e,t,n)},eUe.lh=function(e){return 9==e?!!zY(this):esM(this,e)},eUe.sh=function(e,t){if(9===e){eOL(this,Pp(t,33));return}eTH(this,e,t)},eUe.zh=function(){return eBa(),tmv},eUe.Bh=function(e){if(9===e){eOL(this,null);return}ep2(this,e)},eUe.Ib=function(){return eC6(this)},Y6(eZ3,"ElkPortImpl",186);var e5M=RL(eX_,"BasicEMap/Entry");eTS(1092,115,{105:1,42:1,92:1,90:1,133:1,56:1,108:1,49:1,97:1,114:1,115:1},o3),eUe.Fb=function(e){return this===e},eUe.cd=function(){return this.b},eUe.Hb=function(){return Ao(this)},eUe.Uh=function(e){era(this,Pp(e,146))},eUe._g=function(e,t,n){switch(e){case 0:return this.b;case 1:return this.c}return ebl(this,e,t,n)},eUe.lh=function(e){switch(e){case 0:return!!this.b;case 1:return null!=this.c}return epY(this,e)},eUe.sh=function(e,t){switch(e){case 0:era(this,Pp(t,146));return;case 1:eru(this,t);return}eS6(this,e,t)},eUe.zh=function(){return eBa(),tmy},eUe.Bh=function(e){switch(e){case 0:era(this,null);return;case 1:eru(this,null);return}eSi(this,e)},eUe.Sh=function(){var e;return -1==this.a&&(e=this.b,this.a=e?esj(e):0),this.a},eUe.dd=function(){return this.c},eUe.Th=function(e){this.a=e},eUe.ed=function(e){var t;return t=this.c,eru(this,e),t},eUe.Ib=function(){var e;return(64&this.Db)!=0?eMT(this):(xM(xM(xM(e=new vc,this.b?this.b.tg():eUg),eGH),Ae(this.c)),e.a)},eUe.a=-1,eUe.c=null;var e5O=Y6(eZ3,"ElkPropertyToValueMapEntryImpl",1092);eTS(984,1,{},o5),Y6(eXk,"JsonAdapter",984),eTS(210,60,eHr,gK),Y6(eXk,"JsonImportException",210),eTS(857,1,{},eg5),Y6(eXk,"JsonImporter",857),eTS(891,1,{},kP),Y6(eXk,"JsonImporter/lambda$0$Type",891),eTS(892,1,{},kR),Y6(eXk,"JsonImporter/lambda$1$Type",892),eTS(900,1,{},h7),Y6(eXk,"JsonImporter/lambda$10$Type",900),eTS(902,1,{},kj),Y6(eXk,"JsonImporter/lambda$11$Type",902),eTS(903,1,{},kF),Y6(eXk,"JsonImporter/lambda$12$Type",903),eTS(909,1,{},HE),Y6(eXk,"JsonImporter/lambda$13$Type",909),eTS(908,1,{},H_),Y6(eXk,"JsonImporter/lambda$14$Type",908),eTS(904,1,{},kY),Y6(eXk,"JsonImporter/lambda$15$Type",904),eTS(905,1,{},kB),Y6(eXk,"JsonImporter/lambda$16$Type",905),eTS(906,1,{},kU),Y6(eXk,"JsonImporter/lambda$17$Type",906),eTS(907,1,{},kH),Y6(eXk,"JsonImporter/lambda$18$Type",907),eTS(912,1,{},pe),Y6(eXk,"JsonImporter/lambda$19$Type",912),eTS(893,1,{},pt),Y6(eXk,"JsonImporter/lambda$2$Type",893),eTS(910,1,{},pn),Y6(eXk,"JsonImporter/lambda$20$Type",910),eTS(911,1,{},pr),Y6(eXk,"JsonImporter/lambda$21$Type",911),eTS(915,1,{},pi),Y6(eXk,"JsonImporter/lambda$22$Type",915),eTS(913,1,{},pa),Y6(eXk,"JsonImporter/lambda$23$Type",913),eTS(914,1,{},po),Y6(eXk,"JsonImporter/lambda$24$Type",914),eTS(917,1,{},ps),Y6(eXk,"JsonImporter/lambda$25$Type",917),eTS(916,1,{},pu),Y6(eXk,"JsonImporter/lambda$26$Type",916),eTS(918,1,eUF,k$),eUe.td=function(e){JH(this.b,this.a,Lq(e))},Y6(eXk,"JsonImporter/lambda$27$Type",918),eTS(919,1,eUF,kz),eUe.td=function(e){J$(this.b,this.a,Lq(e))},Y6(eXk,"JsonImporter/lambda$28$Type",919),eTS(920,1,{},kG),Y6(eXk,"JsonImporter/lambda$29$Type",920),eTS(896,1,{},pc),Y6(eXk,"JsonImporter/lambda$3$Type",896),eTS(921,1,{},kW),Y6(eXk,"JsonImporter/lambda$30$Type",921),eTS(922,1,{},pl),Y6(eXk,"JsonImporter/lambda$31$Type",922),eTS(923,1,{},pf),Y6(eXk,"JsonImporter/lambda$32$Type",923),eTS(924,1,{},pd),Y6(eXk,"JsonImporter/lambda$33$Type",924),eTS(925,1,{},ph),Y6(eXk,"JsonImporter/lambda$34$Type",925),eTS(859,1,{},pp),Y6(eXk,"JsonImporter/lambda$35$Type",859),eTS(929,1,{},N9),Y6(eXk,"JsonImporter/lambda$36$Type",929),eTS(926,1,eUF,pb),eUe.td=function(e){qW(this.a,Pp(e,469))},Y6(eXk,"JsonImporter/lambda$37$Type",926),eTS(927,1,eUF,k0),eUe.td=function(e){xC(this.a,this.b,Pp(e,202))},Y6(eXk,"JsonImporter/lambda$38$Type",927),eTS(928,1,eUF,k2),eUe.td=function(e){xI(this.a,this.b,Pp(e,202))},Y6(eXk,"JsonImporter/lambda$39$Type",928),eTS(894,1,{},pm),Y6(eXk,"JsonImporter/lambda$4$Type",894),eTS(930,1,eUF,pg),eUe.td=function(e){qK(this.a,Pp(e,8))},Y6(eXk,"JsonImporter/lambda$40$Type",930),eTS(895,1,{},pv),Y6(eXk,"JsonImporter/lambda$5$Type",895),eTS(899,1,{},py),Y6(eXk,"JsonImporter/lambda$6$Type",899),eTS(897,1,{},pw),Y6(eXk,"JsonImporter/lambda$7$Type",897),eTS(898,1,{},p_),Y6(eXk,"JsonImporter/lambda$8$Type",898),eTS(901,1,{},pE),Y6(eXk,"JsonImporter/lambda$9$Type",901),eTS(948,1,eUF,pS),eUe.td=function(e){BC(this.a,new B_(Lq(e)))},Y6(eXk,"JsonMetaDataConverter/lambda$0$Type",948),eTS(949,1,eUF,pk),eUe.td=function(e){Bm(this.a,Pp(e,237))},Y6(eXk,"JsonMetaDataConverter/lambda$1$Type",949),eTS(950,1,eUF,px),eUe.td=function(e){GR(this.a,Pp(e,149))},Y6(eXk,"JsonMetaDataConverter/lambda$2$Type",950),eTS(951,1,eUF,pT),eUe.td=function(e){Bg(this.a,Pp(e,175))},Y6(eXk,"JsonMetaDataConverter/lambda$3$Type",951),eTS(237,22,{3:1,35:1,22:1,237:1},k1);var e5A=enw(ezx,"GraphFeature",237,e1G,etM,N1);eTS(13,1,{35:1,146:1},pO,Cm,xX,T2),eUe.wd=function(e){return Oo(this,Pp(e,146))},eUe.Fb=function(e){return $k(this,e)},eUe.wg=function(){return epB(this)},eUe.tg=function(){return this.b},eUe.Hb=function(){return ebA(this.b)},eUe.Ib=function(){return this.b},Y6(ezx,"Property",13),eTS(818,1,e$C,pM),eUe.ue=function(e,t){return elW(this,Pp(e,94),Pp(t,94))},eUe.Fb=function(e){return this===e},eUe.ve=function(){return new fZ(this)},Y6(ezx,"PropertyHolderComparator",818),eTS(695,1,eUE,pL),eUe.Nb=function(e){F9(this,e)},eUe.Pb=function(){return JZ(this)},eUe.Qb=function(){yI()},eUe.Ob=function(){return!!this.a},Y6(eXY,"ElkGraphUtil/AncestorIterator",695);var e5L=RL(eX_,"EList");eTS(67,52,{20:1,28:1,52:1,14:1,15:1,67:1,58:1}),eUe.Vc=function(e,t){elm(this,e,t)},eUe.Fc=function(e){return JL(this,e)},eUe.Wc=function(e,t){return eo0(this,e,t)},eUe.Gc=function(e){return Y4(this,e)},eUe.Zh=function(){return new AY(this)},eUe.$h=function(){return new AB(this)},eUe._h=function(e){return enH(this,e)},eUe.ai=function(){return!0},eUe.bi=function(e,t){},eUe.ci=function(){},eUe.di=function(e,t){X9(this,e,t)},eUe.ei=function(e,t,n){},eUe.fi=function(e,t){},eUe.gi=function(e,t,n){},eUe.Fb=function(e){return eCc(this,e)},eUe.Hb=function(){return eov(this)},eUe.hi=function(){return!1},eUe.Kc=function(){return new Ow(this)},eUe.Yc=function(){return new AF(this)},eUe.Zc=function(e){var t;if(t=this.gc(),e<0||e>t)throw p7(new Ii(e,t));return new YC(this,e)},eUe.ji=function(e,t){this.ii(e,this.Xc(t))},eUe.Mc=function(e){return eeu(this,e)},eUe.li=function(e,t){return t},eUe._c=function(e,t){return eby(this,e,t)},eUe.Ib=function(){return efq(this)},eUe.ni=function(){return!0},eUe.oi=function(e,t){return euu(this,t)},Y6(eX_,"AbstractEList",67),eTS(63,67,eXz,o7,eta,eiP),eUe.Vh=function(e,t){return ew2(this,e,t)},eUe.Wh=function(e){return emp(this,e)},eUe.Xh=function(e,t){ecW(this,e,t)},eUe.Yh=function(e){Zz(this,e)},eUe.pi=function(e){return J6(this,e)},eUe.$b=function(){ZG(this)},eUe.Hc=function(e){return ev8(this,e)},eUe.Xb=function(e){return etj(this,e)},eUe.qi=function(e){var t,n,r;++this.j,e>(n=null==this.g?0:this.g.length)&&(r=this.g,(t=n+(n/2|0)+4)=0&&(this.$c(t),!0)},eUe.mi=function(e,t){return this.Ui(e,this.oi(e,t))},eUe.gc=function(){return this.Vi()},eUe.Pc=function(){return this.Wi()},eUe.Qc=function(e){return this.Xi(e)},eUe.Ib=function(){return this.Yi()},Y6(eX_,"DelegatingEList",1995),eTS(1996,1995,eJk),eUe.Vh=function(e,t){return eD1(this,e,t)},eUe.Wh=function(e){return this.Vh(this.Vi(),e)},eUe.Xh=function(e,t){eTf(this,e,t)},eUe.Yh=function(e){exq(this,e)},eUe.ai=function(){return!this.bj()},eUe.$b=function(){eRP(this)},eUe.Zi=function(e,t,n,r,i){return new $P(this,e,t,n,r,i)},eUe.$i=function(e){eam(this.Ai(),e)},eUe._i=function(){return null},eUe.aj=function(){return -1},eUe.Ai=function(){return null},eUe.bj=function(){return!1},eUe.cj=function(e,t){return t},eUe.dj=function(e,t){return t},eUe.ej=function(){return!1},eUe.fj=function(){return!this.Ri()},eUe.ii=function(e,t){var n,r;return this.ej()?(r=this.fj(),n=e_R(this,e,t),this.$i(this.Zi(7,ell(t),n,e,r)),n):e_R(this,e,t)},eUe.$c=function(e){var t,n,r,i;return this.ej()?(n=null,r=this.fj(),t=this.Zi(4,i=RC(this,e),null,e,r),this.bj()&&i?(n=this.dj(i,n))?(n.Ei(t),n.Fi()):this.$i(t):n?(n.Ei(t),n.Fi()):this.$i(t),i):(i=RC(this,e),this.bj()&&i&&(n=this.dj(i,null))&&n.Fi(),i)},eUe.mi=function(e,t){return eD0(this,e,t)},Y6(eZK,"DelegatingNotifyingListImpl",1996),eTS(143,1,eJx),eUe.Ei=function(e){return ey7(this,e)},eUe.Fi=function(){QU(this)},eUe.xi=function(){return this.d},eUe._i=function(){return null},eUe.gj=function(){return null},eUe.yi=function(e){return -1},eUe.zi=function(){return eLo(this)},eUe.Ai=function(){return null},eUe.Bi=function(){return eLs(this)},eUe.Ci=function(){return this.o<0?this.o<-2?-2-this.o-1:-1:this.o},eUe.hj=function(){return!1},eUe.Di=function(e){var t,n,r,i,a,o,s,u,c,l,f;switch(this.d){case 1:case 2:switch(i=e.xi()){case 1:case 2:if(xc(a=e.Ai())===xc(this.Ai())&&this.yi(null)==e.yi(null))return this.g=e.zi(),1==e.xi()&&(this.d=1),!0}case 4:if(4===(i=e.xi())&&xc(a=e.Ai())===xc(this.Ai())&&this.yi(null)==e.yi(null))return c=eju(this),u=this.o<0?this.o<-2?-2-this.o-1:-1:this.o,o=e.Ci(),this.d=6,f=new eta(2),u<=o?(JL(f,this.n),JL(f,e.Bi()),this.g=eow(vx(ty_,1),eHT,25,15,[this.o=u,o+1])):(JL(f,e.Bi()),JL(f,this.n),this.g=eow(vx(ty_,1),eHT,25,15,[this.o=o,u])),this.n=f,c||(this.o=-2-this.o-1),!0;break;case 6:if(4===(i=e.xi())&&xc(a=e.Ai())===xc(this.Ai())&&this.yi(null)==e.yi(null)){for(c=eju(this),o=e.Ci(),r=Je(ty_,eHT,25,(l=Pp(this.g,48)).length+1,15,1),t=0;t>>0).toString(16)),r.a+=" (eventType: ",this.d){case 1:r.a+="SET";break;case 2:r.a+="UNSET";break;case 3:r.a+="ADD";break;case 5:r.a+="ADD_MANY";break;case 4:r.a+="REMOVE";break;case 6:r.a+="REMOVE_MANY";break;case 7:r.a+="MOVE";break;case 8:r.a+="REMOVING_ADAPTER";break;case 9:r.a+="RESOLVE";break;default:yz(r,this.d)}if(eIb(this)&&(r.a+=", touch: true"),r.a+=", position: ",yz(r,this.o<0?this.o<-2?-2-this.o-1:-1:this.o),r.a+=", notifier: ",xS(r,this.Ai()),r.a+=", feature: ",xS(r,this._i()),r.a+=", oldValue: ",xS(r,eLs(this)),r.a+=", newValue: ",6==this.d&&M4(this.g,48)){for(n=Pp(this.g,48),r.a+="[",e=0;e10?(this.b&&this.c.j==this.a||(this.b=new Rq(this),this.a=this.j),w0(this.b,e)):ev8(this,e)},eUe.ni=function(){return!0},eUe.a=0,Y6(eX_,"AbstractEList/1",953),eTS(295,73,eHZ,Ii),Y6(eX_,"AbstractEList/BasicIndexOutOfBoundsException",295),eTS(40,1,eUE,Ow),eUe.Nb=function(e){F9(this,e)},eUe.mj=function(){if(this.i.j!=this.f)throw p7(new bA)},eUe.nj=function(){return epH(this)},eUe.Ob=function(){return this.e!=this.i.gc()},eUe.Pb=function(){return this.nj()},eUe.Qb=function(){ey_(this)},eUe.e=0,eUe.f=0,eUe.g=-1,Y6(eX_,"AbstractEList/EIterator",40),eTS(278,40,eUC,AF,YC),eUe.Qb=function(){ey_(this)},eUe.Rb=function(e){edq(this,e)},eUe.oj=function(){var e;try{return e=this.d.Xb(--this.e),this.mj(),this.g=this.e,e}catch(t){if(t=eoa(t),M4(t,73))throw this.mj(),p7(new bC);throw p7(t)}},eUe.pj=function(e){emE(this,e)},eUe.Sb=function(){return 0!=this.e},eUe.Tb=function(){return this.e},eUe.Ub=function(){return this.oj()},eUe.Vb=function(){return this.e-1},eUe.Wb=function(e){this.pj(e)},Y6(eX_,"AbstractEList/EListIterator",278),eTS(341,40,eUE,AY),eUe.nj=function(){return ep$(this)},eUe.Qb=function(){throw p7(new bO)},Y6(eX_,"AbstractEList/NonResolvingEIterator",341),eTS(385,278,eUC,AB,IB),eUe.Rb=function(e){throw p7(new bO)},eUe.nj=function(){var e;try{return e=this.c.ki(this.e),this.mj(),this.g=this.e++,e}catch(t){if(t=eoa(t),M4(t,73))throw this.mj(),p7(new bC);throw p7(t)}},eUe.oj=function(){var e;try{return e=this.c.ki(--this.e),this.mj(),this.g=this.e,e}catch(t){if(t=eoa(t),M4(t,73))throw this.mj(),p7(new bC);throw p7(t)}},eUe.Qb=function(){throw p7(new bO)},eUe.Wb=function(e){throw p7(new bO)},Y6(eX_,"AbstractEList/NonResolvingEListIterator",385),eTS(1982,67,eJO),eUe.Vh=function(e,t){var n,r,i,a,o,s,u,c,l,f,d;if(0==(i=t.gc()))return++this.j,!1;for(r=eue(this,d=(l=null==(c=Pp(eaS(this.a,4),126))?0:c.length)+i),(f=l-e)>0&&ePD(c,e,r,e+i,f),u=t.Kc(),o=0;on)throw p7(new Ii(e,n));return new Uu(this,e)},eUe.$b=function(){var e,t;++this.j,t=null==(e=Pp(eaS(this.a,4),126))?0:e.length,eps(this,null),X9(this,t,e)},eUe.Hc=function(e){var t,n,r,i,a;if(null!=(t=Pp(eaS(this.a,4),126))){if(null!=e){for(i=0,a=(r=t).length;i=(n=null==(t=Pp(eaS(this.a,4),126))?0:t.length))throw p7(new Ii(e,n));return t[e]},eUe.Xc=function(e){var t,n,r;if(null!=(t=Pp(eaS(this.a,4),126))){if(null!=e){for(n=0,r=t.length;nn)throw p7(new Ii(e,n));return new Us(this,e)},eUe.ii=function(e,t){var n,r,i;if(i=null==(n=ehc(this))?0:n.length,e>=i)throw p7(new gE(eXU+e+eXH+i));if(t>=i)throw p7(new gE(eX$+t+eXH+i));return r=n[t],e!=t&&(e0&&ePD(e,0,t,0,n),t},eUe.Qc=function(e){var t,n,r;return(r=null==(t=Pp(eaS(this.a,4),126))?0:t.length)>0&&(e.lengthr&&Bc(e,r,null),e},Y6(eX_,"ArrayDelegatingEList",1982),eTS(1038,40,eUE,Zl),eUe.mj=function(){if(this.b.j!=this.f||xc(Pp(eaS(this.b.a,4),126))!==xc(this.a))throw p7(new bA)},eUe.Qb=function(){ey_(this),this.a=Pp(eaS(this.b.a,4),126)},Y6(eX_,"ArrayDelegatingEList/EIterator",1038),eTS(706,278,eUC,FK,Us),eUe.mj=function(){if(this.b.j!=this.f||xc(Pp(eaS(this.b.a,4),126))!==xc(this.a))throw p7(new bA)},eUe.pj=function(e){emE(this,e),this.a=Pp(eaS(this.b.a,4),126)},eUe.Qb=function(){ey_(this),this.a=Pp(eaS(this.b.a,4),126)},Y6(eX_,"ArrayDelegatingEList/EListIterator",706),eTS(1039,341,eUE,Zf),eUe.mj=function(){if(this.b.j!=this.f||xc(Pp(eaS(this.b.a,4),126))!==xc(this.a))throw p7(new bA)},Y6(eX_,"ArrayDelegatingEList/NonResolvingEIterator",1039),eTS(707,385,eUC,FV,Uu),eUe.mj=function(){if(this.b.j!=this.f||xc(Pp(eaS(this.b.a,4),126))!==xc(this.a))throw p7(new bA)},Y6(eX_,"ArrayDelegatingEList/NonResolvingEListIterator",707),eTS(606,295,eHZ,xJ),Y6(eX_,"BasicEList/BasicIndexOutOfBoundsException",606),eTS(696,63,eXz,xt),eUe.Vc=function(e,t){throw p7(new bO)},eUe.Fc=function(e){throw p7(new bO)},eUe.Wc=function(e,t){throw p7(new bO)},eUe.Gc=function(e){throw p7(new bO)},eUe.$b=function(){throw p7(new bO)},eUe.qi=function(e){throw p7(new bO)},eUe.Kc=function(){return this.Zh()},eUe.Yc=function(){return this.$h()},eUe.Zc=function(e){return this._h(e)},eUe.ii=function(e,t){throw p7(new bO)},eUe.ji=function(e,t){throw p7(new bO)},eUe.$c=function(e){throw p7(new bO)},eUe.Mc=function(e){throw p7(new bO)},eUe._c=function(e,t){throw p7(new bO)},Y6(eX_,"BasicEList/UnmodifiableEList",696),eTS(705,1,{3:1,20:1,14:1,15:1,58:1,589:1}),eUe.Vc=function(e,t){Mq(this,e,Pp(t,42))},eUe.Fc=function(e){return LA(this,Pp(e,42))},eUe.Jc=function(e){qX(this,e)},eUe.Xb=function(e){return Pp(etj(this.c,e),133)},eUe.ii=function(e,t){return Pp(this.c.ii(e,t),42)},eUe.ji=function(e,t){MZ(this,e,Pp(t,42))},eUe.Lc=function(){return new R1(null,new Gq(this,16))},eUe.$c=function(e){return Pp(this.c.$c(e),42)},eUe._c=function(e,t){return YV(this,e,Pp(t,42))},eUe.ad=function(e){er9(this,e)},eUe.Nc=function(){return new Gq(this,16)},eUe.Oc=function(){return new R1(null,new Gq(this,16))},eUe.Wc=function(e,t){return this.c.Wc(e,t)},eUe.Gc=function(e){return this.c.Gc(e)},eUe.$b=function(){this.c.$b()},eUe.Hc=function(e){return this.c.Hc(e)},eUe.Ic=function(e){return eot(this.c,e)},eUe.qj=function(){var e,t,n;if(null==this.d){for(this.d=Je(e5C,eJA,63,2*this.f+1,0,1),n=this.e,this.f=0,t=this.c.Kc();t.e!=t.i.gc();)ebB(this,e=Pp(t.nj(),133));this.e=n}},eUe.Fb=function(e){return Ij(this,e)},eUe.Hb=function(){return eov(this.c)},eUe.Xc=function(e){return this.c.Xc(e)},eUe.rj=function(){this.c=new pC(this)},eUe.dc=function(){return 0==this.f},eUe.Kc=function(){return this.c.Kc()},eUe.Yc=function(){return this.c.Yc()},eUe.Zc=function(e){return this.c.Zc(e)},eUe.sj=function(){return X5(this)},eUe.tj=function(e,t,n){return new N7(e,t,n)},eUe.uj=function(){return new st},eUe.Mc=function(e){return en$(this,e)},eUe.gc=function(){return this.f},eUe.bd=function(e,t){return new Gz(this.c,e,t)},eUe.Pc=function(){return this.c.Pc()},eUe.Qc=function(e){return this.c.Qc(e)},eUe.Ib=function(){return efq(this.c)},eUe.e=0,eUe.f=0,Y6(eX_,"BasicEMap",705),eTS(1033,63,eXz,pC),eUe.bi=function(e,t){bH(this,Pp(t,133))},eUe.ei=function(e,t,n){var r;++(r=this,Pp(t,133),r).a.e},eUe.fi=function(e,t){b$(this,Pp(t,133))},eUe.gi=function(e,t,n){AO(this,Pp(t,133),Pp(n,133))},eUe.di=function(e,t){eac(this.a)},Y6(eX_,"BasicEMap/1",1033),eTS(1034,63,eXz,st),eUe.ri=function(e){return Je(e5R,eJL,612,e,0,1)},Y6(eX_,"BasicEMap/2",1034),eTS(1035,eUT,eUM,pI),eUe.$b=function(){this.a.c.$b()},eUe.Hc=function(e){return edG(this.a,e)},eUe.Kc=function(){return 0==this.a.f?(LF(),tmB.a):new yd(this.a)},eUe.Mc=function(e){var t;return t=this.a.f,ehx(this.a,e),this.a.f!=t},eUe.gc=function(){return this.a.f},Y6(eX_,"BasicEMap/3",1035),eTS(1036,28,eUx,pD),eUe.$b=function(){this.a.c.$b()},eUe.Hc=function(e){return eCl(this.a,e)},eUe.Kc=function(){return 0==this.a.f?(LF(),tmB.a):new yh(this.a)},eUe.gc=function(){return this.a.f},Y6(eX_,"BasicEMap/4",1036),eTS(1037,eUT,eUM,pN),eUe.$b=function(){this.a.c.$b()},eUe.Hc=function(e){var t,n,r,i,a,o,s,u,c;if(this.a.f>0&&M4(e,42)&&(this.a.qj(),i=null==(s=(u=Pp(e,42)).cd())?0:esj(s),a=Cb(this.a,i),t=this.a.d[a])){for(o=0,n=Pp(t.g,367),c=t.i;o"+this.c},eUe.a=0;var e5R=Y6(eX_,"BasicEMap/EntryImpl",612);eTS(536,1,{},o2),Y6(eX_,"BasicEMap/View",536),eTS(768,1,{}),eUe.Fb=function(e){return eT$((Hj(),e2r),e)},eUe.Hb=function(){return esS((Hj(),e2r))},eUe.Ib=function(){return e_F((Hj(),e2r))},Y6(eX_,"ECollections/BasicEmptyUnmodifiableEList",768),eTS(1312,1,eUC,sn),eUe.Nb=function(e){F9(this,e)},eUe.Rb=function(e){throw p7(new bO)},eUe.Ob=function(){return!1},eUe.Sb=function(){return!1},eUe.Pb=function(){throw p7(new bC)},eUe.Tb=function(){return 0},eUe.Ub=function(){throw p7(new bC)},eUe.Vb=function(){return -1},eUe.Qb=function(){throw p7(new bO)},eUe.Wb=function(e){throw p7(new bO)},Y6(eX_,"ECollections/BasicEmptyUnmodifiableEList/1",1312),eTS(1310,768,{20:1,14:1,15:1,58:1},mx),eUe.Vc=function(e,t){y6()},eUe.Fc=function(e){return y5()},eUe.Wc=function(e,t){return y8()},eUe.Gc=function(e){return y9()},eUe.$b=function(){y7()},eUe.Hc=function(e){return!1},eUe.Ic=function(e){return!1},eUe.Jc=function(e){qX(this,e)},eUe.Xb=function(e){return xY((Hj(),e)),null},eUe.Xc=function(e){return -1},eUe.dc=function(){return!0},eUe.Kc=function(){return this.a},eUe.Yc=function(){return this.a},eUe.Zc=function(e){return this.a},eUe.ii=function(e,t){return we()},eUe.ji=function(e,t){wt()},eUe.Lc=function(){return new R1(null,new Gq(this,16))},eUe.$c=function(e){return wn()},eUe.Mc=function(e){return wr()},eUe._c=function(e,t){return wi()},eUe.gc=function(){return 0},eUe.ad=function(e){er9(this,e)},eUe.Nc=function(){return new Gq(this,16)},eUe.Oc=function(){return new R1(null,new Gq(this,16))},eUe.bd=function(e,t){return Hj(),new Gz(e2r,e,t)},eUe.Pc=function(){return Fn((Hj(),e2r))},eUe.Qc=function(e){return Hj(),emk(e2r,e)},Y6(eX_,"ECollections/EmptyUnmodifiableEList",1310),eTS(1311,768,{20:1,14:1,15:1,58:1,589:1},mT),eUe.Vc=function(e,t){y6()},eUe.Fc=function(e){return y5()},eUe.Wc=function(e,t){return y8()},eUe.Gc=function(e){return y9()},eUe.$b=function(){y7()},eUe.Hc=function(e){return!1},eUe.Ic=function(e){return!1},eUe.Jc=function(e){qX(this,e)},eUe.Xb=function(e){return xY((Hj(),e)),null},eUe.Xc=function(e){return -1},eUe.dc=function(){return!0},eUe.Kc=function(){return this.a},eUe.Yc=function(){return this.a},eUe.Zc=function(e){return this.a},eUe.ii=function(e,t){return we()},eUe.ji=function(e,t){wt()},eUe.Lc=function(){return new R1(null,new Gq(this,16))},eUe.$c=function(e){return wn()},eUe.Mc=function(e){return wr()},eUe._c=function(e,t){return wi()},eUe.gc=function(){return 0},eUe.ad=function(e){er9(this,e)},eUe.Nc=function(){return new Gq(this,16)},eUe.Oc=function(){return new R1(null,new Gq(this,16))},eUe.bd=function(e,t){return Hj(),new Gz(e2r,e,t)},eUe.Pc=function(){return Fn((Hj(),e2r))},eUe.Qc=function(e){return Hj(),emk(e2r,e)},eUe.sj=function(){return Hj(),Hj(),e2i},Y6(eX_,"ECollections/EmptyUnmodifiableEMap",1311);var e5j=RL(eX_,"Enumerator");eTS(281,1,{281:1},eCg),eUe.Fb=function(e){var t;return this===e||!!M4(e,281)&&(t=Pp(e,281),this.f==t.f&&jx(this.i,t.i)&&jk(this.a,(256&this.f)!=0?(256&t.f)!=0?t.a:null:(256&t.f)!=0?null:t.a)&&jk(this.d,t.d)&&jk(this.g,t.g)&&jk(this.e,t.e)&&epK(this,t))},eUe.Hb=function(){return this.f},eUe.Ib=function(){return eDv(this)},eUe.f=0;var e5F,e5Y,e5B,e5U,e5H,e5$,e5z,e5G,e5W,e5K,e5V,e5q,e5Z,e5X,e5J,e5Q,e51,e50,e52,e53,e54,e56,e55,e58,e59,e57,e8e,e8t,e8n,e8r,e8i,e8a,e8o,e8s,e8u,e8c,e8l,e8f,e8d,e8h,e8p,e8b,e8m,e8g,e8v,e8y,e8w,e8_,e8E,e8S,e8k,e8x,e8T,e8M,e8O,e8A,e8L,e8C,e8I,e8D,e8N,e8P,e8R,e8j,e8F,e8Y,e8B,e8U,e8H,e8$,e8z,e8G,e8W,e8K,e8V,e8q,e8Z,e8X,e8J,e8Q,e81,e80,e82,e83,e84,e86,e85,e88,e89,e87,e9e,e9t,e9n,e9r,e9i,e9a,e9o,e9s,e9u,e9c,e9l,e9f,e9d,e9h,e9p,e9b,e9m,e9g,e9v,e9y,e9w,e9_,e9E,e9S,e9k,e9x,e9T,e9M,e9O,e9A,e9L,e9C,e9I,e9D,e9N,e9P,e9R,e9j,e9F,e9Y,e9B,e9U,e9H,e9$,e9z,e9G,e9W,e9K,e9V,e9q,e9Z,e9X,e9J,e9Q,e91,e90,e92,e93,e94,e96,e95,e98,e99,e97,e7e,e7t,e7n,e7r,e7i,e7a,e7o,e7s,e7u,e7c,e7l,e7f,e7d,e7h,e7p,e7b,e7m,e7g,e7v,e7y,e7w,e7_,e7E,e7S,e7k,e7x,e7T,e7M,e7O,e7A,e7L,e7C,e7I,e7D,e7N,e7P,e7R,e7j,e7F,e7Y,e7B,e7U,e7H,e7$,e7z,e7G,e7W,e7K,e7V,e7q,e7Z,e7X,e7J,e7Q,e71,e70,e72,e73,e74,e76,e75,e78,e79,e77,tee,tet,ten,ter,tei,tea,teo,tes,teu,tec,tel,tef,ted,teh,tep,teb,tem,teg,tev,tey,tew,te_,teE,teS,tek,tex,teT,teM,teO,teA,teL,teC,teI,teD,teN,teP,teR,tej,teF,teY,teB,teU,teH,te$,tez,teG,teW,teK,teV,teq,teZ,teX,teJ,teQ,te1,te0,te2,te3,te4,te6,te5,te8,te9,te7,tte,ttt,ttn,ttr,tti,tta,tto,tts,ttu,ttc,ttl,ttf,ttd,tth,ttp,ttb,ttm,ttg,ttv,tty,ttw,tt_,ttE,ttS,ttk,ttx,ttT,ttM,ttO,ttA,ttL,ttC,ttI,ttD,ttN,ttP,ttR,ttj,ttF,ttY,ttB,ttU,ttH,tt$,ttz,ttG,ttW,ttK,ttV,ttq,ttZ,ttX,ttJ,ttQ,tt1,tt0,tt2,tt3,tt4,tt6,tt5,tt8,tt9,tt7,tne,tnt,tnn,tnr,tni,tna,tno,tns,tnu,tnc,tnl,tnf,tnd,tnh,tnp,tnb,tnm,tng,tnv,tny,tnw,tn_,tnE,tnS,tnk,tnx,tnT,tnM,tnO,tnA,tnL,tnC,tnI,tnD,tnN,tnP,tnR,tnj,tnF,tnY,tnB,tnU,tnH,tn$,tnz,tnG,tnW,tnK,tnV,tnq,tnZ,tnX,tnJ,tnQ,tn1,tn0,tn2,tn3,tn4,tn6,tn5,tn8,tn9,tn7,tre,trt,trn,trr,tri,tra,tro,trs,tru,trc,trl,trf,trd,trh,trp,trb,trm,trg,trv,trw,tr_,trE,trS,trk,trx,trT,trM,trO,trA,trL,trC,trI,trD,trN,trP,trR,trj,trF,trY,trB,trU,trH,tr$,trz,trG,trW,trK,trV,trq,trZ,trX,trJ,trQ,tr1,tr0,tr2,tr3,tr4,tr6,tr5,tr8,tr9,tr7,tie,tit,tin,tir,tii,tia,tio,tis,tiu,tic,til,tif,tid,tih,tip,tib,tim,tig,tiv,tiy,tiw,ti_,tiE,tiS,tik,tix,tiT,tiM,tiO,tiA,tiL,tiC,tiI,tiD,tiN,tiP,tiR,tij,tiF,tiY,tiB,tiU,tiH,ti$,tiz,tiG,tiW,tiK,tiV,tiq,tiZ,tiX,tiJ,tiQ,ti1,ti0,ti2,ti3,ti4,ti6,ti5,ti8,ti9,ti7,tae,tat,tan,tar,tai,taa,tao,tas,tau,tac,tal,taf,tad,tah,tap,tab,tam,tag,tav,tay,taw,ta_,taE,taS,tak,tax,taT,taM,taO,taA,taL,taC,taI,taD,taN,taP,taR,taj,taF,taY,taB,taU,taH,ta$,taz,taG,taW,taK,taV,taq,taZ,taX,taJ,taQ,ta1,ta0,ta2,ta3,ta4,ta6,ta5,ta8,ta9,ta7,toe,tot,ton,tor,toi,toa,too,tos,tou,toc,tol,tof,tod,toh,top,tob,tom,tog,tov,toy,tow,to_,toE,toS,tok,tox,toT,toM,toO,toA,toL,toC,toI,toD,toN,toP,toR,toj,toF,toY,toB,toU,toH,to$,toz,toG,toW,toK,toV,toq,toZ,toX,toJ,toQ,to1,to0,to2,to3,to4,to6,to5,to8,to9,to7,tse,tst,tsn,tsr,tsi,tsa,tso,tss,tsu,tsc,tsl,tsf,tsd,tsh,tsp,tsb,tsm,tsg,tsv,tsy,tsw,ts_,tsE,tsS,tsk,tsx,tsT,tsM,tsO,tsA,tsL,tsC,tsI,tsD,tsN,tsP,tsR,tsj,tsF,tsY,tsB,tsU,tsH,ts$,tsz,tsG,tsW,tsK,tsV,tsq,tsZ,tsX,tsJ,tsQ,ts1,ts0,ts2,ts3,ts4,ts6,ts5,ts8,ts9,ts7,tue,tut,tun,tur,tui,tua,tuo,tus,tuu,tuc,tul,tuf,tud,tuh,tup,tub,tum,tug,tuv,tuy,tuw,tu_,tuE,tuS,tuk,tux,tuT,tuM,tuO,tuA,tuL,tuC,tuI,tuD,tuN,tuP,tuR,tuj,tuF,tuY,tuB,tuU,tuH,tu$,tuz,tuG,tuW,tuK,tuV,tuq,tuZ,tuX,tuJ,tuQ,tu1,tu0,tu2,tu3,tu4,tu6,tu5,tu8,tu9,tu7,tce,tct,tcn,tcr,tci,tca,tco,tcs,tcu,tcc,tcl,tcf,tcd,tch,tcp,tcb,tcm,tcg,tcv,tcy,tcw,tc_,tcE,tcS,tck,tcx,tcT,tcM,tcO,tcA,tcL,tcC,tcI,tcD,tcN,tcP,tcR,tcj,tcF,tcY,tcB,tcU,tcH,tc$,tcz,tcG,tcW,tcK,tcV,tcq,tcZ,tcX,tcJ,tcQ,tc1,tc0,tc2,tc3,tc4,tc6,tc5,tc8,tc9,tc7,tle,tlt,tln,tlr,tli,tla,tlo,tls,tlu,tlc,tll,tlf,tld,tlh,tlp,tlb,tlm,tlg,tlv,tly,tlw,tl_,tlE,tlS,tlk,tlx,tlT,tlM,tlO,tlA,tlL,tlC,tlI,tlD,tlN,tlP,tlR,tlj,tlF,tlY,tlB,tlU,tlH,tl$,tlz,tlG,tlW,tlK,tlV,tlq,tlZ,tlX,tlJ,tlQ,tl1,tl0,tl2,tl3,tl4,tl6,tl5,tl8,tl9,tl7,tfe,tft,tfn,tfr,tfi,tfa,tfo,tfs,tfu,tfc,tfl,tff,tfd,tfh,tfp,tfb,tfm,tfg,tfv,tfy,tfw,tf_,tfE,tfS,tfk,tfx,tfT,tfM,tfO,tfA,tfL,tfC,tfI,tfD,tfN,tfP,tfR,tfj,tfF,tfY,tfB,tfU,tfH,tf$,tfz,tfG,tfW,tfK,tfV,tfq,tfZ,tfX,tfJ,tfQ,tf1,tf0,tf2,tf3,tf4,tf6,tf5,tf8,tf9,tf7,tde,tdt,tdn,tdr,tdi,tda,tdo,tds,tdu,tdc,tdl,tdf,tdd,tdh,tdp,tdb,tdm,tdg,tdv,tdy,tdw,td_,tdE,tdS,tdk,tdx,tdT,tdM,tdO,tdA,tdL,tdC,tdI,tdD,tdN,tdP,tdR,tdj,tdF,tdY,tdB,tdU,tdH,td$,tdz,tdG,tdW,tdK,tdV,tdq,tdZ,tdX,tdJ,tdQ,td1,td0,td2,td3,td4,td6,td5,td8,td9,td7,the,tht,thn,thr,thi,tha,tho,ths,thu,thc,thl,thf,thd,thh,thp,thb,thm,thg,thv,thy,thw,th_,thE,thS,thk,thx,thT,thM,thO,thA,thL,thC,thI,thD,thN,thP,thR,thj,thF,thY,thB,thU,thH,th$,thz,thG,thW,thK,thV,thq,thZ,thX,thJ,thQ,th1,th0,th2,th3,th4,th6,th5,th8,th9,th7,tpe,tpt,tpn,tpr,tpi,tpa,tpo,tps,tpu,tpc,tpl,tpf,tpd,tph,tpp,tpb,tpm,tpg,tpv,tpy,tpw,tp_,tpE,tpS,tpk,tpx,tpT,tpM,tpO,tpA,tpL,tpC,tpI,tpD,tpN,tpP,tpR,tpj,tpF,tpY,tpB,tpU,tpH,tp$,tpz,tpG,tpW,tpK,tpV,tpq,tpZ,tpX,tpJ,tpQ,tp1,tp0,tp2,tp3,tp4,tp6,tp5,tp8,tp9,tp7,tbe,tbt,tbn,tbr,tbi,tba,tbo,tbs,tbu,tbc,tbl,tbf,tbd,tbh,tbp,tbb,tbm,tbg,tbv,tby,tbw,tb_,tbE,tbS,tbk,tbx,tbT,tbM,tbO,tbA,tbL,tbC,tbI,tbD,tbN,tbP,tbR,tbj,tbF,tbY,tbB,tbU,tbH,tb$,tbz,tbG,tbW,tbK,tbV,tbq,tbZ,tbX,tbJ,tbQ,tb1,tb0,tb2,tb3,tb4,tb6,tb5,tb8,tb9,tb7,tme,tmt,tmn,tmr,tmi,tma,tmo,tms,tmu,tmc,tml,tmf,tmd,tmh,tmp,tmb,tmm,tmg,tmv,tmy,tmw,tm_,tmE,tmS,tmk,tmx,tmT,tmM,tmO,tmA,tmL,tmC,tmI,tmD,tmN,tmP,tmR,tmj,tmF,tmY,tmB,tmU,tmH,tm$,tmz,tmG=0,tmW=0,tmK=0,tmV=0,tmq=0,tmZ=0,tmX=0,tmJ=0,tmQ=0,tm1=0,tm0=0,tm2=0,tm3=0;Y6(eX_,"URI",281),eTS(1091,43,e$s,mM),eUe.zc=function(e,t){return Pp(Ge(this,Lq(e),Pp(t,281)),281)},Y6(eX_,"URI/URICache",1091),eTS(497,63,eXz,o6,jf),eUe.hi=function(){return!0},Y6(eX_,"UniqueEList",497),eTS(581,60,eHr,QH),Y6(eX_,"WrappedException",581);var tm4=RL(eZD,eJD),tm6=RL(eZD,eJN),tm5=RL(eZD,eJP),tm8=RL(eZD,eJR),tm9=RL(eZD,eJj),tm7=RL(eZD,"EClass"),tge=RL(eZD,"EDataType");eTS(1183,43,e$s,mO),eUe.xc=function(e){return xd(e)?zg(this,e):xu($I(this.f,e))},Y6(eZD,"EDataType/Internal/ConversionDelegate/Factory/Registry/Impl",1183);var tgt=RL(eZD,"EEnum"),tgn=RL(eZD,eJF),tgr=RL(eZD,eJY),tgi=RL(eZD,eJB),tga=RL(eZD,eJU),tgo=RL(eZD,eJH);eTS(1029,1,{},o4),eUe.Ib=function(){return"NIL"},Y6(eZD,"EStructuralFeature/Internal/DynamicValueHolder/1",1029),eTS(1028,43,e$s,mA),eUe.xc=function(e){return xd(e)?zg(this,e):xu($I(this.f,e))},Y6(eZD,"EStructuralFeature/Internal/SettingDelegate/Factory/Registry/Impl",1028);var tgs=RL(eZD,eJ$),tgu=RL(eZD,"EValidator/PatternMatcher"),tgc=RL(eJz,"FeatureMap/Entry");eTS(535,1,{72:1},k3),eUe.ak=function(){return this.a},eUe.dd=function(){return this.b},Y6(eZ2,"BasicEObjectImpl/1",535),eTS(1027,1,eJG,k4),eUe.Wj=function(e){return ZN(this.a,this.b,e)},eUe.fj=function(){return zz(this.a,this.b)},eUe.Wb=function(e){zx(this.a,this.b,e)},eUe.Xj=function(){B4(this.a,this.b)},Y6(eZ2,"BasicEObjectImpl/4",1027),eTS(1983,1,{108:1}),eUe.bk=function(e){this.e=0==e?tgH:Je(e1R,eUp,1,e,5,1)},eUe.Ch=function(e){return this.e[e]},eUe.Dh=function(e,t){this.e[e]=t},eUe.Eh=function(e){this.e[e]=null},eUe.ck=function(){return this.c},eUe.dk=function(){throw p7(new bO)},eUe.ek=function(){throw p7(new bO)},eUe.fk=function(){return this.d},eUe.gk=function(){return null!=this.e},eUe.hk=function(e){this.c=e},eUe.ik=function(e){throw p7(new bO)},eUe.jk=function(e){throw p7(new bO)},eUe.kk=function(e){this.d=e},Y6(eZ2,"BasicEObjectImpl/EPropertiesHolderBaseImpl",1983),eTS(185,1983,{108:1},c1),eUe.dk=function(){return this.a},eUe.ek=function(){return this.b},eUe.ik=function(e){this.a=e},eUe.jk=function(e){this.b=e},Y6(eZ2,"BasicEObjectImpl/EPropertiesHolderImpl",185),eTS(506,97,eZ0,sr),eUe.Kg=function(){return this.f},eUe.Pg=function(){return this.k},eUe.Rg=function(e,t){this.g=e,this.i=t},eUe.Tg=function(){return(2&this.j)==0?this.zh():this.ph().ck()},eUe.Vg=function(){return this.i},eUe.Mg=function(){return(1&this.j)!=0},eUe.eh=function(){return this.g},eUe.kh=function(){return(4&this.j)!=0},eUe.ph=function(){return this.k||(this.k=new c1),this.k},eUe.th=function(e){this.ph().hk(e),e?this.j|=2:this.j&=-3},eUe.vh=function(e){this.ph().jk(e),e?this.j|=4:this.j&=-5},eUe.zh=function(){return(BM(),tgv).S},eUe.i=0,eUe.j=1,Y6(eZ2,"EObjectImpl",506),eTS(780,506,{105:1,92:1,90:1,56:1,108:1,49:1,97:1},Pq),eUe.Ch=function(e){return this.e[e]},eUe.Dh=function(e,t){this.e[e]=t},eUe.Eh=function(e){this.e[e]=null},eUe.Tg=function(){return this.d},eUe.Yg=function(e){return edv(this.d,e)},eUe.$g=function(){return this.d},eUe.dh=function(){return null!=this.e},eUe.ph=function(){return this.k||(this.k=new si),this.k},eUe.th=function(e){this.d=e},eUe.yh=function(){var e;return null==this.e&&(e=Y1(this.d),this.e=0==e?tg$:Je(e1R,eUp,1,e,5,1)),this},eUe.Ah=function(){return 0},Y6(eZ2,"DynamicEObjectImpl",780),eTS(1376,780,{105:1,42:1,92:1,90:1,133:1,56:1,108:1,49:1,97:1},RO),eUe.Fb=function(e){return this===e},eUe.Hb=function(){return Ao(this)},eUe.th=function(e){this.d=e,this.b=eAh(e,"key"),this.c=eAh(e,eXr)},eUe.Sh=function(){var e;return -1==this.a&&(e=Q8(this,this.b),this.a=null==e?0:esj(e)),this.a},eUe.cd=function(){return Q8(this,this.b)},eUe.dd=function(){return Q8(this,this.c)},eUe.Th=function(e){this.a=e},eUe.Uh=function(e){zx(this,this.b,e)},eUe.ed=function(e){var t;return t=Q8(this,this.c),zx(this,this.c,e),t},eUe.a=0,Y6(eZ2,"DynamicEObjectImpl/BasicEMapEntry",1376),eTS(1377,1,{108:1},si),eUe.bk=function(e){throw p7(new bO)},eUe.Ch=function(e){throw p7(new bO)},eUe.Dh=function(e,t){throw p7(new bO)},eUe.Eh=function(e){throw p7(new bO)},eUe.ck=function(){throw p7(new bO)},eUe.dk=function(){return this.a},eUe.ek=function(){return this.b},eUe.fk=function(){return this.c},eUe.gk=function(){throw p7(new bO)},eUe.hk=function(e){throw p7(new bO)},eUe.ik=function(e){this.a=e},eUe.jk=function(e){this.b=e},eUe.kk=function(e){this.c=e},Y6(eZ2,"DynamicEObjectImpl/DynamicEPropertiesHolderImpl",1377),eTS(510,150,{105:1,92:1,90:1,590:1,147:1,56:1,108:1,49:1,97:1,510:1,150:1,114:1,115:1},sa),eUe.Qg=function(e){return eg4(this,e)},eUe._g=function(e,t,n){var r;switch(e){case 0:return this.Ab||(this.Ab=new FQ(tm4,this,0,3)),this.Ab;case 1:return this.d;case 2:return n?(this.b||(this.b=new L_((eBK(),tgF),tgf,this)),this.b):(this.b||(this.b=new L_((eBK(),tgF),tgf,this)),X5(this.b));case 3:return z4(this);case 4:return this.a||(this.a=new O_(e5f,this,4)),this.a;case 5:return this.c||(this.c=new OT(e5f,this,5)),this.c}return Qt(this,e-Y1((eBK(),tgy)),ee2((r=Pp(eaS(this,16),26))||tgy,e),t,n)},eUe.hh=function(e,t,n){var r,i,a;switch(t){case 0:return this.Ab||(this.Ab=new FQ(tm4,this,0,3)),edF(this.Ab,e,n);case 3:return this.Cb&&(n=(i=this.Db>>16)>=0?eg4(this,n):this.Cb.ih(this,-1-i,null,n)),j3(this,Pp(e,147),n)}return(a=Pp(ee2((r=Pp(eaS(this,16),26))||(eBK(),tgy),t),66)).Nj().Qj(this,ehH(this),t-Y1((eBK(),tgy)),e,n)},eUe.jh=function(e,t,n){var r,i;switch(t){case 0:return this.Ab||(this.Ab=new FQ(tm4,this,0,3)),ep5(this.Ab,e,n);case 2:return this.b||(this.b=new L_((eBK(),tgF),tgf,this)),Iz(this.b,e,n);case 3:return j3(this,null,n);case 4:return this.a||(this.a=new O_(e5f,this,4)),ep5(this.a,e,n)}return(i=Pp(ee2((r=Pp(eaS(this,16),26))||(eBK(),tgy),t),66)).Nj().Rj(this,ehH(this),t-Y1((eBK(),tgy)),e,n)},eUe.lh=function(e){var t;switch(e){case 0:return!!this.Ab&&0!=this.Ab.i;case 1:return null!=this.d;case 2:return!!this.b&&0!=this.b.f;case 3:return!!z4(this);case 4:return!!this.a&&0!=this.a.i;case 5:return!!this.c&&0!=this.c.i}return VP(this,e-Y1((eBK(),tgy)),ee2((t=Pp(eaS(this,16),26))||tgy,e))},eUe.sh=function(e,t){var n;switch(e){case 0:this.Ab||(this.Ab=new FQ(tm4,this,0,3)),eRT(this.Ab),this.Ab||(this.Ab=new FQ(tm4,this,0,3)),Y4(this.Ab,Pp(t,14));return;case 1:RN(this,Lq(t));return;case 2:this.b||(this.b=new L_((eBK(),tgF),tgf,this)),eai(this.b,t);return;case 3:eAc(this,Pp(t,147));return;case 4:this.a||(this.a=new O_(e5f,this,4)),eRT(this.a),this.a||(this.a=new O_(e5f,this,4)),Y4(this.a,Pp(t,14));return;case 5:this.c||(this.c=new OT(e5f,this,5)),eRT(this.c),this.c||(this.c=new OT(e5f,this,5)),Y4(this.c,Pp(t,14));return}efL(this,e-Y1((eBK(),tgy)),ee2((n=Pp(eaS(this,16),26))||tgy,e),t)},eUe.zh=function(){return eBK(),tgy},eUe.Bh=function(e){var t;switch(e){case 0:this.Ab||(this.Ab=new FQ(tm4,this,0,3)),eRT(this.Ab);return;case 1:erl(this,null);return;case 2:this.b||(this.b=new L_((eBK(),tgF),tgf,this)),this.b.c.$b();return;case 3:eAc(this,null);return;case 4:this.a||(this.a=new O_(e5f,this,4)),eRT(this.a);return;case 5:this.c||(this.c=new OT(e5f,this,5)),eRT(this.c);return}ec5(this,e-Y1((eBK(),tgy)),ee2((t=Pp(eaS(this,16),26))||tgy,e))},eUe.Ib=function(){return eln(this)},eUe.d=null,Y6(eZ2,"EAnnotationImpl",510),eTS(151,705,eJW,JY),eUe.Xh=function(e,t){T7(this,e,Pp(t,42))},eUe.lk=function(e,t){return I$(this,Pp(e,42),t)},eUe.pi=function(e){return Pp(Pp(this.c,69).pi(e),133)},eUe.Zh=function(){return Pp(this.c,69).Zh()},eUe.$h=function(){return Pp(this.c,69).$h()},eUe._h=function(e){return Pp(this.c,69)._h(e)},eUe.mk=function(e,t){return Iz(this,e,t)},eUe.Wj=function(e){return Pp(this.c,76).Wj(e)},eUe.rj=function(){},eUe.fj=function(){return Pp(this.c,76).fj()},eUe.tj=function(e,t,n){var r;return(r=Pp(etP(this.b).Nh().Jh(this.b),133)).Th(e),r.Uh(t),r.ed(n),r},eUe.uj=function(){return new pZ(this)},eUe.Wb=function(e){eai(this,e)},eUe.Xj=function(){Pp(this.c,76).Xj()},Y6(eJz,"EcoreEMap",151),eTS(158,151,eJW,L_),eUe.qj=function(){var e,t,n,r,i,a;if(null==this.d){for(a=Je(e5C,eJA,63,2*this.f+1,0,1),n=this.c.Kc();n.e!=n.i.gc();)(e=a[i=((r=(t=Pp(n.nj(),133)).Sh())&eUu)%a.length])||(e=a[i]=new pZ(this)),e.Fc(t);this.d=a}},Y6(eZ2,"EAnnotationImpl/1",158),eTS(284,438,{105:1,92:1,90:1,147:1,191:1,56:1,108:1,472:1,49:1,97:1,150:1,284:1,114:1,115:1}),eUe._g=function(e,t,n){var r,i;switch(e){case 0:return this.Ab||(this.Ab=new FQ(tm4,this,0,3)),this.Ab;case 1:return this.zb;case 2:return OQ(),(256&this.Bb)!=0;case 3:return OQ(),(512&this.Bb)!=0;case 4:return ell(this.s);case 5:return ell(this.t);case 6:return OQ(),!!this.$j();case 7:return OQ(),(i=this.s)>=1;case 8:if(t)return evl(this);return this.r;case 9:return this.q}return Qt(this,e-Y1(this.zh()),ee2((r=Pp(eaS(this,16),26))||this.zh(),e),t,n)},eUe.jh=function(e,t,n){var r,i;switch(t){case 0:return this.Ab||(this.Ab=new FQ(tm4,this,0,3)),ep5(this.Ab,e,n);case 9:return Y3(this,n)}return(i=Pp(ee2((r=Pp(eaS(this,16),26))||this.zh(),t),66)).Nj().Rj(this,ehH(this),t-Y1(this.zh()),e,n)},eUe.lh=function(e){var t,n;switch(e){case 0:return!!this.Ab&&0!=this.Ab.i;case 1:return null!=this.zb;case 2:return(256&this.Bb)==0;case 3:return(512&this.Bb)==0;case 4:return 0!=this.s;case 5:return 1!=this.t;case 6:return this.$j();case 7:return(n=this.s)>=1;case 8:return!!this.r&&!this.q.e&&0==BX(this.q).i;case 9:return!!this.q&&!(this.r&&!this.q.e&&0==BX(this.q).i)}return VP(this,e-Y1(this.zh()),ee2((t=Pp(eaS(this,16),26))||this.zh(),e))},eUe.sh=function(e,t){var n,r;switch(e){case 0:this.Ab||(this.Ab=new FQ(tm4,this,0,3)),eRT(this.Ab),this.Ab||(this.Ab=new FQ(tm4,this,0,3)),Y4(this.Ab,Pp(t,14));return;case 1:this.Lh(Lq(t));return;case 2:eli(this,gN(LK(t)));return;case 3:els(this,gN(LK(t)));return;case 4:end(this,Pp(t,19).a);return;case 5:this.ok(Pp(t,19).a);return;case 8:eu2(this,Pp(t,138));return;case 9:(r=ew3(this,Pp(t,87),null))&&r.Fi();return}efL(this,e-Y1(this.zh()),ee2((n=Pp(eaS(this,16),26))||this.zh(),e),t)},eUe.zh=function(){return eBK(),tgB},eUe.Bh=function(e){var t,n;switch(e){case 0:this.Ab||(this.Ab=new FQ(tm4,this,0,3)),eRT(this.Ab);return;case 1:this.Lh(null);return;case 2:eli(this,!0);return;case 3:els(this,!0);return;case 4:end(this,0);return;case 5:this.ok(1);return;case 8:eu2(this,null);return;case 9:(n=ew3(this,null,null))&&n.Fi();return}ec5(this,e-Y1(this.zh()),ee2((t=Pp(eaS(this,16),26))||this.zh(),e))},eUe.Gh=function(){evl(this),this.Bb|=1},eUe.Yj=function(){return evl(this)},eUe.Zj=function(){return this.t},eUe.$j=function(){var e;return(e=this.t)>1||-1==e},eUe.hi=function(){return(512&this.Bb)!=0},eUe.nk=function(e,t){return ecz(this,e,t)},eUe.ok=function(e){enh(this,e)},eUe.Ib=function(){return ex3(this)},eUe.s=0,eUe.t=1,Y6(eZ2,"ETypedElementImpl",284),eTS(449,284,{105:1,92:1,90:1,147:1,191:1,56:1,170:1,66:1,108:1,472:1,49:1,97:1,150:1,449:1,284:1,114:1,115:1,677:1}),eUe.Qg=function(e){return egx(this,e)},eUe._g=function(e,t,n){var r,i;switch(e){case 0:return this.Ab||(this.Ab=new FQ(tm4,this,0,3)),this.Ab;case 1:return this.zb;case 2:return OQ(),(256&this.Bb)!=0;case 3:return OQ(),(512&this.Bb)!=0;case 4:return ell(this.s);case 5:return ell(this.t);case 6:return OQ(),!!this.$j();case 7:return OQ(),(i=this.s)>=1;case 8:if(t)return evl(this);return this.r;case 9:return this.q;case 10:return OQ(),(this.Bb&eXt)!=0;case 11:return OQ(),(this.Bb&eJq)!=0;case 12:return OQ(),(this.Bb&eH0)!=0;case 13:return this.j;case 14:return eOI(this);case 15:return OQ(),(this.Bb&eJV)!=0;case 16:return OQ(),(this.Bb&eUR)!=0;case 17:return z5(this)}return Qt(this,e-Y1(this.zh()),ee2((r=Pp(eaS(this,16),26))||this.zh(),e),t,n)},eUe.hh=function(e,t,n){var r,i,a;switch(t){case 0:return this.Ab||(this.Ab=new FQ(tm4,this,0,3)),edF(this.Ab,e,n);case 17:return this.Cb&&(n=(i=this.Db>>16)>=0?egx(this,n):this.Cb.ih(this,-1-i,null,n)),eDg(this,e,17,n)}return(a=Pp(ee2((r=Pp(eaS(this,16),26))||this.zh(),t),66)).Nj().Qj(this,ehH(this),t-Y1(this.zh()),e,n)},eUe.jh=function(e,t,n){var r,i;switch(t){case 0:return this.Ab||(this.Ab=new FQ(tm4,this,0,3)),ep5(this.Ab,e,n);case 9:return Y3(this,n);case 17:return eDg(this,null,17,n)}return(i=Pp(ee2((r=Pp(eaS(this,16),26))||this.zh(),t),66)).Nj().Rj(this,ehH(this),t-Y1(this.zh()),e,n)},eUe.lh=function(e){var t,n;switch(e){case 0:return!!this.Ab&&0!=this.Ab.i;case 1:return null!=this.zb;case 2:return(256&this.Bb)==0;case 3:return(512&this.Bb)==0;case 4:return 0!=this.s;case 5:return 1!=this.t;case 6:return this.$j();case 7:return(n=this.s)>=1;case 8:return!!this.r&&!this.q.e&&0==BX(this.q).i;case 9:return!!this.q&&!(this.r&&!this.q.e&&0==BX(this.q).i);case 10:return(this.Bb&eXt)==0;case 11:return(this.Bb&eJq)!=0;case 12:return(this.Bb&eH0)!=0;case 13:return null!=this.j;case 14:return null!=eOI(this);case 15:return(this.Bb&eJV)!=0;case 16:return(this.Bb&eUR)!=0;case 17:return!!z5(this)}return VP(this,e-Y1(this.zh()),ee2((t=Pp(eaS(this,16),26))||this.zh(),e))},eUe.sh=function(e,t){var n,r;switch(e){case 0:this.Ab||(this.Ab=new FQ(tm4,this,0,3)),eRT(this.Ab),this.Ab||(this.Ab=new FQ(tm4,this,0,3)),Y4(this.Ab,Pp(t,14));return;case 1:GD(this,Lq(t));return;case 2:eli(this,gN(LK(t)));return;case 3:els(this,gN(LK(t)));return;case 4:end(this,Pp(t,19).a);return;case 5:this.ok(Pp(t,19).a);return;case 8:eu2(this,Pp(t,138));return;case 9:(r=ew3(this,Pp(t,87),null))&&r.Fi();return;case 10:elF(this,gN(LK(t)));return;case 11:elU(this,gN(LK(t)));return;case 12:elY(this,gN(LK(t)));return;case 13:xi(this,Lq(t));return;case 15:elB(this,gN(LK(t)));return;case 16:elZ(this,gN(LK(t)));return}efL(this,e-Y1(this.zh()),ee2((n=Pp(eaS(this,16),26))||this.zh(),e),t)},eUe.zh=function(){return eBK(),tgY},eUe.Bh=function(e){var t,n;switch(e){case 0:this.Ab||(this.Ab=new FQ(tm4,this,0,3)),eRT(this.Ab);return;case 1:M4(this.Cb,88)&&eko(Zd(Pp(this.Cb,88)),4),er3(this,null);return;case 2:eli(this,!0);return;case 3:els(this,!0);return;case 4:end(this,0);return;case 5:this.ok(1);return;case 8:eu2(this,null);return;case 9:(n=ew3(this,null,null))&&n.Fi();return;case 10:elF(this,!0);return;case 11:elU(this,!1);return;case 12:elY(this,!1);return;case 13:this.i=null,erA(this,null);return;case 15:elB(this,!1);return;case 16:elZ(this,!1);return}ec5(this,e-Y1(this.zh()),ee2((t=Pp(eaS(this,16),26))||this.zh(),e))},eUe.Gh=function(){UH(QZ((eSp(),tvc),this)),evl(this),this.Bb|=1},eUe.Gj=function(){return this.f},eUe.zj=function(){return eOI(this)},eUe.Hj=function(){return z5(this)},eUe.Lj=function(){return null},eUe.pk=function(){return this.k},eUe.aj=function(){return this.n},eUe.Mj=function(){return eyD(this)},eUe.Nj=function(){var e,t,n,r,i,a,o,s,u;return this.p||((null==(n=z5(this)).i&&eNT(n),n.i).length,(r=this.Lj())&&Y1(z5(r)),e=(o=(i=evl(this)).Bj())?(1&o.i)!=0?o==tyE?e11:o==ty_?e16:o==tyT?e14:o==tyx?e13:o==tyS?e15:o==tyM?e18:o==tyk?e10:e12:o:null,t=eOI(this),s=i.zj(),efl(this),(this.Bb&eUR)!=0&&((a=ev1((eSp(),tvc),n))&&a!=this||(a=Wk(QZ(tvc,this))))?this.p=new k5(this,a):this.$j()?this.rk()?r?(this.Bb&eJV)!=0?e?this.sk()?this.p=new HS(47,e,this,r):this.p=new HS(5,e,this,r):this.sk()?this.p=new qc(46,this,r):this.p=new qc(4,this,r):e?this.sk()?this.p=new HS(49,e,this,r):this.p=new HS(7,e,this,r):this.sk()?this.p=new qc(48,this,r):this.p=new qc(6,this,r):(this.Bb&eJV)!=0?e?e==e1$?this.p=new Pe(50,e5M,this):this.sk()?this.p=new Pe(43,e,this):this.p=new Pe(1,e,this):this.sk()?this.p=new $F(42,this):this.p=new $F(0,this):e?e==e1$?this.p=new Pe(41,e5M,this):this.sk()?this.p=new Pe(45,e,this):this.p=new Pe(3,e,this):this.sk()?this.p=new $F(44,this):this.p=new $F(2,this):M4(i,148)?e==tgc?this.p=new $F(40,this):(512&this.Bb)!=0?(this.Bb&eJV)!=0?e?this.p=new Pe(9,e,this):this.p=new $F(8,this):e?this.p=new Pe(11,e,this):this.p=new $F(10,this):(this.Bb&eJV)!=0?e?this.p=new Pe(13,e,this):this.p=new $F(12,this):e?this.p=new Pe(15,e,this):this.p=new $F(14,this):r?(u=r.t)>1||-1==u?this.sk()?(this.Bb&eJV)!=0?e?this.p=new HS(25,e,this,r):this.p=new qc(24,this,r):e?this.p=new HS(27,e,this,r):this.p=new qc(26,this,r):(this.Bb&eJV)!=0?e?this.p=new HS(29,e,this,r):this.p=new qc(28,this,r):e?this.p=new HS(31,e,this,r):this.p=new qc(30,this,r):this.sk()?(this.Bb&eJV)!=0?e?this.p=new HS(33,e,this,r):this.p=new qc(32,this,r):e?this.p=new HS(35,e,this,r):this.p=new qc(34,this,r):(this.Bb&eJV)!=0?e?this.p=new HS(37,e,this,r):this.p=new qc(36,this,r):e?this.p=new HS(39,e,this,r):this.p=new qc(38,this,r):this.sk()?(this.Bb&eJV)!=0?e?this.p=new Pe(17,e,this):this.p=new $F(16,this):e?this.p=new Pe(19,e,this):this.p=new $F(18,this):(this.Bb&eJV)!=0?e?this.p=new Pe(21,e,this):this.p=new $F(20,this):e?this.p=new Pe(23,e,this):this.p=new $F(22,this):this.qk()?this.sk()?this.p=new Pt(Pp(i,26),this,r):this.p=new zl(Pp(i,26),this,r):M4(i,148)?e==tgc?this.p=new $F(40,this):(this.Bb&eJV)!=0?e?this.p=new j8(t,s,this,(edO(),o==ty_?tg2:o==tyE?tgX:o==tyS?tg3:o==tyT?tg0:o==tyx?tg1:o==tyM?tg6:o==tyk?tgJ:o==tyw?tgQ:tg4)):this.p=new HT(Pp(i,148),t,s,this):e?this.p=new j5(t,s,this,(edO(),o==ty_?tg2:o==tyE?tgX:o==tyS?tg3:o==tyT?tg0:o==tyx?tg1:o==tyM?tg6:o==tyk?tgJ:o==tyw?tgQ:tg4)):this.p=new Hx(Pp(i,148),t,s,this):this.rk()?r?(this.Bb&eJV)!=0?this.sk()?this.p=new Ps(Pp(i,26),this,r):this.p=new Po(Pp(i,26),this,r):this.sk()?this.p=new Pa(Pp(i,26),this,r):this.p=new Pn(Pp(i,26),this,r):(this.Bb&eJV)!=0?this.sk()?this.p=new Lx(Pp(i,26),this):this.p=new Lk(Pp(i,26),this):this.sk()?this.p=new LS(Pp(i,26),this):this.p=new LE(Pp(i,26),this):this.sk()?r?(this.Bb&eJV)!=0?this.p=new Pu(Pp(i,26),this,r):this.p=new Pr(Pp(i,26),this,r):(this.Bb&eJV)!=0?this.p=new LM(Pp(i,26),this):this.p=new LT(Pp(i,26),this):r?(this.Bb&eJV)!=0?this.p=new Pc(Pp(i,26),this,r):this.p=new Pi(Pp(i,26),this,r):(this.Bb&eJV)!=0?this.p=new LO(Pp(i,26),this):this.p=new jd(Pp(i,26),this)),this.p},eUe.Ij=function(){return(this.Bb&eXt)!=0},eUe.qk=function(){return!1},eUe.rk=function(){return!1},eUe.Jj=function(){return(this.Bb&eUR)!=0},eUe.Oj=function(){return eec(this)},eUe.sk=function(){return!1},eUe.Kj=function(){return(this.Bb&eJV)!=0},eUe.tk=function(e){this.k=e},eUe.Lh=function(e){GD(this,e)},eUe.Ib=function(){return eCR(this)},eUe.e=!1,eUe.n=0,Y6(eZ2,"EStructuralFeatureImpl",449),eTS(322,449,{105:1,92:1,90:1,34:1,147:1,191:1,56:1,170:1,66:1,108:1,472:1,49:1,97:1,322:1,150:1,449:1,284:1,114:1,115:1,677:1},mC),eUe._g=function(e,t,n){var r,i;switch(e){case 0:return this.Ab||(this.Ab=new FQ(tm4,this,0,3)),this.Ab;case 1:return this.zb;case 2:return OQ(),(256&this.Bb)!=0;case 3:return OQ(),(512&this.Bb)!=0;case 4:return ell(this.s);case 5:return ell(this.t);case 6:return OQ(),!!ek7(this);case 7:return OQ(),(i=this.s)>=1;case 8:if(t)return evl(this);return this.r;case 9:return this.q;case 10:return OQ(),(this.Bb&eXt)!=0;case 11:return OQ(),(this.Bb&eJq)!=0;case 12:return OQ(),(this.Bb&eH0)!=0;case 13:return this.j;case 14:return eOI(this);case 15:return OQ(),(this.Bb&eJV)!=0;case 16:return OQ(),(this.Bb&eUR)!=0;case 17:return z5(this);case 18:return OQ(),(this.Bb&eZ1)!=0;case 19:if(t)return eoe(this);return Xl(this)}return Qt(this,e-Y1((eBK(),tgw)),ee2((r=Pp(eaS(this,16),26))||tgw,e),t,n)},eUe.lh=function(e){var t,n;switch(e){case 0:return!!this.Ab&&0!=this.Ab.i;case 1:return null!=this.zb;case 2:return(256&this.Bb)==0;case 3:return(512&this.Bb)==0;case 4:return 0!=this.s;case 5:return 1!=this.t;case 6:return ek7(this);case 7:return(n=this.s)>=1;case 8:return!!this.r&&!this.q.e&&0==BX(this.q).i;case 9:return!!this.q&&!(this.r&&!this.q.e&&0==BX(this.q).i);case 10:return(this.Bb&eXt)==0;case 11:return(this.Bb&eJq)!=0;case 12:return(this.Bb&eH0)!=0;case 13:return null!=this.j;case 14:return null!=eOI(this);case 15:return(this.Bb&eJV)!=0;case 16:return(this.Bb&eUR)!=0;case 17:return!!z5(this);case 18:return(this.Bb&eZ1)!=0;case 19:return!!Xl(this)}return VP(this,e-Y1((eBK(),tgw)),ee2((t=Pp(eaS(this,16),26))||tgw,e))},eUe.sh=function(e,t){var n,r;switch(e){case 0:this.Ab||(this.Ab=new FQ(tm4,this,0,3)),eRT(this.Ab),this.Ab||(this.Ab=new FQ(tm4,this,0,3)),Y4(this.Ab,Pp(t,14));return;case 1:GD(this,Lq(t));return;case 2:eli(this,gN(LK(t)));return;case 3:els(this,gN(LK(t)));return;case 4:end(this,Pp(t,19).a);return;case 5:yg(this,Pp(t,19).a);return;case 8:eu2(this,Pp(t,138));return;case 9:(r=ew3(this,Pp(t,87),null))&&r.Fi();return;case 10:elF(this,gN(LK(t)));return;case 11:elU(this,gN(LK(t)));return;case 12:elY(this,gN(LK(t)));return;case 13:xi(this,Lq(t));return;case 15:elB(this,gN(LK(t)));return;case 16:elZ(this,gN(LK(t)));return;case 18:elX(this,gN(LK(t)));return}efL(this,e-Y1((eBK(),tgw)),ee2((n=Pp(eaS(this,16),26))||tgw,e),t)},eUe.zh=function(){return eBK(),tgw},eUe.Bh=function(e){var t,n;switch(e){case 0:this.Ab||(this.Ab=new FQ(tm4,this,0,3)),eRT(this.Ab);return;case 1:M4(this.Cb,88)&&eko(Zd(Pp(this.Cb,88)),4),er3(this,null);return;case 2:eli(this,!0);return;case 3:els(this,!0);return;case 4:end(this,0);return;case 5:this.b=0,enh(this,1);return;case 8:eu2(this,null);return;case 9:(n=ew3(this,null,null))&&n.Fi();return;case 10:elF(this,!0);return;case 11:elU(this,!1);return;case 12:elY(this,!1);return;case 13:this.i=null,erA(this,null);return;case 15:elB(this,!1);return;case 16:elZ(this,!1);return;case 18:elX(this,!1);return}ec5(this,e-Y1((eBK(),tgw)),ee2((t=Pp(eaS(this,16),26))||tgw,e))},eUe.Gh=function(){eoe(this),UH(QZ((eSp(),tvc),this)),evl(this),this.Bb|=1},eUe.$j=function(){return ek7(this)},eUe.nk=function(e,t){return this.b=0,this.a=null,ecz(this,e,t)},eUe.ok=function(e){yg(this,e)},eUe.Ib=function(){var e;return(64&this.Db)!=0?eCR(this):(e=new O1(eCR(this)),e.a+=" (iD: ",yG(e,(this.Bb&eZ1)!=0),e.a+=")",e.a)},eUe.b=0,Y6(eZ2,"EAttributeImpl",322),eTS(351,438,{105:1,92:1,90:1,138:1,147:1,191:1,56:1,108:1,49:1,97:1,351:1,150:1,114:1,115:1,676:1}),eUe.uk=function(e){return e.Tg()==this},eUe.Qg=function(e){return egn(this,e)},eUe.Rg=function(e,t){this.w=null,this.Db=t<<16|255&this.Db,this.Cb=e},eUe._g=function(e,t,n){var r;switch(e){case 0:return this.Ab||(this.Ab=new FQ(tm4,this,0,3)),this.Ab;case 1:return this.zb;case 2:return null!=this.D?this.D:this.B;case 3:return em4(this);case 4:return this.zj();case 5:return this.F;case 6:if(t)return etP(this);return z6(this);case 7:return this.A||(this.A=new OS(tgs,this,7)),this.A}return Qt(this,e-Y1(this.zh()),ee2((r=Pp(eaS(this,16),26))||this.zh(),e),t,n)},eUe.hh=function(e,t,n){var r,i,a;switch(t){case 0:return this.Ab||(this.Ab=new FQ(tm4,this,0,3)),edF(this.Ab,e,n);case 6:return this.Cb&&(n=(i=this.Db>>16)>=0?egn(this,n):this.Cb.ih(this,-1-i,null,n)),eDg(this,e,6,n)}return(a=Pp(ee2((r=Pp(eaS(this,16),26))||this.zh(),t),66)).Nj().Qj(this,ehH(this),t-Y1(this.zh()),e,n)},eUe.jh=function(e,t,n){var r,i;switch(t){case 0:return this.Ab||(this.Ab=new FQ(tm4,this,0,3)),ep5(this.Ab,e,n);case 6:return eDg(this,null,6,n);case 7:return this.A||(this.A=new OS(tgs,this,7)),ep5(this.A,e,n)}return(i=Pp(ee2((r=Pp(eaS(this,16),26))||this.zh(),t),66)).Nj().Rj(this,ehH(this),t-Y1(this.zh()),e,n)},eUe.lh=function(e){var t;switch(e){case 0:return!!this.Ab&&0!=this.Ab.i;case 1:return null!=this.zb;case 2:return null!=this.D&&this.D==this.F;case 3:return!!em4(this);case 4:return null!=this.zj();case 5:return null!=this.F&&this.F!=this.D&&this.F!=this.B;case 6:return!!z6(this);case 7:return!!this.A&&0!=this.A.i}return VP(this,e-Y1(this.zh()),ee2((t=Pp(eaS(this,16),26))||this.zh(),e))},eUe.sh=function(e,t){var n;switch(e){case 0:this.Ab||(this.Ab=new FQ(tm4,this,0,3)),eRT(this.Ab),this.Ab||(this.Ab=new FQ(tm4,this,0,3)),Y4(this.Ab,Pp(t,14));return;case 1:GN(this,Lq(t));return;case 2:TF(this,Lq(t));return;case 5:eji(this,Lq(t));return;case 7:this.A||(this.A=new OS(tgs,this,7)),eRT(this.A),this.A||(this.A=new OS(tgs,this,7)),Y4(this.A,Pp(t,14));return}efL(this,e-Y1(this.zh()),ee2((n=Pp(eaS(this,16),26))||this.zh(),e),t)},eUe.zh=function(){return eBK(),tgE},eUe.Bh=function(e){var t;switch(e){case 0:this.Ab||(this.Ab=new FQ(tm4,this,0,3)),eRT(this.Ab);return;case 1:M4(this.Cb,179)&&(Pp(this.Cb,179).tb=null),er3(this,null);return;case 2:euc(this,null),enp(this,this.D);return;case 5:eji(this,null);return;case 7:this.A||(this.A=new OS(tgs,this,7)),eRT(this.A);return}ec5(this,e-Y1(this.zh()),ee2((t=Pp(eaS(this,16),26))||this.zh(),e))},eUe.yj=function(){var e;return -1==this.G&&(this.G=(e=etP(this))?ebv(e.Mh(),this):-1),this.G},eUe.zj=function(){return null},eUe.Aj=function(){return etP(this)},eUe.vk=function(){return this.v},eUe.Bj=function(){return em4(this)},eUe.Cj=function(){return null!=this.D?this.D:this.B},eUe.Dj=function(){return this.F},eUe.wj=function(e){return eNc(this,e)},eUe.wk=function(e){this.v=e},eUe.xk=function(e){eia(this,e)},eUe.yk=function(e){this.C=e},eUe.Lh=function(e){GN(this,e)},eUe.Ib=function(){return edb(this)},eUe.C=null,eUe.D=null,eUe.G=-1,Y6(eZ2,"EClassifierImpl",351),eTS(88,351,{105:1,92:1,90:1,26:1,138:1,147:1,191:1,56:1,108:1,49:1,97:1,88:1,351:1,150:1,473:1,114:1,115:1,676:1},c0),eUe.uk=function(e){return C7(this,e.Tg())},eUe._g=function(e,t,n){var r;switch(e){case 0:return this.Ab||(this.Ab=new FQ(tm4,this,0,3)),this.Ab;case 1:return this.zb;case 2:return null!=this.D?this.D:this.B;case 3:return em4(this);case 4:return null;case 5:return this.F;case 6:if(t)return etP(this);return z6(this);case 7:return this.A||(this.A=new OS(tgs,this,7)),this.A;case 8:return OQ(),(256&this.Bb)!=0;case 9:return OQ(),(512&this.Bb)!=0;case 10:return $E(this);case 11:return this.q||(this.q=new FQ(tgi,this,11,10)),this.q;case 12:return ePk(this);case 13:return ePl(this);case 14:return ePl(this),this.r;case 15:return ePk(this),this.k;case 16:return eSD(this);case 17:return eNQ(this);case 18:return eNT(this);case 19:return eOg(this);case 20:return ePk(this),this.o;case 21:return this.s||(this.s=new FQ(tm5,this,21,17)),this.s;case 22:return qt(this);case 23:return eCt(this)}return Qt(this,e-Y1((eBK(),tg_)),ee2((r=Pp(eaS(this,16),26))||tg_,e),t,n)},eUe.hh=function(e,t,n){var r,i,a;switch(t){case 0:return this.Ab||(this.Ab=new FQ(tm4,this,0,3)),edF(this.Ab,e,n);case 6:return this.Cb&&(n=(i=this.Db>>16)>=0?egn(this,n):this.Cb.ih(this,-1-i,null,n)),eDg(this,e,6,n);case 11:return this.q||(this.q=new FQ(tgi,this,11,10)),edF(this.q,e,n);case 21:return this.s||(this.s=new FQ(tm5,this,21,17)),edF(this.s,e,n)}return(a=Pp(ee2((r=Pp(eaS(this,16),26))||(eBK(),tg_),t),66)).Nj().Qj(this,ehH(this),t-Y1((eBK(),tg_)),e,n)},eUe.jh=function(e,t,n){var r,i;switch(t){case 0:return this.Ab||(this.Ab=new FQ(tm4,this,0,3)),ep5(this.Ab,e,n);case 6:return eDg(this,null,6,n);case 7:return this.A||(this.A=new OS(tgs,this,7)),ep5(this.A,e,n);case 11:return this.q||(this.q=new FQ(tgi,this,11,10)),ep5(this.q,e,n);case 21:return this.s||(this.s=new FQ(tm5,this,21,17)),ep5(this.s,e,n);case 22:return ep5(qt(this),e,n)}return(i=Pp(ee2((r=Pp(eaS(this,16),26))||(eBK(),tg_),t),66)).Nj().Rj(this,ehH(this),t-Y1((eBK(),tg_)),e,n)},eUe.lh=function(e){var t;switch(e){case 0:return!!this.Ab&&0!=this.Ab.i;case 1:return null!=this.zb;case 2:return null!=this.D&&this.D==this.F;case 3:return!!em4(this);case 4:return!1;case 5:return null!=this.F&&this.F!=this.D&&this.F!=this.B;case 6:return!!z6(this);case 7:return!!this.A&&0!=this.A.i;case 8:return(256&this.Bb)!=0;case 9:return(512&this.Bb)!=0;case 10:return!!this.u&&0!=qt(this.u.a).i&&!(this.n&&ebV(this.n));case 11:return!!this.q&&0!=this.q.i;case 12:return 0!=ePk(this).i;case 13:return 0!=ePl(this).i;case 14:return ePl(this),0!=this.r.i;case 15:return ePk(this),0!=this.k.i;case 16:return 0!=eSD(this).i;case 17:return 0!=eNQ(this).i;case 18:return 0!=eNT(this).i;case 19:return 0!=eOg(this).i;case 20:return ePk(this),!!this.o;case 21:return!!this.s&&0!=this.s.i;case 22:return!!this.n&&ebV(this.n);case 23:return 0!=eCt(this).i}return VP(this,e-Y1((eBK(),tg_)),ee2((t=Pp(eaS(this,16),26))||tg_,e))},eUe.oh=function(e){var t;return(t=null==this.i||this.q&&0!=this.q.i?null:eAh(this,e))||eF8(this,e)},eUe.sh=function(e,t){var n;switch(e){case 0:this.Ab||(this.Ab=new FQ(tm4,this,0,3)),eRT(this.Ab),this.Ab||(this.Ab=new FQ(tm4,this,0,3)),Y4(this.Ab,Pp(t,14));return;case 1:GN(this,Lq(t));return;case 2:TF(this,Lq(t));return;case 5:eji(this,Lq(t));return;case 7:this.A||(this.A=new OS(tgs,this,7)),eRT(this.A),this.A||(this.A=new OS(tgs,this,7)),Y4(this.A,Pp(t,14));return;case 8:ela(this,gN(LK(t)));return;case 9:elu(this,gN(LK(t)));return;case 10:eRP($E(this)),Y4($E(this),Pp(t,14));return;case 11:this.q||(this.q=new FQ(tgi,this,11,10)),eRT(this.q),this.q||(this.q=new FQ(tgi,this,11,10)),Y4(this.q,Pp(t,14));return;case 21:this.s||(this.s=new FQ(tm5,this,21,17)),eRT(this.s),this.s||(this.s=new FQ(tm5,this,21,17)),Y4(this.s,Pp(t,14));return;case 22:eRT(qt(this)),Y4(qt(this),Pp(t,14));return}efL(this,e-Y1((eBK(),tg_)),ee2((n=Pp(eaS(this,16),26))||tg_,e),t)},eUe.zh=function(){return eBK(),tg_},eUe.Bh=function(e){var t;switch(e){case 0:this.Ab||(this.Ab=new FQ(tm4,this,0,3)),eRT(this.Ab);return;case 1:M4(this.Cb,179)&&(Pp(this.Cb,179).tb=null),er3(this,null);return;case 2:euc(this,null),enp(this,this.D);return;case 5:eji(this,null);return;case 7:this.A||(this.A=new OS(tgs,this,7)),eRT(this.A);return;case 8:ela(this,!1);return;case 9:elu(this,!1);return;case 10:this.u&&eRP(this.u);return;case 11:this.q||(this.q=new FQ(tgi,this,11,10)),eRT(this.q);return;case 21:this.s||(this.s=new FQ(tm5,this,21,17)),eRT(this.s);return;case 22:this.n&&eRT(this.n);return}ec5(this,e-Y1((eBK(),tg_)),ee2((t=Pp(eaS(this,16),26))||tg_,e))},eUe.Gh=function(){var e,t;if(ePk(this),ePl(this),eSD(this),eNQ(this),eNT(this),eOg(this),eCt(this),ZG(Pw(Zd(this))),this.s)for(e=0,t=this.s.i;e=0;--t)etj(this,t);return edj(this,e)},eUe.Xj=function(){eRT(this)},eUe.oi=function(e,t){return env(this,e,t)},Y6(eJz,"EcoreEList",622),eTS(496,622,eJ8,PK),eUe.ai=function(){return!1},eUe.aj=function(){return this.c},eUe.bj=function(){return!1},eUe.Fk=function(){return!0},eUe.hi=function(){return!0},eUe.li=function(e,t){return t},eUe.ni=function(){return!1},eUe.c=0,Y6(eJz,"EObjectEList",496),eTS(85,496,eJ8,O_),eUe.bj=function(){return!0},eUe.Dk=function(){return!1},eUe.rk=function(){return!0},Y6(eJz,"EObjectContainmentEList",85),eTS(545,85,eJ8,OE),eUe.ci=function(){this.b=!0},eUe.fj=function(){return this.b},eUe.Xj=function(){var e;eRT(this),TO(this.e)?(e=this.b,this.b=!1,eam(this.e,new ZB(this.e,2,this.c,e,!1))):this.b=!1},eUe.b=!1,Y6(eJz,"EObjectContainmentEList/Unsettable",545),eTS(1140,545,eJ8,j4),eUe.ii=function(e,t){var n,r;return n=Pp(elR(this,e,t),87),TO(this.e)&&bz(this,new JU(this.a,7,(eBK(),tgS),ell(t),M4(r=n.c,88)?Pp(r,26):tgI,e)),n},eUe.jj=function(e,t){return edB(this,Pp(e,87),t)},eUe.kj=function(e,t){return edY(this,Pp(e,87),t)},eUe.lj=function(e,t,n){return eyl(this,Pp(e,87),Pp(t,87),n)},eUe.Zi=function(e,t,n,r,i){switch(e){case 3:return Gt(this,e,t,n,r,this.i>1);case 5:return Gt(this,e,t,n,r,this.i-Pp(n,15).gc()>0);default:return new Q$(this.e,e,this.c,t,n,r,!0)}},eUe.ij=function(){return!0},eUe.fj=function(){return ebV(this)},eUe.Xj=function(){eRT(this)},Y6(eZ2,"EClassImpl/1",1140),eTS(1154,1153,eJS),eUe.ui=function(e){var t,n,r,i,a,o,s;if(8!=(n=e.xi())){if(0==(r=epM(e)))switch(n){case 1:case 9:null!=(s=e.Bi())&&((t=Zd(Pp(s,473))).c||(t.c=new sk),eeu(t.c,e.Ai())),null!=(o=e.zi())&&(1&(i=Pp(o,473)).Bb)==0&&((t=Zd(i)).c||(t.c=new sk),JL(t.c,Pp(e.Ai(),26)));break;case 3:null!=(o=e.zi())&&(1&(i=Pp(o,473)).Bb)==0&&((t=Zd(i)).c||(t.c=new sk),JL(t.c,Pp(e.Ai(),26)));break;case 5:if(null!=(o=e.zi()))for(a=Pp(o,14).Kc();a.Ob();)(1&(i=Pp(a.Pb(),473)).Bb)==0&&((t=Zd(i)).c||(t.c=new sk),JL(t.c,Pp(e.Ai(),26)));break;case 4:null!=(s=e.Bi())&&(1&(i=Pp(s,473)).Bb)==0&&((t=Zd(i)).c||(t.c=new sk),eeu(t.c,e.Ai()));break;case 6:if(null!=(s=e.Bi()))for(a=Pp(s,14).Kc();a.Ob();)(1&(i=Pp(a.Pb(),473)).Bb)==0&&((t=Zd(i)).c||(t.c=new sk),eeu(t.c,e.Ai()))}this.Hk(r)}},eUe.Hk=function(e){eCO(this,e)},eUe.b=63,Y6(eZ2,"ESuperAdapter",1154),eTS(1155,1154,eJS,pR),eUe.Hk=function(e){eko(this,e)},Y6(eZ2,"EClassImpl/10",1155),eTS(1144,696,eJ8),eUe.Vh=function(e,t){return ew2(this,e,t)},eUe.Wh=function(e){return emp(this,e)},eUe.Xh=function(e,t){ecW(this,e,t)},eUe.Yh=function(e){Zz(this,e)},eUe.pi=function(e){return J6(this,e)},eUe.mi=function(e,t){return ees(this,e,t)},eUe.lk=function(e,t){throw p7(new bO)},eUe.Zh=function(){return new AY(this)},eUe.$h=function(){return new AB(this)},eUe._h=function(e){return enH(this,e)},eUe.mk=function(e,t){throw p7(new bO)},eUe.Wj=function(e){return this},eUe.fj=function(){return 0!=this.i},eUe.Wb=function(e){throw p7(new bO)},eUe.Xj=function(){throw p7(new bO)},Y6(eJz,"EcoreEList/UnmodifiableEList",1144),eTS(319,1144,eJ8,xQ),eUe.ni=function(){return!1},Y6(eJz,"EcoreEList/UnmodifiableEList/FastCompare",319),eTS(1147,319,eJ8,eo9),eUe.Xc=function(e){var t,n,r;if(M4(e,170)&&-1!=(n=(t=Pp(e,170)).aj())){for(r=this.i;n4){if(!this.wj(e))return!1;if(this.rk()){if(s=(n=(r=Pp(e,49)).Ug())==this.b&&(this.Dk()?r.Og(r.Vg(),Pp(ee2($S(this.b),this.aj()).Yj(),26).Bj())==ebY(Pp(ee2($S(this.b),this.aj()),18)).n:-1-r.Vg()==this.aj()),this.Ek()&&!s&&!n&&r.Zg()){for(i=0;i1||-1==r)},eUe.Dk=function(){var e,t,n;return t=ee2($S(this.b),this.aj()),!!M4(t,99)&&!!(n=ebY(e=Pp(t,18)))},eUe.Ek=function(){var e,t;return t=ee2($S(this.b),this.aj()),!!M4(t,99)&&((e=Pp(t,18)).Bb&eH3)!=0},eUe.Xc=function(e){var t,n,r,i;if((r=this.Qi(e))>=0)return r;if(this.Fk()){for(n=0,i=this.Vi();n=0;--e)ejc(this,e,this.Oi(e));return this.Wi()},eUe.Qc=function(e){var t;if(this.Ek())for(t=this.Vi()-1;t>=0;--t)ejc(this,t,this.Oi(t));return this.Xi(e)},eUe.Xj=function(){eRP(this)},eUe.oi=function(e,t){return J5(this,e,t)},Y6(eJz,"DelegatingEcoreEList",742),eTS(1150,742,eQn,Cw),eUe.Hi=function(e,t){LP(this,e,Pp(t,26))},eUe.Ii=function(e){Mt(this,Pp(e,26))},eUe.Oi=function(e){var t,n;return n=(t=Pp(etj(qt(this.a),e),87)).c,M4(n,88)?Pp(n,26):(eBK(),tgI)},eUe.Ti=function(e){var t,n;return n=(t=Pp(eLN(qt(this.a),e),87)).c,M4(n,88)?Pp(n,26):(eBK(),tgI)},eUe.Ui=function(e,t){return emm(this,e,Pp(t,26))},eUe.ai=function(){return!1},eUe.Zi=function(e,t,n,r,i){return null},eUe.Ji=function(){return new pF(this)},eUe.Ki=function(){eRT(qt(this.a))},eUe.Li=function(e){return ec7(this,e)},eUe.Mi=function(e){var t,n;for(n=e.Kc();n.Ob();)if(!ec7(this,t=n.Pb()))return!1;return!0},eUe.Ni=function(e){var t,n,r;if(M4(e,15)&&(r=Pp(e,15)).gc()==qt(this.a).i){for(t=r.Kc(),n=new Ow(this);t.Ob();)if(xc(t.Pb())!==xc(epH(n)))return!1;return!0}return!1},eUe.Pi=function(){var e,t,n,r,i;for(n=1,t=new Ow(qt(this.a));t.e!=t.i.gc();)e=Pp(epH(t),87),r=M4(i=e.c,88)?Pp(i,26):(eBK(),tgI),n=31*n+(r?Ao(r):0);return n},eUe.Qi=function(e){var t,n,r,i;for(r=0,n=new Ow(qt(this.a));n.e!=n.i.gc();){if(t=Pp(epH(n),87),xc(e)===xc(M4(i=t.c,88)?Pp(i,26):(eBK(),tgI)))return r;++r}return -1},eUe.Ri=function(){return 0==qt(this.a).i},eUe.Si=function(){return null},eUe.Vi=function(){return qt(this.a).i},eUe.Wi=function(){var e,t,n,r,i,a;for(a=qt(this.a).i,i=Je(e1R,eUp,1,a,5,1),n=0,t=new Ow(qt(this.a));t.e!=t.i.gc();)e=Pp(epH(t),87),i[n++]=M4(r=e.c,88)?Pp(r,26):(eBK(),tgI);return i},eUe.Xi=function(e){var t,n,r,i,a,o,s;for(s=qt(this.a).i,e.lengths&&Bc(e,s,null),r=0,n=new Ow(qt(this.a));n.e!=n.i.gc();)t=Pp(epH(n),87),a=M4(o=t.c,88)?Pp(o,26):(eBK(),tgI),Bc(e,r++,a);return e},eUe.Yi=function(){var e,t,n,r,i;for(i=new vs,i.a+="[",e=qt(this.a),t=0,r=qt(this.a).i;t>16)>=0?egn(this,n):this.Cb.ih(this,-1-i,null,n)),eDg(this,e,6,n);case 9:return this.a||(this.a=new FQ(tgn,this,9,5)),edF(this.a,e,n)}return(a=Pp(ee2((r=Pp(eaS(this,16),26))||(eBK(),tgx),t),66)).Nj().Qj(this,ehH(this),t-Y1((eBK(),tgx)),e,n)},eUe.jh=function(e,t,n){var r,i;switch(t){case 0:return this.Ab||(this.Ab=new FQ(tm4,this,0,3)),ep5(this.Ab,e,n);case 6:return eDg(this,null,6,n);case 7:return this.A||(this.A=new OS(tgs,this,7)),ep5(this.A,e,n);case 9:return this.a||(this.a=new FQ(tgn,this,9,5)),ep5(this.a,e,n)}return(i=Pp(ee2((r=Pp(eaS(this,16),26))||(eBK(),tgx),t),66)).Nj().Rj(this,ehH(this),t-Y1((eBK(),tgx)),e,n)},eUe.lh=function(e){var t;switch(e){case 0:return!!this.Ab&&0!=this.Ab.i;case 1:return null!=this.zb;case 2:return null!=this.D&&this.D==this.F;case 3:return!!em4(this);case 4:return!!euS(this);case 5:return null!=this.F&&this.F!=this.D&&this.F!=this.B;case 6:return!!z6(this);case 7:return!!this.A&&0!=this.A.i;case 8:return(256&this.Bb)==0;case 9:return!!this.a&&0!=this.a.i}return VP(this,e-Y1((eBK(),tgx)),ee2((t=Pp(eaS(this,16),26))||tgx,e))},eUe.sh=function(e,t){var n;switch(e){case 0:this.Ab||(this.Ab=new FQ(tm4,this,0,3)),eRT(this.Ab),this.Ab||(this.Ab=new FQ(tm4,this,0,3)),Y4(this.Ab,Pp(t,14));return;case 1:GN(this,Lq(t));return;case 2:TF(this,Lq(t));return;case 5:eji(this,Lq(t));return;case 7:this.A||(this.A=new OS(tgs,this,7)),eRT(this.A),this.A||(this.A=new OS(tgs,this,7)),Y4(this.A,Pp(t,14));return;case 8:elo(this,gN(LK(t)));return;case 9:this.a||(this.a=new FQ(tgn,this,9,5)),eRT(this.a),this.a||(this.a=new FQ(tgn,this,9,5)),Y4(this.a,Pp(t,14));return}efL(this,e-Y1((eBK(),tgx)),ee2((n=Pp(eaS(this,16),26))||tgx,e),t)},eUe.zh=function(){return eBK(),tgx},eUe.Bh=function(e){var t;switch(e){case 0:this.Ab||(this.Ab=new FQ(tm4,this,0,3)),eRT(this.Ab);return;case 1:M4(this.Cb,179)&&(Pp(this.Cb,179).tb=null),er3(this,null);return;case 2:euc(this,null),enp(this,this.D);return;case 5:eji(this,null);return;case 7:this.A||(this.A=new OS(tgs,this,7)),eRT(this.A);return;case 8:elo(this,!0);return;case 9:this.a||(this.a=new FQ(tgn,this,9,5)),eRT(this.a);return}ec5(this,e-Y1((eBK(),tgx)),ee2((t=Pp(eaS(this,16),26))||tgx,e))},eUe.Gh=function(){var e,t;if(this.a)for(e=0,t=this.a.i;e>16==5?Pp(this.Cb,671):null}return Qt(this,e-Y1((eBK(),tgT)),ee2((r=Pp(eaS(this,16),26))||tgT,e),t,n)},eUe.hh=function(e,t,n){var r,i,a;switch(t){case 0:return this.Ab||(this.Ab=new FQ(tm4,this,0,3)),edF(this.Ab,e,n);case 5:return this.Cb&&(n=(i=this.Db>>16)>=0?eg3(this,n):this.Cb.ih(this,-1-i,null,n)),eDg(this,e,5,n)}return(a=Pp(ee2((r=Pp(eaS(this,16),26))||(eBK(),tgT),t),66)).Nj().Qj(this,ehH(this),t-Y1((eBK(),tgT)),e,n)},eUe.jh=function(e,t,n){var r,i;switch(t){case 0:return this.Ab||(this.Ab=new FQ(tm4,this,0,3)),ep5(this.Ab,e,n);case 5:return eDg(this,null,5,n)}return(i=Pp(ee2((r=Pp(eaS(this,16),26))||(eBK(),tgT),t),66)).Nj().Rj(this,ehH(this),t-Y1((eBK(),tgT)),e,n)},eUe.lh=function(e){var t;switch(e){case 0:return!!this.Ab&&0!=this.Ab.i;case 1:return null!=this.zb;case 2:return 0!=this.d;case 3:return!!this.b;case 4:return null!=this.c;case 5:return!!(this.Db>>16==5?Pp(this.Cb,671):null)}return VP(this,e-Y1((eBK(),tgT)),ee2((t=Pp(eaS(this,16),26))||tgT,e))},eUe.sh=function(e,t){var n;switch(e){case 0:this.Ab||(this.Ab=new FQ(tm4,this,0,3)),eRT(this.Ab),this.Ab||(this.Ab=new FQ(tm4,this,0,3)),Y4(this.Ab,Pp(t,14));return;case 1:er3(this,Lq(t));return;case 2:enf(this,Pp(t,19).a);return;case 3:exP(this,Pp(t,1940));return;case 4:erc(this,Lq(t));return}efL(this,e-Y1((eBK(),tgT)),ee2((n=Pp(eaS(this,16),26))||tgT,e),t)},eUe.zh=function(){return eBK(),tgT},eUe.Bh=function(e){var t;switch(e){case 0:this.Ab||(this.Ab=new FQ(tm4,this,0,3)),eRT(this.Ab);return;case 1:er3(this,null);return;case 2:enf(this,0);return;case 3:exP(this,null);return;case 4:erc(this,null);return}ec5(this,e-Y1((eBK(),tgT)),ee2((t=Pp(eaS(this,16),26))||tgT,e))},eUe.Ib=function(){var e;return null==(e=this.c)?this.zb:e},eUe.b=null,eUe.c=null,eUe.d=0,Y6(eZ2,"EEnumLiteralImpl",573);var tgl=RL(eZ2,"EFactoryImpl/InternalEDateTimeFormat");eTS(489,1,{2015:1},pY),Y6(eZ2,"EFactoryImpl/1ClientInternalEDateTimeFormat",489),eTS(241,115,{105:1,92:1,90:1,87:1,56:1,108:1,49:1,97:1,241:1,114:1,115:1},p6),eUe.Sg=function(e,t,n){var r;return n=eDg(this,e,t,n),this.e&&M4(e,170)&&(r=eOl(this,this.e))!=this.c&&(n=eFr(this,r,n)),n},eUe._g=function(e,t,n){var r;switch(e){case 0:return this.f;case 1:return this.d||(this.d=new O_(tgr,this,1)),this.d;case 2:if(t)return eD6(this);return this.c;case 3:return this.b;case 4:return this.e;case 5:if(t)return eb1(this);return this.a}return Qt(this,e-Y1((eBK(),tgO)),ee2((r=Pp(eaS(this,16),26))||tgO,e),t,n)},eUe.jh=function(e,t,n){var r,i;switch(t){case 0:return ecg(this,null,n);case 1:return this.d||(this.d=new O_(tgr,this,1)),ep5(this.d,e,n);case 3:return ecm(this,null,n)}return(i=Pp(ee2((r=Pp(eaS(this,16),26))||(eBK(),tgO),t),66)).Nj().Rj(this,ehH(this),t-Y1((eBK(),tgO)),e,n)},eUe.lh=function(e){var t;switch(e){case 0:return!!this.f;case 1:return!!this.d&&0!=this.d.i;case 2:return!!this.c;case 3:return!!this.b;case 4:return!!this.e;case 5:return!!this.a}return VP(this,e-Y1((eBK(),tgO)),ee2((t=Pp(eaS(this,16),26))||tgO,e))},eUe.sh=function(e,t){var n;switch(e){case 0:eyK(this,Pp(t,87));return;case 1:this.d||(this.d=new O_(tgr,this,1)),eRT(this.d),this.d||(this.d=new O_(tgr,this,1)),Y4(this.d,Pp(t,14));return;case 3:eyW(this,Pp(t,87));return;case 4:e_U(this,Pp(t,836));return;case 5:etV(this,Pp(t,138));return}efL(this,e-Y1((eBK(),tgO)),ee2((n=Pp(eaS(this,16),26))||tgO,e),t)},eUe.zh=function(){return eBK(),tgO},eUe.Bh=function(e){var t;switch(e){case 0:eyK(this,null);return;case 1:this.d||(this.d=new O_(tgr,this,1)),eRT(this.d);return;case 3:eyW(this,null);return;case 4:e_U(this,null);return;case 5:etV(this,null);return}ec5(this,e-Y1((eBK(),tgO)),ee2((t=Pp(eaS(this,16),26))||tgO,e))},eUe.Ib=function(){var e;return e=new O0(eMT(this)),e.a+=" (expression: ",ePB(this,e),e.a+=")",e.a},Y6(eZ2,"EGenericTypeImpl",241),eTS(1969,1964,eQr),eUe.Xh=function(e,t){Ch(this,e,t)},eUe.lk=function(e,t){return Ch(this,this.gc(),e),t},eUe.pi=function(e){return ep3(this.Gi(),e)},eUe.Zh=function(){return this.$h()},eUe.Gi=function(){return new pV(this)},eUe.$h=function(){return this._h(0)},eUe._h=function(e){return this.Gi().Zc(e)},eUe.mk=function(e,t){return eds(this,e,!0),t},eUe.ii=function(e,t){var n,r;return r=egW(this,t),(n=this.Zc(e)).Rb(r),r},eUe.ji=function(e,t){var n;eds(this,t,!0),(n=this.Zc(e)).Rb(t)},Y6(eJz,"AbstractSequentialInternalEList",1969),eTS(486,1969,eQr,AA),eUe.pi=function(e){return ep3(this.Gi(),e)},eUe.Zh=function(){return null==this.b?(_2(),_2(),tgq):this.Jk()},eUe.Gi=function(){return new x0(this.a,this.b)},eUe.$h=function(){return null==this.b?(_2(),_2(),tgq):this.Jk()},eUe._h=function(e){var t,n;if(null==this.b){if(e<0||e>1)throw p7(new gE(eJT+e+", size=0"));return _2(),_2(),tgq}for(t=0,n=this.Jk();t0;)if(t=this.c[--this.d],(!this.e||t.Gj()!=e5d||0!=t.aj())&&(!this.Mk()||this.b.mh(t))){if(a=this.b.bh(t,this.Lk()),this.f=(_4(),Pp(t,66).Oj()),this.f||t.$j()){if(this.Lk()?(r=Pp(a,15),this.k=r):(r=Pp(a,69),this.k=this.j=r),M4(this.k,54)?(this.o=this.k.gc(),this.n=this.o):this.p=this.j?this.j._h(this.k.gc()):this.k.Zc(this.k.gc()),this.p?eSs(this,this.p):eSQ(this))return i=this.p?this.p.Ub():this.j?this.j.pi(--this.n):this.k.Xb(--this.n),this.f?((e=Pp(i,72)).ak(),n=e.dd(),this.i=n):(n=i,this.i=n),this.g=-3,!0}else if(null!=a)return this.k=null,this.p=null,n=a,this.i=n,this.g=-2,!0}return this.k=null,this.p=null,this.g=-1,!1}},eUe.Pb=function(){return eaO(this)},eUe.Tb=function(){return this.a},eUe.Ub=function(){var e;if(this.g<-1||this.Sb())return--this.a,this.g=0,e=this.i,this.Sb(),e;throw p7(new bC)},eUe.Vb=function(){return this.a-1},eUe.Qb=function(){throw p7(new bO)},eUe.Lk=function(){return!1},eUe.Wb=function(e){throw p7(new bO)},eUe.Mk=function(){return!0},eUe.a=0,eUe.d=0,eUe.f=!1,eUe.g=0,eUe.n=0,eUe.o=0,Y6(eJz,"EContentsEList/FeatureIteratorImpl",279),eTS(697,279,eQi,Lv),eUe.Lk=function(){return!0},Y6(eJz,"EContentsEList/ResolvingFeatureIteratorImpl",697),eTS(1157,697,eQi,Lw),eUe.Mk=function(){return!1},Y6(eZ2,"ENamedElementImpl/1/1",1157),eTS(1158,279,eQi,Ly),eUe.Mk=function(){return!1},Y6(eZ2,"ENamedElementImpl/1/2",1158),eTS(36,143,eJx,qo,qs,FX,JB,Q$,ZB,en_,WX,enE,WJ,Zj,WQ,enx,W1,ZF,W0,enS,W2,FJ,JU,H0,enk,W3,ZY,W4),eUe._i=function(){return JA(this)},eUe.gj=function(){var e;return(e=JA(this))?e.zj():null},eUe.yi=function(e){return -1==this.b&&this.a&&(this.b=this.c.Xg(this.a.aj(),this.a.Gj())),this.c.Og(this.b,e)},eUe.Ai=function(){return this.c},eUe.hj=function(){var e;return!!(e=JA(this))&&e.Kj()},eUe.b=-1,Y6(eZ2,"ENotificationImpl",36),eTS(399,284,{105:1,92:1,90:1,147:1,191:1,56:1,59:1,108:1,472:1,49:1,97:1,150:1,399:1,284:1,114:1,115:1},mD),eUe.Qg=function(e){return evu(this,e)},eUe._g=function(e,t,n){var r,i,a;switch(e){case 0:return this.Ab||(this.Ab=new FQ(tm4,this,0,3)),this.Ab;case 1:return this.zb;case 2:return OQ(),(256&this.Bb)!=0;case 3:return OQ(),(512&this.Bb)!=0;case 4:return ell(this.s);case 5:return ell(this.t);case 6:return OQ(),(a=this.t)>1||-1==a;case 7:return OQ(),(i=this.s)>=1;case 8:if(t)return evl(this);return this.r;case 9:return this.q;case 10:return this.Db>>16==10?Pp(this.Cb,26):null;case 11:return this.d||(this.d=new OS(tgs,this,11)),this.d;case 12:return this.c||(this.c=new FQ(tga,this,12,10)),this.c;case 13:return this.a||(this.a=new C_(this,this)),this.a;case 14:return QX(this)}return Qt(this,e-Y1((eBK(),tgD)),ee2((r=Pp(eaS(this,16),26))||tgD,e),t,n)},eUe.hh=function(e,t,n){var r,i,a;switch(t){case 0:return this.Ab||(this.Ab=new FQ(tm4,this,0,3)),edF(this.Ab,e,n);case 10:return this.Cb&&(n=(i=this.Db>>16)>=0?evu(this,n):this.Cb.ih(this,-1-i,null,n)),eDg(this,e,10,n);case 12:return this.c||(this.c=new FQ(tga,this,12,10)),edF(this.c,e,n)}return(a=Pp(ee2((r=Pp(eaS(this,16),26))||(eBK(),tgD),t),66)).Nj().Qj(this,ehH(this),t-Y1((eBK(),tgD)),e,n)},eUe.jh=function(e,t,n){var r,i;switch(t){case 0:return this.Ab||(this.Ab=new FQ(tm4,this,0,3)),ep5(this.Ab,e,n);case 9:return Y3(this,n);case 10:return eDg(this,null,10,n);case 11:return this.d||(this.d=new OS(tgs,this,11)),ep5(this.d,e,n);case 12:return this.c||(this.c=new FQ(tga,this,12,10)),ep5(this.c,e,n);case 14:return ep5(QX(this),e,n)}return(i=Pp(ee2((r=Pp(eaS(this,16),26))||(eBK(),tgD),t),66)).Nj().Rj(this,ehH(this),t-Y1((eBK(),tgD)),e,n)},eUe.lh=function(e){var t,n,r;switch(e){case 0:return!!this.Ab&&0!=this.Ab.i;case 1:return null!=this.zb;case 2:return(256&this.Bb)==0;case 3:return(512&this.Bb)==0;case 4:return 0!=this.s;case 5:return 1!=this.t;case 6:return(r=this.t)>1||-1==r;case 7:return(n=this.s)>=1;case 8:return!!this.r&&!this.q.e&&0==BX(this.q).i;case 9:return!!this.q&&!(this.r&&!this.q.e&&0==BX(this.q).i);case 10:return!!(this.Db>>16==10?Pp(this.Cb,26):null);case 11:return!!this.d&&0!=this.d.i;case 12:return!!this.c&&0!=this.c.i;case 13:return!!this.a&&0!=QX(this.a.a).i&&!(this.b&&ebq(this.b));case 14:return!!this.b&&ebq(this.b)}return VP(this,e-Y1((eBK(),tgD)),ee2((t=Pp(eaS(this,16),26))||tgD,e))},eUe.sh=function(e,t){var n,r;switch(e){case 0:this.Ab||(this.Ab=new FQ(tm4,this,0,3)),eRT(this.Ab),this.Ab||(this.Ab=new FQ(tm4,this,0,3)),Y4(this.Ab,Pp(t,14));return;case 1:er3(this,Lq(t));return;case 2:eli(this,gN(LK(t)));return;case 3:els(this,gN(LK(t)));return;case 4:end(this,Pp(t,19).a);return;case 5:enh(this,Pp(t,19).a);return;case 8:eu2(this,Pp(t,138));return;case 9:(r=ew3(this,Pp(t,87),null))&&r.Fi();return;case 11:this.d||(this.d=new OS(tgs,this,11)),eRT(this.d),this.d||(this.d=new OS(tgs,this,11)),Y4(this.d,Pp(t,14));return;case 12:this.c||(this.c=new FQ(tga,this,12,10)),eRT(this.c),this.c||(this.c=new FQ(tga,this,12,10)),Y4(this.c,Pp(t,14));return;case 13:this.a||(this.a=new C_(this,this)),eRP(this.a),this.a||(this.a=new C_(this,this)),Y4(this.a,Pp(t,14));return;case 14:eRT(QX(this)),Y4(QX(this),Pp(t,14));return}efL(this,e-Y1((eBK(),tgD)),ee2((n=Pp(eaS(this,16),26))||tgD,e),t)},eUe.zh=function(){return eBK(),tgD},eUe.Bh=function(e){var t,n;switch(e){case 0:this.Ab||(this.Ab=new FQ(tm4,this,0,3)),eRT(this.Ab);return;case 1:er3(this,null);return;case 2:eli(this,!0);return;case 3:els(this,!0);return;case 4:end(this,0);return;case 5:enh(this,1);return;case 8:eu2(this,null);return;case 9:(n=ew3(this,null,null))&&n.Fi();return;case 11:this.d||(this.d=new OS(tgs,this,11)),eRT(this.d);return;case 12:this.c||(this.c=new FQ(tga,this,12,10)),eRT(this.c);return;case 13:this.a&&eRP(this.a);return;case 14:this.b&&eRT(this.b);return}ec5(this,e-Y1((eBK(),tgD)),ee2((t=Pp(eaS(this,16),26))||tgD,e))},eUe.Gh=function(){var e,t;if(this.c)for(e=0,t=this.c.i;es&&Bc(e,s,null),r=0,n=new Ow(QX(this.a));n.e!=n.i.gc();)a=(o=(t=Pp(epH(n),87)).c)||(eBK(),tgA),Bc(e,r++,a);return e},eUe.Yi=function(){var e,t,n,r,i;for(i=new vs,i.a+="[",e=QX(this.a),t=0,r=QX(this.a).i;t1);case 5:return Gt(this,e,t,n,r,this.i-Pp(n,15).gc()>0);default:return new Q$(this.e,e,this.c,t,n,r,!0)}},eUe.ij=function(){return!0},eUe.fj=function(){return ebq(this)},eUe.Xj=function(){eRT(this)},Y6(eZ2,"EOperationImpl/2",1341),eTS(498,1,{1938:1,498:1},k6),Y6(eZ2,"EPackageImpl/1",498),eTS(16,85,eJ8,FQ),eUe.zk=function(){return this.d},eUe.Ak=function(){return this.b},eUe.Dk=function(){return!0},eUe.b=0,Y6(eJz,"EObjectContainmentWithInverseEList",16),eTS(353,16,eJ8,Ia),eUe.Ek=function(){return!0},eUe.li=function(e,t){return ex7(this,e,Pp(t,56))},Y6(eJz,"EObjectContainmentWithInverseEList/Resolving",353),eTS(298,353,eJ8,Fq),eUe.ci=function(){this.a.tb=null},Y6(eZ2,"EPackageImpl/2",298),eTS(1228,1,{},sh),Y6(eZ2,"EPackageImpl/3",1228),eTS(718,43,e$s,mP),eUe._b=function(e){return xd(e)?$r(this,e):!!$I(this.f,e)},Y6(eZ2,"EPackageRegistryImpl",718),eTS(509,284,{105:1,92:1,90:1,147:1,191:1,56:1,2017:1,108:1,472:1,49:1,97:1,150:1,509:1,284:1,114:1,115:1},mN),eUe.Qg=function(e){return evc(this,e)},eUe._g=function(e,t,n){var r,i,a;switch(e){case 0:return this.Ab||(this.Ab=new FQ(tm4,this,0,3)),this.Ab;case 1:return this.zb;case 2:return OQ(),(256&this.Bb)!=0;case 3:return OQ(),(512&this.Bb)!=0;case 4:return ell(this.s);case 5:return ell(this.t);case 6:return OQ(),(a=this.t)>1||-1==a;case 7:return OQ(),(i=this.s)>=1;case 8:if(t)return evl(this);return this.r;case 9:return this.q;case 10:return this.Db>>16==10?Pp(this.Cb,59):null}return Qt(this,e-Y1((eBK(),tgR)),ee2((r=Pp(eaS(this,16),26))||tgR,e),t,n)},eUe.hh=function(e,t,n){var r,i,a;switch(t){case 0:return this.Ab||(this.Ab=new FQ(tm4,this,0,3)),edF(this.Ab,e,n);case 10:return this.Cb&&(n=(i=this.Db>>16)>=0?evc(this,n):this.Cb.ih(this,-1-i,null,n)),eDg(this,e,10,n)}return(a=Pp(ee2((r=Pp(eaS(this,16),26))||(eBK(),tgR),t),66)).Nj().Qj(this,ehH(this),t-Y1((eBK(),tgR)),e,n)},eUe.jh=function(e,t,n){var r,i;switch(t){case 0:return this.Ab||(this.Ab=new FQ(tm4,this,0,3)),ep5(this.Ab,e,n);case 9:return Y3(this,n);case 10:return eDg(this,null,10,n)}return(i=Pp(ee2((r=Pp(eaS(this,16),26))||(eBK(),tgR),t),66)).Nj().Rj(this,ehH(this),t-Y1((eBK(),tgR)),e,n)},eUe.lh=function(e){var t,n,r;switch(e){case 0:return!!this.Ab&&0!=this.Ab.i;case 1:return null!=this.zb;case 2:return(256&this.Bb)==0;case 3:return(512&this.Bb)==0;case 4:return 0!=this.s;case 5:return 1!=this.t;case 6:return(r=this.t)>1||-1==r;case 7:return(n=this.s)>=1;case 8:return!!this.r&&!this.q.e&&0==BX(this.q).i;case 9:return!!this.q&&!(this.r&&!this.q.e&&0==BX(this.q).i);case 10:return!!(this.Db>>16==10?Pp(this.Cb,59):null)}return VP(this,e-Y1((eBK(),tgR)),ee2((t=Pp(eaS(this,16),26))||tgR,e))},eUe.zh=function(){return eBK(),tgR},Y6(eZ2,"EParameterImpl",509),eTS(99,449,{105:1,92:1,90:1,147:1,191:1,56:1,18:1,170:1,66:1,108:1,472:1,49:1,97:1,150:1,99:1,449:1,284:1,114:1,115:1,677:1},LB),eUe._g=function(e,t,n){var r,i,a,o;switch(e){case 0:return this.Ab||(this.Ab=new FQ(tm4,this,0,3)),this.Ab;case 1:return this.zb;case 2:return OQ(),(256&this.Bb)!=0;case 3:return OQ(),(512&this.Bb)!=0;case 4:return ell(this.s);case 5:return ell(this.t);case 6:return OQ(),(o=this.t)>1||-1==o;case 7:return OQ(),(i=this.s)>=1;case 8:if(t)return evl(this);return this.r;case 9:return this.q;case 10:return OQ(),(this.Bb&eXt)!=0;case 11:return OQ(),(this.Bb&eJq)!=0;case 12:return OQ(),(this.Bb&eH0)!=0;case 13:return this.j;case 14:return eOI(this);case 15:return OQ(),(this.Bb&eJV)!=0;case 16:return OQ(),(this.Bb&eUR)!=0;case 17:return z5(this);case 18:return OQ(),(this.Bb&eZ1)!=0;case 19:return OQ(),!!(a=ebY(this))&&(a.Bb&eZ1)!=0;case 20:return OQ(),(this.Bb&eH3)!=0;case 21:if(t)return ebY(this);return this.b;case 22:if(t)return esd(this);return ZS(this);case 23:return this.a||(this.a=new OT(tm8,this,23)),this.a}return Qt(this,e-Y1((eBK(),tgj)),ee2((r=Pp(eaS(this,16),26))||tgj,e),t,n)},eUe.lh=function(e){var t,n,r,i;switch(e){case 0:return!!this.Ab&&0!=this.Ab.i;case 1:return null!=this.zb;case 2:return(256&this.Bb)==0;case 3:return(512&this.Bb)==0;case 4:return 0!=this.s;case 5:return 1!=this.t;case 6:return(i=this.t)>1||-1==i;case 7:return(n=this.s)>=1;case 8:return!!this.r&&!this.q.e&&0==BX(this.q).i;case 9:return!!this.q&&!(this.r&&!this.q.e&&0==BX(this.q).i);case 10:return(this.Bb&eXt)==0;case 11:return(this.Bb&eJq)!=0;case 12:return(this.Bb&eH0)!=0;case 13:return null!=this.j;case 14:return null!=eOI(this);case 15:return(this.Bb&eJV)!=0;case 16:return(this.Bb&eUR)!=0;case 17:return!!z5(this);case 18:return(this.Bb&eZ1)!=0;case 19:return!!(r=ebY(this))&&(r.Bb&eZ1)!=0;case 20:return(this.Bb&eH3)==0;case 21:return!!this.b;case 22:return!!ZS(this);case 23:return!!this.a&&0!=this.a.i}return VP(this,e-Y1((eBK(),tgj)),ee2((t=Pp(eaS(this,16),26))||tgj,e))},eUe.sh=function(e,t){var n,r;switch(e){case 0:this.Ab||(this.Ab=new FQ(tm4,this,0,3)),eRT(this.Ab),this.Ab||(this.Ab=new FQ(tm4,this,0,3)),Y4(this.Ab,Pp(t,14));return;case 1:GD(this,Lq(t));return;case 2:eli(this,gN(LK(t)));return;case 3:els(this,gN(LK(t)));return;case 4:end(this,Pp(t,19).a);return;case 5:enh(this,Pp(t,19).a);return;case 8:eu2(this,Pp(t,138));return;case 9:(r=ew3(this,Pp(t,87),null))&&r.Fi();return;case 10:elF(this,gN(LK(t)));return;case 11:elU(this,gN(LK(t)));return;case 12:elY(this,gN(LK(t)));return;case 13:xi(this,Lq(t));return;case 15:elB(this,gN(LK(t)));return;case 16:elZ(this,gN(LK(t)));return;case 18:GI(this,gN(LK(t)));return;case 20:elQ(this,gN(LK(t)));return;case 21:erM(this,Pp(t,18));return;case 23:this.a||(this.a=new OT(tm8,this,23)),eRT(this.a),this.a||(this.a=new OT(tm8,this,23)),Y4(this.a,Pp(t,14));return}efL(this,e-Y1((eBK(),tgj)),ee2((n=Pp(eaS(this,16),26))||tgj,e),t)},eUe.zh=function(){return eBK(),tgj},eUe.Bh=function(e){var t,n;switch(e){case 0:this.Ab||(this.Ab=new FQ(tm4,this,0,3)),eRT(this.Ab);return;case 1:M4(this.Cb,88)&&eko(Zd(Pp(this.Cb,88)),4),er3(this,null);return;case 2:eli(this,!0);return;case 3:els(this,!0);return;case 4:end(this,0);return;case 5:enh(this,1);return;case 8:eu2(this,null);return;case 9:(n=ew3(this,null,null))&&n.Fi();return;case 10:elF(this,!0);return;case 11:elU(this,!1);return;case 12:elY(this,!1);return;case 13:this.i=null,erA(this,null);return;case 15:elB(this,!1);return;case 16:elZ(this,!1);return;case 18:elJ(this,!1),M4(this.Cb,88)&&eko(Zd(Pp(this.Cb,88)),2);return;case 20:elQ(this,!0);return;case 21:erM(this,null);return;case 23:this.a||(this.a=new OT(tm8,this,23)),eRT(this.a);return}ec5(this,e-Y1((eBK(),tgj)),ee2((t=Pp(eaS(this,16),26))||tgj,e))},eUe.Gh=function(){esd(this),UH(QZ((eSp(),tvc),this)),evl(this),this.Bb|=1},eUe.Lj=function(){return ebY(this)},eUe.qk=function(){var e;return!!(e=ebY(this))&&(e.Bb&eZ1)!=0},eUe.rk=function(){return(this.Bb&eZ1)!=0},eUe.sk=function(){return(this.Bb&eH3)!=0},eUe.nk=function(e,t){return this.c=null,ecz(this,e,t)},eUe.Ib=function(){var e;return(64&this.Db)!=0?eCR(this):(e=new O1(eCR(this)),e.a+=" (containment: ",yG(e,(this.Bb&eZ1)!=0),e.a+=", resolveProxies: ",yG(e,(this.Bb&eH3)!=0),e.a+=")",e.a)},Y6(eZ2,"EReferenceImpl",99),eTS(548,115,{105:1,42:1,92:1,90:1,133:1,56:1,108:1,49:1,97:1,548:1,114:1,115:1},sp),eUe.Fb=function(e){return this===e},eUe.cd=function(){return this.b},eUe.dd=function(){return this.c},eUe.Hb=function(){return Ao(this)},eUe.Uh=function(e){RP(this,Lq(e))},eUe.ed=function(e){return P6(this,Lq(e))},eUe._g=function(e,t,n){var r;switch(e){case 0:return this.b;case 1:return this.c}return Qt(this,e-Y1((eBK(),tgF)),ee2((r=Pp(eaS(this,16),26))||tgF,e),t,n)},eUe.lh=function(e){var t;switch(e){case 0:return null!=this.b;case 1:return null!=this.c}return VP(this,e-Y1((eBK(),tgF)),ee2((t=Pp(eaS(this,16),26))||tgF,e))},eUe.sh=function(e,t){var n;switch(e){case 0:RR(this,Lq(t));return;case 1:ers(this,Lq(t));return}efL(this,e-Y1((eBK(),tgF)),ee2((n=Pp(eaS(this,16),26))||tgF,e),t)},eUe.zh=function(){return eBK(),tgF},eUe.Bh=function(e){var t;switch(e){case 0:ero(this,null);return;case 1:ers(this,null);return}ec5(this,e-Y1((eBK(),tgF)),ee2((t=Pp(eaS(this,16),26))||tgF,e))},eUe.Sh=function(){var e;return -1==this.a&&(e=this.b,this.a=null==e?0:ebA(e)),this.a},eUe.Th=function(e){this.a=e},eUe.Ib=function(){var e;return(64&this.Db)!=0?eMT(this):(e=new O1(eMT(this)),e.a+=" (key: ",xk(e,this.b),e.a+=", value: ",xk(e,this.c),e.a+=")",e.a)},eUe.a=-1,eUe.b=null,eUe.c=null;var tgf=Y6(eZ2,"EStringToStringMapEntryImpl",548),tgd=RL(eJz,"FeatureMap/Entry/Internal");eTS(565,1,eQa),eUe.Ok=function(e){return this.Pk(Pp(e,49))},eUe.Pk=function(e){return this.Ok(e)},eUe.Fb=function(e){var t,n;return this===e||!!M4(e,72)&&(t=Pp(e,72)).ak()==this.c&&(null==(n=this.dd())?null==t.dd():ecX(n,t.dd()))},eUe.ak=function(){return this.c},eUe.Hb=function(){var e;return e=this.dd(),esj(this.c)^(null==e?0:esj(e))},eUe.Ib=function(){var e,t;return t=etP((e=this.c).Hj()).Ph(),e.ne(),(null!=t&&0!=t.length?t+":"+e.ne():e.ne())+"="+this.dd()},Y6(eZ2,"EStructuralFeatureImpl/BasicFeatureMapEntry",565),eTS(776,565,eQa,Cg),eUe.Pk=function(e){return new Cg(this.c,e)},eUe.dd=function(){return this.a},eUe.Qk=function(e,t,n){return eiY(this,e,this.a,t,n)},eUe.Rk=function(e,t,n){return eiB(this,e,this.a,t,n)},Y6(eZ2,"EStructuralFeatureImpl/ContainmentUpdatingFeatureMapEntry",776),eTS(1314,1,{},k5),eUe.Pj=function(e,t,n,r,i){var a;return(a=Pp(JG(e,this.b),215)).nl(this.a).Wj(r)},eUe.Qj=function(e,t,n,r,i){var a;return(a=Pp(JG(e,this.b),215)).el(this.a,r,i)},eUe.Rj=function(e,t,n,r,i){var a;return(a=Pp(JG(e,this.b),215)).fl(this.a,r,i)},eUe.Sj=function(e,t,n){var r;return(r=Pp(JG(e,this.b),215)).nl(this.a).fj()},eUe.Tj=function(e,t,n,r){var i;(i=Pp(JG(e,this.b),215)).nl(this.a).Wb(r)},eUe.Uj=function(e,t,n){return Pp(JG(e,this.b),215).nl(this.a)},eUe.Vj=function(e,t,n){var r;(r=Pp(JG(e,this.b),215)).nl(this.a).Xj()},Y6(eZ2,"EStructuralFeatureImpl/InternalSettingDelegateFeatureMapDelegator",1314),eTS(89,1,{},Pe,HS,$F,qc),eUe.Pj=function(e,t,n,r,i){var a;if(null==(a=t.Ch(n))&&t.Dh(n,a=eBN(this,e)),!i)switch(this.e){case 50:case 41:return Pp(a,589).sj();case 40:return Pp(a,215).kl()}return a},eUe.Qj=function(e,t,n,r,i){var a,o;return null==(o=t.Ch(n))&&t.Dh(n,o=eBN(this,e)),a=Pp(o,69).lk(r,i)},eUe.Rj=function(e,t,n,r,i){var a;return null!=(a=t.Ch(n))&&(i=Pp(a,69).mk(r,i)),i},eUe.Sj=function(e,t,n){var r;return null!=(r=t.Ch(n))&&Pp(r,76).fj()},eUe.Tj=function(e,t,n,r){var i;(i=Pp(t.Ch(n),76))||t.Dh(n,i=eBN(this,e)),i.Wb(r)},eUe.Uj=function(e,t,n){var r,i;return(null==(i=t.Ch(n))&&t.Dh(n,i=eBN(this,e)),M4(i,76))?Pp(i,76):(r=Pp(t.Ch(n),15),new pz(r))},eUe.Vj=function(e,t,n){var r;(r=Pp(t.Ch(n),76))||t.Dh(n,r=eBN(this,e)),r.Xj()},eUe.b=0,eUe.e=0,Y6(eZ2,"EStructuralFeatureImpl/InternalSettingDelegateMany",89),eTS(504,1,{}),eUe.Qj=function(e,t,n,r,i){throw p7(new bO)},eUe.Rj=function(e,t,n,r,i){throw p7(new bO)},eUe.Uj=function(e,t,n){return new Hk(this,e,t,n)},Y6(eZ2,"EStructuralFeatureImpl/InternalSettingDelegateSingle",504),eTS(1331,1,eJG,Hk),eUe.Wj=function(e){return this.a.Pj(this.c,this.d,this.b,e,!0)},eUe.fj=function(){return this.a.Sj(this.c,this.d,this.b)},eUe.Wb=function(e){this.a.Tj(this.c,this.d,this.b,e)},eUe.Xj=function(){this.a.Vj(this.c,this.d,this.b)},eUe.b=0,Y6(eZ2,"EStructuralFeatureImpl/InternalSettingDelegateSingle/1",1331),eTS(769,504,{},zl),eUe.Pj=function(e,t,n,r,i){return eIy(e,e.eh(),e.Vg())==this.b?this.sk()&&r?eTp(e):e.eh():null},eUe.Qj=function(e,t,n,r,i){var a,o;return e.eh()&&(i=(a=e.Vg())>=0?e.Qg(i):e.eh().ih(e,-1-a,null,i)),o=edv(e.Tg(),this.e),e.Sg(r,o,i)},eUe.Rj=function(e,t,n,r,i){var a;return a=edv(e.Tg(),this.e),e.Sg(null,a,i)},eUe.Sj=function(e,t,n){var r;return r=edv(e.Tg(),this.e),!!e.eh()&&e.Vg()==r},eUe.Tj=function(e,t,n,r){var i,a,o,s,u;if(null!=r&&!eNc(this.a,r))throw p7(new gA(eQo+(M4(r,56)?eyB(Pp(r,56).Tg()):ee5(esF(r)))+eQs+this.a+"'"));if(i=e.eh(),o=edv(e.Tg(),this.e),xc(r)!==xc(i)||e.Vg()!=o&&null!=r){if(eg7(e,Pp(r,56)))throw p7(new gL(eZ4+e.Ib()));u=null,i&&(u=(a=e.Vg())>=0?e.Qg(u):e.eh().ih(e,-1-a,null,u)),(s=Pp(r,49))&&(u=s.gh(e,edv(s.Tg(),this.b),null,u)),(u=e.Sg(s,o,u))&&u.Fi()}else e.Lg()&&e.Mg()&&eam(e,new FX(e,1,o,r,r))},eUe.Vj=function(e,t,n){var r,i,a,o;(r=e.eh())?(o=(i=e.Vg())>=0?e.Qg(null):e.eh().ih(e,-1-i,null,null),a=edv(e.Tg(),this.e),(o=e.Sg(null,a,o))&&o.Fi()):e.Lg()&&e.Mg()&&eam(e,new FJ(e,1,this.e,null,null))},eUe.sk=function(){return!1},Y6(eZ2,"EStructuralFeatureImpl/InternalSettingDelegateSingleContainer",769),eTS(1315,769,{},Pt),eUe.sk=function(){return!0},Y6(eZ2,"EStructuralFeatureImpl/InternalSettingDelegateSingleContainerResolving",1315),eTS(563,504,{}),eUe.Pj=function(e,t,n,r,i){var a;return null==(a=t.Ch(n))?this.b:xc(a)===xc(tgZ)?null:a},eUe.Sj=function(e,t,n){var r;return null!=(r=t.Ch(n))&&(xc(r)===xc(tgZ)||!ecX(r,this.b))},eUe.Tj=function(e,t,n,r){var i,a;e.Lg()&&e.Mg()?(i=null==(a=t.Ch(n))?this.b:xc(a)===xc(tgZ)?null:a,null==r?null!=this.c?(t.Dh(n,null),r=this.b):null!=this.b?t.Dh(n,tgZ):t.Dh(n,null):(this.Sk(r),t.Dh(n,r)),eam(e,this.d.Tk(e,1,this.e,i,r))):null==r?null!=this.c?t.Dh(n,null):null!=this.b?t.Dh(n,tgZ):t.Dh(n,null):(this.Sk(r),t.Dh(n,r))},eUe.Vj=function(e,t,n){var r,i;e.Lg()&&e.Mg()?(r=null==(i=t.Ch(n))?this.b:xc(i)===xc(tgZ)?null:i,t.Eh(n),eam(e,this.d.Tk(e,1,this.e,r,this.b))):t.Eh(n)},eUe.Sk=function(e){throw p7(new bk)},Y6(eZ2,"EStructuralFeatureImpl/InternalSettingDelegateSingleData",563),eTS(eQu,1,{},sb),eUe.Tk=function(e,t,n,r,i){return new FJ(e,t,n,r,i)},eUe.Uk=function(e,t,n,r,i,a){return new H0(e,t,n,r,i,a)},Y6(eZ2,"EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator",eQu),eTS(1332,eQu,{},sm),eUe.Tk=function(e,t,n,r,i){return new ZY(e,t,n,gN(LK(r)),gN(LK(i)))},eUe.Uk=function(e,t,n,r,i,a){return new W4(e,t,n,gN(LK(r)),gN(LK(i)),a)},Y6(eZ2,"EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator/1",1332),eTS(1333,eQu,{},sg),eUe.Tk=function(e,t,n,r,i){return new en_(e,t,n,Pp(r,217).a,Pp(i,217).a)},eUe.Uk=function(e,t,n,r,i,a){return new WX(e,t,n,Pp(r,217).a,Pp(i,217).a,a)},Y6(eZ2,"EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator/2",1333),eTS(1334,eQu,{},sv),eUe.Tk=function(e,t,n,r,i){return new enE(e,t,n,Pp(r,172).a,Pp(i,172).a)},eUe.Uk=function(e,t,n,r,i,a){return new WJ(e,t,n,Pp(r,172).a,Pp(i,172).a,a)},Y6(eZ2,"EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator/3",1334),eTS(1335,eQu,{},sy),eUe.Tk=function(e,t,n,r,i){return new Zj(e,t,n,gP(LV(r)),gP(LV(i)))},eUe.Uk=function(e,t,n,r,i,a){return new WQ(e,t,n,gP(LV(r)),gP(LV(i)),a)},Y6(eZ2,"EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator/4",1335),eTS(1336,eQu,{},sw),eUe.Tk=function(e,t,n,r,i){return new enx(e,t,n,Pp(r,155).a,Pp(i,155).a)},eUe.Uk=function(e,t,n,r,i,a){return new W1(e,t,n,Pp(r,155).a,Pp(i,155).a,a)},Y6(eZ2,"EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator/5",1336),eTS(1337,eQu,{},s_),eUe.Tk=function(e,t,n,r,i){return new ZF(e,t,n,Pp(r,19).a,Pp(i,19).a)},eUe.Uk=function(e,t,n,r,i,a){return new W0(e,t,n,Pp(r,19).a,Pp(i,19).a,a)},Y6(eZ2,"EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator/6",1337),eTS(1338,eQu,{},sE),eUe.Tk=function(e,t,n,r,i){return new enS(e,t,n,Pp(r,162).a,Pp(i,162).a)},eUe.Uk=function(e,t,n,r,i,a){return new W2(e,t,n,Pp(r,162).a,Pp(i,162).a,a)},Y6(eZ2,"EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator/7",1338),eTS(1339,eQu,{},sS),eUe.Tk=function(e,t,n,r,i){return new enk(e,t,n,Pp(r,184).a,Pp(i,184).a)},eUe.Uk=function(e,t,n,r,i,a){return new W3(e,t,n,Pp(r,184).a,Pp(i,184).a,a)},Y6(eZ2,"EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator/8",1339),eTS(1317,563,{},Hx),eUe.Sk=function(e){if(!this.a.wj(e))throw p7(new gA(eQo+esF(e)+eQs+this.a+"'"))},Y6(eZ2,"EStructuralFeatureImpl/InternalSettingDelegateSingleDataDynamic",1317),eTS(1318,563,{},j5),eUe.Sk=function(e){},Y6(eZ2,"EStructuralFeatureImpl/InternalSettingDelegateSingleDataStatic",1318),eTS(770,563,{}),eUe.Sj=function(e,t,n){var r;return null!=(r=t.Ch(n))},eUe.Tj=function(e,t,n,r){var i,a;e.Lg()&&e.Mg()?(i=!0,null==(a=t.Ch(n))?(i=!1,a=this.b):xc(a)===xc(tgZ)&&(a=null),null==r?null!=this.c?(t.Dh(n,null),r=this.b):t.Dh(n,tgZ):(this.Sk(r),t.Dh(n,r)),eam(e,this.d.Uk(e,1,this.e,a,r,!i))):null==r?null!=this.c?t.Dh(n,null):t.Dh(n,tgZ):(this.Sk(r),t.Dh(n,r))},eUe.Vj=function(e,t,n){var r,i;e.Lg()&&e.Mg()?(r=!0,null==(i=t.Ch(n))?(r=!1,i=this.b):xc(i)===xc(tgZ)&&(i=null),t.Eh(n),eam(e,this.d.Uk(e,2,this.e,i,this.b,r))):t.Eh(n)},Y6(eZ2,"EStructuralFeatureImpl/InternalSettingDelegateSingleDataUnsettable",770),eTS(1319,770,{},HT),eUe.Sk=function(e){if(!this.a.wj(e))throw p7(new gA(eQo+esF(e)+eQs+this.a+"'"))},Y6(eZ2,"EStructuralFeatureImpl/InternalSettingDelegateSingleDataUnsettableDynamic",1319),eTS(1320,770,{},j8),eUe.Sk=function(e){},Y6(eZ2,"EStructuralFeatureImpl/InternalSettingDelegateSingleDataUnsettableStatic",1320),eTS(398,504,{},jd),eUe.Pj=function(e,t,n,r,i){var a,o,s,u,c;if(c=t.Ch(n),this.Kj()&&xc(c)===xc(tgZ))return null;if(!this.sk()||!r||null==c)return c;if((s=Pp(c,49)).kh()&&(u=ecv(e,s),s!=u)){if(!eNc(this.a,u))throw p7(new gA(eQo+esF(u)+eQs+this.a+"'"));t.Dh(n,c=u),this.rk()&&(a=Pp(u,49),o=s.ih(e,this.b?edv(s.Tg(),this.b):-1-edv(e.Tg(),this.e),null,null),a.eh()||(o=a.gh(e,this.b?edv(a.Tg(),this.b):-1-edv(e.Tg(),this.e),null,o)),o&&o.Fi()),e.Lg()&&e.Mg()&&eam(e,new FJ(e,9,this.e,s,u))}return c},eUe.Qj=function(e,t,n,r,i){var a,o;return xc(o=t.Ch(n))===xc(tgZ)&&(o=null),t.Dh(n,r),this.bj()?xc(o)!==xc(r)&&null!=o&&(i=(a=Pp(o,49)).ih(e,edv(a.Tg(),this.b),null,i)):this.rk()&&null!=o&&(i=Pp(o,49).ih(e,-1-edv(e.Tg(),this.e),null,i)),e.Lg()&&e.Mg()&&(i||(i=new yf(4)),i.Ei(new FJ(e,1,this.e,o,r))),i},eUe.Rj=function(e,t,n,r,i){var a;return xc(a=t.Ch(n))===xc(tgZ)&&(a=null),t.Eh(n),e.Lg()&&e.Mg()&&(i||(i=new yf(4)),this.Kj()?i.Ei(new FJ(e,2,this.e,a,null)):i.Ei(new FJ(e,1,this.e,a,null))),i},eUe.Sj=function(e,t,n){var r;return null!=(r=t.Ch(n))},eUe.Tj=function(e,t,n,r){var i,a,o,s,u;if(null!=r&&!eNc(this.a,r))throw p7(new gA(eQo+(M4(r,56)?eyB(Pp(r,56).Tg()):ee5(esF(r)))+eQs+this.a+"'"));s=null!=(u=t.Ch(n)),this.Kj()&&xc(u)===xc(tgZ)&&(u=null),o=null,this.bj()?xc(u)!==xc(r)&&(null!=u&&(o=(i=Pp(u,49)).ih(e,edv(i.Tg(),this.b),null,o)),null!=r&&(o=(i=Pp(r,49)).gh(e,edv(i.Tg(),this.b),null,o))):this.rk()&&xc(u)!==xc(r)&&(null!=u&&(o=Pp(u,49).ih(e,-1-edv(e.Tg(),this.e),null,o)),null!=r&&(o=Pp(r,49).gh(e,-1-edv(e.Tg(),this.e),null,o))),null==r&&this.Kj()?t.Dh(n,tgZ):t.Dh(n,r),e.Lg()&&e.Mg()?(a=new H0(e,1,this.e,u,r,this.Kj()&&!s),o?(o.Ei(a),o.Fi()):eam(e,a)):o&&o.Fi()},eUe.Vj=function(e,t,n){var r,i,a,o,s;o=null!=(s=t.Ch(n)),this.Kj()&&xc(s)===xc(tgZ)&&(s=null),a=null,null!=s&&(this.bj()?a=(r=Pp(s,49)).ih(e,edv(r.Tg(),this.b),null,a):this.rk()&&(a=Pp(s,49).ih(e,-1-edv(e.Tg(),this.e),null,a))),t.Eh(n),e.Lg()&&e.Mg()?(i=new H0(e,this.Kj()?2:1,this.e,s,null,o),a?(a.Ei(i),a.Fi()):eam(e,i)):a&&a.Fi()},eUe.bj=function(){return!1},eUe.rk=function(){return!1},eUe.sk=function(){return!1},eUe.Kj=function(){return!1},Y6(eZ2,"EStructuralFeatureImpl/InternalSettingDelegateSingleEObject",398),eTS(564,398,{},LE),eUe.rk=function(){return!0},Y6(eZ2,"EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectContainment",564),eTS(1323,564,{},LS),eUe.sk=function(){return!0},Y6(eZ2,"EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectContainmentResolving",1323),eTS(772,564,{},Lk),eUe.Kj=function(){return!0},Y6(eZ2,"EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectContainmentUnsettable",772),eTS(1325,772,{},Lx),eUe.sk=function(){return!0},Y6(eZ2,"EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectContainmentUnsettableResolving",1325),eTS(640,564,{},Pn),eUe.bj=function(){return!0},Y6(eZ2,"EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectContainmentWithInverse",640),eTS(1324,640,{},Pa),eUe.sk=function(){return!0},Y6(eZ2,"EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectContainmentWithInverseResolving",1324),eTS(773,640,{},Po),eUe.Kj=function(){return!0},Y6(eZ2,"EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectContainmentWithInverseUnsettable",773),eTS(1326,773,{},Ps),eUe.sk=function(){return!0},Y6(eZ2,"EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectContainmentWithInverseUnsettableResolving",1326),eTS(641,398,{},LT),eUe.sk=function(){return!0},Y6(eZ2,"EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectResolving",641),eTS(1327,641,{},LM),eUe.Kj=function(){return!0},Y6(eZ2,"EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectResolvingUnsettable",1327),eTS(774,641,{},Pr),eUe.bj=function(){return!0},Y6(eZ2,"EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectResolvingWithInverse",774),eTS(1328,774,{},Pu),eUe.Kj=function(){return!0},Y6(eZ2,"EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectResolvingWithInverseUnsettable",1328),eTS(1321,398,{},LO),eUe.Kj=function(){return!0},Y6(eZ2,"EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectUnsettable",1321),eTS(771,398,{},Pi),eUe.bj=function(){return!0},Y6(eZ2,"EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectWithInverse",771),eTS(1322,771,{},Pc),eUe.Kj=function(){return!0},Y6(eZ2,"EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectWithInverseUnsettable",1322),eTS(775,565,eQa,Bj),eUe.Pk=function(e){return new Bj(this.a,this.c,e)},eUe.dd=function(){return this.b},eUe.Qk=function(e,t,n){return Jt(this,e,this.b,n)},eUe.Rk=function(e,t,n){return Jn(this,e,this.b,n)},Y6(eZ2,"EStructuralFeatureImpl/InverseUpdatingFeatureMapEntry",775),eTS(1329,1,eJG,pz),eUe.Wj=function(e){return this.a},eUe.fj=function(){return M4(this.a,95)?Pp(this.a,95).fj():!this.a.dc()},eUe.Wb=function(e){this.a.$b(),this.a.Gc(Pp(e,15))},eUe.Xj=function(){M4(this.a,95)?Pp(this.a,95).Xj():this.a.$b()},Y6(eZ2,"EStructuralFeatureImpl/SettingMany",1329),eTS(1330,565,eQa,qf),eUe.Ok=function(e){return new Cv((eR7(),tvK),this.b.Ih(this.a,e))},eUe.dd=function(){return null},eUe.Qk=function(e,t,n){return n},eUe.Rk=function(e,t,n){return n},Y6(eZ2,"EStructuralFeatureImpl/SimpleContentFeatureMapEntry",1330),eTS(642,565,eQa,Cv),eUe.Ok=function(e){return new Cv(this.c,e)},eUe.dd=function(){return this.a},eUe.Qk=function(e,t,n){return n},eUe.Rk=function(e,t,n){return n},Y6(eZ2,"EStructuralFeatureImpl/SimpleFeatureMapEntry",642),eTS(391,497,eXz,sk),eUe.ri=function(e){return Je(tm7,eUp,26,e,0,1)},eUe.ni=function(){return!1},Y6(eZ2,"ESuperAdapter/1",391),eTS(444,438,{105:1,92:1,90:1,147:1,191:1,56:1,108:1,836:1,49:1,97:1,150:1,444:1,114:1,115:1},sx),eUe._g=function(e,t,n){var r;switch(e){case 0:return this.Ab||(this.Ab=new FQ(tm4,this,0,3)),this.Ab;case 1:return this.zb;case 2:return this.a||(this.a=new jh(this,tgr,this)),this.a}return Qt(this,e-Y1((eBK(),tgU)),ee2((r=Pp(eaS(this,16),26))||tgU,e),t,n)},eUe.jh=function(e,t,n){var r,i;switch(t){case 0:return this.Ab||(this.Ab=new FQ(tm4,this,0,3)),ep5(this.Ab,e,n);case 2:return this.a||(this.a=new jh(this,tgr,this)),ep5(this.a,e,n)}return(i=Pp(ee2((r=Pp(eaS(this,16),26))||(eBK(),tgU),t),66)).Nj().Rj(this,ehH(this),t-Y1((eBK(),tgU)),e,n)},eUe.lh=function(e){var t;switch(e){case 0:return!!this.Ab&&0!=this.Ab.i;case 1:return null!=this.zb;case 2:return!!this.a&&0!=this.a.i}return VP(this,e-Y1((eBK(),tgU)),ee2((t=Pp(eaS(this,16),26))||tgU,e))},eUe.sh=function(e,t){var n;switch(e){case 0:this.Ab||(this.Ab=new FQ(tm4,this,0,3)),eRT(this.Ab),this.Ab||(this.Ab=new FQ(tm4,this,0,3)),Y4(this.Ab,Pp(t,14));return;case 1:er3(this,Lq(t));return;case 2:this.a||(this.a=new jh(this,tgr,this)),eRT(this.a),this.a||(this.a=new jh(this,tgr,this)),Y4(this.a,Pp(t,14));return}efL(this,e-Y1((eBK(),tgU)),ee2((n=Pp(eaS(this,16),26))||tgU,e),t)},eUe.zh=function(){return eBK(),tgU},eUe.Bh=function(e){var t;switch(e){case 0:this.Ab||(this.Ab=new FQ(tm4,this,0,3)),eRT(this.Ab);return;case 1:er3(this,null);return;case 2:this.a||(this.a=new jh(this,tgr,this)),eRT(this.a);return}ec5(this,e-Y1((eBK(),tgU)),ee2((t=Pp(eaS(this,16),26))||tgU,e))},Y6(eZ2,"ETypeParameterImpl",444),eTS(445,85,eJ8,jh),eUe.cj=function(e,t){return ewV(this,Pp(e,87),t)},eUe.dj=function(e,t){return ewq(this,Pp(e,87),t)},Y6(eZ2,"ETypeParameterImpl/1",445),eTS(634,43,e$s,mR),eUe.ec=function(){return new pG(this)},Y6(eZ2,"ETypeParameterImpl/2",634),eTS(556,eUT,eUM,pG),eUe.Fc=function(e){return Ie(this,Pp(e,87))},eUe.Gc=function(e){var t,n,r;for(r=!1,n=e.Kc();n.Ob();)t=Pp(n.Pb(),87),null==Um(this.a,t,"")&&(r=!0);return r},eUe.$b=function(){Yy(this.a)},eUe.Hc=function(e){return F8(this.a,e)},eUe.Kc=function(){var e;return e=new esz(new fS(this.a).a),new pW(e)},eUe.Mc=function(e){return Xp(this,e)},eUe.gc=function(){return wq(this.a)},Y6(eZ2,"ETypeParameterImpl/2/1",556),eTS(557,1,eUE,pW),eUe.Nb=function(e){F9(this,e)},eUe.Pb=function(){return Pp(etz(this.a).cd(),87)},eUe.Ob=function(){return this.a.b},eUe.Qb=function(){JM(this.a)},Y6(eZ2,"ETypeParameterImpl/2/1/1",557),eTS(1276,43,e$s,mj),eUe._b=function(e){return xd(e)?$r(this,e):!!$I(this.f,e)},eUe.xc=function(e){var t,n;return M4(t=xd(e)?zg(this,e):xu($I(this.f,e)),837)?(t=(n=Pp(t,837))._j(),Um(this,Pp(e,235),t),t):null!=t?t:null==e?(_3(),tvh):null},Y6(eZ2,"EValidatorRegistryImpl",1276),eTS(1313,704,{105:1,92:1,90:1,471:1,147:1,56:1,108:1,1941:1,49:1,97:1,150:1,114:1,115:1},sT),eUe.Ih=function(e,t){switch(e.yj()){case 21:case 22:case 23:case 24:case 26:case 31:case 32:case 37:case 38:case 39:case 40:case 43:case 44:case 48:case 49:case 20:return null==t?null:efF(t);case 25:return etR(t);case 27:return Qn(t);case 28:return Qr(t);case 29:return null==t?null:MU(tmS[0],Pp(t,199));case 41:return null==t?"":yx(Pp(t,290));case 42:return efF(t);case 50:return Lq(t);default:throw p7(new gL(eZ6+e.ne()+eZ5))}},eUe.Jh=function(e){var t;switch(-1==e.G&&(e.G=(t=etP(e))?ebv(t.Mh(),e):-1),e.G){case 0:return new mC;case 1:return new sa;case 2:return new c0;case 4:return new bN;case 5:return new mI;case 6:return new bD;case 7:return new cQ;case 10:return new sr;case 11:return new mD;case 12:return new $y;case 13:return new mN;case 14:return new LB;case 17:return new sp;case 18:return new p6;case 19:return new sx;default:throw p7(new gL(eZ7+e.zb+eZ5))}},eUe.Kh=function(e,t){switch(e.yj()){case 20:return null==t?null:new yY(t);case 21:return null==t?null:new TU(t);case 23:case 22:return null==t?null:ehL(t);case 26:case 24:return null==t?null:eeT(eDa(t,-128,127)<<24>>24);case 25:return eMp(t);case 27:return egg(t);case 28:return egv(t);case 29:return e__(t);case 32:case 31:return null==t?null:eEu(t);case 38:case 37:return null==t?null:new bK(t);case 40:case 39:return null==t?null:ell(eDa(t,eHt,eUu));case 41:case 42:return null;case 44:case 43:return null==t?null:ehQ(eF0(t));case 49:case 48:return null==t?null:elf(eDa(t,eQl,32767)<<16>>16);case 50:return t;default:throw p7(new gL(eZ6+e.ne()+eZ5))}},Y6(eZ2,"EcoreFactoryImpl",1313),eTS(547,179,{105:1,92:1,90:1,147:1,191:1,56:1,235:1,108:1,1939:1,49:1,97:1,150:1,179:1,547:1,114:1,115:1,675:1},Uh),eUe.gb=!1,eUe.hb=!1;var tgh,tgp,tgb,tgm,tgg,tgv,tgy,tgw,tg_,tgE,tgS,tgk,tgx,tgT,tgM,tgO,tgA,tgL,tgC,tgI,tgD,tgN,tgP,tgR,tgj,tgF,tgY,tgB,tgU,tgH,tg$,tgz,tgG,tgW,tgK,tgV,tgq,tgZ,tgX,tgJ,tgQ,tg1,tg0,tg2,tg3,tg4,tg6,tg5,tg8=!1;Y6(eZ2,"EcorePackageImpl",547),eTS(1184,1,{837:1},sM),eUe._j=function(){return OJ(),tvp},Y6(eZ2,"EcorePackageImpl/1",1184),eTS(1193,1,eQS,sO),eUe.wj=function(e){return M4(e,147)},eUe.xj=function(e){return Je(e5y,eUp,147,e,0,1)},Y6(eZ2,"EcorePackageImpl/10",1193),eTS(1194,1,eQS,sA),eUe.wj=function(e){return M4(e,191)},eUe.xj=function(e){return Je(e5_,eUp,191,e,0,1)},Y6(eZ2,"EcorePackageImpl/11",1194),eTS(1195,1,eQS,sL),eUe.wj=function(e){return M4(e,56)},eUe.xj=function(e){return Je(e5f,eUp,56,e,0,1)},Y6(eZ2,"EcorePackageImpl/12",1195),eTS(1196,1,eQS,sC),eUe.wj=function(e){return M4(e,399)},eUe.xj=function(e){return Je(tgi,eJ6,59,e,0,1)},Y6(eZ2,"EcorePackageImpl/13",1196),eTS(1197,1,eQS,sI),eUe.wj=function(e){return M4(e,235)},eUe.xj=function(e){return Je(e5E,eUp,235,e,0,1)},Y6(eZ2,"EcorePackageImpl/14",1197),eTS(1198,1,eQS,sD),eUe.wj=function(e){return M4(e,509)},eUe.xj=function(e){return Je(tga,eUp,2017,e,0,1)},Y6(eZ2,"EcorePackageImpl/15",1198),eTS(1199,1,eQS,sN),eUe.wj=function(e){return M4(e,99)},eUe.xj=function(e){return Je(tgo,eJ4,18,e,0,1)},Y6(eZ2,"EcorePackageImpl/16",1199),eTS(1200,1,eQS,sP),eUe.wj=function(e){return M4(e,170)},eUe.xj=function(e){return Je(tm5,eJ4,170,e,0,1)},Y6(eZ2,"EcorePackageImpl/17",1200),eTS(1201,1,eQS,sR),eUe.wj=function(e){return M4(e,472)},eUe.xj=function(e){return Je(tm6,eUp,472,e,0,1)},Y6(eZ2,"EcorePackageImpl/18",1201),eTS(1202,1,eQS,sj),eUe.wj=function(e){return M4(e,548)},eUe.xj=function(e){return Je(tgf,eJL,548,e,0,1)},Y6(eZ2,"EcorePackageImpl/19",1202),eTS(1185,1,eQS,sF),eUe.wj=function(e){return M4(e,322)},eUe.xj=function(e){return Je(tm8,eJ4,34,e,0,1)},Y6(eZ2,"EcorePackageImpl/2",1185),eTS(1203,1,eQS,sY),eUe.wj=function(e){return M4(e,241)},eUe.xj=function(e){return Je(tgr,eQt,87,e,0,1)},Y6(eZ2,"EcorePackageImpl/20",1203),eTS(1204,1,eQS,sB),eUe.wj=function(e){return M4(e,444)},eUe.xj=function(e){return Je(tgs,eUp,836,e,0,1)},Y6(eZ2,"EcorePackageImpl/21",1204),eTS(1205,1,eQS,sU),eUe.wj=function(e){return xl(e)},eUe.xj=function(e){return Je(e11,eUP,476,e,8,1)},Y6(eZ2,"EcorePackageImpl/22",1205),eTS(1206,1,eQS,sH),eUe.wj=function(e){return M4(e,190)},eUe.xj=function(e){return Je(tyk,eUP,190,e,0,2)},Y6(eZ2,"EcorePackageImpl/23",1206),eTS(1207,1,eQS,s$),eUe.wj=function(e){return M4(e,217)},eUe.xj=function(e){return Je(e10,eUP,217,e,0,1)},Y6(eZ2,"EcorePackageImpl/24",1207),eTS(1208,1,eQS,sz),eUe.wj=function(e){return M4(e,172)},eUe.xj=function(e){return Je(e12,eUP,172,e,0,1)},Y6(eZ2,"EcorePackageImpl/25",1208),eTS(1209,1,eQS,sG),eUe.wj=function(e){return M4(e,199)},eUe.xj=function(e){return Je(e1Q,eUP,199,e,0,1)},Y6(eZ2,"EcorePackageImpl/26",1209),eTS(1210,1,eQS,sW),eUe.wj=function(e){return!1},eUe.xj=function(e){return Je(tyA,eUp,2110,e,0,1)},Y6(eZ2,"EcorePackageImpl/27",1210),eTS(1211,1,eQS,sK),eUe.wj=function(e){return xf(e)},eUe.xj=function(e){return Je(e13,eUP,333,e,7,1)},Y6(eZ2,"EcorePackageImpl/28",1211),eTS(1212,1,eQS,sV),eUe.wj=function(e){return M4(e,58)},eUe.xj=function(e){return Je(e5L,ezZ,58,e,0,1)},Y6(eZ2,"EcorePackageImpl/29",1212),eTS(1186,1,eQS,sq),eUe.wj=function(e){return M4(e,510)},eUe.xj=function(e){return Je(tm4,{3:1,4:1,5:1,1934:1},590,e,0,1)},Y6(eZ2,"EcorePackageImpl/3",1186),eTS(1213,1,eQS,sZ),eUe.wj=function(e){return M4(e,573)},eUe.xj=function(e){return Je(e5j,eUp,1940,e,0,1)},Y6(eZ2,"EcorePackageImpl/30",1213),eTS(1214,1,eQS,sX),eUe.wj=function(e){return M4(e,153)},eUe.xj=function(e){return Je(tg7,ezZ,153,e,0,1)},Y6(eZ2,"EcorePackageImpl/31",1214),eTS(1215,1,eQS,sJ),eUe.wj=function(e){return M4(e,72)},eUe.xj=function(e){return Je(tgc,eQk,72,e,0,1)},Y6(eZ2,"EcorePackageImpl/32",1215),eTS(1216,1,eQS,sQ),eUe.wj=function(e){return M4(e,155)},eUe.xj=function(e){return Je(e14,eUP,155,e,0,1)},Y6(eZ2,"EcorePackageImpl/33",1216),eTS(1217,1,eQS,s1),eUe.wj=function(e){return M4(e,19)},eUe.xj=function(e){return Je(e16,eUP,19,e,0,1)},Y6(eZ2,"EcorePackageImpl/34",1217),eTS(1218,1,eQS,s0),eUe.wj=function(e){return M4(e,290)},eUe.xj=function(e){return Je(e1j,eUp,290,e,0,1)},Y6(eZ2,"EcorePackageImpl/35",1218),eTS(1219,1,eQS,s2),eUe.wj=function(e){return M4(e,162)},eUe.xj=function(e){return Je(e15,eUP,162,e,0,1)},Y6(eZ2,"EcorePackageImpl/36",1219),eTS(1220,1,eQS,s3),eUe.wj=function(e){return M4(e,83)},eUe.xj=function(e){return Je(e1Y,eUp,83,e,0,1)},Y6(eZ2,"EcorePackageImpl/37",1220),eTS(1221,1,eQS,s4),eUe.wj=function(e){return M4(e,591)},eUe.xj=function(e){return Je(tg9,eUp,591,e,0,1)},Y6(eZ2,"EcorePackageImpl/38",1221),eTS(1222,1,eQS,s6),eUe.wj=function(e){return!1},eUe.xj=function(e){return Je(tyL,eUp,2111,e,0,1)},Y6(eZ2,"EcorePackageImpl/39",1222),eTS(1187,1,eQS,s5),eUe.wj=function(e){return M4(e,88)},eUe.xj=function(e){return Je(tm7,eUp,26,e,0,1)},Y6(eZ2,"EcorePackageImpl/4",1187),eTS(1223,1,eQS,s8),eUe.wj=function(e){return M4(e,184)},eUe.xj=function(e){return Je(e18,eUP,184,e,0,1)},Y6(eZ2,"EcorePackageImpl/40",1223),eTS(1224,1,eQS,s9),eUe.wj=function(e){return xd(e)},eUe.xj=function(e){return Je(e17,eUP,2,e,6,1)},Y6(eZ2,"EcorePackageImpl/41",1224),eTS(1225,1,eQS,s7),eUe.wj=function(e){return M4(e,588)},eUe.xj=function(e){return Je(e5I,eUp,588,e,0,1)},Y6(eZ2,"EcorePackageImpl/42",1225),eTS(1226,1,eQS,ue),eUe.wj=function(e){return!1},eUe.xj=function(e){return Je(tyC,eUP,2112,e,0,1)},Y6(eZ2,"EcorePackageImpl/43",1226),eTS(1227,1,eQS,ut),eUe.wj=function(e){return M4(e,42)},eUe.xj=function(e){return Je(e1$,eUK,42,e,0,1)},Y6(eZ2,"EcorePackageImpl/44",1227),eTS(1188,1,eQS,un),eUe.wj=function(e){return M4(e,138)},eUe.xj=function(e){return Je(tm9,eUp,138,e,0,1)},Y6(eZ2,"EcorePackageImpl/5",1188),eTS(1189,1,eQS,ur),eUe.wj=function(e){return M4(e,148)},eUe.xj=function(e){return Je(tge,eUp,148,e,0,1)},Y6(eZ2,"EcorePackageImpl/6",1189),eTS(1190,1,eQS,ui),eUe.wj=function(e){return M4(e,457)},eUe.xj=function(e){return Je(tgt,eUp,671,e,0,1)},Y6(eZ2,"EcorePackageImpl/7",1190),eTS(1191,1,eQS,ua),eUe.wj=function(e){return M4(e,573)},eUe.xj=function(e){return Je(tgn,eUp,678,e,0,1)},Y6(eZ2,"EcorePackageImpl/8",1191),eTS(1192,1,eQS,uo),eUe.wj=function(e){return M4(e,471)},eUe.xj=function(e){return Je(e5w,eUp,471,e,0,1)},Y6(eZ2,"EcorePackageImpl/9",1192),eTS(1025,1982,eJO,gT),eUe.bi=function(e,t){ecV(this,Pp(t,415))},eUe.fi=function(e,t){eSU(this,e,Pp(t,415))},Y6(eZ2,"MinimalEObjectImpl/1ArrayDelegatingAdapterList",1025),eTS(1026,143,eJx,BF),eUe.Ai=function(){return this.a.a},Y6(eZ2,"MinimalEObjectImpl/1ArrayDelegatingAdapterList/1",1026),eTS(1053,1052,{},Ms),Y6("org.eclipse.emf.ecore.plugin","EcorePlugin",1053);var tg9=RL(eQx,"Resource");eTS(781,1378,eQT),eUe.Yk=function(e){},eUe.Zk=function(e){},eUe.Vk=function(){return this.a||(this.a=new pK(this)),this.a},eUe.Wk=function(e){var t,n,r,i,a;if((r=e.length)>0){if(GV(0,e.length),47==e.charCodeAt(0)){for(t=1,a=new XM(4),i=1;t0&&(e=e.substr(0,n))}return ekX(this,e)},eUe.Xk=function(){return this.c},eUe.Ib=function(){var e;return yx(this.gm)+"@"+(e=esj(this)>>>0).toString(16)+" uri='"+this.d+"'"},eUe.b=!1,Y6(eQM,"ResourceImpl",781),eTS(1379,781,eQT,pq),Y6(eQM,"BinaryResourceImpl",1379),eTS(1169,694,eXG),eUe.si=function(e){return M4(e,56)?$x(this,Pp(e,56)):M4(e,591)?new Ow(Pp(e,591).Vk()):xc(e)===xc(this.f)?Pp(e,14).Kc():(LF(),tmB.a)},eUe.Ob=function(){return exI(this)},eUe.a=!1,Y6(eJz,"EcoreUtil/ContentTreeIterator",1169),eTS(1380,1169,eXG,F0),eUe.si=function(e){return xc(e)===xc(this.f)?Pp(e,15).Kc():new K0(Pp(e,56))},Y6(eQM,"ResourceImpl/5",1380),eTS(648,1994,eJ5,pK),eUe.Hc=function(e){return this.i<=4?ev8(this,e):M4(e,49)&&Pp(e,49).Zg()==this.a},eUe.bi=function(e,t){e==this.i-1&&(this.a.b||(this.a.b=!0))},eUe.di=function(e,t){0==e?this.a.b||(this.a.b=!0):X9(this,e,t)},eUe.fi=function(e,t){},eUe.gi=function(e,t,n){},eUe.aj=function(){return 2},eUe.Ai=function(){return this.a},eUe.bj=function(){return!0},eUe.cj=function(e,t){var n;return t=(n=Pp(e,49)).wh(this.a,t)},eUe.dj=function(e,t){var n;return(n=Pp(e,49)).wh(null,t)},eUe.ej=function(){return!1},eUe.hi=function(){return!0},eUe.ri=function(e){return Je(e5f,eUp,56,e,0,1)},eUe.ni=function(){return!1},Y6(eQM,"ResourceImpl/ContentsEList",648),eTS(957,1964,eU6,pV),eUe.Zc=function(e){return this.a._h(e)},eUe.gc=function(){return this.a.gc()},Y6(eJz,"AbstractSequentialInternalEList/1",957),eTS(624,1,{},PQ),Y6(eJz,"BasicExtendedMetaData",624),eTS(1160,1,{},k8),eUe.$k=function(){return null},eUe._k=function(){return -2==this.a&&fi(this,e_f(this.d,this.b)),this.a},eUe.al=function(){return null},eUe.bl=function(){return Hj(),Hj(),e2r},eUe.ne=function(){return this.c==eQH&&fo(this,eh1(this.d,this.b)),this.c},eUe.cl=function(){return 0},eUe.a=-2,eUe.c=eQH,Y6(eJz,"BasicExtendedMetaData/EClassExtendedMetaDataImpl",1160),eTS(1161,1,{},Ke),eUe.$k=function(){return this.a==(ZE(),tvf)&&fa(this,eO8(this.f,this.b)),this.a},eUe._k=function(){return 0},eUe.al=function(){return this.c==(ZE(),tvf)&&fs(this,eO9(this.f,this.b)),this.c},eUe.bl=function(){return this.d||fu(this,eIA(this.f,this.b)),this.d},eUe.ne=function(){return this.e==eQH&&fc(this,eh1(this.f,this.b)),this.e},eUe.cl=function(){return -2==this.g&&fl(this,ewd(this.f,this.b)),this.g},eUe.e=eQH,eUe.g=-2,Y6(eJz,"BasicExtendedMetaData/EDataTypeExtendedMetaDataImpl",1161),eTS(1159,1,{},xn),eUe.b=!1,eUe.c=!1,Y6(eJz,"BasicExtendedMetaData/EPackageExtendedMetaDataImpl",1159),eTS(1162,1,{},W7),eUe.c=-2,eUe.e=eQH,eUe.f=eQH,Y6(eJz,"BasicExtendedMetaData/EStructuralFeatureExtendedMetaDataImpl",1162),eTS(585,622,eJ8,PJ),eUe.aj=function(){return this.c},eUe.Fk=function(){return!1},eUe.li=function(e,t){return t},eUe.c=0,Y6(eJz,"EDataTypeEList",585);var tg7=RL(eJz,"FeatureMap");eTS(75,585,{3:1,4:1,20:1,28:1,52:1,14:1,15:1,54:1,67:1,63:1,58:1,76:1,153:1,215:1,1937:1,69:1,95:1},eiR),eUe.Vc=function(e,t){eO0(this,e,Pp(t,72))},eUe.Fc=function(e){return eM5(this,Pp(e,72))},eUe.Yh=function(e){Y2(this,Pp(e,72))},eUe.cj=function(e,t){return IG(this,Pp(e,72),t)},eUe.dj=function(e,t){return IW(this,Pp(e,72),t)},eUe.ii=function(e,t){return eI7(this,e,t)},eUe.li=function(e,t){return ejg(this,e,Pp(t,72))},eUe._c=function(e,t){return eA5(this,e,Pp(t,72))},eUe.jj=function(e,t){return IK(this,Pp(e,72),t)},eUe.kj=function(e,t){return IV(this,Pp(e,72),t)},eUe.lj=function(e,t,n){return eyU(this,Pp(e,72),Pp(t,72),n)},eUe.oi=function(e,t){return ewk(this,e,Pp(t,72))},eUe.dl=function(e,t){return eIF(this,e,t)},eUe.Wc=function(e,t){var n,r,i,a,o,s,u,c,l;for(c=new eta(t.gc()),i=t.Kc();i.Ob();)if(a=(r=Pp(i.Pb(),72)).ak(),eLt(this.e,a))a.hi()&&(Vq(this,a,r.dd())||ev8(c,r))||JL(c,r);else{for(s=0,l=eAY(this.e.Tg(),a),n=Pp(this.g,119),o=!0;s=0;)if(t=e[this.c],this.k.rl(t.ak()))return this.j=this.f?t:t.dd(),this.i=-2,!0;return this.i=-1,this.g=-1,!1},Y6(eJz,"BasicFeatureMap/FeatureEIterator",410),eTS(662,410,eUC,x1),eUe.Lk=function(){return!0},Y6(eJz,"BasicFeatureMap/ResolvingFeatureEIterator",662),eTS(955,486,eQr,Mz),eUe.Gi=function(){return this},Y6(eJz,"EContentsEList/1",955),eTS(956,486,eQr,x0),eUe.Lk=function(){return!1},Y6(eJz,"EContentsEList/2",956),eTS(954,279,eQi,MG),eUe.Nk=function(e){},eUe.Ob=function(){return!1},eUe.Sb=function(){return!1},Y6(eJz,"EContentsEList/FeatureIteratorImpl/1",954),eTS(825,585,eJ8,OM),eUe.ci=function(){this.a=!0},eUe.fj=function(){return this.a},eUe.Xj=function(){var e;eRT(this),TO(this.e)?(e=this.a,this.a=!1,eam(this.e,new ZB(this.e,2,this.c,e,!1))):this.a=!1},eUe.a=!1,Y6(eJz,"EDataTypeEList/Unsettable",825),eTS(1849,585,eJ8,OO),eUe.hi=function(){return!0},Y6(eJz,"EDataTypeUniqueEList",1849),eTS(1850,825,eJ8,OA),eUe.hi=function(){return!0},Y6(eJz,"EDataTypeUniqueEList/Unsettable",1850),eTS(139,85,eJ8,OS),eUe.Ek=function(){return!0},eUe.li=function(e,t){return ex7(this,e,Pp(t,56))},Y6(eJz,"EObjectContainmentEList/Resolving",139),eTS(1163,545,eJ8,Ok),eUe.Ek=function(){return!0},eUe.li=function(e,t){return ex7(this,e,Pp(t,56))},Y6(eJz,"EObjectContainmentEList/Unsettable/Resolving",1163),eTS(748,16,eJ8,Io),eUe.ci=function(){this.a=!0},eUe.fj=function(){return this.a},eUe.Xj=function(){var e;eRT(this),TO(this.e)?(e=this.a,this.a=!1,eam(this.e,new ZB(this.e,2,this.c,e,!1))):this.a=!1},eUe.a=!1,Y6(eJz,"EObjectContainmentWithInverseEList/Unsettable",748),eTS(1173,748,eJ8,Is),eUe.Ek=function(){return!0},eUe.li=function(e,t){return ex7(this,e,Pp(t,56))},Y6(eJz,"EObjectContainmentWithInverseEList/Unsettable/Resolving",1173),eTS(743,496,eJ8,Ox),eUe.ci=function(){this.a=!0},eUe.fj=function(){return this.a},eUe.Xj=function(){var e;eRT(this),TO(this.e)?(e=this.a,this.a=!1,eam(this.e,new ZB(this.e,2,this.c,e,!1))):this.a=!1},eUe.a=!1,Y6(eJz,"EObjectEList/Unsettable",743),eTS(328,496,eJ8,OT),eUe.Ek=function(){return!0},eUe.li=function(e,t){return ex7(this,e,Pp(t,56))},Y6(eJz,"EObjectResolvingEList",328),eTS(1641,743,eJ8,OL),eUe.Ek=function(){return!0},eUe.li=function(e,t){return ex7(this,e,Pp(t,56))},Y6(eJz,"EObjectResolvingEList/Unsettable",1641),eTS(1381,1,{},us),Y6(eJz,"EObjectValidator",1381),eTS(546,496,eJ8,F1),eUe.zk=function(){return this.d},eUe.Ak=function(){return this.b},eUe.bj=function(){return!0},eUe.Dk=function(){return!0},eUe.b=0,Y6(eJz,"EObjectWithInverseEList",546),eTS(1176,546,eJ8,Iu),eUe.Ck=function(){return!0},Y6(eJz,"EObjectWithInverseEList/ManyInverse",1176),eTS(625,546,eJ8,Ic),eUe.ci=function(){this.a=!0},eUe.fj=function(){return this.a},eUe.Xj=function(){var e;eRT(this),TO(this.e)?(e=this.a,this.a=!1,eam(this.e,new ZB(this.e,2,this.c,e,!1))):this.a=!1},eUe.a=!1,Y6(eJz,"EObjectWithInverseEList/Unsettable",625),eTS(1175,625,eJ8,If),eUe.Ck=function(){return!0},Y6(eJz,"EObjectWithInverseEList/Unsettable/ManyInverse",1175),eTS(749,546,eJ8,Il),eUe.Ek=function(){return!0},eUe.li=function(e,t){return ex7(this,e,Pp(t,56))},Y6(eJz,"EObjectWithInverseResolvingEList",749),eTS(31,749,eJ8,Ih),eUe.Ck=function(){return!0},Y6(eJz,"EObjectWithInverseResolvingEList/ManyInverse",31),eTS(750,625,eJ8,Id),eUe.Ek=function(){return!0},eUe.li=function(e,t){return ex7(this,e,Pp(t,56))},Y6(eJz,"EObjectWithInverseResolvingEList/Unsettable",750),eTS(1174,750,eJ8,Ip),eUe.Ck=function(){return!0},Y6(eJz,"EObjectWithInverseResolvingEList/Unsettable/ManyInverse",1174),eTS(1164,622,eJ8),eUe.ai=function(){return(1792&this.b)==0},eUe.ci=function(){this.b|=1},eUe.Bk=function(){return(4&this.b)!=0},eUe.bj=function(){return(40&this.b)!=0},eUe.Ck=function(){return(16&this.b)!=0},eUe.Dk=function(){return(8&this.b)!=0},eUe.Ek=function(){return(this.b&eJq)!=0},eUe.rk=function(){return(32&this.b)!=0},eUe.Fk=function(){return(this.b&eXt)!=0},eUe.wj=function(e){return this.d?VB(this.d,e):this.ak().Yj().wj(e)},eUe.fj=function(){return(2&this.b)!=0?(1&this.b)!=0:0!=this.i},eUe.hi=function(){return(128&this.b)!=0},eUe.Xj=function(){var e;eRT(this),(2&this.b)!=0&&(TO(this.e)?(e=(1&this.b)!=0,this.b&=-2,bz(this,new ZB(this.e,2,edv(this.e.Tg(),this.ak()),e,!1))):this.b&=-2)},eUe.ni=function(){return(1536&this.b)==0},eUe.b=0,Y6(eJz,"EcoreEList/Generic",1164),eTS(1165,1164,eJ8,H2),eUe.ak=function(){return this.a},Y6(eJz,"EcoreEList/Dynamic",1165),eTS(747,63,eXz,pZ),eUe.ri=function(e){return enb(this.a.a,e)},Y6(eJz,"EcoreEMap/1",747),eTS(746,85,eJ8,FZ),eUe.bi=function(e,t){ebB(this.b,Pp(t,133))},eUe.di=function(e,t){eac(this.b)},eUe.ei=function(e,t,n){var r;++(r=this.b,Pp(t,133),r).e},eUe.fi=function(e,t){elj(this.b,Pp(t,133))},eUe.gi=function(e,t,n){elj(this.b,Pp(n,133)),xc(n)===xc(t)&&Pp(n,133).Th(Mi(Pp(t,133).cd())),ebB(this.b,Pp(t,133))},Y6(eJz,"EcoreEMap/DelegateEObjectContainmentEList",746),eTS(1171,151,eJW,enQ),Y6(eJz,"EcoreEMap/Unsettable",1171),eTS(1172,746,eJ8,Ib),eUe.ci=function(){this.a=!0},eUe.fj=function(){return this.a},eUe.Xj=function(){var e;eRT(this),TO(this.e)?(e=this.a,this.a=!1,eam(this.e,new ZB(this.e,2,this.c,e,!1))):this.a=!1},eUe.a=!1,Y6(eJz,"EcoreEMap/Unsettable/UnsettableDelegateEObjectContainmentEList",1172),eTS(1168,228,e$s,YQ),eUe.a=!1,eUe.b=!1,Y6(eJz,"EcoreUtil/Copier",1168),eTS(745,1,eUE,K0),eUe.Nb=function(e){F9(this,e)},eUe.Ob=function(){return edV(this)},eUe.Pb=function(){var e;return edV(this),e=this.b,this.b=null,e},eUe.Qb=function(){this.a.Qb()},Y6(eJz,"EcoreUtil/ProperContentIterator",745),eTS(1382,1381,{},c2),Y6(eJz,"EcoreValidator",1382),RL(eJz,"FeatureMapUtil/Validator"),eTS(1260,1,{1942:1},uu),eUe.rl=function(e){return!0},Y6(eJz,"FeatureMapUtil/1",1260),eTS(757,1,{1942:1},eF2),eUe.rl=function(e){var t;return this.c==e||(null!=(t=LK(Bp(this.a,e)))?t==(OQ(),e0P):eCV(this,e)?(Z$(this.a,e,(OQ(),e0P)),!0):(Z$(this.a,e,(OQ(),e0N)),!1))},eUe.e=!1,Y6(eJz,"FeatureMapUtil/BasicValidator",757),eTS(758,43,e$s,MW),Y6(eJz,"FeatureMapUtil/BasicValidator/Cache",758),eTS(501,52,{20:1,28:1,52:1,14:1,15:1,58:1,76:1,69:1,95:1},xe),eUe.Vc=function(e,t){eLe(this.c,this.b,e,t)},eUe.Fc=function(e){return eIF(this.c,this.b,e)},eUe.Wc=function(e,t){return ePq(this.c,this.b,e,t)},eUe.Gc=function(e){return MJ(this,e)},eUe.Xh=function(e,t){ee7(this.c,this.b,e,t)},eUe.lk=function(e,t){return eCB(this.c,this.b,e,t)},eUe.pi=function(e){return ePL(this.c,this.b,e,!1)},eUe.Zh=function(){return TC(this.c,this.b)},eUe.$h=function(){return TI(this.c,this.b)},eUe._h=function(e){return X8(this.c,this.b,e)},eUe.mk=function(e,t){return Cp(this,e,t)},eUe.$b=function(){bG(this)},eUe.Hc=function(e){return Vq(this.c,this.b,e)},eUe.Ic=function(e){return eiF(this.c,this.b,e)},eUe.Xb=function(e){return ePL(this.c,this.b,e,!0)},eUe.Wj=function(e){return this},eUe.Xc=function(e){return VZ(this.c,this.b,e)},eUe.dc=function(){return xs(this)},eUe.fj=function(){return!edK(this.c,this.b)},eUe.Kc=function(){return eei(this.c,this.b)},eUe.Yc=function(){return eea(this.c,this.b)},eUe.Zc=function(e){return ely(this.c,this.b,e)},eUe.ii=function(e,t){return eNn(this.c,this.b,e,t)},eUe.ji=function(e,t){Xx(this.c,this.b,e,t)},eUe.$c=function(e){return eE0(this.c,this.b,e)},eUe.Mc=function(e){return eIC(this.c,this.b,e)},eUe._c=function(e,t){return eNL(this.c,this.b,e,t)},eUe.Wb=function(e){exZ(this.c,this.b),MJ(this,Pp(e,15))},eUe.gc=function(){return elG(this.c,this.b)},eUe.Pc=function(){return Wb(this.c,this.b)},eUe.Qc=function(e){return VX(this.c,this.b,e)},eUe.Ib=function(){var e,t;for(t=new vs,t.a+="[",e=TC(this.c,this.b);euf(e);)xk(t,Ae(ebm(e))),euf(e)&&(t.a+=eUd);return t.a+="]",t.a},eUe.Xj=function(){exZ(this.c,this.b)},Y6(eJz,"FeatureMapUtil/FeatureEList",501),eTS(627,36,eJx,qu),eUe.yi=function(e){return elc(this,e)},eUe.Di=function(e){var t,n,r,i,a,o,s;switch(this.d){case 1:case 2:if(xc(a=e.Ai())===xc(this.c)&&elc(this,null)==e.yi(null))return this.g=e.zi(),1==e.xi()&&(this.d=1),!0;break;case 3:if(3===(i=e.xi())&&xc(a=e.Ai())===xc(this.c)&&elc(this,null)==e.yi(null))return this.d=5,JL(t=new eta(2),this.g),JL(t,e.zi()),this.g=t,!0;break;case 5:if(3===(i=e.xi())&&xc(a=e.Ai())===xc(this.c)&&elc(this,null)==e.yi(null))return(n=Pp(this.g,14)).Fc(e.zi()),!0;break;case 4:switch(i=e.xi()){case 3:if(xc(a=e.Ai())===xc(this.c)&&elc(this,null)==e.yi(null))return this.d=1,this.g=e.zi(),!0;break;case 4:if(xc(a=e.Ai())===xc(this.c)&&elc(this,null)==e.yi(null))return this.d=6,JL(s=new eta(2),this.n),JL(s,e.Bi()),this.n=s,o=eow(vx(ty_,1),eHT,25,15,[this.o,e.Ci()]),this.g=o,!0}break;case 6:if(4===(i=e.xi())&&xc(a=e.Ai())===xc(this.c)&&elc(this,null)==e.yi(null))return(n=Pp(this.n,14)).Fc(e.Bi()),r=Je(ty_,eHT,25,(o=Pp(this.g,48)).length+1,15,1),ePD(o,0,r,0,o.length),r[o.length]=e.Ci(),this.g=r,!0}return!1},Y6(eJz,"FeatureMapUtil/FeatureENotificationImpl",627),eTS(552,501,{20:1,28:1,52:1,14:1,15:1,58:1,76:1,153:1,215:1,1937:1,69:1,95:1},RA),eUe.dl=function(e,t){return eIF(this.c,e,t)},eUe.el=function(e,t,n){return eCB(this.c,e,t,n)},eUe.fl=function(e,t,n){return ePT(this.c,e,t,n)},eUe.gl=function(){return this},eUe.hl=function(e,t){return ePC(this.c,e,t)},eUe.il=function(e){return Pp(ePL(this.c,this.b,e,!1),72).ak()},eUe.jl=function(e){return Pp(ePL(this.c,this.b,e,!1),72).dd()},eUe.kl=function(){return this.a},eUe.ll=function(e){return!edK(this.c,e)},eUe.ml=function(e,t){ePJ(this.c,e,t)},eUe.nl=function(e){return erp(this.c,e)},eUe.ol=function(e){emY(this.c,e)},Y6(eJz,"FeatureMapUtil/FeatureFeatureMap",552),eTS(1259,1,eJG,xr),eUe.Wj=function(e){return ePL(this.b,this.a,-1,e)},eUe.fj=function(){return!edK(this.b,this.a)},eUe.Wb=function(e){ePJ(this.b,this.a,e)},eUe.Xj=function(){exZ(this.b,this.a)},Y6(eJz,"FeatureMapUtil/FeatureValue",1259);var tve=RL(eQz,"AnyType");eTS(666,60,eHr,gV),Y6(eQz,"InvalidDatatypeValueException",666);var tvt=RL(eQz,eQG),tvn=RL(eQz,eQW),tvr=RL(eQz,eQK);eTS(830,506,{105:1,92:1,90:1,56:1,49:1,97:1,843:1},mF),eUe._g=function(e,t,n){switch(e){case 0:if(n)return this.c||(this.c=new eiR(this,0)),this.c;return this.c||(this.c=new eiR(this,0)),this.c.b;case 1:if(n)return this.c||(this.c=new eiR(this,0)),Pp(GP(this.c,(eR7(),tvx)),153);return(this.c||(this.c=new eiR(this,0)),Pp(Pp(GP(this.c,(eR7(),tvx)),153),215)).kl();case 2:if(n)return this.b||(this.b=new eiR(this,2)),this.b;return this.b||(this.b=new eiR(this,2)),this.b.b}return Qt(this,e-Y1(this.zh()),ee2((2&this.j)==0?this.zh():(this.k||(this.k=new c1),this.k).ck(),e),t,n)},eUe.jh=function(e,t,n){var r;switch(t){case 0:return this.c||(this.c=new eiR(this,0)),eIM(this.c,e,n);case 1:return(this.c||(this.c=new eiR(this,0)),Pp(Pp(GP(this.c,(eR7(),tvx)),153),69)).mk(e,n);case 2:return this.b||(this.b=new eiR(this,2)),eIM(this.b,e,n)}return(r=Pp(ee2((2&this.j)==0?this.zh():(this.k||(this.k=new c1),this.k).ck(),t),66)).Nj().Rj(this,Q6(this),t-Y1(this.zh()),e,n)},eUe.lh=function(e){switch(e){case 0:return!!this.c&&0!=this.c.i;case 1:return!(this.c||(this.c=new eiR(this,0)),Pp(GP(this.c,(eR7(),tvx)),153)).dc();case 2:return!!this.b&&0!=this.b.i}return VP(this,e-Y1(this.zh()),ee2((2&this.j)==0?this.zh():(this.k||(this.k=new c1),this.k).ck(),e))},eUe.sh=function(e,t){switch(e){case 0:this.c||(this.c=new eiR(this,0)),YH(this.c,t);return;case 1:(this.c||(this.c=new eiR(this,0)),Pp(Pp(GP(this.c,(eR7(),tvx)),153),215)).Wb(t);return;case 2:this.b||(this.b=new eiR(this,2)),YH(this.b,t);return}efL(this,e-Y1(this.zh()),ee2((2&this.j)==0?this.zh():(this.k||(this.k=new c1),this.k).ck(),e),t)},eUe.zh=function(){return eR7(),tvk},eUe.Bh=function(e){switch(e){case 0:this.c||(this.c=new eiR(this,0)),eRT(this.c);return;case 1:(this.c||(this.c=new eiR(this,0)),Pp(GP(this.c,(eR7(),tvx)),153)).$b();return;case 2:this.b||(this.b=new eiR(this,2)),eRT(this.b);return}ec5(this,e-Y1(this.zh()),ee2((2&this.j)==0?this.zh():(this.k||(this.k=new c1),this.k).ck(),e))},eUe.Ib=function(){var e;return(4&this.j)!=0?eMT(this):(e=new O1(eMT(this)),e.a+=" (mixed: ",xS(e,this.c),e.a+=", anyAttribute: ",xS(e,this.b),e.a+=")",e.a)},Y6(eQV,"AnyTypeImpl",830),eTS(667,506,{105:1,92:1,90:1,56:1,49:1,97:1,2021:1,667:1},ul),eUe._g=function(e,t,n){switch(e){case 0:return this.a;case 1:return this.b}return Qt(this,e-Y1((eR7(),tvj)),ee2((2&this.j)==0?tvj:(this.k||(this.k=new c1),this.k).ck(),e),t,n)},eUe.lh=function(e){switch(e){case 0:return null!=this.a;case 1:return null!=this.b}return VP(this,e-Y1((eR7(),tvj)),ee2((2&this.j)==0?tvj:(this.k||(this.k=new c1),this.k).ck(),e))},eUe.sh=function(e,t){switch(e){case 0:fg(this,Lq(t));return;case 1:fv(this,Lq(t));return}efL(this,e-Y1((eR7(),tvj)),ee2((2&this.j)==0?tvj:(this.k||(this.k=new c1),this.k).ck(),e),t)},eUe.zh=function(){return eR7(),tvj},eUe.Bh=function(e){switch(e){case 0:this.a=null;return;case 1:this.b=null;return}ec5(this,e-Y1((eR7(),tvj)),ee2((2&this.j)==0?tvj:(this.k||(this.k=new c1),this.k).ck(),e))},eUe.Ib=function(){var e;return(4&this.j)!=0?eMT(this):(e=new O1(eMT(this)),e.a+=" (data: ",xk(e,this.a),e.a+=", target: ",xk(e,this.b),e.a+=")",e.a)},eUe.a=null,eUe.b=null,Y6(eQV,"ProcessingInstructionImpl",667),eTS(668,830,{105:1,92:1,90:1,56:1,49:1,97:1,843:1,2022:1,668:1},mB),eUe._g=function(e,t,n){switch(e){case 0:if(n)return this.c||(this.c=new eiR(this,0)),this.c;return this.c||(this.c=new eiR(this,0)),this.c.b;case 1:if(n)return this.c||(this.c=new eiR(this,0)),Pp(GP(this.c,(eR7(),tvx)),153);return(this.c||(this.c=new eiR(this,0)),Pp(Pp(GP(this.c,(eR7(),tvx)),153),215)).kl();case 2:if(n)return this.b||(this.b=new eiR(this,2)),this.b;return this.b||(this.b=new eiR(this,2)),this.b.b;case 3:return this.c||(this.c=new eiR(this,0)),Lq(ePC(this.c,(eR7(),tvB),!0));case 4:return Iy(this.a,(this.c||(this.c=new eiR(this,0)),Lq(ePC(this.c,(eR7(),tvB),!0))));case 5:return this.a}return Qt(this,e-Y1((eR7(),tvY)),ee2((2&this.j)==0?tvY:(this.k||(this.k=new c1),this.k).ck(),e),t,n)},eUe.lh=function(e){switch(e){case 0:return!!this.c&&0!=this.c.i;case 1:return!(this.c||(this.c=new eiR(this,0)),Pp(GP(this.c,(eR7(),tvx)),153)).dc();case 2:return!!this.b&&0!=this.b.i;case 3:return this.c||(this.c=new eiR(this,0)),null!=Lq(ePC(this.c,(eR7(),tvB),!0));case 4:return null!=Iy(this.a,(this.c||(this.c=new eiR(this,0)),Lq(ePC(this.c,(eR7(),tvB),!0))));case 5:return!!this.a}return VP(this,e-Y1((eR7(),tvY)),ee2((2&this.j)==0?tvY:(this.k||(this.k=new c1),this.k).ck(),e))},eUe.sh=function(e,t){switch(e){case 0:this.c||(this.c=new eiR(this,0)),YH(this.c,t);return;case 1:(this.c||(this.c=new eiR(this,0)),Pp(Pp(GP(this.c,(eR7(),tvx)),153),215)).Wb(t);return;case 2:this.b||(this.b=new eiR(this,2)),YH(this.b,t);return;case 3:Kt(this,Lq(t));return;case 4:Kt(this,Iw(this.a,t));return;case 5:fy(this,Pp(t,148));return}efL(this,e-Y1((eR7(),tvY)),ee2((2&this.j)==0?tvY:(this.k||(this.k=new c1),this.k).ck(),e),t)},eUe.zh=function(){return eR7(),tvY},eUe.Bh=function(e){switch(e){case 0:this.c||(this.c=new eiR(this,0)),eRT(this.c);return;case 1:(this.c||(this.c=new eiR(this,0)),Pp(GP(this.c,(eR7(),tvx)),153)).$b();return;case 2:this.b||(this.b=new eiR(this,2)),eRT(this.b);return;case 3:this.c||(this.c=new eiR(this,0)),ePJ(this.c,(eR7(),tvB),null);return;case 4:Kt(this,Iw(this.a,null));return;case 5:this.a=null;return}ec5(this,e-Y1((eR7(),tvY)),ee2((2&this.j)==0?tvY:(this.k||(this.k=new c1),this.k).ck(),e))},Y6(eQV,"SimpleAnyTypeImpl",668),eTS(669,506,{105:1,92:1,90:1,56:1,49:1,97:1,2023:1,669:1},mY),eUe._g=function(e,t,n){switch(e){case 0:if(n)return this.a||(this.a=new eiR(this,0)),this.a;return this.a||(this.a=new eiR(this,0)),this.a.b;case 1:return n?(this.b||(this.b=new JY((eBK(),tgF),tgf,this,1)),this.b):(this.b||(this.b=new JY((eBK(),tgF),tgf,this,1)),X5(this.b));case 2:return n?(this.c||(this.c=new JY((eBK(),tgF),tgf,this,2)),this.c):(this.c||(this.c=new JY((eBK(),tgF),tgf,this,2)),X5(this.c));case 3:return this.a||(this.a=new eiR(this,0)),GP(this.a,(eR7(),tv$));case 4:return this.a||(this.a=new eiR(this,0)),GP(this.a,(eR7(),tvz));case 5:return this.a||(this.a=new eiR(this,0)),GP(this.a,(eR7(),tvW));case 6:return this.a||(this.a=new eiR(this,0)),GP(this.a,(eR7(),tvK))}return Qt(this,e-Y1((eR7(),tvH)),ee2((2&this.j)==0?tvH:(this.k||(this.k=new c1),this.k).ck(),e),t,n)},eUe.jh=function(e,t,n){var r;switch(t){case 0:return this.a||(this.a=new eiR(this,0)),eIM(this.a,e,n);case 1:return this.b||(this.b=new JY((eBK(),tgF),tgf,this,1)),Iz(this.b,e,n);case 2:return this.c||(this.c=new JY((eBK(),tgF),tgf,this,2)),Iz(this.c,e,n);case 5:return this.a||(this.a=new eiR(this,0)),Cp(GP(this.a,(eR7(),tvW)),e,n)}return(r=Pp(ee2((2&this.j)==0?(eR7(),tvH):(this.k||(this.k=new c1),this.k).ck(),t),66)).Nj().Rj(this,Q6(this),t-Y1((eR7(),tvH)),e,n)},eUe.lh=function(e){switch(e){case 0:return!!this.a&&0!=this.a.i;case 1:return!!this.b&&0!=this.b.f;case 2:return!!this.c&&0!=this.c.f;case 3:return this.a||(this.a=new eiR(this,0)),!xs(GP(this.a,(eR7(),tv$)));case 4:return this.a||(this.a=new eiR(this,0)),!xs(GP(this.a,(eR7(),tvz)));case 5:return this.a||(this.a=new eiR(this,0)),!xs(GP(this.a,(eR7(),tvW)));case 6:return this.a||(this.a=new eiR(this,0)),!xs(GP(this.a,(eR7(),tvK)))}return VP(this,e-Y1((eR7(),tvH)),ee2((2&this.j)==0?tvH:(this.k||(this.k=new c1),this.k).ck(),e))},eUe.sh=function(e,t){switch(e){case 0:this.a||(this.a=new eiR(this,0)),YH(this.a,t);return;case 1:this.b||(this.b=new JY((eBK(),tgF),tgf,this,1)),eai(this.b,t);return;case 2:this.c||(this.c=new JY((eBK(),tgF),tgf,this,2)),eai(this.c,t);return;case 3:this.a||(this.a=new eiR(this,0)),bG(GP(this.a,(eR7(),tv$))),this.a||(this.a=new eiR(this,0)),MJ(GP(this.a,tv$),Pp(t,14));return;case 4:this.a||(this.a=new eiR(this,0)),bG(GP(this.a,(eR7(),tvz))),this.a||(this.a=new eiR(this,0)),MJ(GP(this.a,tvz),Pp(t,14));return;case 5:this.a||(this.a=new eiR(this,0)),bG(GP(this.a,(eR7(),tvW))),this.a||(this.a=new eiR(this,0)),MJ(GP(this.a,tvW),Pp(t,14));return;case 6:this.a||(this.a=new eiR(this,0)),bG(GP(this.a,(eR7(),tvK))),this.a||(this.a=new eiR(this,0)),MJ(GP(this.a,tvK),Pp(t,14));return}efL(this,e-Y1((eR7(),tvH)),ee2((2&this.j)==0?tvH:(this.k||(this.k=new c1),this.k).ck(),e),t)},eUe.zh=function(){return eR7(),tvH},eUe.Bh=function(e){switch(e){case 0:this.a||(this.a=new eiR(this,0)),eRT(this.a);return;case 1:this.b||(this.b=new JY((eBK(),tgF),tgf,this,1)),this.b.c.$b();return;case 2:this.c||(this.c=new JY((eBK(),tgF),tgf,this,2)),this.c.c.$b();return;case 3:this.a||(this.a=new eiR(this,0)),bG(GP(this.a,(eR7(),tv$)));return;case 4:this.a||(this.a=new eiR(this,0)),bG(GP(this.a,(eR7(),tvz)));return;case 5:this.a||(this.a=new eiR(this,0)),bG(GP(this.a,(eR7(),tvW)));return;case 6:this.a||(this.a=new eiR(this,0)),bG(GP(this.a,(eR7(),tvK)));return}ec5(this,e-Y1((eR7(),tvH)),ee2((2&this.j)==0?tvH:(this.k||(this.k=new c1),this.k).ck(),e))},eUe.Ib=function(){var e;return(4&this.j)!=0?eMT(this):(e=new O1(eMT(this)),e.a+=" (mixed: ",xS(e,this.a),e.a+=")",e.a)},Y6(eQV,"XMLTypeDocumentRootImpl",669),eTS(1919,704,{105:1,92:1,90:1,471:1,147:1,56:1,108:1,49:1,97:1,150:1,114:1,115:1,2024:1},uc),eUe.Ih=function(e,t){switch(e.yj()){case 7:case 8:case 9:case 10:case 16:case 22:case 23:case 24:case 25:case 26:case 32:case 33:case 34:case 36:case 37:case 44:case 45:case 50:case 51:case 53:case 55:case 56:case 57:case 58:case 60:case 61:case 4:return null==t?null:efF(t);case 19:case 28:case 29:case 35:case 38:case 39:case 41:case 46:case 52:case 54:case 5:return Lq(t);case 6:return LH(Pp(t,190));case 12:case 47:case 49:case 11:return ejZ(this,e,t);case 13:return null==t?null:ePg(Pp(t,240));case 15:case 14:return null==t?null:Yk(gP(LV(t)));case 17:return eyV((eR7(),t));case 18:return eyV(t);case 21:case 20:return null==t?null:Yx(Pp(t,155).a);case 27:return L$(Pp(t,190));case 30:return emB((eR7(),Pp(t,15)));case 31:return emB(Pp(t,15));case 40:return LG((eR7(),t));case 42:return eyq((eR7(),t));case 43:return eyq(t);case 59:case 48:return Lz((eR7(),t));default:throw p7(new gL(eZ6+e.ne()+eZ5))}},eUe.Jh=function(e){var t;switch(-1==e.G&&(e.G=(t=etP(e))?ebv(t.Mh(),e):-1),e.G){case 0:return new mF;case 1:return new ul;case 2:return new mB;case 3:return new mY;default:throw p7(new gL(eZ7+e.zb+eZ5))}},eUe.Kh=function(e,t){var n,r,i,a,o,s,u,c,l,f,d,h,p,b,m,g;switch(e.yj()){case 5:case 52:case 4:return t;case 6:return epU(t);case 8:case 7:return null==t?null:ewe(t);case 9:return null==t?null:eeT(eDa((r=ePh(t,!0)).length>0&&(GV(0,r.length),43==r.charCodeAt(0))?r.substr(1):r,-128,127)<<24>>24);case 10:return null==t?null:eeT(eDa((i=ePh(t,!0)).length>0&&(GV(0,i.length),43==i.charCodeAt(0))?i.substr(1):i,-128,127)<<24>>24);case 11:return Lq(eBd(this,(eR7(),tvO),t));case 12:return Lq(eBd(this,(eR7(),tvA),t));case 13:return null==t?null:new yY(ePh(t,!0));case 15:case 14:return eOa(t);case 16:return Lq(eBd(this,(eR7(),tvL),t));case 17:return ehy((eR7(),t));case 18:return ehy(t);case 28:case 29:case 35:case 38:case 39:case 41:case 54:case 19:return ePh(t,!0);case 21:case 20:return eOv(t);case 22:return Lq(eBd(this,(eR7(),tvC),t));case 23:return Lq(eBd(this,(eR7(),tvI),t));case 24:return Lq(eBd(this,(eR7(),tvD),t));case 25:return Lq(eBd(this,(eR7(),tvN),t));case 26:return Lq(eBd(this,(eR7(),tvP),t));case 27:return epw(t);case 30:return ehw((eR7(),t));case 31:return ehw(t);case 32:return null==t?null:ell(eDa((l=ePh(t,!0)).length>0&&(GV(0,l.length),43==l.charCodeAt(0))?l.substr(1):l,eHt,eUu));case 33:return null==t?null:new TU((f=ePh(t,!0)).length>0&&(GV(0,f.length),43==f.charCodeAt(0))?f.substr(1):f);case 34:return null==t?null:ell(eDa((d=ePh(t,!0)).length>0&&(GV(0,d.length),43==d.charCodeAt(0))?d.substr(1):d,eHt,eUu));case 36:return null==t?null:ehQ(eF0((h=ePh(t,!0)).length>0&&(GV(0,h.length),43==h.charCodeAt(0))?h.substr(1):h));case 37:return null==t?null:ehQ(eF0((p=ePh(t,!0)).length>0&&(GV(0,p.length),43==p.charCodeAt(0))?p.substr(1):p));case 40:return edR((eR7(),t));case 42:return eh_((eR7(),t));case 43:return eh_(t);case 44:return null==t?null:new TU((b=ePh(t,!0)).length>0&&(GV(0,b.length),43==b.charCodeAt(0))?b.substr(1):b);case 45:return null==t?null:new TU((m=ePh(t,!0)).length>0&&(GV(0,m.length),43==m.charCodeAt(0))?m.substr(1):m);case 46:return ePh(t,!1);case 47:return Lq(eBd(this,(eR7(),tvR),t));case 59:case 48:return edP((eR7(),t));case 49:return Lq(eBd(this,(eR7(),tvF),t));case 50:return null==t?null:elf(eDa((g=ePh(t,!0)).length>0&&(GV(0,g.length),43==g.charCodeAt(0))?g.substr(1):g,eQl,32767)<<16>>16);case 51:return null==t?null:elf(eDa((a=ePh(t,!0)).length>0&&(GV(0,a.length),43==a.charCodeAt(0))?a.substr(1):a,eQl,32767)<<16>>16);case 53:return Lq(eBd(this,(eR7(),tvU),t));case 55:return null==t?null:elf(eDa((o=ePh(t,!0)).length>0&&(GV(0,o.length),43==o.charCodeAt(0))?o.substr(1):o,eQl,32767)<<16>>16);case 56:return null==t?null:elf(eDa((s=ePh(t,!0)).length>0&&(GV(0,s.length),43==s.charCodeAt(0))?s.substr(1):s,eQl,32767)<<16>>16);case 57:return null==t?null:ehQ(eF0((u=ePh(t,!0)).length>0&&(GV(0,u.length),43==u.charCodeAt(0))?u.substr(1):u));case 58:return null==t?null:ehQ(eF0((c=ePh(t,!0)).length>0&&(GV(0,c.length),43==c.charCodeAt(0))?c.substr(1):c));case 60:return null==t?null:ell(eDa((n=ePh(t,!0)).length>0&&(GV(0,n.length),43==n.charCodeAt(0))?n.substr(1):n,eHt,eUu));case 61:return null==t?null:ell(eDa(ePh(t,!0),eHt,eUu));default:throw p7(new gL(eZ6+e.ne()+eZ5))}},Y6(eQV,"XMLTypeFactoryImpl",1919),eTS(586,179,{105:1,92:1,90:1,147:1,191:1,56:1,235:1,108:1,49:1,97:1,150:1,179:1,114:1,115:1,675:1,1945:1,586:1},Ud),eUe.N=!1,eUe.O=!1;var tvi=!1;Y6(eQV,"XMLTypePackageImpl",586),eTS(1852,1,{837:1},uf),eUe._j=function(){return eD4(),eB2},Y6(eQV,"XMLTypePackageImpl/1",1852),eTS(1861,1,eQS,ud),eUe.wj=function(e){return xd(e)},eUe.xj=function(e){return Je(e17,eUP,2,e,6,1)},Y6(eQV,"XMLTypePackageImpl/10",1861),eTS(1862,1,eQS,uh),eUe.wj=function(e){return xd(e)},eUe.xj=function(e){return Je(e17,eUP,2,e,6,1)},Y6(eQV,"XMLTypePackageImpl/11",1862),eTS(1863,1,eQS,up),eUe.wj=function(e){return xd(e)},eUe.xj=function(e){return Je(e17,eUP,2,e,6,1)},Y6(eQV,"XMLTypePackageImpl/12",1863),eTS(1864,1,eQS,ub),eUe.wj=function(e){return xf(e)},eUe.xj=function(e){return Je(e13,eUP,333,e,7,1)},Y6(eQV,"XMLTypePackageImpl/13",1864),eTS(1865,1,eQS,um),eUe.wj=function(e){return xd(e)},eUe.xj=function(e){return Je(e17,eUP,2,e,6,1)},Y6(eQV,"XMLTypePackageImpl/14",1865),eTS(1866,1,eQS,ug),eUe.wj=function(e){return M4(e,15)},eUe.xj=function(e){return Je(e1H,ezZ,15,e,0,1)},Y6(eQV,"XMLTypePackageImpl/15",1866),eTS(1867,1,eQS,uv),eUe.wj=function(e){return M4(e,15)},eUe.xj=function(e){return Je(e1H,ezZ,15,e,0,1)},Y6(eQV,"XMLTypePackageImpl/16",1867),eTS(1868,1,eQS,uy),eUe.wj=function(e){return xd(e)},eUe.xj=function(e){return Je(e17,eUP,2,e,6,1)},Y6(eQV,"XMLTypePackageImpl/17",1868),eTS(1869,1,eQS,uw),eUe.wj=function(e){return M4(e,155)},eUe.xj=function(e){return Je(e14,eUP,155,e,0,1)},Y6(eQV,"XMLTypePackageImpl/18",1869),eTS(1870,1,eQS,u_),eUe.wj=function(e){return xd(e)},eUe.xj=function(e){return Je(e17,eUP,2,e,6,1)},Y6(eQV,"XMLTypePackageImpl/19",1870),eTS(1853,1,eQS,uE),eUe.wj=function(e){return M4(e,843)},eUe.xj=function(e){return Je(tve,eUp,843,e,0,1)},Y6(eQV,"XMLTypePackageImpl/2",1853),eTS(1871,1,eQS,uS),eUe.wj=function(e){return xd(e)},eUe.xj=function(e){return Je(e17,eUP,2,e,6,1)},Y6(eQV,"XMLTypePackageImpl/20",1871),eTS(1872,1,eQS,uk),eUe.wj=function(e){return xd(e)},eUe.xj=function(e){return Je(e17,eUP,2,e,6,1)},Y6(eQV,"XMLTypePackageImpl/21",1872),eTS(1873,1,eQS,ux),eUe.wj=function(e){return xd(e)},eUe.xj=function(e){return Je(e17,eUP,2,e,6,1)},Y6(eQV,"XMLTypePackageImpl/22",1873),eTS(1874,1,eQS,uT),eUe.wj=function(e){return xd(e)},eUe.xj=function(e){return Je(e17,eUP,2,e,6,1)},Y6(eQV,"XMLTypePackageImpl/23",1874),eTS(1875,1,eQS,uM),eUe.wj=function(e){return M4(e,190)},eUe.xj=function(e){return Je(tyk,eUP,190,e,0,2)},Y6(eQV,"XMLTypePackageImpl/24",1875),eTS(1876,1,eQS,uO),eUe.wj=function(e){return xd(e)},eUe.xj=function(e){return Je(e17,eUP,2,e,6,1)},Y6(eQV,"XMLTypePackageImpl/25",1876),eTS(1877,1,eQS,uA),eUe.wj=function(e){return xd(e)},eUe.xj=function(e){return Je(e17,eUP,2,e,6,1)},Y6(eQV,"XMLTypePackageImpl/26",1877),eTS(1878,1,eQS,uL),eUe.wj=function(e){return M4(e,15)},eUe.xj=function(e){return Je(e1H,ezZ,15,e,0,1)},Y6(eQV,"XMLTypePackageImpl/27",1878),eTS(1879,1,eQS,uC),eUe.wj=function(e){return M4(e,15)},eUe.xj=function(e){return Je(e1H,ezZ,15,e,0,1)},Y6(eQV,"XMLTypePackageImpl/28",1879),eTS(1880,1,eQS,uI),eUe.wj=function(e){return xd(e)},eUe.xj=function(e){return Je(e17,eUP,2,e,6,1)},Y6(eQV,"XMLTypePackageImpl/29",1880),eTS(1854,1,eQS,uD),eUe.wj=function(e){return M4(e,667)},eUe.xj=function(e){return Je(tvt,eUp,2021,e,0,1)},Y6(eQV,"XMLTypePackageImpl/3",1854),eTS(1881,1,eQS,uN),eUe.wj=function(e){return M4(e,19)},eUe.xj=function(e){return Je(e16,eUP,19,e,0,1)},Y6(eQV,"XMLTypePackageImpl/30",1881),eTS(1882,1,eQS,uP),eUe.wj=function(e){return xd(e)},eUe.xj=function(e){return Je(e17,eUP,2,e,6,1)},Y6(eQV,"XMLTypePackageImpl/31",1882),eTS(1883,1,eQS,uR),eUe.wj=function(e){return M4(e,162)},eUe.xj=function(e){return Je(e15,eUP,162,e,0,1)},Y6(eQV,"XMLTypePackageImpl/32",1883),eTS(1884,1,eQS,uj),eUe.wj=function(e){return xd(e)},eUe.xj=function(e){return Je(e17,eUP,2,e,6,1)},Y6(eQV,"XMLTypePackageImpl/33",1884),eTS(1885,1,eQS,uF),eUe.wj=function(e){return xd(e)},eUe.xj=function(e){return Je(e17,eUP,2,e,6,1)},Y6(eQV,"XMLTypePackageImpl/34",1885),eTS(1886,1,eQS,uY),eUe.wj=function(e){return xd(e)},eUe.xj=function(e){return Je(e17,eUP,2,e,6,1)},Y6(eQV,"XMLTypePackageImpl/35",1886),eTS(1887,1,eQS,uB),eUe.wj=function(e){return xd(e)},eUe.xj=function(e){return Je(e17,eUP,2,e,6,1)},Y6(eQV,"XMLTypePackageImpl/36",1887),eTS(1888,1,eQS,uU),eUe.wj=function(e){return M4(e,15)},eUe.xj=function(e){return Je(e1H,ezZ,15,e,0,1)},Y6(eQV,"XMLTypePackageImpl/37",1888),eTS(1889,1,eQS,uH),eUe.wj=function(e){return M4(e,15)},eUe.xj=function(e){return Je(e1H,ezZ,15,e,0,1)},Y6(eQV,"XMLTypePackageImpl/38",1889),eTS(1890,1,eQS,u$),eUe.wj=function(e){return xd(e)},eUe.xj=function(e){return Je(e17,eUP,2,e,6,1)},Y6(eQV,"XMLTypePackageImpl/39",1890),eTS(1855,1,eQS,uz),eUe.wj=function(e){return M4(e,668)},eUe.xj=function(e){return Je(tvn,eUp,2022,e,0,1)},Y6(eQV,"XMLTypePackageImpl/4",1855),eTS(1891,1,eQS,uG),eUe.wj=function(e){return xd(e)},eUe.xj=function(e){return Je(e17,eUP,2,e,6,1)},Y6(eQV,"XMLTypePackageImpl/40",1891),eTS(1892,1,eQS,uW),eUe.wj=function(e){return xd(e)},eUe.xj=function(e){return Je(e17,eUP,2,e,6,1)},Y6(eQV,"XMLTypePackageImpl/41",1892),eTS(1893,1,eQS,uK),eUe.wj=function(e){return xd(e)},eUe.xj=function(e){return Je(e17,eUP,2,e,6,1)},Y6(eQV,"XMLTypePackageImpl/42",1893),eTS(1894,1,eQS,uV),eUe.wj=function(e){return xd(e)},eUe.xj=function(e){return Je(e17,eUP,2,e,6,1)},Y6(eQV,"XMLTypePackageImpl/43",1894),eTS(1895,1,eQS,uq),eUe.wj=function(e){return xd(e)},eUe.xj=function(e){return Je(e17,eUP,2,e,6,1)},Y6(eQV,"XMLTypePackageImpl/44",1895),eTS(1896,1,eQS,uZ),eUe.wj=function(e){return M4(e,184)},eUe.xj=function(e){return Je(e18,eUP,184,e,0,1)},Y6(eQV,"XMLTypePackageImpl/45",1896),eTS(1897,1,eQS,uX),eUe.wj=function(e){return xd(e)},eUe.xj=function(e){return Je(e17,eUP,2,e,6,1)},Y6(eQV,"XMLTypePackageImpl/46",1897),eTS(1898,1,eQS,uJ),eUe.wj=function(e){return xd(e)},eUe.xj=function(e){return Je(e17,eUP,2,e,6,1)},Y6(eQV,"XMLTypePackageImpl/47",1898),eTS(1899,1,eQS,uQ),eUe.wj=function(e){return xd(e)},eUe.xj=function(e){return Je(e17,eUP,2,e,6,1)},Y6(eQV,"XMLTypePackageImpl/48",1899),eTS(eHx,1,eQS,u1),eUe.wj=function(e){return M4(e,184)},eUe.xj=function(e){return Je(e18,eUP,184,e,0,1)},Y6(eQV,"XMLTypePackageImpl/49",eHx),eTS(1856,1,eQS,u0),eUe.wj=function(e){return M4(e,669)},eUe.xj=function(e){return Je(tvr,eUp,2023,e,0,1)},Y6(eQV,"XMLTypePackageImpl/5",1856),eTS(1901,1,eQS,u2),eUe.wj=function(e){return M4(e,162)},eUe.xj=function(e){return Je(e15,eUP,162,e,0,1)},Y6(eQV,"XMLTypePackageImpl/50",1901),eTS(1902,1,eQS,u3),eUe.wj=function(e){return xd(e)},eUe.xj=function(e){return Je(e17,eUP,2,e,6,1)},Y6(eQV,"XMLTypePackageImpl/51",1902),eTS(1903,1,eQS,u4),eUe.wj=function(e){return M4(e,19)},eUe.xj=function(e){return Je(e16,eUP,19,e,0,1)},Y6(eQV,"XMLTypePackageImpl/52",1903),eTS(1857,1,eQS,u6),eUe.wj=function(e){return xd(e)},eUe.xj=function(e){return Je(e17,eUP,2,e,6,1)},Y6(eQV,"XMLTypePackageImpl/6",1857),eTS(1858,1,eQS,u5),eUe.wj=function(e){return M4(e,190)},eUe.xj=function(e){return Je(tyk,eUP,190,e,0,2)},Y6(eQV,"XMLTypePackageImpl/7",1858),eTS(1859,1,eQS,u8),eUe.wj=function(e){return xl(e)},eUe.xj=function(e){return Je(e11,eUP,476,e,8,1)},Y6(eQV,"XMLTypePackageImpl/8",1859),eTS(1860,1,eQS,u9),eUe.wj=function(e){return M4(e,217)},eUe.xj=function(e){return Je(e10,eUP,217,e,0,1)},Y6(eQV,"XMLTypePackageImpl/9",1860),eTS(50,60,eHr,gX),Y6(e1l,"RegEx/ParseException",50),eTS(820,1,{},u7),eUe.sl=function(e){return e16*n)throw p7(new gX(eBJ((Mo(),eJd))));n=16*n+i}if(125!=this.a)throw p7(new gX(eBJ((Mo(),eJh))));if(n>e1f)throw p7(new gX(eBJ((Mo(),eJp))));e=n}else{if(i=0,0!=this.c||(i=eb0(this.a))<0||(n=i,eBM(this),0!=this.c||(i=eb0(this.a))<0))throw p7(new gX(eBJ((Mo(),eJf))));e=n=16*n+i}break;case 117:if(r=0,eBM(this),0!=this.c||(r=eb0(this.a))<0||(t=r,eBM(this),0!=this.c||(r=eb0(this.a))<0)||(t=16*t+r,eBM(this),0!=this.c||(r=eb0(this.a))<0)||(t=16*t+r,eBM(this),0!=this.c||(r=eb0(this.a))<0))throw p7(new gX(eBJ((Mo(),eJf))));e=t=16*t+r;break;case 118:if(eBM(this),0!=this.c||(r=eb0(this.a))<0||(t=r,eBM(this),0!=this.c||(r=eb0(this.a))<0)||(t=16*t+r,eBM(this),0!=this.c||(r=eb0(this.a))<0)||(t=16*t+r,eBM(this),0!=this.c||(r=eb0(this.a))<0)||(t=16*t+r,eBM(this),0!=this.c||(r=eb0(this.a))<0)||(t=16*t+r,eBM(this),0!=this.c||(r=eb0(this.a))<0))throw p7(new gX(eBJ((Mo(),eJf))));if((t=16*t+r)>e1f)throw p7(new gX(eBJ((Mo(),"parser.descappe.4"))));e=t;break;case 65:case 90:case 122:throw p7(new gX(eBJ((Mo(),eJb))))}return e},eUe.ul=function(e){var t,n;switch(e){case 100:n=(32&this.e)==32?eYB("Nd",!0):(eBG(),tv9);break;case 68:n=(32&this.e)==32?eYB("Nd",!1):(eBG(),tyr);break;case 119:n=(32&this.e)==32?eYB("IsWord",!0):(eBG(),tyd);break;case 87:n=(32&this.e)==32?eYB("IsWord",!1):(eBG(),tya);break;case 115:n=(32&this.e)==32?eYB("IsSpace",!0):(eBG(),tys);break;case 83:n=(32&this.e)==32?eYB("IsSpace",!1):(eBG(),tyi);break;default:throw p7(new go(e1d+(t=e).toString(16)))}return n},eUe.vl=function(e){var t,n,r,i,a,o,s,u,c,l,f,d;for(this.b=1,eBM(this),t=null,0==this.c&&94==this.a?(eBM(this),e?l=(eBG(),eBG(),++tyv,new WZ(5)):(t=(eBG(),eBG(),++tyv,new WZ(4)),eLw(t,0,e1f),l=(++tyv,new WZ(4)))):l=(eBG(),eBG(),++tyv,new WZ(4)),i=!0;1!=(d=this.c)&&(0!=d||93!=this.a||i);){if(i=!1,n=this.a,r=!1,10==d)switch(n){case 100:case 68:case 119:case 87:case 115:case 83:ePR(l,this.ul(n)),r=!0;break;case 105:case 73:case 99:case 67:(n=this.Ll(l,n))<0&&(r=!0);break;case 112:case 80:if(!(f=ext(this,n)))throw p7(new gX(eBJ((Mo(),eJe))));ePR(l,f),r=!0;break;default:n=this.tl()}else if(20==d){if((o=AG(this.i,58,this.d))<0)throw p7(new gX(eBJ((Mo(),eJt))));if(s=!0,94==UI(this.i,this.d)&&(++this.d,s=!1),!(u=JI(a=Az(this.i,this.d,o),s,(512&this.e)==512)))throw p7(new gX(eBJ((Mo(),eJr))));if(ePR(l,u),r=!0,o+1>=this.j||93!=UI(this.i,o+1))throw p7(new gX(eBJ((Mo(),eJt))));this.d=o+2}if(eBM(this),!r){if(0!=this.c||45!=this.a)eLw(l,n,n);else{if(eBM(this),1==(d=this.c))throw p7(new gX(eBJ((Mo(),eJn))));0==d&&93==this.a?(eLw(l,n,n),eLw(l,45,45)):(c=this.a,10==d&&(c=this.tl()),eBM(this),eLw(l,n,c))}}(this.e&eXt)==eXt&&0==this.c&&44==this.a&&eBM(this)}if(1==this.c)throw p7(new gX(eBJ((Mo(),eJn))));return t&&(ej0(t,l),l=t),eMS(l),eRo(l),this.b=0,eBM(this),l},eUe.wl=function(){var e,t,n,r;for(n=this.vl(!1);7!=(r=this.c);)if(e=this.a,0==r&&(45==e||38==e)||4==r){if(eBM(this),9!=this.c)throw p7(new gX(eBJ((Mo(),eJu))));if(t=this.vl(!1),4==r)ePR(n,t);else if(45==e)ej0(n,t);else if(38==e)ejO(n,t);else throw p7(new go("ASSERT"))}else throw p7(new gX(eBJ((Mo(),eJc))));return eBM(this),n},eUe.xl=function(){var e,t;return e=this.a-48,t=(eBG(),eBG(),++tyv,new zc(12,null,e)),this.g||(this.g=new bZ),bY(this.g,new pX(e)),eBM(this),t},eUe.yl=function(){return eBM(this),eBG(),tyu},eUe.zl=function(){return eBM(this),eBG(),tyo},eUe.Al=function(){throw p7(new gX(eBJ((Mo(),eJm))))},eUe.Bl=function(){throw p7(new gX(eBJ((Mo(),eJm))))},eUe.Cl=function(){return eBM(this),esV()},eUe.Dl=function(){return eBM(this),eBG(),tyl},eUe.El=function(){return eBM(this),eBG(),tyh},eUe.Fl=function(){var e;if(this.d>=this.j||(65504&(e=UI(this.i,this.d++)))!=64)throw p7(new gX(eBJ((Mo(),eX5))));return eBM(this),eBG(),eBG(),++tyv,new jb(0,e-64)},eUe.Gl=function(){return eBM(this),eNw()},eUe.Hl=function(){return eBM(this),eBG(),typ},eUe.Il=function(){var e;return e=(eBG(),eBG(),++tyv,new jb(0,105)),eBM(this),e},eUe.Jl=function(){return eBM(this),eBG(),tyf},eUe.Kl=function(){return eBM(this),eBG(),tyc},eUe.Ll=function(e,t){return this.tl()},eUe.Ml=function(){return eBM(this),eBG(),tyt},eUe.Nl=function(){var e,t,n,r,i;if(this.d+1>=this.j)throw p7(new gX(eBJ((Mo(),eX3))));if(r=-1,t=null,49<=(e=UI(this.i,this.d))&&e<=57){if(r=e-48,this.g||(this.g=new bZ),bY(this.g,new pX(r)),++this.d,41!=UI(this.i,this.d))throw p7(new gX(eBJ((Mo(),eX1))));++this.d}else switch(63==e&&--this.d,eBM(this),(t=eBs(this)).e){case 20:case 21:case 22:case 23:break;case 8:if(7!=this.c)throw p7(new gX(eBJ((Mo(),eX1))));break;default:throw p7(new gX(eBJ((Mo(),eX4))))}if(eBM(this),i=ehT(this),n=null,2==i.e){if(2!=i.em())throw p7(new gX(eBJ((Mo(),eX6))));n=i.am(1),i=i.am(0)}if(7!=this.c)throw p7(new gX(eBJ((Mo(),eX1))));return eBM(this),eBG(),eBG(),++tyv,new ee_(r,t,i,n)},eUe.Ol=function(){return eBM(this),eBG(),tyn},eUe.Pl=function(){var e;if(eBM(this),e=F4(24,ehT(this)),7!=this.c)throw p7(new gX(eBJ((Mo(),eX1))));return eBM(this),e},eUe.Ql=function(){var e;if(eBM(this),e=F4(20,ehT(this)),7!=this.c)throw p7(new gX(eBJ((Mo(),eX1))));return eBM(this),e},eUe.Rl=function(){var e;if(eBM(this),e=F4(22,ehT(this)),7!=this.c)throw p7(new gX(eBJ((Mo(),eX1))));return eBM(this),e},eUe.Sl=function(){var e,t,n,r,i;for(e=0,n=0,t=-1;this.d=this.j)throw p7(new gX(eBJ((Mo(),eX0))));if(45==t){for(++this.d;this.d=this.j)throw p7(new gX(eBJ((Mo(),eX0))))}if(58==t){if(++this.d,eBM(this),r=Bu(ehT(this),e,n),7!=this.c)throw p7(new gX(eBJ((Mo(),eX1))));eBM(this)}else if(41==t)++this.d,eBM(this),r=Bu(ehT(this),e,n);else throw p7(new gX(eBJ((Mo(),eX2))));return r},eUe.Tl=function(){var e;if(eBM(this),e=F4(21,ehT(this)),7!=this.c)throw p7(new gX(eBJ((Mo(),eX1))));return eBM(this),e},eUe.Ul=function(){var e;if(eBM(this),e=F4(23,ehT(this)),7!=this.c)throw p7(new gX(eBJ((Mo(),eX1))));return eBM(this),e},eUe.Vl=function(){var e,t;if(eBM(this),e=this.f++,t=F6(ehT(this),e),7!=this.c)throw p7(new gX(eBJ((Mo(),eX1))));return eBM(this),t},eUe.Wl=function(){var e;if(eBM(this),e=F6(ehT(this),0),7!=this.c)throw p7(new gX(eBJ((Mo(),eX1))));return eBM(this),e},eUe.Xl=function(e){return(eBM(this),5==this.c)?(eBM(this),jS(e,(eBG(),eBG(),++tyv,new qa(9,e)))):jS(e,(eBG(),eBG(),++tyv,new qa(3,e)))},eUe.Yl=function(e){var t;return eBM(this),t=(eBG(),eBG(),++tyv,new Mr(2)),5==this.c?(eBM(this),eRv(t,tye),eRv(t,e)):(eRv(t,e),eRv(t,tye)),t},eUe.Zl=function(e){return(eBM(this),5==this.c)?(eBM(this),eBG(),eBG(),++tyv,new qa(9,e)):(eBG(),eBG(),++tyv,new qa(3,e))},eUe.a=0,eUe.b=0,eUe.c=0,eUe.d=0,eUe.e=0,eUe.f=1,eUe.g=null,eUe.j=0,Y6(e1l,"RegEx/RegexParser",820),eTS(1824,820,{},mU),eUe.sl=function(e){return!1},eUe.tl=function(){return eCn(this)},eUe.ul=function(e){return eDu(e)},eUe.vl=function(e){return eBL(this)},eUe.wl=function(){throw p7(new gX(eBJ((Mo(),eJm))))},eUe.xl=function(){throw p7(new gX(eBJ((Mo(),eJm))))},eUe.yl=function(){throw p7(new gX(eBJ((Mo(),eJm))))},eUe.zl=function(){throw p7(new gX(eBJ((Mo(),eJm))))},eUe.Al=function(){return eBM(this),eDu(67)},eUe.Bl=function(){return eBM(this),eDu(73)},eUe.Cl=function(){throw p7(new gX(eBJ((Mo(),eJm))))},eUe.Dl=function(){throw p7(new gX(eBJ((Mo(),eJm))))},eUe.El=function(){throw p7(new gX(eBJ((Mo(),eJm))))},eUe.Fl=function(){return eBM(this),eDu(99)},eUe.Gl=function(){throw p7(new gX(eBJ((Mo(),eJm))))},eUe.Hl=function(){throw p7(new gX(eBJ((Mo(),eJm))))},eUe.Il=function(){return eBM(this),eDu(105)},eUe.Jl=function(){throw p7(new gX(eBJ((Mo(),eJm))))},eUe.Kl=function(){throw p7(new gX(eBJ((Mo(),eJm))))},eUe.Ll=function(e,t){return ePR(e,eDu(t)),-1},eUe.Ml=function(){return eBM(this),eBG(),eBG(),++tyv,new jb(0,94)},eUe.Nl=function(){throw p7(new gX(eBJ((Mo(),eJm))))},eUe.Ol=function(){return eBM(this),eBG(),eBG(),++tyv,new jb(0,36)},eUe.Pl=function(){throw p7(new gX(eBJ((Mo(),eJm))))},eUe.Ql=function(){throw p7(new gX(eBJ((Mo(),eJm))))},eUe.Rl=function(){throw p7(new gX(eBJ((Mo(),eJm))))},eUe.Sl=function(){throw p7(new gX(eBJ((Mo(),eJm))))},eUe.Tl=function(){throw p7(new gX(eBJ((Mo(),eJm))))},eUe.Ul=function(){throw p7(new gX(eBJ((Mo(),eJm))))},eUe.Vl=function(){var e;if(eBM(this),e=F6(ehT(this),0),7!=this.c)throw p7(new gX(eBJ((Mo(),eX1))));return eBM(this),e},eUe.Wl=function(){throw p7(new gX(eBJ((Mo(),eJm))))},eUe.Xl=function(e){return eBM(this),jS(e,(eBG(),eBG(),++tyv,new qa(3,e)))},eUe.Yl=function(e){var t;return eBM(this),t=(eBG(),eBG(),++tyv,new Mr(2)),eRv(t,e),eRv(t,tye),t},eUe.Zl=function(e){return eBM(this),eBG(),eBG(),++tyv,new qa(3,e)};var tva=null,tvo=null;Y6(e1l,"RegEx/ParserForXMLSchema",1824),eTS(117,1,e1k,pJ),eUe.$l=function(e){throw p7(new go("Not supported."))},eUe._l=function(){return -1},eUe.am=function(e){return null},eUe.bm=function(){return null},eUe.cm=function(e){},eUe.dm=function(e){},eUe.em=function(){return 0},eUe.Ib=function(){return this.fm(0)},eUe.fm=function(e){return 11==this.e?".":""},eUe.e=0;var tvs,tvu,tvc,tvl,tvf,tvd,tvh,tvp,tvb,tvm,tvg,tvv,tvy,tvw,tv_,tvE,tvS,tvk,tvx,tvT,tvM,tvO,tvA,tvL,tvC,tvI,tvD,tvN,tvP,tvR,tvj,tvF,tvY,tvB,tvU,tvH,tv$,tvz,tvG,tvW,tvK,tvV,tvq,tvZ,tvX,tvJ,tvQ,tv1,tv0,tv2,tv3,tv4,tv6,tv5,tv8,tv9,tv7,tye,tyt,tyn,tyr,tyi,tya,tyo,tys,tyu,tyc,tyl,tyf,tyd,tyh,typ,tyb=null,tym=null,tyg=null,tyv=0,tyy=Y6(e1l,"RegEx/Token",117);eTS(136,117,{3:1,136:1,117:1},WZ),eUe.fm=function(e){var t,n,r;if(4==this.e){if(this==tv7)n=".";else if(this==tv9)n="\\d";else if(this==tyd)n="\\w";else if(this==tys)n="\\s";else{for(r=new vs,r.a+="[",t=0;t0&&(r.a+=","),this.b[t]===this.b[t+1]?xk(r,eN$(this.b[t])):(xk(r,eN$(this.b[t])),r.a+="-",xk(r,eN$(this.b[t+1])));r.a+="]",n=r.a}}else if(this==tyr)n="\\D";else if(this==tya)n="\\W";else if(this==tyi)n="\\S";else{for(r=new vs,r.a+="[^",t=0;t0&&(r.a+=","),this.b[t]===this.b[t+1]?xk(r,eN$(this.b[t])):(xk(r,eN$(this.b[t])),r.a+="-",xk(r,eN$(this.b[t+1])));r.a+="]",n=r.a}return n},eUe.a=!1,eUe.c=!1,Y6(e1l,"RegEx/RangeToken",136),eTS(584,1,{584:1},pX),eUe.a=0,Y6(e1l,"RegEx/RegexParser/ReferencePosition",584),eTS(583,1,{3:1,583:1},wu),eUe.Fb=function(e){var t;return!!(null!=e&&M4(e,583))&&(t=Pp(e,583),IE(this.b,t.b)&&this.a==t.a)},eUe.Hb=function(){return ebA(this.b+"/"+eAN(this.a))},eUe.Ib=function(){return this.c.fm(this.a)},eUe.a=0,Y6(e1l,"RegEx/RegularExpression",583),eTS(223,117,e1k,jb),eUe._l=function(){return this.a},eUe.fm=function(e){var t,n,r;switch(this.e){case 0:switch(this.a){case 124:case 42:case 43:case 63:case 40:case 41:case 46:case 91:case 123:case 92:r="\\"+CB(this.a&eHd);break;case 12:r="\\f";break;case 10:r="\\n";break;case 13:r="\\r";break;case 9:r="\\t";break;case 27:r="\\e";break;default:r=this.a>=eH3?"\\v"+Az(n="0"+(t=this.a>>>0).toString(16),n.length-6,n.length):""+CB(this.a&eHd)}break;case 8:r=this==tyt||this==tyn?""+CB(this.a&eHd):"\\"+CB(this.a&eHd);break;default:r=null}return r},eUe.a=0,Y6(e1l,"RegEx/Token/CharToken",223),eTS(309,117,e1k,qa),eUe.am=function(e){return this.a},eUe.cm=function(e){this.b=e},eUe.dm=function(e){this.c=e},eUe.em=function(){return 1},eUe.fm=function(e){var t;if(3==this.e){if(this.c<0&&this.b<0)t=this.a.fm(e)+"*";else if(this.c==this.b)t=this.a.fm(e)+"{"+this.c+"}";else if(this.c>=0&&this.b>=0)t=this.a.fm(e)+"{"+this.c+","+this.b+"}";else if(this.c>=0&&this.b<0)t=this.a.fm(e)+"{"+this.c+",}";else throw p7(new go("Token#toString(): CLOSURE "+this.c+eUd+this.b))}else if(this.c<0&&this.b<0)t=this.a.fm(e)+"*?";else if(this.c==this.b)t=this.a.fm(e)+"{"+this.c+"}?";else if(this.c>=0&&this.b>=0)t=this.a.fm(e)+"{"+this.c+","+this.b+"}?";else if(this.c>=0&&this.b<0)t=this.a.fm(e)+"{"+this.c+",}?";else throw p7(new go("Token#toString(): NONGREEDYCLOSURE "+this.c+eUd+this.b));return t},eUe.b=0,eUe.c=0,Y6(e1l,"RegEx/Token/ClosureToken",309),eTS(821,117,e1k,YD),eUe.am=function(e){return 0==e?this.a:this.b},eUe.em=function(){return 2},eUe.fm=function(e){var t;return 3==this.b.e&&this.b.am(0)==this.a?this.a.fm(e)+"+":9==this.b.e&&this.b.am(0)==this.a?this.a.fm(e)+"+?":this.a.fm(e)+""+this.b.fm(e)},Y6(e1l,"RegEx/Token/ConcatToken",821),eTS(1822,117,e1k,ee_),eUe.am=function(e){if(0==e)return this.d;if(1==e)return this.b;throw p7(new go("Internal Error: "+e))},eUe.em=function(){return this.b?2:1},eUe.fm=function(e){var t;return t=this.c>0?"(?("+this.c+")":8==this.a.e?"(?("+this.a+")":"(?"+this.a,this.b?t+=this.d+"|"+this.b+")":t+=this.d+")",t},eUe.c=0,Y6(e1l,"RegEx/Token/ConditionToken",1822),eTS(1823,117,e1k,Wq),eUe.am=function(e){return this.b},eUe.em=function(){return 1},eUe.fm=function(e){return"(?"+(0==this.a?"":eAN(this.a))+(0==this.c?"":eAN(this.c))+":"+this.b.fm(e)+")"},eUe.a=0,eUe.c=0,Y6(e1l,"RegEx/Token/ModifierToken",1823),eTS(822,117,e1k,BR),eUe.am=function(e){return this.a},eUe.em=function(){return 1},eUe.fm=function(e){var t;switch(t=null,this.e){case 6:t=0==this.b?"(?:"+this.a.fm(e)+")":"("+this.a.fm(e)+")";break;case 20:t="(?="+this.a.fm(e)+")";break;case 21:t="(?!"+this.a.fm(e)+")";break;case 22:t="(?<="+this.a.fm(e)+")";break;case 23:t="(?"+this.a.fm(e)+")"}return t},eUe.b=0,Y6(e1l,"RegEx/Token/ParenToken",822),eTS(521,117,{3:1,117:1,521:1},zc),eUe.bm=function(){return this.b},eUe.fm=function(e){return 12==this.e?"\\"+this.a:eTd(this.b)},eUe.a=0,Y6(e1l,"RegEx/Token/StringToken",521),eTS(465,117,e1k,Mr),eUe.$l=function(e){eRv(this,e)},eUe.am=function(e){return Pp(Bz(this.a,e),117)},eUe.em=function(){return this.a?this.a.a.c.length:0},eUe.fm=function(e){var t,n,r,i,a;if(1==this.e){if(2==this.a.a.c.length)t=Pp(Bz(this.a,0),117),i=3==(n=Pp(Bz(this.a,1),117)).e&&n.am(0)==t?t.fm(e)+"+":9==n.e&&n.am(0)==t?t.fm(e)+"+?":t.fm(e)+""+n.fm(e);else{for(r=0,a=new vs;r=this.c.b:this.a<=this.c.b},eUe.Sb=function(){return this.b>0},eUe.Tb=function(){return this.b},eUe.Vb=function(){return this.b-1},eUe.Qb=function(){throw p7(new gW(e1L))},eUe.a=0,eUe.b=0,Y6(e1M,"ExclusiveRange/RangeIterator",254);var tyw=Ui(eJX,"C"),ty_=Ui(eJ1,"I"),tyE=Ui(eUi,"Z"),tyS=Ui(eJ0,"J"),tyk=Ui(eJZ,"B"),tyx=Ui(eJJ,"D"),tyT=Ui(eJQ,"F"),tyM=Ui(eJ2,"S"),tyO=RL("org.eclipse.elk.core.labels","ILabelManager"),tyA=RL(eX_,"DiagnosticChain"),tyL=RL(eQx,"ResourceSet"),tyC=Y6(eX_,"InvocationTargetException",null),tyI=(vg(),q5),tyD=tyD=eyP;enI(bs),eiE("permProps",[[[e1C,e1I],[e1D,"gecko1_8"]],[[e1C,e1I],[e1D,"ie10"]],[[e1C,e1I],[e1D,"ie8"]],[[e1C,e1I],[e1D,"ie9"]],[[e1C,e1I],[e1D,"safari"]]]),tyD(null,"elk",null)},3379(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}function a(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var o=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};r(this,t);var a=Object.assign({},e),o=!1;try{o=!0}catch(s){}if(e.workerUrl){if(o){var u=n(84763);a.workerFactory=function(e){return new u(e)}}else console.warn("Web worker requested but 'web-worker' package not installed. \nConsider installing the package or pass your own 'workerFactory' to ELK's constructor.\n... Falling back to non-web worker version.")}if(!a.workerFactory){var c=n(55273).Worker;a.workerFactory=function(e){return new c(e)}}return i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,a))}return a(t,e),t}(n(4005).default);Object.defineProperty(e.exports,"__esModule",{value:!0}),e.exports=o,o.default=o},17187(e){"use strict";var t,n="object"==typeof Reflect?Reflect:null,r=n&&"function"==typeof n.apply?n.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};function i(e){console&&console.warn&&console.warn(e)}t=n&&"function"==typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var a=Number.isNaN||function(e){return e!=e};function o(){o.init.call(this)}e.exports=o,e.exports.once=v,o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var s=10;function u(e){if("function"!=typeof e)throw TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function c(e){return void 0===e._maxListeners?o.defaultMaxListeners:e._maxListeners}function l(e,t,n,r){if(u(n),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),o=e._events),s=o[t]),void 0===s)s=o[t]=n,++e._eventsCount;else if("function"==typeof s?s=o[t]=r?[n,s]:[s,n]:r?s.unshift(n):s.push(n),(a=c(e))>0&&s.length>a&&!s.warned){s.warned=!0;var a,o,s,l=Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=t,l.count=s.length,i(l)}return e}function f(){if(!this.fired)return(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length)?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=f.bind(r);return i.listener=n,r.wrapFn=i,i}function h(e,t,n){var r=e._events;if(void 0===r)return[];var i=r[t];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?g(i):b(i,i.length)}function p(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function b(e,t){for(var n=Array(t),r=0;r0&&(o=t[0]),o instanceof Error)throw o;var o,s=Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var u=a[e];if(void 0===u)return!1;if("function"==typeof u)r(u,this,t);else for(var c=u.length,l=b(u,c),n=0;n=0;a--)if(n[a]===t||n[a].listener===t){o=n[a].listener,i=a;break}if(i<0)return this;0===i?n.shift():m(n,i),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,o||t)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(e){var t,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var i,a=Object.keys(n);for(r=0;r=0;r--)this.removeListener(e,t[r]);return this},o.prototype.listeners=function(e){return h(this,e,!0)},o.prototype.rawListeners=function(e){return h(this,e,!1)},o.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):p.call(e,t)},o.prototype.listenerCount=p,o.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},16839(e,t,n){var r=n(25323),i=n(31744),a=n(98361),o=n(4514);e.exports={graphlib:n(32478),read:r,readMany:i,write:a,version:o,type:"dot",buffer:!1}},11100(e,t,n){"use strict";var r=n(47755),i=n(32478).Graph;function a(e){var t="graph"!==e.type,n=!e.strict,a=[{node:{},edge:{}}],s=e.id,u=new i({directed:t,multigraph:n,compound:!0});return u.setGraph(null===s?{}:{id:s}),r.each(e.stmts,function(e){o(u,e,a)}),u}function o(e,t,n,r){switch(t.type){case"node":s(e,t,n,r);break;case"edge":u(e,t,n,r);break;case"subgraph":c(e,t,n,r);break;case"attr":l(e,t,n);break;case"inlineAttr":f(e,t,n,r)}}function s(e,t,n,i){var a=t.id,o=t.attrs;h(e,a,n,i),r.merge(e.node(a),o)}function u(e,t,n,i){var a,s,u=t.attrs;r.each(t.elems,function(t){switch(o(e,t,n,i),t.type){case"node":s=[t.id];break;case"subgraph":s=p(t)}r.each(a,function(t){r.each(s,function(i){var a;e.hasEdge(t,i)&&e.isMultigraph()&&(a=r.uniqueId("edge")),e.hasEdge(t,i,a)||e.setEdge(t,i,r.clone(r.last(n).edge),a),r.merge(e.edge(t,i,a),u)})}),a=s})}function c(e,t,n,i){var a=t.id;void 0===a&&(a=d(e)),n.push(r.clone(r.last(n))),h(e,a,n,i),r.each(t.stmts,function(t){o(e,t,n,a)}),e.children(a).length||e.removeNode(a),n.pop()}function l(e,t,n){r.merge(r.last(n)[t.attrType],t.attrs)}function f(e,t,n,i){r.merge(i?e.node(i):e.graph(),t.attrs)}function d(e){var t;do t=r.uniqueId("sg");while(e.hasNode(t))return t}function h(e,t,n,i){e.hasNode(t)||(e.setNode(t,r.clone(r.last(n).node)),e.setParent(t,i))}function p(e){var t,n={},i=[],a=i.push.bind(i);for(a(e);i.length;)switch((t=i.pop()).type){case"node":n[t.id]=!0;break;case"edge":r.each(t.elems,a);break;case"subgraph":r.each(t.stmts,a)}return r.keys(n)}e.exports=a},4644(e,t,n){e.exports=function(){function e(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n}function t(e,t,n,r,i,a){this.message=e,this.expected=t,this.found=n,this.offset=r,this.line=i,this.column=a,this.name="SyntaxError"}function r(e){var r,i,a=arguments.length>1?arguments[1]:{},o={},s={start:tf,graphStmt:td},u=tf,c=o,l=null,f="{",d={type:"literal",value:"{",description:'"{"'},h="}",p={type:"literal",value:"}",description:'"}"'},b=function(e,t,n,r){return{type:t,id:n,strict:null!==e,stmts:r}},m=";",g={type:"literal",value:";",description:'";"'},v=function(e,t){for(var n=[e],r=0;r",description:'"->"'},U=function(e,t){var n=[e];if(t)for(var r=0;rt&&(tr=0,ti={line:1,column:1,seenCR:!1}),n(ti,tr,t),tr=t),ti}function tc(e){!(ttta&&(ta=tt,to=[]),to.push(e))}function tl(n,r,i){function a(e){var t=1;for(e.sort(function(e,t){return e.descriptiont.description?1:0});t1?o.slice(0,-1).join(", ")+" or "+o[e.length-1]:o[0])+" but "+(i=t?'"'+n(t)+'"':"end of input")+" found."}var s=tu(i),u=itt?(s=e.charAt(tt),tt++):(s=o,0===ts&&tc(te)),s!==o?i=a=[a,s]:(tt=i,i=c)):(tt=i,i=c);i!==o;)r.push(i),i=tt,a=tt,ts++,e.substr(tt,2)===e9?(s=e9,tt+=2):(s=o,0===ts&&tc(e7)),ts--,s===o?a=F:(tt=a,a=c),a!==o?(e.length>tt?(s=e.charAt(tt),tt++):(s=o,0===ts&&tc(te)),s!==o?i=a=[a,s]:(tt=i,i=c)):(tt=i,i=c);r!==o?(e.substr(tt,2)===e9?(i=e9,tt+=2):(i=o,0===ts&&tc(e7)),i!==o?t=n=[n,r,i]:(tt=t,t=c)):(tt=t,t=c)}else tt=t,t=c}return ts--,t===o&&(n=o,0===ts&&tc(e0)),t}function tY(){var e;return(e=tj())===o&&(e=tF()),e}var tB=n(47755);if((i=u())!==o&&tt===e.length)return i;throw i!==o&&tt":"--",n=new f;e.isMultigraph()||n.write("strict "),n.writeLine((e.isDirected()?"digraph":"graph")+" {"),n.indent();var i=e.graph();return r.isObject(i)&&r.each(i,function(e,t){n.writeLine(l(t)+"="+l(e)+";")}),o(e,void 0,n),e.edges().forEach(function(r){u(e,r,t,n)}),n.unindent(),n.writeLine("}"),n.toString()}function o(e,t,n){var i=e.isCompound()?e.children(t):e.nodes();r.each(i,function(t){e.isCompound()&&e.children(t).length?(n.writeLine("subgraph "+l(t)+" {"),n.indent(),r.isObject(e.node(t))&&r.map(e.node(t),function(e,t){n.writeLine(l(t)+"="+l(e)+";")}),o(e,t,n),n.unindent(),n.writeLine("}")):s(e,t,n)})}function s(e,t,n){n.write(l(t)),c(e.node(t),n),n.writeLine()}function u(e,t,n,r){var i=t.v,a=t.w,o=e.edge(t);r.write(l(i)+" "+n+" "+l(a)),c(o,r),r.writeLine()}function c(e,t){if(r.isObject(e)){var n=r.map(e,function(e,t){return l(t)+"="+l(e)});n.length&&t.write(" ["+n.join(",")+"]")}}function l(e){return"number"==typeof e||e.toString().match(i)?e:'"'+e.toString().replace(/"/g,'\\"')+'"'}function f(){this._indent="",this._content="",this._shouldIndent=!0}f.prototype.INDENT=" ",f.prototype.indent=function(){this._indent+=this.INDENT},f.prototype.unindent=function(){this._indent=this._indent.slice(this.INDENT.length)},f.prototype.writeLine=function(e){this.write((e||"")+"\n"),this._shouldIndent=!0},f.prototype.write=function(e){this._shouldIndent&&(this._shouldIndent=!1,this._content+=this._indent),this._content+=e},f.prototype.toString=function(){return this._content}},28282(e,t,n){var r=n(82354);e.exports={Graph:r.Graph,json:n(28974),alg:n(12440),version:r.version}},2842(e,t,n){var r=n(89126);function i(e){var t,n={},i=[];function a(i){r.has(n,i)||(n[i]=!0,t.push(i),r.each(e.successors(i),a),r.each(e.predecessors(i),a))}return r.each(e.nodes(),function(e){t=[],a(e),t.length&&i.push(t)}),i}e.exports=i},53984(e,t,n){var r=n(89126);function i(e,t,n){r.isArray(t)||(t=[t]);var i=(e.isDirected()?e.successors:e.neighbors).bind(e),o=[],s={};return r.each(t,function(t){if(!e.hasNode(t))throw Error("Graph does not have node: "+t);a(e,t,"post"===n,s,i,o)}),o}function a(e,t,n,i,o,s){!r.has(i,t)&&(i[t]=!0,n||s.push(t),r.each(o(t),function(t){a(e,t,n,i,o,s)}),n&&s.push(t))}e.exports=i},84847(e,t,n){var r=n(63763),i=n(89126);function a(e,t,n){return i.transform(e.nodes(),function(i,a){i[a]=r(e,a,t,n)},{})}e.exports=a},63763(e,t,n){var r=n(89126),i=n(75639);e.exports=o;var a=r.constant(1);function o(e,t,n,r){return s(e,String(t),n||a,r||function(t){return e.outEdges(t)})}function s(e,t,n,r){var a,o,s={},u=new i,c=function(e){var t=e.v!==a?e.v:e.w,r=s[t],i=n(e),c=o.distance+i;if(i<0)throw Error("dijkstra does not allow negative edge weights. Bad edge: "+e+" Weight: "+i);c0&&(o=s[a=u.removeMin()]).distance!==Number.POSITIVE_INFINITY;)r(a).forEach(c);return s}},9096(e,t,n){var r=n(89126),i=n(5023);function a(e){return r.filter(i(e),function(t){return t.length>1||1===t.length&&e.hasEdge(t[0],t[0])})}e.exports=a},38924(e,t,n){var r=n(89126);e.exports=a;var i=r.constant(1);function a(e,t,n){return o(e,t||i,n||function(t){return e.outEdges(t)})}function o(e,t,n){var r={},i=e.nodes();return i.forEach(function(e){r[e]={},r[e][e]={distance:0},i.forEach(function(t){e!==t&&(r[e][t]={distance:Number.POSITIVE_INFINITY})}),n(e).forEach(function(n){var i=n.v===e?n.w:n.v,a=t(n);r[e][i]={distance:a,predecessor:e}})}),i.forEach(function(e){var t=r[e];i.forEach(function(n){var a=r[n];i.forEach(function(n){var r=a[e],i=t[n],o=a[n],s=r.distance+i.distance;s0;){if(n=u.removeMin(),r.has(s,n))o.setEdge(n,s[n]);else if(l)throw Error("Input graph is not connected: "+e);else l=!0;e.nodeEdges(n).forEach(c)}return o}e.exports=o},5023(e,t,n){var r=n(89126);function i(e){var t=0,n=[],i={},a=[];function o(s){var u=i[s]={onStack:!0,lowlink:t,index:t++};if(n.push(s),e.successors(s).forEach(function(e){r.has(i,e)?i[e].onStack&&(u.lowlink=Math.min(u.lowlink,i[e].index)):(o(e),u.lowlink=Math.min(u.lowlink,i[e].lowlink))}),u.lowlink===u.index){var c,l=[];do i[c=n.pop()].onStack=!1,l.push(c);while(s!==c)a.push(l)}}return e.nodes().forEach(function(e){r.has(i,e)||o(e)}),a}e.exports=i},2166(e,t,n){var r=n(89126);function i(e){var t={},n={},i=[];function o(s){if(r.has(n,s))throw new a;r.has(t,s)||(n[s]=!0,t[s]=!0,r.each(e.predecessors(s),o),delete n[s],i.push(s))}if(r.each(e.sinks(),o),r.size(t)!==e.nodeCount())throw new a;return i}function a(){}e.exports=i,i.CycleException=a,a.prototype=Error()},75639(e,t,n){var r=n(89126);function i(){this._arr=[],this._keyIndices={}}e.exports=i,i.prototype.size=function(){return this._arr.length},i.prototype.keys=function(){return this._arr.map(function(e){return e.key})},i.prototype.has=function(e){return r.has(this._keyIndices,e)},i.prototype.priority=function(e){var t=this._keyIndices[e];if(void 0!==t)return this._arr[t].priority},i.prototype.min=function(){if(0===this.size())throw Error("Queue underflow");return this._arr[0].key},i.prototype.add=function(e,t){var n=this._keyIndices;if(e=String(e),!r.has(n,e)){var i=this._arr,a=i.length;return n[e]=a,i.push({key:e,priority:t}),this._decrease(a),!0}return!1},i.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var e=this._arr.pop();return delete this._keyIndices[e.key],this._heapify(0),e.key},i.prototype.decrease=function(e,t){var n=this._keyIndices[e];if(t>this._arr[n].priority)throw Error("New priority is greater than current priority. Key: "+e+" Old: "+this._arr[n].priority+" New: "+t);this._arr[n].priority=t,this._decrease(n)},i.prototype._heapify=function(e){var t=this._arr,n=2*e,r=n+1,i=e;n>1].priorityu){var c=s;s=u,u=c}return s+o+u+o+(r.isUndefined(a)?i:a)}function f(e,t,n,r){var i=""+t,a=""+n;if(!e&&i>a){var o=i;i=a,a=o}var s={v:i,w:a};return r&&(s.name=r),s}function d(e,t){return l(e,t.v,t.w,t.name)}s.prototype._nodeCount=0,s.prototype._edgeCount=0,s.prototype.isDirected=function(){return this._isDirected},s.prototype.isMultigraph=function(){return this._isMultigraph},s.prototype.isCompound=function(){return this._isCompound},s.prototype.setGraph=function(e){return this._label=e,this},s.prototype.graph=function(){return this._label},s.prototype.setDefaultNodeLabel=function(e){return r.isFunction(e)||(e=r.constant(e)),this._defaultNodeLabelFn=e,this},s.prototype.nodeCount=function(){return this._nodeCount},s.prototype.nodes=function(){return r.keys(this._nodes)},s.prototype.sources=function(){var e=this;return r.filter(this.nodes(),function(t){return r.isEmpty(e._in[t])})},s.prototype.sinks=function(){var e=this;return r.filter(this.nodes(),function(t){return r.isEmpty(e._out[t])})},s.prototype.setNodes=function(e,t){var n=arguments,i=this;return r.each(e,function(e){n.length>1?i.setNode(e,t):i.setNode(e)}),this},s.prototype.setNode=function(e,t){return r.has(this._nodes,e)?(arguments.length>1&&(this._nodes[e]=t),this):(this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=a,this._children[e]={},this._children[a][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)},s.prototype.node=function(e){return this._nodes[e]},s.prototype.hasNode=function(e){return r.has(this._nodes,e)},s.prototype.removeNode=function(e){var t=this;if(r.has(this._nodes,e)){var n=function(e){t.removeEdge(t._edgeObjs[e])};delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],r.each(this.children(e),function(e){t.setParent(e)}),delete this._children[e]),r.each(r.keys(this._in[e]),n),delete this._in[e],delete this._preds[e],r.each(r.keys(this._out[e]),n),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this},s.prototype.setParent=function(e,t){if(!this._isCompound)throw Error("Cannot set parent in a non-compound graph");if(r.isUndefined(t))t=a;else{t+="";for(var n=t;!r.isUndefined(n);n=this.parent(n))if(n===e)throw Error("Setting "+t+" as parent of "+e+" would create a cycle");this.setNode(t)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=t,this._children[t][e]=!0,this},s.prototype._removeFromParentsChildList=function(e){delete this._children[this._parent[e]][e]},s.prototype.parent=function(e){if(this._isCompound){var t=this._parent[e];if(t!==a)return t}},s.prototype.children=function(e){if(r.isUndefined(e)&&(e=a),this._isCompound){var t=this._children[e];if(t)return r.keys(t)}else if(e===a)return this.nodes();else if(this.hasNode(e))return[]},s.prototype.predecessors=function(e){var t=this._preds[e];if(t)return r.keys(t)},s.prototype.successors=function(e){var t=this._sucs[e];if(t)return r.keys(t)},s.prototype.neighbors=function(e){var t=this.predecessors(e);if(t)return r.union(t,this.successors(e))},s.prototype.isLeaf=function(e){var t;return 0===(t=this.isDirected()?this.successors(e):this.neighbors(e)).length},s.prototype.filterNodes=function(e){var t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph());var n=this;r.each(this._nodes,function(n,r){e(r)&&t.setNode(r,n)}),r.each(this._edgeObjs,function(e){t.hasNode(e.v)&&t.hasNode(e.w)&&t.setEdge(e,n.edge(e))});var i={};function a(e){var r=n.parent(e);return void 0===r||t.hasNode(r)?(i[e]=r,r):r in i?i[r]:a(r)}return this._isCompound&&r.each(t.nodes(),function(e){t.setParent(e,a(e))}),t},s.prototype.setDefaultEdgeLabel=function(e){return r.isFunction(e)||(e=r.constant(e)),this._defaultEdgeLabelFn=e,this},s.prototype.edgeCount=function(){return this._edgeCount},s.prototype.edges=function(){return r.values(this._edgeObjs)},s.prototype.setPath=function(e,t){var n=this,i=arguments;return r.reduce(e,function(e,r){return i.length>1?n.setEdge(e,r,t):n.setEdge(e,r),r}),this},s.prototype.setEdge=function(){var e,t,n,i,a=!1,o=arguments[0];"object"==typeof o&&null!==o&&"v"in o?(e=o.v,t=o.w,n=o.name,2===arguments.length&&(i=arguments[1],a=!0)):(e=o,t=arguments[1],n=arguments[3],arguments.length>2&&(i=arguments[2],a=!0)),e=""+e,t=""+t,r.isUndefined(n)||(n=""+n);var s=l(this._isDirected,e,t,n);if(r.has(this._edgeLabels,s))return a&&(this._edgeLabels[s]=i),this;if(!r.isUndefined(n)&&!this._isMultigraph)throw Error("Cannot set a named edge when isMultigraph = false");this.setNode(e),this.setNode(t),this._edgeLabels[s]=a?i:this._defaultEdgeLabelFn(e,t,n);var c=f(this._isDirected,e,t,n);return e=c.v,t=c.w,Object.freeze(c),this._edgeObjs[s]=c,u(this._preds[t],e),u(this._sucs[e],t),this._in[t][s]=c,this._out[e][s]=c,this._edgeCount++,this},s.prototype.edge=function(e,t,n){var r=1===arguments.length?d(this._isDirected,arguments[0]):l(this._isDirected,e,t,n);return this._edgeLabels[r]},s.prototype.hasEdge=function(e,t,n){var i=1===arguments.length?d(this._isDirected,arguments[0]):l(this._isDirected,e,t,n);return r.has(this._edgeLabels,i)},s.prototype.removeEdge=function(e,t,n){var r=1===arguments.length?d(this._isDirected,arguments[0]):l(this._isDirected,e,t,n),i=this._edgeObjs[r];return i&&(e=i.v,t=i.w,delete this._edgeLabels[r],delete this._edgeObjs[r],c(this._preds[t],e),c(this._sucs[e],t),delete this._in[t][r],delete this._out[e][r],this._edgeCount--),this},s.prototype.inEdges=function(e,t){var n=this._in[e];if(n){var i=r.values(n);return t?r.filter(i,function(e){return e.v===t}):i}},s.prototype.outEdges=function(e,t){var n=this._out[e];if(n){var i=r.values(n);return t?r.filter(i,function(e){return e.w===t}):i}},s.prototype.nodeEdges=function(e,t){var n=this.inEdges(e,t);if(n)return n.concat(this.outEdges(e,t))}},82354(e,t,n){e.exports={Graph:n(30771),version:n(49631)}},28974(e,t,n){var r=n(89126),i=n(30771);function a(e){var t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:o(e),edges:s(e)};return r.isUndefined(e.graph())||(t.value=r.clone(e.graph())),t}function o(e){return r.map(e.nodes(),function(t){var n=e.node(t),i=e.parent(t),a={v:t};return r.isUndefined(n)||(a.value=n),r.isUndefined(i)||(a.parent=i),a})}function s(e){return r.map(e.edges(),function(t){var n=e.edge(t),i={v:t.v,w:t.w};return r.isUndefined(t.name)||(i.name=t.name),r.isUndefined(n)||(i.value=n),i})}function u(e){var t=new i(e.options).setGraph(e.value);return r.each(e.nodes,function(e){t.setNode(e.v,e.value),e.parent&&t.setParent(e.v,e.parent)}),r.each(e.edges,function(e){t.setEdge({v:e.v,w:e.w,name:e.name},e.value)}),t}e.exports={write:a,read:u}},89126(e,t,n){var r;try{r={clone:n(66678),constant:n(75703),each:n(66073),filter:n(63105),has:n(18721),isArray:n(1469),isEmpty:n(41609),isFunction:n(23560),isUndefined:n(52353),keys:n(3674),map:n(35161),reduce:n(54061),size:n(84238),transform:n(68718),union:n(93386),values:n(52628)}}catch(i){}r||(r=window._),e.exports=r},49631(e){e.exports="2.1.8"},78892(e){"use strict";e.exports=n;var t=/[#.]/g;function n(e,n){for(var r,i,a,o=e||"",s=n||"div",u={},c=0;cC,q_:()=>F,ob:()=>y,PP:()=>B,Ep:()=>v,Hp:()=>w});var r=n(87462);function i(e){return"/"===e.charAt(0)}function a(e,t){for(var n=t,r=n+1,i=e.length;r=0;d--){var h=o[d];"."===h?a(o,d):".."===h?(a(o,d),f++):f&&(a(o,d),f--)}if(!c)for(;f--;f)o.unshift("..");!c||""===o[0]||o[0]&&i(o[0])||o.unshift("");var p=o.join("/");return n&&"/"!==p.substr(-1)&&(p+="/"),p}let s=o;function u(e){return e.valueOf?e.valueOf():Object.prototype.valueOf.call(e)}function c(e,t){if(e===t)return!0;if(null==e||null==t)return!1;if(Array.isArray(e))return Array.isArray(t)&&e.length===t.length&&e.every(function(e,n){return c(e,t[n])});if("object"==typeof e||"object"==typeof t){var n=u(e),r=u(t);return n!==e||r!==t?c(n,r):Object.keys(Object.assign({},e,t)).every(function(n){return c(e[n],t[n])})}return!1}let l=c;var f=n(2177);function d(e){return"/"===e.charAt(0)?e:"/"+e}function h(e){return"/"===e.charAt(0)?e.substr(1):e}function p(e,t){return 0===e.toLowerCase().indexOf(t.toLowerCase())&&-1!=="/?#".indexOf(e.charAt(t.length))}function b(e,t){return p(e,t)?e.substr(t.length):e}function m(e){return"/"===e.charAt(e.length-1)?e.slice(0,-1):e}function g(e){var t=e||"/",n="",r="",i=t.indexOf("#");-1!==i&&(r=t.substr(i),t=t.substr(0,i));var a=t.indexOf("?");return -1!==a&&(n=t.substr(a),t=t.substr(0,a)),{pathname:t,search:"?"===n?"":n,hash:"#"===r?"":r}}function v(e){var t=e.pathname,n=e.search,r=e.hash,i=t||"/";return n&&"?"!==n&&(i+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(i+="#"===r.charAt(0)?r:"#"+r),i}function y(e,t,n,i){var a;"string"==typeof e?(a=g(e)).state=t:(void 0===(a=(0,r.Z)({},e)).pathname&&(a.pathname=""),a.search?"?"!==a.search.charAt(0)&&(a.search="?"+a.search):a.search="",a.hash?"#"!==a.hash.charAt(0)&&(a.hash="#"+a.hash):a.hash="",void 0!==t&&void 0===a.state&&(a.state=t));try{a.pathname=decodeURI(a.pathname)}catch(o){if(o instanceof URIError)throw URIError('Pathname "'+a.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.');throw o}return n&&(a.key=n),i?a.pathname?"/"!==a.pathname.charAt(0)&&(a.pathname=s(a.pathname,i.pathname)):a.pathname=i.pathname:a.pathname||(a.pathname="/"),a}function w(e,t){return e.pathname===t.pathname&&e.search===t.search&&e.hash===t.hash&&e.key===t.key&&l(e.state,t.state)}function _(){var e=null;function t(t){return e=t,function(){e===t&&(e=null)}}function n(t,n,r,i){if(null!=e){var a="function"==typeof e?e(t,n):e;"string"==typeof a?"function"==typeof r?r(a,i):i(!0):i(!1!==a)}else i(!0)}var r=[];function i(e){var t=!0;function n(){t&&e.apply(void 0,arguments)}return r.push(n),function(){t=!1,r=r.filter(function(e){return e!==n})}}function a(){for(var e=arguments.length,t=Array(e),n=0;nn?a.splice(n,a.length-n,i):a.push(i),f({action:r,location:i,index:n,entries:a})}})}function g(e,t){var r="REPLACE",i=y(e,t,d(),M.location);l.confirmTransitionTo(i,r,n,function(e){e&&(M.entries[M.index]=i,f({action:r,location:i}))})}function w(e){var t=Y(M.index+e,0,M.entries.length-1),r="POP",i=M.entries[t];l.confirmTransitionTo(i,r,n,function(e){e?f({action:r,location:i,index:t}):f()})}function E(){w(-1)}function S(){w(1)}function k(e){var t=M.index+e;return t>=0&&tu});var r=/[A-Z]/g,i=/^ms-/,a={};function o(e){return"-"+e.toLowerCase()}function s(e){if(a.hasOwnProperty(e))return a[e];var t=e.replace(r,o);return a[e]=i.test(t)?"-"+t:t}let u=s},80645(e,t){/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ t.read=function(e,t,n,r,i){var a,o,s=8*i-r-1,u=(1<>1,l=-7,f=n?i-1:0,d=n?-1:1,h=e[t+f];for(f+=d,a=h&(1<<-l)-1,h>>=-l,l+=s;l>0;a=256*a+e[t+f],f+=d,l-=8);for(o=a&(1<<-l)-1,a>>=-l,l+=r;l>0;o=256*o+e[t+f],f+=d,l-=8);if(0===a)a=1-c;else{if(a===u)return o?NaN:(h?-1:1)*(1/0);o+=Math.pow(2,r),a-=c}return(h?-1:1)*o*Math.pow(2,a-r)},t.write=function(e,t,n,r,i,a){var o,s,u,c=8*a-i-1,l=(1<>1,d=23===i?5960464477539062e-23:0,h=r?0:a-1,p=r?1:-1,b=t<0||0===t&&1/t<0?1:0;for(isNaN(t=Math.abs(t))||t===1/0?(s=isNaN(t)?1:0,o=l):(o=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-o))<1&&(o--,u*=2),o+f>=1?t+=d/u:t+=d*Math.pow(2,1-f),t*u>=2&&(o++,u/=2),o+f>=l?(s=0,o=l):o+f>=1?(s=(t*u-1)*Math.pow(2,i),o+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,i),o=0));i>=8;e[n+h]=255&s,h+=p,s/=256,i-=8);for(o=o<0;e[n+h]=255&o,h+=p,o/=256,c-=8);e[n+h-p]|=128*b}},35717(e){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}},46260(e){"use strict";function t(e){var t="string"==typeof e?e.charCodeAt(0):e;return t>=97&&t<=122||t>=65&&t<=90}e.exports=t},7961(e,t,n){"use strict";var r=n(46260),i=n(46195);function a(e){return r(e)||i(e)}e.exports=a},46195(e){"use strict";function t(e){var t="string"==typeof e?e.charCodeAt(0):e;return t>=48&&t<=57}e.exports=t},79480(e){"use strict";function t(e){var t="string"==typeof e?e.charCodeAt(0):e;return t>=97&&t<=102||t>=65&&t<=70||t>=48&&t<=57}e.exports=t},33827(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>a,isBrowser:()=>i});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=("undefined"==typeof window?"undefined":r(window))==="object"&&("undefined"==typeof document?"undefined":r(document))==="object"&&9===document.nodeType;let a=i},5826(e){e.exports=Array.isArray||function(e){return"[object Array]"==Object.prototype.toString.call(e)}},47798(e){"use strict";/*! + * isobject + * + * Copyright (c) 2014-2017, Jon Schlinkert. + * Released under the MIT License. + */ e.exports=function(e){return null!=e&&"object"==typeof e&&!1===Array.isArray(e)}},80204(e,t,n){e.exports=self.fetch||(self.fetch=n(25869).default||n(25869))},5690(e,t,n){e.exports=n(67946)},8126(e,t,n){"use strict";n.d(t,{Z:()=>tl});var r,i="en",a={},o={};function s(){return i}function u(e){i=e}function c(e){return a[e]}function l(e){if(!e)throw Error("No locale data passed");a[e.locale]=e,o[e.locale.toLowerCase()]=e.locale}function f(e){return a[e]?e:o[e.toLowerCase()]?o[e.toLowerCase()]:void 0}function d(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.localeMatcher||"lookup";switch(n){case"lookup":case"best fit":return h(e);default:throw RangeError('Invalid "localeMatcher" option: '.concat(n))}}function h(e){var t=f(e);if(t)return t;for(var n=e.split("-");e.length>1;){n.pop();var r=f(e=n.join("-"));if(r)return r}}var p={af:function(e){return 1==e?"one":"other"},am:function(e){return e>=0&&e<=1?"one":"other"},ar:function(e){var t=String(e).split("."),n=Number(t[0])==e&&t[0].slice(-2);return 0==e?"zero":1==e?"one":2==e?"two":n>=3&&n<=10?"few":n>=11&&n<=99?"many":"other"},ast:function(e){var t=!String(e).split(".")[1];return 1==e&&t?"one":"other"},be:function(e){var t=String(e).split("."),n=Number(t[0])==e,r=n&&t[0].slice(-1),i=n&&t[0].slice(-2);return 1==r&&11!=i?"one":r>=2&&r<=4&&(i<12||i>14)?"few":n&&0==r||r>=5&&r<=9||i>=11&&i<=14?"many":"other"},br:function(e){var t=String(e).split("."),n=Number(t[0])==e,r=n&&t[0].slice(-1),i=n&&t[0].slice(-2),a=n&&t[0].slice(-6);return 1==r&&11!=i&&71!=i&&91!=i?"one":2==r&&12!=i&&72!=i&&92!=i?"two":(3==r||4==r||9==r)&&(i<10||i>19)&&(i<70||i>79)&&(i<90||i>99)?"few":0!=e&&n&&0==a?"many":"other"},bs:function(e){var t=String(e).split("."),n=t[0],r=t[1]||"",i=!t[1],a=n.slice(-1),o=n.slice(-2),s=r.slice(-1),u=r.slice(-2);return i&&1==a&&11!=o||1==s&&11!=u?"one":i&&a>=2&&a<=4&&(o<12||o>14)||s>=2&&s<=4&&(u<12||u>14)?"few":"other"},cs:function(e){var t=String(e).split("."),n=t[0],r=!t[1];return 1==e&&r?"one":n>=2&&n<=4&&r?"few":r?"other":"many"},cy:function(e){return 0==e?"zero":1==e?"one":2==e?"two":3==e?"few":6==e?"many":"other"},da:function(e){var t=String(e).split("."),n=t[0],r=Number(t[0])==e;return 1!=e&&(r||0!=n&&1!=n)?"other":"one"},dsb:function(e){var t=String(e).split("."),n=t[0],r=t[1]||"",i=!t[1],a=n.slice(-2),o=r.slice(-2);return i&&1==a||1==o?"one":i&&2==a||2==o?"two":i&&(3==a||4==a)||3==o||4==o?"few":"other"},dz:function(e){return"other"},fil:function(e){var t=String(e).split("."),n=t[0],r=t[1]||"",i=!t[1],a=n.slice(-1),o=r.slice(-1);return i&&(1==n||2==n||3==n)||i&&4!=a&&6!=a&&9!=a||!i&&4!=o&&6!=o&&9!=o?"one":"other"},fr:function(e){return e>=0&&e<2?"one":"other"},ga:function(e){var t=Number(String(e).split(".")[0])==e;return 1==e?"one":2==e?"two":t&&e>=3&&e<=6?"few":t&&e>=7&&e<=10?"many":"other"},gd:function(e){var t=Number(String(e).split(".")[0])==e;return 1==e||11==e?"one":2==e||12==e?"two":t&&e>=3&&e<=10||t&&e>=13&&e<=19?"few":"other"},he:function(e){var t=String(e).split("."),n=t[0],r=!t[1],i=Number(t[0])==e,a=i&&t[0].slice(-1);return 1==e&&r?"one":2==n&&r?"two":r&&(e<0||e>10)&&i&&0==a?"many":"other"},is:function(e){var t=String(e).split("."),n=t[0],r=Number(t[0])==e,i=n.slice(-1),a=n.slice(-2);return r&&1==i&&11!=a||!r?"one":"other"},ksh:function(e){return 0==e?"zero":1==e?"one":"other"},lt:function(e){var t=String(e).split("."),n=t[1]||"",r=Number(t[0])==e,i=r&&t[0].slice(-1),a=r&&t[0].slice(-2);return 1==i&&(a<11||a>19)?"one":i>=2&&i<=9&&(a<11||a>19)?"few":0!=n?"many":"other"},lv:function(e){var t=String(e).split("."),n=t[1]||"",r=n.length,i=Number(t[0])==e,a=i&&t[0].slice(-1),o=i&&t[0].slice(-2),s=n.slice(-2),u=n.slice(-1);return i&&0==a||o>=11&&o<=19||2==r&&s>=11&&s<=19?"zero":1==a&&11!=o||2==r&&1==u&&11!=s||2!=r&&1==u?"one":"other"},mk:function(e){var t=String(e).split("."),n=t[0],r=t[1]||"",i=!t[1],a=n.slice(-1),o=n.slice(-2),s=r.slice(-1),u=r.slice(-2);return i&&1==a&&11!=o||1==s&&11!=u?"one":"other"},mt:function(e){var t=String(e).split("."),n=Number(t[0])==e&&t[0].slice(-2);return 1==e?"one":0==e||n>=2&&n<=10?"few":n>=11&&n<=19?"many":"other"},pa:function(e){return 0==e||1==e?"one":"other"},pl:function(e){var t=String(e).split("."),n=t[0],r=!t[1],i=n.slice(-1),a=n.slice(-2);return 1==e&&r?"one":r&&i>=2&&i<=4&&(a<12||a>14)?"few":r&&1!=n&&(0==i||1==i)||r&&i>=5&&i<=9||r&&a>=12&&a<=14?"many":"other"},pt:function(e){var t=String(e).split(".")[0];return 0==t||1==t?"one":"other"},ro:function(e){var t=String(e).split("."),n=!t[1],r=Number(t[0])==e&&t[0].slice(-2);return 1==e&&n?"one":!n||0==e||1!=e&&r>=1&&r<=19?"few":"other"},ru:function(e){var t=String(e).split("."),n=t[0],r=!t[1],i=n.slice(-1),a=n.slice(-2);return r&&1==i&&11!=a?"one":r&&i>=2&&i<=4&&(a<12||a>14)?"few":r&&0==i||r&&i>=5&&i<=9||r&&a>=11&&a<=14?"many":"other"},se:function(e){return 1==e?"one":2==e?"two":"other"},si:function(e){var t=String(e).split("."),n=t[0],r=t[1]||"";return 0==e||1==e||0==n&&1==r?"one":"other"},sl:function(e){var t=String(e).split("."),n=t[0],r=!t[1],i=n.slice(-2);return r&&1==i?"one":r&&2==i?"two":r&&(3==i||4==i)||!r?"few":"other"}};p.as=p.am,p.az=p.af,p.bg=p.af,p.bn=p.am,p.ca=p.ast,p.ce=p.af,p.chr=p.af,p.de=p.ast,p.ee=p.af,p.el=p.af,p.en=p.ast,p.es=p.af,p.et=p.ast,p.eu=p.af,p.fa=p.am,p.fi=p.ast,p.fo=p.af,p.fur=p.af,p.fy=p.ast,p.gl=p.ast,p.gu=p.am,p.hi=p.am,p.hr=p.bs,p.hsb=p.dsb,p.hu=p.af,p.hy=p.fr,p.ia=p.ast,p.id=p.dz,p.it=p.ast,p.ja=p.dz,p.jgo=p.af,p.jv=p.dz,p.ka=p.af,p.kea=p.dz,p.kk=p.af,p.kl=p.af,p.km=p.dz,p.kn=p.am,p.ko=p.dz,p.ku=p.af,p.ky=p.af,p.lb=p.af,p.lkt=p.dz,p.lo=p.dz,p.ml=p.af,p.mn=p.af,p.mr=p.am,p.ms=p.dz,p.my=p.dz,p.nb=p.af,p.ne=p.af,p.nl=p.ast,p.nn=p.af,p.or=p.af,p.ps=p.af,p["pt-PT"]=p.ast,p.sah=p.dz,p.sd=p.af,p.sk=p.cs,p.so=p.af,p.sq=p.af,p.sr=p.bs,p.sv=p.ast,p.sw=p.ast,p.ta=p.af,p.te=p.af,p.th=p.dz,p.ti=p.pa,p.tk=p.af,p.to=p.dz,p.tr=p.af,p.ug=p.af,p.uk=p.ru,p.ur=p.ast,p.uz=p.af,p.vi=p.dz,p.wae=p.af,p.yi=p.ast,p.yue=p.dz,p.zh=p.dz,p.zu=p.am;let b=p;function m(e){return"pt-PT"===e?e:v(e)}var g=/^([a-z0-9]+)/i;function v(e){var t=e.match(g);if(!t)throw TypeError("Invalid locale: ".concat(e));return t[1]}function y(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function w(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};A(this,e),I(this,"numeric","always"),I(this,"style","long"),I(this,"localeMatcher","lookup");var r=n.numeric,i=n.style,a=n.localeMatcher;if(void 0!==r){if(0>N.indexOf(r))throw RangeError('Invalid "numeric" option: '.concat(r));this.numeric=r}if(void 0!==i){if(0>P.indexOf(i))throw RangeError('Invalid "style" option: '.concat(i));this.style=i}if(void 0!==a){if(0>R.indexOf(a))throw RangeError('Invalid "localeMatcher" option: '.concat(a));this.localeMatcher=a}if("string"==typeof t&&(t=[t]),t.push(s()),this.locale=e.supportedLocalesOf(t,{localeMatcher:this.localeMatcher})[0],!this.locale)throw Error("No supported locale was found");E.supportedLocalesOf(this.locale).length>0?this.pluralRules=new E(this.locale):console.warn('"'.concat(this.locale,'" locale is not supported')),"undefined"!=typeof Intl&&Intl.NumberFormat?(this.numberFormat=new Intl.NumberFormat(this.locale),this.numberingSystem=this.numberFormat.resolvedOptions().numberingSystem):this.numberingSystem="latn",this.locale=d(this.locale,{localeMatcher:this.localeMatcher})}return C(e,[{key:"format",value:function(){var e=z(arguments),t=x(e,2),n=t[0],r=t[1];return this.getRule(n,r).replace("{0}",this.formatNumber(Math.abs(n)))}},{key:"formatToParts",value:function(){var e=z(arguments),t=x(e,2),n=t[0],r=t[1],i=this.getRule(n,r),a=i.indexOf("{0}");if(a<0)return[{type:"literal",value:i}];var o=[];return a>0&&o.push({type:"literal",value:i.slice(0,a)}),o=o.concat(this.formatNumberToParts(Math.abs(n)).map(function(e){return k({},e,{unit:r})})),a+31&&void 0!==arguments[1]?arguments[1]:{};if("string"==typeof e)e=[e];else if(!Array.isArray(e))throw TypeError('Invalid "locales" argument');return e.filter(function(e){return d(e,t)})},j.addLocale=l,j.setDefaultLocale=u,j.getDefaultLocale=s,j.PluralRules=E;var F='Invalid "unit" argument';function Y(e){if("symbol"===S(e))throw TypeError(F);if("string"!=typeof e||("s"===e[e.length-1]&&(e=e.slice(0,e.length-1)),0>D.indexOf(e)))throw RangeError("".concat(F,": ").concat(e));return e}var B='Invalid "number" argument';function U(e){if(e=Number(e),Number.isFinite&&!Number.isFinite(e))throw RangeError("".concat(B,": ").concat(e));return e}function H(e){return 1/e==-1/0}function $(e){return e<0||0===e&&H(e)}function z(e){if(e.length<2)throw TypeError('"unit" argument is required');return[U(e[0]),Y(e[1])]}function G(e){return(G="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function W(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function K(e,t){for(var n=0;n=n.length)break;a=n[i++]}else{if((i=n.next()).done)break;a=i.value}var a,o=a;if(t(o))return o;for(var s=o.split("-");s.length>1;)if(s.pop(),t(o=s.join("-")))return o}throw Error("No locale data has been registered for any of the locales: ".concat(e.join(", ")))}function Q(){return("undefined"==typeof Intl?"undefined":X(Intl))==="object"&&"function"==typeof Intl.DateTimeFormat}var ee=60,et=60*ee,en=24*et,er=7*en,ei=30.44*en,ea=365.2425*en;function eo(e){switch(e){case"second":return 1;case"minute":return ee;case"hour":return et;case"day":return en;case"week":return er;case"month":return ei;case"year":return ea}}function es(e){return void 0!==e.factor?e.factor:eo(e.unit||e.formatAs)||1}function eu(e){return"floor"===e?Math.floor:(0,Math.round)}function ec(e){return"floor"===e?1:.5}function el(e){return(el="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ef(e,t){var n,r=t.prevStep,i=t.timestamp,a=t.now,o=t.future,s=t.round;return r&&(r.id||r.unit)&&(n=e["threshold_for_".concat(r.id||r.unit)]),void 0===n&&void 0!==e.threshold&&"function"==typeof(n=e.threshold)&&(n=n(a,o)),void 0===n&&(n=e.minTime),"object"===el(n)&&(n=r&&r.id&&void 0!==n[r.id]?n[r.id]:n.default),"function"==typeof n&&(n=n(i,{future:o,getMinTimeForUnit:function(e,t){return ed(e,t||r&&r.formatAs,{round:s})}})),void 0===n&&e.test&&(n=e.test(i,{now:a,future:o})?0:9007199254740991),void 0===n&&(r?e.formatAs&&r.formatAs&&(n=ed(e.formatAs,r.formatAs,{round:s})):n=0),void 0===n&&console.warn("[javascript-time-ago] A step should specify `minTime`:\n"+JSON.stringify(e,null,2)),n}function ed(e,t,n){var r,i=n.round,a=eo(e);if(r="now"===t?eo(e):eo(t),void 0!==a&&void 0!==r)return a-r*(1-ec(i))}function eh(e){for(var t=1;t0?e[o-1]:s}}}function eg(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=ef(e[r],eh({prevStep:e[r-1],timestamp:n.now-1e3*t},n));return void 0===i||Math.abs(t)=0})}function ey(e,t,n){var r=n.now,i=n.round;if(eo(e)){var a=1e3*eo(e),o=t>r,s=Math.abs(t-r),u=eu(i)(s/a)*a;return o?u>0?s-u+e_(i,a):s-u+1:-(s-u)+ew(i,a)}}function ew(e,t){return ec(e)*t}function e_(e,t){return(1-ec(e))*t+1}var eE=31536e9;function eS(e,t,n){var r,i=n.prevStep,a=n.nextStep,o=n.now,s=n.future,u=n.round,c=e.getTime?e.getTime():e,l=function(e){return ey(e,c,{now:o,round:u})},f=ex(s?t:a,c,{future:s,now:o,round:u,prevStep:s?i:t});if(void 0!==f){if(t&&(t.getTimeToNextUpdate&&(r=t.getTimeToNextUpdate(c,{getTimeToNextUpdateForUnit:l,getRoundFunction:eu,now:o,future:s,round:u})),void 0===r)){var d=t.unit||t.formatAs;d&&(r=l(d))}return void 0===r?f:Math.min(r,f)}}function ek(e,t,n){var r,i=n.now,a=n.future,o=ef(e,{timestamp:t,now:i,future:a,round:n.round,prevStep:n.prevStep});return void 0===o?void 0:a?t-1e3*o+1:0===o&&t===i?eE:t+1e3*o}function ex(e,t,n){var r=n.now,i=n.future,a=n.round,o=n.prevStep;if(e){var s=ek(e,t,{now:r,future:i,round:a,prevStep:o});if(void 0===s)return;return s-r}return i?t-r+1:eE}var eT={};function eM(e){return eT[e]}function eO(e){if(!e)throw Error("[javascript-time-ago] No locale data passed.");eT[e.locale]=e}let eA=[{formatAs:"now"},{formatAs:"second"},{formatAs:"minute"},{formatAs:"hour"},{formatAs:"day"},{formatAs:"week"},{formatAs:"month"},{formatAs:"year"}],eL={steps:eA,labels:"long"};function eC(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.polyfill;ts(this,e),"string"==typeof t&&(t=[t]),this.locale=J(t.concat(e.getDefaultLocale()),eM),"undefined"!=typeof Intl&&Intl.NumberFormat&&(this.numberFormat=new Intl.NumberFormat(this.locale)),!1===r?(this.IntlRelativeTimeFormat=Intl.RelativeTimeFormat,this.IntlPluralRules=Intl.PluralRules):(this.IntlRelativeTimeFormat=j,this.IntlPluralRules=j.PluralRules),this.relativeTimeFormatCache=new Z,this.pluralRulesCache=new Z}return tc(e,[{key:"format",value:function(e,t,n){n||(t&&!tv(t)?(n=t,t=void 0):n={}),t||(t=eD),"string"==typeof t&&(t=tt(t));var r,i=td(e),a=this.getLabels(t.flavour||t.labels),o=a.labels,s=a.labelsType;void 0!==t.now&&(r=t.now),void 0===r&&void 0!==n.now&&(r=n.now),void 0===r&&(r=Date.now());var u=(r-i)/1e3,c=n.future||u<0,l=tb(o,eM(this.locale).now,eM(this.locale).long,c);if(t.custom){var f=t.custom({now:r,date:new Date(i),time:i,elapsed:u,locale:this.locale});if(void 0!==f)return f}var d=tp(t.units,o,l),h=n.round||t.round,p=eb(t.gradation||t.steps||eD.steps,u,{now:r,units:d,round:h,future:c,getNextStep:!0}),b=tr(p,3),m=b[0],g=b[1],v=b[2],y=this.formatDateForStep(i,g,u,{labels:o,labelsType:s,nowLabel:l,now:r,future:c,round:h})||"";if(n.getTimeToNextUpdate){var w=eS(i,g,{nextStep:v,prevStep:m,now:r,future:c,round:h});return[y,w]}return y}},{key:"formatDateForStep",value:function(e,t,n,r){var i=this,a=r.labels,o=r.labelsType,s=r.nowLabel,u=r.now,c=r.future,l=r.round;if(t){if(t.format)return t.format(e,this.locale,{formatAs:function(e,t){return i.formatValue(t,e,{labels:a,future:c})},now:u,future:c});var f=t.unit||t.formatAs;if(!f)throw Error("[javascript-time-ago] Each step must define either `formatAs` or `format()`. Step: ".concat(JSON.stringify(t)));if("now"===f)return s;var d=Math.abs(n)/es(t);t.granularity&&(d=eu(l)(d/t.granularity)*t.granularity);var h=-1*Math.sign(n)*eu(l)(d);switch(0===h&&(h=0),o){case"long":case"short":case"narrow":return this.getFormatter(o).format(h,f);default:return this.formatValue(h,f,{labels:a,future:c})}}}},{key:"formatValue",value:function(e,t,n){var r=n.labels,i=n.future;return this.getFormattingRule(r,t,e,{future:i}).replace("{0}",this.formatNumber(Math.abs(e)))}},{key:"getFormattingRule",value:function(e,t,n,r){var i=r.future;if(this.locale,"string"==typeof(e=e[t]))return e;var a=e[0===n?i?"future":"past":n<0?"past":"future"]||e;return"string"==typeof a?a:a[this.getPluralRules().select(Math.abs(n))]||a.other}},{key:"formatNumber",value:function(e){return this.numberFormat?this.numberFormat.format(e):String(e)}},{key:"getFormatter",value:function(e){return this.relativeTimeFormatCache.get(this.locale,e)||this.relativeTimeFormatCache.put(this.locale,e,new this.IntlRelativeTimeFormat(this.locale,{style:e}))}},{key:"getPluralRules",value:function(){return this.pluralRulesCache.get(this.locale)||this.pluralRulesCache.put(this.locale,new this.IntlPluralRules(this.locale))}},{key:"getLabels",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];"string"==typeof e&&(e=[e]),e=(e=e.map(function(e){switch(e){case"tiny":case"mini-time":return"mini";default:return e}})).concat("long");for(var t=eM(this.locale),n=e,r=Array.isArray(n),i=0,n=r?n:n[Symbol.iterator]();;){if(r){if(i>=n.length)break;a=n[i++]}else{if((i=n.next()).done)break;a=i.value}var a,o=a;if(t[o])return{labelsType:o,labels:t[o]}}}}]),e}(),tf="en";function td(e){if(e.constructor===Date||th(e))return e.getTime();if("number"==typeof e)return e;throw Error("Unsupported relative time formatter input: ".concat(tn(e),", ").concat(e))}function th(e){return"object"===tn(e)&&"function"==typeof e.getTime}function tp(e,t,n){var r=Object.keys(t);return n&&r.push("now"),e&&(r=e.filter(function(e){return"now"===e||r.indexOf(e)>=0})),r}function tb(e,t,n,r){var i=e.now||t&&t.now;return i?"string"==typeof i?i:r?i.future:i.past:n&&n.second&&n.second.current?n.second.current:void 0}tl.getDefaultLocale=function(){return tf},tl.setDefaultLocale=function(e){return tf=e},tl.addDefaultLocale=function(e){if(r)throw Error("[javascript-time-ago] `TimeAgo.addDefaultLocale()` can only be called once. To add other locales, use `TimeAgo.addLocale()`.");r=!0,tl.setDefaultLocale(e.locale),tl.addLocale(e)},tl.addLocale=function(e){eO(e),j.addLocale(e)},tl.locale=tl.addLocale,tl.addLabels=function(e,t,n){var r=eM(e);r||(eO({locale:e}),r=eM(e)),r[t]=n};var tm={}.constructor;function tg(e){return void 0!==tn(e)&&null!==e&&e.constructor===tm}function tv(e){return"string"==typeof e||ty(e)}function ty(e){return tg(e)&&(Array.isArray(e.steps)||Array.isArray(e.gradation)||Array.isArray(e.flavour)||"string"==typeof e.flavour||Array.isArray(e.labels)||"string"==typeof e.labels||Array.isArray(e.units)||"function"==typeof e.custom)}},41800(e,t,n){e.exports=function(){"use strict";var e={121:function(e,t,r){r.r(t),r.d(t,{default:function(){return E}}),n(41539),n(21249),n(54747),n(15306),n(74916),n(47042),n(82526),n(41817),n(32165),n(78783),n(66992),n(33948),n(81486);var i=n(68929),a=r.n(i),o=n(1469),s=r.n(o),u=n(45220),c=r.n(u),l=n(3674),f=r.n(l),d=n(82492),h=r.n(d);function p(e){return(p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function b(e){return s()(e)?e:[e]}function m(e){if(null===e||"object"!==p(e)||(t=e,"[object Date]"===Object.prototype.toString.call(t)))return e;if(s()(e))return e.map(m);var t,n={};return f()(e).forEach(function(t){n[a()(t)]=m(e[t])}),n}function g(e,t){var n=t.camelizeKeys,r=t.camelizeTypeValues,i={};return f()(e).forEach(function(t){var o=e[t],u=n?a()(t):t;i[u]={},void 0!==o.data&&(s()(o.data)?i[u].data=o.data.map(function(e){return{id:e.id,type:r?a()(e.type):e.type}}):c()(o.data)?i[u].data=o.data:i[u].data={id:o.data.id,type:r?a()(o.data.type):o.data.type}),o.links&&(i[u].links=n?m(o.links):o.links),o.meta&&(i[u].meta=n?m(o.meta):o.meta)}),i}function v(e,t){if(t.camelizeKeys){var n={};return f()(e).forEach(function(t){n[a()(t)]=m(e[t])}),n}return e}function y(e,t){var n=t.camelizeKeys,r=t.camelizeTypeValues,i={};return b(e).forEach(function(e){var t=n?a()(e.type):e.type;i[t]=i[t]||{},i[t][e.id]=i[t][e.id]||{id:e.id},i[t][e.id].type=r?a()(e.type):e.type,n?(i[t][e.id].attributes={},f()(e.attributes).forEach(function(n){i[t][e.id].attributes[a()(n)]=m(e.attributes[n])})):i[t][e.id].attributes=e.attributes,e.links&&(i[t][e.id].links={},f()(e.links).forEach(function(r){var o=n?a()(r):r;i[t][e.id].links[o]=e.links[r]})),e.relationships&&(i[t][e.id].relationships=g(e.relationships,{camelizeKeys:n,camelizeTypeValues:r})),e.meta&&(i[t][e.id].meta=v(e.meta,{camelizeKeys:n}))}),i}function w(e){return e.replace(/\?.*$/,"")}function _(e,t,n){var r,i=n.camelizeKeys,o=n.camelizeTypeValues,s={meta:{}};if(n.filterEndpoint)s.meta[t]={},r=s.meta[t];else{var u=w(t);s.meta[u]={},s.meta[u][t.slice(u.length)]={},r=s.meta[u][t.slice(u.length)]}if(r.data={},e.data){var c=[];b(e.data).forEach(function(e){var t={id:e.id,type:o?a()(e.type):e.type};e.relationships&&(t.relationships=g(e.relationships,{camelizeKeys:i,camelizeTypeValues:o})),c.push(t)}),r.data=c}return e.links&&(r.links=e.links,s.meta[w(t)].links=e.links),e.meta&&(r.meta=v(e.meta,{camelizeKeys:i})),s}function E(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.filterEndpoint,r=void 0===n||n,i=t.camelizeKeys,a=void 0===i||i,o=t.camelizeTypeValues,s=void 0===o||o,u=t.endpoint,c={};if(e.data&&h()(c,y(e.data,{camelizeKeys:a,camelizeTypeValues:s})),e.included&&h()(c,y(e.included,{camelizeKeys:a,camelizeTypeValues:s})),u){var l=r?w(u):u;h()(c,_(e,l,{camelizeKeys:a,camelizeTypeValues:s,filterEndpoint:r}))}return c}}},t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={exports:{}};return e[n](i,i.exports,r),i.exports}return r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r(121)}()},63731:function(e){var t,n;t="undefined"!=typeof self?self:this,n=function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t||4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,(function(t){return e[t]}).bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),i=/["'&<>]/,a=function(e){var t=i.exec(e);if(null!==t){var n,r="",a=void 0,o=0;for(a=t.index;a")},e.prototype.space=function(){this.buffer.push(" ")},e.prototype.indent=function(e){if(e>0){for(var t="",n=0;n'+a(e)+""),this.buffer.push('"')},e.prototype.printString=function(e){this.buffer.push('"'),this.buffer.push(''+a(e)+""),this.buffer.push('"')},e.prototype.printBoolean=function(e){this.buffer.push(''+e+"")},e.prototype.printNumber=function(e){this.buffer.push(''+e+"")},e.prototype.printSelectionStart=function(){this.buffer.push("
"),this.buffer.push('
')},e.prototype.printSelectionEnd=function(){this.buffer.push("
"),this.buffer.push('
')},Object.defineProperty(e.prototype,"printSelectionEndAtNewLine",{set:function(e){this._printSelectionEndAtNewLine=e},enumerable:!0,configurable:!0}),e.prototype.toString=function(){return this.buffer.join("")},e}(),s=function(e,t,n,r,i){t.checkCircular(e),t.print("{"),t.newLine();for(var a=Object.keys(e),o=0;o'):a.print('
'),Array.isArray(e)?u(e,a,0,t,i):s(e,a,0,t,i),a.print("
"),a.toString()}return""}},function(e,t,n){"use strict";n.r(t),n.d(t,"__extends",function(){return i}),n.d(t,"__assign",function(){return a}),n.d(t,"__rest",function(){return o}),n.d(t,"__decorate",function(){return s}),n.d(t,"__param",function(){return u}),n.d(t,"__metadata",function(){return c}),n.d(t,"__awaiter",function(){return l}),n.d(t,"__generator",function(){return f}),n.d(t,"__exportStar",function(){return d}),n.d(t,"__values",function(){return h}),n.d(t,"__read",function(){return p}),n.d(t,"__spread",function(){return b}),n.d(t,"__await",function(){return m}),n.d(t,"__asyncGenerator",function(){return g}),n.d(t,"__asyncDelegator",function(){return v}),n.d(t,"__asyncValues",function(){return y}),n.d(t,"__makeTemplateObject",function(){return w}),n.d(t,"__importStar",function(){return _}),n.d(t,"__importDefault",function(){return E});/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. All rights reserved. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the +License at http://www.apache.org/licenses/LICENSE-2.0 + +THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +MERCHANTABLITY OR NON-INFRINGEMENT. + +See the Apache Version 2.0 License for specific language governing permissions +and limitations under the License. +***************************************************************************** */ var r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};function i(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var a=Object.assign||function(e){for(var t,n=1,r=arguments.length;nt.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);it.indexOf(r[i])&&(n[r[i]]=e[r[i]])}return n}function s(e,t,n,r){var i,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o}function u(e,t){return function(n,r){t(n,r,e)}}function c(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function l(e,t,n,r){return new(n||(n=Promise))(function(i,a){function o(e){try{u(r.next(e))}catch(t){a(t)}}function s(e){try{u(r.throw(e))}catch(t){a(t)}}function u(e){e.done?i(e.value):new n(function(t){t(e.value)}).then(o,s)}u((r=r.apply(e,t||[])).next())})}function f(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(n)throw TypeError("Generator is already executing.");for(;o;)try{if(n=1,r&&(i=r[2&a[0]?"return":a[0]?"throw":"next"])&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[0,i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,r=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(i=(i=o.trys).length>0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}function p(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,a=n.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o}function b(){for(var e=[],t=0;t1||s(e,t)})})}function s(e,t){try{var n;(n=i[e](t)).value instanceof m?Promise.resolve(n.value.v).then(u,c):l(a[0][2],n)}catch(r){l(a[0][3],r)}}function u(e){s("next",e)}function c(e){s("throw",e)}function l(e,t){e(t),a.shift(),a.length&&s(a[0][0],a[0][1])}}function v(e){var t,n;return t={},r("next"),r("throw",function(e){throw e}),r("return"),t[Symbol.iterator]=function(){return this},t;function r(r,i){e[r]&&(t[r]=function(t){return(n=!n)?{value:m(e[r](t)),done:"return"===r}:i?i(t):t})}}function y(e){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator];return t?t.call(e):h(e)}function w(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function _(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function E(e){return e&&e.__esModule?e:{default:e}}}])},e.exports=n()},35828(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;var r=n(25477),i=a(r);function a(e){return e&&e.__esModule?e:{default:e}}function o(e){var t={};for(var n in e)t[(0,i.default)(n)]=e[n];return e.fallbacks&&(Array.isArray(e.fallbacks)?t.fallbacks=e.fallbacks.map(o):t.fallbacks=o(e.fallbacks)),t}function s(){function e(e){if(Array.isArray(e)){for(var t=0;t0&&void 0!==arguments[0]?arguments[0]:{},t=s(e);function n(e,n){if("style"!==n.type)return e;for(var r in e)e[r]=c(r,e[r],t);return e}function r(e,n){return c(n,e,t)}return{onProcessStyle:n,onChangeValue:r}}},29059(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{};return e.createGenerateClassName&&(this.options.createGenerateClassName=e.createGenerateClassName,this.generateClassName=e.createGenerateClassName()),null!=e.insertionPoint&&(this.options.insertionPoint=e.insertionPoint),(e.virtual||e.Renderer)&&(this.options.Renderer=e.Renderer||(e.virtual?A.default:M.default)),e.plugins&&this.use.apply(this,e.plugins),this}},{key:"createStyleSheet",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.index;"number"!=typeof n&&(n=0===y.default.index?0:y.default.index+1);var r=new c.default(e,i({},t,{jss:this,generateClassName:t.generateClassName||this.generateClassName,insertionPoint:this.options.insertionPoint,Renderer:this.options.Renderer,index:n}));return this.plugins.onProcessSheet(r),r}},{key:"removeStyleSheet",value:function(e){return e.detach(),y.default.remove(e),this}},{key:"createRule",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};(void 0===e?"undefined":r(e))==="object"&&(n=t,t=e,e=void 0);var i=n;i.jss=this,i.Renderer=this.options.Renderer,i.generateClassName||(i.generateClassName=this.generateClassName),i.classes||(i.classes={});var a=(0,x.default)(e,t,i);return!i.selector&&a instanceof _.default&&(a.selector="."+i.generateClassName(a)),this.plugins.onProcessRule(a),a}},{key:"use",value:function(){for(var e=this,t=arguments.length,n=Array(t),r=0;r0&&(this.refs[t]--,0===this.refs[t]&&this.sheets[t].detach())}},{key:"size",get:function(){return this.keys.length}}]),e}();t.default=u},92122(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var n=0;n=this.index){t.push(e);return}for(var r=0;rn){t.splice(r,0,e);return}}}},{key:"reset",value:function(){this.registry=[]}},{key:"remove",value:function(e){var t=this.registry.indexOf(e);this.registry.splice(t,1)}},{key:"toString",value:function(e){return this.registry.filter(function(e){return e.attached}).map(function(t){return t.toString(e)}).join("\n")}},{key:"index",get:function(){return 0===this.registry.length?0:this.registry[this.registry.length-1].options.index}}]),e}();t.default=i},26899(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:0;return e.substr(t,e.indexOf("{")-1)},function(e){if(e.type===y.STYLE_RULE)return e.selectorText;if(e.type===y.KEYFRAMES_RULE){var t=e.name;if(t)return"@keyframes "+t;var n=e.cssText;return"@"+v(n,n.indexOf("keyframes"))}return v(e.cssText)});function _(e,t){return e.selectorText=t,e.selectorText===t}var E,S,k=p(function(){return document.head||document.getElementsByTagName("head")[0]}),x=(E=void 0,S=!1,function(e){var t={};E||(E=document.createElement("style"));for(var n=0;nt.index&&r.options.insertionPoint===t.insertionPoint)return r}return null}function M(e,t){for(var n=e.length-1;n>=0;n--){var r=e[n];if(r.attached&&r.options.insertionPoint===t.insertionPoint)return r}return null}function O(e){for(var t=k(),n=0;n0){var n=T(t,e);if(n)return n.renderer.element;if(n=M(t,e))return n.renderer.element.nextElementSibling}var r=e.insertionPoint;if(r&&"string"==typeof r){var i=O(r);if(i)return i.nextSibling;(0,a.default)("jss"===r,'[JSS] Insertion point "%s" not found.',r)}return null}function L(e,t){var n=t.insertionPoint,r=A(t);if(r){var i=r.parentNode;i&&i.insertBefore(e,r);return}if(n&&"number"==typeof n.nodeType){var o=n,s=o.parentNode;s?s.insertBefore(e,o.nextSibling):(0,a.default)(!1,"[JSS] Insertion point is not in the DOM.");return}k().insertBefore(e,r)}var C=p(function(){var e=document.querySelector('meta[property="csp-nonce"]');return e?e.getAttribute("content"):null}),I=function(){function e(t){h(this,e),this.getPropertyValue=b,this.setProperty=m,this.removeProperty=g,this.setSelector=_,this.getKey=w,this.getUnescapedKeysMap=x,this.hasInsertedRules=!1,t&&s.default.add(t),this.sheet=t;var n=this.sheet?this.sheet.options:{},r=n.media,i=n.meta,a=n.element;this.element=a||document.createElement("style"),this.element.setAttribute("data-jss",""),r&&this.element.setAttribute("media",r),i&&this.element.setAttribute("data-meta",i);var o=C();o&&this.element.setAttribute("nonce",o)}return r(e,[{key:"attach",value:function(){!this.element.parentNode&&this.sheet&&(this.hasInsertedRules&&(this.deploy(),this.hasInsertedRules=!1),L(this.element,this.sheet.options))}},{key:"detach",value:function(){this.element.parentNode.removeChild(this.element)}},{key:"deploy",value:function(){this.sheet&&(this.element.textContent="\n"+this.sheet.toString()+"\n")}},{key:"insertRule",value:function(e,t){var n=this.element.sheet,r=n.cssRules,i=e.toString();if(t||(t=r.length),!i)return!1;try{n.insertRule(i,t)}catch(o){return(0,a.default)(!1,"[JSS] Can not insert an unsupported rule \n\r%s",e),!1}return this.hasInsertedRules=!0,r[t]}},{key:"deleteRule",value:function(e){var t=this.element.sheet,n=this.indexOf(e);return -1!==n&&(t.deleteRule(n),!0)}},{key:"indexOf",value:function(e){for(var t=this.element.sheet.cssRules,n=0;n0&&void 0!==arguments[0]?arguments[0]:{indent:1},t=this.rules.toString(e);return t?this.key+" {\n"+t+"\n}":""}}]),e}();t.default=c},12398(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{indent:1},t=this.rules.toString(e);return t&&(t+="\n"),this.key+" {\n"+t+"}"}}]),e}();t.default=c},3486(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var n=0;nc&&(0,i.default)(!1,"[JSS] You might have a memory leak. Rule counter is at %s.",e);var a=t,o="";return(r&&(a=r.options.classNamePrefix||t,null!=r.options.jss.id&&(o+=r.options.jss.id)),"production"===l)?""+a+s.default+o+e:a+n.key+"-"+s.default+(o&&"-"+o)+"-"+e}}},89380(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=l;var r=n(63189),i=c(r),a=n(15803),o=c(a),s=n(2808),u=c(s);function c(e){return e&&e.__esModule?e:{default:e}}function l(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"unnamed",t=arguments[1],n=arguments[2],r=n.jss,a=(0,u.default)(t),s=r.plugins.onCreateRule(e,a,n);return s||("@"===e[0]&&(0,i.default)(!1,"[JSS] Unknown at-rule %s",e),new o.default(e,a,n))}},55878(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n.g.CSS,i="production",a=/([[\].#*$><+~=|^:(),"'`])/g;t.default=function(e){return"production"===i?e:r&&r.escape?r.escape(e):e.replace(a,"\\$1")}},27343(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function r(e){var t=null;for(var i in e){var a=e[i],o=void 0===a?"undefined":n(a);if("function"===o)t||(t={}),t[i]=a;else if("object"===o&&null!==a&&!Array.isArray(a)){var s=r(a);s&&(t||(t={}),t[i]=s)}}return t}t.default=r},97628(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(67121),i=a(r);function a(e){return e&&e.__esModule?e:{default:e}}t.default=function(e){return e&&e[i.default]&&e===e[i.default]()}},94229(e,t){"use strict";function n(e,t){e.renderable=t,e.rules&&t.cssRules&&e.rules.link(t.cssRules)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n},141(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r="2f1acc6c3a606b082e5eef5e54414ffb";null==n.g[r]&&(n.g[r]=0),t.default=n.g[r]++},70084(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;var r=n(16229),i=a(r);function a(e){return e&&e.__esModule?e:{default:e}}function o(e,t){for(var n="",r=0;r2&&void 0!==arguments[2]?arguments[2]:{},r="";if(!t)return r;var a=n.indent,s=void 0===a?0:a,u=t.fallbacks;if(s++,u){if(Array.isArray(u))for(var c=0;c1&&void 0!==arguments[1]&&arguments[1];if(!Array.isArray(e))return e;var r="";if(Array.isArray(e[0]))for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:{};s(this,e),this.cookieOptions=Object.assign({path:"/"},t),u=void 0===t.prefix?u:t.prefix}return r(e,[{key:"getItem",value:function(e){var t=a.default.parse(document.cookie);return t&&t.hasOwnProperty(u+e)?t[u+e]:null}},{key:"setItem",value:function(e,t){return document.cookie=a.default.serialize(u+e,t,this.cookieOptions),t}},{key:"removeItem",value:function(e){var t=Object.assign({},this.cookieOptions,{maxAge:-1});return document.cookie=a.default.serialize(u+e,"",t),null}},{key:"clear",value:function(){var e=a.default.parse(document.cookie);for(var t in e)0===t.indexOf(u)&&this.removeItem(t.substr(u.length));return null}}]),e}();function l(){var e=new c;try{var t="__test";e.setItem(t,"1");var n=e.getItem(t);return e.removeItem(t),"1"===n}catch(r){return!1}}t.default=c},90145(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:"localStorage",t=String(e).replace(/storage$/i,"").toLowerCase();if("local"===t)return a("localStorage");if("session"===t)return a("sessionStorage");if("cookie"===t)return(0,r.hasCookies)();if("memory"===t)return!0;throw Error("Storage method `"+e+"` is not available.\n Please use one of the following: localStorage, sessionStorage, cookieStorage, memoryStorage.")}},72426(e,t){"use strict";/*! + * cookie + * Copyright(c) 2012-2014 Roman Shtylman + * Copyright(c) 2015 Douglas Christopher Wilson + * MIT Licensed + */ t.parse=o,t.serialize=s;var n=decodeURIComponent,r=encodeURIComponent,i=/; */,a=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function o(e,t){if("string"!=typeof e)throw TypeError("argument str must be a string");for(var r={},a=t||{},o=e.split(i),s=a.decode||n,c=0;cc});var r=n(56169);e=n.hmd(e);var i="object"==typeof exports&&exports&&!exports.nodeType&&exports,a=i&&e&&!e.nodeType&&e,o=a&&a.exports===i?r.Z.Buffer:void 0,s=o?o.allocUnsafe:void 0;function u(e,t){if(t)return e.slice();var n=e.length,r=s?s(n):new e.constructor(n);return e.copy(r),r}let c=u},48277(e,t,n){"use strict";n.d(t,{Z:()=>i});var r="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;let i=r},79730(e,t,n){"use strict";n.d(t,{Z:()=>u});var r=n(48277);e=n.hmd(e);var i="object"==typeof exports&&exports&&!exports.nodeType&&exports,a=i&&e&&!e.nodeType&&e,o=a&&a.exports===i&&r.Z.process,s=function(){try{var e=a&&a.require&&a.require("util").types;if(e)return e;return o&&o.binding&&o.binding("util")}catch(t){}}();let u=s},56169(e,t,n){"use strict";n.d(t,{Z:()=>o});var r=n(48277),i="object"==typeof self&&self&&self.Object===Object&&self,a=r.Z||i||Function("return this")();let o=a},29710(e,t,n){"use strict";n.d(t,{Z:()=>l});var r=n(56169);function i(){return!1}let a=i;e=n.hmd(e);var o="object"==typeof exports&&exports&&!exports.nodeType&&exports,s=o&&e&&!e.nodeType&&e,u=s&&s.exports===o?r.Z.Buffer:void 0,c=(u?u.isBuffer:void 0)||a;let l=c},18552(e,t,n){var r=n(10852),i=n(55639),a=r(i,"DataView");e.exports=a},1989(e,t,n){var r=n(51789),i=n(80401),a=n(57667),o=n(21327),s=n(81866);function u(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t-1}e.exports=i},1196(e){function t(e,t,n){for(var r=-1,i=null==e?0:e.length;++r0&&n(l)?t>1?a(l,t-1,n,o,s):r(s,l):o||(s[s.length]=l)}return s}e.exports=a},28483(e,t,n){var r=n(25063)();e.exports=r},47816(e,t,n){var r=n(28483),i=n(3674);function a(e,t){return e&&r(e,t,i)}e.exports=a},97786(e,t,n){var r=n(71811),i=n(40327);function a(e,t){t=r(t,e);for(var n=0,a=t.length;null!=e&&ni?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var a=Array(i);++r=c){var m=t?null:s(e);if(m)return u(m);h=!1,f=o,b=new r}else b=t?[]:p;outer:for(;++l=i?e:r(e,t,n)}e.exports=i},74318(e,t,n){var r=n(11149);function i(e){var t=new e.constructor(e.byteLength);return new r(t).set(new r(e)),t}e.exports=i},64626(e,t,n){e=n.nmd(e);var r=n(55639),i=t&&!t.nodeType&&t,a=i&&e&&!e.nodeType&&e,o=a&&a.exports===i?r.Buffer:void 0,s=o?o.allocUnsafe:void 0;function u(e,t){if(t)return e.slice();var n=e.length,r=s?s(n):new e.constructor(n);return e.copy(r),r}e.exports=u},57157(e,t,n){var r=n(74318);function i(e,t){var n=t?r(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}e.exports=i},93147(e){var t=/\w*$/;function n(e){var n=new e.constructor(e.source,t.exec(e));return n.lastIndex=e.lastIndex,n}e.exports=n},40419(e,t,n){var r=n(62705),i=r?r.prototype:void 0,a=i?i.valueOf:void 0;function o(e){return a?Object(a.call(e)):{}}e.exports=o},77133(e,t,n){var r=n(74318);function i(e,t){var n=t?r(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}e.exports=i},278(e){function t(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n1?n[a-1]:void 0,s=a>2?n[2]:void 0;for(o=e.length>3&&"function"==typeof o?(a--,o):void 0,s&&i(n[0],n[1],s)&&(o=a<3?void 0:o,a=1),t=Object(t);++rd))return!1;var p=l.get(e),b=l.get(t);if(p&&b)return p==t&&b==e;var m=-1,g=!0,v=n&s?new r:void 0;for(l.set(e,t),l.set(t,e);++m-1&&e%1==0&&e-1}e.exports=i},13399(e,t,n){var r=n(18470);function i(e,t){var n=this.__data__,i=r(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this}e.exports=i},24785(e,t,n){var r=n(1989),i=n(38407),a=n(57071);function o(){this.size=0,this.__data__={hash:new r,map:new(a||i),string:new r}}e.exports=o},11285(e,t,n){var r=n(45050);function i(e){var t=r(this,e).delete(e);return this.size-=t?1:0,t}e.exports=i},96e3(e,t,n){var r=n(45050);function i(e){return r(this,e).get(e)}e.exports=i},49916(e,t,n){var r=n(45050);function i(e){return r(this,e).has(e)}e.exports=i},95265(e,t,n){var r=n(45050);function i(e,t){var n=r(this,e),i=n.size;return n.set(e,t),this.size+=n.size==i?0:1,this}e.exports=i},68776(e){function t(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}e.exports=t},42634(e){function t(e,t){return function(n){return null!=n&&n[e]===t&&(void 0!==t||e in Object(n))}}e.exports=t},24523(e,t,n){var r=n(88306),i=500;function a(e){var t=r(e,function(e){return n.size===i&&n.clear(),e}),n=t.cache;return t}e.exports=a},94536(e,t,n){var r=n(10852)(Object,"create");e.exports=r},86916(e,t,n){var r=n(5569)(Object.keys,Object);e.exports=r},33498(e){function t(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}e.exports=t},31167(e,t,n){e=n.nmd(e);var r=n(31957),i=t&&!t.nodeType&&t,a=i&&e&&!e.nodeType&&e,o=a&&a.exports===i&&r.process,s=function(){try{var e=a&&a.require&&a.require("util").types;if(e)return e;return o&&o.binding&&o.binding("util")}catch(t){}}();e.exports=s},2333(e){var t=Object.prototype.toString;function n(e){return t.call(e)}e.exports=n},5569(e){function t(e,t){return function(n){return e(t(n))}}e.exports=t},45357(e,t,n){var r=n(96874),i=Math.max;function a(e,t,n){return t=i(void 0===t?e.length-1:t,0),function(){for(var a=arguments,o=-1,s=i(a.length-t,0),u=Array(s);++o0){if(++i>=t)return arguments[0]}else i=0;return e.apply(void 0,arguments)}}e.exports=i},37465(e,t,n){var r=n(38407);function i(){this.__data__=new r,this.size=0}e.exports=i},63779(e){function t(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}e.exports=t},67599(e){function t(e){return this.__data__.get(e)}e.exports=t},44758(e){function t(e){return this.__data__.has(e)}e.exports=t},34309(e,t,n){var r=n(38407),i=n(57071),a=n(83369),o=200;function s(e,t){var n=this.__data__;if(n instanceof r){var s=n.__data__;if(!i||s.length=t||n<0||g&&r>=f}function S(){var e=i();if(E(e))return k(e);h=setTimeout(S,_(e))}function k(e){return(h=void 0,v&&c)?y(e):(c=l=void 0,d)}function x(){void 0!==h&&clearTimeout(h),b=0,c=p=l=h=void 0}function T(){return void 0===h?d:k(i())}function M(){var e=i(),n=E(e);if(c=arguments,l=this,p=e,n){if(void 0===h)return w(p);if(g)return clearTimeout(h),h=setTimeout(S,t),y(p)}return void 0===h&&(h=setTimeout(S,t)),d}return t=a(t)||0,r(n)&&(m=!!n.leading,f=(g="maxWait"in n)?s(a(n.maxWait)||0,t):f,v="trailing"in n?!!n.trailing:v),M.cancel=x,M.flush=T,M}e.exports=c},53816(e,t,n){var r=n(69389),i=n(79833),a=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,o=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g");function s(e){return(e=i(e))&&e.replace(a,r).replace(o,"")}e.exports=s},66073(e,t,n){e.exports=n(84486)},77813(e){function t(e,t){return e===t||e!=e&&t!=t}e.exports=t},63105(e,t,n){var r=n(34963),i=n(80760),a=n(67206),o=n(1469);function s(e,t){return(o(e)?r:i)(e,a(t,3))}e.exports=s},85564(e,t,n){var r=n(21078);function i(e){return(null==e?0:e.length)?r(e,1):[]}e.exports=i},84486(e,t,n){var r=n(77412),i=n(89881),a=n(54290),o=n(1469);function s(e,t){return(o(e)?r:i)(e,a(t))}e.exports=s},27361(e,t,n){var r=n(97786);function i(e,t,n){var i=null==e?void 0:r(e,t);return void 0===i?n:i}e.exports=i},18721(e,t,n){var r=n(78565),i=n(222);function a(e,t){return null!=e&&i(e,t,r)}e.exports=a},79095(e,t,n){var r=n(13),i=n(222);function a(e,t){return null!=e&&i(e,t,r)}e.exports=a},6557(e){function t(e){return e}e.exports=t},35694(e,t,n){var r=n(9454),i=n(37005),a=Object.prototype,o=a.hasOwnProperty,s=a.propertyIsEnumerable,u=r(function(){return arguments}())?r:function(e){return i(e)&&o.call(e,"callee")&&!s.call(e,"callee")};e.exports=u},1469(e){var t=Array.isArray;e.exports=t},98612(e,t,n){var r=n(23560),i=n(41780);function a(e){return null!=e&&i(e.length)&&!r(e)}e.exports=a},29246(e,t,n){var r=n(98612),i=n(37005);function a(e){return i(e)&&r(e)}e.exports=a},44144(e,t,n){e=n.nmd(e);var r=n(55639),i=n(95062),a=t&&!t.nodeType&&t,o=a&&e&&!e.nodeType&&e,s=o&&o.exports===a?r.Buffer:void 0,u=(s?s.isBuffer:void 0)||i;e.exports=u},41609(e,t,n){var r=n(280),i=n(64160),a=n(35694),o=n(1469),s=n(98612),u=n(44144),c=n(25726),l=n(36719),f="[object Map]",d="[object Set]",h=Object.prototype.hasOwnProperty;function p(e){if(null==e)return!0;if(s(e)&&(o(e)||"string"==typeof e||"function"==typeof e.splice||u(e)||l(e)||a(e)))return!e.length;var t=i(e);if(t==f||t==d)return!e.size;if(c(e))return!r(e).length;for(var n in e)if(h.call(e,n))return!1;return!0}e.exports=p},23560(e,t,n){var r=n(44239),i=n(13218),a="[object AsyncFunction]",o="[object Function]",s="[object GeneratorFunction]",u="[object Proxy]";function c(e){if(!i(e))return!1;var t=r(e);return t==o||t==s||t==a||t==u}e.exports=c},41780(e){var t=9007199254740991;function n(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=t}e.exports=n},56688(e,t,n){var r=n(25588),i=n(7518),a=n(31167),o=a&&a.isMap,s=o?i(o):r;e.exports=s},45220(e){function t(e){return null===e}e.exports=t},13218(e){function t(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}e.exports=t},37005(e){function t(e){return null!=e&&"object"==typeof e}e.exports=t},68630(e,t,n){var r=n(44239),i=n(85924),a=n(37005),o="[object Object]",s=Function.prototype,u=Object.prototype,c=s.toString,l=u.hasOwnProperty,f=c.call(Object);function d(e){if(!a(e)||r(e)!=o)return!1;var t=i(e);if(null===t)return!0;var n=l.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&c.call(n)==f}e.exports=d},72928(e,t,n){var r=n(29221),i=n(7518),a=n(31167),o=a&&a.isSet,s=o?i(o):r;e.exports=s},47037(e,t,n){var r=n(44239),i=n(1469),a=n(37005),o="[object String]";function s(e){return"string"==typeof e||!i(e)&&a(e)&&r(e)==o}e.exports=s},33448(e,t,n){var r=n(44239),i=n(37005),a="[object Symbol]";function o(e){return"symbol"==typeof e||i(e)&&r(e)==a}e.exports=o},36719(e,t,n){var r=n(38749),i=n(7518),a=n(31167),o=a&&a.isTypedArray,s=o?i(o):r;e.exports=s},52353(e){function t(e){return void 0===e}e.exports=t},3674(e,t,n){var r=n(14636),i=n(280),a=n(98612);function o(e){return a(e)?r(e):i(e)}e.exports=o},81704(e,t,n){var r=n(14636),i=n(35014),a=n(98612);function o(e){return a(e)?r(e,!0):i(e)}e.exports=o},96486:function(e,t,n){var r;e=n.nmd(e),(function(){var i,a="4.17.21",o=200,s="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",u="Expected a function",c="Invalid `variable` option passed into `_.template`",l="__lodash_hash_undefined__",f=500,d="__lodash_placeholder__",h=1,p=2,b=4,m=1,g=2,v=1,y=2,w=4,_=8,E=16,S=32,k=64,x=128,T=256,M=512,O=30,A="...",L=800,C=16,I=1,D=2,N=3,P=1/0,R=9007199254740991,j=17976931348623157e292,F=0/0,Y=4294967295,B=Y-1,U=Y>>>1,H=[["ary",x],["bind",v],["bindKey",y],["curry",_],["curryRight",E],["flip",M],["partial",S],["partialRight",k],["rearg",T]],$="[object Arguments]",z="[object Array]",G="[object AsyncFunction]",W="[object Boolean]",K="[object Date]",V="[object DOMException]",q="[object Error]",Z="[object Function]",X="[object GeneratorFunction]",J="[object Map]",Q="[object Number]",ee="[object Null]",et="[object Object]",en="[object Promise]",er="[object Proxy]",ei="[object RegExp]",ea="[object Set]",eo="[object String]",es="[object Symbol]",eu="[object Undefined]",ec="[object WeakMap]",el="[object WeakSet]",ef="[object ArrayBuffer]",ed="[object DataView]",eh="[object Float32Array]",ep="[object Float64Array]",eb="[object Int8Array]",em="[object Int16Array]",eg="[object Int32Array]",ev="[object Uint8Array]",ey="[object Uint8ClampedArray]",ew="[object Uint16Array]",e_="[object Uint32Array]",eE=/\b__p \+= '';/g,eS=/\b(__p \+=) '' \+/g,ek=/(__e\(.*?\)|\b__t\)) \+\n'';/g,ex=/&(?:amp|lt|gt|quot|#39);/g,eT=/[&<>"']/g,eM=RegExp(ex.source),eO=RegExp(eT.source),eA=/<%-([\s\S]+?)%>/g,eL=/<%([\s\S]+?)%>/g,eC=/<%=([\s\S]+?)%>/g,eI=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,eD=/^\w*$/,eN=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,eP=/[\\^$.*+?()[\]{}|]/g,eR=RegExp(eP.source),ej=/^\s+/,eF=/\s/,eY=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,eB=/\{\n\/\* \[wrapped with (.+)\] \*/,eU=/,? & /,eH=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,e$=/[()=,{}\[\]\/\s]/,ez=/\\(\\)?/g,eG=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,eW=/\w*$/,eK=/^[-+]0x[0-9a-f]+$/i,eV=/^0b[01]+$/i,eq=/^\[object .+?Constructor\]$/,eZ=/^0o[0-7]+$/i,eX=/^(?:0|[1-9]\d*)$/,eJ=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,eQ=/($^)/,e1=/['\n\r\u2028\u2029\\]/g,e0="\ud800-\udfff",e2="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",e3="\\u2700-\\u27bf",e4="a-z\\xdf-\\xf6\\xf8-\\xff",e6="A-Z\\xc0-\\xd6\\xd8-\\xde",e5="\\ufe0e\\ufe0f",e8="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",e9="['’]",e7="["+e0+"]",te="["+e8+"]",tt="["+e2+"]",tn="\\d+",tr="["+e3+"]",ti="["+e4+"]",ta="[^"+e0+e8+tn+e3+e4+e6+"]",to="\ud83c[\udffb-\udfff]",ts="[^"+e0+"]",tu="(?:\ud83c[\udde6-\uddff]){2}",tc="[\ud800-\udbff][\udc00-\udfff]",tl="["+e6+"]",tf="\\u200d",td="(?:"+ti+"|"+ta+")",th="(?:"+tl+"|"+ta+")",tp="(?:"+e9+"(?:d|ll|m|re|s|t|ve))?",tb="(?:"+e9+"(?:D|LL|M|RE|S|T|VE))?",tm="(?:"+tt+"|"+to+")?",tg="["+e5+"]?",tv="(?:"+tf+"(?:"+[ts,tu,tc].join("|")+")"+tg+tm+")*",ty="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",tw="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",t_=tg+tm+tv,tE="(?:"+[tr,tu,tc].join("|")+")"+t_,tS="(?:"+[ts+tt+"?",tt,tu,tc,e7].join("|")+")",tk=RegExp(e9,"g"),tx=RegExp(tt,"g"),tT=RegExp(to+"(?="+to+")|"+tS+t_,"g"),tM=RegExp([tl+"?"+ti+"+"+tp+"(?="+[te,tl,"$"].join("|")+")",th+"+"+tb+"(?="+[te,tl+td,"$"].join("|")+")",tl+"?"+td+"+"+tp,tl+"+"+tb,tw,ty,tn,tE].join("|"),"g"),tO=RegExp("["+tf+e0+e2+e5+"]"),tA=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,tL=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],tC=-1,tI={};tI[eh]=tI[ep]=tI[eb]=tI[em]=tI[eg]=tI[ev]=tI[ey]=tI[ew]=tI[e_]=!0,tI[$]=tI[z]=tI[ef]=tI[W]=tI[ed]=tI[K]=tI[q]=tI[Z]=tI[J]=tI[Q]=tI[et]=tI[ei]=tI[ea]=tI[eo]=tI[ec]=!1;var tD={};tD[$]=tD[z]=tD[ef]=tD[ed]=tD[W]=tD[K]=tD[eh]=tD[ep]=tD[eb]=tD[em]=tD[eg]=tD[J]=tD[Q]=tD[et]=tD[ei]=tD[ea]=tD[eo]=tD[es]=tD[ev]=tD[ey]=tD[ew]=tD[e_]=!0,tD[q]=tD[Z]=tD[ec]=!1;var tN={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},tP={"&":"&","<":"<",">":">",'"':""","'":"'"},tR={"&":"&","<":"<",">":">",""":'"',"'":"'"},tj={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},tF=parseFloat,tY=parseInt,tB="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,tU="object"==typeof self&&self&&self.Object===Object&&self,tH=tB||tU||Function("return this")(),t$=t&&!t.nodeType&&t,tz=t$&&e&&!e.nodeType&&e,tG=tz&&tz.exports===t$,tW=tG&&tB.process,tK=function(){try{var e=tz&&tz.require&&tz.require("util").types;if(e)return e;return tW&&tW.binding&&tW.binding("util")}catch(t){}}(),tV=tK&&tK.isArrayBuffer,tq=tK&&tK.isDate,tZ=tK&&tK.isMap,tX=tK&&tK.isRegExp,tJ=tK&&tK.isSet,tQ=tK&&tK.isTypedArray;function t1(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function t0(e,t,n,r){for(var i=-1,a=null==e?0:e.length;++i-1}function t8(e,t,n){for(var r=-1,i=null==e?0:e.length;++r-1;);return n}function nk(e,t){for(var n=e.length;n--&&nu(t,e[n],0)>-1;);return n}function nx(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}var nT=nh(tN),nM=nh(tP);function nO(e){return"\\"+tj[e]}function nA(e,t){return null==e?i:e[t]}function nL(e){return tO.test(e)}function nC(e){return tA.test(e)}function nI(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}function nD(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function nN(e,t){return function(n){return e(t(n))}}function nP(e,t){for(var n=-1,r=e.length,i=0,a=[];++n-1}function rh(e,t){var n=this.__data__,r=rP(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function rp(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t=t?e:t)),e}function rH(e,t,n,r,a,o){var s,u=t&h,c=t&p,l=t&b;if(n&&(s=a?n(e,r,a,o):n(e)),s!==i)return s;if(!u1(e))return e;var f=uF(e);if(f){if(s=a8(e),!u)return al(e,s)}else{var d=a3(e),m=d==Z||d==X;if(u$(e))return ae(e,u);if(d==et||d==$||m&&!a){if(s=c||m?{}:a9(e),!u)return c?ah(e,rF(s,e)):ad(e,rj(s,e))}else{if(!tD[d])return a?e:{};s=a7(e,d,u)}}o||(o=new rS);var g=o.get(e);if(g)return g;o.set(e,s),cr(e)?e.forEach(function(r){s.add(rH(r,t,n,r,e,o))}):u2(e)&&e.forEach(function(r,i){s.set(i,rH(r,t,n,i,e,o))});var v=l?c?aW:aG:c?c$:cH,y=f?i:v(e);return t2(y||e,function(r,i){y&&(r=e[i=r]),rN(s,i,rH(r,t,n,i,e,o))}),s}function r$(e){var t=cH(e);return function(n){return rz(n,e,t)}}function rz(e,t,n){var r=n.length;if(null==e)return!r;for(e=e4(e);r--;){var a=n[r],o=t[a],s=e[a];if(s===i&&!(a in e)||!o(s))return!1}return!0}function rG(e,t,n){if("function"!=typeof e)throw new e8(u);return o_(function(){e.apply(i,n)},t)}function rW(e,t,n,r){var i=-1,a=t5,s=!0,u=e.length,c=[],l=t.length;if(!u)return c;n&&(t=t9(t,nw(n))),r?(a=t8,s=!1):t.length>=o&&(a=nE,s=!1,t=new rw(t));outer:for(;++ia?0:a+n),(r=r===i||r>a?a:cp(r))<0&&(r+=a),r=n>r?0:cb(r);n0&&n(s)?t>1?rQ(s,t-1,n,r,i):t7(i,s):r||(i[i.length]=s)}return i}var r1=ag(),r0=ag(!0);function r2(e,t){return e&&r1(e,t,cH)}function r3(e,t){return e&&r0(e,t,cH)}function r4(e,t){return t6(t,function(t){return uX(e[t])})}function r6(e,t){t=i5(t,e);for(var n=0,r=t.length;null!=e&&nt}function r7(e,t){return null!=e&&tr.call(e,t)}function ie(e,t){return null!=e&&t in e4(e)}function it(e,t,n){return e>=tU(t,n)&&e=120&&f.length>=120)?new rw(s&&f):i}f=e[0];var d=-1,h=u[0];outer:for(;++d-1;)s!==e&&tg.call(s,u,1),tg.call(e,u,1);return e}function iD(e,t){for(var n=e?t.length:0,r=n-1;n--;){var i=t[n];if(n==r||i!==a){var a=i;on(i)?tg.call(e,i,1):iJ(e,i)}}return e}function iN(e,t){return e+tO(tW()*(t-e+1))}function iP(e,t,n,r){for(var i=-1,a=tB(tM((t-e)/(n||1)),0),o=eF(a);a--;)o[r?a:++i]=e,e+=n;return o}function iR(e,t){var n="";if(!e||t<1||t>R)return n;do t%2&&(n+=e),(t=tO(t/2))&&(e+=e);while(t)return n}function ij(e,t){return oE(om(e,t,lB),e+"")}function iF(e){return rL(c8(e))}function iY(e,t){var n=c8(e);return ox(n,rU(t,0,n.length))}function iB(e,t,n,r){if(!u1(e))return e;t=i5(t,e);for(var a=-1,o=t.length,s=o-1,u=e;null!=u&&++ai?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var a=eF(i);++r>>1,o=e[a];null!==o&&!ca(o)&&(n?o<=t:o=o){var l=t?null:aP(e);if(l)return nR(l);s=!1,i=nE,c=new rw}else c=t?[]:u;outer:for(;++r=r?e:iz(e,t,n)}var i7=tE||function(e){return tH.clearTimeout(e)};function ae(e,t){if(t)return e.slice();var n=e.length,r=th?th(n):new e.constructor(n);return e.copy(r),r}function at(e){var t=new e.constructor(e.byteLength);return new td(t).set(new td(e)),t}function an(e,t){var n=t?at(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}function ar(e){var t=new e.constructor(e.source,eW.exec(e));return t.lastIndex=e.lastIndex,t}function ai(e){return n2?e4(n2.call(e)):{}}function aa(e,t){var n=t?at(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function ao(e,t){if(e!==t){var n=e!==i,r=null===e,a=e==e,o=ca(e),s=t!==i,u=null===t,c=t==t,l=ca(t);if(!u&&!l&&!o&&e>t||o&&s&&c&&!u&&!l||r&&s&&c||!n&&c||!a)return 1;if(!r&&!o&&!l&&e=s)return u;return u*("desc"==n[r]?-1:1)}}return e.index-t.index}function au(e,t,n,r){for(var i=-1,a=e.length,o=n.length,s=-1,u=t.length,c=tB(a-o,0),l=eF(u+c),f=!r;++s1?n[a-1]:i,s=a>2?n[2]:i;for(o=e.length>3&&"function"==typeof o?(a--,o):i,s&&or(n[0],n[1],s)&&(o=a<3?i:o,a=1),t=e4(t);++r-1?a[o?t[s]:s]:i}}function ak(e){return az(function(t){var n=t.length,r=n,a=n8.prototype.thru;for(e&&t.reverse();r--;){var o=t[r];if("function"!=typeof o)throw new e8(u);if(a&&!s&&"wrapper"==aV(o))var s=new n8([],!0)}for(r=s?r:n;++r1&&v.reverse(),f&&cu))return!1;var l=o.get(e),f=o.get(t);if(l&&f)return l==t&&f==e;var d=-1,h=!0,p=n&g?new rw:i;for(o.set(e,t),o.set(t,e);++d1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(eY,"{\n/* [wrapped with "+t+"] */\n")}function ot(e){return uF(e)||uj(e)||!!(tv&&e&&e[tv])}function on(e,t){var n=typeof e;return!!(t=null==t?R:t)&&("number"==n||"symbol"!=n&&eX.test(e))&&e>-1&&e%1==0&&e0){if(++t>=L)return arguments[0]}else t=0;return e.apply(i,arguments)}}function ox(e,t){var n=-1,r=e.length,a=r-1;for(t=t===i?r:t;++n1?e[t-1]:i;return n="function"==typeof n?(e.pop(),n):i,sE(e,n)});function sC(e){var t=n4(e);return t.__chain__=!0,t}function sI(e,t){return t(e),e}function sD(e,t){return t(e)}var sN=az(function(e){var t=e.length,n=t?e[0]:0,r=this.__wrapped__,a=function(t){return rB(t,e)};return!(t>1)&&!this.__actions__.length&&r instanceof n9&&on(n)?((r=r.slice(n,+n+(t?1:0))).__actions__.push({func:sD,args:[a],thisArg:i}),new n8(r,this.__chain__).thru(function(e){return t&&!e.length&&e.push(i),e})):this.thru(a)});function sP(){return sC(this)}function sR(){return new n8(this.value(),this.__chain__)}function sj(){i===this.__values__&&(this.__values__=cd(this.value()));var e=this.__index__>=this.__values__.length,t=e?i:this.__values__[this.__index__++];return{done:e,value:t}}function sF(){return this}function sY(e){for(var t,n=this;n instanceof n5;){var r=oL(n);r.__index__=0,r.__values__=i,t?a.__wrapped__=r:t=r;var a=r;n=n.__wrapped__}return a.__wrapped__=e,t}function sB(){var e=this.__wrapped__;if(e instanceof n9){var t=e;return this.__actions__.length&&(t=new n9(this)),(t=t.reverse()).__actions__.push({func:sD,args:[se],thisArg:i}),new n8(t,this.__chain__)}return this.thru(se)}function sU(){return i0(this.__wrapped__,this.__actions__)}var sH=ap(function(e,t,n){tr.call(e,n)?++e[n]:rY(e,n,1)});function s$(e,t,n){var r=uF(e)?t4:rq;return n&&or(e,t,n)&&(t=i),r(e,aZ(t,3))}function sz(e,t){return(uF(e)?t6:rJ)(e,aZ(t,3))}var sG=aS(oH),sW=aS(o$);function sK(e,t){return rQ(s2(e,t),1)}function sV(e,t){return rQ(s2(e,t),P)}function sq(e,t,n){return n=n===i?1:cp(n),rQ(s2(e,t),n)}function sZ(e,t){return(uF(e)?t2:rK)(e,aZ(t,3))}function sX(e,t){return(uF(e)?t3:rV)(e,aZ(t,3))}var sJ=ap(function(e,t,n){tr.call(e,n)?e[n].push(t):rY(e,n,[t])});function sQ(e,t,n,r){e=uB(e)?e:c8(e),n=n&&!r?cp(n):0;var i=e.length;return n<0&&(n=tB(i+n,0)),ci(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&nu(e,t,n)>-1}var s1=ij(function(e,t,n){var r=-1,i="function"==typeof t,a=uB(e)?eF(e.length):[];return rK(e,function(e){a[++r]=i?t1(t,e,n):ia(e,t,n)}),a}),s0=ap(function(e,t,n){rY(e,n,t)});function s2(e,t){return(uF(e)?t9:iE)(e,aZ(t,3))}function s3(e,t,n,r){return null==e?[]:(uF(t)||(t=null==t?[]:[t]),n=r?i:n,uF(n)||(n=null==n?[]:[n]),iO(e,t,n))}var s4=ap(function(e,t,n){e[n?0:1].push(t)},function(){return[[],[]]});function s6(e,t,n){var r=uF(e)?ne:np,i=arguments.length<3;return r(e,aZ(t,4),n,i,rK)}function s5(e,t,n){var r=uF(e)?nt:np,i=arguments.length<3;return r(e,aZ(t,4),n,i,rV)}function s8(e,t){return(uF(e)?t6:rJ)(e,ug(aZ(t,3)))}function s9(e){return(uF(e)?rL:iF)(e)}function s7(e,t,n){return t=(n?or(e,t,n):t===i)?1:cp(t),(uF(e)?rC:iY)(e,t)}function ue(e){return(uF(e)?rI:i$)(e)}function ut(e){if(null==e)return 0;if(uB(e))return ci(e)?nB(e):e.length;var t=a3(e);return t==J||t==ea?e.size:iy(e).length}function un(e,t,n){var r=uF(e)?nn:iG;return n&&or(e,t,n)&&(t=i),r(e,aZ(t,3))}var ur=ij(function(e,t){if(null==e)return[];var n=t.length;return n>1&&or(e,t[0],t[1])?t=[]:n>2&&or(t[0],t[1],t[2])&&(t=[t[0]]),iO(e,rQ(t,1),[])}),ui=tS||function(){return tH.Date.now()};function ua(e,t){if("function"!=typeof t)throw new e8(u);return e=cp(e),function(){if(--e<1)return t.apply(this,arguments)}}function uo(e,t,n){return t=n?i:t,t=e&&null==t?e.length:t,aj(e,x,i,i,i,i,t)}function us(e,t){var n;if("function"!=typeof t)throw new e8(u);return e=cp(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=i),n}}var uu=ij(function(e,t,n){var r=v;if(n.length){var i=nP(n,aq(uu));r|=S}return aj(e,r,t,n,i)}),uc=ij(function(e,t,n){var r=v|y;if(n.length){var i=nP(n,aq(uc));r|=S}return aj(t,r,e,n,i)});function ul(e,t,n){t=n?i:t;var r=aj(e,_,i,i,i,i,i,t);return r.placeholder=ul.placeholder,r}function uf(e,t,n){t=n?i:t;var r=aj(e,E,i,i,i,i,i,t);return r.placeholder=uf.placeholder,r}function ud(e,t,n){var r,a,o,s,c,l,f=0,d=!1,h=!1,p=!0;if("function"!=typeof e)throw new e8(u);function b(t){var n=r,o=a;return r=a=i,f=t,s=e.apply(o,n)}function m(e){return f=e,c=o_(y,t),d?b(e):s}function g(e){var n=e-l,r=e-f,i=t-n;return h?tU(i,o-r):i}function v(e){var n=e-l,r=e-f;return l===i||n>=t||n<0||h&&r>=o}function y(){var e=ui();if(v(e))return w(e);c=o_(y,g(e))}function w(e){return(c=i,p&&r)?b(e):(r=a=i,s)}function _(){c!==i&&i7(c),f=0,r=l=a=c=i}function E(){return c===i?s:w(ui())}function S(){var e=ui(),n=v(e);if(r=arguments,a=this,l=e,n){if(c===i)return m(l);if(h)return i7(c),c=o_(y,t),b(l)}return c===i&&(c=o_(y,t)),s}return t=cm(t)||0,u1(n)&&(d=!!n.leading,o=(h="maxWait"in n)?tB(cm(n.maxWait)||0,t):o,p="trailing"in n?!!n.trailing:p),S.cancel=_,S.flush=E,S}var uh=ij(function(e,t){return rG(e,1,t)}),up=ij(function(e,t,n){return rG(e,cm(t)||0,n)});function ub(e){return aj(e,M)}function um(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new e8(u);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);var o=e.apply(this,r);return n.cache=a.set(i,o)||a,o};return n.cache=new(um.Cache||rp),n}function ug(e){if("function"!=typeof e)throw new e8(u);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}function uv(e){return us(2,e)}um.Cache=rp;var uy=i8(function(e,t){var n=(t=1==t.length&&uF(t[0])?t9(t[0],nw(aZ())):t9(rQ(t,1),nw(aZ()))).length;return ij(function(r){for(var i=-1,a=tU(r.length,n);++i=t}),uj=io(function(){return arguments}())?io:function(e){return u0(e)&&tr.call(e,"callee")&&!tm.call(e,"callee")},uF=eF.isArray,uY=tV?nw(tV):is;function uB(e){return null!=e&&uQ(e.length)&&!uX(e)}function uU(e){return u0(e)&&uB(e)}function uH(e){return!0===e||!1===e||u0(e)&&r8(e)==W}var u$=tN||l4,uz=tq?nw(tq):iu;function uG(e){return u0(e)&&1===e.nodeType&&!ce(e)}function uW(e){if(null==e)return!0;if(uB(e)&&(uF(e)||"string"==typeof e||"function"==typeof e.splice||u$(e)||co(e)||uj(e)))return!e.length;var t=a3(e);if(t==J||t==ea)return!e.size;if(oc(e))return!iy(e).length;for(var n in e)if(tr.call(e,n))return!1;return!0}function uK(e,t){return ic(e,t)}function uV(e,t,n){var r=(n="function"==typeof n?n:i)?n(e,t):i;return r===i?ic(e,t,i,n):!!r}function uq(e){if(!u0(e))return!1;var t=r8(e);return t==q||t==V||"string"==typeof e.message&&"string"==typeof e.name&&!ce(e)}function uZ(e){return"number"==typeof e&&tP(e)}function uX(e){if(!u1(e))return!1;var t=r8(e);return t==Z||t==X||t==G||t==er}function uJ(e){return"number"==typeof e&&e==cp(e)}function uQ(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=R}function u1(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function u0(e){return null!=e&&"object"==typeof e}var u2=tZ?nw(tZ):id;function u3(e,t){return e===t||ih(e,t,aJ(t))}function u4(e,t,n){return n="function"==typeof n?n:i,ih(e,t,aJ(t),n)}function u6(e){return u7(e)&&e!=+e}function u5(e){if(ou(e))throw new e0(s);return ip(e)}function u8(e){return null===e}function u9(e){return null==e}function u7(e){return"number"==typeof e||u0(e)&&r8(e)==Q}function ce(e){if(!u0(e)||r8(e)!=et)return!1;var t=tp(e);if(null===t)return!0;var n=tr.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&tn.call(n)==ts}var ct=tX?nw(tX):ib;function cn(e){return uJ(e)&&e>=-R&&e<=R}var cr=tJ?nw(tJ):im;function ci(e){return"string"==typeof e||!uF(e)&&u0(e)&&r8(e)==eo}function ca(e){return"symbol"==typeof e||u0(e)&&r8(e)==es}var co=tQ?nw(tQ):ig;function cs(e){return e===i}function cu(e){return u0(e)&&a3(e)==ec}function cc(e){return u0(e)&&r8(e)==el}var cl=aI(i_),cf=aI(function(e,t){return e<=t});function cd(e){if(!e)return[];if(uB(e))return ci(e)?nU(e):al(e);if(ty&&e[ty])return nI(e[ty]());var t=a3(e);return(t==J?nD:t==ea?nR:c8)(e)}function ch(e){return e?(e=cm(e))===P||e===-P?(e<0?-1:1)*j:e==e?e:0:0===e?e:0}function cp(e){var t=ch(e),n=t%1;return t==t?n?t-n:t:0}function cb(e){return e?rU(cp(e),0,Y):0}function cm(e){if("number"==typeof e)return e;if(ca(e))return F;if(u1(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=u1(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=ny(e);var n=eV.test(e);return n||eZ.test(e)?tY(e.slice(2),n?2:8):eK.test(e)?F:+e}function cg(e){return af(e,c$(e))}function cv(e){return e?rU(cp(e),-R,R):0===e?e:0}function cy(e){return null==e?"":iZ(e)}var cw=ab(function(e,t){if(oc(t)||uB(t)){af(t,cH(t),e);return}for(var n in t)tr.call(t,n)&&rN(e,n,t[n])}),c_=ab(function(e,t){af(t,c$(t),e)}),cE=ab(function(e,t,n,r){af(t,c$(t),e,r)}),cS=ab(function(e,t,n,r){af(t,cH(t),e,r)}),ck=az(rB);function cx(e,t){var n=n6(e);return null==t?n:rj(n,t)}var cT=ij(function(e,t){e=e4(e);var n=-1,r=t.length,a=r>2?t[2]:i;for(a&&or(t[0],t[1],a)&&(r=1);++n1),t}),af(e,aW(e),n),r&&(n=rH(n,h|p|b,aB));for(var i=t.length;i--;)iJ(n,t[i]);return n});function cq(e,t){return cX(e,ug(aZ(t)))}var cZ=az(function(e,t){return null==e?{}:iA(e,t)});function cX(e,t){if(null==e)return{};var n=t9(aW(e),function(e){return[e]});return t=aZ(t),iL(e,n,function(e,n){return t(e,n[0])})}function cJ(e,t,n){t=i5(t,e);var r=-1,a=t.length;for(a||(a=1,e=i);++rt){var r=e;e=t,t=r}if(n||e%1||t%1){var a=tW();return tU(e+a*(t-e+tF("1e-"+((a+"").length-1))),t)}return iN(e,t)}var ln=aw(function(e,t,n){return t=t.toLowerCase(),e+(n?lr(t):t)});function lr(e){return lL(cy(e).toLowerCase())}function li(e){return(e=cy(e))&&e.replace(eJ,nT).replace(tx,"")}function la(e,t,n){e=cy(e),t=iZ(t);var r=e.length,a=n=n===i?r:rU(cp(n),0,r);return(n-=t.length)>=0&&e.slice(n,a)==t}function lo(e){return(e=cy(e))&&eO.test(e)?e.replace(eT,nM):e}function ls(e){return(e=cy(e))&&eR.test(e)?e.replace(eP,"\\$&"):e}var lu=aw(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}),lc=aw(function(e,t,n){return e+(n?" ":"")+t.toLowerCase()}),ll=ay("toLowerCase");function lf(e,t,n){e=cy(e);var r=(t=cp(t))?nB(e):0;if(!t||r>=t)return e;var i=(t-r)/2;return aA(tO(i),n)+e+aA(tM(i),n)}function ld(e,t,n){e=cy(e);var r=(t=cp(t))?nB(e):0;return t&&r>>0)?(e=cy(e))&&("string"==typeof t||null!=t&&!ct(t))&&!(t=iZ(t))&&nL(e)?i9(nU(e),0,n):e.split(t,n):[]}var ly=aw(function(e,t,n){return e+(n?" ":"")+lL(t)});function lw(e,t,n){return e=cy(e),n=null==n?0:rU(cp(n),0,e.length),t=iZ(t),e.slice(n,n+t.length)==t}function l_(e,t,n){var r=n4.templateSettings;n&&or(e,t,n)&&(t=i),e=cy(e),t=cE({},t,r,aF);var a,o,s=cE({},t.imports,r.imports,aF),u=cH(s),l=n_(s,u),f=0,d=t.interpolate||eQ,h="__p += '",p=e6((t.escape||eQ).source+"|"+d.source+"|"+(d===eC?eG:eQ).source+"|"+(t.evaluate||eQ).source+"|$","g"),b="//# sourceURL="+(tr.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++tC+"]")+"\n";e.replace(p,function(t,n,r,i,s,u){return r||(r=i),h+=e.slice(f,u).replace(e1,nO),n&&(a=!0,h+="' +\n__e("+n+") +\n'"),s&&(o=!0,h+="';\n"+s+";\n__p += '"),r&&(h+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),f=u+t.length,t}),h+="';\n";var m=tr.call(t,"variable")&&t.variable;if(m){if(e$.test(m))throw new e0(c)}else h="with (obj) {\n"+h+"\n}\n";h=(o?h.replace(eE,""):h).replace(eS,"$1").replace(ek,"$1;"),h="function("+(m||"obj")+") {\n"+(m?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(a?", __e = _.escape":"")+(o?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+h+"return __p\n}";var g=lI(function(){return e2(u,b+"return "+h).apply(i,l)});if(g.source=h,uq(g))throw g;return g}function lE(e){return cy(e).toLowerCase()}function lS(e){return cy(e).toUpperCase()}function lk(e,t,n){if((e=cy(e))&&(n||t===i))return ny(e);if(!e||!(t=iZ(t)))return e;var r=nU(e),a=nU(t),o=nS(r,a),s=nk(r,a)+1;return i9(r,o,s).join("")}function lx(e,t,n){if((e=cy(e))&&(n||t===i))return e.slice(0,nH(e)+1);if(!e||!(t=iZ(t)))return e;var r=nU(e),a=nk(r,nU(t))+1;return i9(r,0,a).join("")}function lT(e,t,n){if((e=cy(e))&&(n||t===i))return e.replace(ej,"");if(!e||!(t=iZ(t)))return e;var r=nU(e),a=nS(r,nU(t));return i9(r,a).join("")}function lM(e,t){var n=O,r=A;if(u1(t)){var a="separator"in t?t.separator:a;n="length"in t?cp(t.length):n,r="omission"in t?iZ(t.omission):r}var o=(e=cy(e)).length;if(nL(e)){var s=nU(e);o=s.length}if(n>=o)return e;var u=n-nB(r);if(u<1)return r;var c=s?i9(s,0,u).join(""):e.slice(0,u);if(a===i)return c+r;if(s&&(u+=c.length-u),ct(a)){if(e.slice(u).search(a)){var l,f=c;for(a.global||(a=e6(a.source,cy(eW.exec(a))+"g")),a.lastIndex=0;l=a.exec(f);)var d=l.index;c=c.slice(0,d===i?u:d)}}else if(e.indexOf(iZ(a),u)!=u){var h=c.lastIndexOf(a);h>-1&&(c=c.slice(0,h))}return c+r}function lO(e){return(e=cy(e))&&eM.test(e)?e.replace(ex,n$):e}var lA=aw(function(e,t,n){return e+(n?" ":"")+t.toUpperCase()}),lL=ay("toUpperCase");function lC(e,t,n){return(e=cy(e),i===(t=n?i:t))?nC(e)?nW(e):na(e):e.match(t)||[]}var lI=ij(function(e,t){try{return t1(e,i,t)}catch(n){return uq(n)?n:new e0(n)}}),lD=az(function(e,t){return t2(t,function(t){t=oM(t),rY(e,t,uu(e[t],e))}),e});function lN(e){var t=null==e?0:e.length,n=aZ();return e=t?t9(e,function(e){if("function"!=typeof e[1])throw new e8(u);return[n(e[0]),e[1]]}):[],ij(function(n){for(var r=-1;++rR)return[];var n=Y,r=tU(e,Y);t=aZ(t),e-=Y;for(var i=ng(r,t);++n0||t<0)?new n9(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==i&&(n=(t=cp(t))<0?n.dropRight(-t):n.take(t-e)),n)},n9.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},n9.prototype.toArray=function(){return this.take(Y)},r2(n9.prototype,function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),r=/^(?:head|last)$/.test(t),a=n4[r?"take"+("last"==t?"Right":""):t],o=r||/^find/.test(t);a&&(n4.prototype[t]=function(){var t=this.__wrapped__,s=r?[1]:arguments,u=t instanceof n9,c=s[0],l=u||uF(t),f=function(e){var t=a.apply(n4,t7([e],s));return r&&d?t[0]:t};l&&n&&"function"==typeof c&&1!=c.length&&(u=l=!1);var d=this.__chain__,h=!!this.__actions__.length,p=o&&!d,b=u&&!h;if(!o&&l){t=b?t:new n9(this);var m=e.apply(t,s);return m.__actions__.push({func:sD,args:[f],thisArg:i}),new n8(m,d)}return p&&b?e.apply(this,s):(m=this.thru(f),p?r?m.value()[0]:m.value():m)})}),t2(["pop","push","shift","sort","splice","unshift"],function(e){var t=e9[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);n4.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var i=this.value();return t.apply(uF(i)?i:[],e)}return this[n](function(n){return t.apply(uF(n)?n:[],e)})}}),r2(n9.prototype,function(e,t){var n=n4[t];if(n){var r=n.name+"";tr.call(nq,r)||(nq[r]=[]),nq[r].push({name:t,func:n})}}),nq[ax(i,y).name]=[{name:"wrapper",func:i}],n9.prototype.clone=n7,n9.prototype.reverse=re,n9.prototype.value=rt,n4.prototype.at=sN,n4.prototype.chain=sP,n4.prototype.commit=sR,n4.prototype.next=sj,n4.prototype.plant=sY,n4.prototype.reverse=sB,n4.prototype.toJSON=n4.prototype.valueOf=n4.prototype.value=sU,n4.prototype.first=n4.prototype.head,ty&&(n4.prototype[ty]=sF),n4}();tH._=nK,i!==(r=(function(){return nK}).call(t,n,t,e))&&(e.exports=r)}).call(this)},35161(e,t,n){var r=n(29932),i=n(67206),a=n(69199),o=n(1469);function s(e,t){return(o(e)?r:a)(e,i(t,3))}e.exports=s},67523(e,t,n){var r=n(89465),i=n(47816),a=n(67206);function o(e,t){var n={};return t=a(t,3),i(e,function(e,i,a){r(n,t(e,i,a),e)}),n}e.exports=o},66604(e,t,n){var r=n(89465),i=n(47816),a=n(67206);function o(e,t){var n={};return t=a(t,3),i(e,function(e,i,a){r(n,i,t(e,i,a))}),n}e.exports=o},88306(e,t,n){var r=n(83369),i="Expected a function";function a(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw TypeError(i);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);var o=e.apply(this,r);return n.cache=a.set(i,o)||a,o};return n.cache=new(a.Cache||r),n}a.Cache=r,e.exports=a},82492(e,t,n){var r=n(42980),i=n(21463)(function(e,t,n){r(e,t,n)});e.exports=i},50308(e){function t(){}e.exports=t},7771(e,t,n){var r=n(55639),i=function(){return r.Date.now()};e.exports=i},78718(e,t,n){var r=n(25970),i=n(99021)(function(e,t){return null==e?{}:r(e,t)});e.exports=i},39601(e,t,n){var r=n(40371),i=n(79152),a=n(15403),o=n(40327);function s(e){return a(e)?r(o(e)):i(e)}e.exports=s},54061(e,t,n){var r=n(62663),i=n(89881),a=n(67206),o=n(10107),s=n(1469);function u(e,t,n){var u=s(e)?r:o,c=arguments.length<3;return u(e,a(t,4),n,c,i)}e.exports=u},84238(e,t,n){var r=n(280),i=n(64160),a=n(98612),o=n(47037),s=n(88016),u="[object Map]",c="[object Set]";function l(e){if(null==e)return 0;if(a(e))return o(e)?s(e):e.length;var t=i(e);return t==u||t==c?e.size:r(e).length}e.exports=l},11865(e,t,n){var r=n(35393)(function(e,t,n){return e+(n?"_":"")+t.toLowerCase()});e.exports=r},70479(e){function t(){return[]}e.exports=t},95062(e){function t(){return!1}e.exports=t},14841(e,t,n){var r=n(27561),i=n(13218),a=n(33448),o=0/0,s=/^[-+]0x[0-9a-f]+$/i,u=/^0b[01]+$/i,c=/^0o[0-7]+$/i,l=parseInt;function f(e){if("number"==typeof e)return e;if(a(e))return o;if(i(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=i(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=r(e);var n=u.test(e);return n||c.test(e)?l(e.slice(2),n?2:8):s.test(e)?o:+e}e.exports=f},59881(e,t,n){var r=n(98363),i=n(81704);function a(e){return r(e,i(e))}e.exports=a},79833(e,t,n){var r=n(80531);function i(e){return null==e?"":r(e)}e.exports=i},68718(e,t,n){var r=n(77412),i=n(3118),a=n(47816),o=n(67206),s=n(85924),u=n(1469),c=n(44144),l=n(23560),f=n(13218),d=n(36719);function h(e,t,n){var h=u(e),p=h||c(e)||d(e);if(t=o(t,4),null==n){var b=e&&e.constructor;n=p?h?new b:[]:f(e)&&l(b)?i(s(e)):{}}return(p?r:a)(e,function(e,r,i){return t(n,e,r,i)}),n}e.exports=h},93386(e,t,n){var r=n(21078),i=n(5976),a=n(45652),o=n(29246),s=i(function(e){return a(r(e,1,o,!0))});e.exports=s},11700(e,t,n){var r=n(98805)("toUpperCase");e.exports=r},52628(e,t,n){var r=n(47415),i=n(3674);function a(e){return null==e?[]:r(e,i(e))}e.exports=a},58748(e,t,n){var r=n(49029),i=n(93157),a=n(79833),o=n(2757);function s(e,t,n){return(e=a(e),void 0===(t=n?void 0:t))?i(e)?o(e):r(e):e.match(t)||[]}e.exports=s},42786:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("af",{months:"Januarie_Februarie_Maart_April_Mei_Junie_Julie_Augustus_September_Oktober_November_Desember".split("_"),monthsShort:"Jan_Feb_Mrt_Apr_Mei_Jun_Jul_Aug_Sep_Okt_Nov_Des".split("_"),weekdays:"Sondag_Maandag_Dinsdag_Woensdag_Donderdag_Vrydag_Saterdag".split("_"),weekdaysShort:"Son_Maa_Din_Woe_Don_Vry_Sat".split("_"),weekdaysMin:"So_Ma_Di_Wo_Do_Vr_Sa".split("_"),meridiemParse:/vm|nm/i,isPM:function(e){return/^nm$/i.test(e)},meridiem:function(e,t,n){return e<12?n?"vm":"VM":n?"nm":"NM"},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Vandag om] LT",nextDay:"[M\xf4re om] LT",nextWeek:"dddd [om] LT",lastDay:"[Gister om] LT",lastWeek:"[Laas] dddd [om] LT",sameElse:"L"},relativeTime:{future:"oor %s",past:"%s gelede",s:"'n paar sekondes",ss:"%d sekondes",m:"'n minuut",mm:"%d minute",h:"'n uur",hh:"%d ure",d:"'n dag",dd:"%d dae",M:"'n maand",MM:"%d maande",y:"'n jaar",yy:"%d jaar"},dayOfMonthOrdinalParse:/\d{1,2}(ste|de)/,ordinal:function(e){return e+(1===e||8===e||e>=20?"ste":"de")},week:{dow:1,doy:4}})})(n(30381))},14130:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration +var t=function(e){return 0===e?0:1===e?1:2===e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5},n={s:["أقل من ثانية","ثانية واحدة",["ثانيتان","ثانيتين"],"%d ثوان","%d ثانية","%d ثانية",],m:["أقل من دقيقة","دقيقة واحدة",["دقيقتان","دقيقتين"],"%d دقائق","%d دقيقة","%d دقيقة",],h:["أقل من ساعة","ساعة واحدة",["ساعتان","ساعتين"],"%d ساعات","%d ساعة","%d ساعة",],d:["أقل من يوم","يوم واحد",["يومان","يومين"],"%d أيام","%d يومًا","%d يوم",],M:["أقل من شهر","شهر واحد",["شهران","شهرين"],"%d أشهر","%d شهرا","%d شهر",],y:["أقل من عام","عام واحد",["عامان","عامين"],"%d أعوام","%d عامًا","%d عام",]},r=function(e){return function(r,i,a,o){var s=t(r),u=n[e][t(r)];return 2===s&&(u=u[i?0:1]),u.replace(/%d/i,r)}},i=["جانفي","فيفري","مارس","أفريل","ماي","جوان","جويلية","أوت","سبتمبر","أكتوبر","نوفمبر","ديسمبر",];return e.defineLocale("ar-dz",{months:i,monthsShort:i,weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/‏M/‏YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(e){return"م"===e},meridiem:function(e,t,n){return e<12?"ص":"م"},calendar:{sameDay:"[اليوم عند الساعة] LT",nextDay:"[غدًا عند الساعة] LT",nextWeek:"dddd [عند الساعة] LT",lastDay:"[أمس عند الساعة] LT",lastWeek:"dddd [عند الساعة] LT",sameElse:"L"},relativeTime:{future:"بعد %s",past:"منذ %s",s:r("s"),ss:r("s"),m:r("m"),mm:r("m"),h:r("h"),hh:r("h"),d:r("d"),dd:r("d"),M:r("M"),MM:r("M"),y:r("y"),yy:r("y")},postformat:function(e){return e.replace(/,/g,"،")},week:{dow:0,doy:4}})})(n(30381))},96135:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("ar-kw",{months:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),weekdays:"الأحد_الإتنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"احد_اتنين_ثلاثاء_اربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",ss:"%d ثانية",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},week:{dow:0,doy:12}})})(n(30381))},56440:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration +var t={1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",0:"0"},n=function(e){return 0===e?0:1===e?1:2===e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5},r={s:["أقل من ثانية","ثانية واحدة",["ثانيتان","ثانيتين"],"%d ثوان","%d ثانية","%d ثانية",],m:["أقل من دقيقة","دقيقة واحدة",["دقيقتان","دقيقتين"],"%d دقائق","%d دقيقة","%d دقيقة",],h:["أقل من ساعة","ساعة واحدة",["ساعتان","ساعتين"],"%d ساعات","%d ساعة","%d ساعة",],d:["أقل من يوم","يوم واحد",["يومان","يومين"],"%d أيام","%d يومًا","%d يوم",],M:["أقل من شهر","شهر واحد",["شهران","شهرين"],"%d أشهر","%d شهرا","%d شهر",],y:["أقل من عام","عام واحد",["عامان","عامين"],"%d أعوام","%d عامًا","%d عام",]},i=function(e){return function(t,i,a,o){var s=n(t),u=r[e][n(t)];return 2===s&&(u=u[i?0:1]),u.replace(/%d/i,t)}},a=["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر",];return e.defineLocale("ar-ly",{months:a,monthsShort:a,weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/‏M/‏YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(e){return"م"===e},meridiem:function(e,t,n){return e<12?"ص":"م"},calendar:{sameDay:"[اليوم عند الساعة] LT",nextDay:"[غدًا عند الساعة] LT",nextWeek:"dddd [عند الساعة] LT",lastDay:"[أمس عند الساعة] LT",lastWeek:"dddd [عند الساعة] LT",sameElse:"L"},relativeTime:{future:"بعد %s",past:"منذ %s",s:i("s"),ss:i("s"),m:i("m"),mm:i("m"),h:i("h"),hh:i("h"),d:i("d"),dd:i("d"),M:i("M"),MM:i("M"),y:i("y"),yy:i("y")},preparse:function(e){return e.replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]}).replace(/,/g,"،")},week:{dow:6,doy:12}})})(n(30381))},47702:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("ar-ma",{months:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"احد_اثنين_ثلاثاء_اربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",ss:"%d ثانية",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},week:{dow:1,doy:4}})})(n(30381))},16040:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration +var t={1:"١",2:"٢",3:"٣",4:"٤",5:"٥",6:"٦",7:"٧",8:"٨",9:"٩",0:"٠"},n={"١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","٠":"0"};return e.defineLocale("ar-sa",{months:"يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(e){return"م"===e},meridiem:function(e,t,n){return e<12?"ص":"م"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",ss:"%d ثانية",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},preparse:function(e){return e.replace(/[١٢٣٤٥٦٧٨٩٠]/g,function(e){return n[e]}).replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]}).replace(/,/g,"،")},week:{dow:0,doy:6}})})(n(30381))},37100:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("ar-tn",{months:"جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),monthsShort:"جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",ss:"%d ثانية",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},week:{dow:1,doy:4}})})(n(30381))},30867:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration +var t={1:"١",2:"٢",3:"٣",4:"٤",5:"٥",6:"٦",7:"٧",8:"٨",9:"٩",0:"٠"},n={"١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","٠":"0"},r=function(e){return 0===e?0:1===e?1:2===e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5},i={s:["أقل من ثانية","ثانية واحدة",["ثانيتان","ثانيتين"],"%d ثوان","%d ثانية","%d ثانية",],m:["أقل من دقيقة","دقيقة واحدة",["دقيقتان","دقيقتين"],"%d دقائق","%d دقيقة","%d دقيقة",],h:["أقل من ساعة","ساعة واحدة",["ساعتان","ساعتين"],"%d ساعات","%d ساعة","%d ساعة",],d:["أقل من يوم","يوم واحد",["يومان","يومين"],"%d أيام","%d يومًا","%d يوم",],M:["أقل من شهر","شهر واحد",["شهران","شهرين"],"%d أشهر","%d شهرا","%d شهر",],y:["أقل من عام","عام واحد",["عامان","عامين"],"%d أعوام","%d عامًا","%d عام",]},a=function(e){return function(t,n,a,o){var s=r(t),u=i[e][r(t)];return 2===s&&(u=u[n?0:1]),u.replace(/%d/i,t)}},o=["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر",];return e.defineLocale("ar",{months:o,monthsShort:o,weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/‏M/‏YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(e){return"م"===e},meridiem:function(e,t,n){return e<12?"ص":"م"},calendar:{sameDay:"[اليوم عند الساعة] LT",nextDay:"[غدًا عند الساعة] LT",nextWeek:"dddd [عند الساعة] LT",lastDay:"[أمس عند الساعة] LT",lastWeek:"dddd [عند الساعة] LT",sameElse:"L"},relativeTime:{future:"بعد %s",past:"منذ %s",s:a("s"),ss:a("s"),m:a("m"),mm:a("m"),h:a("h"),hh:a("h"),d:a("d"),dd:a("d"),M:a("M"),MM:a("M"),y:a("y"),yy:a("y")},preparse:function(e){return e.replace(/[١٢٣٤٥٦٧٨٩٠]/g,function(e){return n[e]}).replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]}).replace(/,/g,"،")},week:{dow:6,doy:12}})})(n(30381))},31083:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration +var t={1:"-inci",5:"-inci",8:"-inci",70:"-inci",80:"-inci",2:"-nci",7:"-nci",20:"-nci",50:"-nci",3:"-\xfcnc\xfc",4:"-\xfcnc\xfc",100:"-\xfcnc\xfc",6:"-ncı",9:"-uncu",10:"-uncu",30:"-uncu",60:"-ıncı",90:"-ıncı"};return e.defineLocale("az",{months:"yanvar_fevral_mart_aprel_may_iyun_iyul_avqust_sentyabr_oktyabr_noyabr_dekabr".split("_"),monthsShort:"yan_fev_mar_apr_may_iyn_iyl_avq_sen_okt_noy_dek".split("_"),weekdays:"Bazar_Bazar ertəsi_\xc7ərşənbə axşamı_\xc7ərşənbə_C\xfcmə axşamı_C\xfcmə_Şənbə".split("_"),weekdaysShort:"Baz_BzE_\xc7Ax_\xc7ər_CAx_C\xfcm_Şən".split("_"),weekdaysMin:"Bz_BE_\xc7A_\xc7ə_CA_C\xfc_Şə".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[bug\xfcn saat] LT",nextDay:"[sabah saat] LT",nextWeek:"[gələn həftə] dddd [saat] LT",lastDay:"[d\xfcnən] LT",lastWeek:"[ke\xe7ən həftə] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s sonra",past:"%s əvvəl",s:"bir ne\xe7ə saniyə",ss:"%d saniyə",m:"bir dəqiqə",mm:"%d dəqiqə",h:"bir saat",hh:"%d saat",d:"bir g\xfcn",dd:"%d g\xfcn",M:"bir ay",MM:"%d ay",y:"bir il",yy:"%d il"},meridiemParse:/gecə|səhər|gündüz|axşam/,isPM:function(e){return/^(gündüz|axşam)$/.test(e)},meridiem:function(e,t,n){return e<4?"gecə":e<12?"səhər":e<17?"g\xfcnd\xfcz":"axşam"},dayOfMonthOrdinalParse:/\d{1,2}-(ıncı|inci|nci|üncü|ncı|uncu)/,ordinal:function(e){if(0===e)return e+"-ıncı";var n=e%10,r=e%100-n,i=e>=100?100:null;return e+(t[n]||t[r]||t[i])},week:{dow:1,doy:7}})})(n(30381))},9808:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration +function t(e,t){var n=e.split("_");return t%10==1&&t%100!=11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}function n(e,n,r){var i={ss:n?"секунда_секунды_секунд":"секунду_секунды_секунд",mm:n?"хвіліна_хвіліны_хвілін":"хвіліну_хвіліны_хвілін",hh:n?"гадзіна_гадзіны_гадзін":"гадзіну_гадзіны_гадзін",dd:"дзень_дні_дзён",MM:"месяц_месяцы_месяцаў",yy:"год_гады_гадоў"};return"m"===r?n?"хвіліна":"хвіліну":"h"===r?n?"гадзіна":"гадзіну":e+" "+t(i[r],+e)}return e.defineLocale("be",{months:{format:"студзеня_лютага_сакавіка_красавіка_траўня_чэрвеня_ліпеня_жніўня_верасня_кастрычніка_лістапада_снежня".split("_"),standalone:"студзень_люты_сакавік_красавік_травень_чэрвень_ліпень_жнівень_верасень_кастрычнік_лістапад_снежань".split("_")},monthsShort:"студ_лют_сак_крас_трав_чэрв_ліп_жнів_вер_каст_ліст_снеж".split("_"),weekdays:{format:"нядзелю_панядзелак_аўторак_сераду_чацвер_пятніцу_суботу".split("_"),standalone:"нядзеля_панядзелак_аўторак_серада_чацвер_пятніца_субота".split("_"),isFormat:/\[ ?[Ууў] ?(?:мінулую|наступную)? ?\] ?dddd/},weekdaysShort:"нд_пн_ат_ср_чц_пт_сб".split("_"),weekdaysMin:"нд_пн_ат_ср_чц_пт_сб".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., HH:mm",LLLL:"dddd, D MMMM YYYY г., HH:mm"},calendar:{sameDay:"[Сёння ў] LT",nextDay:"[Заўтра ў] LT",lastDay:"[Учора ў] LT",nextWeek:function(){return"[У] dddd [ў] LT"},lastWeek:function(){switch(this.day()){case 0:case 3:case 5:case 6:return"[У мінулую] dddd [ў] LT";case 1:case 2:case 4:return"[У мінулы] dddd [ў] LT"}},sameElse:"L"},relativeTime:{future:"праз %s",past:"%s таму",s:"некалькі секунд",m:n,mm:n,h:n,hh:n,d:"дзень",dd:n,M:"месяц",MM:n,y:"год",yy:n},meridiemParse:/ночы|раніцы|дня|вечара/,isPM:function(e){return/^(дня|вечара)$/.test(e)},meridiem:function(e,t,n){return e<4?"ночы":e<12?"раніцы":e<17?"дня":"вечара"},dayOfMonthOrdinalParse:/\d{1,2}-(і|ы|га)/,ordinal:function(e,t){switch(t){case"M":case"d":case"DDD":case"w":case"W":return(e%10==2||e%10==3)&&e%100!=12&&e%100!=13?e+"-і":e+"-ы";case"D":return e+"-га";default:return e}},week:{dow:1,doy:7}})})(n(30381))},68338:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("bg",{months:"януари_февруари_март_април_май_юни_юли_август_септември_октомври_ноември_декември".split("_"),monthsShort:"яну_фев_мар_апр_май_юни_юли_авг_сеп_окт_ное_дек".split("_"),weekdays:"неделя_понеделник_вторник_сряда_четвъртък_петък_събота".split("_"),weekdaysShort:"нед_пон_вто_сря_чет_пет_съб".split("_"),weekdaysMin:"нд_пн_вт_ср_чт_пт_сб".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[Днес в] LT",nextDay:"[Утре в] LT",nextWeek:"dddd [в] LT",lastDay:"[Вчера в] LT",lastWeek:function(){switch(this.day()){case 0:case 3:case 6:return"[Миналата] dddd [в] LT";case 1:case 2:case 4:case 5:return"[Миналия] dddd [в] LT"}},sameElse:"L"},relativeTime:{future:"след %s",past:"преди %s",s:"няколко секунди",ss:"%d секунди",m:"минута",mm:"%d минути",h:"час",hh:"%d часа",d:"ден",dd:"%d дена",w:"седмица",ww:"%d седмици",M:"месец",MM:"%d месеца",y:"година",yy:"%d години"},dayOfMonthOrdinalParse:/\d{1,2}-(ев|ен|ти|ви|ри|ми)/,ordinal:function(e){var t=e%10,n=e%100;if(0===e)return e+"-ев";if(0===n)return e+"-ен";if(n>10&&n<20)return e+"-ти";if(1===t)return e+"-ви";if(2===t)return e+"-ри";else if(7===t||8===t)return e+"-ми";else return e+"-ти"},week:{dow:1,doy:7}})})(n(30381))},67438:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("bm",{months:"Zanwuyekalo_Fewuruyekalo_Marisikalo_Awirilikalo_Mɛkalo_Zuwɛnkalo_Zuluyekalo_Utikalo_Sɛtanburukalo_ɔkutɔburukalo_Nowanburukalo_Desanburukalo".split("_"),monthsShort:"Zan_Few_Mar_Awi_Mɛ_Zuw_Zul_Uti_Sɛt_ɔku_Now_Des".split("_"),weekdays:"Kari_Ntɛnɛn_Tarata_Araba_Alamisa_Juma_Sibiri".split("_"),weekdaysShort:"Kar_Ntɛ_Tar_Ara_Ala_Jum_Sib".split("_"),weekdaysMin:"Ka_Nt_Ta_Ar_Al_Ju_Si".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"MMMM [tile] D [san] YYYY",LLL:"MMMM [tile] D [san] YYYY [lɛrɛ] HH:mm",LLLL:"dddd MMMM [tile] D [san] YYYY [lɛrɛ] HH:mm"},calendar:{sameDay:"[Bi lɛrɛ] LT",nextDay:"[Sini lɛrɛ] LT",nextWeek:"dddd [don lɛrɛ] LT",lastDay:"[Kunu lɛrɛ] LT",lastWeek:"dddd [tɛmɛnen lɛrɛ] LT",sameElse:"L"},relativeTime:{future:"%s kɔnɔ",past:"a bɛ %s bɔ",s:"sanga dama dama",ss:"sekondi %d",m:"miniti kelen",mm:"miniti %d",h:"lɛrɛ kelen",hh:"lɛrɛ %d",d:"tile kelen",dd:"tile %d",M:"kalo kelen",MM:"kalo %d",y:"san kelen",yy:"san %d"},week:{dow:1,doy:4}})})(n(30381))},76225:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration +var t={1:"১",2:"২",3:"৩",4:"৪",5:"৫",6:"৬",7:"৭",8:"৮",9:"৯",0:"০"},n={"১":"1","২":"2","৩":"3","৪":"4","৫":"5","৬":"6","৭":"7","৮":"8","৯":"9","০":"0"};return e.defineLocale("bn-bd",{months:"জানুয়ারি_ফেব্রুয়ারি_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর".split("_"),monthsShort:"জানু_ফেব্রু_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্ট_অক্টো_নভে_ডিসে".split("_"),weekdays:"রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পতিবার_শুক্রবার_শনিবার".split("_"),weekdaysShort:"রবি_সোম_মঙ্গল_বুধ_বৃহস্পতি_শুক্র_শনি".split("_"),weekdaysMin:"রবি_সোম_মঙ্গল_বুধ_বৃহ_শুক্র_শনি".split("_"),longDateFormat:{LT:"A h:mm সময়",LTS:"A h:mm:ss সময়",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm সময়",LLLL:"dddd, D MMMM YYYY, A h:mm সময়"},calendar:{sameDay:"[আজ] LT",nextDay:"[আগামীকাল] LT",nextWeek:"dddd, LT",lastDay:"[গতকাল] LT",lastWeek:"[গত] dddd, LT",sameElse:"L"},relativeTime:{future:"%s পরে",past:"%s আগে",s:"কয়েক সেকেন্ড",ss:"%d সেকেন্ড",m:"এক মিনিট",mm:"%d মিনিট",h:"এক ঘন্টা",hh:"%d ঘন্টা",d:"এক দিন",dd:"%d দিন",M:"এক মাস",MM:"%d মাস",y:"এক বছর",yy:"%d বছর"},preparse:function(e){return e.replace(/[১২৩৪৫৬৭৮৯০]/g,function(e){return n[e]})},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]})},meridiemParse:/রাত|ভোর|সকাল|দুপুর|বিকাল|সন্ধ্যা|রাত/,meridiemHour:function(e,t){if(12===e&&(e=0),"রাত"===t)return e<4?e:e+12;if("ভোর"===t)return e;if("সকাল"===t)return e;if("দুপুর"===t)return e>=3?e:e+12;if("বিকাল"===t)return e+12;else if("সন্ধ্যা"===t)return e+12},meridiem:function(e,t,n){if(e<4)return"রাত";if(e<6)return"ভোর";if(e<12)return"সকাল";if(e<15)return"দুপুর";if(e<18)return"বিকাল";else if(e<20)return"সন্ধ্যা";else return"রাত"},week:{dow:0,doy:6}})})(n(30381))},8905:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration +var t={1:"১",2:"২",3:"৩",4:"৪",5:"৫",6:"৬",7:"৭",8:"৮",9:"৯",0:"০"},n={"১":"1","২":"2","৩":"3","৪":"4","৫":"5","৬":"6","৭":"7","৮":"8","৯":"9","০":"0"};return e.defineLocale("bn",{months:"জানুয়ারি_ফেব্রুয়ারি_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর".split("_"),monthsShort:"জানু_ফেব্রু_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্ট_অক্টো_নভে_ডিসে".split("_"),weekdays:"রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পতিবার_শুক্রবার_শনিবার".split("_"),weekdaysShort:"রবি_সোম_মঙ্গল_বুধ_বৃহস্পতি_শুক্র_শনি".split("_"),weekdaysMin:"রবি_সোম_মঙ্গল_বুধ_বৃহ_শুক্র_শনি".split("_"),longDateFormat:{LT:"A h:mm সময়",LTS:"A h:mm:ss সময়",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm সময়",LLLL:"dddd, D MMMM YYYY, A h:mm সময়"},calendar:{sameDay:"[আজ] LT",nextDay:"[আগামীকাল] LT",nextWeek:"dddd, LT",lastDay:"[গতকাল] LT",lastWeek:"[গত] dddd, LT",sameElse:"L"},relativeTime:{future:"%s পরে",past:"%s আগে",s:"কয়েক সেকেন্ড",ss:"%d সেকেন্ড",m:"এক মিনিট",mm:"%d মিনিট",h:"এক ঘন্টা",hh:"%d ঘন্টা",d:"এক দিন",dd:"%d দিন",M:"এক মাস",MM:"%d মাস",y:"এক বছর",yy:"%d বছর"},preparse:function(e){return e.replace(/[১২৩৪৫৬৭৮৯০]/g,function(e){return n[e]})},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]})},meridiemParse:/রাত|সকাল|দুপুর|বিকাল|রাত/,meridiemHour:function(e,t){return(12===e&&(e=0),"রাত"===t&&e>=4||"দুপুর"===t&&e<5||"বিকাল"===t)?e+12:e},meridiem:function(e,t,n){return e<4?"রাত":e<10?"সকাল":e<17?"দুপুর":e<20?"বিকাল":"রাত"},week:{dow:0,doy:6}})})(n(30381))},11560:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration +var t={1:"༡",2:"༢",3:"༣",4:"༤",5:"༥",6:"༦",7:"༧",8:"༨",9:"༩",0:"༠"},n={"༡":"1","༢":"2","༣":"3","༤":"4","༥":"5","༦":"6","༧":"7","༨":"8","༩":"9","༠":"0"};return e.defineLocale("bo",{months:"ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ".split("_"),monthsShort:"ཟླ་1_ཟླ་2_ཟླ་3_ཟླ་4_ཟླ་5_ཟླ་6_ཟླ་7_ཟླ་8_ཟླ་9_ཟླ་10_ཟླ་11_ཟླ་12".split("_"),monthsShortRegex:/^(ཟླ་\d{1,2})/,monthsParseExact:!0,weekdays:"གཟའ་ཉི་མ་_གཟའ་ཟླ་བ་_གཟའ་མིག་དམར་_གཟའ་ལྷག་པ་_གཟའ་ཕུར་བུ_གཟའ་པ་སངས་_གཟའ་སྤེན་པ་".split("_"),weekdaysShort:"ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་".split("_"),weekdaysMin:"ཉི_ཟླ_མིག_ལྷག_ཕུར_སངས_སྤེན".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},calendar:{sameDay:"[དི་རིང] LT",nextDay:"[སང་ཉིན] LT",nextWeek:"[བདུན་ཕྲག་རྗེས་མ], LT",lastDay:"[ཁ་སང] LT",lastWeek:"[བདུན་ཕྲག་མཐའ་མ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s ལ་",past:"%s སྔན་ལ",s:"ལམ་སང",ss:"%d སྐར་ཆ།",m:"སྐར་མ་གཅིག",mm:"%d སྐར་མ",h:"ཆུ་ཚོད་གཅིག",hh:"%d ཆུ་ཚོད",d:"ཉིན་གཅིག",dd:"%d ཉིན་",M:"ཟླ་བ་གཅིག",MM:"%d ཟླ་བ",y:"ལོ་གཅིག",yy:"%d ལོ"},preparse:function(e){return e.replace(/[༡༢༣༤༥༦༧༨༩༠]/g,function(e){return n[e]})},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]})},meridiemParse:/མཚན་མོ|ཞོགས་ཀས|ཉིན་གུང|དགོང་དག|མཚན་མོ/,meridiemHour:function(e,t){return(12===e&&(e=0),"མཚན་མོ"===t&&e>=4||"ཉིན་གུང"===t&&e<5||"དགོང་དག"===t)?e+12:e},meridiem:function(e,t,n){return e<4?"མཚན་མོ":e<10?"ཞོགས་ཀས":e<17?"ཉིན་གུང":e<20?"དགོང་དག":"མཚན་མོ"},week:{dow:0,doy:6}})})(n(30381))},1278:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration +function t(e,t,n){return e+" "+i({mm:"munutenn",MM:"miz",dd:"devezh"}[n],e)}function n(e){switch(r(e)){case 1:case 3:case 4:case 5:case 9:return e+" bloaz";default:return e+" vloaz"}}function r(e){return e>9?r(e%10):e}function i(e,t){return 2===t?a(e):e}function a(e){var t={m:"v",b:"v",d:"z"};return void 0===t[e.charAt(0)]?e:t[e.charAt(0)]+e.substring(1)}var o=[/^gen/i,/^c[ʼ\']hwe/i,/^meu/i,/^ebr/i,/^mae/i,/^(mez|eve)/i,/^gou/i,/^eos/i,/^gwe/i,/^her/i,/^du/i,/^ker/i,],s=/^(genver|c[ʼ\']hwevrer|meurzh|ebrel|mae|mezheven|gouere|eost|gwengolo|here|du|kerzu|gen|c[ʼ\']hwe|meu|ebr|mae|eve|gou|eos|gwe|her|du|ker)/i,u=/^(genver|c[ʼ\']hwevrer|meurzh|ebrel|mae|mezheven|gouere|eost|gwengolo|here|du|kerzu)/i,c=/^(gen|c[ʼ\']hwe|meu|ebr|mae|eve|gou|eos|gwe|her|du|ker)/i,l=[/^sul/i,/^lun/i,/^meurzh/i,/^merc[ʼ\']her/i,/^yaou/i,/^gwener/i,/^sadorn/i,],f=[/^Sul/i,/^Lun/i,/^Meu/i,/^Mer/i,/^Yao/i,/^Gwe/i,/^Sad/i,],d=[/^Su/i,/^Lu/i,/^Me([^r]|$)/i,/^Mer/i,/^Ya/i,/^Gw/i,/^Sa/i,];return e.defineLocale("br",{months:"Genver_Cʼhwevrer_Meurzh_Ebrel_Mae_Mezheven_Gouere_Eost_Gwengolo_Here_Du_Kerzu".split("_"),monthsShort:"Gen_Cʼhwe_Meu_Ebr_Mae_Eve_Gou_Eos_Gwe_Her_Du_Ker".split("_"),weekdays:"Sul_Lun_Meurzh_Mercʼher_Yaou_Gwener_Sadorn".split("_"),weekdaysShort:"Sul_Lun_Meu_Mer_Yao_Gwe_Sad".split("_"),weekdaysMin:"Su_Lu_Me_Mer_Ya_Gw_Sa".split("_"),weekdaysParse:d,fullWeekdaysParse:l,shortWeekdaysParse:f,minWeekdaysParse:d,monthsRegex:s,monthsShortRegex:s,monthsStrictRegex:u,monthsShortStrictRegex:c,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [a viz] MMMM YYYY",LLL:"D [a viz] MMMM YYYY HH:mm",LLLL:"dddd, D [a viz] MMMM YYYY HH:mm"},calendar:{sameDay:"[Hiziv da] LT",nextDay:"[Warcʼhoazh da] LT",nextWeek:"dddd [da] LT",lastDay:"[Decʼh da] LT",lastWeek:"dddd [paset da] LT",sameElse:"L"},relativeTime:{future:"a-benn %s",past:"%s ʼzo",s:"un nebeud segondenno\xf9",ss:"%d eilenn",m:"ur vunutenn",mm:t,h:"un eur",hh:"%d eur",d:"un devezh",dd:t,M:"ur miz",MM:t,y:"ur bloaz",yy:n},dayOfMonthOrdinalParse:/\d{1,2}(añ|vet)/,ordinal:function(e){var t=1===e?"a\xf1":"vet";return e+t},week:{dow:1,doy:4},meridiemParse:/a.m.|g.m./,isPM:function(e){return"g.m."===e},meridiem:function(e,t,n){return e<12?"a.m.":"g.m."}})})(n(30381))},80622:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration +function t(e,t,n){var r=e+" ";switch(n){case"ss":return 1===e?r+="sekunda":2===e||3===e||4===e?r+="sekunde":r+="sekundi",r;case"m":return t?"jedna minuta":"jedne minute";case"mm":return 1===e?r+="minuta":2===e||3===e||4===e?r+="minute":r+="minuta",r;case"h":return t?"jedan sat":"jednog sata";case"hh":return 1===e?r+="sat":2===e||3===e||4===e?r+="sata":r+="sati",r;case"dd":return 1===e?r+="dan":r+="dana",r;case"MM":return 1===e?r+="mjesec":2===e||3===e||4===e?r+="mjeseca":r+="mjeseci",r;case"yy":return 1===e?r+="godina":2===e||3===e||4===e?r+="godine":r+="godina",r}}return e.defineLocale("bs",{months:"januar_februar_mart_april_maj_juni_juli_august_septembar_oktobar_novembar_decembar".split("_"),monthsShort:"jan._feb._mar._apr._maj._jun._jul._aug._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[jučer u] LT",lastWeek:function(){switch(this.day()){case 0:case 3:return"[prošlu] dddd [u] LT";case 6:return"[prošle] [subote] [u] LT";case 1:case 2:case 4:case 5:return"[prošli] dddd [u] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"par sekundi",ss:t,m:t,mm:t,h:t,hh:t,d:"dan",dd:t,M:"mjesec",MM:t,y:"godinu",yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})})(n(30381))},2468:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("ca",{months:{standalone:"gener_febrer_mar\xe7_abril_maig_juny_juliol_agost_setembre_octubre_novembre_desembre".split("_"),format:"de gener_de febrer_de mar\xe7_d'abril_de maig_de juny_de juliol_d'agost_de setembre_d'octubre_de novembre_de desembre".split("_"),isFormat:/D[oD]?(\s)+MMMM/},monthsShort:"gen._febr._mar\xe7_abr._maig_juny_jul._ag._set._oct._nov._des.".split("_"),monthsParseExact:!0,weekdays:"diumenge_dilluns_dimarts_dimecres_dijous_divendres_dissabte".split("_"),weekdaysShort:"dg._dl._dt._dc._dj._dv._ds.".split("_"),weekdaysMin:"dg_dl_dt_dc_dj_dv_ds".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM [de] YYYY",ll:"D MMM YYYY",LLL:"D MMMM [de] YYYY [a les] H:mm",lll:"D MMM YYYY, H:mm",LLLL:"dddd D MMMM [de] YYYY [a les] H:mm",llll:"ddd D MMM YYYY, H:mm"},calendar:{sameDay:function(){return"[avui a "+(1!==this.hours()?"les":"la")+"] LT"},nextDay:function(){return"[dem\xe0 a "+(1!==this.hours()?"les":"la")+"] LT"},nextWeek:function(){return"dddd [a "+(1!==this.hours()?"les":"la")+"] LT"},lastDay:function(){return"[ahir a "+(1!==this.hours()?"les":"la")+"] LT"},lastWeek:function(){return"[el] dddd [passat a "+(1!==this.hours()?"les":"la")+"] LT"},sameElse:"L"},relativeTime:{future:"d'aqu\xed %s",past:"fa %s",s:"uns segons",ss:"%d segons",m:"un minut",mm:"%d minuts",h:"una hora",hh:"%d hores",d:"un dia",dd:"%d dies",M:"un mes",MM:"%d mesos",y:"un any",yy:"%d anys"},dayOfMonthOrdinalParse:/\d{1,2}(r|n|t|è|a)/,ordinal:function(e,t){var n=1===e?"r":2===e?"n":3===e?"r":4===e?"t":"\xe8";return("w"===t||"W"===t)&&(n="a"),e+n},week:{dow:1,doy:4}})})(n(30381))},5822:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration +var t="leden_\xfanor_březen_duben_květen_červen_červenec_srpen_z\xe1ř\xed_ř\xedjen_listopad_prosinec".split("_"),n="led_\xfano_bře_dub_kvě_čvn_čvc_srp_z\xe1ř_ř\xedj_lis_pro".split("_"),r=[/^led/i,/^úno/i,/^bře/i,/^dub/i,/^kvě/i,/^(čvn|červen$|června)/i,/^(čvc|červenec|července)/i,/^srp/i,/^zář/i,/^říj/i,/^lis/i,/^pro/i,],i=/^(leden|únor|březen|duben|květen|červenec|července|červen|června|srpen|září|říjen|listopad|prosinec|led|úno|bře|dub|kvě|čvn|čvc|srp|zář|říj|lis|pro)/i;function a(e){return e>1&&e<5&&1!=~~(e/10)}function o(e,t,n,r){var i=e+" ";switch(n){case"s":return t||r?"p\xe1r sekund":"p\xe1r sekundami";case"ss":if(t||r)return i+(a(e)?"sekundy":"sekund");return i+"sekundami";case"m":return t?"minuta":r?"minutu":"minutou";case"mm":if(t||r)return i+(a(e)?"minuty":"minut");return i+"minutami";case"h":return t?"hodina":r?"hodinu":"hodinou";case"hh":if(t||r)return i+(a(e)?"hodiny":"hodin");return i+"hodinami";case"d":return t||r?"den":"dnem";case"dd":if(t||r)return i+(a(e)?"dny":"dn\xed");return i+"dny";case"M":return t||r?"měs\xedc":"měs\xedcem";case"MM":if(t||r)return i+(a(e)?"měs\xedce":"měs\xedců");return i+"měs\xedci";case"y":return t||r?"rok":"rokem";case"yy":if(t||r)return i+(a(e)?"roky":"let");return i+"lety"}}return e.defineLocale("cs",{months:t,monthsShort:n,monthsRegex:i,monthsShortRegex:i,monthsStrictRegex:/^(leden|ledna|února|únor|březen|března|duben|dubna|květen|května|červenec|července|červen|června|srpen|srpna|září|říjen|října|listopadu|listopad|prosinec|prosince)/i,monthsShortStrictRegex:/^(led|úno|bře|dub|kvě|čvn|čvc|srp|zář|říj|lis|pro)/i,monthsParse:r,longMonthsParse:r,shortMonthsParse:r,weekdays:"neděle_ponděl\xed_\xfater\xfd_středa_čtvrtek_p\xe1tek_sobota".split("_"),weekdaysShort:"ne_po_\xfat_st_čt_p\xe1_so".split("_"),weekdaysMin:"ne_po_\xfat_st_čt_p\xe1_so".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd D. MMMM YYYY H:mm",l:"D. M. YYYY"},calendar:{sameDay:"[dnes v] LT",nextDay:"[z\xedtra v] LT",nextWeek:function(){switch(this.day()){case 0:return"[v neděli v] LT";case 1:case 2:return"[v] dddd [v] LT";case 3:return"[ve středu v] LT";case 4:return"[ve čtvrtek v] LT";case 5:return"[v p\xe1tek v] LT";case 6:return"[v sobotu v] LT"}},lastDay:"[včera v] LT",lastWeek:function(){switch(this.day()){case 0:return"[minulou neděli v] LT";case 1:case 2:return"[minul\xe9] dddd [v] LT";case 3:return"[minulou středu v] LT";case 4:case 5:return"[minul\xfd] dddd [v] LT";case 6:return"[minulou sobotu v] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"před %s",s:o,ss:o,m:o,mm:o,h:o,hh:o,d:o,dd:o,M:o,MM:o,y:o,yy:o},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})})(n(30381))},50877:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("cv",{months:"кӑрлач_нарӑс_пуш_ака_май_ҫӗртме_утӑ_ҫурла_авӑн_юпа_чӳк_раштав".split("_"),monthsShort:"кӑр_нар_пуш_ака_май_ҫӗр_утӑ_ҫур_авн_юпа_чӳк_раш".split("_"),weekdays:"вырсарникун_тунтикун_ытларикун_юнкун_кӗҫнерникун_эрнекун_шӑматкун".split("_"),weekdaysShort:"выр_тун_ытл_юн_кӗҫ_эрн_шӑм".split("_"),weekdaysMin:"вр_тн_ыт_юн_кҫ_эр_шм".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ]",LLL:"YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm",LLLL:"dddd, YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm"},calendar:{sameDay:"[Паян] LT [сехетре]",nextDay:"[Ыран] LT [сехетре]",lastDay:"[Ӗнер] LT [сехетре]",nextWeek:"[Ҫитес] dddd LT [сехетре]",lastWeek:"[Иртнӗ] dddd LT [сехетре]",sameElse:"L"},relativeTime:{future:function(e){var t=/сехет$/i.exec(e)?"рен":/ҫул$/i.exec(e)?"тан":"ран";return e+t},past:"%s каялла",s:"пӗр-ик ҫеккунт",ss:"%d ҫеккунт",m:"пӗр минут",mm:"%d минут",h:"пӗр сехет",hh:"%d сехет",d:"пӗр кун",dd:"%d кун",M:"пӗр уйӑх",MM:"%d уйӑх",y:"пӗр ҫул",yy:"%d ҫул"},dayOfMonthOrdinalParse:/\d{1,2}-мӗш/,ordinal:"%d-мӗш",week:{dow:1,doy:7}})})(n(30381))},47373:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("cy",{months:"Ionawr_Chwefror_Mawrth_Ebrill_Mai_Mehefin_Gorffennaf_Awst_Medi_Hydref_Tachwedd_Rhagfyr".split("_"),monthsShort:"Ion_Chwe_Maw_Ebr_Mai_Meh_Gor_Aws_Med_Hyd_Tach_Rhag".split("_"),weekdays:"Dydd Sul_Dydd Llun_Dydd Mawrth_Dydd Mercher_Dydd Iau_Dydd Gwener_Dydd Sadwrn".split("_"),weekdaysShort:"Sul_Llun_Maw_Mer_Iau_Gwe_Sad".split("_"),weekdaysMin:"Su_Ll_Ma_Me_Ia_Gw_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Heddiw am] LT",nextDay:"[Yfory am] LT",nextWeek:"dddd [am] LT",lastDay:"[Ddoe am] LT",lastWeek:"dddd [diwethaf am] LT",sameElse:"L"},relativeTime:{future:"mewn %s",past:"%s yn \xf4l",s:"ychydig eiliadau",ss:"%d eiliad",m:"munud",mm:"%d munud",h:"awr",hh:"%d awr",d:"diwrnod",dd:"%d diwrnod",M:"mis",MM:"%d mis",y:"blwyddyn",yy:"%d flynedd"},dayOfMonthOrdinalParse:/\d{1,2}(fed|ain|af|il|ydd|ed|eg)/,ordinal:function(e){var t=e,n="",r=["","af","il","ydd","ydd","ed","ed","ed","fed","fed","fed","eg","fed","eg","eg","fed","eg","eg","fed","eg","fed"];return t>20?n=40===t||50===t||60===t||80===t||100===t?"fed":"ain":t>0&&(n=r[t]),e+n},week:{dow:1,doy:4}})})(n(30381))},24780:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("da",{months:"januar_februar_marts_april_maj_juni_juli_august_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"),weekdays:"s\xf8ndag_mandag_tirsdag_onsdag_torsdag_fredag_l\xf8rdag".split("_"),weekdaysShort:"s\xf8n_man_tir_ons_tor_fre_l\xf8r".split("_"),weekdaysMin:"s\xf8_ma_ti_on_to_fr_l\xf8".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd [d.] D. MMMM YYYY [kl.] HH:mm"},calendar:{sameDay:"[i dag kl.] LT",nextDay:"[i morgen kl.] LT",nextWeek:"p\xe5 dddd [kl.] LT",lastDay:"[i g\xe5r kl.] LT",lastWeek:"[i] dddd[s kl.] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"%s siden",s:"f\xe5 sekunder",ss:"%d sekunder",m:"et minut",mm:"%d minutter",h:"en time",hh:"%d timer",d:"en dag",dd:"%d dage",M:"en m\xe5ned",MM:"%d m\xe5neder",y:"et \xe5r",yy:"%d \xe5r"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})})(n(30381))},60217:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration +function t(e,t,n,r){var i={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[e+" Tage",e+" Tagen"],w:["eine Woche","einer Woche"],M:["ein Monat","einem Monat"],MM:[e+" Monate",e+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[e+" Jahre",e+" Jahren"]};return t?i[n][0]:i[n][1]}return e.defineLocale("de-at",{months:"J\xe4nner_Februar_M\xe4rz_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"J\xe4n._Feb._M\xe4rz_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[heute um] LT [Uhr]",sameElse:"L",nextDay:"[morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",ss:"%d Sekunden",m:t,mm:"%d Minuten",h:t,hh:"%d Stunden",d:t,dd:t,w:t,ww:"%d Wochen",M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})})(n(30381))},60894:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration +function t(e,t,n,r){var i={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[e+" Tage",e+" Tagen"],w:["eine Woche","einer Woche"],M:["ein Monat","einem Monat"],MM:[e+" Monate",e+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[e+" Jahre",e+" Jahren"]};return t?i[n][0]:i[n][1]}return e.defineLocale("de-ch",{months:"Januar_Februar_M\xe4rz_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Feb._M\xe4rz_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[heute um] LT [Uhr]",sameElse:"L",nextDay:"[morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",ss:"%d Sekunden",m:t,mm:"%d Minuten",h:t,hh:"%d Stunden",d:t,dd:t,w:t,ww:"%d Wochen",M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})})(n(30381))},59740:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration +function t(e,t,n,r){var i={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[e+" Tage",e+" Tagen"],w:["eine Woche","einer Woche"],M:["ein Monat","einem Monat"],MM:[e+" Monate",e+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[e+" Jahre",e+" Jahren"]};return t?i[n][0]:i[n][1]}return e.defineLocale("de",{months:"Januar_Februar_M\xe4rz_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Feb._M\xe4rz_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[heute um] LT [Uhr]",sameElse:"L",nextDay:"[morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",ss:"%d Sekunden",m:t,mm:"%d Minuten",h:t,hh:"%d Stunden",d:t,dd:t,w:t,ww:"%d Wochen",M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})})(n(30381))},5300:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration +var t=["ޖެނުއަރީ","ފެބްރުއަރީ","މާރިޗު","އޭޕްރީލު","މޭ","ޖޫން","ޖުލައި","އޯގަސްޓު","ސެޕްޓެމްބަރު","އޮކްޓޯބަރު","ނޮވެމްބަރު","ޑިސެމްބަރު",],n=["އާދިއްތަ","ހޯމަ","އަންގާރަ","ބުދަ","ބުރާސްފަތި","ހުކުރު","ހޮނިހިރު",];return e.defineLocale("dv",{months:t,monthsShort:t,weekdays:n,weekdaysShort:n,weekdaysMin:"އާދި_ހޯމަ_އަން_ބުދަ_ބުރާ_ހުކު_ހޮނި".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/M/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/މކ|މފ/,isPM:function(e){return"މފ"===e},meridiem:function(e,t,n){return e<12?"މކ":"މފ"},calendar:{sameDay:"[މިއަދު] LT",nextDay:"[މާދަމާ] LT",nextWeek:"dddd LT",lastDay:"[އިއްޔެ] LT",lastWeek:"[ފާއިތުވި] dddd LT",sameElse:"L"},relativeTime:{future:"ތެރޭގައި %s",past:"ކުރިން %s",s:"ސިކުންތުކޮޅެއް",ss:"d% ސިކުންތު",m:"މިނިޓެއް",mm:"މިނިޓު %d",h:"ގަޑިއިރެއް",hh:"ގަޑިއިރު %d",d:"ދުވަހެއް",dd:"ދުވަސް %d",M:"މަހެއް",MM:"މަސް %d",y:"އަހަރެއް",yy:"އަހަރު %d"},preparse:function(e){return e.replace(/،/g,",")},postformat:function(e){return e.replace(/,/g,"،")},week:{dow:7,doy:12}})})(n(30381))},50837:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration +function t(e){return"undefined"!=typeof Function&&e instanceof Function||"[object Function]"===Object.prototype.toString.call(e)}return e.defineLocale("el",{monthsNominativeEl:"Ιανουάριος_Φεβρουάριος_Μάρτιος_Απρίλιος_Μάιος_Ιούνιος_Ιούλιος_Αύγουστος_Σεπτέμβριος_Οκτώβριος_Νοέμβριος_Δεκέμβριος".split("_"),monthsGenitiveEl:"Ιανουαρίου_Φεβρουαρίου_Μαρτίου_Απριλίου_Μαΐου_Ιουνίου_Ιουλίου_Αυγούστου_Σεπτεμβρίου_Οκτωβρίου_Νοεμβρίου_Δεκεμβρίου".split("_"),months:function(e,t){return e?"string"==typeof t&&/D/.test(t.substring(0,t.indexOf("MMMM")))?this._monthsGenitiveEl[e.month()]:this._monthsNominativeEl[e.month()]:this._monthsNominativeEl},monthsShort:"Ιαν_Φεβ_Μαρ_Απρ_Μαϊ_Ιουν_Ιουλ_Αυγ_Σεπ_Οκτ_Νοε_Δεκ".split("_"),weekdays:"Κυριακή_Δευτέρα_Τρίτη_Τετάρτη_Πέμπτη_Παρασκευή_Σάββατο".split("_"),weekdaysShort:"Κυρ_Δευ_Τρι_Τετ_Πεμ_Παρ_Σαβ".split("_"),weekdaysMin:"Κυ_Δε_Τρ_Τε_Πε_Πα_Σα".split("_"),meridiem:function(e,t,n){return e>11?n?"μμ":"ΜΜ":n?"πμ":"ΠΜ"},isPM:function(e){return"μ"===(e+"").toLowerCase()[0]},meridiemParse:/[ΠΜ]\.?Μ?\.?/i,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendarEl:{sameDay:"[Σήμερα {}] LT",nextDay:"[Αύριο {}] LT",nextWeek:"dddd [{}] LT",lastDay:"[Χθες {}] LT",lastWeek:function(){return 6===this.day()?"[το προηγούμενο] dddd [{}] LT":"[την προηγούμενη] dddd [{}] LT"},sameElse:"L"},calendar:function(e,n){var r=this._calendarEl[e],i=n&&n.hours();return t(r)&&(r=r.apply(n)),r.replace("{}",i%12==1?"στη":"στις")},relativeTime:{future:"σε %s",past:"%s πριν",s:"λίγα δευτερόλεπτα",ss:"%d δευτερόλεπτα",m:"ένα λεπτό",mm:"%d λεπτά",h:"μία ώρα",hh:"%d ώρες",d:"μία μέρα",dd:"%d μέρες",M:"ένας μήνας",MM:"%d μήνες",y:"ένας χρόνος",yy:"%d χρόνια"},dayOfMonthOrdinalParse:/\d{1,2}η/,ordinal:"%dη",week:{dow:1,doy:4}})})(n(30381))},78348:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("en-au",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10,n=1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th";return e+n},week:{dow:0,doy:4}})})(n(30381))},77925:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("en-ca",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"YYYY-MM-DD",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10,n=1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th";return e+n}})})(n(30381))},22243:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("en-gb",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10,n=1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th";return e+n},week:{dow:1,doy:4}})})(n(30381))},46436:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("en-ie",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10,n=1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th";return e+n},week:{dow:1,doy:4}})})(n(30381))},47207:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("en-il",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10,n=1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th";return e+n}})})(n(30381))},44175:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("en-in",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10,n=1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th";return e+n},week:{dow:0,doy:6}})})(n(30381))},76319:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("en-nz",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10,n=1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th";return e+n},week:{dow:1,doy:4}})})(n(30381))},31662:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("en-sg",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10,n=1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th";return e+n},week:{dow:1,doy:4}})})(n(30381))},92915:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("eo",{months:"januaro_februaro_marto_aprilo_majo_junio_julio_aŭgusto_septembro_oktobro_novembro_decembro".split("_"),monthsShort:"jan_feb_mart_apr_maj_jun_jul_aŭg_sept_okt_nov_dec".split("_"),weekdays:"dimanĉo_lundo_mardo_merkredo_ĵaŭdo_vendredo_sabato".split("_"),weekdaysShort:"dim_lun_mard_merk_ĵaŭ_ven_sab".split("_"),weekdaysMin:"di_lu_ma_me_ĵa_ve_sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"[la] D[-an de] MMMM, YYYY",LLL:"[la] D[-an de] MMMM, YYYY HH:mm",LLLL:"dddd[n], [la] D[-an de] MMMM, YYYY HH:mm",llll:"ddd, [la] D[-an de] MMM, YYYY HH:mm"},meridiemParse:/[ap]\.t\.m/i,isPM:function(e){return"p"===e.charAt(0).toLowerCase()},meridiem:function(e,t,n){return e>11?n?"p.t.m.":"P.T.M.":n?"a.t.m.":"A.T.M."},calendar:{sameDay:"[Hodiaŭ je] LT",nextDay:"[Morgaŭ je] LT",nextWeek:"dddd[n je] LT",lastDay:"[Hieraŭ je] LT",lastWeek:"[pasintan] dddd[n je] LT",sameElse:"L"},relativeTime:{future:"post %s",past:"antaŭ %s",s:"kelkaj sekundoj",ss:"%d sekundoj",m:"unu minuto",mm:"%d minutoj",h:"unu horo",hh:"%d horoj",d:"unu tago",dd:"%d tagoj",M:"unu monato",MM:"%d monatoj",y:"unu jaro",yy:"%d jaroj"},dayOfMonthOrdinalParse:/\d{1,2}a/,ordinal:"%da",week:{dow:1,doy:7}})})(n(30381))},55251:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration +var t="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),n="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),r=[/^ene/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i,],i=/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;return e.defineLocale("es-do",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(e,r){return e?/-MMM-/.test(r)?n[e.month()]:t[e.month()]:t},monthsRegex:i,monthsShortRegex:i,monthsStrictRegex:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,monthsShortStrictRegex:/^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,monthsParse:r,longMonthsParse:r,shortMonthsParse:r,weekdays:"domingo_lunes_martes_mi\xe9rcoles_jueves_viernes_s\xe1bado".split("_"),weekdaysShort:"dom._lun._mar._mi\xe9._jue._vie._s\xe1b.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_s\xe1".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY h:mm A",LLLL:"dddd, D [de] MMMM [de] YYYY h:mm A"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[ma\xf1ana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un d\xeda",dd:"%d d\xedas",w:"una semana",ww:"%d semanas",M:"un mes",MM:"%d meses",y:"un a\xf1o",yy:"%d a\xf1os"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%d\xba",week:{dow:1,doy:4}})})(n(30381))},96112:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration +var t="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),n="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),r=[/^ene/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i,],i=/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;return e.defineLocale("es-mx",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(e,r){return e?/-MMM-/.test(r)?n[e.month()]:t[e.month()]:t},monthsRegex:i,monthsShortRegex:i,monthsStrictRegex:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,monthsShortStrictRegex:/^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,monthsParse:r,longMonthsParse:r,shortMonthsParse:r,weekdays:"domingo_lunes_martes_mi\xe9rcoles_jueves_viernes_s\xe1bado".split("_"),weekdaysShort:"dom._lun._mar._mi\xe9._jue._vie._s\xe1b.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_s\xe1".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[ma\xf1ana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un d\xeda",dd:"%d d\xedas",w:"una semana",ww:"%d semanas",M:"un mes",MM:"%d meses",y:"un a\xf1o",yy:"%d a\xf1os"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%d\xba",week:{dow:0,doy:4},invalidDate:"Fecha inv\xe1lida"})})(n(30381))},71146:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration +var t="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),n="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),r=[/^ene/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i,],i=/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;return e.defineLocale("es-us",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(e,r){return e?/-MMM-/.test(r)?n[e.month()]:t[e.month()]:t},monthsRegex:i,monthsShortRegex:i,monthsStrictRegex:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,monthsShortStrictRegex:/^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,monthsParse:r,longMonthsParse:r,shortMonthsParse:r,weekdays:"domingo_lunes_martes_mi\xe9rcoles_jueves_viernes_s\xe1bado".split("_"),weekdaysShort:"dom._lun._mar._mi\xe9._jue._vie._s\xe1b.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_s\xe1".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"MM/DD/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY h:mm A",LLLL:"dddd, D [de] MMMM [de] YYYY h:mm A"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[ma\xf1ana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un d\xeda",dd:"%d d\xedas",w:"una semana",ww:"%d semanas",M:"un mes",MM:"%d meses",y:"un a\xf1o",yy:"%d a\xf1os"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%d\xba",week:{dow:0,doy:6}})})(n(30381))},55655:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration +var t="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),n="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),r=[/^ene/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i,],i=/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;return e.defineLocale("es",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(e,r){return e?/-MMM-/.test(r)?n[e.month()]:t[e.month()]:t},monthsRegex:i,monthsShortRegex:i,monthsStrictRegex:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,monthsShortStrictRegex:/^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,monthsParse:r,longMonthsParse:r,shortMonthsParse:r,weekdays:"domingo_lunes_martes_mi\xe9rcoles_jueves_viernes_s\xe1bado".split("_"),weekdaysShort:"dom._lun._mar._mi\xe9._jue._vie._s\xe1b.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_s\xe1".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[ma\xf1ana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un d\xeda",dd:"%d d\xedas",w:"una semana",ww:"%d semanas",M:"un mes",MM:"%d meses",y:"un a\xf1o",yy:"%d a\xf1os"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%d\xba",week:{dow:1,doy:4},invalidDate:"Fecha inv\xe1lida"})})(n(30381))},5603:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration +function t(e,t,n,r){var i={s:["m\xf5ne sekundi","m\xf5ni sekund","paar sekundit"],ss:[e+"sekundi",e+"sekundit"],m:["\xfche minuti","\xfcks minut"],mm:[e+" minuti",e+" minutit"],h:["\xfche tunni","tund aega","\xfcks tund"],hh:[e+" tunni",e+" tundi"],d:["\xfche p\xe4eva","\xfcks p\xe4ev"],M:["kuu aja","kuu aega","\xfcks kuu"],MM:[e+" kuu",e+" kuud"],y:["\xfche aasta","aasta","\xfcks aasta"],yy:[e+" aasta",e+" aastat"]};return t?i[n][2]?i[n][2]:i[n][1]:r?i[n][0]:i[n][1]}return e.defineLocale("et",{months:"jaanuar_veebruar_m\xe4rts_aprill_mai_juuni_juuli_august_september_oktoober_november_detsember".split("_"),monthsShort:"jaan_veebr_m\xe4rts_apr_mai_juuni_juuli_aug_sept_okt_nov_dets".split("_"),weekdays:"p\xfchap\xe4ev_esmasp\xe4ev_teisip\xe4ev_kolmap\xe4ev_neljap\xe4ev_reede_laup\xe4ev".split("_"),weekdaysShort:"P_E_T_K_N_R_L".split("_"),weekdaysMin:"P_E_T_K_N_R_L".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[T\xe4na,] LT",nextDay:"[Homme,] LT",nextWeek:"[J\xe4rgmine] dddd LT",lastDay:"[Eile,] LT",lastWeek:"[Eelmine] dddd LT",sameElse:"L"},relativeTime:{future:"%s p\xe4rast",past:"%s tagasi",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:"%d p\xe4eva",M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})})(n(30381))},77763:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("eu",{months:"urtarrila_otsaila_martxoa_apirila_maiatza_ekaina_uztaila_abuztua_iraila_urria_azaroa_abendua".split("_"),monthsShort:"urt._ots._mar._api._mai._eka._uzt._abu._ira._urr._aza._abe.".split("_"),monthsParseExact:!0,weekdays:"igandea_astelehena_asteartea_asteazkena_osteguna_ostirala_larunbata".split("_"),weekdaysShort:"ig._al._ar._az._og._ol._lr.".split("_"),weekdaysMin:"ig_al_ar_az_og_ol_lr".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY[ko] MMMM[ren] D[a]",LLL:"YYYY[ko] MMMM[ren] D[a] HH:mm",LLLL:"dddd, YYYY[ko] MMMM[ren] D[a] HH:mm",l:"YYYY-M-D",ll:"YYYY[ko] MMM D[a]",lll:"YYYY[ko] MMM D[a] HH:mm",llll:"ddd, YYYY[ko] MMM D[a] HH:mm"},calendar:{sameDay:"[gaur] LT[etan]",nextDay:"[bihar] LT[etan]",nextWeek:"dddd LT[etan]",lastDay:"[atzo] LT[etan]",lastWeek:"[aurreko] dddd LT[etan]",sameElse:"L"},relativeTime:{future:"%s barru",past:"duela %s",s:"segundo batzuk",ss:"%d segundo",m:"minutu bat",mm:"%d minutu",h:"ordu bat",hh:"%d ordu",d:"egun bat",dd:"%d egun",M:"hilabete bat",MM:"%d hilabete",y:"urte bat",yy:"%d urte"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})})(n(30381))},76959:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration +var t={1:"۱",2:"۲",3:"۳",4:"۴",5:"۵",6:"۶",7:"۷",8:"۸",9:"۹",0:"۰"},n={"۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9","۰":"0"};return e.defineLocale("fa",{months:"ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"),monthsShort:"ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"),weekdays:"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_جمعه_شنبه".split("_"),weekdaysShort:"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_جمعه_شنبه".split("_"),weekdaysMin:"ی_د_س_چ_پ_ج_ش".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},meridiemParse:/قبل از ظهر|بعد از ظهر/,isPM:function(e){return/بعد از ظهر/.test(e)},meridiem:function(e,t,n){return e<12?"قبل از ظهر":"بعد از ظهر"},calendar:{sameDay:"[امروز ساعت] LT",nextDay:"[فردا ساعت] LT",nextWeek:"dddd [ساعت] LT",lastDay:"[دیروز ساعت] LT",lastWeek:"dddd [پیش] [ساعت] LT",sameElse:"L"},relativeTime:{future:"در %s",past:"%s پیش",s:"چند ثانیه",ss:"%d ثانیه",m:"یک دقیقه",mm:"%d دقیقه",h:"یک ساعت",hh:"%d ساعت",d:"یک روز",dd:"%d روز",M:"یک ماه",MM:"%d ماه",y:"یک سال",yy:"%d سال"},preparse:function(e){return e.replace(/[۰-۹]/g,function(e){return n[e]}).replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]}).replace(/,/g,"،")},dayOfMonthOrdinalParse:/\d{1,2}م/,ordinal:"%dم",week:{dow:6,doy:12}})})(n(30381))},11897:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration +var t="nolla yksi kaksi kolme nelj\xe4 viisi kuusi seitsem\xe4n kahdeksan yhdeks\xe4n".split(" "),n=["nolla","yhden","kahden","kolmen","nelj\xe4n","viiden","kuuden",t[7],t[8],t[9],];function r(e,t,n,r){var a="";switch(n){case"s":return r?"muutaman sekunnin":"muutama sekunti";case"ss":a=r?"sekunnin":"sekuntia";break;case"m":return r?"minuutin":"minuutti";case"mm":a=r?"minuutin":"minuuttia";break;case"h":return r?"tunnin":"tunti";case"hh":a=r?"tunnin":"tuntia";break;case"d":return r?"p\xe4iv\xe4n":"p\xe4iv\xe4";case"dd":a=r?"p\xe4iv\xe4n":"p\xe4iv\xe4\xe4";break;case"M":return r?"kuukauden":"kuukausi";case"MM":a=r?"kuukauden":"kuukautta";break;case"y":return r?"vuoden":"vuosi";case"yy":a=r?"vuoden":"vuotta"}return i(e,r)+" "+a}function i(e,r){return e<10?r?n[e]:t[e]:e}return e.defineLocale("fi",{months:"tammikuu_helmikuu_maaliskuu_huhtikuu_toukokuu_kes\xe4kuu_hein\xe4kuu_elokuu_syyskuu_lokakuu_marraskuu_joulukuu".split("_"),monthsShort:"tammi_helmi_maalis_huhti_touko_kes\xe4_hein\xe4_elo_syys_loka_marras_joulu".split("_"),weekdays:"sunnuntai_maanantai_tiistai_keskiviikko_torstai_perjantai_lauantai".split("_"),weekdaysShort:"su_ma_ti_ke_to_pe_la".split("_"),weekdaysMin:"su_ma_ti_ke_to_pe_la".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD.MM.YYYY",LL:"Do MMMM[ta] YYYY",LLL:"Do MMMM[ta] YYYY, [klo] HH.mm",LLLL:"dddd, Do MMMM[ta] YYYY, [klo] HH.mm",l:"D.M.YYYY",ll:"Do MMM YYYY",lll:"Do MMM YYYY, [klo] HH.mm",llll:"ddd, Do MMM YYYY, [klo] HH.mm"},calendar:{sameDay:"[t\xe4n\xe4\xe4n] [klo] LT",nextDay:"[huomenna] [klo] LT",nextWeek:"dddd [klo] LT",lastDay:"[eilen] [klo] LT",lastWeek:"[viime] dddd[na] [klo] LT",sameElse:"L"},relativeTime:{future:"%s p\xe4\xe4st\xe4",past:"%s sitten",s:r,ss:r,m:r,mm:r,h:r,hh:r,d:r,dd:r,M:r,MM:r,y:r,yy:r},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})})(n(30381))},42549:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("fil",{months:"Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre".split("_"),monthsShort:"Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis".split("_"),weekdays:"Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado".split("_"),weekdaysShort:"Lin_Lun_Mar_Miy_Huw_Biy_Sab".split("_"),weekdaysMin:"Li_Lu_Ma_Mi_Hu_Bi_Sab".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"MM/D/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY HH:mm",LLLL:"dddd, MMMM DD, YYYY HH:mm"},calendar:{sameDay:"LT [ngayong araw]",nextDay:"[Bukas ng] LT",nextWeek:"LT [sa susunod na] dddd",lastDay:"LT [kahapon]",lastWeek:"LT [noong nakaraang] dddd",sameElse:"L"},relativeTime:{future:"sa loob ng %s",past:"%s ang nakalipas",s:"ilang segundo",ss:"%d segundo",m:"isang minuto",mm:"%d minuto",h:"isang oras",hh:"%d oras",d:"isang araw",dd:"%d araw",M:"isang buwan",MM:"%d buwan",y:"isang taon",yy:"%d taon"},dayOfMonthOrdinalParse:/\d{1,2}/,ordinal:function(e){return e},week:{dow:1,doy:4}})})(n(30381))},94694:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("fo",{months:"januar_februar_mars_apr\xedl_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_"),weekdays:"sunnudagur_m\xe1nadagur_t\xfdsdagur_mikudagur_h\xf3sdagur_fr\xedggjadagur_leygardagur".split("_"),weekdaysShort:"sun_m\xe1n_t\xfds_mik_h\xf3s_fr\xed_ley".split("_"),weekdaysMin:"su_m\xe1_t\xfd_mi_h\xf3_fr_le".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D. MMMM, YYYY HH:mm"},calendar:{sameDay:"[\xcd dag kl.] LT",nextDay:"[\xcd morgin kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[\xcd gj\xe1r kl.] LT",lastWeek:"[s\xed\xf0stu] dddd [kl] LT",sameElse:"L"},relativeTime:{future:"um %s",past:"%s s\xed\xf0ani",s:"f\xe1 sekund",ss:"%d sekundir",m:"ein minuttur",mm:"%d minuttir",h:"ein t\xedmi",hh:"%d t\xedmar",d:"ein dagur",dd:"%d dagar",M:"ein m\xe1na\xf0ur",MM:"%d m\xe1na\xf0ir",y:"eitt \xe1r",yy:"%d \xe1r"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})})(n(30381))},63049:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("fr-ca",{months:"janvier_f\xe9vrier_mars_avril_mai_juin_juillet_ao\xfbt_septembre_octobre_novembre_d\xe9cembre".split("_"),monthsShort:"janv._f\xe9vr._mars_avr._mai_juin_juil._ao\xfbt_sept._oct._nov._d\xe9c.".split("_"),monthsParseExact:!0,weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourd’hui \xe0] LT",nextDay:"[Demain \xe0] LT",nextWeek:"dddd [\xe0] LT",lastDay:"[Hier \xe0] LT",lastWeek:"dddd [dernier \xe0] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",ss:"%d secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},dayOfMonthOrdinalParse:/\d{1,2}(er|e)/,ordinal:function(e,t){switch(t){default:case"M":case"Q":case"D":case"DDD":case"d":return e+(1===e?"er":"e");case"w":case"W":return e+(1===e?"re":"e")}}})})(n(30381))},52330:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("fr-ch",{months:"janvier_f\xe9vrier_mars_avril_mai_juin_juillet_ao\xfbt_septembre_octobre_novembre_d\xe9cembre".split("_"),monthsShort:"janv._f\xe9vr._mars_avr._mai_juin_juil._ao\xfbt_sept._oct._nov._d\xe9c.".split("_"),monthsParseExact:!0,weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourd’hui \xe0] LT",nextDay:"[Demain \xe0] LT",nextWeek:"dddd [\xe0] LT",lastDay:"[Hier \xe0] LT",lastWeek:"dddd [dernier \xe0] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",ss:"%d secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},dayOfMonthOrdinalParse:/\d{1,2}(er|e)/,ordinal:function(e,t){switch(t){default:case"M":case"Q":case"D":case"DDD":case"d":return e+(1===e?"er":"e");case"w":case"W":return e+(1===e?"re":"e")}},week:{dow:1,doy:4}})})(n(30381))},94470:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration +var t=/^(janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i,n=/(janv\.?|févr\.?|mars|avr\.?|mai|juin|juil\.?|août|sept\.?|oct\.?|nov\.?|déc\.?)/i,r=/(janv\.?|févr\.?|mars|avr\.?|mai|juin|juil\.?|août|sept\.?|oct\.?|nov\.?|déc\.?|janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i,i=[/^janv/i,/^févr/i,/^mars/i,/^avr/i,/^mai/i,/^juin/i,/^juil/i,/^août/i,/^sept/i,/^oct/i,/^nov/i,/^déc/i,];return e.defineLocale("fr",{months:"janvier_f\xe9vrier_mars_avril_mai_juin_juillet_ao\xfbt_septembre_octobre_novembre_d\xe9cembre".split("_"),monthsShort:"janv._f\xe9vr._mars_avr._mai_juin_juil._ao\xfbt_sept._oct._nov._d\xe9c.".split("_"),monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:t,monthsShortStrictRegex:n,monthsParse:i,longMonthsParse:i,shortMonthsParse:i,weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourd’hui \xe0] LT",nextDay:"[Demain \xe0] LT",nextWeek:"dddd [\xe0] LT",lastDay:"[Hier \xe0] LT",lastWeek:"dddd [dernier \xe0] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",ss:"%d secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",w:"une semaine",ww:"%d semaines",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},dayOfMonthOrdinalParse:/\d{1,2}(er|)/,ordinal:function(e,t){switch(t){case"D":return e+(1===e?"er":"");default:case"M":case"Q":case"DDD":case"d":return e+(1===e?"er":"e");case"w":case"W":return e+(1===e?"re":"e")}},week:{dow:1,doy:4}})})(n(30381))},5044:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration +var t="jan._feb._mrt._apr._mai_jun._jul._aug._sep._okt._nov._des.".split("_"),n="jan_feb_mrt_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_");return e.defineLocale("fy",{months:"jannewaris_febrewaris_maart_april_maaie_juny_july_augustus_septimber_oktober_novimber_desimber".split("_"),monthsShort:function(e,r){return e?/-MMM-/.test(r)?n[e.month()]:t[e.month()]:t},monthsParseExact:!0,weekdays:"snein_moandei_tiisdei_woansdei_tongersdei_freed_sneon".split("_"),weekdaysShort:"si._mo._ti._wo._to._fr._so.".split("_"),weekdaysMin:"Si_Mo_Ti_Wo_To_Fr_So".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[hjoed om] LT",nextDay:"[moarn om] LT",nextWeek:"dddd [om] LT",lastDay:"[juster om] LT",lastWeek:"[\xf4fr\xfbne] dddd [om] LT",sameElse:"L"},relativeTime:{future:"oer %s",past:"%s lyn",s:"in pear sekonden",ss:"%d sekonden",m:"ien min\xfat",mm:"%d minuten",h:"ien oere",hh:"%d oeren",d:"ien dei",dd:"%d dagen",M:"ien moanne",MM:"%d moannen",y:"ien jier",yy:"%d jierren"},dayOfMonthOrdinalParse:/\d{1,2}(ste|de)/,ordinal:function(e){return e+(1===e||8===e||e>=20?"ste":"de")},week:{dow:1,doy:4}})})(n(30381))},29295:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration +var t=["Ean\xe1ir","Feabhra","M\xe1rta","Aibre\xe1n","Bealtaine","Meitheamh","I\xfail","L\xfanasa","Me\xe1n F\xf3mhair","Deireadh F\xf3mhair","Samhain","Nollaig",],n=["Ean","Feabh","M\xe1rt","Aib","Beal","Meith","I\xfail","L\xfan","M.F.","D.F.","Samh","Noll",],r=["D\xe9 Domhnaigh","D\xe9 Luain","D\xe9 M\xe1irt","D\xe9 C\xe9adaoin","D\xe9ardaoin","D\xe9 hAoine","D\xe9 Sathairn",],i=["Domh","Luan","M\xe1irt","C\xe9ad","D\xe9ar","Aoine","Sath"],a=["Do","Lu","M\xe1","C\xe9","D\xe9","A","Sa"];return e.defineLocale("ga",{months:t,monthsShort:n,monthsParseExact:!0,weekdays:r,weekdaysShort:i,weekdaysMin:a,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Inniu ag] LT",nextDay:"[Am\xe1rach ag] LT",nextWeek:"dddd [ag] LT",lastDay:"[Inn\xe9 ag] LT",lastWeek:"dddd [seo caite] [ag] LT",sameElse:"L"},relativeTime:{future:"i %s",past:"%s \xf3 shin",s:"c\xfapla soicind",ss:"%d soicind",m:"n\xf3im\xe9ad",mm:"%d n\xf3im\xe9ad",h:"uair an chloig",hh:"%d uair an chloig",d:"l\xe1",dd:"%d l\xe1",M:"m\xed",MM:"%d m\xedonna",y:"bliain",yy:"%d bliain"},dayOfMonthOrdinalParse:/\d{1,2}(d|na|mh)/,ordinal:function(e){var t=1===e?"d":e%10==2?"na":"mh";return e+t},week:{dow:1,doy:4}})})(n(30381))},2101:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration +var t=["Am Faoilleach","An Gearran","Am M\xe0rt","An Giblean","An C\xe8itean","An t-\xd2gmhios","An t-Iuchar","An L\xf9nastal","An t-Sultain","An D\xe0mhair","An t-Samhain","An D\xf9bhlachd",],n=["Faoi","Gear","M\xe0rt","Gibl","C\xe8it","\xd2gmh","Iuch","L\xf9n","Sult","D\xe0mh","Samh","D\xf9bh",],r=["Did\xf2mhnaich","Diluain","Dim\xe0irt","Diciadain","Diardaoin","Dihaoine","Disathairne",],i=["Did","Dil","Dim","Dic","Dia","Dih","Dis"],a=["D\xf2","Lu","M\xe0","Ci","Ar","Ha","Sa"];return e.defineLocale("gd",{months:t,monthsShort:n,monthsParseExact:!0,weekdays:r,weekdaysShort:i,weekdaysMin:a,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[An-diugh aig] LT",nextDay:"[A-m\xe0ireach aig] LT",nextWeek:"dddd [aig] LT",lastDay:"[An-d\xe8 aig] LT",lastWeek:"dddd [seo chaidh] [aig] LT",sameElse:"L"},relativeTime:{future:"ann an %s",past:"bho chionn %s",s:"beagan diogan",ss:"%d diogan",m:"mionaid",mm:"%d mionaidean",h:"uair",hh:"%d uairean",d:"latha",dd:"%d latha",M:"m\xecos",MM:"%d m\xecosan",y:"bliadhna",yy:"%d bliadhna"},dayOfMonthOrdinalParse:/\d{1,2}(d|na|mh)/,ordinal:function(e){var t=1===e?"d":e%10==2?"na":"mh";return e+t},week:{dow:1,doy:4}})})(n(30381))},38794:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("gl",{months:"xaneiro_febreiro_marzo_abril_maio_xu\xf1o_xullo_agosto_setembro_outubro_novembro_decembro".split("_"),monthsShort:"xan._feb._mar._abr._mai._xu\xf1._xul._ago._set._out._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"domingo_luns_martes_m\xe9rcores_xoves_venres_s\xe1bado".split("_"),weekdaysShort:"dom._lun._mar._m\xe9r._xov._ven._s\xe1b.".split("_"),weekdaysMin:"do_lu_ma_m\xe9_xo_ve_s\xe1".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},calendar:{sameDay:function(){return"[hoxe "+(1!==this.hours()?"\xe1s":"\xe1")+"] LT"},nextDay:function(){return"[ma\xf1\xe1 "+(1!==this.hours()?"\xe1s":"\xe1")+"] LT"},nextWeek:function(){return"dddd ["+(1!==this.hours()?"\xe1s":"a")+"] LT"},lastDay:function(){return"[onte "+(1!==this.hours()?"\xe1":"a")+"] LT"},lastWeek:function(){return"[o] dddd [pasado "+(1!==this.hours()?"\xe1s":"a")+"] LT"},sameElse:"L"},relativeTime:{future:function(e){return 0===e.indexOf("un")?"n"+e:"en "+e},past:"hai %s",s:"uns segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"unha hora",hh:"%d horas",d:"un d\xeda",dd:"%d d\xedas",M:"un mes",MM:"%d meses",y:"un ano",yy:"%d anos"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%d\xba",week:{dow:1,doy:4}})})(n(30381))},27884:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration +function t(e,t,n,r){var i={s:["थोडया सॅकंडांनी","थोडे सॅकंड"],ss:[e+" सॅकंडांनी",e+" सॅकंड"],m:["एका मिणटान","एक मिनूट"],mm:[e+" मिणटांनी",e+" मिणटां"],h:["एका वरान","एक वर"],hh:[e+" वरांनी",e+" वरां"],d:["एका दिसान","एक दीस"],dd:[e+" दिसांनी",e+" दीस"],M:["एका म्हयन्यान","एक म्हयनो"],MM:[e+" म्हयन्यानी",e+" म्हयने"],y:["एका वर्सान","एक वर्स"],yy:[e+" वर्सांनी",e+" वर्सां"]};return r?i[n][0]:i[n][1]}return e.defineLocale("gom-deva",{months:{standalone:"जानेवारी_फेब्रुवारी_मार्च_एप्रील_मे_जून_जुलय_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर".split("_"),format:"जानेवारीच्या_फेब्रुवारीच्या_मार्चाच्या_एप्रीलाच्या_मेयाच्या_जूनाच्या_जुलयाच्या_ऑगस्टाच्या_सप्टेंबराच्या_ऑक्टोबराच्या_नोव्हेंबराच्या_डिसेंबराच्या".split("_"),isFormat:/MMMM(\s)+D[oD]?/},monthsShort:"जाने._फेब्रु._मार्च_एप्री._मे_जून_जुल._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.".split("_"),monthsParseExact:!0,weekdays:"आयतार_सोमार_मंगळार_बुधवार_बिरेस्तार_सुक्रार_शेनवार".split("_"),weekdaysShort:"आयत._सोम._मंगळ._बुध._ब्रेस्त._सुक्र._शेन.".split("_"),weekdaysMin:"आ_सो_मं_बु_ब्रे_सु_शे".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"A h:mm [वाजतां]",LTS:"A h:mm:ss [वाजतां]",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY A h:mm [वाजतां]",LLLL:"dddd, MMMM Do, YYYY, A h:mm [वाजतां]",llll:"ddd, D MMM YYYY, A h:mm [वाजतां]"},calendar:{sameDay:"[आयज] LT",nextDay:"[फाल्यां] LT",nextWeek:"[फुडलो] dddd[,] LT",lastDay:"[काल] LT",lastWeek:"[फाटलो] dddd[,] LT",sameElse:"L"},relativeTime:{future:"%s",past:"%s आदीं",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}(वेर)/,ordinal:function(e,t){return"D"===t?e+"वेर":e},week:{dow:0,doy:3},meridiemParse:/राती|सकाळीं|दनपारां|सांजे/,meridiemHour:function(e,t){return(12===e&&(e=0),"राती"===t)?e<4?e:e+12:"सकाळीं"===t?e:"दनपारां"===t?e>12?e:e+12:"सांजे"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"राती":e<12?"सकाळीं":e<16?"दनपारां":e<20?"सांजे":"राती"}})})(n(30381))},23168:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration +function t(e,t,n,r){var i={s:["thoddea sekondamni","thodde sekond"],ss:[e+" sekondamni",e+" sekond"],m:["eka mintan","ek minut"],mm:[e+" mintamni",e+" mintam"],h:["eka voran","ek vor"],hh:[e+" voramni",e+" voram"],d:["eka disan","ek dis"],dd:[e+" disamni",e+" dis"],M:["eka mhoinean","ek mhoino"],MM:[e+" mhoineamni",e+" mhoine"],y:["eka vorsan","ek voros"],yy:[e+" vorsamni",e+" vorsam"]};return r?i[n][0]:i[n][1]}return e.defineLocale("gom-latn",{months:{standalone:"Janer_Febrer_Mars_Abril_Mai_Jun_Julai_Agost_Setembr_Otubr_Novembr_Dezembr".split("_"),format:"Janerachea_Febrerachea_Marsachea_Abrilachea_Maiachea_Junachea_Julaiachea_Agostachea_Setembrachea_Otubrachea_Novembrachea_Dezembrachea".split("_"),isFormat:/MMMM(\s)+D[oD]?/},monthsShort:"Jan._Feb._Mars_Abr._Mai_Jun_Jul._Ago._Set._Otu._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Aitar_Somar_Mongllar_Budhvar_Birestar_Sukrar_Son'var".split("_"),weekdaysShort:"Ait._Som._Mon._Bud._Bre._Suk._Son.".split("_"),weekdaysMin:"Ai_Sm_Mo_Bu_Br_Su_Sn".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"A h:mm [vazta]",LTS:"A h:mm:ss [vazta]",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY A h:mm [vazta]",LLLL:"dddd, MMMM Do, YYYY, A h:mm [vazta]",llll:"ddd, D MMM YYYY, A h:mm [vazta]"},calendar:{sameDay:"[Aiz] LT",nextDay:"[Faleam] LT",nextWeek:"[Fuddlo] dddd[,] LT",lastDay:"[Kal] LT",lastWeek:"[Fattlo] dddd[,] LT",sameElse:"L"},relativeTime:{future:"%s",past:"%s adim",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}(er)/,ordinal:function(e,t){return"D"===t?e+"er":e},week:{dow:0,doy:3},meridiemParse:/rati|sokallim|donparam|sanje/,meridiemHour:function(e,t){return(12===e&&(e=0),"rati"===t)?e<4?e:e+12:"sokallim"===t?e:"donparam"===t?e>12?e:e+12:"sanje"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"rati":e<12?"sokallim":e<16?"donparam":e<20?"sanje":"rati"}})})(n(30381))},95349:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration +var t={1:"૧",2:"૨",3:"૩",4:"૪",5:"૫",6:"૬",7:"૭",8:"૮",9:"૯",0:"૦"},n={"૧":"1","૨":"2","૩":"3","૪":"4","૫":"5","૬":"6","૭":"7","૮":"8","૯":"9","૦":"0"};return e.defineLocale("gu",{months:"જાન્યુઆરી_ફેબ્રુઆરી_માર્ચ_એપ્રિલ_મે_જૂન_જુલાઈ_ઑગસ્ટ_સપ્ટેમ્બર_ઑક્ટ્બર_નવેમ્બર_ડિસેમ્બર".split("_"),monthsShort:"જાન્યુ._ફેબ્રુ._માર્ચ_એપ્રિ._મે_જૂન_જુલા._ઑગ._સપ્ટે._ઑક્ટ્._નવે._ડિસે.".split("_"),monthsParseExact:!0,weekdays:"રવિવાર_સોમવાર_મંગળવાર_બુધ્વાર_ગુરુવાર_શુક્રવાર_શનિવાર".split("_"),weekdaysShort:"રવિ_સોમ_મંગળ_બુધ્_ગુરુ_શુક્ર_શનિ".split("_"),weekdaysMin:"ર_સો_મં_બુ_ગુ_શુ_શ".split("_"),longDateFormat:{LT:"A h:mm વાગ્યે",LTS:"A h:mm:ss વાગ્યે",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm વાગ્યે",LLLL:"dddd, D MMMM YYYY, A h:mm વાગ્યે"},calendar:{sameDay:"[આજ] LT",nextDay:"[કાલે] LT",nextWeek:"dddd, LT",lastDay:"[ગઇકાલે] LT",lastWeek:"[પાછલા] dddd, LT",sameElse:"L"},relativeTime:{future:"%s મા",past:"%s પહેલા",s:"અમુક પળો",ss:"%d સેકંડ",m:"એક મિનિટ",mm:"%d મિનિટ",h:"એક કલાક",hh:"%d કલાક",d:"એક દિવસ",dd:"%d દિવસ",M:"એક મહિનો",MM:"%d મહિનો",y:"એક વર્ષ",yy:"%d વર્ષ"},preparse:function(e){return e.replace(/[૧૨૩૪૫૬૭૮૯૦]/g,function(e){return n[e]})},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]})},meridiemParse:/રાત|બપોર|સવાર|સાંજ/,meridiemHour:function(e,t){return(12===e&&(e=0),"રાત"===t)?e<4?e:e+12:"સવાર"===t?e:"બપોર"===t?e>=10?e:e+12:"સાંજ"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"રાત":e<10?"સવાર":e<17?"બપોર":e<20?"સાંજ":"રાત"},week:{dow:0,doy:6}})})(n(30381))},24206:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("he",{months:"ינואר_פברואר_מרץ_אפריל_מאי_יוני_יולי_אוגוסט_ספטמבר_אוקטובר_נובמבר_דצמבר".split("_"),monthsShort:"ינו׳_פבר׳_מרץ_אפר׳_מאי_יוני_יולי_אוג׳_ספט׳_אוק׳_נוב׳_דצמ׳".split("_"),weekdays:"ראשון_שני_שלישי_רביעי_חמישי_שישי_שבת".split("_"),weekdaysShort:"א׳_ב׳_ג׳_ד׳_ה׳_ו׳_ש׳".split("_"),weekdaysMin:"א_ב_ג_ד_ה_ו_ש".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [ב]MMMM YYYY",LLL:"D [ב]MMMM YYYY HH:mm",LLLL:"dddd, D [ב]MMMM YYYY HH:mm",l:"D/M/YYYY",ll:"D MMM YYYY",lll:"D MMM YYYY HH:mm",llll:"ddd, D MMM YYYY HH:mm"},calendar:{sameDay:"[היום ב־]LT",nextDay:"[מחר ב־]LT",nextWeek:"dddd [בשעה] LT",lastDay:"[אתמול ב־]LT",lastWeek:"[ביום] dddd [האחרון בשעה] LT",sameElse:"L"},relativeTime:{future:"בעוד %s",past:"לפני %s",s:"מספר שניות",ss:"%d שניות",m:"דקה",mm:"%d דקות",h:"שעה",hh:function(e){return 2===e?"שעתיים":e+" שעות"},d:"יום",dd:function(e){return 2===e?"יומיים":e+" ימים"},M:"חודש",MM:function(e){return 2===e?"חודשיים":e+" חודשים"},y:"שנה",yy:function(e){return 2===e?"שנתיים":e%10==0&&10!==e?e+" שנה":e+" שנים"}},meridiemParse:/אחה"צ|לפנה"צ|אחרי הצהריים|לפני הצהריים|לפנות בוקר|בבוקר|בערב/i,isPM:function(e){return/^(אחה"צ|אחרי הצהריים|בערב)$/.test(e)},meridiem:function(e,t,n){return e<5?"לפנות בוקר":e<10?"בבוקר":e<12?n?'לפנה"צ':"לפני הצהריים":e<18?n?'אחה"צ':"אחרי הצהריים":"בערב"}})})(n(30381))},30094:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration +var t={1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"},n={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"},r=[/^जन/i,/^फ़र|फर/i,/^मार्च/i,/^अप्रै/i,/^मई/i,/^जून/i,/^जुल/i,/^अग/i,/^सितं|सित/i,/^अक्टू/i,/^नव|नवं/i,/^दिसं|दिस/i,],i=[/^जन/i,/^फ़र/i,/^मार्च/i,/^अप्रै/i,/^मई/i,/^जून/i,/^जुल/i,/^अग/i,/^सित/i,/^अक्टू/i,/^नव/i,/^दिस/i,];return e.defineLocale("hi",{months:{format:"जनवरी_फ़रवरी_मार्च_अप्रैल_मई_जून_जुलाई_अगस्त_सितम्बर_अक्टूबर_नवम्बर_दिसम्बर".split("_"),standalone:"जनवरी_फरवरी_मार्च_अप्रैल_मई_जून_जुलाई_अगस्त_सितंबर_अक्टूबर_नवंबर_दिसंबर".split("_")},monthsShort:"जन._फ़र._मार्च_अप्रै._मई_जून_जुल._अग._सित._अक्टू._नव._दिस.".split("_"),weekdays:"रविवार_सोमवार_मंगलवार_बुधवार_गुरूवार_शुक्रवार_शनिवार".split("_"),weekdaysShort:"रवि_सोम_मंगल_बुध_गुरू_शुक्र_शनि".split("_"),weekdaysMin:"र_सो_मं_बु_गु_शु_श".split("_"),longDateFormat:{LT:"A h:mm बजे",LTS:"A h:mm:ss बजे",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm बजे",LLLL:"dddd, D MMMM YYYY, A h:mm बजे"},monthsParse:r,longMonthsParse:r,shortMonthsParse:i,monthsRegex:/^(जनवरी|जन\.?|फ़रवरी|फरवरी|फ़र\.?|मार्च?|अप्रैल|अप्रै\.?|मई?|जून?|जुलाई|जुल\.?|अगस्त|अग\.?|सितम्बर|सितंबर|सित\.?|अक्टूबर|अक्टू\.?|नवम्बर|नवंबर|नव\.?|दिसम्बर|दिसंबर|दिस\.?)/i,monthsShortRegex:/^(जनवरी|जन\.?|फ़रवरी|फरवरी|फ़र\.?|मार्च?|अप्रैल|अप्रै\.?|मई?|जून?|जुलाई|जुल\.?|अगस्त|अग\.?|सितम्बर|सितंबर|सित\.?|अक्टूबर|अक्टू\.?|नवम्बर|नवंबर|नव\.?|दिसम्बर|दिसंबर|दिस\.?)/i,monthsStrictRegex:/^(जनवरी?|फ़रवरी|फरवरी?|मार्च?|अप्रैल?|मई?|जून?|जुलाई?|अगस्त?|सितम्बर|सितंबर|सित?\.?|अक्टूबर|अक्टू\.?|नवम्बर|नवंबर?|दिसम्बर|दिसंबर?)/i,monthsShortStrictRegex:/^(जन\.?|फ़र\.?|मार्च?|अप्रै\.?|मई?|जून?|जुल\.?|अग\.?|सित\.?|अक्टू\.?|नव\.?|दिस\.?)/i,calendar:{sameDay:"[आज] LT",nextDay:"[कल] LT",nextWeek:"dddd, LT",lastDay:"[कल] LT",lastWeek:"[पिछले] dddd, LT",sameElse:"L"},relativeTime:{future:"%s में",past:"%s पहले",s:"कुछ ही क्षण",ss:"%d सेकंड",m:"एक मिनट",mm:"%d मिनट",h:"एक घंटा",hh:"%d घंटे",d:"एक दिन",dd:"%d दिन",M:"एक महीने",MM:"%d महीने",y:"एक वर्ष",yy:"%d वर्ष"},preparse:function(e){return e.replace(/[१२३४५६७८९०]/g,function(e){return n[e]})},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]})},meridiemParse:/रात|सुबह|दोपहर|शाम/,meridiemHour:function(e,t){return(12===e&&(e=0),"रात"===t)?e<4?e:e+12:"सुबह"===t?e:"दोपहर"===t?e>=10?e:e+12:"शाम"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"रात":e<10?"सुबह":e<17?"दोपहर":e<20?"शाम":"रात"},week:{dow:0,doy:6}})})(n(30381))},30316:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration +function t(e,t,n){var r=e+" ";switch(n){case"ss":return 1===e?r+="sekunda":2===e||3===e||4===e?r+="sekunde":r+="sekundi",r;case"m":return t?"jedna minuta":"jedne minute";case"mm":return 1===e?r+="minuta":2===e||3===e||4===e?r+="minute":r+="minuta",r;case"h":return t?"jedan sat":"jednog sata";case"hh":return 1===e?r+="sat":2===e||3===e||4===e?r+="sata":r+="sati",r;case"dd":return 1===e?r+="dan":r+="dana",r;case"MM":return 1===e?r+="mjesec":2===e||3===e||4===e?r+="mjeseca":r+="mjeseci",r;case"yy":return 1===e?r+="godina":2===e||3===e||4===e?r+="godine":r+="godina",r}}return e.defineLocale("hr",{months:{format:"siječnja_veljače_ožujka_travnja_svibnja_lipnja_srpnja_kolovoza_rujna_listopada_studenoga_prosinca".split("_"),standalone:"siječanj_veljača_ožujak_travanj_svibanj_lipanj_srpanj_kolovoz_rujan_listopad_studeni_prosinac".split("_")},monthsShort:"sij._velj._ožu._tra._svi._lip._srp._kol._ruj._lis._stu._pro.".split("_"),monthsParseExact:!0,weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"Do MMMM YYYY",LLL:"Do MMMM YYYY H:mm",LLLL:"dddd, Do MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[jučer u] LT",lastWeek:function(){switch(this.day()){case 0:return"[prošlu] [nedjelju] [u] LT";case 3:return"[prošlu] [srijedu] [u] LT";case 6:return"[prošle] [subote] [u] LT";case 1:case 2:case 4:case 5:return"[prošli] dddd [u] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"par sekundi",ss:t,m:t,mm:t,h:t,hh:t,d:"dan",dd:t,M:"mjesec",MM:t,y:"godinu",yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})})(n(30381))},22138:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration +var t="vas\xe1rnap h\xe9tfőn kedden szerd\xe1n cs\xfct\xf6rt\xf6k\xf6n p\xe9nteken szombaton".split(" ");function n(e,t,n,r){var i=e;switch(n){case"s":return r||t?"n\xe9h\xe1ny m\xe1sodperc":"n\xe9h\xe1ny m\xe1sodperce";case"ss":return i+(r||t)?" m\xe1sodperc":" m\xe1sodperce";case"m":return"egy"+(r||t?" perc":" perce");case"mm":return i+(r||t?" perc":" perce");case"h":return"egy"+(r||t?" \xf3ra":" \xf3r\xe1ja");case"hh":return i+(r||t?" \xf3ra":" \xf3r\xe1ja");case"d":return"egy"+(r||t?" nap":" napja");case"dd":return i+(r||t?" nap":" napja");case"M":return"egy"+(r||t?" h\xf3nap":" h\xf3napja");case"MM":return i+(r||t?" h\xf3nap":" h\xf3napja");case"y":return"egy"+(r||t?" \xe9v":" \xe9ve");case"yy":return i+(r||t?" \xe9v":" \xe9ve")}return""}function r(e){return(e?"":"[m\xfalt] ")+"["+t[this.day()]+"] LT[-kor]"}return e.defineLocale("hu",{months:"janu\xe1r_febru\xe1r_m\xe1rcius_\xe1prilis_m\xe1jus_j\xfanius_j\xfalius_augusztus_szeptember_okt\xf3ber_november_december".split("_"),monthsShort:"jan._feb._m\xe1rc._\xe1pr._m\xe1j._j\xfan._j\xfal._aug._szept._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"vas\xe1rnap_h\xe9tfő_kedd_szerda_cs\xfct\xf6rt\xf6k_p\xe9ntek_szombat".split("_"),weekdaysShort:"vas_h\xe9t_kedd_sze_cs\xfct_p\xe9n_szo".split("_"),weekdaysMin:"v_h_k_sze_cs_p_szo".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"YYYY.MM.DD.",LL:"YYYY. MMMM D.",LLL:"YYYY. MMMM D. H:mm",LLLL:"YYYY. MMMM D., dddd H:mm"},meridiemParse:/de|du/i,isPM:function(e){return"u"===e.charAt(1).toLowerCase()},meridiem:function(e,t,n){return e<12?!0===n?"de":"DE":!0===n?"du":"DU"},calendar:{sameDay:"[ma] LT[-kor]",nextDay:"[holnap] LT[-kor]",nextWeek:function(){return r.call(this,!0)},lastDay:"[tegnap] LT[-kor]",lastWeek:function(){return r.call(this,!1)},sameElse:"L"},relativeTime:{future:"%s m\xfalva",past:"%s",s:n,ss:n,m:n,mm:n,h:n,hh:n,d:n,dd:n,M:n,MM:n,y:n,yy:n},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})})(n(30381))},11423:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("hy-am",{months:{format:"հունվարի_փետրվարի_մարտի_ապրիլի_մայիսի_հունիսի_հուլիսի_օգոստոսի_սեպտեմբերի_հոկտեմբերի_նոյեմբերի_դեկտեմբերի".split("_"),standalone:"հունվար_փետրվար_մարտ_ապրիլ_մայիս_հունիս_հուլիս_օգոստոս_սեպտեմբեր_հոկտեմբեր_նոյեմբեր_դեկտեմբեր".split("_")},monthsShort:"հնվ_փտր_մրտ_ապր_մյս_հնս_հլս_օգս_սպտ_հկտ_նմբ_դկտ".split("_"),weekdays:"կիրակի_երկուշաբթի_երեքշաբթի_չորեքշաբթի_հինգշաբթի_ուրբաթ_շաբաթ".split("_"),weekdaysShort:"կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ".split("_"),weekdaysMin:"կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY թ.",LLL:"D MMMM YYYY թ., HH:mm",LLLL:"dddd, D MMMM YYYY թ., HH:mm"},calendar:{sameDay:"[այսօր] LT",nextDay:"[վաղը] LT",lastDay:"[երեկ] LT",nextWeek:function(){return"dddd [օրը ժամը] LT"},lastWeek:function(){return"[անցած] dddd [օրը ժամը] LT"},sameElse:"L"},relativeTime:{future:"%s հետո",past:"%s առաջ",s:"մի քանի վայրկյան",ss:"%d վայրկյան",m:"րոպե",mm:"%d րոպե",h:"ժամ",hh:"%d ժամ",d:"օր",dd:"%d օր",M:"ամիս",MM:"%d ամիս",y:"տարի",yy:"%d տարի"},meridiemParse:/գիշերվա|առավոտվա|ցերեկվա|երեկոյան/,isPM:function(e){return/^(ցերեկվա|երեկոյան)$/.test(e)},meridiem:function(e){return e<4?"գիշերվա":e<12?"առավոտվա":e<17?"ցերեկվա":"երեկոյան"},dayOfMonthOrdinalParse:/\d{1,2}|\d{1,2}-(ին|րդ)/,ordinal:function(e,t){switch(t){case"DDD":case"w":case"W":case"DDDo":if(1===e)return e+"-ին";return e+"-րդ";default:return e}},week:{dow:1,doy:7}})})(n(30381))},29218:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("id",{months:"Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_November_Desember".split("_"),monthsShort:"Jan_Feb_Mar_Apr_Mei_Jun_Jul_Agt_Sep_Okt_Nov_Des".split("_"),weekdays:"Minggu_Senin_Selasa_Rabu_Kamis_Jumat_Sabtu".split("_"),weekdaysShort:"Min_Sen_Sel_Rab_Kam_Jum_Sab".split("_"),weekdaysMin:"Mg_Sn_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|siang|sore|malam/,meridiemHour:function(e,t){return(12===e&&(e=0),"pagi"===t)?e:"siang"===t?e>=11?e:e+12:"sore"===t||"malam"===t?e+12:void 0},meridiem:function(e,t,n){return e<11?"pagi":e<15?"siang":e<19?"sore":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Besok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kemarin pukul] LT",lastWeek:"dddd [lalu pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lalu",s:"beberapa detik",ss:"%d detik",m:"semenit",mm:"%d menit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:0,doy:6}})})(n(30381))},90135:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration +function t(e){if(e%100==11);else if(e%10==1)return!1;return!0}function n(e,n,r,i){var a=e+" ";switch(r){case"s":return n||i?"nokkrar sek\xfandur":"nokkrum sek\xfandum";case"ss":if(t(e))return a+(n||i?"sek\xfandur":"sek\xfandum");return a+"sek\xfanda";case"m":return n?"m\xedn\xfata":"m\xedn\xfatu";case"mm":if(t(e))return a+(n||i?"m\xedn\xfatur":"m\xedn\xfatum");if(n)return a+"m\xedn\xfata";return a+"m\xedn\xfatu";case"hh":if(t(e))return a+(n||i?"klukkustundir":"klukkustundum");return a+"klukkustund";case"d":if(n)return"dagur";return i?"dag":"degi";case"dd":if(t(e)){if(n)return a+"dagar";return a+(i?"daga":"d\xf6gum")}if(n)return a+"dagur";return a+(i?"dag":"degi");case"M":if(n)return"m\xe1nu\xf0ur";return i?"m\xe1nu\xf0":"m\xe1nu\xf0i";case"MM":if(t(e)){if(n)return a+"m\xe1nu\xf0ir";return a+(i?"m\xe1nu\xf0i":"m\xe1nu\xf0um")}if(n)return a+"m\xe1nu\xf0ur";return a+(i?"m\xe1nu\xf0":"m\xe1nu\xf0i");case"y":return n||i?"\xe1r":"\xe1ri";case"yy":if(t(e))return a+(n||i?"\xe1r":"\xe1rum");return a+(n||i?"\xe1r":"\xe1ri")}}return e.defineLocale("is",{months:"jan\xfaar_febr\xfaar_mars_apr\xedl_ma\xed_j\xfan\xed_j\xfal\xed_\xe1g\xfast_september_okt\xf3ber_n\xf3vember_desember".split("_"),monthsShort:"jan_feb_mar_apr_ma\xed_j\xfan_j\xfal_\xe1g\xfa_sep_okt_n\xf3v_des".split("_"),weekdays:"sunnudagur_m\xe1nudagur_\xferi\xf0judagur_mi\xf0vikudagur_fimmtudagur_f\xf6studagur_laugardagur".split("_"),weekdaysShort:"sun_m\xe1n_\xferi_mi\xf0_fim_f\xf6s_lau".split("_"),weekdaysMin:"Su_M\xe1_\xder_Mi_Fi_F\xf6_La".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] H:mm",LLLL:"dddd, D. MMMM YYYY [kl.] H:mm"},calendar:{sameDay:"[\xed dag kl.] LT",nextDay:"[\xe1 morgun kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[\xed g\xe6r kl.] LT",lastWeek:"[s\xed\xf0asta] dddd [kl.] LT",sameElse:"L"},relativeTime:{future:"eftir %s",past:"fyrir %s s\xed\xf0an",s:n,ss:n,m:n,mm:n,h:"klukkustund",hh:n,d:n,dd:n,M:n,MM:n,y:n,yy:n},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})})(n(30381))},10150:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("it-ch",{months:"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"),monthsShort:"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"),weekdays:"domenica_luned\xec_marted\xec_mercoled\xec_gioved\xec_venerd\xec_sabato".split("_"),weekdaysShort:"dom_lun_mar_mer_gio_ven_sab".split("_"),weekdaysMin:"do_lu_ma_me_gi_ve_sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Oggi alle] LT",nextDay:"[Domani alle] LT",nextWeek:"dddd [alle] LT",lastDay:"[Ieri alle] LT",lastWeek:function(){return 0===this.day()?"[la scorsa] dddd [alle] LT":"[lo scorso] dddd [alle] LT"},sameElse:"L"},relativeTime:{future:function(e){return(/^[0-9].+$/.test(e)?"tra":"in")+" "+e},past:"%s fa",s:"alcuni secondi",ss:"%d secondi",m:"un minuto",mm:"%d minuti",h:"un'ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%d\xba",week:{dow:1,doy:4}})})(n(30381))},90626:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("it",{months:"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"),monthsShort:"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"),weekdays:"domenica_luned\xec_marted\xec_mercoled\xec_gioved\xec_venerd\xec_sabato".split("_"),weekdaysShort:"dom_lun_mar_mer_gio_ven_sab".split("_"),weekdaysMin:"do_lu_ma_me_gi_ve_sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:function(){return"[Oggi a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT"},nextDay:function(){return"[Domani a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT"},nextWeek:function(){return"dddd [a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT"},lastDay:function(){return"[Ieri a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT"},lastWeek:function(){return 0===this.day()?"[La scorsa] dddd [a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT":"[Lo scorso] dddd [a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT"},sameElse:"L"},relativeTime:{future:"tra %s",past:"%s fa",s:"alcuni secondi",ss:"%d secondi",m:"un minuto",mm:"%d minuti",h:"un'ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",w:"una settimana",ww:"%d settimane",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%d\xba",week:{dow:1,doy:4}})})(n(30381))},39183:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("ja",{eras:[{since:"2019-05-01",offset:1,name:"令和",narrow:"㋿",abbr:"R"},{since:"1989-01-08",until:"2019-04-30",offset:1,name:"平成",narrow:"㍻",abbr:"H"},{since:"1926-12-25",until:"1989-01-07",offset:1,name:"昭和",narrow:"㍼",abbr:"S"},{since:"1912-07-30",until:"1926-12-24",offset:1,name:"大正",narrow:"㍽",abbr:"T"},{since:"1873-01-01",until:"1912-07-29",offset:6,name:"明治",narrow:"㍾",abbr:"M"},{since:"0001-01-01",until:"1873-12-31",offset:1,name:"西暦",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"紀元前",narrow:"BC",abbr:"BC"},],eraYearOrdinalRegex:/(元|\d+)年/,eraYearOrdinalParse:function(e,t){return"元"===t[1]?1:parseInt(t[1]||e,10)},months:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"日曜日_月曜日_火曜日_水曜日_木曜日_金曜日_土曜日".split("_"),weekdaysShort:"日_月_火_水_木_金_土".split("_"),weekdaysMin:"日_月_火_水_木_金_土".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日 dddd HH:mm",l:"YYYY/MM/DD",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日(ddd) HH:mm"},meridiemParse:/午前|午後/i,isPM:function(e){return"午後"===e},meridiem:function(e,t,n){return e<12?"午前":"午後"},calendar:{sameDay:"[今日] LT",nextDay:"[明日] LT",nextWeek:function(e){return e.week()!==this.week()?"[来週]dddd LT":"dddd LT"},lastDay:"[昨日] LT",lastWeek:function(e){return this.week()!==e.week()?"[先週]dddd LT":"dddd LT"},sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}日/,ordinal:function(e,t){switch(t){case"y":return 1===e?"元年":e+"年";case"d":case"D":case"DDD":return e+"日";default:return e}},relativeTime:{future:"%s後",past:"%s前",s:"数秒",ss:"%d秒",m:"1分",mm:"%d分",h:"1時間",hh:"%d時間",d:"1日",dd:"%d日",M:"1ヶ月",MM:"%dヶ月",y:"1年",yy:"%d年"}})})(n(30381))},24286:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("jv",{months:"Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_Nopember_Desember".split("_"),monthsShort:"Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nop_Des".split("_"),weekdays:"Minggu_Senen_Seloso_Rebu_Kemis_Jemuwah_Septu".split("_"),weekdaysShort:"Min_Sen_Sel_Reb_Kem_Jem_Sep".split("_"),weekdaysMin:"Mg_Sn_Sl_Rb_Km_Jm_Sp".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/enjing|siyang|sonten|ndalu/,meridiemHour:function(e,t){return(12===e&&(e=0),"enjing"===t)?e:"siyang"===t?e>=11?e:e+12:"sonten"===t||"ndalu"===t?e+12:void 0},meridiem:function(e,t,n){return e<11?"enjing":e<15?"siyang":e<19?"sonten":"ndalu"},calendar:{sameDay:"[Dinten puniko pukul] LT",nextDay:"[Mbenjang pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kala wingi pukul] LT",lastWeek:"dddd [kepengker pukul] LT",sameElse:"L"},relativeTime:{future:"wonten ing %s",past:"%s ingkang kepengker",s:"sawetawis detik",ss:"%d detik",m:"setunggal menit",mm:"%d menit",h:"setunggal jam",hh:"%d jam",d:"sedinten",dd:"%d dinten",M:"sewulan",MM:"%d wulan",y:"setaun",yy:"%d taun"},week:{dow:1,doy:7}})})(n(30381))},12105:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("ka",{months:"იანვარი_თებერვალი_მარტი_აპრილი_მაისი_ივნისი_ივლისი_აგვისტო_სექტემბერი_ოქტომბერი_ნოემბერი_დეკემბერი".split("_"),monthsShort:"იან_თებ_მარ_აპრ_მაი_ივნ_ივლ_აგვ_სექ_ოქტ_ნოე_დეკ".split("_"),weekdays:{standalone:"კვირა_ორშაბათი_სამშაბათი_ოთხშაბათი_ხუთშაბათი_პარასკევი_შაბათი".split("_"),format:"კვირას_ორშაბათს_სამშაბათს_ოთხშაბათს_ხუთშაბათს_პარასკევს_შაბათს".split("_"),isFormat:/(წინა|შემდეგ)/},weekdaysShort:"კვი_ორშ_სამ_ოთხ_ხუთ_პარ_შაბ".split("_"),weekdaysMin:"კვ_ორ_სა_ოთ_ხუ_პა_შა".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[დღეს] LT[-ზე]",nextDay:"[ხვალ] LT[-ზე]",lastDay:"[გუშინ] LT[-ზე]",nextWeek:"[შემდეგ] dddd LT[-ზე]",lastWeek:"[წინა] dddd LT-ზე",sameElse:"L"},relativeTime:{future:function(e){return e.replace(/(წამ|წუთ|საათ|წელ|დღ|თვ)(ი|ე)/,function(e,t,n){return"ი"===n?t+"ში":t+n+"ში"})},past:function(e){return/(წამი|წუთი|საათი|დღე|თვე)/.test(e)?e.replace(/(ი|ე)$/,"ის წინ"):/წელი/.test(e)?e.replace(/წელი$/,"წლის წინ"):e},s:"რამდენიმე წამი",ss:"%d წამი",m:"წუთი",mm:"%d წუთი",h:"საათი",hh:"%d საათი",d:"დღე",dd:"%d დღე",M:"თვე",MM:"%d თვე",y:"წელი",yy:"%d წელი"},dayOfMonthOrdinalParse:/0|1-ლი|მე-\d{1,2}|\d{1,2}-ე/,ordinal:function(e){return 0===e?e:1===e?e+"-ლი":e<20||e<=100&&e%20==0||e%100==0?"მე-"+e:e+"-ე"},week:{dow:1,doy:7}})})(n(30381))},47772:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration +var t={0:"-ші",1:"-ші",2:"-ші",3:"-ші",4:"-ші",5:"-ші",6:"-шы",7:"-ші",8:"-ші",9:"-шы",10:"-шы",20:"-шы",30:"-шы",40:"-шы",50:"-ші",60:"-шы",70:"-ші",80:"-ші",90:"-шы",100:"-ші"};return e.defineLocale("kk",{months:"қаңтар_ақпан_наурыз_сәуір_мамыр_маусым_шілде_тамыз_қыркүйек_қазан_қараша_желтоқсан".split("_"),monthsShort:"қаң_ақп_нау_сәу_мам_мау_шіл_там_қыр_қаз_қар_жел".split("_"),weekdays:"жексенбі_дүйсенбі_сейсенбі_сәрсенбі_бейсенбі_жұма_сенбі".split("_"),weekdaysShort:"жек_дүй_сей_сәр_бей_жұм_сен".split("_"),weekdaysMin:"жк_дй_сй_ср_бй_жм_сн".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Бүгін сағат] LT",nextDay:"[Ертең сағат] LT",nextWeek:"dddd [сағат] LT",lastDay:"[Кеше сағат] LT",lastWeek:"[Өткен аптаның] dddd [сағат] LT",sameElse:"L"},relativeTime:{future:"%s ішінде",past:"%s бұрын",s:"бірнеше секунд",ss:"%d секунд",m:"бір минут",mm:"%d минут",h:"бір сағат",hh:"%d сағат",d:"бір күн",dd:"%d күн",M:"бір ай",MM:"%d ай",y:"бір жыл",yy:"%d жыл"},dayOfMonthOrdinalParse:/\d{1,2}-(ші|шы)/,ordinal:function(e){var n=e%10,r=e>=100?100:null;return e+(t[e]||t[n]||t[r])},week:{dow:1,doy:7}})})(n(30381))},18758:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration +var t={1:"១",2:"២",3:"៣",4:"៤",5:"៥",6:"៦",7:"៧",8:"៨",9:"៩",0:"០"},n={"១":"1","២":"2","៣":"3","៤":"4","៥":"5","៦":"6","៧":"7","៨":"8","៩":"9","០":"0"};return e.defineLocale("km",{months:"មករា_កុម្ភៈ_មីនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ".split("_"),monthsShort:"មករា_កុម្ភៈ_មីនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ".split("_"),weekdays:"អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍".split("_"),weekdaysShort:"អា_ច_អ_ព_ព្រ_សុ_ស".split("_"),weekdaysMin:"អា_ច_អ_ព_ព្រ_សុ_ស".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},meridiemParse:/ព្រឹក|ល្ងាច/,isPM:function(e){return"ល្ងាច"===e},meridiem:function(e,t,n){return e<12?"ព្រឹក":"ល្ងាច"},calendar:{sameDay:"[ថ្ងៃនេះ ម៉ោង] LT",nextDay:"[ស្អែក ម៉ោង] LT",nextWeek:"dddd [ម៉ោង] LT",lastDay:"[ម្សិលមិញ ម៉ោង] LT",lastWeek:"dddd [សប្តាហ៍មុន] [ម៉ោង] LT",sameElse:"L"},relativeTime:{future:"%sទៀត",past:"%sមុន",s:"ប៉ុន្មានវិនាទី",ss:"%d វិនាទី",m:"មួយនាទី",mm:"%d នាទី",h:"មួយម៉ោង",hh:"%d ម៉ោង",d:"មួយថ្ងៃ",dd:"%d ថ្ងៃ",M:"មួយខែ",MM:"%d ខែ",y:"មួយឆ្នាំ",yy:"%d ឆ្នាំ"},dayOfMonthOrdinalParse:/ទី\d{1,2}/,ordinal:"ទី%d",preparse:function(e){return e.replace(/[១២៣៤៥៦៧៨៩០]/g,function(e){return n[e]})},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]})},week:{dow:1,doy:4}})})(n(30381))},79282:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration +var t={1:"೧",2:"೨",3:"೩",4:"೪",5:"೫",6:"೬",7:"೭",8:"೮",9:"೯",0:"೦"},n={"೧":"1","೨":"2","೩":"3","೪":"4","೫":"5","೬":"6","೭":"7","೮":"8","೯":"9","೦":"0"};return e.defineLocale("kn",{months:"ಜನವರಿ_ಫೆಬ್ರವರಿ_ಮಾರ್ಚ್_ಏಪ್ರಿಲ್_ಮೇ_ಜೂನ್_ಜುಲೈ_ಆಗಸ್ಟ್_ಸೆಪ್ಟೆಂಬರ್_ಅಕ್ಟೋಬರ್_ನವೆಂಬರ್_ಡಿಸೆಂಬರ್".split("_"),monthsShort:"ಜನ_ಫೆಬ್ರ_ಮಾರ್ಚ್_ಏಪ್ರಿಲ್_ಮೇ_ಜೂನ್_ಜುಲೈ_ಆಗಸ್ಟ್_ಸೆಪ್ಟೆಂ_ಅಕ್ಟೋ_ನವೆಂ_ಡಿಸೆಂ".split("_"),monthsParseExact:!0,weekdays:"ಭಾನುವಾರ_ಸೋಮವಾರ_ಮಂಗಳವಾರ_ಬುಧವಾರ_ಗುರುವಾರ_ಶುಕ್ರವಾರ_ಶನಿವಾರ".split("_"),weekdaysShort:"ಭಾನು_ಸೋಮ_ಮಂಗಳ_ಬುಧ_ಗುರು_ಶುಕ್ರ_ಶನಿ".split("_"),weekdaysMin:"ಭಾ_ಸೋ_ಮಂ_ಬು_ಗು_ಶು_ಶ".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},calendar:{sameDay:"[ಇಂದು] LT",nextDay:"[ನಾಳೆ] LT",nextWeek:"dddd, LT",lastDay:"[ನಿನ್ನೆ] LT",lastWeek:"[ಕೊನೆಯ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s ನಂತರ",past:"%s ಹಿಂದೆ",s:"ಕೆಲವು ಕ್ಷಣಗಳು",ss:"%d ಸೆಕೆಂಡುಗಳು",m:"ಒಂದು ನಿಮಿಷ",mm:"%d ನಿಮಿಷ",h:"ಒಂದು ಗಂಟೆ",hh:"%d ಗಂಟೆ",d:"ಒಂದು ದಿನ",dd:"%d ದಿನ",M:"ಒಂದು ತಿಂಗಳು",MM:"%d ತಿಂಗಳು",y:"ಒಂದು ವರ್ಷ",yy:"%d ವರ್ಷ"},preparse:function(e){return e.replace(/[೧೨೩೪೫೬೭೮೯೦]/g,function(e){return n[e]})},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]})},meridiemParse:/ರಾತ್ರಿ|ಬೆಳಿಗ್ಗೆ|ಮಧ್ಯಾಹ್ನ|ಸಂಜೆ/,meridiemHour:function(e,t){return(12===e&&(e=0),"ರಾತ್ರಿ"===t)?e<4?e:e+12:"ಬೆಳಿಗ್ಗೆ"===t?e:"ಮಧ್ಯಾಹ್ನ"===t?e>=10?e:e+12:"ಸಂಜೆ"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"ರಾತ್ರಿ":e<10?"ಬೆಳಿಗ್ಗೆ":e<17?"ಮಧ್ಯಾಹ್ನ":e<20?"ಸಂಜೆ":"ರಾತ್ರಿ"},dayOfMonthOrdinalParse:/\d{1,2}(ನೇ)/,ordinal:function(e){return e+"ನೇ"},week:{dow:0,doy:6}})})(n(30381))},33730:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("ko",{months:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),monthsShort:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),weekdays:"일요일_월요일_화요일_수요일_목요일_금요일_토요일".split("_"),weekdaysShort:"일_월_화_수_목_금_토".split("_"),weekdaysMin:"일_월_화_수_목_금_토".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"YYYY.MM.DD.",LL:"YYYY년 MMMM D일",LLL:"YYYY년 MMMM D일 A h:mm",LLLL:"YYYY년 MMMM D일 dddd A h:mm",l:"YYYY.MM.DD.",ll:"YYYY년 MMMM D일",lll:"YYYY년 MMMM D일 A h:mm",llll:"YYYY년 MMMM D일 dddd A h:mm"},calendar:{sameDay:"오늘 LT",nextDay:"내일 LT",nextWeek:"dddd LT",lastDay:"어제 LT",lastWeek:"지난주 dddd LT",sameElse:"L"},relativeTime:{future:"%s 후",past:"%s 전",s:"몇 초",ss:"%d초",m:"1분",mm:"%d분",h:"한 시간",hh:"%d시간",d:"하루",dd:"%d일",M:"한 달",MM:"%d달",y:"일 년",yy:"%d년"},dayOfMonthOrdinalParse:/\d{1,2}(일|월|주)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"일";case"M":return e+"월";case"w":case"W":return e+"주";default:return e}},meridiemParse:/오전|오후/,isPM:function(e){return"오후"===e},meridiem:function(e,t,n){return e<12?"오전":"오후"}})})(n(30381))},1408:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration +var t={1:"١",2:"٢",3:"٣",4:"٤",5:"٥",6:"٦",7:"٧",8:"٨",9:"٩",0:"٠"},n={"١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","٠":"0"},r=["کانونی دووەم","شوبات","ئازار","نیسان","ئایار","حوزەیران","تەمموز","ئاب","ئەیلوول","تشرینی یەكەم","تشرینی دووەم","كانونی یەکەم",];return e.defineLocale("ku",{months:r,monthsShort:r,weekdays:"یه‌كشه‌ممه‌_دووشه‌ممه‌_سێشه‌ممه‌_چوارشه‌ممه‌_پێنجشه‌ممه‌_هه‌ینی_شه‌ممه‌".split("_"),weekdaysShort:"یه‌كشه‌م_دووشه‌م_سێشه‌م_چوارشه‌م_پێنجشه‌م_هه‌ینی_شه‌ممه‌".split("_"),weekdaysMin:"ی_د_س_چ_پ_ه_ش".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},meridiemParse:/ئێواره‌|به‌یانی/,isPM:function(e){return/ئێواره‌/.test(e)},meridiem:function(e,t,n){return e<12?"به‌یانی":"ئێواره‌"},calendar:{sameDay:"[ئه‌مرۆ كاتژمێر] LT",nextDay:"[به‌یانی كاتژمێر] LT",nextWeek:"dddd [كاتژمێر] LT",lastDay:"[دوێنێ كاتژمێر] LT",lastWeek:"dddd [كاتژمێر] LT",sameElse:"L"},relativeTime:{future:"له‌ %s",past:"%s",s:"چه‌ند چركه‌یه‌ك",ss:"چركه‌ %d",m:"یه‌ك خوله‌ك",mm:"%d خوله‌ك",h:"یه‌ك كاتژمێر",hh:"%d كاتژمێر",d:"یه‌ك ڕۆژ",dd:"%d ڕۆژ",M:"یه‌ك مانگ",MM:"%d مانگ",y:"یه‌ك ساڵ",yy:"%d ساڵ"},preparse:function(e){return e.replace(/[١٢٣٤٥٦٧٨٩٠]/g,function(e){return n[e]}).replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]}).replace(/,/g,"،")},week:{dow:6,doy:12}})})(n(30381))},33291:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration +var t={0:"-чү",1:"-чи",2:"-чи",3:"-чү",4:"-чү",5:"-чи",6:"-чы",7:"-чи",8:"-чи",9:"-чу",10:"-чу",20:"-чы",30:"-чу",40:"-чы",50:"-чү",60:"-чы",70:"-чи",80:"-чи",90:"-чу",100:"-чү"};return e.defineLocale("ky",{months:"январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_"),monthsShort:"янв_фев_март_апр_май_июнь_июль_авг_сен_окт_ноя_дек".split("_"),weekdays:"Жекшемби_Дүйшөмбү_Шейшемби_Шаршемби_Бейшемби_Жума_Ишемби".split("_"),weekdaysShort:"Жек_Дүй_Шей_Шар_Бей_Жум_Ише".split("_"),weekdaysMin:"Жк_Дй_Шй_Шр_Бй_Жм_Иш".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Бүгүн саат] LT",nextDay:"[Эртең саат] LT",nextWeek:"dddd [саат] LT",lastDay:"[Кечээ саат] LT",lastWeek:"[Өткөн аптанын] dddd [күнү] [саат] LT",sameElse:"L"},relativeTime:{future:"%s ичинде",past:"%s мурун",s:"бирнече секунд",ss:"%d секунд",m:"бир мүнөт",mm:"%d мүнөт",h:"бир саат",hh:"%d саат",d:"бир күн",dd:"%d күн",M:"бир ай",MM:"%d ай",y:"бир жыл",yy:"%d жыл"},dayOfMonthOrdinalParse:/\d{1,2}-(чи|чы|чү|чу)/,ordinal:function(e){var n=e%10,r=e>=100?100:null;return e+(t[e]||t[n]||t[r])},week:{dow:1,doy:7}})})(n(30381))},36841:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration +function t(e,t,n,r){var i={m:["eng Minutt","enger Minutt"],h:["eng Stonn","enger Stonn"],d:["een Dag","engem Dag"],M:["ee Mount","engem Mount"],y:["ee Joer","engem Joer"]};return t?i[n][0]:i[n][1]}function n(e){return i(e.substr(0,e.indexOf(" ")))?"a "+e:"an "+e}function r(e){return i(e.substr(0,e.indexOf(" ")))?"viru "+e:"virun "+e}function i(e){if(e=parseInt(e,10),isNaN(e))return!1;if(e<0)return!0;if(e<10)return!!(4<=e)&&!!(e<=7);if(e<100){var t=e%10,n=e/10;return 0===t?i(n):i(t)}if(!(e<1e4))return i(e/=1e3);for(;e>=10;)e/=10;return i(e)}return e.defineLocale("lb",{months:"Januar_Februar_M\xe4erz_Abr\xebll_Mee_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Febr._Mrz._Abr._Mee_Jun._Jul._Aug._Sept._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonndeg_M\xe9indeg_D\xebnschdeg_M\xebttwoch_Donneschdeg_Freideg_Samschdeg".split("_"),weekdaysShort:"So._M\xe9._D\xeb._M\xeb._Do._Fr._Sa.".split("_"),weekdaysMin:"So_M\xe9_D\xeb_M\xeb_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm [Auer]",LTS:"H:mm:ss [Auer]",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm [Auer]",LLLL:"dddd, D. MMMM YYYY H:mm [Auer]"},calendar:{sameDay:"[Haut um] LT",sameElse:"L",nextDay:"[Muer um] LT",nextWeek:"dddd [um] LT",lastDay:"[G\xebschter um] LT",lastWeek:function(){switch(this.day()){case 2:case 4:return"[Leschten] dddd [um] LT";default:return"[Leschte] dddd [um] LT"}}},relativeTime:{future:n,past:r,s:"e puer Sekonnen",ss:"%d Sekonnen",m:t,mm:"%d Minutten",h:t,hh:"%d Stonnen",d:t,dd:"%d Deeg",M:t,MM:"%d M\xe9int",y:t,yy:"%d Joer"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})})(n(30381))},55466:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("lo",{months:"ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ".split("_"),monthsShort:"ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ".split("_"),weekdays:"ອາທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ".split("_"),weekdaysShort:"ທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ".split("_"),weekdaysMin:"ທ_ຈ_ອຄ_ພ_ພຫ_ສກ_ສ".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"ວັນdddd D MMMM YYYY HH:mm"},meridiemParse:/ຕອນເຊົ້າ|ຕອນແລງ/,isPM:function(e){return"ຕອນແລງ"===e},meridiem:function(e,t,n){return e<12?"ຕອນເຊົ້າ":"ຕອນແລງ"},calendar:{sameDay:"[ມື້ນີ້ເວລາ] LT",nextDay:"[ມື້ອື່ນເວລາ] LT",nextWeek:"[ວັນ]dddd[ໜ້າເວລາ] LT",lastDay:"[ມື້ວານນີ້ເວລາ] LT",lastWeek:"[ວັນ]dddd[ແລ້ວນີ້ເວລາ] LT",sameElse:"L"},relativeTime:{future:"ອີກ %s",past:"%sຜ່ານມາ",s:"ບໍ່ເທົ່າໃດວິນາທີ",ss:"%d ວິນາທີ",m:"1 ນາທີ",mm:"%d ນາທີ",h:"1 ຊົ່ວໂມງ",hh:"%d ຊົ່ວໂມງ",d:"1 ມື້",dd:"%d ມື້",M:"1 ເດືອນ",MM:"%d ເດືອນ",y:"1 ປີ",yy:"%d ປີ"},dayOfMonthOrdinalParse:/(ທີ່)\d{1,2}/,ordinal:function(e){return"ທີ່"+e}})})(n(30381))},57010:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration +var t={ss:"sekundė_sekundžių_sekundes",m:"minutė_minutės_minutę",mm:"minutės_minučių_minutes",h:"valanda_valandos_valandą",hh:"valandos_valandų_valandas",d:"diena_dienos_dieną",dd:"dienos_dienų_dienas",M:"mėnuo_mėnesio_mėnesį",MM:"mėnesiai_mėnesių_mėnesius",y:"metai_metų_metus",yy:"metai_metų_metus"};function n(e,t,n,r){return t?"kelios sekundės":r?"kelių sekundžių":"kelias sekundes"}function r(e,t,n,r){return t?a(n)[0]:r?a(n)[1]:a(n)[2]}function i(e){return e%10==0||e>10&&e<20}function a(e){return t[e].split("_")}function o(e,t,n,o){var s=e+" ";return 1===e?s+r(e,t,n[0],o):t?s+(i(e)?a(n)[1]:a(n)[0]):o?s+a(n)[1]:s+(i(e)?a(n)[1]:a(n)[2])}return e.defineLocale("lt",{months:{format:"sausio_vasario_kovo_balandžio_gegužės_birželio_liepos_rugpjūčio_rugsėjo_spalio_lapkričio_gruodžio".split("_"),standalone:"sausis_vasaris_kovas_balandis_gegužė_birželis_liepa_rugpjūtis_rugsėjis_spalis_lapkritis_gruodis".split("_"),isFormat:/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?|MMMM?(\[[^\[\]]*\]|\s)+D[oD]?/},monthsShort:"sau_vas_kov_bal_geg_bir_lie_rgp_rgs_spa_lap_grd".split("_"),weekdays:{format:"sekmadienį_pirmadienį_antradienį_trečiadienį_ketvirtadienį_penktadienį_šeštadienį".split("_"),standalone:"sekmadienis_pirmadienis_antradienis_trečiadienis_ketvirtadienis_penktadienis_šeštadienis".split("_"),isFormat:/dddd HH:mm/},weekdaysShort:"Sek_Pir_Ant_Tre_Ket_Pen_Šeš".split("_"),weekdaysMin:"S_P_A_T_K_Pn_Š".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY [m.] MMMM D [d.]",LLL:"YYYY [m.] MMMM D [d.], HH:mm [val.]",LLLL:"YYYY [m.] MMMM D [d.], dddd, HH:mm [val.]",l:"YYYY-MM-DD",ll:"YYYY [m.] MMMM D [d.]",lll:"YYYY [m.] MMMM D [d.], HH:mm [val.]",llll:"YYYY [m.] MMMM D [d.], ddd, HH:mm [val.]"},calendar:{sameDay:"[Šiandien] LT",nextDay:"[Rytoj] LT",nextWeek:"dddd LT",lastDay:"[Vakar] LT",lastWeek:"[Praėjusį] dddd LT",sameElse:"L"},relativeTime:{future:"po %s",past:"prieš %s",s:n,ss:o,m:r,mm:o,h:r,hh:o,d:r,dd:o,M:r,MM:o,y:r,yy:o},dayOfMonthOrdinalParse:/\d{1,2}-oji/,ordinal:function(e){return e+"-oji"},week:{dow:1,doy:4}})})(n(30381))},37595:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration +var t={ss:"sekundes_sekundēm_sekunde_sekundes".split("_"),m:"minūtes_minūtēm_minūte_minūtes".split("_"),mm:"minūtes_minūtēm_minūte_minūtes".split("_"),h:"stundas_stundām_stunda_stundas".split("_"),hh:"stundas_stundām_stunda_stundas".split("_"),d:"dienas_dienām_diena_dienas".split("_"),dd:"dienas_dienām_diena_dienas".split("_"),M:"mēneša_mēnešiem_mēnesis_mēneši".split("_"),MM:"mēneša_mēnešiem_mēnesis_mēneši".split("_"),y:"gada_gadiem_gads_gadi".split("_"),yy:"gada_gadiem_gads_gadi".split("_")};function n(e,t,n){return n?t%10==1&&t%100!=11?e[2]:e[3]:t%10==1&&t%100!=11?e[0]:e[1]}function r(e,r,i){return e+" "+n(t[i],e,r)}function i(e,r,i){return n(t[i],e,r)}function a(e,t){return t?"dažas sekundes":"dažām sekundēm"}return e.defineLocale("lv",{months:"janvāris_februāris_marts_aprīlis_maijs_jūnijs_jūlijs_augusts_septembris_oktobris_novembris_decembris".split("_"),monthsShort:"jan_feb_mar_apr_mai_jūn_jūl_aug_sep_okt_nov_dec".split("_"),weekdays:"svētdiena_pirmdiena_otrdiena_trešdiena_ceturtdiena_piektdiena_sestdiena".split("_"),weekdaysShort:"Sv_P_O_T_C_Pk_S".split("_"),weekdaysMin:"Sv_P_O_T_C_Pk_S".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY.",LL:"YYYY. [gada] D. MMMM",LLL:"YYYY. [gada] D. MMMM, HH:mm",LLLL:"YYYY. [gada] D. MMMM, dddd, HH:mm"},calendar:{sameDay:"[Šodien pulksten] LT",nextDay:"[Rīt pulksten] LT",nextWeek:"dddd [pulksten] LT",lastDay:"[Vakar pulksten] LT",lastWeek:"[Pagājušā] dddd [pulksten] LT",sameElse:"L"},relativeTime:{future:"pēc %s",past:"pirms %s",s:a,ss:r,m:i,mm:r,h:i,hh:r,d:i,dd:r,M:i,MM:r,y:i,yy:r},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})})(n(30381))},39861:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration +var t={words:{ss:["sekund","sekunda","sekundi"],m:["jedan minut","jednog minuta"],mm:["minut","minuta","minuta"],h:["jedan sat","jednog sata"],hh:["sat","sata","sati"],dd:["dan","dana","dana"],MM:["mjesec","mjeseca","mjeseci"],yy:["godina","godine","godina"]},correctGrammaticalCase:function(e,t){return 1===e?t[0]:e>=2&&e<=4?t[1]:t[2]},translate:function(e,n,r){var i=t.words[r];return 1===r.length?n?i[0]:i[1]:e+" "+t.correctGrammaticalCase(e,i)}};return e.defineLocale("me",{months:"januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar".split("_"),monthsShort:"jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sjutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[juče u] LT",lastWeek:function(){return["[prošle] [nedjelje] [u] LT","[prošlog] [ponedjeljka] [u] LT","[prošlog] [utorka] [u] LT","[prošle] [srijede] [u] LT","[prošlog] [četvrtka] [u] LT","[prošlog] [petka] [u] LT","[prošle] [subote] [u] LT",][this.day()]},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"nekoliko sekundi",ss:t.translate,m:t.translate,mm:t.translate,h:t.translate,hh:t.translate,d:"dan",dd:t.translate,M:"mjesec",MM:t.translate,y:"godinu",yy:t.translate},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})})(n(30381))},35493:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("mi",{months:"Kohi-tāte_Hui-tanguru_Poutū-te-rangi_Paenga-whāwhā_Haratua_Pipiri_Hōngoingoi_Here-turi-kōkā_Mahuru_Whiringa-ā-nuku_Whiringa-ā-rangi_Hakihea".split("_"),monthsShort:"Kohi_Hui_Pou_Pae_Hara_Pipi_Hōngoi_Here_Mahu_Whi-nu_Whi-ra_Haki".split("_"),monthsRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,monthsStrictRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,monthsShortRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,monthsShortStrictRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,2}/i,weekdays:"Rātapu_Mane_Tūrei_Wenerei_Tāite_Paraire_Hātarei".split("_"),weekdaysShort:"Ta_Ma_Tū_We_Tāi_Pa_Hā".split("_"),weekdaysMin:"Ta_Ma_Tū_We_Tāi_Pa_Hā".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [i] HH:mm",LLLL:"dddd, D MMMM YYYY [i] HH:mm"},calendar:{sameDay:"[i teie mahana, i] LT",nextDay:"[apopo i] LT",nextWeek:"dddd [i] LT",lastDay:"[inanahi i] LT",lastWeek:"dddd [whakamutunga i] LT",sameElse:"L"},relativeTime:{future:"i roto i %s",past:"%s i mua",s:"te hēkona ruarua",ss:"%d hēkona",m:"he meneti",mm:"%d meneti",h:"te haora",hh:"%d haora",d:"he ra",dd:"%d ra",M:"he marama",MM:"%d marama",y:"he tau",yy:"%d tau"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%d\xba",week:{dow:1,doy:4}})})(n(30381))},95966:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("mk",{months:"јануари_февруари_март_април_мај_јуни_јули_август_септември_октомври_ноември_декември".split("_"),monthsShort:"јан_фев_мар_апр_мај_јун_јул_авг_сеп_окт_ное_дек".split("_"),weekdays:"недела_понеделник_вторник_среда_четврток_петок_сабота".split("_"),weekdaysShort:"нед_пон_вто_сре_чет_пет_саб".split("_"),weekdaysMin:"нe_пo_вт_ср_че_пе_сa".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[Денес во] LT",nextDay:"[Утре во] LT",nextWeek:"[Во] dddd [во] LT",lastDay:"[Вчера во] LT",lastWeek:function(){switch(this.day()){case 0:case 3:case 6:return"[Изминатата] dddd [во] LT";case 1:case 2:case 4:case 5:return"[Изминатиот] dddd [во] LT"}},sameElse:"L"},relativeTime:{future:"за %s",past:"пред %s",s:"неколку секунди",ss:"%d секунди",m:"една минута",mm:"%d минути",h:"еден час",hh:"%d часа",d:"еден ден",dd:"%d дена",M:"еден месец",MM:"%d месеци",y:"една година",yy:"%d години"},dayOfMonthOrdinalParse:/\d{1,2}-(ев|ен|ти|ви|ри|ми)/,ordinal:function(e){var t=e%10,n=e%100;if(0===e)return e+"-ев";if(0===n)return e+"-ен";if(n>10&&n<20)return e+"-ти";if(1===t)return e+"-ви";if(2===t)return e+"-ри";else if(7===t||8===t)return e+"-ми";else return e+"-ти"},week:{dow:1,doy:7}})})(n(30381))},87341:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("ml",{months:"ജനുവരി_ഫെബ്രുവരി_മാർച്ച്_ഏപ്രിൽ_മേയ്_ജൂൺ_ജൂലൈ_ഓഗസ്റ്റ്_സെപ്റ്റംബർ_ഒക്ടോബർ_നവംബർ_ഡിസംബർ".split("_"),monthsShort:"ജനു._ഫെബ്രു._മാർ._ഏപ്രി._മേയ്_ജൂൺ_ജൂലൈ._ഓഗ._സെപ്റ്റ._ഒക്ടോ._നവം._ഡിസം.".split("_"),monthsParseExact:!0,weekdays:"ഞായറാഴ്ച_തിങ്കളാഴ്ച_ചൊവ്വാഴ്ച_ബുധനാഴ്ച_വ്യാഴാഴ്ച_വെള്ളിയാഴ്ച_ശനിയാഴ്ച".split("_"),weekdaysShort:"ഞായർ_തിങ്കൾ_ചൊവ്വ_ബുധൻ_വ്യാഴം_വെള്ളി_ശനി".split("_"),weekdaysMin:"ഞാ_തി_ചൊ_ബു_വ്യാ_വെ_ശ".split("_"),longDateFormat:{LT:"A h:mm -നു",LTS:"A h:mm:ss -നു",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm -നു",LLLL:"dddd, D MMMM YYYY, A h:mm -നു"},calendar:{sameDay:"[ഇന്ന്] LT",nextDay:"[നാളെ] LT",nextWeek:"dddd, LT",lastDay:"[ഇന്നലെ] LT",lastWeek:"[കഴിഞ്ഞ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s കഴിഞ്ഞ്",past:"%s മുൻപ്",s:"അൽപ നിമിഷങ്ങൾ",ss:"%d സെക്കൻഡ്",m:"ഒരു മിനിറ്റ്",mm:"%d മിനിറ്റ്",h:"ഒരു മണിക്കൂർ",hh:"%d മണിക്കൂർ",d:"ഒരു ദിവസം",dd:"%d ദിവസം",M:"ഒരു മാസം",MM:"%d മാസം",y:"ഒരു വർഷം",yy:"%d വർഷം"},meridiemParse:/രാത്രി|രാവിലെ|ഉച്ച കഴിഞ്ഞ്|വൈകുന്നേരം|രാത്രി/i,meridiemHour:function(e,t){return(12===e&&(e=0),"രാത്രി"===t&&e>=4||"ഉച്ച കഴിഞ്ഞ്"===t||"വൈകുന്നേരം"===t)?e+12:e},meridiem:function(e,t,n){return e<4?"രാത്രി":e<12?"രാവിലെ":e<17?"ഉച്ച കഴിഞ്ഞ്":e<20?"വൈകുന്നേരം":"രാത്രി"}})})(n(30381))},5115:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration +function t(e,t,n,r){switch(n){case"s":return t?"хэдхэн секунд":"хэдхэн секундын";case"ss":return e+(t?" секунд":" секундын");case"m":case"mm":return e+(t?" минут":" минутын");case"h":case"hh":return e+(t?" цаг":" цагийн");case"d":case"dd":return e+(t?" өдөр":" өдрийн");case"M":case"MM":return e+(t?" сар":" сарын");case"y":case"yy":return e+(t?" жил":" жилийн");default:return e}}return e.defineLocale("mn",{months:"Нэгдүгээр сар_Хоёрдугаар сар_Гуравдугаар сар_Дөрөвдүгээр сар_Тавдугаар сар_Зургадугаар сар_Долдугаар сар_Наймдугаар сар_Есдүгээр сар_Аравдугаар сар_Арван нэгдүгээр сар_Арван хоёрдугаар сар".split("_"),monthsShort:"1 сар_2 сар_3 сар_4 сар_5 сар_6 сар_7 сар_8 сар_9 сар_10 сар_11 сар_12 сар".split("_"),monthsParseExact:!0,weekdays:"Ням_Даваа_Мягмар_Лхагва_Пүрэв_Баасан_Бямба".split("_"),weekdaysShort:"Ням_Дав_Мяг_Лха_Пүр_Баа_Бям".split("_"),weekdaysMin:"Ня_Да_Мя_Лх_Пү_Ба_Бя".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY оны MMMMын D",LLL:"YYYY оны MMMMын D HH:mm",LLLL:"dddd, YYYY оны MMMMын D HH:mm"},meridiemParse:/ҮӨ|ҮХ/i,isPM:function(e){return"ҮХ"===e},meridiem:function(e,t,n){return e<12?"ҮӨ":"ҮХ"},calendar:{sameDay:"[Өнөөдөр] LT",nextDay:"[Маргааш] LT",nextWeek:"[Ирэх] dddd LT",lastDay:"[Өчигдөр] LT",lastWeek:"[Өнгөрсөн] dddd LT",sameElse:"L"},relativeTime:{future:"%s дараа",past:"%s өмнө",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2} өдөр/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+" өдөр";default:return e}}})})(n(30381))},10370:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration +var t={1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"},n={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"};function r(e,t,n,r){var i="";if(t)switch(n){case"s":i="काही सेकंद";break;case"ss":i="%d सेकंद";break;case"m":i="एक मिनिट";break;case"mm":i="%d मिनिटे";break;case"h":i="एक तास";break;case"hh":i="%d तास";break;case"d":i="एक दिवस";break;case"dd":i="%d दिवस";break;case"M":i="एक महिना";break;case"MM":i="%d महिने";break;case"y":i="एक वर्ष";break;case"yy":i="%d वर्षे"}else switch(n){case"s":i="काही सेकंदां";break;case"ss":i="%d सेकंदां";break;case"m":i="एका मिनिटा";break;case"mm":i="%d मिनिटां";break;case"h":i="एका तासा";break;case"hh":i="%d तासां";break;case"d":i="एका दिवसा";break;case"dd":i="%d दिवसां";break;case"M":i="एका महिन्या";break;case"MM":i="%d महिन्यां";break;case"y":i="एका वर्षा";break;case"yy":i="%d वर्षां"}return i.replace(/%d/i,e)}return e.defineLocale("mr",{months:"जानेवारी_फेब्रुवारी_मार्च_एप्रिल_मे_जून_जुलै_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर".split("_"),monthsShort:"जाने._फेब्रु._मार्च._एप्रि._मे._जून._जुलै._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.".split("_"),monthsParseExact:!0,weekdays:"रविवार_सोमवार_मंगळवार_बुधवार_गुरूवार_शुक्रवार_शनिवार".split("_"),weekdaysShort:"रवि_सोम_मंगळ_बुध_गुरू_शुक्र_शनि".split("_"),weekdaysMin:"र_सो_मं_बु_गु_शु_श".split("_"),longDateFormat:{LT:"A h:mm वाजता",LTS:"A h:mm:ss वाजता",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm वाजता",LLLL:"dddd, D MMMM YYYY, A h:mm वाजता"},calendar:{sameDay:"[आज] LT",nextDay:"[उद्या] LT",nextWeek:"dddd, LT",lastDay:"[काल] LT",lastWeek:"[मागील] dddd, LT",sameElse:"L"},relativeTime:{future:"%sमध्ये",past:"%sपूर्वी",s:r,ss:r,m:r,mm:r,h:r,hh:r,d:r,dd:r,M:r,MM:r,y:r,yy:r},preparse:function(e){return e.replace(/[१२३४५६७८९०]/g,function(e){return n[e]})},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]})},meridiemParse:/पहाटे|सकाळी|दुपारी|सायंकाळी|रात्री/,meridiemHour:function(e,t){return(12===e&&(e=0),"पहाटे"===t||"सकाळी"===t)?e:"दुपारी"===t||"सायंकाळी"===t||"रात्री"===t?e>=12?e:e+12:void 0},meridiem:function(e,t,n){return e>=0&&e<6?"पहाटे":e<12?"सकाळी":e<17?"दुपारी":e<20?"सायंकाळी":"रात्री"},week:{dow:0,doy:6}})})(n(30381))},41237:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("ms-my",{months:"Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis".split("_"),weekdays:"Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu".split("_"),weekdaysShort:"Ahd_Isn_Sel_Rab_Kha_Jum_Sab".split("_"),weekdaysMin:"Ah_Is_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|tengahari|petang|malam/,meridiemHour:function(e,t){return(12===e&&(e=0),"pagi"===t)?e:"tengahari"===t?e>=11?e:e+12:"petang"===t||"malam"===t?e+12:void 0},meridiem:function(e,t,n){return e<11?"pagi":e<15?"tengahari":e<19?"petang":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Esok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kelmarin pukul] LT",lastWeek:"dddd [lepas pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lepas",s:"beberapa saat",ss:"%d saat",m:"seminit",mm:"%d minit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:1,doy:7}})})(n(30381))},9847:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("ms",{months:"Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis".split("_"),weekdays:"Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu".split("_"),weekdaysShort:"Ahd_Isn_Sel_Rab_Kha_Jum_Sab".split("_"),weekdaysMin:"Ah_Is_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|tengahari|petang|malam/,meridiemHour:function(e,t){return(12===e&&(e=0),"pagi"===t)?e:"tengahari"===t?e>=11?e:e+12:"petang"===t||"malam"===t?e+12:void 0},meridiem:function(e,t,n){return e<11?"pagi":e<15?"tengahari":e<19?"petang":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Esok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kelmarin pukul] LT",lastWeek:"dddd [lepas pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lepas",s:"beberapa saat",ss:"%d saat",m:"seminit",mm:"%d minit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:1,doy:7}})})(n(30381))},72126:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("mt",{months:"Jannar_Frar_Marzu_April_Mejju_Ġunju_Lulju_Awwissu_Settembru_Ottubru_Novembru_Diċembru".split("_"),monthsShort:"Jan_Fra_Mar_Apr_Mej_Ġun_Lul_Aww_Set_Ott_Nov_Diċ".split("_"),weekdays:"Il-Ħadd_It-Tnejn_It-Tlieta_L-Erbgħa_Il-Ħamis_Il-Ġimgħa_Is-Sibt".split("_"),weekdaysShort:"Ħad_Tne_Tli_Erb_Ħam_Ġim_Sib".split("_"),weekdaysMin:"Ħa_Tn_Tl_Er_Ħa_Ġi_Si".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Illum fil-]LT",nextDay:"[Għada fil-]LT",nextWeek:"dddd [fil-]LT",lastDay:"[Il-bieraħ fil-]LT",lastWeek:"dddd [li għadda] [fil-]LT",sameElse:"L"},relativeTime:{future:"f’ %s",past:"%s ilu",s:"ftit sekondi",ss:"%d sekondi",m:"minuta",mm:"%d minuti",h:"siegħa",hh:"%d siegħat",d:"ġurnata",dd:"%d ġranet",M:"xahar",MM:"%d xhur",y:"sena",yy:"%d sni"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%d\xba",week:{dow:1,doy:4}})})(n(30381))},56165:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration +var t={1:"၁",2:"၂",3:"၃",4:"၄",5:"၅",6:"၆",7:"၇",8:"၈",9:"၉",0:"၀"},n={"၁":"1","၂":"2","၃":"3","၄":"4","၅":"5","၆":"6","၇":"7","၈":"8","၉":"9","၀":"0"};return e.defineLocale("my",{months:"ဇန်နဝါရီ_ဖေဖော်ဝါရီ_မတ်_ဧပြီ_မေ_ဇွန်_ဇူလိုင်_သြဂုတ်_စက်တင်ဘာ_အောက်တိုဘာ_နိုဝင်ဘာ_ဒီဇင်ဘာ".split("_"),monthsShort:"ဇန်_ဖေ_မတ်_ပြီ_မေ_ဇွန်_လိုင်_သြ_စက်_အောက်_နို_ဒီ".split("_"),weekdays:"တနင်္ဂနွေ_တနင်္လာ_အင်္ဂါ_ဗုဒ္ဓဟူး_ကြာသပတေး_သောကြာ_စနေ".split("_"),weekdaysShort:"နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ".split("_"),weekdaysMin:"နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[ယနေ.] LT [မှာ]",nextDay:"[မနက်ဖြန်] LT [မှာ]",nextWeek:"dddd LT [မှာ]",lastDay:"[မနေ.က] LT [မှာ]",lastWeek:"[ပြီးခဲ့သော] dddd LT [မှာ]",sameElse:"L"},relativeTime:{future:"လာမည့် %s မှာ",past:"လွန်ခဲ့သော %s က",s:"စက္ကန်.အနည်းငယ်",ss:"%d စက္ကန့်",m:"တစ်မိနစ်",mm:"%d မိနစ်",h:"တစ်နာရီ",hh:"%d နာရီ",d:"တစ်ရက်",dd:"%d ရက်",M:"တစ်လ",MM:"%d လ",y:"တစ်နှစ်",yy:"%d နှစ်"},preparse:function(e){return e.replace(/[၁၂၃၄၅၆၇၈၉၀]/g,function(e){return n[e]})},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]})},week:{dow:1,doy:4}})})(n(30381))},64924:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("nb",{months:"januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan._feb._mars_apr._mai_juni_juli_aug._sep._okt._nov._des.".split("_"),monthsParseExact:!0,weekdays:"s\xf8ndag_mandag_tirsdag_onsdag_torsdag_fredag_l\xf8rdag".split("_"),weekdaysShort:"s\xf8._ma._ti._on._to._fr._l\xf8.".split("_"),weekdaysMin:"s\xf8_ma_ti_on_to_fr_l\xf8".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] HH:mm",LLLL:"dddd D. MMMM YYYY [kl.] HH:mm"},calendar:{sameDay:"[i dag kl.] LT",nextDay:"[i morgen kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[i g\xe5r kl.] LT",lastWeek:"[forrige] dddd [kl.] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"%s siden",s:"noen sekunder",ss:"%d sekunder",m:"ett minutt",mm:"%d minutter",h:"en time",hh:"%d timer",d:"en dag",dd:"%d dager",w:"en uke",ww:"%d uker",M:"en m\xe5ned",MM:"%d m\xe5neder",y:"ett \xe5r",yy:"%d \xe5r"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})})(n(30381))},16744:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration +var t={1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"},n={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"};return e.defineLocale("ne",{months:"जनवरी_फेब्रुवरी_मार्च_अप्रिल_मई_जुन_जुलाई_अगष्ट_सेप्टेम्बर_अक्टोबर_नोभेम्बर_डिसेम्बर".split("_"),monthsShort:"जन._फेब्रु._मार्च_अप्रि._मई_जुन_जुलाई._अग._सेप्ट._अक्टो._नोभे._डिसे.".split("_"),monthsParseExact:!0,weekdays:"आइतबार_सोमबार_मङ्गलबार_बुधबार_बिहिबार_शुक्रबार_शनिबार".split("_"),weekdaysShort:"आइत._सोम._मङ्गल._बुध._बिहि._शुक्र._शनि.".split("_"),weekdaysMin:"आ._सो._मं._बु._बि._शु._श.".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"Aको h:mm बजे",LTS:"Aको h:mm:ss बजे",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, Aको h:mm बजे",LLLL:"dddd, D MMMM YYYY, Aको h:mm बजे"},preparse:function(e){return e.replace(/[१२३४५६७८९०]/g,function(e){return n[e]})},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]})},meridiemParse:/राति|बिहान|दिउँसो|साँझ/,meridiemHour:function(e,t){return(12===e&&(e=0),"राति"===t)?e<4?e:e+12:"बिहान"===t?e:"दिउँसो"===t?e>=10?e:e+12:"साँझ"===t?e+12:void 0},meridiem:function(e,t,n){return e<3?"राति":e<12?"बिहान":e<16?"दिउँसो":e<20?"साँझ":"राति"},calendar:{sameDay:"[आज] LT",nextDay:"[भोलि] LT",nextWeek:"[आउँदो] dddd[,] LT",lastDay:"[हिजो] LT",lastWeek:"[गएको] dddd[,] LT",sameElse:"L"},relativeTime:{future:"%sमा",past:"%s अगाडि",s:"केही क्षण",ss:"%d सेकेण्ड",m:"एक मिनेट",mm:"%d मिनेट",h:"एक घण्टा",hh:"%d घण्टा",d:"एक दिन",dd:"%d दिन",M:"एक महिना",MM:"%d महिना",y:"एक बर्ष",yy:"%d बर्ष"},week:{dow:0,doy:6}})})(n(30381))},59814:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration +var t="jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.".split("_"),n="jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec".split("_"),r=[/^jan/i,/^feb/i,/^maart|mrt.?$/i,/^apr/i,/^mei$/i,/^jun[i.]?$/i,/^jul[i.]?$/i,/^aug/i,/^sep/i,/^okt/i,/^nov/i,/^dec/i,],i=/^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december|jan\.?|feb\.?|mrt\.?|apr\.?|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i;return e.defineLocale("nl-be",{months:"januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december".split("_"),monthsShort:function(e,r){return e?/-MMM-/.test(r)?n[e.month()]:t[e.month()]:t},monthsRegex:i,monthsShortRegex:i,monthsStrictRegex:/^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december)/i,monthsShortStrictRegex:/^(jan\.?|feb\.?|mrt\.?|apr\.?|mei|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i,monthsParse:r,longMonthsParse:r,shortMonthsParse:r,weekdays:"zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag".split("_"),weekdaysShort:"zo._ma._di._wo._do._vr._za.".split("_"),weekdaysMin:"zo_ma_di_wo_do_vr_za".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[vandaag om] LT",nextDay:"[morgen om] LT",nextWeek:"dddd [om] LT",lastDay:"[gisteren om] LT",lastWeek:"[afgelopen] dddd [om] LT",sameElse:"L"},relativeTime:{future:"over %s",past:"%s geleden",s:"een paar seconden",ss:"%d seconden",m:"\xe9\xe9n minuut",mm:"%d minuten",h:"\xe9\xe9n uur",hh:"%d uur",d:"\xe9\xe9n dag",dd:"%d dagen",M:"\xe9\xe9n maand",MM:"%d maanden",y:"\xe9\xe9n jaar",yy:"%d jaar"},dayOfMonthOrdinalParse:/\d{1,2}(ste|de)/,ordinal:function(e){return e+(1===e||8===e||e>=20?"ste":"de")},week:{dow:1,doy:4}})})(n(30381))},93901:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration +var t="jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.".split("_"),n="jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec".split("_"),r=[/^jan/i,/^feb/i,/^maart|mrt.?$/i,/^apr/i,/^mei$/i,/^jun[i.]?$/i,/^jul[i.]?$/i,/^aug/i,/^sep/i,/^okt/i,/^nov/i,/^dec/i,],i=/^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december|jan\.?|feb\.?|mrt\.?|apr\.?|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i;return e.defineLocale("nl",{months:"januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december".split("_"),monthsShort:function(e,r){return e?/-MMM-/.test(r)?n[e.month()]:t[e.month()]:t},monthsRegex:i,monthsShortRegex:i,monthsStrictRegex:/^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december)/i,monthsShortStrictRegex:/^(jan\.?|feb\.?|mrt\.?|apr\.?|mei|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i,monthsParse:r,longMonthsParse:r,shortMonthsParse:r,weekdays:"zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag".split("_"),weekdaysShort:"zo._ma._di._wo._do._vr._za.".split("_"),weekdaysMin:"zo_ma_di_wo_do_vr_za".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[vandaag om] LT",nextDay:"[morgen om] LT",nextWeek:"dddd [om] LT",lastDay:"[gisteren om] LT",lastWeek:"[afgelopen] dddd [om] LT",sameElse:"L"},relativeTime:{future:"over %s",past:"%s geleden",s:"een paar seconden",ss:"%d seconden",m:"\xe9\xe9n minuut",mm:"%d minuten",h:"\xe9\xe9n uur",hh:"%d uur",d:"\xe9\xe9n dag",dd:"%d dagen",w:"\xe9\xe9n week",ww:"%d weken",M:"\xe9\xe9n maand",MM:"%d maanden",y:"\xe9\xe9n jaar",yy:"%d jaar"},dayOfMonthOrdinalParse:/\d{1,2}(ste|de)/,ordinal:function(e){return e+(1===e||8===e||e>=20?"ste":"de")},week:{dow:1,doy:4}})})(n(30381))},83877:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("nn",{months:"januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan._feb._mars_apr._mai_juni_juli_aug._sep._okt._nov._des.".split("_"),monthsParseExact:!0,weekdays:"sundag_m\xe5ndag_tysdag_onsdag_torsdag_fredag_laurdag".split("_"),weekdaysShort:"su._m\xe5._ty._on._to._fr._lau.".split("_"),weekdaysMin:"su_m\xe5_ty_on_to_fr_la".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] H:mm",LLLL:"dddd D. MMMM YYYY [kl.] HH:mm"},calendar:{sameDay:"[I dag klokka] LT",nextDay:"[I morgon klokka] LT",nextWeek:"dddd [klokka] LT",lastDay:"[I g\xe5r klokka] LT",lastWeek:"[F\xf8reg\xe5ande] dddd [klokka] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"%s sidan",s:"nokre sekund",ss:"%d sekund",m:"eit minutt",mm:"%d minutt",h:"ein time",hh:"%d timar",d:"ein dag",dd:"%d dagar",w:"ei veke",ww:"%d veker",M:"ein m\xe5nad",MM:"%d m\xe5nader",y:"eit \xe5r",yy:"%d \xe5r"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})})(n(30381))},92135:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("oc-lnc",{months:{standalone:"geni\xe8r_febri\xe8r_mar\xe7_abril_mai_junh_julhet_agost_setembre_oct\xf2bre_novembre_decembre".split("_"),format:"de geni\xe8r_de febri\xe8r_de mar\xe7_d'abril_de mai_de junh_de julhet_d'agost_de setembre_d'oct\xf2bre_de novembre_de decembre".split("_"),isFormat:/D[oD]?(\s)+MMMM/},monthsShort:"gen._febr._mar\xe7_abr._mai_junh_julh._ago._set._oct._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"dimenge_diluns_dimars_dim\xe8cres_dij\xf2us_divendres_dissabte".split("_"),weekdaysShort:"dg._dl._dm._dc._dj._dv._ds.".split("_"),weekdaysMin:"dg_dl_dm_dc_dj_dv_ds".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM [de] YYYY",ll:"D MMM YYYY",LLL:"D MMMM [de] YYYY [a] H:mm",lll:"D MMM YYYY, H:mm",LLLL:"dddd D MMMM [de] YYYY [a] H:mm",llll:"ddd D MMM YYYY, H:mm"},calendar:{sameDay:"[u\xe8i a] LT",nextDay:"[deman a] LT",nextWeek:"dddd [a] LT",lastDay:"[i\xe8r a] LT",lastWeek:"dddd [passat a] LT",sameElse:"L"},relativeTime:{future:"d'aqu\xed %s",past:"fa %s",s:"unas segondas",ss:"%d segondas",m:"una minuta",mm:"%d minutas",h:"una ora",hh:"%d oras",d:"un jorn",dd:"%d jorns",M:"un mes",MM:"%d meses",y:"un an",yy:"%d ans"},dayOfMonthOrdinalParse:/\d{1,2}(r|n|t|è|a)/,ordinal:function(e,t){var n=1===e?"r":2===e?"n":3===e?"r":4===e?"t":"\xe8";return("w"===t||"W"===t)&&(n="a"),e+n},week:{dow:1,doy:4}})})(n(30381))},15858:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration +var t={1:"੧",2:"੨",3:"੩",4:"੪",5:"੫",6:"੬",7:"੭",8:"੮",9:"੯",0:"੦"},n={"੧":"1","੨":"2","੩":"3","੪":"4","੫":"5","੬":"6","੭":"7","੮":"8","੯":"9","੦":"0"};return e.defineLocale("pa-in",{months:"ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ".split("_"),monthsShort:"ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ".split("_"),weekdays:"ਐਤਵਾਰ_ਸੋਮਵਾਰ_ਮੰਗਲਵਾਰ_ਬੁਧਵਾਰ_ਵੀਰਵਾਰ_ਸ਼ੁੱਕਰਵਾਰ_ਸ਼ਨੀਚਰਵਾਰ".split("_"),weekdaysShort:"ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ".split("_"),weekdaysMin:"ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ".split("_"),longDateFormat:{LT:"A h:mm ਵਜੇ",LTS:"A h:mm:ss ਵਜੇ",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm ਵਜੇ",LLLL:"dddd, D MMMM YYYY, A h:mm ਵਜੇ"},calendar:{sameDay:"[ਅਜ] LT",nextDay:"[ਕਲ] LT",nextWeek:"[ਅਗਲਾ] dddd, LT",lastDay:"[ਕਲ] LT",lastWeek:"[ਪਿਛਲੇ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s ਵਿੱਚ",past:"%s ਪਿਛਲੇ",s:"ਕੁਝ ਸਕਿੰਟ",ss:"%d ਸਕਿੰਟ",m:"ਇਕ ਮਿੰਟ",mm:"%d ਮਿੰਟ",h:"ਇੱਕ ਘੰਟਾ",hh:"%d ਘੰਟੇ",d:"ਇੱਕ ਦਿਨ",dd:"%d ਦਿਨ",M:"ਇੱਕ ਮਹੀਨਾ",MM:"%d ਮਹੀਨੇ",y:"ਇੱਕ ਸਾਲ",yy:"%d ਸਾਲ"},preparse:function(e){return e.replace(/[੧੨੩੪੫੬੭੮੯੦]/g,function(e){return n[e]})},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]})},meridiemParse:/ਰਾਤ|ਸਵੇਰ|ਦੁਪਹਿਰ|ਸ਼ਾਮ/,meridiemHour:function(e,t){return(12===e&&(e=0),"ਰਾਤ"===t)?e<4?e:e+12:"ਸਵੇਰ"===t?e:"ਦੁਪਹਿਰ"===t?e>=10?e:e+12:"ਸ਼ਾਮ"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"ਰਾਤ":e<10?"ਸਵੇਰ":e<17?"ਦੁਪਹਿਰ":e<20?"ਸ਼ਾਮ":"ਰਾਤ"},week:{dow:0,doy:6}})})(n(30381))},64495:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration +var t="styczeń_luty_marzec_kwiecień_maj_czerwiec_lipiec_sierpień_wrzesień_październik_listopad_grudzień".split("_"),n="stycznia_lutego_marca_kwietnia_maja_czerwca_lipca_sierpnia_września_października_listopada_grudnia".split("_"),r=[/^sty/i,/^lut/i,/^mar/i,/^kwi/i,/^maj/i,/^cze/i,/^lip/i,/^sie/i,/^wrz/i,/^paź/i,/^lis/i,/^gru/i,];function i(e){return e%10<5&&e%10>1&&~~(e/10)%10!=1}function a(e,t,n){var r=e+" ";switch(n){case"ss":return r+(i(e)?"sekundy":"sekund");case"m":return t?"minuta":"minutę";case"mm":return r+(i(e)?"minuty":"minut");case"h":return t?"godzina":"godzinę";case"hh":return r+(i(e)?"godziny":"godzin");case"ww":return r+(i(e)?"tygodnie":"tygodni");case"MM":return r+(i(e)?"miesiące":"miesięcy");case"yy":return r+(i(e)?"lata":"lat")}}return e.defineLocale("pl",{months:function(e,r){return e?/D MMMM/.test(r)?n[e.month()]:t[e.month()]:t},monthsShort:"sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru".split("_"),monthsParse:r,longMonthsParse:r,shortMonthsParse:r,weekdays:"niedziela_poniedziałek_wtorek_środa_czwartek_piątek_sobota".split("_"),weekdaysShort:"ndz_pon_wt_śr_czw_pt_sob".split("_"),weekdaysMin:"Nd_Pn_Wt_Śr_Cz_Pt_So".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Dziś o] LT",nextDay:"[Jutro o] LT",nextWeek:function(){switch(this.day()){case 0:return"[W niedzielę o] LT";case 2:return"[We wtorek o] LT";case 3:return"[W środę o] LT";case 6:return"[W sobotę o] LT";default:return"[W] dddd [o] LT"}},lastDay:"[Wczoraj o] LT",lastWeek:function(){switch(this.day()){case 0:return"[W zeszłą niedzielę o] LT";case 3:return"[W zeszłą środę o] LT";case 6:return"[W zeszłą sobotę o] LT";default:return"[W zeszły] dddd [o] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"%s temu",s:"kilka sekund",ss:a,m:a,mm:a,h:a,hh:a,d:"1 dzień",dd:"%d dni",w:"tydzień",ww:a,M:"miesiąc",MM:a,y:"rok",yy:a},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})})(n(30381))},57971:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("pt-br",{months:"janeiro_fevereiro_mar\xe7o_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro".split("_"),monthsShort:"jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez".split("_"),weekdays:"domingo_segunda-feira_ter\xe7a-feira_quarta-feira_quinta-feira_sexta-feira_s\xe1bado".split("_"),weekdaysShort:"dom_seg_ter_qua_qui_sex_s\xe1b".split("_"),weekdaysMin:"do_2\xaa_3\xaa_4\xaa_5\xaa_6\xaa_s\xe1".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY [\xe0s] HH:mm",LLLL:"dddd, D [de] MMMM [de] YYYY [\xe0s] HH:mm"},calendar:{sameDay:"[Hoje \xe0s] LT",nextDay:"[Amanh\xe3 \xe0s] LT",nextWeek:"dddd [\xe0s] LT",lastDay:"[Ontem \xe0s] LT",lastWeek:function(){return 0===this.day()||6===this.day()?"[\xdaltimo] dddd [\xe0s] LT":"[\xdaltima] dddd [\xe0s] LT"},sameElse:"L"},relativeTime:{future:"em %s",past:"h\xe1 %s",s:"poucos segundos",ss:"%d segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",M:"um m\xeas",MM:"%d meses",y:"um ano",yy:"%d anos"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%d\xba",invalidDate:"Data inv\xe1lida"})})(n(30381))},89520:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("pt",{months:"janeiro_fevereiro_mar\xe7o_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro".split("_"),monthsShort:"jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez".split("_"),weekdays:"Domingo_Segunda-feira_Ter\xe7a-feira_Quarta-feira_Quinta-feira_Sexta-feira_S\xe1bado".split("_"),weekdaysShort:"Dom_Seg_Ter_Qua_Qui_Sex_S\xe1b".split("_"),weekdaysMin:"Do_2\xaa_3\xaa_4\xaa_5\xaa_6\xaa_S\xe1".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY HH:mm",LLLL:"dddd, D [de] MMMM [de] YYYY HH:mm"},calendar:{sameDay:"[Hoje \xe0s] LT",nextDay:"[Amanh\xe3 \xe0s] LT",nextWeek:"dddd [\xe0s] LT",lastDay:"[Ontem \xe0s] LT",lastWeek:function(){return 0===this.day()||6===this.day()?"[\xdaltimo] dddd [\xe0s] LT":"[\xdaltima] dddd [\xe0s] LT"},sameElse:"L"},relativeTime:{future:"em %s",past:"h\xe1 %s",s:"segundos",ss:"%d segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",w:"uma semana",ww:"%d semanas",M:"um m\xeas",MM:"%d meses",y:"um ano",yy:"%d anos"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%d\xba",week:{dow:1,doy:4}})})(n(30381))},96459:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration +function t(e,t,n){var r=" ";return(e%100>=20||e>=100&&e%100==0)&&(r=" de "),e+r+({ss:"secunde",mm:"minute",hh:"ore",dd:"zile",ww:"săptăm\xe2ni",MM:"luni",yy:"ani"})[n]}return e.defineLocale("ro",{months:"ianuarie_februarie_martie_aprilie_mai_iunie_iulie_august_septembrie_octombrie_noiembrie_decembrie".split("_"),monthsShort:"ian._feb._mart._apr._mai_iun._iul._aug._sept._oct._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"duminică_luni_marți_miercuri_joi_vineri_s\xe2mbătă".split("_"),weekdaysShort:"Dum_Lun_Mar_Mie_Joi_Vin_S\xe2m".split("_"),weekdaysMin:"Du_Lu_Ma_Mi_Jo_Vi_S\xe2".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[azi la] LT",nextDay:"[m\xe2ine la] LT",nextWeek:"dddd [la] LT",lastDay:"[ieri la] LT",lastWeek:"[fosta] dddd [la] LT",sameElse:"L"},relativeTime:{future:"peste %s",past:"%s \xeen urmă",s:"c\xe2teva secunde",ss:t,m:"un minut",mm:t,h:"o oră",hh:t,d:"o zi",dd:t,w:"o săptăm\xe2nă",ww:t,M:"o lună",MM:t,y:"un an",yy:t},week:{dow:1,doy:7}})})(n(30381))},21793:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration +function t(e,t){var n=e.split("_");return t%10==1&&t%100!=11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}function n(e,n,r){var i={ss:n?"секунда_секунды_секунд":"секунду_секунды_секунд",mm:n?"минута_минуты_минут":"минуту_минуты_минут",hh:"час_часа_часов",dd:"день_дня_дней",ww:"неделя_недели_недель",MM:"месяц_месяца_месяцев",yy:"год_года_лет"};return"m"===r?n?"минута":"минуту":e+" "+t(i[r],+e)}var r=[/^янв/i,/^фев/i,/^мар/i,/^апр/i,/^ма[йя]/i,/^июн/i,/^июл/i,/^авг/i,/^сен/i,/^окт/i,/^ноя/i,/^дек/i,];return e.defineLocale("ru",{months:{format:"января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря".split("_"),standalone:"январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_")},monthsShort:{format:"янв._февр._мар._апр._мая_июня_июля_авг._сент._окт._нояб._дек.".split("_"),standalone:"янв._февр._март_апр._май_июнь_июль_авг._сент._окт._нояб._дек.".split("_")},weekdays:{standalone:"воскресенье_понедельник_вторник_среда_четверг_пятница_суббота".split("_"),format:"воскресенье_понедельник_вторник_среду_четверг_пятницу_субботу".split("_"),isFormat:/\[ ?[Вв] ?(?:прошлую|следующую|эту)? ?] ?dddd/},weekdaysShort:"вс_пн_вт_ср_чт_пт_сб".split("_"),weekdaysMin:"вс_пн_вт_ср_чт_пт_сб".split("_"),monthsParse:r,longMonthsParse:r,shortMonthsParse:r,monthsRegex:/^(январ[ья]|янв\.?|феврал[ья]|февр?\.?|марта?|мар\.?|апрел[ья]|апр\.?|ма[йя]|июн[ья]|июн\.?|июл[ья]|июл\.?|августа?|авг\.?|сентябр[ья]|сент?\.?|октябр[ья]|окт\.?|ноябр[ья]|нояб?\.?|декабр[ья]|дек\.?)/i,monthsShortRegex:/^(январ[ья]|янв\.?|феврал[ья]|февр?\.?|марта?|мар\.?|апрел[ья]|апр\.?|ма[йя]|июн[ья]|июн\.?|июл[ья]|июл\.?|августа?|авг\.?|сентябр[ья]|сент?\.?|октябр[ья]|окт\.?|ноябр[ья]|нояб?\.?|декабр[ья]|дек\.?)/i,monthsStrictRegex:/^(январ[яь]|феврал[яь]|марта?|апрел[яь]|ма[яй]|июн[яь]|июл[яь]|августа?|сентябр[яь]|октябр[яь]|ноябр[яь]|декабр[яь])/i,monthsShortStrictRegex:/^(янв\.|февр?\.|мар[т.]|апр\.|ма[яй]|июн[ья.]|июл[ья.]|авг\.|сент?\.|окт\.|нояб?\.|дек\.)/i,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., H:mm",LLLL:"dddd, D MMMM YYYY г., H:mm"},calendar:{sameDay:"[Сегодня, в] LT",nextDay:"[Завтра, в] LT",lastDay:"[Вчера, в] LT",nextWeek:function(e){if(e.week()===this.week())return 2===this.day()?"[Во] dddd, [в] LT":"[В] dddd, [в] LT";switch(this.day()){case 0:return"[В следующее] dddd, [в] LT";case 1:case 2:case 4:return"[В следующий] dddd, [в] LT";case 3:case 5:case 6:return"[В следующую] dddd, [в] LT"}},lastWeek:function(e){if(e.week()===this.week())return 2===this.day()?"[Во] dddd, [в] LT":"[В] dddd, [в] LT";switch(this.day()){case 0:return"[В прошлое] dddd, [в] LT";case 1:case 2:case 4:return"[В прошлый] dddd, [в] LT";case 3:case 5:case 6:return"[В прошлую] dddd, [в] LT"}},sameElse:"L"},relativeTime:{future:"через %s",past:"%s назад",s:"несколько секунд",ss:n,m:n,mm:n,h:"час",hh:n,d:"день",dd:n,w:"неделя",ww:n,M:"месяц",MM:n,y:"год",yy:n},meridiemParse:/ночи|утра|дня|вечера/i,isPM:function(e){return/^(дня|вечера)$/.test(e)},meridiem:function(e,t,n){return e<4?"ночи":e<12?"утра":e<17?"дня":"вечера"},dayOfMonthOrdinalParse:/\d{1,2}-(й|го|я)/,ordinal:function(e,t){switch(t){case"M":case"d":case"DDD":return e+"-й";case"D":return e+"-го";case"w":case"W":return e+"-я";default:return e}},week:{dow:1,doy:4}})})(n(30381))},40950:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration +var t=["جنوري","فيبروري","مارچ","اپريل","مئي","جون","جولاءِ","آگسٽ","سيپٽمبر","آڪٽوبر","نومبر","ڊسمبر",],n=["آچر","سومر","اڱارو","اربع","خميس","جمع","ڇنڇر"];return e.defineLocale("sd",{months:t,monthsShort:t,weekdays:n,weekdaysShort:n,weekdaysMin:n,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd، D MMMM YYYY HH:mm"},meridiemParse:/صبح|شام/,isPM:function(e){return"شام"===e},meridiem:function(e,t,n){return e<12?"صبح":"شام"},calendar:{sameDay:"[اڄ] LT",nextDay:"[سڀاڻي] LT",nextWeek:"dddd [اڳين هفتي تي] LT",lastDay:"[ڪالهه] LT",lastWeek:"[گزريل هفتي] dddd [تي] LT",sameElse:"L"},relativeTime:{future:"%s پوء",past:"%s اڳ",s:"چند سيڪنڊ",ss:"%d سيڪنڊ",m:"هڪ منٽ",mm:"%d منٽ",h:"هڪ ڪلاڪ",hh:"%d ڪلاڪ",d:"هڪ ڏينهن",dd:"%d ڏينهن",M:"هڪ مهينو",MM:"%d مهينا",y:"هڪ سال",yy:"%d سال"},preparse:function(e){return e.replace(/،/g,",")},postformat:function(e){return e.replace(/,/g,"،")},week:{dow:1,doy:4}})})(n(30381))},10490:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("se",{months:"ođđajagem\xe1nnu_guovvam\xe1nnu_njukčam\xe1nnu_cuoŋom\xe1nnu_miessem\xe1nnu_geassem\xe1nnu_suoidnem\xe1nnu_borgem\xe1nnu_čakčam\xe1nnu_golggotm\xe1nnu_sk\xe1bmam\xe1nnu_juovlam\xe1nnu".split("_"),monthsShort:"ođđj_guov_njuk_cuo_mies_geas_suoi_borg_čakč_golg_sk\xe1b_juov".split("_"),weekdays:"sotnabeaivi_vuoss\xe1rga_maŋŋeb\xe1rga_gaskavahkku_duorastat_bearjadat_l\xe1vvardat".split("_"),weekdaysShort:"sotn_vuos_maŋ_gask_duor_bear_l\xe1v".split("_"),weekdaysMin:"s_v_m_g_d_b_L".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"MMMM D. [b.] YYYY",LLL:"MMMM D. [b.] YYYY [ti.] HH:mm",LLLL:"dddd, MMMM D. [b.] YYYY [ti.] HH:mm"},calendar:{sameDay:"[otne ti] LT",nextDay:"[ihttin ti] LT",nextWeek:"dddd [ti] LT",lastDay:"[ikte ti] LT",lastWeek:"[ovddit] dddd [ti] LT",sameElse:"L"},relativeTime:{future:"%s geažes",past:"maŋit %s",s:"moadde sekunddat",ss:"%d sekunddat",m:"okta minuhta",mm:"%d minuhtat",h:"okta diimmu",hh:"%d diimmut",d:"okta beaivi",dd:"%d beaivvit",M:"okta m\xe1nnu",MM:"%d m\xe1nut",y:"okta jahki",yy:"%d jagit"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})})(n(30381))},90124:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("si",{months:"ජනවාරි_පෙබරවාරි_මාර්තු_අප්‍රේල්_මැයි_ජූනි_ජූලි_අගෝස්තු_සැප්තැම්බර්_ඔක්තෝබර්_නොවැම්බර්_දෙසැම්බර්".split("_"),monthsShort:"ජන_පෙබ_මාර්_අප්_මැයි_ජූනි_ජූලි_අගෝ_සැප්_ඔක්_නොවැ_දෙසැ".split("_"),weekdays:"ඉරිදා_සඳුදා_අඟහරුවාදා_බදාදා_බ්‍රහස්පතින්දා_සිකුරාදා_සෙනසුරාදා".split("_"),weekdaysShort:"ඉරි_සඳු_අඟ_බදා_බ්‍රහ_සිකු_සෙන".split("_"),weekdaysMin:"ඉ_ස_අ_බ_බ්‍ර_සි_සෙ".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"a h:mm",LTS:"a h:mm:ss",L:"YYYY/MM/DD",LL:"YYYY MMMM D",LLL:"YYYY MMMM D, a h:mm",LLLL:"YYYY MMMM D [වැනි] dddd, a h:mm:ss"},calendar:{sameDay:"[අද] LT[ට]",nextDay:"[හෙට] LT[ට]",nextWeek:"dddd LT[ට]",lastDay:"[ඊයේ] LT[ට]",lastWeek:"[පසුගිය] dddd LT[ට]",sameElse:"L"},relativeTime:{future:"%sකින්",past:"%sකට පෙර",s:"තත්පර කිහිපය",ss:"තත්පර %d",m:"මිනිත්තුව",mm:"මිනිත්තු %d",h:"පැය",hh:"පැය %d",d:"දිනය",dd:"දින %d",M:"මාසය",MM:"මාස %d",y:"වසර",yy:"වසර %d"},dayOfMonthOrdinalParse:/\d{1,2} වැනි/,ordinal:function(e){return e+" වැනි"},meridiemParse:/පෙර වරු|පස් වරු|පෙ.ව|ප.ව./,isPM:function(e){return"ප.ව."===e||"පස් වරු"===e},meridiem:function(e,t,n){return e>11?n?"ප.ව.":"පස් වරු":n?"පෙ.ව.":"පෙර වරු"}})})(n(30381))},64249:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration +var t="janu\xe1r_febru\xe1r_marec_apr\xedl_m\xe1j_j\xfan_j\xfal_august_september_okt\xf3ber_november_december".split("_"),n="jan_feb_mar_apr_m\xe1j_j\xfan_j\xfal_aug_sep_okt_nov_dec".split("_");function r(e){return e>1&&e<5}function i(e,t,n,i){var a=e+" ";switch(n){case"s":return t||i?"p\xe1r sek\xfand":"p\xe1r sekundami";case"ss":if(t||i)return a+(r(e)?"sekundy":"sek\xfand");return a+"sekundami";case"m":return t?"min\xfata":i?"min\xfatu":"min\xfatou";case"mm":if(t||i)return a+(r(e)?"min\xfaty":"min\xfat");return a+"min\xfatami";case"h":return t?"hodina":i?"hodinu":"hodinou";case"hh":if(t||i)return a+(r(e)?"hodiny":"hod\xedn");return a+"hodinami";case"d":return t||i?"deň":"dňom";case"dd":if(t||i)return a+(r(e)?"dni":"dn\xed");return a+"dňami";case"M":return t||i?"mesiac":"mesiacom";case"MM":if(t||i)return a+(r(e)?"mesiace":"mesiacov");return a+"mesiacmi";case"y":return t||i?"rok":"rokom";case"yy":if(t||i)return a+(r(e)?"roky":"rokov");return a+"rokmi"}}return e.defineLocale("sk",{months:t,monthsShort:n,weekdays:"nedeľa_pondelok_utorok_streda_štvrtok_piatok_sobota".split("_"),weekdaysShort:"ne_po_ut_st_št_pi_so".split("_"),weekdaysMin:"ne_po_ut_st_št_pi_so".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd D. MMMM YYYY H:mm"},calendar:{sameDay:"[dnes o] LT",nextDay:"[zajtra o] LT",nextWeek:function(){switch(this.day()){case 0:return"[v nedeľu o] LT";case 1:case 2:return"[v] dddd [o] LT";case 3:return"[v stredu o] LT";case 4:return"[vo štvrtok o] LT";case 5:return"[v piatok o] LT";case 6:return"[v sobotu o] LT"}},lastDay:"[včera o] LT",lastWeek:function(){switch(this.day()){case 0:return"[minul\xfa nedeľu o] LT";case 1:case 2:case 4:case 5:return"[minul\xfd] dddd [o] LT";case 3:return"[minul\xfa stredu o] LT";case 6:return"[minul\xfa sobotu o] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"pred %s",s:i,ss:i,m:i,mm:i,h:i,hh:i,d:i,dd:i,M:i,MM:i,y:i,yy:i},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})})(n(30381))},14985:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration +function t(e,t,n,r){var i=e+" ";switch(n){case"s":return t||r?"nekaj sekund":"nekaj sekundami";case"ss":return 1===e?i+=t?"sekundo":"sekundi":2===e?i+=t||r?"sekundi":"sekundah":e<5?i+=t||r?"sekunde":"sekundah":i+="sekund",i;case"m":return t?"ena minuta":"eno minuto";case"mm":return 1===e?i+=t?"minuta":"minuto":2===e?i+=t||r?"minuti":"minutama":e<5?i+=t||r?"minute":"minutami":i+=t||r?"minut":"minutami",i;case"h":return t?"ena ura":"eno uro";case"hh":return 1===e?i+=t?"ura":"uro":2===e?i+=t||r?"uri":"urama":e<5?i+=t||r?"ure":"urami":i+=t||r?"ur":"urami",i;case"d":return t||r?"en dan":"enim dnem";case"dd":return 1===e?i+=t||r?"dan":"dnem":2===e?i+=t||r?"dni":"dnevoma":i+=t||r?"dni":"dnevi",i;case"M":return t||r?"en mesec":"enim mesecem";case"MM":return 1===e?i+=t||r?"mesec":"mesecem":2===e?i+=t||r?"meseca":"mesecema":e<5?i+=t||r?"mesece":"meseci":i+=t||r?"mesecev":"meseci",i;case"y":return t||r?"eno leto":"enim letom";case"yy":return 1===e?i+=t||r?"leto":"letom":2===e?i+=t||r?"leti":"letoma":e<5?i+=t||r?"leta":"leti":i+=t||r?"let":"leti",i}}return e.defineLocale("sl",{months:"januar_februar_marec_april_maj_junij_julij_avgust_september_oktober_november_december".split("_"),monthsShort:"jan._feb._mar._apr._maj._jun._jul._avg._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedelja_ponedeljek_torek_sreda_četrtek_petek_sobota".split("_"),weekdaysShort:"ned._pon._tor._sre._čet._pet._sob.".split("_"),weekdaysMin:"ne_po_to_sr_če_pe_so".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD. MM. YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danes ob] LT",nextDay:"[jutri ob] LT",nextWeek:function(){switch(this.day()){case 0:return"[v] [nedeljo] [ob] LT";case 3:return"[v] [sredo] [ob] LT";case 6:return"[v] [soboto] [ob] LT";case 1:case 2:case 4:case 5:return"[v] dddd [ob] LT"}},lastDay:"[včeraj ob] LT",lastWeek:function(){switch(this.day()){case 0:return"[prejšnjo] [nedeljo] [ob] LT";case 3:return"[prejšnjo] [sredo] [ob] LT";case 6:return"[prejšnjo] [soboto] [ob] LT";case 1:case 2:case 4:case 5:return"[prejšnji] dddd [ob] LT"}},sameElse:"L"},relativeTime:{future:"čez %s",past:"pred %s",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})})(n(30381))},51104:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("sq",{months:"Janar_Shkurt_Mars_Prill_Maj_Qershor_Korrik_Gusht_Shtator_Tetor_N\xebntor_Dhjetor".split("_"),monthsShort:"Jan_Shk_Mar_Pri_Maj_Qer_Kor_Gus_Sht_Tet_N\xebn_Dhj".split("_"),weekdays:"E Diel_E H\xebn\xeb_E Mart\xeb_E M\xebrkur\xeb_E Enjte_E Premte_E Shtun\xeb".split("_"),weekdaysShort:"Die_H\xebn_Mar_M\xebr_Enj_Pre_Sht".split("_"),weekdaysMin:"D_H_Ma_M\xeb_E_P_Sh".split("_"),weekdaysParseExact:!0,meridiemParse:/PD|MD/,isPM:function(e){return"M"===e.charAt(0)},meridiem:function(e,t,n){return e<12?"PD":"MD"},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Sot n\xeb] LT",nextDay:"[Nes\xebr n\xeb] LT",nextWeek:"dddd [n\xeb] LT",lastDay:"[Dje n\xeb] LT",lastWeek:"dddd [e kaluar n\xeb] LT",sameElse:"L"},relativeTime:{future:"n\xeb %s",past:"%s m\xeb par\xeb",s:"disa sekonda",ss:"%d sekonda",m:"nj\xeb minut\xeb",mm:"%d minuta",h:"nj\xeb or\xeb",hh:"%d or\xeb",d:"nj\xeb dit\xeb",dd:"%d dit\xeb",M:"nj\xeb muaj",MM:"%d muaj",y:"nj\xeb vit",yy:"%d vite"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})})(n(30381))},79915:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration +var t={words:{ss:["секунда","секунде","секунди"],m:["један минут","једне минуте"],mm:["минут","минуте","минута"],h:["један сат","једног сата"],hh:["сат","сата","сати"],dd:["дан","дана","дана"],MM:["месец","месеца","месеци"],yy:["година","године","година"]},correctGrammaticalCase:function(e,t){return 1===e?t[0]:e>=2&&e<=4?t[1]:t[2]},translate:function(e,n,r){var i=t.words[r];return 1===r.length?n?i[0]:i[1]:e+" "+t.correctGrammaticalCase(e,i)}};return e.defineLocale("sr-cyrl",{months:"јануар_фебруар_март_април_мај_јун_јул_август_септембар_октобар_новембар_децембар".split("_"),monthsShort:"јан._феб._мар._апр._мај_јун_јул_авг._сеп._окт._нов._дец.".split("_"),monthsParseExact:!0,weekdays:"недеља_понедељак_уторак_среда_четвртак_петак_субота".split("_"),weekdaysShort:"нед._пон._уто._сре._чет._пет._суб.".split("_"),weekdaysMin:"не_по_ут_ср_че_пе_су".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D. M. YYYY.",LL:"D. MMMM YYYY.",LLL:"D. MMMM YYYY. H:mm",LLLL:"dddd, D. MMMM YYYY. H:mm"},calendar:{sameDay:"[данас у] LT",nextDay:"[сутра у] LT",nextWeek:function(){switch(this.day()){case 0:return"[у] [недељу] [у] LT";case 3:return"[у] [среду] [у] LT";case 6:return"[у] [суботу] [у] LT";case 1:case 2:case 4:case 5:return"[у] dddd [у] LT"}},lastDay:"[јуче у] LT",lastWeek:function(){return["[прошле] [недеље] [у] LT","[прошлог] [понедељка] [у] LT","[прошлог] [уторка] [у] LT","[прошле] [среде] [у] LT","[прошлог] [четвртка] [у] LT","[прошлог] [петка] [у] LT","[прошле] [суботе] [у] LT",][this.day()]},sameElse:"L"},relativeTime:{future:"за %s",past:"пре %s",s:"неколико секунди",ss:t.translate,m:t.translate,mm:t.translate,h:t.translate,hh:t.translate,d:"дан",dd:t.translate,M:"месец",MM:t.translate,y:"годину",yy:t.translate},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})})(n(30381))},49131:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration +var t={words:{ss:["sekunda","sekunde","sekundi"],m:["jedan minut","jedne minute"],mm:["minut","minute","minuta"],h:["jedan sat","jednog sata"],hh:["sat","sata","sati"],dd:["dan","dana","dana"],MM:["mesec","meseca","meseci"],yy:["godina","godine","godina"]},correctGrammaticalCase:function(e,t){return 1===e?t[0]:e>=2&&e<=4?t[1]:t[2]},translate:function(e,n,r){var i=t.words[r];return 1===r.length?n?i[0]:i[1]:e+" "+t.correctGrammaticalCase(e,i)}};return e.defineLocale("sr",{months:"januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar".split("_"),monthsShort:"jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedelja_ponedeljak_utorak_sreda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sre._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D. M. YYYY.",LL:"D. MMMM YYYY.",LLL:"D. MMMM YYYY. H:mm",LLLL:"dddd, D. MMMM YYYY. H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedelju] [u] LT";case 3:return"[u] [sredu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[juče u] LT",lastWeek:function(){return["[prošle] [nedelje] [u] LT","[prošlog] [ponedeljka] [u] LT","[prošlog] [utorka] [u] LT","[prošle] [srede] [u] LT","[prošlog] [četvrtka] [u] LT","[prošlog] [petka] [u] LT","[prošle] [subote] [u] LT",][this.day()]},sameElse:"L"},relativeTime:{future:"za %s",past:"pre %s",s:"nekoliko sekundi",ss:t.translate,m:t.translate,mm:t.translate,h:t.translate,hh:t.translate,d:"dan",dd:t.translate,M:"mesec",MM:t.translate,y:"godinu",yy:t.translate},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})})(n(30381))},85893:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("ss",{months:"Bhimbidvwane_Indlovana_Indlov'lenkhulu_Mabasa_Inkhwekhweti_Inhlaba_Kholwane_Ingci_Inyoni_Imphala_Lweti_Ingongoni".split("_"),monthsShort:"Bhi_Ina_Inu_Mab_Ink_Inh_Kho_Igc_Iny_Imp_Lwe_Igo".split("_"),weekdays:"Lisontfo_Umsombuluko_Lesibili_Lesitsatfu_Lesine_Lesihlanu_Umgcibelo".split("_"),weekdaysShort:"Lis_Umb_Lsb_Les_Lsi_Lsh_Umg".split("_"),weekdaysMin:"Li_Us_Lb_Lt_Ls_Lh_Ug".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Namuhla nga] LT",nextDay:"[Kusasa nga] LT",nextWeek:"dddd [nga] LT",lastDay:"[Itolo nga] LT",lastWeek:"dddd [leliphelile] [nga] LT",sameElse:"L"},relativeTime:{future:"nga %s",past:"wenteka nga %s",s:"emizuzwana lomcane",ss:"%d mzuzwana",m:"umzuzu",mm:"%d emizuzu",h:"lihora",hh:"%d emahora",d:"lilanga",dd:"%d emalanga",M:"inyanga",MM:"%d tinyanga",y:"umnyaka",yy:"%d iminyaka"},meridiemParse:/ekuseni|emini|entsambama|ebusuku/,meridiem:function(e,t,n){return e<11?"ekuseni":e<15?"emini":e<19?"entsambama":"ebusuku"},meridiemHour:function(e,t){return(12===e&&(e=0),"ekuseni"===t)?e:"emini"===t?e>=11?e:e+12:"entsambama"===t||"ebusuku"===t?0===e?0:e+12:void 0},dayOfMonthOrdinalParse:/\d{1,2}/,ordinal:"%d",week:{dow:1,doy:4}})})(n(30381))},98760:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("sv",{months:"januari_februari_mars_april_maj_juni_juli_augusti_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"),weekdays:"s\xf6ndag_m\xe5ndag_tisdag_onsdag_torsdag_fredag_l\xf6rdag".split("_"),weekdaysShort:"s\xf6n_m\xe5n_tis_ons_tor_fre_l\xf6r".split("_"),weekdaysMin:"s\xf6_m\xe5_ti_on_to_fr_l\xf6".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [kl.] HH:mm",LLLL:"dddd D MMMM YYYY [kl.] HH:mm",lll:"D MMM YYYY HH:mm",llll:"ddd D MMM YYYY HH:mm"},calendar:{sameDay:"[Idag] LT",nextDay:"[Imorgon] LT",lastDay:"[Ig\xe5r] LT",nextWeek:"[P\xe5] dddd LT",lastWeek:"[I] dddd[s] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"f\xf6r %s sedan",s:"n\xe5gra sekunder",ss:"%d sekunder",m:"en minut",mm:"%d minuter",h:"en timme",hh:"%d timmar",d:"en dag",dd:"%d dagar",M:"en m\xe5nad",MM:"%d m\xe5nader",y:"ett \xe5r",yy:"%d \xe5r"},dayOfMonthOrdinalParse:/\d{1,2}(\:e|\:a)/,ordinal:function(e){var t=e%10,n=1==~~(e%100/10)?":e":1===t?":a":2===t?":a":":e";return e+n},week:{dow:1,doy:4}})})(n(30381))},91172:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("sw",{months:"Januari_Februari_Machi_Aprili_Mei_Juni_Julai_Agosti_Septemba_Oktoba_Novemba_Desemba".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ago_Sep_Okt_Nov_Des".split("_"),weekdays:"Jumapili_Jumatatu_Jumanne_Jumatano_Alhamisi_Ijumaa_Jumamosi".split("_"),weekdaysShort:"Jpl_Jtat_Jnne_Jtan_Alh_Ijm_Jmos".split("_"),weekdaysMin:"J2_J3_J4_J5_Al_Ij_J1".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"hh:mm A",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[leo saa] LT",nextDay:"[kesho saa] LT",nextWeek:"[wiki ijayo] dddd [saat] LT",lastDay:"[jana] LT",lastWeek:"[wiki iliyopita] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s baadaye",past:"tokea %s",s:"hivi punde",ss:"sekunde %d",m:"dakika moja",mm:"dakika %d",h:"saa limoja",hh:"masaa %d",d:"siku moja",dd:"siku %d",M:"mwezi mmoja",MM:"miezi %d",y:"mwaka mmoja",yy:"miaka %d"},week:{dow:1,doy:7}})})(n(30381))},27333:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration +var t={1:"௧",2:"௨",3:"௩",4:"௪",5:"௫",6:"௬",7:"௭",8:"௮",9:"௯",0:"௦"},n={"௧":"1","௨":"2","௩":"3","௪":"4","௫":"5","௬":"6","௭":"7","௮":"8","௯":"9","௦":"0"};return e.defineLocale("ta",{months:"ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்".split("_"),monthsShort:"ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்".split("_"),weekdays:"ஞாயிற்றுக்கிழமை_திங்கட்கிழமை_செவ்வாய்கிழமை_புதன்கிழமை_வியாழக்கிழமை_வெள்ளிக்கிழமை_சனிக்கிழமை".split("_"),weekdaysShort:"ஞாயிறு_திங்கள்_செவ்வாய்_புதன்_வியாழன்_வெள்ளி_சனி".split("_"),weekdaysMin:"ஞா_தி_செ_பு_வி_வெ_ச".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, HH:mm",LLLL:"dddd, D MMMM YYYY, HH:mm"},calendar:{sameDay:"[இன்று] LT",nextDay:"[நாளை] LT",nextWeek:"dddd, LT",lastDay:"[நேற்று] LT",lastWeek:"[கடந்த வாரம்] dddd, LT",sameElse:"L"},relativeTime:{future:"%s இல்",past:"%s முன்",s:"ஒரு சில விநாடிகள்",ss:"%d விநாடிகள்",m:"ஒரு நிமிடம்",mm:"%d நிமிடங்கள்",h:"ஒரு மணி நேரம்",hh:"%d மணி நேரம்",d:"ஒரு நாள்",dd:"%d நாட்கள்",M:"ஒரு மாதம்",MM:"%d மாதங்கள்",y:"ஒரு வருடம்",yy:"%d ஆண்டுகள்"},dayOfMonthOrdinalParse:/\d{1,2}வது/,ordinal:function(e){return e+"வது"},preparse:function(e){return e.replace(/[௧௨௩௪௫௬௭௮௯௦]/g,function(e){return n[e]})},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]})},meridiemParse:/யாமம்|வைகறை|காலை|நண்பகல்|எற்பாடு|மாலை/,meridiem:function(e,t,n){if(e<2)return" யாமம்";if(e<6)return" வைகறை";if(e<10)return" காலை";if(e<14)return" நண்பகல்";if(e<18)return" எற்பாடு";else if(e<22)return" மாலை";else return" யாமம்"},meridiemHour:function(e,t){return(12===e&&(e=0),"யாமம்"===t)?e<2?e:e+12:"வைகறை"===t||"காலை"===t?e:"நண்பகல்"===t?e>=10?e:e+12:e+12},week:{dow:0,doy:6}})})(n(30381))},23110:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("te",{months:"జనవరి_ఫిబ్రవరి_మార్చి_ఏప్రిల్_మే_జూన్_జులై_ఆగస్టు_సెప్టెంబర్_అక్టోబర్_నవంబర్_డిసెంబర్".split("_"),monthsShort:"జన._ఫిబ్ర._మార్చి_ఏప్రి._మే_జూన్_జులై_ఆగ._సెప్._అక్టో._నవ._డిసె.".split("_"),monthsParseExact:!0,weekdays:"ఆదివారం_సోమవారం_మంగళవారం_బుధవారం_గురువారం_శుక్రవారం_శనివారం".split("_"),weekdaysShort:"ఆది_సోమ_మంగళ_బుధ_గురు_శుక్ర_శని".split("_"),weekdaysMin:"ఆ_సో_మం_బు_గు_శు_శ".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},calendar:{sameDay:"[నేడు] LT",nextDay:"[రేపు] LT",nextWeek:"dddd, LT",lastDay:"[నిన్న] LT",lastWeek:"[గత] dddd, LT",sameElse:"L"},relativeTime:{future:"%s లో",past:"%s క్రితం",s:"కొన్ని క్షణాలు",ss:"%d సెకన్లు",m:"ఒక నిమిషం",mm:"%d నిమిషాలు",h:"ఒక గంట",hh:"%d గంటలు",d:"ఒక రోజు",dd:"%d రోజులు",M:"ఒక నెల",MM:"%d నెలలు",y:"ఒక సంవత్సరం",yy:"%d సంవత్సరాలు"},dayOfMonthOrdinalParse:/\d{1,2}వ/,ordinal:"%dవ",meridiemParse:/రాత్రి|ఉదయం|మధ్యాహ్నం|సాయంత్రం/,meridiemHour:function(e,t){return(12===e&&(e=0),"రాత్రి"===t)?e<4?e:e+12:"ఉదయం"===t?e:"మధ్యాహ్నం"===t?e>=10?e:e+12:"సాయంత్రం"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"రాత్రి":e<10?"ఉదయం":e<17?"మధ్యాహ్నం":e<20?"సాయంత్రం":"రాత్రి"},week:{dow:0,doy:6}})})(n(30381))},52095:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("tet",{months:"Janeiru_Fevereiru_Marsu_Abril_Maiu_Ju\xf1u_Jullu_Agustu_Setembru_Outubru_Novembru_Dezembru".split("_"),monthsShort:"Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez".split("_"),weekdays:"Domingu_Segunda_Tersa_Kuarta_Kinta_Sesta_Sabadu".split("_"),weekdaysShort:"Dom_Seg_Ters_Kua_Kint_Sest_Sab".split("_"),weekdaysMin:"Do_Seg_Te_Ku_Ki_Ses_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Ohin iha] LT",nextDay:"[Aban iha] LT",nextWeek:"dddd [iha] LT",lastDay:"[Horiseik iha] LT",lastWeek:"dddd [semana kotuk] [iha] LT",sameElse:"L"},relativeTime:{future:"iha %s",past:"%s liuba",s:"segundu balun",ss:"segundu %d",m:"minutu ida",mm:"minutu %d",h:"oras ida",hh:"oras %d",d:"loron ida",dd:"loron %d",M:"fulan ida",MM:"fulan %d",y:"tinan ida",yy:"tinan %d"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10,n=1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th";return e+n},week:{dow:1,doy:4}})})(n(30381))},27321:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration +var t={0:"-ум",1:"-ум",2:"-юм",3:"-юм",4:"-ум",5:"-ум",6:"-ум",7:"-ум",8:"-ум",9:"-ум",10:"-ум",12:"-ум",13:"-ум",20:"-ум",30:"-юм",40:"-ум",50:"-ум",60:"-ум",70:"-ум",80:"-ум",90:"-ум",100:"-ум"};return e.defineLocale("tg",{months:{format:"январи_феврали_марти_апрели_майи_июни_июли_августи_сентябри_октябри_ноябри_декабри".split("_"),standalone:"январ_феврал_март_апрел_май_июн_июл_август_сентябр_октябр_ноябр_декабр".split("_")},monthsShort:"янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек".split("_"),weekdays:"якшанбе_душанбе_сешанбе_чоршанбе_панҷшанбе_ҷумъа_шанбе".split("_"),weekdaysShort:"яшб_дшб_сшб_чшб_пшб_ҷум_шнб".split("_"),weekdaysMin:"яш_дш_сш_чш_пш_ҷм_шб".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Имрӯз соати] LT",nextDay:"[Фардо соати] LT",lastDay:"[Дирӯз соати] LT",nextWeek:"dddd[и] [ҳафтаи оянда соати] LT",lastWeek:"dddd[и] [ҳафтаи гузашта соати] LT",sameElse:"L"},relativeTime:{future:"баъди %s",past:"%s пеш",s:"якчанд сония",m:"як дақиқа",mm:"%d дақиқа",h:"як соат",hh:"%d соат",d:"як рӯз",dd:"%d рӯз",M:"як моҳ",MM:"%d моҳ",y:"як сол",yy:"%d сол"},meridiemParse:/шаб|субҳ|рӯз|бегоҳ/,meridiemHour:function(e,t){return(12===e&&(e=0),"шаб"===t)?e<4?e:e+12:"субҳ"===t?e:"рӯз"===t?e>=11?e:e+12:"бегоҳ"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"шаб":e<11?"субҳ":e<16?"рӯз":e<19?"бегоҳ":"шаб"},dayOfMonthOrdinalParse:/\d{1,2}-(ум|юм)/,ordinal:function(e){var n=e%10,r=e>=100?100:null;return e+(t[e]||t[n]||t[r])},week:{dow:1,doy:7}})})(n(30381))},9041:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("th",{months:"มกราคม_กุมภาพันธ์_มีนาคม_เมษายน_พฤษภาคม_มิถุนายน_กรกฎาคม_สิงหาคม_กันยายน_ตุลาคม_พฤศจิกายน_ธันวาคม".split("_"),monthsShort:"ม.ค._ก.พ._มี.ค._เม.ย._พ.ค._มิ.ย._ก.ค._ส.ค._ก.ย._ต.ค._พ.ย._ธ.ค.".split("_"),monthsParseExact:!0,weekdays:"อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัสบดี_ศุกร์_เสาร์".split("_"),weekdaysShort:"อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัส_ศุกร์_เสาร์".split("_"),weekdaysMin:"อา._จ._อ._พ._พฤ._ศ._ส.".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY เวลา H:mm",LLLL:"วันddddที่ D MMMM YYYY เวลา H:mm"},meridiemParse:/ก่อนเที่ยง|หลังเที่ยง/,isPM:function(e){return"หลังเที่ยง"===e},meridiem:function(e,t,n){return e<12?"ก่อนเที่ยง":"หลังเที่ยง"},calendar:{sameDay:"[วันนี้ เวลา] LT",nextDay:"[พรุ่งนี้ เวลา] LT",nextWeek:"dddd[หน้า เวลา] LT",lastDay:"[เมื่อวานนี้ เวลา] LT",lastWeek:"[วัน]dddd[ที่แล้ว เวลา] LT",sameElse:"L"},relativeTime:{future:"อีก %s",past:"%sที่แล้ว",s:"ไม่กี่วินาที",ss:"%d วินาที",m:"1 นาที",mm:"%d นาที",h:"1 ชั่วโมง",hh:"%d ชั่วโมง",d:"1 วัน",dd:"%d วัน",w:"1 สัปดาห์",ww:"%d สัปดาห์",M:"1 เดือน",MM:"%d เดือน",y:"1 ปี",yy:"%d ปี"}})})(n(30381))},19005:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration +var t={1:"'inji",5:"'inji",8:"'inji",70:"'inji",80:"'inji",2:"'nji",7:"'nji",20:"'nji",50:"'nji",3:"'\xfcnji",4:"'\xfcnji",100:"'\xfcnji",6:"'njy",9:"'unjy",10:"'unjy",30:"'unjy",60:"'ynjy",90:"'ynjy"};return e.defineLocale("tk",{months:"\xddanwar_Fewral_Mart_Aprel_Ma\xfd_I\xfdun_I\xfdul_Awgust_Sent\xfdabr_Okt\xfdabr_No\xfdabr_Dekabr".split("_"),monthsShort:"\xddan_Few_Mar_Apr_Ma\xfd_I\xfdn_I\xfdl_Awg_Sen_Okt_No\xfd_Dek".split("_"),weekdays:"\xddekşenbe_Duşenbe_Sişenbe_\xc7arşenbe_Penşenbe_Anna_Şenbe".split("_"),weekdaysShort:"\xddek_Duş_Siş_\xc7ar_Pen_Ann_Şen".split("_"),weekdaysMin:"\xddk_Dş_Sş_\xc7r_Pn_An_Şn".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[bug\xfcn sagat] LT",nextDay:"[ertir sagat] LT",nextWeek:"[indiki] dddd [sagat] LT",lastDay:"[d\xfc\xfdn] LT",lastWeek:"[ge\xe7en] dddd [sagat] LT",sameElse:"L"},relativeTime:{future:"%s soň",past:"%s \xf6ň",s:"birn\xe4\xe7e sekunt",m:"bir minut",mm:"%d minut",h:"bir sagat",hh:"%d sagat",d:"bir g\xfcn",dd:"%d g\xfcn",M:"bir a\xfd",MM:"%d a\xfd",y:"bir \xfdyl",yy:"%d \xfdyl"},ordinal:function(e,n){switch(n){case"d":case"D":case"Do":case"DD":return e;default:if(0===e)return e+"'unjy";var r=e%10,i=e%100-r,a=e>=100?100:null;return e+(t[r]||t[i]||t[a])}},week:{dow:1,doy:7}})})(n(30381))},75768:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("tl-ph",{months:"Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre".split("_"),monthsShort:"Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis".split("_"),weekdays:"Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado".split("_"),weekdaysShort:"Lin_Lun_Mar_Miy_Huw_Biy_Sab".split("_"),weekdaysMin:"Li_Lu_Ma_Mi_Hu_Bi_Sab".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"MM/D/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY HH:mm",LLLL:"dddd, MMMM DD, YYYY HH:mm"},calendar:{sameDay:"LT [ngayong araw]",nextDay:"[Bukas ng] LT",nextWeek:"LT [sa susunod na] dddd",lastDay:"LT [kahapon]",lastWeek:"LT [noong nakaraang] dddd",sameElse:"L"},relativeTime:{future:"sa loob ng %s",past:"%s ang nakalipas",s:"ilang segundo",ss:"%d segundo",m:"isang minuto",mm:"%d minuto",h:"isang oras",hh:"%d oras",d:"isang araw",dd:"%d araw",M:"isang buwan",MM:"%d buwan",y:"isang taon",yy:"%d taon"},dayOfMonthOrdinalParse:/\d{1,2}/,ordinal:function(e){return e},week:{dow:1,doy:4}})})(n(30381))},89444:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration +var t="pagh_wa’_cha’_wej_loS_vagh_jav_Soch_chorgh_Hut".split("_");function n(e){var t=e;return -1!==e.indexOf("jaj")?t.slice(0,-3)+"leS":-1!==e.indexOf("jar")?t.slice(0,-3)+"waQ":-1!==e.indexOf("DIS")?t.slice(0,-3)+"nem":t+" pIq"}function r(e){var t=e;return -1!==e.indexOf("jaj")?t.slice(0,-3)+"Hu’":-1!==e.indexOf("jar")?t.slice(0,-3)+"wen":-1!==e.indexOf("DIS")?t.slice(0,-3)+"ben":t+" ret"}function i(e,t,n,r){var i=a(e);switch(n){case"ss":return i+" lup";case"mm":return i+" tup";case"hh":return i+" rep";case"dd":return i+" jaj";case"MM":return i+" jar";case"yy":return i+" DIS"}}function a(e){var n=Math.floor(e%1e3/100),r=Math.floor(e%100/10),i=e%10,a="";return n>0&&(a+=t[n]+"vatlh"),r>0&&(a+=(""!==a?" ":"")+t[r]+"maH"),i>0&&(a+=(""!==a?" ":"")+t[i]),""===a?"pagh":a}return e.defineLocale("tlh",{months:"tera’ jar wa’_tera’ jar cha’_tera’ jar wej_tera’ jar loS_tera’ jar vagh_tera’ jar jav_tera’ jar Soch_tera’ jar chorgh_tera’ jar Hut_tera’ jar wa’maH_tera’ jar wa’maH wa’_tera’ jar wa’maH cha’".split("_"),monthsShort:"jar wa’_jar cha’_jar wej_jar loS_jar vagh_jar jav_jar Soch_jar chorgh_jar Hut_jar wa’maH_jar wa’maH wa’_jar wa’maH cha’".split("_"),monthsParseExact:!0,weekdays:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),weekdaysShort:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),weekdaysMin:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[DaHjaj] LT",nextDay:"[wa’leS] LT",nextWeek:"LLL",lastDay:"[wa’Hu’] LT",lastWeek:"LLL",sameElse:"L"},relativeTime:{future:n,past:r,s:"puS lup",ss:i,m:"wa’ tup",mm:i,h:"wa’ rep",hh:i,d:"wa’ jaj",dd:i,M:"wa’ jar",MM:i,y:"wa’ DIS",yy:i},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})})(n(30381))},72397:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration +var t={1:"'inci",5:"'inci",8:"'inci",70:"'inci",80:"'inci",2:"'nci",7:"'nci",20:"'nci",50:"'nci",3:"'\xfcnc\xfc",4:"'\xfcnc\xfc",100:"'\xfcnc\xfc",6:"'ncı",9:"'uncu",10:"'uncu",30:"'uncu",60:"'ıncı",90:"'ıncı"};return e.defineLocale("tr",{months:"Ocak_Şubat_Mart_Nisan_Mayıs_Haziran_Temmuz_Ağustos_Eyl\xfcl_Ekim_Kasım_Aralık".split("_"),monthsShort:"Oca_Şub_Mar_Nis_May_Haz_Tem_Ağu_Eyl_Eki_Kas_Ara".split("_"),weekdays:"Pazar_Pazartesi_Salı_\xc7arşamba_Perşembe_Cuma_Cumartesi".split("_"),weekdaysShort:"Paz_Pts_Sal_\xc7ar_Per_Cum_Cts".split("_"),weekdaysMin:"Pz_Pt_Sa_\xc7a_Pe_Cu_Ct".split("_"),meridiem:function(e,t,n){return e<12?n?"\xf6\xf6":"\xd6\xd6":n?"\xf6s":"\xd6S"},meridiemParse:/öö|ÖÖ|ös|ÖS/,isPM:function(e){return"\xf6s"===e||"\xd6S"===e},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[bug\xfcn saat] LT",nextDay:"[yarın saat] LT",nextWeek:"[gelecek] dddd [saat] LT",lastDay:"[d\xfcn] LT",lastWeek:"[ge\xe7en] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s sonra",past:"%s \xf6nce",s:"birka\xe7 saniye",ss:"%d saniye",m:"bir dakika",mm:"%d dakika",h:"bir saat",hh:"%d saat",d:"bir g\xfcn",dd:"%d g\xfcn",w:"bir hafta",ww:"%d hafta",M:"bir ay",MM:"%d ay",y:"bir yıl",yy:"%d yıl"},ordinal:function(e,n){switch(n){case"d":case"D":case"Do":case"DD":return e;default:if(0===e)return e+"'ıncı";var r=e%10,i=e%100-r,a=e>=100?100:null;return e+(t[r]||t[i]||t[a])}},week:{dow:1,doy:7}})})(n(30381))},28254:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration +var t=e.defineLocale("tzl",{months:"Januar_Fevraglh_Mar\xe7_Avr\xefu_Mai_G\xfcn_Julia_Guscht_Setemvar_Listop\xe4ts_Noemvar_Zecemvar".split("_"),monthsShort:"Jan_Fev_Mar_Avr_Mai_G\xfcn_Jul_Gus_Set_Lis_Noe_Zec".split("_"),weekdays:"S\xfaladi_L\xfane\xe7i_Maitzi_M\xe1rcuri_Xh\xfaadi_Vi\xe9ner\xe7i_S\xe1turi".split("_"),weekdaysShort:"S\xfal_L\xfan_Mai_M\xe1r_Xh\xfa_Vi\xe9_S\xe1t".split("_"),weekdaysMin:"S\xfa_L\xfa_Ma_M\xe1_Xh_Vi_S\xe1".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD.MM.YYYY",LL:"D. MMMM [dallas] YYYY",LLL:"D. MMMM [dallas] YYYY HH.mm",LLLL:"dddd, [li] D. MMMM [dallas] YYYY HH.mm"},meridiemParse:/d\'o|d\'a/i,isPM:function(e){return"d'o"===e.toLowerCase()},meridiem:function(e,t,n){return e>11?n?"d'o":"D'O":n?"d'a":"D'A"},calendar:{sameDay:"[oxhi \xe0] LT",nextDay:"[dem\xe0 \xe0] LT",nextWeek:"dddd [\xe0] LT",lastDay:"[ieiri \xe0] LT",lastWeek:"[s\xfcr el] dddd [lasteu \xe0] LT",sameElse:"L"},relativeTime:{future:"osprei %s",past:"ja%s",s:n,ss:n,m:n,mm:n,h:n,hh:n,d:n,dd:n,M:n,MM:n,y:n,yy:n},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}});function n(e,t,n,r){var i={s:["viensas secunds","'iensas secunds"],ss:[e+" secunds",""+e+" secunds"],m:["'n m\xedut","'iens m\xedut"],mm:[e+" m\xeduts",""+e+" m\xeduts"],h:["'n \xfeora","'iensa \xfeora"],hh:[e+" \xfeoras",""+e+" \xfeoras"],d:["'n ziua","'iensa ziua"],dd:[e+" ziuas",""+e+" ziuas"],M:["'n mes","'iens mes"],MM:[e+" mesen",""+e+" mesen"],y:["'n ar","'iens ar"],yy:[e+" ars",""+e+" ars"]};return r?i[n][0]:t?i[n][0]:i[n][1]}return t})(n(30381))},30699:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("tzm-latn",{months:"innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir".split("_"),monthsShort:"innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir".split("_"),weekdays:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),weekdaysShort:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),weekdaysMin:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[asdkh g] LT",nextDay:"[aska g] LT",nextWeek:"dddd [g] LT",lastDay:"[assant g] LT",lastWeek:"dddd [g] LT",sameElse:"L"},relativeTime:{future:"dadkh s yan %s",past:"yan %s",s:"imik",ss:"%d imik",m:"minuḍ",mm:"%d minuḍ",h:"saɛa",hh:"%d tassaɛin",d:"ass",dd:"%d ossan",M:"ayowr",MM:"%d iyyirn",y:"asgas",yy:"%d isgasn"},week:{dow:6,doy:12}})})(n(30381))},51106:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("tzm",{months:"ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ".split("_"),monthsShort:"ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ".split("_"),weekdays:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),weekdaysShort:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),weekdaysMin:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[ⴰⵙⴷⵅ ⴴ] LT",nextDay:"[ⴰⵙⴽⴰ ⴴ] LT",nextWeek:"dddd [ⴴ] LT",lastDay:"[ⴰⵚⴰⵏⵜ ⴴ] LT",lastWeek:"dddd [ⴴ] LT",sameElse:"L"},relativeTime:{future:"ⴷⴰⴷⵅ ⵙ ⵢⴰⵏ %s",past:"ⵢⴰⵏ %s",s:"ⵉⵎⵉⴽ",ss:"%d ⵉⵎⵉⴽ",m:"ⵎⵉⵏⵓⴺ",mm:"%d ⵎⵉⵏⵓⴺ",h:"ⵙⴰⵄⴰ",hh:"%d ⵜⴰⵙⵙⴰⵄⵉⵏ",d:"ⴰⵙⵙ",dd:"%d oⵙⵙⴰⵏ",M:"ⴰⵢoⵓⵔ",MM:"%d ⵉⵢⵢⵉⵔⵏ",y:"ⴰⵙⴳⴰⵙ",yy:"%d ⵉⵙⴳⴰⵙⵏ"},week:{dow:6,doy:12}})})(n(30381))},9288:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("ug-cn",{months:"يانۋار_فېۋرال_مارت_ئاپرېل_ماي_ئىيۇن_ئىيۇل_ئاۋغۇست_سېنتەبىر_ئۆكتەبىر_نويابىر_دېكابىر".split("_"),monthsShort:"يانۋار_فېۋرال_مارت_ئاپرېل_ماي_ئىيۇن_ئىيۇل_ئاۋغۇست_سېنتەبىر_ئۆكتەبىر_نويابىر_دېكابىر".split("_"),weekdays:"يەكشەنبە_دۈشەنبە_سەيشەنبە_چارشەنبە_پەيشەنبە_جۈمە_شەنبە".split("_"),weekdaysShort:"يە_دۈ_سە_چا_پە_جۈ_شە".split("_"),weekdaysMin:"يە_دۈ_سە_چا_پە_جۈ_شە".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY-يىلىM-ئاينىڭD-كۈنى",LLL:"YYYY-يىلىM-ئاينىڭD-كۈنى، HH:mm",LLLL:"dddd، YYYY-يىلىM-ئاينىڭD-كۈنى، HH:mm"},meridiemParse:/يېرىم كېچە|سەھەر|چۈشتىن بۇرۇن|چۈش|چۈشتىن كېيىن|كەچ/,meridiemHour:function(e,t){return(12===e&&(e=0),"يېرىم كېچە"===t||"سەھەر"===t||"چۈشتىن بۇرۇن"===t)?e:"چۈشتىن كېيىن"===t||"كەچ"===t?e+12:e>=11?e:e+12},meridiem:function(e,t,n){var r=100*e+t;if(r<600)return"يېرىم كېچە";if(r<900)return"سەھەر";if(r<1130)return"چۈشتىن بۇرۇن";if(r<1230)return"چۈش";if(r<1800)return"چۈشتىن كېيىن";else return"كەچ"},calendar:{sameDay:"[بۈگۈن سائەت] LT",nextDay:"[ئەتە سائەت] LT",nextWeek:"[كېلەركى] dddd [سائەت] LT",lastDay:"[تۆنۈگۈن] LT",lastWeek:"[ئالدىنقى] dddd [سائەت] LT",sameElse:"L"},relativeTime:{future:"%s كېيىن",past:"%s بۇرۇن",s:"نەچچە سېكونت",ss:"%d سېكونت",m:"بىر مىنۇت",mm:"%d مىنۇت",h:"بىر سائەت",hh:"%d سائەت",d:"بىر كۈن",dd:"%d كۈن",M:"بىر ئاي",MM:"%d ئاي",y:"بىر يىل",yy:"%d يىل"},dayOfMonthOrdinalParse:/\d{1,2}(-كۈنى|-ئاي|-ھەپتە)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"-كۈنى";case"w":case"W":return e+"-ھەپتە";default:return e}},preparse:function(e){return e.replace(/،/g,",")},postformat:function(e){return e.replace(/,/g,"،")},week:{dow:1,doy:7}})})(n(30381))},67691:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration +function t(e,t){var n=e.split("_");return t%10==1&&t%100!=11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}function n(e,n,r){var i={ss:n?"секунда_секунди_секунд":"секунду_секунди_секунд",mm:n?"хвилина_хвилини_хвилин":"хвилину_хвилини_хвилин",hh:n?"година_години_годин":"годину_години_годин",dd:"день_дні_днів",MM:"місяць_місяці_місяців",yy:"рік_роки_років"};return"m"===r?n?"хвилина":"хвилину":"h"===r?n?"година":"годину":e+" "+t(i[r],+e)}function r(e,t){var n,r={nominative:"неділя_понеділок_вівторок_середа_четвер_п’ятниця_субота".split("_"),accusative:"неділю_понеділок_вівторок_середу_четвер_п’ятницю_суботу".split("_"),genitive:"неділі_понеділка_вівторка_середи_четверга_п’ятниці_суботи".split("_")};return!0===e?r.nominative.slice(1,7).concat(r.nominative.slice(0,1)):e?r[n=/(\[[ВвУу]\]) ?dddd/.test(t)?"accusative":/\[?(?:минулої|наступної)? ?\] ?dddd/.test(t)?"genitive":"nominative"][e.day()]:r.nominative}function i(e){return function(){return e+"о"+(11===this.hours()?"б":"")+"] LT"}}return e.defineLocale("uk",{months:{format:"січня_лютого_березня_квітня_травня_червня_липня_серпня_вересня_жовтня_листопада_грудня".split("_"),standalone:"січень_лютий_березень_квітень_травень_червень_липень_серпень_вересень_жовтень_листопад_грудень".split("_")},monthsShort:"січ_лют_бер_квіт_трав_черв_лип_серп_вер_жовт_лист_груд".split("_"),weekdays:r,weekdaysShort:"нд_пн_вт_ср_чт_пт_сб".split("_"),weekdaysMin:"нд_пн_вт_ср_чт_пт_сб".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY р.",LLL:"D MMMM YYYY р., HH:mm",LLLL:"dddd, D MMMM YYYY р., HH:mm"},calendar:{sameDay:i("[Сьогодні "),nextDay:i("[Завтра "),lastDay:i("[Вчора "),nextWeek:i("[У] dddd ["),lastWeek:function(){switch(this.day()){case 0:case 3:case 5:case 6:return i("[Минулої] dddd [").call(this);case 1:case 2:case 4:return i("[Минулого] dddd [").call(this)}},sameElse:"L"},relativeTime:{future:"за %s",past:"%s тому",s:"декілька секунд",ss:n,m:n,mm:n,h:"годину",hh:n,d:"день",dd:n,M:"місяць",MM:n,y:"рік",yy:n},meridiemParse:/ночі|ранку|дня|вечора/,isPM:function(e){return/^(дня|вечора)$/.test(e)},meridiem:function(e,t,n){return e<4?"ночі":e<12?"ранку":e<17?"дня":"вечора"},dayOfMonthOrdinalParse:/\d{1,2}-(й|го)/,ordinal:function(e,t){switch(t){case"M":case"d":case"DDD":case"w":case"W":return e+"-й";case"D":return e+"-го";default:return e}},week:{dow:1,doy:7}})})(n(30381))},13795:function(e,t,n){var r,i;r=this,(i=function(e){"use strict";//! moment.js locale configuration +var t=["جنوری","فروری","مارچ","اپریل","مئی","جون","جولائی","اگست","ستمبر","اکتوبر","نومبر","دسمبر",],n=["اتوار","پیر","منگل","بدھ","جمعرات","جمعہ","ہفتہ"];return e.defineLocale("ur",{months:t,monthsShort:t,weekdays:n,weekdaysShort:n,weekdaysMin:n,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd، D MMMM YYYY HH:mm"},meridiemParse:/صبح|شام/,isPM:function(e){return"شام"===e},meridiem:function(e,t,n){return e<12?"صبح":"شام"},calendar:{sameDay:"[آج بوقت] LT",nextDay:"[کل بوقت] LT",nextWeek:"dddd [بوقت] LT",lastDay:"[گذشتہ روز بوقت] LT",lastWeek:"[گذشتہ] dddd [بوقت] LT",sameElse:"L"},relativeTime:{future:"%s بعد",past:"%s قبل",s:"چند سیکنڈ",ss:"%d سیکنڈ",m:"ایک منٹ",mm:"%d منٹ",h:"ایک گھنٹہ",hh:"%d گھنٹے",d:"ایک دن",dd:"%d دن",M:"ایک ماہ",MM:"%d ماہ",y:"ایک سال",yy:"%d سال"},preparse:function(e){return e.replace(/،/g,",")},postformat:function(e){return e.replace(/,/g,"،")},week:{dow:1,doy:4}})})(n(30381))},60588:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("uz-latn",{months:"Yanvar_Fevral_Mart_Aprel_May_Iyun_Iyul_Avgust_Sentabr_Oktabr_Noyabr_Dekabr".split("_"),monthsShort:"Yan_Fev_Mar_Apr_May_Iyun_Iyul_Avg_Sen_Okt_Noy_Dek".split("_"),weekdays:"Yakshanba_Dushanba_Seshanba_Chorshanba_Payshanba_Juma_Shanba".split("_"),weekdaysShort:"Yak_Dush_Sesh_Chor_Pay_Jum_Shan".split("_"),weekdaysMin:"Ya_Du_Se_Cho_Pa_Ju_Sha".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"D MMMM YYYY, dddd HH:mm"},calendar:{sameDay:"[Bugun soat] LT [da]",nextDay:"[Ertaga] LT [da]",nextWeek:"dddd [kuni soat] LT [da]",lastDay:"[Kecha soat] LT [da]",lastWeek:"[O'tgan] dddd [kuni soat] LT [da]",sameElse:"L"},relativeTime:{future:"Yaqin %s ichida",past:"Bir necha %s oldin",s:"soniya",ss:"%d soniya",m:"bir daqiqa",mm:"%d daqiqa",h:"bir soat",hh:"%d soat",d:"bir kun",dd:"%d kun",M:"bir oy",MM:"%d oy",y:"bir yil",yy:"%d yil"},week:{dow:1,doy:7}})})(n(30381))},6791:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("uz",{months:"январ_феврал_март_апрел_май_июн_июл_август_сентябр_октябр_ноябр_декабр".split("_"),monthsShort:"янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек".split("_"),weekdays:"Якшанба_Душанба_Сешанба_Чоршанба_Пайшанба_Жума_Шанба".split("_"),weekdaysShort:"Якш_Душ_Сеш_Чор_Пай_Жум_Шан".split("_"),weekdaysMin:"Як_Ду_Се_Чо_Па_Жу_Ша".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"D MMMM YYYY, dddd HH:mm"},calendar:{sameDay:"[Бугун соат] LT [да]",nextDay:"[Эртага] LT [да]",nextWeek:"dddd [куни соат] LT [да]",lastDay:"[Кеча соат] LT [да]",lastWeek:"[Утган] dddd [куни соат] LT [да]",sameElse:"L"},relativeTime:{future:"Якин %s ичида",past:"Бир неча %s олдин",s:"фурсат",ss:"%d фурсат",m:"бир дакика",mm:"%d дакика",h:"бир соат",hh:"%d соат",d:"бир кун",dd:"%d кун",M:"бир ой",MM:"%d ой",y:"бир йил",yy:"%d йил"},week:{dow:1,doy:7}})})(n(30381))},65666:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("vi",{months:"th\xe1ng 1_th\xe1ng 2_th\xe1ng 3_th\xe1ng 4_th\xe1ng 5_th\xe1ng 6_th\xe1ng 7_th\xe1ng 8_th\xe1ng 9_th\xe1ng 10_th\xe1ng 11_th\xe1ng 12".split("_"),monthsShort:"Thg 01_Thg 02_Thg 03_Thg 04_Thg 05_Thg 06_Thg 07_Thg 08_Thg 09_Thg 10_Thg 11_Thg 12".split("_"),monthsParseExact:!0,weekdays:"chủ nhật_thứ hai_thứ ba_thứ tư_thứ năm_thứ s\xe1u_thứ bảy".split("_"),weekdaysShort:"CN_T2_T3_T4_T5_T6_T7".split("_"),weekdaysMin:"CN_T2_T3_T4_T5_T6_T7".split("_"),weekdaysParseExact:!0,meridiemParse:/sa|ch/i,isPM:function(e){return/^ch$/i.test(e)},meridiem:function(e,t,n){return e<12?n?"sa":"SA":n?"ch":"CH"},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM [năm] YYYY",LLL:"D MMMM [năm] YYYY HH:mm",LLLL:"dddd, D MMMM [năm] YYYY HH:mm",l:"DD/M/YYYY",ll:"D MMM YYYY",lll:"D MMM YYYY HH:mm",llll:"ddd, D MMM YYYY HH:mm"},calendar:{sameDay:"[H\xf4m nay l\xfac] LT",nextDay:"[Ng\xe0y mai l\xfac] LT",nextWeek:"dddd [tuần tới l\xfac] LT",lastDay:"[H\xf4m qua l\xfac] LT",lastWeek:"dddd [tuần trước l\xfac] LT",sameElse:"L"},relativeTime:{future:"%s tới",past:"%s trước",s:"v\xe0i gi\xe2y",ss:"%d gi\xe2y",m:"một ph\xfat",mm:"%d ph\xfat",h:"một giờ",hh:"%d giờ",d:"một ng\xe0y",dd:"%d ng\xe0y",w:"một tuần",ww:"%d tuần",M:"một th\xe1ng",MM:"%d th\xe1ng",y:"một năm",yy:"%d năm"},dayOfMonthOrdinalParse:/\d{1,2}/,ordinal:function(e){return e},week:{dow:1,doy:4}})})(n(30381))},14378:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("x-pseudo",{months:"J~\xe1\xf1\xfa\xe1~r\xfd_F~\xe9br\xfa~\xe1r\xfd_~M\xe1rc~h_\xc1p~r\xedl_~M\xe1\xfd_~J\xfa\xf1\xe9~_J\xfal~\xfd_\xc1\xfa~g\xfast~_S\xe9p~t\xe9mb~\xe9r_\xd3~ct\xf3b~\xe9r_\xd1~\xf3v\xe9m~b\xe9r_~D\xe9c\xe9~mb\xe9r".split("_"),monthsShort:"J~\xe1\xf1_~F\xe9b_~M\xe1r_~\xc1pr_~M\xe1\xfd_~J\xfa\xf1_~J\xfal_~\xc1\xfag_~S\xe9p_~\xd3ct_~\xd1\xf3v_~D\xe9c".split("_"),monthsParseExact:!0,weekdays:"S~\xfa\xf1d\xe1~\xfd_M\xf3~\xf1d\xe1\xfd~_T\xfa\xe9~sd\xe1\xfd~_W\xe9d~\xf1\xe9sd~\xe1\xfd_T~h\xfars~d\xe1\xfd_~Fr\xedd~\xe1\xfd_S~\xe1t\xfar~d\xe1\xfd".split("_"),weekdaysShort:"S~\xfa\xf1_~M\xf3\xf1_~T\xfa\xe9_~W\xe9d_~Th\xfa_~Fr\xed_~S\xe1t".split("_"),weekdaysMin:"S~\xfa_M\xf3~_T\xfa_~W\xe9_T~h_Fr~_S\xe1".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[T~\xf3d\xe1~\xfd \xe1t] LT",nextDay:"[T~\xf3m\xf3~rr\xf3~w \xe1t] LT",nextWeek:"dddd [\xe1t] LT",lastDay:"[\xdd~\xe9st~\xe9rd\xe1~\xfd \xe1t] LT",lastWeek:"[L~\xe1st] dddd [\xe1t] LT",sameElse:"L"},relativeTime:{future:"\xed~\xf1 %s",past:"%s \xe1~g\xf3",s:"\xe1 ~f\xe9w ~s\xe9c\xf3~\xf1ds",ss:"%d s~\xe9c\xf3\xf1~ds",m:"\xe1 ~m\xed\xf1~\xfat\xe9",mm:"%d m~\xed\xf1\xfa~t\xe9s",h:"\xe1~\xf1 h\xf3~\xfar",hh:"%d h~\xf3\xfars",d:"\xe1 ~d\xe1\xfd",dd:"%d d~\xe1\xfds",M:"\xe1 ~m\xf3\xf1~th",MM:"%d m~\xf3\xf1t~hs",y:"\xe1 ~\xfd\xe9\xe1r",yy:"%d \xfd~\xe9\xe1rs"},dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10,n=1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th";return e+n},week:{dow:1,doy:4}})})(n(30381))},75805:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("yo",{months:"Sẹ́rẹ́_Èrèlè_Ẹrẹ̀nà_Ìgbé_Èbibi_Òkùdu_Agẹmo_Ògún_Owewe_Ọ̀wàrà_Bélú_Ọ̀pẹ̀̀".split("_"),monthsShort:"Sẹ́r_Èrl_Ẹrn_Ìgb_Èbi_Òkù_Agẹ_Ògú_Owe_Ọ̀wà_Bél_Ọ̀pẹ̀̀".split("_"),weekdays:"Àìkú_Ajé_Ìsẹ́gun_Ọjọ́rú_Ọjọ́bọ_Ẹtì_Àbámẹ́ta".split("_"),weekdaysShort:"Àìk_Ajé_Ìsẹ́_Ọjr_Ọjb_Ẹtì_Àbá".split("_"),weekdaysMin:"Àì_Aj_Ìs_Ọr_Ọb_Ẹt_Àb".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Ònì ni] LT",nextDay:"[Ọ̀la ni] LT",nextWeek:"dddd [Ọsẹ̀ tón'bọ] [ni] LT",lastDay:"[Àna ni] LT",lastWeek:"dddd [Ọsẹ̀ tólọ́] [ni] LT",sameElse:"L"},relativeTime:{future:"ní %s",past:"%s kọjá",s:"ìsẹjú aayá die",ss:"aayá %d",m:"ìsẹjú kan",mm:"ìsẹjú %d",h:"wákati kan",hh:"wákati %d",d:"ọjọ́ kan",dd:"ọjọ́ %d",M:"osù kan",MM:"osù %d",y:"ọdún kan",yy:"ọdún %d"},dayOfMonthOrdinalParse:/ọjọ́\s\d{1,2}/,ordinal:"ọjọ́ %d",week:{dow:1,doy:4}})})(n(30381))},83839:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("zh-cn",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah点mm分",LLLL:"YYYY年M月D日ddddAh点mm分",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){return(12===e&&(e=0),"凌晨"===t||"早上"===t||"上午"===t)?e:"下午"===t||"晚上"===t?e+12:e>=11?e:e+12},meridiem:function(e,t,n){var r=100*e+t;if(r<600)return"凌晨";if(r<900)return"早上";if(r<1130)return"上午";if(r<1230)return"中午";if(r<1800)return"下午";else return"晚上"},calendar:{sameDay:"[今天]LT",nextDay:"[明天]LT",nextWeek:function(e){return e.week()!==this.week()?"[下]dddLT":"[本]dddLT"},lastDay:"[昨天]LT",lastWeek:function(e){return this.week()!==e.week()?"[上]dddLT":"[本]dddLT"},sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|周)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"周";default:return e}},relativeTime:{future:"%s后",past:"%s前",s:"几秒",ss:"%d 秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",w:"1 周",ww:"%d 周",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},week:{dow:1,doy:4}})})(n(30381))},55726:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("zh-hk",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"週日_週一_週二_週三_週四_週五_週六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日dddd HH:mm",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){return(12===e&&(e=0),"凌晨"===t||"早上"===t||"上午"===t)?e:"中午"===t?e>=11?e:e+12:"下午"===t||"晚上"===t?e+12:void 0},meridiem:function(e,t,n){var r=100*e+t;if(r<600)return"凌晨";if(r<900)return"早上";if(r<1200)return"上午";if(1200===r)return"中午";if(r<1800)return"下午";else return"晚上"},calendar:{sameDay:"[今天]LT",nextDay:"[明天]LT",nextWeek:"[下]ddddLT",lastDay:"[昨天]LT",lastWeek:"[上]ddddLT",sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|週)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"週";default:return e}},relativeTime:{future:"%s後",past:"%s前",s:"幾秒",ss:"%d 秒",m:"1 分鐘",mm:"%d 分鐘",h:"1 小時",hh:"%d 小時",d:"1 天",dd:"%d 天",M:"1 個月",MM:"%d 個月",y:"1 年",yy:"%d 年"}})})(n(30381))},99807:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("zh-mo",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"週日_週一_週二_週三_週四_週五_週六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日dddd HH:mm",l:"D/M/YYYY",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){return(12===e&&(e=0),"凌晨"===t||"早上"===t||"上午"===t)?e:"中午"===t?e>=11?e:e+12:"下午"===t||"晚上"===t?e+12:void 0},meridiem:function(e,t,n){var r=100*e+t;if(r<600)return"凌晨";if(r<900)return"早上";if(r<1130)return"上午";if(r<1230)return"中午";if(r<1800)return"下午";else return"晚上"},calendar:{sameDay:"[今天] LT",nextDay:"[明天] LT",nextWeek:"[下]dddd LT",lastDay:"[昨天] LT",lastWeek:"[上]dddd LT",sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|週)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"週";default:return e}},relativeTime:{future:"%s內",past:"%s前",s:"幾秒",ss:"%d 秒",m:"1 分鐘",mm:"%d 分鐘",h:"1 小時",hh:"%d 小時",d:"1 天",dd:"%d 天",M:"1 個月",MM:"%d 個月",y:"1 年",yy:"%d 年"}})})(n(30381))},74152:function(e,t,n){var r,i;r=this,(i=function(e){return e.defineLocale("zh-tw",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"週日_週一_週二_週三_週四_週五_週六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日dddd HH:mm",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){return(12===e&&(e=0),"凌晨"===t||"早上"===t||"上午"===t)?e:"中午"===t?e>=11?e:e+12:"下午"===t||"晚上"===t?e+12:void 0},meridiem:function(e,t,n){var r=100*e+t;if(r<600)return"凌晨";if(r<900)return"早上";if(r<1130)return"上午";if(r<1230)return"中午";if(r<1800)return"下午";else return"晚上"},calendar:{sameDay:"[今天] LT",nextDay:"[明天] LT",nextWeek:"[下]dddd LT",lastDay:"[昨天] LT",lastWeek:"[上]dddd LT",sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|週)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"週";default:return e}},relativeTime:{future:"%s後",past:"%s前",s:"幾秒",ss:"%d 秒",m:"1 分鐘",mm:"%d 分鐘",h:"1 小時",hh:"%d 小時",d:"1 天",dd:"%d 天",M:"1 個月",MM:"%d 個月",y:"1 年",yy:"%d 年"}})})(n(30381))},46700(e,t,n){var r={"./af":42786,"./af.js":42786,"./ar":30867,"./ar-dz":14130,"./ar-dz.js":14130,"./ar-kw":96135,"./ar-kw.js":96135,"./ar-ly":56440,"./ar-ly.js":56440,"./ar-ma":47702,"./ar-ma.js":47702,"./ar-sa":16040,"./ar-sa.js":16040,"./ar-tn":37100,"./ar-tn.js":37100,"./ar.js":30867,"./az":31083,"./az.js":31083,"./be":9808,"./be.js":9808,"./bg":68338,"./bg.js":68338,"./bm":67438,"./bm.js":67438,"./bn":8905,"./bn-bd":76225,"./bn-bd.js":76225,"./bn.js":8905,"./bo":11560,"./bo.js":11560,"./br":1278,"./br.js":1278,"./bs":80622,"./bs.js":80622,"./ca":2468,"./ca.js":2468,"./cs":5822,"./cs.js":5822,"./cv":50877,"./cv.js":50877,"./cy":47373,"./cy.js":47373,"./da":24780,"./da.js":24780,"./de":59740,"./de-at":60217,"./de-at.js":60217,"./de-ch":60894,"./de-ch.js":60894,"./de.js":59740,"./dv":5300,"./dv.js":5300,"./el":50837,"./el.js":50837,"./en-au":78348,"./en-au.js":78348,"./en-ca":77925,"./en-ca.js":77925,"./en-gb":22243,"./en-gb.js":22243,"./en-ie":46436,"./en-ie.js":46436,"./en-il":47207,"./en-il.js":47207,"./en-in":44175,"./en-in.js":44175,"./en-nz":76319,"./en-nz.js":76319,"./en-sg":31662,"./en-sg.js":31662,"./eo":92915,"./eo.js":92915,"./es":55655,"./es-do":55251,"./es-do.js":55251,"./es-mx":96112,"./es-mx.js":96112,"./es-us":71146,"./es-us.js":71146,"./es.js":55655,"./et":5603,"./et.js":5603,"./eu":77763,"./eu.js":77763,"./fa":76959,"./fa.js":76959,"./fi":11897,"./fi.js":11897,"./fil":42549,"./fil.js":42549,"./fo":94694,"./fo.js":94694,"./fr":94470,"./fr-ca":63049,"./fr-ca.js":63049,"./fr-ch":52330,"./fr-ch.js":52330,"./fr.js":94470,"./fy":5044,"./fy.js":5044,"./ga":29295,"./ga.js":29295,"./gd":2101,"./gd.js":2101,"./gl":38794,"./gl.js":38794,"./gom-deva":27884,"./gom-deva.js":27884,"./gom-latn":23168,"./gom-latn.js":23168,"./gu":95349,"./gu.js":95349,"./he":24206,"./he.js":24206,"./hi":30094,"./hi.js":30094,"./hr":30316,"./hr.js":30316,"./hu":22138,"./hu.js":22138,"./hy-am":11423,"./hy-am.js":11423,"./id":29218,"./id.js":29218,"./is":90135,"./is.js":90135,"./it":90626,"./it-ch":10150,"./it-ch.js":10150,"./it.js":90626,"./ja":39183,"./ja.js":39183,"./jv":24286,"./jv.js":24286,"./ka":12105,"./ka.js":12105,"./kk":47772,"./kk.js":47772,"./km":18758,"./km.js":18758,"./kn":79282,"./kn.js":79282,"./ko":33730,"./ko.js":33730,"./ku":1408,"./ku.js":1408,"./ky":33291,"./ky.js":33291,"./lb":36841,"./lb.js":36841,"./lo":55466,"./lo.js":55466,"./lt":57010,"./lt.js":57010,"./lv":37595,"./lv.js":37595,"./me":39861,"./me.js":39861,"./mi":35493,"./mi.js":35493,"./mk":95966,"./mk.js":95966,"./ml":87341,"./ml.js":87341,"./mn":5115,"./mn.js":5115,"./mr":10370,"./mr.js":10370,"./ms":9847,"./ms-my":41237,"./ms-my.js":41237,"./ms.js":9847,"./mt":72126,"./mt.js":72126,"./my":56165,"./my.js":56165,"./nb":64924,"./nb.js":64924,"./ne":16744,"./ne.js":16744,"./nl":93901,"./nl-be":59814,"./nl-be.js":59814,"./nl.js":93901,"./nn":83877,"./nn.js":83877,"./oc-lnc":92135,"./oc-lnc.js":92135,"./pa-in":15858,"./pa-in.js":15858,"./pl":64495,"./pl.js":64495,"./pt":89520,"./pt-br":57971,"./pt-br.js":57971,"./pt.js":89520,"./ro":96459,"./ro.js":96459,"./ru":21793,"./ru.js":21793,"./sd":40950,"./sd.js":40950,"./se":10490,"./se.js":10490,"./si":90124,"./si.js":90124,"./sk":64249,"./sk.js":64249,"./sl":14985,"./sl.js":14985,"./sq":51104,"./sq.js":51104,"./sr":49131,"./sr-cyrl":79915,"./sr-cyrl.js":79915,"./sr.js":49131,"./ss":85893,"./ss.js":85893,"./sv":98760,"./sv.js":98760,"./sw":91172,"./sw.js":91172,"./ta":27333,"./ta.js":27333,"./te":23110,"./te.js":23110,"./tet":52095,"./tet.js":52095,"./tg":27321,"./tg.js":27321,"./th":9041,"./th.js":9041,"./tk":19005,"./tk.js":19005,"./tl-ph":75768,"./tl-ph.js":75768,"./tlh":89444,"./tlh.js":89444,"./tr":72397,"./tr.js":72397,"./tzl":28254,"./tzl.js":28254,"./tzm":51106,"./tzm-latn":30699,"./tzm-latn.js":30699,"./tzm.js":51106,"./ug-cn":9288,"./ug-cn.js":9288,"./uk":67691,"./uk.js":67691,"./ur":13795,"./ur.js":13795,"./uz":6791,"./uz-latn":60588,"./uz-latn.js":60588,"./uz.js":6791,"./vi":65666,"./vi.js":65666,"./x-pseudo":14378,"./x-pseudo.js":14378,"./yo":75805,"./yo.js":75805,"./zh-cn":83839,"./zh-cn.js":83839,"./zh-hk":55726,"./zh-hk.js":55726,"./zh-mo":99807,"./zh-mo.js":99807,"./zh-tw":74152,"./zh-tw.js":74152};function i(e){return n(a(e))}function a(e){if(!n.o(r,e)){var t=Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return r[e]}i.keys=function(){return Object.keys(r)},i.resolve=a,e.exports=i,i.id=46700},30381:function(e,t,n){var r,i;e=n.nmd(e),r=this,i=function(){"use strict";function t(){return em.apply(null,arguments)}function r(e){em=e}function i(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function a(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function o(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function s(e){var t;if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(e).length;for(t in e)if(o(e,t))return!1;return!0}function u(e){return void 0===e}function c(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)}function l(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function f(e,t){var n,r=[];for(n=0;n>>0;for(t=0;t0)for(n=0;n=0?n?"+":"":"-")+Math.pow(10,Math.max(0,t-i.length)).toString().substr(1)+i}var R=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,j=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,F={},Y={};function B(e,t,n,r){var i=r;"string"==typeof r&&(i=function(){return this[r]()}),e&&(Y[e]=i),t&&(Y[t[0]]=function(){return P(i.apply(this,arguments),t[1],t[2])}),n&&(Y[n]=function(){return this.localeData().ordinal(i.apply(this,arguments),e)})}function U(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function H(e){var t,n,r=e.match(R);for(t=0,n=r.length;t=0&&j.test(e);)e=e.replace(j,r),j.lastIndex=0,n-=1;return e}var G={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function W(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.match(R).map(function(e){return"MMMM"===e||"MM"===e||"DD"===e||"dddd"===e?e.slice(1):e}).join(""),this._longDateFormat[e])}var K="Invalid date";function V(){return this._invalidDate}var q="%d",Z=/\d{1,2}/;function X(e){return this._ordinal.replace("%d",e)}var J={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function Q(e,t,n,r){var i=this._relativeTime[n];return A(i)?i(e,t,n,r):i.replace(/%d/i,e)}function ee(e,t){var n=this._relativeTime[e>0?"future":"past"];return A(n)?n(t):n.replace(/%s/i,t)}var et={};function en(e,t){var n=e.toLowerCase();et[n]=et[n+"s"]=et[t]=e}function er(e){return"string"==typeof e?et[e]||et[e.toLowerCase()]:void 0}function ei(e){var t,n,r={};for(n in e)o(e,n)&&(t=er(n))&&(r[t]=e[n]);return r}var ea={};function eo(e,t){ea[e]=t}function es(e){var t,n=[];for(t in e)o(e,t)&&n.push({unit:t,priority:ea[t]});return n.sort(function(e,t){return e.priority-t.priority}),n}function eu(e){return e%4==0&&e%100!=0||e%400==0}function ec(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function el(e){var t=+e,n=0;return 0!==t&&isFinite(t)&&(n=ec(t)),n}function ef(e,n){return function(r){return null!=r?(eh(this,e,r),t.updateOffset(this,n),this):ed(this,e)}}function ed(e,t){return e.isValid()?e._d["get"+(e._isUTC?"UTC":"")+t]():NaN}function eh(e,t,n){e.isValid()&&!isNaN(n)&&("FullYear"===t&&eu(e.year())&&1===e.month()&&29===e.date()?(n=el(n),e._d["set"+(e._isUTC?"UTC":"")+t](n,e.month(),e0(n,e.month()))):e._d["set"+(e._isUTC?"UTC":"")+t](n))}function ep(e){return A(this[e=er(e)])?this[e]():this}function eb(e,t){if("object"==typeof e){e=ei(e);var n,r=es(e);for(n=0;n68?1900:2e3)};var tu=ef("FullYear",!0);function tc(){return eu(this.year())}function tl(e,t,n,r,i,a,o){var s;return e<100&&e>=0?(s=new Date(e+400,t,n,r,i,a,o),isFinite(s.getFullYear())&&s.setFullYear(e)):s=new Date(e,t,n,r,i,a,o),s}function tf(e){var t,n;return e<100&&e>=0?(n=Array.prototype.slice.call(arguments),n[0]=e+400,t=new Date(Date.UTC.apply(null,n)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)):t=new Date(Date.UTC.apply(null,arguments)),t}function td(e,t,n){var r=7+t-n;return-((7+tf(e,0,r).getUTCDay()-t)%7)+r-1}function th(e,t,n,r,i){var a,o,s=(7+n-r)%7,u=td(e,r,i),c=1+7*(t-1)+s+u;return c<=0?o=ts(a=e-1)+c:c>ts(e)?(a=e+1,o=c-ts(e)):(a=e,o=c),{year:a,dayOfYear:o}}function tp(e,t,n){var r,i,a=td(e.year(),t,n),o=Math.floor((e.dayOfYear()-a-1)/7)+1;return o<1?r=o+tb(i=e.year()-1,t,n):o>tb(e.year(),t,n)?(r=o-tb(e.year(),t,n),i=e.year()+1):(i=e.year(),r=o),{week:r,year:i}}function tb(e,t,n){var r=td(e,t,n),i=td(e+1,t,n);return(ts(e)-r+i)/7}function tm(e){return tp(e,this._week.dow,this._week.doy).week}B("w",["ww",2],"wo","week"),B("W",["WW",2],"Wo","isoWeek"),en("week","w"),en("isoWeek","W"),eo("week",5),eo("isoWeek",5),ej("w",ex),ej("ww",ex,e_),ej("W",ex),ej("WW",ex,e_),e$(["w","ww","W","WW"],function(e,t,n,r){t[r.substr(0,1)]=el(e)});var tg={dow:0,doy:6};function tv(){return this._week.dow}function ty(){return this._week.doy}function tw(e){var t=this.localeData().week(this);return null==e?t:this.add((e-t)*7,"d")}function t_(e){var t=tp(this,1,4).week;return null==e?t:this.add((e-t)*7,"d")}function tE(e,t){return"string"!=typeof e?e:isNaN(e)?"number"==typeof(e=t.weekdaysParse(e))?e:null:parseInt(e,10)}function tS(e,t){return"string"==typeof e?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}function tk(e,t){return e.slice(t,7).concat(e.slice(0,t))}B("d",0,"do","day"),B("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),B("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),B("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),B("e",0,0,"weekday"),B("E",0,0,"isoWeekday"),en("day","d"),en("weekday","e"),en("isoWeekday","E"),eo("day",11),eo("weekday",11),eo("isoWeekday",11),ej("d",ex),ej("e",ex),ej("E",ex),ej("dd",function(e,t){return t.weekdaysMinRegex(e)}),ej("ddd",function(e,t){return t.weekdaysShortRegex(e)}),ej("dddd",function(e,t){return t.weekdaysRegex(e)}),e$(["dd","ddd","dddd"],function(e,t,n,r){var i=n._locale.weekdaysParse(e,r,n._strict);null!=i?t.d=i:b(n).invalidWeekday=e}),e$(["d","e","E"],function(e,t,n,r){t[r]=el(e)});var tx="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),tT="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),tM="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),tO=eR,tA=eR,tL=eR;function tC(e,t){var n=i(this._weekdays)?this._weekdays:this._weekdays[e&&!0!==e&&this._weekdays.isFormat.test(t)?"format":"standalone"];return!0===e?tk(n,this._week.dow):e?n[e.day()]:n}function tI(e){return!0===e?tk(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort}function tD(e){return!0===e?tk(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin}function tN(e,t,n){var r,i,a,o=e.toLocaleLowerCase();if(!this._weekdaysParse)for(r=0,this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[];r<7;++r)a=h([2e3,1]).day(r),this._minWeekdaysParse[r]=this.weekdaysMin(a,"").toLocaleLowerCase(),this._shortWeekdaysParse[r]=this.weekdaysShort(a,"").toLocaleLowerCase(),this._weekdaysParse[r]=this.weekdays(a,"").toLocaleLowerCase();return n?"dddd"===t?-1!==(i=tX.call(this._weekdaysParse,o))?i:null:"ddd"===t?-1!==(i=tX.call(this._shortWeekdaysParse,o))?i:null:-1!==(i=tX.call(this._minWeekdaysParse,o))?i:null:"dddd"===t?-1!==(i=tX.call(this._weekdaysParse,o))||-1!==(i=tX.call(this._shortWeekdaysParse,o))?i:-1!==(i=tX.call(this._minWeekdaysParse,o))?i:null:"ddd"===t?-1!==(i=tX.call(this._shortWeekdaysParse,o))||-1!==(i=tX.call(this._weekdaysParse,o))?i:-1!==(i=tX.call(this._minWeekdaysParse,o))?i:null:-1!==(i=tX.call(this._minWeekdaysParse,o))||-1!==(i=tX.call(this._weekdaysParse,o))?i:-1!==(i=tX.call(this._shortWeekdaysParse,o))?i:null}function tP(e,t,n){var r,i,a;if(this._weekdaysParseExact)return tN.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),r=0;r<7;r++){if(i=h([2e3,1]).day(r),n&&!this._fullWeekdaysParse[r]&&(this._fullWeekdaysParse[r]=RegExp("^"+this.weekdays(i,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[r]=RegExp("^"+this.weekdaysShort(i,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[r]=RegExp("^"+this.weekdaysMin(i,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[r]||(a="^"+this.weekdays(i,"")+"|^"+this.weekdaysShort(i,"")+"|^"+this.weekdaysMin(i,""),this._weekdaysParse[r]=RegExp(a.replace(".",""),"i")),n&&"dddd"===t&&this._fullWeekdaysParse[r].test(e))return r;if(n&&"ddd"===t&&this._shortWeekdaysParse[r].test(e))return r;if(n&&"dd"===t&&this._minWeekdaysParse[r].test(e))return r;else if(!n&&this._weekdaysParse[r].test(e))return r}}function tR(e){if(!this.isValid())return null!=e?this:NaN;var t=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=e?(e=tE(e,this.localeData()),this.add(e-t,"d")):t}function tj(e){if(!this.isValid())return null!=e?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return null==e?t:this.add(e-t,"d")}function tF(e){if(!this.isValid())return null!=e?this:NaN;if(null==e)return this.day()||7;var t=tS(e,this.localeData());return this.day(this.day()%7?t:t-7)}function tY(e){return this._weekdaysParseExact?(o(this,"_weekdaysRegex")||tH.call(this),e)?this._weekdaysStrictRegex:this._weekdaysRegex:(o(this,"_weekdaysRegex")||(this._weekdaysRegex=tO),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)}function tB(e){return this._weekdaysParseExact?(o(this,"_weekdaysRegex")||tH.call(this),e)?this._weekdaysShortStrictRegex:this._weekdaysShortRegex:(o(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=tA),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function tU(e){return this._weekdaysParseExact?(o(this,"_weekdaysRegex")||tH.call(this),e)?this._weekdaysMinStrictRegex:this._weekdaysMinRegex:(o(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=tL),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function tH(){function e(e,t){return t.length-e.length}var t,n,r,i,a,o=[],s=[],u=[],c=[];for(t=0;t<7;t++)n=h([2e3,1]).day(t),r=eB(this.weekdaysMin(n,"")),i=eB(this.weekdaysShort(n,"")),a=eB(this.weekdays(n,"")),o.push(r),s.push(i),u.push(a),c.push(r),c.push(i),c.push(a);o.sort(e),s.sort(e),u.sort(e),c.sort(e),this._weekdaysRegex=RegExp("^("+c.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=RegExp("^("+u.join("|")+")","i"),this._weekdaysShortStrictRegex=RegExp("^("+s.join("|")+")","i"),this._weekdaysMinStrictRegex=RegExp("^("+o.join("|")+")","i")}function t$(){return this.hours()%12||12}function tz(){return this.hours()||24}function tG(e,t){B(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}function tW(e,t){return t._meridiemParse}function tK(e){return"p"===(e+"").toLowerCase().charAt(0)}B("H",["HH",2],0,"hour"),B("h",["hh",2],0,t$),B("k",["kk",2],0,tz),B("hmm",0,0,function(){return""+t$.apply(this)+P(this.minutes(),2)}),B("hmmss",0,0,function(){return""+t$.apply(this)+P(this.minutes(),2)+P(this.seconds(),2)}),B("Hmm",0,0,function(){return""+this.hours()+P(this.minutes(),2)}),B("Hmmss",0,0,function(){return""+this.hours()+P(this.minutes(),2)+P(this.seconds(),2)}),tG("a",!0),tG("A",!1),en("hour","h"),eo("hour",13),ej("a",tW),ej("A",tW),ej("H",ex),ej("h",ex),ej("k",ex),ej("HH",ex,e_),ej("hh",ex,e_),ej("kk",ex,e_),ej("hmm",eT),ej("hmmss",eM),ej("Hmm",eT),ej("Hmmss",eM),eH(["H","HH"],eV),eH(["k","kk"],function(e,t,n){var r=el(e);t[eV]=24===r?0:r}),eH(["a","A"],function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e}),eH(["h","hh"],function(e,t,n){t[eV]=el(e),b(n).bigHour=!0}),eH("hmm",function(e,t,n){var r=e.length-2;t[eV]=el(e.substr(0,r)),t[eq]=el(e.substr(r)),b(n).bigHour=!0}),eH("hmmss",function(e,t,n){var r=e.length-4,i=e.length-2;t[eV]=el(e.substr(0,r)),t[eq]=el(e.substr(r,2)),t[eZ]=el(e.substr(i)),b(n).bigHour=!0}),eH("Hmm",function(e,t,n){var r=e.length-2;t[eV]=el(e.substr(0,r)),t[eq]=el(e.substr(r))}),eH("Hmmss",function(e,t,n){var r=e.length-4,i=e.length-2;t[eV]=el(e.substr(0,r)),t[eq]=el(e.substr(r,2)),t[eZ]=el(e.substr(i))});var tV=/[ap]\.?m?\.?/i,tq=ef("Hours",!0);function tZ(e,t,n){return e>11?n?"pm":"PM":n?"am":"AM"}var tX,tJ,tQ={calendar:D,longDateFormat:G,invalidDate:K,ordinal:q,dayOfMonthOrdinalParse:Z,relativeTime:J,months:e2,monthsShort:e3,week:tg,weekdays:tx,weekdaysMin:tM,weekdaysShort:tT,meridiemParse:tV},t1={},t0={};function t2(e,t){var n,r=Math.min(e.length,t.length);for(n=0;n0;){if(r=t6(i.slice(0,t).join("-")))return r;if(n&&n.length>=t&&t2(i,n)>=t-1)break;t--}a++}return tJ}function t6(t){var r,i=null;if(void 0===t1[t]&&e&&e.exports)try{i=tJ._abbr,r=void 0,n(46700)("./"+t),t5(i)}catch(a){t1[t]=null}return t1[t]}function t5(e,t){var n;return e&&((n=u(t)?t7(e):t8(e,t))?tJ=n:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),tJ._abbr}function t8(e,t){if(null===t)return delete t1[e],null;var n,r=tQ;if(t.abbr=e,null!=t1[e])O("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),r=t1[e]._config;else if(null!=t.parentLocale){if(null!=t1[t.parentLocale])r=t1[t.parentLocale]._config;else{if(null==(n=t6(t.parentLocale)))return t0[t.parentLocale]||(t0[t.parentLocale]=[]),t0[t.parentLocale].push({name:e,config:t}),null;r=n._config}}return t1[e]=new I(C(r,t)),t0[e]&&t0[e].forEach(function(e){t8(e.name,e.config)}),t5(e),t1[e]}function t9(e,t){if(null!=t){var n,r,i=tQ;null!=t1[e]&&null!=t1[e].parentLocale?t1[e].set(C(t1[e]._config,t)):(null!=(r=t6(e))&&(i=r._config),t=C(i,t),null==r&&(t.abbr=e),(n=new I(t)).parentLocale=t1[e],t1[e]=n),t5(e)}else null!=t1[e]&&(null!=t1[e].parentLocale?(t1[e]=t1[e].parentLocale,e===t5()&&t5(e)):null!=t1[e]&&delete t1[e]);return t1[e]}function t7(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return tJ;if(!i(e)){if(t=t6(e))return t;e=[e]}return t4(e)}function ne(){return ev(t1)}function nt(e){var t,n=e._a;return n&&-2===b(e).overflow&&(t=n[eW]<0||n[eW]>11?eW:n[eK]<1||n[eK]>e0(n[eG],n[eW])?eK:n[eV]<0||n[eV]>24||24===n[eV]&&(0!==n[eq]||0!==n[eZ]||0!==n[eX])?eV:n[eq]<0||n[eq]>59?eq:n[eZ]<0||n[eZ]>59?eZ:n[eX]<0||n[eX]>999?eX:-1,b(e)._overflowDayOfYear&&(teK)&&(t=eK),b(e)._overflowWeeks&&-1===t&&(t=eJ),b(e)._overflowWeekday&&-1===t&&(t=eQ),b(e).overflow=t),e}var nn=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,nr=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,ni=/Z|[+-]\d\d(?::?\d\d)?/,na=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1],],no=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/],],ns=/^\/?Date\((-?\d+)/i,nu=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,nc={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function nl(e){var t,n,r,i,a,o,s=e._i,u=nn.exec(s)||nr.exec(s);if(u){for(t=0,b(e).iso=!0,n=na.length;tts(a)||0===e._dayOfYear)&&(b(e)._overflowDayOfYear=!0),n=tf(a,0,e._dayOfYear),e._a[eW]=n.getUTCMonth(),e._a[eK]=n.getUTCDate()),t=0;t<3&&null==e._a[t];++t)e._a[t]=o[t]=r[t];for(;t<7;t++)e._a[t]=o[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[eV]&&0===e._a[eq]&&0===e._a[eZ]&&0===e._a[eX]&&(e._nextDay=!0,e._a[eV]=0),e._d=(e._useUTC?tf:tl).apply(null,o),i=e._useUTC?e._d.getUTCDay():e._d.getDay(),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[eV]=24),e._w&&void 0!==e._w.d&&e._w.d!==i&&(b(e).weekdayMismatch=!0)}}function n_(e){var t,n,r,i,a,o,s,u,c;null!=(t=e._w).GG||null!=t.W||null!=t.E?(a=1,o=4,n=nv(t.GG,e._a[eG],tp(nL(),1,4).year),r=nv(t.W,1),((i=nv(t.E,1))<1||i>7)&&(u=!0)):(a=e._locale._week.dow,o=e._locale._week.doy,c=tp(nL(),a,o),n=nv(t.gg,e._a[eG],c.year),r=nv(t.w,c.week),null!=t.d?((i=t.d)<0||i>6)&&(u=!0):null!=t.e?(i=t.e+a,(t.e<0||t.e>6)&&(u=!0)):i=a),r<1||r>tb(n,a,o)?b(e)._overflowWeeks=!0:null!=u?b(e)._overflowWeekday=!0:(s=th(n,r,i,a,o),e._a[eG]=s.year,e._dayOfYear=s.dayOfYear)}function nE(e){if(e._f===t.ISO_8601){nl(e);return}if(e._f===t.RFC_2822){nm(e);return}e._a=[],b(e).empty=!0;var n,r,i,a,o,s,u=""+e._i,c=u.length,l=0;for(n=0,i=z(e._f,e._locale).match(R)||[];n0&&b(e).unusedInput.push(o),u=u.slice(u.indexOf(r)+r.length),l+=r.length),Y[a]?(r?b(e).empty=!1:b(e).unusedTokens.push(a),ez(a,r,e)):e._strict&&!r&&b(e).unusedTokens.push(a);b(e).charsLeftOver=c-l,u.length>0&&b(e).unusedInput.push(u),e._a[eV]<=12&&!0===b(e).bigHour&&e._a[eV]>0&&(b(e).bigHour=void 0),b(e).parsedDateParts=e._a.slice(0),b(e).meridiem=e._meridiem,e._a[eV]=nS(e._locale,e._a[eV],e._meridiem),null!==(s=b(e).era)&&(e._a[eG]=e._locale.erasConvertYear(s,e._a[eG])),nw(e),nt(e)}function nS(e,t,n){var r;return null==n?t:null!=e.meridiemHour?e.meridiemHour(t,n):(null!=e.isPM&&((r=e.isPM(n))&&t<12&&(t+=12),r||12!==t||(t=0)),t)}function nk(e){var t,n,r,i,a,o,s=!1;if(0===e._f.length){b(e).invalidFormat=!0,e._d=new Date(NaN);return}for(i=0;ithis?this:e:g()});function nD(e,t){var n,r;if(1===t.length&&i(t[0])&&(t=t[0]),!t.length)return nL();for(r=1,n=t[0];rMath.abs(e)&&!r&&(e*=60);return!this._isUTC&&n&&(i=nq(this)),this._offset=e,this._isUTC=!0,null!=i&&this.add(i,"m"),a===e||(!n||this._changeInProgress?ri(this,n7(e-a,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,t.updateOffset(this,!0),this._changeInProgress=null)),this}function nX(e,t){return null!=e?("string"!=typeof e&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}function nJ(e){return this.utcOffset(0,e)}function nQ(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(nq(this),"m")),this}function n1(){if(null!=this._tzm)this.utcOffset(this._tzm,!1,!0);else if("string"==typeof this._i){var e=nK(eD,this._i);null!=e?this.utcOffset(e):this.utcOffset(0,!0)}return this}function n0(e){return!!this.isValid()&&(e=e?nL(e).utcOffset():0,(this.utcOffset()-e)%60==0)}function n2(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function n3(){if(!u(this._isDSTShifted))return this._isDSTShifted;var e,t={};return E(t,this),(t=nM(t))._a?(e=t._isUTC?h(t._a):nL(t._a),this._isDSTShifted=this.isValid()&&nz(t._a,e.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function n4(){return!!this.isValid()&&!this._isUTC}function n6(){return!!this.isValid()&&this._isUTC}function n5(){return!!this.isValid()&&this._isUTC&&0===this._offset}t.updateOffset=function(){};var n8=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,n9=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function n7(e,t){var n,r,i,a=e,s=null;return nH(e)?a={ms:e._milliseconds,d:e._days,M:e._months}:c(e)||!isNaN(+e)?(a={},t?a[t]=+e:a.milliseconds=+e):(s=n8.exec(e))?(n="-"===s[1]?-1:1,a={y:0,d:el(s[eK])*n,h:el(s[eV])*n,m:el(s[eq])*n,s:el(s[eZ])*n,ms:el(n$(1e3*s[eX]))*n}):(s=n9.exec(e))?(n="-"===s[1]?-1:1,a={y:re(s[2],n),M:re(s[3],n),w:re(s[4],n),d:re(s[5],n),h:re(s[6],n),m:re(s[7],n),s:re(s[8],n)}):null==a?a={}:"object"==typeof a&&("from"in a||"to"in a)&&(i=rn(nL(a.from),nL(a.to)),(a={}).ms=i.milliseconds,a.M=i.months),r=new nU(a),nH(e)&&o(e,"_locale")&&(r._locale=e._locale),nH(e)&&o(e,"_isValid")&&(r._isValid=e._isValid),r}function re(e,t){var n=e&&parseFloat(e.replace(",","."));return(isNaN(n)?0:n)*t}function rt(e,t){var n={};return n.months=t.month()-e.month()+(t.year()-e.year())*12,e.clone().add(n.months,"M").isAfter(t)&&--n.months,n.milliseconds=+t-+e.clone().add(n.months,"M"),n}function rn(e,t){var n;return e.isValid()&&t.isValid()?(t=nV(t,e),e.isBefore(t)?n=rt(e,t):((n=rt(t,e)).milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function rr(e,t){return function(n,r){var i,a;return null===r||isNaN(+r)||(O(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),a=n,n=r,r=a),i=n7(n,r),ri(this,i,e),this}}function ri(e,n,r,i){var a=n._milliseconds,o=n$(n._days),s=n$(n._months);e.isValid()&&(i=null==i||i,s&&tt(e,ed(e,"Month")+s*r),o&&eh(e,"Date",ed(e,"Date")+o*r),a&&e._d.setTime(e._d.valueOf()+a*r),i&&t.updateOffset(e,o||s))}n7.fn=nU.prototype,n7.invalid=nB;var ra=rr(1,"add"),ro=rr(-1,"subtract");function rs(e){return"string"==typeof e||e instanceof String}function ru(e){return k(e)||l(e)||rs(e)||c(e)||rl(e)||rc(e)||null==e}function rc(e){var t,n,r=a(e)&&!s(e),i=!1,u=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms",];for(t=0;tn.valueOf():n.valueOf()n.year()||n.year()>9999?$(n,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):A(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+6e4*this.utcOffset()).toISOString().replace("Z",$(n,"Z")):$(n,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function rx(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e,t,n,r,i="moment",a="";return this.isLocal()||(i=0===this.utcOffset()?"moment.utc":"moment.parseZone",a="Z"),e="["+i+'("]',t=0<=this.year()&&9999>=this.year()?"YYYY":"YYYYYY",n="-MM-DD[T]HH:mm:ss.SSS",r=a+'[")]',this.format(e+t+n+r)}function rT(e){e||(e=this.isUtc()?t.defaultFormatUtc:t.defaultFormat);var n=$(this,e);return this.localeData().postformat(n)}function rM(e,t){return this.isValid()&&(k(e)&&e.isValid()||nL(e).isValid())?n7({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function rO(e){return this.from(nL(),e)}function rA(e,t){return this.isValid()&&(k(e)&&e.isValid()||nL(e).isValid())?n7({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function rL(e){return this.to(nL(),e)}function rC(e){var t;return void 0===e?this._locale._abbr:(null!=(t=t7(e))&&(this._locale=t),this)}t.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",t.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var rI=T("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){return void 0===e?this.localeData():this.locale(e)});function rD(){return this._locale}var rN=1e3,rP=60*rN,rR=60*rP,rj=3506328*rR;function rF(e,t){return(e%t+t)%t}function rY(e,t,n){return e<100&&e>=0?new Date(e+400,t,n)-rj:new Date(e,t,n).valueOf()}function rB(e,t,n){return e<100&&e>=0?Date.UTC(e+400,t,n)-rj:Date.UTC(e,t,n)}function rU(e){var n,r;if(void 0===(e=er(e))||"millisecond"===e||!this.isValid())return this;switch(r=this._isUTC?rB:rY,e){case"year":n=r(this.year(),0,1);break;case"quarter":n=r(this.year(),this.month()-this.month()%3,1);break;case"month":n=r(this.year(),this.month(),1);break;case"week":n=r(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":n=r(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":n=r(this.year(),this.month(),this.date());break;case"hour":n=this._d.valueOf(),n-=rF(n+(this._isUTC?0:this.utcOffset()*rP),rR);break;case"minute":n=this._d.valueOf(),n-=rF(n,rP);break;case"second":n=this._d.valueOf(),n-=rF(n,rN)}return this._d.setTime(n),t.updateOffset(this,!0),this}function rH(e){var n,r;if(void 0===(e=er(e))||"millisecond"===e||!this.isValid())return this;switch(r=this._isUTC?rB:rY,e){case"year":n=r(this.year()+1,0,1)-1;break;case"quarter":n=r(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":n=r(this.year(),this.month()+1,1)-1;break;case"week":n=r(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":n=r(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":n=r(this.year(),this.month(),this.date()+1)-1;break;case"hour":n=this._d.valueOf(),n+=rR-rF(n+(this._isUTC?0:this.utcOffset()*rP),rR)-1;break;case"minute":n=this._d.valueOf(),n+=rP-rF(n,rP)-1;break;case"second":n=this._d.valueOf(),n+=rN-rF(n,rN)-1}return this._d.setTime(n),t.updateOffset(this,!0),this}function r$(){return this._d.valueOf()-6e4*(this._offset||0)}function rz(){return Math.floor(this.valueOf()/1e3)}function rG(){return new Date(this.valueOf())}function rW(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond(),]}function rK(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}}function rV(){return this.isValid()?this.toISOString():null}function rq(){return m(this)}function rZ(){return d({},b(this))}function rX(){return b(this).overflow}function rJ(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}function rQ(e,n){var r,i,a,o=this._eras||t7("en")._eras;for(r=0,i=o.length;r=0)return u[r]}function r0(e,n){var r=e.since<=e.until?1:-1;return void 0===n?t(e.since).year():t(e.since).year()+(n-e.offset)*r}function r2(){var e,t,n,r=this.localeData().eras();for(e=0,t=r.length;ea&&(t=a),ip.call(this,e,t,n,r,i))}function ip(e,t,n,r,i){var a=th(e,t,n,r,i),o=tf(a.year,0,a.dayOfYear);return this.year(o.getUTCFullYear()),this.month(o.getUTCMonth()),this.date(o.getUTCDate()),this}function ib(e){return null==e?Math.ceil((this.month()+1)/3):this.month((e-1)*3+this.month()%3)}B("N",0,0,"eraAbbr"),B("NN",0,0,"eraAbbr"),B("NNN",0,0,"eraAbbr"),B("NNNN",0,0,"eraName"),B("NNNNN",0,0,"eraNarrow"),B("y",["y",1],"yo","eraYear"),B("y",["yy",2],0,"eraYear"),B("y",["yyy",3],0,"eraYear"),B("y",["yyyy",4],0,"eraYear"),ej("N",r7),ej("NN",r7),ej("NNN",r7),ej("NNNN",ie),ej("NNNNN",it),eH(["N","NN","NNN","NNNN","NNNNN"],function(e,t,n,r){var i=n._locale.erasParse(e,r,n._strict);i?b(n).era=i:b(n).invalidEra=e}),ej("y",eC),ej("yy",eC),ej("yyy",eC),ej("yyyy",eC),ej("yo",ir),eH(["y","yy","yyy","yyyy"],eG),eH(["yo"],function(e,t,n,r){var i;n._locale._eraYearOrdinalRegex&&(i=e.match(n._locale._eraYearOrdinalRegex)),n._locale.eraYearOrdinalParse?t[eG]=n._locale.eraYearOrdinalParse(e,i):t[eG]=parseInt(e,10)}),B(0,["gg",2],0,function(){return this.weekYear()%100}),B(0,["GG",2],0,function(){return this.isoWeekYear()%100}),ia("gggg","weekYear"),ia("ggggg","weekYear"),ia("GGGG","isoWeekYear"),ia("GGGGG","isoWeekYear"),en("weekYear","gg"),en("isoWeekYear","GG"),eo("weekYear",1),eo("isoWeekYear",1),ej("G",eI),ej("g",eI),ej("GG",ex,e_),ej("gg",ex,e_),ej("GGGG",eA,eS),ej("gggg",eA,eS),ej("GGGGG",eL,ek),ej("ggggg",eL,ek),e$(["gggg","ggggg","GGGG","GGGGG"],function(e,t,n,r){t[r.substr(0,2)]=el(e)}),e$(["gg","GG"],function(e,n,r,i){n[i]=t.parseTwoDigitYear(e)}),B("Q",0,"Qo","quarter"),en("quarter","Q"),eo("quarter",7),ej("Q",ew),eH("Q",function(e,t){t[eW]=(el(e)-1)*3}),B("D",["DD",2],"Do","date"),en("date","D"),eo("date",9),ej("D",ex),ej("DD",ex,e_),ej("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient}),eH(["D","DD"],eK),eH("Do",function(e,t){t[eK]=el(e.match(ex)[0])});var im=ef("Date",!0);function ig(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==e?t:this.add(e-t,"d")}B("DDD",["DDDD",3],"DDDo","dayOfYear"),en("dayOfYear","DDD"),eo("dayOfYear",4),ej("DDD",eO),ej("DDDD",eE),eH(["DDD","DDDD"],function(e,t,n){n._dayOfYear=el(e)}),B("m",["mm",2],0,"minute"),en("minute","m"),eo("minute",14),ej("m",ex),ej("mm",ex,e_),eH(["m","mm"],eq);var iv=ef("Minutes",!1);B("s",["ss",2],0,"second"),en("second","s"),eo("second",15),ej("s",ex),ej("ss",ex,e_),eH(["s","ss"],eZ);var iy=ef("Seconds",!1);for(B("S",0,0,function(){return~~(this.millisecond()/100)}),B(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),B(0,["SSS",3],0,"millisecond"),B(0,["SSSS",4],0,function(){return 10*this.millisecond()}),B(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),B(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),B(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),B(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),B(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),en("millisecond","ms"),eo("millisecond",16),ej("S",eO,ew),ej("SS",eO,e_),ej("SSS",eO,eE),v="SSSS";v.length<=9;v+="S")ej(v,eC);function iw(e,t){t[eX]=el(("0."+e)*1e3)}for(v="S";v.length<=9;v+="S")eH(v,iw);function i_(){return this._isUTC?"UTC":""}function iE(){return this._isUTC?"Coordinated Universal Time":""}y=ef("Milliseconds",!1),B("z",0,0,"zoneAbbr"),B("zz",0,0,"zoneName");var iS=S.prototype;function ik(e){return nL(1e3*e)}function ix(){return nL.apply(null,arguments).parseZone()}function iT(e){return e}iS.add=ra,iS.calendar=rh,iS.clone=rp,iS.diff=r_,iS.endOf=rH,iS.format=rT,iS.from=rM,iS.fromNow=rO,iS.to=rA,iS.toNow=rL,iS.get=ep,iS.invalidAt=rX,iS.isAfter=rb,iS.isBefore=rm,iS.isBetween=rg,iS.isSame=rv,iS.isSameOrAfter=ry,iS.isSameOrBefore=rw,iS.isValid=rq,iS.lang=rI,iS.locale=rC,iS.localeData=rD,iS.max=nI,iS.min=nC,iS.parsingFlags=rZ,iS.set=eb,iS.startOf=rU,iS.subtract=ro,iS.toArray=rW,iS.toObject=rK,iS.toDate=rG,iS.toISOString=rk,iS.inspect=rx,"undefined"!=typeof Symbol&&null!=Symbol.for&&(iS[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),iS.toJSON=rV,iS.toString=rS,iS.unix=rz,iS.valueOf=r$,iS.creationData=rJ,iS.eraName=r2,iS.eraNarrow=r3,iS.eraAbbr=r4,iS.eraYear=r6,iS.year=tu,iS.isLeapYear=tc,iS.weekYear=io,iS.isoWeekYear=is,iS.quarter=iS.quarters=ib,iS.month=tn,iS.daysInMonth=tr,iS.week=iS.weeks=tw,iS.isoWeek=iS.isoWeeks=t_,iS.weeksInYear=il,iS.weeksInWeekYear=id,iS.isoWeeksInYear=iu,iS.isoWeeksInISOWeekYear=ic,iS.date=im,iS.day=iS.days=tR,iS.weekday=tj,iS.isoWeekday=tF,iS.dayOfYear=ig,iS.hour=iS.hours=tq,iS.minute=iS.minutes=iv,iS.second=iS.seconds=iy,iS.millisecond=iS.milliseconds=y,iS.utcOffset=nZ,iS.utc=nJ,iS.local=nQ,iS.parseZone=n1,iS.hasAlignedHourOffset=n0,iS.isDST=n2,iS.isLocal=n4,iS.isUtcOffset=n6,iS.isUtc=n5,iS.isUTC=n5,iS.zoneAbbr=i_,iS.zoneName=iE,iS.dates=T("dates accessor is deprecated. Use date instead.",im),iS.months=T("months accessor is deprecated. Use month instead",tn),iS.years=T("years accessor is deprecated. Use year instead",tu),iS.zone=T("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",nX),iS.isDSTShifted=T("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",n3);var iM=I.prototype;function iO(e,t,n,r){var i=t7(),a=h().set(r,t);return i[n](a,e)}function iA(e,t,n){if(c(e)&&(t=e,e=void 0),e=e||"",null!=t)return iO(e,t,n,"month");var r,i=[];for(r=0;r<12;r++)i[r]=iO(e,r,n,"month");return i}function iL(e,t,n,r){"boolean"==typeof e?(c(t)&&(n=t,t=void 0),t=t||""):(n=t=e,e=!1,c(t)&&(n=t,t=void 0),t=t||"");var i,a=t7(),o=e?a._week.dow:0,s=[];if(null!=n)return iO(t,(n+o)%7,r,"day");for(i=0;i<7;i++)s[i]=iO(t,(i+o)%7,r,"day");return s}function iC(e,t){return iA(e,t,"months")}function iI(e,t){return iA(e,t,"monthsShort")}function iD(e,t,n){return iL(e,t,n,"weekdays")}function iN(e,t,n){return iL(e,t,n,"weekdaysShort")}function iP(e,t,n){return iL(e,t,n,"weekdaysMin")}iM.calendar=N,iM.longDateFormat=W,iM.invalidDate=V,iM.ordinal=X,iM.preparse=iT,iM.postformat=iT,iM.relativeTime=Q,iM.pastFuture=ee,iM.set=L,iM.eras=rQ,iM.erasParse=r1,iM.erasConvertYear=r0,iM.erasAbbrRegex=r8,iM.erasNameRegex=r5,iM.erasNarrowRegex=r9,iM.months=e8,iM.monthsShort=e9,iM.monthsParse=te,iM.monthsRegex=ta,iM.monthsShortRegex=ti,iM.week=tm,iM.firstDayOfYear=ty,iM.firstDayOfWeek=tv,iM.weekdays=tC,iM.weekdaysMin=tD,iM.weekdaysShort=tI,iM.weekdaysParse=tP,iM.weekdaysRegex=tY,iM.weekdaysShortRegex=tB,iM.weekdaysMinRegex=tU,iM.isPM=tK,iM.meridiem=tZ,t5("en",{eras:[{since:"0001-01-01",until:Infinity,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"},],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10,n=1===el(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th";return e+n}}),t.lang=T("moment.lang is deprecated. Use moment.locale instead.",t5),t.langData=T("moment.langData is deprecated. Use moment.localeData instead.",t7);var iR=Math.abs;function ij(){var e=this._data;return this._milliseconds=iR(this._milliseconds),this._days=iR(this._days),this._months=iR(this._months),e.milliseconds=iR(e.milliseconds),e.seconds=iR(e.seconds),e.minutes=iR(e.minutes),e.hours=iR(e.hours),e.months=iR(e.months),e.years=iR(e.years),this}function iF(e,t,n,r){var i=n7(t,n);return e._milliseconds+=r*i._milliseconds,e._days+=r*i._days,e._months+=r*i._months,e._bubble()}function iY(e,t){return iF(this,e,t,1)}function iB(e,t){return iF(this,e,t,-1)}function iU(e){return e<0?Math.floor(e):Math.ceil(e)}function iH(){var e,t,n,r,i,a=this._milliseconds,o=this._days,s=this._months,u=this._data;return a>=0&&o>=0&&s>=0||a<=0&&o<=0&&s<=0||(a+=864e5*iU(iz(s)+o),o=0,s=0),u.milliseconds=a%1e3,e=ec(a/1e3),u.seconds=e%60,t=ec(e/60),u.minutes=t%60,n=ec(t/60),u.hours=n%24,o+=ec(n/24),s+=i=ec(i$(o)),o-=iU(iz(i)),r=ec(s/12),s%=12,u.days=o,u.months=s,u.years=r,this}function i$(e){return 4800*e/146097}function iz(e){return 146097*e/4800}function iG(e){if(!this.isValid())return NaN;var t,n,r=this._milliseconds;if("month"===(e=er(e))||"quarter"===e||"year"===e)switch(t=this._days+r/864e5,n=this._months+i$(t),e){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(t=this._days+Math.round(iz(this._months)),e){case"week":return t/7+r/6048e5;case"day":return t+r/864e5;case"hour":return 24*t+r/36e5;case"minute":return 1440*t+r/6e4;case"second":return 86400*t+r/1e3;case"millisecond":return Math.floor(864e5*t)+r;default:throw Error("Unknown unit "+e)}}function iW(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*el(this._months/12):NaN}function iK(e){return function(){return this.as(e)}}var iV=iK("ms"),iq=iK("s"),iZ=iK("m"),iX=iK("h"),iJ=iK("d"),iQ=iK("w"),i1=iK("M"),i0=iK("Q"),i2=iK("y");function i3(){return n7(this)}function i4(e){return e=er(e),this.isValid()?this[e+"s"]():NaN}function i6(e){return function(){return this.isValid()?this._data[e]:NaN}}var i5=i6("milliseconds"),i8=i6("seconds"),i9=i6("minutes"),i7=i6("hours"),ae=i6("days"),at=i6("months"),an=i6("years");function ar(){return ec(this.days()/7)}var ai=Math.round,aa={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function ao(e,t,n,r,i){return i.relativeTime(t||1,!!n,e,r)}function as(e,t,n,r){var i=n7(e).abs(),a=ai(i.as("s")),o=ai(i.as("m")),s=ai(i.as("h")),u=ai(i.as("d")),c=ai(i.as("M")),l=ai(i.as("w")),f=ai(i.as("y")),d=a<=n.ss&&["s",a]||a0,d[4]=r,ao.apply(null,d)}function au(e){return void 0===e?ai:"function"==typeof e&&(ai=e,!0)}function ac(e,t){return void 0!==aa[e]&&(void 0===t?aa[e]:(aa[e]=t,"s"===e&&(aa.ss=t-1),!0))}function al(e,t){if(!this.isValid())return this.localeData().invalidDate();var n,r,i=!1,a=aa;return"object"==typeof e&&(t=e,e=!1),"boolean"==typeof e&&(i=e),"object"==typeof t&&(a=Object.assign({},aa,t),null!=t.s&&null==t.ss&&(a.ss=t.s-1)),r=as(this,!i,a,n=this.localeData()),i&&(r=n.pastFuture(+this,r)),n.postformat(r)}var af=Math.abs;function ad(e){return(e>0)-(e<0)||+e}function ah(){if(!this.isValid())return this.localeData().invalidDate();var e,t,n,r,i,a,o,s,u=af(this._milliseconds)/1e3,c=af(this._days),l=af(this._months),f=this.asSeconds();return f?(e=ec(u/60),t=ec(e/60),u%=60,e%=60,n=ec(l/12),l%=12,r=u?u.toFixed(3).replace(/\.?0+$/,""):"",i=f<0?"-":"",a=ad(this._months)!==ad(f)?"-":"",o=ad(this._days)!==ad(f)?"-":"",s=ad(this._milliseconds)!==ad(f)?"-":"",i+"P"+(n?a+n+"Y":"")+(l?a+l+"M":"")+(c?o+c+"D":"")+(t||e||u?"T":"")+(t?s+t+"H":"")+(e?s+e+"M":"")+(u?s+r+"S":"")):"P0D"}var ap=nU.prototype;return ap.isValid=nY,ap.abs=ij,ap.add=iY,ap.subtract=iB,ap.as=iG,ap.asMilliseconds=iV,ap.asSeconds=iq,ap.asMinutes=iZ,ap.asHours=iX,ap.asDays=iJ,ap.asWeeks=iQ,ap.asMonths=i1,ap.asQuarters=i0,ap.asYears=i2,ap.valueOf=iW,ap._bubble=iH,ap.clone=i3,ap.get=i4,ap.milliseconds=i5,ap.seconds=i8,ap.minutes=i9,ap.hours=i7,ap.days=ae,ap.weeks=ar,ap.months=at,ap.years=an,ap.humanize=al,ap.toISOString=ah,ap.toString=ah,ap.toJSON=ah,ap.locale=rC,ap.localeData=rD,ap.toIsoString=T("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",ah),ap.lang=rI,B("X",0,0,"unix"),B("x",0,0,"valueOf"),ej("x",eI),ej("X",eP),eH("X",function(e,t,n){n._d=new Date(1e3*parseFloat(e))}),eH("x",function(e,t,n){n._d=new Date(el(e))}),//! moment.js +t.version="2.29.1",r(nL),t.fn=iS,t.min=nN,t.max=nP,t.now=nR,t.utc=h,t.unix=ik,t.months=iC,t.isDate=l,t.locale=t5,t.invalid=g,t.duration=n7,t.isMoment=k,t.weekdays=iD,t.parseZone=ix,t.localeData=t7,t.isDuration=nH,t.monthsShort=iI,t.weekdaysMin=iP,t.defineLocale=t8,t.updateLocale=t9,t.locales=ne,t.weekdaysShort=iN,t.normalizeUnits=er,t.relativeTimeRounding=au,t.relativeTimeThreshold=ac,t.calendarFormat=rd,t.prototype=iS,t.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},t},e.exports=i()},46417(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,r=!!("undefined"!=typeof window&&window.document&&window.document.createElement);function i(e){n=e}function a(){if(n)return n;if(!r||!window.document.body)return"indeterminate";var e=window.document.createElement("div");return e.appendChild(document.createTextNode("ABCD")),e.dir="rtl",e.style.fontSize="14px",e.style.width="4px",e.style.height="1px",e.style.position="absolute",e.style.top="-1000px",e.style.overflow="scroll",document.body.appendChild(e),n="reverse",e.scrollLeft>0?n="default":(e.scrollLeft=1,0===e.scrollLeft&&(n="negative")),document.body.removeChild(e),n}function o(e,t){var n=e.scrollLeft;if("rtl"!==t)return n;var r=a();if("indeterminate"===r)return Number.NaN;switch(r){case"negative":return e.scrollWidth-e.clientWidth+n;case"reverse":return e.scrollWidth-e.clientWidth-n}return n}function s(e,t,n){if("rtl"!==n){e.scrollLeft=t;return}var r=a();if("indeterminate"!==r)switch(r){case"negative":e.scrollLeft=e.clientWidth-e.scrollWidth+t;break;case"reverse":e.scrollLeft=e.scrollWidth-e.clientWidth-t;break;default:e.scrollLeft=t}}t._setScrollType=i,t.detectScrollType=a,t.getNormalizedScrollLeft=o,t.setNormalizedScrollLeft=s},27418(e){"use strict";/* +object-assign +(c) Sindre Sorhus +@license MIT +*/ var t=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;function i(e){if(null==e)throw TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function a(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;var r=Object.getOwnPropertyNames(t).map(function(e){return t[e]});if("0123456789"!==r.join(""))return!1;var i={};if("abcdefghijklmnopqrst".split("").forEach(function(e){i[e]=e}),"abcdefghijklmnopqrst"!==Object.keys(Object.assign({},i)).join(""))return!1;return!0}catch(a){return!1}}e.exports=a()?Object.assign:function(e,a){for(var o,s,u=i(e),c=1;c65535&&(Y-=65536,G+=l(Y>>>10|55296),Y=56320|1023&Y),Y=G+l(Y))):q!==x&&$(D,Q)),Y?(ew(),X=ev(),ed=ee-1,ep+=ee-V+1,eg.push(Y),J=ev(),J.offset++,ei&&ei.call(es,Y,{start:X,end:J},e.slice(V-1,ee)),X=J):(em+=d=e.slice(V-1,ee),ep+=d.length,ed=ee-1)}else 10===F&&(eb++,eh++,ep=0),F==F?(em+=l(F),ep++):ew();return eg.join("");function ev(){return{line:eb,column:ep,offset:ed+(ec.offset||0)}}function ey(e,t){var n=ev();n.column+=t,n.offset+=t,ea.call(eu,j[e],n,e)}function ew(){em&&(eg.push(em),er&&er.call(eo,em,{start:X,end:ev()}),em="")}}function B(e){return e>=55296&&e<=57343||e>1114111}function U(e){return e>=1&&e<=8||11===e||e>=13&&e<=31||e>=127&&e<=159||e>=64976&&e<=65007||(65535&e)==65535||(65535&e)==65534}j[L]="Named character references must be terminated by a semicolon",j[C]="Numeric character references must be terminated by a semicolon",j[I]="Named character references cannot be empty",j[D]="Numeric character references cannot be empty",j[N]="Named character references must be known",j[P]="Numeric character references cannot be disallowed",j[R]="Numeric character references cannot be outside the permissible Unicode range"},14779(e){e.exports=b,e.exports.match=a,e.exports.regexpToFunction=o,e.exports.parse=r,e.exports.compile=i,e.exports.tokensToFunction=s,e.exports.tokensToRegExp=p;var t="/",n=RegExp("(\\\\.)|(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?","g");function r(e,r){for(var i,a=[],o=0,s=0,l="",f=r&&r.delimiter||t,d=r&&r.whitelist||void 0,h=!1;null!==(i=n.exec(e));){var p=i[0],b=i[1],m=i.index;if(l+=e.slice(s,m),s=m+p.length,b){l+=b[1],h=!0;continue}var g="",v=i[2],y=i[3],w=i[4],_=i[5];if(!h&&l.length){var E=l.length-1,S=l[E];(!d||d.indexOf(S)>-1)&&(g=S,l=l.slice(0,E))}l&&(a.push(l),l="",h=!1);var k="+"===_||"*"===_,x="?"===_||"*"===_,T=y||w,M=g||f;a.push({name:v||o++,prefix:g,delimiter:M,optional:x,repeat:k,pattern:T?c(T):"[^"+u(M===f?M:M+f)+"]+?"})}return(l||seM});/**! + * @fileOverview Kickass library to create and place poppers near their reference elements. + * @version 1.16.0 + * @license + * Copyright (c) 2016 Federico Zivolo and contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ var r="undefined"!=typeof window&&"undefined"!=typeof document&&"undefined"!=typeof navigator,i=function(){for(var e=["Edge","Trident","Firefox"],t=0;t=0)return 1;return 0}();function a(e){var t=!1;return function(){!t&&(t=!0,window.Promise.resolve().then(function(){t=!1,e()}))}}function o(e){var t=!1;return function(){t||(t=!0,setTimeout(function(){t=!1,e()},i))}}var s=r&&window.Promise?a:o;function u(e){var t={};return e&&"[object Function]"===t.toString.call(e)}function c(e,t){if(1!==e.nodeType)return[];var n=e.ownerDocument.defaultView.getComputedStyle(e,null);return t?n[t]:n}function l(e){return"HTML"===e.nodeName?e:e.parentNode||e.host}function f(e){if(!e)return document.body;switch(e.nodeName){case"HTML":case"BODY":return e.ownerDocument.body;case"#document":return e.body}var t=c(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/(auto|scroll|overlay)/.test(n+i+r)?e:f(l(e))}function d(e){return e&&e.referenceNode?e.referenceNode:e}var h=r&&!!(window.MSInputMethodContext&&document.documentMode),p=r&&/MSIE 10/.test(navigator.userAgent);function b(e){return 11===e?h:10===e?p:h||p}function m(e){if(!e)return document.documentElement;for(var t=b(10)?document.body:null,n=e.offsetParent||null;n===t&&e.nextElementSibling;)n=(e=e.nextElementSibling).offsetParent;var r=n&&n.nodeName;return r&&"BODY"!==r&&"HTML"!==r?-1!==["TH","TD","TABLE"].indexOf(n.nodeName)&&"static"===c(n,"position")?m(n):n:e?e.ownerDocument.documentElement:document.documentElement}function g(e){var t=e.nodeName;return"BODY"!==t&&("HTML"===t||m(e.firstElementChild)===e)}function v(e){return null!==e.parentNode?v(e.parentNode):e}function y(e,t){if(!e||!e.nodeType||!t||!t.nodeType)return document.documentElement;var n=e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING,r=n?e:t,i=n?t:e,a=document.createRange();a.setStart(r,0),a.setEnd(i,0);var o=a.commonAncestorContainer;if(e!==o&&t!==o||r.contains(i))return g(o)?o:m(o);var s=v(e);return s.host?y(s.host,t):y(e,v(t).host)}function w(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"top",n="top"===t?"scrollTop":"scrollLeft",r=e.nodeName;if("BODY"===r||"HTML"===r){var i=e.ownerDocument.documentElement;return(e.ownerDocument.scrollingElement||i)[n]}return e[n]}function _(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=w(t,"top"),i=w(t,"left"),a=n?-1:1;return e.top+=r*a,e.bottom+=r*a,e.left+=i*a,e.right+=i*a,e}function E(e,t){var n="x"===t?"Left":"Top",r="Left"===n?"Right":"Bottom";return parseFloat(e["border"+n+"Width"],10)+parseFloat(e["border"+r+"Width"],10)}function S(e,t,n,r){return Math.max(t["offset"+e],t["scroll"+e],n["client"+e],n["offset"+e],n["scroll"+e],b(10)?parseInt(n["offset"+e])+parseInt(r["margin"+("Height"===e?"Top":"Left")])+parseInt(r["margin"+("Height"===e?"Bottom":"Right")]):0)}function k(e){var t=e.body,n=e.documentElement,r=b(10)&&getComputedStyle(n);return{height:S("Height",t,n,r),width:S("Width",t,n,r)}}var x=function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")},T=function(){function e(e,t){for(var n=0;n2&&void 0!==arguments[2]&&arguments[2],r=b(10),i="HTML"===t.nodeName,a=L(e),o=L(t),s=f(e),u=c(t),l=parseFloat(u.borderTopWidth,10),d=parseFloat(u.borderLeftWidth,10);n&&i&&(o.top=Math.max(o.top,0),o.left=Math.max(o.left,0));var h=A({top:a.top-o.top-l,left:a.left-o.left-d,width:a.width,height:a.height});if(h.marginTop=0,h.marginLeft=0,!r&&i){var p=parseFloat(u.marginTop,10),m=parseFloat(u.marginLeft,10);h.top-=l-p,h.bottom-=l-p,h.left-=d-m,h.right-=d-m,h.marginTop=p,h.marginLeft=m}return(r&&!n?t.contains(s):t===s&&"BODY"!==s.nodeName)&&(h=_(h,t)),h}function I(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e.ownerDocument.documentElement,r=C(e,n),i=Math.max(n.clientWidth,window.innerWidth||0),a=Math.max(n.clientHeight,window.innerHeight||0),o=t?0:w(n),s=t?0:w(n,"left");return A({top:o-r.top+r.marginTop,left:s-r.left+r.marginLeft,width:i,height:a})}function D(e){var t=e.nodeName;if("BODY"===t||"HTML"===t)return!1;if("fixed"===c(e,"position"))return!0;var n=l(e);return!!n&&D(n)}function N(e){if(!e||!e.parentElement||b())return document.documentElement;for(var t=e.parentElement;t&&"none"===c(t,"transform");)t=t.parentElement;return t||document.documentElement}function P(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],a={top:0,left:0},o=i?N(e):y(e,d(t));if("viewport"===r)a=I(o,i);else{var s=void 0;"scrollParent"===r?"BODY"===(s=f(l(t))).nodeName&&(s=e.ownerDocument.documentElement):s="window"===r?e.ownerDocument.documentElement:r;var u=C(s,o,i);if("HTML"!==s.nodeName||D(o))a=u;else{var c=k(e.ownerDocument),h=c.height,p=c.width;a.top+=u.top-u.marginTop,a.bottom=h+u.top,a.left+=u.left-u.marginLeft,a.right=p+u.left}}var b="number"==typeof(n=n||0);return a.left+=b?n:n.left||0,a.top+=b?n:n.top||0,a.right-=b?n:n.right||0,a.bottom-=b?n:n.bottom||0,a}function R(e){var t;return e.width*e.height}function j(e,t,n,r,i){var a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;if(-1===e.indexOf("auto"))return e;var o=P(n,r,a,i),s={top:{width:o.width,height:t.top-o.top},right:{width:o.right-t.right,height:o.height},bottom:{width:o.width,height:o.bottom-t.bottom},left:{width:t.left-o.left,height:o.height}},u=Object.keys(s).map(function(e){return O({key:e},s[e],{area:R(s[e])})}).sort(function(e,t){return t.area-e.area}),c=u.filter(function(e){var t=e.width,r=e.height;return t>=n.clientWidth&&r>=n.clientHeight}),l=c.length>0?c[0].key:u[0].key,f=e.split("-")[1];return l+(f?"-"+f:"")}function F(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,i=r?N(t):y(t,d(n));return C(n,i,r)}function Y(e){var t=e.ownerDocument.defaultView.getComputedStyle(e),n=parseFloat(t.marginTop||0)+parseFloat(t.marginBottom||0),r=parseFloat(t.marginLeft||0)+parseFloat(t.marginRight||0);return{width:e.offsetWidth+r,height:e.offsetHeight+n}}function B(e){var t={left:"right",right:"left",bottom:"top",top:"bottom"};return e.replace(/left|right|bottom|top/g,function(e){return t[e]})}function U(e,t,n){n=n.split("-")[0];var r=Y(e),i={width:r.width,height:r.height},a=-1!==["right","left"].indexOf(n),o=a?"top":"left",s=a?"left":"top",u=a?"height":"width",c=a?"width":"height";return i[o]=t[o]+t[u]/2-r[u]/2,n===s?i[s]=t[s]-r[c]:i[s]=t[B(s)],i}function H(e,t){return Array.prototype.find?e.find(t):e.filter(t)[0]}function $(e,t,n){if(Array.prototype.findIndex)return e.findIndex(function(e){return e[t]===n});var r=H(e,function(e){return e[t]===n});return e.indexOf(r)}function z(e,t,n){return(void 0===n?e:e.slice(0,$(e,"name",n))).forEach(function(e){e.function&&console.warn("`modifier.function` is deprecated, use `modifier.fn`!");var n=e.function||e.fn;e.enabled&&u(n)&&(t.offsets.popper=A(t.offsets.popper),t.offsets.reference=A(t.offsets.reference),t=n(t,e))}),t}function G(){if(!this.state.isDestroyed){var e={instance:this,styles:{},arrowStyles:{},attributes:{},flipped:!1,offsets:{}};e.offsets.reference=F(this.state,this.popper,this.reference,this.options.positionFixed),e.placement=j(this.options.placement,e.offsets.reference,this.popper,this.reference,this.options.modifiers.flip.boundariesElement,this.options.modifiers.flip.padding),e.originalPlacement=e.placement,e.positionFixed=this.options.positionFixed,e.offsets.popper=U(this.popper,e.offsets.reference,e.placement),e.offsets.popper.position=this.options.positionFixed?"fixed":"absolute",e=z(this.modifiers,e),this.state.isCreated?this.options.onUpdate(e):(this.state.isCreated=!0,this.options.onCreate(e))}}function W(e,t){return e.some(function(e){var n=e.name;return e.enabled&&n===t})}function K(e){for(var t=[!1,"ms","Webkit","Moz","O"],n=e.charAt(0).toUpperCase()+e.slice(1),r=0;ro[p]&&(e.offsets.popper[d]+=s[d]+b-o[p]),e.offsets.popper=A(e.offsets.popper);var m=s[d]+s[l]/2-b/2,g=c(e.instance.popper),v=parseFloat(g["margin"+f],10),y=parseFloat(g["border"+f+"Width"],10),w=m-e.offsets.popper[d]-v-y;return w=Math.max(Math.min(o[l]-b,w),0),e.arrowElement=r,e.offsets.arrow=(M(n={},d,Math.round(w)),M(n,h,""),n),e}function ef(e){return"end"===e?"start":"start"===e?"end":e}var ed=["auto-start","auto","auto-end","top-start","top","top-end","right-start","right","right-end","bottom-end","bottom","bottom-start","left-end","left","left-start"],eh=ed.slice(3);function ep(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=eh.indexOf(e),r=eh.slice(n+1).concat(eh.slice(0,n));return t?r.reverse():r}var eb={FLIP:"flip",CLOCKWISE:"clockwise",COUNTERCLOCKWISE:"counterclockwise"};function em(e,t){if(W(e.instance.modifiers,"inner")||e.flipped&&e.placement===e.originalPlacement)return e;var n=P(e.instance.popper,e.instance.reference,t.padding,t.boundariesElement,e.positionFixed),r=e.placement.split("-")[0],i=B(r),a=e.placement.split("-")[1]||"",o=[];switch(t.behavior){case eb.FLIP:o=[r,i];break;case eb.CLOCKWISE:o=ep(r);break;case eb.COUNTERCLOCKWISE:o=ep(r,!0);break;default:o=t.behavior}return o.forEach(function(s,u){if(r!==s||o.length===u+1)return e;i=B(r=e.placement.split("-")[0]);var c=e.offsets.popper,l=e.offsets.reference,f=Math.floor,d="left"===r&&f(c.right)>f(l.left)||"right"===r&&f(c.left)f(l.top)||"bottom"===r&&f(c.top)f(n.right),b=f(c.top)f(n.bottom),g="left"===r&&h||"right"===r&&p||"top"===r&&b||"bottom"===r&&m,v=-1!==["top","bottom"].indexOf(r),y=!!t.flipVariations&&(v&&"start"===a&&h||v&&"end"===a&&p||!v&&"start"===a&&b||!v&&"end"===a&&m),w=!!t.flipVariationsByContent&&(v&&"start"===a&&p||v&&"end"===a&&h||!v&&"start"===a&&m||!v&&"end"===a&&b),_=y||w;(d||g||_)&&(e.flipped=!0,(d||g)&&(r=o[u+1]),_&&(a=ef(a)),e.placement=r+(a?"-"+a:""),e.offsets.popper=O({},e.offsets.popper,U(e.instance.popper,e.offsets.reference,e.placement)),e=z(e.instance.modifiers,e,"flip"))}),e}function eg(e){var t=e.offsets,n=t.popper,r=t.reference,i=e.placement.split("-")[0],a=Math.floor,o=-1!==["top","bottom"].indexOf(i),s=o?"right":"bottom",u=o?"left":"top",c=o?"width":"height";return n[s]a(r[s])&&(e.offsets.popper[u]=a(r[s])),e}function ev(e,t,n,r){var i=e.match(/((?:\-|\+)?\d*\.?\d*)(.*)/),a=+i[1],o=i[2];if(!a)return e;if(0===o.indexOf("%")){var s=void 0;return A(s="%p"===o?n:r)[t]/100*a}if("vh"!==o&&"vw"!==o)return a;var u=void 0;return(u="vh"===o?Math.max(document.documentElement.clientHeight,window.innerHeight||0):Math.max(document.documentElement.clientWidth,window.innerWidth||0))/100*a}function ey(e,t,n,r){var i=[0,0],a=-1!==["right","left"].indexOf(r),o=e.split(/(\+|\-)/).map(function(e){return e.trim()}),s=o.indexOf(H(o,function(e){return -1!==e.search(/,|\s/)}));o[s]&&-1===o[s].indexOf(",")&&console.warn("Offsets separated by white space(s) are deprecated, use a comma (,) instead.");var u=/\s*,\s*|\s+/,c=-1!==s?[o.slice(0,s).concat([o[s].split(u)[0]]),[o[s].split(u)[1]].concat(o.slice(s+1))]:[o];return(c=c.map(function(e,r){var i=(1===r?!a:a)?"height":"width",o=!1;return e.reduce(function(e,t){return""===e[e.length-1]&&-1!==["+","-"].indexOf(t)?(e[e.length-1]=t,o=!0,e):o?(e[e.length-1]+=t,o=!1,e):e.concat(t)},[]).map(function(e){return ev(e,i,t,n)})})).forEach(function(e,t){e.forEach(function(n,r){et(n)&&(i[t]+=n*("-"===e[r-1]?-1:1))})}),i}function ew(e,t){var n=t.offset,r=e.placement,i=e.offsets,a=i.popper,o=i.reference,s=r.split("-")[0],u=void 0;return u=et(+n)?[+n,0]:ey(n,a,o,s),"left"===s?(a.top+=u[0],a.left-=u[1]):"right"===s?(a.top+=u[0],a.left+=u[1]):"top"===s?(a.left+=u[0],a.top-=u[1]):"bottom"===s&&(a.left+=u[0],a.top+=u[1]),e.popper=a,e}function e_(e,t){var n=t.boundariesElement||m(e.instance.popper);e.instance.reference===n&&(n=m(n));var r=K("transform"),i=e.instance.popper.style,a=i.top,o=i.left,s=i[r];i.top="",i.left="",i[r]="";var u=P(e.instance.popper,e.instance.reference,t.padding,n,e.positionFixed);i.top=a,i.left=o,i[r]=s,t.boundaries=u;var c=t.priority,l=e.offsets.popper,f={primary:function(e){var n=l[e];return l[e]u[e]&&!t.escapeWithReference&&(r=Math.min(l[n],u[e]-("right"===e?l.width:l.height))),M({},n,r)}};return c.forEach(function(e){l=O({},l,f[-1!==["left","top"].indexOf(e)?"primary":"secondary"](e))}),e.offsets.popper=l,e}function eE(e){var t=e.placement,n=t.split("-")[0],r=t.split("-")[1];if(r){var i=e.offsets,a=i.reference,o=i.popper,s=-1!==["bottom","top"].indexOf(n),u=s?"left":"top",c=s?"width":"height",l={start:M({},u,a[u]),end:M({},u,a[u]+a[c]-o[c])};e.offsets.popper=O({},o,l[r])}return e}function eS(e){if(!ec(e.instance.modifiers,"hide","preventOverflow"))return e;var t=e.offsets.reference,n=H(e.instance.modifiers,function(e){return"preventOverflow"===e.name}).boundaries;if(t.bottomn.right||t.top>n.bottom||t.right2&&void 0!==arguments[2]?arguments[2]:{};x(this,e),this.scheduleUpdate=function(){return requestAnimationFrame(r.update)},this.update=s(this.update.bind(this)),this.options=O({},e.Defaults,i),this.state={isDestroyed:!1,isCreated:!1,scrollParents:[]},this.reference=t&&t.jquery?t[0]:t,this.popper=n&&n.jquery?n[0]:n,this.options.modifiers={},Object.keys(O({},e.Defaults.modifiers,i.modifiers)).forEach(function(t){r.options.modifiers[t]=O({},e.Defaults.modifiers[t]||{},i.modifiers?i.modifiers[t]:{})}),this.modifiers=Object.keys(this.options.modifiers).map(function(e){return O({name:e},r.options.modifiers[e])}).sort(function(e,t){return e.order-t.order}),this.modifiers.forEach(function(e){e.enabled&&u(e.onLoad)&&e.onLoad(r.reference,r.popper,r.options,e,r.state)}),this.update();var a=this.options.eventsEnabled;a&&this.enableEventListeners(),this.state.eventsEnabled=a}return T(e,[{key:"update",value:function(){return G.call(this)}},{key:"destroy",value:function(){return V.call(this)}},{key:"enableEventListeners",value:function(){return J.call(this)}},{key:"disableEventListeners",value:function(){return ee.call(this)}}]),e}();eT.Utils=("undefined"!=typeof window?window:n.g).PopperUtils,eT.placements=ed,eT.Defaults=ex;let eM=eT},92703(e,t,n){"use strict";var r=n(50414);function i(){}function a(){}a.resetWarningCache=i,e.exports=function(){function e(e,t,n,i,a,o){if(o!==r){var s=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:a,resetWarningCache:i};return n.PropTypes=n,n}},45697(e,t,n){e.exports=n(92703)()},50414(e){"use strict";var t="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";e.exports=t},55760(e){"use strict";function t(e){this._maxSize=e,this.clear()}t.prototype.clear=function(){this._size=0,this._values=Object.create(null)},t.prototype.get=function(e){return this._values[e]},t.prototype.set=function(e,t){return this._size>=this._maxSize&&this.clear(),!(e in this._values)&&this._size++,this._values[e]=t};var n=/[^.^\]^[]+|(?=\[\]|\.\.)/g,r=/^\d+$/,i=/^\d/,a=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,o=/^\s*(['"]?)(.*?)(\1)\s*$/,s=512,u=new t(s),c=new t(s),l=new t(s);function f(e){return u.get(e)||u.set(e,d(e).map(function(e){return e.replace(o,"$2")}))}function d(e){return e.match(n)}function h(e,t,n){var r,i,a,o,s=e.length;for(i=0;i4&&n.slice(0,4)===o&&s.test(t)&&("-"===t.charAt(4)?u=f(t):t=d(t),c=i),new c(u,t))}function f(e){var t=e.slice(5).replace(u,p);return o+t.charAt(0).toUpperCase()+t.slice(1)}function d(e){var t=e.slice(4);return u.test(t)?e:("-"!==(t=t.replace(c,h)).charAt(0)&&(t="-"+t),o+t)}function h(e){return"-"+e.toLowerCase()}function p(e){return e.charAt(1).toUpperCase()}},97247(e,t,n){"use strict";var r=n(19940),i=n(8289),a=n(5812),o=n(94397),s=n(67716),u=n(61805);e.exports=r([a,i,o,s,u])},67716(e,t,n){"use strict";var r=n(17e3),i=n(17596),a=r.booleanish,o=r.number,s=r.spaceSeparated;function u(e,t){return"role"===t?t:"aria-"+t.slice(4).toLowerCase()}e.exports=i({transform:u,properties:{ariaActiveDescendant:null,ariaAtomic:a,ariaAutoComplete:null,ariaBusy:a,ariaChecked:a,ariaColCount:o,ariaColIndex:o,ariaColSpan:o,ariaControls:s,ariaCurrent:null,ariaDescribedBy:s,ariaDetails:null,ariaDisabled:a,ariaDropEffect:s,ariaErrorMessage:null,ariaExpanded:a,ariaFlowTo:s,ariaGrabbed:a,ariaHasPopup:null,ariaHidden:a,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:s,ariaLevel:o,ariaLive:null,ariaModal:a,ariaMultiLine:a,ariaMultiSelectable:a,ariaOrientation:null,ariaOwns:s,ariaPlaceholder:null,ariaPosInSet:o,ariaPressed:a,ariaReadOnly:a,ariaRelevant:null,ariaRequired:a,ariaRoleDescription:s,ariaRowCount:o,ariaRowIndex:o,ariaRowSpan:o,ariaSelected:a,ariaSetSize:o,ariaSort:null,ariaValueMax:o,ariaValueMin:o,ariaValueNow:o,ariaValueText:null,role:null}})},61805(e,t,n){"use strict";var r=n(17e3),i=n(17596),a=n(10855),o=r.boolean,s=r.overloadedBoolean,u=r.booleanish,c=r.number,l=r.spaceSeparated,f=r.commaSeparated;e.exports=i({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:a,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:f,acceptCharset:l,accessKey:l,action:null,allow:null,allowFullScreen:o,allowPaymentRequest:o,allowUserMedia:o,alt:null,as:null,async:o,autoCapitalize:null,autoComplete:l,autoFocus:o,autoPlay:o,capture:o,charSet:null,checked:o,cite:null,className:l,cols:c,colSpan:null,content:null,contentEditable:u,controls:o,controlsList:l,coords:c|f,crossOrigin:null,data:null,dateTime:null,decoding:null,default:o,defer:o,dir:null,dirName:null,disabled:o,download:s,draggable:u,encType:null,enterKeyHint:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:o,formTarget:null,headers:l,height:c,hidden:o,high:c,href:null,hrefLang:null,htmlFor:l,httpEquiv:l,id:null,imageSizes:null,imageSrcSet:f,inputMode:null,integrity:null,is:null,isMap:o,itemId:null,itemProp:l,itemRef:l,itemScope:o,itemType:l,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:o,low:c,manifest:null,max:null,maxLength:c,media:null,method:null,min:null,minLength:c,multiple:o,muted:o,name:null,nonce:null,noModule:o,noValidate:o,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforePrint:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextMenu:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:o,optimum:c,pattern:null,ping:l,placeholder:null,playsInline:o,poster:null,preload:null,readOnly:o,referrerPolicy:null,rel:l,required:o,reversed:o,rows:c,rowSpan:c,sandbox:l,scope:null,scoped:o,seamless:o,selected:o,shape:null,size:c,sizes:null,slot:null,span:c,spellCheck:u,src:null,srcDoc:null,srcLang:null,srcSet:f,start:c,step:null,style:null,tabIndex:c,target:null,title:null,translate:null,type:null,typeMustMatch:o,useMap:null,value:u,width:c,wrap:null,align:null,aLink:null,archive:l,axis:null,background:null,bgColor:null,border:c,borderColor:null,bottomMargin:c,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:o,declare:o,event:null,face:null,frame:null,frameBorder:null,hSpace:c,leftMargin:c,link:null,longDesc:null,lowSrc:null,marginHeight:c,marginWidth:c,noResize:o,noHref:o,noShade:o,noWrap:o,object:null,profile:null,prompt:null,rev:null,rightMargin:c,rules:null,scheme:null,scrolling:u,standby:null,summary:null,text:null,topMargin:c,valueType:null,version:null,vAlign:null,vLink:null,vSpace:c,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:o,disableRemotePlayback:o,prefix:null,property:null,results:c,security:null,unselectable:null}})},10855(e,t,n){"use strict";var r=n(28740);function i(e,t){return r(e,t.toLowerCase())}e.exports=i},28740(e){"use strict";function t(e,t){return t in e?e[t]:t}e.exports=t},17596(e,t,n){"use strict";var r=n(66632),i=n(99607),a=n(81674);function o(e){var t,n,o=e.space,s=e.mustUseProperty||[],u=e.attributes||{},c=e.properties,l=e.transform,f={},d={};for(t in c)n=new a(t,l(u,t),c[t],o),-1!==s.indexOf(t)&&(n.mustUseProperty=!0),f[t]=n,d[r(t)]=t,d[r(n.attribute)]=t;return new i(f,d,o)}e.exports=o},81674(e,t,n){"use strict";var r=n(57643),i=n(17e3);e.exports=s,s.prototype=new r,s.prototype.defined=!0;var a=["boolean","booleanish","overloadedBoolean","number","commaSeparated","spaceSeparated","commaOrSpaceSeparated"],o=a.length;function s(e,t,n,s){var c,l=-1;for(u(this,"space",s),r.call(this,e,t);++l=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function l(e,t){if(null==e)return{};var n,r,i={},a=Object.keys(e);for(r=0;r=0||(i[n]=e[n]);return i}function f(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function d(e,t){for(var n=0;n1&&void 0!==arguments[1]&&arguments[1];return n._tick((0,d.updateNodeHighlightedValue)(n.state.nodes,n.state.links,n.state.config,e,t))}),O(S(n),"_tick",function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return t?n.setState(e,t):n.setState(e)}),O(S(n),"_zoomConfig",function(){var e=(0,o.select)("#".concat(n.state.id,"-").concat(u.default.GRAPH_WRAPPER_ID)),t=(0,s.zoom)().scaleExtent([n.state.config.minZoom,n.state.config.maxZoom]);n.state.config.freezeAllDragEvents||t.on("zoom",n._zoomed),null!==n.state.config.initialZoom&&t.scaleTo(e,n.state.config.initialZoom),e.call(t).on("dblclick.zoom",null)}),O(S(n),"_zoomed",function(){var e=o.event.transform;(0,o.selectAll)("#".concat(n.state.id,"-").concat(u.default.GRAPH_CONTAINER_ID)).attr("transform",e),n.state.config.panAndZoom&&n.setState({transform:e.k}),n.debouncedOnZoomChange&&n.state.previousZoom!==e.k&&(n.debouncedOnZoomChange(n.state.previousZoom,e.k),n.setState({previousZoom:e.k}))}),O(S(n),"onClickGraph",function(e){n.state.enableFocusAnimation&&n.setState({enableFocusAnimation:!1});var t,r,i,a=e.target&&e.target.tagName,o=null==e?void 0:null===(t=e.target)||void 0===t?void 0:null===(r=t.attributes)||void 0===r?void 0:null===(i=r.name)||void 0===i?void 0:i.value,s="svg-container-".concat(n.state.id);"SVG"===a.toUpperCase()&&o===s&&n.props.onClickGraph&&n.props.onClickGraph(e)}),O(S(n),"onClickNode",function(e){var t=n.state.nodes[e];if(n.state.config.collapsible){var r=(0,f.getTargetLeafConnections)(e,n.state.links,n.state.config),i=(0,f.toggleLinksMatrixConnections)(n.state.links,r,n.state.config),a=(0,f.toggleLinksConnections)(n.state.d3Links,i),o=null==r?void 0:r["0"],s=!1;o&&(s=1===i[o.source][o.target]),n._tick({links:i,d3Links:a},function(){n.props.onClickNode&&n.props.onClickNode(e,t),s&&n._graphNodeDragConfig()})}else n.nodeClickTimer?(n.props.onDoubleClickNode&&n.props.onDoubleClickNode(e,t),n.nodeClickTimer=clearTimeout(n.nodeClickTimer)):n.nodeClickTimer=setTimeout(function(){n.props.onClickNode&&n.props.onClickNode(e,t),n.nodeClickTimer=null},u.default.TTL_DOUBLE_CLICK_IN_MS)}),O(S(n),"onRightClickNode",function(e,t){var r=n.state.nodes[t];n.props.onRightClickNode&&n.props.onRightClickNode(e,t,r)}),O(S(n),"onMouseOverNode",function(e){if(!n.isDraggingNode){var t=n.state.nodes[e];n.props.onMouseOverNode&&n.props.onMouseOverNode(e,t),n.state.config.nodeHighlightBehavior&&n._setNodeHighlightedValue(e,!0)}}),O(S(n),"onMouseOutNode",function(e){if(!n.isDraggingNode){var t=n.state.nodes[e];n.props.onMouseOutNode&&n.props.onMouseOutNode(e,t),n.state.config.nodeHighlightBehavior&&n._setNodeHighlightedValue(e,!1)}}),O(S(n),"onMouseOverLink",function(e,t){if(n.props.onMouseOverLink&&n.props.onMouseOverLink(e,t),n.state.config.linkHighlightBehavior){var r={source:e,target:t};n._tick({highlightedLink:r})}}),O(S(n),"onMouseOutLink",function(e,t){if(n.props.onMouseOutLink&&n.props.onMouseOutLink(e,t),n.state.config.linkHighlightBehavior){var r=void 0;n._tick({highlightedLink:r})}}),O(S(n),"onNodePositionChange",function(e){if(n.props.onNodePositionChange){var t=e.id,r=e.x,i=e.y;n.props.onNodePositionChange(t,r,i)}}),O(S(n),"pauseSimulation",function(){return n.state.simulation.stop()}),O(S(n),"resetNodesPositions",function(){if(!n.state.config.staticGraph){var e=(0,d.initializeNodes)(n.props.data.nodes);for(var t in n.state.nodes){var r=n.state.nodes[t];if(r.fx&&r.fy&&(Reflect.deleteProperty(r,"fx"),Reflect.deleteProperty(r,"fy")),t in e){var i=e[t];r.x=i.x,r.y=i.y}}n.state.simulation.alphaTarget(n.state.config.d3.alphaTarget).restart(),n._tick()}}),O(S(n),"restartSimulation",function(){return!n.state.config.staticGraph&&n.state.simulation.restart()}),n.props.id||(0,p.throwErr)(n.constructor.name,l.default.GRAPH_NO_ID_PROP),n.focusAnimationTimeout=null,n.nodeClickTimer=null,n.isDraggingNode=!1,n.state=(0,d.initializeGraphState)(n.props,n.state),n.debouncedOnZoomChange=n.props.onZoomChange?(0,p.debounce)(n.props.onZoomChange,100):null,n}return T(t,e),x(t,[{key:"_graphLinkForceConfig",value:function(){var e=(0,a.forceLink)(this.state.d3Links).id(function(e){return e.id}).distance(this.state.config.d3.linkLength).strength(this.state.config.d3.linkStrength);this.state.simulation.force(u.default.LINK_CLASS_NAME,e)}},{key:"_graphNodeDragConfig",value:function(){var e=(0,i.drag)().on("start",this._onDragStart).on("drag",this._onDragMove).on("end",this._onDragEnd);(0,o.select)("#".concat(this.state.id,"-").concat(u.default.GRAPH_WRAPPER_ID)).selectAll(".node").call(e)}},{key:"_graphBindD3ToReactComponent",value:function(){this.state.config.d3.disableLinkForce||(this.state.simulation.nodes(this.state.d3Nodes).on("tick",this._tick),this._graphLinkForceConfig()),this.state.config.freezeAllDragEvents||this._graphNodeDragConfig()}}]),x(t,[{key:"UNSAFE_componentWillReceiveProps",value:function(e){var t=(0,d.checkForGraphElementsChanges)(e,this.state),n=t.graphElementsUpdated,r=t.newGraphElements,i=n?(0,d.initializeGraphState)(e,this.state):this.state,a=e.config||{},o=(0,d.checkForGraphConfigChanges)(e,this.state),s=o.configUpdated,l=o.d3ConfigUpdated,f=s?(0,p.merge)(c.default,a):this.state.config;r&&this.pauseSimulation();var h=a.panAndZoom!==this.state.config.panAndZoom?1:this.state.transform,b=e.data.focusedNodeId,m=this.state.d3Nodes.find(function(e){return"".concat(e.id)==="".concat(b)}),g="".concat(this.state.id,"-").concat(u.default.GRAPH_WRAPPER_ID),v=(0,d.getCenterAndZoomTransformation)(m,this.state.config,g)||this.state.focusTransformation,w=this.props.data.focusedNodeId!==e.data.focusedNodeId;e.onZoomChange&&(this.debouncedOnZoomChange=(0,p.debounce)(e.onZoomChange,100)),this.setState(y({},i,{config:f,configUpdated:s,d3ConfigUpdated:l,newGraphElements:r,transform:h,focusedNodeId:b,enableFocusAnimation:w,focusTransformation:v}))}},{key:"componentDidUpdate",value:function(){(this.state.config.staticGraph||this.state.config.staticGraphWithDragAndDrop)&&this.pauseSimulation(),!this.state.config.staticGraph&&(this.state.newGraphElements||this.state.d3ConfigUpdated)?(this._graphBindD3ToReactComponent(),this.state.config.staticGraphWithDragAndDrop||this.restartSimulation(),this.setState({newGraphElements:!1,d3ConfigUpdated:!1})):this.state.configUpdated&&this._graphNodeDragConfig(),this.state.configUpdated&&(this._zoomConfig(),this.setState({configUpdated:!1}))}},{key:"componentDidMount",value:function(){this.state.config.staticGraph||this._graphBindD3ToReactComponent(),this._zoomConfig()}},{key:"componentWillUnmount",value:function(){this.pauseSimulation(),this.nodeClickTimer&&(clearTimeout(this.nodeClickTimer),this.nodeClickTimer=null),this.focusAnimationTimeout&&(clearTimeout(this.focusAnimationTimeout),this.focusAnimationTimeout=null)}},{key:"render",value:function(){var e=(0,h.renderGraph)(this.state.nodes,{onClickNode:this.onClickNode,onDoubleClickNode:this.onDoubleClickNode,onRightClickNode:this.onRightClickNode,onMouseOverNode:this.onMouseOverNode,onMouseOut:this.onMouseOutNode},this.state.d3Links,this.state.links,{onClickLink:this.props.onClickLink,onRightClickLink:this.props.onRightClickLink,onMouseOverLink:this.onMouseOverLink,onMouseOutLink:this.onMouseOutLink},this.state.config,this.state.highlightedNode,this.state.highlightedLink,this.state.transform),t=e.nodes,n=e.links,i=e.defs,a={height:this.state.config.height,width:this.state.config.width},o=this._generateFocusAnimationProps();return r.default.createElement("div",{id:"".concat(this.state.id,"-").concat(u.default.GRAPH_WRAPPER_ID)},r.default.createElement("svg",{name:"svg-container-".concat(this.state.id),style:a,onClick:this.onClickGraph},i,r.default.createElement("g",g({id:"".concat(this.state.id,"-").concat(u.default.GRAPH_CONTAINER_ID)},o),n,t)))}}]),t}(r.default.Component);t.default=A},37973(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.computeNodeDegree=l,t.getTargetLeafConnections=f,t.isNodeVisible=d,t.toggleLinksConnections=h,t.toggleLinksMatrixConnections=p;var r=n(52694);function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function a(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{};return Object.keys(t).reduce(function(n,r){return t[r]?Object.keys(t[r]).reduce(function(n,i){return e===r&&(n.outDegree+=t[e][i]),e===i&&(n.inDegree+=t[r][e]),n},n):n},{inDegree:0,outDegree:0})}function f(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,r=n.directed;return(t[e]?Object.keys(t[e]):[]).reduce(function(n,i){return c(i,t,r)&&n.push({source:e,target:i}),n},[])}function d(e,t,n){if(!t[e])return!1;if(t[e]._orphan)return!0;var r=l(e,n),i=r.inDegree,a=r.outDegree;return i>0||a>0}function h(e,t){return e.map(function(e){var n=e.source,i=e.target,o=(0,r.getId)(n),s=(0,r.getId)(i);return a({},e,{isHidden:!(t&&t[o]&&t[o][s])})})}function p(e,t,n){var r=n.directed;return t.reduce(function(e,t){e[t.source]||(e[t.source]={}),e[t.source][t.target]||(e[t.source][t.target]=0);var n=0===e[t.source][t.target]?1:0;return e[t.source][t.target]=n,r||(e[t.target][t.source]=n),e},a({},e))}n(69901)},99182(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.buildLinkProps=h,t.buildNodeProps=p;var r=s(n(53880)),i=n(37109),a=n(80362),o=n(52694);function s(e){return e&&e.__esModule?e:{default:e}}function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function c(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0,a=arguments.length>4?arguments[4]:void 0,o=arguments.length>5?arguments[5]:void 0,s=e.highlighted||e.id===(a&&a.source)||e.id===(a&&a.target),u=d(e,i,a,t),l=e.color||t.node.color;s&&t.node.highlightColor!==r.default.KEYWORDS.SAME&&(l=t.node.highlightColor);var h=e.strokeColor||t.node.strokeColor;s&&t.node.highlightStrokeColor!==r.default.KEYWORDS.SAME&&(h=t.node.highlightStrokeColor);var p=e[t.node.labelProperty]||e.id;"function"==typeof t.node.labelProperty&&(p=t.node.labelProperty(e));var b=e.labelPosition||t.node.labelPosition,m=e.strokeWidth||t.node.strokeWidth;s&&t.node.highlightStrokeWidth!==r.default.KEYWORDS.SAME&&(m=t.node.highlightStrokeWidth);var g=1/o,v=e.size||t.node.size,y="object"!==f(v),w=0;y?w=v:"top"===b||"bottom"===b?w=v.height:("right"===b||"left"===b)&&(w=v.width);var _=e.fontSize||t.node.fontSize,E=e.highlightFontSize||t.node.highlightFontSize,S=s?E:_,k=S*g+w/100+1.5,x=e.svg||t.node.svg,T=e.fontColor||t.node.fontColor,M=t.node.renderLabel;return void 0!==e.renderLabel&&"boolean"==typeof e.renderLabel&&(M=e.renderLabel),c({},e,{className:r.default.NODE_CLASS_NAME,cursor:t.node.mouseCursor,cx:(null==e?void 0:e.x)||"0",cy:(null==e?void 0:e.y)||"0",dx:k,fill:l,fontColor:T,fontSize:S*g,fontWeight:s?t.node.highlightFontWeight:t.node.fontWeight,id:e.id,label:p,labelPosition:b,opacity:u,overrideGlobalViewGenerator:!e.viewGenerator&&e.svg,renderLabel:M,size:y?v*g:{height:v.height*g,width:v.width*g},stroke:h,strokeWidth:m*g,svg:x,type:e.symbolType||t.node.symbolType,viewGenerator:e.viewGenerator||t.node.viewGenerator,onClickNode:n.onClickNode,onMouseOut:n.onMouseOut,onMouseOverNode:n.onMouseOverNode,onRightClickNode:n.onRightClickNode})}},98510(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n={automaticRearrangeAfterDropNode:!1,collapsible:!1,directed:!1,focusAnimationDuration:.75,focusZoom:1,freezeAllDragEvents:!1,height:400,highlightDegree:1,highlightOpacity:1,linkHighlightBehavior:!1,maxZoom:8,minZoom:.1,initialZoom:null,nodeHighlightBehavior:!1,panAndZoom:!1,staticGraph:!1,staticGraphWithDragAndDrop:!1,width:800,d3:{alphaTarget:.05,gravity:-100,linkLength:100,linkStrength:1,disableLinkForce:!1},node:{color:"#d3d3d3",fontColor:"black",fontSize:8,fontWeight:"normal",highlightColor:"SAME",highlightFontSize:8,highlightFontWeight:"normal",highlightStrokeColor:"SAME",highlightStrokeWidth:"SAME",labelProperty:"id",labelPosition:null,mouseCursor:"pointer",opacity:1,renderLabel:!0,size:200,strokeColor:"none",strokeWidth:1.5,svg:"",symbolType:"circle",viewGenerator:null},link:{color:"#d3d3d3",fontColor:"black",fontSize:8,fontWeight:"normal",highlightColor:"SAME",highlightFontSize:8,highlightFontWeight:"normal",labelProperty:"label",mouseCursor:"pointer",opacity:1,renderLabel:!1,semanticStrokeWidth:!1,strokeWidth:1.5,markerHeight:6,markerWidth:6,type:"STRAIGHT",strokeDasharray:0,strokeDashoffset:0,strokeLinecap:"butt"}};t.default=n},53880(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=i(n(11041));function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function o(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:[],r=arguments.length>3?arguments[3]:void 0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},a=n.find(function(t){return t.source.id===e.source&&t.target.id===e.target}),o=a&&(0,c.pick)(a,m),s=(0,c.antiPick)(e,["source","target"]);if(o){var u=i.config&&Object.prototype.hasOwnProperty.call(i.config,"directed")&&r.directed!==i.config.directed,l=h({index:t},o,{},s);return u?h({},l,{isHidden:!1}):r.collapsible?l:h({},l,{isHidden:!1})}var f=!1,d={id:e.source,highlighted:f},p={id:e.target,highlighted:f};return h({index:t,source:d,target:p},s)}function _(e,t){return Object.keys(e).reduce(function(n,r){var i=(0,l.computeNodeDegree)(r,t),a=i.inDegree,o=i.outDegree,s=e[r],u=0===a&&0===o?h({},s,{_orphan:!0}):s;return n[r]=u,n},{})}function E(e){e.nodes&&e.nodes.length||((0,c.logWarning)("Graph",u.default.INSUFFICIENT_DATA),e.nodes=[]),e.links||((0,c.logWarning)("Graph",u.default.INSUFFICIENT_LINKS),e.links=[]);for(var t=e.links.length,n=function(t){var n=e.links[t];e.nodes.find(function(e){return e.id===n.source})||(0,c.throwErr)("Graph","".concat(u.default.INVALID_LINKS,' - "').concat(n.source,'" is not a valid source node id')),e.nodes.find(function(e){return e.id===n.target})||(0,c.throwErr)("Graph","".concat(u.default.INVALID_LINKS,' - "').concat(n.target,'" is not a valid target node id')),n&&void 0!==n.value&&"number"!=typeof n.value&&(0,c.throwErr)("Graph","".concat(u.default.INVALID_LINK_VALUE,' - found in link with source "').concat(n.source,'" and target "').concat(n.target,'"'))},r=0;rx?o.focusZoom=x:T4&&void 0!==arguments[4]&&arguments[4],a=i?r:"",o=h({},e[r],{highlighted:i}),s=h({},e,p({},r,o));return t[r]&&0!==n.highlightDegree&&(s=Object.keys(t[r]).reduce(function(e,t){var n=h({},s[t],{highlighted:i});return e[t]=n,e},s)),{nodes:s,highlightedNode:a}}function I(e){var t=Math.sqrt(Math.pow(e.x,2)+Math.pow(e.y,2));return 0===t?e:{x:e.x/t,y:e.y/t}}var D=new Set([o.default.SYMBOLS.CIRCLE]);function N(e,t,n,r){var i=e.sourceId,a=e.targetId,s=e.sourceCoords,u=void 0===s?{}:s,c=e.targetCoords,l=void 0===c?{}:c,f=null==t?void 0:t[i],d=null==t?void 0:t[a];if(!f||!d||(null===(_=n.node)||void 0===_?void 0:_.viewGenerator)||(null==f?void 0:f.viewGenerator)||(null==d?void 0:d.viewGenerator))return{sourceCoords:u,targetCoords:l};var h=f.symbolType||(null===(E=n.node)||void 0===E?void 0:E.symbolType),p=d.symbolType||(null===(S=n.node)||void 0===S?void 0:S.symbolType);if(!D.has(h)&&!D.has(p))return{sourceCoords:u,targetCoords:l};var b=u.x,m=u.y,g=l.x,v=l.y,y=I({x:g-b,y:v-m});if(h===o.default.SYMBOLS.CIRCLE){var w=(null==f?void 0:f.size)||n.node.size;b+=(w=.95*Math.sqrt(w/Math.PI))*y.x,m+=w*y.y}if(p===o.default.SYMBOLS.CIRCLE){var _,E,S,k,x,T=r*Math.min((null===(k=n.link)||void 0===k?void 0:k.markerWidth)||0,(null===(x=n.link)||void 0===x?void 0:x.markerHeight)||0),M=(null==d?void 0:d.size)||n.node.size;g-=((M=.95*Math.sqrt(M/Math.PI))+(n.directed?T:0))*y.x,v-=(M+(n.directed?T:0))*y.y}return{sourceCoords:{x:b,y:m},targetCoords:{x:g,y:v}}}},75791(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.renderGraph=E;var r=h(n(67294)),i=h(n(53880)),a=n(7619),o=h(n(33938)),s=h(n(61740)),u=h(n(28017)),c=n(99182),l=n(52694),f=n(37973),d=n(80362);function h(e){return e&&e.__esModule?e:{default:e}}function p(){return(p=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:i.LINE_TYPES.STRAIGHT,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],o=e.x,s=e.y,u=p(i.LINE_TYPES[n]||i.LINE_TYPES.STRAIGHT),c=[].concat(a(r),[t]),l=c.map(function(t,n){var r,i=t.x,a=t.y,o=n>0?c[n-1]:e,s=u(o.x,o.y,i,a);return" A".concat(s,",").concat(s," 0 0,1 ").concat(i,",").concat(a)}).join("");return"M".concat(o,",").concat(s).concat(l)}},28017(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=i(n(67294));function i(e){return e&&e.__esModule?e:{default:e}}function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function s(e,t){for(var n=0;n=t&&e0&&void 0!==arguments[0]?arguments[0]:i.default.DEFAULT_NODE_SIZE,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i.default.SYMBOLS.CIRCLE;return(0,r.symbol)().size(function(){return e}).type(function(){return o(t)})()}function u(e,t){switch(t){case"right":return{dx:e?"".concat(e):i.default.NODE_LABEL_DX,dy:"0",dominantBaseline:"middle",textAnchor:"start"};case"left":return{dx:e?"".concat(-e):"-".concat(i.default.NODE_LABEL_DX),dy:"0",dominantBaseline:"middle",textAnchor:"end"};case"top":return{dx:"0",dy:e?"".concat(-e):"-".concat(i.default.NODE_LABEL_DX),dominantBaseline:"baseline",textAnchor:"middle"};case"bottom":return{dx:"0",dy:e?"".concat(e):i.default.NODE_LABEL_DX,dominantBaseline:"hanging",textAnchor:"middle"};case"center":return{dx:"0",dy:"0",dominantBaseline:"middle",textAnchor:"middle"};default:return{dx:e?"".concat(e):i.default.NODE_LABEL_DX,dy:i.default.NODE_LABEL_DY}}}var c={buildSvgSymbol:s,getLabelPlacementProps:u};t.default=c},11041(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n={SYMBOLS:{CIRCLE:"circle",CROSS:"cross",DIAMOND:"diamond",SQUARE:"square",STAR:"star",TRIANGLE:"triangle",WYE:"wye"}};t.default=n},34214(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n={GRAPH_NO_ID_PROP:"id prop not defined! id property is mandatory and it should be unique.",INSUFFICIENT_LINKS:"you are passing invalid data to react-d3-graph. You must include a links array, even if empty, in the data object you're passing down to the component.",INVALID_LINKS:"you provided a invalid links data structure. Links source and target attributes must point to an existent node",INSUFFICIENT_DATA:"you have not provided enough data for react-d3-graph to render something. You need to provide at least one node",INVALID_LINK_VALUE:"links 'value' attribute must be of type number"};t.default=n},94164(e,t,n){"use strict";r={value:!0},Object.defineProperty(t,"kJ",{enumerable:!0,get:function(){return i.default}}),r={enumerable:!0,get:function(){return a.default}},r={enumerable:!0,get:function(){return o.default}};var r,i=s(n(82623)),a=s(n(61740)),o=s(n(33938));function s(e){return e&&e.__esModule?e:{default:e}}},69901(e,t){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.isDeepEqual=a,t.isEmptyObject=o,t.deepClone=s,t.merge=u,t.pick=c,t.antiPick=l,t.debounce=f,t.throwErr=h,t.logError=p,t.logWarning=b;var r=20;function i(e,t){return!!e&&Object.prototype.hasOwnProperty.call(e,t)&&"object"===n(e[t])&&null!==e[t]&&!o(e[t])}function a(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,s=[];if(0===n&&e===t)return!0;if(o(e)&&!o(t)||!o(e)&&o(t))return!1;var u=Object.keys(e),c=Object.keys(t);if(u.length!==c.length)return!1;for(var l=0,f=u;l1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=Object.keys(e),o=0,u=a;o0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a={};if(0===Object.keys(e||{}).length)return t&&!o(t)?t:{};for(var s=0,c=Object.keys(e);s1&&void 0!==arguments[1]?arguments[1]:[];return t.reduce(function(t,n){return Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]),t},{})}function l(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=Object.keys(e).filter(function(e){return!t.includes(e)});return c(e,n)}function f(e,t){var n;return function(){for(var r=arguments.length,i=Array(r),a=0;a0&&void 0!==arguments[0]?arguments[0]:"N/A",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"N/A";return"react-d3-graph :: ".concat(e," :: ").concat(t)}function h(e,t){throw Error(d(e,t))}function p(e,t){console.error(d(e,t))}function b(e,t){var n="react-d3-graph :: ".concat(e," :: ").concat(t);console.warn(n)}},64448(e,t,n){"use strict";/** @license React v16.12.0 + * react-dom.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ var r,i,a,o,s,u=n(67294),c=n(27418),l=n(63840);function f(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;nt}return!1}function eM(e,t,n,r,i,a){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=a}var eO={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){eO[e]=new eM(e,0,!1,e,null,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];eO[t]=new eM(t,1,!1,e[1],null,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){eO[e]=new eM(e,2,!1,e.toLowerCase(),null,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){eO[e]=new eM(e,2,!1,e,null,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){eO[e]=new eM(e,3,!1,e.toLowerCase(),null,!1)}),["checked","multiple","muted","selected"].forEach(function(e){eO[e]=new eM(e,3,!0,e,null,!1)}),["capture","download"].forEach(function(e){eO[e]=new eM(e,4,!1,e,null,!1)}),["cols","rows","size","span"].forEach(function(e){eO[e]=new eM(e,6,!1,e,null,!1)}),["rowSpan","start"].forEach(function(e){eO[e]=new eM(e,5,!1,e.toLowerCase(),null,!1)});var eA=/[\-:]([a-z])/g;function eL(e){return e[1].toUpperCase()}function eC(e){switch(typeof e){case"boolean":case"number":case"object":case"string":case"undefined":return e;default:return""}}function eI(e,t,n,r){var i=eO.hasOwnProperty(t)?eO[t]:null;(null!==i?0===i.type:!r&&2=t.length))throw Error(f(93));t=t[0]}n=t}null==n&&(n="")}e._wrapperState={initialValue:eC(n)}}function eV(e,t){var n=eC(t.value),r=eC(t.defaultValue);null!=n&&((n=""+n)!==e.value&&(e.value=n),null==t.defaultValue&&e.defaultValue!==n&&(e.defaultValue=n)),null!=r&&(e.defaultValue=""+r)}function eq(e){var t=e.textContent;t===e._wrapperState.initialValue&&""!==t&&null!==t&&(e.value=t)}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(eA,eL);eO[t]=new eM(t,1,!1,e,null,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(eA,eL);eO[t]=new eM(t,1,!1,e,"http://www.w3.org/1999/xlink",!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(eA,eL);eO[t]=new eM(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1)}),["tabIndex","crossOrigin"].forEach(function(e){eO[e]=new eM(e,1,!1,e.toLowerCase(),null,!1)}),eO.xlinkHref=new eM("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0),["src","href","action","formAction"].forEach(function(e){eO[e]=new eM(e,1,!1,e.toLowerCase(),null,!0)});var eZ={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg"};function eX(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function eJ(e,t){return null==e||"http://www.w3.org/1999/xhtml"===e?eX(t):"http://www.w3.org/2000/svg"===e&&"foreignObject"===t?"http://www.w3.org/1999/xhtml":e}var eQ,e1,e0=(eQ=function(e,t){if(e.namespaceURI!==eZ.svg||"innerHTML"in e)e.innerHTML=t;else{for((e1=e1||document.createElement("div")).innerHTML=""+t.valueOf().toString()+"",t=e1.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}},"undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction?function(e,t,n,r){MSApp.execUnsafeLocalFunction(function(){return eQ(e,t,n,r)})}:eQ);function e2(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType){n.nodeValue=t;return}}e.textContent=t}function e3(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var e4={animationend:e3("Animation","AnimationEnd"),animationiteration:e3("Animation","AnimationIteration"),animationstart:e3("Animation","AnimationStart"),transitionend:e3("Transition","TransitionEnd")},e6={},e5={};function e8(e){if(e6[e])return e6[e];if(!e4[e])return e;var t,n=e4[e];for(t in n)if(n.hasOwnProperty(t)&&t in e5)return e6[e]=n[t];return e}eo&&(e5=document.createElement("div").style,"AnimationEvent"in window||(delete e4.animationend.animation,delete e4.animationiteration.animation,delete e4.animationstart.animation),"TransitionEvent"in window||delete e4.transitionend.transition);var e9=e8("animationend"),e7=e8("animationiteration"),te=e8("animationstart"),tt=e8("transitionend"),tn="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange seeked seeking stalled suspend timeupdate volumechange waiting".split(" ");function tr(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do 0!=(1026&(t=e).effectTag)&&(n=t.return),e=t.return;while(e)}return 3===t.tag?n:null}function ti(e){if(13===e.tag){var t=e.memoizedState;if(null===t&&null!==(e=e.alternate)&&(t=e.memoizedState),null!==t)return t.dehydrated}return null}function ta(e){if(tr(e)!==e)throw Error(f(188))}function to(e){var t=e.alternate;if(!t){if(null===(t=tr(e)))throw Error(f(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(null===i)break;var a=i.alternate;if(null===a){if(null!==(r=i.return)){n=r;continue}break}if(i.child===a.child){for(a=i.child;a;){if(a===n)return ta(i),e;if(a===r)return ta(i),t;a=a.sibling}throw Error(f(188))}if(n.return!==r.return)n=i,r=a;else{for(var o=!1,s=i.child;s;){if(s===n){o=!0,n=i,r=a;break}if(s===r){o=!0,r=i,n=a;break}s=s.sibling}if(!o){for(s=a.child;s;){if(s===n){o=!0,n=a,r=i;break}if(s===r){o=!0,r=a,n=i;break}s=s.sibling}if(!o)throw Error(f(189))}}if(n.alternate!==r)throw Error(f(190))}if(3!==n.tag)throw Error(f(188));return n.stateNode.current===n?e:t}function ts(e){if(!(e=to(e)))return null;for(var t=e;;){if(5===t.tag||6===t.tag)return t;if(t.child)t.child.return=t,t=t.child;else{if(t===e)break;for(;!t.sibling;){if(!t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}}return null}var tu,tc,tl,tf=!1,td=[],th=null,tp=null,tb=null,tm=new Map,tg=new Map,tv=[],ty="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput close cancel copy cut paste click change contextmenu reset submit".split(" "),tw="focus blur dragenter dragleave mouseover mouseout pointerover pointerout gotpointercapture lostpointercapture".split(" ");function t_(e){var t=nA(e);ty.forEach(function(n){nL(n,e,t)}),tw.forEach(function(n){nL(n,e,t)})}function tE(e,t,n,r){return{blockedOn:e,topLevelType:t,eventSystemFlags:32|n,nativeEvent:r}}function tS(e,t){switch(e){case"focus":case"blur":th=null;break;case"dragenter":case"dragleave":tp=null;break;case"mouseover":case"mouseout":tb=null;break;case"pointerover":case"pointerout":tm.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":tg.delete(t.pointerId)}}function tk(e,t,n,r,i){return null===e||e.nativeEvent!==i?(e=tE(t,n,r,i),null!==t&&null!==(t=n7(t))&&tc(t),e):(e.eventSystemFlags|=r,e)}function tx(e,t,n,r){switch(t){case"focus":return th=tk(th,e,t,n,r),!0;case"dragenter":return tp=tk(tp,e,t,n,r),!0;case"mouseover":return tb=tk(tb,e,t,n,r),!0;case"pointerover":var i=r.pointerId;return tm.set(i,tk(tm.get(i)||null,e,t,n,r)),!0;case"gotpointercapture":return i=r.pointerId,tg.set(i,tk(tg.get(i)||null,e,t,n,r)),!0}return!1}function tT(e){var t=n9(e.target);if(null!==t){var n=tr(t);if(null!==n){if(13===(t=n.tag)){if(null!==(t=ti(n))){e.blockedOn=t,l.unstable_runWithPriority(e.priority,function(){tl(n)});return}}else if(3===t&&n.stateNode.hydrate){e.blockedOn=3===n.tag?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function tM(e){if(null!==e.blockedOn)return!1;var t=nT(e.topLevelType,e.eventSystemFlags,e.nativeEvent);if(null!==t){var n=n7(t);return null!==n&&tc(n),e.blockedOn=t,!1}return!0}function tO(e,t,n){tM(e)&&n.delete(t)}function tA(){for(tf=!1;0this.eventPool.length&&this.eventPool.push(e)}function tz(e){e.eventPool=[],e.getPooled=tH,e.release=t$}c(tU.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=tY)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=tY)},persist:function(){this.isPersistent=tY},isPersistent:tB,destructor:function(){var e,t=this.constructor.Interface;for(e in t)this[e]=null;this.nativeEvent=this._targetInst=this.dispatchConfig=null,this.isPropagationStopped=this.isDefaultPrevented=tB,this._dispatchInstances=this._dispatchListeners=null}}),tU.Interface={type:null,target:null,currentTarget:function(){return null},eventPhase:null,bubbles:null,cancelable:null,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:null,isTrusted:null},tU.extend=function(e){function t(){}function n(){return r.apply(this,arguments)}var r=this;t.prototype=r.prototype;var i=new t;return c(i,n.prototype),n.prototype=i,n.prototype.constructor=n,n.Interface=c({},r.Interface,e),n.extend=r.extend,tz(n),n},tz(tU);var tG=tU.extend({animationName:null,elapsedTime:null,pseudoElement:null}),tW=tU.extend({clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),tK=tU.extend({view:null,detail:null}),tV=tK.extend({relatedTarget:null});function tq(e){var t=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===t&&(e=13):e=t,10===e&&(e=13),32<=e||13===e?e:0}var tZ={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},tX={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},tJ={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function tQ(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=tJ[e])&&!!t[e]}function t1(){return tQ}for(var t0=tK.extend({key:function(e){if(e.key){var t=tZ[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?13===(e=tq(e))?"Enter":String.fromCharCode(e):"keydown"===e.type||"keyup"===e.type?tX[e.keyCode]||"Unidentified":""},location:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,repeat:null,locale:null,getModifierState:t1,charCode:function(e){return"keypress"===e.type?tq(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?tq(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}}),t2=0,t3=0,t4=!1,t6=!1,t5=tK.extend({screenX:null,screenY:null,clientX:null,clientY:null,pageX:null,pageY:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,getModifierState:t1,button:null,buttons:null,relatedTarget:function(e){return e.relatedTarget||(e.fromElement===e.srcElement?e.toElement:e.fromElement)},movementX:function(e){if(("movementX"in e))return e.movementX;var t=t2;return t2=e.screenX,t4?"mousemove"===e.type?e.screenX-t:0:(t4=!0,0)},movementY:function(e){if(("movementY"in e))return e.movementY;var t=t3;return t3=e.screenY,t6?"mousemove"===e.type?e.screenY-t:0:(t6=!0,0)}}),t8=t5.extend({pointerId:null,width:null,height:null,pressure:null,tangentialPressure:null,tiltX:null,tiltY:null,twist:null,pointerType:null,isPrimary:null}),t9=t5.extend({dataTransfer:null}),t7=tK.extend({touches:null,targetTouches:null,changedTouches:null,altKey:null,metaKey:null,ctrlKey:null,shiftKey:null,getModifierState:t1}),ne=tU.extend({propertyName:null,elapsedTime:null,pseudoElement:null}),nt=t5.extend({deltaX:function(e){return("deltaX"in e)?e.deltaX:("wheelDeltaX"in e)?-e.wheelDeltaX:0},deltaY:function(e){return("deltaY"in e)?e.deltaY:("wheelDeltaY"in e)?-e.wheelDeltaY:("wheelDelta"in e)?-e.wheelDelta:0},deltaZ:null,deltaMode:null}),nn=[["blur","blur",0],["cancel","cancel",0],["click","click",0],["close","close",0],["contextmenu","contextMenu",0],["copy","copy",0],["cut","cut",0],["auxclick","auxClick",0],["dblclick","doubleClick",0],["dragend","dragEnd",0],["dragstart","dragStart",0],["drop","drop",0],["focus","focus",0],["input","input",0],["invalid","invalid",0],["keydown","keyDown",0],["keypress","keyPress",0],["keyup","keyUp",0],["mousedown","mouseDown",0],["mouseup","mouseUp",0],["paste","paste",0],["pause","pause",0],["play","play",0],["pointercancel","pointerCancel",0],["pointerdown","pointerDown",0],["pointerup","pointerUp",0],["ratechange","rateChange",0],["reset","reset",0],["seeked","seeked",0],["submit","submit",0],["touchcancel","touchCancel",0],["touchend","touchEnd",0],["touchstart","touchStart",0],["volumechange","volumeChange",0],["drag","drag",1],["dragenter","dragEnter",1],["dragexit","dragExit",1],["dragleave","dragLeave",1],["dragover","dragOver",1],["mousemove","mouseMove",1],["mouseout","mouseOut",1],["mouseover","mouseOver",1],["pointermove","pointerMove",1],["pointerout","pointerOut",1],["pointerover","pointerOver",1],["scroll","scroll",1],["toggle","toggle",1],["touchmove","touchMove",1],["wheel","wheel",1],["abort","abort",2],[e9,"animationEnd",2],[e7,"animationIteration",2],[te,"animationStart",2],["canplay","canPlay",2],["canplaythrough","canPlayThrough",2],["durationchange","durationChange",2],["emptied","emptied",2],["encrypted","encrypted",2],["ended","ended",2],["error","error",2],["gotpointercapture","gotPointerCapture",2],["load","load",2],["loadeddata","loadedData",2],["loadedmetadata","loadedMetadata",2],["loadstart","loadStart",2],["lostpointercapture","lostPointerCapture",2],["playing","playing",2],["progress","progress",2],["seeking","seeking",2],["stalled","stalled",2],["suspend","suspend",2],["timeupdate","timeUpdate",2],[tt,"transitionEnd",2],["waiting","waiting",2]],nr={},ni={},na=0;na=t)return{node:r,offset:t-e};e=n}a:{for(;r;){if(r.nextSibling){r=r.nextSibling;break a}r=r.parentNode}r=void 0}r=nU(r)}}function n$(e,t){return!!e&&!!t&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?n$(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function nz(){for(var e=window,t=nB();t instanceof e.HTMLIFrameElement;){try{var n="string"==typeof t.contentWindow.location.href}catch(r){n=!1}if(n)e=t.contentWindow;else break;t=nB(e.document)}return t}function nG(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}var nW="$",nK="/$",nV="$?",nq="$!",nZ=null,nX=null;function nJ(e,t){switch(e){case"button":case"input":case"select":case"textarea":return!!t.autoFocus}return!1}function nQ(e,t){return"textarea"===e||"option"===e||"noscript"===e||"string"==typeof t.children||"number"==typeof t.children||"object"==typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var n1="function"==typeof setTimeout?setTimeout:void 0,n0="function"==typeof clearTimeout?clearTimeout:void 0;function n2(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break}return e}function n3(e){e=e.previousSibling;for(var t=0;e;){if(8===e.nodeType){var n=e.data;if(n===nW||n===nq||n===nV){if(0===t)return e;t--}else n===nK&&t++}e=e.previousSibling}return null}var n4=Math.random().toString(36).slice(2),n6="__reactInternalInstance$"+n4,n5="__reactEventHandlers$"+n4,n8="__reactContainere$"+n4;function n9(e){var t=e[n6];if(t)return t;for(var n=e.parentNode;n;){if(t=n[n8]||n[n6]){if(n=t.alternate,null!==t.child||null!==n&&null!==n.child)for(e=n3(e);null!==e;){if(n=e[n6])return n;e=n3(e)}return t}n=(e=n).parentNode}return null}function n7(e){return(e=e[n6]||e[n8])&&(5===e.tag||6===e.tag||13===e.tag||3===e.tag)?e:null}function re(e){if(5===e.tag||6===e.tag)return e.stateNode;throw Error(f(33))}function rt(e){return e[n5]||null}var rn=null,rr=null,ri=null;function ra(){if(ri)return ri;var e,t,n=rr,r=n.length,i="value"in rn?rn.value:rn.textContent,a=i.length;for(e=0;e=rl),rh=" ",rp={beforeInput:{phasedRegistrationNames:{bubbled:"onBeforeInput",captured:"onBeforeInputCapture"},dependencies:["compositionend","keypress","textInput","paste"]},compositionEnd:{phasedRegistrationNames:{bubbled:"onCompositionEnd",captured:"onCompositionEndCapture"},dependencies:"blur compositionend keydown keypress keyup mousedown".split(" ")},compositionStart:{phasedRegistrationNames:{bubbled:"onCompositionStart",captured:"onCompositionStartCapture"},dependencies:"blur compositionstart keydown keypress keyup mousedown".split(" ")},compositionUpdate:{phasedRegistrationNames:{bubbled:"onCompositionUpdate",captured:"onCompositionUpdateCapture"},dependencies:"blur compositionupdate keydown keypress keyup mousedown".split(" ")}},rb=!1;function rm(e,t){switch(e){case"keyup":return -1!==ru.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"blur":return!0;default:return!1}}function rg(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var rv=!1;function ry(e,t){switch(e){case"compositionend":return rg(t);case"keypress":if(32!==t.which)return null;return rb=!0,rh;case"textInput":return(e=t.data)===rh&&rb?null:e;default:return null}}function rw(e,t){if(rv)return"compositionend"===e||!rc&&rm(e,t)?(e=ra(),ri=rr=rn=null,rv=!1,e):null;switch(e){case"paste":default:return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=document.documentMode,rK={select:{phasedRegistrationNames:{bubbled:"onSelect",captured:"onSelectCapture"},dependencies:"blur contextmenu dragend focus keydown keyup mousedown mouseup selectionchange".split(" ")}},rV=null,rq=null,rZ=null,rX=!1;function rJ(e,t){var n=t.window===t?t.document:9===t.nodeType?t:t.ownerDocument;return rX||null==rV||rV!==nB(n)?null:(n="selectionStart"in(n=rV)&&nG(n)?{start:n.selectionStart,end:n.selectionEnd}:{anchorNode:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset},rZ&&rG(rZ,n)?null:(rZ=n,(e=tU.getPooled(rK.select,rq,e,t)).type="select",e.target=rV,tF(e),e))}var rQ={eventTypes:rK,extractEvents:function(e,t,n,r){var i,a=r.window===r?r.document:9===r.nodeType?r:r.ownerDocument;if(!(i=!a)){a:{a=nA(a),i=y.onSelect;for(var o=0;or2||(e.current=r0[r2],r0[r2]=null,r2--)}function r4(e,t){r0[++r2]=e.current,e.current=t}var r6={},r5={current:r6},r8={current:!1},r9=r6;function r7(e,t){var n=e.type.contextTypes;if(!n)return r6;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i,a={};for(i in n)a[i]=t[i];return r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=a),a}function ie(e){return null!=(e=e.childContextTypes)}function it(e){r3(r8,e),r3(r5,e)}function ir(e){r3(r8,e),r3(r5,e)}function ii(e,t,n){if(r5.current!==r6)throw Error(f(168));r4(r5,t,e),r4(r8,n,e)}function ia(e,t,n){var r=e.stateNode;if(e=t.childContextTypes,"function"!=typeof r.getChildContext)return n;for(var i in r=r.getChildContext())if(!(i in e))throw Error(f(108,ei(t)||"Unknown",i));return c({},n,{},r)}function io(e){var t=e.stateNode;return t=t&&t.__reactInternalMemoizedMergedChildContext||r6,r9=r5.current,r4(r5,t,e),r4(r8,r8.current,e),!0}function is(e,t,n){var r=e.stateNode;if(!r)throw Error(f(169));n?(t=ia(e,t,r9),r.__reactInternalMemoizedMergedChildContext=t,r3(r8,e),r3(r5,e),r4(r5,t,e)):r3(r8,e),r4(r8,n,e)}var iu=l.unstable_runWithPriority,ic=l.unstable_scheduleCallback,il=l.unstable_cancelCallback,id=l.unstable_shouldYield,ih=l.unstable_requestPaint,ip=l.unstable_now,ib=l.unstable_getCurrentPriorityLevel,im=l.unstable_ImmediatePriority,ig=l.unstable_UserBlockingPriority,iv=l.unstable_NormalPriority,iy=l.unstable_LowPriority,iw=l.unstable_IdlePriority,i_={},iE=void 0!==ih?ih:function(){},iS=null,ik=null,ix=!1,iT=ip(),iM=1e4>iT?ip:function(){return ip()-iT};function iO(){switch(ib()){case im:return 99;case ig:return 98;case iv:return 97;case iy:return 96;case iw:return 95;default:throw Error(f(332))}}function iA(e){switch(e){case 99:return im;case 98:return ig;case 97:return iv;case 96:return iy;case 95:return iw;default:throw Error(f(332))}}function iL(e,t){return e=iA(e),iu(e,t)}function iC(e,t,n){return e=iA(e),ic(e,t,n)}function iI(e){return null===iS?(iS=[e],ik=ic(im,iN)):iS.push(e),i_}function iD(){if(null!==ik){var e=ik;ik=null,il(e)}iN()}function iN(){if(!ix&&null!==iS){ix=!0;var e=0;try{var t=iS;iL(99,function(){for(;e=t&&(oo=!0),e.firstContext=null)}function iK(e,t){if(iU!==e&&!1!==t&&0!==t){if(("number"!=typeof t||1073741823===t)&&(iU=e,t=1073741823),t={context:e,observedBits:t,next:null},null===iB){if(null===iY)throw Error(f(308));iB=t,iY.dependencies={expirationTime:0,firstContext:t,responders:null}}else iB=iB.next=t}return e._currentValue}var iV=!1;function iq(e){return{baseState:e,firstUpdate:null,lastUpdate:null,firstCapturedUpdate:null,lastCapturedUpdate:null,firstEffect:null,lastEffect:null,firstCapturedEffect:null,lastCapturedEffect:null}}function iZ(e){return{baseState:e.baseState,firstUpdate:e.firstUpdate,lastUpdate:e.lastUpdate,firstCapturedUpdate:null,lastCapturedUpdate:null,firstEffect:null,lastEffect:null,firstCapturedEffect:null,lastCapturedEffect:null}}function iX(e,t){return{expirationTime:e,suspenseConfig:t,tag:0,payload:null,callback:null,next:null,nextEffect:null}}function iJ(e,t){null===e.lastUpdate?e.firstUpdate=e.lastUpdate=t:(e.lastUpdate.next=t,e.lastUpdate=t)}function iQ(e,t){var n=e.alternate;if(null===n){var r=e.updateQueue,i=null;null===r&&(r=e.updateQueue=iq(e.memoizedState))}else r=e.updateQueue,i=n.updateQueue,null===r?null===i?(r=e.updateQueue=iq(e.memoizedState),i=n.updateQueue=iq(n.memoizedState)):r=e.updateQueue=iZ(i):null===i&&(i=n.updateQueue=iZ(r));null===i||r===i?iJ(r,t):null===r.lastUpdate||null===i.lastUpdate?(iJ(r,t),iJ(i,t)):(iJ(r,t),i.lastUpdate=t)}function i1(e,t){var n=e.updateQueue;null===(n=null===n?e.updateQueue=iq(e.memoizedState):i0(e,n)).lastCapturedUpdate?n.firstCapturedUpdate=n.lastCapturedUpdate=t:(n.lastCapturedUpdate.next=t,n.lastCapturedUpdate=t)}function i0(e,t){var n=e.alternate;return null!==n&&t===n.updateQueue&&(t=e.updateQueue=iZ(t)),t}function i2(e,t,n,r,i,a){switch(n.tag){case 1:return"function"==typeof(e=n.payload)?e.call(a,r,i):e;case 3:e.effectTag=-4097&e.effectTag|64;case 0:if(null==(i="function"==typeof(e=n.payload)?e.call(a,r,i):e))break;return c({},r,i);case 2:iV=!0}return r}function i3(e,t,n,r,i){iV=!1,t=i0(e,t);for(var a=t.baseState,o=null,s=0,u=t.firstUpdate,c=a;null!==u;){var l=u.expirationTime;lb?(m=f,f=null):m=f.sibling;var g=h(i,f,s[b],u);if(null===g){null===f&&(f=m);break}e&&f&&null===g.alternate&&t(i,f),o=a(g,o,b),null===l?c=g:l.sibling=g,l=g,f=m}if(b===s.length)return n(i,f),c;if(null===f){for(;bm?(g=b,b=null):g=b.sibling;var y=h(i,b,v.value,u);if(null===y){null===b&&(b=g);break}e&&b&&null===y.alternate&&t(i,b),o=a(y,o,m),null===l?c=y:l.sibling=y,l=y,b=g}if(v.done)return n(i,b),c;if(null===b){for(;!v.done;m++,v=s.next())null!==(v=d(i,v.value,u))&&(o=a(v,o,m),null===l?c=v:l.sibling=v,l=v);return c}for(b=r(i,b);!v.done;m++,v=s.next())null!==(v=p(b,i,m,v.value,u))&&(e&&null!==v.alternate&&b.delete(null===v.key?m:v.key),o=a(v,o,m),null===l?c=v:l.sibling=v,l=v);return e&&b.forEach(function(e){return t(i,e)}),c}return function(e,r,a,s){var u="object"==typeof a&&null!==a&&a.type===z&&null===a.key;u&&(a=a.props.children);var c="object"==typeof a&&null!==a;if(c)switch(a.$$typeof){case H:a:{for(c=a.key,u=r;null!==u;){if(u.key===c){if(7===u.tag?a.type===z:u.elementType===a.type){n(e,u.sibling),(r=i(u,a.type===z?a.props.children:a.props,s)).ref=aa(e,u,a),r.return=e,e=r;break a}n(e,u);break}t(e,u),u=u.sibling}a.type===z?((r=s1(a.props.children,e.mode,s,a.key)).return=e,e=r):((s=sQ(a.type,a.key,a.props,null,e.mode,s)).ref=aa(e,r,a),s.return=e,e=s)}return o(e);case $:a:{for(u=a.key;null!==r;){if(r.key===u){if(4===r.tag&&r.stateNode.containerInfo===a.containerInfo&&r.stateNode.implementation===a.implementation){n(e,r.sibling),(r=i(r,a.children||[],s)).return=e,e=r;break a}n(e,r);break}t(e,r),r=r.sibling}(r=s2(a,e.mode,s)).return=e,e=r}return o(e)}if("string"==typeof a||"number"==typeof a)return a=""+a,null!==r&&6===r.tag?(n(e,r.sibling),(r=i(r,a,s)).return=e,e=r):(n(e,r),(r=s0(a,e.mode,s)).return=e,e=r),o(e);if(ai(a))return b(e,r,a,s);if(en(a))return m(e,r,a,s);if(c&&ao(e,a),void 0===a&&!u)switch(e.tag){case 1:case 0:throw Error(f(152,(e=e.type).displayName||e.name||"Component"))}return n(e,r)}}var au=as(!0),ac=as(!1),al={},af={current:al},ad={current:al},ah={current:al};function ap(e){if(e===al)throw Error(f(174));return e}function ab(e,t){r4(ah,t,e),r4(ad,e,e),r4(af,al,e);var n=t.nodeType;switch(n){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:eJ(null,"");break;default:t=eJ(t=(n=8===n?t.parentNode:t).namespaceURI||null,n=n.tagName)}r3(af,e),r4(af,t,e)}function am(e){r3(af,e),r3(ad,e),r3(ah,e)}function ag(e){ap(ah.current);var t=ap(af.current),n=eJ(t,e.type);t!==n&&(r4(ad,e,e),r4(af,n,e))}function av(e){ad.current===e&&(r3(af,e),r3(ad,e))}var ay={current:0};function aw(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||n.data===nV||n.data===nq))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(0!=(64&t.effectTag))return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}function a_(e,t){return{responder:e,props:t}}var aE=Y.ReactCurrentDispatcher,aS=Y.ReactCurrentBatchConfig,ak=0,ax=null,aT=null,aM=null,aO=null,aA=null,aL=null,aC=0,aI=null,aD=0,aN=!1,aP=null,aR=0;function aj(){throw Error(f(321))}function aF(e,t){if(null===t)return!1;for(var n=0;naC&&sL(aC=l)):(sA(l,u.suspenseConfig),a=u.eagerReducer===e?u.eagerState:e(a,u.action)),o=u,u=u.next}while(null!==u&&u!==r)c||(s=o,i=a),r$(a,t.memoizedState)||(oo=!0),t.memoizedState=a,t.baseUpdate=s,t.baseState=i,n.lastRenderedState=a}return[t.memoizedState,n.dispatch]}function aG(e){var t=aU();return"function"==typeof e&&(e=e()),t.memoizedState=t.baseState=e,e=(e=t.queue={last:null,dispatch:null,lastRenderedReducer:a$,lastRenderedState:e}).dispatch=a2.bind(null,ax,e),[t.memoizedState,e]}function aW(e){return az(a$,e)}function aK(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},null===aI?(aI={lastEffect:null}).lastEffect=e.next=e:null===(t=aI.lastEffect)?aI.lastEffect=e.next=e:(n=t.next,t.next=e,e.next=n,aI.lastEffect=e),e}function aV(e,t,n,r){var i=aU();aD|=e,i.memoizedState=aK(t,n,void 0,void 0===r?null:r)}function aq(e,t,n,r){var i=aH();r=void 0===r?null:r;var a=void 0;if(null!==aT){var o=aT.memoizedState;if(a=o.destroy,null!==r&&aF(r,o.deps)){aK(0,n,a,r);return}}aD|=e,i.memoizedState=aK(t,n,a,r)}function aZ(e,t){return aV(516,192,e,t)}function aX(e,t){return aq(516,192,e,t)}function aJ(e,t){return"function"==typeof t?(t(e=e()),function(){t(null)}):null!=t?(e=e(),t.current=e,function(){t.current=null}):void 0}function aQ(){}function a1(e,t){return aU().memoizedState=[e,void 0===t?null:t],e}function a0(e,t){var n=aH();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&aF(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function a2(e,t,n){if(!(25>aR))throw Error(f(301));var r=e.alternate;if(e===ax||null!==r&&r===ax){if(aN=!0,e={expirationTime:ak,suspenseConfig:null,action:n,eagerReducer:null,eagerState:null,next:null},null===aP&&(aP=new Map),void 0===(n=aP.get(t)))aP.set(t,e);else{for(t=n;null!==t.next;)t=t.next;t.next=e}}else{var i=sb(),a=i5.suspense;a={expirationTime:i=sm(i,e,a),suspenseConfig:a,action:n,eagerReducer:null,eagerState:null,next:null};var o=t.last;if(null===o)a.next=a;else{var s=o.next;null!==s&&(a.next=s),o.next=a}if(t.last=a,0===e.expirationTime&&(null===r||0===r.expirationTime)&&null!==(r=t.lastRenderedReducer))try{var u=t.lastRenderedState,c=r(u,n);if(a.eagerReducer=r,a.eagerState=c,r$(c,u))return}catch(l){}finally{}sg(e,i)}}var a3={readContext:iK,useCallback:aj,useContext:aj,useEffect:aj,useImperativeHandle:aj,useLayoutEffect:aj,useMemo:aj,useReducer:aj,useRef:aj,useState:aj,useDebugValue:aj,useResponder:aj,useDeferredValue:aj,useTransition:aj},a4={readContext:iK,useCallback:a1,useContext:iK,useEffect:aZ,useImperativeHandle:function(e,t,n){return n=null!=n?n.concat([e]):null,aV(4,36,aJ.bind(null,t,e),n)},useLayoutEffect:function(e,t){return aV(4,36,e,t)},useMemo:function(e,t){var n=aU();return t=void 0===t?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=aU();return t=void 0!==n?n(t):t,r.memoizedState=r.baseState=t,e=(e=r.queue={last:null,dispatch:null,lastRenderedReducer:e,lastRenderedState:t}).dispatch=a2.bind(null,ax,e),[r.memoizedState,e]},useRef:function(e){var t=aU();return e={current:e},t.memoizedState=e},useState:aG,useDebugValue:aQ,useResponder:a_,useDeferredValue:function(e,t){var n=aG(e),r=n[0],i=n[1];return aZ(function(){l.unstable_next(function(){var n=aS.suspense;aS.suspense=void 0===t?null:t;try{i(e)}finally{aS.suspense=n}})},[e,t]),r},useTransition:function(e){var t=aG(!1),n=t[0],r=t[1];return[a1(function(t){r(!0),l.unstable_next(function(){var n=aS.suspense;aS.suspense=void 0===e?null:e;try{r(!1),t()}finally{aS.suspense=n}})},[e,n]),n]}},a6={readContext:iK,useCallback:a0,useContext:iK,useEffect:aX,useImperativeHandle:function(e,t,n){return n=null!=n?n.concat([e]):null,aq(4,36,aJ.bind(null,t,e),n)},useLayoutEffect:function(e,t){return aq(4,36,e,t)},useMemo:function(e,t){var n=aH();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&aF(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)},useReducer:az,useRef:function(){return aH().memoizedState},useState:aW,useDebugValue:aQ,useResponder:a_,useDeferredValue:function(e,t){var n=aW(e),r=n[0],i=n[1];return aX(function(){l.unstable_next(function(){var n=aS.suspense;aS.suspense=void 0===t?null:t;try{i(e)}finally{aS.suspense=n}})},[e,t]),r},useTransition:function(e){var t=aW(!1),n=t[0],r=t[1];return[a0(function(t){r(!0),l.unstable_next(function(){var n=aS.suspense;aS.suspense=void 0===e?null:e;try{r(!1),t()}finally{aS.suspense=n}})},[e,n]),n]}},a5=null,a8=null,a9=!1;function a7(e,t){var n=sq(5,null,null,0);n.elementType="DELETED",n.type="DELETED",n.stateNode=t,n.return=e,n.effectTag=8,null!==e.lastEffect?(e.lastEffect.nextEffect=n,e.lastEffect=n):e.firstEffect=e.lastEffect=n}function oe(e,t){switch(e.tag){case 5:var n=e.type;return null!==(t=1!==t.nodeType||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t)&&(e.stateNode=t,!0);case 6:return null!==(t=""===e.pendingProps||3!==t.nodeType?null:t)&&(e.stateNode=t,!0);default:return!1}}function ot(e){if(a9){var t=a8;if(t){var n=t;if(!oe(e,t)){if(!(t=n2(n.nextSibling))||!oe(e,t)){e.effectTag=-1025&e.effectTag|2,a9=!1,a5=e;return}a7(a5,n)}a5=e,a8=n2(t.firstChild)}else e.effectTag=-1025&e.effectTag|2,a9=!1,a5=e}}function on(e){for(e=e.return;null!==e&&5!==e.tag&&3!==e.tag&&13!==e.tag;)e=e.return;a5=e}function or(e){if(e!==a5)return!1;if(!a9)return on(e),a9=!0,!1;var t=e.type;if(5!==e.tag||"head"!==t&&"body"!==t&&!nQ(t,e.memoizedProps))for(t=a8;t;)a7(e,t),t=n2(t.nextSibling);if(on(e),13===e.tag){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(f(317));a:{for(t=0,e=e.nextSibling;e;){if(8===e.nodeType){var n=e.data;if(n===nK){if(0===t){a8=n2(e.nextSibling);break a}t--}else n!==nW&&n!==nq&&n!==nV||t++}e=e.nextSibling}a8=null}}else a8=a5?n2(e.stateNode.nextSibling):null;return!0}function oi(){a8=a5=null,a9=!1}var oa=Y.ReactCurrentOwner,oo=!1;function os(e,t,n,r){t.child=null===e?ac(t,null,n,r):au(t,e.child,n,r)}function ou(e,t,n,r,i){n=n.render;var a=t.ref;return(iW(t,i),r=aY(e,t,n,r,a,i),null===e||oo)?(t.effectTag|=1,os(e,t,r,i),t.child):(t.updateQueue=e.updateQueue,t.effectTag&=-517,e.expirationTime<=i&&(e.expirationTime=0),o_(e,t,i))}function oc(e,t,n,r,i,a){if(null===e){var o=n.type;return"function"!=typeof o||sZ(o)||void 0!==o.defaultProps||null!==n.compare||void 0!==n.defaultProps?((e=sQ(n.type,null,r,null,t.mode,a)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=o,ol(e,t,o,r,i,a))}return(o=e.child,it)&&sf.set(e,t))}}function sv(e,t){e.expirationTime(e=e.nextKnownPendingLevel)?t:e:t}function sw(e){if(0!==e.lastExpiredTime)e.callbackExpirationTime=1073741823,e.callbackPriority=99,e.callbackNode=iI(sE.bind(null,e));else{var t=sy(e),n=e.callbackNode;if(0===t)null!==n&&(e.callbackNode=null,e.callbackExpirationTime=0,e.callbackPriority=90);else{var r=sb();if(r=1073741823===t?99:1===t||2===t?95:0>=(r=10*(1073741821-t)-10*(1073741821-r))?99:250>=r?98:5250>=r?97:95,null!==n){var i=e.callbackPriority;if(e.callbackExpirationTime===t&&i>=r)return;n!==i_&&il(n)}e.callbackExpirationTime=t,e.callbackPriority=r,t=1073741823===t?iI(sE.bind(null,e)):iC(r,s_.bind(null,e),{timeout:10*(1073741821-t)-iM()}),e.callbackNode=t}}}function s_(e,t){if(sp=0,t)return t=sb(),s8(e,t),sw(e),null;var n=sy(e);if(0!==n){if(t=e.callbackNode,(o0&(oK|oV))!==oG)throw Error(f(327));if(sY(),e===o2&&n===o4||sT(e,n),null!==o3){var r=o0;o0|=oK;for(var i=sO(e);;)try{sI();break}catch(a){sM(e,a)}if(iH(),o0=r,o$.current=i,o6===oZ)throw t=o5,sT(e,n),s6(e,n),sw(e),t;if(null===o3)switch(i=e.finishedWork=e.current.alternate,e.finishedExpirationTime=n,o2=null,r=o6){case oq:case oZ:throw Error(f(345));case oX:s8(e,2=n){e.lastPingedTime=n,sT(e,n);break}}if(0!==(o=sy(e))&&o!==n)break;if(0!==r&&r!==n){e.lastPingedTime=r;break}e.timeoutHandle=n1(sR.bind(null,e),i);break}sR(e);break;case oQ:if(s6(e,n),n===(r=e.lastSuspendedTime)&&(e.nextKnownPendingLevel=sP(i)),st&&(0===(i=e.lastPingedTime)||i>=n)){e.lastPingedTime=n,sT(e,n);break}if(0!==(i=sy(e))&&i!==n)break;if(0!==r&&r!==n){e.lastPingedTime=r;break}if(1073741823!==o9?r=10*(1073741821-o9)-iM():1073741823===o8?r=0:(r=10*(1073741821-o8)-5e3,n=10*(1073741821-n)-(i=iM()),0>(r=i-r)&&(r=0),n<(r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*oH(r/1960))-r)&&(r=n)),10=(r=0|s.busyMinDurationMs)?r=0:(i=0|s.busyDelayMs,r=(o=iM()-(10*(1073741821-o)-(0|s.timeoutMs||5e3)))<=i?0:i+r-o),10 component higher in the tree to provide a loading indicator or placeholder to display."+ea(i))}o6!==o1&&(o6=oX),a=ox(a,i),c=r;do{switch(c.tag){case 3:s=a,c.effectTag|=4096,c.expirationTime=t;var g=oB(c,s,t);i1(c,g);break a;case 1:s=a;var v=c.type,y=c.stateNode;if(0==(64&c.effectTag)&&("function"==typeof v.getDerivedStateFromError||null!==y&&"function"==typeof y.componentDidCatch&&(null===ss||!ss.has(y)))){c.effectTag|=4096,c.expirationTime=t;var w=oU(c,s,t);i1(c,w);break a}}c=c.return}while(null!==c)}o3=sN(o3)}catch(_){t=_;continue}break}}function sO(){var e=o$.current;return o$.current=a3,null===e?a3:e}function sA(e,t){ese&&(se=e)}function sC(){for(;null!==o3;)o3=sD(o3)}function sI(){for(;null!==o3&&!id();)o3=sD(o3)}function sD(e){var t=s(e.alternate,e,o4);return e.memoizedProps=e.pendingProps,null===t&&(t=sN(e)),oz.current=null,t}function sN(e){o3=e;do{var t=o3.alternate;if(e=o3.return,0==(2048&o3.effectTag)){a:{var n=t;t=o3;var s=o4,u=t.pendingProps;switch(t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:case 20:case 21:break;case 1:case 17:ie(t.type)&&it(t);break;case 3:am(t),ir(t),(u=t.stateNode).pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(null===n||null===n.child)&&or(t)&&oE(t),i(t);break;case 5:av(t),s=ap(ah.current);var l=t.type;if(null!==n&&null!=t.stateNode)a(n,t,l,u,s),n.ref!==t.ref&&(t.effectTag|=128);else if(u){var d=ap(af.current);if(or(t)){var h=(u=t).stateNode;n=u.type;var p=u.memoizedProps,b=s;switch(h[n6]=u,h[n5]=p,l=void 0,s=h,n){case"iframe":case"object":case"embed":nw("load",s);break;case"video":case"audio":for(h=0;h",h=p.removeChild(p.firstChild)):"string"==typeof p.is?h=h.createElement(b,{is:p.is}):(h=h.createElement(b),"select"===b&&(b=h,p.multiple?b.multiple=!0:p.size&&(b.size=p.size))):h=h.createElementNS(d,b),(p=h)[n6]=n,p[n5]=u,r(p,t,!1,!1),t.stateNode=p,b=l;var m=s,g=nj(b,n=u);switch(b){case"iframe":case"object":case"embed":nw("load",p),s=n;break;case"video":case"audio":for(s=0;su.tailExpiration&&1l&&(l=n),p>l&&(l=p),s=s.sibling;u.childExpirationTime=l}if(null!==t)return t;null!==e&&0==(2048&e.effectTag)&&(null===e.firstEffect&&(e.firstEffect=o3.firstEffect),null!==o3.lastEffect&&(null!==e.lastEffect&&(e.lastEffect.nextEffect=o3.firstEffect),e.lastEffect=o3.lastEffect),1(e=e.childExpirationTime)?t:e}function sR(e){var t=iO();return iL(99,sj.bind(null,e,t)),null}function sj(e,t){do sY();while(null!==sc)if((o0&(oK|oV))!==oG)throw Error(f(327));var n=e.finishedWork,r=e.finishedExpirationTime;if(null===n)return null;if(e.finishedWork=null,e.finishedExpirationTime=0,n===e.current)throw Error(f(177));e.callbackNode=null,e.callbackExpirationTime=0,e.callbackPriority=90,e.nextKnownPendingLevel=0;var i=sP(n);if(e.firstPendingTime=i,r<=e.lastSuspendedTime?e.firstSuspendedTime=e.lastSuspendedTime=e.nextKnownPendingLevel=0:r<=e.firstSuspendedTime&&(e.firstSuspendedTime=r-1),r<=e.lastPingedTime&&(e.lastPingedTime=0),r<=e.lastExpiredTime&&(e.lastExpiredTime=0),e===o2&&(o3=o2=null,o4=0),1s&&(l=s,s=o,o=l),l=nH(E,o),d=nH(E,s),l&&d&&(1!==k.rangeCount||k.anchorNode!==l.node||k.anchorOffset!==l.offset||k.focusNode!==d.node||k.focusOffset!==d.offset)&&((S=S.createRange()).setStart(l.node,l.offset),k.removeAllRanges(),o>s?(k.addRange(S),k.extend(d.node,d.offset)):(S.setEnd(d.node,d.offset),k.addRange(S))))),S=[],k=E;k=k.parentNode;)1===k.nodeType&&S.push({element:k,left:k.scrollLeft,top:k.scrollTop});for("function"==typeof E.focus&&E.focus(),E=0;E=n)return og(e,t,n);return r4(ay,1&ay.current,t),null!==(t=o_(e,t,n))?t.sibling:null}r4(ay,1&ay.current,t);break;case 19:if(r=t.childExpirationTime>=n,0!=(64&e.effectTag)){if(r)return ow(e,t,n);t.effectTag|=64}if(null!==(i=t.memoizedState)&&(i.rendering=null,i.tail=null),r4(ay,ay.current,t),!r)return null}return o_(e,t,n)}oo=!1}}else oo=!1;switch(t.expirationTime=0,t.tag){case 2:if(r=t.type,null!==e&&(e.alternate=null,t.alternate=null,t.effectTag|=2),e=t.pendingProps,i=r7(t,r5.current),iW(t,n),i=aY(null,t,r,e,i,n),t.effectTag|=1,"object"==typeof i&&null!==i&&"function"==typeof i.render&&void 0===i.$$typeof){if(t.tag=1,aB(),ie(r)){var a=!0;io(t)}else a=!1;t.memoizedState=null!==i.state&&void 0!==i.state?i.state:null;var o=r.getDerivedStateFromProps;"function"==typeof o&&i9(t,r,o,e),i.updater=i7,t.stateNode=i,i._reactInternalFiber=t,ar(t,r,e,n),t=op(null,t,r,!0,a,n)}else t.tag=0,os(null,t,i,n),t=t.child;return t;case 16:if(i=t.elementType,null!==e&&(e.alternate=null,t.alternate=null,t.effectTag|=2),e=t.pendingProps,er(i),1!==i._status)throw i._result;switch(i=i._result,t.type=i,a=t.tag=sX(i),e=ij(i,e),a){case 0:t=od(null,t,i,e,n);break;case 1:t=oh(null,t,i,e,n);break;case 11:t=ou(null,t,i,e,n);break;case 14:t=oc(null,t,i,ij(i.type,e),r,n);break;default:throw Error(f(306,i,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:ij(r,i),od(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:ij(r,i),oh(e,t,r,i,n);case 3:if(ob(t),null===(r=t.updateQueue))throw Error(f(282));if(i=null!==(i=t.memoizedState)?i.element:null,i3(t,r,t.pendingProps,null,n),(r=t.memoizedState.element)===i)oi(),t=o_(e,t,n);else{if((i=t.stateNode.hydrate)&&(a8=n2(t.stateNode.containerInfo.firstChild),a5=t,i=a9=!0),i)for(n=ac(t,null,r,n),t.child=n;n;)n.effectTag=-3&n.effectTag|1024,n=n.sibling;else os(e,t,r,n),oi();t=t.child}return t;case 5:return ag(t),null===e&&ot(t),r=t.type,i=t.pendingProps,a=null!==e?e.memoizedProps:null,o=i.children,nQ(r,i)?o=null:null!==a&&nQ(r,a)&&(t.effectTag|=16),of(e,t),4&t.mode&&1!==n&&i.hidden?(t.expirationTime=t.childExpirationTime=1,t=null):(os(e,t,o,n),t=t.child),t;case 6:return null===e&&ot(t),null;case 13:return og(e,t,n);case 4:return ab(t,t.stateNode.containerInfo),r=t.pendingProps,null===e?t.child=au(t,null,r,n):os(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:ij(r,i),ou(e,t,r,i,n);case 7:return os(e,t,t.pendingProps,n),t.child;case 8:case 12:return os(e,t,t.pendingProps.children,n),t.child;case 10:a:{if(r=t.type._context,i=t.pendingProps,o=t.memoizedProps,i$(t,a=i.value),null!==o){var s=o.value;if(0==(a=r$(s,a)?0:("function"==typeof r._calculateChangedBits?r._calculateChangedBits(s,a):1073741823)|0)){if(o.children===i.children&&!r8.current){t=o_(e,t,n);break a}}else for(null!==(s=t.child)&&(s.return=t);null!==s;){var u=s.dependencies;if(null!==u){o=s.child;for(var c=u.firstContext;null!==c;){if(c.context===r&&0!=(c.observedBits&a)){1===s.tag&&((c=iX(n,null)).tag=2,iQ(s,c)),s.expirationTime=t&&e<=t}function s6(e,t){var n=e.firstSuspendedTime,r=e.lastSuspendedTime;nt||0===n)&&(e.lastSuspendedTime=t),t<=e.lastPingedTime&&(e.lastPingedTime=0),t<=e.lastExpiredTime&&(e.lastExpiredTime=0)}function s5(e,t){t>e.firstPendingTime&&(e.firstPendingTime=t);var n=e.firstSuspendedTime;0!==n&&(t>=n?e.firstSuspendedTime=e.lastSuspendedTime=e.nextKnownPendingLevel=0:t>=e.lastSuspendedTime&&(e.lastSuspendedTime=t+1),t>e.nextKnownPendingLevel&&(e.nextKnownPendingLevel=t))}function s8(e,t){var n=e.lastExpiredTime;(0===n||n>t)&&(e.lastExpiredTime=t)}function s9(e,t,n,r){var i=t.current,a=sb(),o=i5.suspense;a=sm(a,i,o);a:if(n){n=n._reactInternalFiber;b:{if(tr(n)!==n||1!==n.tag)throw Error(f(170));var s=n;do{switch(s.tag){case 3:s=s.stateNode.context;break b;case 1:if(ie(s.type)){s=s.stateNode.__reactInternalMemoizedMergedChildContext;break b}}s=s.return}while(null!==s)throw Error(f(171))}if(1===n.tag){var u=n.type;if(ie(u)){n=ia(n,u,s);break a}}n=s}else n=r6;return null===t.context?t.context=n:t.pendingContext=n,(t=iX(a,o)).payload={element:e},null!==(r=void 0===r?null:r)&&(t.callback=r),iQ(i,t),sg(i,a),a}function s7(e){return(e=e.current).child?(e.child.tag,e.child.stateNode):null}function ue(e,t){null!==(e=e.memoizedState)&&null!==e.dehydrated&&e.retryTime1&&void 0!==arguments[1]?arguments[1]:this.props,n=t.target;if(n){var r=n;"string"==typeof n&&(r=window[n]),_(t,e.bind(null,r))}}},{key:"render",value:function(){return this.props.children||null}}]),t}(h.PureComponent);S.propTypes={},t.withOptions=E,t.default=S},69590(e){"use strict";var t=Array.isArray,n=Object.keys,r=Object.prototype.hasOwnProperty,i="undefined"!=typeof Element;function a(e,o){if(e===o)return!0;if(e&&o&&"object"==typeof e&&"object"==typeof o){var s,u,c,l=t(e),f=t(o);if(l&&f){if((u=e.length)!=o.length)return!1;for(s=u;0!=s--;)if(!a(e[s],o[s]))return!1;return!0}if(l!=f)return!1;var d=e instanceof Date,h=o instanceof Date;if(d!=h)return!1;if(d&&h)return e.getTime()==o.getTime();var p=e instanceof RegExp,b=o instanceof RegExp;if(p!=b)return!1;if(p&&b)return e.toString()==o.toString();var m=n(e);if((u=m.length)!==n(o).length)return!1;for(s=u;0!=s--;)if(!r.call(o,m[s]))return!1;if(i&&e instanceof Element&&o instanceof Element)return e===o;for(s=u;0!=s--;)if(("_owner"!==(c=m[s])||!e.$$typeof)&&!a(e[c],o[c]))return!1;return!0}return e!=e&&o!=o}e.exports=function(e,t){try{return a(e,t)}catch(n){if(n.message&&n.message.match(/stack|recursion/i)||-2146828260===n.number)return console.warn("Warning: react-fast-compare does not handle circular references.",n.name,n.message),!1;throw n}}},57209(e,t,n){"use strict";function r(e){return e&&"object"==typeof e&&"default"in e?e.default:e}i={value:!0};var i,a=r(n(67294));function o(e){return o.warnAboutHMRDisabled&&(o.warnAboutHMRDisabled=!0,console.error("React-Hot-Loader: misconfiguration detected, using production version in non-production environment."),console.error("React-Hot-Loader: Hot Module Replacement is not enabled.")),a.Children.only(e.children)}o.warnAboutHMRDisabled=!1;var s=function e(){return e.shouldWrapWithAppContainer?function(e){return function(t){return a.createElement(o,null,a.createElement(e,t))}}:function(e){return e}};s.shouldWrapWithAppContainer=!1;var u=function(e,t){return e===t},c=function(){},l=function(e){return e},f=function(){};t.zj=o,t.wU=s,i=u,i=c,i=l,i=f},69921(e,t){"use strict";/** @license React v16.13.1 + * react-is.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ var n="function"==typeof Symbol&&Symbol.for,r=n?Symbol.for("react.element"):60103,i=n?Symbol.for("react.portal"):60106,a=n?Symbol.for("react.fragment"):60107,o=n?Symbol.for("react.strict_mode"):60108,s=n?Symbol.for("react.profiler"):60114,u=n?Symbol.for("react.provider"):60109,c=n?Symbol.for("react.context"):60110,l=n?Symbol.for("react.async_mode"):60111,f=n?Symbol.for("react.concurrent_mode"):60111,d=n?Symbol.for("react.forward_ref"):60112,h=n?Symbol.for("react.suspense"):60113,p=n?Symbol.for("react.suspense_list"):60120,b=n?Symbol.for("react.memo"):60115,m=n?Symbol.for("react.lazy"):60116,g=n?Symbol.for("react.block"):60121,v=n?Symbol.for("react.fundamental"):60117,y=n?Symbol.for("react.responder"):60118,w=n?Symbol.for("react.scope"):60119;function _(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case l:case f:case a:case s:case o:case h:return e;default:switch(e=e&&e.$$typeof){case c:case d:case m:case b:case u:return e;default:return t}}case i:return t}}}function E(e){return _(e)===f}t.AsyncMode=l,t.ConcurrentMode=f,t.ContextConsumer=c,t.ContextProvider=u,t.Element=r,t.ForwardRef=d,t.Fragment=a,t.Lazy=m,t.Memo=b,t.Portal=i,t.Profiler=s,t.StrictMode=o,t.Suspense=h,t.isAsyncMode=function(e){return E(e)||_(e)===l},t.isConcurrentMode=E,t.isContextConsumer=function(e){return _(e)===c},t.isContextProvider=function(e){return _(e)===u},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return _(e)===d},t.isFragment=function(e){return _(e)===a},t.isLazy=function(e){return _(e)===m},t.isMemo=function(e){return _(e)===b},t.isPortal=function(e){return _(e)===i},t.isProfiler=function(e){return _(e)===s},t.isStrictMode=function(e){return _(e)===o},t.isSuspense=function(e){return _(e)===h},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===a||e===f||e===s||e===o||e===h||e===p||"object"==typeof e&&null!==e&&(e.$$typeof===m||e.$$typeof===b||e.$$typeof===u||e.$$typeof===c||e.$$typeof===d||e.$$typeof===v||e.$$typeof===y||e.$$typeof===w||e.$$typeof===g)},t.typeOf=_},59864(e,t,n){"use strict";e.exports=n(69921)},46871(e,t,n){"use strict";function r(){var e=this.constructor.getDerivedStateFromProps(this.props,this.state);null!=e&&this.setState(e)}function i(e){function t(t){var n=this.constructor.getDerivedStateFromProps(e,t);return null!=n?n:null}this.setState(t.bind(this))}function a(e,t){try{var n=this.props,r=this.state;this.props=e,this.state=t,this.__reactInternalSnapshotFlag=!0,this.__reactInternalSnapshot=this.getSnapshotBeforeUpdate(n,r)}finally{this.props=n,this.state=r}}function o(e){var t,n=e.prototype;if(!n||!n.isReactComponent)throw Error("Can only polyfill class components");if("function"!=typeof e.getDerivedStateFromProps&&"function"!=typeof n.getSnapshotBeforeUpdate)return e;var o=null,s=null,u=null;if("function"==typeof n.componentWillMount?o="componentWillMount":"function"==typeof n.UNSAFE_componentWillMount&&(o="UNSAFE_componentWillMount"),"function"==typeof n.componentWillReceiveProps?s="componentWillReceiveProps":"function"==typeof n.UNSAFE_componentWillReceiveProps&&(s="UNSAFE_componentWillReceiveProps"),"function"==typeof n.componentWillUpdate?u="componentWillUpdate":"function"==typeof n.UNSAFE_componentWillUpdate&&(u="UNSAFE_componentWillUpdate"),null!==o||null!==s||null!==u){throw Error("Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n"+(e.displayName||e.name)+" uses "+("function"==typeof e.getDerivedStateFromProps?"getDerivedStateFromProps()":"getSnapshotBeforeUpdate()")+" but also contains the following legacy lifecycles:"+(null!==o?"\n "+o:"")+(null!==s?"\n "+s:"")+(null!==u?"\n "+u:"")+"\n\nThe above lifecycles should be removed. Learn more about this warning here:\nhttps://fb.me/react-async-component-lifecycle-hooks")}if("function"==typeof e.getDerivedStateFromProps&&(n.componentWillMount=r,n.componentWillReceiveProps=i),"function"==typeof n.getSnapshotBeforeUpdate){if("function"!=typeof n.componentDidUpdate)throw Error("Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype");n.componentWillUpdate=a;var c=n.componentDidUpdate;n.componentDidUpdate=function(e,t,n){var r=this.__reactInternalSnapshotFlag?this.__reactInternalSnapshot:n;c.call(this,e,t,r)}}return e}n.r(t),n.d(t,{polyfill:()=>o}),r.__suppressDeprecationWarning=!0,i.__suppressDeprecationWarning=!0,a.__suppressDeprecationWarning=!0},37703(e,t,n){"use strict";n.d(t,{zt:()=>h,$j:()=>J,wU:()=>A,I0:()=>er,v9:()=>es});var r=n(67294),i=r.createContext(null);function a(e){e()}var o=a,s=function(e){return o=e},u=function(){return o},c={notify:function(){}};function l(){var e=u(),t=null,n=null;return{clear:function(){t=null,n=null},notify:function(){e(function(){for(var e=t;e;)e.callback(),e=e.next})},get:function(){for(var e=[],n=t;n;)e.push(n),n=n.next;return e},subscribe:function(e){var r=!0,i=n={callback:e,next:null,prev:n};return i.prev?i.prev.next=i:t=i,function(){r&&null!==t&&(r=!1,i.next?i.next.prev=i.prev:n=i.prev,i.prev?i.prev.next=i.next:t=i.next)}}}}var f=function(){function e(e,t){this.store=e,this.parentSub=t,this.unsubscribe=null,this.listeners=c,this.handleChangeWrapper=this.handleChangeWrapper.bind(this)}var t=e.prototype;return t.addNestedSub=function(e){return this.trySubscribe(),this.listeners.subscribe(e)},t.notifyNestedSubs=function(){this.listeners.notify()},t.handleChangeWrapper=function(){this.onStateChange&&this.onStateChange()},t.isSubscribed=function(){return Boolean(this.unsubscribe)},t.trySubscribe=function(){this.unsubscribe||(this.unsubscribe=this.parentSub?this.parentSub.addNestedSub(this.handleChangeWrapper):this.store.subscribe(this.handleChangeWrapper),this.listeners=l())},t.tryUnsubscribe=function(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null,this.listeners.clear(),this.listeners=c)},e}();function d(e){var t=e.store,n=e.context,a=e.children,o=(0,r.useMemo)(function(){var e=new f(t);return e.onStateChange=e.notifyNestedSubs,{store:t,subscription:e}},[t]),s=(0,r.useMemo)(function(){return t.getState()},[t]);(0,r.useEffect)(function(){var e=o.subscription;return e.trySubscribe(),s!==t.getState()&&e.notifyNestedSubs(),function(){e.tryUnsubscribe(),e.onStateChange=null}},[o,s]);var u=n||i;return r.createElement(u.Provider,{value:o},a)}let h=d;var p=n(87462),b=n(63366),m=n(8679),g=n.n(m),v=n(59864),y="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?r.useLayoutEffect:r.useEffect,w=[],_=[null,null];function E(e,t){var n=e[1];return[t.payload,n+1]}function S(e,t,n){y(function(){return e.apply(void 0,t)},n)}function k(e,t,n,r,i,a,o){e.current=r,t.current=i,n.current=!1,a.current&&(a.current=null,o())}function x(e,t,n,r,i,a,o,s,u,c){if(e){var l,f=!1,d=null,h=function(){if(!f){var e,n,l=t.getState();try{e=r(l,i.current)}catch(h){n=h,d=h}n||(d=null),e===a.current?o.current||u():(a.current=e,s.current=e,o.current=!0,c({type:"STORE_UPDATED",payload:{error:n}}))}};return n.onStateChange=h,n.trySubscribe(),h(),function(){if(f=!0,n.tryUnsubscribe(),n.onStateChange=null,d)throw d}}}var T=function(){return[null,0]};function M(e,t){void 0===t&&(t={});var n=t,a=n.getDisplayName,o=void 0===a?function(e){return"ConnectAdvanced("+e+")"}:a,s=n.methodName,u=void 0===s?"connectAdvanced":s,c=n.renderCountProp,l=void 0===c?void 0:c,d=n.shouldHandleStateChanges,h=void 0===d||d,m=n.storeKey,y=void 0===m?"store":m,M=(n.withRef,n.forwardRef),O=void 0!==M&&M,A=n.context,L=void 0===A?i:A,C=(0,b.Z)(n,["getDisplayName","methodName","renderCountProp","shouldHandleStateChanges","storeKey","withRef","forwardRef","context"]),I=L;return function(t){var n=t.displayName||t.name||"Component",i=o(n),a=(0,p.Z)({},C,{getDisplayName:o,methodName:u,renderCountProp:l,shouldHandleStateChanges:h,storeKey:y,displayName:i,wrappedComponentName:n,WrappedComponent:t}),s=C.pure;function c(t){return e(t.dispatch,a)}var d=s?r.useMemo:function(e){return e()};function m(e){var n=(0,r.useMemo)(function(){var t=e.reactReduxForwardedRef,n=(0,b.Z)(e,["reactReduxForwardedRef"]);return[e.context,t,n]},[e]),i=n[0],a=n[1],o=n[2],s=(0,r.useMemo)(function(){return i&&i.Consumer&&(0,v.isContextConsumer)(r.createElement(i.Consumer,null))?i:I},[i,I]),u=(0,r.useContext)(s),l=Boolean(e.store)&&Boolean(e.store.getState)&&Boolean(e.store.dispatch);Boolean(u)&&u.store;var m=l?e.store:u.store,g=(0,r.useMemo)(function(){return c(m)},[m]),y=(0,r.useMemo)(function(){if(!h)return _;var e=new f(m,l?null:u.subscription),t=e.notifyNestedSubs.bind(e);return[e,t]},[m,l,u]),M=y[0],O=y[1],A=(0,r.useMemo)(function(){return l?u:(0,p.Z)({},u,{subscription:M})},[l,u,M]),L=(0,r.useReducer)(E,w,T),C=L[0][0],D=L[1];if(C&&C.error)throw C.error;var N=(0,r.useRef)(),P=(0,r.useRef)(o),R=(0,r.useRef)(),j=(0,r.useRef)(!1),F=d(function(){return R.current&&o===P.current?R.current:g(m.getState(),o)},[m,C,o]);S(k,[P,N,j,o,F,R,O]),S(x,[h,m,M,g,P,N,j,R,O,D],[m,M,g]);var Y=(0,r.useMemo)(function(){return r.createElement(t,(0,p.Z)({},F,{ref:a}))},[a,t,F]);return(0,r.useMemo)(function(){return h?r.createElement(s.Provider,{value:A},Y):Y},[s,Y,A])}var M=s?r.memo(m):m;if(M.WrappedComponent=t,M.displayName=i,O){var A=r.forwardRef(function(e,t){return r.createElement(M,(0,p.Z)({},e,{reactReduxForwardedRef:t}))});return A.displayName=i,A.WrappedComponent=t,g()(A,t)}return g()(M,t)}}function O(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}function A(e,t){if(O(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var i=0;i=0;r--){var i=t[r](e);if(i)return i}return function(t,r){throw Error("Invalid value of type "+typeof e+" for "+n+" argument when connecting component "+r.wrappedComponentName+".")}}function Z(e,t){return e===t}function X(e){var t=void 0===e?{}:e,n=t.connectHOC,r=void 0===n?M:n,i=t.mapStateToPropsFactories,a=void 0===i?B:i,o=t.mapDispatchToPropsFactories,s=void 0===o?j:o,u=t.mergePropsFactories,c=void 0===u?G:u,l=t.selectorFactory,f=void 0===l?V:l;return function(e,t,n,i){void 0===i&&(i={});var o=i,u=o.pure,l=void 0===u||u,d=o.areStatesEqual,h=void 0===d?Z:d,m=o.areOwnPropsEqual,g=void 0===m?A:m,v=o.areStatePropsEqual,y=void 0===v?A:v,w=o.areMergedPropsEqual,_=void 0===w?A:w,E=(0,b.Z)(o,["pure","areStatesEqual","areOwnPropsEqual","areStatePropsEqual","areMergedPropsEqual"]),S=q(e,a,"mapStateToProps"),k=q(t,s,"mapDispatchToProps"),x=q(n,c,"mergeProps");return r(f,(0,p.Z)({methodName:"connect",getDisplayName:function(e){return"Connect("+e+")"},shouldHandleStateChanges:Boolean(e),initMapStateToProps:S,initMapDispatchToProps:k,initMergeProps:x,pure:l,areStatesEqual:h,areOwnPropsEqual:g,areStatePropsEqual:y,areMergedPropsEqual:_},E))}}let J=X();function Q(){var e;return(0,r.useContext)(i)}function ee(e){void 0===e&&(e=i);var t=e===i?Q:function(){return(0,r.useContext)(e)};return function(){return t().store}}var et=ee();function en(e){void 0===e&&(e=i);var t=e===i?et:ee(e);return function(){return t().dispatch}}var er=en(),ei=function(e,t){return e===t};function ea(e,t,n,i){var a,o=(0,r.useReducer)(function(e){return e+1},0)[1],s=(0,r.useMemo)(function(){return new f(n,i)},[n,i]),u=(0,r.useRef)(),c=(0,r.useRef)(),l=(0,r.useRef)(),d=(0,r.useRef)(),h=n.getState();try{a=e!==c.current||h!==l.current||u.current?e(h):d.current}catch(p){throw u.current&&(p.message+="\nThe error may be correlated with this previous error:\n"+u.current.stack+"\n\n"),p}return y(function(){c.current=e,l.current=h,d.current=a,u.current=void 0}),y(function(){function e(){try{var e=c.current(n.getState());if(t(e,d.current))return;d.current=e}catch(r){u.current=r}o()}return s.onStateChange=e,s.trySubscribe(),e(),function(){return s.tryUnsubscribe()}},[n,s]),a}function eo(e){void 0===e&&(e=i);var t=e===i?Q:function(){return(0,r.useContext)(e)};return function(e,n){void 0===n&&(n=ei);var i,a=t(),o=ea(e,n,a.store,a.subscription);return(0,r.useDebugValue)(o),o}}var es=eo();s(n(73935).unstable_batchedUpdates)},73727(e,t,n){"use strict";n.d(t,{VK:()=>l,rU:()=>g});var r=n(5977),i=n(51721),a=n(67294),o=n(90071),s=n(87462),u=n(63366),c=n(2177),l=function(e){function t(){for(var t,n=arguments.length,r=Array(n),i=0;iC,AW:()=>F,F0:()=>k,rs:()=>B,s6:()=>S,LX:()=>R,k6:()=>H,TH:()=>$,UO:()=>z,$B:()=>G});var r=n(51721),i=n(67294),a=n(90071),o=n(45697),s=n.n(o),u=1073741823,c="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==n.g?n.g:{};function l(){var e="__global_unique_id__";return c[e]=(c[e]||0)+1}function f(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function d(e){var t=[];return{on:function(e){t.push(e)},off:function(e){t=t.filter(function(t){return t!==e})},get:function(){return e},set:function(n,r){e=n,t.forEach(function(t){return t(e,r)})}}}function h(e){return Array.isArray(e)?e[0]:e}function p(e,t){var n,a,o="__create-react-context-"+l()+"__",c=function(e){function n(){var t;return t=e.apply(this,arguments)||this,t.emitter=d(t.props.value),t}(0,r.Z)(n,e);var i=n.prototype;return i.getChildContext=function(){var e;return(e={})[o]=this.emitter,e},i.componentWillReceiveProps=function(e){if(this.props.value!==e.value){var n,r=this.props.value,i=e.value;f(r,i)?n=0:(n="function"==typeof t?t(r,i):u,0!=(n|=0)&&this.emitter.set(e.value,n))}},i.render=function(){return this.props.children},n}(i.Component);c.childContextTypes=((n={})[o]=s().object.isRequired,n);var p=function(t){function n(){var e;return e=t.apply(this,arguments)||this,e.state={value:e.getValue()},e.onUpdate=function(t,n){((0|e.observedBits)&n)!=0&&e.setState({value:e.getValue()})},e}(0,r.Z)(n,t);var i=n.prototype;return i.componentWillReceiveProps=function(e){var t=e.observedBits;this.observedBits=null==t?u:t},i.componentDidMount=function(){this.context[o]&&this.context[o].on(this.onUpdate);var e=this.props.observedBits;this.observedBits=null==e?u:e},i.componentWillUnmount=function(){this.context[o]&&this.context[o].off(this.onUpdate)},i.getValue=function(){return this.context[o]?this.context[o].get():e},i.render=function(){return h(this.props.children)(this.state.value)},n}(i.Component);return p.contextTypes=((a={})[o]=s().object,a),{Provider:c,Consumer:p}}var b=i.createContext||p;let m=b;var g=n(2177),v=n(87462),y=n(39658),w=n.n(y);n(59864),n(63366),n(8679);var _=function(e){var t=m();return t.displayName=e,t},E=_("Router-History"),S=_("Router"),k=function(e){function t(t){var n;return(n=e.call(this,t)||this).state={location:t.history.location},n._isMounted=!1,n._pendingLocation=null,t.staticContext||(n.unlisten=t.history.listen(function(e){n._isMounted?n.setState({location:e}):n._pendingLocation=e})),n}(0,r.Z)(t,e),t.computeRootMatch=function(e){return{path:"/",url:"/",params:{},isExact:"/"===e}};var n=t.prototype;return n.componentDidMount=function(){this._isMounted=!0,this._pendingLocation&&this.setState({location:this._pendingLocation})},n.componentWillUnmount=function(){this.unlisten&&(this.unlisten(),this._isMounted=!1,this._pendingLocation=null)},n.render=function(){return i.createElement(S.Provider,{value:{history:this.props.history,location:this.state.location,match:t.computeRootMatch(this.state.location.pathname),staticContext:this.props.staticContext}},i.createElement(E.Provider,{children:this.props.children||null,value:this.props.history}))},t}(i.Component);i.Component;var x=function(e){function t(){return e.apply(this,arguments)||this}(0,r.Z)(t,e);var n=t.prototype;return n.componentDidMount=function(){this.props.onMount&&this.props.onMount.call(this,this)},n.componentDidUpdate=function(e){this.props.onUpdate&&this.props.onUpdate.call(this,this,e)},n.componentWillUnmount=function(){this.props.onUnmount&&this.props.onUnmount.call(this,this)},n.render=function(){return null},t}(i.Component),T={},M=1e4,O=0;function A(e){if(T[e])return T[e];var t=w().compile(e);return O=0||(i[n]=e[n]);return i}function l(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}n(54726);var f="unmounted";t.UNMOUNTED=f;var d="exited";t.EXITED=d;var h="entering";t.ENTERING=h;var p="entered";t.ENTERED=p;var b="exiting";t.EXITING=b;var m=function(e){function t(t,n){r=e.call(this,t,n)||this;var r,i,a=n.transitionGroup,o=a&&!a.isMounting?t.enter:t.appear;return r.appearStatus=null,t.in?o?(i=d,r.appearStatus=h):i=p:i=t.unmountOnExit||t.mountOnEnter?f:d,r.state={status:i},r.nextCallback=null,r}l(t,e);var n=t.prototype;return n.getChildContext=function(){return{transitionGroup:null}},t.getDerivedStateFromProps=function(e,t){return e.in&&t.status===f?{status:d}:null},n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(e){var t=null;if(e!==this.props){var n=this.state.status;this.props.in?n!==h&&n!==p&&(t=h):(n===h||n===p)&&(t=b)}this.updateStatus(!1,t)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var e,t,n,r=this.props.timeout;return e=t=n=r,null!=r&&"number"!=typeof r&&(e=r.exit,t=r.enter,n=void 0!==r.appear?r.appear:t),{exit:e,enter:t,appear:n}},n.updateStatus=function(e,t){if(void 0===e&&(e=!1),null!==t){this.cancelNextCallback();var n=a.default.findDOMNode(this);t===h?this.performEnter(n,e):this.performExit(n)}else this.props.unmountOnExit&&this.state.status===d&&this.setState({status:f})},n.performEnter=function(e,t){var n=this,r=this.props.enter,i=this.context.transitionGroup?this.context.transitionGroup.isMounting:t,a=this.getTimeouts(),o=i?a.appear:a.enter;if(!t&&!r){this.safeSetState({status:p},function(){n.props.onEntered(e)});return}this.props.onEnter(e,i),this.safeSetState({status:h},function(){n.props.onEntering(e,i),n.onTransitionEnd(e,o,function(){n.safeSetState({status:p},function(){n.props.onEntered(e,i)})})})},n.performExit=function(e){var t=this,n=this.props.exit,r=this.getTimeouts();if(!n){this.safeSetState({status:d},function(){t.props.onExited(e)});return}this.props.onExit(e),this.safeSetState({status:b},function(){t.props.onExiting(e),t.onTransitionEnd(e,r.exit,function(){t.safeSetState({status:d},function(){t.props.onExited(e)})})})},n.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},n.setNextCallback=function(e){var t=this,n=!0;return this.nextCallback=function(r){n&&(n=!1,t.nextCallback=null,e(r))},this.nextCallback.cancel=function(){n=!1},this.nextCallback},n.onTransitionEnd=function(e,t,n){this.setNextCallback(n);var r=null==t&&!this.props.addEndListener;if(!e||r){setTimeout(this.nextCallback,0);return}this.props.addEndListener&&this.props.addEndListener(e,this.nextCallback),null!=t&&setTimeout(this.nextCallback,t)},n.render=function(){var e=this.state.status;if(e===f)return null;var t=this.props,n=t.children,r=c(t,["children"]);if(delete r.in,delete r.mountOnEnter,delete r.unmountOnExit,delete r.appear,delete r.enter,delete r.exit,delete r.timeout,delete r.addEndListener,delete r.onEnter,delete r.onEntering,delete r.onEntered,delete r.onExit,delete r.onExiting,delete r.onExited,"function"==typeof n)return n(e,r);var a=i.default.Children.only(n);return i.default.cloneElement(a,r)},t}(i.default.Component);function g(){}m.contextTypes={transitionGroup:r.object},m.childContextTypes={transitionGroup:function(){}},m.propTypes={},m.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:g,onEntering:g,onEntered:g,onExit:g,onExiting:g,onExited:g},m.UNMOUNTED=0,m.EXITED=1,m.ENTERING=2,m.ENTERED=3,m.EXITING=4;var v=(0,o.polyfill)(m);t.default=v},92381(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r=s(n(45697)),i=s(n(67294)),a=n(46871),o=n(40537);function s(e){return e&&e.__esModule?e:{default:e}}function u(e,t){if(null==e)return{};var n,r,i={},a=Object.keys(e);for(r=0;r=0||(i[n]=e[n]);return i}function c(){return(c=Object.assign||function(e){for(var t=1;tI.length&&I.push(e)}function P(e,t,n,r){var i=typeof e;("undefined"===i||"boolean"===i)&&(e=null);var s=!1;if(null===e)s=!0;else switch(i){case"string":case"number":s=!0;break;case"object":switch(e.$$typeof){case a:case o:s=!0}}if(s)return n(r,e,""===t?"."+j(e,0):t),1;if(s=0,t=""===t?".":t+":",Array.isArray(e))for(var u=0;u2)?"one of ".concat(t," ").concat(e.slice(0,n-1).join(", "),", or ")+e[n-1]:2===n?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}function a(e,t,n){return e.substr(!n||n<0?0:+n,t.length)===t}function o(e,t,n){return(void 0===n||n>e.length)&&(n=e.length),e.substring(n-t.length,n)===t}function s(e,t,n){return"number"!=typeof n&&(n=0),!(n+t.length>e.length)&&-1!==e.indexOf(t,n)}r("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError),r("ERR_INVALID_ARG_TYPE",function(e,t,n){if("string"==typeof t&&a(t,"not ")?(r="must not be",t=t.replace(/^not /,"")):r="must be",o(e," argument"))u="The ".concat(e," ").concat(r," ").concat(i(t,"type"));else{var r,u,c=s(e,".")?"property":"argument";u='The "'.concat(e,'" ').concat(c," ").concat(r," ").concat(i(t,"type"))}return u+". Received type ".concat(typeof n)},TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"}),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"}),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.q=n},56753(e,t,n){"use strict";var r=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};e.exports=c;var i=n(79481),a=n(64229);n(35717)(c,i);for(var o=r(a.prototype),s=0;s0){if("string"==typeof t||u.objectMode||Object.getPrototypeOf(t)===a.prototype||(t=s(t)),r)u.endEmitted?S(e,new E):A(e,u,t,!0);else if(u.ended)S(e,new w);else{if(u.destroyed)return!1;u.reading=!1,u.decoder&&!n?(t=u.decoder.write(t),u.objectMode||0!==t.length?A(e,u,t,!1):j(e,u)):A(e,u,t,!1)}}else r||(u.reading=!1,j(e,u));return!u.ended&&(u.length=C?e=C:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function D(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=I(e)),e<=t.length)?e:t.ended?t.length:(t.needReadable=!0,0)}function N(e,t){if(f("onEofChunk"),!t.ended){if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,t.sync?P(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,R(e)))}}function P(e){var t=e._readableState;f("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(f("emitReadable",t.flowing),t.emittedReadable=!0,process.nextTick(R,e))}function R(e){var t=e._readableState;f("emitReadable_",t.destroyed,t.length,t.ended),!t.destroyed&&(t.length||t.ended)&&(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,z(e)}function j(e,t){t.readingMore||(t.readingMore=!0,process.nextTick(F,e,t))}function F(e,t){for(;!t.reading&&!t.ended&&(t.length0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function U(e){f("readable nexttick read 0"),e.read(0)}function H(e,t){t.resumeScheduled||(t.resumeScheduled=!0,process.nextTick($,e,t))}function $(e,t){f("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),z(e),t.flowing&&!t.reading&&e.read(0)}function z(e){var t=e._readableState;for(f("flow",t.flowing);t.flowing&&null!==e.read(););}function G(e,t){var n;return 0===t.length?null:(t.objectMode?n=t.buffer.shift():!e||e>=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):n=t.buffer.consume(e,t.decoder),n)}function W(e){var t=e._readableState;f("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,process.nextTick(K,t,e))}function K(e,t){if(f("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var n=t._writableState;(!n||n.autoDestroy&&n.finished)&&t.destroy()}}function V(e,t){for(var n=0,r=e.length;n=n.highWaterMark:n.length>0)||n.ended))return f("read: emitReadable",n.length,n.ended),0===n.length&&n.ended?W(this):P(this),null;if(0===(e=D(e,n))&&n.ended)return 0===n.length&&W(this),null;var i=n.needReadable;return f("need readable",i),(0===n.length||n.length-e0?G(e,n):null)?(n.needReadable=n.length<=n.highWaterMark,e=0):(n.length-=e,n.awaitDrain=0),0===n.length&&(n.ended||(n.needReadable=!0),r!==e&&n.ended&&W(this)),null!==t&&this.emit("data",t),t},M.prototype._read=function(e){S(this,new _("_read()"))},M.prototype.pipe=function(e,t){var n=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=e;break;case 1:i.pipes=[i.pipes,e];break;default:i.pipes.push(e)}i.pipesCount+=1,f("pipe count=%d opts=%j",i.pipesCount,t);var a=t&&!1===t.end||e===process.stdout||e===process.stderr?m:s;function o(e,t){f("onunpipe"),e===n&&t&&!1===t.hasUnpiped&&(t.hasUnpiped=!0,l())}function s(){f("onend"),e.end()}i.endEmitted?process.nextTick(a):n.once("end",a),e.on("unpipe",o);var u=Y(n);e.on("drain",u);var c=!1;function l(){f("cleanup"),e.removeListener("close",p),e.removeListener("finish",b),e.removeListener("drain",u),e.removeListener("error",h),e.removeListener("unpipe",o),n.removeListener("end",s),n.removeListener("end",m),n.removeListener("data",d),c=!0,i.awaitDrain&&(!e._writableState||e._writableState.needDrain)&&u()}function d(t){f("ondata");var r=e.write(t);f("dest.write",r),!1===r&&((1===i.pipesCount&&i.pipes===e||i.pipesCount>1&&-1!==V(i.pipes,e))&&!c&&(f("false write response, pause",i.awaitDrain),i.awaitDrain++),n.pause())}function h(t){f("onerror",t),m(),e.removeListener("error",h),0===r(e,"error")&&S(e,t)}function p(){e.removeListener("finish",b),m()}function b(){f("onfinish"),e.removeListener("close",p),m()}function m(){f("unpipe"),n.unpipe(e)}return n.on("data",d),x(e,"error",h),e.once("close",p),e.once("finish",b),e.emit("pipe",n),i.flowing||(f("pipe resume"),n.resume()),e},M.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,n)),this;if(!e){var r=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var a=0;a0,!1!==r.flowing&&this.resume()):"readable"!==e||r.endEmitted||r.readableListening||(r.readableListening=r.needReadable=!0,r.flowing=!1,r.emittedReadable=!1,f("on readable",r.length,r.reading),r.length?P(this):r.reading||process.nextTick(U,this)),n},M.prototype.addListener=M.prototype.on,M.prototype.removeListener=function(e,t){var n=i.prototype.removeListener.call(this,e,t);return"readable"===e&&process.nextTick(B,this),n},M.prototype.removeAllListeners=function(e){var t=i.prototype.removeAllListeners.apply(this,arguments);return("readable"===e||void 0===e)&&process.nextTick(B,this),t},M.prototype.resume=function(){var e=this._readableState;return e.flowing||(f("resume"),e.flowing=!e.readableListening,H(this,e)),e.paused=!1,this},M.prototype.pause=function(){return f("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(f("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},M.prototype.wrap=function(e){var t=this,n=this._readableState,r=!1;for(var i in e.on("end",function(){if(f("wrapped end"),n.decoder&&!n.ended){var e=n.decoder.end();e&&e.length&&t.push(e)}t.push(null)}),e.on("data",function(i){if(f("wrapped data"),n.decoder&&(i=n.decoder.write(i)),!n.objectMode||null!=i)(n.objectMode||i&&i.length)&&(t.push(i)||(r=!0,e.pause()))}),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var a=0;a-1))throw new E(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(T.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(T.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),T.prototype._write=function(e,t,n){n(new m("_write()"))},T.prototype._writev=null,T.prototype.end=function(e,t,n){var r=this._writableState;return"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||H(this,r,n),this},Object.defineProperty(T.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(T.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),T.prototype.destroy=d.destroy,T.prototype._undestroy=d.undestroy,T.prototype._destroy=function(e,t){t(e)}},45850(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var i,a=n(8610),o=Symbol("lastResolve"),s=Symbol("lastReject"),u=Symbol("error"),c=Symbol("ended"),l=Symbol("lastPromise"),f=Symbol("handlePromise"),d=Symbol("stream");function h(e,t){return{value:e,done:t}}function p(e){var t=e[o];if(null!==t){var n=e[d].read();null!==n&&(e[l]=null,e[o]=null,e[s]=null,t(h(n,!1)))}}function b(e){process.nextTick(p,e)}function m(e,t){return function(n,r){e.then(function(){if(t[c]){n(h(void 0,!0));return}t[f](n,r)},r)}}var g=Object.getPrototypeOf(function(){}),v=Object.setPrototypeOf((i={get stream(){return this[d]},next:function(){var e,t=this,n=this[u];if(null!==n)return Promise.reject(n);if(this[c])return Promise.resolve(h(void 0,!0));if(this[d].destroyed)return new Promise(function(e,n){process.nextTick(function(){t[u]?n(t[u]):e(h(void 0,!0))})});var r=this[l];if(r)e=new Promise(m(r,this));else{var i=this[d].read();if(null!==i)return Promise.resolve(h(i,!1));e=new Promise(this[f])}return this[l]=e,e}},r(i,Symbol.asyncIterator,function(){return this}),r(i,"return",function(){var e=this;return new Promise(function(t,n){e[d].destroy(null,function(e){if(e){n(e);return}t(h(void 0,!0))})})}),i),g),y=function(e){var t,n=Object.create(v,(r(t={},d,{value:e,writable:!0}),r(t,o,{value:null,writable:!0}),r(t,s,{value:null,writable:!0}),r(t,u,{value:null,writable:!0}),r(t,c,{value:e._readableState.endEmitted,writable:!0}),r(t,f,{value:function(e,t){var r=n[d].read();r?(n[l]=null,n[o]=null,n[s]=null,e(h(r,!1))):(n[o]=e,n[s]=t)},writable:!0}),t));return n[l]=null,a(e,function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=n[s];null!==t&&(n[l]=null,n[o]=null,n[s]=null,t(e)),n[u]=e;return}var r=n[o];null!==r&&(n[l]=null,n[o]=null,n[s]=null,r(h(void 0,!0))),n[c]=!0}),e.on("readable",b.bind(null,n)),n};e.exports=y},77086(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n}},{key:"concat",value:function(e){if(0===this.length)return c.alloc(0);for(var t=c.allocUnsafe(e>>>0),n=this.head,r=0;n;)d(n.data,t,r),r+=n.data.length,n=n.next;return t}},{key:"consume",value:function(e,t){var n;return ei.length?i.length:e;if(a===i.length?r+=i:r+=i.slice(0,e),0==(e-=a)){a===i.length?(++n,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(a));break}++n}return this.length-=n,r}},{key:"_getBuffer",value:function(e){var t=c.allocUnsafe(e),n=this.head,r=1;for(n.data.copy(t),e-=n.data.length;n=n.next;){var i=n.data,a=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,a),0==(e-=a)){a===i.length?(++r,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=i.slice(a));break}++r}return this.length-=r,t}},{key:f,value:function(e,t){return l(this,i({},t,{depth:0,customInspect:!1}))}}]),e}()},61195(e){"use strict";function t(e,t){var i=this,o=this._readableState&&this._readableState.destroyed,s=this._writableState&&this._writableState.destroyed;return o||s?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(a,this,e)):process.nextTick(a,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(e){!t&&e?i._writableState?i._writableState.errorEmitted?process.nextTick(r,i):(i._writableState.errorEmitted=!0,process.nextTick(n,i,e)):process.nextTick(n,i,e):t?(process.nextTick(r,i),t(e)):process.nextTick(r,i)}),this)}function n(e,t){a(e,t),r(e)}function r(e){(!e._writableState||e._writableState.emitClose)&&(!e._readableState||e._readableState.emitClose)&&e.emit("close")}function i(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function a(e,t){e.emit("error",t)}function o(e,t){var n=e._readableState,r=e._writableState;n&&n.autoDestroy||r&&r.autoDestroy?e.destroy(t):e.emit("error",t)}e.exports={destroy:t,undestroy:i,errorOrDestroy:o}},8610(e,t,n){"use strict";var r=n(94281).q.ERR_STREAM_PREMATURE_CLOSE;function i(e){var t=!1;return function(){if(!t){t=!0;for(var n=arguments.length,r=Array(n),i=0;i0,function(t){e||(e=t),t&&a.forEach(f),o||(a.forEach(f),i(e))})});return n.reduce(d)}e.exports=p},82457(e,t,n){"use strict";var r=n(94281).q.ERR_INVALID_OPT_VALUE;function i(e,t,n){return null!=e.highWaterMark?e.highWaterMark:t?e[n]:null}function a(e,t,n,a){var o=i(t,a,n);if(null!=o){if(!(isFinite(o)&&Math.floor(o)===o)||o<0){var s=a?n:"highWaterMark";throw new r(s,o)}return Math.floor(o)}return e.objectMode?16:16384}e.exports={getHighWaterMark:a}},22503(e,t,n){e.exports=n(17187).EventEmitter},61566(e,t){"use strict";t.__esModule=!0,t.default=void 0;var n=function(e){return"string"==typeof e?e:e?e.displayName||e.name||"Component":void 0};t.default=n},60375(e){"use strict";var t=Object.prototype.hasOwnProperty;function n(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}function r(e,r){if(n(e,r))return!0;if("object"!=typeof e||null===e||"object"!=typeof r||null===r)return!1;var i=Object.keys(e),a=Object.keys(r);if(i.length!==a.length)return!1;for(var o=0;og,DE:()=>b,UY:()=>h,qC:()=>m,MT:()=>f});var r=n(4942);function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function a(e){for(var t=1;t]?|>=?|\?=|[-+\/=])(?=\s)/,lookbehind:!0},"string-operator":{pattern:/(\s)&&?(?=\s)/,lookbehind:!0,alias:"keyword"},"token-operator":[{pattern:/(\w)(?:->?|=>|[~|{}])(?=\w)/,lookbehind:!0,alias:"punctuation"},{pattern:/[|{}]/,alias:"punctuation"}],punctuation:/[,.:()]/}}e.exports=t,t.displayName="abap",t.aliases=[]},68313(e){"use strict";function t(e){var t,n;n="(?:ALPHA|BIT|CHAR|CR|CRLF|CTL|DIGIT|DQUOTE|HEXDIG|HTAB|LF|LWSP|OCTET|SP|VCHAR|WSP)",(t=e).languages.abnf={comment:/;.*/,string:{pattern:/(?:%[is])?"[^"\n\r]*"/,greedy:!0,inside:{punctuation:/^%[is]/}},range:{pattern:/%(?:b[01]+-[01]+|d\d+-\d+|x[A-F\d]+-[A-F\d]+)/i,alias:"number"},terminal:{pattern:/%(?:b[01]+(?:\.[01]+)*|d\d+(?:\.\d+)*|x[A-F\d]+(?:\.[A-F\d]+)*)/i,alias:"number"},repetition:{pattern:/(^|[^\w-])(?:\d*\*\d*|\d+)/,lookbehind:!0,alias:"operator"},definition:{pattern:/(^[ \t]*)(?:[a-z][\w-]*|<[^<>\r\n]*>)(?=\s*=)/m,lookbehind:!0,alias:"keyword",inside:{punctuation:/<|>/}},"core-rule":{pattern:RegExp("(?:(^|[^<\\w-])"+n+"|<"+n+">)(?![\\w-])","i"),lookbehind:!0,alias:["rule","constant"],inside:{punctuation:/<|>/}},rule:{pattern:/(^|[^<\w-])[a-z][\w-]*|<[^<>\r\n]*>/i,lookbehind:!0,inside:{punctuation:/<|>/}},operator:/=\/?|\//,punctuation:/[()\[\]]/}}e.exports=t,t.displayName="abnf",t.aliases=[]},5199(e){"use strict";function t(e){e.languages.actionscript=e.languages.extend("javascript",{keyword:/\b(?:as|break|case|catch|class|const|default|delete|do|else|extends|finally|for|function|if|implements|import|in|instanceof|interface|internal|is|native|new|null|package|private|protected|public|return|super|switch|this|throw|try|typeof|use|var|void|while|with|dynamic|each|final|get|include|namespace|override|set|static)\b/,operator:/\+\+|--|(?:[+\-*\/%^]|&&?|\|\|?|<>?>?|[!=]=?)=?|[~?@]/}),e.languages.actionscript["class-name"].alias="function",e.languages.markup&&e.languages.insertBefore("actionscript","string",{xml:{pattern:/(^|[^.])<\/?\w+(?:\s+[^\s>\/=]+=("|')(?:\\[\s\S]|(?!\2)[^\\])*\2)*\s*\/?>/,lookbehind:!0,inside:e.languages.markup}})}e.exports=t,t.displayName="actionscript",t.aliases=[]},89693(e){"use strict";function t(e){e.languages.ada={comment:/--.*/,string:/"(?:""|[^"\r\f\n])*"/i,number:[{pattern:/\b\d(?:_?\d)*#[\dA-F](?:_?[\dA-F])*(?:\.[\dA-F](?:_?[\dA-F])*)?#(?:E[+-]?\d(?:_?\d)*)?/i},{pattern:/\b\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:E[+-]?\d(?:_?\d)*)?\b/i}],"attr-name":/\b'\w+/i,keyword:/\b(?:abort|abs|abstract|accept|access|aliased|all|and|array|at|begin|body|case|constant|declare|delay|delta|digits|do|else|new|return|elsif|end|entry|exception|exit|for|function|generic|goto|if|in|interface|is|limited|loop|mod|not|null|of|others|out|overriding|package|pragma|private|procedure|protected|raise|range|record|rem|renames|requeue|reverse|select|separate|some|subtype|synchronized|tagged|task|terminate|then|type|until|use|when|while|with|xor)\b/i,boolean:/\b(?:true|false)\b/i,operator:/<[=>]?|>=?|=>?|:=|\/=?|\*\*?|[&+-]/,punctuation:/\.\.?|[,;():]/,char:/'.'/,variable:/\b[a-z](?:\w)*\b/i}}e.exports=t,t.displayName="ada",t.aliases=[]},24001(e){"use strict";function t(e){var t;(t=e).languages.agda={comment:/\{-[\s\S]*?(?:-\}|$)|--.*/,string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^\\\r\n"])*"/,greedy:!0},punctuation:/[(){}⦃⦄.;@]/,"class-name":{pattern:/((?:data|record) +)\S+/,lookbehind:!0},function:{pattern:/(^[ \t]*)(?!\s)[^:\r\n]+(?=:)/m,lookbehind:!0},operator:{pattern:/(^\s*|\s)(?:[=|:∀→λ\\?_]|->)(?=\s)/,lookbehind:!0},keyword:/\b(?:Set|abstract|constructor|data|eta-equality|field|forall|hiding|import|in|inductive|infix|infixl|infixr|instance|let|macro|module|mutual|no-eta-equality|open|overlap|pattern|postulate|primitive|private|public|quote|quoteContext|quoteGoal|quoteTerm|record|renaming|rewrite|syntax|tactic|unquote|unquoteDecl|unquoteDef|using|variable|where|with)\b/}}e.exports=t,t.displayName="agda",t.aliases=[]},18018(e){"use strict";function t(e){e.languages.al={comment:/\/\/.*|\/\*[\s\S]*?\*\//,string:{pattern:/'(?:''|[^'\r\n])*'(?!')|"(?:""|[^"\r\n])*"(?!")/,greedy:!0},function:{pattern:/(\b(?:event|procedure|trigger)\s+|(?:^|[^.])\.\s*)[a-z_]\w*(?=\s*\()/i,lookbehind:!0},keyword:[/\b(?:array|asserterror|begin|break|case|do|downto|else|end|event|exit|for|foreach|function|if|implements|in|indataset|interface|internal|local|of|procedure|program|protected|repeat|runonclient|securityfiltering|suppressdispose|temporary|then|to|trigger|until|var|while|with|withevents)\b/i,/\b(?:action|actions|addafter|addbefore|addfirst|addlast|area|assembly|chartpart|codeunit|column|controladdin|cuegroup|customizes|dataitem|dataset|dotnet|elements|enum|enumextension|extends|field|fieldattribute|fieldelement|fieldgroup|fieldgroups|fields|filter|fixed|grid|group|key|keys|label|labels|layout|modify|moveafter|movebefore|movefirst|movelast|page|pagecustomization|pageextension|part|profile|query|repeater|report|requestpage|schema|separator|systempart|table|tableelement|tableextension|textattribute|textelement|type|usercontrol|value|xmlport)\b/i],number:/\b(?:0x[\da-f]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?)(?:F|U(?:LL?)?|LL?)?\b/i,boolean:/\b(?:false|true)\b/i,variable:/\b(?:Curr(?:FieldNo|Page|Report)|RequestOptionsPage|x?Rec)\b/,"class-name":/\b(?:automation|biginteger|bigtext|blob|boolean|byte|char|clienttype|code|completiontriggererrorlevel|connectiontype|database|dataclassification|datascope|date|dateformula|datetime|decimal|defaultlayout|dialog|dictionary|dotnetassembly|dotnettypedeclaration|duration|errorinfo|errortype|executioncontext|executionmode|fieldclass|fieldref|fieldtype|file|filterpagebuilder|guid|httpclient|httpcontent|httpheaders|httprequestmessage|httpresponsemessage|instream|integer|joker|jsonarray|jsonobject|jsontoken|jsonvalue|keyref|list|moduledependencyinfo|moduleinfo|none|notification|notificationscope|objecttype|option|outstream|pageresult|record|recordid|recordref|reportformat|securityfilter|sessionsettings|tableconnectiontype|tablefilter|testaction|testfield|testfilterfield|testpage|testpermissions|testrequestpage|text|textbuilder|textconst|textencoding|time|transactionmodel|transactiontype|variant|verbosity|version|view|views|webserviceactioncontext|webserviceactionresultcode|xmlattribute|xmlattributecollection|xmlcdata|xmlcomment|xmldeclaration|xmldocument|xmldocumenttype|xmlelement|xmlnamespacemanager|xmlnametable|xmlnode|xmlnodelist|xmlprocessinginstruction|xmlreadoptions|xmltext|xmlwriteoptions)\b/i,operator:/\.\.|:[=:]|[-+*/]=?|<>|[<>]=?|=|\b(?:and|div|mod|not|or|xor)\b/i,punctuation:/[()\[\]{}:.;,]/}}e.exports=t,t.displayName="al",t.aliases=[]},36363(e){"use strict";function t(e){e.languages.antlr4={comment:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,string:{pattern:/'(?:\\.|[^\\'\r\n])*'/,greedy:!0},"character-class":{pattern:/\[(?:\\.|[^\\\]\r\n])*\]/,greedy:!0,alias:"regex",inside:{range:{pattern:/([^[]|(?:^|[^\\])(?:\\\\)*\\\[)-(?!\])/,lookbehind:!0,alias:"punctuation"},escape:/\\(?:u(?:[a-fA-F\d]{4}|\{[a-fA-F\d]+\})|[pP]\{[=\w-]+\}|[^\r\nupP])/,punctuation:/[\[\]]/}},action:{pattern:/\{(?:[^{}]|\{(?:[^{}]|\{(?:[^{}]|\{[^{}]*\})*\})*\})*\}/,greedy:!0,inside:{content:{pattern:/(\{)[\s\S]+(?=\})/,lookbehind:!0},punctuation:/[{}]/}},command:{pattern:/(->\s*(?!\s))(?:\s*(?:,\s*)?\b[a-z]\w*(?:\s*\([^()\r\n]*\))?)+(?=\s*;)/i,lookbehind:!0,inside:{function:/\b\w+(?=\s*(?:[,(]|$))/,punctuation:/[,()]/}},annotation:{pattern:/@\w+(?:::\w+)*/,alias:"keyword"},label:{pattern:/#[ \t]*\w+/,alias:"punctuation"},keyword:/\b(?:catch|channels|finally|fragment|grammar|import|lexer|locals|mode|options|parser|returns|throws|tokens)\b/,definition:[{pattern:/\b[a-z]\w*(?=\s*:)/,alias:["rule","class-name"]},{pattern:/\b[A-Z]\w*(?=\s*:)/,alias:["token","constant"]}],constant:/\b[A-Z][A-Z_]*\b/,operator:/\.\.|->|[|~]|[*+?]\??/,punctuation:/[;:()=]/},e.languages.g4=e.languages.antlr4}e.exports=t,t.displayName="antlr4",t.aliases=["g4"]},35281(e){"use strict";function t(e){e.languages.apacheconf={comment:/#.*/,"directive-inline":{pattern:/(^[\t ]*)\b(?:AcceptFilter|AcceptPathInfo|AccessFileName|Action|Add(?:Alt|AltByEncoding|AltByType|Charset|DefaultCharset|Description|Encoding|Handler|Icon|IconByEncoding|IconByType|InputFilter|Language|ModuleInfo|OutputFilter|OutputFilterByType|Type)|Alias|AliasMatch|Allow(?:CONNECT|EncodedSlashes|Methods|Override|OverrideList)?|Anonymous(?:_LogEmail|_MustGiveEmail|_NoUserID|_VerifyEmail)?|AsyncRequestWorkerFactor|Auth(?:BasicAuthoritative|BasicFake|BasicProvider|BasicUseDigestAlgorithm|DBDUserPWQuery|DBDUserRealmQuery|DBMGroupFile|DBMType|DBMUserFile|Digest(?:Algorithm|Domain|NonceLifetime|Provider|Qop|ShmemSize)|Form(?:Authoritative|Body|DisableNoStore|FakeBasicAuth|Location|LoginRequiredLocation|LoginSuccessLocation|LogoutLocation|Method|Mimetype|Password|Provider|SitePassphrase|Size|Username)|GroupFile|LDAP(?:AuthorizePrefix|BindAuthoritative|BindDN|BindPassword|CharsetConfig|CompareAsUser|CompareDNOnServer|DereferenceAliases|GroupAttribute|GroupAttributeIsDN|InitialBindAsUser|InitialBindPattern|MaxSubGroupDepth|RemoteUserAttribute|RemoteUserIsDN|SearchAsUser|SubGroupAttribute|SubGroupClass|Url)|Merging|Name|Type|UserFile|nCache(?:Context|Enable|ProvideFor|SOCache|Timeout)|nzFcgiCheckAuthnProvider|nzFcgiDefineProvider|zDBDLoginToReferer|zDBDQuery|zDBDRedirectQuery|zDBMType|zSendForbiddenOnFailure)|BalancerGrowth|BalancerInherit|BalancerMember|BalancerPersist|BrowserMatch|BrowserMatchNoCase|BufferSize|BufferedLogs|CGIDScriptTimeout|CGIMapExtension|Cache(?:DefaultExpire|DetailHeader|DirLength|DirLevels|Disable|Enable|File|Header|IgnoreCacheControl|IgnoreHeaders|IgnoreNoLastMod|IgnoreQueryString|IgnoreURLSessionIdentifiers|KeyBaseURL|LastModifiedFactor|Lock|LockMaxAge|LockPath|MaxExpire|MaxFileSize|MinExpire|MinFileSize|NegotiatedDocs|QuickHandler|ReadSize|ReadTime|Root|Socache(?:MaxSize|MaxTime|MinTime|ReadSize|ReadTime)?|StaleOnError|StoreExpired|StoreNoStore|StorePrivate)|CharsetDefault|CharsetOptions|CharsetSourceEnc|CheckCaseOnly|CheckSpelling|ChrootDir|ContentDigest|CookieDomain|CookieExpires|CookieName|CookieStyle|CookieTracking|CoreDumpDirectory|CustomLog|DBDExptime|DBDInitSQL|DBDKeep|DBDMax|DBDMin|DBDParams|DBDPersist|DBDPrepareSQL|DBDriver|DTracePrivileges|Dav|DavDepthInfinity|DavGenericLockDB|DavLockDB|DavMinTimeout|DefaultIcon|DefaultLanguage|DefaultRuntimeDir|DefaultType|Define|Deflate(?:BufferSize|CompressionLevel|FilterNote|InflateLimitRequestBody|InflateRatio(?:Burst|Limit)|MemLevel|WindowSize)|Deny|DirectoryCheckHandler|DirectoryIndex|DirectoryIndexRedirect|DirectorySlash|DocumentRoot|DumpIOInput|DumpIOOutput|EnableExceptionHook|EnableMMAP|EnableSendfile|Error|ErrorDocument|ErrorLog|ErrorLogFormat|Example|ExpiresActive|ExpiresByType|ExpiresDefault|ExtFilterDefine|ExtFilterOptions|ExtendedStatus|FallbackResource|FileETag|FilterChain|FilterDeclare|FilterProtocol|FilterProvider|FilterTrace|ForceLanguagePriority|ForceType|ForensicLog|GprofDir|GracefulShutdownTimeout|Group|Header|HeaderName|Heartbeat(?:Address|Listen|MaxServers|Storage)|HostnameLookups|ISAPI(?:AppendLogToErrors|AppendLogToQuery|CacheFile|FakeAsync|LogNotSupported|ReadAheadBuffer)|IdentityCheck|IdentityCheckTimeout|ImapBase|ImapDefault|ImapMenu|Include|IncludeOptional|Index(?:HeadInsert|Ignore|IgnoreReset|Options|OrderDefault|StyleSheet)|InputSed|KeepAlive|KeepAliveTimeout|KeptBodySize|LDAP(?:CacheEntries|CacheTTL|ConnectionPoolTTL|ConnectionTimeout|LibraryDebug|OpCacheEntries|OpCacheTTL|ReferralHopLimit|Referrals|Retries|RetryDelay|SharedCacheFile|SharedCacheSize|Timeout|TrustedClientCert|TrustedGlobalCert|TrustedMode|VerifyServerCert)|LanguagePriority|Limit(?:InternalRecursion|Request(?:Body|FieldSize|Fields|Line)|XMLRequestBody)|Listen|ListenBackLog|LoadFile|LoadModule|LogFormat|LogLevel|LogMessage|LuaAuthzProvider|LuaCodeCache|Lua(?:Hook(?:AccessChecker|AuthChecker|CheckUserID|Fixups|InsertFilter|Log|MapToStorage|TranslateName|TypeChecker)|Inherit|InputFilter|MapHandler|OutputFilter|PackageCPath|PackagePath|QuickHandler|Root|Scope)|MMapFile|Max(?:ConnectionsPerChild|KeepAliveRequests|MemFree|RangeOverlaps|RangeReversals|Ranges|RequestWorkers|SpareServers|SpareThreads|Threads)|MergeTrailers|MetaDir|MetaFiles|MetaSuffix|MimeMagicFile|MinSpareServers|MinSpareThreads|ModMimeUsePathInfo|ModemStandard|MultiviewsMatch|Mutex|NWSSLTrustedCerts|NWSSLUpgradeable|NameVirtualHost|NoProxy|Options|Order|OutputSed|PassEnv|PidFile|PrivilegesMode|Protocol|ProtocolEcho|Proxy(?:AddHeaders|BadHeader|Block|Domain|ErrorOverride|ExpressDBMFile|ExpressDBMType|ExpressEnable|FtpDirCharset|FtpEscapeWildcards|FtpListOnWildcard|HTML(?:BufSize|CharsetOut|DocType|Enable|Events|Extended|Fixups|Interp|Links|Meta|StripComments|URLMap)|IOBufferSize|MaxForwards|Pass(?:Inherit|InterpolateEnv|Match|Reverse|ReverseCookieDomain|ReverseCookiePath)?|PreserveHost|ReceiveBufferSize|Remote|RemoteMatch|Requests|SCGIInternalRedirect|SCGISendfile|Set|SourceAddress|Status|Timeout|Via)|RLimitCPU|RLimitMEM|RLimitNPROC|ReadmeName|ReceiveBufferSize|Redirect|RedirectMatch|RedirectPermanent|RedirectTemp|ReflectorHeader|RemoteIP(?:Header|InternalProxy|InternalProxyList|ProxiesHeader|TrustedProxy|TrustedProxyList)|RemoveCharset|RemoveEncoding|RemoveHandler|RemoveInputFilter|RemoveLanguage|RemoveOutputFilter|RemoveType|RequestHeader|RequestReadTimeout|Require|Rewrite(?:Base|Cond|Engine|Map|Options|Rule)|SSIETag|SSIEndTag|SSIErrorMsg|SSILastModified|SSILegacyExprParser|SSIStartTag|SSITimeFormat|SSIUndefinedEcho|SSL(?:CACertificateFile|CACertificatePath|CADNRequestFile|CADNRequestPath|CARevocationCheck|CARevocationFile|CARevocationPath|CertificateChainFile|CertificateFile|CertificateKeyFile|CipherSuite|Compression|CryptoDevice|Engine|FIPS|HonorCipherOrder|InsecureRenegotiation|OCSP(?:DefaultResponder|Enable|OverrideResponder|ResponderTimeout|ResponseMaxAge|ResponseTimeSkew|UseRequestNonce)|OpenSSLConfCmd|Options|PassPhraseDialog|Protocol|Proxy(?:CACertificateFile|CACertificatePath|CARevocation(?:Check|File|Path)|CheckPeer(?:CN|Expire|Name)|CipherSuite|Engine|MachineCertificate(?:ChainFile|File|Path)|Protocol|Verify|VerifyDepth)|RandomSeed|RenegBufferSize|Require|RequireSSL|SRPUnknownUserSeed|SRPVerifierFile|Session(?:Cache|CacheTimeout|TicketKeyFile|Tickets)|Stapling(?:Cache|ErrorCacheTimeout|FakeTryLater|ForceURL|ResponderTimeout|ResponseMaxAge|ResponseTimeSkew|ReturnResponderErrors|StandardCacheTimeout)|StrictSNIVHostCheck|UseStapling|UserName|VerifyClient|VerifyDepth)|Satisfy|ScoreBoardFile|Script(?:Alias|AliasMatch|InterpreterSource|Log|LogBuffer|LogLength|Sock)?|SecureListen|SeeRequestTail|SendBufferSize|Server(?:Admin|Alias|Limit|Name|Path|Root|Signature|Tokens)|Session(?:Cookie(?:Name|Name2|Remove)|Crypto(?:Cipher|Driver|Passphrase|PassphraseFile)|DBD(?:CookieName|CookieName2|CookieRemove|DeleteLabel|InsertLabel|PerUser|SelectLabel|UpdateLabel)|Env|Exclude|Header|Include|MaxAge)?|SetEnv|SetEnvIf|SetEnvIfExpr|SetEnvIfNoCase|SetHandler|SetInputFilter|SetOutputFilter|StartServers|StartThreads|Substitute|Suexec|SuexecUserGroup|ThreadLimit|ThreadStackSize|ThreadsPerChild|TimeOut|TraceEnable|TransferLog|TypesConfig|UnDefine|UndefMacro|UnsetEnv|Use|UseCanonicalName|UseCanonicalPhysicalPort|User|UserDir|VHostCGIMode|VHostCGIPrivs|VHostGroup|VHostPrivs|VHostSecure|VHostUser|Virtual(?:DocumentRoot|ScriptAlias)(?:IP)?|WatchdogInterval|XBitHack|xml2EncAlias|xml2EncDefault|xml2StartParse)\b/im,lookbehind:!0,alias:"property"},"directive-block":{pattern:/<\/?\b(?:Auth[nz]ProviderAlias|Directory|DirectoryMatch|Else|ElseIf|Files|FilesMatch|If|IfDefine|IfModule|IfVersion|Limit|LimitExcept|Location|LocationMatch|Macro|Proxy|Require(?:All|Any|None)|VirtualHost)\b.*>/i,inside:{"directive-block":{pattern:/^<\/?\w+/,inside:{punctuation:/^<\/?/},alias:"tag"},"directive-block-parameter":{pattern:/.*[^>]/,inside:{punctuation:/:/,string:{pattern:/("|').*\1/,inside:{variable:/[$%]\{?(?:\w\.?[-+:]?)+\}?/}}},alias:"attr-value"},punctuation:/>/},alias:"tag"},"directive-flags":{pattern:/\[(?:[\w=],?)+\]/,alias:"keyword"},string:{pattern:/("|').*\1/,inside:{variable:/[$%]\{?(?:\w\.?[-+:]?)+\}?/}},variable:/[$%]\{?(?:\w\.?[-+:]?)+\}?/,regex:/\^?.*\$|\^.*\$?/}}e.exports=t,t.displayName="apacheconf",t.aliases=[]},10433(e,t,n){"use strict";var r=n(11114);function i(e){e.register(r),function(e){var t=/\b(?:abstract|activate|and|any|array|as|asc|autonomous|begin|bigdecimal|blob|boolean|break|bulk|by|byte|case|cast|catch|char|class|collect|commit|const|continue|currency|date|datetime|decimal|default|delete|desc|do|double|else|end|enum|exception|exit|export|extends|final|finally|float|for|from|global|goto|group|having|hint|if|implements|import|in|inner|insert|instanceof|int|integer|interface|into|join|like|limit|list|long|loop|map|merge|new|not|null|nulls|number|object|of|on|or|outer|override|package|parallel|pragma|private|protected|public|retrieve|return|rollback|select|set|short|sObject|sort|static|string|super|switch|synchronized|system|testmethod|then|this|throw|time|transaction|transient|trigger|try|undelete|update|upsert|using|virtual|void|webservice|when|where|while|get(?=\s*[{};])|(?:after|before)(?=\s+[a-z])|(?:inherited|with|without)\s+sharing)\b/i,n=/\b(?:(?=[a-z_]\w*\s*[<\[])|(?!))[A-Z_]\w*(?:\s*\.\s*[A-Z_]\w*)*\b(?:\s*(?:\[\s*\]|<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>))*/.source.replace(//g,function(){return t.source});function r(e){return RegExp(e.replace(//g,function(){return n}),"i")}var i={keyword:t,punctuation:/[()\[\]{};,:.<>]/};e.languages.apex={comment:e.languages.clike.comment,string:e.languages.clike.string,sql:{pattern:/((?:[=,({:]|\breturn)\s*)\[[^\[\]]*\]/i,lookbehind:!0,greedy:!0,alias:"language-sql",inside:e.languages.sql},annotation:{pattern:/@\w+\b/,alias:"punctuation"},"class-name":[{pattern:r(/(\b(?:class|enum|extends|implements|instanceof|interface|new|trigger\s+\w+\s+on)\s+)/.source),lookbehind:!0,inside:i},{pattern:r(/(\(\s*)(?=\s*\)\s*[\w(])/.source),lookbehind:!0,inside:i},{pattern:r(/(?=\s*\w+\s*[;=,(){:])/.source),inside:i}],trigger:{pattern:/(\btrigger\s+)\w+\b/i,lookbehind:!0,alias:"class-name"},keyword:t,function:/\b[a-z_]\w*(?=\s*\()/i,boolean:/\b(?:false|true)\b/i,number:/(?:\B\.\d+|\b\d+(?:\.\d+|L)?)\b/i,operator:/[!=](?:==?)?|\?\.?|&&|\|\||--|\+\+|[-+*/^&|]=?|:|<{1,3}=?/,punctuation:/[()\[\]{};,.]/}}(e)}e.exports=i,i.displayName="apex",i.aliases=[]},84039(e){"use strict";function t(e){e.languages.apl={comment:/(?:⍝|#[! ]).*$/m,string:{pattern:/'(?:[^'\r\n]|'')*'/,greedy:!0},number:/¯?(?:\d*\.?\b\d+(?:e[+¯]?\d+)?|¯|∞)(?:j¯?(?:(?:\d+(?:\.\d+)?|\.\d+)(?:e[+¯]?\d+)?|¯|∞))?/i,statement:/:[A-Z][a-z][A-Za-z]*\b/,"system-function":{pattern:/⎕[A-Z]+/i,alias:"function"},constant:/[⍬⌾#⎕⍞]/,function:/[-+×÷⌈⌊∣|⍳⍸?*⍟○!⌹<≤=>≥≠≡≢∊⍷∪∩~∨∧⍱⍲⍴,⍪⌽⊖⍉↑↓⊂⊃⊆⊇⌷⍋⍒⊤⊥⍕⍎⊣⊢⍁⍂≈⍯↗¤→]/,"monadic-operator":{pattern:/[\\\/⌿⍀¨⍨⌶&∥]/,alias:"operator"},"dyadic-operator":{pattern:/[.⍣⍠⍤∘⌸@⌺⍥]/,alias:"operator"},assignment:{pattern:/←/,alias:"keyword"},punctuation:/[\[;\]()◇⋄]/,dfn:{pattern:/[{}⍺⍵⍶⍹∇⍫:]/,alias:"builtin"}}}e.exports=t,t.displayName="apl",t.aliases=[]},71336(e){"use strict";function t(e){e.languages.applescript={comment:[/\(\*(?:\(\*(?:[^*]|\*(?!\)))*\*\)|(?!\(\*)[\s\S])*?\*\)/,/--.+/,/#.+/],string:/"(?:\\.|[^"\\\r\n])*"/,number:/(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e-?\d+)?\b/i,operator:[/[&=≠≤≥*+\-\/÷^]|[<>]=?/,/\b(?:(?:start|begin|end)s? with|(?:(?:does not|doesn't) contain|contains?)|(?:is|isn't|is not) (?:in|contained by)|(?:(?:is|isn't|is not) )?(?:greater|less) than(?: or equal)?(?: to)?|(?:(?:does not|doesn't) come|comes) (?:before|after)|(?:is|isn't|is not) equal(?: to)?|(?:(?:does not|doesn't) equal|equals|equal to|isn't|is not)|(?:a )?(?:ref(?: to)?|reference to)|(?:and|or|div|mod|as|not))\b/],keyword:/\b(?:about|above|after|against|apart from|around|aside from|at|back|before|beginning|behind|below|beneath|beside|between|but|by|considering|continue|copy|does|eighth|else|end|equal|error|every|exit|false|fifth|first|for|fourth|from|front|get|given|global|if|ignoring|in|instead of|into|is|it|its|last|local|me|middle|my|ninth|of|on|onto|out of|over|prop|property|put|repeat|return|returning|second|set|seventh|since|sixth|some|tell|tenth|that|the|then|third|through|thru|timeout|times|to|transaction|true|try|until|where|while|whose|with|without)\b/,class:{pattern:/\b(?:alias|application|boolean|class|constant|date|file|integer|list|number|POSIX file|real|record|reference|RGB color|script|text|centimetres|centimeters|feet|inches|kilometres|kilometers|metres|meters|miles|yards|square feet|square kilometres|square kilometers|square metres|square meters|square miles|square yards|cubic centimetres|cubic centimeters|cubic feet|cubic inches|cubic metres|cubic meters|cubic yards|gallons|litres|liters|quarts|grams|kilograms|ounces|pounds|degrees Celsius|degrees Fahrenheit|degrees Kelvin)\b/,alias:"builtin"},punctuation:/[{}():,¬«»《》]/}}e.exports=t,t.displayName="applescript",t.aliases=[]},4481(e){"use strict";function t(e){e.languages.aql={comment:/\/\/.*|\/\*[\s\S]*?\*\//,property:{pattern:/([{,]\s*)(?:(?!\d)\w+|(["'´`])(?:(?!\2)[^\\\r\n]|\\.)*\2)(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(["'´`])(?:(?!\1)[^\\\r\n]|\\.)*\1/,greedy:!0},variable:/@@?\w+/,keyword:[{pattern:/(\bWITH\s+)COUNT(?=\s+INTO\b)/i,lookbehind:!0},/\b(?:AGGREGATE|ALL|AND|ANY|ASC|COLLECT|DESC|DISTINCT|FILTER|FOR|GRAPH|IN|INBOUND|INSERT|INTO|K_PATHS|K_SHORTEST_PATHS|LET|LIKE|LIMIT|NONE|NOT|NULL|OR|OUTBOUND|REMOVE|REPLACE|RETURN|SHORTEST_PATH|SORT|UPDATE|UPSERT|WINDOW|WITH)\b/i,{pattern:/(^|[^\w.[])(?:KEEP|PRUNE|SEARCH|TO)\b/i,lookbehind:!0},{pattern:/(^|[^\w.[])(?:CURRENT|NEW|OLD)\b/,lookbehind:!0},{pattern:/\bOPTIONS(?=\s*\{)/i}],function:/\b(?!\d)\w+(?=\s*\()/,boolean:/\b(?:true|false)\b/i,range:{pattern:/\.\./,alias:"operator"},number:[/\b0b[01]+/i,/\b0x[0-9a-f]+/i,/(?:\B\.\d+|\b(?:0|[1-9]\d*)(?:\.\d+)?)(?:e[+-]?\d+)?/i],operator:/\*{2,}|[=!]~|[!=<>]=?|&&|\|\||[-+*/%]/,punctuation:/::|[?.:,;()[\]{}]/}}e.exports=t,t.displayName="aql",t.aliases=[]},2159(e,t,n){"use strict";var r=n(80096);function i(e){e.register(r),e.languages.arduino=e.languages.extend("cpp",{constant:/\b(?:DIGITAL_MESSAGE|FIRMATA_STRING|ANALOG_MESSAGE|REPORT_DIGITAL|REPORT_ANALOG|INPUT_PULLUP|SET_PIN_MODE|INTERNAL2V56|SYSTEM_RESET|LED_BUILTIN|INTERNAL1V1|SYSEX_START|INTERNAL|EXTERNAL|DEFAULT|OUTPUT|INPUT|HIGH|LOW)\b/,keyword:/\b(?:setup|if|else|while|do|for|return|in|instanceof|default|function|loop|goto|switch|case|new|try|throw|catch|finally|null|break|continue|boolean|bool|void|byte|word|string|String|array|int|long|integer|double)\b/,builtin:/\b(?:KeyboardController|MouseController|SoftwareSerial|EthernetServer|EthernetClient|LiquidCrystal|LiquidCrystal_I2C|RobotControl|GSMVoiceCall|EthernetUDP|EsploraTFT|HttpClient|RobotMotor|WiFiClient|GSMScanner|FileSystem|Scheduler|GSMServer|YunClient|YunServer|IPAddress|GSMClient|GSMModem|Keyboard|Ethernet|Console|GSMBand|Esplora|Stepper|Process|WiFiUDP|GSM_SMS|Mailbox|USBHost|Firmata|PImage|Client|Server|GSMPIN|FileIO|Bridge|Serial|EEPROM|Stream|Mouse|Audio|Servo|File|Task|GPRS|WiFi|Wire|TFT|GSM|SPI|SD|runShellCommandAsynchronously|analogWriteResolution|retrieveCallingNumber|printFirmwareVersion|analogReadResolution|sendDigitalPortPair|noListenOnLocalhost|readJoystickButton|setFirmwareVersion|readJoystickSwitch|scrollDisplayRight|getVoiceCallStatus|scrollDisplayLeft|writeMicroseconds|delayMicroseconds|beginTransmission|getSignalStrength|runAsynchronously|getAsynchronously|listenOnLocalhost|getCurrentCarrier|readAccelerometer|messageAvailable|sendDigitalPorts|lineFollowConfig|countryNameWrite|runShellCommand|readStringUntil|rewindDirectory|readTemperature|setClockDivider|readLightSensor|endTransmission|analogReference|detachInterrupt|countryNameRead|attachInterrupt|encryptionType|readBytesUntil|robotNameWrite|readMicrophone|robotNameRead|cityNameWrite|userNameWrite|readJoystickY|readJoystickX|mouseReleased|openNextFile|scanNetworks|noInterrupts|digitalWrite|beginSpeaker|mousePressed|isActionDone|mouseDragged|displayLogos|noAutoscroll|addParameter|remoteNumber|getModifiers|keyboardRead|userNameRead|waitContinue|processInput|parseCommand|printVersion|readNetworks|writeMessage|blinkVersion|cityNameRead|readMessage|setDataMode|parsePacket|isListening|setBitOrder|beginPacket|isDirectory|motorsWrite|drawCompass|digitalRead|clearScreen|serialEvent|rightToLeft|setTextSize|leftToRight|requestFrom|keyReleased|compassRead|analogWrite|interrupts|WiFiServer|disconnect|playMelody|parseFloat|autoscroll|getPINUsed|setPINUsed|setTimeout|sendAnalog|readSlider|analogRead|beginWrite|createChar|motorsStop|keyPressed|tempoWrite|readButton|subnetMask|debugPrint|macAddress|writeGreen|randomSeed|attachGPRS|readString|sendString|remotePort|releaseAll|mouseMoved|background|getXChange|getYChange|answerCall|getResult|voiceCall|endPacket|constrain|getSocket|writeJSON|getButton|available|connected|findUntil|readBytes|exitValue|readGreen|writeBlue|startLoop|isPressed|sendSysex|pauseMode|gatewayIP|setCursor|getOemKey|tuneWrite|noDisplay|loadImage|switchPIN|onRequest|onReceive|changePIN|playFile|noBuffer|parseInt|overflow|checkPIN|knobRead|beginTFT|bitClear|updateIR|bitWrite|position|writeRGB|highByte|writeRed|setSpeed|readBlue|noStroke|remoteIP|transfer|shutdown|hangCall|beginSMS|endWrite|attached|maintain|noCursor|checkReg|checkPUK|shiftOut|isValid|shiftIn|pulseIn|connect|println|localIP|pinMode|getIMEI|display|noBlink|process|getBand|running|beginSD|drawBMP|lowByte|setBand|release|bitRead|prepare|pointTo|readRed|setMode|noFill|remove|listen|stroke|detach|attach|noTone|exists|buffer|height|bitSet|circle|config|cursor|random|IRread|setDNS|endSMS|getKey|micros|millis|begin|print|write|ready|flush|width|isPIN|blink|clear|press|mkdir|rmdir|close|point|yield|image|BSSID|click|delay|read|text|move|peek|beep|rect|line|open|seek|fill|size|turn|stop|home|find|step|tone|sqrt|RSSI|SSID|end|bit|tan|cos|sin|pow|map|abs|max|min|get|run|put)\b/})}e.exports=i,i.displayName="arduino",i.aliases=[]},60274(e){"use strict";function t(e){e.languages.arff={comment:/%.*/,string:{pattern:/(["'])(?:\\.|(?!\1)[^\\\r\n])*\1/,greedy:!0},keyword:/@(?:attribute|data|end|relation)\b/i,number:/\b\d+(?:\.\d+)?\b/,punctuation:/[{},]/}}e.exports=t,t.displayName="arff",t.aliases=[]},18738(e){"use strict";function t(e){!function(e){var t={pattern:/(^[ \t]*)\[(?!\[)(?:(["'$`])(?:(?!\2)[^\\]|\\.)*\2|\[(?:[^\[\]\\]|\\.)*\]|[^\[\]\\"'$`]|\\.)*\]/m,lookbehind:!0,inside:{quoted:{pattern:/([$`])(?:(?!\1)[^\\]|\\.)*\1/,inside:{punctuation:/^[$`]|[$`]$/}},interpreted:{pattern:/'(?:[^'\\]|\\.)*'/,inside:{punctuation:/^'|'$/}},string:/"(?:[^"\\]|\\.)*"/,variable:/\w+(?==)/,punctuation:/^\[|\]$|,/,operator:/=/,"attr-value":/(?!^\s+$).+/}},n=e.languages.asciidoc={"comment-block":{pattern:/^(\/{4,})(?:\r?\n|\r)(?:[\s\S]*(?:\r?\n|\r))??\1/m,alias:"comment"},table:{pattern:/^\|={3,}(?:(?:\r?\n|\r(?!\n)).*)*?(?:\r?\n|\r)\|={3,}$/m,inside:{specifiers:{pattern:/(?!\|)(?:(?:(?:\d+(?:\.\d+)?|\.\d+)[+*])?(?:[<^>](?:\.[<^>])?|\.[<^>])?[a-z]*)(?=\|)/,alias:"attr-value"},punctuation:{pattern:/(^|[^\\])[|!]=*/,lookbehind:!0}}},"passthrough-block":{pattern:/^(\+{4,})(?:\r?\n|\r)(?:[\s\S]*(?:\r?\n|\r))??\1$/m,inside:{punctuation:/^\++|\++$/}},"literal-block":{pattern:/^(-{4,}|\.{4,})(?:\r?\n|\r)(?:[\s\S]*(?:\r?\n|\r))??\1$/m,inside:{punctuation:/^(?:-+|\.+)|(?:-+|\.+)$/}},"other-block":{pattern:/^(--|\*{4,}|_{4,}|={4,})(?:\r?\n|\r)(?:[\s\S]*(?:\r?\n|\r))??\1$/m,inside:{punctuation:/^(?:-+|\*+|_+|=+)|(?:-+|\*+|_+|=+)$/}},"list-punctuation":{pattern:/(^[ \t]*)(?:-|\*{1,5}|\.{1,5}|(?:[a-z]|\d+)\.|[xvi]+\))(?= )/im,lookbehind:!0,alias:"punctuation"},"list-label":{pattern:/(^[ \t]*)[a-z\d].+(?::{2,4}|;;)(?=\s)/im,lookbehind:!0,alias:"symbol"},"indented-block":{pattern:/((\r?\n|\r)\2)([ \t]+)\S.*(?:(?:\r?\n|\r)\3.+)*(?=\2{2}|$)/,lookbehind:!0},comment:/^\/\/.*/m,title:{pattern:/^.+(?:\r?\n|\r)(?:={3,}|-{3,}|~{3,}|\^{3,}|\+{3,})$|^={1,5} .+|^\.(?![\s.]).*/m,alias:"important",inside:{punctuation:/^(?:\.|=+)|(?:=+|-+|~+|\^+|\++)$/}},"attribute-entry":{pattern:/^:[^:\r\n]+:(?: .*?(?: \+(?:\r?\n|\r).*?)*)?$/m,alias:"tag"},attributes:t,hr:{pattern:/^'{3,}$/m,alias:"punctuation"},"page-break":{pattern:/^<{3,}$/m,alias:"punctuation"},admonition:{pattern:/^(?:TIP|NOTE|IMPORTANT|WARNING|CAUTION):/m,alias:"keyword"},callout:[{pattern:/(^[ \t]*)/m,lookbehind:!0,alias:"symbol"},{pattern:/<\d+>/,alias:"symbol"}],macro:{pattern:/\b[a-z\d][a-z\d-]*::?(?:[^\s\[\]]*\[(?:[^\]\\"']|(["'])(?:(?!\1)[^\\]|\\.)*\1|\\.)*\])/,inside:{function:/^[a-z\d-]+(?=:)/,punctuation:/^::?/,attributes:{pattern:/(?:\[(?:[^\]\\"']|(["'])(?:(?!\1)[^\\]|\\.)*\1|\\.)*\])/,inside:t.inside}}},inline:{pattern:/(^|[^\\])(?:(?:\B\[(?:[^\]\\"']|(["'])(?:(?!\2)[^\\]|\\.)*\2|\\.)*\])?(?:\b_(?!\s)(?: _|[^_\\\r\n]|\\.)+(?:(?:\r?\n|\r)(?: _|[^_\\\r\n]|\\.)+)*_\b|\B``(?!\s).+?(?:(?:\r?\n|\r).+?)*''\B|\B`(?!\s)(?:[^`'\s]|\s+\S)+['`]\B|\B(['*+#])(?!\s)(?: \3|(?!\3)[^\\\r\n]|\\.)+(?:(?:\r?\n|\r)(?: \3|(?!\3)[^\\\r\n]|\\.)+)*\3\B)|(?:\[(?:[^\]\\"']|(["'])(?:(?!\4)[^\\]|\\.)*\4|\\.)*\])?(?:(__|\*\*|\+\+\+?|##|\$\$|[~^]).+?(?:(?:\r?\n|\r).+?)*\5|\{[^}\r\n]+\}|\[\[\[?.+?(?:(?:\r?\n|\r).+?)*\]?\]\]|<<.+?(?:(?:\r?\n|\r).+?)*>>|\(\(\(?.+?(?:(?:\r?\n|\r).+?)*\)?\)\)))/m,lookbehind:!0,inside:{attributes:t,url:{pattern:/^(?:\[\[\[?.+?\]?\]\]|<<.+?>>)$/,inside:{punctuation:/^(?:\[\[\[?|<<)|(?:\]\]\]?|>>)$/}},"attribute-ref":{pattern:/^\{.+\}$/,inside:{variable:{pattern:/(^\{)[a-z\d,+_-]+/,lookbehind:!0},operator:/^[=?!#%@$]|!(?=[:}])/,punctuation:/^\{|\}$|::?/}},italic:{pattern:/^(['_])[\s\S]+\1$/,inside:{punctuation:/^(?:''?|__?)|(?:''?|__?)$/}},bold:{pattern:/^\*[\s\S]+\*$/,inside:{punctuation:/^\*\*?|\*\*?$/}},punctuation:/^(?:``?|\+{1,3}|##?|\$\$|[~^]|\(\(\(?)|(?:''?|\+{1,3}|##?|\$\$|[~^`]|\)?\)\))$/}},replacement:{pattern:/\((?:C|TM|R)\)/,alias:"builtin"},entity:/&#?[\da-z]{1,8};/i,"line-continuation":{pattern:/(^| )\+$/m,lookbehind:!0,alias:"punctuation"}};function r(e){e=e.split(" ");for(var t={},r=0,i=e.length;r/i,alias:"tag",inside:{"page-directive":{pattern:/<%\s*@\s*(?:Assembly|Control|Implements|Import|Master(?:Type)?|OutputCache|Page|PreviousPageType|Reference|Register)?|%>/i,alias:"tag"},rest:e.languages.markup.tag.inside}},directive:{pattern:/<%.*%>/i,alias:"tag",inside:{directive:{pattern:/<%\s*?[$=%#:]{0,2}|%>/i,alias:"tag"},rest:e.languages.csharp}}}),e.languages.aspnet.tag.pattern=/<(?!%)\/?[^\s>\/]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|[^\s'">=]+))?)*\s*\/?>/i,e.languages.insertBefore("inside","punctuation",{directive:e.languages.aspnet.directive},e.languages.aspnet.tag.inside["attr-value"]),e.languages.insertBefore("aspnet","comment",{"asp-comment":{pattern:/<%--[\s\S]*?--%>/,alias:["asp","comment"]}}),e.languages.insertBefore("aspnet",e.languages.javascript?"script":"tag",{"asp-script":{pattern:/(]*>)[\s\S]*?(?=<\/script>)/i,lookbehind:!0,alias:["asp","script"],inside:e.languages.csharp||{}}})}e.exports=i,i.displayName="aspnet",i.aliases=[]},6681(e){"use strict";function t(e){e.languages.autohotkey={comment:[{pattern:/(^|\s);.*/,lookbehind:!0},{pattern:/(^[\t ]*)\/\*(?:[\r\n](?![ \t]*\*\/)|[^\r\n])*(?:[\r\n][ \t]*\*\/)?/m,lookbehind:!0,greedy:!0}],tag:{pattern:/^([ \t]*)[^\s,`":]+(?=:[ \t]*$)/m,lookbehind:!0},string:/"(?:[^"\n\r]|"")*"/m,variable:/%\w+%/,number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/\?|\/\/?=?|:=|\|[=|]?|&[=&]?|\+[=+]?|-[=-]?|\*[=*]?|<(?:<=?|>|=)?|>>?=?|[.^!=~]=?|\b(?:AND|NOT|OR)\b/,boolean:/\b(?:true|false)\b/,selector:/\b(?:AutoTrim|BlockInput|Break|Click|ClipWait|Continue|Control|ControlClick|ControlFocus|ControlGet|ControlGetFocus|ControlGetPos|ControlGetText|ControlMove|ControlSend|ControlSendRaw|ControlSetText|CoordMode|Critical|DetectHiddenText|DetectHiddenWindows|Drive|DriveGet|DriveSpaceFree|EnvAdd|EnvDiv|EnvGet|EnvMult|EnvSet|EnvSub|EnvUpdate|Exit|ExitApp|FileAppend|FileCopy|FileCopyDir|FileCreateDir|FileCreateShortcut|FileDelete|FileEncoding|FileGetAttrib|FileGetShortcut|FileGetSize|FileGetTime|FileGetVersion|FileInstall|FileMove|FileMoveDir|FileRead|FileReadLine|FileRecycle|FileRecycleEmpty|FileRemoveDir|FileSelectFile|FileSelectFolder|FileSetAttrib|FileSetTime|FormatTime|GetKeyState|Gosub|Goto|GroupActivate|GroupAdd|GroupClose|GroupDeactivate|Gui|GuiControl|GuiControlGet|Hotkey|ImageSearch|IniDelete|IniRead|IniWrite|Input|InputBox|KeyWait|ListHotkeys|ListLines|ListVars|Loop|Menu|MouseClick|MouseClickDrag|MouseGetPos|MouseMove|MsgBox|OnExit|OutputDebug|Pause|PixelGetColor|PixelSearch|PostMessage|Process|Progress|Random|RegDelete|RegRead|RegWrite|Reload|Repeat|Return|Run|RunAs|RunWait|Send|SendEvent|SendInput|SendMessage|SendMode|SendPlay|SendRaw|SetBatchLines|SetCapslockState|SetControlDelay|SetDefaultMouseSpeed|SetEnv|SetFormat|SetKeyDelay|SetMouseDelay|SetNumlockState|SetRegView|SetScrollLockState|SetStoreCapslockMode|SetTimer|SetTitleMatchMode|SetWinDelay|SetWorkingDir|Shutdown|Sleep|Sort|SoundBeep|SoundGet|SoundGetWaveVolume|SoundPlay|SoundSet|SoundSetWaveVolume|SplashImage|SplashTextOff|SplashTextOn|SplitPath|StatusBarGetText|StatusBarWait|StringCaseSense|StringGetPos|StringLeft|StringLen|StringLower|StringMid|StringReplace|StringRight|StringSplit|StringTrimLeft|StringTrimRight|StringUpper|Suspend|SysGet|Thread|ToolTip|Transform|TrayTip|URLDownloadToFile|WinActivate|WinActivateBottom|WinClose|WinGet|WinGetActiveStats|WinGetActiveTitle|WinGetClass|WinGetPos|WinGetText|WinGetTitle|WinHide|WinKill|WinMaximize|WinMenuSelectItem|WinMinimize|WinMinimizeAll|WinMinimizeAllUndo|WinMove|WinRestore|WinSet|WinSetTitle|WinShow|WinWait|WinWaitActive|WinWaitClose|WinWaitNotActive)\b/i,constant:/\b(?:a_ahkpath|a_ahkversion|a_appdata|a_appdatacommon|a_autotrim|a_batchlines|a_caretx|a_carety|a_computername|a_controldelay|a_cursor|a_dd|a_ddd|a_dddd|a_defaultmousespeed|a_desktop|a_desktopcommon|a_detecthiddentext|a_detecthiddenwindows|a_endchar|a_eventinfo|a_exitreason|a_fileencoding|a_formatfloat|a_formatinteger|a_gui|a_guievent|a_guicontrol|a_guicontrolevent|a_guiheight|a_guiwidth|a_guix|a_guiy|a_hour|a_iconfile|a_iconhidden|a_iconnumber|a_icontip|a_index|a_ipaddress1|a_ipaddress2|a_ipaddress3|a_ipaddress4|a_is64bitos|a_isadmin|a_iscompiled|a_iscritical|a_ispaused|a_issuspended|a_isunicode|a_keydelay|a_language|a_lasterror|a_linefile|a_linenumber|a_loopfield|a_loopfileattrib|a_loopfiledir|a_loopfileext|a_loopfilefullpath|a_loopfilelongpath|a_loopfilename|a_loopfileshortname|a_loopfileshortpath|a_loopfilesize|a_loopfilesizekb|a_loopfilesizemb|a_loopfiletimeaccessed|a_loopfiletimecreated|a_loopfiletimemodified|a_loopreadline|a_loopregkey|a_loopregname|a_loopregsubkey|a_loopregtimemodified|a_loopregtype|a_mday|a_min|a_mm|a_mmm|a_mmmm|a_mon|a_mousedelay|a_msec|a_mydocuments|a_now|a_nowutc|a_numbatchlines|a_ostype|a_osversion|a_priorhotkey|a_priorkey|programfiles|a_programfiles|a_programs|a_programscommon|a_ptrsize|a_regview|a_screendpi|a_screenheight|a_screenwidth|a_scriptdir|a_scriptfullpath|a_scripthwnd|a_scriptname|a_sec|a_space|a_startmenu|a_startmenucommon|a_startup|a_startupcommon|a_stringcasesense|a_tab|a_temp|a_thisfunc|a_thishotkey|a_thislabel|a_thismenu|a_thismenuitem|a_thismenuitempos|a_tickcount|a_timeidle|a_timeidlephysical|a_timesincepriorhotkey|a_timesincethishotkey|a_titlematchmode|a_titlematchmodespeed|a_username|a_wday|a_windelay|a_windir|a_workingdir|a_yday|a_year|a_yweek|a_yyyy|clipboard|clipboardall|comspec|errorlevel)\b/i,builtin:/\b(?:abs|acos|asc|asin|atan|ceil|chr|class|comobjactive|comobjarray|comobjconnect|comobjcreate|comobjerror|comobjflags|comobjget|comobjquery|comobjtype|comobjvalue|cos|dllcall|exp|fileexist|Fileopen|floor|format|il_add|il_create|il_destroy|instr|substr|isfunc|islabel|IsObject|ln|log|lv_add|lv_delete|lv_deletecol|lv_getcount|lv_getnext|lv_gettext|lv_insert|lv_insertcol|lv_modify|lv_modifycol|lv_setimagelist|ltrim|rtrim|mod|onmessage|numget|numput|registercallback|regexmatch|regexreplace|round|sin|tan|sqrt|strlen|strreplace|sb_seticon|sb_setparts|sb_settext|strsplit|tv_add|tv_delete|tv_getchild|tv_getcount|tv_getnext|tv_get|tv_getparent|tv_getprev|tv_getselection|tv_gettext|tv_modify|varsetcapacity|winactive|winexist|__New|__Call|__Get|__Set)\b/i,symbol:/\b(?:alt|altdown|altup|appskey|backspace|browser_back|browser_favorites|browser_forward|browser_home|browser_refresh|browser_search|browser_stop|bs|capslock|ctrl|ctrlbreak|ctrldown|ctrlup|del|delete|down|end|enter|esc|escape|f1|f10|f11|f12|f13|f14|f15|f16|f17|f18|f19|f2|f20|f21|f22|f23|f24|f3|f4|f5|f6|f7|f8|f9|home|ins|insert|joy1|joy10|joy11|joy12|joy13|joy14|joy15|joy16|joy17|joy18|joy19|joy2|joy20|joy21|joy22|joy23|joy24|joy25|joy26|joy27|joy28|joy29|joy3|joy30|joy31|joy32|joy4|joy5|joy6|joy7|joy8|joy9|joyaxes|joybuttons|joyinfo|joyname|joypov|joyr|joyu|joyv|joyx|joyy|joyz|lalt|launch_app1|launch_app2|launch_mail|launch_media|lbutton|lcontrol|lctrl|left|lshift|lwin|lwindown|lwinup|mbutton|media_next|media_play_pause|media_prev|media_stop|numlock|numpad0|numpad1|numpad2|numpad3|numpad4|numpad5|numpad6|numpad7|numpad8|numpad9|numpadadd|numpadclear|numpaddel|numpaddiv|numpaddot|numpaddown|numpadend|numpadenter|numpadhome|numpadins|numpadleft|numpadmult|numpadpgdn|numpadpgup|numpadright|numpadsub|numpadup|pgdn|pgup|printscreen|ralt|rbutton|rcontrol|rctrl|right|rshift|rwin|rwindown|rwinup|scrolllock|shift|shiftdown|shiftup|space|tab|up|volume_down|volume_mute|volume_up|wheeldown|wheelleft|wheelright|wheelup|xbutton1|xbutton2)\b/i,important:/#\b(?:AllowSameLineComments|ClipboardTimeout|CommentFlag|DerefChar|ErrorStdOut|EscapeChar|HotkeyInterval|HotkeyModifierTimeout|Hotstring|If|IfTimeout|IfWinActive|IfWinExist|IfWinNotActive|IfWinNotExist|Include|IncludeAgain|InputLevel|InstallKeybdHook|InstallMouseHook|KeyHistory|MaxHotkeysPerInterval|MaxMem|MaxThreads|MaxThreadsBuffer|MaxThreadsPerHotkey|MenuMaskKey|NoEnv|NoTrayIcon|Persistent|SingleInstance|UseHook|Warn|WinActivateForce)\b/i,keyword:/\b(?:Abort|AboveNormal|Add|ahk_class|ahk_exe|ahk_group|ahk_id|ahk_pid|All|Alnum|Alpha|AltSubmit|AltTab|AltTabAndMenu|AltTabMenu|AltTabMenuDismiss|AlwaysOnTop|AutoSize|Background|BackgroundTrans|BelowNormal|between|BitAnd|BitNot|BitOr|BitShiftLeft|BitShiftRight|BitXOr|Bold|Border|Button|ByRef|Checkbox|Checked|CheckedGray|Choose|ChooseString|Close|Color|ComboBox|Contains|ControlList|Count|Date|DateTime|Days|DDL|Default|DeleteAll|Delimiter|Deref|Destroy|Digit|Disable|Disabled|DropDownList|Edit|Eject|Else|Enable|Enabled|Error|Exist|Expand|ExStyle|FileSystem|First|Flash|Float|FloatFast|Focus|Font|for|global|Grid|Group|GroupBox|GuiClose|GuiContextMenu|GuiDropFiles|GuiEscape|GuiSize|Hdr|Hidden|Hide|High|HKCC|HKCR|HKCU|HKEY_CLASSES_ROOT|HKEY_CURRENT_CONFIG|HKEY_CURRENT_USER|HKEY_LOCAL_MACHINE|HKEY_USERS|HKLM|HKU|Hours|HScroll|Icon|IconSmall|ID|IDLast|If|IfEqual|IfExist|IfGreater|IfGreaterOrEqual|IfInString|IfLess|IfLessOrEqual|IfMsgBox|IfNotEqual|IfNotExist|IfNotInString|IfWinActive|IfWinExist|IfWinNotActive|IfWinNotExist|Ignore|ImageList|in|Integer|IntegerFast|Interrupt|is|italic|Join|Label|LastFound|LastFoundExist|Limit|Lines|List|ListBox|ListView|local|Lock|Logoff|Low|Lower|Lowercase|MainWindow|Margin|Maximize|MaximizeBox|MaxSize|Minimize|MinimizeBox|MinMax|MinSize|Minutes|MonthCal|Mouse|Move|Multi|NA|No|NoActivate|NoDefault|NoHide|NoIcon|NoMainWindow|norm|Normal|NoSort|NoSortHdr|NoStandard|Not|NoTab|NoTimers|Number|Off|Ok|On|OwnDialogs|Owner|Parse|Password|Picture|Pixel|Pos|Pow|Priority|ProcessName|Radio|Range|Read|ReadOnly|Realtime|Redraw|REG_BINARY|REG_DWORD|REG_EXPAND_SZ|REG_MULTI_SZ|REG_SZ|Region|Relative|Rename|Report|Resize|Restore|Retry|RGB|Screen|Seconds|Section|Serial|SetLabel|ShiftAltTab|Show|Single|Slider|SortDesc|Standard|static|Status|StatusBar|StatusCD|strike|Style|Submit|SysMenu|Tab2|TabStop|Text|Theme|Tile|ToggleCheck|ToggleEnable|ToolWindow|Top|Topmost|TransColor|Transparent|Tray|TreeView|TryAgain|Throw|Try|Catch|Finally|Type|UnCheck|underline|Unicode|Unlock|Until|UpDown|Upper|Uppercase|UseErrorLevel|Vis|VisFirst|Visible|VScroll|Wait|WaitClose|WantCtrlA|WantF2|WantReturn|While|Wrap|Xdigit|xm|xp|xs|Yes|ym|yp|ys)\b/i,function:/[^(); \t,\n+*\-=?>:\\\/<&%\[\]]+(?=\()/m,punctuation:/[{}[\]():,]/}}e.exports=t,t.displayName="autohotkey",t.aliases=[]},53358(e){"use strict";function t(e){e.languages.autoit={comment:[/;.*/,{pattern:/(^[\t ]*)#(?:comments-start|cs)[\s\S]*?^[ \t]*#(?:comments-end|ce)/m,lookbehind:!0}],url:{pattern:/(^[\t ]*#include\s+)(?:<[^\r\n>]+>|"[^\r\n"]+")/m,lookbehind:!0},string:{pattern:/(["'])(?:\1\1|(?!\1)[^\r\n])*\1/,greedy:!0,inside:{variable:/([%$@])\w+\1/}},directive:{pattern:/(^[\t ]*)#\w+/m,lookbehind:!0,alias:"keyword"},function:/\b\w+(?=\()/,variable:/[$@]\w+/,keyword:/\b(?:Case|Const|Continue(?:Case|Loop)|Default|Dim|Do|Else(?:If)?|End(?:Func|If|Select|Switch|With)|Enum|Exit(?:Loop)?|For|Func|Global|If|In|Local|Next|Null|ReDim|Select|Static|Step|Switch|Then|To|Until|Volatile|WEnd|While|With)\b/i,number:/\b(?:0x[\da-f]+|\d+(?:\.\d+)?(?:e[+-]?\d+)?)\b/i,boolean:/\b(?:True|False)\b/i,operator:/<[=>]?|[-+*\/=&>]=?|[?^]|\b(?:And|Or|Not)\b/i,punctuation:/[\[\]().,:]/}}e.exports=t,t.displayName="autoit",t.aliases=[]},6979(e){"use strict";function t(e){!function(e){var t="\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b",n={pattern:/(^(["']?)\w+\2)[ \t]+\S.*/,lookbehind:!0,alias:"punctuation",inside:null},r={bash:n,environment:{pattern:RegExp("\\$"+t),alias:"constant"},variable:[{pattern:/\$?\(\([\s\S]+?\)\)/,greedy:!0,inside:{variable:[{pattern:/(^\$\(\([\s\S]+)\)\)/,lookbehind:!0},/^\$\(\(/],number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,punctuation:/\(\(?|\)\)?|,|;/}},{pattern:/\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,greedy:!0,inside:{variable:/^\$\(|^`|\)$|`$/}},{pattern:/\$\{[^}]+\}/,greedy:!0,inside:{operator:/:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,punctuation:/[\[\]]/,environment:{pattern:RegExp("(\\{)"+t),lookbehind:!0,alias:"constant"}}},/\$(?:\w+|[#?*!@$])/],entity:/\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|x[0-9a-fA-F]{1,2}|u[0-9a-fA-F]{4}|U[0-9a-fA-F]{8})/};e.languages.bash={shebang:{pattern:/^#!\s*\/.*/,alias:"important"},comment:{pattern:/(^|[^"{\\$])#.*/,lookbehind:!0},"function-name":[{pattern:/(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,lookbehind:!0,alias:"function"},{pattern:/\b[\w-]+(?=\s*\(\s*\)\s*\{)/,alias:"function"}],"for-or-select":{pattern:/(\b(?:for|select)\s+)\w+(?=\s+in\s)/,alias:"variable",lookbehind:!0},"assign-left":{pattern:/(^|[\s;|&]|[<>]\()\w+(?=\+?=)/,inside:{environment:{pattern:RegExp("(^|[\\s;|&]|[<>]\\()"+t),lookbehind:!0,alias:"constant"}},alias:"variable",lookbehind:!0},string:[{pattern:/((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,lookbehind:!0,greedy:!0,inside:r},{pattern:/((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,lookbehind:!0,greedy:!0,inside:{bash:n}},{pattern:/(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,lookbehind:!0,greedy:!0,inside:r},{pattern:/(^|[^$\\])'[^']*'/,lookbehind:!0,greedy:!0},{pattern:/\$'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,inside:{entity:r.entity}}],environment:{pattern:RegExp("\\$?"+t),alias:"constant"},variable:r.variable,function:{pattern:/(^|[\s;|&]|[<>]\()(?:add|apropos|apt|aptitude|apt-cache|apt-get|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,lookbehind:!0},keyword:{pattern:/(^|[\s;|&]|[<>]\()(?:if|then|else|elif|fi|for|while|in|case|esac|function|select|do|done|until)(?=$|[)\s;|&])/,lookbehind:!0},builtin:{pattern:/(^|[\s;|&]|[<>]\()(?:\.|:|break|cd|continue|eval|exec|exit|export|getopts|hash|pwd|readonly|return|shift|test|times|trap|umask|unset|alias|bind|builtin|caller|command|declare|echo|enable|help|let|local|logout|mapfile|printf|read|readarray|source|type|typeset|ulimit|unalias|set|shopt)(?=$|[)\s;|&])/,lookbehind:!0,alias:"class-name"},boolean:{pattern:/(^|[\s;|&]|[<>]\()(?:true|false)(?=$|[)\s;|&])/,lookbehind:!0},"file-descriptor":{pattern:/\B&\d\b/,alias:"important"},operator:{pattern:/\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,inside:{"file-descriptor":{pattern:/^\d/,alias:"important"}}},punctuation:/\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,number:{pattern:/(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,lookbehind:!0}},n.inside=e.languages.bash;for(var i=["comment","function-name","for-or-select","assign-left","string","environment","function","keyword","builtin","boolean","file-descriptor","operator","punctuation","number"],a=r.variable[1].inside,o=0;o?^\w +\-.])*"/i,greedy:!0},number:/(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:E[+-]?\d+)?/i,keyword:/\b(?:AS|BEEP|BLOAD|BSAVE|CALL(?: ABSOLUTE)?|CASE|CHAIN|CHDIR|CLEAR|CLOSE|CLS|COM|COMMON|CONST|DATA|DECLARE|DEF(?: FN| SEG|DBL|INT|LNG|SNG|STR)|DIM|DO|DOUBLE|ELSE|ELSEIF|END|ENVIRON|ERASE|ERROR|EXIT|FIELD|FILES|FOR|FUNCTION|GET|GOSUB|GOTO|IF|INPUT|INTEGER|IOCTL|KEY|KILL|LINE INPUT|LOCATE|LOCK|LONG|LOOP|LSET|MKDIR|NAME|NEXT|OFF|ON(?: COM| ERROR| KEY| TIMER)?|OPEN|OPTION BASE|OUT|POKE|PUT|READ|REDIM|REM|RESTORE|RESUME|RETURN|RMDIR|RSET|RUN|SHARED|SINGLE|SELECT CASE|SHELL|SLEEP|STATIC|STEP|STOP|STRING|SUB|SWAP|SYSTEM|THEN|TIMER|TO|TROFF|TRON|TYPE|UNLOCK|UNTIL|USING|VIEW PRINT|WAIT|WEND|WHILE|WRITE)(?:\$|\b)/i,function:/\b(?:ABS|ACCESS|ACOS|ANGLE|AREA|ARITHMETIC|ARRAY|ASIN|ASK|AT|ATN|BASE|BEGIN|BREAK|CAUSE|CEIL|CHR|CLIP|COLLATE|COLOR|CON|COS|COSH|COT|CSC|DATE|DATUM|DEBUG|DECIMAL|DEF|DEG|DEGREES|DELETE|DET|DEVICE|DISPLAY|DOT|ELAPSED|EPS|ERASABLE|EXLINE|EXP|EXTERNAL|EXTYPE|FILETYPE|FIXED|FP|GO|GRAPH|HANDLER|IDN|IMAGE|IN|INT|INTERNAL|IP|IS|KEYED|LBOUND|LCASE|LEFT|LEN|LENGTH|LET|LINE|LINES|LOG|LOG10|LOG2|LTRIM|MARGIN|MAT|MAX|MAXNUM|MID|MIN|MISSING|MOD|NATIVE|NUL|NUMERIC|OF|OPTION|ORD|ORGANIZATION|OUTIN|OUTPUT|PI|POINT|POINTER|POINTS|POS|PRINT|PROGRAM|PROMPT|RAD|RADIANS|RANDOMIZE|RECORD|RECSIZE|RECTYPE|RELATIVE|REMAINDER|REPEAT|REST|RETRY|REWRITE|RIGHT|RND|ROUND|RTRIM|SAME|SEC|SELECT|SEQUENTIAL|SET|SETTER|SGN|SIN|SINH|SIZE|SKIP|SQR|STANDARD|STATUS|STR|STREAM|STYLE|TAB|TAN|TANH|TEMPLATE|TEXT|THERE|TIME|TIMEOUT|TRACE|TRANSFORM|TRUNCATE|UBOUND|UCASE|USE|VAL|VARIABLE|VIEWPORT|WHEN|WINDOW|WITH|ZER|ZONEWIDTH)(?:\$|\b)/i,operator:/<[=>]?|>=?|[+\-*\/^=&]|\b(?:AND|EQV|IMP|NOT|OR|XOR)\b/i,punctuation:/[,;:()]/}}e.exports=t,t.displayName="basic",t.aliases=[]},94781(e){"use strict";function t(e){var t,n,r,i,a;n=/%%?[~:\w]+%?|!\S+!/,r={pattern:/\/[a-z?]+(?=[ :]|$):?|-[a-z]\b|--[a-z-]+\b/im,alias:"attr-name",inside:{punctuation:/:/}},i=/"(?:[\\"]"|[^"])*"(?!")/,a=/(?:\b|-)\d+\b/,(t=e).languages.batch={comment:[/^::.*/m,{pattern:/((?:^|[&(])[ \t]*)rem\b(?:[^^&)\r\n]|\^(?:\r\n|[\s\S]))*/im,lookbehind:!0}],label:{pattern:/^:.*/m,alias:"property"},command:[{pattern:/((?:^|[&(])[ \t]*)for(?: \/[a-z?](?:[ :](?:"[^"]*"|[^\s"/]\S*))?)* \S+ in \([^)]+\) do/im,lookbehind:!0,inside:{keyword:/^for\b|\b(?:in|do)\b/i,string:i,parameter:r,variable:n,number:a,punctuation:/[()',]/}},{pattern:/((?:^|[&(])[ \t]*)if(?: \/[a-z?](?:[ :](?:"[^"]*"|[^\s"/]\S*))?)* (?:not )?(?:cmdextversion \d+|defined \w+|errorlevel \d+|exist \S+|(?:"[^"]*"|(?!")(?:(?!==)\S)+)?(?:==| (?:equ|neq|lss|leq|gtr|geq) )(?:"[^"]*"|[^\s"]\S*))/im,lookbehind:!0,inside:{keyword:/^if\b|\b(?:not|cmdextversion|defined|errorlevel|exist)\b/i,string:i,parameter:r,variable:n,number:a,operator:/\^|==|\b(?:equ|neq|lss|leq|gtr|geq)\b/i}},{pattern:/((?:^|[&()])[ \t]*)else\b/im,lookbehind:!0,inside:{keyword:/^else\b/i}},{pattern:/((?:^|[&(])[ \t]*)set(?: \/[a-z](?:[ :](?:"[^"]*"|[^\s"/]\S*))?)* (?:[^^&)\r\n]|\^(?:\r\n|[\s\S]))*/im,lookbehind:!0,inside:{keyword:/^set\b/i,string:i,parameter:r,variable:[n,/\w+(?=(?:[*\/%+\-&^|]|<<|>>)?=)/],number:a,operator:/[*\/%+\-&^|]=?|<<=?|>>=?|[!~_=]/,punctuation:/[()',]/}},{pattern:/((?:^|[&(])[ \t]*@?)\w+\b(?:"(?:[\\"]"|[^"])*"(?!")|[^"^&)\r\n]|\^(?:\r\n|[\s\S]))*/im,lookbehind:!0,inside:{keyword:/^\w+\b/i,string:i,parameter:r,label:{pattern:/(^\s*):\S+/m,lookbehind:!0,alias:"property"},variable:n,number:a,operator:/\^/}}],operator:/[&@]/,punctuation:/[()']/}}e.exports=t,t.displayName="batch",t.aliases=[]},62260(e){"use strict";function t(e){e.languages.bbcode={tag:{pattern:/\[\/?[^\s=\]]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'"\]=]+))?(?:\s+[^\s=\]]+\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'"\]=]+))*\s*\]/,inside:{tag:{pattern:/^\[\/?[^\s=\]]+/,inside:{punctuation:/^\[\/?/}},"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'"\]=]+)/i,inside:{punctuation:[/^=/,{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\]/,"attr-name":/[^\s=\]]+/}}},e.languages.shortcode=e.languages.bbcode}e.exports=t,t.displayName="bbcode",t.aliases=["shortcode"]},59258(e){"use strict";function t(e){e.languages.birb=e.languages.extend("clike",{string:{pattern:/r?("|')(?:\\.|(?!\1)[^\\])*\1/,greedy:!0},"class-name":[/\b[A-Z](?:[\d_]*[a-zA-Z]\w*)?\b/,/\b[A-Z]\w*(?=\s+\w+\s*[;,=()])/],keyword:/\b(?:assert|break|case|class|const|default|else|enum|final|follows|for|grab|if|nest|next|new|noSeeb|return|static|switch|throw|var|void|while)\b/,operator:/\+\+|--|&&|\|\||<<=?|>>=?|~(?:\/=?)?|[+\-*\/%&^|=!<>]=?|\?|:/,variable:/\b[a-z_]\w*\b/}),e.languages.insertBefore("birb","function",{metadata:{pattern:/<\w+>/,greedy:!0,alias:"symbol"}})}e.exports=t,t.displayName="birb",t.aliases=[]},62890(e,t,n){"use strict";var r=n(65806);function i(e){e.register(r),e.languages.bison=e.languages.extend("c",{}),e.languages.insertBefore("bison","comment",{bison:{pattern:/^(?:[^%]|%(?!%))*%%[\s\S]*?%%/,inside:{c:{pattern:/%\{[\s\S]*?%\}|\{(?:\{[^}]*\}|[^{}])*\}/,inside:{delimiter:{pattern:/^%?\{|%?\}$/,alias:"punctuation"},"bison-variable":{pattern:/[$@](?:<[^\s>]+>)?[\w$]+/,alias:"variable",inside:{punctuation:/<|>/}},rest:e.languages.c}},comment:e.languages.c.comment,string:e.languages.c.string,property:/\S+(?=:)/,keyword:/%\w+/,number:{pattern:/(^|[^@])\b(?:0x[\da-f]+|\d+)/i,lookbehind:!0},punctuation:/%[%?]|[|:;\[\]<>]/}}})}e.exports=i,i.displayName="bison",i.aliases=[]},15958(e){"use strict";function t(e){e.languages.bnf={string:{pattern:/"[^\r\n"]*"|'[^\r\n']*'/},definition:{pattern:/<[^<>\r\n\t]+>(?=\s*::=)/,alias:["rule","keyword"],inside:{punctuation:/^<|>$/}},rule:{pattern:/<[^<>\r\n\t]+>/,inside:{punctuation:/^<|>$/}},operator:/::=|[|()[\]{}*+?]|\.{3}/},e.languages.rbnf=e.languages.bnf}e.exports=t,t.displayName="bnf",t.aliases=["rbnf"]},61321(e){"use strict";function t(e){e.languages.brainfuck={pointer:{pattern:/<|>/,alias:"keyword"},increment:{pattern:/\+/,alias:"inserted"},decrement:{pattern:/-/,alias:"deleted"},branching:{pattern:/\[|\]/,alias:"important"},operator:/[.,]/,comment:/\S+/}}e.exports=t,t.displayName="brainfuck",t.aliases=[]},77856(e){"use strict";function t(e){e.languages.brightscript={comment:/(?:\brem|').*/i,"directive-statement":{pattern:/(^[\t ]*)#(?:const|else(?:[\t ]+if)?|end[\t ]+if|error|if).*/im,lookbehind:!0,alias:"property",inside:{"error-message":{pattern:/(^#error).+/,lookbehind:!0},directive:{pattern:/^#(?:const|else(?:[\t ]+if)?|end[\t ]+if|error|if)/,alias:"keyword"},expression:{pattern:/[\s\S]+/,inside:null}}},property:{pattern:/([\r\n{,][\t ]*)(?:(?!\d)\w+|"(?:[^"\r\n]|"")*"(?!"))(?=[ \t]*:)/,lookbehind:!0,greedy:!0},string:{pattern:/"(?:[^"\r\n]|"")*"(?!")/,greedy:!0},"class-name":{pattern:/(\bAs[\t ]+)\w+/i,lookbehind:!0},keyword:/\b(?:As|Dim|Each|Else|Elseif|End|Exit|For|Function|Goto|If|In|Print|Return|Step|Stop|Sub|Then|To|While)\b/i,boolean:/\b(?:true|false)\b/i,function:/\b(?!\d)\w+(?=[\t ]*\()/i,number:/(?:\b\d+(?:\.\d+)?(?:[ed][+-]\d+)?|&h[a-f\d]+)\b[%&!#]?/i,operator:/--|\+\+|>>=?|<<=?|<>|[-+*/\\<>]=?|[:^=?]|\b(?:and|mod|not|or)\b/i,punctuation:/[.,;()[\]{}]/,constant:/\b(?:LINE_NUM)\b/i},e.languages.brightscript["directive-statement"].inside.expression.inside=e.languages.brightscript}e.exports=t,t.displayName="brightscript",t.aliases=[]},90741(e){"use strict";function t(e){e.languages.bro={comment:{pattern:/(^|[^\\$])#.*/,lookbehind:!0,inside:{italic:/\b(?:TODO|FIXME|XXX)\b/}},string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},boolean:/\b[TF]\b/,function:{pattern:/(?:function|hook|event) \w+(?:::\w+)?/,inside:{keyword:/^(?:function|hook|event)/}},variable:{pattern:/(?:global|local) \w+/i,inside:{keyword:/(?:global|local)/}},builtin:/(?:@(?:load(?:-(?:sigs|plugin))?|unload|prefixes|ifn?def|else|(?:end)?if|DIR|FILENAME))|(?:&?(?:redef|priority|log|optional|default|add_func|delete_func|expire_func|read_expire|write_expire|create_expire|synchronized|persistent|rotate_interval|rotate_size|encrypt|raw_output|mergeable|group|error_handler|type_column))/,constant:{pattern:/const \w+/i,inside:{keyword:/const/}},keyword:/\b(?:break|next|continue|alarm|using|of|add|delete|export|print|return|schedule|when|timeout|addr|any|bool|count|double|enum|file|int|interval|pattern|opaque|port|record|set|string|subnet|table|time|vector|for|if|else|in|module|function)\b/,operator:/--?|\+\+?|!=?=?|<=?|>=?|==?=?|&&|\|\|?|\?|\*|\/|~|\^|%/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,punctuation:/[{}[\];(),.:]/}}e.exports=t,t.displayName="bro",t.aliases=[]},83410(e){"use strict";function t(e){e.languages.bsl={comment:/\/\/.*/,string:[{pattern:/"(?:[^"]|"")*"(?!")/,greedy:!0},{pattern:/'(?:[^'\r\n\\]|\\.)*'/}],keyword:[{pattern:/(^|[^\w\u0400-\u0484\u0487-\u052f\u1d2b\u1d78\u2de0-\u2dff\ua640-\ua69f\ufe2e\ufe2f])(?:пока|для|новый|прервать|попытка|исключение|вызватьисключение|иначе|конецпопытки|неопределено|функция|перем|возврат|конецфункции|если|иначеесли|процедура|конецпроцедуры|тогда|знач|экспорт|конецесли|из|каждого|истина|ложь|по|цикл|конеццикла|выполнить)(?![\w\u0400-\u0484\u0487-\u052f\u1d2b\u1d78\u2de0-\u2dff\ua640-\ua69f\ufe2e\ufe2f])/i,lookbehind:!0},{pattern:/\b(?:while|for|new|break|try|except|raise|else|endtry|undefined|function|var|return|endfunction|null|if|elseif|procedure|endprocedure|then|val|export|endif|in|each|true|false|to|do|enddo|execute)\b/i}],number:{pattern:/(^(?=\d)|[^\w\u0400-\u0484\u0487-\u052f\u1d2b\u1d78\u2de0-\u2dff\ua640-\ua69f\ufe2e\ufe2f])(?:\d+(?:\.\d*)?|\.\d+)(?:E[+-]?\d+)?/i,lookbehind:!0},operator:[/[<>+\-*/]=?|[%=]/,{pattern:/(^|[^\w\u0400-\u0484\u0487-\u052f\u1d2b\u1d78\u2de0-\u2dff\ua640-\ua69f\ufe2e\ufe2f])(?:и|или|не)(?![\w\u0400-\u0484\u0487-\u052f\u1d2b\u1d78\u2de0-\u2dff\ua640-\ua69f\ufe2e\ufe2f])/i,lookbehind:!0},{pattern:/\b(?:and|or|not)\b/i}],punctuation:/\(\.|\.\)|[()\[\]:;,.]/,directive:[{pattern:/^(\s*)&.*/m,lookbehind:!0,alias:"important"},{pattern:/^\s*#.*/gm,alias:"important"}]},e.languages.oscript=e.languages.bsl}e.exports=t,t.displayName="bsl",t.aliases=[]},65806(e){"use strict";function t(e){e.languages.c=e.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:__attribute__|_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|asm|typeof|inline|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),e.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},e.languages.c.string],comment:e.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:e.languages.c}}},constant:/\b(?:__FILE__|__LINE__|__DATE__|__TIME__|__TIMESTAMP__|__func__|EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|stdin|stdout|stderr)\b/}),delete e.languages.c.boolean}e.exports=t,t.displayName="c",t.aliases=[]},33039(e){"use strict";function t(e){e.languages.cfscript=e.languages.extend("clike",{comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,inside:{annotation:{pattern:/(?:^|[^.])@[\w\.]+/,alias:"punctuation"}}},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],keyword:/\b(?:abstract|break|catch|component|continue|default|do|else|extends|final|finally|for|function|if|in|include|package|private|property|public|remote|required|rethrow|return|static|switch|throw|try|var|while|xml)\b(?!\s*=)/,operator:[/\+\+|--|&&|\|\||::|=>|[!=]==|<=?|>=?|[-+*/%&|^!=<>]=?|\?(?:\.|:)?|[?:]/,/\b(?:and|contains|eq|equal|eqv|gt|gte|imp|is|lt|lte|mod|not|or|xor)\b/],scope:{pattern:/\b(?:application|arguments|cgi|client|cookie|local|session|super|this|variables)\b/,alias:"global"},type:{pattern:/\b(?:any|array|binary|boolean|date|guid|numeric|query|string|struct|uuid|void|xml)\b/,alias:"builtin"}}),e.languages.insertBefore("cfscript","keyword",{"function-variable":{pattern:/[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"}}),delete e.languages.cfscript["class-name"],e.languages.cfc=e.languages.cfscript}e.exports=t,t.displayName="cfscript",t.aliases=[]},85082(e,t,n){"use strict";var r=n(80096);function i(e){e.register(r),e.languages.chaiscript=e.languages.extend("clike",{string:{pattern:/(^|[^\\])'(?:[^'\\]|\\[\s\S])*'/,lookbehind:!0,greedy:!0},"class-name":[{pattern:/(\bclass\s+)\w+/,lookbehind:!0},{pattern:/(\b(?:attr|def)\s+)\w+(?=\s*::)/,lookbehind:!0}],keyword:/\b(?:attr|auto|break|case|catch|class|continue|def|default|else|finally|for|fun|global|if|return|switch|this|try|var|while)\b/,number:[e.languages.cpp.number,/\b(?:Infinity|NaN)\b/],operator:/>>=?|<<=?|\|\||&&|:[:=]?|--|\+\+|[=!<>+\-*/%|&^]=?|[?~]|`[^`\r\n]{1,4}`/}),e.languages.insertBefore("chaiscript","operator",{"parameter-type":{pattern:/([,(]\s*)\w+(?=\s+\w)/,lookbehind:!0,alias:"class-name"}}),e.languages.insertBefore("chaiscript","string",{"string-interpolation":{pattern:/(^|[^\\])"(?:[^"$\\]|\\[\s\S]|\$(?!\{)|\$\{(?:[^{}]|\{(?:[^{}]|\{[^{}]*\})*\})*\})*"/,lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^{}]*\})*\})*\}/,lookbehind:!0,inside:{"interpolation-expression":{pattern:/(^\$\{)[\s\S]+(?=\}$)/,lookbehind:!0,inside:e.languages.chaiscript},"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"}}},string:/[\s\S]+/}}})}e.exports=i,i.displayName="chaiscript",i.aliases=[]},79415(e){"use strict";function t(e){e.languages.cil={comment:/\/\/.*/,string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},directive:{pattern:/(^|\W)\.[a-z]+(?=\s)/,lookbehind:!0,alias:"class-name"},variable:/\[[\w\.]+\]/,keyword:/\b(?:abstract|ansi|assembly|auto|autochar|beforefieldinit|bool|bstr|byvalstr|catch|char|cil|class|currency|date|decimal|default|enum|error|explicit|extends|extern|famandassem|family|famorassem|final(?:ly)?|float32|float64|hidebysig|iant|idispatch|implements|import|initonly|instance|u?int(?:8|16|32|64)?|interface|iunknown|literal|lpstr|lpstruct|lptstr|lpwstr|managed|method|native(?:Type)?|nested|newslot|object(?:ref)?|pinvokeimpl|private|privatescope|public|reqsecobj|rtspecialname|runtime|sealed|sequential|serializable|specialname|static|string|struct|syschar|tbstr|unicode|unmanagedexp|unsigned|value(?:type)?|variant|virtual|void)\b/,function:/\b(?:(?:constrained|unaligned|volatile|readonly|tail|no)\.)?(?:conv\.(?:[iu][1248]?|ovf\.[iu][1248]?(?:\.un)?|r\.un|r4|r8)|ldc\.(?:i4(?:\.[0-9]+|\.[mM]1|\.s)?|i8|r4|r8)|ldelem(?:\.[iu][1248]?|\.r[48]|\.ref|a)?|ldind\.(?:[iu][1248]?|r[48]|ref)|stelem\.?(?:i[1248]?|r[48]|ref)?|stind\.(?:i[1248]?|r[48]|ref)?|end(?:fault|filter|finally)|ldarg(?:\.[0-3s]|a(?:\.s)?)?|ldloc(?:\.[0-9]+|\.s)?|sub(?:\.ovf(?:\.un)?)?|mul(?:\.ovf(?:\.un)?)?|add(?:\.ovf(?:\.un)?)?|stloc(?:\.[0-3s])?|refany(?:type|val)|blt(?:\.un)?(?:\.s)?|ble(?:\.un)?(?:\.s)?|bgt(?:\.un)?(?:\.s)?|bge(?:\.un)?(?:\.s)?|unbox(?:\.any)?|init(?:blk|obj)|call(?:i|virt)?|brfalse(?:\.s)?|bne\.un(?:\.s)?|ldloca(?:\.s)?|brzero(?:\.s)?|brtrue(?:\.s)?|brnull(?:\.s)?|brinst(?:\.s)?|starg(?:\.s)?|leave(?:\.s)?|shr(?:\.un)?|rem(?:\.un)?|div(?:\.un)?|clt(?:\.un)?|alignment|ldvirtftn|castclass|beq(?:\.s)?|mkrefany|localloc|ckfinite|rethrow|ldtoken|ldsflda|cgt\.un|arglist|switch|stsfld|sizeof|newobj|newarr|ldsfld|ldnull|ldflda|isinst|throw|stobj|stfld|ldstr|ldobj|ldlen|ldftn|ldfld|cpobj|cpblk|break|br\.s|xor|shl|ret|pop|not|nop|neg|jmp|dup|cgt|ceq|box|and|or|br)\b/,boolean:/\b(?:true|false)\b/,number:/\b-?(?:0x[0-9a-f]+|[0-9]+)(?:\.[0-9a-f]+)?\b/i,punctuation:/[{}[\];(),:=]|IL_[0-9A-Za-z]+/}}e.exports=t,t.displayName="cil",t.aliases=[]},29726(e){"use strict";function t(e){e.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|interface|extends|implements|trait|instanceof|new)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/,boolean:/\b(?:true|false)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/}}e.exports=t,t.displayName="clike",t.aliases=[]},62849(e){"use strict";function t(e){e.languages.clojure={comment:/;.*/,string:{pattern:/"(?:[^"\\]|\\.)*"/,greedy:!0},operator:/(?:::|[:|'])\b[a-z][\w*+!?-]*\b/i,keyword:{pattern:/([^\w+*'?-])(?:def|if|do|let|\.\.|quote|var|->>|->|fn|loop|recur|throw|try|monitor-enter|\.|new|set!|def-|defn|defn-|defmacro|defmulti|defmethod|defstruct|defonce|declare|definline|definterface|defprotocol|==|defrecord|>=|deftype|<=|defproject|ns|\*|\+|-|\/|<|=|>|accessor|agent|agent-errors|aget|alength|all-ns|alter|and|append-child|apply|array-map|aset|aset-boolean|aset-byte|aset-char|aset-double|aset-float|aset-int|aset-long|aset-short|assert|assoc|await|await-for|bean|binding|bit-and|bit-not|bit-or|bit-shift-left|bit-shift-right|bit-xor|boolean|branch\?|butlast|byte|cast|char|children|class|clear-agent-errors|comment|commute|comp|comparator|complement|concat|conj|cons|constantly|cond|if-not|construct-proxy|contains\?|count|create-ns|create-struct|cycle|dec|deref|difference|disj|dissoc|distinct|doall|doc|dorun|doseq|dosync|dotimes|doto|double|down|drop|drop-while|edit|end\?|ensure|eval|every\?|false\?|ffirst|file-seq|filter|find|find-doc|find-ns|find-var|first|float|flush|for|fnseq|frest|gensym|get-proxy-class|get|hash-map|hash-set|identical\?|identity|if-let|import|in-ns|inc|index|insert-child|insert-left|insert-right|inspect-table|inspect-tree|instance\?|int|interleave|intersection|into|into-array|iterate|join|key|keys|keyword|keyword\?|last|lazy-cat|lazy-cons|left|lefts|line-seq|list\*|list|load|load-file|locking|long|macroexpand|macroexpand-1|make-array|make-node|map|map-invert|map\?|mapcat|max|max-key|memfn|merge|merge-with|meta|min|min-key|name|namespace|neg\?|newline|next|nil\?|node|not|not-any\?|not-every\?|not=|ns-imports|ns-interns|ns-map|ns-name|ns-publics|ns-refers|ns-resolve|ns-unmap|nth|nthrest|or|parse|partial|path|peek|pop|pos\?|pr|pr-str|print|print-str|println|println-str|prn|prn-str|project|proxy|proxy-mappings|quot|rand|rand-int|range|re-find|re-groups|re-matcher|re-matches|re-pattern|re-seq|read|read-line|reduce|ref|ref-set|refer|rem|remove|remove-method|remove-ns|rename|rename-keys|repeat|replace|replicate|resolve|rest|resultset-seq|reverse|rfirst|right|rights|root|rrest|rseq|second|select|select-keys|send|send-off|seq|seq-zip|seq\?|set|short|slurp|some|sort|sort-by|sorted-map|sorted-map-by|sorted-set|special-symbol\?|split-at|split-with|str|string\?|struct|struct-map|subs|subvec|symbol|symbol\?|sync|take|take-nth|take-while|test|time|to-array|to-array-2d|tree-seq|true\?|union|up|update-proxy|val|vals|var-get|var-set|var\?|vector|vector-zip|vector\?|when|when-first|when-let|when-not|with-local-vars|with-meta|with-open|with-out-str|xml-seq|xml-zip|zero\?|zipmap|zipper)(?=[^\w+*'?-])/,lookbehind:!0},boolean:/\b(?:true|false|nil)\b/,number:/\b[\da-f]+\b/i,punctuation:/[{}\[\](),]/}}e.exports=t,t.displayName="clojure",t.aliases=[]},55773(e){"use strict";function t(e){e.languages.cmake={comment:/#.*/,string:{pattern:/"(?:[^\\"]|\\.)*"/,greedy:!0,inside:{interpolation:{pattern:/\$\{(?:[^{}$]|\$\{[^{}$]*\})*\}/,inside:{punctuation:/\$\{|\}/,variable:/\w+/}}}},variable:/\b(?:CMAKE_\w+|\w+_(?:VERSION(?:_MAJOR|_MINOR|_PATCH|_TWEAK)?|(?:BINARY|SOURCE)_DIR|DESCRIPTION|HOMEPAGE_URL|ROOT)|(?:ANDROID|APPLE|BORLAND|BUILD_SHARED_LIBS|CACHE|CPACK_(?:ABSOLUTE_DESTINATION_FILES|COMPONENT_INCLUDE_TOPLEVEL_DIRECTORY|ERROR_ON_ABSOLUTE_INSTALL_DESTINATION|INCLUDE_TOPLEVEL_DIRECTORY|INSTALL_DEFAULT_DIRECTORY_PERMISSIONS|INSTALL_SCRIPT|PACKAGING_INSTALL_PREFIX|SET_DESTDIR|WARN_ON_ABSOLUTE_INSTALL_DESTINATION)|CTEST_(?:BINARY_DIRECTORY|BUILD_COMMAND|BUILD_NAME|BZR_COMMAND|BZR_UPDATE_OPTIONS|CHANGE_ID|CHECKOUT_COMMAND|CONFIGURATION_TYPE|CONFIGURE_COMMAND|COVERAGE_COMMAND|COVERAGE_EXTRA_FLAGS|CURL_OPTIONS|CUSTOM_(?:COVERAGE_EXCLUDE|ERROR_EXCEPTION|ERROR_MATCH|ERROR_POST_CONTEXT|ERROR_PRE_CONTEXT|MAXIMUM_FAILED_TEST_OUTPUT_SIZE|MAXIMUM_NUMBER_OF_(?:ERRORS|WARNINGS)|MAXIMUM_PASSED_TEST_OUTPUT_SIZE|MEMCHECK_IGNORE|POST_MEMCHECK|POST_TEST|PRE_MEMCHECK|PRE_TEST|TESTS_IGNORE|WARNING_EXCEPTION|WARNING_MATCH)|CVS_CHECKOUT|CVS_COMMAND|CVS_UPDATE_OPTIONS|DROP_LOCATION|DROP_METHOD|DROP_SITE|DROP_SITE_CDASH|DROP_SITE_PASSWORD|DROP_SITE_USER|EXTRA_COVERAGE_GLOB|GIT_COMMAND|GIT_INIT_SUBMODULES|GIT_UPDATE_CUSTOM|GIT_UPDATE_OPTIONS|HG_COMMAND|HG_UPDATE_OPTIONS|LABELS_FOR_SUBPROJECTS|MEMORYCHECK_(?:COMMAND|COMMAND_OPTIONS|SANITIZER_OPTIONS|SUPPRESSIONS_FILE|TYPE)|NIGHTLY_START_TIME|P4_CLIENT|P4_COMMAND|P4_OPTIONS|P4_UPDATE_OPTIONS|RUN_CURRENT_SCRIPT|SCP_COMMAND|SITE|SOURCE_DIRECTORY|SUBMIT_URL|SVN_COMMAND|SVN_OPTIONS|SVN_UPDATE_OPTIONS|TEST_LOAD|TEST_TIMEOUT|TRIGGER_SITE|UPDATE_COMMAND|UPDATE_OPTIONS|UPDATE_VERSION_ONLY|USE_LAUNCHERS)|CYGWIN|ENV|EXECUTABLE_OUTPUT_PATH|GHS-MULTI|IOS|LIBRARY_OUTPUT_PATH|MINGW|MSVC(?:10|11|12|14|60|70|71|80|90|_IDE|_TOOLSET_VERSION|_VERSION)?|MSYS|PROJECT_(?:BINARY_DIR|DESCRIPTION|HOMEPAGE_URL|NAME|SOURCE_DIR|VERSION|VERSION_(?:MAJOR|MINOR|PATCH|TWEAK))|UNIX|WIN32|WINCE|WINDOWS_PHONE|WINDOWS_STORE|XCODE|XCODE_VERSION))\b/,property:/\b(?:cxx_\w+|(?:ARCHIVE_OUTPUT_(?:DIRECTORY|NAME)|COMPILE_DEFINITIONS|COMPILE_PDB_NAME|COMPILE_PDB_OUTPUT_DIRECTORY|EXCLUDE_FROM_DEFAULT_BUILD|IMPORTED_(?:IMPLIB|LIBNAME|LINK_DEPENDENT_LIBRARIES|LINK_INTERFACE_LANGUAGES|LINK_INTERFACE_LIBRARIES|LINK_INTERFACE_MULTIPLICITY|LOCATION|NO_SONAME|OBJECTS|SONAME)|INTERPROCEDURAL_OPTIMIZATION|LIBRARY_OUTPUT_DIRECTORY|LIBRARY_OUTPUT_NAME|LINK_FLAGS|LINK_INTERFACE_LIBRARIES|LINK_INTERFACE_MULTIPLICITY|LOCATION|MAP_IMPORTED_CONFIG|OSX_ARCHITECTURES|OUTPUT_NAME|PDB_NAME|PDB_OUTPUT_DIRECTORY|RUNTIME_OUTPUT_DIRECTORY|RUNTIME_OUTPUT_NAME|STATIC_LIBRARY_FLAGS|VS_CSHARP|VS_DOTNET_REFERENCEPROP|VS_DOTNET_REFERENCE|VS_GLOBAL_SECTION_POST|VS_GLOBAL_SECTION_PRE|VS_GLOBAL|XCODE_ATTRIBUTE)_\w+|\w+_(?:CLANG_TIDY|COMPILER_LAUNCHER|CPPCHECK|CPPLINT|INCLUDE_WHAT_YOU_USE|OUTPUT_NAME|POSTFIX|VISIBILITY_PRESET)|ABSTRACT|ADDITIONAL_MAKE_CLEAN_FILES|ADVANCED|ALIASED_TARGET|ALLOW_DUPLICATE_CUSTOM_TARGETS|ANDROID_(?:ANT_ADDITIONAL_OPTIONS|API|API_MIN|ARCH|ASSETS_DIRECTORIES|GUI|JAR_DEPENDENCIES|NATIVE_LIB_DEPENDENCIES|NATIVE_LIB_DIRECTORIES|PROCESS_MAX|PROGUARD|PROGUARD_CONFIG_PATH|SECURE_PROPS_PATH|SKIP_ANT_STEP|STL_TYPE)|ARCHIVE_OUTPUT_DIRECTORY|ATTACHED_FILES|ATTACHED_FILES_ON_FAIL|AUTOGEN_(?:BUILD_DIR|ORIGIN_DEPENDS|PARALLEL|SOURCE_GROUP|TARGETS_FOLDER|TARGET_DEPENDS)|AUTOMOC|AUTOMOC_(?:COMPILER_PREDEFINES|DEPEND_FILTERS|EXECUTABLE|MACRO_NAMES|MOC_OPTIONS|SOURCE_GROUP|TARGETS_FOLDER)|AUTORCC|AUTORCC_EXECUTABLE|AUTORCC_OPTIONS|AUTORCC_SOURCE_GROUP|AUTOUIC|AUTOUIC_EXECUTABLE|AUTOUIC_OPTIONS|AUTOUIC_SEARCH_PATHS|BINARY_DIR|BUILDSYSTEM_TARGETS|BUILD_RPATH|BUILD_RPATH_USE_ORIGIN|BUILD_WITH_INSTALL_NAME_DIR|BUILD_WITH_INSTALL_RPATH|BUNDLE|BUNDLE_EXTENSION|CACHE_VARIABLES|CLEAN_NO_CUSTOM|COMMON_LANGUAGE_RUNTIME|COMPATIBLE_INTERFACE_(?:BOOL|NUMBER_MAX|NUMBER_MIN|STRING)|COMPILE_(?:DEFINITIONS|FEATURES|FLAGS|OPTIONS|PDB_NAME|PDB_OUTPUT_DIRECTORY)|COST|CPACK_DESKTOP_SHORTCUTS|CPACK_NEVER_OVERWRITE|CPACK_PERMANENT|CPACK_STARTUP_SHORTCUTS|CPACK_START_MENU_SHORTCUTS|CPACK_WIX_ACL|CROSSCOMPILING_EMULATOR|CUDA_EXTENSIONS|CUDA_PTX_COMPILATION|CUDA_RESOLVE_DEVICE_SYMBOLS|CUDA_SEPARABLE_COMPILATION|CUDA_STANDARD|CUDA_STANDARD_REQUIRED|CXX_EXTENSIONS|CXX_STANDARD|CXX_STANDARD_REQUIRED|C_EXTENSIONS|C_STANDARD|C_STANDARD_REQUIRED|DEBUG_CONFIGURATIONS|DEFINE_SYMBOL|DEFINITIONS|DEPENDS|DEPLOYMENT_ADDITIONAL_FILES|DEPLOYMENT_REMOTE_DIRECTORY|DISABLED|DISABLED_FEATURES|ECLIPSE_EXTRA_CPROJECT_CONTENTS|ECLIPSE_EXTRA_NATURES|ENABLED_FEATURES|ENABLED_LANGUAGES|ENABLE_EXPORTS|ENVIRONMENT|EXCLUDE_FROM_ALL|EXCLUDE_FROM_DEFAULT_BUILD|EXPORT_NAME|EXPORT_PROPERTIES|EXTERNAL_OBJECT|EchoString|FAIL_REGULAR_EXPRESSION|FIND_LIBRARY_USE_LIB32_PATHS|FIND_LIBRARY_USE_LIB64_PATHS|FIND_LIBRARY_USE_LIBX32_PATHS|FIND_LIBRARY_USE_OPENBSD_VERSIONING|FIXTURES_CLEANUP|FIXTURES_REQUIRED|FIXTURES_SETUP|FOLDER|FRAMEWORK|Fortran_FORMAT|Fortran_MODULE_DIRECTORY|GENERATED|GENERATOR_FILE_NAME|GENERATOR_IS_MULTI_CONFIG|GHS_INTEGRITY_APP|GHS_NO_SOURCE_GROUP_FILE|GLOBAL_DEPENDS_DEBUG_MODE|GLOBAL_DEPENDS_NO_CYCLES|GNUtoMS|HAS_CXX|HEADER_FILE_ONLY|HELPSTRING|IMPLICIT_DEPENDS_INCLUDE_TRANSFORM|IMPORTED|IMPORTED_(?:COMMON_LANGUAGE_RUNTIME|CONFIGURATIONS|GLOBAL|IMPLIB|LIBNAME|LINK_DEPENDENT_LIBRARIES|LINK_INTERFACE_(?:LANGUAGES|LIBRARIES|MULTIPLICITY)|LOCATION|NO_SONAME|OBJECTS|SONAME)|IMPORT_PREFIX|IMPORT_SUFFIX|INCLUDE_DIRECTORIES|INCLUDE_REGULAR_EXPRESSION|INSTALL_NAME_DIR|INSTALL_RPATH|INSTALL_RPATH_USE_LINK_PATH|INTERFACE_(?:AUTOUIC_OPTIONS|COMPILE_DEFINITIONS|COMPILE_FEATURES|COMPILE_OPTIONS|INCLUDE_DIRECTORIES|LINK_DEPENDS|LINK_DIRECTORIES|LINK_LIBRARIES|LINK_OPTIONS|POSITION_INDEPENDENT_CODE|SOURCES|SYSTEM_INCLUDE_DIRECTORIES)|INTERPROCEDURAL_OPTIMIZATION|IN_TRY_COMPILE|IOS_INSTALL_COMBINED|JOB_POOLS|JOB_POOL_COMPILE|JOB_POOL_LINK|KEEP_EXTENSION|LABELS|LANGUAGE|LIBRARY_OUTPUT_DIRECTORY|LINKER_LANGUAGE|LINK_(?:DEPENDS|DEPENDS_NO_SHARED|DIRECTORIES|FLAGS|INTERFACE_LIBRARIES|INTERFACE_MULTIPLICITY|LIBRARIES|OPTIONS|SEARCH_END_STATIC|SEARCH_START_STATIC|WHAT_YOU_USE)|LISTFILE_STACK|LOCATION|MACOSX_BUNDLE|MACOSX_BUNDLE_INFO_PLIST|MACOSX_FRAMEWORK_INFO_PLIST|MACOSX_PACKAGE_LOCATION|MACOSX_RPATH|MACROS|MANUALLY_ADDED_DEPENDENCIES|MEASUREMENT|MODIFIED|NAME|NO_SONAME|NO_SYSTEM_FROM_IMPORTED|OBJECT_DEPENDS|OBJECT_OUTPUTS|OSX_ARCHITECTURES|OUTPUT_NAME|PACKAGES_FOUND|PACKAGES_NOT_FOUND|PARENT_DIRECTORY|PASS_REGULAR_EXPRESSION|PDB_NAME|PDB_OUTPUT_DIRECTORY|POSITION_INDEPENDENT_CODE|POST_INSTALL_SCRIPT|PREDEFINED_TARGETS_FOLDER|PREFIX|PRE_INSTALL_SCRIPT|PRIVATE_HEADER|PROCESSORS|PROCESSOR_AFFINITY|PROJECT_LABEL|PUBLIC_HEADER|REPORT_UNDEFINED_PROPERTIES|REQUIRED_FILES|RESOURCE|RESOURCE_LOCK|RULE_LAUNCH_COMPILE|RULE_LAUNCH_CUSTOM|RULE_LAUNCH_LINK|RULE_MESSAGES|RUNTIME_OUTPUT_DIRECTORY|RUN_SERIAL|SKIP_AUTOGEN|SKIP_AUTOMOC|SKIP_AUTORCC|SKIP_AUTOUIC|SKIP_BUILD_RPATH|SKIP_RETURN_CODE|SOURCES|SOURCE_DIR|SOVERSION|STATIC_LIBRARY_FLAGS|STATIC_LIBRARY_OPTIONS|STRINGS|SUBDIRECTORIES|SUFFIX|SYMBOLIC|TARGET_ARCHIVES_MAY_BE_SHARED_LIBS|TARGET_MESSAGES|TARGET_SUPPORTS_SHARED_LIBS|TESTS|TEST_INCLUDE_FILE|TEST_INCLUDE_FILES|TIMEOUT|TIMEOUT_AFTER_MATCH|TYPE|USE_FOLDERS|VALUE|VARIABLES|VERSION|VISIBILITY_INLINES_HIDDEN|VS_(?:CONFIGURATION_TYPE|COPY_TO_OUT_DIR|DEBUGGER_(?:COMMAND|COMMAND_ARGUMENTS|ENVIRONMENT|WORKING_DIRECTORY)|DEPLOYMENT_CONTENT|DEPLOYMENT_LOCATION|DOTNET_REFERENCES|DOTNET_REFERENCES_COPY_LOCAL|GLOBAL_KEYWORD|GLOBAL_PROJECT_TYPES|GLOBAL_ROOTNAMESPACE|INCLUDE_IN_VSIX|IOT_STARTUP_TASK|KEYWORD|RESOURCE_GENERATOR|SCC_AUXPATH|SCC_LOCALPATH|SCC_PROJECTNAME|SCC_PROVIDER|SDK_REFERENCES|SHADER_(?:DISABLE_OPTIMIZATIONS|ENABLE_DEBUG|ENTRYPOINT|FLAGS|MODEL|OBJECT_FILE_NAME|OUTPUT_HEADER_FILE|TYPE|VARIABLE_NAME)|STARTUP_PROJECT|TOOL_OVERRIDE|USER_PROPS|WINRT_COMPONENT|WINRT_EXTENSIONS|WINRT_REFERENCES|XAML_TYPE)|WILL_FAIL|WIN32_EXECUTABLE|WINDOWS_EXPORT_ALL_SYMBOLS|WORKING_DIRECTORY|WRAP_EXCLUDE|XCODE_(?:EMIT_EFFECTIVE_PLATFORM_NAME|EXPLICIT_FILE_TYPE|FILE_ATTRIBUTES|LAST_KNOWN_FILE_TYPE|PRODUCT_TYPE|SCHEME_(?:ADDRESS_SANITIZER|ADDRESS_SANITIZER_USE_AFTER_RETURN|ARGUMENTS|DISABLE_MAIN_THREAD_CHECKER|DYNAMIC_LIBRARY_LOADS|DYNAMIC_LINKER_API_USAGE|ENVIRONMENT|EXECUTABLE|GUARD_MALLOC|MAIN_THREAD_CHECKER_STOP|MALLOC_GUARD_EDGES|MALLOC_SCRIBBLE|MALLOC_STACK|THREAD_SANITIZER(?:_STOP)?|UNDEFINED_BEHAVIOUR_SANITIZER(?:_STOP)?|ZOMBIE_OBJECTS))|XCTEST)\b/,keyword:/\b(?:add_compile_definitions|add_compile_options|add_custom_command|add_custom_target|add_definitions|add_dependencies|add_executable|add_library|add_link_options|add_subdirectory|add_test|aux_source_directory|break|build_command|build_name|cmake_host_system_information|cmake_minimum_required|cmake_parse_arguments|cmake_policy|configure_file|continue|create_test_sourcelist|ctest_build|ctest_configure|ctest_coverage|ctest_empty_binary_directory|ctest_memcheck|ctest_read_custom_files|ctest_run_script|ctest_sleep|ctest_start|ctest_submit|ctest_test|ctest_update|ctest_upload|define_property|else|elseif|enable_language|enable_testing|endforeach|endfunction|endif|endmacro|endwhile|exec_program|execute_process|export|export_library_dependencies|file|find_file|find_library|find_package|find_path|find_program|fltk_wrap_ui|foreach|function|get_cmake_property|get_directory_property|get_filename_component|get_property|get_source_file_property|get_target_property|get_test_property|if|include|include_directories|include_external_msproject|include_guard|include_regular_expression|install|install_files|install_programs|install_targets|link_directories|link_libraries|list|load_cache|load_command|macro|make_directory|mark_as_advanced|math|message|option|output_required_files|project|qt_wrap_cpp|qt_wrap_ui|remove|remove_definitions|return|separate_arguments|set|set_directory_properties|set_property|set_source_files_properties|set_target_properties|set_tests_properties|site_name|source_group|string|subdir_depends|subdirs|target_compile_definitions|target_compile_features|target_compile_options|target_include_directories|target_link_directories|target_link_libraries|target_link_options|target_sources|try_compile|try_run|unset|use_mangled_mesa|utility_source|variable_requires|variable_watch|while|write_file)(?=\s*\()\b/,boolean:/\b(?:ON|OFF|TRUE|FALSE)\b/,namespace:/\b(?:PROPERTIES|SHARED|PRIVATE|STATIC|PUBLIC|INTERFACE|TARGET_OBJECTS)\b/,operator:/\b(?:NOT|AND|OR|MATCHES|LESS|GREATER|EQUAL|STRLESS|STRGREATER|STREQUAL|VERSION_LESS|VERSION_EQUAL|VERSION_GREATER|DEFINED)\b/,inserted:{pattern:/\b\w+::\w+\b/,alias:"class-name"},number:/\b\d+(?:\.\d+)*\b/,function:/\b[a-z_]\w*(?=\s*\()\b/i,punctuation:/[()>}]|\$[<{]/}}e.exports=t,t.displayName="cmake",t.aliases=[]},32762(e){"use strict";function t(e){e.languages.cobol={comment:{pattern:/\*>.*|(^[ \t]*)\*.*/m,lookbehind:!0,greedy:!0},string:{pattern:/[xzgn]?(?:"(?:[^\r\n"]|"")*"(?!")|'(?:[^\r\n']|'')*'(?!'))/i,greedy:!0},level:{pattern:/(^[ \t]*)\d+\b/m,lookbehind:!0,greedy:!0,alias:"number"},"class-name":{pattern:/(\bpic(?:ture)?\s+)(?:(?:[-\w$/,:*+<>]|\.(?!\s|$))(?:\(\d+\))?)+/i,lookbehind:!0,inside:{number:{pattern:/(\()\d+/,lookbehind:!0},punctuation:/[()]/}},keyword:{pattern:/(^|[^\w-])(?:ABORT|ACCEPT|ACCESS|ADD|ADDRESS|ADVANCING|AFTER|ALIGNED|ALL|ALPHABET|ALPHABETIC|ALPHABETIC-LOWER|ALPHABETIC-UPPER|ALPHANUMERIC|ALPHANUMERIC-EDITED|ALSO|ALTER|ALTERNATE|ANY|ARE|AREA|AREAS|AS|ASCENDING|ASCII|ASSIGN|ASSOCIATED-DATA|ASSOCIATED-DATA-LENGTH|AT|ATTRIBUTE|AUTHOR|AUTO|AUTO-SKIP|BACKGROUND-COLOR|BACKGROUND-COLOUR|BASIS|BEEP|BEFORE|BEGINNING|BELL|BINARY|BIT|BLANK|BLINK|BLOCK|BOUNDS|BOTTOM|BY|BYFUNCTION|BYTITLE|CALL|CANCEL|CAPABLE|CCSVERSION|CD|CF|CH|CHAINING|CHANGED|CHANNEL|CHARACTER|CHARACTERS|CLASS|CLASS-ID|CLOCK-UNITS|CLOSE|CLOSE-DISPOSITION|COBOL|CODE|CODE-SET|COLLATING|COL|COLUMN|COM-REG|COMMA|COMMITMENT|COMMON|COMMUNICATION|COMP|COMP-1|COMP-2|COMP-3|COMP-4|COMP-5|COMPUTATIONAL|COMPUTATIONAL-1|COMPUTATIONAL-2|COMPUTATIONAL-3|COMPUTATIONAL-4|COMPUTATIONAL-5|COMPUTE|CONFIGURATION|CONTAINS|CONTENT|CONTINUE|CONTROL|CONTROL-POINT|CONTROLS|CONVENTION|CONVERTING|COPY|CORR|CORRESPONDING|COUNT|CRUNCH|CURRENCY|CURSOR|DATA|DATA-BASE|DATE|DATE-COMPILED|DATE-WRITTEN|DAY|DAY-OF-WEEK|DBCS|DE|DEBUG-CONTENTS|DEBUG-ITEM|DEBUG-LINE|DEBUG-NAME|DEBUG-SUB-1|DEBUG-SUB-2|DEBUG-SUB-3|DEBUGGING|DECIMAL-POINT|DECLARATIVES|DEFAULT|DEFAULT-DISPLAY|DEFINITION|DELETE|DELIMITED|DELIMITER|DEPENDING|DESCENDING|DESTINATION|DETAIL|DFHRESP|DFHVALUE|DISABLE|DISK|DISPLAY|DISPLAY-1|DIVIDE|DIVISION|DONTCARE|DOUBLE|DOWN|DUPLICATES|DYNAMIC|EBCDIC|EGCS|EGI|ELSE|EMI|EMPTY-CHECK|ENABLE|END|END-ACCEPT|END-ADD|END-CALL|END-COMPUTE|END-DELETE|END-DIVIDE|END-EVALUATE|END-IF|END-MULTIPLY|END-OF-PAGE|END-PERFORM|END-READ|END-RECEIVE|END-RETURN|END-REWRITE|END-SEARCH|END-START|END-STRING|END-SUBTRACT|END-UNSTRING|END-WRITE|ENDING|ENTER|ENTRY|ENTRY-PROCEDURE|ENVIRONMENT|EOP|ERASE|ERROR|EOL|EOS|ESCAPE|ESI|EVALUATE|EVENT|EVERY|EXCEPTION|EXCLUSIVE|EXHIBIT|EXIT|EXPORT|EXTEND|EXTENDED|EXTERNAL|FD|FILE|FILE-CONTROL|FILLER|FINAL|FIRST|FOOTING|FOR|FOREGROUND-COLOR|FOREGROUND-COLOUR|FROM|FULL|FUNCTION|FUNCTIONNAME|FUNCTION-POINTER|GENERATE|GOBACK|GIVING|GLOBAL|GO|GRID|GROUP|HEADING|HIGHLIGHT|HIGH-VALUE|HIGH-VALUES|I-O|I-O-CONTROL|ID|IDENTIFICATION|IF|IMPLICIT|IMPORT|IN|INDEX|INDEXED|INDICATE|INITIAL|INITIALIZE|INITIATE|INPUT|INPUT-OUTPUT|INSPECT|INSTALLATION|INTEGER|INTO|INVALID|INVOKE|IS|JUST|JUSTIFIED|KANJI|KEPT|KEY|KEYBOARD|LABEL|LANGUAGE|LAST|LB|LD|LEADING|LEFT|LEFTLINE|LENGTH|LENGTH-CHECK|LIBACCESS|LIBPARAMETER|LIBRARY|LIMIT|LIMITS|LINAGE|LINAGE-COUNTER|LINE|LINES|LINE-COUNTER|LINKAGE|LIST|LOCAL|LOCAL-STORAGE|LOCK|LONG-DATE|LONG-TIME|LOWER|LOWLIGHT|LOW-VALUE|LOW-VALUES|MEMORY|MERGE|MESSAGE|MMDDYYYY|MODE|MODULES|MORE-LABELS|MOVE|MULTIPLE|MULTIPLY|NAMED|NATIONAL|NATIONAL-EDITED|NATIVE|NEGATIVE|NETWORK|NEXT|NO|NO-ECHO|NULL|NULLS|NUMBER|NUMERIC|NUMERIC-DATE|NUMERIC-EDITED|NUMERIC-TIME|OBJECT-COMPUTER|OCCURS|ODT|OF|OFF|OMITTED|ON|OPEN|OPTIONAL|ORDER|ORDERLY|ORGANIZATION|OTHER|OUTPUT|OVERFLOW|OVERLINE|OWN|PACKED-DECIMAL|PADDING|PAGE|PAGE-COUNTER|PASSWORD|PERFORM|PF|PH|PIC|PICTURE|PLUS|POINTER|POSITION|POSITIVE|PORT|PRINTER|PRINTING|PRIVATE|PROCEDURE|PROCEDURE-POINTER|PROCEDURES|PROCEED|PROCESS|PROGRAM|PROGRAM-ID|PROGRAM-LIBRARY|PROMPT|PURGE|QUEUE|QUOTE|QUOTES|RANDOM|READER|REMOTE|RD|REAL|READ|RECEIVE|RECEIVED|RECORD|RECORDING|RECORDS|RECURSIVE|REDEFINES|REEL|REF|REFERENCE|REFERENCES|RELATIVE|RELEASE|REMAINDER|REMARKS|REMOVAL|REMOVE|RENAMES|REPLACE|REPLACING|REPORT|REPORTING|REPORTS|REQUIRED|RERUN|RESERVE|REVERSE-VIDEO|RESET|RETURN|RETURN-CODE|RETURNING|REVERSED|REWIND|REWRITE|RF|RH|RIGHT|ROUNDED|RUN|SAME|SAVE|SCREEN|SD|SEARCH|SECTION|SECURE|SECURITY|SEGMENT|SEGMENT-LIMIT|SELECT|SEND|SENTENCE|SEPARATE|SEQUENCE|SEQUENTIAL|SET|SHARED|SHAREDBYALL|SHAREDBYRUNUNIT|SHARING|SHIFT-IN|SHIFT-OUT|SHORT-DATE|SIGN|SIZE|SORT|SORT-CONTROL|SORT-CORE-SIZE|SORT-FILE-SIZE|SORT-MERGE|SORT-MESSAGE|SORT-MODE-SIZE|SORT-RETURN|SOURCE|SOURCE-COMPUTER|SPACE|SPACES|SPECIAL-NAMES|STANDARD|STANDARD-1|STANDARD-2|START|STATUS|STOP|STRING|SUB-QUEUE-1|SUB-QUEUE-2|SUB-QUEUE-3|SUBTRACT|SUM|SUPPRESS|SYMBOL|SYMBOLIC|SYNC|SYNCHRONIZED|TABLE|TALLY|TALLYING|TASK|TAPE|TERMINAL|TERMINATE|TEST|TEXT|THEN|THREAD|THREAD-LOCAL|THROUGH|THRU|TIME|TIMER|TIMES|TITLE|TO|TODAYS-DATE|TODAYS-NAME|TOP|TRAILING|TRUNCATED|TYPE|TYPEDEF|UNDERLINE|UNIT|UNSTRING|UNTIL|UP|UPON|USAGE|USE|USING|VALUE|VALUES|VARYING|VIRTUAL|WAIT|WHEN|WHEN-COMPILED|WITH|WORDS|WORKING-STORAGE|WRITE|YEAR|YYYYMMDD|YYYYDDD|ZERO-FILL|ZEROS|ZEROES)(?![\w-])/i,lookbehind:!0},boolean:{pattern:/(^|[^\w-])(?:false|true)(?![\w-])/i,lookbehind:!0},number:{pattern:/(^|[^\w-])(?:[+-]?(?:(?:\d+(?:[.,]\d+)?|[.,]\d+)(?:e[+-]?\d+)?|zero))(?![\w-])/i,lookbehind:!0},operator:[/<>|[<>]=?|[=+*/&]/,{pattern:/(^|[^\w-])(?:-|and|equal|greater|less|not|or|than)(?![\w-])/i,lookbehind:!0}],punctuation:/[.:,()]/}}e.exports=t,t.displayName="cobol",t.aliases=[]},43576(e){"use strict";function t(e){var t,n,r;n=/#(?!\{).+/,r={pattern:/#\{[^}]+\}/,alias:"variable"},(t=e).languages.coffeescript=t.languages.extend("javascript",{comment:n,string:[{pattern:/'(?:\\[\s\S]|[^\\'])*'/,greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,greedy:!0,inside:{interpolation:r}}],keyword:/\b(?:and|break|by|catch|class|continue|debugger|delete|do|each|else|extend|extends|false|finally|for|if|in|instanceof|is|isnt|let|loop|namespace|new|no|not|null|of|off|on|or|own|return|super|switch|then|this|throw|true|try|typeof|undefined|unless|until|when|while|window|with|yes|yield)\b/,"class-member":{pattern:/@(?!\d)\w+/,alias:"variable"}}),t.languages.insertBefore("coffeescript","comment",{"multiline-comment":{pattern:/###[\s\S]+?###/,alias:"comment"},"block-regex":{pattern:/\/{3}[\s\S]*?\/{3}/,alias:"regex",inside:{comment:n,interpolation:r}}}),t.languages.insertBefore("coffeescript","string",{"inline-javascript":{pattern:/`(?:\\[\s\S]|[^\\`])*`/,inside:{delimiter:{pattern:/^`|`$/,alias:"punctuation"},script:{pattern:/[\s\S]+/,alias:"language-javascript",inside:t.languages.javascript}}},"multiline-string":[{pattern:/'''[\s\S]*?'''/,greedy:!0,alias:"string"},{pattern:/"""[\s\S]*?"""/,greedy:!0,alias:"string",inside:{interpolation:r}}]}),t.languages.insertBefore("coffeescript","keyword",{property:/(?!\d)\w+(?=\s*:(?!:))/}),delete t.languages.coffeescript["template-string"],t.languages.coffee=t.languages.coffeescript}e.exports=t,t.displayName="coffeescript",t.aliases=["coffee"]},71794(e){"use strict";function t(e){e.languages.concurnas={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],langext:{pattern:/\b\w+\s*\|\|[\s\S]+?\|\|/,greedy:!0,alias:"string"},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/,lookbehind:!0},keyword:/\b(?:abstract|actor|also|annotation|assert|async|await|bool|boolean|break|byte|case|catch|changed|char|class|closed|constant|continue|def|default|del|double|elif|else|enum|every|extends|false|finally|float|for|from|global|gpudef|gpukernel|if|import|in|init|inject|int|lambda|local|long|loop|match|new|nodefault|null|of|onchange|open|out|override|package|parfor|parforsync|post|pre|private|protected|provide|provider|public|return|shared|short|single|size_t|sizeof|super|sync|this|throw|trait|trans|transient|true|try|typedef|unchecked|using|val|var|void|while|with)\b/,boolean:/\b(?:false|true)\b/,number:/\b0b[01][01_]*L?\b|\b0x(?:[\da-f_]*\.)?[\da-f_p+-]+\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfls]?/i,punctuation:/[{}[\];(),.:]/,operator:/<==|>==|=>|->|<-|<>|\^|&==|&<>|!|\?:?|\.\?|\+\+|--|[-+*/=<>]=?|\b(?:and|as|band|bor|bxor|comp|is|isnot|mod|or)\b=?/,annotation:{pattern:/@(?:\w+:)?(?:\w+|\[[^\]]+\])?/,alias:"builtin"}},e.languages.insertBefore("concurnas","langext",{string:{pattern:/[rs]?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:e.languages.concurnas},string:/[\s\S]+/}}}),e.languages.conc=e.languages.concurnas}e.exports=t,t.displayName="concurnas",t.aliases=["conc"]},1315(e){"use strict";function t(e){!function(e){for(var t=/\(\*(?:[^(*]|\((?!\*)|\*(?!\))|)*\*\)/.source,n=0;n<2;n++)t=t.replace(//g,function(){return t});t=t.replace(//g,"[]"),e.languages.coq={comment:RegExp(t),string:{pattern:/"(?:[^"]|"")*"(?!")/,greedy:!0},attribute:[{pattern:RegExp(/#\[(?:[^\]("]|"(?:[^"]|"")*"(?!")|\((?!\*)|)*\]/.source.replace(//g,function(){return t})),greedy:!0,alias:"attr-name",inside:{comment:RegExp(t),string:{pattern:/"(?:[^"]|"")*"(?!")/,greedy:!0},operator:/=/,punctuation:/^#\[|\]$|[,()]/}},{pattern:/\b(?:Cumulative|Global|Local|Monomorphic|NonCumulative|Polymorphic|Private|Program)\b/,alias:"attr-name"}],keyword:/\b(?:_|Abort|About|Add|Admit|Admitted|All|apply|Arguments|as|As|Assumptions|at|Axiom|Axioms|Back|BackTo|Backtrace|Bind|BinOp|BinOpSpec|BinRel|Blacklist|by|Canonical|Case|Cd|Check|Class|Classes|Close|Coercion|Coercions|cofix|CoFixpoint|CoInductive|Collection|Combined|Compute|Conjecture|Conjectures|Constant|Constants|Constraint|Constructors|Context|Corollary|Create|CstOp|Custom|Cut|Debug|Declare|Defined|Definition|Delimit|Dependencies|Dependent|Derive|Diffs|Drop|Elimination|else|end|End|Entry|Equality|Eval|Example|Existential|Existentials|Existing|exists|exists2|Export|Extern|Extraction|Fact|Fail|Field|File|Firstorder|fix|Fixpoint|Flags|Focus|for|forall|From|fun|Funclass|Function|Functional|GC|Generalizable|Goal|Grab|Grammar|Graph|Guarded|Haskell|Heap|Hide|Hint|HintDb|Hints|Hypotheses|Hypothesis|Identity|if|IF|Immediate|Implicit|Implicits|Import|in|Include|Induction|Inductive|Infix|Info|Initial|InjTyp|Inline|Inspect|Instance|Instances|Intro|Intros|Inversion|Inversion_clear|JSON|Language|Left|Lemma|let|Let|Lia|Libraries|Library|Load|LoadPath|Locate|Ltac|Ltac2|match|Match|measure|Method|Minimality|ML|Module|Modules|Morphism|move|Next|NoInline|Notation|Number|Obligation|Obligations|OCaml|Opaque|Open|Optimize|Parameter|Parameters|Parametric|Path|Paths|Prenex|Preterm|Primitive|Print|Profile|Projections|Proof|Prop|PropBinOp|Property|PropOp|Proposition|PropUOp|Pwd|Qed|Quit|Rec|Record|Recursive|Redirect|Reduction|Register|Relation|Remark|Remove|removed|Require|Reserved|Reset|Resolve|Restart|return|Rewrite|Right|Ring|Rings|Saturate|Save|Scheme|Scope|Scopes|Search|SearchHead|SearchPattern|SearchRewrite|Section|Separate|Set|Setoid|Show|Signatures|Solve|Solver|Sort|Sortclass|Sorted|Spec|SProp|Step|Strategies|Strategy|String|struct|Structure|SubClass|Subgraph|SuchThat|Tactic|Term|TestCompile|then|Theorem|Time|Timeout|To|Transparent|Type|Typeclasses|Types|Typing|Undelimit|Undo|Unfocus|Unfocused|Unfold|Universe|Universes|UnOp|UnOpSpec|Unshelve|using|Variable|Variables|Variant|Verbose|View|Visibility|wf|where|with|Zify)\b/,number:/\b(?:0x[a-f0-9][a-f0-9_]*(?:\.[a-f0-9_]+)?(?:p[+-]?\d[\d_]*)?|\d[\d_]*(?:\.[\d_]+)?(?:e[+-]?\d[\d_]*)?)\b/i,punct:{pattern:/@\{|\{\||\[=|:>/,alias:"punctuation"},operator:/\/\\|\\\/|\.{2,3}|:{1,2}=|\*\*|[-=]>|<(?:->?|[+:=>]|<:)|>(?:=|->)|\|[-|]?|[-!%&*+/<=>?@^~']/,punctuation:/\.\(|`\(|@\{|`\{|\{\||\[=|:>|[:.,;(){}\[\]]/}}(e)}e.exports=t,t.displayName="coq",t.aliases=[]},80096(e,t,n){"use strict";var r=n(65806);function i(e){var t,n,i;e.register(r),t=e,n=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char8_t|char16_t|char32_t|class|compl|concept|const|consteval|constexpr|constinit|const_cast|continue|co_await|co_return|co_yield|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int8_t|int16_t|int32_t|int64_t|uint8_t|uint16_t|uint32_t|uint64_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,i=/\b(?!)\w+(?:\s*\.\s*\w+)*\b/.source.replace(//g,function(){return n.source}),t.languages.cpp=t.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!)\w+/.source.replace(//g,function(){return n.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:n,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:true|false)\b/}),t.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:module|import)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/(?:\s*:\s*)?|:\s*/.source.replace(//g,function(){return i})+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),t.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b[a-z_]\w*\s*<(?:[^<>]|<(?:[^<>])*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:t.languages.cpp}}}}),t.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),t.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:t.languages.extend("cpp",{})}}),t.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},t.languages.cpp["base-clause"])}e.exports=i,i.displayName="cpp",i.aliases=[]},99176(e,t,n){"use strict";var r=n(56939);function i(e){var t;e.register(r),(t=e).languages.crystal=t.languages.extend("ruby",{keyword:[/\b(?:abstract|alias|as|asm|begin|break|case|class|def|do|else|elsif|end|ensure|enum|extend|for|fun|if|include|instance_sizeof|lib|macro|module|next|of|out|pointerof|private|protected|rescue|return|require|select|self|sizeof|struct|super|then|type|typeof|uninitialized|union|unless|until|when|while|with|yield|__DIR__|__END_LINE__|__FILE__|__LINE__)\b/,{pattern:/(\.\s*)(?:is_a|responds_to)\?/,lookbehind:!0}],number:/\b(?:0b[01_]*[01]|0o[0-7_]*[0-7]|0x[\da-fA-F_]*[\da-fA-F]|(?:\d(?:[\d_]*\d)?)(?:\.[\d_]*\d)?(?:[eE][+-]?[\d_]*\d)?)(?:_(?:[uif](?:8|16|32|64))?)?\b/}),t.languages.insertBefore("crystal","string",{attribute:{pattern:/@\[.+?\]/,alias:"attr-name",inside:{delimiter:{pattern:/^@\[|\]$/,alias:"tag"},rest:t.languages.crystal}},expansion:[{pattern:/\{\{.+?\}\}/,inside:{delimiter:{pattern:/^\{\{|\}\}$/,alias:"tag"},rest:t.languages.crystal}},{pattern:/\{%.+?%\}/,inside:{delimiter:{pattern:/^\{%|%\}$/,alias:"tag"},rest:t.languages.crystal}}]})}e.exports=i,i.displayName="crystal",i.aliases=[]},61958(e){"use strict";function t(e){!function(e){function t(e,t){return e.replace(/<<(\d+)>>/g,function(e,n){return"(?:"+t[+n]+")"})}function n(e,n,r){return RegExp(t(e,n),r||"")}function r(e,t){for(var n=0;n>/g,function(){return"(?:"+e+")"});return e.replace(/<>/g,"[^\\s\\S]")}var i={type:"bool byte char decimal double dynamic float int long object sbyte short string uint ulong ushort var void",typeDeclaration:"class enum interface struct",contextual:"add alias and ascending async await by descending from get global group into join let nameof not notnull on or orderby partial remove select set unmanaged value when where",other:"abstract as base break case catch checked const continue default delegate do else event explicit extern finally fixed for foreach goto if implicit in internal is lock namespace new null operator out override params private protected public readonly ref return sealed sizeof stackalloc static switch this throw try typeof unchecked unsafe using virtual volatile while yield"};function a(e){return"\\b(?:"+e.trim().replace(/ /g,"|")+")\\b"}var o=a(i.typeDeclaration),s=RegExp(a(i.type+" "+i.typeDeclaration+" "+i.contextual+" "+i.other)),u=a(i.typeDeclaration+" "+i.contextual+" "+i.other),c=a(i.type+" "+i.typeDeclaration+" "+i.other),l=r(/<(?:[^<>;=+\-*/%&|^]|<>)*>/.source,2),f=r(/\((?:[^()]|<>)*\)/.source,2),d=/@?\b[A-Za-z_]\w*\b/.source,h=t(/<<0>>(?:\s*<<1>>)?/.source,[d,l]),p=t(/(?!<<0>>)<<1>>(?:\s*\.\s*<<1>>)*/.source,[u,h]),b=/\[\s*(?:,\s*)*\]/.source,m=t(/<<0>>(?:\s*(?:\?\s*)?<<1>>)*(?:\s*\?)?/.source,[p,b]),g=t(/[^,()<>[\];=+\-*/%&|^]|<<0>>|<<1>>|<<2>>/.source,[l,f,b]),v=t(/\(<<0>>+(?:,<<0>>+)+\)/.source,[g]),y=t(/(?:<<0>>|<<1>>)(?:\s*(?:\?\s*)?<<2>>)*(?:\s*\?)?/.source,[v,p,b]),w={keyword:s,punctuation:/[<>()?,.:[\]]/},_=/'(?:[^\r\n'\\]|\\.|\\[Uux][\da-fA-F]{1,8})'/.source,E=/"(?:\\.|[^\\"\r\n])*"/.source,S=/@"(?:""|\\[\s\S]|[^\\"])*"(?!")/.source;e.languages.csharp=e.languages.extend("clike",{string:[{pattern:n(/(^|[^$\\])<<0>>/.source,[S]),lookbehind:!0,greedy:!0},{pattern:n(/(^|[^@$\\])<<0>>/.source,[E]),lookbehind:!0,greedy:!0},{pattern:RegExp(_),greedy:!0,alias:"character"}],"class-name":[{pattern:n(/(\busing\s+static\s+)<<0>>(?=\s*;)/.source,[p]),lookbehind:!0,inside:w},{pattern:n(/(\busing\s+<<0>>\s*=\s*)<<1>>(?=\s*;)/.source,[d,y]),lookbehind:!0,inside:w},{pattern:n(/(\busing\s+)<<0>>(?=\s*=)/.source,[d]),lookbehind:!0},{pattern:n(/(\b<<0>>\s+)<<1>>/.source,[o,h]),lookbehind:!0,inside:w},{pattern:n(/(\bcatch\s*\(\s*)<<0>>/.source,[p]),lookbehind:!0,inside:w},{pattern:n(/(\bwhere\s+)<<0>>/.source,[d]),lookbehind:!0},{pattern:n(/(\b(?:is(?:\s+not)?|as)\s+)<<0>>/.source,[m]),lookbehind:!0,inside:w},{pattern:n(/\b<<0>>(?=\s+(?!<<1>>)<<2>>(?:\s*[=,;:{)\]]|\s+(?:in|when)\b))/.source,[y,c,d]),inside:w}],keyword:s,number:/(?:\b0(?:x[\da-f_]*[\da-f]|b[01_]*[01])|(?:\B\.\d+(?:_+\d+)*|\b\d+(?:_+\d+)*(?:\.\d+(?:_+\d+)*)?)(?:e[-+]?\d+(?:_+\d+)*)?)(?:ul|lu|[dflmu])?\b/i,operator:/>>=?|<<=?|[-=]>|([-+&|])\1|~|\?\?=?|[-+*/%&|^!=<>]=?/,punctuation:/\?\.?|::|[{}[\];(),.:]/}),e.languages.insertBefore("csharp","number",{range:{pattern:/\.\./,alias:"operator"}}),e.languages.insertBefore("csharp","punctuation",{"named-parameter":{pattern:n(/([(,]\s*)<<0>>(?=\s*:)/.source,[d]),lookbehind:!0,alias:"punctuation"}}),e.languages.insertBefore("csharp","class-name",{namespace:{pattern:n(/(\b(?:namespace|using)\s+)<<0>>(?:\s*\.\s*<<0>>)*(?=\s*[;{])/.source,[d]),lookbehind:!0,inside:{punctuation:/\./}},"type-expression":{pattern:n(/(\b(?:default|typeof|sizeof)\s*\(\s*(?!\s))(?:[^()\s]|\s(?!\s)|<<0>>)*(?=\s*\))/.source,[f]),lookbehind:!0,alias:"class-name",inside:w},"return-type":{pattern:n(/<<0>>(?=\s+(?:<<1>>\s*(?:=>|[({]|\.\s*this\s*\[)|this\s*\[))/.source,[y,p]),inside:w,alias:"class-name"},"constructor-invocation":{pattern:n(/(\bnew\s+)<<0>>(?=\s*[[({])/.source,[y]),lookbehind:!0,inside:w,alias:"class-name"},"generic-method":{pattern:n(/<<0>>\s*<<1>>(?=\s*\()/.source,[d,l]),inside:{function:n(/^<<0>>/.source,[d]),generic:{pattern:RegExp(l),alias:"class-name",inside:w}}},"type-list":{pattern:n(/\b((?:<<0>>\s+<<1>>|where\s+<<2>>)\s*:\s*)(?:<<3>>|<<4>>)(?:\s*,\s*(?:<<3>>|<<4>>))*(?=\s*(?:where|[{;]|=>|$))/.source,[o,h,d,y,s.source]),lookbehind:!0,inside:{keyword:s,"class-name":{pattern:RegExp(y),greedy:!0,inside:w},punctuation:/,/}},preprocessor:{pattern:/(^[\t ]*)#.*/m,lookbehind:!0,alias:"property",inside:{directive:{pattern:/(#)\b(?:define|elif|else|endif|endregion|error|if|line|pragma|region|undef|warning)\b/,lookbehind:!0,alias:"keyword"}}}});var k=E+"|"+_,x=t(/\/(?![*/])|\/\/[^\r\n]*[\r\n]|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>/.source,[k]),T=r(t(/[^"'/()]|<<0>>|\(<>*\)/.source,[x]),2),M=/\b(?:assembly|event|field|method|module|param|property|return|type)\b/.source,O=t(/<<0>>(?:\s*\(<<1>>*\))?/.source,[p,T]);e.languages.insertBefore("csharp","class-name",{attribute:{pattern:n(/((?:^|[^\s\w>)?])\s*\[\s*)(?:<<0>>\s*:\s*)?<<1>>(?:\s*,\s*<<1>>)*(?=\s*\])/.source,[M,O]),lookbehind:!0,greedy:!0,inside:{target:{pattern:n(/^<<0>>(?=\s*:)/.source,[M]),alias:"keyword"},"attribute-arguments":{pattern:n(/\(<<0>>*\)/.source,[T]),inside:e.languages.csharp},"class-name":{pattern:RegExp(p),inside:{punctuation:/\./}},punctuation:/[:,]/}}});var A=/:[^}\r\n]+/.source,L=r(t(/[^"'/()]|<<0>>|\(<>*\)/.source,[x]),2),C=t(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[L,A]),I=r(t(/[^"'/()]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>|\(<>*\)/.source,[k]),2),D=t(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[I,A]);function N(t,r){return{interpolation:{pattern:n(/((?:^|[^{])(?:\{\{)*)<<0>>/.source,[t]),lookbehind:!0,inside:{"format-string":{pattern:n(/(^\{(?:(?![}:])<<0>>)*)<<1>>(?=\}$)/.source,[r,A]),lookbehind:!0,inside:{punctuation:/^:/}},punctuation:/^\{|\}$/,expression:{pattern:/[\s\S]+/,alias:"language-csharp",inside:e.languages.csharp}}},string:/[\s\S]+/}}e.languages.insertBefore("csharp","string",{"interpolation-string":[{pattern:n(/(^|[^\\])(?:\$@|@\$)"(?:""|\\[\s\S]|\{\{|<<0>>|[^\\{"])*"/.source,[C]),lookbehind:!0,greedy:!0,inside:N(C,L)},{pattern:n(/(^|[^@\\])\$"(?:\\.|\{\{|<<0>>|[^\\"{])*"/.source,[D]),lookbehind:!0,greedy:!0,inside:N(D,I)}]})}(e),e.languages.dotnet=e.languages.cs=e.languages.csharp}e.exports=t,t.displayName="csharp",t.aliases=["dotnet","cs"]},65447(e){"use strict";function t(e){e.languages.csp={directive:{pattern:/(^|[^-\da-z])(?:base-uri|block-all-mixed-content|(?:child|connect|default|font|frame|img|manifest|media|object|prefetch|script|style|worker)-src|disown-opener|form-action|frame-(?:ancestors|options)|input-protection(?:-(?:clip|selectors))?|navigate-to|plugin-types|policy-uri|referrer|reflected-xss|report-(?:to|uri)|require-sri-for|sandbox|(?:script|style)-src-(?:attr|elem)|upgrade-insecure-requests)(?=[^-\da-z]|$)/i,lookbehind:!0,alias:"keyword"},safe:{pattern:/'(?:deny|none|report-sample|self|strict-dynamic|top-only|(?:nonce|sha(?:256|384|512))-[-+/\w=]+)'/i,alias:"selector"},unsafe:{pattern:/(?:'unsafe-(?:allow-redirects|dynamic|eval|hash-attributes|hashed-attributes|hashes|inline)'|\*)/i,alias:"function"}}}e.exports=t,t.displayName="csp",t.aliases=[]},4762(e){"use strict";function t(e){var t,n,r,i,a;r=/("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,(t=e).languages.css.selector={pattern:t.languages.css.selector.pattern,lookbehind:!0,inside:n={"pseudo-element":/:(?:after|before|first-letter|first-line|selection)|::[-\w]+/,"pseudo-class":/:[-\w]+/,class:/\.[-\w]+/,id:/#[-\w]+/,attribute:{pattern:RegExp("\\[(?:[^[\\]\"']|"+r.source+")*\\]"),greedy:!0,inside:{punctuation:/^\[|\]$/,"case-sensitivity":{pattern:/(\s)[si]$/i,lookbehind:!0,alias:"keyword"},namespace:{pattern:/^(\s*)(?:(?!\s)[-*\w\xA0-\uFFFF])*\|(?!=)/,lookbehind:!0,inside:{punctuation:/\|$/}},"attr-name":{pattern:/^(\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+/,lookbehind:!0},"attr-value":[r,{pattern:/(=\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+(?=\s*$)/,lookbehind:!0}],operator:/[|~*^$]?=/}},"n-th":[{pattern:/(\(\s*)[+-]?\d*[\dn](?:\s*[+-]\s*\d+)?(?=\s*\))/,lookbehind:!0,inside:{number:/[\dn]+/,operator:/[+-]/}},{pattern:/(\(\s*)(?:even|odd)(?=\s*\))/i,lookbehind:!0}],combinator:/>|\+|~|\|\|/,punctuation:/[(),]/}},t.languages.css.atrule.inside["selector-function-argument"].inside=n,t.languages.insertBefore("css","property",{variable:{pattern:/(^|[^-\w\xA0-\uFFFF])--(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*/i,lookbehind:!0}}),i={pattern:/(\b\d+)(?:%|[a-z]+\b)/,lookbehind:!0},a={pattern:/(^|[^\w.-])-?(?:\d+(?:\.\d+)?|\.\d+)/,lookbehind:!0},t.languages.insertBefore("css","function",{operator:{pattern:/(\s)[+\-*\/](?=\s)/,lookbehind:!0},hexcode:{pattern:/\B#[\da-f]{3,8}\b/i,alias:"color"},color:[/\b(?:AliceBlue|AntiqueWhite|Aqua|Aquamarine|Azure|Beige|Bisque|Black|BlanchedAlmond|Blue|BlueViolet|Brown|BurlyWood|CadetBlue|Chartreuse|Chocolate|Coral|CornflowerBlue|Cornsilk|Crimson|Cyan|DarkBlue|DarkCyan|DarkGoldenRod|DarkGr[ae]y|DarkGreen|DarkKhaki|DarkMagenta|DarkOliveGreen|DarkOrange|DarkOrchid|DarkRed|DarkSalmon|DarkSeaGreen|DarkSlateBlue|DarkSlateGr[ae]y|DarkTurquoise|DarkViolet|DeepPink|DeepSkyBlue|DimGr[ae]y|DodgerBlue|FireBrick|FloralWhite|ForestGreen|Fuchsia|Gainsboro|GhostWhite|Gold|GoldenRod|Gr[ae]y|Green|GreenYellow|HoneyDew|HotPink|IndianRed|Indigo|Ivory|Khaki|Lavender|LavenderBlush|LawnGreen|LemonChiffon|LightBlue|LightCoral|LightCyan|LightGoldenRodYellow|LightGr[ae]y|LightGreen|LightPink|LightSalmon|LightSeaGreen|LightSkyBlue|LightSlateGr[ae]y|LightSteelBlue|LightYellow|Lime|LimeGreen|Linen|Magenta|Maroon|MediumAquaMarine|MediumBlue|MediumOrchid|MediumPurple|MediumSeaGreen|MediumSlateBlue|MediumSpringGreen|MediumTurquoise|MediumVioletRed|MidnightBlue|MintCream|MistyRose|Moccasin|NavajoWhite|Navy|OldLace|Olive|OliveDrab|Orange|OrangeRed|Orchid|PaleGoldenRod|PaleGreen|PaleTurquoise|PaleVioletRed|PapayaWhip|PeachPuff|Peru|Pink|Plum|PowderBlue|Purple|Red|RosyBrown|RoyalBlue|SaddleBrown|Salmon|SandyBrown|SeaGreen|SeaShell|Sienna|Silver|SkyBlue|SlateBlue|SlateGr[ae]y|Snow|SpringGreen|SteelBlue|Tan|Teal|Thistle|Tomato|Transparent|Turquoise|Violet|Wheat|White|WhiteSmoke|Yellow|YellowGreen)\b/i,{pattern:/\b(?:rgb|hsl)\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*\)\B|\b(?:rgb|hsl)a\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*,\s*(?:0|0?\.\d+|1)\s*\)\B/i,inside:{unit:i,number:a,function:/[\w-]+(?=\()/,punctuation:/[(),]/}}],entity:/\\[\da-f]{1,8}/i,unit:i,number:a})}e.exports=t,t.displayName="cssExtras",t.aliases=[]},12049(e){"use strict";function t(e){var t,n,r;n=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/,(t=e).languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:/@[\w-](?:[^;{\s]|\s+(?![\s{]))*(?:;|(?=\s*\{))/,inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+n.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+n.source+"$"),alias:"url"}}},selector:{pattern:RegExp("(^|[{}\\s])[^{}\\s](?:[^{};\"'\\s]|\\s+(?![\\s{])|"+n.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:n,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},t.languages.css.atrule.inside.rest=t.languages.css,(r=t.languages.markup)&&(r.tag.addInlined("style","css"),r.tag.addAttribute("style","css"))}e.exports=t,t.displayName="css",t.aliases=[]},78090(e){"use strict";function t(e){e.languages.csv={value:/[^\r\n,"]+|"(?:[^"]|"")*"(?!")/,punctuation:/,/}}e.exports=t,t.displayName="csv",t.aliases=[]},40315(e){"use strict";function t(e){e.languages.cypher={comment:/\/\/.*/,string:{pattern:/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/,greedy:!0},"class-name":{pattern:/(:\s*)(?:\w+|`(?:[^`\\\r\n])*`)(?=\s*[{):])/,lookbehind:!0,greedy:!0},relationship:{pattern:/(-\[\s*(?:\w+\s*|`(?:[^`\\\r\n])*`\s*)?:\s*|\|\s*:\s*)(?:\w+|`(?:[^`\\\r\n])*`)/,lookbehind:!0,greedy:!0,alias:"property"},identifier:{pattern:/`(?:[^`\\\r\n])*`/,greedy:!0,alias:"symbol"},variable:/\$\w+/,keyword:/\b(?:ADD|ALL|AND|AS|ASC|ASCENDING|ASSERT|BY|CALL|CASE|COMMIT|CONSTRAINT|CONTAINS|CREATE|CSV|DELETE|DESC|DESCENDING|DETACH|DISTINCT|DO|DROP|ELSE|END|ENDS|EXISTS|FOR|FOREACH|IN|INDEX|IS|JOIN|KEY|LIMIT|LOAD|MANDATORY|MATCH|MERGE|NODE|NOT|OF|ON|OPTIONAL|OR|ORDER(?=\s+BY)|PERIODIC|REMOVE|REQUIRE|RETURN|SCALAR|SCAN|SET|SKIP|START|STARTS|THEN|UNION|UNIQUE|UNWIND|USING|WHEN|WHERE|WITH|XOR|YIELD)\b/i,function:/\b\w+\b(?=\s*\()/,boolean:/\b(?:true|false|null)\b/i,number:/\b(?:0x[\da-fA-F]+|\d+(?:\.\d+)?(?:[eE][+-]?\d+)?)\b/,operator:/:|<--?|--?>?|<>|=~?|[<>]=?|[+*/%^|]|\.\.\.?/,punctuation:/[()[\]{},;.]/}}e.exports=t,t.displayName="cypher",t.aliases=[]},7902(e){"use strict";function t(e){e.languages.d=e.languages.extend("clike",{comment:[{pattern:/^\s*#!.+/,greedy:!0},{pattern:RegExp(/(^|[^\\])/.source+"(?:"+[/\/\+(?:\/\+(?:[^+]|\+(?!\/))*\+\/|(?!\/\+)[\s\S])*?\+\//.source,/\/\/.*/.source,/\/\*[\s\S]*?\*\//.source].join("|")+")"),lookbehind:!0,greedy:!0}],string:[{pattern:RegExp([/\b[rx]"(?:\\[\s\S]|[^\\"])*"[cwd]?/.source,/\bq"(?:\[[\s\S]*?\]|\([\s\S]*?\)|<[\s\S]*?>|\{[\s\S]*?\})"/.source,/\bq"((?!\d)\w+)$[\s\S]*?^\1"/.source,/\bq"(.)[\s\S]*?\2"/.source,/'(?:\\(?:\W|\w+)|[^\\])'/.source,/(["`])(?:\\[\s\S]|(?!\3)[^\\])*\3[cwd]?/.source].join("|"),"m"),greedy:!0},{pattern:/\bq\{(?:\{[^{}]*\}|[^{}])*\}/,greedy:!0,alias:"token-string"}],keyword:/\$|\b(?:abstract|alias|align|asm|assert|auto|body|bool|break|byte|case|cast|catch|cdouble|cent|cfloat|char|class|const|continue|creal|dchar|debug|default|delegate|delete|deprecated|do|double|else|enum|export|extern|false|final|finally|float|for|foreach|foreach_reverse|function|goto|idouble|if|ifloat|immutable|import|inout|int|interface|invariant|ireal|lazy|long|macro|mixin|module|new|nothrow|null|out|override|package|pragma|private|protected|public|pure|real|ref|return|scope|shared|short|static|struct|super|switch|synchronized|template|this|throw|true|try|typedef|typeid|typeof|ubyte|ucent|uint|ulong|union|unittest|ushort|version|void|volatile|wchar|while|with|__(?:(?:FILE|MODULE|LINE|FUNCTION|PRETTY_FUNCTION|DATE|EOF|TIME|TIMESTAMP|VENDOR|VERSION)__|gshared|traits|vector|parameters)|string|wstring|dstring|size_t|ptrdiff_t)\b/,number:[/\b0x\.?[a-f\d_]+(?:(?!\.\.)\.[a-f\d_]*)?(?:p[+-]?[a-f\d_]+)?[ulfi]{0,4}/i,{pattern:/((?:\.\.)?)(?:\b0b\.?|\b|\.)\d[\d_]*(?:(?!\.\.)\.[\d_]*)?(?:e[+-]?\d[\d_]*)?[ulfi]{0,4}/i,lookbehind:!0}],operator:/\|[|=]?|&[&=]?|\+[+=]?|-[-=]?|\.?\.\.|=[>=]?|!(?:i[ns]\b|<>?=?|>=?|=)?|\bi[ns]\b|(?:<[<>]?|>>?>?|\^\^|[*\/%^~])=?/}),e.languages.insertBefore("d","keyword",{property:/\B@\w*/}),e.languages.insertBefore("d","function",{register:{pattern:/\b(?:[ABCD][LHX]|E[ABCD]X|E?(?:BP|SP|DI|SI)|[ECSDGF]S|CR[0234]|DR[012367]|TR[3-7]|X?MM[0-7]|R[ABCD]X|[BS]PL|R[BS]P|[DS]IL|R[DS]I|R(?:[89]|1[0-5])[BWD]?|XMM(?:[89]|1[0-5])|YMM(?:1[0-5]|\d))\b|\bST(?:\([0-7]\)|\b)/,alias:"variable"}})}e.exports=t,t.displayName="d",t.aliases=[]},28651(e){"use strict";function t(e){var t,n,r,i;t=e,n=[/\b(?:async|sync|yield)\*/,/\b(?:abstract|assert|async|await|break|case|catch|class|const|continue|covariant|default|deferred|do|dynamic|else|enum|export|extension|external|extends|factory|final|finally|for|get|hide|if|implements|interface|import|in|library|mixin|new|null|on|operator|part|rethrow|return|set|show|static|super|switch|sync|this|throw|try|typedef|var|void|while|with|yield)\b/],i={pattern:RegExp((r=/(^|[^\w.])(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source)+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}}}},t.languages.dart=t.languages.extend("clike",{string:[{pattern:/r?("""|''')[\s\S]*?\1/,greedy:!0},{pattern:/r?(["'])(?:\\.|(?!\1)[^\\\r\n])*\1/,greedy:!0}],"class-name":[i,{pattern:RegExp(r+/[A-Z]\w*(?=\s+\w+\s*[;,=()])/.source),lookbehind:!0,inside:i.inside}],keyword:n,operator:/\bis!|\b(?:as|is)\b|\+\+|--|&&|\|\||<<=?|>>=?|~(?:\/=?)?|[+\-*\/%&^|=!<>]=?|\?/}),t.languages.insertBefore("dart","function",{metadata:{pattern:/@\w+/,alias:"symbol"}}),t.languages.insertBefore("dart","class-name",{generics:{pattern:/<(?:[\w\s,.&?]|<(?:[\w\s,.&?]|<(?:[\w\s,.&?]|<[\w\s,.&?]*>)*>)*>)*>/,inside:{"class-name":i,keyword:n,punctuation:/[<>(),.:]/,operator:/[?&|]/}}})}e.exports=t,t.displayName="dart",t.aliases=[]},55579(e){"use strict";function t(e){var t;(t=e).languages.dataweave={url:/\b[A-Za-z]+:\/\/[\w/:.?=&-]+|\burn:[\w:.?=&-]+/,property:{pattern:/(?:\b\w+#)?(?:"(?:\\.|[^\\"\r\n])*"|\b\w+)(?=\s*[:@])/,greedy:!0},string:{pattern:/(["'`])(?:\\[\s\S]|(?!\1)[^\\])*\1/,greedy:!0},"mime-type":/\b(?:text|audio|video|application|multipart|image)\/[\w+-]+/,date:{pattern:/\|[\w:+-]+\|/,greedy:!0},comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],regex:{pattern:/\/(?:[^\\\/\r\n]|\\[^\r\n])+\//,greedy:!0},function:/\b[A-Z_]\w*(?=\s*\()/i,number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\];(),.:@]/,operator:/<<|>>|->|[<>~=]=?|!=|--?-?|\+\+?|!|\?/,boolean:/\b(?:true|false)\b/,keyword:/\b(?:match|input|output|ns|type|update|null|if|else|using|unless|at|is|as|case|do|fun|var|not|and|or)\b/}}e.exports=t,t.displayName="dataweave",t.aliases=[]},93685(e){"use strict";function t(e){e.languages.dax={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/).*)/,lookbehind:!0},"data-field":{pattern:/'(?:[^']|'')*'(?!')(?:\[[ \w\xA0-\uFFFF]+\])?|\w+\[[ \w\xA0-\uFFFF]+\]/,alias:"symbol"},measure:{pattern:/\[[ \w\xA0-\uFFFF]+\]/,alias:"constant"},string:{pattern:/"(?:[^"]|"")*"(?!")/,greedy:!0},function:/\b(?:ABS|ACOS|ACOSH|ACOT|ACOTH|ADDCOLUMNS|ADDMISSINGITEMS|ALL|ALLCROSSFILTERED|ALLEXCEPT|ALLNOBLANKROW|ALLSELECTED|AND|APPROXIMATEDISTINCTCOUNT|ASIN|ASINH|ATAN|ATANH|AVERAGE|AVERAGEA|AVERAGEX|BETA\.DIST|BETA\.INV|BLANK|CALCULATE|CALCULATETABLE|CALENDAR|CALENDARAUTO|CEILING|CHISQ\.DIST|CHISQ\.DIST\.RT|CHISQ\.INV|CHISQ\.INV\.RT|CLOSINGBALANCEMONTH|CLOSINGBALANCEQUARTER|CLOSINGBALANCEYEAR|COALESCE|COMBIN|COMBINA|COMBINEVALUES|CONCATENATE|CONCATENATEX|CONFIDENCE\.NORM|CONFIDENCE\.T|CONTAINS|CONTAINSROW|CONTAINSSTRING|CONTAINSSTRINGEXACT|CONVERT|COS|COSH|COT|COTH|COUNT|COUNTA|COUNTAX|COUNTBLANK|COUNTROWS|COUNTX|CROSSFILTER|CROSSJOIN|CURRENCY|CURRENTGROUP|CUSTOMDATA|DATATABLE|DATE|DATEADD|DATEDIFF|DATESBETWEEN|DATESINPERIOD|DATESMTD|DATESQTD|DATESYTD|DATEVALUE|DAY|DEGREES|DETAILROWS|DISTINCT|DISTINCTCOUNT|DISTINCTCOUNTNOBLANK|DIVIDE|EARLIER|EARLIEST|EDATE|ENDOFMONTH|ENDOFQUARTER|ENDOFYEAR|EOMONTH|ERROR|EVEN|EXACT|EXCEPT|EXP|EXPON\.DIST|FACT|FALSE|FILTER|FILTERS|FIND|FIRSTDATE|FIRSTNONBLANK|FIRSTNONBLANKVALUE|FIXED|FLOOR|FORMAT|GCD|GENERATE|GENERATEALL|GENERATESERIES|GEOMEAN|GEOMEANX|GROUPBY|HASONEFILTER|HASONEVALUE|HOUR|IF|IF\.EAGER|IFERROR|IGNORE|INT|INTERSECT|ISBLANK|ISCROSSFILTERED|ISEMPTY|ISERROR|ISEVEN|ISFILTERED|ISINSCOPE|ISLOGICAL|ISNONTEXT|ISNUMBER|ISO\.CEILING|ISODD|ISONORAFTER|ISSELECTEDMEASURE|ISSUBTOTAL|ISTEXT|KEEPFILTERS|KEYWORDMATCH|LASTDATE|LASTNONBLANK|LASTNONBLANKVALUE|LCM|LEFT|LEN|LN|LOG|LOG10|LOOKUPVALUE|LOWER|MAX|MAXA|MAXX|MEDIAN|MEDIANX|MID|MIN|MINA|MINUTE|MINX|MOD|MONTH|MROUND|NATURALINNERJOIN|NATURALLEFTOUTERJOIN|NEXTDAY|NEXTMONTH|NEXTQUARTER|NEXTYEAR|NONVISUAL|NORM\.DIST|NORM\.INV|NORM\.S\.DIST|NORM\.S\.INV|NOT|NOW|ODD|OPENINGBALANCEMONTH|OPENINGBALANCEQUARTER|OPENINGBALANCEYEAR|OR|PARALLELPERIOD|PATH|PATHCONTAINS|PATHITEM|PATHITEMREVERSE|PATHLENGTH|PERCENTILE\.EXC|PERCENTILE\.INC|PERCENTILEX\.EXC|PERCENTILEX\.INC|PERMUT|PI|POISSON\.DIST|POWER|PREVIOUSDAY|PREVIOUSMONTH|PREVIOUSQUARTER|PREVIOUSYEAR|PRODUCT|PRODUCTX|QUARTER|QUOTIENT|RADIANS|RAND|RANDBETWEEN|RANK\.EQ|RANKX|RELATED|RELATEDTABLE|REMOVEFILTERS|REPLACE|REPT|RIGHT|ROLLUP|ROLLUPADDISSUBTOTAL|ROLLUPGROUP|ROLLUPISSUBTOTAL|ROUND|ROUNDDOWN|ROUNDUP|ROW|SAMEPERIODLASTYEAR|SAMPLE|SEARCH|SECOND|SELECTCOLUMNS|SELECTEDMEASURE|SELECTEDMEASUREFORMATSTRING|SELECTEDMEASURENAME|SELECTEDVALUE|SIGN|SIN|SINH|SQRT|SQRTPI|STARTOFMONTH|STARTOFQUARTER|STARTOFYEAR|STDEV\.P|STDEV\.S|STDEVX\.P|STDEVX\.S|SUBSTITUTE|SUBSTITUTEWITHINDEX|SUM|SUMMARIZE|SUMMARIZECOLUMNS|SUMX|SWITCH|T\.DIST|T\.DIST\.2T|T\.DIST\.RT|T\.INV|T\.INV\.2T|TAN|TANH|TIME|TIMEVALUE|TODAY|TOPN|TOPNPERLEVEL|TOPNSKIP|TOTALMTD|TOTALQTD|TOTALYTD|TREATAS|TRIM|TRUE|TRUNC|UNICHAR|UNICODE|UNION|UPPER|USERELATIONSHIP|USERNAME|USEROBJECTID|USERPRINCIPALNAME|UTCNOW|UTCTODAY|VALUE|VALUES|VAR\.P|VAR\.S|VARX\.P|VARX\.S|WEEKDAY|WEEKNUM|XIRR|XNPV|YEAR|YEARFRAC)(?=\s*\()/i,keyword:/\b(?:DEFINE|MEASURE|EVALUATE|ORDER\s+BY|RETURN|VAR|START\s+AT|ASC|DESC)\b/i,boolean:{pattern:/\b(?:TRUE|FALSE|NULL)\b/i,alias:"constant"},number:/\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/:=|[-+*\/=^]|&&?|\|\||<(?:=>?|<|>)?|>[>=]?|\b(?:IN|NOT)\b/i,punctuation:/[;\[\](){}`,.]/}}e.exports=t,t.displayName="dax",t.aliases=[]},13934(e){"use strict";function t(e){e.languages.dhall={comment:/--.*|\{-(?:[^-{]|-(?!\})|\{(?!-)|\{-(?:[^-{]|-(?!\})|\{(?!-))*-\})*-\}/,string:{pattern:/"(?:[^"\\]|\\.)*"|''(?:[^']|'(?!')|'''|''\$\{)*''(?!'|\$)/,greedy:!0,inside:{interpolation:{pattern:/\$\{[^{}]*\}/,inside:{expression:{pattern:/(^\$\{)[\s\S]+(?=\}$)/,lookbehind:!0,alias:"language-dhall",inside:null},punctuation:/\$\{|\}/}}}},label:{pattern:/`[^`]*`/,greedy:!0},url:{pattern:/\bhttps?:\/\/[\w.:%!$&'*+;=@~-]+(?:\/[\w.:%!$&'*+;=@~-]*)*(?:\?[/?\w.:%!$&'*+;=@~-]*)?/,greedy:!0},env:{pattern:/\benv:(?:(?!\d)\w+|"(?:[^"\\=]|\\.)*")/,greedy:!0,inside:{function:/^env/,operator:/^:/,variable:/[\s\S]+/}},hash:{pattern:/\bsha256:[\da-fA-F]{64}\b/,inside:{function:/sha256/,operator:/:/,number:/[\da-fA-F]{64}/}},keyword:/\b(?:as|assert|else|forall|if|in|let|merge|missing|then|toMap|using|with)\b|\u2200/,builtin:/\b(?:Some|None)\b/,boolean:/\b(?:False|True)\b/,number:/\bNaN\b|-?\bInfinity\b|[+-]?\b(?:0x[\da-fA-F]+|\d+(?:\.\d+)?(?:e[+-]?\d+)?)\b/,operator:/\/\\|\/\/\\\\|&&|\|\||===|[!=]=|\/\/|->|\+\+|::|[+*#@=:?<>|\\\u2227\u2a53\u2261\u2afd\u03bb\u2192]/,punctuation:/\.\.|[{}\[\](),./]/,"class-name":/\b[A-Z]\w*\b/},e.languages.dhall.string.inside.interpolation.inside.expression.inside=e.languages.dhall}e.exports=t,t.displayName="dhall",t.aliases=[]},93336(e){"use strict";function t(e){var t,n;(t=e).languages.diff={coord:[/^(?:\*{3}|-{3}|\+{3}).*$/m,/^@@.*@@$/m,/^\d.*$/m]},Object.keys(n={"deleted-sign":"-","deleted-arrow":"<","inserted-sign":"+","inserted-arrow":">",unchanged:" ",diff:"!"}).forEach(function(e){var r=n[e],i=[];/^\w+$/.test(e)||i.push(/\w+/.exec(e)[0]),"diff"===e&&i.push("bold"),t.languages.diff[e]={pattern:RegExp("^(?:["+r+"].*(?:\r\n?|\n|(?![\\s\\S])))+","m"),alias:i,inside:{line:{pattern:/(.)(?=[\s\S]).*(?:\r\n?|\n)?/,lookbehind:!0},prefix:{pattern:/[\s\S]/,alias:/\w+/.exec(e)[0]}}}}),Object.defineProperty(t.languages.diff,"PREFIXES",{value:n})}e.exports=t,t.displayName="diff",t.aliases=[]},13294(e,t,n){"use strict";var r=n(93205);function i(e){var t,n,i;e.register(r),(t=e).languages.django={comment:/^\{#[\s\S]*?#\}$/,tag:{pattern:/(^\{%[+-]?\s*)\w+/,lookbehind:!0,alias:"keyword"},delimiter:{pattern:/^\{[{%][+-]?|[+-]?[}%]\}$/,alias:"punctuation"},string:{pattern:/("|')(?:\\.|(?!\1)[^\\\r\n])*\1/,greedy:!0},filter:{pattern:/(\|)\w+/,lookbehind:!0,alias:"function"},test:{pattern:/(\bis\s+(?:not\s+)?)(?!not\b)\w+/,lookbehind:!0,alias:"function"},function:/\b[a-z_]\w+(?=\s*\()/i,keyword:/\b(?:and|as|by|else|for|if|import|in|is|loop|not|or|recursive|with|without)\b/,operator:/[-+%=]=?|!=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,number:/\b\d+(?:\.\d+)?\b/,boolean:/[Tt]rue|[Ff]alse|[Nn]one/,variable:/\b\w+?\b/,punctuation:/[{}[\](),.:;]/},n=/\{\{[\s\S]*?\}\}|\{%[\s\S]*?%\}|\{#[\s\S]*?#\}/g,i=t.languages["markup-templating"],t.hooks.add("before-tokenize",function(e){i.buildPlaceholders(e,"django",n)}),t.hooks.add("after-tokenize",function(e){i.tokenizePlaceholders(e,"django")}),t.languages.jinja2=t.languages.django,t.hooks.add("before-tokenize",function(e){i.buildPlaceholders(e,"jinja2",n)}),t.hooks.add("after-tokenize",function(e){i.tokenizePlaceholders(e,"jinja2")})}e.exports=i,i.displayName="django",i.aliases=["jinja2"]},38223(e){"use strict";function t(e){e.languages["dns-zone-file"]={comment:/;.*/,string:{pattern:/"(?:\\.|[^"\\\r\n])*"/,greedy:!0},variable:[{pattern:/(^\$ORIGIN[ \t]+)\S+/m,lookbehind:!0},{pattern:/(^|\s)@(?=\s|$)/,lookbehind:!0}],keyword:/^\$(?:ORIGIN|INCLUDE|TTL)(?=\s|$)/m,class:{pattern:/(^|\s)(?:IN|CH|CS|HS)(?=\s|$)/,lookbehind:!0,alias:"keyword"},type:{pattern:/(^|\s)(?:A|A6|AAAA|AFSDB|APL|ATMA|CAA|CDNSKEY|CDS|CERT|CNAME|DHCID|DLV|DNAME|DNSKEY|DS|EID|GID|GPOS|HINFO|HIP|IPSECKEY|ISDN|KEY|KX|LOC|MAILA|MAILB|MB|MD|MF|MG|MINFO|MR|MX|NAPTR|NB|NBSTAT|NIMLOC|NINFO|NS|NSAP|NSAP-PTR|NSEC|NSEC3|NSEC3PARAM|NULL|NXT|OPENPGPKEY|PTR|PX|RKEY|RP|RRSIG|RT|SIG|SINK|SMIMEA|SOA|SPF|SRV|SSHFP|TA|TKEY|TLSA|TSIG|TXT|UID|UINFO|UNSPEC|URI|WKS|X25)(?=\s|$)/,lookbehind:!0,alias:"keyword"},punctuation:/[()]/},e.languages["dns-zone"]=e.languages["dns-zone-file"]}e.exports=t,t.displayName="dnsZoneFile",t.aliases=[]},97266(e){"use strict";function t(e){!function(e){var t=/\\[\r\n](?:\s|\\[\r\n]|#.*(?!.))*(?![\s#]|\\[\r\n])/.source,n=/(?:[ \t]+(?![ \t])(?:)?|)/.source.replace(//g,function(){return t}),r=/"(?:[^"\\\r\n]|\\(?:\r\n|[\s\S]))*"|'(?:[^'\\\r\n]|\\(?:\r\n|[\s\S]))*'/.source,i=/--[\w-]+=(?:|(?!["'])(?:[^\s\\]|\\.)+)/.source.replace(//g,function(){return r}),a={pattern:RegExp(r),greedy:!0},o={pattern:/(^[ \t]*)#.*/m,lookbehind:!0,greedy:!0};function s(e,t){return e=e.replace(//g,function(){return i}).replace(//g,function(){return n}),RegExp(e,t)}e.languages.docker={instruction:{pattern:/(^[ \t]*)(?:ADD|ARG|CMD|COPY|ENTRYPOINT|ENV|EXPOSE|FROM|HEALTHCHECK|LABEL|MAINTAINER|ONBUILD|RUN|SHELL|STOPSIGNAL|USER|VOLUME|WORKDIR)(?=\s)(?:\\.|[^\r\n\\])*(?:\\$(?:\s|#.*$)*(?![\s#])(?:\\.|[^\r\n\\])*)*/im,lookbehind:!0,greedy:!0,inside:{options:{pattern:s(/(^(?:ONBUILD)?\w+)(?:)*/.source,"i"),lookbehind:!0,greedy:!0,inside:{property:{pattern:/(^|\s)--[\w-]+/,lookbehind:!0},string:[a,{pattern:/(=)(?!["'])(?:[^\s\\]|\\.)+/,lookbehind:!0}],operator:/\\$/m,punctuation:/=/}},keyword:[{pattern:s(/(^(?:ONBUILD)?HEALTHCHECK(?:)*)(?:CMD|NONE)\b/.source,"i"),lookbehind:!0,greedy:!0},{pattern:s(/(^(?:ONBUILD)?FROM(?:)*(?!--)[^ \t\\]+)AS/.source,"i"),lookbehind:!0,greedy:!0},{pattern:s(/(^ONBUILD)\w+/.source,"i"),lookbehind:!0,greedy:!0},{pattern:/^\w+/,greedy:!0}],comment:o,string:a,variable:/\$(?:\w+|\{[^{}"'\\]*\})/,operator:/\\$/m}},comment:o},e.languages.dockerfile=e.languages.docker}(e)}e.exports=t,t.displayName="docker",t.aliases=["dockerfile"]},80636(e){"use strict";function t(e){!function(e){var t="(?:"+[/[a-zA-Z_\x80-\uFFFF][\w\x80-\uFFFF]*/.source,/-?(?:\.\d+|\d+(?:\.\d*)?)/.source,/"[^"\\]*(?:\\[\s\S][^"\\]*)*"/.source,/<(?:[^<>]|(?!)*>/.source].join("|")+")",n={markup:{pattern:/(^<)[\s\S]+(?=>$)/,lookbehind:!0,alias:["language-markup","language-html","language-xml"],inside:e.languages.markup}};function r(e,n){return RegExp(e.replace(//g,function(){return t}),n)}e.languages.dot={comment:{pattern:/\/\/.*|\/\*[\s\S]*?\*\/|^#.*/m,greedy:!0},"graph-name":{pattern:r(/(\b(?:digraph|graph|subgraph)[ \t\r\n]+)/.source,"i"),lookbehind:!0,greedy:!0,alias:"class-name",inside:n},"attr-value":{pattern:r(/(=[ \t\r\n]*)/.source),lookbehind:!0,greedy:!0,inside:n},"attr-name":{pattern:r(/([\[;, \t\r\n])(?=[ \t\r\n]*=)/.source),lookbehind:!0,greedy:!0,inside:n},keyword:/\b(?:digraph|edge|graph|node|strict|subgraph)\b/i,"compass-point":{pattern:/(:[ \t\r\n]*)(?:[ns][ew]?|[ewc_])(?![\w\x80-\uFFFF])/,lookbehind:!0,alias:"builtin"},node:{pattern:r(/(^|[^-.\w\x80-\uFFFF\\])/.source),lookbehind:!0,greedy:!0,inside:n},operator:/[=:]|-[->]/,punctuation:/[\[\]{};,]/},e.languages.gv=e.languages.dot}(e)}e.exports=t,t.displayName="dot",t.aliases=["gv"]},36500(e){"use strict";function t(e){e.languages.ebnf={comment:/\(\*[\s\S]*?\*\)/,string:{pattern:/"[^"\r\n]*"|'[^'\r\n]*'/,greedy:!0},special:{pattern:/\?[^?\r\n]*\?/,greedy:!0,alias:"class-name"},definition:{pattern:/^([\t ]*)[a-z]\w*(?:[ \t]+[a-z]\w*)*(?=\s*=)/im,lookbehind:!0,alias:["rule","keyword"]},rule:/\b[a-z]\w*(?:[ \t]+[a-z]\w*)*\b/i,punctuation:/\([:/]|[:/]\)|[.,;()[\]{}]/,operator:/[-=|*/!]/}}e.exports=t,t.displayName="ebnf",t.aliases=[]},30296(e){"use strict";function t(e){e.languages.editorconfig={comment:/[;#].*/,section:{pattern:/(^[ \t]*)\[.+\]/m,lookbehind:!0,alias:"keyword",inside:{regex:/\\\\[\[\]{},!?.*]/,operator:/[!?]|\.\.|\*{1,2}/,punctuation:/[\[\]{},]/}},property:{pattern:/(^[ \t]*)[^\s=]+(?=[ \t]*=)/m,lookbehind:!0},value:{pattern:/=.*/,alias:"string",inside:{punctuation:/^=/}}}}e.exports=t,t.displayName="editorconfig",t.aliases=[]},50115(e){"use strict";function t(e){e.languages.eiffel={comment:/--.*/,string:[{pattern:/"([^[]*)\[[\s\S]*?\]\1"/,greedy:!0},{pattern:/"([^{]*)\{[\s\S]*?\}\1"/,greedy:!0},{pattern:/"(?:%(?:(?!\n)\s)*\n\s*%|%\S|[^%"\r\n])*"/,greedy:!0}],char:/'(?:%.|[^%'\r\n])+'/,keyword:/\b(?:across|agent|alias|all|and|attached|as|assign|attribute|check|class|convert|create|Current|debug|deferred|detachable|do|else|elseif|end|ensure|expanded|export|external|feature|from|frozen|if|implies|inherit|inspect|invariant|like|local|loop|not|note|obsolete|old|once|or|Precursor|redefine|rename|require|rescue|Result|retry|select|separate|some|then|undefine|until|variant|Void|when|xor)\b/i,boolean:/\b(?:True|False)\b/i,"class-name":{pattern:/\b[A-Z][\dA-Z_]*\b/,alias:"builtin"},number:[/\b0[xcb][\da-f](?:_*[\da-f])*\b/i,/(?:\b\d(?:_*\d)*)?\.(?:(?:\d(?:_*\d)*)?e[+-]?)?\d(?:_*\d)*\b|\b\d(?:_*\d)*\b\.?/i],punctuation:/:=|<<|>>|\(\||\|\)|->|\.(?=\w)|[{}[\];(),:?]/,operator:/\\\\|\|\.\.\||\.\.|\/[~\/=]?|[><]=?|[-+*^=~]/}}e.exports=t,t.displayName="eiffel",t.aliases=[]},20791(e,t,n){"use strict";var r=n(93205);function i(e){var t;e.register(r),(t=e).languages.ejs={delimiter:{pattern:/^<%[-_=]?|[-_]?%>$/,alias:"punctuation"},comment:/^#[\s\S]*/,"language-javascript":{pattern:/[\s\S]+/,inside:t.languages.javascript}},t.hooks.add("before-tokenize",function(e){var n=/<%(?!%)[\s\S]+?%>/g;t.languages["markup-templating"].buildPlaceholders(e,"ejs",n)}),t.hooks.add("after-tokenize",function(e){t.languages["markup-templating"].tokenizePlaceholders(e,"ejs")}),t.languages.eta=t.languages.ejs}e.exports=i,i.displayName="ejs",i.aliases=["eta"]},11974(e){"use strict";function t(e){e.languages.elixir={doc:{pattern:/@(?:doc|moduledoc)\s+(?:("""|''')[\s\S]*?\1|("|')(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2)/,inside:{attribute:/^@\w+/,string:/['"][\s\S]+/}},comment:{pattern:/#.*/m,greedy:!0},regex:{pattern:/~[rR](?:("""|''')(?:\\[\s\S]|(?!\1)[^\\])+\1|([\/|"'])(?:\\.|(?!\2)[^\\\r\n])+\2|\((?:\\.|[^\\)\r\n])+\)|\[(?:\\.|[^\\\]\r\n])+\]|\{(?:\\.|[^\\}\r\n])+\}|<(?:\\.|[^\\>\r\n])+>)[uismxfr]*/,greedy:!0},string:[{pattern:/~[cCsSwW](?:("""|''')(?:\\[\s\S]|(?!\1)[^\\])+\1|([\/|"'])(?:\\.|(?!\2)[^\\\r\n])+\2|\((?:\\.|[^\\)\r\n])+\)|\[(?:\\.|[^\\\]\r\n])+\]|\{(?:\\.|#\{[^}]+\}|#(?!\{)|[^#\\}\r\n])+\}|<(?:\\.|[^\\>\r\n])+>)[csa]?/,greedy:!0,inside:{}},{pattern:/("""|''')[\s\S]*?\1/,greedy:!0,inside:{}},{pattern:/("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0,inside:{}}],atom:{pattern:/(^|[^:]):\w+/,lookbehind:!0,alias:"symbol"},module:{pattern:/\b[A-Z]\w*\b/,alias:"class-name"},"attr-name":/\b\w+\??:(?!:)/,argument:{pattern:/(^|[^&])&\d+/,lookbehind:!0,alias:"variable"},attribute:{pattern:/@\w+/,alias:"variable"},function:/\b[_a-zA-Z]\w*[?!]?(?:(?=\s*(?:\.\s*)?\()|(?=\/\d))/,number:/\b(?:0[box][a-f\d_]+|\d[\d_]*)(?:\.[\d_]+)?(?:e[+-]?[\d_]+)?\b/i,keyword:/\b(?:after|alias|and|case|catch|cond|def(?:callback|delegate|exception|impl|macro|module|n|np|p|protocol|struct)?|do|else|end|fn|for|if|import|not|or|quote|raise|require|rescue|try|unless|unquote|use|when)\b/,boolean:/\b(?:true|false|nil)\b/,operator:[/\bin\b|&&?|\|[|>]?|\\\\|::|\.\.\.?|\+\+?|-[->]?|<[-=>]|>=|!==?|\B!|=(?:==?|[>~])?|[*\/^]/,{pattern:/([^<])<(?!<)/,lookbehind:!0},{pattern:/([^>])>(?!>)/,lookbehind:!0}],punctuation:/<<|>>|[.,%\[\]{}()]/},e.languages.elixir.string.forEach(function(t){t.inside={interpolation:{pattern:/#\{[^}]+\}/,inside:{delimiter:{pattern:/^#\{|\}$/,alias:"punctuation"},rest:e.languages.elixir}}}})}e.exports=t,t.displayName="elixir",t.aliases=[]},8645(e){"use strict";function t(e){e.languages.elm={comment:/--.*|\{-[\s\S]*?-\}/,char:{pattern:/'(?:[^\\'\r\n]|\\(?:[abfnrtv\\']|\d+|x[0-9a-fA-F]+))'/,greedy:!0},string:[{pattern:/"""[\s\S]*?"""/,greedy:!0},{pattern:/"(?:[^\\"\r\n]|\\.)*"/,greedy:!0}],"import-statement":{pattern:/(^[\t ]*)import\s+[A-Z]\w*(?:\.[A-Z]\w*)*(?:\s+as\s+(?:[A-Z]\w*)(?:\.[A-Z]\w*)*)?(?:\s+exposing\s+)?/m,lookbehind:!0,inside:{keyword:/\b(?:import|as|exposing)\b/}},keyword:/\b(?:alias|as|case|else|exposing|if|in|infixl|infixr|let|module|of|then|type)\b/,builtin:/\b(?:abs|acos|always|asin|atan|atan2|ceiling|clamp|compare|cos|curry|degrees|e|flip|floor|fromPolar|identity|isInfinite|isNaN|logBase|max|min|negate|never|not|pi|radians|rem|round|sin|sqrt|tan|toFloat|toPolar|toString|truncate|turns|uncurry|xor)\b/,number:/\b(?:\d+(?:\.\d+)?(?:e[+-]?\d+)?|0x[0-9a-f]+)\b/i,operator:/\s\.\s|[+\-/*=.$<>:&|^?%#@~!]{2,}|[+\-/*=$<>:&|^?%#@~!]/,hvariable:/\b(?:[A-Z]\w*\.)*[a-z]\w*\b/,constant:/\b(?:[A-Z]\w*\.)*[A-Z]\w*\b/,punctuation:/[{}[\]|(),.:]/}}e.exports=t,t.displayName="elm",t.aliases=[]},84790(e,t,n){"use strict";var r=n(56939),i=n(93205);function a(e){var t;e.register(r),e.register(i),(t=e).languages.erb=t.languages.extend("ruby",{}),t.languages.insertBefore("erb","comment",{delimiter:{pattern:/^<%=?|%>$/,alias:"punctuation"}}),t.hooks.add("before-tokenize",function(e){var n=/<%=?(?:[^\r\n]|[\r\n](?!=begin)|[\r\n]=begin\s(?:[^\r\n]|[\r\n](?!=end))*[\r\n]=end)+?%>/gm;t.languages["markup-templating"].buildPlaceholders(e,"erb",n)}),t.hooks.add("after-tokenize",function(e){t.languages["markup-templating"].tokenizePlaceholders(e,"erb")})}e.exports=a,a.displayName="erb",a.aliases=[]},4502(e){"use strict";function t(e){e.languages.erlang={comment:/%.+/,string:{pattern:/"(?:\\.|[^\\"\r\n])*"/,greedy:!0},"quoted-function":{pattern:/'(?:\\.|[^\\'\r\n])+'(?=\()/,alias:"function"},"quoted-atom":{pattern:/'(?:\\.|[^\\'\r\n])+'/,alias:"atom"},boolean:/\b(?:true|false)\b/,keyword:/\b(?:fun|when|case|of|end|if|receive|after|try|catch)\b/,number:[/\$\\?./,/\b\d+#[a-z0-9]+/i,/(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i],function:/\b[a-z][\w@]*(?=\()/,variable:{pattern:/(^|[^@])(?:\b|\?)[A-Z_][\w@]*/,lookbehind:!0},operator:[/[=\/<>:]=|=[:\/]=|\+\+?|--?|[=*\/!]|\b(?:bnot|div|rem|band|bor|bxor|bsl|bsr|not|and|or|xor|orelse|andalso)\b/,{pattern:/(^|[^<])<(?!<)/,lookbehind:!0},{pattern:/(^|[^>])>(?!>)/,lookbehind:!0}],atom:/\b[a-z][\w@]*/,punctuation:/[()[\]{}:;,.#|]|<<|>>/}}e.exports=t,t.displayName="erlang",t.aliases=[]},66055(e,t,n){"use strict";var r=n(59803),i=n(93205);function a(e){var t;e.register(r),e.register(i),(t=e).languages.etlua={delimiter:{pattern:/^<%[-=]?|-?%>$/,alias:"punctuation"},"language-lua":{pattern:/[\s\S]+/,inside:t.languages.lua}},t.hooks.add("before-tokenize",function(e){var n=/<%[\s\S]+?%>/g;t.languages["markup-templating"].buildPlaceholders(e,"etlua",n)}),t.hooks.add("after-tokenize",function(e){t.languages["markup-templating"].tokenizePlaceholders(e,"etlua")})}e.exports=a,a.displayName="etlua",a.aliases=[]},68876(e){"use strict";function t(e){e.languages["excel-formula"]={comment:{pattern:/(\bN\(\s*)"(?:[^"]|"")*"(?=\s*\))/i,lookbehind:!0,greedy:!0},string:{pattern:/"(?:[^"]|"")*"(?!")/,greedy:!0},reference:{pattern:/(?:'[^']*'|(?:[^\s()[\]{}<>*?"';,$&]*\[[^^\s()[\]{}<>*?"']+\])?\w+)!/,greedy:!0,alias:"string",inside:{operator:/!$/,punctuation:/'/,sheet:{pattern:/[^[\]]+$/,alias:"function"},file:{pattern:/\[[^[\]]+\]$/,inside:{punctuation:/[[\]]/}},path:/[\s\S]+/}},"function-name":{pattern:/\b[A-Z]\w*(?=\()/i,alias:"keyword"},range:{pattern:/\$?\b(?:[A-Z]+\$?\d+:\$?[A-Z]+\$?\d+|[A-Z]+:\$?[A-Z]+|\d+:\$?\d+)\b/i,alias:"property",inside:{operator:/:/,cell:/\$?[A-Z]+\$?\d+/i,column:/\$?[A-Z]+/i,row:/\$?\d+/}},cell:{pattern:/\b[A-Z]+\d+\b|\$[A-Za-z]+\$?\d+\b|\b[A-Za-z]+\$\d+\b/,alias:"property"},number:/(?:\b\d+(?:\.\d+)?|\B\.\d+)(?:e[+-]?\d+)?\b/i,boolean:/\b(?:TRUE|FALSE)\b/i,operator:/[-+*/^%=&,]|<[=>]?|>=?/,punctuation:/[[\]();{}|]/},e.languages.xlsx=e.languages.xls=e.languages["excel-formula"]}e.exports=t,t.displayName="excelFormula",t.aliases=[]},95126(e){"use strict";function t(e){var t,n,r,i,a,o,s,u;t=e,i={comment:[{pattern:/(^|\s)(?:! .*|!$)/,lookbehind:!0,inside:n={function:/\b(?:TODOS?|FIX(?:MES?)?|NOTES?|BUGS?|XX+|HACKS?|WARN(?:ING)?|\?{2,}|!{2,})\b/}},{pattern:/(^|\s)\/\*\s[\s\S]*?\*\/(?=\s|$)/,lookbehind:!0,greedy:!0,inside:n},{pattern:/(^|\s)!\[(={0,6})\[\s[\s\S]*?\]\2\](?=\s|$)/,lookbehind:!0,greedy:!0,inside:n}],number:[{pattern:/(^|\s)[+-]?\d+(?=\s|$)/,lookbehind:!0},{pattern:/(^|\s)[+-]?0(?:b[01]+|o[0-7]+|d\d+|x[\dA-F]+)(?=\s|$)/i,lookbehind:!0},{pattern:/(^|\s)[+-]?\d+\/\d+\.?(?=\s|$)/,lookbehind:!0},{pattern:/(^|\s)\+?\d+\+\d+\/\d+(?=\s|$)/,lookbehind:!0},{pattern:/(^|\s)-\d+-\d+\/\d+(?=\s|$)/,lookbehind:!0},{pattern:/(^|\s)[+-]?(?:\d*\.\d+|\d+\.\d*|\d+)(?:e[+-]?\d+)?(?=\s|$)/i,lookbehind:!0},{pattern:/(^|\s)NAN:\s+[\da-fA-F]+(?=\s|$)/,lookbehind:!0},{pattern:/(^|\s)[+-]?0(?:b1\.[01]*|o1\.[0-7]*|d1\.\d*|x1\.[\dA-F]*)p\d+(?=\s|$)/i,lookbehind:!0}],regexp:{pattern:/(^|\s)R\/\s(?:\\\S|[^\\/])*\/(?:[idmsr]*|[idmsr]+-[idmsr]+)(?=\s|$)/,lookbehind:!0,alias:"number",inside:{variable:/\\\S/,keyword:/[+?*\[\]^$(){}.|]/,operator:{pattern:/(\/)[idmsr]+(?:-[idmsr]+)?/,lookbehind:!0}}},boolean:{pattern:/(^|\s)[tf](?=\s|$)/,lookbehind:!0},"custom-string":{pattern:/(^|\s)[A-Z0-9\-]+"\s(?:\\\S|[^"\\])*"/,lookbehind:!0,greedy:!0,alias:"string",inside:{number:/\\\S|%\w|\//}},"multiline-string":[{pattern:/(^|\s)STRING:\s+\S+(?:\n|\r\n).*(?:\n|\r\n)\s*;(?=\s|$)/,lookbehind:!0,greedy:!0,alias:"string",inside:{number:(r={number:/\\[^\s']|%\w/}).number,"semicolon-or-setlocal":{pattern:/([\r\n][ \t]*);(?=\s|$)/,lookbehind:!0,alias:"function"}}},{pattern:/(^|\s)HEREDOC:\s+\S+(?:\n|\r\n).*(?:\n|\r\n)\s*\S+(?=\s|$)/,lookbehind:!0,greedy:!0,alias:"string",inside:r},{pattern:/(^|\s)\[(={0,6})\[\s[\s\S]*?\]\2\](?=\s|$)/,lookbehind:!0,greedy:!0,alias:"string",inside:r}],"special-using":{pattern:/(^|\s)USING:(?:\s\S+)*(?=\s+;(?:\s|$))/,lookbehind:!0,alias:"function",inside:{string:{pattern:/(\s)[^:\s]+/,lookbehind:!0}}},"stack-effect-delimiter":[{pattern:/(^|\s)(?:call|execute|eval)?\((?=\s)/,lookbehind:!0,alias:"operator"},{pattern:/(\s)--(?=\s)/,lookbehind:!0,alias:"operator"},{pattern:/(\s)\)(?=\s|$)/,lookbehind:!0,alias:"operator"}],combinators:{pattern:null,lookbehind:!0,alias:"keyword"},"kernel-builtin":{pattern:null,lookbehind:!0,alias:"variable"},"sequences-builtin":{pattern:null,lookbehind:!0,alias:"variable"},"math-builtin":{pattern:null,lookbehind:!0,alias:"variable"},"constructor-word":{pattern:/(^|\s)<(?!=+>|-+>)\S+>(?=\s|$)/,lookbehind:!0,alias:"keyword"},"other-builtin-syntax":{pattern:null,lookbehind:!0,alias:"operator"},"conventionally-named-word":{pattern:/(^|\s)(?!")(?:(?:set|change|with|new)-\S+|\$\S+|>[^>\s]+|[^:>\s]+>|[^>\s]+>[^>\s]+|\+[^+\s]+\+|[^?\s]+\?|\?[^?\s]+|[^>\s]+>>|>>[^>\s]+|[^<\s]+<<|\([^()\s]+\)|[^!\s]+!|[^*\s]\S*\*|[^.\s]\S*\.)(?=\s|$)/,lookbehind:!0,alias:"keyword"},"colon-syntax":{pattern:/(^|\s)(?:[A-Z0-9\-]+#?)?:{1,2}\s+(?:;\S+|(?!;)\S+)(?=\s|$)/,lookbehind:!0,greedy:!0,alias:"function"},"semicolon-or-setlocal":{pattern:/(\s)(?:;|:>)(?=\s|$)/,lookbehind:!0,alias:"function"},"curly-brace-literal-delimiter":[{pattern:/(^|\s)[a-z]*\{(?=\s)/i,lookbehind:!0,alias:"operator"},{pattern:/(\s)\}(?=\s|$)/,lookbehind:!0,alias:"operator"}],"quotation-delimiter":[{pattern:/(^|\s)\[(?=\s)/,lookbehind:!0,alias:"operator"},{pattern:/(\s)\](?=\s|$)/,lookbehind:!0,alias:"operator"}],"normal-word":{pattern:/(^|\s)[^"\s]\S*(?=\s|$)/,lookbehind:!0},string:{pattern:/"(?:\\\S|[^"\\])*"/,greedy:!0,inside:r}},a=function(e){return(e+"").replace(/([.?*+\^$\[\]\\(){}|\-])/g,"\\$1")},o=function(e){return RegExp("(^|\\s)(?:"+e.map(a).join("|")+")(?=\\s|$)")},Object.keys(s={"kernel-builtin":["or","2nipd","4drop","tuck","wrapper","nip","wrapper?","callstack>array","die","dupd","callstack","callstack?","3dup","hashcode","pick","4nip","build",">boolean","nipd","clone","5nip","eq?","?","=","swapd","2over","clear","2dup","get-retainstack","not","tuple?","dup","3nipd","call","-rotd","object","drop","assert=","assert?","-rot","execute","boa","get-callstack","curried?","3drop","pickd","overd","over","roll","3nip","swap","and","2nip","rotd","throw","(clone)","hashcode*","spin","reach","4dup","equal?","get-datastack","assert","2drop","","boolean?","identity-hashcode","identity-tuple?","null","composed?","new","5drop","rot","-roll","xor","identity-tuple","boolean"],"other-builtin-syntax":["=======","recursive","flushable",">>","<<<<<<","M\\","B","PRIVATE>","\\","======","final","inline","delimiter","deprecated",">>>>>","<<<<<<<","parse-complex","malformed-complex","read-only",">>>>>>>","call-next-method","<<","foldable","$","$[","${"],"sequences-builtin":["member-eq?","mismatch","append","assert-sequence=","longer","repetition","clone-like","3sequence","assert-sequence?","last-index-from","reversed","index-from","cut*","pad-tail","join-as","remove-eq!","concat-as","but-last","snip","nths","nth","sequence","longest","slice?","","remove-nth","tail-slice","empty?","tail*","member?","virtual-sequence?","set-length","drop-prefix","iota","unclip","bounds-error?","unclip-last-slice","non-negative-integer-expected","non-negative-integer-expected?","midpoint@","longer?","?set-nth","?first","rest-slice","prepend-as","prepend","fourth","sift","subseq-start","new-sequence","?last","like","first4","1sequence","reverse","slice","virtual@","repetition?","set-last","index","4sequence","max-length","set-second","immutable-sequence","first2","first3","supremum","unclip-slice","suffix!","insert-nth","tail","3append","short","suffix","concat","flip","immutable?","reverse!","2sequence","sum","delete-all","indices","snip-slice","","check-slice","sequence?","head","append-as","halves","sequence=","collapse-slice","?second","slice-error?","product","bounds-check?","bounds-check","immutable","virtual-exemplar","harvest","remove","pad-head","last","set-fourth","cartesian-product","remove-eq","shorten","shorter","reversed?","shorter?","shortest","head-slice","pop*","tail-slice*","but-last-slice","iota?","append!","cut-slice","new-resizable","head-slice*","sequence-hashcode","pop","set-nth","?nth","second","join","immutable-sequence?","","3append-as","virtual-sequence","subseq?","remove-nth!","length","last-index","lengthen","assert-sequence","copy","move","third","first","tail?","set-first","prefix","bounds-error","","exchange","surround","cut","min-length","set-third","push-all","head?","subseq-start-from","delete-slice","rest","sum-lengths","head*","infimum","remove!","glue","slice-error","subseq","push","replace-slice","subseq-as","unclip-last"],"math-builtin":["number=","next-power-of-2","?1+","fp-special?","imaginary-part","float>bits","number?","fp-infinity?","bignum?","fp-snan?","denominator","gcd","*","+","fp-bitwise=","-","u>=","/",">=","bitand","power-of-2?","log2-expects-positive","neg?","<","log2",">","integer?","number","bits>double","2/","zero?","bits>float","float?","shift","ratio?","rect>","even?","ratio","fp-sign","bitnot",">fixnum","complex?","/i","integer>fixnum","/f","sgn",">bignum","next-float","u<","u>","mod","recip","rational",">float","2^","integer","fixnum?","neg","fixnum","sq","bignum",">rect","bit?","fp-qnan?","simple-gcd","complex","","real",">fraction","double>bits","bitor","rem","fp-nan-payload","real-part","log2-expects-positive?","prev-float","align","unordered?","float","fp-nan?","abs","bitxor","integer>fixnum-strict","u<=","odd?","<=","/mod",">integer","real?","rational?","numerator"]}).forEach(function(e){i[e].pattern=o(s[e])}),u=["2bi","while","2tri","bi*","4dip","both?","same?","tri@","curry","prepose","3bi","?if","tri*","2keep","3keep","curried","2keepd","when","2bi*","2tri*","4keep","bi@","keepdd","do","unless*","tri-curry","if*","loop","bi-curry*","when*","2bi@","2tri@","with","2with","either?","bi","until","3dip","3curry","tri-curry*","tri-curry@","bi-curry","keepd","compose","2dip","if","3tri","unless","tuple","keep","2curry","tri","most","while*","dip","composed","bi-curry@","find-last-from","trim-head-slice","map-as","each-from","none?","trim-tail","partition","if-empty","accumulate*","reject!","find-from","accumulate-as","collector-for-as","reject","map","map-sum","accumulate!","2each-from","follow","supremum-by","map!","unless-empty","collector","padding","reduce-index","replicate-as","infimum-by","trim-tail-slice","count","find-index","filter","accumulate*!","reject-as","map-integers","map-find","reduce","selector","interleave","2map","filter-as","binary-reduce","map-index-as","find","produce","filter!","replicate","cartesian-map","cartesian-each","find-index-from","map-find-last","3map-as","3map","find-last","selector-as","2map-as","2map-reduce","accumulate","each","each-index","accumulate*-as","when-empty","all?","collector-as","push-either","new-like","collector-for","2selector","push-if","2all?","map-reduce","3each","any?","trim-slice","2reduce","change-nth","produce-as","2each","trim","trim-head","cartesian-find","map-index","if-zero","each-integer","unless-zero","(find-integer)","when-zero","find-last-integer","(all-integers?)","times","(each-integer)","find-integer","all-integers?","unless-negative","if-positive","when-positive","when-negative","unless-positive","if-negative","case","2cleave","cond>quot","case>quot","3cleave","wrong-values","to-fixed-point","alist>quot","cond","cleave","call-effect","recursive-hashcode","spread","deep-spread>quot","2||","0||","n||","0&&","2&&","3||","1||","1&&","n&&","3&&","smart-unless*","keep-inputs","reduce-outputs","smart-when*","cleave>array","smart-with","smart-apply","smart-if","inputs/outputs","output>sequence-n","map-outputs","map-reduce-outputs","dropping","output>array","smart-map-reduce","smart-2map-reduce","output>array-n","nullary","inputsequence"],i.combinators.pattern=o(u),t.languages.factor=i}e.exports=t,t.displayName="factor",t.aliases=[]},74644(e){"use strict";function t(e){var t;(t=e).languages.false={comment:{pattern:/\{[^}]*\}/},string:{pattern:/"[^"]*"/,greedy:!0},"character-code":{pattern:/'(?:[^\r]|\r\n?)/,alias:"number"},"assembler-code":{pattern:/\d+`/,alias:"important"},number:/\d+/,operator:/[-!#$%&'*+,./:;=>?@\\^_`|~ßø]/,punctuation:/\[|\]/,variable:/[a-z]/,"non-standard":{pattern:/[()!=]=?|[-+*/%]|\b(?:in|is)\b/}),delete e.languages["firestore-security-rules"]["class-name"],e.languages.insertBefore("firestore-security-rules","keyword",{path:{pattern:/(^|[\s(),])(?:\/(?:[\w\xA0-\uFFFF]+|\{[\w\xA0-\uFFFF]+(?:=\*\*)?\}|\$\([\w\xA0-\uFFFF.]+\)))+/,lookbehind:!0,greedy:!0,inside:{variable:{pattern:/\{[\w\xA0-\uFFFF]+(?:=\*\*)?\}|\$\([\w\xA0-\uFFFF.]+\)/,inside:{operator:/=/,keyword:/\*\*/,punctuation:/[.$(){}]/}},punctuation:/\//}},method:{pattern:/(\ballow\s+)[a-z]+(?:\s*,\s*[a-z]+)*(?=\s*[:;])/,lookbehind:!0,alias:"builtin",inside:{punctuation:/,/}}})}e.exports=t,t.displayName="firestoreSecurityRules",t.aliases=[]},37225(e){"use strict";function t(e){var t;(t=e).languages.flow=t.languages.extend("javascript",{}),t.languages.insertBefore("flow","keyword",{type:[{pattern:/\b(?:[Nn]umber|[Ss]tring|[Bb]oolean|Function|any|mixed|null|void)\b/,alias:"tag"}]}),t.languages.flow["function-variable"].pattern=/(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=\s*(?:function\b|(?:\([^()]*\)(?:\s*:\s*\w+)?|(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/i,delete t.languages.flow.parameter,t.languages.insertBefore("flow","operator",{"flow-punctuation":{pattern:/\{\||\|\}/,alias:"punctuation"}}),Array.isArray(t.languages.flow.keyword)||(t.languages.flow.keyword=[t.languages.flow.keyword]),t.languages.flow.keyword.unshift({pattern:/(^|[^$]\b)(?:type|opaque|declare|Class)\b(?!\$)/,lookbehind:!0},{pattern:/(^|[^$]\B)\$(?:await|Diff|Exact|Keys|ObjMap|PropertyType|Shape|Record|Supertype|Subtype|Enum)\b(?!\$)/,lookbehind:!0})}e.exports=t,t.displayName="flow",t.aliases=[]},16725(e){"use strict";function t(e){e.languages.fortran={"quoted-number":{pattern:/[BOZ](['"])[A-F0-9]+\1/i,alias:"number"},string:{pattern:/(?:\b\w+_)?(['"])(?:\1\1|&(?:\r\n?|\n)(?:[ \t]*!.*(?:\r\n?|\n)|(?![ \t]*!))|(?!\1).)*(?:\1|&)/,inside:{comment:{pattern:/(&(?:\r\n?|\n)\s*)!.*/,lookbehind:!0}}},comment:{pattern:/!.*/,greedy:!0},boolean:/\.(?:TRUE|FALSE)\.(?:_\w+)?/i,number:/(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[ED][+-]?\d+)?(?:_\w+)?/i,keyword:[/\b(?:INTEGER|REAL|DOUBLE ?PRECISION|COMPLEX|CHARACTER|LOGICAL)\b/i,/\b(?:END ?)?(?:BLOCK ?DATA|DO|FILE|FORALL|FUNCTION|IF|INTERFACE|MODULE(?! PROCEDURE)|PROGRAM|SELECT|SUBROUTINE|TYPE|WHERE)\b/i,/\b(?:ALLOCATABLE|ALLOCATE|BACKSPACE|CALL|CASE|CLOSE|COMMON|CONTAINS|CONTINUE|CYCLE|DATA|DEALLOCATE|DIMENSION|DO|END|EQUIVALENCE|EXIT|EXTERNAL|FORMAT|GO ?TO|IMPLICIT(?: NONE)?|INQUIRE|INTENT|INTRINSIC|MODULE PROCEDURE|NAMELIST|NULLIFY|OPEN|OPTIONAL|PARAMETER|POINTER|PRINT|PRIVATE|PUBLIC|READ|RETURN|REWIND|SAVE|SELECT|STOP|TARGET|WHILE|WRITE)\b/i,/\b(?:ASSIGNMENT|DEFAULT|ELEMENTAL|ELSE|ELSEWHERE|ELSEIF|ENTRY|IN|INCLUDE|INOUT|KIND|NULL|ONLY|OPERATOR|OUT|PURE|RECURSIVE|RESULT|SEQUENCE|STAT|THEN|USE)\b/i],operator:[/\*\*|\/\/|=>|[=\/]=|[<>]=?|::|[+\-*=%]|\.[A-Z]+\./i,{pattern:/(^|(?!\().)\/(?!\))/,lookbehind:!0}],punctuation:/\(\/|\/\)|[(),;:&]/}}e.exports=t,t.displayName="fortran",t.aliases=[]},95559(e){"use strict";function t(e){e.languages.fsharp=e.languages.extend("clike",{comment:[{pattern:/(^|[^\\])\(\*(?!\))[\s\S]*?\*\)/,lookbehind:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0}],string:{pattern:/(?:"""[\s\S]*?"""|@"(?:""|[^"])*"|"(?:\\[\s\S]|[^\\"])*")B?|'(?:[^\\']|\\(?:.|\d{3}|x[a-fA-F\d]{2}|u[a-fA-F\d]{4}|U[a-fA-F\d]{8}))'B?/,greedy:!0},"class-name":{pattern:/(\b(?:exception|inherit|interface|new|of|type)\s+|\w\s*:\s*|\s:\??>\s*)[.\w]+\b(?:\s*(?:->|\*)\s*[.\w]+\b)*(?!\s*[:.])/,lookbehind:!0,inside:{operator:/->|\*/,punctuation:/\./}},keyword:/\b(?:let|return|use|yield)(?:!\B|\b)|\b(?:abstract|and|as|assert|base|begin|class|default|delegate|do|done|downcast|downto|elif|else|end|exception|extern|false|finally|for|fun|function|global|if|in|inherit|inline|interface|internal|lazy|match|member|module|mutable|namespace|new|not|null|of|open|or|override|private|public|rec|select|static|struct|then|to|true|try|type|upcast|val|void|when|while|with|asr|land|lor|lsl|lsr|lxor|mod|sig|atomic|break|checked|component|const|constraint|constructor|continue|eager|event|external|fixed|functor|include|method|mixin|object|parallel|process|protected|pure|sealed|tailcall|trait|virtual|volatile)\b/,number:[/\b0x[\da-fA-F]+(?:un|lf|LF)?\b/,/\b0b[01]+(?:y|uy)?\b/,/(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[fm]|e[+-]?\d+)?\b/i,/\b\d+(?:[IlLsy]|u[lsy]?|UL)?\b/],operator:/([<>~&^])\1\1|([*.:<>&])\2|<-|->|[!=:]=|?|\??(?:<=|>=|<>|[-+*/%=<>])\??|[!?^&]|~[+~-]|:>|:\?>?/}),e.languages.insertBefore("fsharp","keyword",{preprocessor:{pattern:/(^[\t ]*)#.*/m,lookbehind:!0,alias:"property",inside:{directive:{pattern:/(^#)\b(?:else|endif|if|light|line|nowarn)\b/,lookbehind:!0,alias:"keyword"}}}}),e.languages.insertBefore("fsharp","punctuation",{"computation-expression":{pattern:/\b[_a-z]\w*(?=\s*\{)/i,alias:"keyword"}}),e.languages.insertBefore("fsharp","string",{annotation:{pattern:/\[<.+?>\]/,inside:{punctuation:/^\[<|>\]$/,"class-name":{pattern:/^\w+$|(^|;\s*)[A-Z]\w*(?=\()/,lookbehind:!0},"annotation-content":{pattern:/[\s\S]+/,inside:e.languages.fsharp}}}})}e.exports=t,t.displayName="fsharp",t.aliases=[]},82114(e,t,n){"use strict";var r=n(93205);function i(e){e.register(r),function(e){for(var t=/[^<()"']|\((?:)*\)|<(?!#--)|<#--(?:[^-]|-(?!->))*-->|"(?:[^\\"]|\\.)*"|'(?:[^\\']|\\.)*'/.source,n=0;n<2;n++)t=t.replace(//g,function(){return t});t=t.replace(//g,/[^\s\S]/.source);var r={comment:/<#--[\s\S]*?-->/,string:[{pattern:/\br("|')(?:(?!\1)[^\\]|\\.)*\1/,greedy:!0},{pattern:RegExp(/("|')(?:(?!\1|\$\{)[^\\]|\\.|\$\{(?:(?!\})(?:))*\})*\1/.source.replace(//g,function(){return t})),greedy:!0,inside:{interpolation:{pattern:RegExp(/((?:^|[^\\])(?:\\\\)*)\$\{(?:(?!\})(?:))*\}/.source.replace(//g,function(){return t})),lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:null}}}}],keyword:/\b(?:as)\b/,boolean:/\b(?:true|false)\b/,"builtin-function":{pattern:/((?:^|[^?])\?\s*)\w+/,lookbehind:!0,alias:"function"},function:/\b\w+(?=\s*\()/,number:/\b\d+(?:\.\d+)?\b/,operator:/\.\.[<*!]?|->|--|\+\+|&&|\|\||\?{1,2}|[-+*/%!=<>]=?|\b(?:gt|gte|lt|lte)\b/,punctuation:/[,;.:()[\]{}]/};r.string[1].inside.interpolation.inside.rest=r,e.languages.ftl={"ftl-comment":{pattern:/^<#--[\s\S]*/,alias:"comment"},"ftl-directive":{pattern:/^<[\s\S]+>$/,inside:{directive:{pattern:/(^<\/?)[#@][a-z]\w*/i,lookbehind:!0,alias:"keyword"},punctuation:/^<\/?|\/?>$/,content:{pattern:/\s*\S[\s\S]*/,alias:"ftl",inside:r}}},"ftl-interpolation":{pattern:/^\$\{[\s\S]*\}$/,inside:{punctuation:/^\$\{|\}$/,content:{pattern:/\s*\S[\s\S]*/,alias:"ftl",inside:r}}}},e.hooks.add("before-tokenize",function(n){var r=RegExp(/<#--[\s\S]*?-->|<\/?[#@][a-zA-Z](?:)*?>|\$\{(?:)*?\}/.source.replace(//g,function(){return t}),"gi");e.languages["markup-templating"].buildPlaceholders(n,"ftl",r)}),e.hooks.add("after-tokenize",function(t){e.languages["markup-templating"].tokenizePlaceholders(t,"ftl")})}(e)}e.exports=i,i.displayName="ftl",i.aliases=[]},12208(e){"use strict";function t(e){e.languages.gcode={comment:/;.*|\B\(.*?\)\B/,string:{pattern:/"(?:""|[^"])*"/,greedy:!0},keyword:/\b[GM]\d+(?:\.\d+)?\b/,property:/\b[A-Z]/,checksum:{pattern:/\*\d+/,alias:"punctuation"},punctuation:/:/}}e.exports=t,t.displayName="gcode",t.aliases=[]},62728(e){"use strict";function t(e){e.languages.gdscript={comment:/#.*/,string:{pattern:/@?(?:("|')(?:(?!\1)[^\n\\]|\\[\s\S])*\1(?!"|')|"""(?:[^\\]|\\[\s\S])*?""")/,greedy:!0},"class-name":{pattern:/(^(?:class_name|class|extends)[ \t]+|^export\([ \t]*|\bas[ \t]+|(?:\b(?:const|var)[ \t]|[,(])[ \t]*\w+[ \t]*:[ \t]*|->[ \t]*)[a-zA-Z_]\w*/m,lookbehind:!0},keyword:/\b(?:and|as|assert|break|breakpoint|class|class_name|const|continue|elif|else|enum|export|extends|for|func|if|in|is|master|mastersync|match|not|null|onready|or|pass|preload|puppet|puppetsync|remote|remotesync|return|self|setget|signal|static|tool|var|while|yield)\b/,function:/\b[a-z_]\w*(?=[ \t]*\()/i,variable:/\$\w+/,number:[/\b0b[01_]+\b|\b0x[\da-fA-F_]+\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.[\d_]+)(?:e[+-]?[\d_]+)?\b/,/\b(?:INF|NAN|PI|TAU)\b/],constant:/\b[A-Z][A-Z_\d]*\b/,boolean:/\b(?:false|true)\b/,operator:/->|:=|&&|\|\||<<|>>|[-+*/%&|!<>=]=?|[~^]/,punctuation:/[.:,;()[\]{}]/}}e.exports=t,t.displayName="gdscript",t.aliases=[]},81549(e){"use strict";function t(e){e.languages.gedcom={"line-value":{pattern:/(^[\t ]*\d+ +(?:@\w[\w!"$%&'()*+,\-./:;<=>?[\\\]^`{|}~\x80-\xfe #]*@ +)?\w+ ).+/m,lookbehind:!0,inside:{pointer:{pattern:/^@\w[\w!"$%&'()*+,\-./:;<=>?[\\\]^`{|}~\x80-\xfe #]*@$/,alias:"variable"}}},tag:{pattern:/(^[\t ]*\d+ +(?:@\w[\w!"$%&'()*+,\-./:;<=>?[\\\]^`{|}~\x80-\xfe #]*@ +)?)\w+/m,lookbehind:!0,alias:"string"},level:{pattern:/(^[\t ]*)\d+/m,lookbehind:!0,alias:"number"},pointer:{pattern:/@\w[\w!"$%&'()*+,\-./:;<=>?[\\\]^`{|}~\x80-\xfe #]*@/,alias:"variable"}}}e.exports=t,t.displayName="gedcom",t.aliases=[]},6024(e){"use strict";function t(e){var t,n;n=/(?:\r?\n|\r)[ \t]*\|.+\|(?:(?!\|).)*/.source,(t=e).languages.gherkin={pystring:{pattern:/("""|''')[\s\S]+?\1/,alias:"string"},comment:{pattern:/(^[ \t]*)#.*/m,lookbehind:!0},tag:{pattern:/(^[ \t]*)@\S*/m,lookbehind:!0},feature:{pattern:/((?:^|\r?\n|\r)[ \t]*)(?:Ability|Ahoy matey!|Arwedd|Aspekt|Besigheid Behoefte|Business Need|Caracteristica|Característica|Egenskab|Egenskap|Eiginleiki|Feature|Fīča|Fitur|Fonctionnalité|Fonksyonalite|Funcionalidade|Funcionalitat|Functionalitate|Funcţionalitate|Funcționalitate|Functionaliteit|Fungsi|Funkcia|Funkcija|Funkcionalitāte|Funkcionalnost|Funkcja|Funksie|Funktionalität|Funktionalitéit|Funzionalità|Hwaet|Hwæt|Jellemző|Karakteristik|laH|Lastnost|Mak|Mogucnost|Mogućnost|Moznosti|Možnosti|OH HAI|Omadus|Ominaisuus|Osobina|Özellik|perbogh|poQbogh malja'|Potrzeba biznesowa|Požadavek|Požiadavka|Pretty much|Qap|Qu'meH 'ut|Savybė|Tính năng|Trajto|Vermoë|Vlastnosť|Właściwość|Značilnost|Δυνατότητα|Λειτουργία|Могућност|Мөмкинлек|Особина|Свойство|Үзенчәлеклелек|Функционал|Функционалност|Функция|Функціонал|תכונה|خاصية|خصوصیت|صلاحیت|کاروبار کی ضرورت|وِیژگی|रूप लेख|ਖਾਸੀਅਤ|ਨਕਸ਼ ਨੁਹਾਰ|ਮੁਹਾਂਦਰਾ|గుణము|ಹೆಚ್ಚಳ|ความต้องการทางธุรกิจ|ความสามารถ|โครงหลัก|기능|フィーチャ|功能|機能):(?:[^:\r\n]+(?:\r?\n|\r|$))*/,lookbehind:!0,inside:{important:{pattern:/(:)[^\r\n]+/,lookbehind:!0},keyword:/[^:\r\n]+:/}},scenario:{pattern:/(^[ \t]*)(?:Abstract Scenario|Abstrakt Scenario|Achtergrond|Aer|Ær|Agtergrond|All y'all|Antecedentes|Antecedents|Atburðarás|Atburðarásir|Awww, look mate|B4|Background|Baggrund|Bakgrund|Bakgrunn|Bakgrunnur|Beispiele|Beispiller|Bối cảnh|Cefndir|Cenario|Cenário|Cenario de Fundo|Cenário de Fundo|Cenarios|Cenários|Contesto|Context|Contexte|Contexto|Conto|Contoh|Contone|Dæmi|Dasar|Dead men tell no tales|Delineacao do Cenario|Delineação do Cenário|Dis is what went down|Dữ liệu|Dyagram senaryo|Dyagram Senaryo|Egzanp|Ejemplos|Eksempler|Ekzemploj|Enghreifftiau|Esbozo do escenario|Escenari|Escenario|Esempi|Esquema de l'escenari|Esquema del escenario|Esquema do Cenario|Esquema do Cenário|Examples|EXAMPLZ|Exempel|Exemple|Exemples|Exemplos|First off|Fono|Forgatókönyv|Forgatókönyv vázlat|Fundo|Geçmiş|ghantoH|Grundlage|Hannergrond|Háttér|Heave to|Istorik|Juhtumid|Keadaan|Khung kịch bản|Khung tình huống|Kịch bản|Koncept|Konsep skenario|Kontèks|Kontekst|Kontekstas|Konteksts|Kontext|Konturo de la scenaro|Latar Belakang|lut|lut chovnatlh|lutmey|Lýsing Atburðarásar|Lýsing Dæma|Menggariskan Senario|MISHUN|MISHUN SRSLY|mo'|Náčrt Scenára|Náčrt Scénáře|Náčrt Scenáru|Oris scenarija|Örnekler|Osnova|Osnova Scenára|Osnova scénáře|Osnutek|Ozadje|Paraugs|Pavyzdžiai|Példák|Piemēri|Plan du scénario|Plan du Scénario|Plan senaryo|Plan Senaryo|Plang vum Szenario|Pozadí|Pozadie|Pozadina|Príklady|Příklady|Primer|Primeri|Primjeri|Przykłady|Raamstsenaarium|Reckon it's like|Rerefons|Scenár|Scénář|Scenarie|Scenarij|Scenarijai|Scenarijaus šablonas|Scenariji|Scenārijs|Scenārijs pēc parauga|Scenarijus|Scenario|Scénario|Scenario Amlinellol|Scenario Outline|Scenario Template|Scenariomal|Scenariomall|Scenarios|Scenariu|Scenariusz|Scenaro|Schema dello scenario|Se ðe|Se the|Se þe|Senario|Senaryo|Senaryo deskripsyon|Senaryo Deskripsyon|Senaryo taslağı|Shiver me timbers|Situācija|Situai|Situasie|Situasie Uiteensetting|Skenario|Skenario konsep|Skica|Structura scenariu|Structură scenariu|Struktura scenarija|Stsenaarium|Swa|Swa hwaer swa|Swa hwær swa|Szablon scenariusza|Szenario|Szenariogrundriss|Tapaukset|Tapaus|Tapausaihio|Taust|Tausta|Template Keadaan|Template Senario|Template Situai|The thing of it is|Tình huống|Variantai|Voorbeelde|Voorbeelden|Wharrimean is|Yo-ho-ho|You'll wanna|Założenia|Παραδείγματα|Περιγραφή Σεναρίου|Σενάρια|Σενάριο|Υπόβαθρο|Кереш|Контекст|Концепт|Мисаллар|Мисоллар|Основа|Передумова|Позадина|Предистория|Предыстория|Приклади|Пример|Примери|Примеры|Рамка на сценарий|Скица|Структура сценарија|Структура сценария|Структура сценарію|Сценарий|Сценарий структураси|Сценарийның төзелеше|Сценарији|Сценарио|Сценарій|Тарих|Үрнәкләр|דוגמאות|רקע|תבנית תרחיש|תרחיש|الخلفية|الگوی سناریو|امثلة|پس منظر|زمینه|سناریو|سيناريو|سيناريو مخطط|مثالیں|منظر نامے کا خاکہ|منظرنامہ|نمونه ها|उदाहरण|परिदृश्य|परिदृश्य रूपरेखा|पृष्ठभूमि|ਉਦਾਹਰਨਾਂ|ਪਟਕਥਾ|ਪਟਕਥਾ ਢਾਂਚਾ|ਪਟਕਥਾ ਰੂਪ ਰੇਖਾ|ਪਿਛੋਕੜ|ఉదాహరణలు|కథనం|నేపథ్యం|సన్నివేశం|ಉದಾಹರಣೆಗಳು|ಕಥಾಸಾರಾಂಶ|ವಿವರಣೆ|ಹಿನ್ನೆಲೆ|โครงสร้างของเหตุการณ์|ชุดของตัวอย่าง|ชุดของเหตุการณ์|แนวคิด|สรุปเหตุการณ์|เหตุการณ์|배경|시나리오|시나리오 개요|예|サンプル|シナリオ|シナリオアウトライン|シナリオテンプレ|シナリオテンプレート|テンプレ|例|例子|剧本|剧本大纲|劇本|劇本大綱|场景|场景大纲|場景|場景大綱|背景):[^:\r\n]*/m,lookbehind:!0,inside:{important:{pattern:/(:)[^\r\n]*/,lookbehind:!0},keyword:/[^:\r\n]+:/}},"table-body":{pattern:RegExp("("+n+")(?:"+n+")+"),lookbehind:!0,inside:{outline:{pattern:/<[^>]+>/,alias:"variable"},td:{pattern:/\s*[^\s|][^|]*/,alias:"string"},punctuation:/\|/}},"table-head":{pattern:RegExp(n),inside:{th:{pattern:/\s*[^\s|][^|]*/,alias:"variable"},punctuation:/\|/}},atrule:{pattern:/(^[ \t]+)(?:'ach|'a|'ej|7|a|A také|A taktiež|A tiež|A zároveň|Aber|Ac|Adott|Akkor|Ak|Aleshores|Ale|Ali|Allora|Alors|Als|Ama|Amennyiben|Amikor|Ampak|an|AN|Ananging|And y'all|And|Angenommen|Anrhegedig a|An|Apabila|Atès|Atesa|Atunci|Avast!|Aye|A|awer|Bagi|Banjur|Bet|Biết|Blimey!|Buh|But at the end of the day I reckon|But y'all|But|BUT|Cal|Când|Cando|Cand|Ce|Cuando|Če|Ða ðe|Ða|Dadas|Dada|Dados|Dado|DaH ghu' bejlu'|dann|Dann|Dano|Dan|Dar|Dat fiind|Data|Date fiind|Date|Dati fiind|Dati|Daţi fiind|Dați fiind|Dato|DEN|Den youse gotta|Dengan|De|Diberi|Diyelim ki|Donada|Donat|Donitaĵo|Do|Dun|Duota|Ðurh|Eeldades|Ef|Eğer ki|Entao|Então|Entón|Entonces|En|Epi|E|És|Etant donnée|Etant donné|Et|Étant données|Étant donnée|Étant donné|Etant données|Etant donnés|Étant donnés|Fakat|Gangway!|Gdy|Gegeben seien|Gegeben sei|Gegeven|Gegewe|ghu' noblu'|Gitt|Given y'all|Given|Givet|Givun|Ha|Cho|I CAN HAZ|In|Ir|It's just unbelievable|I|Ja|Jeśli|Jeżeli|Kadar|Kada|Kad|Kai|Kaj|Když|Keď|Kemudian|Ketika|Khi|Kiedy|Ko|Kuid|Kui|Kun|Lan|latlh|Le sa a|Let go and haul|Le|Lè sa a|Lè|Logo|Lorsqu'<|Lorsque|mä|Maar|Mais|Mając|Majd|Maka|Manawa|Mas|Ma|Menawa|Men|Mutta|Nalikaning|Nalika|Nanging|Når|När|Nato|Nhưng|Niin|Njuk|O zaman|Og|Och|Oletetaan|Onda|Ond|Oraz|Pak|Pero|Però|Podano|Pokiaľ|Pokud|Potem|Potom|Privzeto|Pryd|qaSDI'|Quando|Quand|Quan|Så|Sed|Se|Siis|Sipoze ke|Sipoze Ke|Sipoze|Si|Şi|Și|Soit|Stel|Tada|Tad|Takrat|Tak|Tapi|Ter|Tetapi|Tha the|Tha|Then y'all|Then|Thì|Thurh|Toda|Too right|ugeholl|Und|Un|Và|vaj|Vendar|Ve|wann|Wanneer|WEN|Wenn|When y'all|When|Wtedy|Wun|Y'know|Yeah nah|Yna|Youse know like when|Youse know when youse got|Y|Za predpokladu|Za předpokladu|Zadani|Zadano|Zadan|Zadate|Zadato|Zakładając|Zaradi|Zatati|Þa þe|Þa|Þá|Þegar|Þurh|Αλλά|Δεδομένου|Και|Όταν|Τότε|А також|Агар|Але|Али|Аммо|А|Әгәр|Әйтик|Әмма|Бирок|Ва|Вә|Дадено|Дано|Допустим|Если|Задате|Задати|Задато|И|І|К тому же|Када|Кад|Когато|Когда|Коли|Ләкин|Лекин|Нәтиҗәдә|Нехай|Но|Онда|Припустимо, що|Припустимо|Пусть|Также|Та|Тогда|Тоді|То|Унда|Һәм|Якщо|אבל|אזי|אז|בהינתן|וגם|כאשר|آنگاه|اذاً|اگر|اما|اور|با فرض|بالفرض|بفرض|پھر|تب|ثم|جب|عندما|فرض کیا|لكن|لیکن|متى|هنگامی|و|अगर|और|कदा|किन्तु|चूंकि|जब|तथा|तदा|तब|परन्तु|पर|यदि|ਅਤੇ|ਜਦੋਂ|ਜਿਵੇਂ ਕਿ|ਜੇਕਰ|ਤਦ|ਪਰ|అప్పుడు|ఈ పరిస్థితిలో|కాని|చెప్పబడినది|మరియు|ಆದರೆ|ನಂತರ|ನೀಡಿದ|ಮತ್ತು|ಸ್ಥಿತಿಯನ್ನು|กำหนดให้|ดังนั้น|แต่|เมื่อ|และ|그러면<|그리고<|단<|만약<|만일<|먼저<|조건<|하지만<|かつ<|しかし<|ただし<|ならば<|もし<|並且<|但し<|但是<|假如<|假定<|假設<|假设<|前提<|同时<|同時<|并且<|当<|當<|而且<|那么<|那麼<)(?=[ \t])/m,lookbehind:!0},string:{pattern:/"(?:\\.|[^"\\\r\n])*"|'(?:\\.|[^'\\\r\n])*'/,inside:{outline:{pattern:/<[^>]+>/,alias:"variable"}}},outline:{pattern:/<[^>]+>/,alias:"variable"}}}e.exports=t,t.displayName="gherkin",t.aliases=[]},13600(e){"use strict";function t(e){e.languages.git={comment:/^#.*/m,deleted:/^[-–].*/m,inserted:/^\+.*/m,string:/("|')(?:\\.|(?!\1)[^\\\r\n])*\1/m,command:{pattern:/^.*\$ git .*$/m,inside:{parameter:/\s--?\w+/m}},coord:/^@@.*@@$/m,"commit-sha1":/^commit \w{40}$/m}}e.exports=t,t.displayName="git",t.aliases=[]},3322(e,t,n){"use strict";var r=n(65806);function i(e){e.register(r),e.languages.glsl=e.languages.extend("c",{keyword:/\b(?:attribute|const|uniform|varying|buffer|shared|coherent|volatile|restrict|readonly|writeonly|atomic_uint|layout|centroid|flat|smooth|noperspective|patch|sample|break|continue|do|for|while|switch|case|default|if|else|subroutine|in|out|inout|float|double|int|void|bool|true|false|invariant|precise|discard|return|d?mat[234](?:x[234])?|[ibdu]?vec[234]|uint|lowp|mediump|highp|precision|[iu]?sampler[123]D|[iu]?samplerCube|sampler[12]DShadow|samplerCubeShadow|[iu]?sampler[12]DArray|sampler[12]DArrayShadow|[iu]?sampler2DRect|sampler2DRectShadow|[iu]?samplerBuffer|[iu]?sampler2DMS(?:Array)?|[iu]?samplerCubeArray|samplerCubeArrayShadow|[iu]?image[123]D|[iu]?image2DRect|[iu]?imageCube|[iu]?imageBuffer|[iu]?image[12]DArray|[iu]?imageCubeArray|[iu]?image2DMS(?:Array)?|struct|common|partition|active|asm|class|union|enum|typedef|template|this|resource|goto|inline|noinline|public|static|extern|external|interface|long|short|half|fixed|unsigned|superp|input|output|hvec[234]|fvec[234]|sampler3DRect|filter|sizeof|cast|namespace|using)\b/})}e.exports=i,i.displayName="glsl",i.aliases=[]},53877(e){"use strict";function t(e){e.languages.gamemakerlanguage=e.languages.gml=e.languages.extend("clike",{keyword:/\b(?:if|else|switch|case|default|break|for|repeat|while|do|until|continue|exit|return|globalvar|var|enum)\b/,number:/(?:\b0x[\da-f]+|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ulf]{0,4}/i,operator:/[-+%=]=?|!=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]|\b(?:or|and|not|with|at|xor)\b/,constant:/\b(?:self|other|all|noone|global|local|undefined|pointer_(?:invalid|null)|action_(?:stop|restart|continue|reverse)|pi|GM_build_date|GM_version|timezone_(?:local|utc)|gamespeed_(?:fps|microseconds)|ev_(?:create|destroy|step|alarm|keyboard|mouse|collision|other|draw|draw_(?:begin|end|pre|post)|keypress|keyrelease|trigger|(?:left|right|middle|no)_button|(?:left|right|middle)_press|(?:left|right|middle)_release|mouse_(?:enter|leave|wheel_up|wheel_down)|global_(?:left|right|middle)_button|global_(?:left|right|middle)_press|global_(?:left|right|middle)_release|joystick(?:1|2)_(?:left|right|up|down|button1|button2|button3|button4|button5|button6|button7|button8)|outside|boundary|game_start|game_end|room_start|room_end|no_more_lives|animation_end|end_of_path|no_more_health|user\d|step_(?:normal|begin|end)|gui|gui_begin|gui_end)|vk_(?:nokey|anykey|enter|return|shift|control|alt|escape|space|backspace|tab|pause|printscreen|left|right|up|down|home|end|delete|insert|pageup|pagedown|f\d|numpad\d|divide|multiply|subtract|add|decimal|lshift|lcontrol|lalt|rshift|rcontrol|ralt)|mb_(?:any|none|left|right|middle)|c_(?:aqua|black|blue|dkgray|fuchsia|gray|green|lime|ltgray|maroon|navy|olive|purple|red|silver|teal|white|yellow|orange)|fa_(?:left|center|right|top|middle|bottom|readonly|hidden|sysfile|volumeid|directory|archive)|pr_(?:pointlist|linelist|linestrip|trianglelist|trianglestrip|trianglefan)|bm_(?:complex|normal|add|max|subtract|zero|one|src_colour|inv_src_colour|src_color|inv_src_color|src_alpha|inv_src_alpha|dest_alpha|inv_dest_alpha|dest_colour|inv_dest_colour|dest_color|inv_dest_color|src_alpha_sat)|audio_(?:falloff_(?:none|inverse_distance|inverse_distance_clamped|linear_distance|linear_distance_clamped|exponent_distance|exponent_distance_clamped)|old_system|new_system|mono|stereo|3d)|cr_(?:default|none|arrow|cross|beam|size_nesw|size_ns|size_nwse|size_we|uparrow|hourglass|drag|appstart|handpoint|size_all)|asset_(?:object|unknown|sprite|sound|room|path|script|font|timeline|tiles|shader)|ds_type_(?:map|list|stack|queue|grid|priority)|ef_(?:explosion|ring|ellipse|firework|smoke|smokeup|star|spark|flare|cloud|rain|snow)|pt_shape_(?:pixel|disk|square|line|star|circle|ring|sphere|flare|spark|explosion|cloud|smoke|snow)|ps_(?:distr|shape)_(?:linear|gaussian|invgaussian|rectangle|ellipse|diamond|line)|ty_(?:real|string)|dll_(?:cdel|cdecl|stdcall)|matrix_(?:view|projection|world)|os_(?:win32|windows|macosx|ios|android|linux|unknown|winphone|win8native|psvita|ps4|xboxone|ps3|uwp)|browser_(?:not_a_browser|unknown|ie|firefox|chrome|safari|safari_mobile|opera|tizen|windows_store|ie_mobile)|device_ios_(?:unknown|iphone|iphone_retina|ipad|ipad_retina|iphone5|iphone6|iphone6plus)|device_(?:emulator|tablet)|display_(?:landscape|landscape_flipped|portrait|portrait_flipped)|of_challenge_(?:win|lose|tie)|leaderboard_type_(?:number|time_mins_secs)|cmpfunc_(?:never|less|equal|lessequal|greater|notequal|greaterequal|always)|cull_(?:noculling|clockwise|counterclockwise)|lighttype_(?:dir|point)|iap_(?:ev_storeload|ev_product|ev_purchase|ev_consume|ev_restore|storeload_ok|storeload_failed|status_uninitialised|status_unavailable|status_loading|status_available|status_processing|status_restoring|failed|unavailable|available|purchased|canceled|refunded)|fb_login_(?:default|fallback_to_webview|no_fallback_to_webview|forcing_webview|use_system_account|forcing_safari)|phy_joint_(?:anchor_1_x|anchor_1_y|anchor_2_x|anchor_2_y|reaction_force_x|reaction_force_y|reaction_torque|motor_speed|angle|motor_torque|max_motor_torque|translation|speed|motor_force|max_motor_force|length_1|length_2|damping_ratio|frequency|lower_angle_limit|upper_angle_limit|angle_limits|max_length|max_torque|max_force)|phy_debug_render_(?:aabb|collision_pairs|coms|core_shapes|joints|obb|shapes)|phy_particle_flag_(?:water|zombie|wall|spring|elastic|viscous|powder|tensile|colourmixing|colormixing)|phy_particle_group_flag_(?:solid|rigid)|phy_particle_data_flag_(?:typeflags|position|velocity|colour|color|category)|achievement_(?:our_info|friends_info|leaderboard_info|info|filter_(?:all_players|friends_only|favorites_only)|type_challenge|type_score_challenge|pic_loaded|show_(?:ui|profile|leaderboard|achievement|bank|friend_picker|purchase_prompt))|network_(?:socket_(?:tcp|udp|bluetooth)|type_(?:connect|disconnect|data|non_blocking_connect)|config_(?:connect_timeout|use_non_blocking_socket|enable_reliable_udp|disable_reliable_udp))|buffer_(?:fixed|grow|wrap|fast|vbuffer|network|u8|s8|u16|s16|u32|s32|u64|f16|f32|f64|bool|text|string|seek_start|seek_relative|seek_end|generalerror|outofspace|outofbounds|invalidtype)|gp_(?:face\d|shoulderl|shoulderr|shoulderlb|shoulderrb|select|start|stickl|stickr|padu|padd|padl|padr|axislh|axislv|axisrh|axisrv)|ov_(?:friends|community|players|settings|gamegroup|achievements)|lb_sort_(?:none|ascending|descending)|lb_disp_(?:none|numeric|time_sec|time_ms)|ugc_(?:result_success|filetype_(?:community|microtrans)|visibility_(?:public|friends_only|private)|query_RankedBy(?:Vote|PublicationDate|Trend|NumTimesReported|TotalVotesAsc|VotesUp|TextSearch)|query_(?:AcceptedForGameRankedByAcceptanceDate|FavoritedByFriendsRankedByPublicationDate|CreatedByFriendsRankedByPublicationDate|NotYetRated)|sortorder_CreationOrder(?:Desc|Asc)|sortorder_(?:TitleAsc|LastUpdatedDesc|SubscriptionDateDesc|VoteScoreDesc|ForModeration)|list_(?:Published|VotedOn|VotedUp|VotedDown|WillVoteLater|Favorited|Subscribed|UsedOrPlayed|Followed)|match_(?:Items|Items_Mtx|Items_ReadyToUse|Collections|Artwork|Videos|Screenshots|AllGuides|WebGuides|IntegratedGuides|UsableInGame|ControllerBindings))|vertex_usage_(?:position|colour|color|normal|texcoord|textcoord|blendweight|blendindices|psize|tangent|binormal|fog|depth|sample)|vertex_type_(?:float\d|colour|color|ubyte4)|layerelementtype_(?:undefined|background|instance|oldtilemap|sprite|tilemap|particlesystem|tile)|tile_(?:rotate|flip|mirror|index_mask)|input_type|se_(?:chorus|compressor|echo|equalizer|flanger|gargle|none|reverb)|text_type|(?:obj|scr|spr|rm)\w+)\b/,variable:/\b(?:x|y|(?:x|y)(?:previous|start)|(?:h|v)speed|direction|speed|friction|gravity|gravity_direction|path_(?:index|position|positionprevious|speed|scale|orientation|endaction)|object_index|id|solid|persistent|mask_index|instance_(?:count|id)|alarm|timeline_(?:index|position|speed|running|loop)|visible|sprite_(?:index|width|height|xoffset|yoffset)|image_(?:number|index|speed|depth|xscale|yscale|angle|alpha|blend)|bbox_(?:left|right|top|bottom)|layer|phy_(?:rotation|(?:position|linear_velocity|speed|com|collision|col_normal)_(?:x|y)|angular_(?:velocity|damping)|position_(?:x|y)previous|speed|linear_damping|bullet|fixed_rotation|active|mass|inertia|dynamic|kinematic|sleeping|collision_points)|working_directory|webgl_enabled|view_(?:(?:y|x|w|h)view|(?:y|x|w|h)port|(?:v|h)(?:speed|border)|visible|surface_id|object|enabled|current|angle)|undefined|transition_(?:steps|kind|color)|temp_directory|show_(?:score|lives|health)|secure_mode|score|room_(?:width|speed|persistent|last|height|first|caption)|room|pointer_(?:null|invalid)|os_(?:version|type|device|browser)|mouse_(?:y|x|lastbutton|button)|lives|keyboard_(?:string|lastkey|lastchar|key)|iap_data|health|gamemaker_(?:version|registered|pro)|game_(?:save|project|display)_(?:id|name)|fps_real|fps|event_(?:type|object|number|action)|error_(?:occurred|last)|display_aa|delta_time|debug_mode|cursor_sprite|current_(?:year|weekday|time|second|month|minute|hour|day)|caption_(?:score|lives|health)|browser_(?:width|height)|background_(?:yscale|y|xscale|x|width|vtiled|vspeed|visible|showcolour|showcolor|index|htiled|hspeed|height|foreground|colour|color|blend|alpha)|async_load|application_surface|argument(?:_relitive|_count|\d)|argument|global|local|self|other)\b/})}e.exports=t,t.displayName="gml",t.aliases=[]},51519(e){"use strict";function t(e){e.languages.go=e.languages.extend("clike",{string:{pattern:/(["'`])(?:\\[\s\S]|(?!\1)[^\\])*\1/,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|iota|nil|true|false)\b/,number:/(?:\b0x[a-f\d]+|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[-+]?\d+)?)i?/i,operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:bool|byte|complex(?:64|128)|error|float(?:32|64)|rune|string|u?int(?:8|16|32|64)?|uintptr|append|cap|close|complex|copy|delete|imag|len|make|new|panic|print(?:ln)?|real|recover)\b/}),delete e.languages.go["class-name"]}e.exports=t,t.displayName="go",t.aliases=[]},94055(e){"use strict";function t(e){e.languages.graphql={comment:/#.*/,description:{pattern:/(?:"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*")(?=\s*[a-z_])/i,greedy:!0,alias:"string",inside:{"language-markdown":{pattern:/(^"(?:"")?)(?!\1)[\s\S]+(?=\1$)/,lookbehind:!0,inside:e.languages.markdown}}},string:{pattern:/"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*"/,greedy:!0},number:/(?:\B-|\b)\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,boolean:/\b(?:true|false)\b/,variable:/\$[a-z_]\w*/i,directive:{pattern:/@[a-z_]\w*/i,alias:"function"},"attr-name":{pattern:/[a-z_]\w*(?=\s*(?:\((?:[^()"]|"(?:\\.|[^\\"\r\n])*")*\))?:)/i,greedy:!0},"atom-input":{pattern:/[A-Z]\w*Input(?=!?.*$)/m,alias:"class-name"},scalar:/\b(?:Boolean|Float|ID|Int|String)\b/,constant:/\b[A-Z][A-Z_\d]*\b/,"class-name":{pattern:/(\b(?:enum|implements|interface|on|scalar|type|union)\s+|&\s*|:\s*|\[)[A-Z_]\w*/,lookbehind:!0},fragment:{pattern:/(\bfragment\s+|\.{3}\s*(?!on\b))[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},"definition-mutation":{pattern:/(\bmutation\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},"definition-query":{pattern:/(\bquery\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},keyword:/\b(?:directive|enum|extend|fragment|implements|input|interface|mutation|on|query|repeatable|scalar|schema|subscription|type|union)\b/,operator:/[!=|&]|\.{3}/,"property-query":/\w+(?=\s*\()/,object:/\w+(?=\s*\{)/,punctuation:/[!(){}\[\]:=,]/,property:/\w+/},e.hooks.add("after-tokenize",function(e){if("graphql"===e.language){for(var t=e.tokens.filter(function(e){return"string"!=typeof e&&"comment"!==e.type&&"scalar"!==e.type}),n=0;n0)){var s=d(/^\{$/,/^\}$/);if(-1===s)continue;for(var u=n;u=0&&h(c,"variable-input")}}}}}function l(e){return t[n+e]}function f(e,t){t=t||0;for(var n=0;n]?|\+[+=]?|!=?|<(?:<=?|=>?)?|>(?:>>?=?|=)?|&[&=]?|\|[|=]?|\/=?|\^=?|%=?)/,lookbehind:!0},punctuation:/\.+|[{}[\];(),:$]/}),e.languages.insertBefore("groovy","string",{shebang:{pattern:/#!.+/,alias:"comment"}}),e.languages.insertBefore("groovy","punctuation",{"spock-block":/\b(?:setup|given|when|then|and|cleanup|expect|where):/}),e.languages.insertBefore("groovy","function",{annotation:{pattern:/(^|[^.])@\w+/,lookbehind:!0,alias:"punctuation"}}),e.hooks.add("wrap",function(t){if("groovy"===t.language&&"string"===t.type){var n=t.content.value[0];if("'"!=n){var r=/([^\\])(?:\$(?:\{.*?\}|[\w.]+))/;"$"===n&&(r=/([^\$])(?:\$(?:\{.*?\}|[\w.]+))/),t.content.value=t.content.value.replace(/</g,"<").replace(/&/g,"&"),t.content=e.highlight(t.content.value,{expression:{pattern:r,lookbehind:!0,inside:e.languages.groovy}}),t.classes.push("/"===n?"regex":"gstring")}}})}e.exports=t,t.displayName="groovy",t.aliases=[]},29536(e,t,n){"use strict";var r=n(56939);function i(e){e.register(r),function(e){e.languages.haml={"multiline-comment":{pattern:/((?:^|\r?\n|\r)([\t ]*))(?:\/|-#).*(?:(?:\r?\n|\r)\2[\t ].+)*/,lookbehind:!0,alias:"comment"},"multiline-code":[{pattern:/((?:^|\r?\n|\r)([\t ]*)(?:[~-]|[&!]?=)).*,[\t ]*(?:(?:\r?\n|\r)\2[\t ].*,[\t ]*)*(?:(?:\r?\n|\r)\2[\t ].+)/,lookbehind:!0,inside:e.languages.ruby},{pattern:/((?:^|\r?\n|\r)([\t ]*)(?:[~-]|[&!]?=)).*\|[\t ]*(?:(?:\r?\n|\r)\2[\t ].*\|[\t ]*)*/,lookbehind:!0,inside:e.languages.ruby}],filter:{pattern:/((?:^|\r?\n|\r)([\t ]*)):[\w-]+(?:(?:\r?\n|\r)(?:\2[\t ].+|\s*?(?=\r?\n|\r)))+/,lookbehind:!0,inside:{"filter-name":{pattern:/^:[\w-]+/,alias:"variable"}}},markup:{pattern:/((?:^|\r?\n|\r)[\t ]*)<.+/,lookbehind:!0,inside:e.languages.markup},doctype:{pattern:/((?:^|\r?\n|\r)[\t ]*)!!!(?: .+)?/,lookbehind:!0},tag:{pattern:/((?:^|\r?\n|\r)[\t ]*)[%.#][\w\-#.]*[\w\-](?:\([^)]+\)|\{(?:\{[^}]+\}|[^{}])+\}|\[[^\]]+\])*[\/<>]*/,lookbehind:!0,inside:{attributes:[{pattern:/(^|[^#])\{(?:\{[^}]+\}|[^{}])+\}/,lookbehind:!0,inside:e.languages.ruby},{pattern:/\([^)]+\)/,inside:{"attr-value":{pattern:/(=\s*)(?:"(?:\\.|[^\\"\r\n])*"|[^)\s]+)/,lookbehind:!0},"attr-name":/[\w:-]+(?=\s*!?=|\s*[,)])/,punctuation:/[=(),]/}},{pattern:/\[[^\]]+\]/,inside:e.languages.ruby}],punctuation:/[<>]/}},code:{pattern:/((?:^|\r?\n|\r)[\t ]*(?:[~-]|[&!]?=)).+/,lookbehind:!0,inside:e.languages.ruby},interpolation:{pattern:/#\{[^}]+\}/,inside:{delimiter:{pattern:/^#\{|\}$/,alias:"punctuation"},rest:e.languages.ruby}},punctuation:{pattern:/((?:^|\r?\n|\r)[\t ]*)[~=\-&!]+/,lookbehind:!0}};for(var t="((?:^|\\r?\\n|\\r)([\\t ]*)):{{filter_name}}(?:(?:\\r?\\n|\\r)(?:\\2[\\t ].+|\\s*?(?=\\r?\\n|\\r)))+",n=["css",{filter:"coffee",language:"coffeescript"},"erb","javascript","less","markdown","ruby","scss","textile"],r={},i=0,a=n.length;i@\[\\\]^`{|}~]/,variable:/[^!"#%&'()*+,\/;<=>@\[\\\]^`{|}~\s]+/},t.hooks.add("before-tokenize",function(e){var n=/\{\{\{[\s\S]+?\}\}\}|\{\{[\s\S]+?\}\}/g;t.languages["markup-templating"].buildPlaceholders(e,"handlebars",n)}),t.hooks.add("after-tokenize",function(e){t.languages["markup-templating"].tokenizePlaceholders(e,"handlebars")}),t.languages.hbs=t.languages.handlebars}e.exports=i,i.displayName="handlebars",i.aliases=["hbs"]},58090(e){"use strict";function t(e){e.languages.haskell={comment:{pattern:/(^|[^-!#$%*+=?&@|~.:<>^\\\/])(?:--(?:(?=.)[^-!#$%*+=?&@|~.:<>^\\\/].*|$)|\{-[\s\S]*?-\})/m,lookbehind:!0},char:{pattern:/'(?:[^\\']|\\(?:[abfnrtv\\"'&]|\^[A-Z@[\]^_]|NUL|SOH|STX|ETX|EOT|ENQ|ACK|BEL|BS|HT|LF|VT|FF|CR|SO|SI|DLE|DC1|DC2|DC3|DC4|NAK|SYN|ETB|CAN|EM|SUB|ESC|FS|GS|RS|US|SP|DEL|\d+|o[0-7]+|x[0-9a-fA-F]+))'/,alias:"string"},string:{pattern:/"(?:[^\\"]|\\(?:\S|\s+\\))*"/,greedy:!0},keyword:/\b(?:case|class|data|deriving|do|else|if|in|infixl|infixr|instance|let|module|newtype|of|primitive|then|type|where)\b/,"import-statement":{pattern:/(^[\t ]*)import\s+(?:qualified\s+)?(?:[A-Z][\w']*)(?:\.[A-Z][\w']*)*(?:\s+as\s+(?:[A-Z][\w']*)(?:\.[A-Z][\w']*)*)?(?:\s+hiding\b)?/m,lookbehind:!0,inside:{keyword:/\b(?:import|qualified|as|hiding)\b/}},builtin:/\b(?:abs|acos|acosh|all|and|any|appendFile|approxRational|asTypeOf|asin|asinh|atan|atan2|atanh|basicIORun|break|catch|ceiling|chr|compare|concat|concatMap|const|cos|cosh|curry|cycle|decodeFloat|denominator|digitToInt|div|divMod|drop|dropWhile|either|elem|encodeFloat|enumFrom|enumFromThen|enumFromThenTo|enumFromTo|error|even|exp|exponent|fail|filter|flip|floatDigits|floatRadix|floatRange|floor|fmap|foldl|foldl1|foldr|foldr1|fromDouble|fromEnum|fromInt|fromInteger|fromIntegral|fromRational|fst|gcd|getChar|getContents|getLine|group|head|id|inRange|index|init|intToDigit|interact|ioError|isAlpha|isAlphaNum|isAscii|isControl|isDenormalized|isDigit|isHexDigit|isIEEE|isInfinite|isLower|isNaN|isNegativeZero|isOctDigit|isPrint|isSpace|isUpper|iterate|last|lcm|length|lex|lexDigits|lexLitChar|lines|log|logBase|lookup|map|mapM|mapM_|max|maxBound|maximum|maybe|min|minBound|minimum|mod|negate|not|notElem|null|numerator|odd|or|ord|otherwise|pack|pi|pred|primExitWith|print|product|properFraction|putChar|putStr|putStrLn|quot|quotRem|range|rangeSize|read|readDec|readFile|readFloat|readHex|readIO|readInt|readList|readLitChar|readLn|readOct|readParen|readSigned|reads|readsPrec|realToFrac|recip|rem|repeat|replicate|return|reverse|round|scaleFloat|scanl|scanl1|scanr|scanr1|seq|sequence|sequence_|show|showChar|showInt|showList|showLitChar|showParen|showSigned|showString|shows|showsPrec|significand|signum|sin|sinh|snd|sort|span|splitAt|sqrt|subtract|succ|sum|tail|take|takeWhile|tan|tanh|threadToIOResult|toEnum|toInt|toInteger|toLower|toRational|toUpper|truncate|uncurry|undefined|unlines|until|unwords|unzip|unzip3|userError|words|writeFile|zip|zip3|zipWith|zipWith3)\b/,number:/\b(?:\d+(?:\.\d+)?(?:e[+-]?\d+)?|0o[0-7]+|0x[0-9a-f]+)\b/i,operator:/\s\.\s|[-!#$%*+=?&@|~:<>^\\\/]*\.[-!#$%*+=?&@|~.:<>^\\\/]+|[-!#$%*+=?&@|~.:<>^\\\/]+\.[-!#$%*+=?&@|~:<>^\\\/]*|[-!#$%*+=?&@|~:<>^\\\/]+|`(?:[A-Z][\w']*\.)*[_a-z][\w']*`/,hvariable:/\b(?:[A-Z][\w']*\.)*[_a-z][\w']*\b/,constant:/\b(?:[A-Z][\w']*\.)*[A-Z][\w']*\b/,punctuation:/[{}[\];(),.:]/},e.languages.hs=e.languages.haskell}e.exports=t,t.displayName="haskell",t.aliases=["hs"]},95121(e){"use strict";function t(e){e.languages.haxe=e.languages.extend("clike",{string:{pattern:/(["'])(?:(?!\1)[^\\]|\\[\s\S])*\1/,greedy:!0,inside:{interpolation:{pattern:/(^|[^\\])\$(?:\w+|\{[^}]+\})/,lookbehind:!0,inside:{interpolation:{pattern:/^\$\w*/,alias:"variable"}}}}},keyword:/\bthis\b|\b(?:abstract|as|break|case|cast|catch|class|continue|default|do|dynamic|else|enum|extends|extern|from|for|function|if|implements|import|in|inline|interface|macro|new|null|override|public|private|return|static|super|switch|throw|to|try|typedef|using|var|while)(?!\.)\b/,operator:/\.{3}|\+\+?|-[->]?|[=!]=?|&&?|\|\|?|<[<=]?|>[>=]?|[*\/%~^]/}),e.languages.insertBefore("haxe","class-name",{regex:{pattern:/~\/(?:[^\/\\\r\n]|\\.)+\/[igmsu]*/,greedy:!0}}),e.languages.insertBefore("haxe","keyword",{preprocessor:{pattern:/#\w+/,alias:"builtin"},metadata:{pattern:/@:?\w+/,alias:"symbol"},reification:{pattern:/\$(?:\w+|(?=\{))/,alias:"variable"}}),e.languages.haxe.string.inside.interpolation.inside.rest=e.languages.haxe,delete e.languages.haxe["class-name"]}e.exports=t,t.displayName="haxe",t.aliases=[]},59904(e){"use strict";function t(e){e.languages.hcl={comment:/(?:\/\/|#).*|\/\*[\s\S]*?(?:\*\/|$)/,heredoc:{pattern:/<<-?(\w+\b)[\s\S]*?^[ \t]*\1/m,greedy:!0,alias:"string"},keyword:[{pattern:/(?:resource|data)\s+(?:"(?:\\[\s\S]|[^\\"])*")(?=\s+"[\w-]+"\s+\{)/i,inside:{type:{pattern:/(resource|data|\s+)(?:"(?:\\[\s\S]|[^\\"])*")/i,lookbehind:!0,alias:"variable"}}},{pattern:/(?:provider|provisioner|variable|output|module|backend)\s+(?:[\w-]+|"(?:\\[\s\S]|[^\\"])*")\s+(?=\{)/i,inside:{type:{pattern:/(provider|provisioner|variable|output|module|backend)\s+(?:[\w-]+|"(?:\\[\s\S]|[^\\"])*")\s+/i,lookbehind:!0,alias:"variable"}}},/[\w-]+(?=\s+\{)/],property:[/[-\w\.]+(?=\s*=(?!=))/,/"(?:\\[\s\S]|[^\\"])+"(?=\s*[:=])/],string:{pattern:/"(?:[^\\$"]|\\[\s\S]|\$(?:(?=")|\$+(?!\$)|[^"${])|\$\{(?:[^{}"]|"(?:[^\\"]|\\[\s\S])*")*\})*"/,greedy:!0,inside:{interpolation:{pattern:/(^|[^$])\$\{(?:[^{}"]|"(?:[^\\"]|\\[\s\S])*")*\}/,lookbehind:!0,inside:{type:{pattern:/(\b(?:terraform|var|self|count|module|path|data|local)\b\.)[\w\*]+/i,lookbehind:!0,alias:"variable"},keyword:/\b(?:terraform|var|self|count|module|path|data|local)\b/i,function:/\w+(?=\()/,string:{pattern:/"(?:\\[\s\S]|[^\\"])*"/,greedy:!0},number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?(?:e[+-]?\d+)?/i,punctuation:/[!\$#%&'()*+,.\/;<=>@\[\\\]^`{|}~?:]/}}}},number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?(?:e[+-]?\d+)?/i,boolean:/\b(?:true|false)\b/i,punctuation:/[=\[\]{}]/}}e.exports=t,t.displayName="hcl",t.aliases=[]},9436(e,t,n){"use strict";var r=n(65806);function i(e){e.register(r),e.languages.hlsl=e.languages.extend("c",{"class-name":[e.languages.c["class-name"],/\b(?:AppendStructuredBuffer|BlendState|Buffer|ByteAddressBuffer|CompileShader|ComputeShader|ConsumeStructuredBuffer|DepthStencilState|DepthStencilView|DomainShader|GeometryShader|Hullshader|InputPatch|LineStream|OutputPatch|PixelShader|PointStream|RasterizerState|RenderTargetView|RWBuffer|RWByteAddressBuffer|RWStructuredBuffer|RWTexture(?:1D|1DArray|2D|2DArray|3D)|SamplerComparisonState|SamplerState|StructuredBuffer|Texture(?:1D|1DArray|2D|2DArray|2DMS|2DMSArray|3D|Cube|CubeArray)|TriangleStream|VertexShader)\b/],keyword:[/\b(?:asm|asm_fragment|auto|break|case|catch|cbuffer|centroid|char|class|column_major|compile|compile_fragment|const|const_cast|continue|default|delete|discard|do|dynamic_cast|else|enum|explicit|export|extern|for|friend|fxgroup|goto|groupshared|if|in|inline|inout|interface|line|lineadj|linear|long|matrix|mutable|namespace|new|nointerpolation|noperspective|operator|out|packoffset|pass|pixelfragment|point|precise|private|protected|public|register|reinterpret_cast|return|row_major|sample|sampler|shared|short|signed|sizeof|snorm|stateblock|stateblock_state|static|static_cast|string|struct|switch|tbuffer|technique|technique10|technique11|template|texture|this|throw|triangle|triangleadj|try|typedef|typename|uniform|union|unorm|unsigned|using|vector|vertexfragment|virtual|void|volatile|while)\b/,/\b(?:bool|double|dword|float|half|int|min(?:10float|12int|16(?:float|int|uint))|uint)(?:[1-4](?:x[1-4])?)?\b/],number:/(?:(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[eE][+-]?\d+)?|\b0x[\da-fA-F]+)[fFhHlLuU]?\b/,boolean:/\b(?:false|true)\b/})}e.exports=i,i.displayName="hlsl",i.aliases=[]},76942(e){"use strict";function t(e){e.languages.hpkp={directive:{pattern:/\b(?:(?:includeSubDomains|preload|strict)(?: |;)|pin-sha256="[a-zA-Z\d+=/]+"|(?:max-age|report-uri)=|report-to )/,alias:"keyword"},safe:{pattern:/\b\d{7,}\b/,alias:"selector"},unsafe:{pattern:/\b\d{1,6}\b/,alias:"function"}}}e.exports=t,t.displayName="hpkp",t.aliases=[]},60561(e){"use strict";function t(e){e.languages.hsts={directive:{pattern:/\b(?:max-age=|includeSubDomains|preload)/,alias:"keyword"},safe:{pattern:/\b\d{8,}\b/,alias:"selector"},unsafe:{pattern:/\b\d{1,7}\b/,alias:"function"}}}e.exports=t,t.displayName="hsts",t.aliases=[]},49660(e){"use strict";function t(e){!function(e){e.languages.http={"request-line":{pattern:/^(?:GET|HEAD|POST|PUT|DELETE|CONNECT|OPTIONS|TRACE|PATCH|PRI|SEARCH)\s(?:https?:\/\/|\/)\S*\sHTTP\/[0-9.]+/m,inside:{method:{pattern:/^[A-Z]+\b/,alias:"property"},"request-target":{pattern:/^(\s)(?:https?:\/\/|\/)\S*(?=\s)/,lookbehind:!0,alias:"url",inside:e.languages.uri},"http-version":{pattern:/^(\s)HTTP\/[0-9.]+/,lookbehind:!0,alias:"property"}}},"response-status":{pattern:/^HTTP\/[0-9.]+ \d+ .+/m,inside:{"http-version":{pattern:/^HTTP\/[0-9.]+/,alias:"property"},"status-code":{pattern:/^(\s)\d+(?=\s)/,lookbehind:!0,alias:"number"},"reason-phrase":{pattern:/^(\s).+/,lookbehind:!0,alias:"string"}}},"header-name":{pattern:/^[\w-]+:(?=.)/m,alias:"keyword"}};var t,n=e.languages,r={"application/javascript":n.javascript,"application/json":n.json||n.javascript,"application/xml":n.xml,"text/xml":n.xml,"text/html":n.html,"text/css":n.css},i={"application/json":!0,"application/xml":!0};function a(e){var t="\\w+/(?:[\\w.-]+\\+)+"+e.replace(/^[a-z]+\//,"")+"(?![+\\w.-])";return"(?:"+e+"|"+t+")"}for(var o in r)if(r[o]){t=t||{};var s=i[o]?a(o):o;t[o.replace(/\//g,"-")]={pattern:RegExp("(content-type:\\s*"+s+"(?:(?:\\r\\n?|\\n).+)*)(?:\\r?\\n|\\r){2}[\\s\\S]*","i"),lookbehind:!0,inside:r[o]}}t&&e.languages.insertBefore("http","header-name",t)}(e)}e.exports=t,t.displayName="http",t.aliases=[]},30615(e){"use strict";function t(e){e.languages.ichigojam={comment:/(?:\B'|REM)(?:[^\n\r]*)/i,string:{pattern:/"(?:""|[!#$%&'()*,\/:;<=>?^\w +\-.])*"/i,greedy:!0},number:/\B#[0-9A-F]+|\B`[01]+|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:E[+-]?\d+)?/i,keyword:/\b(?:BEEP|BPS|CASE|CLEAR|CLK|CLO|CLP|CLS|CLT|CLV|CONT|COPY|ELSE|END|FILE|FILES|FOR|GOSUB|GSB|GOTO|IF|INPUT|KBD|LED|LET|LIST|LOAD|LOCATE|LRUN|NEW|NEXT|OUT|RIGHT|PLAY|POKE|PRINT|PWM|REM|RENUM|RESET|RETURN|RTN|RUN|SAVE|SCROLL|SLEEP|SRND|STEP|STOP|SUB|TEMPO|THEN|TO|UART|VIDEO|WAIT)(?:\$|\b)/i,function:/\b(?:ABS|ANA|ASC|BIN|BTN|DEC|END|FREE|HELP|HEX|I2CR|I2CW|IN|INKEY|LEN|LINE|PEEK|RND|SCR|SOUND|STR|TICK|USR|VER|VPEEK|ZER)(?:\$|\b)/i,label:/(?:\B@\S+)/i,operator:/<[=>]?|>=?|\|\||&&|[+\-*\/=|&^~!]|\b(?:AND|NOT|OR)\b/i,punctuation:/[\[,;:()\]]/}}e.exports=t,t.displayName="ichigojam",t.aliases=[]},93865(e){"use strict";function t(e){e.languages.icon={comment:/#.*/,string:{pattern:/(["'])(?:(?!\1)[^\\\r\n_]|\\.|_(?!\1)(?:\r\n|[\s\S]))*\1/,greedy:!0},number:/\b(?:\d+r[a-z\d]+|\d+(?:\.\d+)?(?:e[+-]?\d+)?)\b|\.\d+\b/i,"builtin-keyword":{pattern:/&(?:allocated|ascii|clock|collections|cset|current|date|dateline|digits|dump|e|error(?:number|text|value)?|errout|fail|features|file|host|input|lcase|letters|level|line|main|null|output|phi|pi|pos|progname|random|regions|source|storage|subject|time|trace|ucase|version)\b/,alias:"variable"},directive:{pattern:/\$\w+/,alias:"builtin"},keyword:/\b(?:break|by|case|create|default|do|else|end|every|fail|global|if|initial|invocable|link|local|next|not|of|procedure|record|repeat|return|static|suspend|then|to|until|while)\b/,function:/\b(?!\d)\w+(?=\s*[({]|\s*!\s*\[)/,operator:/[+-]:(?!=)|(?:[\/?@^%&]|\+\+?|--?|==?=?|~==?=?|\*\*?|\|\|\|?|<(?:->?|>?=?)(?::=)?|:(?:=:?)?|[!.\\|~]/,punctuation:/[\[\](){},;]/}}e.exports=t,t.displayName="icon",t.aliases=[]},51078(e){"use strict";function t(e){!function(e){function t(e,n){return n<=0?/[]/.source:e.replace(//g,function(){return t(e,n-1)})}var n=/'[{}:=,](?:[^']|'')*'(?!')/,r={pattern:/''/,greedy:!0,alias:"operator"},i={pattern:n,greedy:!0,inside:{escape:r}},a=t(/\{(?:[^{}']|'(?![{},'])|''||)*\}/.source.replace(//g,function(){return n.source}),8),o={pattern:RegExp(a),inside:{message:{pattern:/^(\{)[\s\S]+(?=\}$)/,lookbehind:!0,inside:null},"message-delimiter":{pattern:/./,alias:"punctuation"}}};e.languages["icu-message-format"]={argument:{pattern:RegExp(a),greedy:!0,inside:{content:{pattern:/^(\{)[\s\S]+(?=\}$)/,lookbehind:!0,inside:{"argument-name":{pattern:/^(\s*)[^{}:=,\s]+/,lookbehind:!0},"choice-style":{pattern:/^(\s*,\s*choice\s*,\s*)\S(?:[\s\S]*\S)?/,lookbehind:!0,inside:{punctuation:/\|/,range:{pattern:/^(\s*)[+-]?(?:\d+(?:\.\d*)?|\u221e)\s*[<#\u2264]/,lookbehind:!0,inside:{operator:/[<#\u2264]/,number:/\S+/}},rest:null}},"plural-style":{pattern:/^(\s*,\s*(?:plural|selectordinal)\s*,\s*)\S(?:[\s\S]*\S)?/,lookbehind:!0,inside:{offset:/^offset:\s*\d+/,"nested-message":o,selector:{pattern:/=\d+|[^{}:=,\s]+/,inside:{keyword:/^(?:zero|one|two|few|many|other)$/}}}},"select-style":{pattern:/^(\s*,\s*select\s*,\s*)\S(?:[\s\S]*\S)?/,lookbehind:!0,inside:{"nested-message":o,selector:{pattern:/[^{}:=,\s]+/,inside:{keyword:/^other$/}}}},keyword:/\b(?:choice|plural|select|selectordinal)\b/,"arg-type":{pattern:/\b(?:number|date|time|spellout|ordinal|duration)\b/,alias:"keyword"},"arg-skeleton":{pattern:/(,\s*)::[^{}:=,\s]+/,lookbehind:!0},"arg-style":{pattern:/(,\s*)(?:short|medium|long|full|integer|currency|percent)(?=\s*$)/,lookbehind:!0},"arg-style-text":{pattern:RegExp(/(^\s*,\s*(?=\S))/.source+t(/(?:[^{}']|'[^']*'|\{(?:)?\})+/.source,8)+"$"),lookbehind:!0,alias:"string"},punctuation:/,/}},"argument-delimiter":{pattern:/./,alias:"operator"}}},escape:r,string:i},o.inside.message.inside=e.languages["icu-message-format"],e.languages["icu-message-format"].argument.inside.content.inside["choice-style"].inside.rest=e.languages["icu-message-format"]}(e)}e.exports=t,t.displayName="icuMessageFormat",t.aliases=[]},91178(e,t,n){"use strict";var r=n(58090);function i(e){e.register(r),e.languages.idris=e.languages.extend("haskell",{comment:{pattern:/(?:(?:--|\|\|\|).*$|\{-[\s\S]*?-\})/m},keyword:/\b(?:Type|case|class|codata|constructor|corecord|data|do|dsl|else|export|if|implementation|implicit|import|impossible|in|infix|infixl|infixr|instance|interface|let|module|mutual|namespace|of|parameters|partial|postulate|private|proof|public|quoteGoal|record|rewrite|syntax|then|total|using|where|with)\b/,"import-statement":{pattern:/(^\s*)import\s+(?:[A-Z][\w']*)(?:\.[A-Z][\w']*)*/m,lookbehind:!0},builtin:void 0}),e.languages.idr=e.languages.idris}e.exports=i,i.displayName="idris",i.aliases=["idr"]},40011(e){"use strict";function t(e){e.languages.iecst={comment:[{pattern:/(^|[^\\])(?:\/\*[\s\S]*?(?:\*\/|$)|\(\*[\s\S]*?(?:\*\)|$)|\{[\s\S]*?(?:\}|$))/,lookbehind:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":/\b(?:END_)?(?:PROGRAM|CONFIGURATION|INTERFACE|FUNCTION_BLOCK|FUNCTION|ACTION|TRANSITION|TYPE|STRUCT|(?:INITIAL_)?STEP|NAMESPACE|LIBRARY|CHANNEL|FOLDER|RESOURCE|VAR_(?:GLOBAL|INPUT|PUTPUT|IN_OUT|ACCESS|TEMP|EXTERNAL|CONFIG)|VAR|METHOD|PROPERTY)\b/i,keyword:/\b(?:(?:END_)?(?:IF|WHILE|REPEAT|CASE|FOR)|ELSE|FROM|THEN|ELSIF|DO|TO|BY|PRIVATE|PUBLIC|PROTECTED|CONSTANT|RETURN|EXIT|CONTINUE|GOTO|JMP|AT|RETAIN|NON_RETAIN|TASK|WITH|UNTIL|USING|EXTENDS|IMPLEMENTS|GET|SET|__TRY|__CATCH|__FINALLY|__ENDTRY)\b/,variable:/\b(?:AT|BOOL|BYTE|(?:D|L)?WORD|U?(?:S|D|L)?INT|L?REAL|TIME(?:_OF_DAY)?|TOD|DT|DATE(?:_AND_TIME)?|STRING|ARRAY|ANY|POINTER)\b/,symbol:/%[IQM][XBWDL][\d.]*|%[IQ][\d.]*/,number:/\b(?:16#[\da-f]+|2#[01_]+|0x[\da-f]+)\b|\b(?:T|D|DT|TOD)#[\d_shmd:]*|\b[A-Z]*#[\d.,_]*|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,boolean:/\b(?:TRUE|FALSE|NULL)\b/,function:/\w+(?=\()/,operator:/(?:S?R?:?=>?|&&?|\*\*?|<=?|>=?|[-:^/+])|\b(?:OR|AND|MOD|NOT|XOR|LE|GE|EQ|NE|GT|LT)\b/,punctuation:/[();]/,type:{pattern:/#/,alias:"selector"}}}e.exports=t,t.displayName="iecst",t.aliases=[]},12017(e){"use strict";function t(e){var t;(t=e).languages.ignore={comment:/^#.*/m,entry:{pattern:/\S(?:.*(?:(?:\\ )|\S))?/,alias:"string",inside:{operator:/^!|\*\*?|\?/,regex:{pattern:/(^|[^\\])\[[^\[\]]*\]/,lookbehind:!0},punctuation:/\//}}},t.languages.gitignore=t.languages.ignore,t.languages.hgignore=t.languages.ignore,t.languages.npmignore=t.languages.ignore}e.exports=t,t.displayName="ignore",t.aliases=["gitignore","hgignore","npmignore"]},65175(e){"use strict";function t(e){e.languages.inform7={string:{pattern:/"[^"]*"/,inside:{substitution:{pattern:/\[[^\[\]]+\]/,inside:{delimiter:{pattern:/\[|\]/,alias:"punctuation"}}}}},comment:{pattern:/\[[^\[\]]+\]/,greedy:!0},title:{pattern:/^[ \t]*(?:volume|book|part(?! of)|chapter|section|table)\b.+/im,alias:"important"},number:{pattern:/(^|[^-])(?:\b\d+(?:\.\d+)?(?:\^\d+)?(?:(?!\d)\w+)?|\b(?:one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve))\b(?!-)/i,lookbehind:!0},verb:{pattern:/(^|[^-])\b(?:applying to|are|attacking|answering|asking|be(?:ing)?|burning|buying|called|carries|carry(?! out)|carrying|climbing|closing|conceal(?:s|ing)?|consulting|contain(?:s|ing)?|cutting|drinking|dropping|eating|enclos(?:es?|ing)|entering|examining|exiting|getting|giving|going|ha(?:ve|s|ving)|hold(?:s|ing)?|impl(?:y|ies)|incorporat(?:es?|ing)|inserting|is|jumping|kissing|listening|locking|looking|mean(?:s|ing)?|opening|provid(?:es?|ing)|pulling|pushing|putting|relat(?:es?|ing)|removing|searching|see(?:s|ing)?|setting|showing|singing|sleeping|smelling|squeezing|switching|support(?:s|ing)?|swearing|taking|tasting|telling|thinking|throwing|touching|turning|tying|unlock(?:s|ing)?|var(?:y|ies|ying)|waiting|waking|waving|wear(?:s|ing)?)\b(?!-)/i,lookbehind:!0,alias:"operator"},keyword:{pattern:/(^|[^-])\b(?:after|before|carry out|check|continue the action|definition(?= *:)|do nothing|else|end (?:if|unless|the story)|every turn|if|include|instead(?: of)?|let|move|no|now|otherwise|repeat|report|resume the story|rule for|running through|say(?:ing)?|stop the action|test|try(?:ing)?|understand|unless|use|when|while|yes)\b(?!-)/i,lookbehind:!0},property:{pattern:/(^|[^-])\b(?:adjacent(?! to)|carried|closed|concealed|contained|dark|described|edible|empty|enclosed|enterable|even|female|fixed in place|full|handled|held|improper-named|incorporated|inedible|invisible|lighted|lit|lock(?:able|ed)|male|marked for listing|mentioned|negative|neuter|non-(?:empty|full|recurring)|odd|opaque|open(?:able)?|plural-named|portable|positive|privately-named|proper-named|provided|publically-named|pushable between rooms|recurring|related|rubbing|scenery|seen|singular-named|supported|swinging|switch(?:able|ed(?: on| off)?)|touch(?:able|ed)|transparent|unconcealed|undescribed|unlit|unlocked|unmarked for listing|unmentioned|unopenable|untouchable|unvisited|variable|visible|visited|wearable|worn)\b(?!-)/i,lookbehind:!0,alias:"symbol"},position:{pattern:/(^|[^-])\b(?:above|adjacent to|back side of|below|between|down|east|everywhere|front side|here|in|inside(?: from)?|north(?:east|west)?|nowhere|on(?: top of)?|other side|outside(?: from)?|parts? of|regionally in|south(?:east|west)?|through|up|west|within)\b(?!-)/i,lookbehind:!0,alias:"keyword"},type:{pattern:/(^|[^-])\b(?:actions?|activit(?:y|ies)|actors?|animals?|backdrops?|containers?|devices?|directions?|doors?|holders?|kinds?|lists?|m[ae]n|nobody|nothing|nouns?|numbers?|objects?|people|persons?|player(?:'s holdall)?|regions?|relations?|rooms?|rule(?:book)?s?|scenes?|someone|something|supporters?|tables?|texts?|things?|time|vehicles?|wom[ae]n)\b(?!-)/i,lookbehind:!0,alias:"variable"},punctuation:/[.,:;(){}]/},e.languages.inform7.string.inside.substitution.inside.rest=e.languages.inform7,e.languages.inform7.string.inside.substitution.inside.rest.text={pattern:/\S(?:\s*\S)*/,alias:"comment"}}e.exports=t,t.displayName="inform7",t.aliases=[]},14970(e){"use strict";function t(e){e.languages.ini={comment:{pattern:/(^[ \f\t\v]*)[#;][^\n\r]*/m,lookbehind:!0},header:{pattern:/(^[ \f\t\v]*)\[[^\n\r\]]*\]?/m,lookbehind:!0,inside:{"section-name":{pattern:/(^\[[ \f\t\v]*)[^ \f\t\v\]]+(?:[ \f\t\v]+[^ \f\t\v\]]+)*/,lookbehind:!0,alias:"selector"},punctuation:/\[|\]/}},key:{pattern:/(^[ \f\t\v]*)[^ \f\n\r\t\v=]+(?:[ \f\t\v]+[^ \f\n\r\t\v=]+)*(?=[ \f\t\v]*=)/m,lookbehind:!0,alias:"attr-name"},value:{pattern:/(=[ \f\t\v]*)[^ \f\n\r\t\v]+(?:[ \f\t\v]+[^ \f\n\r\t\v]+)*/,lookbehind:!0,alias:"attr-value",inside:{"inner-value":{pattern:/^("|').+(?=\1$)/,lookbehind:!0}}},punctuation:/=/}}e.exports=t,t.displayName="ini",t.aliases=[]},30764(e){"use strict";function t(e){e.languages.io={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0},{pattern:/(^|[^\\])\/\/.*/,lookbehind:!0},{pattern:/(^|[^\\])#.*/,lookbehind:!0}],"triple-quoted-string":{pattern:/"""(?:\\[\s\S]|(?!""")[^\\])*"""/,greedy:!0,alias:"string"},string:{pattern:/"(?:\\.|[^\\\r\n"])*"/,greedy:!0},keyword:/\b(?:activate|activeCoroCount|asString|block|break|catch|clone|collectGarbage|compileString|continue|do|doFile|doMessage|doString|else|elseif|exit|for|foreach|forward|getSlot|getEnvironmentVariable|hasSlot|if|ifFalse|ifNil|ifNilEval|ifTrue|isActive|isNil|isResumable|list|message|method|parent|pass|pause|perform|performWithArgList|print|println|proto|raise|raiseResumable|removeSlot|resend|resume|schedulerSleepSeconds|self|sender|setSchedulerSleepSeconds|setSlot|shallowCopy|slotNames|super|system|then|thisBlock|thisContext|call|try|type|uniqueId|updateSlot|wait|while|write|yield)\b/,builtin:/\b(?:Array|AudioDevice|AudioMixer|Block|Box|Buffer|CFunction|CGI|Color|Curses|DBM|DNSResolver|DOConnection|DOProxy|DOServer|Date|Directory|Duration|DynLib|Error|Exception|FFT|File|Fnmatch|Font|Future|GL|GLE|GLScissor|GLU|GLUCylinder|GLUQuadric|GLUSphere|GLUT|Host|Image|Importer|LinkList|List|Lobby|Locals|MD5|MP3Decoder|MP3Encoder|Map|Message|Movie|Notification|Number|Object|OpenGL|Point|Protos|Regex|SGML|SGMLElement|SGMLParser|SQLite|Server|Sequence|ShowMessage|SleepyCat|SleepyCatCursor|Socket|SocketManager|Sound|Soup|Store|String|Tree|UDPSender|UPDReceiver|URL|User|Warning|WeakLink|Random|BigNum)\b/,boolean:/\b(?:true|false|nil)\b/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e-?\d+)?/i,operator:/[=!*/%+\-^&|]=|>>?=?|<+*\-%$|,#][.:]?|[?^]\.?|[;\[]:?|[~}"i][.:]|[ACeEIjLor]\.|(?:[_\/\\qsux]|_?\d):)/,alias:"keyword"},number:/\b_?(?:(?!\d:)\d+(?:\.\d+)?(?:(?:[ejpx]|ad|ar)_?\d+(?:\.\d+)?)*(?:b_?[\da-z]+(?:\.[\da-z]+)?)?|_\b(?!\.))/,adverb:{pattern:/[~}]|[\/\\]\.?|[bfM]\.|t[.:]/,alias:"builtin"},operator:/[=a][.:]|_\./,conjunction:{pattern:/&(?:\.:?|:)?|[.:@][.:]?|[!D][.:]|[;dHT]\.|`:?|[\^LS]:|"/,alias:"variable"},punctuation:/[()]/}}e.exports=t,t.displayName="j",t.aliases=[]},15909(e){"use strict";function t(e){var t,n,r,i;t=e,n=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,i={pattern:RegExp((r=/(^|[^\w.])(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source)+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}},t.languages.java=t.languages.extend("clike",{"class-name":[i,{pattern:RegExp(r+/[A-Z]\w*(?=\s+\w+\s*[;,=()])/.source),lookbehind:!0,inside:i.inside}],keyword:n,function:[t.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0}}),t.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"}}),t.languages.insertBefore("java","class-name",{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:"punctuation"},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":i,keyword:n,punctuation:/[<>(),.:]/,operator:/[?&|]/}},namespace:{pattern:RegExp(/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(//g,function(){return n.source})),lookbehind:!0,inside:{punctuation:/\./}}})}e.exports=t,t.displayName="java",t.aliases=[]},36553(e,t,n){"use strict";var r=n(15909),i=n(9858);function a(e){var t,n,a,o;e.register(r),e.register(i),t=e,n=/(^(?:[\t ]*(?:\*\s*)*))[^*\s].*$/m,a=/#\s*\w+(?:\s*\([^()]*\))?/.source,o=/(?:\b[a-zA-Z]\w+\s*\.\s*)*\b[A-Z]\w*(?:\s*)?|/.source.replace(//g,function(){return a}),t.languages.javadoc=t.languages.extend("javadoclike",{}),t.languages.insertBefore("javadoc","keyword",{reference:{pattern:RegExp(/(@(?:exception|throws|see|link|linkplain|value)\s+(?:\*\s*)?)/.source+"(?:"+o+")"),lookbehind:!0,inside:{function:{pattern:/(#\s*)\w+(?=\s*\()/,lookbehind:!0},field:{pattern:/(#\s*)\w+/,lookbehind:!0},namespace:{pattern:/\b(?:[a-z]\w*\s*\.\s*)+/,inside:{punctuation:/\./}},"class-name":/\b[A-Z]\w*/,keyword:t.languages.java.keyword,punctuation:/[#()[\],.]/}},"class-name":{pattern:/(@param\s+)<[A-Z]\w*>/,lookbehind:!0,inside:{punctuation:/[.<>]/}},"code-section":[{pattern:/(\{@code\s+(?!\s))(?:[^\s{}]|\s+(?![\s}])|\{(?:[^{}]|\{(?:[^{}]|\{(?:[^{}]|\{[^{}]*\})*\})*\})*\})+(?=\s*\})/,lookbehind:!0,inside:{code:{pattern:n,lookbehind:!0,inside:t.languages.java,alias:"language-java"}}},{pattern:/(<(code|pre|tt)>(?!)\s*)\S(?:\S|\s+\S)*?(?=\s*<\/\2>)/,lookbehind:!0,inside:{line:{pattern:n,lookbehind:!0,inside:{tag:t.languages.markup.tag,entity:t.languages.markup.entity,code:{pattern:/.+/,inside:t.languages.java,alias:"language-java"}}}}}],tag:t.languages.markup.tag,entity:t.languages.markup.entity}),t.languages.javadoclike.addSupport("java",t.languages.javadoc)}e.exports=a,a.displayName="javadoc",a.aliases=[]},9858(e){"use strict";function t(e){!function(e){var t=e.languages.javadoclike={parameter:{pattern:/(^[\t ]*(?:\/{3}|\*|\/\*\*)\s*@(?:param|arg|arguments)\s+)\w+/m,lookbehind:!0},keyword:{pattern:/(^[\t ]*(?:\/{3}|\*|\/\*\*)\s*|\{)@[a-z][a-zA-Z-]+\b/m,lookbehind:!0},punctuation:/[{}]/};function n(t,n){var r="doc-comment",i=e.languages[t];if(i){var a=i[r];if(!a){var o={};o[r]={pattern:/(^|[^\\])\/\*\*[^/][\s\S]*?(?:\*\/|$)/,lookbehind:!0,alias:"comment"},a=(i=e.languages.insertBefore(t,"comment",o))[r]}if(a instanceof RegExp&&(a=i[r]={pattern:a}),Array.isArray(a))for(var s=0,u=a.length;s|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),e.languages.javascript["class-name"][0].pattern=/(\b(?:class|interface|extends|implements|instanceof|new)\s+)[\w.\\]+/,e.languages.insertBefore("javascript","keyword",{regex:{pattern:/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)\/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/,lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:e.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:e.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:e.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:e.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:e.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),e.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:e.languages.javascript}},string:/[\s\S]+/}}}),e.languages.markup&&(e.languages.markup.tag.addInlined("script","javascript"),e.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),e.languages.js=e.languages.javascript}e.exports=t,t.displayName="javascript",t.aliases=["js"]},11223(e){"use strict";function t(e){e.languages.javastacktrace={summary:{pattern:/^[\t ]*(?:(?:Caused by:|Suppressed:|Exception in thread "[^"]*")[\t ]+)?[\w$.]+(?::.*)?$/m,inside:{keyword:{pattern:/^(\s*)(?:(?:Caused by|Suppressed)(?=:)|Exception in thread)/m,lookbehind:!0},string:{pattern:/^(\s*)"[^"]*"/,lookbehind:!0},exceptions:{pattern:/^(:?\s*)[\w$.]+(?=:|$)/,lookbehind:!0,inside:{"class-name":/[\w$]+(?=$|:)/,namespace:/[a-z]\w*/,punctuation:/[.:]/}},message:{pattern:/(:\s*)\S.*/,lookbehind:!0,alias:"string"},punctuation:/:/}},"stack-frame":{pattern:/^[\t ]*at (?:[\w$./]|@[\w$.+-]*\/)+(?:)?\([^()]*\)/m,inside:{keyword:{pattern:/^(\s*)at(?= )/,lookbehind:!0},source:[{pattern:/(\()\w+\.\w+:\d+(?=\))/,lookbehind:!0,inside:{file:/^\w+\.\w+/,punctuation:/:/,"line-number":{pattern:/\d+/,alias:"number"}}},{pattern:/(\()[^()]*(?=\))/,lookbehind:!0,inside:{keyword:/^(?:Unknown Source|Native Method)$/}}],"class-name":/[\w$]+(?=\.(?:|[\w$]+)\()/,function:/(?:|[\w$]+)(?=\()/,"class-loader":{pattern:/(\s)[a-z]\w*(?:\.[a-z]\w*)*(?=\/[\w@$.]*\/)/,lookbehind:!0,alias:"namespace",inside:{punctuation:/\./}},module:{pattern:/([\s/])[a-z]\w*(?:\.[a-z]\w*)*(?:@[\w$.+-]*)?(?=\/)/,lookbehind:!0,inside:{version:{pattern:/(@)[\s\S]+/,lookbehind:!0,alias:"number"},punctuation:/[@.]/}},namespace:{pattern:/(?:[a-z]\w*\.)+/,inside:{punctuation:/\./}},punctuation:/[()/.]/}},more:{pattern:/^[\t ]*\.{3} \d+ [a-z]+(?: [a-z]+)*/m,inside:{punctuation:/\.{3}/,number:/\d+/,keyword:/\b[a-z]+(?: [a-z]+)*\b/}}}}e.exports=t,t.displayName="javastacktrace",t.aliases=[]},57957(e){"use strict";function t(e){e.languages.jexl={string:/(["'])(?:\\[\s\S]|(?!\1)[^\\])*\1/,transform:{pattern:/(\|\s*)[a-zA-Zа-яА-Я_\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF$][\wа-яА-Я\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF$]*/,alias:"function",lookbehind:!0},function:/[a-zA-Zа-яА-Я_\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF$][\wа-яА-Я\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF$]*\s*(?=\()/,number:/\b\d+(?:\.\d+)?\b|\B\.\d+\b/,operator:/[<>!]=?|-|\+|&&|==|\|\|?|\/\/?|[?:*^%]/,boolean:/\b(?:true|false)\b/,keyword:/\bin\b/,punctuation:/[{}[\](),.]/}}e.exports=t,t.displayName="jexl",t.aliases=[]},75807(e){"use strict";function t(e){e.languages.jolie=e.languages.extend("clike",{string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},keyword:/\b(?:include|define|is_defined|undef|main|init|outputPort|inputPort|Location|Protocol|Interfaces|RequestResponse|OneWay|type|interface|extender|throws|cset|csets|forward|Aggregates|Redirects|embedded|courier|execution|sequential|concurrent|single|scope|install|throw|comp|cH|default|global|linkIn|linkOut|synchronized|this|new|for|if|else|while|in|Jolie|Java|Javascript|nullProcess|spawn|constants|with|provide|until|exit|foreach|instanceof|over|service)\b/,number:/(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?l?/i,operator:/-[-=>]?|\+[+=]?|<[<=]?|[>=*!]=?|&&|\|\||[:?\/%^]/,punctuation:/[,.]/,builtin:/\b(?:undefined|string|int|void|long|Byte|bool|double|float|char|any)\b/,symbol:/[|;@]/}),delete e.languages.jolie["class-name"],e.languages.insertBefore("jolie","keyword",{function:{pattern:/((?:\b(?:outputPort|inputPort|in|service|courier)\b|@)\s*)\w+/,lookbehind:!0},aggregates:{pattern:/(\bAggregates\s*:\s*)(?:\w+(?:\s+with\s+\w+)?\s*,\s*)*\w+(?:\s+with\s+\w+)?/,lookbehind:!0,inside:{"with-extension":{pattern:/\bwith\s+\w+/,inside:{keyword:/\bwith\b/}},function:{pattern:/\w+/},punctuation:{pattern:/,/}}},redirects:{pattern:/(\bRedirects\s*:\s*)(?:\w+\s*=>\s*\w+\s*,\s*)*(?:\w+\s*=>\s*\w+)/,lookbehind:!0,inside:{punctuation:{pattern:/,/},function:{pattern:/\w+/},symbol:{pattern:/=>/}}}})}e.exports=t,t.displayName="jolie",t.aliases=[]},77935(e){"use strict";function t(e){var t,n,r,i,a;t=e,n=/\\\((?:[^()]|\([^()]*\))*\)/.source,r=RegExp(/"(?:[^"\r\n\\]|\\[^\r\n(]|__)*"/.source.replace(/__/g,function(){return n})),i={interpolation:{pattern:RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+n),lookbehind:!0,inside:{content:{pattern:/^(\\\()[\s\S]+(?=\)$)/,lookbehind:!0,inside:null},punctuation:/^\\\(|\)$/}}},a=t.languages.jq={comment:/#.*/,property:{pattern:RegExp(r.source+/(?=\s*:(?!:))/.source),greedy:!0,inside:i},string:{pattern:r,greedy:!0,inside:i},function:{pattern:/(\bdef\s+)[a-z_]\w+/i,lookbehind:!0},variable:/\B\$\w+/,"property-literal":{pattern:/\b[a-z_]\w*(?=\s*:(?!:))/i,alias:"property"},keyword:/\b(?:as|break|catch|def|elif|else|end|foreach|if|import|include|label|module|modulemeta|null|reduce|then|try|while)\b/,boolean:/\b(?:true|false)\b/,number:/(?:\b\d+\.|\B\.)?\b\d+(?:[eE][+-]?\d+)?\b/,operator:[{pattern:/\|=?/,alias:"pipe"},/\.\.|[!=<>]?=|\?\/\/|\/\/=?|[-+*/%]=?|[<>?]|\b(?:and|or|not)\b/],"c-style-function":{pattern:/\b[a-z_]\w*(?=\s*\()/i,alias:"function"},punctuation:/::|[()\[\]{},:;]|\.(?=\s*[\[\w$])/,dot:{pattern:/\./,alias:"important"}},i.interpolation.inside.content.inside=a}e.exports=t,t.displayName="jq",t.aliases=[]},46155(e){"use strict";function t(e){!function(e){function t(e,t){return RegExp(e.replace(//g,function(){return/(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/.source}),t)}e.languages.insertBefore("javascript","function-variable",{"method-variable":{pattern:RegExp("(\\.\\s*)"+e.languages.javascript["function-variable"].pattern.source),lookbehind:!0,alias:["function-variable","method","function","property-access"]}}),e.languages.insertBefore("javascript","function",{method:{pattern:RegExp("(\\.\\s*)"+e.languages.javascript.function.source),lookbehind:!0,alias:["function","property-access"]}}),e.languages.insertBefore("javascript","constant",{"known-class-name":[{pattern:/\b(?:(?:(?:Uint|Int)(?:8|16|32)|Uint8Clamped|Float(?:32|64))?Array|ArrayBuffer|BigInt|Boolean|DataView|Date|Error|Function|Intl|JSON|Math|Number|Object|Promise|Proxy|Reflect|RegExp|String|Symbol|(?:Weak)?(?:Set|Map)|WebAssembly)\b/,alias:"class-name"},{pattern:/\b(?:[A-Z]\w*)Error\b/,alias:"class-name"}]}),e.languages.insertBefore("javascript","keyword",{imports:{pattern:t(/(\bimport\b\s*)(?:(?:\s*,\s*(?:\*\s*as\s+|\{[^{}]*\}))?|\*\s*as\s+|\{[^{}]*\})(?=\s*\bfrom\b)/.source),lookbehind:!0,inside:e.languages.javascript},exports:{pattern:t(/(\bexport\b\s*)(?:\*(?:\s*as\s+)?(?=\s*\bfrom\b)|\{[^{}]*\})/.source),lookbehind:!0,inside:e.languages.javascript}}),e.languages.javascript.keyword.unshift({pattern:/\b(?:as|default|export|from|import)\b/,alias:"module"},{pattern:/\b(?:await|break|catch|continue|do|else|for|finally|if|return|switch|throw|try|while|yield)\b/,alias:"control-flow"},{pattern:/\bnull\b/,alias:["null","nil"]},{pattern:/\bundefined\b/,alias:"nil"}),e.languages.insertBefore("javascript","operator",{spread:{pattern:/\.{3}/,alias:"operator"},arrow:{pattern:/=>/,alias:"operator"}}),e.languages.insertBefore("javascript","punctuation",{"property-access":{pattern:t(/(\.\s*)#?/.source),lookbehind:!0},"maybe-class-name":{pattern:/(^|[^$\w\xA0-\uFFFF])[A-Z][$\w\xA0-\uFFFF]+/,lookbehind:!0},dom:{pattern:/\b(?:document|location|navigator|performance|(?:local|session)Storage|window)\b/,alias:"variable"},console:{pattern:/\bconsole(?=\s*\.)/,alias:"class-name"}});for(var n=["function","function-variable","method","method-variable","property-access"],r=0;r=h.length)return;var n=e[t];if("string"==typeof n||"string"==typeof n.content){var r=h[o],i="string"==typeof n?n:n.content,a=i.indexOf(r);if(-1!==a){++o;var s=i.substring(0,a),u=c(l[r]),f=i.substring(a+r.length),d=[];if(s&&d.push(s),d.push(u),f){var b=[f];p(b),d.push.apply(d,b)}"string"==typeof n?(e.splice.apply(e,[t,1].concat(d)),t+=d.length-1):n.content=d}}else{var m=n.content;Array.isArray(m)?p(m):p([m])}}}return o=0,p(d),new e.Token(r,d,"language-"+r,t)}e.languages.javascript["template-string"]=[o("css",/\b(?:styled(?:\([^)]*\))?(?:\s*\.\s*\w+(?:\([^)]*\))*)*|css(?:\s*\.\s*(?:global|resolve))?|createGlobalStyle|keyframes)/.source),o("html",/\bhtml|\.\s*(?:inner|outer)HTML\s*\+?=/.source),o("svg",/\bsvg/.source),o("markdown",/\b(?:md|markdown)/.source),o("graphql",/\b(?:gql|graphql(?:\s*\.\s*experimental)?)/.source),o("sql",/\bsql/.source),t].filter(Boolean);var f={javascript:!0,js:!0,typescript:!0,ts:!0,jsx:!0,tsx:!0};function d(e){return"string"==typeof e?e:Array.isArray(e)?e.map(d).join(""):d(e.content)}e.hooks.add("after-tokenize",function(t){t.language in f&&n(t.tokens);function n(t){for(var r=0,i=t.length;r\s+)?)[A-Z]\w*(?:\.[A-Z]\w*)*/.source.replace(//g,function(){return a})),lookbehind:!0,inside:{punctuation:/\./}},{pattern:RegExp("(@[a-z]+\\s+)"+a),lookbehind:!0,inside:{string:n.string,number:n.number,boolean:n.boolean,keyword:t.languages.typescript.keyword,operator:/=>|\.\.\.|[&|?:*]/,punctuation:/[.,;=<>{}()[\]]/}}],example:{pattern:/(@example\s+(?!\s))(?:[^@\s]|\s+(?!\s))+?(?=\s*(?:\*\s*)?(?:@\w|\*\/))/,lookbehind:!0,inside:{code:{pattern:/^([\t ]*(?:\*\s*)?)\S.*$/m,lookbehind:!0,inside:n,alias:"language-javascript"}}}}),t.languages.javadoclike.addSupport("javascript",t.languages.jsdoc)}e.exports=a,a.displayName="jsdoc",a.aliases=[]},45950(e){"use strict";function t(e){e.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:true|false)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}},e.languages.webmanifest=e.languages.json}e.exports=t,t.displayName="json",t.aliases=["webmanifest"]},50235(e,t,n){"use strict";var r=n(45950);function i(e){var t,n;e.register(r),n=/("|')(?:\\(?:\r\n?|\n|.)|(?!\1)[^\\\r\n])*\1/,(t=e).languages.json5=t.languages.extend("json",{property:[{pattern:RegExp(n.source+"(?=\\s*:)"),greedy:!0},{pattern:/(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/,alias:"unquoted"}],string:{pattern:n,greedy:!0},number:/[+-]?\b(?:NaN|Infinity|0x[a-fA-F\d]+)\b|[+-]?(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[eE][+-]?\d+\b)?/})}e.exports=i,i.displayName="json5",i.aliases=[]},80963(e,t,n){"use strict";var r=n(45950);function i(e){e.register(r),e.languages.jsonp=e.languages.extend("json",{punctuation:/[{}[\]();,.]/}),e.languages.insertBefore("jsonp","punctuation",{function:/(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*\()/})}e.exports=i,i.displayName="jsonp",i.aliases=[]},79358(e){"use strict";function t(e){e.languages.jsstacktrace={"error-message":{pattern:/^\S.*/m,alias:"string"},"stack-frame":{pattern:/(^[ \t]+)at[ \t].*/m,lookbehind:!0,inside:{"not-my-code":{pattern:/^at[ \t]+(?!\s)(?:node\.js||.*(?:node_modules|\(\)|\(|$|\(internal\/|\(node\.js)).*/m,alias:"comment"},filename:{pattern:/(\bat\s+(?!\s)|\()(?:[a-zA-Z]:)?[^():]+(?=:)/,lookbehind:!0,alias:"url"},function:{pattern:/(at\s+(?:new\s+)?)(?!\s)[_$a-zA-Z\xA0-\uFFFF<][.$\w\xA0-\uFFFF<>]*/,lookbehind:!0,inside:{punctuation:/\./}},punctuation:/[()]/,keyword:/\b(?:at|new)\b/,alias:{pattern:/\[(?:as\s+)?(?!\s)[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*\]/,alias:"variable"},"line-number":{pattern:/:[0-9]+(?::[0-9]+)?\b/,alias:"number",inside:{punctuation:/:/}}}}}}e.exports=t,t.displayName="jsstacktrace",t.aliases=[]},96412(e){"use strict";function t(e){!function(e){var t=e.util.clone(e.languages.javascript),n=/(?:\s|\/\/.*(?!.)|\/\*(?:[^*]|\*(?!\/))\*\/)/.source,r=/(?:\{(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])*\})/.source,i=/(?:\{*\.{3}(?:[^{}]|)*\})/.source;function a(e,t){return RegExp(e=e.replace(//g,function(){return n}).replace(//g,function(){return r}).replace(//g,function(){return i}),t)}i=a(i).source,e.languages.jsx=e.languages.extend("markup",t),e.languages.jsx.tag.pattern=a(/<\/?(?:[\w.:-]+(?:+(?:[\w.:$-]+(?:=(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s{'"/>=]+|))?|))**\/?)?>/.source),e.languages.jsx.tag.inside.tag.pattern=/^<\/?[^\s>\/]*/i,e.languages.jsx.tag.inside["attr-value"].pattern=/=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/i,e.languages.jsx.tag.inside.tag.inside["class-name"]=/^[A-Z]\w*(?:\.[A-Z]\w*)*$/,e.languages.jsx.tag.inside.comment=t.comment,e.languages.insertBefore("inside","attr-name",{spread:{pattern:a(//.source),inside:e.languages.jsx}},e.languages.jsx.tag),e.languages.insertBefore("inside","special-attr",{script:{pattern:a(/=/.source),inside:{"script-punctuation":{pattern:/^=(?=\{)/,alias:"punctuation"},rest:e.languages.jsx},alias:"language-javascript"}},e.languages.jsx.tag);var o=function(e){return e?"string"==typeof e?e:"string"==typeof e.content?e.content:e.content.map(o).join(""):""},s=function(t){for(var n=[],r=0;r0&&n[n.length-1].tagName===o(i.content[0].content[1])&&n.pop():"/>"===i.content[i.content.length-1].content||n.push({tagName:o(i.content[0].content[1]),openedBraces:0}):n.length>0&&"punctuation"===i.type&&"{"===i.content?n[n.length-1].openedBraces++:n.length>0&&n[n.length-1].openedBraces>0&&"punctuation"===i.type&&"}"===i.content?n[n.length-1].openedBraces--:a=!0),(a||"string"==typeof i)&&n.length>0&&0===n[n.length-1].openedBraces){var u=o(i);r0&&("string"==typeof t[r-1]||"plain-text"===t[r-1].type)&&(u=o(t[r-1])+u,t.splice(r-1,1),r--),t[r]=new e.Token("plain-text",u,null,u)}i.content&&"string"!=typeof i.content&&s(i.content)}};e.hooks.add("after-tokenize",function(e){("jsx"===e.language||"tsx"===e.language)&&s(e.tokens)})}(e)}e.exports=t,t.displayName="jsx",t.aliases=[]},39259(e){"use strict";function t(e){e.languages.julia={comment:{pattern:/(^|[^\\])(?:#=(?:[^#=]|=(?!#)|#(?!=)|#=(?:[^#=]|=(?!#)|#(?!=))*=#)*=#|#.*)/,lookbehind:!0},regex:{pattern:/r"(?:\\.|[^"\\\r\n])*"[imsx]{0,4}/,greedy:!0},string:{pattern:/"""[\s\S]+?"""|(?:\b\w+)?"(?:\\.|[^"\\\r\n])*"|(^|[^\w'])'(?:\\[^\r\n][^'\r\n]*|[^\\\r\n])'|`(?:[^\\`\r\n]|\\.)*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:abstract|baremodule|begin|bitstype|break|catch|ccall|const|continue|do|else|elseif|end|export|finally|for|function|global|if|immutable|import|importall|in|let|local|macro|module|print|println|quote|return|struct|try|type|typealias|using|while)\b/,boolean:/\b(?:true|false)\b/,number:/(?:\b(?=\d)|\B(?=\.))(?:0[box])?(?:[\da-f]+(?:_[\da-f]+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[efp][+-]?\d+(?:_\d+)*)?j?/i,operator:/&&|\|\||[-+*^%÷⊻&$\\]=?|\/[\/=]?|!=?=?|\|[=>]?|<(?:<=?|[=:|])?|>(?:=|>>?=?)?|==?=?|[~≠≤≥'√∛]/,punctuation:/::?|[{}[\]();,.?]/,constant:/\b(?:(?:NaN|Inf)(?:16|32|64)?|im|pi)\b|[πℯ]/}}e.exports=t,t.displayName="julia",t.aliases=[]},35760(e){"use strict";function t(e){e.languages.keyman={comment:/\bc\s.*/i,function:/\[\s*(?:(?:CTRL|SHIFT|ALT|LCTRL|RCTRL|LALT|RALT|CAPS|NCAPS)\s+)*(?:[TKU]_[\w?]+|".+?"|'.+?')\s*\]/i,string:/("|').*?\1/,bold:[/&(?:baselayout|bitmap|capsononly|capsalwaysoff|shiftfreescaps|copyright|ethnologuecode|hotkey|includecodes|keyboardversion|kmw_embedcss|kmw_embedjs|kmw_helpfile|kmw_helptext|kmw_rtl|language|layer|layoutfile|message|mnemoniclayout|name|oldcharposmatching|platform|targets|version|visualkeyboard|windowslanguages)\b/i,/\b(?:bitmap|bitmaps|caps on only|caps always off|shift frees caps|copyright|hotkey|language|layout|message|name|version)\b/i],keyword:/\b(?:any|baselayout|beep|call|context|deadkey|dk|if|index|layer|notany|nul|outs|platform|return|reset|save|set|store|use)\b/i,atrule:/\b(?:ansi|begin|unicode|group|using keys|match|nomatch)\b/i,number:/\b(?:U\+[\dA-F]+|d\d+|x[\da-f]+|\d+)\b/i,operator:/[+>\\,()]/,tag:/\$(?:keyman|kmfl|weaver|keymanweb|keymanonly):/i}}e.exports=t,t.displayName="keyman",t.aliases=[]},19715(e){"use strict";function t(e){var t,n;(t=e).languages.kotlin=t.languages.extend("clike",{keyword:{pattern:/(^|[^.])\b(?:abstract|actual|annotation|as|break|by|catch|class|companion|const|constructor|continue|crossinline|data|do|dynamic|else|enum|expect|external|final|finally|for|fun|get|if|import|in|infix|init|inline|inner|interface|internal|is|lateinit|noinline|null|object|open|operator|out|override|package|private|protected|public|reified|return|sealed|set|super|suspend|tailrec|this|throw|to|try|typealias|val|var|vararg|when|where|while)\b/,lookbehind:!0},function:[{pattern:/(?:`[^\r\n`]+`|\b\w+)(?=\s*\()/,greedy:!0},{pattern:/(\.)(?:`[^\r\n`]+`|\w+)(?=\s*\{)/,lookbehind:!0,greedy:!0}],number:/\b(?:0[xX][\da-fA-F]+(?:_[\da-fA-F]+)*|0[bB][01]+(?:_[01]+)*|\d+(?:_\d+)*(?:\.\d+(?:_\d+)*)?(?:[eE][+-]?\d+(?:_\d+)*)?[fFL]?)\b/,operator:/\+[+=]?|-[-=>]?|==?=?|!(?:!|==?)?|[\/*%<>]=?|[?:]:?|\.\.|&&|\|\||\b(?:and|inv|or|shl|shr|ushr|xor)\b/}),delete t.languages.kotlin["class-name"],t.languages.insertBefore("kotlin","string",{"raw-string":{pattern:/("""|''')[\s\S]*?\1/,alias:"string"}}),t.languages.insertBefore("kotlin","keyword",{annotation:{pattern:/\B@(?:\w+:)?(?:[A-Z]\w*|\[[^\]]+\])/,alias:"builtin"}}),t.languages.insertBefore("kotlin","function",{label:{pattern:/\b\w+@|@\w+\b/,alias:"symbol"}}),n=[{pattern:/\$\{[^}]+\}/,inside:{delimiter:{pattern:/^\$\{|\}$/,alias:"variable"},rest:t.languages.kotlin}},{pattern:/\$\w+/,alias:"variable"}],t.languages.kotlin.string.inside=t.languages.kotlin["raw-string"].inside={interpolation:n},t.languages.kt=t.languages.kotlin,t.languages.kts=t.languages.kotlin}e.exports=t,t.displayName="kotlin",t.aliases=["kt","kts"]},27614(e){"use strict";function t(e){!function(e){var t=/\s\x00-\x1f\x22-\x2f\x3a-\x3f\x5b-\x5e\x60\x7b-\x7e/.source;function n(e,n){return RegExp(e.replace(//g,t),n)}e.languages.kumir={comment:{pattern:/\|.*/},prolog:{pattern:/#.*/,greedy:!0},string:{pattern:/"[^\n\r"]*"|'[^\n\r']*'/,greedy:!0},boolean:{pattern:n(/(^|[])(?:да|нет)(?=[]|$)/.source),lookbehind:!0},"operator-word":{pattern:n(/(^|[])(?:и|или|не)(?=[]|$)/.source),lookbehind:!0,alias:"keyword"},"system-variable":{pattern:n(/(^|[])знач(?=[]|$)/.source),lookbehind:!0,alias:"keyword"},type:[{pattern:n(/(^|[])(?:вещ|лит|лог|сим|цел)(?:\x20*таб)?(?=[]|$)/.source),lookbehind:!0,alias:"builtin"},{pattern:n(/(^|[])(?:компл|сканкод|файл|цвет)(?=[]|$)/.source),lookbehind:!0,alias:"important"}],keyword:{pattern:n(/(^|[])(?:алг|арг(?:\x20*рез)?|ввод|ВКЛЮЧИТЬ|вс[её]|выбор|вывод|выход|дано|для|до|дс|если|иначе|исп|использовать|кон(?:(?:\x20+|_)исп)?|кц(?:(?:\x20+|_)при)?|надо|нач|нс|нц|от|пауза|пока|при|раза?|рез|стоп|таб|то|утв|шаг)(?=[]|$)/.source),lookbehind:!0},name:{pattern:n(/(^|[])[^\d][^]*(?:\x20+[^]+)*(?=[]|$)/.source),lookbehind:!0},number:{pattern:n(/(^|[])(?:\B\$[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)(?=[]|$)/.source,"i"),lookbehind:!0},punctuation:/:=|[(),:;\[\]]/,"operator-char":{pattern:/\*\*?|<[=>]?|>=?|[-+/=]/,alias:"operator"}},e.languages.kum=e.languages.kumir}(e)}e.exports=t,t.displayName="kumir",t.aliases=["kum"]},42876(e){"use strict";function t(e){var t,n,r;t=e,r={"equation-command":{pattern:n=/\\(?:[^a-z()[\]]|[a-z*]+)/i,alias:"regex"}},t.languages.latex={comment:/%.*/m,cdata:{pattern:/(\\begin\{((?:verbatim|lstlisting)\*?)\})[\s\S]*?(?=\\end\{\2\})/,lookbehind:!0},equation:[{pattern:/\$\$(?:\\[\s\S]|[^\\$])+\$\$|\$(?:\\[\s\S]|[^\\$])+\$|\\\([\s\S]*?\\\)|\\\[[\s\S]*?\\\]/,inside:r,alias:"string"},{pattern:/(\\begin\{((?:equation|math|eqnarray|align|multline|gather)\*?)\})[\s\S]*?(?=\\end\{\2\})/,lookbehind:!0,inside:r,alias:"string"}],keyword:{pattern:/(\\(?:begin|end|ref|cite|label|usepackage|documentclass)(?:\[[^\]]+\])?\{)[^}]+(?=\})/,lookbehind:!0},url:{pattern:/(\\url\{)[^}]+(?=\})/,lookbehind:!0},headline:{pattern:/(\\(?:part|chapter|section|subsection|frametitle|subsubsection|paragraph|subparagraph|subsubparagraph|subsubsubparagraph)\*?(?:\[[^\]]+\])?\{)[^}]+(?=\})/,lookbehind:!0,alias:"class-name"},function:{pattern:n,alias:"selector"},punctuation:/[[\]{}&]/},t.languages.tex=t.languages.latex,t.languages.context=t.languages.latex}e.exports=t,t.displayName="latex",t.aliases=["tex","context"]},2980(e,t,n){"use strict";var r=n(93205),i=n(88262);function a(e){var t,n;e.register(r),e.register(i),(t=e).languages.latte={comment:/^\{\*[\s\S]*/,ld:{pattern:/^\{(?:[=_]|\/?(?!\d|\w+\()\w+)?/,inside:{punctuation:/^\{\/?/,tag:{pattern:/.+/,alias:"important"}}},rd:{pattern:/\}$/,inside:{punctuation:/.+/}},php:{pattern:/\S(?:[\s\S]*\S)?/,alias:"language-php",inside:t.languages.php}},n=t.languages.extend("markup",{}),t.languages.insertBefore("inside","attr-value",{"n-attr":{pattern:/n:[\w-]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+))?/,inside:{"attr-name":{pattern:/^[^\s=]+/,alias:"important"},"attr-value":{pattern:/=[\s\S]+/,inside:{punctuation:[/^=/,{pattern:/^(\s*)["']|["']$/,lookbehind:!0}],php:{pattern:/\S(?:[\s\S]*\S)?/,inside:t.languages.php}}}}}},n.tag),t.hooks.add("before-tokenize",function(e){if("latte"===e.language){var r=/\{\*[\s\S]*?\*\}|\{[^'"\s{}*](?:[^"'/{}]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|\/\*(?:[^*]|\*(?!\/))*\*\/)*?\}/g;t.languages["markup-templating"].buildPlaceholders(e,"latte",r),e.grammar=n}}),t.hooks.add("after-tokenize",function(e){t.languages["markup-templating"].tokenizePlaceholders(e,"latte")})}e.exports=a,a.displayName="latte",a.aliases=[]},41701(e){"use strict";function t(e){e.languages.less=e.languages.extend("css",{comment:[/\/\*[\s\S]*?\*\//,{pattern:/(^|[^\\])\/\/.*/,lookbehind:!0}],atrule:{pattern:/@[\w-](?:\((?:[^(){}]|\([^(){}]*\))*\)|[^(){};\s]|\s+(?!\s))*?(?=\s*\{)/,inside:{punctuation:/[:()]/}},selector:{pattern:/(?:@\{[\w-]+\}|[^{};\s@])(?:@\{[\w-]+\}|\((?:[^(){}]|\([^(){}]*\))*\)|[^(){};@\s]|\s+(?!\s))*?(?=\s*\{)/,inside:{variable:/@+[\w-]+/}},property:/(?:@\{[\w-]+\}|[\w-])+(?:\+_?)?(?=\s*:)/i,operator:/[+\-*\/]/}),e.languages.insertBefore("less","property",{variable:[{pattern:/@[\w-]+\s*:/,inside:{punctuation:/:/}},/@@?[\w-]+/],"mixin-usage":{pattern:/([{;]\s*)[.#](?!\d)[\w-].*?(?=[(;])/,lookbehind:!0,alias:"function"}})}e.exports=t,t.displayName="less",t.aliases=[]},42491(e,t,n){"use strict";var r=n(9997);function i(e){e.register(r),function(e){for(var t=/\((?:[^();"#\\]|\\[\s\S]|;.*(?!.)|"(?:[^"\\]|\\.)*"|#(?:\{(?:(?!#\})[\s\S])*#\}|[^{])|)*\)/.source,n=5,r=0;r/g,function(){return t});t=t.replace(//g,/[^\s\S]/.source);var i=e.languages.lilypond={comment:/%(?:(?!\{).*|\{[\s\S]*?%\})/,"embedded-scheme":{pattern:RegExp(/(^|[=\s])#(?:"(?:[^"\\]|\\.)*"|[^\s()"]*(?:[^\s()]|))/.source.replace(//g,function(){return t}),"m"),lookbehind:!0,greedy:!0,inside:{scheme:{pattern:/^(#)[\s\S]+$/,lookbehind:!0,alias:"language-scheme",inside:{"embedded-lilypond":{pattern:/#\{[\s\S]*?#\}/,greedy:!0,inside:{punctuation:/^#\{|#\}$/,lilypond:{pattern:/[\s\S]+/,alias:"language-lilypond",inside:null}}},rest:e.languages.scheme}},punctuation:/#/}},string:{pattern:/"(?:[^"\\]|\\.)*"/,greedy:!0},"class-name":{pattern:/(\\new\s+)[\w-]+/,lookbehind:!0},keyword:{pattern:/\\[a-z][-\w]*/i,inside:{punctuation:/^\\/}},operator:/[=|]|<<|>>/,punctuation:{pattern:/(^|[a-z\d])(?:'+|,+|[_^]?-[_^]?(?:[-+^!>._]|(?=\d))|[_^]\.?|[.!])|[{}()[\]<>^~]|\\[()[\]<>\\!]|--|__/,lookbehind:!0},number:/\b\d+(?:\/\d+)?\b/};i["embedded-scheme"].inside.scheme.inside["embedded-lilypond"].inside.lilypond.inside=i,e.languages.ly=i}(e)}e.exports=i,i.displayName="lilypond",i.aliases=[]},34927(e,t,n){"use strict";var r=n(93205);function i(e){e.register(r),e.languages.liquid={comment:{pattern:/(^\{%\s*comment\s*%\})[\s\S]+(?=\{%\s*endcomment\s*%\}$)/,lookbehind:!0},delimiter:{pattern:/^\{(?:\{\{|[%\{])-?|-?(?:\}\}|[%\}])\}$/,alias:"punctuation"},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},keyword:/\b(?:as|assign|break|continue|cycle|decrement|echo|else|elsif|(?:end)?(?:capture|case|comment|for|form|if|paginate|style|raw|tablerow|unless)|in|include|increment|limit|liquid|offset|range|render|reversed|section|when|with)\b/,function:[{pattern:/(\|\s*)\w+/,lookbehind:!0,alias:"filter"},{pattern:/(\.\s*)(?:first|last|size)/,lookbehind:!0}],boolean:/\b(?:true|false|nil)\b/,range:{pattern:/\.\./,alias:"operator"},number:/\b\d+(?:\.\d+)?\b/,operator:/[!=]=|<>|[<>]=?|[|?:=-]|\b(?:and|or|contains(?=\s))\b/,punctuation:/[.,\[\]()]/},e.hooks.add("before-tokenize",function(t){var n=/\{%\s*comment\s*%\}[\s\S]*?\{%\s*endcomment\s*%\}|\{(?:%[\s\S]*?%|\{\{[\s\S]*?\}\}|\{[\s\S]*?\})\}/g,r=!1;e.languages["markup-templating"].buildPlaceholders(t,"liquid",n,function(e){var t=/^\{%-?\s*(\w+)/.exec(e);if(t){var n=t[1];if("raw"===n&&!r)return r=!0,!0;if("endraw"===n)return r=!1,!0}return!r})}),e.hooks.add("after-tokenize",function(t){e.languages["markup-templating"].tokenizePlaceholders(t,"liquid")})}e.exports=i,i.displayName="liquid",i.aliases=[]},3848(e){"use strict";function t(e){!function(e){function t(e){return RegExp("(\\()"+e+"(?=[\\s\\)])")}function n(e){return RegExp("([\\s([])"+e+"(?=[\\s)])")}var r="[-+*/_~!@$%^=<>{}\\w]+",i="&"+r,a="(\\()",o="(?=\\))",s="(?=\\s)",u={heading:{pattern:/;;;.*/,alias:["comment","title"]},comment:/;.*/,string:{pattern:/"(?:[^"\\]|\\.)*"/,greedy:!0,inside:{argument:/[-A-Z]+(?=[.,\s])/,symbol:RegExp("`"+r+"'")}},"quoted-symbol":{pattern:RegExp("#?'"+r),alias:["variable","symbol"]},"lisp-property":{pattern:RegExp(":"+r),alias:"property"},splice:{pattern:RegExp(",@?"+r),alias:["symbol","variable"]},keyword:[{pattern:RegExp(a+"(?:(?:lexical-)?let\\*?|(?:cl-)?letf|if|when|while|unless|cons|cl-loop|and|or|not|cond|setq|error|message|null|require|provide|use-package)"+s),lookbehind:!0},{pattern:RegExp(a+"(?:for|do|collect|return|finally|append|concat|in|by)"+s),lookbehind:!0}],declare:{pattern:t("declare"),lookbehind:!0,alias:"keyword"},interactive:{pattern:t("interactive"),lookbehind:!0,alias:"keyword"},boolean:{pattern:n("(?:t|nil)"),lookbehind:!0},number:{pattern:n("[-+]?\\d+(?:\\.\\d*)?"),lookbehind:!0},defvar:{pattern:RegExp(a+"def(?:var|const|custom|group)\\s+"+r),lookbehind:!0,inside:{keyword:/^def[a-z]+/,variable:RegExp(r)}},defun:{pattern:RegExp(a+"(?:cl-)?(?:defun\\*?|defmacro)\\s+"+r+"\\s+\\([\\s\\S]*?\\)"),lookbehind:!0,inside:{keyword:/^(?:cl-)?def\S+/,arguments:null,function:{pattern:RegExp("(^\\s)"+r),lookbehind:!0},punctuation:/[()]/}},lambda:{pattern:RegExp(a+"lambda\\s+\\(\\s*(?:&?"+r+"(?:\\s+&?"+r+")*\\s*)?\\)"),lookbehind:!0,inside:{keyword:/^lambda/,arguments:null,punctuation:/[()]/}},car:{pattern:RegExp(a+r),lookbehind:!0},punctuation:[/(?:['`,]?\(|[)\[\]])/,{pattern:/(\s)\.(?=\s)/,lookbehind:!0}]},c={"lisp-marker":RegExp(i),rest:{argument:{pattern:RegExp(r),alias:"variable"},varform:{pattern:RegExp(a+r+"\\s+\\S[\\s\\S]*"+o),lookbehind:!0,inside:{string:u.string,boolean:u.boolean,number:u.number,symbol:u.symbol,punctuation:/[()]/}}}},l="\\S+(?:\\s+\\S+)*",f={pattern:RegExp(a+"[\\s\\S]*"+o),lookbehind:!0,inside:{"rest-vars":{pattern:RegExp("&(?:rest|body)\\s+"+l),inside:c},"other-marker-vars":{pattern:RegExp("&(?:optional|aux)\\s+"+l),inside:c},keys:{pattern:RegExp("&key\\s+"+l+"(?:\\s+&allow-other-keys)?"),inside:c},argument:{pattern:RegExp(r),alias:"variable"},punctuation:/[()]/}};u.lambda.inside.arguments=f,u.defun.inside.arguments=e.util.clone(f),u.defun.inside.arguments.inside.sublist=f,e.languages.lisp=u,e.languages.elisp=u,e.languages.emacs=u,e.languages["emacs-lisp"]=u}(e)}e.exports=t,t.displayName="lisp",t.aliases=[]},41469(e){"use strict";function t(e){e.languages.livescript={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?\*\//,lookbehind:!0},{pattern:/(^|[^\\])#.*/,lookbehind:!0}],"interpolated-string":{pattern:/(^|[^"])("""|")(?:\\[\s\S]|(?!\2)[^\\])*\2(?!")/,lookbehind:!0,greedy:!0,inside:{variable:{pattern:/(^|[^\\])#[a-z_](?:-?[a-z]|[\d_])*/m,lookbehind:!0},interpolation:{pattern:/(^|[^\\])#\{[^}]+\}/m,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^#\{|\}$/,alias:"variable"}}},string:/[\s\S]+/}},string:[{pattern:/('''|')(?:\\[\s\S]|(?!\1)[^\\])*\1/,greedy:!0},{pattern:/<\[[\s\S]*?\]>/,greedy:!0},/\\[^\s,;\])}]+/],regex:[{pattern:/\/\/(?:\[[^\r\n\]]*\]|\\.|(?!\/\/)[^\\\[])+\/\/[gimyu]{0,5}/,greedy:!0,inside:{comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0}}},{pattern:/\/(?:\[[^\r\n\]]*\]|\\.|[^/\\\r\n\[])+\/[gimyu]{0,5}/,greedy:!0}],keyword:{pattern:/(^|(?!-).)\b(?:break|case|catch|class|const|continue|default|do|else|extends|fallthrough|finally|for(?: ever)?|function|if|implements|it|let|loop|new|null|otherwise|own|return|super|switch|that|then|this|throw|try|unless|until|var|void|when|while|yield)(?!-)\b/m,lookbehind:!0},"keyword-operator":{pattern:/(^|[^-])\b(?:(?:delete|require|typeof)!|(?:and|by|delete|export|from|import(?: all)?|in|instanceof|is(?:nt| not)?|not|of|or|til|to|typeof|with|xor)(?!-)\b)/m,lookbehind:!0,alias:"operator"},boolean:{pattern:/(^|[^-])\b(?:false|no|off|on|true|yes)(?!-)\b/m,lookbehind:!0},argument:{pattern:/(^|(?!\.&\.)[^&])&(?!&)\d*/m,lookbehind:!0,alias:"variable"},number:/\b(?:\d+~[\da-z]+|\d[\d_]*(?:\.\d[\d_]*)?(?:[a-z]\w*)?)/i,identifier:/[a-z_](?:-?[a-z]|[\d_])*/i,operator:[{pattern:/( )\.(?= )/,lookbehind:!0},/\.(?:[=~]|\.\.?)|\.(?:[&|^]|<<|>>>?)\.|:(?:=|:=?)|&&|\|[|>]|<(?:<[>=?]?|-(?:->?|>)?|\+\+?|@@?|%%?|\*\*?|!(?:~?=|--?>|~?~>)?|~(?:~?>|=)?|==?|\^\^?|[\/?]/],punctuation:/[(){}\[\]|.,:;`]/},e.languages.livescript["interpolated-string"].inside.interpolation.inside.rest=e.languages.livescript}e.exports=t,t.displayName="livescript",t.aliases=[]},73070(e){"use strict";function t(e){var t;(t=e).languages.llvm={comment:/;.*/,string:{pattern:/"[^"]*"/,greedy:!0},boolean:/\b(?:true|false)\b/,variable:/[%@!#](?:(?!\d)(?:[-$.\w]|\\[a-f\d]{2})+|\d+)/i,label:/(?!\d)(?:[-$.\w]|\\[a-f\d]{2})+:/i,type:{pattern:/\b(?:double|float|fp128|half|i[1-9]\d*|label|metadata|ppc_fp128|token|void|x86_fp80|x86_mmx)\b/,alias:"class-name"},keyword:/\b[a-z_][a-z_0-9]*\b/,number:/[+-]?\b\d+(?:\.\d+)?(?:[eE][+-]?\d+)?\b|\b0x[\dA-Fa-f]+\b|\b0xK[\dA-Fa-f]{20}\b|\b0x[ML][\dA-Fa-f]{32}\b|\b0xH[\dA-Fa-f]{4}\b/,punctuation:/[{}[\];(),.!*=<>]/}}e.exports=t,t.displayName="llvm",t.aliases=[]},35049(e){"use strict";function t(e){e.languages.log={string:{pattern:/"(?:[^"\\\r\n]|\\.)*"|'(?![st] | \w)(?:[^'\\\r\n]|\\.)*'/,greedy:!0},level:[{pattern:/\b(?:ALERT|CRIT|CRITICAL|EMERG|EMERGENCY|ERR|ERROR|FAILURE|FATAL|SEVERE)\b/,alias:["error","important"]},{pattern:/\b(?:WARN|WARNING|WRN)\b/,alias:["warning","important"]},{pattern:/\b(?:DISPLAY|INF|INFO|NOTICE|STATUS)\b/,alias:["info","keyword"]},{pattern:/\b(?:DBG|DEBUG|FINE)\b/,alias:["debug","keyword"]},{pattern:/\b(?:FINER|FINEST|TRACE|TRC|VERBOSE|VRB)\b/,alias:["trace","comment"]}],property:{pattern:/((?:^|[\]|])[ \t]*)[a-z_](?:[\w-]|\b\/\b)*(?:[. ]\(?\w(?:[\w-]|\b\/\b)*\)?)*:(?=\s)/im,lookbehind:!0},separator:{pattern:/(^|[^-+])-{3,}|={3,}|\*{3,}|- - /m,lookbehind:!0,alias:"comment"},url:/\b(?:https?|ftp|file):\/\/[^\s|,;'"]*[^\s|,;'">.]/,email:{pattern:/(^|\s)[-\w+.]+@[a-z][a-z0-9-]*(?:\.[a-z][a-z0-9-]*)+(?=\s)/,lookbehind:!0,alias:"url"},"ip-address":{pattern:/\b(?:\d{1,3}(?:\.\d{1,3}){3})\b/i,alias:"constant"},"mac-address":{pattern:/\b[a-f0-9]{2}(?::[a-f0-9]{2}){5}\b/i,alias:"constant"},domain:{pattern:/(^|\s)[a-z][a-z0-9-]*(?:\.[a-z][a-z0-9-]*)*\.[a-z][a-z0-9-]+(?=\s)/,lookbehind:!0,alias:"constant"},uuid:{pattern:/\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/i,alias:"constant"},hash:{pattern:/\b(?:[a-f0-9]{32}){1,2}\b/i,alias:"constant"},"file-path":{pattern:/\b[a-z]:[\\/][^\s|,;:(){}\[\]"']+|(^|[\s:\[\](>|])\.{0,2}\/\w[^\s|,;:(){}\[\]"']*/i,lookbehind:!0,greedy:!0,alias:"string"},date:{pattern:RegExp(/\b\d{4}[-/]\d{2}[-/]\d{2}(?:T(?=\d{1,2}:)|(?=\s\d{1,2}:))/.source+"|"+/\b\d{1,4}[-/ ](?:\d{1,2}|Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)[-/ ]\d{2,4}T?\b/.source+"|"+/\b(?:(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun)(?:\s{1,2}(?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec))?|Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s{1,2}\d{1,2}\b/.source,"i"),alias:"number"},time:{pattern:/\b\d{1,2}:\d{1,2}:\d{1,2}(?:[.,:]\d+)?(?:\s?[+-]\d{2}:?\d{2}|Z)?\b/,alias:"number"},boolean:/\b(?:true|false|null)\b/i,number:{pattern:/(^|[^.\w])(?:0x[a-f0-9]+|0o[0-7]+|0b[01]+|v?\d[\da-f]*(?:\.\d+)*(?:e[+-]?\d+)?[a-z]{0,3}\b)\b(?!\.\w)/i,lookbehind:!0},operator:/[;:?<=>~/@!$%&+\-|^(){}*#]/,punctuation:/[\[\].,]/}}e.exports=t,t.displayName="log",t.aliases=[]},8789(e){"use strict";function t(e){e.languages.lolcode={comment:[/\bOBTW\s[\s\S]*?\sTLDR\b/,/\bBTW.+/],string:{pattern:/"(?::.|[^":])*"/,inside:{variable:/:\{[^}]+\}/,symbol:[/:\([a-f\d]+\)/i,/:\[[^\]]+\]/,/:[)>o":]/]},greedy:!0},number:/(?:\B-)?(?:\b\d+(?:\.\d*)?|\B\.\d+)/,symbol:{pattern:/(^|\s)(?:A )?(?:YARN|NUMBR|NUMBAR|TROOF|BUKKIT|NOOB)(?=\s|,|$)/,lookbehind:!0,inside:{keyword:/A(?=\s)/}},label:{pattern:/((?:^|\s)(?:IM IN YR|IM OUTTA YR) )[a-zA-Z]\w*/,lookbehind:!0,alias:"string"},function:{pattern:/((?:^|\s)(?:I IZ|HOW IZ I|IZ) )[a-zA-Z]\w*/,lookbehind:!0},keyword:[{pattern:/(^|\s)(?:O HAI IM|KTHX|HAI|KTHXBYE|I HAS A|ITZ(?: A)?|R|AN|MKAY|SMOOSH|MAEK|IS NOW(?: A)?|VISIBLE|GIMMEH|O RLY\?|YA RLY|NO WAI|OIC|MEBBE|WTF\?|OMG|OMGWTF|GTFO|IM IN YR|IM OUTTA YR|FOUND YR|YR|TIL|WILE|UPPIN|NERFIN|I IZ|HOW IZ I|IF U SAY SO|SRS|HAS A|LIEK(?: A)?|IZ)(?=\s|,|$)/,lookbehind:!0},/'Z(?=\s|,|$)/],boolean:{pattern:/(^|\s)(?:WIN|FAIL)(?=\s|,|$)/,lookbehind:!0},variable:{pattern:/(^|\s)IT(?=\s|,|$)/,lookbehind:!0},operator:{pattern:/(^|\s)(?:NOT|BOTH SAEM|DIFFRINT|(?:SUM|DIFF|PRODUKT|QUOSHUNT|MOD|BIGGR|SMALLR|BOTH|EITHER|WON|ALL|ANY) OF)(?=\s|,|$)/,lookbehind:!0},punctuation:/\.{3}|…|,|!/}}e.exports=t,t.displayName="lolcode",t.aliases=[]},59803(e){"use strict";function t(e){e.languages.lua={comment:/^#!.+|--(?:\[(=*)\[[\s\S]*?\]\1\]|.*)/m,string:{pattern:/(["'])(?:(?!\1)[^\\\r\n]|\\z(?:\r\n|\s)|\\(?:\r\n|[^z]))*\1|\[(=*)\[[\s\S]*?\]\2\]/,greedy:!0},number:/\b0x[a-f\d]+(?:\.[a-f\d]*)?(?:p[+-]?\d+)?\b|\b\d+(?:\.\B|(?:\.\d*)?(?:e[+-]?\d+)?\b)|\B\.\d+(?:e[+-]?\d+)?\b/i,keyword:/\b(?:and|break|do|else|elseif|end|false|for|function|goto|if|in|local|nil|not|or|repeat|return|then|true|until|while)\b/,function:/(?!\d)\w+(?=\s*(?:[({]))/,operator:[/[-+*%^&|#]|\/\/?|<[<=]?|>[>=]?|[=~]=?/,{pattern:/(^|[^.])\.\.(?!\.)/,lookbehind:!0}],punctuation:/[\[\](){},;]|\.+|:+/}}e.exports=t,t.displayName="lua",t.aliases=[]},33055(e){"use strict";function t(e){e.languages.makefile={comment:{pattern:/(^|[^\\])#(?:\\(?:\r\n|[\s\S])|[^\\\r\n])*/,lookbehind:!0},string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},builtin:/\.[A-Z][^:#=\s]+(?=\s*:(?!=))/,symbol:{pattern:/^(?:[^:=\s]|[ \t]+(?![\s:]))+(?=\s*:(?!=))/m,inside:{variable:/\$+(?:(?!\$)[^(){}:#=\s]+|(?=[({]))/}},variable:/\$+(?:(?!\$)[^(){}:#=\s]+|\([@*%<^+?][DF]\)|(?=[({]))/,keyword:[/-include\b|\b(?:define|else|endef|endif|export|ifn?def|ifn?eq|include|override|private|sinclude|undefine|unexport|vpath)\b/,{pattern:/(\()(?:addsuffix|abspath|and|basename|call|dir|error|eval|file|filter(?:-out)?|findstring|firstword|flavor|foreach|guile|if|info|join|lastword|load|notdir|or|origin|patsubst|realpath|shell|sort|strip|subst|suffix|value|warning|wildcard|word(?:s|list)?)(?=[ \t])/,lookbehind:!0}],operator:/(?:::|[?:+!])?=|[|@]/,punctuation:/[:;(){}]/}}e.exports=t,t.displayName="makefile",t.aliases=[]},90542(e){"use strict";function t(e){!function(e){var t=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function n(e){return e=e.replace(//g,function(){return t}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+e+")")}var r=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,i=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return r}),a=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;e.languages.markdown=e.languages.extend("markup",{}),e.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"font-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:e.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+i+a+"(?:"+i+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+i+a+")(?:"+i+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(r),inside:e.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+i+")"+a+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+i+"$"),inside:{"table-header":{pattern:RegExp(r),alias:"important",inside:e.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:n(/\b__(?:(?!_)|_(?:(?!_))+_)+__\b|\*\*(?:(?!\*)|\*(?:(?!\*))+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:n(/\b_(?:(?!_)|__(?:(?!_))+__)+_\b|\*(?:(?!\*)|\*\*(?:(?!\*))+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:n(/(~~?)(?:(?!~))+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:n(/!?\[(?:(?!\]))+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\]))+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach(function(t){["url","bold","italic","strike","code-snippet"].forEach(function(n){t!==n&&(e.languages.markdown[t].inside.content.inside[n]=e.languages.markdown[n])})}),e.hooks.add("after-tokenize",function(e){("markdown"===e.language||"md"===e.language)&&t(e.tokens);function t(e){if(e&&"string"!=typeof e)for(var n=0,r=e.length;n=a.length);u++){var c=s[u];if("string"==typeof c||c.content&&"string"==typeof c.content){var l=a[i],f=n.tokenStack[l],d="string"==typeof c?c:c.content,h=t(r,l),p=d.indexOf(h);if(p>-1){++i;var b=d.substring(0,p),m=new e.Token(r,e.tokenize(f,n.grammar),"language-"+r,f),g=d.substring(p+h.length),v=[];b&&v.push.apply(v,o([b])),v.push(m),g&&v.push.apply(v,o([g])),"string"==typeof c?s.splice.apply(s,[u,1].concat(v)):c.content=v}}else c.content&&o(c.content)}return s}}}})}(e)}e.exports=t,t.displayName="markupTemplating",t.aliases=[]},2717(e){"use strict";function t(e){e.languages.markup={comment://,prolog:/<\?[\s\S]+?\?>/,doctype:{pattern:/"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^$|[[\]]/,"doctype-tag":/^DOCTYPE/,name:/[^\s<>'"]+/}},cdata://i,tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},e.languages.markup.tag.inside["attr-value"].inside.entity=e.languages.markup.entity,e.languages.markup.doctype.inside["internal-subset"].inside=e.languages.markup,e.hooks.add("wrap",function(e){"entity"===e.type&&(e.attributes.title=e.content.value.replace(/&/,"&"))}),Object.defineProperty(e.languages.markup.tag,"addInlined",{value:function(t,n){var r={};r["language-"+n]={pattern:/(^$)/i,lookbehind:!0,inside:e.languages[n]},r.cdata=/^$/i;var i={"included-cdata":{pattern://i,inside:r}};i["language-"+n]={pattern:/[\s\S]+/,inside:e.languages[n]};var a={};a[t]={pattern:RegExp(/(<__[^>]*>)(?:))*\]\]>|(?!)/.source.replace(/__/g,function(){return t}),"i"),lookbehind:!0,greedy:!0,inside:i},e.languages.insertBefore("markup","cdata",a)}}),Object.defineProperty(e.languages.markup.tag,"addAttribute",{value:function(t,n){e.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+t+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[n,"language-"+n],inside:e.languages[n]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),e.languages.html=e.languages.markup,e.languages.mathml=e.languages.markup,e.languages.svg=e.languages.markup,e.languages.xml=e.languages.extend("markup",{}),e.languages.ssml=e.languages.xml,e.languages.atom=e.languages.xml,e.languages.rss=e.languages.xml}e.exports=t,t.displayName="markup",t.aliases=["html","mathml","svg","xml","ssml","atom","rss"]},27992(e){"use strict";function t(e){e.languages.matlab={comment:[/%\{[\s\S]*?\}%/,/%.+/],string:{pattern:/\B'(?:''|[^'\r\n])*'/,greedy:!0},number:/(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[eE][+-]?\d+)?(?:[ij])?|\b[ij]\b/,keyword:/\b(?:break|case|catch|continue|else|elseif|end|for|function|if|inf|NaN|otherwise|parfor|pause|pi|return|switch|try|while)\b/,function:/\b(?!\d)\w+(?=\s*\()/,operator:/\.?[*^\/\\']|[+\-:@]|[<>=~]=?|&&?|\|\|?/,punctuation:/\.{3}|[.,;\[\](){}!]/}}e.exports=t,t.displayName="matlab",t.aliases=[]},606(e){"use strict";function t(e){e.languages.mel={comment:/\/\/.*/,code:{pattern:/`(?:\\.|[^\\`\r\n])*`/,greedy:!0,alias:"italic",inside:{delimiter:{pattern:/^`|`$/,alias:"punctuation"}}},string:{pattern:/"(?:\\.|[^\\"\r\n])*"/,greedy:!0},variable:/\$\w+/,number:/\b0x[\da-fA-F]+\b|\b\d+(?:\.\d*)?|\B\.\d+/,flag:{pattern:/-[^\d\W]\w*/,alias:"operator"},keyword:/\b(?:break|case|continue|default|do|else|float|for|global|if|in|int|matrix|proc|return|string|switch|vector|while)\b/,function:/\b\w+(?=\()|\b(?:about|abs|addAttr|addAttributeEditorNodeHelp|addDynamic|addNewShelfTab|addPP|addPanelCategory|addPrefixToName|advanceToNextDrivenKey|affectedNet|affects|aimConstraint|air|alias|aliasAttr|align|alignCtx|alignCurve|alignSurface|allViewFit|ambientLight|angle|angleBetween|animCone|animCurveEditor|animDisplay|animView|annotate|appendStringArray|applicationName|applyAttrPreset|applyTake|arcLenDimContext|arcLengthDimension|arclen|arrayMapper|art3dPaintCtx|artAttrCtx|artAttrPaintVertexCtx|artAttrSkinPaintCtx|artAttrTool|artBuildPaintMenu|artFluidAttrCtx|artPuttyCtx|artSelectCtx|artSetPaintCtx|artUserPaintCtx|assignCommand|assignInputDevice|assignViewportFactories|attachCurve|attachDeviceAttr|attachSurface|attrColorSliderGrp|attrCompatibility|attrControlGrp|attrEnumOptionMenu|attrEnumOptionMenuGrp|attrFieldGrp|attrFieldSliderGrp|attrNavigationControlGrp|attrPresetEditWin|attributeExists|attributeInfo|attributeMenu|attributeQuery|autoKeyframe|autoPlace|bakeClip|bakeFluidShading|bakePartialHistory|bakeResults|bakeSimulation|basename|basenameEx|batchRender|bessel|bevel|bevelPlus|binMembership|bindSkin|blend2|blendShape|blendShapeEditor|blendShapePanel|blendTwoAttr|blindDataType|boneLattice|boundary|boxDollyCtx|boxZoomCtx|bufferCurve|buildBookmarkMenu|buildKeyframeMenu|button|buttonManip|CBG|cacheFile|cacheFileCombine|cacheFileMerge|cacheFileTrack|camera|cameraView|canCreateManip|canvas|capitalizeString|catch|catchQuiet|ceil|changeSubdivComponentDisplayLevel|changeSubdivRegion|channelBox|character|characterMap|characterOutlineEditor|characterize|chdir|checkBox|checkBoxGrp|checkDefaultRenderGlobals|choice|circle|circularFillet|clamp|clear|clearCache|clip|clipEditor|clipEditorCurrentTimeCtx|clipSchedule|clipSchedulerOutliner|clipTrimBefore|closeCurve|closeSurface|cluster|cmdFileOutput|cmdScrollFieldExecuter|cmdScrollFieldReporter|cmdShell|coarsenSubdivSelectionList|collision|color|colorAtPoint|colorEditor|colorIndex|colorIndexSliderGrp|colorSliderButtonGrp|colorSliderGrp|columnLayout|commandEcho|commandLine|commandPort|compactHairSystem|componentEditor|compositingInterop|computePolysetVolume|condition|cone|confirmDialog|connectAttr|connectControl|connectDynamic|connectJoint|connectionInfo|constrain|constrainValue|constructionHistory|container|containsMultibyte|contextInfo|control|convertFromOldLayers|convertIffToPsd|convertLightmap|convertSolidTx|convertTessellation|convertUnit|copyArray|copyFlexor|copyKey|copySkinWeights|cos|cpButton|cpCache|cpClothSet|cpCollision|cpConstraint|cpConvClothToMesh|cpForces|cpGetSolverAttr|cpPanel|cpProperty|cpRigidCollisionFilter|cpSeam|cpSetEdit|cpSetSolverAttr|cpSolver|cpSolverTypes|cpTool|cpUpdateClothUVs|createDisplayLayer|createDrawCtx|createEditor|createLayeredPsdFile|createMotionField|createNewShelf|createNode|createRenderLayer|createSubdivRegion|cross|crossProduct|ctxAbort|ctxCompletion|ctxEditMode|ctxTraverse|currentCtx|currentTime|currentTimeCtx|currentUnit|curve|curveAddPtCtx|curveCVCtx|curveEPCtx|curveEditorCtx|curveIntersect|curveMoveEPCtx|curveOnSurface|curveSketchCtx|cutKey|cycleCheck|cylinder|dagPose|date|defaultLightListCheckBox|defaultNavigation|defineDataServer|defineVirtualDevice|deformer|deg_to_rad|delete|deleteAttr|deleteShadingGroupsAndMaterials|deleteShelfTab|deleteUI|deleteUnusedBrushes|delrandstr|detachCurve|detachDeviceAttr|detachSurface|deviceEditor|devicePanel|dgInfo|dgdirty|dgeval|dgtimer|dimWhen|directKeyCtx|directionalLight|dirmap|dirname|disable|disconnectAttr|disconnectJoint|diskCache|displacementToPoly|displayAffected|displayColor|displayCull|displayLevelOfDetail|displayPref|displayRGBColor|displaySmoothness|displayStats|displayString|displaySurface|distanceDimContext|distanceDimension|doBlur|dolly|dollyCtx|dopeSheetEditor|dot|dotProduct|doubleProfileBirailSurface|drag|dragAttrContext|draggerContext|dropoffLocator|duplicate|duplicateCurve|duplicateSurface|dynCache|dynControl|dynExport|dynExpression|dynGlobals|dynPaintEditor|dynParticleCtx|dynPref|dynRelEdPanel|dynRelEditor|dynamicLoad|editAttrLimits|editDisplayLayerGlobals|editDisplayLayerMembers|editRenderLayerAdjustment|editRenderLayerGlobals|editRenderLayerMembers|editor|editorTemplate|effector|emit|emitter|enableDevice|encodeString|endString|endsWith|env|equivalent|equivalentTol|erf|error|eval|evalDeferred|evalEcho|event|exactWorldBoundingBox|exclusiveLightCheckBox|exec|executeForEachObject|exists|exp|expression|expressionEditorListen|extendCurve|extendSurface|extrude|fcheck|fclose|feof|fflush|fgetline|fgetword|file|fileBrowserDialog|fileDialog|fileExtension|fileInfo|filetest|filletCurve|filter|filterCurve|filterExpand|filterStudioImport|findAllIntersections|findAnimCurves|findKeyframe|findMenuItem|findRelatedSkinCluster|finder|firstParentOf|fitBspline|flexor|floatEq|floatField|floatFieldGrp|floatScrollBar|floatSlider|floatSlider2|floatSliderButtonGrp|floatSliderGrp|floor|flow|fluidCacheInfo|fluidEmitter|fluidVoxelInfo|flushUndo|fmod|fontDialog|fopen|formLayout|format|fprint|frameLayout|fread|freeFormFillet|frewind|fromNativePath|fwrite|gamma|gauss|geometryConstraint|getApplicationVersionAsFloat|getAttr|getClassification|getDefaultBrush|getFileList|getFluidAttr|getInputDeviceRange|getMayaPanelTypes|getModifiers|getPanel|getParticleAttr|getPluginResource|getenv|getpid|glRender|glRenderEditor|globalStitch|gmatch|goal|gotoBindPose|grabColor|gradientControl|gradientControlNoAttr|graphDollyCtx|graphSelectContext|graphTrackCtx|gravity|grid|gridLayout|group|groupObjectsByName|HfAddAttractorToAS|HfAssignAS|HfBuildEqualMap|HfBuildFurFiles|HfBuildFurImages|HfCancelAFR|HfConnectASToHF|HfCreateAttractor|HfDeleteAS|HfEditAS|HfPerformCreateAS|HfRemoveAttractorFromAS|HfSelectAttached|HfSelectAttractors|HfUnAssignAS|hardenPointCurve|hardware|hardwareRenderPanel|headsUpDisplay|headsUpMessage|help|helpLine|hermite|hide|hilite|hitTest|hotBox|hotkey|hotkeyCheck|hsv_to_rgb|hudButton|hudSlider|hudSliderButton|hwReflectionMap|hwRender|hwRenderLoad|hyperGraph|hyperPanel|hyperShade|hypot|iconTextButton|iconTextCheckBox|iconTextRadioButton|iconTextRadioCollection|iconTextScrollList|iconTextStaticLabel|ikHandle|ikHandleCtx|ikHandleDisplayScale|ikSolver|ikSplineHandleCtx|ikSystem|ikSystemInfo|ikfkDisplayMethod|illustratorCurves|image|imfPlugins|inheritTransform|insertJoint|insertJointCtx|insertKeyCtx|insertKnotCurve|insertKnotSurface|instance|instanceable|instancer|intField|intFieldGrp|intScrollBar|intSlider|intSliderGrp|interToUI|internalVar|intersect|iprEngine|isAnimCurve|isConnected|isDirty|isParentOf|isSameObject|isTrue|isValidObjectName|isValidString|isValidUiName|isolateSelect|itemFilter|itemFilterAttr|itemFilterRender|itemFilterType|joint|jointCluster|jointCtx|jointDisplayScale|jointLattice|keyTangent|keyframe|keyframeOutliner|keyframeRegionCurrentTimeCtx|keyframeRegionDirectKeyCtx|keyframeRegionDollyCtx|keyframeRegionInsertKeyCtx|keyframeRegionMoveKeyCtx|keyframeRegionScaleKeyCtx|keyframeRegionSelectKeyCtx|keyframeRegionSetKeyCtx|keyframeRegionTrackCtx|keyframeStats|lassoContext|lattice|latticeDeformKeyCtx|launch|launchImageEditor|layerButton|layeredShaderPort|layeredTexturePort|layout|layoutDialog|lightList|lightListEditor|lightListPanel|lightlink|lineIntersection|linearPrecision|linstep|listAnimatable|listAttr|listCameras|listConnections|listDeviceAttachments|listHistory|listInputDeviceAxes|listInputDeviceButtons|listInputDevices|listMenuAnnotation|listNodeTypes|listPanelCategories|listRelatives|listSets|listTransforms|listUnselected|listerEditor|loadFluid|loadNewShelf|loadPlugin|loadPluginLanguageResources|loadPrefObjects|localizedPanelLabel|lockNode|loft|log|longNameOf|lookThru|ls|lsThroughFilter|lsType|lsUI|Mayatomr|mag|makeIdentity|makeLive|makePaintable|makeRoll|makeSingleSurface|makeTubeOn|makebot|manipMoveContext|manipMoveLimitsCtx|manipOptions|manipRotateContext|manipRotateLimitsCtx|manipScaleContext|manipScaleLimitsCtx|marker|match|max|memory|menu|menuBarLayout|menuEditor|menuItem|menuItemToShelf|menuSet|menuSetPref|messageLine|min|minimizeApp|mirrorJoint|modelCurrentTimeCtx|modelEditor|modelPanel|mouse|movIn|movOut|move|moveIKtoFK|moveKeyCtx|moveVertexAlongDirection|multiProfileBirailSurface|mute|nParticle|nameCommand|nameField|namespace|namespaceInfo|newPanelItems|newton|nodeCast|nodeIconButton|nodeOutliner|nodePreset|nodeType|noise|nonLinear|normalConstraint|normalize|nurbsBoolean|nurbsCopyUVSet|nurbsCube|nurbsEditUV|nurbsPlane|nurbsSelect|nurbsSquare|nurbsToPoly|nurbsToPolygonsPref|nurbsToSubdiv|nurbsToSubdivPref|nurbsUVSet|nurbsViewDirectionVector|objExists|objectCenter|objectLayer|objectType|objectTypeUI|obsoleteProc|oceanNurbsPreviewPlane|offsetCurve|offsetCurveOnSurface|offsetSurface|openGLExtension|openMayaPref|optionMenu|optionMenuGrp|optionVar|orbit|orbitCtx|orientConstraint|outlinerEditor|outlinerPanel|overrideModifier|paintEffectsDisplay|pairBlend|palettePort|paneLayout|panel|panelConfiguration|panelHistory|paramDimContext|paramDimension|paramLocator|parent|parentConstraint|particle|particleExists|particleInstancer|particleRenderInfo|partition|pasteKey|pathAnimation|pause|pclose|percent|performanceOptions|pfxstrokes|pickWalk|picture|pixelMove|planarSrf|plane|play|playbackOptions|playblast|plugAttr|plugNode|pluginInfo|pluginResourceUtil|pointConstraint|pointCurveConstraint|pointLight|pointMatrixMult|pointOnCurve|pointOnSurface|pointPosition|poleVectorConstraint|polyAppend|polyAppendFacetCtx|polyAppendVertex|polyAutoProjection|polyAverageNormal|polyAverageVertex|polyBevel|polyBlendColor|polyBlindData|polyBoolOp|polyBridgeEdge|polyCacheMonitor|polyCheck|polyChipOff|polyClipboard|polyCloseBorder|polyCollapseEdge|polyCollapseFacet|polyColorBlindData|polyColorDel|polyColorPerVertex|polyColorSet|polyCompare|polyCone|polyCopyUV|polyCrease|polyCreaseCtx|polyCreateFacet|polyCreateFacetCtx|polyCube|polyCut|polyCutCtx|polyCylinder|polyCylindricalProjection|polyDelEdge|polyDelFacet|polyDelVertex|polyDuplicateAndConnect|polyDuplicateEdge|polyEditUV|polyEditUVShell|polyEvaluate|polyExtrudeEdge|polyExtrudeFacet|polyExtrudeVertex|polyFlipEdge|polyFlipUV|polyForceUV|polyGeoSampler|polyHelix|polyInfo|polyInstallAction|polyLayoutUV|polyListComponentConversion|polyMapCut|polyMapDel|polyMapSew|polyMapSewMove|polyMergeEdge|polyMergeEdgeCtx|polyMergeFacet|polyMergeFacetCtx|polyMergeUV|polyMergeVertex|polyMirrorFace|polyMoveEdge|polyMoveFacet|polyMoveFacetUV|polyMoveUV|polyMoveVertex|polyNormal|polyNormalPerVertex|polyNormalizeUV|polyOptUvs|polyOptions|polyOutput|polyPipe|polyPlanarProjection|polyPlane|polyPlatonicSolid|polyPoke|polyPrimitive|polyPrism|polyProjection|polyPyramid|polyQuad|polyQueryBlindData|polyReduce|polySelect|polySelectConstraint|polySelectConstraintMonitor|polySelectCtx|polySelectEditCtx|polySeparate|polySetToFaceNormal|polySewEdge|polyShortestPathCtx|polySmooth|polySoftEdge|polySphere|polySphericalProjection|polySplit|polySplitCtx|polySplitEdge|polySplitRing|polySplitVertex|polyStraightenUVBorder|polySubdivideEdge|polySubdivideFacet|polyToSubdiv|polyTorus|polyTransfer|polyTriangulate|polyUVSet|polyUnite|polyWedgeFace|popen|popupMenu|pose|pow|preloadRefEd|print|progressBar|progressWindow|projFileViewer|projectCurve|projectTangent|projectionContext|projectionManip|promptDialog|propModCtx|propMove|psdChannelOutliner|psdEditTextureFile|psdExport|psdTextureFile|putenv|pwd|python|querySubdiv|quit|rad_to_deg|radial|radioButton|radioButtonGrp|radioCollection|radioMenuItemCollection|rampColorPort|rand|randomizeFollicles|randstate|rangeControl|readTake|rebuildCurve|rebuildSurface|recordAttr|recordDevice|redo|reference|referenceEdit|referenceQuery|refineSubdivSelectionList|refresh|refreshAE|registerPluginResource|rehash|reloadImage|removeJoint|removeMultiInstance|removePanelCategory|rename|renameAttr|renameSelectionList|renameUI|render|renderGlobalsNode|renderInfo|renderLayerButton|renderLayerParent|renderLayerPostProcess|renderLayerUnparent|renderManip|renderPartition|renderQualityNode|renderSettings|renderThumbnailUpdate|renderWindowEditor|renderWindowSelectContext|renderer|reorder|reorderDeformers|requires|reroot|resampleFluid|resetAE|resetPfxToPolyCamera|resetTool|resolutionNode|retarget|reverseCurve|reverseSurface|revolve|rgb_to_hsv|rigidBody|rigidSolver|roll|rollCtx|rootOf|rot|rotate|rotationInterpolation|roundConstantRadius|rowColumnLayout|rowLayout|runTimeCommand|runup|sampleImage|saveAllShelves|saveAttrPreset|saveFluid|saveImage|saveInitialState|saveMenu|savePrefObjects|savePrefs|saveShelf|saveToolSettings|scale|scaleBrushBrightness|scaleComponents|scaleConstraint|scaleKey|scaleKeyCtx|sceneEditor|sceneUIReplacement|scmh|scriptCtx|scriptEditorInfo|scriptJob|scriptNode|scriptTable|scriptToShelf|scriptedPanel|scriptedPanelType|scrollField|scrollLayout|sculpt|searchPathArray|seed|selLoadSettings|select|selectContext|selectCurveCV|selectKey|selectKeyCtx|selectKeyframeRegionCtx|selectMode|selectPref|selectPriority|selectType|selectedNodes|selectionConnection|separator|setAttr|setAttrEnumResource|setAttrMapping|setAttrNiceNameResource|setConstraintRestPosition|setDefaultShadingGroup|setDrivenKeyframe|setDynamic|setEditCtx|setEditor|setFluidAttr|setFocus|setInfinity|setInputDeviceMapping|setKeyCtx|setKeyPath|setKeyframe|setKeyframeBlendshapeTargetWts|setMenuMode|setNodeNiceNameResource|setNodeTypeFlag|setParent|setParticleAttr|setPfxToPolyCamera|setPluginResource|setProject|setStampDensity|setStartupMessage|setState|setToolTo|setUITemplate|setXformManip|sets|shadingConnection|shadingGeometryRelCtx|shadingLightRelCtx|shadingNetworkCompare|shadingNode|shapeCompare|shelfButton|shelfLayout|shelfTabLayout|shellField|shortNameOf|showHelp|showHidden|showManipCtx|showSelectionInTitle|showShadingGroupAttrEditor|showWindow|sign|simplify|sin|singleProfileBirailSurface|size|sizeBytes|skinCluster|skinPercent|smoothCurve|smoothTangentSurface|smoothstep|snap2to2|snapKey|snapMode|snapTogetherCtx|snapshot|soft|softMod|softModCtx|sort|sound|soundControl|source|spaceLocator|sphere|sphrand|spotLight|spotLightPreviewPort|spreadSheetEditor|spring|sqrt|squareSurface|srtContext|stackTrace|startString|startsWith|stitchAndExplodeShell|stitchSurface|stitchSurfacePoints|strcmp|stringArrayCatenate|stringArrayContains|stringArrayCount|stringArrayInsertAtIndex|stringArrayIntersector|stringArrayRemove|stringArrayRemoveAtIndex|stringArrayRemoveDuplicates|stringArrayRemoveExact|stringArrayToString|stringToStringArray|strip|stripPrefixFromName|stroke|subdAutoProjection|subdCleanTopology|subdCollapse|subdDuplicateAndConnect|subdEditUV|subdListComponentConversion|subdMapCut|subdMapSewMove|subdMatchTopology|subdMirror|subdToBlind|subdToPoly|subdTransferUVsToCache|subdiv|subdivCrease|subdivDisplaySmoothness|substitute|substituteAllString|substituteGeometry|substring|surface|surfaceSampler|surfaceShaderList|swatchDisplayPort|switchTable|symbolButton|symbolCheckBox|sysFile|system|tabLayout|tan|tangentConstraint|texLatticeDeformContext|texManipContext|texMoveContext|texMoveUVShellContext|texRotateContext|texScaleContext|texSelectContext|texSelectShortestPathCtx|texSmudgeUVContext|texWinToolCtx|text|textCurves|textField|textFieldButtonGrp|textFieldGrp|textManip|textScrollList|textToShelf|textureDisplacePlane|textureHairColor|texturePlacementContext|textureWindow|threadCount|threePointArcCtx|timeControl|timePort|timerX|toNativePath|toggle|toggleAxis|toggleWindowVisibility|tokenize|tokenizeList|tolerance|tolower|toolButton|toolCollection|toolDropped|toolHasOptions|toolPropertyWindow|torus|toupper|trace|track|trackCtx|transferAttributes|transformCompare|transformLimits|translator|trim|trunc|truncateFluidCache|truncateHairCache|tumble|tumbleCtx|turbulence|twoPointArcCtx|uiRes|uiTemplate|unassignInputDevice|undo|undoInfo|ungroup|uniform|unit|unloadPlugin|untangleUV|untitledFileName|untrim|upAxis|updateAE|userCtx|uvLink|uvSnapshot|validateShelfName|vectorize|view2dToolCtx|viewCamera|viewClipPlane|viewFit|viewHeadOn|viewLookAt|viewManip|viewPlace|viewSet|visor|volumeAxis|vortex|waitCursor|warning|webBrowser|webBrowserPrefs|whatIs|window|windowPref|wire|wireContext|workspace|wrinkle|wrinkleContext|writeTake|xbmLangPathList|xform)\b/,operator:[/\+[+=]?|-[-=]?|&&|\|\||[<>]=|[*\/!=]=?|[%^]/,{pattern:/(^|[^<])<(?!<)/,lookbehind:!0},{pattern:/(^|[^>])>(?!>)/,lookbehind:!0}],punctuation:/<<|>>|[.,:;?\[\](){}]/},e.languages.mel.code.inside.rest=e.languages.mel}e.exports=t,t.displayName="mel",t.aliases=[]},23388(e){"use strict";function t(e){e.languages.mizar={comment:/::.+/,keyword:/@proof\b|\b(?:according|aggregate|all|and|antonym|are|as|associativity|assume|asymmetry|attr|be|begin|being|by|canceled|case|cases|clusters?|coherence|commutativity|compatibility|connectedness|consider|consistency|constructors|contradiction|correctness|def|deffunc|define|definitions?|defpred|do|does|equals|end|environ|ex|exactly|existence|for|from|func|given|hence|hereby|holds|idempotence|identity|iff?|implies|involutiveness|irreflexivity|is|it|let|means|mode|non|not|notations?|now|of|or|otherwise|over|per|pred|prefix|projectivity|proof|provided|qua|reconsider|redefine|reduce|reducibility|reflexivity|registrations?|requirements|reserve|sch|schemes?|section|selector|set|sethood|st|struct|such|suppose|symmetry|synonym|take|that|the|then|theorems?|thesis|thus|to|transitivity|uniqueness|vocabular(?:y|ies)|when|where|with|wrt)\b/,parameter:{pattern:/\$(?:10|\d)/,alias:"variable"},variable:/\b\w+(?=:)/,number:/(?:\b|-)\d+\b/,operator:/\.\.\.|->|&|\.?=/,punctuation:/\(#|#\)|[,:;\[\](){}]/}}e.exports=t,t.displayName="mizar",t.aliases=[]},90596(e){"use strict";function t(e){var t,n,r,i;t=e,r=["ObjectId","Code","BinData","DBRef","Timestamp","NumberLong","NumberDecimal","MaxKey","MinKey","RegExp","ISODate","UUID"],i="(?:"+(n=(n=["$eq","$gt","$gte","$in","$lt","$lte","$ne","$nin","$and","$not","$nor","$or","$exists","$type","$expr","$jsonSchema","$mod","$regex","$text","$where","$geoIntersects","$geoWithin","$near","$nearSphere","$all","$elemMatch","$size","$bitsAllClear","$bitsAllSet","$bitsAnyClear","$bitsAnySet","$comment","$elemMatch","$meta","$slice","$currentDate","$inc","$min","$max","$mul","$rename","$set","$setOnInsert","$unset","$addToSet","$pop","$pull","$push","$pullAll","$each","$position","$slice","$sort","$bit","$addFields","$bucket","$bucketAuto","$collStats","$count","$currentOp","$facet","$geoNear","$graphLookup","$group","$indexStats","$limit","$listLocalSessions","$listSessions","$lookup","$match","$merge","$out","$planCacheStats","$project","$redact","$replaceRoot","$replaceWith","$sample","$set","$skip","$sort","$sortByCount","$unionWith","$unset","$unwind","$abs","$accumulator","$acos","$acosh","$add","$addToSet","$allElementsTrue","$and","$anyElementTrue","$arrayElemAt","$arrayToObject","$asin","$asinh","$atan","$atan2","$atanh","$avg","$binarySize","$bsonSize","$ceil","$cmp","$concat","$concatArrays","$cond","$convert","$cos","$dateFromParts","$dateToParts","$dateFromString","$dateToString","$dayOfMonth","$dayOfWeek","$dayOfYear","$degreesToRadians","$divide","$eq","$exp","$filter","$first","$floor","$function","$gt","$gte","$hour","$ifNull","$in","$indexOfArray","$indexOfBytes","$indexOfCP","$isArray","$isNumber","$isoDayOfWeek","$isoWeek","$isoWeekYear","$last","$last","$let","$literal","$ln","$log","$log10","$lt","$lte","$ltrim","$map","$max","$mergeObjects","$meta","$min","$millisecond","$minute","$mod","$month","$multiply","$ne","$not","$objectToArray","$or","$pow","$push","$radiansToDegrees","$range","$reduce","$regexFind","$regexFindAll","$regexMatch","$replaceOne","$replaceAll","$reverseArray","$round","$rtrim","$second","$setDifference","$setEquals","$setIntersection","$setIsSubset","$setUnion","$size","$sin","$slice","$split","$sqrt","$stdDevPop","$stdDevSamp","$strcasecmp","$strLenBytes","$strLenCP","$substr","$substrBytes","$substrCP","$subtract","$sum","$switch","$tan","$toBool","$toDate","$toDecimal","$toDouble","$toInt","$toLong","$toObjectId","$toString","$toLower","$toUpper","$trim","$trunc","$type","$week","$year","$zip","$comment","$explain","$hint","$max","$maxTimeMS","$min","$orderby","$query","$returnKey","$showDiskLoc","$natural"]).map(function(e){return e.replace("$","\\$")})).join("|")+")\\b",t.languages.mongodb=t.languages.extend("javascript",{}),t.languages.insertBefore("mongodb","string",{property:{pattern:/(?:(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)(?=\s*:)/,greedy:!0,inside:{keyword:RegExp("^(['\"])?"+i+"(?:\\1)?$")}}}),t.languages.mongodb.string.inside={url:{pattern:/https?:\/\/[-\w@:%.+~#=]{1,256}\.[a-z0-9()]{1,6}\b[-\w()@:%+.~#?&/=]*/i,greedy:!0},entity:{pattern:/\b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b/,greedy:!0}},t.languages.insertBefore("mongodb","constant",{builtin:{pattern:RegExp("\\b(?:"+r.join("|")+")\\b"),alias:"keyword"}})}e.exports=t,t.displayName="mongodb",t.aliases=[]},95721(e){"use strict";function t(e){e.languages.monkey={string:/"[^"\r\n]*"/,comment:[{pattern:/^#Rem\s[\s\S]*?^#End/im,greedy:!0},{pattern:/'.+/,greedy:!0}],preprocessor:{pattern:/(^[ \t]*)#.+/m,lookbehind:!0,alias:"comment"},function:/\b\w+(?=\()/,"type-char":{pattern:/(\w)[?%#$]/,lookbehind:!0,alias:"variable"},number:{pattern:/((?:\.\.)?)(?:(?:\b|\B-\.?|\B\.)\d+(?:(?!\.\.)\.\d*)?|\$[\da-f]+)/i,lookbehind:!0},keyword:/\b(?:Void|Strict|Public|Private|Property|Bool|Int|Float|String|Array|Object|Continue|Exit|Import|Extern|New|Self|Super|Try|Catch|Eachin|True|False|Extends|Abstract|Final|Select|Case|Default|Const|Local|Global|Field|Method|Function|Class|End|If|Then|Else|ElseIf|EndIf|While|Wend|Repeat|Until|Forever|For|To|Step|Next|Return|Module|Interface|Implements|Inline|Throw|Null)\b/i,operator:/\.\.|<[=>]?|>=?|:?=|(?:[+\-*\/&~|]|\b(?:Mod|Shl|Shr)\b)=?|\b(?:And|Not|Or)\b/i,punctuation:/[.,:;()\[\]]/}}e.exports=t,t.displayName="monkey",t.aliases=[]},64262(e){"use strict";function t(e){e.languages.moonscript={comment:/--.*/,string:[{pattern:/'[^']*'|\[(=*)\[[\s\S]*?\]\1\]/,greedy:!0},{pattern:/"[^"]*"/,greedy:!0,inside:{interpolation:{pattern:/#\{[^{}]*\}/,inside:{moonscript:{pattern:/(^#\{)[\s\S]+(?=\})/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/#\{|\}/,alias:"punctuation"}}}}}],"class-name":[{pattern:/(\b(?:class|extends)[ \t]+)\w+/,lookbehind:!0},/\b[A-Z]\w*/],keyword:/\b(?:class|continue|do|else|elseif|export|extends|for|from|if|import|in|local|nil|return|self|super|switch|then|unless|using|when|while|with)\b/,variable:/@@?\w*/,property:{pattern:/\b(?!\d)\w+(?=:)|(:)(?!\d)\w+/,lookbehind:!0},function:{pattern:/\b(?:_G|_VERSION|assert|collectgarbage|coroutine\.(?:running|create|resume|status|wrap|yield)|debug\.(?:debug|gethook|getinfo|getlocal|getupvalue|setlocal|setupvalue|sethook|traceback|getfenv|getmetatable|getregistry|setfenv|setmetatable)|dofile|error|getfenv|getmetatable|io\.(?:stdin|stdout|stderr|close|flush|input|lines|open|output|popen|read|tmpfile|type|write)|ipairs|load|loadfile|loadstring|math\.(?:abs|acos|asin|atan|atan2|ceil|sin|cos|tan|deg|exp|floor|log|log10|max|min|fmod|modf|cosh|sinh|tanh|pow|rad|sqrt|frexp|ldexp|random|randomseed|pi)|module|next|os\.(?:clock|date|difftime|execute|exit|getenv|remove|rename|setlocale|time|tmpname)|package\.(?:cpath|loaded|loadlib|path|preload|seeall)|pairs|pcall|print|rawequal|rawget|rawset|require|select|setfenv|setmetatable|string\.(?:byte|char|dump|find|len|lower|rep|sub|upper|format|gsub|gmatch|match|reverse)|table\.(?:maxn|concat|sort|insert|remove)|tonumber|tostring|type|unpack|xpcall)\b/,inside:{punctuation:/\./}},boolean:/\b(?:false|true)\b/,number:/(?:\B\.\d+|\b\d+\.\d+|\b\d+(?=[eE]))(?:[eE][-+]?\d+)?\b|\b(?:0x[a-fA-F\d]+|\d+)(?:U?LL)?\b/,operator:/\.{3}|[-=]>|~=|(?:[-+*/%<>!=]|\.\.)=?|[:#^]|\b(?:and|or)\b=?|\b(?:not)\b/,punctuation:/[.,()[\]{}\\]/},e.languages.moonscript.string[1].inside.interpolation.inside.moonscript.inside=e.languages.moonscript,e.languages.moon=e.languages.moonscript}e.exports=t,t.displayName="moonscript",t.aliases=["moon"]},18190(e){"use strict";function t(e){e.languages.n1ql={comment:/\/\*[\s\S]*?(?:$|\*\/)/,parameter:/\$[\w.]+/,string:{pattern:/(["'])(?:\\[\s\S]|(?!\1)[^\\]|\1\1)*\1/,greedy:!0},identifier:{pattern:/`(?:\\[\s\S]|[^\\`]|``)*`/,greedy:!0},function:/\b(?:ABS|ACOS|ARRAY_AGG|ARRAY_APPEND|ARRAY_AVG|ARRAY_CONCAT|ARRAY_CONTAINS|ARRAY_COUNT|ARRAY_DISTINCT|ARRAY_FLATTEN|ARRAY_IFNULL|ARRAY_INSERT|ARRAY_INTERSECT|ARRAY_LENGTH|ARRAY_MAX|ARRAY_MIN|ARRAY_POSITION|ARRAY_PREPEND|ARRAY_PUT|ARRAY_RANGE|ARRAY_REMOVE|ARRAY_REPEAT|ARRAY_REPLACE|ARRAY_REVERSE|ARRAY_SORT|ARRAY_STAR|ARRAY_SUM|ARRAY_SYMDIFF|ARRAY_SYMDIFFN|ARRAY_UNION|ASIN|ATAN|ATAN2|AVG|BASE64|BASE64_DECODE|BASE64_ENCODE|BITAND|BITCLEAR|BITNOT|BITOR|BITSET|BITSHIFT|BITTEST|BITXOR|CEIL|CLOCK_LOCAL|CLOCK_MILLIS|CLOCK_STR|CLOCK_TZ|CLOCK_UTC|CONTAINS|CONTAINS_TOKEN|CONTAINS_TOKEN_LIKE|CONTAINS_TOKEN_REGEXP|COS|COUNT|CURL|DATE_ADD_MILLIS|DATE_ADD_STR|DATE_DIFF_MILLIS|DATE_DIFF_STR|DATE_FORMAT_STR|DATE_PART_MILLIS|DATE_PART_STR|DATE_RANGE_MILLIS|DATE_RANGE_STR|DATE_TRUNC_MILLIS|DATE_TRUNC_STR|DECODE_JSON|DEGREES|DURATION_TO_STR|E|ENCODED_SIZE|ENCODE_JSON|EXP|FLOOR|GREATEST|HAS_TOKEN|IFINF|IFMISSING|IFMISSINGORNULL|IFNAN|IFNANORINF|IFNULL|INITCAP|ISARRAY|ISATOM|ISBOOLEAN|ISNUMBER|ISOBJECT|ISSTRING|IsBitSET|LEAST|LENGTH|LN|LOG|LOWER|LTRIM|MAX|META|MILLIS|MILLIS_TO_LOCAL|MILLIS_TO_STR|MILLIS_TO_TZ|MILLIS_TO_UTC|MILLIS_TO_ZONE_NAME|MIN|MISSINGIF|NANIF|NEGINFIF|NOW_LOCAL|NOW_MILLIS|NOW_STR|NOW_TZ|NOW_UTC|NULLIF|OBJECT_ADD|OBJECT_CONCAT|OBJECT_INNER_PAIRS|OBJECT_INNER_VALUES|OBJECT_LENGTH|OBJECT_NAMES|OBJECT_PAIRS|OBJECT_PUT|OBJECT_REMOVE|OBJECT_RENAME|OBJECT_REPLACE|OBJECT_UNWRAP|OBJECT_VALUES|PAIRS|PI|POLY_LENGTH|POSINFIF|POSITION|POWER|RADIANS|RANDOM|REGEXP_CONTAINS|REGEXP_LIKE|REGEXP_POSITION|REGEXP_REPLACE|REPEAT|REPLACE|REVERSE|ROUND|RTRIM|SIGN|SIN|SPLIT|SQRT|STR_TO_DURATION|STR_TO_MILLIS|STR_TO_TZ|STR_TO_UTC|STR_TO_ZONE_NAME|SUBSTR|SUFFIXES|SUM|TAN|TITLE|TOARRAY|TOATOM|TOBOOLEAN|TOKENS|TONUMBER|TOOBJECT|TOSTRING|TRIM|TRUNC|TYPE|UPPER|WEEKDAY_MILLIS|WEEKDAY_STR)(?=\s*\()/i,keyword:/\b(?:ALL|ALTER|ANALYZE|AS|ASC|BEGIN|BINARY|BOOLEAN|BREAK|BUCKET|BUILD|BY|CALL|CAST|CLUSTER|COLLATE|COLLECTION|COMMIT|CONNECT|CONTINUE|CORRELATE|COVER|CREATE|DATABASE|DATASET|DATASTORE|DECLARE|DECREMENT|DELETE|DERIVED|DESC|DESCRIBE|DISTINCT|DO|DROP|EACH|ELEMENT|EXCEPT|EXCLUDE|EXECUTE|EXPLAIN|FETCH|FLATTEN|FOR|FORCE|FROM|FUNCTION|GRANT|GROUP|GSI|HAVING|IF|IGNORE|ILIKE|INCLUDE|INCREMENT|INDEX|INFER|INLINE|INNER|INSERT|INTERSECT|INTO|IS|JOIN|KEY|KEYS|KEYSPACE|KNOWN|LAST|LEFT|LET|LETTING|LIMIT|LSM|MAP|MAPPING|MATCHED|MATERIALIZED|MERGE|MINUS|MISSING|NAMESPACE|NEST|NULL|NUMBER|OBJECT|OFFSET|ON|OPTION|ORDER|OUTER|OVER|PARSE|PARTITION|PASSWORD|PATH|POOL|PREPARE|PRIMARY|PRIVATE|PRIVILEGE|PROCEDURE|PUBLIC|RAW|REALM|REDUCE|RENAME|RETURN|RETURNING|REVOKE|RIGHT|ROLE|ROLLBACK|SATISFIES|SCHEMA|SELECT|SELF|SEMI|SET|SHOW|SOME|START|STATISTICS|STRING|SYSTEM|TO|TRANSACTION|TRIGGER|TRUNCATE|UNDER|UNION|UNIQUE|UNKNOWN|UNNEST|UNSET|UPDATE|UPSERT|USE|USER|USING|VALIDATE|VALUE|VALUES|VIA|VIEW|WHERE|WHILE|WITH|WORK|XOR)\b/i,boolean:/\b(?:TRUE|FALSE)\b/i,number:/(?:\b\d+\.|\B\.)\d+e[+\-]?\d+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/%]|!=|==?|\|\||<[>=]?|>=?|\b(?:AND|ANY|ARRAY|BETWEEN|CASE|ELSE|END|EVERY|EXISTS|FIRST|IN|LIKE|NOT|OR|THEN|VALUED|WHEN|WITHIN)\b/i,punctuation:/[;[\](),.{}:]/}}e.exports=t,t.displayName="n1ql",t.aliases=[]},70896(e){"use strict";function t(e){e.languages.n4js=e.languages.extend("javascript",{keyword:/\b(?:any|Array|boolean|break|case|catch|class|const|constructor|continue|debugger|declare|default|delete|do|else|enum|export|extends|false|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|module|new|null|number|package|private|protected|public|return|set|static|string|super|switch|this|throw|true|try|typeof|var|void|while|with|yield)\b/}),e.languages.insertBefore("n4js","constant",{annotation:{pattern:/@+\w+/,alias:"operator"}}),e.languages.n4jsd=e.languages.n4js}e.exports=t,t.displayName="n4js",t.aliases=["n4jsd"]},42242(e){"use strict";function t(e){e.languages["nand2tetris-hdl"]={comment:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,keyword:/\b(?:CHIP|IN|OUT|PARTS|BUILTIN|CLOCKED)\b/,boolean:/\b(?:true|false)\b/,function:/\b[A-Za-z][A-Za-z0-9]*(?=\()/,number:/\b\d+\b/,operator:/=|\.\./,punctuation:/[{}[\];(),:]/}}e.exports=t,t.displayName="nand2tetrisHdl",t.aliases=[]},37943(e){"use strict";function t(e){!function(e){var t=/\{[^\r\n\[\]{}]*\}/,n={"quoted-string":{pattern:/"(?:[^"\\]|\\.)*"/,alias:"operator"},"command-param-id":{pattern:/(\s)\w+:/,lookbehind:!0,alias:"property"},"command-param-value":[{pattern:t,alias:"selector"},{pattern:/([\t ])\S+/,lookbehind:!0,greedy:!0,alias:"operator"},{pattern:/\S(?:.*\S)?/,alias:"operator"}]};function r(e){for(var t="[]{}",n=[],r=0;r.+/m,alias:"tag",inside:{value:{pattern:/(^>\w+[\t ]+)(?!\s)[^{}\r\n]+/,lookbehind:!0,alias:"operator"},key:{pattern:/(^>)\w+/,lookbehind:!0}}},label:{pattern:/^([\t ]*)#[\t ]*\w+[\t ]*$/m,lookbehind:!0,alias:"regex"},command:{pattern:/^([\t ]*)@\w+(?=[\t ]|$).*/m,lookbehind:!0,alias:"function",inside:{"command-name":/^@\w+/,expression:{pattern:t,greedy:!0,alias:"selector"},"command-params":{pattern:/\s*\S[\s\S]*/,inside:n}}},"generic-text":{pattern:/(^[ \t]*)[^#@>;\s].*/m,lookbehind:!0,alias:"punctuation",inside:{"escaped-char":/\\[{}\[\]"]/,expression:{pattern:t,greedy:!0,alias:"selector"},"inline-command":{pattern:/\[[\t ]*\w[^\r\n\[\]]*\]/,greedy:!0,alias:"function",inside:{"command-params":{pattern:/(^\[[\t ]*\w+\b)[\s\S]+(?=\]$)/,lookbehind:!0,inside:n},"command-param-name":{pattern:/^(\[[\t ]*)\w+/,lookbehind:!0,alias:"name"},"start-stop-char":/[\[\]]/}}}}},e.languages.nani=e.languages.naniscript,e.hooks.add("after-tokenize",function(e){e.tokens.forEach(function(e){if("string"!=typeof e&&"generic-text"===e.type){var t=i(e);r(t)||(e.type="bad-line",e.content=t)}})})}(e)}e.exports=t,t.displayName="naniscript",t.aliases=[]},293(e){"use strict";function t(e){e.languages.nasm={comment:/;.*$/m,string:/(["'`])(?:\\.|(?!\1)[^\\\r\n])*\1/,label:{pattern:/(^\s*)[A-Za-z._?$][\w.?$@~#]*:/m,lookbehind:!0,alias:"function"},keyword:[/\[?BITS (?:16|32|64)\]?/,{pattern:/(^\s*)section\s*[a-z.]+:?/im,lookbehind:!0},/(?:extern|global)[^;\r\n]*/i,/(?:CPU|FLOAT|DEFAULT).*$/m],register:{pattern:/\b(?:st\d|[xyz]mm\d\d?|[cdt]r\d|r\d\d?[bwd]?|[er]?[abcd]x|[abcd][hl]|[er]?(?:bp|sp|si|di)|[cdefgs]s)\b/i,alias:"variable"},number:/(?:\b|(?=\$))(?:0[hx](?:\.[\da-f]+|[\da-f]+(?:\.[\da-f]+)?)(?:p[+-]?\d+)?|\d[\da-f]+[hx]|\$\d[\da-f]*|0[oq][0-7]+|[0-7]+[oq]|0[by][01]+|[01]+[by]|0[dt]\d+|(?:\d+(?:\.\d+)?|\.\d+)(?:\.?e[+-]?\d+)?[dt]?)\b/i,operator:/[\[\]*+\-\/%<>=&|$!]/}}e.exports=t,t.displayName="nasm",t.aliases=[]},83873(e){"use strict";function t(e){e.languages.neon={comment:{pattern:/#.*/,greedy:!0},datetime:{pattern:/(^|[[{(=:,\s])\d\d\d\d-\d\d?-\d\d?(?:(?:[Tt]| +)\d\d?:\d\d:\d\d(?:\.\d*)? *(?:Z|[-+]\d\d?(?::?\d\d)?)?)?(?=$|[\]}),\s])/,lookbehind:!0,alias:"number"},key:{pattern:/(^|[[{(,\s])[^,:=[\]{}()'"\s]+(?=\s*:(?:$|[\]}),\s])|\s*=)/,lookbehind:!0,alias:"atrule"},number:{pattern:/(^|[[{(=:,\s])[+-]?(?:0x[\da-fA-F]+|0o[0-7]+|0b[01]+|(?:\d+(?:\.\d*)?|\.?\d+)(?:[eE][+-]?\d+)?)(?=$|[\]}),:=\s])/,lookbehind:!0},boolean:{pattern:/(^|[[{(=:,\s])(?:true|false|yes|no)(?=$|[\]}),:=\s])/i,lookbehind:!0},null:{pattern:/(^|[[{(=:,\s])(?:null)(?=$|[\]}),:=\s])/i,lookbehind:!0,alias:"keyword"},string:{pattern:/(^|[[{(=:,\s])(?:('''|""")\r?\n(?:(?:[^\r\n]|\r?\n(?![\t ]*\2))*\r?\n)?[\t ]*\2|'[^'\r\n]*'|"(?:\\.|[^\\"\r\n])*")/,lookbehind:!0,greedy:!0},literal:{pattern:/(^|[[{(=:,\s])(?:[^#"',:=[\]{}()\s`-]|[:-][^"',=[\]{}()\s])(?:[^,:=\]})(\s]|:(?![\s,\]})]|$)|[ \t]+[^#,:=\]})(\s])*/,lookbehind:!0,alias:"string"},punctuation:/[,:=[\]{}()-]/}}e.exports=t,t.displayName="neon",t.aliases=[]},75932(e){"use strict";function t(e){e.languages.nevod={comment:/\/\/.*|(?:\/\*[\s\S]*?(?:\*\/|$))/,string:{pattern:/(?:"(?:""|[^"])*"(?!")|'(?:''|[^'])*'(?!'))!?\*?/,greedy:!0,inside:{"string-attrs":/!$|!\*$|\*$/}},namespace:{pattern:/(@namespace\s+)[a-zA-Z0-9\-.]+(?=\s*\{)/,lookbehind:!0},pattern:{pattern:/(@pattern\s+)?#?[a-zA-Z0-9\-.]+(?:\s*\(\s*(?:~\s*)?[a-zA-Z0-9\-.]+\s*(?:,\s*(?:~\s*)?[a-zA-Z0-9\-.]*)*\))?(?=\s*=)/,lookbehind:!0,inside:{"pattern-name":{pattern:/^#?[a-zA-Z0-9\-.]+/,alias:"class-name"},fields:{pattern:/\(.*\)/,inside:{"field-name":{pattern:/[a-zA-Z0-9\-.]+/,alias:"variable"},punctuation:/[,()]/,operator:{pattern:/~/,alias:"field-hidden-mark"}}}}},search:{pattern:/(@search\s+|#)[a-zA-Z0-9\-.]+(?:\.\*)?(?=\s*;)/,alias:"function",lookbehind:!0},keyword:/@(?:require|namespace|pattern|search|inside|outside|having|where)\b/,"standard-pattern":{pattern:/\b(?:Word|Punct|Symbol|Space|LineBreak|Start|End|Alpha|AlphaNum|Num|NumAlpha|Blank|WordBreak|Any)(?:\([a-zA-Z0-9\-.,\s+]*\))?/,inside:{"standard-pattern-name":{pattern:/^[a-zA-Z0-9\-.]+/,alias:"builtin"},quantifier:{pattern:/\b\d+(?:\s*\+|\s*-\s*\d+)?(?!\w)/,alias:"number"},"standard-pattern-attr":{pattern:/[a-zA-Z0-9\-.]+/,alias:"builtin"},punctuation:/[,()]/}},quantifier:{pattern:/\b\d+(?:\s*\+|\s*-\s*\d+)?(?!\w)/,alias:"number"},operator:[{pattern:/=/,alias:"pattern-def"},{pattern:/&/,alias:"conjunction"},{pattern:/~/,alias:"exception"},{pattern:/\?/,alias:"optionality"},{pattern:/[[\]]/,alias:"repetition"},{pattern:/[{}]/,alias:"variation"},{pattern:/[+_]/,alias:"sequence"},{pattern:/\.{2,3}/,alias:"span"}],"field-capture":[{pattern:/([a-zA-Z0-9\-.]+\s*\()\s*[a-zA-Z0-9\-.]+\s*:\s*[a-zA-Z0-9\-.]+(?:\s*,\s*[a-zA-Z0-9\-.]+\s*:\s*[a-zA-Z0-9\-.]+)*(?=\s*\))/,lookbehind:!0,inside:{"field-name":{pattern:/[a-zA-Z0-9\-.]+/,alias:"variable"},colon:/:/}},{pattern:/[a-zA-Z0-9\-.]+\s*:/,inside:{"field-name":{pattern:/[a-zA-Z0-9\-.]+/,alias:"variable"},colon:/:/}}],punctuation:/[:;,()]/,name:/[a-zA-Z0-9\-.]+/}}e.exports=t,t.displayName="nevod",t.aliases=[]},60221(e){"use strict";function t(e){var t,n;n=/\$(?:\w[a-z\d]*(?:_[^\x00-\x1F\s"'\\()$]*)?|\{[^}\s"'\\]+\})/i,(t=e).languages.nginx={comment:{pattern:/(^|[\s{};])#.*/,lookbehind:!0},directive:{pattern:/(^|\s)\w(?:[^;{}"'\\\s]|\\.|"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*'|\s+(?:#.*(?!.)|(?![#\s])))*?(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:{string:{pattern:/((?:^|[^\\])(?:\\\\)*)(?:"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*')/,lookbehind:!0,inside:{escape:{pattern:/\\["'\\nrt]/,alias:"entity"},variable:n}},comment:{pattern:/(\s)#.*/,lookbehind:!0,greedy:!0},keyword:{pattern:/^\S+/,greedy:!0},boolean:{pattern:/(\s)(?:off|on)(?!\S)/,lookbehind:!0},number:{pattern:/(\s)\d+[a-z]*(?!\S)/i,lookbehind:!0},variable:n}},punctuation:/[{};]/}}e.exports=t,t.displayName="nginx",t.aliases=[]},44188(e){"use strict";function t(e){e.languages.nim={comment:/#.*/,string:{pattern:/(?:(?:\b(?!\d)(?:\w|\\x[8-9a-fA-F][0-9a-fA-F])+)?(?:"""[\s\S]*?"""(?!")|"(?:\\[\s\S]|""|[^"\\])*")|'(?:\\(?:\d+|x[\da-fA-F]{2}|.)|[^'])')/,greedy:!0},number:/\b(?:0[xXoObB][\da-fA-F_]+|\d[\d_]*(?:(?!\.\.)\.[\d_]*)?(?:[eE][+-]?\d[\d_]*)?)(?:'?[iuf]\d*)?/,keyword:/\b(?:addr|as|asm|atomic|bind|block|break|case|cast|concept|const|continue|converter|defer|discard|distinct|do|elif|else|end|enum|except|export|finally|for|from|func|generic|if|import|include|interface|iterator|let|macro|method|mixin|nil|object|out|proc|ptr|raise|ref|return|static|template|try|tuple|type|using|var|when|while|with|without|yield)\b/,function:{pattern:/(?:(?!\d)(?:\w|\\x[8-9a-fA-F][0-9a-fA-F])+|`[^`\r\n]+`)\*?(?:\[[^\]]+\])?(?=\s*\()/,inside:{operator:/\*$/}},ignore:{pattern:/`[^`\r\n]+`/,inside:{punctuation:/`/}},operator:{pattern:/(^|[({\[](?=\.\.)|(?![({\[]\.).)(?:(?:[=+\-*\/<>@$~&%|!?^:\\]|\.\.|\.(?![)}\]]))+|\b(?:and|div|of|or|in|is|isnot|mod|not|notin|shl|shr|xor)\b)/m,lookbehind:!0},punctuation:/[({\[]\.|\.[)}\]]|[`(){}\[\],:]/}}e.exports=t,t.displayName="nim",t.aliases=[]},74426(e){"use strict";function t(e){e.languages.nix={comment:/\/\*[\s\S]*?\*\/|#.*/,string:{pattern:/"(?:[^"\\]|\\[\s\S])*"|''(?:(?!'')[\s\S]|''(?:'|\\|\$\{))*''/,greedy:!0,inside:{interpolation:{pattern:/(^|(?:^|(?!'').)[^\\])\$\{(?:[^{}]|\{[^}]*\})*\}/,lookbehind:!0,inside:{antiquotation:{pattern:/^\$(?=\{)/,alias:"variable"}}}}},url:[/\b(?:[a-z]{3,7}:\/\/)[\w\-+%~\/.:#=?&]+/,{pattern:/([^\/])(?:[\w\-+%~.:#=?&]*(?!\/\/)[\w\-+%~\/.:#=?&])?(?!\/\/)\/[\w\-+%~\/.:#=?&]*/,lookbehind:!0}],antiquotation:{pattern:/\$(?=\{)/,alias:"variable"},number:/\b\d+\b/,keyword:/\b(?:assert|builtins|else|if|in|inherit|let|null|or|then|with)\b/,function:/\b(?:abort|add|all|any|attrNames|attrValues|baseNameOf|compareVersions|concatLists|currentSystem|deepSeq|derivation|dirOf|div|elem(?:At)?|fetch(?:url|Tarball)|filter(?:Source)?|fromJSON|genList|getAttr|getEnv|hasAttr|hashString|head|import|intersectAttrs|is(?:Attrs|Bool|Function|Int|List|Null|String)|length|lessThan|listToAttrs|map|mul|parseDrvName|pathExists|read(?:Dir|File)|removeAttrs|replaceStrings|seq|sort|stringLength|sub(?:string)?|tail|throw|to(?:File|JSON|Path|String|XML)|trace|typeOf)\b|\bfoldl'\B/,boolean:/\b(?:true|false)\b/,operator:/[=!<>]=?|\+\+?|\|\||&&|\/\/|->?|[?@]/,punctuation:/[{}()[\].,:;]/},e.languages.nix.string.inside.interpolation.inside.rest=e.languages.nix}e.exports=t,t.displayName="nix",t.aliases=[]},88447(e){"use strict";function t(e){e.languages.nsis={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|[#;].*)/,lookbehind:!0},string:{pattern:/("|')(?:\\.|(?!\1)[^\\\r\n])*\1/,greedy:!0},keyword:{pattern:/(^[\t ]*)(?:Abort|Add(?:BrandingImage|Size)|AdvSplash|Allow(?:RootDirInstall|SkipFiles)|AutoCloseWindow|Banner|BG(?:Font|Gradient|Image)|BrandingText|BringToFront|Call(?:InstDLL)?|Caption|ChangeUI|CheckBitmap|ClearErrors|CompletedText|ComponentText|CopyFiles|CRCCheck|Create(?:Directory|Font|ShortCut)|Delete(?:INISec|INIStr|RegKey|RegValue)?|Detail(?:Print|sButtonText)|Dialer|Dir(?:Text|Var|Verify)|EnableWindow|Enum(?:RegKey|RegValue)|Exch|Exec(?:Shell(?:Wait)?|Wait)?|ExpandEnvStrings|File(?:BufSize|Close|ErrorText|Open|Read|ReadByte|ReadUTF16LE|ReadWord|WriteUTF16LE|Seek|Write|WriteByte|WriteWord)?|Find(?:Close|First|Next|Window)|FlushINI|Get(?:CurInstType|CurrentAddress|DlgItem|DLLVersion(?:Local)?|ErrorLevel|FileTime(?:Local)?|FullPathName|Function(?:Address|End)?|InstDirError|LabelAddress|TempFileName)|Goto|HideWindow|Icon|If(?:Abort|Errors|FileExists|RebootFlag|Silent)|InitPluginsDir|Install(?:ButtonText|Colors|Dir(?:RegKey)?)|InstProgressFlags|Inst(?:Type(?:GetText|SetText)?)|Int(?:64|Ptr)?CmpU?|Int(?:64)?Fmt|Int(?:Ptr)?Op|IsWindow|Lang(?:DLL|String)|License(?:BkColor|Data|ForceSelection|LangString|Text)|LoadLanguageFile|LockWindow|Log(?:Set|Text)|Manifest(?:DPIAware|SupportedOS)|Math|MessageBox|MiscButtonText|Name|Nop|ns(?:Dialogs|Exec)|NSISdl|OutFile|Page(?:Callbacks)?|PE(?:DllCharacteristics|SubsysVer)|Pop|Push|Quit|Read(?:EnvStr|INIStr|RegDWORD|RegStr)|Reboot|RegDLL|Rename|RequestExecutionLevel|ReserveFile|Return|RMDir|SearchPath|Section(?:End|GetFlags|GetInstTypes|GetSize|GetText|Group|In|SetFlags|SetInstTypes|SetSize|SetText)?|SendMessage|Set(?:AutoClose|BrandingImage|Compress|Compressor(?:DictSize)?|CtlColors|CurInstType|DatablockOptimize|DateSave|Details(?:Print|View)|ErrorLevel|Errors|FileAttributes|Font|OutPath|Overwrite|PluginUnload|RebootFlag|RegView|ShellVarContext|Silent)|Show(?:InstDetails|UninstDetails|Window)|Silent(?:Install|UnInstall)|Sleep|SpaceTexts|Splash|StartMenu|Str(?:CmpS?|Cpy|Len)|SubCaption|System|Unicode|Uninstall(?:ButtonText|Caption|Icon|SubCaption|Text)|UninstPage|UnRegDLL|UserInfo|Var|VI(?:AddVersionKey|FileVersion|ProductVersion)|VPatch|WindowIcon|Write(?:INIStr|Reg(?:Bin|DWORD|ExpandStr|MultiStr|None|Str)|Uninstaller)|XPStyle)\b/m,lookbehind:!0},property:/\b(?:admin|all|auto|both|colored|false|force|hide|highest|lastused|leave|listonly|none|normal|notset|off|on|open|print|show|silent|silentlog|smooth|textonly|true|user|ARCHIVE|FILE_(?:ATTRIBUTE_ARCHIVE|ATTRIBUTE_NORMAL|ATTRIBUTE_OFFLINE|ATTRIBUTE_READONLY|ATTRIBUTE_SYSTEM|ATTRIBUTE_TEMPORARY)|HK(?:(?:CR|CU|LM)(?:32|64)?|DD|PD|U)|HKEY_(?:CLASSES_ROOT|CURRENT_CONFIG|CURRENT_USER|DYN_DATA|LOCAL_MACHINE|PERFORMANCE_DATA|USERS)|ID(?:ABORT|CANCEL|IGNORE|NO|OK|RETRY|YES)|MB_(?:ABORTRETRYIGNORE|DEFBUTTON1|DEFBUTTON2|DEFBUTTON3|DEFBUTTON4|ICONEXCLAMATION|ICONINFORMATION|ICONQUESTION|ICONSTOP|OK|OKCANCEL|RETRYCANCEL|RIGHT|RTLREADING|SETFOREGROUND|TOPMOST|USERICON|YESNO)|NORMAL|OFFLINE|READONLY|SHCTX|SHELL_CONTEXT|SYSTEM|TEMPORARY)\b/,constant:/\$\{[\w\.:\^-]+\}|\$\([\w\.:\^-]+\)/i,variable:/\$\w+/i,number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/--?|\+\+?|<=?|>=?|==?=?|&&?|\|\|?|[?*\/~^%]/,punctuation:/[{}[\];(),.:]/,important:{pattern:/(^[\t ]*)!(?:addincludedir|addplugindir|appendfile|cd|define|delfile|echo|else|endif|error|execute|finalize|getdllversion|gettlbversion|ifdef|ifmacrodef|ifmacrondef|ifndef|if|include|insertmacro|macroend|macro|makensis|packhdr|pragma|searchparse|searchreplace|system|tempfile|undef|verbose|warning)\b/im,lookbehind:!0}}}e.exports=t,t.displayName="nsis",t.aliases=[]},16032(e,t,n){"use strict";var r=n(65806);function i(e){e.register(r),e.languages.objectivec=e.languages.extend("c",{string:/("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1|@"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,keyword:/\b(?:asm|typeof|inline|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|union|unsigned|void|volatile|while|in|self|super)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete e.languages.objectivec["class-name"],e.languages.objc=e.languages.objectivec}e.exports=i,i.displayName="objectivec",i.aliases=["objc"]},33607(e){"use strict";function t(e){e.languages.ocaml={comment:/\(\*[\s\S]*?\*\)/,string:[{pattern:/"(?:\\.|[^\\\r\n"])*"/,greedy:!0},{pattern:/(['`])(?:\\(?:\d+|x[\da-f]+|.)|(?!\1)[^\\\r\n])\1/i,greedy:!0}],number:/\b(?:0x[\da-f][\da-f_]+|(?:0[bo])?\d[\d_]*(?:\.[\d_]*)?(?:e[+-]?[\d_]+)?)/i,directive:{pattern:/\B#\w+/,alias:"important"},label:{pattern:/\B~\w+/,alias:"function"},"type-variable":{pattern:/\B'\w+/,alias:"function"},variant:{pattern:/`\w+/,alias:"variable"},module:{pattern:/\b[A-Z]\w+/,alias:"variable"},keyword:/\b(?:as|assert|begin|class|constraint|do|done|downto|else|end|exception|external|for|fun|function|functor|if|in|include|inherit|initializer|lazy|let|match|method|module|mutable|new|nonrec|object|of|open|private|rec|sig|struct|then|to|try|type|val|value|virtual|when|where|while|with)\b/,boolean:/\b(?:false|true)\b/,operator:/:=|[=<>@^|&+\-*\/$%!?~][!$%&*+\-.\/:<=>?@^|~]*|\b(?:and|asr|land|lor|lsl|lsr|lxor|mod|or)\b/,punctuation:/[(){}\[\]|.,:;]|\b_\b/}}e.exports=t,t.displayName="ocaml",t.aliases=[]},22001(e,t,n){"use strict";var r=n(65806);function i(e){var t,n;e.register(r),(t=e).languages.opencl=t.languages.extend("c",{keyword:/\b(?:__attribute__|(?:__)?(?:constant|global|kernel|local|private|read_only|read_write|write_only)|auto|break|case|complex|const|continue|default|do|(?:float|double)(?:16(?:x(?:1|16|2|4|8))?|1x(?:1|16|2|4|8)|2(?:x(?:1|16|2|4|8))?|3|4(?:x(?:1|16|2|4|8))?|8(?:x(?:1|16|2|4|8))?)?|else|enum|extern|for|goto|(?:u?(?:char|short|int|long)|half|quad|bool)(?:2|3|4|8|16)?|if|imaginary|inline|packed|pipe|register|restrict|return|signed|sizeof|static|struct|switch|typedef|uniform|union|unsigned|void|volatile|while)\b/,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[fuhl]{0,4}/i,boolean:/\b(?:false|true)\b/,"constant-opencl-kernel":{pattern:/\b(?:CHAR_(?:BIT|MAX|MIN)|CLK_(?:ADDRESS_(?:CLAMP(?:_TO_EDGE)?|NONE|REPEAT)|FILTER_(?:LINEAR|NEAREST)|(?:LOCAL|GLOBAL)_MEM_FENCE|NORMALIZED_COORDS_(?:FALSE|TRUE))|CL_(?:BGRA|(?:HALF_)?FLOAT|INTENSITY|LUMINANCE|A?R?G?B?[Ax]?|(?:(?:UN)?SIGNED|[US]NORM)_(?:INT(?:8|16|32))|UNORM_(?:INT_101010|SHORT_(?:555|565)))|(?:DBL|FLT|HALF)_(?:DIG|EPSILON|MANT_DIG|(?:MIN|MAX)(?:(?:_10)?_EXP)?)|FLT_RADIX|HUGE_VALF?|INFINITY|(?:INT|LONG|SCHAR|SHRT)_(?:MAX|MIN)|(?:UCHAR|USHRT|UINT|ULONG)_MAX|MAXFLOAT|M_(?:[12]_PI|2_SQRTPI|E|LN(?:2|10)|LOG(?:10|2)E?|PI(?:_[24])?|SQRT(?:1_2|2))(?:_F|_H)?|NAN)\b/,alias:"constant"}}),t.languages.insertBefore("opencl","class-name",{"builtin-type":{pattern:/\b(?:_cl_(?:command_queue|context|device_id|event|kernel|mem|platform_id|program|sampler)|cl_(?:image_format|mem_fence_flags)|clk_event_t|event_t|image(?:1d_(?:array_|buffer_)?t|2d_(?:array_(?:depth_|msaa_depth_|msaa_)?|depth_|msaa_depth_|msaa_)?t|3d_t)|intptr_t|ndrange_t|ptrdiff_t|queue_t|reserve_id_t|sampler_t|size_t|uintptr_t)\b/,alias:"keyword"}}),n={"type-opencl-host":{pattern:/\b(?:cl_(?:GLenum|GLint|GLuin|addressing_mode|bitfield|bool|buffer_create_type|build_status|channel_(?:order|type)|(?:u?(?:char|short|int|long)|float|double)(?:2|3|4|8|16)?|command_(?:queue(?:_info|_properties)?|type)|context(?:_info|_properties)?|device_(?:exec_capabilities|fp_config|id|info|local_mem_type|mem_cache_type|type)|(?:event|sampler)(?:_info)?|filter_mode|half|image_info|kernel(?:_info|_work_group_info)?|map_flags|mem(?:_flags|_info|_object_type)?|platform_(?:id|info)|profiling_info|program(?:_build_info|_info)?))\b/,alias:"keyword"},"boolean-opencl-host":{pattern:/\bCL_(?:TRUE|FALSE)\b/,alias:"boolean"},"constant-opencl-host":{pattern:/\bCL_(?:A|ABGR|ADDRESS_(?:CLAMP(?:_TO_EDGE)?|MIRRORED_REPEAT|NONE|REPEAT)|ARGB|BGRA|BLOCKING|BUFFER_CREATE_TYPE_REGION|BUILD_(?:ERROR|IN_PROGRESS|NONE|PROGRAM_FAILURE|SUCCESS)|COMMAND_(?:ACQUIRE_GL_OBJECTS|BARRIER|COPY_(?:BUFFER(?:_RECT|_TO_IMAGE)?|IMAGE(?:_TO_BUFFER)?)|FILL_(?:BUFFER|IMAGE)|MAP(?:_BUFFER|_IMAGE)|MARKER|MIGRATE(?:_SVM)?_MEM_OBJECTS|NATIVE_KERNEL|NDRANGE_KERNEL|READ_(?:BUFFER(?:_RECT)?|IMAGE)|RELEASE_GL_OBJECTS|SVM_(?:FREE|MAP|MEMCPY|MEMFILL|UNMAP)|TASK|UNMAP_MEM_OBJECT|USER|WRITE_(?:BUFFER(?:_RECT)?|IMAGE))|COMPILER_NOT_AVAILABLE|COMPILE_PROGRAM_FAILURE|COMPLETE|CONTEXT_(?:DEVICES|INTEROP_USER_SYNC|NUM_DEVICES|PLATFORM|PROPERTIES|REFERENCE_COUNT)|DEPTH(?:_STENCIL)?|DEVICE_(?:ADDRESS_BITS|AFFINITY_DOMAIN_(?:L[1-4]_CACHE|NEXT_PARTITIONABLE|NUMA)|AVAILABLE|BUILT_IN_KERNELS|COMPILER_AVAILABLE|DOUBLE_FP_CONFIG|ENDIAN_LITTLE|ERROR_CORRECTION_SUPPORT|EXECUTION_CAPABILITIES|EXTENSIONS|GLOBAL_(?:MEM_(?:CACHELINE_SIZE|CACHE_SIZE|CACHE_TYPE|SIZE)|VARIABLE_PREFERRED_TOTAL_SIZE)|HOST_UNIFIED_MEMORY|IL_VERSION|IMAGE(?:2D_MAX_(?:HEIGHT|WIDTH)|3D_MAX_(?:DEPTH|HEIGHT|WIDTH)|_BASE_ADDRESS_ALIGNMENT|_MAX_ARRAY_SIZE|_MAX_BUFFER_SIZE|_PITCH_ALIGNMENT|_SUPPORT)|LINKER_AVAILABLE|LOCAL_MEM_SIZE|LOCAL_MEM_TYPE|MAX_(?:CLOCK_FREQUENCY|COMPUTE_UNITS|CONSTANT_ARGS|CONSTANT_BUFFER_SIZE|GLOBAL_VARIABLE_SIZE|MEM_ALLOC_SIZE|NUM_SUB_GROUPS|ON_DEVICE_(?:EVENTS|QUEUES)|PARAMETER_SIZE|PIPE_ARGS|READ_IMAGE_ARGS|READ_WRITE_IMAGE_ARGS|SAMPLERS|WORK_GROUP_SIZE|WORK_ITEM_DIMENSIONS|WORK_ITEM_SIZES|WRITE_IMAGE_ARGS)|MEM_BASE_ADDR_ALIGN|MIN_DATA_TYPE_ALIGN_SIZE|NAME|NATIVE_VECTOR_WIDTH_(?:CHAR|DOUBLE|FLOAT|HALF|INT|LONG|SHORT)|NOT_(?:AVAILABLE|FOUND)|OPENCL_C_VERSION|PARENT_DEVICE|PARTITION_(?:AFFINITY_DOMAIN|BY_AFFINITY_DOMAIN|BY_COUNTS|BY_COUNTS_LIST_END|EQUALLY|FAILED|MAX_SUB_DEVICES|PROPERTIES|TYPE)|PIPE_MAX_(?:ACTIVE_RESERVATIONS|PACKET_SIZE)|PLATFORM|PREFERRED_(?:GLOBAL_ATOMIC_ALIGNMENT|INTEROP_USER_SYNC|LOCAL_ATOMIC_ALIGNMENT|PLATFORM_ATOMIC_ALIGNMENT|VECTOR_WIDTH_(?:CHAR|DOUBLE|FLOAT|HALF|INT|LONG|SHORT))|PRINTF_BUFFER_SIZE|PROFILE|PROFILING_TIMER_RESOLUTION|QUEUE_(?:ON_(?:DEVICE_(?:MAX_SIZE|PREFERRED_SIZE|PROPERTIES)|HOST_PROPERTIES)|PROPERTIES)|REFERENCE_COUNT|SINGLE_FP_CONFIG|SUB_GROUP_INDEPENDENT_FORWARD_PROGRESS|SVM_(?:ATOMICS|CAPABILITIES|COARSE_GRAIN_BUFFER|FINE_GRAIN_BUFFER|FINE_GRAIN_SYSTEM)|TYPE(?:_ACCELERATOR|_ALL|_CPU|_CUSTOM|_DEFAULT|_GPU)?|VENDOR(?:_ID)?|VERSION)|DRIVER_VERSION|EVENT_(?:COMMAND_(?:EXECUTION_STATUS|QUEUE|TYPE)|CONTEXT|REFERENCE_COUNT)|EXEC_(?:KERNEL|NATIVE_KERNEL|STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST)|FILTER_(?:LINEAR|NEAREST)|FLOAT|FP_(?:CORRECTLY_ROUNDED_DIVIDE_SQRT|DENORM|FMA|INF_NAN|ROUND_TO_INF|ROUND_TO_NEAREST|ROUND_TO_ZERO|SOFT_FLOAT)|GLOBAL|HALF_FLOAT|IMAGE_(?:ARRAY_SIZE|BUFFER|DEPTH|ELEMENT_SIZE|FORMAT|FORMAT_MISMATCH|FORMAT_NOT_SUPPORTED|HEIGHT|NUM_MIP_LEVELS|NUM_SAMPLES|ROW_PITCH|SLICE_PITCH|WIDTH)|INTENSITY|INVALID_(?:ARG_INDEX|ARG_SIZE|ARG_VALUE|BINARY|BUFFER_SIZE|BUILD_OPTIONS|COMMAND_QUEUE|COMPILER_OPTIONS|CONTEXT|DEVICE|DEVICE_PARTITION_COUNT|DEVICE_QUEUE|DEVICE_TYPE|EVENT|EVENT_WAIT_LIST|GLOBAL_OFFSET|GLOBAL_WORK_SIZE|GL_OBJECT|HOST_PTR|IMAGE_DESCRIPTOR|IMAGE_FORMAT_DESCRIPTOR|IMAGE_SIZE|KERNEL|KERNEL_ARGS|KERNEL_DEFINITION|KERNEL_NAME|LINKER_OPTIONS|MEM_OBJECT|MIP_LEVEL|OPERATION|PIPE_SIZE|PLATFORM|PROGRAM|PROGRAM_EXECUTABLE|PROPERTY|QUEUE_PROPERTIES|SAMPLER|VALUE|WORK_DIMENSION|WORK_GROUP_SIZE|WORK_ITEM_SIZE)|KERNEL_(?:ARG_(?:ACCESS_(?:NONE|QUALIFIER|READ_ONLY|READ_WRITE|WRITE_ONLY)|ADDRESS_(?:CONSTANT|GLOBAL|LOCAL|PRIVATE|QUALIFIER)|INFO_NOT_AVAILABLE|NAME|TYPE_(?:CONST|NAME|NONE|PIPE|QUALIFIER|RESTRICT|VOLATILE))|ATTRIBUTES|COMPILE_NUM_SUB_GROUPS|COMPILE_WORK_GROUP_SIZE|CONTEXT|EXEC_INFO_SVM_FINE_GRAIN_SYSTEM|EXEC_INFO_SVM_PTRS|FUNCTION_NAME|GLOBAL_WORK_SIZE|LOCAL_MEM_SIZE|LOCAL_SIZE_FOR_SUB_GROUP_COUNT|MAX_NUM_SUB_GROUPS|MAX_SUB_GROUP_SIZE_FOR_NDRANGE|NUM_ARGS|PREFERRED_WORK_GROUP_SIZE_MULTIPLE|PRIVATE_MEM_SIZE|PROGRAM|REFERENCE_COUNT|SUB_GROUP_COUNT_FOR_NDRANGE|WORK_GROUP_SIZE)|LINKER_NOT_AVAILABLE|LINK_PROGRAM_FAILURE|LOCAL|LUMINANCE|MAP_(?:FAILURE|READ|WRITE|WRITE_INVALIDATE_REGION)|MEM_(?:ALLOC_HOST_PTR|ASSOCIATED_MEMOBJECT|CONTEXT|COPY_HOST_PTR|COPY_OVERLAP|FLAGS|HOST_NO_ACCESS|HOST_PTR|HOST_READ_ONLY|HOST_WRITE_ONLY|KERNEL_READ_AND_WRITE|MAP_COUNT|OBJECT_(?:ALLOCATION_FAILURE|BUFFER|IMAGE1D|IMAGE1D_ARRAY|IMAGE1D_BUFFER|IMAGE2D|IMAGE2D_ARRAY|IMAGE3D|PIPE)|OFFSET|READ_ONLY|READ_WRITE|REFERENCE_COUNT|SIZE|SVM_ATOMICS|SVM_FINE_GRAIN_BUFFER|TYPE|USES_SVM_POINTER|USE_HOST_PTR|WRITE_ONLY)|MIGRATE_MEM_OBJECT_(?:CONTENT_UNDEFINED|HOST)|MISALIGNED_SUB_BUFFER_OFFSET|NONE|NON_BLOCKING|OUT_OF_(?:HOST_MEMORY|RESOURCES)|PIPE_(?:MAX_PACKETS|PACKET_SIZE)|PLATFORM_(?:EXTENSIONS|HOST_TIMER_RESOLUTION|NAME|PROFILE|VENDOR|VERSION)|PROFILING_(?:COMMAND_(?:COMPLETE|END|QUEUED|START|SUBMIT)|INFO_NOT_AVAILABLE)|PROGRAM_(?:BINARIES|BINARY_SIZES|BINARY_TYPE(?:_COMPILED_OBJECT|_EXECUTABLE|_LIBRARY|_NONE)?|BUILD_(?:GLOBAL_VARIABLE_TOTAL_SIZE|LOG|OPTIONS|STATUS)|CONTEXT|DEVICES|IL|KERNEL_NAMES|NUM_DEVICES|NUM_KERNELS|REFERENCE_COUNT|SOURCE)|QUEUED|QUEUE_(?:CONTEXT|DEVICE|DEVICE_DEFAULT|ON_DEVICE|ON_DEVICE_DEFAULT|OUT_OF_ORDER_EXEC_MODE_ENABLE|PROFILING_ENABLE|PROPERTIES|REFERENCE_COUNT|SIZE)|R|RA|READ_(?:ONLY|WRITE)_CACHE|RG|RGB|RGBA|RGBx|RGx|RUNNING|Rx|SAMPLER_(?:ADDRESSING_MODE|CONTEXT|FILTER_MODE|LOD_MAX|LOD_MIN|MIP_FILTER_MODE|NORMALIZED_COORDS|REFERENCE_COUNT)|(?:UN)?SIGNED_INT(?:8|16|32)|SNORM_INT(?:8|16)|SUBMITTED|SUCCESS|UNORM_INT(?:16|24|8|_101010|_101010_2)|UNORM_SHORT_(?:555|565)|VERSION_(?:1_0|1_1|1_2|2_0|2_1)|sBGRA|sRGB|sRGBA|sRGBx)\b/,alias:"constant"},"function-opencl-host":{pattern:/\bcl(?:BuildProgram|CloneKernel|CompileProgram|Create(?:Buffer|CommandQueue(?:WithProperties)?|Context|ContextFromType|Image|Image2D|Image3D|Kernel|KernelsInProgram|Pipe|ProgramWith(?:Binary|BuiltInKernels|IL|Source)|Sampler|SamplerWithProperties|SubBuffer|SubDevices|UserEvent)|Enqueue(?:(?:Barrier|Marker)(?:WithWaitList)?|Copy(?:Buffer(?:Rect|ToImage)?|Image(?:ToBuffer)?)|(?:Fill|Map)(?:Buffer|Image)|MigrateMemObjects|NDRangeKernel|NativeKernel|(?:Read|Write)(?:Buffer(?:Rect)?|Image)|SVM(?:Free|Map|MemFill|Memcpy|MigrateMem|Unmap)|Task|UnmapMemObject|WaitForEvents)|Finish|Flush|Get(?:CommandQueueInfo|ContextInfo|Device(?:AndHostTimer|IDs|Info)|Event(?:Profiling)?Info|ExtensionFunctionAddress(?:ForPlatform)?|HostTimer|ImageInfo|Kernel(?:ArgInfo|Info|SubGroupInfo|WorkGroupInfo)|MemObjectInfo|PipeInfo|Platform(?:IDs|Info)|Program(?:Build)?Info|SamplerInfo|SupportedImageFormats)|LinkProgram|(?:Release|Retain)(?:CommandQueue|Context|Device|Event|Kernel|MemObject|Program|Sampler)|SVM(?:Alloc|Free)|Set(?:CommandQueueProperty|DefaultDeviceCommandQueue|EventCallback|Kernel(?:Arg(?:SVMPointer)?|ExecInfo)|Kernel|MemObjectDestructorCallback|UserEventStatus)|Unload(?:Platform)?Compiler|WaitForEvents)\b/,alias:"function"}},t.languages.insertBefore("c","keyword",n),t.languages.cpp&&(n["type-opencl-host-cpp"]={pattern:/\b(?:Buffer|BufferGL|BufferRenderGL|CommandQueue|Context|Device|DeviceCommandQueue|EnqueueArgs|Event|Image|Image1D|Image1DArray|Image1DBuffer|Image2D|Image2DArray|Image2DGL|Image3D|Image3DGL|ImageFormat|ImageGL|Kernel|KernelFunctor|LocalSpaceArg|Memory|NDRange|Pipe|Platform|Program|Sampler|SVMAllocator|SVMTraitAtomic|SVMTraitCoarse|SVMTraitFine|SVMTraitReadOnly|SVMTraitReadWrite|SVMTraitWriteOnly|UserEvent)\b/,alias:"keyword"},t.languages.insertBefore("cpp","keyword",n))}e.exports=i,i.displayName="opencl",i.aliases=[]},22950(e){"use strict";function t(e){e.languages.openqasm={comment:/\/\*[\s\S]*?\*\/|\/\/.*/,string:{pattern:/"[^"\r\n\t]*"|'[^'\r\n\t]*'/,greedy:!0},keyword:/\b(?:barrier|boxas|boxto|break|const|continue|ctrl|def|defcal|defcalgrammar|delay|else|end|for|gate|gphase|if|in|include|inv|kernel|lengthof|let|measure|pow|reset|return|rotary|stretchinf|while|CX|OPENQASM|U)\b|#pragma\b/,"class-name":/\b(?:angle|bit|bool|creg|fixed|float|int|length|qreg|qubit|stretch|uint)\b/,function:/\b(?:sin|cos|tan|exp|ln|sqrt|rotl|rotr|popcount)\b(?=\s*\()/,constant:/\b(?:pi|tau|euler)\b|π|𝜏|ℇ/,number:{pattern:/(^|[^.\w$])(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?(?:dt|ns|us|µs|ms|s)?/i,lookbehind:!0},operator:/->|>>=?|<<=?|&&|\|\||\+\+|--|[!=<>&|~^+\-*/%]=?|@/,punctuation:/[(){}\[\];,:.]/},e.languages.qasm=e.languages.openqasm}e.exports=t,t.displayName="openqasm",t.aliases=["qasm"]},23254(e){"use strict";function t(e){e.languages.oz={comment:/\/\*[\s\S]*?\*\/|%.*/,string:{pattern:/"(?:[^"\\]|\\[\s\S])*"/,greedy:!0},atom:{pattern:/'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,alias:"builtin"},keyword:/\$|\[\]|\b(?:_|at|attr|case|catch|choice|class|cond|declare|define|dis|else(?:case|if)?|end|export|fail|false|feat|finally|from|fun|functor|if|import|in|local|lock|meth|nil|not|of|or|prepare|proc|prop|raise|require|self|skip|then|thread|true|try|unit)\b/,function:[/\b[a-z][A-Za-z\d]*(?=\()/,{pattern:/(\{)[A-Z][A-Za-z\d]*\b/,lookbehind:!0}],number:/\b(?:0[bx][\da-f]+|\d+(?:\.\d*)?(?:e~?\d+)?)\b|&(?:[^\\]|\\(?:\d{3}|.))/i,variable:/\b[A-Z][A-Za-z\d]*|`(?:[^`\\]|\\.)+`/,"attr-name":/\b\w+(?=:)/,operator:/:(?:=|::?)|<[-:=]?|=(?:=|=?:?|\\=:?|!!?|[|#+\-*\/,~^@]|\b(?:andthen|div|mod|orelse)\b/,punctuation:/[\[\](){}.:;?]/}}e.exports=t,t.displayName="oz",t.aliases=[]},92694(e){"use strict";function t(e){var t;e.languages.parigp={comment:/\/\*[\s\S]*?\*\/|\\\\.*/,string:{pattern:/"(?:[^"\\\r\n]|\\.)*"/,greedy:!0},keyword:RegExp("\\b(?:"+(t=(t=["breakpoint","break","dbg_down","dbg_err","dbg_up","dbg_x","forcomposite","fordiv","forell","forpart","forprime","forstep","forsubgroup","forvec","for","iferr","if","local","my","next","return","until","while"]).map(function(e){return e.split("").join(" *")}).join("|"))+")\\b"),function:/\b\w(?:[\w ]*\w)?(?= *\()/,number:{pattern:/((?:\. *\. *)?)(?:\b\d(?: *\d)*(?: *(?!\. *\.)\.(?: *\d)*)?|\. *\d(?: *\d)*)(?: *e *(?:[+-] *)?\d(?: *\d)*)?/i,lookbehind:!0},operator:/\. *\.|[*\/!](?: *=)?|%(?: *=|(?: *#)?(?: *')*)?|\+(?: *[+=])?|-(?: *[-=>])?|<(?: *>|(?: *<)?(?: *=)?)?|>(?: *>)?(?: *=)?|=(?: *=){0,2}|\\(?: *\/)?(?: *=)?|&(?: *&)?|\| *\||['#~^]/,punctuation:/[\[\]{}().,:;|]/}}e.exports=t,t.displayName="parigp",t.aliases=[]},43273(e){"use strict";function t(e){var t,n;n=(t=e).languages.parser=t.languages.extend("markup",{keyword:{pattern:/(^|[^^])(?:\^(?:case|eval|for|if|switch|throw)\b|@(?:BASE|CLASS|GET(?:_DEFAULT)?|OPTIONS|SET_DEFAULT|USE)\b)/,lookbehind:!0},variable:{pattern:/(^|[^^])\B\$(?:\w+|(?=[.{]))(?:(?:\.|::?)\w+)*(?:\.|::?)?/,lookbehind:!0,inside:{punctuation:/\.|:+/}},function:{pattern:/(^|[^^])\B[@^]\w+(?:(?:\.|::?)\w+)*(?:\.|::?)?/,lookbehind:!0,inside:{keyword:{pattern:/(^@)(?:GET_|SET_)/,lookbehind:!0},punctuation:/\.|:+/}},escape:{pattern:/\^(?:[$^;@()\[\]{}"':]|#[a-f\d]*)/i,alias:"builtin"},punctuation:/[\[\](){};]/}),n=t.languages.insertBefore("parser","keyword",{"parser-comment":{pattern:/(\s)#.*/,lookbehind:!0,alias:"comment"},expression:{pattern:/(^|[^^])\((?:[^()]|\((?:[^()]|\((?:[^()])*\))*\))*\)/,greedy:!0,lookbehind:!0,inside:{string:{pattern:/(^|[^^])(["'])(?:(?!\2)[^^]|\^[\s\S])*\2/,lookbehind:!0},keyword:n.keyword,variable:n.variable,function:n.function,boolean:/\b(?:true|false)\b/,number:/\b(?:0x[a-f\d]+|\d+(?:\.\d*)?(?:e[+-]?\d+)?)\b/i,escape:n.escape,operator:/[~+*\/\\%]|!(?:\|\|?|=)?|&&?|\|\|?|==|<[<=]?|>[>=]?|-[fd]?|\b(?:def|eq|ge|gt|in|is|le|lt|ne)\b/,punctuation:n.punctuation}}}),t.languages.insertBefore("inside","punctuation",{expression:n.expression,keyword:n.keyword,variable:n.variable,function:n.function,escape:n.escape,"parser-punctuation":{pattern:n.punctuation,alias:"punctuation"}},n.tag.inside["attr-value"])}e.exports=t,t.displayName="parser",t.aliases=[]},60718(e){"use strict";function t(e){e.languages.pascal={comment:[/\(\*[\s\S]+?\*\)/,/\{[\s\S]+?\}/,/\/\/.*/],string:{pattern:/(?:'(?:''|[^'\r\n])*'(?!')|#[&$%]?[a-f\d]+)+|\^[a-z]/i,greedy:!0},keyword:[{pattern:/(^|[^&])\b(?:absolute|array|asm|begin|case|const|constructor|destructor|do|downto|else|end|file|for|function|goto|if|implementation|inherited|inline|interface|label|nil|object|of|operator|packed|procedure|program|record|reintroduce|repeat|self|set|string|then|to|type|unit|until|uses|var|while|with)\b/i,lookbehind:!0},{pattern:/(^|[^&])\b(?:dispose|exit|false|new|true)\b/i,lookbehind:!0},{pattern:/(^|[^&])\b(?:class|dispinterface|except|exports|finalization|finally|initialization|inline|library|on|out|packed|property|raise|resourcestring|threadvar|try)\b/i,lookbehind:!0},{pattern:/(^|[^&])\b(?:absolute|abstract|alias|assembler|bitpacked|break|cdecl|continue|cppdecl|cvar|default|deprecated|dynamic|enumerator|experimental|export|external|far|far16|forward|generic|helper|implements|index|interrupt|iochecks|local|message|name|near|nodefault|noreturn|nostackframe|oldfpccall|otherwise|overload|override|pascal|platform|private|protected|public|published|read|register|reintroduce|result|safecall|saveregisters|softfloat|specialize|static|stdcall|stored|strict|unaligned|unimplemented|varargs|virtual|write)\b/i,lookbehind:!0}],number:[/(?:[&%]\d+|\$[a-f\d]+)/i,/\b\d+(?:\.\d+)?(?:e[+-]?\d+)?/i],operator:[/\.\.|\*\*|:=|<[<=>]?|>[>=]?|[+\-*\/]=?|[@^=]/i,{pattern:/(^|[^&])\b(?:and|as|div|exclude|in|include|is|mod|not|or|shl|shr|xor)\b/,lookbehind:!0}],punctuation:/\(\.|\.\)|[()\[\]:;,.]/},e.languages.objectpascal=e.languages.pascal}e.exports=t,t.displayName="pascal",t.aliases=["objectpascal"]},39303(e){"use strict";function t(e){var t,n,r,i,a;t=e,n=/\((?:[^()]|\((?:[^()]|\([^()]*\))*\))*\)/.source,r=/(?:\b\w+(?:)?|)/.source.replace(//g,function(){return n}),i=t.languages.pascaligo={comment:/\(\*[\s\S]+?\*\)|\/\/.*/,string:{pattern:/(["'`])(?:\\[\s\S]|(?!\1)[^\\])*\1|\^[a-z]/i,greedy:!0},"class-name":[{pattern:RegExp(/(\btype\s+\w+\s+is\s+)/.source.replace(//g,function(){return r}),"i"),lookbehind:!0,inside:null},{pattern:RegExp(/(?=\s+is\b)/.source.replace(//g,function(){return r}),"i"),inside:null},{pattern:RegExp(/(:\s*)/.source.replace(//g,function(){return r})),lookbehind:!0,inside:null}],keyword:{pattern:/(^|[^&])\b(?:begin|block|case|const|else|end|fail|for|from|function|if|is|nil|of|remove|return|skip|then|type|var|while|with)\b/i,lookbehind:!0},boolean:{pattern:/(^|[^&])\b(?:True|False)\b/i,lookbehind:!0},builtin:{pattern:/(^|[^&])\b(?:bool|int|list|map|nat|record|string|unit)\b/i,lookbehind:!0},function:/\b\w+(?=\s*\()/i,number:[/%[01]+|&[0-7]+|\$[a-f\d]+/i,/\b\d+(?:\.\d+)?(?:e[+-]?\d+)?(?:mtz|n)?/i],operator:/->|=\/=|\.\.|\*\*|:=|<[<=>]?|>[>=]?|[+\-*\/]=?|[@^=|]|\b(?:and|mod|or)\b/,punctuation:/\(\.|\.\)|[()\[\]:;,.{}]/},a=["comment","keyword","builtin","operator","punctuation"].reduce(function(e,t){return e[t]=i[t],e},{}),i["class-name"].forEach(function(e){e.inside=a})}e.exports=t,t.displayName="pascaligo",t.aliases=[]},77393(e){"use strict";function t(e){e.languages.pcaxis={string:/"[^"]*"/,keyword:{pattern:/((?:^|;)\s*)[-A-Z\d]+(?:\s*\[[-\w]+\])?(?:\s*\("[^"]*"(?:,\s*"[^"]*")*\))?(?=\s*=)/,lookbehind:!0,greedy:!0,inside:{keyword:/^[-A-Z\d]+/,language:{pattern:/^(\s*)\[[-\w]+\]/,lookbehind:!0,inside:{punctuation:/^\[|\]$/,property:/[-\w]+/}},"sub-key":{pattern:/^(\s*)\S[\s\S]*/,lookbehind:!0,inside:{parameter:{pattern:/"[^"]*"/,alias:"property"},punctuation:/^\(|\)$|,/}}}},operator:/=/,tlist:{pattern:/TLIST\s*\(\s*\w+(?:(?:\s*,\s*"[^"]*")+|\s*,\s*"[^"]*"-"[^"]*")?\s*\)/,greedy:!0,inside:{function:/^TLIST/,property:{pattern:/^(\s*\(\s*)\w+/,lookbehind:!0},string:/"[^"]*"/,punctuation:/[(),]/,operator:/-/}},punctuation:/[;,]/,number:{pattern:/(^|\s)\d+(?:\.\d+)?(?!\S)/,lookbehind:!0},boolean:/YES|NO/},e.languages.px=e.languages.pcaxis}e.exports=t,t.displayName="pcaxis",t.aliases=["px"]},19023(e){"use strict";function t(e){e.languages.peoplecode={comment:RegExp([/\/\*[\s\S]*?\*\//.source,/\bREM[^;]*;/.source,/<\*(?:[^<*]|\*(?!>)|<(?!\*)|<\*(?:(?!\*>)[\s\S])*\*>)*\*>/.source,/\/\+[\s\S]*?\+\//.source].join("|")),string:{pattern:/'(?:''|[^'\r\n])*'(?!')|"(?:""|[^"\r\n])*"(?!")/,greedy:!0},variable:/%\w+/,"function-definition":{pattern:/((?:^|[^\w-])(?:function|method)\s+)\w+/i,lookbehind:!0,alias:"function"},"class-name":{pattern:/((?:^|[^-\w])(?:as|catch|class|component|create|extends|global|implements|instance|local|of|property|returns)\s+)\w+(?::\w+)*/i,lookbehind:!0,inside:{punctuation:/:/}},keyword:/\b(?:abstract|alias|as|catch|class|component|constant|create|declare|else|end-(?:class|evaluate|for|function|get|if|method|set|try|while)|evaluate|extends|for|function|get|global|implements|import|instance|if|library|local|method|null|of|out|peopleCode|private|program|property|protected|readonly|ref|repeat|returns?|set|step|then|throw|to|try|until|value|when(?:-other)?|while)\b/i,"operator-keyword":{pattern:/\b(?:and|not|or)\b/i,alias:"operator"},function:/[_a-z]\w*(?=\s*\()/i,boolean:/\b(?:false|true)\b/i,number:/\b\d+(?:\.\d+)?\b/,operator:/<>|[<>]=?|!=|\*\*|[-+*/|=@]/,punctuation:/[:.;,()[\]]/},e.languages.pcode=e.languages.peoplecode}e.exports=t,t.displayName="peoplecode",t.aliases=["pcode"]},74212(e){"use strict";function t(e){e.languages.perl={comment:[{pattern:/(^\s*)=\w[\s\S]*?=cut.*/m,lookbehind:!0},{pattern:/(^|[^\\$])#.*/,lookbehind:!0}],string:[{pattern:/\b(?:q|qq|qx|qw)\s*([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1/,greedy:!0},{pattern:/\b(?:q|qq|qx|qw)\s+([a-zA-Z0-9])(?:(?!\1)[^\\]|\\[\s\S])*\1/,greedy:!0},{pattern:/\b(?:q|qq|qx|qw)\s*\((?:[^()\\]|\\[\s\S])*\)/,greedy:!0},{pattern:/\b(?:q|qq|qx|qw)\s*\{(?:[^{}\\]|\\[\s\S])*\}/,greedy:!0},{pattern:/\b(?:q|qq|qx|qw)\s*\[(?:[^[\]\\]|\\[\s\S])*\]/,greedy:!0},{pattern:/\b(?:q|qq|qx|qw)\s*<(?:[^<>\\]|\\[\s\S])*>/,greedy:!0},{pattern:/("|`)(?:(?!\1)[^\\]|\\[\s\S])*\1/,greedy:!0},{pattern:/'(?:[^'\\\r\n]|\\.)*'/,greedy:!0}],regex:[{pattern:/\b(?:m|qr)\s*([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1[msixpodualngc]*/,greedy:!0},{pattern:/\b(?:m|qr)\s+([a-zA-Z0-9])(?:(?!\1)[^\\]|\\[\s\S])*\1[msixpodualngc]*/,greedy:!0},{pattern:/\b(?:m|qr)\s*\((?:[^()\\]|\\[\s\S])*\)[msixpodualngc]*/,greedy:!0},{pattern:/\b(?:m|qr)\s*\{(?:[^{}\\]|\\[\s\S])*\}[msixpodualngc]*/,greedy:!0},{pattern:/\b(?:m|qr)\s*\[(?:[^[\]\\]|\\[\s\S])*\][msixpodualngc]*/,greedy:!0},{pattern:/\b(?:m|qr)\s*<(?:[^<>\\]|\\[\s\S])*>[msixpodualngc]*/,greedy:!0},{pattern:/(^|[^-]\b)(?:s|tr|y)\s*([^a-zA-Z0-9\s{(\[<])(?:(?!\2)[^\\]|\\[\s\S])*\2(?:(?!\2)[^\\]|\\[\s\S])*\2[msixpodualngcer]*/,lookbehind:!0,greedy:!0},{pattern:/(^|[^-]\b)(?:s|tr|y)\s+([a-zA-Z0-9])(?:(?!\2)[^\\]|\\[\s\S])*\2(?:(?!\2)[^\\]|\\[\s\S])*\2[msixpodualngcer]*/,lookbehind:!0,greedy:!0},{pattern:/(^|[^-]\b)(?:s|tr|y)\s*\((?:[^()\\]|\\[\s\S])*\)\s*\((?:[^()\\]|\\[\s\S])*\)[msixpodualngcer]*/,lookbehind:!0,greedy:!0},{pattern:/(^|[^-]\b)(?:s|tr|y)\s*\{(?:[^{}\\]|\\[\s\S])*\}\s*\{(?:[^{}\\]|\\[\s\S])*\}[msixpodualngcer]*/,lookbehind:!0,greedy:!0},{pattern:/(^|[^-]\b)(?:s|tr|y)\s*\[(?:[^[\]\\]|\\[\s\S])*\]\s*\[(?:[^[\]\\]|\\[\s\S])*\][msixpodualngcer]*/,lookbehind:!0,greedy:!0},{pattern:/(^|[^-]\b)(?:s|tr|y)\s*<(?:[^<>\\]|\\[\s\S])*>\s*<(?:[^<>\\]|\\[\s\S])*>[msixpodualngcer]*/,lookbehind:!0,greedy:!0},{pattern:/\/(?:[^\/\\\r\n]|\\.)*\/[msixpodualngc]*(?=\s*(?:$|[\r\n,.;})&|\-+*~<>!?^]|(?:lt|gt|le|ge|eq|ne|cmp|not|and|or|xor|x)\b))/,greedy:!0}],variable:[/[&*$@%]\{\^[A-Z]+\}/,/[&*$@%]\^[A-Z_]/,/[&*$@%]#?(?=\{)/,/[&*$@%]#?(?:(?:::)*'?(?!\d)[\w$]+(?![\w$]))+(?:::)*/i,/[&*$@%]\d+/,/(?!%=)[$@%][!"#$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~]/],filehandle:{pattern:/<(?![<=])\S*>|\b_\b/,alias:"symbol"},vstring:{pattern:/v\d+(?:\.\d+)*|\d+(?:\.\d+){2,}/,alias:"string"},function:{pattern:/sub \w+/i,inside:{keyword:/sub/}},keyword:/\b(?:any|break|continue|default|delete|die|do|else|elsif|eval|for|foreach|given|goto|if|last|local|my|next|our|package|print|redo|require|return|say|state|sub|switch|undef|unless|until|use|when|while)\b/,number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)\b/,operator:/-[rwxoRWXOezsfdlpSbctugkTBMAC]\b|\+[+=]?|-[-=>]?|\*\*?=?|\/\/?=?|=[=~>]?|~[~=]?|\|\|?=?|&&?=?|<(?:=>?|<=?)?|>>?=?|![~=]?|[%^]=?|\.(?:=|\.\.?)?|[\\?]|\bx(?:=|\b)|\b(?:lt|gt|le|ge|eq|ne|cmp|not|and|or|xor)\b/,punctuation:/[{}[\];(),:]/}}e.exports=t,t.displayName="perl",t.aliases=[]},5137(e,t,n){"use strict";var r=n(88262);function i(e){e.register(r),e.languages.insertBefore("php","variable",{this:/\$this\b/,global:/\$(?:_(?:SERVER|GET|POST|FILES|REQUEST|SESSION|ENV|COOKIE)|GLOBALS|HTTP_RAW_POST_DATA|argc|argv|php_errormsg|http_response_header)\b/,scope:{pattern:/\b[\w\\]+::/,inside:{keyword:/static|self|parent/,punctuation:/::|\\/}}})}e.exports=i,i.displayName="phpExtras",i.aliases=[]},88262(e,t,n){"use strict";var r=n(93205);function i(e){var t,n,i,a,o,s,u,c;e.register(r),n=/\/\*[\s\S]*?\*\/|\/\/.*|#(?!\[).*/,i=[{pattern:/\b(?:false|true)\b/i,alias:"boolean"},{pattern:/(::\s*)\b[a-z_]\w*\b(?!\s*\()/i,greedy:!0,lookbehind:!0},{pattern:/(\b(?:case|const)\s+)\b[a-z_]\w*(?=\s*[;=])/i,greedy:!0,lookbehind:!0},/\b(?:null)\b/i,/\b[A-Z_][A-Z0-9_]*\b(?!\s*\()/],a=/\b0b[01]+(?:_[01]+)*\b|\b0o[0-7]+(?:_[0-7]+)*\b|\b0x[\da-f]+(?:_[\da-f]+)*\b|(?:\b\d+(?:_\d+)*\.?(?:\d+(?:_\d+)*)?|\B\.\d+)(?:e[+-]?\d+)?/i,o=/|\?\?=?|\.{3}|\??->|[!=]=?=?|::|\*\*=?|--|\+\+|&&|\|\||<<|>>|[?~]|[/^|%*&<>.+-]=?/,s=/[{}\[\](),:;]/,(t=e).languages.php={delimiter:{pattern:/\?>$|^<\?(?:php(?=\s)|=)?/i,alias:"important"},comment:n,variable:/\$+(?:\w+\b|(?=\{))/i,package:{pattern:/(namespace\s+|use\s+(?:function\s+)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,lookbehind:!0,inside:{punctuation:/\\/}},"class-name-definition":{pattern:/(\b(?:class|enum|interface|trait)\s+)\b[a-z_]\w*(?!\\)\b/i,lookbehind:!0,alias:"class-name"},"function-definition":{pattern:/(\bfunction\s+)[a-z_]\w*(?=\s*\()/i,lookbehind:!0,alias:"function"},keyword:[{pattern:/(\(\s*)\b(?:bool|boolean|int|integer|float|string|object|array)\b(?=\s*\))/i,alias:"type-casting",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)\b(?:bool|int|float|string|object|array(?!\s*\()|mixed|self|static|callable|iterable|(?:null|false)(?=\s*\|))\b(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*[\w|]\|\s*)(?:null|false)\b(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b(?:bool|int|float|string|object|void|array(?!\s*\()|mixed|self|static|callable|iterable|(?:null|false)(?=\s*\|))\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?[\w|]\|\s*)(?:null|false)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/\b(?:bool|int|float|string|object|void|array(?!\s*\()|mixed|iterable|(?:null|false)(?=\s*\|))\b/i,alias:"type-declaration",greedy:!0},{pattern:/(\|\s*)(?:null|false)\b/i,alias:"type-declaration",greedy:!0,lookbehind:!0},{pattern:/\b(?:parent|self|static)(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(\byield\s+)from\b/i,lookbehind:!0},/\bclass\b/i,{pattern:/((?:^|[^\s>:]|(?:^|[^-])>|(?:^|[^:]):)\s*)\b(?:__halt_compiler|abstract|and|array|as|break|callable|case|catch|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|enum|eval|exit|extends|final|finally|fn|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|namespace|match|new|or|parent|print|private|protected|public|require|require_once|return|self|static|switch|throw|trait|try|unset|use|var|while|xor|yield)\b/i,lookbehind:!0}],"argument-name":{pattern:/([(,]\s+)\b[a-z_]\w*(?=\s*:(?!:))/i,lookbehind:!0},"class-name":[{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self|\s+static))\s+|\bcatch\s*\()\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/(\|\s*)\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/\b[a-z_]\w*(?!\\)\b(?=\s*\|)/i,greedy:!0},{pattern:/(\|\s*)(?:\\?\b[a-z_]\w*)+\b/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(?:\\?\b[a-z_]\w*)+\b(?=\s*\|)/i,alias:"class-name-fully-qualified",greedy:!0,inside:{punctuation:/\\/}},{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self\b|\s+static\b))\s+|\bcatch\s*\()(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*\$)/i,alias:"type-declaration",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-declaration"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*::)/i,alias:["class-name-fully-qualified","static-context"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/([(,?]\s*)[a-z_]\w*(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-hint"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b[a-z_]\w*(?!\\)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:["class-name-fully-qualified","return-type"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:i,function:{pattern:/(^|[^\\\w])\\?[a-z_](?:[\w\\]*\w)?(?=\s*\()/i,lookbehind:!0,inside:{punctuation:/\\/}},property:{pattern:/(->\s*)\w+/,lookbehind:!0},number:a,operator:o,punctuation:s},c=[{pattern:/<<<'([^']+)'[\r\n](?:.*[\r\n])*?\1;/,alias:"nowdoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<'[^']+'|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<'?|[';]$/}}}},{pattern:/<<<(?:"([^"]+)"[\r\n](?:.*[\r\n])*?\1;|([a-z_]\w*)[\r\n](?:.*[\r\n])*?\2;)/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<(?:"[^"]+"|[a-z_]\w*)|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<"?|[";]$/}},interpolation:u={pattern:/\{\$(?:\{(?:\{[^{}]+\}|[^{}]+)\}|[^{}])+\}|(^|[^\\{])\$+(?:\w+(?:\[[^\r\n\[\]]+\]|->\w+)?)/,lookbehind:!0,inside:t.languages.php}}},{pattern:/`(?:\\[\s\S]|[^\\`])*`/,alias:"backtick-quoted-string",greedy:!0},{pattern:/'(?:\\[\s\S]|[^\\'])*'/,alias:"single-quoted-string",greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,alias:"double-quoted-string",greedy:!0,inside:{interpolation:u}}],t.languages.insertBefore("php","variable",{string:c,attribute:{pattern:/#\[(?:[^"'\/#]|\/(?![*/])|\/\/.*$|#(?!\[).*$|\/\*(?:[^*]|\*(?!\/))*\*\/|"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*')+\](?=\s*[a-z$#])/im,greedy:!0,inside:{"attribute-content":{pattern:/^(#\[)[\s\S]+(?=\]$)/,lookbehind:!0,inside:{comment:n,string:c,"attribute-class-name":[{pattern:/([^:]|^)\b[a-z_]\w*(?!\\)\b/i,alias:"class-name",greedy:!0,lookbehind:!0},{pattern:/([^:]|^)(?:\\?\b[a-z_]\w*)+/i,alias:["class-name","class-name-fully-qualified"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:i,number:a,operator:o,punctuation:s}},delimiter:{pattern:/^#\[|\]$/,alias:"punctuation"}}}}),t.hooks.add("before-tokenize",function(e){if(/<\?/.test(e.code)){var n=/<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#(?!\[))(?:[^?\n\r]|\?(?!>))*(?=$|\?>|[\r\n])|#\[|\/\*(?:[^*]|\*(?!\/))*(?:\*\/|$))*?(?:\?>|$)/gi;t.languages["markup-templating"].buildPlaceholders(e,"php",n)}}),t.hooks.add("after-tokenize",function(e){t.languages["markup-templating"].tokenizePlaceholders(e,"php")})}e.exports=i,i.displayName="php",i.aliases=[]},63632(e,t,n){"use strict";var r=n(88262),i=n(9858);function a(e){var t,n;e.register(r),e.register(i),n=/(?:\b[a-zA-Z]\w*|[|\\[\]])+/.source,(t=e).languages.phpdoc=t.languages.extend("javadoclike",{parameter:{pattern:RegExp("(@(?:global|param|property(?:-read|-write)?|var)\\s+(?:"+n+"\\s+)?)\\$\\w+"),lookbehind:!0}}),t.languages.insertBefore("phpdoc","keyword",{"class-name":[{pattern:RegExp("(@(?:global|package|param|property(?:-read|-write)?|return|subpackage|throws|var)\\s+)"+n),lookbehind:!0,inside:{keyword:/\b(?:callback|resource|boolean|integer|double|object|string|array|false|float|mixed|bool|null|self|true|void|int)\b/,punctuation:/[|\\[\]()]/}}]}),t.languages.javadoclike.addSupport("php",t.languages.phpdoc)}e.exports=a,a.displayName="phpdoc",a.aliases=[]},59149(e,t,n){"use strict";var r=n(11114);function i(e){var t,n,i,a;e.register(r),Array.isArray(i=(n=(t=e).languages.plsql=t.languages.extend("sql",{comment:[/\/\*[\s\S]*?\*\//,/--.*/]})).keyword)||(i=n.keyword=[i]),i.unshift(/\b(?:ACCESS|AGENT|AGGREGATE|ARRAY|ARROW|AT|ATTRIBUTE|AUDIT|AUTHID|BFILE_BASE|BLOB_BASE|BLOCK|BODY|BOTH|BOUND|BYTE|CALLING|CHAR_BASE|CHARSET(?:FORM|ID)|CLOB_BASE|COLAUTH|COLLECT|CLUSTERS?|COMPILED|COMPRESS|CONSTANT|CONSTRUCTOR|CONTEXT|CRASH|CUSTOMDATUM|DANGLING|DATE_BASE|DEFINE|DETERMINISTIC|DURATION|ELEMENT|EMPTY|EXCEPTIONS?|EXCLUSIVE|EXTERNAL|FINAL|FORALL|FORM|FOUND|GENERAL|HEAP|HIDDEN|IDENTIFIED|IMMEDIATE|INCLUDING|INCREMENT|INDICATOR|INDEXES|INDICES|INFINITE|INITIAL|ISOPEN|INSTANTIABLE|INTERFACE|INVALIDATE|JAVA|LARGE|LEADING|LENGTH|LIBRARY|LIKE[24C]|LIMITED|LONG|LOOP|MAP|MAXEXTENTS|MAXLEN|MEMBER|MINUS|MLSLABEL|MULTISET|NAME|NAN|NATIVE|NEW|NOAUDIT|NOCOMPRESS|NOCOPY|NOTFOUND|NOWAIT|NUMBER(?:_BASE)?|OBJECT|OCI(?:COLL|DATE|DATETIME|DURATION|INTERVAL|LOBLOCATOR|NUMBER|RAW|REF|REFCURSOR|ROWID|STRING|TYPE)|OFFLINE|ONLINE|ONLY|OPAQUE|OPERATOR|ORACLE|ORADATA|ORGANIZATION|ORL(?:ANY|VARY)|OTHERS|OVERLAPS|OVERRIDING|PACKAGE|PARALLEL_ENABLE|PARAMETERS?|PASCAL|PCTFREE|PIPE(?:LINED)?|PRAGMA|PRIOR|PRIVATE|RAISE|RANGE|RAW|RECORD|REF|REFERENCE|REM|REMAINDER|RESULT|RESOURCE|RETURNING|REVERSE|ROW(?:ID|NUM|TYPE)|SAMPLE|SB[124]|SEGMENT|SELF|SEPARATE|SEQUENCE|SHORT|SIZE(?:_T)?|SPARSE|SQL(?:CODE|DATA|NAME|STATE)|STANDARD|STATIC|STDDEV|STORED|STRING|STRUCT|STYLE|SUBMULTISET|SUBPARTITION|SUBSTITUTABLE|SUBTYPE|SUCCESSFUL|SYNONYM|SYSDATE|TABAUTH|TDO|THE|TIMEZONE_(?:ABBR|HOUR|MINUTE|REGION)|TRAILING|TRANSAC(?:TIONAL)?|TRUSTED|UB[124]|UID|UNDER|UNTRUSTED|VALIDATE|VALIST|VARCHAR2|VARIABLE|VARIANCE|VARRAY|VIEWS|VOID|WHENEVER|WRAPPED|ZONE)\b/i),Array.isArray(a=n.operator)||(a=n.operator=[a]),a.unshift(/:=/)}e.exports=i,i.displayName="plsql",i.aliases=[]},50256(e){"use strict";function t(e){e.languages.powerquery={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:\/\/).*)/,lookbehind:!0},"quoted-identifier":{pattern:/#"(?:[^"\r\n]|"")*"(?!")/,greedy:!0,alias:"variable"},string:{pattern:/"(?:[^"\r\n]|"")*"(?!")/,greedy:!0},constant:[/\bDay\.(?:Sunday|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday)\b/,/\bTraceLevel\.(?:Critical|Error|Information|Verbose|Warning)\b/,/\bOccurrence\.(?:First|Last|All)\b/,/\bOrder\.(?:Ascending|Descending)\b/,/\bRoundingMode\.(?:AwayFromZero|Down|ToEven|TowardZero|Up)\b/,/\bMissingField\.(?:Error|Ignore|UseNull)\b/,/\bQuoteStyle\.(?:Csv|None)\b/,/\bJoinKind\.(?:Inner|LeftOuter|RightOuter|FullOuter|LeftAnti|RightAnti)\b/,/\bGroupKind\.(?:Global|Local)\b/,/\bExtraValues\.(?:List|Ignore|Error)\b/,/\bJoinAlgorithm\.(?:Dynamic|PairwiseHash|SortMerge|LeftHash|RightHash|LeftIndex|RightIndex)\b/,/\bJoinSide\.(?:Left|Right)\b/,/\bPrecision\.(?:Double|Decimal)\b/,/\bRelativePosition\.From(?:End|Start)\b/,/\bTextEncoding\.(?:Ascii|BigEndianUnicode|Unicode|Utf8|Utf16|Windows)\b/,/\b(?:Any|Binary|Date|DateTime|DateTimeZone|Duration|Int8|Int16|Int32|Int64|Function|List|Logical|None|Number|Record|Table|Text|Time)\.Type\b/,/\bnull\b/],boolean:/\b(?:true|false)\b/,keyword:/\b(?:and|as|each|else|error|if|in|is|let|meta|not|nullable|optional|or|otherwise|section|shared|then|try|type)\b|#(?:binary|date|datetime|datetimezone|duration|infinity|nan|sections|shared|table|time)\b/,function:{pattern:/(^|[^#\w.])(?!\d)[\w.]+(?=\s*\()/,lookbehind:!0},"data-type":{pattern:/\b(?:any|anynonnull|binary|date|datetime|datetimezone|duration|function|list|logical|none|number|record|table|text|time|type)\b/,alias:"variable"},number:{pattern:/\b0x[\da-f]+\b|(?:[+-]?(?:\b\d+\.)?\b\d+|[+-]\.\d+|(^|[^.])\B\.\d+)(?:e[+-]?\d+)?\b/i,lookbehind:!0},operator:/[-+*\/&?@^]|<(?:=>?|>)?|>=?|=>?|\.\.\.?/,punctuation:/[,;\[\](){}]/},e.languages.pq=e.languages.powerquery,e.languages.mscript=e.languages.powerquery}e.exports=t,t.displayName="powerquery",t.aliases=[]},61777(e){"use strict";function t(e){var t,n,r;(r=(n=(t=e).languages.powershell={comment:[{pattern:/(^|[^`])<#[\s\S]*?#>/,lookbehind:!0},{pattern:/(^|[^`])#.*/,lookbehind:!0}],string:[{pattern:/"(?:`[\s\S]|[^`"])*"/,greedy:!0,inside:{function:{pattern:/(^|[^`])\$\((?:\$\([^\r\n()]*\)|(?!\$\()[^\r\n)])*\)/,lookbehind:!0,inside:{}}}},{pattern:/'(?:[^']|'')*'/,greedy:!0}],namespace:/\[[a-z](?:\[(?:\[[^\]]*\]|[^\[\]])*\]|[^\[\]])*\]/i,boolean:/\$(?:true|false)\b/i,variable:/\$\w+\b/,function:[/\b(?:Add|Approve|Assert|Backup|Block|Checkpoint|Clear|Close|Compare|Complete|Compress|Confirm|Connect|Convert|ConvertFrom|ConvertTo|Copy|Debug|Deny|Disable|Disconnect|Dismount|Edit|Enable|Enter|Exit|Expand|Export|Find|ForEach|Format|Get|Grant|Group|Hide|Import|Initialize|Install|Invoke|Join|Limit|Lock|Measure|Merge|Move|New|Open|Optimize|Out|Ping|Pop|Protect|Publish|Push|Read|Receive|Redo|Register|Remove|Rename|Repair|Request|Reset|Resize|Resolve|Restart|Restore|Resume|Revoke|Save|Search|Select|Send|Set|Show|Skip|Sort|Split|Start|Step|Stop|Submit|Suspend|Switch|Sync|Tee|Test|Trace|Unblock|Undo|Uninstall|Unlock|Unprotect|Unpublish|Unregister|Update|Use|Wait|Watch|Where|Write)-[a-z]+\b/i,/\b(?:ac|cat|chdir|clc|cli|clp|clv|compare|copy|cp|cpi|cpp|cvpa|dbp|del|diff|dir|ebp|echo|epal|epcsv|epsn|erase|fc|fl|ft|fw|gal|gbp|gc|gci|gcs|gdr|gi|gl|gm|gp|gps|group|gsv|gu|gv|gwmi|iex|ii|ipal|ipcsv|ipsn|irm|iwmi|iwr|kill|lp|ls|measure|mi|mount|move|mp|mv|nal|ndr|ni|nv|ogv|popd|ps|pushd|pwd|rbp|rd|rdr|ren|ri|rm|rmdir|rni|rnp|rp|rv|rvpa|rwmi|sal|saps|sasv|sbp|sc|select|set|shcm|si|sl|sleep|sls|sort|sp|spps|spsv|start|sv|swmi|tee|trcm|type|write)\b/i],keyword:/\b(?:Begin|Break|Catch|Class|Continue|Data|Define|Do|DynamicParam|Else|ElseIf|End|Exit|Filter|Finally|For|ForEach|From|Function|If|InlineScript|Parallel|Param|Process|Return|Sequence|Switch|Throw|Trap|Try|Until|Using|Var|While|Workflow)\b/i,operator:{pattern:/(\W?)(?:!|-(?:eq|ne|gt|ge|lt|le|sh[lr]|not|b?(?:and|x?or)|(?:Not)?(?:Like|Match|Contains|In)|Replace|Join|is(?:Not)?|as)\b|-[-=]?|\+[+=]?|[*\/%]=?)/i,lookbehind:!0},punctuation:/[|{}[\];(),.]/}).string[0].inside).boolean=n.boolean,r.variable=n.variable,r.function.inside=n}e.exports=t,t.displayName="powershell",t.aliases=[]},3623(e){"use strict";function t(e){e.languages.processing=e.languages.extend("clike",{keyword:/\b(?:break|catch|case|class|continue|default|else|extends|final|for|if|implements|import|new|null|private|public|return|static|super|switch|this|try|void|while)\b/,operator:/<[<=]?|>[>=]?|&&?|\|\|?|[%?]|[!=+\-*\/]=?/}),e.languages.insertBefore("processing","number",{constant:/\b(?!XML\b)[A-Z][A-Z\d_]+\b/,type:{pattern:/\b(?:boolean|byte|char|color|double|float|int|[A-Z]\w*)\b/,alias:"variable"}}),e.languages.processing.function=/\b\w+(?=\s*\()/,e.languages.processing["class-name"].alias="variable"}e.exports=t,t.displayName="processing",t.aliases=[]},82707(e){"use strict";function t(e){e.languages.prolog={comment:[/%.+/,/\/\*[\s\S]*?\*\//],string:{pattern:/(["'])(?:\1\1|\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},builtin:/\b(?:fx|fy|xf[xy]?|yfx?)\b/,variable:/\b[A-Z_]\w*/,function:/\b[a-z]\w*(?:(?=\()|\/\d+)/,number:/\b\d+(?:\.\d*)?/,operator:/[:\\=><\-?*@\/;+^|!$.]+|\b(?:is|mod|not|xor)\b/,punctuation:/[(){}\[\],]/}}e.exports=t,t.displayName="prolog",t.aliases=[]},59338(e){"use strict";function t(e){var t,n,r;t=e,r=["sum","min","max","avg","group","stddev","stdvar","count","count_values","bottomk","topk","quantile"].concat(n=["on","ignoring","group_right","group_left","by","without"],["offset"]),t.languages.promql={comment:{pattern:/(^[ \t]*)#.*/m,lookbehind:!0},"vector-match":{pattern:RegExp("((?:"+n.join("|")+")\\s*)\\([^)]*\\)"),lookbehind:!0,inside:{"label-key":{pattern:/\b[^,]*\b/,alias:"attr-name"},punctuation:/[(),]/}},"context-labels":{pattern:/\{[^{}]*\}/,inside:{"label-key":{pattern:/\b[a-z_]\w*(?=\s*(?:=|![=~]))/,alias:"attr-name"},"label-value":{pattern:/(["'`])(?:\\[\s\S]|(?!\1)[^\\])*\1/,greedy:!0,alias:"attr-value"},punctuation:/\{|\}|=~?|![=~]|,/}},"context-range":[{pattern:/\[[\w\s:]+\]/,inside:{punctuation:/\[|\]|:/,"range-duration":{pattern:/\b(?:\d+(?:[smhdwy]|ms))+\b/i,alias:"number"}}},{pattern:/(\boffset\s+)\w+/,lookbehind:!0,inside:{"range-duration":{pattern:/\b(?:\d+(?:[smhdwy]|ms))+\b/i,alias:"number"}}}],keyword:RegExp("\\b(?:"+r.join("|")+")\\b","i"),function:/\b[a-z_]\w*(?=\s*\()/i,number:/[-+]?(?:(?:\b\d+(?:\.\d+)?|\B\.\d+)(?:e[-+]?\d+)?\b|\b(?:0x[0-9a-f]+|nan|inf)\b)/i,operator:/[\^*/%+-]|==|!=|<=|<|>=|>|\b(?:and|unless|or)\b/i,punctuation:/[{};()`,.[\]]/}}e.exports=t,t.displayName="promql",t.aliases=[]},56267(e){"use strict";function t(e){e.languages.properties={comment:/^[ \t]*[#!].*$/m,"attr-value":{pattern:/(^[ \t]*(?:\\(?:\r\n|[\s\S])|[^\\\s:=])+(?: *[=:] *(?! )| ))(?:\\(?:\r\n|[\s\S])|[^\\\r\n])+/m,lookbehind:!0},"attr-name":/^[ \t]*(?:\\(?:\r\n|[\s\S])|[^\\\s:=])+(?= *[=:]| )/m,punctuation:/[=:]/}}e.exports=t,t.displayName="properties",t.aliases=[]},98809(e){"use strict";function t(e){var t,n;n=/\b(?:double|float|[su]?int(?:32|64)|s?fixed(?:32|64)|bool|string|bytes)\b/,(t=e).languages.protobuf=t.languages.extend("clike",{"class-name":[{pattern:/(\b(?:enum|extend|message|service)\s+)[A-Za-z_]\w*(?=\s*\{)/,lookbehind:!0},{pattern:/(\b(?:rpc\s+\w+|returns)\s*\(\s*(?:stream\s+)?)\.?[A-Za-z_]\w*(?:\.[A-Za-z_]\w*)*(?=\s*\))/,lookbehind:!0}],keyword:/\b(?:enum|extend|extensions|import|message|oneof|option|optional|package|public|repeated|required|reserved|returns|rpc(?=\s+\w)|service|stream|syntax|to)\b(?!\s*=\s*\d)/,function:/\b[a-z_]\w*(?=\s*\()/i}),t.languages.insertBefore("protobuf","operator",{map:{pattern:/\bmap<\s*[\w.]+\s*,\s*[\w.]+\s*>(?=\s+[a-z_]\w*\s*[=;])/i,alias:"class-name",inside:{punctuation:/[<>.,]/,builtin:n}},builtin:n,"positional-class-name":{pattern:/(?:\b|\B\.)[a-z_]\w*(?:\.[a-z_]\w*)*(?=\s+[a-z_]\w*\s*[=;])/i,alias:"class-name",inside:{punctuation:/\./}},annotation:{pattern:/(\[\s*)[a-z_]\w*(?=\s*=)/i,lookbehind:!0}})}e.exports=t,t.displayName="protobuf",t.aliases=[]},37548(e){"use strict";function t(e){e.languages.psl={comment:{pattern:/#.*/,greedy:!0},string:{pattern:/"(?:\\.|[^\\"])*"/,greedy:!0,inside:{symbol:/\\[ntrbA-Z"\\]/}},"heredoc-string":{pattern:/<<<([a-zA-Z_]\w*)[\r\n](?:.*[\r\n])*?\1\b/,alias:"string",greedy:!0},keyword:/\b(?:__multi|__single|case|default|do|else|elsif|exit|export|for|foreach|function|if|last|line|local|next|requires|return|switch|until|while|word)\b/,constant:/\b(?:ALARM|CHART_ADD_GRAPH|CHART_DELETE_GRAPH|CHART_DESTROY|CHART_LOAD|CHART_PRINT|EOF|FALSE|False|false|NO|No|no|OFFLINE|OK|PSL_PROF_LOG|R_CHECK_HORIZ|R_CHECK_VERT|R_CLICKER|R_COLUMN|R_FRAME|R_ICON|R_LABEL|R_LABEL_CENTER|R_LIST_MULTIPLE|R_LIST_MULTIPLE_ND|R_LIST_SINGLE|R_LIST_SINGLE_ND|R_MENU|R_POPUP|R_POPUP_SCROLLED|R_RADIO_HORIZ|R_RADIO_VERT|R_ROW|R_SCALE_HORIZ|R_SCALE_VERT|R_SPINNER|R_TEXT_FIELD|R_TEXT_FIELD_LABEL|R_TOGGLE|TRIM_LEADING|TRIM_LEADING_AND_TRAILING|TRIM_REDUNDANT|TRIM_TRAILING|TRUE|True|true|VOID|WARN)\b/,variable:/\b(?:errno|exit_status|PslDebug)\b/,builtin:{pattern:/\b(?:acos|add_diary|annotate|annotate_get|asctime|asin|atan|atexit|ascii_to_ebcdic|batch_set|blackout|cat|ceil|chan_exists|change_state|close|code_cvt|cond_signal|cond_wait|console_type|convert_base|convert_date|convert_locale_date|cos|cosh|create|destroy_lock|dump_hist|date|destroy|difference|dget_text|dcget_text|ebcdic_to_ascii|encrypt|event_archive|event_catalog_get|event_check|event_query|event_range_manage|event_range_query|event_report|event_schedule|event_trigger|event_trigger2|execute|exists|exp|fabs|floor|fmod|full_discovery|file|fopen|ftell|fseek|grep|get_vars|getenv|get|get_chan_info|get_ranges|get_text|gethostinfo|getpid|getpname|history_get_retention|history|index|int|is_var|intersection|isnumber|internal|in_transition|join|kill|length|lines|lock|lock_info|log|loge|log10|matchline|msg_check|msg_get_format|msg_get_severity|msg_printf|msg_sprintf|ntharg|num_consoles|nthargf|nthline|nthlinef|num_bytes|print|proc_exists|process|popen|printf|pconfig|poplines|pow|PslExecute|PslFunctionCall|PslFunctionExists|PslSetOptions|random|read|readln|refresh_parameters|remote_check|remote_close|remote_event_query|remote_event_trigger|remote_file_send|remote_open|remove|replace|rindex|sec_check_priv|sec_store_get|sec_store_set|set_alarm_ranges|set_locale|share|sin|sinh|sleep|sopen|sqrt|srandom|subset|set|substr|system|sprintf|sort|snmp_agent_config|_snmp_debug|snmp_agent_stop|snmp_agent_start|snmp_h_set|snmp_h_get_next|snmp_h_get|snmp_set|snmp_walk|snmp_get_next|snmp_get|snmp_config|snmp_close|snmp_open|snmp_trap_receive|snmp_trap_ignore|snmp_trap_listen|snmp_trap_send|snmp_trap_raise_std_trap|snmp_trap_register_im|splitline|strcasecmp|str_repeat|trim|tail|tan|tanh|time|tmpnam|tolower|toupper|trace_psl_process|text_domain|unlock|unique|union|unset|va_arg|va_start|write)\b/,alias:"builtin-function"},"foreach-variable":{pattern:/(\bforeach\s+(?:(?:\w+\b|"(?:\\.|[^\\"])*")\s+){0,2})[_a-zA-Z]\w*(?=\s*\()/,lookbehind:!0,greedy:!0},function:{pattern:/\b[_a-z]\w*\b(?=\s*\()/i},number:/\b(?:0x[0-9a-f]+|[0-9]+(?:\.[0-9]+)?)\b/i,operator:/--|\+\+|&&=?|\|\|=?|<<=?|>>=?|[=!]~|[-+*/%&|^!=<>]=?|\.|[:?]/,punctuation:/[(){}\[\];,]/}}e.exports=t,t.displayName="psl",t.aliases=[]},82161(e){"use strict";function t(e){!function(e){e.languages.pug={comment:{pattern:/(^([\t ]*))\/\/.*(?:(?:\r?\n|\r)\2[\t ].+)*/m,lookbehind:!0},"multiline-script":{pattern:/(^([\t ]*)script\b.*\.[\t ]*)(?:(?:\r?\n|\r(?!\n))(?:\2[\t ].+|\s*?(?=\r?\n|\r)))+/m,lookbehind:!0,inside:e.languages.javascript},filter:{pattern:/(^([\t ]*)):.+(?:(?:\r?\n|\r(?!\n))(?:\2[\t ].+|\s*?(?=\r?\n|\r)))+/m,lookbehind:!0,inside:{"filter-name":{pattern:/^:[\w-]+/,alias:"variable"}}},"multiline-plain-text":{pattern:/(^([\t ]*)[\w\-#.]+\.[\t ]*)(?:(?:\r?\n|\r(?!\n))(?:\2[\t ].+|\s*?(?=\r?\n|\r)))+/m,lookbehind:!0},markup:{pattern:/(^[\t ]*)<.+/m,lookbehind:!0,inside:e.languages.markup},doctype:{pattern:/((?:^|\n)[\t ]*)doctype(?: .+)?/,lookbehind:!0},"flow-control":{pattern:/(^[\t ]*)(?:if|unless|else|case|when|default|each|while)\b(?: .+)?/m,lookbehind:!0,inside:{each:{pattern:/^each .+? in\b/,inside:{keyword:/\b(?:each|in)\b/,punctuation:/,/}},branch:{pattern:/^(?:if|unless|else|case|when|default|while)\b/,alias:"keyword"},rest:e.languages.javascript}},keyword:{pattern:/(^[\t ]*)(?:block|extends|include|append|prepend)\b.+/m,lookbehind:!0},mixin:[{pattern:/(^[\t ]*)mixin .+/m,lookbehind:!0,inside:{keyword:/^mixin/,function:/\w+(?=\s*\(|\s*$)/,punctuation:/[(),.]/}},{pattern:/(^[\t ]*)\+.+/m,lookbehind:!0,inside:{name:{pattern:/^\+\w+/,alias:"function"},rest:e.languages.javascript}}],script:{pattern:/(^[\t ]*script(?:(?:&[^(]+)?\([^)]+\))*[\t ]).+/m,lookbehind:!0,inside:e.languages.javascript},"plain-text":{pattern:/(^[\t ]*(?!-)[\w\-#.]*[\w\-](?:(?:&[^(]+)?\([^)]+\))*\/?[\t ]).+/m,lookbehind:!0},tag:{pattern:/(^[\t ]*)(?!-)[\w\-#.]*[\w\-](?:(?:&[^(]+)?\([^)]+\))*\/?:?/m,lookbehind:!0,inside:{attributes:[{pattern:/&[^(]+\([^)]+\)/,inside:e.languages.javascript},{pattern:/\([^)]+\)/,inside:{"attr-value":{pattern:/(=\s*(?!\s))(?:\{[^}]*\}|[^,)\r\n]+)/,lookbehind:!0,inside:e.languages.javascript},"attr-name":/[\w-]+(?=\s*!?=|\s*[,)])/,punctuation:/[!=(),]+/}}],punctuation:/:/,"attr-id":/#[\w\-]+/,"attr-class":/\.[\w\-]+/}},code:[{pattern:/(^[\t ]*(?:-|!?=)).+/m,lookbehind:!0,inside:e.languages.javascript}],punctuation:/[.\-!=|]+/};for(var t=/(^([\t ]*)):(?:(?:\r?\n|\r(?!\n))(?:\2[\t ].+|\s*?(?=\r?\n|\r)))+/.source,n=[{filter:"atpl",language:"twig"},{filter:"coffee",language:"coffeescript"},"ejs","handlebars","less","livescript","markdown",{filter:"sass",language:"scss"},"stylus"],r={},i=0,a=n.length;i",function(){return o.filter}),"m"),lookbehind:!0,inside:{"filter-name":{pattern:/^:[\w-]+/,alias:"variable"},rest:e.languages[o.language]}})}e.languages.insertBefore("pug","filter",r)}(e)}e.exports=t,t.displayName="pug",t.aliases=[]},80625(e){"use strict";function t(e){var t,n;(t=e).languages.puppet={heredoc:[{pattern:/(@\("([^"\r\n\/):]+)"(?:\/[nrts$uL]*)?\).*(?:\r?\n|\r))(?:.*(?:\r?\n|\r(?!\n)))*?[ \t]*(?:\|[ \t]*)?(?:-[ \t]*)?\2/,lookbehind:!0,alias:"string",inside:{punctuation:/(?=\S).*\S(?= *$)/}},{pattern:/(@\(([^"\r\n\/):]+)(?:\/[nrts$uL]*)?\).*(?:\r?\n|\r))(?:.*(?:\r?\n|\r(?!\n)))*?[ \t]*(?:\|[ \t]*)?(?:-[ \t]*)?\2/,lookbehind:!0,greedy:!0,alias:"string",inside:{punctuation:/(?=\S).*\S(?= *$)/}},{pattern:/@\("?(?:[^"\r\n\/):]+)"?(?:\/[nrts$uL]*)?\)/,alias:"string",inside:{punctuation:{pattern:/(\().+?(?=\))/,lookbehind:!0}}}],"multiline-comment":{pattern:/(^|[^\\])\/\*[\s\S]*?\*\//,lookbehind:!0,greedy:!0,alias:"comment"},regex:{pattern:/((?:\bnode\s+|[~=\(\[\{,]\s*|[=+]>\s*|^\s*))\/(?:[^\/\\]|\\[\s\S])+\/(?:[imx]+\b|\B)/,lookbehind:!0,greedy:!0,inside:{"extended-regex":{pattern:/^\/(?:[^\/\\]|\\[\s\S])+\/[im]*x[im]*$/,inside:{comment:/#.*/}}}},comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},string:{pattern:/(["'])(?:\$\{(?:[^'"}]|(["'])(?:(?!\2)[^\\]|\\[\s\S])*\2)+\}|\$(?!\{)|(?!\1)[^\\$]|\\[\s\S])*\1/,greedy:!0,inside:{"double-quoted":{pattern:/^"[\s\S]*"$/,inside:{}}}},variable:{pattern:/\$(?:::)?\w+(?:::\w+)*/,inside:{punctuation:/::/}},"attr-name":/(?:\b\w+|\*)(?=\s*=>)/,function:[{pattern:/(\.)(?!\d)\w+/,lookbehind:!0},/\b(?:contain|debug|err|fail|include|info|notice|realize|require|tag|warning)\b|\b(?!\d)\w+(?=\()/],number:/\b(?:0x[a-f\d]+|\d+(?:\.\d+)?(?:e-?\d+)?)\b/i,boolean:/\b(?:true|false)\b/,keyword:/\b(?:application|attr|case|class|consumes|default|define|else|elsif|function|if|import|inherits|node|private|produces|type|undef|unless)\b/,datatype:{pattern:/\b(?:Any|Array|Boolean|Callable|Catalogentry|Class|Collection|Data|Default|Enum|Float|Hash|Integer|NotUndef|Numeric|Optional|Pattern|Regexp|Resource|Runtime|Scalar|String|Struct|Tuple|Type|Undef|Variant)\b/,alias:"symbol"},operator:/=[=~>]?|![=~]?|<(?:<\|?|[=~|-])?|>[>=]?|->?|~>|\|>?>?|[*\/%+?]|\b(?:and|in|or)\b/,punctuation:/[\[\]{}().,;]|:+/},n=[{pattern:/(^|[^\\])\$\{(?:[^'"{}]|\{[^}]*\}|(["'])(?:(?!\2)[^\\]|\\[\s\S])*\2)+\}/,lookbehind:!0,inside:{"short-variable":{pattern:/(^\$\{)(?!\w+\()(?:::)?\w+(?:::\w+)*/,lookbehind:!0,alias:"variable",inside:{punctuation:/::/}},delimiter:{pattern:/^\$/,alias:"variable"},rest:t.languages.puppet}},{pattern:/(^|[^\\])\$(?:::)?\w+(?:::\w+)*/,lookbehind:!0,alias:"variable",inside:{punctuation:/::/}}],t.languages.puppet.heredoc[0].inside.interpolation=n,t.languages.puppet.string.inside["double-quoted"].inside.interpolation=n}e.exports=t,t.displayName="puppet",t.aliases=[]},88393(e){"use strict";function t(e){var t,n,r;(t=e).languages.pure={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?\*\//,lookbehind:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0},/#!.+/],"inline-lang":{pattern:/%<[\s\S]+?%>/,greedy:!0,inside:{lang:{pattern:/(^%< *)-\*-.+?-\*-/,lookbehind:!0,alias:"comment"},delimiter:{pattern:/^%<.*|%>$/,alias:"punctuation"}}},string:{pattern:/"(?:\\.|[^"\\\r\n])*"/,greedy:!0},number:{pattern:/((?:\.\.)?)(?:\b(?:inf|nan)\b|\b0x[\da-f]+|(?:\b(?:0b)?\d+(?:\.\d+)?|\B\.\d+)(?:e[+-]?\d+)?L?)/i,lookbehind:!0},keyword:/\b(?:ans|break|bt|case|catch|cd|clear|const|def|del|dump|else|end|exit|extern|false|force|help|if|infix[lr]?|interface|let|ls|mem|namespace|nonfix|NULL|of|otherwise|outfix|override|postfix|prefix|private|public|pwd|quit|run|save|show|stats|then|throw|trace|true|type|underride|using|when|with)\b/,function:/\b(?:abs|add_(?:(?:fundef|interface|macdef|typedef)(?:_at)?|addr|constdef|vardef)|all|any|applp?|arity|bigintp?|blob(?:_crc|_size|p)?|boolp?|byte_(?:matrix|pointer)|byte_c?string(?:_pointer)?|calloc|cat|catmap|ceil|char[ps]?|check_ptrtag|chr|clear_sentry|clearsym|closurep?|cmatrixp?|cols?|colcat(?:map)?|colmap|colrev|colvector(?:p|seq)?|complex(?:_float_(?:matrix|pointer)|_matrix(?:_view)?|_pointer|p)?|conj|cookedp?|cst|cstring(?:_(?:dup|list|vector))?|curry3?|cyclen?|del_(?:constdef|fundef|interface|macdef|typedef|vardef)|delete|diag(?:mat)?|dim|dmatrixp?|do|double(?:_matrix(?:_view)?|_pointer|p)?|dowith3?|drop|dropwhile|eval(?:cmd)?|exactp|filter|fix|fixity|flip|float(?:_matrix|_pointer)|floor|fold[lr]1?|frac|free|funp?|functionp?|gcd|get(?:_(?:byte|constdef|double|float|fundef|int(?:64)?|interface(?:_typedef)?|long|macdef|pointer|ptrtag|short|sentry|string|typedef|vardef))?|globsym|hash|head|id|im|imatrixp?|index|inexactp|infp|init|insert|int(?:_matrix(?:_view)?|_pointer|p)?|int64_(?:matrix|pointer)|integerp?|iteraten?|iterwhile|join|keys?|lambdap?|last(?:err(?:pos)?)?|lcd|list[2p]?|listmap|make_ptrtag|malloc|map|matcat|matrixp?|max|member|min|nanp|nargs|nmatrixp?|null|numberp?|ord|pack(?:ed)?|pointer(?:_cast|_tag|_type|p)?|pow|pred|ptrtag|put(?:_(?:byte|double|float|int(?:64)?|long|pointer|short|string))?|rationalp?|re|realp?|realloc|recordp?|redim|reduce(?:_with)?|refp?|repeatn?|reverse|rlistp?|round|rows?|rowcat(?:map)?|rowmap|rowrev|rowvector(?:p|seq)?|same|scan[lr]1?|sentry|sgn|short_(?:matrix|pointer)|slice|smatrixp?|sort|split|str|strcat|stream|stride|string(?:_(?:dup|list|vector)|p)?|subdiag(?:mat)?|submat|subseq2?|substr|succ|supdiag(?:mat)?|symbolp?|tail|take|takewhile|thunkp?|transpose|trunc|tuplep?|typep|ubyte|uint(?:64)?|ulong|uncurry3?|unref|unzip3?|update|ushort|vals?|varp?|vector(?:p|seq)?|void|zip3?|zipwith3?)\b/,special:{pattern:/\b__[a-z]+__\b/i,alias:"builtin"},operator:/(?:[!"#$%&'*+,\-.\/:<=>?@\\^`|~\u00a1-\u00bf\u00d7-\u00f7\u20d0-\u2bff]|\b_+\b)+|\b(?:and|div|mod|not|or)\b/,punctuation:/[(){}\[\];,|]/},r=/%< *-\*- *\d* *-\*-[\s\S]+?%>/.source,(n=["c",{lang:"c++",alias:"cpp"},"fortran"]).forEach(function(e){var n=e;if("string"!=typeof e&&(n=e.alias,e=e.lang),t.languages[n]){var i={};i["inline-lang-"+n]={pattern:RegExp(r.replace("",e.replace(/([.+*?\/\\(){}\[\]])/g,"\\$1")),"i"),inside:t.util.clone(t.languages.pure["inline-lang"].inside)},i["inline-lang-"+n].inside.rest=t.util.clone(t.languages[n]),t.languages.insertBefore("pure","inline-lang",i)}}),t.languages.c&&(t.languages.pure["inline-lang"].inside.rest=t.util.clone(t.languages.c))}e.exports=t,t.displayName="pure",t.aliases=[]},78404(e){"use strict";function t(e){e.languages.purebasic=e.languages.extend("clike",{comment:/;.*/,keyword:/\b(?:declarecdll|declaredll|compilerselect|compilercase|compilerdefault|compilerendselect|compilererror|enableexplicit|disableexplicit|not|and|or|xor|calldebugger|debuglevel|enabledebugger|disabledebugger|restore|read|includepath|includebinary|threaded|runtime|with|endwith|structureunion|endstructureunion|align|newlist|newmap|interface|endinterface|extends|enumeration|endenumeration|swap|foreach|continue|fakereturn|goto|gosub|return|break|module|endmodule|declaremodule|enddeclaremodule|declare|declarec|prototype|prototypec|enableasm|disableasm|dim|redim|data|datasection|enddatasection|to|procedurereturn|debug|default|case|select|endselect|as|import|endimport|importc|compilerif|compilerelse|compilerendif|compilerelseif|end|structure|endstructure|while|wend|for|next|step|if|else|elseif|endif|repeat|until|procedure|proceduredll|procedurec|procedurecdll|endprocedure|protected|shared|static|global|define|includefile|xincludefile|macro|endmacro)\b/i,function:/\b\w+(?:\.\w+)?\s*(?=\()/,number:/(?:\$[\da-f]+|\b-?(?:\d+(?:\.\d+)?|\.\d+)(?:e[+-]?\d+)?)\b/i,operator:/(?:@\*?|\?|\*)\w+|-[>-]?|\+\+?|!=?|<>?=?|==?|&&?|\|?\||[~^%?*/@]/}),e.languages.insertBefore("purebasic","keyword",{tag:/#\w+/,asm:{pattern:/(^[\t ]*)!.*/m,lookbehind:!0,alias:"tag",inside:{comment:/;.*/,string:{pattern:/(["'`])(?:\\.|(?!\1)[^\\\r\n])*\1/,greedy:!0},"label-reference-anonymous":{pattern:/(!\s*j[a-z]+\s+)@[fb]/i,lookbehind:!0,alias:"fasm-label"},"label-reference-addressed":{pattern:/(!\s*j[a-z]+\s+)[A-Z._?$@][\w.?$@~#]*/i,lookbehind:!0,alias:"fasm-label"},function:{pattern:/^([\t ]*!\s*)[\da-z]+(?=\s|$)/im,lookbehind:!0},"function-inline":{pattern:/(:\s*)[\da-z]+(?=\s)/i,lookbehind:!0,alias:"function"},label:{pattern:/^([\t ]*!\s*)[A-Za-z._?$@][\w.?$@~#]*(?=:)/m,lookbehind:!0,alias:"fasm-label"},keyword:[/\b(?:extern|global)\b[^;\r\n]*/i,/\b(?:CPU|FLOAT|DEFAULT)\b.*/],register:/\b(?:st\d|[xyz]mm\d\d?|[cdt]r\d|r\d\d?[bwd]?|[er]?[abcd]x|[abcd][hl]|[er]?(?:bp|sp|si|di)|[cdefgs]s|mm\d+)\b/i,number:/(?:\b|-|(?=\$))(?:0[hx](?:[\da-f]*\.)?[\da-f]+(?:p[+-]?\d+)?|\d[\da-f]+[hx]|\$\d[\da-f]*|0[oq][0-7]+|[0-7]+[oq]|0[by][01]+|[01]+[by]|0[dt]\d+|(?:\d+(?:\.\d+)?|\.\d+)(?:\.?e[+-]?\d+)?[dt]?)\b/i,operator:/[\[\]*+\-/%<>=&|$!,.:]/}}}),delete e.languages.purebasic["class-name"],delete e.languages.purebasic.boolean,e.languages.pbfasm=e.languages.purebasic}e.exports=t,t.displayName="purebasic",t.aliases=[]},92923(e,t,n){"use strict";var r=n(58090);function i(e){e.register(r),e.languages.purescript=e.languages.extend("haskell",{keyword:/\b(?:ado|case|class|data|derive|do|else|forall|if|in|infixl|infixr|instance|let|module|newtype|of|primitive|then|type|where)\b/,"import-statement":{pattern:/(^[\t ]*)import\s+[A-Z][\w']*(?:\.[A-Z][\w']*)*(?:\s+as\s+[A-Z][\w']*(?:\.[A-Z][\w']*)*)?(?:\s+hiding\b)?/m,lookbehind:!0,inside:{keyword:/\b(?:import|as|hiding)\b/}},builtin:/\b(?:absurd|add|ap|append|apply|between|bind|bottom|clamp|compare|comparing|compose|conj|const|degree|discard|disj|div|eq|flap|flip|gcd|identity|ifM|join|lcm|liftA1|liftM1|map|max|mempty|min|mod|mul|negate|not|notEq|one|otherwise|recip|show|sub|top|unit|unless|unlessM|void|when|whenM|zero)\b/}),e.languages.purs=e.languages.purescript}e.exports=i,i.displayName="purescript",i.aliases=["purs"]},52992(e){"use strict";function t(e){e.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0},"string-interpolation":{pattern:/(?:f|rf|fr)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|rb|br)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|rb|br)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/im,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:and|as|assert|async|await|break|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:True|False|None)\b/,number:/(?:\b(?=\d)|\B(?=\.))(?:0[bo])?(?:(?:\d|0x[\da-f])[\da-f]*(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?j?\b/i,operator:/[-+%=]=?|!=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},e.languages.python["string-interpolation"].inside.interpolation.inside.rest=e.languages.python,e.languages.py=e.languages.python}e.exports=t,t.displayName="python",t.aliases=["py"]},55762(e){"use strict";function t(e){e.languages.q={string:/"(?:\\.|[^"\\\r\n])*"/,comment:[{pattern:/([\t )\]}])\/.*/,lookbehind:!0,greedy:!0},{pattern:/(^|\r?\n|\r)\/[\t ]*(?:(?:\r?\n|\r)(?:.*(?:\r?\n|\r(?!\n)))*?(?:\\(?=[\t ]*(?:\r?\n|\r))|$)|\S.*)/,lookbehind:!0,greedy:!0},{pattern:/^\\[\t ]*(?:\r?\n|\r)[\s\S]+/m,greedy:!0},{pattern:/^#!.+/m,greedy:!0}],symbol:/`(?::\S+|[\w.]*)/,datetime:{pattern:/0N[mdzuvt]|0W[dtz]|\d{4}\.\d\d(?:m|\.\d\d(?:T(?:\d\d(?::\d\d(?::\d\d(?:[.:]\d\d\d)?)?)?)?)?[dz]?)|\d\d:\d\d(?::\d\d(?:[.:]\d\d\d)?)?[uvt]?/,alias:"number"},number:/\b(?![01]:)(?:0[wn]|0W[hj]?|0N[hje]?|0x[\da-fA-F]+|\d+(?:\.\d*)?(?:e[+-]?\d+)?[hjfeb]?)/,keyword:/\\\w+\b|\b(?:abs|acos|aj0?|all|and|any|asc|asin|asof|atan|attr|avgs?|binr?|by|ceiling|cols|cor|cos|count|cov|cross|csv|cut|delete|deltas|desc|dev|differ|distinct|div|do|dsave|ej|enlist|eval|except|exec|exit|exp|fby|fills|first|fkeys|flip|floor|from|get|getenv|group|gtime|hclose|hcount|hdel|hopen|hsym|iasc|identity|idesc|if|ij|in|insert|inter|inv|keys?|last|like|list|ljf?|load|log|lower|lsq|ltime|ltrim|mavg|maxs?|mcount|md5|mdev|med|meta|mins?|mmax|mmin|mmu|mod|msum|neg|next|not|null|or|over|parse|peach|pj|plist|prds?|prev|prior|rand|rank|ratios|raze|read0|read1|reciprocal|reval|reverse|rload|rotate|rsave|rtrim|save|scan|scov|sdev|select|set|setenv|show|signum|sin|sqrt|ssr?|string|sublist|sums?|sv|svar|system|tables|tan|til|trim|txf|type|uj|ungroup|union|update|upper|upsert|value|var|views?|vs|wavg|where|while|within|wj1?|wsum|ww|xasc|xbar|xcols?|xdesc|xexp|xgroup|xkey|xlog|xprev|xrank)\b/,adverb:{pattern:/['\/\\]:?|\beach\b/,alias:"function"},verb:{pattern:/(?:\B\.\B|\b[01]:|<[=>]?|>=?|[:+\-*%,!?~=|$&#@^]):?|\b_\b:?/,alias:"operator"},punctuation:/[(){}\[\];.]/}}e.exports=t,t.displayName="q",t.aliases=[]},4137(e){"use strict";function t(e){!function(e){for(var t=/"(?:\\.|[^\\"\r\n])*"|'(?:\\.|[^\\'\r\n])*'/.source,n=/\/\/.*(?!.)|\/\*(?:[^*]|\*(?!\/))*\*\//.source,r=/(?:[^\\()[\]{}"'/]||\/(?![*/])||\(*\)|\[*\]|\{*\}|\\[\s\S])/.source.replace(//g,function(){return t}).replace(//g,function(){return n}),i=0;i<2;i++)r=r.replace(//g,function(){return r});r=r.replace(//g,"[^\\s\\S]"),e.languages.qml={comment:{pattern:/\/\/.*|\/\*[\s\S]*?\*\//,greedy:!0},"javascript-function":{pattern:RegExp(/((?:^|;)[ \t]*)function\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*\(*\)\s*\{*\}/.source.replace(//g,function(){return r}),"m"),lookbehind:!0,greedy:!0,alias:"language-javascript",inside:e.languages.javascript},"class-name":{pattern:/((?:^|[:;])[ \t]*)(?!\d)\w+(?=[ \t]*\{|[ \t]+on\b)/m,lookbehind:!0},property:[{pattern:/((?:^|[;{])[ \t]*)(?!\d)\w+(?:\.\w+)*(?=[ \t]*:)/m,lookbehind:!0},{pattern:/((?:^|[;{])[ \t]*)property[ \t]+(?!\d)\w+(?:\.\w+)*[ \t]+(?!\d)\w+(?:\.\w+)*(?=[ \t]*:)/m,lookbehind:!0,inside:{keyword:/^property/,property:/\w+(?:\.\w+)*/}}],"javascript-expression":{pattern:RegExp(/(:[ \t]*)(?![\s;}[])(?:(?!$|[;}]))+/.source.replace(//g,function(){return r}),"m"),lookbehind:!0,greedy:!0,alias:"language-javascript",inside:e.languages.javascript},string:/"(?:\\.|[^\\"\r\n])*"/,keyword:/\b(?:as|import|on)\b/,punctuation:/[{}[\]:;,]/}}(e)}e.exports=t,t.displayName="qml",t.aliases=[]},28260(e){"use strict";function t(e){e.languages.qore=e.languages.extend("clike",{comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:\/\/|#).*)/,lookbehind:!0},string:{pattern:/("|')(?:\\[\s\S]|(?!\1)[^\\])*\1/,greedy:!0},keyword:/\b(?:abstract|any|assert|binary|bool|boolean|break|byte|case|catch|char|class|code|const|continue|data|default|do|double|else|enum|extends|final|finally|float|for|goto|hash|if|implements|import|inherits|instanceof|int|interface|long|my|native|new|nothing|null|object|our|own|private|reference|rethrow|return|short|soft(?:int|float|number|bool|string|date|list)|static|strictfp|string|sub|super|switch|synchronized|this|throw|throws|transient|try|void|volatile|while)\b/,boolean:/\b(?:true|false)\b/i,function:/\$?\b(?!\d)\w+(?=\()/,number:/\b(?:0b[01]+|0x(?:[\da-f]*\.)?[\da-fp\-]+|(?:\d+(?:\.\d+)?|\.\d+)(?:e\d+)?[df]|(?:\d+(?:\.\d+)?|\.\d+))\b/i,operator:{pattern:/(^|[^.])(?:\+[+=]?|-[-=]?|[!=](?:==?|~)?|>>?=?|<(?:=>?|<=?)?|&[&=]?|\|[|=]?|[*\/%^]=?|[~?])/,lookbehind:!0},variable:/\$(?!\d)\w+\b/})}e.exports=t,t.displayName="qore",t.aliases=[]},71360(e){"use strict";function t(e){!function(e){function t(e,t){return e.replace(/<<(\d+)>>/g,function(e,n){return"(?:"+t[+n]+")"})}function n(e,n,r){return RegExp(t(e,n),r||"")}function r(e,t){for(var n=0;n>/g,function(){return"(?:"+e+")"});return e.replace(/<>/g,"[^\\s\\S]")}var i={type:"Adj BigInt Bool Ctl Double false Int One Pauli PauliI PauliX PauliY PauliZ Qubit Range Result String true Unit Zero",other:"Adjoint adjoint apply as auto body borrow borrowing Controlled controlled distribute elif else fail fixup for function if in internal intrinsic invert is let mutable namespace new newtype open operation repeat return self set until use using while within"};function a(e){return"\\b(?:"+e.trim().replace(/ /g,"|")+")\\b"}var o=RegExp(a(i.type+" "+i.other)),s=/\b[A-Za-z_]\w*\b/.source,u=t(/<<0>>(?:\s*\.\s*<<0>>)*/.source,[s]),c={keyword:o,punctuation:/[<>()?,.:[\]]/},l=/"(?:\\.|[^\\"])*"/.source;e.languages.qsharp=e.languages.extend("clike",{comment:/\/\/.*/,string:[{pattern:n(/(^|[^$\\])<<0>>/.source,[l]),lookbehind:!0,greedy:!0}],"class-name":[{pattern:n(/(\b(?:as|open)\s+)<<0>>(?=\s*(?:;|as\b))/.source,[u]),lookbehind:!0,inside:c},{pattern:n(/(\bnamespace\s+)<<0>>(?=\s*\{)/.source,[u]),lookbehind:!0,inside:c}],keyword:o,number:/(?:\b0(?:x[\da-f]+|b[01]+|o[0-7]+)|(?:\B\.\d+|\b\d+(?:\.\d*)?)(?:e[-+]?\d+)?)l?\b/i,operator:/\band=|\bor=|\band\b|\bor\b|\bnot\b|<[-=]|[-=]>|>>>=?|<<<=?|\^\^\^=?|\|\|\|=?|&&&=?|w\/=?|~~~|[*\/+\-^=!%]=?/,punctuation:/::|[{}[\];(),.:]/}),e.languages.insertBefore("qsharp","number",{range:{pattern:/\.\./,alias:"operator"}});var f=r(t(/\{(?:[^"{}]|<<0>>|<>)*\}/.source,[l]),2);e.languages.insertBefore("qsharp","string",{"interpolation-string":{pattern:n(/\$"(?:\\.|<<0>>|[^\\"{])*"/.source,[f]),greedy:!0,inside:{interpolation:{pattern:n(/((?:^|[^\\])(?:\\\\)*)<<0>>/.source,[f]),lookbehind:!0,inside:{punctuation:/^\{|\}$/,expression:{pattern:/[\s\S]+/,alias:"language-qsharp",inside:e.languages.qsharp}}},string:/[\s\S]+/}}})}(e),e.languages.qs=e.languages.qsharp}e.exports=t,t.displayName="qsharp",t.aliases=["qs"]},29308(e){"use strict";function t(e){e.languages.r={comment:/#.*/,string:{pattern:/(['"])(?:\\.|(?!\1)[^\\\r\n])*\1/,greedy:!0},"percent-operator":{pattern:/%[^%\s]*%/,alias:"operator"},boolean:/\b(?:TRUE|FALSE)\b/,ellipsis:/\.\.(?:\.|\d+)/,number:[/\b(?:NaN|Inf)\b/,/(?:\b0x[\dA-Fa-f]+(?:\.\d*)?|\b\d+(?:\.\d*)?|\B\.\d+)(?:[EePp][+-]?\d+)?[iL]?/],keyword:/\b(?:if|else|repeat|while|function|for|in|next|break|NULL|NA|NA_integer_|NA_real_|NA_complex_|NA_character_)\b/,operator:/->?>?|<(?:=|=!]=?|::?|&&?|\|\|?|[+*\/^$@~]/,punctuation:/[(){}\[\],;]/}}e.exports=t,t.displayName="r",t.aliases=[]},32168(e,t,n){"use strict";var r=n(9997);function i(e){e.register(r),e.languages.racket=e.languages.extend("scheme",{"lambda-parameter":{pattern:/([(\[]lambda\s+[(\[])[^()\[\]'\s]+/,lookbehind:!0}}),e.languages.insertBefore("racket","string",{lang:{pattern:/^#lang.+/m,greedy:!0,alias:"keyword"}}),e.languages.rkt=e.languages.racket}e.exports=i,i.displayName="racket",i.aliases=["rkt"]},5755(e){"use strict";function t(e){e.languages.reason=e.languages.extend("clike",{string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^\\\r\n"])*"/,greedy:!0},"class-name":/\b[A-Z]\w*/,keyword:/\b(?:and|as|assert|begin|class|constraint|do|done|downto|else|end|exception|external|for|fun|function|functor|if|in|include|inherit|initializer|lazy|let|method|module|mutable|new|nonrec|object|of|open|or|private|rec|sig|struct|switch|then|to|try|type|val|virtual|when|while|with)\b/,operator:/\.{3}|:[:=]|\|>|->|=(?:==?|>)?|<=?|>=?|[|^?'#!~`]|[+\-*\/]\.?|\b(?:mod|land|lor|lxor|lsl|lsr|asr)\b/}),e.languages.insertBefore("reason","class-name",{character:{pattern:/'(?:\\x[\da-f]{2}|\\o[0-3][0-7][0-7]|\\\d{3}|\\.|[^'\\\r\n])'/,alias:"string"},constructor:{pattern:/\b[A-Z]\w*\b(?!\s*\.)/,alias:"variable"},label:{pattern:/\b[a-z]\w*(?=::)/,alias:"symbol"}}),delete e.languages.reason.function}e.exports=t,t.displayName="reason",t.aliases=[]},54105(e){"use strict";function t(e){var t,n,r,i,a,o,s,u;t=e,n={pattern:/\\[\\(){}[\]^$+*?|.]/,alias:"escape"},i={pattern:/\.|\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},a={pattern:/\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},s=RegExp((o="(?:[^\\\\-]|"+(r=/\\(?:x[\da-fA-F]{2}|u[\da-fA-F]{4}|u\{[\da-fA-F]+\}|c[a-zA-Z]|0[0-7]{0,2}|[123][0-7]{2}|.)/).source+")")+"-"+o),u={pattern:/(<|')[^<>']+(?=[>']$)/,lookbehind:!0,alias:"variable"},t.languages.regex={charset:{pattern:/((?:^|[^\\])(?:\\\\)*)\[(?:[^\\\]]|\\[\s\S])*\]/,lookbehind:!0,inside:{"charset-negation":{pattern:/(^\[)\^/,lookbehind:!0,alias:"operator"},"charset-punctuation":{pattern:/^\[|\]$/,alias:"punctuation"},range:{pattern:s,inside:{escape:r,"range-punctuation":{pattern:/-/,alias:"operator"}}},"special-escape":n,charclass:a,escape:r}},"special-escape":n,charclass:i,backreference:[{pattern:/\\(?![123][0-7]{2})[1-9]/,alias:"keyword"},{pattern:/\\k<[^<>']+>/,alias:"keyword",inside:{"group-name":u}}],anchor:{pattern:/[$^]|\\[ABbGZz]/,alias:"function"},escape:r,group:[{pattern:/\((?:\?(?:<[^<>']+>|'[^<>']+'|[>:]|:=]=?|!=|\b_\b/,punctuation:/[,;.\[\]{}()]/}}e.exports=t,t.displayName="rego",t.aliases=[]},35108(e){"use strict";function t(e){e.languages.renpy={comment:{pattern:/(^|[^\\])#.+/,lookbehind:!0},string:{pattern:/("""|''')[\s\S]+?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2|(?:^#?(?:[0-9a-fA-F]{6}|(?:[0-9a-fA-F]){3})$)/m,greedy:!0},function:/\b[a-z_]\w*(?=\()/i,property:/\b(?:insensitive|idle|hover|selected_idle|selected_hover|background|position|alt|xpos|ypos|pos|xanchor|yanchor|anchor|xalign|yalign|align|xcenter|ycenter|xofsset|yoffset|ymaximum|maximum|xmaximum|xminimum|yminimum|minimum|xsize|ysizexysize|xfill|yfill|area|antialias|black_color|bold|caret|color|first_indent|font|size|italic|justify|kerning|language|layout|line_leading|line_overlap_split|line_spacing|min_width|newline_indent|outlines|rest_indent|ruby_style|slow_cps|slow_cps_multiplier|strikethrough|text_align|underline|hyperlink_functions|vertical|hinting|foreground|left_margin|xmargin|top_margin|bottom_margin|ymargin|left_padding|right_padding|xpadding|top_padding|bottom_padding|ypadding|size_group|child|hover_sound|activate_sound|mouse|focus_mask|keyboard_focus|bar_vertical|bar_invert|bar_resizing|left_gutter|right_gutter|top_gutter|bottom_gutter|left_bar|right_bar|top_bar|bottom_bar|thumb|thumb_shadow|thumb_offset|unscrollable|spacing|first_spacing|box_reverse|box_wrap|order_reverse|fit_first|ysize|thumbnail_width|thumbnail_height|help|text_ypos|text_xpos|idle_color|hover_color|selected_idle_color|selected_hover_color|insensitive_color|alpha|insensitive_background|hover_background|zorder|value|width|xadjustment|xanchoraround|xaround|xinitial|xoffset|xzoom|yadjustment|yanchoraround|yaround|yinitial|yzoom|zoom|ground|height|text_style|text_y_fudge|selected_insensitive|has_sound|has_music|has_voice|focus|hovered|image_style|length|minwidth|mousewheel|offset|prefix|radius|range|right_margin|rotate|rotate_pad|developer|screen_width|screen_height|window_title|name|version|windows_icon|default_fullscreen|default_text_cps|default_afm_time|main_menu_music|sample_sound|enter_sound|exit_sound|save_directory|enter_transition|exit_transition|intra_transition|main_game_transition|game_main_transition|end_splash_transition|end_game_transition|after_load_transition|window_show_transition|window_hide_transition|adv_nvl_transition|nvl_adv_transition|enter_yesno_transition|exit_yesno_transition|enter_replay_transition|exit_replay_transition|say_attribute_transition|directory_name|executable_name|include_update|window_icon|modal|google_play_key|google_play_salt|drag_name|drag_handle|draggable|dragged|droppable|dropped|narrator_menu|action|default_afm_enable|version_name|version_tuple|inside|fadeout|fadein|layers|layer_clipping|linear|scrollbars|side_xpos|side_ypos|side_spacing|edgescroll|drag_joined|drag_raise|drop_shadow|drop_shadow_color|subpixel|easein|easeout|time|crop|auto|update|get_installed_packages|can_update|UpdateVersion|Update|overlay_functions|translations|window_left_padding|show_side_image|show_two_window)\b/,tag:/\b(?:label|image|menu|[hv]box|frame|text|imagemap|imagebutton|bar|vbar|screen|textbutton|buttoscreenn|fixed|grid|input|key|mousearea|side|timer|viewport|window|hotspot|hotbar|self|button|drag|draggroup|tag|mm_menu_frame|nvl|block|parallel)\b|\$/,keyword:/\b(?:as|assert|break|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|pass|print|raise|return|try|while|yield|adjustment|alignaround|allow|angle|around|box_layout|cache|changed|child_size|clicked|clipping|corner1|corner2|default|delay|exclude|scope|slow|slow_abortable|slow_done|sound|style_group|substitute|suffix|transform_anchor|transpose|unhovered|config|theme|mm_root|gm_root|rounded_window|build|disabled_text|disabled|widget_selected|widget_text|widget_hover|widget|updater|behind|call|expression|hide|init|jump|onlayer|python|renpy|scene|set|show|transform|play|queue|stop|pause|define|window|repeat|contains|choice|on|function|event|animation|clockwise|counterclockwise|circles|knot|null|None|random|has|add|use|fade|dissolve|style|store|id|voice|center|left|right|less_rounded|music|movie|clear|persistent|ui)\b/,boolean:/\b(?:[Tt]rue|[Ff]alse)\b/,number:/(?:\b(?:0[bo])?(?:(?:\d|0x[\da-f])[\da-f]*(?:\.\d*)?)|\B\.\d+)(?:e[+-]?\d+)?j?/i,operator:/[-+%=]=?|!=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]|\b(?:or|and|not|with|at)\b/,punctuation:/[{}[\];(),.:]/},e.languages.rpy=e.languages.renpy}e.exports=t,t.displayName="renpy",t.aliases=["rpy"]},46678(e){"use strict";function t(e){e.languages.rest={table:[{pattern:/(^[\t ]*)(?:\+[=-]+)+\+(?:\r?\n|\r)(?:\1[+|].+[+|](?:\r?\n|\r))+\1(?:\+[=-]+)+\+/m,lookbehind:!0,inside:{punctuation:/\||(?:\+[=-]+)+\+/}},{pattern:/(^[\t ]*)=+ [ =]*=(?:(?:\r?\n|\r)\1.+)+(?:\r?\n|\r)\1=+ [ =]*=(?=(?:\r?\n|\r){2}|\s*$)/m,lookbehind:!0,inside:{punctuation:/[=-]+/}}],"substitution-def":{pattern:/(^[\t ]*\.\. )\|(?:[^|\s](?:[^|]*[^|\s])?)\| [^:]+::/m,lookbehind:!0,inside:{substitution:{pattern:/^\|(?:[^|\s]|[^|\s][^|]*[^|\s])\|/,alias:"attr-value",inside:{punctuation:/^\||\|$/}},directive:{pattern:/( )(?! )[^:]+::/,lookbehind:!0,alias:"function",inside:{punctuation:/::$/}}}},"link-target":[{pattern:/(^[\t ]*\.\. )\[[^\]]+\]/m,lookbehind:!0,alias:"string",inside:{punctuation:/^\[|\]$/}},{pattern:/(^[\t ]*\.\. )_(?:`[^`]+`|(?:[^:\\]|\\.)+):/m,lookbehind:!0,alias:"string",inside:{punctuation:/^_|:$/}}],directive:{pattern:/(^[\t ]*\.\. )[^:]+::/m,lookbehind:!0,alias:"function",inside:{punctuation:/::$/}},comment:{pattern:/(^[\t ]*\.\.)(?:(?: .+)?(?:(?:\r?\n|\r).+)+| .+)(?=(?:\r?\n|\r){2}|$)/m,lookbehind:!0},title:[{pattern:/^(([!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~])\2+)(?:\r?\n|\r).+(?:\r?\n|\r)\1$/m,inside:{punctuation:/^[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~]+|[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~]+$/,important:/.+/}},{pattern:/(^|(?:\r?\n|\r){2}).+(?:\r?\n|\r)([!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~])\2+(?=\r?\n|\r|$)/,lookbehind:!0,inside:{punctuation:/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~]+$/,important:/.+/}}],hr:{pattern:/((?:\r?\n|\r){2})([!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~])\2{3,}(?=(?:\r?\n|\r){2})/,lookbehind:!0,alias:"punctuation"},field:{pattern:/(^[\t ]*):[^:\r\n]+:(?= )/m,lookbehind:!0,alias:"attr-name"},"command-line-option":{pattern:/(^[\t ]*)(?:[+-][a-z\d]|(?:--|\/)[a-z\d-]+)(?:[ =](?:[a-z][\w-]*|<[^<>]+>))?(?:, (?:[+-][a-z\d]|(?:--|\/)[a-z\d-]+)(?:[ =](?:[a-z][\w-]*|<[^<>]+>))?)*(?=(?:\r?\n|\r)? {2,}\S)/im,lookbehind:!0,alias:"symbol"},"literal-block":{pattern:/::(?:\r?\n|\r){2}([ \t]+)(?![ \t]).+(?:(?:\r?\n|\r)\1.+)*/,inside:{"literal-block-punctuation":{pattern:/^::/,alias:"punctuation"}}},"quoted-literal-block":{pattern:/::(?:\r?\n|\r){2}([!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~]).*(?:(?:\r?\n|\r)\1.*)*/,inside:{"literal-block-punctuation":{pattern:/^(?:::|([!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~])\1*)/m,alias:"punctuation"}}},"list-bullet":{pattern:/(^[\t ]*)(?:[*+\-•‣⁃]|\(?(?:\d+|[a-z]|[ivxdclm]+)\)|(?:\d+|[a-z]|[ivxdclm]+)\.)(?= )/im,lookbehind:!0,alias:"punctuation"},"doctest-block":{pattern:/(^[\t ]*)>>> .+(?:(?:\r?\n|\r).+)*/m,lookbehind:!0,inside:{punctuation:/^>>>/}},inline:[{pattern:/(^|[\s\-:\/'"<(\[{])(?::[^:]+:`.*?`|`.*?`:[^:]+:|(\*\*?|``?|\|)(?!\s)(?:(?!\2).)*\S\2(?=[\s\-.,:;!?\\\/'")\]}]|$))/m,lookbehind:!0,inside:{bold:{pattern:/(^\*\*).+(?=\*\*$)/,lookbehind:!0},italic:{pattern:/(^\*).+(?=\*$)/,lookbehind:!0},"inline-literal":{pattern:/(^``).+(?=``$)/,lookbehind:!0,alias:"symbol"},role:{pattern:/^:[^:]+:|:[^:]+:$/,alias:"function",inside:{punctuation:/^:|:$/}},"interpreted-text":{pattern:/(^`).+(?=`$)/,lookbehind:!0,alias:"attr-value"},substitution:{pattern:/(^\|).+(?=\|$)/,lookbehind:!0,alias:"attr-value"},punctuation:/\*\*?|``?|\|/}}],link:[{pattern:/\[[^\[\]]+\]_(?=[\s\-.,:;!?\\\/'")\]}]|$)/,alias:"string",inside:{punctuation:/^\[|\]_$/}},{pattern:/(?:\b[a-z\d]+(?:[_.:+][a-z\d]+)*_?_|`[^`]+`_?_|_`[^`]+`)(?=[\s\-.,:;!?\\\/'")\]}]|$)/i,alias:"string",inside:{punctuation:/^_?`|`$|`?_?_$/}}],punctuation:{pattern:/(^[\t ]*)(?:\|(?= |$)|(?:---?|—|\.\.|__)(?= )|\.\.$)/m,lookbehind:!0}}}e.exports=t,t.displayName="rest",t.aliases=[]},47496(e){"use strict";function t(e){e.languages.rip={comment:/#.*/,keyword:/(?:=>|->)|\b(?:class|if|else|switch|case|return|exit|try|catch|finally|raise)\b/,builtin:/@|\bSystem\b/,boolean:/\b(?:true|false)\b/,date:/\b\d{4}-\d{2}-\d{2}\b/,time:/\b\d{2}:\d{2}:\d{2}\b/,datetime:/\b\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\b/,character:/\B`[^\s`'",.:;#\/\\()<>\[\]{}]\b/,regex:{pattern:/(^|[^/])\/(?!\/)(?:\[[^\n\r\]]*\]|\\.|[^/\\\r\n\[])+\/(?=\s*(?:$|[\r\n,.;})]))/,lookbehind:!0,greedy:!0},symbol:/:[^\d\s`'",.:;#\/\\()<>\[\]{}][^\s`'",.:;#\/\\()<>\[\]{}]*/,string:{pattern:/("|')(?:\\.|(?!\1)[^\\\r\n])*\1/,greedy:!0},number:/[+-]?\b(?:\d+\.\d+|\d+)\b/,punctuation:/(?:\.{2,3})|[`,.:;=\/\\()<>\[\]{}]/,reference:/[^\d\s`'",.:;#\/\\()<>\[\]{}][^\s`'",.:;#\/\\()<>\[\]{}]*/}}e.exports=t,t.displayName="rip",t.aliases=[]},30527(e){"use strict";function t(e){e.languages.roboconf={comment:/#.*/,keyword:{pattern:/(^|\s)(?:(?:facet|instance of)(?=[ \t]+[\w-]+[ \t]*\{)|(?:external|import)\b)/,lookbehind:!0},component:{pattern:/[\w-]+(?=[ \t]*\{)/,alias:"variable"},property:/[\w.-]+(?=[ \t]*:)/,value:{pattern:/(=[ \t]*(?![ \t]))[^,;]+/,lookbehind:!0,alias:"attr-value"},optional:{pattern:/\(optional\)/,alias:"builtin"},wildcard:{pattern:/(\.)\*/,lookbehind:!0,alias:"operator"},punctuation:/[{},.;:=]/}}e.exports=t,t.displayName="roboconf",t.aliases=[]},5261(e){"use strict";function t(e){!function(e){var t={pattern:/(^[ \t]*| {2}|\t)#.*/m,lookbehind:!0,greedy:!0},n={pattern:/((?:^|[^\\])(?:\\{2})*)[$@&%]\{(?:[^{}\r\n]|\{[^{}\r\n]*\})*\}/,lookbehind:!0,inside:{punctuation:/^[$@&%]\{|\}$/}};function r(e,r){var i={};for(var a in i["section-header"]={pattern:/^ ?\*{3}.+?\*{3}/,alias:"keyword"},r)i[a]=r[a];return i.tag={pattern:/([\r\n](?: {2}|\t)[ \t]*)\[[-\w]+\]/,lookbehind:!0,inside:{punctuation:/\[|\]/}},i.variable=n,i.comment=t,{pattern:RegExp(/^ ?\*{3}[ \t]*[ \t]*\*{3}(?:.|[\r\n](?!\*{3}))*/.source.replace(//g,function(){return e}),"im"),alias:"section",inside:i}}var i={pattern:/(\[Documentation\](?: {2}|\t)[ \t]*)(?![ \t]|#)(?:.|(?:\r\n?|\n)[ \t]*\.{3})+/,lookbehind:!0,alias:"string"},a={pattern:/([\r\n] ?)(?!#)(?:\S(?:[ \t]\S)*)+/,lookbehind:!0,alias:"function",inside:{variable:n}},o={pattern:/([\r\n](?: {2}|\t)[ \t]*)(?!\[|\.{3}|#)(?:\S(?:[ \t]\S)*)+/,lookbehind:!0,inside:{variable:n}};e.languages.robotframework={settings:r("Settings",{documentation:{pattern:/([\r\n] ?Documentation(?: {2}|\t)[ \t]*)(?![ \t]|#)(?:.|(?:\r\n?|\n)[ \t]*\.{3})+/,lookbehind:!0,alias:"string"},property:{pattern:/([\r\n] ?)(?!\.{3}|#)(?:\S(?:[ \t]\S)*)+/,lookbehind:!0}}),variables:r("Variables"),"test-cases":r("Test Cases",{"test-name":a,documentation:i,property:o}),keywords:r("Keywords",{"keyword-name":a,documentation:i,property:o}),tasks:r("Tasks",{"task-name":a,documentation:i,property:o}),comment:t},e.languages.robot=e.languages.robotframework}(e)}e.exports=t,t.displayName="robotframework",t.aliases=[]},56939(e){"use strict";function t(e){var t,n;(t=e).languages.ruby=t.languages.extend("clike",{comment:[/#.*/,{pattern:/^=begin\s[\s\S]*?^=end/m,greedy:!0}],"class-name":{pattern:/(\b(?:class)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:alias|and|BEGIN|begin|break|case|class|def|define_method|defined|do|each|else|elsif|END|end|ensure|extend|for|if|in|include|module|new|next|nil|not|or|prepend|protected|private|public|raise|redo|require|rescue|retry|return|self|super|then|throw|undef|unless|until|when|while|yield)\b/}),n={pattern:/#\{[^}]+\}/,inside:{delimiter:{pattern:/^#\{|\}$/,alias:"tag"},rest:t.languages.ruby}},delete t.languages.ruby.function,t.languages.insertBefore("ruby","keyword",{regex:[{pattern:RegExp(/%r/.source+"(?:"+[/([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,/\((?:[^()\\]|\\[\s\S])*\)/.source,/\{(?:[^#{}\\]|#(?:\{[^}]+\})?|\\[\s\S])*\}/.source,/\[(?:[^\[\]\\]|\\[\s\S])*\]/.source,/<(?:[^<>\\]|\\[\s\S])*>/.source].join("|")+")"+/[egimnosux]{0,6}/.source),greedy:!0,inside:{interpolation:n}},{pattern:/(^|[^/])\/(?!\/)(?:\[[^\r\n\]]+\]|\\.|[^[/\\\r\n])+\/[egimnosux]{0,6}(?=\s*(?:$|[\r\n,.;})#]))/,lookbehind:!0,greedy:!0,inside:{interpolation:n}}],variable:/[@$]+[a-zA-Z_]\w*(?:[?!]|\b)/,symbol:{pattern:/(^|[^:]):[a-zA-Z_]\w*(?:[?!]|\b)/,lookbehind:!0},"method-definition":{pattern:/(\bdef\s+)[\w.]+/,lookbehind:!0,inside:{function:/\w+$/,rest:t.languages.ruby}}}),t.languages.insertBefore("ruby","number",{builtin:/\b(?:Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Stat|Fixnum|Float|Hash|Integer|IO|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|String|Struct|TMS|Symbol|ThreadGroup|Thread|Time|TrueClass)\b/,constant:/\b[A-Z]\w*(?:[?!]|\b)/}),t.languages.ruby.string=[{pattern:RegExp(/%[qQiIwWxs]?/.source+"(?:"+[/([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,/\((?:[^()\\]|\\[\s\S])*\)/.source,/\{(?:[^#{}\\]|#(?:\{[^}]+\})?|\\[\s\S])*\}/.source,/\[(?:[^\[\]\\]|\\[\s\S])*\]/.source,/<(?:[^<>\\]|\\[\s\S])*>/.source].join("|")+")"),greedy:!0,inside:{interpolation:n}},{pattern:/("|')(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|(?!\1)[^\\#\r\n])*\1/,greedy:!0,inside:{interpolation:n}},{pattern:/<<[-~]?([a-z_]\w*)[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?[a-z_]\w*|[a-z_]\w*$/i,alias:"symbol",inside:{punctuation:/^<<[-~]?/}},interpolation:n}},{pattern:/<<[-~]?'([a-z_]\w*)'[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?'[a-z_]\w*'|[a-z_]\w*$/i,alias:"symbol",inside:{punctuation:/^<<[-~]?'|'$/}}}}],t.languages.rb=t.languages.ruby}e.exports=t,t.displayName="ruby",t.aliases=["rb"]},83648(e){"use strict";function t(e){!function(e){for(var t=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|)*\*\//.source,n=0;n<2;n++)t=t.replace(//g,function(){return t});t=t.replace(//g,function(){return/[^\s\S]/.source}),e.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+t),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0,alias:"string"},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|Self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:[ui](?:8|16|32|64|128|size)|f(?:32|64)|bool|char|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:[iu](?:8|16|32|64|size)?|f32|f64))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<>?=?|[@?]/},e.languages.rust["closure-params"].inside.rest=e.languages.rust,e.languages.rust.attribute.inside.string=e.languages.rust.string}(e)}e.exports=t,t.displayName="rust",t.aliases=[]},16009(e){"use strict";function t(e){var t,n,r,i,a,o,s,u,c,l,f,d,h,p,b,m,g,v,y;t=e,n=/(?:"(?:""|[^"])*"(?!")|'(?:''|[^'])*'(?!'))/.source,r=/\b(?:\d[\da-f]*x|\d+(?:\.\d+)?(?:e[+-]?\d+)?)\b/i,i={pattern:RegExp(n+"[bx]"),alias:"number"},a={pattern:/&[a-z_]\w*/i},o={pattern:/((?:^|\s|=|\())%(?:ABORT|BY|CMS|COPY|DISPLAY|DO|ELSE|END|EVAL|GLOBAL|GO|GOTO|IF|INC|INCLUDE|INDEX|INPUT|KTRIM|LENGTH|LET|LIST|LOCAL|PUT|QKTRIM|QSCAN|QSUBSTR|QSYSFUNC|QUPCASE|RETURN|RUN|SCAN|SUBSTR|SUPERQ|SYMDEL|SYMGLOBL|SYMLOCAL|SYMEXIST|SYSCALL|SYSEVALF|SYSEXEC|SYSFUNC|SYSGET|SYSRPUT|THEN|TO|TSO|UNQUOTE|UNTIL|UPCASE|WHILE|WINDOW)\b/i,lookbehind:!0,alias:"keyword"},s={pattern:/(^|\s)(?:proc\s+\w+|quit|run|data(?!=))\b/i,alias:"keyword",lookbehind:!0},u=[/\/\*[\s\S]*?\*\//,{pattern:/(^[ \t]*|;\s*)\*[^;]*;/m,lookbehind:!0}],c={pattern:RegExp(n),greedy:!0},d={function:f={pattern:/%?\b\w+(?=\()/,alias:"keyword"},"arg-value":{pattern:/(=\s*)[A-Z\.]+/i,lookbehind:!0},operator:/=/,"macro-variable":a,arg:{pattern:/[A-Z]+/i,alias:"keyword"},number:r,"numeric-constant":i,punctuation:l=/[$%@.(){}\[\];,\\]/,string:c},h={pattern:/\b(?:format|put)\b=?[\w'$.]+/im,inside:{keyword:/^(?:format|put)(?==)/i,equals:/=/,format:{pattern:/(?:\w|\$\d)+\.\d?/i,alias:"number"}}},p={pattern:/\b(?:format|put)\s+[\w']+(?:\s+[$.\w]+)+(?=;)/i,inside:{keyword:/^(?:format|put)/i,format:{pattern:/[\w$]+\.\d?/,alias:"number"}}},b={pattern:/((?:^|\s)=?)(?:catname|checkpoint execute_always|dm|endsas|filename|footnote|%include|libname|%list|lock|missing|options|page|resetline|%run|sasfile|skip|sysecho|title\d?)\b/i,lookbehind:!0,alias:"keyword"},m={pattern:/(^|\s)(?:submit(?:\s+(?:load|parseonly|norun))?|endsubmit)\b/i,lookbehind:!0,alias:"keyword"},g=/accessControl|cdm|aggregation|aStore|ruleMining|audio|autotune|bayesianNetClassifier|bioMedImage|boolRule|builtins|cardinality|sccasl|clustering|copula|countreg|dataDiscovery|dataPreprocess|dataSciencePilot|dataStep|decisionTree|deepLearn|deepNeural|varReduce|simSystem|ds2|deduplication|ecm|entityRes|espCluster|explainModel|factmac|fastKnn|fcmpact|fedSql|freqTab|gam|gleam|graphSemiSupLearn|gVarCluster|hiddenMarkovModel|hyperGroup|image|iml|ica|kernalPca|langModel|ldaTopic|sparseML|mlTools|mixed|modelPublishing|mbc|network|optNetwork|neuralNet|nonlinear|nmf|nonParametricBayes|optimization|panel|pls|percentile|pca|phreg|qkb|qlim|quantreg|recommend|tsReconcile|deepRnn|regression|reinforcementLearn|robustPca|sampling|sparkEmbeddedProcess|search(?:Analytics)?|sentimentAnalysis|sequence|configuration|session(?:Prop)?|severity|simple|smartData|sandwich|spatialreg|stabilityMonitoring|spc|loadStreams|svDataDescription|svm|table|conditionalRandomFields|text(?:Rule(?:Develop|Score)|Mining|Parse|Topic|Util|Filters|Frequency)|tsInfo|timeData|transpose|uniTimeSeries/.source,v={pattern:RegExp(/(^|\s)(?:action\s+)?(?:)\.[a-z]+\b[^;]+/.source.replace(//g,function(){return g}),"i"),lookbehind:!0,inside:{keyword:RegExp(/(?:)\.[a-z]+\b/.source.replace(//g,function(){return g}),"i"),action:{pattern:/(?:action)/i,alias:"keyword"},comment:u,function:f,"arg-value":d["arg-value"],operator:d.operator,argument:d.arg,number:r,"numeric-constant":i,punctuation:l,string:c}},y={pattern:/((?:^|\s)=?)(?:after|analysis|and|array|barchart|barwidth|begingraph|by|call|cas|cbarline|cfill|class(?:lev)?|close|column|computed?|contains|continue|data(?==)|define|delete|describe|document|do\s+over|do|dol|drop|dul|end(?:source|comp)?|entryTitle|else|eval(?:uate)?|exec(?:ute)?|exit|fill(?:attrs)?|file(?:name)?|flist|fnc|function(?:list)?|goto|global|group(?:by)?|headline|headskip|histogram|if|infile|keep|keylabel|keyword|label|layout|leave|legendlabel|length|libname|loadactionset|merge|midpoints|name|noobs|nowd|_?null_|ods|options|or|otherwise|out(?:put)?|over(?:lay)?|plot|put|print|raise|ranexp|rannor|rbreak|retain|return|select|set|session|sessref|source|statgraph|sum|summarize|table|temp|terminate|then\s+do|then|title\d?|to|var|when|where|xaxisopts|yaxisopts|y2axisopts)\b/i,lookbehind:!0},t.languages.sas={datalines:{pattern:/^([ \t]*)(?:(?:data)?lines|cards);[\s\S]+?^[ \t]*;/im,lookbehind:!0,alias:"string",inside:{keyword:{pattern:/^(?:(?:data)?lines|cards)/i},punctuation:/;/}},"proc-sql":{pattern:/(^proc\s+(?:fed)?sql(?:\s+[\w|=]+)?;)[\s\S]+?(?=^(?:proc\s+\w+|quit|run|data);|(?![\s\S]))/im,lookbehind:!0,inside:{sql:{pattern:RegExp(/^[ \t]*(?:select|alter\s+table|(?:create|describe|drop)\s+(?:index|table(?:\s+constraints)?|view)|create\s+unique\s+index|insert\s+into|update)(?:|[^;"'])+;/.source.replace(//g,function(){return n}),"im"),alias:"language-sql",inside:t.languages.sql},"global-statements":b,"sql-statements":{pattern:/(^|\s)(?:disconnect\s+from|exec(?:ute)?|begin|commit|rollback|reset|validate)\b/i,lookbehind:!0,alias:"keyword"},number:r,"numeric-constant":i,punctuation:l,string:c}},"proc-groovy":{pattern:/(^proc\s+groovy(?:\s+[\w|=]+)?;)[\s\S]+?(?=^(?:proc\s+\w+|quit|run|data);|(?![\s\S]))/im,lookbehind:!0,inside:{comment:u,groovy:{pattern:RegExp(/(^[ \t]*submit(?:\s+(?:load|parseonly|norun))?)(?:|[^"'])+?(?=endsubmit;)/.source.replace(//g,function(){return n}),"im"),lookbehind:!0,alias:"language-groovy",inside:t.languages.groovy},keyword:y,"submit-statement":m,"global-statements":b,number:r,"numeric-constant":i,punctuation:l,string:c}},"proc-lua":{pattern:/(^proc\s+lua(?:\s+[\w|=]+)?;)[\s\S]+?(?=^(?:proc\s+\w+|quit|run|data);|(?![\s\S]))/im,lookbehind:!0,inside:{comment:u,lua:{pattern:RegExp(/(^[ \t]*submit(?:\s+(?:load|parseonly|norun))?)(?:|[^"'])+?(?=endsubmit;)/.source.replace(//g,function(){return n}),"im"),lookbehind:!0,alias:"language-lua",inside:t.languages.lua},keyword:y,"submit-statement":m,"global-statements":b,number:r,"numeric-constant":i,punctuation:l,string:c}},"proc-cas":{pattern:/(^proc\s+cas(?:\s+[\w|=]+)?;)[\s\S]+?(?=^(?:proc\s+\w+|quit|data);|(?![\s\S]))/im,lookbehind:!0,inside:{comment:u,"statement-var":{pattern:/((?:^|\s)=?)saveresult\s[^;]+/im,lookbehind:!0,inside:{statement:{pattern:/^saveresult\s+\S+/i,inside:{keyword:/^(?:saveresult)/i}},rest:d}},"cas-actions":v,statement:{pattern:/((?:^|\s)=?)(?:default|(?:un)?set|on|output|upload)[^;]+/im,lookbehind:!0,inside:d},step:s,keyword:y,function:f,format:h,altformat:p,"global-statements":b,number:r,"numeric-constant":i,punctuation:l,string:c}},"proc-args":{pattern:RegExp(/(^proc\s+\w+\s+)(?!\s)(?:[^;"']|)+;/.source.replace(//g,function(){return n}),"im"),lookbehind:!0,inside:d},"macro-keyword":o,"macro-variable":a,"macro-string-functions":{pattern:/((?:^|\s|=))%(?:NRBQUOTE|NRQUOTE|NRSTR|BQUOTE|QUOTE|STR)\(.*?(?:[^%]\))/i,lookbehind:!0,inside:{function:{pattern:/%(?:NRBQUOTE|NRQUOTE|NRSTR|BQUOTE|QUOTE|STR)/i,alias:"keyword"},"macro-keyword":o,"macro-variable":a,"escaped-char":{pattern:/%['"()<>=¬^~;,#]/i},punctuation:l}},"macro-declaration":{pattern:/^%macro[^;]+(?=;)/im,inside:{keyword:/%macro/i}},"macro-end":{pattern:/^%mend[^;]+(?=;)/im,inside:{keyword:/%mend/i}},macro:{pattern:/%_\w+(?=\()/,alias:"keyword"},input:{pattern:/\binput\s[-\w\s/*.$&]+;/i,inside:{input:{alias:"keyword",pattern:/^input/i},comment:u,number:r,"numeric-constant":i}},"options-args":{pattern:/(^options)[-'"|/\\<>*+=:()\w\s]*(?=;)/im,lookbehind:!0,inside:d},"cas-actions":v,comment:u,function:f,format:h,altformat:p,"numeric-constant":i,datetime:{pattern:RegExp(n+"(?:dt?|t)"),alias:"number"},string:c,step:s,keyword:y,"operator-keyword":{pattern:/\b(?:eq|ne|gt|lt|ge|le|in|not)\b/i,alias:"operator"},number:r,operator:/\*\*?|\|\|?|!!?|¦¦?|<[>=]?|>[<=]?|[-+\/=&]|[~¬^]=?/i,punctuation:l}}e.exports=t,t.displayName="sas",t.aliases=[]},41720(e){"use strict";function t(e){var t,n,r;(t=e).languages.sass=t.languages.extend("css",{comment:{pattern:/^([ \t]*)\/[\/*].*(?:(?:\r?\n|\r)\1[ \t].+)*/m,lookbehind:!0}}),t.languages.insertBefore("sass","atrule",{"atrule-line":{pattern:/^(?:[ \t]*)[@+=].+/m,inside:{atrule:/(?:@[\w-]+|[+=])/m}}}),delete t.languages.sass.atrule,n=/\$[-\w]+|#\{\$[-\w]+\}/,r=[/[+*\/%]|[=!]=|<=?|>=?|\b(?:and|or|not)\b/,{pattern:/(\s)-(?=\s)/,lookbehind:!0}],t.languages.insertBefore("sass","property",{"variable-line":{pattern:/^[ \t]*\$.+/m,inside:{punctuation:/:/,variable:n,operator:r}},"property-line":{pattern:/^[ \t]*(?:[^:\s]+ *:.*|:[^:\s].*)/m,inside:{property:[/[^:\s]+(?=\s*:)/,{pattern:/(:)[^:\s]+/,lookbehind:!0}],punctuation:/:/,variable:n,operator:r,important:t.languages.sass.important}}}),delete t.languages.sass.property,delete t.languages.sass.important,t.languages.insertBefore("sass","punctuation",{selector:{pattern:/([ \t]*)\S(?:,[^,\r\n]+|[^,\r\n]*)(?:,[^,\r\n]+)*(?:,(?:\r?\n|\r)\1[ \t]+\S(?:,[^,\r\n]+|[^,\r\n]*)(?:,[^,\r\n]+)*)*/,lookbehind:!0}})}e.exports=t,t.displayName="sass",t.aliases=[]},6054(e,t,n){"use strict";var r=n(15909);function i(e){e.register(r),e.languages.scala=e.languages.extend("java",{"triple-quoted-string":{pattern:/"""[\s\S]*?"""/,greedy:!0,alias:"string"},string:{pattern:/("|')(?:\\.|(?!\1)[^\\\r\n])*\1/,greedy:!0},keyword:/<-|=>|\b(?:abstract|case|catch|class|def|do|else|extends|final|finally|for|forSome|if|implicit|import|lazy|match|new|null|object|override|package|private|protected|return|sealed|self|super|this|throw|trait|try|type|val|var|while|with|yield)\b/,number:/\b0x(?:[\da-f]*\.)?[\da-f]+|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e\d+)?[dfl]?/i,builtin:/\b(?:String|Int|Long|Short|Byte|Boolean|Double|Float|Char|Any|AnyRef|AnyVal|Unit|Nothing)\b/,symbol:/'[^\d\s\\]\w*/}),delete e.languages.scala["class-name"],delete e.languages.scala.function}e.exports=i,i.displayName="scala",i.aliases=[]},9997(e){"use strict";function t(e){!function(e){e.languages.scheme={comment:/;.*|#;\s*(?:\((?:[^()]|\([^()]*\))*\)|\[(?:[^\[\]]|\[[^\[\]]*\])*\])|#\|(?:[^#|]|#(?!\|)|\|(?!#)|#\|(?:[^#|]|#(?!\|)|\|(?!#))*\|#)*\|#/,string:{pattern:/"(?:[^"\\]|\\.)*"/,greedy:!0},symbol:{pattern:/'[^()\[\]#'\s]+/,greedy:!0},character:{pattern:/#\\(?:[ux][a-fA-F\d]+\b|[-a-zA-Z]+\b|[\uD800-\uDBFF][\uDC00-\uDFFF]|\S)/,greedy:!0,alias:"string"},"lambda-parameter":[{pattern:/((?:^|[^'`#])[(\[]lambda\s+)(?:[^|()\[\]'\s]+|\|(?:[^\\|]|\\.)*\|)/,lookbehind:!0},{pattern:/((?:^|[^'`#])[(\[]lambda\s+[(\[])[^()\[\]']+/,lookbehind:!0}],keyword:{pattern:/((?:^|[^'`#])[(\[])(?:begin|case(?:-lambda)?|cond(?:-expand)?|define(?:-library|-macro|-record-type|-syntax|-values)?|defmacro|delay(?:-force)?|do|else|export|except|guard|if|import|include(?:-ci|-library-declarations)?|lambda|let(?:rec)?(?:-syntax|-values|\*)?|let\*-values|only|parameterize|prefix|(?:quasi-?)?quote|rename|set!|syntax-(?:case|rules)|unless|unquote(?:-splicing)?|when)(?=[()\[\]\s]|$)/,lookbehind:!0},builtin:{pattern:/((?:^|[^'`#])[(\[])(?:abs|and|append|apply|assoc|ass[qv]|binary-port\?|boolean=?\?|bytevector(?:-append|-copy|-copy!|-length|-u8-ref|-u8-set!|\?)?|caar|cadr|call-with-(?:current-continuation|port|values)|call\/cc|car|cdar|cddr|cdr|ceiling|char(?:->integer|-ready\?|\?|<\?|<=\?|=\?|>\?|>=\?)|close-(?:input-port|output-port|port)|complex\?|cons|current-(?:error|input|output)-port|denominator|dynamic-wind|eof-object\??|eq\?|equal\?|eqv\?|error|error-object(?:-irritants|-message|\?)|eval|even\?|exact(?:-integer-sqrt|-integer\?|\?)?|expt|features|file-error\?|floor(?:-quotient|-remainder|\/)?|flush-output-port|for-each|gcd|get-output-(?:bytevector|string)|inexact\??|input-port(?:-open\?|\?)|integer(?:->char|\?)|lcm|length|list(?:->string|->vector|-copy|-ref|-set!|-tail|\?)?|make-(?:bytevector|list|parameter|string|vector)|map|max|member|memq|memv|min|modulo|negative\?|newline|not|null\?|number(?:->string|\?)|numerator|odd\?|open-(?:input|output)-(?:bytevector|string)|or|output-port(?:-open\?|\?)|pair\?|peek-char|peek-u8|port\?|positive\?|procedure\?|quotient|raise|raise-continuable|rational\?|rationalize|read-(?:bytevector|bytevector!|char|error\?|line|string|u8)|real\?|remainder|reverse|round|set-c[ad]r!|square|string(?:->list|->number|->symbol|->utf8|->vector|-append|-copy|-copy!|-fill!|-for-each|-length|-map|-ref|-set!|\?|<\?|<=\?|=\?|>\?|>=\?)?|substring|symbol(?:->string|\?|=\?)|syntax-error|textual-port\?|truncate(?:-quotient|-remainder|\/)?|u8-ready\?|utf8->string|values|vector(?:->list|->string|-append|-copy|-copy!|-fill!|-for-each|-length|-map|-ref|-set!|\?)?|with-exception-handler|write-(?:bytevector|char|string|u8)|zero\?)(?=[()\[\]\s]|$)/,lookbehind:!0},operator:{pattern:/((?:^|[^'`#])[(\[])(?:[-+*%/]|[<>]=?|=>?)(?=[()\[\]\s]|$)/,lookbehind:!0},number:{pattern:RegExp(t({"":/\d+(?:\/\d+)|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?/.source,"":/[+-]?|[+-](?:inf|nan)\.0/.source,"":/[+-](?:|(?:inf|nan)\.0)?i/.source,"":/(?:@|)?|/.source,"":/(?:#d(?:#[ei])?|#[ei](?:#d)?)?/.source,"":/[0-9a-f]+(?:\/[0-9a-f]+)?/.source,"":/[+-]?|[+-](?:inf|nan)\.0/.source,"":/[+-](?:|(?:inf|nan)\.0)?i/.source,"":/(?:@|)?|/.source,"":/#[box](?:#[ei])?|(?:#[ei])?#[box]/.source,"":/(^|[()\[\]\s])(?:|)(?=[()\[\]\s]|$)/.source}),"i"),lookbehind:!0},boolean:{pattern:/(^|[()\[\]\s])#(?:[ft]|false|true)(?=[()\[\]\s]|$)/,lookbehind:!0},function:{pattern:/((?:^|[^'`#])[(\[])(?:[^|()\[\]'\s]+|\|(?:[^\\|]|\\.)*\|)(?=[()\[\]\s]|$)/,lookbehind:!0},identifier:{pattern:/(^|[()\[\]\s])\|(?:[^\\|]|\\.)*\|(?=[()\[\]\s]|$)/,lookbehind:!0,greedy:!0},punctuation:/[()\[\]']/};function t(e){for(var t in e)e[t]=e[t].replace(/<[\w\s]+>/g,function(t){return"(?:"+e[t].trim()+")"});return e[t]}}(e)}e.exports=t,t.displayName="scheme",t.aliases=[]},24296(e){"use strict";function t(e){e.languages.scss=e.languages.extend("css",{comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,lookbehind:!0},atrule:{pattern:/@[\w-](?:\([^()]+\)|[^()\s]|\s+(?!\s))*?(?=\s+[{;])/,inside:{rule:/@[\w-]+/}},url:/(?:[-a-z]+-)?url(?=\()/i,selector:{pattern:/(?=\S)[^@;{}()]?(?:[^@;{}()\s]|\s+(?!\s)|#\{\$[-\w]+\})+(?=\s*\{(?:\}|\s|[^}][^:{}]*[:{][^}]))/m,inside:{parent:{pattern:/&/,alias:"important"},placeholder:/%[-\w]+/,variable:/\$[-\w]+|#\{\$[-\w]+\}/}},property:{pattern:/(?:[-\w]|\$[-\w]|#\{\$[-\w]+\})+(?=\s*:)/,inside:{variable:/\$[-\w]+|#\{\$[-\w]+\}/}}}),e.languages.insertBefore("scss","atrule",{keyword:[/@(?:if|else(?: if)?|forward|for|each|while|import|use|extend|debug|warn|mixin|include|function|return|content)\b/i,{pattern:/( )(?:from|through)(?= )/,lookbehind:!0}]}),e.languages.insertBefore("scss","important",{variable:/\$[-\w]+|#\{\$[-\w]+\}/}),e.languages.insertBefore("scss","function",{"module-modifier":{pattern:/\b(?:as|with|show|hide)\b/i,alias:"keyword"},placeholder:{pattern:/%[-\w]+/,alias:"selector"},statement:{pattern:/\B!(?:default|optional)\b/i,alias:"keyword"},boolean:/\b(?:true|false)\b/,null:{pattern:/\bnull\b/,alias:"keyword"},operator:{pattern:/(\s)(?:[-+*\/%]|[=!]=|<=?|>=?|and|or|not)(?=\s)/,lookbehind:!0}}),e.languages.scss.atrule.inside.rest=e.languages.scss}e.exports=t,t.displayName="scss",t.aliases=[]},49246(e,t,n){"use strict";var r=n(6979);function i(e){var t,n;e.register(r),n=[/"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/.source,/'[^']*'/.source,/\$'(?:[^'\\]|\\[\s\S])*'/.source,/<<-?\s*(["']?)(\w+)\1\s[\s\S]*?[\r\n]\2/.source].join("|"),(t=e).languages["shell-session"]={command:{pattern:RegExp(/^(?:[^\s@:$#*!/\\]+@[^\r\n@:$#*!/\\]+(?::[^\0-\x1F$#*?"<>:;|]+)?|[^\0-\x1F$#*?"<>@:;|]+)?/.source+/[$#]/.source+/(?:[^\\\r\n'"<$]|\\(?:[^\r]|\r\n?)|\$(?!')|<>)+/.source.replace(/<>/g,function(){return n}),"m"),greedy:!0,inside:{info:{pattern:/^[^#$]+/,alias:"punctuation",inside:{user:/^[^\s@:$#*!/\\]+@[^\r\n@:$#*!/\\]+/,punctuation:/:/,path:/[\s\S]+/}},bash:{pattern:/(^[$#]\s*)\S[\s\S]*/,lookbehind:!0,alias:"language-bash",inside:t.languages.bash},"shell-symbol":{pattern:/^[$#]/,alias:"important"}}},output:/.(?:.*(?:[\r\n]|.$))*/},t.languages["sh-session"]=t.languages.shellsession=t.languages["shell-session"]}e.exports=i,i.displayName="shellSession",i.aliases=[]},18890(e){"use strict";function t(e){e.languages.smali={comment:/#.*/,string:{pattern:/"(?:[^\r\n\\"]|\\.)*"|'(?:[^\r\n\\']|\\(?:.|u[\da-fA-F]{4}))'/,greedy:!0},"class-name":{pattern:/(^|[^L])L(?:(?:\w+|`[^`\r\n]*`)\/)*(?:[\w$]+|`[^`\r\n]*`)(?=\s*;)/,lookbehind:!0,inside:{"class-name":{pattern:/(^L|\/)(?:[\w$]+|`[^`\r\n]*`)$/,lookbehind:!0},namespace:{pattern:/^(L)(?:(?:\w+|`[^`\r\n]*`)\/)+/,lookbehind:!0,inside:{punctuation:/\//}},builtin:/^L/}},builtin:[{pattern:/([();\[])[BCDFIJSVZ]+/,lookbehind:!0},{pattern:/([\w$>]:)[BCDFIJSVZ]/,lookbehind:!0}],keyword:[{pattern:/(\.end\s+)[\w-]+/,lookbehind:!0},{pattern:/(^|[^\w.-])\.(?!\d)[\w-]+/,lookbehind:!0},{pattern:/(^|[^\w.-])(?:abstract|annotation|bridge|constructor|enum|final|interface|private|protected|public|runtime|static|synthetic|system|transient)(?![\w.-])/,lookbehind:!0}],function:{pattern:/(^|[^\w.-])(?:\w+|<[\w$-]+>)(?=\()/,lookbehind:!0},field:{pattern:/[\w$]+(?=:)/,alias:"variable"},register:{pattern:/(^|[^\w.-])[vp]\d(?![\w.-])/,lookbehind:!0,alias:"variable"},boolean:{pattern:/(^|[^\w.-])(?:true|false)(?![\w.-])/,lookbehind:!0},number:{pattern:/(^|[^/\w.-])-?(?:NAN|INFINITY|0x(?:[\dA-F]+(?:\.[\dA-F]*)?|\.[\dA-F]+)(?:p[+-]?[\dA-F]+)?|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?)[dflst]?(?![\w.-])/i,lookbehind:!0},label:{pattern:/(:)\w+/,lookbehind:!0,alias:"property"},operator:/->|\.\.|[\[=]/,punctuation:/[{}(),;:]/}}e.exports=t,t.displayName="smali",t.aliases=[]},11037(e){"use strict";function t(e){e.languages.smalltalk={comment:/"(?:""|[^"])*"/,character:{pattern:/\$./,alias:"string"},string:/'(?:''|[^'])*'/,symbol:/#[\da-z]+|#(?:-|([+\/\\*~<>=@%|&?!])\1?)|#(?=\()/i,"block-arguments":{pattern:/(\[\s*):[^\[|]*\|/,lookbehind:!0,inside:{variable:/:[\da-z]+/i,punctuation:/\|/}},"temporary-variables":{pattern:/\|[^|]+\|/,inside:{variable:/[\da-z]+/i,punctuation:/\|/}},keyword:/\b(?:nil|true|false|self|super|new)\b/,number:[/\d+r-?[\dA-Z]+(?:\.[\dA-Z]+)?(?:e-?\d+)?/,/\b\d+(?:\.\d+)?(?:e-?\d+)?/],operator:/[<=]=?|:=|~[~=]|\/\/?|\\\\|>[>=]?|[!^+\-*&|,@]/,punctuation:/[.;:?\[\](){}]/}}e.exports=t,t.displayName="smalltalk",t.aliases=[]},64020(e,t,n){"use strict";var r=n(93205);function i(e){var t;e.register(r),(t=e).languages.smarty={comment:/\{\*[\s\S]*?\*\}/,delimiter:{pattern:/^\{|\}$/i,alias:"punctuation"},string:/(["'])(?:\\.|(?!\1)[^\\\r\n])*\1/,number:/\b0x[\dA-Fa-f]+|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee][-+]?\d+)?/,variable:[/\$(?!\d)\w+/,/#(?!\d)\w+#/,{pattern:/(\.|->)(?!\d)\w+/,lookbehind:!0},{pattern:/(\[)(?!\d)\w+(?=\])/,lookbehind:!0}],function:[{pattern:/(\|\s*)@?(?!\d)\w+/,lookbehind:!0},/^\/?(?!\d)\w+/,/(?!\d)\w+(?=\()/],"attr-name":{pattern:/\w+\s*=\s*(?:(?!\d)\w+)?/,inside:{variable:{pattern:/(=\s*)(?!\d)\w+/,lookbehind:!0},operator:/=/}},punctuation:[/[\[\]().,:`]|->/],operator:[/[+\-*\/%]|==?=?|[!<>]=?|&&|\|\|?/,/\bis\s+(?:not\s+)?(?:div|even|odd)(?:\s+by)?\b/,/\b(?:eq|neq?|gt|lt|gt?e|lt?e|not|mod|or|and)\b/],keyword:/\b(?:false|off|on|no|true|yes)\b/},t.hooks.add("before-tokenize",function(e){var n=/\{\*[\s\S]*?\*\}|\{[\s\S]+?\}/g,r="{literal}",i="{/literal}",a=!1;t.languages["markup-templating"].buildPlaceholders(e,"smarty",n,function(e){return e===i&&(a=!1),!a&&(e===r&&(a=!0),!0)})}),t.hooks.add("after-tokenize",function(e){t.languages["markup-templating"].tokenizePlaceholders(e,"smarty")})}e.exports=i,i.displayName="smarty",i.aliases=[]},49760(e){"use strict";function t(e){var t,n;n=/\b(?:abstype|and|andalso|as|case|datatype|do|else|end|eqtype|exception|fn|fun|functor|handle|if|in|include|infix|infixr|let|local|nonfix|of|op|open|orelse|raise|rec|sharing|sig|signature|struct|structure|then|type|val|where|while|with|withtype)\b/i,(t=e).languages.sml={comment:/\(\*(?:[^*(]|\*(?!\))|\((?!\*)|\(\*(?:[^*(]|\*(?!\))|\((?!\*))*\*\))*\*\)/,string:{pattern:/#?"(?:[^"\\]|\\.)*"/,greedy:!0},"class-name":[{pattern:RegExp(/((?:^|[^:]):\s*)(?:\s*(?:(?:\*|->)\s*|,\s*(?:(?=)|(?!)\s+)))*/.source.replace(//g,function(){return/\s*(?:[*,]|->)/.source}).replace(//g,function(){return/(?:'[\w']*||\((?:[^()]|\([^()]*\))*\)|\{(?:[^{}]|\{[^{}]*\})*\})(?:\s+)*/.source}).replace(//g,function(){return/(?!)[a-z\d_][\w'.]*/.source}).replace(//g,function(){return n.source}),"i"),lookbehind:!0,greedy:!0,inside:null},{pattern:/((?:^|[^\w'])(?:datatype|exception|functor|signature|structure|type)\s+)[a-z_][\w'.]*/i,lookbehind:!0}],function:{pattern:/((?:^|[^\w'])fun\s+)[a-z_][\w'.]*/i,lookbehind:!0},keyword:n,variable:{pattern:/(^|[^\w'])'[\w']*/,lookbehind:!0},number:/~?\b(?:\d+(?:\.\d+)?(?:e~?\d+)?|0x[\da-f]+)\b/i,word:{pattern:/\b0w(?:\d+|x[\da-f]+)\b/i,alias:"constant"},boolean:/\b(?:false|true)\b/i,operator:/\.\.\.|:[>=:]|=>?|->|[<>]=?|[!+\-*/^#|@~]/,punctuation:/[(){}\[\].:,;]/},t.languages.sml["class-name"][0].inside=t.languages.sml,t.languages.smlnj=t.languages.sml}e.exports=t,t.displayName="sml",t.aliases=["smlnj"]},33351(e){"use strict";function t(e){e.languages.solidity=e.languages.extend("clike",{"class-name":{pattern:/(\b(?:contract|enum|interface|library|new|struct|using)\s+)(?!\d)[\w$]+/,lookbehind:!0},keyword:/\b(?:_|anonymous|as|assembly|assert|break|calldata|case|constant|constructor|continue|contract|default|delete|do|else|emit|enum|event|external|for|from|function|if|import|indexed|inherited|interface|internal|is|let|library|mapping|memory|modifier|new|payable|pragma|private|public|pure|require|returns?|revert|selfdestruct|solidity|storage|struct|suicide|switch|this|throw|using|var|view|while)\b/,operator:/=>|->|:=|=:|\*\*|\+\+|--|\|\||&&|<<=?|>>=?|[-+*/%^&|<>!=]=?|[~?]/}),e.languages.insertBefore("solidity","keyword",{builtin:/\b(?:address|bool|string|u?int(?:8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?|byte|bytes(?:[1-9]|[12]\d|3[0-2])?)\b/}),e.languages.insertBefore("solidity","number",{version:{pattern:/([<>]=?|\^)\d+\.\d+\.\d+\b/,lookbehind:!0,alias:"number"}}),e.languages.sol=e.languages.solidity}e.exports=t,t.displayName="solidity",t.aliases=["sol"]},13570(e){"use strict";function t(e){var t,n;n={pattern:/\{[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}\}/i,alias:"constant",inside:{punctuation:/[{}]/}},(t=e).languages["solution-file"]={comment:{pattern:/#.*/,greedy:!0},string:{pattern:/"[^"\r\n]*"|'[^'\r\n]*'/,greedy:!0,inside:{guid:n}},object:{pattern:/^([ \t]*)(?:([A-Z]\w*)\b(?=.*(?:\r\n?|\n)(?:\1[ \t].*(?:\r\n?|\n))*\1End\2(?=[ \t]*$))|End[A-Z]\w*(?=[ \t]*$))/m,lookbehind:!0,greedy:!0,alias:"keyword"},property:{pattern:/^([ \t]*)(?!\s)[^\r\n"#=()]*[^\s"#=()](?=\s*=)/m,lookbehind:!0,inside:{guid:n}},guid:n,number:/\b\d+(?:\.\d+)*\b/,boolean:/\b(?:FALSE|TRUE)\b/,operator:/=/,punctuation:/[(),]/},t.languages.sln=t.languages["solution-file"]}e.exports=t,t.displayName="solutionFile",t.aliases=[]},38181(e,t,n){"use strict";var r=n(93205);function i(e){var t,n,i;e.register(r),n=/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,i=/\b\d+(?:\.\d+)?(?:[eE][+-]?\d+)?\b|\b0x[\dA-F]+\b/,(t=e).languages.soy={comment:[/\/\*[\s\S]*?\*\//,{pattern:/(\s)\/\/.*/,lookbehind:!0,greedy:!0}],"command-arg":{pattern:/(\{+\/?\s*(?:alias|call|delcall|delpackage|deltemplate|namespace|template)\s+)\.?[\w.]+/,lookbehind:!0,alias:"string",inside:{punctuation:/\./}},parameter:{pattern:/(\{+\/?\s*@?param\??\s+)\.?[\w.]+/,lookbehind:!0,alias:"variable"},keyword:[{pattern:/(\{+\/?[^\S\r\n]*)(?:\\[nrt]|alias|call|case|css|default|delcall|delpackage|deltemplate|else(?:if)?|fallbackmsg|for(?:each)?|if(?:empty)?|lb|let|literal|msg|namespace|nil|@?param\??|rb|sp|switch|template|xid)/,lookbehind:!0},/\b(?:any|as|attributes|bool|css|float|in|int|js|html|list|map|null|number|string|uri)\b/],delimiter:{pattern:/^\{+\/?|\/?\}+$/,alias:"punctuation"},property:/\w+(?==)/,variable:{pattern:/\$[^\W\d]\w*(?:\??(?:\.\w+|\[[^\]]+\]))*/,inside:{string:{pattern:n,greedy:!0},number:i,punctuation:/[\[\].?]/}},string:{pattern:n,greedy:!0},function:[/\w+(?=\()/,{pattern:/(\|[^\S\r\n]*)\w+/,lookbehind:!0}],boolean:/\b(?:true|false)\b/,number:i,operator:/\?:?|<=?|>=?|==?|!=|[+*/%-]|\b(?:and|not|or)\b/,punctuation:/[{}()\[\]|.,:]/},t.hooks.add("before-tokenize",function(e){var n=/\{\{.+?\}\}|\{.+?\}|\s\/\/.*|\/\*[\s\S]*?\*\//g,r="{literal}",i="{/literal}",a=!1;t.languages["markup-templating"].buildPlaceholders(e,"soy",n,function(e){return e===i&&(a=!1),!a&&(e===r&&(a=!0),!0)})}),t.hooks.add("after-tokenize",function(e){t.languages["markup-templating"].tokenizePlaceholders(e,"soy")})}e.exports=i,i.displayName="soy",i.aliases=[]},98774(e,t,n){"use strict";var r=n(24691);function i(e){e.register(r),e.languages.sparql=e.languages.extend("turtle",{boolean:/\b(?:true|false)\b/i,variable:{pattern:/[?$]\w+/,greedy:!0}}),e.languages.insertBefore("sparql","punctuation",{keyword:[/\b(?:A|ADD|ALL|AS|ASC|ASK|BNODE|BY|CLEAR|CONSTRUCT|COPY|CREATE|DATA|DEFAULT|DELETE|DESC|DESCRIBE|DISTINCT|DROP|EXISTS|FILTER|FROM|GROUP|HAVING|INSERT|INTO|LIMIT|LOAD|MINUS|MOVE|NAMED|NOT|NOW|OFFSET|OPTIONAL|ORDER|RAND|REDUCED|SELECT|SEPARATOR|SERVICE|SILENT|STRUUID|UNION|USING|UUID|VALUES|WHERE)\b/i,/\b(?:ABS|AVG|BIND|BOUND|CEIL|COALESCE|CONCAT|CONTAINS|COUNT|DATATYPE|DAY|ENCODE_FOR_URI|FLOOR|GROUP_CONCAT|HOURS|IF|IRI|isBLANK|isIRI|isLITERAL|isNUMERIC|isURI|LANG|LANGMATCHES|LCASE|MAX|MD5|MIN|MINUTES|MONTH|ROUND|REGEX|REPLACE|sameTerm|SAMPLE|SECONDS|SHA1|SHA256|SHA384|SHA512|STR|STRAFTER|STRBEFORE|STRDT|STRENDS|STRLANG|STRLEN|STRSTARTS|SUBSTR|SUM|TIMEZONE|TZ|UCASE|URI|YEAR)\b(?=\s*\()/i,/\b(?:GRAPH|BASE|PREFIX)\b/i]}),e.languages.rq=e.languages.sparql}e.exports=i,i.displayName="sparql",i.aliases=["rq"]},22855(e){"use strict";function t(e){e.languages["splunk-spl"]={comment:/`comment\("(?:\\.|[^\\"])*"\)`/,string:{pattern:/"(?:\\.|[^\\"])*"/,greedy:!0},keyword:/\b(?:abstract|accum|addcoltotals|addinfo|addtotals|analyzefields|anomalies|anomalousvalue|anomalydetection|append|appendcols|appendcsv|appendlookup|appendpipe|arules|associate|audit|autoregress|bin|bucket|bucketdir|chart|cluster|cofilter|collect|concurrency|contingency|convert|correlate|datamodel|dbinspect|dedup|delete|delta|diff|erex|eval|eventcount|eventstats|extract|fieldformat|fields|fieldsummary|filldown|fillnull|findtypes|folderize|foreach|format|from|gauge|gentimes|geom|geomfilter|geostats|head|highlight|history|iconify|input|inputcsv|inputlookup|iplocation|join|kmeans|kv|kvform|loadjob|localize|localop|lookup|makecontinuous|makemv|makeresults|map|mcollect|metadata|metasearch|meventcollect|mstats|multikv|multisearch|mvcombine|mvexpand|nomv|outlier|outputcsv|outputlookup|outputtext|overlap|pivot|predict|rangemap|rare|regex|relevancy|reltime|rename|replace|rest|return|reverse|rex|rtorder|run|savedsearch|script|scrub|search|searchtxn|selfjoin|sendemail|set|setfields|sichart|sirare|sistats|sitimechart|sitop|sort|spath|stats|strcat|streamstats|table|tags|tail|timechart|timewrap|top|transaction|transpose|trendline|tscollect|tstats|typeahead|typelearner|typer|union|uniq|untable|where|x11|xmlkv|xmlunescape|xpath|xyseries)\b/i,"operator-word":{pattern:/\b(?:and|as|by|not|or|xor)\b/i,alias:"operator"},function:/\b\w+(?=\s*\()/,property:/\b\w+(?=\s*=(?!=))/,date:{pattern:/\b\d{1,2}\/\d{1,2}\/\d{1,4}(?:(?::\d{1,2}){3})?\b/,alias:"number"},number:/\b\d+(?:\.\d+)?\b/,boolean:/\b(?:f|false|t|true)\b/i,operator:/[<>=]=?|[-+*/%|]/,punctuation:/[()[\],]/}}e.exports=t,t.displayName="splunkSpl",t.aliases=[]},29611(e){"use strict";function t(e){e.languages.sqf=e.languages.extend("clike",{string:{pattern:/"(?:(?:"")?[^"])*"(?!")|'(?:[^'])*'/,greedy:!0},keyword:/\b(?:breakOut|breakTo|call|case|catch|default|do|echo|else|execVM|execFSM|exitWith|for|forEach|forEachMember|forEachMemberAgent|forEachMemberTeam|from|goto|if|nil|preprocessFile|preprocessFileLineNumbers|private|scopeName|spawn|step|switch|then|throw|to|try|while|with)\b/i,boolean:/\b(?:true|false)\b/i,function:/\b(?:abs|accTime|acos|action|actionIDs|actionKeys|actionKeysImages|actionKeysNames|actionKeysNamesArray|actionName|actionParams|activateAddons|activatedAddons|activateKey|add3DENConnection|add3DENEventHandler|add3DENLayer|addAction|addBackpack|addBackpackCargo|addBackpackCargoGlobal|addBackpackGlobal|addCamShake|addCuratorAddons|addCuratorCameraArea|addCuratorEditableObjects|addCuratorEditingArea|addCuratorPoints|addEditorObject|addEventHandler|addForce|addForceGeneratorRTD|addGoggles|addGroupIcon|addHandgunItem|addHeadgear|addItem|addItemCargo|addItemCargoGlobal|addItemPool|addItemToBackpack|addItemToUniform|addItemToVest|addLiveStats|addMagazine|addMagazineAmmoCargo|addMagazineCargo|addMagazineCargoGlobal|addMagazineGlobal|addMagazinePool|addMagazines|addMagazineTurret|addMenu|addMenuItem|addMissionEventHandler|addMPEventHandler|addMusicEventHandler|addOwnedMine|addPlayerScores|addPrimaryWeaponItem|addPublicVariableEventHandler|addRating|addResources|addScore|addScoreSide|addSecondaryWeaponItem|addSwitchableUnit|addTeamMember|addToRemainsCollector|addTorque|addUniform|addVehicle|addVest|addWaypoint|addWeapon|addWeaponCargo|addWeaponCargoGlobal|addWeaponGlobal|addWeaponItem|addWeaponPool|addWeaponTurret|admin|agent|agents|AGLToASL|aimedAtTarget|aimPos|airDensityCurveRTD|airDensityRTD|airplaneThrottle|airportSide|AISFinishHeal|alive|all3DENEntities|allAirports|allControls|allCurators|allCutLayers|allDead|allDeadMen|allDisplays|allGroups|allMapMarkers|allMines|allMissionObjects|allow3DMode|allowCrewInImmobile|allowCuratorLogicIgnoreAreas|allowDamage|allowDammage|allowFileOperations|allowFleeing|allowGetIn|allowSprint|allPlayers|allSimpleObjects|allSites|allTurrets|allUnits|allUnitsUAV|allVariables|ammo|ammoOnPylon|animate|animateBay|animateDoor|animatePylon|animateSource|animationNames|animationPhase|animationSourcePhase|animationState|append|apply|armoryPoints|arrayIntersect|asin|ASLToAGL|ASLToATL|assert|assignAsCargo|assignAsCargoIndex|assignAsCommander|assignAsDriver|assignAsGunner|assignAsTurret|assignCurator|assignedCargo|assignedCommander|assignedDriver|assignedGunner|assignedItems|assignedTarget|assignedTeam|assignedVehicle|assignedVehicleRole|assignItem|assignTeam|assignToAirport|atan|atan2|atg|ATLToASL|attachedObject|attachedObjects|attachedTo|attachObject|attachTo|attackEnabled|backpack|backpackCargo|backpackContainer|backpackItems|backpackMagazines|backpackSpaceFor|behaviour|benchmark|binocular|blufor|boundingBox|boundingBoxReal|boundingCenter|briefingName|buildingExit|buildingPos|buldozer_EnableRoadDiag|buldozer_IsEnabledRoadDiag|buldozer_LoadNewRoads|buldozer_reloadOperMap|buttonAction|buttonSetAction|cadetMode|callExtension|camCommand|camCommit|camCommitPrepared|camCommitted|camConstuctionSetParams|camCreate|camDestroy|cameraEffect|cameraEffectEnableHUD|cameraInterest|cameraOn|cameraView|campaignConfigFile|camPreload|camPreloaded|camPrepareBank|camPrepareDir|camPrepareDive|camPrepareFocus|camPrepareFov|camPrepareFovRange|camPreparePos|camPrepareRelPos|camPrepareTarget|camSetBank|camSetDir|camSetDive|camSetFocus|camSetFov|camSetFovRange|camSetPos|camSetRelPos|camSetTarget|camTarget|camUseNVG|canAdd|canAddItemToBackpack|canAddItemToUniform|canAddItemToVest|cancelSimpleTaskDestination|canFire|canMove|canSlingLoad|canStand|canSuspend|canTriggerDynamicSimulation|canUnloadInCombat|canVehicleCargo|captive|captiveNum|cbChecked|cbSetChecked|ceil|channelEnabled|cheatsEnabled|checkAIFeature|checkVisibility|civilian|className|clear3DENAttribute|clear3DENInventory|clearAllItemsFromBackpack|clearBackpackCargo|clearBackpackCargoGlobal|clearForcesRTD|clearGroupIcons|clearItemCargo|clearItemCargoGlobal|clearItemPool|clearMagazineCargo|clearMagazineCargoGlobal|clearMagazinePool|clearOverlay|clearRadio|clearVehicleInit|clearWeaponCargo|clearWeaponCargoGlobal|clearWeaponPool|clientOwner|closeDialog|closeDisplay|closeOverlay|collapseObjectTree|collect3DENHistory|collectiveRTD|combatMode|commandArtilleryFire|commandChat|commander|commandFire|commandFollow|commandFSM|commandGetOut|commandingMenu|commandMove|commandRadio|commandStop|commandSuppressiveFire|commandTarget|commandWatch|comment|commitOverlay|compile|compileFinal|completedFSM|composeText|configClasses|configFile|configHierarchy|configName|configNull|configProperties|configSourceAddonList|configSourceMod|configSourceModList|confirmSensorTarget|connectTerminalToUAV|controlNull|controlsGroupCtrl|copyFromClipboard|copyToClipboard|copyWaypoints|cos|count|countEnemy|countFriendly|countSide|countType|countUnknown|create3DENComposition|create3DENEntity|createAgent|createCenter|createDialog|createDiaryLink|createDiaryRecord|createDiarySubject|createDisplay|createGearDialog|createGroup|createGuardedPoint|createLocation|createMarker|createMarkerLocal|createMenu|createMine|createMissionDisplay|createMPCampaignDisplay|createSimpleObject|createSimpleTask|createSite|createSoundSource|createTask|createTeam|createTrigger|createUnit|createVehicle|createVehicleCrew|createVehicleLocal|crew|ctAddHeader|ctAddRow|ctClear|ctCurSel|ctData|ctFindHeaderRows|ctFindRowHeader|ctHeaderControls|ctHeaderCount|ctRemoveHeaders|ctRemoveRows|ctrlActivate|ctrlAddEventHandler|ctrlAngle|ctrlAutoScrollDelay|ctrlAutoScrollRewind|ctrlAutoScrollSpeed|ctrlChecked|ctrlClassName|ctrlCommit|ctrlCommitted|ctrlCreate|ctrlDelete|ctrlEnable|ctrlEnabled|ctrlFade|ctrlHTMLLoaded|ctrlIDC|ctrlIDD|ctrlMapAnimAdd|ctrlMapAnimClear|ctrlMapAnimCommit|ctrlMapAnimDone|ctrlMapCursor|ctrlMapMouseOver|ctrlMapScale|ctrlMapScreenToWorld|ctrlMapWorldToScreen|ctrlModel|ctrlModelDirAndUp|ctrlModelScale|ctrlParent|ctrlParentControlsGroup|ctrlPosition|ctrlRemoveAllEventHandlers|ctrlRemoveEventHandler|ctrlScale|ctrlSetActiveColor|ctrlSetAngle|ctrlSetAutoScrollDelay|ctrlSetAutoScrollRewind|ctrlSetAutoScrollSpeed|ctrlSetBackgroundColor|ctrlSetChecked|ctrlSetDisabledColor|ctrlSetEventHandler|ctrlSetFade|ctrlSetFocus|ctrlSetFont|ctrlSetFontH1|ctrlSetFontH1B|ctrlSetFontH2|ctrlSetFontH2B|ctrlSetFontH3|ctrlSetFontH3B|ctrlSetFontH4|ctrlSetFontH4B|ctrlSetFontH5|ctrlSetFontH5B|ctrlSetFontH6|ctrlSetFontH6B|ctrlSetFontHeight|ctrlSetFontHeightH1|ctrlSetFontHeightH2|ctrlSetFontHeightH3|ctrlSetFontHeightH4|ctrlSetFontHeightH5|ctrlSetFontHeightH6|ctrlSetFontHeightSecondary|ctrlSetFontP|ctrlSetFontPB|ctrlSetFontSecondary|ctrlSetForegroundColor|ctrlSetModel|ctrlSetModelDirAndUp|ctrlSetModelScale|ctrlSetPixelPrecision|ctrlSetPosition|ctrlSetScale|ctrlSetStructuredText|ctrlSetText|ctrlSetTextColor|ctrlSetTextColorSecondary|ctrlSetTextSecondary|ctrlSetTooltip|ctrlSetTooltipColorBox|ctrlSetTooltipColorShade|ctrlSetTooltipColorText|ctrlShow|ctrlShown|ctrlText|ctrlTextHeight|ctrlTextSecondary|ctrlTextWidth|ctrlType|ctrlVisible|ctRowControls|ctRowCount|ctSetCurSel|ctSetData|ctSetHeaderTemplate|ctSetRowTemplate|ctSetValue|ctValue|curatorAddons|curatorCamera|curatorCameraArea|curatorCameraAreaCeiling|curatorCoef|curatorEditableObjects|curatorEditingArea|curatorEditingAreaType|curatorMouseOver|curatorPoints|curatorRegisteredObjects|curatorSelected|curatorWaypointCost|current3DENOperation|currentChannel|currentCommand|currentMagazine|currentMagazineDetail|currentMagazineDetailTurret|currentMagazineTurret|currentMuzzle|currentNamespace|currentTask|currentTasks|currentThrowable|currentVisionMode|currentWaypoint|currentWeapon|currentWeaponMode|currentWeaponTurret|currentZeroing|cursorObject|cursorTarget|customChat|customRadio|cutFadeOut|cutObj|cutRsc|cutText|damage|date|dateToNumber|daytime|deActivateKey|debriefingText|debugFSM|debugLog|deg|delete3DENEntities|deleteAt|deleteCenter|deleteCollection|deleteEditorObject|deleteGroup|deleteGroupWhenEmpty|deleteIdentity|deleteLocation|deleteMarker|deleteMarkerLocal|deleteRange|deleteResources|deleteSite|deleteStatus|deleteTeam|deleteVehicle|deleteVehicleCrew|deleteWaypoint|detach|detectedMines|diag_activeMissionFSMs|diag_activeScripts|diag_activeSQFScripts|diag_activeSQSScripts|diag_captureFrame|diag_captureFrameToFile|diag_captureSlowFrame|diag_codePerformance|diag_drawMode|diag_dynamicSimulationEnd|diag_enable|diag_enabled|diag_fps|diag_fpsMin|diag_frameNo|diag_lightNewLoad|diag_list|diag_log|diag_logSlowFrame|diag_mergeConfigFile|diag_recordTurretLimits|diag_setLightNew|diag_tickTime|diag_toggle|dialog|diarySubjectExists|didJIP|didJIPOwner|difficulty|difficultyEnabled|difficultyEnabledRTD|difficultyOption|direction|directSay|disableAI|disableCollisionWith|disableConversation|disableDebriefingStats|disableMapIndicators|disableNVGEquipment|disableRemoteSensors|disableSerialization|disableTIEquipment|disableUAVConnectability|disableUserInput|displayAddEventHandler|displayCtrl|displayNull|displayParent|displayRemoveAllEventHandlers|displayRemoveEventHandler|displaySetEventHandler|dissolveTeam|distance|distance2D|distanceSqr|distributionRegion|do3DENAction|doArtilleryFire|doFire|doFollow|doFSM|doGetOut|doMove|doorPhase|doStop|doSuppressiveFire|doTarget|doWatch|drawArrow|drawEllipse|drawIcon|drawIcon3D|drawLine|drawLine3D|drawLink|drawLocation|drawPolygon|drawRectangle|drawTriangle|driver|drop|dynamicSimulationDistance|dynamicSimulationDistanceCoef|dynamicSimulationEnabled|dynamicSimulationSystemEnabled|east|edit3DENMissionAttributes|editObject|editorSetEventHandler|effectiveCommander|emptyPositions|enableAI|enableAIFeature|enableAimPrecision|enableAttack|enableAudioFeature|enableAutoStartUpRTD|enableAutoTrimRTD|enableCamShake|enableCaustics|enableChannel|enableCollisionWith|enableCopilot|enableDebriefingStats|enableDiagLegend|enableDynamicSimulation|enableDynamicSimulationSystem|enableEndDialog|enableEngineArtillery|enableEnvironment|enableFatigue|enableGunLights|enableInfoPanelComponent|enableIRLasers|enableMimics|enablePersonTurret|enableRadio|enableReload|enableRopeAttach|enableSatNormalOnDetail|enableSaving|enableSentences|enableSimulation|enableSimulationGlobal|enableStamina|enableStressDamage|enableTeamSwitch|enableTraffic|enableUAVConnectability|enableUAVWaypoints|enableVehicleCargo|enableVehicleSensor|enableWeaponDisassembly|endl|endLoadingScreen|endMission|engineOn|enginesIsOnRTD|enginesPowerRTD|enginesRpmRTD|enginesTorqueRTD|entities|environmentEnabled|estimatedEndServerTime|estimatedTimeLeft|evalObjectArgument|everyBackpack|everyContainer|exec|execEditorScript|exp|expectedDestination|exportJIPMessages|eyeDirection|eyePos|face|faction|fadeMusic|fadeRadio|fadeSound|fadeSpeech|failMission|fillWeaponsFromPool|find|findCover|findDisplay|findEditorObject|findEmptyPosition|findEmptyPositionReady|findIf|findNearestEnemy|finishMissionInit|finite|fire|fireAtTarget|firstBackpack|flag|flagAnimationPhase|flagOwner|flagSide|flagTexture|fleeing|floor|flyInHeight|flyInHeightASL|fog|fogForecast|fogParams|forceAddUniform|forceAtPositionRTD|forcedMap|forceEnd|forceFlagTexture|forceFollowRoad|forceGeneratorRTD|forceMap|forceRespawn|forceSpeed|forceWalk|forceWeaponFire|forceWeatherChange|forgetTarget|format|formation|formationDirection|formationLeader|formationMembers|formationPosition|formationTask|formatText|formLeader|freeLook|fromEditor|fuel|fullCrew|gearIDCAmmoCount|gearSlotAmmoCount|gearSlotData|get3DENActionState|get3DENAttribute|get3DENCamera|get3DENConnections|get3DENEntity|get3DENEntityID|get3DENGrid|get3DENIconsVisible|get3DENLayerEntities|get3DENLinesVisible|get3DENMissionAttribute|get3DENMouseOver|get3DENSelected|getAimingCoef|getAllEnvSoundControllers|getAllHitPointsDamage|getAllOwnedMines|getAllSoundControllers|getAmmoCargo|getAnimAimPrecision|getAnimSpeedCoef|getArray|getArtilleryAmmo|getArtilleryComputerSettings|getArtilleryETA|getAssignedCuratorLogic|getAssignedCuratorUnit|getBackpackCargo|getBleedingRemaining|getBurningValue|getCameraViewDirection|getCargoIndex|getCenterOfMass|getClientState|getClientStateNumber|getCompatiblePylonMagazines|getConnectedUAV|getContainerMaxLoad|getCursorObjectParams|getCustomAimCoef|getDammage|getDescription|getDir|getDirVisual|getDLCAssetsUsage|getDLCAssetsUsageByName|getDLCs|getDLCUsageTime|getEditorCamera|getEditorMode|getEditorObjectScope|getElevationOffset|getEngineTargetRpmRTD|getEnvSoundController|getFatigue|getFieldManualStartPage|getForcedFlagTexture|getFriend|getFSMVariable|getFuelCargo|getGroupIcon|getGroupIconParams|getGroupIcons|getHideFrom|getHit|getHitIndex|getHitPointDamage|getItemCargo|getMagazineCargo|getMarkerColor|getMarkerPos|getMarkerSize|getMarkerType|getMass|getMissionConfig|getMissionConfigValue|getMissionDLCs|getMissionLayerEntities|getMissionLayers|getModelInfo|getMousePosition|getMusicPlayedTime|getNumber|getObjectArgument|getObjectChildren|getObjectDLC|getObjectMaterials|getObjectProxy|getObjectTextures|getObjectType|getObjectViewDistance|getOxygenRemaining|getPersonUsedDLCs|getPilotCameraDirection|getPilotCameraPosition|getPilotCameraRotation|getPilotCameraTarget|getPlateNumber|getPlayerChannel|getPlayerScores|getPlayerUID|getPlayerUIDOld|getPos|getPosASL|getPosASLVisual|getPosASLW|getPosATL|getPosATLVisual|getPosVisual|getPosWorld|getPylonMagazines|getRelDir|getRelPos|getRemoteSensorsDisabled|getRepairCargo|getResolution|getRotorBrakeRTD|getShadowDistance|getShotParents|getSlingLoad|getSoundController|getSoundControllerResult|getSpeed|getStamina|getStatValue|getSuppression|getTerrainGrid|getTerrainHeightASL|getText|getTotalDLCUsageTime|getTrimOffsetRTD|getUnitLoadout|getUnitTrait|getUserMFDText|getUserMFDValue|getVariable|getVehicleCargo|getWeaponCargo|getWeaponSway|getWingsOrientationRTD|getWingsPositionRTD|getWPPos|glanceAt|globalChat|globalRadio|goggles|group|groupChat|groupFromNetId|groupIconSelectable|groupIconsVisible|groupId|groupOwner|groupRadio|groupSelectedUnits|groupSelectUnit|grpNull|gunner|gusts|halt|handgunItems|handgunMagazine|handgunWeapon|handsHit|hasInterface|hasPilotCamera|hasWeapon|hcAllGroups|hcGroupParams|hcLeader|hcRemoveAllGroups|hcRemoveGroup|hcSelected|hcSelectGroup|hcSetGroup|hcShowBar|hcShownBar|headgear|hideBody|hideObject|hideObjectGlobal|hideSelection|hint|hintC|hintCadet|hintSilent|hmd|hostMission|htmlLoad|HUDMovementLevels|humidity|image|importAllGroups|importance|in|inArea|inAreaArray|incapacitatedState|independent|inflame|inflamed|infoPanel|infoPanelComponentEnabled|infoPanelComponents|infoPanels|inGameUISetEventHandler|inheritsFrom|initAmbientLife|inPolygon|inputAction|inRangeOfArtillery|insertEditorObject|intersect|is3DEN|is3DENMultiplayer|isAbleToBreathe|isAgent|isAimPrecisionEnabled|isArray|isAutoHoverOn|isAutonomous|isAutoStartUpEnabledRTD|isAutotest|isAutoTrimOnRTD|isBleeding|isBurning|isClass|isCollisionLightOn|isCopilotEnabled|isDamageAllowed|isDedicated|isDLCAvailable|isEngineOn|isEqualTo|isEqualType|isEqualTypeAll|isEqualTypeAny|isEqualTypeArray|isEqualTypeParams|isFilePatchingEnabled|isFlashlightOn|isFlatEmpty|isForcedWalk|isFormationLeader|isGroupDeletedWhenEmpty|isHidden|isInRemainsCollector|isInstructorFigureEnabled|isIRLaserOn|isKeyActive|isKindOf|isLaserOn|isLightOn|isLocalized|isManualFire|isMarkedForCollection|isMultiplayer|isMultiplayerSolo|isNil|isNull|isNumber|isObjectHidden|isObjectRTD|isOnRoad|isPipEnabled|isPlayer|isRealTime|isRemoteExecuted|isRemoteExecutedJIP|isServer|isShowing3DIcons|isSimpleObject|isSprintAllowed|isStaminaEnabled|isSteamMission|isStreamFriendlyUIEnabled|isStressDamageEnabled|isText|isTouchingGround|isTurnedOut|isTutHintsEnabled|isUAVConnectable|isUAVConnected|isUIContext|isUniformAllowed|isVehicleCargo|isVehicleRadarOn|isVehicleSensorEnabled|isWalking|isWeaponDeployed|isWeaponRested|itemCargo|items|itemsWithMagazines|join|joinAs|joinAsSilent|joinSilent|joinString|kbAddDatabase|kbAddDatabaseTargets|kbAddTopic|kbHasTopic|kbReact|kbRemoveTopic|kbTell|kbWasSaid|keyImage|keyName|knowsAbout|land|landAt|landResult|language|laserTarget|lbAdd|lbClear|lbColor|lbColorRight|lbCurSel|lbData|lbDelete|lbIsSelected|lbPicture|lbPictureRight|lbSelection|lbSetColor|lbSetColorRight|lbSetCurSel|lbSetData|lbSetPicture|lbSetPictureColor|lbSetPictureColorDisabled|lbSetPictureColorSelected|lbSetPictureRight|lbSetPictureRightColor|lbSetPictureRightColorDisabled|lbSetPictureRightColorSelected|lbSetSelectColor|lbSetSelectColorRight|lbSetSelected|lbSetText|lbSetTextRight|lbSetTooltip|lbSetValue|lbSize|lbSort|lbSortByValue|lbText|lbTextRight|lbValue|leader|leaderboardDeInit|leaderboardGetRows|leaderboardInit|leaderboardRequestRowsFriends|leaderboardRequestRowsGlobal|leaderboardRequestRowsGlobalAroundUser|leaderboardsRequestUploadScore|leaderboardsRequestUploadScoreKeepBest|leaderboardState|leaveVehicle|libraryCredits|libraryDisclaimers|lifeState|lightAttachObject|lightDetachObject|lightIsOn|lightnings|limitSpeed|linearConversion|lineBreak|lineIntersects|lineIntersectsObjs|lineIntersectsSurfaces|lineIntersectsWith|linkItem|list|listObjects|listRemoteTargets|listVehicleSensors|ln|lnbAddArray|lnbAddColumn|lnbAddRow|lnbClear|lnbColor|lnbColorRight|lnbCurSelRow|lnbData|lnbDeleteColumn|lnbDeleteRow|lnbGetColumnsPosition|lnbPicture|lnbPictureRight|lnbSetColor|lnbSetColorRight|lnbSetColumnsPos|lnbSetCurSelRow|lnbSetData|lnbSetPicture|lnbSetPictureColor|lnbSetPictureColorRight|lnbSetPictureColorSelected|lnbSetPictureColorSelectedRight|lnbSetPictureRight|lnbSetText|lnbSetTextRight|lnbSetValue|lnbSize|lnbSort|lnbSortByValue|lnbText|lnbTextRight|lnbValue|load|loadAbs|loadBackpack|loadFile|loadGame|loadIdentity|loadMagazine|loadOverlay|loadStatus|loadUniform|loadVest|local|localize|locationNull|locationPosition|lock|lockCameraTo|lockCargo|lockDriver|locked|lockedCargo|lockedDriver|lockedTurret|lockIdentity|lockTurret|lockWP|log|logEntities|logNetwork|logNetworkTerminate|lookAt|lookAtPos|magazineCargo|magazines|magazinesAllTurrets|magazinesAmmo|magazinesAmmoCargo|magazinesAmmoFull|magazinesDetail|magazinesDetailBackpack|magazinesDetailUniform|magazinesDetailVest|magazinesTurret|magazineTurretAmmo|mapAnimAdd|mapAnimClear|mapAnimCommit|mapAnimDone|mapCenterOnCamera|mapGridPosition|markAsFinishedOnSteam|markerAlpha|markerBrush|markerColor|markerDir|markerPos|markerShape|markerSize|markerText|markerType|max|members|menuAction|menuAdd|menuChecked|menuClear|menuCollapse|menuData|menuDelete|menuEnable|menuEnabled|menuExpand|menuHover|menuPicture|menuSetAction|menuSetCheck|menuSetData|menuSetPicture|menuSetValue|menuShortcut|menuShortcutText|menuSize|menuSort|menuText|menuURL|menuValue|min|mineActive|mineDetectedBy|missionConfigFile|missionDifficulty|missionName|missionNamespace|missionStart|missionVersion|modelToWorld|modelToWorldVisual|modelToWorldVisualWorld|modelToWorldWorld|modParams|moonIntensity|moonPhase|morale|move|move3DENCamera|moveInAny|moveInCargo|moveInCommander|moveInDriver|moveInGunner|moveInTurret|moveObjectToEnd|moveOut|moveTime|moveTo|moveToCompleted|moveToFailed|musicVolume|name|nameSound|nearEntities|nearestBuilding|nearestLocation|nearestLocations|nearestLocationWithDubbing|nearestObject|nearestObjects|nearestTerrainObjects|nearObjects|nearObjectsReady|nearRoads|nearSupplies|nearTargets|needReload|netId|netObjNull|newOverlay|nextMenuItemIndex|nextWeatherChange|nMenuItems|numberOfEnginesRTD|numberToDate|objectCurators|objectFromNetId|objectParent|objNull|objStatus|onBriefingGear|onBriefingGroup|onBriefingNotes|onBriefingPlan|onBriefingTeamSwitch|onCommandModeChanged|onDoubleClick|onEachFrame|onGroupIconClick|onGroupIconOverEnter|onGroupIconOverLeave|onHCGroupSelectionChanged|onMapSingleClick|onPlayerConnected|onPlayerDisconnected|onPreloadFinished|onPreloadStarted|onShowNewObject|onTeamSwitch|openCuratorInterface|openDLCPage|openDSInterface|openMap|openSteamApp|openYoutubeVideo|opfor|orderGetIn|overcast|overcastForecast|owner|param|params|parseNumber|parseSimpleArray|parseText|parsingNamespace|particlesQuality|pi|pickWeaponPool|pitch|pixelGrid|pixelGridBase|pixelGridNoUIScale|pixelH|pixelW|playableSlotsNumber|playableUnits|playAction|playActionNow|player|playerRespawnTime|playerSide|playersNumber|playGesture|playMission|playMove|playMoveNow|playMusic|playScriptedMission|playSound|playSound3D|position|positionCameraToWorld|posScreenToWorld|posWorldToScreen|ppEffectAdjust|ppEffectCommit|ppEffectCommitted|ppEffectCreate|ppEffectDestroy|ppEffectEnable|ppEffectEnabled|ppEffectForceInNVG|precision|preloadCamera|preloadObject|preloadSound|preloadTitleObj|preloadTitleRsc|primaryWeapon|primaryWeaponItems|primaryWeaponMagazine|priority|processDiaryLink|processInitCommands|productVersion|profileName|profileNamespace|profileNameSteam|progressLoadingScreen|progressPosition|progressSetPosition|publicVariable|publicVariableClient|publicVariableServer|pushBack|pushBackUnique|putWeaponPool|queryItemsPool|queryMagazinePool|queryWeaponPool|rad|radioChannelAdd|radioChannelCreate|radioChannelRemove|radioChannelSetCallSign|radioChannelSetLabel|radioVolume|rain|rainbow|random|rank|rankId|rating|rectangular|registeredTasks|registerTask|reload|reloadEnabled|remoteControl|remoteExec|remoteExecCall|remoteExecutedOwner|remove3DENConnection|remove3DENEventHandler|remove3DENLayer|removeAction|removeAll3DENEventHandlers|removeAllActions|removeAllAssignedItems|removeAllContainers|removeAllCuratorAddons|removeAllCuratorCameraAreas|removeAllCuratorEditingAreas|removeAllEventHandlers|removeAllHandgunItems|removeAllItems|removeAllItemsWithMagazines|removeAllMissionEventHandlers|removeAllMPEventHandlers|removeAllMusicEventHandlers|removeAllOwnedMines|removeAllPrimaryWeaponItems|removeAllWeapons|removeBackpack|removeBackpackGlobal|removeCuratorAddons|removeCuratorCameraArea|removeCuratorEditableObjects|removeCuratorEditingArea|removeDrawIcon|removeDrawLinks|removeEventHandler|removeFromRemainsCollector|removeGoggles|removeGroupIcon|removeHandgunItem|removeHeadgear|removeItem|removeItemFromBackpack|removeItemFromUniform|removeItemFromVest|removeItems|removeMagazine|removeMagazineGlobal|removeMagazines|removeMagazinesTurret|removeMagazineTurret|removeMenuItem|removeMissionEventHandler|removeMPEventHandler|removeMusicEventHandler|removeOwnedMine|removePrimaryWeaponItem|removeSecondaryWeaponItem|removeSimpleTask|removeSwitchableUnit|removeTeamMember|removeUniform|removeVest|removeWeapon|removeWeaponAttachmentCargo|removeWeaponCargo|removeWeaponGlobal|removeWeaponTurret|reportRemoteTarget|requiredVersion|resetCamShake|resetSubgroupDirection|resistance|resize|resources|respawnVehicle|restartEditorCamera|reveal|revealMine|reverse|reversedMouseY|roadAt|roadsConnectedTo|roleDescription|ropeAttachedObjects|ropeAttachedTo|ropeAttachEnabled|ropeAttachTo|ropeCreate|ropeCut|ropeDestroy|ropeDetach|ropeEndPosition|ropeLength|ropes|ropeUnwind|ropeUnwound|rotorsForcesRTD|rotorsRpmRTD|round|runInitScript|safeZoneH|safeZoneW|safeZoneWAbs|safeZoneX|safeZoneXAbs|safeZoneY|save3DENInventory|saveGame|saveIdentity|saveJoysticks|saveOverlay|saveProfileNamespace|saveStatus|saveVar|savingEnabled|say|say2D|say3D|score|scoreSide|screenshot|screenToWorld|scriptDone|scriptName|scriptNull|scudState|secondaryWeapon|secondaryWeaponItems|secondaryWeaponMagazine|select|selectBestPlaces|selectDiarySubject|selectedEditorObjects|selectEditorObject|selectionNames|selectionPosition|selectLeader|selectMax|selectMin|selectNoPlayer|selectPlayer|selectRandom|selectRandomWeighted|selectWeapon|selectWeaponTurret|sendAUMessage|sendSimpleCommand|sendTask|sendTaskResult|sendUDPMessage|serverCommand|serverCommandAvailable|serverCommandExecutable|serverName|serverTime|set|set3DENAttribute|set3DENAttributes|set3DENGrid|set3DENIconsVisible|set3DENLayer|set3DENLinesVisible|set3DENLogicType|set3DENMissionAttribute|set3DENMissionAttributes|set3DENModelsVisible|set3DENObjectType|set3DENSelected|setAccTime|setActualCollectiveRTD|setAirplaneThrottle|setAirportSide|setAmmo|setAmmoCargo|setAmmoOnPylon|setAnimSpeedCoef|setAperture|setApertureNew|setArmoryPoints|setAttributes|setAutonomous|setBehaviour|setBleedingRemaining|setBrakesRTD|setCameraInterest|setCamShakeDefParams|setCamShakeParams|setCamUseTI|setCaptive|setCenterOfMass|setCollisionLight|setCombatMode|setCompassOscillation|setConvoySeparation|setCuratorCameraAreaCeiling|setCuratorCoef|setCuratorEditingAreaType|setCuratorWaypointCost|setCurrentChannel|setCurrentTask|setCurrentWaypoint|setCustomAimCoef|setCustomWeightRTD|setDamage|setDammage|setDate|setDebriefingText|setDefaultCamera|setDestination|setDetailMapBlendPars|setDir|setDirection|setDrawIcon|setDriveOnPath|setDropInterval|setDynamicSimulationDistance|setDynamicSimulationDistanceCoef|setEditorMode|setEditorObjectScope|setEffectCondition|setEngineRpmRTD|setFace|setFaceAnimation|setFatigue|setFeatureType|setFlagAnimationPhase|setFlagOwner|setFlagSide|setFlagTexture|setFog|setForceGeneratorRTD|setFormation|setFormationTask|setFormDir|setFriend|setFromEditor|setFSMVariable|setFuel|setFuelCargo|setGroupIcon|setGroupIconParams|setGroupIconsSelectable|setGroupIconsVisible|setGroupId|setGroupIdGlobal|setGroupOwner|setGusts|setHideBehind|setHit|setHitIndex|setHitPointDamage|setHorizonParallaxCoef|setHUDMovementLevels|setIdentity|setImportance|setInfoPanel|setLeader|setLightAmbient|setLightAttenuation|setLightBrightness|setLightColor|setLightDayLight|setLightFlareMaxDistance|setLightFlareSize|setLightIntensity|setLightnings|setLightUseFlare|setLocalWindParams|setMagazineTurretAmmo|setMarkerAlpha|setMarkerAlphaLocal|setMarkerBrush|setMarkerBrushLocal|setMarkerColor|setMarkerColorLocal|setMarkerDir|setMarkerDirLocal|setMarkerPos|setMarkerPosLocal|setMarkerShape|setMarkerShapeLocal|setMarkerSize|setMarkerSizeLocal|setMarkerText|setMarkerTextLocal|setMarkerType|setMarkerTypeLocal|setMass|setMimic|setMousePosition|setMusicEffect|setMusicEventHandler|setName|setNameSound|setObjectArguments|setObjectMaterial|setObjectMaterialGlobal|setObjectProxy|setObjectTexture|setObjectTextureGlobal|setObjectViewDistance|setOvercast|setOwner|setOxygenRemaining|setParticleCircle|setParticleClass|setParticleFire|setParticleParams|setParticleRandom|setPilotCameraDirection|setPilotCameraRotation|setPilotCameraTarget|setPilotLight|setPiPEffect|setPitch|setPlateNumber|setPlayable|setPlayerRespawnTime|setPos|setPosASL|setPosASL2|setPosASLW|setPosATL|setPosition|setPosWorld|setPylonLoadOut|setPylonsPriority|setRadioMsg|setRain|setRainbow|setRandomLip|setRank|setRectangular|setRepairCargo|setRotorBrakeRTD|setShadowDistance|setShotParents|setSide|setSimpleTaskAlwaysVisible|setSimpleTaskCustomData|setSimpleTaskDescription|setSimpleTaskDestination|setSimpleTaskTarget|setSimpleTaskType|setSimulWeatherLayers|setSize|setSkill|setSlingLoad|setSoundEffect|setSpeaker|setSpeech|setSpeedMode|setStamina|setStaminaScheme|setStatValue|setSuppression|setSystemOfUnits|setTargetAge|setTaskMarkerOffset|setTaskResult|setTaskState|setTerrainGrid|setText|setTimeMultiplier|setTitleEffect|setToneMapping|setToneMappingParams|setTrafficDensity|setTrafficDistance|setTrafficGap|setTrafficSpeed|setTriggerActivation|setTriggerArea|setTriggerStatements|setTriggerText|setTriggerTimeout|setTriggerType|setType|setUnconscious|setUnitAbility|setUnitLoadout|setUnitPos|setUnitPosWeak|setUnitRank|setUnitRecoilCoefficient|setUnitTrait|setUnloadInCombat|setUserActionText|setUserMFDText|setUserMFDValue|setVariable|setVectorDir|setVectorDirAndUp|setVectorUp|setVehicleAmmo|setVehicleAmmoDef|setVehicleArmor|setVehicleCargo|setVehicleId|setVehicleInit|setVehicleLock|setVehiclePosition|setVehicleRadar|setVehicleReceiveRemoteTargets|setVehicleReportOwnPosition|setVehicleReportRemoteTargets|setVehicleTIPars|setVehicleVarName|setVelocity|setVelocityModelSpace|setVelocityTransformation|setViewDistance|setVisibleIfTreeCollapsed|setWantedRpmRTD|setWaves|setWaypointBehaviour|setWaypointCombatMode|setWaypointCompletionRadius|setWaypointDescription|setWaypointForceBehaviour|setWaypointFormation|setWaypointHousePosition|setWaypointLoiterRadius|setWaypointLoiterType|setWaypointName|setWaypointPosition|setWaypointScript|setWaypointSpeed|setWaypointStatements|setWaypointTimeout|setWaypointType|setWaypointVisible|setWeaponReloadingTime|setWind|setWindDir|setWindForce|setWindStr|setWingForceScaleRTD|setWPPos|show3DIcons|showChat|showCinemaBorder|showCommandingMenu|showCompass|showCuratorCompass|showGPS|showHUD|showLegend|showMap|shownArtilleryComputer|shownChat|shownCompass|shownCuratorCompass|showNewEditorObject|shownGPS|shownHUD|shownMap|shownPad|shownRadio|shownScoretable|shownUAVFeed|shownWarrant|shownWatch|showPad|showRadio|showScoretable|showSubtitles|showUAVFeed|showWarrant|showWatch|showWaypoint|showWaypoints|side|sideAmbientLife|sideChat|sideEmpty|sideEnemy|sideFriendly|sideLogic|sideRadio|sideUnknown|simpleTasks|simulationEnabled|simulCloudDensity|simulCloudOcclusion|simulInClouds|simulWeatherSync|sin|size|sizeOf|skill|skillFinal|skipTime|sleep|sliderPosition|sliderRange|sliderSetPosition|sliderSetRange|sliderSetSpeed|sliderSpeed|slingLoadAssistantShown|soldierMagazines|someAmmo|sort|soundVolume|speaker|speed|speedMode|splitString|sqrt|squadParams|stance|startLoadingScreen|stop|stopEngineRTD|stopped|str|sunOrMoon|supportInfo|suppressFor|surfaceIsWater|surfaceNormal|surfaceType|swimInDepth|switchableUnits|switchAction|switchCamera|switchGesture|switchLight|switchMove|synchronizedObjects|synchronizedTriggers|synchronizedWaypoints|synchronizeObjectsAdd|synchronizeObjectsRemove|synchronizeTrigger|synchronizeWaypoint|systemChat|systemOfUnits|tan|targetKnowledge|targets|targetsAggregate|targetsQuery|taskAlwaysVisible|taskChildren|taskCompleted|taskCustomData|taskDescription|taskDestination|taskHint|taskMarkerOffset|taskNull|taskParent|taskResult|taskState|taskType|teamMember|teamMemberNull|teamName|teams|teamSwitch|teamSwitchEnabled|teamType|terminate|terrainIntersect|terrainIntersectASL|terrainIntersectAtASL|text|textLog|textLogFormat|tg|time|timeMultiplier|titleCut|titleFadeOut|titleObj|titleRsc|titleText|toArray|toFixed|toLower|toString|toUpper|triggerActivated|triggerActivation|triggerArea|triggerAttachedVehicle|triggerAttachObject|triggerAttachVehicle|triggerDynamicSimulation|triggerStatements|triggerText|triggerTimeout|triggerTimeoutCurrent|triggerType|turretLocal|turretOwner|turretUnit|tvAdd|tvClear|tvCollapse|tvCollapseAll|tvCount|tvCurSel|tvData|tvDelete|tvExpand|tvExpandAll|tvPicture|tvPictureRight|tvSetColor|tvSetCurSel|tvSetData|tvSetPicture|tvSetPictureColor|tvSetPictureColorDisabled|tvSetPictureColorSelected|tvSetPictureRight|tvSetPictureRightColor|tvSetPictureRightColorDisabled|tvSetPictureRightColorSelected|tvSetSelectColor|tvSetText|tvSetTooltip|tvSetValue|tvSort|tvSortByValue|tvText|tvTooltip|tvValue|type|typeName|typeOf|UAVControl|uiNamespace|uiSleep|unassignCurator|unassignItem|unassignTeam|unassignVehicle|underwater|uniform|uniformContainer|uniformItems|uniformMagazines|unitAddons|unitAimPosition|unitAimPositionVisual|unitBackpack|unitIsUAV|unitPos|unitReady|unitRecoilCoefficient|units|unitsBelowHeight|unlinkItem|unlockAchievement|unregisterTask|updateDrawIcon|updateMenuItem|updateObjectTree|useAIOperMapObstructionTest|useAISteeringComponent|useAudioTimeForMoves|userInputDisabled|vectorAdd|vectorCos|vectorCrossProduct|vectorDiff|vectorDir|vectorDirVisual|vectorDistance|vectorDistanceSqr|vectorDotProduct|vectorFromTo|vectorMagnitude|vectorMagnitudeSqr|vectorModelToWorld|vectorModelToWorldVisual|vectorMultiply|vectorNormalized|vectorUp|vectorUpVisual|vectorWorldToModel|vectorWorldToModelVisual|vehicle|vehicleCargoEnabled|vehicleChat|vehicleRadio|vehicleReceiveRemoteTargets|vehicleReportOwnPosition|vehicleReportRemoteTargets|vehicles|vehicleVarName|velocity|velocityModelSpace|verifySignature|vest|vestContainer|vestItems|vestMagazines|viewDistance|visibleCompass|visibleGPS|visibleMap|visiblePosition|visiblePositionASL|visibleScoretable|visibleWatch|waitUntil|waves|waypointAttachedObject|waypointAttachedVehicle|waypointAttachObject|waypointAttachVehicle|waypointBehaviour|waypointCombatMode|waypointCompletionRadius|waypointDescription|waypointForceBehaviour|waypointFormation|waypointHousePosition|waypointLoiterRadius|waypointLoiterType|waypointName|waypointPosition|waypoints|waypointScript|waypointsEnabledUAV|waypointShow|waypointSpeed|waypointStatements|waypointTimeout|waypointTimeoutCurrent|waypointType|waypointVisible|weaponAccessories|weaponAccessoriesCargo|weaponCargo|weaponDirection|weaponInertia|weaponLowered|weapons|weaponsItems|weaponsItemsCargo|weaponState|weaponsTurret|weightRTD|west|WFSideText|wind|windDir|windRTD|windStr|wingsForcesRTD|worldName|worldSize|worldToModel|worldToModelVisual|worldToScreen)\b/i,number:/(?:\$|\b0x)[\da-f]+\b|(?:\B\.\d+|\b\d+(?:\.\d+)?)(?:e[+-]?\d+)?\b/i,operator:/##|>>|&&|\|\||[!=<>]=?|[-+*/%#^]|\b(?:and|mod|not|or)\b/i,"magic-variable":{pattern:/\b(?:_exception|_fnc_scriptName|_fnc_scriptNameParent|_forEachIndex|_this|_thisEventHandler|_thisFSM|_thisScript|_x|this|thisList|thisTrigger)\b/i,alias:"keyword"},constant:/\bDIK(?:_[a-z\d]+)+\b/i}),e.languages.insertBefore("sqf","string",{macro:{pattern:/(^[ \t]*)#[a-z](?:[^\r\n\\]|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{directive:{pattern:/#[a-z]+\b/i,alias:"keyword"},comment:e.languages.sqf.comment}}}),delete e.languages.sqf["class-name"]}e.exports=t,t.displayName="sqf",t.aliases=[]},11114(e){"use strict";function t(e){e.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:_INSERT|COL)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:S|ING)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:TRUE|FALSE|NULL)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|IN|ILIKE|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/}}e.exports=t,t.displayName="sql",t.aliases=[]},67386(e){"use strict";function t(e){e.languages.squirrel=e.languages.extend("clike",{comment:[e.languages.clike.comment[0],{pattern:/(^|[^\\:])(?:\/\/|#).*/,lookbehind:!0,greedy:!0}],string:[{pattern:/(^|[^\\"'@])(?:@"(?:[^"]|"")*"(?!")|"(?:[^\\\r\n"]|\\.)*")/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\"'])'(?:[^\\']|\\(?:[xuU][0-9a-fA-F]{0,8}|[\s\S]))'/,lookbehind:!0,greedy:!0}],"class-name":{pattern:/(\b(?:class|enum|extends|instanceof)\s+)\w+(?:\.\w+)*/,lookbehind:!0,inside:{punctuation:/\./}},keyword:/\b(?:base|break|case|catch|class|clone|const|constructor|continue|default|delete|else|enum|extends|for|foreach|function|if|in|instanceof|local|null|resume|return|static|switch|this|throw|try|typeof|while|yield|__LINE__|__FILE__)\b/,number:/\b(?:0x[0-9a-fA-F]+|\d+(?:\.(?:\d+|[eE][+-]?\d+))?)\b/,operator:/\+\+|--|<=>|<[-<]|>>>?|&&?|\|\|?|[-+*/%!=<>]=?|[~^]|::?/,punctuation:/[(){}\[\],;.]/}),e.languages.insertBefore("squirrel","operator",{"attribute-punctuation":{pattern:/<\/|\/>/,alias:"important"},lambda:{pattern:/@(?=\()/,alias:"operator"}})}e.exports=t,t.displayName="squirrel",t.aliases=[]},28067(e){"use strict";function t(e){e.languages.stan={comment:/\/\/.*|\/\*[\s\S]*?\*\/|#(?!include).*/,string:{pattern:/"[\x20\x21\x23-\x5B\x5D-\x7E]*"/,greedy:!0},directive:{pattern:/^([ \t]*)#include\b.*/m,lookbehind:!0,alias:"property"},"function-arg":{pattern:/(\b(?:algebra_solver|integrate_1d|integrate_ode|integrate_ode_bdf|integrate_ode_rk45|map_rect)\s*\(\s*)[a-zA-Z]\w*/,lookbehind:!0,alias:"function"},constraint:{pattern:/(\b(?:int|matrix|real|row_vector|vector)\s*)<[^<>]*>/,lookbehind:!0,inside:{expression:{pattern:/(=\s*)\S(?:\S|\s+(?!\s))*?(?=\s*(?:>$|,\s*\w+\s*=))/,lookbehind:!0,inside:null},property:/\b[a-z]\w*(?=\s*=)/i,operator:/=/,punctuation:/^<|>$|,/}},keyword:[/\b(?:break|cholesky_factor_corr|cholesky_factor_cov|continue|corr_matrix|cov_matrix|data|else|for|functions|generated|if|in|increment_log_prob|int|matrix|model|ordered|parameters|positive_ordered|print|quantities|real|reject|return|row_vector|simplex|target|transformed|unit_vector|vector|void|while)\b/,/\b(?:algebra_solver|integrate_1d|integrate_ode|integrate_ode_bdf|integrate_ode_rk45|map_rect)\b/],function:/\b[a-z]\w*(?=\s*\()/i,number:/(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:E[+-]?\d+)?\b/i,boolean:/\b(?:false|true)\b/,operator:/<-|\.[*/]=?|\|\|?|&&|[!=<>+\-*/]=?|['^%~?:]/,punctuation:/[()\[\]{},;]/},e.languages.stan.constraint.inside.expression.inside=e.languages.stan}e.exports=t,t.displayName="stan",t.aliases=[]},49168(e){"use strict";function t(e){var t,n,r,i;t=e,(i={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,lookbehind:!0},url:{pattern:/\burl\((["']?).*?\1\)/i,greedy:!0},string:{pattern:/("|')(?:(?!\1)[^\\\r\n]|\\(?:\r\n|[\s\S]))*\1/,greedy:!0},interpolation:null,func:null,important:/\B!(?:important|optional)\b/i,keyword:{pattern:/(^|\s+)(?:(?:if|else|for|return|unless)(?=\s|$)|@[\w-]+)/,lookbehind:!0},hexcode:/#[\da-f]{3,6}/i,color:[/\b(?:AliceBlue|AntiqueWhite|Aqua|Aquamarine|Azure|Beige|Bisque|Black|BlanchedAlmond|Blue|BlueViolet|Brown|BurlyWood|CadetBlue|Chartreuse|Chocolate|Coral|CornflowerBlue|Cornsilk|Crimson|Cyan|DarkBlue|DarkCyan|DarkGoldenRod|DarkGr[ae]y|DarkGreen|DarkKhaki|DarkMagenta|DarkOliveGreen|DarkOrange|DarkOrchid|DarkRed|DarkSalmon|DarkSeaGreen|DarkSlateBlue|DarkSlateGr[ae]y|DarkTurquoise|DarkViolet|DeepPink|DeepSkyBlue|DimGr[ae]y|DodgerBlue|FireBrick|FloralWhite|ForestGreen|Fuchsia|Gainsboro|GhostWhite|Gold|GoldenRod|Gr[ae]y|Green|GreenYellow|HoneyDew|HotPink|IndianRed|Indigo|Ivory|Khaki|Lavender|LavenderBlush|LawnGreen|LemonChiffon|LightBlue|LightCoral|LightCyan|LightGoldenRodYellow|LightGr[ae]y|LightGreen|LightPink|LightSalmon|LightSeaGreen|LightSkyBlue|LightSlateGr[ae]y|LightSteelBlue|LightYellow|Lime|LimeGreen|Linen|Magenta|Maroon|MediumAquaMarine|MediumBlue|MediumOrchid|MediumPurple|MediumSeaGreen|MediumSlateBlue|MediumSpringGreen|MediumTurquoise|MediumVioletRed|MidnightBlue|MintCream|MistyRose|Moccasin|NavajoWhite|Navy|OldLace|Olive|OliveDrab|Orange|OrangeRed|Orchid|PaleGoldenRod|PaleGreen|PaleTurquoise|PaleVioletRed|PapayaWhip|PeachPuff|Peru|Pink|Plum|PowderBlue|Purple|Red|RosyBrown|RoyalBlue|SaddleBrown|Salmon|SandyBrown|SeaGreen|SeaShell|Sienna|Silver|SkyBlue|SlateBlue|SlateGr[ae]y|Snow|SpringGreen|SteelBlue|Tan|Teal|Thistle|Tomato|Transparent|Turquoise|Violet|Wheat|White|WhiteSmoke|Yellow|YellowGreen)\b/i,{pattern:/\b(?:rgb|hsl)\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*\)\B|\b(?:rgb|hsl)a\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*,\s*(?:0|0?\.\d+|1)\s*\)\B/i,inside:{unit:n={pattern:/(\b\d+)(?:%|[a-z]+)/,lookbehind:!0},number:r={pattern:/(^|[^\w.-])-?(?:\d+(?:\.\d+)?|\.\d+)/,lookbehind:!0},function:/[\w-]+(?=\()/,punctuation:/[(),]/}}],entity:/\\[\da-f]{1,8}/i,unit:n,boolean:/\b(?:true|false)\b/,operator:[/~|[+!\/%<>?=]=?|[-:]=|\*[*=]?|\.{2,3}|&&|\|\||\B-\B|\b(?:and|in|is(?: a| defined| not|nt)?|not|or)\b/],number:r,punctuation:/[{}()\[\];:,]/}).interpolation={pattern:/\{[^\r\n}:]+\}/,alias:"variable",inside:{delimiter:{pattern:/^\{|\}$/,alias:"punctuation"},rest:i}},i.func={pattern:/[\w-]+\([^)]*\).*/,inside:{function:/^[^(]+/,rest:i}},t.languages.stylus={"atrule-declaration":{pattern:/(^[ \t]*)@.+/m,lookbehind:!0,inside:{atrule:/^@[\w-]+/,rest:i}},"variable-declaration":{pattern:/(^[ \t]*)[\w$-]+\s*.?=[ \t]*(?:\{[^{}]*\}|\S.*|$)/m,lookbehind:!0,inside:{variable:/^\S+/,rest:i}},statement:{pattern:/(^[ \t]*)(?:if|else|for|return|unless)[ \t].+/m,lookbehind:!0,inside:{keyword:/^\S+/,rest:i}},"property-declaration":{pattern:/((?:^|\{)([ \t]*))(?:[\w-]|\{[^}\r\n]+\})+(?:\s*:\s*|[ \t]+)(?!\s)[^{\r\n]*(?:;|[^{\r\n,]$(?!(?:\r?\n|\r)(?:\{|\2[ \t])))/m,lookbehind:!0,inside:{property:{pattern:/^[^\s:]+/,inside:{interpolation:i.interpolation}},rest:i}},selector:{pattern:/(^[ \t]*)(?:(?=\S)(?:[^{}\r\n:()]|::?[\w-]+(?:\([^)\r\n]*\)|(?![\w-]))|\{[^}\r\n]+\})+)(?:(?:\r?\n|\r)(?:\1(?:(?=\S)(?:[^{}\r\n:()]|::?[\w-]+(?:\([^)\r\n]*\)|(?![\w-]))|\{[^}\r\n]+\})+)))*(?:,$|\{|(?=(?:\r?\n|\r)(?:\{|\1[ \t])))/m,lookbehind:!0,inside:{interpolation:i.interpolation,comment:i.comment,punctuation:/[{},]/}},func:i.func,string:i.string,comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,lookbehind:!0,greedy:!0},interpolation:i.interpolation,punctuation:/[{}()\[\];:.]/}}e.exports=t,t.displayName="stylus",t.aliases=[]},23651(e){"use strict";function t(e){e.languages.swift=e.languages.extend("clike",{string:{pattern:/("|')(?:\\(?:\((?:[^()]|\([^)]+\))+\)|\r\n|[^(])|(?!\1)[^\\\r\n])*\1/,greedy:!0,inside:{interpolation:{pattern:/\\\((?:[^()]|\([^)]+\))+\)/,inside:{delimiter:{pattern:/^\\\(|\)$/,alias:"variable"}}}}},keyword:/\b(?:as|associativity|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic(?:Type)?|else|enum|extension|fallthrough|final|for|func|get|guard|if|import|in|infix|init|inout|internal|is|lazy|left|let|mutating|new|none|nonmutating|operator|optional|override|postfix|precedence|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|Self|set|some|static|struct|subscript|super|switch|throws?|try|Type|typealias|unowned|unsafe|var|weak|where|while|willSet|__(?:COLUMN__|FILE__|FUNCTION__|LINE__))\b/,number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,constant:/\b(?:nil|[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,atrule:/@\b(?:IB(?:Outlet|Designable|Action|Inspectable)|class_protocol|exported|noreturn|NS(?:Copying|Managed)|objc|UIApplicationMain|auto_closure)\b/,builtin:/\b(?:[A-Z]\S+|abs|advance|alignof(?:Value)?|assert|contains|count(?:Elements)?|debugPrint(?:ln)?|distance|drop(?:First|Last)|dump|enumerate|equal|filter|find|first|getVaList|indices|isEmpty|join|last|lexicographicalCompare|map|max(?:Element)?|min(?:Element)?|numericCast|overlaps|partition|print(?:ln)?|reduce|reflect|reverse|sizeof(?:Value)?|sort(?:ed)?|split|startsWith|stride(?:of(?:Value)?)?|suffix|swap|toDebugString|toString|transcode|underestimateCount|unsafeBitCast|with(?:ExtendedLifetime|Unsafe(?:MutablePointers?|Pointers?)|VaList))\b/}),e.languages.swift.string.inside.interpolation.inside.rest=e.languages.swift}e.exports=t,t.displayName="swift",t.aliases=[]},32268(e,t,n){"use strict";var r=n(2329),i=n(61958);function a(e){e.register(r),e.register(i),e.languages.t4=e.languages["t4-cs"]=e.languages["t4-templating"].createT4("csharp")}e.exports=a,a.displayName="t4Cs",a.aliases=[]},2329(e){"use strict";function t(e){!function(e){function t(e,t,n){return{pattern:RegExp("<#"+e+"[\\s\\S]*?#>"),alias:"block",inside:{delimiter:{pattern:RegExp("^<#"+e+"|#>$"),alias:"important"},content:{pattern:/[\s\S]+/,inside:t,alias:n}}}}function n(n){var r=e.languages[n],i="language-"+n;return{block:{pattern:/<#[\s\S]+?#>/,inside:{directive:t("@",{"attr-value":{pattern:/=(?:("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|[^\s'">=]+)/,inside:{punctuation:/^=|^["']|["']$/}},keyword:/\b\w+(?=\s)/,"attr-name":/\b\w+/}),expression:t("=",r,i),"class-feature":t("\\+",r,i),standard:t("",r,i)}}}}e.languages["t4-templating"]=Object.defineProperty({},"createT4",{value:n})}(e)}e.exports=t,t.displayName="t4Templating",t.aliases=[]},82996(e,t,n){"use strict";var r=n(2329),i=n(53813);function a(e){e.register(r),e.register(i),e.languages["t4-vb"]=e.languages["t4-templating"].createT4("vbnet")}e.exports=a,a.displayName="t4Vb",a.aliases=[]},17290(e,t,n){"use strict";var r=n(65039);function i(e){e.register(r),e.languages.tap={fail:/not ok[^#{\n\r]*/,pass:/ok[^#{\n\r]*/,pragma:/pragma [+-][a-z]+/,bailout:/bail out!.*/i,version:/TAP version \d+/i,plan:/\b\d+\.\.\d+(?: +#.*)?/,subtest:{pattern:/# Subtest(?:: .*)?/,greedy:!0},punctuation:/[{}]/,directive:/#.*/,yamlish:{pattern:/(^[ \t]*)---[\s\S]*?[\r\n][ \t]*\.\.\.$/m,lookbehind:!0,inside:e.languages.yaml,alias:"language-yaml"}}}e.exports=i,i.displayName="tap",i.aliases=[]},67989(e){"use strict";function t(e){e.languages.tcl={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0},string:{pattern:/"(?:[^"\\\r\n]|\\(?:\r\n|[\s\S]))*"/,greedy:!0},variable:[{pattern:/(\$)(?:::)?(?:[a-zA-Z0-9]+::)*\w+/,lookbehind:!0},{pattern:/(\$)\{[^}]+\}/,lookbehind:!0},{pattern:/(^[\t ]*set[ \t]+)(?:::)?(?:[a-zA-Z0-9]+::)*\w+/m,lookbehind:!0}],function:{pattern:/(^[\t ]*proc[ \t]+)\S+/m,lookbehind:!0},builtin:[{pattern:/(^[\t ]*)(?:proc|return|class|error|eval|exit|for|foreach|if|switch|while|break|continue)\b/m,lookbehind:!0},/\b(?:elseif|else)\b/],scope:{pattern:/(^[\t ]*)(?:global|upvar|variable)\b/m,lookbehind:!0,alias:"constant"},keyword:{pattern:/(^[\t ]*|\[)(?:after|append|apply|array|auto_(?:execok|import|load|mkindex|qualify|reset)|automkindex_old|bgerror|binary|catch|cd|chan|clock|close|concat|dde|dict|encoding|eof|exec|expr|fblocked|fconfigure|fcopy|file(?:event|name)?|flush|gets|glob|history|http|incr|info|interp|join|lappend|lassign|lindex|linsert|list|llength|load|lrange|lrepeat|lreplace|lreverse|lsearch|lset|lsort|math(?:func|op)|memory|msgcat|namespace|open|package|parray|pid|pkg_mkIndex|platform|puts|pwd|re_syntax|read|refchan|regexp|registry|regsub|rename|Safe_Base|scan|seek|set|socket|source|split|string|subst|Tcl|tcl(?:_endOfWord|_findLibrary|startOf(?:Next|Previous)Word|wordBreak(?:After|Before)|test|vars)|tell|time|tm|trace|unknown|unload|unset|update|uplevel|vwait)\b/m,lookbehind:!0},operator:/!=?|\*\*?|==|&&?|\|\|?|<[=<]?|>[=>]?|[-+~\/%?^]|\b(?:eq|ne|in|ni)\b/,punctuation:/[{}()\[\]]/}}e.exports=t,t.displayName="tcl",t.aliases=[]},31065(e){"use strict";function t(e){!function(e){var t=/\([^|()\n]+\)|\[[^\]\n]+\]|\{[^}\n]+\}/.source,n=/\)|\((?![^|()\n]+\))/.source;function r(e,r){return RegExp(e.replace(//g,function(){return"(?:"+t+")"}).replace(//g,function(){return"(?:"+n+")"}),r||"")}var i={css:{pattern:/\{[^{}]+\}/,inside:{rest:e.languages.css}},"class-id":{pattern:/(\()[^()]+(?=\))/,lookbehind:!0,alias:"attr-value"},lang:{pattern:/(\[)[^\[\]]+(?=\])/,lookbehind:!0,alias:"attr-value"},punctuation:/[\\\/]\d+|\S/},a=e.languages.textile=e.languages.extend("markup",{phrase:{pattern:/(^|\r|\n)\S[\s\S]*?(?=$|\r?\n\r?\n|\r\r)/,lookbehind:!0,inside:{"block-tag":{pattern:r(/^[a-z]\w*(?:||[<>=])*\./.source),inside:{modifier:{pattern:r(/(^[a-z]\w*)(?:||[<>=])+(?=\.)/.source),lookbehind:!0,inside:i},tag:/^[a-z]\w*/,punctuation:/\.$/}},list:{pattern:r(/^[*#]+*\s+\S.*/.source,"m"),inside:{modifier:{pattern:r(/(^[*#]+)+/.source),lookbehind:!0,inside:i},punctuation:/^[*#]+/}},table:{pattern:r(/^(?:(?:||[<>=^~])+\.\s*)?(?:\|(?:(?:||[<>=^~_]|[\\/]\d+)+\.|(?!(?:||[<>=^~_]|[\\/]\d+)+\.))[^|]*)+\|/.source,"m"),inside:{modifier:{pattern:r(/(^|\|(?:\r?\n|\r)?)(?:||[<>=^~_]|[\\/]\d+)+(?=\.)/.source),lookbehind:!0,inside:i},punctuation:/\||^\./}},inline:{pattern:r(/(^|[^a-zA-Z\d])(\*\*|__|\?\?|[*_%@+\-^~])*.+?\2(?![a-zA-Z\d])/.source),lookbehind:!0,inside:{bold:{pattern:r(/(^(\*\*?)*).+?(?=\2)/.source),lookbehind:!0},italic:{pattern:r(/(^(__?)*).+?(?=\2)/.source),lookbehind:!0},cite:{pattern:r(/(^\?\?*).+?(?=\?\?)/.source),lookbehind:!0,alias:"string"},code:{pattern:r(/(^@*).+?(?=@)/.source),lookbehind:!0,alias:"keyword"},inserted:{pattern:r(/(^\+*).+?(?=\+)/.source),lookbehind:!0},deleted:{pattern:r(/(^-*).+?(?=-)/.source),lookbehind:!0},span:{pattern:r(/(^%*).+?(?=%)/.source),lookbehind:!0},modifier:{pattern:r(/(^\*\*|__|\?\?|[*_%@+\-^~])+/.source),lookbehind:!0,inside:i},punctuation:/[*_%?@+\-^~]+/}},"link-ref":{pattern:/^\[[^\]]+\]\S+$/m,inside:{string:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0},url:{pattern:/(^\])\S+$/,lookbehind:!0},punctuation:/[\[\]]/}},link:{pattern:r(/"*[^"]+":.+?(?=[^\w/]?(?:\s|$))/.source),inside:{text:{pattern:r(/(^"*)[^"]+(?=")/.source),lookbehind:!0},modifier:{pattern:r(/(^")+/.source),lookbehind:!0,inside:i},url:{pattern:/(:).+/,lookbehind:!0},punctuation:/[":]/}},image:{pattern:r(/!(?:||[<>=])*(?![<>=])[^!\s()]+(?:\([^)]+\))?!(?::.+?(?=[^\w/]?(?:\s|$)))?/.source),inside:{source:{pattern:r(/(^!(?:||[<>=])*)(?![<>=])[^!\s()]+(?:\([^)]+\))?(?=!)/.source),lookbehind:!0,alias:"url"},modifier:{pattern:r(/(^!)(?:||[<>=])+/.source),lookbehind:!0,inside:i},url:{pattern:/(:).+/,lookbehind:!0},punctuation:/[!:]/}},footnote:{pattern:/\b\[\d+\]/,alias:"comment",inside:{punctuation:/\[|\]/}},acronym:{pattern:/\b[A-Z\d]+\([^)]+\)/,inside:{comment:{pattern:/(\()[^()]+(?=\))/,lookbehind:!0},punctuation:/[()]/}},mark:{pattern:/\b\((?:TM|R|C)\)/,alias:"comment",inside:{punctuation:/[()]/}}}}}),o=a.phrase.inside,s={inline:o.inline,link:o.link,image:o.image,footnote:o.footnote,acronym:o.acronym,mark:o.mark};a.tag.pattern=/<\/?(?!\d)[a-z0-9]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|[^\s'">=]+))?)*\s*\/?>/i;var u=o.inline.inside;u.bold.inside=s,u.italic.inside=s,u.inserted.inside=s,u.deleted.inside=s,u.span.inside=s;var c=o.table.inside;c.inline=s.inline,c.link=s.link,c.image=s.image,c.footnote=s.footnote,c.acronym=s.acronym,c.mark=s.mark}(e)}e.exports=t,t.displayName="textile",t.aliases=[]},85572(e){"use strict";function t(e){!function(e){var t=/(?:[\w-]+|'[^'\n\r]*'|"(?:\\.|[^\\"\r\n])*")/.source;function n(e){return e.replace(/__/g,function(){return t})}e.languages.toml={comment:{pattern:/#.*/,greedy:!0},table:{pattern:RegExp(n(/(^[\t ]*\[\s*(?:\[\s*)?)__(?:\s*\.\s*__)*(?=\s*\])/.source),"m"),lookbehind:!0,greedy:!0,alias:"class-name"},key:{pattern:RegExp(n(/(^[\t ]*|[{,]\s*)__(?:\s*\.\s*__)*(?=\s*=)/.source),"m"),lookbehind:!0,greedy:!0,alias:"property"},string:{pattern:/"""(?:\\[\s\S]|[^\\])*?"""|'''[\s\S]*?'''|'[^'\n\r]*'|"(?:\\.|[^\\"\r\n])*"/,greedy:!0},date:[{pattern:/\b\d{4}-\d{2}-\d{2}(?:[T\s]\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})?)?\b/i,alias:"number"},{pattern:/\b\d{2}:\d{2}:\d{2}(?:\.\d+)?\b/,alias:"number"}],number:/(?:\b0(?:x[\da-zA-Z]+(?:_[\da-zA-Z]+)*|o[0-7]+(?:_[0-7]+)*|b[10]+(?:_[10]+)*))\b|[-+]?\b\d+(?:_\d+)*(?:\.\d+(?:_\d+)*)?(?:[eE][+-]?\d+(?:_\d+)*)?\b|[-+]?\b(?:inf|nan)\b/,boolean:/\b(?:true|false)\b/,punctuation:/[.,=[\]{}]/}}(e)}e.exports=t,t.displayName="toml",t.aliases=[]},87041(e,t,n){"use strict";var r=n(96412),i=n(4979);function a(e){var t,n,a;e.register(r),e.register(i),n=(t=e).util.clone(t.languages.typescript),t.languages.tsx=t.languages.extend("jsx",n),(a=t.languages.tsx.tag).pattern=RegExp(/(^|[^\w$]|(?=<\/))/.source+"(?:"+a.pattern.source+")",a.pattern.flags),a.lookbehind=!0}e.exports=a,a.displayName="tsx",a.aliases=[]},61028(e,t,n){"use strict";var r=n(93205);function i(e){var t;e.register(r),(t=e).languages.tt2=t.languages.extend("clike",{comment:/#.*|\[%#[\s\S]*?%\]/,keyword:/\b(?:BLOCK|CALL|CASE|CATCH|CLEAR|DEBUG|DEFAULT|ELSE|ELSIF|END|FILTER|FINAL|FOREACH|GET|IF|IN|INCLUDE|INSERT|LAST|MACRO|META|NEXT|PERL|PROCESS|RAWPERL|RETURN|SET|STOP|TAGS|THROW|TRY|SWITCH|UNLESS|USE|WHILE|WRAPPER)\b/,punctuation:/[[\]{},()]/}),t.languages.insertBefore("tt2","number",{operator:/=[>=]?|!=?|<=?|>=?|&&|\|\|?|\b(?:and|or|not)\b/,variable:{pattern:/\b[a-z]\w*(?:\s*\.\s*(?:\d+|\$?[a-z]\w*))*\b/i}}),t.languages.insertBefore("tt2","keyword",{delimiter:{pattern:/^(?:\[%|%%)-?|-?%\]$/,alias:"punctuation"}}),t.languages.insertBefore("tt2","string",{"single-quoted-string":{pattern:/'[^\\']*(?:\\[\s\S][^\\']*)*'/,greedy:!0,alias:"string"},"double-quoted-string":{pattern:/"[^\\"]*(?:\\[\s\S][^\\"]*)*"/,greedy:!0,alias:"string",inside:{variable:{pattern:/\$(?:[a-z]\w*(?:\.(?:\d+|\$?[a-z]\w*))*)/i}}}}),delete t.languages.tt2.string,t.hooks.add("before-tokenize",function(e){var n=/\[%[\s\S]+?%\]/g;t.languages["markup-templating"].buildPlaceholders(e,"tt2",n)}),t.hooks.add("after-tokenize",function(e){t.languages["markup-templating"].tokenizePlaceholders(e,"tt2")})}e.exports=i,i.displayName="tt2",i.aliases=[]},24691(e){"use strict";function t(e){e.languages.turtle={comment:{pattern:/#.*/,greedy:!0},"multiline-string":{pattern:/"""(?:(?:""?)?(?:[^"\\]|\\.))*"""|'''(?:(?:''?)?(?:[^'\\]|\\.))*'''/,greedy:!0,alias:"string",inside:{comment:/#.*/}},string:{pattern:/"(?:[^\\"\r\n]|\\.)*"|'(?:[^\\'\r\n]|\\.)*'/,greedy:!0},url:{pattern:/<(?:[^\x00-\x20<>"{}|^`\\]|\\(?:u[\da-fA-F]{4}|U[\da-fA-F]{8}))*>/,greedy:!0,inside:{punctuation:/[<>]/}},function:{pattern:/(?:(?![-.\d\xB7])[-.\w\xB7\xC0-\uFFFD]+)?:(?:(?![-.])(?:[-.:\w\xC0-\uFFFD]|%[\da-f]{2}|\\.)+)?/i,inside:{"local-name":{pattern:/([^:]*:)[\s\S]+/,lookbehind:!0},prefix:{pattern:/[\s\S]+/,inside:{punctuation:/:/}}}},number:/[+-]?\b\d+(?:\.\d*)?(?:e[+-]?\d+)?/i,punctuation:/[{}.,;()[\]]|\^\^/,boolean:/\b(?:true|false)\b/,keyword:[/(?:\ba|@prefix|@base)\b|=/,/\b(?:graph|base|prefix)\b/i],tag:{pattern:/@[a-z]+(?:-[a-z\d]+)*/i,inside:{punctuation:/@/}}},e.languages.trig=e.languages.turtle}e.exports=t,t.displayName="turtle",t.aliases=[]},19892(e){"use strict";function t(e){e.languages.twig={comment:/\{#[\s\S]*?#\}/,tag:{pattern:/\{\{[\s\S]*?\}\}|\{%[\s\S]*?%\}/,inside:{ld:{pattern:/^(?:\{\{-?|\{%-?\s*\w+)/,inside:{punctuation:/^(?:\{\{|\{%)-?/,keyword:/\w+/}},rd:{pattern:/-?(?:%\}|\}\})$/,inside:{punctuation:/.+/}},string:{pattern:/("|')(?:\\.|(?!\1)[^\\\r\n])*\1/,inside:{punctuation:/^['"]|['"]$/}},keyword:/\b(?:even|if|odd)\b/,boolean:/\b(?:true|false|null)\b/,number:/\b0x[\dA-Fa-f]+|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee][-+]?\d+)?/,operator:[{pattern:/(\s)(?:and|b-and|b-xor|b-or|ends with|in|is|matches|not|or|same as|starts with)(?=\s)/,lookbehind:!0},/[=<>]=?|!=|\*\*?|\/\/?|\?:?|[-+~%|]/],property:/\b[a-zA-Z_]\w*\b/,punctuation:/[()\[\]{}:.,]/}},other:{pattern:/\S(?:[\s\S]*\S)?/,inside:e.languages.markup}}}e.exports=t,t.displayName="twig",t.aliases=[]},4979(e){"use strict";function t(e){var t,n;(t=e).languages.typescript=t.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:string|Function|any|number|boolean|Array|symbol|console|Promise|unknown|never)\b/}),t.languages.typescript.keyword.push(/\b(?:abstract|as|declare|implements|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)(?!\s*[^\s_${}*a-zA-Z\xA0-\uFFFF])/),delete t.languages.typescript.parameter,delete(n=t.languages.extend("typescript",{}))["class-name"],t.languages.typescript["class-name"].inside=n,t.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:n}}}}),t.languages.ts=t.languages.typescript}e.exports=t,t.displayName="typescript",t.aliases=["ts"]},23159(e){"use strict";function t(e){var t,n;n=/\b(?:ACT|ACTIFSUB|CARRAY|CASE|CLEARGIF|COA|COA_INT|CONSTANTS|CONTENT|CUR|EDITPANEL|EFFECT|EXT|FILE|FLUIDTEMPLATE|FORM|FRAME|FRAMESET|GIFBUILDER|GMENU|GMENU_FOLDOUT|GMENU_LAYERS|GP|HMENU|HRULER|HTML|IENV|IFSUB|IMAGE|IMGMENU|IMGMENUITEM|IMGTEXT|IMG_RESOURCE|INCLUDE_TYPOSCRIPT|JSMENU|JSMENUITEM|LLL|LOAD_REGISTER|NO|PAGE|RECORDS|RESTORE_REGISTER|TEMPLATE|TEXT|TMENU|TMENUITEM|TMENU_LAYERS|USER|USER_INT|_GIFBUILDER|global|globalString|globalVar)\b/,(t=e).languages.typoscript={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0},{pattern:/(^|[^\\:= \t]|(?:^|[^= \t])[ \t]+)\/\/.*/,lookbehind:!0,greedy:!0},{pattern:/(^|[^"'])#.*/,lookbehind:!0,greedy:!0}],function:[{pattern://,inside:{string:{pattern:/"[^"\r\n]*"|'[^'\r\n]*'/,inside:{keyword:n}},keyword:{pattern:/INCLUDE_TYPOSCRIPT/}}},{pattern:/@import\s*(?:"[^"\r\n]*"|'[^'\r\n]*')/,inside:{string:/"[^"\r\n]*"|'[^'\r\n]*'/}}],string:{pattern:/^([^=]*=[< ]?)(?:(?!\]\n).)*/,lookbehind:!0,inside:{function:/\{\$.*\}/,keyword:n,number:/^[0-9]+$/,punctuation:/[,|:]/}},keyword:n,number:{pattern:/\b[0-9]+\s*[.{=]/,inside:{operator:/[.{=]/}},tag:{pattern:/\.?[-\w\\]+\.?/,inside:{punctuation:/\./}},punctuation:/[{}[\];(),.:|]/,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/},t.languages.tsconfig=t.languages.typoscript}e.exports=t,t.displayName="typoscript",t.aliases=["tsconfig"]},34966(e){"use strict";function t(e){e.languages.unrealscript={comment:/\/\/.*|\/\*[\s\S]*?\*\//,string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},category:{pattern:/(\b(?:(?:autoexpand|hide|show)categories|var)\s*\()[^()]+(?=\))/,lookbehind:!0,greedy:!0,alias:"property"},metadata:{pattern:/(\w\s*)<\s*\w+\s*=[^<>|=\r\n]+(?:\|\s*\w+\s*=[^<>|=\r\n]+)*>/,lookbehind:!0,greedy:!0,inside:{property:/\b\w+(?=\s*=)/,operator:/=/,punctuation:/[<>|]/}},macro:{pattern:/`\w+/,alias:"property"},"class-name":{pattern:/(\b(?:class|enum|extends|interface|state(?:\(\))?|struct|within)\s+)\w+/,lookbehind:!0},keyword:/\b(?:abstract|actor|array|auto|autoexpandcategories|bool|break|byte|case|class|classgroup|client|coerce|collapsecategories|config|const|continue|default|defaultproperties|delegate|dependson|deprecated|do|dontcollapsecategories|editconst|editinlinenew|else|enum|event|exec|export|extends|final|float|for|forcescriptorder|foreach|function|goto|guid|hidecategories|hidedropdown|if|ignores|implements|inherits|input|int|interface|iterator|latent|local|material|name|native|nativereplication|noexport|nontransient|noteditinlinenew|notplaceable|operator|optional|out|pawn|perobjectconfig|perobjectlocalized|placeable|postoperator|preoperator|private|protected|reliable|replication|return|server|showcategories|simulated|singular|state|static|string|struct|structdefault|structdefaultproperties|switch|texture|transient|travel|unreliable|until|var|vector|while|within)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,boolean:/\b(?:false|true)\b/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/>>|<<|--|\+\+|\*\*|[-+*/~!=<>$@]=?|&&?|\|\|?|\^\^?|[?:%]|\b(?:Cross|Dot|ClockwiseFrom)\b/,punctuation:/[()[\]{};,.]/},e.languages.uc=e.languages.uscript=e.languages.unrealscript}e.exports=t,t.displayName="unrealscript",t.aliases=["uc","uscript"]},38521(e){"use strict";function t(e){e.languages.uri={scheme:{pattern:/^[a-z][a-z0-9+.-]*:/im,greedy:!0,inside:{"scheme-delimiter":/:$/}},fragment:{pattern:/#[\w\-.~!$&'()*+,;=%:@/?]*/,inside:{"fragment-delimiter":/^#/}},query:{pattern:/\?[\w\-.~!$&'()*+,;=%:@/?]*/,inside:{"query-delimiter":{pattern:/^\?/,greedy:!0},"pair-delimiter":/[&;]/,pair:{pattern:/^[^=][\s\S]*/,inside:{key:/^[^=]+/,value:{pattern:/(^=)[\s\S]+/,lookbehind:!0}}}}},authority:{pattern:RegExp(/^\/\//.source+/(?:[\w\-.~!$&'()*+,;=%:]*@)?/.source+("(?:"+/\[(?:[0-9a-fA-F:.]{2,48}|v[0-9a-fA-F]+\.[\w\-.~!$&'()*+,;=]+)\]/.source+"|")+/[\w\-.~!$&'()*+,;=%]*/.source+")"+/(?::\d*)?/.source,"m"),inside:{"authority-delimiter":/^\/\//,"user-info-segment":{pattern:/^[\w\-.~!$&'()*+,;=%:]*@/,inside:{"user-info-delimiter":/@$/,"user-info":/^[\w\-.~!$&'()*+,;=%:]+/}},"port-segment":{pattern:/:\d*$/,inside:{"port-delimiter":/^:/,port:/^\d+/}},host:{pattern:/[\s\S]+/,inside:{"ip-literal":{pattern:/^\[[\s\S]+\]$/,inside:{"ip-literal-delimiter":/^\[|\]$/,"ipv-future":/^v[\s\S]+/,"ipv6-address":/^[\s\S]+/}},"ipv4-address":/^(?:(?:[03-9]\d?|[12]\d{0,2})\.){3}(?:[03-9]\d?|[12]{0,2})$/}}}},path:{pattern:/^[\w\-.~!$&'()*+,;=%:@/]+/m,inside:{"path-separator":/\//}}},e.languages.url=e.languages.uri}e.exports=t,t.displayName="uri",t.aliases=["url"]},7255(e){"use strict";function t(e){var t,n;n={pattern:/[\s\S]+/,inside:null},(t=e).languages.v=t.languages.extend("clike",{string:[{pattern:/`(?:\\`|\\?[^`]{1,2})`/,alias:"rune"},{pattern:/r?(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,alias:"quoted-string",greedy:!0,inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:\{[^{}]*\}|\w+(?:\.\w+(?:\([^\(\)]*\))?|\[[^\[\]]+\])*)/,lookbehind:!0,inside:{"interpolation-variable":{pattern:/^\$\w[\s\S]*$/,alias:"variable"},"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},"interpolation-expression":n}}}}],"class-name":{pattern:/(\b(?:enum|interface|struct|type)\s+)(?:C\.)?\w+/,lookbehind:!0},keyword:/(?:\b(?:as|asm|assert|atomic|break|chan|const|continue|defer|else|embed|enum|fn|for|__global|go(?:to)?|if|import|in|interface|is|lock|match|module|mut|none|or|pub|return|rlock|select|shared|sizeof|static|struct|type(?:of)?|union|unsafe)|\$(?:if|else|for)|#(?:include|flag))\b/,number:/\b(?:0x[a-f\d]+(?:_[a-f\d]+)*|0b[01]+(?:_[01]+)*|0o[0-7]+(?:_[0-7]+)*|\d+(?:_\d+)*(?:\.\d+(?:_\d+)*)?)\b/i,operator:/~|\?|[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\.?/,builtin:/\b(?:any(?:_int|_float)?|bool|byte(?:ptr)?|charptr|f(?:32|64)|i(?:8|16|nt|64|128)|rune|size_t|string|u(?:16|32|64|128)|voidptr)\b/}),n.inside=t.languages.v,t.languages.insertBefore("v","operator",{attribute:{pattern:/(^[\t ]*)\[(?:deprecated|unsafe_fn|typedef|live|inline|flag|ref_only|windows_stdcall|direct_array_access)\]/m,lookbehind:!0,alias:"annotation",inside:{punctuation:/[\[\]]/,keyword:/\w+/}},generic:{pattern:/<\w+>(?=\s*[\)\{])/,inside:{punctuation:/[<>]/,"class-name":/\w+/}}}),t.languages.insertBefore("v","function",{"generic-function":{pattern:/\b\w+\s*<\w+>(?=\()/,inside:{function:/^\w+/,generic:{pattern:/<\w+>/,inside:t.languages.v.generic.inside}}}})}e.exports=t,t.displayName="v",t.aliases=[]},28173(e){"use strict";function t(e){e.languages.vala=e.languages.extend("clike",{"class-name":[{pattern:/\b[A-Z]\w*(?:\.\w+)*\b(?=(?:\?\s+|\*?\s+\*?)\w)/,inside:{punctuation:/\./}},{pattern:/(\[)[A-Z]\w*(?:\.\w+)*\b/,lookbehind:!0,inside:{punctuation:/\./}},{pattern:/(\b(?:class|interface)\s+[A-Z]\w*(?:\.\w+)*\s*:\s*)[A-Z]\w*(?:\.\w+)*\b/,lookbehind:!0,inside:{punctuation:/\./}},{pattern:/((?:\b(?:class|interface|new|struct|enum)\s+)|(?:catch\s+\())[A-Z]\w*(?:\.\w+)*\b/,lookbehind:!0,inside:{punctuation:/\./}}],keyword:/\b(?:bool|char|double|float|null|size_t|ssize_t|string|unichar|void|int|int8|int16|int32|int64|long|short|uchar|uint|uint8|uint16|uint32|uint64|ulong|ushort|class|delegate|enum|errordomain|interface|namespace|struct|break|continue|do|for|foreach|return|while|else|if|switch|assert|case|default|abstract|const|dynamic|ensures|extern|inline|internal|override|private|protected|public|requires|signal|static|virtual|volatile|weak|async|owned|unowned|try|catch|finally|throw|as|base|construct|delete|get|in|is|lock|new|out|params|ref|sizeof|set|this|throws|typeof|using|value|var|yield)\b/i,function:/\b\w+(?=\s*\()/,number:/(?:\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)(?:f|u?l?)?/i,operator:/\+\+|--|&&|\|\||<<=?|>>=?|=>|->|~|[+\-*\/%&^|=!<>]=?|\?\??|\.\.\./,punctuation:/[{}[\];(),.:]/,constant:/\b[A-Z0-9_]+\b/}),e.languages.insertBefore("vala","string",{"raw-string":{pattern:/"""[\s\S]*?"""/,greedy:!0,alias:"string"},"template-string":{pattern:/@"[\s\S]*?"/,greedy:!0,inside:{interpolation:{pattern:/\$(?:\([^)]*\)|[a-zA-Z]\w*)/,inside:{delimiter:{pattern:/^\$\(?|\)$/,alias:"punctuation"},rest:e.languages.vala}},string:/[\s\S]+/}}}),e.languages.insertBefore("vala","keyword",{regex:{pattern:/\/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[imsx]{0,4}(?=\s*(?:$|[\r\n,.;})\]]))/,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:e.languages.regex},"regex-delimiter":/^\//,"regex-flags":/^[a-z]+$/}}})}e.exports=t,t.displayName="vala",t.aliases=[]},53813(e,t,n){"use strict";var r=n(46241);function i(e){e.register(r),e.languages.vbnet=e.languages.extend("basic",{comment:[{pattern:/(?:!|REM\b).+/i,inside:{keyword:/^REM/i}},{pattern:/(^|[^\\:])'.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(^|[^"])"(?:""|[^"])*"(?!")/i,lookbehind:!0,greedy:!0},keyword:/(?:\b(?:ADDHANDLER|ADDRESSOF|ALIAS|AND|ANDALSO|AS|BEEP|BLOAD|BOOLEAN|BSAVE|BYREF|BYTE|BYVAL|CALL(?: ABSOLUTE)?|CASE|CATCH|CBOOL|CBYTE|CCHAR|CDATE|CDEC|CDBL|CHAIN|CHAR|CHDIR|CINT|CLASS|CLEAR|CLNG|CLOSE|CLS|COBJ|COM|COMMON|CONST|CONTINUE|CSBYTE|CSHORT|CSNG|CSTR|CTYPE|CUINT|CULNG|CUSHORT|DATA|DATE|DECIMAL|DECLARE|DEFAULT|DEF(?: FN| SEG|DBL|INT|LNG|SNG|STR)|DELEGATE|DIM|DIRECTCAST|DO|DOUBLE|ELSE|ELSEIF|END|ENUM|ENVIRON|ERASE|ERROR|EVENT|EXIT|FALSE|FIELD|FILES|FINALLY|FOR(?: EACH)?|FRIEND|FUNCTION|GET|GETTYPE|GETXMLNAMESPACE|GLOBAL|GOSUB|GOTO|HANDLES|IF|IMPLEMENTS|IMPORTS|IN|INHERITS|INPUT|INTEGER|INTERFACE|IOCTL|IS|ISNOT|KEY|KILL|LINE INPUT|LET|LIB|LIKE|LOCATE|LOCK|LONG|LOOP|LSET|ME|MKDIR|MOD|MODULE|MUSTINHERIT|MUSTOVERRIDE|MYBASE|MYCLASS|NAME|NAMESPACE|NARROWING|NEW|NEXT|NOT|NOTHING|NOTINHERITABLE|NOTOVERRIDABLE|OBJECT|OF|OFF|ON(?: COM| ERROR| KEY| TIMER)?|OPERATOR|OPEN|OPTION(?: BASE)?|OPTIONAL|OR|ORELSE|OUT|OVERLOADS|OVERRIDABLE|OVERRIDES|PARAMARRAY|PARTIAL|POKE|PRIVATE|PROPERTY|PROTECTED|PUBLIC|PUT|RAISEEVENT|READ|READONLY|REDIM|REM|REMOVEHANDLER|RESTORE|RESUME|RETURN|RMDIR|RSET|RUN|SBYTE|SELECT(?: CASE)?|SET|SHADOWS|SHARED|SHORT|SINGLE|SHELL|SLEEP|STATIC|STEP|STOP|STRING|STRUCTURE|SUB|SYNCLOCK|SWAP|SYSTEM|THEN|THROW|TIMER|TO|TROFF|TRON|TRUE|TRY|TRYCAST|TYPE|TYPEOF|UINTEGER|ULONG|UNLOCK|UNTIL|USHORT|USING|VIEW PRINT|WAIT|WEND|WHEN|WHILE|WIDENING|WITH|WITHEVENTS|WRITE|WRITEONLY|XOR)|\B(?:#CONST|#ELSE|#ELSEIF|#END|#IF))(?:\$|\b)/i,punctuation:/[,;:(){}]/})}e.exports=i,i.displayName="vbnet",i.aliases=[]},46891(e){"use strict";function t(e){var t,n;(t=e).languages.velocity=t.languages.extend("markup",{}),(n={variable:{pattern:/(^|[^\\](?:\\\\)*)\$!?(?:[a-z][\w-]*(?:\([^)]*\))?(?:\.[a-z][\w-]*(?:\([^)]*\))?|\[[^\]]+\])*|\{[^}]+\})/i,lookbehind:!0,inside:{}},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},number:/\b\d+\b/,boolean:/\b(?:true|false)\b/,operator:/[=!<>]=?|[+*/%-]|&&|\|\||\.\.|\b(?:eq|g[et]|l[et]|n(?:e|ot))\b/,punctuation:/[(){}[\]:,.]/}).variable.inside={string:n.string,function:{pattern:/([^\w-])[a-z][\w-]*(?=\()/,lookbehind:!0},number:n.number,boolean:n.boolean,punctuation:n.punctuation},t.languages.insertBefore("velocity","comment",{unparsed:{pattern:/(^|[^\\])#\[\[[\s\S]*?\]\]#/,lookbehind:!0,greedy:!0,inside:{punctuation:/^#\[\[|\]\]#$/}},"velocity-comment":[{pattern:/(^|[^\\])#\*[\s\S]*?\*#/,lookbehind:!0,greedy:!0,alias:"comment"},{pattern:/(^|[^\\])##.*/,lookbehind:!0,greedy:!0,alias:"comment"}],directive:{pattern:/(^|[^\\](?:\\\\)*)#@?(?:[a-z][\w-]*|\{[a-z][\w-]*\})(?:\s*\((?:[^()]|\([^()]*\))*\))?/i,lookbehind:!0,inside:{keyword:{pattern:/^#@?(?:[a-z][\w-]*|\{[a-z][\w-]*\})|\bin\b/,inside:{punctuation:/[{}]/}},rest:n}},variable:n.variable}),t.languages.velocity.tag.inside["attr-value"].inside.rest=t.languages.velocity}e.exports=t,t.displayName="velocity",t.aliases=[]},91824(e){"use strict";function t(e){e.languages.verilog={comment:/\/\/.*|\/\*[\s\S]*?\*\//,string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},property:/\B\$\w+\b/,constant:/\B`\w+\b/,function:/\b\w+(?=\()/,keyword:/\b(?:alias|and|assert|assign|assume|automatic|before|begin|bind|bins|binsof|bit|break|buf|bufif0|bufif1|byte|class|case|casex|casez|cell|chandle|clocking|cmos|config|const|constraint|context|continue|cover|covergroup|coverpoint|cross|deassign|default|defparam|design|disable|dist|do|edge|else|end|endcase|endclass|endclocking|endconfig|endfunction|endgenerate|endgroup|endinterface|endmodule|endpackage|endprimitive|endprogram|endproperty|endspecify|endsequence|endtable|endtask|enum|event|expect|export|extends|extern|final|first_match|for|force|foreach|forever|fork|forkjoin|function|generate|genvar|highz0|highz1|if|iff|ifnone|ignore_bins|illegal_bins|import|incdir|include|initial|inout|input|inside|instance|int|integer|interface|intersect|join|join_any|join_none|large|liblist|library|local|localparam|logic|longint|macromodule|matches|medium|modport|module|nand|negedge|new|nmos|nor|noshowcancelled|not|notif0|notif1|null|or|output|package|packed|parameter|pmos|posedge|primitive|priority|program|property|protected|pull0|pull1|pulldown|pullup|pulsestyle_onevent|pulsestyle_ondetect|pure|rand|randc|randcase|randsequence|rcmos|real|realtime|ref|reg|release|repeat|return|rnmos|rpmos|rtran|rtranif0|rtranif1|scalared|sequence|shortint|shortreal|showcancelled|signed|small|solve|specify|specparam|static|string|strong0|strong1|struct|super|supply0|supply1|table|tagged|task|this|throughout|time|timeprecision|timeunit|tran|tranif0|tranif1|tri|tri0|tri1|triand|trior|trireg|type|typedef|union|unique|unsigned|use|uwire|var|vectored|virtual|void|wait|wait_order|wand|weak0|weak1|while|wildcard|wire|with|within|wor|xnor|xor)\b/,important:/\b(?:always_latch|always_comb|always_ff|always)\b ?@?/,number:/\B##?\d+|(?:\b\d+)?'[odbh] ?[\da-fzx_?]+|\b(?:\d*[._])?\d+(?:e[-+]?\d+)?/i,operator:/[-+{}^~%*\/?=!<>&|]+/,punctuation:/[[\];(),.:]/}}e.exports=t,t.displayName="verilog",t.aliases=[]},9447(e){"use strict";function t(e){e.languages.vhdl={comment:/--.+/,"vhdl-vectors":{pattern:/\b[oxb]"[\da-f_]+"|"[01uxzwlh-]+"/i,alias:"number"},"quoted-function":{pattern:/"\S+?"(?=\()/,alias:"function"},string:/"(?:[^\\"\r\n]|\\(?:\r\n|[\s\S]))*"/,constant:/\b(?:use|library)\b/i,keyword:/\b(?:'active|'ascending|'base|'delayed|'driving|'driving_value|'event|'high|'image|'instance_name|'last_active|'last_event|'last_value|'left|'leftof|'length|'low|'path_name|'pos|'pred|'quiet|'range|'reverse_range|'right|'rightof|'simple_name|'stable|'succ|'transaction|'val|'value|access|after|alias|all|architecture|array|assert|attribute|begin|block|body|buffer|bus|case|component|configuration|constant|disconnect|downto|else|elsif|end|entity|exit|file|for|function|generate|generic|group|guarded|if|impure|in|inertial|inout|is|label|library|linkage|literal|loop|map|new|next|null|of|on|open|others|out|package|port|postponed|procedure|process|pure|range|record|register|reject|report|return|select|severity|shared|signal|subtype|then|to|transport|type|unaffected|units|until|use|variable|wait|when|while|with)\b/i,boolean:/\b(?:true|false)\b/i,function:/\w+(?=\()/,number:/'[01uxzwlh-]'|\b(?:\d+#[\da-f_.]+#|\d[\d_.]*)(?:e[-+]?\d+)?/i,operator:/[<>]=?|:=|[-+*/&=]|\b(?:abs|not|mod|rem|sll|srl|sla|sra|rol|ror|and|or|nand|xnor|xor|nor)\b/i,punctuation:/[{}[\];(),.:]/}}e.exports=t,t.displayName="vhdl",t.aliases=[]},53062(e){"use strict";function t(e){e.languages.vim={string:/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\r\n]|'')*'/,comment:/".*/,function:/\b\w+(?=\()/,keyword:/\b(?:ab|abbreviate|abc|abclear|abo|aboveleft|al|all|arga|argadd|argd|argdelete|argdo|arge|argedit|argg|argglobal|argl|arglocal|ar|args|argu|argument|as|ascii|bad|badd|ba|ball|bd|bdelete|be|bel|belowright|bf|bfirst|bl|blast|bm|bmodified|bn|bnext|bN|bNext|bo|botright|bp|bprevious|brea|break|breaka|breakadd|breakd|breakdel|breakl|breaklist|br|brewind|bro|browse|bufdo|b|buffer|buffers|bun|bunload|bw|bwipeout|ca|cabbrev|cabc|cabclear|caddb|caddbuffer|cad|caddexpr|caddf|caddfile|cal|call|cat|catch|cb|cbuffer|cc|ccl|cclose|cd|ce|center|cex|cexpr|cf|cfile|cfir|cfirst|cgetb|cgetbuffer|cgete|cgetexpr|cg|cgetfile|c|change|changes|chd|chdir|che|checkpath|checkt|checktime|cla|clast|cl|clist|clo|close|cmapc|cmapclear|cnew|cnewer|cn|cnext|cN|cNext|cnf|cnfile|cNfcNfile|cnorea|cnoreabbrev|col|colder|colo|colorscheme|comc|comclear|comp|compiler|conf|confirm|con|continue|cope|copen|co|copy|cpf|cpfile|cp|cprevious|cq|cquit|cr|crewind|cuna|cunabbrev|cu|cunmap|cw|cwindow|debugg|debuggreedy|delc|delcommand|d|delete|delf|delfunction|delm|delmarks|diffg|diffget|diffoff|diffpatch|diffpu|diffput|diffsplit|diffthis|diffu|diffupdate|dig|digraphs|di|display|dj|djump|dl|dlist|dr|drop|ds|dsearch|dsp|dsplit|earlier|echoe|echoerr|echom|echomsg|echon|e|edit|el|else|elsei|elseif|em|emenu|endfo|endfor|endf|endfunction|endfun|en|endif|endt|endtry|endw|endwhile|ene|enew|ex|exi|exit|exu|exusage|f|file|files|filetype|fina|finally|fin|find|fini|finish|fir|first|fix|fixdel|fo|fold|foldc|foldclose|folddoc|folddoclosed|foldd|folddoopen|foldo|foldopen|for|fu|fun|function|go|goto|gr|grep|grepa|grepadd|ha|hardcopy|h|help|helpf|helpfind|helpg|helpgrep|helpt|helptags|hid|hide|his|history|ia|iabbrev|iabc|iabclear|if|ij|ijump|il|ilist|imapc|imapclear|in|inorea|inoreabbrev|isearch|isp|isplit|iuna|iunabbrev|iu|iunmap|j|join|ju|jumps|k|keepalt|keepj|keepjumps|kee|keepmarks|laddb|laddbuffer|lad|laddexpr|laddf|laddfile|lan|language|la|last|later|lb|lbuffer|lc|lcd|lch|lchdir|lcl|lclose|let|left|lefta|leftabove|lex|lexpr|lf|lfile|lfir|lfirst|lgetb|lgetbuffer|lgete|lgetexpr|lg|lgetfile|lgr|lgrep|lgrepa|lgrepadd|lh|lhelpgrep|l|list|ll|lla|llast|lli|llist|lmak|lmake|lm|lmap|lmapc|lmapclear|lnew|lnewer|lne|lnext|lN|lNext|lnf|lnfile|lNf|lNfile|ln|lnoremap|lo|loadview|loc|lockmarks|lockv|lockvar|lol|lolder|lop|lopen|lpf|lpfile|lp|lprevious|lr|lrewind|ls|lt|ltag|lu|lunmap|lv|lvimgrep|lvimgrepa|lvimgrepadd|lw|lwindow|mak|make|ma|mark|marks|mat|match|menut|menutranslate|mk|mkexrc|mks|mksession|mksp|mkspell|mkvie|mkview|mkv|mkvimrc|mod|mode|m|move|mzf|mzfile|mz|mzscheme|nbkey|new|n|next|N|Next|nmapc|nmapclear|noh|nohlsearch|norea|noreabbrev|nu|number|nun|nunmap|omapc|omapclear|on|only|o|open|opt|options|ou|ounmap|pc|pclose|ped|pedit|pe|perl|perld|perldo|po|pop|popu|popup|pp|ppop|pre|preserve|prev|previous|p|print|P|Print|profd|profdel|prof|profile|promptf|promptfind|promptr|promptrepl|ps|psearch|pta|ptag|ptf|ptfirst|ptj|ptjump|ptl|ptlast|ptn|ptnext|ptN|ptNext|ptp|ptprevious|ptr|ptrewind|pts|ptselect|pu|put|pw|pwd|pyf|pyfile|py|python|qa|qall|q|quit|quita|quitall|r|read|rec|recover|redi|redir|red|redo|redr|redraw|redraws|redrawstatus|reg|registers|res|resize|ret|retab|retu|return|rew|rewind|ri|right|rightb|rightbelow|rub|ruby|rubyd|rubydo|rubyf|rubyfile|ru|runtime|rv|rviminfo|sal|sall|san|sandbox|sa|sargument|sav|saveas|sba|sball|sbf|sbfirst|sbl|sblast|sbm|sbmodified|sbn|sbnext|sbN|sbNext|sbp|sbprevious|sbr|sbrewind|sb|sbuffer|scripte|scriptencoding|scrip|scriptnames|se|set|setf|setfiletype|setg|setglobal|setl|setlocal|sf|sfind|sfir|sfirst|sh|shell|sign|sil|silent|sim|simalt|sla|slast|sl|sleep|sm|smagic|smap|smapc|smapclear|sme|smenu|sn|snext|sN|sNext|sni|sniff|sno|snomagic|snor|snoremap|snoreme|snoremenu|sor|sort|so|source|spelld|spelldump|spe|spellgood|spelli|spellinfo|spellr|spellrepall|spellu|spellundo|spellw|spellwrong|sp|split|spr|sprevious|sre|srewind|sta|stag|startg|startgreplace|star|startinsert|startr|startreplace|stj|stjump|st|stop|stopi|stopinsert|sts|stselect|sun|sunhide|sunm|sunmap|sus|suspend|sv|sview|syncbind|t|tab|tabc|tabclose|tabd|tabdo|tabe|tabedit|tabf|tabfind|tabfir|tabfirst|tabl|tablast|tabm|tabmove|tabnew|tabn|tabnext|tabN|tabNext|tabo|tabonly|tabp|tabprevious|tabr|tabrewind|tabs|ta|tag|tags|tc|tcl|tcld|tcldo|tclf|tclfile|te|tearoff|tf|tfirst|th|throw|tj|tjump|tl|tlast|tm|tmenu|tn|tnext|tN|tNext|to|topleft|tp|tprevious|tr|trewind|try|ts|tselect|tu|tunmenu|una|unabbreviate|u|undo|undoj|undojoin|undol|undolist|unh|unhide|unlet|unlo|unlockvar|unm|unmap|up|update|verb|verbose|ve|version|vert|vertical|vie|view|vim|vimgrep|vimgrepa|vimgrepadd|vi|visual|viu|viusage|vmapc|vmapclear|vne|vnew|vs|vsplit|vu|vunmap|wa|wall|wh|while|winc|wincmd|windo|winp|winpos|win|winsize|wn|wnext|wN|wNext|wp|wprevious|wq|wqa|wqall|w|write|ws|wsverb|wv|wviminfo|X|xa|xall|x|xit|xm|xmap|xmapc|xmapclear|xme|xmenu|XMLent|XMLns|xn|xnoremap|xnoreme|xnoremenu|xu|xunmap|y|yank)\b/,builtin:/\b(?:autocmd|acd|ai|akm|aleph|allowrevins|altkeymap|ambiwidth|ambw|anti|antialias|arab|arabic|arabicshape|ari|arshape|autochdir|autoindent|autoread|autowrite|autowriteall|aw|awa|background|backspace|backup|backupcopy|backupdir|backupext|backupskip|balloondelay|ballooneval|balloonexpr|bdir|bdlay|beval|bex|bexpr|bg|bh|bin|binary|biosk|bioskey|bk|bkc|bomb|breakat|brk|browsedir|bs|bsdir|bsk|bt|bufhidden|buflisted|buftype|casemap|ccv|cdpath|cedit|cfu|ch|charconvert|ci|cin|cindent|cink|cinkeys|cino|cinoptions|cinw|cinwords|clipboard|cmdheight|cmdwinheight|cmp|cms|columns|com|comments|commentstring|compatible|complete|completefunc|completeopt|consk|conskey|copyindent|cot|cpo|cpoptions|cpt|cscopepathcomp|cscopeprg|cscopequickfix|cscopetag|cscopetagorder|cscopeverbose|cspc|csprg|csqf|cst|csto|csverb|cuc|cul|cursorcolumn|cursorline|cwh|debug|deco|def|define|delcombine|dex|dg|dict|dictionary|diff|diffexpr|diffopt|digraph|dip|dir|directory|dy|ea|ead|eadirection|eb|ed|edcompatible|ef|efm|ei|ek|enc|encoding|endofline|eol|ep|equalalways|equalprg|errorbells|errorfile|errorformat|esckeys|et|eventignore|expandtab|exrc|fcl|fcs|fdc|fde|fdi|fdl|fdls|fdm|fdn|fdo|fdt|fen|fenc|fencs|fex|ff|ffs|fileencoding|fileencodings|fileformat|fileformats|fillchars|fk|fkmap|flp|fml|fmr|foldcolumn|foldenable|foldexpr|foldignore|foldlevel|foldlevelstart|foldmarker|foldmethod|foldminlines|foldnestmax|foldtext|formatexpr|formatlistpat|formatoptions|formatprg|fp|fs|fsync|ft|gcr|gd|gdefault|gfm|gfn|gfs|gfw|ghr|gp|grepformat|grepprg|gtl|gtt|guicursor|guifont|guifontset|guifontwide|guiheadroom|guioptions|guipty|guitablabel|guitabtooltip|helpfile|helpheight|helplang|hf|hh|hi|hidden|highlight|hk|hkmap|hkmapp|hkp|hl|hlg|hls|hlsearch|ic|icon|iconstring|ignorecase|im|imactivatekey|imak|imc|imcmdline|imd|imdisable|imi|iminsert|ims|imsearch|inc|include|includeexpr|incsearch|inde|indentexpr|indentkeys|indk|inex|inf|infercase|insertmode|isf|isfname|isi|isident|isk|iskeyword|isprint|joinspaces|js|key|keymap|keymodel|keywordprg|km|kmp|kp|langmap|langmenu|laststatus|lazyredraw|lbr|lcs|linebreak|lines|linespace|lisp|lispwords|listchars|loadplugins|lpl|lsp|lz|macatsui|magic|makeef|makeprg|matchpairs|matchtime|maxcombine|maxfuncdepth|maxmapdepth|maxmem|maxmempattern|maxmemtot|mco|mef|menuitems|mfd|mh|mis|mkspellmem|ml|mls|mm|mmd|mmp|mmt|modeline|modelines|modifiable|modified|more|mouse|mousef|mousefocus|mousehide|mousem|mousemodel|mouses|mouseshape|mouset|mousetime|mp|mps|msm|mzq|mzquantum|nf|nrformats|numberwidth|nuw|odev|oft|ofu|omnifunc|opendevice|operatorfunc|opfunc|osfiletype|pa|para|paragraphs|paste|pastetoggle|patchexpr|patchmode|path|pdev|penc|pex|pexpr|pfn|ph|pheader|pi|pm|pmbcs|pmbfn|popt|preserveindent|previewheight|previewwindow|printdevice|printencoding|printexpr|printfont|printheader|printmbcharset|printmbfont|printoptions|prompt|pt|pumheight|pvh|pvw|qe|quoteescape|readonly|remap|report|restorescreen|revins|rightleft|rightleftcmd|rl|rlc|ro|rs|rtp|ruf|ruler|rulerformat|runtimepath|sbo|sc|scb|scr|scroll|scrollbind|scrolljump|scrolloff|scrollopt|scs|sect|sections|secure|sel|selection|selectmode|sessionoptions|sft|shcf|shellcmdflag|shellpipe|shellquote|shellredir|shellslash|shelltemp|shelltype|shellxquote|shiftround|shiftwidth|shm|shortmess|shortname|showbreak|showcmd|showfulltag|showmatch|showmode|showtabline|shq|si|sidescroll|sidescrolloff|siso|sj|slm|smartcase|smartindent|smarttab|smc|smd|softtabstop|sol|spc|spell|spellcapcheck|spellfile|spelllang|spellsuggest|spf|spl|splitbelow|splitright|sps|sr|srr|ss|ssl|ssop|stal|startofline|statusline|stl|stmp|su|sua|suffixes|suffixesadd|sw|swapfile|swapsync|swb|swf|switchbuf|sws|sxq|syn|synmaxcol|syntax|tabline|tabpagemax|tabstop|tagbsearch|taglength|tagrelative|tagstack|tal|tb|tbi|tbidi|tbis|tbs|tenc|term|termbidi|termencoding|terse|textauto|textmode|textwidth|tgst|thesaurus|tildeop|timeout|timeoutlen|title|titlelen|titleold|titlestring|toolbar|toolbariconsize|top|tpm|tsl|tsr|ttimeout|ttimeoutlen|ttm|tty|ttybuiltin|ttyfast|ttym|ttymouse|ttyscroll|ttytype|tw|tx|uc|ul|undolevels|updatecount|updatetime|ut|vb|vbs|vdir|verbosefile|vfile|viewdir|viewoptions|viminfo|virtualedit|visualbell|vop|wak|warn|wb|wc|wcm|wd|weirdinvert|wfh|wfw|whichwrap|wi|wig|wildchar|wildcharm|wildignore|wildmenu|wildmode|wildoptions|wim|winaltkeys|window|winfixheight|winfixwidth|winheight|winminheight|winminwidth|winwidth|wiv|wiw|wm|wmh|wmnu|wmw|wop|wrap|wrapmargin|wrapscan|writeany|writebackup|writedelay|ww|noacd|noai|noakm|noallowrevins|noaltkeymap|noanti|noantialias|noar|noarab|noarabic|noarabicshape|noari|noarshape|noautochdir|noautoindent|noautoread|noautowrite|noautowriteall|noaw|noawa|nobackup|noballooneval|nobeval|nobin|nobinary|nobiosk|nobioskey|nobk|nobl|nobomb|nobuflisted|nocf|noci|nocin|nocindent|nocompatible|noconfirm|noconsk|noconskey|nocopyindent|nocp|nocscopetag|nocscopeverbose|nocst|nocsverb|nocuc|nocul|nocursorcolumn|nocursorline|nodeco|nodelcombine|nodg|nodiff|nodigraph|nodisable|noea|noeb|noed|noedcompatible|noek|noendofline|noeol|noequalalways|noerrorbells|noesckeys|noet|noex|noexpandtab|noexrc|nofen|nofk|nofkmap|nofoldenable|nogd|nogdefault|noguipty|nohid|nohidden|nohk|nohkmap|nohkmapp|nohkp|nohls|noic|noicon|noignorecase|noim|noimc|noimcmdline|noimd|noincsearch|noinf|noinfercase|noinsertmode|nois|nojoinspaces|nojs|nolazyredraw|nolbr|nolinebreak|nolisp|nolist|noloadplugins|nolpl|nolz|noma|nomacatsui|nomagic|nomh|noml|nomod|nomodeline|nomodifiable|nomodified|nomore|nomousef|nomousefocus|nomousehide|nonu|nonumber|noodev|noopendevice|nopaste|nopi|nopreserveindent|nopreviewwindow|noprompt|nopvw|noreadonly|noremap|norestorescreen|norevins|nori|norightleft|norightleftcmd|norl|norlc|noro|nors|noru|noruler|nosb|nosc|noscb|noscrollbind|noscs|nosecure|nosft|noshellslash|noshelltemp|noshiftround|noshortname|noshowcmd|noshowfulltag|noshowmatch|noshowmode|nosi|nosm|nosmartcase|nosmartindent|nosmarttab|nosmd|nosn|nosol|nospell|nosplitbelow|nosplitright|nospr|nosr|nossl|nosta|nostartofline|nostmp|noswapfile|noswf|nota|notagbsearch|notagrelative|notagstack|notbi|notbidi|notbs|notermbidi|noterse|notextauto|notextmode|notf|notgst|notildeop|notimeout|notitle|noto|notop|notr|nottimeout|nottybuiltin|nottyfast|notx|novb|novisualbell|nowa|nowarn|nowb|noweirdinvert|nowfh|nowfw|nowildmenu|nowinfixheight|nowinfixwidth|nowiv|nowmnu|nowrap|nowrapscan|nowrite|nowriteany|nowritebackup|nows|invacd|invai|invakm|invallowrevins|invaltkeymap|invanti|invantialias|invar|invarab|invarabic|invarabicshape|invari|invarshape|invautochdir|invautoindent|invautoread|invautowrite|invautowriteall|invaw|invawa|invbackup|invballooneval|invbeval|invbin|invbinary|invbiosk|invbioskey|invbk|invbl|invbomb|invbuflisted|invcf|invci|invcin|invcindent|invcompatible|invconfirm|invconsk|invconskey|invcopyindent|invcp|invcscopetag|invcscopeverbose|invcst|invcsverb|invcuc|invcul|invcursorcolumn|invcursorline|invdeco|invdelcombine|invdg|invdiff|invdigraph|invdisable|invea|inveb|inved|invedcompatible|invek|invendofline|inveol|invequalalways|inverrorbells|invesckeys|invet|invex|invexpandtab|invexrc|invfen|invfk|invfkmap|invfoldenable|invgd|invgdefault|invguipty|invhid|invhidden|invhk|invhkmap|invhkmapp|invhkp|invhls|invhlsearch|invic|invicon|invignorecase|invim|invimc|invimcmdline|invimd|invincsearch|invinf|invinfercase|invinsertmode|invis|invjoinspaces|invjs|invlazyredraw|invlbr|invlinebreak|invlisp|invlist|invloadplugins|invlpl|invlz|invma|invmacatsui|invmagic|invmh|invml|invmod|invmodeline|invmodifiable|invmodified|invmore|invmousef|invmousefocus|invmousehide|invnu|invnumber|invodev|invopendevice|invpaste|invpi|invpreserveindent|invpreviewwindow|invprompt|invpvw|invreadonly|invremap|invrestorescreen|invrevins|invri|invrightleft|invrightleftcmd|invrl|invrlc|invro|invrs|invru|invruler|invsb|invsc|invscb|invscrollbind|invscs|invsecure|invsft|invshellslash|invshelltemp|invshiftround|invshortname|invshowcmd|invshowfulltag|invshowmatch|invshowmode|invsi|invsm|invsmartcase|invsmartindent|invsmarttab|invsmd|invsn|invsol|invspell|invsplitbelow|invsplitright|invspr|invsr|invssl|invsta|invstartofline|invstmp|invswapfile|invswf|invta|invtagbsearch|invtagrelative|invtagstack|invtbi|invtbidi|invtbs|invtermbidi|invterse|invtextauto|invtextmode|invtf|invtgst|invtildeop|invtimeout|invtitle|invto|invtop|invtr|invttimeout|invttybuiltin|invttyfast|invtx|invvb|invvisualbell|invwa|invwarn|invwb|invweirdinvert|invwfh|invwfw|invwildmenu|invwinfixheight|invwinfixwidth|invwiv|invwmnu|invwrap|invwrapscan|invwrite|invwriteany|invwritebackup|invws|t_AB|t_AF|t_al|t_AL|t_bc|t_cd|t_ce|t_Ce|t_cl|t_cm|t_Co|t_cs|t_Cs|t_CS|t_CV|t_da|t_db|t_dl|t_DL|t_EI|t_F1|t_F2|t_F3|t_F4|t_F5|t_F6|t_F7|t_F8|t_F9|t_fs|t_IE|t_IS|t_k1|t_K1|t_k2|t_k3|t_K3|t_k4|t_K4|t_k5|t_K5|t_k6|t_K6|t_k7|t_K7|t_k8|t_K8|t_k9|t_K9|t_KA|t_kb|t_kB|t_KB|t_KC|t_kd|t_kD|t_KD|t_ke|t_KE|t_KF|t_KG|t_kh|t_KH|t_kI|t_KI|t_KJ|t_KK|t_kl|t_KL|t_kN|t_kP|t_kr|t_ks|t_ku|t_le|t_mb|t_md|t_me|t_mr|t_ms|t_nd|t_op|t_RI|t_RV|t_Sb|t_se|t_Sf|t_SI|t_so|t_sr|t_te|t_ti|t_ts|t_ue|t_us|t_ut|t_vb|t_ve|t_vi|t_vs|t_WP|t_WS|t_xs|t_ZH|t_ZR)\b/,number:/\b(?:0x[\da-f]+|\d+(?:\.\d+)?)\b/i,operator:/\|\||&&|[-+.]=?|[=!](?:[=~][#?]?)?|[<>]=?[#?]?|[*\/%?]|\b(?:is(?:not)?)\b/,punctuation:/[{}[\](),;:]/}}e.exports=t,t.displayName="vim",t.aliases=[]},46215(e){"use strict";function t(e){e.languages["visual-basic"]={comment:{pattern:/(?:['‘’]|REM\b)(?:[^\r\n_]|_(?:\r\n?|\n)?)*/i,inside:{keyword:/^REM/i}},directive:{pattern:/#(?:Const|Else|ElseIf|End|ExternalChecksum|ExternalSource|If|Region)(?:[^\S\r\n]_[^\S\r\n]*(?:\r\n?|\n)|.)+/i,alias:"comment",greedy:!0},string:{pattern:/\$?["“”](?:["“”]{2}|[^"“”])*["“”]C?/i,greedy:!0},date:{pattern:/#[^\S\r\n]*(?:\d+([/-])\d+\1\d+(?:[^\S\r\n]+(?:\d+[^\S\r\n]*(?:AM|PM)|\d+:\d+(?::\d+)?(?:[^\S\r\n]*(?:AM|PM))?))?|\d+[^\S\r\n]*(?:AM|PM)|\d+:\d+(?::\d+)?(?:[^\S\r\n]*(?:AM|PM))?)[^\S\r\n]*#/i,alias:"builtin"},number:/(?:(?:\b\d+(?:\.\d+)?|\.\d+)(?:E[+-]?\d+)?|&[HO][\dA-F]+)(?:U?[ILS]|[FRD])?/i,boolean:/\b(?:True|False|Nothing)\b/i,keyword:/\b(?:AddHandler|AddressOf|Alias|And(?:Also)?|As|Boolean|ByRef|Byte|ByVal|Call|Case|Catch|C(?:Bool|Byte|Char|Date|Dbl|Dec|Int|Lng|Obj|SByte|Short|Sng|Str|Type|UInt|ULng|UShort)|Char|Class|Const|Continue|Currency|Date|Decimal|Declare|Default|Delegate|Dim|DirectCast|Do|Double|Each|Else(?:If)?|End(?:If)?|Enum|Erase|Error|Event|Exit|Finally|For|Friend|Function|Get(?:Type|XMLNamespace)?|Global|GoSub|GoTo|Handles|If|Implements|Imports|In|Inherits|Integer|Interface|Is|IsNot|Let|Lib|Like|Long|Loop|Me|Mod|Module|Must(?:Inherit|Override)|My(?:Base|Class)|Namespace|Narrowing|New|Next|Not(?:Inheritable|Overridable)?|Object|Of|On|Operator|Option(?:al)?|Or(?:Else)?|Out|Overloads|Overridable|Overrides|ParamArray|Partial|Private|Property|Protected|Public|RaiseEvent|ReadOnly|ReDim|RemoveHandler|Resume|Return|SByte|Select|Set|Shadows|Shared|short|Single|Static|Step|Stop|String|Structure|Sub|SyncLock|Then|Throw|To|Try|TryCast|Type|TypeOf|U(?:Integer|Long|Short)|Using|Variant|Wend|When|While|Widening|With(?:Events)?|WriteOnly|Until|Xor)\b/i,operator:[/[+\-*/\\^<=>&#@$%!]/,{pattern:/([^\S\r\n])_(?=[^\S\r\n]*[\r\n])/,lookbehind:!0}],punctuation:/[{}().,:?]/},e.languages.vb=e.languages["visual-basic"],e.languages.vba=e.languages["visual-basic"]}e.exports=t,t.displayName="visualBasic",t.aliases=[]},10784(e){"use strict";function t(e){e.languages.warpscript={comment:/#.*|\/\/.*|\/\*[\s\S]*?\*\//,string:{pattern:/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'|<'(?:[^\\']|'(?!>)|\\.)*'>/,greedy:!0},variable:/\$\S+/,macro:{pattern:/@\S+/,alias:"property"},keyword:/\b(?:BREAK|CHECKMACRO|CONTINUE|CUDF|DEFINED|DEFINEDMACRO|EVAL|FAIL|FOR|FOREACH|FORSTEP|IFT|IFTE|MSGFAIL|NRETURN|RETHROW|RETURN|SWITCH|TRY|UDF|UNTIL|WHILE)\b/,number:/[+-]?\b(?:NaN|Infinity|\d+(?:\.\d*)?(?:[Ee][+-]?\d+)?|0x[\da-fA-F]+|0b[01]+)\b/,boolean:/\b(?:false|true|F|T)\b/,punctuation:/<%|%>|[{}[\]()]/,operator:/==|&&?|\|\|?|\*\*?|>>>?|<<|[<>!~]=?|[-/%^]|\+!?|\b(?:AND|NOT|OR)\b/}}e.exports=t,t.displayName="warpscript",t.aliases=[]},17684(e){"use strict";function t(e){e.languages.wasm={comment:[/\(;[\s\S]*?;\)/,{pattern:/;;.*/,greedy:!0}],string:{pattern:/"(?:\\[\s\S]|[^"\\])*"/,greedy:!0},keyword:[{pattern:/\b(?:align|offset)=/,inside:{operator:/=/}},{pattern:/\b(?:(?:f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))?|memory\.(?:grow|size))\b/,inside:{punctuation:/\./}},/\b(?:anyfunc|block|br(?:_if|_table)?|call(?:_indirect)?|data|drop|elem|else|end|export|func|get_(?:global|local)|global|if|import|local|loop|memory|module|mut|nop|offset|param|result|return|select|set_(?:global|local)|start|table|tee_local|then|type|unreachable)\b/],variable:/\$[\w!#$%&'*+\-./:<=>?@\\^`|~]+/i,number:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/,punctuation:/[()]/}}e.exports=t,t.displayName="wasm",t.aliases=[]},18191(e){"use strict";function t(e){e.languages.wiki=e.languages.extend("markup",{"block-comment":{pattern:/(^|[^\\])\/\*[\s\S]*?\*\//,lookbehind:!0,alias:"comment"},heading:{pattern:/^(=+)[^=\r\n].*?\1/m,inside:{punctuation:/^=+|=+$/,important:/.+/}},emphasis:{pattern:/('{2,5}).+?\1/,inside:{"bold-italic":{pattern:/(''''').+?(?=\1)/,lookbehind:!0,alias:["bold","italic"]},bold:{pattern:/(''')[^'](?:.*?[^'])?(?=\1)/,lookbehind:!0},italic:{pattern:/('')[^'](?:.*?[^'])?(?=\1)/,lookbehind:!0},punctuation:/^''+|''+$/}},hr:{pattern:/^-{4,}/m,alias:"punctuation"},url:[/ISBN +(?:97[89][ -]?)?(?:\d[ -]?){9}[\dx]\b|(?:RFC|PMID) +\d+/i,/\[\[.+?\]\]|\[.+?\]/],variable:[/__[A-Z]+__/,/\{{3}.+?\}{3}/,/\{\{.+?\}\}/],symbol:[/^#redirect/im,/~{3,5}/],"table-tag":{pattern:/((?:^|[|!])[|!])[^|\r\n]+\|(?!\|)/m,lookbehind:!0,inside:{"table-bar":{pattern:/\|$/,alias:"punctuation"},rest:e.languages.markup.tag.inside}},punctuation:/^(?:\{\||\|\}|\|-|[*#:;!|])|\|\||!!/m}),e.languages.insertBefore("wiki","tag",{nowiki:{pattern:/<(nowiki|pre|source)\b[^>]*>[\s\S]*?<\/\1>/i,inside:{tag:{pattern:/<(?:nowiki|pre|source)\b[^>]*>|<\/(?:nowiki|pre|source)>/i,inside:e.languages.markup.tag.inside}}}})}e.exports=t,t.displayName="wiki",t.aliases=[]},75242(e){"use strict";function t(e){e.languages.wolfram={comment:/\(\*(?:\(\*(?:[^*]|\*(?!\)))*\*\)|(?!\(\*)[\s\S])*?\*\)/,string:{pattern:/"(?:\\.|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:Abs|AbsArg|Accuracy|Block|Do|For|Function|If|Manipulate|Module|Nest|NestList|None|Return|Switch|Table|Which|While)\b/,context:{pattern:/\w+`+\w*/,alias:"class-name"},blank:{pattern:/\b\w+_\b/,alias:"regex"},"global-variable":{pattern:/\$\w+/,alias:"variable"},boolean:/\b(?:True|False)\b/,number:/(?:\b(?=\d)|\B(?=\.))(?:0[bo])?(?:(?:\d|0x[\da-f])[\da-f]*(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?j?\b/i,operator:/\/\.|;|=\.|\^=|\^:=|:=|<<|>>|<\||\|>|:>|\|->|->|<-|@@@|@@|@|\/@|=!=|===|==|=|\+|-|\^|\[\/-+%=\]=?|!=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[\|{}[\];(),.:]/},e.languages.mathematica=e.languages.wolfram,e.languages.wl=e.languages.wolfram,e.languages.nb=e.languages.wolfram}e.exports=t,t.displayName="wolfram",t.aliases=["mathematica","wl","nb"]},97202(e){"use strict";function t(e){var t;(t=e).languages.xeora=t.languages.extend("markup",{constant:{pattern:/\$(?:DomainContents|PageRenderDuration)\$/,inside:{punctuation:{pattern:/\$/}}},variable:{pattern:/\$@?(?:#+|[-+*~=^])?[\w.]+\$/,inside:{punctuation:{pattern:/[$.]/},operator:{pattern:/#+|[-+*~=^@]/}}},"function-inline":{pattern:/\$F:[-\w.]+\?[-\w.]+(?:,(?:(?:@[-#]*\w+\.[\w+.]\.*)*\|)*(?:(?:[\w+]|[-#*.~^]+[\w+]|=\S)(?:[^$=]|=+[^=])*=*|(?:@[-#]*\w+\.[\w+.]\.*)+(?:(?:[\w+]|[-#*~^][-#*.~^]*[\w+]|=\S)(?:[^$=]|=+[^=])*=*)?)?)?\$/,inside:{variable:{pattern:/(?:[,|])@?(?:#+|[-+*~=^])?[\w.]+/,inside:{punctuation:{pattern:/[,.|]/},operator:{pattern:/#+|[-+*~=^@]/}}},punctuation:{pattern:/\$\w:|[$:?.,|]/}},alias:"function"},"function-block":{pattern:/\$XF:\{[-\w.]+\?[-\w.]+(?:,(?:(?:@[-#]*\w+\.[\w+.]\.*)*\|)*(?:(?:[\w+]|[-#*.~^]+[\w+]|=\S)(?:[^$=]|=+[^=])*=*|(?:@[-#]*\w+\.[\w+.]\.*)+(?:(?:[\w+]|[-#*~^][-#*.~^]*[\w+]|=\S)(?:[^$=]|=+[^=])*=*)?)?)?\}:XF\$/,inside:{punctuation:{pattern:/[$:{}?.,|]/}},alias:"function"},"directive-inline":{pattern:/\$\w(?:#\d+\+?)?(?:\[[-\w.]+\])?:[-\/\w.]+\$/,inside:{punctuation:{pattern:/\$(?:\w:|C(?:\[|#\d))?|[:{[\]]/,inside:{tag:{pattern:/#\d/}}}},alias:"function"},"directive-block-open":{pattern:/\$\w+:\{|\$\w(?:#\d+\+?)?(?:\[[-\w.]+\])?:[-\w.]+:\{(?:![A-Z]+)?/,inside:{punctuation:{pattern:/\$(?:\w:|C(?:\[|#\d))?|[:{[\]]/,inside:{tag:{pattern:/#\d/}}},attribute:{pattern:/![A-Z]+$/,inside:{punctuation:{pattern:/!/}},alias:"keyword"}},alias:"function"},"directive-block-separator":{pattern:/\}:[-\w.]+:\{/,inside:{punctuation:{pattern:/[:{}]/}},alias:"function"},"directive-block-close":{pattern:/\}:[-\w.]+\$/,inside:{punctuation:{pattern:/[:{}$]/}},alias:"function"}}),t.languages.insertBefore("inside","punctuation",{variable:t.languages.xeora["function-inline"].inside.variable},t.languages.xeora["function-block"]),t.languages.xeoracube=t.languages.xeora}e.exports=t,t.displayName="xeora",t.aliases=["xeoracube"]},13808(e){"use strict";function t(e){!function(e){function t(t,n){e.languages[t]&&e.languages.insertBefore(t,"comment",{"doc-comment":n})}var n=e.languages.markup.tag,r={pattern:/\/\/\/.*/,greedy:!0,alias:"comment",inside:{tag:n}},i={pattern:/'''.*/,greedy:!0,alias:"comment",inside:{tag:n}};t("csharp",r),t("fsharp",r),t("vbnet",i)}(e)}e.exports=t,t.displayName="xmlDoc",t.aliases=[]},21301(e){"use strict";function t(e){e.languages.xojo={comment:{pattern:/(?:'|\/\/|Rem\b).+/i},string:{pattern:/"(?:""|[^"])*"/,greedy:!0},number:[/(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:E[+-]?\d+)?/i,/&[bchou][a-z\d]+/i],symbol:/#(?:If|Else|ElseIf|Endif|Pragma)\b/i,keyword:/\b(?:AddHandler|App|Array|As(?:signs)?|Auto|By(?:Ref|Val)|Boolean|Break|Byte|Call|Case|Catch|CFStringRef|CGFloat|Class|Color|Const|Continue|CString|Currency|CurrentMethodName|Declare|Delegate|Dim|Do(?:uble|wnTo)?|Each|Else(?:If)?|End|Enumeration|Event|Exception|Exit|Extends|False|Finally|For|Function|Get|GetTypeInfo|Global|GOTO|If|Implements|In|Inherits|Int(?:erface|eger|8|16|32|64)?|Lib|Loop|Me|Module|Next|Nil|Object|Optional|OSType|ParamArray|Private|Property|Protected|PString|Ptr|Raise(?:Event)?|ReDim|RemoveHandler|Return|Select(?:or)?|Self|Set|Single|Shared|Short|Soft|Static|Step|String|Sub|Super|Text|Then|To|True|Try|Ubound|UInt(?:eger|8|16|32|64)?|Until|Using|Var(?:iant)?|Wend|While|WindowPtr|WString)\b/i,operator:/<[=>]?|>=?|[+\-*\/\\^=]|\b(?:AddressOf|And|Ctype|IsA?|Mod|New|Not|Or|Xor|WeakAddressOf)\b/i,punctuation:/[.,;:()]/}}e.exports=t,t.displayName="xojo",t.aliases=[]},20349(e){"use strict";function t(e){var t,n,r;(t=e).languages.xquery=t.languages.extend("markup",{"xquery-comment":{pattern:/\(:[\s\S]*?:\)/,greedy:!0,alias:"comment"},string:{pattern:/(["'])(?:\1\1|(?!\1)[\s\S])*\1/,greedy:!0},extension:{pattern:/\(#.+?#\)/,alias:"symbol"},variable:/\$[-\w:]+/,axis:{pattern:/(^|[^-])(?:ancestor(?:-or-self)?|attribute|child|descendant(?:-or-self)?|following(?:-sibling)?|parent|preceding(?:-sibling)?|self)(?=::)/,lookbehind:!0,alias:"operator"},"keyword-operator":{pattern:/(^|[^:-])\b(?:and|castable as|div|eq|except|ge|gt|idiv|instance of|intersect|is|le|lt|mod|ne|or|union)\b(?=$|[^:-])/,lookbehind:!0,alias:"operator"},keyword:{pattern:/(^|[^:-])\b(?:as|ascending|at|base-uri|boundary-space|case|cast as|collation|construction|copy-namespaces|declare|default|descending|else|empty (?:greatest|least)|encoding|every|external|for|function|if|import|in|inherit|lax|let|map|module|namespace|no-inherit|no-preserve|option|order(?: by|ed|ing)?|preserve|return|satisfies|schema|some|stable|strict|strip|then|to|treat as|typeswitch|unordered|validate|variable|version|where|xquery)\b(?=$|[^:-])/,lookbehind:!0},function:/[\w-]+(?::[\w-]+)*(?=\s*\()/,"xquery-element":{pattern:/(element\s+)[\w-]+(?::[\w-]+)*/,lookbehind:!0,alias:"tag"},"xquery-attribute":{pattern:/(attribute\s+)[\w-]+(?::[\w-]+)*/,lookbehind:!0,alias:"attr-name"},builtin:{pattern:/(^|[^:-])\b(?:attribute|comment|document|element|processing-instruction|text|xs:(?:anyAtomicType|anyType|anyURI|base64Binary|boolean|byte|date|dateTime|dayTimeDuration|decimal|double|duration|ENTITIES|ENTITY|float|gDay|gMonth|gMonthDay|gYear|gYearMonth|hexBinary|ID|IDREFS?|int|integer|language|long|Name|NCName|negativeInteger|NMTOKENS?|nonNegativeInteger|nonPositiveInteger|normalizedString|NOTATION|positiveInteger|QName|short|string|time|token|unsigned(?:Byte|Int|Long|Short)|untyped(?:Atomic)?|yearMonthDuration))\b(?=$|[^:-])/,lookbehind:!0},number:/\b\d+(?:\.\d+)?(?:E[+-]?\d+)?/,operator:[/[+*=?|@]|\.\.?|:=|!=|<[=<]?|>[=>]?/,{pattern:/(\s)-(?=\s)/,lookbehind:!0}],punctuation:/[[\](){},;:/]/}),t.languages.xquery.tag.pattern=/<\/?(?!\d)[^\s>\/=$<%]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\[\s\S]|\{(?!\{)(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])+\}|(?!\1)[^\\])*\1|[^\s'">=]+))?)*\s*\/?>/i,t.languages.xquery.tag.inside["attr-value"].pattern=/=(?:("|')(?:\\[\s\S]|\{(?!\{)(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])+\}|(?!\1)[^\\])*\1|[^\s'">=]+)/i,t.languages.xquery.tag.inside["attr-value"].inside.punctuation=/^="|"$/,t.languages.xquery.tag.inside["attr-value"].inside.expression={pattern:/\{(?!\{)(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])+\}/,inside:t.languages.xquery,alias:"language-xquery"},n=function(e){return"string"==typeof e?e:"string"==typeof e.content?e.content:e.content.map(n).join("")},r=function(e){for(var i=[],a=0;a0&&i[i.length-1].tagName===n(o.content[0].content[1])&&i.pop():"/>"===o.content[o.content.length-1].content||i.push({tagName:n(o.content[0].content[1]),openedBraces:0}):!(i.length>0)||"punctuation"!==o.type||"{"!==o.content||e[a+1]&&"punctuation"===e[a+1].type&&"{"===e[a+1].content||e[a-1]&&"plain-text"===e[a-1].type&&"{"===e[a-1].content?i.length>0&&i[i.length-1].openedBraces>0&&"punctuation"===o.type&&"}"===o.content?i[i.length-1].openedBraces--:"comment"!==o.type&&(s=!0):i[i.length-1].openedBraces++),(s||"string"==typeof o)&&i.length>0&&0===i[i.length-1].openedBraces){var u=n(o);a0&&("string"==typeof e[a-1]||"plain-text"===e[a-1].type)&&(u=n(e[a-1])+u,e.splice(a-1,1),a--),/^\s+$/.test(u)?e[a]=u:e[a]=new t.Token("plain-text",u,null,u)}o.content&&"string"!=typeof o.content&&r(o.content)}},t.hooks.add("after-tokenize",function(e){"xquery"===e.language&&r(e.tokens)})}e.exports=t,t.displayName="xquery",t.aliases=[]},65039(e){"use strict";function t(e){!function(e){var t=/[*&][^\s[\]{},]+/,n=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,r="(?:"+n.source+"(?:[ ]+"+t.source+")?|"+t.source+"(?:[ ]+"+n.source+")?)",i=/(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-])(?:[ \t]*(?:(?![#:])|:))*/.source.replace(//g,function(){return/[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source}),a=/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;function o(e,t){return t=(t||"").replace(/m/g,"")+"m",RegExp(/([:\-,[{]\s*(?:\s<>[ \t]+)?)(?:<>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<>/g,function(){return r}).replace(/<>/g,function(){return e}),t)}e.languages.yaml={scalar:{pattern:RegExp(/([\-:]\s*(?:\s<>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<>/g,function(){return r})),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<>[ \t]+)?)<>(?=\s*:\s)/.source.replace(/<>/g,function(){return r}).replace(/<>/g,function(){return"(?:"+i+"|"+a+")"})),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:o(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),lookbehind:!0,alias:"number"},boolean:{pattern:o(/true|false/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:o(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:o(a),lookbehind:!0,greedy:!0},number:{pattern:o(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source,"i"),lookbehind:!0},tag:n,important:t,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},e.languages.yml=e.languages.yaml}(e)}e.exports=t,t.displayName="yaml",t.aliases=["yml"]},80741(e){"use strict";function t(e){e.languages.yang={comment:/\/\*[\s\S]*?\*\/|\/\/.*/,string:{pattern:/"(?:[^\\"]|\\.)*"|'[^']*'/,greedy:!0},keyword:{pattern:/(^|[{};\r\n][ \t]*)[a-z_][\w.-]*/i,lookbehind:!0},namespace:{pattern:/(\s)[a-z_][\w.-]*(?=:)/i,lookbehind:!0},boolean:/\b(?:false|true)\b/,operator:/\+/,punctuation:/[{};:]/}}e.exports=t,t.displayName="yang",t.aliases=[]},86528(e){"use strict";function t(e){!function(e){function t(e){return function(){return e}}var n=/\b(?:align|allowzero|and|asm|async|await|break|cancel|catch|comptime|const|continue|defer|else|enum|errdefer|error|export|extern|fn|for|if|inline|linksection|nakedcc|noalias|null|or|orelse|packed|promise|pub|resume|return|stdcallcc|struct|suspend|switch|test|threadlocal|try|undefined|union|unreachable|usingnamespace|var|volatile|while)\b/,r="\\b(?!"+n.source+")(?!\\d)\\w+\\b",i=/align\s*\((?:[^()]|\([^()]*\))*\)/.source,a=/(?:\?|\bpromise->|(?:\[[^[\]]*\]|\*(?!\*)|\*\*)(?:\s*|\s*const\b|\s*volatile\b|\s*allowzero\b)*)/.source.replace(//g,t(i)),o=/(?:\bpromise\b|(?:\berror\.)?(?:\.)*(?!\s+))/.source.replace(//g,t(r)),s="(?!\\s)(?:!?\\s*(?:"+a+"\\s*)*"+o+")+";e.languages.zig={comment:[{pattern:/\/{3}.*/,alias:"doc-comment"},/\/{2}.*/],string:[{pattern:/(^|[^\\@])c?"(?:[^"\\\r\n]|\\.)*"/,lookbehind:!0,greedy:!0},{pattern:/([\r\n])([ \t]+c?\\{2}).*(?:(?:\r\n?|\n)\2.*)*/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\])'(?:[^'\\\r\n]|\\(?:.|x[a-fA-F\d]{2}|u\{[a-fA-F\d]{1,6}\}))'/,lookbehind:!0,greedy:!0}],builtin:/\B@(?!\d)\w+(?=\s*\()/,label:{pattern:/(\b(?:break|continue)\s*:\s*)\w+\b|\b(?!\d)\w+\b(?=\s*:\s*(?:\{|while\b))/,lookbehind:!0},"class-name":[/\b(?!\d)\w+(?=\s*=\s*(?:(?:extern|packed)\s+)?(?:enum|struct|union)\s*[({])/,{pattern:RegExp(/(:\s*)(?=\s*(?:\s*)?[=;,)])|(?=\s*(?:\s*)?\{)/.source.replace(//g,t(s)).replace(//g,t(i))),lookbehind:!0,inside:null},{pattern:RegExp(/(\)\s*)(?=\s*(?:\s*)?;)/.source.replace(//g,t(s)).replace(//g,t(i))),lookbehind:!0,inside:null}],"builtin-types":{pattern:/\b(?:anyerror|bool|c_u?(?:short|int|long|longlong)|c_longdouble|c_void|comptime_(?:float|int)|[iu](?:8|16|32|64|128|size)|f(?:16|32|64|128)|noreturn|type|void)\b/,alias:"keyword"},keyword:n,function:/\b(?!\d)\w+(?=\s*\()/,number:/\b(?:0b[01]+|0o[0-7]+|0x[a-fA-F\d]+(?:\.[a-fA-F\d]*)?(?:[pP][+-]?[a-fA-F\d]+)?|\d+(?:\.\d*)?(?:[eE][+-]?\d+)?)\b/,boolean:/\b(?:false|true)\b/,operator:/\.[*?]|\.{2,3}|[-=]>|\*\*|\+\+|\|\||(?:<<|>>|[-+*]%|[-+*/%^&|<>!=])=?|[?~]/,punctuation:/[.:,;(){}[\]]/},e.languages.zig["class-name"].forEach(function(t){null===t.inside&&(t.inside=e.languages.zig)})}(e)}e.exports=t,t.displayName="zig",t.aliases=[]},59216(e,t,n){var r=function(e){var t=/\blang(?:uage)?-([\w-]+)\b/i,n=0,r={},i={manual:e.Prism&&e.Prism.manual,disableWorkerMessageHandler:e.Prism&&e.Prism.disableWorkerMessageHandler,util:{encode:function e(t){return t instanceof a?new a(t.type,e(t.content),t.alias):Array.isArray(t)?t.map(e):t.replace(/&/g,"&").replace(/=f.reach));S+=E.value.length,E=E.next){var k,x=E.value;if(t.length>e.length)return;if(!(x instanceof a)){var T=1;if(v){if(!(k=o(_,S,e,g)))break;var M=k.index,O=k.index+k[0].length,A=S;for(A+=E.value.length;M>=A;)A+=(E=E.next).value.length;if(A-=E.value.length,S=A,E.value instanceof a)continue;for(var L=E;L!==t.tail&&(Af.reach&&(f.reach=N);var P=E.prev;I&&(P=c(t,P,I),S+=I.length),l(t,P,T);var R=new a(d,m?i.tokenize(C,m):C,y,C);if(E=c(t,P,R),D&&c(t,E,D),T>1){var j={cause:d+","+p,reach:N};s(e,t,n,E.prev,S,j),f&&j.reach>f.reach&&(f.reach=j.reach)}}}}}}function u(){var e={value:null,prev:null,next:null},t={value:null,prev:e,next:null};e.next=t,this.head=e,this.tail=t,this.length=0}function c(e,t,n){var r=t.next,i={value:n,prev:t,next:r};return t.next=i,r.prev=i,e.length++,i}function l(e,t,n){for(var r=t.next,i=0;i"+a.content+""},!e.document)return e.addEventListener&&(i.disableWorkerMessageHandler||e.addEventListener("message",function(t){var n=JSON.parse(t.data),r=n.language,a=n.code,o=n.immediateClose;e.postMessage(i.highlight(a,i.languages[r],r)),o&&e.close()},!1)),i;var d=i.util.currentScript();function h(){i.manual||i.highlightAll()}if(d&&(i.filename=d.src,d.hasAttribute("data-manual")&&(i.manual=!0)),!i.manual){var p=document.readyState;"loading"===p||"interactive"===p&&d&&d.defer?document.addEventListener("DOMContentLoaded",h):window.requestAnimationFrame?window.requestAnimationFrame(h):window.setTimeout(h,16)}return i}("undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{});e.exports&&(e.exports=r),void 0!==n.g&&(n.g.Prism=r)},60053(e,t){"use strict";if(/** @license React v0.18.0 + * scheduler.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ Object.defineProperty(t,"__esModule",{value:!0}),"undefined"==typeof window||"function"!=typeof MessageChannel){var n,r,i,a,o,s=null,u=null,c=function(){if(null!==s)try{var e=t.unstable_now();s(!0,e),s=null}catch(n){throw setTimeout(c,0),n}},l=Date.now();t.unstable_now=function(){return Date.now()-l},n=function(e){null!==s?setTimeout(n,0,e):(s=e,setTimeout(c,0))},r=function(e,t){u=setTimeout(e,t)},i=function(){clearTimeout(u)},a=function(){return!1},o=t.unstable_forceFrameRate=function(){}}else{var f=window.performance,d=window.Date,h=window.setTimeout,p=window.clearTimeout;if("undefined"!=typeof console){var b=window.cancelAnimationFrame;"function"!=typeof window.requestAnimationFrame&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills"),"function"!=typeof b&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills")}if("object"==typeof f&&"function"==typeof f.now)t.unstable_now=function(){return f.now()};else{var m=d.now();t.unstable_now=function(){return d.now()-m}}var g=!1,v=null,y=-1,w=5,_=0;a=function(){return t.unstable_now()>=_},o=function(){},t.unstable_forceFrameRate=function(e){0>e||125M(o,n))void 0!==u&&0>M(u,o)?(e[r]=u,e[s]=n,r=s):(e[r]=o,e[a]=n,r=a);else if(void 0!==u&&0>M(u,n))e[r]=u,e[s]=n,r=s;else break a}}return t}return null}function M(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}var O=[],A=[],L=1,C=null,I=3,D=!1,N=!1,P=!1;function R(e){for(var t=x(A);null!==t;){if(null===t.callback)T(A);else if(t.startTime<=e)T(A),t.sortIndex=t.expirationTime,k(O,t);else break;t=x(A)}}function j(e){if(P=!1,R(e),!N){if(null!==x(O))N=!0,n(F);else{var t=x(A);null!==t&&r(j,t.startTime-e)}}}function F(e,n){N=!1,P&&(P=!1,i()),D=!0;var o=I;try{for(R(n),C=x(O);null!==C&&(!(C.expirationTime>n)||e&&!a());){var s=C.callback;if(null!==s){C.callback=null,I=C.priorityLevel;var u=s(C.expirationTime<=n);n=t.unstable_now(),"function"==typeof u?C.callback=u:C===x(O)&&T(O),R(n)}else T(O);C=x(O)}if(null!==C)var c=!0;else{var l=x(A);null!==l&&r(j,l.startTime-n),c=!1}return c}finally{C=null,I=o,D=!1}}function Y(e){switch(e){case 1:return -1;case 2:return 250;case 5:return 1073741823;case 4:return 1e4;default:return 5e3}}var B=o;t.unstable_ImmediatePriority=1,t.unstable_UserBlockingPriority=2,t.unstable_NormalPriority=3,t.unstable_IdlePriority=5,t.unstable_LowPriority=4,t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=I;I=e;try{return t()}finally{I=n}},t.unstable_next=function(e){switch(I){case 1:case 2:case 3:var t=3;break;default:t=I}var n=I;I=t;try{return e()}finally{I=n}},t.unstable_scheduleCallback=function(e,a,o){var s=t.unstable_now();if("object"==typeof o&&null!==o){var u=o.delay;u="number"==typeof u&&0s?(e.sortIndex=u,k(A,e),null===x(O)&&e===x(A)&&(P?i():P=!0,r(j,u-s))):(e.sortIndex=o,k(O,e),N||D||(N=!0,n(F))),e},t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_wrapCallback=function(e){var t=I;return function(){var n=I;I=t;try{return e.apply(this,arguments)}finally{I=n}}},t.unstable_getCurrentPriorityLevel=function(){return I},t.unstable_shouldYield=function(){var e=t.unstable_now();R(e);var n=x(O);return n!==C&&null!==C&&null!==n&&null!==n.callback&&n.startTime<=e&&n.expirationTime>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function c(e,t,n){var r=t.length-1;if(r=0?(i>0&&(e.lastNeed=i-1),i):--r=0?(i>0&&(e.lastNeed=i-2),i):--r=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0}function l(e,t,n){if((192&t[0])!=128)return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if((192&t[1])!=128)return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&(192&t[2])!=128)return e.lastNeed=2,"�"}}function f(e){var t=this.lastTotal-this.lastNeed,n=l(this,e,t);return void 0!==n?n:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):void(e.copy(this.lastChar,t,0,e.length),this.lastNeed-=e.length)}function d(e,t){var n=c(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=n;var r=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString("utf8",t,r)}function h(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t}function p(e,t){if((e.length-t)%2==0){var n=e.toString("utf16le",t);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function b(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,n)}return t}function m(e,t){var n=(e.length-t)%3;return 0===n?e.toString("base64",t):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-n))}function g(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function v(e){return e.toString(this.encoding)}function y(e){return e&&e.length?this.write(e):""}t.s=s,s.prototype.write=function(e){var t,n;if(0===e.length)return"";if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n */ var r=n(48764),i=r.Buffer;function a(e,t){for(var n in e)t[n]=e[n]}function o(e,t,n){return i(e,t,n)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=r:(a(r,t),t.Buffer=o),o.prototype=Object.create(i.prototype),a(i,o),o.from=function(e,t,n){if("number"==typeof e)throw TypeError("Argument must not be a number");return i(e,t,n)},o.alloc=function(e,t,n){if("number"!=typeof e)throw TypeError("Argument must be a number");var r=i(e);return void 0!==t?"string"==typeof n?r.fill(t,n):r.fill(t):r.fill(0),r},o.allocUnsafe=function(e){if("number"!=typeof e)throw TypeError("Argument must be a number");return i(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw TypeError("Argument must be a number");return r.SlowBuffer(e)}},93379(e,t,n){"use strict";var r,i,a=function(){return void 0===r&&(r=Boolean(window&&document&&document.all&&!window.atob)),r},o=(i={},function(e){if(void 0===i[e]){var t=document.querySelector(e);if(window.HTMLIFrameElement&&t instanceof window.HTMLIFrameElement)try{t=t.contentDocument.head}catch(n){t=null}i[e]=t}return i[e]}),s=[];function u(e){for(var t=-1,n=0;nOq});var r,i,a,o,s,u,c,l=n(67294),f=n.t(l,2),d=n(39814),h=n(5977),p=n(57209),b=n(32316),m=n(95880),g=n(17051),v=n(71381),y=n(81701),w=n(3022),_=n(60323),E=n(87591),S=n(25649),k=n(28902),x=n(71426),T=n(48884),M=n(94184),O=n.n(M),A=n(37703),L=n(73935),C=function(){if("undefined"!=typeof Map)return Map;function e(e,t){var n=-1;return e.some(function(e,r){return e[0]===t&&(n=r,!0)}),n}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(t){var n=e(this.__entries__,t),r=this.__entries__[n];return r&&r[1]},t.prototype.set=function(t,n){var r=e(this.__entries__,t);~r?this.__entries__[r][1]=n:this.__entries__.push([t,n])},t.prototype.delete=function(t){var n=this.__entries__,r=e(n,t);~r&&n.splice(r,1)},t.prototype.has=function(t){return!!~e(this.__entries__,t)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(e,t){void 0===t&&(t=null);for(var n=0,r=this.__entries__;n0},e.prototype.connect_=function(){I&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),Y?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){I&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(e){var t=e.propertyName,n=void 0===t?"":t;F.some(function(e){return!!~n.indexOf(e)})&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),U=function(e,t){for(var n=0,r=Object.keys(t);n0},e}(),er="undefined"!=typeof WeakMap?new WeakMap:new C,ei=function(){function e(t){if(!(this instanceof e))throw TypeError("Cannot call a class as a function.");if(!arguments.length)throw TypeError("1 argument required, but only 0 present.");var n=B.getInstance(),r=new en(t,n,this);er.set(this,r)}return e}();["observe","unobserve","disconnect"].forEach(function(e){ei.prototype[e]=function(){var t;return(t=er.get(this))[e].apply(t,arguments)}});var ea=void 0!==D.ResizeObserver?D.ResizeObserver:ei;let eo=ea;var es=function(e){var t=[],n=null,r=function(){for(var r=arguments.length,i=Array(r),a=0;a=t||n<0||f&&r>=a}function g(){var e=eb();if(m(e))return v(e);s=setTimeout(g,b(e))}function v(e){return(s=void 0,d&&r)?h(e):(r=i=void 0,o)}function y(){void 0!==s&&clearTimeout(s),c=0,r=u=i=s=void 0}function w(){return void 0===s?o:v(eb())}function _(){var e=eb(),n=m(e);if(r=arguments,i=this,u=e,n){if(void 0===s)return p(u);if(f)return clearTimeout(s),s=setTimeout(g,t),h(u)}return void 0===s&&(s=setTimeout(g,t)),o}return t=ez(t)||0,ed(n)&&(l=!!n.leading,a=(f="maxWait"in n)?eW(ez(n.maxWait)||0,t):a,d="trailing"in n?!!n.trailing:d),_.cancel=y,_.flush=w,_}let eq=eV;var eZ="Expected a function";function eX(e,t,n){var r=!0,i=!0;if("function"!=typeof e)throw TypeError(eZ);return ed(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),eq(e,t,{leading:r,maxWait:t,trailing:i})}let eJ=eX;var eQ={debounce:eq,throttle:eJ},e1=function(e){return eQ[e]},e0=function(e){return"function"==typeof e},e2=function(){return"undefined"==typeof window},e3=function(e){return e instanceof Element||e instanceof HTMLDocument};function e4(e){return(e4="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function e6(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function e5(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=Array(t);ne.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&l.createElement(tG.Z,{variant:"indeterminate",classes:r}))};tK.propTypes={fetchCount:el().number.isRequired};let tV=(0,b.withStyles)(tW)(tK);var tq=n(5536);let tZ=n.p+"ba8bbf16ebf8e1d05bef.svg";function tX(){return(tX=Object.assign||function(e){for(var t=1;t120){for(var d=Math.floor(u/80),h=u%80,p=[],b=0;b0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),null!=s&&s.stack)?(Object.defineProperty(nf(b),"stack",{value:s.stack,writable:!0,configurable:!0}),nl(b)):(Error.captureStackTrace?Error.captureStackTrace(nf(b),n):Object.defineProperty(nf(b),"stack",{value:Error().stack,writable:!0,configurable:!0}),b)}return ns(n,[{key:"toString",value:function(){return nw(this)}},{key:t4.YF,get:function(){return"Object"}}]),n}(nd(Error));function ny(e){return void 0===e||0===e.length?void 0:e}function nw(e){var t=e.message;if(e.nodes)for(var n=0,r=e.nodes;n",EOF:"",BANG:"!",DOLLAR:"$",AMP:"&",PAREN_L:"(",PAREN_R:")",SPREAD:"...",COLON:":",EQUALS:"=",AT:"@",BRACKET_L:"[",BRACKET_R:"]",BRACE_L:"{",PIPE:"|",BRACE_R:"}",NAME:"Name",INT:"Int",FLOAT:"Float",STRING:"String",BLOCK_STRING:"BlockString",COMMENT:"Comment"}),nx=n(10143),nT=Object.freeze({QUERY:"QUERY",MUTATION:"MUTATION",SUBSCRIPTION:"SUBSCRIPTION",FIELD:"FIELD",FRAGMENT_DEFINITION:"FRAGMENT_DEFINITION",FRAGMENT_SPREAD:"FRAGMENT_SPREAD",INLINE_FRAGMENT:"INLINE_FRAGMENT",VARIABLE_DEFINITION:"VARIABLE_DEFINITION",SCHEMA:"SCHEMA",SCALAR:"SCALAR",OBJECT:"OBJECT",FIELD_DEFINITION:"FIELD_DEFINITION",ARGUMENT_DEFINITION:"ARGUMENT_DEFINITION",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",ENUM_VALUE:"ENUM_VALUE",INPUT_OBJECT:"INPUT_OBJECT",INPUT_FIELD_DEFINITION:"INPUT_FIELD_DEFINITION"}),nM=n(87392),nO=function(){function e(e){var t=new nS.WU(nk.SOF,0,0,0,0,null);this.source=e,this.lastToken=t,this.token=t,this.line=1,this.lineStart=0}var t=e.prototype;return t.advance=function(){return this.lastToken=this.token,this.token=this.lookahead()},t.lookahead=function(){var e,t=this.token;if(t.kind!==nk.EOF)do t=null!==(e=t.next)&&void 0!==e?e:t.next=nC(this,t);while(t.kind===nk.COMMENT)return t},e}();function nA(e){return e===nk.BANG||e===nk.DOLLAR||e===nk.AMP||e===nk.PAREN_L||e===nk.PAREN_R||e===nk.SPREAD||e===nk.COLON||e===nk.EQUALS||e===nk.AT||e===nk.BRACKET_L||e===nk.BRACKET_R||e===nk.BRACE_L||e===nk.PIPE||e===nk.BRACE_R}function nL(e){return isNaN(e)?nk.EOF:e<127?JSON.stringify(String.fromCharCode(e)):'"\\u'.concat(("00"+e.toString(16).toUpperCase()).slice(-4),'"')}function nC(e,t){for(var n=e.source,r=n.body,i=r.length,a=t.end;a31||9===a))return new nS.WU(nk.COMMENT,t,s,n,r,i,o.slice(t+1,s))}function nN(e,t,n,r,i,a){var o=e.body,s=n,u=t,c=!1;if(45===s&&(s=o.charCodeAt(++u)),48===s){if((s=o.charCodeAt(++u))>=48&&s<=57)throw n_(e,u,"Invalid number, unexpected digit after 0: ".concat(nL(s),"."))}else u=nP(e,u,s),s=o.charCodeAt(u);if(46===s&&(c=!0,s=o.charCodeAt(++u),u=nP(e,u,s),s=o.charCodeAt(u)),(69===s||101===s)&&(c=!0,(43===(s=o.charCodeAt(++u))||45===s)&&(s=o.charCodeAt(++u)),u=nP(e,u,s),s=o.charCodeAt(u)),46===s||nU(s))throw n_(e,u,"Invalid number, expected digit but got: ".concat(nL(s),"."));return new nS.WU(c?nk.FLOAT:nk.INT,t,u,r,i,a,o.slice(t,u))}function nP(e,t,n){var r=e.body,i=t,a=n;if(a>=48&&a<=57){do a=r.charCodeAt(++i);while(a>=48&&a<=57)return i}throw n_(e,i,"Invalid number, expected digit but got: ".concat(nL(a),"."))}function nR(e,t,n,r,i){for(var a=e.body,o=t+1,s=o,u=0,c="";o=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function nB(e,t,n,r,i){for(var a=e.body,o=a.length,s=t+1,u=0;s!==o&&!isNaN(u=a.charCodeAt(s))&&(95===u||u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122);)++s;return new nS.WU(nk.NAME,t,s,n,r,i,a.slice(t,s))}function nU(e){return 95===e||e>=65&&e<=90||e>=97&&e<=122}function nH(e,t){return new n$(e,t).parseDocument()}var n$=function(){function e(e,t){var n=(0,nx.T)(e)?e:new nx.H(e);this._lexer=new nO(n),this._options=t}var t=e.prototype;return t.parseName=function(){var e=this.expectToken(nk.NAME);return{kind:nE.h.NAME,value:e.value,loc:this.loc(e)}},t.parseDocument=function(){var e=this._lexer.token;return{kind:nE.h.DOCUMENT,definitions:this.many(nk.SOF,this.parseDefinition,nk.EOF),loc:this.loc(e)}},t.parseDefinition=function(){if(this.peek(nk.NAME))switch(this._lexer.token.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"schema":case"scalar":case"type":case"interface":case"union":case"enum":case"input":case"directive":return this.parseTypeSystemDefinition();case"extend":return this.parseTypeSystemExtension()}else if(this.peek(nk.BRACE_L))return this.parseOperationDefinition();else if(this.peekDescription())return this.parseTypeSystemDefinition();throw this.unexpected()},t.parseOperationDefinition=function(){var e,t=this._lexer.token;if(this.peek(nk.BRACE_L))return{kind:nE.h.OPERATION_DEFINITION,operation:"query",name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet(),loc:this.loc(t)};var n=this.parseOperationType();return this.peek(nk.NAME)&&(e=this.parseName()),{kind:nE.h.OPERATION_DEFINITION,operation:n,name:e,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(t)}},t.parseOperationType=function(){var e=this.expectToken(nk.NAME);switch(e.value){case"query":return"query";case"mutation":return"mutation";case"subscription":return"subscription"}throw this.unexpected(e)},t.parseVariableDefinitions=function(){return this.optionalMany(nk.PAREN_L,this.parseVariableDefinition,nk.PAREN_R)},t.parseVariableDefinition=function(){var e=this._lexer.token;return{kind:nE.h.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(nk.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(nk.EQUALS)?this.parseValueLiteral(!0):void 0,directives:this.parseDirectives(!0),loc:this.loc(e)}},t.parseVariable=function(){var e=this._lexer.token;return this.expectToken(nk.DOLLAR),{kind:nE.h.VARIABLE,name:this.parseName(),loc:this.loc(e)}},t.parseSelectionSet=function(){var e=this._lexer.token;return{kind:nE.h.SELECTION_SET,selections:this.many(nk.BRACE_L,this.parseSelection,nk.BRACE_R),loc:this.loc(e)}},t.parseSelection=function(){return this.peek(nk.SPREAD)?this.parseFragment():this.parseField()},t.parseField=function(){var e,t,n=this._lexer.token,r=this.parseName();return this.expectOptionalToken(nk.COLON)?(e=r,t=this.parseName()):t=r,{kind:nE.h.FIELD,alias:e,name:t,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(nk.BRACE_L)?this.parseSelectionSet():void 0,loc:this.loc(n)}},t.parseArguments=function(e){var t=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(nk.PAREN_L,t,nk.PAREN_R)},t.parseArgument=function(){var e=this._lexer.token,t=this.parseName();return this.expectToken(nk.COLON),{kind:nE.h.ARGUMENT,name:t,value:this.parseValueLiteral(!1),loc:this.loc(e)}},t.parseConstArgument=function(){var e=this._lexer.token;return{kind:nE.h.ARGUMENT,name:this.parseName(),value:(this.expectToken(nk.COLON),this.parseValueLiteral(!0)),loc:this.loc(e)}},t.parseFragment=function(){var e=this._lexer.token;this.expectToken(nk.SPREAD);var t=this.expectOptionalKeyword("on");return!t&&this.peek(nk.NAME)?{kind:nE.h.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1),loc:this.loc(e)}:{kind:nE.h.INLINE_FRAGMENT,typeCondition:t?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(e)}},t.parseFragmentDefinition=function(){var e,t=this._lexer.token;return(this.expectKeyword("fragment"),(null===(e=this._options)||void 0===e?void 0:e.experimentalFragmentVariables)===!0)?{kind:nE.h.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(t)}:{kind:nE.h.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(t)}},t.parseFragmentName=function(){if("on"===this._lexer.token.value)throw this.unexpected();return this.parseName()},t.parseValueLiteral=function(e){var t=this._lexer.token;switch(t.kind){case nk.BRACKET_L:return this.parseList(e);case nk.BRACE_L:return this.parseObject(e);case nk.INT:return this._lexer.advance(),{kind:nE.h.INT,value:t.value,loc:this.loc(t)};case nk.FLOAT:return this._lexer.advance(),{kind:nE.h.FLOAT,value:t.value,loc:this.loc(t)};case nk.STRING:case nk.BLOCK_STRING:return this.parseStringLiteral();case nk.NAME:switch(this._lexer.advance(),t.value){case"true":return{kind:nE.h.BOOLEAN,value:!0,loc:this.loc(t)};case"false":return{kind:nE.h.BOOLEAN,value:!1,loc:this.loc(t)};case"null":return{kind:nE.h.NULL,loc:this.loc(t)};default:return{kind:nE.h.ENUM,value:t.value,loc:this.loc(t)}}case nk.DOLLAR:if(!e)return this.parseVariable()}throw this.unexpected()},t.parseStringLiteral=function(){var e=this._lexer.token;return this._lexer.advance(),{kind:nE.h.STRING,value:e.value,block:e.kind===nk.BLOCK_STRING,loc:this.loc(e)}},t.parseList=function(e){var t=this,n=this._lexer.token,r=function(){return t.parseValueLiteral(e)};return{kind:nE.h.LIST,values:this.any(nk.BRACKET_L,r,nk.BRACKET_R),loc:this.loc(n)}},t.parseObject=function(e){var t=this,n=this._lexer.token,r=function(){return t.parseObjectField(e)};return{kind:nE.h.OBJECT,fields:this.any(nk.BRACE_L,r,nk.BRACE_R),loc:this.loc(n)}},t.parseObjectField=function(e){var t=this._lexer.token,n=this.parseName();return this.expectToken(nk.COLON),{kind:nE.h.OBJECT_FIELD,name:n,value:this.parseValueLiteral(e),loc:this.loc(t)}},t.parseDirectives=function(e){for(var t=[];this.peek(nk.AT);)t.push(this.parseDirective(e));return t},t.parseDirective=function(e){var t=this._lexer.token;return this.expectToken(nk.AT),{kind:nE.h.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(e),loc:this.loc(t)}},t.parseTypeReference=function(){var e,t=this._lexer.token;return(this.expectOptionalToken(nk.BRACKET_L)?(e=this.parseTypeReference(),this.expectToken(nk.BRACKET_R),e={kind:nE.h.LIST_TYPE,type:e,loc:this.loc(t)}):e=this.parseNamedType(),this.expectOptionalToken(nk.BANG))?{kind:nE.h.NON_NULL_TYPE,type:e,loc:this.loc(t)}:e},t.parseNamedType=function(){var e=this._lexer.token;return{kind:nE.h.NAMED_TYPE,name:this.parseName(),loc:this.loc(e)}},t.parseTypeSystemDefinition=function(){var e=this.peekDescription()?this._lexer.lookahead():this._lexer.token;if(e.kind===nk.NAME)switch(e.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}throw this.unexpected(e)},t.peekDescription=function(){return this.peek(nk.STRING)||this.peek(nk.BLOCK_STRING)},t.parseDescription=function(){if(this.peekDescription())return this.parseStringLiteral()},t.parseSchemaDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("schema");var n=this.parseDirectives(!0),r=this.many(nk.BRACE_L,this.parseOperationTypeDefinition,nk.BRACE_R);return{kind:nE.h.SCHEMA_DEFINITION,description:t,directives:n,operationTypes:r,loc:this.loc(e)}},t.parseOperationTypeDefinition=function(){var e=this._lexer.token,t=this.parseOperationType();this.expectToken(nk.COLON);var n=this.parseNamedType();return{kind:nE.h.OPERATION_TYPE_DEFINITION,operation:t,type:n,loc:this.loc(e)}},t.parseScalarTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("scalar");var n=this.parseName(),r=this.parseDirectives(!0);return{kind:nE.h.SCALAR_TYPE_DEFINITION,description:t,name:n,directives:r,loc:this.loc(e)}},t.parseObjectTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("type");var n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseDirectives(!0),a=this.parseFieldsDefinition();return{kind:nE.h.OBJECT_TYPE_DEFINITION,description:t,name:n,interfaces:r,directives:i,fields:a,loc:this.loc(e)}},t.parseImplementsInterfaces=function(){var e;if(!this.expectOptionalKeyword("implements"))return[];if((null===(e=this._options)||void 0===e?void 0:e.allowLegacySDLImplementsInterfaces)===!0){var t=[];this.expectOptionalToken(nk.AMP);do t.push(this.parseNamedType());while(this.expectOptionalToken(nk.AMP)||this.peek(nk.NAME))return t}return this.delimitedMany(nk.AMP,this.parseNamedType)},t.parseFieldsDefinition=function(){var e;return(null===(e=this._options)||void 0===e?void 0:e.allowLegacySDLEmptyFields)===!0&&this.peek(nk.BRACE_L)&&this._lexer.lookahead().kind===nk.BRACE_R?(this._lexer.advance(),this._lexer.advance(),[]):this.optionalMany(nk.BRACE_L,this.parseFieldDefinition,nk.BRACE_R)},t.parseFieldDefinition=function(){var e=this._lexer.token,t=this.parseDescription(),n=this.parseName(),r=this.parseArgumentDefs();this.expectToken(nk.COLON);var i=this.parseTypeReference(),a=this.parseDirectives(!0);return{kind:nE.h.FIELD_DEFINITION,description:t,name:n,arguments:r,type:i,directives:a,loc:this.loc(e)}},t.parseArgumentDefs=function(){return this.optionalMany(nk.PAREN_L,this.parseInputValueDef,nk.PAREN_R)},t.parseInputValueDef=function(){var e,t=this._lexer.token,n=this.parseDescription(),r=this.parseName();this.expectToken(nk.COLON);var i=this.parseTypeReference();this.expectOptionalToken(nk.EQUALS)&&(e=this.parseValueLiteral(!0));var a=this.parseDirectives(!0);return{kind:nE.h.INPUT_VALUE_DEFINITION,description:n,name:r,type:i,defaultValue:e,directives:a,loc:this.loc(t)}},t.parseInterfaceTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("interface");var n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseDirectives(!0),a=this.parseFieldsDefinition();return{kind:nE.h.INTERFACE_TYPE_DEFINITION,description:t,name:n,interfaces:r,directives:i,fields:a,loc:this.loc(e)}},t.parseUnionTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("union");var n=this.parseName(),r=this.parseDirectives(!0),i=this.parseUnionMemberTypes();return{kind:nE.h.UNION_TYPE_DEFINITION,description:t,name:n,directives:r,types:i,loc:this.loc(e)}},t.parseUnionMemberTypes=function(){return this.expectOptionalToken(nk.EQUALS)?this.delimitedMany(nk.PIPE,this.parseNamedType):[]},t.parseEnumTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("enum");var n=this.parseName(),r=this.parseDirectives(!0),i=this.parseEnumValuesDefinition();return{kind:nE.h.ENUM_TYPE_DEFINITION,description:t,name:n,directives:r,values:i,loc:this.loc(e)}},t.parseEnumValuesDefinition=function(){return this.optionalMany(nk.BRACE_L,this.parseEnumValueDefinition,nk.BRACE_R)},t.parseEnumValueDefinition=function(){var e=this._lexer.token,t=this.parseDescription(),n=this.parseName(),r=this.parseDirectives(!0);return{kind:nE.h.ENUM_VALUE_DEFINITION,description:t,name:n,directives:r,loc:this.loc(e)}},t.parseInputObjectTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("input");var n=this.parseName(),r=this.parseDirectives(!0),i=this.parseInputFieldsDefinition();return{kind:nE.h.INPUT_OBJECT_TYPE_DEFINITION,description:t,name:n,directives:r,fields:i,loc:this.loc(e)}},t.parseInputFieldsDefinition=function(){return this.optionalMany(nk.BRACE_L,this.parseInputValueDef,nk.BRACE_R)},t.parseTypeSystemExtension=function(){var e=this._lexer.lookahead();if(e.kind===nk.NAME)switch(e.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(e)},t.parseSchemaExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");var t=this.parseDirectives(!0),n=this.optionalMany(nk.BRACE_L,this.parseOperationTypeDefinition,nk.BRACE_R);if(0===t.length&&0===n.length)throw this.unexpected();return{kind:nE.h.SCHEMA_EXTENSION,directives:t,operationTypes:n,loc:this.loc(e)}},t.parseScalarTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");var t=this.parseName(),n=this.parseDirectives(!0);if(0===n.length)throw this.unexpected();return{kind:nE.h.SCALAR_TYPE_EXTENSION,name:t,directives:n,loc:this.loc(e)}},t.parseObjectTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");var t=this.parseName(),n=this.parseImplementsInterfaces(),r=this.parseDirectives(!0),i=this.parseFieldsDefinition();if(0===n.length&&0===r.length&&0===i.length)throw this.unexpected();return{kind:nE.h.OBJECT_TYPE_EXTENSION,name:t,interfaces:n,directives:r,fields:i,loc:this.loc(e)}},t.parseInterfaceTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");var t=this.parseName(),n=this.parseImplementsInterfaces(),r=this.parseDirectives(!0),i=this.parseFieldsDefinition();if(0===n.length&&0===r.length&&0===i.length)throw this.unexpected();return{kind:nE.h.INTERFACE_TYPE_EXTENSION,name:t,interfaces:n,directives:r,fields:i,loc:this.loc(e)}},t.parseUnionTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");var t=this.parseName(),n=this.parseDirectives(!0),r=this.parseUnionMemberTypes();if(0===n.length&&0===r.length)throw this.unexpected();return{kind:nE.h.UNION_TYPE_EXTENSION,name:t,directives:n,types:r,loc:this.loc(e)}},t.parseEnumTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");var t=this.parseName(),n=this.parseDirectives(!0),r=this.parseEnumValuesDefinition();if(0===n.length&&0===r.length)throw this.unexpected();return{kind:nE.h.ENUM_TYPE_EXTENSION,name:t,directives:n,values:r,loc:this.loc(e)}},t.parseInputObjectTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");var t=this.parseName(),n=this.parseDirectives(!0),r=this.parseInputFieldsDefinition();if(0===n.length&&0===r.length)throw this.unexpected();return{kind:nE.h.INPUT_OBJECT_TYPE_EXTENSION,name:t,directives:n,fields:r,loc:this.loc(e)}},t.parseDirectiveDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("directive"),this.expectToken(nk.AT);var n=this.parseName(),r=this.parseArgumentDefs(),i=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");var a=this.parseDirectiveLocations();return{kind:nE.h.DIRECTIVE_DEFINITION,description:t,name:n,arguments:r,repeatable:i,locations:a,loc:this.loc(e)}},t.parseDirectiveLocations=function(){return this.delimitedMany(nk.PIPE,this.parseDirectiveLocation)},t.parseDirectiveLocation=function(){var e=this._lexer.token,t=this.parseName();if(void 0!==nT[t.value])return t;throw this.unexpected(e)},t.loc=function(e){var t;if((null===(t=this._options)||void 0===t?void 0:t.noLocation)!==!0)return new nS.Ye(e,this._lexer.lastToken,this._lexer.source)},t.peek=function(e){return this._lexer.token.kind===e},t.expectToken=function(e){var t=this._lexer.token;if(t.kind===e)return this._lexer.advance(),t;throw n_(this._lexer.source,t.start,"Expected ".concat(nG(e),", found ").concat(nz(t),"."))},t.expectOptionalToken=function(e){var t=this._lexer.token;if(t.kind===e)return this._lexer.advance(),t},t.expectKeyword=function(e){var t=this._lexer.token;if(t.kind===nk.NAME&&t.value===e)this._lexer.advance();else throw n_(this._lexer.source,t.start,'Expected "'.concat(e,'", found ').concat(nz(t),"."))},t.expectOptionalKeyword=function(e){var t=this._lexer.token;return t.kind===nk.NAME&&t.value===e&&(this._lexer.advance(),!0)},t.unexpected=function(e){var t=null!=e?e:this._lexer.token;return n_(this._lexer.source,t.start,"Unexpected ".concat(nz(t),"."))},t.any=function(e,t,n){this.expectToken(e);for(var r=[];!this.expectOptionalToken(n);)r.push(t.call(this));return r},t.optionalMany=function(e,t,n){if(this.expectOptionalToken(e)){var r=[];do r.push(t.call(this));while(!this.expectOptionalToken(n))return r}return[]},t.many=function(e,t,n){this.expectToken(e);var r=[];do r.push(t.call(this));while(!this.expectOptionalToken(n))return r},t.delimitedMany=function(e,t){this.expectOptionalToken(e);var n=[];do n.push(t.call(this));while(this.expectOptionalToken(e))return n},e}();function nz(e){var t=e.value;return nG(e.kind)+(null!=t?' "'.concat(t,'"'):"")}function nG(e){return nA(e)?'"'.concat(e,'"'):e}var nW=new Map,nK=new Map,nV=!0,nq=!1;function nZ(e){return e.replace(/[\s,]+/g," ").trim()}function nX(e){return nZ(e.source.body.substring(e.start,e.end))}function nJ(e){var t=new Set,n=[];return e.definitions.forEach(function(e){if("FragmentDefinition"===e.kind){var r=e.name.value,i=nX(e.loc),a=nK.get(r);a&&!a.has(i)?nV&&console.warn("Warning: fragment with name "+r+" already exists.\ngraphql-tag enforces all fragment names across your application to be unique; read more about\nthis in the docs: http://dev.apollodata.com/core/fragments.html#unique-names"):a||nK.set(r,a=new Set),a.add(i),t.has(i)||(t.add(i),n.push(e))}else n.push(e)}),(0,t0.pi)((0,t0.pi)({},e),{definitions:n})}function nQ(e){var t=new Set(e.definitions);t.forEach(function(e){e.loc&&delete e.loc,Object.keys(e).forEach(function(n){var r=e[n];r&&"object"==typeof r&&t.add(r)})});var n=e.loc;return n&&(delete n.startToken,delete n.endToken),e}function n1(e){var t=nZ(e);if(!nW.has(t)){var n=nH(e,{experimentalFragmentVariables:nq,allowLegacyFragmentVariables:nq});if(!n||"Document"!==n.kind)throw Error("Not a valid GraphQL document.");nW.set(t,nQ(nJ(n)))}return nW.get(t)}function n0(e){for(var t=[],n=1;n, or pass an ApolloClient instance in via options.'):(0,n9.kG)(!!n,32),n}var rp=n(10542),rb=n(53712),rm=n(21436),rg=Object.prototype.hasOwnProperty;function rv(e,t){return void 0===t&&(t=Object.create(null)),ry(rh(t.client),e).useQuery(t)}function ry(e,t){var n=(0,l.useRef)();n.current&&e===n.current.client&&t===n.current.query||(n.current=new rw(e,t,n.current));var r=n.current,i=(0,l.useState)(0),a=(i[0],i[1]);return r.forceUpdate=function(){a(function(e){return e+1})},r}var rw=function(){function e(e,t,n){this.client=e,this.query=t,this.ssrDisabledResult=(0,rp.J)({loading:!0,data:void 0,error:void 0,networkStatus:ru.I.loading}),this.skipStandbyResult=(0,rp.J)({loading:!1,data:void 0,error:void 0,networkStatus:ru.I.ready}),this.toQueryResultCache=new(n7.mr?WeakMap:Map),rd(t,r.Query);var i=n&&n.result,a=i&&i.data;a&&(this.previousData=a)}return e.prototype.forceUpdate=function(){__DEV__&&n9.kG.warn("Calling default no-op implementation of InternalState#forceUpdate")},e.prototype.executeQuery=function(e){var t,n=this;e.query&&Object.assign(this,{query:e.query}),this.watchQueryOptions=this.createWatchQueryOptions(this.queryHookOptions=e);var r=this.observable.reobserveAsConcast(this.getObsQueryOptions());return this.previousData=(null===(t=this.result)||void 0===t?void 0:t.data)||this.previousData,this.result=void 0,this.forceUpdate(),new Promise(function(e){var t;r.subscribe({next:function(e){t=e},error:function(){e(n.toQueryResult(n.observable.getCurrentResult()))},complete:function(){e(n.toQueryResult(t))}})})},e.prototype.useQuery=function(e){var t=this;this.renderPromises=(0,l.useContext)((0,ro.K)()).renderPromises,this.useOptions(e);var n=this.useObservableQuery(),r=rt((0,l.useCallback)(function(){if(t.renderPromises)return function(){};var e=function(){var e=t.result,r=n.getCurrentResult();!(e&&e.loading===r.loading&&e.networkStatus===r.networkStatus&&(0,ri.D)(e.data,r.data))&&t.setResult(r)},r=function(a){var o=n.last;i.unsubscribe();try{n.resetLastResults(),i=n.subscribe(e,r)}finally{n.last=o}if(!rg.call(a,"graphQLErrors"))throw a;var s=t.result;(!s||s&&s.loading||!(0,ri.D)(a,s.error))&&t.setResult({data:s&&s.data,error:a,loading:!1,networkStatus:ru.I.error})},i=n.subscribe(e,r);return function(){return setTimeout(function(){return i.unsubscribe()})}},[n,this.renderPromises,this.client.disableNetworkFetches,]),function(){return t.getCurrentResult()},function(){return t.getCurrentResult()});return this.unsafeHandlePartialRefetch(r),this.toQueryResult(r)},e.prototype.useOptions=function(t){var n,r=this.createWatchQueryOptions(this.queryHookOptions=t),i=this.watchQueryOptions;!(0,ri.D)(r,i)&&(this.watchQueryOptions=r,i&&this.observable&&(this.observable.reobserve(this.getObsQueryOptions()),this.previousData=(null===(n=this.result)||void 0===n?void 0:n.data)||this.previousData,this.result=void 0)),this.onCompleted=t.onCompleted||e.prototype.onCompleted,this.onError=t.onError||e.prototype.onError,(this.renderPromises||this.client.disableNetworkFetches)&&!1===this.queryHookOptions.ssr&&!this.queryHookOptions.skip?this.result=this.ssrDisabledResult:this.queryHookOptions.skip||"standby"===this.watchQueryOptions.fetchPolicy?this.result=this.skipStandbyResult:(this.result===this.ssrDisabledResult||this.result===this.skipStandbyResult)&&(this.result=void 0)},e.prototype.getObsQueryOptions=function(){var e=[],t=this.client.defaultOptions.watchQuery;return t&&e.push(t),this.queryHookOptions.defaultOptions&&e.push(this.queryHookOptions.defaultOptions),e.push((0,rb.o)(this.observable&&this.observable.options,this.watchQueryOptions)),e.reduce(ra.J)},e.prototype.createWatchQueryOptions=function(e){void 0===e&&(e={});var t,n=e.skip,r=Object.assign((e.ssr,e.onCompleted,e.onError,e.defaultOptions,(0,t0._T)(e,["skip","ssr","onCompleted","onError","defaultOptions"])),{query:this.query});if(this.renderPromises&&("network-only"===r.fetchPolicy||"cache-and-network"===r.fetchPolicy)&&(r.fetchPolicy="cache-first"),r.variables||(r.variables={}),n){var i=r.fetchPolicy,a=void 0===i?this.getDefaultFetchPolicy():i,o=r.initialFetchPolicy;Object.assign(r,{initialFetchPolicy:void 0===o?a:o,fetchPolicy:"standby"})}else r.fetchPolicy||(r.fetchPolicy=(null===(t=this.observable)||void 0===t?void 0:t.options.initialFetchPolicy)||this.getDefaultFetchPolicy());return r},e.prototype.getDefaultFetchPolicy=function(){var e,t;return(null===(e=this.queryHookOptions.defaultOptions)||void 0===e?void 0:e.fetchPolicy)||(null===(t=this.client.defaultOptions.watchQuery)||void 0===t?void 0:t.fetchPolicy)||"cache-first"},e.prototype.onCompleted=function(e){},e.prototype.onError=function(e){},e.prototype.useObservableQuery=function(){var e=this.observable=this.renderPromises&&this.renderPromises.getSSRObservable(this.watchQueryOptions)||this.observable||this.client.watchQuery(this.getObsQueryOptions());this.obsQueryFields=(0,l.useMemo)(function(){return{refetch:e.refetch.bind(e),reobserve:e.reobserve.bind(e),fetchMore:e.fetchMore.bind(e),updateQuery:e.updateQuery.bind(e),startPolling:e.startPolling.bind(e),stopPolling:e.stopPolling.bind(e),subscribeToMore:e.subscribeToMore.bind(e)}},[e]);var t=!(!1===this.queryHookOptions.ssr||this.queryHookOptions.skip);return this.renderPromises&&t&&(this.renderPromises.registerSSRObservable(e),e.getCurrentResult().loading&&this.renderPromises.addObservableQueryPromise(e)),e},e.prototype.setResult=function(e){var t=this.result;t&&t.data&&(this.previousData=t.data),this.result=e,this.forceUpdate(),this.handleErrorOrCompleted(e)},e.prototype.handleErrorOrCompleted=function(e){var t=this;if(!e.loading){var n=this.toApolloError(e);Promise.resolve().then(function(){n?t.onError(n):e.data&&t.onCompleted(e.data)}).catch(function(e){__DEV__&&n9.kG.warn(e)})}},e.prototype.toApolloError=function(e){return(0,rm.O)(e.errors)?new rs.cA({graphQLErrors:e.errors}):e.error},e.prototype.getCurrentResult=function(){return this.result||this.handleErrorOrCompleted(this.result=this.observable.getCurrentResult()),this.result},e.prototype.toQueryResult=function(e){var t=this.toQueryResultCache.get(e);if(t)return t;var n=e.data,r=(e.partial,(0,t0._T)(e,["data","partial"]));return this.toQueryResultCache.set(e,t=(0,t0.pi)((0,t0.pi)((0,t0.pi)({data:n},r),this.obsQueryFields),{client:this.client,observable:this.observable,variables:this.observable.variables,called:!this.queryHookOptions.skip,previousData:this.previousData})),!t.error&&(0,rm.O)(e.errors)&&(t.error=new rs.cA({graphQLErrors:e.errors})),t},e.prototype.unsafeHandlePartialRefetch=function(e){e.partial&&this.queryHookOptions.partialRefetch&&!e.loading&&(!e.data||0===Object.keys(e.data).length)&&"cache-only"!==this.observable.options.fetchPolicy&&(Object.assign(e,{loading:!0,networkStatus:ru.I.refetch}),this.observable.refetch())},e}();function r_(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);ne.length)&&(t=e.length);for(var n=0,r=Array(t);ne.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&void 0!==arguments[0]?arguments[0]:{};return rv(iH,e)},iz=function(){var e=ij(),t=parseInt(e.get("page")||"1",10),n=parseInt(e.get("per")||"50",10),r=i$({variables:{offset:(t-1)*n,limit:n},fetchPolicy:"network-only"}),i=r.data,a=r.loading,o=r.error;return a?l.createElement(iR,null):o?l.createElement(iD,{error:o}):i?l.createElement(iI,{chains:i.chains.results,page:t,pageSize:n,total:i.chains.metadata.total}):null},iG=n(67932),iW=n(8126),iK="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function iV(e){if(iq())return Intl.DateTimeFormat.supportedLocalesOf(e)[0]}function iq(){return("undefined"==typeof Intl?"undefined":iK(Intl))==="object"&&"function"==typeof Intl.DateTimeFormat}var iZ="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},iX=function(){function e(e,t){for(var n=0;n=i.length)break;s=i[o++]}else{if((o=i.next()).done)break;s=o.value}var s,u=s;if((void 0===e?"undefined":iZ(e))!=="object")return;e=e[u]}return e}},{key:"put",value:function(){for(var e=arguments.length,t=Array(e),n=0;n=o.length)break;c=o[u++]}else{if((u=o.next()).done)break;c=u.value}var c,l=c;"object"!==iZ(a[l])&&(a[l]={}),a=a[l]}return a[i]=r}}]),e}();let i1=iQ;var i0=new i1;function i2(e,t){if(!iq())return function(e){return e.toString()};var n=i4(e),r=JSON.stringify(t),i=i0.get(String(n),r)||i0.put(String(n),r,new Intl.DateTimeFormat(n,t));return function(e){return i.format(e)}}var i3={};function i4(e){var t=e.toString();return i3[t]?i3[t]:i3[t]=iV(e)}var i6="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function i5(e){return i8(e)?e:new Date(e)}function i8(e){return e instanceof Date||i9(e)}function i9(e){return(void 0===e?"undefined":i6(e))==="object"&&"function"==typeof e.getTime}var i7=n(54087),ae=n.n(i7);function at(e,t){if(0===e.length)return 0;for(var n=0,r=e.length-1,i=void 0;n<=r;){var a=t(e[i=Math.floor((r+n)/2)]);if(0===a)return i;if(a<0){if((n=i+1)>r)return n}else if((r=i-1)=t.nextUpdateTime)aa(t,this.instances);else break}},scheduleNextTick:function(){var e=this;this.scheduledTick=ae()(function(){e.tick(),e.scheduleNextTick()})},start:function(){this.scheduleNextTick()},stop:function(){ae().cancel(this.scheduledTick)}};function ai(e){var t=an(e.getNextValue(),2),n=t[0],r=t[1];e.setValue(n),e.nextUpdateTime=r}function aa(e,t){ai(e),as(t,e),ao(t,e)}function ao(e,t){var n=au(e,t);e.splice(n,0,t)}function as(e,t){var n=e.indexOf(t);e.splice(n,1)}function au(e,t){var n=t.nextUpdateTime;return at(e,function(e){return e.nextUpdateTime===n?0:e.nextUpdateTime>n?1:-1})}var ac=(0,ec.oneOfType)([(0,ec.shape)({minTime:ec.number,formatAs:ec.string.isRequired}),(0,ec.shape)({test:ec.func,formatAs:ec.string.isRequired}),(0,ec.shape)({minTime:ec.number,format:ec.func.isRequired}),(0,ec.shape)({test:ec.func,format:ec.func.isRequired})]),al=(0,ec.oneOfType)([ec.string,(0,ec.shape)({steps:(0,ec.arrayOf)(ac).isRequired,labels:(0,ec.oneOfType)([ec.string,(0,ec.arrayOf)(ec.string)]).isRequired,round:ec.string})]),af=Object.assign||function(e){for(var t=1;t=0)&&Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function ap(e){var t=e.date,n=e.future,r=e.timeStyle,i=e.round,a=e.minTimeLeft,o=e.tooltip,s=e.component,u=e.container,c=e.wrapperComponent,f=e.wrapperProps,d=e.locale,h=e.locales,p=e.formatVerboseDate,b=e.verboseDateFormat,m=e.updateInterval,g=e.tick,v=ah(e,["date","future","timeStyle","round","minTimeLeft","tooltip","component","container","wrapperComponent","wrapperProps","locale","locales","formatVerboseDate","verboseDateFormat","updateInterval","tick"]),y=(0,l.useMemo)(function(){return d&&(h=[d]),h.concat(iW.Z.getDefaultLocale())},[d,h]),w=(0,l.useMemo)(function(){return new iW.Z(y)},[y]);t=(0,l.useMemo)(function(){return i5(t)},[t]);var _=(0,l.useCallback)(function(){var e=Date.now(),o=void 0;if(n&&e>=t.getTime()&&(e=t.getTime(),o=!0),void 0!==a){var s=t.getTime()-1e3*a;e>s&&(e=s,o=!0)}var u=w.format(t,r,{getTimeToNextUpdate:!0,now:e,future:n,round:i}),c=ad(u,2),l=c[0],f=c[1];return f=o?ag:m||f||6e4,[l,e+f]},[t,n,r,m,i,a,w]),E=(0,l.useRef)();E.current=_;var S=(0,l.useMemo)(_,[]),k=ad(S,2),x=k[0],T=k[1],M=(0,l.useState)(x),O=ad(M,2),A=O[0],L=O[1],C=ad((0,l.useState)(),2),I=C[0],D=C[1],N=(0,l.useRef)();(0,l.useEffect)(function(){if(g)return N.current=ar.add({getNextValue:function(){return E.current()},setValue:L,nextUpdateTime:T}),function(){return N.current.stop()}},[g]),(0,l.useEffect)(function(){if(N.current)N.current.forceUpdate();else{var e=_(),t=ad(e,1)[0];L(t)}},[_]),(0,l.useEffect)(function(){D(!0)},[]);var P=(0,l.useMemo)(function(){if("undefined"!=typeof window)return i2(y,b)},[y,b]),R=(0,l.useMemo)(function(){if("undefined"!=typeof window)return p?p(t):P(t)},[t,p,P]),j=l.createElement(s,af({date:t,verboseDate:I?R:void 0,tooltip:o},v),A),F=c||u;return F?l.createElement(F,af({},f,{verboseDate:I?R:void 0}),j):j}ap.propTypes={date:el().oneOfType([el().instanceOf(Date),el().number]).isRequired,locale:el().string,locales:el().arrayOf(el().string),future:el().bool,timeStyle:al,round:el().string,minTimeLeft:el().number,component:el().elementType.isRequired,tooltip:el().bool.isRequired,formatVerboseDate:el().func,verboseDateFormat:el().object,updateInterval:el().oneOfType([el().number,el().arrayOf(el().shape({threshold:el().number,interval:el().number.isRequired}))]),tick:el().bool,wrapperComponent:el().func,wrapperProps:el().object},ap.defaultProps={locales:[],component:av,tooltip:!0,verboseDateFormat:{weekday:"long",day:"numeric",month:"long",year:"numeric",hour:"numeric",minute:"2-digit",second:"2-digit"},tick:!0},ap=l.memo(ap);let ab=ap;var am,ag=31536e9;function av(e){var t=e.date,n=e.verboseDate,r=e.tooltip,i=e.children,a=ah(e,["date","verboseDate","tooltip","children"]),o=(0,l.useMemo)(function(){return t.toISOString()},[t]);return l.createElement("time",af({},a,{dateTime:o,title:r?n:void 0}),i)}av.propTypes={date:el().instanceOf(Date).isRequired,verboseDate:el().string,tooltip:el().bool.isRequired,children:el().string.isRequired};var ay=n(30381),aw=n.n(ay),a_=n(31657);function aE(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function aS(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=Array(t);ne.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]0?new rs.cA({graphQLErrors:i}):void 0;if(u===s.current.mutationId&&!c.ignoreResults){var f={called:!0,loading:!1,data:r,error:l,client:a};s.current.isMounted&&!(0,ri.D)(s.current.result,f)&&o(s.current.result=f)}var d=e.onCompleted||(null===(n=s.current.options)||void 0===n?void 0:n.onCompleted);return null==d||d(t.data,c),t}).catch(function(t){if(u===s.current.mutationId&&s.current.isMounted){var n,r={loading:!1,error:t,data:void 0,called:!0,client:a};(0,ri.D)(s.current.result,r)||o(s.current.result=r)}var i=e.onError||(null===(n=s.current.options)||void 0===n?void 0:n.onError);if(i)return i(t,c),{data:void 0,errors:t};throw t})},[]),c=(0,l.useCallback)(function(){s.current.isMounted&&o({called:!1,loading:!1,client:n})},[]);return(0,l.useEffect)(function(){return s.current.isMounted=!0,function(){s.current.isMounted=!1}},[]),[u,(0,t0.pi)({reset:c},a)]}var os=n(59067),ou=n(28428),oc=n(11186),ol=n(78513);function of(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var od=function(e){return(0,b.createStyles)({paper:{display:"flex",margin:"".concat(2.5*e.spacing.unit,"px 0"),padding:"".concat(3*e.spacing.unit,"px ").concat(3.5*e.spacing.unit,"px")},content:{flex:1,width:"100%"},actions:of({marginTop:-(1.5*e.spacing.unit),marginLeft:-(4*e.spacing.unit)},e.breakpoints.up("sm"),{marginLeft:0,marginRight:-(1.5*e.spacing.unit)}),itemBlock:{border:"1px solid rgba(224, 224, 224, 1)",borderRadius:e.shape.borderRadius,padding:2*e.spacing.unit,marginTop:e.spacing.unit},itemBlockText:{overflowWrap:"anywhere"}})},oh=(0,b.withStyles)(od)(function(e){var t=e.actions,n=e.children,r=e.classes;return l.createElement(ii.default,{className:r.paper},l.createElement("div",{className:r.content},n),t&&l.createElement("div",{className:r.actions},t))}),op=function(e){var t=e.title;return l.createElement(x.default,{variant:"subtitle2",gutterBottom:!0},t)},ob=function(e){var t=e.children,n=e.value;return l.createElement(x.default,{variant:"body1",noWrap:!0},t||n)},om=(0,b.withStyles)(od)(function(e){var t=e.children,n=e.classes,r=e.value;return l.createElement("div",{className:n.itemBlock},l.createElement(x.default,{variant:"body1",className:n.itemBlockText},t||r))});function og(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);ne.length)&&(t=e.length);for(var n=0,r=Array(t);ne.length)&&(t=e.length);for(var n=0,r=Array(t);ne.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]-1}let sq=sV;function sZ(e,t){var n=this.__data__,r=sH(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}let sX=sZ;function sJ(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t-1&&e%1==0&&e-1&&e%1==0&&e<=cC}let cD=cI;var cN="[object Arguments]",cP="[object Array]",cR="[object Boolean]",cj="[object Date]",cF="[object Error]",cY="[object Function]",cB="[object Map]",cU="[object Number]",cH="[object Object]",c$="[object RegExp]",cz="[object Set]",cG="[object String]",cW="[object WeakMap]",cK="[object ArrayBuffer]",cV="[object DataView]",cq="[object Float64Array]",cZ="[object Int8Array]",cX="[object Int16Array]",cJ="[object Int32Array]",cQ="[object Uint8Array]",c1="[object Uint8ClampedArray]",c0="[object Uint16Array]",c2="[object Uint32Array]",c3={};function c4(e){return eD(e)&&cD(e.length)&&!!c3[eC(e)]}c3["[object Float32Array]"]=c3[cq]=c3[cZ]=c3[cX]=c3[cJ]=c3[cQ]=c3[c1]=c3[c0]=c3[c2]=!0,c3[cN]=c3[cP]=c3[cK]=c3[cR]=c3[cV]=c3[cj]=c3[cF]=c3[cY]=c3[cB]=c3[cU]=c3[cH]=c3[c$]=c3[cz]=c3[cG]=c3[cW]=!1;let c6=c4;function c5(e){return function(t){return e(t)}}let c8=c5;var c9=n(79730),c7=c9.Z&&c9.Z.isTypedArray,le=c7?c8(c7):c6;let lt=le;var ln=Object.prototype.hasOwnProperty;function lr(e,t){var n=cx(e),r=!n&&cS(e),i=!n&&!r&&(0,cT.Z)(e),a=!n&&!r&&!i&<(e),o=n||r||i||a,s=o?cb(e.length,String):[],u=s.length;for(var c in e)(t||ln.call(e,c))&&!(o&&("length"==c||i&&("offset"==c||"parent"==c)||a&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||cL(c,u)))&&s.push(c);return s}let li=lr;var la=Object.prototype;function lo(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||la)}let ls=lo;var lu=sT(Object.keys,Object);let lc=lu;var ll=Object.prototype.hasOwnProperty;function lf(e){if(!ls(e))return lc(e);var t=[];for(var n in Object(e))ll.call(e,n)&&"constructor"!=n&&t.push(n);return t}let ld=lf;function lh(e){return null!=e&&cD(e.length)&&!ur(e)}let lp=lh;function lb(e){return lp(e)?li(e):ld(e)}let lm=lb;function lg(e,t){return e&&ch(t,lm(t),e)}let lv=lg;function ly(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}let lw=ly;var l_=Object.prototype.hasOwnProperty;function lE(e){if(!ed(e))return lw(e);var t=ls(e),n=[];for(var r in e)"constructor"==r&&(t||!l_.call(e,r))||n.push(r);return n}let lS=lE;function lk(e){return lp(e)?li(e,!0):lS(e)}let lx=lk;function lT(e,t){return e&&ch(t,lx(t),e)}let lM=lT;var lO=n(42896);function lA(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n=0||(i[n]=e[n]);return i}function hu(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var hc=function(e){return Array.isArray(e)&&0===e.length},hl=function(e){return"function"==typeof e},hf=function(e){return null!==e&&"object"==typeof e},hd=function(e){return String(Math.floor(Number(e)))===e},hh=function(e){return"[object String]"===Object.prototype.toString.call(e)},hp=function(e){return 0===l.Children.count(e)},hb=function(e){return hf(e)&&hl(e.then)};function hm(e,t,n,r){void 0===r&&(r=0);for(var i=d8(t);e&&r=0?[]:{}}}return(0===a?e:i)[o[a]]===n?e:(void 0===n?delete i[o[a]]:i[o[a]]=n,0===a&&void 0===n&&delete r[o[a]],r)}function hv(e,t,n,r){void 0===n&&(n=new WeakMap),void 0===r&&(r={});for(var i=0,a=Object.keys(e);i0?t.map(function(t){return x(t,hm(e,t))}):[Promise.resolve("DO_NOT_DELETE_YOU_WILL_BE_FIRED")]).then(function(e){return e.reduce(function(e,n,r){return"DO_NOT_DELETE_YOU_WILL_BE_FIRED"===n||n&&(e=hg(e,t[r],n)),e},{})})},[x]),M=(0,l.useCallback)(function(e){return Promise.all([T(e),h.validationSchema?k(e):{},h.validate?S(e):{}]).then(function(e){var t=e[0],n=e[1],r=e[2];return sk.all([t,n,r],{arrayMerge:hL})})},[h.validate,h.validationSchema,T,S,k]),O=hN(function(e){return void 0===e&&(e=_.values),E({type:"SET_ISVALIDATING",payload:!0}),M(e).then(function(e){return v.current&&(E({type:"SET_ISVALIDATING",payload:!1}),sd()(_.errors,e)||E({type:"SET_ERRORS",payload:e})),e})});(0,l.useEffect)(function(){o&&!0===v.current&&sd()(p.current,h.initialValues)&&O(p.current)},[o,O]);var A=(0,l.useCallback)(function(e){var t=e&&e.values?e.values:p.current,n=e&&e.errors?e.errors:b.current?b.current:h.initialErrors||{},r=e&&e.touched?e.touched:m.current?m.current:h.initialTouched||{},i=e&&e.status?e.status:g.current?g.current:h.initialStatus;p.current=t,b.current=n,m.current=r,g.current=i;var a=function(){E({type:"RESET_FORM",payload:{isSubmitting:!!e&&!!e.isSubmitting,errors:n,touched:r,status:i,values:t,isValidating:!!e&&!!e.isValidating,submitCount:e&&e.submitCount&&"number"==typeof e.submitCount?e.submitCount:0}})};if(h.onReset){var o=h.onReset(_.values,V);hb(o)?o.then(a):a()}else a()},[h.initialErrors,h.initialStatus,h.initialTouched]);(0,l.useEffect)(function(){!0===v.current&&!sd()(p.current,h.initialValues)&&(c&&(p.current=h.initialValues,A()),o&&O(p.current))},[c,h.initialValues,A,o,O]),(0,l.useEffect)(function(){c&&!0===v.current&&!sd()(b.current,h.initialErrors)&&(b.current=h.initialErrors||hS,E({type:"SET_ERRORS",payload:h.initialErrors||hS}))},[c,h.initialErrors]),(0,l.useEffect)(function(){c&&!0===v.current&&!sd()(m.current,h.initialTouched)&&(m.current=h.initialTouched||hk,E({type:"SET_TOUCHED",payload:h.initialTouched||hk}))},[c,h.initialTouched]),(0,l.useEffect)(function(){c&&!0===v.current&&!sd()(g.current,h.initialStatus)&&(g.current=h.initialStatus,E({type:"SET_STATUS",payload:h.initialStatus}))},[c,h.initialStatus,h.initialTouched]);var L=hN(function(e){if(y.current[e]&&hl(y.current[e].validate)){var t=hm(_.values,e),n=y.current[e].validate(t);return hb(n)?(E({type:"SET_ISVALIDATING",payload:!0}),n.then(function(e){return e}).then(function(t){E({type:"SET_FIELD_ERROR",payload:{field:e,value:t}}),E({type:"SET_ISVALIDATING",payload:!1})})):(E({type:"SET_FIELD_ERROR",payload:{field:e,value:n}}),Promise.resolve(n))}return h.validationSchema?(E({type:"SET_ISVALIDATING",payload:!0}),k(_.values,e).then(function(e){return e}).then(function(t){E({type:"SET_FIELD_ERROR",payload:{field:e,value:t[e]}}),E({type:"SET_ISVALIDATING",payload:!1})})):Promise.resolve()}),C=(0,l.useCallback)(function(e,t){var n=t.validate;y.current[e]={validate:n}},[]),I=(0,l.useCallback)(function(e){delete y.current[e]},[]),D=hN(function(e,t){return E({type:"SET_TOUCHED",payload:e}),(void 0===t?i:t)?O(_.values):Promise.resolve()}),N=(0,l.useCallback)(function(e){E({type:"SET_ERRORS",payload:e})},[]),P=hN(function(e,t){var r=hl(e)?e(_.values):e;return E({type:"SET_VALUES",payload:r}),(void 0===t?n:t)?O(r):Promise.resolve()}),R=(0,l.useCallback)(function(e,t){E({type:"SET_FIELD_ERROR",payload:{field:e,value:t}})},[]),j=hN(function(e,t,r){return E({type:"SET_FIELD_VALUE",payload:{field:e,value:t}}),(void 0===r?n:r)?O(hg(_.values,e,t)):Promise.resolve()}),F=(0,l.useCallback)(function(e,t){var n,r=t,i=e;if(!hh(e)){e.persist&&e.persist();var a=e.target?e.target:e.currentTarget,o=a.type,s=a.name,u=a.id,c=a.value,l=a.checked,f=(a.outerHTML,a.options),d=a.multiple;r=t||s||u,i=/number|range/.test(o)?(n=parseFloat(c),isNaN(n)?"":n):/checkbox/.test(o)?hI(hm(_.values,r),l,c):d?hC(f):c}r&&j(r,i)},[j,_.values]),Y=hN(function(e){if(hh(e))return function(t){return F(t,e)};F(e)}),B=hN(function(e,t,n){return void 0===t&&(t=!0),E({type:"SET_FIELD_TOUCHED",payload:{field:e,value:t}}),(void 0===n?i:n)?O(_.values):Promise.resolve()}),U=(0,l.useCallback)(function(e,t){e.persist&&e.persist();var n,r=e.target,i=r.name,a=r.id;r.outerHTML,B(t||i||a,!0)},[B]),H=hN(function(e){if(hh(e))return function(t){return U(t,e)};U(e)}),$=(0,l.useCallback)(function(e){hl(e)?E({type:"SET_FORMIK_STATE",payload:e}):E({type:"SET_FORMIK_STATE",payload:function(){return e}})},[]),z=(0,l.useCallback)(function(e){E({type:"SET_STATUS",payload:e})},[]),G=(0,l.useCallback)(function(e){E({type:"SET_ISSUBMITTING",payload:e})},[]),W=hN(function(){return E({type:"SUBMIT_ATTEMPT"}),O().then(function(e){var t,n=e instanceof Error;if(!n&&0===Object.keys(e).length){try{if(void 0===(t=q()))return}catch(r){throw r}return Promise.resolve(t).then(function(e){return v.current&&E({type:"SUBMIT_SUCCESS"}),e}).catch(function(e){if(v.current)throw E({type:"SUBMIT_FAILURE"}),e})}if(v.current&&(E({type:"SUBMIT_FAILURE"}),n))throw e})}),K=hN(function(e){e&&e.preventDefault&&hl(e.preventDefault)&&e.preventDefault(),e&&e.stopPropagation&&hl(e.stopPropagation)&&e.stopPropagation(),W().catch(function(e){console.warn("Warning: An unhandled error was caught from submitForm()",e)})}),V={resetForm:A,validateForm:O,validateField:L,setErrors:N,setFieldError:R,setFieldTouched:B,setFieldValue:j,setStatus:z,setSubmitting:G,setTouched:D,setValues:P,setFormikState:$,submitForm:W},q=hN(function(){return f(_.values,V)}),Z=hN(function(e){e&&e.preventDefault&&hl(e.preventDefault)&&e.preventDefault(),e&&e.stopPropagation&&hl(e.stopPropagation)&&e.stopPropagation(),A()}),X=(0,l.useCallback)(function(e){return{value:hm(_.values,e),error:hm(_.errors,e),touched:!!hm(_.touched,e),initialValue:hm(p.current,e),initialTouched:!!hm(m.current,e),initialError:hm(b.current,e)}},[_.errors,_.touched,_.values]),J=(0,l.useCallback)(function(e){return{setValue:function(t,n){return j(e,t,n)},setTouched:function(t,n){return B(e,t,n)},setError:function(t){return R(e,t)}}},[j,B,R]),Q=(0,l.useCallback)(function(e){var t=hf(e),n=t?e.name:e,r=hm(_.values,n),i={name:n,value:r,onChange:Y,onBlur:H};if(t){var a=e.type,o=e.value,s=e.as,u=e.multiple;"checkbox"===a?void 0===o?i.checked=!!r:(i.checked=!!(Array.isArray(r)&&~r.indexOf(o)),i.value=o):"radio"===a?(i.checked=r===o,i.value=o):"select"===s&&u&&(i.value=i.value||[],i.multiple=!0)}return i},[H,Y,_.values]),ee=(0,l.useMemo)(function(){return!sd()(p.current,_.values)},[p.current,_.values]),et=(0,l.useMemo)(function(){return void 0!==s?ee?_.errors&&0===Object.keys(_.errors).length:!1!==s&&hl(s)?s(h):s:_.errors&&0===Object.keys(_.errors).length},[s,ee,_.errors,h]);return ha({},_,{initialValues:p.current,initialErrors:b.current,initialTouched:m.current,initialStatus:g.current,handleBlur:H,handleChange:Y,handleReset:Z,handleSubmit:K,resetForm:A,setErrors:N,setFormikState:$,setFieldTouched:B,setFieldValue:j,setFieldError:R,setStatus:z,setSubmitting:G,setTouched:D,setValues:P,submitForm:W,validateForm:O,validateField:L,isValid:et,dirty:ee,unregisterField:I,registerField:C,getFieldProps:Q,getFieldMeta:X,getFieldHelpers:J,validateOnBlur:i,validateOnChange:n,validateOnMount:o})}function hT(e){var t=hx(e),n=e.component,r=e.children,i=e.render,a=e.innerRef;return(0,l.useImperativeHandle)(a,function(){return t}),(0,l.createElement)(hw,{value:t},n?(0,l.createElement)(n,t):i?i(t):r?hl(r)?r(t):hp(r)?null:l.Children.only(r):null)}function hM(e){var t={};if(e.inner){if(0===e.inner.length)return hg(t,e.path,e.message);for(var n=e.inner,r=Array.isArray(n),i=0,n=r?n:n[Symbol.iterator]();;){if(r){if(i>=n.length)break;a=n[i++]}else{if((i=n.next()).done)break;a=i.value}var a,o=a;hm(t,o.path)||(t=hg(t,o.path,o.message))}}return t}function hO(e,t,n,r){void 0===n&&(n=!1),void 0===r&&(r={});var i=hA(e);return t[n?"validateSync":"validate"](i,{abortEarly:!1,context:r})}function hA(e){var t=Array.isArray(e)?[]:{};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=String(n);!0===Array.isArray(e[r])?t[r]=e[r].map(function(e){return!0===Array.isArray(e)||sR(e)?hA(e):""!==e?e:void 0}):sR(e[r])?t[r]=hA(e[r]):t[r]=""!==e[r]?e[r]:void 0}return t}function hL(e,t,n){var r=e.slice();return t.forEach(function(t,i){if(void 0===r[i]){var a=!1!==n.clone&&n.isMergeableObject(t);r[i]=a?sk(Array.isArray(t)?[]:{},t,n):t}else n.isMergeableObject(t)?r[i]=sk(e[i],t,n):-1===e.indexOf(t)&&r.push(t)}),r}function hC(e){return Array.from(e).filter(function(e){return e.selected}).map(function(e){return e.value})}function hI(e,t,n){if("boolean"==typeof e)return Boolean(t);var r=[],i=!1,a=-1;if(Array.isArray(e))r=e,i=(a=e.indexOf(n))>=0;else if(!n||"true"==n||"false"==n)return Boolean(t);return t&&n&&!i?r.concat(n):i?r.slice(0,a).concat(r.slice(a+1)):r}var hD="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?l.useLayoutEffect:l.useEffect;function hN(e){var t=(0,l.useRef)(e);return hD(function(){t.current=e}),(0,l.useCallback)(function(){for(var e=arguments.length,n=Array(e),r=0;re?t:e},0);return Array.from(ha({},e,{length:t+1}))};(function(e){function t(t){var n;return(n=e.call(this,t)||this).updateArrayField=function(e,t,r){var i=n.props,a=i.name;(0,i.formik.setFormikState)(function(n){var i="function"==typeof r?r:e,o="function"==typeof t?t:e,s=hg(n.values,a,e(hm(n.values,a))),u=r?i(hm(n.errors,a)):void 0,c=t?o(hm(n.touched,a)):void 0;return hc(u)&&(u=void 0),hc(c)&&(c=void 0),ha({},n,{values:s,errors:r?hg(n.errors,a,u):n.errors,touched:t?hg(n.touched,a,c):n.touched})})},n.push=function(e){return n.updateArrayField(function(t){return[].concat(hU(t),[hi(e)])},!1,!1)},n.handlePush=function(e){return function(){return n.push(e)}},n.swap=function(e,t){return n.updateArrayField(function(n){return hF(n,e,t)},!0,!0)},n.handleSwap=function(e,t){return function(){return n.swap(e,t)}},n.move=function(e,t){return n.updateArrayField(function(n){return hj(n,e,t)},!0,!0)},n.handleMove=function(e,t){return function(){return n.move(e,t)}},n.insert=function(e,t){return n.updateArrayField(function(n){return hY(n,e,t)},function(t){return hY(t,e,null)},function(t){return hY(t,e,null)})},n.handleInsert=function(e,t){return function(){return n.insert(e,t)}},n.replace=function(e,t){return n.updateArrayField(function(n){return hB(n,e,t)},!1,!1)},n.handleReplace=function(e,t){return function(){return n.replace(e,t)}},n.unshift=function(e){var t=-1;return n.updateArrayField(function(n){var r=n?[e].concat(n):[e];return t<0&&(t=r.length),r},function(e){var n=e?[null].concat(e):[null];return t<0&&(t=n.length),n},function(e){var n=e?[null].concat(e):[null];return t<0&&(t=n.length),n}),t},n.handleUnshift=function(e){return function(){return n.unshift(e)}},n.handleRemove=function(e){return function(){return n.remove(e)}},n.handlePop=function(){return function(){return n.pop()}},n.remove=n.remove.bind(hu(n)),n.pop=n.pop.bind(hu(n)),n}ho(t,e);var n=t.prototype;return n.componentDidUpdate=function(e){this.props.validateOnChange&&this.props.formik.validateOnChange&&!sd()(hm(e.formik.values,e.name),hm(this.props.formik.values,this.props.name))&&this.props.formik.validateForm(this.props.formik.values)},n.remove=function(e){var t;return this.updateArrayField(function(n){var r=n?hU(n):[];return t||(t=r[e]),hl(r.splice)&&r.splice(e,1),r},!0,!0),t},n.pop=function(){var e;return this.updateArrayField(function(t){var n=t;return e||(e=n&&n.pop&&n.pop()),n},!0,!0),e},n.render=function(){var e={push:this.push,pop:this.pop,swap:this.swap,move:this.move,insert:this.insert,replace:this.replace,unshift:this.unshift,remove:this.remove,handlePush:this.handlePush,handlePop:this.handlePop,handleSwap:this.handleSwap,handleMove:this.handleMove,handleInsert:this.handleInsert,handleReplace:this.handleReplace,handleUnshift:this.handleUnshift,handleRemove:this.handleRemove},t=this.props,n=t.component,r=t.render,i=t.children,a=t.name,o=hs(t.formik,["validate","validationSchema"]),s=ha({},e,{form:o,name:a});return n?(0,l.createElement)(n,s):r?r(s):i?"function"==typeof i?i(s):hp(i)?null:l.Children.only(i):null},t})(l.Component).defaultProps={validateOnChange:!0},l.Component,l.Component;var hH=n(24802),h$=n(71209),hz=n(91750),hG=n(11970),hW=n(4689),hK=n(67598),hV=function(){return(hV=Object.assign||function(e){for(var t,n=1,r=arguments.length;nt.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,r=Object.getOwnPropertySymbols(e);it.indexOf(r[i])&&(n[r[i]]=e[r[i]]);return n}function hZ(e){var t=e.disabled,n=e.field,r=n.onBlur,i=hq(n,["onBlur"]),a=e.form,o=a.isSubmitting,s=a.touched,u=a.errors,c=e.onBlur,l=e.helperText,f=hq(e,["disabled","field","form","onBlur","helperText"]),d=hm(u,i.name),h=hm(s,i.name)&&!!d;return hV(hV({variant:f.variant,error:h,helperText:h?d:l,disabled:null!=t?t:o,onBlur:null!=c?c:function(e){r(null!=e?e:i.name)}},i),f)}function hX(e){var t=e.children,n=hq(e,["children"]);return(0,l.createElement)(iw.Z,hV({},hZ(n)),t)}function hJ(e){var t=e.disabled,n=e.field,r=n.onBlur,i=hq(n,["onBlur"]),a=e.form.isSubmitting,o=(e.type,e.onBlur),s=hq(e,["disabled","field","form","type","onBlur"]);return hV(hV({disabled:null!=t?t:a,onBlur:null!=o?o:function(e){r(null!=e?e:i.name)}},i),s)}function hQ(e){return(0,l.createElement)(hH.Z,hV({},hJ(e)))}function h1(e){var t,n=e.disabled,r=e.field,i=r.onBlur,a=hq(r,["onBlur"]),o=e.form.isSubmitting,s=(e.type,e.onBlur),u=hq(e,["disabled","field","form","type","onBlur"]);return hV(hV({disabled:null!=n?n:o,indeterminate:!Array.isArray(a.value)&&null==a.value,onBlur:null!=s?s:function(e){i(null!=e?e:a.name)}},a),u)}function h0(e){return(0,l.createElement)(h$.Z,hV({},h1(e)))}function h2(e){var t=e.Label,n=hq(e,["Label"]);return(0,l.createElement)(hz.Z,hV({control:(0,l.createElement)(h$.Z,hV({},h1(n)))},t))}function h3(e){var t=e.disabled,n=e.field,r=n.onBlur,i=hq(n,["onBlur"]),a=e.form.isSubmitting,o=e.onBlur,s=hq(e,["disabled","field","form","onBlur"]);return hV(hV({disabled:null!=t?t:a,onBlur:null!=o?o:function(e){r(null!=e?e:i.name)}},i),s)}function h4(e){return(0,l.createElement)(hG.default,hV({},h3(e)))}function h6(e){var t=e.field,n=t.onBlur,r=hq(t,["onBlur"]),i=(e.form,e.onBlur),a=hq(e,["field","form","onBlur"]);return hV(hV({onBlur:null!=i?i:function(e){n(null!=e?e:r.name)}},r),a)}function h5(e){return(0,l.createElement)(hW.Z,hV({},h6(e)))}function h8(e){var t=e.disabled,n=e.field,r=n.onBlur,i=hq(n,["onBlur"]),a=e.form.isSubmitting,o=e.onBlur,s=hq(e,["disabled","field","form","onBlur"]);return hV(hV({disabled:null!=t?t:a,onBlur:null!=o?o:function(e){r(null!=e?e:i.name)}},i),s)}function h9(e){return(0,l.createElement)(hK.default,hV({},h8(e)))}hX.displayName="FormikMaterialUITextField",hQ.displayName="FormikMaterialUISwitch",h0.displayName="FormikMaterialUICheckbox",h2.displayName="FormikMaterialUICheckboxWithLabel",h4.displayName="FormikMaterialUISelect",h5.displayName="FormikMaterialUIRadioGroup",h9.displayName="FormikMaterialUIInputBase";try{a=Map}catch(h7){}try{o=Set}catch(pe){}function pt(e,t,n){if(!e||"object"!=typeof e||"function"==typeof e)return e;if(e.nodeType&&"cloneNode"in e)return e.cloneNode(!0);if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp)return RegExp(e);if(Array.isArray(e))return e.map(pn);if(a&&e instanceof a)return new Map(Array.from(e.entries()));if(o&&e instanceof o)return new Set(Array.from(e.values()));if(e instanceof Object){t.push(e);var r=Object.create(e);for(var i in n.push(r),e){var s=t.findIndex(function(t){return t===e[i]});r[i]=s>-1?n[s]:pt(e[i],t,n)}return r}return e}function pn(e){return pt(e,[],[])}let pr=Object.prototype.toString,pi=Error.prototype.toString,pa=RegExp.prototype.toString,po="undefined"!=typeof Symbol?Symbol.prototype.toString:()=>"",ps=/^Symbol\((.*)\)(.*)$/;function pu(e){if(e!=+e)return"NaN";let t=0===e&&1/e<0;return t?"-0":""+e}function pc(e,t=!1){if(null==e||!0===e||!1===e)return""+e;let n=typeof e;if("number"===n)return pu(e);if("string"===n)return t?`"${e}"`:e;if("function"===n)return"[Function "+(e.name||"anonymous")+"]";if("symbol"===n)return po.call(e).replace(ps,"Symbol($1)");let r=pr.call(e).slice(8,-1);return"Date"===r?isNaN(e.getTime())?""+e:e.toISOString(e):"Error"===r||e instanceof Error?"["+pi.call(e)+"]":"RegExp"===r?pa.call(e):null}function pl(e,t){let n=pc(e,t);return null!==n?n:JSON.stringify(e,function(e,n){let r=pc(this[e],t);return null!==r?r:n},2)}let pf={default:"${path} is invalid",required:"${path} is a required field",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType({path:e,type:t,value:n,originalValue:r}){let i=null!=r&&r!==n,a=`${e} must be a \`${t}\` type, but the final value was: \`${pl(n,!0)}\``+(i?` (cast from the value \`${pl(r,!0)}\`).`:".");return null===n&&(a+='\n If "null" is intended as an empty value be sure to mark the schema as `.nullable()`'),a},defined:"${path} must be defined"},pd={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},ph={min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},pp={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},pb={isValue:"${path} field must be ${value}"},pm={noUnknown:"${path} field has unspecified keys: ${unknown}"},pg={min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must be have ${length} items"};Object.assign(Object.create(null),{mixed:pf,string:pd,number:ph,date:pp,object:pm,array:pg,boolean:pb});var pv=n(18721),py=n.n(pv);let pw=e=>e&&e.__isYupSchema__;class p_{constructor(e,t){if(this.refs=e,this.refs=e,"function"==typeof t){this.fn=t;return}if(!py()(t,"is"))throw TypeError("`is:` is required for `when()` conditions");if(!t.then&&!t.otherwise)throw TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:n,then:r,otherwise:i}=t,a="function"==typeof n?n:(...e)=>e.every(e=>e===n);this.fn=function(...e){let t=e.pop(),n=e.pop(),o=a(...e)?r:i;if(o)return"function"==typeof o?o(n):n.concat(o.resolve(t))}}resolve(e,t){let n=this.refs.map(e=>e.getValue(null==t?void 0:t.value,null==t?void 0:t.parent,null==t?void 0:t.context)),r=this.fn.apply(e,n.concat(e,t));if(void 0===r||r===e)return e;if(!pw(r))throw TypeError("conditions must return a schema object");return r.resolve(t)}}let pE=p_;function pS(e){return null==e?[]:[].concat(e)}function pk(){return(pk=Object.assign||function(e){for(var t=1;tpl(t[n])):"function"==typeof e?e(t):e}static isError(e){return e&&"ValidationError"===e.name}constructor(e,t,n,r){super(),this.name="ValidationError",this.value=t,this.path=n,this.type=r,this.errors=[],this.inner=[],pS(e).forEach(e=>{pT.isError(e)?(this.errors.push(...e.errors),this.inner=this.inner.concat(e.inner.length?e.inner:e)):this.errors.push(e)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0],Error.captureStackTrace&&Error.captureStackTrace(this,pT)}}let pM=e=>{let t=!1;return(...n)=>{t||(t=!0,e(...n))}};function pO(e,t){let{endEarly:n,tests:r,args:i,value:a,errors:o,sort:s,path:u}=e,c=pM(t),l=r.length,f=[];if(o=o||[],!l)return o.length?c(new pT(o,a,u)):c(null,a);for(let d=0;d=0||(i[n]=e[n]);return i}function pR(e){function t(t,n){let{value:r,path:i="",label:a,options:o,originalValue:s,sync:u}=t,c=pP(t,["value","path","label","options","originalValue","sync"]),{name:l,test:f,params:d,message:h}=e,{parent:p,context:b}=o;function m(e){return pD.isRef(e)?e.getValue(r,p,b):e}function g(e={}){let t=pL()(pN({value:r,originalValue:s,label:a,path:e.path||i},d,e.params),m),n=new pT(pT.formatError(e.message||h,t),r,t.path,e.type||l);return n.params=t,n}let v=pN({path:i,parent:p,type:l,createError:g,resolve:m,options:o,originalValue:s},c);if(!u){try{Promise.resolve(f.call(v,r,v)).then(e=>{pT.isError(e)?n(e):e?n(null,e):n(g())})}catch(y){n(y)}return}let w;try{var _;if(w=f.call(v,r,v),"function"==typeof(null==(_=w)?void 0:_.then))throw Error(`Validation test of type: "${v.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`)}catch(E){n(E);return}pT.isError(w)?n(w):w?n(null,w):n(g())}return t.OPTIONS=e,t}pD.prototype.__isYupRef=!0;let pj=e=>e.substr(0,e.length-1).substr(1);function pF(e,t,n,r=n){let i,a,o;return t?((0,pC.forEach)(t,(s,u,c)=>{let l=u?pj(s):s;if((e=e.resolve({context:r,parent:i,value:n})).innerType){let f=c?parseInt(l,10):0;if(n&&f>=n.length)throw Error(`Yup.reach cannot resolve an array item at index: ${s}, in the path: ${t}. because there is no value at that index. `);i=n,n=n&&n[f],e=e.innerType}if(!c){if(!e.fields||!e.fields[l])throw Error(`The schema does not contain the path: ${t}. (failed at: ${o} which is a type: "${e._type}")`);i=n,n=n&&n[l],e=e.fields[l]}a=l,o=u?"["+s+"]":"."+s}),{schema:e,parent:i,parentPath:a}):{parent:i,parentPath:t,schema:e}}class pY{constructor(){this.list=new Set,this.refs=new Map}get size(){return this.list.size+this.refs.size}describe(){let e=[];for(let t of this.list)e.push(t);for(let[,n]of this.refs)e.push(n.describe());return e}toArray(){return Array.from(this.list).concat(Array.from(this.refs.values()))}add(e){pD.isRef(e)?this.refs.set(e.key,e):this.list.add(e)}delete(e){pD.isRef(e)?this.refs.delete(e.key):this.list.delete(e)}has(e,t){if(this.list.has(e))return!0;let n,r=this.refs.values();for(;!(n=r.next()).done;)if(t(n.value)===e)return!0;return!1}clone(){let e=new pY;return e.list=new Set(this.list),e.refs=new Map(this.refs),e}merge(e,t){let n=this.clone();return e.list.forEach(e=>n.add(e)),e.refs.forEach(e=>n.add(e)),t.list.forEach(e=>n.delete(e)),t.refs.forEach(e=>n.delete(e)),n}}function pB(){return(pB=Object.assign||function(e){for(var t=1;t{this.typeError(pf.notType)}),this.type=(null==e?void 0:e.type)||"mixed",this.spec=pB({strip:!1,strict:!1,abortEarly:!0,recursive:!0,nullable:!1,presence:"optional"},null==e?void 0:e.spec)}get _type(){return this.type}_typeCheck(e){return!0}clone(e){if(this._mutate)return e&&Object.assign(this.spec,e),this;let t=Object.create(Object.getPrototypeOf(this));return t.type=this.type,t._typeError=this._typeError,t._whitelistError=this._whitelistError,t._blacklistError=this._blacklistError,t._whitelist=this._whitelist.clone(),t._blacklist=this._blacklist.clone(),t.exclusiveTests=pB({},this.exclusiveTests),t.deps=[...this.deps],t.conditions=[...this.conditions],t.tests=[...this.tests],t.transforms=[...this.transforms],t.spec=pn(pB({},this.spec,e)),t}label(e){var t=this.clone();return t.spec.label=e,t}meta(...e){if(0===e.length)return this.spec.meta;let t=this.clone();return t.spec.meta=Object.assign(t.spec.meta||{},e[0]),t}withMutation(e){let t=this._mutate;this._mutate=!0;let n=e(this);return this._mutate=t,n}concat(e){if(!e||e===this)return this;if(e.type!==this.type&&"mixed"!==this.type)throw TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${e.type}`);let t=this,n=e.clone(),r=pB({},t.spec,n.spec);return n.spec=r,n._typeError||(n._typeError=t._typeError),n._whitelistError||(n._whitelistError=t._whitelistError),n._blacklistError||(n._blacklistError=t._blacklistError),n._whitelist=t._whitelist.merge(e._whitelist,e._blacklist),n._blacklist=t._blacklist.merge(e._blacklist,e._whitelist),n.tests=t.tests,n.exclusiveTests=t.exclusiveTests,n.withMutation(t=>{e.tests.forEach(e=>{t.test(e.OPTIONS)})}),n}isType(e){return!!this.spec.nullable&&null===e||this._typeCheck(e)}resolve(e){let t=this;if(t.conditions.length){let n=t.conditions;(t=t.clone()).conditions=[],t=(t=n.reduce((t,n)=>n.resolve(t,e),t)).resolve(e)}return t}cast(e,t={}){let n=this.resolve(pB({value:e},t)),r=n._cast(e,t);if(void 0!==e&&!1!==t.assert&&!0!==n.isType(r)){let i=pl(e),a=pl(r);throw TypeError(`The value of ${t.path||"field"} could not be cast to a value that satisfies the schema type: "${n._type}". + +attempted value: ${i} +`+(a!==i?`result of cast: ${a}`:""))}return r}_cast(e,t){let n=void 0===e?e:this.transforms.reduce((t,n)=>n.call(this,t,e,this),e);return void 0===n&&(n=this.getDefault()),n}_validate(e,t={},n){let{sync:r,path:i,from:a=[],originalValue:o=e,strict:s=this.spec.strict,abortEarly:u=this.spec.abortEarly}=t,c=e;s||(c=this._cast(c,pB({assert:!1},t)));let l={value:c,path:i,options:t,originalValue:o,schema:this,label:this.spec.label,sync:r,from:a},f=[];this._typeError&&f.push(this._typeError),this._whitelistError&&f.push(this._whitelistError),this._blacklistError&&f.push(this._blacklistError),pO({args:l,value:c,path:i,sync:r,tests:f,endEarly:u},e=>{if(e)return void n(e,c);pO({tests:this.tests,args:l,path:i,sync:r,value:c,endEarly:u},n)})}validate(e,t,n){let r=this.resolve(pB({},t,{value:e}));return"function"==typeof n?r._validate(e,t,n):new Promise((n,i)=>r._validate(e,t,(e,t)=>{e?i(e):n(t)}))}validateSync(e,t){let n;return this.resolve(pB({},t,{value:e}))._validate(e,pB({},t,{sync:!0}),(e,t)=>{if(e)throw e;n=t}),n}isValid(e,t){return this.validate(e,t).then(()=>!0,e=>{if(pT.isError(e))return!1;throw e})}isValidSync(e,t){try{return this.validateSync(e,t),!0}catch(n){if(pT.isError(n))return!1;throw n}}_getDefault(){let e=this.spec.default;return null==e?e:"function"==typeof e?e.call(this):pn(e)}getDefault(e){return this.resolve(e||{})._getDefault()}default(e){return 0===arguments.length?this._getDefault():this.clone({default:e})}strict(e=!0){var t=this.clone();return t.spec.strict=e,t}_isPresent(e){return null!=e}defined(e=pf.defined){return this.test({message:e,name:"defined",exclusive:!0,test:e=>void 0!==e})}required(e=pf.required){return this.clone({presence:"required"}).withMutation(t=>t.test({message:e,name:"required",exclusive:!0,test(e){return this.schema._isPresent(e)}}))}notRequired(){var e=this.clone({presence:"optional"});return e.tests=e.tests.filter(e=>"required"!==e.OPTIONS.name),e}nullable(e=!0){return this.clone({nullable:!1!==e})}transform(e){var t=this.clone();return t.transforms.push(e),t}test(...e){let t;if(void 0===(t=1===e.length?"function"==typeof e[0]?{test:e[0]}:e[0]:2===e.length?{name:e[0],test:e[1]}:{name:e[0],message:e[1],test:e[2]}).message&&(t.message=pf.default),"function"!=typeof t.test)throw TypeError("`test` is a required parameters");let n=this.clone(),r=pR(t),i=t.exclusive||t.name&&!0===n.exclusiveTests[t.name];if(t.exclusive&&!t.name)throw TypeError("Exclusive tests must provide a unique `name` identifying the test");return t.name&&(n.exclusiveTests[t.name]=!!t.exclusive),n.tests=n.tests.filter(e=>e.OPTIONS.name!==t.name||!i&&e.OPTIONS.test!==r.OPTIONS.test),n.tests.push(r),n}when(e,t){Array.isArray(e)||"string"==typeof e||(t=e,e=".");let n=this.clone(),r=pS(e).map(e=>new pD(e));return r.forEach(e=>{e.isSibling&&n.deps.push(e.key)}),n.conditions.push(new pE(r,t)),n}typeError(e){var t=this.clone();return t._typeError=pR({message:e,name:"typeError",test(e){return!!(void 0===e||this.schema.isType(e))||this.createError({params:{type:this.schema._type}})}}),t}oneOf(e,t=pf.oneOf){var n=this.clone();return e.forEach(e=>{n._whitelist.add(e),n._blacklist.delete(e)}),n._whitelistError=pR({message:t,name:"oneOf",test(e){if(void 0===e)return!0;let t=this.schema._whitelist;return!!t.has(e,this.resolve)||this.createError({params:{values:t.toArray().join(", ")}})}}),n}notOneOf(e,t=pf.notOneOf){var n=this.clone();return e.forEach(e=>{n._blacklist.add(e),n._whitelist.delete(e)}),n._blacklistError=pR({message:t,name:"notOneOf",test(e){let t=this.schema._blacklist;return!t.has(e,this.resolve)||this.createError({params:{values:t.toArray().join(", ")}})}}),n}strip(e=!0){let t=this.clone();return t.spec.strip=e,t}describe(){let e=this.clone(),{label:t,meta:n}=e.spec,r={meta:n,label:t,type:e.type,oneOf:e._whitelist.describe(),notOneOf:e._blacklist.describe(),tests:e.tests.map(e=>({name:e.OPTIONS.name,params:e.OPTIONS.params})).filter((e,t,n)=>n.findIndex(t=>t.name===e.name)===t)};return r}}for(let pH of(pU.prototype.__isYupSchema__=!0,["validate","validateSync"]))pU.prototype[`${pH}At`]=function(e,t,n={}){let{parent:r,parentPath:i,schema:a}=pF(this,e,t,n.context);return a[pH](r&&r[i],pB({},n,{parent:r,path:e}))};for(let p$ of["equals","is"])pU.prototype[p$]=pU.prototype.oneOf;for(let pz of["not","nope"])pU.prototype[pz]=pU.prototype.notOneOf;pU.prototype.optional=pU.prototype.notRequired;let pG=pU;function pW(){return new pG}pW.prototype=pG.prototype;let pK=e=>null==e;function pV(){return new pq}class pq extends pU{constructor(){super({type:"boolean"}),this.withMutation(()=>{this.transform(function(e){if(!this.isType(e)){if(/^(true|1)$/i.test(String(e)))return!0;if(/^(false|0)$/i.test(String(e)))return!1}return e})})}_typeCheck(e){return e instanceof Boolean&&(e=e.valueOf()),"boolean"==typeof e}isTrue(e=pb.isValue){return this.test({message:e,name:"is-value",exclusive:!0,params:{value:"true"},test:e=>pK(e)||!0===e})}isFalse(e=pb.isValue){return this.test({message:e,name:"is-value",exclusive:!0,params:{value:"false"},test:e=>pK(e)||!1===e})}}pV.prototype=pq.prototype;let pZ=/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i,pX=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,pJ=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,pQ=e=>pK(e)||e===e.trim(),p1=({}).toString();function p0(){return new p2}class p2 extends pU{constructor(){super({type:"string"}),this.withMutation(()=>{this.transform(function(e){if(this.isType(e)||Array.isArray(e))return e;let t=null!=e&&e.toString?e.toString():e;return t===p1?e:t})})}_typeCheck(e){return e instanceof String&&(e=e.valueOf()),"string"==typeof e}_isPresent(e){return super._isPresent(e)&&!!e.length}length(e,t=pd.length){return this.test({message:t,name:"length",exclusive:!0,params:{length:e},test(t){return pK(t)||t.length===this.resolve(e)}})}min(e,t=pd.min){return this.test({message:t,name:"min",exclusive:!0,params:{min:e},test(t){return pK(t)||t.length>=this.resolve(e)}})}max(e,t=pd.max){return this.test({name:"max",exclusive:!0,message:t,params:{max:e},test(t){return pK(t)||t.length<=this.resolve(e)}})}matches(e,t){let n=!1,r,i;return t&&("object"==typeof t?{excludeEmptyString:n=!1,message:r,name:i}=t:r=t),this.test({name:i||"matches",message:r||pd.matches,params:{regex:e},test:t=>pK(t)||""===t&&n||-1!==t.search(e)})}email(e=pd.email){return this.matches(pZ,{name:"email",message:e,excludeEmptyString:!0})}url(e=pd.url){return this.matches(pX,{name:"url",message:e,excludeEmptyString:!0})}uuid(e=pd.uuid){return this.matches(pJ,{name:"uuid",message:e,excludeEmptyString:!1})}ensure(){return this.default("").transform(e=>null===e?"":e)}trim(e=pd.trim){return this.transform(e=>null!=e?e.trim():e).test({message:e,name:"trim",test:pQ})}lowercase(e=pd.lowercase){return this.transform(e=>pK(e)?e:e.toLowerCase()).test({message:e,name:"string_case",exclusive:!0,test:e=>pK(e)||e===e.toLowerCase()})}uppercase(e=pd.uppercase){return this.transform(e=>pK(e)?e:e.toUpperCase()).test({message:e,name:"string_case",exclusive:!0,test:e=>pK(e)||e===e.toUpperCase()})}}p0.prototype=p2.prototype;let p3=e=>e!=+e;function p4(){return new p6}class p6 extends pU{constructor(){super({type:"number"}),this.withMutation(()=>{this.transform(function(e){let t=e;if("string"==typeof t){if(""===(t=t.replace(/\s/g,"")))return NaN;t=+t}return this.isType(t)?t:parseFloat(t)})})}_typeCheck(e){return e instanceof Number&&(e=e.valueOf()),"number"==typeof e&&!p3(e)}min(e,t=ph.min){return this.test({message:t,name:"min",exclusive:!0,params:{min:e},test(t){return pK(t)||t>=this.resolve(e)}})}max(e,t=ph.max){return this.test({message:t,name:"max",exclusive:!0,params:{max:e},test(t){return pK(t)||t<=this.resolve(e)}})}lessThan(e,t=ph.lessThan){return this.test({message:t,name:"max",exclusive:!0,params:{less:e},test(t){return pK(t)||tthis.resolve(e)}})}positive(e=ph.positive){return this.moreThan(0,e)}negative(e=ph.negative){return this.lessThan(0,e)}integer(e=ph.integer){return this.test({name:"integer",message:e,test:e=>pK(e)||Number.isInteger(e)})}truncate(){return this.transform(e=>pK(e)?e:0|e)}round(e){var t,n=["ceil","floor","round","trunc"];if("trunc"===(e=(null==(t=e)?void 0:t.toLowerCase())||"round"))return this.truncate();if(-1===n.indexOf(e.toLowerCase()))throw TypeError("Only valid options for round() are: "+n.join(", "));return this.transform(t=>pK(t)?t:Math[e](t))}}p4.prototype=p6.prototype;var p5=/^(\d{4}|[+\-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,\.](\d{1,}))?)?(?:(Z)|([+\-])(\d{2})(?::?(\d{2}))?)?)?$/;function p8(e){var t,n,r=[1,4,5,6,7,10,11],i=0;if(n=p5.exec(e)){for(var a,o=0;a=r[o];++o)n[a]=+n[a]||0;n[2]=(+n[2]||1)-1,n[3]=+n[3]||1,n[7]=n[7]?String(n[7]).substr(0,3):0,(void 0===n[8]||""===n[8])&&(void 0===n[9]||""===n[9])?t=+new Date(n[1],n[2],n[3],n[4],n[5],n[6],n[7]):("Z"!==n[8]&&void 0!==n[9]&&(i=60*n[10]+n[11],"+"===n[9]&&(i=0-i)),t=Date.UTC(n[1],n[2],n[3],n[4],n[5]+i,n[6],n[7]))}else t=Date.parse?Date.parse(e):NaN;return t}let p9=new Date(""),p7=e=>"[object Date]"===Object.prototype.toString.call(e);function be(){return new bt}class bt extends pU{constructor(){super({type:"date"}),this.withMutation(()=>{this.transform(function(e){return this.isType(e)?e:(e=p8(e),isNaN(e)?p9:new Date(e))})})}_typeCheck(e){return p7(e)&&!isNaN(e.getTime())}prepareParam(e,t){let n;if(pD.isRef(e))n=e;else{let r=this.cast(e);if(!this._typeCheck(r))throw TypeError(`\`${t}\` must be a Date or a value that can be \`cast()\` to a Date`);n=r}return n}min(e,t=pp.min){let n=this.prepareParam(e,"min");return this.test({message:t,name:"min",exclusive:!0,params:{min:e},test(e){return pK(e)||e>=this.resolve(n)}})}max(e,t=pp.max){var n=this.prepareParam(e,"max");return this.test({message:t,name:"max",exclusive:!0,params:{max:e},test(e){return pK(e)||e<=this.resolve(n)}})}}bt.INVALID_DATE=p9,be.prototype=bt.prototype,be.INVALID_DATE=p9;var bn=n(11865),br=n.n(bn),bi=n(68929),ba=n.n(bi),bo=n(67523),bs=n.n(bo),bu=n(94633),bc=n.n(bu);function bl(e,t=[]){let n=[],r=[];function i(e,i){var a=(0,pC.split)(e)[0];~r.indexOf(a)||r.push(a),~t.indexOf(`${i}-${a}`)||n.push([i,a])}for(let a in e)if(py()(e,a)){let o=e[a];~r.indexOf(a)||r.push(a),pD.isRef(o)&&o.isSibling?i(o.path,a):pw(o)&&"deps"in o&&o.deps.forEach(e=>i(e,a))}return bc().array(r,n).reverse()}function bf(e,t){let n=1/0;return e.some((e,r)=>{var i;if((null==(i=t.path)?void 0:i.indexOf(e))!==-1)return n=r,!0}),n}function bd(e){return(t,n)=>bf(e,t)-bf(e,n)}function bh(){return(bh=Object.assign||function(e){for(var t=1;t"[object Object]"===Object.prototype.toString.call(e);function bb(e,t){let n=Object.keys(e.fields);return Object.keys(t).filter(e=>-1===n.indexOf(e))}let bm=bd([]);class bg extends pU{constructor(e){super({type:"object"}),this.fields=Object.create(null),this._sortErrors=bm,this._nodes=[],this._excludedEdges=[],this.withMutation(()=>{this.transform(function(e){if("string"==typeof e)try{e=JSON.parse(e)}catch(t){e=null}return this.isType(e)?e:null}),e&&this.shape(e)})}_typeCheck(e){return bp(e)||"function"==typeof e}_cast(e,t={}){var n;let r=super._cast(e,t);if(void 0===r)return this.getDefault();if(!this._typeCheck(r))return r;let i=this.fields,a=null!=(n=t.stripUnknown)?n:this.spec.noUnknown,o=this._nodes.concat(Object.keys(r).filter(e=>-1===this._nodes.indexOf(e))),s={},u=bh({},t,{parent:s,__validating:t.__validating||!1}),c=!1;for(let l of o){let f=i[l],d=py()(r,l);if(f){let h,p=r[l];u.path=(t.path?`${t.path}.`:"")+l;let b="spec"in(f=f.resolve({value:p,context:t.context,parent:s}))?f.spec:void 0,m=null==b?void 0:b.strict;if(null==b?void 0:b.strip){c=c||l in r;continue}void 0!==(h=t.__validating&&m?r[l]:f.cast(r[l],u))&&(s[l]=h)}else d&&!a&&(s[l]=r[l]);s[l]!==r[l]&&(c=!0)}return c?s:r}_validate(e,t={},n){let r=[],{sync:i,from:a=[],originalValue:o=e,abortEarly:s=this.spec.abortEarly,recursive:u=this.spec.recursive}=t;a=[{schema:this,value:o},...a],t.__validating=!0,t.originalValue=o,t.from=a,super._validate(e,t,(e,c)=>{if(e){if(!pT.isError(e)||s)return void n(e,c);r.push(e)}if(!u||!bp(c)){n(r[0]||null,c);return}o=o||c;let l=this._nodes.map(e=>(n,r)=>{let i=-1===e.indexOf(".")?(t.path?`${t.path}.`:"")+e:`${t.path||""}["${e}"]`,s=this.fields[e];if(s&&"validate"in s){s.validate(c[e],bh({},t,{path:i,from:a,strict:!0,parent:c,originalValue:o[e]}),r);return}r(null)});pO({sync:i,tests:l,value:c,errors:r,endEarly:s,sort:this._sortErrors,path:t.path},n)})}clone(e){let t=super.clone(e);return t.fields=bh({},this.fields),t._nodes=this._nodes,t._excludedEdges=this._excludedEdges,t._sortErrors=this._sortErrors,t}concat(e){let t=super.concat(e),n=t.fields;for(let[r,i]of Object.entries(this.fields)){let a=n[r];void 0===a?n[r]=i:a instanceof pU&&i instanceof pU&&(n[r]=i.concat(a))}return t.withMutation(()=>t.shape(n))}getDefaultFromShape(){let e={};return this._nodes.forEach(t=>{let n=this.fields[t];e[t]="default"in n?n.getDefault():void 0}),e}_getDefault(){return"default"in this.spec?super._getDefault():this._nodes.length?this.getDefaultFromShape():void 0}shape(e,t=[]){let n=this.clone(),r=Object.assign(n.fields,e);if(n.fields=r,n._sortErrors=bd(Object.keys(r)),t.length){Array.isArray(t[0])||(t=[t]);let i=t.map(([e,t])=>`${e}-${t}`);n._excludedEdges=n._excludedEdges.concat(i)}return n._nodes=bl(r,n._excludedEdges),n}pick(e){let t={};for(let n of e)this.fields[n]&&(t[n]=this.fields[n]);return this.clone().withMutation(e=>(e.fields={},e.shape(t)))}omit(e){let t=this.clone(),n=t.fields;for(let r of(t.fields={},e))delete n[r];return t.withMutation(()=>t.shape(n))}from(e,t,n){let r=(0,pC.getter)(e,!0);return this.transform(i=>{if(null==i)return i;let a=i;return py()(i,e)&&(a=bh({},i),n||delete a[e],a[t]=r(i)),a})}noUnknown(e=!0,t=pm.noUnknown){"string"==typeof e&&(t=e,e=!0);let n=this.test({name:"noUnknown",exclusive:!0,message:t,test(t){if(null==t)return!0;let n=bb(this.schema,t);return!e||0===n.length||this.createError({params:{unknown:n.join(", ")}})}});return n.spec.noUnknown=e,n}unknown(e=!0,t=pm.noUnknown){return this.noUnknown(!e,t)}transformKeys(e){return this.transform(t=>t&&bs()(t,(t,n)=>e(n)))}camelCase(){return this.transformKeys(ba())}snakeCase(){return this.transformKeys(br())}constantCase(){return this.transformKeys(e=>br()(e).toUpperCase())}describe(){let e=super.describe();return e.fields=pL()(this.fields,e=>e.describe()),e}}function bv(e){return new bg(e)}function by(){return(by=Object.assign||function(e){for(var t=1;t{this.transform(function(e){if("string"==typeof e)try{e=JSON.parse(e)}catch(t){e=null}return this.isType(e)?e:null})})}_typeCheck(e){return Array.isArray(e)}get _subType(){return this.innerType}_cast(e,t){let n=super._cast(e,t);if(!this._typeCheck(n)||!this.innerType)return n;let r=!1,i=n.map((e,n)=>{let i=this.innerType.cast(e,by({},t,{path:`${t.path||""}[${n}]`}));return i!==e&&(r=!0),i});return r?i:n}_validate(e,t={},n){var r,i;let a=[],o=t.sync,s=t.path,u=this.innerType,c=null!=(r=t.abortEarly)?r:this.spec.abortEarly,l=null!=(i=t.recursive)?i:this.spec.recursive,f=null!=t.originalValue?t.originalValue:e;super._validate(e,t,(e,r)=>{if(e){if(!pT.isError(e)||c)return void n(e,r);a.push(e)}if(!l||!u||!this._typeCheck(r)){n(a[0]||null,r);return}f=f||r;let i=Array(r.length);for(let d=0;du.validate(h,b,t)}pO({sync:o,path:s,value:r,errors:a,endEarly:c,tests:i},n)})}clone(e){let t=super.clone(e);return t.innerType=this.innerType,t}concat(e){let t=super.concat(e);return t.innerType=this.innerType,e.innerType&&(t.innerType=t.innerType?t.innerType.concat(e.innerType):e.innerType),t}of(e){let t=this.clone();if(!pw(e))throw TypeError("`array.of()` sub-schema must be a valid yup schema not: "+pl(e));return t.innerType=e,t}length(e,t=pg.length){return this.test({message:t,name:"length",exclusive:!0,params:{length:e},test(t){return pK(t)||t.length===this.resolve(e)}})}min(e,t){return t=t||pg.min,this.test({message:t,name:"min",exclusive:!0,params:{min:e},test(t){return pK(t)||t.length>=this.resolve(e)}})}max(e,t){return t=t||pg.max,this.test({message:t,name:"max",exclusive:!0,params:{max:e},test(t){return pK(t)||t.length<=this.resolve(e)}})}ensure(){return this.default(()=>[]).transform((e,t)=>this._typeCheck(e)?e:null==t?[]:[].concat(t))}compact(e){let t=e?(t,n,r)=>!e(t,n,r):e=>!!e;return this.transform(e=>null!=e?e.filter(t):e)}describe(){let e=super.describe();return this.innerType&&(e.innerType=this.innerType.describe()),e}nullable(e=!0){return super.nullable(e)}defined(){return super.defined()}required(e){return super.required(e)}}bw.prototype=b_.prototype;var bE=bv().shape({name:p0().required("Required"),url:p0().required("Required")}),bS=function(e){var t=e.initialValues,n=e.onSubmit,r=e.submitButtonText,i=e.nameDisabled,a=void 0!==i&&i;return l.createElement(hT,{initialValues:t,validationSchema:bE,onSubmit:n},function(e){var t=e.isSubmitting;return l.createElement(l.Fragment,null,l.createElement(hR,{"data-testid":"bridge-form",noValidate:!0},l.createElement(d.Z,{container:!0,spacing:16},l.createElement(d.Z,{item:!0,xs:12,md:7},l.createElement(hP,{component:hX,id:"name",name:"name",label:"Name",disabled:a,required:!0,fullWidth:!0,FormHelperTextProps:{"data-testid":"name-helper-text"}})),l.createElement(d.Z,{item:!0,xs:12,md:7},l.createElement(hP,{component:hX,id:"url",name:"url",label:"Bridge URL",placeholder:"https://",required:!0,fullWidth:!0,FormHelperTextProps:{"data-testid":"url-helper-text"}})),l.createElement(d.Z,{item:!0,xs:12,md:7},l.createElement(d.Z,{container:!0,spacing:16},l.createElement(d.Z,{item:!0,xs:7},l.createElement(hP,{component:hX,id:"minimumContractPayment",name:"minimumContractPayment",label:"Minimum Contract Payment",placeholder:"0",fullWidth:!0,inputProps:{min:0},FormHelperTextProps:{"data-testid":"minimumContractPayment-helper-text"}})),l.createElement(d.Z,{item:!0,xs:7},l.createElement(hP,{component:hX,id:"confirmations",name:"confirmations",label:"Confirmations",placeholder:"0",type:"number",fullWidth:!0,inputProps:{min:0},FormHelperTextProps:{"data-testid":"confirmations-helper-text"}})))),l.createElement(d.Z,{item:!0,xs:12,md:7},l.createElement(ok.default,{variant:"contained",color:"primary",type:"submit",disabled:t,size:"large"},r)))))})},bk=function(e){var t=e.bridge,n=e.onSubmit,r={name:t.name,url:t.url,minimumContractPayment:t.minimumContractPayment,confirmations:t.confirmations};return l.createElement(ig,null,l.createElement(d.Z,{container:!0,spacing:40},l.createElement(d.Z,{item:!0,xs:12,md:11,lg:9},l.createElement(r5.Z,null,l.createElement(sl.Z,{title:"Edit Bridge",action:l.createElement(aA.Z,{component:tz,href:"/bridges/".concat(t.id)},"Cancel")}),l.createElement(aW.Z,null,l.createElement(bS,{nameDisabled:!0,initialValues:r,onSubmit:n,submitButtonText:"Save Bridge"}))))))};function bx(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]e.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]e.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&void 0!==arguments[0]&&arguments[0],t=e?function(){return l.createElement(x.default,{variant:"body1"},"Loading...")}:function(){return null};return{isLoading:e,LoadingPlaceholder:t}},mc=n(76023);function ml(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]e.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function mB(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n=4?[e[0],e[1],e[2],e[3],"".concat(e[0],".").concat(e[1]),"".concat(e[0],".").concat(e[2]),"".concat(e[0],".").concat(e[3]),"".concat(e[1],".").concat(e[0]),"".concat(e[1],".").concat(e[2]),"".concat(e[1],".").concat(e[3]),"".concat(e[2],".").concat(e[0]),"".concat(e[2],".").concat(e[1]),"".concat(e[2],".").concat(e[3]),"".concat(e[3],".").concat(e[0]),"".concat(e[3],".").concat(e[1]),"".concat(e[3],".").concat(e[2]),"".concat(e[0],".").concat(e[1],".").concat(e[2]),"".concat(e[0],".").concat(e[1],".").concat(e[3]),"".concat(e[0],".").concat(e[2],".").concat(e[1]),"".concat(e[0],".").concat(e[2],".").concat(e[3]),"".concat(e[0],".").concat(e[3],".").concat(e[1]),"".concat(e[0],".").concat(e[3],".").concat(e[2]),"".concat(e[1],".").concat(e[0],".").concat(e[2]),"".concat(e[1],".").concat(e[0],".").concat(e[3]),"".concat(e[1],".").concat(e[2],".").concat(e[0]),"".concat(e[1],".").concat(e[2],".").concat(e[3]),"".concat(e[1],".").concat(e[3],".").concat(e[0]),"".concat(e[1],".").concat(e[3],".").concat(e[2]),"".concat(e[2],".").concat(e[0],".").concat(e[1]),"".concat(e[2],".").concat(e[0],".").concat(e[3]),"".concat(e[2],".").concat(e[1],".").concat(e[0]),"".concat(e[2],".").concat(e[1],".").concat(e[3]),"".concat(e[2],".").concat(e[3],".").concat(e[0]),"".concat(e[2],".").concat(e[3],".").concat(e[1]),"".concat(e[3],".").concat(e[0],".").concat(e[1]),"".concat(e[3],".").concat(e[0],".").concat(e[2]),"".concat(e[3],".").concat(e[1],".").concat(e[0]),"".concat(e[3],".").concat(e[1],".").concat(e[2]),"".concat(e[3],".").concat(e[2],".").concat(e[0]),"".concat(e[3],".").concat(e[2],".").concat(e[1]),"".concat(e[0],".").concat(e[1],".").concat(e[2],".").concat(e[3]),"".concat(e[0],".").concat(e[1],".").concat(e[3],".").concat(e[2]),"".concat(e[0],".").concat(e[2],".").concat(e[1],".").concat(e[3]),"".concat(e[0],".").concat(e[2],".").concat(e[3],".").concat(e[1]),"".concat(e[0],".").concat(e[3],".").concat(e[1],".").concat(e[2]),"".concat(e[0],".").concat(e[3],".").concat(e[2],".").concat(e[1]),"".concat(e[1],".").concat(e[0],".").concat(e[2],".").concat(e[3]),"".concat(e[1],".").concat(e[0],".").concat(e[3],".").concat(e[2]),"".concat(e[1],".").concat(e[2],".").concat(e[0],".").concat(e[3]),"".concat(e[1],".").concat(e[2],".").concat(e[3],".").concat(e[0]),"".concat(e[1],".").concat(e[3],".").concat(e[0],".").concat(e[2]),"".concat(e[1],".").concat(e[3],".").concat(e[2],".").concat(e[0]),"".concat(e[2],".").concat(e[0],".").concat(e[1],".").concat(e[3]),"".concat(e[2],".").concat(e[0],".").concat(e[3],".").concat(e[1]),"".concat(e[2],".").concat(e[1],".").concat(e[0],".").concat(e[3]),"".concat(e[2],".").concat(e[1],".").concat(e[3],".").concat(e[0]),"".concat(e[2],".").concat(e[3],".").concat(e[0],".").concat(e[1]),"".concat(e[2],".").concat(e[3],".").concat(e[1],".").concat(e[0]),"".concat(e[3],".").concat(e[0],".").concat(e[1],".").concat(e[2]),"".concat(e[3],".").concat(e[0],".").concat(e[2],".").concat(e[1]),"".concat(e[3],".").concat(e[1],".").concat(e[0],".").concat(e[2]),"".concat(e[3],".").concat(e[1],".").concat(e[2],".").concat(e[0]),"".concat(e[3],".").concat(e[2],".").concat(e[0],".").concat(e[1]),"".concat(e[3],".").concat(e[2],".").concat(e[1],".").concat(e[0])]:void 0}var mZ={};function mX(e){if(0===e.length||1===e.length)return e;var t=e.join(".");return mZ[t]||(mZ[t]=mq(e)),mZ[t]}function mJ(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;return mX(e.filter(function(e){return"token"!==e})).reduce(function(e,t){return mK({},e,n[t])},t)}function mQ(e){return e.join(" ")}function m1(e,t){var n=0;return function(r){return n+=1,r.map(function(r,i){return m0({node:r,stylesheet:e,useInlineStyles:t,key:"code-segment-".concat(n,"-").concat(i)})})}}function m0(e){var t=e.node,n=e.stylesheet,r=e.style,i=void 0===r?{}:r,a=e.useInlineStyles,o=e.key,s=t.properties,u=t.type,c=t.tagName,f=t.value;if("text"===u)return f;if(c){var d,h=m1(n,a);if(a){var p=Object.keys(n).reduce(function(e,t){return t.split(".").forEach(function(t){e.includes(t)||e.push(t)}),e},[]),b=s.className&&s.className.includes("token")?["token"]:[],m=s.className&&b.concat(s.className.filter(function(e){return!p.includes(e)}));d=mK({},s,{className:mQ(m)||void 0,style:mJ(s.className,Object.assign({},s.style,i),n)})}else d=mK({},s,{className:mQ(s.className)});var g=h(t.children);return l.createElement(c,(0,mV.Z)({key:o},d),g)}}let m2=function(e,t){return -1!==e.listLanguages().indexOf(t)};var m3=/\n/g;function m4(e){return e.match(m3)}function m6(e){var t=e.lines,n=e.startingLineNumber,r=e.style;return t.map(function(e,t){var i=t+n;return l.createElement("span",{key:"line-".concat(t),className:"react-syntax-highlighter-line-number",style:"function"==typeof r?r(i):r},"".concat(i,"\n"))})}function m5(e){var t=e.codeString,n=e.codeStyle,r=e.containerStyle,i=void 0===r?{float:"left",paddingRight:"10px"}:r,a=e.numberStyle,o=void 0===a?{}:a,s=e.startingLineNumber;return l.createElement("code",{style:Object.assign({},n,i)},m6({lines:t.replace(/\n$/,"").split("\n"),style:o,startingLineNumber:s}))}function m8(e){return"".concat(e.toString().length,".25em")}function m9(e,t){return{type:"element",tagName:"span",properties:{key:"line-number--".concat(e),className:["comment","linenumber","react-syntax-highlighter-line-number"],style:t},children:[{type:"text",value:e}]}}function m7(e,t,n){var r,i={display:"inline-block",minWidth:m8(n),paddingRight:"1em",textAlign:"right",userSelect:"none"};return mK({},i,"function"==typeof e?e(t):e)}function ge(e){var t=e.children,n=e.lineNumber,r=e.lineNumberStyle,i=e.largestLineNumber,a=e.showInlineLineNumbers,o=e.lineProps,s=void 0===o?{}:o,u=e.className,c=void 0===u?[]:u,l=e.showLineNumbers,f=e.wrapLongLines,d="function"==typeof s?s(n):s;if(d.className=c,n&&a){var h=m7(r,n,i);t.unshift(m9(n,h))}return f&l&&(d.style=mK({},d.style,{display:"flex"})),{type:"element",tagName:"span",properties:d,children:t}}function gt(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=0;r2&&void 0!==arguments[2]?arguments[2]:[];return ge({children:e,lineNumber:t,lineNumberStyle:s,largestLineNumber:o,showInlineLineNumbers:i,lineProps:n,className:a,showLineNumbers:r,wrapLongLines:u})}function b(e,t){if(r&&t&&i){var n=m7(s,t,o);e.unshift(m9(t,n))}return e}function m(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return t||r.length>0?p(e,n,r):b(e,n)}for(var g=function(){var e=l[h],t=e.children[0].value;if(m4(t)){var n=t.split("\n");n.forEach(function(t,i){var o=r&&f.length+a,s={type:"text",value:"".concat(t,"\n")};if(0===i){var u=l.slice(d+1,h).concat(ge({children:[s],className:e.properties.className})),c=m(u,o);f.push(c)}else if(i===n.length-1){if(l[h+1]&&l[h+1].children&&l[h+1].children[0]){var p={type:"text",value:"".concat(t)},b=ge({children:[p],className:e.properties.className});l.splice(h+1,0,b)}else{var g=[s],v=m(g,o,e.properties.className);f.push(v)}}else{var y=[s],w=m(y,o,e.properties.className);f.push(w)}}),d=h}h++};h code[class*="language-"]':{background:"#f5f2f0",padding:".1em",borderRadius:".3em",whiteSpace:"normal"},comment:{color:"slategray"},prolog:{color:"slategray"},doctype:{color:"slategray"},cdata:{color:"slategray"},punctuation:{color:"#999"},namespace:{Opacity:".7"},property:{color:"#905"},tag:{color:"#905"},boolean:{color:"#905"},number:{color:"#905"},constant:{color:"#905"},symbol:{color:"#905"},deleted:{color:"#905"},selector:{color:"#690"},"attr-name":{color:"#690"},string:{color:"#690"},char:{color:"#690"},builtin:{color:"#690"},inserted:{color:"#690"},operator:{color:"#9a6e3a",background:"hsla(0, 0%, 100%, .5)"},entity:{color:"#9a6e3a",background:"hsla(0, 0%, 100%, .5)",cursor:"help"},url:{color:"#9a6e3a",background:"hsla(0, 0%, 100%, .5)"},".language-css .token.string":{color:"#9a6e3a",background:"hsla(0, 0%, 100%, .5)"},".style .token.string":{color:"#9a6e3a",background:"hsla(0, 0%, 100%, .5)"},atrule:{color:"#07a"},"attr-value":{color:"#07a"},keyword:{color:"#07a"},function:{color:"#DD4A68"},"class-name":{color:"#DD4A68"},regex:{color:"#e90"},important:{color:"#e90",fontWeight:"bold"},variable:{color:"#e90"},bold:{fontWeight:"bold"},italic:{fontStyle:"italic"}};var gu=n(98695),gc=n.n(gu);let gl=["abap","abnf","actionscript","ada","agda","al","antlr4","apacheconf","apl","applescript","aql","arduino","arff","asciidoc","asm6502","aspnet","autohotkey","autoit","bash","basic","batch","bbcode","birb","bison","bnf","brainfuck","brightscript","bro","bsl","c","cil","clike","clojure","cmake","coffeescript","concurnas","cpp","crystal","csharp","csp","css-extras","css","cypher","d","dart","dax","dhall","diff","django","dns-zone-file","docker","ebnf","editorconfig","eiffel","ejs","elixir","elm","erb","erlang","etlua","excel-formula","factor","firestore-security-rules","flow","fortran","fsharp","ftl","gcode","gdscript","gedcom","gherkin","git","glsl","gml","go","graphql","groovy","haml","handlebars","haskell","haxe","hcl","hlsl","hpkp","hsts","http","ichigojam","icon","iecst","ignore","inform7","ini","io","j","java","javadoc","javadoclike","javascript","javastacktrace","jolie","jq","js-extras","js-templates","jsdoc","json","json5","jsonp","jsstacktrace","jsx","julia","keyman","kotlin","latex","latte","less","lilypond","liquid","lisp","livescript","llvm","lolcode","lua","makefile","markdown","markup-templating","markup","matlab","mel","mizar","mongodb","monkey","moonscript","n1ql","n4js","nand2tetris-hdl","naniscript","nasm","neon","nginx","nim","nix","nsis","objectivec","ocaml","opencl","oz","parigp","parser","pascal","pascaligo","pcaxis","peoplecode","perl","php-extras","php","phpdoc","plsql","powerquery","powershell","processing","prolog","properties","protobuf","pug","puppet","pure","purebasic","purescript","python","q","qml","qore","r","racket","reason","regex","renpy","rest","rip","roboconf","robotframework","ruby","rust","sas","sass","scala","scheme","scss","shell-session","smali","smalltalk","smarty","sml","solidity","solution-file","soy","sparql","splunk-spl","sqf","sql","stan","stylus","swift","t4-cs","t4-templating","t4-vb","tap","tcl","textile","toml","tsx","tt2","turtle","twig","typescript","typoscript","unrealscript","vala","vbnet","velocity","verilog","vhdl","vim","visual-basic","warpscript","wasm","wiki","xeora","xml-doc","xojo","xquery","yaml","yang","zig"];var gf=go(gc(),gs);gf.supportedLanguages=gl;let gd=gf;var gh=n(64566);function gp(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function gb(){var e=gp(["\n query FetchConfigV2 {\n configv2 {\n user\n effective\n }\n }\n"]);return gb=function(){return e},e}var gm=n0(gb()),gg=function(e){var t=e.children;return l.createElement(ir.Z,null,l.createElement(r7.default,{component:"th",scope:"row",colSpan:3},t))},gv=function(){return l.createElement(gg,null,"...")},gy=function(e){var t=e.children;return l.createElement(gg,null,t)},gw=function(e){var t=e.loading,n=e.toml,r=e.error,i=void 0===r?"":r,a=e.title,o=e.expanded;if(i)return l.createElement(gy,null,i);if(t)return l.createElement(gv,null);a||(a="TOML");var s={display:"block"};return l.createElement(x.default,null,l.createElement(mP.Z,{defaultExpanded:o},l.createElement(mR.Z,{expandIcon:l.createElement(gh.Z,null)},a),l.createElement(mj.Z,{style:s},l.createElement(gd,{language:"toml",style:gs},n))))},g_=function(){var e=rv(gm,{fetchPolicy:"cache-and-network"}),t=e.data,n=e.loading,r=e.error;return(null==t?void 0:t.configv2.effective)=="N/A"?l.createElement(l.Fragment,null,l.createElement(d.Z,{item:!0,xs:12},l.createElement(r5.Z,null,l.createElement(sl.Z,{title:"TOML Configuration"}),l.createElement(gw,{title:"V2 config dump:",error:null==r?void 0:r.message,loading:n,toml:null==t?void 0:t.configv2.user,showHead:!0})))):l.createElement(l.Fragment,null,l.createElement(d.Z,{container:!0},l.createElement(d.Z,{item:!0,xs:12},l.createElement(r5.Z,null,l.createElement(sl.Z,{title:"TOML Configuration"}),l.createElement(gw,{title:"User specified:",error:null==r?void 0:r.message,loading:n,toml:null==t?void 0:t.configv2.user,showHead:!0,expanded:!0}),l.createElement(gw,{title:"Effective (with defaults):",error:null==r?void 0:r.message,loading:n,toml:null==t?void 0:t.configv2.effective,showHead:!0})))))},gE=n(34823),gS=function(e){return(0,b.createStyles)({cell:{paddingTop:1.5*e.spacing.unit,paddingBottom:1.5*e.spacing.unit}})},gk=(0,b.withStyles)(gS)(function(e){var t=e.classes,n=(0,A.I0)();(0,l.useEffect)(function(){n((0,ty.DQ)())});var r=(0,A.v9)(gE.N,A.wU);return l.createElement(r5.Z,null,l.createElement(sl.Z,{title:"Node"}),l.createElement(r8.Z,null,l.createElement(r9.Z,null,l.createElement(ir.Z,null,l.createElement(r7.default,{className:t.cell},l.createElement(x.default,null,"Version"),l.createElement(x.default,{variant:"subtitle1",color:"textSecondary"},r.version))),l.createElement(ir.Z,null,l.createElement(r7.default,{className:t.cell},l.createElement(x.default,null,"SHA"),l.createElement(x.default,{variant:"subtitle1",color:"textSecondary"},r.commitSHA))))))}),gx=function(){return l.createElement(ig,null,l.createElement(d.Z,{container:!0},l.createElement(d.Z,{item:!0,sm:12,md:8},l.createElement(d.Z,{container:!0},l.createElement(g_,null))),l.createElement(d.Z,{item:!0,sm:12,md:4},l.createElement(d.Z,{container:!0},l.createElement(d.Z,{item:!0,xs:12},l.createElement(gk,null)),l.createElement(d.Z,{item:!0,xs:12},l.createElement(mN,null)),l.createElement(d.Z,{item:!0,xs:12},l.createElement(mE,null))))))},gT=function(){return l.createElement(gx,null)},gM=function(){return l.createElement(gT,null)},gO=n(44431),gA=1e18,gL=function(e){return new gO.BigNumber(e).dividedBy(gA).toFixed(8)},gC=function(e){var t=e.keys,n=e.chainID,r=e.hideHeaderTitle;return l.createElement(l.Fragment,null,l.createElement(sl.Z,{title:!r&&"Account Balances",subheader:"Chain ID "+n}),l.createElement(aW.Z,null,l.createElement(w.default,{dense:!1,disablePadding:!0},t&&t.map(function(e,r){return l.createElement(l.Fragment,null,l.createElement(_.default,{disableGutters:!0,key:["acc-balance",n.toString(),r.toString()].join("-")},l.createElement(E.Z,{primary:l.createElement(l.Fragment,null,l.createElement(d.Z,{container:!0,spacing:16},l.createElement(d.Z,{item:!0,xs:12},l.createElement(op,{title:"Address"}),l.createElement(ob,{value:e.address})),l.createElement(d.Z,{item:!0,xs:6},l.createElement(op,{title:"Native Token Balance"}),l.createElement(ob,{value:e.ethBalance||"--"})),l.createElement(d.Z,{item:!0,xs:6},l.createElement(op,{title:"LINK Balance"}),l.createElement(ob,{value:e.linkBalance?gL(e.linkBalance):"--"}))))})),r+1s&&l.createElement(gB.Z,null,l.createElement(ir.Z,null,l.createElement(r7.default,{className:r.footer},l.createElement(aA.Z,{href:"/runs",component:tz},"View More"))))))});function vt(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function vn(){var e=vt(["\n ","\n query FetchRecentJobRuns($offset: Int, $limit: Int) {\n jobRuns(offset: $offset, limit: $limit) {\n results {\n ...RecentJobRunsPayload_ResultsFields\n }\n metadata {\n total\n }\n }\n }\n"]);return vn=function(){return e},e}var vr=5,vi=n0(vn(),g9),va=function(){var e=rv(vi,{variables:{offset:0,limit:vr},fetchPolicy:"cache-and-network"}),t=e.data,n=e.loading,r=e.error;return l.createElement(ve,{data:t,errorMsg:null==r?void 0:r.message,loading:n,maxRunsSize:vr})},vo=function(e){return(0,b.createStyles)({style:{textAlign:"center",padding:2.5*e.spacing.unit,position:"fixed",left:"0",bottom:"0",width:"100%",borderRadius:0},bareAnchor:{color:e.palette.common.black,textDecoration:"none"}})},vs=(0,b.withStyles)(vo)(function(e){var t=e.classes,n=(0,A.v9)(gE.N,A.wU),r=(0,A.I0)();return(0,l.useEffect)(function(){r((0,ty.DQ)())}),l.createElement(ii.default,{className:t.style},l.createElement(x.default,null,"Chainlink Node ",n.version," at commit"," ",l.createElement("a",{target:"_blank",rel:"noopener noreferrer",href:"https://github.com/smartcontractkit/chainlink/commit/".concat(n.commitSHA),className:t.bareAnchor},n.commitSHA)))}),vu=function(e){return(0,b.createStyles)({cell:{borderColor:e.palette.divider,borderTop:"1px solid",borderBottom:"none",paddingTop:2*e.spacing.unit,paddingBottom:2*e.spacing.unit,paddingLeft:2*e.spacing.unit},block:{display:"block"},overflowEllipsis:{textOverflow:"ellipsis",overflow:"hidden"}})},vc=(0,b.withStyles)(vu)(function(e){var t=e.classes,n=e.job;return l.createElement(ir.Z,null,l.createElement(r7.default,{scope:"row",className:t.cell},l.createElement(d.Z,{container:!0,spacing:0},l.createElement(d.Z,{item:!0,xs:12},l.createElement(ih,{href:"/jobs/".concat(n.id),classes:{linkContent:t.block}},l.createElement(x.default,{className:t.overflowEllipsis,variant:"body1",component:"span",color:"primary"},n.name||n.id))),l.createElement(d.Z,{item:!0,xs:12},l.createElement(x.default,{variant:"body1",color:"textSecondary"},"Created ",l.createElement(aO,{tooltip:!0},n.createdAt))))))});function vl(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function vf(){var e=vl(["\n fragment RecentJobsPayload_ResultsFields on Job {\n id\n name\n createdAt\n }\n"]);return vf=function(){return e},e}var vd=n0(vf()),vh=function(){return(0,b.createStyles)({cardHeader:{borderBottom:0},table:{tableLayout:"fixed"}})},vp=(0,b.withStyles)(vh)(function(e){var t,n,r=e.classes,i=e.data,a=e.errorMsg,o=e.loading;return l.createElement(r5.Z,null,l.createElement(sl.Z,{title:"Recent Jobs",className:r.cardHeader}),l.createElement(r8.Z,{className:r.table},l.createElement(r9.Z,null,l.createElement(g$,{visible:o}),l.createElement(gz,{visible:(null===(t=null==i?void 0:i.jobs.results)||void 0===t?void 0:t.length)===0},"No recently created jobs"),l.createElement(gU,{msg:a}),null===(n=null==i?void 0:i.jobs.results)||void 0===n?void 0:n.map(function(e,t){return l.createElement(vc,{job:e,key:t})}))))});function vb(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function vm(){var e=vb(["\n ","\n query FetchRecentJobs($offset: Int, $limit: Int) {\n jobs(offset: $offset, limit: $limit) {\n results {\n ...RecentJobsPayload_ResultsFields\n }\n }\n }\n"]);return vm=function(){return e},e}var vg=5,vv=n0(vm(),vd),vy=function(){var e=rv(vv,{variables:{offset:0,limit:vg},fetchPolicy:"cache-and-network"}),t=e.data,n=e.loading,r=e.error;return l.createElement(vp,{data:t,errorMsg:null==r?void 0:r.message,loading:n})},vw=function(){return l.createElement(ig,null,l.createElement(d.Z,{container:!0},l.createElement(d.Z,{item:!0,xs:8},l.createElement(va,null)),l.createElement(d.Z,{item:!0,xs:4},l.createElement(d.Z,{container:!0},l.createElement(d.Z,{item:!0,xs:12},l.createElement(gY,null)),l.createElement(d.Z,{item:!0,xs:12},l.createElement(vy,null))))),l.createElement(vs,null))},v_=function(){return l.createElement(vw,null)},vE=function(){return l.createElement(v_,null)},vS=n(87239),vk=function(e){switch(e){case"DirectRequestSpec":return"Direct Request";case"FluxMonitorSpec":return"Flux Monitor";default:return e.replace(/Spec$/,"")}},vx=n(5022),vT=n(78718),vM=n.n(vT);function vO(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n1?t-1:0),r=1;r1?t-1:0),r=1;re.length)&&(t=e.length);for(var n=0,r=Array(t);ne.length)&&(t=e.length);for(var n=0,r=Array(t);ne.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&n.map(function(e){return l.createElement(ir.Z,{key:e.id,style:{cursor:"pointer"},onClick:function(){return r.push("/runs/".concat(e.id))}},l.createElement(r7.default,{className:t.idCell,scope:"row"},l.createElement("div",{className:t.runDetails},l.createElement(x.default,{variant:"h5",color:"primary",component:"span"},e.id))),l.createElement(r7.default,{className:t.stampCell},l.createElement(x.default,{variant:"body1",color:"textSecondary",className:t.stamp},"Created ",l.createElement(aO,{tooltip:!0},e.createdAt))),l.createElement(r7.default,{className:t.statusCell,scope:"row"},l.createElement(x.default,{variant:"body1",className:O()(t.status,yh(t,e.status))},e.status.toLowerCase())))})))}),yb=n(16839),ym=n.n(yb);function yg(e){var t=e.replace(/\w+\s*=\s*<([^>]|[\r\n])*>/g,""),n=ym().read(t),r=n.edges();return n.nodes().map(function(e){var t={id:e,parentIds:r.filter(function(t){return t.w===e}).map(function(e){return e.v})};return Object.keys(n.node(e)).length>0&&(t.attributes=n.node(e)),t})}var yv=n(94164),yy=function(e){var t=e.data,n=[];return(null==t?void 0:t.attributes)&&Object.keys(t.attributes).forEach(function(e){var r;n.push(l.createElement("div",{key:e},l.createElement(x.default,{variant:"body1",color:"textSecondary",component:"div"},l.createElement("b",null,e,":")," ",null===(r=t.attributes)||void 0===r?void 0:r[e])))}),l.createElement("div",null,t&&l.createElement(x.default,{variant:"body1",color:"textPrimary"},l.createElement("b",null,t.id)),n)},yw=n(73343),y_=n(3379),yE=n.n(y_);function yS(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);nwindow.innerWidth?u-r.getBoundingClientRect().width-a:u+a,n=c+r.getBoundingClientRect().height+i>window.innerHeight?c-r.getBoundingClientRect().height-a:c+a,r.style.opacity=String(1),r.style.top="".concat(n,"px"),r.style.left="".concat(t,"px"),r.style.zIndex=String(1)}},h=function(e){var t=document.getElementById("tooltip-d3-chart-".concat(e));t&&(t.style.opacity=String(0),t.style.zIndex=String(-1))};return l.createElement("div",{style:{fontFamily:"sans-serif",fontWeight:"normal"}},l.createElement(yv.kJ,{id:"task-list-graph-d3",data:i,config:s,onMouseOverNode:d,onMouseOutNode:h},"D3 chart"),n.map(function(e){return l.createElement("div",{key:"d3-tooltip-key-".concat(e.id),id:"tooltip-d3-chart-".concat(e.id),style:{position:"absolute",opacity:"0",border:"1px solid rgba(0, 0, 0, 0.1)",padding:yw.r.spacing.unit,background:"white",borderRadius:5,zIndex:-1,inlineSize:"min-content"}},l.createElement(yy,{data:e}))}))};function yL(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);nyY&&l.createElement("div",{className:t.runDetails},l.createElement(aA.Z,{href:"/jobs/".concat(n.id,"/runs"),component:tz},"View more")))),l.createElement(d.Z,{item:!0,xs:12,sm:6},l.createElement(yF,{observationSource:n.observationSource})))});function yH(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);ne.length)&&(t=e.length);for(var n=0,r=Array(t);ne.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]e.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&void 0!==arguments[0]?arguments[0]:"";try{return vx.parse(e),!0}catch(t){return!1}})}),wW=function(e){var t=e.initialValues,n=e.onSubmit,r=e.onTOMLChange;return l.createElement(hT,{initialValues:t,validationSchema:wG,onSubmit:n},function(e){var t=e.isSubmitting,n=e.values;return r&&r(n.toml),l.createElement(hR,{"data-testid":"job-form",noValidate:!0},l.createElement(d.Z,{container:!0,spacing:16},l.createElement(d.Z,{item:!0,xs:12},l.createElement(hP,{component:hX,id:"toml",name:"toml",label:"Job Spec (TOML)",required:!0,fullWidth:!0,multiline:!0,rows:10,rowsMax:25,variant:"outlined",autoComplete:"off",FormHelperTextProps:{"data-testid":"toml-helper-text"}})),l.createElement(d.Z,{item:!0,xs:12,md:7},l.createElement(ok.default,{variant:"contained",color:"primary",type:"submit",disabled:t,size:"large"},"Create Job"))))})},wK=n(50109),wV="persistSpec";function wq(e){var t=e.query,n=new URLSearchParams(t).get("definition");return n?(wK.t8(wV,n),{toml:n}):{toml:wK.U2(wV)||""}}var wZ=function(e){var t=e.onSubmit,n=e.onTOMLChange,r=wq({query:(0,h.TH)().search}),i=function(e){var t=e.replace(/[\u200B-\u200D\uFEFF]/g,"");wK.t8("".concat(wV),t),n&&n(t)};return l.createElement(r5.Z,null,l.createElement(sl.Z,{title:"New Job"}),l.createElement(aW.Z,null,l.createElement(wW,{initialValues:r,onSubmit:t,onTOMLChange:i})))};function wX(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);ne.length)&&(t=e.length);for(var n=0,r=Array(t);ne.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]e.length)&&(t=e.length);for(var n=0,r=Array(t);n1&&void 0!==arguments[1]?arguments[1]:{},n=t.start,r=void 0===n?6:n,i=t.end,a=void 0===i?4:i;return e.substring(0,r)+"..."+e.substring(e.length-a)}function _M(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]0&&void 0!==arguments[0]?arguments[0]:{};return rv(_W,e)},_V=function(){var e=_K({fetchPolicy:"cache-and-network"}),t=e.data,n=e.loading,r=e.error,i=e.refetch;return l.createElement(_U,{loading:n,data:t,errorMsg:null==r?void 0:r.message,refetch:i})},_q=function(e){var t=e.csaKey;return l.createElement(ir.Z,{hover:!0},l.createElement(r7.default,null,l.createElement(x.default,{variant:"body1"},t.publicKey," ",l.createElement(_x,{data:t.publicKey}))))};function _Z(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function _X(){var e=_Z(["\n fragment CSAKeysPayload_ResultsFields on CSAKey {\n id\n publicKey\n }\n"]);return _X=function(){return e},e}var _J=n0(_X()),_Q=function(e){var t,n,r,i=e.data,a=e.errorMsg,o=e.loading,s=e.onCreate;return l.createElement(r5.Z,null,l.createElement(sl.Z,{action:(null===(t=null==i?void 0:i.csaKeys.results)||void 0===t?void 0:t.length)===0&&l.createElement(ok.default,{variant:"outlined",color:"primary",onClick:s},"New CSA Key"),title:"CSA Key",subheader:"Manage your CSA Key"}),l.createElement(r8.Z,null,l.createElement(ie.Z,null,l.createElement(ir.Z,null,l.createElement(r7.default,null,"Public Key"))),l.createElement(r9.Z,null,l.createElement(g$,{visible:o}),l.createElement(gz,{visible:(null===(n=null==i?void 0:i.csaKeys.results)||void 0===n?void 0:n.length)===0}),l.createElement(gU,{msg:a}),null===(r=null==i?void 0:i.csaKeys.results)||void 0===r?void 0:r.map(function(e,t){return l.createElement(_q,{csaKey:e,key:t})}))))};function _1(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]e.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]0&&void 0!==arguments[0]?arguments[0]:{};return rv(EM,e)};function EA(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]0&&void 0!==arguments[0]?arguments[0]:{};return rv(EJ,e)},E3=function(){return oo(EQ)},E4=function(){return oo(E1)},E6=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return rv(E0,e)};function E5(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);ne.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]e.length)&&(t=e.length);for(var n=0,r=Array(t);ne.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]e.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]0&&void 0!==arguments[0]?arguments[0]:{};return rv(SK,e)};function Sq(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]e.length)&&(t=e.length);for(var n=0,r=Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function kV(e,t){if(null==e)return{};var n,r,i={},a=Object.keys(e);for(r=0;r=0||(i[n]=e[n]);return i}var kq=function(e){var t=e.run,n=l.useMemo(function(){var e=t.inputs,n=t.outputs,r=t.taskRuns,i=kK(t,["inputs","outputs","taskRuns"]),a={};try{a=JSON.parse(e)}catch(o){a={}}return kW(kz({},i),{inputs:a,outputs:n,taskRuns:r})},[t]);return l.createElement(r5.Z,null,l.createElement(aW.Z,null,l.createElement(kH,{object:n})))};function kZ(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kX(e){for(var t=1;t0&&l.createElement(kr,{errors:t.allErrors})),l.createElement(d.Z,{item:!0,xs:12},l.createElement(h.rs,null,l.createElement(h.AW,{path:"".concat(n,"/json")},l.createElement(kq,{run:t})),l.createElement(h.AW,{path:n},t.taskRuns.length>0&&l.createElement(kN,{taskRuns:t.taskRuns,observationSource:t.job.observationSource}))))))))};function k5(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function k8(){var e=k5(["\n ","\n query FetchJobRun($id: ID!) {\n jobRun(id: $id) {\n __typename\n ... on JobRun {\n ...JobRunPayload_Fields\n }\n ... on NotFoundError {\n message\n }\n }\n }\n"]);return k8=function(){return e},e}var k9=n0(k8(),k4),k7=function(){var e=rv(k9,{variables:{id:(0,h.UO)().id}}),t=e.data,n=e.loading,r=e.error;if(n)return l.createElement(iR,null);if(r)return l.createElement(iD,{error:r});var i=null==t?void 0:t.jobRun;switch(null==i?void 0:i.__typename){case"JobRun":return l.createElement(k6,{run:i});case"NotFoundError":return l.createElement(oa,null);default:return null}};function xe(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function xt(){var e=xe(["\n fragment JobRunsPayload_ResultsFields on JobRun {\n id\n allErrors\n createdAt\n finishedAt\n status\n job {\n id\n }\n }\n"]);return xt=function(){return e},e}var xn=n0(xt()),xr=function(e){var t=e.loading,n=e.data,r=e.page,i=e.pageSize,a=(0,h.k6)(),o=l.useMemo(function(){return null==n?void 0:n.jobRuns.results.map(function(e){var t,n=e.allErrors,r=e.id,i=e.createdAt;return{id:r,createdAt:i,errors:n,finishedAt:e.finishedAt,status:e.status}})},[n]);return l.createElement(ig,null,l.createElement(d.Z,{container:!0,spacing:32},l.createElement(d.Z,{item:!0,xs:12},l.createElement(iy,null,"Job Runs")),t&&l.createElement(iR,null),n&&o&&l.createElement(d.Z,{item:!0,xs:12},l.createElement(r5.Z,null,l.createElement(yp,{runs:o}),l.createElement(it.Z,{component:"div",count:n.jobRuns.metadata.total,rowsPerPage:i,rowsPerPageOptions:[i],page:r-1,onChangePage:function(e,t){a.push("/runs?page=".concat(t+1,"&per=").concat(i))},onChangeRowsPerPage:function(){},backIconButtonProps:{"aria-label":"prev-page"},nextIconButtonProps:{"aria-label":"next-page"}})))))};function xi(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function xa(){var e=xi(["\n ","\n query FetchJobRuns($offset: Int, $limit: Int) {\n jobRuns(offset: $offset, limit: $limit) {\n results {\n ...JobRunsPayload_ResultsFields\n }\n metadata {\n total\n }\n }\n }\n"]);return xa=function(){return e},e}var xo=n0(xa(),xn),xs=function(){var e=ij(),t=parseInt(e.get("page")||"1",10),n=parseInt(e.get("per")||"25",10),r=rv(xo,{variables:{offset:(t-1)*n,limit:n},fetchPolicy:"cache-and-network"}),i=r.data,a=r.loading,o=r.error;return o?l.createElement(iD,{error:o}):l.createElement(xr,{loading:a,data:i,page:t,pageSize:n})},xu=function(){var e=(0,h.$B)().path;return l.createElement(h.rs,null,l.createElement(h.AW,{exact:!0,path:e},l.createElement(xs,null)),l.createElement(h.AW,{path:"".concat(e,"/:id")},l.createElement(k7,null)))};function xc(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function xl(){var e=xc(["\n fragment FetchFeedsManagersPayload_ResultsFields on FeedsManager {\n __typename\n id\n name\n uri\n publicKey\n isConnectionActive\n createdAt\n }\n query FetchFeedsManagers {\n feedsManagers {\n results {\n ...FetchFeedsManagersPayload_ResultsFields\n }\n }\n }\n"]);return xl=function(){return e},e}var xf=n0(xl()),xd=function(e){return rv(xf,e)},xh=n(47559),xp=n(83165),xb=n(47298),xm=n(81395),xg=function(){return(0,b.createStyles)({root:{display:"flex"},connectedIcon:{color:xh.default[500]},disconnectedIcon:{color:xp.default[500]},text:{marginLeft:4}})},xv=(0,b.withStyles)(xg)(function(e){var t=e.isConnected,n=e.classes;return l.createElement("div",{className:n.root},t?l.createElement(xm.Z,{fontSize:"small",className:n.connectedIcon}):l.createElement(xb.Z,{fontSize:"small",className:n.disconnectedIcon}),l.createElement(x.default,{variant:"body1",inline:!0,className:n.text},t?"Connected":"Disconnected"))}),xy=(0,b.withStyles)(iu)(function(e){var t=e.jobDistributor,n=e.classes;return l.createElement(ir.Z,{className:n.row,hover:!0},l.createElement(r7.default,{className:n.cell,component:"th",scope:"row"},l.createElement(ih,{className:n.link,href:"/job_distributors/".concat(t.id)},t.name)),l.createElement(r7.default,null,l.createElement(xv,{isConnected:t.isConnectionActive})),l.createElement(r7.default,null,_T(t.publicKey,{start:6,end:6}),l.createElement(_x,{data:t.publicKey})),l.createElement(r7.default,null,t.uri))}),xw=function(e){var t=e.jobDistributors;return l.createElement(ig,null,l.createElement(d.Z,{container:!0},l.createElement(d.Z,{item:!0,xs:9},l.createElement(iy,null,"Job Distributors")),l.createElement(d.Z,{item:!0,xs:3},l.createElement(d.Z,{container:!0,justify:"flex-end"},l.createElement(d.Z,{item:!0},l.createElement(aA.Z,{variant:"secondary",component:tz,href:"/job_distributors/new"},"New Job Distributor")))),l.createElement(d.Z,{item:!0,xs:12},l.createElement(r5.Z,null,l.createElement(r8.Z,null,l.createElement(ie.Z,null,l.createElement(ir.Z,null,l.createElement(r7.default,null,"Name"),l.createElement(r7.default,null,"Status"),l.createElement(r7.default,null,"CSA Public Key"),l.createElement(r7.default,null,"RPC URL"))),l.createElement(r9.Z,null,0===t.length&&l.createElement(ir.Z,null,l.createElement(r7.default,{component:"th",scope:"row",colSpan:3},"Job Distributors have not been registered")),t.map(function(e){return l.createElement(xy,{key:e.id,jobDistributor:e})})))))))},x_=function(){var e,t=xd({fetchPolicy:"cache-and-network"}),n=t.data,r=t.loading,i=t.error;return r?l.createElement(iR,null):i?l.createElement(iD,{error:i}):l.createElement(xw,{jobDistributors:null!==(e=null==n?void 0:n.feedsManagers.results)&&void 0!==e?e:[]})},xE=bv().shape({name:p0().required("Required"),uri:p0().required("Required"),publicKey:p0().required("Required")}),xS=function(e){var t=e.initialValues,n=e.onSubmit;return l.createElement(hT,{initialValues:t,validationSchema:xE,onSubmit:n},function(e){var t=e.isSubmitting,n=e.submitForm;return l.createElement(hR,{"data-testid":"feeds-manager-form"},l.createElement(d.Z,{container:!0,spacing:16},l.createElement(d.Z,{item:!0,xs:12,md:6},l.createElement(hP,{component:hX,id:"name",name:"name",label:"Name",required:!0,fullWidth:!0,FormHelperTextProps:{"data-testid":"name-helper-text"}})),l.createElement(d.Z,{item:!0,xs:!1,md:6}),l.createElement(d.Z,{item:!0,xs:12,md:6},l.createElement(hP,{component:hX,id:"uri",name:"uri",label:"URI",required:!0,fullWidth:!0,helperText:"Provided by the Job Distributor operator",FormHelperTextProps:{"data-testid":"uri-helper-text"}})),l.createElement(d.Z,{item:!0,xs:12,md:6},l.createElement(hP,{component:hX,id:"publicKey",name:"publicKey",label:"Public Key",required:!0,fullWidth:!0,helperText:"Provided by the Job Distributor operator",FormHelperTextProps:{"data-testid":"publicKey-helper-text"}})),l.createElement(d.Z,{item:!0,xs:12},l.createElement(ok.default,{variant:"contained",color:"primary",disabled:t,onClick:n},"Submit"))))})},xk=function(e){var t=e.data,n=e.onSubmit,r={name:t.name,uri:t.uri,publicKey:t.publicKey};return l.createElement(d.Z,{container:!0},l.createElement(d.Z,{item:!0,xs:12,md:11,lg:9},l.createElement(r5.Z,null,l.createElement(sl.Z,{title:"Edit Job Distributor"}),l.createElement(aW.Z,null,l.createElement(xS,{initialValues:r,onSubmit:n})))))};function xx(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]0&&void 0!==arguments[0]?arguments[0]:{};return rv(xZ,e)},xJ=n(57234);function xQ(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function x6(e,t){if(null==e)return{};var n,r,i={},a=Object.keys(e);for(r=0;r=0||(i[n]=e[n]);return i}function x5(e,t){return x1(e)||x2(e,t)||x8(e,t)||x3()}function x8(e,t){if(e){if("string"==typeof e)return xQ(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return xQ(e,t)}}var x9=function(e){return"SN_MAIN"===e||"SN_SEPOLIA"===e},x7=bv().shape({chainID:p0().required("Required"),chainType:p0().required("Required"),accountAddr:p0().required("Required"),accountAddrPubKey:p0().nullable(),adminAddr:p0().required("Required"),ocr1Multiaddr:p0().when(["ocr1Enabled","ocr1IsBootstrap"],{is:function(e,t){return e&&t},then:p0().required("Required").nullable()}).nullable(),ocr1P2PPeerID:p0().when(["ocr1Enabled","ocr1IsBootstrap"],{is:function(e,t){return e&&!t},then:p0().required("Required").nullable()}).nullable(),ocr1KeyBundleID:p0().when(["ocr1Enabled","ocr1IsBootstrap"],{is:function(e,t){return e&&!t},then:p0().required("Required").nullable()}).nullable(),ocr2Multiaddr:p0().when(["ocr2Enabled","ocr2IsBootstrap"],{is:function(e,t){return e&&t},then:p0().required("Required").nullable()}).nullable(),ocr2P2PPeerID:p0().when(["ocr2Enabled","ocr2IsBootstrap"],{is:function(e,t){return e&&!t},then:p0().required("Required").nullable()}).nullable(),ocr2KeyBundleID:p0().when(["ocr2Enabled","ocr2IsBootstrap"],{is:function(e,t){return e&&!t},then:p0().required("Required").nullable()}).nullable(),ocr2CommitPluginEnabled:pV().required("Required"),ocr2ExecutePluginEnabled:pV().required("Required"),ocr2MedianPluginEnabled:pV().required("Required"),ocr2MercuryPluginEnabled:pV().required("Required"),ocr2ForwarderAddress:p0().nullable()}),Te=function(e){return(0,b.createStyles)({supportedJobOptionsPaper:{padding:2*e.spacing.unit}})},Tt=function(e){var t=e.chainAccounts,n=x4(e,["chainAccounts"]),r=h_(),i=r.values,a=i.chainID,o=i.accountAddr,s=r.setFieldValue,u=x5(l.useState(!1),2),c=u[0],f=u[1],d=l.useRef();l.useEffect(function(){d.current=a},[a]),l.useEffect(function(){a!==d.current&&(s(n.name,""),f(!1))},[a,s,n.name]);var h=function(e){var t=e.target.value;"custom"===t?(f(!0),s(n.name,"")):(f(!1),s(n.name,t))};return l.createElement(l.Fragment,null,!x9(a)&&l.createElement(hP,x0({},n,{select:!0,value:c?"custom":o,onChange:h}),t.map(function(e){return l.createElement(tE.default,{key:e.address,value:e.address},e.address)})),x9(a)&&l.createElement(hP,{component:hX,id:"accountAddr",name:"accountAddr",label:"Enter your account address",inputProps:{"data-testid":"customAccountAddr-input"},helperText:"The account address used for this chain",required:!0,fullWidth:!0}),x9(a)&&l.createElement("div",null,l.createElement(hP,{component:hX,id:"accountAddrPubKey",name:"accountAddrPubKey",label:"Account Address Public Key",required:!0,fullWidth:!0,helperText:"The public key for your account address",FormHelperTextProps:{"data-testid":"accountAddrPubKey-helper-text"}})))},Tn=(0,b.withStyles)(Te)(function(e){var t=e.classes,n=e.editing,r=void 0!==n&&n,i=e.innerRef,a=e.initialValues,o=e.onSubmit,s=e.chainIDs,u=void 0===s?[]:s,c=e.accounts,f=void 0===c?[]:c,h=e.p2pKeys,p=void 0===h?[]:h,b=e.ocrKeys,m=void 0===b?[]:b,g=e.ocr2Keys,v=void 0===g?[]:g,y=e.showSubmit,w=void 0!==y&&y;return l.createElement(hT,{innerRef:i,initialValues:a,validationSchema:x7,onSubmit:o},function(e){var n=e.values,i=f.filter(function(e){return e.chain.id==n.chainID&&!e.isDisabled});return l.createElement(hR,{"data-testid":"feeds-manager-form",id:"chain-configuration-form",noValidate:!0},l.createElement(d.Z,{container:!0,spacing:16},l.createElement(d.Z,{item:!0,xs:12,md:6},l.createElement(hP,{component:hX,id:"chainType",name:"chainType",label:"Chain Type",select:!0,required:!0,fullWidth:!0,disabled:!0},l.createElement(tE.default,{key:"EVM",value:"EVM"},"EVM"))),l.createElement(d.Z,{item:!0,xs:12,md:6},l.createElement(hP,{component:hX,id:"chainID",name:"chainID",label:"Chain ID",required:!0,fullWidth:!0,select:!0,disabled:r,inputProps:{"data-testid":"chainID-input"},FormHelperTextProps:{"data-testid":"chainID-helper-text"}},u.map(function(e){return l.createElement(tE.default,{key:e,value:e},e)}))),l.createElement(d.Z,{item:!0,xs:12,md:6},l.createElement(Tt,{component:hX,id:"accountAddr",name:"accountAddr",label:"Account Address",inputProps:{"data-testid":"accountAddr-input"},required:!0,fullWidth:!0,select:!0,helperText:"The account address used for this chain",chainAccounts:i,FormHelperTextProps:{"data-testid":"accountAddr-helper-text"}})),l.createElement(d.Z,{item:!0,xs:12,md:6},l.createElement(hP,{component:hX,id:"adminAddr",name:"adminAddr",label:"Admin Address",required:!0,fullWidth:!0,helperText:"The address used for LINK payments",FormHelperTextProps:{"data-testid":"adminAddr-helper-text"}})),l.createElement(d.Z,{item:!0,xs:12},l.createElement(x.default,null,"Supported Job Types")),l.createElement(d.Z,{item:!0,xs:12},l.createElement(hP,{component:h2,name:"fluxMonitorEnabled",type:"checkbox",Label:{label:"Flux Monitor"}})),l.createElement(d.Z,{item:!0,xs:12},l.createElement(hP,{component:h2,name:"ocr1Enabled",type:"checkbox",Label:{label:"OCR"}}),n.ocr1Enabled&&l.createElement(ii.default,{className:t.supportedJobOptionsPaper},l.createElement(d.Z,{container:!0,spacing:8},l.createElement(l.Fragment,null,l.createElement(d.Z,{item:!0,xs:12},l.createElement(hP,{component:h2,name:"ocr1IsBootstrap",type:"checkbox",Label:{label:"Is this node running as a bootstrap peer?"}})),n.ocr1IsBootstrap?l.createElement(d.Z,{item:!0,xs:12},l.createElement(hP,{component:hX,id:"ocr1Multiaddr",name:"ocr1Multiaddr",label:"Multiaddr",required:!0,fullWidth:!0,helperText:"The OCR Multiaddr which oracles use to query for network information",FormHelperTextProps:{"data-testid":"ocr1Multiaddr-helper-text"}})):l.createElement(l.Fragment,null,l.createElement(d.Z,{item:!0,xs:12,md:6},l.createElement(hP,{component:hX,id:"ocr1P2PPeerID",name:"ocr1P2PPeerID",label:"Peer ID",select:!0,required:!0,fullWidth:!0,helperText:"The Peer ID used for this chain",FormHelperTextProps:{"data-testid":"ocr1P2PPeerID-helper-text"}},p.map(function(e){return l.createElement(tE.default,{key:e.peerID,value:e.peerID},e.peerID)}))),l.createElement(d.Z,{item:!0,xs:12,md:6},l.createElement(hP,{component:hX,id:"ocr1KeyBundleID",name:"ocr1KeyBundleID",label:"Key Bundle ID",select:!0,required:!0,fullWidth:!0,helperText:"The OCR Key Bundle ID used for this chain",FormHelperTextProps:{"data-testid":"ocr1KeyBundleID-helper-text"}},m.map(function(e){return l.createElement(tE.default,{key:e.id,value:e.id},e.id)})))))))),l.createElement(d.Z,{item:!0,xs:12},l.createElement(hP,{component:h2,name:"ocr2Enabled",type:"checkbox",Label:{label:"OCR2"}}),n.ocr2Enabled&&l.createElement(ii.default,{className:t.supportedJobOptionsPaper},l.createElement(d.Z,{container:!0,spacing:8},l.createElement(l.Fragment,null,l.createElement(d.Z,{item:!0,xs:12},l.createElement(hP,{component:h2,name:"ocr2IsBootstrap",type:"checkbox",Label:{label:"Is this node running as a bootstrap peer?"}})),l.createElement(d.Z,{item:!0,xs:12,md:6},l.createElement(hP,{component:hX,id:"ocr2P2PPeerID",name:"ocr2P2PPeerID",label:"Peer ID",select:!0,required:!n.ocr2IsBootstrap,fullWidth:!0,helperText:"The Peer ID used for this chain",FormHelperTextProps:{"data-testid":"ocr2P2PPeerID-helper-text"}},p.map(function(e){return l.createElement(tE.default,{key:e.peerID,value:e.peerID},e.peerID)}))),n.ocr2IsBootstrap?l.createElement(d.Z,{item:!0,xs:12},l.createElement(hP,{component:hX,id:"ocr2Multiaddr",name:"ocr2Multiaddr",label:"Multiaddr",required:!0,fullWidth:!0,helperText:"The OCR2 Multiaddr which oracles use to query for network information",FormHelperTextProps:{"data-testid":"ocr2Multiaddr-helper-text"}})):l.createElement(l.Fragment,null,l.createElement(d.Z,{item:!0,xs:12,md:6},l.createElement(hP,{component:hX,id:"ocr2KeyBundleID",name:"ocr2KeyBundleID",label:"Key Bundle ID",select:!0,required:!0,fullWidth:!0,helperText:"The OCR2 Key Bundle ID used for this chain",FormHelperTextProps:{"data-testid":"ocr2KeyBundleID-helper-text"}},v.map(function(e){return l.createElement(tE.default,{key:e.id,value:e.id},e.id)}))),l.createElement(d.Z,{item:!0,xs:12},l.createElement(x.default,null,"Supported Plugins")),l.createElement(d.Z,{item:!0,xs:6},l.createElement(hP,{component:h2,name:"ocr2CommitPluginEnabled",type:"checkbox",Label:{label:"Commit"}})),l.createElement(d.Z,{item:!0,xs:6},l.createElement(hP,{component:h2,name:"ocr2ExecutePluginEnabled",type:"checkbox",Label:{label:"Execute"}})),l.createElement(d.Z,{item:!0,xs:6},l.createElement(hP,{component:h2,name:"ocr2RebalancerPluginEnabled",type:"checkbox",Label:{label:"Rebalancer"}})),l.createElement(d.Z,{item:!0,xs:6},l.createElement(hP,{component:h2,name:"ocr2MedianPluginEnabled",type:"checkbox",Label:{label:"Median"}})),l.createElement(d.Z,{item:!0,xs:6},l.createElement(hP,{component:h2,name:"ocr2MercuryPluginEnabled",type:"checkbox",Label:{label:"Mercury"}})),l.createElement(d.Z,{item:!0,xs:12,md:12},l.createElement(hP,{component:hX,id:"ocr2ForwarderAddress",name:"ocr2ForwarderAddress",label:"Forwarder Address (optional)",fullWidth:!0,helperText:"The forwarder address from the Operator Forwarder Contract",FormHelperTextProps:{"data-testid":"ocr2ForwarderAddress-helper-text"}}))))))),w&&l.createElement(d.Z,{item:!0,xs:12,md:7},l.createElement(ok.default,{variant:"contained",color:"primary",type:"submit",size:"large"},"Submit"))))})}),Tr=function(e){var t=e.onClose,n=e.open,r=e.onSubmit,i=l.useRef(),a=i$({fetchPolicy:"network-only"}).data,o=_K({fetchPolicy:"cache-and-network"}).data,s=SV({fetchPolicy:"cache-and-network"}).data,u=EO({fetchPolicy:"cache-and-network"}).data,c=E2({fetchPolicy:"cache-and-network"}).data,f={chainID:"",chainType:"EVM",accountAddr:"",adminAddr:"",accountAddrPubKey:"",fluxMonitorEnabled:!1,ocr1Enabled:!1,ocr1IsBootstrap:!1,ocr1Multiaddr:"",ocr1P2PPeerID:"",ocr1KeyBundleID:"",ocr2Enabled:!1,ocr2IsBootstrap:!1,ocr2Multiaddr:"",ocr2P2PPeerID:"",ocr2KeyBundleID:"",ocr2CommitPluginEnabled:!1,ocr2ExecutePluginEnabled:!1,ocr2MedianPluginEnabled:!1,ocr2MercuryPluginEnabled:!1,ocr2RebalancerPluginEnabled:!1,ocr2ForwarderAddress:""},d=a?a.chains.results.map(function(e){return e.id}):[],h=o?o.ethKeys.results:[],p=s?s.p2pKeys.results:[],b=u?u.ocrKeyBundles.results:[],m=c?c.ocr2KeyBundles.results:[];return l.createElement(aD.Z,{onClose:t,open:n,disableBackdropClick:!0},l.createElement(oO.Z,{disableTypography:!0},l.createElement(x.default,{variant:"body2"},"New Supported Chain")),l.createElement(oT.Z,null,l.createElement(Tn,{innerRef:i,initialValues:f,onSubmit:r,chainIDs:d,accounts:h,p2pKeys:p,ocrKeys:b,ocr2Keys:m})),l.createElement(ox.Z,null,l.createElement(ok.default,{onClick:t},"Cancel"),l.createElement(ok.default,{color:"primary",type:"submit",form:"chain-configuration-form",variant:"contained"},"Submit")))},Ti=function(e){var t=e.cfg,n=e.onClose,r=e.open,i=e.onSubmit,a=l.useRef(),o=i$({fetchPolicy:"network-only"}).data,s=_K({fetchPolicy:"cache-and-network"}).data,u=SV({fetchPolicy:"cache-and-network"}).data,c=EO({fetchPolicy:"cache-and-network"}).data,f=E2({fetchPolicy:"cache-and-network"}).data;if(!t)return null;var d={chainID:t.chainID,chainType:"EVM",accountAddr:t.accountAddr,adminAddr:t.adminAddr,accountAddrPubKey:t.accountAddrPubKey,fluxMonitorEnabled:t.fluxMonitorJobConfig.enabled,ocr1Enabled:t.ocr1JobConfig.enabled,ocr1IsBootstrap:t.ocr1JobConfig.isBootstrap,ocr1Multiaddr:t.ocr1JobConfig.multiaddr,ocr1P2PPeerID:t.ocr1JobConfig.p2pPeerID,ocr1KeyBundleID:t.ocr1JobConfig.keyBundleID,ocr2Enabled:t.ocr2JobConfig.enabled,ocr2IsBootstrap:t.ocr2JobConfig.isBootstrap,ocr2Multiaddr:t.ocr2JobConfig.multiaddr,ocr2P2PPeerID:t.ocr2JobConfig.p2pPeerID,ocr2KeyBundleID:t.ocr2JobConfig.keyBundleID,ocr2CommitPluginEnabled:t.ocr2JobConfig.plugins.commit,ocr2ExecutePluginEnabled:t.ocr2JobConfig.plugins.execute,ocr2MedianPluginEnabled:t.ocr2JobConfig.plugins.median,ocr2MercuryPluginEnabled:t.ocr2JobConfig.plugins.mercury,ocr2RebalancerPluginEnabled:t.ocr2JobConfig.plugins.rebalancer,ocr2ForwarderAddress:t.ocr2JobConfig.forwarderAddress},h=o?o.chains.results.map(function(e){return e.id}):[],p=s?s.ethKeys.results:[],b=u?u.p2pKeys.results:[],m=c?c.ocrKeyBundles.results:[],g=f?f.ocr2KeyBundles.results:[];return l.createElement(aD.Z,{onClose:n,open:r,disableBackdropClick:!0},l.createElement(oO.Z,{disableTypography:!0},l.createElement(x.default,{variant:"body2"},"Edit Supported Chain")),l.createElement(oT.Z,null,l.createElement(Tn,{innerRef:a,initialValues:d,onSubmit:i,chainIDs:h,accounts:p,p2pKeys:b,ocrKeys:m,ocr2Keys:g,editing:!0})),l.createElement(ox.Z,null,l.createElement(ok.default,{onClick:n},"Cancel"),l.createElement(ok.default,{color:"primary",type:"submit",form:"chain-configuration-form",variant:"contained"},"Submit")))};function Ta(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]e.length)&&(t=e.length);for(var n=0,r=Array(t);ne.length)&&(t=e.length);for(var n=0,r=Array(t);ne.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]e.length)&&(t=e.length);for(var n=0,r=Array(t);nt.version?e:t})},[o]),g=l.useMemo(function(){return Mx(o).sort(function(e,t){return t.version-e.version})},[o]),v=function(e,t,n){switch(e){case"PENDING":return l.createElement(l.Fragment,null,l.createElement(ok.default,{variant:"text",color:"secondary",onClick:function(){return b("reject",t)}},"Reject"),m.id===t&&"DELETED"!==n.status&&"REVOKED"!==n.status&&l.createElement(ok.default,{variant:"contained",color:"primary",onClick:function(){return b("approve",t)}},"Approve"),m.id===t&&"DELETED"===n.status&&n.pendingUpdate&&l.createElement(l.Fragment,null,l.createElement(ok.default,{variant:"contained",color:"primary",onClick:function(){return b("cancel",t)}},"Cancel"),l.createElement(x.default,{color:"error"},"This proposal was deleted. Cancel the spec to delete any running jobs")));case"APPROVED":return l.createElement(l.Fragment,null,l.createElement(ok.default,{variant:"contained",onClick:function(){return b("cancel",t)}},"Cancel"),"DELETED"===n.status&&n.pendingUpdate&&l.createElement(x.default,{color:"error"},"This proposal was deleted. Cancel the spec to delete any running jobs"));case"CANCELLED":if(m.id===t&&"DELETED"!==n.status&&"REVOKED"!==n.status)return l.createElement(ok.default,{variant:"contained",color:"primary",onClick:function(){return b("approve",t)}},"Approve");return null;default:return null}};return l.createElement("div",null,g.map(function(e,n){return l.createElement(mP.Z,{defaultExpanded:0===n,key:n},l.createElement(mR.Z,{expandIcon:l.createElement(gh.Z,null)},l.createElement(x.default,{className:t.versionText},"Version ",e.version),l.createElement(Es.Z,{label:e.status,color:"APPROVED"===e.status?"primary":"default",variant:"REJECTED"===e.status||"CANCELLED"===e.status?"outlined":"default"}),l.createElement("div",{className:t.proposedAtContainer},l.createElement(x.default,null,"Proposed ",l.createElement(aO,{tooltip:!0},e.createdAt)))),l.createElement(mj.Z,{className:t.expansionPanelDetails},l.createElement("div",{className:t.actions},l.createElement("div",{className:t.editContainer},0===n&&("PENDING"===e.status||"CANCELLED"===e.status)&&"DELETED"!==s.status&&"REVOKED"!==s.status&&l.createElement(ok.default,{variant:"contained",onClick:function(){return p(!0)}},"Edit")),l.createElement("div",{className:t.actionsContainer},v(e.status,e.id,s))),l.createElement(gd,{language:"toml",style:gs,"data-testid":"codeblock"},e.definition)))}),l.createElement(oC,{open:null!=c,title:c?ML[c.action].title:"",body:c?ML[c.action].body:"",onConfirm:function(){if(c){switch(c.action){case"approve":n(c.id);break;case"cancel":r(c.id);break;case"reject":i(c.id)}f(null)}},cancelButtonText:"Cancel",onCancel:function(){return f(null)}}),l.createElement(Mb,{open:h,onClose:function(){return p(!1)},initialValues:{definition:m.definition,id:m.id},onSubmit:a}))});function MI(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function MD(){var e=MI(["\n ","\n fragment JobProposalPayloadFields on JobProposal {\n id\n externalJobID\n remoteUUID\n jobID\n specs {\n ...JobProposal_SpecsFields\n }\n status\n pendingUpdate\n }\n"]);return MD=function(){return e},e}var MN=n0(MD(),MO),MP=function(e){var t=e.onApprove,n=e.onCancel,r=e.onReject,i=e.onUpdateSpec,a=e.proposal;return l.createElement(ig,null,l.createElement(d.Z,{container:!0,spacing:32},l.createElement(d.Z,{item:!0,xs:9},l.createElement(iy,null,"Job Proposal #",a.id))),l.createElement(Mc,{proposal:a}),l.createElement(d.Z,{container:!0,spacing:32},l.createElement(d.Z,{item:!0,xs:9},l.createElement(TJ,null,"Specs"))),l.createElement(d.Z,{container:!0,spacing:32},l.createElement(d.Z,{item:!0,xs:12},l.createElement(MC,{proposal:a,specs:a.specs,onReject:r,onApprove:t,onCancel:n,onUpdateSpec:i}))))};function MR(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]e.length)&&(t=e.length);for(var n=0,r=Array(t);ne.length)&&(t=e.length);for(var n=0,r=Array(t);nU,tA:()=>$,KL:()=>H,Iw:()=>V,DQ:()=>W,cB:()=>T,LO:()=>M,t5:()=>k,qt:()=>x,Jc:()=>C,L7:()=>Y,EO:()=>B});var r,i,a=n(66289),o=n(41800),s=n.n(o),u=n(67932);(i=r||(r={})).IN_PROGRESS="in_progress",i.PENDING_INCOMING_CONFIRMATIONS="pending_incoming_confirmations",i.PENDING_CONNECTION="pending_connection",i.PENDING_BRIDGE="pending_bridge",i.PENDING_SLEEP="pending_sleep",i.ERRORED="errored",i.COMPLETED="completed";var c=n(87013),l=n(19084),f=n(34823);function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]j,v2:()=>F});var r=n(66289);function i(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}var a="/sessions",o="/sessions",s=function e(t){var n=this;i(this,e),this.api=t,this.createSession=function(e){return n.create(e)},this.destroySession=function(){return n.destroy()},this.create=this.api.createResource(a),this.destroy=this.api.deleteResource(o)};function u(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}var c="/v2/bulk_delete_runs",l=function e(t){var n=this;u(this,e),this.api=t,this.bulkDeleteJobRuns=function(e){return n.destroy(e)},this.destroy=this.api.deleteResource(c)};function f(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}var d="/v2/chains/evm",h="".concat(d,"/:id"),p=function e(t){var n=this;f(this,e),this.api=t,this.getChains=function(){return n.index()},this.createChain=function(e){return n.create(e)},this.destroyChain=function(e){return n.destroy(void 0,{id:e})},this.updateChain=function(e,t){return n.update(t,{id:e})},this.index=this.api.fetchResource(d),this.create=this.api.createResource(d),this.destroy=this.api.deleteResource(h),this.update=this.api.updateResource(h)};function b(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}var m="/v2/keys/evm/chain",g=function e(t){var n=this;b(this,e),this.api=t,this.chain=function(e){var t=new URLSearchParams;t.append("address",e.address),t.append("evmChainID",e.evmChainID),null!==e.nextNonce&&t.append("nextNonce",e.nextNonce),null!==e.abandon&&t.append("abandon",String(e.abandon)),null!==e.enabled&&t.append("enabled",String(e.enabled));var r=m+"?"+t.toString();return n.api.createResource(r)()}};function v(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}var y="/v2/jobs",w="".concat(y,"/:specId/runs"),_=function e(t){var n=this;v(this,e),this.api=t,this.createJobRunV2=function(e,t){return n.post(t,{specId:e})},this.post=this.api.createResource(w,!0)};function E(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}var S="/v2/log",k=function e(t){var n=this;E(this,e),this.api=t,this.getLogConfig=function(){return n.show()},this.updateLogConfig=function(e){return n.update(e)},this.show=this.api.fetchResource(S),this.update=this.api.updateResource(S)};function x(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}var T="/v2/nodes",M=function e(t){var n=this;x(this,e),this.api=t,this.getNodes=function(){return n.index()},this.createNode=function(e){return n.create(e)},this.index=this.api.fetchResource(T),this.create=this.api.createResource(T)};function O(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}var A="/v2/enroll_webauthn",L=function e(t){var n=this;O(this,e),this.api=t,this.beginKeyRegistration=function(e){return n.create(e)},this.finishKeyRegistration=function(e){return n.put(e)},this.create=this.api.fetchResource(A),this.put=this.api.createResource(A)};function C(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}var I="/v2/build_info",D=function e(t){var n=this;C(this,e),this.api=t,this.show=function(){return n.api.GET(I)()}};function N(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}var P=function e(t){N(this,e),this.api=t,this.buildInfo=new D(this.api),this.bulkDeleteRuns=new l(this.api),this.chains=new p(this.api),this.logConfig=new k(this.api),this.nodes=new M(this.api),this.jobs=new _(this.api),this.webauthn=new L(this.api),this.evmKeys=new g(this.api)},R=new r.V0({base:void 0}),j=new s(R),F=new P(R)},1398(e,t,n){"use strict";n.d(t,{Z:()=>d});var r=n(67294),i=n(32316),a=n(83638),o=n(94184),s=n.n(o);function u(){return(u=Object.assign||function(e){for(var t=1;tc});var r=n(67294),i=n(32316);function a(){return(a=Object.assign||function(e){for(var t=1;tx,jK:()=>v});var r=n(67294),i=n(37703),a=n(45697),o=n.n(a),s=n(82204),u=n(71426),c=n(94184),l=n.n(c),f=n(32316),d=function(e){var t=e.palette.success||{},n=e.palette.warning||{};return{base:{paddingLeft:5*e.spacing.unit,paddingRight:5*e.spacing.unit},success:{backgroundColor:t.main,color:t.contrastText},error:{backgroundColor:e.palette.error.dark,color:e.palette.error.contrastText},warning:{backgroundColor:n.contrastText,color:n.main}}},h=function(e){var t,n=e.success,r=e.error,i=e.warning,a=e.classes,o=e.className;return n?t=a.success:r?t=a.error:i&&(t=a.warning),l()(a.base,o,t)},p=function(e){return r.createElement(s.Z,{className:h(e),square:!0},r.createElement(u.default,{variant:"body2",color:"inherit",component:"div"},e.children))};p.defaultProps={success:!1,error:!1,warning:!1},p.propTypes={success:o().bool,error:o().bool,warning:o().bool};let b=(0,f.withStyles)(d)(p);var m=function(){return r.createElement(r.Fragment,null,"Unhandled error. Please help us by opening a"," ",r.createElement("a",{href:"https://github.com/smartcontractkit/chainlink/issues/new"},"bug report"))};let g=m;function v(e){return"string"==typeof e?e:e.component?e.component(e.props):r.createElement(g,null)}function y(e,t){var n;return n="string"==typeof e?e:e.component?e.component(e.props):r.createElement(g,null),r.createElement("p",{key:t},n)}var w=function(e){var t=e.notifications;return r.createElement(b,{error:!0},t.map(y))},_=function(e){var t=e.notifications;return r.createElement(b,{success:!0},t.map(y))},E=function(e){var t=e.errors,n=e.successes;return r.createElement("div",null,(null==t?void 0:t.length)>0&&r.createElement(w,{notifications:t}),n.length>0&&r.createElement(_,{notifications:n}))},S=function(e){return{errors:e.notifications.errors,successes:e.notifications.successes}},k=(0,i.$j)(S)(E);let x=k},9409(e,t,n){"use strict";n.d(t,{ZP:()=>j});var r=n(67294),i=n(37703),a=n(5977),o=n(32316),s=n(1398),u=n(82204),c=n(30060),l=n(71426),f=n(60520),d=n(39814),h=n(57209),p=n(26842),b=n(3950),m=n(5536),g=n(45697),v=n.n(g);let y=n.p+"9f6d832ef97e8493764e.svg";function w(){return(w=Object.assign||function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&_.map(function(e,t){return r.createElement(d.Z,{item:!0,xs:12,key:t},r.createElement(u.Z,{raised:!1,className:v.error},r.createElement(c.Z,null,r.createElement(l.default,{variant:"body1",className:v.errorText},(0,b.jK)(e)))))}),r.createElement(d.Z,{item:!0,xs:12},r.createElement(f.Z,{id:"email",label:"Email",margin:"normal",value:n,onChange:m("email"),error:_.length>0,variant:"outlined",fullWidth:!0})),r.createElement(d.Z,{item:!0,xs:12},r.createElement(f.Z,{id:"password",label:"Password",type:"password",autoComplete:"password",margin:"normal",value:h,onChange:m("password"),error:_.length>0,variant:"outlined",fullWidth:!0})),r.createElement(d.Z,{item:!0,xs:12},r.createElement(d.Z,{container:!0,spacing:0,justify:"center"},r.createElement(d.Z,{item:!0},r.createElement(s.Z,{type:"submit",variant:"primary"},"Access Account")))),y&&r.createElement(l.default,{variant:"body1",color:"textSecondary"},"Signing in...")))))))},P=function(e){return{fetching:e.authentication.fetching,authenticated:e.authentication.allowed,errors:e.notifications.errors}},R=(0,i.$j)(P,x({submitSignIn:p.L7}))(N);let j=(0,h.wU)(e)((0,o.withStyles)(D)(R))},16353(e,t,n){"use strict";n.d(t,{ZP:()=>H,rH:()=>U});var r,i=n(37703),a=n(97779),o=n(9541),s=n(19084);function u(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:h,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case s.Mk.RECEIVE_SIGNOUT_SUCCESS:case s.Mk.RECEIVE_SIGNIN_SUCCESS:var n={allowed:t.authenticated};return o.Ks(n),f(c({},e,n),{errors:[]});case s.Mk.RECEIVE_SIGNIN_FAIL:var r={allowed:!1};return o.Ks(r),f(c({},e,r),{errors:[]});case s.Mk.RECEIVE_SIGNIN_ERROR:case s.Mk.RECEIVE_SIGNOUT_ERROR:var i={allowed:!1};return o.Ks(i),f(c({},e,i),{errors:t.errors||[]});default:return e}};let b=p;function m(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function g(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:_,t=arguments.length>1?arguments[1]:void 0;return t.type?t.type.startsWith(r.REQUEST)?y(g({},e),{count:e.count+1}):t.type.startsWith(r.RECEIVE)?y(g({},e),{count:Math.max(e.count-1,0)}):t.type.startsWith(r.RESPONSE)?y(g({},e),{count:Math.max(e.count-1,0)}):t.type===s.di.REDIRECT?y(g({},e),{count:0}):e:e};let S=E;function k(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function x(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:O,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case s.di.MATCH_ROUTE:return M(x({},O),{currentUrl:t.pathname});case s.Ih.NOTIFY_SUCCESS:var n={component:t.component,props:t.props};return M(x({},e),{successes:[n],errors:[]});case s.Ih.NOTIFY_SUCCESS_MSG:return M(x({},e),{successes:[t.msg],errors:[]});case s.Ih.NOTIFY_ERROR:var r=t.error.errors,i=null==r?void 0:r.map(function(e){return L(t,e)});return M(x({},e),{successes:[],errors:i});case s.Ih.NOTIFY_ERROR_MSG:return M(x({},e),{successes:[],errors:[t.msg]});case s.Mk.RECEIVE_SIGNIN_FAIL:return M(x({},e),{successes:[],errors:["Your email or password is incorrect. Please try again"]});default:return e}};function L(e,t){return{component:e.component,props:{msg:t.detail}}}let C=A;function I(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function D(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:R,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case s.di.REDIRECT:return P(D({},e),{to:t.to});case s.di.MATCH_ROUTE:return P(D({},e),{to:void 0});default:return e}};let F=j;var Y=n(87013),B=(0,a.UY)({authentication:b,fetching:S,notifications:C,redirect:F,buildInfo:Y.Z});B(void 0,{type:"INITIAL_STATE"});var U=i.v9;let H=B},19084(e,t,n){"use strict";var r,i,a,o,s,u,c,l,f,d;n.d(t,{Ih:()=>i,Mk:()=>a,Y0:()=>s,di:()=>r,jp:()=>o}),n(67294),(u=r||(r={})).REDIRECT="REDIRECT",u.MATCH_ROUTE="MATCH_ROUTE",(c=i||(i={})).NOTIFY_SUCCESS="NOTIFY_SUCCESS",c.NOTIFY_SUCCESS_MSG="NOTIFY_SUCCESS_MSG",c.NOTIFY_ERROR="NOTIFY_ERROR",c.NOTIFY_ERROR_MSG="NOTIFY_ERROR_MSG",(l=a||(a={})).REQUEST_SIGNIN="REQUEST_SIGNIN",l.RECEIVE_SIGNIN_SUCCESS="RECEIVE_SIGNIN_SUCCESS",l.RECEIVE_SIGNIN_FAIL="RECEIVE_SIGNIN_FAIL",l.RECEIVE_SIGNIN_ERROR="RECEIVE_SIGNIN_ERROR",l.RECEIVE_SIGNOUT_SUCCESS="RECEIVE_SIGNOUT_SUCCESS",l.RECEIVE_SIGNOUT_ERROR="RECEIVE_SIGNOUT_ERROR",(f=o||(o={})).RECEIVE_CREATE_ERROR="RECEIVE_CREATE_ERROR",f.RECEIVE_CREATE_SUCCESS="RECEIVE_CREATE_SUCCESS",f.RECEIVE_DELETE_ERROR="RECEIVE_DELETE_ERROR",f.RECEIVE_DELETE_SUCCESS="RECEIVE_DELETE_SUCCESS",f.RECEIVE_UPDATE_ERROR="RECEIVE_UPDATE_ERROR",f.RECEIVE_UPDATE_SUCCESS="RECEIVE_UPDATE_SUCCESS",f.REQUEST_CREATE="REQUEST_CREATE",f.REQUEST_DELETE="REQUEST_DELETE",f.REQUEST_UPDATE="REQUEST_UPDATE",f.UPSERT_CONFIGURATION="UPSERT_CONFIGURATION",f.UPSERT_JOB_RUN="UPSERT_JOB_RUN",f.UPSERT_JOB_RUNS="UPSERT_JOB_RUNS",f.UPSERT_TRANSACTION="UPSERT_TRANSACTION",f.UPSERT_TRANSACTIONS="UPSERT_TRANSACTIONS",f.UPSERT_BUILD_INFO="UPSERT_BUILD_INFO",(d=s||(s={})).FETCH_BUILD_INFO_REQUESTED="FETCH_BUILD_INFO_REQUESTED",d.FETCH_BUILD_INFO_SUCCEEDED="FETCH_BUILD_INFO_SUCCEEDED",d.FETCH_BUILD_INFO_FAILED="FETCH_BUILD_INFO_FAILED"},87013(e,t,n){"use strict";n.d(t,{Y:()=>o,Z:()=>u});var r=n(19084);function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:o,t=arguments.length>1?arguments[1]:void 0;return t.type===r.Y0.FETCH_BUILD_INFO_SUCCEEDED?a({},t.buildInfo):e};let u=s},34823(e,t,n){"use strict";n.d(t,{N:()=>r});var r=function(e){return e.buildInfo}},73343(e,t,n){"use strict";n.d(t,{r:()=>u});var r=n(19350),i=n(32316),a=n(59114),o=n(5324),s={props:{MuiGrid:{spacing:3*o.default.unit},MuiCardHeader:{titleTypographyProps:{color:"secondary"}}},palette:{action:{hoverOpacity:.3},primary:{light:"#E5F1FF",main:"#3c40c6",contrastText:"#fff"},secondary:{main:"#3d5170"},success:{light:"#e8faf1",main:r.ek.A700,dark:r.ek[700],contrastText:r.y0.white},warning:{light:"#FFFBF1",main:"#fff6b6",contrastText:"#fad27a"},error:{light:"#ffdada",main:"#f44336",dark:"#d32f2f",contrastText:"#fff"},background:{default:"#f5f6f8",appBar:"#3c40c6"},text:{primary:(0,a.darken)(r.BA.A700,.7),secondary:"#818ea3"},listPendingStatus:{background:"#fef7e5",color:"#fecb4c"},listCompletedStatus:{background:"#e9faf2",color:"#4ed495"}},shape:{borderRadius:o.default.unit},overrides:{MuiButton:{root:{borderRadius:o.default.unit/2,textTransform:"none"},sizeLarge:{padding:void 0,fontSize:void 0,paddingTop:o.default.unit,paddingBottom:o.default.unit,paddingLeft:5*o.default.unit,paddingRight:5*o.default.unit}},MuiTableCell:{body:{fontSize:"1rem"},head:{fontSize:"1rem",fontWeight:400}},MuiCardHeader:{root:{borderBottom:"1px solid rgba(0, 0, 0, 0.12)"},action:{marginTop:-2,marginRight:0,"& >*":{marginLeft:2*o.default.unit}},subheader:{marginTop:.5*o.default.unit}}},typography:{useNextVariants:!0,fontFamily:"-apple-system,BlinkMacSystemFont,Roboto,Helvetica,Arial,sans-serif",button:{textTransform:"none",fontSize:"1.2em"},body1:{fontSize:"1.0rem",fontWeight:400,lineHeight:"1.46429em",color:"rgba(0, 0, 0, 0.87)",letterSpacing:-.4},body2:{fontSize:"1.0rem",fontWeight:500,lineHeight:"1.71429em",color:"rgba(0, 0, 0, 0.87)",letterSpacing:-.4},body1Next:{color:"rgb(29, 29, 29)",fontWeight:400,fontSize:"1rem",lineHeight:1.5,letterSpacing:-.4},body2Next:{color:"rgb(29, 29, 29)",fontWeight:400,fontSize:"0.875rem",lineHeight:1.5,letterSpacing:-.4},display1:{color:"#818ea3",fontSize:"2.125rem",fontWeight:400,lineHeight:"1.20588em",letterSpacing:-.4},display2:{color:"#818ea3",fontSize:"2.8125rem",fontWeight:400,lineHeight:"1.13333em",marginLeft:"-.02em",letterSpacing:-.4},display3:{color:"#818ea3",fontSize:"3.5rem",fontWeight:400,lineHeight:"1.30357em",marginLeft:"-.02em",letterSpacing:-.4},display4:{fontSize:14,fontWeightLight:300,fontWeightMedium:500,fontWeightRegular:400,letterSpacing:-.4},h1:{color:"rgb(29, 29, 29)",fontSize:"6rem",fontWeight:300,lineHeight:1},h2:{color:"rgb(29, 29, 29)",fontSize:"3.75rem",fontWeight:300,lineHeight:1},h3:{color:"rgb(29, 29, 29)",fontSize:"3rem",fontWeight:400,lineHeight:1.04},h4:{color:"rgb(29, 29, 29)",fontSize:"2.125rem",fontWeight:400,lineHeight:1.17},h5:{color:"rgb(29, 29, 29)",fontSize:"1.5rem",fontWeight:400,lineHeight:1.33,letterSpacing:-.4},h6:{fontSize:"0.8rem",fontWeight:450,lineHeight:"1.71429em",color:"rgba(0, 0, 0, 0.87)",letterSpacing:-.4},subheading:{color:"rgb(29, 29, 29)",fontSize:"1rem",fontWeight:400,lineHeight:"1.5em",letterSpacing:-.4},subtitle1:{color:"rgb(29, 29, 29)",fontSize:"1rem",fontWeight:400,lineHeight:1.75,letterSpacing:-.4},subtitle2:{color:"rgb(29, 29, 29)",fontSize:"0.875rem",fontWeight:500,lineHeight:1.57,letterSpacing:-.4}},shadows:["none","0px 1px 3px 0px rgba(0, 0, 0, 0.1),0px 1px 1px 0px rgba(0, 0, 0, 0.04),0px 2px 1px -1px rgba(0, 0, 0, 0.02)","0px 1px 5px 0px rgba(0, 0, 0, 0.1),0px 2px 2px 0px rgba(0, 0, 0, 0.04),0px 3px 1px -2px rgba(0, 0, 0, 0.02)","0px 1px 8px 0px rgba(0, 0, 0, 0.1),0px 3px 4px 0px rgba(0, 0, 0, 0.04),0px 3px 3px -2px rgba(0, 0, 0, 0.02)","0px 2px 4px -1px rgba(0, 0, 0, 0.1),0px 4px 5px 0px rgba(0, 0, 0, 0.04),0px 1px 10px 0px rgba(0, 0, 0, 0.02)","0px 3px 5px -1px rgba(0, 0, 0, 0.1),0px 5px 8px 0px rgba(0, 0, 0, 0.04),0px 1px 14px 0px rgba(0, 0, 0, 0.02)","0px 3px 5px -1px rgba(0, 0, 0, 0.1),0px 6px 10px 0px rgba(0, 0, 0, 0.04),0px 1px 18px 0px rgba(0, 0, 0, 0.02)","0px 4px 5px -2px rgba(0, 0, 0, 0.1),0px 7px 10px 1px rgba(0, 0, 0, 0.04),0px 2px 16px 1px rgba(0, 0, 0, 0.02)","0px 5px 5px -3px rgba(0, 0, 0, 0.1),0px 8px 10px 1px rgba(0, 0, 0, 0.04),0px 3px 14px 2px rgba(0, 0, 0, 0.02)","0px 5px 6px -3px rgba(0, 0, 0, 0.1),0px 9px 12px 1px rgba(0, 0, 0, 0.04),0px 3px 16px 2px rgba(0, 0, 0, 0.02)","0px 6px 6px -3px rgba(0, 0, 0, 0.1),0px 10px 14px 1px rgba(0, 0, 0, 0.04),0px 4px 18px 3px rgba(0, 0, 0, 0.02)","0px 6px 7px -4px rgba(0, 0, 0, 0.1),0px 11px 15px 1px rgba(0, 0, 0, 0.04),0px 4px 20px 3px rgba(0, 0, 0, 0.02)","0px 7px 8px -4px rgba(0, 0, 0, 0.1),0px 12px 17px 2px rgba(0, 0, 0, 0.04),0px 5px 22px 4px rgba(0, 0, 0, 0.02)","0px 7px 8px -4px rgba(0, 0, 0, 0.1),0px 13px 19px 2px rgba(0, 0, 0, 0.04),0px 5px 24px 4px rgba(0, 0, 0, 0.02)","0px 7px 9px -4px rgba(0, 0, 0, 0.1),0px 14px 21px 2px rgba(0, 0, 0, 0.04),0px 5px 26px 4px rgba(0, 0, 0, 0.02)","0px 8px 9px -5px rgba(0, 0, 0, 0.1),0px 15px 22px 2px rgba(0, 0, 0, 0.04),0px 6px 28px 5px rgba(0, 0, 0, 0.02)","0px 8px 10px -5px rgba(0, 0, 0, 0.1),0px 16px 24px 2px rgba(0, 0, 0, 0.04),0px 6px 30px 5px rgba(0, 0, 0, 0.02)","0px 8px 11px -5px rgba(0, 0, 0, 0.1),0px 17px 26px 2px rgba(0, 0, 0, 0.04),0px 6px 32px 5px rgba(0, 0, 0, 0.02)","0px 9px 11px -5px rgba(0, 0, 0, 0.1),0px 18px 28px 2px rgba(0, 0, 0, 0.04),0px 7px 34px 6px rgba(0, 0, 0, 0.02)","0px 9px 12px -6px rgba(0, 0, 0, 0.1),0px 19px 29px 2px rgba(0, 0, 0, 0.04),0px 7px 36px 6px rgba(0, 0, 0, 0.02)","0px 10px 13px -6px rgba(0, 0, 0, 0.1),0px 20px 31px 3px rgba(0, 0, 0, 0.04),0px 8px 38px 7px rgba(0, 0, 0, 0.02)","0px 10px 13px -6px rgba(0, 0, 0, 0.1),0px 21px 33px 3px rgba(0, 0, 0, 0.04),0px 8px 40px 7px rgba(0, 0, 0, 0.02)","0px 10px 14px -6px rgba(0, 0, 0, 0.1),0px 22px 35px 3px rgba(0, 0, 0, 0.04),0px 8px 42px 7px rgba(0, 0, 0, 0.02)","0px 11px 14px -7px rgba(0, 0, 0, 0.1),0px 23px 36px 3px rgba(0, 0, 0, 0.04),0px 9px 44px 8px rgba(0, 0, 0, 0.02)","0px 11px 15px -7px rgba(0, 0, 0, 0.1),0px 24px 38px 3px rgba(0, 0, 0, 0.04),0px 9px 46px 8px rgba(0, 0, 0, 0.02)",]},u=(0,i.createMuiTheme)(s)},66289(e,t,n){"use strict";function r(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function i(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function a(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}function o(e,t,n){return(o=a()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&f(i,n.prototype),i}).apply(null,arguments)}function s(e){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function u(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&f(e,t)}function c(e){return -1!==Function.toString.call(e).indexOf("[native code]")}function l(e,t){return t&&("object"===p(t)||"function"==typeof t)?t:r(e)}function f(e,t){return(f=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}n.d(t,{V0:()=>B,_7:()=>v});var d,h,p=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function b(e){var t="function"==typeof Map?new Map:void 0;return(b=function(e){if(null===e||!c(e))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return o(e,arguments,s(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),f(n,e)})(e)}function m(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}function g(e){var t=m();return function(){var n,r=s(e);if(t){var i=s(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return l(this,n)}}var v=function(e){u(n,e);var t=g(n);function n(e){var r;return i(this,n),(r=t.call(this,"AuthenticationError(".concat(e.statusText,")"))).errors=[{status:e.status,detail:e},],r}return n}(b(Error)),y=function(e){u(n,e);var t=g(n);function n(e){var r,a=e.errors;return i(this,n),(r=t.call(this,"BadRequestError")).errors=a,r}return n}(b(Error)),w=function(e){u(n,e);var t=g(n);function n(e){var r;return i(this,n),(r=t.call(this,"UnprocessableEntityError")).errors=e,r}return n}(b(Error)),_=function(e){u(n,e);var t=g(n);function n(e){var r;return i(this,n),(r=t.call(this,"ServerError")).errors=e,r}return n}(b(Error)),E=function(e){u(n,e);var t=g(n);function n(e){var r,a=e.errors;return i(this,n),(r=t.call(this,"ConflictError")).errors=a,r}return n}(b(Error)),S=function(e){u(n,e);var t=g(n);function n(e){var r;return i(this,n),(r=t.call(this,"UnknownResponseError(".concat(e.statusText,")"))).errors=[{status:e.status,detail:e.statusText},],r}return n}(b(Error));function k(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2e4;return Promise.race([fetch(e,t),new Promise(function(e,t){return setTimeout(function(){return t(Error("timeout"))},n)}),])}function x(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]=200&&e.status<300))return[3,2];return[2,e.json()];case 2:if(400!==e.status)return[3,3];return[2,e.json().then(function(e){throw new y(e)})];case 3:if(401!==e.status)return[3,4];throw new v(e);case 4:if(422!==e.status)return[3,6];return[4,$(e)];case 5:throw n=i.sent(),new w(n);case 6:if(409!==e.status)return[3,7];return[2,e.json().then(function(e){throw new E(e)})];case 7:if(!(e.status>=500))return[3,9];return[4,$(e)];case 8:throw r=i.sent(),new _(r);case 9:throw new S(e);case 10:return[2]}})})).apply(this,arguments)}function $(e){return z.apply(this,arguments)}function z(){return(z=j(function(e){return Y(this,function(t){return[2,e.json().then(function(t){return t.errors?t.errors.map(function(t){return{status:e.status,detail:t.detail}}):G(e)}).catch(function(){return G(e)})]})})).apply(this,arguments)}function G(e){return[{status:e.status,detail:e.statusText},]}},50109(e,t,n){"use strict";n.d(t,{LK:()=>o,U2:()=>i,eT:()=>s,t8:()=>a});var r=n(12795);function i(e){return r.ZP.getItem("chainlink.".concat(e))}function a(e,t){r.ZP.setItem("chainlink.".concat(e),t)}function o(e){var t=i(e),n={};if(t)try{return JSON.parse(t)}catch(r){}return n}function s(e,t){a(e,JSON.stringify(t))}},9541(e,t,n){"use strict";n.d(t,{Ks:()=>u,Tp:()=>a,iR:()=>o,pm:()=>s});var r=n(50109),i="persistURL";function a(){return r.U2(i)||""}function o(e){r.t8(i,e)}function s(){return r.LK("authentication")}function u(e){r.eT("authentication",e)}},67121(e,t,n){"use strict";function r(e){var t,n=e.Symbol;return"function"==typeof n?n.observable?t=n.observable:(t=n("observable"),n.observable=t):t="@@observable",t}n.r(t),n.d(t,{default:()=>o}),e=n.hmd(e),i="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==n.g?n.g:e;var i,a=r(i);let o=a},2177(e,t,n){"use strict";n.d(t,{Z:()=>o});var r=!0,i="Invariant failed";function a(e,t){if(!e){if(r)throw Error(i);throw Error(i+": "+(t||""))}}let o=a},11742(e){e.exports=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,n=[],r=0;ru,ZT:()=>i,_T:()=>o,ev:()=>c,mG:()=>s,pi:()=>a});var r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function i(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var a=function(){return(a=Object.assign||function(e){for(var t,n=1,r=arguments.length;nt.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,r=Object.getOwnPropertySymbols(e);it.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function s(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||(n=Promise))(function(n,a){function o(e){try{u(r.next(e))}catch(t){a(t)}}function s(e){try{u(r.throw(e))}catch(t){a(t)}}function u(e){e.done?n(e.value):i(e.value).then(o,s)}u((r=r.apply(e,t||[])).next())})}function u(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(e){return function(t){return u([e,t])}}function u(a){if(n)throw TypeError("Generator is already executing.");for(;o;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,r=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(i=(i=o.trys).length>0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]r})},94927(e,t,n){function r(e,t){if(i("noDeprecation"))return e;var n=!1;function r(){if(!n){if(i("throwDeprecation"))throw Error(t);i("traceDeprecation")?console.trace(t):console.warn(t),n=!0}return e.apply(this,arguments)}return r}function i(e){try{if(!n.g.localStorage)return!1}catch(t){return!1}var r=n.g.localStorage[e];return null!=r&&"true"===String(r).toLowerCase()}e.exports=r},42473(e){"use strict";var t=function(){};e.exports=t},84763(e){e.exports=Worker},47529(e){e.exports=n;var t=Object.prototype.hasOwnProperty;function n(){for(var e={},n=0;ne.length)&&(t=e.length);for(var n=0,r=Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports},7071(e){function t(e,t){if(null==e)return{};var n,r,i={},a=Object.keys(e);for(r=0;r=0||(i[n]=e[n]);return i}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},94993(e,t,n){var r=n(18698).default,i=n(66115);function a(e,t){if(t&&("object"===r(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return i(e)}e.exports=a,e.exports.__esModule=!0,e.exports.default=e.exports},6015(e){function t(n,r){return e.exports=t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n,r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},861(e,t,n){var r=n(63405),i=n(79498),a=n(86116),o=n(42281);function s(e){return r(e)||i(e)||a(e)||o()}e.exports=s,e.exports.__esModule=!0,e.exports.default=e.exports},18698(e){function t(n){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},86116(e,t,n){var r=n(73897);function i(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return r(e,t)}}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports},1644(e,t,n){"use strict";var r,i;function a(e){return!!e&&e<7}n.d(t,{I:()=>r,O:()=>a}),(i=r||(r={}))[i.loading=1]="loading",i[i.setVariables=2]="setVariables",i[i.fetchMore=3]="fetchMore",i[i.refetch=4]="refetch",i[i.poll=6]="poll",i[i.ready=7]="ready",i[i.error=8]="error"},30990(e,t,n){"use strict";n.d(t,{MS:()=>s,YG:()=>a,cA:()=>c,ls:()=>o});var r=n(70655);n(83952);var i=n(13154),a=Symbol();function o(e){return!!e.extensions&&Array.isArray(e.extensions[a])}function s(e){return e.hasOwnProperty("graphQLErrors")}var u=function(e){var t=(0,r.ev)((0,r.ev)((0,r.ev)([],e.graphQLErrors,!0),e.clientErrors,!0),e.protocolErrors,!0);return e.networkError&&t.push(e.networkError),t.map(function(e){return(0,i.s)(e)&&e.message||"Error message not found."}).join("\n")},c=function(e){function t(n){var r=n.graphQLErrors,i=n.protocolErrors,a=n.clientErrors,o=n.networkError,s=n.errorMessage,c=n.extraInfo,l=e.call(this,s)||this;return l.name="ApolloError",l.graphQLErrors=r||[],l.protocolErrors=i||[],l.clientErrors=a||[],l.networkError=o||null,l.message=s||u(l),l.extraInfo=c,l.__proto__=t.prototype,l}return(0,r.ZT)(t,e),t}(Error)},85317(e,t,n){"use strict";n.d(t,{K:()=>a});var r=n(67294),i=n(30320).aS?Symbol.for("__APOLLO_CONTEXT__"):"__APOLLO_CONTEXT__";function a(){var e=r.createContext[i];return e||(Object.defineProperty(r.createContext,i,{value:e=r.createContext({}),enumerable:!1,writable:!1,configurable:!0}),e.displayName="ApolloContext"),e}},21436(e,t,n){"use strict";n.d(t,{O:()=>i,k:()=>r});var r=Array.isArray;function i(e){return Array.isArray(e)&&e.length>0}},30320(e,t,n){"use strict";n.d(t,{DN:()=>s,JC:()=>l,aS:()=>o,mr:()=>i,sy:()=>a});var r=n(83952),i="function"==typeof WeakMap&&"ReactNative"!==(0,r.wY)(function(){return navigator.product}),a="function"==typeof WeakSet,o="function"==typeof Symbol&&"function"==typeof Symbol.for,s=o&&Symbol.asyncIterator,u="function"==typeof(0,r.wY)(function(){return window.document.createElement}),c=(0,r.wY)(function(){return navigator.userAgent.indexOf("jsdom")>=0})||!1,l=u&&!c},53712(e,t,n){"use strict";function r(){for(var e=[],t=0;tr})},10542(e,t,n){"use strict";n.d(t,{J:()=>o}),n(83952);var r=n(13154);function i(e){var t=new Set([e]);return t.forEach(function(e){(0,r.s)(e)&&a(e)===e&&Object.getOwnPropertyNames(e).forEach(function(n){(0,r.s)(e[n])&&t.add(e[n])})}),e}function a(e){if(__DEV__&&!Object.isFrozen(e))try{Object.freeze(e)}catch(t){if(t instanceof TypeError)return null;throw t}return e}function o(e){return __DEV__&&i(e),e}},14012(e,t,n){"use strict";n.d(t,{J:()=>a});var r=n(70655),i=n(53712);function a(e,t){return(0,i.o)(e,t,t.variables&&{variables:(0,r.pi)((0,r.pi)({},e&&e.variables),t.variables)})}},13154(e,t,n){"use strict";function r(e){return null!==e&&"object"==typeof e}n.d(t,{s:()=>r})},83952(e,t,n){"use strict";n.d(t,{ej:()=>u,kG:()=>c,wY:()=>h});var r,i=n(70655),a="Invariant Violation",o=Object.setPrototypeOf,s=void 0===o?function(e,t){return e.__proto__=t,e}:o,u=function(e){function t(n){void 0===n&&(n=a);var r=e.call(this,"number"==typeof n?a+": "+n+" (see https://github.com/apollographql/invariant-packages)":n)||this;return r.framesToPop=1,r.name=a,s(r,t.prototype),r}return(0,i.ZT)(t,e),t}(Error);function c(e,t){if(!e)throw new u(t)}var l=["debug","log","warn","error","silent"],f=l.indexOf("log");function d(e){return function(){if(l.indexOf(e)>=f)return(console[e]||console.log).apply(console,arguments)}}function h(e){try{return e()}catch(t){}}(r=c||(c={})).debug=d("debug"),r.log=d("log"),r.warn=d("warn"),r.error=d("error");let p=h(function(){return globalThis})||h(function(){return window})||h(function(){return self})||h(function(){return global})||h(function(){return h.constructor("return this")()});var b="__",m=[b,b].join("DEV");function g(){try{return Boolean(__DEV__)}catch(e){return Object.defineProperty(p,m,{value:"production"!==h(function(){return"production"}),enumerable:!1,configurable:!0,writable:!0}),p[m]}}let v=g();function y(e){try{return e()}catch(t){}}var w=y(function(){return globalThis})||y(function(){return window})||y(function(){return self})||y(function(){return global})||y(function(){return y.constructor("return this")()}),_=!1;function E(){!w||y(function(){return"production"})||y(function(){return process})||(Object.defineProperty(w,"process",{value:{env:{NODE_ENV:"production"}},configurable:!0,enumerable:!1,writable:!0}),_=!0)}function S(){_&&(delete w.process,_=!1)}E();var k=n(10143);function x(){return k.H,S()}function T(){__DEV__?c("boolean"==typeof v,v):c("boolean"==typeof v,39)}x(),T()},4942(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n.d(t,{Z:()=>r})},87462(e,t,n){"use strict";function r(){return(r=Object.assign?Object.assign.bind():function(e){for(var t=1;tr})},51721(e,t,n){"use strict";function r(e,t){return(r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function i(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,r(e,t)}n.d(t,{Z:()=>i})},63366(e,t,n){"use strict";function r(e,t){if(null==e)return{};var n,r,i={},a=Object.keys(e);for(r=0;r=0||(i[n]=e[n]);return i}n.d(t,{Z:()=>r})},25821(e,t,n){"use strict";n.d(t,{Z:()=>s});var r=n(45695);function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var a=10,o=2;function s(e){return u(e,[])}function u(e,t){switch(i(e)){case"string":return JSON.stringify(e);case"function":return e.name?"[function ".concat(e.name,"]"):"[function]";case"object":if(null===e)return"null";return c(e,t);default:return String(e)}}function c(e,t){if(-1!==t.indexOf(e))return"[Circular]";var n=[].concat(t,[e]),r=d(e);if(void 0!==r){var i=r.call(e);if(i!==e)return"string"==typeof i?i:u(i,n)}else if(Array.isArray(e))return f(e,n);return l(e,n)}function l(e,t){var n=Object.keys(e);return 0===n.length?"{}":t.length>o?"["+h(e)+"]":"{ "+n.map(function(n){var r=u(e[n],t);return n+": "+r}).join(", ")+" }"}function f(e,t){if(0===e.length)return"[]";if(t.length>o)return"[Array]";for(var n=Math.min(a,e.length),r=e.length-n,i=[],s=0;s1&&i.push("... ".concat(r," more items")),"["+i.join(", ")+"]"}function d(e){var t=e[String(r.Z)];return"function"==typeof t?t:"function"==typeof e.inspect?e.inspect:void 0}function h(e){var t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===t&&"function"==typeof e.constructor){var n=e.constructor.name;if("string"==typeof n&&""!==n)return n}return t}},45695(e,t,n){"use strict";n.d(t,{Z:()=>i});var r="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):void 0;let i=r},25217(e,t,n){"use strict";function r(e,t){if(!Boolean(e))throw Error(null!=t?t:"Unexpected invariant triggered.")}n.d(t,{Ye:()=>o,WU:()=>s,UG:()=>u});var i=n(45695);function a(e){var t=e.prototype.toJSON;"function"==typeof t||r(0),e.prototype.inspect=t,i.Z&&(e.prototype[i.Z]=t)}var o=function(){function e(e,t,n){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=n}return e.prototype.toJSON=function(){return{start:this.start,end:this.end}},e}();a(o);var s=function(){function e(e,t,n,r,i,a,o){this.kind=e,this.start=t,this.end=n,this.line=r,this.column=i,this.value=o,this.prev=a,this.next=null}return e.prototype.toJSON=function(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}},e}();function u(e){return null!=e&&"string"==typeof e.kind}a(s)},87392(e,t,n){"use strict";function r(e){var t=e.split(/\r\n|[\n\r]/g),n=a(e);if(0!==n)for(var r=1;ro&&i(t[s-1]);)--s;return t.slice(o,s).join("\n")}function i(e){for(var t=0;t1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=-1===e.indexOf("\n"),i=" "===e[0]||" "===e[0],a='"'===e[e.length-1],o="\\"===e[e.length-1],s=!r||a||o||n,u="";return s&&!(r&&i)&&(u+="\n"+t),u+=t?e.replace(/\n/g,"\n"+t):e,s&&(u+="\n"),'"""'+u.replace(/"""/g,'\\"""')+'"""'}n.d(t,{LZ:()=>o,W7:()=>r})},97359(e,t,n){"use strict";n.d(t,{h:()=>r});var r=Object.freeze({NAME:"Name",DOCUMENT:"Document",OPERATION_DEFINITION:"OperationDefinition",VARIABLE_DEFINITION:"VariableDefinition",SELECTION_SET:"SelectionSet",FIELD:"Field",ARGUMENT:"Argument",FRAGMENT_SPREAD:"FragmentSpread",INLINE_FRAGMENT:"InlineFragment",FRAGMENT_DEFINITION:"FragmentDefinition",VARIABLE:"Variable",INT:"IntValue",FLOAT:"FloatValue",STRING:"StringValue",BOOLEAN:"BooleanValue",NULL:"NullValue",ENUM:"EnumValue",LIST:"ListValue",OBJECT:"ObjectValue",OBJECT_FIELD:"ObjectField",DIRECTIVE:"Directive",NAMED_TYPE:"NamedType",LIST_TYPE:"ListType",NON_NULL_TYPE:"NonNullType",SCHEMA_DEFINITION:"SchemaDefinition",OPERATION_TYPE_DEFINITION:"OperationTypeDefinition",SCALAR_TYPE_DEFINITION:"ScalarTypeDefinition",OBJECT_TYPE_DEFINITION:"ObjectTypeDefinition",FIELD_DEFINITION:"FieldDefinition",INPUT_VALUE_DEFINITION:"InputValueDefinition",INTERFACE_TYPE_DEFINITION:"InterfaceTypeDefinition",UNION_TYPE_DEFINITION:"UnionTypeDefinition",ENUM_TYPE_DEFINITION:"EnumTypeDefinition",ENUM_VALUE_DEFINITION:"EnumValueDefinition",INPUT_OBJECT_TYPE_DEFINITION:"InputObjectTypeDefinition",DIRECTIVE_DEFINITION:"DirectiveDefinition",SCHEMA_EXTENSION:"SchemaExtension",SCALAR_TYPE_EXTENSION:"ScalarTypeExtension",OBJECT_TYPE_EXTENSION:"ObjectTypeExtension",INTERFACE_TYPE_EXTENSION:"InterfaceTypeExtension",UNION_TYPE_EXTENSION:"UnionTypeExtension",ENUM_TYPE_EXTENSION:"EnumTypeExtension",INPUT_OBJECT_TYPE_EXTENSION:"InputObjectTypeExtension"})},10143(e,t,n){"use strict";n.d(t,{H:()=>c,T:()=>l});var r=n(99763),i=n(25821);function a(e,t){if(!Boolean(e))throw Error(t)}let o=function(e,t){return e instanceof t};function s(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:"GraphQL request",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{line:1,column:1};"string"==typeof e||a(0,"Body must be a string. Received: ".concat((0,i.Z)(e),".")),this.body=e,this.name=t,this.locationOffset=n,this.locationOffset.line>0||a(0,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||a(0,"column in locationOffset is 1-indexed and must be positive.")}return u(e,[{key:r.YF,get:function(){return"Source"}}]),e}();function l(e){return o(e,c)}},99763(e,t,n){"use strict";n.d(t,{YF:()=>r});var r="function"==typeof Symbol&&null!=Symbol.toStringTag?Symbol.toStringTag:"@@toStringTag"},37452(e){"use strict";e.exports=JSON.parse('{"AElig":"\xc6","AMP":"&","Aacute":"\xc1","Acirc":"\xc2","Agrave":"\xc0","Aring":"\xc5","Atilde":"\xc3","Auml":"\xc4","COPY":"\xa9","Ccedil":"\xc7","ETH":"\xd0","Eacute":"\xc9","Ecirc":"\xca","Egrave":"\xc8","Euml":"\xcb","GT":">","Iacute":"\xcd","Icirc":"\xce","Igrave":"\xcc","Iuml":"\xcf","LT":"<","Ntilde":"\xd1","Oacute":"\xd3","Ocirc":"\xd4","Ograve":"\xd2","Oslash":"\xd8","Otilde":"\xd5","Ouml":"\xd6","QUOT":"\\"","REG":"\xae","THORN":"\xde","Uacute":"\xda","Ucirc":"\xdb","Ugrave":"\xd9","Uuml":"\xdc","Yacute":"\xdd","aacute":"\xe1","acirc":"\xe2","acute":"\xb4","aelig":"\xe6","agrave":"\xe0","amp":"&","aring":"\xe5","atilde":"\xe3","auml":"\xe4","brvbar":"\xa6","ccedil":"\xe7","cedil":"\xb8","cent":"\xa2","copy":"\xa9","curren":"\xa4","deg":"\xb0","divide":"\xf7","eacute":"\xe9","ecirc":"\xea","egrave":"\xe8","eth":"\xf0","euml":"\xeb","frac12":"\xbd","frac14":"\xbc","frac34":"\xbe","gt":">","iacute":"\xed","icirc":"\xee","iexcl":"\xa1","igrave":"\xec","iquest":"\xbf","iuml":"\xef","laquo":"\xab","lt":"<","macr":"\xaf","micro":"\xb5","middot":"\xb7","nbsp":"\xa0","not":"\xac","ntilde":"\xf1","oacute":"\xf3","ocirc":"\xf4","ograve":"\xf2","ordf":"\xaa","ordm":"\xba","oslash":"\xf8","otilde":"\xf5","ouml":"\xf6","para":"\xb6","plusmn":"\xb1","pound":"\xa3","quot":"\\"","raquo":"\xbb","reg":"\xae","sect":"\xa7","shy":"\xad","sup1":"\xb9","sup2":"\xb2","sup3":"\xb3","szlig":"\xdf","thorn":"\xfe","times":"\xd7","uacute":"\xfa","ucirc":"\xfb","ugrave":"\xf9","uml":"\xa8","uuml":"\xfc","yacute":"\xfd","yen":"\xa5","yuml":"\xff"}')},93580(e){"use strict";e.exports=JSON.parse('{"0":"�","128":"€","130":"‚","131":"ƒ","132":"„","133":"…","134":"†","135":"‡","136":"ˆ","137":"‰","138":"Š","139":"‹","140":"Œ","142":"Ž","145":"‘","146":"’","147":"“","148":"”","149":"•","150":"–","151":"—","152":"˜","153":"™","154":"š","155":"›","156":"œ","158":"ž","159":"Ÿ"}')},67946(e){"use strict";e.exports=JSON.parse('{"locale":"en","long":{"year":{"previous":"last year","current":"this year","next":"next year","past":{"one":"{0} year ago","other":"{0} years ago"},"future":{"one":"in {0} year","other":"in {0} years"}},"quarter":{"previous":"last quarter","current":"this quarter","next":"next quarter","past":{"one":"{0} quarter ago","other":"{0} quarters ago"},"future":{"one":"in {0} quarter","other":"in {0} quarters"}},"month":{"previous":"last month","current":"this month","next":"next month","past":{"one":"{0} month ago","other":"{0} months ago"},"future":{"one":"in {0} month","other":"in {0} months"}},"week":{"previous":"last week","current":"this week","next":"next week","past":{"one":"{0} week ago","other":"{0} weeks ago"},"future":{"one":"in {0} week","other":"in {0} weeks"}},"day":{"previous":"yesterday","current":"today","next":"tomorrow","past":{"one":"{0} day ago","other":"{0} days ago"},"future":{"one":"in {0} day","other":"in {0} days"}},"hour":{"current":"this hour","past":{"one":"{0} hour ago","other":"{0} hours ago"},"future":{"one":"in {0} hour","other":"in {0} hours"}},"minute":{"current":"this minute","past":{"one":"{0} minute ago","other":"{0} minutes ago"},"future":{"one":"in {0} minute","other":"in {0} minutes"}},"second":{"current":"now","past":{"one":"{0} second ago","other":"{0} seconds ago"},"future":{"one":"in {0} second","other":"in {0} seconds"}}},"short":{"year":{"previous":"last yr.","current":"this yr.","next":"next yr.","past":"{0} yr. ago","future":"in {0} yr."},"quarter":{"previous":"last qtr.","current":"this qtr.","next":"next qtr.","past":{"one":"{0} qtr. ago","other":"{0} qtrs. ago"},"future":{"one":"in {0} qtr.","other":"in {0} qtrs."}},"month":{"previous":"last mo.","current":"this mo.","next":"next mo.","past":"{0} mo. ago","future":"in {0} mo."},"week":{"previous":"last wk.","current":"this wk.","next":"next wk.","past":"{0} wk. ago","future":"in {0} wk."},"day":{"previous":"yesterday","current":"today","next":"tomorrow","past":{"one":"{0} day ago","other":"{0} days ago"},"future":{"one":"in {0} day","other":"in {0} days"}},"hour":{"current":"this hour","past":"{0} hr. ago","future":"in {0} hr."},"minute":{"current":"this minute","past":"{0} min. ago","future":"in {0} min."},"second":{"current":"now","past":"{0} sec. ago","future":"in {0} sec."}},"narrow":{"year":{"previous":"last yr.","current":"this yr.","next":"next yr.","past":"{0} yr. ago","future":"in {0} yr."},"quarter":{"previous":"last qtr.","current":"this qtr.","next":"next qtr.","past":{"one":"{0} qtr. ago","other":"{0} qtrs. ago"},"future":{"one":"in {0} qtr.","other":"in {0} qtrs."}},"month":{"previous":"last mo.","current":"this mo.","next":"next mo.","past":"{0} mo. ago","future":"in {0} mo."},"week":{"previous":"last wk.","current":"this wk.","next":"next wk.","past":"{0} wk. ago","future":"in {0} wk."},"day":{"previous":"yesterday","current":"today","next":"tomorrow","past":{"one":"{0} day ago","other":"{0} days ago"},"future":{"one":"in {0} day","other":"in {0} days"}},"hour":{"current":"this hour","past":"{0} hr. ago","future":"in {0} hr."},"minute":{"current":"this minute","past":"{0} min. ago","future":"in {0} min."},"second":{"current":"now","past":"{0} sec. ago","future":"in {0} sec."}},"now":{"now":{"current":"now","future":"in a moment","past":"just now"}},"mini":{"year":"{0}yr","month":"{0}mo","week":"{0}wk","day":"{0}d","hour":"{0}h","minute":"{0}m","second":"{0}s","now":"now"},"short-time":{"year":"{0} yr.","month":"{0} mo.","week":"{0} wk.","day":{"one":"{0} day","other":"{0} days"},"hour":"{0} hr.","minute":"{0} min.","second":"{0} sec."},"long-time":{"year":{"one":"{0} year","other":"{0} years"},"month":{"one":"{0} month","other":"{0} months"},"week":{"one":"{0} week","other":"{0} weeks"},"day":{"one":"{0} day","other":"{0} days"},"hour":{"one":"{0} hour","other":"{0} hours"},"minute":{"one":"{0} minute","other":"{0} minutes"},"second":{"one":"{0} second","other":"{0} seconds"}}}')}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var n=__webpack_module_cache__[e]={id:e,loaded:!1,exports:{}};return __webpack_modules__[e].call(n.exports,n,n.exports,__webpack_require__),n.loaded=!0,n.exports}__webpack_require__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},(()=>{var e,t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__;__webpack_require__.t=function(n,r){if(1&r&&(n=this(n)),8&r||"object"==typeof n&&n&&(4&r&&n.__esModule||16&r&&"function"==typeof n.then))return n;var i=Object.create(null);__webpack_require__.r(i);var a={};e=e||[null,t({}),t([]),t(t)];for(var o=2&r&&n;"object"==typeof o&&!~e.indexOf(o);o=t(o))Object.getOwnPropertyNames(o).forEach(e=>a[e]=()=>n[e]);return a.default=()=>n,__webpack_require__.d(i,a),i}})(),__webpack_require__.d=(e,t)=>{for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.hmd=e=>((e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set(){throw Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e),__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),__webpack_require__.p="/assets/",__webpack_require__.nc=void 0;var __webpack_exports__={};(()=>{"use strict";var e,t,n,r,i=__webpack_require__(32316),a=__webpack_require__(8126),o=__webpack_require__(5690),s=__webpack_require__(30381),u=__webpack_require__.n(s),c=__webpack_require__(67294),l=__webpack_require__(73935),f=__webpack_require__.n(l),d=__webpack_require__(57209),h=__webpack_require__(37703),p=__webpack_require__(97779),b=__webpack_require__(28500);function m(e){return function(t){var n=t.dispatch,r=t.getState;return function(t){return function(i){return"function"==typeof i?i(n,r,e):t(i)}}}}var g=m();g.withExtraArgument=m;let v=g;var y=__webpack_require__(76489);function w(e){return function(t){return function(n){return function(r){n(r);var i=e||document&&document.cookie||"",a=t.getState();if("MATCH_ROUTE"===r.type&&"/signin"!==a.notifications.currentUrl){var o=(0,y.Q)(i);if(o.explorer)try{var s=JSON.parse(o.explorer);if("error"===s.status){var u=_(s.url);n({type:"NOTIFY_ERROR_MSG",msg:u})}}catch(c){n({type:"NOTIFY_ERROR_MSG",msg:"Invalid explorer status"})}}}}}}function _(e){var t="Can't connect to explorer: ".concat(e);return e.match(/^wss?:.+/)?t:"".concat(t,". You must use a websocket.")}var E=__webpack_require__(16353);function S(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function ei(e,t){if(e){if("string"==typeof e)return ea(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ea(e,t)}}function ea(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n1,i=!1,a=arguments[1],o=a;return new n(function(n){return t.subscribe({next:function(t){var a=!i;if(i=!0,!a||r)try{o=e(o,t)}catch(s){return n.error(s)}else o=t},error:function(e){n.error(e)},complete:function(){if(!i&&!r)return n.error(TypeError("Cannot reduce an empty sequence"));n.next(o),n.complete()}})})},t.concat=function(){for(var e=this,t=arguments.length,n=Array(t),r=0;r=0&&i.splice(e,1),o()}});i.push(s)},error:function(e){r.error(e)},complete:function(){o()}});function o(){a.closed&&0===i.length&&r.complete()}return function(){i.forEach(function(e){return e.unsubscribe()}),a.unsubscribe()}})},t[ed]=function(){return this},e.from=function(t){var n="function"==typeof this?this:e;if(null==t)throw TypeError(t+" is not an object");var r=ep(t,ed);if(r){var i=r.call(t);if(Object(i)!==i)throw TypeError(i+" is not an object");return em(i)&&i.constructor===n?i:new n(function(e){return i.subscribe(e)})}if(ec("iterator")&&(r=ep(t,ef)))return new n(function(e){ev(function(){if(!e.closed){for(var n,i=er(r.call(t));!(n=i()).done;){var a=n.value;if(e.next(a),e.closed)return}e.complete()}})});if(Array.isArray(t))return new n(function(e){ev(function(){if(!e.closed){for(var n=0;n0))return n.connection.key;var r=n.connection.filter?n.connection.filter:[];r.sort();var i={};return r.forEach(function(e){i[e]=t[e]}),"".concat(n.connection.key,"(").concat(eV(i),")")}var a=e;if(t){var o=eV(t);a+="(".concat(o,")")}return n&&Object.keys(n).forEach(function(e){-1===eW.indexOf(e)&&(n[e]&&Object.keys(n[e]).length?a+="@".concat(e,"(").concat(eV(n[e]),")"):a+="@".concat(e))}),a},{setStringify:function(e){var t=eV;return eV=e,t}}),eV=function(e){return JSON.stringify(e,eq)};function eq(e,t){return(0,eO.s)(t)&&!Array.isArray(t)&&(t=Object.keys(t).sort().reduce(function(e,n){return e[n]=t[n],e},{})),t}function eZ(e,t){if(e.arguments&&e.arguments.length){var n={};return e.arguments.forEach(function(e){var r;return ez(n,e.name,e.value,t)}),n}return null}function eX(e){return e.alias?e.alias.value:e.name.value}function eJ(e,t,n){for(var r,i=0,a=t.selections;it.indexOf(i))throw __DEV__?new Q.ej("illegal argument: ".concat(i)):new Q.ej(27)}return e}function tt(e,t){return t?t(e):eT.of()}function tn(e){return"function"==typeof e?new ta(e):e}function tr(e){return e.request.length<=1}var ti=function(e){function t(t,n){var r=e.call(this,t)||this;return r.link=n,r}return(0,en.ZT)(t,e),t}(Error),ta=function(){function e(e){e&&(this.request=e)}return e.empty=function(){return new e(function(){return eT.of()})},e.from=function(t){return 0===t.length?e.empty():t.map(tn).reduce(function(e,t){return e.concat(t)})},e.split=function(t,n,r){var i=tn(n),a=tn(r||new e(tt));return new e(tr(i)&&tr(a)?function(e){return t(e)?i.request(e)||eT.of():a.request(e)||eT.of()}:function(e,n){return t(e)?i.request(e,n)||eT.of():a.request(e,n)||eT.of()})},e.execute=function(e,t){return e.request(eM(t.context,e7(te(t))))||eT.of()},e.concat=function(t,n){var r=tn(t);if(tr(r))return __DEV__&&Q.kG.warn(new ti("You are calling concat on a terminating link, which will have no effect",r)),r;var i=tn(n);return new e(tr(i)?function(e){return r.request(e,function(e){return i.request(e)||eT.of()})||eT.of()}:function(e,t){return r.request(e,function(e){return i.request(e,t)||eT.of()})||eT.of()})},e.prototype.split=function(t,n,r){return this.concat(e.split(t,n,r||new e(tt)))},e.prototype.concat=function(t){return e.concat(this,t)},e.prototype.request=function(e,t){throw __DEV__?new Q.ej("request is not implemented"):new Q.ej(22)},e.prototype.onError=function(e,t){if(t&&t.error)return t.error(e),!1;throw e},e.prototype.setOnError=function(e){return this.onError=e,this},e}(),to=__webpack_require__(25821),ts=__webpack_require__(25217),tu={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]},tc=Object.freeze({});function tl(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:tu,r=void 0,i=Array.isArray(e),a=[e],o=-1,s=[],u=void 0,c=void 0,l=void 0,f=[],d=[],h=e;do{var p,b=++o===a.length,m=b&&0!==s.length;if(b){if(c=0===d.length?void 0:f[f.length-1],u=l,l=d.pop(),m){if(i)u=u.slice();else{for(var g={},v=0,y=Object.keys(u);v1)for(var r=new tB,i=1;i=0;--a){var o=i[a],s=isNaN(+o)?{}:[];s[o]=t,t=s}n=r.merge(n,t)}),n}var tW=Object.prototype.hasOwnProperty;function tK(e,t){var n,r,i,a,o;return(0,en.mG)(this,void 0,void 0,function(){var s,u,c,l,f,d,h,p,b,m,g,v,y,w,_,E,S,k,x,T,M,O,A;return(0,en.Jh)(this,function(L){switch(L.label){case 0:if(void 0===TextDecoder)throw Error("TextDecoder must be defined in the environment: please import a polyfill.");s=new TextDecoder("utf-8"),u=null===(n=e.headers)||void 0===n?void 0:n.get("content-type"),c="boundary=",l=(null==u?void 0:u.includes(c))?null==u?void 0:u.substring((null==u?void 0:u.indexOf(c))+c.length).replace(/['"]/g,"").replace(/\;(.*)/gm,"").trim():"-",f="\r\n--".concat(l),d="",h=tI(e),p=!0,L.label=1;case 1:if(!p)return[3,3];return[4,h.next()];case 2:for(m=(b=L.sent()).value,g=b.done,v="string"==typeof m?m:s.decode(m),y=d.length-f.length+1,p=!g,d+=v,w=d.indexOf(f,y);w>-1;){if(_=void 0,_=(O=[d.slice(0,w),d.slice(w+f.length),])[0],d=O[1],E=_.indexOf("\r\n\r\n"),(k=(S=tV(_.slice(0,E)))["content-type"])&&-1===k.toLowerCase().indexOf("application/json"))throw Error("Unsupported patch content type: application/json is required.");if(x=_.slice(E))try{T=tq(e,x),Object.keys(T).length>1||"data"in T||"incremental"in T||"errors"in T||"payload"in T?tz(T)?(M={},"payload"in T&&(M=(0,en.pi)({},T.payload)),"errors"in T&&(M=(0,en.pi)((0,en.pi)({},M),{extensions:(0,en.pi)((0,en.pi)({},"extensions"in M?M.extensions:null),((A={})[tN.YG]=T.errors,A))})),null===(r=t.next)||void 0===r||r.call(t,M)):null===(i=t.next)||void 0===i||i.call(t,T):1===Object.keys(T).length&&"hasNext"in T&&!T.hasNext&&(null===(a=t.complete)||void 0===a||a.call(t))}catch(C){tZ(C,t)}w=d.indexOf(f)}return[3,1];case 3:return null===(o=t.complete)||void 0===o||o.call(t),[2]}})})}function tV(e){var t={};return e.split("\n").forEach(function(e){var n=e.indexOf(":");if(n>-1){var r=e.slice(0,n).trim().toLowerCase(),i=e.slice(n+1).trim();t[r]=i}}),t}function tq(e,t){e.status>=300&&tD(e,function(){try{return JSON.parse(t)}catch(e){return t}}(),"Response not successful: Received status code ".concat(e.status));try{return JSON.parse(t)}catch(n){var r=n;throw r.name="ServerParseError",r.response=e,r.statusCode=e.status,r.bodyText=t,r}}function tZ(e,t){var n,r;"AbortError"!==e.name&&(e.result&&e.result.errors&&e.result.data&&(null===(n=t.next)||void 0===n||n.call(t,e.result)),null===(r=t.error)||void 0===r||r.call(t,e))}function tX(e,t,n){tJ(t)(e).then(function(e){var t,r;null===(t=n.next)||void 0===t||t.call(n,e),null===(r=n.complete)||void 0===r||r.call(n)}).catch(function(e){return tZ(e,n)})}function tJ(e){return function(t){return t.text().then(function(e){return tq(t,e)}).then(function(n){return t.status>=300&&tD(t,n,"Response not successful: Received status code ".concat(t.status)),Array.isArray(n)||tW.call(n,"data")||tW.call(n,"errors")||tD(t,n,"Server response was missing for query '".concat(Array.isArray(e)?e.map(function(e){return e.operationName}):e.operationName,"'.")),n})}}var tQ=function(e){if(!e&&"undefined"==typeof fetch)throw __DEV__?new Q.ej("\n\"fetch\" has not been found globally and no fetcher has been configured. To fix this, install a fetch package (like https://www.npmjs.com/package/cross-fetch), instantiate the fetcher, and pass it into your HttpLink constructor. For example:\n\nimport fetch from 'cross-fetch';\nimport { ApolloClient, HttpLink } from '@apollo/client';\nconst client = new ApolloClient({\n link: new HttpLink({ uri: '/graphql', fetch })\n});\n "):new Q.ej(23)},t1=__webpack_require__(87392);function t0(e){return tl(e,{leave:t3})}var t2=80,t3={Name:function(e){return e.value},Variable:function(e){return"$"+e.name},Document:function(e){return t6(e.definitions,"\n\n")+"\n"},OperationDefinition:function(e){var t=e.operation,n=e.name,r=t8("(",t6(e.variableDefinitions,", "),")"),i=t6(e.directives," "),a=e.selectionSet;return n||i||r||"query"!==t?t6([t,t6([n,r]),i,a]," "):a},VariableDefinition:function(e){var t=e.variable,n=e.type,r=e.defaultValue,i=e.directives;return t+": "+n+t8(" = ",r)+t8(" ",t6(i," "))},SelectionSet:function(e){return t5(e.selections)},Field:function(e){var t=e.alias,n=e.name,r=e.arguments,i=e.directives,a=e.selectionSet,o=t8("",t,": ")+n,s=o+t8("(",t6(r,", "),")");return s.length>t2&&(s=o+t8("(\n",t9(t6(r,"\n")),"\n)")),t6([s,t6(i," "),a]," ")},Argument:function(e){var t;return e.name+": "+e.value},FragmentSpread:function(e){var t;return"..."+e.name+t8(" ",t6(e.directives," "))},InlineFragment:function(e){var t=e.typeCondition,n=e.directives,r=e.selectionSet;return t6(["...",t8("on ",t),t6(n," "),r]," ")},FragmentDefinition:function(e){var t=e.name,n=e.typeCondition,r=e.variableDefinitions,i=e.directives,a=e.selectionSet;return"fragment ".concat(t).concat(t8("(",t6(r,", "),")")," ")+"on ".concat(n," ").concat(t8("",t6(i," ")," "))+a},IntValue:function(e){return e.value},FloatValue:function(e){return e.value},StringValue:function(e,t){var n=e.value;return e.block?(0,t1.LZ)(n,"description"===t?"":" "):JSON.stringify(n)},BooleanValue:function(e){return e.value?"true":"false"},NullValue:function(){return"null"},EnumValue:function(e){return e.value},ListValue:function(e){return"["+t6(e.values,", ")+"]"},ObjectValue:function(e){return"{"+t6(e.fields,", ")+"}"},ObjectField:function(e){var t;return e.name+": "+e.value},Directive:function(e){var t;return"@"+e.name+t8("(",t6(e.arguments,", "),")")},NamedType:function(e){return e.name},ListType:function(e){return"["+e.type+"]"},NonNullType:function(e){return e.type+"!"},SchemaDefinition:t4(function(e){var t=e.directives,n=e.operationTypes;return t6(["schema",t6(t," "),t5(n)]," ")}),OperationTypeDefinition:function(e){var t;return e.operation+": "+e.type},ScalarTypeDefinition:t4(function(e){var t;return t6(["scalar",e.name,t6(e.directives," ")]," ")}),ObjectTypeDefinition:t4(function(e){var t=e.name,n=e.interfaces,r=e.directives,i=e.fields;return t6(["type",t,t8("implements ",t6(n," & ")),t6(r," "),t5(i)]," ")}),FieldDefinition:t4(function(e){var t=e.name,n=e.arguments,r=e.type,i=e.directives;return t+(ne(n)?t8("(\n",t9(t6(n,"\n")),"\n)"):t8("(",t6(n,", "),")"))+": "+r+t8(" ",t6(i," "))}),InputValueDefinition:t4(function(e){var t=e.name,n=e.type,r=e.defaultValue,i=e.directives;return t6([t+": "+n,t8("= ",r),t6(i," ")]," ")}),InterfaceTypeDefinition:t4(function(e){var t=e.name,n=e.interfaces,r=e.directives,i=e.fields;return t6(["interface",t,t8("implements ",t6(n," & ")),t6(r," "),t5(i)]," ")}),UnionTypeDefinition:t4(function(e){var t=e.name,n=e.directives,r=e.types;return t6(["union",t,t6(n," "),r&&0!==r.length?"= "+t6(r," | "):""]," ")}),EnumTypeDefinition:t4(function(e){var t=e.name,n=e.directives,r=e.values;return t6(["enum",t,t6(n," "),t5(r)]," ")}),EnumValueDefinition:t4(function(e){var t;return t6([e.name,t6(e.directives," ")]," ")}),InputObjectTypeDefinition:t4(function(e){var t=e.name,n=e.directives,r=e.fields;return t6(["input",t,t6(n," "),t5(r)]," ")}),DirectiveDefinition:t4(function(e){var t=e.name,n=e.arguments,r=e.repeatable,i=e.locations;return"directive @"+t+(ne(n)?t8("(\n",t9(t6(n,"\n")),"\n)"):t8("(",t6(n,", "),")"))+(r?" repeatable":"")+" on "+t6(i," | ")}),SchemaExtension:function(e){var t=e.directives,n=e.operationTypes;return t6(["extend schema",t6(t," "),t5(n)]," ")},ScalarTypeExtension:function(e){var t;return t6(["extend scalar",e.name,t6(e.directives," ")]," ")},ObjectTypeExtension:function(e){var t=e.name,n=e.interfaces,r=e.directives,i=e.fields;return t6(["extend type",t,t8("implements ",t6(n," & ")),t6(r," "),t5(i)]," ")},InterfaceTypeExtension:function(e){var t=e.name,n=e.interfaces,r=e.directives,i=e.fields;return t6(["extend interface",t,t8("implements ",t6(n," & ")),t6(r," "),t5(i)]," ")},UnionTypeExtension:function(e){var t=e.name,n=e.directives,r=e.types;return t6(["extend union",t,t6(n," "),r&&0!==r.length?"= "+t6(r," | "):""]," ")},EnumTypeExtension:function(e){var t=e.name,n=e.directives,r=e.values;return t6(["extend enum",t,t6(n," "),t5(r)]," ")},InputObjectTypeExtension:function(e){var t=e.name,n=e.directives,r=e.fields;return t6(["extend input",t,t6(n," "),t5(r)]," ")}};function t4(e){return function(t){return t6([t.description,e(t)],"\n")}}function t6(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return null!==(t=null==e?void 0:e.filter(function(e){return e}).join(n))&&void 0!==t?t:""}function t5(e){return t8("{\n",t9(t6(e,"\n")),"\n}")}function t8(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return null!=t&&""!==t?e+t+n:""}function t9(e){return t8(" ",e.replace(/\n/g,"\n "))}function t7(e){return -1!==e.indexOf("\n")}function ne(e){return null!=e&&e.some(t7)}var nt,nn,nr,ni={http:{includeQuery:!0,includeExtensions:!1,preserveHeaderCase:!1},headers:{accept:"*/*","content-type":"application/json"},options:{method:"POST"}},na=function(e,t){return t(e)};function no(e,t){for(var n=[],r=2;rObject.create(null),{forEach:nv,slice:ny}=Array.prototype,{hasOwnProperty:nw}=Object.prototype;class n_{constructor(e=!0,t=ng){this.weakness=e,this.makeData=t}lookup(...e){return this.lookupArray(e)}lookupArray(e){let t=this;return nv.call(e,e=>t=t.getChildTrie(e)),nw.call(t,"data")?t.data:t.data=this.makeData(ny.call(e))}peek(...e){return this.peekArray(e)}peekArray(e){let t=this;for(let n=0,r=e.length;t&&n=0;--o)t.definitions[o].kind===nL.h.OPERATION_DEFINITION&&++a;var s=nN(e),u=e.some(function(e){return e.remove}),c=function(e){return u&&e&&e.some(s)},l=new Map,f=!1,d={enter:function(e){if(c(e.directives))return f=!0,null}},h=tl(t,{Field:d,InlineFragment:d,VariableDefinition:{enter:function(){return!1}},Variable:{enter:function(e,t,n,r,a){var o=i(a);o&&o.variables.add(e.name.value)}},FragmentSpread:{enter:function(e,t,n,r,a){if(c(e.directives))return f=!0,null;var o=i(a);o&&o.fragmentSpreads.add(e.name.value)}},FragmentDefinition:{enter:function(e,t,n,r){l.set(JSON.stringify(r),e)},leave:function(e,t,n,i){return e===l.get(JSON.stringify(i))?e:a>0&&e.selectionSet.selections.every(function(e){return e.kind===nL.h.FIELD&&"__typename"===e.name.value})?(r(e.name.value).removed=!0,f=!0,null):void 0}},Directive:{leave:function(e){if(s(e))return f=!0,null}}});if(!f)return t;var p=function(e){return e.transitiveVars||(e.transitiveVars=new Set(e.variables),e.removed||e.fragmentSpreads.forEach(function(t){p(r(t)).transitiveVars.forEach(function(t){e.transitiveVars.add(t)})})),e},b=new Set;h.definitions.forEach(function(e){e.kind===nL.h.OPERATION_DEFINITION?p(n(e.name&&e.name.value)).fragmentSpreads.forEach(function(e){b.add(e)}):e.kind!==nL.h.FRAGMENT_DEFINITION||0!==a||r(e.name.value).removed||b.add(e.name.value)}),b.forEach(function(e){p(r(e)).fragmentSpreads.forEach(function(e){b.add(e)})});var m=function(e){return!!(!b.has(e)||r(e).removed)},g={enter:function(e){if(m(e.name.value))return null}};return nD(tl(h,{FragmentSpread:g,FragmentDefinition:g,OperationDefinition:{leave:function(e){if(e.variableDefinitions){var t=p(n(e.name&&e.name.value)).transitiveVars;if(t.size0},t.prototype.tearDownQuery=function(){this.isTornDown||(this.concast&&this.observer&&(this.concast.removeObserver(this.observer),delete this.concast,delete this.observer),this.stopPolling(),this.subscriptions.forEach(function(e){return e.unsubscribe()}),this.subscriptions.clear(),this.queryManager.stopQuery(this.queryId),this.observers.clear(),this.isTornDown=!0)},t}(eT);function n4(e){var t=e.options,n=t.fetchPolicy,r=t.nextFetchPolicy;return"cache-and-network"===n||"network-only"===n?e.reobserve({fetchPolicy:"cache-first",nextFetchPolicy:function(){return(this.nextFetchPolicy=r,"function"==typeof r)?r.apply(this,arguments):n}}):e.reobserve()}function n6(e){__DEV__&&Q.kG.error("Unhandled error",e.message,e.stack)}function n5(e){__DEV__&&e&&__DEV__&&Q.kG.debug("Missing cache result fields: ".concat(JSON.stringify(e)),e)}function n8(e){return"network-only"===e||"no-cache"===e||"standby"===e}nK(n3);function n9(e){return e.kind===nL.h.FIELD||e.kind===nL.h.FRAGMENT_SPREAD||e.kind===nL.h.INLINE_FRAGMENT}function n7(e){return e.kind===Kind.SCALAR_TYPE_DEFINITION||e.kind===Kind.OBJECT_TYPE_DEFINITION||e.kind===Kind.INTERFACE_TYPE_DEFINITION||e.kind===Kind.UNION_TYPE_DEFINITION||e.kind===Kind.ENUM_TYPE_DEFINITION||e.kind===Kind.INPUT_OBJECT_TYPE_DEFINITION}function re(e){return e.kind===Kind.SCALAR_TYPE_EXTENSION||e.kind===Kind.OBJECT_TYPE_EXTENSION||e.kind===Kind.INTERFACE_TYPE_EXTENSION||e.kind===Kind.UNION_TYPE_EXTENSION||e.kind===Kind.ENUM_TYPE_EXTENSION||e.kind===Kind.INPUT_OBJECT_TYPE_EXTENSION}var rt=function(){return Object.create(null)},rn=Array.prototype,rr=rn.forEach,ri=rn.slice,ra=function(){function e(e,t){void 0===e&&(e=!0),void 0===t&&(t=rt),this.weakness=e,this.makeData=t}return e.prototype.lookup=function(){for(var e=[],t=0;tclass{constructor(){this.id=["slot",rc++,Date.now(),Math.random().toString(36).slice(2),].join(":")}hasValue(){for(let e=rs;e;e=e.parent)if(this.id in e.slots){let t=e.slots[this.id];if(t===ru)break;return e!==rs&&(rs.slots[this.id]=t),!0}return rs&&(rs.slots[this.id]=ru),!1}getValue(){if(this.hasValue())return rs.slots[this.id]}withValue(e,t,n,r){let i={__proto__:null,[this.id]:e},a=rs;rs={parent:a,slots:i};try{return t.apply(r,n)}finally{rs=a}}static bind(e){let t=rs;return function(){let n=rs;try{return rs=t,e.apply(this,arguments)}finally{rs=n}}}static noContext(e,t,n){if(!rs)return e.apply(n,t);{let r=rs;try{return rs=null,e.apply(n,t)}finally{rs=r}}}};function rf(e){try{return e()}catch(t){}}let rd="@wry/context:Slot",rh=rf(()=>globalThis)||rf(()=>global)||Object.create(null),rp=rh,rb=rp[rd]||Array[rd]||function(e){try{Object.defineProperty(rp,rd,{value:e,enumerable:!1,writable:!1,configurable:!0})}finally{return e}}(rl()),{bind:rm,noContext:rg}=rb;function rv(){}var ry=function(){function e(e,t){void 0===e&&(e=1/0),void 0===t&&(t=rv),this.max=e,this.dispose=t,this.map=new Map,this.newest=null,this.oldest=null}return e.prototype.has=function(e){return this.map.has(e)},e.prototype.get=function(e){var t=this.getNode(e);return t&&t.value},e.prototype.getNode=function(e){var t=this.map.get(e);if(t&&t!==this.newest){var n=t.older,r=t.newer;r&&(r.older=n),n&&(n.newer=r),t.older=this.newest,t.older.newer=t,t.newer=null,this.newest=t,t===this.oldest&&(this.oldest=r)}return t},e.prototype.set=function(e,t){var n=this.getNode(e);return n?n.value=t:(n={key:e,value:t,newer:null,older:this.newest},this.newest&&(this.newest.newer=n),this.newest=n,this.oldest=this.oldest||n,this.map.set(e,n),n.value)},e.prototype.clean=function(){for(;this.oldest&&this.map.size>this.max;)this.delete(this.oldest.key)},e.prototype.delete=function(e){var t=this.map.get(e);return!!t&&(t===this.newest&&(this.newest=t.older),t===this.oldest&&(this.oldest=t.newer),t.newer&&(t.newer.older=t.older),t.older&&(t.older.newer=t.newer),this.map.delete(e),this.dispose(t.value,e),!0)},e}(),rw=new rb,r_=Object.prototype.hasOwnProperty,rE=void 0===(n=Array.from)?function(e){var t=[];return e.forEach(function(e){return t.push(e)}),t}:n;function rS(e){var t=e.unsubscribe;"function"==typeof t&&(e.unsubscribe=void 0,t())}var rk=[],rx=100;function rT(e,t){if(!e)throw Error(t||"assertion failure")}function rM(e,t){var n=e.length;return n>0&&n===t.length&&e[n-1]===t[n-1]}function rO(e){switch(e.length){case 0:throw Error("unknown value");case 1:return e[0];case 2:throw e[1]}}function rA(e){return e.slice(0)}var rL=function(){function e(t){this.fn=t,this.parents=new Set,this.childValues=new Map,this.dirtyChildren=null,this.dirty=!0,this.recomputing=!1,this.value=[],this.deps=null,++e.count}return e.prototype.peek=function(){if(1===this.value.length&&!rN(this))return rC(this),this.value[0]},e.prototype.recompute=function(e){return rT(!this.recomputing,"already recomputing"),rC(this),rN(this)?rI(this,e):rO(this.value)},e.prototype.setDirty=function(){this.dirty||(this.dirty=!0,this.value.length=0,rR(this),rS(this))},e.prototype.dispose=function(){var e=this;this.setDirty(),rH(this),rF(this,function(t,n){t.setDirty(),r$(t,e)})},e.prototype.forget=function(){this.dispose()},e.prototype.dependOn=function(e){e.add(this),this.deps||(this.deps=rk.pop()||new Set),this.deps.add(e)},e.prototype.forgetDeps=function(){var e=this;this.deps&&(rE(this.deps).forEach(function(t){return t.delete(e)}),this.deps.clear(),rk.push(this.deps),this.deps=null)},e.count=0,e}();function rC(e){var t=rw.getValue();if(t)return e.parents.add(t),t.childValues.has(e)||t.childValues.set(e,[]),rN(e)?rY(t,e):rB(t,e),t}function rI(e,t){return rH(e),rw.withValue(e,rD,[e,t]),rz(e,t)&&rP(e),rO(e.value)}function rD(e,t){e.recomputing=!0,e.value.length=0;try{e.value[0]=e.fn.apply(null,t)}catch(n){e.value[1]=n}e.recomputing=!1}function rN(e){return e.dirty||!!(e.dirtyChildren&&e.dirtyChildren.size)}function rP(e){e.dirty=!1,!rN(e)&&rj(e)}function rR(e){rF(e,rY)}function rj(e){rF(e,rB)}function rF(e,t){var n=e.parents.size;if(n)for(var r=rE(e.parents),i=0;i0&&e.childValues.forEach(function(t,n){r$(e,n)}),e.forgetDeps(),rT(null===e.dirtyChildren)}function r$(e,t){t.parents.delete(e),e.childValues.delete(t),rU(e,t)}function rz(e,t){if("function"==typeof e.subscribe)try{rS(e),e.unsubscribe=e.subscribe.apply(null,t)}catch(n){return e.setDirty(),!1}return!0}var rG={setDirty:!0,dispose:!0,forget:!0};function rW(e){var t=new Map,n=e&&e.subscribe;function r(e){var r=rw.getValue();if(r){var i=t.get(e);i||t.set(e,i=new Set),r.dependOn(i),"function"==typeof n&&(rS(i),i.unsubscribe=n(e))}}return r.dirty=function(e,n){var r=t.get(e);if(r){var i=n&&r_.call(rG,n)?n:"setDirty";rE(r).forEach(function(e){return e[i]()}),t.delete(e),rS(r)}},r}function rK(){var e=new ra("function"==typeof WeakMap);return function(){return e.lookupArray(arguments)}}var rV=rK(),rq=new Set;function rZ(e,t){void 0===t&&(t=Object.create(null));var n=new ry(t.max||65536,function(e){return e.dispose()}),r=t.keyArgs,i=t.makeCacheKey||rK(),a=function(){var a=i.apply(null,r?r.apply(null,arguments):arguments);if(void 0===a)return e.apply(null,arguments);var o=n.get(a);o||(n.set(a,o=new rL(e)),o.subscribe=t.subscribe,o.forget=function(){return n.delete(a)});var s=o.recompute(Array.prototype.slice.call(arguments));return n.set(a,o),rq.add(n),rw.hasValue()||(rq.forEach(function(e){return e.clean()}),rq.clear()),s};function o(e){var t=n.get(e);t&&t.setDirty()}function s(e){var t=n.get(e);if(t)return t.peek()}function u(e){return n.delete(e)}return Object.defineProperty(a,"size",{get:function(){return n.map.size},configurable:!1,enumerable:!1}),a.dirtyKey=o,a.dirty=function(){o(i.apply(null,arguments))},a.peekKey=s,a.peek=function(){return s(i.apply(null,arguments))},a.forgetKey=u,a.forget=function(){return u(i.apply(null,arguments))},a.makeCacheKey=i,a.getKey=r?function(){return i.apply(null,r.apply(null,arguments))}:i,Object.freeze(a)}var rX=new rb,rJ=new WeakMap;function rQ(e){var t=rJ.get(e);return t||rJ.set(e,t={vars:new Set,dep:rW()}),t}function r1(e){rQ(e).vars.forEach(function(t){return t.forgetCache(e)})}function r0(e){rQ(e).vars.forEach(function(t){return t.attachCache(e)})}function r2(e){var t=new Set,n=new Set,r=function(a){if(arguments.length>0){if(e!==a){e=a,t.forEach(function(e){rQ(e).dep.dirty(r),r3(e)});var o=Array.from(n);n.clear(),o.forEach(function(t){return t(e)})}}else{var s=rX.getValue();s&&(i(s),rQ(s).dep(r))}return e};r.onNextChange=function(e){return n.add(e),function(){n.delete(e)}};var i=r.attachCache=function(e){return t.add(e),rQ(e).vars.add(r),r};return r.forgetCache=function(e){return t.delete(e)},r}function r3(e){e.broadcastWatches&&e.broadcastWatches()}var r4=function(){function e(e){var t=e.cache,n=e.client,r=e.resolvers,i=e.fragmentMatcher;this.selectionsToResolveCache=new WeakMap,this.cache=t,n&&(this.client=n),r&&this.addResolvers(r),i&&this.setFragmentMatcher(i)}return e.prototype.addResolvers=function(e){var t=this;this.resolvers=this.resolvers||{},Array.isArray(e)?e.forEach(function(e){t.resolvers=tj(t.resolvers,e)}):this.resolvers=tj(this.resolvers,e)},e.prototype.setResolvers=function(e){this.resolvers={},this.addResolvers(e)},e.prototype.getResolvers=function(){return this.resolvers||{}},e.prototype.runResolvers=function(e){var t=e.document,n=e.remoteResult,r=e.context,i=e.variables,a=e.onlyRunForcedResolvers,o=void 0!==a&&a;return(0,en.mG)(this,void 0,void 0,function(){return(0,en.Jh)(this,function(e){return t?[2,this.resolveDocument(t,n.data,r,i,this.fragmentMatcher,o).then(function(e){return(0,en.pi)((0,en.pi)({},n),{data:e.result})})]:[2,n]})})},e.prototype.setFragmentMatcher=function(e){this.fragmentMatcher=e},e.prototype.getFragmentMatcher=function(){return this.fragmentMatcher},e.prototype.clientQuery=function(e){return tb(["client"],e)&&this.resolvers?e:null},e.prototype.serverQuery=function(e){return n$(e)},e.prototype.prepareContext=function(e){var t=this.cache;return(0,en.pi)((0,en.pi)({},e),{cache:t,getCacheKey:function(e){return t.identify(e)}})},e.prototype.addExportedVariables=function(e,t,n){return void 0===t&&(t={}),void 0===n&&(n={}),(0,en.mG)(this,void 0,void 0,function(){return(0,en.Jh)(this,function(r){return e?[2,this.resolveDocument(e,this.buildRootValueFromCache(e,t)||{},this.prepareContext(n),t).then(function(e){return(0,en.pi)((0,en.pi)({},t),e.exportedVariables)})]:[2,(0,en.pi)({},t)]})})},e.prototype.shouldForceResolvers=function(e){var t=!1;return tl(e,{Directive:{enter:function(e){if("client"===e.name.value&&e.arguments&&(t=e.arguments.some(function(e){return"always"===e.name.value&&"BooleanValue"===e.value.kind&&!0===e.value.value})))return tc}}}),t},e.prototype.buildRootValueFromCache=function(e,t){return this.cache.diff({query:nH(e),variables:t,returnPartialData:!0,optimistic:!1}).result},e.prototype.resolveDocument=function(e,t,n,r,i,a){return void 0===n&&(n={}),void 0===r&&(r={}),void 0===i&&(i=function(){return!0}),void 0===a&&(a=!1),(0,en.mG)(this,void 0,void 0,function(){var o,s,u,c,l,f,d,h,p,b,m;return(0,en.Jh)(this,function(g){return o=e8(e),s=e4(e),u=eL(s),c=this.collectSelectionsToResolve(o,u),f=(l=o.operation)?l.charAt(0).toUpperCase()+l.slice(1):"Query",d=this,h=d.cache,p=d.client,b={fragmentMap:u,context:(0,en.pi)((0,en.pi)({},n),{cache:h,client:p}),variables:r,fragmentMatcher:i,defaultOperationType:f,exportedVariables:{},selectionsToResolve:c,onlyRunForcedResolvers:a},m=!1,[2,this.resolveSelectionSet(o.selectionSet,m,t,b).then(function(e){return{result:e,exportedVariables:b.exportedVariables}})]})})},e.prototype.resolveSelectionSet=function(e,t,n,r){return(0,en.mG)(this,void 0,void 0,function(){var i,a,o,s,u,c=this;return(0,en.Jh)(this,function(l){return i=r.fragmentMap,a=r.context,o=r.variables,s=[n],u=function(e){return(0,en.mG)(c,void 0,void 0,function(){var u,c;return(0,en.Jh)(this,function(l){return(t||r.selectionsToResolve.has(e))&&td(e,o)?eQ(e)?[2,this.resolveField(e,t,n,r).then(function(t){var n;void 0!==t&&s.push(((n={})[eX(e)]=t,n))})]:(e1(e)?u=e:(u=i[e.name.value],__DEV__?(0,Q.kG)(u,"No fragment named ".concat(e.name.value)):(0,Q.kG)(u,11)),u&&u.typeCondition&&(c=u.typeCondition.name.value,r.fragmentMatcher(n,c,a)))?[2,this.resolveSelectionSet(u.selectionSet,t,n,r).then(function(e){s.push(e)})]:[2]:[2]})})},[2,Promise.all(e.selections.map(u)).then(function(){return tF(s)})]})})},e.prototype.resolveField=function(e,t,n,r){return(0,en.mG)(this,void 0,void 0,function(){var i,a,o,s,u,c,l,f,d,h=this;return(0,en.Jh)(this,function(p){return n?(i=r.variables,a=e.name.value,o=eX(e),s=a!==o,c=Promise.resolve(u=n[o]||n[a]),(!r.onlyRunForcedResolvers||this.shouldForceResolvers(e))&&(l=n.__typename||r.defaultOperationType,(f=this.resolvers&&this.resolvers[l])&&(d=f[s?a:o])&&(c=Promise.resolve(rX.withValue(this.cache,d,[n,eZ(e,i),r.context,{field:e,fragmentMap:r.fragmentMap},])))),[2,c.then(function(n){if(void 0===n&&(n=u),e.directives&&e.directives.forEach(function(e){"export"===e.name.value&&e.arguments&&e.arguments.forEach(function(e){"as"===e.name.value&&"StringValue"===e.value.kind&&(r.exportedVariables[e.value.value]=n)})}),!e.selectionSet||null==n)return n;var i,a,o=null!==(a=null===(i=e.directives)||void 0===i?void 0:i.some(function(e){return"client"===e.name.value}))&&void 0!==a&&a;return Array.isArray(n)?h.resolveSubSelectedArray(e,t||o,n,r):e.selectionSet?h.resolveSelectionSet(e.selectionSet,t||o,n,r):void 0})]):[2,null]})})},e.prototype.resolveSubSelectedArray=function(e,t,n,r){var i=this;return Promise.all(n.map(function(n){return null===n?null:Array.isArray(n)?i.resolveSubSelectedArray(e,t,n,r):e.selectionSet?i.resolveSelectionSet(e.selectionSet,t,n,r):void 0}))},e.prototype.collectSelectionsToResolve=function(e,t){var n=function(e){return!Array.isArray(e)},r=this.selectionsToResolveCache;function i(e){if(!r.has(e)){var a=new Set;r.set(e,a),tl(e,{Directive:function(e,t,r,i,o){"client"===e.name.value&&o.forEach(function(e){n(e)&&n9(e)&&a.add(e)})},FragmentSpread:function(e,r,o,s,u){var c=t[e.name.value];__DEV__?(0,Q.kG)(c,"No fragment named ".concat(e.name.value)):(0,Q.kG)(c,12);var l=i(c);l.size>0&&(u.forEach(function(e){n(e)&&n9(e)&&a.add(e)}),a.add(e),l.forEach(function(e){a.add(e)}))}})}return r.get(e)}return i(e)},e}(),r6=new(t_.mr?WeakMap:Map);function r5(e,t){var n=e[t];"function"==typeof n&&(e[t]=function(){return r6.set(e,(r6.get(e)+1)%1e15),n.apply(this,arguments)})}function r8(e){e.notifyTimeout&&(clearTimeout(e.notifyTimeout),e.notifyTimeout=void 0)}var r9=function(){function e(e,t){void 0===t&&(t=e.generateQueryId()),this.queryId=t,this.listeners=new Set,this.document=null,this.lastRequestId=1,this.subscriptions=new Set,this.stopped=!1,this.dirty=!1,this.observableQuery=null;var n=this.cache=e.cache;r6.has(n)||(r6.set(n,0),r5(n,"evict"),r5(n,"modify"),r5(n,"reset"))}return e.prototype.init=function(e){var t=e.networkStatus||nZ.I.loading;return this.variables&&this.networkStatus!==nZ.I.loading&&!(0,nm.D)(this.variables,e.variables)&&(t=nZ.I.setVariables),(0,nm.D)(e.variables,this.variables)||(this.lastDiff=void 0),Object.assign(this,{document:e.document,variables:e.variables,networkError:null,graphQLErrors:this.graphQLErrors||[],networkStatus:t}),e.observableQuery&&this.setObservableQuery(e.observableQuery),e.lastRequestId&&(this.lastRequestId=e.lastRequestId),this},e.prototype.reset=function(){r8(this),this.dirty=!1},e.prototype.getDiff=function(e){void 0===e&&(e=this.variables);var t=this.getDiffOptions(e);if(this.lastDiff&&(0,nm.D)(t,this.lastDiff.options))return this.lastDiff.diff;this.updateWatch(this.variables=e);var n=this.observableQuery;if(n&&"no-cache"===n.options.fetchPolicy)return{complete:!1};var r=this.cache.diff(t);return this.updateLastDiff(r,t),r},e.prototype.updateLastDiff=function(e,t){this.lastDiff=e?{diff:e,options:t||this.getDiffOptions()}:void 0},e.prototype.getDiffOptions=function(e){var t;return void 0===e&&(e=this.variables),{query:this.document,variables:e,returnPartialData:!0,optimistic:!0,canonizeResults:null===(t=this.observableQuery)||void 0===t?void 0:t.options.canonizeResults}},e.prototype.setDiff=function(e){var t=this,n=this.lastDiff&&this.lastDiff.diff;this.updateLastDiff(e),this.dirty||(0,nm.D)(n&&n.result,e&&e.result)||(this.dirty=!0,this.notifyTimeout||(this.notifyTimeout=setTimeout(function(){return t.notify()},0)))},e.prototype.setObservableQuery=function(e){var t=this;e!==this.observableQuery&&(this.oqListener&&this.listeners.delete(this.oqListener),this.observableQuery=e,e?(e.queryInfo=this,this.listeners.add(this.oqListener=function(){t.getDiff().fromOptimisticTransaction?e.observe():n4(e)})):delete this.oqListener)},e.prototype.notify=function(){var e=this;r8(this),this.shouldNotify()&&this.listeners.forEach(function(t){return t(e)}),this.dirty=!1},e.prototype.shouldNotify=function(){if(!this.dirty||!this.listeners.size)return!1;if((0,nZ.O)(this.networkStatus)&&this.observableQuery){var e=this.observableQuery.options.fetchPolicy;if("cache-only"!==e&&"cache-and-network"!==e)return!1}return!0},e.prototype.stop=function(){if(!this.stopped){this.stopped=!0,this.reset(),this.cancel(),this.cancel=e.prototype.cancel,this.subscriptions.forEach(function(e){return e.unsubscribe()});var t=this.observableQuery;t&&t.stopPolling()}},e.prototype.cancel=function(){},e.prototype.updateWatch=function(e){var t=this;void 0===e&&(e=this.variables);var n=this.observableQuery;if(!n||"no-cache"!==n.options.fetchPolicy){var r=(0,en.pi)((0,en.pi)({},this.getDiffOptions(e)),{watcher:this,callback:function(e){return t.setDiff(e)}});this.lastWatch&&(0,nm.D)(r,this.lastWatch)||(this.cancel(),this.cancel=this.cache.watch(this.lastWatch=r))}},e.prototype.resetLastWrite=function(){this.lastWrite=void 0},e.prototype.shouldWrite=function(e,t){var n=this.lastWrite;return!(n&&n.dmCount===r6.get(this.cache)&&(0,nm.D)(t,n.variables)&&(0,nm.D)(e.data,n.result.data))},e.prototype.markResult=function(e,t,n,r){var i=this,a=new tB,o=(0,tP.O)(e.errors)?e.errors.slice(0):[];if(this.reset(),"incremental"in e&&(0,tP.O)(e.incremental)){var s=tG(this.getDiff().result,e);e.data=s}else if("hasNext"in e&&e.hasNext){var u=this.getDiff();e.data=a.merge(u.result,e.data)}this.graphQLErrors=o,"no-cache"===n.fetchPolicy?this.updateLastDiff({result:e.data,complete:!0},this.getDiffOptions(n.variables)):0!==r&&(r7(e,n.errorPolicy)?this.cache.performTransaction(function(a){if(i.shouldWrite(e,n.variables))a.writeQuery({query:t,data:e.data,variables:n.variables,overwrite:1===r}),i.lastWrite={result:e,variables:n.variables,dmCount:r6.get(i.cache)};else if(i.lastDiff&&i.lastDiff.diff.complete){e.data=i.lastDiff.diff.result;return}var o=i.getDiffOptions(n.variables),s=a.diff(o);i.stopped||i.updateWatch(n.variables),i.updateLastDiff(s,o),s.complete&&(e.data=s.result)}):this.lastWrite=void 0)},e.prototype.markReady=function(){return this.networkError=null,this.networkStatus=nZ.I.ready},e.prototype.markError=function(e){return this.networkStatus=nZ.I.error,this.lastWrite=void 0,this.reset(),e.graphQLErrors&&(this.graphQLErrors=e.graphQLErrors),e.networkError&&(this.networkError=e.networkError),e},e}();function r7(e,t){void 0===t&&(t="none");var n="ignore"===t||"all"===t,r=!nO(e);return!r&&n&&e.data&&(r=!0),r}var ie=Object.prototype.hasOwnProperty,it=function(){function e(e){var t=e.cache,n=e.link,r=e.defaultOptions,i=e.queryDeduplication,a=void 0!==i&&i,o=e.onBroadcast,s=e.ssrMode,u=void 0!==s&&s,c=e.clientAwareness,l=void 0===c?{}:c,f=e.localState,d=e.assumeImmutableResults;this.clientAwareness={},this.queries=new Map,this.fetchCancelFns=new Map,this.transformCache=new(t_.mr?WeakMap:Map),this.queryIdCounter=1,this.requestIdCounter=1,this.mutationIdCounter=1,this.inFlightLinkObservables=new Map,this.cache=t,this.link=n,this.defaultOptions=r||Object.create(null),this.queryDeduplication=a,this.clientAwareness=l,this.localState=f||new r4({cache:t}),this.ssrMode=u,this.assumeImmutableResults=!!d,(this.onBroadcast=o)&&(this.mutationStore=Object.create(null))}return e.prototype.stop=function(){var e=this;this.queries.forEach(function(t,n){e.stopQueryNoBroadcast(n)}),this.cancelPendingFetches(__DEV__?new Q.ej("QueryManager stopped while query was in flight"):new Q.ej(14))},e.prototype.cancelPendingFetches=function(e){this.fetchCancelFns.forEach(function(t){return t(e)}),this.fetchCancelFns.clear()},e.prototype.mutate=function(e){var t,n,r=e.mutation,i=e.variables,a=e.optimisticResponse,o=e.updateQueries,s=e.refetchQueries,u=void 0===s?[]:s,c=e.awaitRefetchQueries,l=void 0!==c&&c,f=e.update,d=e.onQueryUpdated,h=e.fetchPolicy,p=void 0===h?(null===(t=this.defaultOptions.mutate)||void 0===t?void 0:t.fetchPolicy)||"network-only":h,b=e.errorPolicy,m=void 0===b?(null===(n=this.defaultOptions.mutate)||void 0===n?void 0:n.errorPolicy)||"none":b,g=e.keepRootFields,v=e.context;return(0,en.mG)(this,void 0,void 0,function(){var e,t,n,s,c,h;return(0,en.Jh)(this,function(b){switch(b.label){case 0:if(__DEV__?(0,Q.kG)(r,"mutation option is required. You must specify your GraphQL document in the mutation option."):(0,Q.kG)(r,15),__DEV__?(0,Q.kG)("network-only"===p||"no-cache"===p,"Mutations support only 'network-only' or 'no-cache' fetchPolicy strings. The default `network-only` behavior automatically writes mutation results to the cache. Passing `no-cache` skips the cache write."):(0,Q.kG)("network-only"===p||"no-cache"===p,16),e=this.generateMutationId(),n=(t=this.transform(r)).document,s=t.hasClientExports,r=this.cache.transformForLink(n),i=this.getVariables(r,i),!s)return[3,2];return[4,this.localState.addExportedVariables(r,i,v)];case 1:i=b.sent(),b.label=2;case 2:return c=this.mutationStore&&(this.mutationStore[e]={mutation:r,variables:i,loading:!0,error:null}),a&&this.markMutationOptimistic(a,{mutationId:e,document:r,variables:i,fetchPolicy:p,errorPolicy:m,context:v,updateQueries:o,update:f,keepRootFields:g}),this.broadcastQueries(),h=this,[2,new Promise(function(t,n){return nM(h.getObservableFromLink(r,(0,en.pi)((0,en.pi)({},v),{optimisticResponse:a}),i,!1),function(t){if(nO(t)&&"none"===m)throw new tN.cA({graphQLErrors:nA(t)});c&&(c.loading=!1,c.error=null);var n=(0,en.pi)({},t);return"function"==typeof u&&(u=u(n)),"ignore"===m&&nO(n)&&delete n.errors,h.markMutationResult({mutationId:e,result:n,document:r,variables:i,fetchPolicy:p,errorPolicy:m,context:v,update:f,updateQueries:o,awaitRefetchQueries:l,refetchQueries:u,removeOptimistic:a?e:void 0,onQueryUpdated:d,keepRootFields:g})}).subscribe({next:function(e){h.broadcastQueries(),"hasNext"in e&&!1!==e.hasNext||t(e)},error:function(t){c&&(c.loading=!1,c.error=t),a&&h.cache.removeOptimistic(e),h.broadcastQueries(),n(t instanceof tN.cA?t:new tN.cA({networkError:t}))}})})]}})})},e.prototype.markMutationResult=function(e,t){var n=this;void 0===t&&(t=this.cache);var r=e.result,i=[],a="no-cache"===e.fetchPolicy;if(!a&&r7(r,e.errorPolicy)){if(tU(r)||i.push({result:r.data,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}),tU(r)&&(0,tP.O)(r.incremental)){var o=t.diff({id:"ROOT_MUTATION",query:this.transform(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0}),s=void 0;o.result&&(s=tG(o.result,r)),void 0!==s&&(r.data=s,i.push({result:s,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}))}var u=e.updateQueries;u&&this.queries.forEach(function(e,a){var o=e.observableQuery,s=o&&o.queryName;if(s&&ie.call(u,s)){var c,l=u[s],f=n.queries.get(a),d=f.document,h=f.variables,p=t.diff({query:d,variables:h,returnPartialData:!0,optimistic:!1}),b=p.result;if(p.complete&&b){var m=l(b,{mutationResult:r,queryName:d&&e3(d)||void 0,queryVariables:h});m&&i.push({result:m,dataId:"ROOT_QUERY",query:d,variables:h})}}})}if(i.length>0||e.refetchQueries||e.update||e.onQueryUpdated||e.removeOptimistic){var c=[];if(this.refetchQueries({updateCache:function(t){a||i.forEach(function(e){return t.write(e)});var o=e.update,s=!t$(r)||tU(r)&&!r.hasNext;if(o){if(!a){var u=t.diff({id:"ROOT_MUTATION",query:n.transform(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0});u.complete&&("incremental"in(r=(0,en.pi)((0,en.pi)({},r),{data:u.result}))&&delete r.incremental,"hasNext"in r&&delete r.hasNext)}s&&o(t,r,{context:e.context,variables:e.variables})}a||e.keepRootFields||!s||t.modify({id:"ROOT_MUTATION",fields:function(e,t){var n=t.fieldName,r=t.DELETE;return"__typename"===n?e:r}})},include:e.refetchQueries,optimistic:!1,removeOptimistic:e.removeOptimistic,onQueryUpdated:e.onQueryUpdated||null}).forEach(function(e){return c.push(e)}),e.awaitRefetchQueries||e.onQueryUpdated)return Promise.all(c).then(function(){return r})}return Promise.resolve(r)},e.prototype.markMutationOptimistic=function(e,t){var n=this,r="function"==typeof e?e(t.variables):e;return this.cache.recordOptimisticTransaction(function(e){try{n.markMutationResult((0,en.pi)((0,en.pi)({},t),{result:{data:r}}),e)}catch(i){__DEV__&&Q.kG.error(i)}},t.mutationId)},e.prototype.fetchQuery=function(e,t,n){return this.fetchQueryObservable(e,t,n).promise},e.prototype.getQueryStore=function(){var e=Object.create(null);return this.queries.forEach(function(t,n){e[n]={variables:t.variables,networkStatus:t.networkStatus,networkError:t.networkError,graphQLErrors:t.graphQLErrors}}),e},e.prototype.resetErrors=function(e){var t=this.queries.get(e);t&&(t.networkError=void 0,t.graphQLErrors=[])},e.prototype.transform=function(e){var t=this.transformCache;if(!t.has(e)){var n=this.cache.transformDocument(e),r=nY(n),i=this.localState.clientQuery(n),a=r&&this.localState.serverQuery(r),o={document:n,hasClientExports:tm(n),hasForcedResolvers:this.localState.shouldForceResolvers(n),clientQuery:i,serverQuery:a,defaultVars:e9(e2(n)),asQuery:(0,en.pi)((0,en.pi)({},n),{definitions:n.definitions.map(function(e){return"OperationDefinition"===e.kind&&"query"!==e.operation?(0,en.pi)((0,en.pi)({},e),{operation:"query"}):e})})},s=function(e){e&&!t.has(e)&&t.set(e,o)};s(e),s(n),s(i),s(a)}return t.get(e)},e.prototype.getVariables=function(e,t){return(0,en.pi)((0,en.pi)({},this.transform(e).defaultVars),t)},e.prototype.watchQuery=function(e){void 0===(e=(0,en.pi)((0,en.pi)({},e),{variables:this.getVariables(e.query,e.variables)})).notifyOnNetworkStatusChange&&(e.notifyOnNetworkStatusChange=!1);var t=new r9(this),n=new n3({queryManager:this,queryInfo:t,options:e});return this.queries.set(n.queryId,t),t.init({document:n.query,observableQuery:n,variables:n.variables}),n},e.prototype.query=function(e,t){var n=this;return void 0===t&&(t=this.generateQueryId()),__DEV__?(0,Q.kG)(e.query,"query option is required. You must specify your GraphQL document in the query option."):(0,Q.kG)(e.query,17),__DEV__?(0,Q.kG)("Document"===e.query.kind,'You must wrap the query string in a "gql" tag.'):(0,Q.kG)("Document"===e.query.kind,18),__DEV__?(0,Q.kG)(!e.returnPartialData,"returnPartialData option only supported on watchQuery."):(0,Q.kG)(!e.returnPartialData,19),__DEV__?(0,Q.kG)(!e.pollInterval,"pollInterval option only supported on watchQuery."):(0,Q.kG)(!e.pollInterval,20),this.fetchQuery(t,e).finally(function(){return n.stopQuery(t)})},e.prototype.generateQueryId=function(){return String(this.queryIdCounter++)},e.prototype.generateRequestId=function(){return this.requestIdCounter++},e.prototype.generateMutationId=function(){return String(this.mutationIdCounter++)},e.prototype.stopQueryInStore=function(e){this.stopQueryInStoreNoBroadcast(e),this.broadcastQueries()},e.prototype.stopQueryInStoreNoBroadcast=function(e){var t=this.queries.get(e);t&&t.stop()},e.prototype.clearStore=function(e){return void 0===e&&(e={discardWatches:!0}),this.cancelPendingFetches(__DEV__?new Q.ej("Store reset while query was in flight (not completed in link chain)"):new Q.ej(21)),this.queries.forEach(function(e){e.observableQuery?e.networkStatus=nZ.I.loading:e.stop()}),this.mutationStore&&(this.mutationStore=Object.create(null)),this.cache.reset(e)},e.prototype.getObservableQueries=function(e){var t=this;void 0===e&&(e="active");var n=new Map,r=new Map,i=new Set;return Array.isArray(e)&&e.forEach(function(e){"string"==typeof e?r.set(e,!1):eN(e)?r.set(t.transform(e).document,!1):(0,eO.s)(e)&&e.query&&i.add(e)}),this.queries.forEach(function(t,i){var a=t.observableQuery,o=t.document;if(a){if("all"===e){n.set(i,a);return}var s=a.queryName;if("standby"===a.options.fetchPolicy||"active"===e&&!a.hasObservers())return;("active"===e||s&&r.has(s)||o&&r.has(o))&&(n.set(i,a),s&&r.set(s,!0),o&&r.set(o,!0))}}),i.size&&i.forEach(function(e){var r=nG("legacyOneTimeQuery"),i=t.getQuery(r).init({document:e.query,variables:e.variables}),a=new n3({queryManager:t,queryInfo:i,options:(0,en.pi)((0,en.pi)({},e),{fetchPolicy:"network-only"})});(0,Q.kG)(a.queryId===r),i.setObservableQuery(a),n.set(r,a)}),__DEV__&&r.size&&r.forEach(function(e,t){!e&&__DEV__&&Q.kG.warn("Unknown query ".concat("string"==typeof t?"named ":"").concat(JSON.stringify(t,null,2)," requested in refetchQueries options.include array"))}),n},e.prototype.reFetchObservableQueries=function(e){var t=this;void 0===e&&(e=!1);var n=[];return this.getObservableQueries(e?"all":"active").forEach(function(r,i){var a=r.options.fetchPolicy;r.resetLastResults(),(e||"standby"!==a&&"cache-only"!==a)&&n.push(r.refetch()),t.getQuery(i).setDiff(null)}),this.broadcastQueries(),Promise.all(n)},e.prototype.setObservableQuery=function(e){this.getQuery(e.queryId).setObservableQuery(e)},e.prototype.startGraphQLSubscription=function(e){var t=this,n=e.query,r=e.fetchPolicy,i=e.errorPolicy,a=e.variables,o=e.context,s=void 0===o?{}:o;n=this.transform(n).document,a=this.getVariables(n,a);var u=function(e){return t.getObservableFromLink(n,s,e).map(function(a){"no-cache"!==r&&(r7(a,i)&&t.cache.write({query:n,result:a.data,dataId:"ROOT_SUBSCRIPTION",variables:e}),t.broadcastQueries());var o=nO(a),s=(0,tN.ls)(a);if(o||s){var u={};throw o&&(u.graphQLErrors=a.errors),s&&(u.protocolErrors=a.extensions[tN.YG]),new tN.cA(u)}return a})};if(this.transform(n).hasClientExports){var c=this.localState.addExportedVariables(n,a,s).then(u);return new eT(function(e){var t=null;return c.then(function(n){return t=n.subscribe(e)},e.error),function(){return t&&t.unsubscribe()}})}return u(a)},e.prototype.stopQuery=function(e){this.stopQueryNoBroadcast(e),this.broadcastQueries()},e.prototype.stopQueryNoBroadcast=function(e){this.stopQueryInStoreNoBroadcast(e),this.removeQuery(e)},e.prototype.removeQuery=function(e){this.fetchCancelFns.delete(e),this.queries.has(e)&&(this.getQuery(e).stop(),this.queries.delete(e))},e.prototype.broadcastQueries=function(){this.onBroadcast&&this.onBroadcast(),this.queries.forEach(function(e){return e.notify()})},e.prototype.getLocalState=function(){return this.localState},e.prototype.getObservableFromLink=function(e,t,n,r){var i,a,o=this;void 0===r&&(r=null!==(i=null==t?void 0:t.queryDeduplication)&&void 0!==i?i:this.queryDeduplication);var s=this.transform(e).serverQuery;if(s){var u=this,c=u.inFlightLinkObservables,l=u.link,f={query:s,variables:n,operationName:e3(s)||void 0,context:this.prepareContext((0,en.pi)((0,en.pi)({},t),{forceFetch:!r}))};if(t=f.context,r){var d=c.get(s)||new Map;c.set(s,d);var h=nx(n);if(!(a=d.get(h))){var p=new nq([np(l,f)]);d.set(h,a=p),p.beforeNext(function(){d.delete(h)&&d.size<1&&c.delete(s)})}}else a=new nq([np(l,f)])}else a=new nq([eT.of({data:{}})]),t=this.prepareContext(t);var b=this.transform(e).clientQuery;return b&&(a=nM(a,function(e){return o.localState.runResolvers({document:b,remoteResult:e,context:t,variables:n})})),a},e.prototype.getResultsFromLink=function(e,t,n){var r=e.lastRequestId=this.generateRequestId(),i=this.cache.transformForLink(this.transform(e.document).document);return nM(this.getObservableFromLink(i,n.context,n.variables),function(a){var o=nA(a),s=o.length>0;if(r>=e.lastRequestId){if(s&&"none"===n.errorPolicy)throw e.markError(new tN.cA({graphQLErrors:o}));e.markResult(a,i,n,t),e.markReady()}var u={data:a.data,loading:!1,networkStatus:nZ.I.ready};return s&&"ignore"!==n.errorPolicy&&(u.errors=o,u.networkStatus=nZ.I.error),u},function(t){var n=(0,tN.MS)(t)?t:new tN.cA({networkError:t});throw r>=e.lastRequestId&&e.markError(n),n})},e.prototype.fetchQueryObservable=function(e,t,n){return this.fetchConcastWithInfo(e,t,n).concast},e.prototype.fetchConcastWithInfo=function(e,t,n){var r,i,a=this;void 0===n&&(n=nZ.I.loading);var o=this.transform(t.query).document,s=this.getVariables(o,t.variables),u=this.getQuery(e),c=this.defaultOptions.watchQuery,l=t.fetchPolicy,f=void 0===l?c&&c.fetchPolicy||"cache-first":l,d=t.errorPolicy,h=void 0===d?c&&c.errorPolicy||"none":d,p=t.returnPartialData,b=void 0!==p&&p,m=t.notifyOnNetworkStatusChange,g=void 0!==m&&m,v=t.context,y=void 0===v?{}:v,w=Object.assign({},t,{query:o,variables:s,fetchPolicy:f,errorPolicy:h,returnPartialData:b,notifyOnNetworkStatusChange:g,context:y}),_=function(e){w.variables=e;var r=a.fetchQueryByPolicy(u,w,n);return"standby"!==w.fetchPolicy&&r.sources.length>0&&u.observableQuery&&u.observableQuery.applyNextFetchPolicy("after-fetch",t),r},E=function(){return a.fetchCancelFns.delete(e)};if(this.fetchCancelFns.set(e,function(e){E(),setTimeout(function(){return r.cancel(e)})}),this.transform(w.query).hasClientExports)r=new nq(this.localState.addExportedVariables(w.query,w.variables,w.context).then(_).then(function(e){return e.sources})),i=!0;else{var S=_(w.variables);i=S.fromLink,r=new nq(S.sources)}return r.promise.then(E,E),{concast:r,fromLink:i}},e.prototype.refetchQueries=function(e){var t=this,n=e.updateCache,r=e.include,i=e.optimistic,a=void 0!==i&&i,o=e.removeOptimistic,s=void 0===o?a?nG("refetchQueries"):void 0:o,u=e.onQueryUpdated,c=new Map;r&&this.getObservableQueries(r).forEach(function(e,n){c.set(n,{oq:e,lastDiff:t.getQuery(n).getDiff()})});var l=new Map;return n&&this.cache.batch({update:n,optimistic:a&&s||!1,removeOptimistic:s,onWatchUpdated:function(e,t,n){var r=e.watcher instanceof r9&&e.watcher.observableQuery;if(r){if(u){c.delete(r.queryId);var i=u(r,t,n);return!0===i&&(i=r.refetch()),!1!==i&&l.set(r,i),i}null!==u&&c.set(r.queryId,{oq:r,lastDiff:n,diff:t})}}}),c.size&&c.forEach(function(e,n){var r,i=e.oq,a=e.lastDiff,o=e.diff;if(u){if(!o){var s=i.queryInfo;s.reset(),o=s.getDiff()}r=u(i,o,a)}u&&!0!==r||(r=i.refetch()),!1!==r&&l.set(i,r),n.indexOf("legacyOneTimeQuery")>=0&&t.stopQueryNoBroadcast(n)}),s&&this.cache.removeOptimistic(s),l},e.prototype.fetchQueryByPolicy=function(e,t,n){var r=this,i=t.query,a=t.variables,o=t.fetchPolicy,s=t.refetchWritePolicy,u=t.errorPolicy,c=t.returnPartialData,l=t.context,f=t.notifyOnNetworkStatusChange,d=e.networkStatus;e.init({document:this.transform(i).document,variables:a,networkStatus:n});var h=function(){return e.getDiff(a)},p=function(t,n){void 0===n&&(n=e.networkStatus||nZ.I.loading);var o=t.result;!__DEV__||c||(0,nm.D)(o,{})||n5(t.missing);var s=function(e){return eT.of((0,en.pi)({data:e,loading:(0,nZ.O)(n),networkStatus:n},t.complete?null:{partial:!0}))};return o&&r.transform(i).hasForcedResolvers?r.localState.runResolvers({document:i,remoteResult:{data:o},context:l,variables:a,onlyRunForcedResolvers:!0}).then(function(e){return s(e.data||void 0)}):"none"===u&&n===nZ.I.refetch&&Array.isArray(t.missing)?s(void 0):s(o)},b="no-cache"===o?0:n===nZ.I.refetch&&"merge"!==s?1:2,m=function(){return r.getResultsFromLink(e,b,{variables:a,context:l,fetchPolicy:o,errorPolicy:u})},g=f&&"number"==typeof d&&d!==n&&(0,nZ.O)(n);switch(o){default:case"cache-first":var v=h();if(v.complete)return{fromLink:!1,sources:[p(v,e.markReady())]};if(c||g)return{fromLink:!0,sources:[p(v),m()]};return{fromLink:!0,sources:[m()]};case"cache-and-network":var v=h();if(v.complete||c||g)return{fromLink:!0,sources:[p(v),m()]};return{fromLink:!0,sources:[m()]};case"cache-only":return{fromLink:!1,sources:[p(h(),e.markReady())]};case"network-only":if(g)return{fromLink:!0,sources:[p(h()),m()]};return{fromLink:!0,sources:[m()]};case"no-cache":if(g)return{fromLink:!0,sources:[p(e.getDiff()),m(),]};return{fromLink:!0,sources:[m()]};case"standby":return{fromLink:!1,sources:[]}}},e.prototype.getQuery=function(e){return e&&!this.queries.has(e)&&this.queries.set(e,new r9(this,e)),this.queries.get(e)},e.prototype.prepareContext=function(e){void 0===e&&(e={});var t=this.localState.prepareContext(e);return(0,en.pi)((0,en.pi)({},t),{clientAwareness:this.clientAwareness})},e}(),ir=__webpack_require__(14012),ii=!1,ia=function(){function e(e){var t=this;this.resetStoreCallbacks=[],this.clearStoreCallbacks=[];var n=e.uri,r=e.credentials,i=e.headers,a=e.cache,o=e.ssrMode,s=void 0!==o&&o,u=e.ssrForceFetchDelay,c=void 0===u?0:u,l=e.connectToDevTools,f=void 0===l?"object"==typeof window&&!window.__APOLLO_CLIENT__&&__DEV__:l,d=e.queryDeduplication,h=void 0===d||d,p=e.defaultOptions,b=e.assumeImmutableResults,m=void 0!==b&&b,g=e.resolvers,v=e.typeDefs,y=e.fragmentMatcher,w=e.name,_=e.version,E=e.link;if(E||(E=n?new nh({uri:n,credentials:r,headers:i}):ta.empty()),!a)throw __DEV__?new Q.ej("To initialize Apollo Client, you must specify a 'cache' property in the options object. \nFor more information, please visit: https://go.apollo.dev/c/docs"):new Q.ej(9);if(this.link=E,this.cache=a,this.disableNetworkFetches=s||c>0,this.queryDeduplication=h,this.defaultOptions=p||Object.create(null),this.typeDefs=v,c&&setTimeout(function(){return t.disableNetworkFetches=!1},c),this.watchQuery=this.watchQuery.bind(this),this.query=this.query.bind(this),this.mutate=this.mutate.bind(this),this.resetStore=this.resetStore.bind(this),this.reFetchObservableQueries=this.reFetchObservableQueries.bind(this),f&&"object"==typeof window&&(window.__APOLLO_CLIENT__=this),!ii&&f&&__DEV__&&(ii=!0,"undefined"!=typeof window&&window.document&&window.top===window.self&&!window.__APOLLO_DEVTOOLS_GLOBAL_HOOK__)){var S=window.navigator,k=S&&S.userAgent,x=void 0;"string"==typeof k&&(k.indexOf("Chrome/")>-1?x="https://chrome.google.com/webstore/detail/apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm":k.indexOf("Firefox/")>-1&&(x="https://addons.mozilla.org/en-US/firefox/addon/apollo-developer-tools/")),x&&__DEV__&&Q.kG.log("Download the Apollo DevTools for a better development experience: "+x)}this.version=nb,this.localState=new r4({cache:a,client:this,resolvers:g,fragmentMatcher:y}),this.queryManager=new it({cache:this.cache,link:this.link,defaultOptions:this.defaultOptions,queryDeduplication:h,ssrMode:s,clientAwareness:{name:w,version:_},localState:this.localState,assumeImmutableResults:m,onBroadcast:f?function(){t.devToolsHookCb&&t.devToolsHookCb({action:{},state:{queries:t.queryManager.getQueryStore(),mutations:t.queryManager.mutationStore||{}},dataWithOptimisticResults:t.cache.extract(!0)})}:void 0})}return e.prototype.stop=function(){this.queryManager.stop()},e.prototype.watchQuery=function(e){return this.defaultOptions.watchQuery&&(e=(0,ir.J)(this.defaultOptions.watchQuery,e)),this.disableNetworkFetches&&("network-only"===e.fetchPolicy||"cache-and-network"===e.fetchPolicy)&&(e=(0,en.pi)((0,en.pi)({},e),{fetchPolicy:"cache-first"})),this.queryManager.watchQuery(e)},e.prototype.query=function(e){return this.defaultOptions.query&&(e=(0,ir.J)(this.defaultOptions.query,e)),__DEV__?(0,Q.kG)("cache-and-network"!==e.fetchPolicy,"The cache-and-network fetchPolicy does not work with client.query, because client.query can only return a single result. Please use client.watchQuery to receive multiple results from the cache and the network, or consider using a different fetchPolicy, such as cache-first or network-only."):(0,Q.kG)("cache-and-network"!==e.fetchPolicy,10),this.disableNetworkFetches&&"network-only"===e.fetchPolicy&&(e=(0,en.pi)((0,en.pi)({},e),{fetchPolicy:"cache-first"})),this.queryManager.query(e)},e.prototype.mutate=function(e){return this.defaultOptions.mutate&&(e=(0,ir.J)(this.defaultOptions.mutate,e)),this.queryManager.mutate(e)},e.prototype.subscribe=function(e){return this.queryManager.startGraphQLSubscription(e)},e.prototype.readQuery=function(e,t){return void 0===t&&(t=!1),this.cache.readQuery(e,t)},e.prototype.readFragment=function(e,t){return void 0===t&&(t=!1),this.cache.readFragment(e,t)},e.prototype.writeQuery=function(e){var t=this.cache.writeQuery(e);return!1!==e.broadcast&&this.queryManager.broadcastQueries(),t},e.prototype.writeFragment=function(e){var t=this.cache.writeFragment(e);return!1!==e.broadcast&&this.queryManager.broadcastQueries(),t},e.prototype.__actionHookForDevTools=function(e){this.devToolsHookCb=e},e.prototype.__requestRaw=function(e){return np(this.link,e)},e.prototype.resetStore=function(){var e=this;return Promise.resolve().then(function(){return e.queryManager.clearStore({discardWatches:!1})}).then(function(){return Promise.all(e.resetStoreCallbacks.map(function(e){return e()}))}).then(function(){return e.reFetchObservableQueries()})},e.prototype.clearStore=function(){var e=this;return Promise.resolve().then(function(){return e.queryManager.clearStore({discardWatches:!0})}).then(function(){return Promise.all(e.clearStoreCallbacks.map(function(e){return e()}))})},e.prototype.onResetStore=function(e){var t=this;return this.resetStoreCallbacks.push(e),function(){t.resetStoreCallbacks=t.resetStoreCallbacks.filter(function(t){return t!==e})}},e.prototype.onClearStore=function(e){var t=this;return this.clearStoreCallbacks.push(e),function(){t.clearStoreCallbacks=t.clearStoreCallbacks.filter(function(t){return t!==e})}},e.prototype.reFetchObservableQueries=function(e){return this.queryManager.reFetchObservableQueries(e)},e.prototype.refetchQueries=function(e){var t=this.queryManager.refetchQueries(e),n=[],r=[];t.forEach(function(e,t){n.push(t),r.push(e)});var i=Promise.all(r);return i.queries=n,i.results=r,i.catch(function(e){__DEV__&&Q.kG.debug("In client.refetchQueries, Promise.all promise rejected with error ".concat(e))}),i},e.prototype.getObservableQueries=function(e){return void 0===e&&(e="active"),this.queryManager.getObservableQueries(e)},e.prototype.extract=function(e){return this.cache.extract(e)},e.prototype.restore=function(e){return this.cache.restore(e)},e.prototype.addResolvers=function(e){this.localState.addResolvers(e)},e.prototype.setResolvers=function(e){this.localState.setResolvers(e)},e.prototype.getResolvers=function(){return this.localState.getResolvers()},e.prototype.setLocalStateFragmentMatcher=function(e){this.localState.setFragmentMatcher(e)},e.prototype.setLink=function(e){this.link=this.queryManager.link=e},e}(),io=function(){function e(){this.getFragmentDoc=rZ(eA)}return e.prototype.batch=function(e){var t,n=this,r="string"==typeof e.optimistic?e.optimistic:!1===e.optimistic?null:void 0;return this.performTransaction(function(){return t=e.update(n)},r),t},e.prototype.recordOptimisticTransaction=function(e,t){this.performTransaction(e,t)},e.prototype.transformDocument=function(e){return e},e.prototype.transformForLink=function(e){return e},e.prototype.identify=function(e){},e.prototype.gc=function(){return[]},e.prototype.modify=function(e){return!1},e.prototype.readQuery=function(e,t){return void 0===t&&(t=!!e.optimistic),this.read((0,en.pi)((0,en.pi)({},e),{rootId:e.id||"ROOT_QUERY",optimistic:t}))},e.prototype.readFragment=function(e,t){return void 0===t&&(t=!!e.optimistic),this.read((0,en.pi)((0,en.pi)({},e),{query:this.getFragmentDoc(e.fragment,e.fragmentName),rootId:e.id,optimistic:t}))},e.prototype.writeQuery=function(e){var t=e.id,n=e.data,r=(0,en._T)(e,["id","data"]);return this.write(Object.assign(r,{dataId:t||"ROOT_QUERY",result:n}))},e.prototype.writeFragment=function(e){var t=e.id,n=e.data,r=e.fragment,i=e.fragmentName,a=(0,en._T)(e,["id","data","fragment","fragmentName"]);return this.write(Object.assign(a,{query:this.getFragmentDoc(r,i),dataId:t,result:n}))},e.prototype.updateQuery=function(e,t){return this.batch({update:function(n){var r=n.readQuery(e),i=t(r);return null==i?r:(n.writeQuery((0,en.pi)((0,en.pi)({},e),{data:i})),i)}})},e.prototype.updateFragment=function(e,t){return this.batch({update:function(n){var r=n.readFragment(e),i=t(r);return null==i?r:(n.writeFragment((0,en.pi)((0,en.pi)({},e),{data:i})),i)}})},e}(),is=function(e){function t(n,r,i,a){var o,s=e.call(this,n)||this;if(s.message=n,s.path=r,s.query=i,s.variables=a,Array.isArray(s.path)){s.missing=s.message;for(var u=s.path.length-1;u>=0;--u)s.missing=((o={})[s.path[u]]=s.missing,o)}else s.missing=s.path;return s.__proto__=t.prototype,s}return(0,en.ZT)(t,e),t}(Error),iu=__webpack_require__(10542),ic=Object.prototype.hasOwnProperty;function il(e){return null==e}function id(e,t){var n=e.__typename,r=e.id,i=e._id;if("string"==typeof n&&(t&&(t.keyObject=il(r)?il(i)?void 0:{_id:i}:{id:r}),il(r)&&!il(i)&&(r=i),!il(r)))return"".concat(n,":").concat("number"==typeof r||"string"==typeof r?r:JSON.stringify(r))}var ih={dataIdFromObject:id,addTypename:!0,resultCaching:!0,canonizeResults:!1};function ip(e){return(0,n1.o)(ih,e)}function ib(e){var t=e.canonizeResults;return void 0===t?ih.canonizeResults:t}function im(e,t){return eD(t)?e.get(t.__ref,"__typename"):t&&t.__typename}var ig=/^[_a-z][_0-9a-z]*/i;function iv(e){var t=e.match(ig);return t?t[0]:e}function iy(e,t,n){return!!(0,eO.s)(t)&&((0,tP.k)(t)?t.every(function(t){return iy(e,t,n)}):e.selections.every(function(e){if(eQ(e)&&td(e,n)){var r=eX(e);return ic.call(t,r)&&(!e.selectionSet||iy(e.selectionSet,t[r],n))}return!0}))}function iw(e){return(0,eO.s)(e)&&!eD(e)&&!(0,tP.k)(e)}function i_(){return new tB}function iE(e,t){var n=eL(e4(e));return{fragmentMap:n,lookupFragment:function(e){var r=n[e];return!r&&t&&(r=t.lookup(e)),r||null}}}var iS=Object.create(null),ik=function(){return iS},ix=Object.create(null),iT=function(){function e(e,t){var n=this;this.policies=e,this.group=t,this.data=Object.create(null),this.rootIds=Object.create(null),this.refs=Object.create(null),this.getFieldValue=function(e,t){return(0,iu.J)(eD(e)?n.get(e.__ref,t):e&&e[t])},this.canRead=function(e){return eD(e)?n.has(e.__ref):"object"==typeof e},this.toReference=function(e,t){if("string"==typeof e)return eI(e);if(eD(e))return e;var r=n.policies.identify(e)[0];if(r){var i=eI(r);return t&&n.merge(r,e),i}}}return e.prototype.toObject=function(){return(0,en.pi)({},this.data)},e.prototype.has=function(e){return void 0!==this.lookup(e,!0)},e.prototype.get=function(e,t){if(this.group.depend(e,t),ic.call(this.data,e)){var n=this.data[e];if(n&&ic.call(n,t))return n[t]}return"__typename"===t&&ic.call(this.policies.rootTypenamesById,e)?this.policies.rootTypenamesById[e]:this instanceof iL?this.parent.get(e,t):void 0},e.prototype.lookup=function(e,t){return(t&&this.group.depend(e,"__exists"),ic.call(this.data,e))?this.data[e]:this instanceof iL?this.parent.lookup(e,t):this.policies.rootTypenamesById[e]?Object.create(null):void 0},e.prototype.merge=function(e,t){var n,r=this;eD(e)&&(e=e.__ref),eD(t)&&(t=t.__ref);var i="string"==typeof e?this.lookup(n=e):e,a="string"==typeof t?this.lookup(n=t):t;if(a){__DEV__?(0,Q.kG)("string"==typeof n,"store.merge expects a string ID"):(0,Q.kG)("string"==typeof n,1);var o=new tB(iI).merge(i,a);if(this.data[n]=o,o!==i&&(delete this.refs[n],this.group.caching)){var s=Object.create(null);i||(s.__exists=1),Object.keys(a).forEach(function(e){if(!i||i[e]!==o[e]){s[e]=1;var t=iv(e);t===e||r.policies.hasKeyArgs(o.__typename,t)||(s[t]=1),void 0!==o[e]||r instanceof iL||delete o[e]}}),s.__typename&&!(i&&i.__typename)&&this.policies.rootTypenamesById[n]===o.__typename&&delete s.__typename,Object.keys(s).forEach(function(e){return r.group.dirty(n,e)})}}},e.prototype.modify=function(e,t){var n=this,r=this.lookup(e);if(r){var i=Object.create(null),a=!1,o=!0,s={DELETE:iS,INVALIDATE:ix,isReference:eD,toReference:this.toReference,canRead:this.canRead,readField:function(t,r){return n.policies.readField("string"==typeof t?{fieldName:t,from:r||eI(e)}:t,{store:n})}};if(Object.keys(r).forEach(function(u){var c=iv(u),l=r[u];if(void 0!==l){var f="function"==typeof t?t:t[u]||t[c];if(f){var d=f===ik?iS:f((0,iu.J)(l),(0,en.pi)((0,en.pi)({},s),{fieldName:c,storeFieldName:u,storage:n.getStorage(e,u)}));d===ix?n.group.dirty(e,u):(d===iS&&(d=void 0),d!==l&&(i[u]=d,a=!0,l=d))}void 0!==l&&(o=!1)}}),a)return this.merge(e,i),o&&(this instanceof iL?this.data[e]=void 0:delete this.data[e],this.group.dirty(e,"__exists")),!0}return!1},e.prototype.delete=function(e,t,n){var r,i=this.lookup(e);if(i){var a=this.getFieldValue(i,"__typename"),o=t&&n?this.policies.getStoreFieldName({typename:a,fieldName:t,args:n}):t;return this.modify(e,o?((r={})[o]=ik,r):ik)}return!1},e.prototype.evict=function(e,t){var n=!1;return e.id&&(ic.call(this.data,e.id)&&(n=this.delete(e.id,e.fieldName,e.args)),this instanceof iL&&this!==t&&(n=this.parent.evict(e,t)||n),(e.fieldName||n)&&this.group.dirty(e.id,e.fieldName||"__exists")),n},e.prototype.clear=function(){this.replace(null)},e.prototype.extract=function(){var e=this,t=this.toObject(),n=[];return this.getRootIdSet().forEach(function(t){ic.call(e.policies.rootTypenamesById,t)||n.push(t)}),n.length&&(t.__META={extraRootIds:n.sort()}),t},e.prototype.replace=function(e){var t=this;if(Object.keys(this.data).forEach(function(n){e&&ic.call(e,n)||t.delete(n)}),e){var n=e.__META,r=(0,en._T)(e,["__META"]);Object.keys(r).forEach(function(e){t.merge(e,r[e])}),n&&n.extraRootIds.forEach(this.retain,this)}},e.prototype.retain=function(e){return this.rootIds[e]=(this.rootIds[e]||0)+1},e.prototype.release=function(e){if(this.rootIds[e]>0){var t=--this.rootIds[e];return t||delete this.rootIds[e],t}return 0},e.prototype.getRootIdSet=function(e){return void 0===e&&(e=new Set),Object.keys(this.rootIds).forEach(e.add,e),this instanceof iL?this.parent.getRootIdSet(e):Object.keys(this.policies.rootTypenamesById).forEach(e.add,e),e},e.prototype.gc=function(){var e=this,t=this.getRootIdSet(),n=this.toObject();t.forEach(function(r){ic.call(n,r)&&(Object.keys(e.findChildRefIds(r)).forEach(t.add,t),delete n[r])});var r=Object.keys(n);if(r.length){for(var i=this;i instanceof iL;)i=i.parent;r.forEach(function(e){return i.delete(e)})}return r},e.prototype.findChildRefIds=function(e){if(!ic.call(this.refs,e)){var t=this.refs[e]=Object.create(null),n=this.data[e];if(!n)return t;var r=new Set([n]);r.forEach(function(e){eD(e)&&(t[e.__ref]=!0),(0,eO.s)(e)&&Object.keys(e).forEach(function(t){var n=e[t];(0,eO.s)(n)&&r.add(n)})})}return this.refs[e]},e.prototype.makeCacheKey=function(){return this.group.keyMaker.lookupArray(arguments)},e}(),iM=function(){function e(e,t){void 0===t&&(t=null),this.caching=e,this.parent=t,this.d=null,this.resetCaching()}return e.prototype.resetCaching=function(){this.d=this.caching?rW():null,this.keyMaker=new n_(t_.mr)},e.prototype.depend=function(e,t){if(this.d){this.d(iO(e,t));var n=iv(t);n!==t&&this.d(iO(e,n)),this.parent&&this.parent.depend(e,t)}},e.prototype.dirty=function(e,t){this.d&&this.d.dirty(iO(e,t),"__exists"===t?"forget":"setDirty")},e}();function iO(e,t){return t+"#"+e}function iA(e,t){iD(e)&&e.group.depend(t,"__exists")}!function(e){var t=function(e){function t(t){var n=t.policies,r=t.resultCaching,i=void 0===r||r,a=t.seed,o=e.call(this,n,new iM(i))||this;return o.stump=new iC(o),o.storageTrie=new n_(t_.mr),a&&o.replace(a),o}return(0,en.ZT)(t,e),t.prototype.addLayer=function(e,t){return this.stump.addLayer(e,t)},t.prototype.removeLayer=function(){return this},t.prototype.getStorage=function(){return this.storageTrie.lookupArray(arguments)},t}(e);e.Root=t}(iT||(iT={}));var iL=function(e){function t(t,n,r,i){var a=e.call(this,n.policies,i)||this;return a.id=t,a.parent=n,a.replay=r,a.group=i,r(a),a}return(0,en.ZT)(t,e),t.prototype.addLayer=function(e,n){return new t(e,this,n,this.group)},t.prototype.removeLayer=function(e){var t=this,n=this.parent.removeLayer(e);return e===this.id?(this.group.caching&&Object.keys(this.data).forEach(function(e){var r=t.data[e],i=n.lookup(e);i?r?r!==i&&Object.keys(r).forEach(function(n){(0,nm.D)(r[n],i[n])||t.group.dirty(e,n)}):(t.group.dirty(e,"__exists"),Object.keys(i).forEach(function(n){t.group.dirty(e,n)})):t.delete(e)}),n):n===this.parent?this:n.addLayer(this.id,this.replay)},t.prototype.toObject=function(){return(0,en.pi)((0,en.pi)({},this.parent.toObject()),this.data)},t.prototype.findChildRefIds=function(t){var n=this.parent.findChildRefIds(t);return ic.call(this.data,t)?(0,en.pi)((0,en.pi)({},n),e.prototype.findChildRefIds.call(this,t)):n},t.prototype.getStorage=function(){for(var e=this.parent;e.parent;)e=e.parent;return e.getStorage.apply(e,arguments)},t}(iT),iC=function(e){function t(t){return e.call(this,"EntityStore.Stump",t,function(){},new iM(t.group.caching,t.group))||this}return(0,en.ZT)(t,e),t.prototype.removeLayer=function(){return this},t.prototype.merge=function(){return this.parent.merge.apply(this.parent,arguments)},t}(iL);function iI(e,t,n){var r=e[n],i=t[n];return(0,nm.D)(r,i)?r:i}function iD(e){return!!(e instanceof iT&&e.group.caching)}function iN(e){return[e.selectionSet,e.objectOrReference,e.context,e.context.canonizeResults,]}var iP=function(){function e(e){var t=this;this.knownResults=new(t_.mr?WeakMap:Map),this.config=(0,n1.o)(e,{addTypename:!1!==e.addTypename,canonizeResults:ib(e)}),this.canon=e.canon||new nk,this.executeSelectionSet=rZ(function(e){var n,r=e.context.canonizeResults,i=iN(e);i[3]=!r;var a=(n=t.executeSelectionSet).peek.apply(n,i);return a?r?(0,en.pi)((0,en.pi)({},a),{result:t.canon.admit(a.result)}):a:(iA(e.context.store,e.enclosingRef.__ref),t.execSelectionSetImpl(e))},{max:this.config.resultCacheMaxSize,keyArgs:iN,makeCacheKey:function(e,t,n,r){if(iD(n.store))return n.store.makeCacheKey(e,eD(t)?t.__ref:t,n.varString,r)}}),this.executeSubSelectedArray=rZ(function(e){return iA(e.context.store,e.enclosingRef.__ref),t.execSubSelectedArrayImpl(e)},{max:this.config.resultCacheMaxSize,makeCacheKey:function(e){var t=e.field,n=e.array,r=e.context;if(iD(r.store))return r.store.makeCacheKey(t,n,r.varString)}})}return e.prototype.resetCanon=function(){this.canon=new nk},e.prototype.diffQueryAgainstStore=function(e){var t,n=e.store,r=e.query,i=e.rootId,a=void 0===i?"ROOT_QUERY":i,o=e.variables,s=e.returnPartialData,u=void 0===s||s,c=e.canonizeResults,l=void 0===c?this.config.canonizeResults:c,f=this.config.cache.policies;o=(0,en.pi)((0,en.pi)({},e9(e6(r))),o);var d=eI(a),h=this.executeSelectionSet({selectionSet:e8(r).selectionSet,objectOrReference:d,enclosingRef:d,context:(0,en.pi)({store:n,query:r,policies:f,variables:o,varString:nx(o),canonizeResults:l},iE(r,this.config.fragments))});if(h.missing&&(t=[new is(iR(h.missing),h.missing,r,o)],!u))throw t[0];return{result:h.result,complete:!t,missing:t}},e.prototype.isFresh=function(e,t,n,r){if(iD(r.store)&&this.knownResults.get(e)===n){var i=this.executeSelectionSet.peek(n,t,r,this.canon.isKnown(e));if(i&&e===i.result)return!0}return!1},e.prototype.execSelectionSetImpl=function(e){var t,n=this,r=e.selectionSet,i=e.objectOrReference,a=e.enclosingRef,o=e.context;if(eD(i)&&!o.policies.rootTypenamesById[i.__ref]&&!o.store.has(i.__ref))return{result:this.canon.empty,missing:"Dangling reference to missing ".concat(i.__ref," object")};var s=o.variables,u=o.policies,c=o.store.getFieldValue(i,"__typename"),l=[],f=new tB;function d(e,n){var r;return e.missing&&(t=f.merge(t,((r={})[n]=e.missing,r))),e.result}this.config.addTypename&&"string"==typeof c&&!u.rootIdsByTypename[c]&&l.push({__typename:c});var h=new Set(r.selections);h.forEach(function(e){var r,p;if(td(e,s)){if(eQ(e)){var b=u.readField({fieldName:e.name.value,field:e,variables:o.variables,from:i},o),m=eX(e);void 0===b?nj.added(e)||(t=f.merge(t,((r={})[m]="Can't find field '".concat(e.name.value,"' on ").concat(eD(i)?i.__ref+" object":"object "+JSON.stringify(i,null,2)),r))):(0,tP.k)(b)?b=d(n.executeSubSelectedArray({field:e,array:b,enclosingRef:a,context:o}),m):e.selectionSet?null!=b&&(b=d(n.executeSelectionSet({selectionSet:e.selectionSet,objectOrReference:b,enclosingRef:eD(b)?b:a,context:o}),m)):o.canonizeResults&&(b=n.canon.pass(b)),void 0!==b&&l.push(((p={})[m]=b,p))}else{var g=eC(e,o.lookupFragment);if(!g&&e.kind===nL.h.FRAGMENT_SPREAD)throw __DEV__?new Q.ej("No fragment named ".concat(e.name.value)):new Q.ej(5);g&&u.fragmentMatches(g,c)&&g.selectionSet.selections.forEach(h.add,h)}}});var p={result:tF(l),missing:t},b=o.canonizeResults?this.canon.admit(p):(0,iu.J)(p);return b.result&&this.knownResults.set(b.result,r),b},e.prototype.execSubSelectedArrayImpl=function(e){var t,n=this,r=e.field,i=e.array,a=e.enclosingRef,o=e.context,s=new tB;function u(e,n){var r;return e.missing&&(t=s.merge(t,((r={})[n]=e.missing,r))),e.result}return r.selectionSet&&(i=i.filter(o.store.canRead)),i=i.map(function(e,t){return null===e?null:(0,tP.k)(e)?u(n.executeSubSelectedArray({field:r,array:e,enclosingRef:a,context:o}),t):r.selectionSet?u(n.executeSelectionSet({selectionSet:r.selectionSet,objectOrReference:e,enclosingRef:eD(e)?e:a,context:o}),t):(__DEV__&&ij(o.store,r,e),e)}),{result:o.canonizeResults?this.canon.admit(i):i,missing:t}},e}();function iR(e){try{JSON.stringify(e,function(e,t){if("string"==typeof t)throw t;return t})}catch(t){return t}}function ij(e,t,n){if(!t.selectionSet){var r=new Set([n]);r.forEach(function(n){(0,eO.s)(n)&&(__DEV__?(0,Q.kG)(!eD(n),"Missing selection set for object of type ".concat(im(e,n)," returned for query field ").concat(t.name.value)):(0,Q.kG)(!eD(n),6),Object.values(n).forEach(r.add,r))})}}function iF(e){var t=nG("stringifyForDisplay");return JSON.stringify(e,function(e,n){return void 0===n?t:n}).split(JSON.stringify(t)).join("")}var iY=Object.create(null);function iB(e){var t=JSON.stringify(e);return iY[t]||(iY[t]=Object.create(null))}function iU(e){var t=iB(e);return t.keyFieldsFn||(t.keyFieldsFn=function(t,n){var r=function(e,t){return n.readField(t,e)},i=n.keyObject=i$(e,function(e){var i=iW(n.storeObject,e,r);return void 0===i&&t!==n.storeObject&&ic.call(t,e[0])&&(i=iW(t,e,iG)),__DEV__?(0,Q.kG)(void 0!==i,"Missing field '".concat(e.join("."),"' while extracting keyFields from ").concat(JSON.stringify(t))):(0,Q.kG)(void 0!==i,2),i});return"".concat(n.typename,":").concat(JSON.stringify(i))})}function iH(e){var t=iB(e);return t.keyArgsFn||(t.keyArgsFn=function(t,n){var r=n.field,i=n.variables,a=n.fieldName,o=JSON.stringify(i$(e,function(e){var n=e[0],a=n.charAt(0);if("@"===a){if(r&&(0,tP.O)(r.directives)){var o=n.slice(1),s=r.directives.find(function(e){return e.name.value===o}),u=s&&eZ(s,i);return u&&iW(u,e.slice(1))}return}if("$"===a){var c=n.slice(1);if(i&&ic.call(i,c)){var l=e.slice(0);return l[0]=c,iW(i,l)}return}if(t)return iW(t,e)}));return(t||"{}"!==o)&&(a+=":"+o),a})}function i$(e,t){var n=new tB;return iz(e).reduce(function(e,r){var i,a=t(r);if(void 0!==a){for(var o=r.length-1;o>=0;--o)a=((i={})[r[o]]=a,i);e=n.merge(e,a)}return e},Object.create(null))}function iz(e){var t=iB(e);if(!t.paths){var n=t.paths=[],r=[];e.forEach(function(t,i){(0,tP.k)(t)?(iz(t).forEach(function(e){return n.push(r.concat(e))}),r.length=0):(r.push(t),(0,tP.k)(e[i+1])||(n.push(r.slice(0)),r.length=0))})}return t.paths}function iG(e,t){return e[t]}function iW(e,t,n){return n=n||iG,iK(t.reduce(function e(t,r){return(0,tP.k)(t)?t.map(function(t){return e(t,r)}):t&&n(t,r)},e))}function iK(e){return(0,eO.s)(e)?(0,tP.k)(e)?e.map(iK):i$(Object.keys(e).sort(),function(t){return iW(e,t)}):e}function iV(e){return void 0!==e.args?e.args:e.field?eZ(e.field,e.variables):null}eK.setStringify(nx);var iq=function(){},iZ=function(e,t){return t.fieldName},iX=function(e,t,n){return(0,n.mergeObjects)(e,t)},iJ=function(e,t){return t},iQ=function(){function e(e){this.config=e,this.typePolicies=Object.create(null),this.toBeAdded=Object.create(null),this.supertypeMap=new Map,this.fuzzySubtypes=new Map,this.rootIdsByTypename=Object.create(null),this.rootTypenamesById=Object.create(null),this.usingPossibleTypes=!1,this.config=(0,en.pi)({dataIdFromObject:id},e),this.cache=this.config.cache,this.setRootTypename("Query"),this.setRootTypename("Mutation"),this.setRootTypename("Subscription"),e.possibleTypes&&this.addPossibleTypes(e.possibleTypes),e.typePolicies&&this.addTypePolicies(e.typePolicies)}return e.prototype.identify=function(e,t){var n,r,i=this,a=t&&(t.typename||(null===(n=t.storeObject)||void 0===n?void 0:n.__typename))||e.__typename;if(a===this.rootTypenamesById.ROOT_QUERY)return["ROOT_QUERY"];for(var o=t&&t.storeObject||e,s=(0,en.pi)((0,en.pi)({},t),{typename:a,storeObject:o,readField:t&&t.readField||function(){var e=i0(arguments,o);return i.readField(e,{store:i.cache.data,variables:e.variables})}}),u=a&&this.getTypePolicy(a),c=u&&u.keyFn||this.config.dataIdFromObject;c;){var l=c((0,en.pi)((0,en.pi)({},e),o),s);if((0,tP.k)(l))c=iU(l);else{r=l;break}}return r=r?String(r):void 0,s.keyObject?[r,s.keyObject]:[r]},e.prototype.addTypePolicies=function(e){var t=this;Object.keys(e).forEach(function(n){var r=e[n],i=r.queryType,a=r.mutationType,o=r.subscriptionType,s=(0,en._T)(r,["queryType","mutationType","subscriptionType"]);i&&t.setRootTypename("Query",n),a&&t.setRootTypename("Mutation",n),o&&t.setRootTypename("Subscription",n),ic.call(t.toBeAdded,n)?t.toBeAdded[n].push(s):t.toBeAdded[n]=[s]})},e.prototype.updateTypePolicy=function(e,t){var n=this,r=this.getTypePolicy(e),i=t.keyFields,a=t.fields;function o(e,t){e.merge="function"==typeof t?t:!0===t?iX:!1===t?iJ:e.merge}o(r,t.merge),r.keyFn=!1===i?iq:(0,tP.k)(i)?iU(i):"function"==typeof i?i:r.keyFn,a&&Object.keys(a).forEach(function(t){var r=n.getFieldPolicy(e,t,!0),i=a[t];if("function"==typeof i)r.read=i;else{var s=i.keyArgs,u=i.read,c=i.merge;r.keyFn=!1===s?iZ:(0,tP.k)(s)?iH(s):"function"==typeof s?s:r.keyFn,"function"==typeof u&&(r.read=u),o(r,c)}r.read&&r.merge&&(r.keyFn=r.keyFn||iZ)})},e.prototype.setRootTypename=function(e,t){void 0===t&&(t=e);var n="ROOT_"+e.toUpperCase(),r=this.rootTypenamesById[n];t!==r&&(__DEV__?(0,Q.kG)(!r||r===e,"Cannot change root ".concat(e," __typename more than once")):(0,Q.kG)(!r||r===e,3),r&&delete this.rootIdsByTypename[r],this.rootIdsByTypename[t]=n,this.rootTypenamesById[n]=t)},e.prototype.addPossibleTypes=function(e){var t=this;this.usingPossibleTypes=!0,Object.keys(e).forEach(function(n){t.getSupertypeSet(n,!0),e[n].forEach(function(e){t.getSupertypeSet(e,!0).add(n);var r=e.match(ig);r&&r[0]===e||t.fuzzySubtypes.set(e,RegExp(e))})})},e.prototype.getTypePolicy=function(e){var t=this;if(!ic.call(this.typePolicies,e)){var n=this.typePolicies[e]=Object.create(null);n.fields=Object.create(null);var r=this.supertypeMap.get(e);r&&r.size&&r.forEach(function(e){var r=t.getTypePolicy(e),i=r.fields;Object.assign(n,(0,en._T)(r,["fields"])),Object.assign(n.fields,i)})}var i=this.toBeAdded[e];return i&&i.length&&i.splice(0).forEach(function(n){t.updateTypePolicy(e,n)}),this.typePolicies[e]},e.prototype.getFieldPolicy=function(e,t,n){if(e){var r=this.getTypePolicy(e).fields;return r[t]||n&&(r[t]=Object.create(null))}},e.prototype.getSupertypeSet=function(e,t){var n=this.supertypeMap.get(e);return!n&&t&&this.supertypeMap.set(e,n=new Set),n},e.prototype.fragmentMatches=function(e,t,n,r){var i=this;if(!e.typeCondition)return!0;if(!t)return!1;var a=e.typeCondition.name.value;if(t===a)return!0;if(this.usingPossibleTypes&&this.supertypeMap.has(a))for(var o=this.getSupertypeSet(t,!0),s=[o],u=function(e){var t=i.getSupertypeSet(e,!1);t&&t.size&&0>s.indexOf(t)&&s.push(t)},c=!!(n&&this.fuzzySubtypes.size),l=!1,f=0;f1?a:t}:(r=(0,en.pi)({},i),ic.call(r,"from")||(r.from=t)),__DEV__&&void 0===r.from&&__DEV__&&Q.kG.warn("Undefined 'from' passed to readField with arguments ".concat(iF(Array.from(e)))),void 0===r.variables&&(r.variables=n),r}function i2(e){return function(t,n){if((0,tP.k)(t)||(0,tP.k)(n))throw __DEV__?new Q.ej("Cannot automatically merge arrays"):new Q.ej(4);if((0,eO.s)(t)&&(0,eO.s)(n)){var r=e.getFieldValue(t,"__typename"),i=e.getFieldValue(n,"__typename");if(r&&i&&r!==i)return n;if(eD(t)&&iw(n))return e.merge(t.__ref,n),t;if(iw(t)&&eD(n))return e.merge(t,n.__ref),n;if(iw(t)&&iw(n))return(0,en.pi)((0,en.pi)({},t),n)}return n}}function i3(e,t,n){var r="".concat(t).concat(n),i=e.flavors.get(r);return i||e.flavors.set(r,i=e.clientOnly===t&&e.deferred===n?e:(0,en.pi)((0,en.pi)({},e),{clientOnly:t,deferred:n})),i}var i4=function(){function e(e,t,n){this.cache=e,this.reader=t,this.fragments=n}return e.prototype.writeToStore=function(e,t){var n=this,r=t.query,i=t.result,a=t.dataId,o=t.variables,s=t.overwrite,u=e2(r),c=i_();o=(0,en.pi)((0,en.pi)({},e9(u)),o);var l=(0,en.pi)((0,en.pi)({store:e,written:Object.create(null),merge:function(e,t){return c.merge(e,t)},variables:o,varString:nx(o)},iE(r,this.fragments)),{overwrite:!!s,incomingById:new Map,clientOnly:!1,deferred:!1,flavors:new Map}),f=this.processSelectionSet({result:i||Object.create(null),dataId:a,selectionSet:u.selectionSet,mergeTree:{map:new Map},context:l});if(!eD(f))throw __DEV__?new Q.ej("Could not identify object ".concat(JSON.stringify(i))):new Q.ej(7);return l.incomingById.forEach(function(t,r){var i=t.storeObject,a=t.mergeTree,o=t.fieldNodeSet,s=eI(r);if(a&&a.map.size){var u=n.applyMerges(a,s,i,l);if(eD(u))return;i=u}if(__DEV__&&!l.overwrite){var c=Object.create(null);o.forEach(function(e){e.selectionSet&&(c[e.name.value]=!0)});var f=function(e){return!0===c[iv(e)]},d=function(e){var t=a&&a.map.get(e);return Boolean(t&&t.info&&t.info.merge)};Object.keys(i).forEach(function(e){f(e)&&!d(e)&&at(s,i,e,l.store)})}e.merge(r,i)}),e.retain(f.__ref),f},e.prototype.processSelectionSet=function(e){var t=this,n=e.dataId,r=e.result,i=e.selectionSet,a=e.context,o=e.mergeTree,s=this.cache.policies,u=Object.create(null),c=n&&s.rootTypenamesById[n]||eJ(r,i,a.fragmentMap)||n&&a.store.get(n,"__typename");"string"==typeof c&&(u.__typename=c);var l=function(){var e=i0(arguments,u,a.variables);if(eD(e.from)){var t=a.incomingById.get(e.from.__ref);if(t){var n=s.readField((0,en.pi)((0,en.pi)({},e),{from:t.storeObject}),a);if(void 0!==n)return n}}return s.readField(e,a)},f=new Set;this.flattenFields(i,r,a,c).forEach(function(e,n){var i,a=r[eX(n)];if(f.add(n),void 0!==a){var d=s.getStoreFieldName({typename:c,fieldName:n.name.value,field:n,variables:e.variables}),h=i5(o,d),p=t.processFieldValue(a,n,n.selectionSet?i3(e,!1,!1):e,h),b=void 0;n.selectionSet&&(eD(p)||iw(p))&&(b=l("__typename",p));var m=s.getMergeFunction(c,n.name.value,b);m?h.info={field:n,typename:c,merge:m}:i7(o,d),u=e.merge(u,((i={})[d]=p,i))}else __DEV__&&!e.clientOnly&&!e.deferred&&!nj.added(n)&&!s.getReadFunction(c,n.name.value)&&__DEV__&&Q.kG.error("Missing field '".concat(eX(n),"' while writing result ").concat(JSON.stringify(r,null,2)).substring(0,1e3))});try{var d=s.identify(r,{typename:c,selectionSet:i,fragmentMap:a.fragmentMap,storeObject:u,readField:l}),h=d[0],p=d[1];n=n||h,p&&(u=a.merge(u,p))}catch(b){if(!n)throw b}if("string"==typeof n){var m=eI(n),g=a.written[n]||(a.written[n]=[]);if(g.indexOf(i)>=0||(g.push(i),this.reader&&this.reader.isFresh(r,m,i,a)))return m;var v=a.incomingById.get(n);return v?(v.storeObject=a.merge(v.storeObject,u),v.mergeTree=i8(v.mergeTree,o),f.forEach(function(e){return v.fieldNodeSet.add(e)})):a.incomingById.set(n,{storeObject:u,mergeTree:i9(o)?void 0:o,fieldNodeSet:f}),m}return u},e.prototype.processFieldValue=function(e,t,n,r){var i=this;return t.selectionSet&&null!==e?(0,tP.k)(e)?e.map(function(e,a){var o=i.processFieldValue(e,t,n,i5(r,a));return i7(r,a),o}):this.processSelectionSet({result:e,selectionSet:t.selectionSet,context:n,mergeTree:r}):__DEV__?nJ(e):e},e.prototype.flattenFields=function(e,t,n,r){void 0===r&&(r=eJ(t,e,n.fragmentMap));var i=new Map,a=this.cache.policies,o=new n_(!1);return function e(s,u){var c=o.lookup(s,u.clientOnly,u.deferred);c.visited||(c.visited=!0,s.selections.forEach(function(o){if(td(o,n.variables)){var s=u.clientOnly,c=u.deferred;if(!(s&&c)&&(0,tP.O)(o.directives)&&o.directives.forEach(function(e){var t=e.name.value;if("client"===t&&(s=!0),"defer"===t){var r=eZ(e,n.variables);r&&!1===r.if||(c=!0)}}),eQ(o)){var l=i.get(o);l&&(s=s&&l.clientOnly,c=c&&l.deferred),i.set(o,i3(n,s,c))}else{var f=eC(o,n.lookupFragment);if(!f&&o.kind===nL.h.FRAGMENT_SPREAD)throw __DEV__?new Q.ej("No fragment named ".concat(o.name.value)):new Q.ej(8);f&&a.fragmentMatches(f,r,t,n.variables)&&e(f.selectionSet,i3(n,s,c))}}}))}(e,n),i},e.prototype.applyMerges=function(e,t,n,r,i){var a=this;if(e.map.size&&!eD(n)){var o,s,u=!(0,tP.k)(n)&&(eD(t)||iw(t))?t:void 0,c=n;u&&!i&&(i=[eD(u)?u.__ref:u]);var l=function(e,t){return(0,tP.k)(e)?"number"==typeof t?e[t]:void 0:r.store.getFieldValue(e,String(t))};e.map.forEach(function(e,t){var n=l(u,t),o=l(c,t);if(void 0!==o){i&&i.push(t);var f=a.applyMerges(e,n,o,r,i);f!==o&&(s=s||new Map).set(t,f),i&&(0,Q.kG)(i.pop()===t)}}),s&&(n=(0,tP.k)(c)?c.slice(0):(0,en.pi)({},c),s.forEach(function(e,t){n[t]=e}))}return e.info?this.cache.policies.runMergeFunction(t,n,e.info,r,i&&(o=r.store).getStorage.apply(o,i)):n},e}(),i6=[];function i5(e,t){var n=e.map;return n.has(t)||n.set(t,i6.pop()||{map:new Map}),n.get(t)}function i8(e,t){if(e===t||!t||i9(t))return e;if(!e||i9(e))return t;var n=e.info&&t.info?(0,en.pi)((0,en.pi)({},e.info),t.info):e.info||t.info,r=e.map.size&&t.map.size,i=r?new Map:e.map.size?e.map:t.map,a={info:n,map:i};if(r){var o=new Set(t.map.keys());e.map.forEach(function(e,n){a.map.set(n,i8(e,t.map.get(n))),o.delete(n)}),o.forEach(function(n){a.map.set(n,i8(t.map.get(n),e.map.get(n)))})}return a}function i9(e){return!e||!(e.info||e.map.size)}function i7(e,t){var n=e.map,r=n.get(t);r&&i9(r)&&(i6.push(r),n.delete(t))}var ae=new Set;function at(e,t,n,r){var i=function(e){var t=r.getFieldValue(e,n);return"object"==typeof t&&t},a=i(e);if(a){var o=i(t);if(!(!o||eD(a)||(0,nm.D)(a,o)||Object.keys(a).every(function(e){return void 0!==r.getFieldValue(o,e)}))){var s=r.getFieldValue(e,"__typename")||r.getFieldValue(t,"__typename"),u=iv(n),c="".concat(s,".").concat(u);if(!ae.has(c)){ae.add(c);var l=[];(0,tP.k)(a)||(0,tP.k)(o)||[a,o].forEach(function(e){var t=r.getFieldValue(e,"__typename");"string"!=typeof t||l.includes(t)||l.push(t)}),__DEV__&&Q.kG.warn("Cache data may be lost when replacing the ".concat(u," field of a ").concat(s," object.\n\nThis could cause additional (usually avoidable) network requests to fetch data that were otherwise cached.\n\nTo address this problem (which is not a bug in Apollo Client), ").concat(l.length?"either ensure all objects of type "+l.join(" and ")+" have an ID or a custom merge function, or ":"","define a custom merge function for the ").concat(c," field, so InMemoryCache can safely merge these objects:\n\n existing: ").concat(JSON.stringify(a).slice(0,1e3),"\n incoming: ").concat(JSON.stringify(o).slice(0,1e3),"\n\nFor more information about these options, please refer to the documentation:\n\n * Ensuring entity objects have IDs: https://go.apollo.dev/c/generating-unique-identifiers\n * Defining custom merge functions: https://go.apollo.dev/c/merging-non-normalized-objects\n"))}}}}var an=function(e){function t(t){void 0===t&&(t={});var n=e.call(this)||this;return n.watches=new Set,n.typenameDocumentCache=new Map,n.makeVar=r2,n.txCount=0,n.config=ip(t),n.addTypename=!!n.config.addTypename,n.policies=new iQ({cache:n,dataIdFromObject:n.config.dataIdFromObject,possibleTypes:n.config.possibleTypes,typePolicies:n.config.typePolicies}),n.init(),n}return(0,en.ZT)(t,e),t.prototype.init=function(){var e=this.data=new iT.Root({policies:this.policies,resultCaching:this.config.resultCaching});this.optimisticData=e.stump,this.resetResultCache()},t.prototype.resetResultCache=function(e){var t=this,n=this.storeReader,r=this.config.fragments;this.storeWriter=new i4(this,this.storeReader=new iP({cache:this,addTypename:this.addTypename,resultCacheMaxSize:this.config.resultCacheMaxSize,canonizeResults:ib(this.config),canon:e?void 0:n&&n.canon,fragments:r}),r),this.maybeBroadcastWatch=rZ(function(e,n){return t.broadcastWatch(e,n)},{max:this.config.resultCacheMaxSize,makeCacheKey:function(e){var n=e.optimistic?t.optimisticData:t.data;if(iD(n)){var r=e.optimistic,i=e.id,a=e.variables;return n.makeCacheKey(e.query,e.callback,nx({optimistic:r,id:i,variables:a}))}}}),new Set([this.data.group,this.optimisticData.group,]).forEach(function(e){return e.resetCaching()})},t.prototype.restore=function(e){return this.init(),e&&this.data.replace(e),this},t.prototype.extract=function(e){return void 0===e&&(e=!1),(e?this.optimisticData:this.data).extract()},t.prototype.read=function(e){var t=e.returnPartialData,n=void 0!==t&&t;try{return this.storeReader.diffQueryAgainstStore((0,en.pi)((0,en.pi)({},e),{store:e.optimistic?this.optimisticData:this.data,config:this.config,returnPartialData:n})).result||null}catch(r){if(r instanceof is)return null;throw r}},t.prototype.write=function(e){try{return++this.txCount,this.storeWriter.writeToStore(this.data,e)}finally{--this.txCount||!1===e.broadcast||this.broadcastWatches()}},t.prototype.modify=function(e){if(ic.call(e,"id")&&!e.id)return!1;var t=e.optimistic?this.optimisticData:this.data;try{return++this.txCount,t.modify(e.id||"ROOT_QUERY",e.fields)}finally{--this.txCount||!1===e.broadcast||this.broadcastWatches()}},t.prototype.diff=function(e){return this.storeReader.diffQueryAgainstStore((0,en.pi)((0,en.pi)({},e),{store:e.optimistic?this.optimisticData:this.data,rootId:e.id||"ROOT_QUERY",config:this.config}))},t.prototype.watch=function(e){var t=this;return this.watches.size||r0(this),this.watches.add(e),e.immediate&&this.maybeBroadcastWatch(e),function(){t.watches.delete(e)&&!t.watches.size&&r1(t),t.maybeBroadcastWatch.forget(e)}},t.prototype.gc=function(e){nx.reset();var t=this.optimisticData.gc();return e&&!this.txCount&&(e.resetResultCache?this.resetResultCache(e.resetResultIdentities):e.resetResultIdentities&&this.storeReader.resetCanon()),t},t.prototype.retain=function(e,t){return(t?this.optimisticData:this.data).retain(e)},t.prototype.release=function(e,t){return(t?this.optimisticData:this.data).release(e)},t.prototype.identify=function(e){if(eD(e))return e.__ref;try{return this.policies.identify(e)[0]}catch(t){__DEV__&&Q.kG.warn(t)}},t.prototype.evict=function(e){if(!e.id){if(ic.call(e,"id"))return!1;e=(0,en.pi)((0,en.pi)({},e),{id:"ROOT_QUERY"})}try{return++this.txCount,this.optimisticData.evict(e,this.data)}finally{--this.txCount||!1===e.broadcast||this.broadcastWatches()}},t.prototype.reset=function(e){var t=this;return this.init(),nx.reset(),e&&e.discardWatches?(this.watches.forEach(function(e){return t.maybeBroadcastWatch.forget(e)}),this.watches.clear(),r1(this)):this.broadcastWatches(),Promise.resolve()},t.prototype.removeOptimistic=function(e){var t=this.optimisticData.removeLayer(e);t!==this.optimisticData&&(this.optimisticData=t,this.broadcastWatches())},t.prototype.batch=function(e){var t,n=this,r=e.update,i=e.optimistic,a=void 0===i||i,o=e.removeOptimistic,s=e.onWatchUpdated,u=function(e){var i=n,a=i.data,o=i.optimisticData;++n.txCount,e&&(n.data=n.optimisticData=e);try{return t=r(n)}finally{--n.txCount,n.data=a,n.optimisticData=o}},c=new Set;return s&&!this.txCount&&this.broadcastWatches((0,en.pi)((0,en.pi)({},e),{onWatchUpdated:function(e){return c.add(e),!1}})),"string"==typeof a?this.optimisticData=this.optimisticData.addLayer(a,u):!1===a?u(this.data):u(),"string"==typeof o&&(this.optimisticData=this.optimisticData.removeLayer(o)),s&&c.size?(this.broadcastWatches((0,en.pi)((0,en.pi)({},e),{onWatchUpdated:function(e,t){var n=s.call(this,e,t);return!1!==n&&c.delete(e),n}})),c.size&&c.forEach(function(e){return n.maybeBroadcastWatch.dirty(e)})):this.broadcastWatches(e),t},t.prototype.performTransaction=function(e,t){return this.batch({update:e,optimistic:t||null!==t})},t.prototype.transformDocument=function(e){if(this.addTypename){var t=this.typenameDocumentCache.get(e);return t||(t=nj(e),this.typenameDocumentCache.set(e,t),this.typenameDocumentCache.set(t,t)),t}return e},t.prototype.transformForLink=function(e){var t=this.config.fragments;return t?t.transform(e):e},t.prototype.broadcastWatches=function(e){var t=this;this.txCount||this.watches.forEach(function(n){return t.maybeBroadcastWatch(n,e)})},t.prototype.broadcastWatch=function(e,t){var n=e.lastDiff,r=this.diff(e);(!t||(e.optimistic&&"string"==typeof t.optimistic&&(r.fromOptimisticTransaction=!0),!t.onWatchUpdated||!1!==t.onWatchUpdated.call(this,e,r,n)))&&(n&&(0,nm.D)(n.result,r.result)||e.callback(e.lastDiff=r,n))},t}(io),ar={possibleTypes:{ApproveJobProposalSpecPayload:["ApproveJobProposalSpecSuccess","JobAlreadyExistsError","NotFoundError"],BridgePayload:["Bridge","NotFoundError"],CancelJobProposalSpecPayload:["CancelJobProposalSpecSuccess","NotFoundError"],ChainPayload:["Chain","NotFoundError"],CreateAPITokenPayload:["CreateAPITokenSuccess","InputErrors"],CreateBridgePayload:["CreateBridgeSuccess"],CreateCSAKeyPayload:["CSAKeyExistsError","CreateCSAKeySuccess"],CreateFeedsManagerChainConfigPayload:["CreateFeedsManagerChainConfigSuccess","InputErrors","NotFoundError"],CreateFeedsManagerPayload:["CreateFeedsManagerSuccess","DuplicateFeedsManagerError","InputErrors","NotFoundError","SingleFeedsManagerError"],CreateJobPayload:["CreateJobSuccess","InputErrors"],CreateOCR2KeyBundlePayload:["CreateOCR2KeyBundleSuccess"],CreateOCRKeyBundlePayload:["CreateOCRKeyBundleSuccess"],CreateP2PKeyPayload:["CreateP2PKeySuccess"],DeleteAPITokenPayload:["DeleteAPITokenSuccess","InputErrors"],DeleteBridgePayload:["DeleteBridgeConflictError","DeleteBridgeInvalidNameError","DeleteBridgeSuccess","NotFoundError"],DeleteCSAKeyPayload:["DeleteCSAKeySuccess","NotFoundError"],DeleteFeedsManagerChainConfigPayload:["DeleteFeedsManagerChainConfigSuccess","NotFoundError"],DeleteJobPayload:["DeleteJobSuccess","NotFoundError"],DeleteOCR2KeyBundlePayload:["DeleteOCR2KeyBundleSuccess","NotFoundError"],DeleteOCRKeyBundlePayload:["DeleteOCRKeyBundleSuccess","NotFoundError"],DeleteP2PKeyPayload:["DeleteP2PKeySuccess","NotFoundError"],DeleteVRFKeyPayload:["DeleteVRFKeySuccess","NotFoundError"],DismissJobErrorPayload:["DismissJobErrorSuccess","NotFoundError"],Error:["CSAKeyExistsError","DeleteBridgeConflictError","DeleteBridgeInvalidNameError","DuplicateFeedsManagerError","InputError","JobAlreadyExistsError","NotFoundError","RunJobCannotRunError","SingleFeedsManagerError"],EthTransactionPayload:["EthTransaction","NotFoundError"],FeaturesPayload:["Features"],FeedsManagerPayload:["FeedsManager","NotFoundError"],GetSQLLoggingPayload:["SQLLogging"],GlobalLogLevelPayload:["GlobalLogLevel"],JobPayload:["Job","NotFoundError"],JobProposalPayload:["JobProposal","NotFoundError"],JobRunPayload:["JobRun","NotFoundError"],JobSpec:["BlockHeaderFeederSpec","BlockhashStoreSpec","BootstrapSpec","CronSpec","DirectRequestSpec","FluxMonitorSpec","GatewaySpec","KeeperSpec","OCR2Spec","OCRSpec","StandardCapabilitiesSpec","VRFSpec","WebhookSpec","WorkflowSpec"],NodePayload:["Node","NotFoundError"],PaginatedPayload:["BridgesPayload","ChainsPayload","EthTransactionAttemptsPayload","EthTransactionsPayload","JobRunsPayload","JobsPayload","NodesPayload"],RejectJobProposalSpecPayload:["NotFoundError","RejectJobProposalSpecSuccess"],RunJobPayload:["NotFoundError","RunJobCannotRunError","RunJobSuccess"],SetGlobalLogLevelPayload:["InputErrors","SetGlobalLogLevelSuccess"],SetSQLLoggingPayload:["SetSQLLoggingSuccess"],SetServicesLogLevelsPayload:["InputErrors","SetServicesLogLevelsSuccess"],UpdateBridgePayload:["NotFoundError","UpdateBridgeSuccess"],UpdateFeedsManagerChainConfigPayload:["InputErrors","NotFoundError","UpdateFeedsManagerChainConfigSuccess"],UpdateFeedsManagerPayload:["InputErrors","NotFoundError","UpdateFeedsManagerSuccess"],UpdateJobProposalSpecDefinitionPayload:["NotFoundError","UpdateJobProposalSpecDefinitionSuccess"],UpdatePasswordPayload:["InputErrors","UpdatePasswordSuccess"],VRFKeyPayload:["NotFoundError","VRFKeySuccess"]}};let ai=ar;var aa=(r=void 0,location.origin),ao=new nh({uri:"".concat(aa,"/query"),credentials:"include"}),as=new ia({cache:new an({possibleTypes:ai.possibleTypes}),link:ao});if(a.Z.locale(o),u().defaultFormat="YYYY-MM-DD h:mm:ss A","undefined"!=typeof document){var au,ac,al=f().hydrate;ac=X,al(c.createElement(et,{client:as},c.createElement(d.zj,null,c.createElement(i.MuiThemeProvider,{theme:J.r},c.createElement(ac,null)))),document.getElementById("root"))}})()})(); \ No newline at end of file diff --git a/core/web/assets/main.84f90f8fc23465846aa7.js.gz b/core/web/assets/main.84f90f8fc23465846aa7.js.gz new file mode 100644 index 00000000000..7fcd5de9137 Binary files /dev/null and b/core/web/assets/main.84f90f8fc23465846aa7.js.gz differ diff --git a/core/web/evm_transfer_controller.go b/core/web/evm_transfer_controller.go index 88d3dead4c8..75f6c07b6d9 100644 --- a/core/web/evm_transfer_controller.go +++ b/core/web/evm_transfer_controller.go @@ -54,7 +54,7 @@ func (tc *EVMTransfersController) Create(c *gin.Context) { } if !tr.AllowHigherAmounts { - err = ValidateEthBalanceForTransfer(c, chain, tr.FromAddress, tr.Amount) + err = ValidateEthBalanceForTransfer(c, chain, tr.FromAddress, tr.Amount, tr.DestinationAddress) if err != nil { jsonAPIError(c, http.StatusUnprocessableEntity, errors.Errorf("transaction failed: %v", err)) return @@ -92,7 +92,7 @@ func (tc *EVMTransfersController) Create(c *gin.Context) { } // ValidateEthBalanceForTransfer validates that the current balance can cover the transaction amount -func ValidateEthBalanceForTransfer(c *gin.Context, chain legacyevm.Chain, fromAddr common.Address, amount assets.Eth) error { +func ValidateEthBalanceForTransfer(c *gin.Context, chain legacyevm.Chain, fromAddr common.Address, amount assets.Eth, toAddr common.Address) error { var err error var balance *big.Int @@ -116,7 +116,7 @@ func ValidateEthBalanceForTransfer(c *gin.Context, chain legacyevm.Chain, fromAd gasLimit := chain.Config().EVM().GasEstimator().LimitTransfer() estimator := chain.GasEstimator() - amountWithFees, err := estimator.GetMaxCost(c, amount, nil, gasLimit, chain.Config().EVM().GasEstimator().PriceMaxKey(fromAddr)) + amountWithFees, err := estimator.GetMaxCost(c, amount, nil, gasLimit, chain.Config().EVM().GasEstimator().PriceMaxKey(fromAddr), &fromAddr, &toAddr) if err != nil { return err } diff --git a/core/web/features_controller.go b/core/web/features_controller.go index 76f04fe262c..66cd9e60c44 100644 --- a/core/web/features_controller.go +++ b/core/web/features_controller.go @@ -13,8 +13,9 @@ type FeaturesController struct { } const ( - FeatureKeyCSA string = "csa" - FeatureKeyFeedsManager string = "feeds_manager" + FeatureKeyCSA string = "csa" + FeatureKeyFeedsManager string = "feeds_manager" + FeatureKeyMultiFeedsManagers string = "multi_feeds_managers" ) // Index retrieves the features @@ -24,6 +25,7 @@ func (fc *FeaturesController) Index(c *gin.Context) { resources := []presenters.FeatureResource{ *presenters.NewFeatureResource(FeatureKeyCSA, fc.App.GetConfig().Feature().UICSAKeys()), *presenters.NewFeatureResource(FeatureKeyFeedsManager, fc.App.GetConfig().Feature().FeedsManager()), + *presenters.NewFeatureResource(FeatureKeyMultiFeedsManagers, fc.App.GetConfig().Feature().MultiFeedsManagers()), } jsonAPIResponse(c, resources, "features") diff --git a/core/web/features_controller_test.go b/core/web/features_controller_test.go index 727d7db5476..02f75f14bc5 100644 --- a/core/web/features_controller_test.go +++ b/core/web/features_controller_test.go @@ -19,6 +19,7 @@ func Test_FeaturesController_List(t *testing.T) { app := cltest.NewApplicationWithConfig(t, configtest.NewGeneralConfig(t, func(c *chainlink.Config, s *chainlink.Secrets) { csa := true c.Feature.UICSAKeys = &csa + c.Feature.MultiFeedsManagers = &csa })) require.NoError(t, app.Start(testutils.Context(t))) client := app.NewHTTPClient(nil) @@ -30,11 +31,14 @@ func Test_FeaturesController_List(t *testing.T) { resources := []presenters.FeatureResource{} err := web.ParseJSONAPIResponse(cltest.ParseResponseBody(t, resp), &resources) require.NoError(t, err) - require.Len(t, resources, 2) + require.Len(t, resources, 3) assert.Equal(t, "csa", resources[0].ID) assert.True(t, resources[0].Enabled) assert.Equal(t, "feeds_manager", resources[1].ID) assert.True(t, resources[1].Enabled) + + assert.Equal(t, "multi_feeds_managers", resources[2].ID) + assert.True(t, resources[2].Enabled) } diff --git a/core/web/health_controller.go b/core/web/health_controller.go index bd775671d73..ee08c39fcf1 100644 --- a/core/web/health_controller.go +++ b/core/web/health_controller.go @@ -69,6 +69,8 @@ func (hc *HealthController) Readyz(c *gin.Context) { } func (hc *HealthController) Health(c *gin.Context) { + _, failing := c.GetQuery("failing") + status := http.StatusOK checker := hc.App.GetHealthChecker() @@ -89,6 +91,8 @@ func (hc *HealthController) Health(c *gin.Context) { if err != nil { status = HealthStatusFailing output = err.Error() + } else if failing { + continue // omit from returned data } checks = append(checks, presenters.Check{ diff --git a/core/web/health_controller_test.go b/core/web/health_controller_test.go index 21da1fb2e44..14367b1e4bb 100644 --- a/core/web/health_controller_test.go +++ b/core/web/health_controller_test.go @@ -97,6 +97,12 @@ var ( bodyHTML string //go:embed testdata/body/health.txt bodyTXT string + //go:embed testdata/body/health-failing.json + bodyJSONFailing string + //go:embed testdata/body/health-failing.html + bodyHTMLFailing string + //go:embed testdata/body/health-failing.txt + bodyTXTFailing string ) func TestHealthController_Health_body(t *testing.T) { @@ -111,6 +117,12 @@ func TestHealthController_Health_body(t *testing.T) { {"html", "/health", map[string]string{"Accept": gin.MIMEHTML}, bodyHTML}, {"text", "/health", map[string]string{"Accept": gin.MIMEPlain}, bodyTXT}, {".txt", "/health.txt", nil, bodyTXT}, + + {"default-failing", "/health?failing", nil, bodyJSONFailing}, + {"json-failing", "/health?failing", map[string]string{"Accept": gin.MIMEJSON}, bodyJSONFailing}, + {"html-failing", "/health?failing", map[string]string{"Accept": gin.MIMEHTML}, bodyHTMLFailing}, + {"text-failing", "/health?failing", map[string]string{"Accept": gin.MIMEPlain}, bodyTXTFailing}, + {".txt-failing", "/health.txt?failing", nil, bodyTXTFailing}, } { t.Run(tc.name, func(t *testing.T) { app := cltest.NewApplicationWithKey(t) diff --git a/core/web/jobs_controller.go b/core/web/jobs_controller.go index 2e005d6d230..b11f6e61094 100644 --- a/core/web/jobs_controller.go +++ b/core/web/jobs_controller.go @@ -12,6 +12,7 @@ import ( "github.com/google/uuid" "github.com/pkg/errors" + ccip "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/validate" "github.com/smartcontractkit/chainlink/v2/core/logger/audit" "github.com/smartcontractkit/chainlink/v2/core/services/blockhashstore" "github.com/smartcontractkit/chainlink/v2/core/services/blockheaderfeeder" @@ -255,10 +256,11 @@ func (jc *JobsController) validateJobSpec(ctx context.Context, tomlString string case job.Stream: jb, err = streams.ValidatedStreamSpec(tomlString) case job.Workflow: - jb, err = workflows.ValidatedWorkflowJobSpec(tomlString) + jb, err = workflows.ValidatedWorkflowJobSpec(ctx, tomlString) case job.StandardCapabilities: jb, err = standardcapabilities.ValidatedStandardCapabilitiesSpec(tomlString) - + case job.CCIP: + jb, err = ccip.ValidatedCCIPSpec(tomlString) default: return jb, http.StatusUnprocessableEntity, errors.Errorf("unknown job type: %s", jobType) } diff --git a/core/web/loop_registry_internal_test.go b/core/web/loop_registry_internal_test.go index 48cd75a5cff..a02fa20802a 100644 --- a/core/web/loop_registry_internal_test.go +++ b/core/web/loop_registry_internal_test.go @@ -38,7 +38,7 @@ func TestLoopRegistryServer_CantWriteToResponse(t *testing.T) { l, o := logger.TestLoggerObserved(t, zap.ErrorLevel) s := &LoopRegistryServer{ exposedPromPort: 1, - registry: plugins.NewLoopRegistry(l, nil), + registry: plugins.NewLoopRegistry(l, nil, nil), logger: l.(logger.SugaredLogger), jsonMarshalFn: json.Marshal, } @@ -53,7 +53,7 @@ func TestLoopRegistryServer_CantMarshal(t *testing.T) { l, o := logger.TestLoggerObserved(t, zap.ErrorLevel) s := &LoopRegistryServer{ exposedPromPort: 1, - registry: plugins.NewLoopRegistry(l, nil), + registry: plugins.NewLoopRegistry(l, nil, nil), logger: l.(logger.SugaredLogger), jsonMarshalFn: func(any) ([]byte, error) { return []byte(""), errors.New("can't unmarshal") diff --git a/core/web/presenters/aptos_key.go b/core/web/presenters/aptos_key.go index 6460c325f97..8c0c09ed10a 100644 --- a/core/web/presenters/aptos_key.go +++ b/core/web/presenters/aptos_key.go @@ -5,7 +5,8 @@ import "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/apt // AptosKeyResource represents a Aptos key JSONAPI resource. type AptosKeyResource struct { JAID - PubKey string `json:"publicKey"` + Account string `json:"account"` + PubKey string `json:"publicKey"` } // GetName implements the api2go EntityNamer interface @@ -15,8 +16,9 @@ func (AptosKeyResource) GetName() string { func NewAptosKeyResource(key aptoskey.Key) *AptosKeyResource { r := &AptosKeyResource{ - JAID: JAID{ID: key.ID()}, - PubKey: key.PublicKeyStr(), + JAID: JAID{ID: key.ID()}, + Account: key.Account(), + PubKey: key.PublicKeyStr(), } return r diff --git a/core/web/presenters/job.go b/core/web/presenters/job.go index ad6bf617a82..bb518650516 100644 --- a/core/web/presenters/job.go +++ b/core/web/presenters/job.go @@ -468,6 +468,26 @@ func NewStandardCapabilitiesSpec(spec *job.StandardCapabilitiesSpec) *StandardCa } } +type CCIPSpec struct { + CreatedAt time.Time `json:"createdAt"` + UpdatedAt time.Time `json:"updatedAt"` + CapabilityVersion string `json:"capabilityVersion"` + CapabilityLabelledName string `json:"capabilityLabelledName"` + OCRKeyBundleIDs map[string]interface{} `json:"ocrKeyBundleIDs"` + P2PKeyID string `json:"p2pKeyID"` +} + +func NewCCIPSpec(spec *job.CCIPSpec) *CCIPSpec { + return &CCIPSpec{ + CreatedAt: spec.CreatedAt, + UpdatedAt: spec.UpdatedAt, + CapabilityVersion: spec.CapabilityVersion, + CapabilityLabelledName: spec.CapabilityLabelledName, + OCRKeyBundleIDs: spec.OCRKeyBundleIDs, + P2PKeyID: spec.P2PKeyID, + } +} + // JobError represents errors on the job type JobError struct { ID int64 `json:"id"` @@ -512,6 +532,7 @@ type JobResource struct { GatewaySpec *GatewaySpec `json:"gatewaySpec"` WorkflowSpec *WorkflowSpec `json:"workflowSpec"` StandardCapabilitiesSpec *StandardCapabilitiesSpec `json:"standardCapabilitiesSpec"` + CCIPSpec *CCIPSpec `json:"ccipSpec"` PipelineSpec PipelineSpec `json:"pipelineSpec"` Errors []JobError `json:"errors"` } @@ -562,6 +583,8 @@ func NewJobResource(j job.Job) *JobResource { resource.WorkflowSpec = NewWorkflowSpec(j.WorkflowSpec) case job.StandardCapabilities: resource.StandardCapabilitiesSpec = NewStandardCapabilitiesSpec(j.StandardCapabilitiesSpec) + case job.CCIP: + resource.CCIPSpec = NewCCIPSpec(j.CCIPSpec) case job.LegacyGasStationServer, job.LegacyGasStationSidecar: // unsupported } diff --git a/core/web/presenters/job_test.go b/core/web/presenters/job_test.go index 5de71f918e3..75697c6e068 100644 --- a/core/web/presenters/job_test.go +++ b/core/web/presenters/job_test.go @@ -130,6 +130,7 @@ func TestJob(t *testing.T) { "bootstrapSpec": null, "gatewaySpec": null, "standardCapabilitiesSpec": null, + "ccipSpec": null, "errors": [] } } @@ -208,6 +209,7 @@ func TestJob(t *testing.T) { "bootstrapSpec": null, "gatewaySpec": null, "standardCapabilitiesSpec": null, + "ccipSpec": null, "errors": [] } } @@ -296,6 +298,7 @@ func TestJob(t *testing.T) { "bootstrapSpec": null, "gatewaySpec": null, "standardCapabilitiesSpec": null, + "ccipSpec": null, "errors": [] } } @@ -361,6 +364,7 @@ func TestJob(t *testing.T) { "bootstrapSpec": null, "gatewaySpec": null, "standardCapabilitiesSpec": null, + "ccipSpec": null, "errors": [] } } @@ -423,6 +427,7 @@ func TestJob(t *testing.T) { "bootstrapSpec": null, "gatewaySpec": null, "standardCapabilitiesSpec": null, + "ccipSpec": null, "errors": [] } } @@ -481,6 +486,7 @@ func TestJob(t *testing.T) { "bootstrapSpec": null, "gatewaySpec": null, "standardCapabilitiesSpec": null, + "ccipSpec": null, "errors": [] } } @@ -566,7 +572,9 @@ func TestJob(t *testing.T) { "dotDagSource": "" }, "gatewaySpec": null, - "standardCapabilitiesSpec": null, + "standardCapabilitiesSpec": null, + "standardCapabilitiesSpec": null, + "ccipSpec": null, "errors": [] } } @@ -649,6 +657,7 @@ func TestJob(t *testing.T) { }, "gatewaySpec": null, "standardCapabilitiesSpec": null, + "ccipSpec": null, "errors": [] } } @@ -731,6 +740,7 @@ func TestJob(t *testing.T) { }, "gatewaySpec": null, "standardCapabilitiesSpec": null, + "ccipSpec": null, "errors": [] } } @@ -780,14 +790,14 @@ func TestJob(t *testing.T) { "blockhashStoreSpec": null, "blockHeaderFeederSpec": null, "bootstrapSpec": { - "blockchainTimeout":"0s", - "contractConfigConfirmations":0, - "contractConfigTrackerPollInterval":"0s", - "contractConfigTrackerSubscribeInterval":"0s", - "contractID":"0x16988483b46e695f6c8D58e6e1461DC703e008e1", - "createdAt":"0001-01-01T00:00:00Z", - "relay":"evm", - "relayConfig":{"chainID":1337}, + "blockchainTimeout":"0s", + "contractConfigConfirmations":0, + "contractConfigTrackerPollInterval":"0s", + "contractConfigTrackerSubscribeInterval":"0s", + "contractID":"0x16988483b46e695f6c8D58e6e1461DC703e008e1", + "createdAt":"0001-01-01T00:00:00Z", + "relay":"evm", + "relayConfig":{"chainID":1337}, "updatedAt":"0001-01-01T00:00:00Z" }, "pipelineSpec": { @@ -797,6 +807,7 @@ func TestJob(t *testing.T) { }, "gatewaySpec": null, "standardCapabilitiesSpec": null, + "ccipSpec": null, "errors": [] } } @@ -855,6 +866,7 @@ func TestJob(t *testing.T) { "updatedAt":"0001-01-01T00:00:00Z" }, "standardCapabilitiesSpec": null, + "ccipSpec": null, "pipelineSpec": { "id": 1, "jobID": 0, @@ -919,6 +931,7 @@ func TestJob(t *testing.T) { "bootstrapSpec": null, "gatewaySpec": null, "standardCapabilitiesSpec": null, + "ccipSpec": null, "pipelineSpec": { "id": 1, "jobID": 0, @@ -979,6 +992,72 @@ func TestJob(t *testing.T) { "createdAt":"0001-01-01T00:00:00Z", "updatedAt":"0001-01-01T00:00:00Z" }, + "ccipSpec": null, + "pipelineSpec": { + "id": 1, + "jobID": 0, + "dotDagSource": "" + }, + "errors": [] + } + } + }`, + }, + { + name: "ccip spec", + job: job.Job{ + ID: 1, + CCIPSpec: &job.CCIPSpec{ + ID: 3, + CreatedAt: timestamp, + UpdatedAt: timestamp, + CapabilityVersion: "4.5.9", + CapabilityLabelledName: "ccip", + }, + PipelineSpec: &pipeline.Spec{ + ID: 1, + DotDagSource: "", + }, + ExternalJobID: uuid.MustParse("0eec7e1d-d0d2-476c-a1a8-72dfb6633f46"), + Type: job.CCIP, + SchemaVersion: 1, + Name: null.StringFrom("ccip test"), + }, + want: ` + { + "data": { + "type": "jobs", + "id": "1", + "attributes": { + "name": "ccip test", + "type": "ccip", + "schemaVersion": 1, + "maxTaskDuration": "0s", + "externalJobID": "0eec7e1d-d0d2-476c-a1a8-72dfb6633f46", + "directRequestSpec": null, + "fluxMonitorSpec": null, + "gasLimit": null, + "forwardingAllowed": false, + "cronSpec": null, + "offChainReportingOracleSpec": null, + "offChainReporting2OracleSpec": null, + "keeperSpec": null, + "vrfSpec": null, + "webhookSpec": null, + "workflowSpec": null, + "blockhashStoreSpec": null, + "blockHeaderFeederSpec": null, + "bootstrapSpec": null, + "gatewaySpec": null, + "standardCapabilitiesSpec": null, + "ccipSpec": { + "capabilityVersion":"4.5.9", + "capabilityLabelledName":"ccip", + "ocrKeyBundleIDs": null, + "p2pKeyID": "", + "createdAt":"2000-01-01T00:00:00Z", + "updatedAt":"2000-01-01T00:00:00Z" + }, "pipelineSpec": { "id": 1, "jobID": 0, @@ -1058,6 +1137,7 @@ func TestJob(t *testing.T) { "bootstrapSpec": null, "gatewaySpec": null, "standardCapabilitiesSpec": null, + "ccipSpec": null, "errors": [{ "id": 200, "description": "some error", diff --git a/core/web/resolver/features.go b/core/web/resolver/features.go index 9ce39a773c6..9d6c135a93c 100644 --- a/core/web/resolver/features.go +++ b/core/web/resolver/features.go @@ -20,6 +20,11 @@ func (r *FeaturesResolver) FeedsManager() bool { return r.cfg.FeedsManager() } +// MultiFeedsManagers resolves to whether multiple feed managers support is enable. +func (r *FeaturesResolver) MultiFeedsManagers() bool { + return r.cfg.MultiFeedsManagers() +} + type FeaturesPayloadResolver struct { cfg config.Feature } diff --git a/core/web/resolver/features_test.go b/core/web/resolver/features_test.go index 76394f038b0..4e8f9e8c26c 100644 --- a/core/web/resolver/features_test.go +++ b/core/web/resolver/features_test.go @@ -15,6 +15,7 @@ func Test_ToFeatures(t *testing.T) { ... on Features { csa feedsManager + multiFeedsManagers } } }` @@ -29,6 +30,7 @@ func Test_ToFeatures(t *testing.T) { t, f := true, false c.Feature.UICSAKeys = &f c.Feature.FeedsManager = &t + c.Feature.MultiFeedsManagers = &f })) }, query: query, @@ -36,7 +38,8 @@ func Test_ToFeatures(t *testing.T) { { "features": { "csa": false, - "feedsManager": true + "feedsManager": true, + "multiFeedsManagers": false } }`, }, diff --git a/core/web/resolver/feeds_manager.go b/core/web/resolver/feeds_manager.go index 86705cf2071..0711cb1354b 100644 --- a/core/web/resolver/feeds_manager.go +++ b/core/web/resolver/feeds_manager.go @@ -145,6 +145,7 @@ func (r *CreateFeedsManagerPayloadResolver) ToCreateFeedsManagerSuccess() (*Crea return nil, false } +// TODO: delete once multiple feeds managers support is released func (r *CreateFeedsManagerPayloadResolver) ToSingleFeedsManagerError() (*SingleFeedsManagerErrorResolver, bool) { if r.err != nil && errors.Is(r.err, feeds.ErrSingleFeedsManager) { return NewSingleFeedsManagerError(r.err.Error()), true @@ -153,6 +154,14 @@ func (r *CreateFeedsManagerPayloadResolver) ToSingleFeedsManagerError() (*Single return nil, false } +func (r *CreateFeedsManagerPayloadResolver) ToDuplicateFeedsManagerError() (*DuplicateFeedsManagerErrorResolver, bool) { + if r.err != nil && errors.Is(r.err, feeds.ErrDuplicateFeedsManager) { + return NewDuplicateFeedsManagerError(r.err.Error()), true + } + + return nil, false +} + func (r *CreateFeedsManagerPayloadResolver) ToInputErrors() (*InputErrorsResolver, bool) { if r.inputErrs != nil { var errs []*InputErrorResolver @@ -182,6 +191,7 @@ func (r *CreateFeedsManagerSuccessResolver) FeedsManager() *FeedsManagerResolver } // SingleFeedsManagerErrorResolver - +// TODO: delete once multiple feeds managers support is released type SingleFeedsManagerErrorResolver struct { message string } @@ -200,6 +210,25 @@ func (r *SingleFeedsManagerErrorResolver) Code() ErrorCode { return ErrorCodeUnprocessable } +// DuplicateFeedsManagerErrorResolver - +type DuplicateFeedsManagerErrorResolver struct { + message string +} + +func NewDuplicateFeedsManagerError(message string) *DuplicateFeedsManagerErrorResolver { + return &DuplicateFeedsManagerErrorResolver{ + message: message, + } +} + +func (r *DuplicateFeedsManagerErrorResolver) Message() string { + return r.message +} + +func (r *DuplicateFeedsManagerErrorResolver) Code() ErrorCode { + return ErrorCodeUnprocessable +} + // -- UpdateFeedsManager Mutation -- // UpdateFeedsManagerPayloadResolver - diff --git a/core/web/resolver/feeds_manager_test.go b/core/web/resolver/feeds_manager_test.go index bafb50ab0d5..4237c6a7749 100644 --- a/core/web/resolver/feeds_manager_test.go +++ b/core/web/resolver/feeds_manager_test.go @@ -183,6 +183,10 @@ func Test_CreateFeedsManager(t *testing.T) { message code } + ... on DuplicateFeedsManagerError { + message + code + } ... on NotFoundError { message code @@ -264,6 +268,25 @@ func Test_CreateFeedsManager(t *testing.T) { } }`, }, + { + name: "register duplicate feeds manager error", + authenticated: true, + before: func(ctx context.Context, f *gqlTestFramework) { + f.App.On("GetFeedsService").Return(f.Mocks.feedsSvc) + f.Mocks.feedsSvc. + On("RegisterManager", mock.Anything, mock.IsType(feeds.RegisterManagerParams{})). + Return(int64(0), feeds.ErrDuplicateFeedsManager) + }, + query: mutation, + variables: variables, + result: ` + { + "createFeedsManager": { + "message": "manager was previously registered using the same public key", + "code": "UNPROCESSABLE" + } + }`, + }, { name: "not found", authenticated: true, diff --git a/core/web/resolver/mutation.go b/core/web/resolver/mutation.go index 4da5b1da651..4388bd5a701 100644 --- a/core/web/resolver/mutation.go +++ b/core/web/resolver/mutation.go @@ -14,8 +14,10 @@ import ( "gopkg.in/guregu/null.v4" "github.com/smartcontractkit/chainlink-common/pkg/assets" + "github.com/smartcontractkit/chainlink/v2/core/auth" "github.com/smartcontractkit/chainlink/v2/core/bridges" + ccip "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/validate" "github.com/smartcontractkit/chainlink/v2/core/logger/audit" "github.com/smartcontractkit/chainlink/v2/core/services/blockhashstore" "github.com/smartcontractkit/chainlink/v2/core/services/blockheaderfeeder" @@ -424,7 +426,7 @@ func (r *Resolver) CreateFeedsManager(ctx context.Context, args struct { id, err := feedsService.RegisterManager(ctx, params) if err != nil { - if errors.Is(err, feeds.ErrSingleFeedsManager) { + if errors.Is(err, feeds.ErrSingleFeedsManager) || errors.Is(err, feeds.ErrDuplicateFeedsManager) { return NewCreateFeedsManagerPayload(nil, err, nil), nil } return nil, err @@ -1061,11 +1063,13 @@ func (r *Resolver) CreateJob(ctx context.Context, args struct { case job.Gateway: jb, err = gateway.ValidatedGatewaySpec(args.Input.TOML) case job.Workflow: - jb, err = workflows.ValidatedWorkflowJobSpec(args.Input.TOML) + jb, err = workflows.ValidatedWorkflowJobSpec(ctx, args.Input.TOML) case job.StandardCapabilities: jb, err = standardcapabilities.ValidatedStandardCapabilitiesSpec(args.Input.TOML) case job.Stream: jb, err = streams.ValidatedStreamSpec(args.Input.TOML) + case job.CCIP: + jb, err = ccip.ValidatedCCIPSpec(args.Input.TOML) default: return NewCreateJobPayload(r.App, nil, map[string]string{ "Job Type": fmt.Sprintf("unknown job type: %s", jbt), diff --git a/core/web/resolver/testdata/config-empty-effective.toml b/core/web/resolver/testdata/config-empty-effective.toml index 1bad3fd91c6..4cfe5e2086c 100644 --- a/core/web/resolver/testdata/config-empty-effective.toml +++ b/core/web/resolver/testdata/config-empty-effective.toml @@ -6,6 +6,8 @@ ShutdownGracePeriod = '5s' FeedsManager = true LogPoller = false UICSAKeys = false +CCIP = true +MultiFeedsManagers = false [Database] DefaultIdleInTxSessionTimeout = '1h0m0s' @@ -33,7 +35,7 @@ LeaseDuration = '10s' LeaseRefreshInterval = '1s' [TelemetryIngress] -UniConn = true +UniConn = false Logging = false BufferSize = 100 MaxBatchSize = 50 @@ -251,7 +253,36 @@ DeltaDial = '15s' DeltaReconcile = '1m0s' ListenAddresses = [] +[Capabilities.Dispatcher] +SupportedVersion = 1 +ReceiverBufferSize = 10000 + +[Capabilities.Dispatcher.RateLimit] +GlobalRPS = 800.0 +GlobalBurst = 1000 +PerSenderRPS = 10.0 +PerSenderBurst = 50 + [Capabilities.ExternalRegistry] Address = '' NetworkID = 'evm' ChainID = '1' + +[Capabilities.GatewayConnector] +ChainIDForNodeKey = '' +NodeAddress = '' +DonID = '' +WSHandshakeTimeoutMillis = 0 +AuthMinChallengeLen = 0 +AuthTimestampToleranceSec = 0 + +[[Capabilities.GatewayConnector.Gateways]] +ID = '' +URL = '' + +[Telemetry] +Enabled = false +CACertFile = '' +Endpoint = '' +InsecureConnection = false +TraceSampleRatio = 0.01 diff --git a/core/web/resolver/testdata/config-full.toml b/core/web/resolver/testdata/config-full.toml index 3e083bd1844..b26e1068ac8 100644 --- a/core/web/resolver/testdata/config-full.toml +++ b/core/web/resolver/testdata/config-full.toml @@ -6,6 +6,8 @@ ShutdownGracePeriod = '10s' FeedsManager = true LogPoller = true UICSAKeys = true +CCIP = true +MultiFeedsManagers = false [Database] DefaultIdleInTxSessionTimeout = '1m0s' @@ -33,7 +35,7 @@ LeaseDuration = '1m0s' LeaseRefreshInterval = '1s' [TelemetryIngress] -UniConn = true +UniConn = false Logging = true BufferSize = 1234 MaxBatchSize = 4321 @@ -261,11 +263,44 @@ DeltaDial = '1m0s' DeltaReconcile = '2s' ListenAddresses = ['foo', 'bar'] +[Capabilities.Dispatcher] +SupportedVersion = 1 +ReceiverBufferSize = 10000 + +[Capabilities.Dispatcher.RateLimit] +GlobalRPS = 800.0 +GlobalBurst = 1000 +PerSenderRPS = 10.0 +PerSenderBurst = 50 + [Capabilities.ExternalRegistry] Address = '' NetworkID = 'evm' ChainID = '1' +[Capabilities.GatewayConnector] +ChainIDForNodeKey = '11155111' +NodeAddress = '0x68902d681c28119f9b2531473a417088bf008e59' +DonID = 'example_don' +WSHandshakeTimeoutMillis = 100 +AuthMinChallengeLen = 10 +AuthTimestampToleranceSec = 10 + +[[Capabilities.GatewayConnector.Gateways]] +ID = 'example_gateway' +URL = 'wss://localhost:8081/node' + +[Telemetry] +Enabled = true +CACertFile = 'cert-file' +Endpoint = 'example.com/collector' +InsecureConnection = true +TraceSampleRatio = 0.01 + +[Telemetry.ResourceAttributes] +Baz = 'test' +Foo = 'bar' + [[EVM]] ChainID = '1' Enabled = false @@ -274,7 +309,7 @@ BlockBackfillDepth = 100 BlockBackfillSkip = true ChainType = 'Optimism' FinalityDepth = 42 -FinalityTagEnabled = false +FinalityTagEnabled = true FlagsContractAddress = '0xae4E781a6218A8031764928E88d457937A954fC3' LinkContractAddress = '0x538aAaB4ea120b2bC2fe5D296852D948F07D849e' LogBackfillBatchSize = 17 @@ -287,9 +322,11 @@ MinContractPayment = '9.223372036854775807 link' NonceAutoSync = true NoNewHeadsThreshold = '1m0s' OperatorFactoryAddress = '0xa5B85635Be42F21f94F28034B7DA440EeFF0F418' +LogBroadcasterEnabled = true RPCDefaultBatchSize = 17 RPCBlockQueryDelay = 10 FinalizedBlockOffset = 0 +NoNewFinalizedHeadsThreshold = '15m0s' [EVM.Transactions] ForwardersEnabled = true @@ -314,6 +351,7 @@ LimitDefault = 12 LimitMax = 17 LimitMultiplier = '1.234' LimitTransfer = 100 +EstimateLimit = false BumpMin = '100 wei' BumpPercent = 10 BumpThreshold = 6 @@ -338,12 +376,16 @@ CheckInclusionPercentile = 19 EIP1559FeeCapBufferBlocks = 13 TransactionPercentile = 15 +[EVM.GasEstimator.FeeHistory] +CacheTimeout = '1s' + [EVM.HeadTracker] HistoryDepth = 15 MaxBufferSize = 17 SamplingInterval = '1h0m0s' MaxAllowedFinalityDepth = 10000 FinalityTagBypass = true +PersistenceEnabled = true [[EVM.KeySpecific]] Key = '0x2a3e23c6f242F5345320814aC8a1b4E58707D292' @@ -361,6 +403,7 @@ NodeIsSyncingEnabled = false FinalizedBlockPollInterval = '5s' EnforceRepeatableRead = false DeathDeclarationDelay = '10s' +NewHeadsPollInterval = '0s' [EVM.NodePool.Errors] NonceTooLow = '(: |^)nonce too low' @@ -377,6 +420,7 @@ L2Full = '(: |^)l2 full' TransactionAlreadyMined = '(: |^)transaction already mined' Fatal = '(: |^)fatal' ServiceUnavailable = '(: |^)service unavailable' +TooManyResults = '(: |^)too many results' [EVM.OCR] ContractConfirmations = 11 @@ -390,6 +434,9 @@ ObservationGracePeriod = '1s' [EVM.OCR2.Automation] GasLimit = 540 +[EVM.Workflow] +GasLimitDefault = 400000 + [[EVM.Nodes]] Name = 'foo' WSURL = 'wss://web.socket/test/foo' @@ -451,18 +498,22 @@ ComputeUnitPriceMin = 0 ComputeUnitPriceDefault = 0 FeeBumpPeriod = '3s' BlockHistoryPollPeriod = '5s' +ComputeUnitLimitDefault = 200000 [[Solana.Nodes]] Name = 'primary' URL = 'http://solana.web' +SendOnly = false [[Solana.Nodes]] Name = 'foo' URL = 'http://solana.foo' +SendOnly = false [[Solana.Nodes]] Name = 'bar' URL = 'http://solana.bar' +SendOnly = false [[Starknet]] ChainID = 'foobar' diff --git a/core/web/resolver/testdata/config-multi-chain-effective.toml b/core/web/resolver/testdata/config-multi-chain-effective.toml index f391804b7cd..303843cf8bf 100644 --- a/core/web/resolver/testdata/config-multi-chain-effective.toml +++ b/core/web/resolver/testdata/config-multi-chain-effective.toml @@ -6,6 +6,8 @@ ShutdownGracePeriod = '5s' FeedsManager = true LogPoller = false UICSAKeys = false +CCIP = true +MultiFeedsManagers = false [Database] DefaultIdleInTxSessionTimeout = '1h0m0s' @@ -33,7 +35,7 @@ LeaseDuration = '10s' LeaseRefreshInterval = '1s' [TelemetryIngress] -UniConn = true +UniConn = false Logging = false BufferSize = 100 MaxBatchSize = 50 @@ -251,18 +253,47 @@ DeltaDial = '15s' DeltaReconcile = '1m0s' ListenAddresses = [] +[Capabilities.Dispatcher] +SupportedVersion = 1 +ReceiverBufferSize = 10000 + +[Capabilities.Dispatcher.RateLimit] +GlobalRPS = 800.0 +GlobalBurst = 1000 +PerSenderRPS = 10.0 +PerSenderBurst = 50 + [Capabilities.ExternalRegistry] Address = '' NetworkID = 'evm' ChainID = '1' +[Capabilities.GatewayConnector] +ChainIDForNodeKey = '' +NodeAddress = '' +DonID = '' +WSHandshakeTimeoutMillis = 0 +AuthMinChallengeLen = 0 +AuthTimestampToleranceSec = 0 + +[[Capabilities.GatewayConnector.Gateways]] +ID = '' +URL = '' + +[Telemetry] +Enabled = false +CACertFile = '' +Endpoint = '' +InsecureConnection = false +TraceSampleRatio = 0.01 + [[EVM]] ChainID = '1' AutoCreateKey = true BlockBackfillDepth = 10 BlockBackfillSkip = false FinalityDepth = 26 -FinalityTagEnabled = false +FinalityTagEnabled = true LinkContractAddress = '0x514910771AF9Ca656af840dff83E8264EcF986CA' LogBackfillBatchSize = 1000 LogPollInterval = '15s' @@ -274,9 +305,11 @@ MinContractPayment = '0.1 link' NonceAutoSync = true NoNewHeadsThreshold = '3m0s' OperatorFactoryAddress = '0x3E64Cd889482443324F91bFA9c84fE72A511f48A' +LogBroadcasterEnabled = true RPCDefaultBatchSize = 250 RPCBlockQueryDelay = 1 FinalizedBlockOffset = 0 +NoNewFinalizedHeadsThreshold = '9m0s' [EVM.Transactions] ForwardersEnabled = false @@ -301,6 +334,7 @@ LimitDefault = 500000 LimitMax = 500000 LimitMultiplier = '1' LimitTransfer = 21000 +EstimateLimit = false BumpMin = '5 gwei' BumpPercent = 20 BumpThreshold = 3 @@ -316,12 +350,16 @@ CheckInclusionBlocks = 12 CheckInclusionPercentile = 90 TransactionPercentile = 50 +[EVM.GasEstimator.FeeHistory] +CacheTimeout = '10s' + [EVM.HeadTracker] HistoryDepth = 100 MaxBufferSize = 3 SamplingInterval = '1s' MaxAllowedFinalityDepth = 10000 FinalityTagBypass = true +PersistenceEnabled = true [EVM.NodePool] PollFailureThreshold = 5 @@ -333,6 +371,7 @@ NodeIsSyncingEnabled = false FinalizedBlockPollInterval = '5s' EnforceRepeatableRead = false DeathDeclarationDelay = '10s' +NewHeadsPollInterval = '0s' [EVM.OCR] ContractConfirmations = 4 @@ -346,6 +385,9 @@ ObservationGracePeriod = '1s' [EVM.OCR2.Automation] GasLimit = 10500000 +[EVM.Workflow] +GasLimitDefault = 400000 + [[EVM.Nodes]] Name = 'primary' WSURL = 'wss://web.socket/mainnet' @@ -373,9 +415,11 @@ MinContractPayment = '0.1 link' NonceAutoSync = true NoNewHeadsThreshold = '3m0s' OperatorFactoryAddress = '0x8007e24251b1D2Fc518Eb843A701d9cD21fe0aA3' +LogBroadcasterEnabled = true RPCDefaultBatchSize = 250 RPCBlockQueryDelay = 1 FinalizedBlockOffset = 0 +NoNewFinalizedHeadsThreshold = '0s' [EVM.Transactions] ForwardersEnabled = false @@ -400,6 +444,7 @@ LimitDefault = 500000 LimitMax = 500000 LimitMultiplier = '1' LimitTransfer = 21000 +EstimateLimit = false BumpMin = '5 gwei' BumpPercent = 20 BumpThreshold = 3 @@ -415,12 +460,16 @@ CheckInclusionBlocks = 12 CheckInclusionPercentile = 90 TransactionPercentile = 50 +[EVM.GasEstimator.FeeHistory] +CacheTimeout = '10s' + [EVM.HeadTracker] HistoryDepth = 100 MaxBufferSize = 3 SamplingInterval = '1s' MaxAllowedFinalityDepth = 10000 FinalityTagBypass = true +PersistenceEnabled = true [EVM.NodePool] PollFailureThreshold = 5 @@ -432,6 +481,7 @@ NodeIsSyncingEnabled = false FinalizedBlockPollInterval = '5s' EnforceRepeatableRead = false DeathDeclarationDelay = '10s' +NewHeadsPollInterval = '0s' [EVM.OCR] ContractConfirmations = 4 @@ -445,6 +495,9 @@ ObservationGracePeriod = '1s' [EVM.OCR2.Automation] GasLimit = 5400000 +[EVM.Workflow] +GasLimitDefault = 400000 + [[EVM.Nodes]] Name = 'foo' WSURL = 'wss://web.socket/test/foo' @@ -455,7 +508,7 @@ AutoCreateKey = true BlockBackfillDepth = 10 BlockBackfillSkip = false FinalityDepth = 500 -FinalityTagEnabled = false +FinalityTagEnabled = true LinkContractAddress = '0xb0897686c545045aFc77CF20eC7A532E3120E0F1' LogBackfillBatchSize = 1000 LogPollInterval = '1s' @@ -466,9 +519,11 @@ MinIncomingConfirmations = 5 MinContractPayment = '0.00001 link' NonceAutoSync = true NoNewHeadsThreshold = '30s' +LogBroadcasterEnabled = true RPCDefaultBatchSize = 100 RPCBlockQueryDelay = 10 FinalizedBlockOffset = 0 +NoNewFinalizedHeadsThreshold = '6m0s' [EVM.Transactions] ForwardersEnabled = false @@ -493,6 +548,7 @@ LimitDefault = 500000 LimitMax = 500000 LimitMultiplier = '1' LimitTransfer = 21000 +EstimateLimit = false BumpMin = '20 gwei' BumpPercent = 20 BumpThreshold = 5 @@ -508,12 +564,16 @@ CheckInclusionBlocks = 12 CheckInclusionPercentile = 90 TransactionPercentile = 60 +[EVM.GasEstimator.FeeHistory] +CacheTimeout = '10s' + [EVM.HeadTracker] HistoryDepth = 2000 MaxBufferSize = 3 SamplingInterval = '1s' MaxAllowedFinalityDepth = 10000 FinalityTagBypass = true +PersistenceEnabled = true [EVM.NodePool] PollFailureThreshold = 5 @@ -525,6 +585,7 @@ NodeIsSyncingEnabled = false FinalizedBlockPollInterval = '5s' EnforceRepeatableRead = false DeathDeclarationDelay = '10s' +NewHeadsPollInterval = '0s' [EVM.OCR] ContractConfirmations = 4 @@ -538,6 +599,9 @@ ObservationGracePeriod = '1s' [EVM.OCR2.Automation] GasLimit = 5400000 +[EVM.Workflow] +GasLimitDefault = 400000 + [[EVM.Nodes]] Name = 'bar' WSURL = 'wss://web.socket/test/bar' @@ -596,10 +660,12 @@ ComputeUnitPriceMin = 0 ComputeUnitPriceDefault = 0 FeeBumpPeriod = '3s' BlockHistoryPollPeriod = '5s' +ComputeUnitLimitDefault = 200000 [[Solana.Nodes]] Name = 'primary' URL = 'http://mainnet.solana.com' +SendOnly = false [[Solana]] ChainID = 'testnet' @@ -619,10 +685,12 @@ ComputeUnitPriceMin = 0 ComputeUnitPriceDefault = 0 FeeBumpPeriod = '3s' BlockHistoryPollPeriod = '5s' +ComputeUnitLimitDefault = 200000 [[Solana.Nodes]] Name = 'secondary' URL = 'http://testnet.solana.com' +SendOnly = false [[Starknet]] ChainID = 'foobar' diff --git a/core/web/resolver/testdata/config-multi-chain.toml b/core/web/resolver/testdata/config-multi-chain.toml index 9abb1719402..7d72ef55de7 100644 --- a/core/web/resolver/testdata/config-multi-chain.toml +++ b/core/web/resolver/testdata/config-multi-chain.toml @@ -38,7 +38,7 @@ CPUProfileRate = 7 [[EVM]] ChainID = '1' FinalityDepth = 26 -FinalityTagEnabled = false +FinalityTagEnabled = true FinalizedBlockOffset = 0 [EVM.OCR2] @@ -101,6 +101,7 @@ MaxRetries = 12 [[Solana.Nodes]] Name = 'primary' URL = 'http://mainnet.solana.com' +SendOnly = false [[Solana]] ChainID = 'testnet' @@ -109,6 +110,7 @@ OCR2CachePollPeriod = '1m0s' [[Solana.Nodes]] Name = 'secondary' URL = 'http://testnet.solana.com' +SendOnly = false [[Starknet]] ChainID = 'foobar' diff --git a/core/web/schema/type/features.graphql b/core/web/schema/type/features.graphql index 4254bdecb6c..ff434ab4bdc 100644 --- a/core/web/schema/type/features.graphql +++ b/core/web/schema/type/features.graphql @@ -1,6 +1,7 @@ type Features { csa: Boolean! feedsManager: Boolean! + multiFeedsManagers: Boolean! } # FeaturesPayload defines the response of fetching the features availability in the UI diff --git a/core/web/schema/type/feeds_manager.graphql b/core/web/schema/type/feeds_manager.graphql index 12e8732c8e0..9da8f64e1c2 100644 --- a/core/web/schema/type/feeds_manager.graphql +++ b/core/web/schema/type/feeds_manager.graphql @@ -77,6 +77,13 @@ type CreateFeedsManagerSuccess { feedsManager: FeedsManager! } +type DuplicateFeedsManagerError implements Error { + message: String! + code: ErrorCode! +} + +# DEPRECATED: No longer used since we now support multiple feeds manager. +# Keeping this to avoid breaking change. type SingleFeedsManagerError implements Error { message: String! code: ErrorCode! @@ -84,7 +91,8 @@ type SingleFeedsManagerError implements Error { # CreateFeedsManagerPayload defines the response when creating a feeds manager union CreateFeedsManagerPayload = CreateFeedsManagerSuccess - | SingleFeedsManagerError + | DuplicateFeedsManagerError + | SingleFeedsManagerError # // TODO: delete once multiple feeds managers support is released | NotFoundError | InputErrors diff --git a/core/web/solana_chains_controller_test.go b/core/web/solana_chains_controller_test.go index 048a3790b1a..3f64431b049 100644 --- a/core/web/solana_chains_controller_test.go +++ b/core/web/solana_chains_controller_test.go @@ -58,6 +58,7 @@ ComputeUnitPriceMin = 0 ComputeUnitPriceDefault = 0 FeeBumpPeriod = '3s' BlockHistoryPollPeriod = '5s' +ComputeUnitLimitDefault = 200000 Nodes = [] `, } diff --git a/core/web/testdata/body/health-failing.html b/core/web/testdata/body/health-failing.html new file mode 100644 index 00000000000..6b667a3ba69 --- /dev/null +++ b/core/web/testdata/body/health-failing.html @@ -0,0 +1,47 @@ + +
+ EVM +
+ 0 +
+ HeadTracker +
+ HeadListener +
Listener is not connected
+
+
+
+
diff --git a/core/web/testdata/body/health-failing.json b/core/web/testdata/body/health-failing.json new file mode 100644 index 00000000000..185b98b8da5 --- /dev/null +++ b/core/web/testdata/body/health-failing.json @@ -0,0 +1 @@ +{"data":[{"type":"checks","id":"EVM.0.HeadTracker.HeadListener","attributes":{"name":"EVM.0.HeadTracker.HeadListener","status":"failing","output":"Listener is not connected"}}]} diff --git a/core/web/testdata/body/health-failing.txt b/core/web/testdata/body/health-failing.txt new file mode 100644 index 00000000000..c6b948c3f93 --- /dev/null +++ b/core/web/testdata/body/health-failing.txt @@ -0,0 +1,2 @@ +! EVM.0.HeadTracker.HeadListener + Listener is not connected diff --git a/core/web/testdata/body/health.html b/core/web/testdata/body/health.html index 2a1b2227530..d2b6db906b4 100644 --- a/core/web/testdata/body/health.html +++ b/core/web/testdata/body/health.html @@ -63,12 +63,18 @@
Confirmer
+
+ Finalizer +
WrappedEvmEstimator
+
+ HeadReporter +
JobSpawner
@@ -96,9 +102,6 @@ BridgeCache -
- PromReporter -
TelemetryManager
diff --git a/core/web/testdata/body/health.json b/core/web/testdata/body/health.json index 10415c0abdc..81ed7ff6d11 100644 --- a/core/web/testdata/body/health.json +++ b/core/web/testdata/body/health.json @@ -90,6 +90,15 @@ "output": "" } }, + { + "type": "checks", + "id": "EVM.0.Txm.Finalizer", + "attributes": { + "name": "EVM.0.Txm.Finalizer", + "status": "passing", + "output": "" + } + }, { "type": "checks", "id": "EVM.0.Txm.WrappedEvmEstimator", @@ -99,6 +108,15 @@ "output": "" } }, + { + "type": "checks", + "id": "HeadReporter", + "attributes": { + "name": "HeadReporter", + "status": "passing", + "output": "" + } + }, { "type": "checks", "id": "JobSpawner", @@ -162,15 +180,6 @@ "output": "" } }, - { - "type": "checks", - "id": "PromReporter", - "attributes": { - "name": "PromReporter", - "status": "passing", - "output": "" - } - }, { "type": "checks", "id": "TelemetryManager", diff --git a/core/web/testdata/body/health.txt b/core/web/testdata/body/health.txt index 09c8cff6c2d..6b165d26d99 100644 --- a/core/web/testdata/body/health.txt +++ b/core/web/testdata/body/health.txt @@ -9,7 +9,9 @@ ok EVM.0.Txm ok EVM.0.Txm.BlockHistoryEstimator ok EVM.0.Txm.Broadcaster ok EVM.0.Txm.Confirmer +ok EVM.0.Txm.Finalizer ok EVM.0.Txm.WrappedEvmEstimator +ok HeadReporter ok JobSpawner ok Mailbox.Monitor ok Mercury.WSRPCPool @@ -17,5 +19,4 @@ ok Mercury.WSRPCPool.CacheSet ok PipelineORM ok PipelineRunner ok PipelineRunner.BridgeCache -ok PromReporter ok TelemetryManager diff --git a/core/web/testutils/mock_relayer.go b/core/web/testutils/mock_relayer.go index 4c2e5661afa..4666f9da6a4 100644 --- a/core/web/testutils/mock_relayer.go +++ b/core/web/testutils/mock_relayer.go @@ -8,6 +8,7 @@ import ( ) type MockRelayer struct { + Head commontypes.Head ChainStatus commontypes.ChainStatus NodeStatuses []commontypes.NodeStatus } @@ -40,6 +41,10 @@ func (m MockRelayer) NewContractReader(_ context.Context, _ []byte) (commontypes panic("not implemented") } +func (m MockRelayer) LatestHead(_ context.Context) (commontypes.Head, error) { + return m.Head, nil +} + func (m MockRelayer) GetChainStatus(ctx context.Context) (commontypes.ChainStatus, error) { return m.ChainStatus, nil } diff --git a/dashboard-lib/atlas-don/component.go b/dashboard-lib/atlas-don/component.go index 39218c7aea8..beda6f48ec4 100644 --- a/dashboard-lib/atlas-don/component.go +++ b/dashboard-lib/atlas-don/component.go @@ -2,6 +2,7 @@ package atlas_don import ( "fmt" + "github.com/K-Phoen/grabana/dashboard" "github.com/K-Phoen/grabana/row" "github.com/K-Phoen/grabana/stat" diff --git a/dashboard-lib/ccip-load-test-view/component.go b/dashboard-lib/ccip-load-test-view/component.go index 9f58438410e..790ea6e9a9d 100644 --- a/dashboard-lib/ccip-load-test-view/component.go +++ b/dashboard-lib/ccip-load-test-view/component.go @@ -3,6 +3,7 @@ package ccip_load_test_view import ( "encoding/json" "fmt" + "github.com/K-Phoen/grabana/dashboard" "github.com/K-Phoen/grabana/logs" "github.com/K-Phoen/grabana/row" diff --git a/dashboard-lib/config.go b/dashboard-lib/config.go index 2e0b9cad993..386082dae01 100644 --- a/dashboard-lib/config.go +++ b/dashboard-lib/config.go @@ -2,9 +2,10 @@ package dashboard_lib import ( "encoding/base64" - "github.com/pkg/errors" "os" "strings" + + "github.com/pkg/errors" ) type EnvConfig struct { diff --git a/dashboard-lib/core-don/component.go b/dashboard-lib/core-don/component.go index 24173fb6cc9..0589ab5cf8c 100644 --- a/dashboard-lib/core-don/component.go +++ b/dashboard-lib/core-don/component.go @@ -2,6 +2,7 @@ package core_don import ( "fmt" + "github.com/K-Phoen/grabana/dashboard" "github.com/K-Phoen/grabana/gauge" "github.com/K-Phoen/grabana/row" diff --git a/dashboard-lib/core-ocrv2-ccip/component.go b/dashboard-lib/core-ocrv2-ccip/component.go index 837f693fcc7..56b35587e18 100644 --- a/dashboard-lib/core-ocrv2-ccip/component.go +++ b/dashboard-lib/core-ocrv2-ccip/component.go @@ -2,6 +2,7 @@ package core_ocrv2_ccip import ( "fmt" + "github.com/K-Phoen/grabana/dashboard" "github.com/K-Phoen/grabana/row" "github.com/K-Phoen/grabana/target/prometheus" diff --git a/dashboard-lib/dashboard.go b/dashboard-lib/dashboard.go index 70892586bb0..92c4691a5ec 100644 --- a/dashboard-lib/dashboard.go +++ b/dashboard-lib/dashboard.go @@ -4,11 +4,12 @@ import ( "context" "encoding/json" "fmt" + "net/http" + "os" + "github.com/K-Phoen/grabana" "github.com/K-Phoen/grabana/dashboard" "github.com/pkg/errors" - "net/http" - "os" ) type Dashboard struct { diff --git a/dashboard-lib/go.mod b/dashboard-lib/go.mod index ecb33bbae30..0ab2b696dbc 100644 --- a/dashboard-lib/go.mod +++ b/dashboard-lib/go.mod @@ -1,6 +1,6 @@ module github.com/smartcontractkit/chainlink/dashboard-lib -go 1.21.7 +go 1.22.5 require ( github.com/K-Phoen/grabana v0.22.1 @@ -17,9 +17,11 @@ require ( github.com/gosimple/slug v1.13.1 // indirect github.com/gosimple/unidecode v1.0.1 // indirect github.com/mattn/go-colorable v0.1.13 // indirect - github.com/mattn/go-isatty v0.0.19 // indirect + github.com/mattn/go-isatty v0.0.20 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/prometheus/common v0.45.0 // indirect github.com/stretchr/testify v1.9.0 // indirect - golang.org/x/sys v0.16.0 // indirect + golang.org/x/sys v0.24.0 // indirect ) + +replace github.com/sourcegraph/sourcegraph/lib => github.com/sourcegraph/sourcegraph-public-snapshot/lib v0.0.0-20240822153003-c864f15af264 diff --git a/dashboard-lib/go.sum b/dashboard-lib/go.sum index 7eb74088f13..fd6985df0cb 100644 --- a/dashboard-lib/go.sum +++ b/dashboard-lib/go.sum @@ -15,8 +15,9 @@ github.com/grafana/grafana-foundation-sdk/go v0.0.0-20240314112857-a7c9c6d0044c/ github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA= github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= +github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= @@ -31,7 +32,7 @@ github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8 golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU= -golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= +golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/docs/CONFIG.md b/docs/CONFIG.md index 4efbc70d0e8..b7bc07b34fa 100644 --- a/docs/CONFIG.md +++ b/docs/CONFIG.md @@ -51,6 +51,8 @@ ShutdownGracePeriod is the maximum time allowed to shut down gracefully. If exce FeedsManager = true # Default LogPoller = false # Default UICSAKeys = false # Default +CCIP = true # Default +MultiFeedsManagers = false # Default ``` @@ -72,6 +74,18 @@ UICSAKeys = false # Default ``` UICSAKeys enables CSA Keys in the UI. +### CCIP +```toml +CCIP = true # Default +``` +CCIP enables the CCIP service. + +### MultiFeedsManagers +```toml +MultiFeedsManagers = false # Default +``` +MultiFeedsManagers enables support for multiple feeds manager connections. + ## Database ```toml [Database] @@ -242,7 +256,7 @@ LeaseRefreshInterval determines how often to refresh the lease lock. Also contro ## TelemetryIngress ```toml [TelemetryIngress] -UniConn = true # Default +UniConn = false # Default Logging = false # Default BufferSize = 100 # Default MaxBatchSize = 50 # Default @@ -254,7 +268,7 @@ UseBatchSend = true # Default ### UniConn ```toml -UniConn = true # Default +UniConn = false # Default ``` UniConn toggles which ws connection style is used. @@ -1226,6 +1240,60 @@ ChainID = '1' # Default ``` ChainID identifies the target chain id where the remote registry is located. +## Capabilities.Dispatcher +```toml +[Capabilities.Dispatcher] +SupportedVersion = 1 # Default +ReceiverBufferSize = 10000 # Default +``` + + +### SupportedVersion +```toml +SupportedVersion = 1 # Default +``` +SupportedVersion is the version of the version of message schema. + +### ReceiverBufferSize +```toml +ReceiverBufferSize = 10000 # Default +``` +ReceiverBufferSize is the size of the buffer for incoming messages. + +## Capabilities.Dispatcher.RateLimit +```toml +[Capabilities.Dispatcher.RateLimit] +GlobalRPS = 800 # Default +GlobalBurst = 1000 # Default +PerSenderRPS = 10 # Default +PerSenderBurst = 50 # Default +``` + + +### GlobalRPS +```toml +GlobalRPS = 800 # Default +``` +GlobalRPS is the global rate limit for the dispatcher. + +### GlobalBurst +```toml +GlobalBurst = 1000 # Default +``` +GlobalBurst is the global burst limit for the dispatcher. + +### PerSenderRPS +```toml +PerSenderRPS = 10 # Default +``` +PerSenderRPS is the per-sender rate limit for the dispatcher. + +### PerSenderBurst +```toml +PerSenderBurst = 50 # Default +``` +PerSenderBurst is the per-sender burst limit for the dispatcher. + ## Capabilities.Peering ```toml [Capabilities.Peering] @@ -1325,6 +1393,74 @@ ListenAddresses = ['1.2.3.4:9999', '[a52d:0:a88:1274::abcd]:1337'] # Example ListenAddresses is the addresses the peer will listen to on the network in `host:port` form as accepted by `net.Listen()`, but the host and port must be fully specified and cannot be empty. You can specify `0.0.0.0` (IPv4) or `::` (IPv6) to listen on all interfaces, but that is not recommended. +## Capabilities.GatewayConnector +```toml +[Capabilities.GatewayConnector] +ChainIDForNodeKey = '11155111' # Example +NodeAddress = '0x68902d681c28119f9b2531473a417088bf008e59' # Example +DonID = 'example_don' # Example +WSHandshakeTimeoutMillis = 1000 # Example +AuthMinChallengeLen = 10 # Example +AuthTimestampToleranceSec = 10 # Example +``` + + +### ChainIDForNodeKey +```toml +ChainIDForNodeKey = '11155111' # Example +``` +ChainIDForNodeKey is the ChainID of the network associated with a private key to be used for authentication with Gateway nodes + +### NodeAddress +```toml +NodeAddress = '0x68902d681c28119f9b2531473a417088bf008e59' # Example +``` +NodeAddress is the address of the desired private key to be used for authentication with Gateway nodes + +### DonID +```toml +DonID = 'example_don' # Example +``` +DonID is the Id of the Don + +### WSHandshakeTimeoutMillis +```toml +WSHandshakeTimeoutMillis = 1000 # Example +``` +WSHandshakeTimeoutMillis is Websocket handshake timeout + +### AuthMinChallengeLen +```toml +AuthMinChallengeLen = 10 # Example +``` +AuthMinChallengeLen is the minimum number of bytes in authentication challenge payload + +### AuthTimestampToleranceSec +```toml +AuthTimestampToleranceSec = 10 # Example +``` +AuthTimestampToleranceSec is Authentication timestamp tolerance + +## Capabilities.GatewayConnector.Gateways +```toml +[[Capabilities.GatewayConnector.Gateways]] +ID = 'example_gateway' # Example +URL = 'wss://localhost:8081/node' # Example +``` + + +### ID +```toml +ID = 'example_gateway' # Example +``` +ID of the Gateway + +### URL +```toml +URL = 'wss://localhost:8081/node' # Example +``` +URL of the Gateway + ## Keeper ```toml [Keeper] @@ -1761,6 +1897,64 @@ TransmitTimeout controls how long the transmitter will wait for a response when sending a message to the mercury server, before aborting and considering the transmission to be failed. +## Telemetry +```toml +[Telemetry] +Enabled = false # Default +Endpoint = 'example.com/collector' # Example +CACertFile = 'cert-file' # Example +InsecureConnection = false # Default +TraceSampleRatio = 0.01 # Default +``` +Telemetry holds OTEL settings. +This data includes open telemetry metrics, traces, & logs. +It does not currently include prometheus metrics or standard out logs, but may in the future. + +### Enabled +```toml +Enabled = false # Default +``` +Enabled turns telemetry collection on or off. + +### Endpoint +```toml +Endpoint = 'example.com/collector' # Example +``` +Endpoint of the OTEL Collector. + +### CACertFile +```toml +CACertFile = 'cert-file' # Example +``` +CACertFile is the file path of the TLS certificate used for secure communication with the OTEL Collector. +Required unless InescureConnection is true. + +### InsecureConnection +```toml +InsecureConnection = false # Default +``` +InsecureConnection bypasses the TLS CACertFile requirement and uses an insecure connection instead. +Only available in dev mode. + +### TraceSampleRatio +```toml +TraceSampleRatio = 0.01 # Default +``` +TraceSampleRatio is the rate at which to sample traces. Must be between 0 and 1. + +## Telemetry.ResourceAttributes +```toml +[Telemetry.ResourceAttributes] +foo = "bar" # Example +``` +ResourceAttributes are global metadata to include with all telemetry. + +### foo +```toml +foo = "bar" # Example +``` +foo is an example resource attribute + ## EVM EVM defaults depend on ChainID: @@ -1771,7 +1965,7 @@ AutoCreateKey = true BlockBackfillDepth = 10 BlockBackfillSkip = false FinalityDepth = 50 -FinalityTagEnabled = false +FinalityTagEnabled = true LinkContractAddress = '0x514910771AF9Ca656af840dff83E8264EcF986CA' LogBackfillBatchSize = 1000 LogPollInterval = '15s' @@ -1783,9 +1977,11 @@ MinContractPayment = '0.1 link' NonceAutoSync = true NoNewHeadsThreshold = '3m0s' OperatorFactoryAddress = '0x3E64Cd889482443324F91bFA9c84fE72A511f48A' +LogBroadcasterEnabled = true RPCDefaultBatchSize = 250 RPCBlockQueryDelay = 1 FinalizedBlockOffset = 0 +NoNewFinalizedHeadsThreshold = '9m0s' [Transactions] ForwardersEnabled = false @@ -1810,6 +2006,7 @@ LimitDefault = 500000 LimitMax = 500000 LimitMultiplier = '1' LimitTransfer = 21000 +EstimateLimit = false BumpMin = '5 gwei' BumpPercent = 20 BumpThreshold = 3 @@ -1825,12 +2022,16 @@ CheckInclusionBlocks = 12 CheckInclusionPercentile = 90 TransactionPercentile = 50 +[GasEstimator.FeeHistory] +CacheTimeout = '10s' + [HeadTracker] HistoryDepth = 100 MaxBufferSize = 3 SamplingInterval = '1s' MaxAllowedFinalityDepth = 10000 FinalityTagBypass = true +PersistenceEnabled = true [NodePool] PollFailureThreshold = 5 @@ -1842,6 +2043,7 @@ NodeIsSyncingEnabled = false FinalizedBlockPollInterval = '5s' EnforceRepeatableRead = false DeathDeclarationDelay = '10s' +NewHeadsPollInterval = '0s' [OCR] ContractConfirmations = 4 @@ -1854,6 +2056,9 @@ ObservationGracePeriod = '1s' [OCR2] [OCR2.Automation] GasLimit = 10500000 + +[Workflow] +GasLimitDefault = 400000 ```

@@ -1876,9 +2081,11 @@ MinIncomingConfirmations = 3 MinContractPayment = '0.1 link' NonceAutoSync = true NoNewHeadsThreshold = '3m0s' +LogBroadcasterEnabled = true RPCDefaultBatchSize = 250 RPCBlockQueryDelay = 1 FinalizedBlockOffset = 0 +NoNewFinalizedHeadsThreshold = '0s' [Transactions] ForwardersEnabled = false @@ -1903,6 +2110,7 @@ LimitDefault = 500000 LimitMax = 500000 LimitMultiplier = '1' LimitTransfer = 21000 +EstimateLimit = false BumpMin = '5 gwei' BumpPercent = 20 BumpThreshold = 3 @@ -1918,12 +2126,16 @@ CheckInclusionBlocks = 12 CheckInclusionPercentile = 90 TransactionPercentile = 50 +[GasEstimator.FeeHistory] +CacheTimeout = '10s' + [HeadTracker] HistoryDepth = 100 MaxBufferSize = 3 SamplingInterval = '1s' MaxAllowedFinalityDepth = 10000 FinalityTagBypass = true +PersistenceEnabled = true [NodePool] PollFailureThreshold = 5 @@ -1935,6 +2147,7 @@ NodeIsSyncingEnabled = false FinalizedBlockPollInterval = '5s' EnforceRepeatableRead = false DeathDeclarationDelay = '10s' +NewHeadsPollInterval = '0s' [OCR] ContractConfirmations = 4 @@ -1947,6 +2160,9 @@ ObservationGracePeriod = '1s' [OCR2] [OCR2.Automation] GasLimit = 5400000 + +[Workflow] +GasLimitDefault = 400000 ```

@@ -1969,9 +2185,11 @@ MinIncomingConfirmations = 3 MinContractPayment = '0.1 link' NonceAutoSync = true NoNewHeadsThreshold = '3m0s' +LogBroadcasterEnabled = true RPCDefaultBatchSize = 250 RPCBlockQueryDelay = 1 FinalizedBlockOffset = 0 +NoNewFinalizedHeadsThreshold = '0s' [Transactions] ForwardersEnabled = false @@ -1996,6 +2214,7 @@ LimitDefault = 500000 LimitMax = 500000 LimitMultiplier = '1' LimitTransfer = 21000 +EstimateLimit = false BumpMin = '5 gwei' BumpPercent = 20 BumpThreshold = 3 @@ -2011,12 +2230,16 @@ CheckInclusionBlocks = 12 CheckInclusionPercentile = 90 TransactionPercentile = 50 +[GasEstimator.FeeHistory] +CacheTimeout = '10s' + [HeadTracker] HistoryDepth = 100 MaxBufferSize = 3 SamplingInterval = '1s' MaxAllowedFinalityDepth = 10000 FinalityTagBypass = true +PersistenceEnabled = true [NodePool] PollFailureThreshold = 5 @@ -2028,6 +2251,7 @@ NodeIsSyncingEnabled = false FinalizedBlockPollInterval = '5s' EnforceRepeatableRead = false DeathDeclarationDelay = '10s' +NewHeadsPollInterval = '0s' [OCR] ContractConfirmations = 4 @@ -2040,6 +2264,9 @@ ObservationGracePeriod = '1s' [OCR2] [OCR2.Automation] GasLimit = 5400000 + +[Workflow] +GasLimitDefault = 400000 ```

@@ -2062,9 +2289,11 @@ MinIncomingConfirmations = 3 MinContractPayment = '0.1 link' NonceAutoSync = true NoNewHeadsThreshold = '3m0s' +LogBroadcasterEnabled = true RPCDefaultBatchSize = 250 RPCBlockQueryDelay = 1 FinalizedBlockOffset = 0 +NoNewFinalizedHeadsThreshold = '0s' [Transactions] ForwardersEnabled = false @@ -2089,6 +2318,7 @@ LimitDefault = 500000 LimitMax = 500000 LimitMultiplier = '1' LimitTransfer = 21000 +EstimateLimit = false BumpMin = '5 gwei' BumpPercent = 20 BumpThreshold = 3 @@ -2104,12 +2334,16 @@ CheckInclusionBlocks = 12 CheckInclusionPercentile = 90 TransactionPercentile = 50 +[GasEstimator.FeeHistory] +CacheTimeout = '10s' + [HeadTracker] HistoryDepth = 100 MaxBufferSize = 3 SamplingInterval = '1s' MaxAllowedFinalityDepth = 10000 FinalityTagBypass = true +PersistenceEnabled = true [NodePool] PollFailureThreshold = 5 @@ -2121,6 +2355,7 @@ NodeIsSyncingEnabled = false FinalizedBlockPollInterval = '5s' EnforceRepeatableRead = false DeathDeclarationDelay = '10s' +NewHeadsPollInterval = '0s' [OCR] ContractConfirmations = 4 @@ -2133,6 +2368,9 @@ ObservationGracePeriod = '1s' [OCR2] [OCR2.Automation] GasLimit = 5400000 + +[Workflow] +GasLimitDefault = 400000 ```

@@ -2145,7 +2383,7 @@ BlockBackfillDepth = 10 BlockBackfillSkip = false ChainType = 'optimismBedrock' FinalityDepth = 200 -FinalityTagEnabled = false +FinalityTagEnabled = true LinkContractAddress = '0x350a791Bfc2C21F9Ed5d10980Dad2e2638ffa7f6' LogBackfillBatchSize = 1000 LogPollInterval = '2s' @@ -2156,9 +2394,11 @@ MinIncomingConfirmations = 1 MinContractPayment = '0.00001 link' NonceAutoSync = true NoNewHeadsThreshold = '40s' +LogBroadcasterEnabled = true RPCDefaultBatchSize = 250 RPCBlockQueryDelay = 1 FinalizedBlockOffset = 0 +NoNewFinalizedHeadsThreshold = '13m0s' [Transactions] ForwardersEnabled = false @@ -2183,6 +2423,7 @@ LimitDefault = 500000 LimitMax = 500000 LimitMultiplier = '1' LimitTransfer = 21000 +EstimateLimit = false BumpMin = '100 wei' BumpPercent = 20 BumpThreshold = 3 @@ -2198,12 +2439,16 @@ CheckInclusionBlocks = 12 CheckInclusionPercentile = 90 TransactionPercentile = 60 +[GasEstimator.FeeHistory] +CacheTimeout = '10s' + [HeadTracker] HistoryDepth = 300 MaxBufferSize = 3 SamplingInterval = '1s' MaxAllowedFinalityDepth = 10000 FinalityTagBypass = true +PersistenceEnabled = true [NodePool] PollFailureThreshold = 5 @@ -2215,6 +2460,7 @@ NodeIsSyncingEnabled = false FinalizedBlockPollInterval = '5s' EnforceRepeatableRead = false DeathDeclarationDelay = '10s' +NewHeadsPollInterval = '0s' [OCR] ContractConfirmations = 1 @@ -2227,6 +2473,9 @@ ObservationGracePeriod = '1s' [OCR2] [OCR2.Automation] GasLimit = 6500000 + +[Workflow] +GasLimitDefault = 400000 ```

@@ -2249,9 +2498,11 @@ MinIncomingConfirmations = 3 MinContractPayment = '0.001 link' NonceAutoSync = true NoNewHeadsThreshold = '3m0s' +LogBroadcasterEnabled = true RPCDefaultBatchSize = 250 RPCBlockQueryDelay = 1 FinalizedBlockOffset = 0 +NoNewFinalizedHeadsThreshold = '0s' [Transactions] ForwardersEnabled = false @@ -2276,6 +2527,7 @@ LimitDefault = 500000 LimitMax = 500000 LimitMultiplier = '1' LimitTransfer = 21000 +EstimateLimit = false BumpMin = '5 gwei' BumpPercent = 20 BumpThreshold = 3 @@ -2291,12 +2543,16 @@ CheckInclusionBlocks = 12 CheckInclusionPercentile = 90 TransactionPercentile = 60 +[GasEstimator.FeeHistory] +CacheTimeout = '10s' + [HeadTracker] HistoryDepth = 100 MaxBufferSize = 3 SamplingInterval = '1s' MaxAllowedFinalityDepth = 10000 FinalityTagBypass = true +PersistenceEnabled = true [NodePool] PollFailureThreshold = 5 @@ -2308,6 +2564,7 @@ NodeIsSyncingEnabled = false FinalizedBlockPollInterval = '5s' EnforceRepeatableRead = false DeathDeclarationDelay = '10s' +NewHeadsPollInterval = '0s' [OCR] ContractConfirmations = 4 @@ -2320,6 +2577,9 @@ ObservationGracePeriod = '1s' [OCR2] [OCR2.Automation] GasLimit = 5400000 + +[Workflow] +GasLimitDefault = 400000 ```

@@ -2342,9 +2602,11 @@ MinIncomingConfirmations = 3 MinContractPayment = '0.001 link' NonceAutoSync = true NoNewHeadsThreshold = '3m0s' +LogBroadcasterEnabled = true RPCDefaultBatchSize = 250 RPCBlockQueryDelay = 1 FinalizedBlockOffset = 0 +NoNewFinalizedHeadsThreshold = '0s' [Transactions] ForwardersEnabled = false @@ -2369,6 +2631,7 @@ LimitDefault = 500000 LimitMax = 500000 LimitMultiplier = '1' LimitTransfer = 21000 +EstimateLimit = false BumpMin = '5 gwei' BumpPercent = 20 BumpThreshold = 3 @@ -2384,12 +2647,16 @@ CheckInclusionBlocks = 12 CheckInclusionPercentile = 90 TransactionPercentile = 60 +[GasEstimator.FeeHistory] +CacheTimeout = '10s' + [HeadTracker] HistoryDepth = 100 MaxBufferSize = 3 SamplingInterval = '1s' MaxAllowedFinalityDepth = 10000 FinalityTagBypass = true +PersistenceEnabled = true [NodePool] PollFailureThreshold = 5 @@ -2401,6 +2668,7 @@ NodeIsSyncingEnabled = false FinalizedBlockPollInterval = '5s' EnforceRepeatableRead = false DeathDeclarationDelay = '10s' +NewHeadsPollInterval = '0s' [OCR] ContractConfirmations = 4 @@ -2413,6 +2681,9 @@ ObservationGracePeriod = '1s' [OCR2] [OCR2.Automation] GasLimit = 5400000 + +[Workflow] +GasLimitDefault = 400000 ```

@@ -2436,9 +2707,11 @@ MinContractPayment = '0.1 link' NonceAutoSync = true NoNewHeadsThreshold = '3m0s' OperatorFactoryAddress = '0x8007e24251b1D2Fc518Eb843A701d9cD21fe0aA3' +LogBroadcasterEnabled = true RPCDefaultBatchSize = 250 RPCBlockQueryDelay = 1 FinalizedBlockOffset = 0 +NoNewFinalizedHeadsThreshold = '0s' [Transactions] ForwardersEnabled = false @@ -2463,6 +2736,7 @@ LimitDefault = 500000 LimitMax = 500000 LimitMultiplier = '1' LimitTransfer = 21000 +EstimateLimit = false BumpMin = '5 gwei' BumpPercent = 20 BumpThreshold = 3 @@ -2478,12 +2752,16 @@ CheckInclusionBlocks = 12 CheckInclusionPercentile = 90 TransactionPercentile = 50 +[GasEstimator.FeeHistory] +CacheTimeout = '10s' + [HeadTracker] HistoryDepth = 100 MaxBufferSize = 3 SamplingInterval = '1s' MaxAllowedFinalityDepth = 10000 FinalityTagBypass = true +PersistenceEnabled = true [NodePool] PollFailureThreshold = 5 @@ -2495,6 +2773,7 @@ NodeIsSyncingEnabled = false FinalizedBlockPollInterval = '5s' EnforceRepeatableRead = false DeathDeclarationDelay = '10s' +NewHeadsPollInterval = '0s' [OCR] ContractConfirmations = 4 @@ -2507,6 +2786,9 @@ ObservationGracePeriod = '1s' [OCR2] [OCR2.Automation] GasLimit = 5400000 + +[Workflow] +GasLimitDefault = 400000 ```

@@ -2518,7 +2800,7 @@ AutoCreateKey = true BlockBackfillDepth = 10 BlockBackfillSkip = false FinalityDepth = 50 -FinalityTagEnabled = false +FinalityTagEnabled = true LinkContractAddress = '0x404460C6A5EdE2D891e8297795264fDe62ADBB75' LogBackfillBatchSize = 1000 LogPollInterval = '3s' @@ -2529,9 +2811,11 @@ MinIncomingConfirmations = 3 MinContractPayment = '0.00001 link' NonceAutoSync = true NoNewHeadsThreshold = '30s' +LogBroadcasterEnabled = true RPCDefaultBatchSize = 250 RPCBlockQueryDelay = 2 FinalizedBlockOffset = 0 +NoNewFinalizedHeadsThreshold = '45s' [Transactions] ForwardersEnabled = false @@ -2551,11 +2835,12 @@ Enabled = true Mode = 'BlockHistory' PriceDefault = '5 gwei' PriceMax = '115792089237316195423570985008687907853269984665.640564039457584007913129639935 tether' -PriceMin = '1 gwei' +PriceMin = '3 gwei' LimitDefault = 500000 LimitMax = 500000 LimitMultiplier = '1' LimitTransfer = 21000 +EstimateLimit = false BumpMin = '5 gwei' BumpPercent = 20 BumpThreshold = 5 @@ -2571,12 +2856,16 @@ CheckInclusionBlocks = 12 CheckInclusionPercentile = 90 TransactionPercentile = 60 +[GasEstimator.FeeHistory] +CacheTimeout = '10s' + [HeadTracker] HistoryDepth = 100 MaxBufferSize = 3 SamplingInterval = '1s' MaxAllowedFinalityDepth = 10000 FinalityTagBypass = true +PersistenceEnabled = true [NodePool] PollFailureThreshold = 5 @@ -2588,6 +2877,7 @@ NodeIsSyncingEnabled = false FinalizedBlockPollInterval = '5s' EnforceRepeatableRead = false DeathDeclarationDelay = '10s' +NewHeadsPollInterval = '0s' [OCR] ContractConfirmations = 4 @@ -2600,6 +2890,9 @@ ObservationGracePeriod = '500ms' [OCR2] [OCR2.Automation] GasLimit = 5400000 + +[Workflow] +GasLimitDefault = 400000 ```

@@ -2621,9 +2914,11 @@ MinIncomingConfirmations = 3 MinContractPayment = '0.00001 link' NonceAutoSync = true NoNewHeadsThreshold = '3m0s' +LogBroadcasterEnabled = true RPCDefaultBatchSize = 250 RPCBlockQueryDelay = 1 FinalizedBlockOffset = 0 +NoNewFinalizedHeadsThreshold = '0s' [Transactions] ForwardersEnabled = false @@ -2648,6 +2943,7 @@ LimitDefault = 500000 LimitMax = 500000 LimitMultiplier = '1' LimitTransfer = 21000 +EstimateLimit = false BumpMin = '5 gwei' BumpPercent = 20 BumpThreshold = 3 @@ -2663,12 +2959,16 @@ CheckInclusionBlocks = 12 CheckInclusionPercentile = 90 TransactionPercentile = 60 +[GasEstimator.FeeHistory] +CacheTimeout = '10s' + [HeadTracker] HistoryDepth = 100 MaxBufferSize = 3 SamplingInterval = '1s' MaxAllowedFinalityDepth = 10000 FinalityTagBypass = true +PersistenceEnabled = true [NodePool] PollFailureThreshold = 5 @@ -2680,6 +2980,7 @@ NodeIsSyncingEnabled = false FinalizedBlockPollInterval = '5s' EnforceRepeatableRead = false DeathDeclarationDelay = '10s' +NewHeadsPollInterval = '0s' [OCR] ContractConfirmations = 4 @@ -2692,6 +2993,9 @@ ObservationGracePeriod = '1s' [OCR2] [OCR2.Automation] GasLimit = 5400000 + +[Workflow] +GasLimitDefault = 400000 ```

@@ -2713,9 +3017,11 @@ MinIncomingConfirmations = 3 MinContractPayment = '0.00001 link' NonceAutoSync = true NoNewHeadsThreshold = '3m0s' +LogBroadcasterEnabled = true RPCDefaultBatchSize = 250 RPCBlockQueryDelay = 1 FinalizedBlockOffset = 0 +NoNewFinalizedHeadsThreshold = '0s' [Transactions] ForwardersEnabled = false @@ -2740,6 +3046,7 @@ LimitDefault = 500000 LimitMax = 500000 LimitMultiplier = '1' LimitTransfer = 21000 +EstimateLimit = false BumpMin = '5 gwei' BumpPercent = 20 BumpThreshold = 3 @@ -2755,12 +3062,16 @@ CheckInclusionBlocks = 12 CheckInclusionPercentile = 90 TransactionPercentile = 60 +[GasEstimator.FeeHistory] +CacheTimeout = '10s' + [HeadTracker] HistoryDepth = 100 MaxBufferSize = 3 SamplingInterval = '1s' MaxAllowedFinalityDepth = 10000 FinalityTagBypass = true +PersistenceEnabled = true [NodePool] PollFailureThreshold = 5 @@ -2772,6 +3083,7 @@ NodeIsSyncingEnabled = false FinalizedBlockPollInterval = '5s' EnforceRepeatableRead = false DeathDeclarationDelay = '10s' +NewHeadsPollInterval = '0s' [OCR] ContractConfirmations = 4 @@ -2784,6 +3096,9 @@ ObservationGracePeriod = '1s' [OCR2] [OCR2.Automation] GasLimit = 5400000 + +[Workflow] +GasLimitDefault = 400000 ```

@@ -2795,7 +3110,7 @@ AutoCreateKey = true BlockBackfillDepth = 10 BlockBackfillSkip = false FinalityDepth = 50 -FinalityTagEnabled = false +FinalityTagEnabled = true LinkContractAddress = '0x84b9B910527Ad5C03A9Ca831909E21e236EA7b06' LogBackfillBatchSize = 1000 LogPollInterval = '3s' @@ -2806,9 +3121,11 @@ MinIncomingConfirmations = 3 MinContractPayment = '0.00001 link' NonceAutoSync = true NoNewHeadsThreshold = '30s' +LogBroadcasterEnabled = true RPCDefaultBatchSize = 250 RPCBlockQueryDelay = 2 FinalizedBlockOffset = 0 +NoNewFinalizedHeadsThreshold = '40s' [Transactions] ForwardersEnabled = false @@ -2833,6 +3150,7 @@ LimitDefault = 500000 LimitMax = 500000 LimitMultiplier = '1' LimitTransfer = 21000 +EstimateLimit = false BumpMin = '5 gwei' BumpPercent = 20 BumpThreshold = 5 @@ -2848,12 +3166,16 @@ CheckInclusionBlocks = 12 CheckInclusionPercentile = 90 TransactionPercentile = 60 +[GasEstimator.FeeHistory] +CacheTimeout = '10s' + [HeadTracker] HistoryDepth = 100 MaxBufferSize = 3 SamplingInterval = '1s' MaxAllowedFinalityDepth = 10000 FinalityTagBypass = false +PersistenceEnabled = true [NodePool] PollFailureThreshold = 5 @@ -2865,6 +3187,7 @@ NodeIsSyncingEnabled = false FinalizedBlockPollInterval = '5s' EnforceRepeatableRead = false DeathDeclarationDelay = '10s' +NewHeadsPollInterval = '0s' [OCR] ContractConfirmations = 4 @@ -2877,6 +3200,9 @@ ObservationGracePeriod = '500ms' [OCR2] [OCR2.Automation] GasLimit = 5400000 + +[Workflow] +GasLimitDefault = 400000 ```

@@ -2900,9 +3226,11 @@ MinIncomingConfirmations = 3 MinContractPayment = '0.00001 link' NonceAutoSync = true NoNewHeadsThreshold = '3m0s' +LogBroadcasterEnabled = true RPCDefaultBatchSize = 250 RPCBlockQueryDelay = 1 FinalizedBlockOffset = 0 +NoNewFinalizedHeadsThreshold = '2m0s' [Transactions] ForwardersEnabled = false @@ -2927,6 +3255,7 @@ LimitDefault = 500000 LimitMax = 500000 LimitMultiplier = '1' LimitTransfer = 21000 +EstimateLimit = false BumpMin = '5 gwei' BumpPercent = 20 BumpThreshold = 3 @@ -2942,12 +3271,16 @@ CheckInclusionBlocks = 12 CheckInclusionPercentile = 90 TransactionPercentile = 60 +[GasEstimator.FeeHistory] +CacheTimeout = '10s' + [HeadTracker] HistoryDepth = 100 MaxBufferSize = 3 SamplingInterval = '1s' MaxAllowedFinalityDepth = 10000 FinalityTagBypass = true +PersistenceEnabled = true [NodePool] PollFailureThreshold = 5 @@ -2959,6 +3292,7 @@ NodeIsSyncingEnabled = false FinalizedBlockPollInterval = '5s' EnforceRepeatableRead = false DeathDeclarationDelay = '10s' +NewHeadsPollInterval = '0s' [OCR] ContractConfirmations = 4 @@ -2971,6 +3305,9 @@ ObservationGracePeriod = '1s' [OCR2] [OCR2.Automation] GasLimit = 5400000 + +[Workflow] +GasLimitDefault = 400000 ```

@@ -2993,9 +3330,11 @@ MinIncomingConfirmations = 3 MinContractPayment = '0.00001 link' NonceAutoSync = true NoNewHeadsThreshold = '30s' +LogBroadcasterEnabled = true RPCDefaultBatchSize = 250 RPCBlockQueryDelay = 2 FinalizedBlockOffset = 0 +NoNewFinalizedHeadsThreshold = '0s' [Transactions] ForwardersEnabled = false @@ -3020,6 +3359,7 @@ LimitDefault = 500000 LimitMax = 500000 LimitMultiplier = '1' LimitTransfer = 21000 +EstimateLimit = false BumpMin = '5 gwei' BumpPercent = 20 BumpThreshold = 5 @@ -3035,12 +3375,16 @@ CheckInclusionBlocks = 12 CheckInclusionPercentile = 90 TransactionPercentile = 60 +[GasEstimator.FeeHistory] +CacheTimeout = '10s' + [HeadTracker] HistoryDepth = 100 MaxBufferSize = 3 SamplingInterval = '1s' MaxAllowedFinalityDepth = 10000 FinalityTagBypass = true +PersistenceEnabled = true [NodePool] PollFailureThreshold = 5 @@ -3052,6 +3396,7 @@ NodeIsSyncingEnabled = false FinalizedBlockPollInterval = '5s' EnforceRepeatableRead = false DeathDeclarationDelay = '10s' +NewHeadsPollInterval = '0s' [OCR] ContractConfirmations = 4 @@ -3064,6 +3409,9 @@ ObservationGracePeriod = '500ms' [OCR2] [OCR2.Automation] GasLimit = 5400000 + +[Workflow] +GasLimitDefault = 400000 ```

@@ -3075,7 +3423,7 @@ AutoCreateKey = true BlockBackfillDepth = 10 BlockBackfillSkip = false FinalityDepth = 500 -FinalityTagEnabled = false +FinalityTagEnabled = true LinkContractAddress = '0xb0897686c545045aFc77CF20eC7A532E3120E0F1' LogBackfillBatchSize = 1000 LogPollInterval = '1s' @@ -3086,9 +3434,11 @@ MinIncomingConfirmations = 5 MinContractPayment = '0.00001 link' NonceAutoSync = true NoNewHeadsThreshold = '30s' +LogBroadcasterEnabled = true RPCDefaultBatchSize = 100 RPCBlockQueryDelay = 10 FinalizedBlockOffset = 0 +NoNewFinalizedHeadsThreshold = '6m0s' [Transactions] ForwardersEnabled = false @@ -3113,6 +3463,7 @@ LimitDefault = 500000 LimitMax = 500000 LimitMultiplier = '1' LimitTransfer = 21000 +EstimateLimit = false BumpMin = '20 gwei' BumpPercent = 20 BumpThreshold = 5 @@ -3128,12 +3479,16 @@ CheckInclusionBlocks = 12 CheckInclusionPercentile = 90 TransactionPercentile = 60 +[GasEstimator.FeeHistory] +CacheTimeout = '10s' + [HeadTracker] HistoryDepth = 2000 MaxBufferSize = 3 SamplingInterval = '1s' MaxAllowedFinalityDepth = 10000 FinalityTagBypass = true +PersistenceEnabled = true [NodePool] PollFailureThreshold = 5 @@ -3145,6 +3500,7 @@ NodeIsSyncingEnabled = false FinalizedBlockPollInterval = '5s' EnforceRepeatableRead = false DeathDeclarationDelay = '10s' +NewHeadsPollInterval = '0s' [OCR] ContractConfirmations = 4 @@ -3157,6 +3513,9 @@ ObservationGracePeriod = '1s' [OCR2] [OCR2.Automation] GasLimit = 5400000 + +[Workflow] +GasLimitDefault = 400000 ```

@@ -3179,9 +3538,11 @@ MinIncomingConfirmations = 1 MinContractPayment = '0.00001 link' NonceAutoSync = true NoNewHeadsThreshold = '12m0s' +LogBroadcasterEnabled = true RPCDefaultBatchSize = 100 RPCBlockQueryDelay = 15 FinalizedBlockOffset = 0 +NoNewFinalizedHeadsThreshold = '0s' [Transactions] ForwardersEnabled = false @@ -3206,6 +3567,7 @@ LimitDefault = 500000 LimitMax = 500000 LimitMultiplier = '1' LimitTransfer = 21000 +EstimateLimit = false BumpMin = '20 mwei' BumpPercent = 40 BumpThreshold = 3 @@ -3221,12 +3583,16 @@ CheckInclusionBlocks = 12 CheckInclusionPercentile = 90 TransactionPercentile = 60 +[GasEstimator.FeeHistory] +CacheTimeout = '10s' + [HeadTracker] HistoryDepth = 2000 MaxBufferSize = 3 SamplingInterval = '1s' MaxAllowedFinalityDepth = 10000 FinalityTagBypass = true +PersistenceEnabled = true [NodePool] PollFailureThreshold = 5 @@ -3238,6 +3604,7 @@ NodeIsSyncingEnabled = false FinalizedBlockPollInterval = '5s' EnforceRepeatableRead = false DeathDeclarationDelay = '10s' +NewHeadsPollInterval = '0s' [OCR] ContractConfirmations = 1 @@ -3250,6 +3617,9 @@ ObservationGracePeriod = '1s' [OCR2] [OCR2.Automation] GasLimit = 5400000 + +[Workflow] +GasLimitDefault = 400000 ```

@@ -3272,9 +3642,11 @@ MinIncomingConfirmations = 1 MinContractPayment = '0.00001 link' NonceAutoSync = true NoNewHeadsThreshold = '6m0s' +LogBroadcasterEnabled = true RPCDefaultBatchSize = 100 RPCBlockQueryDelay = 15 FinalizedBlockOffset = 0 +NoNewFinalizedHeadsThreshold = '0s' [Transactions] ForwardersEnabled = false @@ -3299,6 +3671,7 @@ LimitDefault = 500000 LimitMax = 500000 LimitMultiplier = '1' LimitTransfer = 21000 +EstimateLimit = false BumpMin = '100 mwei' BumpPercent = 40 BumpThreshold = 3 @@ -3314,12 +3687,16 @@ CheckInclusionBlocks = 12 CheckInclusionPercentile = 90 TransactionPercentile = 60 +[GasEstimator.FeeHistory] +CacheTimeout = '10s' + [HeadTracker] HistoryDepth = 2000 MaxBufferSize = 3 SamplingInterval = '1s' MaxAllowedFinalityDepth = 10000 FinalityTagBypass = true +PersistenceEnabled = true [NodePool] PollFailureThreshold = 5 @@ -3331,6 +3708,7 @@ NodeIsSyncingEnabled = false FinalizedBlockPollInterval = '5s' EnforceRepeatableRead = false DeathDeclarationDelay = '10s' +NewHeadsPollInterval = '0s' [OCR] ContractConfirmations = 1 @@ -3343,6 +3721,9 @@ ObservationGracePeriod = '1s' [OCR2] [OCR2.Automation] GasLimit = 5400000 + +[Workflow] +GasLimitDefault = 400000 ```

@@ -3365,9 +3746,11 @@ MinIncomingConfirmations = 3 MinContractPayment = '0.00001 link' NonceAutoSync = true NoNewHeadsThreshold = '30s' +LogBroadcasterEnabled = true RPCDefaultBatchSize = 250 RPCBlockQueryDelay = 2 FinalizedBlockOffset = 0 +NoNewFinalizedHeadsThreshold = '0s' [Transactions] ForwardersEnabled = false @@ -3392,6 +3775,7 @@ LimitDefault = 500000 LimitMax = 500000 LimitMultiplier = '1' LimitTransfer = 21000 +EstimateLimit = false BumpMin = '5 gwei' BumpPercent = 20 BumpThreshold = 3 @@ -3407,12 +3791,16 @@ CheckInclusionBlocks = 12 CheckInclusionPercentile = 90 TransactionPercentile = 60 +[GasEstimator.FeeHistory] +CacheTimeout = '10s' + [HeadTracker] HistoryDepth = 100 MaxBufferSize = 3 SamplingInterval = '1s' MaxAllowedFinalityDepth = 10000 FinalityTagBypass = true +PersistenceEnabled = true [NodePool] PollFailureThreshold = 5 @@ -3424,6 +3812,7 @@ NodeIsSyncingEnabled = false FinalizedBlockPollInterval = '5s' EnforceRepeatableRead = false DeathDeclarationDelay = '10s' +NewHeadsPollInterval = '0s' [OCR] ContractConfirmations = 4 @@ -3436,6 +3825,9 @@ ObservationGracePeriod = '1s' [OCR2] [OCR2.Automation] GasLimit = 3800000 + +[Workflow] +GasLimitDefault = 400000 ```

@@ -3448,7 +3840,7 @@ BlockBackfillDepth = 10 BlockBackfillSkip = false ChainType = 'kroma' FinalityDepth = 400 -FinalityTagEnabled = false +FinalityTagEnabled = true LogBackfillBatchSize = 1000 LogPollInterval = '2s' LogKeepBlocksDepth = 100000 @@ -3458,9 +3850,11 @@ MinIncomingConfirmations = 1 MinContractPayment = '0.00001 link' NonceAutoSync = true NoNewHeadsThreshold = '40s' +LogBroadcasterEnabled = true RPCDefaultBatchSize = 250 RPCBlockQueryDelay = 1 FinalizedBlockOffset = 0 +NoNewFinalizedHeadsThreshold = '0s' [Transactions] ForwardersEnabled = false @@ -3485,6 +3879,7 @@ LimitDefault = 500000 LimitMax = 500000 LimitMultiplier = '1' LimitTransfer = 21000 +EstimateLimit = false BumpMin = '100 wei' BumpPercent = 20 BumpThreshold = 3 @@ -3500,12 +3895,16 @@ CheckInclusionBlocks = 12 CheckInclusionPercentile = 90 TransactionPercentile = 60 +[GasEstimator.FeeHistory] +CacheTimeout = '10s' + [HeadTracker] HistoryDepth = 400 MaxBufferSize = 3 SamplingInterval = '1s' MaxAllowedFinalityDepth = 10000 FinalityTagBypass = true +PersistenceEnabled = true [NodePool] PollFailureThreshold = 5 @@ -3517,6 +3916,7 @@ NodeIsSyncingEnabled = false FinalizedBlockPollInterval = '5s' EnforceRepeatableRead = false DeathDeclarationDelay = '10s' +NewHeadsPollInterval = '0s' [OCR] ContractConfirmations = 1 @@ -3529,6 +3929,9 @@ ObservationGracePeriod = '1s' [OCR2] [OCR2.Automation] GasLimit = 5400000 + +[Workflow] +GasLimitDefault = 400000 ```

@@ -3551,9 +3954,11 @@ MinIncomingConfirmations = 1 MinContractPayment = '0.00001 link' NonceAutoSync = true NoNewHeadsThreshold = '1m0s' +LogBroadcasterEnabled = true RPCDefaultBatchSize = 250 RPCBlockQueryDelay = 1 FinalizedBlockOffset = 0 +NoNewFinalizedHeadsThreshold = '0s' [Transactions] ForwardersEnabled = false @@ -3578,6 +3983,7 @@ LimitDefault = 100000000 LimitMax = 500000 LimitMultiplier = '1' LimitTransfer = 21000 +EstimateLimit = false BumpMin = '5 gwei' BumpPercent = 20 BumpThreshold = 3 @@ -3593,12 +3999,16 @@ CheckInclusionBlocks = 12 CheckInclusionPercentile = 90 TransactionPercentile = 60 +[GasEstimator.FeeHistory] +CacheTimeout = '10s' + [HeadTracker] HistoryDepth = 50 MaxBufferSize = 3 SamplingInterval = '1s' MaxAllowedFinalityDepth = 10000 FinalityTagBypass = true +PersistenceEnabled = true [NodePool] PollFailureThreshold = 5 @@ -3610,6 +4020,7 @@ NodeIsSyncingEnabled = false FinalizedBlockPollInterval = '5s' EnforceRepeatableRead = false DeathDeclarationDelay = '10s' +NewHeadsPollInterval = '0s' [OCR] ContractConfirmations = 4 @@ -3622,31 +4033,36 @@ ObservationGracePeriod = '1s' [OCR2] [OCR2.Automation] GasLimit = 5400000 + +[Workflow] +GasLimitDefault = 400000 ```

-
zkSync Sepolia (300)

+

Hedera Mainnet (295)

```toml AutoCreateKey = true BlockBackfillDepth = 10 BlockBackfillSkip = false -ChainType = 'zksync' +ChainType = 'hedera' FinalityDepth = 10 FinalityTagEnabled = false LogBackfillBatchSize = 1000 -LogPollInterval = '5s' +LogPollInterval = '10s' LogKeepBlocksDepth = 100000 LogPrunePageSize = 0 BackupLogPollerBlockDelay = 100 MinIncomingConfirmations = 1 MinContractPayment = '0.00001 link' NonceAutoSync = true -NoNewHeadsThreshold = '1m0s' +NoNewHeadsThreshold = '3m0s' +LogBroadcasterEnabled = true RPCDefaultBatchSize = 250 RPCBlockQueryDelay = 1 FinalizedBlockOffset = 0 +NoNewFinalizedHeadsThreshold = '0s' [Transactions] ForwardersEnabled = false @@ -3654,7 +4070,7 @@ MaxInFlight = 16 MaxQueued = 250 ReaperInterval = '1h0m0s' ReaperThreshold = '168h0m0s' -ResendAfterThreshold = '1m0s' +ResendAfterThreshold = '2m0s' [Transactions.AutoPurge] Enabled = false @@ -3663,17 +4079,18 @@ Enabled = false Enabled = true [GasEstimator] -Mode = 'BlockHistory' +Mode = 'SuggestedPrice' PriceDefault = '20 gwei' -PriceMax = '18.446744073709551615 ether' -PriceMin = '0' -LimitDefault = 100000000 +PriceMax = '115792089237316195423570985008687907853269984665.640564039457584007913129639935 tether' +PriceMin = '1 gwei' +LimitDefault = 500000 LimitMax = 500000 LimitMultiplier = '1' LimitTransfer = 21000 -BumpMin = '5 gwei' +EstimateLimit = false +BumpMin = '10 gwei' BumpPercent = 20 -BumpThreshold = 3 +BumpThreshold = 0 EIP1559DynamicFees = false FeeCapDefault = '100 gwei' TipCapDefault = '1 wei' @@ -3686,23 +4103,28 @@ CheckInclusionBlocks = 12 CheckInclusionPercentile = 90 TransactionPercentile = 60 +[GasEstimator.FeeHistory] +CacheTimeout = '10s' + [HeadTracker] -HistoryDepth = 50 +HistoryDepth = 100 MaxBufferSize = 3 SamplingInterval = '1s' MaxAllowedFinalityDepth = 10000 FinalityTagBypass = true +PersistenceEnabled = true [NodePool] PollFailureThreshold = 5 PollInterval = '10s' SelectionMode = 'HighestHead' -SyncThreshold = 5 +SyncThreshold = 10 LeaseDuration = '0s' NodeIsSyncingEnabled = false FinalizedBlockPollInterval = '5s' EnforceRepeatableRead = false DeathDeclarationDelay = '10s' +NewHeadsPollInterval = '0s' [OCR] ContractConfirmations = 4 @@ -3715,31 +4137,36 @@ ObservationGracePeriod = '1s' [OCR2] [OCR2.Automation] GasLimit = 5400000 + +[Workflow] +GasLimitDefault = 400000 ```

-
zkSync Mainnet (324)

+

Hedera Testnet (296)

```toml AutoCreateKey = true BlockBackfillDepth = 10 BlockBackfillSkip = false -ChainType = 'zksync' +ChainType = 'hedera' FinalityDepth = 10 FinalityTagEnabled = false LogBackfillBatchSize = 1000 -LogPollInterval = '5s' +LogPollInterval = '10s' LogKeepBlocksDepth = 100000 LogPrunePageSize = 0 BackupLogPollerBlockDelay = 100 MinIncomingConfirmations = 1 MinContractPayment = '0.00001 link' NonceAutoSync = true -NoNewHeadsThreshold = '1m0s' +NoNewHeadsThreshold = '3m0s' +LogBroadcasterEnabled = true RPCDefaultBatchSize = 250 RPCBlockQueryDelay = 1 FinalizedBlockOffset = 0 +NoNewFinalizedHeadsThreshold = '0s' [Transactions] ForwardersEnabled = false @@ -3747,7 +4174,7 @@ MaxInFlight = 16 MaxQueued = 250 ReaperInterval = '1h0m0s' ReaperThreshold = '168h0m0s' -ResendAfterThreshold = '1m0s' +ResendAfterThreshold = '2m0s' [Transactions.AutoPurge] Enabled = false @@ -3756,17 +4183,18 @@ Enabled = false Enabled = true [GasEstimator] -Mode = 'BlockHistory' +Mode = 'SuggestedPrice' PriceDefault = '20 gwei' -PriceMax = '18.446744073709551615 ether' -PriceMin = '0' -LimitDefault = 100000000 +PriceMax = '115792089237316195423570985008687907853269984665.640564039457584007913129639935 tether' +PriceMin = '1 gwei' +LimitDefault = 500000 LimitMax = 500000 LimitMultiplier = '1' LimitTransfer = 21000 -BumpMin = '5 gwei' +EstimateLimit = false +BumpMin = '10 gwei' BumpPercent = 20 -BumpThreshold = 3 +BumpThreshold = 0 EIP1559DynamicFees = false FeeCapDefault = '100 gwei' TipCapDefault = '1 wei' @@ -3779,23 +4207,28 @@ CheckInclusionBlocks = 12 CheckInclusionPercentile = 90 TransactionPercentile = 60 +[GasEstimator.FeeHistory] +CacheTimeout = '10s' + [HeadTracker] -HistoryDepth = 50 +HistoryDepth = 100 MaxBufferSize = 3 SamplingInterval = '1s' MaxAllowedFinalityDepth = 10000 FinalityTagBypass = true +PersistenceEnabled = true [NodePool] PollFailureThreshold = 5 PollInterval = '10s' SelectionMode = 'HighestHead' -SyncThreshold = 5 +SyncThreshold = 10 LeaseDuration = '0s' NodeIsSyncingEnabled = false FinalizedBlockPollInterval = '5s' EnforceRepeatableRead = false DeathDeclarationDelay = '10s' +NewHeadsPollInterval = '0s' [OCR] ContractConfirmations = 4 @@ -3808,32 +4241,36 @@ ObservationGracePeriod = '1s' [OCR2] [OCR2.Automation] GasLimit = 5400000 + +[Workflow] +GasLimitDefault = 400000 ```

-
Optimism Goerli (420)

+

zkSync Sepolia (300)

```toml AutoCreateKey = true BlockBackfillDepth = 10 BlockBackfillSkip = false -ChainType = 'optimismBedrock' -FinalityDepth = 200 +ChainType = 'zksync' +FinalityDepth = 10 FinalityTagEnabled = false -LinkContractAddress = '0xdc2CC710e42857672E7907CF474a69B63B93089f' LogBackfillBatchSize = 1000 -LogPollInterval = '2s' +LogPollInterval = '5s' LogKeepBlocksDepth = 100000 LogPrunePageSize = 0 BackupLogPollerBlockDelay = 100 MinIncomingConfirmations = 1 MinContractPayment = '0.00001 link' NonceAutoSync = true -NoNewHeadsThreshold = '40s' +NoNewHeadsThreshold = '1m0s' +LogBroadcasterEnabled = true RPCDefaultBatchSize = 250 RPCBlockQueryDelay = 1 FinalizedBlockOffset = 0 +NoNewFinalizedHeadsThreshold = '0s' [Transactions] ForwardersEnabled = false @@ -3841,7 +4278,7 @@ MaxInFlight = 16 MaxQueued = 250 ReaperInterval = '1h0m0s' ReaperThreshold = '168h0m0s' -ResendAfterThreshold = '30s' +ResendAfterThreshold = '1m0s' [Transactions.AutoPurge] Enabled = false @@ -3852,47 +4289,53 @@ Enabled = true [GasEstimator] Mode = 'BlockHistory' PriceDefault = '20 gwei' -PriceMax = '115792089237316195423570985008687907853269984665.640564039457584007913129639935 tether' -PriceMin = '1 wei' -LimitDefault = 500000 +PriceMax = '18.446744073709551615 ether' +PriceMin = '0' +LimitDefault = 100000000 LimitMax = 500000 LimitMultiplier = '1' LimitTransfer = 21000 -BumpMin = '100 wei' +EstimateLimit = false +BumpMin = '5 gwei' BumpPercent = 20 BumpThreshold = 3 -EIP1559DynamicFees = true +EIP1559DynamicFees = false FeeCapDefault = '100 gwei' TipCapDefault = '1 wei' TipCapMin = '1 wei' [GasEstimator.BlockHistory] BatchSize = 25 -BlockHistorySize = 60 +BlockHistorySize = 8 CheckInclusionBlocks = 12 CheckInclusionPercentile = 90 TransactionPercentile = 60 +[GasEstimator.FeeHistory] +CacheTimeout = '10s' + [HeadTracker] -HistoryDepth = 300 +HistoryDepth = 50 MaxBufferSize = 3 SamplingInterval = '1s' MaxAllowedFinalityDepth = 10000 FinalityTagBypass = true +PersistenceEnabled = true [NodePool] PollFailureThreshold = 5 PollInterval = '10s' SelectionMode = 'HighestHead' -SyncThreshold = 10 +SyncThreshold = 5 LeaseDuration = '0s' NodeIsSyncingEnabled = false FinalizedBlockPollInterval = '5s' EnforceRepeatableRead = false DeathDeclarationDelay = '10s' +NewHeadsPollInterval = '0s' [OCR] -ContractConfirmations = 1 +ContractConfirmations = 4 ContractTransmitterTransmitTimeout = '10s' DatabaseTimeout = '10s' DeltaCOverride = '168h0m0s' @@ -3901,32 +4344,37 @@ ObservationGracePeriod = '1s' [OCR2] [OCR2.Automation] -GasLimit = 6500000 +GasLimit = 5400000 + +[Workflow] +GasLimitDefault = 400000 ```

-
Metis Rinkeby (588)

+

zkSync Mainnet (324)

```toml AutoCreateKey = true BlockBackfillDepth = 10 BlockBackfillSkip = false -ChainType = 'metis' +ChainType = 'zksync' FinalityDepth = 10 FinalityTagEnabled = false LogBackfillBatchSize = 1000 -LogPollInterval = '15s' +LogPollInterval = '5s' LogKeepBlocksDepth = 100000 LogPrunePageSize = 0 BackupLogPollerBlockDelay = 100 MinIncomingConfirmations = 1 MinContractPayment = '0.00001 link' NonceAutoSync = true -NoNewHeadsThreshold = '0s' +NoNewHeadsThreshold = '1m0s' +LogBroadcasterEnabled = true RPCDefaultBatchSize = 250 RPCBlockQueryDelay = 1 FinalizedBlockOffset = 0 +NoNewFinalizedHeadsThreshold = '0s' [Transactions] ForwardersEnabled = false @@ -3943,14 +4391,15 @@ Enabled = false Enabled = true [GasEstimator] -Mode = 'SuggestedPrice' +Mode = 'BlockHistory' PriceDefault = '20 gwei' -PriceMax = '115792089237316195423570985008687907853269984665.640564039457584007913129639935 tether' +PriceMax = '18.446744073709551615 ether' PriceMin = '0' -LimitDefault = 500000 +LimitDefault = 100000000 LimitMax = 500000 LimitMultiplier = '1' LimitTransfer = 21000 +EstimateLimit = false BumpMin = '5 gwei' BumpPercent = 20 BumpThreshold = 3 @@ -3961,31 +4410,36 @@ TipCapMin = '1 wei' [GasEstimator.BlockHistory] BatchSize = 25 -BlockHistorySize = 0 +BlockHistorySize = 8 CheckInclusionBlocks = 12 CheckInclusionPercentile = 90 TransactionPercentile = 60 +[GasEstimator.FeeHistory] +CacheTimeout = '10s' + [HeadTracker] -HistoryDepth = 100 +HistoryDepth = 50 MaxBufferSize = 3 SamplingInterval = '1s' MaxAllowedFinalityDepth = 10000 FinalityTagBypass = true +PersistenceEnabled = true [NodePool] PollFailureThreshold = 5 PollInterval = '10s' SelectionMode = 'HighestHead' -SyncThreshold = 10 +SyncThreshold = 5 LeaseDuration = '0s' NodeIsSyncingEnabled = false FinalizedBlockPollInterval = '5s' EnforceRepeatableRead = false DeathDeclarationDelay = '10s' +NewHeadsPollInterval = '0s' [OCR] -ContractConfirmations = 1 +ContractConfirmations = 4 ContractTransmitterTransmitTimeout = '10s' DatabaseTimeout = '10s' DeltaCOverride = '168h0m0s' @@ -3995,17 +4449,229 @@ ObservationGracePeriod = '1s' [OCR2] [OCR2.Automation] GasLimit = 5400000 + +[Workflow] +GasLimitDefault = 400000 ```

-
Klaytn Testnet (1001)

+

Optimism Goerli (420)

```toml AutoCreateKey = true BlockBackfillDepth = 10 BlockBackfillSkip = false -FinalityDepth = 10 +ChainType = 'optimismBedrock' +FinalityDepth = 200 +FinalityTagEnabled = false +LinkContractAddress = '0xdc2CC710e42857672E7907CF474a69B63B93089f' +LogBackfillBatchSize = 1000 +LogPollInterval = '2s' +LogKeepBlocksDepth = 100000 +LogPrunePageSize = 0 +BackupLogPollerBlockDelay = 100 +MinIncomingConfirmations = 1 +MinContractPayment = '0.00001 link' +NonceAutoSync = true +NoNewHeadsThreshold = '40s' +LogBroadcasterEnabled = true +RPCDefaultBatchSize = 250 +RPCBlockQueryDelay = 1 +FinalizedBlockOffset = 0 +NoNewFinalizedHeadsThreshold = '0s' + +[Transactions] +ForwardersEnabled = false +MaxInFlight = 16 +MaxQueued = 250 +ReaperInterval = '1h0m0s' +ReaperThreshold = '168h0m0s' +ResendAfterThreshold = '30s' + +[Transactions.AutoPurge] +Enabled = false + +[BalanceMonitor] +Enabled = true + +[GasEstimator] +Mode = 'BlockHistory' +PriceDefault = '20 gwei' +PriceMax = '115792089237316195423570985008687907853269984665.640564039457584007913129639935 tether' +PriceMin = '1 wei' +LimitDefault = 500000 +LimitMax = 500000 +LimitMultiplier = '1' +LimitTransfer = 21000 +EstimateLimit = false +BumpMin = '100 wei' +BumpPercent = 20 +BumpThreshold = 3 +EIP1559DynamicFees = true +FeeCapDefault = '100 gwei' +TipCapDefault = '1 wei' +TipCapMin = '1 wei' + +[GasEstimator.BlockHistory] +BatchSize = 25 +BlockHistorySize = 60 +CheckInclusionBlocks = 12 +CheckInclusionPercentile = 90 +TransactionPercentile = 60 + +[GasEstimator.FeeHistory] +CacheTimeout = '10s' + +[HeadTracker] +HistoryDepth = 300 +MaxBufferSize = 3 +SamplingInterval = '1s' +MaxAllowedFinalityDepth = 10000 +FinalityTagBypass = true +PersistenceEnabled = true + +[NodePool] +PollFailureThreshold = 5 +PollInterval = '10s' +SelectionMode = 'HighestHead' +SyncThreshold = 10 +LeaseDuration = '0s' +NodeIsSyncingEnabled = false +FinalizedBlockPollInterval = '5s' +EnforceRepeatableRead = false +DeathDeclarationDelay = '10s' +NewHeadsPollInterval = '0s' + +[OCR] +ContractConfirmations = 1 +ContractTransmitterTransmitTimeout = '10s' +DatabaseTimeout = '10s' +DeltaCOverride = '168h0m0s' +DeltaCJitterOverride = '1h0m0s' +ObservationGracePeriod = '1s' + +[OCR2] +[OCR2.Automation] +GasLimit = 6500000 + +[Workflow] +GasLimitDefault = 400000 +``` + +

+ +
Metis Rinkeby (588)

+ +```toml +AutoCreateKey = true +BlockBackfillDepth = 10 +BlockBackfillSkip = false +ChainType = 'metis' +FinalityDepth = 10 +FinalityTagEnabled = false +LogBackfillBatchSize = 1000 +LogPollInterval = '15s' +LogKeepBlocksDepth = 100000 +LogPrunePageSize = 0 +BackupLogPollerBlockDelay = 100 +MinIncomingConfirmations = 1 +MinContractPayment = '0.00001 link' +NonceAutoSync = true +NoNewHeadsThreshold = '0s' +LogBroadcasterEnabled = true +RPCDefaultBatchSize = 250 +RPCBlockQueryDelay = 1 +FinalizedBlockOffset = 0 +NoNewFinalizedHeadsThreshold = '0s' + +[Transactions] +ForwardersEnabled = false +MaxInFlight = 16 +MaxQueued = 250 +ReaperInterval = '1h0m0s' +ReaperThreshold = '168h0m0s' +ResendAfterThreshold = '1m0s' + +[Transactions.AutoPurge] +Enabled = false + +[BalanceMonitor] +Enabled = true + +[GasEstimator] +Mode = 'SuggestedPrice' +PriceDefault = '20 gwei' +PriceMax = '115792089237316195423570985008687907853269984665.640564039457584007913129639935 tether' +PriceMin = '0' +LimitDefault = 500000 +LimitMax = 500000 +LimitMultiplier = '1' +LimitTransfer = 21000 +EstimateLimit = false +BumpMin = '5 gwei' +BumpPercent = 20 +BumpThreshold = 3 +EIP1559DynamicFees = false +FeeCapDefault = '100 gwei' +TipCapDefault = '1 wei' +TipCapMin = '1 wei' + +[GasEstimator.BlockHistory] +BatchSize = 25 +BlockHistorySize = 0 +CheckInclusionBlocks = 12 +CheckInclusionPercentile = 90 +TransactionPercentile = 60 + +[GasEstimator.FeeHistory] +CacheTimeout = '10s' + +[HeadTracker] +HistoryDepth = 100 +MaxBufferSize = 3 +SamplingInterval = '1s' +MaxAllowedFinalityDepth = 10000 +FinalityTagBypass = true +PersistenceEnabled = true + +[NodePool] +PollFailureThreshold = 5 +PollInterval = '10s' +SelectionMode = 'HighestHead' +SyncThreshold = 10 +LeaseDuration = '0s' +NodeIsSyncingEnabled = false +FinalizedBlockPollInterval = '5s' +EnforceRepeatableRead = false +DeathDeclarationDelay = '10s' +NewHeadsPollInterval = '0s' + +[OCR] +ContractConfirmations = 1 +ContractTransmitterTransmitTimeout = '10s' +DatabaseTimeout = '10s' +DeltaCOverride = '168h0m0s' +DeltaCJitterOverride = '1h0m0s' +ObservationGracePeriod = '1s' + +[OCR2] +[OCR2.Automation] +GasLimit = 5400000 + +[Workflow] +GasLimitDefault = 400000 +``` + +

+ +
Klaytn Testnet (1001)

+ +```toml +AutoCreateKey = true +BlockBackfillDepth = 10 +BlockBackfillSkip = false +FinalityDepth = 10 FinalityTagEnabled = false LogBackfillBatchSize = 1000 LogPollInterval = '15s' @@ -4016,9 +4682,11 @@ MinIncomingConfirmations = 1 MinContractPayment = '0.00001 link' NonceAutoSync = true NoNewHeadsThreshold = '30s' +LogBroadcasterEnabled = true RPCDefaultBatchSize = 250 RPCBlockQueryDelay = 1 FinalizedBlockOffset = 0 +NoNewFinalizedHeadsThreshold = '0s' [Transactions] ForwardersEnabled = false @@ -4043,6 +4711,7 @@ LimitDefault = 500000 LimitMax = 500000 LimitMultiplier = '1' LimitTransfer = 21000 +EstimateLimit = false BumpMin = '5 gwei' BumpPercent = 20 BumpThreshold = 5 @@ -4058,12 +4727,16 @@ CheckInclusionBlocks = 12 CheckInclusionPercentile = 90 TransactionPercentile = 60 +[GasEstimator.FeeHistory] +CacheTimeout = '10s' + [HeadTracker] HistoryDepth = 100 MaxBufferSize = 3 SamplingInterval = '1s' MaxAllowedFinalityDepth = 10000 FinalityTagBypass = true +PersistenceEnabled = true [NodePool] PollFailureThreshold = 5 @@ -4075,6 +4748,7 @@ NodeIsSyncingEnabled = false FinalizedBlockPollInterval = '5s' EnforceRepeatableRead = false DeathDeclarationDelay = '10s' +NewHeadsPollInterval = '0s' [OCR] ContractConfirmations = 1 @@ -4087,6 +4761,9 @@ ObservationGracePeriod = '1s' [OCR2] [OCR2.Automation] GasLimit = 5400000 + +[Workflow] +GasLimitDefault = 400000 ```

@@ -4099,7 +4776,7 @@ BlockBackfillDepth = 10 BlockBackfillSkip = false ChainType = 'metis' FinalityDepth = 10 -FinalityTagEnabled = false +FinalityTagEnabled = true LogBackfillBatchSize = 1000 LogPollInterval = '15s' LogKeepBlocksDepth = 100000 @@ -4109,9 +4786,11 @@ MinIncomingConfirmations = 1 MinContractPayment = '0.00001 link' NonceAutoSync = true NoNewHeadsThreshold = '0s' +LogBroadcasterEnabled = true RPCDefaultBatchSize = 250 RPCBlockQueryDelay = 1 FinalizedBlockOffset = 0 +NoNewFinalizedHeadsThreshold = '0s' [Transactions] ForwardersEnabled = false @@ -4136,6 +4815,7 @@ LimitDefault = 500000 LimitMax = 500000 LimitMultiplier = '1' LimitTransfer = 21000 +EstimateLimit = false BumpMin = '5 gwei' BumpPercent = 20 BumpThreshold = 3 @@ -4151,12 +4831,16 @@ CheckInclusionBlocks = 12 CheckInclusionPercentile = 90 TransactionPercentile = 60 +[GasEstimator.FeeHistory] +CacheTimeout = '10s' + [HeadTracker] HistoryDepth = 100 MaxBufferSize = 3 SamplingInterval = '1s' MaxAllowedFinalityDepth = 10000 FinalityTagBypass = true +PersistenceEnabled = true [NodePool] PollFailureThreshold = 5 @@ -4168,6 +4852,7 @@ NodeIsSyncingEnabled = false FinalizedBlockPollInterval = '5s' EnforceRepeatableRead = false DeathDeclarationDelay = '10s' +NewHeadsPollInterval = '0s' [OCR] ContractConfirmations = 1 @@ -4180,6 +4865,9 @@ ObservationGracePeriod = '1s' [OCR2] [OCR2.Automation] GasLimit = 5400000 + +[Workflow] +GasLimitDefault = 400000 ```

@@ -4202,9 +4890,11 @@ MinIncomingConfirmations = 1 MinContractPayment = '0.00001 link' NonceAutoSync = true NoNewHeadsThreshold = '6m0s' +LogBroadcasterEnabled = true RPCDefaultBatchSize = 100 RPCBlockQueryDelay = 15 FinalizedBlockOffset = 0 +NoNewFinalizedHeadsThreshold = '0s' [Transactions] ForwardersEnabled = false @@ -4221,15 +4911,16 @@ Enabled = false Enabled = true [GasEstimator] -Mode = 'BlockHistory' +Mode = 'FeeHistory' PriceDefault = '20 gwei' PriceMax = '115792089237316195423570985008687907853269984665.640564039457584007913129639935 tether' -PriceMin = '100 mwei' +PriceMin = '0' LimitDefault = 500000 LimitMax = 500000 LimitMultiplier = '1' LimitTransfer = 21000 -BumpMin = '100 mwei' +EstimateLimit = false +BumpMin = '5 gwei' BumpPercent = 40 BumpThreshold = 3 EIP1559DynamicFees = false @@ -4239,17 +4930,21 @@ TipCapMin = '1 wei' [GasEstimator.BlockHistory] BatchSize = 25 -BlockHistorySize = 12 +BlockHistorySize = 8 CheckInclusionBlocks = 12 CheckInclusionPercentile = 90 TransactionPercentile = 60 +[GasEstimator.FeeHistory] +CacheTimeout = '4s' + [HeadTracker] HistoryDepth = 2000 MaxBufferSize = 3 SamplingInterval = '1s' MaxAllowedFinalityDepth = 10000 FinalityTagBypass = true +PersistenceEnabled = true [NodePool] PollFailureThreshold = 5 @@ -4261,6 +4956,7 @@ NodeIsSyncingEnabled = false FinalizedBlockPollInterval = '5s' EnforceRepeatableRead = false DeathDeclarationDelay = '10s' +NewHeadsPollInterval = '0s' [OCR] ContractConfirmations = 1 @@ -4273,6 +4969,9 @@ ObservationGracePeriod = '1s' [OCR2] [OCR2.Automation] GasLimit = 5400000 + +[Workflow] +GasLimitDefault = 400000 ```

@@ -4285,7 +4984,7 @@ BlockBackfillDepth = 10 BlockBackfillSkip = false ChainType = 'wemix' FinalityDepth = 10 -FinalityTagEnabled = false +FinalityTagEnabled = true LogBackfillBatchSize = 1000 LogPollInterval = '3s' LogKeepBlocksDepth = 100000 @@ -4295,9 +4994,11 @@ MinIncomingConfirmations = 1 MinContractPayment = '0.00001 link' NonceAutoSync = true NoNewHeadsThreshold = '30s' +LogBroadcasterEnabled = true RPCDefaultBatchSize = 250 RPCBlockQueryDelay = 1 FinalizedBlockOffset = 0 +NoNewFinalizedHeadsThreshold = '40s' [Transactions] ForwardersEnabled = false @@ -4322,6 +5023,7 @@ LimitDefault = 500000 LimitMax = 500000 LimitMultiplier = '1' LimitTransfer = 21000 +EstimateLimit = false BumpMin = '5 gwei' BumpPercent = 20 BumpThreshold = 3 @@ -4337,12 +5039,16 @@ CheckInclusionBlocks = 12 CheckInclusionPercentile = 90 TransactionPercentile = 60 +[GasEstimator.FeeHistory] +CacheTimeout = '10s' + [HeadTracker] HistoryDepth = 100 MaxBufferSize = 3 SamplingInterval = '1s' MaxAllowedFinalityDepth = 10000 FinalityTagBypass = true +PersistenceEnabled = true [NodePool] PollFailureThreshold = 5 @@ -4354,6 +5060,7 @@ NodeIsSyncingEnabled = false FinalizedBlockPollInterval = '5s' EnforceRepeatableRead = false DeathDeclarationDelay = '10s' +NewHeadsPollInterval = '0s' [OCR] ContractConfirmations = 1 @@ -4366,6 +5073,9 @@ ObservationGracePeriod = '1s' [OCR2] [OCR2.Automation] GasLimit = 5400000 + +[Workflow] +GasLimitDefault = 400000 ```

@@ -4378,7 +5088,7 @@ BlockBackfillDepth = 10 BlockBackfillSkip = false ChainType = 'wemix' FinalityDepth = 10 -FinalityTagEnabled = false +FinalityTagEnabled = true LogBackfillBatchSize = 1000 LogPollInterval = '3s' LogKeepBlocksDepth = 100000 @@ -4388,9 +5098,11 @@ MinIncomingConfirmations = 1 MinContractPayment = '0.00001 link' NonceAutoSync = true NoNewHeadsThreshold = '30s' +LogBroadcasterEnabled = true RPCDefaultBatchSize = 250 RPCBlockQueryDelay = 1 FinalizedBlockOffset = 0 +NoNewFinalizedHeadsThreshold = '40s' [Transactions] ForwardersEnabled = false @@ -4415,6 +5127,7 @@ LimitDefault = 500000 LimitMax = 500000 LimitMultiplier = '1' LimitTransfer = 21000 +EstimateLimit = false BumpMin = '5 gwei' BumpPercent = 20 BumpThreshold = 3 @@ -4430,12 +5143,16 @@ CheckInclusionBlocks = 12 CheckInclusionPercentile = 90 TransactionPercentile = 60 +[GasEstimator.FeeHistory] +CacheTimeout = '10s' + [HeadTracker] HistoryDepth = 100 MaxBufferSize = 3 SamplingInterval = '1s' MaxAllowedFinalityDepth = 10000 FinalityTagBypass = false +PersistenceEnabled = true [NodePool] PollFailureThreshold = 5 @@ -4447,6 +5164,7 @@ NodeIsSyncingEnabled = false FinalizedBlockPollInterval = '5s' EnforceRepeatableRead = false DeathDeclarationDelay = '10s' +NewHeadsPollInterval = '0s' [OCR] ContractConfirmations = 1 @@ -4459,6 +5177,9 @@ ObservationGracePeriod = '1s' [OCR2] [OCR2.Automation] GasLimit = 5400000 + +[Workflow] +GasLimitDefault = 400000 ```

@@ -4480,9 +5201,11 @@ MinIncomingConfirmations = 1 MinContractPayment = '100' NonceAutoSync = true NoNewHeadsThreshold = '0s' +LogBroadcasterEnabled = true RPCDefaultBatchSize = 250 RPCBlockQueryDelay = 1 FinalizedBlockOffset = 0 +NoNewFinalizedHeadsThreshold = '0s' [Transactions] ForwardersEnabled = false @@ -4507,6 +5230,7 @@ LimitDefault = 500000 LimitMax = 500000 LimitMultiplier = '1' LimitTransfer = 21000 +EstimateLimit = false BumpMin = '5 gwei' BumpPercent = 20 BumpThreshold = 0 @@ -4522,12 +5246,16 @@ CheckInclusionBlocks = 12 CheckInclusionPercentile = 90 TransactionPercentile = 60 +[GasEstimator.FeeHistory] +CacheTimeout = '10s' + [HeadTracker] HistoryDepth = 10 MaxBufferSize = 100 SamplingInterval = '0s' MaxAllowedFinalityDepth = 10000 FinalityTagBypass = true +PersistenceEnabled = true [NodePool] PollFailureThreshold = 5 @@ -4539,6 +5267,7 @@ NodeIsSyncingEnabled = false FinalizedBlockPollInterval = '5s' EnforceRepeatableRead = false DeathDeclarationDelay = '10s' +NewHeadsPollInterval = '0s' [OCR] ContractConfirmations = 1 @@ -4551,31 +5280,37 @@ ObservationGracePeriod = '1s' [OCR2] [OCR2.Automation] GasLimit = 5400000 + +[Workflow] +GasLimitDefault = 400000 ```

-
Polygon Zkevm Goerli (1442)

+

Soneium Sepolia (1946)

```toml AutoCreateKey = true BlockBackfillDepth = 10 BlockBackfillSkip = false -ChainType = 'zkevm' -FinalityDepth = 500 -FinalityTagEnabled = false +ChainType = 'optimismBedrock' +FinalityDepth = 200 +FinalityTagEnabled = true +LinkContractAddress = '0x7ea13478Ea3961A0e8b538cb05a9DF0477c79Cd2' LogBackfillBatchSize = 1000 -LogPollInterval = '30s' +LogPollInterval = '2s' LogKeepBlocksDepth = 100000 LogPrunePageSize = 0 BackupLogPollerBlockDelay = 100 MinIncomingConfirmations = 1 MinContractPayment = '0.00001 link' NonceAutoSync = true -NoNewHeadsThreshold = '12m0s' -RPCDefaultBatchSize = 100 +NoNewHeadsThreshold = '40s' +LogBroadcasterEnabled = true +RPCDefaultBatchSize = 250 RPCBlockQueryDelay = 1 FinalizedBlockOffset = 0 +NoNewFinalizedHeadsThreshold = '2h0m0s' [Transactions] ForwardersEnabled = false @@ -4583,7 +5318,7 @@ MaxInFlight = 16 MaxQueued = 250 ReaperInterval = '1h0m0s' ReaperThreshold = '168h0m0s' -ResendAfterThreshold = '3m0s' +ResendAfterThreshold = '30s' [Transactions.AutoPurge] Enabled = false @@ -4595,43 +5330,49 @@ Enabled = true Mode = 'BlockHistory' PriceDefault = '20 gwei' PriceMax = '115792089237316195423570985008687907853269984665.640564039457584007913129639935 tether' -PriceMin = '50 mwei' +PriceMin = '1 wei' LimitDefault = 500000 LimitMax = 500000 LimitMultiplier = '1' LimitTransfer = 21000 -BumpMin = '20 mwei' -BumpPercent = 40 +EstimateLimit = false +BumpMin = '1 mwei' +BumpPercent = 20 BumpThreshold = 3 -EIP1559DynamicFees = false +EIP1559DynamicFees = true FeeCapDefault = '100 gwei' TipCapDefault = '1 wei' TipCapMin = '1 wei' [GasEstimator.BlockHistory] BatchSize = 25 -BlockHistorySize = 12 +BlockHistorySize = 60 CheckInclusionBlocks = 12 CheckInclusionPercentile = 90 TransactionPercentile = 60 +[GasEstimator.FeeHistory] +CacheTimeout = '10s' + [HeadTracker] -HistoryDepth = 2000 +HistoryDepth = 300 MaxBufferSize = 3 SamplingInterval = '1s' MaxAllowedFinalityDepth = 10000 FinalityTagBypass = true +PersistenceEnabled = true [NodePool] PollFailureThreshold = 5 PollInterval = '10s' SelectionMode = 'HighestHead' -SyncThreshold = 5 +SyncThreshold = 10 LeaseDuration = '0s' NodeIsSyncingEnabled = false FinalizedBlockPollInterval = '5s' EnforceRepeatableRead = false DeathDeclarationDelay = '10s' +NewHeadsPollInterval = '0s' [OCR] ContractConfirmations = 1 @@ -4643,7 +5384,10 @@ ObservationGracePeriod = '1s' [OCR2] [OCR2.Automation] -GasLimit = 5400000 +GasLimit = 6500000 + +[Workflow] +GasLimitDefault = 400000 ```

@@ -4656,7 +5400,7 @@ BlockBackfillDepth = 10 BlockBackfillSkip = false ChainType = 'kroma' FinalityDepth = 400 -FinalityTagEnabled = false +FinalityTagEnabled = true LogBackfillBatchSize = 1000 LogPollInterval = '2s' LogKeepBlocksDepth = 100000 @@ -4666,9 +5410,11 @@ MinIncomingConfirmations = 1 MinContractPayment = '0.00001 link' NonceAutoSync = true NoNewHeadsThreshold = '40s' +LogBroadcasterEnabled = true RPCDefaultBatchSize = 250 RPCBlockQueryDelay = 1 FinalizedBlockOffset = 0 +NoNewFinalizedHeadsThreshold = '0s' [Transactions] ForwardersEnabled = false @@ -4693,6 +5439,7 @@ LimitDefault = 500000 LimitMax = 500000 LimitMultiplier = '1' LimitTransfer = 21000 +EstimateLimit = false BumpMin = '100 wei' BumpPercent = 20 BumpThreshold = 3 @@ -4708,12 +5455,16 @@ CheckInclusionBlocks = 12 CheckInclusionPercentile = 90 TransactionPercentile = 60 +[GasEstimator.FeeHistory] +CacheTimeout = '10s' + [HeadTracker] HistoryDepth = 400 MaxBufferSize = 3 SamplingInterval = '1s' MaxAllowedFinalityDepth = 10000 FinalityTagBypass = true +PersistenceEnabled = true [NodePool] PollFailureThreshold = 5 @@ -4725,6 +5476,7 @@ NodeIsSyncingEnabled = false FinalizedBlockPollInterval = '5s' EnforceRepeatableRead = false DeathDeclarationDelay = '10s' +NewHeadsPollInterval = '0s' [OCR] ContractConfirmations = 1 @@ -4737,6 +5489,9 @@ ObservationGracePeriod = '1s' [OCR2] [OCR2.Automation] GasLimit = 5400000 + +[Workflow] +GasLimitDefault = 400000 ```

@@ -4759,9 +5514,11 @@ MinIncomingConfirmations = 1 MinContractPayment = '0.00001 link' NonceAutoSync = true NoNewHeadsThreshold = '12m0s' +LogBroadcasterEnabled = true RPCDefaultBatchSize = 100 RPCBlockQueryDelay = 1 FinalizedBlockOffset = 0 +NoNewFinalizedHeadsThreshold = '0s' [Transactions] ForwardersEnabled = false @@ -4778,15 +5535,16 @@ Enabled = false Enabled = true [GasEstimator] -Mode = 'BlockHistory' +Mode = 'FeeHistory' PriceDefault = '20 gwei' PriceMax = '115792089237316195423570985008687907853269984665.640564039457584007913129639935 tether' -PriceMin = '1 mwei' +PriceMin = '0' LimitDefault = 500000 LimitMax = 500000 LimitMultiplier = '1' LimitTransfer = 21000 -BumpMin = '20 mwei' +EstimateLimit = false +BumpMin = '5 gwei' BumpPercent = 40 BumpThreshold = 3 EIP1559DynamicFees = false @@ -4796,17 +5554,21 @@ TipCapMin = '1 wei' [GasEstimator.BlockHistory] BatchSize = 25 -BlockHistorySize = 12 +BlockHistorySize = 8 CheckInclusionBlocks = 12 CheckInclusionPercentile = 90 TransactionPercentile = 60 +[GasEstimator.FeeHistory] +CacheTimeout = '4s' + [HeadTracker] HistoryDepth = 2000 MaxBufferSize = 3 SamplingInterval = '1s' MaxAllowedFinalityDepth = 10000 FinalityTagBypass = true +PersistenceEnabled = true [NodePool] PollFailureThreshold = 5 @@ -4818,6 +5580,7 @@ NodeIsSyncingEnabled = false FinalizedBlockPollInterval = '5s' EnforceRepeatableRead = false DeathDeclarationDelay = '10s' +NewHeadsPollInterval = '0s' [OCR] ContractConfirmations = 1 @@ -4830,6 +5593,9 @@ ObservationGracePeriod = '1s' [OCR2] [OCR2.Automation] GasLimit = 5400000 + +[Workflow] +GasLimitDefault = 400000 ```

@@ -4852,9 +5618,11 @@ MinIncomingConfirmations = 3 MinContractPayment = '0.00001 link' NonceAutoSync = true NoNewHeadsThreshold = '0s' +LogBroadcasterEnabled = true RPCDefaultBatchSize = 250 RPCBlockQueryDelay = 2 FinalizedBlockOffset = 0 +NoNewFinalizedHeadsThreshold = '0s' [Transactions] ForwardersEnabled = false @@ -4879,6 +5647,7 @@ LimitDefault = 500000 LimitMax = 500000 LimitMultiplier = '1' LimitTransfer = 21000 +EstimateLimit = false BumpMin = '5 gwei' BumpPercent = 20 BumpThreshold = 3 @@ -4894,12 +5663,16 @@ CheckInclusionBlocks = 12 CheckInclusionPercentile = 90 TransactionPercentile = 60 +[GasEstimator.FeeHistory] +CacheTimeout = '10s' + [HeadTracker] HistoryDepth = 100 MaxBufferSize = 3 SamplingInterval = '1s' MaxAllowedFinalityDepth = 10000 FinalityTagBypass = true +PersistenceEnabled = true [NodePool] PollFailureThreshold = 5 @@ -4911,6 +5684,7 @@ NodeIsSyncingEnabled = false FinalizedBlockPollInterval = '5s' EnforceRepeatableRead = false DeathDeclarationDelay = '10s' +NewHeadsPollInterval = '0s' [OCR] ContractConfirmations = 4 @@ -4923,6 +5697,9 @@ ObservationGracePeriod = '1s' [OCR2] [OCR2.Automation] GasLimit = 3800000 + +[Workflow] +GasLimitDefault = 400000 ```

@@ -4944,9 +5721,11 @@ MinIncomingConfirmations = 1 MinContractPayment = '0.00001 link' NonceAutoSync = true NoNewHeadsThreshold = '30s' +LogBroadcasterEnabled = true RPCDefaultBatchSize = 250 RPCBlockQueryDelay = 1 FinalizedBlockOffset = 0 +NoNewFinalizedHeadsThreshold = '0s' [Transactions] ForwardersEnabled = false @@ -4971,6 +5750,7 @@ LimitDefault = 500000 LimitMax = 500000 LimitMultiplier = '1' LimitTransfer = 21000 +EstimateLimit = false BumpMin = '5 gwei' BumpPercent = 20 BumpThreshold = 5 @@ -4986,12 +5766,16 @@ CheckInclusionBlocks = 12 CheckInclusionPercentile = 90 TransactionPercentile = 60 +[GasEstimator.FeeHistory] +CacheTimeout = '10s' + [HeadTracker] HistoryDepth = 100 MaxBufferSize = 3 SamplingInterval = '1s' MaxAllowedFinalityDepth = 10000 FinalityTagBypass = true +PersistenceEnabled = true [NodePool] PollFailureThreshold = 5 @@ -5003,6 +5787,7 @@ NodeIsSyncingEnabled = false FinalizedBlockPollInterval = '5s' EnforceRepeatableRead = false DeathDeclarationDelay = '10s' +NewHeadsPollInterval = '0s' [OCR] ContractConfirmations = 1 @@ -5015,6 +5800,9 @@ ObservationGracePeriod = '1s' [OCR2] [OCR2.Automation] GasLimit = 5400000 + +[Workflow] +GasLimitDefault = 400000 ```

@@ -5027,7 +5815,7 @@ BlockBackfillDepth = 10 BlockBackfillSkip = false ChainType = 'optimismBedrock' FinalityDepth = 200 -FinalityTagEnabled = false +FinalityTagEnabled = true LogBackfillBatchSize = 1000 LogPollInterval = '2s' LogKeepBlocksDepth = 100000 @@ -5037,9 +5825,11 @@ MinIncomingConfirmations = 1 MinContractPayment = '0.00001 link' NonceAutoSync = true NoNewHeadsThreshold = '40s' +LogBroadcasterEnabled = true RPCDefaultBatchSize = 250 RPCBlockQueryDelay = 1 FinalizedBlockOffset = 0 +NoNewFinalizedHeadsThreshold = '15m0s' [Transactions] ForwardersEnabled = false @@ -5064,6 +5854,7 @@ LimitDefault = 500000 LimitMax = 500000 LimitMultiplier = '1' LimitTransfer = 21000 +EstimateLimit = false BumpMin = '100 wei' BumpPercent = 20 BumpThreshold = 3 @@ -5079,12 +5870,16 @@ CheckInclusionBlocks = 12 CheckInclusionPercentile = 90 TransactionPercentile = 60 +[GasEstimator.FeeHistory] +CacheTimeout = '10s' + [HeadTracker] HistoryDepth = 300 MaxBufferSize = 3 SamplingInterval = '1s' MaxAllowedFinalityDepth = 10000 FinalityTagBypass = true +PersistenceEnabled = true [NodePool] PollFailureThreshold = 5 @@ -5096,6 +5891,7 @@ NodeIsSyncingEnabled = false FinalizedBlockPollInterval = '5s' EnforceRepeatableRead = false DeathDeclarationDelay = '10s' +NewHeadsPollInterval = '0s' [OCR] ContractConfirmations = 1 @@ -5108,6 +5904,9 @@ ObservationGracePeriod = '1s' [OCR2] [OCR2.Automation] GasLimit = 6500000 + +[Workflow] +GasLimitDefault = 400000 ```

@@ -5130,9 +5929,11 @@ MinIncomingConfirmations = 3 MinContractPayment = '0.00001 link' NonceAutoSync = true NoNewHeadsThreshold = '3m0s' +LogBroadcasterEnabled = true RPCDefaultBatchSize = 250 RPCBlockQueryDelay = 1 FinalizedBlockOffset = 0 +NoNewFinalizedHeadsThreshold = '2m0s' [Transactions] ForwardersEnabled = false @@ -5157,6 +5958,7 @@ LimitDefault = 500000 LimitMax = 500000 LimitMultiplier = '1' LimitTransfer = 21000 +EstimateLimit = false BumpMin = '5 gwei' BumpPercent = 20 BumpThreshold = 3 @@ -5172,12 +5974,435 @@ CheckInclusionBlocks = 12 CheckInclusionPercentile = 90 TransactionPercentile = 60 +[GasEstimator.FeeHistory] +CacheTimeout = '10s' + +[HeadTracker] +HistoryDepth = 100 +MaxBufferSize = 3 +SamplingInterval = '1s' +MaxAllowedFinalityDepth = 10000 +FinalityTagBypass = true +PersistenceEnabled = true + +[NodePool] +PollFailureThreshold = 5 +PollInterval = '10s' +SelectionMode = 'HighestHead' +SyncThreshold = 5 +LeaseDuration = '0s' +NodeIsSyncingEnabled = false +FinalizedBlockPollInterval = '5s' +EnforceRepeatableRead = false +DeathDeclarationDelay = '10s' +NewHeadsPollInterval = '0s' + +[OCR] +ContractConfirmations = 4 +ContractTransmitterTransmitTimeout = '10s' +DatabaseTimeout = '10s' +DeltaCOverride = '168h0m0s' +DeltaCJitterOverride = '1h0m0s' +ObservationGracePeriod = '1s' + +[OCR2] +[OCR2.Automation] +GasLimit = 5400000 + +[Workflow] +GasLimitDefault = 400000 +``` + +

+ +
L3X Mainnet (12324)

+ +```toml +AutoCreateKey = true +BlockBackfillDepth = 10 +BlockBackfillSkip = false +ChainType = 'arbitrum' +FinalityDepth = 10 +FinalityTagEnabled = true +LinkContractAddress = '0x79f531a3D07214304F259DC28c7191513223bcf3' +LogBackfillBatchSize = 1000 +LogPollInterval = '10s' +LogKeepBlocksDepth = 100000 +LogPrunePageSize = 0 +BackupLogPollerBlockDelay = 100 +MinIncomingConfirmations = 3 +MinContractPayment = '0.00001 link' +NonceAutoSync = true +NoNewHeadsThreshold = '0s' +LogBroadcasterEnabled = true +RPCDefaultBatchSize = 250 +RPCBlockQueryDelay = 1 +FinalizedBlockOffset = 0 +NoNewFinalizedHeadsThreshold = '0s' + +[Transactions] +ForwardersEnabled = false +MaxInFlight = 16 +MaxQueued = 250 +ReaperInterval = '1h0m0s' +ReaperThreshold = '168h0m0s' +ResendAfterThreshold = '1m0s' + +[Transactions.AutoPurge] +Enabled = false + +[BalanceMonitor] +Enabled = true + +[GasEstimator] +Mode = 'Arbitrum' +PriceDefault = '100 mwei' +PriceMax = '115792089237316195423570985008687907853269984665.640564039457584007913129639935 tether' +PriceMin = '0' +LimitDefault = 500000 +LimitMax = 1000000000 +LimitMultiplier = '1' +LimitTransfer = 21000 +EstimateLimit = false +BumpMin = '5 gwei' +BumpPercent = 20 +BumpThreshold = 5 +EIP1559DynamicFees = false +FeeCapDefault = '1 micro' +TipCapDefault = '1 wei' +TipCapMin = '1 wei' + +[GasEstimator.BlockHistory] +BatchSize = 25 +BlockHistorySize = 8 +CheckInclusionBlocks = 12 +CheckInclusionPercentile = 90 +TransactionPercentile = 60 + +[GasEstimator.FeeHistory] +CacheTimeout = '10s' + +[HeadTracker] +HistoryDepth = 100 +MaxBufferSize = 3 +SamplingInterval = '1s' +MaxAllowedFinalityDepth = 10000 +FinalityTagBypass = true +PersistenceEnabled = true + +[NodePool] +PollFailureThreshold = 5 +PollInterval = '10s' +SelectionMode = 'HighestHead' +SyncThreshold = 5 +LeaseDuration = '0s' +NodeIsSyncingEnabled = false +FinalizedBlockPollInterval = '5s' +EnforceRepeatableRead = false +DeathDeclarationDelay = '10s' +NewHeadsPollInterval = '0s' + +[OCR] +ContractConfirmations = 1 +ContractTransmitterTransmitTimeout = '10s' +DatabaseTimeout = '10s' +DeltaCOverride = '168h0m0s' +DeltaCJitterOverride = '1h0m0s' +ObservationGracePeriod = '1s' + +[OCR2] +[OCR2.Automation] +GasLimit = 5400000 + +[Workflow] +GasLimitDefault = 400000 +``` + +

+ +
L3X Sepolia (12325)

+ +```toml +AutoCreateKey = true +BlockBackfillDepth = 10 +BlockBackfillSkip = false +ChainType = 'arbitrum' +FinalityDepth = 10 +FinalityTagEnabled = true +LinkContractAddress = '0xa71848C99155DA0b245981E5ebD1C94C4be51c43' +LogBackfillBatchSize = 1000 +LogPollInterval = '10s' +LogKeepBlocksDepth = 100000 +LogPrunePageSize = 0 +BackupLogPollerBlockDelay = 100 +MinIncomingConfirmations = 3 +MinContractPayment = '0.00001 link' +NonceAutoSync = true +NoNewHeadsThreshold = '0s' +LogBroadcasterEnabled = true +RPCDefaultBatchSize = 250 +RPCBlockQueryDelay = 1 +FinalizedBlockOffset = 0 +NoNewFinalizedHeadsThreshold = '0s' + +[Transactions] +ForwardersEnabled = false +MaxInFlight = 16 +MaxQueued = 250 +ReaperInterval = '1h0m0s' +ReaperThreshold = '168h0m0s' +ResendAfterThreshold = '1m0s' + +[Transactions.AutoPurge] +Enabled = false + +[BalanceMonitor] +Enabled = true + +[GasEstimator] +Mode = 'Arbitrum' +PriceDefault = '100 mwei' +PriceMax = '115792089237316195423570985008687907853269984665.640564039457584007913129639935 tether' +PriceMin = '0' +LimitDefault = 500000 +LimitMax = 1000000000 +LimitMultiplier = '1' +LimitTransfer = 21000 +EstimateLimit = false +BumpMin = '5 gwei' +BumpPercent = 20 +BumpThreshold = 5 +EIP1559DynamicFees = false +FeeCapDefault = '1 micro' +TipCapDefault = '1 wei' +TipCapMin = '1 wei' + +[GasEstimator.BlockHistory] +BatchSize = 25 +BlockHistorySize = 8 +CheckInclusionBlocks = 12 +CheckInclusionPercentile = 90 +TransactionPercentile = 60 + +[GasEstimator.FeeHistory] +CacheTimeout = '10s' + +[HeadTracker] +HistoryDepth = 100 +MaxBufferSize = 3 +SamplingInterval = '1s' +MaxAllowedFinalityDepth = 10000 +FinalityTagBypass = true +PersistenceEnabled = true + +[NodePool] +PollFailureThreshold = 5 +PollInterval = '10s' +SelectionMode = 'HighestHead' +SyncThreshold = 5 +LeaseDuration = '0s' +NodeIsSyncingEnabled = false +FinalizedBlockPollInterval = '5s' +EnforceRepeatableRead = false +DeathDeclarationDelay = '10s' +NewHeadsPollInterval = '0s' + +[OCR] +ContractConfirmations = 1 +ContractTransmitterTransmitTimeout = '10s' +DatabaseTimeout = '10s' +DeltaCOverride = '168h0m0s' +DeltaCJitterOverride = '1h0m0s' +ObservationGracePeriod = '1s' + +[OCR2] +[OCR2.Automation] +GasLimit = 5400000 + +[Workflow] +GasLimitDefault = 400000 +``` + +

+ +
Arbitrum Mainnet (42161)

+ +```toml +AutoCreateKey = true +BlockBackfillDepth = 10 +BlockBackfillSkip = false +ChainType = 'arbitrum' +FinalityDepth = 50 +FinalityTagEnabled = true +LinkContractAddress = '0xf97f4df75117a78c1A5a0DBb814Af92458539FB4' +LogBackfillBatchSize = 1000 +LogPollInterval = '1s' +LogKeepBlocksDepth = 100000 +LogPrunePageSize = 0 +BackupLogPollerBlockDelay = 100 +MinIncomingConfirmations = 3 +MinContractPayment = '0.00001 link' +NonceAutoSync = true +NoNewHeadsThreshold = '0s' +LogBroadcasterEnabled = true +RPCDefaultBatchSize = 250 +RPCBlockQueryDelay = 1 +FinalizedBlockOffset = 0 +NoNewFinalizedHeadsThreshold = '0s' + +[Transactions] +ForwardersEnabled = false +MaxInFlight = 16 +MaxQueued = 250 +ReaperInterval = '1h0m0s' +ReaperThreshold = '168h0m0s' +ResendAfterThreshold = '1m0s' + +[Transactions.AutoPurge] +Enabled = false + +[BalanceMonitor] +Enabled = true + +[GasEstimator] +Mode = 'Arbitrum' +PriceDefault = '100 mwei' +PriceMax = '115792089237316195423570985008687907853269984665.640564039457584007913129639935 tether' +PriceMin = '0' +LimitDefault = 500000 +LimitMax = 1000000000 +LimitMultiplier = '1' +LimitTransfer = 21000 +EstimateLimit = false +BumpMin = '5 gwei' +BumpPercent = 20 +BumpThreshold = 5 +EIP1559DynamicFees = false +FeeCapDefault = '1 micro' +TipCapDefault = '1 wei' +TipCapMin = '1 wei' + +[GasEstimator.BlockHistory] +BatchSize = 25 +BlockHistorySize = 0 +CheckInclusionBlocks = 12 +CheckInclusionPercentile = 90 +TransactionPercentile = 60 + +[GasEstimator.FeeHistory] +CacheTimeout = '10s' + +[HeadTracker] +HistoryDepth = 100 +MaxBufferSize = 3 +SamplingInterval = '1s' +MaxAllowedFinalityDepth = 10000 +FinalityTagBypass = true +PersistenceEnabled = true + +[NodePool] +PollFailureThreshold = 5 +PollInterval = '10s' +SelectionMode = 'HighestHead' +SyncThreshold = 10 +LeaseDuration = '0s' +NodeIsSyncingEnabled = false +FinalizedBlockPollInterval = '5s' +EnforceRepeatableRead = false +DeathDeclarationDelay = '10s' +NewHeadsPollInterval = '0s' + +[OCR] +ContractConfirmations = 1 +ContractTransmitterTransmitTimeout = '10s' +DatabaseTimeout = '10s' +DeltaCOverride = '168h0m0s' +DeltaCJitterOverride = '1h0m0s' +ObservationGracePeriod = '1s' + +[OCR2] +[OCR2.Automation] +GasLimit = 14500000 + +[Workflow] +GasLimitDefault = 400000 +``` + +

+ +
Celo Mainnet (42220)

+ +```toml +AutoCreateKey = true +BlockBackfillDepth = 10 +BlockBackfillSkip = false +ChainType = 'celo' +FinalityDepth = 10 +FinalityTagEnabled = false +LogBackfillBatchSize = 1000 +LogPollInterval = '5s' +LogKeepBlocksDepth = 100000 +LogPrunePageSize = 0 +BackupLogPollerBlockDelay = 100 +MinIncomingConfirmations = 1 +MinContractPayment = '0.00001 link' +NonceAutoSync = true +NoNewHeadsThreshold = '1m0s' +LogBroadcasterEnabled = true +RPCDefaultBatchSize = 250 +RPCBlockQueryDelay = 1 +FinalizedBlockOffset = 0 +NoNewFinalizedHeadsThreshold = '1m0s' + +[Transactions] +ForwardersEnabled = false +MaxInFlight = 16 +MaxQueued = 250 +ReaperInterval = '1h0m0s' +ReaperThreshold = '168h0m0s' +ResendAfterThreshold = '1m0s' + +[Transactions.AutoPurge] +Enabled = false + +[BalanceMonitor] +Enabled = true + +[GasEstimator] +Mode = 'BlockHistory' +PriceDefault = '5 gwei' +PriceMax = '500 gwei' +PriceMin = '5 gwei' +LimitDefault = 500000 +LimitMax = 500000 +LimitMultiplier = '1' +LimitTransfer = 21000 +EstimateLimit = false +BumpMin = '2 gwei' +BumpPercent = 20 +BumpThreshold = 3 +EIP1559DynamicFees = false +FeeCapDefault = '100 gwei' +TipCapDefault = '1 wei' +TipCapMin = '1 wei' + +[GasEstimator.BlockHistory] +BatchSize = 25 +BlockHistorySize = 12 +CheckInclusionBlocks = 12 +CheckInclusionPercentile = 90 +TransactionPercentile = 60 + +[GasEstimator.FeeHistory] +CacheTimeout = '10s' + [HeadTracker] -HistoryDepth = 100 +HistoryDepth = 50 MaxBufferSize = 3 SamplingInterval = '1s' MaxAllowedFinalityDepth = 10000 FinalityTagBypass = true +PersistenceEnabled = true [NodePool] PollFailureThreshold = 5 @@ -5189,9 +6414,10 @@ NodeIsSyncingEnabled = false FinalizedBlockPollInterval = '5s' EnforceRepeatableRead = false DeathDeclarationDelay = '10s' +NewHeadsPollInterval = '0s' [OCR] -ContractConfirmations = 4 +ContractConfirmations = 1 ContractTransmitterTransmitTimeout = '10s' DatabaseTimeout = '10s' DeltaCOverride = '168h0m0s' @@ -5201,11 +6427,14 @@ ObservationGracePeriod = '1s' [OCR2] [OCR2.Automation] GasLimit = 5400000 + +[Workflow] +GasLimitDefault = 400000 ```

-
Arbitrum Mainnet (42161)

+

Avalanche Fuji (43113)

```toml AutoCreateKey = true @@ -5213,20 +6442,22 @@ BlockBackfillDepth = 10 BlockBackfillSkip = false ChainType = 'arbitrum' FinalityDepth = 4350 -FinalityTagEnabled = false -LinkContractAddress = '0xf97f4df75117a78c1A5a0DBb814Af92458539FB4' +FinalityTagEnabled = true +LinkContractAddress = '0x0b9d5D9136855f6FEc3c0993feE6E9CE8a297846' LogBackfillBatchSize = 1000 -LogPollInterval = '1s' +LogPollInterval = '3s' LogKeepBlocksDepth = 100000 LogPrunePageSize = 0 BackupLogPollerBlockDelay = 100 -MinIncomingConfirmations = 3 +MinIncomingConfirmations = 1 MinContractPayment = '0.00001 link' NonceAutoSync = true -NoNewHeadsThreshold = '0s' +NoNewHeadsThreshold = '30s' +LogBroadcasterEnabled = true RPCDefaultBatchSize = 250 -RPCBlockQueryDelay = 1 +RPCBlockQueryDelay = 2 FinalizedBlockOffset = 0 +NoNewFinalizedHeadsThreshold = '1m0s' [Transactions] ForwardersEnabled = false @@ -5243,46 +6474,52 @@ Enabled = false Enabled = true [GasEstimator] -Mode = 'Arbitrum' -PriceDefault = '100 mwei' +Mode = 'BlockHistory' +PriceDefault = '25 gwei' PriceMax = '115792089237316195423570985008687907853269984665.640564039457584007913129639935 tether' -PriceMin = '0' +PriceMin = '25 gwei' LimitDefault = 500000 -LimitMax = 1000000000 +LimitMax = 500000 LimitMultiplier = '1' LimitTransfer = 21000 +EstimateLimit = false BumpMin = '5 gwei' BumpPercent = 20 -BumpThreshold = 5 +BumpThreshold = 3 EIP1559DynamicFees = false -FeeCapDefault = '1 micro' +FeeCapDefault = '100 gwei' TipCapDefault = '1 wei' TipCapMin = '1 wei' [GasEstimator.BlockHistory] BatchSize = 25 -BlockHistorySize = 0 +BlockHistorySize = 24 CheckInclusionBlocks = 12 CheckInclusionPercentile = 90 TransactionPercentile = 60 +[GasEstimator.FeeHistory] +CacheTimeout = '10s' + [HeadTracker] HistoryDepth = 100 MaxBufferSize = 3 SamplingInterval = '1s' MaxAllowedFinalityDepth = 10000 -FinalityTagBypass = true +FinalityTagBypass = false +PersistenceEnabled = true [NodePool] PollFailureThreshold = 5 PollInterval = '10s' SelectionMode = 'HighestHead' -SyncThreshold = 10 +SyncThreshold = 5 LeaseDuration = '0s' NodeIsSyncingEnabled = false FinalizedBlockPollInterval = '5s' EnforceRepeatableRead = false DeathDeclarationDelay = '10s' +NewHeadsPollInterval = '0s' [OCR] ContractConfirmations = 1 @@ -5294,32 +6531,37 @@ ObservationGracePeriod = '1s' [OCR2] [OCR2.Automation] -GasLimit = 14500000 +GasLimit = 5400000 + +[Workflow] +GasLimitDefault = 400000 ```

-
Celo Mainnet (42220)

+

Avalanche Mainnet (43114)

```toml AutoCreateKey = true BlockBackfillDepth = 10 BlockBackfillSkip = false -ChainType = 'celo' FinalityDepth = 10 -FinalityTagEnabled = false +FinalityTagEnabled = true +LinkContractAddress = '0x5947BB275c521040051D82396192181b413227A3' LogBackfillBatchSize = 1000 -LogPollInterval = '5s' +LogPollInterval = '3s' LogKeepBlocksDepth = 100000 LogPrunePageSize = 0 BackupLogPollerBlockDelay = 100 MinIncomingConfirmations = 1 MinContractPayment = '0.00001 link' NonceAutoSync = true -NoNewHeadsThreshold = '1m0s' +NoNewHeadsThreshold = '30s' +LogBroadcasterEnabled = true RPCDefaultBatchSize = 250 -RPCBlockQueryDelay = 1 +RPCBlockQueryDelay = 2 FinalizedBlockOffset = 0 +NoNewFinalizedHeadsThreshold = '1m0s' [Transactions] ForwardersEnabled = false @@ -5337,14 +6579,15 @@ Enabled = true [GasEstimator] Mode = 'BlockHistory' -PriceDefault = '5 gwei' -PriceMax = '500 gwei' -PriceMin = '5 gwei' +PriceDefault = '25 gwei' +PriceMax = '115792089237316195423570985008687907853269984665.640564039457584007913129639935 tether' +PriceMin = '25 gwei' LimitDefault = 500000 LimitMax = 500000 LimitMultiplier = '1' LimitTransfer = 21000 -BumpMin = '2 gwei' +EstimateLimit = false +BumpMin = '5 gwei' BumpPercent = 20 BumpThreshold = 3 EIP1559DynamicFees = false @@ -5354,17 +6597,21 @@ TipCapMin = '1 wei' [GasEstimator.BlockHistory] BatchSize = 25 -BlockHistorySize = 12 +BlockHistorySize = 24 CheckInclusionBlocks = 12 CheckInclusionPercentile = 90 TransactionPercentile = 60 +[GasEstimator.FeeHistory] +CacheTimeout = '10s' + [HeadTracker] -HistoryDepth = 50 +HistoryDepth = 100 MaxBufferSize = 3 SamplingInterval = '1s' MaxAllowedFinalityDepth = 10000 FinalityTagBypass = true +PersistenceEnabled = true [NodePool] PollFailureThreshold = 5 @@ -5376,6 +6623,7 @@ NodeIsSyncingEnabled = false FinalizedBlockPollInterval = '5s' EnforceRepeatableRead = false DeathDeclarationDelay = '10s' +NewHeadsPollInterval = '0s' [OCR] ContractConfirmations = 1 @@ -5388,31 +6636,36 @@ ObservationGracePeriod = '1s' [OCR2] [OCR2.Automation] GasLimit = 5400000 + +[Workflow] +GasLimitDefault = 400000 ```

-
Avalanche Fuji (43113)

+

Celo Testnet (44787)

```toml AutoCreateKey = true BlockBackfillDepth = 10 BlockBackfillSkip = false +ChainType = 'celo' FinalityDepth = 10 FinalityTagEnabled = false -LinkContractAddress = '0x0b9d5D9136855f6FEc3c0993feE6E9CE8a297846' LogBackfillBatchSize = 1000 -LogPollInterval = '3s' +LogPollInterval = '5s' LogKeepBlocksDepth = 100000 LogPrunePageSize = 0 BackupLogPollerBlockDelay = 100 MinIncomingConfirmations = 1 MinContractPayment = '0.00001 link' NonceAutoSync = true -NoNewHeadsThreshold = '30s' +NoNewHeadsThreshold = '1m0s' +LogBroadcasterEnabled = true RPCDefaultBatchSize = 250 -RPCBlockQueryDelay = 2 +RPCBlockQueryDelay = 1 FinalizedBlockOffset = 0 +NoNewFinalizedHeadsThreshold = '1m0s' [Transactions] ForwardersEnabled = false @@ -5430,14 +6683,15 @@ Enabled = true [GasEstimator] Mode = 'BlockHistory' -PriceDefault = '25 gwei' -PriceMax = '115792089237316195423570985008687907853269984665.640564039457584007913129639935 tether' -PriceMin = '25 gwei' +PriceDefault = '5 gwei' +PriceMax = '500 gwei' +PriceMin = '5 gwei' LimitDefault = 500000 LimitMax = 500000 LimitMultiplier = '1' LimitTransfer = 21000 -BumpMin = '5 gwei' +EstimateLimit = false +BumpMin = '2 gwei' BumpPercent = 20 BumpThreshold = 3 EIP1559DynamicFees = false @@ -5452,12 +6706,16 @@ CheckInclusionBlocks = 12 CheckInclusionPercentile = 90 TransactionPercentile = 60 +[GasEstimator.FeeHistory] +CacheTimeout = '10s' + [HeadTracker] -HistoryDepth = 100 +HistoryDepth = 50 MaxBufferSize = 3 SamplingInterval = '1s' MaxAllowedFinalityDepth = 10000 -FinalityTagBypass = false +FinalityTagBypass = true +PersistenceEnabled = true [NodePool] PollFailureThreshold = 5 @@ -5469,6 +6727,7 @@ NodeIsSyncingEnabled = false FinalizedBlockPollInterval = '5s' EnforceRepeatableRead = false DeathDeclarationDelay = '10s' +NewHeadsPollInterval = '0s' [OCR] ContractConfirmations = 1 @@ -5481,31 +6740,37 @@ ObservationGracePeriod = '1s' [OCR2] [OCR2.Automation] GasLimit = 5400000 + +[Workflow] +GasLimitDefault = 400000 ```

-
Avalanche Mainnet (43114)

+

Zircuit Sepolia (48899)

```toml AutoCreateKey = true BlockBackfillDepth = 10 BlockBackfillSkip = false -FinalityDepth = 10 -FinalityTagEnabled = false -LinkContractAddress = '0x5947BB275c521040051D82396192181b413227A3' +ChainType = 'optimismBedrock' +FinalityDepth = 1000 +FinalityTagEnabled = true +LinkContractAddress = '0xDEE94506570cA186BC1e3516fCf4fd719C312cCD' LogBackfillBatchSize = 1000 -LogPollInterval = '3s' +LogPollInterval = '2s' LogKeepBlocksDepth = 100000 LogPrunePageSize = 0 BackupLogPollerBlockDelay = 100 -MinIncomingConfirmations = 1 +MinIncomingConfirmations = 3 MinContractPayment = '0.00001 link' NonceAutoSync = true -NoNewHeadsThreshold = '30s' +NoNewHeadsThreshold = '40s' +LogBroadcasterEnabled = true RPCDefaultBatchSize = 250 -RPCBlockQueryDelay = 2 +RPCBlockQueryDelay = 1 FinalizedBlockOffset = 0 +NoNewFinalizedHeadsThreshold = '15m0s' [Transactions] ForwardersEnabled = false @@ -5513,55 +6778,63 @@ MaxInFlight = 16 MaxQueued = 250 ReaperInterval = '1h0m0s' ReaperThreshold = '168h0m0s' -ResendAfterThreshold = '1m0s' +ResendAfterThreshold = '30s' [Transactions.AutoPurge] -Enabled = false +Enabled = true +Threshold = 90 +MinAttempts = 3 [BalanceMonitor] Enabled = true [GasEstimator] Mode = 'BlockHistory' -PriceDefault = '25 gwei' +PriceDefault = '20 gwei' PriceMax = '115792089237316195423570985008687907853269984665.640564039457584007913129639935 tether' -PriceMin = '25 gwei' +PriceMin = '1 wei' LimitDefault = 500000 LimitMax = 500000 LimitMultiplier = '1' LimitTransfer = 21000 -BumpMin = '5 gwei' +EstimateLimit = false +BumpMin = '100 wei' BumpPercent = 20 BumpThreshold = 3 -EIP1559DynamicFees = false +EIP1559DynamicFees = true FeeCapDefault = '100 gwei' TipCapDefault = '1 wei' TipCapMin = '1 wei' [GasEstimator.BlockHistory] BatchSize = 25 -BlockHistorySize = 24 +BlockHistorySize = 60 CheckInclusionBlocks = 12 CheckInclusionPercentile = 90 TransactionPercentile = 60 +[GasEstimator.FeeHistory] +CacheTimeout = '10s' + [HeadTracker] -HistoryDepth = 100 +HistoryDepth = 2000 MaxBufferSize = 3 SamplingInterval = '1s' MaxAllowedFinalityDepth = 10000 FinalityTagBypass = true +PersistenceEnabled = true [NodePool] PollFailureThreshold = 5 PollInterval = '10s' SelectionMode = 'HighestHead' -SyncThreshold = 5 +SyncThreshold = 10 LeaseDuration = '0s' NodeIsSyncingEnabled = false FinalizedBlockPollInterval = '5s' EnforceRepeatableRead = false DeathDeclarationDelay = '10s' +NewHeadsPollInterval = '0s' [OCR] ContractConfirmations = 1 @@ -5573,32 +6846,38 @@ ObservationGracePeriod = '1s' [OCR2] [OCR2.Automation] -GasLimit = 5400000 +GasLimit = 6500000 + +[Workflow] +GasLimitDefault = 400000 ```

-
Celo Testnet (44787)

+

Zircuit Mainnet (48900)

```toml AutoCreateKey = true BlockBackfillDepth = 10 BlockBackfillSkip = false -ChainType = 'celo' -FinalityDepth = 10 -FinalityTagEnabled = false +ChainType = 'optimismBedrock' +FinalityDepth = 1000 +FinalityTagEnabled = true +LinkContractAddress = '0x5D6d033B4FbD2190D99D930719fAbAcB64d2439a' LogBackfillBatchSize = 1000 -LogPollInterval = '5s' +LogPollInterval = '2s' LogKeepBlocksDepth = 100000 LogPrunePageSize = 0 BackupLogPollerBlockDelay = 100 -MinIncomingConfirmations = 1 +MinIncomingConfirmations = 3 MinContractPayment = '0.00001 link' NonceAutoSync = true -NoNewHeadsThreshold = '1m0s' +NoNewHeadsThreshold = '40s' +LogBroadcasterEnabled = true RPCDefaultBatchSize = 250 RPCBlockQueryDelay = 1 FinalizedBlockOffset = 0 +NoNewFinalizedHeadsThreshold = '15m0s' [Transactions] ForwardersEnabled = false @@ -5606,27 +6885,30 @@ MaxInFlight = 16 MaxQueued = 250 ReaperInterval = '1h0m0s' ReaperThreshold = '168h0m0s' -ResendAfterThreshold = '1m0s' +ResendAfterThreshold = '30s' [Transactions.AutoPurge] -Enabled = false +Enabled = true +Threshold = 90 +MinAttempts = 3 [BalanceMonitor] Enabled = true [GasEstimator] Mode = 'BlockHistory' -PriceDefault = '5 gwei' -PriceMax = '500 gwei' -PriceMin = '5 gwei' +PriceDefault = '20 gwei' +PriceMax = '115792089237316195423570985008687907853269984665.640564039457584007913129639935 tether' +PriceMin = '1 wei' LimitDefault = 500000 LimitMax = 500000 LimitMultiplier = '1' LimitTransfer = 21000 -BumpMin = '2 gwei' +EstimateLimit = false +BumpMin = '100 wei' BumpPercent = 20 BumpThreshold = 3 -EIP1559DynamicFees = false +EIP1559DynamicFees = true FeeCapDefault = '100 gwei' TipCapDefault = '1 wei' TipCapMin = '1 wei' @@ -5638,23 +6920,28 @@ CheckInclusionBlocks = 12 CheckInclusionPercentile = 90 TransactionPercentile = 60 +[GasEstimator.FeeHistory] +CacheTimeout = '10s' + [HeadTracker] -HistoryDepth = 50 +HistoryDepth = 2000 MaxBufferSize = 3 SamplingInterval = '1s' MaxAllowedFinalityDepth = 10000 FinalityTagBypass = true +PersistenceEnabled = true [NodePool] PollFailureThreshold = 5 PollInterval = '10s' SelectionMode = 'HighestHead' -SyncThreshold = 5 +SyncThreshold = 10 LeaseDuration = '0s' NodeIsSyncingEnabled = false FinalizedBlockPollInterval = '5s' EnforceRepeatableRead = false DeathDeclarationDelay = '10s' +NewHeadsPollInterval = '0s' [OCR] ContractConfirmations = 1 @@ -5666,7 +6953,10 @@ ObservationGracePeriod = '1s' [OCR2] [OCR2.Automation] -GasLimit = 5400000 +GasLimit = 6500000 + +[Workflow] +GasLimitDefault = 400000 ```

@@ -5688,9 +6978,11 @@ MinIncomingConfirmations = 3 MinContractPayment = '0.00001 link' NonceAutoSync = true NoNewHeadsThreshold = '0s' +LogBroadcasterEnabled = true RPCDefaultBatchSize = 250 RPCBlockQueryDelay = 1 FinalizedBlockOffset = 0 +NoNewFinalizedHeadsThreshold = '0s' [Transactions] ForwardersEnabled = false @@ -5715,6 +7007,7 @@ LimitDefault = 500000 LimitMax = 500000 LimitMultiplier = '1' LimitTransfer = 21000 +EstimateLimit = false BumpMin = '5 gwei' BumpPercent = 40 BumpThreshold = 3 @@ -5730,12 +7023,16 @@ CheckInclusionBlocks = 12 CheckInclusionPercentile = 90 TransactionPercentile = 60 +[GasEstimator.FeeHistory] +CacheTimeout = '10s' + [HeadTracker] HistoryDepth = 100 MaxBufferSize = 3 SamplingInterval = '1s' MaxAllowedFinalityDepth = 10000 FinalityTagBypass = true +PersistenceEnabled = true [NodePool] PollFailureThreshold = 5 @@ -5747,6 +7044,7 @@ NodeIsSyncingEnabled = false FinalizedBlockPollInterval = '5s' EnforceRepeatableRead = false DeathDeclarationDelay = '10s' +NewHeadsPollInterval = '0s' [OCR] ContractConfirmations = 4 @@ -5759,6 +7057,9 @@ ObservationGracePeriod = '1s' [OCR2] [OCR2.Automation] GasLimit = 5400000 + +[Workflow] +GasLimitDefault = 400000 ```

@@ -5780,9 +7081,11 @@ MinIncomingConfirmations = 3 MinContractPayment = '0.00001 link' NonceAutoSync = true NoNewHeadsThreshold = '0s' +LogBroadcasterEnabled = true RPCDefaultBatchSize = 250 RPCBlockQueryDelay = 1 FinalizedBlockOffset = 0 +NoNewFinalizedHeadsThreshold = '0s' [Transactions] ForwardersEnabled = false @@ -5807,6 +7110,7 @@ LimitDefault = 500000 LimitMax = 500000 LimitMultiplier = '1' LimitTransfer = 21000 +EstimateLimit = false BumpMin = '5 gwei' BumpPercent = 20 BumpThreshold = 3 @@ -5822,12 +7126,16 @@ CheckInclusionBlocks = 12 CheckInclusionPercentile = 90 TransactionPercentile = 60 +[GasEstimator.FeeHistory] +CacheTimeout = '10s' + [HeadTracker] HistoryDepth = 1000 MaxBufferSize = 3 SamplingInterval = '1s' MaxAllowedFinalityDepth = 10000 FinalityTagBypass = true +PersistenceEnabled = true [NodePool] PollFailureThreshold = 5 @@ -5839,6 +7147,7 @@ NodeIsSyncingEnabled = false FinalizedBlockPollInterval = '5s' EnforceRepeatableRead = false DeathDeclarationDelay = '10s' +NewHeadsPollInterval = '0s' [OCR] ContractConfirmations = 4 @@ -5851,6 +7160,9 @@ ObservationGracePeriod = '1s' [OCR2] [OCR2.Automation] GasLimit = 5400000 + +[Workflow] +GasLimitDefault = 400000 ```

@@ -5872,9 +7184,11 @@ MinIncomingConfirmations = 3 MinContractPayment = '0.00001 link' NonceAutoSync = true NoNewHeadsThreshold = '0s' +LogBroadcasterEnabled = true RPCDefaultBatchSize = 250 RPCBlockQueryDelay = 1 FinalizedBlockOffset = 0 +NoNewFinalizedHeadsThreshold = '0s' [Transactions] ForwardersEnabled = false @@ -5899,6 +7213,7 @@ LimitDefault = 500000 LimitMax = 500000 LimitMultiplier = '1' LimitTransfer = 21000 +EstimateLimit = false BumpMin = '5 gwei' BumpPercent = 40 BumpThreshold = 3 @@ -5914,12 +7229,16 @@ CheckInclusionBlocks = 12 CheckInclusionPercentile = 90 TransactionPercentile = 60 +[GasEstimator.FeeHistory] +CacheTimeout = '10s' + [HeadTracker] HistoryDepth = 350 MaxBufferSize = 3 SamplingInterval = '1s' MaxAllowedFinalityDepth = 10000 FinalityTagBypass = true +PersistenceEnabled = true [NodePool] PollFailureThreshold = 5 @@ -5931,6 +7250,7 @@ NodeIsSyncingEnabled = false FinalizedBlockPollInterval = '5s' EnforceRepeatableRead = false DeathDeclarationDelay = '10s' +NewHeadsPollInterval = '0s' [OCR] ContractConfirmations = 4 @@ -5943,6 +7263,9 @@ ObservationGracePeriod = '1s' [OCR2] [OCR2.Automation] GasLimit = 5400000 + +[Workflow] +GasLimitDefault = 400000 ```

@@ -5955,7 +7278,7 @@ BlockBackfillDepth = 10 BlockBackfillSkip = false ChainType = 'metis' FinalityDepth = 10 -FinalityTagEnabled = false +FinalityTagEnabled = true LogBackfillBatchSize = 1000 LogPollInterval = '15s' LogKeepBlocksDepth = 100000 @@ -5965,9 +7288,11 @@ MinIncomingConfirmations = 1 MinContractPayment = '0.00001 link' NonceAutoSync = true NoNewHeadsThreshold = '0s' +LogBroadcasterEnabled = true RPCDefaultBatchSize = 250 RPCBlockQueryDelay = 1 FinalizedBlockOffset = 0 +NoNewFinalizedHeadsThreshold = '0s' [Transactions] ForwardersEnabled = false @@ -5992,6 +7317,7 @@ LimitDefault = 500000 LimitMax = 500000 LimitMultiplier = '1' LimitTransfer = 21000 +EstimateLimit = false BumpMin = '5 gwei' BumpPercent = 20 BumpThreshold = 3 @@ -6007,12 +7333,16 @@ CheckInclusionBlocks = 12 CheckInclusionPercentile = 90 TransactionPercentile = 60 +[GasEstimator.FeeHistory] +CacheTimeout = '10s' + [HeadTracker] HistoryDepth = 100 MaxBufferSize = 3 SamplingInterval = '1s' MaxAllowedFinalityDepth = 10000 FinalityTagBypass = true +PersistenceEnabled = true [NodePool] PollFailureThreshold = 5 @@ -6024,6 +7354,7 @@ NodeIsSyncingEnabled = false FinalizedBlockPollInterval = '5s' EnforceRepeatableRead = false DeathDeclarationDelay = '10s' +NewHeadsPollInterval = '0s' [OCR] ContractConfirmations = 1 @@ -6036,6 +7367,9 @@ ObservationGracePeriod = '1s' [OCR2] [OCR2.Automation] GasLimit = 5400000 + +[Workflow] +GasLimitDefault = 400000 ```

@@ -6058,9 +7392,11 @@ MinIncomingConfirmations = 5 MinContractPayment = '0.00001 link' NonceAutoSync = true NoNewHeadsThreshold = '30s' +LogBroadcasterEnabled = true RPCDefaultBatchSize = 100 RPCBlockQueryDelay = 10 FinalizedBlockOffset = 0 +NoNewFinalizedHeadsThreshold = '0s' [Transactions] ForwardersEnabled = false @@ -6078,13 +7414,14 @@ Enabled = true [GasEstimator] Mode = 'BlockHistory' -PriceDefault = '1 gwei' +PriceDefault = '25 gwei' PriceMax = '115792089237316195423570985008687907853269984665.640564039457584007913129639935 tether' -PriceMin = '1 gwei' +PriceMin = '25 gwei' LimitDefault = 500000 LimitMax = 500000 LimitMultiplier = '1' LimitTransfer = 21000 +EstimateLimit = false BumpMin = '20 gwei' BumpPercent = 20 BumpThreshold = 5 @@ -6100,12 +7437,16 @@ CheckInclusionBlocks = 12 CheckInclusionPercentile = 90 TransactionPercentile = 60 +[GasEstimator.FeeHistory] +CacheTimeout = '10s' + [HeadTracker] HistoryDepth = 2000 MaxBufferSize = 3 SamplingInterval = '1s' MaxAllowedFinalityDepth = 10000 FinalityTagBypass = true +PersistenceEnabled = true [NodePool] PollFailureThreshold = 5 @@ -6117,6 +7458,7 @@ NodeIsSyncingEnabled = false FinalizedBlockPollInterval = '5s' EnforceRepeatableRead = false DeathDeclarationDelay = '10s' +NewHeadsPollInterval = '0s' [OCR] ContractConfirmations = 4 @@ -6129,6 +7471,9 @@ ObservationGracePeriod = '1s' [OCR2] [OCR2.Automation] GasLimit = 5400000 + +[Workflow] +GasLimitDefault = 400000 ```

@@ -6150,9 +7495,11 @@ MinIncomingConfirmations = 5 MinContractPayment = '0.00001 link' NonceAutoSync = true NoNewHeadsThreshold = '30s' +LogBroadcasterEnabled = true RPCDefaultBatchSize = 100 RPCBlockQueryDelay = 10 FinalizedBlockOffset = 0 +NoNewFinalizedHeadsThreshold = '12m0s' [Transactions] ForwardersEnabled = false @@ -6170,13 +7517,14 @@ Enabled = true [GasEstimator] Mode = 'BlockHistory' -PriceDefault = '20 gwei' +PriceDefault = '25 gwei' PriceMax = '115792089237316195423570985008687907853269984665.640564039457584007913129639935 tether' -PriceMin = '1 gwei' +PriceMin = '25 gwei' LimitDefault = 500000 LimitMax = 500000 LimitMultiplier = '1' LimitTransfer = 21000 +EstimateLimit = false BumpMin = '20 gwei' BumpPercent = 20 BumpThreshold = 5 @@ -6192,12 +7540,16 @@ CheckInclusionBlocks = 12 CheckInclusionPercentile = 90 TransactionPercentile = 60 +[GasEstimator.FeeHistory] +CacheTimeout = '10s' + [HeadTracker] HistoryDepth = 2000 MaxBufferSize = 3 SamplingInterval = '1s' MaxAllowedFinalityDepth = 10000 FinalityTagBypass = true +PersistenceEnabled = true [NodePool] PollFailureThreshold = 5 @@ -6209,6 +7561,7 @@ NodeIsSyncingEnabled = false FinalizedBlockPollInterval = '5s' EnforceRepeatableRead = false DeathDeclarationDelay = '10s' +NewHeadsPollInterval = '0s' [OCR] ContractConfirmations = 4 @@ -6221,6 +7574,9 @@ ObservationGracePeriod = '1s' [OCR2] [OCR2.Automation] GasLimit = 5400000 + +[Workflow] +GasLimitDefault = 400000 ```

@@ -6243,9 +7599,11 @@ MinIncomingConfirmations = 1 MinContractPayment = '0.00001 link' NonceAutoSync = true NoNewHeadsThreshold = '40s' +LogBroadcasterEnabled = true RPCDefaultBatchSize = 250 RPCBlockQueryDelay = 1 FinalizedBlockOffset = 0 +NoNewFinalizedHeadsThreshold = '0s' [Transactions] ForwardersEnabled = false @@ -6270,6 +7628,7 @@ LimitDefault = 500000 LimitMax = 500000 LimitMultiplier = '1' LimitTransfer = 21000 +EstimateLimit = false BumpMin = '100 wei' BumpPercent = 20 BumpThreshold = 3 @@ -6285,12 +7644,16 @@ CheckInclusionBlocks = 12 CheckInclusionPercentile = 90 TransactionPercentile = 60 +[GasEstimator.FeeHistory] +CacheTimeout = '10s' + [HeadTracker] HistoryDepth = 300 MaxBufferSize = 3 SamplingInterval = '1s' MaxAllowedFinalityDepth = 10000 FinalityTagBypass = true +PersistenceEnabled = true [NodePool] PollFailureThreshold = 5 @@ -6302,6 +7665,7 @@ NodeIsSyncingEnabled = false FinalizedBlockPollInterval = '5s' EnforceRepeatableRead = false DeathDeclarationDelay = '10s' +NewHeadsPollInterval = '0s' [OCR] ContractConfirmations = 1 @@ -6314,6 +7678,9 @@ ObservationGracePeriod = '1s' [OCR2] [OCR2.Automation] GasLimit = 6500000 + +[Workflow] +GasLimitDefault = 400000 ```

@@ -6326,7 +7693,7 @@ BlockBackfillDepth = 10 BlockBackfillSkip = false ChainType = 'optimismBedrock' FinalityDepth = 200 -FinalityTagEnabled = false +FinalityTagEnabled = true LogBackfillBatchSize = 1000 LogPollInterval = '2s' LogKeepBlocksDepth = 100000 @@ -6336,9 +7703,11 @@ MinIncomingConfirmations = 1 MinContractPayment = '0.00001 link' NonceAutoSync = true NoNewHeadsThreshold = '40s' +LogBroadcasterEnabled = true RPCDefaultBatchSize = 250 RPCBlockQueryDelay = 1 FinalizedBlockOffset = 0 +NoNewFinalizedHeadsThreshold = '12m0s' [Transactions] ForwardersEnabled = false @@ -6363,6 +7732,7 @@ LimitDefault = 500000 LimitMax = 500000 LimitMultiplier = '1' LimitTransfer = 21000 +EstimateLimit = false BumpMin = '100 wei' BumpPercent = 20 BumpThreshold = 3 @@ -6378,12 +7748,16 @@ CheckInclusionBlocks = 12 CheckInclusionPercentile = 90 TransactionPercentile = 60 +[GasEstimator.FeeHistory] +CacheTimeout = '10s' + [HeadTracker] HistoryDepth = 300 MaxBufferSize = 3 SamplingInterval = '1s' MaxAllowedFinalityDepth = 10000 FinalityTagBypass = true +PersistenceEnabled = true [NodePool] PollFailureThreshold = 5 @@ -6395,6 +7769,7 @@ NodeIsSyncingEnabled = false FinalizedBlockPollInterval = '5s' EnforceRepeatableRead = false DeathDeclarationDelay = '10s' +NewHeadsPollInterval = '0s' [OCR] ContractConfirmations = 1 @@ -6407,6 +7782,9 @@ ObservationGracePeriod = '1s' [OCR2] [OCR2.Automation] GasLimit = 6500000 + +[Workflow] +GasLimitDefault = 400000 ```

@@ -6430,9 +7808,11 @@ MinIncomingConfirmations = 3 MinContractPayment = '0.00001 link' NonceAutoSync = true NoNewHeadsThreshold = '0s' +LogBroadcasterEnabled = true RPCDefaultBatchSize = 250 RPCBlockQueryDelay = 1 FinalizedBlockOffset = 0 +NoNewFinalizedHeadsThreshold = '0s' [Transactions] ForwardersEnabled = false @@ -6457,6 +7837,7 @@ LimitDefault = 500000 LimitMax = 1000000000 LimitMultiplier = '1' LimitTransfer = 21000 +EstimateLimit = false BumpMin = '5 gwei' BumpPercent = 20 BumpThreshold = 5 @@ -6472,12 +7853,16 @@ CheckInclusionBlocks = 12 CheckInclusionPercentile = 90 TransactionPercentile = 60 +[GasEstimator.FeeHistory] +CacheTimeout = '10s' + [HeadTracker] HistoryDepth = 100 MaxBufferSize = 3 SamplingInterval = '1s' MaxAllowedFinalityDepth = 10000 FinalityTagBypass = true +PersistenceEnabled = true [NodePool] PollFailureThreshold = 5 @@ -6489,6 +7874,7 @@ NodeIsSyncingEnabled = false FinalizedBlockPollInterval = '5s' EnforceRepeatableRead = false DeathDeclarationDelay = '10s' +NewHeadsPollInterval = '0s' [OCR] ContractConfirmations = 1 @@ -6501,6 +7887,9 @@ ObservationGracePeriod = '1s' [OCR2] [OCR2.Automation] GasLimit = 5400000 + +[Workflow] +GasLimitDefault = 400000 ```

@@ -6524,9 +7913,11 @@ MinIncomingConfirmations = 3 MinContractPayment = '0.00001 link' NonceAutoSync = true NoNewHeadsThreshold = '0s' +LogBroadcasterEnabled = true RPCDefaultBatchSize = 250 RPCBlockQueryDelay = 1 FinalizedBlockOffset = 0 +NoNewFinalizedHeadsThreshold = '0s' [Transactions] ForwardersEnabled = false @@ -6551,6 +7942,7 @@ LimitDefault = 500000 LimitMax = 1000000000 LimitMultiplier = '1' LimitTransfer = 21000 +EstimateLimit = false BumpMin = '5 gwei' BumpPercent = 20 BumpThreshold = 5 @@ -6566,12 +7958,16 @@ CheckInclusionBlocks = 12 CheckInclusionPercentile = 90 TransactionPercentile = 60 +[GasEstimator.FeeHistory] +CacheTimeout = '10s' + [HeadTracker] HistoryDepth = 100 MaxBufferSize = 3 SamplingInterval = '1s' MaxAllowedFinalityDepth = 10000 FinalityTagBypass = true +PersistenceEnabled = true [NodePool] PollFailureThreshold = 5 @@ -6583,6 +7979,7 @@ NodeIsSyncingEnabled = false FinalizedBlockPollInterval = '5s' EnforceRepeatableRead = false DeathDeclarationDelay = '10s' +NewHeadsPollInterval = '0s' [OCR] ContractConfirmations = 1 @@ -6595,6 +7992,9 @@ ObservationGracePeriod = '1s' [OCR2] [OCR2.Automation] GasLimit = 14500000 + +[Workflow] +GasLimitDefault = 400000 ```

@@ -6607,7 +8007,7 @@ BlockBackfillDepth = 10 BlockBackfillSkip = false ChainType = 'arbitrum' FinalityDepth = 4350 -FinalityTagEnabled = false +FinalityTagEnabled = true LogBackfillBatchSize = 1000 LogPollInterval = '1s' LogKeepBlocksDepth = 100000 @@ -6617,9 +8017,11 @@ MinIncomingConfirmations = 3 MinContractPayment = '0.00001 link' NonceAutoSync = true NoNewHeadsThreshold = '0s' +LogBroadcasterEnabled = true RPCDefaultBatchSize = 250 RPCBlockQueryDelay = 1 FinalizedBlockOffset = 0 +NoNewFinalizedHeadsThreshold = '0s' [Transactions] ForwardersEnabled = false @@ -6644,6 +8046,7 @@ LimitDefault = 500000 LimitMax = 1000000000 LimitMultiplier = '1' LimitTransfer = 21000 +EstimateLimit = false BumpMin = '5 gwei' BumpPercent = 20 BumpThreshold = 5 @@ -6659,12 +8062,16 @@ CheckInclusionBlocks = 12 CheckInclusionPercentile = 90 TransactionPercentile = 60 +[GasEstimator.FeeHistory] +CacheTimeout = '10s' + [HeadTracker] HistoryDepth = 100 MaxBufferSize = 3 SamplingInterval = '1s' MaxAllowedFinalityDepth = 10000 FinalityTagBypass = true +PersistenceEnabled = true [NodePool] PollFailureThreshold = 5 @@ -6676,6 +8083,7 @@ NodeIsSyncingEnabled = false FinalizedBlockPollInterval = '5s' EnforceRepeatableRead = false DeathDeclarationDelay = '10s' +NewHeadsPollInterval = '0s' [OCR] ContractConfirmations = 1 @@ -6688,6 +8096,9 @@ ObservationGracePeriod = '1s' [OCR2] [OCR2.Automation] GasLimit = 14500000 + +[Workflow] +GasLimitDefault = 400000 ```

@@ -6710,9 +8121,11 @@ MinIncomingConfirmations = 1 MinContractPayment = '0.00001 link' NonceAutoSync = true NoNewHeadsThreshold = '0s' +LogBroadcasterEnabled = true RPCDefaultBatchSize = 250 RPCBlockQueryDelay = 1 FinalizedBlockOffset = 0 +NoNewFinalizedHeadsThreshold = '0s' [Transactions] ForwardersEnabled = false @@ -6737,6 +8150,7 @@ LimitDefault = 500000 LimitMax = 500000 LimitMultiplier = '1' LimitTransfer = 21000 +EstimateLimit = false BumpMin = '1 gwei' BumpPercent = 20 BumpThreshold = 3 @@ -6752,12 +8166,16 @@ CheckInclusionBlocks = 12 CheckInclusionPercentile = 90 TransactionPercentile = 60 +[GasEstimator.FeeHistory] +CacheTimeout = '10s' + [HeadTracker] HistoryDepth = 50 MaxBufferSize = 3 SamplingInterval = '1s' MaxAllowedFinalityDepth = 10000 FinalityTagBypass = true +PersistenceEnabled = true [NodePool] PollFailureThreshold = 5 @@ -6769,6 +8187,7 @@ NodeIsSyncingEnabled = false FinalizedBlockPollInterval = '5s' EnforceRepeatableRead = false DeathDeclarationDelay = '10s' +NewHeadsPollInterval = '0s' [OCR] ContractConfirmations = 1 @@ -6781,6 +8200,9 @@ ObservationGracePeriod = '1s' [OCR2] [OCR2.Automation] GasLimit = 5400000 + +[Workflow] +GasLimitDefault = 400000 ```

@@ -6803,9 +8225,11 @@ MinIncomingConfirmations = 1 MinContractPayment = '0.00001 link' NonceAutoSync = true NoNewHeadsThreshold = '0s' +LogBroadcasterEnabled = true RPCDefaultBatchSize = 250 RPCBlockQueryDelay = 1 FinalizedBlockOffset = 0 +NoNewFinalizedHeadsThreshold = '0s' [Transactions] ForwardersEnabled = false @@ -6830,6 +8254,7 @@ LimitDefault = 500000 LimitMax = 500000 LimitMultiplier = '1' LimitTransfer = 21000 +EstimateLimit = false BumpMin = '1 gwei' BumpPercent = 20 BumpThreshold = 3 @@ -6845,12 +8270,16 @@ CheckInclusionBlocks = 12 CheckInclusionPercentile = 90 TransactionPercentile = 60 +[GasEstimator.FeeHistory] +CacheTimeout = '10s' + [HeadTracker] HistoryDepth = 50 MaxBufferSize = 3 SamplingInterval = '1s' MaxAllowedFinalityDepth = 10000 FinalityTagBypass = true +PersistenceEnabled = true [NodePool] PollFailureThreshold = 5 @@ -6862,6 +8291,7 @@ NodeIsSyncingEnabled = false FinalizedBlockPollInterval = '5s' EnforceRepeatableRead = false DeathDeclarationDelay = '10s' +NewHeadsPollInterval = '0s' [OCR] ContractConfirmations = 1 @@ -6874,6 +8304,9 @@ ObservationGracePeriod = '1s' [OCR2] [OCR2.Automation] GasLimit = 5400000 + +[Workflow] +GasLimitDefault = 400000 ```

@@ -6885,7 +8318,7 @@ AutoCreateKey = true BlockBackfillDepth = 10 BlockBackfillSkip = false FinalityDepth = 50 -FinalityTagEnabled = false +FinalityTagEnabled = true LinkContractAddress = '0x779877A7B0D9E8603169DdbD7836e478b4624789' LogBackfillBatchSize = 1000 LogPollInterval = '15s' @@ -6896,9 +8329,11 @@ MinIncomingConfirmations = 3 MinContractPayment = '0.1 link' NonceAutoSync = true NoNewHeadsThreshold = '3m0s' +LogBroadcasterEnabled = true RPCDefaultBatchSize = 250 RPCBlockQueryDelay = 1 FinalizedBlockOffset = 0 +NoNewFinalizedHeadsThreshold = '0s' [Transactions] ForwardersEnabled = false @@ -6923,6 +8358,7 @@ LimitDefault = 500000 LimitMax = 500000 LimitMultiplier = '1' LimitTransfer = 21000 +EstimateLimit = false BumpMin = '5 gwei' BumpPercent = 20 BumpThreshold = 3 @@ -6938,12 +8374,16 @@ CheckInclusionBlocks = 12 CheckInclusionPercentile = 90 TransactionPercentile = 50 +[GasEstimator.FeeHistory] +CacheTimeout = '10s' + [HeadTracker] HistoryDepth = 100 MaxBufferSize = 3 SamplingInterval = '1s' MaxAllowedFinalityDepth = 10000 FinalityTagBypass = false +PersistenceEnabled = true [NodePool] PollFailureThreshold = 5 @@ -6955,6 +8395,7 @@ NodeIsSyncingEnabled = false FinalizedBlockPollInterval = '5s' EnforceRepeatableRead = false DeathDeclarationDelay = '10s' +NewHeadsPollInterval = '0s' [OCR] ContractConfirmations = 4 @@ -6967,6 +8408,9 @@ ObservationGracePeriod = '1s' [OCR2] [OCR2.Automation] GasLimit = 10500000 + +[Workflow] +GasLimitDefault = 400000 ```

@@ -6979,7 +8423,7 @@ BlockBackfillDepth = 10 BlockBackfillSkip = false ChainType = 'optimismBedrock' FinalityDepth = 200 -FinalityTagEnabled = false +FinalityTagEnabled = true LogBackfillBatchSize = 1000 LogPollInterval = '2s' LogKeepBlocksDepth = 100000 @@ -6989,9 +8433,11 @@ MinIncomingConfirmations = 1 MinContractPayment = '0.00001 link' NonceAutoSync = true NoNewHeadsThreshold = '40s' +LogBroadcasterEnabled = true RPCDefaultBatchSize = 250 RPCBlockQueryDelay = 1 FinalizedBlockOffset = 0 +NoNewFinalizedHeadsThreshold = '15m0s' [Transactions] ForwardersEnabled = false @@ -7016,6 +8462,7 @@ LimitDefault = 500000 LimitMax = 500000 LimitMultiplier = '1' LimitTransfer = 21000 +EstimateLimit = false BumpMin = '100 wei' BumpPercent = 20 BumpThreshold = 3 @@ -7031,12 +8478,16 @@ CheckInclusionBlocks = 12 CheckInclusionPercentile = 90 TransactionPercentile = 60 +[GasEstimator.FeeHistory] +CacheTimeout = '10s' + [HeadTracker] HistoryDepth = 300 MaxBufferSize = 3 SamplingInterval = '1s' MaxAllowedFinalityDepth = 10000 FinalityTagBypass = true +PersistenceEnabled = true [NodePool] PollFailureThreshold = 5 @@ -7048,6 +8499,7 @@ NodeIsSyncingEnabled = false FinalizedBlockPollInterval = '5s' EnforceRepeatableRead = false DeathDeclarationDelay = '10s' +NewHeadsPollInterval = '0s' [OCR] ContractConfirmations = 1 @@ -7060,6 +8512,9 @@ ObservationGracePeriod = '1s' [OCR2] [OCR2.Automation] GasLimit = 6500000 + +[Workflow] +GasLimitDefault = 400000 ```

@@ -7082,9 +8537,11 @@ MinIncomingConfirmations = 1 MinContractPayment = '0.00001 link' NonceAutoSync = true NoNewHeadsThreshold = '30s' +LogBroadcasterEnabled = true RPCDefaultBatchSize = 250 RPCBlockQueryDelay = 1 FinalizedBlockOffset = 0 +NoNewFinalizedHeadsThreshold = '0s' [Transactions] ForwardersEnabled = false @@ -7109,6 +8566,7 @@ LimitDefault = 500000 LimitMax = 500000 LimitMultiplier = '1' LimitTransfer = 21000 +EstimateLimit = false BumpMin = '5 gwei' BumpPercent = 20 BumpThreshold = 3 @@ -7124,12 +8582,16 @@ CheckInclusionBlocks = 12 CheckInclusionPercentile = 90 TransactionPercentile = 60 +[GasEstimator.FeeHistory] +CacheTimeout = '10s' + [HeadTracker] HistoryDepth = 100 MaxBufferSize = 3 SamplingInterval = '1s' MaxAllowedFinalityDepth = 10000 FinalityTagBypass = true +PersistenceEnabled = true [NodePool] PollFailureThreshold = 5 @@ -7141,6 +8603,7 @@ NodeIsSyncingEnabled = false FinalizedBlockPollInterval = '5s' EnforceRepeatableRead = false DeathDeclarationDelay = '10s' +NewHeadsPollInterval = '0s' [OCR] ContractConfirmations = 4 @@ -7153,6 +8616,9 @@ ObservationGracePeriod = '1s' [OCR2] [OCR2.Automation] GasLimit = 5400000 + +[Workflow] +GasLimitDefault = 400000 ```

@@ -7175,9 +8641,11 @@ MinIncomingConfirmations = 1 MinContractPayment = '0.00001 link' NonceAutoSync = true NoNewHeadsThreshold = '30s' +LogBroadcasterEnabled = true RPCDefaultBatchSize = 250 RPCBlockQueryDelay = 1 FinalizedBlockOffset = 0 +NoNewFinalizedHeadsThreshold = '0s' [Transactions] ForwardersEnabled = false @@ -7202,6 +8670,7 @@ LimitDefault = 500000 LimitMax = 500000 LimitMultiplier = '1' LimitTransfer = 21000 +EstimateLimit = false BumpMin = '5 gwei' BumpPercent = 20 BumpThreshold = 3 @@ -7217,12 +8686,16 @@ CheckInclusionBlocks = 12 CheckInclusionPercentile = 90 TransactionPercentile = 60 +[GasEstimator.FeeHistory] +CacheTimeout = '10s' + [HeadTracker] HistoryDepth = 100 MaxBufferSize = 3 SamplingInterval = '1s' MaxAllowedFinalityDepth = 10000 FinalityTagBypass = true +PersistenceEnabled = true [NodePool] PollFailureThreshold = 5 @@ -7234,6 +8707,7 @@ NodeIsSyncingEnabled = false FinalizedBlockPollInterval = '5s' EnforceRepeatableRead = false DeathDeclarationDelay = '10s' +NewHeadsPollInterval = '0s' [OCR] ContractConfirmations = 4 @@ -7246,6 +8720,9 @@ ObservationGracePeriod = '1s' [OCR2] [OCR2.Automation] GasLimit = 5400000 + +[Workflow] +GasLimitDefault = 400000 ```

@@ -7287,7 +8764,7 @@ BlockBackfillSkip enables skipping of very long backfills. ChainType = 'arbitrum' # Example ``` ChainType is automatically detected from chain ID. Set this to force a certain chain type regardless of chain ID. -Available types: `arbitrum`, `celo`, `gnosis`, `kroma`, `metis`, `optimismBedrock`, `scroll`, `wemix`, `xlayer`, `zksync` +Available types: `arbitrum`, `celo`, `gnosis`, `hedera`, `kroma`, `metis`, `optimismBedrock`, `scroll`, `wemix`, `xlayer`, `zksync` ### FinalityDepth ```toml @@ -7438,6 +8915,21 @@ The latest finalized block on chain is 64, so block 63 is the latest finalized f Block 64 will be treated as finalized by CL Node only when chain's latest finalized block is 65. As chain finalizes blocks in batches of 32, CL Node has to wait for a whole new batch to be finalized to treat block 64 as finalized. +### LogBroadcasterEnabled +```toml +LogBroadcasterEnabled = true # Default +``` +LogBroadcasterEnabled is a feature flag for LogBroadcaster, by default it's true. + +### NoNewFinalizedHeadsThreshold +```toml +NoNewFinalizedHeadsThreshold = '0' # Default +``` +NoNewFinalizedHeadsThreshold controls how long to wait for new finalized block before `NodePool` marks rpc endpoints as +out-of-sync. Only applicable if `FinalityTagEnabled=true` + +Set to zero to disable. + ## EVM.Transactions ```toml [EVM.Transactions] @@ -7554,6 +9046,7 @@ LimitDefault = 500_000 # Default LimitMax = 500_000 # Default LimitMultiplier = '1.0' # Default LimitTransfer = 21_000 # Default +EstimateLimit = false # Default BumpMin = '5 gwei' # Default BumpPercent = 20 # Default BumpThreshold = 3 # Default @@ -7648,6 +9141,12 @@ LimitTransfer = 21_000 # Default ``` LimitTransfer is the gas limit used for an ordinary ETH transfer. +### EstimateLimit +```toml +EstimateLimit = false # Default +``` +EstimateLimit enables estimating gas limits for transactions. This feature respects the gas limit provided during transaction creation as an upper bound. + ### BumpMin ```toml BumpMin = '5 gwei' # Default @@ -7861,6 +9360,24 @@ Setting this number higher will cause the Chainlink node to select higher gas pr Setting it lower will tend to set lower gas prices. +## EVM.GasEstimator.FeeHistory +```toml +[EVM.GasEstimator.FeeHistory] +CacheTimeout = '10s' # Default +``` + + +### CacheTimeout +```toml +CacheTimeout = '10s' # Default +``` +CacheTimeout is the time to wait in order to refresh the cached values stored in the FeeHistory estimator. A small jitter is applied so the timeout won't be exactly the same each time. + +You want this value to be close to the block time. For slower chains, like Ethereum, you can set it to 12s, the same as the block time. For faster chains you can skip a block or two +and set it to two times the block time i.e. on Optimism you can set it to 4s. Ideally, you don't want to go lower than 1s since the RTT times of the RPC requests will be comparable to +the timeout. The estimator is already adding a buffer to account for a potential increase in prices within one or two blocks. On the other hand, slower frequency will fail to refresh +the prices and end up in stale values. + ## EVM.HeadTracker ```toml [EVM.HeadTracker] @@ -7869,6 +9386,7 @@ MaxBufferSize = 3 # Default SamplingInterval = '1s' # Default FinalityTagBypass = true # Default MaxAllowedFinalityDepth = 10000 # Default +PersistenceEnabled = true # Default ``` The head tracker continually listens for new heads from the chain. @@ -7915,6 +9433,15 @@ MaxAllowedFinalityDepth - defines maximum number of blocks between the most rece If actual finality depth exceeds this number, HeadTracker aborts backfill and returns an error. Has no effect if `FinalityTagsEnabled` = false +### PersistenceEnabled +```toml +PersistenceEnabled = true # Default +``` +PersistenceEnabled defines whether HeadTracker needs to store heads in the database. +Persistence is helpful on chains with large finality depth, where fetching blocks from the latest to the latest finalized takes a lot of time. +On chains with fast finality, the persistence layer does not improve the chain's load time and only consumes database resources (mainly IO). +NOTE: persistence should not be disabled for products that use LogBroadcaster, as it might lead to missed on-chain events. + ## EVM.KeySpecific ```toml [[EVM.KeySpecific]] @@ -7947,6 +9474,7 @@ NodeIsSyncingEnabled = false # Default FinalizedBlockPollInterval = '5s' # Default EnforceRepeatableRead = false # Default DeathDeclarationDelay = '10s' # Default +NewHeadsPollInterval = '0s' # Default ``` The node pool manages multiple RPC endpoints. @@ -8039,6 +9567,14 @@ Larger values might be helpful to reduce the noisiness of health checks like `En trigger declaration of `FinalizedBlockOutOfSync` due to insignificant network delays in broadcasting of the finalized state among RPCs. RPC will not be picked to handle a request even if this option is set to a nonzero value. +### NewHeadsPollInterval +```toml +NewHeadsPollInterval = '0s' # Default +``` +NewHeadsPollInterval define an interval for polling new block periodically using http client rather than subscribe to ws feed + +Set to 0 to disable. + ## EVM.NodePool.Errors :warning: **_ADVANCED_**: _Do not change these settings unless you know what you are doing._ ```toml @@ -8057,6 +9593,7 @@ L2Full = '(: |^)l2 full' # Example TransactionAlreadyMined = '(: |^)transaction already mined' # Example Fatal = '(: |^)fatal' # Example ServiceUnavailable = '(: |^)service unavailable' # Example +TooManyResults = '(: |^)too many results' # Example ``` Errors enable the node to provide custom regex patterns to match against error messages from RPCs. @@ -8144,6 +9681,12 @@ ServiceUnavailable = '(: |^)service unavailable' # Example ``` ServiceUnavailable is a regex pattern to match against service unavailable errors. +### TooManyResults +```toml +TooManyResults = '(: |^)too many results' # Example +``` +TooManyResults is a regex pattern to match an eth_getLogs error indicating the result set is too large to return + ## EVM.OCR ```toml [EVM.OCR] @@ -8255,6 +9798,7 @@ GasLimit controls the gas limit for transmit transactions from ocr2automation jo [EVM.Workflow] FromAddress = '0x2a3e23c6f242F5345320814aC8a1b4E58707D292' # Example ForwarderAddress = '0x2a3e23c6f242F5345320814aC8a1b4E58707D292' # Example +GasLimitDefault = 400_000 # Default ``` @@ -8270,6 +9814,12 @@ ForwarderAddress = '0x2a3e23c6f242F5345320814aC8a1b4E58707D292' # Example ``` ForwarderAddress is the keystone forwarder contract address on chain. +### GasLimitDefault +```toml +GasLimitDefault = 400_000 # Default +``` +GasLimitDefault is the default gas limit for workflow transactions. + ## Cosmos ```toml [[Cosmos]] @@ -8408,6 +9958,7 @@ ComputeUnitPriceMin = 0 # Default ComputeUnitPriceDefault = 0 # Default FeeBumpPeriod = '3s' # Default BlockHistoryPollPeriod = '5s' # Default +ComputeUnitLimitDefault = 200_000 # Default ``` @@ -8520,11 +10071,18 @@ BlockHistoryPollPeriod = '5s' # Default ``` BlockHistoryPollPeriod is the rate to poll for blocks in the block history fee estimator +### ComputeUnitLimitDefault +```toml +ComputeUnitLimitDefault = 200_000 # Default +``` +ComputeUnitLimitDefault is the compute units limit applied to transactions unless overriden during the txm enqueue + ## Solana.Nodes ```toml [[Solana.Nodes]] Name = 'primary' # Example URL = 'http://solana.web' # Example +SendOnly = false # Default ``` @@ -8540,6 +10098,12 @@ URL = 'http://solana.web' # Example ``` URL is the HTTP(S) endpoint for this node. +### SendOnly +```toml +SendOnly = false # Default +``` +SendOnly is a multinode config that only sends transactions to a node and does not read state + ## Starknet ```toml [[Starknet]] diff --git a/flake.lock b/flake.lock index da3a69cd248..77dddea4060 100644 --- a/flake.lock +++ b/flake.lock @@ -26,11 +26,11 @@ "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1714727549, - "narHash": "sha256-CWXRTxxcgMfQubJugpeg3yVWIfm70MYTtgaKWKgD60U=", + "lastModified": 1725354688, + "narHash": "sha256-KHHFemVt6C/hbGoMzIq7cpxmjdp+KZVZaqbvx02aliY=", "owner": "shazow", "repo": "foundry.nix", - "rev": "47cf189ec395eda4b3e0623179d1075c8027ca97", + "rev": "671672bd60a0d2e5f6757638fdf27e806df755a4", "type": "github" }, "original": { @@ -56,11 +56,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1712439257, - "narHash": "sha256-aSpiNepFOMk9932HOax0XwNxbA38GOUVOiXfUVPOrck=", + "lastModified": 1725103162, + "narHash": "sha256-Ym04C5+qovuQDYL/rKWSR+WESseQBbNAe5DsXNx5trY=", "owner": "nixos", "repo": "nixpkgs", - "rev": "ff0dbd94265ac470dda06a657d5fe49de93b4599", + "rev": "12228ff1752d7b7624a54e9c1af4b222b3c1073b", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index f65847455b2..7e188857ba4 100644 --- a/flake.nix +++ b/flake.nix @@ -8,15 +8,22 @@ foundry.inputs.flake-utils.follows = "flake-utils"; }; - outputs = inputs@{ self, nixpkgs, flake-utils, foundry, ... }: - flake-utils.lib.eachDefaultSystem (system: - let - pkgs = import nixpkgs { inherit system; overlays = [ foundry.overlay ]; }; - in - rec { - devShell = pkgs.callPackage ./shell.nix { - inherit pkgs; - }; - formatter = pkgs.nixpkgs-fmt; - }); + outputs = inputs @ { + self, + nixpkgs, + flake-utils, + foundry, + ... + }: + flake-utils.lib.eachDefaultSystem (system: let + pkgs = import nixpkgs { + inherit system; + overlays = [foundry.overlay]; + }; + in rec { + devShell = pkgs.callPackage ./shell.nix { + inherit pkgs; + }; + formatter = pkgs.nixpkgs-fmt; + }); } diff --git a/fuzz/fuzz_all_native.py b/fuzz/fuzz_all_native.py index 41588b090b7..aa191fc5e8d 100755 --- a/fuzz/fuzz_all_native.py +++ b/fuzz/fuzz_all_native.py @@ -7,8 +7,6 @@ import subprocess import sys -LIBROOT = "../" - def main(): parser = argparse.ArgumentParser( formatter_class=argparse.RawDescriptionHelpFormatter, @@ -19,6 +17,7 @@ def main(): ) parser.add_argument("--ci", required=False, help="In CI mode we run each parser only briefly once", action="store_true") parser.add_argument("--seconds", required=False, help="Run for this many seconds of total fuzz time before exiting") + parser.add_argument("--go_module_root", required=True, help="Path to the root of the go module to fuzz") args = parser.parse_args() # use float for remaining_seconds so we can represent infinity @@ -27,7 +26,7 @@ def main(): else: remaining_seconds = float("inf") - fuzzers = discover_fuzzers() + fuzzers = discover_fuzzers(args.go_module_root) print(f"🐝 Discovered fuzzers:", file=sys.stderr) for fuzzfn, path in fuzzers.items(): print(f"{fuzzfn} in {path}", file=sys.stderr) @@ -50,12 +49,12 @@ def main(): remaining_seconds -= next_duration_seconds print(f"🐝 Running {fuzzfn} in {path} for {next_duration_seconds}s before switching to next fuzzer", file=sys.stderr) - run_fuzzer(fuzzfn, path, next_duration_seconds) + run_fuzzer(fuzzfn, path, next_duration_seconds, args.go_module_root) print(f"🐝 Completed running {fuzzfn} in {path} for {next_duration_seconds}s. Total remaining time is {remaining_seconds}s", file=sys.stderr) -def discover_fuzzers(): +def discover_fuzzers(go_module_root): fuzzers = {} - for root, dirs, files in os.walk(LIBROOT): + for root, dirs, files in os.walk(go_module_root): for file in files: if not file.endswith("test.go"): continue with open(os.path.join(root, file), "r") as f: @@ -68,11 +67,11 @@ def discover_fuzzers(): for fuzzfn in re.findall(r"func\s+(Fuzz\w+)", text): if fuzzfn in fuzzers: raise Exception(f"Duplicate fuzz function: {fuzzfn}") - fuzzers[fuzzfn] = os.path.relpath(root, LIBROOT) + fuzzers[fuzzfn] = os.path.relpath(root, go_module_root) return fuzzers -def run_fuzzer(fuzzfn, dir, duration_seconds): - subprocess.check_call(["go", "test", "-run=^$", f"-fuzz=^{fuzzfn}$", f"-fuzztime={duration_seconds}s", f"./{dir}"], cwd=LIBROOT) +def run_fuzzer(fuzzfn, dir, duration_seconds, go_module_root): + subprocess.check_call(["go", "test", "-run=^$", f"-fuzz=^{fuzzfn}$", f"-fuzztime={duration_seconds}s", f"./{dir}"], cwd=go_module_root) if __name__ == "__main__": main() \ No newline at end of file diff --git a/go.md b/go.md index 4ef6c4da9e4..3100bd2db0e 100644 --- a/go.md +++ b/go.md @@ -5,11 +5,7 @@ flowchart LR chainlink-cosmos chainlink-solana chainlink-starknet/relayer - subgraph chainlink-integrations - direction LR - chainlink-integrations/evm/relayer - chainlink-integrations/common - end + chainlink-evm end subgraph products @@ -21,13 +17,20 @@ flowchart LR chainlink-vrf end + subgraph tdh2 + tdh2/go/tdh2 + tdh2/go/ocr2/decryptionplugin + end + classDef outline stroke-dasharray:6,fill:none; - class chains,products outline + class chains,products,tdh2 outline chainlink/v2 --> chain-selectors click chain-selectors href "https://github.com/smartcontractkit/chain-selectors" chainlink/v2 --> chainlink-automation click chainlink-automation href "https://github.com/smartcontractkit/chainlink-automation" + chainlink/v2 --> chainlink-ccip + click chainlink-ccip href "https://github.com/smartcontractkit/chainlink-ccip" chainlink/v2 --> chainlink-common click chainlink-common href "https://github.com/smartcontractkit/chainlink-common" chainlink/v2 --> chainlink-cosmos @@ -40,6 +43,8 @@ flowchart LR click chainlink-solana href "https://github.com/smartcontractkit/chainlink-solana" chainlink/v2 --> chainlink-starknet/relayer click chainlink-starknet/relayer href "https://github.com/smartcontractkit/chainlink-starknet" + chainlink/v2 --> grpc-proxy + click grpc-proxy href "https://github.com/smartcontractkit/grpc-proxy" chainlink/v2 --> libocr click libocr href "https://github.com/smartcontractkit/libocr" chainlink/v2 --> tdh2/go/ocr2/decryptionplugin @@ -50,18 +55,26 @@ flowchart LR click wsrpc href "https://github.com/smartcontractkit/wsrpc" chainlink-automation --> chainlink-common chainlink-automation --> libocr + chainlink-ccip --> chain-selectors + chainlink-ccip --> chainlink-common + chainlink-ccip --> libocr + chainlink-common --> grpc-proxy chainlink-common --> libocr chainlink-cosmos --> chainlink-common chainlink-cosmos --> libocr - chainlink-data-streams --> chain-selectors + chainlink-cosmos --> grpc-proxy chainlink-data-streams --> chainlink-common chainlink-data-streams --> libocr + chainlink-data-streams --> grpc-proxy chainlink-feeds --> chainlink-common chainlink-feeds --> libocr + chainlink-feeds --> grpc-proxy chainlink-solana --> chainlink-common chainlink-solana --> libocr + chainlink-solana --> grpc-proxy chainlink-starknet/relayer --> chainlink-common chainlink-starknet/relayer --> libocr + chainlink-starknet/relayer --> grpc-proxy tdh2/go/ocr2/decryptionplugin --> libocr tdh2/go/ocr2/decryptionplugin --> tdh2/go/tdh2 ``` diff --git a/go.mod b/go.mod index 30fe2b5e5e2..f49dabbad39 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/smartcontractkit/chainlink/v2 -go 1.21.7 +go 1.22.5 require ( github.com/Depado/ginprom v1.8.0 @@ -9,36 +9,38 @@ require ( github.com/NethermindEth/juno v0.3.1 github.com/NethermindEth/starknet.go v0.7.1-0.20240401080518-34a506f3cfdb github.com/XSAM/otelsql v0.27.0 - github.com/avast/retry-go/v4 v4.5.1 + github.com/avast/retry-go/v4 v4.6.0 github.com/btcsuite/btcd/btcec/v2 v2.3.2 - github.com/cometbft/cometbft v0.37.2 - github.com/cosmos/cosmos-sdk v0.47.4 + github.com/cometbft/cometbft v0.37.5 + github.com/cosmos/cosmos-sdk v0.47.11 github.com/danielkov/gin-helmet v0.0.0-20171108135313-1387e224435e + github.com/deckarep/golang-set/v2 v2.6.0 github.com/dominikbraun/graph v0.23.0 github.com/esote/minmaxheap v1.0.0 github.com/ethereum/go-ethereum v1.13.8 - github.com/fatih/color v1.16.0 - github.com/fxamacker/cbor/v2 v2.5.0 + github.com/fatih/color v1.17.0 + github.com/fxamacker/cbor/v2 v2.7.0 github.com/gagliardetto/solana-go v1.8.4 - github.com/getsentry/sentry-go v0.19.0 + github.com/getsentry/sentry-go v0.23.0 github.com/gin-contrib/cors v1.5.0 github.com/gin-contrib/expvar v0.0.1 github.com/gin-contrib/sessions v0.0.5 github.com/gin-contrib/size v0.0.0-20230212012657-e14a14094dc4 github.com/gin-gonic/gin v1.9.1 github.com/go-ldap/ldap/v3 v3.4.6 + github.com/go-viper/mapstructure/v2 v2.1.0 github.com/go-webauthn/webauthn v0.9.4 - github.com/google/pprof v0.0.0-20231023181126-ff6d637d2a7b + github.com/google/pprof v0.0.0-20240424215950-a892ee059fd6 github.com/google/uuid v1.6.0 github.com/gorilla/securecookie v1.1.2 github.com/gorilla/sessions v1.2.2 github.com/gorilla/websocket v1.5.1 github.com/grafana/pyroscope-go v1.1.1 github.com/graph-gophers/dataloader v5.0.0+incompatible - github.com/graph-gophers/graphql-go v1.3.0 + github.com/graph-gophers/graphql-go v1.5.0 github.com/hashicorp/consul/sdk v0.16.0 github.com/hashicorp/go-envparse v0.1.0 - github.com/hashicorp/go-plugin v1.6.0 + github.com/hashicorp/go-plugin v1.6.2-0.20240829161738-06afb6d7ae99 github.com/hashicorp/go-retryablehttp v0.7.5 github.com/hdevalence/ed25519consensus v0.1.0 github.com/jackc/pgconn v1.14.3 @@ -52,36 +54,37 @@ require ( github.com/lib/pq v1.10.9 github.com/manyminds/api2go v0.0.0-20171030193247-e7b693844a6f github.com/mitchellh/go-homedir v1.1.0 - github.com/mitchellh/mapstructure v1.5.0 github.com/mr-tron/base58 v1.2.0 github.com/olekukonko/tablewriter v0.0.5 - github.com/onsi/gomega v1.30.0 + github.com/onsi/gomega v1.33.1 github.com/patrickmn/go-cache v2.1.0+incompatible github.com/pelletier/go-toml v1.9.5 - github.com/pelletier/go-toml/v2 v2.2.0 + github.com/pelletier/go-toml/v2 v2.2.2 github.com/pkg/errors v0.9.1 github.com/pressly/goose/v3 v3.21.1 - github.com/prometheus/client_golang v1.17.0 - github.com/prometheus/client_model v0.5.0 - github.com/prometheus/common v0.45.0 + github.com/prometheus/client_golang v1.20.0 + github.com/prometheus/client_model v0.6.1 + github.com/prometheus/common v0.59.1 github.com/prometheus/prometheus v0.48.1 github.com/robfig/cron/v3 v3.0.1 github.com/rogpeppe/go-internal v1.12.0 + github.com/rs/zerolog v1.32.0 github.com/scylladb/go-reflectx v1.0.1 github.com/shirou/gopsutil/v3 v3.24.3 - github.com/shopspring/decimal v1.3.1 - github.com/smartcontractkit/chain-selectors v1.0.10 + github.com/shopspring/decimal v1.4.0 + github.com/smartcontractkit/chain-selectors v1.0.23 github.com/smartcontractkit/chainlink-automation v1.0.4 - github.com/smartcontractkit/chainlink-common v0.1.7-0.20240709155552-d76403db14e5 - github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20240710121324-3ed288aa9b45 - github.com/smartcontractkit/chainlink-data-streams v0.0.0-20240702145022-37a2c3a742d1 - github.com/smartcontractkit/chainlink-feeds v0.0.0-20240522213638-159fb2d99917 - github.com/smartcontractkit/chainlink-solana v1.0.3-0.20240708150922-0546185ead68 - github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240709043547-03612098f799 - github.com/smartcontractkit/libocr v0.0.0-20240702141926-063ceef8c42e + github.com/smartcontractkit/chainlink-ccip v0.0.0-20240930060710-158d2a9ac9ca + github.com/smartcontractkit/chainlink-common v0.2.3-0.20240927162447-20630b333f57 + github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20240911175228-daf2600bb7b7 + github.com/smartcontractkit/chainlink-data-streams v0.0.0-20240916152957-433914114bd2 + github.com/smartcontractkit/chainlink-feeds v0.0.0-20240910155501-42f20443189f + github.com/smartcontractkit/chainlink-solana v1.1.1-0.20240927143737-7e527aa85bff + github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240911194142-506bc469d8ae + github.com/smartcontractkit/libocr v0.0.0-20240717100443-f6226e09bee7 github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin v0.0.0-20230906073235-9e478e5e19f1 github.com/smartcontractkit/tdh2/go/tdh2 v0.0.0-20230906073235-9e478e5e19f1 - github.com/smartcontractkit/wsrpc v0.7.3 + github.com/smartcontractkit/wsrpc v0.8.2 github.com/spf13/cast v1.6.0 github.com/stretchr/testify v1.9.0 github.com/test-go/testify v1.1.4 @@ -92,40 +95,48 @@ require ( github.com/umbracle/ethgo v0.1.3 github.com/unrolled/secure v1.13.0 github.com/urfave/cli v1.22.14 + github.com/wk8/go-ordered-map/v2 v2.1.8 go.dedis.ch/fixbuf v1.0.3 go.dedis.ch/kyber/v3 v3.1.0 go.opentelemetry.io/contrib/instrumentation/github.com/gin-gonic/gin/otelgin v0.49.0 - go.opentelemetry.io/otel v1.27.0 + go.opentelemetry.io/otel v1.28.0 + go.opentelemetry.io/otel/trace v1.28.0 go.uber.org/multierr v1.11.0 - go.uber.org/zap v1.26.0 - golang.org/x/crypto v0.24.0 - golang.org/x/exp v0.0.0-20240325151524-a685a6edb6d8 - golang.org/x/mod v0.17.0 - golang.org/x/net v0.25.0 - golang.org/x/sync v0.7.0 - golang.org/x/term v0.21.0 - golang.org/x/text v0.16.0 - golang.org/x/time v0.5.0 - golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d - gonum.org/v1/gonum v0.14.0 - google.golang.org/grpc v1.64.0 - google.golang.org/protobuf v1.34.1 + go.uber.org/zap v1.27.0 + golang.org/x/crypto v0.27.0 + golang.org/x/exp v0.0.0-20240909161429-701f63a606c0 + golang.org/x/mod v0.21.0 + golang.org/x/net v0.29.0 + golang.org/x/sync v0.8.0 + golang.org/x/term v0.24.0 + golang.org/x/text v0.18.0 + golang.org/x/time v0.6.0 + golang.org/x/tools v0.25.0 + gonum.org/v1/gonum v0.15.0 + google.golang.org/grpc v1.65.0 + google.golang.org/protobuf v1.34.2 gopkg.in/guregu/null.v4 v4.0.0 gopkg.in/natefinch/lumberjack.v2 v2.2.1 + k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 ) require ( + cloud.google.com/go/auth v0.7.1 // indirect + cloud.google.com/go/auth/oauth2adapt v0.2.3 // indirect + cloud.google.com/go/compute/metadata v0.5.0 // indirect + cloud.google.com/go/iam v1.1.11 // indirect + cloud.google.com/go/storage v1.43.0 // indirect contrib.go.opencensus.io/exporter/stackdriver v0.13.5 // indirect cosmossdk.io/api v0.3.1 // indirect cosmossdk.io/core v0.5.1 // indirect - cosmossdk.io/depinject v1.0.0-alpha.3 // indirect - cosmossdk.io/errors v1.0.0 // indirect - cosmossdk.io/math v1.0.1 // indirect + cosmossdk.io/depinject v1.0.0-alpha.4 // indirect + cosmossdk.io/errors v1.0.1 // indirect + cosmossdk.io/math v1.3.0 // indirect filippo.io/edwards25519 v1.1.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.1 // indirect github.com/Azure/go-ntlmssp v0.0.0-20221128193559-754e69321358 // indirect - github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d // indirect + github.com/ChainSafe/go-schnorrkel v1.0.0 // indirect github.com/CosmWasm/wasmd v0.40.1 // indirect github.com/CosmWasm/wasmvm v1.2.4 // indirect github.com/DataDog/zstd v1.5.2 // indirect @@ -144,44 +155,43 @@ require ( github.com/cenkalti/backoff v2.2.1+incompatible // indirect github.com/cenkalti/backoff/v4 v4.3.0 // indirect github.com/cespare/xxhash v1.1.0 // indirect - github.com/cespare/xxhash/v2 v2.2.0 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d // indirect github.com/chenzhuoyu/iasm v0.9.0 // indirect - github.com/cockroachdb/errors v1.9.1 // indirect + github.com/cockroachdb/errors v1.10.0 // indirect github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect github.com/cockroachdb/pebble v0.0.0-20230928194634-aa077af62593 // indirect - github.com/cockroachdb/redact v1.1.3 // indirect + github.com/cockroachdb/redact v1.1.5 // indirect github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect github.com/cometbft/cometbft-db v0.7.0 // indirect github.com/confio/ics23/go v0.9.0 // indirect github.com/consensys/bavard v0.1.13 // indirect github.com/consensys/gnark-crypto v0.12.1 // indirect github.com/cosmos/btcutil v1.0.5 // indirect - github.com/cosmos/cosmos-proto v1.0.0-beta.2 // indirect + github.com/cosmos/cosmos-proto v1.0.0-beta.5 // indirect github.com/cosmos/go-bip39 v1.0.0 // indirect github.com/cosmos/gogoproto v1.4.11 // indirect - github.com/cosmos/iavl v0.20.0 // indirect + github.com/cosmos/iavl v0.20.1 // indirect github.com/cosmos/ibc-go/v7 v7.0.1 // indirect github.com/cosmos/ics23/go v0.9.1-0.20221207100636-b1abd8678aab // indirect - github.com/cosmos/ledger-cosmos-go v0.12.1 // indirect - github.com/cpuguy83/go-md2man/v2 v2.0.3 // indirect + github.com/cosmos/ledger-cosmos-go v0.12.4 // indirect + github.com/cpuguy83/go-md2man/v2 v2.0.4 // indirect github.com/crate-crypto/go-ipa v0.0.0-20231025140028-3c0104f4b233 // indirect github.com/crate-crypto/go-kzg-4844 v0.7.0 // indirect github.com/danieljoos/wincred v1.1.2 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect - github.com/deckarep/golang-set/v2 v2.3.0 // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect github.com/dfuse-io/logging v0.0.0-20210109005628-b97a57253f70 // indirect github.com/dgraph-io/badger/v2 v2.2007.4 // indirect github.com/dgraph-io/ristretto v0.1.1 // indirect github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect github.com/docker/distribution v2.8.2+incompatible // indirect + github.com/docker/go-connections v0.5.0 // indirect github.com/dustin/go-humanize v1.0.1 // indirect github.com/dvsekhvalnov/jose2go v1.7.0 // indirect github.com/ethereum/c-kzg-4844 v0.4.0 // indirect - github.com/felixge/httpsnoop v1.0.4 // indirect - github.com/fsnotify/fsnotify v1.6.0 // indirect - github.com/gabriel-vasile/mimetype v1.4.2 // indirect + github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/gabriel-vasile/mimetype v1.4.3 // indirect github.com/gagliardetto/binary v0.7.7 // indirect github.com/gagliardetto/treeout v0.1.4 // indirect github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08 // indirect @@ -193,19 +203,19 @@ require ( github.com/go-kit/kit v0.12.0 // indirect github.com/go-kit/log v0.2.1 // indirect github.com/go-logfmt/logfmt v0.6.0 // indirect - github.com/go-logr/logr v1.4.1 // indirect + github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/go-ole/go-ole v1.2.6 // indirect github.com/go-playground/locales v0.14.1 // indirect github.com/go-playground/universal-translator v0.18.1 // indirect - github.com/go-playground/validator/v10 v10.15.5 // indirect + github.com/go-playground/validator/v10 v10.22.0 // indirect github.com/go-webauthn/x v0.1.5 // indirect github.com/goccy/go-json v0.10.2 // indirect github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect github.com/gofrs/flock v0.8.1 // indirect github.com/gogo/protobuf v1.3.3 // indirect github.com/golang-jwt/jwt/v5 v5.2.0 // indirect - github.com/golang/glog v1.2.0 // indirect + github.com/golang/glog v1.2.1 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/protobuf v1.5.4 // indirect github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb // indirect @@ -213,15 +223,13 @@ require ( github.com/google/go-cmp v0.6.0 // indirect github.com/google/go-tpm v0.9.0 // indirect github.com/google/gofuzz v1.2.0 // indirect - github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect - github.com/googleapis/gax-go/v2 v2.12.2 // indirect github.com/gorilla/context v1.1.1 // indirect - github.com/grafana/pyroscope-go/godeltaprof v0.1.6 // indirect + github.com/grafana/pyroscope-go/godeltaprof v0.1.8 // indirect github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus v1.0.1 // indirect github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.1.0 // indirect github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect - github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0 // indirect github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect github.com/gtank/merlin v0.1.1 // indirect github.com/gtank/ristretto255 v0.1.2 // indirect @@ -247,12 +255,13 @@ require ( github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect github.com/jackpal/go-nat-pmp v1.0.2 // indirect github.com/jmhodges/levigo v1.0.0 // indirect + github.com/joho/godotenv v1.5.1 // indirect github.com/json-iterator/go v1.1.12 // indirect - github.com/klauspost/compress v1.17.3 // indirect + github.com/klauspost/compress v1.17.9 // indirect github.com/klauspost/cpuid/v2 v2.2.5 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect - github.com/leodido/go-urn v1.2.4 // indirect + github.com/leodido/go-urn v1.4.0 // indirect github.com/libp2p/go-buffer-pool v0.1.0 // indirect github.com/logrusorgru/aurora v2.0.3+incompatible // indirect github.com/magiconair/properties v1.8.7 // indirect @@ -260,41 +269,45 @@ require ( github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect github.com/mattn/go-runewidth v0.0.14 // indirect - github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 // indirect github.com/mfridman/interpolate v0.0.2 // indirect github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 // indirect github.com/mitchellh/copystructure v1.2.0 // indirect github.com/mitchellh/go-testing-interface v1.14.1 // indirect + github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/mmcloughlin/addchain v0.4.0 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/mostynb/zstdpool-freelist v0.0.0-20201229113212-927304c0c3b1 // indirect github.com/mtibben/percent v0.2.1 // indirect - github.com/mwitkow/grpc-proxy v0.0.0-20230212185441-f345521cb9c9 // indirect + github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/oklog/run v1.1.0 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect + github.com/opencontainers/image-spec v1.1.0-rc5 // indirect github.com/opentracing/opentracing-go v1.2.0 // indirect github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect - github.com/prometheus/procfs v0.12.0 // indirect + github.com/prometheus/procfs v0.15.1 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect github.com/rivo/uniseg v0.4.4 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect + github.com/sagikazarmark/locafero v0.4.0 // indirect + github.com/sagikazarmark/slog-shim v0.1.0 // indirect github.com/santhosh-tekuri/jsonschema/v5 v5.3.1 // indirect github.com/sasha-s/go-deadlock v0.3.1 // indirect github.com/sethvargo/go-retry v0.2.4 // indirect github.com/shirou/gopsutil v3.21.11+incompatible // indirect - github.com/spf13/afero v1.9.5 // indirect - github.com/spf13/cobra v1.8.0 // indirect - github.com/spf13/jwalterweatherman v1.1.0 // indirect + github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7 // indirect + github.com/sourcegraph/conc v0.3.0 // indirect + github.com/spf13/afero v1.11.0 // indirect + github.com/spf13/cobra v1.8.1 // indirect github.com/spf13/pflag v1.0.5 // indirect - github.com/spf13/viper v1.15.0 // indirect + github.com/spf13/viper v1.18.2 // indirect github.com/status-im/keycard-go v0.2.0 // indirect github.com/streamingfast/logging v0.0.0-20220405224725-2755dab2ce75 // indirect github.com/stretchr/objx v0.5.2 // indirect - github.com/subosito/gotenv v1.4.2 // indirect + github.com/subosito/gotenv v1.6.0 // indirect github.com/supranational/blst v0.3.11 // indirect github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c // indirect @@ -309,47 +322,51 @@ require ( github.com/tyler-smith/go-bip39 v1.1.0 // indirect github.com/umbracle/fastrlp v0.0.0-20220527094140-59d5dd30e722 // indirect github.com/valyala/fastjson v1.4.1 // indirect - github.com/wk8/go-ordered-map/v2 v2.1.8 // indirect github.com/x448/float16 v0.8.4 // indirect github.com/yusufpapurcu/wmi v1.2.4 // indirect - github.com/zondax/hid v0.9.1 // indirect - github.com/zondax/ledger-go v0.14.1 // indirect + github.com/zondax/hid v0.9.2 // indirect + github.com/zondax/ledger-go v0.14.3 // indirect go.dedis.ch/protobuf v1.0.11 // indirect go.etcd.io/bbolt v1.3.7 // indirect go.mongodb.org/mongo-driver v1.15.0 // indirect go.opencensus.io v0.24.0 // indirect - go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.52.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.27.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.27.0 // indirect - go.opentelemetry.io/otel/metric v1.27.0 // indirect - go.opentelemetry.io/otel/sdk v1.27.0 // indirect - go.opentelemetry.io/otel/trace v1.27.0 // indirect - go.opentelemetry.io/proto/otlp v1.2.0 // indirect + go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.53.0 // indirect + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.53.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.0.0-20240823153156-2a54df7bffb9 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.28.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.28.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.28.0 // indirect + go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.4.0 // indirect + go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.28.0 // indirect + go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.28.0 // indirect + go.opentelemetry.io/otel/log v0.4.0 // indirect + go.opentelemetry.io/otel/metric v1.28.0 // indirect + go.opentelemetry.io/otel/sdk v1.28.0 // indirect + go.opentelemetry.io/otel/sdk/log v0.4.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.28.0 // indirect + go.opentelemetry.io/proto/otlp v1.3.1 // indirect go.uber.org/ratelimit v0.3.0 // indirect - golang.org/x/arch v0.7.0 // indirect - golang.org/x/sys v0.21.0 // indirect - google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20240520151616-dc85e6b867a5 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240520151616-dc85e6b867a5 // indirect + golang.org/x/arch v0.8.0 // indirect + golang.org/x/sys v0.25.0 // indirect + google.golang.org/api v0.188.0 // indirect + google.golang.org/genproto v0.0.0-20240711142825-46eb208f015d // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20240822170219-fc7c04adadcd // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd // indirect gopkg.in/guregu/null.v2 v2.1.2 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - pgregory.net/rapid v0.5.5 // indirect + pgregory.net/rapid v1.1.0 // indirect rsc.io/tmplfunc v0.0.3 // indirect sigs.k8s.io/yaml v1.4.0 // indirect ) replace ( + // until merged upstream: https://github.com/omissis/go-jsonschema/pull/264 + github.com/atombender/go-jsonschema => github.com/nolag/go-jsonschema v0.16.0-rtinianov + // replicating the replace directive on cosmos SDK github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1 - - // until merged upstream: https://github.com/hashicorp/go-plugin/pull/257 - github.com/hashicorp/go-plugin => github.com/smartcontractkit/go-plugin v0.0.0-20240208201424-b3b91517de16 - - // until nolag updates merged upstream - github.com/mitchellh/mapstructure => github.com/nolag/mapstructure v1.5.2-0.20240625151721-90ea83a3f479 - - // until merged upstream: https://github.com/mwitkow/grpc-proxy/pull/69 - github.com/mwitkow/grpc-proxy => github.com/smartcontractkit/grpc-proxy v0.0.0-20230731113816-f1be6620749f ) + +replace github.com/sourcegraph/sourcegraph/lib => github.com/sourcegraph/sourcegraph-public-snapshot/lib v0.0.0-20240822153003-c864f15af264 diff --git a/go.sum b/go.sum index 8fe90c98379..e3b97a90da9 100644 --- a/go.sum +++ b/go.sum @@ -4,48 +4,36 @@ cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSR cloud.google.com/go v0.43.0/go.mod h1:BOSR3VbTLkk6FDC/TcffxP4NF/FFBGA5ku+jvKOP7pg= cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= -cloud.google.com/go v0.44.3/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= -cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= -cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= -cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= -cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= -cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= -cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= -cloud.google.com/go v0.75.0/go.mod h1:VGuuCn7PG0dwsd5XPVm2Mm3wlh3EL55/79EKB6hlPTY= -cloud.google.com/go v0.112.1 h1:uJSeirPke5UNZHIb4SxfZklVSiWWVqW4oXlETwZziwM= -cloud.google.com/go v0.112.1/go.mod h1:+Vbu+Y1UU+I1rjmzeMOb/8RfkKJK2Gyxi1X6jJCZLo4= +cloud.google.com/go v0.115.0 h1:CnFSK6Xo3lDYRoBKEcAtia6VSC837/ZkJuRduSFnr14= +cloud.google.com/go v0.115.0/go.mod h1:8jIM5vVgoAEoiVxQ/O4BFTfHqulPZgs/ufEzMcFMdWU= +cloud.google.com/go/auth v0.7.1 h1:Iv1bbpzJ2OIg16m94XI9/tlzZZl3cdeR3nGVGj78N7s= +cloud.google.com/go/auth v0.7.1/go.mod h1:VEc4p5NNxycWQTMQEDQF0bd6aTMb6VgYDXEwiJJQAbs= +cloud.google.com/go/auth/oauth2adapt v0.2.3 h1:MlxF+Pd3OmSudg/b1yZ5lJwoXCEaeedAguodky1PcKI= +cloud.google.com/go/auth/oauth2adapt v0.2.3/go.mod h1:tMQXOfZzFuNuUxOypHlQEXgdfX5cuhwU+ffUuXRJE8I= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= -cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= -cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= -cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= -cloud.google.com/go/compute v1.25.1 h1:ZRpHJedLtTpKgr3RV1Fx23NuaAEN1Zfx9hw1u4aJdjU= -cloud.google.com/go/compute/metadata v0.3.0 h1:Tz+eQXMEqDIKRsmY3cHTL6FVaynIjX2QxYC4trgAKZc= -cloud.google.com/go/compute/metadata v0.3.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k= +cloud.google.com/go/compute/metadata v0.5.0 h1:Zr0eK8JbFv6+Wi4ilXAR8FJ3wyNdpxHKJNPos6LTZOY= +cloud.google.com/go/compute/metadata v0.5.0/go.mod h1:aHnloV2TPI38yx4s9+wAZhHykWvVCfu7hQbF+9CWoiY= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= -cloud.google.com/go/iam v1.1.6 h1:bEa06k05IO4f4uJonbB5iAgKTPpABy1ayxaIZV/GHVc= -cloud.google.com/go/iam v1.1.6/go.mod h1:O0zxdPeGBoFdWW3HWmBxJsk0pfvNM/p/qa82rWOGTwI= +cloud.google.com/go/iam v1.1.11 h1:0mQ8UKSfdHLut6pH9FM3bI55KWR46ketn0PuXleDyxw= +cloud.google.com/go/iam v1.1.11/go.mod h1:biXoiLWYIKntto2joP+62sd9uW5EpkZmKIvfNcTWlnQ= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= -cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= -cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= -cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= -cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= -cloud.google.com/go/storage v1.38.0 h1:Az68ZRGlnNTpIBbLjSMIV2BDcwwXYlRlQzis0llkpJg= -cloud.google.com/go/storage v1.38.0/go.mod h1:tlUADB0mAb9BgYls9lq+8MGkfzOXuLrnHXlpHmvFJoY= +cloud.google.com/go/storage v1.43.0 h1:CcxnSohZwizt4LCzQHWvBf1/kvtHUn7gk9QERXPyXFs= +cloud.google.com/go/storage v1.43.0/go.mod h1:ajvxEa7WmZS1PxvKRq4bq0tFT3vMd502JwstCcYv0Q0= contrib.go.opencensus.io/exporter/stackdriver v0.12.6/go.mod h1:8x999/OcIPy5ivx/wDiV7Gx4D+VUPODf0mWRGRc5kSk= contrib.go.opencensus.io/exporter/stackdriver v0.13.4/go.mod h1:aXENhDJ1Y4lIg4EUaVTwzvYETVNZk10Pu26tevFKLUc= contrib.go.opencensus.io/exporter/stackdriver v0.13.5 h1:TNaexHK16gPUoc7uzELKOU7JULqccn1NDuqUxmxSqfo= @@ -54,14 +42,14 @@ cosmossdk.io/api v0.3.1 h1:NNiOclKRR0AOlO4KIqeaG6PS6kswOMhHD0ir0SscNXE= cosmossdk.io/api v0.3.1/go.mod h1:DfHfMkiNA2Uhy8fj0JJlOCYOBp4eWUUJ1te5zBGNyIw= cosmossdk.io/core v0.5.1 h1:vQVtFrIYOQJDV3f7rw4pjjVqc1id4+mE0L9hHP66pyI= cosmossdk.io/core v0.5.1/go.mod h1:KZtwHCLjcFuo0nmDc24Xy6CRNEL9Vl/MeimQ2aC7NLE= -cosmossdk.io/depinject v1.0.0-alpha.3 h1:6evFIgj//Y3w09bqOUOzEpFj5tsxBqdc5CfkO7z+zfw= -cosmossdk.io/depinject v1.0.0-alpha.3/go.mod h1:eRbcdQ7MRpIPEM5YUJh8k97nxHpYbc3sMUnEtt8HPWU= -cosmossdk.io/errors v1.0.0 h1:nxF07lmlBbB8NKQhtJ+sJm6ef5uV1XkvPXG2bUntb04= -cosmossdk.io/errors v1.0.0/go.mod h1:+hJZLuhdDE0pYN8HkOrVNwrIOYvUGnn6+4fjnJs/oV0= -cosmossdk.io/log v1.1.1-0.20230704160919-88f2c830b0ca h1:msenprh2BLLRwNT7zN56TbBHOGk/7ARQckXHxXyvjoQ= -cosmossdk.io/log v1.1.1-0.20230704160919-88f2c830b0ca/go.mod h1:PkIAKXZvaxrTRc++z53XMRvFk8AcGGWYHcMIPzVYX9c= -cosmossdk.io/math v1.0.1 h1:Qx3ifyOPaMLNH/89WeZFH268yCvU4xEcnPLu3sJqPPg= -cosmossdk.io/math v1.0.1/go.mod h1:Ygz4wBHrgc7g0N+8+MrnTfS9LLn9aaTGa9hKopuym5k= +cosmossdk.io/depinject v1.0.0-alpha.4 h1:PLNp8ZYAMPTUKyG9IK2hsbciDWqna2z1Wsl98okJopc= +cosmossdk.io/depinject v1.0.0-alpha.4/go.mod h1:HeDk7IkR5ckZ3lMGs/o91AVUc7E596vMaOmslGFM3yU= +cosmossdk.io/errors v1.0.1 h1:bzu+Kcr0kS/1DuPBtUFdWjzLqyUuCiyHjyJB6srBV/0= +cosmossdk.io/errors v1.0.1/go.mod h1:MeelVSZThMi4bEakzhhhE/CKqVv3nOJDA25bIqRDu/U= +cosmossdk.io/log v1.3.1 h1:UZx8nWIkfbbNEWusZqzAx3ZGvu54TZacWib3EzUYmGI= +cosmossdk.io/log v1.3.1/go.mod h1:2/dIomt8mKdk6vl3OWJcPk2be3pGOS8OQaLUM/3/tCM= +cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= +cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= cosmossdk.io/tools/rosetta v0.2.1 h1:ddOMatOH+pbxWbrGJKRAawdBkPYLfKXutK9IETnjYxw= cosmossdk.io/tools/rosetta v0.2.1/go.mod h1:Pqdc1FdvkNV3LcNIkYWt2RQY6IP1ge6YWZk8MhhO9Hw= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= @@ -74,7 +62,6 @@ github.com/99designs/keyring v1.2.1 h1:tYLp1ULvO7i3fI5vE21ReQuj99QFSs7lGm0xWyJo8 github.com/99designs/keyring v1.2.1/go.mod h1:fc+wB5KTk9wQ9sDx0kFXB3A0MaeGHM9AwRStKOQ5vOA= github.com/AlekSi/pointer v1.1.0 h1:SSDMPcXD9jSl8FPy9cRzoRaMJtm9g9ggGTxecRUbQoI= github.com/AlekSi/pointer v1.1.0/go.mod h1:y7BvfRI3wXPWKXEBhU71nbnIEEZX0QTSB2Bj48UJIZE= -github.com/AndreasBriese/bbloom v0.0.0-20190306092124-e2d15f34fcf9/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8= github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25UVaW/CKtUDjefjrs0SPonmDGUVOYP0= github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/Azure/go-ntlmssp v0.0.0-20221128193559-754e69321358 h1:mFRzDkZVAjdal+s7s0MwaRv9igoPqLRdzOLzw/8Xvq8= @@ -82,10 +69,8 @@ github.com/Azure/go-ntlmssp v0.0.0-20221128193559-754e69321358/go.mod h1:chxPXzS github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d h1:nalkkPQcITbvhmL4+C4cKA87NW0tfm3Kl9VXRoPywFg= -github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d/go.mod h1:URdX5+vg25ts3aCh8H5IFZybJYKWhJHYMTnf+ULtoC4= -github.com/CloudyKit/fastprinter v0.0.0-20200109182630-33d98a066a53/go.mod h1:+3IMCy2vIlbG1XG/0ggNQv0SvxCAIpPM5b1nCz56Xno= -github.com/CloudyKit/jet/v3 v3.0.0/go.mod h1:HKQPgSJmdK8hdoAbKUUWajkHyHo4RaU5rMdUywE7VMo= +github.com/ChainSafe/go-schnorrkel v1.0.0 h1:3aDA67lAykLaG1y3AOjs88dMxC88PgUuHRrLeDnvGIM= +github.com/ChainSafe/go-schnorrkel v1.0.0/go.mod h1:dpzHYVxLZcp8pjlV+O+UR8K0Hp/z7vcchBSbMBEhCw4= github.com/CosmWasm/wasmd v0.40.1 h1:LxbO78t/6S8TkeQlUrJ0m5O87HtAwLx4RGHq3rdrOEU= github.com/CosmWasm/wasmd v0.40.1/go.mod h1:6EOwnv7MpuFaEqxcUOdFV9i4yvrdOciaY6VQ1o7A3yg= github.com/CosmWasm/wasmvm v1.2.4 h1:6OfeZuEcEH/9iqwrg2pkeVtDCkMoj9U6PpKtcrCyVrQ= @@ -97,7 +82,6 @@ github.com/Depado/ginprom v1.8.0 h1:zaaibRLNI1dMiiuj1MKzatm8qrcHzikMlCc1anqOdyo= github.com/Depado/ginprom v1.8.0/go.mod h1:XBaKzeNBqPF4vxJpNLincSQZeMDnZp1tIbU0FU0UKgg= github.com/GeertJohan/go.incremental v1.0.0/go.mod h1:6fAjUhbVuX1KcMD3c8TEgVUqmo4seqhv0i0kdATSkM0= github.com/GeertJohan/go.rice v1.0.0/go.mod h1:eH6gbSOAUv07dQuZVnBmoDP8mgsM1rtixis4Tib9if0= -github.com/Joker/hpp v1.0.0/go.mod h1:8x5n+M1Hp5hC0g8okX3sR3vFQwynaX/UgSOM9MeBKzY= github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI= github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= @@ -117,17 +101,13 @@ github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5/go.mod h1:lmUJ/7eu/Q8 github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/OneOfOne/xxhash v1.2.8 h1:31czK/TI9sNkxIKfaUfGlU47BAxQ0ztGgd9vPyqimf8= github.com/OneOfOne/xxhash v1.2.8/go.mod h1:eZbhyaAYD41SGSSsnmcpxVoRiQ/MPUTjUdIIOT9Um7Q= -github.com/Shopify/goreferrer v0.0.0-20181106222321-ec9c9a553398/go.mod h1:a1uqRtAwp2Xwc6WNPJEufxJ7fx3npB4UV/JOLmbu5I0= github.com/VictoriaMetrics/fastcache v1.12.1 h1:i0mICQuojGDL3KblA7wUNlY5lOK6a4bwt3uRKnkZU40= github.com/VictoriaMetrics/fastcache v1.12.1/go.mod h1:tX04vaqcNoQeGLD+ra5pU5sWkuxnzWhEzLwhP9w653o= github.com/VividCortex/gohistogram v1.0.0 h1:6+hBz+qvs0JOrrNhhmR7lFxo5sINxBCGXrdtl/UvroE= github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= github.com/XSAM/otelsql v0.27.0 h1:i9xtxtdcqXV768a5C6SoT/RkG+ue3JTOgkYInzlTOqs= github.com/XSAM/otelsql v0.27.0/go.mod h1:0mFB3TvLa7NCuhm/2nU7/b2wEtsczkj8Rey8ygO7V+A= -github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY= github.com/akavel/rsrc v0.8.0/go.mod h1:uLoCtb9J+EyAqh+26kdrTgmzRBFPGOolLWKpdxkKq+c= -github.com/alecthomas/participle/v2 v2.0.0-alpha7 h1:cK4vjj0VSgb3lN1nuKA5F7dw+1s1pWBe5bx7nNCnN+c= -github.com/alecthomas/participle/v2 v2.0.0-alpha7/go.mod h1:NumScqsC42o9x+dGj8/YqsIfhrIQjFEOFovxotbBirA= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= @@ -147,13 +127,12 @@ github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmV github.com/armon/go-metrics v0.4.1 h1:hR91U9KYmb6bLBYLQjyM+3j+rcd/UhE+G78SFnF8gJA= github.com/armon/go-metrics v0.4.1/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+3JqfkOG4= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= -github.com/avast/retry-go/v4 v4.5.1 h1:AxIx0HGi4VZ3I02jr78j5lZ3M6x1E0Ivxa6b0pUUh7o= -github.com/avast/retry-go/v4 v4.5.1/go.mod h1:/sipNsvNB3RRuT5iNcb6h73nw3IBmXJ/H3XrCQYSOpc= +github.com/avast/retry-go/v4 v4.6.0 h1:K9xNA+KeB8HHc2aWFuLb25Offp+0iVRXEvFx8IinRJA= +github.com/avast/retry-go/v4 v4.6.0/go.mod h1:gvWlPhBVsvBbLkVGDg/KwvBv0bEkCOLRRSHKIr2PyOE= github.com/aws/aws-sdk-go v1.22.1/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.23.20/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.45.25 h1:c4fLlh5sLdK2DCRTY1z0hyuJZU4ygxX8m1FswL6/nF4= github.com/aws/aws-sdk-go v1.45.25/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= -github.com/aymerick/raymond v2.0.3-0.20180322193309-b565731e1464+incompatible/go.mod h1:osfaiScAUVup+UC9Nfq76eWqDhXlp+4UYaA8uhTBO6g= github.com/bahlo/generic-list-go v0.2.0 h1:5sz/EEAK+ls5wF+NeqDpk5+iNdMDXrh3z3nPnH1Wvgk= github.com/bahlo/generic-list-go v0.2.0/go.mod h1:2KvAjgMlE5NNynlg/5iLrrCCZ2+5xWbdbCW3pNTGyYg= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= @@ -198,8 +177,9 @@ github.com/cespare/cp v1.1.1/go.mod h1:SOGHArjBr4JWaSDEVpWpo/hNg6RoKrls6Oh40hiwW github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/chenzhuoyu/base64x v0.0.0-20211019084208-fb5309c8db06/go.mod h1:DH46F32mSOjUmXrMHnKwZdA8wcEefY7UVqBKYGjpdQY= github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311/go.mod h1:b583jCggY9gE99b6G5LEC39OIiVsWj+R97kbl5odCEk= github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d h1:77cEq6EriyTZ0g/qfRdp61a3Uu/AWrgIq2s0ClJV1g0= @@ -215,33 +195,27 @@ github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6D github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= -github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cockroachdb/apd v1.1.0 h1:3LFP3629v+1aKXU5Q37mxmRxX/pIu1nijXydLShEq5I= github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ= github.com/cockroachdb/apd/v2 v2.0.2 h1:weh8u7Cneje73dDh+2tEVLUvyBc89iwepWCD8b8034E= github.com/cockroachdb/apd/v2 v2.0.2/go.mod h1:DDxRlzC2lo3/vSlmSoS7JkqbbrARPuFOGr0B9pvN3Gw= -github.com/cockroachdb/apd/v3 v3.1.0 h1:MK3Ow7LH0W8zkd5GMKA1PvS9qG3bWFI95WaVNfyZJ/w= -github.com/cockroachdb/apd/v3 v3.1.0/go.mod h1:6qgPBMXjATAdD/VefbRP9NoSLKjbB4LCoA7gN4LpHs4= -github.com/cockroachdb/datadriven v1.0.2/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f h1:otljaYPt5hWxV3MUfO5dFPFiOXg9CyG5/kCfayTqsJ4= github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= -github.com/cockroachdb/errors v1.9.1 h1:yFVvsI0VxmRShfawbt/laCIDy/mtTqqnvoNgiy5bEV8= -github.com/cockroachdb/errors v1.9.1/go.mod h1:2sxOtL2WIc096WSZqZ5h8fa17rdDq9HZOZLBCor4mBk= -github.com/cockroachdb/logtags v0.0.0-20211118104740-dabe8e521a4f/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= +github.com/cockroachdb/errors v1.10.0 h1:lfxS8zZz1+OjtV4MtNWgboi/W5tyLEB6VQZBXN+0VUU= +github.com/cockroachdb/errors v1.10.0/go.mod h1:lknhIsEVQ9Ss/qKDBQS/UqFSvPQjOwNq2qyKAxtHRqE= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= github.com/cockroachdb/pebble v0.0.0-20230928194634-aa077af62593 h1:aPEJyR4rPBvDmeyi+l/FS/VtA00IWvjeFvjen1m1l1A= github.com/cockroachdb/pebble v0.0.0-20230928194634-aa077af62593/go.mod h1:6hk1eMY/u5t+Cf18q5lFMUA1Rc+Sm5I6Ra1QuPyxXCo= -github.com/cockroachdb/redact v1.1.3 h1:AKZds10rFSIj7qADf0g46UixK8NNLwWTNdCIGS5wfSQ= -github.com/cockroachdb/redact v1.1.3/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= +github.com/cockroachdb/redact v1.1.5 h1:u1PMllDkdFfPWaNGMyLD1+so+aq3uUItthCFqzwPJ30= +github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= -github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0/go.mod h1:4Zcjuz89kmFXt9morQgcfYZAYZ5n8WHjt81YYWIwtTM= github.com/coinbase/rosetta-sdk-go/types v1.0.0 h1:jpVIwLcPoOeCR6o1tU+Xv7r5bMONNbHU7MuEHboiFuA= github.com/coinbase/rosetta-sdk-go/types v1.0.0/go.mod h1:eq7W2TMRH22GTW0N0beDnN931DW0/WOI1R2sdHNHG4c= -github.com/cometbft/cometbft v0.37.2 h1:XB0yyHGT0lwmJlFmM4+rsRnczPlHoAKFX6K8Zgc2/Jc= -github.com/cometbft/cometbft v0.37.2/go.mod h1:Y2MMMN//O5K4YKd8ze4r9jmk4Y7h0ajqILXbH5JQFVs= +github.com/cometbft/cometbft v0.37.5 h1:/U/TlgMh4NdnXNo+YU9T2NMCWyhXNDF34Mx582jlvq0= +github.com/cometbft/cometbft v0.37.5/go.mod h1:QC+mU0lBhKn8r9qvmnq53Dmf3DWBt4VtkcKw2C81wxY= github.com/cometbft/cometbft-db v0.7.0 h1:uBjbrBx4QzU0zOEnU8KxoDl18dMNgDh+zZRUE0ucsbo= github.com/cometbft/cometbft-db v0.7.0/go.mod h1:yiKJIm2WKrt6x8Cyxtq9YTEcIMPcEe4XPxhgX59Fzf0= github.com/confio/ics23/go v0.9.0 h1:cWs+wdbS2KRPZezoaaj+qBleXgUk5WOQFMP3CQFGTr4= @@ -260,13 +234,14 @@ github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3Ee github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= +github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cosmos/btcutil v1.0.5 h1:t+ZFcX77LpKtDBhjucvnOH8C2l2ioGsBNEQ3jef8xFk= github.com/cosmos/btcutil v1.0.5/go.mod h1:IyB7iuqZMJlthe2tkIFL33xPyzbFYP0XVdS8P5lUPis= -github.com/cosmos/cosmos-proto v1.0.0-beta.2 h1:X3OKvWgK9Gsejo0F1qs5l8Qn6xJV/AzgIWR2wZ8Nua8= -github.com/cosmos/cosmos-proto v1.0.0-beta.2/go.mod h1:+XRCLJ14pr5HFEHIUcn51IKXD1Fy3rkEQqt4WqmN4V0= -github.com/cosmos/cosmos-sdk v0.47.4 h1:FVUpEprm58nMmBX4xkRdMDaIG5Nr4yy92HZAfGAw9bg= -github.com/cosmos/cosmos-sdk v0.47.4/go.mod h1:R5n+uM7vguVPFap4pgkdvQCT1nVo/OtPwrlAU40rvok= +github.com/cosmos/cosmos-proto v1.0.0-beta.5 h1:eNcayDLpip+zVLRLYafhzLvQlSmyab+RC5W7ZfmxJLA= +github.com/cosmos/cosmos-proto v1.0.0-beta.5/go.mod h1:hQGLpiIUloJBMdQMMWb/4wRApmI9hjHH05nefC0Ojec= +github.com/cosmos/cosmos-sdk v0.47.11 h1:0Qx7eORw0RJqPv+mvDuU8NQ1LV3nJJKJnPoYblWHolc= +github.com/cosmos/cosmos-sdk v0.47.11/go.mod h1:ADjORYzUQqQv/FxDi0H0K5gW/rAk1CiDR3ZKsExfJV0= github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= @@ -274,21 +249,21 @@ github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiK github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ4GUkT+tbFI= github.com/cosmos/gogoproto v1.4.11 h1:LZcMHrx4FjUgrqQSWeaGC1v/TeuVFqSLa43CC6aWR2g= github.com/cosmos/gogoproto v1.4.11/go.mod h1:/g39Mh8m17X8Q/GDEs5zYTSNaNnInBSohtaxzQnYq1Y= -github.com/cosmos/iavl v0.20.0 h1:fTVznVlepH0KK8NyKq8w+U7c2L6jofa27aFX6YGlm38= -github.com/cosmos/iavl v0.20.0/go.mod h1:WO7FyvaZJoH65+HFOsDir7xU9FWk2w9cHXNW1XHcl7A= +github.com/cosmos/iavl v0.20.1 h1:rM1kqeG3/HBT85vsZdoSNsehciqUQPWrR4BYmqE2+zg= +github.com/cosmos/iavl v0.20.1/go.mod h1:WO7FyvaZJoH65+HFOsDir7xU9FWk2w9cHXNW1XHcl7A= github.com/cosmos/ibc-go/v7 v7.0.1 h1:NIBNRWjlOoFvFQu1ZlgwkaSeHO5avf4C1YQiWegt8jw= github.com/cosmos/ibc-go/v7 v7.0.1/go.mod h1:vEaapV6nuLPQlS+g8IKmxMo6auPi0i7HMv1PhViht/E= github.com/cosmos/ics23/go v0.9.1-0.20221207100636-b1abd8678aab h1:I9ialKTQo7248V827Bba4OuKPmk+FPzmTVHsLXaIJWw= github.com/cosmos/ics23/go v0.9.1-0.20221207100636-b1abd8678aab/go.mod h1:2CwqasX5dSD7Hbp/9b6lhK6BwoBDCBldx7gPKRukR60= -github.com/cosmos/ledger-cosmos-go v0.12.1 h1:sMBxza5p/rNK/06nBSNmsI/WDqI0pVJFVNihy1Y984w= -github.com/cosmos/ledger-cosmos-go v0.12.1/go.mod h1:dhO6kj+Y+AHIOgAe4L9HL/6NDdyyth4q238I9yFpD2g= +github.com/cosmos/ledger-cosmos-go v0.12.4 h1:drvWt+GJP7Aiw550yeb3ON/zsrgW0jgh5saFCr7pDnw= +github.com/cosmos/ledger-cosmos-go v0.12.4/go.mod h1:fjfVWRf++Xkygt9wzCsjEBdjcf7wiiY35fv3ctT+k4M= github.com/cosmos/rosetta-sdk-go v0.10.0 h1:E5RhTruuoA7KTIXUcMicL76cffyeoyvNybzUGSKFTcM= github.com/cosmos/rosetta-sdk-go v0.10.0/go.mod h1:SImAZkb96YbwvoRkzSMQB6noNJXFgWl/ENIznEoYQI4= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= -github.com/cpuguy83/go-md2man/v2 v2.0.3 h1:qMCsGGgs+MAzDFyp9LpAe1Lqy/fY/qCovCm0qnXZOBM= -github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/cpuguy83/go-md2man/v2 v2.0.4 h1:wfIWP927BUkWJb2NmU/kNDYIBTh/ziUX91+lVfRxZq4= +github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/crate-crypto/go-ipa v0.0.0-20231025140028-3c0104f4b233 h1:d28BXYi+wUpz1KBmiF9bWrjEMacUEREV6MBi2ODnrfQ= github.com/crate-crypto/go-ipa v0.0.0-20231025140028-3c0104f4b233/go.mod h1:geZJZH3SzKCqnz5VT0q/DyIG/tvu/dZk+VIfXicupJs= github.com/crate-crypto/go-kzg-4844 v0.7.0 h1:C0vgZRk4q4EZ/JgPfzuSoxdCq3C3mOZMBShovmncxvA= @@ -297,10 +272,6 @@ github.com/creachadair/taskgroup v0.4.2 h1:jsBLdAJE42asreGss2xZGZ8fJra7WtwnHWeJF github.com/creachadair/taskgroup v0.4.2/go.mod h1:qiXUOSrbwAY3u0JPGTzObbE3yf9hcXHDKBZ2ZjpCbgM= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/cucumber/common/gherkin/go/v22 v22.0.0 h1:4K8NqptbvdOrjL9DEea6HFjSpbdT9+Q5kgLpmmsHYl0= -github.com/cucumber/common/gherkin/go/v22 v22.0.0/go.mod h1:3mJT10B2GGn3MvVPd3FwR7m2u4tLhSRhWUqJU4KN4Fg= -github.com/cucumber/common/messages/go/v17 v17.1.1 h1:RNqopvIFyLWnKv0LfATh34SWBhXeoFTJnSrgm9cT/Ts= -github.com/cucumber/common/messages/go/v17 v17.1.1/go.mod h1:bpGxb57tDE385Rb2EohgUadLkAbhoC4IyCFi89u/JQI= github.com/daaku/go.zipexe v1.0.0/go.mod h1:z8IiR6TsVLEYKwXAoE/I+8ys/sDkgTzSL0CLnGVd57E= github.com/danieljoos/wincred v1.1.2 h1:QLdCxFs1/Yl4zduvBdcHB8goaYk9RARS2SgLLRuAyr0= github.com/danieljoos/wincred v1.1.2/go.mod h1:GijpziifJoIBfYh+S7BbkdUTU4LfM+QnGqR5Vl2tAx0= @@ -310,8 +281,8 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/deckarep/golang-set/v2 v2.3.0 h1:qs18EKUfHm2X9fA50Mr/M5hccg2tNnVqsiBImnyDs0g= -github.com/deckarep/golang-set/v2 v2.3.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4= +github.com/deckarep/golang-set/v2 v2.6.0 h1:XfcQbWM1LlMB8BsJ8N9vW5ehnnPVIw0je80NsVHagjM= +github.com/deckarep/golang-set/v2 v2.6.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4= github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y= github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etlyjdBU4sfcs2WYQMs= @@ -321,7 +292,6 @@ github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f/go.mod h1:xH/i4TFM github.com/dfuse-io/logging v0.0.0-20201110202154-26697de88c79/go.mod h1:V+ED4kT/t/lKtH99JQmKIb0v9WL3VaYkJ36CfHlVECI= github.com/dfuse-io/logging v0.0.0-20210109005628-b97a57253f70 h1:CuJS05R9jmNlUK8GOxrEELPbfXm0EuGh/30LjkjN5vo= github.com/dfuse-io/logging v0.0.0-20210109005628-b97a57253f70/go.mod h1:EoK/8RFbMEteaCaz89uessDTnCWjbbcr+DXcBh4el5o= -github.com/dgraph-io/badger v1.6.0/go.mod h1:zwt7syl517jmP8s94KqSxTlM6IMsdhYy6psNgSztDR4= github.com/dgraph-io/badger/v2 v2.2007.4 h1:TRWBQg8UrlUhaFdco01nO2uXwzKS7zd+HVdwV/GHc4o= github.com/dgraph-io/badger/v2 v2.2007.4/go.mod h1:vSw/ax2qojzbN6eXHIx6KPKtCSHJN/Uz0X0VPruTIhk= github.com/dgraph-io/ristretto v0.0.3-0.20200630154024-f66de99634de/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70dGTu2u+Ahh6E= @@ -334,8 +304,8 @@ github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13/go.mod h1:SqUrOPUn github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= github.com/docker/distribution v2.8.2+incompatible h1:T3de5rq0dB1j30rp0sA2rER+m322EBzniBPB6ZIzuh8= github.com/docker/distribution v2.8.2+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= -github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= +github.com/docker/go-connections v0.5.0 h1:USnMq7hx7gwdVZq1L49hLXaFtUdTADjXGp+uj1Br63c= +github.com/docker/go-connections v0.5.0/go.mod h1:ov60Kzw0kKElRwhNs9UlUHAE/F9Fe6GLaXnqyDdmEXc= github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/dominikbraun/graph v0.23.0 h1:TdZB4pPqCLFxYhdyMFb1TBdFxp8XLcJfTTBQucVPgCo= @@ -345,17 +315,13 @@ github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkp github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= github.com/dvsekhvalnov/jose2go v1.7.0 h1:bnQc8+GMnidJZA8zc6lLEAb4xNrIqHwO+9TzqvtQZPo= github.com/dvsekhvalnov/jose2go v1.7.0/go.mod h1:QsHjhyTlD/lAVqn/NSbVZmSCGeDehTB/mPZadG+mhXU= -github.com/eknkc/amber v0.0.0-20171010120322-cdade1c07385/go.mod h1:0vRUJqYpeSZifjYj7uP3BG/gKcuzL9xWVV/Y+cK33KM= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= -github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/esote/minmaxheap v1.0.0 h1:rgA7StnXXpZG6qlM0S7pUmEv1KpWe32rYT4x8J8ntaA= github.com/esote/minmaxheap v1.0.0/go.mod h1:Ln8+i7fS1k3PLgZI2JAo0iA1as95QnIYiGCrqSJ5FZk= -github.com/etcd-io/bbolt v1.3.3/go.mod h1:ZF2nL25h33cCyBtcyWeZ2/I3HQOfTP+0PIEvHjkjCrw= github.com/ethereum/c-kzg-4844 v0.4.0 h1:3MS1s4JtA868KpJxroZoepdV0ZKBp3u/O5HcZ7R3nlY= github.com/ethereum/c-kzg-4844 v0.4.0/go.mod h1:VewdlzQmpT5QSrVhbBuGoCdFJkpaJlO1aQputP83wc0= github.com/ethereum/go-ethereum v1.13.8 h1:1od+thJel3tM52ZUNQwvpYOeRHlbkVFZ5S8fhi0Lgsg= @@ -366,13 +332,11 @@ github.com/facebookgo/stack v0.0.0-20160209184415-751773369052 h1:JWuenKqqX8nojt github.com/facebookgo/stack v0.0.0-20160209184415-751773369052/go.mod h1:UbMTZqLaRiH3MsBH8va0n7s1pQYcu3uTb8G4tygF4Zg= github.com/facebookgo/subset v0.0.0-20200203212716-c811ad88dec4 h1:7HZCaLC5+BZpmbhCOZJ293Lz68O7PYrF2EzeiFMwCLk= github.com/facebookgo/subset v0.0.0-20200203212716-c811ad88dec4/go.mod h1:5tD+neXqOorC30/tWg0LCSkrqj/AR6gu8yY8/fpw1q0= -github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072/go.mod h1:duJ4Jxv5lDcvg4QuQr0oowTf7dz4/CR8NtyCooz9HL8= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= -github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM= -github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE= -github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= +github.com/fatih/color v1.17.0 h1:GlRw1BRJxkpqUCBKzKOw098ed57fEsKeNjpTe3cSjK4= +github.com/fatih/color v1.17.0/go.mod h1:YZ7TlrGPkiz6ku9fK3TLD/pl3CpsiFyu8N92HLgmosI= github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5 h1:FtmdgXiUlNeRsoNMFlKLDt+S+6hbjVMEW6RGQ7aUf7c= @@ -384,12 +348,12 @@ github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7z github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= -github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= -github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= -github.com/fxamacker/cbor/v2 v2.5.0 h1:oHsG0V/Q6E/wqTS2O1Cozzsy69nqCiguo5Q1a1ADivE= -github.com/fxamacker/cbor/v2 v2.5.0/go.mod h1:TA1xS00nchWmaBnEIxPSE5oHLuJBAVvqrtAnWBwBCVo= -github.com/gabriel-vasile/mimetype v1.4.2 h1:w5qFW6JKBz9Y393Y4q372O9A7cUSequkh1Q7OhCmWKU= -github.com/gabriel-vasile/mimetype v1.4.2/go.mod h1:zApsH/mKG4w07erKIaJPFiX0Tsq9BFQgN3qGY5GnNgA= +github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= +github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= +github.com/fxamacker/cbor/v2 v2.7.0 h1:iM5WgngdRBanHcxugY4JySA0nk1wZorNOpTgCMedv5E= +github.com/fxamacker/cbor/v2 v2.7.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ= +github.com/gabriel-vasile/mimetype v1.4.3 h1:in2uUcidCuFcDKtdcBxlR0rJ1+fsokWf+uqxgUFjbI0= +github.com/gabriel-vasile/mimetype v1.4.3/go.mod h1:d8uq/6HKRL6CGdk+aubisF/M5GcPfT7nKyLpA0lbSSk= github.com/gagliardetto/binary v0.7.7 h1:QZpT38+sgoPg+TIQjH94sLbl/vX+nlIRA37pEyOsjfY= github.com/gagliardetto/binary v0.7.7/go.mod h1:mUuay5LL8wFVnIlecHakSZMvcdqfs+CsotR5n77kyjM= github.com/gagliardetto/gofuzz v1.2.2 h1:XL/8qDMzcgvR4+CyRQW9UGdwPRPMHVJfqQ/uMvSUuQw= @@ -398,16 +362,14 @@ github.com/gagliardetto/solana-go v1.8.4 h1:vmD/JmTlonyXGy39bAo0inMhmbdAwV7rXZtL github.com/gagliardetto/solana-go v1.8.4/go.mod h1:i+7aAyNDTHG0jK8GZIBSI4OVvDqkt2Qx+LklYclRNG8= github.com/gagliardetto/treeout v0.1.4 h1:ozeYerrLCmCubo1TcIjFiOWTTGteOOHND1twdFpgwaw= github.com/gagliardetto/treeout v0.1.4/go.mod h1:loUefvXTrlRG5rYmJmExNryyBRh8f89VZhmMOyCyqok= -github.com/gavv/httpexpect v2.0.0+incompatible/go.mod h1:x+9tiU1YnrOvnB725RkpoLv1M62hOWzwo5OXotisrKc= github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08 h1:f6D9Hr8xV8uYKlyuj8XIruxlh9WjVjdh1gIicAS7ays= github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= github.com/gballet/go-verkle v0.1.1-0.20231031103413-a67434b50f46 h1:BAIP2GihuqhwdILrV+7GJel5lyPV3u1+PgzrWLc0TkE= github.com/gballet/go-verkle v0.1.1-0.20231031103413-a67434b50f46/go.mod h1:QNpY22eby74jVhqH4WhDLDwxc/vqsern6pW+u2kbkpc= github.com/gedex/inflector v0.0.0-20170307190818-16278e9db813 h1:Uc+IZ7gYqAf/rSGFplbWBSHaGolEQlNLgMgSE3ccnIQ= github.com/gedex/inflector v0.0.0-20170307190818-16278e9db813/go.mod h1:P+oSoE9yhSRvsmYyZsshflcR6ePWYLql6UU1amW13IM= -github.com/getsentry/sentry-go v0.12.0/go.mod h1:NSap0JBYWzHND8oMbyi0+XZhUalc1TBdRL1M71JZW2c= -github.com/getsentry/sentry-go v0.19.0 h1:BcCH3CN5tXt5aML+gwmbFwVptLLQA+eT866fCO9wVOM= -github.com/getsentry/sentry-go v0.19.0/go.mod h1:y3+lGEFEFexZtpbG1GUE2WD/f9zGyKYwpEqryTOC/nE= +github.com/getsentry/sentry-go v0.23.0 h1:dn+QRCeJv4pPt9OjVXiMcGIBIefaTJPw/h0bZWO05nE= +github.com/getsentry/sentry-go v0.23.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gin-contrib/cors v1.5.0 h1:DgGKV7DDoOn36DFkNtbHrjoRiT5ExCe+PC9/xp7aKvk= github.com/gin-contrib/cors v1.5.0/go.mod h1:TvU7MAZ3EwrPLI2ztzTt3tqgvBCq+wn8WpZmfADjupI= @@ -426,8 +388,6 @@ github.com/gin-gonic/gin v1.9.1 h1:4idEAncQnU5cB7BeOkPtxjfCSye0AAm1R0RVIqJ+Jmg= github.com/gin-gonic/gin v1.9.1/go.mod h1:hPrL7YrpYKXt5YId3A/Tnip5kqbEAP+KLuI3SUcPTeU= github.com/go-asn1-ber/asn1-ber v1.5.5 h1:MNHlNMBDgEKD4TcKr36vQN68BA00aDfjIt3/bD50WnA= github.com/go-asn1-ber/asn1-ber v1.5.5/go.mod h1:hEBeB/ic+5LoWskz+yKT7vGhhPYkProFKoKdwZRWMe0= -github.com/go-check/check v0.0.0-20180628173108-788fd7840127/go.mod h1:9ES+weclKsC9YodN5RgxqK/VD9HM9JsCSh7rNhMZE98= -github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= @@ -450,11 +410,11 @@ github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG github.com/go-logfmt/logfmt v0.6.0 h1:wGYYu3uicYdqXVgoYbvnkrPVXkuLM1p1ifugDMEdRi4= github.com/go-logfmt/logfmt v0.6.0/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= -github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= +github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= -github.com/go-martini/martini v0.0.0-20170121215854-22fa46961aab/go.mod h1:/P9AEU963A2AYjv4d1V5eVL1CQbEJq6aCNHDDjibzu8= 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-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= @@ -467,44 +427,41 @@ github.com/go-playground/universal-translator v0.18.0/go.mod h1:UvRDBj+xPUEGrFYl github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= github.com/go-playground/validator/v10 v10.10.0/go.mod h1:74x4gJWsvQexRdW8Pn3dXSGrTK4nAUsbPlLADvpJkos= -github.com/go-playground/validator/v10 v10.15.5 h1:LEBecTWb/1j5TNY1YYG2RcOUN3R7NLylN+x8TTueE24= -github.com/go-playground/validator/v10 v10.15.5/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU= +github.com/go-playground/validator/v10 v10.22.0 h1:k6HsTZ0sTnROkhS//R0O+55JgM8C4Bx7ia+JlgcnOao= +github.com/go-playground/validator/v10 v10.22.0/go.mod h1:dbuPbCMFw/DrkbEynArYaCwl3amGuJotoKCe95atGMM= github.com/go-sql-driver/mysql v1.8.1 h1:LedoTUt/eveggdHS9qUFC1EFSa8bU2+1pZjSRpvNJ1Y= github.com/go-sql-driver/mysql v1.8.1/go.mod h1:wEBSXgmK//2ZFJyE+qWnIsVGmvmEKlqwuVSjsCm7DZg= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 h1:p104kn46Q8WdvHunIJ9dAyjPVtrBPhSr3KT2yUst43I= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= -github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= -github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls= +github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= +github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= +github.com/go-viper/mapstructure/v2 v2.1.0 h1:gHnMa2Y/pIxElCH2GlZZ1lZSsn6XMtufpGyP1XxdC/w= +github.com/go-viper/mapstructure/v2 v2.1.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= github.com/go-webauthn/webauthn v0.9.4 h1:YxvHSqgUyc5AK2pZbqkWWR55qKeDPhP8zLDr6lpIc2g= github.com/go-webauthn/webauthn v0.9.4/go.mod h1:LqupCtzSef38FcxzaklmOn7AykGKhAhr9xlRbdbgnTw= github.com/go-webauthn/x v0.1.5 h1:V2TCzDU2TGLd0kSZOXdrqDVV5JB9ILnKxA9S53CSBw0= github.com/go-webauthn/x v0.1.5/go.mod h1:qbzWwcFcv4rTwtCLOZd+icnr6B7oSsAGZJqlt8cukqY= -github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo= -github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= -github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM= github.com/goccy/go-json v0.9.7/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU= github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 h1:ZpnhV/YsD2/4cESfV5+Hoeu/iUR3ruzNvZ+yQfO03a0= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4= +github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gofrs/flock v0.8.1 h1:+gYjHKf32LDeiEEFhQaotPbLuUXjY5ZqxKgXy7n59aw= github.com/gofrs/flock v0.8.1/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU= github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gofrs/uuid v4.3.1+incompatible h1:0/KbAdpx3UXAx1kEOWHJeOkpbgRFGHVgv+CFIY7dBJI= github.com/gofrs/uuid v4.3.1+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= -github.com/gogo/googleapis v0.0.0-20180223154316-0cd9801be74a/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= github.com/gogo/googleapis v1.4.1 h1:1Yx4Myt7BxzvUr5ldGSbwYiZG6t9wGBZ+8/fX3Wvtq0= github.com/gogo/googleapis v1.4.1/go.mod h1:2lpHqI5OcWCtVElxXnPt+s8oJvMpySlOyM6xDCrzib4= -github.com/gogo/status v1.1.0/go.mod h1:BFv9nrluPLmrS0EmGVvLaPNmRosr9KapBYd5/hpY1WM= -github.com/golang-jwt/jwt v3.2.2+incompatible h1:IfV12K8xAKAnZqdXVzCZ+TOjboZ2keLg81eXfW3O+oY= -github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg= github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= github.com/golang-jwt/jwt/v5 v5.2.0 h1:d/ix8ftRUorsN+5eMIlF4T6J8CAt9rch3My2winC1Jw= github.com/golang-jwt/jwt/v5 v5.2.0/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/glog v1.2.0 h1:uCdmnmatrKCgMBlM4rMuJZWOkPDqdbZPnrMXDY4gI68= -github.com/golang/glog v1.2.0/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w= +github.com/golang/glog v1.2.1 h1:OptwRhECazUx5ix5TTWC3EZhsZEHWcYWY4FQHTIubm4= +github.com/golang/glog v1.2.1/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w= github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -515,9 +472,7 @@ github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfb github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -525,7 +480,6 @@ github.com/golang/protobuf v1.3.0/go.mod h1:Qd/q+1AKNOZr9uGQzbzCmRO6sUih6GTPZv6a github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= @@ -545,7 +499,6 @@ github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEW github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb h1:PBC98N2aIaM3XXiurYmW7fx4GZkL8feAMVq7nEjURHk= github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/gomodule/redigo v1.7.1-0.20190724094224-574c33c3df38/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.1.2 h1:xf4v41cLI2Z6FxbKm+8Bu+m8ifhj15JuZ9sa0jZCMUU= @@ -554,18 +507,15 @@ github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5a github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= github.com/google/go-tpm v0.9.0 h1:sQF6YqWMi+SCXpsmS3fd21oPy/vSddwZry4JnmltHVk= github.com/google/go-tpm v0.9.0/go.mod h1:FkNVkc6C+IsvDI9Jw1OveJmxGZUUaKxtrpOS47QWKfU= github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= @@ -573,8 +523,6 @@ github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/ github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= -github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= -github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/orderedcode v0.0.1 h1:UzfcAexk9Vhv8+9pNOgRu41f16lHq725vPwnSeiG/Us= github.com/google/orderedcode v0.0.1/go.mod h1:iVyU4/qPKHY5h/wSd6rZZCDcLJNxiWO6dvsYES2Sb20= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= @@ -582,21 +530,15 @@ github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OI github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20231023181126-ff6d637d2a7b h1:RMpPgZTSApbPf7xaVel+QkoGPRLFLrwFO89uDUHEGf0= -github.com/google/pprof v0.0.0-20231023181126-ff6d637d2a7b/go.mod h1:czg5+yv1E0ZGTi6S6vVK1mke0fV+FaUhNGcd6VRS9Ik= +github.com/google/pprof v0.0.0-20240424215950-a892ee059fd6 h1:k7nVchz72niMH6YLQNvHSdIE7iqsQxK1P41mySCvssg= +github.com/google/pprof v0.0.0-20240424215950-a892ee059fd6/go.mod h1:kf6iHlnVGwgKolg33glAes7Yg/8iWP8ukqeldJSO7jw= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/s2a-go v0.1.7 h1:60BLSyTrOV4/haCDW4zb1guZItoSq8foHCXrAnjBo/o= github.com/google/s2a-go v0.1.7/go.mod h1:50CgR4k1jNlWBu4UfS4AcfhVe1r6pdZPygJ3R8F0Qdw= github.com/google/subcommands v1.2.0/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -604,9 +546,8 @@ github.com/googleapis/enterprise-certificate-proxy v0.3.2 h1:Vie5ybvEvT75RniqhfF github.com/googleapis/enterprise-certificate-proxy v0.3.2/go.mod h1:VLSiSSBs/ksPL8kq3OBOQ6WRI2QnaFynd1DCjZ62+V0= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/googleapis/gax-go/v2 v2.12.2 h1:mhN09QQW1jEWeMF74zGR81R30z4VJzjZsfkUhuHF+DA= -github.com/googleapis/gax-go/v2 v2.12.2/go.mod h1:61M8vcyyXR2kqKFxKrfA22jaA8JGF7Dc8App1U3H6jc= -github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= +github.com/googleapis/gax-go/v2 v2.12.5 h1:8gw9KZK8TiVKB6q3zHY3SBzLnrGp6HQjyfYBYGmXdxA= +github.com/googleapis/gax-go/v2 v2.12.5/go.mod h1:BUDKcWo+RaKq5SC9vVYL0wLADa3VcfswbOMMRmB9H3E= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/context v1.1.1 h1:AWwleXJkX/nhcU9bZSnZoi3h/qGYqQAGhq6zZe/aQW8= github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= @@ -619,18 +560,17 @@ github.com/gorilla/securecookie v1.1.2 h1:YCIWL56dvtr73r6715mJs5ZvhtnY73hBvEF8kX github.com/gorilla/securecookie v1.1.2/go.mod h1:NfCASbcHqRSY+3a8tlWJwsQap2VX5pwzwo4h3eOamfo= github.com/gorilla/sessions v1.2.2 h1:lqzMYz6bOfvn2WriPUjNByzeXIlVzURcPmgMczkmTjY= github.com/gorilla/sessions v1.2.2/go.mod h1:ePLdVu+jbEgHH+KWw8I1z2wqd0BAdAQh/8LRvBeoNcQ= -github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY= github.com/gorilla/websocket v1.5.1/go.mod h1:x3kM2JMyaluk02fnUJpQuwD2dCS5NDG2ZHL0uE0tcaY= github.com/grafana/pyroscope-go v1.1.1 h1:PQoUU9oWtO3ve/fgIiklYuGilvsm8qaGhlY4Vw6MAcQ= github.com/grafana/pyroscope-go v1.1.1/go.mod h1:Mw26jU7jsL/KStNSGGuuVYdUq7Qghem5P8aXYXSXG88= -github.com/grafana/pyroscope-go/godeltaprof v0.1.6 h1:nEdZ8louGAplSvIJi1HVp7kWvFvdiiYg3COLlTwJiFo= -github.com/grafana/pyroscope-go/godeltaprof v0.1.6/go.mod h1:Tk376Nbldo4Cha9RgiU7ik8WKFkNpfds98aUzS8omLE= +github.com/grafana/pyroscope-go/godeltaprof v0.1.8 h1:iwOtYXeeVSAeYefJNaxDytgjKtUuKQbJqgAIjlnicKg= +github.com/grafana/pyroscope-go/godeltaprof v0.1.8/go.mod h1:2+l7K7twW49Ct4wFluZD3tZ6e0SjanjcUUBPVD/UuGU= github.com/graph-gophers/dataloader v5.0.0+incompatible h1:R+yjsbrNq1Mo3aPG+Z/EKYrXrXXUNJHOgbRt+U6jOug= github.com/graph-gophers/dataloader v5.0.0+incompatible/go.mod h1:jk4jk0c5ZISbKaMe8WsVopGB5/15GvGHMdMdPtwlRp4= -github.com/graph-gophers/graphql-go v1.3.0 h1:Eb9x/q6MFpCLz7jBCiP/WTxjSDrYLR1QY41SORZyNJ0= -github.com/graph-gophers/graphql-go v1.3.0/go.mod h1:9CQHMSxwO4MprSdzoIEobiHpoLtHm77vfxsvsIN5Vuc= +github.com/graph-gophers/graphql-go v1.5.0 h1:fDqblo50TEpD0LY7RXk/LFVYEVqo3+tXMNMPSVXA1yc= +github.com/graph-gophers/graphql-go v1.5.0/go.mod h1:YtmJZDLbF1YYNrlNAuiO5zAStUWc3XZT07iGsVqe1Os= github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 h1:+9834+KizmvFV7pXQGSXQTsaWhq2GjuNUt0aUU0YBYw= github.com/grpc-ecosystem/go-grpc-middleware v1.3.0/go.mod h1:z0ButlSOZa5vEBq9m2m2hlwIgKw+rp3sdCBRoJY+30Y= @@ -642,8 +582,8 @@ github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgf github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 h1:bkypFPDjIYGfCYD5mRBvpqxfYX1YCS1PXdKYWi8FsN0= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0/go.mod h1:P+Lt/0by1T8bfcF3z737NnSbmxQAppXMRziHUxPOC8k= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0 h1:asbCHRVmodnJTuQ3qamDwqVOIjwqUPTYmYuemVOx+Ys= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0/go.mod h1:ggCgvZ2r7uOoQjOyu2Y1NhHmEPPzzuhWgcza5M1Ji1I= github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c h1:6rhixN/i8ZofjG1Y75iExal34USq5p+wiN1tpie8IrU= github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c/go.mod h1:NMPJylDgVpX0MLRlPy15sqSwOFv/U1GZ2m21JhFfek0= github.com/gtank/merlin v0.1.1-0.20191105220539-8318aed1a79f/go.mod h1:T86dnYJhcGOh5BjZFCJWTDeTK7XW8uE+E21Cy/bIQ+s= @@ -674,6 +614,8 @@ github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJ github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= +github.com/hashicorp/go-plugin v1.6.2-0.20240829161738-06afb6d7ae99 h1:OSQYEsRT3tRttZkk6zyC3aAaliwd7Loi/KgXgXxGtwA= +github.com/hashicorp/go-plugin v1.6.2-0.20240829161738-06afb6d7ae99/go.mod h1:CkgLQ5CZqNmdL9U9JzM532t8ZiYQ35+pj3b1FD37R0Q= github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= github.com/hashicorp/go-retryablehttp v0.7.5 h1:bJj+Pj19UZMIweq/iie+1u5YCdGrnxCT9yvm0e+Nd5M= github.com/hashicorp/go-retryablehttp v0.7.5/go.mod h1:Jy/gPYAdjqffZ/yFGCFV2doI5wjtH1ewM9u8iYVjtX8= @@ -686,7 +628,6 @@ github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/b github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8= github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek= github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= @@ -723,13 +664,11 @@ github.com/huandu/xstrings v1.4.0 h1:D17IlohoQq4UcpqD7fDk80P7l+lwAmlFaBHgOipl2FU github.com/huandu/xstrings v1.4.0/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/huin/goupnp v1.3.0 h1:UvLUlWDNpoUdYzb2TCn+MuTWtcjXKSza2n6CBdQ0xXc= github.com/huin/goupnp v1.3.0/go.mod h1:gnGPsThkYa7bFi/KWmEysQRf48l2dvR5bxr2OFckNX8= -github.com/hydrogen18/memlistener v0.0.0-20200120041712-dcc25e7acd91/go.mod h1:qEIFzExnS6016fRpRfxrExeVn2gbClQA99gQhnIcdhE= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/imdario/mergo v0.3.16 h1:wwQJbIsHYGMUyLSPrEq1CT16AhnhNJQ51+4fdHUnCl4= github.com/imdario/mergo v0.3.16/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+hD27ysY= -github.com/imkira/go-interpol v1.1.0/go.mod h1:z0h2/2T3XF8kyEPpRgJ3kmNv+C43p+I/CoI+jC3w2iA= github.com/improbable-eng/grpc-web v0.15.0 h1:BN+7z6uNXZ1tQGcNAuaU1YjsLTApzkjt2tzCixLaUPQ= github.com/improbable-eng/grpc-web v0.15.0/go.mod h1:1sy9HKV4Jt9aEs9JSnkWlRJPuPtwNr0l57L4f878wP8= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= @@ -737,11 +676,6 @@ github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2 github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/invopop/jsonschema v0.12.0 h1:6ovsNSuvn9wEQVOyc72aycBMVQFKz7cPdMJn10CvzRI= github.com/invopop/jsonschema v0.12.0/go.mod h1:ffZ5Km5SWWRAIN6wbDXItl95euhFz2uON45H2qjYt+0= -github.com/iris-contrib/blackfriday v2.0.0+incompatible/go.mod h1:UzZ2bDEoaSGPbkg6SAB4att1aAwTmVIx/5gCVqeyUdI= -github.com/iris-contrib/go.uuid v2.0.0+incompatible/go.mod h1:iz2lgM/1UnEf1kP0L/+fafWORmlnuysV2EMP8MW+qe0= -github.com/iris-contrib/jade v1.1.3/go.mod h1:H/geBymxJhShH5kecoiOCSssPX7QWYH7UaeZTSWddIk= -github.com/iris-contrib/pongo2 v0.0.1/go.mod h1:Ssh+00+3GAZqSQb30AvBRNxBx7rf0GqwkjqxNd0u65g= -github.com/iris-contrib/schema v0.0.1/go.mod h1:urYA3uvUNG1TIIjOSCzHr9/LmbQo8LrOcOqfqxa4hXw= github.com/jackc/chunkreader v1.0.0/go.mod h1:RT6O25fNZIuasFJRyZ4R/Y2BbhasbmZXF9QQ7T3kePo= github.com/jackc/chunkreader/v2 v2.0.0/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk= github.com/jackc/chunkreader/v2 v2.0.1 h1:i+RDz65UE+mmpjTfyz0MoVTnzeYxroil2G82ki7MGG8= @@ -801,8 +735,8 @@ github.com/jmhodges/levigo v1.0.0 h1:q5EC36kV79HWeTBWsod3mG11EgStG3qArTKcvlksN1U github.com/jmhodges/levigo v1.0.0/go.mod h1:Q6Qx+uH3RAqyK4rFQroq9RL7mdkABMcfhEI+nNuzMJQ= github.com/jmoiron/sqlx v1.4.0 h1:1PLqN7S1UYp5t4SrVVnt4nUVNemrDAtxlulVe+Qgm3o= github.com/jmoiron/sqlx v1.4.0/go.mod h1:ZrZ7UsYB/weZdl2Bxg6jCRO9c3YHl8r3ahlKmRT4JLY= -github.com/joho/godotenv v1.4.0 h1:3l4+N6zfMWnkbPEXKng2o2/MR5mSwTrBih4ZEkkz1lg= -github.com/joho/godotenv v1.4.0/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= +github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0= +github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/jonboulle/clockwork v0.4.0 h1:p4Cf1aMWXnXAUh8lVfewRBx1zaTSYKrKMF2g3ST4RZ4= github.com/jonboulle/clockwork v0.4.0/go.mod h1:xgRqUGwRcjKCO1vbZUEtSLrqKoPSsUpK7fnezOII0kc= @@ -817,29 +751,19 @@ github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1 github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= -github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88/go.mod h1:3w7q1U84EfirKl04SVQ/s7nPm1ZPhiXd34z40TNz36k= -github.com/kataras/golog v0.0.10/go.mod h1:yJ8YKCmyL+nWjERB90Qwn+bdyBZsaQwU3bTVFgkFIp8= -github.com/kataras/iris/v12 v12.1.8/go.mod h1:LMYy4VlP67TQ3Zgriz8RE2h2kMZV2SgMYbq3UhfoFmE= -github.com/kataras/neffos v0.0.14/go.mod h1:8lqADm8PnbeFfL7CLXh1WHw53dG27MC3pgi2R1rmoTE= -github.com/kataras/pio v0.0.2/go.mod h1:hAoW0t9UmXi4R5Oyq5Z4irTbaTsOemSrDGUtaTl7Dro= -github.com/kataras/sitemap v0.0.5/go.mod h1:KY2eugMKiPwsJgx7+U103YZehfvNGOXURubcGyk0Bz8= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.8.2/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= -github.com/klauspost/compress v1.9.7/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/klauspost/compress v1.11.4/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= -github.com/klauspost/compress v1.17.3 h1:qkRjuerhUU1EmXLYGkSH6EZL+vPSxIrYjLNAK4slzwA= -github.com/klauspost/compress v1.17.3/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= -github.com/klauspost/cpuid v1.2.1/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= +github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA= +github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/klauspost/cpuid/v2 v2.2.5 h1:0E5MSMDEoAulmXNFquVs//DdoomxaoTY1kUhbc/qbZg= github.com/klauspost/cpuid/v2 v2.2.5/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= github.com/knz/go-libedit v1.10.1/go.mod h1:MZTVkCWyz0oBc7JOWP3wNAzd002ZbM/5hgShxwh4x8M= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= @@ -853,13 +777,11 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/labstack/echo/v4 v4.5.0/go.mod h1:czIriw4a0C1dFun+ObrXp7ok03xON0N1awStJ6ArI7Y= -github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL7NoOu+k= github.com/leanovate/gopter v0.2.10-0.20210127095200-9abe2343507a h1:dHCfT5W7gghzPtfsW488uPmEOm85wewI+ypUwibyTdU= github.com/leanovate/gopter v0.2.10-0.20210127095200-9abe2343507a/go.mod h1:U2L/78B+KVFIx2VmW6onHJQzXtFb+p5y3y2Sh+Jxxv8= github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= -github.com/leodido/go-urn v1.2.4 h1:XlAE/cm/ms7TE/VMVoduSpNBoyc2dOxHs5MZSwAN63Q= -github.com/leodido/go-urn v1.2.4/go.mod h1:7ZrI8mTSeBSHl/UaRyKQW1qZeMgak41ANeCNaVckg+4= +github.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ= +github.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI= github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.1.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= @@ -883,12 +805,9 @@ github.com/manyminds/api2go v0.0.0-20171030193247-e7b693844a6f h1:tVvGiZQFjOXP+9 github.com/manyminds/api2go v0.0.0-20171030193247-e7b693844a6f/go.mod h1:Z60vy0EZVSu0bOugCHdcN5ZxFMKSpjRgsnh0XKPFqqk= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= -github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-colorable v0.1.11/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= @@ -896,11 +815,11 @@ github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNx github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= @@ -909,14 +828,9 @@ github.com/mattn/go-runewidth v0.0.14/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh github.com/mattn/go-sqlite3 v1.14.22/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y= github.com/mattn/go-sqlite3 v2.0.3+incompatible h1:gXHsfypPkaMZrKbD5209QV9jbUTJKjyR5WD3HYQSd+U= github.com/mattn/go-sqlite3 v2.0.3+incompatible/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= -github.com/mattn/goveralls v0.0.2/go.mod h1:8d1ZMHsd7fW6IRPKQh46F2WRpyib5/X4FOpevwGNQEw= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 h1:jWpvCLoY8Z/e3VKvlsiIGKtc+UG6U5vzxaoagmhXfyg= -github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0/go.mod h1:QUyp042oQthUoa9bqDv0ER0wrtXnBruoNd7aNjkbP+k= -github.com/mediocregopher/radix/v3 v3.4.2/go.mod h1:8FL3F6UQRXHXIBSPUs5h0RybMF8i4n7wVopoX3x7Bv8= github.com/mfridman/interpolate v0.0.2 h1:pnuTK7MQIxxFz1Gr+rjSIx9u7qVjf5VOoM/u6BbAxPY= github.com/mfridman/interpolate v0.0.2/go.mod h1:p+7uk6oE07mpE/Ik1b8EckO0O4ZXiGAfshKBWLUM9Xg= -github.com/microcosm-cc/bluemonday v1.0.2/go.mod h1:iVP4YcDBq+n/5fb23BhYFvIMq/leAFZyRl6bYmGDlGc= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/mimoo/StrobeGo v0.0.0-20181016162300-f8f6d4d2b643/go.mod h1:43+3pMjjKimDBf5Kr4ZFNGbLql1zKkbImw+fZbw3geM= github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 h1:QRUSJEgZn2Snx0EmT/QLXibWjSUDjKWvXIT19NBVp94= @@ -935,6 +849,10 @@ github.com/mitchellh/go-testing-interface v1.14.1 h1:jrgshOhYAUVNMAJiKbEu7EqAwgJ github.com/mitchellh/go-testing-interface v1.14.1/go.mod h1:gfgS7OtZj6MA4U1UrDRp04twqAjfvlZyCfX3sDjEym8= github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= +github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= +github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/pointerstructure v1.2.0 h1:O+i9nHnXS3l/9Wu7r4NrEdwA2VFTicjUEN1uBnDo34A= github.com/mitchellh/pointerstructure v1.2.0/go.mod h1:BRAsLI5zgXmw97Lf6s25bs8ohIXc3tViBH44KcwB2g4= github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= @@ -953,22 +871,17 @@ github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjY github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= github.com/mostynb/zstdpool-freelist v0.0.0-20201229113212-927304c0c3b1 h1:mPMvm6X6tf4w8y7j9YIt6V9jfWhL6QlbEc7CCmeQlWk= github.com/mostynb/zstdpool-freelist v0.0.0-20201229113212-927304c0c3b1/go.mod h1:ye2e/VUEtE2BHE+G/QcKkcLQVAEJoYRFj5VUOQatCRE= -github.com/moul/http2curl v1.0.0/go.mod h1:8UbvGypXm98wA/IqH45anm5Y2Z6ep6O31QGOAZ3H0fQ= github.com/mr-tron/base58 v1.2.0 h1:T/HDJBh4ZCPbU39/+c3rRvE0uKBQlU27+QI8LJ4t64o= github.com/mr-tron/base58 v1.2.0/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= github.com/mtibben/percent v0.2.1 h1:5gssi8Nqo8QU/r2pynCm+hBQHpkB/uNK7BJCFogWdzs= github.com/mtibben/percent v0.2.1/go.mod h1:KG9uO+SZkUp+VkRHsCdYQV3XSZrrSpR3O9ibNBTZrns= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5VglpSg= -github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzEE/Zbp4w= -github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= -github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= github.com/ncruces/go-strftime v0.1.9 h1:bY0MQC28UADQmHmaF5dgpLmImcShSi2kHU9XLdhx/f4= github.com/ncruces/go-strftime v0.1.9/go.mod h1:Fwc5htZGVVkseilnfgOVb9mKy6w1naJmn9CehxcKcls= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nkovacs/streamquote v0.0.0-20170412213628-49af9bddb229/go.mod h1:0aYXnNPJ8l7uZxf45rWW1a/uME32OF0rhiYGNQ2oF2E= -github.com/nolag/mapstructure v1.5.2-0.20240625151721-90ea83a3f479 h1:1jCGDLFXDOHF2sdeTJYKrIuSLGMpQZpgXXHNGXR5Ouk= -github.com/nolag/mapstructure v1.5.2-0.20240625151721-90ea83a3f479/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/nsf/jsondiff v0.0.0-20210926074059-1e845ec5d249 h1:NHrXEjTNQY7P0Zfx1aMrNhpgxHmow66XQtm0aQLY0AE= github.com/nsf/jsondiff v0.0.0-20210926074059-1e845ec5d249/go.mod h1:mpRZBD8SJ55OIICQ3iWH0Yz3cjzA61JdqMLoWXeB2+8= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= @@ -980,24 +893,23 @@ github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= -github.com/onsi/ginkgo/v2 v2.13.0 h1:0jY9lJquiL8fcf3M4LAXN5aMlS/b2BV86HFFPCPMgE4= -github.com/onsi/ginkgo/v2 v2.13.0/go.mod h1:TE309ZR8s5FsKKpuB1YAQYBzCaAfUgatB/xlT/ETL/o= +github.com/onsi/ginkgo/v2 v2.17.2 h1:7eMhcy3GimbsA3hEnVKdw/PQM9XN9krpKVXsZdph0/g= +github.com/onsi/ginkgo/v2 v2.17.2/go.mod h1:nP2DPOQoNsQmsVyv5rDA8JkXQoCs6goXIvr/PRJ1eCc= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= -github.com/onsi/gomega v1.30.0 h1:hvMK7xYz4D3HapigLTeGdId/NcfQx1VHMJc60ew99+8= -github.com/onsi/gomega v1.30.0/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ= +github.com/onsi/gomega v1.33.1 h1:dsYjIxxSR755MDmKVsaFQTE22ChNBcuuTWgkUDSubOk= +github.com/onsi/gomega v1.33.1/go.mod h1:U4R44UsT+9eLIaYRB2a5qajjtQYn0hauxvRm16AVYg0= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= -github.com/opencontainers/image-spec v1.1.0-rc2 h1:2zx/Stx4Wc5pIPDvIxHXvXtQFW/7XWJGmnM7r3wg034= -github.com/opencontainers/image-spec v1.1.0-rc2/go.mod h1:3OVijpioIKYWTqjiG0zfF6wvoJ4fAXGbjdZuI2NgsRQ= +github.com/opencontainers/image-spec v1.1.0-rc5 h1:Ygwkfw9bpDvs+c9E34SdgGOj41dX/cbdlwvlWt0pnFI= +github.com/opencontainers/image-spec v1.1.0-rc5/go.mod h1:X4pATf0uXsnn3g5aiGIsVnJBR4mxhKzfwmvK/B2NTm8= github.com/opencontainers/runc v1.1.3 h1:vIXrkId+0/J2Ymu2m7VjGvbSlAId9XNRPhn2p4b+d8w= github.com/opencontainers/runc v1.1.3/go.mod h1:1J5XiS+vdZ3wCyZybsuxXZWGrgSr8fFJHLXuG2PsnNg= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= @@ -1014,8 +926,8 @@ github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/9 github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8= github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= github.com/pelletier/go-toml/v2 v2.0.1/go.mod h1:r9LEWfGN8R5k0VXJ+0BkIe7MYkRdwZOjgMj2KwnJFUo= -github.com/pelletier/go-toml/v2 v2.2.0 h1:QLgLl2yMN7N+ruc31VynXs1vhMZa7CeHHejIeBAsoHo= -github.com/pelletier/go-toml/v2 v2.2.0/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs= +github.com/pelletier/go-toml/v2 v2.2.2 h1:aYUidT7k73Pcl9nb2gScu7NSrKCSHIDE89b3+6Wq+LM= +github.com/pelletier/go-toml/v2 v2.2.2/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs= github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08 h1:hDSdbBuw3Lefr6R18ax0tZ2BJeNB3NehB3trOwYBsdU= github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= @@ -1026,7 +938,6 @@ github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= @@ -1039,26 +950,26 @@ github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXP github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= -github.com/prometheus/client_golang v1.17.0 h1:rl2sfwZMtSthVU752MqfjQozy7blglC+1SOtjMAMh+Q= -github.com/prometheus/client_golang v1.17.0/go.mod h1:VeL+gMmOAxkS2IqfCq0ZmHSL+LjWfWDUmp1mBz9JgUY= +github.com/prometheus/client_golang v1.20.0 h1:jBzTZ7B099Rg24tny+qngoynol8LtVYlA2bqx3vEloI= +github.com/prometheus/client_golang v1.20.0/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.5.0 h1:VQw1hfvPvk3Uv6Qf29VrPF32JB6rtbgI6cYPYQjL0Qw= -github.com/prometheus/client_model v0.5.0/go.mod h1:dTiFglRmd66nLR9Pv9f0mZi7B7fk5Pm3gvsjB5tr+kI= +github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= +github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= -github.com/prometheus/common v0.45.0 h1:2BGz0eBc2hdMDLnO/8n0jeB3oPrt2D08CekT0lneoxM= -github.com/prometheus/common v0.45.0/go.mod h1:YJmSTw9BoKxJplESWWxlbyttQR4uaEcGyv9MZjVOJsY= +github.com/prometheus/common v0.59.1 h1:LXb1quJHWm1P6wq/U824uxYi4Sg0oGvNeUm1z5dJoX0= +github.com/prometheus/common v0.59.1/go.mod h1:GpWM7dewqmVYcd7SmRaiWVe9SSqjf0UrwnYnpEZNuT0= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= -github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= -github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= +github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= +github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/prometheus/prometheus v0.48.1 h1:CTszphSNTXkuCG6O0IfpKdHcJkvvnAAE1GbELKS+NFk= github.com/prometheus/prometheus v0.48.1/go.mod h1:SRw624aMAxTfryAcP8rOjg4S/sHHaetx2lyJJ2nM83g= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= @@ -1066,8 +977,6 @@ github.com/rakyll/statik v0.1.7 h1:OF3QCZUuyPxuGEP7B4ypUa7sB/iHtqOTDYZXGM8KOdQ= github.com/rakyll/statik v0.1.7/go.mod h1:AlZONWzMtEnMs7W4e/1LURLiI49pIMmp6V9Unghqrcc= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= -github.com/regen-network/gocuke v0.6.2 h1:pHviZ0kKAq2U2hN2q3smKNxct6hS0mGByFMHGnWA97M= -github.com/regen-network/gocuke v0.6.2/go.mod h1:zYaqIHZobHyd0xOrHGPQjbhGJsuZ1oElx150u2o1xuk= github.com/regen-network/protobuf v1.3.3-alpha.regen.1 h1:OHEc+q5iIAXpqiqFKeLpu5NwTIkVXUs48vFMwzqpqY4= github.com/regen-network/protobuf v1.3.3-alpha.regen.1/go.mod h1:2DjTFR1HhMQhiWC5sZ4OhQ3+NtdbZ6oBDKQwq5Ou+FI= github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE= @@ -1082,33 +991,34 @@ github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6L github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= -github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/rs/cors v1.8.3 h1:O+qNyWn7Z+F9M0ILBHgMVPuB1xTOucVd5gtaYyXBpRo= github.com/rs/cors v1.8.3/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= +github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= github.com/rs/zerolog v1.13.0/go.mod h1:YbFCdg8HfsridGWAh22vktObvhZbQsZXe4/zB0OKkWU= github.com/rs/zerolog v1.15.0/go.mod h1:xYTKnLHcpfU2225ny5qZjxnj9NvkumZYjJHlAThCjNc= -github.com/rs/zerolog v1.30.0 h1:SymVODrcRsaRaSInD9yQtKbtWqwsfoPcRff/oRXLj4c= -github.com/rs/zerolog v1.30.0/go.mod h1:/tk+P47gFdPXq4QYjvCmT5/Gsug2nagsFWBWhAiSi1w= +github.com/rs/zerolog v1.32.0 h1:keLypqrlIjaFsbmJOBdB/qvyF8KEtCWHwobLp5l/mQ0= +github.com/rs/zerolog v1.32.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= -github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= +github.com/sagikazarmark/locafero v0.4.0 h1:HApY1R9zGo4DBgr7dqsTH/JJxLTTsOt7u6keLGt6kNQ= +github.com/sagikazarmark/locafero v0.4.0/go.mod h1:Pe1W6UlPYUk/+wc/6KFhbORCfqzgYEpgQ3O5fPuL3H4= +github.com/sagikazarmark/slog-shim v0.1.0 h1:diDBnUNK9N/354PgrxMywXnAwEr1QZcOr6gto+ugjYE= +github.com/sagikazarmark/slog-shim v0.1.0/go.mod h1:SrcSrq8aKtyuqEI1uvTDTK1arOWRIczQRv+GVI1AkeQ= github.com/santhosh-tekuri/jsonschema/v5 v5.3.1 h1:lZUw3E0/J3roVtGQ+SCrUrg3ON6NgVqpn3+iol9aGu4= github.com/santhosh-tekuri/jsonschema/v5 v5.3.1/go.mod h1:uToXkOrWAZ6/Oc07xWQrPOhJotwFIyu2bBVN41fcDUY= github.com/sasha-s/go-deadlock v0.3.1 h1:sqv7fDNShgjcaxkO0JNcOAlr8B9+cV5Ey/OB71efZx0= github.com/sasha-s/go-deadlock v0.3.1/go.mod h1:F73l+cr82YSh10GxyRI6qZiCgK64VaZjwesgfQ1/iLM= github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= -github.com/schollz/closestmatch v2.1.0+incompatible/go.mod h1:RtP1ddjLong6gTkbtmuhtR2uUrrJOpYzYRvbcPAid+g= github.com/scylladb/go-reflectx v1.0.1 h1:b917wZM7189pZdlND9PbIJ6NQxfDPfBvUaQ7cjj1iZQ= github.com/scylladb/go-reflectx v1.0.1/go.mod h1:rWnOfDIRWBGN0miMLIcoPt/Dhi2doCMZqwMCJ3KupFc= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= -github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/sethvargo/go-retry v0.2.4 h1:T+jHEQy/zKJf5s95UkguisicE0zuF9y7+/vgz08Ocec= github.com/sethvargo/go-retry v0.2.4/go.mod h1:1afjQuvh7s4gflMObvjLPaWgluLLyhA1wmVZ6KLpICw= github.com/shirou/gopsutil v3.21.11+incompatible h1:+1+c1VGhc88SSonWP6foOcLhvnKlUeu/erjjvaPEYiI= @@ -1119,70 +1029,71 @@ github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg github.com/shoenig/test v0.6.4/go.mod h1:byHiCGXqrVaflBLAMq/srcZIHynQPQgeyvkvXnjqq0k= github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4= github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= -github.com/shopspring/decimal v1.3.1 h1:2Usl1nmF/WZucqkFZhnfFYxxxu8LG21F6nPQBE5gKV8= github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= +github.com/shopspring/decimal v1.4.0 h1:bxl37RwXBklmTi0C79JfXCEBD1cqqHt0bbgBAGFp81k= +github.com/shopspring/decimal v1.4.0/go.mod h1:gawqmDU56v4yIKSwfBSFip1HdCCXN8/+DMd9qYNcwME= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= -github.com/smartcontractkit/chain-selectors v1.0.10 h1:t9kJeE6B6G+hKD0GYR4kGJSCqR1LNS7aI3jT0V+xGrg= -github.com/smartcontractkit/chain-selectors v1.0.10/go.mod h1:d4Hi+E1zqjy9HqMkjBE5q1vcG9VGgxf5VxiRHfzi2kE= +github.com/smartcontractkit/chain-selectors v1.0.23 h1:D2Eaex4Cw/O7Lg3tX6WklOqnjjIQAEBnutCtksPzVDY= +github.com/smartcontractkit/chain-selectors v1.0.23/go.mod h1:d4Hi+E1zqjy9HqMkjBE5q1vcG9VGgxf5VxiRHfzi2kE= github.com/smartcontractkit/chainlink-automation v1.0.4 h1:iyW181JjKHLNMnDleI8umfIfVVlwC7+n5izbLSFgjw8= github.com/smartcontractkit/chainlink-automation v1.0.4/go.mod h1:u4NbPZKJ5XiayfKHD/v3z3iflQWqvtdhj13jVZXj/cM= -github.com/smartcontractkit/chainlink-common v0.1.7-0.20240709155552-d76403db14e5 h1:1J1M+rpMJn+5R4EPaU8hbCqR17PFClEBOJyazsvbWck= -github.com/smartcontractkit/chainlink-common v0.1.7-0.20240709155552-d76403db14e5/go.mod h1:fh9eBbrReCmv31bfz52ENCAMa7nTKQbdhb2B3+S2VGo= -github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20240710121324-3ed288aa9b45 h1:NBQLtqk8zsyY4qTJs+NElI3aDFTcAo83JHvqD04EvB0= -github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20240710121324-3ed288aa9b45/go.mod h1:LV0h7QBQUpoC2UUi6TcUvcIFm1xjP/DtEcqV8+qeLUs= -github.com/smartcontractkit/chainlink-data-streams v0.0.0-20240702145022-37a2c3a742d1 h1:dsTmitRaVizHxoYFoGz4+y/zVa8XnvKUiTaZdx+6t9M= -github.com/smartcontractkit/chainlink-data-streams v0.0.0-20240702145022-37a2c3a742d1/go.mod h1:6DgCnHMGdBaIh0bLs1dK0MtdeMZfeNhc/nvBUN6KIUg= -github.com/smartcontractkit/chainlink-feeds v0.0.0-20240522213638-159fb2d99917 h1:MD80ZRCTvxxJ8PBmhtrKoTnky8cVNYrCrIBLVRbrOM0= -github.com/smartcontractkit/chainlink-feeds v0.0.0-20240522213638-159fb2d99917/go.mod h1:jwVxhctE6BgLOSSsVq9wbREpZ8Ev34H+UBxeUhESZRs= -github.com/smartcontractkit/chainlink-solana v1.0.3-0.20240708150922-0546185ead68 h1:kLf20IgCHTNoON0EzWqF5QiZJWZW+i7xWvFPCyIUZTM= -github.com/smartcontractkit/chainlink-solana v1.0.3-0.20240708150922-0546185ead68/go.mod h1:NbXXQaNFskVMYRut0MvBlcHu/vDgipGMwYjamvjVB9Y= -github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240709043547-03612098f799 h1:HyLTySm7BR+oNfZqDTkVJ25wnmcTtxBBD31UkFL+kEM= -github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240709043547-03612098f799/go.mod h1:UVFRacRkP7O7TQAzFmR52v5mUlxf+G1ovMlCQAB/cHU= -github.com/smartcontractkit/go-plugin v0.0.0-20240208201424-b3b91517de16 h1:TFe+FvzxClblt6qRfqEhUfa4kFQx5UobuoFGO2W4mMo= -github.com/smartcontractkit/go-plugin v0.0.0-20240208201424-b3b91517de16/go.mod h1:lBS5MtSSBZk0SHc66KACcjjlU6WzEVP/8pwz68aMkCI= -github.com/smartcontractkit/grpc-proxy v0.0.0-20230731113816-f1be6620749f h1:hgJif132UCdjo8u43i7iPN1/MFnu49hv7lFGFftCHKU= -github.com/smartcontractkit/grpc-proxy v0.0.0-20230731113816-f1be6620749f/go.mod h1:MvMXoufZAtqExNexqi4cjrNYE9MefKddKylxjS+//n0= -github.com/smartcontractkit/libocr v0.0.0-20240702141926-063ceef8c42e h1:9ypZ/8aW8Vm497i1gXHcT96oNLiu88jbg9QdX+IUE3E= -github.com/smartcontractkit/libocr v0.0.0-20240702141926-063ceef8c42e/go.mod h1:fb1ZDVXACvu4frX3APHZaEBp0xi1DIm34DcA0CwTsZM= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20240930060710-158d2a9ac9ca h1:cvifSiZr9VifpKjgVtGaEqknz2MwpY4shQhoOLpgQUE= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20240930060710-158d2a9ac9ca/go.mod h1:hxKOwuo3HBC9a5hoNOvstl2wVF6Z9kZDssHU5VCdqk8= +github.com/smartcontractkit/chainlink-common v0.2.3-0.20240927162447-20630b333f57 h1:pRiTiFOkPEyvgG0hchcCSZzwUbwYydnZBu0QbVaRnVk= +github.com/smartcontractkit/chainlink-common v0.2.3-0.20240927162447-20630b333f57/go.mod h1:F6WUS6N4mP5ScwpwyTyAJc9/vjR+GXbMCRUOVekQi1g= +github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20240911175228-daf2600bb7b7 h1:lTGIOQYLk1Ufn++X/AvZnt6VOcuhste5yp+C157No/Q= +github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20240911175228-daf2600bb7b7/go.mod h1:BMYE1vC/pGmdFSsOJdPrAA0/4gZ0Xo0SxTMdGspBtRo= +github.com/smartcontractkit/chainlink-data-streams v0.0.0-20240916152957-433914114bd2 h1:yRk4ektpx/UxwarqAfgxUXLrsYXlaNeP1NOwzHGrK2Q= +github.com/smartcontractkit/chainlink-data-streams v0.0.0-20240916152957-433914114bd2/go.mod h1:rNhNSrrRMvkgAm5SA6bNTdh2340bTQQZdUVNtZ2o2bk= +github.com/smartcontractkit/chainlink-feeds v0.0.0-20240910155501-42f20443189f h1:p4p3jBT91EQyLuAMvHD+zNJsuAYI/QjJbzuGUJ7wIgg= +github.com/smartcontractkit/chainlink-feeds v0.0.0-20240910155501-42f20443189f/go.mod h1:FLlWBt2hwiMVgt9AcSo6wBJYIRd/nsc8ENbV1Wir1bw= +github.com/smartcontractkit/chainlink-solana v1.1.1-0.20240927143737-7e527aa85bff h1:piMugtrRlbVdcC6xZF37me686eS1YwpLQ0kN2v2b9YE= +github.com/smartcontractkit/chainlink-solana v1.1.1-0.20240927143737-7e527aa85bff/go.mod h1:5jD47oCERRQ4eGi0iNdk9ZV5HMEdolfQwHpUX1+Ix4s= +github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240911194142-506bc469d8ae h1:d+B8y2Nd/PrnPMNoaSPn3eDgUgxcVcIqAxGrvYu/gGw= +github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240911194142-506bc469d8ae/go.mod h1:ec/a20UZ7YRK4oxJcnTBFzp1+DBcJcwqEaerUMsktMs= +github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7 h1:12ijqMM9tvYVEm+nR826WsrNi6zCKpwBhuApq127wHs= +github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7/go.mod h1:FX7/bVdoep147QQhsOPkYsPEXhGZjeYx6lBSaSXtZOA= +github.com/smartcontractkit/libocr v0.0.0-20240717100443-f6226e09bee7 h1:e38V5FYE7DA1JfKXeD5Buo/7lczALuVXlJ8YNTAUxcw= +github.com/smartcontractkit/libocr v0.0.0-20240717100443-f6226e09bee7/go.mod h1:fb1ZDVXACvu4frX3APHZaEBp0xi1DIm34DcA0CwTsZM= github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin v0.0.0-20230906073235-9e478e5e19f1 h1:yiKnypAqP8l0OX0P3klzZ7SCcBUxy5KqTAKZmQOvSQE= github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin v0.0.0-20230906073235-9e478e5e19f1/go.mod h1:q6f4fe39oZPdsh1i57WznEZgxd8siidMaSFq3wdPmVg= github.com/smartcontractkit/tdh2/go/tdh2 v0.0.0-20230906073235-9e478e5e19f1 h1:Dai1bn+Q5cpeGMQwRdjOdVjG8mmFFROVkSKuUgBErRQ= github.com/smartcontractkit/tdh2/go/tdh2 v0.0.0-20230906073235-9e478e5e19f1/go.mod h1:G5Sd/yzHWf26rQ+X0nG9E0buKPqRGPMJAfk2gwCzOOw= -github.com/smartcontractkit/wsrpc v0.7.3 h1:CKYZfawZShZGfvsQep1F9oBansnFk9ByZPCdTMpLphw= -github.com/smartcontractkit/wsrpc v0.7.3/go.mod h1:sj7QX2NQibhkhxTfs3KOhAj/5xwgqMipTvJVSssT9i0= +github.com/smartcontractkit/wsrpc v0.8.2 h1:XB/xcn/MMseHW+8JE8+a/rceA86ck7Ur6cEa9LiUC8M= +github.com/smartcontractkit/wsrpc v0.8.2/go.mod h1:2u/wfnhl5R4RlSXseN4n6HHIWk8w1Am3AT6gWftQbNg= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= +github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo= +github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= -github.com/spf13/afero v1.9.5 h1:stMpOSZFs//0Lv29HduCmli3GUfpFoF3Y1Q/aXj/wVM= -github.com/spf13/afero v1.9.5/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ= +github.com/spf13/afero v1.11.0 h1:WJQKhtpdm3v2IzqG8VMqrr6Rf3UYpEF239Jy9wNepM8= +github.com/spf13/afero v1.11.0/go.mod h1:GH9Y3pIexgf1MTIWtNGyogA5MwRIDXGUr+hbWNoBjkY= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cast v1.6.0 h1:GEiTHELF+vaR5dhz3VqZfFSzZjYbgeKDpBxQVS4GYJ0= github.com/spf13/cast v1.6.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= github.com/spf13/cobra v1.1.1/go.mod h1:WnodtKOvamDL/PwE2M4iKs8aMDBZ5Q5klgD3qfVJQMI= -github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0= -github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho= +github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM= +github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= -github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= -github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= github.com/spf13/viper v1.7.1/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= -github.com/spf13/viper v1.15.0 h1:js3yy885G8xwJa6iOISGFwd+qlUo5AvyXb7CiihdtiU= -github.com/spf13/viper v1.15.0/go.mod h1:fFcTBJxvhhzSJiZy8n+PeW6t8l+KeT/uTARa0jHOQLA= +github.com/spf13/viper v1.18.2 h1:LUXCnvUvSM6FXAsj6nnfc8Q2tp1dIgUfY9Kc8GsSOiQ= +github.com/spf13/viper v1.18.2/go.mod h1:EKmWIqdnk5lOcmR72yw6hS+8OPYcwD0jteitLMVB+yk= github.com/status-im/keycard-go v0.2.0 h1:QDLFswOQu1r5jsycloeQh3bVU8n/NatHHaZobtDnDzA= github.com/status-im/keycard-go v0.2.0/go.mod h1:wlp8ZLbsmrF6g6WjugPAx+IzoLrkdf9+mHxBEeo3Hbg= github.com/streamingfast/logging v0.0.0-20220405224725-2755dab2ce75 h1:ZqpS7rAhhKD7S7DnrpEdrnW1/gZcv82ytpMviovkli4= @@ -1204,13 +1115,12 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= -github.com/subosito/gotenv v1.4.2 h1:X1TuBLAMDFbaTAChgCBLu3DU3UPyELpnF2jjJ2cz/S8= -github.com/subosito/gotenv v1.4.2/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= +github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= +github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= github.com/supranational/blst v0.3.11 h1:LyU6FolezeWAhvQk0k6O/d49jqgO52MSDDfYgbeoEm4= github.com/supranational/blst v0.3.11/go.mod h1:jZJtfjgudtNl4en1tzwPIV3KjUnQUvG3/j+w+fVonLw= github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d h1:vfofYNRScrDdvS342BElfbETmL1Aiz3i2t0zfRj16Hs= @@ -1247,10 +1157,8 @@ github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2 github.com/tyler-smith/go-bip39 v1.1.0 h1:5eUemwrMargf3BSLRRCalXT93Ns6pQJIjYQN2nyfOP8= github.com/tyler-smith/go-bip39 v1.1.0/go.mod h1:gUYDtqQw1JS3ZJ8UWVcGTGqqr6YIN3CWg+kkNaLt55U= github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= -github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= github.com/ugorji/go v1.2.7/go.mod h1:nF9osbDWLy6bDVv/Rtoh6QgnvNDpmCalQV5urGCCS6M= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= -github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= github.com/ugorji/go/codec v1.2.7/go.mod h1:WGN1fab3R1fzQlVQTkfxVtIBhWDRqOviHU95kRgeqEY= github.com/ugorji/go/codec v1.2.12 h1:9LC83zGrHhuUA9l16C9AHXAqEV/2wBQ4nkvumAE65EE= github.com/ugorji/go/codec v1.2.12/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= @@ -1268,14 +1176,10 @@ github.com/urfave/cli v1.22.14 h1:ebbhrRiGK2i4naQJr+1Xj92HXZCrK7MsyTS/ob3HnAk= github.com/urfave/cli v1.22.14/go.mod h1:X0eDS6pD6Exaclxm99NJ3FiCDRED7vIHpx2mDOHLvkA= github.com/urfave/cli/v2 v2.25.7 h1:VAzn5oq403l5pHjc4OhD54+XGO9cdKVL/7lDjF+iKUs= github.com/urfave/cli/v2 v2.25.7/go.mod h1:8qnjx1vcq5s2/wpsqoZFndg2CE5tNFyrTvS6SinrnYQ= -github.com/urfave/negroni v1.0.0/go.mod h1:Meg73S6kFm/4PpbYdq35yYWoCZ9mS/YSx+lKnmiohz4= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= -github.com/valyala/fasthttp v1.6.0/go.mod h1:FstJa9V+Pj9vQ7OJie2qMHdwemEDaDiSdBnvPM1Su9w= github.com/valyala/fastjson v1.4.1 h1:hrltpHpIpkaxll8QltMU8c3QZ5+qIiCL8yKqPFJI/yE= github.com/valyala/fastjson v1.4.1/go.mod h1:nV6MsjxL2IMJQUoHDIrjEI7oLyeqK6aBD7EFWPsvP8o= github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= -github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= -github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a/go.mod h1:v3UYOV9WzVtRmSR+PDvWpU/qWl4Wa5LApYYX4ZtKbio= github.com/wk8/go-ordered-map/v2 v2.1.8 h1:5h/BUHu93oj4gIdvHHHGsScSTMijfx5PeYkE/fJgbpc= github.com/wk8/go-ordered-map/v2 v2.1.8/go.mod h1:5nJHM5DyteebpVlHnWMV0rPz6Zp7+xBAnxjb1X5vnTw= github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= @@ -1283,31 +1187,23 @@ github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcY github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI= github.com/xdg-go/scram v1.1.1/go.mod h1:RaEWvsqvNKKvBPvcKeFjrG2cJqOkHTiyTpzz23ni57g= github.com/xdg-go/stringprep v1.0.3/go.mod h1:W3f5j4i+9rC0kuIEJL0ky1VpHXQU3ocBgklLGvcBnW8= -github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= -github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= -github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU= github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8= -github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0/go.mod h1:/LWChgwKmvncFJFHJ7Gvn9wZArjbV5/FppcK2fKk/tI= github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7JulP+udvsHwJoVG1YGAP6VLg4y9I5dyZdqmA= -github.com/yudai/gojsondiff v1.0.0/go.mod h1:AY32+k2cwILAkW1fbgxQ5mUmMiZFgLIV+FBNExI05xg= -github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82/go.mod h1:lgjkn3NuSvDfVJdfcVVdX+jpBxNmX4rDAzaS45IcYoM= -github.com/yudai/pp v2.0.1+incompatible/go.mod h1:PuxR/8QJ7cyCkFp/aUDS+JY727OFEZkTdatxwunjIkc= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0= github.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q= -github.com/zondax/hid v0.9.1 h1:gQe66rtmyZ8VeGFcOpbuH3r7erYtNEAezCAYu8LdkJo= -github.com/zondax/hid v0.9.1/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= -github.com/zondax/ledger-go v0.14.1 h1:Pip65OOl4iJ84WTpA4BKChvOufMhhbxED3BaihoZN4c= -github.com/zondax/ledger-go v0.14.1/go.mod h1:fZ3Dqg6qcdXWSOJFKMG8GCTnD7slO/RL2feOQv8K320= +github.com/zondax/hid v0.9.2 h1:WCJFnEDMiqGF64nlZz28E9qLVZ0KSJ7xpc5DLEyma2U= +github.com/zondax/hid v0.9.2/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= +github.com/zondax/ledger-go v0.14.3 h1:wEpJt2CEcBJ428md/5MgSLsXLBos98sBOyxNmCjfUCw= +github.com/zondax/ledger-go v0.14.3/go.mod h1:IKKaoxupuB43g4NxeQmbLXv7T9AlQyie1UpHb342ycI= go.dedis.ch/fixbuf v1.0.3 h1:hGcV9Cd/znUxlusJ64eAlExS+5cJDIyTyEG+otu5wQs= go.dedis.ch/fixbuf v1.0.3/go.mod h1:yzJMt34Wa5xD37V5RTdmp38cz3QhMagdGoem9anUalw= go.dedis.ch/kyber/v3 v3.0.4/go.mod h1:OzvaEnPvKlyrWyp3kGXlFdp7ap1VC6RkZDTaPikqhsQ= @@ -1335,28 +1231,44 @@ go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= go.opentelemetry.io/contrib/instrumentation/github.com/gin-gonic/gin/otelgin v0.49.0 h1:1f31+6grJmV3X4lxcEvUy13i5/kfDw1nJZwhd8mA4tg= go.opentelemetry.io/contrib/instrumentation/github.com/gin-gonic/gin/otelgin v0.49.0/go.mod h1:1P/02zM3OwkX9uki+Wmxw3a5GVb6KUXRsa7m7bOC9Fg= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.52.0 h1:vS1Ao/R55RNV4O7TA2Qopok8yN+X0LIP6RVWLFkprck= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.52.0/go.mod h1:BMsdeOxN04K0L5FNUBfjFdvwWGNe/rkmSwH4Aelu/X0= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 h1:jq9TW8u3so/bN+JPT166wjOI6/vQPF6Xe7nMNIltagk= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0/go.mod h1:p8pYQP+m5XfbZm9fxtSKAbM6oIllS7s2AfxrChvc7iw= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.53.0 h1:9G6E0TXzGFVfTnawRzrPl83iHOAV7L8NJiR8RSGYV1g= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.53.0/go.mod h1:azvtTADFQJA8mX80jIH/akaE7h+dbm/sVuaHqN13w74= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.53.0 h1:4K4tsIXefpVJtvA/8srF4V4y0akAoPHkIslgAkjixJA= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.53.0/go.mod h1:jjdQuTGVsXV4vSs+CJ2qYDeDPf9yIJV23qlIzBm73Vg= go.opentelemetry.io/contrib/propagators/b3 v1.24.0 h1:n4xwCdTx3pZqZs2CjS/CUZAs03y3dZcGhC/FepKtEUY= go.opentelemetry.io/contrib/propagators/b3 v1.24.0/go.mod h1:k5wRxKRU2uXx2F8uNJ4TaonuEO/V7/5xoz7kdsDACT8= -go.opentelemetry.io/otel v1.27.0 h1:9BZoF3yMK/O1AafMiQTVu0YDj5Ea4hPhxCs7sGva+cg= -go.opentelemetry.io/otel v1.27.0/go.mod h1:DMpAK8fzYRzs+bi3rS5REupisuqTheUlSZJ1WnZaPAQ= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.27.0 h1:R9DE4kQ4k+YtfLI2ULwX82VtNQ2J8yZmA7ZIF/D+7Mc= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.27.0/go.mod h1:OQFyQVrDlbe+R7xrEyDr/2Wr67Ol0hRUgsfA+V5A95s= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.27.0 h1:qFffATk0X+HD+f1Z8lswGiOQYKHRlzfmdJm0wEaVrFA= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.27.0/go.mod h1:MOiCmryaYtc+V0Ei+Tx9o5S1ZjA7kzLucuVuyzBZloQ= -go.opentelemetry.io/otel/metric v1.27.0 h1:hvj3vdEKyeCi4YaYfNjv2NUje8FqKqUY8IlF0FxV/ik= -go.opentelemetry.io/otel/metric v1.27.0/go.mod h1:mVFgmRlhljgBiuk/MP/oKylr4hs85GZAylncepAX/ak= -go.opentelemetry.io/otel/sdk v1.27.0 h1:mlk+/Y1gLPLn84U4tI8d3GNJmGT/eXe3ZuOXN9kTWmI= -go.opentelemetry.io/otel/sdk v1.27.0/go.mod h1:Ha9vbLwJE6W86YstIywK2xFfPjbWlCuwPtMkKdz/Y4A= -go.opentelemetry.io/otel/sdk/metric v1.21.0 h1:smhI5oD714d6jHE6Tie36fPx4WDFIg+Y6RfAY4ICcR0= -go.opentelemetry.io/otel/sdk/metric v1.21.0/go.mod h1:FJ8RAsoPGv/wYMgBdUJXOm+6pzFY3YdljnXtv1SBE8Q= -go.opentelemetry.io/otel/trace v1.27.0 h1:IqYb813p7cmbHk0a5y6pD5JPakbVfftRXABGt5/Rscw= -go.opentelemetry.io/otel/trace v1.27.0/go.mod h1:6RiD1hkAprV4/q+yd2ln1HG9GoPx39SuvvstaLBl+l4= -go.opentelemetry.io/proto/otlp v1.2.0 h1:pVeZGk7nXDC9O2hncA6nHldxEjm6LByfA2aN8IOkz94= -go.opentelemetry.io/proto/otlp v1.2.0/go.mod h1:gGpR8txAl5M03pDhMC79G6SdqNV26naRm/KDsgaHD8A= +go.opentelemetry.io/otel v1.6.3/go.mod h1:7BgNga5fNlF/iZjG06hM3yofffp0ofKCDwSXx1GC4dI= +go.opentelemetry.io/otel v1.28.0 h1:/SqNcYk+idO0CxKEUOtKQClMK/MimZihKYMruSMViUo= +go.opentelemetry.io/otel v1.28.0/go.mod h1:q68ijF8Fc8CnMHKyzqL6akLO46ePnjkgfIMIjUIX9z4= +go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.0.0-20240823153156-2a54df7bffb9 h1:UiRNKd1OgqsLbFwE+wkAWTdiAxXtCBqKIHeBIse4FUA= +go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.0.0-20240823153156-2a54df7bffb9/go.mod h1:eqZlW3pJWhjyexnDPrdQxix1pn0wwhI4AO4GKpP/bMI= +go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.28.0 h1:U2guen0GhqH8o/G2un8f/aG/y++OuW6MyCo6hT9prXk= +go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.28.0/go.mod h1:yeGZANgEcpdx/WK0IvvRFC+2oLiMS2u4L/0Rj2M2Qr0= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.28.0 h1:3Q/xZUyC1BBkualc9ROb4G8qkH90LXEIICcs5zv1OYY= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.28.0/go.mod h1:s75jGIWA9OfCMzF0xr+ZgfrB5FEbbV7UuYo32ahUiFI= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.28.0 h1:R3X6ZXmNPRR8ul6i3WgFURCHzaXjHdm0karRG/+dj3s= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.28.0/go.mod h1:QWFXnDavXWwMx2EEcZsf3yxgEKAqsxQ+Syjp+seyInw= +go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.4.0 h1:0MH3f8lZrflbUWXVxyBg/zviDFdGE062uKh5+fu8Vv0= +go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.4.0/go.mod h1:Vh68vYiHY5mPdekTr0ox0sALsqjoVy0w3Os278yX5SQ= +go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.28.0 h1:BJee2iLkfRfl9lc7aFmBwkWxY/RI1RDdXepSF6y8TPE= +go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.28.0/go.mod h1:DIzlHs3DRscCIBU3Y9YSzPfScwnYnzfnCd4g8zA7bZc= +go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.28.0 h1:EVSnY9JbEEW92bEkIYOVMw4q1WJxIAGoFTrtYOzWuRQ= +go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.28.0/go.mod h1:Ea1N1QQryNXpCD0I1fdLibBAIpQuBkznMmkdKrapk1Y= +go.opentelemetry.io/otel/log v0.4.0 h1:/vZ+3Utqh18e8TPjuc3ecg284078KWrR8BRz+PQAj3o= +go.opentelemetry.io/otel/log v0.4.0/go.mod h1:DhGnQvky7pHy82MIRV43iXh3FlKN8UUKftn0KbLOq6I= +go.opentelemetry.io/otel/metric v1.28.0 h1:f0HGvSl1KRAU1DLgLGFjrwVyismPlnuU6JD6bOeuA5Q= +go.opentelemetry.io/otel/metric v1.28.0/go.mod h1:Fb1eVBFZmLVTMb6PPohq3TO9IIhUisDsbJoL/+uQW4s= +go.opentelemetry.io/otel/sdk v1.28.0 h1:b9d7hIry8yZsgtbmM0DKyPWMMUMlK9NEKuIG4aBqWyE= +go.opentelemetry.io/otel/sdk v1.28.0/go.mod h1:oYj7ClPUA7Iw3m+r7GeEjz0qckQRJK2B8zjcZEfu7Pg= +go.opentelemetry.io/otel/sdk/log v0.4.0 h1:1mMI22L82zLqf6KtkjrRy5BbagOTWdJsqMY/HSqILAA= +go.opentelemetry.io/otel/sdk/log v0.4.0/go.mod h1:AYJ9FVF0hNOgAVzUG/ybg/QttnXhUePWAupmCqtdESo= +go.opentelemetry.io/otel/sdk/metric v1.28.0 h1:OkuaKgKrgAbYrrY0t92c+cC+2F6hsFNnCQArXCKlg08= +go.opentelemetry.io/otel/sdk/metric v1.28.0/go.mod h1:cWPjykihLAPvXKi4iZc1dpER3Jdq2Z0YLse3moQUCpg= +go.opentelemetry.io/otel/trace v1.6.3/go.mod h1:GNJQusJlUgZl9/TQBPKU/Y/ty+0iVB5fjhKeJGZPGFs= +go.opentelemetry.io/otel/trace v1.28.0 h1:GhQ9cUuQGmNDd5BTCP2dAvv75RdMxEfTmYejp+lkx9g= +go.opentelemetry.io/otel/trace v1.28.0/go.mod h1:jPyXzNPg6da9+38HEwElrQiHlVMTnVfM3/yv2OlIHaI= +go.opentelemetry.io/proto/otlp v1.3.1 h1:TrMUixzpM0yuc/znrFTP9MMRh8trP93mkCiDVeXrui0= +go.opentelemetry.io/proto/otlp v1.3.1/go.mod h1:0X1WI4de4ZsLrrJNLAQbFeLCm3T7yBkR0XqQ7niQU+8= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= @@ -1383,12 +1295,11 @@ go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= go.uber.org/zap v1.14.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= go.uber.org/zap v1.16.0/go.mod h1:MA8QOfq0BHJwdXa996Y4dYkAqRKB8/1K1QMMZVaNZjQ= go.uber.org/zap v1.21.0/go.mod h1:wjWOCqI0f2ZZrJF/UufIOkiC8ii6tm1iqIsLo76RfJw= -go.uber.org/zap v1.24.0/go.mod h1:2kMP+WWQ8aoFoedH3T2sq6iJ2yDWpHbP0f6MQbS9Gkg= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= +go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= -golang.org/x/arch v0.7.0 h1:pskyeJh/3AmoQ8CPE95vxHLqp1G1GfGNXTmcl9NEKTc= -golang.org/x/arch v0.7.0/go.mod h1:FEVrYAQjsQXMVJ1nsMoVVXPZg6p2JE2mx8psSWTDQys= +golang.org/x/arch v0.8.0 h1:3wRIsP3pM4yUptoR96otTUOXI367OS0+c9eeRi9doIc= +golang.org/x/arch v0.8.0/go.mod h1:FEVrYAQjsQXMVJ1nsMoVVXPZg6p2JE2mx8psSWTDQys= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= @@ -1397,27 +1308,22 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk golang.org/x/crypto v0.0.0-20190411191339-88737f569e3a/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20191227163750-53104e6ec876/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201203163018-be400aefbc4c/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= -golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= -golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220214200702-86341886e292/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc= -golang.org/x/crypto v0.24.0 h1:mnl8DM0o513X8fdIkmyFE/5hTYxbwYOjDS/+rK6qpRI= -golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM= +golang.org/x/crypto v0.27.0 h1:GXm2NjJrPaiv/h1tb2UH8QfgC/hOf/+z0p6PT8o1w7A= +golang.org/x/crypto v0.27.0/go.mod h1:1Xngt8kV6Dvbssa53Ziq6Eqn0HqbZi5Z6R0ZpwQzt70= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -1428,8 +1334,8 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20240325151524-a685a6edb6d8 h1:aAcj0Da7eBAtrTp03QXWvm88pSyOt+UgdZw2BFZ+lEw= -golang.org/x/exp v0.0.0-20240325151524-a685a6edb6d8/go.mod h1:CQ1k9gNrJ50XIzaKCRR2hssIjF07kZFEiieALBM/ARQ= +golang.org/x/exp v0.0.0-20240909161429-701f63a606c0 h1:e66Fs6Z+fZTbFBAxKfP3PALWBtpfqks2bwGcexMxgtk= +golang.org/x/exp v0.0.0-20240909161429-701f63a606c0/go.mod h1:2TbTHSBQa924w8M6Xs1QcRcFwyucIwBGpK1p2f1YFFY= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -1443,7 +1349,6 @@ golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRu golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= @@ -1452,13 +1357,11 @@ golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzB golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA= -golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.21.0 h1:vvrHzRwRfVKSiLrG+d4FMl/Qi4ukBCE6kZlTUkDYRT0= +golang.org/x/mod v0.21.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1469,44 +1372,30 @@ golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73r golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190327091125-710a502c58a2/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= golang.org/x/net v0.0.0-20210331212208-0fccb6fa2b5c/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= -golang.org/x/net v0.0.0-20211008194852-3b03d305991f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= @@ -1514,19 +1403,15 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= -golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac= -golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= +golang.org/x/net v0.29.0 h1:5ORfpBpCs4HzDYoodCDBbwHzdR5UrLBZ3sOnUJmFoHo= +golang.org/x/net v0.29.0/go.mod h1:gLkgy8jTGERgjzMic6DS9+SP0ajcu6Xu3Orq/SpETg0= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.20.0 h1:4mQdhULixXKP1rwYBW0vAijoXnkTG0BLCDRzfe1idMo= -golang.org/x/oauth2 v0.20.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= +golang.org/x/oauth2 v0.22.0 h1:BzDx2FehcG7jJwgWLELCdmLuxk2i+x9UDpSiss2u0ZA= +golang.org/x/oauth2 v0.22.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1534,14 +1419,12 @@ golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= -golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1579,45 +1462,30 @@ golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210331175145-43e1dd70ce54/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210819135213-f52c844e1c1c/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-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -1626,8 +1494,8 @@ golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= -golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34= +golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= 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-20201210144234-2321bbc49cbf/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= @@ -1636,8 +1504,8 @@ golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU= -golang.org/x/term v0.21.0 h1:WVXCp+/EBEHOj53Rvu+7KiT/iElMrO8ACK16SMZ3jaA= -golang.org/x/term v0.21.0/go.mod h1:ooXLefLobQVslOqselCNF4SxFAaoS6KujMbsGzSDmX0= +golang.org/x/term v0.24.0 h1:Mh5cbb+Zk2hqqXNO7S1iTjEphVL+jb8ZWaqh/g+JWkM= +golang.org/x/term v0.24.0/go.mod h1:lOBK/LVxemqiMij05LGJ0tzNr8xlmwBRJ81PX6wVLH8= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1651,22 +1519,19 @@ golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= -golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= -golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= +golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224= +golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20201208040808-7e3f01d25324/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= -golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= +golang.org/x/time v0.6.0 h1:eTDhh4ZXt5Qf0augr54TN6suAUudPcawVZeIAPU7D4U= +golang.org/x/time v0.6.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181221001348-537d06c36207/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190327201419-c70d86f8b7cf/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190425163242-31fd60d6bfdc/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= @@ -1699,33 +1564,16 @@ golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapK golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= -golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= -golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= -golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg= -golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= +golang.org/x/tools v0.25.0 h1:oFU9pkj/iJgs+0DT+VMHrx+oBKs/LJMV+Uvg78sl+fE= +golang.org/x/tools v0.25.0/go.mod h1:/vtpO8WL1N9cQC3FN5zPqb//fRXskFHbLKk4OW1Q7rg= golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -1733,8 +1581,8 @@ golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= -gonum.org/v1/gonum v0.14.0 h1:2NiG67LD1tEH0D7kM+ps2V+fXmsAnpUeec7n8tcr4S0= -gonum.org/v1/gonum v0.14.0/go.mod h1:AoWeoz0becf9QMWtE8iWXNXc27fK4fNeHNf/oMejGfU= +gonum.org/v1/gonum v0.15.0 h1:2lYxjRbTYyxkJxlhC+LvJIx3SsANPdRybu1tGj9/OrQ= +gonum.org/v1/gonum v0.15.0/go.mod h1:xzZVBJBtS+Mz4q0Yl2LJTk+OxOg4jiXZ7qBoM0uISGo= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= @@ -1745,27 +1593,16 @@ google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsb google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= -google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= -google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= -google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= -google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= -google.golang.org/api v0.169.0 h1:QwWPy71FgMWqJN/l6jVlFHUa29a7dcUy02I8o799nPY= -google.golang.org/api v0.169.0/go.mod h1:gpNOiMA2tZ4mf5R9Iwf4rK/Dcz0fbdIgWYWVoxmsyLg= +google.golang.org/api v0.188.0 h1:51y8fJ/b1AaaBRJr4yWm96fPcuxSo0JcegXE3DaHQHw= +google.golang.org/api v0.188.0/go.mod h1:VR0d+2SIiWOYG3r/jdm7adPW9hI2aRv9ETOSCQ9Beag= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= google.golang.org/appengine v1.6.2/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/genproto v0.0.0-20180518175338-11a468237815/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= @@ -1785,37 +1622,18 @@ google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvx google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200324203455-a04cca1dde73/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= -google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210401141331-865547bb08e2/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= -google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= -google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 h1:9+tzLLstTlPTRyJTh+ah5wIMsBW5c4tQwGTN3thOW9Y= -google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9/go.mod h1:mqHbVIp48Muh7Ywss/AD6I5kNVKZMmAa/QEW58Gxp2s= -google.golang.org/genproto/googleapis/api v0.0.0-20240520151616-dc85e6b867a5 h1:P8OJ/WCl/Xo4E4zoe4/bifHpSmmKwARqyqE4nW6J2GQ= -google.golang.org/genproto/googleapis/api v0.0.0-20240520151616-dc85e6b867a5/go.mod h1:RGnPtTG7r4i8sPlNyDeikXF99hMM+hN6QMm4ooG9g2g= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240520151616-dc85e6b867a5 h1:Q2RxlXqh1cgzzUgV261vBO2jI5R/3DD1J2pM0nI4NhU= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240520151616-dc85e6b867a5/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0= -google.golang.org/grpc v1.12.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= +google.golang.org/genproto v0.0.0-20240711142825-46eb208f015d h1:/hmn0Ku5kWij/kjGsrcJeC1T/MrJi2iNWwgAqrihFwc= +google.golang.org/genproto v0.0.0-20240711142825-46eb208f015d/go.mod h1:FfBgJBJg9GcpPvKIuHSZ/aE1g2ecGL74upMzGZjiGEY= +google.golang.org/genproto/googleapis/api v0.0.0-20240822170219-fc7c04adadcd h1:BBOTEWLuuEGQy9n1y9MhVJ9Qt0BDu21X8qZs71/uPZo= +google.golang.org/genproto/googleapis/api v0.0.0-20240822170219-fc7c04adadcd/go.mod h1:fO8wJzT2zbQbAjbIoos1285VfEIYKDDY+Dt+WpTkh6g= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd h1:6TEm2ZxXoQmFWFlt1vNxvVOa1Q0dXFQD1m/rYjXmS0E= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= @@ -1828,17 +1646,11 @@ google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8 google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= -google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= -google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= -google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.64.0 h1:KH3VH9y/MgNQg1dE7b3XfVK0GsPSIzJwdF617gUSbvY= -google.golang.org/grpc v1.64.0/go.mod h1:oxjF8E3FBnjp+/gVFYdWacaLDx9na1aqy9oovLpxQYg= +google.golang.org/grpc v1.65.0 h1:bs/cUb4lp1G5iImFFd3u5ixQzweKizoZJAwBNLR42lc= +google.golang.org/grpc v1.65.0/go.mod h1:WgYC2ypjlB0EiQi6wdKixMqukr6lBc0Vo+oOgjrM5ZQ= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -1847,13 +1659,12 @@ google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzi google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= 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/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= -google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -1871,10 +1682,8 @@ gopkg.in/guregu/null.v4 v4.0.0 h1:1Wm3S1WEA2I26Kq+6vcW+w0gcDo44YKYD7YIEJNHDjg= gopkg.in/guregu/null.v4 v4.0.0/go.mod h1:YoQhUrADuG3i9WqesrCmpNRwm1ypAgSHYqoOcTu/JrI= gopkg.in/inconshreveable/log15.v2 v2.0.0-20180818164646-67afb5ed74ec/go.mod h1:aPpfJ7XW+gOuirDoZ8gHhLh3kZ1B08FtV2bbmy7Jv3s= gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/ini.v1 v1.51.1/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/mgo.v2 v2.0.0-20180705113604-9856a29383ce/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA= gopkg.in/natefinch/lumberjack.v2 v2.2.1 h1:bBRl1b0OH9s/DuPhuXpNl+VtCaJXFZ5/uEFST95x9zc= gopkg.in/natefinch/lumberjack.v2 v2.2.1/go.mod h1:YD8tP3GAjkrDg1eZH7EGmyESg/lsYskCTPBJVb9jqSc= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= @@ -1890,22 +1699,22 @@ gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= -gopkg.in/yaml.v3 v3.0.0-20191120175047-4206685974f2/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= -gotest.tools/v3 v3.5.0 h1:Ljk6PdHdOhAb5aDMWXjDLMMhph+BpztA4v1QdqEW2eY= -gotest.tools/v3 v3.5.0/go.mod h1:isy3WKz7GK6uNw/sbHzfKBLvlvXwUyV06n6brMxxopU= +gotest.tools/v3 v3.5.1 h1:EENdUnS3pdur5nybKYIh2Vfgc8IUNBjxDPSjtiJcOzU= +gotest.tools/v3 v3.5.1/go.mod h1:isy3WKz7GK6uNw/sbHzfKBLvlvXwUyV06n6brMxxopU= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.1.3/go.mod h1:NgwopIslSNH47DimFoV78dnkksY2EFtX0ajyb3K/las= +k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 h1:pUdcCO1Lk/tbT5ztQWOBi5HBgbBP1J8+AsQnQCKsi8A= +k8s.io/utils v0.0.0-20240711033017-18e509b52bc8/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= modernc.org/gc/v3 v3.0.0-20240107210532-573471604cb6 h1:5D53IMaUuA5InSeMu9eJtlQXS2NxAhyWQvkKEgXZhHI= modernc.org/gc/v3 v3.0.0-20240107210532-573471604cb6/go.mod h1:Qz0X07sNOR1jWYCrJMEnbW/X55x206Q7Vt4mz6/wHp4= modernc.org/libc v1.41.0 h1:g9YAc6BkKlgORsUWj+JwqoB1wU3o4DE3bM3yvA3k+Gk= @@ -1923,8 +1732,8 @@ modernc.org/token v1.1.0/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM= nhooyr.io/websocket v1.8.10 h1:mv4p+MnGrLDcPlBoWsvPP7XCzTYMXP9F9eIGoKbgx7Q= nhooyr.io/websocket v1.8.10/go.mod h1:rN9OFWIUwuxg4fR5tELlYC04bXYowCP9GX47ivo2l+c= nullprogram.com/x/optparse v1.0.0/go.mod h1:KdyPE+Igbe0jQUrVfMqDMeJQIJZEuyV7pjYmp6pbG50= -pgregory.net/rapid v0.5.5 h1:jkgx1TjbQPD/feRoK+S/mXw9e1uj6WilpHrXJowi6oA= -pgregory.net/rapid v0.5.5/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= +pgregory.net/rapid v1.1.0 h1:CMa0sjHSru3puNx+J0MIAuiiEV4N0qj8/cMWGBBCsjw= +pgregory.net/rapid v1.1.0/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= diff --git a/heroku.yml b/heroku.yml deleted file mode 100644 index bb95afa1213..00000000000 --- a/heroku.yml +++ /dev/null @@ -1,6 +0,0 @@ -build: - docker: - web: Dockerfile.web - config: - REACT_APP_INFURA_KEY: - REACT_APP_GA_ID: diff --git a/integration-tests/.golangci.yml b/integration-tests/.golangci.yml index 897c72d1ecb..304249d24cc 100644 --- a/integration-tests/.golangci.yml +++ b/integration-tests/.golangci.yml @@ -46,7 +46,7 @@ linters-settings: - name: errorf - name: empty-block - name: superfluous-else - - name: unused-parameter + #- name: unused-parameter - name: unreachable-code - name: redefines-builtin-id - name: waitgroup-by-value @@ -70,6 +70,9 @@ linters-settings: - name: atomic issues: exclude-rules: + - path: deployment/memory/(.+)\.go + linters: + - revive - text: "^G404: Use of weak random number generator" linters: - gosec diff --git a/integration-tests/.tool-versions b/integration-tests/.tool-versions index 7b9e8ab6bf4..7ca4249a799 100644 --- a/integration-tests/.tool-versions +++ b/integration-tests/.tool-versions @@ -1,5 +1,6 @@ -golang 1.21.7 +golang 1.22.5 k3d 5.4.6 kubectl 1.25.5 nodejs 20.13.1 golangci-lint 1.59.1 +task 3.35.1 diff --git a/integration-tests/README.md b/integration-tests/README.md index fcfefe97a73..5647a62316e 100644 --- a/integration-tests/README.md +++ b/integration-tests/README.md @@ -27,6 +27,8 @@ version = "your tag" The `./testconfig/overrides.toml` file **should never be committed** and has been added to the [.gitignore](../.gitignore) file as it can often contain secrets like private keys and RPC URLs. +For more information on how to configure the tests, see the [testconfig README](./testconfig/README.md). + ## Build If you'd like to run the tests on a local build of Chainlink, you can point to your own docker image, or build a fresh one with `make`. @@ -51,7 +53,7 @@ It's generally recommended to run only one test at a time on a local machine as ### Configure Seth -Our new evm client is Seth. Detailed instructions on how to configure it can be found in the [Seth README](./README_SETH.md) in this repo as well as in [Seth repository](https://github.com/smartcontractkit/seth). +Our new evm client is Seth. Detailed instructions on how to configure it can be found in the [Seth README](./README_SETH.md) in this repo as well as in [Seth repository](https://github.com/smartcontractkit/chainlink-testing-framework/tree/main/seth). ## Analyze @@ -76,8 +78,7 @@ make test_soak_ocr_reorg_2 Run reorg/automation_reorg_test.go with reorg settings: -1. Use Simulated Geth network and put GethReorgConfig in overrides.toml - +1. Use Simulated Geth network and put GethReorgConfig in overrides.toml ```toml [Network] @@ -128,3 +129,9 @@ Run soak/ocr_test.go with RPC network chaos by bringing down network to RPC node ```bash make test_soak_ocr_rpc_down_half_cl_nodes ``` + +### Debugging HTTP and RPC clients +```bash +export SETH_LOG_LEVEL=debug +export RESTY_DEBUG=true +``` diff --git a/integration-tests/README_SETH.md b/integration-tests/README_SETH.md index 92302ab9ce7..26fbfc1a79f 100644 --- a/integration-tests/README_SETH.md +++ b/integration-tests/README_SETH.md @@ -41,7 +41,7 @@ ## Introduction -[Seth](https://github.com/smartcontractkit/seth) is the Ethereum client we use for integration tests. It is designed to be a thin wrapper over `go-ethereum` client that adds a couple of key features: +[Seth](https://github.com/smartcontractkit/chainlink-testing-framework/tree/main/seth) is the Ethereum client we use for integration tests. It is designed to be a thin wrapper over `go-ethereum` client that adds a couple of key features: * key management * transaction decoding and tracing * gas estimation @@ -65,7 +65,7 @@ tracing_level = "all" # trace all transactions regardless of whether they are re ``` ### Documentation and Further Details -For a comprehensive description of all available configuration options, refer to the `[Seth]` section of configuration documentation in the [default.toml](./testconfig/default.toml) file or consult the Seth [README.md on GitHub](https://github.com/smartcontractkit/seth/blob/master/README.md). +For a comprehensive description of all available configuration options, refer to the `[Seth]` section of configuration documentation in the [default.toml](./testconfig/default.toml) file or consult the Seth [README.md on GitHub](https://github.com/smartcontractkit/chainlink-testing-framework/tree/main/seth/blob/master/README.md). ## How to set Seth logging level ### Locally @@ -155,7 +155,7 @@ The most important thing to keep in mind that the CLI requires you to provide a * `keys` commands requires `SETH_KEYFILE_PATH`, `SETH_CONFIG_PATH` and `SETH_ROOT_PRIVATE_KEY` environment variables * `gas` and `stats` command requires `SETH_CONFIG_PATH` environment variable -You can find a sample `Seth.toml` file [here](https://github.com/smartcontractkit/seth/blob/master/seth.toml). Currently, you cannot use your test TOML file as a Seth configuration file, but we will add ability that in the future. +You can find a sample `Seth.toml` file [here](https://github.com/smartcontractkit/chainlink-testing-framework/tree/main/seth/blob/master/seth.toml). Currently, you cannot use your test TOML file as a Seth configuration file, but we will add ability that in the future. ## How to get Fallback (Hardcoded) Values There are two primary methods to obtain fallback values for network configuration: @@ -166,7 +166,7 @@ There are two primary methods to obtain fallback values for network configuratio 1. **Clone the Seth Repository:** Clone the repository from GitHub using: ```bash -git clone https://github.com/smartcontractkit/seth +git clone https://github.com/smartcontractkit/chainlink-testing-framework/tree/main/seth ``` 2. **Run Seth CLI:** diff --git a/integration-tests/actions/actions.go b/integration-tests/actions/actions.go index b657bacca94..e395c9a251a 100644 --- a/integration-tests/actions/actions.go +++ b/integration-tests/actions/actions.go @@ -20,13 +20,15 @@ import ( "github.com/ethereum/go-ethereum/rpc" "go.uber.org/zap/zapcore" - "github.com/smartcontractkit/chainlink-testing-framework/blockchain" - "github.com/smartcontractkit/chainlink-testing-framework/k8s/environment" - "github.com/smartcontractkit/chainlink-testing-framework/logging" - "github.com/smartcontractkit/chainlink-testing-framework/testreporters" - "github.com/smartcontractkit/chainlink-testing-framework/utils/conversions" + "github.com/smartcontractkit/chainlink-testing-framework/lib/blockchain" + "github.com/smartcontractkit/chainlink-testing-framework/lib/k8s/environment" + "github.com/smartcontractkit/chainlink-testing-framework/lib/logging" + "github.com/smartcontractkit/chainlink-testing-framework/lib/testreporters" + "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/conversions" + "github.com/smartcontractkit/chainlink/integration-tests/contracts" ethContracts "github.com/smartcontractkit/chainlink/integration-tests/contracts/ethereum" + "github.com/smartcontractkit/chainlink/integration-tests/wrappers" "github.com/ethereum/go-ethereum/accounts/abi" @@ -37,16 +39,18 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/google/uuid" - "github.com/smartcontractkit/seth" + + "github.com/smartcontractkit/chainlink-testing-framework/seth" gethtypes "github.com/ethereum/go-ethereum/core/types" "github.com/pkg/errors" "github.com/test-go/testify/require" - ctfconfig "github.com/smartcontractkit/chainlink-testing-framework/config" - "github.com/smartcontractkit/chainlink-testing-framework/utils/testcontext" + ctfconfig "github.com/smartcontractkit/chainlink-testing-framework/lib/config" + "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/testcontext" "github.com/smartcontractkit/chainlink/integration-tests/client" + "github.com/smartcontractkit/chainlink/integration-tests/testconfig/ocr" "github.com/smartcontractkit/chainlink/integration-tests/types/config/node" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/link_token_interface" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/operator_factory" @@ -283,7 +287,7 @@ func fundChainlinkNodesAtAnyKey( return err } - fromAddress, err := privateKeyToAddress(privateKey) + fromAddress, err := PrivateKeyToAddress(privateKey) if err != nil { return err } @@ -334,7 +338,7 @@ type FundsToSendPayload struct { // to given address. You can override any or none of the following: gas limit, gas price, gas fee cap, gas tip cap. // Values that are not set will be estimated or taken from config. func SendFunds(logger zerolog.Logger, client *seth.Client, payload FundsToSendPayload) (*types.Receipt, error) { - fromAddress, err := privateKeyToAddress(payload.PrivateKey) + fromAddress, err := PrivateKeyToAddress(payload.PrivateKey) if err != nil { return nil, err } @@ -488,7 +492,8 @@ func DeployForwarderContracts( operatorFactoryInstance = &instance for i := 0; i < numberOfOperatorForwarderPairs; i++ { - decodedTx, err := seth.Decode(operatorFactoryInstance.DeployNewOperatorAndForwarder()) + tx, deployErr := operatorFactoryInstance.DeployNewOperatorAndForwarder() + decodedTx, err := seth.Decode(tx, deployErr) require.NoError(t, err, "Deploying new operator with proposed ownership with forwarder shouldn't fail") for i, event := range decodedTx.Events { @@ -606,29 +611,48 @@ func TrackForwarder( Msg("Forwarder tracked") } -// DeployOCRv2Contracts deploys a number of OCRv2 contracts and configures them with defaults -func DeployOCRv2Contracts( +// SetupOCRv2Contracts deploys a number of OCRv2 contracts and configures them with defaults +func SetupOCRv2Contracts( l zerolog.Logger, seth *seth.Client, - numberOfContracts int, + ocrContractsConfig ocr.OffChainAggregatorsConfig, linkTokenAddress common.Address, transmitters []string, ocrOptions contracts.OffchainOptions, ) ([]contracts.OffchainAggregatorV2, error) { var ocrInstances []contracts.OffchainAggregatorV2 - for contractCount := 0; contractCount < numberOfContracts; contractCount++ { - ocrInstance, err := contracts.DeployOffchainAggregatorV2( - l, - seth, - linkTokenAddress, - ocrOptions, - ) - if err != nil { - return nil, fmt.Errorf("OCRv2 instance deployment have failed: %w", err) + + if ocrContractsConfig == nil { + return nil, fmt.Errorf("you need to pass non-nil OffChainAggregatorsConfig to setup OCR contracts") + } + + if !ocrContractsConfig.UseExistingOffChainAggregatorsContracts() { + for contractCount := 0; contractCount < ocrContractsConfig.NumberOfContractsToDeploy(); contractCount++ { + ocrInstance, err := contracts.DeployOffchainAggregatorV2( + l, + seth, + linkTokenAddress, + ocrOptions, + ) + if err != nil { + return nil, fmt.Errorf("OCRv2 instance deployment have failed: %w", err) + } + ocrInstances = append(ocrInstances, &ocrInstance) + if (contractCount+1)%ContractDeploymentInterval == 0 { // For large amounts of contract deployments, space things out some + time.Sleep(2 * time.Second) + } } - ocrInstances = append(ocrInstances, &ocrInstance) - if (contractCount+1)%ContractDeploymentInterval == 0 { // For large amounts of contract deployments, space things out some - time.Sleep(2 * time.Second) + } else { + for _, address := range ocrContractsConfig.OffChainAggregatorsContractsAddresses() { + ocrInstance, err := contracts.LoadOffchainAggregatorV2(l, seth, address) + if err != nil { + return nil, fmt.Errorf("OCRv2 instance loading have failed: %w", err) + } + ocrInstances = append(ocrInstances, &ocrInstance) + } + + if !ocrContractsConfig.ConfigureExistingOffChainAggregatorsContracts() { + return ocrInstances, nil } } @@ -690,7 +714,7 @@ func TeardownSuite( l.Warn().Msgf("Error deleting jobs %+v", err) } - if chainlinkNodes != nil { + if chainlinkNodes != nil && chainClient != nil { if err := ReturnFundsFromNodes(l, chainClient, contracts.ChainlinkK8sClientToChainlinkNodeWithKeysAndAddress(chainlinkNodes)); err != nil { // This printed line is required for tests that use real funds to propagate the failure // out to the system running the test. Do not remove @@ -777,7 +801,7 @@ func StartNewRound( func DeployOCRContractsForwarderFlow( logger zerolog.Logger, seth *seth.Client, - numberOfContracts int, + ocrContractsConfig ocr.OffChainAggregatorsConfig, linkTokenContractAddress common.Address, workerNodes []contracts.ChainlinkNodeWithKeysAndAddress, forwarderAddresses []common.Address, @@ -798,23 +822,23 @@ func DeployOCRContractsForwarderFlow( return forwarderAddresses, nil } - return deployAnyOCRv1Contracts(logger, seth, numberOfContracts, linkTokenContractAddress, workerNodes, transmitterPayeesFn, transmitterAddressesFn) + return setupAnyOCRv1Contracts(logger, seth, ocrContractsConfig, linkTokenContractAddress, workerNodes, transmitterPayeesFn, transmitterAddressesFn) } -// DeployOCRv1Contracts deploys and funds a certain number of offchain aggregator contracts -func DeployOCRv1Contracts( +// SetupOCRv1Contracts deploys and funds a certain number of offchain aggregator contracts or uses existing ones and returns a slice of contract wrappers. +func SetupOCRv1Contracts( logger zerolog.Logger, seth *seth.Client, - numberOfContracts int, + ocrContractsConfig ocr.OffChainAggregatorsConfig, linkTokenContractAddress common.Address, workerNodes []contracts.ChainlinkNodeWithKeysAndAddress, ) ([]contracts.OffchainAggregator, error) { transmitterPayeesFn := func() (transmitters []string, payees []string, err error) { transmitters = make([]string, 0) payees = make([]string, 0) - for _, node := range workerNodes { + for _, n := range workerNodes { var addr string - addr, err = node.PrimaryEthAddress() + addr, err = n.PrimaryEthAddress() if err != nil { err = fmt.Errorf("error getting node's primary ETH address: %w", err) return @@ -828,8 +852,8 @@ func DeployOCRv1Contracts( transmitterAddressesFn := func() ([]common.Address, error) { transmitterAddresses := make([]common.Address, 0) - for _, node := range workerNodes { - primaryAddress, err := node.PrimaryEthAddress() + for _, n := range workerNodes { + primaryAddress, err := n.PrimaryEthAddress() if err != nil { return nil, err } @@ -839,28 +863,48 @@ func DeployOCRv1Contracts( return transmitterAddresses, nil } - return deployAnyOCRv1Contracts(logger, seth, numberOfContracts, linkTokenContractAddress, workerNodes, transmitterPayeesFn, transmitterAddressesFn) + return setupAnyOCRv1Contracts(logger, seth, ocrContractsConfig, linkTokenContractAddress, workerNodes, transmitterPayeesFn, transmitterAddressesFn) } -func deployAnyOCRv1Contracts( +func setupAnyOCRv1Contracts( logger zerolog.Logger, seth *seth.Client, - numberOfContracts int, + ocrContractsConfig ocr.OffChainAggregatorsConfig, linkTokenContractAddress common.Address, workerNodes []contracts.ChainlinkNodeWithKeysAndAddress, getTransmitterAndPayeesFn func() ([]string, []string, error), getTransmitterAddressesFn func() ([]common.Address, error), ) ([]contracts.OffchainAggregator, error) { - // Deploy contracts var ocrInstances []contracts.OffchainAggregator - for contractCount := 0; contractCount < numberOfContracts; contractCount++ { - ocrInstance, err := contracts.DeployOffchainAggregator(logger, seth, linkTokenContractAddress, contracts.DefaultOffChainAggregatorOptions()) - if err != nil { - return nil, fmt.Errorf("OCR instance deployment have failed: %w", err) + + if ocrContractsConfig == nil { + return nil, fmt.Errorf("you need to pass non-nil OffChainAggregatorsConfig to setup OCR contracts") + } + + if !ocrContractsConfig.UseExistingOffChainAggregatorsContracts() { + // Deploy contracts + for contractCount := 0; contractCount < ocrContractsConfig.NumberOfContractsToDeploy(); contractCount++ { + ocrInstance, err := contracts.DeployOffchainAggregator(logger, seth, linkTokenContractAddress, contracts.DefaultOffChainAggregatorOptions()) + if err != nil { + return nil, fmt.Errorf("OCR instance deployment have failed: %w", err) + } + ocrInstances = append(ocrInstances, &ocrInstance) + if (contractCount+1)%ContractDeploymentInterval == 0 { // For large amounts of contract deployments, space things out some + time.Sleep(2 * time.Second) + } } - ocrInstances = append(ocrInstances, &ocrInstance) - if (contractCount+1)%ContractDeploymentInterval == 0 { // For large amounts of contract deployments, space things out some - time.Sleep(2 * time.Second) + } else { + // Load contract wrappers + for _, address := range ocrContractsConfig.OffChainAggregatorsContractsAddresses() { + ocrInstance, err := contracts.LoadOffChainAggregator(logger, seth, address) + if err != nil { + return nil, fmt.Errorf("OCR instance loading have failed: %w", err) + } + ocrInstances = append(ocrInstances, &ocrInstance) + } + + if !ocrContractsConfig.ConfigureExistingOffChainAggregatorsContracts() { + return ocrInstances, nil } } @@ -907,7 +951,7 @@ func deployAnyOCRv1Contracts( return ocrInstances, nil } -func privateKeyToAddress(privateKey *ecdsa.PrivateKey) (common.Address, error) { +func PrivateKeyToAddress(privateKey *ecdsa.PrivateKey) (common.Address, error) { publicKey := privateKey.Public() publicKeyECDSA, ok := publicKey.(*ecdsa.PublicKey) if !ok { @@ -1024,18 +1068,42 @@ func SendLinkFundsToDeploymentAddresses( toTransferToMultiCallContract := big.NewInt(0).Mul(linkAmountPerUpkeep, big.NewInt(int64(totalUpkeeps+concurrency))) toTransferPerClient := big.NewInt(0).Mul(linkAmountPerUpkeep, big.NewInt(int64(operationsPerAddress+1))) - err := linkToken.Transfer(multicallAddress.Hex(), toTransferToMultiCallContract) + + // As a hack we use the geth wrapper directly, because we need to access receipt to get block number, which we will use to query the balance + // This is needed as querying with 'latest' block number very rarely, but still, return stale balance. That's happening even though we wait for + // the transaction to be mined. + linkInstance, err := link_token_interface.NewLinkToken(common.HexToAddress(linkToken.Address()), wrappers.MustNewWrappedContractBackend(nil, chainClient)) + if err != nil { + return err + } + + tx, err := chainClient.Decode(linkInstance.Transfer(chainClient.NewTXOpts(), multicallAddress, toTransferToMultiCallContract)) if err != nil { - return errors.Wrapf(err, "Error transferring LINK to multicall contract") + return err + } + + if tx.Receipt == nil { + return fmt.Errorf("transaction receipt for LINK transfer to multicall contract is nil") } - balance, err := linkToken.BalanceOf(context.Background(), multicallAddress.Hex()) + multiBalance, err := linkInstance.BalanceOf(&bind.CallOpts{From: chainClient.Addresses[0], BlockNumber: tx.Receipt.BlockNumber}, multicallAddress) if err != nil { return errors.Wrapf(err, "Error getting LINK balance of multicall contract") } - if balance.Cmp(toTransferToMultiCallContract) < 0 { - return fmt.Errorf("Incorrect LINK balance of multicall contract. Expected at least: %s. Got: %s", toTransferToMultiCallContract.String(), balance.String()) + // Old code that's querying latest block + //err := linkToken.Transfer(multicallAddress.Hex(), toTransferToMultiCallContract) + //if err != nil { + // return errors.Wrapf(err, "Error transferring LINK to multicall contract") + //} + // + //balance, err := linkToken.BalanceOf(context.Background(), multicallAddress.Hex()) + //if err != nil { + // return errors.Wrapf(err, "Error getting LINK balance of multicall contract") + //} + + if multiBalance.Cmp(toTransferToMultiCallContract) < 0 { + return fmt.Errorf("Incorrect LINK balance of multicall contract. Expected at least: %s. Got: %s", toTransferToMultiCallContract.String(), multiBalance.String()) } // Transfer LINK to ephemeral keys @@ -1060,18 +1128,24 @@ func SendLinkFundsToDeploymentAddresses( } boundContract := bind.NewBoundContract(multicallAddress, multiCallABI, chainClient.Client, chainClient.Client, chainClient.Client) // call aggregate3 to group all msg call data and send them in a single transaction - _, err = chainClient.Decode(boundContract.Transact(chainClient.NewTXOpts(), "aggregate3", call)) + ephemeralTx, err := chainClient.Decode(boundContract.Transact(chainClient.NewTXOpts(), "aggregate3", call)) if err != nil { return errors.Wrapf(err, "Error calling Multicall contract") } + if ephemeralTx.Receipt == nil { + return fmt.Errorf("transaction receipt for LINK transfer to ephemeral keys is nil") + } + for i := 1; i <= concurrency; i++ { - balance, err := linkToken.BalanceOf(context.Background(), chainClient.Addresses[i].Hex()) + ephemeralBalance, err := linkInstance.BalanceOf(&bind.CallOpts{From: chainClient.Addresses[0], BlockNumber: ephemeralTx.Receipt.BlockNumber}, chainClient.Addresses[i]) + // Old code that's querying latest block, for now we prefer to use block number from the transaction receipt + //balance, err := linkToken.BalanceOf(context.Background(), chainClient.Addresses[i].Hex()) if err != nil { return errors.Wrapf(err, "Error getting LINK balance of ephemeral key %d", i) } - if balance.Cmp(toTransferPerClient) < 0 { - return fmt.Errorf("Incorrect LINK balance after transfer. Ephemeral key %d. Expected: %s. Got: %s", i, toTransferPerClient.String(), balance.String()) + if ephemeralBalance.Cmp(toTransferPerClient) < 0 { + return fmt.Errorf("Incorrect LINK balance after transfer. Ephemeral key %d. Expected: %s. Got: %s", i, toTransferPerClient.String(), ephemeralBalance.String()) } } @@ -1205,11 +1279,23 @@ func BuildTOMLNodeConfigForK8s(testConfig ctfconfig.GlobalTestConfig, testNetwor return string(asStr), nil } +func IsOPStackChain(chainID int64) bool { + return chainID == 8453 || //BASE MAINNET + chainID == 84532 || //BASE SEPOLIA + chainID == 10 || //OPTIMISM MAINNET + chainID == 11155420 //OPTIMISM SEPOLIA +} + +func IsArbitrumChain(chainID int64) bool { + return chainID == 42161 || //Arbitrum MAINNET + chainID == 421614 //Arbitrum Sepolia +} + func RandBool() bool { return rand.Intn(2) == 1 } -func ContinuouslyGenerateTXsOnChain(sethClient *seth.Client, stopChannel chan bool, l zerolog.Logger) (bool, error) { +func ContinuouslyGenerateTXsOnChain(sethClient *seth.Client, stopChannel chan bool, wg *sync.WaitGroup, l zerolog.Logger) (bool, error) { counterContract, err := contracts.DeployCounterContract(sethClient) if err != nil { return false, err @@ -1223,6 +1309,10 @@ func ContinuouslyGenerateTXsOnChain(sethClient *seth.Client, stopChannel chan bo select { case <-stopChannel: l.Info().Str("Number of generated transactions on chain", count.String()).Msg("Stopping generating txs on chain. Desired block number reached.") + sleepDuration := time.Second * 10 + l.Info().Str("Waiting for", sleepDuration.String()).Msg("Waiting for transactions to be mined and avoid nonce issues") + time.Sleep(sleepDuration) + wg.Done() return true, nil default: err = counterContract.Increment() @@ -1237,3 +1327,12 @@ func ContinuouslyGenerateTXsOnChain(sethClient *seth.Client, stopChannel chan bo } } } + +func WithinTolerance(a, b, tolerance float64) (bool, float64) { + if a == b { + return true, 0 + } + diff := math.Abs(a - b) + isWithinTolerance := diff < tolerance + return isWithinTolerance, diff +} diff --git a/integration-tests/actions/automation_ocr_helpers.go b/integration-tests/actions/automation_ocr_helpers.go index 9aa96040250..fb2fddb3515 100644 --- a/integration-tests/actions/automation_ocr_helpers.go +++ b/integration-tests/actions/automation_ocr_helpers.go @@ -2,262 +2,24 @@ package actions //revive:disable:dot-imports import ( - "encoding/json" - "fmt" "math" "math/big" "testing" - "time" - - "github.com/pkg/errors" - "github.com/smartcontractkit/seth" "github.com/ethereum/go-ethereum/common" - "github.com/lib/pq" - "github.com/stretchr/testify/require" - "gopkg.in/guregu/null.v4" - ocr2 "github.com/smartcontractkit/libocr/offchainreporting2plus/confighelper" - ocr3 "github.com/smartcontractkit/libocr/offchainreporting2plus/ocr3confighelper" - "github.com/smartcontractkit/libocr/offchainreporting2plus/types" + tt "github.com/smartcontractkit/chainlink/integration-tests/types" - ocr2keepers20config "github.com/smartcontractkit/chainlink-automation/pkg/v2/config" - ocr2keepers30config "github.com/smartcontractkit/chainlink-automation/pkg/v3/config" - "github.com/smartcontractkit/chainlink-testing-framework/logging" + "github.com/pkg/errors" + + "github.com/smartcontractkit/chainlink-testing-framework/seth" + + "github.com/stretchr/testify/require" - "github.com/smartcontractkit/chainlink/integration-tests/client" "github.com/smartcontractkit/chainlink/integration-tests/contracts" "github.com/smartcontractkit/chainlink/integration-tests/contracts/ethereum" - "github.com/smartcontractkit/chainlink/v2/core/services/job" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/chaintype" - "github.com/smartcontractkit/chainlink/v2/core/store/models" ) -func BuildAutoOCR2ConfigVars( - t *testing.T, - chainlinkNodes []*client.ChainlinkK8sClient, - registryConfig contracts.KeeperRegistrySettings, - registrar string, - deltaStage time.Duration, - chainModuleAddress common.Address, - reorgProtectionEnabled bool, -) (contracts.OCRv2Config, error) { - return BuildAutoOCR2ConfigVarsWithKeyIndex(t, chainlinkNodes, registryConfig, registrar, deltaStage, 0, common.Address{}, chainModuleAddress, reorgProtectionEnabled) -} - -func BuildAutoOCR2ConfigVarsWithKeyIndex( - t *testing.T, - chainlinkNodes []*client.ChainlinkK8sClient, - registryConfig contracts.KeeperRegistrySettings, - registrar string, - deltaStage time.Duration, - keyIndex int, - registryOwnerAddress common.Address, - chainModuleAddress common.Address, - reorgProtectionEnabled bool, -) (contracts.OCRv2Config, error) { - l := logging.GetTestLogger(t) - S, oracleIdentities, err := GetOracleIdentitiesWithKeyIndex(chainlinkNodes, keyIndex) - if err != nil { - return contracts.OCRv2Config{}, err - } - - var offC []byte - var signerOnchainPublicKeys []types.OnchainPublicKey - var transmitterAccounts []types.Account - var f uint8 - var offchainConfigVersion uint64 - var offchainConfig []byte - - if registryConfig.RegistryVersion == ethereum.RegistryVersion_2_1 || registryConfig.RegistryVersion == ethereum.RegistryVersion_2_2 { - offC, err = json.Marshal(ocr2keepers30config.OffchainConfig{ - TargetProbability: "0.999", - TargetInRounds: 1, - PerformLockoutWindow: 3600000, // Intentionally set to be higher than in prod for testing purpose - GasLimitPerReport: 5_300_000, - GasOverheadPerUpkeep: 300_000, - MinConfirmations: 0, - MaxUpkeepBatchSize: 10, - }) - if err != nil { - return contracts.OCRv2Config{}, err - } - - signerOnchainPublicKeys, transmitterAccounts, f, _, offchainConfigVersion, offchainConfig, err = ocr3.ContractSetConfigArgsForTests( - 10*time.Second, // deltaProgress time.Duration, - 15*time.Second, // deltaResend time.Duration, - 500*time.Millisecond, // deltaInitial time.Duration, - 1000*time.Millisecond, // deltaRound time.Duration, - 200*time.Millisecond, // deltaGrace time.Duration, - 300*time.Millisecond, // deltaCertifiedCommitRequest time.Duration - deltaStage, // deltaStage time.Duration, - 24, // rMax uint64, - S, // s []int, - oracleIdentities, // oracles []OracleIdentityExtra, - offC, // reportingPluginConfig []byte, - 20*time.Millisecond, // maxDurationQuery time.Duration, - 20*time.Millisecond, // maxDurationObservation time.Duration, // good to here - 1200*time.Millisecond, // maxDurationShouldAcceptAttestedReport time.Duration, - 20*time.Millisecond, // maxDurationShouldTransmitAcceptedReport time.Duration, - 1, // f int, - nil, // onchainConfig []byte, - ) - if err != nil { - return contracts.OCRv2Config{}, err - } - } else { - offC, err = json.Marshal(ocr2keepers20config.OffchainConfig{ - TargetProbability: "0.999", - TargetInRounds: 1, - PerformLockoutWindow: 3600000, // Intentionally set to be higher than in prod for testing purpose - GasLimitPerReport: 5_300_000, - GasOverheadPerUpkeep: 300_000, - SamplingJobDuration: 3000, - MinConfirmations: 0, - MaxUpkeepBatchSize: 1, - }) - if err != nil { - return contracts.OCRv2Config{}, err - } - - signerOnchainPublicKeys, transmitterAccounts, f, _, offchainConfigVersion, offchainConfig, err = ocr2.ContractSetConfigArgsForTests( - 10*time.Second, // deltaProgress time.Duration, - 15*time.Second, // deltaResend time.Duration, - 3000*time.Millisecond, // deltaRound time.Duration, - 200*time.Millisecond, // deltaGrace time.Duration, - deltaStage, // deltaStage time.Duration, - 24, // rMax uint8, - S, // s []int, - oracleIdentities, // oracles []OracleIdentityExtra, - offC, // reportingPluginConfig []byte, - 20*time.Millisecond, // maxDurationQuery time.Duration, - 20*time.Millisecond, // maxDurationObservation time.Duration, - 1200*time.Millisecond, // maxDurationReport time.Duration, - 20*time.Millisecond, // maxDurationShouldAcceptFinalizedReport time.Duration, - 20*time.Millisecond, // maxDurationShouldTransmitAcceptedReport time.Duration, - 1, // f int, - nil, // onchainConfig []byte, - ) - if err != nil { - return contracts.OCRv2Config{}, err - } - } - - var signers []common.Address - for _, signer := range signerOnchainPublicKeys { - require.Equal(t, 20, len(signer), "OnChainPublicKey '%v' has wrong length for address", signer) - signers = append(signers, common.BytesToAddress(signer)) - } - - var transmitters []common.Address - for _, transmitter := range transmitterAccounts { - require.True(t, common.IsHexAddress(string(transmitter)), "TransmitAccount '%s' is not a valid Ethereum address", string(transmitter)) - transmitters = append(transmitters, common.HexToAddress(string(transmitter))) - } - - ocrConfig := contracts.OCRv2Config{ - Signers: signers, - Transmitters: transmitters, - F: f, - OffchainConfigVersion: offchainConfigVersion, - OffchainConfig: offchainConfig, - } - - if registryConfig.RegistryVersion == ethereum.RegistryVersion_2_0 { - ocrConfig.OnchainConfig = registryConfig.Encode20OnchainConfig(registrar) - } else if registryConfig.RegistryVersion == ethereum.RegistryVersion_2_1 { - ocrConfig.TypedOnchainConfig21 = registryConfig.Create21OnchainConfig(registrar, registryOwnerAddress) - } else if registryConfig.RegistryVersion == ethereum.RegistryVersion_2_2 { - ocrConfig.TypedOnchainConfig22 = registryConfig.Create22OnchainConfig(registrar, registryOwnerAddress, chainModuleAddress, reorgProtectionEnabled) - } - - l.Info().Msg("Done building OCR config") - return ocrConfig, nil -} - -// CreateOCRKeeperJobs bootstraps the first node and to the other nodes sends ocr jobs -func CreateOCRKeeperJobs( - t *testing.T, - chainlinkNodes []*client.ChainlinkK8sClient, - registryAddr string, - chainID int64, - keyIndex int, - registryVersion ethereum.KeeperRegistryVersion, -) { - l := logging.GetTestLogger(t) - bootstrapNode := chainlinkNodes[0] - bootstrapP2PIds, err := bootstrapNode.MustReadP2PKeys() - require.NoError(t, err, "Shouldn't fail reading P2P keys from bootstrap node") - bootstrapP2PId := bootstrapP2PIds.Data[0].Attributes.PeerID - - var contractVersion string - if registryVersion == ethereum.RegistryVersion_2_2 { - contractVersion = "v2.1+" - } else if registryVersion == ethereum.RegistryVersion_2_1 { - contractVersion = "v2.1" - } else if registryVersion == ethereum.RegistryVersion_2_0 { - contractVersion = "v2.0" - } else { - require.FailNow(t, fmt.Sprintf("v2.0, v2.1, and v2.2 are the only supported versions, but got something else: %v (iota)", registryVersion)) - } - - bootstrapSpec := &client.OCR2TaskJobSpec{ - Name: "ocr2 bootstrap node " + registryAddr, - JobType: "bootstrap", - OCR2OracleSpec: job.OCR2OracleSpec{ - ContractID: registryAddr, - Relay: "evm", - RelayConfig: map[string]interface{}{ - "chainID": int(chainID), - }, - ContractConfigTrackerPollInterval: *models.NewInterval(time.Second * 15), - }, - } - _, err = bootstrapNode.MustCreateJob(bootstrapSpec) - require.NoError(t, err, "Shouldn't fail creating bootstrap job on bootstrap node") - // TODO: Use service name returned by chainlink-env once that is available - P2Pv2Bootstrapper := fmt.Sprintf("%s@%s-node-1:%d", bootstrapP2PId, bootstrapNode.Name(), 6690) - - for nodeIndex := 1; nodeIndex < len(chainlinkNodes); nodeIndex++ { - nodeTransmitterAddress, err := chainlinkNodes[nodeIndex].EthAddresses() - require.NoError(t, err, "Shouldn't fail getting primary ETH address from OCR node %d", nodeIndex+1) - nodeOCRKeys, err := chainlinkNodes[nodeIndex].MustReadOCR2Keys() - require.NoError(t, err, "Shouldn't fail getting OCR keys from OCR node %d", nodeIndex+1) - var nodeOCRKeyId []string - for _, key := range nodeOCRKeys.Data { - if key.Attributes.ChainType == string(chaintype.EVM) { - nodeOCRKeyId = append(nodeOCRKeyId, key.ID) - break - } - } - - autoOCR2JobSpec := client.OCR2TaskJobSpec{ - Name: "ocr2 " + registryAddr, - JobType: "offchainreporting2", - OCR2OracleSpec: job.OCR2OracleSpec{ - PluginType: "ocr2automation", - Relay: "evm", - RelayConfig: map[string]interface{}{ - "chainID": int(chainID), - }, - PluginConfig: map[string]interface{}{ - "mercuryCredentialName": "\"cred1\"", - "contractVersion": "\"" + contractVersion + "\"", - }, - ContractConfigTrackerPollInterval: *models.NewInterval(time.Second * 15), - ContractID: registryAddr, // registryAddr - OCRKeyBundleID: null.StringFrom(nodeOCRKeyId[0]), // get node ocr2config.ID - TransmitterID: null.StringFrom(nodeTransmitterAddress[keyIndex]), // node addr - P2PV2Bootstrappers: pq.StringArray{P2Pv2Bootstrapper}, // bootstrap node key and address @bootstrap:8000 - }, - } - - _, err = chainlinkNodes[nodeIndex].MustCreateJob(&autoOCR2JobSpec) - require.NoError(t, err, "Shouldn't fail creating OCR Task job on OCR node %d err: %+v", nodeIndex+1, err) - } - l.Info().Msg("Done creating OCR automation jobs") -} - // DeployAutoOCRRegistryAndRegistrar registry and registrar func DeployAutoOCRRegistryAndRegistrar( t *testing.T, @@ -265,16 +27,18 @@ func DeployAutoOCRRegistryAndRegistrar( registryVersion ethereum.KeeperRegistryVersion, registrySettings contracts.KeeperRegistrySettings, linkToken contracts.LinkToken, + wethToken contracts.WETHToken, + ethUSDFeed contracts.MockETHUSDFeed, ) (contracts.KeeperRegistry, contracts.KeeperRegistrar) { - registry := deployRegistry(t, client, registryVersion, registrySettings, linkToken) - registrar := deployRegistrar(t, client, registryVersion, registry, linkToken) + registry := deployRegistry(t, client, registryVersion, registrySettings, linkToken, wethToken, ethUSDFeed) + registrar := deployRegistrar(t, client, registryVersion, registry, linkToken, wethToken) return registry, registrar } -// DeployConsumers deploys and registers keeper consumers. If ephemeral addresses are enabled, it will deploy and register the consumers from ephemeral addresses, but each upkpeep will be registered with root key address as the admin. Which means +// DeployLegacyConsumers deploys and registers keeper consumers. If ephemeral addresses are enabled, it will deploy and register the consumers from ephemeral addresses, but each upkpeep will be registered with root key address as the admin. Which means // that functions like setting upkeep configuration, pausing, unpausing, etc. will be done by the root key address. It deploys multicall contract and sends link funds to each deployment address. -func DeployConsumers(t *testing.T, chainClient *seth.Client, registry contracts.KeeperRegistry, registrar contracts.KeeperRegistrar, linkToken contracts.LinkToken, numberOfUpkeeps int, linkFundsForEachUpkeep *big.Int, upkeepGasLimit uint32, isLogTrigger bool, isMercury bool, isBillingTokenNative bool, wethToken contracts.WETHToken) ([]contracts.KeeperConsumer, []*big.Int) { +func DeployLegacyConsumers(t *testing.T, chainClient *seth.Client, registry contracts.KeeperRegistry, registrar contracts.KeeperRegistrar, linkToken contracts.LinkToken, numberOfUpkeeps int, linkFundsForEachUpkeep *big.Int, upkeepGasLimit uint32, isLogTrigger bool, isMercury bool, isBillingTokenNative bool, wethToken contracts.WETHToken) ([]contracts.KeeperConsumer, []*big.Int) { // Fund deployers with LINK, no need to do this for Native token if !isBillingTokenNative { err := DeployMultiCallAndFundDeploymentAddresses(chainClient, linkToken, numberOfUpkeeps, linkFundsForEachUpkeep) @@ -294,6 +58,28 @@ func DeployConsumers(t *testing.T, chainClient *seth.Client, registry contracts. return upkeeps, upkeepIds } +// DeployConsumers deploys and registers keeper consumers. If ephemeral addresses are enabled, it will deploy and register the consumers from ephemeral addresses, but each upkpeep will be registered with root key address as the admin. Which means +// that functions like setting upkeep configuration, pausing, unpausing, etc. will be done by the root key address. It deploys multicall contract and sends link funds to each deployment address. +func DeployConsumers(t *testing.T, chainClient *seth.Client, registry contracts.KeeperRegistry, registrar contracts.KeeperRegistrar, linkToken contracts.LinkToken, numberOfUpkeeps int, linkFundsForEachUpkeep *big.Int, upkeepGasLimit uint32, isLogTrigger bool, isMercury bool, isBillingTokenNative bool, wethToken contracts.WETHToken, config tt.AutomationTestConfig) ([]contracts.KeeperConsumer, []*big.Int) { + // Fund deployers with LINK, no need to do this for Native token + if !isBillingTokenNative { + err := SetupMultiCallAndFundDeploymentAddresses(chainClient, linkToken, numberOfUpkeeps, linkFundsForEachUpkeep, config) + require.NoError(t, err, "Sending link funds to deployment addresses shouldn't fail") + } + + upkeeps := SetupKeeperConsumers(t, chainClient, numberOfUpkeeps, isLogTrigger, isMercury, config) + require.Equal(t, numberOfUpkeeps, len(upkeeps), "Number of upkeeps should match") + var upkeepsAddresses []string + for _, upkeep := range upkeeps { + upkeepsAddresses = append(upkeepsAddresses, upkeep.Address()) + } + upkeepIds := RegisterUpkeepContracts( + t, chainClient, linkToken, linkFundsForEachUpkeep, upkeepGasLimit, registry, registrar, numberOfUpkeeps, upkeepsAddresses, isLogTrigger, isMercury, isBillingTokenNative, wethToken, + ) + require.Equal(t, numberOfUpkeeps, len(upkeepIds), "Number of upkeepIds should match") + return upkeeps, upkeepIds +} + // DeployPerformanceConsumers deploys and registers keeper performance consumers. If ephemeral addresses are enabled, it will deploy and register the consumers from ephemeral addresses, but each upkeep will be registered with root key address as the admin. // that functions like setting upkeep configuration, pausing, unpausing, etc. will be done by the root key address. It deploys multicall contract and sends link funds to each deployment address. func DeployPerformanceConsumers( @@ -309,12 +95,13 @@ func DeployPerformanceConsumers( blockInterval, // Interval of blocks that upkeeps are expected to be performed checkGasToBurn, // How much gas should be burned on checkUpkeep() calls performGasToBurn int64, // How much gas should be burned on performUpkeep() calls + config tt.AutomationTestConfig, ) ([]contracts.KeeperConsumerPerformance, []*big.Int) { upkeeps := DeployKeeperConsumersPerformance( t, chainClient, numberOfUpkeeps, blockRange, blockInterval, checkGasToBurn, performGasToBurn, ) - err := DeployMultiCallAndFundDeploymentAddresses(chainClient, linkToken, numberOfUpkeeps, linkFundsForEachUpkeep) + err := SetupMultiCallAndFundDeploymentAddresses(chainClient, linkToken, numberOfUpkeeps, linkFundsForEachUpkeep, config) require.NoError(t, err, "Sending link funds to deployment addresses shouldn't fail") var upkeepsAddresses []string @@ -337,10 +124,11 @@ func DeployPerformDataCheckerConsumers( linkFundsForEachUpkeep *big.Int, upkeepGasLimit uint32, expectedData []byte, + config tt.AutomationTestConfig, ) ([]contracts.KeeperPerformDataChecker, []*big.Int) { upkeeps := DeployPerformDataChecker(t, chainClient, numberOfUpkeeps, expectedData) - err := DeployMultiCallAndFundDeploymentAddresses(chainClient, linkToken, numberOfUpkeeps, linkFundsForEachUpkeep) + err := SetupMultiCallAndFundDeploymentAddresses(chainClient, linkToken, numberOfUpkeeps, linkFundsForEachUpkeep, config) require.NoError(t, err, "Sending link funds to deployment addresses shouldn't fail") var upkeepsAddresses []string @@ -351,6 +139,45 @@ func DeployPerformDataCheckerConsumers( return upkeeps, upkeepIds } +func SetupMultiCallAddress(chainClient *seth.Client, testConfig tt.AutomationTestConfig) (common.Address, error) { + if testConfig.GetAutomationConfig().UseExistingMultiCallContract() { + multiCallAddress, err := testConfig.GetAutomationConfig().MultiCallContractAddress() + if err != nil { + return common.Address{}, errors.Wrap(err, "Error getting existing multicall contract address") + } + return multiCallAddress, nil + } + + multicallAddress, err := contracts.DeployMultiCallContract(chainClient) + if err != nil { + return common.Address{}, errors.Wrap(err, "Error deploying multicall contract") + } + return multicallAddress, nil +} + +// SetupMultiCallAndFundDeploymentAddresses setups multicall contract and sends link funds to each deployment address +func SetupMultiCallAndFundDeploymentAddresses( + chainClient *seth.Client, + linkToken contracts.LinkToken, + numberOfUpkeeps int, + linkFundsForEachUpkeep *big.Int, + testConfig tt.AutomationTestConfig, +) error { + concurrency, err := GetAndAssertCorrectConcurrency(chainClient, 1) + if err != nil { + return err + } + + operationsPerAddress := numberOfUpkeeps / concurrency + + multicallAddress, err := SetupMultiCallAddress(chainClient, testConfig) + if err != nil { + return errors.Wrap(err, "Error deploying multicall contract") + } + + return SendLinkFundsToDeploymentAddresses(chainClient, concurrency, numberOfUpkeeps, operationsPerAddress, multicallAddress, linkFundsForEachUpkeep, linkToken) +} + // DeployMultiCallAndFundDeploymentAddresses deploys multicall contract and sends link funds to each deployment address func DeployMultiCallAndFundDeploymentAddresses( chainClient *seth.Client, @@ -379,12 +206,14 @@ func deployRegistrar( registryVersion ethereum.KeeperRegistryVersion, registry contracts.KeeperRegistry, linkToken contracts.LinkToken, + wethToken contracts.WETHToken, ) contracts.KeeperRegistrar { registrarSettings := contracts.KeeperRegistrarSettings{ AutoApproveConfigType: 2, AutoApproveMaxAllowed: math.MaxUint16, RegistryAddr: registry.Address(), MinLinkJuels: big.NewInt(0), + WETHTokenAddr: wethToken.Address(), } registrar, err := contracts.DeployKeeperRegistrar(client, registryVersion, linkToken.Address(), registrarSettings) require.NoError(t, err, "Deploying KeeperRegistrar contract shouldn't fail") @@ -397,8 +226,10 @@ func deployRegistry( registryVersion ethereum.KeeperRegistryVersion, registrySettings contracts.KeeperRegistrySettings, linkToken contracts.LinkToken, + wethToken contracts.WETHToken, + ethUSDFeed contracts.MockETHUSDFeed, ) contracts.KeeperRegistry { - ef, err := contracts.DeployMockETHLINKFeed(client, big.NewInt(2e18)) + ef, err := contracts.DeployMockLINKETHFeed(client, big.NewInt(2e18)) require.NoError(t, err, "Deploying mock ETH-Link feed shouldn't fail") gf, err := contracts.DeployMockGASFeed(client, big.NewInt(2e11)) require.NoError(t, err, "Deploying mock gas feed shouldn't fail") @@ -410,13 +241,16 @@ func deployRegistry( registry, err := contracts.DeployKeeperRegistry( client, &contracts.KeeperRegistryOpts{ - RegistryVersion: registryVersion, - LinkAddr: linkToken.Address(), - ETHFeedAddr: ef.Address(), - GasFeedAddr: gf.Address(), - TranscoderAddr: transcoder.Address(), - RegistrarAddr: ZeroAddress.Hex(), - Settings: registrySettings, + RegistryVersion: registryVersion, + LinkAddr: linkToken.Address(), + ETHFeedAddr: ef.Address(), + GasFeedAddr: gf.Address(), + TranscoderAddr: transcoder.Address(), + RegistrarAddr: ZeroAddress.Hex(), + Settings: registrySettings, + LinkUSDFeedAddr: ethUSDFeed.Address(), + NativeUSDFeedAddr: ethUSDFeed.Address(), + WrappedNativeAddr: wethToken.Address(), }, ) require.NoError(t, err, "Deploying KeeperRegistry contract shouldn't fail") diff --git a/integration-tests/actions/automation_ocr_helpers_local.go b/integration-tests/actions/automation_ocr_helpers_local.go index ec6f8ba2684..e4d5ad70cac 100644 --- a/integration-tests/actions/automation_ocr_helpers_local.go +++ b/integration-tests/actions/automation_ocr_helpers_local.go @@ -6,6 +6,8 @@ import ( "fmt" "time" + tc "github.com/smartcontractkit/chainlink/integration-tests/testconfig" + "github.com/ethereum/go-ethereum/common" "github.com/lib/pq" "github.com/rs/zerolog" @@ -26,6 +28,61 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/store/models" ) +func ReadRegistryConfig(c tc.AutomationTestConfig) contracts.KeeperRegistrySettings { + registrySettings := c.GetAutomationConfig().AutomationConfig.RegistrySettings + return contracts.KeeperRegistrySettings{ + PaymentPremiumPPB: *registrySettings.PaymentPremiumPPB, + FlatFeeMicroLINK: *registrySettings.FlatFeeMicroLINK, + CheckGasLimit: *registrySettings.CheckGasLimit, + StalenessSeconds: registrySettings.StalenessSeconds, + GasCeilingMultiplier: *registrySettings.GasCeilingMultiplier, + MinUpkeepSpend: registrySettings.MinUpkeepSpend, + MaxPerformGas: *registrySettings.MaxPerformGas, + FallbackGasPrice: registrySettings.FallbackGasPrice, + FallbackLinkPrice: registrySettings.FallbackLinkPrice, + FallbackNativePrice: registrySettings.FallbackNativePrice, + MaxCheckDataSize: *registrySettings.MaxCheckDataSize, + MaxPerformDataSize: *registrySettings.MaxPerformDataSize, + MaxRevertDataSize: *registrySettings.MaxRevertDataSize, + } +} + +func ReadPluginConfig(c tc.AutomationTestConfig) ocr2keepers30config.OffchainConfig { + plCfg := c.GetAutomationConfig().AutomationConfig.PluginConfig + return ocr2keepers30config.OffchainConfig{ + TargetProbability: *plCfg.TargetProbability, + TargetInRounds: *plCfg.TargetInRounds, + PerformLockoutWindow: *plCfg.PerformLockoutWindow, + GasLimitPerReport: *plCfg.GasLimitPerReport, + GasOverheadPerUpkeep: *plCfg.GasOverheadPerUpkeep, + MinConfirmations: *plCfg.MinConfirmations, + MaxUpkeepBatchSize: *plCfg.MaxUpkeepBatchSize, + LogProviderConfig: ocr2keepers30config.LogProviderConfig{ + BlockRate: *plCfg.LogProviderConfig.BlockRate, + LogLimit: *plCfg.LogProviderConfig.LogLimit, + }, + } +} + +func ReadPublicConfig(c tc.AutomationTestConfig) ocr3.PublicConfig { + pubCfg := c.GetAutomationConfig().AutomationConfig.PublicConfig + return ocr3.PublicConfig{ + DeltaProgress: *pubCfg.DeltaProgress, + DeltaResend: *pubCfg.DeltaResend, + DeltaInitial: *pubCfg.DeltaInitial, + DeltaRound: *pubCfg.DeltaRound, + DeltaGrace: *pubCfg.DeltaGrace, + DeltaCertifiedCommitRequest: *pubCfg.DeltaCertifiedCommitRequest, + DeltaStage: *pubCfg.DeltaStage, + RMax: *pubCfg.RMax, + MaxDurationQuery: *pubCfg.MaxDurationQuery, + MaxDurationObservation: *pubCfg.MaxDurationObservation, + MaxDurationShouldAcceptAttestedReport: *pubCfg.MaxDurationShouldAcceptAttestedReport, + MaxDurationShouldTransmitAcceptedReport: *pubCfg.MaxDurationShouldTransmitAcceptedReport, + F: *pubCfg.F, + } +} + func BuildAutoOCR2ConfigVarsLocal( l zerolog.Logger, chainlinkNodes []*client.ChainlinkClient, diff --git a/integration-tests/actions/automationv2/actions.go b/integration-tests/actions/automationv2/actions.go index f7d495bda5a..9b3013f778e 100644 --- a/integration-tests/actions/automationv2/actions.go +++ b/integration-tests/actions/automationv2/actions.go @@ -12,6 +12,8 @@ import ( "testing" "time" + tt "github.com/smartcontractkit/chainlink/integration-tests/types" + "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/common" "github.com/lib/pq" @@ -20,11 +22,12 @@ import ( ocr2 "github.com/smartcontractkit/libocr/offchainreporting2plus/confighelper" ocr3 "github.com/smartcontractkit/libocr/offchainreporting2plus/ocr3confighelper" "github.com/smartcontractkit/libocr/offchainreporting2plus/types" - "github.com/smartcontractkit/seth" "github.com/stretchr/testify/require" "golang.org/x/sync/errgroup" "gopkg.in/guregu/null.v4" + "github.com/smartcontractkit/chainlink-testing-framework/seth" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/i_automation_registry_master_wrapper_2_3" ocr2keepers20config "github.com/smartcontractkit/chainlink-automation/pkg/v2/config" @@ -43,9 +46,9 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/keystore/chaintype" "github.com/smartcontractkit/chainlink/v2/core/store/models" - ctf_concurrency "github.com/smartcontractkit/chainlink-testing-framework/concurrency" - ctfTestEnv "github.com/smartcontractkit/chainlink-testing-framework/docker/test_env" - "github.com/smartcontractkit/chainlink-testing-framework/logging" + ctf_concurrency "github.com/smartcontractkit/chainlink-testing-framework/lib/concurrency" + ctftestenv "github.com/smartcontractkit/chainlink-testing-framework/lib/docker/test_env" + "github.com/smartcontractkit/chainlink-testing-framework/lib/logging" ) type NodeDetails struct { @@ -60,10 +63,13 @@ type NodeDetails struct { type AutomationTest struct { ChainClient *seth.Client + TestConfig tt.AutomationTestConfig + LinkToken contracts.LinkToken Transcoder contracts.UpkeepTranscoder - EthLinkFeed contracts.MockETHLINKFeed - EthUSDFeed contracts.MockETHUSDFeed + LINKETHFeed contracts.MockLINKETHFeed + ETHUSDFeed contracts.MockETHUSDFeed + LINKUSDFeed contracts.MockETHUSDFeed WETHToken contracts.WETHToken GasFeed contracts.MockGasFeed Registry contracts.KeeperRegistry @@ -88,8 +94,7 @@ type AutomationTest struct { mercuryCredentialName string TransmitterKeyIndex int - Logger zerolog.Logger - useLogBufferV1 bool + Logger zerolog.Logger } type UpkeepConfig struct { @@ -109,15 +114,16 @@ func NewAutomationTestK8s( l zerolog.Logger, chainClient *seth.Client, chainlinkNodes []*client.ChainlinkK8sClient, + config tt.AutomationTestConfig, ) *AutomationTest { return &AutomationTest{ ChainClient: chainClient, + TestConfig: config, ChainlinkNodesk8s: chainlinkNodes, IsOnk8s: true, TransmitterKeyIndex: 0, UpkeepPrivilegeManager: chainClient.MustGetRootKeyAddress(), mercuryCredentialName: "", - useLogBufferV1: false, Logger: l, } } @@ -126,15 +132,16 @@ func NewAutomationTestDocker( l zerolog.Logger, chainClient *seth.Client, chainlinkNodes []*client.ChainlinkClient, + config tt.AutomationTestConfig, ) *AutomationTest { return &AutomationTest{ ChainClient: chainClient, + TestConfig: config, ChainlinkNodes: chainlinkNodes, IsOnk8s: false, TransmitterKeyIndex: 0, UpkeepPrivilegeManager: chainClient.MustGetRootKeyAddress(), mercuryCredentialName: "", - useLogBufferV1: false, Logger: l, } } @@ -147,10 +154,6 @@ func (a *AutomationTest) SetMercuryCredentialName(name string) { a.mercuryCredentialName = name } -func (a *AutomationTest) SetUseLogBufferV1(flag bool) { - a.useLogBufferV1 = flag -} - func (a *AutomationTest) SetTransmitterKeyIndex(index int) { a.TransmitterKeyIndex = index } @@ -178,6 +181,7 @@ func (a *AutomationTest) LoadLINK(address string) error { return err } a.LinkToken = linkToken + a.Logger.Info().Str("LINK Token Address", a.LinkToken.Address()).Msg("Successfully loaded LINK Token") return nil } @@ -196,34 +200,35 @@ func (a *AutomationTest) LoadTranscoder(address string) error { return err } a.Transcoder = transcoder + a.Logger.Info().Str("Transcoder Address", a.Transcoder.Address()).Msg("Successfully loaded Transcoder") return nil } -func (a *AutomationTest) DeployEthLinkFeed() error { - ethLinkFeed, err := contracts.DeployMockETHLINKFeed(a.ChainClient, a.RegistrySettings.FallbackLinkPrice) +func (a *AutomationTest) DeployLinkEthFeed() error { + ethLinkFeed, err := contracts.DeployMockLINKETHFeed(a.ChainClient, a.RegistrySettings.FallbackLinkPrice) if err != nil { return err } - a.EthLinkFeed = ethLinkFeed + a.LINKETHFeed = ethLinkFeed return nil } -func (a *AutomationTest) LoadEthLinkFeed(address string) error { - ethLinkFeed, err := contracts.LoadMockETHLINKFeed(a.ChainClient, common.HexToAddress(address)) +func (a *AutomationTest) LoadLinkEthFeed(address string) error { + ethLinkFeed, err := contracts.LoadMockLINKETHFeed(a.ChainClient, common.HexToAddress(address)) if err != nil { return err } - a.EthLinkFeed = ethLinkFeed + a.LINKETHFeed = ethLinkFeed + a.Logger.Info().Str("LINK/ETH Feed Address", a.LINKETHFeed.Address()).Msg("Successfully loaded LINK/ETH Feed") return nil } func (a *AutomationTest) DeployEthUSDFeed() error { - // FallbackLinkPrice and FallbackETHPrice are the same ethUSDFeed, err := contracts.DeployMockETHUSDFeed(a.ChainClient, a.RegistrySettings.FallbackLinkPrice) if err != nil { return err } - a.EthUSDFeed = ethUSDFeed + a.ETHUSDFeed = ethUSDFeed return nil } @@ -232,7 +237,27 @@ func (a *AutomationTest) LoadEthUSDFeed(address string) error { if err != nil { return err } - a.EthUSDFeed = ethUSDFeed + a.ETHUSDFeed = ethUSDFeed + a.Logger.Info().Str("ETH/USD Feed Address", a.ETHUSDFeed.Address()).Msg("Successfully loaded ETH/USD Feed") + return nil +} + +func (a *AutomationTest) DeployLinkUSDFeed() error { + linkUSDFeed, err := contracts.DeployMockETHUSDFeed(a.ChainClient, a.RegistrySettings.FallbackLinkPrice) + if err != nil { + return err + } + a.LINKUSDFeed = linkUSDFeed + return nil +} + +func (a *AutomationTest) LoadLinkUSDFeed(address string) error { + linkUSDFeed, err := contracts.LoadMockETHUSDFeed(a.ChainClient, common.HexToAddress(address)) + if err != nil { + return err + } + a.LINKUSDFeed = linkUSDFeed + a.Logger.Info().Str("LINK/USD Feed Address", a.LINKUSDFeed.Address()).Msg("Successfully loaded LINK/USD Feed") return nil } @@ -251,6 +276,7 @@ func (a *AutomationTest) LoadWETH(address string) error { return err } a.WETHToken = wethToken + a.Logger.Info().Str("WETH Token Address", a.WETHToken.Address()).Msg("Successfully loaded WETH Token") return nil } @@ -269,6 +295,7 @@ func (a *AutomationTest) LoadEthGasFeed(address string) error { return err } a.GasFeed = gasFeed + a.Logger.Info().Str("Gas Feed Address", a.GasFeed.Address()).Msg("Successfully loaded Gas Feed") return nil } @@ -276,13 +303,13 @@ func (a *AutomationTest) DeployRegistry() error { registryOpts := &contracts.KeeperRegistryOpts{ RegistryVersion: a.RegistrySettings.RegistryVersion, LinkAddr: a.LinkToken.Address(), - ETHFeedAddr: a.EthLinkFeed.Address(), + ETHFeedAddr: a.LINKETHFeed.Address(), GasFeedAddr: a.GasFeed.Address(), TranscoderAddr: a.Transcoder.Address(), RegistrarAddr: utils.ZeroAddress.Hex(), Settings: a.RegistrySettings, - LinkUSDFeedAddr: a.EthUSDFeed.Address(), - NativeUSDFeedAddr: a.EthUSDFeed.Address(), + LinkUSDFeedAddr: a.ETHUSDFeed.Address(), + NativeUSDFeedAddr: a.LINKUSDFeed.Address(), WrappedNativeAddr: a.WETHToken.Address(), } registry, err := contracts.DeployKeeperRegistry(a.ChainClient, registryOpts) @@ -293,12 +320,13 @@ func (a *AutomationTest) DeployRegistry() error { return nil } -func (a *AutomationTest) LoadRegistry(address string) error { - registry, err := contracts.LoadKeeperRegistry(a.Logger, a.ChainClient, common.HexToAddress(address), a.RegistrySettings.RegistryVersion) +func (a *AutomationTest) LoadRegistry(registryAddress, chainModuleAddress string) error { + registry, err := contracts.LoadKeeperRegistry(a.Logger, a.ChainClient, common.HexToAddress(registryAddress), a.RegistrySettings.RegistryVersion, common.HexToAddress(chainModuleAddress)) if err != nil { return err } a.Registry = registry + a.Logger.Info().Str("ChainModule Address", chainModuleAddress).Str("Registry Address", a.Registry.Address()).Msg("Successfully loaded Registry") return nil } @@ -325,6 +353,7 @@ func (a *AutomationTest) LoadRegistrar(address string) error { if err != nil { return err } + a.Logger.Info().Str("Registrar Address", registrar.Address()).Msg("Successfully loaded Registrar") a.Registrar = registrar return nil } @@ -422,9 +451,6 @@ func (a *AutomationTest) AddAutomationJobs() error { if a.mercuryCredentialName != "" { pluginCfg["mercuryCredentialName"] = "\"" + a.mercuryCredentialName + "\"" } - if a.useLogBufferV1 { - pluginCfg["useBufferV1"] = "true" - } } for i := 1; i < len(a.ChainlinkNodes); i++ { autoOCR2JobSpec := client.OCR2TaskJobSpec{ @@ -573,7 +599,7 @@ func (a *AutomationTest) SetConfigOnRegistry() error { { GasFeePPB: 100, FlatFeeMilliCents: big.NewInt(500), - PriceFeed: common.HexToAddress(a.EthUSDFeed.Address()), // ETH/USD feed and LINK/USD feed are the same + PriceFeed: common.HexToAddress(a.ETHUSDFeed.Address()), Decimals: 18, FallbackPrice: big.NewInt(1000), MinSpend: big.NewInt(200), @@ -581,13 +607,14 @@ func (a *AutomationTest) SetConfigOnRegistry() error { { GasFeePPB: 100, FlatFeeMilliCents: big.NewInt(500), - PriceFeed: common.HexToAddress(a.EthUSDFeed.Address()), // ETH/USD feed and LINK/USD feed are the same + PriceFeed: common.HexToAddress(a.LINKUSDFeed.Address()), Decimals: 18, FallbackPrice: big.NewInt(1000), MinSpend: big.NewInt(200), }, } } + a.Logger.Debug().Interface("ocrConfig", ocrConfig).Msg("Setting OCR3 config") err = a.Registry.SetConfigTypeSafe(ocrConfig) if err != nil { return errors.Join(err, fmt.Errorf("failed to set config on registry")) @@ -837,7 +864,7 @@ func (a *AutomationTest) AddJobsAndSetConfig(t *testing.T) { l.Info().Str("Registry Address", a.Registry.Address()).Msg("Successfully setConfig on registry") } -func (a *AutomationTest) SetupMercuryMock(t *testing.T, imposters []ctfTestEnv.KillgraveImposter) { +func (a *AutomationTest) SetupMercuryMock(t *testing.T, imposters []ctftestenv.KillgraveImposter) { if a.IsOnk8s { t.Error("mercury mock is not supported on k8s") } @@ -851,58 +878,118 @@ func (a *AutomationTest) SetupMercuryMock(t *testing.T, imposters []ctfTestEnv.K } func (a *AutomationTest) SetupAutomationDeployment(t *testing.T) { + a.setupDeployment(t, true) +} + +func (a *AutomationTest) SetupAutomationDeploymentWithoutJobs(t *testing.T) { + a.setupDeployment(t, false) +} + +func (a *AutomationTest) setupDeployment(t *testing.T, addJobs bool) { l := logging.GetTestLogger(t) err := a.CollectNodeDetails() require.NoError(t, err, "Error collecting node details") l.Info().Msg("Collected Node Details") l.Debug().Interface("Node Details", a.NodeDetails).Msg("Node Details") - err = a.DeployLINK() - require.NoError(t, err, "Error deploying link token contract") + if a.TestConfig.GetAutomationConfig().UseExistingLinkTokenContract() { + linkAddress, err := a.TestConfig.GetAutomationConfig().LinkTokenContractAddress() + require.NoError(t, err, "Error getting link token contract address") + err = a.LoadLINK(linkAddress.String()) + require.NoError(t, err, "Error loading link token contract") + } else { + err = a.DeployLINK() + require.NoError(t, err, "Error deploying link token contract") + } - err = a.DeployWETH() - require.NoError(t, err, "Error deploying weth token contract") + if a.TestConfig.GetAutomationConfig().UseExistingWethContract() { + wethAddress, err := a.TestConfig.GetAutomationConfig().WethContractAddress() + require.NoError(t, err, "Error getting weth token contract address") + err = a.LoadWETH(wethAddress.String()) + require.NoError(t, err, "Error loading weth token contract") + } else { + err = a.DeployWETH() + require.NoError(t, err, "Error deploying weth token contract") + } - err = a.DeployEthLinkFeed() - require.NoError(t, err, "Error deploying eth link feed contract") - err = a.DeployGasFeed() - require.NoError(t, err, "Error deploying gas feed contract") + if a.TestConfig.GetAutomationConfig().UseExistingLinkEthFeedContract() { + linkEthFeedAddress, err := a.TestConfig.GetAutomationConfig().LinkEthFeedContractAddress() + require.NoError(t, err, "Error getting link eth feed contract address") + err = a.LoadLinkEthFeed(linkEthFeedAddress.String()) + require.NoError(t, err, "Error loading link eth feed contract") + } else { + err = a.DeployLinkEthFeed() + require.NoError(t, err, "Error deploying link eth feed contract") + } - err = a.DeployEthUSDFeed() - require.NoError(t, err, "Error deploying eth usd feed contract") + if a.TestConfig.GetAutomationConfig().UseExistingEthGasFeedContract() { + gasFeedAddress, err := a.TestConfig.GetAutomationConfig().EthGasFeedContractAddress() + require.NoError(t, err, "Error getting gas feed contract address") + err = a.LoadEthGasFeed(gasFeedAddress.String()) + require.NoError(t, err, "Error loading gas feed contract") + } else { + err = a.DeployGasFeed() + require.NoError(t, err, "Error deploying gas feed contract") + } - err = a.DeployTranscoder() - require.NoError(t, err, "Error deploying transcoder contract") + if a.TestConfig.GetAutomationConfig().UseExistingEthUSDFeedContract() { + ethUsdFeedAddress, err := a.TestConfig.GetAutomationConfig().EthUSDFeedContractAddress() + require.NoError(t, err, "Error getting eth usd feed contract address") + err = a.LoadEthUSDFeed(ethUsdFeedAddress.String()) + require.NoError(t, err, "Error loading eth usd feed contract") + } else { + err = a.DeployEthUSDFeed() + require.NoError(t, err, "Error deploying eth usd feed contract") + } - err = a.DeployRegistry() - require.NoError(t, err, "Error deploying registry contract") - err = a.DeployRegistrar() - require.NoError(t, err, "Error deploying registrar contract") + if a.TestConfig.GetAutomationConfig().UseExistingLinkUSDFeedContract() { + linkUsdFeedAddress, err := a.TestConfig.GetAutomationConfig().LinkUSDFeedContractAddress() + require.NoError(t, err, "Error getting link usd feed contract address") + err = a.LoadLinkUSDFeed(linkUsdFeedAddress.String()) + require.NoError(t, err, "Error loading link usd feed contract") + } else { + err = a.DeployLinkUSDFeed() + require.NoError(t, err, "Error deploying link usd feed contract") + } - a.AddJobsAndSetConfig(t) -} + if a.TestConfig.GetAutomationConfig().UseExistingTranscoderContract() { + transcoderAddress, err := a.TestConfig.GetAutomationConfig().TranscoderContractAddress() + require.NoError(t, err, "Error getting transcoder contract address") + err = a.LoadTranscoder(transcoderAddress.String()) + require.NoError(t, err, "Error loading transcoder contract") + } else { + err = a.DeployTranscoder() + require.NoError(t, err, "Error deploying transcoder contract") + } + + if a.TestConfig.GetAutomationConfig().UseExistingRegistryContract() { + chainModuleAddress, err := a.TestConfig.GetAutomationConfig().ChainModuleContractAddress() + require.NoError(t, err, "Error getting chain module contract address") + registryAddress, err := a.TestConfig.GetAutomationConfig().RegistryContractAddress() + require.NoError(t, err, "Error getting registry contract address") + err = a.LoadRegistry(registryAddress.String(), chainModuleAddress.String()) + require.NoError(t, err, "Error loading registry contract") + if a.Registry.RegistryOwnerAddress().String() != a.ChainClient.MustGetRootKeyAddress().String() { + l.Debug().Str("RootKeyAddress", a.ChainClient.MustGetRootKeyAddress().String()).Str("Registry Owner Address", a.Registry.RegistryOwnerAddress().String()).Msg("Registry owner address is not the root key address") + t.Error("Registry owner address is not the root key address") + t.FailNow() + } + } else { + err = a.DeployRegistry() + require.NoError(t, err, "Error deploying registry contract") + } -func (a *AutomationTest) LoadAutomationDeployment(t *testing.T, linkTokenAddress, - ethLinkFeedAddress, gasFeedAddress, transcoderAddress, registryAddress, registrarAddress string) { - l := logging.GetTestLogger(t) - err := a.CollectNodeDetails() - require.NoError(t, err, "Error collecting node details") - l.Info().Msg("Collected Node Details") - l.Debug().Interface("Node Details", a.NodeDetails).Msg("Node Details") + if a.TestConfig.GetAutomationConfig().UseExistingRegistrarContract() { + registrarAddress, err := a.TestConfig.GetAutomationConfig().RegistrarContractAddress() + require.NoError(t, err, "Error getting registrar contract address") + err = a.LoadRegistrar(registrarAddress.String()) + require.NoError(t, err, "Error loading registrar contract") + } else { + err = a.DeployRegistrar() + require.NoError(t, err, "Error deploying registrar contract") + } - err = a.LoadLINK(linkTokenAddress) - require.NoError(t, err, "Error loading link token contract") - - err = a.LoadEthLinkFeed(ethLinkFeedAddress) - require.NoError(t, err, "Error loading eth link feed contract") - err = a.LoadEthGasFeed(gasFeedAddress) - require.NoError(t, err, "Error loading gas feed contract") - err = a.LoadTranscoder(transcoderAddress) - require.NoError(t, err, "Error loading transcoder contract") - err = a.LoadRegistry(registryAddress) - require.NoError(t, err, "Error loading registry contract") - err = a.LoadRegistrar(registrarAddress) - require.NoError(t, err, "Error loading registrar contract") - - a.AddJobsAndSetConfig(t) + if addJobs { + a.AddJobsAndSetConfig(t) + } } diff --git a/integration-tests/actions/contracts.go b/integration-tests/actions/contracts.go new file mode 100644 index 00000000000..1a50c4d7ba9 --- /dev/null +++ b/integration-tests/actions/contracts.go @@ -0,0 +1,23 @@ +package actions + +import ( + "github.com/rs/zerolog" + + "github.com/smartcontractkit/chainlink-testing-framework/seth" + + "github.com/smartcontractkit/chainlink/integration-tests/contracts" + tc "github.com/smartcontractkit/chainlink/integration-tests/testconfig" +) + +// LinkTokenContract returns a link token contract instance. Depending on test configuration, it either deploys a new one or uses an existing one. +func LinkTokenContract(l zerolog.Logger, sethClient *seth.Client, configWithLinkToken tc.LinkTokenContractConfig) (*contracts.EthereumLinkToken, error) { + if configWithLinkToken != nil && configWithLinkToken.UseExistingLinkTokenContract() { + linkAddress, err := configWithLinkToken.LinkTokenContractAddress() + if err != nil { + return nil, err + } + + return contracts.LoadLinkTokenContract(l, sethClient, linkAddress) + } + return contracts.DeployLinkTokenContract(l, sethClient) +} diff --git a/integration-tests/actions/keeper_helpers.go b/integration-tests/actions/keeper_helpers.go index ee1662cc180..1cf468d06fa 100644 --- a/integration-tests/actions/keeper_helpers.go +++ b/integration-tests/actions/keeper_helpers.go @@ -8,13 +8,16 @@ import ( "strconv" "testing" + tt "github.com/smartcontractkit/chainlink/integration-tests/types" + "github.com/ethereum/go-ethereum/core/types" "github.com/google/uuid" "github.com/pkg/errors" - "github.com/smartcontractkit/seth" - ctf_concurrency "github.com/smartcontractkit/chainlink-testing-framework/concurrency" - "github.com/smartcontractkit/chainlink-testing-framework/logging" + "github.com/smartcontractkit/chainlink-testing-framework/seth" + + ctf_concurrency "github.com/smartcontractkit/chainlink-testing-framework/lib/concurrency" + "github.com/smartcontractkit/chainlink-testing-framework/lib/logging" "github.com/smartcontractkit/chainlink/integration-tests/contracts/ethereum" "github.com/ethereum/go-ethereum/common" @@ -81,7 +84,7 @@ func DeployKeeperContracts( client *seth.Client, linkFundsForEachUpkeep *big.Int, ) (contracts.KeeperRegistry, contracts.KeeperRegistrar, []contracts.KeeperConsumer, []*big.Int) { - ef, err := contracts.DeployMockETHLINKFeed(client, big.NewInt(2e18)) + ef, err := contracts.DeployMockLINKETHFeed(client, big.NewInt(2e18)) require.NoError(t, err, "Deploying mock ETH-Link feed shouldn't fail") gf, err := contracts.DeployMockGASFeed(client, big.NewInt(2e11)) require.NoError(t, err, "Deploying mock gas feed shouldn't fail") @@ -116,7 +119,7 @@ func DeployKeeperContracts( } registrar := DeployKeeperRegistrar(t, client, registryVersion, linkToken, registrarSettings, registry) - upkeeps, upkeepIds := DeployConsumers(t, client, registry, registrar, linkToken, numberOfUpkeeps, linkFundsForEachUpkeep, upkeepGasLimit, false, false, false, nil) + upkeeps, upkeepIds := DeployLegacyConsumers(t, client, registry, registrar, linkToken, numberOfUpkeeps, linkFundsForEachUpkeep, upkeepGasLimit, false, false, false, nil) return registry, registrar, upkeeps, upkeepIds } @@ -136,7 +139,7 @@ func DeployPerformanceKeeperContracts( checkGasToBurn, // How much gas should be burned on checkUpkeep() calls performGasToBurn int64, // How much gas should be burned on performUpkeep() calls ) (contracts.KeeperRegistry, contracts.KeeperRegistrar, []contracts.KeeperConsumerPerformance, []*big.Int) { - ef, err := contracts.DeployMockETHLINKFeed(chainClient, big.NewInt(2e18)) + ef, err := contracts.DeployMockLINKETHFeed(chainClient, big.NewInt(2e18)) require.NoError(t, err, "Deploying mock ETH-Link feed shouldn't fail") gf, err := contracts.DeployMockGASFeed(chainClient, big.NewInt(2e11)) require.NoError(t, err, "Deploying mock gas feed shouldn't fail") @@ -196,7 +199,7 @@ func DeployPerformDataCheckerContracts( linkFundsForEachUpkeep *big.Int, expectedData []byte, ) (contracts.KeeperRegistry, contracts.KeeperRegistrar, []contracts.KeeperPerformDataChecker, []*big.Int) { - ef, err := contracts.DeployMockETHLINKFeed(chainClient, big.NewInt(2e18)) + ef, err := contracts.DeployMockLINKETHFeed(chainClient, big.NewInt(2e18)) require.NoError(t, err, "Deploying mock ETH-Link feed shouldn't fail") gf, err := contracts.DeployMockGASFeed(chainClient, big.NewInt(2e11)) require.NoError(t, err, "Deploying mock gas feed shouldn't fail") @@ -455,6 +458,33 @@ func DeployKeeperConsumers(t *testing.T, client *seth.Client, numberOfContracts return results } +// SetupKeeperConsumers concurrently loads or deploys keeper consumer contracts. It requires at least 1 ephemeral key to be present in Seth config. +func SetupKeeperConsumers(t *testing.T, client *seth.Client, numberOfContracts int, isLogTrigger bool, isMercury bool, config tt.AutomationTestConfig) []contracts.KeeperConsumer { + l := logging.GetTestLogger(t) + + var results []contracts.KeeperConsumer + + if config.GetAutomationConfig().UseExistingUpkeepContracts() { + contractsLoaded, err := config.GetAutomationConfig().UpkeepContractAddresses() + require.NoError(t, err, "Failed to get upkeep contract addresses") + require.Equal(t, numberOfContracts, len(contractsLoaded), "Incorrect number of Keeper Consumer Contracts loaded") + l.Info().Int("Number of Contracts", numberOfContracts).Msg("Loading upkeep contracts from config") + // Load existing contracts + for i := 0; i < numberOfContracts; i++ { + require.NoError(t, err, "Failed to get upkeep contract addresses") + contract, err := contracts.LoadKeeperConsumer(client, contractsLoaded[i]) + require.NoError(t, err, "Failed to load keeper consumer contract") + l.Info().Str("Contract Address", contract.Address()).Int("Number", i+1).Int("Out Of", numberOfContracts).Msg("Loaded Keeper Consumer Contract") + results = append(results, contract) + } + } else { + // Deploy new contracts + return DeployKeeperConsumers(t, client, numberOfContracts, isLogTrigger, isMercury) + } + + return results +} + // DeployKeeperConsumersPerformance sequentially deploys keeper performance consumer contracts. func DeployKeeperConsumersPerformance( t *testing.T, diff --git a/integration-tests/actions/ocr2_helpers.go b/integration-tests/actions/ocr2_helpers.go index 0f8dd9b29f2..f487368dfd2 100644 --- a/integration-tests/actions/ocr2_helpers.go +++ b/integration-tests/actions/ocr2_helpers.go @@ -18,7 +18,7 @@ import ( "github.com/smartcontractkit/libocr/offchainreporting2plus/confighelper" "github.com/smartcontractkit/libocr/offchainreporting2plus/types" - ctfClient "github.com/smartcontractkit/chainlink-testing-framework/client" + ctfClient "github.com/smartcontractkit/chainlink-testing-framework/lib/client" "github.com/smartcontractkit/chainlink/v2/core/services/job" "github.com/smartcontractkit/chainlink/v2/core/services/keystore/chaintype" diff --git a/integration-tests/actions/ocr2_helpers_local.go b/integration-tests/actions/ocr2_helpers_local.go index 733b6903552..3667aa1ef0e 100644 --- a/integration-tests/actions/ocr2_helpers_local.go +++ b/integration-tests/actions/ocr2_helpers_local.go @@ -19,7 +19,7 @@ import ( "gopkg.in/guregu/null.v4" "github.com/smartcontractkit/chainlink-common/pkg/codec" - "github.com/smartcontractkit/chainlink-testing-framework/docker/test_env" + "github.com/smartcontractkit/chainlink-testing-framework/lib/docker/test_env" evmtypes "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/types" "github.com/smartcontractkit/chainlink/v2/core/services/job" diff --git a/integration-tests/actions/ocr_helpers.go b/integration-tests/actions/ocr_helpers.go index 6e54e81cd84..0f6f65d1289 100644 --- a/integration-tests/actions/ocr_helpers.go +++ b/integration-tests/actions/ocr_helpers.go @@ -2,17 +2,27 @@ package actions import ( "fmt" + "math/big" + "math/rand" "strings" "testing" + "time" + + "github.com/ethereum/go-ethereum/common" + "github.com/rs/zerolog" + + "github.com/smartcontractkit/chainlink-testing-framework/seth" "github.com/google/uuid" "github.com/stretchr/testify/require" "golang.org/x/sync/errgroup" - ctfClient "github.com/smartcontractkit/chainlink-testing-framework/client" + ctfClient "github.com/smartcontractkit/chainlink-testing-framework/lib/client" "github.com/smartcontractkit/chainlink/integration-tests/client" "github.com/smartcontractkit/chainlink/integration-tests/contracts" + tc "github.com/smartcontractkit/chainlink/integration-tests/testconfig" + "github.com/smartcontractkit/chainlink/integration-tests/testconfig/ocr" ) // This actions file often returns functions, rather than just values. These are used as common test helpers, and are @@ -217,3 +227,57 @@ func BuildNodeContractPairID(node contracts.ChainlinkNodeWithKeysAndAddress, ocr shortOCRAddr := ocrInstance.Address()[2:12] return strings.ToLower(fmt.Sprintf("node_%s_contract_%s", shortNodeAddr, shortOCRAddr)), nil } + +func SetupOCRv1Cluster( + l zerolog.Logger, + seth *seth.Client, + configWithLinkToken tc.LinkTokenContractConfig, + workerNodes []*client.ChainlinkK8sClient, +) (common.Address, error) { + err := FundChainlinkNodesFromRootAddress(l, seth, contracts.ChainlinkK8sClientToChainlinkNodeWithKeysAndAddress(workerNodes), big.NewFloat(3)) + if err != nil { + return common.Address{}, err + } + linkContract, err := LinkTokenContract(l, seth, configWithLinkToken) + if err != nil { + return common.Address{}, err + } + return common.HexToAddress(linkContract.Address()), nil +} + +func SetupOCRv1Feed( + l zerolog.Logger, + seth *seth.Client, + lta common.Address, + ocrContractsConfig ocr.OffChainAggregatorsConfig, + msClient *ctfClient.MockserverClient, + bootstrapNode *client.ChainlinkK8sClient, + workerNodes []*client.ChainlinkK8sClient, +) ([]contracts.OffchainAggregator, error) { + ocrInstances, err := SetupOCRv1Contracts(l, seth, ocrContractsConfig, lta, contracts.ChainlinkK8sClientToChainlinkNodeWithKeysAndAddress(workerNodes)) + if err != nil { + return nil, err + } + err = CreateOCRJobs(ocrInstances, bootstrapNode, workerNodes, 5, msClient, fmt.Sprint(seth.ChainID)) + if err != nil { + return nil, err + } + return ocrInstances, nil +} + +func SimulateOCRv1EAActivity( + l zerolog.Logger, + eaChangeInterval time.Duration, + ocrInstances []contracts.OffchainAggregator, + workerNodes []*client.ChainlinkK8sClient, + msClient *ctfClient.MockserverClient, +) { + go func() { + for { + time.Sleep(eaChangeInterval) + if err := SetAllAdapterResponsesToTheSameValue(rand.Intn(1000), ocrInstances, workerNodes, msClient); err != nil { + l.Error().Err(err).Msg("failed to update mockserver responses") + } + } + }() +} diff --git a/integration-tests/actions/ocr_helpers_local.go b/integration-tests/actions/ocr_helpers_local.go index 0b415277f27..b546139dc32 100644 --- a/integration-tests/actions/ocr_helpers_local.go +++ b/integration-tests/actions/ocr_helpers_local.go @@ -10,7 +10,7 @@ import ( "github.com/google/uuid" "golang.org/x/sync/errgroup" - "github.com/smartcontractkit/chainlink-testing-framework/docker/test_env" + "github.com/smartcontractkit/chainlink-testing-framework/lib/docker/test_env" "github.com/smartcontractkit/chainlink/integration-tests/client" "github.com/smartcontractkit/chainlink/integration-tests/contracts" diff --git a/integration-tests/actions/private_network.go b/integration-tests/actions/private_network.go index 70239a60060..40fe317ab3f 100644 --- a/integration-tests/actions/private_network.go +++ b/integration-tests/actions/private_network.go @@ -3,8 +3,9 @@ package actions import ( "github.com/rs/zerolog" - ctf_config "github.com/smartcontractkit/chainlink-testing-framework/config" - ctf_test_env "github.com/smartcontractkit/chainlink-testing-framework/docker/test_env" + ctf_config "github.com/smartcontractkit/chainlink-testing-framework/lib/config" + ctf_config_types "github.com/smartcontractkit/chainlink-testing-framework/lib/config/types" + ctf_test_env "github.com/smartcontractkit/chainlink-testing-framework/lib/docker/test_env" ) func EthereumNetworkConfigFromConfig(l zerolog.Logger, config ctf_config.GlobalTestConfig) (network ctf_test_env.EthereumNetwork, err error) { @@ -12,8 +13,8 @@ func EthereumNetworkConfigFromConfig(l zerolog.Logger, config ctf_config.GlobalT l.Warn().Msg("No TOML private ethereum network config found, will use old geth") ethBuilder := ctf_test_env.NewEthereumNetworkBuilder() network, err = ethBuilder. - WithEthereumVersion(ctf_config.EthereumVersion_Eth1). - WithExecutionLayer(ctf_config.ExecutionLayer_Geth). + WithEthereumVersion(ctf_config_types.EthereumVersion_Eth1). + WithExecutionLayer(ctf_config_types.ExecutionLayer_Geth). Build() return diff --git a/integration-tests/actions/refund.go b/integration-tests/actions/refund.go index 38c4dfad3b9..bcdf6a380d8 100644 --- a/integration-tests/actions/refund.go +++ b/integration-tests/actions/refund.go @@ -16,9 +16,10 @@ import ( "github.com/ethereum/go-ethereum/crypto" "github.com/pkg/errors" "github.com/rs/zerolog" - "github.com/smartcontractkit/seth" - "github.com/smartcontractkit/chainlink-testing-framework/blockchain" + "github.com/smartcontractkit/chainlink-testing-framework/seth" + + "github.com/smartcontractkit/chainlink-testing-framework/lib/blockchain" clClient "github.com/smartcontractkit/chainlink/integration-tests/client" "github.com/smartcontractkit/chainlink/integration-tests/contracts" @@ -233,6 +234,14 @@ func (r *OvershotTransferRetrier) Retry(ctx context.Context, logger zerolog.Logg // of strategies to attempt to return funds, including retrying with less funds if the transaction fails due to // insufficient funds, and retrying with a higher gas limit if the transaction fails due to gas too low. func ReturnFundsFromNodes(log zerolog.Logger, client *seth.Client, chainlinkNodes []contracts.ChainlinkNodeWithKeysAndAddress) error { + var keyExporters []contracts.ChainlinkKeyExporter + for _, node := range chainlinkNodes { + keyExporters = append(keyExporters, node) + } + return ReturnFundsFromKeyExporterNodes(log, client, keyExporters) +} + +func ReturnFundsFromKeyExporterNodes(log zerolog.Logger, client *seth.Client, chainlinkNodes []contracts.ChainlinkKeyExporter) error { if client == nil { return fmt.Errorf("seth client is nil, unable to return funds from chainlink nodes") } diff --git a/integration-tests/actions/vrf/common/actions.go b/integration-tests/actions/vrf/common/actions.go index e599c705ef0..67d13264c17 100644 --- a/integration-tests/actions/vrf/common/actions.go +++ b/integration-tests/actions/vrf/common/actions.go @@ -10,16 +10,19 @@ import ( "testing" "time" + "github.com/smartcontractkit/chainlink/integration-tests/utils" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" "github.com/go-resty/resty/v2" "github.com/google/uuid" "github.com/rs/zerolog" - "github.com/smartcontractkit/seth" - ctf_test_env "github.com/smartcontractkit/chainlink-testing-framework/docker/test_env" - "github.com/smartcontractkit/chainlink-testing-framework/utils/conversions" - seth_utils "github.com/smartcontractkit/chainlink-testing-framework/utils/seth" + "github.com/smartcontractkit/chainlink-testing-framework/seth" + + ctf_test_env "github.com/smartcontractkit/chainlink-testing-framework/lib/docker/test_env" + "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/conversions" + "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/testcontext" "github.com/smartcontractkit/chainlink/integration-tests/actions" "github.com/smartcontractkit/chainlink/integration-tests/client" @@ -366,7 +369,7 @@ func BuildNewCLEnvForVRF(l zerolog.Logger, t *testing.T, envConfig VRFEnvConfig, if err != nil { return nil, nil, fmt.Errorf("%s, err: %w", "error getting first evm network", err) } - sethClient, err := seth_utils.GetChainClient(envConfig.TestConfig, *evmNetwork) + sethClient, err := utils.TestAwareSethClient(t, envConfig.TestConfig, evmNetwork) if err != nil { return nil, nil, fmt.Errorf("%s, err: %w", "error getting seth client", err) } @@ -384,6 +387,35 @@ func BuildNewCLEnvForVRF(l zerolog.Logger, t *testing.T, envConfig VRFEnvConfig, return env, sethClient, nil } +func LoadExistingCLEnvForVRF( + t *testing.T, + envConfig VRFEnvConfig, + commonExistingEnvConfig *vrf_common_config.ExistingEnvConfig, + l zerolog.Logger, +) (*test_env.CLClusterTestEnv, *seth.Client, error) { + env, err := test_env.NewCLTestEnvBuilder(). + WithTestInstance(t). + WithTestConfig(&envConfig.TestConfig). + WithCustomCleanup(envConfig.CleanupFn). + Build() + if err != nil { + return nil, nil, fmt.Errorf("%s, err: %w", "error creating test env", err) + } + evmNetwork, err := env.GetFirstEvmNetwork() + if err != nil { + return nil, nil, err + } + sethClient, err := utils.TestAwareSethClient(t, envConfig.TestConfig, evmNetwork) + if err != nil { + return nil, nil, err + } + err = FundNodesIfNeeded(testcontext.Get(t), commonExistingEnvConfig, sethClient, l) + if err != nil { + return nil, nil, err + } + return env, sethClient, nil +} + func GetRPCUrl(env *test_env.CLClusterTestEnv, chainID int64) (string, error) { provider, err := env.GetRpcProvider(chainID) if err != nil { @@ -399,7 +431,7 @@ type RPCRawClient struct { } func NewRPCRawClient(url string) *RPCRawClient { - isDebug := os.Getenv("DEBUG_RESTY") == "true" + isDebug := os.Getenv("RESTY_DEBUG") == "true" restyClient := resty.New().SetDebug(isDebug).SetBaseURL(url) return &RPCRawClient{ resty: restyClient, diff --git a/integration-tests/actions/vrf/common/models.go b/integration-tests/actions/vrf/common/models.go index 9baa5c96e1d..f51fd84ba07 100644 --- a/integration-tests/actions/vrf/common/models.go +++ b/integration-tests/actions/vrf/common/models.go @@ -55,6 +55,7 @@ type VRFContracts struct { VRFV2PlusConsumer []contracts.VRFv2PlusLoadTestConsumer LinkToken contracts.LinkToken MockETHLINKFeed contracts.VRFMockETHLINKFeed + LinkNativeFeedAddress string } type VRFOwnerConfig struct { diff --git a/integration-tests/actions/vrf/vrfv1/actions.go b/integration-tests/actions/vrf/vrfv1/actions.go index 67110c543e5..f5fae76a395 100644 --- a/integration-tests/actions/vrf/vrfv1/actions.go +++ b/integration-tests/actions/vrf/vrfv1/actions.go @@ -3,7 +3,7 @@ package vrfv1 import ( "fmt" - "github.com/smartcontractkit/seth" + "github.com/smartcontractkit/chainlink-testing-framework/seth" "github.com/smartcontractkit/chainlink/integration-tests/contracts" ) diff --git a/integration-tests/actions/vrf/vrfv2/contract_steps.go b/integration-tests/actions/vrf/vrfv2/contract_steps.go index 324b65b5d6c..25239537f4e 100644 --- a/integration-tests/actions/vrf/vrfv2/contract_steps.go +++ b/integration-tests/actions/vrf/vrfv2/contract_steps.go @@ -11,9 +11,9 @@ import ( "github.com/rs/zerolog" "github.com/shopspring/decimal" - "github.com/smartcontractkit/seth" + "github.com/smartcontractkit/chainlink-testing-framework/seth" - "github.com/smartcontractkit/chainlink-testing-framework/utils/conversions" + "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/conversions" "github.com/smartcontractkit/chainlink/integration-tests/actions" vrfcommon "github.com/smartcontractkit/chainlink/integration-tests/actions/vrf/common" "github.com/smartcontractkit/chainlink/integration-tests/client" @@ -635,7 +635,7 @@ func SetupNewConsumersAndSubs( ) ([]contracts.VRFv2LoadTestConsumer, []uint64, error) { consumers, err := DeployVRFV2Consumers(sethClient, coordinator.Address(), numberOfConsumerContractsToDeployAndAddToSub) if err != nil { - return nil, nil, fmt.Errorf("err: %w", err) + return nil, nil, err } l.Info(). Str("Coordinator", *testConfig.VRFv2.ExistingEnvConfig.ExistingEnvConfig.CoordinatorAddress). @@ -649,7 +649,7 @@ func SetupNewConsumersAndSubs( numberOfSubToCreate, ) if err != nil { - return nil, nil, fmt.Errorf("err: %w", err) + return nil, nil, err } return consumers, subIDs, nil } diff --git a/integration-tests/actions/vrf/vrfv2/setup_steps.go b/integration-tests/actions/vrf/vrfv2/setup_steps.go index c13aed807a9..f252f79ffc0 100644 --- a/integration-tests/actions/vrf/vrfv2/setup_steps.go +++ b/integration-tests/actions/vrf/vrfv2/setup_steps.go @@ -6,9 +6,7 @@ import ( "math/big" "testing" - "github.com/smartcontractkit/seth" - - seth_utils "github.com/smartcontractkit/chainlink-testing-framework/utils/seth" + "github.com/smartcontractkit/chainlink-testing-framework/seth" "github.com/ethereum/go-ethereum/common" "github.com/rs/zerolog" @@ -16,7 +14,7 @@ import ( "github.com/google/uuid" - "github.com/smartcontractkit/chainlink-testing-framework/utils/testcontext" + "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/testcontext" "github.com/smartcontractkit/chainlink/integration-tests/actions" "github.com/smartcontractkit/chainlink/integration-tests/docker/test_env" testconfig "github.com/smartcontractkit/chainlink/integration-tests/testconfig/vrfv2" @@ -44,7 +42,7 @@ func CreateVRFV2Job( } ost, err := os.String() if err != nil { - return nil, fmt.Errorf("%s, err %w", vrfcommon.ErrParseJob, err) + return nil, fmt.Errorf(vrfcommon.ErrGenericFormat, vrfcommon.ErrParseJob, err) } spec := &client.VRFV2JobSpec{ @@ -71,7 +69,7 @@ func CreateVRFV2Job( } job, err := chainlinkNode.MustCreateJob(spec) if err != nil { - return nil, fmt.Errorf("%s, err %w", ErrCreatingVRFv2Job, err) + return nil, fmt.Errorf(vrfcommon.ErrGenericFormat, ErrCreatingVRFv2Job, err) } return job, nil } @@ -115,15 +113,14 @@ func SetupVRFV2Environment( if err != nil { return nil, nil, nil, err } - l.Info().Str("Coordinator", vrfContracts.CoordinatorV2.Address()).Msg("Registering Proving Key") provingKey, err := VRFV2RegisterProvingKey(vrfKey, registerProvingKeyAgainstAddress, vrfContracts.CoordinatorV2) if err != nil { - return nil, nil, nil, fmt.Errorf("%s, err %w", vrfcommon.ErrRegisteringProvingKey, err) + return nil, nil, nil, fmt.Errorf(vrfcommon.ErrGenericFormat, vrfcommon.ErrRegisteringProvingKey, err) } keyHash, err := vrfContracts.CoordinatorV2.HashOfKey(ctx, provingKey) if err != nil { - return nil, nil, nil, fmt.Errorf("%s, err %w", vrfcommon.ErrCreatingProvingKeyHash, err) + return nil, nil, nil, fmt.Errorf(vrfcommon.ErrGenericFormat, vrfcommon.ErrCreatingProvingKeyHash, err) } vrfTXKeyAddressStrings, vrfTXKeyAddresses, err := vrfcommon.CreateFundAndGetSendingKeys( @@ -191,44 +188,47 @@ func SetupVRFV2Environment( return vrfContracts, &vrfKeyData, nodeTypeToNodeMap, nil } -func setupVRFNode(contracts *vrfcommon.VRFContracts, chainID *big.Int, vrfv2Config *testconfig.General, pubKeyCompressed string, vrfOwnerConfig *vrfcommon.VRFOwnerConfig, l zerolog.Logger, vrfNode *vrfcommon.VRFNode) error { +func setupVRFNode(contracts *vrfcommon.VRFContracts, chainID *big.Int, config *testconfig.General, pubKeyCompressed string, vrfOwnerConfig *vrfcommon.VRFOwnerConfig, l zerolog.Logger, vrfNode *vrfcommon.VRFNode) error { vrfJobSpecConfig := vrfcommon.VRFJobSpecConfig{ - ForwardingAllowed: *vrfv2Config.VRFJobForwardingAllowed, + ForwardingAllowed: *config.VRFJobForwardingAllowed, CoordinatorAddress: contracts.CoordinatorV2.Address(), BatchCoordinatorAddress: contracts.BatchCoordinatorV2.Address(), FromAddresses: vrfNode.TXKeyAddressStrings, EVMChainID: chainID.String(), - MinIncomingConfirmations: int(*vrfv2Config.MinimumConfirmations), + MinIncomingConfirmations: int(*config.MinimumConfirmations), PublicKey: pubKeyCompressed, - EstimateGasMultiplier: *vrfv2Config.VRFJobEstimateGasMultiplier, - BatchFulfillmentEnabled: *vrfv2Config.VRFJobBatchFulfillmentEnabled, - BatchFulfillmentGasMultiplier: *vrfv2Config.VRFJobBatchFulfillmentGasMultiplier, - PollPeriod: vrfv2Config.VRFJobPollPeriod.Duration, - RequestTimeout: vrfv2Config.VRFJobRequestTimeout.Duration, - SimulationBlock: vrfv2Config.VRFJobSimulationBlock, + EstimateGasMultiplier: *config.VRFJobEstimateGasMultiplier, + BatchFulfillmentEnabled: *config.VRFJobBatchFulfillmentEnabled, + BatchFulfillmentGasMultiplier: *config.VRFJobBatchFulfillmentGasMultiplier, + PollPeriod: config.VRFJobPollPeriod.Duration, + RequestTimeout: config.VRFJobRequestTimeout.Duration, + SimulationBlock: config.VRFJobSimulationBlock, VRFOwnerConfig: vrfOwnerConfig, } l.Info().Msg("Creating VRFV2 Job") - vrfV2job, err := CreateVRFV2Job( + job, err := CreateVRFV2Job( vrfNode.CLNode.API, vrfJobSpecConfig, ) if err != nil { return fmt.Errorf("%s, err %w", ErrCreateVRFV2Jobs, err) } - vrfNode.Job = vrfV2job + vrfNode.Job = job // this part is here because VRFv2 can work with only a specific key // [[EVM.KeySpecific]] // Key = '...' nodeConfig := node.NewConfig(vrfNode.CLNode.NodeConfig, - node.WithKeySpecificMaxGasPrice(vrfNode.TXKeyAddressStrings, *vrfv2Config.CLNodeMaxGasPriceGWei), + node.WithKeySpecificMaxGasPrice(vrfNode.TXKeyAddressStrings, *config.CLNodeMaxGasPriceGWei), ) - l.Info().Msg("Restarting Node with new sending key PriceMax configuration") + l.Info(). + Strs("Sending Keys", vrfNode.TXKeyAddressStrings). + Int64("Price Max Setting", *config.CLNodeMaxGasPriceGWei). + Msg("Restarting Node with new sending key PriceMax configuration") err = vrfNode.CLNode.Restart(nodeConfig) if err != nil { - return fmt.Errorf("%s, err %w", vrfcommon.ErrRestartCLNode, err) + return fmt.Errorf(vrfcommon.ErrGenericFormat, vrfcommon.ErrRestartCLNode, err) } return nil } @@ -371,38 +371,30 @@ func SetupVRFV2ForNewEnv( func SetupVRFV2ForExistingEnv(t *testing.T, envConfig vrfcommon.VRFEnvConfig, l zerolog.Logger) (*vrfcommon.VRFContracts, *vrfcommon.VRFKeyData, *test_env.CLClusterTestEnv, *seth.Client, error) { commonExistingEnvConfig := envConfig.TestConfig.VRFv2.ExistingEnvConfig.ExistingEnvConfig - env, err := test_env.NewCLTestEnvBuilder(). - WithTestInstance(t). - WithTestConfig(&envConfig.TestConfig). - WithCustomCleanup(envConfig.CleanupFn). - Build() - if err != nil { - return nil, nil, nil, nil, fmt.Errorf("%s, err: %w", "error creating test env", err) - } - evmNetwork, err := env.GetFirstEvmNetwork() - if err != nil { - return nil, nil, nil, nil, err - } - sethClient, err := seth_utils.GetChainClient(envConfig.TestConfig, *evmNetwork) + env, sethClient, err := vrfcommon.LoadExistingCLEnvForVRF( + t, + envConfig, + commonExistingEnvConfig, + l, + ) if err != nil { - return nil, nil, nil, nil, err + return nil, nil, nil, nil, fmt.Errorf("%s, err: %w", "error loading existing CL env", err) } - coordinator, err := contracts.LoadVRFCoordinatorV2(sethClient, *commonExistingEnvConfig.ConsumerAddress) + coordinator, err := contracts.LoadVRFCoordinatorV2(sethClient, *commonExistingEnvConfig.CoordinatorAddress) if err != nil { return nil, nil, nil, nil, fmt.Errorf("%s, err: %w", "error loading VRFCoordinator2", err) } - linkAddr := common.HexToAddress(*commonExistingEnvConfig.LinkAddress) - linkToken, err := contracts.LoadLinkTokenContract(l, sethClient, linkAddr) + linkAddress, err := coordinator.GetLinkAddress(testcontext.Get(t)) if err != nil { - return nil, nil, nil, nil, fmt.Errorf("%s, err: %w", "error loading LinkToken", err) + return nil, nil, nil, nil, fmt.Errorf("%s, err: %w", "error getting Link address from Coordinator", err) } - err = vrfcommon.FundNodesIfNeeded(testcontext.Get(t), commonExistingEnvConfig, sethClient, l) + linkToken, err := contracts.LoadLinkTokenContract(l, sethClient, common.HexToAddress(linkAddress.String())) if err != nil { - return nil, nil, nil, nil, fmt.Errorf("err: %w", err) + return nil, nil, nil, nil, fmt.Errorf("%s, err: %w", "error loading LinkToken", err) } blockHashStoreAddress, err := coordinator.GetBlockHashStoreAddress(testcontext.Get(t)) if err != nil { - return nil, nil, nil, nil, fmt.Errorf("err: %w", err) + return nil, nil, nil, nil, err } blockHashStore, err := contracts.LoadBlockHashStore(sethClient, blockHashStoreAddress.String()) if err != nil { @@ -449,13 +441,13 @@ func SetupSubsAndConsumersForExistingEnv( l, ) if err != nil { - return nil, nil, fmt.Errorf("err: %w", err) + return nil, nil, err } } else { addr := common.HexToAddress(*commonExistingEnvConfig.ConsumerAddress) consumer, err := contracts.LoadVRFv2LoadTestConsumer(sethClient, addr) if err != nil { - return nil, nil, fmt.Errorf("err: %w", err) + return nil, nil, err } consumers = append(consumers, consumer) subIDs = append(subIDs, *testConfig.VRFv2.ExistingEnvConfig.SubID) @@ -471,7 +463,7 @@ func SetupSubsAndConsumersForExistingEnv( l, ) if err != nil { - return nil, nil, fmt.Errorf("err: %w", err) + return nil, nil, err } } return subIDs, consumers, nil diff --git a/integration-tests/actions/vrf/vrfv2plus/contract_steps.go b/integration-tests/actions/vrf/vrfv2plus/contract_steps.go index 7e814ccceba..4dced9edf79 100644 --- a/integration-tests/actions/vrf/vrfv2plus/contract_steps.go +++ b/integration-tests/actions/vrf/vrfv2plus/contract_steps.go @@ -10,9 +10,10 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/rs/zerolog" "github.com/shopspring/decimal" - "github.com/smartcontractkit/seth" - "github.com/smartcontractkit/chainlink-testing-framework/utils/conversions" + "github.com/smartcontractkit/chainlink-testing-framework/seth" + + "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/conversions" "github.com/smartcontractkit/chainlink/integration-tests/actions" vrfcommon "github.com/smartcontractkit/chainlink/integration-tests/actions/vrf/common" "github.com/smartcontractkit/chainlink/integration-tests/client" @@ -24,6 +25,7 @@ import ( func DeployVRFV2_5Contracts( chainClient *seth.Client, + configGeneral *vrfv2plusconfig.General, ) (*vrfcommon.VRFContracts, error) { bhs, err := contracts.DeployBlockhashStore(chainClient) if err != nil { @@ -33,13 +35,47 @@ func DeployVRFV2_5Contracts( if err != nil { return nil, fmt.Errorf(vrfcommon.ErrGenericFormat, vrfcommon.ErrDeployBatchBlockHashStore, err) } - coordinator, err := contracts.DeployVRFCoordinatorV2_5(chainClient, bhs.Address()) - if err != nil { - return nil, fmt.Errorf(vrfcommon.ErrGenericFormat, ErrDeployCoordinatorV2Plus, err) + var coordinator contracts.VRFCoordinatorV2_5 + if actions.IsOPStackChain(chainClient.ChainID) { + opStackCoordinator, err := contracts.DeployVRFCoordinatorV2_5_Optimism(chainClient, bhs.Address()) + if err != nil { + return nil, fmt.Errorf(vrfcommon.ErrGenericFormat, ErrDeployCoordinatorV2Plus, err) + } + err = opStackCoordinator.SetL1FeeCalculation(*configGeneral.L1FeeCalculationMode, *configGeneral.L1FeeCoefficient) + if err != nil { + return nil, fmt.Errorf(vrfcommon.ErrGenericFormat, ErrSetL1FeeCalculation, err) + } + coordinator, err = contracts.LoadVRFCoordinatorV2_5(chainClient, opStackCoordinator.Address.String()) + if err != nil { + return nil, fmt.Errorf(vrfcommon.ErrGenericFormat, vrfcommon.ErrLoadingCoordinator, err) + } + } else if actions.IsArbitrumChain(chainClient.ChainID) { + arbitrumCoordinator, err := contracts.DeployVRFCoordinatorV2_5_Arbitrum(chainClient, bhs.Address()) + if err != nil { + return nil, fmt.Errorf(vrfcommon.ErrGenericFormat, ErrDeployCoordinatorV2Plus, err) + } + coordinator, err = contracts.LoadVRFCoordinatorV2_5(chainClient, arbitrumCoordinator.Address.String()) + if err != nil { + return nil, fmt.Errorf(vrfcommon.ErrGenericFormat, vrfcommon.ErrLoadingCoordinator, err) + } + } else if *configGeneral.UseTestCoordinator { + testCoordinator, err := contracts.DeployVRFCoordinatorTestV2_5(chainClient, bhs.Address()) + if err != nil { + return nil, fmt.Errorf(vrfcommon.ErrGenericFormat, ErrDeployCoordinatorV2Plus, err) + } + coordinator, err = contracts.LoadVRFCoordinatorV2_5(chainClient, testCoordinator.Address.String()) + if err != nil { + return nil, fmt.Errorf(vrfcommon.ErrGenericFormat, vrfcommon.ErrLoadingCoordinator, err) + } + } else { + coordinator, err = contracts.DeployVRFCoordinatorV2_5(chainClient, bhs.Address()) + if err != nil { + return nil, fmt.Errorf(vrfcommon.ErrGenericFormat, ErrDeployCoordinatorV2Plus, err) + } } batchCoordinator, err := contracts.DeployBatchVRFCoordinatorV2Plus(chainClient, coordinator.Address()) if err != nil { - return nil, fmt.Errorf("%s, err %w", ErrDeployBatchCoordinatorV2Plus, err) + return nil, fmt.Errorf(vrfcommon.ErrGenericFormat, ErrDeployBatchCoordinatorV2Plus, err) } return &vrfcommon.VRFContracts{ CoordinatorV2Plus: coordinator, @@ -390,14 +426,41 @@ func DeployVRFV2PlusDirectFundingContracts( linkTokenAddress string, linkEthFeedAddress string, coordinator contracts.VRFCoordinatorV2_5, - consumerContractsAmount int, + numberOfConsumerContracts int, wrapperSubId *big.Int, + configGeneral *vrfv2plusconfig.General, ) (*VRFV2PlusWrapperContracts, error) { - vrfv2PlusWrapper, err := contracts.DeployVRFV2PlusWrapper(sethClient, linkTokenAddress, linkEthFeedAddress, coordinator.Address(), wrapperSubId) - if err != nil { - return nil, fmt.Errorf(vrfcommon.ErrGenericFormat, ErrDeployWrapper, err) + var vrfv2PlusWrapper contracts.VRFV2PlusWrapper + var err error + if actions.IsOPStackChain(sethClient.ChainID) { + opStackWrapper, err := contracts.DeployVRFV2PlusWrapperOptimism(sethClient, linkTokenAddress, linkEthFeedAddress, coordinator.Address(), wrapperSubId) + if err != nil { + return nil, fmt.Errorf(vrfcommon.ErrGenericFormat, ErrDeployWrapper, err) + } + err = opStackWrapper.SetL1FeeCalculation(*configGeneral.L1FeeCalculationMode, *configGeneral.L1FeeCoefficient) + if err != nil { + return nil, fmt.Errorf(vrfcommon.ErrGenericFormat, ErrSetL1FeeCalculation, err) + } + vrfv2PlusWrapper, err = contracts.LoadVRFV2PlusWrapper(sethClient, opStackWrapper.Address.String()) + if err != nil { + return nil, fmt.Errorf(vrfcommon.ErrGenericFormat, vrfcommon.ErrLoadingCoordinator, err) + } + } else if actions.IsArbitrumChain(sethClient.ChainID) { + arbitrumWrapper, err := contracts.DeployVRFV2PlusWrapperArbitrum(sethClient, linkTokenAddress, linkEthFeedAddress, coordinator.Address(), wrapperSubId) + if err != nil { + return nil, fmt.Errorf(vrfcommon.ErrGenericFormat, ErrDeployCoordinatorV2Plus, err) + } + vrfv2PlusWrapper, err = contracts.LoadVRFV2PlusWrapper(sethClient, arbitrumWrapper.Address.String()) + if err != nil { + return nil, fmt.Errorf(vrfcommon.ErrGenericFormat, vrfcommon.ErrLoadingCoordinator, err) + } + } else { + vrfv2PlusWrapper, err = contracts.DeployVRFV2PlusWrapper(sethClient, linkTokenAddress, linkEthFeedAddress, coordinator.Address(), wrapperSubId) + if err != nil { + return nil, fmt.Errorf(vrfcommon.ErrGenericFormat, ErrDeployWrapper, err) + } } - consumers, err := DeployVRFV2PlusWrapperConsumers(sethClient, vrfv2PlusWrapper, consumerContractsAmount) + consumers, err := DeployVRFV2PlusWrapperConsumers(sethClient, vrfv2PlusWrapper, numberOfConsumerContracts) if err != nil { return nil, err } @@ -510,9 +573,9 @@ func WaitRandomWordsFulfilledEvent( return randomWordsFulfilledEvent, err } -func DeployVRFV2PlusWrapperConsumers(client *seth.Client, vrfV2PlusWrapper contracts.VRFV2PlusWrapper, consumerContractsAmount int) ([]contracts.VRFv2PlusWrapperLoadTestConsumer, error) { +func DeployVRFV2PlusWrapperConsumers(client *seth.Client, vrfV2PlusWrapper contracts.VRFV2PlusWrapper, numberOfConsumerContracts int) ([]contracts.VRFv2PlusWrapperLoadTestConsumer, error) { var consumers []contracts.VRFv2PlusWrapperLoadTestConsumer - for i := 1; i <= consumerContractsAmount; i++ { + for i := 1; i <= numberOfConsumerContracts; i++ { loadTestConsumer, err := contracts.DeployVRFV2PlusWrapperLoadTestConsumer(client, vrfV2PlusWrapper.Address()) if err != nil { return nil, fmt.Errorf(vrfcommon.ErrGenericFormat, ErrAdvancedConsumer, err) @@ -530,7 +593,7 @@ func SetupVRFV2PlusContracts( l zerolog.Logger, ) (*vrfcommon.VRFContracts, error) { l.Info().Msg("Deploying VRFV2 Plus contracts") - vrfContracts, err := DeployVRFV2_5Contracts(sethClient) + vrfContracts, err := DeployVRFV2_5Contracts(sethClient, configGeneral) if err != nil { return nil, fmt.Errorf(vrfcommon.ErrGenericFormat, ErrDeployVRFV2_5Contracts, err) } @@ -574,7 +637,7 @@ func SetupNewConsumersAndSubs( ) ([]contracts.VRFv2PlusLoadTestConsumer, []*big.Int, error) { consumers, err := DeployVRFV2PlusConsumers(sethClient, coordinator, consumerContractsAmount) if err != nil { - return nil, nil, fmt.Errorf("err: %w", err) + return nil, nil, err } l.Info(). Str("Coordinator", *testConfig.VRFv2Plus.ExistingEnvConfig.ExistingEnvConfig.CoordinatorAddress). @@ -592,7 +655,7 @@ func SetupNewConsumersAndSubs( *testConfig.VRFv2Plus.General.SubscriptionBillingType, ) if err != nil { - return nil, nil, fmt.Errorf("err: %w", err) + return nil, nil, err } return consumers, subIDs, nil } @@ -617,3 +680,57 @@ func CancelSubsAndReturnFunds(ctx context.Context, vrfContracts *vrfcommon.VRFCo } } } + +func FundWrapperConsumer( + sethClient *seth.Client, + subFundingType string, + linkToken contracts.LinkToken, + wrapperConsumer contracts.VRFv2PlusWrapperLoadTestConsumer, + vrfv2PlusConfig *vrfv2plusconfig.General, + l zerolog.Logger, +) error { + fundConsumerWithLink := func() error { + //fund consumer with Link + linkAmount := big.NewInt(0).Mul(big.NewInt(1e18), big.NewInt(*vrfv2PlusConfig.WrapperConsumerFundingAmountLink)) + l.Info(). + Str("Link Amount", linkAmount.String()). + Str("WrapperConsumerAddress", wrapperConsumer.Address()).Msg("Funding WrapperConsumer with Link") + return linkToken.Transfer( + wrapperConsumer.Address(), + linkAmount, + ) + } + fundConsumerWithNative := func() error { + //fund consumer with Eth (native token) + _, err := actions.SendFunds(l, sethClient, actions.FundsToSendPayload{ + ToAddress: common.HexToAddress(wrapperConsumer.Address()), + Amount: conversions.EtherToWei(big.NewFloat(*vrfv2PlusConfig.WrapperConsumerFundingAmountNativeToken)), + PrivateKey: sethClient.PrivateKeys[0], + }) + return err + } + switch vrfv2plusconfig.BillingType(subFundingType) { + case vrfv2plusconfig.BillingType_Link: + err := fundConsumerWithLink() + if err != nil { + return err + } + case vrfv2plusconfig.BillingType_Native: + err := fundConsumerWithNative() + if err != nil { + return err + } + case vrfv2plusconfig.BillingType_Link_and_Native: + err := fundConsumerWithLink() + if err != nil { + return err + } + err = fundConsumerWithNative() + if err != nil { + return err + } + default: + return fmt.Errorf("invalid billing type: %s", subFundingType) + } + return nil +} diff --git a/integration-tests/actions/vrf/vrfv2plus/errors.go b/integration-tests/actions/vrf/vrfv2plus/errors.go index 250c4da85a7..a2802032ec9 100644 --- a/integration-tests/actions/vrf/vrfv2plus/errors.go +++ b/integration-tests/actions/vrf/vrfv2plus/errors.go @@ -16,4 +16,5 @@ const ( ErrLinkTotalBalance = "error waiting for RandomWordsFulfilled event" ErrNativeTokenBalance = "error waiting for RandomWordsFulfilled event" ErrDeployWrapper = "error deploying VRFV2PlusWrapper" + ErrSetL1FeeCalculation = "error setting L1 fee calculation" ) diff --git a/integration-tests/actions/vrf/vrfv2plus/logging_helpers.go b/integration-tests/actions/vrf/vrfv2plus/logging_helpers.go index 1c6e2edaa0a..758200f86f4 100644 --- a/integration-tests/actions/vrf/vrfv2plus/logging_helpers.go +++ b/integration-tests/actions/vrf/vrfv2plus/logging_helpers.go @@ -4,9 +4,11 @@ import ( "fmt" "math/big" + "github.com/ethereum/go-ethereum/core/types" "github.com/rs/zerolog" "github.com/smartcontractkit/chainlink/integration-tests/contracts" + tc "github.com/smartcontractkit/chainlink/integration-tests/testconfig" vrfv2plus_config "github.com/smartcontractkit/chainlink/integration-tests/testconfig/vrfv2plus" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_coordinator_v2_5" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_v2plus_upgraded_version" @@ -55,3 +57,18 @@ func LogSubDetailsAfterMigration(l zerolog.Logger, newCoordinator contracts.Coor Interface("Subscription Consumers", migratedSubscription.Consumers). Msg("Subscription Data After Migration to New Coordinator") } + +func LogPaymentDetails(l zerolog.Logger, fulfillmentTxFeeWei *big.Int, fulfillmentTxReceipt *types.Receipt, actualSubPaymentWei *big.Int, expectedSubPaymentWei *big.Float, configCopy tc.TestConfig) { + l.Info(). + Str("Tx Fee in Wei", fulfillmentTxFeeWei.String()). + Str("Effective Gas Price", fulfillmentTxReceipt.EffectiveGasPrice.String()). + Uint64("Gas Used", fulfillmentTxReceipt.GasUsed). + Str("Actual Subscription Payment in Wei", actualSubPaymentWei.String()). + Str("Expected Subscription Payment in Wei", expectedSubPaymentWei.String()). + Uint8("Native Premium Percentage", *configCopy.VRFv2Plus.General.NativePremiumPercentage). + Uint8("Link Premium Percentage", *configCopy.VRFv2Plus.General.LinkPremiumPercentage). + Uint32("FulfillmentFlatFeeNativePPM", *configCopy.VRFv2Plus.General.FulfillmentFlatFeeNativePPM). + Uint32("FulfillmentFlatFeeLinkDiscountPPM", *configCopy.VRFv2Plus.General.FulfillmentFlatFeeLinkDiscountPPM). + Uint32("GasAfterPaymentCalculation", *configCopy.VRFv2Plus.General.GasAfterPaymentCalculation). + Msg("Randomness Fulfillment Payment Details") +} diff --git a/integration-tests/actions/vrf/vrfv2plus/models.go b/integration-tests/actions/vrf/vrfv2plus/models.go index a2ca8ec582b..5198439c050 100644 --- a/integration-tests/actions/vrf/vrfv2plus/models.go +++ b/integration-tests/actions/vrf/vrfv2plus/models.go @@ -5,6 +5,6 @@ import ( ) type VRFV2PlusWrapperContracts struct { - VRFV2PlusWrapper contracts.VRFV2PlusWrapper - LoadTestConsumers []contracts.VRFv2PlusWrapperLoadTestConsumer + VRFV2PlusWrapper contracts.VRFV2PlusWrapper + WrapperConsumers []contracts.VRFv2PlusWrapperLoadTestConsumer } diff --git a/integration-tests/actions/vrf/vrfv2plus/setup_steps.go b/integration-tests/actions/vrf/vrfv2plus/setup_steps.go index 8a3661ed110..c88c7fdb125 100644 --- a/integration-tests/actions/vrf/vrfv2plus/setup_steps.go +++ b/integration-tests/actions/vrf/vrfv2plus/setup_steps.go @@ -6,9 +6,7 @@ import ( "math/big" "testing" - "github.com/smartcontractkit/seth" - - seth_utils "github.com/smartcontractkit/chainlink-testing-framework/utils/seth" + "github.com/smartcontractkit/chainlink-testing-framework/seth" "github.com/shopspring/decimal" "golang.org/x/sync/errgroup" @@ -17,8 +15,7 @@ import ( "github.com/google/uuid" "github.com/rs/zerolog" - "github.com/smartcontractkit/chainlink-testing-framework/utils/conversions" - "github.com/smartcontractkit/chainlink-testing-framework/utils/testcontext" + "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/testcontext" "github.com/smartcontractkit/chainlink/integration-tests/actions" vrfcommon "github.com/smartcontractkit/chainlink/integration-tests/actions/vrf/common" tc "github.com/smartcontractkit/chainlink/integration-tests/testconfig" @@ -28,7 +25,7 @@ import ( "github.com/smartcontractkit/chainlink/integration-tests/client" "github.com/smartcontractkit/chainlink/integration-tests/contracts" "github.com/smartcontractkit/chainlink/integration-tests/docker/test_env" - vrfv2plus_config "github.com/smartcontractkit/chainlink/integration-tests/testconfig/vrfv2plus" + vrfv2plusconfig "github.com/smartcontractkit/chainlink/integration-tests/testconfig/vrfv2plus" "github.com/smartcontractkit/chainlink/integration-tests/types" ) @@ -66,12 +63,10 @@ func CreateVRFV2PlusJob( if vrfJobSpecConfig.BatchFulfillmentEnabled { jobSpec.BatchCoordinatorAddress = vrfJobSpecConfig.BatchCoordinatorAddress } - job, err := chainlinkNode.MustCreateJob(&jobSpec) if err != nil { return nil, fmt.Errorf(vrfcommon.ErrGenericFormat, ErrCreatingVRFv2PlusJob, err) } - return job, nil } @@ -90,7 +85,6 @@ func SetupVRFV2_5Environment( ) (*vrfcommon.VRFContracts, *vrfcommon.VRFKeyData, map[vrfcommon.VRFNodeType]*vrfcommon.VRFNode, error) { l.Info().Msg("Starting VRFV2 Plus environment setup") configGeneral := vrfv2PlusTestConfig.GetVRFv2PlusConfig().General - vrfContracts, err := SetupVRFV2PlusContracts( sethClient, linkToken, @@ -201,7 +195,7 @@ func SetupVRFV2_5Environment( return vrfContracts, &vrfKeyData, nodeTypeToNodeMap, nil } -func setupVRFNode(contracts *vrfcommon.VRFContracts, chainID *big.Int, config *vrfv2plus_config.General, pubKeyCompressed string, l zerolog.Logger, vrfNode *vrfcommon.VRFNode) error { +func setupVRFNode(contracts *vrfcommon.VRFContracts, chainID *big.Int, config *vrfv2plusconfig.General, pubKeyCompressed string, l zerolog.Logger, vrfNode *vrfcommon.VRFNode) error { vrfJobSpecConfig := vrfcommon.VRFJobSpecConfig{ ForwardingAllowed: *config.VRFJobForwardingAllowed, CoordinatorAddress: contracts.CoordinatorV2Plus.Address(), @@ -235,7 +229,10 @@ func setupVRFNode(contracts *vrfcommon.VRFContracts, chainID *big.Int, config *v nodeConfig := node.NewConfig(vrfNode.CLNode.NodeConfig, node.WithKeySpecificMaxGasPrice(vrfNode.TXKeyAddressStrings, *config.CLNodeMaxGasPriceGWei), ) - l.Info().Msg("Restarting Node with new sending key PriceMax configuration") + l.Info(). + Strs("Sending Keys", vrfNode.TXKeyAddressStrings). + Int64("Price Max Setting", *config.CLNodeMaxGasPriceGWei). + Msg("Restarting Node with new sending key PriceMax configuration") err = vrfNode.CLNode.Restart(nodeConfig) if err != nil { return fmt.Errorf(vrfcommon.ErrGenericFormat, vrfcommon.ErrRestartCLNode, err) @@ -243,42 +240,131 @@ func setupVRFNode(contracts *vrfcommon.VRFContracts, chainID *big.Int, config *v return nil } -func SetupVRFV2PlusWrapperEnvironment( +func SetupVRFV2PlusWrapperForExistingEnv( ctx context.Context, + sethClient *seth.Client, + vrfContracts *vrfcommon.VRFContracts, + keyHash [32]byte, + vrfv2PlusTestConfig types.VRFv2PlusTestConfig, + numberOfConsumerContracts int, l zerolog.Logger, +) (*VRFV2PlusWrapperContracts, *big.Int, error) { + config := *vrfv2PlusTestConfig.GetVRFv2PlusConfig() + var wrapper contracts.VRFV2PlusWrapper + var err error + if *config.ExistingEnvConfig.UseExistingWrapper { + wrapper, err = contracts.LoadVRFV2PlusWrapper(sethClient, *config.ExistingEnvConfig.WrapperAddress) + if err != nil { + return nil, nil, fmt.Errorf(vrfcommon.ErrGenericFormat, "error loading VRFV2PlusWrapper", err) + } + } else { + wrapperSubId, err := CreateSubAndFindSubID(ctx, sethClient, vrfContracts.CoordinatorV2Plus) + if err != nil { + return nil, nil, err + } + wrapper, err = contracts.DeployVRFV2PlusWrapper(sethClient, vrfContracts.LinkToken.Address(), vrfContracts.LinkNativeFeedAddress, vrfContracts.CoordinatorV2Plus.Address(), wrapperSubId) + if err != nil { + return nil, nil, fmt.Errorf(vrfcommon.ErrGenericFormat, ErrDeployWrapper, err) + } + err = FundSubscriptions( + big.NewFloat(*config.General.SubscriptionFundingAmountNative), + big.NewFloat(*config.General.SubscriptionFundingAmountLink), + vrfContracts.LinkToken, + vrfContracts.CoordinatorV2Plus, + []*big.Int{wrapperSubId}, + *config.General.SubscriptionBillingType, + ) + if err != nil { + return nil, nil, err + } + err = vrfContracts.CoordinatorV2Plus.AddConsumer(wrapperSubId, wrapper.Address()) + if err != nil { + return nil, nil, err + } + err = wrapper.SetConfig( + *config.General.WrapperGasOverhead, + *config.General.CoordinatorGasOverheadNative, + *config.General.CoordinatorGasOverheadLink, + *config.General.CoordinatorGasOverheadPerWord, + *config.General.CoordinatorNativePremiumPercentage, + *config.General.CoordinatorLinkPremiumPercentage, + keyHash, + *config.General.WrapperMaxNumberOfWords, + *config.General.StalenessSeconds, + decimal.RequireFromString(*config.General.FallbackWeiPerUnitLink).BigInt(), + *config.General.FulfillmentFlatFeeNativePPM, + *config.General.FulfillmentFlatFeeLinkDiscountPPM, + ) + if err != nil { + return nil, nil, err + } + } + wrapperSubID, err := wrapper.GetSubID(ctx) + if err != nil { + return nil, nil, fmt.Errorf(vrfcommon.ErrGenericFormat, "error getting subID", err) + } + var wrapperConsumers []contracts.VRFv2PlusWrapperLoadTestConsumer + if *config.ExistingEnvConfig.CreateFundAddWrapperConsumers { + wrapperConsumers, err = DeployVRFV2PlusWrapperConsumers(sethClient, wrapper, numberOfConsumerContracts) + if err != nil { + return nil, nil, err + } + } else { + wrapperConsumer, err := contracts.LoadVRFV2WrapperLoadTestConsumer(sethClient, *config.ExistingEnvConfig.WrapperConsumerAddress) + if err != nil { + return nil, nil, fmt.Errorf(vrfcommon.ErrGenericFormat, "error loading VRFV2WrapperLoadTestConsumer", err) + } + wrapperConsumers = append(wrapperConsumers, wrapperConsumer) + } + wrapperContracts := &VRFV2PlusWrapperContracts{wrapper, wrapperConsumers} + for _, consumer := range wrapperConsumers { + err = FundWrapperConsumer( + sethClient, + *config.General.SubscriptionBillingType, + vrfContracts.LinkToken, + consumer, + config.General, + l, + ) + if err != nil { + return nil, nil, err + } + } + return wrapperContracts, wrapperSubID, nil +} + +func SetupVRFV2PlusWrapperForNewEnv( + ctx context.Context, sethClient *seth.Client, vrfv2PlusTestConfig types.VRFv2PlusTestConfig, - linkToken contracts.LinkToken, - mockNativeLINKFeed contracts.MockETHLINKFeed, - coordinator contracts.VRFCoordinatorV2_5, + vrfContracts *vrfcommon.VRFContracts, keyHash [32]byte, wrapperConsumerContractsAmount int, + l zerolog.Logger, ) (*VRFV2PlusWrapperContracts, *big.Int, error) { // external EOA has to create a subscription for the wrapper first - wrapperSubId, err := CreateSubAndFindSubID(ctx, sethClient, coordinator) + wrapperSubId, err := CreateSubAndFindSubID(ctx, sethClient, vrfContracts.CoordinatorV2Plus) if err != nil { return nil, nil, err } - vrfv2PlusConfig := vrfv2PlusTestConfig.GetVRFv2PlusConfig().General wrapperContracts, err := DeployVRFV2PlusDirectFundingContracts( sethClient, - linkToken.Address(), - mockNativeLINKFeed.Address(), - coordinator, + vrfContracts.LinkToken.Address(), + vrfContracts.MockETHLINKFeed.Address(), + vrfContracts.CoordinatorV2Plus, wrapperConsumerContractsAmount, wrapperSubId, + vrfv2PlusConfig, ) if err != nil { - return nil, nil, fmt.Errorf(vrfcommon.ErrGenericFormat, vrfcommon.ErrWaitTXsComplete, err) + return nil, nil, err } - // once the wrapper is deployed, wrapper address will become consumer of external EOA subscription - err = coordinator.AddConsumer(wrapperSubId, wrapperContracts.VRFV2PlusWrapper.Address()) + err = vrfContracts.CoordinatorV2Plus.AddConsumer(wrapperSubId, wrapperContracts.VRFV2PlusWrapper.Address()) if err != nil { return nil, nil, err } - err = wrapperContracts.VRFV2PlusWrapper.SetConfig( *vrfv2PlusConfig.WrapperGasOverhead, *vrfv2PlusConfig.CoordinatorGasOverheadNative, @@ -296,53 +382,35 @@ func SetupVRFV2PlusWrapperEnvironment( if err != nil { return nil, nil, err } - //fund sub wrapperSubID, err := wrapperContracts.VRFV2PlusWrapper.GetSubID(ctx) if err != nil { return nil, nil, err } - err = FundSubscriptions( big.NewFloat(*vrfv2PlusTestConfig.GetVRFv2PlusConfig().General.SubscriptionFundingAmountNative), big.NewFloat(*vrfv2PlusTestConfig.GetVRFv2PlusConfig().General.SubscriptionFundingAmountLink), - linkToken, - coordinator, + vrfContracts.LinkToken, + vrfContracts.CoordinatorV2Plus, []*big.Int{wrapperSubID}, *vrfv2PlusConfig.SubscriptionBillingType, ) if err != nil { return nil, nil, err } - - //fund consumer with Link - err = linkToken.Transfer( - wrapperContracts.LoadTestConsumers[0].Address(), - big.NewInt(0).Mul(big.NewInt(1e18), big.NewInt(*vrfv2PlusConfig.WrapperConsumerFundingAmountLink)), - ) - if err != nil { - return nil, nil, err - } - - //fund consumer with Eth (native token) - _, err = actions.SendFunds(l, sethClient, actions.FundsToSendPayload{ - ToAddress: common.HexToAddress(wrapperContracts.LoadTestConsumers[0].Address()), - Amount: conversions.EtherToWei(big.NewFloat(*vrfv2PlusConfig.WrapperConsumerFundingAmountNativeToken)), - PrivateKey: sethClient.PrivateKeys[0], - }) - if err != nil { - return nil, nil, err - } - - wrapperConsumerBalanceBeforeRequestWei, err := sethClient.Client.BalanceAt(ctx, common.HexToAddress(wrapperContracts.LoadTestConsumers[0].Address()), nil) - if err != nil { - return nil, nil, err + for _, consumer := range wrapperContracts.WrapperConsumers { + err = FundWrapperConsumer( + sethClient, + *vrfv2PlusConfig.SubscriptionBillingType, + vrfContracts.LinkToken, + consumer, + vrfv2PlusConfig, + l, + ) + if err != nil { + return nil, nil, err + } } - l.Info(). - Str("WrapperConsumerBalanceBeforeRequestWei", wrapperConsumerBalanceBeforeRequestWei.String()). - Str("WrapperConsumerAddress", wrapperContracts.LoadTestConsumers[0].Address()). - Msg("WrapperConsumerBalanceBeforeRequestWei") - return wrapperContracts, wrapperSubID, nil } @@ -420,47 +488,45 @@ func SetupVRFV2PlusForNewEnv( func SetupVRFV2PlusForExistingEnv(t *testing.T, envConfig vrfcommon.VRFEnvConfig, l zerolog.Logger) (*vrfcommon.VRFContracts, *vrfcommon.VRFKeyData, *test_env.CLClusterTestEnv, *seth.Client, error) { commonExistingEnvConfig := envConfig.TestConfig.VRFv2Plus.ExistingEnvConfig.ExistingEnvConfig - env, err := test_env.NewCLTestEnvBuilder(). - WithTestInstance(t). - WithTestConfig(&envConfig.TestConfig). - WithCustomCleanup(envConfig.CleanupFn). - Build() - if err != nil { - return nil, nil, nil, nil, fmt.Errorf("%s, err: %w", "error creating test env", err) - } - evmNetwork, err := env.GetFirstEvmNetwork() - if err != nil { - return nil, nil, nil, nil, err - } - sethClient, err := seth_utils.GetChainClient(envConfig.TestConfig, *evmNetwork) + env, sethClient, err := vrfcommon.LoadExistingCLEnvForVRF( + t, + envConfig, + commonExistingEnvConfig, + l, + ) if err != nil { - return nil, nil, nil, nil, err + return nil, nil, nil, nil, fmt.Errorf("%s, err: %w", "error loading existing CL env", err) } coordinator, err := contracts.LoadVRFCoordinatorV2_5(sethClient, *commonExistingEnvConfig.CoordinatorAddress) if err != nil { return nil, nil, nil, nil, fmt.Errorf("%s, err: %w", "error loading VRFCoordinator2_5", err) } - linkToken, err := contracts.LoadLinkTokenContract(l, sethClient, common.HexToAddress(*commonExistingEnvConfig.LinkAddress)) + linkAddress, err := coordinator.GetLinkAddress(testcontext.Get(t)) + if err != nil { + return nil, nil, nil, nil, fmt.Errorf("%s, err: %w", "error getting Link address from Coordinator", err) + } + linkToken, err := contracts.LoadLinkTokenContract(l, sethClient, common.HexToAddress(linkAddress.String())) if err != nil { return nil, nil, nil, nil, fmt.Errorf("%s, err: %w", "error loading LinkToken", err) } - err = vrfcommon.FundNodesIfNeeded(testcontext.Get(t), commonExistingEnvConfig, sethClient, l) + linkNativeFeedAddress, err := coordinator.GetLinkNativeFeed(testcontext.Get(t)) if err != nil { - return nil, nil, nil, nil, fmt.Errorf("err: %w", err) + return nil, nil, nil, nil, fmt.Errorf("%s, err: %w", "error getting Link address from Coordinator", err) } blockHashStoreAddress, err := coordinator.GetBlockHashStoreAddress(testcontext.Get(t)) if err != nil { - return nil, nil, nil, nil, fmt.Errorf("err: %w", err) + return nil, nil, nil, nil, err } blockHashStore, err := contracts.LoadBlockHashStore(sethClient, blockHashStoreAddress.String()) if err != nil { return nil, nil, nil, nil, fmt.Errorf("%s, err: %w", "error loading BlockHashStore", err) } vrfContracts := &vrfcommon.VRFContracts{ - CoordinatorV2Plus: coordinator, - VRFV2PlusConsumer: nil, - LinkToken: linkToken, - BHS: blockHashStore, + CoordinatorV2Plus: coordinator, + VRFV2PlusConsumer: nil, + LinkToken: linkToken, + BHS: blockHashStore, + LinkNativeFeedAddress: linkNativeFeedAddress.String(), } vrfKey := &vrfcommon.VRFKeyData{ VRFKey: nil, @@ -499,12 +565,12 @@ func SetupSubsAndConsumersForExistingEnv( l, ) if err != nil { - return nil, nil, fmt.Errorf("err: %w", err) + return nil, nil, err } } else { consumer, err := contracts.LoadVRFv2PlusLoadTestConsumer(sethClient, *commonExistingEnvConfig.ConsumerAddress) if err != nil { - return nil, nil, fmt.Errorf("err: %w", err) + return nil, nil, err } consumers = append(consumers, consumer) var ok bool @@ -526,21 +592,65 @@ func SetupSubsAndConsumersForExistingEnv( l, ) if err != nil { - return nil, nil, fmt.Errorf("err: %w", err) + return nil, nil, err } } return subIDs, consumers, nil } func SelectBillingTypeWithDistribution(billingType string, distributionFn func() bool) (bool, error) { - switch vrfv2plus_config.BillingType(billingType) { - case vrfv2plus_config.BillingType_Link: + switch vrfv2plusconfig.BillingType(billingType) { + case vrfv2plusconfig.BillingType_Link: return false, nil - case vrfv2plus_config.BillingType_Native: + case vrfv2plusconfig.BillingType_Native: return true, nil - case vrfv2plus_config.BillingType_Link_and_Native: + case vrfv2plusconfig.BillingType_Link_and_Native: return distributionFn(), nil default: return false, fmt.Errorf("invalid billing type: %s", billingType) } } + +func SetupVRFV2PlusWrapperUniverse( + ctx context.Context, + sethClient *seth.Client, + vrfContracts *vrfcommon.VRFContracts, + config *tc.TestConfig, + keyHash [32]byte, + numberOfConsumerContracts int, + l zerolog.Logger, +) (*VRFV2PlusWrapperContracts, *big.Int, error) { + var ( + wrapperContracts *VRFV2PlusWrapperContracts + wrapperSubID *big.Int + err error + ) + if *config.VRFv2Plus.General.UseExistingEnv { + wrapperContracts, wrapperSubID, err = SetupVRFV2PlusWrapperForExistingEnv( + ctx, + sethClient, + vrfContracts, + keyHash, + config, + numberOfConsumerContracts, + l, + ) + if err != nil { + return nil, nil, err + } + } else { + wrapperContracts, wrapperSubID, err = SetupVRFV2PlusWrapperForNewEnv( + ctx, + sethClient, + config, + vrfContracts, + keyHash, + numberOfConsumerContracts, + l, + ) + if err != nil { + return nil, nil, err + } + } + return wrapperContracts, wrapperSubID, nil +} diff --git a/integration-tests/benchmark/automation_test.go b/integration-tests/benchmark/automation_test.go new file mode 100644 index 00000000000..0a63ff2c27a --- /dev/null +++ b/integration-tests/benchmark/automation_test.go @@ -0,0 +1,385 @@ +package benchmark + +import ( + "fmt" + "math/big" + "strings" + "testing" + "time" + + "github.com/stretchr/testify/require" + + "github.com/smartcontractkit/chainlink-testing-framework/lib/blockchain" + ctfconfig "github.com/smartcontractkit/chainlink-testing-framework/lib/config" + envclient "github.com/smartcontractkit/chainlink-testing-framework/lib/k8s/client" + "github.com/smartcontractkit/chainlink-testing-framework/lib/k8s/environment" + "github.com/smartcontractkit/chainlink-testing-framework/lib/k8s/pkg/helm/chainlink" + "github.com/smartcontractkit/chainlink-testing-framework/lib/k8s/pkg/helm/ethereum" + "github.com/smartcontractkit/chainlink-testing-framework/lib/k8s/pkg/helm/reorg" + "github.com/smartcontractkit/chainlink-testing-framework/lib/logging" + "github.com/smartcontractkit/chainlink-testing-framework/lib/networks" + sethutils "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/seth" + + "github.com/smartcontractkit/chainlink/integration-tests/actions" + ethcontracts "github.com/smartcontractkit/chainlink/integration-tests/contracts/ethereum" + tc "github.com/smartcontractkit/chainlink/integration-tests/testconfig" + "github.com/smartcontractkit/chainlink/integration-tests/testsetups" + "github.com/smartcontractkit/chainlink/integration-tests/types" +) + +var ( + chainlinkResources = map[string]interface{}{ + "resources": map[string]interface{}{ + "requests": map[string]interface{}{ + "cpu": "1000m", + "memory": "4Gi", + }, + "limits": map[string]interface{}{ + "cpu": "1000m", + "memory": "4Gi", + }, + }, + } + dbResources = map[string]interface{}{ + "resources": map[string]interface{}{ + "requests": map[string]interface{}{ + "cpu": "1000m", + "memory": "1Gi", + }, + "limits": map[string]interface{}{ + "cpu": "1000m", + "memory": "1Gi", + }, + }, + "stateful": true, + "capacity": "10Gi", + } +) + +type NetworkConfig struct { + upkeepSLA int64 + blockTime time.Duration + deltaStage time.Duration + funding *big.Float +} + +var defaultNetworkConfig = NetworkConfig{ + upkeepSLA: int64(120), + blockTime: time.Second, + deltaStage: time.Duration(0), +} + +func TestAutomationBenchmark(t *testing.T) { + l := logging.GetTestLogger(t) + testType, err := tc.GetConfigurationNameFromEnv() + require.NoError(t, err, "Error getting test type") + + config, err := tc.GetConfig([]string{testType}, tc.Automation) + require.NoError(t, err, "Error getting test config") + + testEnvironment, benchmarkNetwork := SetupAutomationBenchmarkEnv(t, &config) + if testEnvironment.WillUseRemoteRunner() { + return + } + networkName := strings.ReplaceAll(benchmarkNetwork.Name, " ", "") + testName := fmt.Sprintf("%s%s", networkName, *config.Automation.Benchmark.RegistryToTest) + l.Info().Str("Test Name", testName).Msg("Running Benchmark Test") + benchmarkTestNetwork := getNetworkConfig(&config) + + l.Info().Str("Namespace", testEnvironment.Cfg.Namespace).Msg("Connected to Keepers Benchmark Environment") + testNetwork := sethutils.MustReplaceSimulatedNetworkUrlWithK8(l, benchmarkNetwork, *testEnvironment) + + chainClient, err := sethutils.GetChainClientWithConfigFunction(&config, testNetwork, sethutils.OneEphemeralKeysLiveTestnetAutoFixFn) + require.NoError(t, err, "Error getting Seth client") + + registryVersions := addRegistry(&config) + registrySettings := actions.ReadRegistryConfig(config) + keeperBenchmarkTest := testsetups.NewKeeperBenchmarkTest(t, + testsetups.KeeperBenchmarkTestInputs{ + BlockchainClient: chainClient, + RegistryVersions: registryVersions, + KeeperRegistrySettings: ®istrySettings, + Upkeeps: &testsetups.UpkeepConfig{ + NumberOfUpkeeps: *config.Automation.Benchmark.NumberOfUpkeeps, + CheckGasToBurn: *config.Automation.Benchmark.CheckGasToBurn, + PerformGasToBurn: *config.Automation.Benchmark.PerformGasToBurn, + BlockRange: *config.Automation.Benchmark.BlockRange, + BlockInterval: *config.Automation.Benchmark.BlockInterval, + UpkeepGasLimit: *config.Automation.Benchmark.UpkeepGasLimit, + FirstEligibleBuffer: 1, + }, + ChainlinkNodeFunding: benchmarkTestNetwork.funding, + UpkeepSLA: benchmarkTestNetwork.upkeepSLA, + BlockTime: benchmarkTestNetwork.blockTime, + DeltaStage: benchmarkTestNetwork.deltaStage, + ForceSingleTxnKey: *config.Automation.Benchmark.ForceSingleTxKey, + DeleteJobsOnEnd: *config.Automation.Benchmark.DeleteJobsOnEnd, + }, + ) + t.Cleanup(func() { + if err = actions.TeardownRemoteSuite(keeperBenchmarkTest.TearDownVals(t)); err != nil { + l.Error().Err(err).Msg("Error when tearing down remote suite") + } else { + if *config.GetAutomationConfig().Benchmark.DeleteJobsOnEnd { + err := testEnvironment.Client.RemoveNamespace(testEnvironment.Cfg.Namespace) + if err != nil { + l.Error().Err(err).Msg("Error removing namespace") + } + } + } + }) + keeperBenchmarkTest.Setup(testEnvironment, config) + keeperBenchmarkTest.Run() +} + +func addRegistry(config *tc.TestConfig) []ethcontracts.KeeperRegistryVersion { + switch *config.Automation.Benchmark.RegistryToTest { + case "2_0": + return []ethcontracts.KeeperRegistryVersion{ethcontracts.RegistryVersion_2_0} + case "2_1": + return []ethcontracts.KeeperRegistryVersion{ethcontracts.RegistryVersion_2_1} + case "2_2": + return []ethcontracts.KeeperRegistryVersion{ethcontracts.RegistryVersion_2_2} + case "2_3": + return []ethcontracts.KeeperRegistryVersion{ethcontracts.RegistryVersion_2_3} + case "2_2-2_1": + return []ethcontracts.KeeperRegistryVersion{ethcontracts.RegistryVersion_2_2, ethcontracts.RegistryVersion_2_1} + case "2_0-Multiple": + return repeatRegistries(ethcontracts.RegistryVersion_2_0, *config.Automation.Benchmark.NumberOfRegistries) + case "2_1-Multiple": + return repeatRegistries(ethcontracts.RegistryVersion_2_1, *config.Automation.Benchmark.NumberOfRegistries) + case "2_2-Multiple": + return repeatRegistries(ethcontracts.RegistryVersion_2_2, *config.Automation.Benchmark.NumberOfRegistries) + default: + return []ethcontracts.KeeperRegistryVersion{ethcontracts.RegistryVersion_2_0} + } +} + +func repeatRegistries(registryVersion ethcontracts.KeeperRegistryVersion, numberOfRegistries int) []ethcontracts.KeeperRegistryVersion { + repeatedRegistries := make([]ethcontracts.KeeperRegistryVersion, 0) + for i := 0; i < numberOfRegistries; i++ { + repeatedRegistries = append(repeatedRegistries, registryVersion) + } + return repeatedRegistries +} + +func getNetworkConfig(config *tc.TestConfig) NetworkConfig { + evmNetwork := networks.MustGetSelectedNetworkConfig(config.GetNetworkConfig())[0] + var nc NetworkConfig + var ok bool + if nc, ok = networkConfig[evmNetwork.Name]; !ok { + nc = defaultNetworkConfig + } + + if evmNetwork.Name == networks.SimulatedEVM.Name || evmNetwork.Name == networks.SimulatedEVMNonDev.Name { + return nc + } + + nc.funding = big.NewFloat(*config.Common.ChainlinkNodeFunding) + + return nc +} + +var networkConfig = map[string]NetworkConfig{ + networks.SimulatedEVM.Name: { + upkeepSLA: int64(120), //2 minutes + blockTime: time.Second, + deltaStage: 30 * time.Second, + funding: big.NewFloat(100_000), + }, + networks.SimulatedEVMNonDev.Name: { + upkeepSLA: int64(120), //2 minutes + blockTime: time.Second, + deltaStage: 30 * time.Second, + funding: big.NewFloat(100_000), + }, + networks.GoerliTestnet.Name: { + upkeepSLA: int64(4), + blockTime: 12 * time.Second, + deltaStage: time.Duration(0), + }, + networks.SepoliaTestnet.Name: { + upkeepSLA: int64(4), + blockTime: 12 * time.Second, + deltaStage: time.Duration(0), + }, + networks.PolygonMumbai.Name: { + upkeepSLA: int64(4), + blockTime: 12 * time.Second, + deltaStage: time.Duration(0), + }, + networks.BaseSepolia.Name: { + upkeepSLA: int64(60), + blockTime: 2 * time.Second, + deltaStage: 20 * time.Second, + }, + networks.ArbitrumSepolia.Name: { + upkeepSLA: int64(120), + blockTime: time.Second, + deltaStage: 20 * time.Second, + }, + networks.OptimismSepolia.Name: { + upkeepSLA: int64(120), + blockTime: time.Second, + deltaStage: 20 * time.Second, + }, + networks.LineaGoerli.Name: { + upkeepSLA: int64(120), + blockTime: time.Second, + deltaStage: 20 * time.Second, + }, + networks.GnosisChiado.Name: { + upkeepSLA: int64(120), + blockTime: 6 * time.Second, + deltaStage: 20 * time.Second, + }, + networks.PolygonZkEvmCardona.Name: { + upkeepSLA: int64(120), + blockTime: time.Second, + deltaStage: 20 * time.Second, + }, + networks.ScrollSepolia.Name: { + upkeepSLA: int64(120), + blockTime: 3 * time.Second, + deltaStage: 20 * time.Second, + }, +} + +func SetupAutomationBenchmarkEnv(t *testing.T, keeperTestConfig types.AutomationBenchmarkTestConfig) (*environment.Environment, blockchain.EVMNetwork) { + l := logging.GetTestLogger(t) + testNetwork := networks.MustGetSelectedNetworkConfig(keeperTestConfig.GetNetworkConfig())[0] // Environment currently being used to run benchmark test on + blockTime := "1" + numberOfNodes := *keeperTestConfig.GetAutomationConfig().General.NumberOfNodes + + if strings.Contains(*keeperTestConfig.GetAutomationConfig().Benchmark.RegistryToTest, "2_") { + numberOfNodes++ + } + + networkName := strings.ReplaceAll(testNetwork.Name, " ", "-") + networkName = strings.ReplaceAll(networkName, "_", "-") + testNetwork.Name = networkName + + testEnvironment := environment.New(&environment.Config{ + TTL: time.Hour * 720, // 30 days, + NamespacePrefix: fmt.Sprintf( + "automation-%s-%s-%s", + strings.ToLower(strings.Join(keeperTestConfig.GetConfigurationNames(), "")), + strings.ReplaceAll(strings.ToLower(testNetwork.Name), " ", "-"), + strings.ReplaceAll(strings.ToLower(*keeperTestConfig.GetAutomationConfig().Benchmark.RegistryToTest), "_", "-"), + ), + Test: t, + PreventPodEviction: true, + }) + + dbResources := dbResources + chainlinkResources := chainlinkResources + + // Test can run on simulated, simulated-non-dev, testnets + if testNetwork.Name == networks.SimulatedEVMNonDev.Name { + testEnvironment. + AddHelm(reorg.New(&reorg.Props{ + NetworkName: testNetwork.Name, + Values: map[string]interface{}{ + "geth": map[string]interface{}{ + "tx": map[string]interface{}{ + "replicas": numberOfNodes, + }, + "miner": map[string]interface{}{ + "replicas": 2, + }, + }, + }, + })) + } else { + testEnvironment. + AddHelm(ethereum.New(ðereum.Props{ + NetworkName: testNetwork.Name, + Simulated: testNetwork.Simulated, + WsURLs: testNetwork.URLs, + Values: map[string]interface{}{ + "resources": map[string]interface{}{ + "requests": map[string]interface{}{ + "cpu": "4000m", + "memory": "4Gi", + }, + "limits": map[string]interface{}{ + "cpu": "4000m", + "memory": "4Gi", + }, + }, + "geth": map[string]interface{}{ + "blocktime": blockTime, + "capacity": "20Gi", + "startGaslimit": "20000000", + "targetGasLimit": "30000000", + }, + }, + })) + } + var err error + if testNetwork.Simulated { + // TODO we need to update the image in CTF, the old one is not available anymore + // deploy blockscout if running on simulated + //testEnvironment. + // AddChart(blockscout.New(&blockscout.Props{ + // Name: "geth-blockscout", + // WsURL: testNetwork.URLs[0], + // HttpURL: testNetwork.HTTPURLs[0]})) + // Need to setup geth node before setting up chainlink nodes + err = testEnvironment.Run() + require.NoError(t, err, "Error launching test environment") + } + + if testEnvironment.WillUseRemoteRunner() { + return testEnvironment, testNetwork + } + + // separate RPC urls per CL node + internalWsURLs := make([]string, 0) + internalHttpURLs := make([]string, 0) + for i := 0; i < numberOfNodes; i++ { + // for simulated-nod-dev each CL node gets its own RPC node + if testNetwork.Name == networks.SimulatedEVMNonDev.Name { + podName := fmt.Sprintf("%s-ethereum-geth:%d", testNetwork.Name, i) + txNodeInternalWs, err := testEnvironment.Fwd.FindPort(podName, "geth", "ws-rpc").As(envclient.RemoteConnection, envclient.WS) + require.NoError(t, err, "Error finding WS ports") + internalWsURLs = append(internalWsURLs, txNodeInternalWs) + txNodeInternalHttp, err := testEnvironment.Fwd.FindPort(podName, "geth", "http-rpc").As(envclient.RemoteConnection, envclient.HTTP) + require.NoError(t, err, "Error finding HTTP ports") + internalHttpURLs = append(internalHttpURLs, txNodeInternalHttp) + // for testnets with more than 1 RPC nodes + } else if len(testNetwork.URLs) > 1 { + internalWsURLs = append(internalWsURLs, testNetwork.URLs[i%len(testNetwork.URLs)]) + internalHttpURLs = append(internalHttpURLs, testNetwork.HTTPURLs[i%len(testNetwork.URLs)]) + // for simulated and testnets with 1 RPC node + } else { + internalWsURLs = append(internalWsURLs, testNetwork.URLs[0]) + internalHttpURLs = append(internalHttpURLs, testNetwork.HTTPURLs[0]) + } + } + l.Debug().Strs("internalWsURLs", internalWsURLs).Strs("internalHttpURLs", internalHttpURLs).Msg("internalURLs") + + for i := 0; i < numberOfNodes; i++ { + testNetwork.HTTPURLs = []string{internalHttpURLs[i]} + testNetwork.URLs = []string{internalWsURLs[i]} + + var overrideFn = func(_ interface{}, target interface{}) { + ctfconfig.MustConfigOverrideChainlinkVersion(keeperTestConfig.GetChainlinkImageConfig(), target) + ctfconfig.MightConfigOverridePyroscopeKey(keeperTestConfig.GetPyroscopeConfig(), target) + } + + tomlConfig, err := actions.BuildTOMLNodeConfigForK8s(keeperTestConfig, testNetwork) + require.NoError(t, err, "Error building TOML config") + + cd := chainlink.NewWithOverride(i, map[string]any{ + "toml": tomlConfig, + "chainlink": chainlinkResources, + "db": dbResources, + }, keeperTestConfig.GetChainlinkImageConfig(), overrideFn) + + testEnvironment.AddHelm(cd) + } + err = testEnvironment.Run() + require.NoError(t, err, "Error launching test environment") + return testEnvironment, testNetwork +} diff --git a/integration-tests/benchmark/keeper_test.go b/integration-tests/benchmark/keeper_test.go deleted file mode 100644 index 177b3521013..00000000000 --- a/integration-tests/benchmark/keeper_test.go +++ /dev/null @@ -1,433 +0,0 @@ -package benchmark - -import ( - "fmt" - "math/big" - "strings" - "testing" - "time" - - "github.com/stretchr/testify/require" - - "github.com/smartcontractkit/chainlink-testing-framework/blockchain" - ctf_config "github.com/smartcontractkit/chainlink-testing-framework/config" - env_client "github.com/smartcontractkit/chainlink-testing-framework/k8s/client" - "github.com/smartcontractkit/chainlink-testing-framework/k8s/environment" - "github.com/smartcontractkit/chainlink-testing-framework/k8s/pkg/helm/chainlink" - "github.com/smartcontractkit/chainlink-testing-framework/k8s/pkg/helm/ethereum" - "github.com/smartcontractkit/chainlink-testing-framework/k8s/pkg/helm/reorg" - "github.com/smartcontractkit/chainlink-testing-framework/logging" - "github.com/smartcontractkit/chainlink-testing-framework/networks" - seth_utils "github.com/smartcontractkit/chainlink-testing-framework/utils/seth" - - "github.com/smartcontractkit/chainlink/integration-tests/actions" - "github.com/smartcontractkit/chainlink/integration-tests/contracts" - eth_contracts "github.com/smartcontractkit/chainlink/integration-tests/contracts/ethereum" - tc "github.com/smartcontractkit/chainlink/integration-tests/testconfig" - "github.com/smartcontractkit/chainlink/integration-tests/testsetups" - "github.com/smartcontractkit/chainlink/integration-tests/types" -) - -var ( - performanceChainlinkResources = map[string]interface{}{ - "resources": map[string]interface{}{ - "requests": map[string]interface{}{ - "cpu": "1000m", - "memory": "4Gi", - }, - "limits": map[string]interface{}{ - "cpu": "1000m", - "memory": "4Gi", - }, - }, - } - performanceDbResources = map[string]interface{}{ - "resources": map[string]interface{}{ - "requests": map[string]interface{}{ - "cpu": "1000m", - "memory": "1Gi", - }, - "limits": map[string]interface{}{ - "cpu": "1000m", - "memory": "1Gi", - }, - }, - "stateful": true, - "capacity": "10Gi", - } - - soakChainlinkResources = map[string]interface{}{ - "resources": map[string]interface{}{ - "requests": map[string]interface{}{ - "cpu": "350m", - "memory": "1Gi", - }, - "limits": map[string]interface{}{ - "cpu": "350m", - "memory": "1Gi", - }, - }, - } - soakDbResources = map[string]interface{}{ - "resources": map[string]interface{}{ - "requests": map[string]interface{}{ - "cpu": "250m", - "memory": "256Mi", - }, - "limits": map[string]interface{}{ - "cpu": "250m", - "memory": "256Mi", - }, - }, - "stateful": true, - "capacity": "10Gi", - } -) - -type NetworkConfig struct { - upkeepSLA int64 - blockTime time.Duration - deltaStage time.Duration - funding *big.Float -} - -var defaultNetworkConfig = NetworkConfig{ - upkeepSLA: int64(120), - blockTime: time.Second, - deltaStage: time.Duration(0), -} - -func TestAutomationBenchmark(t *testing.T) { - l := logging.GetTestLogger(t) - testType, err := tc.GetConfigurationNameFromEnv() - require.NoError(t, err, "Error getting test type") - - config, err := tc.GetConfig([]string{testType}, tc.Keeper) - require.NoError(t, err, "Error getting test config") - - testEnvironment, benchmarkNetwork := SetupAutomationBenchmarkEnv(t, &config) - if testEnvironment.WillUseRemoteRunner() { - return - } - networkName := strings.ReplaceAll(benchmarkNetwork.Name, " ", "") - testName := fmt.Sprintf("%s%s", networkName, *config.Keeper.Common.RegistryToTest) - l.Info().Str("Test Name", testName).Msg("Running Benchmark Test") - benchmarkTestNetwork := getNetworkConfig(&config) - - l.Info().Str("Namespace", testEnvironment.Cfg.Namespace).Msg("Connected to Keepers Benchmark Environment") - testNetwork := seth_utils.MustReplaceSimulatedNetworkUrlWithK8(l, benchmarkNetwork, *testEnvironment) - - chainClient, err := seth_utils.GetChainClientWithConfigFunction(&config, testNetwork, seth_utils.OneEphemeralKeysLiveTestnetAutoFixFn) - require.NoError(t, err, "Error getting Seth client") - - registryVersions := addRegistry(&config) - keeperBenchmarkTest := testsetups.NewKeeperBenchmarkTest(t, - testsetups.KeeperBenchmarkTestInputs{ - BlockchainClient: chainClient, - RegistryVersions: registryVersions, - KeeperRegistrySettings: &contracts.KeeperRegistrySettings{ - PaymentPremiumPPB: uint32(0), - FlatFeeMicroLINK: uint32(40000), - BlockCountPerTurn: big.NewInt(100), - CheckGasLimit: uint32(45_000_000), //45M - StalenessSeconds: big.NewInt(90_000), - GasCeilingMultiplier: uint16(2), - MaxPerformGas: uint32(*config.Keeper.Common.MaxPerformGas), - MinUpkeepSpend: big.NewInt(0), - FallbackGasPrice: big.NewInt(2e11), - FallbackLinkPrice: big.NewInt(2e18), - MaxCheckDataSize: uint32(5_000), - MaxPerformDataSize: uint32(5_000), - MaxRevertDataSize: uint32(5_000), - }, - Upkeeps: &testsetups.UpkeepConfig{ - NumberOfUpkeeps: *config.Keeper.Common.NumberOfUpkeeps, - CheckGasToBurn: *config.Keeper.Common.CheckGasToBurn, - PerformGasToBurn: *config.Keeper.Common.PerformGasToBurn, - BlockRange: *config.Keeper.Common.BlockRange, - BlockInterval: *config.Keeper.Common.BlockInterval, - UpkeepGasLimit: *config.Keeper.Common.UpkeepGasLimit, - FirstEligibleBuffer: 1, - }, - Contracts: &testsetups.PreDeployedContracts{ - RegistrarAddress: *config.Keeper.Common.RegistrarAddress, - RegistryAddress: *config.Keeper.Common.RegistryAddress, - LinkTokenAddress: *config.Keeper.Common.LinkTokenAddress, - EthFeedAddress: *config.Keeper.Common.EthFeedAddress, - GasFeedAddress: *config.Keeper.Common.GasFeedAddress, - }, - ChainlinkNodeFunding: benchmarkTestNetwork.funding, - UpkeepSLA: benchmarkTestNetwork.upkeepSLA, - BlockTime: benchmarkTestNetwork.blockTime, - DeltaStage: benchmarkTestNetwork.deltaStage, - ForceSingleTxnKey: *config.Keeper.Common.ForceSingleTxKey, - DeleteJobsOnEnd: *config.Keeper.Common.DeleteJobsOnEnd, - }, - ) - t.Cleanup(func() { - if err = actions.TeardownRemoteSuite(keeperBenchmarkTest.TearDownVals(t)); err != nil { - l.Error().Err(err).Msg("Error when tearing down remote suite") - } - }) - keeperBenchmarkTest.Setup(testEnvironment, &config) - keeperBenchmarkTest.Run() -} - -func addRegistry(config *tc.TestConfig) []eth_contracts.KeeperRegistryVersion { - switch *config.Keeper.Common.RegistryToTest { - case "1_1": - return []eth_contracts.KeeperRegistryVersion{eth_contracts.RegistryVersion_1_1} - case "1_2": - return []eth_contracts.KeeperRegistryVersion{eth_contracts.RegistryVersion_1_2} - case "1_3": - return []eth_contracts.KeeperRegistryVersion{eth_contracts.RegistryVersion_1_3} - case "2_0": - return []eth_contracts.KeeperRegistryVersion{eth_contracts.RegistryVersion_2_0} - case "2_1": - return []eth_contracts.KeeperRegistryVersion{eth_contracts.RegistryVersion_2_1} - case "2_2": - return []eth_contracts.KeeperRegistryVersion{eth_contracts.RegistryVersion_2_2} - case "2_0-1_3": - return []eth_contracts.KeeperRegistryVersion{eth_contracts.RegistryVersion_2_0, eth_contracts.RegistryVersion_1_3} - case "2_1-2_0-1_3": - return []eth_contracts.KeeperRegistryVersion{eth_contracts.RegistryVersion_2_1, - eth_contracts.RegistryVersion_2_0, eth_contracts.RegistryVersion_1_3} - case "2_2-2_1": - return []eth_contracts.KeeperRegistryVersion{eth_contracts.RegistryVersion_2_2, eth_contracts.RegistryVersion_2_1} - case "2_0-Multiple": - return repeatRegistries(eth_contracts.RegistryVersion_2_0, *config.Keeper.Common.NumberOfRegistries) - case "2_1-Multiple": - return repeatRegistries(eth_contracts.RegistryVersion_2_1, *config.Keeper.Common.NumberOfRegistries) - case "2_2-Multiple": - return repeatRegistries(eth_contracts.RegistryVersion_2_2, *config.Keeper.Common.NumberOfRegistries) - default: - return []eth_contracts.KeeperRegistryVersion{eth_contracts.RegistryVersion_2_0} - } -} - -func repeatRegistries(registryVersion eth_contracts.KeeperRegistryVersion, numberOfRegistries int) []eth_contracts.KeeperRegistryVersion { - repeatedRegistries := make([]eth_contracts.KeeperRegistryVersion, 0) - for i := 0; i < numberOfRegistries; i++ { - repeatedRegistries = append(repeatedRegistries, registryVersion) - } - return repeatedRegistries -} - -func getNetworkConfig(config *tc.TestConfig) NetworkConfig { - evmNetwork := networks.MustGetSelectedNetworkConfig(config.GetNetworkConfig())[0] - var nc NetworkConfig - var ok bool - if nc, ok = networkConfig[evmNetwork.Name]; !ok { - nc = defaultNetworkConfig - } - - if evmNetwork.Name == networks.SimulatedEVM.Name || evmNetwork.Name == networks.SimulatedEVMNonDev.Name { - return nc - } - - nc.funding = big.NewFloat(*config.Common.ChainlinkNodeFunding) - - return nc -} - -var networkConfig = map[string]NetworkConfig{ - networks.SimulatedEVM.Name: { - upkeepSLA: int64(120), //2 minutes - blockTime: time.Second, - deltaStage: 30 * time.Second, - funding: big.NewFloat(100_000), - }, - networks.SimulatedEVMNonDev.Name: { - upkeepSLA: int64(120), //2 minutes - blockTime: time.Second, - deltaStage: 30 * time.Second, - funding: big.NewFloat(100_000), - }, - networks.GoerliTestnet.Name: { - upkeepSLA: int64(4), - blockTime: 12 * time.Second, - deltaStage: time.Duration(0), - }, - networks.SepoliaTestnet.Name: { - upkeepSLA: int64(4), - blockTime: 12 * time.Second, - deltaStage: time.Duration(0), - }, - networks.PolygonMumbai.Name: { - upkeepSLA: int64(4), - blockTime: 12 * time.Second, - deltaStage: time.Duration(0), - }, - networks.BaseSepolia.Name: { - upkeepSLA: int64(60), - blockTime: 2 * time.Second, - deltaStage: 20 * time.Second, - }, - networks.ArbitrumSepolia.Name: { - upkeepSLA: int64(120), - blockTime: time.Second, - deltaStage: 20 * time.Second, - }, - networks.OptimismSepolia.Name: { - upkeepSLA: int64(120), - blockTime: time.Second, - deltaStage: 20 * time.Second, - }, - networks.LineaGoerli.Name: { - upkeepSLA: int64(120), - blockTime: time.Second, - deltaStage: 20 * time.Second, - }, - networks.GnosisChiado.Name: { - upkeepSLA: int64(120), - blockTime: 6 * time.Second, - deltaStage: 20 * time.Second, - }, - networks.PolygonZkEvmCardona.Name: { - upkeepSLA: int64(120), - blockTime: time.Second, - deltaStage: 20 * time.Second, - }, -} - -func SetupAutomationBenchmarkEnv(t *testing.T, keeperTestConfig types.KeeperBenchmarkTestConfig) (*environment.Environment, blockchain.EVMNetwork) { - l := logging.GetTestLogger(t) - testNetwork := networks.MustGetSelectedNetworkConfig(keeperTestConfig.GetNetworkConfig())[0] // Environment currently being used to run benchmark test on - blockTime := "1" - numberOfNodes := *keeperTestConfig.GetKeeperConfig().Common.NumberOfNodes - - if strings.Contains(*keeperTestConfig.GetKeeperConfig().Common.RegistryToTest, "2_") { - numberOfNodes++ - } - - networkName := strings.ReplaceAll(testNetwork.Name, " ", "-") - networkName = strings.ReplaceAll(networkName, "_", "-") - testNetwork.Name = networkName - - testEnvironment := environment.New(&environment.Config{ - TTL: time.Hour * 720, // 30 days, - NamespacePrefix: fmt.Sprintf( - "automation-%s-%s-%s", - strings.ToLower(strings.Join(keeperTestConfig.GetConfigurationNames(), "")), - strings.ReplaceAll(strings.ToLower(testNetwork.Name), " ", "-"), - strings.ReplaceAll(strings.ToLower(*keeperTestConfig.GetKeeperConfig().Common.RegistryToTest), "_", "-"), - ), - Test: t, - PreventPodEviction: true, - }) - - dbResources := performanceDbResources - chainlinkResources := performanceChainlinkResources - if strings.Contains(strings.ToLower(strings.Join(keeperTestConfig.GetConfigurationNames(), ",")), "soak") { - chainlinkResources = soakChainlinkResources - dbResources = soakDbResources - } - - // Test can run on simulated, simulated-non-dev, testnets - if testNetwork.Name == networks.SimulatedEVMNonDev.Name { - testEnvironment. - AddHelm(reorg.New(&reorg.Props{ - NetworkName: testNetwork.Name, - Values: map[string]interface{}{ - "geth": map[string]interface{}{ - "tx": map[string]interface{}{ - "replicas": numberOfNodes, - }, - "miner": map[string]interface{}{ - "replicas": 2, - }, - }, - }, - })) - } else { - testEnvironment. - AddHelm(ethereum.New(ðereum.Props{ - NetworkName: testNetwork.Name, - Simulated: testNetwork.Simulated, - WsURLs: testNetwork.URLs, - Values: map[string]interface{}{ - "resources": map[string]interface{}{ - "requests": map[string]interface{}{ - "cpu": "4000m", - "memory": "4Gi", - }, - "limits": map[string]interface{}{ - "cpu": "4000m", - "memory": "4Gi", - }, - }, - "geth": map[string]interface{}{ - "blocktime": blockTime, - "capacity": "20Gi", - "startGaslimit": "20000000", - "targetGasLimit": "30000000", - }, - }, - })) - } - - // TODO we need to update the image in CTF, the old one is not available anymore - // deploy blockscout if running on simulated - // if testNetwork.Simulated { - // testEnvironment. - // AddChart(blockscout.New(&blockscout.Props{ - // Name: "geth-blockscout", - // WsURL: testNetwork.URLs[0], - // HttpURL: testNetwork.HTTPURLs[0]})) - // } - err := testEnvironment.Run() - require.NoError(t, err, "Error launching test environment") - - if testEnvironment.WillUseRemoteRunner() { - return testEnvironment, testNetwork - } - - // separate RPC urls per CL node - internalWsURLs := make([]string, 0) - internalHttpURLs := make([]string, 0) - for i := 0; i < numberOfNodes; i++ { - // for simulated-nod-dev each CL node gets its own RPC node - if testNetwork.Name == networks.SimulatedEVMNonDev.Name { - podName := fmt.Sprintf("%s-ethereum-geth:%d", testNetwork.Name, i) - txNodeInternalWs, err := testEnvironment.Fwd.FindPort(podName, "geth", "ws-rpc").As(env_client.RemoteConnection, env_client.WS) - require.NoError(t, err, "Error finding WS ports") - internalWsURLs = append(internalWsURLs, txNodeInternalWs) - txNodeInternalHttp, err := testEnvironment.Fwd.FindPort(podName, "geth", "http-rpc").As(env_client.RemoteConnection, env_client.HTTP) - require.NoError(t, err, "Error finding HTTP ports") - internalHttpURLs = append(internalHttpURLs, txNodeInternalHttp) - // for testnets with more than 1 RPC nodes - } else if len(testNetwork.URLs) > 1 { - internalWsURLs = append(internalWsURLs, testNetwork.URLs[i%len(testNetwork.URLs)]) - internalHttpURLs = append(internalHttpURLs, testNetwork.HTTPURLs[i%len(testNetwork.URLs)]) - // for simulated and testnets with 1 RPC node - } else { - internalWsURLs = append(internalWsURLs, testNetwork.URLs[0]) - internalHttpURLs = append(internalHttpURLs, testNetwork.HTTPURLs[0]) - } - } - l.Debug().Strs("internalWsURLs", internalWsURLs).Strs("internalHttpURLs", internalHttpURLs).Msg("internalURLs") - - for i := 0; i < numberOfNodes; i++ { - testNetwork.HTTPURLs = []string{internalHttpURLs[i]} - testNetwork.URLs = []string{internalWsURLs[i]} - - var overrideFn = func(_ interface{}, target interface{}) { - ctf_config.MustConfigOverrideChainlinkVersion(keeperTestConfig.GetChainlinkImageConfig(), target) - ctf_config.MightConfigOverridePyroscopeKey(keeperTestConfig.GetPyroscopeConfig(), target) - } - - tomlConfig, err := actions.BuildTOMLNodeConfigForK8s(keeperTestConfig, testNetwork) - require.NoError(t, err, "Error building TOML config") - - cd := chainlink.NewWithOverride(i, map[string]any{ - "toml": tomlConfig, - "chainlink": chainlinkResources, - "db": dbResources, - }, keeperTestConfig.GetChainlinkImageConfig(), overrideFn) - - testEnvironment.AddHelm(cd) - } - err = testEnvironment.Run() - require.NoError(t, err, "Error launching test environment") - return testEnvironment, testNetwork -} diff --git a/integration-tests/ccip-tests/Makefile b/integration-tests/ccip-tests/Makefile new file mode 100644 index 00000000000..2702c36b027 --- /dev/null +++ b/integration-tests/ccip-tests/Makefile @@ -0,0 +1,73 @@ +## To Override the default config: +# example usage: make set_config override_toml=../config/config.toml network_config_toml=../config/network.toml +.PHONY: set_config +set_config: + if [ -s "$(override_toml)" ]; then \ + echo "Overriding config with $(override_toml)"; \ + echo "export BASE64_CONFIG_OVERRIDE=$$(base64 -i $(override_toml))" > ./testconfig/override/.env; \ + echo "export TEST_BASE64_CONFIG_OVERRIDE=$$(base64 -i $(override_toml))" >> ./testconfig/override/.env; \ + echo "BASE64_CONFIG_OVERRIDE=$$(base64 -i $(override_toml))" > ./testconfig/override/debug.env; \ + echo "TEST_BASE64_CONFIG_OVERRIDE=$$(base64 -i $(override_toml))" >> ./testconfig/override/debug.env; \ + else \ + echo "No override config found, using default config"; \ + echo > ./testconfig/override/.env; \ + fi + if [ -s "$(network_config_toml)" ]; then \ + echo "Overriding network config with $(network_config_toml)"; \ + echo "export BASE64_NETWORK_CONFIG=$$(base64 -i $(network_config_toml))" >> ./testconfig/override/.env; \ + fi + + @echo "Checking for test secrets file in ~/.testsecrets..."; + @if [ ! -f ~/.testsecrets ]; then \ + echo "WARNING: ~/.testsecrets file not found. No test secrets will be set. To set test secrets, refer to ./testconfig/examples/.testsecrets.example for the list of secrets and instruction how to set them up."; \ + else \ + echo "Test secrets will be loaded from ~/.testsecrets file."; \ + fi + + +# example usage: make test_load_ccip testimage=chainlink-ccip-tests:latest testname=TestLoadCCIPStableRPS override_toml=./testconfig/override/config.toml network_config_toml=../config/network.toml +.PHONY: test_load_ccip +test_load_ccip: set_config + source ./testconfig/override/.env && \ + DATABASE_URL=postgresql://postgres:node@localhost:5432/chainlink_test?sslmode=disable \ + ENV_JOB_IMAGE=$(testimage) \ + TEST_SUITE=load \ + TEST_ARGS="-test.timeout 900h" \ + DETACH_RUNNER=true \ + RR_MEM=16Gi \ + RR_CPU=4 \ + go test -timeout 24h -count=1 -v -run ^$(testname)$$ ./load + + +# example usage: make test_smoke_ccip testimage=chainlink-ccip-tests:latest testname=TestSmokeCCIPForBidirectionalLane override_toml=../testconfig/override/config.toml network_config_toml=../config/network.toml +.PHONY: test_smoke_ccip +test_smoke_ccip: set_config + source ./testconfig/override/.env && \ + DATABASE_URL=postgresql://postgres:node@localhost:5432/chainlink_test?sslmode=disable \ + ENV_JOB_IMAGE=$(testimage) \ + TEST_SUITE=smoke \ + TEST_ARGS="-test.timeout 900h" \ + DETACH_RUNNER=true \ + go test -timeout 24h -count=1 -v -run ^$(testname)$$ ./smoke + +# run ccip smoke tests with default config; explicitly sets the override config to empty +# example usage: make test_smoke_ccip_default testname=TestSmokeCCIPForBidirectionalLane +.PHONY: test_smoke_ccip_default +test_smoke_ccip_default: set_config + source ./testconfig/override/.env && \ + DATABASE_URL=postgresql://postgres:node@localhost:5432/chainlink_test?sslmode=disable \ + BASE64_CONFIG_OVERRIDE="" \ + TEST_BASE64_CONFIG_OVERRIDE="" \ + ENV_JOB_IMAGE="" \ + TEST_SUITE=smoke \ + TEST_ARGS="-test.timeout 900h" \ + DETACH_RUNNER=true \ + go test -timeout 24h -count=1 -v -run ^$(testname)$$ ./smoke + + +# image: the name for the chainlink image being built, example: image=chainlink +# tag: the tag for the chainlink image being built, example: tag=latest +# example usage: make build_ccip_image image=chainlink-ccip tag=latest +.PHONY: build_ccip_image +build_ccip_image: + docker build -f ../../core/chainlink.Dockerfile --build-arg COMMIT_SHA=$(git rev-parse HEAD) --build-arg CHAINLINK_USER=chainlink -t $(image):$(tag) ../../ diff --git a/integration-tests/ccip-tests/README.md b/integration-tests/ccip-tests/README.md new file mode 100644 index 00000000000..a4255928949 --- /dev/null +++ b/integration-tests/ccip-tests/README.md @@ -0,0 +1,127 @@ +# CCIP Tests + +Here lives the integration tests for ccip, utilizing our [chainlink-testing-framework](https://github.com/smartcontractkit/chainlink-testing-framework) and [integration-tests](https://github.com/smartcontractkit/ccip/tree/ccip-develop/integration-tests) + +## Setup the Tests + +CCIP tests are designed to be highly configurable. Instead of writing many tests to check specific scenarios, the philosophy is to write a few unique tests and make them adjustable through the use of test inputs and configurations. There are a few different ways to set this configuration: + +1. Default test input - set via TOML - If no specific input is set; the tests will run with default inputs mentioned in [default.toml](./testconfig/tomls/ccip-default.toml). +Please refer to the [testconfig README](../testconfig/README.md) for a more detailed look at how testconfig works. +2. If you want to run your test with a different config, you can override the default inputs. You can either write an [overrides.toml](../testconfig/README.md#configuration-and-overrides) file, or set the env var `BASE64_CONFIG_OVERRIDE` containing the base64 encoded TOML file content with updated test input parameters. +For example, if you want to override the `Network` input in test and want to run your test on `avalanche testnet` and `arbitrum goerli` network, you need to: + 1. Create a TOML file with the following content: + + ```toml + [CCIP] + [CCIP.Env] + [CCIP.Env.Network] + selected_networks= ['AVALANCHE_FUJI', 'ARBITRUM_GOERLI'] + ``` + + 2. Encode it using the `base64` command + 3. Set the env var `BASE64_CONFIG_OVERRIDE` with the encoded content. + + ```bash + export BASE64_CONFIG_OVERRIDE=$(base64 -i ) + ``` + + [mainnet.toml](./testconfig/override/mainnet.toml), [override.toml](./testconfig/examples/override.toml.example) are some of the sample override TOML files. + + For example - In order to run the smoke test (TestSmokeCCIPForBidirectionalLane) on mainnet, run the test with following env var set: + + ```bash + export BASE64_CONFIG_OVERRIDE=$(base64 -i ./testconfig/override/mainnet.toml) + ``` + +3. Secrets - You also need to set some secrets. This is a mandatory step needed to run the tests. Please refer to [.testsecrets.example](./examples/.testsecrets.example) for the list of secrets and instruction how to set them up. + - The chainlink image and tag are required secrets for all the tests. + - If you are running tests in live networks like testnet and mainnet, you need to set the secrets (rpc urls and private keys) for the respective networks. + - If you are running tests in simulated networks no network specific secrets are required. + here is a sample secrets.toml file, for running the tests in simulated networks, with the chainlink image and tag set as secrets: + +**Please note that the secrets should NOT be checked in to the repo and should be kept locally.** + +We recommend against changing the content of [secrets.toml.example](./testconfig/examples/secrets.toml.example). Please create a new file and set it as the secrets file. + +You can run this command to ignore any changes to the file. + +```bash +git update-index --skip-worktree +``` + +## Running the Tests + +There are two ways to run the tests: + +1. Using local docker containers +2. Using a remote kubernetes cluster + +### Using Local Docker Containers + +In order to run the tests locally, you need to have docker installed and running on your machine. +You can use a specific chainlink image and tag (if you already have one) for the tests. Otherwise, you can build the image using the following command: + +```bash +make build_ccip_image image=chainlink-ccip tag=latest-dev # please choose the image and tag name as per your choice +``` + +For a local run, tests creates two private geth networks and runs the tests on them. Running tests on testnet and mainnet is not supported yet for local docker tests and must be run in a kubernetes environment. + +1. [Setting the test inputs](#setup-the-tests) + 1. If required, create an `override.toml` with the required test inputs. If you want to run the tests with default parameters, you can skip this step. + 2. Create a TOML file with the secrets. +2. Run the following command to run the smoke tests with your custom override toml and secrets. + +```bash +# mark the testimage as empty for running the tests in local docker containers +make test_smoke_ccip testimage="" testname=TestSmokeCCIPForBidirectionalLane override_toml="" secret_toml="" +``` + +If you don't want to bother with any overrides, you can run with the default TOML settings with the below command. + +```bash +make test_smoke_ccip_default testname=TestSmokeCCIPForBidirectionalLane secret_toml="" +``` + +```mermaid +--- +title: Basic Docker Test Environment +--- +flowchart + subgraph SD[DON] + CL1[Node 1] + CL2[Node 2] + CL3[Node 3] + CL4[Node 4] + CL5[Node 5] + CL6[Node 6] + CL1---CL2 + CL2---CL3 + CL3---CL4 + CL4---CL5 + CL5---CL6 + end + subgraph Chains + SC1[[Private Chain 1]] + SC2[[Private Chain 2]] + end + SC1<-->SD + SC2<-->SD + MS([Mock Server]) + MS-->SD + TC[/Test Code\] + TC<-->MS + TC<-->Chains + TC<-->SD +``` + +### Using Remote Kubernetes Cluster + +For running more complex and intensive tests (like load and chaos tests) you need to connect the test to a Kubernetes cluster. These tests have more complex setup and running instructions. We endeavor to make these easier to run and configure, but for the time being please seek a member of the QA/Test Tooling team if you want to run these. + +### Live environment testing + +To run against live environments, use the configs available under [beta-testnet](./testconfig/tomls/beta-testnet) +or [prod-testnet](./testconfig/tomls/prod-testnet) directory. Prod testnet has configs for smoke, load and +soak test separately and beta-testnet has smoke and soak combined. \ No newline at end of file diff --git a/integration-tests/ccip-tests/actions/ccip_helpers.go b/integration-tests/ccip-tests/actions/ccip_helpers.go new file mode 100644 index 00000000000..da2e870f3ec --- /dev/null +++ b/integration-tests/ccip-tests/actions/ccip_helpers.go @@ -0,0 +1,4471 @@ +package actions + +import ( + "context" + crypto_rand "crypto/rand" + "encoding/base64" + "encoding/json" + "fmt" + "math/big" + "net/http" + "runtime" + "strings" + "sync" + "testing" + "time" + + "dario.cat/mergo" + "github.com/AlekSi/pointer" + "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" + "github.com/pkg/errors" + "github.com/rs/zerolog" + "github.com/rs/zerolog/log" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "go.uber.org/atomic" + "golang.org/x/exp/rand" + "golang.org/x/sync/errgroup" + + "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/ptr" + + chainselectors "github.com/smartcontractkit/chain-selectors" + + commonconfig "github.com/smartcontractkit/chainlink-common/pkg/config" + "github.com/smartcontractkit/chainlink-testing-framework/lib/blockchain" + ctfClient "github.com/smartcontractkit/chainlink-testing-framework/lib/client" + ctftestenv "github.com/smartcontractkit/chainlink-testing-framework/lib/docker/test_env" + "github.com/smartcontractkit/chainlink-testing-framework/lib/k8s/environment" + "github.com/smartcontractkit/chainlink-testing-framework/lib/k8s/pkg/helm/foundry" + "github.com/smartcontractkit/chainlink-testing-framework/lib/k8s/pkg/helm/mockserver" + "github.com/smartcontractkit/chainlink-testing-framework/lib/k8s/pkg/helm/reorg" + "github.com/smartcontractkit/chainlink-testing-framework/lib/networks" + "github.com/smartcontractkit/chainlink/integration-tests/ccip-tests/contracts" + "github.com/smartcontractkit/chainlink/integration-tests/ccip-tests/contracts/laneconfig" + "github.com/smartcontractkit/chainlink/integration-tests/ccip-tests/testconfig" + "github.com/smartcontractkit/chainlink/integration-tests/ccip-tests/testreporters" + testutils "github.com/smartcontractkit/chainlink/integration-tests/ccip-tests/utils" + "github.com/smartcontractkit/chainlink/integration-tests/client" + "github.com/smartcontractkit/chainlink/integration-tests/docker/test_env" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/commit_store" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/evm_2_evm_offramp" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/evm_2_evm_onramp" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/evm_2_evm_onramp_1_2_0" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/fee_quoter" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/mock_rmn_contract" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/rmn_contract" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/router" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/token_pool" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/config" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/testhelpers" + integrationtesthelpers "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/testhelpers/integration" + bigmath "github.com/smartcontractkit/chainlink/v2/core/utils/big_math" +) + +const ( + ChaosGroupExecution = "ExecutionNodesAll" // all execution nodes + ChaosGroupCommit = "CommitNodesAll" // all commit nodes + ChaosGroupCommitFaultyPlus = "CommitMajority" // >f number of nodes + ChaosGroupCommitFaulty = "CommitMinority" // f number of nodes + ChaosGroupExecutionFaultyPlus = "ExecutionNodesMajority" // > f number of nodes + ChaosGroupExecutionFaulty = "ExecutionNodesMinority" // f number of nodes + + ChaosGroupCommitAndExecFaulty = "CommitAndExecutionNodesMinority" // f number of nodes + ChaosGroupCommitAndExecFaultyPlus = "CommitAndExecutionNodesMajority" // >f number of nodes + ChaosGroupCCIPGeth = "CCIPGeth" // both source and destination simulated geth networks + ChaosGroupNetworkACCIPGeth = "CCIPNetworkAGeth" + ChaosGroupNetworkBCCIPGeth = "CCIPNetworkBGeth" + + defaultUSDCDestBytesOverhead = 640 + defaultUSDCDestGasOverhead = 150_000 + DefaultDestinationGasLimit = 600_000 + // DefaultResubscriptionTimeout denotes the max backoff duration for resubscription for various watch events + // if the subscription keeps failing even after this duration, the test will fail + DefaultResubscriptionTimeout = 2 * time.Hour +) + +// TODO: These should be refactored along with the default CCIP test setup to use optional config functions +var ( + // DefaultPermissionlessExecThreshold denotes how long the DON will retry a transaction before giving up, + // otherwise known as the "Smart Execution Time Window". If a transaction fails to execute within this time window, + // the DON will give up and the transaction will need Manual Execution as detailed here: https://docs.chain.link/ccip/concepts/manual-execution#manual-execution + // For performance tests: the higher the load/throughput, the higher value we might need here to guarantee that nonces are not blocked + // 1 day should be enough for most of the cases + DefaultPermissionlessExecThreshold = time.Hour * 8 + DefaultMaxNoOfTokensInMsg uint16 = 50 +) + +type CCIPTOMLEnv struct { + Networks []blockchain.EVMNetwork +} + +var ( + NetworkChart = reorg.TXNodesAppLabel + NetworkName = func(name string) string { + return strings.ReplaceAll(strings.ToLower(name), " ", "-") + } + InflightExpiryExec = 3 * time.Minute + InflightExpiryCommit = 3 * time.Minute + BatchGasLimit = uint32(7_000_000) + + MaxDataBytes = uint32(50_000) + + RootSnoozeTime = 3 * time.Minute + GethLabel = func(name string) string { + name = NetworkName(name) + switch NetworkChart { + case reorg.TXNodesAppLabel: + return fmt.Sprintf("%s-ethereum-geth", name) + case foundry.ChartName: + return name + } + return "" + } + // ApprovedAmountToRouter is the default amount which gets approved for router so that it can transfer token and use the fee token for fee payment + ApprovedAmountToRouter = new(big.Int).Mul(big.NewInt(1e18), big.NewInt(1)) + ApprovedFeeAmountToRouter = new(big.Int).Mul(big.NewInt(int64(GasFeeMultiplier)), big.NewInt(1e5)) + GasFeeMultiplier uint64 = 12e17 + LinkToUSD = new(big.Int).Mul(big.NewInt(1e18), big.NewInt(20)) + WrappedNativeToUSD = new(big.Int).Mul(big.NewInt(1e18), big.NewInt(1.7e3)) +) + +func GetUSDCDomain(networkName string, simulated bool) (uint32, error) { + if simulated { + // generate a random domain for simulated networks + return rand.Uint32(), nil + } + lookup := map[string]uint32{ + networks.AvalancheFuji.Name: 1, + networks.OptimismGoerli.Name: 2, + networks.ArbitrumGoerli.Name: 3, + networks.BaseGoerli.Name: 6, + networks.PolygonMumbai.Name: 7, + } + if val, ok := lookup[networkName]; ok { + return val, nil + } + return 0, fmt.Errorf("USDC domain not found for chain %s", networkName) +} + +type CCIPCommon struct { + Logger *zerolog.Logger + ChainClient blockchain.EVMClient + // Deployer deploys all CCIP contracts + Deployer *contracts.CCIPContractsDeployer + // tokenDeployer is used exclusively for deploying self-serve tokens and their pools + tokenDeployer *contracts.CCIPContractsDeployer + FeeToken *contracts.LinkToken + BridgeTokens []*contracts.ERC20Token + PriceAggregators map[common.Address]*contracts.MockAggregator + NoOfTokensNeedingDynamicPrice int + BridgeTokenPools []*contracts.TokenPool + RateLimiterConfig contracts.RateLimiterConfig + RMNContract *common.Address + ARM *contracts.ARM // populate only if the ARM contracts is not a mock and can be used to verify various ARM events; keep this nil for mock ARM + Router *contracts.Router + PriceRegistry *contracts.PriceRegistry + TokenAdminRegistry *contracts.TokenAdminRegistry + WrappedNative common.Address + MulticallEnabled bool + MulticallContract common.Address + ExistingDeployment bool + USDCMockDeployment *bool + TokenMessenger *common.Address + TokenTransmitter *contracts.TokenTransmitter + IsConnectionRestoredRecently *atomic.Bool + + poolFunds *big.Int + tokenPriceUpdateWatcherMu *sync.Mutex + tokenPriceUpdateWatcher map[common.Address]*big.Int // key - token; value - timestamp of update + gasUpdateWatcherMu *sync.Mutex + gasUpdateWatcher map[uint64]*big.Int // key - destchain id; value - timestamp of update + GasUpdateEvents []contracts.GasUpdateEvent + AllowOutOfOrder bool +} + +// FreeUpUnusedSpace sets nil to various elements of ccipModule which are only used +// during lane set up and not used for rest of the test duration +// this is called mainly by load test to keep the memory usage minimum for high number of lanes +func (ccipModule *CCIPCommon) FreeUpUnusedSpace() { + ccipModule.PriceAggregators = nil + ccipModule.BridgeTokenPools = nil + ccipModule.TokenMessenger = nil + ccipModule.TokenTransmitter = nil + runtime.GC() +} + +func (ccipModule *CCIPCommon) UnvoteToCurseARM() error { + if ccipModule.ARM != nil { + return fmt.Errorf("real ARM deployed. cannot curse through test") + } + if ccipModule.RMNContract == nil { + return fmt.Errorf("no ARM contract is set") + } + arm, err := mock_rmn_contract.NewMockRMNContract(*ccipModule.RMNContract, ccipModule.ChainClient.Backend()) + if err != nil { + return fmt.Errorf("error instantiating arm %w", err) + } + opts, err := ccipModule.ChainClient.TransactionOpts(ccipModule.ChainClient.GetDefaultWallet()) + if err != nil { + return fmt.Errorf("error getting owners for ARM OwnerUnvoteToCurse %w", err) + } + tx, err := arm.OwnerUnvoteToCurse0(opts, []mock_rmn_contract.RMNUnvoteToCurseRecord{}) + if err != nil { + return fmt.Errorf("error in calling OwnerUnvoteToCurse %w", err) + } + err = ccipModule.ChainClient.ProcessTransaction(tx) + if err != nil { + return err + } + log.Info(). + Str("ARM", arm.Address().Hex()). + Msg("ARM is uncursed") + return ccipModule.ChainClient.WaitForEvents() +} + +func (ccipModule *CCIPCommon) IsCursed() (bool, error) { + if ccipModule.ARM != nil { + return false, fmt.Errorf("real ARM deployed. cannot validate cursing") + } + if ccipModule.RMNContract == nil { + return false, fmt.Errorf("no ARM contract is set") + } + arm, err := mock_rmn_contract.NewMockRMNContract(*ccipModule.RMNContract, ccipModule.ChainClient.Backend()) + if err != nil { + return false, fmt.Errorf("error instantiating arm %w", err) + } + return arm.IsCursed0(nil) +} + +func (ccipModule *CCIPCommon) CurseARM() (*types.Transaction, error) { + if ccipModule.ARM != nil { + return nil, fmt.Errorf("real ARM deployed. cannot curse through test") + } + if ccipModule.RMNContract == nil { + return nil, fmt.Errorf("no ARM contract is set") + } + arm, err := mock_rmn_contract.NewMockRMNContract(*ccipModule.RMNContract, ccipModule.ChainClient.Backend()) + if err != nil { + return nil, fmt.Errorf("error instantiating arm %w", err) + } + opts, err := ccipModule.ChainClient.TransactionOpts(ccipModule.ChainClient.GetDefaultWallet()) + if err != nil { + return nil, fmt.Errorf("error getting owners for ARM VoteToCurse %w", err) + } + tx, err := arm.VoteToCurse(opts, [32]byte{}) + if err != nil { + return nil, fmt.Errorf("error in calling VoteToCurse %w", err) + } + err = ccipModule.ChainClient.ProcessTransaction(tx) + if err != nil { + return tx, err + } + log.Info(). + Str("ARM", arm.Address().Hex()). + Str("Network", ccipModule.ChainClient.GetNetworkName()). + Msg("ARM is cursed") + return tx, ccipModule.ChainClient.WaitForEvents() +} + +func (ccipModule *CCIPCommon) LoadContractAddresses(conf *laneconfig.LaneConfig, noOfTokens *int) { + if conf != nil { + if conf.AllowOutOfOrder { + ccipModule.AllowOutOfOrder = true + } + if common.IsHexAddress(conf.FeeToken) { + ccipModule.FeeToken = &contracts.LinkToken{ + EthAddress: common.HexToAddress(conf.FeeToken), + } + } + if conf.IsNativeFeeToken { + ccipModule.FeeToken = &contracts.LinkToken{ + EthAddress: common.HexToAddress("0x0"), + } + } + + if common.IsHexAddress(conf.Router) { + ccipModule.Router = &contracts.Router{ + EthAddress: common.HexToAddress(conf.Router), + } + } + if common.IsHexAddress(conf.ARM) { + addr := common.HexToAddress(conf.ARM) + ccipModule.RMNContract = &addr + if !conf.IsMockARM { + ccipModule.ARM = &contracts.ARM{ + EthAddress: addr, + } + } + } + if common.IsHexAddress(conf.PriceRegistry) { + ccipModule.PriceRegistry = &contracts.PriceRegistry{ + EthAddress: common.HexToAddress(conf.PriceRegistry), + } + } + if common.IsHexAddress(conf.WrappedNative) { + ccipModule.WrappedNative = common.HexToAddress(conf.WrappedNative) + } + if common.IsHexAddress(conf.Multicall) { + ccipModule.MulticallContract = common.HexToAddress(conf.Multicall) + } + if common.IsHexAddress(conf.TokenMessenger) { + addr := common.HexToAddress(conf.TokenMessenger) + ccipModule.TokenMessenger = &addr + } + if common.IsHexAddress(conf.TokenTransmitter) { + ccipModule.TokenTransmitter = &contracts.TokenTransmitter{ + ContractAddress: common.HexToAddress(conf.TokenTransmitter), + } + } + if len(conf.BridgeTokens) > 0 { + // if noOfTokens is set, then only take that many tokens from the list + // the lane config can have more tokens than required for the test + if noOfTokens != nil { + if len(conf.BridgeTokens) > *noOfTokens { + conf.BridgeTokens = conf.BridgeTokens[:*noOfTokens] + } + } + var tokens []*contracts.ERC20Token + for _, token := range conf.BridgeTokens { + if common.IsHexAddress(token) { + tokens = append(tokens, &contracts.ERC20Token{ + ContractAddress: common.HexToAddress(token), + }) + } + } + ccipModule.BridgeTokens = tokens + } + if len(conf.BridgeTokenPools) > 0 { + // if noOfTokens is set, then only take that many tokenpools from the list + // the lane config can have more tokenpools than required for the test + if noOfTokens != nil { + if len(conf.BridgeTokenPools) > *noOfTokens { + conf.BridgeTokenPools = conf.BridgeTokenPools[:*noOfTokens] + } + } + var pools []*contracts.TokenPool + for _, pool := range conf.BridgeTokenPools { + if common.IsHexAddress(pool) { + pools = append(pools, &contracts.TokenPool{ + EthAddress: common.HexToAddress(pool), + }) + } + } + ccipModule.BridgeTokenPools = pools + } + if len(conf.PriceAggregators) > 0 { + priceAggrs := make(map[common.Address]*contracts.MockAggregator) + for token, aggr := range conf.PriceAggregators { + if common.IsHexAddress(aggr) { + priceAggrs[common.HexToAddress(token)] = &contracts.MockAggregator{ + ContractAddress: common.HexToAddress(aggr), + } + } + } + ccipModule.PriceAggregators = priceAggrs + } + if common.IsHexAddress(conf.TokenAdminRegistry) { + ccipModule.TokenAdminRegistry = &contracts.TokenAdminRegistry{ + EthAddress: common.HexToAddress(conf.TokenAdminRegistry), + } + } + } +} + +// ApproveTokens approves tokens for the router to send usually a massive amount of tokens enough to cover all the ccip transfers +// to be triggered by the test. +// Also, if the test is using self-serve tokens and pools deployed by a separate `tokenDeployer` address, this sends some of those tokens +// to the default `ccipOwner` address to be used for the test. +func (ccipModule *CCIPCommon) ApproveTokens() error { + isApproved := false + for _, token := range ccipModule.BridgeTokens { + // TODO: We send half of token funds back to the CCIP Deployer account, which isn't particularly realistic. + // See CCIP-2477 + if token.OwnerWallet.Address() != ccipModule.ChainClient.GetDefaultWallet().Address() && + !ccipModule.ExistingDeployment { + tokenBalance, err := token.BalanceOf(context.Background(), token.OwnerWallet.Address()) + if err != nil { + return fmt.Errorf("failed to get balance of token %s: %w", token.ContractAddress.Hex(), err) + } + tokenBalance.Div(tokenBalance, big.NewInt(2)) // Send half of the balance to the default wallet + err = token.Transfer(token.OwnerWallet, ccipModule.ChainClient.GetDefaultWallet().Address(), tokenBalance) + if err != nil { + return fmt.Errorf("failed to transfer token from '%s' to '%s' %s: %w", + token.ContractAddress.Hex(), token.OwnerAddress.Hex(), ccipModule.ChainClient.GetDefaultWallet().Address(), err, + ) + } + } + + err := token.Approve(ccipModule.ChainClient.GetDefaultWallet(), ccipModule.Router.Address(), ApprovedAmountToRouter) + if err != nil { + return fmt.Errorf("failed to approve token %s: %w", token.ContractAddress.Hex(), err) + } + if token.ContractAddress == ccipModule.FeeToken.EthAddress { + isApproved = true + } + } + if ccipModule.FeeToken.EthAddress != common.HexToAddress("0x0") { + amount := ApprovedFeeAmountToRouter + if isApproved { + amount = new(big.Int).Add(ApprovedAmountToRouter, ApprovedFeeAmountToRouter) + } + allowance, err := ccipModule.FeeToken.Allowance(ccipModule.ChainClient.GetDefaultWallet().Address(), ccipModule.Router.Address()) + if err != nil { + return fmt.Errorf("failed to get allowance for token %s: %w", ccipModule.FeeToken.Address(), err) + } + if allowance.Cmp(amount) < 0 { + err := ccipModule.FeeToken.Approve(ccipModule.Router.Address(), amount) + if err != nil { + return fmt.Errorf("failed to approve fee token %s: %w", ccipModule.FeeToken.EthAddress.String(), err) + } + } + } + ccipModule.Logger.Info().Msg("Tokens approved") + + return nil +} + +func (ccipModule *CCIPCommon) CleanUp() error { + if !ccipModule.ExistingDeployment { + for i, pool := range ccipModule.BridgeTokenPools { + if !pool.IsLockRelease() { + continue + } + bal, err := ccipModule.BridgeTokens[i].BalanceOf(context.Background(), pool.Address()) + if err != nil { + return fmt.Errorf("error in getting pool balance %w", err) + } + if bal.Cmp(big.NewInt(0)) == 0 { + continue + } + err = pool.RemoveLiquidity(bal) + if err != nil { + return fmt.Errorf("error in removing liquidity %w", err) + } + } + err := ccipModule.ChainClient.WaitForEvents() + if err != nil { + return fmt.Errorf("error in waiting for events %wfmt.Sprintf(\"Setting mockserver response\")", err) + } + } + return nil +} + +func (ccipModule *CCIPCommon) WaitForPriceUpdates( + ctx context.Context, + lggr *zerolog.Logger, + timeout time.Duration, + destChainId uint64, + allTokens []common.Address, +) error { + destChainSelector, err := chainselectors.SelectorFromChainId(destChainId) + if err != nil { + return err + } + // check if price is already updated + price, err := ccipModule.PriceRegistry.Instance.GetDestinationChainGasPrice(nil, destChainSelector) + if err != nil { + return err + } + + if price.Timestamp > 0 && price.Value.Cmp(big.NewInt(0)) > 0 { + lggr.Info(). + Str("Price Registry", ccipModule.PriceRegistry.Address()). + Uint64("dest chain", destChainId). + Str("source chain", ccipModule.ChainClient.GetNetworkName()). + Msg("Price already updated") + return nil + } + // if not, wait for price update + lggr.Info().Msgf("Waiting for UsdPerUnitGas and UsdPerTokenUpdated for dest chain %d Price Registry %s", destChainId, ccipModule.PriceRegistry.Address()) + ticker := time.NewTicker(time.Second) + defer ticker.Stop() + localCtx, cancel := context.WithTimeout(ctx, timeout) + defer cancel() + var tokensMissingForUpdate common.Address + for { + select { + case <-ticker.C: + ccipModule.gasUpdateWatcherMu.Lock() + timestampOfUpdate, ok := ccipModule.gasUpdateWatcher[destChainId] + ccipModule.gasUpdateWatcherMu.Unlock() + tokenPricesUpdated := false + if len(allTokens) > 0 { + ccipModule.tokenPriceUpdateWatcherMu.Lock() + for _, token := range allTokens { + timestampOfTokenUpdate, okToken := ccipModule.tokenPriceUpdateWatcher[token] + // we consider token prices updated only if all tokens have been updated + // if any token is missing, we retry + if !okToken || timestampOfTokenUpdate.Cmp(big.NewInt(0)) < 1 { + tokenPricesUpdated = false + tokensMissingForUpdate = token + break + } + tokenPricesUpdated = true + } + ccipModule.tokenPriceUpdateWatcherMu.Unlock() + } + + if tokenPricesUpdated && ok && timestampOfUpdate.Cmp(big.NewInt(0)) == 1 { + lggr.Info(). + Str("Price Registry", ccipModule.PriceRegistry.Address()). + Uint64("dest chain", destChainId). + Str("source chain", ccipModule.ChainClient.GetNetworkName()). + Msg("Price updated") + return nil + } + case <-localCtx.Done(): + if tokensMissingForUpdate != (common.Address{}) { + return fmt.Errorf("price Updates not found for token %s", tokensMissingForUpdate.Hex()) + } + return fmt.Errorf("price Updates not found for chain %d", destChainId) + } + } +} + +// WatchForPriceUpdates helps to ensure the price updates are happening in price registry by subscribing to a couple +// of price update events and add the event details to watchers. It subscribes to 'UsdPerUnitGasUpdated' +// and 'UsdPerTokenUpdated' event. +func (ccipModule *CCIPCommon) WatchForPriceUpdates(ctx context.Context, lggr *zerolog.Logger) error { + gasUpdateEventLatest := make(chan *fee_quoter.FeeQuoterUsdPerUnitGasUpdated) + tokenUpdateEvent := make(chan *fee_quoter.FeeQuoterUsdPerTokenUpdated) + sub := event.Resubscribe(DefaultResubscriptionTimeout, func(_ context.Context) (event.Subscription, error) { + lggr.Info().Msg("Subscribing to UsdPerUnitGasUpdated event") + eventSub, err := ccipModule.PriceRegistry.WatchUsdPerUnitGasUpdated(nil, gasUpdateEventLatest, nil) + if err != nil { + log.Error().Err(err).Msg("error in subscribing to UsdPerUnitGasUpdated event") + } + return eventSub, err + }) + if sub == nil { + return fmt.Errorf("no event subscription found") + } + tokenUpdateSub := event.Resubscribe(DefaultResubscriptionTimeout, func(_ context.Context) (event.Subscription, error) { + lggr.Info().Msg("Subscribing to UsdPerTokenUpdated event") + eventSub, err := ccipModule.PriceRegistry.WatchUsdPerTokenUpdated(nil, tokenUpdateEvent) + if err != nil { + log.Error().Err(err).Msg("error in subscribing to UsdPerTokenUpdated event") + } + return eventSub, err + }) + if tokenUpdateSub == nil { + return fmt.Errorf("no event subscription found") + } + processEvent := func(value, timestamp *big.Int, destChainSelector uint64, raw types.Log) error { + destChain, err := chainselectors.ChainIdFromSelector(destChainSelector) + if err != nil { + return err + } + ccipModule.gasUpdateWatcherMu.Lock() + ccipModule.gasUpdateWatcher[destChain] = timestamp + + ccipModule.GasUpdateEvents = append(ccipModule.GasUpdateEvents, contracts.GasUpdateEvent{ + Sender: raw.Address.Hex(), + Tx: raw.TxHash.Hex(), + Value: value, + DestChain: destChain, + Source: ccipModule.ChainClient.GetNetworkName(), + }) + ccipModule.gasUpdateWatcherMu.Unlock() + lggr.Info(). + Uint64("chainSelector", destChainSelector). + Uint64("dest_chain", destChain). + Str("price_registry", ccipModule.PriceRegistry.Address()). + Str("tx hash", raw.TxHash.Hex()). + Msgf("UsdPerUnitGasUpdated event received for dest chain: %d, source chain: %s", + destChain, ccipModule.ChainClient.GetNetworkName()) + return nil + } + go func() { + defer func() { + sub.Unsubscribe() + tokenUpdateSub.Unsubscribe() + ccipModule.gasUpdateWatcher = nil + ccipModule.gasUpdateWatcherMu = nil + ccipModule.GasUpdateEvents = nil + ccipModule.tokenPriceUpdateWatcher = nil + ccipModule.tokenPriceUpdateWatcherMu = nil + }() + for { + select { + case e := <-gasUpdateEventLatest: + err := processEvent(e.Value, e.Timestamp, e.DestChain, e.Raw) + if err != nil { + continue + } + case tk := <-tokenUpdateEvent: + ccipModule.tokenPriceUpdateWatcherMu.Lock() + ccipModule.tokenPriceUpdateWatcher[tk.Token] = tk.Timestamp + ccipModule.tokenPriceUpdateWatcherMu.Unlock() + lggr.Info(). + Str("token", tk.Token.Hex()). + Str("chain", ccipModule.ChainClient.GetNetworkName()). + Str("price_registry", ccipModule.PriceRegistry.Address()). + Msg("UsdPerTokenUpdated event received") + case <-ctx.Done(): + return + } + } + }() + + return nil +} + +// UpdateTokenPricesAtRegularInterval updates aggregator contract with updated answer at regular interval. +// At each iteration of ticker it chooses one of the aggregator contracts and updates its round answer. +func (ccipModule *CCIPCommon) UpdateTokenPricesAtRegularInterval(ctx context.Context, lggr *zerolog.Logger, interval time.Duration, conf *laneconfig.LaneConfig) error { + if ccipModule.ExistingDeployment { + return nil + } + var aggregators []*contracts.MockAggregator + for _, aggregatorContract := range conf.PriceAggregators { + contract, err := ccipModule.Deployer.NewMockAggregator(common.HexToAddress(aggregatorContract)) + if err != nil { + return err + } + aggregators = append(aggregators, contract) + } + go func(aggregators []*contracts.MockAggregator) { + rand.NewSource(uint64(time.Now().UnixNano())) + ticker := time.NewTicker(interval) + for { + select { + case <-ticker.C: + // randomly choose an aggregator contract from slice of aggregators + randomIndex := rand.Intn(len(aggregators)) + err := aggregators[randomIndex].UpdateRoundData(nil, ptr.Ptr(-5), ptr.Ptr(2)) + if err != nil { + lggr.Error().Err(err).Msg("error in updating round data") + continue + } + case <-ctx.Done(): + return + } + } + }(aggregators) + return nil +} + +// SyncUSDCDomain makes domain updates to Source usdc pool domain with - +// 1. USDC domain from destination chain's token transmitter contract +// 2. Destination pool address as allowed caller +func (ccipModule *CCIPCommon) SyncUSDCDomain(destTransmitter *contracts.TokenTransmitter, destPools []*contracts.TokenPool, destChainID uint64) error { + // if not USDC new deployment, return + // if existing deployment, consider that no syncing is required and return + if ccipModule.ExistingDeployment || !ccipModule.IsUSDCDeployment() { + return nil + } + if destTransmitter == nil { + return fmt.Errorf("invalid address") + } + destChainSelector, err := chainselectors.SelectorFromChainId(destChainID) + if err != nil { + return fmt.Errorf("invalid chain id %w", err) + } + + // sync USDC domain + for i, pool := range ccipModule.BridgeTokenPools { + if !pool.IsUSDC() { + continue + } + if destPools[i] == nil { + return fmt.Errorf("invalid pool address") + } + if !destPools[i].IsUSDC() { + return fmt.Errorf("corresponding dest pool is not USDC pool") + } + err = pool.SyncUSDCDomain(destTransmitter, destPools[i].EthAddress, destChainSelector) + if err != nil { + return err + } + err = destPools[i].MintUSDCToUSDCPool() + if err != nil { + return err + } + } + + return ccipModule.ChainClient.WaitForEvents() +} + +func (ccipModule *CCIPCommon) PollRPCConnection(ctx context.Context, lggr *zerolog.Logger) { + for { + select { + case reconnectTime := <-ccipModule.ChainClient.ConnectionRestored(): + if ccipModule.IsConnectionRestoredRecently == nil { + ccipModule.IsConnectionRestoredRecently = atomic.NewBool(true) + } else { + ccipModule.IsConnectionRestoredRecently.Store(true) + } + lggr.Info().Time("Restored At", reconnectTime).Str("Network", ccipModule.ChainClient.GetNetworkName()).Msg("Connection Restored") + case issueTime := <-ccipModule.ChainClient.ConnectionIssue(): + if ccipModule.IsConnectionRestoredRecently == nil { + ccipModule.IsConnectionRestoredRecently = atomic.NewBool(false) + } else { + ccipModule.IsConnectionRestoredRecently.Store(false) + } + lggr.Info().Time("Started At", issueTime).Str("Network", ccipModule.ChainClient.GetNetworkName()).Msg("RPC Disconnected") + case <-ctx.Done(): + return + } + } +} + +func (ccipModule *CCIPCommon) IsUSDCDeployment() bool { + return pointer.GetBool(ccipModule.USDCMockDeployment) +} + +func (ccipModule *CCIPCommon) WriteLaneConfig(conf *laneconfig.LaneConfig) { + var btAddresses, btpAddresses []string + priceAggrs := make(map[string]string) + for i, bt := range ccipModule.BridgeTokens { + btAddresses = append(btAddresses, bt.Address()) + btpAddresses = append(btpAddresses, ccipModule.BridgeTokenPools[i].Address()) + } + for k, v := range ccipModule.PriceAggregators { + priceAggrs[k.Hex()] = v.ContractAddress.Hex() + } + conf.CommonContracts = laneconfig.CommonContracts{ + FeeToken: ccipModule.FeeToken.Address(), + BridgeTokens: btAddresses, + BridgeTokenPools: btpAddresses, + ARM: ccipModule.RMNContract.Hex(), + Router: ccipModule.Router.Address(), + PriceRegistry: ccipModule.PriceRegistry.Address(), + PriceAggregators: priceAggrs, + WrappedNative: ccipModule.WrappedNative.Hex(), + Multicall: ccipModule.MulticallContract.Hex(), + } + if ccipModule.TokenAdminRegistry != nil { + conf.CommonContracts.TokenAdminRegistry = ccipModule.TokenAdminRegistry.Address() + } + if ccipModule.TokenTransmitter != nil { + conf.CommonContracts.TokenTransmitter = ccipModule.TokenTransmitter.ContractAddress.Hex() + } + if ccipModule.TokenMessenger != nil { + conf.CommonContracts.TokenMessenger = ccipModule.TokenMessenger.Hex() + } + if ccipModule.ARM == nil { + conf.CommonContracts.IsMockARM = true + } +} + +func (ccipModule *CCIPCommon) AddPriceAggregatorToken(token common.Address, initialAns *big.Int) error { + // check if dynamic price update is enabled + if ccipModule.NoOfTokensNeedingDynamicPrice <= 0 { + return nil + } + var err error + if aggregator, ok := ccipModule.PriceAggregators[token]; !ok { + ccipModule.PriceAggregators[token], err = ccipModule.Deployer.DeployMockAggregator(18, initialAns) + if err != nil { + return fmt.Errorf("deploying mock aggregator contract shouldn't fail %w", err) + } + } else { + ccipModule.PriceAggregators[token], err = ccipModule.Deployer.NewMockAggregator(aggregator.ContractAddress) + if err != nil { + return fmt.Errorf("error instantiating price aggregator for token %s", token.Hex()) + } + } + ccipModule.NoOfTokensNeedingDynamicPrice-- + return nil +} + +// DeployContracts deploys the contracts which are necessary in both source and dest chain +// This reuses common contracts for bidirectional lanes +func (ccipModule *CCIPCommon) DeployContracts( + noOfTokens int, + tokenDeployerFns []blockchain.ContractDeployer, + conf *laneconfig.LaneConfig, +) error { + var err error + cd := ccipModule.Deployer + + ccipModule.LoadContractAddresses(conf, &noOfTokens) + if ccipModule.ARM != nil { + arm, err := cd.NewRMNContract(ccipModule.ARM.EthAddress) + if err != nil { + return fmt.Errorf("getting new ARM contract shouldn't fail %w", err) + } + ccipModule.ARM = arm + } else { + // deploy a mock ARM contract + if ccipModule.RMNContract == nil { + if ccipModule.ExistingDeployment { + return fmt.Errorf("ARM contract address is not provided in lane config") + } + ccipModule.RMNContract, err = cd.DeployMockRMNContract() + if err != nil { + return fmt.Errorf("deploying mock ARM contract shouldn't fail %w", err) + } + err = ccipModule.ChainClient.WaitForEvents() + if err != nil { + return fmt.Errorf("error in waiting for mock ARM deployment %w", err) + } + } + } + if ccipModule.WrappedNative == common.HexToAddress("0x0") { + if ccipModule.ExistingDeployment { + return fmt.Errorf("wrapped native contract address is not provided in lane config") + } + weth9addr, err := cd.DeployWrappedNative() + if err != nil { + return fmt.Errorf("deploying wrapped native shouldn't fail %w", err) + } + err = ccipModule.AddPriceAggregatorToken(*weth9addr, WrappedNativeToUSD) + if err != nil { + return fmt.Errorf("deploying mock aggregator contract shouldn't fail %w", err) + } + err = ccipModule.ChainClient.WaitForEvents() + if err != nil { + return fmt.Errorf("waiting for deploying wrapped native shouldn't fail %w", err) + } + ccipModule.WrappedNative = *weth9addr + } + + if ccipModule.Router == nil { + if ccipModule.ExistingDeployment { + return fmt.Errorf("router contract address is not provided in lane config") + } + ccipModule.Router, err = cd.DeployRouter(ccipModule.WrappedNative, *ccipModule.RMNContract) + if err != nil { + return fmt.Errorf("deploying router shouldn't fail %w", err) + } + err = ccipModule.ChainClient.WaitForEvents() + if err != nil { + return fmt.Errorf("error in waiting for router deployment %w", err) + } + } else { + r, err := cd.NewRouter(ccipModule.Router.EthAddress) + if err != nil { + return fmt.Errorf("getting new router contract shouldn't fail %w", err) + } + ccipModule.Router = r + } + if ccipModule.FeeToken == nil { + if ccipModule.ExistingDeployment { + return fmt.Errorf("FeeToken contract address is not provided in lane config") + } + // deploy link token + token, err := cd.DeployLinkTokenContract() + if err != nil { + return fmt.Errorf("deploying fee token contract shouldn't fail %w", err) + } + + ccipModule.FeeToken = token + err = ccipModule.AddPriceAggregatorToken(ccipModule.FeeToken.EthAddress, LinkToUSD) + if err != nil { + return fmt.Errorf("deploying mock aggregator contract shouldn't fail %w", err) + } + err = ccipModule.ChainClient.WaitForEvents() + if err != nil { + return fmt.Errorf("error in waiting for feetoken deployment %w", err) + } + } else { + token, err := cd.NewLinkTokenContract(common.HexToAddress(ccipModule.FeeToken.Address())) + if err != nil { + return fmt.Errorf("getting fee token contract shouldn't fail %w", err) + } + ccipModule.FeeToken = token + } + + // If the number of deployed bridge tokens does not match noOfTokens, deploy rest of the tokens in case ExistingDeployment is false + // In case of ExistingDeployment as true use whatever is provided in laneconfig + if len(ccipModule.BridgeTokens) < noOfTokens && !ccipModule.ExistingDeployment { + // deploy bridge token. + for i := len(ccipModule.BridgeTokens); i < noOfTokens; i++ { + var token *contracts.ERC20Token + + if len(tokenDeployerFns) != noOfTokens { + if ccipModule.IsUSDCDeployment() && i == 0 { + // if it's USDC deployment, we deploy the burn mint token 677 with decimal 6 and cast it to ERC20Token + usdcToken, err := ccipModule.tokenDeployer.DeployBurnMintERC677(new(big.Int).Mul(big.NewInt(1e6), big.NewInt(1e18))) + if err != nil { + return fmt.Errorf("deploying bridge usdc token contract shouldn't fail %w", err) + } + token, err = ccipModule.tokenDeployer.NewERC20TokenContract(usdcToken.ContractAddress) + if err != nil { + return fmt.Errorf("getting new bridge usdc token contract shouldn't fail %w", err) + } + if ccipModule.TokenTransmitter == nil { + domain, err := GetUSDCDomain(ccipModule.ChainClient.GetNetworkName(), ccipModule.ChainClient.NetworkSimulated()) + if err != nil { + return fmt.Errorf("error in getting USDC domain %w", err) + } + + ccipModule.TokenTransmitter, err = ccipModule.tokenDeployer.DeployTokenTransmitter(domain, usdcToken.ContractAddress) + if err != nil { + return fmt.Errorf("deploying token transmitter shouldn't fail %w", err) + } + } + if ccipModule.TokenMessenger == nil { + if ccipModule.TokenTransmitter == nil { + return fmt.Errorf("TokenTransmitter contract address is not provided") + } + ccipModule.TokenMessenger, err = ccipModule.tokenDeployer.DeployTokenMessenger(ccipModule.TokenTransmitter.ContractAddress) + if err != nil { + return fmt.Errorf("deploying token messenger shouldn't fail %w", err) + } + err = ccipModule.ChainClient.WaitForEvents() + if err != nil { + return fmt.Errorf("error in waiting for mock TokenMessenger and Transmitter deployment %w", err) + } + } + + // grant minter role to token messenger + err = usdcToken.GrantMintAndBurn(*ccipModule.TokenMessenger) + if err != nil { + return fmt.Errorf("granting minter role to token messenger shouldn't fail %w", err) + } + err = usdcToken.GrantMintAndBurn(ccipModule.TokenTransmitter.ContractAddress) + if err != nil { + return fmt.Errorf("granting minter role to token transmitter shouldn't fail %w", err) + } + } else { + // otherwise we deploy link token and cast it to ERC20Token + linkToken, err := ccipModule.tokenDeployer.DeployLinkTokenContract() + if err != nil { + return fmt.Errorf("deploying bridge token contract shouldn't fail %w", err) + } + token, err = ccipModule.tokenDeployer.NewERC20TokenContract(common.HexToAddress(linkToken.Address())) + if err != nil { + return fmt.Errorf("getting new bridge token contract shouldn't fail %w", err) + } + err = ccipModule.AddPriceAggregatorToken(linkToken.EthAddress, LinkToUSD) + if err != nil { + return fmt.Errorf("deploying mock aggregator contract shouldn't fail %w", err) + } + } + } else { + token, err = ccipModule.tokenDeployer.DeployERC20TokenContract(tokenDeployerFns[i]) + if err != nil { + return fmt.Errorf("deploying bridge token contract shouldn't fail %w", err) + } + err = ccipModule.AddPriceAggregatorToken(token.ContractAddress, LinkToUSD) + if err != nil { + return fmt.Errorf("deploying mock aggregator contract shouldn't fail %w", err) + } + } + ccipModule.BridgeTokens = append(ccipModule.BridgeTokens, token) + + } + if err = ccipModule.ChainClient.WaitForEvents(); err != nil { + return fmt.Errorf("error in waiting for bridge token deployment %w", err) + } + } + + var tokens []*contracts.ERC20Token + for _, token := range ccipModule.BridgeTokens { + newToken, err := ccipModule.tokenDeployer.NewERC20TokenContract(common.HexToAddress(token.Address())) + if err != nil { + return fmt.Errorf("getting new bridge token contract shouldn't fail %w", err) + } + tokens = append(tokens, newToken) + } + ccipModule.BridgeTokens = tokens + if len(ccipModule.BridgeTokenPools) != len(ccipModule.BridgeTokens) { + if ccipModule.ExistingDeployment { + return fmt.Errorf("bridge token pool contract address is not provided in lane config") + } + // deploy native token pool + for i := len(ccipModule.BridgeTokenPools); i < len(ccipModule.BridgeTokens); i++ { + token := ccipModule.BridgeTokens[i] + // usdc pool need to be the first one in the slice + if ccipModule.IsUSDCDeployment() && i == 0 { + // deploy usdc token pool in case of usdc deployment + if ccipModule.TokenMessenger == nil { + return fmt.Errorf("TokenMessenger contract address is not provided") + } + if ccipModule.TokenTransmitter == nil { + return fmt.Errorf("TokenTransmitter contract address is not provided") + } + usdcPool, err := ccipModule.tokenDeployer.DeployUSDCTokenPoolContract(token.Address(), *ccipModule.TokenMessenger, *ccipModule.RMNContract, ccipModule.Router.Instance.Address()) + if err != nil { + return fmt.Errorf("deploying bridge Token pool(usdc) shouldn't fail %w", err) + } + + ccipModule.BridgeTokenPools = append(ccipModule.BridgeTokenPools, usdcPool) + } else { + // deploy lock release token pool in case of non-usdc deployment + btp, err := ccipModule.tokenDeployer.DeployLockReleaseTokenPoolContract(token.Address(), *ccipModule.RMNContract, ccipModule.Router.Instance.Address()) + if err != nil { + return fmt.Errorf("deploying bridge Token pool(lock&release) shouldn't fail %w", err) + } + ccipModule.BridgeTokenPools = append(ccipModule.BridgeTokenPools, btp) + + err = btp.AddLiquidity(token, token.OwnerWallet, ccipModule.poolFunds) + if err != nil { + return fmt.Errorf("adding liquidity token to dest pool shouldn't fail %w", err) + } + } + } + } else { + var pools []*contracts.TokenPool + for _, pool := range ccipModule.BridgeTokenPools { + newPool, err := ccipModule.tokenDeployer.NewLockReleaseTokenPoolContract(pool.EthAddress) + if err != nil { + return fmt.Errorf("getting new bridge token pool contract shouldn't fail %w", err) + } + pools = append(pools, newPool) + } + ccipModule.BridgeTokenPools = pools + } + + // no need to have price registry for existing deployment, we consider that it's already deployed + if !ccipModule.ExistingDeployment { + if ccipModule.PriceRegistry == nil { + // we will update the price updates later based on source and dest PriceUpdates + ccipModule.PriceRegistry, err = cd.DeployPriceRegistry( + []common.Address{ + common.HexToAddress(ccipModule.FeeToken.Address()), + common.HexToAddress(ccipModule.WrappedNative.Hex()), + }) + if err != nil { + return fmt.Errorf("deploying PriceRegistry shouldn't fail %w", err) + } + err = ccipModule.ChainClient.WaitForEvents() + if err != nil { + return fmt.Errorf("error in waiting for PriceRegistry deployment %w", err) + } + } else { + ccipModule.PriceRegistry, err = cd.NewPriceRegistry(ccipModule.PriceRegistry.EthAddress) + if err != nil { + return fmt.Errorf("getting new PriceRegistry contract shouldn't fail %w", err) + } + } + } + if ccipModule.MulticallContract == (common.Address{}) && ccipModule.MulticallEnabled { + ccipModule.MulticallContract, err = cd.DeployMultiCallContract() + if err != nil { + return fmt.Errorf("deploying multicall contract shouldn't fail %w", err) + } + } + + // if the version is after 1.4.0, we need to deploy TokenAdminRegistry + // no need to have token admin registry for existing deployment, we consider that it's already deployed + if contracts.NeedTokenAdminRegistry() && !ccipModule.ExistingDeployment { + if ccipModule.TokenAdminRegistry == nil { + // deploy token admin registry + ccipModule.TokenAdminRegistry, err = cd.DeployTokenAdminRegistry() + if err != nil { + return fmt.Errorf("deploying token admin registry shouldn't fail %w", err) + } + err = ccipModule.ChainClient.WaitForEvents() + if err != nil { + return fmt.Errorf("error in waiting for token admin registry deployment %w", err) + } + + if len(ccipModule.BridgeTokens) != len(ccipModule.BridgeTokenPools) { + return fmt.Errorf("tokens number %d and pools number %d do not match", len(ccipModule.BridgeTokens), len(ccipModule.BridgeTokenPools)) + } + // add all pools to registry + for i, pool := range ccipModule.BridgeTokenPools { + token := ccipModule.BridgeTokens[i] + err := ccipModule.TokenAdminRegistry.SetAdminAndRegisterPool(token.ContractAddress, pool.EthAddress) + if err != nil { + return fmt.Errorf("error setting up token %s and pool %s on TokenAdminRegistry : %w", token.Address(), pool.Address(), err) + } + } + err = ccipModule.ChainClient.WaitForEvents() + if err != nil { + return fmt.Errorf("error in waiting for token admin registry set up with tokens and pools %w", err) + } + } else { + ccipModule.TokenAdminRegistry, err = cd.NewTokenAdminRegistry(ccipModule.TokenAdminRegistry.EthAddress) + if err != nil { + return fmt.Errorf("getting new token admin registry contract shouldn't fail %w", err) + } + } + } + ccipModule.Logger.Info().Msg("Finished deploying common contracts") + // approve router to spend fee token + return ccipModule.ApproveTokens() +} + +func (ccipModule *CCIPCommon) AvgBlockTime(ctx context.Context) (time.Duration, error) { + return ccipModule.ChainClient.AvgBlockTime(ctx) +} + +// DynamicPriceGetterConfig specifies the configuration for the price getter in price pipeline. +// This should match pricegetter.DynamicPriceGetterConfig in core/services/ocr2/plugins/ccip/internal/pricegetter +type DynamicPriceGetterConfig struct { + AggregatorPrices map[common.Address]AggregatorPriceConfig `json:"aggregatorPrices"` + StaticPrices map[common.Address]StaticPriceConfig `json:"staticPrices"` +} + +func (d *DynamicPriceGetterConfig) AddPriceConfig( + tokenAddr string, + aggregatorMap map[common.Address]*contracts.MockAggregator, + price *big.Int, + chainID uint64, +) error { + aggregatorContract, ok := aggregatorMap[common.HexToAddress(tokenAddr)] + if !ok || aggregatorContract == nil { + return d.AddStaticPriceConfig(tokenAddr, chainID, price) + } + return d.AddAggregatorPriceConfig(tokenAddr, aggregatorMap, price) +} + +func (d *DynamicPriceGetterConfig) AddAggregatorPriceConfig( + tokenAddr string, + aggregatorMap map[common.Address]*contracts.MockAggregator, + price *big.Int, +) error { + aggregatorContract, ok := aggregatorMap[common.HexToAddress(tokenAddr)] + if !ok || aggregatorContract == nil { + return fmt.Errorf("aggregator contract not found for token %s", tokenAddr) + } + // update round Data + err := aggregatorContract.UpdateRoundData(price, nil, nil) + if err != nil { + return fmt.Errorf("error in updating round data %w", err) + } + + d.AggregatorPrices[common.HexToAddress(tokenAddr)] = AggregatorPriceConfig{ + ChainID: aggregatorContract.ChainID(), + AggregatorContractAddress: aggregatorContract.ContractAddress, + } + return nil +} + +func (d *DynamicPriceGetterConfig) AddStaticPriceConfig(tokenAddr string, chainID uint64, price *big.Int) error { + d.StaticPrices[common.HexToAddress(tokenAddr)] = StaticPriceConfig{ + ChainID: chainID, + Price: price, + } + return nil +} + +func (d *DynamicPriceGetterConfig) String() (string, error) { + tokenPricesConfigBytes, err := json.MarshalIndent(d, "", " ") + if err != nil { + return "", fmt.Errorf("error in marshalling token prices config %w", err) + } + return string(tokenPricesConfigBytes), nil +} + +// AggregatorPriceConfig specifies a price retrieved from an aggregator contract. +// This should match pricegetter.AggregatorPriceConfig in core/services/ocr2/plugins/ccip/internal/pricegetter +type AggregatorPriceConfig struct { + ChainID uint64 `json:"chainID,string"` + AggregatorContractAddress common.Address `json:"contractAddress"` +} + +// StaticPriceConfig specifies a price defined statically. +// This should match pricegetter.StaticPriceConfig in core/services/ocr2/plugins/ccip/internal/pricegetter +type StaticPriceConfig struct { + ChainID uint64 `json:"chainID,string"` + Price *big.Int `json:"price"` +} + +func NewCCIPCommonFromConfig( + logger *zerolog.Logger, + testGroupConf *testconfig.CCIPTestGroupConfig, + chainClient blockchain.EVMClient, + laneConfig *laneconfig.LaneConfig, +) (*CCIPCommon, error) { + newCCIPModule, err := DefaultCCIPModule(logger, testGroupConf, chainClient) + if err != nil { + return nil, err + } + newCD := newCCIPModule.Deployer + newCCIPModule.LoadContractAddresses(laneConfig, testGroupConf.TokenConfig.NoOfTokensPerChain) + if newCCIPModule.TokenAdminRegistry != nil { + newCCIPModule.TokenAdminRegistry, err = newCD.NewTokenAdminRegistry(common.HexToAddress(newCCIPModule.TokenAdminRegistry.Address())) + if err != nil { + return nil, err + } + } + var arm *contracts.ARM + if newCCIPModule.ARM != nil { + arm, err = newCD.NewRMNContract(*newCCIPModule.RMNContract) + if err != nil { + return nil, err + } + newCCIPModule.ARM = arm + } + var pools []*contracts.TokenPool + for i := range newCCIPModule.BridgeTokenPools { + // if there is usdc token, the corresponding pool will always be added as first one in the slice + if newCCIPModule.IsUSDCDeployment() && i == 0 { + pool, err := newCCIPModule.tokenDeployer.NewUSDCTokenPoolContract(common.HexToAddress(newCCIPModule.BridgeTokenPools[i].Address())) + if err != nil { + return nil, err + } + pools = append(pools, pool) + } else { + pool, err := newCCIPModule.tokenDeployer.NewLockReleaseTokenPoolContract(common.HexToAddress(newCCIPModule.BridgeTokenPools[i].Address())) + if err != nil { + return nil, err + } + pools = append(pools, pool) + } + } + newCCIPModule.BridgeTokenPools = pools + var tokens []*contracts.ERC20Token + for i := range newCCIPModule.BridgeTokens { + token, err := newCCIPModule.tokenDeployer.NewERC20TokenContract(common.HexToAddress(newCCIPModule.BridgeTokens[i].Address())) + if err != nil { + return nil, err + } + tokens = append(tokens, token) + } + newCCIPModule.BridgeTokens = tokens + priceAggregators := make(map[common.Address]*contracts.MockAggregator) + for k, v := range newCCIPModule.PriceAggregators { + aggregator, err := newCD.NewMockAggregator(v.ContractAddress) + if err != nil { + return nil, err + } + priceAggregators[k] = aggregator + } + newCCIPModule.PriceAggregators = priceAggregators + newCCIPModule.FeeToken, err = newCCIPModule.Deployer.NewLinkTokenContract(common.HexToAddress(newCCIPModule.FeeToken.Address())) + if err != nil { + return nil, err + } + if newCCIPModule.PriceRegistry != nil { + newCCIPModule.PriceRegistry, err = newCCIPModule.Deployer.NewPriceRegistry(common.HexToAddress(newCCIPModule.PriceRegistry.Address())) + if err != nil { + return nil, err + } + } + newCCIPModule.Router, err = newCCIPModule.Deployer.NewRouter(common.HexToAddress(newCCIPModule.Router.Address())) + if err != nil { + return nil, err + } + if newCCIPModule.TokenTransmitter != nil { + newCCIPModule.TokenTransmitter, err = newCCIPModule.Deployer.NewTokenTransmitter(newCCIPModule.TokenTransmitter.ContractAddress) + if err != nil { + return nil, err + } + } + return newCCIPModule, nil +} + +func DefaultCCIPModule( + logger *zerolog.Logger, + testGroupConf *testconfig.CCIPTestGroupConfig, + chainClient blockchain.EVMClient, +) (*CCIPCommon, error) { + networkCfg := chainClient.GetNetworkConfig() + tokenDeployerChainClient, err := blockchain.ConcurrentEVMClient(*networkCfg, nil, chainClient, *logger) + if err != nil { + return nil, errors.WithStack(fmt.Errorf("failed to create token deployment chain client for %s: %w", networkCfg.Name, err)) + } + // If we want to deploy tokens as a non CCIP owner, we need to set the default wallet to something other than the first one. The first wallet is used as default CCIP owner for all other ccip contract deployment. + // This is not needed for existing deployment as the tokens and pools are already deployed. + if contracts.NeedTokenAdminRegistry() && + !pointer.GetBool(testGroupConf.TokenConfig.CCIPOwnerTokens) && + !pointer.GetBool(testGroupConf.ExistingDeployment) && + len(tokenDeployerChainClient.GetWallets()) > 1 { + if err = tokenDeployerChainClient.SetDefaultWallet(1); err != nil { + return nil, errors.WithStack(fmt.Errorf("failed to set default wallet for token deployment client %s: %w", networkCfg.Name, err)) + } + } + cd, err := contracts.NewCCIPContractsDeployer(logger, chainClient) + if err != nil { + return nil, err + } + tokenCD, err := contracts.NewCCIPContractsDeployer(logger, tokenDeployerChainClient) + if err != nil { + return nil, err + } + return &CCIPCommon{ + Logger: logger, + ChainClient: chainClient, + Deployer: cd, + tokenDeployer: tokenCD, + RateLimiterConfig: contracts.RateLimiterConfig{ + Rate: contracts.FiftyCoins, + Capacity: contracts.HundredCoins, + }, + ExistingDeployment: pointer.GetBool(testGroupConf.ExistingDeployment), + MulticallEnabled: pointer.GetBool(testGroupConf.MulticallInOneTx), + USDCMockDeployment: testGroupConf.USDCMockDeployment, + NoOfTokensNeedingDynamicPrice: pointer.GetInt(testGroupConf.TokenConfig.NoOfTokensWithDynamicPrice), + poolFunds: testhelpers.Link(5), + gasUpdateWatcherMu: &sync.Mutex{}, + gasUpdateWatcher: make(map[uint64]*big.Int), + tokenPriceUpdateWatcherMu: &sync.Mutex{}, + tokenPriceUpdateWatcher: make(map[common.Address]*big.Int), + PriceAggregators: make(map[common.Address]*contracts.MockAggregator), + }, nil +} + +type SourceCCIPModule struct { + Common *CCIPCommon + Sender common.Address + TransferAmount []*big.Int + MsgDataLength int64 + DestinationChainId uint64 + DestChainSelector uint64 + DestNetworkName string + OnRamp *contracts.OnRamp + SrcStartBlock uint64 + CCIPSendRequestedWatcher *sync.Map // map[string]*evm_2_evm_onramp.EVM2EVMOnRampCCIPSendRequested + NewFinalizedBlockNum atomic.Uint64 + NewFinalizedBlockTimestamp atomic.Time +} + +func (sourceCCIP *SourceCCIPModule) PayCCIPFeeToOwnerAddress() error { + isNativeFee := sourceCCIP.Common.FeeToken.EthAddress == common.HexToAddress("0x0") + if isNativeFee { + err := sourceCCIP.OnRamp.WithdrawNonLinkFees(sourceCCIP.Common.WrappedNative) + if err != nil { + return err + } + } else { + err := sourceCCIP.OnRamp.SetNops() + if err != nil { + return err + } + err = sourceCCIP.OnRamp.PayNops() + if err != nil { + return err + } + } + return nil +} + +func (sourceCCIP *SourceCCIPModule) LoadContracts(conf *laneconfig.LaneConfig) { + if conf != nil { + cfg, ok := conf.SrcContracts[sourceCCIP.DestNetworkName] + if ok { + if common.IsHexAddress(cfg.OnRamp) { + sourceCCIP.OnRamp = &contracts.OnRamp{ + EthAddress: common.HexToAddress(cfg.OnRamp), + } + } + if cfg.DeployedAt > 0 { + sourceCCIP.SrcStartBlock = cfg.DeployedAt + } + } + } +} + +// SetAllTokenTransferFeeConfigs sets a default transfer fee config for all BridgeTokens on the CCIP source chain. +// enableAggregateRateLimit is used to enable/disable aggregate rate limit for all BridgeTokens. +func (sourceCCIP *SourceCCIPModule) SetAllTokenTransferFeeConfigs(enableAggregateRateLimit bool) error { + var tokenTransferFeeConfig []evm_2_evm_onramp.EVM2EVMOnRampTokenTransferFeeConfigArgs + var tokens, pools []common.Address + if len(sourceCCIP.Common.BridgeTokens) != len(sourceCCIP.Common.BridgeTokenPools) { + return fmt.Errorf("tokens number %d and pools number %d do not match", len(sourceCCIP.Common.BridgeTokens), len(sourceCCIP.Common.BridgeTokenPools)) + } + for i, token := range sourceCCIP.Common.BridgeTokens { + tokens = append(tokens, token.ContractAddress) + pools = append(pools, sourceCCIP.Common.BridgeTokenPools[i].EthAddress) + conf := evm_2_evm_onramp.EVM2EVMOnRampTokenTransferFeeConfigArgs{ + Token: token.ContractAddress, + MinFeeUSDCents: 50, // $0.5 + MaxFeeUSDCents: 1_000_000_00, // $ 1 million + DeciBps: 5_0, // 5 bps + AggregateRateLimitEnabled: enableAggregateRateLimit, + } + if sourceCCIP.Common.BridgeTokenPools[i].IsUSDC() { + conf.DestBytesOverhead = defaultUSDCDestBytesOverhead + conf.DestGasOverhead = defaultUSDCDestGasOverhead + } + tokenTransferFeeConfig = append(tokenTransferFeeConfig, conf) + } + err := sourceCCIP.OnRamp.SetTokenTransferFeeConfig(tokenTransferFeeConfig) + if err != nil { + return fmt.Errorf("setting token transfer fee config shouldn't fail %w", err) + } + // this is required for v1.2.0 ramps + err = sourceCCIP.OnRamp.ApplyPoolUpdates(tokens, pools) + if err != nil { + return fmt.Errorf("applying pool updates shouldn't fail %w", err) + } + return nil +} + +// DeployContracts deploys all CCIP contracts specific to the source chain +func (sourceCCIP *SourceCCIPModule) DeployContracts(lane *laneconfig.LaneConfig) error { + var err error + contractDeployer := sourceCCIP.Common.Deployer + log.Info().Msg("Deploying source chain specific contracts") + + sourceCCIP.LoadContracts(lane) + sourceChainSelector, err := chainselectors.SelectorFromChainId(sourceCCIP.Common.ChainClient.GetChainID().Uint64()) + if err != nil { + return fmt.Errorf("getting chain selector shouldn't fail %w", err) + } + + if sourceCCIP.OnRamp == nil { + if sourceCCIP.Common.ExistingDeployment { + return fmt.Errorf("existing deployment is set to true but no onramp address is provided") + } + var tokensAndPools []evm_2_evm_onramp_1_2_0.InternalPoolUpdate + var tokenTransferFeeConfig []evm_2_evm_onramp.EVM2EVMOnRampTokenTransferFeeConfigArgs + + sourceCCIP.SrcStartBlock, err = sourceCCIP.Common.ChainClient.LatestBlockNumber(context.Background()) + if err != nil { + return fmt.Errorf("getting latest block number shouldn't fail %w", err) + } + var tokenAdminReg common.Address + if contracts.NeedTokenAdminRegistry() { + if sourceCCIP.Common.TokenAdminRegistry == nil { + return fmt.Errorf("token admin registry contract address is not provided in lane config") + } + tokenAdminReg = sourceCCIP.Common.TokenAdminRegistry.EthAddress + } + sourceCCIP.OnRamp, err = contractDeployer.DeployOnRamp( + sourceChainSelector, + sourceCCIP.DestChainSelector, + tokensAndPools, + *sourceCCIP.Common.RMNContract, + sourceCCIP.Common.Router.EthAddress, + sourceCCIP.Common.PriceRegistry.EthAddress, + tokenAdminReg, + sourceCCIP.Common.RateLimiterConfig, + []evm_2_evm_onramp.EVM2EVMOnRampFeeTokenConfigArgs{ + { + Token: common.HexToAddress(sourceCCIP.Common.FeeToken.Address()), + NetworkFeeUSDCents: 1_00, + GasMultiplierWeiPerEth: GasFeeMultiplier, + PremiumMultiplierWeiPerEth: 1e18, + Enabled: true, + }, + { + Token: sourceCCIP.Common.WrappedNative, + NetworkFeeUSDCents: 1_00, + GasMultiplierWeiPerEth: GasFeeMultiplier, + PremiumMultiplierWeiPerEth: 1e18, + Enabled: true, + }, + }, tokenTransferFeeConfig, sourceCCIP.Common.FeeToken.EthAddress) + + if err != nil { + return fmt.Errorf("onRamp deployment shouldn't fail %w", err) + } + + err = sourceCCIP.Common.ChainClient.WaitForEvents() + if err != nil { + return fmt.Errorf("waiting for onRamp deployment shouldn't fail %w", err) + } + + // update source Router with OnRamp address + err = sourceCCIP.Common.Router.SetOnRamp(sourceCCIP.DestChainSelector, sourceCCIP.OnRamp.EthAddress) + if err != nil { + return fmt.Errorf("setting onramp on the router shouldn't fail %w", err) + } + // now sync the pools and tokens + err := sourceCCIP.SetAllTokenTransferFeeConfigs(true) + if err != nil { + return err + } + } else { + sourceCCIP.OnRamp, err = contractDeployer.NewOnRamp(sourceCCIP.OnRamp.EthAddress) + if err != nil { + return fmt.Errorf("getting new onramp contractshouldn't fail %w", err) + } + } + return nil +} + +func (sourceCCIP *SourceCCIPModule) CollectBalanceRequirements() []testhelpers.BalanceReq { + var balancesReq []testhelpers.BalanceReq + for _, token := range sourceCCIP.Common.BridgeTokens { + balancesReq = append(balancesReq, testhelpers.BalanceReq{ + Name: fmt.Sprintf("BridgeToken-%s-Address-%s", token.Address(), sourceCCIP.Sender.Hex()), + Addr: sourceCCIP.Sender, + Getter: GetterForLinkToken(token.BalanceOf, sourceCCIP.Sender.Hex()), + }) + } + for i, pool := range sourceCCIP.Common.BridgeTokenPools { + balancesReq = append(balancesReq, testhelpers.BalanceReq{ + Name: fmt.Sprintf("BridgeToken-%s-TokenPool-%s", sourceCCIP.Common.BridgeTokens[i].Address(), pool.Address()), + Addr: pool.EthAddress, + Getter: GetterForLinkToken(sourceCCIP.Common.BridgeTokens[i].BalanceOf, pool.Address()), + }) + } + + if sourceCCIP.Common.FeeToken.Address() != common.HexToAddress("0x0").String() { + balancesReq = append(balancesReq, testhelpers.BalanceReq{ + Name: fmt.Sprintf("FeeToken-%s-Address-%s", sourceCCIP.Common.FeeToken.Address(), sourceCCIP.Sender.Hex()), + Addr: sourceCCIP.Sender, + Getter: GetterForLinkToken(sourceCCIP.Common.FeeToken.BalanceOf, sourceCCIP.Sender.Hex()), + }) + balancesReq = append(balancesReq, testhelpers.BalanceReq{ + Name: fmt.Sprintf("FeeToken-%s-Router-%s", sourceCCIP.Common.FeeToken.Address(), sourceCCIP.Common.Router.Address()), + Addr: sourceCCIP.Common.Router.EthAddress, + Getter: GetterForLinkToken(sourceCCIP.Common.FeeToken.BalanceOf, sourceCCIP.Common.Router.Address()), + }) + balancesReq = append(balancesReq, testhelpers.BalanceReq{ + Name: fmt.Sprintf("FeeToken-%s-OnRamp-%s", sourceCCIP.Common.FeeToken.Address(), sourceCCIP.OnRamp.Address()), + Addr: sourceCCIP.OnRamp.EthAddress, + Getter: GetterForLinkToken(sourceCCIP.Common.FeeToken.BalanceOf, sourceCCIP.OnRamp.Address()), + }) + balancesReq = append(balancesReq, testhelpers.BalanceReq{ + Name: fmt.Sprintf("FeeToken-%s-Prices-%s", sourceCCIP.Common.FeeToken.Address(), sourceCCIP.Common.PriceRegistry.Address()), + Addr: sourceCCIP.Common.PriceRegistry.EthAddress, + Getter: GetterForLinkToken(sourceCCIP.Common.FeeToken.BalanceOf, sourceCCIP.Common.PriceRegistry.Address()), + }) + } + return balancesReq +} + +func (sourceCCIP *SourceCCIPModule) UpdateBalance( + noOfReq int64, + totalFee *big.Int, + balances *BalanceSheet, +) { + if len(sourceCCIP.TransferAmount) > 0 { + for i := range sourceCCIP.TransferAmount { + if sourceCCIP.TransferAmount[i] == nil { // nil transfer amount means no transfer for this token + continue + } + // if length of sourceCCIP.TransferAmount is more than available bridge token use first bridge token + token := sourceCCIP.Common.BridgeTokens[0] + if i < len(sourceCCIP.Common.BridgeTokens) { + token = sourceCCIP.Common.BridgeTokens[i] + } + name := fmt.Sprintf("BridgeToken-%s-Address-%s", token.Address(), sourceCCIP.Sender.Hex()) + balances.Update(name, BalanceItem{ + Address: sourceCCIP.Sender, + Getter: GetterForLinkToken(token.BalanceOf, sourceCCIP.Sender.Hex()), + AmtToSub: bigmath.Mul(big.NewInt(noOfReq), sourceCCIP.TransferAmount[i]), + }) + } + for i := range sourceCCIP.TransferAmount { + // if length of sourceCCIP.TransferAmount is more than available bridge token use first bridge token + pool := sourceCCIP.Common.BridgeTokenPools[0] + index := 0 + if i < len(sourceCCIP.Common.BridgeTokenPools) { + pool = sourceCCIP.Common.BridgeTokenPools[i] + index = i + } + + name := fmt.Sprintf("BridgeToken-%s-TokenPool-%s", sourceCCIP.Common.BridgeTokens[index].Address(), pool.Address()) + balances.Update(name, BalanceItem{ + Address: pool.EthAddress, + Getter: GetterForLinkToken(sourceCCIP.Common.BridgeTokens[index].BalanceOf, pool.Address()), + AmtToAdd: bigmath.Mul(big.NewInt(noOfReq), sourceCCIP.TransferAmount[i]), + }) + } + } + if sourceCCIP.Common.FeeToken.Address() != common.HexToAddress("0x0").String() { + name := fmt.Sprintf("FeeToken-%s-Address-%s", sourceCCIP.Common.FeeToken.Address(), sourceCCIP.Sender.Hex()) + balances.Update(name, BalanceItem{ + Address: sourceCCIP.Sender, + Getter: GetterForLinkToken(sourceCCIP.Common.FeeToken.BalanceOf, sourceCCIP.Sender.Hex()), + AmtToSub: totalFee, + }) + name = fmt.Sprintf("FeeToken-%s-Prices-%s", sourceCCIP.Common.FeeToken.Address(), sourceCCIP.Common.PriceRegistry.Address()) + balances.Update(name, BalanceItem{ + Address: sourceCCIP.Common.PriceRegistry.EthAddress, + Getter: GetterForLinkToken(sourceCCIP.Common.FeeToken.BalanceOf, sourceCCIP.Common.PriceRegistry.Address()), + }) + name = fmt.Sprintf("FeeToken-%s-Router-%s", sourceCCIP.Common.FeeToken.Address(), sourceCCIP.Common.Router.Address()) + balances.Update(name, BalanceItem{ + Address: sourceCCIP.Common.Router.EthAddress, + Getter: GetterForLinkToken(sourceCCIP.Common.FeeToken.BalanceOf, sourceCCIP.Common.Router.Address()), + }) + name = fmt.Sprintf("FeeToken-%s-OnRamp-%s", sourceCCIP.Common.FeeToken.Address(), sourceCCIP.OnRamp.Address()) + balances.Update(name, BalanceItem{ + Address: sourceCCIP.OnRamp.EthAddress, + Getter: GetterForLinkToken(sourceCCIP.Common.FeeToken.BalanceOf, sourceCCIP.OnRamp.Address()), + AmtToAdd: totalFee, + }) + } +} + +func (sourceCCIP *SourceCCIPModule) AssertSendRequestedLogFinalized( + lggr *zerolog.Logger, + txHash common.Hash, + sendReqData []*contracts.SendReqEventData, + prevEventAt time.Time, + reqStats []*testreporters.RequestStat, +) (time.Time, uint64, error) { + if len(sendReqData) != len(reqStats) { + return time.Time{}, 0, fmt.Errorf("sendReqData and reqStats length mismatch") + } + var gasUsed uint64 + receipt, err := sourceCCIP.Common.ChainClient.GetTxReceipt(txHash) + if err == nil { + gasUsed = receipt.GasUsed + } + lggr.Info().Msg("Waiting for CCIPSendRequested event log to be finalized") + finalizedBlockNum, finalizedAt, err := sourceCCIP.Common.ChainClient.WaitForFinalizedTx(txHash) + if err != nil || finalizedBlockNum == nil { + for i, stat := range reqStats { + stat.UpdateState(lggr, stat.SeqNum, testreporters.SourceLogFinalized, time.Since(prevEventAt), testreporters.Failure, &testreporters.TransactionStats{ + MsgID: fmt.Sprintf("0x%x", sendReqData[i].MessageId[:]), + Fee: sendReqData[i].Fee.String(), + NoOfTokensSent: sendReqData[i].NoOfTokens, + MessageBytesLength: int64(sendReqData[i].DataLength), + TxHash: txHash.Hex(), + }) + } + return time.Time{}, 0, fmt.Errorf("error waiting for CCIPSendRequested event log to be finalized - %w", err) + } + for i, stat := range reqStats { + stat.UpdateState(lggr, stat.SeqNum, testreporters.SourceLogFinalized, finalizedAt.Sub(prevEventAt), testreporters.Success, + &testreporters.TransactionStats{ + MsgID: fmt.Sprintf("0x%x", sendReqData[i].MessageId[:]), + Fee: sendReqData[i].Fee.String(), + GasUsed: gasUsed, + NoOfTokensSent: sendReqData[i].NoOfTokens, + MessageBytesLength: int64(sendReqData[i].DataLength), + TxHash: txHash.Hex(), + FinalizedByBlock: finalizedBlockNum.String(), + FinalizedAt: finalizedAt.String(), + }) + } + return finalizedAt, finalizedBlockNum.Uint64(), nil +} + +// IsRequestTriggeredWithinTimeframe monitors for live events occurring within the specified timeframe. +// Live events refer to those that are triggered after subscribing to the CCIP Send Requested event. +func (sourceCCIP *SourceCCIPModule) IsRequestTriggeredWithinTimeframe(timeframe *commonconfig.Duration) *time.Time { + if timeframe == nil { + return nil + } + var foundAt *time.Time + lastSeenTimestamp := time.Now().UTC().Add(-timeframe.Duration()) + sourceCCIP.CCIPSendRequestedWatcher.Range(func(_, value any) bool { + if sendRequestedEvents, exists := value.([]*evm_2_evm_onramp.EVM2EVMOnRampCCIPSendRequested); exists { + for _, sendRequestedEvent := range sendRequestedEvents { + raw := sendRequestedEvent.Raw + hdr, err := sourceCCIP.Common.ChainClient.HeaderByNumber(context.Background(), new(big.Int).SetUint64(raw.BlockNumber)) + if err == nil { + if hdr.Timestamp.After(lastSeenTimestamp) { + foundAt = pointer.ToTime(hdr.Timestamp) + return false + } + } + } + } + return true + }) + return foundAt +} + +// IsPastRequestTriggeredWithinTimeframe determines the average block time and calculates the block numbers +// within the specified timeframe. It then uses FilterCCIPSendRequested to identify the past events. +func (sourceCCIP *SourceCCIPModule) IsPastRequestTriggeredWithinTimeframe(ctx context.Context, timeframe *commonconfig.Duration) (*time.Time, error) { + if timeframe == nil { + return nil, nil + } + //var foundAt *time.Time + latestBlock, err := sourceCCIP.Common.ChainClient.LatestBlockNumber(ctx) + if err != nil { + return nil, fmt.Errorf("error while getting latest source block number. Error: %w", err) + } + avgBlockTime, err := sourceCCIP.Common.ChainClient.AvgBlockTime(ctx) + if err != nil { + return nil, fmt.Errorf("error while getting average source block time. Error: %w", err) + } + filterFromBlock := latestBlock - uint64(timeframe.Duration()/avgBlockTime) + + onRampContract, err := evm_2_evm_onramp.NewEVM2EVMOnRamp(common.HexToAddress(sourceCCIP.OnRamp.EthAddress.Hex()), + sourceCCIP.Common.ChainClient.Backend()) + if err != nil { + return nil, fmt.Errorf("error while on ramp contract. Error: %w", err) + } + iterator, err := onRampContract.FilterCCIPSendRequested(&bind.FilterOpts{ + Start: filterFromBlock, + }) + if err != nil { + return nil, fmt.Errorf("error while filtering CCIP send requested starting block number: %d. Error: %w", filterFromBlock, err) + } + defer func() { + _ = iterator.Close() + }() + if iterator.Next() { + hdr, err := sourceCCIP.Common.ChainClient.HeaderByNumber(context.Background(), big.NewInt(int64(iterator.Event.Raw.BlockNumber))) + if err != nil { + return nil, fmt.Errorf("error getting header for block: %d, Error: %w", iterator.Event.Raw.BlockNumber, err) + } + return pointer.ToTime(hdr.Timestamp), nil + } + + return nil, nil +} + +func (sourceCCIP *SourceCCIPModule) AssertEventCCIPSendRequested( + lggr *zerolog.Logger, + txHash string, + timeout time.Duration, + prevEventAt time.Time, + reqStat []*testreporters.RequestStat, +) ([]*contracts.SendReqEventData, time.Time, error) { + lggr.Info().Str("Timeout", timeout.String()).Msg("Waiting for CCIPSendRequested event") + ticker := time.NewTicker(time.Second) + defer ticker.Stop() + timer := time.NewTimer(timeout) + defer timer.Stop() + resetTimer := 0 + for { + select { + case <-ticker.C: + value, ok := sourceCCIP.CCIPSendRequestedWatcher.Load(txHash) + if ok { + // if sendrequested events are found, check if the number of events are same as the number of requests + if sendRequestedEvents, exists := value.([]*contracts.SendReqEventData); exists && len(sendRequestedEvents) == len(reqStat) { + // if the value is processed, delete it from the map + sourceCCIP.CCIPSendRequestedWatcher.Delete(txHash) + for i, sendRequestedEvent := range sendRequestedEvents { + seqNum := sendRequestedEvent.SequenceNumber + lggr = ptr.Ptr(lggr.With(). + Uint64("SequenceNumber", seqNum). + Str("MsgID", fmt.Sprintf("0x%x", sendRequestedEvent.MessageId[:])). + Logger()) + // prevEventAt is the time when the message was successful, this should be same as the time when the event was emitted + reqStat[i].UpdateState(lggr, seqNum, testreporters.CCIPSendRe, 0, testreporters.Success, nil) + } + var err error + if len(sendRequestedEvents) == 0 { + err = fmt.Errorf("message logs not found, no CCIPSendRequested event found for tx %s", txHash) + } + return sendRequestedEvents, prevEventAt, err + } + } + case <-timer.C: + // if there is connection issue reset the timer : + if sourceCCIP.Common.IsConnectionRestoredRecently != nil && !sourceCCIP.Common.IsConnectionRestoredRecently.Load() { + if resetTimer > 2 { + for _, stat := range reqStat { + stat.UpdateState(lggr, 0, testreporters.CCIPSendRe, time.Since(prevEventAt), testreporters.Failure, + &testreporters.TransactionStats{ + TxHash: txHash, + }) + } + return nil, time.Now(), fmt.Errorf("possible RPC issue - CCIPSendRequested event is not found for tx %s", txHash) + } + resetTimer++ + timer.Reset(timeout) + lggr.Info().Int("count of reset", resetTimer).Msg("Resetting timer to validate CCIPSendRequested event") + continue + } + for _, stat := range reqStat { + stat.UpdateState(lggr, 0, testreporters.CCIPSendRe, time.Since(prevEventAt), testreporters.Failure, + &testreporters.TransactionStats{ + TxHash: txHash, + }) + } + return nil, time.Now(), fmt.Errorf("CCIPSendRequested event is not found for tx %s", txHash) + } + } +} + +// CCIPMsg constructs the message for a CCIP request +func (sourceCCIP *SourceCCIPModule) CCIPMsg( + receiver common.Address, + allowOutOfOrder bool, + gasLimit *big.Int, +) (router.ClientEVM2AnyMessage, error) { + length := sourceCCIP.MsgDataLength + var data string + if length > 0 { + b := make([]byte, length) + _, err := crypto_rand.Read(b) + if err != nil { + return router.ClientEVM2AnyMessage{}, fmt.Errorf("failed generating random string: %w", err) + } + randomString := base64.URLEncoding.EncodeToString(b) + data = randomString[:length] + } + + tokenAndAmounts := []router.ClientEVMTokenAmount{} + for i, amount := range sourceCCIP.TransferAmount { + if amount == nil { // make nil transfer amount 0 to avoid panics + sourceCCIP.TransferAmount[i] = big.NewInt(0) + } + token := sourceCCIP.Common.BridgeTokens[0] + // if length of sourceCCIP.TransferAmount is more than available bridge token use first bridge token + if i < len(sourceCCIP.Common.BridgeTokens) { + token = sourceCCIP.Common.BridgeTokens[i] + } + if amount == nil || amount.Cmp(big.NewInt(0)) == 0 { + log.Warn(). + Str("Token Address", token.Address()). + Int("Token Index", i). + Msg("Not sending a request for token transfer as the amount is 0 or nil") + continue + } + tokenAndAmounts = append(tokenAndAmounts, router.ClientEVMTokenAmount{ + Token: common.HexToAddress(token.Address()), Amount: amount, + }) + } + + receiverAddr, err := utils.ABIEncode(`[{"type":"address"}]`, receiver) + if err != nil { + return router.ClientEVM2AnyMessage{}, fmt.Errorf("failed encoding the receiver address: %w", err) + } + + var extraArgs []byte + matchErr := contracts.MatchContractVersionsOrAbove(map[contracts.Name]contracts.Version{ + contracts.OnRampContract: contracts.V1_5_0, + }) + if matchErr != nil { + extraArgs, err = testhelpers.GetEVMExtraArgsV1(gasLimit, false) + } else { + extraArgs, err = testhelpers.GetEVMExtraArgsV2(gasLimit, allowOutOfOrder) + } + if err != nil { + return router.ClientEVM2AnyMessage{}, fmt.Errorf("failed getting extra args: %w", err) + } + // form the message for transfer + return router.ClientEVM2AnyMessage{ + Receiver: receiverAddr, + Data: []byte(data), + TokenAmounts: tokenAndAmounts, + FeeToken: common.HexToAddress(sourceCCIP.Common.FeeToken.Address()), + ExtraArgs: extraArgs, + }, nil +} + +// SendRequest sends a CCIP request to the source chain's router contract +func (sourceCCIP *SourceCCIPModule) SendRequest( + receiver common.Address, + gasLimit *big.Int, +) (common.Hash, time.Duration, *big.Int, error) { + var d time.Duration + destChainSelector, err := chainselectors.SelectorFromChainId(sourceCCIP.DestinationChainId) + if err != nil { + return common.Hash{}, d, nil, fmt.Errorf("failed getting the chain selector: %w", err) + } + // form the message for transfer + msg, err := sourceCCIP.CCIPMsg(receiver, sourceCCIP.Common.AllowOutOfOrder, gasLimit) + if err != nil { + return common.Hash{}, d, nil, fmt.Errorf("failed forming the ccip msg: %w", err) + } + + fee, err := sourceCCIP.Common.Router.GetFee(destChainSelector, msg) + if err != nil { + log.Info().Interface("Msg", msg).Msg("CCIP msg") + reason, _ := blockchain.RPCErrorFromError(err) + if reason != "" { + return common.Hash{}, d, nil, fmt.Errorf("failed getting the fee: %s", reason) + } + return common.Hash{}, d, nil, fmt.Errorf("failed getting the fee: %w", err) + } + log.Info().Str("Fee", fee.String()).Msg("Calculated fee") + + var sendTx *types.Transaction + timeNow := time.Now() + feeToken := common.HexToAddress(sourceCCIP.Common.FeeToken.Address()) + // initiate the transfer + // if the fee token address is 0x0 it will use Native as fee token and the fee amount should be mentioned in bind.TransactOpts's value + if feeToken != (common.Address{}) { + sendTx, err = sourceCCIP.Common.Router.CCIPSendAndProcessTx(destChainSelector, msg, nil) + if err != nil { + txHash := common.Hash{} + if sendTx != nil { + txHash = sendTx.Hash() + } + return txHash, time.Since(timeNow), nil, fmt.Errorf("failed initiating the transfer ccip-send: %w", err) + } + } else { + sendTx, err = sourceCCIP.Common.Router.CCIPSendAndProcessTx(destChainSelector, msg, fee) + if err != nil { + txHash := common.Hash{} + if sendTx != nil { + txHash = sendTx.Hash() + } + return txHash, time.Since(timeNow), nil, fmt.Errorf("failed initiating the transfer ccip-send: %w", err) + } + } + + log.Info(). + Str("Network", sourceCCIP.Common.ChainClient.GetNetworkName()). + Str("Send token transaction", sendTx.Hash().String()). + Str("lane", fmt.Sprintf("%s-->%s", sourceCCIP.Common.ChainClient.GetNetworkName(), sourceCCIP.DestNetworkName)). + Msg("Sending token") + return sendTx.Hash(), time.Since(timeNow), fee, nil +} + +func DefaultSourceCCIPModule( + logger *zerolog.Logger, + testConf *testconfig.CCIPTestGroupConfig, + chainClient blockchain.EVMClient, + destChainId uint64, + destChain string, + laneConf *laneconfig.LaneConfig, +) (*SourceCCIPModule, error) { + cmn, err := NewCCIPCommonFromConfig( + logger, testConf, chainClient, laneConf, + ) + if err != nil { + return nil, err + } + + destChainSelector, err := chainselectors.SelectorFromChainId(destChainId) + if err != nil { + return nil, fmt.Errorf("failed getting the chain selector: %w", err) + } + source := &SourceCCIPModule{ + Common: cmn, + TransferAmount: testConf.MsgDetails.TransferAmounts(), + MsgDataLength: pointer.GetInt64(testConf.MsgDetails.DataLength), + DestinationChainId: destChainId, + DestChainSelector: destChainSelector, + DestNetworkName: destChain, + Sender: common.HexToAddress(chainClient.GetDefaultWallet().Address()), + CCIPSendRequestedWatcher: &sync.Map{}, + } + + return source, nil +} + +type DestCCIPModule struct { + Common *CCIPCommon + SourceChainId uint64 + SourceChainSelector uint64 + SourceNetworkName string + CommitStore *contracts.CommitStore + ReceiverDapp *contracts.ReceiverDapp + OffRamp *contracts.OffRamp + ReportAcceptedWatcher *sync.Map + ExecStateChangedWatcher *sync.Map + ReportBlessedWatcher *sync.Map + ReportBlessedBySeqNum *sync.Map + NextSeqNumToCommit *atomic.Uint64 + DestStartBlock uint64 +} + +func (destCCIP *DestCCIPModule) LoadContracts(conf *laneconfig.LaneConfig) { + if conf != nil { + cfg, ok := conf.DestContracts[destCCIP.SourceNetworkName] + if ok { + if common.IsHexAddress(cfg.OffRamp) { + destCCIP.OffRamp = &contracts.OffRamp{ + EthAddress: common.HexToAddress(cfg.OffRamp), + } + } + if common.IsHexAddress(cfg.CommitStore) { + destCCIP.CommitStore = &contracts.CommitStore{ + EthAddress: common.HexToAddress(cfg.CommitStore), + } + } + if common.IsHexAddress(cfg.ReceiverDapp) { + destCCIP.ReceiverDapp = &contracts.ReceiverDapp{ + EthAddress: common.HexToAddress(cfg.ReceiverDapp), + } + } + } + } +} + +func (destCCIP *DestCCIPModule) SyncTokensAndPools(srcTokens []*contracts.ERC20Token) error { + if destCCIP.OffRamp.Instance.V1_2_0 == nil { + return nil + } + var sourceTokens, pools []common.Address + + for _, token := range srcTokens { + sourceTokens = append(sourceTokens, common.HexToAddress(token.Address())) + } + + for i := range destCCIP.Common.BridgeTokenPools { + pools = append(pools, destCCIP.Common.BridgeTokenPools[i].EthAddress) + } + if len(sourceTokens) != len(pools) { + return fmt.Errorf("source token and destination pool length mismatch") + } + // if number of tokens are more than 10, then we need to split the tokens in batch of 10 and call sync + // otherwise the tx gets too large and we will get out of gas error + if len(sourceTokens) > 10 { + for i := 0; i < len(sourceTokens); i += 10 { + end := i + 10 + if end > len(sourceTokens) { + end = len(sourceTokens) + } + err := destCCIP.OffRamp.SyncTokensAndPools(sourceTokens[i:end], pools[i:end]) + if err != nil { + return err + } + } + return nil + } + return destCCIP.OffRamp.SyncTokensAndPools(sourceTokens, pools) +} + +// AddRateLimitTokens adds token pairs to the OffRamp's rate limiting +func (destCCIP *DestCCIPModule) AddRateLimitTokens(srcTokens, destTokens []*contracts.ERC20Token) error { + if destCCIP.OffRamp.Instance.Latest == nil { + return nil + } + if srcTokens == nil || destTokens == nil { + return fmt.Errorf("source or destination tokens are nil") + } + + if len(srcTokens) != len(destTokens) { + return fmt.Errorf("source and destination token length mismatch") + } + + var sourceTokenAddresses, destTokenAddresses []common.Address + + for i, token := range srcTokens { + sourceTokenAddresses = append(sourceTokenAddresses, common.HexToAddress(token.Address())) + destTokenAddresses = append(destTokenAddresses, common.HexToAddress(destTokens[i].Address())) + } + + // if number of tokens are more than 10, then we need to split the tokens in batch of 10 and update the rate limit + // otherwise the tx gets too large and we will get out of gas error + if len(sourceTokenAddresses) > 10 { + for i := 0; i < len(sourceTokenAddresses); i += 10 { + end := i + 10 + if end > len(sourceTokenAddresses) { + end = len(sourceTokenAddresses) + } + err := destCCIP.OffRamp.AddRateLimitTokens(sourceTokenAddresses[i:end], destTokenAddresses[i:end]) + if err != nil { + return err + } + } + return nil + } + + return destCCIP.OffRamp.AddRateLimitTokens(sourceTokenAddresses, destTokenAddresses) +} + +// RemoveRateLimitTokens removes token pairs from the OffRamp's rate limiting. +// If you ask to remove a token pair that doesn't exist, it will return an error. +func (destCCIP *DestCCIPModule) RemoveRateLimitTokens(ctx context.Context, srcTokens, destTokens []*contracts.ERC20Token) error { + if srcTokens == nil || destTokens == nil { + return fmt.Errorf("source or destination tokens are nil") + } + + if len(srcTokens) != len(destTokens) { + return fmt.Errorf("source and destination token length mismatch") + } + + var sourceTokenAddresses, destTokenAddresses []common.Address + + for i, token := range srcTokens { + sourceTokenAddresses = append(sourceTokenAddresses, common.HexToAddress(token.Address())) + destTokenAddresses = append(destTokenAddresses, common.HexToAddress(destTokens[i].Address())) + } + + return destCCIP.OffRamp.RemoveRateLimitTokens(ctx, sourceTokenAddresses, destTokenAddresses) +} + +// RemoveAllRateLimitTokens removes all token pairs from the OffRamp's rate limiting. +func (destCCIP *DestCCIPModule) RemoveAllRateLimitTokens(ctx context.Context) error { + return destCCIP.OffRamp.RemoveAllRateLimitTokens(ctx) +} + +// DeployContracts deploys all CCIP contracts specific to the destination chain +func (destCCIP *DestCCIPModule) DeployContracts( + sourceCCIP SourceCCIPModule, + lane *laneconfig.LaneConfig, +) error { + var err error + contractDeployer := destCCIP.Common.Deployer + log.Info().Msg("Deploying destination chain specific contracts") + destCCIP.LoadContracts(lane) + destChainSelector, err := chainselectors.SelectorFromChainId(destCCIP.Common.ChainClient.GetChainID().Uint64()) + if err != nil { + return fmt.Errorf("failed to get chain selector for destination chain id %d: %w", destCCIP.Common.ChainClient.GetChainID().Uint64(), err) + } + destCCIP.DestStartBlock, err = destCCIP.Common.ChainClient.LatestBlockNumber(context.Background()) + if err != nil { + return fmt.Errorf("getting latest block number shouldn't fail %w", err) + } + if !destCCIP.Common.ExistingDeployment && len(sourceCCIP.Common.BridgeTokenPools) != len(destCCIP.Common.BridgeTokenPools) { + return fmt.Errorf("source and destination token pool number does not match") + } + + if destCCIP.CommitStore == nil { + if destCCIP.Common.ExistingDeployment { + return fmt.Errorf("commit store address not provided in lane config") + } + // commitStore responsible for validating the transfer message + destCCIP.CommitStore, err = contractDeployer.DeployCommitStore( + destCCIP.SourceChainSelector, + destChainSelector, + sourceCCIP.OnRamp.EthAddress, + *destCCIP.Common.RMNContract, + ) + if err != nil { + return fmt.Errorf("deploying commitstore shouldn't fail %w", err) + } + err = destCCIP.Common.ChainClient.WaitForEvents() + if err != nil { + return fmt.Errorf("waiting for commitstore deployment shouldn't fail %w", err) + } + + // CommitStore can update + err = destCCIP.Common.PriceRegistry.AddPriceUpdater(destCCIP.CommitStore.EthAddress) + if err != nil { + return fmt.Errorf("setting commitstore as fee updater shouldn't fail %w", err) + } + err = destCCIP.Common.ChainClient.WaitForEvents() + if err != nil { + return fmt.Errorf("waiting for setting commitstore as fee updater shouldn't fail %w", err) + } + } else { + destCCIP.CommitStore, err = contractDeployer.NewCommitStore(destCCIP.CommitStore.EthAddress) + if err != nil { + return fmt.Errorf("getting new commitstore shouldn't fail %w", err) + } + } + + if destCCIP.OffRamp == nil { + if destCCIP.Common.ExistingDeployment { + return fmt.Errorf("offramp address not provided in lane config") + } + var tokenAdminReg common.Address + if contracts.NeedTokenAdminRegistry() { + if destCCIP.Common.TokenAdminRegistry == nil { + return fmt.Errorf("token admin registry contract address is not provided in lane config") + } + tokenAdminReg = destCCIP.Common.TokenAdminRegistry.EthAddress + } + destCCIP.OffRamp, err = contractDeployer.DeployOffRamp( + destCCIP.SourceChainSelector, + destChainSelector, + destCCIP.CommitStore.EthAddress, + sourceCCIP.OnRamp.EthAddress, + destCCIP.Common.RateLimiterConfig, + []common.Address{}, + []common.Address{}, + *destCCIP.Common.RMNContract, + tokenAdminReg, + ) + if err != nil { + return fmt.Errorf("deploying offramp shouldn't fail %w", err) + } + err = destCCIP.Common.ChainClient.WaitForEvents() + if err != nil { + return fmt.Errorf("waiting for offramp deployment shouldn't fail %w", err) + } + + // apply offramp updates + _, err = destCCIP.Common.Router.AddOffRamp(destCCIP.OffRamp.EthAddress, destCCIP.SourceChainSelector) + if err != nil { + return fmt.Errorf("setting offramp as fee updater shouldn't fail %w", err) + } + + err = destCCIP.AddRateLimitTokens(sourceCCIP.Common.BridgeTokens, destCCIP.Common.BridgeTokens) + if err != nil { + return fmt.Errorf("setting rate limited tokens shouldn't fail %w", err) + } + err = destCCIP.SyncTokensAndPools(sourceCCIP.Common.BridgeTokens) + if err != nil { + return fmt.Errorf("syncing tokens and pools shouldn't fail %w", err) + } + err = destCCIP.Common.ChainClient.WaitForEvents() + if err != nil { + return fmt.Errorf("waiting for events on destination contract shouldn't fail %w", err) + } + } else { + destCCIP.OffRamp, err = contractDeployer.NewOffRamp(destCCIP.OffRamp.EthAddress) + if err != nil { + return fmt.Errorf("getting new offramp shouldn't fail %w", err) + } + } + if destCCIP.ReceiverDapp == nil { + // ReceiverDapp + destCCIP.ReceiverDapp, err = contractDeployer.DeployReceiverDapp(false) + if err != nil { + return fmt.Errorf("receiverDapp contract should be deployed successfully %w", err) + } + err = destCCIP.Common.ChainClient.WaitForEvents() + if err != nil { + return fmt.Errorf("waiting for events on destination contract deployments %w", err) + } + } else { + destCCIP.ReceiverDapp, err = contractDeployer.NewReceiverDapp(destCCIP.ReceiverDapp.EthAddress) + if err != nil { + return fmt.Errorf("getting new receiverDapp shouldn't fail %w", err) + } + } + return nil +} + +func (destCCIP *DestCCIPModule) CollectBalanceRequirements() []testhelpers.BalanceReq { + var destBalancesReq []testhelpers.BalanceReq + for _, token := range destCCIP.Common.BridgeTokens { + destBalancesReq = append(destBalancesReq, testhelpers.BalanceReq{ + Name: fmt.Sprintf("BridgeToken-%s-Address-%s", token.Address(), destCCIP.ReceiverDapp.Address()), + Addr: destCCIP.ReceiverDapp.EthAddress, + Getter: GetterForLinkToken(token.BalanceOf, destCCIP.ReceiverDapp.Address()), + }) + } + for i, pool := range destCCIP.Common.BridgeTokenPools { + destBalancesReq = append(destBalancesReq, testhelpers.BalanceReq{ + Name: fmt.Sprintf("BridgeToken-%s-TokenPool-%s", destCCIP.Common.BridgeTokens[i].Address(), pool.Address()), + Addr: pool.EthAddress, + Getter: GetterForLinkToken(destCCIP.Common.BridgeTokens[i].BalanceOf, pool.Address()), + }) + } + if destCCIP.Common.FeeToken.Address() != common.HexToAddress("0x0").String() { + destBalancesReq = append(destBalancesReq, testhelpers.BalanceReq{ + Name: fmt.Sprintf("FeeToken-%s-Address-%s", destCCIP.Common.FeeToken.Address(), destCCIP.ReceiverDapp.Address()), + Addr: destCCIP.ReceiverDapp.EthAddress, + Getter: GetterForLinkToken(destCCIP.Common.FeeToken.BalanceOf, destCCIP.ReceiverDapp.Address()), + }) + destBalancesReq = append(destBalancesReq, testhelpers.BalanceReq{ + Name: fmt.Sprintf("FeeToken-%s-OffRamp-%s", destCCIP.Common.FeeToken.Address(), destCCIP.OffRamp.Address()), + Addr: destCCIP.OffRamp.EthAddress, + Getter: GetterForLinkToken(destCCIP.Common.FeeToken.BalanceOf, destCCIP.OffRamp.Address()), + }) + } + return destBalancesReq +} + +func (destCCIP *DestCCIPModule) UpdateBalance( + transferAmount []*big.Int, + noOfReq int64, + balance *BalanceSheet, +) { + if len(transferAmount) > 0 { + for i := range transferAmount { + token := destCCIP.Common.BridgeTokens[0] + if i < len(destCCIP.Common.BridgeTokens) { + token = destCCIP.Common.BridgeTokens[i] + } + name := fmt.Sprintf("BridgeToken-%s-Address-%s", token.Address(), destCCIP.ReceiverDapp.Address()) + balance.Update(name, BalanceItem{ + Address: destCCIP.ReceiverDapp.EthAddress, + Getter: GetterForLinkToken(token.BalanceOf, destCCIP.ReceiverDapp.Address()), + AmtToAdd: bigmath.Mul(big.NewInt(noOfReq), transferAmount[i]), + }) + } + for i := range transferAmount { + pool := destCCIP.Common.BridgeTokenPools[0] + index := 0 + if i < len(destCCIP.Common.BridgeTokenPools) { + pool = destCCIP.Common.BridgeTokenPools[i] + index = i + } + name := fmt.Sprintf("BridgeToken-%s-TokenPool-%s", destCCIP.Common.BridgeTokens[index].Address(), pool.Address()) + balance.Update(name, BalanceItem{ + Address: pool.EthAddress, + Getter: GetterForLinkToken(destCCIP.Common.BridgeTokens[index].BalanceOf, pool.Address()), + AmtToSub: bigmath.Mul(big.NewInt(noOfReq), transferAmount[i]), + }) + } + } + if destCCIP.Common.FeeToken.Address() != common.HexToAddress("0x0").String() { + name := fmt.Sprintf("FeeToken-%s-OffRamp-%s", destCCIP.Common.FeeToken.Address(), destCCIP.OffRamp.Address()) + balance.Update(name, BalanceItem{ + Address: destCCIP.OffRamp.EthAddress, + Getter: GetterForLinkToken(destCCIP.Common.FeeToken.BalanceOf, destCCIP.OffRamp.Address()), + }) + + name = fmt.Sprintf("FeeToken-%s-Address-%s", destCCIP.Common.FeeToken.Address(), destCCIP.ReceiverDapp.Address()) + balance.Update(name, BalanceItem{ + Address: destCCIP.ReceiverDapp.EthAddress, + Getter: GetterForLinkToken(destCCIP.Common.FeeToken.BalanceOf, destCCIP.ReceiverDapp.Address()), + }) + } +} + +// AssertNoReportAcceptedEventReceived validates that no ExecutionStateChangedEvent is emitted for mentioned timeRange after lastSeenTimestamp +func (destCCIP *DestCCIPModule) AssertNoReportAcceptedEventReceived(lggr *zerolog.Logger, timeRange time.Duration, lastSeenTimestamp time.Time) error { + ctx, cancel := context.WithTimeout(context.Background(), timeRange) + defer cancel() + ticker := time.NewTicker(time.Second) + defer ticker.Stop() + for { + select { + case <-ticker.C: + var eventFoundAfterCursing *time.Time + // verify if CommitReportAccepted is received, it's not generated after provided lastSeenTimestamp + destCCIP.ReportAcceptedWatcher.Range(func(_, value any) bool { + e, exists := value.(*evm_2_evm_offramp.EVM2EVMOffRampExecutionStateChanged) + if exists { + vLogs := e.Raw + hdr, err := destCCIP.Common.ChainClient.HeaderByNumber(ctx, new(big.Int).SetUint64(vLogs.BlockNumber)) + if err != nil { + return true + } + if hdr.Timestamp.After(lastSeenTimestamp) { + eventFoundAfterCursing = pointer.ToTime(hdr.Timestamp) + return false + } + } + return true + }) + if eventFoundAfterCursing != nil { + return fmt.Errorf("CommitReportAccepted Event detected at %s after %s", lastSeenTimestamp, eventFoundAfterCursing.String()) + } + case <-ctx.Done(): + lggr.Info().Msgf("successfully validated that no CommitReportAccepted detected after %s for %s", lastSeenTimestamp, timeRange) + return nil + } + } +} + +// AssertNoExecutionStateChangedEventReceived validates that no ExecutionStateChangedEvent is emitted for mentioned timeRange after lastSeenTimestamp +func (destCCIP *DestCCIPModule) AssertNoExecutionStateChangedEventReceived( + lggr *zerolog.Logger, + timeRange time.Duration, + lastSeenTimestamp time.Time, +) error { + ctx, cancel := context.WithTimeout(context.Background(), timeRange) + defer cancel() + ticker := time.NewTicker(time.Second) + defer ticker.Stop() + lggr.Info().Str("Wait Time", timeRange.String()).Time("Since", lastSeenTimestamp).Msg("Waiting to ensure no ExecutionStateChanged event") + for { + select { + case <-ticker.C: + var eventFoundAfterCursing *time.Time + // verify if ExecutionStateChanged is received, it's not generated after provided lastSeenTimestamp + destCCIP.ExecStateChangedWatcher.Range(func(_, value any) bool { + e, exists := value.(*contracts.EVM2EVMOffRampExecutionStateChanged) + if exists { + vLogs := e.LogInfo + hdr, err := destCCIP.Common.ChainClient.HeaderByNumber(ctx, new(big.Int).SetUint64(vLogs.BlockNumber)) + if err != nil { + return true + } + if hdr.Timestamp.After(lastSeenTimestamp) { + eventFoundAfterCursing = pointer.ToTime(hdr.Timestamp) + return false + } + } + return true + }) + if eventFoundAfterCursing != nil { + return fmt.Errorf("ExecutionStateChanged Event detected at %s after %s", lastSeenTimestamp, eventFoundAfterCursing.String()) + } + case <-ctx.Done(): + lggr.Info().Msgf("Successfully validated that no ExecutionStateChanged detected after %s for %s", lastSeenTimestamp, timeRange) + return nil + } + } +} + +func (destCCIP *DestCCIPModule) AssertEventExecutionStateChanged( + lggr *zerolog.Logger, + seqNum uint64, + timeout time.Duration, + timeNow time.Time, + reqStat *testreporters.RequestStat, + execState testhelpers.MessageExecutionState, +) (uint8, error) { + lggr.Info().Uint64("seqNum", seqNum).Str("Timeout", timeout.String()).Msg("Waiting for ExecutionStateChanged event") + timer := time.NewTimer(timeout) + defer timer.Stop() + ticker := time.NewTicker(time.Second) + defer ticker.Stop() + resetTimer := 0 + for { + select { + case <-ticker.C: + value, ok := destCCIP.ExecStateChangedWatcher.Load(seqNum) + if ok && value != nil { + e, exists := value.(*contracts.EVM2EVMOffRampExecutionStateChanged) + // find the type of the value + if exists { + // if the value is processed, delete it from the map + destCCIP.ExecStateChangedWatcher.Delete(seqNum) + vLogs := e.LogInfo + receivedAt := time.Now().UTC() + hdr, err := destCCIP.Common.ChainClient.HeaderByNumber(context.Background(), new(big.Int).SetUint64(vLogs.BlockNumber)) + if err == nil { + receivedAt = hdr.Timestamp + } + receipt, err := destCCIP.Common.ChainClient.GetTxReceipt(vLogs.TxHash) + if err != nil { + lggr.Warn().Msg("Failed to get receipt for ExecStateChanged event") + } + var gasUsed uint64 + if receipt != nil { + gasUsed = receipt.GasUsed + } + if testhelpers.MessageExecutionState(e.State) == execState { + lggr.Info().Uint64("seqNum", seqNum).Uint8("ExecutionState", e.State).Msg("ExecutionStateChanged event received") + reqStat.UpdateState(lggr, seqNum, testreporters.ExecStateChanged, receivedAt.Sub(timeNow), + testreporters.Success, + &testreporters.TransactionStats{ + TxHash: vLogs.TxHash.Hex(), + MsgID: fmt.Sprintf("0x%x", e.MessageId[:]), + GasUsed: gasUsed, + }, + ) + return e.State, nil + } + reqStat.UpdateState(lggr, seqNum, testreporters.ExecStateChanged, time.Since(timeNow), testreporters.Failure, nil) + return e.State, fmt.Errorf("ExecutionStateChanged event state - expected %d actual - %d with data %x for seq num %v for lane %d-->%d", + execState, testhelpers.MessageExecutionState(e.State), e.ReturnData, seqNum, destCCIP.SourceChainId, destCCIP.Common.ChainClient.GetChainID()) + } + } + case <-timer.C: + // if there is connection issue reset the context : + if destCCIP.Common.IsConnectionRestoredRecently != nil && !destCCIP.Common.IsConnectionRestoredRecently.Load() { + // if timer already has been reset 2 times we fail with warning + if resetTimer > 2 { + reqStat.UpdateState(lggr, seqNum, testreporters.ExecStateChanged, time.Since(timeNow), testreporters.Failure, nil) + return 0, fmt.Errorf("possible RPC issues - ExecutionStateChanged event not found for seq num %d for lane %d-->%d", + seqNum, destCCIP.SourceChainId, destCCIP.Common.ChainClient.GetChainID()) + } + timer.Reset(timeout) + resetTimer++ + lggr.Info().Int("count of reset", resetTimer).Msg("Resetting timer to validate ExecutionStateChanged event") + continue + } + reqStat.UpdateState(lggr, seqNum, testreporters.ExecStateChanged, time.Since(timeNow), testreporters.Failure, nil) + return 0, fmt.Errorf("ExecutionStateChanged event not found for seq num %d for lane %d-->%d", + seqNum, destCCIP.SourceChainId, destCCIP.Common.ChainClient.GetChainID()) + } + } +} + +func (destCCIP *DestCCIPModule) AssertEventReportAccepted( + lggr *zerolog.Logger, + seqNum uint64, + timeout time.Duration, + prevEventAt time.Time, + reqStat *testreporters.RequestStat, +) (*contracts.CommitStoreReportAccepted, time.Time, error) { + lggr.Info().Uint64("seqNum", seqNum).Str("Timeout", timeout.String()).Msg("Waiting for ReportAccepted event") + timer := time.NewTimer(timeout) + defer timer.Stop() + resetTimerCount := 0 + ticker := time.NewTicker(time.Second) + defer ticker.Stop() + for { + select { + case <-ticker.C: + value, ok := destCCIP.ReportAcceptedWatcher.Load(seqNum) + if ok && value != nil { + reportAccepted, exists := value.(*contracts.CommitStoreReportAccepted) + if exists { + // if the value is processed, delete it from the map + destCCIP.ReportAcceptedWatcher.Delete(seqNum) + receivedAt := time.Now().UTC() + hdr, err := destCCIP.Common.ChainClient.HeaderByNumber(context.Background(), new(big.Int).SetUint64(reportAccepted.LogInfo.BlockNumber)) + if err == nil { + receivedAt = hdr.Timestamp + } + + totalTime := receivedAt.Sub(prevEventAt) + // we cannot calculate the exact time at which block was finalized + // as a result sometimes we get a time which is slightly after the block was marked as finalized + // in such cases we get a negative time difference between finalized and report accepted if the commit + // has happened almost immediately after block being finalized + // in such cases we set the time difference to 1 second + if totalTime < 0 { + lggr.Warn(). + Uint64("seqNum", seqNum). + Time("finalized at", prevEventAt). + Time("ReportAccepted at", receivedAt). + Msg("ReportAccepted event received before finalized timestamp") + totalTime = time.Second + } + receipt, err := destCCIP.Common.ChainClient.GetTxReceipt(reportAccepted.LogInfo.TxHash) + if err != nil { + lggr.Warn().Msg("Failed to get receipt for ReportAccepted event") + } + var gasUsed uint64 + if receipt != nil { + gasUsed = receipt.GasUsed + } + reqStat.UpdateState(lggr, seqNum, testreporters.Commit, totalTime, testreporters.Success, + &testreporters.TransactionStats{ + GasUsed: gasUsed, + TxHash: reportAccepted.LogInfo.TxHash.Hex(), + CommitRoot: fmt.Sprintf("%x", reportAccepted.MerkleRoot), + }) + return reportAccepted, receivedAt, nil + } + } + case <-timer.C: + // if there is connection issue reset the context : + if destCCIP.Common.IsConnectionRestoredRecently != nil && !destCCIP.Common.IsConnectionRestoredRecently.Load() { + if resetTimerCount > 2 { + reqStat.UpdateState(lggr, seqNum, testreporters.Commit, time.Since(prevEventAt), testreporters.Failure, nil) + return nil, time.Now().UTC(), fmt.Errorf("possible RPC issue - ReportAccepted is not found for seq num %d lane %d-->%d", + seqNum, destCCIP.SourceChainId, destCCIP.Common.ChainClient.GetChainID()) + } + timer.Reset(timeout) + resetTimerCount++ + lggr.Info().Int("count of reset", resetTimerCount).Msg("Resetting timer to validate ReportAccepted event") + continue + } + reqStat.UpdateState(lggr, seqNum, testreporters.Commit, time.Since(prevEventAt), testreporters.Failure, nil) + return nil, time.Now().UTC(), fmt.Errorf("ReportAccepted is not found for seq num %d lane %d-->%d", + seqNum, destCCIP.SourceChainId, destCCIP.Common.ChainClient.GetChainID()) + } + } +} + +func (destCCIP *DestCCIPModule) AssertReportBlessed( + lggr *zerolog.Logger, + seqNum uint64, + timeout time.Duration, + CommitReport contracts.CommitStoreReportAccepted, + prevEventAt time.Time, + reqStat *testreporters.RequestStat, +) (time.Time, error) { + if destCCIP.Common.ARM == nil { + lggr.Info(). + Uint64("commit store interval Min", CommitReport.Min). + Uint64("commit store interval Max", CommitReport.Max). + Hex("Root", CommitReport.MerkleRoot[:]). + Msg("Skipping ReportBlessed check for mock ARM") + return prevEventAt, nil + } + lggr.Info(). + Str("Timeout", timeout.String()). + Uint64("commit store interval Min", CommitReport.Min). + Uint64("commit store interval Max", CommitReport.Max). + Msg("Waiting for Report To be blessed") + timer := time.NewTimer(timeout) + defer timer.Stop() + resetTimerCount := 0 + ticker := time.NewTicker(time.Second) + defer ticker.Stop() + for { + select { + case <-ticker.C: + var value any + var foundAsRoot, ok bool + value, foundAsRoot = destCCIP.ReportBlessedWatcher.Load(CommitReport.MerkleRoot) + receivedAt := time.Now().UTC() + ok = foundAsRoot + if !foundAsRoot { + // if the value is not found as root, check if it is found as sequence number + value, ok = destCCIP.ReportBlessedBySeqNum.Load(seqNum) + } + if ok && value != nil { + vLogs, exists := value.(*contracts.LogInfo) + if exists { + // if the root is found, set the value for all the sequence numbers in the interval and delete the root from the map + if foundAsRoot { + // set the value for all the sequence numbers in the interval + for i := CommitReport.Min; i <= CommitReport.Max; i++ { + destCCIP.ReportBlessedBySeqNum.Store(i, vLogs) + } + // if the value is processed, delete it from the map + destCCIP.ReportBlessedWatcher.Delete(CommitReport.MerkleRoot) + } else { + // if the value is processed, delete it from the map + destCCIP.ReportBlessedBySeqNum.Delete(seqNum) + } + hdr, err := destCCIP.Common.ChainClient.HeaderByNumber(context.Background(), new(big.Int).SetUint64(vLogs.BlockNumber)) + if err == nil { + receivedAt = hdr.Timestamp + } + receipt, err := destCCIP.Common.ChainClient.GetTxReceipt(vLogs.TxHash) + if err != nil { + lggr.Warn().Err(err).Msg("Failed to get receipt for ReportBlessed event") + } + var gasUsed uint64 + if receipt != nil { + gasUsed = receipt.GasUsed + } + reqStat.UpdateState(lggr, seqNum, testreporters.ReportBlessed, receivedAt.Sub(prevEventAt), testreporters.Success, + &testreporters.TransactionStats{ + GasUsed: gasUsed, + TxHash: vLogs.TxHash.String(), + CommitRoot: fmt.Sprintf("%x", CommitReport.MerkleRoot), + }) + return receivedAt, nil + } + } + case <-timer.C: + // if there is connection issue reset the context : + if destCCIP.Common.IsConnectionRestoredRecently != nil && !destCCIP.Common.IsConnectionRestoredRecently.Load() { + if resetTimerCount > 2 { + reqStat.UpdateState(lggr, seqNum, testreporters.ReportBlessed, time.Since(prevEventAt), testreporters.Failure, nil) + return time.Now().UTC(), fmt.Errorf("possible RPC issue - ReportBlessed is not found for interval min - %d max - %d lane %d-->%d", + CommitReport.Min, CommitReport.Max, destCCIP.SourceChainId, destCCIP.Common.ChainClient.GetChainID()) + } + timer.Reset(timeout) + resetTimerCount++ + lggr.Info().Int("count of reset", resetTimerCount).Msg("Resetting timer to validate ReportBlessed event") + continue + } + reqStat.UpdateState(lggr, seqNum, testreporters.ReportBlessed, time.Since(prevEventAt), testreporters.Failure, nil) + return time.Now().UTC(), fmt.Errorf("ReportBlessed is not found for interval min - %d max - %d lane %d-->%d", + CommitReport.Min, CommitReport.Max, destCCIP.SourceChainId, destCCIP.Common.ChainClient.GetChainID()) + } + } +} + +func (destCCIP *DestCCIPModule) AssertSeqNumberExecuted( + lggr *zerolog.Logger, + seqNumberBefore uint64, + timeout time.Duration, + timeNow time.Time, + reqStat *testreporters.RequestStat, +) error { + lggr.Info().Uint64("seqNum", seqNumberBefore).Str("Timeout", timeout.String()).Msg("Waiting to be processed by commit store") + timer := time.NewTimer(timeout) + defer timer.Stop() + resetTimerCount := 0 + ticker := time.NewTicker(time.Second) + defer ticker.Stop() + for { + select { + case <-ticker.C: + if destCCIP.NextSeqNumToCommit.Load() > seqNumberBefore { + return nil + } + seqNumberAfter, err := destCCIP.CommitStore.Instance.GetExpectedNextSequenceNumber(nil) + if err != nil { + // if we get error instead of returning error we continue, in case it's a temporary RPC failure . + continue + } + if seqNumberAfter > seqNumberBefore { + destCCIP.NextSeqNumToCommit.Store(seqNumberAfter) + return nil + } + case <-timer.C: + // if there is connection issue reset the context : + if destCCIP.Common.IsConnectionRestoredRecently != nil && !destCCIP.Common.IsConnectionRestoredRecently.Load() { + if resetTimerCount > 2 { + reqStat.UpdateState(lggr, seqNumberBefore, testreporters.Commit, time.Since(timeNow), testreporters.Failure, nil) + return fmt.Errorf("possible RPC issue - sequence number is not increased for seq num %d lane %d-->%d", + seqNumberBefore, destCCIP.SourceChainId, destCCIP.Common.ChainClient.GetChainID()) + } + timer.Reset(timeout) + resetTimerCount++ + lggr.Info().Int("count of reset", resetTimerCount).Msg("Resetting timer to validate seqnumber increase in commit store") + continue + } + reqStat.UpdateState(lggr, seqNumberBefore, testreporters.Commit, time.Since(timeNow), testreporters.Failure, nil) + return fmt.Errorf("sequence number is not increased for seq num %d lane %d-->%d", + seqNumberBefore, destCCIP.SourceChainId, destCCIP.Common.ChainClient.GetChainID()) + } + } +} + +func DefaultDestinationCCIPModule( + logger *zerolog.Logger, + testConf *testconfig.CCIPTestGroupConfig, + chainClient blockchain.EVMClient, + sourceChainId uint64, + sourceChain string, + laneConf *laneconfig.LaneConfig, +) (*DestCCIPModule, error) { + cmn, err := NewCCIPCommonFromConfig( + logger, testConf, chainClient, laneConf, + ) + if err != nil { + return nil, err + } + + sourceChainSelector, err := chainselectors.SelectorFromChainId(sourceChainId) + if err != nil { + return nil, fmt.Errorf("failed to get chain selector for source chain id %d: %w", sourceChainId, err) + } + return &DestCCIPModule{ + Common: cmn, + SourceChainId: sourceChainId, + SourceChainSelector: sourceChainSelector, + SourceNetworkName: sourceChain, + NextSeqNumToCommit: atomic.NewUint64(1), + ReportBlessedWatcher: &sync.Map{}, + ReportBlessedBySeqNum: &sync.Map{}, + ExecStateChangedWatcher: &sync.Map{}, + ReportAcceptedWatcher: &sync.Map{}, + }, nil +} + +type CCIPRequest struct { + ReqNo int64 + txHash string + txConfirmationTimestamp time.Time + RequestStat *testreporters.RequestStat +} + +func CCIPRequestFromTxHash(txHash common.Hash, chainClient blockchain.EVMClient) (CCIPRequest, *types.Receipt, error) { + rcpt, err := chainClient.GetTxReceipt(txHash) + if err != nil { + return CCIPRequest{}, nil, err + } + + hdr, err := chainClient.HeaderByNumber(context.Background(), rcpt.BlockNumber) + if err != nil { + return CCIPRequest{}, nil, err + } + txConfirmationTimestamp := hdr.Timestamp + + return CCIPRequest{ + txHash: txHash.Hex(), + txConfirmationTimestamp: txConfirmationTimestamp, + }, rcpt, nil +} + +type CCIPLane struct { + Test *testing.T + Logger *zerolog.Logger + SourceNetworkName string + DestNetworkName string + SourceChain blockchain.EVMClient + DestChain blockchain.EVMClient + Source *SourceCCIPModule + Dest *DestCCIPModule + NumberOfReq int + Reports *testreporters.CCIPLaneStats + Balance *BalanceSheet + SentReqs map[common.Hash][]CCIPRequest + TotalFee *big.Int // total fee for all the requests. Used for balance validation. + ValidationTimeout time.Duration + Context context.Context + SrcNetworkLaneCfg *laneconfig.LaneConfig + DstNetworkLaneCfg *laneconfig.LaneConfig + PriceReportingDisabled bool +} + +func (lane *CCIPLane) TokenPricesConfig() (string, error) { + d := &DynamicPriceGetterConfig{ + AggregatorPrices: make(map[common.Address]AggregatorPriceConfig), + StaticPrices: make(map[common.Address]StaticPriceConfig), + } + // for each token if there is a price aggregator, add it to the aggregator prices + // else add it to the static prices + for _, token := range lane.Dest.Common.BridgeTokens { + err := d.AddPriceConfig(token.Address(), lane.Dest.Common.PriceAggregators, LinkToUSD, lane.DestChain.GetChainID().Uint64()) + if err != nil { + return "", fmt.Errorf("error in adding PriceConfig for source bridge token %s: %w", token.Address(), err) + } + } + err := d.AddPriceConfig(lane.Dest.Common.FeeToken.Address(), lane.Dest.Common.PriceAggregators, LinkToUSD, lane.DestChain.GetChainID().Uint64()) + if err != nil { + return "", fmt.Errorf("error adding PriceConfig for dest Fee token %s: %w", lane.Dest.Common.FeeToken.Address(), err) + } + err = d.AddPriceConfig(lane.Dest.Common.WrappedNative.Hex(), lane.Dest.Common.PriceAggregators, WrappedNativeToUSD, lane.DestChain.GetChainID().Uint64()) + if err != nil { + return "", fmt.Errorf("error in adding PriceConfig for dest WrappedNative token %s: %w", lane.Dest.Common.WrappedNative.Hex(), err) + } + err = d.AddPriceConfig(lane.Source.Common.WrappedNative.Hex(), lane.Source.Common.PriceAggregators, WrappedNativeToUSD, lane.SourceChain.GetChainID().Uint64()) + if err != nil { + return "", fmt.Errorf("error in adding PriceConfig for source WrappedNative token %s: %w", lane.Source.Common.WrappedNative.Hex(), err) + } + return d.String() +} + +func (lane *CCIPLane) SetRemoteChainsOnPool() error { + if lane.Source.Common.ExistingDeployment { + return nil + } + if len(lane.Source.Common.BridgeTokenPools) != len(lane.Dest.Common.BridgeTokenPools) { + return fmt.Errorf("source (%d) and dest (%d) bridge token pools length should be same", + len(lane.Source.Common.BridgeTokenPools), len(lane.Dest.Common.BridgeTokenPools), + ) + } + for i, srcPool := range lane.Source.Common.BridgeTokenPools { + sourceToken := lane.Source.Common.BridgeTokens[i] + destToken := lane.Dest.Common.BridgeTokens[i] + dstPool := lane.Dest.Common.BridgeTokenPools[i] + + err := srcPool.SetRemoteChainOnPool(lane.Source.DestChainSelector, dstPool.EthAddress, destToken.ContractAddress) + if err != nil { + return err + } + err = dstPool.SetRemoteChainOnPool(lane.Dest.SourceChainSelector, srcPool.EthAddress, sourceToken.ContractAddress) + if err != nil { + return err + } + } + return nil +} + +// OptimizeStorage sets nil to various elements of CCIPLane which are only used +// during lane set up and not used for rest of the test duration +// this is called mainly by load test to keep the memory usage minimum for high number of lanes +func (lane *CCIPLane) OptimizeStorage() { + lane.Source.Common.FreeUpUnusedSpace() + lane.Dest.Common.FreeUpUnusedSpace() + lane.DstNetworkLaneCfg = nil + lane.SrcNetworkLaneCfg = nil + // close all header subscriptions for dest chains + queuedEvents := lane.Dest.Common.ChainClient.GetHeaderSubscriptions() + for subName := range queuedEvents { + lane.Dest.Common.ChainClient.DeleteHeaderEventSubscription(subName) + } + // close all header subscriptions for source chains except for finalized header + queuedEvents = lane.Source.Common.ChainClient.GetHeaderSubscriptions() + for subName := range queuedEvents { + if subName == blockchain.FinalizedHeaderKey { + continue + } + lane.Source.Common.ChainClient.DeleteHeaderEventSubscription(subName) + } +} + +func (lane *CCIPLane) UpdateLaneConfig() { + lane.Source.Common.WriteLaneConfig(lane.SrcNetworkLaneCfg) + lane.SrcNetworkLaneCfg.SrcContractsMu.Lock() + lane.SrcNetworkLaneCfg.SrcContracts[lane.Source.DestNetworkName] = laneconfig.SourceContracts{ + OnRamp: lane.Source.OnRamp.Address(), + DeployedAt: lane.Source.SrcStartBlock, + } + lane.SrcNetworkLaneCfg.SrcContractsMu.Unlock() + lane.Dest.Common.WriteLaneConfig(lane.DstNetworkLaneCfg) + lane.DstNetworkLaneCfg.DestContractsMu.Lock() + lane.DstNetworkLaneCfg.DestContracts[lane.Dest.SourceNetworkName] = laneconfig.DestContracts{ + OffRamp: lane.Dest.OffRamp.Address(), + CommitStore: lane.Dest.CommitStore.Address(), + ReceiverDapp: lane.Dest.ReceiverDapp.Address(), + } + lane.DstNetworkLaneCfg.DestContractsMu.Unlock() +} + +func (lane *CCIPLane) RecordStateBeforeTransfer() { + // collect the balance assert.ment to verify balances after transfer + bal, err := testhelpers.GetBalances(lane.Test, lane.Source.CollectBalanceRequirements()) + require.NoError(lane.Test, err, "fetching source balance") + lane.Balance.RecordBalance(bal) + + bal, err = testhelpers.GetBalances(lane.Test, lane.Dest.CollectBalanceRequirements()) + require.NoError(lane.Test, err, "fetching dest balance") + lane.Balance.RecordBalance(bal) + + // save the current block numbers to use in various filter log requests + lane.TotalFee = big.NewInt(0) + lane.NumberOfReq = 0 + lane.SentReqs = make(map[common.Hash][]CCIPRequest) +} + +func (lane *CCIPLane) AddToSentReqs(txHash common.Hash, reqStats []*testreporters.RequestStat) (*types.Receipt, error) { + request, rcpt, err := CCIPRequestFromTxHash(txHash, lane.Source.Common.ChainClient) + if err != nil { + for _, stat := range reqStats { + stat.UpdateState(lane.Logger, 0, testreporters.TX, 0, testreporters.Failure, nil) + } + return rcpt, fmt.Errorf("could not get request from tx hash %s: %w", txHash.Hex(), err) + } + var allRequests []CCIPRequest + for _, stat := range reqStats { + allRequests = append(allRequests, CCIPRequest{ + ReqNo: stat.ReqNo, + txHash: rcpt.TxHash.Hex(), + txConfirmationTimestamp: request.txConfirmationTimestamp, + RequestStat: stat, + }) + lane.NumberOfReq++ + } + lane.SentReqs[rcpt.TxHash] = allRequests + return rcpt, nil +} + +// Multicall sends multiple ccip-send requests in a single transaction +// It will create one transaction for all the requests and will wait for the confirmation +func (lane *CCIPLane) Multicall(noOfRequests int, multiSendAddr common.Address) error { + var ccipMultipleMsg []contracts.CCIPMsgData + feeToken := common.HexToAddress(lane.Source.Common.FeeToken.Address()) + genericMsg, err := lane.Source.CCIPMsg( + lane.Dest.ReceiverDapp.EthAddress, + lane.Source.Common.AllowOutOfOrder, + big.NewInt(DefaultDestinationGasLimit), + ) + if err != nil { + return fmt.Errorf("failed to form the ccip message: %w", err) + } + destChainSelector, err := chainselectors.SelectorFromChainId(lane.Source.DestinationChainId) + if err != nil { + return fmt.Errorf("failed getting the chain selector: %w", err) + } + var reqStats []*testreporters.RequestStat + var txstats []*testreporters.TransactionStats + for i := 1; i <= noOfRequests; i++ { + // form the message for transfer + msg := genericMsg + msg.Data = []byte(fmt.Sprintf("msg %d", i)) + sendData := contracts.CCIPMsgData{ + Msg: msg, + RouterAddr: lane.Source.Common.Router.EthAddress, + ChainSelector: destChainSelector, + } + + fee, err := lane.Source.Common.Router.GetFee(destChainSelector, msg) + if err != nil { + reason, _ := blockchain.RPCErrorFromError(err) + if reason != "" { + return fmt.Errorf("failed getting the fee: %s", reason) + } + return fmt.Errorf("failed getting the fee: %w", err) + } + log.Info().Str("fee", fee.String()).Msg("calculated fee") + sendData.Fee = fee + lane.TotalFee = new(big.Int).Add(lane.TotalFee, fee) + ccipMultipleMsg = append(ccipMultipleMsg, sendData) + // if token transfer is required, transfer the token amount to multisend + for j, amount := range lane.Source.TransferAmount { + // if length of sourceCCIP.TransferAmount is more than available bridge token use first bridge token + token := lane.Source.Common.BridgeTokens[0] + if j < len(lane.Source.Common.BridgeTokens) { + token = lane.Source.Common.BridgeTokens[j] + } + err = token.Transfer(lane.SourceChain.GetDefaultWallet(), multiSendAddr.Hex(), amount) + if err != nil { + return err + } + } + stat := testreporters.NewCCIPRequestStats(int64(lane.NumberOfReq+i), lane.SourceNetworkName, lane.DestNetworkName) + txstats = append(txstats, &testreporters.TransactionStats{ + Fee: fee.String(), + NoOfTokensSent: len(msg.TokenAmounts), + MessageBytesLength: int64(len(msg.Data)), + }) + reqStats = append(reqStats, stat) + } + isNative := true + // transfer the fee amount to multisend + if feeToken != (common.Address{}) { + isNative = false + err = lane.Source.Common.FeeToken.Transfer(multiSendAddr.Hex(), lane.TotalFee) + if err != nil { + return err + } + } + + tx, err := contracts.MultiCallCCIP(lane.Source.Common.ChainClient, multiSendAddr.Hex(), ccipMultipleMsg, isNative) + if err != nil { + // update the stats as failure for all the requests in the multicall tx + for _, stat := range reqStats { + stat.UpdateState(lane.Logger, 0, testreporters.TX, 0, testreporters.Failure, nil) + } + return fmt.Errorf("failed to send the multicall: %w", err) + } + rcpt, err := lane.AddToSentReqs(tx.Hash(), reqStats) + if err != nil { + return err + } + var gasUsed uint64 + if rcpt != nil { + gasUsed = rcpt.GasUsed + } + // update the stats for all the requests in the multicall tx + for i, stat := range reqStats { + txstats[i].GasUsed = gasUsed + txstats[i].TxHash = tx.Hash().Hex() + stat.UpdateState(lane.Logger, 0, testreporters.TX, 0, testreporters.Success, txstats[i]) + } + return nil +} + +// SendRequests sends individual ccip-send requests in different transactions +// It will create noOfRequests transactions +func (lane *CCIPLane) SendRequests(noOfRequests int, gasLimit *big.Int) error { + for i := 1; i <= noOfRequests; i++ { + stat := testreporters.NewCCIPRequestStats(int64(lane.NumberOfReq+i), lane.SourceNetworkName, lane.DestNetworkName) + txHash, txConfirmationDur, fee, err := lane.Source.SendRequest(lane.Dest.ReceiverDapp.EthAddress, gasLimit) + if err != nil { + stat.UpdateState(lane.Logger, 0, testreporters.TX, txConfirmationDur, testreporters.Failure, nil) + return fmt.Errorf("could not send request: %w", err) + } + err = lane.Source.Common.ChainClient.WaitForEvents() + if err != nil { + stat.UpdateState(lane.Logger, 0, testreporters.TX, txConfirmationDur, testreporters.Failure, nil) + return fmt.Errorf("could not send request: %w", err) + } + + noOfTokens := 0 + for _, tokenAmount := range lane.Source.TransferAmount { // Only count tokens that are actually sent + if tokenAmount != nil && tokenAmount.Cmp(big.NewInt(0)) > 0 { + noOfTokens++ + } + } + _, err = lane.AddToSentReqs(txHash, []*testreporters.RequestStat{stat}) + if err != nil { + return err + } + stat.UpdateState(lane.Logger, 0, testreporters.TX, txConfirmationDur, testreporters.Success, nil) + lane.TotalFee = bigmath.Add(lane.TotalFee, fee) + } + + return nil +} + +// manualExecutionOpts modify how ExecuteManually behaves +type manualExecutionOpts struct { + timeout time.Duration +} + +// ManualExecutionOption is a function that modifies ExecuteManually behavior +type ManualExecutionOption func(*manualExecutionOpts) + +// WithConfirmationTimeout sets a custom timeout for waiting for the confirmation of the manual execution +func WithConfirmationTimeout(timeout time.Duration) ManualExecutionOption { + return func(opts *manualExecutionOpts) { + opts.timeout = timeout + } +} + +// ExecuteManually attempts to execute pending CCIP transactions manually. +// This is necessary in situations where Smart Execution window for that message is over and Offchain plugin +// will not attempt to execute the message.In such situation any further message from same sender will not be executed until +// the blocking message is executed by the OffRamp. +// More info: https://docs.chain.link/ccip/concepts/manual-execution#manual-execution +func (lane *CCIPLane) ExecuteManually(options ...ManualExecutionOption) error { + var opts manualExecutionOpts + for _, opt := range options { + if opt != nil { + opt(&opts) + } + } + if opts.timeout == 0 { + opts.timeout = lane.ValidationTimeout + } + + onRampABI, err := abi.JSON(strings.NewReader(evm_2_evm_onramp.EVM2EVMOnRampABI)) + if err != nil { + return err + } + sendReqTopic := onRampABI.Events["CCIPSendRequested"].ID + for txHash, req := range lane.SentReqs { + for _, ccipReq := range req { + lane.Logger.Info().Str("ccip-send", txHash.Hex()).Msg("Executing request manually") + seqNum := ccipReq.RequestStat.SeqNum + sendReqReceipt, err := lane.Source.Common.ChainClient.GetTxReceipt(txHash) + if err != nil { + return err + } + if sendReqReceipt == nil { + return fmt.Errorf("could not find the receipt for tx %s", txHash.Hex()) + } + commitStat, ok := ccipReq.RequestStat.StatusByPhase[testreporters.Commit] + if !ok { + return fmt.Errorf("could not find the commit phase in the request stats, reqNo %d", ccipReq.RequestStat.ReqNo) + } + commitTx := commitStat.SendTransactionStats.TxHash + commitReceipt, err := lane.DestChain.GetTxReceipt(common.HexToHash(commitTx)) + if err != nil { + return err + } + var logIndex uint + // find the send request log index sendReqReceipt + for _, sendReqLog := range sendReqReceipt.Logs { + if sendReqLog.Topics[0] == sendReqTopic { + logSeqNum, err := lane.Source.OnRamp.Instance.ParseCCIPSendRequested(*sendReqLog) + if err != nil { + return err + } + if logSeqNum == seqNum { + logIndex = sendReqLog.Index + } + } + } + destChainSelector, err := chainselectors.SelectorFromChainId(lane.DestChain.GetChainID().Uint64()) + if err != nil { + return err + } + sourceChainSelector, err := chainselectors.SelectorFromChainId(lane.SourceChain.GetChainID().Uint64()) + if err != nil { + return err + } + // Calling `TransactionOpts` will automatically increase the nonce, so if this fails, any other destination transactions will time out + destUser, err := lane.DestChain.TransactionOpts(lane.DestChain.GetDefaultWallet()) + if err != nil { + return err + } + args := testhelpers.ManualExecArgs{ + SourceChainID: sourceChainSelector, + DestChainID: destChainSelector, + DestUser: destUser, + SourceChain: lane.SourceChain.Backend(), + DestChain: lane.DestChain.Backend(), + SourceStartBlock: sendReqReceipt.BlockNumber, + DestStartBlock: commitReceipt.BlockNumber.Uint64(), + SendReqTxHash: txHash.Hex(), + CommitStore: lane.Dest.CommitStore.Address(), + OnRamp: lane.Source.OnRamp.Address(), + OffRamp: lane.Dest.OffRamp.Address(), + SendReqLogIndex: logIndex, + GasLimit: big.NewInt(DefaultDestinationGasLimit), + } + timeNow := time.Now().UTC() + tx, err := args.ExecuteManually() + if err != nil { + return fmt.Errorf("could not execute manually: %w seqNum %d", err, seqNum) + } + + ctx, cancel := context.WithTimeout(context.Background(), opts.timeout) + rec, err := bind.WaitMined(ctx, lane.DestChain.DeployBackend(), tx) + if err != nil { + cancel() + return fmt.Errorf("could not get receipt: %w seqNum %d", err, seqNum) + } + cancel() + if rec.Status != 1 { + return fmt.Errorf( + "manual execution failed for seqNum %d with receipt status %d, use the revert-reason script on this transaction hash '%s' and this sender address '%s'", + seqNum, rec.Status, tx.Hash().Hex(), destUser.From.Hex(), + ) + } + lane.Logger.Info().Uint64("seqNum", seqNum).Msg("Manual Execution completed") + _, err = lane.Dest.AssertEventExecutionStateChanged(lane.Logger, seqNum, opts.timeout, + timeNow, ccipReq.RequestStat, testhelpers.ExecutionStateSuccess, + ) + if err != nil { + return fmt.Errorf("could not validate ExecutionStateChanged event: %w", err) + } + } + } + return nil +} + +// validationOptions are used in the ValidateRequests function to specify which phase is expected to fail and how +type validationOptions struct { + expectAnyPhaseToFail bool + phaseExpectedToFail testreporters.Phase // the phase expected to fail + expectedErrorMessage string // if provided, we're looking for a specific error message + timeout time.Duration // timeout for the validation +} + +// ValidationOptionFunc is a function that can be passed to ValidateRequests to specify which phase is expected to fail +type ValidationOptionFunc func(opts *validationOptions) + +// PhaseSpecificValidationOptionFunc can specify how exactly you want a phase to fail +type PhaseSpecificValidationOptionFunc func(*validationOptions) + +// WithErrorMessage specifies the expected error message for the phase that is expected to fail. +func WithErrorMessage(expectedErrorMessage string) PhaseSpecificValidationOptionFunc { + return func(opts *validationOptions) { + opts.expectedErrorMessage = expectedErrorMessage + } +} + +// WithTimeout specifies a custom timeout for validating that the phase failed. +func WithTimeout(timeout time.Duration) PhaseSpecificValidationOptionFunc { + return func(opts *validationOptions) { + opts.timeout = timeout + } +} + +// ExpectPhaseToFail specifies that a specific phase is expected to fail. +// You can optionally provide an expected error message, if you don't have one in mind, just pass an empty string. +// shouldExist is used to specify whether the phase should exist or not, which is only applicable to the `ExecStateChanged` phase. +// If you expect the `ExecStateChanged` events to be there, but in a "failed" state, set this to true. +// It will otherwise be ignored. +func ExpectPhaseToFail(phase testreporters.Phase, phaseSpecificOptions ...PhaseSpecificValidationOptionFunc) ValidationOptionFunc { + return func(opts *validationOptions) { + opts.phaseExpectedToFail = phase + for _, f := range phaseSpecificOptions { + if f != nil { + f(opts) + } + } + } +} + +// ExpectAnyPhaseToFail expects any phase in CCIP transaction to fail. +func ExpectAnyPhaseToFail(phaseSpecificOptions ...PhaseSpecificValidationOptionFunc) ValidationOptionFunc { + return func(opts *validationOptions) { + opts.expectAnyPhaseToFail = true + for _, f := range phaseSpecificOptions { + if f != nil { + f(opts) + } + } + } +} + +// ValidateRequests validates all sent request events. +// If you expect a specific phase to fail, you can pass a validationOptionFunc to specify exactly which one. +// If not, just pass in nil. +func (lane *CCIPLane) ValidateRequests(validationOptionFuncs ...ValidationOptionFunc) { + var opts validationOptions + for _, f := range validationOptionFuncs { + if f != nil { + f(&opts) + } + } + for txHash, ccipReqs := range lane.SentReqs { + require.Greater(lane.Test, len(ccipReqs), 0, "no ccip requests found for tx hash") + require.NoError(lane.Test, lane.ValidateRequestByTxHash(txHash, opts), "validating request events by tx hash") + } + if len(validationOptionFuncs) > 0 { + return + } + // Asserting balances reliably work only for simulated private chains. The testnet contract balances might get updated by other transactions + // verify the fee amount is deducted from sender, added to receiver token balances and + if len(lane.Source.TransferAmount) > 0 && len(lane.Source.Common.BridgeTokens) > 0 { + lane.Source.UpdateBalance(int64(lane.NumberOfReq), lane.TotalFee, lane.Balance) + lane.Dest.UpdateBalance(lane.Source.TransferAmount, int64(lane.NumberOfReq), lane.Balance) + } +} + +// ValidateRequestByTxHash validates the request events by tx hash. +// If a phaseExpectedToFail is provided, it will return no error if that phase fails, but will error if it succeeds. +func (lane *CCIPLane) ValidateRequestByTxHash(txHash common.Hash, opts validationOptions) error { + var ( + reqStats []*testreporters.RequestStat + timeout = lane.ValidationTimeout + ccipRequests = lane.SentReqs[txHash] + txConfirmation = ccipRequests[0].txConfirmationTimestamp + ) + require.Greater(lane.Test, len(ccipRequests), 0, "no ccip requests found for tx hash") + + defer func() { + for _, req := range ccipRequests { + lane.Reports.UpdatePhaseStatsForReq(req.RequestStat) + } + }() + for _, req := range ccipRequests { + reqStats = append(reqStats, req.RequestStat) + } + + if opts.phaseExpectedToFail == testreporters.CCIPSendRe && opts.timeout != 0 { + timeout = opts.timeout + } + msgLogs, ccipSendReqGenAt, err := lane.Source.AssertEventCCIPSendRequested( + lane.Logger, txHash.Hex(), timeout, txConfirmation, reqStats, + ) + if shouldReturn, phaseErr := isPhaseValid(lane.Logger, testreporters.CCIPSendRe, opts, err); shouldReturn { + return phaseErr + } + + sourceLogFinalizedAt, _, err := lane.Source.AssertSendRequestedLogFinalized(lane.Logger, txHash, msgLogs, ccipSendReqGenAt, reqStats) + if shouldReturn, phaseErr := isPhaseValid(lane.Logger, testreporters.SourceLogFinalized, opts, err); shouldReturn { + return phaseErr + } + for _, msgLog := range msgLogs { + seqNumber := msgLog.SequenceNumber + lane.Logger = ptr.Ptr(lane.Logger.With().Str("msgId", fmt.Sprintf("0x%x", msgLog.MessageId[:])).Logger()) + var reqStat *testreporters.RequestStat + for _, stat := range reqStats { + if stat.SeqNum == seqNumber { + reqStat = stat + break + } + } + if reqStat == nil { + return fmt.Errorf("could not find request stat for seq number %d", seqNumber) + } + + if opts.phaseExpectedToFail == testreporters.Commit && opts.timeout != 0 { + timeout = opts.timeout + } + err = lane.Dest.AssertSeqNumberExecuted(lane.Logger, seqNumber, timeout, sourceLogFinalizedAt, reqStat) + if shouldReturn, phaseErr := isPhaseValid(lane.Logger, testreporters.Commit, opts, err); shouldReturn { + return phaseErr + } + + // Verify whether commitStore has accepted the report + commitReport, reportAcceptedAt, err := lane.Dest.AssertEventReportAccepted( + lane.Logger, seqNumber, timeout, sourceLogFinalizedAt, reqStat, + ) + if shouldReturn, phaseErr := isPhaseValid(lane.Logger, testreporters.Commit, opts, err); shouldReturn { + return phaseErr + } + + if opts.phaseExpectedToFail == testreporters.ReportBlessed && opts.timeout != 0 { + timeout = opts.timeout + } + reportBlessedAt, err := lane.Dest.AssertReportBlessed(lane.Logger, seqNumber, timeout, *commitReport, reportAcceptedAt, reqStat) + if shouldReturn, phaseErr := isPhaseValid(lane.Logger, testreporters.ReportBlessed, opts, err); shouldReturn { + return phaseErr + } + + if opts.phaseExpectedToFail == testreporters.ExecStateChanged && opts.timeout != 0 { + timeout = opts.timeout + } + // Verify whether the execution state is changed and the transfer is successful + _, err = lane.Dest.AssertEventExecutionStateChanged( + lane.Logger, seqNumber, + timeout, + reportBlessedAt, + reqStat, + testhelpers.ExecutionStateSuccess, + ) + if shouldReturn, phaseErr := isPhaseValid(lane.Logger, testreporters.ExecStateChanged, opts, err); shouldReturn { + return phaseErr + } + } + return nil +} + +// isPhaseValid checks if the phase is in a valid state or not given expectations. +// If `shouldComplete` is true, it means that the phase validation is meant to end and we should return from the calling function. +func isPhaseValid( + logger *zerolog.Logger, + currentPhase testreporters.Phase, + opts validationOptions, + err error, +) (shouldComplete bool, validationError error) { + if opts.expectAnyPhaseToFail && err != nil { + logmsg := logger.Info().Str("Failed with Error", err.Error()).Str("Phase", string(currentPhase)) + logmsg.Msg("Phase failed, as expected") + return true, nil + } + // If no phase is expected to fail or the current phase is not the one expected to fail, we just return what we were given + if opts.phaseExpectedToFail == "" || currentPhase != opts.phaseExpectedToFail { + return err != nil, err + } + if err == nil && currentPhase == opts.phaseExpectedToFail { + return true, fmt.Errorf("expected phase '%s' to fail, but it passed", opts.phaseExpectedToFail) + } + logmsg := logger.Info().Str("Failed with Error", err.Error()).Str("Phase", string(currentPhase)) + + if opts.expectedErrorMessage != "" { + if !strings.Contains(err.Error(), opts.expectedErrorMessage) { + return true, fmt.Errorf("expected phase '%s' to fail with error message '%s' but got error '%s'", currentPhase, opts.expectedErrorMessage, err.Error()) + } + logmsg.Str("Expected Error Message", opts.expectedErrorMessage) + } + logmsg.Msg("Phase failed, as expected") + return true, nil +} + +// DisableAllRateLimiting disables all rate limiting for the lane, including ARL and token pool rate limits +func (lane *CCIPLane) DisableAllRateLimiting() error { + src := lane.Source + dest := lane.Dest + + // Tell OnRamp to not include any tokens in ARL + err := src.SetAllTokenTransferFeeConfigs(false) + if err != nil { + return fmt.Errorf("error disabling token transfer fee config for OnRamp: %w", err) + } + err = dest.RemoveAllRateLimitTokens(context.Background()) + if err != nil { + return fmt.Errorf("error removing rate limited tokens for OffRamp: %w", err) + } + // Disable ARL for OnRamp and OffRamp + err = src.OnRamp.SetRateLimit(evm_2_evm_onramp.RateLimiterConfig{ + IsEnabled: false, + Capacity: big.NewInt(0), + Rate: big.NewInt(0), + }) + if err != nil { + return fmt.Errorf("error disabling rate limit for source onramp: %w", err) + } + err = dest.OffRamp.SetRateLimit(contracts.RateLimiterConfig{ + IsEnabled: false, + Capacity: big.NewInt(0), + Rate: big.NewInt(0), + }) + if err != nil { + return fmt.Errorf("error disabling rate limit for destination offramp: %w", err) + } + // Disable individual token pool rate limits + for i, tokenPool := range src.Common.BridgeTokenPools { + err = tokenPool.SetRemoteChainRateLimits(src.DestChainSelector, token_pool.RateLimiterConfig{ + IsEnabled: false, + Capacity: big.NewInt(0), + Rate: big.NewInt(0), + }) + if err != nil { + return fmt.Errorf("error disabling rate limit for token pool %d: %w", i, err) + } + } + for i, tokenPool := range dest.Common.BridgeTokenPools { + err = tokenPool.SetRemoteChainRateLimits(dest.SourceChainSelector, token_pool.RateLimiterConfig{ + IsEnabled: false, + Capacity: big.NewInt(0), + Rate: big.NewInt(0), + }) + if err != nil { + return fmt.Errorf("error disabling rate limit for token pool %d: %w", i, err) + } + } + err = src.Common.ChainClient.WaitForEvents() + if err != nil { + return fmt.Errorf("error waiting for source chain events: %w", err) + } + err = dest.Common.ChainClient.WaitForEvents() + if err != nil { + return fmt.Errorf("error waiting for destination chain events: %w", err) + } + lane.Logger.Info().Msg("Disabled all rate limiting") + return nil +} + +func (lane *CCIPLane) StartEventWatchers() error { + lane.Logger.Info().Msg("Starting event watchers") + if lane.Source.Common.ChainClient.GetNetworkConfig().FinalityDepth == 0 { + err := lane.Source.Common.ChainClient.PollFinality() + if err != nil { + return err + } + } + + go lane.Source.Common.PollRPCConnection(lane.Context, lane.Logger) + go lane.Dest.Common.PollRPCConnection(lane.Context, lane.Logger) + + sendReqEventLatest := make(chan *evm_2_evm_onramp.EVM2EVMOnRampCCIPSendRequested) + senReqSub := event.Resubscribe(DefaultResubscriptionTimeout, func(_ context.Context) (event.Subscription, error) { + sub, err := lane.Source.OnRamp.WatchCCIPSendRequested(nil, sendReqEventLatest) + if err != nil { + log.Error().Err(err).Msg("error in subscribing to CCIPSendRequested event") + } + return sub, err + }) + if senReqSub == nil { + return fmt.Errorf("failed to subscribe to CCIPSendRequested event") + } + go func(sub event.Subscription) { + defer sub.Unsubscribe() + for { + select { + case e := <-sendReqEventLatest: + lane.Logger.Info().Msgf("CCIPSendRequested event received for seq number %d", e.Message.SequenceNumber) + eventsForTx, ok := lane.Source.CCIPSendRequestedWatcher.Load(e.Raw.TxHash.Hex()) + if ok { + lane.Source.CCIPSendRequestedWatcher.Store(e.Raw.TxHash.Hex(), append(eventsForTx.([]*contracts.SendReqEventData), + &contracts.SendReqEventData{ + MessageId: e.Message.MessageId, + SequenceNumber: e.Message.SequenceNumber, + DataLength: len(e.Message.Data), + NoOfTokens: len(e.Message.TokenAmounts), + LogInfo: contracts.LogInfo{ + BlockNumber: e.Raw.BlockNumber, + TxHash: e.Raw.TxHash, + }, + Fee: e.Message.FeeTokenAmount, + })) + } else { + lane.Source.CCIPSendRequestedWatcher.Store(e.Raw.TxHash.Hex(), []*contracts.SendReqEventData{ + { + MessageId: e.Message.MessageId, + SequenceNumber: e.Message.SequenceNumber, + DataLength: len(e.Message.Data), + NoOfTokens: len(e.Message.TokenAmounts), + LogInfo: contracts.LogInfo{ + BlockNumber: e.Raw.BlockNumber, + TxHash: e.Raw.TxHash, + }, + Fee: e.Message.FeeTokenAmount, + }, + }) + } + + lane.Source.CCIPSendRequestedWatcher = testutils.DeleteNilEntriesFromMap(lane.Source.CCIPSendRequestedWatcher) + case <-lane.Context.Done(): + return + } + } + }(senReqSub) + + reportAcceptedEvent := make(chan *commit_store.CommitStoreReportAccepted) + reportAccSub := event.Resubscribe(DefaultResubscriptionTimeout, func(_ context.Context) (event.Subscription, error) { + sub, err := lane.Dest.CommitStore.WatchReportAccepted(nil, reportAcceptedEvent) + if err != nil { + log.Error().Err(err).Msg("error in subscribing to ReportAccepted event") + } + return sub, err + }) + if reportAccSub == nil { + return fmt.Errorf("failed to subscribe to ReportAccepted event") + } + go func(sub event.Subscription) { + defer sub.Unsubscribe() + for { + select { + case e := <-reportAcceptedEvent: + lane.Logger.Info().Interface("Interval", e.Report.Interval).Msgf("ReportAccepted event received") + for i := e.Report.Interval.Min; i <= e.Report.Interval.Max; i++ { + lane.Dest.ReportAcceptedWatcher.Store(i, &contracts.CommitStoreReportAccepted{ + Min: e.Report.Interval.Min, + Max: e.Report.Interval.Max, + MerkleRoot: e.Report.MerkleRoot, + LogInfo: contracts.LogInfo{ + BlockNumber: e.Raw.BlockNumber, + TxHash: e.Raw.TxHash, + }, + }) + } + lane.Dest.ReportAcceptedWatcher = testutils.DeleteNilEntriesFromMap(lane.Dest.ReportAcceptedWatcher) + case <-lane.Context.Done(): + return + } + } + }(reportAccSub) + + if lane.Dest.Common.ARM != nil { + reportBlessedEvent := make(chan *rmn_contract.RMNContractTaggedRootBlessed) + blessedSub := event.Resubscribe(DefaultResubscriptionTimeout, func(_ context.Context) (event.Subscription, error) { + sub, err := lane.Dest.Common.ARM.Instance.WatchTaggedRootBlessed(nil, reportBlessedEvent, nil) + if err != nil { + log.Error().Err(err).Msg("error in subscribing to TaggedRootBlessed event") + } + return sub, err + }) + if blessedSub == nil { + return fmt.Errorf("failed to subscribe to TaggedRootBlessed event") + } + go func(sub event.Subscription) { + defer sub.Unsubscribe() + for { + select { + case e := <-reportBlessedEvent: + lane.Logger.Info().Msgf("TaggedRootBlessed event received for root %x", e.TaggedRoot.Root) + if e.TaggedRoot.CommitStore == lane.Dest.CommitStore.EthAddress { + lane.Dest.ReportBlessedWatcher.Store(e.TaggedRoot.Root, &contracts.LogInfo{ + BlockNumber: e.Raw.BlockNumber, + TxHash: e.Raw.TxHash, + }) + } + lane.Dest.ReportBlessedWatcher = testutils.DeleteNilEntriesFromMap(lane.Dest.ReportBlessedWatcher) + case <-lane.Context.Done(): + return + } + } + }(blessedSub) + } + + execStateChangedEventLatest := make(chan *evm_2_evm_offramp.EVM2EVMOffRampExecutionStateChanged) + execSub := event.Resubscribe(DefaultResubscriptionTimeout, func(_ context.Context) (event.Subscription, error) { + sub, err := lane.Dest.OffRamp.WatchExecutionStateChanged(nil, execStateChangedEventLatest, nil, nil) + if err != nil { + log.Error().Err(err).Msg("error in subscribing to ExecutionStateChanged event") + } + return sub, err + }) + if execSub == nil { + return fmt.Errorf("failed to subscribe to ExecutionStateChanged event") + } + go func(sub event.Subscription) { + defer sub.Unsubscribe() + for { + select { + case e := <-execStateChangedEventLatest: + lane.Logger.Info().Msgf("Execution state changed event received for seq number %d", e.SequenceNumber) + lane.Dest.ExecStateChangedWatcher.Store(e.SequenceNumber, &contracts.EVM2EVMOffRampExecutionStateChanged{ + SequenceNumber: e.SequenceNumber, + MessageId: e.MessageId, + State: e.State, + ReturnData: e.ReturnData, + LogInfo: contracts.LogInfo{ + BlockNumber: e.Raw.BlockNumber, + TxHash: e.Raw.TxHash, + }, + }) + lane.Dest.ExecStateChangedWatcher = testutils.DeleteNilEntriesFromMap(lane.Dest.ExecStateChangedWatcher) + case <-lane.Context.Done(): + return + } + } + }(execSub) + return nil +} + +func (lane *CCIPLane) CleanUp(clearFees bool) error { + lane.Logger.Info().Msg("Cleaning up lane") + if lane.Source.Common.ChainClient.GetNetworkConfig().FinalityDepth == 0 { + lane.Source.Common.ChainClient.CancelFinalityPolling() + } + // recover fees from onRamp contract + if clearFees && !lane.Source.Common.ChainClient.NetworkSimulated() { + err := lane.Source.PayCCIPFeeToOwnerAddress() + if err != nil { + return err + } + } + err := lane.Dest.Common.ChainClient.Close() + if err != nil { + return err + } + return lane.Source.Common.ChainClient.Close() +} + +// DeployNewCCIPLane sets up a lane and initiates lane.Source and lane.Destination +// If configureCLNodes is true it sets up jobs and contract config for the lane +func (lane *CCIPLane) DeployNewCCIPLane( + setUpCtx context.Context, + env *CCIPTestEnv, + testConf *testconfig.CCIPTestGroupConfig, + bootstrapAdded *atomic.Bool, + jobErrGroup *errgroup.Group, +) error { + var ( + err error + sourceChainClient = lane.SourceChain + destChainClient = lane.DestChain + srcConf = lane.SrcNetworkLaneCfg + destConf = lane.DstNetworkLaneCfg + commitAndExecOnSameDON = pointer.GetBool(testConf.CommitAndExecuteOnSameDON) + allowOutOfOrder = pointer.GetBool(testConf.AllowOutOfOrder) + withPipeline = pointer.GetBool(testConf.TokenConfig.WithPipeline) + configureCLNodes = !pointer.GetBool(testConf.ExistingDeployment) + ) + + lane.Source, err = DefaultSourceCCIPModule( + lane.Logger, + testConf, + sourceChainClient, destChainClient.GetChainID().Uint64(), + destChainClient.GetNetworkName(), + srcConf, + ) + if err != nil { + return fmt.Errorf("failed to create source module: %w", err) + } + + // If AllowOutOfOrder is set globally in test config, the assumption is to set it for every lane. + // However, if this is set as false, and set as true for specific chain in lane_configs, then apply it + // only for a lane where source network is of that chain. + if allowOutOfOrder { + lane.Source.Common.AllowOutOfOrder = true + } + lane.Dest, err = DefaultDestinationCCIPModule( + lane.Logger, testConf, + destChainClient, sourceChainClient.GetChainID().Uint64(), + sourceChainClient.GetNetworkName(), destConf, + ) + if err != nil { + return fmt.Errorf("failed to create destination module: %w", err) + } + + // deploy all source contracts + err = lane.Source.DeployContracts(srcConf) + if err != nil { + return fmt.Errorf("failed to deploy source contracts: %w", err) + } + // deploy all destination contracts + err = lane.Dest.DeployContracts(*lane.Source, destConf) + if err != nil { + return fmt.Errorf("failed to deploy destination contracts: %w", err) + } + // if it's a new USDC deployment, sync the USDC domain + err = lane.Source.Common.SyncUSDCDomain(lane.Dest.Common.TokenTransmitter, lane.Dest.Common.BridgeTokenPools, lane.Source.DestinationChainId) + if err != nil { + return fmt.Errorf("failed to sync USDC domain: %w", err) + } + + lane.UpdateLaneConfig() + + // if lane is being set up for already configured CL nodes and contracts + // no further action is necessary + if !configureCLNodes { + return nil + } + err = lane.Source.Common.WatchForPriceUpdates(setUpCtx, lane.Logger) + if err != nil { + return fmt.Errorf("error in starting price update watch %w", err) + } + if env == nil { + return fmt.Errorf("test environment not set") + } + // wait for the CL nodes to be ready before moving ahead with job creation + err = env.CLNodeWithKeyReady.Wait() + if err != nil { + return fmt.Errorf("failed to wait for CL nodes to be ready: %w", err) + } + clNodesWithKeys := env.CLNodesWithKeys + // set up ocr2 jobs + clNodes, exists := clNodesWithKeys[lane.Dest.Common.ChainClient.GetChainID().String()] + if !exists { + return fmt.Errorf("could not find CL nodes for %s", lane.Dest.Common.ChainClient.GetChainID().String()) + } + bootstrapCommit := clNodes[0] + var bootstrapExec *client.CLNodesWithKeys + commitNodes := clNodes[env.CommitNodeStartIndex : env.CommitNodeStartIndex+env.NumOfCommitNodes] + execNodes := clNodes[env.ExecNodeStartIndex : env.ExecNodeStartIndex+env.NumOfExecNodes] + if !commitAndExecOnSameDON { + if len(clNodes) < 11 { + return fmt.Errorf("not enough CL nodes for separate commit and execution nodes") + } + bootstrapExec = clNodes[1] // for a set-up of different commit and execution nodes second node is the bootstrapper for execution nodes + } + + // save the current block numbers. If there is a delay between job start up and ocr config set up, the jobs will + // replay the log polling from these mentioned block number. The dest block number should ideally be the block number on which + // contract config is set and the source block number should be the one on which the ccip send request is performed. + // Here for simplicity we are just taking the current block number just before the job is created. + currentBlockOnDest, err := destChainClient.LatestBlockNumber(context.Background()) + if err != nil { + return fmt.Errorf("getting current block should be successful in destination chain %w", err) + } + + var killgrave *ctftestenv.Killgrave + if env.LocalCluster != nil { + killgrave = env.LocalCluster.MockAdapter + } + var tokenAddresses []string + for _, token := range lane.Dest.Common.BridgeTokens { + tokenAddresses = append(tokenAddresses, token.Address()) + } + tokenAddresses = append(tokenAddresses, lane.Dest.Common.FeeToken.Address(), lane.Source.Common.WrappedNative.Hex(), lane.Dest.Common.WrappedNative.Hex()) + + // Only one off pipeline or price getter to be set. + tokenPricesUSDPipeline := "" + tokenPricesConfigJson := "" + if withPipeline { + tokensUSDUrl := TokenPricePipelineURLs(tokenAddresses, killgrave, env.MockServer) + tokenPricesUSDPipeline = TokenFeeForMultipleTokenAddr(tokensUSDUrl) + } else { + tokenPricesConfigJson, err = lane.TokenPricesConfig() + if err != nil { + return fmt.Errorf("error getting token prices config %w", err) + } + lane.Logger.Info().Str("tokenPricesConfigJson", tokenPricesConfigJson).Msg("Price getter config") + } + + jobParams := integrationtesthelpers.CCIPJobSpecParams{ + OffRamp: lane.Dest.OffRamp.EthAddress, + CommitStore: lane.Dest.CommitStore.EthAddress, + SourceChainName: sourceChainClient.GetNetworkName(), + DestChainName: destChainClient.GetNetworkName(), + DestEvmChainId: destChainClient.GetChainID().Uint64(), + SourceStartBlock: lane.Source.SrcStartBlock, + TokenPricesUSDPipeline: tokenPricesUSDPipeline, + PriceGetterConfig: tokenPricesConfigJson, + DestStartBlock: currentBlockOnDest, + } + if !lane.Source.Common.ExistingDeployment && lane.Source.Common.IsUSDCDeployment() { + api := "" + if killgrave != nil { + api = killgrave.InternalEndpoint + } + if env.MockServer != nil { + api = env.MockServer.Config.ClusterURL + } + if lane.Source.Common.TokenTransmitter == nil { + return fmt.Errorf("token transmitter address not set") + } + // Only one USDC allowed per chain + jobParams.USDCConfig = &config.USDCConfig{ + SourceTokenAddress: common.HexToAddress(lane.Source.Common.BridgeTokens[0].Address()), + SourceMessageTransmitterAddress: lane.Source.Common.TokenTransmitter.ContractAddress, + AttestationAPI: api, + AttestationAPITimeoutSeconds: 5, + } + } + if !bootstrapAdded.Load() { + bootstrapAdded.Store(true) + err := CreateBootstrapJob(jobParams, bootstrapCommit, bootstrapExec) + if err != nil { + return fmt.Errorf("failed to create bootstrap job: %w", err) + } + } + + bootstrapCommitP2PId := bootstrapCommit.KeysBundle.P2PKeys.Data[0].Attributes.PeerID + var p2pBootstrappersExec, p2pBootstrappersCommit *client.P2PData + if bootstrapExec != nil { + p2pBootstrappersExec = &client.P2PData{ + InternalIP: bootstrapExec.Node.InternalIP(), + PeerID: bootstrapExec.KeysBundle.P2PKeys.Data[0].Attributes.PeerID, + } + } + + p2pBootstrappersCommit = &client.P2PData{ + InternalIP: bootstrapCommit.Node.InternalIP(), + PeerID: bootstrapCommitP2PId, + } + + jobParams.P2PV2Bootstrappers = []string{p2pBootstrappersCommit.P2PV2Bootstrapper()} + + err = SetOCR2Config(lane.Context, lane.Logger, *testConf, commitNodes, execNodes, *lane.Dest, lane.PriceReportingDisabled) + if err != nil { + return fmt.Errorf("failed to set ocr2 config: %w", err) + } + + err = CreateOCR2CCIPCommitJobs(lane.Logger, jobParams, commitNodes, env.nodeMutexes, jobErrGroup) + if err != nil { + return fmt.Errorf("failed to create ocr2 commit jobs: %w", err) + } + if p2pBootstrappersExec != nil { + jobParams.P2PV2Bootstrappers = []string{p2pBootstrappersExec.P2PV2Bootstrapper()} + } + + err = CreateOCR2CCIPExecutionJobs(lane.Logger, jobParams, execNodes, env.nodeMutexes, jobErrGroup) + if err != nil { + return fmt.Errorf("failed to create ocr2 execution jobs: %w", err) + } + + if err := lane.Source.Common.ChainClient.WaitForEvents(); err != nil { + return fmt.Errorf("failed to wait for events: %w", err) + } + if err := lane.Dest.Common.ChainClient.WaitForEvents(); err != nil { + return fmt.Errorf("failed to wait for events: %w", err) + } + lane.Dest.Common.ChainClient.ParallelTransactions(false) + lane.Source.Common.ChainClient.ParallelTransactions(false) + + return nil +} + +// SetOCR2Config sets the oracle config in ocr2 contracts. If execNodes is nil, commit and execution jobs are set up in same DON +func SetOCR2Config( + ctx context.Context, + lggr *zerolog.Logger, + testConf testconfig.CCIPTestGroupConfig, + commitNodes, + execNodes []*client.CLNodesWithKeys, + destCCIP DestCCIPModule, + priceReportingDisabled bool, +) error { + inflightExpiryExec := commonconfig.MustNewDuration(InflightExpiryExec) + inflightExpiryCommit := commonconfig.MustNewDuration(InflightExpiryCommit) + blockTime, err := destCCIP.Common.AvgBlockTime(ctx) + if err != nil { + return fmt.Errorf("failed to get avg block time: %w", err) + } + + OCR2ParamsForCommit := contracts.OCR2ParamsForCommit(blockTime) + OCR2ParamsForExec := contracts.OCR2ParamsForExec(blockTime) + // if test config has custom ocr2 params, merge them with default params to replace default with custom ocr2 params provided in config + // for commit and exec + if testConf.CommitOCRParams != nil { + err := mergo.Merge(&OCR2ParamsForCommit, testConf.CommitOCRParams, mergo.WithOverride) + if err != nil { + return err + } + } + if testConf.ExecOCRParams != nil { + err := mergo.Merge(&OCR2ParamsForExec, testConf.ExecOCRParams, mergo.WithOverride) + if err != nil { + return err + } + } + lggr.Info(). + Dur("AvgBlockTimeOnDest", blockTime). + Interface("OCRParmsForCommit", OCR2ParamsForCommit). + Interface("OCRParmsForExec", OCR2ParamsForExec). + Msg("Setting OCR2 config") + commitOffchainCfg, err := contracts.NewCommitOffchainConfig( + *commonconfig.MustNewDuration(5 * time.Second), + 1e6, + 1e6, + *commonconfig.MustNewDuration(5 * time.Second), + 1e6, + *inflightExpiryCommit, + priceReportingDisabled, + ) + if err != nil { + return fmt.Errorf("failed to create commit offchain config: %w", err) + } + + commitOnchainCfg, err := contracts.NewCommitOnchainConfig( + destCCIP.Common.PriceRegistry.EthAddress, + ) + if err != nil { + return fmt.Errorf("failed to create commit onchain config: %w", err) + } + signers, transmitters, f, onchainConfig, offchainConfigVersion, offchainConfig, err := contracts.NewOffChainAggregatorV2ConfigForCCIPPlugin( + commitNodes, commitOffchainCfg, commitOnchainCfg, OCR2ParamsForCommit, 3*time.Minute) + if err != nil { + return fmt.Errorf("failed to create ocr2 config params for commit: %w", err) + } + + err = destCCIP.CommitStore.SetOCR2Config(signers, transmitters, f, onchainConfig, offchainConfigVersion, offchainConfig) + if err != nil { + return fmt.Errorf("failed to set ocr2 config for commit: %w", err) + } + + nodes := commitNodes + // if commit and exec job is set up in different DON + if len(execNodes) > 0 { + nodes = execNodes + } + if destCCIP.OffRamp != nil { + // Use out of order batching strategy if we expect to be sending out of order messages + batchingStrategyID := uint32(0) + if pointer.GetBool(testConf.AllowOutOfOrder) { + batchingStrategyID = uint32(1) + } + execOffchainCfg, err := contracts.NewExecOffchainConfig( + 1, + BatchGasLimit, + 0.7, + *inflightExpiryExec, + *commonconfig.MustNewDuration(RootSnoozeTime), + batchingStrategyID, + ) + if err != nil { + return fmt.Errorf("failed to create exec offchain config: %w", err) + } + execOnchainCfg, err := contracts.NewExecOnchainConfig( + uint32(DefaultPermissionlessExecThreshold.Seconds()), + destCCIP.Common.Router.EthAddress, + destCCIP.Common.PriceRegistry.EthAddress, + DefaultMaxNoOfTokensInMsg, + MaxDataBytes, + 200_000, + ) + if err != nil { + return fmt.Errorf("failed to create exec onchain config: %w", err) + } + signers, transmitters, f, onchainConfig, offchainConfigVersion, offchainConfig, err = contracts.NewOffChainAggregatorV2ConfigForCCIPPlugin( + nodes, + execOffchainCfg, + execOnchainCfg, + OCR2ParamsForExec, + 3*time.Minute, + ) + if err != nil { + return fmt.Errorf("failed to create ocr2 config params for exec: %w", err) + } + err = destCCIP.OffRamp.SetOCR2Config(signers, transmitters, f, onchainConfig, offchainConfigVersion, offchainConfig) + if err != nil { + return fmt.Errorf("failed to set ocr2 config for exec: %w", err) + } + } + return destCCIP.Common.ChainClient.WaitForEvents() +} + +func CreateBootstrapJob( + jobParams integrationtesthelpers.CCIPJobSpecParams, + bootstrapCommit *client.CLNodesWithKeys, + bootstrapExec *client.CLNodesWithKeys, +) error { + _, err := bootstrapCommit.Node.MustCreateJob(jobParams.BootstrapJob(jobParams.CommitStore.Hex())) + if err != nil { + return fmt.Errorf("shouldn't fail creating bootstrap job on bootstrap node %w", err) + } + if bootstrapExec != nil { + _, err := bootstrapExec.Node.MustCreateJob(jobParams.BootstrapJob(jobParams.OffRamp.Hex())) + if err != nil { + return fmt.Errorf("shouldn't fail creating bootstrap job on bootstrap node %w", err) + } + } + return nil +} + +func CreateOCR2CCIPCommitJobs( + lggr *zerolog.Logger, + jobParams integrationtesthelpers.CCIPJobSpecParams, + commitNodes []*client.CLNodesWithKeys, + mutexes []*sync.Mutex, + group *errgroup.Group, +) error { + ocr2SpecCommit, err := jobParams.CommitJobSpec() + if err != nil { + return fmt.Errorf("failed to create ocr2 commit job spec: %w", err) + } + createJob := func(index int, node *client.CLNodesWithKeys, ocr2SpecCommit client.OCR2TaskJobSpec, mu *sync.Mutex) error { + mu.Lock() + defer mu.Unlock() + ocr2SpecCommit.OCR2OracleSpec.OCRKeyBundleID.SetValid(node.KeysBundle.OCR2Key.Data.ID) + ocr2SpecCommit.OCR2OracleSpec.TransmitterID.SetValid(node.KeysBundle.EthAddress) + lggr.Info().Msgf("Creating CCIP-Commit job on OCR node %d job name %s", index+1, ocr2SpecCommit.Name) + _, err = node.Node.MustCreateJob(&ocr2SpecCommit) + if err != nil { + return fmt.Errorf("shouldn't fail creating CCIP-Commit job on OCR node %d job name %s - %w", index+1, ocr2SpecCommit.Name, err) + } + return nil + } + + testSpec := client.OCR2TaskJobSpec{ + Name: ocr2SpecCommit.Name, + JobType: ocr2SpecCommit.JobType, + OCR2OracleSpec: ocr2SpecCommit.OCR2OracleSpec, + } + for i, node := range commitNodes { + node := node + i := i + group.Go(func() error { + return createJob(i, node, testSpec, mutexes[i]) + }) + } + return nil +} + +func CreateOCR2CCIPExecutionJobs( + lggr *zerolog.Logger, + jobParams integrationtesthelpers.CCIPJobSpecParams, + execNodes []*client.CLNodesWithKeys, + mutexes []*sync.Mutex, + group *errgroup.Group, +) error { + ocr2SpecExec, err := jobParams.ExecutionJobSpec() + if err != nil { + return fmt.Errorf("failed to create ocr2 execution job spec: %w", err) + } + createJob := func(index int, node *client.CLNodesWithKeys, ocr2SpecExec client.OCR2TaskJobSpec, mu *sync.Mutex) error { + mu.Lock() + defer mu.Unlock() + ocr2SpecExec.OCR2OracleSpec.OCRKeyBundleID.SetValid(node.KeysBundle.OCR2Key.Data.ID) + ocr2SpecExec.OCR2OracleSpec.TransmitterID.SetValid(node.KeysBundle.EthAddress) + lggr.Info().Msgf("Creating CCIP-Exec job on OCR node %d job name %s", index+1, ocr2SpecExec.Name) + _, err = node.Node.MustCreateJob(&ocr2SpecExec) + if err != nil { + return fmt.Errorf("shouldn't fail creating CCIP-Exec job on OCR node %d job name %s - %w", index+1, + ocr2SpecExec.Name, err) + } + return nil + } + if ocr2SpecExec != nil { + for i, node := range execNodes { + node := node + i := i + group.Go(func() error { + return createJob(i, node, client.OCR2TaskJobSpec{ + Name: ocr2SpecExec.Name, + JobType: ocr2SpecExec.JobType, + MaxTaskDuration: ocr2SpecExec.MaxTaskDuration, + ForwardingAllowed: ocr2SpecExec.ForwardingAllowed, + OCR2OracleSpec: ocr2SpecExec.OCR2OracleSpec, + ObservationSource: ocr2SpecExec.ObservationSource, + }, mutexes[i]) + }) + } + } + return nil +} + +func TokenFeeForMultipleTokenAddr(tokenAddrToURL map[string]string) string { + source := "" + right := "" + i := 1 + for addr, url := range tokenAddrToURL { + source = source + fmt.Sprintf(` +token%d [type=http method=GET url="%s"]; +token%d_parse [type=jsonparse path="data,result"]; +token%d->token%d_parse;`, i, url, i, i, i) + right = right + fmt.Sprintf(` \\\"%s\\\":$(token%d_parse),`, addr, i) + i++ + } + right = right[:len(right)-1] + source = fmt.Sprintf(`%s +merge [type=merge left="{}" right="{%s}"];`, source, right) + + return source +} + +type CCIPTestEnv struct { + MockServer *ctfClient.MockserverClient + LocalCluster *test_env.CLClusterTestEnv + CLNodesWithKeys map[string][]*client.CLNodesWithKeys // key - network chain-id + CLNodes []*client.ChainlinkK8sClient + nodeMutexes []*sync.Mutex + ExecNodeStartIndex int + CommitNodeStartIndex int + NumOfAllowedFaultyCommit int + NumOfAllowedFaultyExec int + NumOfCommitNodes int + NumOfExecNodes int + K8Env *environment.Environment + CLNodeWithKeyReady *errgroup.Group // denotes if keys are created in chainlink node and ready to be used for job creation +} + +func (c *CCIPTestEnv) ChaosLabelForGeth(t *testing.T, srcChain, destChain string) { + err := c.K8Env.Client.LabelChaosGroupByLabels(c.K8Env.Cfg.Namespace, map[string]string{ + "app": GethLabel(srcChain), + }, ChaosGroupNetworkACCIPGeth) + require.NoError(t, err) + + err = c.K8Env.Client.LabelChaosGroupByLabels(c.K8Env.Cfg.Namespace, map[string]string{ + "app": GethLabel(destChain), + }, ChaosGroupNetworkBCCIPGeth) + require.NoError(t, err) + gethNetworksLabels := []string{GethLabel(srcChain), GethLabel(destChain)} + c.ChaosLabelForAllGeth(t, gethNetworksLabels) + +} + +func (c *CCIPTestEnv) ChaosLabelForAllGeth(t *testing.T, gethNetworksLabels []string) { + for _, gethNetworkLabel := range gethNetworksLabels { + err := c.K8Env.Client.AddLabel(c.K8Env.Cfg.Namespace, + fmt.Sprintf("app=%s", gethNetworkLabel), + fmt.Sprintf("geth=%s", ChaosGroupCCIPGeth)) + require.NoError(t, err) + } +} + +func (c *CCIPTestEnv) ChaosLabelForCLNodes(t *testing.T) { + allowedFaulty := c.NumOfAllowedFaultyCommit + commitStartInstance := c.CommitNodeStartIndex + 1 + execStartInstance := c.ExecNodeStartIndex + 1 + for i := commitStartInstance; i < len(c.CLNodes); i++ { + labelSelector := map[string]string{ + "app": "chainlink-0", + "instance": fmt.Sprintf("node-%d", i), + } + if i >= commitStartInstance && i < commitStartInstance+allowedFaulty+1 { + err := c.K8Env.Client.LabelChaosGroupByLabels(c.K8Env.Cfg.Namespace, labelSelector, ChaosGroupCommitAndExecFaultyPlus) + require.NoError(t, err) + } + if i >= commitStartInstance && i < commitStartInstance+allowedFaulty { + err := c.K8Env.Client.LabelChaosGroupByLabels(c.K8Env.Cfg.Namespace, labelSelector, ChaosGroupCommitAndExecFaulty) + require.NoError(t, err) + } + + // commit node starts from index 2 + if i >= commitStartInstance && i < commitStartInstance+c.NumOfCommitNodes { + err := c.K8Env.Client.LabelChaosGroupByLabels(c.K8Env.Cfg.Namespace, labelSelector, ChaosGroupCommit) + require.NoError(t, err) + } + if i >= commitStartInstance && i < commitStartInstance+c.NumOfAllowedFaultyCommit+1 { + err := c.K8Env.Client.LabelChaosGroupByLabels(c.K8Env.Cfg.Namespace, labelSelector, ChaosGroupCommitFaultyPlus) + require.NoError(t, err) + } + if i >= commitStartInstance && i < commitStartInstance+c.NumOfAllowedFaultyCommit { + err := c.K8Env.Client.LabelChaosGroupByLabels(c.K8Env.Cfg.Namespace, labelSelector, ChaosGroupCommitFaulty) + require.NoError(t, err) + } + if i >= execStartInstance && i < execStartInstance+c.NumOfExecNodes { + err := c.K8Env.Client.LabelChaosGroupByLabels(c.K8Env.Cfg.Namespace, labelSelector, ChaosGroupExecution) + require.NoError(t, err) + } + if i >= execStartInstance && i < execStartInstance+c.NumOfAllowedFaultyExec+1 { + err := c.K8Env.Client.LabelChaosGroupByLabels(c.K8Env.Cfg.Namespace, labelSelector, ChaosGroupExecutionFaultyPlus) + require.NoError(t, err) + } + if i >= execStartInstance && i < execStartInstance+c.NumOfAllowedFaultyExec { + err := c.K8Env.Client.LabelChaosGroupByLabels(c.K8Env.Cfg.Namespace, labelSelector, ChaosGroupExecutionFaulty) + require.NoError(t, err) + } + } +} + +func (c *CCIPTestEnv) ConnectToExistingNodes(envConfig *testconfig.Common) error { + if envConfig.ExistingCLCluster == nil { + return fmt.Errorf("existing cluster is nil") + } + noOfNodes := pointer.GetInt(envConfig.ExistingCLCluster.NoOfNodes) + namespace := pointer.GetString(envConfig.ExistingCLCluster.Name) + + for i := 0; i < noOfNodes; i++ { + cfg := envConfig.ExistingCLCluster.NodeConfigs[i] + if cfg == nil { + return fmt.Errorf("node %d config is nil", i+1) + } + clClient, err := client.NewChainlinkK8sClient(cfg, cfg.InternalIP, namespace) + if err != nil { + return fmt.Errorf("failed to create chainlink client: %w for node %d config %v", err, i+1, cfg) + } + c.CLNodes = append(c.CLNodes, clClient) + c.nodeMutexes = append(c.nodeMutexes, &sync.Mutex{}) + } + + return nil +} + +func (c *CCIPTestEnv) ConnectToDeployedNodes() error { + if c.LocalCluster != nil { + // for local cluster, fetch the values from the local cluster + for _, chainlinkNode := range c.LocalCluster.ClCluster.Nodes { + c.nodeMutexes = append(c.nodeMutexes, &sync.Mutex{}) + c.CLNodes = append(c.CLNodes, &client.ChainlinkK8sClient{ + ChainlinkClient: chainlinkNode.API, + }) + } + } else { + // in case of k8s, we need to connect to the chainlink nodes + log.Info().Msg("Connecting to launched resources") + chainlinkK8sNodes, err := client.ConnectChainlinkNodes(c.K8Env) + if err != nil { + return fmt.Errorf("failed to connect to chainlink nodes: %w", err) + } + if len(chainlinkK8sNodes) == 0 { + return fmt.Errorf("no CL node found") + } + + for range chainlinkK8sNodes { + c.nodeMutexes = append(c.nodeMutexes, &sync.Mutex{}) + } + c.CLNodes = chainlinkK8sNodes + if _, exists := c.K8Env.URLs[mockserver.InternalURLsKey]; exists { + c.MockServer = ctfClient.ConnectMockServer(c.K8Env) + } + } + return nil +} + +// SetUpNodeKeysAndFund creates node keys and funds the nodes +func (c *CCIPTestEnv) SetUpNodeKeysAndFund( + logger *zerolog.Logger, + nodeFund *big.Float, + chains []blockchain.EVMClient, +) error { + if c.CLNodes == nil || len(c.CLNodes) == 0 { + return fmt.Errorf("no chainlink nodes to setup") + } + var chainlinkNodes []*client.ChainlinkClient + for _, node := range c.CLNodes { + chainlinkNodes = append(chainlinkNodes, node.ChainlinkClient) + } + nodesWithKeys := make(map[string][]*client.CLNodesWithKeys) + + populateKeys := func(chain blockchain.EVMClient) error { + log.Info().Str("chain id", chain.GetChainID().String()).Msg("creating node keys for chain") + _, clNodes, err := client.CreateNodeKeysBundle(chainlinkNodes, "evm", chain.GetChainID().String()) + if err != nil { + return fmt.Errorf("failed to create node keys for chain %s: %w", chain.GetChainID().String(), err) + } + if len(clNodes) == 0 { + return fmt.Errorf("no CL node with keys found for chain %s", chain.GetNetworkName()) + } + + nodesWithKeys[chain.GetChainID().String()] = clNodes + return nil + } + + fund := func(ec blockchain.EVMClient) error { + cfg := ec.GetNetworkConfig() + if cfg == nil { + return fmt.Errorf("blank network config") + } + c1, err := blockchain.ConcurrentEVMClient(*cfg, c.K8Env, ec, *logger) + if err != nil { + return fmt.Errorf("getting concurrent evmclient chain %s %w", ec.GetNetworkName(), err) + } + defer func() { + if c1 != nil { + c1.Close() + } + }() + log.Info().Str("chain id", c1.GetChainID().String()).Msg("Funding Chainlink nodes for chain") + for i := 1; i < len(chainlinkNodes); i++ { + cl := chainlinkNodes[i] + m := c.nodeMutexes[i] + toAddress, err := cl.EthAddressesForChain(c1.GetChainID().String()) + if err != nil { + return err + } + for _, addr := range toAddress { + toAddr := common.HexToAddress(addr) + gasEstimates, err := c1.EstimateGas(ethereum.CallMsg{ + To: &toAddr, + }) + if err != nil { + return err + } + m.Lock() + err = c1.Fund(addr, nodeFund, gasEstimates) + m.Unlock() + if err != nil { + return err + } + } + } + return c1.WaitForEvents() + } + grp, _ := errgroup.WithContext(context.Background()) + for _, chain := range chains { + err := populateKeys(chain) + if err != nil { + return err + } + } + for _, chain := range chains { + chain := chain + grp.Go(func() error { + return fund(chain) + }) + } + err := grp.Wait() + if err != nil { + return fmt.Errorf("error funding nodes %w", err) + } + c.CLNodesWithKeys = nodesWithKeys + + return nil +} + +func AssertBalances(t *testing.T, bas []testhelpers.BalanceAssertion) { + logEvent := log.Info() + for _, b := range bas { + actual := b.Getter(t, b.Address) + assert.NotNil(t, actual, "%v getter return nil", b.Name) + if b.Within == "" { + assert.Equal(t, b.Expected, actual.String(), "wrong balance for %s got %s want %s", b.Name, actual, b.Expected) + logEvent.Interface(b.Name, struct { + Exp string + Actual string + }{ + Exp: b.Expected, + Actual: actual.String(), + }) + } else { + bi, _ := big.NewInt(0).SetString(b.Expected, 10) + withinI, _ := big.NewInt(0).SetString(b.Within, 10) + high := big.NewInt(0).Add(bi, withinI) + low := big.NewInt(0).Sub(bi, withinI) + assert.Equal(t, -1, actual.Cmp(high), + "wrong balance for %s got %s outside expected range [%s, %s]", b.Name, actual, low, high) + assert.Equal(t, 1, actual.Cmp(low), + "wrong balance for %s got %s outside expected range [%s, %s]", b.Name, actual, low, high) + logEvent.Interface(b.Name, struct { + ExpRange string + Actual string + }{ + ExpRange: fmt.Sprintf("[%s, %s]", low, high), + Actual: actual.String(), + }) + } + } + logEvent.Msg("balance assertions succeeded") +} + +type BalFunc func(ctx context.Context, addr string) (*big.Int, error) + +func GetterForLinkToken(getBalance BalFunc, addr string) func(t *testing.T, _ common.Address) *big.Int { + return func(t *testing.T, _ common.Address) *big.Int { + balance, err := getBalance(context.Background(), addr) + assert.NoError(t, err) + return balance + } +} + +type BalanceItem struct { + Address common.Address + Getter func(t *testing.T, addr common.Address) *big.Int + PreviousBalance *big.Int + AmtToAdd *big.Int + AmtToSub *big.Int +} + +type BalanceSheet struct { + mu *sync.Mutex + Items map[string]BalanceItem + PrevBalance map[string]*big.Int +} + +func (b *BalanceSheet) Update(key string, item BalanceItem) { + b.mu.Lock() + defer b.mu.Unlock() + prev, ok := b.Items[key] + if !ok { + b.Items[key] = item + return + } + amtToAdd, amtToSub := big.NewInt(0), big.NewInt(0) + if prev.AmtToAdd != nil { + amtToAdd = prev.AmtToAdd + } + if prev.AmtToSub != nil { + amtToSub = prev.AmtToSub + } + if item.AmtToAdd != nil { + amtToAdd = new(big.Int).Add(amtToAdd, item.AmtToAdd) + } + if item.AmtToSub != nil { + amtToSub = new(big.Int).Add(amtToSub, item.AmtToSub) + } + + b.Items[key] = BalanceItem{ + Address: item.Address, + Getter: item.Getter, + AmtToAdd: amtToAdd, + AmtToSub: amtToSub, + } +} + +func (b *BalanceSheet) RecordBalance(bal map[string]*big.Int) { + b.mu.Lock() + defer b.mu.Unlock() + for key, value := range bal { + if _, ok := b.PrevBalance[key]; !ok { + b.PrevBalance[key] = value + } + } +} + +func (b *BalanceSheet) Verify(t *testing.T) { + var balAssertions []testhelpers.BalanceAssertion + for key, item := range b.Items { + prevBalance, ok := b.PrevBalance[key] + require.Truef(t, ok, "previous balance is not captured for %s", key) + exp := prevBalance + if item.AmtToAdd != nil { + exp = new(big.Int).Add(exp, item.AmtToAdd) + } + if item.AmtToSub != nil { + exp = new(big.Int).Sub(exp, item.AmtToSub) + } + balAssertions = append(balAssertions, testhelpers.BalanceAssertion{ + Name: key, + Address: item.Address, + Getter: item.Getter, + Expected: exp.String(), + }) + } + AssertBalances(t, balAssertions) +} + +func NewBalanceSheet() *BalanceSheet { + return &BalanceSheet{ + mu: &sync.Mutex{}, + Items: make(map[string]BalanceItem), + PrevBalance: make(map[string]*big.Int), + } +} + +// SetMockServerWithUSDCAttestation responds with a mock attestation for any msgHash +// The path is set with regex to match any path that starts with /v1/attestations +func SetMockServerWithUSDCAttestation( + killGrave *ctftestenv.Killgrave, + mockserver *ctfClient.MockserverClient, +) error { + path := "/v1/attestations" + response := struct { + Status string `json:"status"` + Attestation string `json:"attestation"` + Error string `json:"error"` + }{ + Status: "complete", + Attestation: "0x9049623e91719ef2aa63c55f357be2529b0e7122ae552c18aff8db58b4633c4d3920ff03d3a6d1ddf11f06bf64d7fd60d45447ac81f527ba628877dc5ca759651b08ffae25a6d3b1411749765244f0a1c131cbfe04430d687a2e12fd9d2e6dc08e118ad95d94ad832332cf3c4f7a4f3da0baa803b7be024b02db81951c0f0714de1b", + } + if killGrave == nil && mockserver == nil { + return fmt.Errorf("both killgrave and mockserver are nil") + } + log.Info().Str("path", path).Msg("setting attestation-api response for any msgHash") + if killGrave != nil { + err := killGrave.SetAnyValueResponse(fmt.Sprintf("%s/{_hash:.*}", path), []string{http.MethodGet}, response) + if err != nil { + return fmt.Errorf("failed to set killgrave server value: %w", err) + } + } + if mockserver != nil { + err := mockserver.SetAnyValueResponse(fmt.Sprintf("%s/.*", path), response) + if err != nil { + return fmt.Errorf("failed to set mockserver value: %w URL = %s", err, fmt.Sprintf("%s/%s/.*", mockserver.LocalURL(), path)) + } + } + return nil +} + +// SetMockserverWithTokenPriceValue sets the mock responses in mockserver that are read by chainlink nodes +// to simulate different price feed value. +// it keeps updating the response every 15 seconds to simulate price feed updates +func SetMockserverWithTokenPriceValue( + killGrave *ctftestenv.Killgrave, + mockserver *ctfClient.MockserverClient, +) { + wg := &sync.WaitGroup{} + path := "token_contract_" + wg.Add(1) + go func() { + set := true + // keep updating token value every 15 second + for { + if killGrave == nil && mockserver == nil { + log.Fatal().Msg("both killgrave and mockserver are nil") + return + } + tokenValue := big.NewInt(time.Now().UnixNano()).String() + if killGrave != nil { + err := killGrave.SetAdapterBasedAnyValuePath(fmt.Sprintf("%s{.*}", path), []string{http.MethodGet}, tokenValue) + if err != nil { + log.Fatal().Err(err).Msg("failed to set killgrave server value") + return + } + } + if mockserver != nil { + err := mockserver.SetAnyValuePath(fmt.Sprintf("/%s.*", path), tokenValue) + if err != nil { + log.Fatal().Err(err).Str("URL", fmt.Sprintf("%s/%s/.*", mockserver.LocalURL(), path)).Msg("failed to set mockserver value") + return + } + } + if set { + set = false + wg.Done() + } + time.Sleep(15 * time.Second) + } + }() + // wait for the first value to be set + wg.Wait() +} + +// TokenPricePipelineURLs returns the mockserver urls for the token price pipeline +func TokenPricePipelineURLs( + tokenAddresses []string, + killGrave *ctftestenv.Killgrave, + mockserver *ctfClient.MockserverClient, +) map[string]string { + mapTokenURL := make(map[string]string) + + for _, tokenAddr := range tokenAddresses { + path := fmt.Sprintf("token_contract_%s", tokenAddr[2:12]) + if mockserver != nil { + mapTokenURL[tokenAddr] = fmt.Sprintf("%s/%s", mockserver.Config.ClusterURL, path) + } + if killGrave != nil { + mapTokenURL[tokenAddr] = fmt.Sprintf("%s/%s", killGrave.InternalEndpoint, path) + } + } + + return mapTokenURL +} diff --git a/integration-tests/ccip-tests/actions/ccip_helpers_test.go b/integration-tests/ccip-tests/actions/ccip_helpers_test.go new file mode 100644 index 00000000000..4ca1061d6f2 --- /dev/null +++ b/integration-tests/ccip-tests/actions/ccip_helpers_test.go @@ -0,0 +1,105 @@ +package actions + +import ( + "errors" + "testing" + + "github.com/rs/zerolog" + "github.com/stretchr/testify/require" + + "github.com/smartcontractkit/chainlink/integration-tests/ccip-tests/testreporters" +) + +func TestIsPhaseValid(t *testing.T) { + // isPhaseValid has some complex logic that could lead to false negatives + t.Parallel() + logger := zerolog.New(zerolog.Nop()) + + testCases := []struct { + name string + currentPhase testreporters.Phase + opts validationOptions + phaseErr error + + expectedShouldReturn bool + expectedErr error + }{ + { + name: "should return error immediately if phase error is present and no phase is expected to fail", + currentPhase: testreporters.CCIPSendRe, + opts: validationOptions{}, + phaseErr: errors.New("some error"), + + expectedShouldReturn: true, + expectedErr: errors.New("some error"), + }, + { + name: "should return with no error if phase is expected to fail and phase error present", + currentPhase: testreporters.CCIPSendRe, + opts: validationOptions{ + phaseExpectedToFail: testreporters.CCIPSendRe, + }, + phaseErr: errors.New("some error"), + + expectedShouldReturn: true, + expectedErr: nil, + }, + { + name: "should return with error if phase is expected to fail and no phase error present", + currentPhase: testreporters.CCIPSendRe, + opts: validationOptions{ + phaseExpectedToFail: testreporters.CCIPSendRe, + }, + phaseErr: nil, + + expectedShouldReturn: true, + expectedErr: errors.New("expected phase 'CCIPSendRequested' to fail, but it passed"), + }, + { + name: "should not return if phase is not expected to fail and no phase error present", + currentPhase: testreporters.CCIPSendRe, + opts: validationOptions{ + phaseExpectedToFail: testreporters.ExecStateChanged, + }, + phaseErr: nil, + + expectedShouldReturn: false, + expectedErr: nil, + }, + { + name: "should return with no error if phase is expected to fail with specific error message and that error message is present", + currentPhase: testreporters.CCIPSendRe, + opts: validationOptions{ + phaseExpectedToFail: testreporters.CCIPSendRe, + expectedErrorMessage: "some error", + }, + phaseErr: errors.New("some error"), + + expectedShouldReturn: true, + expectedErr: nil, + }, + { + name: "should return with error if phase is expected to fail with specific error message and that error message is not present", + currentPhase: testreporters.CCIPSendRe, + opts: validationOptions{ + phaseExpectedToFail: testreporters.CCIPSendRe, + expectedErrorMessage: "some error", + }, + phaseErr: errors.New("some other error"), + + expectedShouldReturn: true, + expectedErr: errors.New("expected phase 'CCIPSendRequested' to fail with error message 'some error' but got error 'some other error'"), + }, + } + + for _, tc := range testCases { + tc := tc + t.Run(tc.name, func(t *testing.T) { + t.Parallel() + + shouldReturn, err := isPhaseValid(&logger, tc.currentPhase, tc.opts, tc.phaseErr) + require.Equal(t, tc.expectedShouldReturn, shouldReturn, "shouldReturn not as expected") + require.Equal(t, tc.expectedErr, err, "err not as expected") + }) + } +} diff --git a/integration-tests/ccip-tests/actions/reorg_helpers.go b/integration-tests/ccip-tests/actions/reorg_helpers.go new file mode 100644 index 00000000000..017b8ffab69 --- /dev/null +++ b/integration-tests/ccip-tests/actions/reorg_helpers.go @@ -0,0 +1,86 @@ +package actions + +import ( + "fmt" + "testing" + "time" + + "github.com/rs/zerolog" + "github.com/stretchr/testify/assert" + + "github.com/smartcontractkit/chainlink-testing-framework/lib/client" +) + +// ReorgSuite is a test suite that generates reorgs on source/dest chains +type ReorgSuite struct { + t *testing.T + Cfg *ReorgConfig + Logger *zerolog.Logger + SrcClient *client.RPCClient + DstClient *client.RPCClient +} + +// ReorgConfig is a configuration for reorg tests +type ReorgConfig struct { + // SrcGethHTTPURL source chain Geth HTTP URL + SrcGethHTTPURL string + // DstGethHTTPURL dest chain Geth HTTP URL + DstGethHTTPURL string + // SrcFinalityDepth source chain finality depth + SrcFinalityDepth uint64 + // DstGethHTTPURL dest chain finality depth + DstFinalityDepth uint64 + // FinalityDelta blocks to rewind below or above finality + FinalityDelta int +} + +// Validate validates ReorgConfig params +func (rc *ReorgConfig) Validate() error { + if rc.FinalityDelta >= int(rc.SrcFinalityDepth) || rc.FinalityDelta >= int(rc.DstFinalityDepth) { + return fmt.Errorf( + "finality delta can't be higher than source or dest chain finality, delta: %d, src: %d, dst: %d", + rc.FinalityDelta, rc.SrcFinalityDepth, rc.DstFinalityDepth, + ) + } + return nil +} + +// NewReorgSuite creates new reorg suite with source/dest RPC clients, works only with Geth +func NewReorgSuite(t *testing.T, lggr *zerolog.Logger, cfg *ReorgConfig) (*ReorgSuite, error) { + if err := cfg.Validate(); err != nil { + return nil, err + } + return &ReorgSuite{ + t: t, + Cfg: cfg, + Logger: lggr, + SrcClient: client.NewRPCClient(cfg.SrcGethHTTPURL, nil), + DstClient: client.NewRPCClient(cfg.DstGethHTTPURL, nil), + }, nil +} + +// RunReorg rollbacks given chain, for N blocks back +func (r *ReorgSuite) RunReorg(client *client.RPCClient, blocksBack int, network string, startDelay time.Duration) { + go func() { + time.Sleep(startDelay) + r.Logger.Info(). + Str("Network", network). + Str("URL", client.URL). + Int("BlocksBack", blocksBack). + Msg(fmt.Sprintf("Rewinding blocks on %s chain", network)) + blockNumber, err := client.BlockNumber() + assert.NoError(r.t, err, "error getting block number") + r.Logger.Info(). + Int64("Number", blockNumber). + Str("Network", network). + Msg("Block number before rewinding") + err = client.GethSetHead(blocksBack) + assert.NoError(r.t, err, "error setting block head") + blockNumber, err = client.BlockNumber() + assert.NoError(r.t, err, "error getting block number") + r.Logger.Info(). + Int64("Number", blockNumber). + Str("Network", network). + Msg("Block number after rewinding") + }() +} diff --git a/integration-tests/ccip-tests/chaos/ccip_test.go b/integration-tests/ccip-tests/chaos/ccip_test.go new file mode 100644 index 00000000000..125e683dc5b --- /dev/null +++ b/integration-tests/ccip-tests/chaos/ccip_test.go @@ -0,0 +1,153 @@ +package chaos_test + +import ( + "math/big" + "testing" + "time" + + "github.com/stretchr/testify/require" + + "github.com/smartcontractkit/chainlink-testing-framework/lib/k8s/chaos" + "github.com/smartcontractkit/chainlink-testing-framework/lib/logging" + "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/ptr" + + "github.com/smartcontractkit/chainlink/integration-tests/ccip-tests/actions" + "github.com/smartcontractkit/chainlink/integration-tests/ccip-tests/testconfig" + "github.com/smartcontractkit/chainlink/integration-tests/ccip-tests/testsetups" +) + +/* @network-chaos and @pod-chaos are split intentionally into 2 parallel groups +we can't use chaos.NewNetworkPartition and chaos.NewFailPods in parallel +because of jsii runtime bug, see Makefile and please use those targets to run tests +In .github/workflows/ccip-chaos-tests.yml we use these tags to run these tests separately +*/ + +func TestChaosCCIP(t *testing.T) { + inputs := []struct { + testName string + chaosFunc chaos.ManifestFunc + chaosProps *chaos.Props + waitForChaosRecovery bool + }{ + { + testName: "CCIP works after rpc is down for NetworkA @network-chaos", + chaosFunc: chaos.NewNetworkPartition, + chaosProps: &chaos.Props{ + FromLabels: &map[string]*string{actions.ChaosGroupNetworkACCIPGeth: ptr.Ptr("1")}, + // chainlink-0 is default label set for all cll nodes + ToLabels: &map[string]*string{"app": ptr.Ptr("chainlink-0")}, + DurationStr: "1m", + }, + waitForChaosRecovery: true, + }, + { + testName: "CCIP works after rpc is down for NetworkB @network-chaos", + chaosFunc: chaos.NewNetworkPartition, + chaosProps: &chaos.Props{ + FromLabels: &map[string]*string{actions.ChaosGroupNetworkBCCIPGeth: ptr.Ptr("1")}, + ToLabels: &map[string]*string{"app": ptr.Ptr("chainlink-0")}, + DurationStr: "1m", + }, + waitForChaosRecovery: true, + }, + { + testName: "CCIP works after 2 rpc's are down for all cll nodes @network-chaos", + chaosFunc: chaos.NewNetworkPartition, + chaosProps: &chaos.Props{ + FromLabels: &map[string]*string{"geth": ptr.Ptr(actions.ChaosGroupCCIPGeth)}, + ToLabels: &map[string]*string{"app": ptr.Ptr("chainlink-0")}, + DurationStr: "1m", + }, + waitForChaosRecovery: true, + }, + { + testName: "CCIP Commit works after majority of CL nodes are recovered from pod failure @pod-chaos", + chaosFunc: chaos.NewFailPods, + chaosProps: &chaos.Props{ + LabelsSelector: &map[string]*string{actions.ChaosGroupCommitFaultyPlus: ptr.Ptr("1")}, + DurationStr: "1m", + }, + waitForChaosRecovery: true, + }, + { + testName: "CCIP Execution works after majority of CL nodes are recovered from pod failure @pod-chaos", + chaosFunc: chaos.NewFailPods, + chaosProps: &chaos.Props{ + LabelsSelector: &map[string]*string{actions.ChaosGroupExecutionFaultyPlus: ptr.Ptr("1")}, + DurationStr: "1m", + }, + waitForChaosRecovery: true, + }, + { + testName: "CCIP Commit works while minority of CL nodes are in failed state for pod failure @pod-chaos", + chaosFunc: chaos.NewFailPods, + chaosProps: &chaos.Props{ + LabelsSelector: &map[string]*string{actions.ChaosGroupCommitFaulty: ptr.Ptr("1")}, + DurationStr: "90s", + }, + waitForChaosRecovery: false, + }, + { + testName: "CCIP Execution works while minority of CL nodes are in failed state for pod failure @pod-chaos", + chaosFunc: chaos.NewFailPods, + chaosProps: &chaos.Props{ + LabelsSelector: &map[string]*string{actions.ChaosGroupExecutionFaulty: ptr.Ptr("1")}, + DurationStr: "90s", + }, + waitForChaosRecovery: false, + }, + } + + for _, in := range inputs { + in := in + t.Run(in.testName, func(t *testing.T) { + t.Parallel() + l := logging.GetTestLogger(t) + testCfg := testsetups.NewCCIPTestConfig(t, l, testconfig.Chaos) + var numOfRequests = 3 + + setUpArgs := testsetups.CCIPDefaultTestSetUp( + t, &l, "chaos-ccip", nil, testCfg) + + if len(setUpArgs.Lanes) == 0 { + return + } + + lane := setUpArgs.Lanes[0].ForwardLane + + tearDown := setUpArgs.TearDown + testEnvironment := setUpArgs.Env.K8Env + testSetup := setUpArgs.Env + + testSetup.ChaosLabelForGeth(t, lane.SourceChain.GetNetworkName(), lane.DestChain.GetNetworkName()) + testSetup.ChaosLabelForCLNodes(t) + + lane.RecordStateBeforeTransfer() + // Send the ccip-request and verify ocr2 is running + err := lane.SendRequests(1, big.NewInt(actions.DefaultDestinationGasLimit)) + require.NoError(t, err) + lane.ValidateRequests(nil) + + // apply chaos + chaosId, err := testEnvironment.Chaos.Run(in.chaosFunc(testEnvironment.Cfg.Namespace, in.chaosProps)) + require.NoError(t, err) + t.Cleanup(func() { + if chaosId != "" { + require.NoError(t, testEnvironment.Chaos.Stop(chaosId)) + } + require.NoError(t, tearDown()) + }) + lane.RecordStateBeforeTransfer() + // Now send the ccip-request while the chaos is at play + err = lane.SendRequests(numOfRequests, big.NewInt(actions.DefaultDestinationGasLimit)) + require.NoError(t, err) + if in.waitForChaosRecovery { + // wait for chaos to be recovered before further validation + require.NoError(t, testEnvironment.Chaos.WaitForAllRecovered(chaosId, 1*time.Minute)) + } else { + l.Info().Msg("proceeding without waiting for chaos recovery") + } + lane.ValidateRequests(nil) + }) + } +} diff --git a/integration-tests/ccip-tests/contracts/contract_deployer.go b/integration-tests/ccip-tests/contracts/contract_deployer.go new file mode 100644 index 00000000000..579d16da4fc --- /dev/null +++ b/integration-tests/ccip-tests/contracts/contract_deployer.go @@ -0,0 +1,1583 @@ +package contracts + +import ( + "context" + "crypto/ed25519" + "encoding/hex" + "fmt" + "math/big" + "strings" + "time" + + "github.com/Masterminds/semver/v3" + "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/rs/zerolog" + "github.com/rs/zerolog/log" + "golang.org/x/crypto/curve25519" + + ocrconfighelper2 "github.com/smartcontractkit/libocr/offchainreporting2/confighelper" + ocrtypes2 "github.com/smartcontractkit/libocr/offchainreporting2/types" + + "github.com/smartcontractkit/chainlink-common/pkg/config" + "github.com/smartcontractkit/chainlink-testing-framework/lib/blockchain" + + "github.com/smartcontractkit/chainlink/integration-tests/client" + "github.com/smartcontractkit/chainlink/integration-tests/contracts" + "github.com/smartcontractkit/chainlink/integration-tests/wrappers" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/commit_store" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/commit_store_1_2_0" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/evm_2_evm_offramp" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/evm_2_evm_offramp_1_2_0" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/evm_2_evm_onramp" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/evm_2_evm_onramp_1_2_0" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/lock_release_token_pool" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/lock_release_token_pool_1_4_0" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/maybe_revert_message_receiver" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/mock_rmn_contract" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/mock_usdc_token_messenger" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/mock_usdc_token_transmitter" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/mock_v3_aggregator_contract" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/price_registry_1_2_0" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/rmn_contract" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/router" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/token_admin_registry" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/token_pool" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/token_pool_1_4_0" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/usdc_token_pool" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/usdc_token_pool_1_4_0" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/weth9" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/link_token_interface" + type_and_version "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/type_and_version_interface_wrapper" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/shared/generated/burn_mint_erc677" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/shared/generated/erc20" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/abihelpers" + ccipconfig "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/config" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/testhelpers" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/testhelpers/testhelpers_1_4_0" + "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm" +) + +// MatchContractVersionsOrAbove checks if the current contract versions for the test match or exceed the provided contract versions +func MatchContractVersionsOrAbove(requiredContractVersions map[Name]Version) error { + for contractName, r := range requiredContractVersions { + required := r + if contractVersion, ok := VersionMap[contractName]; !ok { + return fmt.Errorf("contract %s not found in version map", contractName) + } else if contractVersion.Compare(&required.Version) < 0 { + return fmt.Errorf("contract %s version %s is less than required version %s", contractName, contractVersion, required.Version) + } + } + return nil +} + +// NeedTokenAdminRegistry checks if token admin registry is needed for the current version of ccip +// if the version is less than 1.5.0, then token admin registry is not needed +func NeedTokenAdminRegistry() bool { + return MatchContractVersionsOrAbove(map[Name]Version{ + TokenPoolContract: V1_5_0, + }) == nil +} + +// CCIPContractsDeployer provides the implementations for deploying CCIP ETH contracts +type CCIPContractsDeployer struct { + evmClient blockchain.EVMClient + logger *zerolog.Logger +} + +// NewCCIPContractsDeployer returns an instance of a contract deployer for CCIP +func NewCCIPContractsDeployer(logger *zerolog.Logger, bcClient blockchain.EVMClient) (*CCIPContractsDeployer, error) { + return &CCIPContractsDeployer{ + evmClient: bcClient, + logger: logger, + }, nil +} + +func (e *CCIPContractsDeployer) Client() blockchain.EVMClient { + return e.evmClient +} + +func (e *CCIPContractsDeployer) DeployMultiCallContract() (common.Address, error) { + multiCallABI, err := abi.JSON(strings.NewReader(MultiCallABI)) + if err != nil { + return common.Address{}, err + } + address, tx, _, err := e.evmClient.DeployContract("MultiCall Contract", func( + auth *bind.TransactOpts, + _ bind.ContractBackend, + ) (common.Address, *types.Transaction, interface{}, error) { + address, tx, contract, err := bind.DeployContract(auth, multiCallABI, common.FromHex(MultiCallBIN), wrappers.MustNewWrappedContractBackend(e.evmClient, nil)) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, contract, err + }) + if err != nil { + return common.Address{}, err + } + r, err := bind.WaitMined(context.Background(), e.evmClient.DeployBackend(), tx) + if err != nil { + return common.Address{}, err + } + if r.Status != types.ReceiptStatusSuccessful { + return common.Address{}, fmt.Errorf("deploy multicall failed") + } + return *address, nil +} + +func (e *CCIPContractsDeployer) DeployTokenMessenger(tokenTransmitter common.Address) (*common.Address, error) { + address, _, _, err := e.evmClient.DeployContract("Mock Token Messenger", func( + auth *bind.TransactOpts, + _ bind.ContractBackend, + ) (common.Address, *types.Transaction, interface{}, error) { + address, tx, contract, err := mock_usdc_token_messenger.DeployMockE2EUSDCTokenMessenger(auth, wrappers.MustNewWrappedContractBackend(e.evmClient, nil), 0, tokenTransmitter) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, contract, err + }) + + return address, err +} + +func (e *CCIPContractsDeployer) NewTokenTransmitter(addr common.Address) (*TokenTransmitter, error) { + transmitter, err := mock_usdc_token_transmitter.NewMockE2EUSDCTransmitter(addr, wrappers.MustNewWrappedContractBackend(e.evmClient, nil)) + + if err != nil { + return nil, err + } + e.logger.Info(). + Str("Contract Address", addr.Hex()). + Str("Contract Name", "Mock USDC Token Transmitter"). + Str("From", e.evmClient.GetDefaultWallet().Address()). + Str("Network Name", e.evmClient.GetNetworkConfig().Name). + Msg("New contract") + return &TokenTransmitter{ + client: e.evmClient, + instance: transmitter, + ContractAddress: addr, + }, err +} + +func (e *CCIPContractsDeployer) DeployTokenTransmitter(domain uint32, usdcToken common.Address) (*TokenTransmitter, error) { + address, _, instance, err := e.evmClient.DeployContract("Mock Token Transmitter", func( + auth *bind.TransactOpts, + _ bind.ContractBackend, + ) (common.Address, *types.Transaction, interface{}, error) { + address, tx, contract, err := mock_usdc_token_transmitter.DeployMockE2EUSDCTransmitter(auth, wrappers.MustNewWrappedContractBackend(e.evmClient, nil), 0, domain, usdcToken) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, contract, err + }) + + if err != nil { + return nil, fmt.Errorf("error in deploying usdc token transmitter: %w", err) + } + + return &TokenTransmitter{ + client: e.evmClient, + instance: instance.(*mock_usdc_token_transmitter.MockE2EUSDCTransmitter), + ContractAddress: *address, + }, err +} + +func (e *CCIPContractsDeployer) DeployLinkTokenContract() (*LinkToken, error) { + address, _, instance, err := e.evmClient.DeployContract("Link Token", func( + auth *bind.TransactOpts, + _ bind.ContractBackend, + ) (common.Address, *types.Transaction, interface{}, error) { + return link_token_interface.DeployLinkToken(auth, wrappers.MustNewWrappedContractBackend(e.evmClient, nil)) + }) + + if err != nil { + return nil, err + } + return &LinkToken{ + client: e.evmClient, + logger: e.logger, + instance: instance.(*link_token_interface.LinkToken), + EthAddress: *address, + }, err +} + +// DeployBurnMintERC677 deploys a BurnMintERC677 contract, mints given amount ( if provided) to the owner address and returns the ERC20Token wrapper instance +func (e *CCIPContractsDeployer) DeployBurnMintERC677(ownerMintingAmount *big.Int) (*ERC677Token, error) { + address, _, instance, err := e.evmClient.DeployContract("Burn Mint ERC 677", func( + auth *bind.TransactOpts, + _ bind.ContractBackend, + ) (common.Address, *types.Transaction, interface{}, error) { + return burn_mint_erc677.DeployBurnMintERC677(auth, wrappers.MustNewWrappedContractBackend(e.evmClient, nil), "Test Token ERC677", "TERC677", 6, new(big.Int).Mul(big.NewInt(1e18), big.NewInt(1e9))) + }) + if err != nil { + return nil, err + } + + token := &ERC677Token{ + client: e.evmClient, + logger: e.logger, + ContractAddress: *address, + instance: instance.(*burn_mint_erc677.BurnMintERC677), + OwnerAddress: common.HexToAddress(e.evmClient.GetDefaultWallet().Address()), + OwnerWallet: e.evmClient.GetDefaultWallet(), + } + if ownerMintingAmount != nil { + // grant minter role to owner and mint tokens + err = token.GrantMintRole(common.HexToAddress(e.evmClient.GetDefaultWallet().Address())) + if err != nil { + return token, fmt.Errorf("granting minter role to owner shouldn't fail %w", err) + } + err = e.evmClient.WaitForEvents() + if err != nil { + return token, fmt.Errorf("error in waiting for granting mint role %w", err) + } + err = token.Mint(common.HexToAddress(e.evmClient.GetDefaultWallet().Address()), ownerMintingAmount) + if err != nil { + return token, fmt.Errorf("minting tokens shouldn't fail %w", err) + } + } + return token, err +} + +func (e *CCIPContractsDeployer) DeployERC20TokenContract(deployerFn blockchain.ContractDeployer) (*ERC20Token, error) { + address, _, _, err := e.evmClient.DeployContract("Custom ERC20 Token", deployerFn) + if err != nil { + return nil, err + } + err = e.evmClient.WaitForEvents() + if err != nil { + return nil, err + } + return e.NewERC20TokenContract(*address) +} + +func (e *CCIPContractsDeployer) NewLinkTokenContract(addr common.Address) (*LinkToken, error) { + token, err := link_token_interface.NewLinkToken(addr, wrappers.MustNewWrappedContractBackend(e.evmClient, nil)) + + if err != nil { + return nil, err + } + e.logger.Info(). + Str("Contract Address", addr.Hex()). + Str("Contract Name", "Link Token"). + Str("From", e.evmClient.GetDefaultWallet().Address()). + Str("Network Name", e.evmClient.GetNetworkConfig().Name). + Msg("New contract") + return &LinkToken{ + client: e.evmClient, + logger: e.logger, + instance: token, + EthAddress: addr, + }, err +} + +func (e *CCIPContractsDeployer) NewERC20TokenContract(addr common.Address) (*ERC20Token, error) { + token, err := erc20.NewERC20(addr, wrappers.MustNewWrappedContractBackend(e.evmClient, nil)) + + if err != nil { + return nil, err + } + e.logger.Info(). + Str("Contract Address", addr.Hex()). + Str("Contract Name", "ERC20 Token"). + Str("From", e.evmClient.GetDefaultWallet().Address()). + Str("Network Name", e.evmClient.GetNetworkConfig().Name). + Msg("New contract") + return &ERC20Token{ + client: e.evmClient, + logger: e.logger, + instance: token, + ContractAddress: addr, + OwnerAddress: common.HexToAddress(e.evmClient.GetDefaultWallet().Address()), + OwnerWallet: e.evmClient.GetDefaultWallet(), + }, err +} + +func (e *CCIPContractsDeployer) NewLockReleaseTokenPoolContract(addr common.Address) ( + *TokenPool, + error, +) { + version := VersionMap[TokenPoolContract] + e.logger.Info().Str("Version", version.String()).Msg("New LockRelease Token Pool") + switch version { + case Latest: + pool, err := lock_release_token_pool.NewLockReleaseTokenPool(addr, wrappers.MustNewWrappedContractBackend(e.evmClient, nil)) + + if err != nil { + return nil, err + } + e.logger.Info(). + Str("Contract Address", addr.Hex()). + Str("Contract Name", "Native Token Pool"). + Str("From", e.evmClient.GetDefaultWallet().Address()). + Str("Network Name", e.evmClient.GetNetworkConfig().Name). + Msg("New contract") + poolInstance, err := token_pool.NewTokenPool(addr, wrappers.MustNewWrappedContractBackend(e.evmClient, nil)) + if err != nil { + return nil, err + } + return &TokenPool{ + client: e.evmClient, + logger: e.logger, + Instance: &TokenPoolWrapper{ + Latest: &LatestPool{ + PoolInterface: poolInstance, + LockReleasePool: pool, + }, + }, + EthAddress: addr, + OwnerAddress: common.HexToAddress(e.evmClient.GetDefaultWallet().Address()), + OwnerWallet: e.evmClient.GetDefaultWallet(), + }, err + case V1_4_0: + pool, err := lock_release_token_pool_1_4_0.NewLockReleaseTokenPool(addr, wrappers.MustNewWrappedContractBackend(e.evmClient, nil)) + if err != nil { + return nil, err + } + e.logger.Info(). + Str("Contract Address", addr.Hex()). + Str("Contract Name", "Native Token Pool"). + Str("From", e.evmClient.GetDefaultWallet().Address()). + Str("Network Name", e.evmClient.GetNetworkConfig().Name). + Msg("New contract") + poolInstance, err := token_pool_1_4_0.NewTokenPool(addr, wrappers.MustNewWrappedContractBackend(e.evmClient, nil)) + if err != nil { + return nil, err + } + return &TokenPool{ + client: e.evmClient, + logger: e.logger, + Instance: &TokenPoolWrapper{ + V1_4_0: &V1_4_0Pool{ + PoolInterface: poolInstance, + LockReleasePool: pool, + }, + }, + EthAddress: addr, + OwnerAddress: common.HexToAddress(e.evmClient.GetDefaultWallet().Address()), + OwnerWallet: e.evmClient.GetDefaultWallet(), + }, err + default: + return nil, fmt.Errorf("version not supported: %s", version) + } +} + +func (e *CCIPContractsDeployer) NewUSDCTokenPoolContract(addr common.Address) ( + *TokenPool, + error, +) { + version := VersionMap[TokenPoolContract] + e.logger.Info().Str("Version", version.String()).Msg("New USDC Token Pool") + switch version { + case Latest: + pool, err := usdc_token_pool.NewUSDCTokenPool(addr, wrappers.MustNewWrappedContractBackend(e.evmClient, nil)) + + if err != nil { + return nil, err + } + e.logger.Info(). + Str("Contract Address", addr.Hex()). + Str("Contract Name", "USDC Token Pool"). + Str("From", e.evmClient.GetDefaultWallet().Address()). + Str("Network Name", e.evmClient.GetNetworkConfig().Name). + Msg("New contract") + poolInterface, err := token_pool.NewTokenPool(addr, wrappers.MustNewWrappedContractBackend(e.evmClient, nil)) + if err != nil { + return nil, err + } + return &TokenPool{ + client: e.evmClient, + logger: e.logger, + Instance: &TokenPoolWrapper{ + Latest: &LatestPool{ + PoolInterface: poolInterface, + USDCPool: pool, + }, + }, + EthAddress: addr, + OwnerAddress: common.HexToAddress(e.evmClient.GetDefaultWallet().Address()), + OwnerWallet: e.evmClient.GetDefaultWallet(), + }, err + case V1_4_0: + pool, err := usdc_token_pool_1_4_0.NewUSDCTokenPool(addr, wrappers.MustNewWrappedContractBackend(e.evmClient, nil)) + + if err != nil { + return nil, err + } + e.logger.Info(). + Str("Contract Address", addr.Hex()). + Str("Contract Name", "USDC Token Pool"). + Str("From", e.evmClient.GetDefaultWallet().Address()). + Str("Network Name", e.evmClient.GetNetworkConfig().Name). + Msg("New contract") + poolInterface, err := token_pool_1_4_0.NewTokenPool(addr, wrappers.MustNewWrappedContractBackend(e.evmClient, nil)) + if err != nil { + return nil, err + } + return &TokenPool{ + client: e.evmClient, + logger: e.logger, + Instance: &TokenPoolWrapper{ + V1_4_0: &V1_4_0Pool{ + PoolInterface: poolInterface, + USDCPool: pool, + }, + }, + EthAddress: addr, + OwnerAddress: common.HexToAddress(e.evmClient.GetDefaultWallet().Address()), + OwnerWallet: e.evmClient.GetDefaultWallet(), + }, err + default: + return nil, fmt.Errorf("version not supported: %s", version) + } + +} + +func (e *CCIPContractsDeployer) DeployUSDCTokenPoolContract(tokenAddr string, tokenMessenger, rmnProxy common.Address, router common.Address) ( + *TokenPool, + error, +) { + version := VersionMap[TokenPoolContract] + e.logger.Debug().Str("Token", tokenAddr).Msg("Deploying USDC token pool") + token := common.HexToAddress(tokenAddr) + switch version { + case Latest: + address, _, _, err := e.evmClient.DeployContract("USDC Token Pool", func( + auth *bind.TransactOpts, + _ bind.ContractBackend, + ) (common.Address, *types.Transaction, interface{}, error) { + return usdc_token_pool.DeployUSDCTokenPool( + auth, + wrappers.MustNewWrappedContractBackend(e.evmClient, nil), + tokenMessenger, + token, + []common.Address{}, + rmnProxy, + router, + ) + }) + + if err != nil { + return nil, err + } + return e.NewUSDCTokenPoolContract(*address) + case V1_4_0: + address, _, _, err := e.evmClient.DeployContract("USDC Token Pool", func( + auth *bind.TransactOpts, + _ bind.ContractBackend, + ) (common.Address, *types.Transaction, interface{}, error) { + return usdc_token_pool_1_4_0.DeployUSDCTokenPool( + auth, + wrappers.MustNewWrappedContractBackend(e.evmClient, nil), + tokenMessenger, + token, + []common.Address{}, + rmnProxy, + router, + ) + }) + + if err != nil { + return nil, err + } + return e.NewUSDCTokenPoolContract(*address) + default: + return nil, fmt.Errorf("version not supported: %s", version) + } +} + +func (e *CCIPContractsDeployer) DeployLockReleaseTokenPoolContract(tokenAddr string, rmnProxy common.Address, router common.Address) ( + *TokenPool, + error, +) { + version := VersionMap[TokenPoolContract] + e.logger.Info().Str("Version", version.String()).Msg("Deploying LockRelease Token Pool") + token := common.HexToAddress(tokenAddr) + switch version { + case Latest: + address, _, _, err := e.evmClient.DeployContract("LockRelease Token Pool", func( + auth *bind.TransactOpts, + _ bind.ContractBackend, + ) (common.Address, *types.Transaction, interface{}, error) { + return lock_release_token_pool.DeployLockReleaseTokenPool( + auth, + wrappers.MustNewWrappedContractBackend(e.evmClient, nil), + token, + []common.Address{}, + rmnProxy, + true, + router, + ) + }) + + if err != nil { + return nil, err + } + return e.NewLockReleaseTokenPoolContract(*address) + case V1_4_0: + address, _, _, err := e.evmClient.DeployContract("LockRelease Token Pool", func( + auth *bind.TransactOpts, + _ bind.ContractBackend, + ) (common.Address, *types.Transaction, interface{}, error) { + return lock_release_token_pool_1_4_0.DeployLockReleaseTokenPool( + auth, + wrappers.MustNewWrappedContractBackend(e.evmClient, nil), + token, + []common.Address{}, + rmnProxy, + true, + router, + ) + }) + + if err != nil { + return nil, err + } + return e.NewLockReleaseTokenPoolContract(*address) + default: + return nil, fmt.Errorf("version not supported: %s", version) + } +} + +func (e *CCIPContractsDeployer) DeployMockRMNContract() (*common.Address, error) { + address, _, _, err := e.evmClient.DeployContract("Mock ARM Contract", func( + auth *bind.TransactOpts, + _ bind.ContractBackend, + ) (common.Address, *types.Transaction, interface{}, error) { + return mock_rmn_contract.DeployMockRMNContract(auth, wrappers.MustNewWrappedContractBackend(e.evmClient, nil)) + }) + return address, err +} + +func (e *CCIPContractsDeployer) NewRMNContract(addr common.Address) (*ARM, error) { + arm, err := rmn_contract.NewRMNContract(addr, wrappers.MustNewWrappedContractBackend(e.evmClient, nil)) + if err != nil { + return nil, err + } + e.logger.Info(). + Str("Contract Address", addr.Hex()). + Str("Contract Name", "Mock ARM Contract"). + Str("From", e.evmClient.GetDefaultWallet().Address()). + Str("Network Name", e.evmClient.GetNetworkConfig().Name). + Msg("New contract") + + return &ARM{ + client: e.evmClient, + Instance: arm, + EthAddress: addr, + }, err +} + +func (e *CCIPContractsDeployer) NewCommitStore(addr common.Address) ( + *CommitStore, + error, +) { + version := VersionMap[CommitStoreContract] + e.logger.Info().Str("Version", version.String()).Msg("New CommitStore") + switch version { + case Latest: + ins, err := commit_store.NewCommitStore(addr, wrappers.MustNewWrappedContractBackend(e.evmClient, nil)) + e.logger.Info(). + Str("Contract Address", addr.Hex()). + Str("Contract Name", "CommitStore"). + Str("From", e.evmClient.GetDefaultWallet().Address()). + Str("Network Name", e.evmClient.GetNetworkConfig().Name). + Msg("New contract") + return &CommitStore{ + client: e.evmClient, + logger: e.logger, + Instance: &CommitStoreWrapper{ + Latest: ins, + }, + EthAddress: addr, + }, err + case V1_2_0: + ins, err := commit_store_1_2_0.NewCommitStore(addr, wrappers.MustNewWrappedContractBackend(e.evmClient, nil)) + e.logger.Info(). + Str("Contract Address", addr.Hex()). + Str("Contract Name", "CommitStore"). + Str("From", e.evmClient.GetDefaultWallet().Address()). + Str("Network Name", e.evmClient.GetNetworkConfig().Name). + Msg("New contract") + return &CommitStore{ + client: e.evmClient, + logger: e.logger, + Instance: &CommitStoreWrapper{ + V1_2_0: ins, + }, + EthAddress: addr, + }, err + default: + return nil, fmt.Errorf("version not supported: %s", version) + } +} + +func (e *CCIPContractsDeployer) DeployCommitStore(sourceChainSelector, destChainSelector uint64, onRamp common.Address, armProxy common.Address) (*CommitStore, error) { + version, ok := VersionMap[CommitStoreContract] + if !ok { + return nil, fmt.Errorf("versioning not supported: %s", version) + } + e.logger.Info().Str("Version", version.String()).Msg("Deploying CommitStore") + switch version { + case Latest: + address, _, instance, err := e.evmClient.DeployContract("CommitStore Contract", func( + auth *bind.TransactOpts, + _ bind.ContractBackend, + ) (common.Address, *types.Transaction, interface{}, error) { + return commit_store.DeployCommitStore( + auth, + wrappers.MustNewWrappedContractBackend(e.evmClient, nil), + commit_store.CommitStoreStaticConfig{ + ChainSelector: destChainSelector, + SourceChainSelector: sourceChainSelector, + OnRamp: onRamp, + RmnProxy: armProxy, + }, + ) + }) + if err != nil { + return nil, err + } + return &CommitStore{ + client: e.evmClient, + logger: e.logger, + Instance: &CommitStoreWrapper{ + Latest: instance.(*commit_store.CommitStore), + }, + EthAddress: *address, + }, err + case V1_2_0: + address, _, instance, err := e.evmClient.DeployContract("CommitStore Contract", func( + auth *bind.TransactOpts, + _ bind.ContractBackend, + ) (common.Address, *types.Transaction, interface{}, error) { + return commit_store_1_2_0.DeployCommitStore( + auth, + wrappers.MustNewWrappedContractBackend(e.evmClient, nil), + commit_store_1_2_0.CommitStoreStaticConfig{ + ChainSelector: destChainSelector, + SourceChainSelector: sourceChainSelector, + OnRamp: onRamp, + ArmProxy: armProxy, + }, + ) + }) + if err != nil { + return nil, err + } + return &CommitStore{ + client: e.evmClient, + logger: e.logger, + Instance: &CommitStoreWrapper{ + V1_2_0: instance.(*commit_store_1_2_0.CommitStore), + }, + EthAddress: *address, + }, err + default: + return nil, fmt.Errorf("version not supported: %s", version) + } +} + +func (e *CCIPContractsDeployer) DeployReceiverDapp(revert bool) ( + *ReceiverDapp, + error, +) { + address, _, instance, err := e.evmClient.DeployContract("ReceiverDapp", func( + auth *bind.TransactOpts, + _ bind.ContractBackend, + ) (common.Address, *types.Transaction, interface{}, error) { + return maybe_revert_message_receiver.DeployMaybeRevertMessageReceiver(auth, wrappers.MustNewWrappedContractBackend(e.evmClient, nil), revert) + }) + if err != nil { + return nil, err + } + return &ReceiverDapp{ + client: e.evmClient, + logger: e.logger, + instance: instance.(*maybe_revert_message_receiver.MaybeRevertMessageReceiver), + EthAddress: *address, + }, err +} + +func (e *CCIPContractsDeployer) NewReceiverDapp(addr common.Address) ( + *ReceiverDapp, + error, +) { + ins, err := maybe_revert_message_receiver.NewMaybeRevertMessageReceiver(addr, wrappers.MustNewWrappedContractBackend(e.evmClient, nil)) + e.logger.Info(). + Str("Contract Address", addr.Hex()). + Str("Contract Name", "ReceiverDapp"). + Str("From", e.evmClient.GetDefaultWallet().Address()). + Str("Network Name", e.evmClient.GetNetworkConfig().Name). + Msg("New contract") + return &ReceiverDapp{ + client: e.evmClient, + logger: e.logger, + instance: ins, + EthAddress: addr, + }, err +} + +func (e *CCIPContractsDeployer) DeployRouter(wrappedNative common.Address, armAddress common.Address) ( + *Router, + error, +) { + address, _, instance, err := e.evmClient.DeployContract("Router", func( + auth *bind.TransactOpts, + _ bind.ContractBackend, + ) (common.Address, *types.Transaction, interface{}, error) { + return router.DeployRouter(auth, wrappers.MustNewWrappedContractBackend(e.evmClient, nil), wrappedNative, armAddress) + }) + if err != nil { + return nil, err + } + return &Router{ + client: e.evmClient, + logger: e.logger, + Instance: instance.(*router.Router), + EthAddress: *address, + }, err +} + +func (e *CCIPContractsDeployer) NewRouter(addr common.Address) ( + *Router, + error, +) { + r, err := router.NewRouter(addr, wrappers.MustNewWrappedContractBackend(e.evmClient, nil)) + e.logger.Info(). + Str("Contract Address", addr.Hex()). + Str("Contract Name", "Router"). + Str("From", e.evmClient.GetDefaultWallet().Address()). + Str("Network Name", e.evmClient.GetNetworkConfig().Name). + Msg("New contract") + if err != nil { + return nil, err + } + return &Router{ + client: e.evmClient, + logger: e.logger, + Instance: r, + EthAddress: addr, + }, err +} + +func (e *CCIPContractsDeployer) NewPriceRegistry(addr common.Address) ( + *PriceRegistry, + error, +) { + var wrapper *PriceRegistryWrapper + version := VersionMap[PriceRegistryContract] + e.logger.Info().Str("Version", version.String()).Msg("New PriceRegistry") + switch version { + case Latest: + ins, err := price_registry_1_2_0.NewPriceRegistry(addr, wrappers.MustNewWrappedContractBackend(e.evmClient, nil)) + if err != nil { + return nil, fmt.Errorf("error in creating price registry instance: %w", err) + } + wrapper = &PriceRegistryWrapper{ + V1_2_0: ins, + } + case V1_2_0: + ins, err := price_registry_1_2_0.NewPriceRegistry(addr, wrappers.MustNewWrappedContractBackend(e.evmClient, nil)) + if err != nil { + return nil, fmt.Errorf("error in creating price registry instance: %w", err) + } + wrapper = &PriceRegistryWrapper{ + V1_2_0: ins, + } + default: + return nil, fmt.Errorf("version not supported: %s", version) + } + e.logger.Info(). + Str("Contract Address", addr.Hex()). + Str("Contract Name", "PriceRegistry"). + Str("From", e.evmClient.GetDefaultWallet().Address()). + Str("Network Name", e.evmClient.GetNetworkConfig().Name). + Msg("New contract") + return &PriceRegistry{ + client: e.evmClient, + logger: e.logger, + Instance: wrapper, + EthAddress: addr, + }, nil +} + +func (e *CCIPContractsDeployer) DeployPriceRegistry(tokens []common.Address) (*PriceRegistry, error) { + var address *common.Address + var wrapper *PriceRegistryWrapper + var err error + var instance interface{} + version := VersionMap[PriceRegistryContract] + e.logger.Info().Str("Version", version.String()).Msg("Deploying PriceRegistry") + switch version { + case Latest: + address, _, instance, err = e.evmClient.DeployContract("PriceRegistry", func( + auth *bind.TransactOpts, + _ bind.ContractBackend, + ) (common.Address, *types.Transaction, interface{}, error) { + return price_registry_1_2_0.DeployPriceRegistry(auth, wrappers.MustNewWrappedContractBackend(e.evmClient, nil), nil, tokens, 60*60*24*14) + }) + if err != nil { + return nil, err + } + wrapper = &PriceRegistryWrapper{ + V1_2_0: instance.(*price_registry_1_2_0.PriceRegistry), + } + case V1_2_0: + address, _, instance, err = e.evmClient.DeployContract("PriceRegistry", func( + auth *bind.TransactOpts, + _ bind.ContractBackend, + ) (common.Address, *types.Transaction, interface{}, error) { + return price_registry_1_2_0.DeployPriceRegistry(auth, wrappers.MustNewWrappedContractBackend(e.evmClient, nil), nil, tokens, 60*60*24*14) + }) + if err != nil { + return nil, err + } + wrapper = &PriceRegistryWrapper{ + V1_2_0: instance.(*price_registry_1_2_0.PriceRegistry), + } + default: + return nil, fmt.Errorf("version not supported: %s", version) + } + reg := &PriceRegistry{ + client: e.evmClient, + logger: e.logger, + EthAddress: *address, + Instance: wrapper, + } + return reg, err +} + +func (e *CCIPContractsDeployer) DeployTokenAdminRegistry() (*TokenAdminRegistry, error) { + address, _, instance, err := e.evmClient.DeployContract("TokenAdminRegistry", func( + auth *bind.TransactOpts, + _ bind.ContractBackend, + ) (common.Address, *types.Transaction, interface{}, error) { + return token_admin_registry.DeployTokenAdminRegistry(auth, wrappers.MustNewWrappedContractBackend(e.evmClient, nil)) + }) + if err != nil { + return nil, err + } + return &TokenAdminRegistry{ + client: e.evmClient, + logger: e.logger, + Instance: instance.(*token_admin_registry.TokenAdminRegistry), + EthAddress: *address, + }, err +} + +func (e *CCIPContractsDeployer) NewTokenAdminRegistry(addr common.Address) ( + *TokenAdminRegistry, + error, +) { + ins, err := token_admin_registry.NewTokenAdminRegistry(addr, wrappers.MustNewWrappedContractBackend(e.evmClient, nil)) + e.logger.Info(). + Str("Contract Address", addr.Hex()). + Str("Contract Name", "TokenAdminRegistry"). + Str("From", e.evmClient.GetDefaultWallet().Address()). + Str("Network Name", e.evmClient.GetNetworkConfig().Name). + Msg("New contract") + return &TokenAdminRegistry{ + client: e.evmClient, + logger: e.logger, + Instance: ins, + EthAddress: addr, + }, err +} + +func (e *CCIPContractsDeployer) NewOnRamp(addr common.Address) ( + *OnRamp, + error, +) { + version := VersionMap[OnRampContract] + e.logger.Info().Str("Version", version.String()).Msg("New OnRamp") + e.logger.Info(). + Str("Contract Address", addr.Hex()). + Str("Contract Name", "OnRamp"). + Str("From", e.evmClient.GetDefaultWallet().Address()). + Str("Network Name", e.evmClient.GetNetworkConfig().Name). + Msg("New contract") + switch version { + case V1_2_0: + ins, err := evm_2_evm_onramp_1_2_0.NewEVM2EVMOnRamp(addr, wrappers.MustNewWrappedContractBackend(e.evmClient, nil)) + if err != nil { + return nil, err + } + return &OnRamp{ + client: e.evmClient, + logger: e.logger, + Instance: &OnRampWrapper{V1_2_0: ins}, + EthAddress: addr, + }, err + case Latest: + ins, err := evm_2_evm_onramp.NewEVM2EVMOnRamp(addr, wrappers.MustNewWrappedContractBackend(e.evmClient, nil)) + if err != nil { + return nil, err + } + return &OnRamp{ + client: e.evmClient, + logger: e.logger, + Instance: &OnRampWrapper{Latest: ins}, + EthAddress: addr, + }, nil + default: + return nil, fmt.Errorf("version not supported: %s", version) + } +} + +func (e *CCIPContractsDeployer) DeployOnRamp( + sourceChainSelector, destChainSelector uint64, + tokensAndPools []evm_2_evm_onramp_1_2_0.InternalPoolUpdate, + rmn, + router, + priceRegistry, + tokenAdminRegistry common.Address, + opts RateLimiterConfig, + feeTokenConfig []evm_2_evm_onramp.EVM2EVMOnRampFeeTokenConfigArgs, + tokenTransferFeeConfig []evm_2_evm_onramp.EVM2EVMOnRampTokenTransferFeeConfigArgs, + linkTokenAddress common.Address, +) (*OnRamp, error) { + version := VersionMap[OnRampContract] + e.logger.Info().Str("Version", version.String()).Msg("Deploying OnRamp") + switch version { + case V1_2_0: + feeTokenConfigV1_2_0 := make([]evm_2_evm_onramp_1_2_0.EVM2EVMOnRampFeeTokenConfigArgs, len(feeTokenConfig)) + for i, f := range feeTokenConfig { + feeTokenConfigV1_2_0[i] = evm_2_evm_onramp_1_2_0.EVM2EVMOnRampFeeTokenConfigArgs{ + Token: f.Token, + NetworkFeeUSDCents: f.NetworkFeeUSDCents, + GasMultiplierWeiPerEth: f.GasMultiplierWeiPerEth, + PremiumMultiplierWeiPerEth: f.PremiumMultiplierWeiPerEth, + Enabled: f.Enabled, + } + } + tokenTransferFeeConfigV1_2_0 := make([]evm_2_evm_onramp_1_2_0.EVM2EVMOnRampTokenTransferFeeConfigArgs, len(tokenTransferFeeConfig)) + for i, f := range tokenTransferFeeConfig { + tokenTransferFeeConfigV1_2_0[i] = evm_2_evm_onramp_1_2_0.EVM2EVMOnRampTokenTransferFeeConfigArgs{ + Token: f.Token, + MinFeeUSDCents: f.MinFeeUSDCents, + MaxFeeUSDCents: f.MaxFeeUSDCents, + DeciBps: f.DeciBps, + DestGasOverhead: f.DestGasOverhead, + DestBytesOverhead: f.DestBytesOverhead, + } + } + address, _, instance, err := e.evmClient.DeployContract("OnRamp", func( + auth *bind.TransactOpts, + _ bind.ContractBackend, + ) (common.Address, *types.Transaction, interface{}, error) { + return evm_2_evm_onramp_1_2_0.DeployEVM2EVMOnRamp( + auth, + wrappers.MustNewWrappedContractBackend(e.evmClient, nil), + evm_2_evm_onramp_1_2_0.EVM2EVMOnRampStaticConfig{ + LinkToken: linkTokenAddress, + ChainSelector: sourceChainSelector, // source chain id + DestChainSelector: destChainSelector, // destinationChainSelector + DefaultTxGasLimit: 200_000, + MaxNopFeesJuels: big.NewInt(0).Mul(big.NewInt(100_000_000), big.NewInt(1e18)), + PrevOnRamp: common.HexToAddress(""), + ArmProxy: rmn, + }, + evm_2_evm_onramp_1_2_0.EVM2EVMOnRampDynamicConfig{ + Router: router, + MaxNumberOfTokensPerMsg: 50, + DestGasOverhead: 350_000, + DestGasPerPayloadByte: 16, + DestDataAvailabilityOverheadGas: 33_596, + DestGasPerDataAvailabilityByte: 16, + DestDataAvailabilityMultiplierBps: 6840, // 0.684 + PriceRegistry: priceRegistry, + MaxDataBytes: 50000, + MaxPerMsgGasLimit: 4_000_000, + }, + tokensAndPools, + evm_2_evm_onramp_1_2_0.RateLimiterConfig{ + Capacity: opts.Capacity, + Rate: opts.Rate, + }, + feeTokenConfigV1_2_0, + tokenTransferFeeConfigV1_2_0, + []evm_2_evm_onramp_1_2_0.EVM2EVMOnRampNopAndWeight{}, + ) + }) + if err != nil { + return nil, err + } + return &OnRamp{ + client: e.evmClient, + logger: e.logger, + Instance: &OnRampWrapper{ + V1_2_0: instance.(*evm_2_evm_onramp_1_2_0.EVM2EVMOnRamp), + }, + EthAddress: *address, + }, nil + case Latest: + address, _, instance, err := e.evmClient.DeployContract("OnRamp", func( + auth *bind.TransactOpts, + _ bind.ContractBackend, + ) (common.Address, *types.Transaction, interface{}, error) { + return evm_2_evm_onramp.DeployEVM2EVMOnRamp( + auth, + wrappers.MustNewWrappedContractBackend(e.evmClient, nil), + evm_2_evm_onramp.EVM2EVMOnRampStaticConfig{ + LinkToken: linkTokenAddress, + ChainSelector: sourceChainSelector, // source chain id + DestChainSelector: destChainSelector, // destinationChainSelector + DefaultTxGasLimit: 200_000, + MaxNopFeesJuels: big.NewInt(0).Mul(big.NewInt(100_000_000), big.NewInt(1e18)), + PrevOnRamp: common.HexToAddress(""), + RmnProxy: rmn, + TokenAdminRegistry: tokenAdminRegistry, + }, + evm_2_evm_onramp.EVM2EVMOnRampDynamicConfig{ + Router: router, + MaxNumberOfTokensPerMsg: 50, + DestGasOverhead: 350_000, + DestGasPerPayloadByte: 16, + DestDataAvailabilityOverheadGas: 33_596, + DestGasPerDataAvailabilityByte: 16, + DestDataAvailabilityMultiplierBps: 6840, // 0.684 + PriceRegistry: priceRegistry, + MaxDataBytes: 50000, + MaxPerMsgGasLimit: 4_000_000, + DefaultTokenFeeUSDCents: 50, + DefaultTokenDestGasOverhead: 125_000, + EnforceOutOfOrder: false, + }, + evm_2_evm_onramp.RateLimiterConfig{ + Capacity: opts.Capacity, + Rate: opts.Rate, + }, + feeTokenConfig, + tokenTransferFeeConfig, + []evm_2_evm_onramp.EVM2EVMOnRampNopAndWeight{}, + ) + }) + if err != nil { + return nil, err + } + return &OnRamp{ + client: e.evmClient, + logger: e.logger, + Instance: &OnRampWrapper{ + Latest: instance.(*evm_2_evm_onramp.EVM2EVMOnRamp), + }, + EthAddress: *address, + }, err + default: + return nil, fmt.Errorf("version not supported: %s", version) + } +} + +func (e *CCIPContractsDeployer) NewOffRamp(addr common.Address) ( + *OffRamp, + error, +) { + version := VersionMap[OffRampContract] + e.logger.Info().Str("Version", version.String()).Msg("New OffRamp") + switch version { + case V1_2_0: + ins, err := evm_2_evm_offramp_1_2_0.NewEVM2EVMOffRamp(addr, wrappers.MustNewWrappedContractBackend(e.evmClient, nil)) + if err != nil { + return nil, err + } + e.logger.Info(). + Str("Contract Address", addr.Hex()). + Str("Contract Name", "OffRamp"). + Str("From", e.evmClient.GetDefaultWallet().Address()). + Str("Network Name", e.evmClient.GetNetworkConfig().Name). + Msg("New contract") + return &OffRamp{ + client: e.evmClient, + logger: e.logger, + Instance: &OffRampWrapper{V1_2_0: ins}, + EthAddress: addr, + }, err + case Latest: + ins, err := evm_2_evm_offramp.NewEVM2EVMOffRamp(addr, wrappers.MustNewWrappedContractBackend(e.evmClient, nil)) + if err != nil { + return nil, err + } + e.logger.Info(). + Str("Contract Address", addr.Hex()). + Str("Contract Name", "OffRamp"). + Str("From", e.evmClient.GetDefaultWallet().Address()). + Str("Network Name", e.evmClient.GetNetworkConfig().Name). + Msg("New contract") + return &OffRamp{ + client: e.evmClient, + logger: e.logger, + Instance: &OffRampWrapper{Latest: ins}, + EthAddress: addr, + }, err + default: + return nil, fmt.Errorf("version not supported: %s", version) + } +} + +func (e *CCIPContractsDeployer) DeployOffRamp( + sourceChainSelector, destChainSelector uint64, + commitStore, onRamp common.Address, + opts RateLimiterConfig, + sourceTokens, pools []common.Address, + rmnProxy common.Address, + tokenAdminRegistry common.Address, +) (*OffRamp, error) { + version := VersionMap[OffRampContract] + e.logger.Info().Str("Version", version.String()).Msg("Deploying OffRamp") + switch version { + case V1_2_0: + address, _, instance, err := e.evmClient.DeployContract("OffRamp Contract", func( + auth *bind.TransactOpts, + _ bind.ContractBackend, + ) (common.Address, *types.Transaction, interface{}, error) { + return evm_2_evm_offramp_1_2_0.DeployEVM2EVMOffRamp( + auth, + wrappers.MustNewWrappedContractBackend(e.evmClient, nil), + evm_2_evm_offramp_1_2_0.EVM2EVMOffRampStaticConfig{ + CommitStore: commitStore, + ChainSelector: destChainSelector, + SourceChainSelector: sourceChainSelector, + OnRamp: onRamp, + PrevOffRamp: common.Address{}, + ArmProxy: rmnProxy, + }, + sourceTokens, + pools, + evm_2_evm_offramp_1_2_0.RateLimiterConfig{ + IsEnabled: true, + Capacity: opts.Capacity, + Rate: opts.Rate, + }, + ) + }) + if err != nil { + return nil, err + } + return &OffRamp{ + client: e.evmClient, + logger: e.logger, + Instance: &OffRampWrapper{ + V1_2_0: instance.(*evm_2_evm_offramp_1_2_0.EVM2EVMOffRamp), + }, + EthAddress: *address, + }, err + case Latest: + staticConfig := evm_2_evm_offramp.EVM2EVMOffRampStaticConfig{ + CommitStore: commitStore, + ChainSelector: destChainSelector, + SourceChainSelector: sourceChainSelector, + OnRamp: onRamp, + PrevOffRamp: common.Address{}, + RmnProxy: rmnProxy, + TokenAdminRegistry: tokenAdminRegistry, + } + address, _, instance, err := e.evmClient.DeployContract("OffRamp Contract", func( + auth *bind.TransactOpts, + _ bind.ContractBackend, + ) (common.Address, *types.Transaction, interface{}, error) { + return evm_2_evm_offramp.DeployEVM2EVMOffRamp( + auth, + wrappers.MustNewWrappedContractBackend(e.evmClient, nil), + staticConfig, + evm_2_evm_offramp.RateLimiterConfig{ + IsEnabled: true, + Capacity: opts.Capacity, + Rate: opts.Rate, + }, + ) + }) + e.logger.Info().Msg(fmt.Sprintf("deploying offramp with static config: %+v", staticConfig)) + + if err != nil { + return nil, err + } + return &OffRamp{ + client: e.evmClient, + logger: e.logger, + Instance: &OffRampWrapper{ + Latest: instance.(*evm_2_evm_offramp.EVM2EVMOffRamp), + }, + EthAddress: *address, + }, err + default: + return nil, fmt.Errorf("version not supported: %s", version) + } +} + +func (e *CCIPContractsDeployer) DeployWrappedNative() (*common.Address, error) { + address, _, _, err := e.evmClient.DeployContract("WrappedNative", func( + auth *bind.TransactOpts, + _ bind.ContractBackend, + ) (common.Address, *types.Transaction, interface{}, error) { + return weth9.DeployWETH9(auth, wrappers.MustNewWrappedContractBackend(e.evmClient, nil)) + }) + if err != nil { + return nil, err + } + return address, err +} + +func (e *CCIPContractsDeployer) DeployMockAggregator(decimals uint8, initialAns *big.Int) (*MockAggregator, error) { + address, _, instance, err := e.evmClient.DeployContract("MockAggregator", func( + auth *bind.TransactOpts, + _ bind.ContractBackend, + ) (common.Address, *types.Transaction, interface{}, error) { + return mock_v3_aggregator_contract.DeployMockV3Aggregator(auth, wrappers.MustNewWrappedContractBackend(e.evmClient, nil), decimals, initialAns) + }) + if err != nil { + return nil, fmt.Errorf("deploying mock aggregator: %w", err) + } + e.logger.Info(). + Str("Contract Address", address.Hex()). + Str("Contract Name", "MockAggregator"). + Str("From", e.evmClient.GetDefaultWallet().Address()). + Str("Network Name", e.evmClient.GetNetworkConfig().Name). + Msg("New contract") + return &MockAggregator{ + client: e.evmClient, + logger: e.logger, + Instance: instance.(*mock_v3_aggregator_contract.MockV3Aggregator), + ContractAddress: *address, + }, nil +} + +func (e *CCIPContractsDeployer) NewMockAggregator(addr common.Address) (*MockAggregator, error) { + ins, err := mock_v3_aggregator_contract.NewMockV3Aggregator(addr, wrappers.MustNewWrappedContractBackend(e.evmClient, nil)) + if err != nil { + return nil, fmt.Errorf("creating mock aggregator: %w", err) + } + return &MockAggregator{ + client: e.evmClient, + logger: e.logger, + Instance: ins, + ContractAddress: addr, + }, nil +} + +func (e *CCIPContractsDeployer) TypeAndVersion(addr common.Address) (string, error) { + tv, err := type_and_version.NewTypeAndVersionInterface(addr, wrappers.MustNewWrappedContractBackend(e.evmClient, nil)) + if err != nil { + return "", err + } + tvStr, err := tv.TypeAndVersion(nil) + if err != nil { + return "", fmt.Errorf("error calling typeAndVersion on addr: %s %w", addr.Hex(), err) + } + e.logger.Info(). + Str("TypeAndVersion", tvStr). + Str("Contract Address", addr.Hex()). + Msg("TypeAndVersion") + + _, versionStr, err := ccipconfig.ParseTypeAndVersion(tvStr) + if err != nil { + return versionStr, err + } + v, err := semver.NewVersion(versionStr) + if err != nil { + return "", fmt.Errorf("failed parsing version %s: %w", versionStr, err) + } + return v.String(), nil +} + +// OCR2ParamsForCommit and OCR2ParamsForExec - +// These functions return the default OCR2 parameters for Commit and Exec respectively. +// Refer to CommitOCRParams and ExecOCRParams in CCIPTestConfig located in testconfig/ccip.go to override these values with custom param values. +func OCR2ParamsForCommit(blockTime time.Duration) contracts.OffChainAggregatorV2Config { + // slow blocktime chains like Ethereum + if blockTime >= 10*time.Second { + return contracts.OffChainAggregatorV2Config{ + DeltaProgress: config.MustNewDuration(2 * time.Minute), + DeltaResend: config.MustNewDuration(5 * time.Second), + DeltaRound: config.MustNewDuration(90 * time.Second), + DeltaGrace: config.MustNewDuration(5 * time.Second), + DeltaStage: config.MustNewDuration(60 * time.Second), + MaxDurationQuery: config.MustNewDuration(100 * time.Millisecond), + MaxDurationObservation: config.MustNewDuration(35 * time.Second), + MaxDurationReport: config.MustNewDuration(10 * time.Second), + MaxDurationShouldAcceptFinalizedReport: config.MustNewDuration(5 * time.Second), + MaxDurationShouldTransmitAcceptedReport: config.MustNewDuration(10 * time.Second), + } + } + // fast blocktime chains like Avalanche + return contracts.OffChainAggregatorV2Config{ + DeltaProgress: config.MustNewDuration(2 * time.Minute), + DeltaResend: config.MustNewDuration(5 * time.Second), + DeltaRound: config.MustNewDuration(60 * time.Second), + DeltaGrace: config.MustNewDuration(5 * time.Second), + DeltaStage: config.MustNewDuration(25 * time.Second), + MaxDurationQuery: config.MustNewDuration(100 * time.Millisecond), + MaxDurationObservation: config.MustNewDuration(35 * time.Second), + MaxDurationReport: config.MustNewDuration(10 * time.Second), + MaxDurationShouldAcceptFinalizedReport: config.MustNewDuration(5 * time.Second), + MaxDurationShouldTransmitAcceptedReport: config.MustNewDuration(10 * time.Second), + } +} + +func OCR2ParamsForExec(blockTime time.Duration) contracts.OffChainAggregatorV2Config { + // slow blocktime chains like Ethereum + if blockTime >= 10*time.Second { + return contracts.OffChainAggregatorV2Config{ + DeltaProgress: config.MustNewDuration(2 * time.Minute), + DeltaResend: config.MustNewDuration(5 * time.Second), + DeltaRound: config.MustNewDuration(90 * time.Second), + DeltaGrace: config.MustNewDuration(5 * time.Second), + DeltaStage: config.MustNewDuration(60 * time.Second), + MaxDurationQuery: config.MustNewDuration(100 * time.Millisecond), + MaxDurationObservation: config.MustNewDuration(35 * time.Second), + MaxDurationReport: config.MustNewDuration(10 * time.Second), + MaxDurationShouldAcceptFinalizedReport: config.MustNewDuration(5 * time.Second), + MaxDurationShouldTransmitAcceptedReport: config.MustNewDuration(10 * time.Second), + } + } + // fast blocktime chains like Avalanche + return contracts.OffChainAggregatorV2Config{ + DeltaProgress: config.MustNewDuration(120 * time.Second), + DeltaResend: config.MustNewDuration(5 * time.Second), + DeltaRound: config.MustNewDuration(30 * time.Second), + DeltaGrace: config.MustNewDuration(5 * time.Second), + DeltaStage: config.MustNewDuration(10 * time.Second), + MaxDurationQuery: config.MustNewDuration(100 * time.Millisecond), + MaxDurationObservation: config.MustNewDuration(35 * time.Second), + MaxDurationReport: config.MustNewDuration(10 * time.Second), + MaxDurationShouldAcceptFinalizedReport: config.MustNewDuration(5 * time.Second), + MaxDurationShouldTransmitAcceptedReport: config.MustNewDuration(10 * time.Second), + } +} + +func OffChainAggregatorV2ConfigWithNodes(numberNodes int, inflightExpiry time.Duration, cfg contracts.OffChainAggregatorV2Config) contracts.OffChainAggregatorV2Config { + if numberNodes <= 4 { + log.Err(fmt.Errorf("insufficient number of nodes (%d) supplied for OCR, need at least 5", numberNodes)). + Int("Number Chainlink Nodes", numberNodes). + Msg("You likely need more chainlink nodes to properly configure OCR, try 5 or more.") + } + s := make([]int, 0) + for i := 0; i < numberNodes; i++ { + s = append(s, 1) + } + faultyNodes := 0 + if numberNodes > 1 { + faultyNodes = (numberNodes - 1) / 3 + } + if faultyNodes == 0 { + faultyNodes = 1 + } + if cfg.DeltaStage == nil { + cfg.DeltaStage = config.MustNewDuration(inflightExpiry) + } + return contracts.OffChainAggregatorV2Config{ + DeltaProgress: cfg.DeltaProgress, + DeltaResend: cfg.DeltaResend, + DeltaRound: cfg.DeltaRound, + DeltaGrace: cfg.DeltaGrace, + DeltaStage: cfg.DeltaStage, + RMax: 3, + S: s, + F: faultyNodes, + Oracles: []ocrconfighelper2.OracleIdentityExtra{}, + MaxDurationQuery: cfg.MaxDurationQuery, + MaxDurationObservation: cfg.MaxDurationObservation, + MaxDurationReport: cfg.MaxDurationReport, + MaxDurationShouldAcceptFinalizedReport: cfg.MaxDurationShouldAcceptFinalizedReport, + MaxDurationShouldTransmitAcceptedReport: cfg.MaxDurationShouldTransmitAcceptedReport, + OnchainConfig: []byte{}, + } +} + +func stripKeyPrefix(key string) string { + chunks := strings.Split(key, "_") + if len(chunks) == 3 { + return chunks[2] + } + return key +} + +func NewCommitOffchainConfig( + GasPriceHeartBeat config.Duration, + DAGasPriceDeviationPPB uint32, + ExecGasPriceDeviationPPB uint32, + TokenPriceHeartBeat config.Duration, + TokenPriceDeviationPPB uint32, + InflightCacheExpiry config.Duration, + priceReportingDisabled bool) (ccipconfig.OffchainConfig, error) { + switch VersionMap[CommitStoreContract] { + case Latest: + return testhelpers.NewCommitOffchainConfig( + GasPriceHeartBeat, + DAGasPriceDeviationPPB, + ExecGasPriceDeviationPPB, + TokenPriceHeartBeat, + TokenPriceDeviationPPB, + InflightCacheExpiry, + priceReportingDisabled, + ), nil + case V1_2_0: + return testhelpers_1_4_0.NewCommitOffchainConfig( + GasPriceHeartBeat, + DAGasPriceDeviationPPB, + ExecGasPriceDeviationPPB, + TokenPriceHeartBeat, + TokenPriceDeviationPPB, + InflightCacheExpiry, + priceReportingDisabled, + ), nil + default: + return nil, fmt.Errorf("version not supported: %s", VersionMap[CommitStoreContract]) + } +} + +func NewCommitOnchainConfig( + PriceRegistry common.Address, +) (abihelpers.AbiDefined, error) { + switch VersionMap[CommitStoreContract] { + case Latest: + return testhelpers.NewCommitOnchainConfig(PriceRegistry), nil + case V1_2_0: + return testhelpers_1_4_0.NewCommitOnchainConfig(PriceRegistry), nil + default: + return nil, fmt.Errorf("version not supported: %s", VersionMap[CommitStoreContract]) + } +} + +func NewExecOnchainConfig( + PermissionLessExecutionThresholdSeconds uint32, + Router common.Address, + PriceRegistry common.Address, + MaxNumberOfTokensPerMsg uint16, + MaxDataBytes uint32, + MaxPoolReleaseOrMintGas uint32, +) (abihelpers.AbiDefined, error) { + switch VersionMap[OffRampContract] { + case Latest: + return testhelpers.NewExecOnchainConfig(PermissionLessExecutionThresholdSeconds, Router, PriceRegistry, MaxNumberOfTokensPerMsg, MaxDataBytes), nil + case V1_2_0: + return testhelpers_1_4_0.NewExecOnchainConfig( + PermissionLessExecutionThresholdSeconds, + Router, + PriceRegistry, + MaxNumberOfTokensPerMsg, + MaxDataBytes, + MaxPoolReleaseOrMintGas, + ), nil + default: + return nil, fmt.Errorf("version not supported: %s", VersionMap[OffRampContract]) + } +} + +// NewExecOffchainConfig creates a config for the OffChain portion of how CCIP operates +func NewExecOffchainConfig( + destOptimisticConfirmations uint32, + batchGasLimit uint32, + relativeBoostPerWaitHour float64, + inflightCacheExpiry config.Duration, + rootSnoozeTime config.Duration, + batchingStrategyID uint32, // See ccipexec package +) (ccipconfig.OffchainConfig, error) { + switch VersionMap[OffRampContract] { + case Latest: + return testhelpers.NewExecOffchainConfig( + destOptimisticConfirmations, + batchGasLimit, + relativeBoostPerWaitHour, + inflightCacheExpiry, + rootSnoozeTime, + batchingStrategyID, + ), nil + case V1_2_0: + return testhelpers_1_4_0.NewExecOffchainConfig( + destOptimisticConfirmations, + batchGasLimit, + relativeBoostPerWaitHour, + inflightCacheExpiry, + rootSnoozeTime, + batchingStrategyID, + ), nil + default: + return nil, fmt.Errorf("version not supported: %s", VersionMap[OffRampContract]) + } +} + +func NewOffChainAggregatorV2ConfigForCCIPPlugin[T ccipconfig.OffchainConfig]( + nodes []*client.CLNodesWithKeys, + offchainCfg T, + onchainCfg abihelpers.AbiDefined, + ocr2Params contracts.OffChainAggregatorV2Config, + inflightExpiry time.Duration, +) ( + signers []common.Address, + transmitters []common.Address, + f_ uint8, + onchainConfig_ []byte, + offchainConfigVersion uint64, + offchainConfig []byte, + err error, +) { + oracleIdentities := make([]ocrconfighelper2.OracleIdentityExtra, 0) + ocrConfig := OffChainAggregatorV2ConfigWithNodes(len(nodes), inflightExpiry, ocr2Params) + var onChainKeys []ocrtypes2.OnchainPublicKey + for i, nodeWithKeys := range nodes { + ocr2Key := nodeWithKeys.KeysBundle.OCR2Key.Data + offChainPubKeyTemp, err := hex.DecodeString(stripKeyPrefix(ocr2Key.Attributes.OffChainPublicKey)) + if err != nil { + return nil, nil, 0, nil, 0, nil, err + } + formattedOnChainPubKey := stripKeyPrefix(ocr2Key.Attributes.OnChainPublicKey) + cfgPubKeyTemp, err := hex.DecodeString(stripKeyPrefix(ocr2Key.Attributes.ConfigPublicKey)) + if err != nil { + return nil, nil, 0, nil, 0, nil, err + } + cfgPubKeyBytes := [ed25519.PublicKeySize]byte{} + copy(cfgPubKeyBytes[:], cfgPubKeyTemp) + offChainPubKey := [curve25519.PointSize]byte{} + copy(offChainPubKey[:], offChainPubKeyTemp) + ethAddress := nodeWithKeys.KeysBundle.EthAddress + p2pKeys := nodeWithKeys.KeysBundle.P2PKeys + peerID := p2pKeys.Data[0].Attributes.PeerID + oracleIdentities = append(oracleIdentities, ocrconfighelper2.OracleIdentityExtra{ + OracleIdentity: ocrconfighelper2.OracleIdentity{ + OffchainPublicKey: offChainPubKey, + OnchainPublicKey: common.HexToAddress(formattedOnChainPubKey).Bytes(), + PeerID: peerID, + TransmitAccount: ocrtypes2.Account(ethAddress), + }, + ConfigEncryptionPublicKey: cfgPubKeyBytes, + }) + onChainKeys = append(onChainKeys, oracleIdentities[i].OnchainPublicKey) + transmitters = append(transmitters, common.HexToAddress(ethAddress)) + } + signers, err = evm.OnchainPublicKeyToAddress(onChainKeys) + if err != nil { + return nil, nil, 0, nil, 0, nil, err + } + ocrConfig.Oracles = oracleIdentities + ocrConfig.ReportingPluginConfig, err = ccipconfig.EncodeOffchainConfig(offchainCfg) + if err != nil { + return nil, nil, 0, nil, 0, nil, err + } + ocrConfig.OnchainConfig, err = abihelpers.EncodeAbiStruct(onchainCfg) + if err != nil { + return nil, nil, 0, nil, 0, nil, err + } + + _, _, f_, onchainConfig_, offchainConfigVersion, offchainConfig, err = ocrconfighelper2.ContractSetConfigArgsForTests( + ocrConfig.DeltaProgress.Duration(), + ocrConfig.DeltaResend.Duration(), + ocrConfig.DeltaRound.Duration(), + ocrConfig.DeltaGrace.Duration(), + ocrConfig.DeltaStage.Duration(), + ocrConfig.RMax, + ocrConfig.S, + ocrConfig.Oracles, + ocrConfig.ReportingPluginConfig, + ocrConfig.MaxDurationQuery.Duration(), + ocrConfig.MaxDurationObservation.Duration(), + ocrConfig.MaxDurationReport.Duration(), + ocrConfig.MaxDurationShouldAcceptFinalizedReport.Duration(), + ocrConfig.MaxDurationShouldTransmitAcceptedReport.Duration(), + ocrConfig.F, + ocrConfig.OnchainConfig, + ) + return +} diff --git a/integration-tests/ccip-tests/contracts/contract_models.go b/integration-tests/ccip-tests/contracts/contract_models.go new file mode 100644 index 00000000000..83fe12a60a6 --- /dev/null +++ b/integration-tests/ccip-tests/contracts/contract_models.go @@ -0,0 +1,2283 @@ +package contracts + +import ( + "context" + "fmt" + "math/big" + "strconv" + "strings" + "time" + + "github.com/AlekSi/pointer" + "github.com/Masterminds/semver/v3" + "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" + "github.com/rs/zerolog" + "golang.org/x/exp/rand" + + "github.com/smartcontractkit/chainlink-testing-framework/lib/blockchain" + + "github.com/smartcontractkit/chainlink/integration-tests/wrappers" + + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/commit_store" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/commit_store_1_2_0" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/evm_2_evm_offramp" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/evm_2_evm_offramp_1_2_0" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/evm_2_evm_onramp" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/evm_2_evm_onramp_1_2_0" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/fee_quoter" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/lock_release_token_pool" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/lock_release_token_pool_1_4_0" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/maybe_revert_message_receiver" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/mock_rmn_contract" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/mock_usdc_token_transmitter" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/mock_v3_aggregator_contract" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/price_registry_1_2_0" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/rmn_contract" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/router" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/token_admin_registry" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/token_pool" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/token_pool_1_4_0" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/usdc_token_pool" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/usdc_token_pool_1_4_0" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/link_token_interface" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/shared/generated/burn_mint_erc677" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/shared/generated/erc20" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/abihelpers" +) + +type LogInfo struct { + BlockNumber uint64 + TxHash common.Hash +} + +// Name denotes a contract name +type Name string + +// Version wraps a semver.Version object to provide some custom unmarshalling +type Version struct { + semver.Version +} + +// GasUpdateEvent holds the event details of Gas price update +type GasUpdateEvent struct { + Sender string + Tx string + Value *big.Int + DestChain uint64 + Source string +} + +// MustVersion creates a new Version object from a semver string and panics if it fails +func MustVersion(version string) Version { + v := semver.MustParse(version) + return Version{Version: *v} +} + +// UnmarshalTOML unmarshals TOML data into a Version object +func (v *Version) UnmarshalText(data []byte) error { + str := strings.Trim(string(data), `"`) + str = strings.Trim(str, `'`) + if strings.ToLower(str) == "latest" { + *v = Latest + return nil + } + ver, err := semver.NewVersion(str) + if err != nil { + return fmt.Errorf("failed to parse version from '%s': %w", str, err) + } + v.Version = *ver + return nil +} + +// Latest returns true if the version is the latest version +func (v *Version) Latest() bool { + return v.Version.Equal(&Latest.Version) +} + +const ( + Network = "Network Name" + PriceRegistryContract Name = "PriceRegistry" + OffRampContract Name = "OffRamp" + OnRampContract Name = "OnRamp" + TokenPoolContract Name = "TokenPool" + CommitStoreContract Name = "CommitStore" + + defaultDestByteOverhead = uint32(32) + defaultDestGasOverhead = uint32(125_000) +) + +var ( + V1_2_0 = MustVersion("1.2.0") + V1_4_0 = MustVersion("1.4.0") + V1_5_0 = MustVersion("1.5.0") + LatestPoolVersion = V1_5_0 + Latest = V1_5_0 + VersionMap = map[Name]Version{ + PriceRegistryContract: V1_2_0, + OffRampContract: Latest, + OnRampContract: Latest, + CommitStoreContract: Latest, + TokenPoolContract: Latest, + } + SupportedContracts = map[Name]map[string]bool{ + PriceRegistryContract: { + Latest.String(): true, + V1_2_0.String(): true, + }, + OffRampContract: { + Latest.String(): true, + V1_2_0.String(): true, + }, + OnRampContract: { + Latest.String(): true, + V1_2_0.String(): true, + }, + CommitStoreContract: { + Latest.String(): true, + V1_2_0.String(): true, + }, + TokenPoolContract: { + Latest.String(): true, + V1_4_0.String(): true, + }, + } + + FiftyCoins = new(big.Int).Mul(big.NewInt(1e18), big.NewInt(50)) + HundredCoins = new(big.Int).Mul(big.NewInt(1e18), big.NewInt(100)) +) + +// CheckVersionSupported checks if a given version is supported for a given contract +func CheckVersionSupported(name Name, version Version) error { + if contract, ok := SupportedContracts[name]; ok { + if isSupported, ok := contract[version.String()]; ok { + if isSupported { + return nil + } + return fmt.Errorf("version %s is not supported for contract %s", version.String(), name) + } + return fmt.Errorf("version %s is not supported for contract %s", version.String(), name) + } + return fmt.Errorf("contract %s is not supported", name) +} + +type RateLimiterConfig struct { + IsEnabled bool + Rate *big.Int + Capacity *big.Int + Tokens *big.Int +} + +type ARMConfig struct { + ARMWeightsByParticipants map[string]*big.Int // mapping : ARM participant address => weight + ThresholdForBlessing *big.Int + ThresholdForBadSignal *big.Int +} + +type TokenTransmitter struct { + client blockchain.EVMClient + instance *mock_usdc_token_transmitter.MockE2EUSDCTransmitter + ContractAddress common.Address +} + +type ERC677Token struct { + client blockchain.EVMClient + logger *zerolog.Logger + instance *burn_mint_erc677.BurnMintERC677 + ContractAddress common.Address + OwnerAddress common.Address + OwnerWallet *blockchain.EthereumWallet +} + +func (token *ERC677Token) GrantMintAndBurn(burnAndMinter common.Address) error { + opts, err := token.client.TransactionOpts(token.OwnerWallet) + if err != nil { + return fmt.Errorf("failed to get transaction opts: %w", err) + } + token.logger.Info(). + Str(Network, token.client.GetNetworkName()). + Str("BurnAndMinter", burnAndMinter.Hex()). + Str("Token", token.ContractAddress.Hex()). + Msg("Granting mint and burn roles") + tx, err := token.instance.GrantMintAndBurnRoles(opts, burnAndMinter) + if err != nil { + return fmt.Errorf("failed to grant mint and burn roles: %w", err) + } + return token.client.ProcessTransaction(tx) +} + +func (token *ERC677Token) GrantMintRole(minter common.Address) error { + opts, err := token.client.TransactionOpts(token.OwnerWallet) + if err != nil { + return err + } + token.logger.Info(). + Str(Network, token.client.GetNetworkName()). + Str("Minter", minter.Hex()). + Str("Token", token.ContractAddress.Hex()). + Msg("Granting mint roles") + tx, err := token.instance.GrantMintRole(opts, minter) + if err != nil { + return fmt.Errorf("failed to grant mint role: %w", err) + } + return token.client.ProcessTransaction(tx) +} + +func (token *ERC677Token) Mint(to common.Address, amount *big.Int) error { + opts, err := token.client.TransactionOpts(token.OwnerWallet) + if err != nil { + return err + } + token.logger.Info(). + Str(Network, token.client.GetNetworkName()). + Str("To", to.Hex()). + Str("Token", token.ContractAddress.Hex()). + Str("Amount", amount.String()). + Msg("Minting tokens") + tx, err := token.instance.Mint(opts, to, amount) + if err != nil { + return fmt.Errorf("failed to mint tokens: %w", err) + } + return token.client.ProcessTransaction(tx) +} + +type ERC20Token struct { + client blockchain.EVMClient + logger *zerolog.Logger + instance *erc20.ERC20 + ContractAddress common.Address + OwnerAddress common.Address + OwnerWallet *blockchain.EthereumWallet +} + +func (token *ERC20Token) Address() string { + return token.ContractAddress.Hex() +} + +func (token *ERC20Token) BalanceOf(ctx context.Context, addr string) (*big.Int, error) { + opts := &bind.CallOpts{ + From: common.HexToAddress(token.client.GetDefaultWallet().Address()), + Context: ctx, + } + balance, err := token.instance.BalanceOf(opts, common.HexToAddress(addr)) + if err != nil { + return nil, fmt.Errorf("failed to get balance: %w", err) + } + return balance, nil +} + +// Allowance returns the amount which spender is still allowed to withdraw from owner +// https://docs.openzeppelin.com/contracts/2.x/api/token/erc20#IERC20-allowance-address-address- +func (token *ERC20Token) Allowance(owner, spender string) (*big.Int, error) { + allowance, err := token.instance.Allowance(nil, common.HexToAddress(owner), common.HexToAddress(spender)) + if err != nil { + return nil, err + } + return allowance, nil +} + +// Approve approves the spender to spend the given amount of tokens on behalf of another account +// https://docs.openzeppelin.com/contracts/2.x/api/token/erc20#IERC20-approve-address-uint256- +func (token *ERC20Token) Approve(onBehalf *blockchain.EthereumWallet, spender string, amount *big.Int) error { + onBehalfBalance, err := token.BalanceOf(context.Background(), onBehalf.Address()) + if err != nil { + return fmt.Errorf("failed to get balance of onBehalf: %w", err) + } + currentAllowance, err := token.Allowance(onBehalf.Address(), spender) + if err != nil { + return fmt.Errorf("failed to get current allowance for '%s' on behalf of '%s': %w", spender, onBehalf.Address(), err) + } + opts, err := token.client.TransactionOpts(onBehalf) + if err != nil { + return fmt.Errorf("failed to get transaction options: %w", err) + } + log := token.logger.Info(). + Str("On Behalf Of", onBehalf.Address()). + Str("On Behalf Of Balance", onBehalfBalance.String()). + Str("Spender", spender). + Str("Spender Current Allowance", currentAllowance.String()). + Str("Token", token.Address()). + Str("Amount", amount.String()). + Uint64("Nonce", opts.Nonce.Uint64()). + Str(Network, token.client.GetNetworkConfig().Name) + tx, err := token.instance.Approve(opts, common.HexToAddress(spender), amount) + if err != nil { + log.Err(err).Msg("Error Approving ERC20 Transfer") + return fmt.Errorf("failed to approve ERC20: %w", err) + } + log.Str("Hash", tx.Hash().Hex()).Msg("Approving ERC20 Transfer") + return token.client.ProcessTransaction(tx) +} + +func (token *ERC20Token) Transfer(from *blockchain.EthereumWallet, to string, amount *big.Int) error { + opts, err := token.client.TransactionOpts(from) + if err != nil { + return fmt.Errorf("failed to get transaction options: %w", err) + } + token.logger.Info(). + Str("From", from.Address()). + Str("To", to). + Str("Amount", amount.String()). + Uint64("Nonce", opts.Nonce.Uint64()). + Str(Network, token.client.GetNetworkConfig().Name). + Msg("Transferring ERC20") + tx, err := token.instance.Transfer(opts, common.HexToAddress(to), amount) + if err != nil { + return fmt.Errorf("failed to transfer ERC20: %w", err) + } + return token.client.ProcessTransaction(tx) +} + +type LinkToken struct { + client blockchain.EVMClient + logger *zerolog.Logger + instance *link_token_interface.LinkToken + EthAddress common.Address +} + +func (l *LinkToken) Address() string { + return l.EthAddress.Hex() +} + +func (l *LinkToken) BalanceOf(ctx context.Context, addr string) (*big.Int, error) { + opts := &bind.CallOpts{ + From: common.HexToAddress(l.client.GetDefaultWallet().Address()), + Context: ctx, + } + balance, err := l.instance.BalanceOf(opts, common.HexToAddress(addr)) + if err != nil { + return nil, fmt.Errorf("failed to get LINK balance: %w", err) + } + return balance, nil +} + +func (l *LinkToken) Allowance(owner, spender string) (*big.Int, error) { + allowance, err := l.instance.Allowance(nil, common.HexToAddress(owner), common.HexToAddress(spender)) + if err != nil { + return nil, err + } + return allowance, nil +} + +func (l *LinkToken) Approve(to string, amount *big.Int) error { + opts, err := l.client.TransactionOpts(l.client.GetDefaultWallet()) + if err != nil { + return fmt.Errorf("failed to get transaction opts: %w", err) + } + l.logger.Info(). + Str("From", l.client.GetDefaultWallet().Address()). + Str("To", to). + Str("Token", l.Address()). + Str("Amount", amount.String()). + Uint64("Nonce", opts.Nonce.Uint64()). + Str(Network, l.client.GetNetworkConfig().Name). + Msg("Approving LINK Transfer") + tx, err := l.instance.Approve(opts, common.HexToAddress(to), amount) + if err != nil { + return fmt.Errorf("failed to approve LINK transfer: %w", err) + } + return l.client.ProcessTransaction(tx) +} + +func (l *LinkToken) Transfer(to string, amount *big.Int) error { + opts, err := l.client.TransactionOpts(l.client.GetDefaultWallet()) + if err != nil { + return fmt.Errorf("failed to get transaction opts: %w", err) + } + l.logger.Info(). + Str("From", l.client.GetDefaultWallet().Address()). + Str("To", to). + Str("Amount", amount.String()). + Uint64("Nonce", opts.Nonce.Uint64()). + Str(Network, l.client.GetNetworkConfig().Name). + Msg("Transferring LINK") + tx, err := l.instance.Transfer(opts, common.HexToAddress(to), amount) + if err != nil { + return fmt.Errorf("failed to transfer LINK: %w", err) + } + return l.client.ProcessTransaction(tx) +} + +type LatestPool struct { + PoolInterface *token_pool.TokenPool + LockReleasePool *lock_release_token_pool.LockReleaseTokenPool + USDCPool *usdc_token_pool.USDCTokenPool +} + +type V1_4_0Pool struct { + PoolInterface *token_pool_1_4_0.TokenPool + LockReleasePool *lock_release_token_pool_1_4_0.LockReleaseTokenPool + USDCPool *usdc_token_pool_1_4_0.USDCTokenPool +} + +type TokenPoolWrapper struct { + Latest *LatestPool + V1_4_0 *V1_4_0Pool +} + +func (w TokenPoolWrapper) SetRebalancer(opts *bind.TransactOpts, from common.Address) (*types.Transaction, error) { + if w.Latest != nil && w.Latest.LockReleasePool != nil { + return w.Latest.LockReleasePool.SetRebalancer(opts, from) + } + if w.V1_4_0 != nil && w.V1_4_0.LockReleasePool != nil { + return w.V1_4_0.LockReleasePool.SetRebalancer(opts, from) + } + return nil, fmt.Errorf("no pool found to set rebalancer") +} + +func (w TokenPoolWrapper) SetUSDCDomains(opts *bind.TransactOpts, updates []usdc_token_pool.USDCTokenPoolDomainUpdate) (*types.Transaction, error) { + if w.Latest != nil && w.Latest.USDCPool != nil { + return w.Latest.USDCPool.SetDomains(opts, updates) + } + if w.V1_4_0 != nil && w.V1_4_0.USDCPool != nil { + V1_4_0Updates := make([]usdc_token_pool_1_4_0.USDCTokenPoolDomainUpdate, len(updates)) + for i, update := range updates { + V1_4_0Updates[i] = usdc_token_pool_1_4_0.USDCTokenPoolDomainUpdate{ + AllowedCaller: update.AllowedCaller, + DomainIdentifier: update.DomainIdentifier, + DestChainSelector: update.DestChainSelector, + Enabled: update.Enabled, + } + } + return w.V1_4_0.USDCPool.SetDomains(opts, V1_4_0Updates) + } + return nil, fmt.Errorf("no pool found to set USDC domains") +} + +func (w TokenPoolWrapper) WithdrawLiquidity(opts *bind.TransactOpts, amount *big.Int) (*types.Transaction, error) { + if w.Latest != nil && w.Latest.LockReleasePool != nil { + return w.Latest.LockReleasePool.WithdrawLiquidity(opts, amount) + } + if w.V1_4_0 != nil && w.V1_4_0.LockReleasePool != nil { + return w.V1_4_0.LockReleasePool.WithdrawLiquidity(opts, amount) + } + return nil, fmt.Errorf("no pool found to withdraw liquidity") +} + +func (w TokenPoolWrapper) ProvideLiquidity(opts *bind.TransactOpts, amount *big.Int) (*types.Transaction, error) { + if w.Latest != nil && w.Latest.LockReleasePool != nil { + return w.Latest.LockReleasePool.ProvideLiquidity(opts, amount) + } + if w.V1_4_0 != nil && w.V1_4_0.LockReleasePool != nil { + return w.V1_4_0.LockReleasePool.ProvideLiquidity(opts, amount) + } + return nil, fmt.Errorf("no pool found to provide liquidity") +} + +func (w TokenPoolWrapper) IsSupportedChain(opts *bind.CallOpts, remoteChainSelector uint64) (bool, error) { + if w.Latest != nil && w.Latest.PoolInterface != nil { + return w.Latest.PoolInterface.IsSupportedChain(opts, remoteChainSelector) + } + if w.V1_4_0 != nil && w.V1_4_0.PoolInterface != nil { + return w.V1_4_0.PoolInterface.IsSupportedChain(opts, remoteChainSelector) + } + return false, fmt.Errorf("no pool found to check if chain is supported") +} + +func (w TokenPoolWrapper) ApplyChainUpdates(opts *bind.TransactOpts, update []token_pool.TokenPoolChainUpdate) (*types.Transaction, error) { + if w.Latest != nil && w.Latest.PoolInterface != nil { + return w.Latest.PoolInterface.ApplyChainUpdates(opts, update) + } + if w.V1_4_0 != nil && w.V1_4_0.PoolInterface != nil { + V1_4_0Updates := make([]token_pool_1_4_0.TokenPoolChainUpdate, len(update)) + for i, u := range update { + V1_4_0Updates[i] = token_pool_1_4_0.TokenPoolChainUpdate{ + RemoteChainSelector: u.RemoteChainSelector, + Allowed: u.Allowed, + InboundRateLimiterConfig: token_pool_1_4_0.RateLimiterConfig{ + IsEnabled: u.InboundRateLimiterConfig.IsEnabled, + Capacity: u.InboundRateLimiterConfig.Capacity, + Rate: u.InboundRateLimiterConfig.Rate, + }, + OutboundRateLimiterConfig: token_pool_1_4_0.RateLimiterConfig{ + IsEnabled: u.OutboundRateLimiterConfig.IsEnabled, + Capacity: u.OutboundRateLimiterConfig.Capacity, + Rate: u.OutboundRateLimiterConfig.Rate, + }, + } + } + return w.V1_4_0.PoolInterface.ApplyChainUpdates(opts, V1_4_0Updates) + } + return nil, fmt.Errorf("no pool found to apply chain updates") +} + +func (w TokenPoolWrapper) SetChainRateLimiterConfig(opts *bind.TransactOpts, selector uint64, out token_pool.RateLimiterConfig, in token_pool.RateLimiterConfig) (*types.Transaction, error) { + if w.Latest != nil && w.Latest.PoolInterface != nil { + return w.Latest.PoolInterface.SetChainRateLimiterConfig(opts, selector, out, in) + } + if w.V1_4_0 != nil && w.V1_4_0.PoolInterface != nil { + return w.V1_4_0.PoolInterface.SetChainRateLimiterConfig(opts, selector, + token_pool_1_4_0.RateLimiterConfig{ + IsEnabled: out.IsEnabled, + Capacity: out.Capacity, + Rate: out.Rate, + }, token_pool_1_4_0.RateLimiterConfig{ + IsEnabled: in.IsEnabled, + Capacity: in.Capacity, + Rate: in.Rate, + }) + } + return nil, fmt.Errorf("no pool found to set chain rate limiter config") +} + +func (w TokenPoolWrapper) GetCurrentOutboundRateLimiterState(opts *bind.CallOpts, selector uint64) (*RateLimiterConfig, error) { + if w.Latest != nil && w.Latest.PoolInterface != nil { + rl, err := w.Latest.PoolInterface.GetCurrentOutboundRateLimiterState(opts, selector) + if err != nil { + return nil, err + } + return &RateLimiterConfig{ + IsEnabled: rl.IsEnabled, + Capacity: rl.Capacity, + Rate: rl.Rate, + Tokens: rl.Tokens, + }, nil + } + if w.V1_4_0 != nil && w.V1_4_0.PoolInterface != nil { + rl, err := w.V1_4_0.PoolInterface.GetCurrentOutboundRateLimiterState(opts, selector) + if err != nil { + return nil, err + } + return &RateLimiterConfig{ + IsEnabled: rl.IsEnabled, + Capacity: rl.Capacity, + Rate: rl.Rate, + Tokens: rl.Tokens, + }, nil + } + return nil, fmt.Errorf("no pool found to get current outbound rate limiter state") +} + +func (w TokenPoolWrapper) GetCurrentInboundRateLimiterState(opts *bind.CallOpts, selector uint64) (*RateLimiterConfig, error) { + if w.Latest != nil && w.Latest.PoolInterface != nil { + rl, err := w.Latest.PoolInterface.GetCurrentInboundRateLimiterState(opts, selector) + if err != nil { + return nil, err + } + return &RateLimiterConfig{ + IsEnabled: rl.IsEnabled, + Capacity: rl.Capacity, + Rate: rl.Rate, + Tokens: rl.Tokens, + }, nil + } + if w.V1_4_0 != nil && w.V1_4_0.PoolInterface != nil { + rl, err := w.V1_4_0.PoolInterface.GetCurrentInboundRateLimiterState(opts, selector) + if err != nil { + return nil, err + } + return &RateLimiterConfig{ + IsEnabled: rl.IsEnabled, + Capacity: rl.Capacity, + Rate: rl.Rate, + Tokens: rl.Tokens, + }, nil + } + return nil, fmt.Errorf("no pool found to get current outbound rate limiter state") +} + +func (w TokenPoolWrapper) SetRouter(opts *bind.TransactOpts, routerAddr common.Address) (*types.Transaction, error) { + if w.Latest != nil && w.Latest.PoolInterface != nil { + return w.Latest.PoolInterface.SetRouter(opts, routerAddr) + } + if w.V1_4_0 != nil && w.V1_4_0.PoolInterface != nil { + return w.V1_4_0.PoolInterface.SetRouter(opts, routerAddr) + } + return nil, fmt.Errorf("no pool found to set router") +} + +func (w TokenPoolWrapper) GetRouter(opts *bind.CallOpts) (common.Address, error) { + if w.Latest != nil && w.Latest.PoolInterface != nil { + addr, err := w.Latest.PoolInterface.GetRouter(opts) + if err != nil { + return common.Address{}, err + } + return addr, nil + } + if w.V1_4_0 != nil && w.V1_4_0.PoolInterface != nil { + addr, err := w.V1_4_0.PoolInterface.GetRouter(opts) + if err != nil { + return common.Address{}, err + } + return addr, nil + } + return common.Address{}, fmt.Errorf("no pool found to get router") +} + +func (w TokenPoolWrapper) GetRebalancer(opts *bind.CallOpts) (common.Address, error) { + if w.Latest != nil && w.Latest.LockReleasePool != nil { + addr, err := w.Latest.LockReleasePool.GetRebalancer(opts) + if err != nil { + return common.Address{}, err + } + return addr, nil + } + if w.V1_4_0 != nil && w.V1_4_0.LockReleasePool != nil { + addr, err := w.V1_4_0.LockReleasePool.GetRebalancer(opts) + if err != nil { + return common.Address{}, err + } + return addr, nil + } + return common.Address{}, fmt.Errorf("no pool found to get rebalancer") +} + +// TokenPool represents a TokenPool address +type TokenPool struct { + client blockchain.EVMClient + logger *zerolog.Logger + Instance *TokenPoolWrapper + EthAddress common.Address + OwnerAddress common.Address + OwnerWallet *blockchain.EthereumWallet +} + +func (pool *TokenPool) Address() string { + return pool.EthAddress.Hex() +} + +func (pool *TokenPool) IsUSDC() bool { + if pool.Instance.Latest != nil && pool.Instance.Latest.USDCPool != nil { + return true + } + if pool.Instance.V1_4_0 != nil && pool.Instance.V1_4_0.USDCPool != nil { + return true + } + return false +} + +func (pool *TokenPool) IsLockRelease() bool { + if pool.Instance.Latest != nil && pool.Instance.Latest.LockReleasePool != nil { + return true + } + if pool.Instance.V1_4_0 != nil && pool.Instance.V1_4_0.LockReleasePool != nil { + return true + } + return false +} + +func (pool *TokenPool) SyncUSDCDomain(destTokenTransmitter *TokenTransmitter, destPoolAddr common.Address, destChainSelector uint64) error { + if !pool.IsUSDC() { + return fmt.Errorf("pool is not a USDC pool, cannot sync domain") + } + + var allowedCallerBytes [32]byte + copy(allowedCallerBytes[12:], destPoolAddr.Bytes()) + destTokenTransmitterIns, err := mock_usdc_token_transmitter.NewMockE2EUSDCTransmitter( + destTokenTransmitter.ContractAddress, destTokenTransmitter.client.Backend(), + ) + if err != nil { + return fmt.Errorf("failed to create mock USDC token transmitter: %w", err) + } + domain, err := destTokenTransmitterIns.LocalDomain(nil) + if err != nil { + return fmt.Errorf("failed to get local domain: %w", err) + } + opts, err := pool.client.TransactionOpts(pool.OwnerWallet) + if err != nil { + return fmt.Errorf("failed to get transaction opts: %w", err) + } + pool.logger.Info(). + Str("Token Pool", pool.Address()). + Str("From", pool.OwnerAddress.Hex()). + Str(Network, pool.client.GetNetworkName()). + Uint32("Domain", domain). + Str("Allowed Caller", destPoolAddr.Hex()). + Str("Dest Chain Selector", fmt.Sprintf("%d", destChainSelector)). + Msg("Syncing USDC Domain") + tx, err := pool.Instance.SetUSDCDomains(opts, []usdc_token_pool.USDCTokenPoolDomainUpdate{ + { + AllowedCaller: allowedCallerBytes, + DomainIdentifier: domain, + DestChainSelector: destChainSelector, + Enabled: true, + }, + }) + if err != nil { + return fmt.Errorf("failed to set domain: %w", err) + } + return pool.client.ProcessTransaction(tx) +} + +// MintUSDCToUSDCPool mints 100 USDC tokens to the pool if it is a USDC pool. +// This helps provide liquidity to the pool which is necessary for USDC tests to function properly. +func (pool *TokenPool) MintUSDCToUSDCPool() error { + if !pool.IsUSDC() { + return fmt.Errorf("pool is not a USDC pool, cannot send USDC") + } + usdcToken, err := pool.GetToken() + if err != nil { + return fmt.Errorf("failed to get dest usdc token: %w", err) + } + usdcInstance, err := burn_mint_erc677.NewBurnMintERC677(usdcToken, pool.client.Backend()) + if err != nil { + return fmt.Errorf("failed to get dest usdc token instance: %w", err) + } + + opts, err := pool.client.TransactionOpts(pool.client.GetDefaultWallet()) + if err != nil { + return fmt.Errorf("failed to get transaction opts: %w", err) + } + + tx, err := usdcInstance.Mint(opts, pool.EthAddress, HundredCoins) + if err != nil { + return fmt.Errorf("failed to mint usdc tokens to destPool: %w", err) + } + return pool.client.ProcessTransaction(tx) +} + +func (pool *TokenPool) RemoveLiquidity(amount *big.Int) error { + if !pool.IsLockRelease() { + return fmt.Errorf("pool is not a lock release pool, cannot remove liquidity") + } + opts, err := pool.client.TransactionOpts(pool.OwnerWallet) + if err != nil { + return fmt.Errorf("failed to get transaction opts: %w", err) + } + pool.logger.Info(). + Str("Token Pool", pool.Address()). + Str("Amount", amount.String()). + Msg("Initiating removing funds from pool") + tx, err := pool.Instance.WithdrawLiquidity(opts, amount) + if err != nil { + return fmt.Errorf("failed to withdraw liquidity: %w", err) + } + pool.logger.Info(). + Str("Token Pool", pool.Address()). + Str("Amount", amount.String()). + Str(Network, pool.client.GetNetworkConfig().Name). + Msg("Liquidity removed") + return pool.client.ProcessTransaction(tx) +} + +// AddLiquidity approves the token pool to spend the given amount of tokens from the given wallet +func (pool *TokenPool) AddLiquidity(token *ERC20Token, fromWallet *blockchain.EthereumWallet, amount *big.Int) error { + if !pool.IsLockRelease() { + return fmt.Errorf("pool is not a lock release pool, cannot add liquidity") + } + pool.logger.Info(). + Str("Token", token.Address()). + Str("Token Pool", pool.Address()). + Msg("Initiating adding liquidity to token pool") + err := token.Approve(fromWallet, pool.Address(), amount) + if err != nil { + return fmt.Errorf("failed to approve token transfer: %w", err) + } + err = pool.client.WaitForEvents() + if err != nil { + return fmt.Errorf("failed to wait for events: %w", err) + } + opts, err := pool.client.TransactionOpts(pool.OwnerWallet) + if err != nil { + return fmt.Errorf("failed to get transaction opts: %w", err) + } + _, err = pool.Instance.SetRebalancer(opts, opts.From) + if err != nil { + return fmt.Errorf("failed to set rebalancer: %w", err) + } + opts, err = pool.client.TransactionOpts(pool.OwnerWallet) + if err != nil { + return fmt.Errorf("failed to get transaction opts: %w", err) + } + pool.logger.Info(). + Str("Token Pool", pool.Address()). + Msg("Initiating adding Tokens in pool") + tx, err := pool.Instance.ProvideLiquidity(opts, amount) + if err != nil { + return fmt.Errorf("failed to provide liquidity: %w", err) + } + pool.logger.Info(). + Str("Token Pool", pool.Address()). + Str("Token", token.Address()). + Str(Network, pool.client.GetNetworkConfig().Name). + Msg("Liquidity added") + return pool.client.ProcessTransaction(tx) +} + +func (pool *TokenPool) SetRemoteChainOnPool(remoteChainSelector uint64, remotePoolAddresses common.Address, remoteTokenAddress common.Address) error { + pool.logger.Info(). + Str("Token Pool", pool.Address()). + Msg("Setting remote chain on pool") + var selectorsToUpdate []token_pool.TokenPoolChainUpdate + + isSupported, err := pool.Instance.IsSupportedChain(nil, remoteChainSelector) + if err != nil { + return fmt.Errorf("failed to get if chain is supported: %w", err) + } + // Check if remote chain is already supported, if yes return + if isSupported { + pool.logger.Info(). + Str("Token Pool", pool.Address()). + Str(Network, pool.client.GetNetworkName()). + Uint64("Remote Chain Selector", remoteChainSelector). + Msg("Remote chain is already supported") + return nil + } + // if not, add it + encodedPoolAddress, err := abihelpers.EncodeAddress(remotePoolAddresses) + if err != nil { + return fmt.Errorf("failed to encode address: %w", err) + } + + encodedTokenAddress, err := abihelpers.EncodeAddress(remoteTokenAddress) + if err != nil { + return fmt.Errorf("failed to encode token address: %w", err) + } + + selectorsToUpdate = append(selectorsToUpdate, token_pool.TokenPoolChainUpdate{ + RemoteChainSelector: remoteChainSelector, + RemotePoolAddress: encodedPoolAddress, + RemoteTokenAddress: encodedTokenAddress, + Allowed: true, + InboundRateLimiterConfig: token_pool.RateLimiterConfig{ + IsEnabled: true, + Capacity: new(big.Int).Mul(big.NewInt(1e18), big.NewInt(1e9)), + Rate: new(big.Int).Mul(big.NewInt(1e18), big.NewInt(1e5)), + }, + OutboundRateLimiterConfig: token_pool.RateLimiterConfig{ + IsEnabled: true, + Capacity: new(big.Int).Mul(big.NewInt(1e18), big.NewInt(1e9)), + Rate: new(big.Int).Mul(big.NewInt(1e18), big.NewInt(1e5)), + }, + }) + opts, err := pool.client.TransactionOpts(pool.OwnerWallet) + if err != nil { + return fmt.Errorf("failed to get transaction opts: %w", err) + } + tx, err := pool.Instance.ApplyChainUpdates(opts, selectorsToUpdate) + if err != nil { + return fmt.Errorf("failed to set chain updates on token pool: %w", err) + } + + pool.logger.Info(). + Str("Token Pool", pool.Address()). + Uint64("Chain selector", remoteChainSelector). + Str(Network, pool.client.GetNetworkConfig().Name). + Msg("Remote chains set on token pool") + return pool.client.ProcessTransaction(tx) +} + +// SetRemoteChainRateLimits sets the rate limits for the token pool on the remote chain +func (pool *TokenPool) SetRemoteChainRateLimits(remoteChainSelector uint64, rl token_pool.RateLimiterConfig) error { + opts, err := pool.client.TransactionOpts(pool.OwnerWallet) + if err != nil { + return fmt.Errorf("error getting transaction opts: %w", err) + } + pool.logger.Info(). + Str("Token Pool", pool.Address()). + Str("Remote chain selector", strconv.FormatUint(remoteChainSelector, 10)). + Interface("RateLimiterConfig", rl). + Msg("Setting Rate Limit on token pool") + tx, err := pool.Instance.SetChainRateLimiterConfig(opts, remoteChainSelector, rl, rl) + + if err != nil { + return fmt.Errorf("error setting rate limit token pool: %w", err) + } + + pool.logger.Info(). + Str("Token Pool", pool.Address()). + Str("Remote chain selector", strconv.FormatUint(remoteChainSelector, 10)). + Interface("RateLimiterConfig", rl). + Msg("Rate Limit on token pool is set") + return pool.client.ProcessTransaction(tx) +} + +func (pool *TokenPool) SetRouter(routerAddr common.Address) error { + pool.logger.Info(). + Str("Token Pool", pool.Address()). + Msg("Setting router on pool") + opts, err := pool.client.TransactionOpts(pool.OwnerWallet) + if err != nil { + return fmt.Errorf("failed to get transaction opts: %w", err) + } + tx, err := pool.Instance.SetRouter(opts, routerAddr) + if err != nil { + return fmt.Errorf("failed to set router: %w", err) + + } + pool.logger.Info(). + Str("Token Pool", pool.Address()). + Str("Router", routerAddr.String()). + Msg("Router set on pool") + return pool.client.ProcessTransaction(tx) +} + +func (pool *TokenPool) GetRouter() (common.Address, error) { + return pool.Instance.GetRouter(nil) +} + +func (pool *TokenPool) GetToken() (common.Address, error) { + if pool.Instance.V1_4_0 != nil && pool.Instance.V1_4_0.PoolInterface != nil { + return pool.Instance.V1_4_0.PoolInterface.GetToken(nil) + } + if pool.Instance.Latest != nil && pool.Instance.Latest.PoolInterface != nil { + return pool.Instance.Latest.PoolInterface.GetToken(nil) + } + return common.Address{}, fmt.Errorf("no pool found to get token") +} + +func (pool *TokenPool) SetRebalancer(rebalancerAddress common.Address) error { + pool.logger.Info(). + Str("Token Pool", pool.Address()). + Msg("Setting rebalancer on pool") + opts, err := pool.client.TransactionOpts(pool.OwnerWallet) + if err != nil { + return fmt.Errorf("failed to get transaction opts: %w", err) + } + tx, err := pool.Instance.SetRebalancer(opts, rebalancerAddress) + if err != nil { + return fmt.Errorf("failed to set router: %w", err) + + } + pool.logger.Info(). + Str("Token Pool", pool.Address()). + Str("Rebalancer", rebalancerAddress.String()). + Msg("Rebalancer set on pool") + return pool.client.ProcessTransaction(tx) +} + +func (pool *TokenPool) GetRebalancer() (common.Address, error) { + return pool.Instance.GetRebalancer(nil) +} + +type ARM struct { + client blockchain.EVMClient + Instance *rmn_contract.RMNContract + EthAddress common.Address +} + +func (arm *ARM) Address() string { + return arm.EthAddress.Hex() +} + +type MockARM struct { + client blockchain.EVMClient + Instance *mock_rmn_contract.MockRMNContract + EthAddress common.Address +} + +func (arm *MockARM) SetClient(client blockchain.EVMClient) { + arm.client = client +} +func (arm *MockARM) Address() string { + return arm.EthAddress.Hex() +} + +type CommitStoreReportAccepted struct { + Min uint64 + Max uint64 + MerkleRoot [32]byte + LogInfo LogInfo +} + +type CommitStoreWrapper struct { + Latest *commit_store.CommitStore + V1_2_0 *commit_store_1_2_0.CommitStore +} + +func (w CommitStoreWrapper) SetOCR2Config(opts *bind.TransactOpts, + signers []common.Address, + transmitters []common.Address, + f uint8, + onchainConfig []byte, + offchainConfigVersion uint64, + offchainConfig []byte, +) (*types.Transaction, error) { + if w.Latest != nil { + return w.Latest.SetOCR2Config(opts, signers, transmitters, f, onchainConfig, offchainConfigVersion, offchainConfig) + } + if w.V1_2_0 != nil { + return w.V1_2_0.SetOCR2Config(opts, signers, transmitters, f, onchainConfig, offchainConfigVersion, offchainConfig) + } + return nil, fmt.Errorf("no instance found to set OCR2 config") +} + +func (w CommitStoreWrapper) GetExpectedNextSequenceNumber(opts *bind.CallOpts) (uint64, error) { + if w.Latest != nil { + return w.Latest.GetExpectedNextSequenceNumber(opts) + } + if w.V1_2_0 != nil { + return w.V1_2_0.GetExpectedNextSequenceNumber(opts) + } + return 0, fmt.Errorf("no instance found to get expected next sequence number") +} + +type CommitStore struct { + client blockchain.EVMClient + logger *zerolog.Logger + Instance *CommitStoreWrapper + EthAddress common.Address +} + +func (b *CommitStore) Address() string { + return b.EthAddress.Hex() +} + +// SetOCR2Config sets the offchain reporting protocol configuration +func (b *CommitStore) SetOCR2Config( + signers []common.Address, + transmitters []common.Address, + f uint8, + onchainConfig []byte, + offchainConfigVersion uint64, + offchainConfig []byte, +) error { + b.logger.Info().Str("Contract Address", b.Address()).Msg("Configuring OCR config for CommitStore Contract") + // Set Config + opts, err := b.client.TransactionOpts(b.client.GetDefaultWallet()) + if err != nil { + return fmt.Errorf("error getting transaction opts: %w", err) + } + tx, err := b.Instance.SetOCR2Config( + opts, + signers, + transmitters, + f, + onchainConfig, + offchainConfigVersion, + offchainConfig, + ) + b.logger.Debug(). + Interface("signerAddresses", signers). + Interface("transmitterAddresses", transmitters). + Str(Network, b.client.GetNetworkConfig().Name). + Str("Tx", tx.Hash().Hex()). + Msg("Configuring CommitStore") + + if err != nil { + return fmt.Errorf("error setting OCR2 config: %w", err) + } + return b.client.ProcessTransaction(tx) +} + +// WatchReportAccepted watches for report accepted events +// There is no need to differentiate between the two versions of the contract as the event signature is the same +// we can cast the contract to the latest version +func (b *CommitStore) WatchReportAccepted(opts *bind.WatchOpts, acceptedEvent chan *commit_store.CommitStoreReportAccepted) (event.Subscription, error) { + if b.Instance.Latest != nil { + return b.Instance.Latest.WatchReportAccepted(opts, acceptedEvent) + } + if b.Instance.V1_2_0 != nil { + newCommitStore, err := commit_store.NewCommitStore(b.EthAddress, wrappers.MustNewWrappedContractBackend(b.client, nil)) + if err != nil { + return nil, fmt.Errorf("failed to create new CommitStore contract: %w", err) + } + return newCommitStore.WatchReportAccepted(opts, acceptedEvent) + } + return nil, fmt.Errorf("no instance found to watch for report accepted") +} + +type ReceiverDapp struct { + client blockchain.EVMClient + logger *zerolog.Logger + instance *maybe_revert_message_receiver.MaybeRevertMessageReceiver + EthAddress common.Address +} + +func (rDapp *ReceiverDapp) Address() string { + return rDapp.EthAddress.Hex() +} + +func (rDapp *ReceiverDapp) ToggleRevert(revert bool) error { + opts, err := rDapp.client.TransactionOpts(rDapp.client.GetDefaultWallet()) + if err != nil { + return fmt.Errorf("error getting transaction opts: %w", err) + } + tx, err := rDapp.instance.SetRevert(opts, revert) + if err != nil { + return fmt.Errorf("error setting revert: %w", err) + } + rDapp.logger.Info(). + Bool("revert", revert). + Str("tx", tx.Hash().String()). + Str("ReceiverDapp", rDapp.Address()). + Str(Network, rDapp.client.GetNetworkConfig().Name). + Msg("ReceiverDapp revert set") + return rDapp.client.ProcessTransaction(tx) +} + +type InternalTimestampedPackedUint224 struct { + Value *big.Int + Timestamp uint32 +} + +type PriceRegistryUsdPerUnitGasUpdated struct { + DestChain uint64 + Value *big.Int + Timestamp *big.Int + Raw types.Log +} + +type PriceRegistryWrapper struct { + Latest *fee_quoter.FeeQuoter + V1_2_0 *price_registry_1_2_0.PriceRegistry +} + +func (p *PriceRegistryWrapper) GetTokenPrice(opts *bind.CallOpts, token common.Address) (*big.Int, error) { + if p.Latest != nil { + price, err := p.Latest.GetTokenPrice(opts, token) + if err != nil { + return nil, err + } + return price.Value, nil + } + if p.V1_2_0 != nil { + p, err := p.V1_2_0.GetTokenPrice(opts, token) + if err != nil { + return nil, err + } + return p.Value, nil + } + return nil, fmt.Errorf("no instance found to get token price") +} + +func (p *PriceRegistryWrapper) AddPriceUpdater(opts *bind.TransactOpts, addr common.Address) (*types.Transaction, error) { + if p.Latest != nil { + return p.Latest.ApplyAuthorizedCallerUpdates( + opts, + fee_quoter.AuthorizedCallersAuthorizedCallerArgs{ + AddedCallers: []common.Address{addr}, + RemovedCallers: []common.Address{}, + }, + ) + } + if p.V1_2_0 != nil { + return p.V1_2_0.ApplyPriceUpdatersUpdates(opts, []common.Address{addr}, []common.Address{}) + } + return nil, fmt.Errorf("no instance found to add price updater") +} + +func (p *PriceRegistryWrapper) AddFeeToken(opts *bind.TransactOpts, addr common.Address) (*types.Transaction, error) { + if p.Latest != nil { + return p.Latest.ApplyFeeTokensUpdates(opts, []common.Address{addr}, []common.Address{}) + } + if p.V1_2_0 != nil { + return p.V1_2_0.ApplyFeeTokensUpdates(opts, []common.Address{addr}, []common.Address{}) + } + return nil, fmt.Errorf("no instance found to add fee token") +} + +func (p *PriceRegistryWrapper) GetDestinationChainGasPrice(opts *bind.CallOpts, chainselector uint64) (InternalTimestampedPackedUint224, error) { + if p.Latest != nil { + price, err := p.Latest.GetDestinationChainGasPrice(opts, chainselector) + if err != nil { + return InternalTimestampedPackedUint224{}, err + } + return InternalTimestampedPackedUint224{ + Value: price.Value, + Timestamp: price.Timestamp, + }, nil + } + if p.V1_2_0 != nil { + price, err := p.V1_2_0.GetDestinationChainGasPrice(opts, chainselector) + if err != nil { + return InternalTimestampedPackedUint224{}, err + } + return InternalTimestampedPackedUint224{ + Value: price.Value, + Timestamp: price.Timestamp, + }, nil + } + return InternalTimestampedPackedUint224{}, fmt.Errorf("no instance found to add fee token") +} + +type InternalGasPriceUpdate struct { + DestChainSelector uint64 + UsdPerUnitGas *big.Int +} + +type InternalTokenPriceUpdate struct { + SourceToken common.Address + UsdPerToken *big.Int +} + +type PriceRegistry struct { + client blockchain.EVMClient + Instance *PriceRegistryWrapper + logger *zerolog.Logger + EthAddress common.Address +} + +func (c *PriceRegistry) Address() string { + return c.EthAddress.Hex() +} + +func (c *PriceRegistry) AddPriceUpdater(addr common.Address) error { + opts, err := c.client.TransactionOpts(c.client.GetDefaultWallet()) + if err != nil { + return fmt.Errorf("error getting transaction opts: %w", err) + } + tx, err := c.Instance.AddPriceUpdater(opts, addr) + if err != nil { + return fmt.Errorf("error adding price updater: %w", err) + } + c.logger.Info(). + Str("updaters", addr.Hex()). + Str(Network, c.client.GetNetworkConfig().Name). + Msg("PriceRegistry updater added") + return c.client.ProcessTransaction(tx) +} + +func (c *PriceRegistry) AddFeeToken(addr common.Address) error { + opts, err := c.client.TransactionOpts(c.client.GetDefaultWallet()) + if err != nil { + return fmt.Errorf("error getting transaction opts: %w", err) + } + tx, err := c.Instance.AddFeeToken(opts, addr) + if err != nil { + return fmt.Errorf("error adding fee token: %w", err) + } + c.logger.Info(). + Str("feeTokens", addr.Hex()). + Str(Network, c.client.GetNetworkConfig().Name). + Msg("PriceRegistry feeToken set") + return c.client.ProcessTransaction(tx) +} + +func (c *PriceRegistry) UpdatePrices(tokenUpdates []InternalTokenPriceUpdate, gasUpdates []InternalGasPriceUpdate) error { + opts, err := c.client.TransactionOpts(c.client.GetDefaultWallet()) + if err != nil { + return fmt.Errorf("error getting transaction opts: %w", err) + } + var tx *types.Transaction + if c.Instance.Latest != nil { + var tokenUpdatesLatest []fee_quoter.InternalTokenPriceUpdate + var gasUpdatesLatest []fee_quoter.InternalGasPriceUpdate + for _, update := range tokenUpdates { + tokenUpdatesLatest = append(tokenUpdatesLatest, fee_quoter.InternalTokenPriceUpdate{ + SourceToken: update.SourceToken, + UsdPerToken: update.UsdPerToken, + }) + } + for _, update := range gasUpdates { + gasUpdatesLatest = append(gasUpdatesLatest, fee_quoter.InternalGasPriceUpdate{ + DestChainSelector: update.DestChainSelector, + UsdPerUnitGas: update.UsdPerUnitGas, + }) + } + tx, err = c.Instance.Latest.UpdatePrices(opts, fee_quoter.InternalPriceUpdates{ + TokenPriceUpdates: tokenUpdatesLatest, + GasPriceUpdates: gasUpdatesLatest, + }) + if err != nil { + return fmt.Errorf("error updating prices: %w", err) + } + } + if c.Instance.V1_2_0 != nil { + var tokenUpdates_1_2_0 []price_registry_1_2_0.InternalTokenPriceUpdate + var gasUpdates_1_2_0 []price_registry_1_2_0.InternalGasPriceUpdate + for _, update := range tokenUpdates { + tokenUpdates_1_2_0 = append(tokenUpdates_1_2_0, price_registry_1_2_0.InternalTokenPriceUpdate{ + SourceToken: update.SourceToken, + UsdPerToken: update.UsdPerToken, + }) + } + for _, update := range gasUpdates { + gasUpdates_1_2_0 = append(gasUpdates_1_2_0, price_registry_1_2_0.InternalGasPriceUpdate{ + DestChainSelector: update.DestChainSelector, + UsdPerUnitGas: update.UsdPerUnitGas, + }) + } + tx, err = c.Instance.V1_2_0.UpdatePrices(opts, price_registry_1_2_0.InternalPriceUpdates{ + TokenPriceUpdates: tokenUpdates_1_2_0, + GasPriceUpdates: gasUpdates_1_2_0, + }) + if err != nil { + return fmt.Errorf("error updating prices: %w", err) + } + } + if tx == nil { + return fmt.Errorf("no instance found to update prices") + } + c.logger.Info(). + Str(Network, c.client.GetNetworkConfig().Name). + Interface("tokenUpdates", tokenUpdates). + Interface("gasUpdates", gasUpdates). + Msg("Prices updated") + return c.client.ProcessTransaction(tx) +} + +func (c *PriceRegistry) WatchUsdPerUnitGasUpdated(opts *bind.WatchOpts, latest chan *fee_quoter.FeeQuoterUsdPerUnitGasUpdated, destChain []uint64) (event.Subscription, error) { + if c.Instance.Latest != nil { + return c.Instance.Latest.WatchUsdPerUnitGasUpdated(opts, latest, destChain) + } + if c.Instance.V1_2_0 != nil { + newP, err := fee_quoter.NewFeeQuoter(c.Instance.V1_2_0.Address(), wrappers.MustNewWrappedContractBackend(c.client, nil)) + if err != nil { + return nil, fmt.Errorf("failed to create new PriceRegistry contract: %w", err) + } + return newP.WatchUsdPerUnitGasUpdated(opts, latest, destChain) + } + return nil, fmt.Errorf("no instance found to watch for price updates for gas") +} + +func (c *PriceRegistry) WatchUsdPerTokenUpdated(opts *bind.WatchOpts, latest chan *fee_quoter.FeeQuoterUsdPerTokenUpdated) (event.Subscription, error) { + if c.Instance.Latest != nil { + return c.Instance.Latest.WatchUsdPerTokenUpdated(opts, latest, nil) + } + if c.Instance.V1_2_0 != nil { + newP, err := fee_quoter.NewFeeQuoter(c.Instance.V1_2_0.Address(), wrappers.MustNewWrappedContractBackend(c.client, nil)) + if err != nil { + return nil, fmt.Errorf("failed to create new PriceRegistry contract: %w", err) + } + return newP.WatchUsdPerTokenUpdated(opts, latest, nil) + } + return nil, fmt.Errorf("no instance found to watch for price updates for tokens") +} + +type TokenAdminRegistry struct { + client blockchain.EVMClient + logger *zerolog.Logger + Instance *token_admin_registry.TokenAdminRegistry + EthAddress common.Address +} + +func (r *TokenAdminRegistry) Address() string { + return r.EthAddress.Hex() +} + +func (r *TokenAdminRegistry) SetAdminAndRegisterPool(tokenAddr, poolAddr common.Address) error { + opts, err := r.client.TransactionOpts(r.client.GetDefaultWallet()) + if err != nil { + return fmt.Errorf("error getting transaction opts: %w", err) + } + tx, err := r.Instance.ProposeAdministrator(opts, tokenAddr, opts.From) + if err != nil { + return fmt.Errorf("error setting admin for token %s : %w", tokenAddr.Hex(), err) + } + err = r.client.ProcessTransaction(tx) + if err != nil { + return fmt.Errorf("error processing tx for setting admin on token %w", err) + } + r.logger.Info(). + Str("Admin", opts.From.Hex()). + Str("Token", tokenAddr.Hex()). + Str("TokenAdminRegistry", r.Address()). + Msg("Admin is set for token on TokenAdminRegistry") + err = r.client.WaitForEvents() + if err != nil { + return fmt.Errorf("error waiting for tx for setting admin on pool %w", err) + } + opts, err = r.client.TransactionOpts(r.client.GetDefaultWallet()) + if err != nil { + return fmt.Errorf("error getting transaction opts: %w", err) + } + tx, err = r.Instance.AcceptAdminRole(opts, tokenAddr) + if err != nil { + return fmt.Errorf("error accepting admin role for token %s : %w", tokenAddr.Hex(), err) + } + err = r.client.ProcessTransaction(tx) + if err != nil { + return fmt.Errorf("error processing tx for accepting admin role for token %w", err) + } + r.logger.Info(). + Str("Token", tokenAddr.Hex()). + Str("TokenAdminRegistry", r.Address()). + Msg("Admin role is accepted for token on TokenAdminRegistry") + err = r.client.WaitForEvents() + if err != nil { + return fmt.Errorf("error waiting for tx for accepting admin role for token %w", err) + } + opts, err = r.client.TransactionOpts(r.client.GetDefaultWallet()) + if err != nil { + return fmt.Errorf("error getting transaction opts: %w", err) + } + tx, err = r.Instance.SetPool(opts, tokenAddr, poolAddr) + if err != nil { + return fmt.Errorf("error setting token %s and pool %s : %w", tokenAddr.Hex(), poolAddr.Hex(), err) + } + r.logger.Info(). + Str("Token", tokenAddr.Hex()). + Str("Pool", poolAddr.Hex()). + Str("TokenAdminRegistry", r.Address()). + Msg("token and pool are set on TokenAdminRegistry") + err = r.client.ProcessTransaction(tx) + if err != nil { + return fmt.Errorf("error processing tx for setting token %s and pool %s : %w", tokenAddr.Hex(), poolAddr.Hex(), err) + } + return nil +} + +type Router struct { + client blockchain.EVMClient + logger *zerolog.Logger + Instance *router.Router + EthAddress common.Address +} + +func (r *Router) Address() string { + return r.EthAddress.Hex() +} + +func (r *Router) SetOnRamp(chainSelector uint64, onRamp common.Address) error { + opts, err := r.client.TransactionOpts(r.client.GetDefaultWallet()) + if err != nil { + return fmt.Errorf("error getting transaction opts: %w", err) + } + r.logger.Info(). + Str("Router", r.Address()). + Str("OnRamp", onRamp.Hex()). + Str(Network, r.client.GetNetworkName()). + Str("ChainSelector", strconv.FormatUint(chainSelector, 10)). + Msg("Setting on ramp for r") + + tx, err := r.Instance.ApplyRampUpdates(opts, []router.RouterOnRamp{{DestChainSelector: chainSelector, OnRamp: onRamp}}, nil, nil) + if err != nil { + return fmt.Errorf("error applying ramp updates: %w", err) + } + r.logger.Info(). + Str("onRamp", onRamp.Hex()). + Str("Network Name", r.client.GetNetworkConfig().Name). + Msg("Router is configured") + return r.client.ProcessTransaction(tx) +} + +func (r *Router) CCIPSend(destChainSelector uint64, msg router.ClientEVM2AnyMessage, valueForNative *big.Int) (*types.Transaction, error) { + opts, err := r.client.TransactionOpts(r.client.GetDefaultWallet()) + if err != nil { + return nil, fmt.Errorf("error getting transaction opts: %w", err) + } + if valueForNative != nil { + opts.Value = valueForNative + } + + r.logger.Info(). + Str(Network, r.client.GetNetworkName()). + Str("Router", r.Address()). + Interface("TokensAndAmounts", msg.TokenAmounts). + Str("FeeToken", msg.FeeToken.Hex()). + Str("ExtraArgs", fmt.Sprintf("0x%x", msg.ExtraArgs[:])). + Str("Receiver", fmt.Sprintf("0x%x", msg.Receiver[:])). + Msg("Sending msg") + return r.Instance.CcipSend(opts, destChainSelector, msg) +} + +func (r *Router) CCIPSendAndProcessTx(destChainSelector uint64, msg router.ClientEVM2AnyMessage, valueForNative *big.Int) (*types.Transaction, error) { + tx, err := r.CCIPSend(destChainSelector, msg, valueForNative) + if err != nil { + return nil, fmt.Errorf("failed to send msg: %w", err) + } + r.logger.Info(). + Str("Router", r.Address()). + Str("txHash", tx.Hash().Hex()). + Str(Network, r.client.GetNetworkConfig().Name). + Str("Chain Selector", strconv.FormatUint(destChainSelector, 10)). + Msg("Message Sent") + return tx, r.client.ProcessTransaction(tx) +} + +func (r *Router) AddOffRamp(offRamp common.Address, sourceChainId uint64) (*types.Transaction, error) { + opts, err := r.client.TransactionOpts(r.client.GetDefaultWallet()) + if err != nil { + return nil, fmt.Errorf("failed to get transaction opts: %w", err) + } + tx, err := r.Instance.ApplyRampUpdates(opts, nil, nil, []router.RouterOffRamp{{SourceChainSelector: sourceChainId, OffRamp: offRamp}}) + if err != nil { + return nil, fmt.Errorf("failed to add offRamp: %w", err) + } + r.logger.Info(). + Str("offRamp", offRamp.Hex()). + Str(Network, r.client.GetNetworkConfig().Name). + Msg("offRamp is added to Router") + return tx, r.client.ProcessTransaction(tx) +} + +func (r *Router) SetWrappedNative(wNative common.Address) (*types.Transaction, error) { + opts, err := r.client.TransactionOpts(r.client.GetDefaultWallet()) + if err != nil { + return nil, fmt.Errorf("failed to get transaction opts: %w", err) + } + tx, err := r.Instance.SetWrappedNative(opts, wNative) + if err != nil { + return nil, fmt.Errorf("failed to set wrapped native: %w", err) + } + r.logger.Info(). + Str("wrapped native", wNative.Hex()). + Str("router", r.Address()). + Str(Network, r.client.GetNetworkConfig().Name). + Msg("wrapped native is added for Router") + return tx, r.client.ProcessTransaction(tx) +} + +func (r *Router) GetFee(destChainSelector uint64, message router.ClientEVM2AnyMessage) (*big.Int, error) { + return r.Instance.GetFee(nil, destChainSelector, message) +} + +type SendReqEventData struct { + MessageId [32]byte + SequenceNumber uint64 + DataLength int + NoOfTokens int + LogInfo LogInfo + Fee *big.Int +} + +type OnRampWrapper struct { + Latest *evm_2_evm_onramp.EVM2EVMOnRamp + V1_2_0 *evm_2_evm_onramp_1_2_0.EVM2EVMOnRamp +} + +func (w OnRampWrapper) SetNops(opts *bind.TransactOpts, owner common.Address) (*types.Transaction, error) { + if w.Latest != nil { + return w.Latest.SetNops(opts, []evm_2_evm_onramp.EVM2EVMOnRampNopAndWeight{ + { + Nop: owner, + Weight: 1, + }, + }) + } + if w.V1_2_0 != nil { + return w.V1_2_0.SetNops(opts, []evm_2_evm_onramp_1_2_0.EVM2EVMOnRampNopAndWeight{ + { + Nop: owner, + Weight: 1, + }, + }) + } + return nil, fmt.Errorf("no instance found to set nops") +} + +func (w OnRampWrapper) SetTokenTransferFeeConfig( + opts *bind.TransactOpts, + config []evm_2_evm_onramp.EVM2EVMOnRampTokenTransferFeeConfigArgs, + addresses []common.Address, +) (*types.Transaction, error) { + if w.Latest != nil { + return w.Latest.SetTokenTransferFeeConfig(opts, config, addresses) + } + if w.V1_2_0 != nil { + var configV12 []evm_2_evm_onramp_1_2_0.EVM2EVMOnRampTokenTransferFeeConfigArgs + for _, c := range config { + configV12 = append(configV12, evm_2_evm_onramp_1_2_0.EVM2EVMOnRampTokenTransferFeeConfigArgs{ + Token: c.Token, + MinFeeUSDCents: c.MinFeeUSDCents, + MaxFeeUSDCents: c.MaxFeeUSDCents, + DeciBps: c.DeciBps, + DestGasOverhead: c.DestGasOverhead, + DestBytesOverhead: c.DestBytesOverhead, + }) + } + return w.V1_2_0.SetTokenTransferFeeConfig(opts, configV12) + } + return nil, fmt.Errorf("no instance found to set token transfer fee config") +} + +func (w OnRampWrapper) PayNops(opts *bind.TransactOpts) (*types.Transaction, error) { + if w.Latest != nil { + return w.Latest.PayNops(opts) + } + if w.V1_2_0 != nil { + return w.V1_2_0.PayNops(opts) + } + return nil, fmt.Errorf("no instance found to pay nops") +} + +func (w OnRampWrapper) WithdrawNonLinkFees(opts *bind.TransactOpts, native common.Address, owner common.Address) (*types.Transaction, error) { + if w.Latest != nil { + return w.Latest.WithdrawNonLinkFees(opts, native, owner) + } + if w.V1_2_0 != nil { + return w.V1_2_0.WithdrawNonLinkFees(opts, native, owner) + } + return nil, fmt.Errorf("no instance found to withdraw non link fees") +} + +func (w OnRampWrapper) SetRateLimiterConfig(opts *bind.TransactOpts, config evm_2_evm_onramp.RateLimiterConfig) (*types.Transaction, error) { + if w.Latest != nil { + return w.Latest.SetRateLimiterConfig(opts, config) + } + if w.V1_2_0 != nil { + return w.V1_2_0.SetRateLimiterConfig(opts, evm_2_evm_onramp_1_2_0.RateLimiterConfig{ + IsEnabled: config.IsEnabled, + Capacity: config.Capacity, + Rate: config.Rate, + }) + } + return nil, fmt.Errorf("no instance found to set rate limiter config") +} + +func (w OnRampWrapper) ParseCCIPSendRequested(l types.Log) (uint64, error) { + if w.Latest != nil { + sendReq, err := w.Latest.ParseCCIPSendRequested(l) + if err != nil { + return 0, err + } + return sendReq.Message.SequenceNumber, nil + } + if w.V1_2_0 != nil { + sendReq, err := w.V1_2_0.ParseCCIPSendRequested(l) + if err != nil { + return 0, err + } + return sendReq.Message.SequenceNumber, nil + } + return 0, fmt.Errorf("no instance found to parse CCIPSendRequested") +} + +// GetDynamicConfig retrieves the dynamic config for the onramp +func (w OnRampWrapper) GetDynamicConfig(opts *bind.CallOpts) (evm_2_evm_onramp.EVM2EVMOnRampDynamicConfig, error) { + if w.Latest != nil { + cfg, err := w.Latest.GetDynamicConfig(opts) + if err != nil { + return evm_2_evm_onramp.EVM2EVMOnRampDynamicConfig{}, err + } + return cfg, nil + } + if w.V1_2_0 != nil { + cfg, err := w.V1_2_0.GetDynamicConfig(opts) + if err != nil { + return evm_2_evm_onramp.EVM2EVMOnRampDynamicConfig{}, err + } + return evm_2_evm_onramp.EVM2EVMOnRampDynamicConfig{ + Router: cfg.Router, + MaxNumberOfTokensPerMsg: cfg.MaxNumberOfTokensPerMsg, + DestGasOverhead: cfg.DestGasOverhead, + DestGasPerPayloadByte: cfg.DestGasPerPayloadByte, + DestDataAvailabilityOverheadGas: cfg.DestDataAvailabilityOverheadGas, + DestGasPerDataAvailabilityByte: cfg.DestGasPerDataAvailabilityByte, + DestDataAvailabilityMultiplierBps: cfg.DestDataAvailabilityMultiplierBps, + PriceRegistry: cfg.PriceRegistry, + MaxDataBytes: cfg.MaxDataBytes, + MaxPerMsgGasLimit: cfg.MaxPerMsgGasLimit, + }, nil + } + return evm_2_evm_onramp.EVM2EVMOnRampDynamicConfig{}, fmt.Errorf("no instance found to get dynamic config") +} + +// SetDynamicConfig sets the dynamic config for the onramp +// Note that you cannot set only a single field, you must set all fields or they will be reset to zero values +// You can use GetDynamicConfig to get the current config and modify it as needed +func (w OnRampWrapper) SetDynamicConfig(opts *bind.TransactOpts, dynamicConfig evm_2_evm_onramp.EVM2EVMOnRampDynamicConfig) (*types.Transaction, error) { + if w.Latest != nil { + return w.Latest.SetDynamicConfig(opts, dynamicConfig) + } + if w.V1_2_0 != nil { + return w.V1_2_0.SetDynamicConfig(opts, evm_2_evm_onramp_1_2_0.EVM2EVMOnRampDynamicConfig{ + Router: dynamicConfig.Router, + MaxNumberOfTokensPerMsg: dynamicConfig.MaxNumberOfTokensPerMsg, + DestGasOverhead: dynamicConfig.DestGasOverhead, + DestGasPerPayloadByte: dynamicConfig.DestGasPerPayloadByte, + DestDataAvailabilityOverheadGas: dynamicConfig.DestDataAvailabilityOverheadGas, + DestGasPerDataAvailabilityByte: dynamicConfig.DestGasPerDataAvailabilityByte, + DestDataAvailabilityMultiplierBps: dynamicConfig.DestDataAvailabilityMultiplierBps, + PriceRegistry: dynamicConfig.PriceRegistry, + MaxDataBytes: dynamicConfig.MaxDataBytes, + MaxPerMsgGasLimit: dynamicConfig.MaxPerMsgGasLimit, + }) + } + return nil, fmt.Errorf("no instance found to set dynamic config") +} + +func (w OnRampWrapper) ApplyPoolUpdates(opts *bind.TransactOpts, tokens []common.Address, pools []common.Address) (*types.Transaction, error) { + if w.Latest != nil { + return nil, fmt.Errorf("latest version does not support ApplyPoolUpdates") + } + if w.V1_2_0 != nil { + var poolUpdates []evm_2_evm_onramp_1_2_0.InternalPoolUpdate + if len(tokens) != len(pools) { + return nil, fmt.Errorf("tokens and pools length mismatch") + } + for i, token := range tokens { + poolUpdates = append(poolUpdates, evm_2_evm_onramp_1_2_0.InternalPoolUpdate{ + Token: token, + Pool: pools[i], + }) + } + return w.V1_2_0.ApplyPoolUpdates(opts, []evm_2_evm_onramp_1_2_0.InternalPoolUpdate{}, poolUpdates) + } + return nil, fmt.Errorf("no instance found to apply pool updates") +} + +// CurrentRateLimiterState returns the current state of the rate limiter +func (w OnRampWrapper) CurrentRateLimiterState(opts *bind.CallOpts) (*RateLimiterConfig, error) { + if w.Latest != nil { + rlConfig, err := w.Latest.CurrentRateLimiterState(opts) + if err != nil { + return nil, err + } + return &RateLimiterConfig{ + IsEnabled: rlConfig.IsEnabled, + Rate: rlConfig.Rate, + Capacity: rlConfig.Capacity, + Tokens: rlConfig.Tokens, + }, err + } + if w.V1_2_0 != nil { + rlConfig, err := w.V1_2_0.CurrentRateLimiterState(opts) + if err != nil { + return nil, err + } + return &RateLimiterConfig{ + IsEnabled: rlConfig.IsEnabled, + Rate: rlConfig.Rate, + Capacity: rlConfig.Capacity, + Tokens: rlConfig.Tokens, + }, err + } + return nil, fmt.Errorf("no instance found to get current rate limiter state") +} + +type OnRamp struct { + client blockchain.EVMClient + logger *zerolog.Logger + Instance *OnRampWrapper + EthAddress common.Address +} + +// WatchCCIPSendRequested returns a subscription to watch for CCIPSendRequested events +// there is no difference in the event between the two versions +// so we can use the latest version to watch for events +func (onRamp *OnRamp) WatchCCIPSendRequested(opts *bind.WatchOpts, sendReqEvent chan *evm_2_evm_onramp.EVM2EVMOnRampCCIPSendRequested) (event.Subscription, error) { + if onRamp.Instance.Latest != nil { + return onRamp.Instance.Latest.WatchCCIPSendRequested(opts, sendReqEvent) + } + // cast the contract to the latest version so that we can watch for events with latest wrapper + if onRamp.Instance.V1_2_0 != nil { + newRamp, err := evm_2_evm_onramp.NewEVM2EVMOnRamp(onRamp.EthAddress, wrappers.MustNewWrappedContractBackend(onRamp.client, nil)) + if err != nil { + return nil, fmt.Errorf("failed to cast to latest version: %w", err) + } + return newRamp.WatchCCIPSendRequested(opts, sendReqEvent) + } + // should never reach here + return nil, fmt.Errorf("no instance found to watch for CCIPSendRequested") +} + +func (onRamp *OnRamp) Address() string { + return onRamp.EthAddress.Hex() +} + +func (onRamp *OnRamp) SetNops() error { + opts, err := onRamp.client.TransactionOpts(onRamp.client.GetDefaultWallet()) + if err != nil { + return fmt.Errorf("failed to get transaction opts: %w", err) + } + owner := common.HexToAddress(onRamp.client.GetDefaultWallet().Address()) + // set the payee to the default wallet + tx, err := onRamp.Instance.SetNops(opts, owner) + if err != nil { + return fmt.Errorf("failed to set nops: %w", err) + } + return onRamp.client.ProcessTransaction(tx) +} + +// SetTokenTransferFeeConfig sets the token transfer fee configuration for the OnRamp +func (onRamp *OnRamp) SetTokenTransferFeeConfig(tokenTransferFeeConfig []evm_2_evm_onramp.EVM2EVMOnRampTokenTransferFeeConfigArgs) error { + opts, err := onRamp.client.TransactionOpts(onRamp.client.GetDefaultWallet()) + if err != nil { + return fmt.Errorf("failed to get transaction opts: %w", err) + } + for i := range tokenTransferFeeConfig { + if tokenTransferFeeConfig[i].DestBytesOverhead == 0 { + tokenTransferFeeConfig[i].DestBytesOverhead = defaultDestByteOverhead + } + if tokenTransferFeeConfig[i].DestGasOverhead == 0 { + tokenTransferFeeConfig[i].DestGasOverhead = defaultDestGasOverhead + } + } + tx, err := onRamp.Instance.SetTokenTransferFeeConfig(opts, tokenTransferFeeConfig, []common.Address{}) + if err != nil { + return fmt.Errorf("failed to set token transfer fee config: %w", err) + } + onRamp.logger.Info(). + Interface("tokenTransferFeeConfig", tokenTransferFeeConfig). + Str("onRamp", onRamp.Address()). + Str(Network, onRamp.client.GetNetworkConfig().Name). + Msg("TokenTransferFeeConfig set in OnRamp") + return onRamp.client.ProcessTransaction(tx) +} + +func (onRamp *OnRamp) PayNops() error { + opts, err := onRamp.client.TransactionOpts(onRamp.client.GetDefaultWallet()) + if err != nil { + return fmt.Errorf("failed to get transaction opts: %w", err) + } + tx, err := onRamp.Instance.PayNops(opts) + if err != nil { + return fmt.Errorf("failed to pay nops: %w", err) + } + return onRamp.client.ProcessTransaction(tx) +} + +func (onRamp *OnRamp) WithdrawNonLinkFees(wrappedNative common.Address) error { + opts, err := onRamp.client.TransactionOpts(onRamp.client.GetDefaultWallet()) + if err != nil { + return fmt.Errorf("failed to get transaction opts: %w", err) + } + owner := common.HexToAddress(onRamp.client.GetDefaultWallet().Address()) + tx, err := onRamp.Instance.WithdrawNonLinkFees(opts, wrappedNative, owner) + if err != nil { + return fmt.Errorf("failed to withdraw non link fees: %w", err) + } + return onRamp.client.ProcessTransaction(tx) +} + +// SetRateLimit sets the Aggregate Rate Limit (ARL) values for the OnRamp +func (onRamp *OnRamp) SetRateLimit(rlConfig evm_2_evm_onramp.RateLimiterConfig) error { + opts, err := onRamp.client.TransactionOpts(onRamp.client.GetDefaultWallet()) + if err != nil { + return err + } + tx, err := onRamp.Instance.SetRateLimiterConfig(opts, rlConfig) + if err != nil { + return fmt.Errorf("failed to set rate limit: %w", err) + } + onRamp.logger.Info(). + Bool("Enabled", rlConfig.IsEnabled). + Str("capacity", rlConfig.Capacity.String()). + Str("rate", rlConfig.Rate.String()). + Str("onRamp", onRamp.Address()). + Str(Network, onRamp.client.GetNetworkConfig().Name). + Msg("Setting Rate limit in OnRamp") + return onRamp.client.ProcessTransaction(tx) +} + +func (onRamp *OnRamp) ApplyPoolUpdates(tokens []common.Address, pools []common.Address) error { + // if the latest version is used, no need to apply pool updates + if onRamp.Instance.Latest != nil { + return nil + } + opts, err := onRamp.client.TransactionOpts(onRamp.client.GetDefaultWallet()) + if err != nil { + return fmt.Errorf("failed to get transaction opts: %w", err) + } + tx, err := onRamp.Instance.ApplyPoolUpdates(opts, tokens, pools) + if err != nil { + return fmt.Errorf("failed to apply pool updates: %w", err) + } + onRamp.logger.Info(). + Interface("tokens", tokens). + Interface("pools", pools). + Str("onRamp", onRamp.Address()). + Str(Network, onRamp.client.GetNetworkConfig().Name). + Msg("poolUpdates set in OnRamp") + return onRamp.client.ProcessTransaction(tx) +} + +// OffRamp represents the OffRamp CCIP contract on the destination chain +type OffRamp struct { + client blockchain.EVMClient + logger *zerolog.Logger + Instance *OffRampWrapper + EthAddress common.Address +} + +func (offRamp *OffRamp) Address() string { + return offRamp.EthAddress.Hex() +} + +// WatchExecutionStateChanged returns a subscription to watch for ExecutionStateChanged events +// there is no difference in the event between the two versions +// so we can use the latest version to watch for events +func (offRamp *OffRamp) WatchExecutionStateChanged( + opts *bind.WatchOpts, + execEvent chan *evm_2_evm_offramp.EVM2EVMOffRampExecutionStateChanged, + sequenceNumber []uint64, + messageId [][32]byte, +) (event.Subscription, error) { + if offRamp.Instance.Latest != nil { + return offRamp.Instance.Latest.WatchExecutionStateChanged(opts, execEvent, sequenceNumber, messageId) + } + if offRamp.Instance.V1_2_0 != nil { + newOffRamp, err := evm_2_evm_offramp.NewEVM2EVMOffRamp(offRamp.EthAddress, wrappers.MustNewWrappedContractBackend(offRamp.client, nil)) + if err != nil { + return nil, fmt.Errorf("failed to cast to latest version of OffRamp from v1_2_0: %w", err) + } + return newOffRamp.WatchExecutionStateChanged(opts, execEvent, sequenceNumber, messageId) + } + return nil, fmt.Errorf("no instance found to watch for ExecutionStateChanged") +} + +// SetOCR2Config sets the offchain reporting protocol configuration +func (offRamp *OffRamp) SetOCR2Config( + signers []common.Address, + transmitters []common.Address, + f uint8, + onchainConfig []byte, + offchainConfigVersion uint64, + offchainConfig []byte, +) error { + offRamp.logger.Info().Str("Contract Address", offRamp.Address()).Msg("Configuring OffRamp Contract") + // Set Config + opts, err := offRamp.client.TransactionOpts(offRamp.client.GetDefaultWallet()) + if err != nil { + return fmt.Errorf("failed to get transaction options: %w", err) + } + offRamp.logger.Debug(). + Interface("SignerAddresses", signers). + Interface("TransmitterAddresses", transmitters). + Str(Network, offRamp.client.GetNetworkConfig().Name). + Msg("Configuring OffRamp") + if offRamp.Instance.Latest != nil { + tx, err := offRamp.Instance.Latest.SetOCR2Config( + opts, + signers, + transmitters, + f, + onchainConfig, + offchainConfigVersion, + offchainConfig, + ) + if err != nil { + return fmt.Errorf("failed to set latest OCR2 config: %w", err) + } + return offRamp.client.ProcessTransaction(tx) + } + if offRamp.Instance.V1_2_0 != nil { + tx, err := offRamp.Instance.V1_2_0.SetOCR2Config( + opts, + signers, + transmitters, + f, + onchainConfig, + offchainConfigVersion, + offchainConfig, + ) + if err != nil { + return fmt.Errorf("failed to set 1.2 OCR2 config: %w", err) + } + return offRamp.client.ProcessTransaction(tx) + } + return fmt.Errorf("no instance found to set OCR2 config") +} + +// AddRateLimitTokens adds token pairs to the OffRamp's rate limit +func (offRamp *OffRamp) AddRateLimitTokens(sourceTokens, destTokens []common.Address) error { + if offRamp.Instance.V1_2_0 != nil { + return nil + } + + if len(sourceTokens) != len(destTokens) { + return fmt.Errorf("source and dest tokens must be of the same length") + } + opts, err := offRamp.client.TransactionOpts(offRamp.client.GetDefaultWallet()) + if err != nil { + return fmt.Errorf("failed to get transaction opts: %w", err) + } + + if offRamp.Instance.Latest != nil { + rateLimitTokens := make([]evm_2_evm_offramp.EVM2EVMOffRampRateLimitToken, len(sourceTokens)) + for i, sourceToken := range sourceTokens { + rateLimitTokens[i] = evm_2_evm_offramp.EVM2EVMOffRampRateLimitToken{ + SourceToken: sourceToken, + DestToken: destTokens[i], + } + } + + tx, err := offRamp.Instance.Latest.UpdateRateLimitTokens(opts, []evm_2_evm_offramp.EVM2EVMOffRampRateLimitToken{}, rateLimitTokens) + if err != nil { + return fmt.Errorf("failed to apply rate limit tokens updates: %w", err) + } + offRamp.logger.Info(). + Interface("rateLimitToken adds", rateLimitTokens). + Str("offRamp", offRamp.Address()). + Str(Network, offRamp.client.GetNetworkConfig().Name). + Msg("rateLimitTokens set in OffRamp") + return offRamp.client.ProcessTransaction(tx) + } + return fmt.Errorf("no supported OffRamp version instance found") +} + +// RemoveRateLimitTokens removes token pairs to the OffRamp's rate limit. +// If you ask to remove a token pair that doesn't exist, it will return an error. +func (offRamp *OffRamp) RemoveRateLimitTokens(ctx context.Context, sourceTokens, destTokens []common.Address) error { + callOpts := &bind.CallOpts{ + From: common.HexToAddress(offRamp.client.GetDefaultWallet().Address()), + Context: ctx, + } + + switch { + case offRamp.Instance.Latest != nil: + existingRateLimitTokens, err := offRamp.Instance.Latest.GetAllRateLimitTokens(callOpts) + if err != nil { + return fmt.Errorf("failed to get all rate limit tokens: %w", err) + } + + rateLimitTokens := make([]evm_2_evm_offramp.EVM2EVMOffRampRateLimitToken, len(sourceTokens)) + for i, sourceToken := range sourceTokens { + destToken := destTokens[i] + // Check if the source rate limit token exists + foundIndex := -1 + for j, existingSourceToken := range existingRateLimitTokens.SourceTokens { + if existingSourceToken == sourceToken { + foundIndex = j + break + } + } + if foundIndex == -1 { + return fmt.Errorf("source rate limit token not found for pair: %s -> %s", sourceTokens[i].Hex(), destTokens[i].Hex()) + } + // Check if the matching dest rate limit token exists + if existingRateLimitTokens.DestTokens[foundIndex] != destToken { + return fmt.Errorf("dest rate limit token not found for pair: %s -> %s", sourceTokens[i].Hex(), destTokens[i].Hex()) + } + // Update the existing rate limit tokens to remove the pair for visibility + existingRateLimitTokens.SourceTokens = append(existingRateLimitTokens.SourceTokens[:foundIndex], existingRateLimitTokens.SourceTokens[foundIndex+1:]...) + existingRateLimitTokens.DestTokens = append(existingRateLimitTokens.DestTokens[:foundIndex], existingRateLimitTokens.DestTokens[foundIndex+1:]...) + + rateLimitTokens[i] = evm_2_evm_offramp.EVM2EVMOffRampRateLimitToken{ + SourceToken: sourceToken, + DestToken: destToken, + } + } + + opts, err := offRamp.client.TransactionOpts(offRamp.client.GetDefaultWallet()) + if err != nil { + return fmt.Errorf("failed to get transaction opts: %w", err) + } + tx, err := offRamp.Instance.Latest.UpdateRateLimitTokens(opts, rateLimitTokens, []evm_2_evm_offramp.EVM2EVMOffRampRateLimitToken{}) + if err != nil { + return fmt.Errorf("failed to remove rate limit tokens: %w", err) + } + offRamp.logger.Info(). + Interface("RateLimitTokens Remaining", existingRateLimitTokens). + Interface("RateLimitTokens Removed", rateLimitTokens). + Str("OffRamp", offRamp.Address()). + Str(Network, offRamp.client.GetNetworkConfig().Name). + Msg("RateLimitTokens Removed from OffRamp") + return offRamp.client.ProcessTransaction(tx) + case offRamp.Instance.V1_2_0 != nil: + return nil + } + return fmt.Errorf("no supported OffRamp version instance found") +} + +// RemoveAllRateLimitTokens removes all token pairs from the OffRamp's rate limit. +func (offRamp *OffRamp) RemoveAllRateLimitTokens(ctx context.Context) error { + callOpts := &bind.CallOpts{ + From: common.HexToAddress(offRamp.client.GetDefaultWallet().Address()), + Context: ctx, + } + + switch { + case offRamp.Instance.Latest != nil: + allRateLimitTokens, err := offRamp.Instance.Latest.GetAllRateLimitTokens(callOpts) + if err != nil { + return fmt.Errorf("failed to get all rate limit tokens: %w", err) + } + + rateLimitTokens := make([]evm_2_evm_offramp.EVM2EVMOffRampRateLimitToken, len(allRateLimitTokens.SourceTokens)) + for i, sourceToken := range allRateLimitTokens.SourceTokens { + rateLimitTokens[i] = evm_2_evm_offramp.EVM2EVMOffRampRateLimitToken{ + SourceToken: sourceToken, + DestToken: allRateLimitTokens.DestTokens[i], + } + } + + opts, err := offRamp.client.TransactionOpts(offRamp.client.GetDefaultWallet()) + if err != nil { + return fmt.Errorf("failed to get transaction opts: %w", err) + } + tx, err := offRamp.Instance.Latest.UpdateRateLimitTokens(opts, rateLimitTokens, []evm_2_evm_offramp.EVM2EVMOffRampRateLimitToken{}) + if err != nil { + return fmt.Errorf("failed to remove rate limit tokens: %w", err) + } + offRamp.logger.Info(). + Interface("RateLimitTokens Removed", rateLimitTokens). + Str("OffRamp", offRamp.Address()). + Str(Network, offRamp.client.GetNetworkConfig().Name). + Msg("Removed all RateLimitTokens from OffRamp") + return offRamp.client.ProcessTransaction(tx) + case offRamp.Instance.V1_2_0 != nil: + return nil + } + return fmt.Errorf("no supported OffRamp version instance found") +} + +// SetRateLimit sets the Aggregate Rate Limit (ARL) values for the OffRamp +func (offRamp *OffRamp) SetRateLimit(rlConfig RateLimiterConfig) error { + opts, err := offRamp.client.TransactionOpts(offRamp.client.GetDefaultWallet()) + if err != nil { + return err + } + offRamp.logger.Info(). + Bool("Enabled", rlConfig.IsEnabled). + Str("Capacity", rlConfig.Capacity.String()). + Str("Rate", rlConfig.Rate.String()). + Str("OffRamp", offRamp.Address()). + Str(Network, offRamp.client.GetNetworkConfig().Name). + Msg("Setting Rate limit on OffRamp") + + switch { + case offRamp.Instance.Latest != nil: + tx, err := offRamp.Instance.Latest.SetRateLimiterConfig(opts, evm_2_evm_offramp.RateLimiterConfig{ + IsEnabled: rlConfig.IsEnabled, + Capacity: rlConfig.Capacity, + Rate: rlConfig.Rate, + }) + if err != nil { + return fmt.Errorf("failed to set rate limit: %w", err) + } + return offRamp.client.ProcessTransaction(tx) + case offRamp.Instance.V1_2_0 != nil: + tx, err := offRamp.Instance.V1_2_0.SetRateLimiterConfig(opts, evm_2_evm_offramp_1_2_0.RateLimiterConfig{ + IsEnabled: rlConfig.IsEnabled, + Capacity: rlConfig.Capacity, + Rate: rlConfig.Rate, + }) + if err != nil { + return fmt.Errorf("failed to set rate limit: %w", err) + } + return offRamp.client.ProcessTransaction(tx) + } + return fmt.Errorf("no supported OffRamp version instance found") +} + +func (offRamp *OffRamp) SyncTokensAndPools(sourceTokens, pools []common.Address) error { + if offRamp.Instance.Latest != nil { + return nil + } + opts, err := offRamp.client.TransactionOpts(offRamp.client.GetDefaultWallet()) + if err != nil { + return fmt.Errorf("failed to get transaction opts: %w", err) + } + if offRamp.Instance.V1_2_0 != nil { + var tokenUpdates []evm_2_evm_offramp_1_2_0.InternalPoolUpdate + for i, srcToken := range sourceTokens { + tokenUpdates = append(tokenUpdates, evm_2_evm_offramp_1_2_0.InternalPoolUpdate{ + Token: srcToken, + Pool: pools[i], + }) + } + tx, err := offRamp.Instance.V1_2_0.ApplyPoolUpdates(opts, []evm_2_evm_offramp_1_2_0.InternalPoolUpdate{}, tokenUpdates) + if err != nil { + return fmt.Errorf("failed to apply pool updates: %w", err) + } + offRamp.logger.Info(). + Interface("tokenUpdates", tokenUpdates). + Str("offRamp", offRamp.Address()). + Str(Network, offRamp.client.GetNetworkConfig().Name). + Msg("tokenUpdates set in OffRamp") + return offRamp.client.ProcessTransaction(tx) + } + return fmt.Errorf("no instance found to sync tokens and pools") +} + +// OffRampWrapper wraps multiple versions of the OffRamp contract as we support multiple at once. +// If you are using any of the functions in this struct, be sure to follow best practices: +// 1. If the function does not make sense for a specific version, +// (e.g. crucial functionality that changes state, but doesn't exist yet) return an error. +// 2. If the function does not make sense for a specific version, but calling it doesn't change how execution would work +// (e.g. functionality that wouldn't change state), you can return a nil or default value, treating it as a no-op. +// 3. If no valid versions are available, return an error. +// +// See CurrentRateLimiterState, WatchExecutionStateChanged, and AddRateLimitTokens for examples. +type OffRampWrapper struct { + Latest *evm_2_evm_offramp.EVM2EVMOffRamp + V1_2_0 *evm_2_evm_offramp_1_2_0.EVM2EVMOffRamp +} + +// CurrentRateLimiterState retrieves the current rate limiter state for the OffRamp contract +func (offRamp *OffRampWrapper) CurrentRateLimiterState(opts *bind.CallOpts) (RateLimiterConfig, error) { + if offRamp.Latest != nil { + rlConfig, err := offRamp.Latest.CurrentRateLimiterState(opts) + if err != nil { + return RateLimiterConfig{}, err + } + return RateLimiterConfig{ + IsEnabled: rlConfig.IsEnabled, + Capacity: rlConfig.Capacity, + Rate: rlConfig.Rate, + }, nil + } + if offRamp.V1_2_0 != nil { + rlConfig, err := offRamp.V1_2_0.CurrentRateLimiterState(opts) + if err != nil { + return RateLimiterConfig{}, err + } + return RateLimiterConfig{ + IsEnabled: rlConfig.IsEnabled, + Capacity: rlConfig.Capacity, + Rate: rlConfig.Rate, + }, nil + } + return RateLimiterConfig{}, fmt.Errorf("no instance found to get rate limiter state") +} + +type EVM2EVMOffRampExecutionStateChanged struct { + SequenceNumber uint64 + MessageId [32]byte + State uint8 + ReturnData []byte + LogInfo LogInfo +} + +type MockAggregator struct { + client blockchain.EVMClient + logger *zerolog.Logger + Instance *mock_v3_aggregator_contract.MockV3Aggregator + ContractAddress common.Address + RoundId *big.Int + Answer *big.Int +} + +func (a *MockAggregator) ChainID() uint64 { + return a.client.GetChainID().Uint64() +} + +// UpdateRoundData updates the round data in the aggregator contract +// if answer is nil, it will set next round data by adding random percentage( within provided range) to the previous round data +func (a *MockAggregator) UpdateRoundData(answer *big.Int, minP, maxP *int) error { + if answer == nil && (minP == nil || maxP == nil) { + return fmt.Errorf("minP and maxP are required to update round data with random percentage if answer is nil") + } + // if round id is nil, set it to 1 + if a.RoundId == nil { + a.RoundId = big.NewInt(1) + } + // if there is no answer provided and last saved answer is nil + // we fetch the last round data from chain + // and set the answer to the aggregator's latest answer and round id to the aggregator's latest round id + if answer == nil && a.Answer == nil { + roundData, err := a.Instance.LatestRoundData(nil) + if err != nil || roundData.RoundId == nil || roundData.Answer == nil { + return fmt.Errorf("unable to get latest round data: %w", err) + } + a.Answer = roundData.Answer + a.RoundId = roundData.RoundId + } + + // if answer is nil, we calculate the answer with random percentage (within the provided range) of latest answer + if answer == nil { + rand.Seed(uint64(time.Now().UnixNano())) + randomNumber := rand.Intn(pointer.GetInt(maxP)-pointer.GetInt(minP)+1) + pointer.GetInt(minP) + // answer = previous round answer + (previous round answer * random percentage) + answer = new(big.Int).Add(a.Answer, new(big.Int).Div(new(big.Int).Mul(a.Answer, big.NewInt(int64(randomNumber))), big.NewInt(100))) + } + // increment the round id + round := new(big.Int).Add(a.RoundId, big.NewInt(1)) + // save the round data as the latest round data + a.RoundId = round + a.Answer = answer + opts, err := a.client.TransactionOpts(a.client.GetDefaultWallet()) + if err != nil { + return fmt.Errorf("unable to get transaction opts: %w", err) + } + a.logger.Info(). + Str("Contract Address", a.ContractAddress.Hex()). + Str("Network Name", a.client.GetNetworkConfig().Name). + Msg("Updating Round Data") + tx, err := a.Instance.UpdateRoundData(opts, round, answer, big.NewInt(time.Now().UTC().UnixNano()), big.NewInt(time.Now().UTC().UnixNano())) + if err != nil { + return fmt.Errorf("unable to update round data: %w", err) + } + a.logger.Info(). + Str("Contract Address", a.ContractAddress.Hex()). + Str("Network Name", a.client.GetNetworkConfig().Name). + Str("Round", round.String()). + Str("Answer", answer.String()). + Msg("Updated Round Data") + ctx, cancel := context.WithTimeout(context.Background(), a.client.GetNetworkConfig().Timeout.Duration) + defer cancel() + rec, err := bind.WaitMined(ctx, a.client.DeployBackend(), tx) + if err != nil { + return fmt.Errorf("error waiting for tx %s to be mined", tx.Hash().Hex()) + } + if rec.Status != types.ReceiptStatusSuccessful { + return fmt.Errorf("tx %s failed while updating round data", tx.Hash().Hex()) + } + + return a.client.MarkTxAsSentOnL2(tx) +} diff --git a/integration-tests/ccip-tests/contracts/laneconfig/contracts-1.2.json b/integration-tests/ccip-tests/contracts/laneconfig/contracts-1.2.json new file mode 100644 index 00000000000..4de4d1e504d --- /dev/null +++ b/integration-tests/ccip-tests/contracts/laneconfig/contracts-1.2.json @@ -0,0 +1,634 @@ +{ + "lane_configs": { + "Arbitrum Mainnet": { + "is_native_fee_token": true, + "fee_token": "0xf97f4df75117a78c1A5a0DBb814Af92458539FB4", + "bridge_tokens": [], + "bridge_tokens_pools": [], + "arm": "0xe06b0e8c4bd455153e8794ad7Ea8Ff5A14B64E4b", + "router": "0x141fa059441E0ca23ce184B6A78bafD2A517DdE8", + "price_registry": "0x13015e4E6f839E1Aa1016DF521ea458ecA20438c", + "wrapped_native": "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1", + "src_contracts": { + "Avalanche Mainnet": { + "on_ramp": "0x05B723f3db92430FbE4395fD03E40Cc7e9D17988", + "deployed_at": 11111111 + }, + "Base Mainnet": { + "on_ramp": "0x77b60F85b25fD501E3ddED6C1fe7bF565C08A22A", + "deployed_at": 11111111 + }, + "BSC Mainnet": { + "on_ramp": "0x79f3ABeCe5A3AFFf32D47F4CFe45e7b65c9a2D91", + "deployed_at": 11111111 + }, + "Ethereum Mainnet": { + "on_ramp": "0xCe11020D56e5FDbfE46D9FC3021641FfbBB5AdEE", + "deployed_at": 11111111 + }, + "Optimism Mainnet": { + "on_ramp": "0xC09b72E8128620C40D89649019d995Cc79f030C3", + "deployed_at": 11111111 + }, + "Polygon Mainnet": { + "on_ramp": "0x122F05F49e90508F089eE8D0d868d1a4f3E5a809", + "deployed_at": 11111111 + }, + "WeMix Mainnet": { + "on_ramp": "0x66a0046ac9FA104eB38B04cfF391CcD0122E6FbC", + "deployed_at": 11111111 + } + }, + "dest_contracts": { + "Avalanche Mainnet": { + "off_ramp": "0xe0109912157d5B75ea8b3181123Cf32c73bc9920", + "commit_store": "0xDaa61b8Cd85977820f92d1e749E1D9F55Da6CCEA", + "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" + }, + "Base Mainnet": { + "off_ramp": "0xdB19F77F87661f9be0F557cf9a1ebeCf7D8F206c", + "commit_store": "0x6e37f4c82d9A31cc42B445874dd3c3De97AB553f", + "receiver_dapp": "0xAFa2c441a83bBCEDc2E8c5c6f66248aFD8b9af3d" + }, + "BSC Mainnet": { + "off_ramp": "0xB1b705c2315fced1B38baE463BE7DDef531e47fA", + "commit_store": "0x310cECbFf14Ad0307EfF762F461a487C1abb90bf", + "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" + }, + "Ethereum Mainnet": { + "off_ramp": "0x542ba1902044069330e8c5b36A84EC503863722f", + "commit_store": "0x060331fEdA35691e54876D957B4F9e3b8Cb47d20", + "receiver_dapp": "0xAFa2c441a83bBCEDc2E8c5c6f66248aFD8b9af3d" + }, + "Optimism Mainnet": { + "off_ramp": "0xeeed4D86F3E0e6d32A6Ad29d8De6A0Dc91963A5f", + "commit_store": "0xbbB563c4d98020b9c0f3Cc34c2C0Ef9676806E35", + "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" + }, + "Polygon Mainnet": { + "off_ramp": "0x9bDA7c8DCda4E39aFeB483cc0B7E3C1f6E0D5AB1", + "commit_store": "0x63a0AeaadAe851b990bBD9dc41f5C1B08b32026d", + "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" + }, + "WeMix Mainnet": { + "off_ramp": "0xEEf5Fb4c4953F9cA9ab1f25cE590776AfFc2c455", + "commit_store": "0xD268286A277095a9C3C90205110831a84505881c", + "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" + } + } + }, + "Avalanche Mainnet": { + "is_native_fee_token": true, + "fee_token": "0x5947BB275c521040051D82396192181b413227A3", + "bridge_tokens": [], + "bridge_tokens_pools": [], + "arm": "0xdFD6C0dc67666DE3bB36b31eec5c7B1542A82C1E", + "router": "0xF4c7E640EdA248ef95972845a62bdC74237805dB", + "price_registry": "0xfA4edD04eaAcDB07c8D73621bc1790eC50D8c489", + "wrapped_native": "0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7", + "src_contracts": { + "Arbitrum Mainnet": { + "on_ramp": "0x98f51B041e493fc4d72B8BD33218480bA0c66DDF", + "deployed_at": 11111111 + }, + "Base Mainnet": { + "on_ramp": "0x268fb4311D2c6CB2bbA01CCA9AC073Fb3bfd1C7c", + "deployed_at": 11111111 + }, + "BSC Mainnet": { + "on_ramp": "0x8eaae6462816CB4957184c48B86afA7642D8Bf2B", + "deployed_at": 11111111 + }, + "Ethereum Mainnet": { + "on_ramp": "0xD0701FcC7818c31935331B02Eb21e91eC71a1704", + "deployed_at": 11111111 + }, + "Optimism Mainnet": { + "on_ramp": "0x8629008887E073260c5434D6CaCFc83C3001d211", + "deployed_at": 11111111 + }, + "Polygon Mainnet": { + "on_ramp": "0x97500490d9126f34cf9aA0126d64623E170319Ef", + "deployed_at": 11111111 + }, + "WeMix Mainnet": { + "on_ramp": "0x9b1ed9De069Be4d50957464b359f98eD0Bf34dd5", + "deployed_at": 11111111 + } + }, + "dest_contracts": { + "Arbitrum Mainnet": { + "off_ramp": "0x770b1375F86E7a9bf30DBe3F97bea67193dC9135", + "commit_store": "0x23E2b34Ce8e12c53f8a39AD4b3FFCa845f8E617C", + "receiver_dapp": "0xAFa2c441a83bBCEDc2E8c5c6f66248aFD8b9af3d" + }, + "Base Mainnet": { + "off_ramp": "0x4d6A796Bc85dcDF41ce9AaEB50B094C6b589748f", + "commit_store": "0xc4C4358FA01a04D6c6FE3b96a351946d4c2715C2", + "receiver_dapp": "0xAFa2c441a83bBCEDc2E8c5c6f66248aFD8b9af3d" + }, + "BSC Mainnet": { + "off_ramp": "0x83F53Fc798FEbfFbdF84830AD403b9989187a06C", + "commit_store": "0xD8ceCE2D7794385E00Ce3EF94550E732b0A0B959", + "receiver_dapp": "0xAFa2c441a83bBCEDc2E8c5c6f66248aFD8b9af3d" + }, + "Ethereum Mainnet": { + "off_ramp": "0x5B833BD6456c604Eb396C0fBa477aD49e82B1A2a", + "commit_store": "0x23E23958D220B774680f91c2c91a6f2B2f610d7e", + "receiver_dapp": "0xAFa2c441a83bBCEDc2E8c5c6f66248aFD8b9af3d" + }, + "Optimism Mainnet": { + "off_ramp": "0xb68A3EE8bD0A09eE221cf1859Dd5a4d5765188Fe", + "commit_store": "0x83DCeeCf822981F9F8552925eEfd88CAc1905dEA", + "receiver_dapp": "0xAFa2c441a83bBCEDc2E8c5c6f66248aFD8b9af3d" + }, + "Polygon Mainnet": { + "off_ramp": "0x19250aBE66B88F214d02B6f3BF80F4118290C619", + "commit_store": "0x87A0935cE6254dB1252bBac90d1D07D04846aDCA", + "receiver_dapp": "0xAFa2c441a83bBCEDc2E8c5c6f66248aFD8b9af3d" + }, + "WeMix Mainnet": { + "off_ramp": "0x317dE8bc5c3292E494b6496586696d4966A922B0", + "commit_store": "0x97Fbf3d6DEac16adC721aE9187CeEa1e610aC7Af", + "receiver_dapp": "0xAFa2c441a83bBCEDc2E8c5c6f66248aFD8b9af3d" + } + } + }, + "Base Mainnet": { + "is_native_fee_token": true, + "fee_token": "0x88Fb150BDc53A65fe94Dea0c9BA0a6dAf8C6e196", + "bridge_tokens": [], + "bridge_tokens_pools": [], + "arm": "0x38660c8CC222c0192b635c2ac09687B4F25cCE5F", + "router": "0x881e3A65B4d4a04dD529061dd0071cf975F58bCD", + "price_registry": "0x6337a58D4BD7Ba691B66341779e8f87d4679923a", + "wrapped_native": "0x4200000000000000000000000000000000000006", + "src_contracts": { + "Arbitrum Mainnet": { + "on_ramp": "0x1E5Ca70d1e7A1B26061125738a880BBeA42FeB21", + "deployed_at": 11111111 + }, + "Avalanche Mainnet": { + "on_ramp": "0xBE5a9E336D9614024B4Fa10D8112671fc9A42d96", + "deployed_at": 11111111 + }, + "BSC Mainnet": { + "on_ramp": "0xdd4Fb402d41Beb0eEeF6CfB1bf445f50bDC8c981", + "deployed_at": 11111111 + }, + "Ethereum Mainnet": { + "on_ramp": "0xDEA286dc0E01Cb4755650A6CF8d1076b454eA1cb", + "deployed_at": 11111111 + }, + "Optimism Mainnet": { + "on_ramp": "0xd952FEAcDd5919Cc5E9454b53bF45d4E73dD6457", + "deployed_at": 11111111 + }, + "Polygon Mainnet": { + "on_ramp": "0x3DB8Bea142e41cA3633890d0e5640F99a895D6A5", + "deployed_at": 11111111 + } + }, + "dest_contracts": { + "Arbitrum Mainnet": { + "off_ramp": "0x8531E63aE9279a1f0D09eba566CD1b092b95f3D5", + "commit_store": "0x327E13f54c7871a2416006B33B4822eAAD357916", + "receiver_dapp": "0xAFa2c441a83bBCEDc2E8c5c6f66248aFD8b9af3d" + }, + "Avalanche Mainnet": { + "off_ramp": "0x8345F2fF67e5A65e85dc955DE1414832608E00aD", + "commit_store": "0xd0b13be4c53A6262b47C5DDd36F0257aa714F562", + "receiver_dapp": "0xAFa2c441a83bBCEDc2E8c5c6f66248aFD8b9af3d" + }, + "BSC Mainnet": { + "off_ramp": "0x48a51f5D38BE630Ddd6417Ea2D9052B8efc91a18", + "commit_store": "0xF97127e77252284EC9D4bc13C247c9D1A99F72B0", + "receiver_dapp": "0xAFa2c441a83bBCEDc2E8c5c6f66248aFD8b9af3d" + }, + "Ethereum Mainnet": { + "off_ramp": "0xEC0cFe335a4d53dBA70CB650Ab56eEc32788F0BB", + "commit_store": "0x0ae3c2c7FB789bd05A450CD3075D11f6c2Ca4F77", + "receiver_dapp": "0xAFa2c441a83bBCEDc2E8c5c6f66248aFD8b9af3d" + }, + "Optimism Mainnet": { + "off_ramp": "0xf50c0d2a8B6Db60f1D93E60f03d0413D56153E4F", + "commit_store": "0x16f72C15165f7C9d74c12fDF188E399d4d3724e4", + "receiver_dapp": "0xAFa2c441a83bBCEDc2E8c5c6f66248aFD8b9af3d" + }, + "Polygon Mainnet": { + "off_ramp": "0x75F29f058b31106F99caFdc17c9b26ADfcC7b5D7", + "commit_store": "0xb719616E732581B570232DfB13Ca49D27667Af9f", + "receiver_dapp": "0xAFa2c441a83bBCEDc2E8c5c6f66248aFD8b9af3d" + } + } + }, + "BSC Mainnet": { + "is_native_fee_token": true, + "fee_token": "0x404460C6A5EdE2D891e8297795264fDe62ADBB75", + "bridge_tokens": [], + "bridge_tokens_pools": [], + "arm": "0x3DB43b96B2625F4232e9Df900d464dd2c64C0021", + "router": "0x34B03Cb9086d7D758AC55af71584F81A598759FE", + "price_registry": "0xd64aAbD70A71d9f0A00B99F6EFc1626aA2dD43C7", + "wrapped_native": "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c", + "src_contracts": { + "Avalanche Mainnet": { + "on_ramp": "0x6aa72a998859eF93356c6521B72155D355D0Cfd2", + "deployed_at": 11111111 + }, + "Arbitrum Mainnet": { + "on_ramp": "0x2788b46BAcFF49BD89562e6bA5c5FBbbE5Fa92F7", + "deployed_at": 11111111 + }, + "Base Mainnet": { + "on_ramp": "0x70bC7f7a6D936b289bBF5c0E19ECE35B437E2e36", + "deployed_at": 11111111 + }, + "Ethereum Mainnet": { + "on_ramp": "0x0Bf40b034872D0b364f3DCec04C7434a4Da1C8d9", + "deployed_at": 11111111 + }, + "Optimism Mainnet": { + "on_ramp": "0x4FEB11A454C9E8038A8d0aDF599Fe7612ce114bA", + "deployed_at": 11111111 + }, + "Polygon Mainnet": { + "on_ramp": "0x6bD4754D86fc87FE5b463D368f26a3587a08347c", + "deployed_at": 11111111 + }, + "WeMix Mainnet": { + "on_ramp": "0x1467fF8f249f5bc604119Af26a47035886f856BE", + "deployed_at": 11111111 + } + }, + "dest_contracts": { + "Avalanche Mainnet": { + "off_ramp": "0x37a6fa55fe61061Ae97bF7314Ae270eCF71c5ED3", + "commit_store": "0x1f558F6dcf0224Ef1F78A24814FED548B9602c80", + "receiver_dapp": "0xAFa2c441a83bBCEDc2E8c5c6f66248aFD8b9af3d" + }, + "Arbitrum Mainnet": { + "off_ramp": "0x3DA330fd8Ef10d93cFB7D4f8ecE7BC1F10811feC", + "commit_store": "0x86D55Ff492cfBBAf0c0D42D4EE615144E78b3D02", + "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" + }, + "Base Mainnet": { + "off_ramp": "0x574c697deab06B805D8780898B3F136a1F4892Dc", + "commit_store": "0x002B164b1dcf4E92F352DC625A01Be0E890EdEea", + "receiver_dapp": "0xAFa2c441a83bBCEDc2E8c5c6f66248aFD8b9af3d" + }, + "Ethereum Mainnet": { + "off_ramp": "0x181Bb1E97b0bDD1D85E741ad0943552D3682cc35", + "commit_store": "0x3fF27A34fF0FA77921C3438e67f58da1a83e9Ce1", + "receiver_dapp": "0xAFa2c441a83bBCEDc2E8c5c6f66248aFD8b9af3d" + }, + "Optimism Mainnet": { + "off_ramp": "0xE7E080C8d62d595a223C577C7C8d1f75d9A5E664", + "commit_store": "0xF4d53346bDb6d393C74B0B72Aa7D6689a3eAad79", + "receiver_dapp": "0xAFa2c441a83bBCEDc2E8c5c6f66248aFD8b9af3d" + }, + "Polygon Mainnet": { + "off_ramp": "0x26af2046Da85d7f6712D5edCa81B9E3b2e7A60Ab", + "commit_store": "0x4C1dA405a789AC2853A69D8290B8B9b47a0374F8", + "receiver_dapp": "0xAFa2c441a83bBCEDc2E8c5c6f66248aFD8b9af3d" + }, + "WeMix Mainnet": { + "off_ramp": "0xC027C5AEb230008c243Be463A73571e581F94c13", + "commit_store": "0x2EB426C8C54D740d1FC856eB3Ff96feA03957978", + "receiver_dapp": "0xAFa2c441a83bBCEDc2E8c5c6f66248aFD8b9af3d" + } + } + }, + "Ethereum Mainnet": { + "is_native_fee_token": true, + "fee_token": "0x514910771AF9Ca656af840dff83E8264EcF986CA", + "bridge_tokens": [], + "bridge_tokens_pools": [], + "arm": "0x8B63b3DE93431C0f756A493644d128134291fA1b", + "router": "0x80226fc0Ee2b096224EeAc085Bb9a8cba1146f7D", + "price_registry": "0x8c9b2Efb7c64C394119270bfecE7f54763b958Ad", + "wrapped_native": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", + "src_contracts": { + "Arbitrum Mainnet": { + "on_ramp": "0x925228D7B82d883Dde340A55Fe8e6dA56244A22C", + "deployed_at": 11111111 + }, + "Avalanche Mainnet": { + "on_ramp": "0x3df8dAe2d123081c4D5E946E655F7c109B9Dd630", + "deployed_at": 11111111 + }, + "Base Mainnet": { + "on_ramp": "0xe2c2AB221AA0b957805f229d2AA57fBE2f4dADf7", + "deployed_at": 11111111 + }, + "BSC Mainnet": { + "on_ramp": "0x91D25A56Db77aD5147437d8B83Eb563D46eBFa69", + "deployed_at": 11111111 + }, + "Optimism Mainnet": { + "on_ramp": "0x86B47d8411006874eEf8E4584BdFD7be8e5549d1", + "deployed_at": 11111111 + }, + "Polygon Mainnet": { + "on_ramp": "0x35F0ca9Be776E4B38659944c257bDd0ba75F1B8B", + "deployed_at": 11111111 + }, + "WeMix Mainnet": { + "on_ramp": "0xCbE7e5DA76dC99Ac317adF6d99137005FDA4E2C4", + "deployed_at": 11111111 + } + }, + "dest_contracts": { + "Arbitrum Mainnet": { + "off_ramp": "0xeFC4a18af59398FF23bfe7325F2401aD44286F4d", + "commit_store": "0x9B2EEd6A1e16cB50Ed4c876D2dD69468B21b7749", + "receiver_dapp": "0xAFa2c441a83bBCEDc2E8c5c6f66248aFD8b9af3d" + }, + "Avalanche Mainnet": { + "off_ramp": "0x569940e02D4425eac61A7601632eC00d69f75c17", + "commit_store": "0x2aa101BF99CaeF7fc1355D4c493a1fe187A007cE", + "receiver_dapp": "0xAFa2c441a83bBCEDc2E8c5c6f66248aFD8b9af3d" + }, + "Base Mainnet": { + "off_ramp": "0xdf85c8381954694E74abD07488f452b4c2Cddfb3", + "commit_store": "0x8DC27D621c41a32140e22E2a4dAf1259639BAe04", + "receiver_dapp": "0xAFa2c441a83bBCEDc2E8c5c6f66248aFD8b9af3d" + }, + "BSC Mainnet": { + "off_ramp": "0x7Afe7088aff57173565F4b034167643AA8b9171c", + "commit_store": "0x87c55D48DF6EF7B08153Ab079e76bFEcbb793D75", + "receiver_dapp": "0xAFa2c441a83bBCEDc2E8c5c6f66248aFD8b9af3d" + }, + "Optimism Mainnet": { + "off_ramp": "0xB095900fB91db00E6abD247A5A5AD1cee3F20BF7", + "commit_store": "0x4af4B497c998007eF83ad130318eB2b925a79dc8", + "receiver_dapp": "0xAFa2c441a83bBCEDc2E8c5c6f66248aFD8b9af3d" + }, + "Polygon Mainnet": { + "off_ramp": "0x0af338F0E314c7551bcE0EF516d46d855b0Ee395", + "commit_store": "0xD37a60E8C36E802D2E1a6321832Ee85556Beeb76", + "receiver_dapp": "0xAFa2c441a83bBCEDc2E8c5c6f66248aFD8b9af3d" + }, + "WeMix Mainnet": { + "off_ramp": "0x3a129e6C18b23d18BA9E6Aa14Dc2e79d1f91c6c5", + "commit_store": "0x31f6ab382DDeb9A316Ab61C3945a5292a50a89AB", + "receiver_dapp": "0xAFa2c441a83bBCEDc2E8c5c6f66248aFD8b9af3d" + } + } + }, + "Kroma Mainnet": { + "is_native_fee_token": true, + "fee_token": "0xC1F6f7622ad37C3f46cDF6F8AA0344ADE80BF450", + "bridge_tokens": [], + "bridge_tokens_pools": [], + "arm": "0xB59779d3364BC6d71168245f9ebb96469E5a5a98", + "router": "0xE93E8B0d1b1CEB44350C8758ed1E2799CCee31aB", + "price_registry": "0x8155B4710e7bbC90924E957104F94Afd4f95Eca2", + "wrapped_native": "0x4200000000000000000000000000000000000001", + "src_contracts": { + "WeMix Mainnet": { + "on_ramp": "0x3C5Ab46fA1dB1dECD854224654313a69bf9fcAD3", + "deployed_at": 11111111 + } + }, + "dest_contracts": { + "WeMix Mainnet": { + "off_ramp": "0x2B555774B3D1dcbcd76efb7751F3c5FbCFABC5C4", + "commit_store": "0x213124614aAf31eBCE7c612A12aac5f8aAD77DE4", + "receiver_dapp": "0xAFa2c441a83bBCEDc2E8c5c6f66248aFD8b9af3d" + } + } + }, + "Optimism Mainnet": { + "is_native_fee_token": true, + "fee_token": "0x350a791Bfc2C21F9Ed5d10980Dad2e2638ffa7f6", + "bridge_tokens": [], + "bridge_tokens_pools": [], + "arm": "0x8C7C2C3362a42308BB5c368677Ad321D11693b81", + "router": "0x3206695CaE29952f4b0c22a169725a865bc8Ce0f", + "price_registry": "0xb52545aECE8C73A97E52a146757EC15b90Ed8488", + "wrapped_native": "0x4200000000000000000000000000000000000006", + "src_contracts": { + "Arbitrum Mainnet": { + "on_ramp": "0x0C9BE7Cfd12c735E5aaE047C1dCB845d54E518C3", + "deployed_at": 11111111 + }, + "Avalanche Mainnet": { + "on_ramp": "0xD0D3E757bFBce7ae1881DDD7F6d798DDcE588445", + "deployed_at": 11111111 + }, + "Base Mainnet": { + "on_ramp": "0x0b1760A8112183303c5526C6b24569fd3A274f3B", + "deployed_at": 11111111 + }, + "BSC Mainnet": { + "on_ramp": "0xa3c9544B82846C45BE37593d5d9ACffbE61BF3A6", + "deployed_at": 11111111 + }, + "Ethereum Mainnet": { + "on_ramp": "0x55183Db1d2aE0b63e4c92A64bEF2CBfc2032B127", + "deployed_at": 11111111 + }, + "Polygon Mainnet": { + "on_ramp": "0x6B57145e322c877E7D91Ed8E31266eB5c02F7EfC", + "deployed_at": 11111111 + }, + "WeMix Mainnet": { + "on_ramp": "0x82e9f4C5ec4a84E310d60D462a12042E5cbA0954", + "deployed_at": 11111111 + } + }, + "dest_contracts": { + "Arbitrum Mainnet": { + "off_ramp": "0x0C9BE7Cfd12c735E5aaE047C1dCB845d54E518C3", + "commit_store": "0x55028780918330FD00a34a61D9a7Efd3f43ca845", + "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" + }, + "Avalanche Mainnet": { + "off_ramp": "0x8dc6490A6204dF846BaBE809cB695ba17Df1F9B1", + "commit_store": "0xA190660787B6B183Dd82B243eA10e609327c7308", + "receiver_dapp": "0xAFa2c441a83bBCEDc2E8c5c6f66248aFD8b9af3d" + }, + "Base Mainnet": { + "off_ramp": "0xBAE6560eCa9B77Cb047158C783e36F7735C86037", + "commit_store": "0x6168aDF58e1Ad446BaD45c6275Bef60Ef4FFBAb8", + "receiver_dapp": "0xAFa2c441a83bBCEDc2E8c5c6f66248aFD8b9af3d" + }, + "BSC Mainnet": { + "off_ramp": "0xE14501F2838F2fA1Ceb52E78ABdA289EcE1705EA", + "commit_store": "0xa8DD25B29787527Df283211C24Ac72B17150A696", + "receiver_dapp": "0xAFa2c441a83bBCEDc2E8c5c6f66248aFD8b9af3d" + }, + "Ethereum Mainnet": { + "off_ramp": "0xd2D98Be6a1C241e86C807e51cED6ABb51d044203", + "commit_store": "0x4d75A5cE454b264b187BeE9e189aF1564a68408D", + "receiver_dapp": "0xAFa2c441a83bBCEDc2E8c5c6f66248aFD8b9af3d" + }, + "Polygon Mainnet": { + "off_ramp": "0x7c6221880A1D62506b1A08Dab3Bf695A49AcDD22", + "commit_store": "0x0684076EE3595221861C50cDb9Cb66402Ec11Cb9", + "receiver_dapp": "0xAFa2c441a83bBCEDc2E8c5c6f66248aFD8b9af3d" + }, + "WeMix Mainnet": { + "off_ramp": "0x3e5B3b7559D39563a74434157b31781322dA712D", + "commit_store": "0x7954372FF6f80908e5A2dC2a19d796A1005f91D2", + "receiver_dapp": "0xAFa2c441a83bBCEDc2E8c5c6f66248aFD8b9af3d" + } + } + }, + "Polygon Mainnet": { + "is_native_fee_token": true, + "fee_token": "0xb0897686c545045aFc77CF20eC7A532E3120E0F1", + "bridge_tokens": [], + "bridge_tokens_pools": [], + "arm": "0xD7AcF65dA1E1f34b663aB199a474F209bF2b0523", + "router": "0x849c5ED5a80F5B408Dd4969b78c2C8fdf0565Bfe", + "price_registry": "0x30D873664Ba766C983984C7AF9A921ccE36D34e1", + "wrapped_native": "0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270", + "src_contracts": { + "Arbitrum Mainnet": { + "on_ramp": "0xD16D025330Edb91259EEA8ed499daCd39087c295", + "deployed_at": 11111111 + }, + "Avalanche Mainnet": { + "on_ramp": "0x5FA30697e90eB30954895c45b028F7C0dDD39b12", + "deployed_at": 11111111 + }, + "Base Mainnet": { + "on_ramp": "0x20B028A2e0F6CCe3A11f3CE5F2B8986F932e89b4", + "deployed_at": 11111111 + }, + "BSC Mainnet": { + "on_ramp": "0xF5b5A2fC11BF46B1669C3B19d98B19C79109Dca9", + "deployed_at": 11111111 + }, + "Ethereum Mainnet": { + "on_ramp": "0xFd77c53AA4eF0E3C01f5Ac012BF7Cc7A3ECf5168", + "deployed_at": 11111111 + }, + "Optimism Mainnet": { + "on_ramp": "0x3111cfbF5e84B5D9BD952dd8e957f4Ca75f728Cf", + "deployed_at": 11111111 + }, + "WeMix Mainnet": { + "on_ramp": "0x5060eF647a1F66BE6eE27FAe3046faf8D53CeB2d", + "deployed_at": 11111111 + } + }, + "dest_contracts": { + "Arbitrum Mainnet": { + "off_ramp": "0xa8a9eDa2867c2E0CE0d5ECe273961F1EcC3CC25B", + "commit_store": "0xbD4480658dca8496a65046dfD1BDD44EF897Bdb5", + "receiver_dapp": "0xAFa2c441a83bBCEDc2E8c5c6f66248aFD8b9af3d" + }, + "Avalanche Mainnet": { + "off_ramp": "0xB9e3680639c9F0C4e0b02FD81C445094426244Ae", + "commit_store": "0x8c63d4e67f7c4af6FEd2f56A34fB4e01CB807CFF", + "receiver_dapp": "0xAFa2c441a83bBCEDc2E8c5c6f66248aFD8b9af3d" + }, + "Base Mainnet": { + "off_ramp": "0xD0FA7DE2D18A0c59D3fD7dfC7aB4e913C6Aa7b68", + "commit_store": "0xF88053B9DAC8Dd3039a4eFa8639159aaa3F2D4Cb", + "receiver_dapp": "0xAFa2c441a83bBCEDc2E8c5c6f66248aFD8b9af3d" + }, + "BSC Mainnet": { + "off_ramp": "0x592773924741F0Da889a0dfdab71171Dd11E054C", + "commit_store": "0xEC4d35E1A85f770f4D93BA43a462c9d87Ef7017e", + "receiver_dapp": "0xAFa2c441a83bBCEDc2E8c5c6f66248aFD8b9af3d" + }, + "Ethereum Mainnet": { + "off_ramp": "0x45320085fF051361D301eC1044318213A5387A15", + "commit_store": "0x4Dc771B5ef21ef60c33e2987E092345f2b63aE08", + "receiver_dapp": "0xAFa2c441a83bBCEDc2E8c5c6f66248aFD8b9af3d" + }, + "Optimism Mainnet": { + "off_ramp": "0xBa754ecd3CFA7E9093F688EAc3860cf9D07Fc0AC", + "commit_store": "0x04C0D5302E3D8Ca0A0019141a52a23B59cdb70e4", + "receiver_dapp": "0xAFa2c441a83bBCEDc2E8c5c6f66248aFD8b9af3d" + }, + "WeMix Mainnet": { + "off_ramp": "0xd7c877ea02310Cce9278D9A048Aa1Bb9aF72F00d", + "commit_store": "0x92A1C927E8E10Ab6A40E5A5154e2300D278d1a67", + "receiver_dapp": "0xAFa2c441a83bBCEDc2E8c5c6f66248aFD8b9af3d" + } + } + }, + "WeMix Mainnet": { + "is_native_fee_token": true, + "fee_token": "0x80f1FcdC96B55e459BF52b998aBBE2c364935d69", + "bridge_tokens": [], + "bridge_tokens_pools": [], + "arm": "0x07aaC8B69A62dB5bd3d244091916EbF2fac17b76", + "router": "0x7798b795Fde864f4Cd1b124a38Ba9619B7F8A442", + "price_registry": "0x252863688762aD86868D3d3076233Eacd80c7055", + "wrapped_native": "0x7D72b22a74A216Af4a002a1095C8C707d6eC1C5f", + "src_contracts": { + "Arbitrum Mainnet": { + "on_ramp": "0x9aBfd6f4C865610692AB6fb1Be862575809fFabf", + "deployed_at": 11111111 + }, + "Avalanche Mainnet": { + "on_ramp": "0xbE0Cfae74677F8dd16a246a3a5c8cbB1973118f4", + "deployed_at": 11111111 + }, + "BSC Mainnet": { + "on_ramp": "0x56657ec4D15C71f7F3C17ba2b21C853A24Dc5381", + "deployed_at": 11111111 + }, + "Optimism Mainnet": { + "on_ramp": "0x70f3b0FD7e6a4B9B623e9AB859604A9EE03e48BD", + "deployed_at": 11111111 + }, + "Polygon Mainnet": { + "on_ramp": "0x777058C1e1dcE4eB8001F38631a1cd9450816e5a", + "deployed_at": 11111111 + }, + "Ethereum Mainnet": { + "on_ramp": "0x190bcE84CF2d500B878966F4Cf98a50d78f2675E", + "deployed_at": 11111111 + }, + "Kroma Mainnet": { + "on_ramp": "0x47E9AE0A815C94836202E696748A5d5476aD8735", + "deployed_at": 11111111 + } + }, + "dest_contracts": { + "Arbitrum Mainnet": { + "off_ramp": "0x2ba68a395B72a6E3498D312efeD755ed2f3CF223", + "commit_store": "0xdAeC234DA83F68707Bb8AcB2ee6a01a5FD4c2391", + "receiver_dapp": "0xAFa2c441a83bBCEDc2E8c5c6f66248aFD8b9af3d" + }, + "Avalanche Mainnet": { + "off_ramp": "0xFac907F9a1087B846Faa75A14C5d34A8639233d8", + "commit_store": "0xF2812063446c7deD2CA306c67A68364BdDcbEfc5", + "receiver_dapp": "0xAFa2c441a83bBCEDc2E8c5c6f66248aFD8b9af3d" + }, + "BSC Mainnet": { + "off_ramp": "0x6ec9ca4Cba62cA17c55F05ad2000B46192f02035", + "commit_store": "0x84534BE763366a69710E119c100832955795B34B", + "receiver_dapp": "0xAFa2c441a83bBCEDc2E8c5c6f66248aFD8b9af3d" + }, + "Optimism Mainnet": { + "off_ramp": "0x87220D01DF0fF27149B47227897074653788fd23", + "commit_store": "0xF8dD2be2C6FA43e48A17146380CbEBBB4291807b", + "receiver_dapp": "0xAFa2c441a83bBCEDc2E8c5c6f66248aFD8b9af3d" + }, + "Polygon Mainnet": { + "off_ramp": "0x8f0229804513A9Bc00c1308414AB279Dbc718ae1", + "commit_store": "0x3A85D1b8641d83a87957C6ECF1b62151213e0842", + "receiver_dapp": "0xAFa2c441a83bBCEDc2E8c5c6f66248aFD8b9af3d" + }, + "Ethereum Mainnet": { + "off_ramp": "0xF92Fa796F5307b029c65CA26f322a6D86f211194", + "commit_store": "0xbeC110FF43D52be2066B06525304A9924E16b73b", + "receiver_dapp": "0xAFa2c441a83bBCEDc2E8c5c6f66248aFD8b9af3d" + }, + "Kroma Mainnet": { + "off_ramp": "0xF886d8DC64E544af4835cbf91e5678A54D95B80e", + "commit_store": "0x8794C9534658fdCC44f2FF6645Bf31cf9F6d2d5D", + "receiver_dapp": "0xAFa2c441a83bBCEDc2E8c5c6f66248aFD8b9af3d" + } + } + } + } +} \ No newline at end of file diff --git a/integration-tests/ccip-tests/contracts/laneconfig/contracts.json b/integration-tests/ccip-tests/contracts/laneconfig/contracts.json new file mode 100644 index 00000000000..4d20e2a4d57 --- /dev/null +++ b/integration-tests/ccip-tests/contracts/laneconfig/contracts.json @@ -0,0 +1,243 @@ +{ + "lane_configs": { + "Arbitrum Mainnet": { + "fee_token": "0xf97f4df75117a78c1A5a0DBb814Af92458539FB4", + "bridge_tokens": [ + "0xf97f4df75117a78c1A5a0DBb814Af92458539FB4" + ], + "bridge_tokens_pools": [ + "" + ], + "arm": "0xe06b0e8c4bd455153e8794ad7Ea8Ff5A14B64E4b", + "router": "0xE92634289A1841A979C11C2f618B33D376e4Ba85", + "price_registry": "0xeBec5Cb8651FCD0Fd86Bd1BBb8562f5028D5102E", + "wrapped_native": "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1", + "src_contracts": { + "Ethereum Mainnet": { + "on_ramp": "0x98dd9E9b8AE458225119Ab5B8c947A9d1cd0B648", + "deployed_at": 126471491 + } + }, + "dest_contracts": { + "Ethereum Mainnet": { + "off_ramp": "0x7b1f908ceBf41d5829D0134c7dfD6aa0f163C97d", + "commit_store": "0x8E2adA223f8514C2E6E6Fb0877a19018B67256fF", + "receiver_dapp": "0xAFa2c441a83bBCEDc2E8c5c6f66248aFD8b9af3d" + } + } + }, + "Avalanche Mainnet": { + "fee_token": "0x5947BB275c521040051D82396192181b413227A3", + "bridge_tokens": [ + "0x5947BB275c521040051D82396192181b413227A3" + ], + "bridge_tokens_pools": [ + "0x8A3e8D8614189d7ad0CF3f1a0D787Da79eBCEc17" + ], + "arm": "0xdFD6C0dc67666DE3bB36b31eec5c7B1542A82C1E", + "router": "0x27F39D0af3303703750D4001fCc1844c6491563c", + "price_registry": "0x2d3b38E0a4DFFDad2A613f7760bE1683F272eA18", + "wrapped_native": "0xb31f66aa3c1e785363f0875a1b74e27b85fd66c7", + "src_contracts": { + "Ethereum Mainnet": { + "on_ramp": "0x3D3817270db2b89e9F68bA27297fb4672082f942", + "deployed_at": 32263102 + }, + "Polygon Mainnet": { + "on_ramp": "0x2d306510FE83Cdb33Ff1658c71C181e9567F0009", + "deployed_at": 32562460 + } + }, + "dest_contracts": { + "Ethereum Mainnet": { + "off_ramp": "0x2BF2611a07e2cA880b814d53325e9b2ee0BbfD2f", + "commit_store": "0x5eBE880c4d340892dA1b0F32798a7A28e17e6E65", + "receiver_dapp": "0xAFa2c441a83bBCEDc2E8c5c6f66248aFD8b9af3d" + }, + "Polygon Mainnet": { + "off_ramp": "0xC65F15b8178c2Fd653183130C6E003d196C39eC2", + "commit_store": "0xa9DC27fAc318fdDCa08E215ca157Fa5C7A832d80", + "receiver_dapp": "0xAFa2c441a83bBCEDc2E8c5c6f66248aFD8b9af3d" + } + } + }, + "Base Mainnet": { + "fee_token": "0x88Fb150BDc53A65fe94Dea0c9BA0a6dAf8C6e196", + "arm": "0x38660c8CC222c0192b635c2ac09687B4F25cCE5F", + "router": "0x673AA85efd75080031d44fcA061575d1dA427A28", + "price_registry": "0x1bA15c57c8b74cD32443D7583E7f6d7c638aCf46", + "wrapped_native": "0x4200000000000000000000000000000000000006", + "src_contracts": { + "Ethereum Mainnet": { + "on_ramp": "0xD44371bFDe87f2db3eA6Df242091351A06c2e181", + "deployed_at": 3316617 + } + }, + "dest_contracts": { + "Ethereum Mainnet": { + "off_ramp": "0x391B9B016C3bBA61F02e7ddd345130415908B9c7", + "commit_store": "0x398d2164a3F61353B4619814A31cC74A7741612E", + "receiver_dapp": "0xAFa2c441a83bBCEDc2E8c5c6f66248aFD8b9af3d" + } + } + }, + "BSC Mainnet": { + "fee_token": "0x404460C6A5EdE2D891e8297795264fDe62ADBB75", + "bridge_tokens": [ + "0x404460C6A5EdE2D891e8297795264fDe62ADBB75" + ], + "bridge_tokens_pools": [ + "" + ], + "arm": "0x3DB43b96B2625F4232e9Df900d464dd2c64C0021", + "router": "0x536d7E53D0aDeB1F20E7c81fea45d02eC9dBD698", + "price_registry": "0x18C3D917D55Bc1784a3d4729AA3e2C1ecd662fFd", + "wrapped_native": "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c", + "src_contracts": { + "Ethereum Mainnet": { + "on_ramp": "0x1f17D464652f5Bd74a03446FeA20590CCfB3332D", + "deployed_at": 31312405 + } + }, + "dest_contracts": { + "Ethereum Mainnet": { + "off_ramp": "0xEcaa7473b57956647C8Cff5a909520e7A0A4a5f6", + "commit_store": "0x9C68a868db2C27E9A7Ce43b73272A5d7ecFB5865", + "receiver_dapp": "0xAFa2c441a83bBCEDc2E8c5c6f66248aFD8b9af3d" + } + } + }, + "Ethereum Mainnet": { + "fee_token": "0x514910771AF9Ca656af840dff83E8264EcF986CA", + "bridge_tokens": [ + "0x514910771AF9Ca656af840dff83E8264EcF986CA" + ], + "bridge_tokens_pools": [ + "0xC2291992A08eBFDfedfE248F2CCD34Da63570DF4" + ], + "arm": "0x8B63b3DE93431C0f756A493644d128134291fA1b", + "router": "0xE561d5E02207fb5eB32cca20a699E0d8919a1476", + "price_registry": "0x020082A7a9c2510e1921116001152DEE4da81985", + "wrapped_native": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", + "src_contracts": { + "Arbitrum Mainnet": { + "on_ramp": "0x333f976915195ba9044fD0cd603cEcE936f6264e", + "deployed_at": 18029393 + }, + "Avalanche Mainnet": { + "on_ramp": "0xd0B5Fc9790a6085b048b8Aa1ED26ca2b3b282CF2", + "deployed_at": 17636709 + }, + "BSC Mainnet": { + "on_ramp": "0xdF1d7FD22aC3aB5171E275796f123224039f3b24", + "deployed_at": 18029385 + }, + "Base Mainnet": { + "on_ramp": "0xe2Eb229e88F56691e96bb98256707Bc62160FE73", + "deployed_at": 18029431 + }, + "Optimism Mainnet": { + "on_ramp": "0xCC19bC4D43d17eB6859F0d22BA300967C97780b0", + "deployed_at": 17636647 + }, + "Polygon Mainnet": { + "on_ramp": "0x0f27c8532457b66D6037141DEB0ed479Dad04B3c", + "deployed_at": 17636734 + } + }, + "dest_contracts": { + "Arbitrum Mainnet": { + "off_ramp": "0x61135E701a2214C170c5F596D0067798FEfbaaE4", + "commit_store": "0x3d3467e1036Ee25F6F4aa15e3Abf77443A23144C", + "receiver_dapp": "0xAFa2c441a83bBCEDc2E8c5c6f66248aFD8b9af3d" + }, + "Avalanche Mainnet": { + "off_ramp": "0x1C207dabc46902dF9028b27D6d301c3849b2D12c", + "commit_store": "0x40c558575093eC1099CC21B020d9b8D13c74417F", + "receiver_dapp": "0xAFa2c441a83bBCEDc2E8c5c6f66248aFD8b9af3d" + }, + "BSC Mainnet": { + "off_ramp": "0xC7176620daf49A39a17FF9A6C2DE1eAA6033EE94", + "commit_store": "0x7986C9892389854cAAbAC785ff18123B0070a5Fd", + "receiver_dapp": "0xAFa2c441a83bBCEDc2E8c5c6f66248aFD8b9af3d" + }, + "Base Mainnet": { + "off_ramp": "0xfF51C00546AA3d9051a4B96Ae81346E14709CD24", + "commit_store": "0x2D1708ff2a15adbE313eA8C6035aA24d0FBA1c77", + "receiver_dapp": "0xAFa2c441a83bBCEDc2E8c5c6f66248aFD8b9af3d" + }, + "Optimism Mainnet": { + "off_ramp": "0x41627a90f2c6238f2BADAB72D5aB050B857fdAb5", + "commit_store": "0x8bEFCa744c6f2b567b1863dcF055C593afdC11A0", + "receiver_dapp": "0xAFa2c441a83bBCEDc2E8c5c6f66248aFD8b9af3d" + }, + "Polygon Mainnet": { + "off_ramp": "0xBDd822f3bC2EAB6818CfA3053107831D4E93fE72", + "commit_store": "0x20718EfbC25Dba60FD51c2c81362b83f7C411A6D", + "receiver_dapp": "0xAFa2c441a83bBCEDc2E8c5c6f66248aFD8b9af3d" + } + } + }, + "Optimism Mainnet": { + "fee_token": "0x350a791Bfc2C21F9Ed5d10980Dad2e2638ffa7f6", + "bridge_tokens": [ + "0x350a791Bfc2C21F9Ed5d10980Dad2e2638ffa7f6" + ], + "bridge_tokens_pools": [ + "0x841b32B5309ba30cFbf4534667fC3D99EdF05B7A" + ], + "arm": "0x8C7C2C3362a42308BB5c368677Ad321D11693b81", + "router": "0x261c05167db67B2b619f9d312e0753f3721ad6E8", + "price_registry": "0x9270AAA75F4B9038f4c25fEc665B02a150a90361", + "wrapped_native": "0x4200000000000000000000000000000000000006", + "src_contracts": { + "Ethereum Mainnet": { + "on_ramp": "0xad1b1F2A6DD55627e3893B771A00Cd43F69DcE35", + "deployed_at": 106535110 + } + }, + "dest_contracts": { + "Ethereum Mainnet": { + "off_ramp": "0x032F957BfbB8C535a1b2048f8b4FA27E1F2018Fd", + "commit_store": "0xa4D34ca38244F6c8AB640315d7257221408B6596", + "receiver_dapp": "0xAFa2c441a83bBCEDc2E8c5c6f66248aFD8b9af3d" + } + } + }, + "Polygon Mainnet": { + "fee_token": "0xb0897686c545045aFc77CF20eC7A532E3120E0F1", + "bridge_tokens": [ + "0xb0897686c545045aFc77CF20eC7A532E3120E0F1" + ], + "bridge_tokens_pools": [ + "0x086892015567fb8764d02c6845C85C25C8FcA389" + ], + "arm": "0xD7AcF65dA1E1f34b663aB199a474F209bF2b0523", + "router": "0x3C3D92629A02a8D95D5CB9650fe49C3544f69B43", + "price_registry": "0x68590799942eed65f9f1fB2277B9F6584A5957B8", + "wrapped_native": "0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270", + "src_contracts": { + "Avalanche Mainnet": { + "on_ramp": "0x47D945f7bbb814B65775a89c71F5D2229BE96CE9", + "deployed_at": 45041759 + }, + "Ethereum Mainnet": { + "on_ramp": "0xAE0e486Fa6577188d586A8e4c12360FB82E2a386", + "deployed_at": 44762064 + } + }, + "dest_contracts": { + "Avalanche Mainnet": { + "off_ramp": "0xd59A3770c3e05479152b8581Ae0839f51b315E6A", + "commit_store": "0xC2870bF94E24657f7f5E75cF458e391D23CD84B5", + "receiver_dapp": "0xAFa2c441a83bBCEDc2E8c5c6f66248aFD8b9af3d" + }, + "Ethereum Mainnet": { + "off_ramp": "0xa73bf37F78CD1629ff11Fa2B397CED39F49F6efe", + "commit_store": "0x779cA414cAC21c76AbE9213861b1bE9187d495F9", + "receiver_dapp": "0xAFa2c441a83bBCEDc2E8c5c6f66248aFD8b9af3d" + } + } + } + } +} diff --git a/integration-tests/ccip-tests/contracts/laneconfig/parse_contracts.go b/integration-tests/ccip-tests/contracts/laneconfig/parse_contracts.go new file mode 100644 index 00000000000..c96cb3dfdc6 --- /dev/null +++ b/integration-tests/ccip-tests/contracts/laneconfig/parse_contracts.go @@ -0,0 +1,228 @@ +package laneconfig + +import ( + _ "embed" + "encoding/json" + "errors" + "fmt" + "os" + "path/filepath" + "sync" + + "github.com/ethereum/go-ethereum/common" + "go.uber.org/multierr" +) + +var ( + //go:embed contracts.json + ExistingContracts []byte + laneMu = &sync.Mutex{} +) + +type CommonContracts struct { + IsNativeFeeToken bool `json:"is_native_fee_token,omitempty"` + AllowOutOfOrder bool `json:"allow_out_of_order,omitempty"` // expected to set this value as True for ZK chain source networks + IsMockARM bool `json:"is_mock_arm,omitempty"` + FeeToken string `json:"fee_token"` + BridgeTokens []string `json:"bridge_tokens,omitempty"` + BridgeTokenPools []string `json:"bridge_tokens_pools,omitempty"` + PriceAggregators map[string]string `json:"price_aggregators,omitempty"` + ARM string `json:"arm"` + Router string `json:"router"` + PriceRegistry string `json:"price_registry,omitempty"` + WrappedNative string `json:"wrapped_native"` + Multicall string `json:"multicall,omitempty"` + TokenTransmitter string `json:"token_transmitter,omitempty"` + TokenMessenger string `json:"token_messenger,omitempty"` + TokenAdminRegistry string `json:"token_admin_registry,omitempty"` +} + +type SourceContracts struct { + OnRamp string `json:"on_ramp"` + DeployedAt uint64 `json:"deployed_at"` +} + +type DestContracts struct { + OffRamp string `json:"off_ramp"` + CommitStore string `json:"commit_store"` + ReceiverDapp string `json:"receiver_dapp"` +} + +type LaneConfig struct { + CommonContracts + SrcContractsMu *sync.Mutex `json:"-"` + SrcContracts map[string]SourceContracts `json:"src_contracts"` // key destination chain id + DestContractsMu *sync.Mutex `json:"-"` + DestContracts map[string]DestContracts `json:"dest_contracts"` // key source chain id +} + +func (l *LaneConfig) Validate() error { + var laneConfigError error + + if l.ARM == "" || !common.IsHexAddress(l.ARM) { + laneConfigError = multierr.Append(laneConfigError, errors.New("must set proper address for arm")) + } + + if l.FeeToken != "" && !common.IsHexAddress(l.FeeToken) { + laneConfigError = multierr.Append(laneConfigError, errors.New("must set proper address for fee_token")) + } + + for _, token := range l.BridgeTokens { + if token != "" && !common.IsHexAddress(token) { + laneConfigError = multierr.Append(laneConfigError, errors.New("must set proper address for bridge_tokens")) + } + } + + for _, pool := range l.BridgeTokenPools { + if pool != "" && !common.IsHexAddress(pool) { + laneConfigError = multierr.Append(laneConfigError, errors.New("must set proper address for bridge_tokens_pools")) + } + } + if l.Router == "" || !common.IsHexAddress(l.Router) { + laneConfigError = multierr.Append(laneConfigError, errors.New("must set proper address for router")) + } + if l.PriceRegistry == "" || !common.IsHexAddress(l.PriceRegistry) { + laneConfigError = multierr.Append(laneConfigError, errors.New("must set proper address for price_registry")) + } + if l.WrappedNative == "" || !common.IsHexAddress(l.WrappedNative) { + laneConfigError = multierr.Append(laneConfigError, errors.New("must set proper address for wrapped_native")) + } + if l.Multicall == "" || !common.IsHexAddress(l.Multicall) { + laneConfigError = multierr.Append(laneConfigError, errors.New("must set proper address for multicall")) + } + return laneConfigError +} + +type Lanes struct { + LaneConfigs map[string]*LaneConfig `json:"lane_configs"` +} + +func (l *Lanes) ReadLaneConfig(networkA string) *LaneConfig { + laneMu.Lock() + defer laneMu.Unlock() + cfg, ok := l.LaneConfigs[networkA] + if !ok { + l.LaneConfigs[networkA] = &LaneConfig{ + SrcContracts: make(map[string]SourceContracts), + DestContracts: make(map[string]DestContracts), + SrcContractsMu: &sync.Mutex{}, + DestContractsMu: &sync.Mutex{}, + } + return l.LaneConfigs[networkA] + } + if cfg.SrcContractsMu == nil { + l.LaneConfigs[networkA].SrcContractsMu = &sync.Mutex{} + } + if cfg.DestContractsMu == nil { + l.LaneConfigs[networkA].DestContractsMu = &sync.Mutex{} + } + return l.LaneConfigs[networkA] +} + +// CopyCommonContracts copies network config for common contracts from fromNetwork to toNetwork +// if the toNetwork already exists, it does nothing +// If reuse is set to false, it only retains the token contracts +func (l *Lanes) CopyCommonContracts(fromNetwork, toNetwork string, reuse, isTokenTransfer bool) { + laneMu.Lock() + defer laneMu.Unlock() + // if the toNetwork already exists, return + if _, ok := l.LaneConfigs[toNetwork]; ok { + return + } + existing, ok := l.LaneConfigs[fromNetwork] + if !ok { + l.LaneConfigs[toNetwork] = &LaneConfig{ + SrcContracts: make(map[string]SourceContracts), + DestContracts: make(map[string]DestContracts), + SrcContractsMu: &sync.Mutex{}, + DestContractsMu: &sync.Mutex{}, + } + return + } + cfg := &LaneConfig{ + SrcContracts: make(map[string]SourceContracts), + SrcContractsMu: &sync.Mutex{}, + DestContractsMu: &sync.Mutex{}, + DestContracts: make(map[string]DestContracts), + CommonContracts: CommonContracts{ + WrappedNative: existing.WrappedNative, + Multicall: existing.Multicall, + }, + } + // if reuse is set to true, it copies all the common contracts except the router + if reuse { + cfg.CommonContracts.FeeToken = existing.FeeToken + cfg.CommonContracts.PriceRegistry = existing.PriceRegistry + cfg.CommonContracts.TokenAdminRegistry = existing.TokenAdminRegistry + cfg.CommonContracts.PriceAggregators = existing.PriceAggregators + cfg.CommonContracts.ARM = existing.ARM + cfg.CommonContracts.IsMockARM = existing.IsMockARM + cfg.CommonContracts.Multicall = existing.Multicall + } + // if it is a token transfer, it copies the bridge token contracts + if isTokenTransfer { + cfg.CommonContracts.BridgeTokens = existing.BridgeTokens + if reuse { + cfg.CommonContracts.BridgeTokenPools = existing.BridgeTokenPools + } + } + l.LaneConfigs[toNetwork] = cfg +} + +func (l *Lanes) WriteLaneConfig(networkA string, cfg *LaneConfig) error { + laneMu.Lock() + defer laneMu.Unlock() + if l.LaneConfigs == nil { + l.LaneConfigs = make(map[string]*LaneConfig) + } + err := cfg.Validate() + if err != nil { + return err + } + l.LaneConfigs[networkA] = cfg + return nil +} + +func ReadLanesFromExistingDeployment(contracts []byte) (*Lanes, error) { + // if contracts is empty, use the existing contracts from contracts.json + if len(contracts) == 0 { + contracts = ExistingContracts + } + var lanes Lanes + if err := json.Unmarshal(contracts, &lanes); err != nil { + return nil, err + } + return &lanes, nil +} + +func CreateDeploymentJSON(path string) (*Lanes, error) { + existingLanes := Lanes{ + LaneConfigs: make(map[string]*LaneConfig), + } + err := WriteLanesToJSON(path, &existingLanes) + return &existingLanes, err +} + +func WriteLanesToJSON(path string, lanes *Lanes) error { + b, err := json.MarshalIndent(lanes, "", " ") + if err != nil { + return err + } + // Get the directory part of the file path. + dir := filepath.Dir(path) + // Check if the directory exists. + if _, err := os.Stat(dir); os.IsNotExist(err) { + // The directory does not exist, create it. + if err := os.MkdirAll(dir, 0755); err != nil { + return fmt.Errorf("failed to create directory: %w", err) + } + } + + f, err := os.Create(path) + if err != nil { + return err + } + defer f.Close() + _, err = f.Write(b) + return err +} diff --git a/integration-tests/ccip-tests/contracts/lm_contracts.go b/integration-tests/ccip-tests/contracts/lm_contracts.go new file mode 100644 index 00000000000..521324c11be --- /dev/null +++ b/integration-tests/ccip-tests/contracts/lm_contracts.go @@ -0,0 +1,320 @@ +package contracts + +import ( + "fmt" + "math/big" + + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/rs/zerolog" + + "github.com/smartcontractkit/chainlink/integration-tests/wrappers" + + "github.com/smartcontractkit/chainlink-testing-framework/lib/blockchain" + + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/rmn_proxy_contract" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/liquiditymanager/generated/arbitrum_l1_bridge_adapter" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/liquiditymanager/generated/arbitrum_l2_bridge_adapter" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/liquiditymanager/generated/liquiditymanager" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/liquiditymanager/generated/mock_l1_bridge_adapter" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/liquiditymanager/generated/mock_l2_bridge_adapter" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/liquiditymanager/generated/optimism_l1_bridge_adapter" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/liquiditymanager/generated/optimism_l2_bridge_adapter" +) + +type ArmProxy struct { + client blockchain.EVMClient + Instance *rmn_proxy_contract.RMNProxyContract + EthAddress *common.Address +} + +func (e *CCIPContractsDeployer) DeployArmProxy(arm common.Address) (*ArmProxy, error) { + address, _, instance, err := e.evmClient.DeployContract("ARMProxy", func( + auth *bind.TransactOpts, + _ bind.ContractBackend, + ) (common.Address, *types.Transaction, interface{}, error) { + return rmn_proxy_contract.DeployRMNProxyContract( + auth, + wrappers.MustNewWrappedContractBackend(e.evmClient, nil), + arm, + ) + }) + if err != nil { + return nil, err + } + return &ArmProxy{ + client: e.evmClient, + Instance: instance.(*rmn_proxy_contract.RMNProxyContract), + EthAddress: address, + }, err +} + +type LiquidityManager struct { + client blockchain.EVMClient + logger *zerolog.Logger + Instance *liquiditymanager.LiquidityManager + EthAddress *common.Address +} + +func (e *CCIPContractsDeployer) DeployLiquidityManager( + token common.Address, + localChainSelector uint64, + localLiquidityContainer common.Address, + minimumLiquidity *big.Int, +) (*LiquidityManager, error) { + address, _, instance, err := e.evmClient.DeployContract("LiquidityManager", func( + auth *bind.TransactOpts, + _ bind.ContractBackend, + ) (common.Address, *types.Transaction, interface{}, error) { + return liquiditymanager.DeployLiquidityManager( + auth, + wrappers.MustNewWrappedContractBackend(e.evmClient, nil), + token, + localChainSelector, + localLiquidityContainer, + minimumLiquidity, + common.Address{}, + ) + }) + if err != nil { + return nil, err + } + return &LiquidityManager{ + client: e.evmClient, + logger: e.logger, + Instance: instance.(*liquiditymanager.LiquidityManager), + EthAddress: address, + }, err +} + +func (v *LiquidityManager) GetLiquidity() (*big.Int, error) { + return v.Instance.GetLiquidity(nil) +} + +func (v *LiquidityManager) SetCrossChainRebalancer( + crossChainRebalancerArgs liquiditymanager.ILiquidityManagerCrossChainRebalancerArgs, +) error { + v.logger.Info(). + Str("Liquidity Manager", v.EthAddress.String()). + Msg("Setting crosschain rebalancer on liquidity manager") + opts, err := v.client.TransactionOpts(v.client.GetDefaultWallet()) + if err != nil { + return fmt.Errorf("failed to get transaction opts: %w", err) + } + tx, err := v.Instance.SetCrossChainRebalancer(opts, crossChainRebalancerArgs) + if err != nil { + return fmt.Errorf("failed to set cross chain rebalancer: %w", err) + + } + v.logger.Info(). + Str("Liquidity Manager", v.EthAddress.String()). + Interface("Rebalance Argsr", crossChainRebalancerArgs). + Msg("Crosschain Rebalancer set on liquidity manager") + return v.client.ProcessTransaction(tx) +} + +func (v *LiquidityManager) SetOCR3Config( + signers []common.Address, + transmitters []common.Address, + f uint8, + onchainConfig []byte, + offchainConfigVersion uint64, + offchainConfig []byte, +) error { + v.logger.Info(). + Str("Liquidity Manager", v.EthAddress.String()). + Msg("Setting ocr3 config on liquidity manager") + opts, err := v.client.TransactionOpts(v.client.GetDefaultWallet()) + if err != nil { + return fmt.Errorf("failed to get transaction opts: %w", err) + } + tx, err := v.Instance.SetOCR3Config( + opts, + signers, + transmitters, + f, + onchainConfig, + offchainConfigVersion, + offchainConfig) + if err != nil { + return fmt.Errorf("failed to set cross chain rebalancer: %w", err) + + } + v.logger.Info(). + Str("Liquidity Manager", v.EthAddress.String()). + Msg("Set OCR3Config on LM") + return v.client.ProcessTransaction(tx) +} + +type ArbitrumL1BridgeAdapter struct { + client blockchain.EVMClient + Instance *arbitrum_l1_bridge_adapter.ArbitrumL1BridgeAdapter + EthAddress *common.Address +} + +func (e *CCIPContractsDeployer) DeployArbitrumL1BridgeAdapter( + l1GatewayRouter common.Address, + l1Outbox common.Address, +) (*ArbitrumL1BridgeAdapter, error) { + address, _, instance, err := e.evmClient.DeployContract("ArbitrumL1BridgeAdapter", func( + auth *bind.TransactOpts, + _ bind.ContractBackend, + ) (common.Address, *types.Transaction, interface{}, error) { + return arbitrum_l1_bridge_adapter.DeployArbitrumL1BridgeAdapter( + auth, + wrappers.MustNewWrappedContractBackend(e.evmClient, nil), + l1GatewayRouter, + l1Outbox, + ) + }) + if err != nil { + return nil, err + } + return &ArbitrumL1BridgeAdapter{ + client: e.evmClient, + Instance: instance.(*arbitrum_l1_bridge_adapter.ArbitrumL1BridgeAdapter), + EthAddress: address, + }, err +} + +type ArbitrumL2BridgeAdapter struct { + client blockchain.EVMClient + Instance *arbitrum_l2_bridge_adapter.ArbitrumL2BridgeAdapter + EthAddress *common.Address +} + +func (e *CCIPContractsDeployer) DeployArbitrumL2BridgeAdapter(l2GatewayRouter common.Address) (*ArbitrumL2BridgeAdapter, error) { + address, _, instance, err := e.evmClient.DeployContract("ArbitrumL2BridgeAdapter", func( + auth *bind.TransactOpts, + _ bind.ContractBackend, + ) (common.Address, *types.Transaction, interface{}, error) { + return arbitrum_l2_bridge_adapter.DeployArbitrumL2BridgeAdapter( + auth, + wrappers.MustNewWrappedContractBackend(e.evmClient, nil), + l2GatewayRouter, + ) + }) + if err != nil { + return nil, err + } + return &ArbitrumL2BridgeAdapter{ + client: e.evmClient, + Instance: instance.(*arbitrum_l2_bridge_adapter.ArbitrumL2BridgeAdapter), + EthAddress: address, + }, err +} + +type OptimismL1BridgeAdapter struct { + client blockchain.EVMClient + Instance *optimism_l1_bridge_adapter.OptimismL1BridgeAdapter + EthAddress *common.Address +} + +func (e *CCIPContractsDeployer) DeployOptimismL1BridgeAdapter( + l1Bridge common.Address, + wrappedNative common.Address, + optimismPortal common.Address, +) (*OptimismL1BridgeAdapter, error) { + address, _, instance, err := e.evmClient.DeployContract("OptimismL1BridgeAdapter", func( + auth *bind.TransactOpts, + _ bind.ContractBackend, + ) (common.Address, *types.Transaction, interface{}, error) { + return optimism_l1_bridge_adapter.DeployOptimismL1BridgeAdapter( + auth, + wrappers.MustNewWrappedContractBackend(e.evmClient, nil), + l1Bridge, + wrappedNative, + optimismPortal, + ) + }) + if err != nil { + return nil, err + } + return &OptimismL1BridgeAdapter{ + client: e.evmClient, + Instance: instance.(*optimism_l1_bridge_adapter.OptimismL1BridgeAdapter), + EthAddress: address, + }, err +} + +type OptimismL2BridgeAdapter struct { + client blockchain.EVMClient + Instance *optimism_l2_bridge_adapter.OptimismL2BridgeAdapter + EthAddress *common.Address +} + +func (e *CCIPContractsDeployer) DeployOptimismL2BridgeAdapter(wrappedNative common.Address) (*OptimismL2BridgeAdapter, error) { + address, _, instance, err := e.evmClient.DeployContract("OptimismL2BridgeAdapter", func( + auth *bind.TransactOpts, + _ bind.ContractBackend, + ) (common.Address, *types.Transaction, interface{}, error) { + return optimism_l2_bridge_adapter.DeployOptimismL2BridgeAdapter( + auth, + wrappers.MustNewWrappedContractBackend(e.evmClient, nil), + wrappedNative, + ) + }) + if err != nil { + return nil, err + } + return &OptimismL2BridgeAdapter{ + client: e.evmClient, + Instance: instance.(*optimism_l2_bridge_adapter.OptimismL2BridgeAdapter), + EthAddress: address, + }, err +} + +type MockL1BridgeAdapter struct { + client blockchain.EVMClient + Instance *mock_l1_bridge_adapter.MockL1BridgeAdapter + EthAddress *common.Address +} + +func (e *CCIPContractsDeployer) DeployMockL1BridgeAdapter(tokenAddr common.Address, holdNative bool) (*MockL1BridgeAdapter, error) { + address, _, instance, err := e.evmClient.DeployContract("MockL1BridgeAdapter", func( + auth *bind.TransactOpts, + _ bind.ContractBackend, + ) (common.Address, *types.Transaction, interface{}, error) { + return mock_l1_bridge_adapter.DeployMockL1BridgeAdapter( + auth, + wrappers.MustNewWrappedContractBackend(e.evmClient, nil), + tokenAddr, + holdNative, + ) + }) + if err != nil { + return nil, err + } + return &MockL1BridgeAdapter{ + client: e.evmClient, + Instance: instance.(*mock_l1_bridge_adapter.MockL1BridgeAdapter), + EthAddress: address, + }, err +} + +type MockL2BridgeAdapter struct { + client blockchain.EVMClient + Instance *mock_l2_bridge_adapter.MockL2BridgeAdapter + EthAddress *common.Address +} + +func (e *CCIPContractsDeployer) DeployMockL2BridgeAdapter() (*MockL2BridgeAdapter, error) { + address, _, instance, err := e.evmClient.DeployContract("MockL2BridgeAdapter", func( + auth *bind.TransactOpts, + _ bind.ContractBackend, + ) (common.Address, *types.Transaction, interface{}, error) { + return mock_l2_bridge_adapter.DeployMockL2BridgeAdapter( + auth, + wrappers.MustNewWrappedContractBackend(e.evmClient, nil), + ) + }) + if err != nil { + return nil, err + } + return &MockL2BridgeAdapter{ + client: e.evmClient, + Instance: instance.(*mock_l2_bridge_adapter.MockL2BridgeAdapter), + EthAddress: address, + }, err +} diff --git a/integration-tests/ccip-tests/contracts/multicall.go b/integration-tests/ccip-tests/contracts/multicall.go new file mode 100644 index 00000000000..094a6152be6 --- /dev/null +++ b/integration-tests/ccip-tests/contracts/multicall.go @@ -0,0 +1,280 @@ +package contracts + +import ( + "context" + "fmt" + "math/big" + "strings" + + "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/pkg/errors" + "github.com/rs/zerolog/log" + + "github.com/smartcontractkit/chainlink-testing-framework/lib/blockchain" + + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/router" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/shared/generated/erc20" +) + +const ( + MultiCallABI = "[{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"callData\",\"type\":\"bytes\"}],\"internalType\":\"struct Multicall3.Call[]\",\"name\":\"calls\",\"type\":\"tuple[]\"}],\"name\":\"aggregate\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"blockNumber\",\"type\":\"uint256\"},{\"internalType\":\"bytes[]\",\"name\":\"returnData\",\"type\":\"bytes[]\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"allowFailure\",\"type\":\"bool\"},{\"internalType\":\"bytes\",\"name\":\"callData\",\"type\":\"bytes\"}],\"internalType\":\"struct Multicall3.Call3[]\",\"name\":\"calls\",\"type\":\"tuple[]\"}],\"name\":\"aggregate3\",\"outputs\":[{\"components\":[{\"internalType\":\"bool\",\"name\":\"success\",\"type\":\"bool\"},{\"internalType\":\"bytes\",\"name\":\"returnData\",\"type\":\"bytes\"}],\"internalType\":\"struct Multicall3.Result[]\",\"name\":\"returnData\",\"type\":\"tuple[]\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"allowFailure\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"callData\",\"type\":\"bytes\"}],\"internalType\":\"struct Multicall3.Call3Value[]\",\"name\":\"calls\",\"type\":\"tuple[]\"}],\"name\":\"aggregate3Value\",\"outputs\":[{\"components\":[{\"internalType\":\"bool\",\"name\":\"success\",\"type\":\"bool\"},{\"internalType\":\"bytes\",\"name\":\"returnData\",\"type\":\"bytes\"}],\"internalType\":\"struct Multicall3.Result[]\",\"name\":\"returnData\",\"type\":\"tuple[]\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"callData\",\"type\":\"bytes\"}],\"internalType\":\"struct Multicall3.Call[]\",\"name\":\"calls\",\"type\":\"tuple[]\"}],\"name\":\"blockAndAggregate\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"blockNumber\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"success\",\"type\":\"bool\"},{\"internalType\":\"bytes\",\"name\":\"returnData\",\"type\":\"bytes\"}],\"internalType\":\"struct Multicall3.Result[]\",\"name\":\"returnData\",\"type\":\"tuple[]\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getBasefee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"basefee\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"blockNumber\",\"type\":\"uint256\"}],\"name\":\"getBlockHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getBlockNumber\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"blockNumber\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getChainId\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"chainid\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getCurrentBlockCoinbase\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"coinbase\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getCurrentBlockDifficulty\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"difficulty\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getCurrentBlockGasLimit\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"gaslimit\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getCurrentBlockTimestamp\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"getEthBalance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"balance\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getLastBlockHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bool\",\"name\":\"requireSuccess\",\"type\":\"bool\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"callData\",\"type\":\"bytes\"}],\"internalType\":\"struct Multicall3.Call[]\",\"name\":\"calls\",\"type\":\"tuple[]\"}],\"name\":\"tryAggregate\",\"outputs\":[{\"components\":[{\"internalType\":\"bool\",\"name\":\"success\",\"type\":\"bool\"},{\"internalType\":\"bytes\",\"name\":\"returnData\",\"type\":\"bytes\"}],\"internalType\":\"struct Multicall3.Result[]\",\"name\":\"returnData\",\"type\":\"tuple[]\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bool\",\"name\":\"requireSuccess\",\"type\":\"bool\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"callData\",\"type\":\"bytes\"}],\"internalType\":\"struct Multicall3.Call[]\",\"name\":\"calls\",\"type\":\"tuple[]\"}],\"name\":\"tryBlockAndAggregate\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"blockNumber\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"success\",\"type\":\"bool\"},{\"internalType\":\"bytes\",\"name\":\"returnData\",\"type\":\"bytes\"}],\"internalType\":\"struct Multicall3.Result[]\",\"name\":\"returnData\",\"type\":\"tuple[]\"}],\"stateMutability\":\"payable\",\"type\":\"function\"}]" + MultiCallBIN = "0x608060405234801561001057600080fd5b50610ee0806100206000396000f3fe6080604052600436106100f35760003560e01c80634d2301cc1161008a578063a8b0574e11610059578063a8b0574e1461025a578063bce38bd714610275578063c3077fa914610288578063ee82ac5e1461029b57600080fd5b80634d2301cc146101ec57806372425d9d1461022157806382ad56cb1461023457806386d516e81461024757600080fd5b80633408e470116100c65780633408e47014610191578063399542e9146101a45780633e64a696146101c657806342cbb15c146101d957600080fd5b80630f28c97d146100f8578063174dea711461011a578063252dba421461013a57806327e86d6e1461015b575b600080fd5b34801561010457600080fd5b50425b6040519081526020015b60405180910390f35b61012d610128366004610a85565b6102ba565b6040516101119190610bbe565b61014d610148366004610a85565b6104ef565b604051610111929190610bd8565b34801561016757600080fd5b50437fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0140610107565b34801561019d57600080fd5b5046610107565b6101b76101b2366004610c60565b610690565b60405161011193929190610cba565b3480156101d257600080fd5b5048610107565b3480156101e557600080fd5b5043610107565b3480156101f857600080fd5b50610107610207366004610ce2565b73ffffffffffffffffffffffffffffffffffffffff163190565b34801561022d57600080fd5b5044610107565b61012d610242366004610a85565b6106ab565b34801561025357600080fd5b5045610107565b34801561026657600080fd5b50604051418152602001610111565b61012d610283366004610c60565b61085a565b6101b7610296366004610a85565b610a1a565b3480156102a757600080fd5b506101076102b6366004610d18565b4090565b60606000828067ffffffffffffffff8111156102d8576102d8610d31565b60405190808252806020026020018201604052801561031e57816020015b6040805180820190915260008152606060208201528152602001906001900390816102f65790505b5092503660005b8281101561047757600085828151811061034157610341610d60565b6020026020010151905087878381811061035d5761035d610d60565b905060200281019061036f9190610d8f565b6040810135958601959093506103886020850185610ce2565b73ffffffffffffffffffffffffffffffffffffffff16816103ac6060870187610dcd565b6040516103ba929190610e32565b60006040518083038185875af1925050503d80600081146103f7576040519150601f19603f3d011682016040523d82523d6000602084013e6103fc565b606091505b50602080850191909152901515808452908501351761046d577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260846000fd5b5050600101610325565b508234146104e6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f4d756c746963616c6c333a2076616c7565206d69736d6174636800000000000060448201526064015b60405180910390fd5b50505092915050565b436060828067ffffffffffffffff81111561050c5761050c610d31565b60405190808252806020026020018201604052801561053f57816020015b606081526020019060019003908161052a5790505b5091503660005b8281101561068657600087878381811061056257610562610d60565b90506020028101906105749190610e42565b92506105836020840184610ce2565b73ffffffffffffffffffffffffffffffffffffffff166105a66020850185610dcd565b6040516105b4929190610e32565b6000604051808303816000865af19150503d80600081146105f1576040519150601f19603f3d011682016040523d82523d6000602084013e6105f6565b606091505b5086848151811061060957610609610d60565b602090810291909101015290508061067d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060448201526064016104dd565b50600101610546565b5050509250929050565b43804060606106a086868661085a565b905093509350939050565b6060818067ffffffffffffffff8111156106c7576106c7610d31565b60405190808252806020026020018201604052801561070d57816020015b6040805180820190915260008152606060208201528152602001906001900390816106e55790505b5091503660005b828110156104e657600084828151811061073057610730610d60565b6020026020010151905086868381811061074c5761074c610d60565b905060200281019061075e9190610e76565b925061076d6020840184610ce2565b73ffffffffffffffffffffffffffffffffffffffff166107906040850185610dcd565b60405161079e929190610e32565b6000604051808303816000865af19150503d80600081146107db576040519150601f19603f3d011682016040523d82523d6000602084013e6107e0565b606091505b506020808401919091529015158083529084013517610851577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260646000fd5b50600101610714565b6060818067ffffffffffffffff81111561087657610876610d31565b6040519080825280602002602001820160405280156108bc57816020015b6040805180820190915260008152606060208201528152602001906001900390816108945790505b5091503660005b82811015610a105760008482815181106108df576108df610d60565b602002602001015190508686838181106108fb576108fb610d60565b905060200281019061090d9190610e42565b925061091c6020840184610ce2565b73ffffffffffffffffffffffffffffffffffffffff1661093f6020850185610dcd565b60405161094d929190610e32565b6000604051808303816000865af19150503d806000811461098a576040519150601f19603f3d011682016040523d82523d6000602084013e61098f565b606091505b506020830152151581528715610a07578051610a07576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060448201526064016104dd565b506001016108c3565b5050509392505050565b6000806060610a2b60018686610690565b919790965090945092505050565b60008083601f840112610a4b57600080fd5b50813567ffffffffffffffff811115610a6357600080fd5b6020830191508360208260051b8501011115610a7e57600080fd5b9250929050565b60008060208385031215610a9857600080fd5b823567ffffffffffffffff811115610aaf57600080fd5b610abb85828601610a39565b90969095509350505050565b6000815180845260005b81811015610aed57602081850181015186830182015201610ad1565b81811115610aff576000602083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b600082825180855260208086019550808260051b84010181860160005b84811015610bb1578583037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe001895281518051151584528401516040858501819052610b9d81860183610ac7565b9a86019a9450505090830190600101610b4f565b5090979650505050505050565b602081526000610bd16020830184610b32565b9392505050565b600060408201848352602060408185015281855180845260608601915060608160051b870101935082870160005b82811015610c52577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa0888703018452610c40868351610ac7565b95509284019290840190600101610c06565b509398975050505050505050565b600080600060408486031215610c7557600080fd5b83358015158114610c8557600080fd5b9250602084013567ffffffffffffffff811115610ca157600080fd5b610cad86828701610a39565b9497909650939450505050565b838152826020820152606060408201526000610cd96060830184610b32565b95945050505050565b600060208284031215610cf457600080fd5b813573ffffffffffffffffffffffffffffffffffffffff81168114610bd157600080fd5b600060208284031215610d2a57600080fd5b5035919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81833603018112610dc357600080fd5b9190910192915050565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112610e0257600080fd5b83018035915067ffffffffffffffff821115610e1d57600080fd5b602001915036819003821315610a7e57600080fd5b8183823760009101908152919050565b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc1833603018112610dc357600080fd5b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa1833603018112610dc357600080fdfea2646970667358221220bb2b5c71a328032f97c676ae39a1ec2148d3e5d6f73d95e9b17910152d61f16264736f6c634300080c0033" +) + +type CallWithValue struct { + Target common.Address + AllowFailure bool + Value *big.Int + CallData []byte +} + +type Call struct { + Target common.Address + AllowFailure bool + CallData []byte +} + +type Result struct { + Success bool + ReturnData []byte +} +type CCIPMsgData struct { + RouterAddr common.Address + ChainSelector uint64 + Msg router.ClientEVM2AnyMessage + Fee *big.Int +} + +func TransferTokenCallData(to common.Address, amount *big.Int) ([]byte, error) { + erc20ABI, err := abi.JSON(strings.NewReader(erc20.ERC20ABI)) + if err != nil { + return nil, err + } + transferToken := erc20ABI.Methods["transfer"] + inputs, err := transferToken.Inputs.Pack(to, amount) + if err != nil { + return nil, err + } + inputs = append(transferToken.ID[:], inputs...) + return inputs, nil +} + +// ApproveTokenCallData returns the call data for approving a token with approve function of erc20 contract +func ApproveTokenCallData(to common.Address, amount *big.Int) ([]byte, error) { + erc20ABI, err := abi.JSON(strings.NewReader(erc20.ERC20ABI)) + if err != nil { + return nil, err + } + approveToken := erc20ABI.Methods["approve"] + inputs, err := approveToken.Inputs.Pack(to, amount) + if err != nil { + return nil, err + } + inputs = append(approveToken.ID[:], inputs...) + return inputs, nil +} + +// CCIPSendCallData returns the call data for sending a CCIP message with ccipSend function of router contract +func CCIPSendCallData(msg CCIPMsgData) ([]byte, error) { + routerABI, err := abi.JSON(strings.NewReader(router.RouterABI)) + if err != nil { + return nil, err + } + ccipSend := routerABI.Methods["ccipSend"] + sendID := ccipSend.ID + inputs, err := ccipSend.Inputs.Pack( + msg.ChainSelector, + msg.Msg, + ) + if err != nil { + return nil, err + } + inputs = append(sendID[:], inputs...) + return inputs, nil +} + +func WaitForSuccessfulTxMined(evmClient blockchain.EVMClient, tx *types.Transaction) error { + log.Info().Str("tx", tx.Hash().Hex()).Msg("waiting for tx to be mined") + receipt, err := bind.WaitMined(context.Background(), evmClient.DeployBackend(), tx) + if err != nil { + return err + } + if receipt.Status != types.ReceiptStatusSuccessful { + // TODO: Add error reason from receipt/tx + return fmt.Errorf("tx failed %s", tx.Hash().Hex()) + } + log.Info().Str("tx", tx.Hash().Hex()).Str("Network", evmClient.GetNetworkName()).Msg("tx mined successfully") + return nil +} + +// MultiCallCCIP sends multiple CCIP messages in a single transaction +// if native is true, it will send msg with native as fee. In this case the msg should be sent with a +// msg.value equivalent to the total fee with the help of aggregate3Value +// +// if native is false, it will send msg with fee in specific feetoken. In this case the msg should be sent without value with the help of aggregate3. +// In both cases, if there are any bridge tokens included in ccip transfer, the amount for corresponding token should be approved to the router contract as spender. +// The approval should be done by calling approval function as part of the call data of aggregate3 or aggregate3Value +// If feetoken is used as fee, the amount for feetoken should be approved to the router contract as spender and should be done as part of the call data of aggregate3 +// In case of native as fee, there is no need for fee amount approval +func MultiCallCCIP( + evmClient blockchain.EVMClient, + address string, + msgData []CCIPMsgData, + native bool, +) (*types.Transaction, error) { + contractAddress := common.HexToAddress(address) + multiCallABI, err := abi.JSON(strings.NewReader(MultiCallABI)) + if err != nil { + return nil, err + } + boundContract := bind.NewBoundContract(contractAddress, multiCallABI, evmClient.Backend(), evmClient.Backend(), evmClient.Backend()) + + // if native, use aggregate3Value to send msg with value + if native { + var callData []CallWithValue + allValue := big.NewInt(0) + // create call data for each msg + for _, msg := range msgData { + if msg.Msg.FeeToken != (common.Address{}) { + return nil, fmt.Errorf("fee token should be %s for native as fee", common.HexToAddress("0x0").Hex()) + } + // approve bridge token + for _, tokenAndAmount := range msg.Msg.TokenAmounts { + inputs, err := ApproveTokenCallData(msg.RouterAddr, tokenAndAmount.Amount) + if err != nil { + return nil, err + } + data := CallWithValue{Target: tokenAndAmount.Token, AllowFailure: false, Value: big.NewInt(0), CallData: inputs} + callData = append(callData, data) + } + inputs, err := CCIPSendCallData(msg) + if err != nil { + return nil, err + } + data := CallWithValue{Target: msg.RouterAddr, AllowFailure: false, Value: msg.Fee, CallData: inputs} + callData = append(callData, data) + allValue.Add(allValue, msg.Fee) + } + + opts, err := evmClient.TransactionOpts(evmClient.GetDefaultWallet()) + if err != nil { + return nil, err + } + // the value of transactionOpts is the sum of the value of all msg, which is the total fee of all ccip-sends + opts.Value = allValue + + // call aggregate3Value to group all msg call data and send them in a single transaction + tx, err := boundContract.Transact(opts, "aggregate3Value", callData) + if err != nil { + return nil, err + } + err = evmClient.MarkTxAsSentOnL2(tx) + if err != nil { + return nil, err + } + err = WaitForSuccessfulTxMined(evmClient, tx) + if err != nil { + return nil, errors.Wrapf(err, "multicall failed for ccip-send; multicall %s", contractAddress.Hex()) + } + return tx, nil + } + // if with feetoken, use aggregate3 to send msg without value + var callData []Call + // create call data for each msg + for _, msg := range msgData { + isFeeTokenAndBridgeTokenSame := false + // approve bridge token + for _, tokenAndAmount := range msg.Msg.TokenAmounts { + var inputs []byte + // if feetoken is same as bridge token, approve total amount including transfer amount + fee amount + if tokenAndAmount.Token == msg.Msg.FeeToken { + isFeeTokenAndBridgeTokenSame = true + inputs, err = ApproveTokenCallData(msg.RouterAddr, new(big.Int).Add(msg.Fee, tokenAndAmount.Amount)) + if err != nil { + return nil, err + } + } else { + inputs, err = ApproveTokenCallData(msg.RouterAddr, tokenAndAmount.Amount) + if err != nil { + return nil, err + } + } + + callData = append(callData, Call{Target: tokenAndAmount.Token, AllowFailure: false, CallData: inputs}) + } + // approve fee token if not already approved + if msg.Fee != nil && msg.Fee.Cmp(big.NewInt(0)) > 0 && !isFeeTokenAndBridgeTokenSame { + inputs, err := ApproveTokenCallData(msg.RouterAddr, msg.Fee) + if err != nil { + return nil, err + } + callData = append(callData, Call{Target: msg.Msg.FeeToken, AllowFailure: false, CallData: inputs}) + } + + inputs, err := CCIPSendCallData(msg) + if err != nil { + return nil, err + } + callData = append(callData, Call{Target: msg.RouterAddr, AllowFailure: false, CallData: inputs}) + } + opts, err := evmClient.TransactionOpts(evmClient.GetDefaultWallet()) + if err != nil { + return nil, err + } + + // call aggregate3 to group all msg call data and send them in a single transaction + tx, err := boundContract.Transact(opts, "aggregate3", callData) + if err != nil { + return nil, err + } + err = WaitForSuccessfulTxMined(evmClient, tx) + if err != nil { + return tx, errors.Wrapf(err, "multicall failed for ccip-send; router %s", contractAddress.Hex()) + } + return tx, nil +} + +func TransferTokens( + evmClient blockchain.EVMClient, + contractAddress common.Address, + tokens []*ERC20Token, +) error { + multiCallABI, err := abi.JSON(strings.NewReader(MultiCallABI)) + if err != nil { + return err + } + var callData []Call + boundContract := bind.NewBoundContract(contractAddress, multiCallABI, evmClient.Backend(), evmClient.Backend(), evmClient.Backend()) + for _, token := range tokens { + var inputs []byte + balance, err := token.BalanceOf(context.Background(), contractAddress.Hex()) + if err != nil { + return err + } + inputs, err = TransferTokenCallData(common.HexToAddress(evmClient.GetDefaultWallet().Address()), balance) + if err != nil { + return err + } + data := Call{Target: token.ContractAddress, AllowFailure: false, CallData: inputs} + callData = append(callData, data) + } + + opts, err := evmClient.TransactionOpts(evmClient.GetDefaultWallet()) + if err != nil { + return err + } + + // call aggregate3 to group all msg call data and send them in a single transaction + tx, err := boundContract.Transact(opts, "aggregate3", callData) + if err != nil { + return err + } + err = WaitForSuccessfulTxMined(evmClient, tx) + if err != nil { + return errors.Wrapf(err, "token transfer failed for token; router %s", contractAddress.Hex()) + } + return nil +} diff --git a/integration-tests/ccip-tests/load/ccip_loadgen.go b/integration-tests/ccip-tests/load/ccip_loadgen.go new file mode 100644 index 00000000000..3ce770d31bc --- /dev/null +++ b/integration-tests/ccip-tests/load/ccip_loadgen.go @@ -0,0 +1,395 @@ +package load + +import ( + "context" + crypto_rand "crypto/rand" + "encoding/base64" + "fmt" + "math/big" + "strconv" + "testing" + "time" + + "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/testcontext" + + "github.com/AlekSi/pointer" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/rs/zerolog" + chain_selectors "github.com/smartcontractkit/chain-selectors" + "github.com/stretchr/testify/require" + "go.uber.org/atomic" + + "github.com/smartcontractkit/chainlink-testing-framework/wasp" + + "github.com/smartcontractkit/chainlink-common/pkg/config" + + "github.com/smartcontractkit/chainlink/integration-tests/ccip-tests/contracts" + "github.com/smartcontractkit/chainlink/integration-tests/ccip-tests/testconfig" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/router" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/testhelpers" + + "github.com/smartcontractkit/chainlink/integration-tests/ccip-tests/actions" + "github.com/smartcontractkit/chainlink/integration-tests/ccip-tests/testreporters" +) + +// CCIPLaneOptimized is a light-weight version of CCIPLane, It only contains elements which are used during load triggering and validation +type CCIPLaneOptimized struct { + Logger *zerolog.Logger + SourceNetworkName string + DestNetworkName string + Source *actions.SourceCCIPModule + Dest *actions.DestCCIPModule + Reports *testreporters.CCIPLaneStats +} + +type CCIPE2ELoad struct { + t *testing.T + Lane *CCIPLaneOptimized + NoOfReq int64 // approx no of Request fired + CurrentMsgSerialNo *atomic.Int64 // current msg serial number in the load sequence + CallTimeOut time.Duration // max time to wait for various on-chain events + msg router.ClientEVM2AnyMessage + MaxDataBytes uint32 + SendMaxDataIntermittentlyInMsgCount int64 + SkipRequestIfAnotherRequestTriggeredWithin *config.Duration + LastFinalizedTxBlock atomic.Uint64 + LastFinalizedTimestamp atomic.Time + MsgProfiles *testconfig.MsgProfile + EOAReceiver []byte +} + +func NewCCIPLoad( + t *testing.T, + lane *actions.CCIPLane, + timeout time.Duration, + noOfReq int64, + m *testconfig.MsgProfile, + sendMaxDataIntermittentlyInEveryMsgCount int64, + SkipRequestIfAnotherRequestTriggeredWithin *config.Duration, +) *CCIPE2ELoad { + // to avoid holding extra data + loadLane := &CCIPLaneOptimized{ + Logger: lane.Logger, + SourceNetworkName: lane.SourceNetworkName, + DestNetworkName: lane.DestNetworkName, + Source: lane.Source, + Dest: lane.Dest, + Reports: lane.Reports, + } + + return &CCIPE2ELoad{ + t: t, + Lane: loadLane, + CurrentMsgSerialNo: atomic.NewInt64(1), + CallTimeOut: timeout, + NoOfReq: noOfReq, + SendMaxDataIntermittentlyInMsgCount: sendMaxDataIntermittentlyInEveryMsgCount, + SkipRequestIfAnotherRequestTriggeredWithin: SkipRequestIfAnotherRequestTriggeredWithin, + MsgProfiles: m, + } +} + +// BeforeAllCall funds subscription, approves the token transfer amount. +// Needs to be called before load sequence is started. +// Needs to approve and fund for the entire sequence. +func (c *CCIPE2ELoad) BeforeAllCall() { + sourceCCIP := c.Lane.Source + destCCIP := c.Lane.Dest + + receiver, err := utils.ABIEncode(`[{"type":"address"}]`, destCCIP.ReceiverDapp.EthAddress) + require.NoError(c.t, err, "Failed encoding the receiver address") + c.msg = router.ClientEVM2AnyMessage{ + Receiver: receiver, + FeeToken: common.HexToAddress(sourceCCIP.Common.FeeToken.Address()), + Data: []byte("message with Id 1"), + } + var tokenAndAmounts []router.ClientEVMTokenAmount + if len(c.Lane.Source.Common.BridgeTokens) > 0 { + for i := range c.Lane.Source.TransferAmount { + // if length of sourceCCIP.TransferAmount is more than available bridge token use first bridge token + token := sourceCCIP.Common.BridgeTokens[0] + if i < len(sourceCCIP.Common.BridgeTokens) { + token = sourceCCIP.Common.BridgeTokens[i] + } + tokenAndAmounts = append(tokenAndAmounts, router.ClientEVMTokenAmount{ + Token: common.HexToAddress(token.Address()), Amount: c.Lane.Source.TransferAmount[i], + }) + } + c.msg.TokenAmounts = tokenAndAmounts + } + // we might need to change the receiver to the default wallet of destination based on the gaslimit of msg + // Get the receiver's bytecode to check if it's a contract or EOA + bytecode, err := c.Lane.Dest.Common.ChainClient.Backend().CodeAt(context.Background(), c.Lane.Dest.ReceiverDapp.EthAddress, nil) + require.NoError(c.t, err, "Failed to get bytecode of the receiver contract") + // if the bytecode is empty, it's an EOA, + // In that case save the receiver address as EOA to be used in the message + // Otherwise save destination's default wallet address as EOA + // so that it can be used later for msgs with gaslimit 0 + if len(bytecode) > 0 { + receiver, err := utils.ABIEncode(`[{"type":"address"}]`, common.HexToAddress(c.Lane.Dest.Common.ChainClient.GetDefaultWallet().Address())) + require.NoError(c.t, err, "Failed encoding the receiver address") + c.EOAReceiver = receiver + } else { + c.EOAReceiver = c.msg.Receiver + } + if c.SendMaxDataIntermittentlyInMsgCount > 0 { + cfg, err := sourceCCIP.OnRamp.Instance.GetDynamicConfig(nil) + require.NoError(c.t, err, "failed to fetch dynamic config") + c.MaxDataBytes = cfg.MaxDataBytes + } + // if the msg is sent via multicall, transfer the token transfer amount to multicall contract + if sourceCCIP.Common.MulticallEnabled && + sourceCCIP.Common.MulticallContract != (common.Address{}) && + len(c.Lane.Source.Common.BridgeTokens) > 0 { + for i, amount := range sourceCCIP.TransferAmount { + // if length of sourceCCIP.TransferAmount is more than available bridge token use first bridge token + token := sourceCCIP.Common.BridgeTokens[0] + if i < len(sourceCCIP.Common.BridgeTokens) { + token = sourceCCIP.Common.BridgeTokens[i] + } + amountToApprove := new(big.Int).Mul(amount, big.NewInt(c.NoOfReq)) + bal, err := token.BalanceOf(context.Background(), sourceCCIP.Common.MulticallContract.Hex()) + require.NoError(c.t, err, "Failed to get token balance") + if bal.Cmp(amountToApprove) < 0 { + err := token.Transfer(token.OwnerWallet, sourceCCIP.Common.MulticallContract.Hex(), amountToApprove) + require.NoError(c.t, err, "Failed to approve token transfer amount") + } + } + } + + c.LastFinalizedTxBlock.Store(c.Lane.Source.NewFinalizedBlockNum.Load()) + c.LastFinalizedTimestamp.Store(c.Lane.Source.NewFinalizedBlockTimestamp.Load()) + + sourceCCIP.Common.ChainClient.ParallelTransactions(false) + destCCIP.Common.ChainClient.ParallelTransactions(false) +} + +func (c *CCIPE2ELoad) CCIPMsg() (router.ClientEVM2AnyMessage, *testreporters.RequestStat, error) { + msgSerialNo := c.CurrentMsgSerialNo.Load() + c.CurrentMsgSerialNo.Inc() + msgDetails := c.MsgProfiles.MsgDetailsForIteration(msgSerialNo) + stats := testreporters.NewCCIPRequestStats(msgSerialNo, c.Lane.SourceNetworkName, c.Lane.DestNetworkName) + // form the message for transfer + msgLength := pointer.GetInt64(msgDetails.DataLength) + gasLimit := pointer.GetInt64(msgDetails.DestGasLimit) + msg := c.msg + if msgLength > 0 && msgDetails.IsDataTransfer() { + if c.SendMaxDataIntermittentlyInMsgCount > 0 { + // every SendMaxDataIntermittentlyInMsgCount message will have extra data with almost MaxDataBytes + if msgSerialNo%c.SendMaxDataIntermittentlyInMsgCount == 0 { + msgLength = int64(c.MaxDataBytes - 1) + } + } + b := make([]byte, msgLength) + _, err := crypto_rand.Read(b) + if err != nil { + return router.ClientEVM2AnyMessage{}, stats, fmt.Errorf("failed to generate random string %w", err) + } + randomString := base64.URLEncoding.EncodeToString(b) + msg.Data = []byte(randomString[:msgLength]) + } + if !msgDetails.IsTokenTransfer() { + msg.TokenAmounts = []router.ClientEVMTokenAmount{} + } + + var ( + extraArgs []byte + err error + ) + matchErr := contracts.MatchContractVersionsOrAbove(map[contracts.Name]contracts.Version{ + contracts.OnRampContract: contracts.V1_5_0, + }) + // TODO: The CCIP Offchain upgrade tests make the AllowOutOfOrder flag tricky in this case. + // It runs with out of date contract versions at first, then upgrades them. So transactions will assume that the new contracts are there + // before being deployed. So setting v2 args will break the test. This is a bit of a hack to get around that. + // The test will soon be deprecated, so a temporary solution is fine. + if matchErr != nil || !c.Lane.Source.Common.AllowOutOfOrder { + extraArgs, err = testhelpers.GetEVMExtraArgsV1(big.NewInt(gasLimit), false) + } else { + extraArgs, err = testhelpers.GetEVMExtraArgsV2(big.NewInt(gasLimit), c.Lane.Source.Common.AllowOutOfOrder) + } + if err != nil { + return router.ClientEVM2AnyMessage{}, stats, err + } + msg.ExtraArgs = extraArgs + // if gaslimit is 0, set the receiver to EOA + if gasLimit == 0 { + msg.Receiver = c.EOAReceiver + } + return msg, stats, nil +} + +func (c *CCIPE2ELoad) Call(_ *wasp.Generator) *wasp.Response { + res := &wasp.Response{} + sourceCCIP := c.Lane.Source + var recentRequestFoundAt *time.Time + var err error + // Use IsPastRequestTriggeredWithinTimeframe to check for any historical CCIP send request events + // within the specified timeframe for the first message. Subsequently, use the watcher method to monitor + // and detect any new events as they occur. + if c.CurrentMsgSerialNo.Load() == int64(1) { + recentRequestFoundAt, err = sourceCCIP.IsPastRequestTriggeredWithinTimeframe(testcontext.Get(c.t), c.SkipRequestIfAnotherRequestTriggeredWithin) + require.NoError(c.t, err, "error while filtering past requests") + } else { + recentRequestFoundAt = sourceCCIP.IsRequestTriggeredWithinTimeframe(c.SkipRequestIfAnotherRequestTriggeredWithin) + } + + if recentRequestFoundAt != nil { + c.Lane.Logger. + Info(). + Str("Found At=", recentRequestFoundAt.String()). + Msgf("Skipping ...Another Request found within given timeframe %s", c.SkipRequestIfAnotherRequestTriggeredWithin.String()) + return res + } + // if there is an connection error , we will skip sending the request + // this is to avoid sending the request when the connection is not restored yet + if sourceCCIP.Common.IsConnectionRestoredRecently != nil { + if !sourceCCIP.Common.IsConnectionRestoredRecently.Load() { + c.Lane.Logger.Info().Msg("RPC Connection Error.. skipping this request") + res.Failed = true + res.Error = "RPC Connection error .. this request was skipped" + return res + } + c.Lane.Logger.Info().Msg("Connection is restored, Resuming load") + } + msg, stats, err := c.CCIPMsg() + if err != nil { + res.Error = err.Error() + res.Failed = true + return res + } + msgSerialNo := stats.ReqNo + // create a sub-logger for the request + lggr := c.Lane.Logger.With().Int64("msg Number", stats.ReqNo).Logger() + + feeToken := sourceCCIP.Common.FeeToken.EthAddress + // initiate the transfer + lggr.Debug().Str("triggeredAt", time.Now().GoString()).Msg("triggering transfer") + var sendTx *types.Transaction + + destChainSelector, err := chain_selectors.SelectorFromChainId(sourceCCIP.DestinationChainId) + if err != nil { + res.Error = fmt.Sprintf("reqNo %d err %s - while getting selector from chainid", msgSerialNo, err.Error()) + res.Failed = true + return res + } + + // initiate the transfer + // if the token address is 0x0 it will use Native as fee token and the fee amount should be mentioned in bind.TransactOpts's value + fee, err := sourceCCIP.Common.Router.GetFee(destChainSelector, msg) + if err != nil { + res.Error = fmt.Sprintf("reqNo %d err %s - while getting fee from router", msgSerialNo, err.Error()) + res.Failed = true + return res + } + startTime := time.Now().UTC() + if feeToken != common.HexToAddress("0x0") { + sendTx, err = sourceCCIP.Common.Router.CCIPSendAndProcessTx(destChainSelector, msg, nil) + } else { + // add a bit buffer to fee + sendTx, err = sourceCCIP.Common.Router.CCIPSendAndProcessTx(destChainSelector, msg, new(big.Int).Add(big.NewInt(1e5), fee)) + } + if err != nil { + stats.UpdateState(&lggr, 0, testreporters.TX, time.Since(startTime), testreporters.Failure, nil) + res.Error = fmt.Sprintf("ccip-send tx error %s for reqNo %d", err.Error(), msgSerialNo) + res.Data = stats.StatusByPhase + res.Failed = true + return res + } + + // the msg is no longer needed, so we can clear it to avoid holding extra data during load + // nolint:ineffassign,staticcheck + msg = router.ClientEVM2AnyMessage{} + + txConfirmationTime := time.Now().UTC() + lggr = lggr.With().Str("Msg Tx", sendTx.Hash().String()).Logger() + + stats.UpdateState(&lggr, 0, testreporters.TX, txConfirmationTime.Sub(startTime), testreporters.Success, nil) + err = c.Validate(lggr, sendTx, txConfirmationTime, []*testreporters.RequestStat{stats}) + if err != nil { + res.Error = err.Error() + res.Failed = true + res.Data = stats.StatusByPhase + return res + } + res.Data = stats.StatusByPhase + return res +} + +func (c *CCIPE2ELoad) Validate(lggr zerolog.Logger, sendTx *types.Transaction, txConfirmationTime time.Time, stats []*testreporters.RequestStat) error { + // wait for + // - CCIPSendRequested Event log to be generated, + msgLogs, sourceLogTime, err := c.Lane.Source.AssertEventCCIPSendRequested(&lggr, sendTx.Hash().Hex(), c.CallTimeOut, txConfirmationTime, stats) + if err != nil { + return err + } + + lstFinalizedBlock := c.LastFinalizedTxBlock.Load() + var sourceLogFinalizedAt time.Time + // if the finality tag is enabled and the last finalized block is greater than the block number of the message + // consider the message finalized + if c.Lane.Source.Common.ChainClient.GetNetworkConfig().FinalityDepth == 0 && + lstFinalizedBlock != 0 && lstFinalizedBlock > msgLogs[0].LogInfo.BlockNumber { + sourceLogFinalizedAt = c.LastFinalizedTimestamp.Load() + for i, stat := range stats { + stat.UpdateState(&lggr, stat.SeqNum, testreporters.SourceLogFinalized, + sourceLogFinalizedAt.Sub(sourceLogTime), testreporters.Success, + &testreporters.TransactionStats{ + TxHash: msgLogs[i].LogInfo.TxHash.Hex(), + FinalizedByBlock: strconv.FormatUint(lstFinalizedBlock, 10), + FinalizedAt: sourceLogFinalizedAt.String(), + Fee: msgLogs[i].Fee.String(), + NoOfTokensSent: msgLogs[i].NoOfTokens, + MessageBytesLength: int64(msgLogs[i].DataLength), + MsgID: fmt.Sprintf("0x%x", msgLogs[i].MessageId[:]), + }) + } + } else { + var finalizingBlock uint64 + sourceLogFinalizedAt, finalizingBlock, err = c.Lane.Source.AssertSendRequestedLogFinalized( + &lggr, msgLogs[0].LogInfo.TxHash, msgLogs, sourceLogTime, stats) + if err != nil { + return err + } + c.LastFinalizedTxBlock.Store(finalizingBlock) + c.LastFinalizedTimestamp.Store(sourceLogFinalizedAt) + } + + for _, msgLog := range msgLogs { + seqNum := msgLog.SequenceNumber + var reqStat *testreporters.RequestStat + lggr = lggr.With().Str("MsgID", fmt.Sprintf("0x%x", msgLog.MessageId[:])).Logger() + for _, stat := range stats { + if stat.SeqNum == seqNum { + reqStat = stat + break + } + } + if reqStat == nil { + return fmt.Errorf("could not find request stat for seq number %d", seqNum) + } + // wait for + // - CommitStore to increase the seq number, + err = c.Lane.Dest.AssertSeqNumberExecuted(&lggr, seqNum, c.CallTimeOut, sourceLogFinalizedAt, reqStat) + if err != nil { + return err + } + // wait for ReportAccepted event + commitReport, reportAcceptedAt, err := c.Lane.Dest.AssertEventReportAccepted(&lggr, seqNum, c.CallTimeOut, sourceLogFinalizedAt, reqStat) + if err != nil || commitReport == nil { + return err + } + blessedAt, err := c.Lane.Dest.AssertReportBlessed(&lggr, seqNum, c.CallTimeOut, *commitReport, reportAcceptedAt, reqStat) + if err != nil { + return err + } + _, err = c.Lane.Dest.AssertEventExecutionStateChanged(&lggr, seqNum, c.CallTimeOut, blessedAt, reqStat, testhelpers.ExecutionStateSuccess) + if err != nil { + return err + } + } + + return nil +} diff --git a/integration-tests/ccip-tests/load/ccip_multicall_loadgen.go b/integration-tests/ccip-tests/load/ccip_multicall_loadgen.go new file mode 100644 index 00000000000..04fcffaa4b1 --- /dev/null +++ b/integration-tests/ccip-tests/load/ccip_multicall_loadgen.go @@ -0,0 +1,272 @@ +package load + +import ( + "fmt" + "math/big" + "testing" + "time" + + "github.com/ethereum/go-ethereum/common" + "github.com/prometheus/common/model" + "github.com/rs/zerolog" + "golang.org/x/sync/errgroup" + + chain_selectors "github.com/smartcontractkit/chain-selectors" + + "github.com/smartcontractkit/chainlink-testing-framework/wasp" + + "github.com/smartcontractkit/chainlink-testing-framework/lib/blockchain" + "github.com/smartcontractkit/chainlink-testing-framework/lib/logging" + + "github.com/smartcontractkit/chainlink/integration-tests/ccip-tests/actions" + "github.com/smartcontractkit/chainlink/integration-tests/ccip-tests/contracts" + "github.com/smartcontractkit/chainlink/integration-tests/ccip-tests/testreporters" + "github.com/smartcontractkit/chainlink/integration-tests/ccip-tests/testsetups" +) + +// CCIPMultiCallLoadGenerator represents a load generator for the CCIP lanes originating from same network +// The purpose of this load generator is to group ccip-send calls for the CCIP lanes originating from same network +// This is to avoid the scenario of hitting rpc rate limit for the same network if the load generator is sending +// too many ccip-send calls to the same network hitting the rpc rate limit +type CCIPMultiCallLoadGenerator struct { + t *testing.T + logger zerolog.Logger + client blockchain.EVMClient + E2ELoads map[string]*CCIPE2ELoad + MultiCall string + NoOfRequestsPerUnitTime int64 + labels model.LabelSet + loki *wasp.LokiClient + responses chan map[string]MultiCallReturnValues + Done chan struct{} +} + +type MultiCallReturnValues struct { + Msgs []contracts.CCIPMsgData + Stats []*testreporters.RequestStat +} + +func NewMultiCallLoadGenerator(testCfg *testsetups.CCIPTestConfig, lanes []*actions.CCIPLane, noOfRequestsPerUnitTime int64, labels map[string]string) (*CCIPMultiCallLoadGenerator, error) { + // check if all lanes are from same network + source := lanes[0].Source.Common.ChainClient.GetChainID() + multiCall := lanes[0].Source.Common.MulticallContract.Hex() + if multiCall == "" { + return nil, fmt.Errorf("multicall address cannot be empty") + } + for i := 1; i < len(lanes); i++ { + if source.String() != lanes[i].Source.Common.ChainClient.GetChainID().String() { + return nil, fmt.Errorf("all lanes should be from same network; expected %s, got %s", source, lanes[i].Source.Common.ChainClient.GetChainID()) + } + if lanes[i].Source.Common.MulticallContract.Hex() != multiCall { + return nil, fmt.Errorf("multicall address should be same for all lanes") + } + } + client := lanes[0].Source.Common.ChainClient + lggr := logging.GetTestLogger(testCfg.Test).With().Str("Source Network", client.GetNetworkName()).Logger() + ls := wasp.LabelsMapToModel(labels) + if err := ls.Validate(); err != nil { + return nil, err + } + lokiConfig := testCfg.EnvInput.Logging.Loki + loki, err := wasp.NewLokiClient(wasp.NewLokiConfig(lokiConfig.Endpoint, lokiConfig.TenantId, nil, nil)) + if err != nil { + return nil, err + } + m := &CCIPMultiCallLoadGenerator{ + t: testCfg.Test, + client: client, + MultiCall: multiCall, + logger: lggr, + NoOfRequestsPerUnitTime: noOfRequestsPerUnitTime, + E2ELoads: make(map[string]*CCIPE2ELoad), + labels: ls, + loki: loki, + responses: make(chan map[string]MultiCallReturnValues), + Done: make(chan struct{}), + } + for _, lane := range lanes { + // for multicall load generator, we don't want to send max data intermittently, it might + // cause oversized data for multicall + ccipLoad := NewCCIPLoad( + testCfg.Test, lane, testCfg.TestGroupInput.PhaseTimeout.Duration(), + 100000, + testCfg.TestGroupInput.LoadProfile.MsgProfile, 0, + testCfg.TestGroupInput.LoadProfile.SkipRequestIfAnotherRequestTriggeredWithin, + ) + ccipLoad.BeforeAllCall() + m.E2ELoads[fmt.Sprintf("%s-%s", lane.SourceNetworkName, lane.DestNetworkName)] = ccipLoad + } + + m.StartLokiStream() + return m, nil +} + +func (m *CCIPMultiCallLoadGenerator) Stop() error { + m.Done <- struct{}{} + tokenMap := make(map[string]struct{}) + var tokens []*contracts.ERC20Token + for _, e2eLoad := range m.E2ELoads { + for i := range e2eLoad.Lane.Source.TransferAmount { + // if length of sourceCCIP.TransferAmount is more than available bridge token use first bridge token + token := e2eLoad.Lane.Source.Common.BridgeTokens[0] + if i < len(e2eLoad.Lane.Source.Common.BridgeTokens) { + token = e2eLoad.Lane.Source.Common.BridgeTokens[i] + } + if _, ok := tokenMap[token.Address()]; !ok { + tokens = append(tokens, e2eLoad.Lane.Source.Common.BridgeTokens[i]) + } + } + } + if len(tokens) > 0 { + return contracts.TransferTokens(m.client, common.HexToAddress(m.MultiCall), tokens) + } + return nil +} + +func (m *CCIPMultiCallLoadGenerator) StartLokiStream() { + go func() { + for { + select { + case <-m.Done: + m.logger.Info().Msg("stopping loki client from multi call load generator") + m.loki.Stop() + return + case rValues := <-m.responses: + m.HandleLokiLogs(rValues) + } + } + }() +} + +func (m *CCIPMultiCallLoadGenerator) HandleLokiLogs(rValues map[string]MultiCallReturnValues) { + for dest, rValue := range rValues { + labels := m.labels.Merge(model.LabelSet{ + "dest_chain": model.LabelValue(dest), + "test_data_type": "responses", + "go_test_name": model.LabelValue(m.t.Name()), + }) + for _, stat := range rValue.Stats { + err := m.loki.HandleStruct(labels, time.Now().UTC(), stat.StatusByPhase) + if err != nil { + m.logger.Error().Err(err).Msg("error while handling loki logs") + } + } + } +} + +func (m *CCIPMultiCallLoadGenerator) Call(_ *wasp.Generator) *wasp.Response { + res := &wasp.Response{} + msgs, returnValuesByDest, err := m.MergeCalls() + if err != nil { + res.Error = err.Error() + res.Failed = true + return res + } + defer func() { + m.responses <- returnValuesByDest + }() + m.logger.Info().Interface("msgs", msgs).Msgf("Sending %d ccip-send calls", len(msgs)) + startTime := time.Now().UTC() + // for now we are using all ccip-sends with native + sendTx, err := contracts.MultiCallCCIP(m.client, m.MultiCall, msgs, true) + if err != nil { + res.Error = err.Error() + res.Failed = true + return res + } + + lggr := m.logger.With().Str("Msg Tx", sendTx.Hash().String()).Logger() + txConfirmationTime := time.Now().UTC() + for _, rValues := range returnValuesByDest { + if len(rValues.Stats) != len(rValues.Msgs) { + res.Error = fmt.Sprintf("number of stats %d and msgs %d should be same", len(rValues.Stats), len(rValues.Msgs)) + res.Failed = true + return res + } + for _, stat := range rValues.Stats { + stat.UpdateState(&lggr, 0, testreporters.TX, startTime.Sub(txConfirmationTime), testreporters.Success, nil) + } + } + + validateGrp := errgroup.Group{} + // wait for + // - CCIPSendRequested Event log to be generated, + for _, rValues := range returnValuesByDest { + key := fmt.Sprintf("%s-%s", rValues.Stats[0].SourceNetwork, rValues.Stats[0].DestNetwork) + c, ok := m.E2ELoads[key] + if !ok { + res.Error = fmt.Sprintf("load for %s not found", key) + res.Failed = true + return res + } + + lggr = lggr.With().Str("Source Network", c.Lane.Source.Common.ChainClient.GetNetworkName()).Str("Dest Network", c.Lane.Dest.Common.ChainClient.GetNetworkName()).Logger() + stats := rValues.Stats + txConfirmationTime := txConfirmationTime + sendTx := sendTx + lggr := lggr + validateGrp.Go(func() error { + return c.Validate(lggr, sendTx, txConfirmationTime, stats) + }) + } + err = validateGrp.Wait() + if err != nil { + res.Error = err.Error() + res.Failed = true + return res + } + + return res +} + +func (m *CCIPMultiCallLoadGenerator) MergeCalls() ([]contracts.CCIPMsgData, map[string]MultiCallReturnValues, error) { + var ccipMsgs []contracts.CCIPMsgData + statDetails := make(map[string]MultiCallReturnValues) + + for _, e2eLoad := range m.E2ELoads { + destChainSelector, err := chain_selectors.SelectorFromChainId(e2eLoad.Lane.Source.DestinationChainId) + if err != nil { + return ccipMsgs, statDetails, err + } + + allFee := big.NewInt(0) + var allStatsForDest []*testreporters.RequestStat + var allMsgsForDest []contracts.CCIPMsgData + for i := int64(0); i < m.NoOfRequestsPerUnitTime; i++ { + msg, stats, err := e2eLoad.CCIPMsg() + if err != nil { + return ccipMsgs, statDetails, err + } + msg.FeeToken = common.Address{} + fee, err := e2eLoad.Lane.Source.Common.Router.GetFee(destChainSelector, msg) + if err != nil { + return ccipMsgs, statDetails, err + } + // transfer fee to the multicall address + if msg.FeeToken != (common.Address{}) { + allFee = new(big.Int).Add(allFee, fee) + } + msgData := contracts.CCIPMsgData{ + RouterAddr: e2eLoad.Lane.Source.Common.Router.EthAddress, + ChainSelector: destChainSelector, + Msg: msg, + Fee: fee, + } + ccipMsgs = append(ccipMsgs, msgData) + + allStatsForDest = append(allStatsForDest, stats) + allMsgsForDest = append(allMsgsForDest, msgData) + } + statDetails[e2eLoad.Lane.DestNetworkName] = MultiCallReturnValues{ + Stats: allStatsForDest, + Msgs: allMsgsForDest, + } + // transfer fee to the multicall address + if allFee.Cmp(big.NewInt(0)) > 0 { + if err := e2eLoad.Lane.Source.Common.FeeToken.Transfer(e2eLoad.Lane.Source.Common.MulticallContract.Hex(), allFee); err != nil { + return ccipMsgs, statDetails, err + } + } + } + return ccipMsgs, statDetails, nil +} diff --git a/integration-tests/ccip-tests/load/ccip_test.go b/integration-tests/ccip-tests/load/ccip_test.go new file mode 100644 index 00000000000..a8297dd2096 --- /dev/null +++ b/integration-tests/ccip-tests/load/ccip_test.go @@ -0,0 +1,331 @@ +package load + +import ( + "testing" + "time" + + "github.com/rs/zerolog/log" + "github.com/stretchr/testify/require" + + "github.com/smartcontractkit/chainlink-common/pkg/config" + "github.com/smartcontractkit/chainlink-testing-framework/lib/k8s/chaos" + "github.com/smartcontractkit/chainlink-testing-framework/lib/logging" + "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/ptr" + + "github.com/smartcontractkit/chainlink/integration-tests/ccip-tests/actions" + "github.com/smartcontractkit/chainlink/integration-tests/ccip-tests/testsetups" +) + +func TestLoadCCIPStableRPS(t *testing.T) { + t.Parallel() + lggr := logging.GetTestLogger(t) + testArgs := NewLoadArgs(t, lggr) + testArgs.Setup() + // if the test runs on remote runner + if len(testArgs.TestSetupArgs.Lanes) == 0 { + return + } + t.Cleanup(func() { + log.Info().Msg("Tearing down the environment") + require.NoError(t, testArgs.TestSetupArgs.TearDown()) + }) + testArgs.TriggerLoadByLane() + testArgs.Wait() +} + +// TestLoadCCIPWithUpgradeNodeVersion starts all nodes with a specific version, triggers load and then upgrades the node version as the load is running +func TestLoadCCIPWithUpgradeNodeVersion(t *testing.T) { + t.Parallel() + lggr := logging.GetTestLogger(t) + testArgs := NewLoadArgs(t, lggr) + testArgs.Setup() + // if the test runs on remote runner + if len(testArgs.TestSetupArgs.Lanes) == 0 { + return + } + t.Cleanup(func() { + log.Info().Msg("Tearing down the environment") + require.NoError(t, testArgs.TestSetupArgs.TearDown()) + }) + testArgs.TriggerLoadByLane() + testArgs.lggr.Info().Msg("Waiting for load to start on all lanes") + // wait for load runner to start + testArgs.LoadStarterWg.Wait() + // sleep for 30s to let load run for a while + time.Sleep(30 * time.Second) + // upgrade node version for few nodes + err := testsetups.UpgradeNodes(testArgs.t, testArgs.lggr, testArgs.TestCfg, testArgs.TestSetupArgs.Env) + require.NoError(t, err) + // after upgrade send a request to all lanes as a sanity check + testArgs.SanityCheck() + // now wait for the load to finish + testArgs.Wait() +} + +func TestLoadCCIPStableRPSTriggerBySource(t *testing.T) { + t.Parallel() + lggr := logging.GetTestLogger(t) + testArgs := NewLoadArgs(t, lggr) + testArgs.TestCfg.TestGroupInput.MulticallInOneTx = ptr.Ptr(true) + testArgs.Setup() + // if the test runs on remote runner + if len(testArgs.TestSetupArgs.Lanes) == 0 { + return + } + t.Cleanup(func() { + log.Info().Msg("Tearing down the environment") + testArgs.TearDown() + }) + testArgs.TriggerLoadBySource() + testArgs.Wait() +} + +func TestLoadCCIPStableRequestTriggeringWithNetworkChaos(t *testing.T) { + t.Parallel() + lggr := logging.GetTestLogger(t) + testArgs := NewLoadArgs(t, lggr) + testArgs.Setup() + // if the test runs on remote runner + if len(testArgs.TestSetupArgs.Lanes) == 0 { + return + } + t.Cleanup(func() { + log.Info().Msg("Tearing down the environment") + require.NoError(t, testArgs.TestSetupArgs.TearDown()) + }) + testEnv := testArgs.TestSetupArgs.Env + require.NotNil(t, testEnv) + require.NotNil(t, testEnv.K8Env) + + // apply network chaos so that chainlink's RPC calls are affected by some network delay for the duration of the test + var gethNetworksLabels []string + for _, net := range testArgs.TestCfg.SelectedNetworks { + gethNetworksLabels = append(gethNetworksLabels, actions.GethLabel(net.Name)) + } + testEnv.ChaosLabelForAllGeth(t, gethNetworksLabels) + if testArgs.TestCfg.TestGroupInput.LoadProfile.NetworkChaosDelay == nil { + testArgs.TestCfg.TestGroupInput.LoadProfile.NetworkChaosDelay = config.MustNewDuration(200 * time.Millisecond) + } + chaosId, err := testEnv.K8Env.Chaos.Run( + chaos.NewNetworkLatency( + testEnv.K8Env.Cfg.Namespace, &chaos.Props{ + FromLabels: &map[string]*string{"geth": ptr.Ptr(actions.ChaosGroupCCIPGeth)}, + ToLabels: &map[string]*string{"app": ptr.Ptr("chainlink-0")}, + DurationStr: testArgs.TestCfg.TestGroupInput.LoadProfile.TestDuration.String(), + Delay: testArgs.TestCfg.TestGroupInput.LoadProfile.NetworkChaosDelay.Duration().String(), + })) + require.NoError(t, err) + + t.Cleanup(func() { + if chaosId != "" { + require.NoError(t, testEnv.K8Env.Chaos.Stop(chaosId)) + } + }) + + // now trigger the load + testArgs.TriggerLoadByLane() + testArgs.Wait() +} + +// This test applies pod chaos to the CL nodes asynchronously and sequentially while the load is running +// the pod chaos is applied at a regular interval throughout the test duration +// this test needs to be run for a longer duration to see the effects of pod chaos +// in this test commit and execution are set up to be on the same node +func TestLoadCCIPStableWithMajorityNodeFailure(t *testing.T) { + t.Parallel() + + inputs := []ChaosConfig{ + { + ChaosName: "CCIP works after majority of CL nodes are recovered from pod failure @pod-chaos", + ChaosFunc: chaos.NewFailPods, + ChaosProps: &chaos.Props{ + LabelsSelector: &map[string]*string{actions.ChaosGroupCommitFaultyPlus: ptr.Ptr("1")}, + DurationStr: "2m", + }, + }, + } + + lggr := logging.GetTestLogger(t) + testArgs := NewLoadArgs(t, lggr, inputs...) + + var allChaosDur time.Duration + // to override the default duration of chaos with test input + for i := range inputs { + inputs[i].ChaosProps.DurationStr = testArgs.TestCfg.TestGroupInput.ChaosDuration.String() + allChaosDur += testArgs.TestCfg.TestGroupInput.ChaosDuration.Duration() + inputs[i].WaitBetweenChaos = testArgs.TestCfg.TestGroupInput.LoadProfile.WaitBetweenChaosDuringLoad.Duration() + allChaosDur += inputs[i].WaitBetweenChaos + } + + // the duration of load test should be greater than the duration of chaos + if testArgs.TestCfg.TestGroupInput.LoadProfile.TestDuration.Duration() < allChaosDur+2*time.Minute { + t.Fatalf("Skipping the test as the test duration is less than the chaos duration") + } + + testArgs.Setup() + // if the test runs on remote runner + if len(testArgs.TestSetupArgs.Lanes) == 0 { + return + } + t.Cleanup(func() { + log.Info().Msg("Tearing down the environment") + require.NoError(t, testArgs.TestSetupArgs.TearDown()) + }) + + testEnv := testArgs.TestSetupArgs.Env + require.NotNil(t, testEnv) + require.NotNil(t, testEnv.K8Env) + + testArgs.TriggerLoadByLane() + testArgs.ApplyChaos() + testArgs.Wait() +} + +// This test applies pod chaos to the CL nodes asynchronously and sequentially while the load is running +// the pod chaos is applied at a regular interval throughout the test duration +// this test needs to be run for a longer duration to see the effects of pod chaos +// in this test commit and execution are set up to be on the same node +func TestLoadCCIPStableWithMinorityNodeFailure(t *testing.T) { + t.Parallel() + + inputs := []ChaosConfig{ + { + ChaosName: "CCIP works while minority of CL nodes are in failed state for pod failure @pod-chaos", + ChaosFunc: chaos.NewFailPods, + ChaosProps: &chaos.Props{ + LabelsSelector: &map[string]*string{actions.ChaosGroupCommitFaulty: ptr.Ptr("1")}, + DurationStr: "4m", + }, + }, + } + + lggr := logging.GetTestLogger(t) + testArgs := NewLoadArgs(t, lggr, inputs...) + + var allChaosDur time.Duration + // to override the default duration of chaos with test input + for i := range inputs { + inputs[i].ChaosProps.DurationStr = testArgs.TestCfg.TestGroupInput.ChaosDuration.String() + allChaosDur += testArgs.TestCfg.TestGroupInput.ChaosDuration.Duration() + inputs[i].WaitBetweenChaos = testArgs.TestCfg.TestGroupInput.LoadProfile.WaitBetweenChaosDuringLoad.Duration() + allChaosDur += inputs[i].WaitBetweenChaos + } + + // the duration of load test should be greater than the duration of chaos + if testArgs.TestCfg.TestGroupInput.LoadProfile.TestDuration.Duration() < allChaosDur+2*time.Minute { + t.Fatalf("Skipping the test as the test duration is less than the chaos duration") + } + + testArgs.Setup() + // if the test runs on remote runner + if len(testArgs.TestSetupArgs.Lanes) == 0 { + return + } + t.Cleanup(func() { + log.Info().Msg("Tearing down the environment") + require.NoError(t, testArgs.TestSetupArgs.TearDown()) + }) + + testEnv := testArgs.TestSetupArgs.Env + require.NotNil(t, testEnv) + require.NotNil(t, testEnv.K8Env) + + testArgs.TriggerLoadByLane() + testArgs.ApplyChaos() + testArgs.Wait() +} + +// This test applies pod chaos to the CL nodes asynchronously and sequentially while the load is running +// the pod chaos is applied at a regular interval throughout the test duration +// in this test commit and execution are set up to be on different node +func TestLoadCCIPStableWithPodChaosDiffCommitAndExec(t *testing.T) { + t.Parallel() + inputs := []ChaosConfig{ + { + ChaosName: "CCIP Commit works after majority of CL nodes are recovered from pod failure @pod-chaos", + ChaosFunc: chaos.NewFailPods, + ChaosProps: &chaos.Props{ + LabelsSelector: &map[string]*string{actions.ChaosGroupCommitFaultyPlus: ptr.Ptr("1")}, + DurationStr: "2m", + }, + }, + { + ChaosName: "CCIP Execution works after majority of CL nodes are recovered from pod failure @pod-chaos", + ChaosFunc: chaos.NewFailPods, + ChaosProps: &chaos.Props{ + LabelsSelector: &map[string]*string{actions.ChaosGroupExecutionFaultyPlus: ptr.Ptr("1")}, + DurationStr: "2m", + }, + }, + { + ChaosName: "CCIP Commit works while minority of CL nodes are in failed state for pod failure @pod-chaos", + ChaosFunc: chaos.NewFailPods, + ChaosProps: &chaos.Props{ + LabelsSelector: &map[string]*string{actions.ChaosGroupCommitFaulty: ptr.Ptr("1")}, + DurationStr: "4m", + }, + }, + { + ChaosName: "CCIP Execution works while minority of CL nodes are in failed state for pod failure @pod-chaos", + ChaosFunc: chaos.NewFailPods, + ChaosProps: &chaos.Props{ + LabelsSelector: &map[string]*string{actions.ChaosGroupExecutionFaulty: ptr.Ptr("1")}, + DurationStr: "4m", + }, + }, + } + for _, in := range inputs { + in := in + t.Run(in.ChaosName, func(t *testing.T) { + t.Parallel() + lggr := logging.GetTestLogger(t) + testArgs := NewLoadArgs(t, lggr, in) + testArgs.TestCfg.TestGroupInput.LoadProfile.TestDuration = config.MustNewDuration(5 * time.Minute) + testArgs.TestCfg.TestGroupInput.LoadProfile.TimeUnit = config.MustNewDuration(1 * time.Second) + testArgs.TestCfg.TestGroupInput.LoadProfile.RequestPerUnitTime = []int64{2} + testArgs.TestCfg.TestGroupInput.PhaseTimeout = config.MustNewDuration(15 * time.Minute) + + testArgs.Setup() + // if the test runs on remote runner + if len(testArgs.TestSetupArgs.Lanes) == 0 { + return + } + t.Cleanup(func() { + log.Info().Msg("Tearing down the environment") + require.NoError(t, testArgs.TestSetupArgs.TearDown()) + }) + testArgs.SanityCheck() + testArgs.TriggerLoadByLane() + testArgs.ApplyChaos() + testArgs.Wait() + }) + } +} + +// TestLoadCCIPStableRPSAfterARMCurseAndUncurse validates that after ARM curse is lifted +// all pending requests get delivered. +// The test pauses loadgen while ARM is cursed and resumes it when curse is lifted. +// There is a known limitation of this test - if the test is run on remote-runner with high frequency +// the remote-runner pod gets evicted after the loadgen is resumed. +// The recommended frequency for this test 2req/min +func TestLoadCCIPStableRPSAfterARMCurseAndUncurse(t *testing.T) { + t.Skipf("need to be enabled as part of CCIP-2277") + t.Parallel() + lggr := logging.GetTestLogger(t) + testArgs := NewLoadArgs(t, lggr) + testArgs.Setup() + // if the test runs on remote runner + if len(testArgs.TestSetupArgs.Lanes) == 0 { + return + } + t.Cleanup(func() { + log.Info().Msg("Tearing down the environment") + require.NoError(t, testArgs.TestSetupArgs.TearDown()) + }) + testArgs.TriggerLoadByLane() + // wait for certain time so that few messages are sent + time.Sleep(2 * time.Minute) + // now validate the curse + testArgs.ValidateCurseFollowedByUncurse() + testArgs.Wait() +} diff --git a/integration-tests/ccip-tests/load/helper.go b/integration-tests/ccip-tests/load/helper.go new file mode 100644 index 00000000000..34860c8871c --- /dev/null +++ b/integration-tests/ccip-tests/load/helper.go @@ -0,0 +1,481 @@ +package load + +import ( + "context" + "fmt" + "math" + "math/big" + "strings" + "sync" + "testing" + "time" + + "github.com/AlekSi/pointer" + "github.com/rs/zerolog" + "github.com/stretchr/testify/require" + "go.uber.org/atomic" + "golang.org/x/sync/errgroup" + + "github.com/smartcontractkit/chainlink-testing-framework/wasp" + + "github.com/smartcontractkit/chainlink-common/pkg/config" + + "github.com/smartcontractkit/chainlink-testing-framework/lib/k8s/chaos" + "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/testcontext" + + "github.com/smartcontractkit/chainlink/integration-tests/ccip-tests/actions" + "github.com/smartcontractkit/chainlink/integration-tests/ccip-tests/testconfig" + "github.com/smartcontractkit/chainlink/integration-tests/ccip-tests/testsetups" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/router" +) + +type ChaosConfig struct { + ChaosName string + ChaosFunc chaos.ManifestFunc + ChaosProps *chaos.Props + WaitBetweenChaos time.Duration +} + +// WaspSchedule calculates the load schedule based on the provided request per unit time and duration +// if multiple step durations are provided, it will calculate the schedule based on the step duration and +// corresponding request per unit time by matching the index of the request per unit time and step duration slice +func WaspSchedule(rps []int64, duration *config.Duration, steps []*config.Duration) []*wasp.Segment { + var segments []*wasp.Segment + var segmentDuration time.Duration + + if len(rps) > 1 { + for i, req := range rps { + duration := steps[i].Duration() + segmentDuration += duration + segments = append(segments, wasp.Plain(req, duration)...) + } + totalDuration := duration.Duration() + repeatTimes := totalDuration.Seconds() / segmentDuration.Seconds() + return wasp.CombineAndRepeat(int(math.Round(repeatTimes)), segments) + } + return wasp.Plain(rps[0], duration.Duration()) +} + +type LoadArgs struct { + t *testing.T + Ctx context.Context + lggr *zerolog.Logger + RunnerWg *errgroup.Group // to wait on individual load generators run + LoadStarterWg *sync.WaitGroup // waits for all the runners to start + TestCfg *testsetups.CCIPTestConfig + TestSetupArgs *testsetups.CCIPTestSetUpOutputs + ChaosExps []ChaosConfig + LoadgenTearDowns []func() + Labels map[string]string + pauseLoad *atomic.Bool +} + +func (l *LoadArgs) SetReportParams() { + var qParams []string + for k, v := range l.Labels { + qParams = append(qParams, fmt.Sprintf("var-%s=%s", k, v)) + } + // add one of the source and destination network to the grafana query params + if len(l.TestSetupArgs.Lanes) > 0 { + qParams = append(qParams, fmt.Sprintf("var-source_chain=%s", l.TestSetupArgs.Lanes[0].ForwardLane.SourceNetworkName)) + qParams = append(qParams, fmt.Sprintf("var-dest_chain=%s", l.TestSetupArgs.Lanes[0].ForwardLane.DestNetworkName)) + } + err := l.TestSetupArgs.Reporter.AddToGrafanaDashboardQueryParams(qParams...) + require.NoError(l.t, err, "failed to set grafana query params") +} + +func (l *LoadArgs) Setup() { + lggr := l.lggr + existing := pointer.GetBool(l.TestCfg.TestGroupInput.ExistingDeployment) + envName := "load-ccip" + if existing { + envName = "ccip-runner" + } + l.TestSetupArgs = testsetups.CCIPDefaultTestSetUp(l.TestCfg.Test, lggr, envName, nil, l.TestCfg) + namespace := l.TestCfg.TestGroupInput.LoadProfile.TestRunName + if l.TestSetupArgs.Env != nil && l.TestSetupArgs.Env.K8Env != nil && l.TestSetupArgs.Env.K8Env.Cfg != nil { + namespace = l.TestSetupArgs.Env.K8Env.Cfg.Namespace + } + l.Labels = map[string]string{ + "test_group": "load", + "test_id": "ccip", + "namespace": namespace, + } + l.TestSetupArgs.Reporter.SetGrafanaURLProvider(l.TestCfg.EnvInput) + l.SetReportParams() +} + +func (l *LoadArgs) scheduleForDest(destNetworkName string) []*wasp.Segment { + require.Greater(l.t, len(l.TestCfg.TestGroupInput.LoadProfile.RequestPerUnitTime), 0, "RequestPerUnitTime must be set") + // try to locate if there is a frequency provided for the destination network + // to locate the frequency, we check if the destination network name contains the network name in the frequency map + // if found, use that frequency for the destination network + // otherwise, use the default frequency + if l.TestCfg.TestGroupInput.LoadProfile.FrequencyByDestination != nil { + for networkName, freq := range l.TestCfg.TestGroupInput.LoadProfile.FrequencyByDestination { + if strings.Contains(destNetworkName, networkName) { + return WaspSchedule( + freq.RequestPerUnitTime, + l.TestCfg.TestGroupInput.LoadProfile.TestDuration, + freq.StepDuration) + } + } + } + + return WaspSchedule( + l.TestCfg.TestGroupInput.LoadProfile.RequestPerUnitTime, + l.TestCfg.TestGroupInput.LoadProfile.TestDuration, + l.TestCfg.TestGroupInput.LoadProfile.StepDuration) +} + +func (l *LoadArgs) SanityCheck() { + var allLanes []*actions.CCIPLane + for _, lane := range l.TestSetupArgs.Lanes { + allLanes = append(allLanes, lane.ForwardLane) + if lane.ReverseLane != nil { + allLanes = append(allLanes, lane.ReverseLane) + } + } + for _, lane := range allLanes { + ccipLoad := NewCCIPLoad( + l.TestCfg.Test, lane, + l.TestCfg.TestGroupInput.PhaseTimeout.Duration(), + 1, l.TestCfg.TestGroupInput.LoadProfile.MsgProfile, + 0, nil, + ) + ccipLoad.BeforeAllCall() + resp := ccipLoad.Call(nil) + require.False(l.t, resp.Failed, "request failed in sanity check") + } +} + +// ValidateCurseFollowedByUncurse assumes the lanes under test are bi-directional. +// It assumes requests in both direction are in flight when this is called. +// It assumes the ARM is not already cursed, it will fail the test if it is in cursed state. +// It curses source ARM for forward lanes so that destination curse is also validated for reverse lanes. +// It waits for 2 minutes for curse to be seen by ccip plugins and contracts. +// It captures the curse timestamp to verify no execution state changed event is emitted after the cure is applied. +// It uncurses the source ARM at the end so that it can be verified that rest of the requests are processed as expected. +// Validates that even after uncursing the lane should not function for 30 more minutes. +func (l *LoadArgs) ValidateCurseFollowedByUncurse() { + var lanes []*actions.CCIPLane + for _, lane := range l.TestSetupArgs.Lanes { + lanes = append(lanes, lane.ForwardLane) + } + // check if source is already cursed + for _, lane := range lanes { + cursed, err := lane.Source.Common.IsCursed() + require.NoError(l.t, err, "cannot get cursed state") + if cursed { + require.Fail(l.t, "test will not work if ARM is already cursed") + } + } + // before cursing set pause + l.pauseLoad.Store(true) + // wait for some time for pause to be active in wasp + l.lggr.Info().Msg("Waiting for 1 minute after applying pause on load") + time.Sleep(1 * time.Minute) + curseTimeStamps := make(map[string]time.Time) + for _, lane := range lanes { + if _, exists := curseTimeStamps[lane.SourceNetworkName]; exists { + continue + } + curseTx, err := lane.Source.Common.CurseARM() + require.NoError(l.t, err, "error in cursing arm") + require.NotNil(l.t, curseTx, "invalid cursetx") + receipt, err := lane.Source.Common.ChainClient.GetTxReceipt(curseTx.Hash()) + require.NoError(l.t, err) + hdr, err := lane.Source.Common.ChainClient.HeaderByNumber(context.Background(), receipt.BlockNumber) + require.NoError(l.t, err) + curseTimeStamps[lane.SourceNetworkName] = hdr.Timestamp + l.lggr.Info().Str("Source", lane.SourceNetworkName).Msg("Curse is applied on source") + l.lggr.Info().Str("Destination", lane.SourceNetworkName).Msg("Curse is applied on destination") + } + + l.lggr.Info().Msg("Curse is applied on all lanes. Waiting for 2 minutes") + time.Sleep(2 * time.Minute) + + for _, lane := range lanes { + // try to send requests on lanes on which curse is applied on source RMN and the request should revert + // data-only transfer is sufficient + lane.Source.TransferAmount = []*big.Int{} + failedTx, _, _, err := lane.Source.SendRequest(lane.Dest.ReceiverDapp.EthAddress, big.NewInt(actions.DefaultDestinationGasLimit)) + if lane.Source.Common.ChainClient.GetNetworkConfig().MinimumConfirmations > 0 { + require.Error(l.t, err) + } else { + require.NoError(l.t, err) + } + errReason, v, err := lane.Source.Common.ChainClient.RevertReasonFromTx(failedTx, router.RouterABI) + require.NoError(l.t, err) + require.Equal(l.t, "BadARMSignal", errReason) + lane.Logger.Info(). + Str("Revert Reason", errReason). + Interface("Args", v). + Str("FailedTx", failedTx.Hex()). + Msg("Msg sent while source ARM is cursed") + } + + // now uncurse all + for _, lane := range lanes { + require.NoError(l.t, lane.Source.Common.UnvoteToCurseARM(), "error to unvote in cursing arm") + } + l.lggr.Info().Msg("Curse is lifted on all lanes") + // lift the pause on load test + l.pauseLoad.Store(false) + + // now add the reverse lanes so that destination curse is also verified + // we add the reverse lanes now to verify absence of commit and execution for the reverse lanes + for _, lane := range l.TestSetupArgs.Lanes { + lanes = append(lanes, lane.ReverseLane) + } + + // verify that even after uncursing the lane should not function for 30 more minutes, + // i.e no execution state changed or commit report accepted event is generated + errGrp := &errgroup.Group{} + for _, lane := range lanes { + lane := lane + curseTimeStamp, exists := curseTimeStamps[lane.SourceNetworkName] + // if curse timestamp does not exist for source, it will exist for destination + if !exists { + curseTimeStamp, exists = curseTimeStamps[lane.DestNetworkName] + require.Truef(l.t, exists, "did not find curse time stamp for lane %s->%s", lane.SourceNetworkName, lane.DestNetworkName) + } + errGrp.Go(func() error { + lane.Logger.Info().Msg("Validating no CommitReportAccepted event is received for 29 minutes") + // we allow additional 1 minute after curse timestamp for curse to be visible by plugin + return lane.Dest.AssertNoReportAcceptedEventReceived(lane.Logger, 25*time.Minute, curseTimeStamp.Add(1*time.Minute)) + }) + errGrp.Go(func() error { + lane.Logger.Info().Msg("Validating no ExecutionStateChanged event is received for 25 minutes") + // we allow additional 1 minute after curse timestamp for curse to be visible by plugin + return lane.Dest.AssertNoExecutionStateChangedEventReceived(lane.Logger, 25*time.Minute, curseTimeStamp.Add(1*time.Minute)) + }) + } + l.lggr.Info().Msg("waiting for no commit/execution validation") + err := errGrp.Wait() + require.NoError(l.t, err, "error received to validate no commit/execution is generated after lane is cursed") +} + +func (l *LoadArgs) TriggerLoadByLane() { + l.TestSetupArgs.Reporter.SetDuration(l.TestCfg.TestGroupInput.LoadProfile.TestDuration.Duration()) + + // start load for a lane + startLoad := func(lane *actions.CCIPLane) { + lane.Logger.Info(). + Str("Source Network", lane.SourceNetworkName). + Str("Destination Network", lane.DestNetworkName). + Msg("Starting load for lane") + sendMaxData := pointer.GetInt64(l.TestCfg.TestGroupInput.LoadProfile.SendMaxDataInEveryMsgCount) + ccipLoad := NewCCIPLoad( + l.TestCfg.Test, lane, l.TestCfg.TestGroupInput.PhaseTimeout.Duration(), + 100000, l.TestCfg.TestGroupInput.LoadProfile.MsgProfile, sendMaxData, + l.TestCfg.TestGroupInput.LoadProfile.SkipRequestIfAnotherRequestTriggeredWithin, + ) + ccipLoad.BeforeAllCall() + // if it's not multicall set the tokens to nil to free up some space, + // we have already formed the msg to be sent in load, there is no need to store the bridge tokens anymore + // In case of multicall we still need the BridgeTokens to transfer amount from mutlicall to owner + if !lane.Source.Common.MulticallEnabled { + lane.Source.Common.BridgeTokens = nil + lane.Dest.Common.BridgeTokens = nil + } + // no need for price registry in load + lane.Source.Common.PriceRegistry = nil + lane.Dest.Common.PriceRegistry = nil + lokiConfig := l.TestCfg.EnvInput.Logging.Loki + labels := make(map[string]string) + for k, v := range l.Labels { + labels[k] = v + } + labels["source_chain"] = lane.SourceNetworkName + labels["dest_chain"] = lane.DestNetworkName + waspCfg := &wasp.Config{ + T: l.TestCfg.Test, + GenName: fmt.Sprintf("lane %s-> %s", lane.SourceNetworkName, lane.DestNetworkName), + Schedule: l.scheduleForDest(lane.DestNetworkName), + LoadType: wasp.RPS, + RateLimitUnitDuration: l.TestCfg.TestGroupInput.LoadProfile.TimeUnit.Duration(), + CallResultBufLen: 10, // we keep the last 10 call results for each generator, as the detailed report is generated at the end of the test + CallTimeout: (l.TestCfg.TestGroupInput.PhaseTimeout.Duration()) * 5, + Gun: ccipLoad, + Logger: *ccipLoad.Lane.Logger, + LokiConfig: wasp.NewLokiConfig(lokiConfig.Endpoint, lokiConfig.TenantId, nil, nil), + Labels: labels, + FailOnErr: pointer.GetBool(l.TestCfg.TestGroupInput.LoadProfile.FailOnFirstErrorInLoad), + } + waspCfg.LokiConfig.Timeout = time.Minute + loadRunner, err := wasp.NewGenerator(waspCfg) + require.NoError(l.TestCfg.Test, err, "error while initiating loadgen for lane %s --> %s", + lane.SourceNetworkName, lane.DestNetworkName) + loadRunner.Run(false) + l.AddToRunnerGroup(loadRunner) + } + + for _, lane := range l.TestSetupArgs.Lanes { + lane := lane + l.LoadStarterWg.Add(1) + go func() { + defer l.LoadStarterWg.Done() + startLoad(lane.ForwardLane) + }() + if pointer.GetBool(l.TestSetupArgs.Cfg.TestGroupInput.BiDirectionalLane) { + l.LoadStarterWg.Add(1) + go func() { + defer l.LoadStarterWg.Done() + startLoad(lane.ReverseLane) + }() + } + } +} + +func (l *LoadArgs) AddToRunnerGroup(gen *wasp.Generator) { + // watch for pause signal + go func(gen *wasp.Generator) { + ticker := time.NewTicker(time.Second) + pausedOnce := false + resumedAlready := false + for { + select { + case <-ticker.C: + if l.pauseLoad.Load() && !pausedOnce { + gen.Pause() + pausedOnce = true + continue + } + if pausedOnce && !resumedAlready && !l.pauseLoad.Load() { + gen.Resume() + resumedAlready = true + } + case <-l.Ctx.Done(): + return + } + } + }(gen) + l.RunnerWg.Go(func() error { + _, failed := gen.Wait() + if failed { + return fmt.Errorf("load run is failed") + } + if len(gen.Errors()) > 0 { + return fmt.Errorf("error in load sequence call %v", gen.Errors()) + } + return nil + }) +} + +func (l *LoadArgs) Wait() { + l.lggr.Info().Msg("Waiting for load to start on all lanes") + // wait for load runner to start + l.LoadStarterWg.Wait() + l.lggr.Info().Msg("Waiting for load to finish on all lanes") + // wait for load runner to finish + err := l.RunnerWg.Wait() + require.NoError(l.t, err, "load run is failed") + l.lggr.Info().Msg("Load finished on all lanes") +} + +func (l *LoadArgs) ApplyChaos() { + testEnv := l.TestSetupArgs.Env + if testEnv == nil || testEnv.K8Env == nil { + l.lggr.Warn().Msg("test environment is nil, skipping chaos") + return + } + testEnv.ChaosLabelForCLNodes(l.TestCfg.Test) + + for _, exp := range l.ChaosExps { + if exp.WaitBetweenChaos > 0 { + l.lggr.Info().Msgf("sleeping for %s after chaos %s", exp.WaitBetweenChaos, exp.ChaosName) + time.Sleep(exp.WaitBetweenChaos) + } + l.lggr.Info().Msgf("Starting to apply chaos %s at %s", exp.ChaosName, time.Now().UTC()) + // apply chaos + chaosId, err := testEnv.K8Env.Chaos.Run(exp.ChaosFunc(testEnv.K8Env.Cfg.Namespace, exp.ChaosProps)) + require.NoError(l.t, err) + if chaosId != "" { + chaosDur, err := time.ParseDuration(exp.ChaosProps.DurationStr) + require.NoError(l.t, err) + err = testEnv.K8Env.Chaos.WaitForAllRecovered(chaosId, chaosDur+1*time.Minute) + require.NoError(l.t, err) + l.lggr.Info().Msgf("chaos %s is recovered at %s", exp.ChaosName, time.Now().UTC()) + err = testEnv.K8Env.Chaos.Stop(chaosId) + require.NoError(l.t, err) + l.lggr.Info().Msgf("stopped chaos %s at %s", exp.ChaosName, time.Now().UTC()) + } + } +} + +func (l *LoadArgs) TearDown() { + for _, tearDn := range l.LoadgenTearDowns { + tearDn() + } + if l.TestSetupArgs.TearDown != nil { + require.NoError(l.t, l.TestSetupArgs.TearDown()) + } +} + +func (l *LoadArgs) TriggerLoadBySource() { + require.NotNil(l.t, l.TestCfg.TestGroupInput.LoadProfile.TestDuration, "test duration input is nil") + require.GreaterOrEqual(l.t, 1, len(l.TestCfg.TestGroupInput.LoadProfile.RequestPerUnitTime), "time unit input must be specified") + l.TestSetupArgs.Reporter.SetDuration(l.TestCfg.TestGroupInput.LoadProfile.TestDuration.Duration()) + var laneBySource = make(map[string][]*actions.CCIPLane) + for _, lane := range l.TestSetupArgs.Lanes { + laneBySource[lane.ForwardLane.SourceNetworkName] = append(laneBySource[lane.ForwardLane.SourceNetworkName], lane.ForwardLane) + if lane.ReverseLane != nil { + laneBySource[lane.ReverseLane.SourceNetworkName] = append(laneBySource[lane.ReverseLane.SourceNetworkName], lane.ReverseLane) + } + } + for source, lanes := range laneBySource { + source := source + lanes := lanes + l.LoadStarterWg.Add(1) + go func() { + defer l.LoadStarterWg.Done() + l.lggr.Info(). + Str("Source Network", source). + Msg("Starting load for source") + allLabels := make(map[string]string) + for k, v := range l.Labels { + allLabels[k] = v + } + allLabels["source_chain"] = source + multiCallGen, err := NewMultiCallLoadGenerator(l.TestCfg, lanes, l.TestCfg.TestGroupInput.LoadProfile.RequestPerUnitTime[0], allLabels) + require.NoError(l.t, err) + lokiConfig := l.TestCfg.EnvInput.Logging.Loki + loadRunner, err := wasp.NewGenerator(&wasp.Config{ + T: l.TestCfg.Test, + GenName: fmt.Sprintf("Source %s", source), + Schedule: wasp.Plain(1, l.TestCfg.TestGroupInput.LoadProfile.TestDuration.Duration()), // hardcoded request per unit time to 1 as we are using multiCallGen + LoadType: wasp.RPS, + RateLimitUnitDuration: l.TestCfg.TestGroupInput.LoadProfile.TimeUnit.Duration(), + CallResultBufLen: 10, // we keep the last 10 call results for each generator, as the detailed report is generated at the end of the test + CallTimeout: (l.TestCfg.TestGroupInput.PhaseTimeout.Duration()) * 5, + Gun: multiCallGen, + Logger: multiCallGen.logger, + LokiConfig: wasp.NewLokiConfig(lokiConfig.Endpoint, lokiConfig.TenantId, nil, nil), + Labels: allLabels, + FailOnErr: pointer.GetBool(l.TestCfg.TestGroupInput.LoadProfile.FailOnFirstErrorInLoad), + }) + require.NoError(l.TestCfg.Test, err, "initiating loadgen for source %s", source) + loadRunner.Run(false) + l.AddToRunnerGroup(loadRunner) + l.LoadgenTearDowns = append(l.LoadgenTearDowns, func() { + require.NoError(l.t, multiCallGen.Stop()) + }) + }() + } +} + +func NewLoadArgs(t *testing.T, lggr zerolog.Logger, chaosExps ...ChaosConfig) *LoadArgs { + wg, _ := errgroup.WithContext(testcontext.Get(t)) + ctx := testcontext.Get(t) + return &LoadArgs{ + t: t, + Ctx: ctx, + lggr: &lggr, + RunnerWg: wg, + TestCfg: testsetups.NewCCIPTestConfig(t, lggr, testconfig.Load), + ChaosExps: chaosExps, + LoadStarterWg: &sync.WaitGroup{}, + pauseLoad: atomic.NewBool(false), + } +} diff --git a/integration-tests/ccip-tests/smoke/ccip_test.go b/integration-tests/ccip-tests/smoke/ccip_test.go new file mode 100644 index 00000000000..08054459481 --- /dev/null +++ b/integration-tests/ccip-tests/smoke/ccip_test.go @@ -0,0 +1,1155 @@ +package smoke + +import ( + "fmt" + "math/big" + "testing" + "time" + + "github.com/rs/zerolog" + "github.com/stretchr/testify/assert" + + "github.com/AlekSi/pointer" + "github.com/stretchr/testify/require" + + "github.com/smartcontractkit/chainlink-testing-framework/lib/logging" + "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/ptr" + + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/evm_2_evm_onramp" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/lock_release_token_pool" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/token_pool" + + "github.com/smartcontractkit/chainlink/integration-tests/ccip-tests/actions" + "github.com/smartcontractkit/chainlink/integration-tests/ccip-tests/contracts" + "github.com/smartcontractkit/chainlink/integration-tests/ccip-tests/testconfig" + "github.com/smartcontractkit/chainlink/integration-tests/ccip-tests/testreporters" + "github.com/smartcontractkit/chainlink/integration-tests/ccip-tests/testsetups" +) + +type testDefinition struct { + testName string + lane *actions.CCIPLane +} + +func TestSmokeCCIPForBidirectionalLane(t *testing.T) { + t.Parallel() + log := logging.GetTestLogger(t) + TestCfg := testsetups.NewCCIPTestConfig(t, log, testconfig.Smoke) + require.NotNil(t, TestCfg.TestGroupInput.MsgDetails.DestGasLimit) + gasLimit := big.NewInt(*TestCfg.TestGroupInput.MsgDetails.DestGasLimit) + setUpOutput := testsetups.CCIPDefaultTestSetUp(t, &log, "smoke-ccip", nil, TestCfg) + if len(setUpOutput.Lanes) == 0 { + log.Info().Msg("No lanes found") + return + } + + t.Cleanup(func() { + // If we are running a test that is a token transfer, we need to verify the balance. + // skip the balance check for existing deployment, there can be multiple external requests in progress for existing deployments + // other than token transfer initiated by the test, which can affect the balance check + // therefore we check the balance only for the ccip environment created by the test + if TestCfg.TestGroupInput.MsgDetails.IsTokenTransfer() && + !pointer.GetBool(TestCfg.TestGroupInput.USDCMockDeployment) && + !pointer.GetBool(TestCfg.TestGroupInput.ExistingDeployment) { + setUpOutput.Balance.Verify(t) + } + require.NoError(t, setUpOutput.TearDown()) + }) + + // Create test definitions for each lane. + var tests []testDefinition + for _, lane := range setUpOutput.Lanes { + tests = append(tests, testDefinition{ + testName: fmt.Sprintf("CCIP message transfer from network %s to network %s", + lane.ForwardLane.SourceNetworkName, lane.ForwardLane.DestNetworkName), + lane: lane.ForwardLane, + }) + if lane.ReverseLane != nil { + tests = append(tests, testDefinition{ + testName: fmt.Sprintf("CCIP message transfer from network %s to network %s", + lane.ReverseLane.SourceNetworkName, lane.ReverseLane.DestNetworkName), + lane: lane.ReverseLane, + }) + } + } + + // Execute tests. + log.Info().Int("Total Lanes", len(tests)).Msg("Starting CCIP test") + for _, test := range tests { + tc := test + t.Run(tc.testName, func(t *testing.T) { + t.Parallel() + tc.lane.Test = t + log.Info(). + Str("Source", tc.lane.SourceNetworkName). + Str("Destination", tc.lane.DestNetworkName). + Msgf("Starting lane %s -> %s", tc.lane.SourceNetworkName, tc.lane.DestNetworkName) + + tc.lane.RecordStateBeforeTransfer() + err := tc.lane.SendRequests(1, gasLimit) + require.NoError(t, err) + tc.lane.ValidateRequests() + }) + } +} + +func TestSmokeCCIPRateLimit(t *testing.T) { + t.Parallel() + log := logging.GetTestLogger(t) + TestCfg := testsetups.NewCCIPTestConfig(t, log, testconfig.Smoke) + require.True(t, TestCfg.TestGroupInput.MsgDetails.IsTokenTransfer(), "Test config should have token transfer message type") + setUpOutput := testsetups.CCIPDefaultTestSetUp(t, &log, "smoke-ccip", nil, TestCfg) + if len(setUpOutput.Lanes) == 0 { + return + } + t.Cleanup(func() { + require.NoError(t, setUpOutput.TearDown()) + }) + + var tests []testDefinition + for _, lane := range setUpOutput.Lanes { + tests = append(tests, testDefinition{ + testName: fmt.Sprintf("Network %s to network %s", + lane.ForwardLane.SourceNetworkName, lane.ForwardLane.DestNetworkName), + lane: lane.ForwardLane, + }) + } + + // if we are running in simulated or in testnet mode, we can set the rate limit to test friendly values + // For mainnet, we need to set this as false to avoid changing the deployed contract config + setRateLimit := true + AggregatedRateLimitCapacity := new(big.Int).Mul(big.NewInt(1e18), big.NewInt(30)) + AggregatedRateLimitRate := big.NewInt(1e17) + + TokenPoolRateLimitCapacity := new(big.Int).Mul(big.NewInt(1e17), big.NewInt(1)) + TokenPoolRateLimitRate := big.NewInt(1e14) + + for _, test := range tests { + tc := test + t.Run(fmt.Sprintf("%s - Rate Limit", tc.testName), func(t *testing.T) { + tc.lane.Test = t + src := tc.lane.Source + // add liquidity to pools on both networks + if !pointer.GetBool(TestCfg.TestGroupInput.ExistingDeployment) { + addLiquidity(t, src.Common, new(big.Int).Mul(AggregatedRateLimitCapacity, big.NewInt(20))) + addLiquidity(t, tc.lane.Dest.Common, new(big.Int).Mul(AggregatedRateLimitCapacity, big.NewInt(20))) + } + log.Info(). + Str("Source", tc.lane.SourceNetworkName). + Str("Destination", tc.lane.DestNetworkName). + Msgf("Starting lane %s -> %s", tc.lane.SourceNetworkName, tc.lane.DestNetworkName) + + // capture the rate limit config before we change it + prevRLOnRamp, err := src.OnRamp.Instance.CurrentRateLimiterState(nil) + require.NoError(t, err) + tc.lane.Logger.Info().Interface("rate limit", prevRLOnRamp).Msg("Initial OnRamp rate limiter state") + + prevOnRampRLTokenPool, err := src.Common.BridgeTokenPools[0].Instance.GetCurrentOutboundRateLimiterState( + nil, tc.lane.Source.DestChainSelector, + ) // TODO RENS maybe? + require.NoError(t, err) + tc.lane.Logger.Info(). + Interface("rate limit", prevOnRampRLTokenPool). + Str("pool", src.Common.BridgeTokenPools[0].Address()). + Str("onRamp", src.OnRamp.Address()). + Msg("Initial Token Pool rate limiter state") + + // some sanity checks + rlOffRamp, err := tc.lane.Dest.OffRamp.Instance.CurrentRateLimiterState(nil) + require.NoError(t, err) + tc.lane.Logger.Info().Interface("rate limit", rlOffRamp).Msg("Initial OffRamp rate limiter state") + if rlOffRamp.IsEnabled { + require.GreaterOrEqual(t, rlOffRamp.Capacity.Cmp(prevRLOnRamp.Capacity), 0, + "OffRamp Aggregated capacity should be greater than or equal to OnRamp Aggregated capacity", + ) + } + + prevOffRampRLTokenPool, err := tc.lane.Dest.Common.BridgeTokenPools[0].Instance.GetCurrentInboundRateLimiterState( + nil, tc.lane.Dest.SourceChainSelector, + ) // TODO RENS maybe? + require.NoError(t, err) + tc.lane.Logger.Info(). + Interface("rate limit", prevOffRampRLTokenPool). + Str("pool", tc.lane.Dest.Common.BridgeTokenPools[0].Address()). + Str("offRamp", tc.lane.Dest.OffRamp.Address()). + Msg("Initial Token Pool rate limiter state") + if prevOffRampRLTokenPool.IsEnabled { + require.GreaterOrEqual(t, prevOffRampRLTokenPool.Capacity.Cmp(prevOnRampRLTokenPool.Capacity), 0, + "OffRamp Token Pool capacity should be greater than or equal to OnRamp Token Pool capacity", + ) + } + + AggregatedRateLimitChanged := false + TokenPoolRateLimitChanged := false + + // reset the rate limit config to what it was before the tc + t.Cleanup(func() { + if AggregatedRateLimitChanged { + require.NoError(t, src.OnRamp.SetRateLimit(evm_2_evm_onramp.RateLimiterConfig{ + IsEnabled: prevRLOnRamp.IsEnabled, + Capacity: prevRLOnRamp.Capacity, + Rate: prevRLOnRamp.Rate, + }), "setting rate limit") + require.NoError(t, src.Common.ChainClient.WaitForEvents(), "waiting for events") + } + if TokenPoolRateLimitChanged { + require.NoError(t, src.Common.BridgeTokenPools[0].SetRemoteChainRateLimits(src.DestChainSelector, + token_pool.RateLimiterConfig{ + Capacity: prevOnRampRLTokenPool.Capacity, + IsEnabled: prevOnRampRLTokenPool.IsEnabled, + Rate: prevOnRampRLTokenPool.Rate, + })) + require.NoError(t, src.Common.ChainClient.WaitForEvents(), "waiting for events") + } + }) + + if setRateLimit { + if prevRLOnRamp.Capacity.Cmp(AggregatedRateLimitCapacity) != 0 || + prevRLOnRamp.Rate.Cmp(AggregatedRateLimitRate) != 0 || + !prevRLOnRamp.IsEnabled { + require.NoError(t, src.OnRamp.SetRateLimit(evm_2_evm_onramp.RateLimiterConfig{ + IsEnabled: true, + Capacity: AggregatedRateLimitCapacity, + Rate: AggregatedRateLimitRate, + }), "setting rate limit on onramp") + require.NoError(t, src.Common.ChainClient.WaitForEvents(), "waiting for events") + AggregatedRateLimitChanged = true + } + } else { + AggregatedRateLimitCapacity = prevRLOnRamp.Capacity + AggregatedRateLimitRate = prevRLOnRamp.Rate + } + + rlOnRamp, err := src.OnRamp.Instance.CurrentRateLimiterState(nil) + require.NoError(t, err) + tc.lane.Logger.Info().Interface("rate limit", rlOnRamp).Msg("OnRamp rate limiter state") + require.True(t, rlOnRamp.IsEnabled, "OnRamp rate limiter should be enabled") + + tokenPrice, err := src.Common.PriceRegistry.Instance.GetTokenPrice(nil, src.Common.BridgeTokens[0].ContractAddress) + require.NoError(t, err) + tc.lane.Logger.Info().Str("tokenPrice.Value", tokenPrice.String()).Msg("Price Registry Token Price") + + totalTokensForOnRampCapacity := new(big.Int).Mul( + big.NewInt(1e18), + new(big.Int).Div(rlOnRamp.Capacity, tokenPrice), + ) + + tc.lane.Source.Common.ChainClient.ParallelTransactions(true) + + // current tokens are equal to the full capacity - should fail + src.TransferAmount[0] = rlOnRamp.Tokens + tc.lane.Logger.Info().Str("tokensToSend", rlOnRamp.Tokens.String()).Msg("Aggregated Capacity") + // approve the tokens + require.NoError(t, src.Common.BridgeTokens[0].Approve( + tc.lane.Source.Common.ChainClient.GetDefaultWallet(), src.Common.Router.Address(), src.TransferAmount[0]), + ) + require.NoError(t, tc.lane.Source.Common.ChainClient.WaitForEvents()) + failedTx, _, _, err := tc.lane.Source.SendRequest(tc.lane.Dest.ReceiverDapp.EthAddress, big.NewInt(actions.DefaultDestinationGasLimit)) + require.NoError(t, err) + require.Error(t, tc.lane.Source.Common.ChainClient.WaitForEvents()) + errReason, v, err := tc.lane.Source.Common.ChainClient.RevertReasonFromTx(failedTx, evm_2_evm_onramp.EVM2EVMOnRampABI) + require.NoError(t, err) + tc.lane.Logger.Info(). + Str("Revert Reason", errReason). + Interface("Args", v). + Str("TokensSent", src.TransferAmount[0].String()). + Str("Token", tc.lane.Source.Common.BridgeTokens[0].Address()). + Str("FailedTx", failedTx.Hex()). + Msg("Msg sent with tokens more than AggregateValueMaxCapacity") + require.Equal(t, "AggregateValueMaxCapacityExceeded", errReason) + + // 99% of the aggregated capacity - should succeed + tokensToSend := new(big.Int).Div(new(big.Int).Mul(totalTokensForOnRampCapacity, big.NewInt(99)), big.NewInt(100)) + tc.lane.Logger.Info().Str("tokensToSend", tokensToSend.String()).Msg("99% of Aggregated Capacity") + tc.lane.RecordStateBeforeTransfer() + src.TransferAmount[0] = tokensToSend + err = tc.lane.SendRequests(1, big.NewInt(actions.DefaultDestinationGasLimit)) + require.NoError(t, err) + + // try to send again with amount more than the amount refilled by rate and + // this should fail, as the refill rate is not enough to refill the capacity + src.TransferAmount[0] = new(big.Int).Mul(AggregatedRateLimitRate, big.NewInt(10)) + failedTx, _, _, err = tc.lane.Source.SendRequest(tc.lane.Dest.ReceiverDapp.EthAddress, big.NewInt(actions.DefaultDestinationGasLimit)) + tc.lane.Logger.Info().Str("tokensToSend", src.TransferAmount[0].String()).Msg("More than Aggregated Rate") + require.NoError(t, err) + require.Error(t, tc.lane.Source.Common.ChainClient.WaitForEvents()) + errReason, v, err = tc.lane.Source.Common.ChainClient.RevertReasonFromTx(failedTx, evm_2_evm_onramp.EVM2EVMOnRampABI) + require.NoError(t, err) + tc.lane.Logger.Info(). + Str("Revert Reason", errReason). + Interface("Args", v). + Str("TokensSent", src.TransferAmount[0].String()). + Str("Token", tc.lane.Source.Common.BridgeTokens[0].Address()). + Str("FailedTx", failedTx.Hex()). + Msg("Msg sent with tokens more than AggregateValueRate") + require.Equal(t, "AggregateValueRateLimitReached", errReason) + + // validate the successful request was delivered to the destination + tc.lane.ValidateRequests() + + // now set the token pool rate limit + if setRateLimit { + if prevOnRampRLTokenPool.Capacity.Cmp(TokenPoolRateLimitCapacity) != 0 || + prevOnRampRLTokenPool.Rate.Cmp(TokenPoolRateLimitRate) != 0 || + !prevOnRampRLTokenPool.IsEnabled { + require.NoError(t, src.Common.BridgeTokenPools[0].SetRemoteChainRateLimits( + src.DestChainSelector, + token_pool.RateLimiterConfig{ + IsEnabled: true, + Capacity: TokenPoolRateLimitCapacity, + Rate: TokenPoolRateLimitRate, + }), "error setting rate limit on token pool") + require.NoError(t, src.Common.ChainClient.WaitForEvents(), "waiting for events") + TokenPoolRateLimitChanged = true + } + } else { + TokenPoolRateLimitCapacity = prevOnRampRLTokenPool.Capacity + TokenPoolRateLimitRate = prevOnRampRLTokenPool.Rate + } + + rlOnPool, err := src.Common.BridgeTokenPools[0].Instance.GetCurrentOutboundRateLimiterState(nil, src.DestChainSelector) + require.NoError(t, err) + require.True(t, rlOnPool.IsEnabled, "Token Pool rate limiter should be enabled") + + // try to send more than token pool capacity - should fail + tokensToSend = new(big.Int).Add(TokenPoolRateLimitCapacity, big.NewInt(2)) + + // wait for the AggregateCapacity to be refilled + onRampState, err := src.OnRamp.Instance.CurrentRateLimiterState(nil) + if err != nil { + return + } + if AggregatedRateLimitCapacity.Cmp(onRampState.Capacity) > 0 { + capacityToBeFilled := new(big.Int).Sub(AggregatedRateLimitCapacity, onRampState.Capacity) + durationToFill := time.Duration(new(big.Int).Div(capacityToBeFilled, AggregatedRateLimitRate).Int64()) + tc.lane.Logger.Info(). + Dur("wait duration", durationToFill). + Str("current capacity", onRampState.Capacity.String()). + Str("tokensToSend", tokensToSend.String()). + Msg("Waiting for aggregated capacity to be available") + time.Sleep(durationToFill * time.Second) + } + + src.TransferAmount[0] = tokensToSend + tc.lane.Logger.Info().Str("tokensToSend", tokensToSend.String()).Msg("More than Token Pool Capacity") + + failedTx, _, _, err = tc.lane.Source.SendRequest(tc.lane.Dest.ReceiverDapp.EthAddress, big.NewInt(actions.DefaultDestinationGasLimit)) + require.NoError(t, err) + require.Error(t, tc.lane.Source.Common.ChainClient.WaitForEvents()) + errReason, v, err = tc.lane.Source.Common.ChainClient.RevertReasonFromTx(failedTx, lock_release_token_pool.LockReleaseTokenPoolABI) + require.NoError(t, err) + tc.lane.Logger.Info(). + Str("Revert Reason", errReason). + Interface("Args", v). + Str("TokensSent", src.TransferAmount[0].String()). + Str("Token", tc.lane.Source.Common.BridgeTokens[0].Address()). + Str("FailedTx", failedTx.Hex()). + Msg("Msg sent with tokens more than token pool capacity") + require.Equal(t, "TokenMaxCapacityExceeded", errReason) + + // try to send 99% of token pool capacity - should succeed + tokensToSend = new(big.Int).Div(new(big.Int).Mul(TokenPoolRateLimitCapacity, big.NewInt(99)), big.NewInt(100)) + src.TransferAmount[0] = tokensToSend + tc.lane.Logger.Info().Str("tokensToSend", tokensToSend.String()).Msg("99% of Token Pool Capacity") + tc.lane.RecordStateBeforeTransfer() + err = tc.lane.SendRequests(1, big.NewInt(actions.DefaultDestinationGasLimit)) + require.NoError(t, err) + + // try to send again with amount more than the amount refilled by token pool rate and + // this should fail, as the refill rate is not enough to refill the capacity + tokensToSend = new(big.Int).Mul(TokenPoolRateLimitRate, big.NewInt(20)) + tc.lane.Logger.Info().Str("tokensToSend", tokensToSend.String()).Msg("More than TokenPool Rate") + src.TransferAmount[0] = tokensToSend + // approve the tokens + require.NoError(t, src.Common.BridgeTokens[0].Approve( + src.Common.ChainClient.GetDefaultWallet(), src.Common.Router.Address(), src.TransferAmount[0]), + ) + require.NoError(t, tc.lane.Source.Common.ChainClient.WaitForEvents()) + failedTx, _, _, err = tc.lane.Source.SendRequest(tc.lane.Dest.ReceiverDapp.EthAddress, big.NewInt(actions.DefaultDestinationGasLimit)) + require.NoError(t, err) + require.Error(t, tc.lane.Source.Common.ChainClient.WaitForEvents()) + errReason, v, err = tc.lane.Source.Common.ChainClient.RevertReasonFromTx(failedTx, lock_release_token_pool.LockReleaseTokenPoolABI) + require.NoError(t, err) + tc.lane.Logger.Info(). + Str("Revert Reason", errReason). + Interface("Args", v). + Str("TokensSent", src.TransferAmount[0].String()). + Str("Token", tc.lane.Source.Common.BridgeTokens[0].Address()). + Str("FailedTx", failedTx.Hex()). + Msg("Msg sent with tokens more than TokenPool Rate") + require.Equal(t, "TokenRateLimitReached", errReason) + + // validate that the successful transfers are reflected in destination + tc.lane.ValidateRequests() + }) + } +} + +func TestSmokeCCIPOnRampLimits(t *testing.T) { + t.Parallel() + + log := logging.GetTestLogger(t) + TestCfg := testsetups.NewCCIPTestConfig(t, log, testconfig.Smoke, testsetups.WithNoTokensPerMessage(4), testsetups.WithTokensPerChain(4)) + require.False(t, pointer.GetBool(TestCfg.TestGroupInput.ExistingDeployment), + "This test modifies contract state. Before running it, ensure you are willing and able to do so.", + ) + err := contracts.MatchContractVersionsOrAbove(map[contracts.Name]contracts.Version{ + contracts.OffRampContract: contracts.V1_5_0, + contracts.OnRampContract: contracts.V1_5_0, + }) + require.NoError(t, err, "Required contract versions not met") + + setUpOutput := testsetups.CCIPDefaultTestSetUp(t, &log, "smoke-ccip", nil, TestCfg) + if len(setUpOutput.Lanes) == 0 { + return + } + t.Cleanup(func() { + require.NoError(t, setUpOutput.TearDown()) + }) + + var tests []testDefinition + for _, lane := range setUpOutput.Lanes { + tests = append(tests, testDefinition{ + testName: fmt.Sprintf("Network %s to network %s", + lane.ForwardLane.SourceNetworkName, lane.ForwardLane.DestNetworkName), + lane: lane.ForwardLane, + }) + } + + var ( + capacityLimit = big.NewInt(1e16) + overCapacityAmount = new(big.Int).Add(capacityLimit, big.NewInt(1)) + + // token without any transfer config + freeTokenIndex = 0 + // token with bps non-zero, no agg rate limit + bpsTokenIndex = 1 + // token with bps zero, with agg rate limit on + aggRateTokenIndex = 2 + // token with both bps and agg rate limit + bpsAndAggTokenIndex = 3 + ) + + for _, tc := range tests { + t.Run(fmt.Sprintf("%s - OnRamp Limits", tc.testName), func(t *testing.T) { + tc.lane.Test = t + src := tc.lane.Source + dest := tc.lane.Dest + require.GreaterOrEqual(t, len(src.Common.BridgeTokens), 2, "At least two bridge tokens needed for test") + require.GreaterOrEqual(t, len(src.Common.BridgeTokenPools), 2, "At least two bridge token pools needed for test") + require.GreaterOrEqual(t, len(dest.Common.BridgeTokens), 2, "At least two bridge tokens needed for test") + require.GreaterOrEqual(t, len(dest.Common.BridgeTokenPools), 2, "At least two bridge token pools needed for test") + addLiquidity(t, src.Common, new(big.Int).Mul(capacityLimit, big.NewInt(20))) + addLiquidity(t, dest.Common, new(big.Int).Mul(capacityLimit, big.NewInt(20))) + + var ( + freeToken = src.Common.BridgeTokens[freeTokenIndex] + bpsToken = src.Common.BridgeTokens[bpsTokenIndex] + aggRateToken = src.Common.BridgeTokens[aggRateTokenIndex] + bpsAndAggToken = src.Common.BridgeTokens[bpsAndAggTokenIndex] + ) + tc.lane.Logger.Info(). + Str("Free Token", freeToken.ContractAddress.Hex()). + Str("BPS Token", bpsToken.ContractAddress.Hex()). + Str("Agg Rate Token", aggRateToken.ContractAddress.Hex()). + Str("BPS and Agg Rate Token", bpsAndAggToken.ContractAddress.Hex()). + Msg("Tokens for rate limit testing") + err := tc.lane.DisableAllRateLimiting() + require.NoError(t, err, "Error disabling rate limits") + + // Set reasonable rate limits for the tokens + err = src.OnRamp.SetTokenTransferFeeConfig([]evm_2_evm_onramp.EVM2EVMOnRampTokenTransferFeeConfigArgs{ + { + Token: bpsToken.ContractAddress, + AggregateRateLimitEnabled: false, + DeciBps: 10, + }, + { + Token: aggRateToken.ContractAddress, + AggregateRateLimitEnabled: true, + }, + { + Token: bpsAndAggToken.ContractAddress, + AggregateRateLimitEnabled: true, + DeciBps: 10, + }, + }) + require.NoError(t, err, "Error setting OnRamp transfer fee config") + err = src.OnRamp.SetRateLimit(evm_2_evm_onramp.RateLimiterConfig{ + IsEnabled: true, + Capacity: capacityLimit, + Rate: new(big.Int).Mul(capacityLimit, big.NewInt(500)), // Set a high rate to avoid it getting in the way + }) + require.NoError(t, err, "Error setting OnRamp rate limits") + err = src.Common.ChainClient.WaitForEvents() + require.NoError(t, err, "Error waiting for events") + + // Send all tokens under their limits and ensure they succeed + src.TransferAmount[freeTokenIndex] = overCapacityAmount + src.TransferAmount[bpsTokenIndex] = overCapacityAmount + src.TransferAmount[aggRateTokenIndex] = big.NewInt(1) + src.TransferAmount[bpsAndAggTokenIndex] = big.NewInt(1) + tc.lane.RecordStateBeforeTransfer() + err = tc.lane.SendRequests(1, big.NewInt(actions.DefaultDestinationGasLimit)) + require.NoError(t, err) + tc.lane.ValidateRequests() + + // Check that capacity limits are enforced + src.TransferAmount[freeTokenIndex] = big.NewInt(0) + src.TransferAmount[bpsTokenIndex] = big.NewInt(0) + src.TransferAmount[aggRateTokenIndex] = overCapacityAmount + src.TransferAmount[bpsAndAggTokenIndex] = big.NewInt(0) + failedTx, _, _, err := tc.lane.Source.SendRequest(tc.lane.Dest.ReceiverDapp.EthAddress, big.NewInt(actions.DefaultDestinationGasLimit)) + require.Error(t, err, "Limited token transfer should immediately revert") + errReason, _, err := src.Common.ChainClient.RevertReasonFromTx(failedTx, evm_2_evm_onramp.EVM2EVMOnRampABI) + require.NoError(t, err) + require.Equal(t, "AggregateValueMaxCapacityExceeded", errReason, "Expected capacity limit reached error") + tc.lane.Logger. + Info(). + Str("Token", aggRateToken.ContractAddress.Hex()). + Msg("Limited token transfer failed on source chain (a good thing in this context)") + + src.TransferAmount[aggRateTokenIndex] = big.NewInt(0) + src.TransferAmount[bpsAndAggTokenIndex] = overCapacityAmount + failedTx, _, _, err = tc.lane.Source.SendRequest(tc.lane.Dest.ReceiverDapp.EthAddress, big.NewInt(actions.DefaultDestinationGasLimit)) + require.Error(t, err, "Limited token transfer should immediately revert") + errReason, _, err = src.Common.ChainClient.RevertReasonFromTx(failedTx, evm_2_evm_onramp.EVM2EVMOnRampABI) + require.NoError(t, err) + require.Equal(t, "AggregateValueMaxCapacityExceeded", errReason, "Expected capacity limit reached error") + tc.lane.Logger. + Info(). + Str("Token", aggRateToken.ContractAddress.Hex()). + Msg("Limited token transfer failed on source chain (a good thing in this context)") + + // Set a high price for the tokens to more easily trigger aggregate rate limits + // Aggregate rate limits are based on USD price of the tokens + err = src.Common.PriceRegistry.UpdatePrices([]contracts.InternalTokenPriceUpdate{ + { + SourceToken: aggRateToken.ContractAddress, + UsdPerToken: big.NewInt(100), + }, + { + SourceToken: bpsAndAggToken.ContractAddress, + UsdPerToken: big.NewInt(100), + }, + }, []contracts.InternalGasPriceUpdate{}) + require.NoError(t, err, "Error updating prices") + // Enable aggregate rate limiting for the limited tokens + err = src.OnRamp.SetRateLimit(evm_2_evm_onramp.RateLimiterConfig{ + IsEnabled: true, + Capacity: new(big.Int).Mul(capacityLimit, big.NewInt(5000)), // Set a high capacity to avoid it getting in the way + Rate: big.NewInt(1), + }) + require.NoError(t, err, "Error setting OnRamp rate limits") + err = src.Common.ChainClient.WaitForEvents() + require.NoError(t, err, "Error waiting for events") + + // Send aggregate unlimited tokens and ensure they succeed + src.TransferAmount[freeTokenIndex] = overCapacityAmount + src.TransferAmount[bpsTokenIndex] = overCapacityAmount + src.TransferAmount[aggRateTokenIndex] = big.NewInt(0) + src.TransferAmount[bpsAndAggTokenIndex] = big.NewInt(0) + tc.lane.RecordStateBeforeTransfer() + err = tc.lane.SendRequests(1, big.NewInt(actions.DefaultDestinationGasLimit)) + require.NoError(t, err) + tc.lane.ValidateRequests() + + // Check that aggregate rate limits are enforced on limited tokens + src.TransferAmount[freeTokenIndex] = big.NewInt(0) + src.TransferAmount[bpsTokenIndex] = big.NewInt(0) + src.TransferAmount[aggRateTokenIndex] = capacityLimit + src.TransferAmount[bpsAndAggTokenIndex] = big.NewInt(0) + failedTx, _, _, err = tc.lane.Source.SendRequest(tc.lane.Dest.ReceiverDapp.EthAddress, big.NewInt(actions.DefaultDestinationGasLimit)) + require.Error(t, err, "Aggregate rate limited token transfer should immediately revert") + errReason, _, err = src.Common.ChainClient.RevertReasonFromTx(failedTx, evm_2_evm_onramp.EVM2EVMOnRampABI) + require.NoError(t, err) + require.Equal(t, "AggregateValueRateLimitReached", errReason, "Expected aggregate rate limit reached error") + tc.lane.Logger. + Info(). + Str("Token", aggRateToken.ContractAddress.Hex()). + Msg("Limited token transfer failed on source chain (a good thing in this context)") + + src.TransferAmount[aggRateTokenIndex] = big.NewInt(0) + src.TransferAmount[bpsAndAggTokenIndex] = capacityLimit + failedTx, _, _, err = tc.lane.Source.SendRequest(tc.lane.Dest.ReceiverDapp.EthAddress, big.NewInt(actions.DefaultDestinationGasLimit)) + require.Error(t, err, "Aggregate rate limited token transfer should immediately revert") + errReason, _, err = src.Common.ChainClient.RevertReasonFromTx(failedTx, evm_2_evm_onramp.EVM2EVMOnRampABI) + require.NoError(t, err) + require.Equal(t, "AggregateValueRateLimitReached", errReason, "Expected aggregate rate limit reached error") + tc.lane.Logger. + Info(). + Str("Token", aggRateToken.ContractAddress.Hex()). + Msg("Limited token transfer failed on source chain (a good thing in this context)") + }) + } +} + +func TestSmokeCCIPOffRampCapacityLimit(t *testing.T) { + t.Parallel() + + capacityLimited := contracts.RateLimiterConfig{ + IsEnabled: true, + Capacity: big.NewInt(1e16), + Rate: new(big.Int).Mul(big.NewInt(1e16), big.NewInt(10)), // Set a high rate limit to avoid it getting in the way + } + testOffRampRateLimits(t, capacityLimited) +} + +func TestSmokeCCIPOffRampAggRateLimit(t *testing.T) { + t.Parallel() + + aggRateLimited := contracts.RateLimiterConfig{ + IsEnabled: true, + Capacity: new(big.Int).Mul(big.NewInt(1e16), big.NewInt(10)), // Set a high capacity limit to avoid it getting in the way + Rate: big.NewInt(1), + } + testOffRampRateLimits(t, aggRateLimited) +} + +func TestSmokeCCIPTokenPoolRateLimits(t *testing.T) { + t.Parallel() + + log := logging.GetTestLogger(t) + TestCfg := testsetups.NewCCIPTestConfig(t, log, testconfig.Smoke, testsetups.WithNoTokensPerMessage(4), testsetups.WithTokensPerChain(4)) + require.False(t, pointer.GetBool(TestCfg.TestGroupInput.ExistingDeployment), + "This test modifies contract state. Before running it, ensure you are willing and able to do so.", + ) + err := contracts.MatchContractVersionsOrAbove(map[contracts.Name]contracts.Version{ + contracts.OffRampContract: contracts.V1_5_0, + contracts.OnRampContract: contracts.V1_5_0, + }) + require.NoError(t, err, "Required contract versions not met") + + setUpOutput := testsetups.CCIPDefaultTestSetUp(t, &log, "smoke-ccip", nil, TestCfg) + if len(setUpOutput.Lanes) == 0 { + return + } + t.Cleanup(func() { + require.NoError(t, setUpOutput.TearDown()) + }) + + var tests []testDefinition + for _, lane := range setUpOutput.Lanes { + tests = append(tests, testDefinition{ + testName: fmt.Sprintf("Network %s to network %s", + lane.ForwardLane.SourceNetworkName, lane.ForwardLane.DestNetworkName), + lane: lane.ForwardLane, + }) + } + + var ( + capacityLimit = big.NewInt(1e16) + overCapacityAmount = new(big.Int).Add(capacityLimit, big.NewInt(1)) + + // token without any limits + freeTokenIndex = 0 + // token with rate limits + limitedTokenIndex = 1 + ) + + for _, tc := range tests { + t.Run(fmt.Sprintf("%s - Token Pool Rate Limits", tc.testName), func(t *testing.T) { + tc.lane.Test = t + src := tc.lane.Source + dest := tc.lane.Dest + require.GreaterOrEqual(t, len(src.Common.BridgeTokens), 2, "At least two bridge tokens needed for test") + require.GreaterOrEqual(t, len(src.Common.BridgeTokenPools), 2, "At least two bridge token pools needed for test") + require.GreaterOrEqual(t, len(dest.Common.BridgeTokens), 2, "At least two bridge tokens needed for test") + require.GreaterOrEqual(t, len(dest.Common.BridgeTokenPools), 2, "At least two bridge token pools needed for test") + addLiquidity(t, src.Common, new(big.Int).Mul(capacityLimit, big.NewInt(20))) + addLiquidity(t, dest.Common, new(big.Int).Mul(capacityLimit, big.NewInt(20))) + + var ( + freeToken = src.Common.BridgeTokens[freeTokenIndex] + limitedToken = src.Common.BridgeTokens[limitedTokenIndex] + limitedTokenPool = src.Common.BridgeTokenPools[limitedTokenIndex] + ) + tc.lane.Logger.Info(). + Str("Free Token", freeToken.ContractAddress.Hex()). + Str("Limited Token", limitedToken.ContractAddress.Hex()). + Msg("Tokens for rate limit testing") + err := tc.lane.DisableAllRateLimiting() // Make sure this is pure + require.NoError(t, err, "Error disabling rate limits") + + // Check capacity limits + err = limitedTokenPool.SetRemoteChainRateLimits(src.DestChainSelector, token_pool.RateLimiterConfig{ + IsEnabled: true, + Capacity: capacityLimit, + Rate: new(big.Int).Sub(capacityLimit, big.NewInt(1)), // Set as high rate as possible to avoid it getting in the way + }) + require.NoError(t, err, "Error setting token pool rate limit") + err = src.Common.ChainClient.WaitForEvents() + require.NoError(t, err, "Error waiting for events") + + // Send all tokens under their limits and ensure they succeed + src.TransferAmount[freeTokenIndex] = overCapacityAmount + src.TransferAmount[limitedTokenIndex] = big.NewInt(1) + tc.lane.RecordStateBeforeTransfer() + err = tc.lane.SendRequests(1, big.NewInt(actions.DefaultDestinationGasLimit)) + require.NoError(t, err) + tc.lane.ValidateRequests() + + // Send limited token over capacity and ensure it fails + src.TransferAmount[freeTokenIndex] = big.NewInt(0) + src.TransferAmount[limitedTokenIndex] = overCapacityAmount + failedTx, _, _, err := tc.lane.Source.SendRequest(tc.lane.Dest.ReceiverDapp.EthAddress, big.NewInt(actions.DefaultDestinationGasLimit)) + require.Error(t, err, "Limited token transfer should immediately revert") + errReason, _, err := src.Common.ChainClient.RevertReasonFromTx(failedTx, lock_release_token_pool.LockReleaseTokenPoolABI) + require.NoError(t, err) + require.Equal(t, "TokenMaxCapacityExceeded", errReason, "Expected token capacity error") + tc.lane.Logger. + Info(). + Str("Token", limitedToken.ContractAddress.Hex()). + Msg("Limited token transfer failed on source chain (a good thing in this context)") + + // Check rate limit + err = limitedTokenPool.SetRemoteChainRateLimits(src.DestChainSelector, token_pool.RateLimiterConfig{ + IsEnabled: true, + Capacity: new(big.Int).Mul(capacityLimit, big.NewInt(2)), // Set a high capacity to avoid it getting in the way + Rate: big.NewInt(1), + }) + require.NoError(t, err, "Error setting token pool rate limit") + err = src.Common.ChainClient.WaitForEvents() + require.NoError(t, err, "Error waiting for events") + + // Send all tokens under their limits and ensure they succeed + src.TransferAmount[freeTokenIndex] = overCapacityAmount + src.TransferAmount[limitedTokenIndex] = capacityLimit + tc.lane.RecordStateBeforeTransfer() + err = tc.lane.SendRequests(1, big.NewInt(actions.DefaultDestinationGasLimit)) + require.NoError(t, err) + tc.lane.ValidateRequests() + + // Send limited token over rate limit and ensure it fails + src.TransferAmount[freeTokenIndex] = big.NewInt(0) + src.TransferAmount[limitedTokenIndex] = capacityLimit + failedTx, _, _, err = tc.lane.Source.SendRequest(tc.lane.Dest.ReceiverDapp.EthAddress, big.NewInt(actions.DefaultDestinationGasLimit)) + require.Error(t, err, "Limited token transfer should immediately revert") + errReason, _, err = src.Common.ChainClient.RevertReasonFromTx(failedTx, lock_release_token_pool.LockReleaseTokenPoolABI) + require.NoError(t, err) + require.Equal(t, "TokenRateLimitReached", errReason, "Expected rate limit reached error") + tc.lane.Logger. + Info(). + Str("Token", limitedToken.ContractAddress.Hex()). + Msg("Limited token transfer failed on source chain (a good thing in this context)") + }) + } +} + +func TestSmokeCCIPMulticall(t *testing.T) { + t.Parallel() + log := logging.GetTestLogger(t) + TestCfg := testsetups.NewCCIPTestConfig(t, log, testconfig.Smoke) + // enable multicall in one tx for this test + TestCfg.TestGroupInput.MulticallInOneTx = ptr.Ptr(true) + setUpOutput := testsetups.CCIPDefaultTestSetUp(t, &log, "smoke-ccip", nil, TestCfg) + if len(setUpOutput.Lanes) == 0 { + return + } + t.Cleanup(func() { + require.NoError(t, setUpOutput.TearDown()) + }) + + var tests []testDefinition + for _, lane := range setUpOutput.Lanes { + tests = append(tests, testDefinition{ + testName: fmt.Sprintf("CCIP message transfer from network %s to network %s", + lane.ForwardLane.SourceNetworkName, lane.ForwardLane.DestNetworkName), + lane: lane.ForwardLane, + }) + if lane.ReverseLane != nil { + tests = append(tests, testDefinition{ + testName: fmt.Sprintf("CCIP message transfer from network %s to network %s", + lane.ReverseLane.SourceNetworkName, lane.ReverseLane.DestNetworkName), + lane: lane.ReverseLane, + }) + } + } + + log.Info().Int("Total Lanes", len(tests)).Msg("Starting CCIP test") + for _, test := range tests { + tc := test + t.Run(tc.testName, func(t *testing.T) { + t.Parallel() + tc.lane.Test = t + log.Info(). + Str("Source", tc.lane.SourceNetworkName). + Str("Destination", tc.lane.DestNetworkName). + Msgf("Starting lane %s -> %s", tc.lane.SourceNetworkName, tc.lane.DestNetworkName) + + tc.lane.RecordStateBeforeTransfer() + err := tc.lane.Multicall(TestCfg.TestGroupInput.NoOfSendsInMulticall, tc.lane.Source.Common.MulticallContract) + require.NoError(t, err) + tc.lane.ValidateRequests() + }) + } +} + +func TestSmokeCCIPManuallyExecuteAfterExecutionFailingDueToInsufficientGas(t *testing.T) { + t.Parallel() + log := logging.GetTestLogger(t) + TestCfg := testsetups.NewCCIPTestConfig(t, log, testconfig.Smoke) + setUpOutput := testsetups.CCIPDefaultTestSetUp(t, &log, "smoke-ccip", nil, TestCfg) + if len(setUpOutput.Lanes) == 0 { + return + } + t.Cleanup(func() { + if TestCfg.TestGroupInput.MsgDetails.IsTokenTransfer() { + setUpOutput.Balance.Verify(t) + } + require.NoError(t, setUpOutput.TearDown()) + }) + + var tests []testDefinition + for _, lane := range setUpOutput.Lanes { + tests = append(tests, testDefinition{ + testName: fmt.Sprintf("CCIP message transfer from network %s to network %s", + lane.ForwardLane.SourceNetworkName, lane.ForwardLane.DestNetworkName), + lane: lane.ForwardLane, + }) + if lane.ReverseLane != nil { + tests = append(tests, testDefinition{ + testName: fmt.Sprintf("CCIP message transfer from network %s to network %s", + lane.ReverseLane.SourceNetworkName, lane.ReverseLane.DestNetworkName), + lane: lane.ReverseLane, + }) + } + } + + log.Info().Int("Total Lanes", len(tests)).Msg("Starting CCIP test") + for _, test := range tests { + tc := test + t.Run(tc.testName, func(t *testing.T) { + t.Parallel() + tc.lane.Test = t + log.Info(). + Str("Source", tc.lane.SourceNetworkName). + Str("Destination", tc.lane.DestNetworkName). + Msgf("Starting lane %s -> %s", tc.lane.SourceNetworkName, tc.lane.DestNetworkName) + + tc.lane.RecordStateBeforeTransfer() + // send with insufficient gas for ccip-receive to fail + err := tc.lane.SendRequests(1, big.NewInt(0)) + require.NoError(t, err) + tc.lane.ValidateRequests(actions.ExpectPhaseToFail(testreporters.ExecStateChanged)) + // wait for events + err = tc.lane.Dest.Common.ChainClient.WaitForEvents() + require.NoError(t, err) + // execute all failed ccip requests manually + err = tc.lane.ExecuteManually() + require.NoError(t, err) + if len(tc.lane.Source.TransferAmount) > 0 { + tc.lane.Source.UpdateBalance(int64(tc.lane.NumberOfReq), tc.lane.TotalFee, tc.lane.Balance) + tc.lane.Dest.UpdateBalance(tc.lane.Source.TransferAmount, int64(tc.lane.NumberOfReq), tc.lane.Balance) + } + }) + } +} + +// Test expects to generate below finality reorg in both source and destination and +// expect CCIP transactions to go through successful. +func TestSmokeCCIPReorgBelowFinality(t *testing.T) { + t.Parallel() + log := logging.GetTestLogger(t) + TestCfg := testsetups.NewCCIPTestConfig(t, log, testconfig.Smoke) + gasLimit := big.NewInt(*TestCfg.TestGroupInput.MsgDetails.DestGasLimit) + setUpOutput := testsetups.CCIPDefaultTestSetUp(t, &log, "smoke-ccip", nil, TestCfg) + require.False(t, len(setUpOutput.Lanes) == 0, "No lanes found.") + t.Cleanup(func() { + require.NoError(t, setUpOutput.TearDown()) + }) + + lane := setUpOutput.Lanes[0].ForwardLane + log.Info(). + Str("Source", lane.SourceNetworkName). + Str("Destination", lane.DestNetworkName). + Msg("Starting CCIP reorg test") + t.Run(fmt.Sprintf("CCIP reorg below finality test from network %s to network %s", + lane.SourceNetworkName, lane.DestNetworkName), func(t *testing.T) { + t.Parallel() + lane.Test = t + lane.RecordStateBeforeTransfer() + // sending multiple request and expect all should go through though there is below finality reorg + err := lane.SendRequests(5, gasLimit) + require.NoError(t, err, "Send requests failed") + rs := SetupReorgSuite(t, &log, setUpOutput) + // run below finality reorg in both source and destination chain + blocksBackSrc := int(rs.Cfg.SrcFinalityDepth) - rs.Cfg.FinalityDelta + blocksBackDst := int(rs.Cfg.DstFinalityDepth) - rs.Cfg.FinalityDelta + rs.RunReorg(rs.DstClient, blocksBackSrc, "Source", 2*time.Second) + rs.RunReorg(rs.DstClient, blocksBackDst, "Destination", 2*time.Second) + time.Sleep(1 * time.Minute) + lane.ValidateRequests() + }) +} + +// Test creates above finality reorg at destination and +// expects ccip transactions in-flight and the one initiated after reorg +// doesn't go through and verifies every node is able to detect reorg. +// Note: LogPollInterval interval is set as 1s to detect the reorg immediately +func TestSmokeCCIPReorgAboveFinalityAtDestination(t *testing.T) { + t.Parallel() + t.Run("Above finality reorg in destination chain", func(t *testing.T) { + performAboveFinalityReorgAndValidate(t, "Destination") + }) +} + +// Test creates above finality reorg at destination and +// expects ccip transactions in-flight doesn't go through, the transaction initiated after reorg +// shouldn't even get initiated and verifies every node is able to detect reorg. +// Note: LogPollInterval interval is set as 1s to detect the reorg immediately +func TestSmokeCCIPReorgAboveFinalityAtSource(t *testing.T) { + t.Parallel() + t.Run("Above finality reorg in source chain", func(t *testing.T) { + performAboveFinalityReorgAndValidate(t, "Source") + }) +} + +// performAboveFinalityReorgAndValidate is to perform the above finality reorg test +func performAboveFinalityReorgAndValidate(t *testing.T, network string) { + t.Helper() + + log := logging.GetTestLogger(t) + TestCfg := testsetups.NewCCIPTestConfig(t, log, testconfig.Smoke) + gasLimit := big.NewInt(*TestCfg.TestGroupInput.MsgDetails.DestGasLimit) + setUpOutput := testsetups.CCIPDefaultTestSetUp(t, &log, "smoke-ccip", nil, TestCfg) + require.False(t, len(setUpOutput.Lanes) == 0, "No lanes found.") + t.Cleanup(func() { + require.NoError(t, setUpOutput.TearDown()) + }) + rs := SetupReorgSuite(t, &log, setUpOutput) + lane := setUpOutput.Lanes[0].ForwardLane + log.Info(). + Str("Source", lane.SourceNetworkName). + Str("Destination", lane.DestNetworkName). + Msg("Starting ccip reorg test") + lane.Test = t + lane.RecordStateBeforeTransfer() + err := lane.SendRequests(1, gasLimit) + require.NoError(t, err, "Send requests failed") + logPollerName := "" + if network == "Destination" { + logPollerName = fmt.Sprintf("EVM.%d.LogPoller", lane.DestChain.GetChainID()) + rs.RunReorg(rs.DstClient, int(rs.Cfg.DstFinalityDepth)+rs.Cfg.FinalityDelta, network, 2*time.Second) + } else { + logPollerName = fmt.Sprintf("EVM.%d.LogPoller", lane.SourceChain.GetChainID()) + rs.RunReorg(rs.SrcClient, int(rs.Cfg.SrcFinalityDepth)+rs.Cfg.FinalityDelta, network, 2*time.Second) + } + clNodes := setUpOutput.Env.CLNodes + // assert every node is detecting the reorg (LogPollInterval is set as 1s for faster detection) + nodesDetectedViolation := make(map[string]bool) + assert.Eventually(t, func() bool { + for _, node := range clNodes { + if _, ok := nodesDetectedViolation[node.ChainlinkClient.URL()]; ok { + continue + } + resp, _, err := node.Health() + require.NoError(t, err) + for _, d := range resp.Data { + if d.Attributes.Name == logPollerName && d.Attributes.Output == "finality violated" && d.Attributes.Status == "failing" { + log.Debug().Msg("Finality violated is detected by node") + nodesDetectedViolation[node.ChainlinkClient.URL()] = true + } + } + } + return len(nodesDetectedViolation) == len(clNodes) + }, 3*time.Minute, 20*time.Second, "Reorg above finality depth is not detected by every node") + log.Debug().Interface("Nodes", nodesDetectedViolation).Msg("Violation detection details") + // send another request and verify it fails + err = lane.SendRequests(1, gasLimit) + if network == "Source" { + // if it is source chain reorg, the transaction will not even be initiated + require.Error(t, err, + "CCIP send transaction shouldn't be initiated as there is above finality depth reorg in source chain") + } else { + // if it is destination chain reorg, the transaction will be initiated and will fail in the process + require.NoError(t, err, + "CCIP send transaction should be initiated even when there above finality reorg in dest chain") + } + + lane.ValidateRequests(actions.ExpectAnyPhaseToFail(actions.WithTimeout(time.Minute))) +} + +// add liquidity to pools on both networks +func addLiquidity(t *testing.T, ccipCommon *actions.CCIPCommon, amount *big.Int) { + t.Helper() + + for i, btp := range ccipCommon.BridgeTokenPools { + token := ccipCommon.BridgeTokens[i] + err := btp.AddLiquidity( + token, token.OwnerWallet, amount, + ) + require.NoError(t, err) + } +} + +// testOffRampRateLimits tests the rate limiting functionality of the OffRamp contract +// it's broken into a helper to help parallelize and keep the tests DRY +func testOffRampRateLimits(t *testing.T, rateLimiterConfig contracts.RateLimiterConfig) { + t.Helper() + + log := logging.GetTestLogger(t) + TestCfg := testsetups.NewCCIPTestConfig(t, log, testconfig.Smoke) + require.False(t, pointer.GetBool(TestCfg.TestGroupInput.ExistingDeployment), + "This test modifies contract state. Before running it, ensure you are willing and able to do so.", + ) + err := contracts.MatchContractVersionsOrAbove(map[contracts.Name]contracts.Version{ + contracts.OffRampContract: contracts.V1_5_0, + }) + require.NoError(t, err, "Required contract versions not met") + require.False(t, pointer.GetBool(TestCfg.TestGroupInput.ExistingDeployment), "This test modifies contract state and cannot be run on existing deployments") + + // Set the default permissionless exec threshold lower so that we can manually execute the transactions faster + // Tuning this too low stops any transactions from being realistically executed + actions.DefaultPermissionlessExecThreshold = 1 * time.Minute + + setUpOutput := testsetups.CCIPDefaultTestSetUp(t, &log, "smoke-ccip", nil, TestCfg) + if len(setUpOutput.Lanes) == 0 { + return + } + t.Cleanup(func() { + require.NoError(t, setUpOutput.TearDown()) + }) + + var tests []testDefinition + for _, lane := range setUpOutput.Lanes { + tests = append(tests, testDefinition{ + testName: fmt.Sprintf("Network %s to network %s", + lane.ForwardLane.SourceNetworkName, lane.ForwardLane.DestNetworkName), + lane: lane.ForwardLane, + }) + } + + var ( + freeTokenIndex = 0 + limitedTokenIndex = 1 + ) + + for _, tc := range tests { + t.Run(fmt.Sprintf("%s - OffRamp Limits", tc.testName), func(t *testing.T) { + tc.lane.Test = t + src := tc.lane.Source + dest := tc.lane.Dest + var ( + capacityLimit = rateLimiterConfig.Capacity + overLimitAmount = new(big.Int).Add(capacityLimit, big.NewInt(1)) + ) + require.GreaterOrEqual(t, len(src.Common.BridgeTokens), 2, "At least two bridge tokens needed for test") + require.GreaterOrEqual(t, len(src.Common.BridgeTokenPools), 2, "At least two bridge token pools needed for test") + require.GreaterOrEqual(t, len(dest.Common.BridgeTokens), 2, "At least two bridge tokens needed for test") + require.GreaterOrEqual(t, len(dest.Common.BridgeTokenPools), 2, "At least two bridge token pools needed for test") + addLiquidity(t, src.Common, new(big.Int).Mul(capacityLimit, big.NewInt(20))) + addLiquidity(t, dest.Common, new(big.Int).Mul(capacityLimit, big.NewInt(20))) + + var ( + freeSrcToken = src.Common.BridgeTokens[freeTokenIndex] + freeDestToken = dest.Common.BridgeTokens[freeTokenIndex] + limitedSrcToken = src.Common.BridgeTokens[limitedTokenIndex] + limitedDestToken = dest.Common.BridgeTokens[limitedTokenIndex] + ) + tc.lane.Logger.Info(). + Str("Free Source Token", freeSrcToken.Address()). + Str("Free Dest Token", freeDestToken.Address()). + Str("Limited Source Token", limitedSrcToken.Address()). + Str("Limited Dest Token", limitedDestToken.Address()). + Msg("Tokens for rate limit testing") + + err := tc.lane.DisableAllRateLimiting() + require.NoError(t, err, "Error disabling rate limits") + + // Send both tokens with no rate limits and ensure they succeed + src.TransferAmount[freeTokenIndex] = overLimitAmount + src.TransferAmount[limitedTokenIndex] = overLimitAmount + tc.lane.RecordStateBeforeTransfer() + err = tc.lane.SendRequests(1, big.NewInt(actions.DefaultDestinationGasLimit)) + require.NoError(t, err) + tc.lane.ValidateRequests() + + // Enable capacity limiting on the destination chain for the limited token + err = dest.AddRateLimitTokens([]*contracts.ERC20Token{limitedSrcToken}, []*contracts.ERC20Token{limitedDestToken}) + require.NoError(t, err, "Error setting destination rate limits") + err = dest.OffRamp.SetRateLimit(rateLimiterConfig) + require.NoError(t, err, "Error setting destination rate limits") + err = dest.Common.ChainClient.WaitForEvents() + require.NoError(t, err, "Error waiting for events") + tc.lane.Logger.Debug().Str("Token", limitedSrcToken.ContractAddress.Hex()).Msg("Enabled capacity limit on destination chain") + + // Send free token that should not have a rate limit and should succeed + src.TransferAmount[freeTokenIndex] = overLimitAmount + src.TransferAmount[limitedTokenIndex] = big.NewInt(0) + tc.lane.RecordStateBeforeTransfer() + err = tc.lane.SendRequests(1, big.NewInt(actions.DefaultDestinationGasLimit)) + require.NoError(t, err, "Free token transfer failed") + tc.lane.ValidateRequests() + tc.lane.Logger.Info().Str("Token", freeSrcToken.ContractAddress.Hex()).Msg("Free token transfer succeeded") + + // Send limited token with rate limit that should fail on the destination chain + src.TransferAmount[freeTokenIndex] = big.NewInt(0) + src.TransferAmount[limitedTokenIndex] = overLimitAmount + tc.lane.RecordStateBeforeTransfer() + err = tc.lane.SendRequests(1, big.NewInt(actions.DefaultDestinationGasLimit)) + require.NoError(t, err, "Failed to send rate limited token transfer") + + // We should see the ExecStateChanged phase fail on the OffRamp + tc.lane.ValidateRequests(actions.ExpectPhaseToFail(testreporters.ExecStateChanged)) + tc.lane.Logger.Info(). + Str("Token", limitedSrcToken.ContractAddress.Hex()). + Msg("Limited token transfer failed on destination chain (a good thing in this context)") + + // Manually execute the rate limited token transfer and expect a similar error + tc.lane.Logger.Info().Str("Wait Time", actions.DefaultPermissionlessExecThreshold.String()).Msg("Waiting for Exec Threshold to Expire") + time.Sleep(actions.DefaultPermissionlessExecThreshold) // Give time to exit the window + // See above comment on timeout + err = tc.lane.ExecuteManually(actions.WithConfirmationTimeout(time.Minute)) + require.Error(t, err, "There should be errors executing manually at this point") + tc.lane.Logger.Debug().Str("Error", err.Error()).Msg("Manually executed rate limited token transfer failed as expected") + + // Change limits to make it viable + err = dest.OffRamp.SetRateLimit(contracts.RateLimiterConfig{ + IsEnabled: true, + Capacity: new(big.Int).Mul(capacityLimit, big.NewInt(100)), + Rate: new(big.Int).Mul(capacityLimit, big.NewInt(100)), + }) + require.NoError(t, err, "Error setting destination rate limits") + err = dest.Common.ChainClient.WaitForEvents() + require.NoError(t, err, "Error waiting for events") + + // Execute again manually and expect a pass + err = tc.lane.ExecuteManually() + require.NoError(t, err, "Error manually executing transaction after rate limit is lifted") + }) + } +} + +// SetupReorgSuite defines the setup required to perform re-org step +func SetupReorgSuite(t *testing.T, lggr *zerolog.Logger, setupOutput *testsetups.CCIPTestSetUpOutputs) *actions.ReorgSuite { + var finalitySrc uint64 + var finalityDst uint64 + if setupOutput.Cfg.SelectedNetworks[0].FinalityTag { + finalitySrc = 10 + } else { + finalitySrc = setupOutput.Cfg.SelectedNetworks[0].FinalityDepth + } + if setupOutput.Cfg.SelectedNetworks[1].FinalityTag { + finalityDst = 10 + } else { + finalityDst = setupOutput.Cfg.SelectedNetworks[1].FinalityDepth + } + var srcGethHTTPURL, dstGethHTTPURL string + if setupOutput.Env.LocalCluster != nil { + srcGethHTTPURL = setupOutput.Env.LocalCluster.EVMNetworks[0].HTTPURLs[0] + dstGethHTTPURL = setupOutput.Env.LocalCluster.EVMNetworks[1].HTTPURLs[0] + } else { + srcGethHTTPURL = setupOutput.Env.K8Env.URLs["source-chain_http"][0] + dstGethHTTPURL = setupOutput.Env.K8Env.URLs["dest-chain_http"][0] + } + rs, err := actions.NewReorgSuite(t, lggr, &actions.ReorgConfig{ + SrcGethHTTPURL: srcGethHTTPURL, + DstGethHTTPURL: dstGethHTTPURL, + SrcFinalityDepth: finalitySrc, + DstFinalityDepth: finalityDst, + FinalityDelta: setupOutput.Cfg.TestGroupInput.ReorgProfile.FinalityDelta, + }) + require.NoError(t, err) + return rs +} diff --git a/integration-tests/ccip-tests/testconfig/README.md b/integration-tests/ccip-tests/testconfig/README.md new file mode 100644 index 00000000000..ff57ecaa220 --- /dev/null +++ b/integration-tests/ccip-tests/testconfig/README.md @@ -0,0 +1,831 @@ +# CCIP Configuration + +The CCIP configuration is used to specify the test configuration for running the CCIP integration tests. +The configuration is specified in a TOML file. The configuration is used to specify the test environment, test type, test parameters, and other necessary details for running the tests. +The test config is read in following order: + +- The test reads the default configuration from [ccip-default.toml](./tomls/ccip-default.toml). +- The default can be overridden by specifying the test config in a separate file. + - The file content needs to be encoded in base64 format and set in `BASE64_CONFIG_OVERRIDE` environment variable. + - The config mentioned in this file will override the default config. + - Example override file - [override.toml.example](./examples/override.toml.example) +- If there are sensitive details like private keys, credentials in test config, they can be specified in a separate dotenv file as env vars + - The `~/.testsecrets` file in home directory is automatically loaded and should have all test secrets as env vars + - Example secret file - [.testsecrets.example](./examples/.testsecrets.example) + +## CCIP.ContractVersions + +Specifies contract versions of different contracts to be referred by test. +Supported versions are: + +- **PriceRegistry**: '1.2.0', 'Latest' +- **OffRamp**: '1.2.0', 'Latest' +- **OnRamp**: '1.2.0', 'Latest' +- **TokenPool**: '1.4.0', 'Latest' +- **CommitStore**: '1.2.0', 'Latest' + +Example Usage: + +```toml +[CCIP.ContractVersions] +PriceRegistry = "1.2.0" +OffRamp = "1.2.0" +OnRamp = "1.2.0" +TokenPool = "1.4.0" +CommitStore = "1.2.0" +``` + +## CCIP.Deployments + +CCIP Deployment contains all necessary contract addresses for various networks. This is mandatory if the test are to be run for [existing deployments](#ccipgroupstestgroupexistingdeployment) +The deployment data can be specified - + +- Under `CCIP.Deployments.Data` field with value as stringify format of json. +- Under `CCIP.Deployments.DataFile` field with value as the path of the file containing the deployment data in json format. + +The json schema is specified in https://github.com/smartcontractkit/ccip/blob/ccip-develop/integration-tests/ccip-tests/contracts/laneconfig/parse_contracts.go#L96 + +Example Usage: + +```toml +[CCIP.Deployments] +Data = """ +{ + "lane_configs": { + "Arbitrum Mainnet": { + "is_native_fee_token": true, + "fee_token": "0xf97f4df75117a78c1A5a0DBb814Af92458539FB4", + "bridge_tokens": ["0x82aF49447D8a07e3bd95BD0d56f35241523fBab1"], + "bridge_tokens_pools": ["0x82aF49947D8a07e3bd95BD0d56f35241523fBab1"], + "arm": "0xe06b0e8c4bd455153e8794ad7Ea8Ff5A14B64E4b", + "router": "0x141fa059441E0ca23ce184B6A78bafD2A517DdE8", + "price_registry": "0x13015e4E6f839E1Aa1016DF521ea458ecA20438c", + "wrapped_native": "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1", + "src_contracts": { + "Ethereum Mainnet": { + "on_ramp": "0xCe11020D56e5FDbfE46D9FC3021641FfbBB5AdEE", + "deployed_at": 11111111 + } + }, + "dest_contracts": { + "Ethereum Mainnet": { + "off_ramp": "0x542ba1902044069330e8c5b36A84EC503863722f", + "commit_store": "0x060331fEdA35691e54876D957B4F9e3b8Cb47d20", + "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" + } + } + }, + "Ethereum Mainnet": { + "is_native_fee_token": true, + "fee_token": "0x514910771AF9Ca656af840dff83E8264EcF986CA", + "bridge_tokens": ["0x8B63b3DE93431C0f756A493644d128134291fA1b"], + "bridge_tokens_pools": ["0x8B63b3DE93431C0f756A493644d128134291fA1b"], + "arm": "0x8B63b3DE93431C0f756A493644d128134291fA1b", + "router": "0x80226fc0Ee2b096224EeAc085Bb9a8cba1146f7D", + "price_registry": "0x8c9b2Efb7c64C394119270bfecE7f54763b958Ad", + "wrapped_native": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", + "src_contracts": { + "Arbitrum Mainnet": { + "on_ramp": "0x925228D7B82d883Dde340A55Fe8e6dA56244A22C", + "deployed_at": 11111111 + } + }, + "dest_contracts": { + "Arbitrum Mainnet": { + "off_ramp": "0xeFC4a18af59398FF23bfe7325F2401aD44286F4d", + "commit_store": "0x9B2EEd6A1e16cB50Ed4c876D2dD69468B21b7749", + "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" + } + } + } + } +} +""" +``` + +Or, + +```toml +[CCIP.Deployments] +DataFile = '' +``` + +## CCIP.Env + +Specifies the environment details for the test to be run on. +Mandatory fields are: + +- **Networks**: [CCIP.Env.Networks](#ccipenvnetworks) +- **NewCLCluster**: [CCIP.Env.NewCLCluster](#ccipenvnewclcluster) - This is mandatory if the test needs to deploy Chainlink nodes. +- **ExistingCLCluster**: [CCIP.Env.ExistingCLCluster](#ccipenvexistingclcluster) - This is mandatory if the test needs to run on existing Chainlink nodes to deploy ccip jobs. + +Test needs network/chain details to be set through configuration. This configuration is mandatory for running the tests. +you have option to set the network details in two ways: + +1. Using [CCIP.Env.Networks](#ccipenvnetworks) +2. Using a separate network config file - + - refer to the example - [network_config.toml.example](./examples/network_config.toml.example) + - once all necessary values are set, encode the toml file content in base64 format, + - set the base64'ed string content in `BASE64_NETWORK_CONFIG` environment variable. + +### CCIP.Env.Networks + +Specifies the network details for the test to be run. +The NetworkConfig is imported from https://github.com/smartcontractkit/chainlink-testing-framework/blob/main/config/network.go#L39 + +#### CCIP.Env.Networks.selected_networks + +It denotes the network names in which tests will be run. These networks are used to deploy ccip contracts and set up lanes between them. +If more than 2 networks are specified, then lanes will be set up between all possible pairs of networks. + +For example , if `selected_networks = ['SIMULATED_1', 'SIMULATED_2', 'SIMULATED_3']`, it denotes that lanes will be set up between SIMULATED_1 and SIMULATED_2, SIMULATED_1 and SIMULATED_3, SIMULATED_2 and SIMULATED_3 +This behaviour can be varied based on [NoOfNetworks](#ccipgroupstestgroupnoofnetworks), [NetworkPairs](#ccipgroupstestgroupnetworkpairs), [MaxNoOfLanes](#ccipgroupstestgroupmaxnooflanes) fields in test config. + +The name of the networks are taken from [known_networks](https://github.com/smartcontractkit/chainlink-testing-framework/blob/main/networks/known_networks.go#L884) in chainlink-testing-framework +If the network is not present in known_networks, then the network details can be specified in the config file itself under the following `EVMNetworks` key. + +#### CCIP.Env.Network.EVMNetworks + +Specifies the network config to be used while creating blockchain EVMClient for test. +It is a map of network name to EVMNetworks where key is network name specified under `CCIP.Env.Networks.selected_networks` and value is `EVMNetwork`. +The EVMNetwork is imported from [EVMNetwork](https://github.com/smartcontractkit/chainlink-testing-framework/blob/main/blockchain/config.go#L43) in chainlink-testing-framework. + +If `CCIP.Env.Network.EVMNetworks` config is not set for a network name specified under `CCIP.Env.Networks.selected_networks`, test will try to find the corresponding network config from defined networks in `MappedNetworks` under [known_networks.go](https://github.com/smartcontractkit/chainlink-testing-framework/blob/main/networks/known_networks.go) + +#### CCIP.Env.Network.AnvilConfigs + +If the test needs to run on chains created using Anvil, then the AnvilConfigs can be specified. +It is a map of network name to `AnvilConfig` where key is network name specified under `CCIP.Env.Networks.selected_networks` and value is `AnvilConfig`. +The AnvilConfig is imported from [AnvilConfig](https://github.com/smartcontractkit/chainlink-testing-framework/blob/main/config/network.go#L20) in chainlink-testing-framework. + +**The following network configs are required for tests running on live networks. It can be ignored if the tests are running on simulated networks.** +Refer to [secrets.toml.example](./examples/secrets.toml.example) for details. + +#### CCIP.ENV.Network.RpcHttpUrls + +RpcHttpUrls is the RPC HTTP endpoints for each network, key is the network name as declared in selected_networks slice. + +#### CCIP.ENV.Network.RpcWsUrls + +RpcWsUrls is the RPC WS endpoints for each network, key is the network name as declared in selected_networks slice. + +#### CCIP.ENV.Network.WalletKeys + +WalletKeys is the private keys for each network, key is the network name as declared in selected_networks slice. + +Example Usage of Network Config: + +```toml +[CCIP.Env.Network] +selected_networks= ['PRIVATE-CHAIN-1', 'PRIVATE-CHAIN-2'] + +[CCIP.Env.Network.EVMNetworks.PRIVATE-CHAIN-1] +evm_name = 'private-chain-1' +evm_chain_id = 2337 +evm_urls = ['wss://ignore-this-url.com'] +evm_http_urls = ['https://ignore-this-url.com'] +evm_keys = ['59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d'] +evm_simulated = true +client_implementation = 'Ethereum' +evm_chainlink_transaction_limit = 5000 +evm_transaction_timeout = '3m' +evm_minimum_confirmations = 1 +evm_gas_estimation_buffer = 1000 +evm_supports_eip1559 = true +evm_default_gas_limit = 6000000 +evm_finality_depth = 400 + +[CCIP.Env.Network.EVMNetworks.PRIVATE-CHAIN-2] +evm_name = 'private-chain-2' +evm_chain_id = 1337 +evm_urls = ['wss://ignore-this-url.com'] +evm_http_urls = ['https://ignore-this-url.com'] +evm_keys = ['ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80'] +evm_simulated = true +client_implementation = 'Ethereum' +evm_chainlink_transaction_limit = 5000 +evm_transaction_timeout = '3m' +evm_minimum_confirmations = 1 +evm_gas_estimation_buffer = 1000 +evm_supports_eip1559 = true +evm_default_gas_limit = 6000000 +evm_finality_depth = 400 + +[CCIP.Env.Network.AnvilConfigs.PRIVATE-CHAIN-1] +block_time = 1 + +[CCIP.Env.Network.AnvilConfigs.PRIVATE-CHAIN-2] +block_time = 1 +``` + +### CCIP.Env.NewCLCluster + +The NewCLCluster config holds the overall deployment configuration for Chainlink nodes. + +#### CCIP.Env.NewCLCluster.NoOfNodes + +Specifies the number of Chainlink nodes to be deployed. + +#### CCIP.Env.NewCLCluster.Common + +Specifies the common configuration for all Chainlink nodes if they share the same configuration. + +##### Name + +Name of the node. + +##### NeedsUpgrade + +Indicates if the node needs an upgrade during test. + +##### ChainlinkImage + +Configuration for the Chainlink image. + +##### ChainlinkUpgradeImage + +Configuration for the Chainlink upgrade image. It is used when the node needs an upgrade. + +##### BaseConfigTOML + +String containing the base configuration toml content for the Chainlink node config. + +##### CommonChainConfigTOML + +String containing the common chain configuration toml content for all EVMNodes in chainlink node config. + +##### ChainConfigTOMLByChain + +String containing the chain-specific configuration toml content for individual EVMNodes in chainlink node config. This is keyed by chain ID. + +##### DBImage + +Database image for the Chainlink node. + +##### DBTag + +Database tag/version for the Chainlink node. + +#### CCIP.Env.NewCLCluster.Nodes + +Specifies the configuration for individual nodes if they differ from the common configuration. The fields are the same as the common configuration. + +#### CCIP.Env.NewCLCluster.NodeMemory + +Specifies the memory to be allocated for each Chainlink node. This is valid only if the deployment is on Kubernetes. + +#### CCIP.Env.NewCLCluster.NodeCPU + +Specifies the CPU to be allocated for each Chainlink node. This is valid only if the deployment is on Kubernetes. + +#### CCIP.Env.NewCLCluster.DBMemory + +Specifies the memory to be allocated for the database. This is valid only if the deployment is on Kubernetes. + +#### CCIP.Env.NewCLCluster.DBCPU + +Specifies the CPU to be allocated for the database. This is valid only if the deployment is on Kubernetes. + +#### CCIP.Env.NewCLCluster.IsStateful + +Specifies whether the deployment is StatefulSet on Kubernetes. + +#### CCIP.Env.NewCLCluster.DBStorageClass + +Specifies the storage class for the database. This is valid only if the deployment is StatefulSet on Kubernetes. + +#### CCIP.Env.NewCLCluster.DBCapacity + +Specifies the capacity of the database. This is valid only if the deployment is StatefulSet on Kubernetes. + +#### CCIP.Env.NewCLCluster.PromPgExporter + +Specifies whether to enable Prometheus PostgreSQL exporter. This is valid only if the deployment is on Kubernetes. + +#### CCIP.Env.NewCLCluster.DBArgs + +Specifies the arguments to be passed to the database. This is valid only if the deployment is on Kubernetes. + +Example Usage: + +```toml +[CCIP.Env.NewCLCluster] +NoOfNodes = 17 +NodeMemory = '12Gi' +NodeCPU = '6' +DBMemory = '10Gi' +DBCPU = '2' +DBStorageClass = 'gp3' +PromPgExporter = true +DBCapacity = '50Gi' +IsStateful = true +DBArgs = ['shared_buffers=2048MB', 'effective_cache_size=4096MB', 'work_mem=64MB'] + +[CCIP.Env.NewCLCluster.Common] +Name = 'node1' +DBImage = 'postgres' +DBTag = '13.12' +CommonChainConfigTOML = """ +[HeadTracker] +HistoryDepth = 400 + +[GasEstimator] +PriceMax = '200 gwei' +LimitDefault = 6000000 +FeeCapDefault = '200 gwei' +""" +``` + +### CCIP.Env.ExistingCLCluster + +The ExistingCLCluster config holds the overall connection configuration for existing Chainlink nodes. +It is needed when the tests are to be run on Chainlink nodes already deployed on some environment. +If this is specified, test will not need to connect to k8 namespace using [CCIP.Env.EnvToConnect](#ccipenvenvtoconnect). +Test can directly connect to the existing Chainlink nodes using node credentials without knowing the k8 namespace details. + +#### CCIP.Env.ExistingCLCluster.Name + +Specifies the name of the existing Chainlink cluster. This is used to identify the cluster in the test. + +#### CCIP.Env.ExistingCLCluster.NoOfNodes + +Specifies the number of Chainlink nodes in the existing cluster. + +#### CCIP.Env.ExistingCLCluster.NodeConfigs + +Specifies the configuration for individual nodes in the existing cluster. Each node config contains the following fields to connect to the Chainlink node: + +##### CCIP.Env.ExistingCLCluster.NodeConfigs.URL + +The URL of the Chainlink node. + +##### CCIP.Env.ExistingCLCluster.NodeConfigs.Email + +The username/email of the Chainlink node credential. + +##### CCIP.Env.ExistingCLCluster.NodeConfigs.Password + +The password of the Chainlink node credential. + +##### CCIP.Env.ExistingCLCluster.NodeConfigs.InternalIP + +The internal IP of the Chainlink node. + +Example Usage: + +```toml +[CCIP.Env.ExistingCLCluster] +Name = 'crib-sample' +NoOfNodes = 5 + +[[CCIP.Env.ExistingCLCluster.NodeConfigs]] +URL = 'https://crib-sample-demo-node1.main.stage.cldev.sh/' +Email = 'notreal@fakeemail.ch' +Password = 'fj293fbBnlQ!f9vNs' +InternalIP = 'app-node-1' + + +[[CCIP.Env.ExistingCLCluster.NodeConfigs]] +URL = 'https://crib-sample-demo-node2.main.stage.cldev.sh/' +Email = 'notreal@fakeemail.ch' +Password = 'fj293fbBnlQ!f9vNs' +InternalIP = 'app-node-2' + +[[CCIP.Env.ExistingCLCluster.NodeConfigs]] +URL = 'https://crib-sample-demo-node3.main.stage.cldev.sh/' +Email = 'notreal@fakeemail.ch' +Password = 'fj293fbBnlQ!f9vNs' +InternalIP = 'app-node-3' + +[[CCIP.Env.ExistingCLCluster.NodeConfigs]] +URL = 'https://crib-ani-demo-node4.main.stage.cldev.sh/' +Email = 'notreal@fakeemail.ch' +Password = 'fj293fbBnlQ!f9vNs' +InternalIP = 'app-node-4' + +[[CCIP.Env.ExistingCLCluster.NodeConfigs]] +URL = 'https://crib-sample-demo-node5.main.stage.cldev.sh/' +Email = 'notreal@fakeemail.ch' +Password = 'fj293fbBnlQ!f9vNs' +InternalIP = 'app-node-5' +``` + +### CCIP.Env.EnvToConnect + +This is specified when the test needs to connect to already existing k8s namespace. User needs to have access to the k8 namespace to run the tests through specific kubeconfig file. +Example usage: + +```toml +[CCIP.Env] +EnvToConnect="load-ccip-c8972" +``` + +### CCIP.ENV.TTL + +Specifies the time to live for the k8 namespace. This is used to terminate the namespace after the tests are run. This is only valid if the tests are run on k8s. +Example usage: + +```toml +[CCIP.Env] +TTL = "11h" +``` + +### CCIP.Env.Logging + +Specifies the logging configuration for the test. Imported from [LoggingConfig](https://github.com/smartcontractkit/chainlink-testing-framework/blob/main/config/logging.go#L11) in chainlink-testing-framework. +Example usage: + +```toml +[CCIP.Env.Logging] +test_log_collect = false # if set to true will save logs even if test did not fail + +[CCIP.Env.Logging.LogStream] +# supported targets: file, loki, in-memory. if empty no logs will be persistet +log_targets = ["file"] +# context timeout for starting log producer and also time-frame for requesting logs +log_producer_timeout = "10s" +# number of retries before log producer gives up and stops listening to logs +log_producer_retry_limit = 10 + +[CCIP.Env.Logging.Loki] +tenant_id = "..." +endpoint = "https://loki...." + +[CCIP.Env.Logging.Grafana] +base_url = "https://grafana..../" +dashboard_url = "/d/6vjVx-1V8/ccip-long-running-tests" +``` + +### CCIP.Env.Lane.LeaderLaneEnabled + +Specifies whether to enable the leader lane feature. This setting is only applicable for new deployments. + +## CCIP.Groups + +Specifies the test config specific to each test type. Available test types are: + +- **CCIP.Groups.load** +- **CCIP.Groups.smoke** +- **CCIP.Groups.chaos** + +### CCIP.Groups.[testgroup].KeepEnvAlive + +Specifies whether to keep the k8 namespace alive after the test is run. This is only valid if the tests are run on k8s. + +### CCIP.Groups.[testgroup].BiDirectionalLane + +Specifies whether to set up bi-directional lanes between networks. + +### CCIP.Groups.[testgroup].CommitAndExecuteOnSameDON + +Specifies whether commit and execution jobs are to be run on the same Chainlink node. + +### CCIP.Groups.[testgroup].AllowOutOfOrder + +Specifies whether out of order execution is allowed globally for all the chains. + +### CCIP.Groups.[testgroup].NoOfCommitNodes + +Specifies the number of nodes on which commit jobs are to be run. This needs to be lesser than the total number of nodes mentioned in [CCIP.Env.NewCLCluster.NoOfNodes](#ccipenvnewclclusternoofnodes) or [CCIP.Env.ExistingCLCluster.NoOfNodes](#ccipenvexistingclclusternoofnodes). +If the value of total nodes is `n`, then the max value of NoOfCommitNodes should be less than `n-1`. As the first node is used for bootstrap job. +If the NoOfCommitNodes is lesser than `n-1`, then the remaining nodes are used for execution jobs if `CCIP.Groups.[testgroup].CommitAndExecuteOnSameDON` is set to false. + +### CCIP.Groups.[testgroup].TokenConfig + +Specifies the token configuration for the test. The token configuration is used to set up tokens and token pools for all chains. + +#### CCIP.Groups.[testgroup].TokenConfig.NoOfTokensPerChain + +Specifies the number of tokens to be set up for each chain. + +#### CCIP.Groups.[testgroup].TokenConfig.WithPipeline + +Specifies whether to set up token pipelines in commit jobspec. If set to false, the token prices will be set with DynamicPriceGetterConfig. + +#### CCIP.Groups.[testgroup].TokenConfig.TimeoutForPriceUpdate + +Specifies the timeout to wait for token and gas price updates to be available in price registry for each chain. + +#### CCIP.Groups.[testgroup].TokenConfig.NoOfTokensWithDynamicPrice + +Specifies the number of tokens to be set up with dynamic price update. The rest of the tokens will be set up with static price. This is only valid if [WithPipeline](#ccipgroupstestgrouptokenconfigwithpipeline) is set to false. + +#### CCIP.Groups.[testgroup].TokenConfig.DynamicPriceUpdateInterval + +Specifies the interval for dynamic price update for tokens. This is only valid if [NoOfTokensWithDynamicPrice](#ccipgroupstestgrouptokenconfignooftokenswithdynamicprice) is set to value greater tha zero. + +#### CCIP.Groups.[testgroup].TokenConfig.CCIPOwnerTokens + +Specifies the tokens to be owned by the CCIP owner. If this is false, the tokens and pools will be owned by an address other than rest of CCIP contract admin addresses. +This is applicable only if the contract versions are '1.5' or higher. + +Example Usage: + +```toml +[CCIP.Groups.load.TokenConfig] +TimeoutForPriceUpdate = '15m' +NoOfTokensPerChain = 60 +NoOfTokensWithDynamicPrice = 15 +DynamicPriceUpdateInterval ='15s' +CCIPOwnerTokens = true +``` + +### CCIP.Groups.[testgroup].MsgDetails + +Specifies the ccip message details to be sent by the test. + +#### CCIP.Groups.[testgroup].MsgDetails.MsgType + +Specifies the type of message to be sent. The supported message types are: + +- **Token** +- **Data** +- **DataWithToken** + +#### CCIP.Groups.[testgroup].MsgDetails.DestGasLimit + +Specifies the gas limit for the destination chain. This is used to in `ExtraArgs` field of CCIPMessage. Change this to 0, if you are doing ccip-send to an EOA in the destination chain. + +#### CCIP.Groups.[testgroup].MsgDetails.DataLength + +Specifies the length of data to be sent in the message. This is only valid if [MsgType](#ccipgroupstestgroupmsgdetailsmsgtype) is set to 'Data' or 'DataWithToken'. + +#### CCIP.Groups.[testgroup].MsgDetails.NoOfTokens + +Specifies the number of tokens to be sent in the message. This is only valid if [MsgType](#ccipgroupstestgroupmsgdetailsmsgtype) is set to 'Token' or 'DataWithToken'. +It needs to be less than or equal to [NoOfTokensPerChain](#ccipgroupstestgrouptokenconfignooftokensperchain) specified in the test config. + +#### CCIP.Groups.[testgroup].MsgDetails.TokenAmount + +Specifies the amount for each token to be sent in the message. This is only valid if [MsgType](#ccipgroupstestgroupmsgdetailsmsgtype) is set to 'Token' or 'DataWithToken'. + +Example Usage: + +```toml +[CCIP.Groups.smoke.MsgDetails] +MsgType = 'DataWithToken' +DestGasLimit = 100000 +DataLength = 1000 +NoOfTokens = 2 +AmountPerToken = 1 +``` + +### CCIP.Groups.[testgroup].MulticallInOneTx + +Specifies whether to send multiple ccip messages in a single transaction. + +### CCIP.Groups.[testgroup].NoOfSendsInMulticall + +Specifies the number of ccip messages to be sent in a single transaction. This is only valid if [MulticallInOneTx](#ccipgroupstestgroupmulticallinonetx) is set to true. + +### CCIP.Groups.[testgroup].PhaseTimeout + +The test validates various events in a ccip request lifecycle, like commit, execute, etc. This field specifies the timeout for each phase in the lifecycle. +The timeout is calculated from the time the previous phase event is received. +The following contract events are validated: + +- **CCIPSendRequested on OnRamp** +- **CCIPSendRequested event log to be Finalized** +- **ReportAccepted on CommitStore** +- **TaggedRootBlessed on ARM/RMN** +- **ExecutionStateChanged on OffRamp** + +### CCIP.Groups.[testgroup].LocalCluster + +Specifies whether the test is to be run on a local docker. If set to true, the test environment will be set up on a local docker. + +### CCIP.Groups.[testgroup].ExistingDeployment + +Specifies whether the test is to be run on existing deployments. If set to true, the test will use the deployment data specified in [CCIP.Deployments](#ccipdeployments) for interacting with the ccip contracts. +If the deployment data does not contain the required contract addresses, the test will fail. + +### CCIP.Groups.[testgroup].ReuseContracts + +Test loads contract/lane config from [contracts.json](../contracts/laneconfig/contracts.json) if no lane config is specified in [CCIP.Deployments](#ccipdeployments) +If a certain contract is present in the contracts.json, the test will use the contract address from the contracts.json. +This field specifies whether to reuse the contracts from [contracts.json](../contracts/laneconfig/contracts.json) +For example if the contracts.json contains the contract address for PriceRegistry for `Arbitrum Mainnet`, the test by default will use the contract address from contracts.json instead of redeploying the contract. +If `ReuseContracts` is set to false, the test will redeploy the contract instead of using the contract address from contracts.json. + +### CCIP.Groups.[testgroup].NodeFunding + +Specified the native token funding for each Chainlink node. It assumes that the native token decimals is 18. +The funding is done by the private key specified in [CCIP.Env.Networks](#ccipenvnetworks) for each network. +The funding is done only if the test is run on local docker or k8s. This is not applicable for [existing deployments](#ccipgroupstestgroupexistingdeployment) is set to true. + +### CCIP.Groups.[testgroup].NetworkPairs + +Specifies the network pairs for which the test is to be run. The test will set up lanes only between the specified network pairs. +If the network pairs are not specified, the test will set up lanes between all possible pairs of networks mentioned in selected_networks in [CCIP.Env.Networks](#ccipenvnetworksselectednetworks) + +### CCIP.Groups.[testgroup].NoOfNetworks + +Specifies the number of networks to be used for the test. +If the number of networks is greater than the total number of networks specified in [CCIP.Env.Networks.selected_networks](#ccipenvnetworksselectednetworks): + +- the test will fail if the networks are live networks. +- the test will create equal number of replicas of the first network with a new chain id if the networks are simulated networks. + For example, if the `selected_networks` is ['SIMULATED_1','SIMULATED_2'] and `NoOfNetworks` is 3, the test will create 1 more network config by copying the network config of `SIMULATED_1` with a different chain id and use that as 3rd network. + +### CCIP.Groups.[testgroup].NoOfRoutersPerPair + +Specifies the number of routers to be set up for each network. + +### CCIP.Groups.[testgroup].MaxNoOfLanes + +Specifies the maximum number of lanes to be set up between networks. If this values is not set, the test will set up lanes between all possible pairs of networks mentioned in `selected_networks` in [CCIP.Env.Networks](#ccipenvnetworksselectednetworks). +For example, if `selected_networks = ['SIMULATED_1', 'SIMULATED_2', 'SIMULATED_3']`, and `MaxNoOfLanes` is set to 2, it denotes that the test will randomly select the 2 lanes between all possible pairs `SIMULATED_1`, `SIMULATED_2`, and `SIMULATED_3` for the test run. + +### CCIP.Groups.[testgroup].DenselyConnectedNetworkChainIds + +This is applicable only if [MaxNoOfLanes](#ccipgroupstestgroupmaxnooflanes) is specified. +Specifies the chain ids for networks to be densely connected. If this is provided the test will include all possible pairs of networks mentioned in `DenselyConnectedNetworkChainIds`. +The rest of the networks will be connected randomly based on the value of `MaxNoOfLanes`. + +### CCIP.Groups.[testgroup].ChaosDuration + +Specifies the duration for which the chaos experiment is to be run. This is only valid if the test type is 'chaos'. + +### CCIP.Groups.[testgroup].USDCMockDeployment + +Specifies whether to deploy USDC mock contract for the test. This is only valid if the test is not run on [existing deployments](#ccipgroupstestgroupexistingdeployment). + +The following fields are used for various parameters in OCR2 commit and execution jobspecs. All of these are only valid if the test is not run on [existing deployments](#ccipgroupstestgroupexistingdeployment). + +### CCIP.Groups.[testgroup].CommitOCRParams + +Specifies the OCR parameters for the commit job. This is only valid if the test is not run on [existing deployments](#ccipgroupstestgroupexistingdeployment). + +### CCIP.Groups.[testgroup].ExecuteOCRParams + +Specifies the OCR parameters for the execute job. This is only valid if the test is not run on [existing deployments](#ccipgroupstestgroupexistingdeployment). + +### CCIP.Groups.[testgroup].CommitInflightExpiry + +Specifies the value for the `InflightExpiry` in commit job's offchain config. This is only valid if the test is not run on [existing deployments](#ccipgroupstestgroupexistingdeployment). + +### CCIP.Groups.[testgroup].OffRampConfig + +Specifies the offramp configuration for the execution job. This is only valid if the test is not run on [existing deployments](#ccipgroupstestgroupexistingdeployment). +This is used to set values for following fields in execution jobspec's offchain and onchain config: + +- **OffRampConfig.MaxDataBytes** +- **OffRampConfig.BatchGasLimit** +- **OffRampConfig.InflightExpiry** +- **OffRampConfig.RootSnooze** + +Example Usage: + +```toml +[CCIP.Groups.load] +CommitInflightExpiry = '5m' + +[CCIP.Groups.load.CommitOCRParams] +DeltaProgress = '2m' +DeltaResend = '5s' +DeltaRound = '75s' +DeltaGrace = '5s' +MaxDurationQuery = '100ms' +MaxDurationObservation = '35s' +MaxDurationReport = '10s' +MaxDurationShouldAcceptFinalizedReport = '5s' +MaxDurationShouldTransmitAcceptedReport = '10s' + +[CCIP.Groups.load.ExecOCRParams] +DeltaProgress = '2m' +DeltaResend = '5s' +DeltaRound = '75s' +DeltaGrace = '5s' +MaxDurationQuery = '100ms' +MaxDurationObservation = '35s' +MaxDurationReport = '10s' +MaxDurationShouldAcceptFinalizedReport = '5s' +MaxDurationShouldTransmitAcceptedReport = '10s' + +[CCIP.Groups.load.OffRampConfig] +BatchGasLimit = 11000000 +MaxDataBytes = 1000 +InflightExpiry = '5m' +RootSnooze = '5m' +``` + +### CCIP.Groups.[testgroup].StoreLaneConfig + +This is only valid if the tests are run on remote runners in k8s. If set to true, the test will store the lane config in the remote runner. + +### CCIP.Groups.[testgroup].LoadProfile + +Specifies the load profile for the test. Only valid if the testgroup is 'load'. + +### CCIP.Groups.[testgroup].LoadProfile.LoadFrequency.[DestNetworkName] + +#### CCIP.Groups.[testgroup].LoadProfile.RequestPerUnitTime + +Specifies the number of requests to be sent per unit time. This is applicable to all networks if [LoadFrequency](#ccipgroupstestgrouploadprofileloadfrequencydestnetworkname) is not specified for a destination network. + +#### CCIP.Groups.[testgroup].LoadProfile.TimeUnit + +Specifies the unit of time for the load profile. This is applicable to all networks if [LoadFrequency](#ccipgroupstestgrouploadprofileloadfrequencydestnetworkname) is not specified for a destination network. + +#### CCIP.Groups.[testgroup].LoadProfile.StepDuration + +Specifies the duration for each step in the load profile. This is applicable to all networks if [LoadFrequency](#ccipgroupstestgrouploadprofileloadfrequencydestnetworkname) is not specified for a destination network. + +#### CCIP.Groups.[testgroup].LoadProfile.TestDuration + +Specifies the total duration for the load test. + +#### CCIP.Groups.[testgroup].LoadProfile.NetworkChaosDelay + +Specifies the duration network delay used for `NetworkChaos` experiment. This is only valid if the test is run on k8s and not on [existing deployments](#ccipgroupstestgroupexistingdeployment). + +#### CCIP.Groups.[testgroup].LoadProfile.WaitBetweenChaosDuringLoad + +If there are multiple chaos experiments, this specifies the duration to wait between each chaos experiment. This is only valid if the test is run on k8s and not on [existing deployments](#ccipgroupstestgroupexistingdeployment). + +#### CCIP.Groups.[testgroup].LoadProfile.SkipRequestIfAnotherRequestTriggeredWithin + +If a request is triggered within this duration, the test will skip sending another request during load run. For Example, if `SkipRequestIfAnotherRequestTriggeredWithin` is set to `40m`, and a request is triggered at 0th second, the test will skip sending another request for another 40m. +This particular field is used to avoid sending multiple requests in a short duration during load run. + +#### CCIP.Groups.[testgroup].LoadProfile.OptimizeSpace + +This is used internally to optimize memory usage during load run. If set to true, after the initial lane set up is over the test will discard the lane config to save memory. +The test will only store contract addresses strictly necessary to trigger/validate ccip-send requests. +Except for following contracts all other contract addresses will be discarded after the initial lane set up - + +- Router +- ARM +- CommitStore +- OffRamp +- OnRamp + +#### CCIP.Groups.[testgroup].LoadProfile.FailOnFirstErrorInLoad + +If set to true, the test will fail on the first error encountered during load run. If set to false, the test will continue to run even if there are errors during load run. + +#### CCIP.Groups.[testgroup].LoadProfile.SendMaxDataInEveryMsgCount + +Specifies the number of requests to send with maximum data in every mentioned count iteration. +For example, if `SendMaxDataInEveryMsgCount` is set to 5, the test will send ccip message with max allowable data length(as set in onRamp config) in every 5th request. + +#### CCIP.Groups.[testgroup].LoadProfile.TestRunName + +Specifies the name of the test run. This is used to identify the test run in CCIP test dashboard or logs. If multiple tests are run with same `TestRunName`, the test results will be aggregated under the same test run in grafana dashboard. +This is used when multiple iterations of tests are run against same release version to aggregate the results under same dashboard view. + +#### CCIP.Groups.[testgroup].LoadProfile.MsgProfile + +Specifies the message profile for the test. The message profile is used to set up multiple ccip message details during load test. + +##### CCIP.Groups.[testgroup].LoadProfile.MsgProfile.Frequencies + +Specifies the frequency of each message profile. +For example, if `Frequencies` is set to [1, 2, 3], the test will send 1st message profile 1 time, 2nd message profile 2 times, and 3rd message profile 3 times in each iteration. Each iteration will be defined by (1+2+3) = 6 requests. +Example Breakdown: + +- Frequencies = [4, 12, 3, 1] +- Total Sum of Frequencies = 4 + 12 + 3 + 1 = 20 +- Percentages: + - Message Type 1: (4 / 20) * 100% = 20% + - Message Type 2: (12 / 20) * 100% = 60% + - Message Type 3: (3 / 20) * 100% = 15% + - Message Type 4: (1 / 20) * 100% = 5% + These percentages reflect how often each message type should appear in the total set of messages. + Please note - if the total set of messages is not equal to the multiple of sum of frequencies, the percentages will not be accurate. + +##### CCIP.Groups.[testgroup].LoadProfile.MsgProfile.MsgDetails + +Specifies the message details for each message profile. The fields are the same as [CCIP.Groups.[testgroup].MsgDetails](#ccipgroupstestgroupmsgdetails). + +example usage: + +```toml +# to represent 20%, 60%, 15%, 5% of the total messages +[CCIP.Groups.load.LoadProfile.MsgProfile] +Frequencies = [4,12,3,1] + +[[CCIP.Groups.load.LoadProfile.MsgProfile.MsgDetails]] +MsgType = 'Token' +DestGasLimit = 0 +DataLength = 0 +NoOfTokens = 5 +AmountPerToken = 1 + +[[CCIP.Groups.load.LoadProfile.MsgProfile.MsgDetails]] +MsgType = 'DataWithToken' +DestGasLimit = 500000 +DataLength = 5000 +NoOfTokens = 5 +AmountPerToken = 1 + +[[CCIP.Groups.load.LoadProfile.MsgProfile.MsgDetails]] +MsgType = 'Data' +DestGasLimit = 800000 +DataLength = 10000 + +[[CCIP.Groups.load.LoadProfile.MsgProfile.MsgDetails]] +MsgType = 'Data' +DestGasLimit = 2500000 +DataLength = 10000 +``` \ No newline at end of file diff --git a/integration-tests/ccip-tests/testconfig/ccip.go b/integration-tests/ccip-tests/testconfig/ccip.go new file mode 100644 index 00000000000..0a53ee18732 --- /dev/null +++ b/integration-tests/ccip-tests/testconfig/ccip.go @@ -0,0 +1,442 @@ +package testconfig + +import ( + "fmt" + "math/big" + "os" + + "github.com/AlekSi/pointer" + "github.com/pelletier/go-toml/v2" + "github.com/rs/zerolog" + + "github.com/smartcontractkit/chainlink-common/pkg/config" + ctfconfig "github.com/smartcontractkit/chainlink-testing-framework/lib/config" + ctfK8config "github.com/smartcontractkit/chainlink-testing-framework/lib/k8s/config" + + ccipcontracts "github.com/smartcontractkit/chainlink/integration-tests/ccip-tests/contracts" + testutils "github.com/smartcontractkit/chainlink/integration-tests/ccip-tests/utils" + "github.com/smartcontractkit/chainlink/integration-tests/contracts" +) + +const ( + CONTRACTS_OVERRIDE_CONFIG string = "BASE64_CCIP_CONFIG_OVERRIDE_CONTRACTS" + TokenOnlyTransfer string = "Token" + DataOnlyTransfer string = "Data" + DataAndTokenTransfer string = "DataWithToken" +) + +type OffRampConfig struct { + MaxDataBytes *uint32 `toml:",omitempty"` + BatchGasLimit *uint32 `toml:",omitempty"` + InflightExpiry *config.Duration `toml:",omitempty"` + RootSnooze *config.Duration `toml:",omitempty"` +} + +type MsgDetails struct { + MsgType *string `toml:",omitempty"` + DestGasLimit *int64 `toml:",omitempty"` + DataLength *int64 `toml:",omitempty"` + NoOfTokens *int `toml:",omitempty"` + AmountPerToken *int64 `toml:",omitempty"` +} + +func (m *MsgDetails) IsTokenTransfer() bool { + return pointer.GetString(m.MsgType) == "Token" || pointer.GetString(m.MsgType) == "DataWithToken" +} + +func (m *MsgDetails) IsDataTransfer() bool { + return pointer.GetString(m.MsgType) == "Data" || pointer.GetString(m.MsgType) == "DataWithToken" +} + +func (m *MsgDetails) TransferAmounts() []*big.Int { + var transferAmounts []*big.Int + if m.IsTokenTransfer() { + for i := 0; i < pointer.GetInt(m.NoOfTokens); i++ { + transferAmounts = append(transferAmounts, big.NewInt(pointer.GetInt64(m.AmountPerToken))) + } + } + return transferAmounts +} + +func (m *MsgDetails) Validate() error { + if m == nil { + return fmt.Errorf("msg details should be set") + } + if m.MsgType == nil { + return fmt.Errorf("msg type should be set") + } + if m.IsDataTransfer() { + if m.DataLength == nil || *m.DataLength == 0 { + return fmt.Errorf("data length should be set and greater than 0") + } + } + if m.DestGasLimit == nil { + return fmt.Errorf("destination gas limit should be set") + } + if pointer.GetString(m.MsgType) != DataOnlyTransfer && + pointer.GetString(m.MsgType) != TokenOnlyTransfer && + pointer.GetString(m.MsgType) != DataAndTokenTransfer { + return fmt.Errorf("msg type should be - %s/%s/%s", DataOnlyTransfer, TokenOnlyTransfer, DataAndTokenTransfer) + } + + if m.IsTokenTransfer() { + if pointer.GetInt64(m.AmountPerToken) == 0 { + return fmt.Errorf("token amount should be greater than 0") + } + + if pointer.GetInt(m.NoOfTokens) == 0 { + return fmt.Errorf("number of tokens in msg should be greater than 0") + } + } + + return nil +} + +// TokenConfig defines the configuration for tokens in a CCIP test group +type TokenConfig struct { + NoOfTokensPerChain *int `toml:",omitempty"` + WithPipeline *bool `toml:",omitempty"` + TimeoutForPriceUpdate *config.Duration `toml:",omitempty"` + NoOfTokensWithDynamicPrice *int `toml:",omitempty"` + DynamicPriceUpdateInterval *config.Duration `toml:",omitempty"` + // CCIPOwnerTokens dictates if tokens are deployed and controlled by the default CCIP owner account + // By default, all tokens are deployed and owned by a separate address + CCIPOwnerTokens *bool `toml:",omitempty"` +} + +func (tc *TokenConfig) IsDynamicPriceUpdate() bool { + return tc.NoOfTokensWithDynamicPrice != nil && *tc.NoOfTokensWithDynamicPrice > 0 +} + +func (tc *TokenConfig) IsPipelineSpec() bool { + return pointer.GetBool(tc.WithPipeline) +} + +func (tc *TokenConfig) Validate() error { + if tc == nil { + return fmt.Errorf("token config should be set") + } + if tc.TimeoutForPriceUpdate == nil || tc.TimeoutForPriceUpdate.Duration().Minutes() == 0 { + return fmt.Errorf("timeout for price update should be set") + } + if tc.NoOfTokensWithDynamicPrice != nil && *tc.NoOfTokensWithDynamicPrice > 0 { + if tc.DynamicPriceUpdateInterval == nil || tc.DynamicPriceUpdateInterval.Duration().Minutes() == 0 { + return fmt.Errorf("dynamic price update interval should be set if NoOfTokensWithDynamicPrice is greater than 0") + } + } + return nil +} + +type MsgProfile struct { + MsgDetails *[]*MsgDetails `toml:",omitempty"` + Frequencies []int `toml:",omitempty"` + matrixByFreq []int + mapMsgDetails map[int]*MsgDetails +} + +// msgDetailsIndexMatrixByFrequency creates a matrix of msg details index based on their frequency +// This matrix is used to select a msg detail based on the iteration number +// For example, if we have 3 msg details (msg1,msg2,msg3) with frequencies 2, 3, 5 respectively, +// the matrixByFreq will be [0,0,1,1,1,2,2,2,2,2] +// and mapMsgDetails will be {0:msg1, 1:msg2, 2:msg3} +// So, for iteration 0, msg1 will be selected, for iteration 1, msg1 will be selected, for iteration 2, msg2 will be selected and so on +// This is useful to select a msg detail based on the iteration number +func (m *MsgProfile) msgDetailsIndexMatrixByFrequency() { + m.mapMsgDetails = make(map[int]*MsgDetails) + for i, msg := range *m.MsgDetails { + m.mapMsgDetails[i] = msg + } + m.matrixByFreq = make([]int, 0) + for i, freq := range m.Frequencies { + for j := 0; j < freq; j++ { + m.matrixByFreq = append(m.matrixByFreq, i) + } + } + // we do not need frequencies and msg details after creating the matrix + m.Frequencies = nil + m.MsgDetails = nil +} + +// MsgDetailsForIteration returns the msg details for the given iteration +// The iteration is used to select the msg details based on their frequency +// Refer to msgDetailsIndexMatrixByFrequency for more details +// If the iteration is greater than the number of matrixByFreq, it will loop back to the first msg detail +// if the final iteration in a load run is lesser than the number of matrixByFreq, there is a chance that some of the msg details might not be selected +func (m *MsgProfile) MsgDetailsForIteration(it int64) *MsgDetails { + index := (it - 1) % int64(len(m.matrixByFreq)) + return m.mapMsgDetails[m.matrixByFreq[index]] +} + +// MsgDetailWithMaxToken returns the msg details with the max no of tokens in the msg profile +func (m *MsgProfile) MsgDetailWithMaxToken() *MsgDetails { + allDetails := *m.MsgDetails + msgDetails := allDetails[0] + for _, msg := range allDetails { + if msg.NoOfTokens != nil && pointer.GetInt(msg.NoOfTokens) > pointer.GetInt(msgDetails.NoOfTokens) { + msgDetails = msg + } + } + return msgDetails +} + +func (m *MsgProfile) Validate() error { + if m == nil { + return fmt.Errorf("msg profile should be set") + } + if m.MsgDetails == nil { + return fmt.Errorf("msg details should be set") + } + allDetails := *m.MsgDetails + if len(allDetails) == 0 { + return fmt.Errorf("msg details should be set") + } + if len(m.Frequencies) == 0 { + return fmt.Errorf("frequencies should be set") + } + if len(allDetails) != len(m.Frequencies) { + return fmt.Errorf("number of msg details %d and frequencies %d should be same", len(allDetails), len(m.Frequencies)) + } + for _, msg := range allDetails { + if err := msg.Validate(); err != nil { + return err + } + } + return nil +} + +type LoadFrequency struct { + RequestPerUnitTime []int64 `toml:",omitempty"` + TimeUnit *config.Duration `toml:",omitempty"` + StepDuration []*config.Duration `toml:",omitempty"` +} + +type LoadProfile struct { + MsgProfile *MsgProfile `toml:",omitempty"` + FrequencyByDestination map[string]*LoadFrequency `toml:",omitempty"` + RequestPerUnitTime []int64 `toml:",omitempty"` + TimeUnit *config.Duration `toml:",omitempty"` + StepDuration []*config.Duration `toml:",omitempty"` + TestDuration *config.Duration `toml:",omitempty"` + NetworkChaosDelay *config.Duration `toml:",omitempty"` + WaitBetweenChaosDuringLoad *config.Duration `toml:",omitempty"` + SkipRequestIfAnotherRequestTriggeredWithin *config.Duration `toml:",omitempty"` + OptimizeSpace *bool `toml:",omitempty"` + FailOnFirstErrorInLoad *bool `toml:",omitempty"` + SendMaxDataInEveryMsgCount *int64 `toml:",omitempty"` + TestRunName string `toml:",omitempty"` +} + +func (l *LoadProfile) Validate() error { + if l == nil { + return fmt.Errorf("load profile should be set") + } + if err := l.MsgProfile.Validate(); err != nil { + return err + } + if len(l.RequestPerUnitTime) == 0 { + return fmt.Errorf("request per unit time should be set") + } + if l.TimeUnit == nil || l.TimeUnit.Duration().Minutes() == 0 { + return fmt.Errorf("time unit should be set") + } + if l.TestDuration == nil || l.TestDuration.Duration().Minutes() == 0 { + return fmt.Errorf("test duration should be set") + } + if l.SkipRequestIfAnotherRequestTriggeredWithin != nil && l.TimeUnit.Duration() < l.SkipRequestIfAnotherRequestTriggeredWithin.Duration() { + return fmt.Errorf("SkipRequestIfAnotherRequestTriggeredWithin should be set below the TimeUnit duration") + } + return nil +} + +func (l *LoadProfile) SetTestRunName(name string) { + if l.TestRunName == "" && name != "" { + l.TestRunName = name + } +} + +type ReorgProfile struct { + FinalityDelta int `toml:",omitempty"` +} + +func (gp *ReorgProfile) Validate() error { + // FinalityDelta can be validated only relatively to CL nodes settings, see setupReorgSuite method + return nil +} + +// CCIPTestGroupConfig defines configuration input to change how a particular CCIP test group should run +type CCIPTestGroupConfig struct { + Type string `toml:",omitempty"` + KeepEnvAlive *bool `toml:",omitempty"` + BiDirectionalLane *bool `toml:",omitempty"` + CommitAndExecuteOnSameDON *bool `toml:",omitempty"` + AllowOutOfOrder *bool `toml:",omitempty"` // To set out of order execution globally + NoOfCommitNodes int `toml:",omitempty"` + MsgDetails *MsgDetails `toml:",omitempty"` + TokenConfig *TokenConfig `toml:",omitempty"` + MulticallInOneTx *bool `toml:",omitempty"` + NoOfSendsInMulticall int `toml:",omitempty"` + PhaseTimeout *config.Duration `toml:",omitempty"` + LocalCluster *bool `toml:",omitempty"` + ExistingDeployment *bool `toml:",omitempty"` + ReuseContracts *bool `toml:",omitempty"` + NodeFunding float64 `toml:",omitempty"` + NetworkPairs []string `toml:",omitempty"` + DenselyConnectedNetworkChainIds []string `toml:",omitempty"` + NoOfNetworks int `toml:",omitempty"` + NoOfRoutersPerPair int `toml:",omitempty"` + MaxNoOfLanes int `toml:",omitempty"` + ChaosDuration *config.Duration `toml:",omitempty"` + USDCMockDeployment *bool `toml:",omitempty"` + CommitOCRParams *contracts.OffChainAggregatorV2Config `toml:",omitempty"` + ExecOCRParams *contracts.OffChainAggregatorV2Config `toml:",omitempty"` + OffRampConfig *OffRampConfig `toml:",omitempty"` + CommitInflightExpiry *config.Duration `toml:",omitempty"` + StoreLaneConfig *bool `toml:",omitempty"` + LoadProfile *LoadProfile `toml:",omitempty"` + ReorgProfile *ReorgProfile `toml:",omitempty"` +} + +func (c *CCIPTestGroupConfig) Validate() error { + if c.Type == Load { + if err := c.LoadProfile.Validate(); err != nil { + return err + } + if c.MsgDetails == nil { + c.MsgDetails = c.LoadProfile.MsgProfile.MsgDetailWithMaxToken() + } + c.LoadProfile.MsgProfile.msgDetailsIndexMatrixByFrequency() + if c.ExistingDeployment != nil && *c.ExistingDeployment { + if c.LoadProfile.TestRunName == "" && os.Getenv(ctfK8config.EnvVarJobImage) != "" { + return fmt.Errorf("test run name should be set if existing deployment is true and test is running in k8s") + } + } + } + err := c.MsgDetails.Validate() + if err != nil { + return err + } + if c.PhaseTimeout != nil && (c.PhaseTimeout.Duration().Minutes() < 1 || c.PhaseTimeout.Duration().Minutes() > 50) { + return fmt.Errorf("phase timeout should be between 1 and 50 minutes") + } + + if c.NoOfCommitNodes < 4 { + return fmt.Errorf("insuffcient number of commit nodes provided") + } + if err := c.TokenConfig.Validate(); err != nil { + return err + } + + if c.MsgDetails.IsTokenTransfer() { + if pointer.GetInt(c.TokenConfig.NoOfTokensPerChain) == 0 { + return fmt.Errorf("number of tokens per chain should be greater than 0") + } + } + if c.MulticallInOneTx != nil { + if c.NoOfSendsInMulticall == 0 { + return fmt.Errorf("number of sends in multisend should be greater than 0 if multisend is true") + } + } + + return nil +} + +type CCIPContractConfig struct { + DataFile *string `toml:",omitempty"` + Data string `toml:",omitempty"` +} + +func (c *CCIPContractConfig) DataFilePath() string { + return pointer.GetString(c.DataFile) +} + +// ContractsData reads the contract config passed in TOML +// CCIPContractConfig can accept contract config in string mentioned in Data field +// It also accepts DataFile. Data takes precedence over DataFile +// If you are providing contract config in DataFile, this will read the content of the file +// and set it to CONTRACTS_OVERRIDE_CONFIG env var in base 64 encoded format. +// This comes handy while running tests in remote runner. It ensures that you won't have to deal with copying the +// DataFile to remote runner pod. Instead, you can pass the base64ed content of the file with the help of +// an env var. +func (c *CCIPContractConfig) ContractsData() ([]byte, error) { + // check if CONTRACTS_OVERRIDE_CONFIG is provided + // load config from env var if specified for contracts + rawConfig := os.Getenv(CONTRACTS_OVERRIDE_CONFIG) + if rawConfig != "" { + err := DecodeConfig(rawConfig, &c) + if err != nil { + return nil, err + } + } + if c == nil { + return nil, nil + } + if c.Data != "" { + return []byte(c.Data), nil + } + // if DataFilePath is given, update c.Data with the content of file so that we can set CONTRACTS_OVERRIDE_CONFIG + // to pass the file content to remote runner with override config var + if c.DataFilePath() != "" { + // if there is regex provided in filepath, reformat the filepath with actual filepath matching the regex + filePath, err := testutils.FirstFileFromMatchingPath(c.DataFilePath()) + if err != nil { + return nil, fmt.Errorf("error finding contract config file %s: %w", c.DataFilePath(), err) + } + dataContent, err := os.ReadFile(filePath) + if err != nil { + return dataContent, fmt.Errorf("error reading contract config file %s : %w", filePath, err) + } + c.Data = string(dataContent) + // encode it to base64 and set to CONTRACTS_OVERRIDE_CONFIG so that the same content can be passed to remote runner + // we add TEST_ prefix to CONTRACTS_OVERRIDE_CONFIG to ensure the env var is ported to remote runner. + _, err = EncodeConfigAndSetEnv(c, fmt.Sprintf("TEST_%s", CONTRACTS_OVERRIDE_CONFIG)) + return dataContent, err + } + return nil, nil +} + +type CCIP struct { + Env *Common `toml:",omitempty"` + ContractVersions map[ccipcontracts.Name]ccipcontracts.Version `toml:",omitempty"` + Deployments *CCIPContractConfig `toml:",omitempty"` + Groups map[string]*CCIPTestGroupConfig `toml:",omitempty"` +} + +// LoadFromEnv loads selected env vars into the CCIP config +func (c *CCIP) LoadFromEnv() error { + if c.Env == nil { + c.Env = &Common{} + } + err := c.Env.ReadFromEnvVar() + if err != nil { + return err + } + return nil +} + +func (c *CCIP) Validate() error { + if c.Env != nil { + err := c.Env.Validate() + if err != nil { + return err + } + } + + for name, grp := range c.Groups { + grp.Type = name + if err := grp.Validate(); err != nil { + return err + } + } + return nil +} + +func (c *CCIP) ApplyOverrides(fromCfg *CCIP) error { + if fromCfg == nil { + return nil + } + logBytes, err := toml.Marshal(fromCfg) + if err != nil { + return err + } + return ctfconfig.BytesToAnyTomlStruct(zerolog.Logger{}, "", "", c, logBytes) +} diff --git a/integration-tests/ccip-tests/testconfig/examples/.testsecrets.example b/integration-tests/ccip-tests/testconfig/examples/.testsecrets.example new file mode 100644 index 00000000000..52afa77015e --- /dev/null +++ b/integration-tests/ccip-tests/testconfig/examples/.testsecrets.example @@ -0,0 +1,39 @@ +# DO NOT UPDATE THIS FILE WITH ANY SECRET VALUES. +# This file serves as a template for the actual ~/.testsecrets file. Follow these steps to use it: +# 1. Create a copy of this template in your home directory under ~/.testsecrets +# 2. Update ~/.testsecrets with actual secret values required for your tests. The file will be automatically loaded by the test framework +# 3. Only include secrets necessary for the tests you are running. For example, if you are only running tests on Ethereum Mainnet, you do not need secrets for Base Mainnet. Comment other env vars. +# DO NOT COMMIT THE ACTUAL SECRETS FILE TO THE REPOSITORY. + +# Chainlink image used for NewCLCluster +E2E_TEST_CHAINLINK_IMAGE="***.dkr.ecr.***.amazonaws.com/chainlink-ccip" + +# Chainlink upgrade image for NewCLCluster. Used only for upgrade tests +E2E_TEST_CHAINLINK_UPGRADE_IMAGE="***.dkr.ecr.***.amazonaws.com/chainlink-ccip" + +# Ethereum network secrets +E2E_TEST_ETHEREUM_MAINNET_WALLET_KEY="" +E2E_TEST_ETHEREUM_MAINNET_RPC_HTTP_URL="" +E2E_TEST_ETHEREUM_MAINNET_RPC_HTTP_URL_1="" +E2E_TEST_ETHEREUM_MAINNET_RPC_WS_URL="" +E2E_TEST_ETHEREUM_MAINNET_RPC_WS_URL_1="" + +# Base network secrets +E2E_TEST_BASE_MAINNET_WALLET_KEY="" +E2E_TEST_BASE_MAINNET_RPC_HTTP_URL="" +E2E_TEST_BASE_MAINNET_RPC_HTTP_URL_1="" +E2E_TEST_BASE_MAINNET_RPC_WS_URL="" +E2E_TEST_BASE_MAINNET_RPC_WS_URL_1="" + +# Other networks secrets (pattern for envs) +# E2E_TEST_(.+)_WALLET_KEY_(\d+)="" +# E2E_TEST_(.+)_RPC_HTTP_URL_(\d+)="" +# E2E_TEST_(.+)_RPC_WS_URL_(\d+)="" + +# Loki secrets +E2E_TEST_LOKI_TENANT_ID="" +E2E_TEST_LOKI_ENDPOINT="" + +# Grafana secrets +E2E_TEST_GRAFANA_BASE_URL="" +E2E_TEST_GRAFANA_DASHBOARD_URL="/d/6vjVx-1V8/ccip-long-running-tests" \ No newline at end of file diff --git a/integration-tests/ccip-tests/testconfig/examples/network_config.toml.example b/integration-tests/ccip-tests/testconfig/examples/network_config.toml.example new file mode 100644 index 00000000000..ffed99a7718 --- /dev/null +++ b/integration-tests/ccip-tests/testconfig/examples/network_config.toml.example @@ -0,0 +1,168 @@ +[RpcHttpUrls] +ETHEREUM_MAINNET = [ + 'https:....', + 'https:......', +] +AVALANCHE_MAINNET = [ + 'https:....', + 'https:......', +] +BASE_MAINNET = [ + 'https:....', + 'https:......', +] +ARBITRUM_MAINNET = [ + 'https:....', + 'https:......', +] +BSC_MAINNET = [ + 'https:....', + 'https:......', +] +OPTIMISM_MAINNET = [ + 'https:....', + 'https:......', +] +POLYGON_MAINNET = [ + 'https:....', + 'https:......', +] +WEMIX_MAINNET = [ + 'https:....', + 'https:......', +] +KROMA_MAINNET = [ + 'https:....', + 'https:......', +] + +OPTIMISM_SEPOLIA = [ + 'https:....', + 'https:......', +] +SEPOLIA = [ + 'https:....', + 'https:......', +] +AVALANCHE_FUJI = [ + 'https:....', + 'https:......', +] +ARBITRUM_SEPOLIA = [ + 'https:....', + 'https:......', +] +POLYGON_MUMBAI = [ + 'https:....', + 'https:......', +] +BASE_SEPOLIA = [ + 'https:....', + 'https:......', +] +BSC_TESTNET = [ + 'https:....', + 'https:......', +] +KROMA_SEPOLIA = [ + 'https:....', + 'https:......', +] +WEMIX_TESTNET = [ + 'https:....', + 'https:......', +] + +[RpcWsUrls] +ETHEREUM_MAINNET = [ + 'wss://......', + 'wss://.........' +] +AVALANCHE_MAINNET = [ + 'wss://......', + 'wss://.........' +] +BASE_MAINNET = [ + 'wss://......', + 'wss://.........' +] +ARBITRUM_MAINNET = [ + 'wss://......', + 'wss://.........' +] +BSC_MAINNET = [ + 'wss://......', + 'wss://.........' +] +POLYGON_MAINNET = [ + 'wss://......', + 'wss://.........' +] +OPTIMISM_MAINNET = [ + 'wss://......', + 'wss://.........' +] +WEMIX_MAINNET = [ + 'wss://......', + 'wss://.........' +] +KROMA_MAINNET = [ + 'wss://......', + 'wss://.........' +] +OPTIMISM_SEPOLIA = [ + 'wss://......', + 'wss://.........' +] +SEPOLIA = [ + 'wss://......', + 'wss://.........' +] +AVALANCHE_FUJI = [ + 'wss://......', + 'wss://.........' +] +ARBITRUM_SEPOLIA = [ + 'wss://......', + 'wss://.........' +] +POLYGON_MUMBAI = [ + 'wss://......', + 'wss://.........' +] +BASE_SEPOLIA = [ + 'wss://......', + 'wss://.........' +] +BSC_TESTNET = [ + 'wss://......', + 'wss://.........' +] +KROMA_SEPOLIA = [ + 'wss://......', + 'wss://.........' +] +WEMIX_TESTNET = [ + 'wss://......', + 'wss://.........' +] + +[WalletKeys] +ETHEREUM_MAINNET = [''] +AVALANCHE_MAINNET = [''] +BASE_MAINNET = [''] +ARBITRUM_MAINNET = [''] +BSC_MAINNET = [''] +POLYGON_MAINNET = [''] +OPTIMISM_MAINNET = [''] +WEMIX_MAINNET = [''] +KROMA_MAINNET = [''] +OPTIMISM_SEPOLIA = [''] +SEPOLIA = [''] +AVALANCHE_FUJI = [''] +ARBITRUM_SEPOLIA = [''] +POLYGON_MUMBAI = [''] +BASE_SEPOLIA = [''] +BSC_TESTNET = [''] +KROMA_SEPOLIA = [''] +WEMIX_TESTNET = [''] \ No newline at end of file diff --git a/integration-tests/ccip-tests/testconfig/examples/override.toml.example b/integration-tests/ccip-tests/testconfig/examples/override.toml.example new file mode 100644 index 00000000000..281a4e8963f --- /dev/null +++ b/integration-tests/ccip-tests/testconfig/examples/override.toml.example @@ -0,0 +1,119 @@ + +[CCIP] +[CCIP.Deployments] +Data = """ +{ + "lane_configs": { + "geth_1337": { + "is_mock_arm": true, + "fee_token": "0x42699A7612A82f1d9C36148af9C77354759b210b", + "bridge_tokens": [ + "0x42699A7612A82f1d9C36148af9C77354759b210b" + ], + "bridge_tokens_pools": [ + "0xecb550de5c73e6690ab4521c03ec9d476617167e" + ], + "arm": "0x99c6a236913907dce5714cfa4a179d4f2c0b93d9", + "router": "0x96c1f5d31c4c627d6e84a046d4790cac4f17d3ed", + "price_registry": "0x625c70baf2dfb2cf06cf6673e6bbad1672427605", + "wrapped_native": "0x9B8397f1B0FEcD3a1a40CdD5E8221Fa461898517", + "src_contracts": { + "geth_2337": { + "on_ramp": "0xe62b93777e666224cc8029c21a31311554e2f10e", + "deployed_at": 71207 + } + }, + "dest_contracts": { + "geth_2337": { + "off_ramp": "0xba1a4f08001416a630e19e34abd260f039874e92", + "commit_store": "0x297e29cd7be020c211495f98a3d794a8ae000165", + "receiver_dapp": "" + } + } + }, + "geth_2337": { + "is_mock_arm": true, + "fee_token": "0x42699A7612A82f1d9C36148af9C77354759b210b", + "bridge_tokens": [ + "0x42699A7612A82f1d9C36148af9C77354759b210b" + ], + "bridge_tokens_pools": [ + "0xc7555581de61f6db45ea28547d6d5e0722ed6fbe" + ], + "arm": "0x2b33e63e99cbb1847a2735e08c61d9034b13a171", + "router": "0x27a107a95b36c4510ea926f0f886ff7772248e66", + "price_registry": "0x4a6ea541263c363478da333239e38e96e2cc8653", + "wrapped_native": "0x9B8397f1B0FEcD3a1a40CdD5E8221Fa461898517", + "src_contracts": { + "geth_1337": { + "on_ramp": "0x96c1f5d31c4c627d6e84a046d4790cac4f17d3ed", + "deployed_at": 71209 + } + }, + "dest_contracts": { + "geth_1337": { + "off_ramp": "0xe62b93777e666224cc8029c21a31311554e2f10e", + "commit_store": "0xa1dc9167b1a8f201d15b48bdd5d77f8360845ced", + "receiver_dapp": "" + } + } + } + } +} +""" + +[CCIP.Env] +EnvUser = 'crib-deployment' +Mockserver = 'http://mockserver:1080' + +[CCIP.Env.Network] +selected_networks = ['geth_1337', 'geth_2337'] + +[CCIP.Env.Network.EVMNetworks.geth_1337] +evm_name = 'geth_1337' +evm_chain_id = 1337 +evm_urls = ['wss://chain-alpha-rpc.nodeops.sand.cldev.sh/ws/'] +evm_http_urls = ['https://chain-alpha-rpc.nodeops.sand.cldev.sh/'] +evm_keys = ['8f2a55949038a9610f50fb23b5883af3b4ecb3c3bb792cbcefbd1542c692be63'] +evm_simulated = true +client_implementation = 'Ethereum' +evm_chainlink_transaction_limit = 500000 +evm_transaction_timeout = '2m' +evm_minimum_confirmations = 1 +evm_gas_estimation_buffer = 10000 +evm_supports_eip1559 = false +evm_default_gas_limit = 6000000 +evm_finality_depth = 1 + +[CCIP.Env.Network.EVMNetworks.geth_2337] +evm_name = 'geth_2337' +evm_chain_id = 2337 +evm_urls = ['wss://chain-beta-rpc.nodeops.sand.cldev.sh/ws/'] +evm_http_urls = ['https://chain-beta-rpc.nodeops.sand.cldev.sh/'] +evm_keys = ['8f2a55949038a9610f50fb23b5883af3b4ecb3c3bb792cbcefbd1542c692be63'] +evm_simulated = true +client_implementation = 'Ethereum' +evm_chainlink_transaction_limit = 500000 +evm_transaction_timeout = '2m' +evm_minimum_confirmations = 1 +evm_gas_estimation_buffer = 10000 +evm_supports_eip1559 = false +evm_default_gas_limit = 6000000 +evm_finality_depth = 1 + +[CCIP.Env.ExistingCLCluster] +Name = 'crib-mono-repo-test' + +[CCIP.Groups] +[CCIP.Groups.smoke] +LocalCluster = false +ExistingDeployment = true + + +[CCIP.Groups.smoke.MsgDetails] +MsgType = 'DataWithToken' +DestGasLimit = 100000 +DataLength = 1000 +NoOfTokens = 1 +AmountPerToken = 1 + diff --git a/integration-tests/ccip-tests/testconfig/global.go b/integration-tests/ccip-tests/testconfig/global.go new file mode 100644 index 00000000000..d2b3f599b1f --- /dev/null +++ b/integration-tests/ccip-tests/testconfig/global.go @@ -0,0 +1,685 @@ +package testconfig + +import ( + "bytes" + _ "embed" + "encoding/base64" + "fmt" + "os" + "strings" + + "github.com/AlekSi/pointer" + "github.com/pelletier/go-toml/v2" + "github.com/pkg/errors" + "github.com/rs/zerolog/log" + + "github.com/smartcontractkit/chainlink-testing-framework/seth" + + "github.com/smartcontractkit/chainlink-testing-framework/lib/docker/test_env" + "github.com/smartcontractkit/chainlink-testing-framework/lib/logging" + "github.com/smartcontractkit/chainlink-testing-framework/lib/networks" + + "github.com/smartcontractkit/chainlink-testing-framework/lib/blockchain" + "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/osutil" + + "github.com/smartcontractkit/chainlink-common/pkg/config" + ctfconfig "github.com/smartcontractkit/chainlink-testing-framework/lib/config" + + "github.com/smartcontractkit/chainlink/integration-tests/client" +) + +const ( + OVERIDECONFIG = "BASE64_CONFIG_OVERRIDE" + ErrReadConfig = "failed to read TOML config" + ErrUnmarshalConfig = "failed to unmarshal TOML config" + Load string = "load" + Chaos string = "chaos" + Smoke string = "smoke" + ProductCCIP = "CCIP" +) + +var ( + //go:embed tomls/ccip-default.toml + DefaultConfig []byte +) + +func GlobalTestConfig() *Config { + var err error + cfg, err := NewConfig() + if err != nil { + log.Fatal().Err(err).Msg("Failed to load config") + } + return cfg +} + +// GenericConfig is an interface for all product based config types to implement +type GenericConfig interface { + Validate() error + ApplyOverrides(from interface{}) error +} + +// Config is the top level config struct. It contains config for all product based tests. +type Config struct { + CCIP *CCIP `toml:",omitempty"` +} + +func (c *Config) Validate() error { + return c.CCIP.Validate() +} + +func (c *Config) TOMLString() string { + buf := new(bytes.Buffer) + err := toml.NewEncoder(buf).Encode(c) + if err != nil { + log.Fatal().Err(err).Msg("Failed to encode config to TOML") + } + return buf.String() +} + +func DecodeConfig(rawConfig string, c any) error { + d, err := base64.StdEncoding.DecodeString(rawConfig) + if err != nil { + return errors.Wrap(err, ErrReadConfig) + } + err = toml.Unmarshal(d, c) + if err != nil { + return errors.Wrap(err, ErrUnmarshalConfig) + } + return nil +} + +// EncodeConfigAndSetEnv encodes the given struct to base64 +// and sets env var ( if not empty) with the encoded base64 string +func EncodeConfigAndSetEnv(c any, envVar string) (string, error) { + srcBytes, err := toml.Marshal(c) + if err != nil { + return "", err + } + encodedStr := base64.StdEncoding.EncodeToString(srcBytes) + if envVar == "" { + return encodedStr, nil + } + return encodedStr, os.Setenv(envVar, encodedStr) +} + +func NewConfig() (*Config, error) { + cfg := &Config{} + var override *Config + // var secrets *Config + // load config from default file + err := config.DecodeTOML(bytes.NewReader(DefaultConfig), cfg) + if err != nil { + return nil, errors.Wrap(err, ErrReadConfig) + } + + // load config overrides from env var if specified + // there can be multiple overrides separated by comma + rawConfigs, _ := osutil.GetEnv(OVERIDECONFIG) + if rawConfigs != "" { + for _, rawConfig := range strings.Split(rawConfigs, ",") { + err = DecodeConfig(rawConfig, &override) + if err != nil { + return nil, fmt.Errorf("failed to decode override config: %w", err) + } + if override != nil { + // apply overrides for all products + if override.CCIP != nil { + if cfg.CCIP == nil { + cfg.CCIP = override.CCIP + } else { + err = cfg.CCIP.ApplyOverrides(override.CCIP) + if err != nil { + return nil, err + } + } + } + } + } + } + + // read secrets for all products + if cfg.CCIP != nil { + err := ctfconfig.LoadSecretEnvsFromFiles() + if err != nil { + return nil, errors.Wrap(err, "error loading testsecrets files") + } + err = cfg.CCIP.LoadFromEnv() + if err != nil { + return nil, errors.Wrap(err, "error loading env vars into CCIP config") + } + // validate all products + err = cfg.CCIP.Validate() + if err != nil { + return nil, err + } + } + + return cfg, nil +} + +// Common is the generic config struct which can be used with product specific configs. +// It contains generic DON and networks config which can be applied to all product based tests. +type Common struct { + EnvUser string `toml:",omitempty"` + EnvToConnect *string `toml:",omitempty"` + TTL *config.Duration `toml:",omitempty"` + ExistingCLCluster *CLCluster `toml:",omitempty"` // ExistingCLCluster is the existing chainlink cluster to use, if specified it will be used instead of creating a new one + Mockserver *string `toml:",omitempty"` + NewCLCluster *ChainlinkDeployment `toml:",omitempty"` // NewCLCluster is the new chainlink cluster to create, if specified along with ExistingCLCluster this will be ignored + Network *ctfconfig.NetworkConfig `toml:",omitempty"` + PrivateEthereumNetworks map[string]*ctfconfig.EthereumNetworkConfig `toml:",omitempty"` + Logging *ctfconfig.LoggingConfig `toml:",omitempty"` +} + +// ReadFromEnvVar loads selected env vars into the config +func (p *Common) ReadFromEnvVar() error { + logger := logging.GetTestLogger(nil) + + testLogCollect := ctfconfig.MustReadEnvVar_Boolean(ctfconfig.E2E_TEST_LOG_COLLECT_ENV) + if testLogCollect != nil { + if p.Logging == nil { + p.Logging = &ctfconfig.LoggingConfig{} + } + logger.Debug().Msgf("Using %s env var to override Logging.TestLogCollect", ctfconfig.E2E_TEST_LOG_COLLECT_ENV) + p.Logging.TestLogCollect = testLogCollect + } + + loggingRunID := ctfconfig.MustReadEnvVar_String(ctfconfig.E2E_TEST_LOGGING_RUN_ID_ENV) + if loggingRunID != "" { + if p.Logging == nil { + p.Logging = &ctfconfig.LoggingConfig{} + } + logger.Debug().Msgf("Using %s env var to override Logging.RunID", ctfconfig.E2E_TEST_LOGGING_RUN_ID_ENV) + p.Logging.RunId = &loggingRunID + } + + logstreamLogTargets := ctfconfig.MustReadEnvVar_Strings(ctfconfig.E2E_TEST_LOG_STREAM_LOG_TARGETS_ENV, ",") + if len(logstreamLogTargets) > 0 { + if p.Logging == nil { + p.Logging = &ctfconfig.LoggingConfig{} + } + if p.Logging.LogStream == nil { + p.Logging.LogStream = &ctfconfig.LogStreamConfig{} + } + logger.Debug().Msgf("Using %s env var to override Logging.LogStream.LogTargets", ctfconfig.E2E_TEST_LOG_STREAM_LOG_TARGETS_ENV) + p.Logging.LogStream.LogTargets = logstreamLogTargets + } + + lokiTenantID := ctfconfig.MustReadEnvVar_String(ctfconfig.E2E_TEST_LOKI_TENANT_ID_ENV) + if lokiTenantID != "" { + if p.Logging == nil { + p.Logging = &ctfconfig.LoggingConfig{} + } + if p.Logging.Loki == nil { + p.Logging.Loki = &ctfconfig.LokiConfig{} + } + logger.Debug().Msgf("Using %s env var to override Logging.Loki.TenantId", ctfconfig.E2E_TEST_LOKI_TENANT_ID_ENV) + p.Logging.Loki.TenantId = &lokiTenantID + } + + lokiEndpoint := ctfconfig.MustReadEnvVar_String(ctfconfig.E2E_TEST_LOKI_ENDPOINT_ENV) + if lokiEndpoint != "" { + if p.Logging == nil { + p.Logging = &ctfconfig.LoggingConfig{} + } + if p.Logging.Loki == nil { + p.Logging.Loki = &ctfconfig.LokiConfig{} + } + logger.Debug().Msgf("Using %s env var to override Logging.Loki.Endpoint", ctfconfig.E2E_TEST_LOKI_ENDPOINT_ENV) + p.Logging.Loki.Endpoint = &lokiEndpoint + } + + lokiBasicAuth := ctfconfig.MustReadEnvVar_String(ctfconfig.E2E_TEST_LOKI_BASIC_AUTH_ENV) + if lokiBasicAuth != "" { + if p.Logging == nil { + p.Logging = &ctfconfig.LoggingConfig{} + } + if p.Logging.Loki == nil { + p.Logging.Loki = &ctfconfig.LokiConfig{} + } + logger.Debug().Msgf("Using %s env var to override Logging.Loki.BasicAuth", ctfconfig.E2E_TEST_LOKI_BASIC_AUTH_ENV) + p.Logging.Loki.BasicAuth = &lokiBasicAuth + } + + lokiBearerToken := ctfconfig.MustReadEnvVar_String(ctfconfig.E2E_TEST_LOKI_BEARER_TOKEN_ENV) + if lokiBearerToken != "" { + if p.Logging == nil { + p.Logging = &ctfconfig.LoggingConfig{} + } + if p.Logging.Loki == nil { + p.Logging.Loki = &ctfconfig.LokiConfig{} + } + logger.Debug().Msgf("Using %s env var to override Logging.Loki.BearerToken", ctfconfig.E2E_TEST_LOKI_BEARER_TOKEN_ENV) + p.Logging.Loki.BearerToken = &lokiBearerToken + } + + grafanaBaseUrl := ctfconfig.MustReadEnvVar_String(ctfconfig.E2E_TEST_GRAFANA_BASE_URL_ENV) + if grafanaBaseUrl != "" { + if p.Logging == nil { + p.Logging = &ctfconfig.LoggingConfig{} + } + if p.Logging.Grafana == nil { + p.Logging.Grafana = &ctfconfig.GrafanaConfig{} + } + logger.Debug().Msgf("Using %s env var to override Logging.Grafana.BaseUrl", ctfconfig.E2E_TEST_GRAFANA_BASE_URL_ENV) + p.Logging.Grafana.BaseUrl = &grafanaBaseUrl + } + + grafanaDashboardUrl := ctfconfig.MustReadEnvVar_String(ctfconfig.E2E_TEST_GRAFANA_DASHBOARD_URL_ENV) + if grafanaDashboardUrl != "" { + if p.Logging == nil { + p.Logging = &ctfconfig.LoggingConfig{} + } + if p.Logging.Grafana == nil { + p.Logging.Grafana = &ctfconfig.GrafanaConfig{} + } + logger.Debug().Msgf("Using %s env var to override Logging.Grafana.DashboardUrl", ctfconfig.E2E_TEST_GRAFANA_DASHBOARD_URL_ENV) + p.Logging.Grafana.DashboardUrl = &grafanaDashboardUrl + } + + grafanaBearerToken := ctfconfig.MustReadEnvVar_String(ctfconfig.E2E_TEST_GRAFANA_BEARER_TOKEN_ENV) + if grafanaBearerToken != "" { + if p.Logging == nil { + p.Logging = &ctfconfig.LoggingConfig{} + } + if p.Logging.Grafana == nil { + p.Logging.Grafana = &ctfconfig.GrafanaConfig{} + } + logger.Debug().Msgf("Using %s env var to override Logging.Grafana.BearerToken", ctfconfig.E2E_TEST_GRAFANA_BEARER_TOKEN_ENV) + p.Logging.Grafana.BearerToken = &grafanaBearerToken + } + + selectedNetworks := ctfconfig.MustReadEnvVar_Strings(ctfconfig.E2E_TEST_SELECTED_NETWORK_ENV, ",") + if len(selectedNetworks) > 0 { + if p.Network == nil { + p.Network = &ctfconfig.NetworkConfig{} + } + logger.Debug().Msgf("Using %s env var to override Network.SelectedNetworks", ctfconfig.E2E_TEST_SELECTED_NETWORK_ENV) + p.Network.SelectedNetworks = selectedNetworks + } + + walletKeys := ctfconfig.ReadEnvVarGroupedMap(ctfconfig.E2E_TEST_WALLET_KEY_ENV, ctfconfig.E2E_TEST_WALLET_KEYS_ENV) + if len(walletKeys) > 0 { + if p.Network == nil { + p.Network = &ctfconfig.NetworkConfig{} + } + logger.Debug().Msgf("Using %s and/or %s env vars to override Network.WalletKeys", ctfconfig.E2E_TEST_WALLET_KEY_ENV, ctfconfig.E2E_TEST_WALLET_KEYS_ENV) + p.Network.WalletKeys = walletKeys + } + + rpcHttpUrls := ctfconfig.ReadEnvVarGroupedMap(ctfconfig.E2E_TEST_RPC_HTTP_URL_ENV, ctfconfig.E2E_TEST_RPC_HTTP_URLS_ENV) + if len(rpcHttpUrls) > 0 { + if p.Network == nil { + p.Network = &ctfconfig.NetworkConfig{} + } + logger.Debug().Msgf("Using %s and/or %s env vars to override Network.RpcHttpUrls", ctfconfig.E2E_TEST_RPC_HTTP_URL_ENV, ctfconfig.E2E_TEST_RPC_HTTP_URLS_ENV) + p.Network.RpcHttpUrls = rpcHttpUrls + } + + rpcWsUrls := ctfconfig.ReadEnvVarGroupedMap(ctfconfig.E2E_TEST_RPC_WS_URL_ENV, ctfconfig.E2E_TEST_RPC_WS_URLS_ENV) + if len(rpcWsUrls) > 0 { + if p.Network == nil { + p.Network = &ctfconfig.NetworkConfig{} + } + logger.Debug().Msgf("Using %s and/or %s env vars to override Network.RpcWsUrls", ctfconfig.E2E_TEST_RPC_WS_URL_ENV, ctfconfig.E2E_TEST_RPC_WS_URLS_ENV) + p.Network.RpcWsUrls = rpcWsUrls + } + + chainlinkImage := ctfconfig.MustReadEnvVar_String(ctfconfig.E2E_TEST_CHAINLINK_IMAGE_ENV) + if chainlinkImage != "" { + if p.NewCLCluster == nil { + p.NewCLCluster = &ChainlinkDeployment{} + } + if p.NewCLCluster.Common == nil { + p.NewCLCluster.Common = &Node{} + } + if p.NewCLCluster.Common.ChainlinkImage == nil { + p.NewCLCluster.Common.ChainlinkImage = &ctfconfig.ChainlinkImageConfig{} + } + + logger.Debug().Msgf("Using %s env var to override NewCLCluster.Common.ChainlinkImage.Image", ctfconfig.E2E_TEST_CHAINLINK_IMAGE_ENV) + p.NewCLCluster.Common.ChainlinkImage.Image = &chainlinkImage + } + + chainlinkVersion := ctfconfig.MustReadEnvVar_String(ctfconfig.E2E_TEST_CHAINLINK_VERSION_ENV) + if chainlinkVersion != "" { + if p.NewCLCluster == nil { + p.NewCLCluster = &ChainlinkDeployment{} + } + if p.NewCLCluster.Common == nil { + p.NewCLCluster.Common = &Node{} + } + if p.NewCLCluster.Common.ChainlinkImage == nil { + p.NewCLCluster.Common.ChainlinkImage = &ctfconfig.ChainlinkImageConfig{} + } + + logger.Debug().Msgf("Using %s env var to override NewCLCluster.Common.ChainlinkImage.Version", ctfconfig.E2E_TEST_CHAINLINK_VERSION_ENV) + p.NewCLCluster.Common.ChainlinkImage.Version = &chainlinkVersion + } + + chainlinkPostgresVersion := ctfconfig.MustReadEnvVar_String(ctfconfig.E2E_TEST_CHAINLINK_POSTGRES_VERSION_ENV) + if chainlinkPostgresVersion != "" { + if p.NewCLCluster == nil { + p.NewCLCluster = &ChainlinkDeployment{} + } + if p.NewCLCluster.Common == nil { + p.NewCLCluster.Common = &Node{} + } + if p.NewCLCluster.Common.ChainlinkImage == nil { + p.NewCLCluster.Common.ChainlinkImage = &ctfconfig.ChainlinkImageConfig{} + } + + logger.Debug().Msgf("Using %s env var to override NewCLCluster.Common.ChainlinkImage.PostgresVersion", ctfconfig.E2E_TEST_CHAINLINK_POSTGRES_VERSION_ENV) + p.NewCLCluster.Common.ChainlinkImage.PostgresVersion = &chainlinkPostgresVersion + } + + chainlinkUpgradeImage := ctfconfig.MustReadEnvVar_String(ctfconfig.E2E_TEST_CHAINLINK_UPGRADE_IMAGE_ENV) + if chainlinkUpgradeImage != "" { + if p.NewCLCluster == nil { + p.NewCLCluster = &ChainlinkDeployment{} + } + if p.NewCLCluster.Common == nil { + p.NewCLCluster.Common = &Node{} + } + if p.NewCLCluster.Common.ChainlinkUpgradeImage == nil { + p.NewCLCluster.Common.ChainlinkUpgradeImage = &ctfconfig.ChainlinkImageConfig{} + } + + logger.Debug().Msgf("Using %s env var to override NewCLCluster.Common.ChainlinkUpgradeImage.Image", ctfconfig.E2E_TEST_CHAINLINK_UPGRADE_IMAGE_ENV) + p.NewCLCluster.Common.ChainlinkUpgradeImage.Image = &chainlinkUpgradeImage + } + + chainlinkUpgradeVersion := ctfconfig.MustReadEnvVar_String(ctfconfig.E2E_TEST_CHAINLINK_UPGRADE_VERSION_ENV) + if chainlinkUpgradeVersion != "" { + if p.NewCLCluster == nil { + p.NewCLCluster = &ChainlinkDeployment{} + } + if p.NewCLCluster.Common == nil { + p.NewCLCluster.Common = &Node{} + } + if p.NewCLCluster.Common.ChainlinkImage == nil { + p.NewCLCluster.Common.ChainlinkImage = &ctfconfig.ChainlinkImageConfig{} + } + + logger.Debug().Msgf("Using %s env var to override NewCLCluster.Common.ChainlinkUpgradeImage.Version", ctfconfig.E2E_TEST_CHAINLINK_UPGRADE_VERSION_ENV) + p.NewCLCluster.Common.ChainlinkUpgradeImage.Version = &chainlinkUpgradeVersion + } + + return nil +} + +func (p *Common) GetNodeConfig() *ctfconfig.NodeConfig { + return &ctfconfig.NodeConfig{ + BaseConfigTOML: p.NewCLCluster.Common.BaseConfigTOML, + CommonChainConfigTOML: p.NewCLCluster.Common.CommonChainConfigTOML, + ChainConfigTOMLByChainID: p.NewCLCluster.Common.ChainConfigTOMLByChain, + } +} + +func (p *Common) GetSethConfig() *seth.Config { + return nil +} + +func (p *Common) Validate() error { + if err := p.Logging.Validate(); err != nil { + return fmt.Errorf("error validating logging config %w", err) + } + if p.Network == nil { + return errors.New("no networks specified") + } + // read the default network config, if specified + p.Network.UpperCaseNetworkNames() + p.Network.OverrideURLsAndKeysFromEVMNetwork() + if err := p.Network.Validate(); err != nil { + return fmt.Errorf("error validating networks config %w", err) + } + if p.NewCLCluster == nil && p.ExistingCLCluster == nil { + return errors.New("no chainlink or existing cluster specified") + } + + for k, v := range p.PrivateEthereumNetworks { + // this is the only value we need to generate dynamically before starting a new simulated chain + if v.EthereumChainConfig != nil { + p.PrivateEthereumNetworks[k].EthereumChainConfig.GenerateGenesisTimestamp() + } + + builder := test_env.NewEthereumNetworkBuilder() + ethNetwork, err := builder.WithExistingConfig(*v).Build() + if err != nil { + return fmt.Errorf("error building private ethereum network ethNetworks %w", err) + } + + p.PrivateEthereumNetworks[k] = ðNetwork.EthereumNetworkConfig + } + + if p.ExistingCLCluster != nil { + if err := p.ExistingCLCluster.Validate(); err != nil { + return fmt.Errorf("error validating existing chainlink cluster config %w", err) + } + if p.Mockserver == nil { + return errors.New("no mockserver specified for existing chainlink cluster") + } + log.Warn().Msg("Using existing chainlink cluster, overriding new chainlink cluster config if specified") + p.NewCLCluster = nil + } else { + if p.NewCLCluster != nil { + if err := p.NewCLCluster.Validate(); err != nil { + return fmt.Errorf("error validating chainlink config %w", err) + } + } + } + return nil +} + +func (p *Common) EVMNetworks() ([]blockchain.EVMNetwork, []string, error) { + evmNetworks := networks.MustGetSelectedNetworkConfig(p.Network) + if len(p.Network.SelectedNetworks) != len(evmNetworks) { + return nil, p.Network.SelectedNetworks, fmt.Errorf("selected networks %v do not match evm networks %v", p.Network.SelectedNetworks, evmNetworks) + } + return evmNetworks, p.Network.SelectedNetworks, nil +} + +func (p *Common) GetLoggingConfig() *ctfconfig.LoggingConfig { + return p.Logging +} + +func (p *Common) GetChainlinkImageConfig() *ctfconfig.ChainlinkImageConfig { + return p.NewCLCluster.Common.ChainlinkImage +} + +func (p *Common) GetPyroscopeConfig() *ctfconfig.PyroscopeConfig { + return nil +} + +func (p *Common) GetPrivateEthereumNetworkConfig() *ctfconfig.EthereumNetworkConfig { + return nil +} + +func (p *Common) GetNetworkConfig() *ctfconfig.NetworkConfig { + return p.Network +} + +// Returns Grafana URL from Logging config +func (p *Common) GetGrafanaBaseURL() (string, error) { + if p.Logging.Grafana == nil || p.Logging.Grafana.BaseUrl == nil { + return "", errors.New("grafana base url not set") + } + + return strings.TrimSuffix(*p.Logging.Grafana.BaseUrl, "/"), nil +} + +// Returns Grafana Dashboard URL from Logging config +func (p *Common) GetGrafanaDashboardURL() (string, error) { + if p.Logging.Grafana == nil || p.Logging.Grafana.DashboardUrl == nil { + return "", errors.New("grafana dashboard url not set") + } + + url := *p.Logging.Grafana.DashboardUrl + if !strings.HasPrefix(url, "/") { + url = "/" + url + } + + return url, nil +} + +type CLCluster struct { + Name *string `toml:",omitempty"` + NoOfNodes *int `toml:",omitempty"` + NodeConfigs []*client.ChainlinkConfig `toml:",omitempty"` +} + +func (c *CLCluster) Validate() error { + if c.NoOfNodes == nil || len(c.NodeConfigs) == 0 { + return fmt.Errorf("no chainlink nodes specified") + } + if *c.NoOfNodes != len(c.NodeConfigs) { + return fmt.Errorf("number of nodes %d does not match number of node configs %d", *c.NoOfNodes, len(c.NodeConfigs)) + } + for i, nodeConfig := range c.NodeConfigs { + if nodeConfig.URL == "" { + return fmt.Errorf("node %d url not specified", i+1) + } + if nodeConfig.Password == "" { + return fmt.Errorf("node %d password not specified", i+1) + } + if nodeConfig.Email == "" { + return fmt.Errorf("node %d email not specified", i+1) + } + if nodeConfig.InternalIP == "" { + return fmt.Errorf("node %d internal ip not specified", i+1) + } + } + + return nil +} + +type ChainlinkDeployment struct { + Common *Node `toml:",omitempty"` + NodeMemory string `toml:",omitempty"` + NodeCPU string `toml:",omitempty"` + DBMemory string `toml:",omitempty"` + DBCPU string `toml:",omitempty"` + DBCapacity string `toml:",omitempty"` + DBStorageClass *string `toml:",omitempty"` + PromPgExporter *bool `toml:",omitempty"` + IsStateful *bool `toml:",omitempty"` + DBArgs []string `toml:",omitempty"` + NoOfNodes *int `toml:",omitempty"` + Nodes []*Node `toml:",omitempty"` // to be mentioned only if diff nodes follow diff configs; not required if all nodes follow CommonConfig +} + +func (c *ChainlinkDeployment) Validate() error { + if c.Common == nil { + return errors.New("common config can't be empty") + } + if c.Common.ChainlinkImage == nil { + return errors.New("chainlink image can't be empty") + } + if err := c.Common.ChainlinkImage.Validate(); err != nil { + return err + } + if c.Common.DBImage == "" || c.Common.DBTag == "" { + return errors.New("must provide db image and tag") + } + if c.NoOfNodes == nil { + return errors.New("chainlink config is invalid, NoOfNodes should be specified") + } + if c.Nodes != nil && len(c.Nodes) > 0 { + noOfNodes := pointer.GetInt(c.NoOfNodes) + if noOfNodes != len(c.Nodes) { + return errors.New("chainlink config is invalid, NoOfNodes and Nodes length mismatch") + } + for i := range c.Nodes { + // merge common config with node specific config + c.Nodes[i].Merge(c.Common) + node := c.Nodes[i] + if node.ChainlinkImage == nil { + return fmt.Errorf("node %s: chainlink image can't be empty", node.Name) + } + if err := node.ChainlinkImage.Validate(); err != nil { + return fmt.Errorf("node %s: %w", node.Name, err) + } + if node.DBImage == "" || node.DBTag == "" { + return fmt.Errorf("node %s: must provide db image and tag", node.Name) + } + } + } + return nil +} + +type Node struct { + Name string `toml:",omitempty"` + NeedsUpgrade *bool `toml:",omitempty"` + ChainlinkImage *ctfconfig.ChainlinkImageConfig `toml:"ChainlinkImage"` + ChainlinkUpgradeImage *ctfconfig.ChainlinkImageConfig `toml:"ChainlinkUpgradeImage"` + BaseConfigTOML string `toml:",omitempty"` + CommonChainConfigTOML string `toml:",omitempty"` + ChainConfigTOMLByChain map[string]string `toml:",omitempty"` // key is chainID + DBImage string `toml:",omitempty"` + DBTag string `toml:",omitempty"` +} + +// Merge merges non-empty values +func (n *Node) Merge(from *Node) { + if from == nil || n == nil { + return + } + if n.Name == "" { + n.Name = from.Name + } + if n.ChainlinkImage == nil { + if from.ChainlinkImage != nil { + n.ChainlinkImage = &ctfconfig.ChainlinkImageConfig{ + Image: from.ChainlinkImage.Image, + Version: from.ChainlinkImage.Version, + } + } + } else { + if n.ChainlinkImage.Image == nil && from.ChainlinkImage != nil { + n.ChainlinkImage.Image = from.ChainlinkImage.Image + } + if n.ChainlinkImage.Version == nil && from.ChainlinkImage != nil { + n.ChainlinkImage.Version = from.ChainlinkImage.Version + } + } + // merge upgrade image only if the nodes is marked as NeedsUpgrade to true + if pointer.GetBool(n.NeedsUpgrade) { + if n.ChainlinkUpgradeImage == nil { + if from.ChainlinkUpgradeImage != nil { + n.ChainlinkUpgradeImage = &ctfconfig.ChainlinkImageConfig{ + Image: from.ChainlinkUpgradeImage.Image, + Version: from.ChainlinkUpgradeImage.Version, + } + } + } else { + if n.ChainlinkUpgradeImage.Image == nil && from.ChainlinkUpgradeImage != nil { + n.ChainlinkUpgradeImage.Image = from.ChainlinkUpgradeImage.Image + } + if n.ChainlinkUpgradeImage.Version == nil && from.ChainlinkUpgradeImage != nil { + n.ChainlinkUpgradeImage.Version = from.ChainlinkUpgradeImage.Version + } + } + } + + if n.DBImage == "" { + n.DBImage = from.DBImage + } + if n.DBTag == "" { + n.DBTag = from.DBTag + } + if n.BaseConfigTOML == "" { + n.BaseConfigTOML = from.BaseConfigTOML + } + if n.CommonChainConfigTOML == "" { + n.CommonChainConfigTOML = from.CommonChainConfigTOML + } + if n.ChainConfigTOMLByChain == nil { + n.ChainConfigTOMLByChain = from.ChainConfigTOMLByChain + } else { + for k, v := range from.ChainConfigTOMLByChain { + if _, ok := n.ChainConfigTOMLByChain[k]; !ok { + n.ChainConfigTOMLByChain[k] = v + } + } + } +} diff --git a/integration-tests/ccip-tests/testconfig/override/mainnet.toml b/integration-tests/ccip-tests/testconfig/override/mainnet.toml new file mode 100644 index 00000000000..f723411eafc --- /dev/null +++ b/integration-tests/ccip-tests/testconfig/override/mainnet.toml @@ -0,0 +1,1198 @@ +[CCIP] +[CCIP.ContractVersions] +PriceRegistry = '1.2.0' +OffRamp = '1.2.0' +OnRamp = '1.2.0' +TokenPool = '1.4.0' +CommitStore = '1.2.0' + +[CCIP.Deployments] +Data = """ +{ + "lane_configs": { + "Arbitrum Mainnet": { + "is_native_fee_token": true, + "fee_token": "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1", + "arm": "0xC2C5E22a2d9715ed5C5BCC4D8eFf5966cf260744", + "router": "0x141fa059441E0ca23ce184B6A78bafD2A517DdE8", + "price_registry": "0x13015e4E6f839E1Aa1016DF521ea458ecA20438c", + "wrapped_native": "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1", + "src_contracts": { + "Avalanche Mainnet": { + "on_ramp": "0x05B723f3db92430FbE4395fD03E40Cc7e9D17988", + "deployed_at": 0 + }, + "BSC Mainnet": { + "on_ramp": "0x79f3ABeCe5A3AFFf32D47F4CFe45e7b65c9a2D91", + "deployed_at": 0 + }, + "Base Mainnet": { + "on_ramp": "0x77b60F85b25fD501E3ddED6C1fe7bF565C08A22A", + "deployed_at": 0 + }, + "Blast Mainnet": { + "on_ramp": "0x54480425E9e24138fdF1644a1F70007F25abfB46", + "deployed_at": 0 + }, + "Ethereum Mainnet": { + "on_ramp": "0xCe11020D56e5FDbfE46D9FC3021641FfbBB5AdEE", + "deployed_at": 0 + }, + "Gnosis Mainnet": { + "on_ramp": "0x1216DC856Af47a833254a280A038185F51C1B5c4", + "deployed_at": 0 + }, + "Metis Andromeda": { + "on_ramp": "0x5b23A0a103fC9028363B3BC3577e8Bd45B8E819F", + "deployed_at": 0 + }, + "Mode Mainnet": { + "on_ramp": "0x3920BF474BB50fffb4B77c1e6e66F65210D1D722", + "deployed_at": 0 + }, + "Optimism Mainnet": { + "on_ramp": "0xC09b72E8128620C40D89649019d995Cc79f030C3", + "deployed_at": 0 + }, + "Polygon Mainnet": { + "on_ramp": "0x122F05F49e90508F089eE8D0d868d1a4f3E5a809", + "deployed_at": 0 + }, + "WeMix Mainnet": { + "on_ramp": "0x66a0046ac9FA104eB38B04cfF391CcD0122E6FbC", + "deployed_at": 0 + }, + "ZKSync Mainnet": { + "on_ramp": "0x2C1016053d9873270d71613cA321aE97Fc89201d", + "deployed_at": 0 + } + }, + "dest_contracts": { + "Avalanche Mainnet": { + "off_ramp": "0xe0109912157d5B75ea8b3181123Cf32c73bc9920", + "commit_store": "0xDaa61b8Cd85977820f92d1e749E1D9F55Da6CCEA", + "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + }, + "BSC Mainnet": { + "off_ramp": "0xB1b705c2315fced1B38baE463BE7DDef531e47fA", + "commit_store": "0x310cECbFf14Ad0307EfF762F461a487C1abb90bf", + "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + }, + "Base Mainnet": { + "off_ramp": "0xdB19F77F87661f9be0F557cf9a1ebeCf7D8F206c", + "commit_store": "0x6e37f4c82d9A31cc42B445874dd3c3De97AB553f", + "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + }, + "Blast Mainnet": { + "off_ramp": "0x449C59F4Ef3b1802DD054dd7837Eb2Ca91aFAB84", + "commit_store": "0x1E0e8B01693A248b3Aa1e5aca36336F9022Ceac0", + "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + }, + "Ethereum Mainnet": { + "off_ramp": "0x542ba1902044069330e8c5b36A84EC503863722f", + "commit_store": "0x060331fEdA35691e54876D957B4F9e3b8Cb47d20", + "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + }, + "Gnosis Mainnet": { + "off_ramp": "0x0C00414D9dcDB2DA7BF8AF26aE2deb617f09e756", + "commit_store": "0x1d464cd86c5C8358d56281aB31d2213534CCEA13", + "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + }, + "Metis Andromeda": { + "off_ramp": "0xeF8dEb0c01f7389AD4ae05DAB30120dba915D53c", + "commit_store": "0xE594a09Aa8bCb55188758826A160615B95A6F3fE", + "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + }, + "Mode Mainnet": { + "off_ramp": "0xEDE7ADACFbD27DBEBbE2d6C3BaDf12a634a72Faa", + "commit_store": "0x032B209a6B7a00336047505b55a4cBFBd29eE2c1", + "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + }, + "Optimism Mainnet": { + "off_ramp": "0xeeed4D86F3E0e6d32A6Ad29d8De6A0Dc91963A5f", + "commit_store": "0xbbB563c4d98020b9c0f3Cc34c2C0Ef9676806E35", + "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + }, + "Polygon Mainnet": { + "off_ramp": "0x9bDA7c8DCda4E39aFeB483cc0B7E3C1f6E0D5AB1", + "commit_store": "0x63a0AeaadAe851b990bBD9dc41f5C1B08b32026d", + "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + }, + "WeMix Mainnet": { + "off_ramp": "0xEEf5Fb4c4953F9cA9ab1f25cE590776AfFc2c455", + "commit_store": "0xD268286A277095a9C3C90205110831a84505881c", + "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + }, + "ZKSync Mainnet": { + "off_ramp": "0x50Fc0de671c775301e1Bdf19C17E778D0f978f6F", + "commit_store": "0x87732C2647168818ED49268EdA8A98C2e62ed744", + "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + } + } + }, + "Avalanche Mainnet": { + "is_native_fee_token": true, + "fee_token": "0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7", + "arm": "0x4f6Ec25f06A114ADD3154DC17fb637F750AdaA31", + "router": "0xF4c7E640EdA248ef95972845a62bdC74237805dB", + "price_registry": "0x2d3b38E0a4DFFDad2A613f7760bE1683F272eA18", + "wrapped_native": "0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7", + "src_contracts": { + "Arbitrum Mainnet": { + "on_ramp": "0x98f51B041e493fc4d72B8BD33218480bA0c66DDF", + "deployed_at": 0 + }, + "BSC Mainnet": { + "on_ramp": "0x8eaae6462816CB4957184c48B86afA7642D8Bf2B", + "deployed_at": 0 + }, + "Base Mainnet": { + "on_ramp": "0x268fb4311D2c6CB2bbA01CCA9AC073Fb3bfd1C7c", + "deployed_at": 0 + }, + "Ethereum Mainnet": { + "on_ramp": "0xD0701FcC7818c31935331B02Eb21e91eC71a1704", + "deployed_at": 0 + }, + "Gnosis Mainnet": { + "on_ramp": "0xBd0B9317F6AaA1085993F7b4CD468dE7A6428722", + "deployed_at": 0 + }, + "Optimism Mainnet": { + "on_ramp": "0x8629008887E073260c5434D6CaCFc83C3001d211", + "deployed_at": 0 + }, + "Polygon Mainnet": { + "on_ramp": "0x97500490d9126f34cf9aA0126d64623E170319Ef", + "deployed_at": 0 + }, + "WeMix Mainnet": { + "on_ramp": "0x9b1ed9De069Be4d50957464b359f98eD0Bf34dd5", + "deployed_at": 0 + } + }, + "dest_contracts": { + "Arbitrum Mainnet": { + "off_ramp": "0x770b1375F86E7a9bf30DBe3F97bea67193dC9135", + "commit_store": "0x23E2b34Ce8e12c53f8a39AD4b3FFCa845f8E617C", + "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + }, + "BSC Mainnet": { + "off_ramp": "0x83F53Fc798FEbfFbdF84830AD403b9989187a06C", + "commit_store": "0xD8ceCE2D7794385E00Ce3EF94550E732b0A0B959", + "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + }, + "Base Mainnet": { + "off_ramp": "0x4d6A796Bc85dcDF41ce9AaEB50B094C6b589748f", + "commit_store": "0xc4C4358FA01a04D6c6FE3b96a351946d4c2715C2", + "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + }, + "Ethereum Mainnet": { + "off_ramp": "0x5B833BD6456c604Eb396C0fBa477aD49e82B1A2a", + "commit_store": "0x23E23958D220B774680f91c2c91a6f2B2f610d7e", + "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + }, + "Gnosis Mainnet": { + "off_ramp": "0xDE7ebf1Dc753D916A9fbEC4ae521Ee74EC2d0B5f", + "commit_store": "0x2dbc917b4DD455532015949c3103B64fcDB891b2", + "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + }, + "Optimism Mainnet": { + "off_ramp": "0xb68A3EE8bD0A09eE221cf1859Dd5a4d5765188Fe", + "commit_store": "0x83DCeeCf822981F9F8552925eEfd88CAc1905dEA", + "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + }, + "Polygon Mainnet": { + "off_ramp": "0x19250aBE66B88F214d02B6f3BF80F4118290C619", + "commit_store": "0x87A0935cE6254dB1252bBac90d1D07D04846aDCA", + "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + }, + "WeMix Mainnet": { + "off_ramp": "0x317dE8bc5c3292E494b6496586696d4966A922B0", + "commit_store": "0x97Fbf3d6DEac16adC721aE9187CeEa1e610aC7Af", + "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + } + } + }, + "BSC Mainnet": { + "is_native_fee_token": true, + "fee_token": "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c", + "arm": "0x56491A98199aD2e687Ea9D0cFB7b4AC57B4980Fc", + "router": "0x34B03Cb9086d7D758AC55af71584F81A598759FE", + "price_registry": "0x18C3D917D55Bc1784a3d4729AA3e2C1ecd662fFd", + "wrapped_native": "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c", + "src_contracts": { + "Arbitrum Mainnet": { + "on_ramp": "0x2788b46BAcFF49BD89562e6bA5c5FBbbE5Fa92F7", + "deployed_at": 0 + }, + "Avalanche Mainnet": { + "on_ramp": "0x6aa72a998859eF93356c6521B72155D355D0Cfd2", + "deployed_at": 0 + }, + "Base Mainnet": { + "on_ramp": "0x70bC7f7a6D936b289bBF5c0E19ECE35B437E2e36", + "deployed_at": 0 + }, + "Blast Mainnet": { + "on_ramp": "0x02082b23D35d2670B8a636A431F3C30AF9d21e07", + "deployed_at": 0 + }, + "Ethereum Mainnet": { + "on_ramp": "0x0Bf40b034872D0b364f3DCec04C7434a4Da1C8d9", + "deployed_at": 0 + }, + "Gnosis Mainnet": { + "on_ramp": "0xAc9fE4179816077674d769698306CE6A7C6A1096", + "deployed_at": 0 + }, + "Mode Mainnet": { + "on_ramp": "0x4A83dA46c148AB5941a379b4cA49f42d14281C78", + "deployed_at": 0 + }, + "Optimism Mainnet": { + "on_ramp": "0x4FEB11A454C9E8038A8d0aDF599Fe7612ce114bA", + "deployed_at": 0 + }, + "Polygon Mainnet": { + "on_ramp": "0x6bD4754D86fc87FE5b463D368f26a3587a08347c", + "deployed_at": 0 + }, + "WeMix Mainnet": { + "on_ramp": "0x1467fF8f249f5bc604119Af26a47035886f856BE", + "deployed_at": 0 + } + }, + "dest_contracts": { + "Arbitrum Mainnet": { + "off_ramp": "0x3DA330fd8Ef10d93cFB7D4f8ecE7BC1F10811feC", + "commit_store": "0x86D55Ff492cfBBAf0c0D42D4EE615144E78b3D02", + "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + }, + "Avalanche Mainnet": { + "off_ramp": "0x37a6fa55fe61061Ae97bF7314Ae270eCF71c5ED3", + "commit_store": "0x1f558F6dcf0224Ef1F78A24814FED548B9602c80", + "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + }, + "Base Mainnet": { + "off_ramp": "0x574c697deab06B805D8780898B3F136a1F4892Dc", + "commit_store": "0x002B164b1dcf4E92F352DC625A01Be0E890EdEea", + "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + }, + "Blast Mainnet": { + "off_ramp": "0x6500EDFBD27d34b7B69D0D45865ddaC4A1ceafE1", + "commit_store": "0x3A328B3fA852409415c15271442EFE4c77C04992", + "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + }, + "Ethereum Mainnet": { + "off_ramp": "0x181Bb1E97b0bDD1D85E741ad0943552D3682cc35", + "commit_store": "0x3fF27A34fF0FA77921C3438e67f58da1a83e9Ce1", + "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + }, + "Gnosis Mainnet": { + "off_ramp": "0xBE9b0cc569E970dAb953d336c670fc6b7c856c19", + "commit_store": "0xEe89CC6C2236d3b99C2D9c0b3b911690F757FadF", + "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + }, + "Mode Mainnet": { + "off_ramp": "0x6C702159daA4DEbae32E294c584B1EaF2356cB1A", + "commit_store": "0x73C8d1E9e240331E3345c6fBe6CDFC71B742B69C", + "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + }, + "Optimism Mainnet": { + "off_ramp": "0xE7E080C8d62d595a223C577C7C8d1f75d9A5E664", + "commit_store": "0xF4d53346bDb6d393C74B0B72Aa7D6689a3eAad79", + "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + }, + "Polygon Mainnet": { + "off_ramp": "0x26af2046Da85d7f6712D5edCa81B9E3b2e7A60Ab", + "commit_store": "0x4C1dA405a789AC2853A69D8290B8B9b47a0374F8", + "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + }, + "WeMix Mainnet": { + "off_ramp": "0xC027C5AEb230008c243Be463A73571e581F94c13", + "commit_store": "0x2EB426C8C54D740d1FC856eB3Ff96feA03957978", + "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + } + } + }, + "Base Mainnet": { + "is_native_fee_token": true, + "fee_token": "0x4200000000000000000000000000000000000006", + "arm": "0x91cB19E7c4Ba9B08CF544cDc9143042150B007C3", + "router": "0x881e3A65B4d4a04dD529061dd0071cf975F58bCD", + "price_registry": "0x1bA15c57c8b74cD32443D7583E7f6d7c638aCf46", + "wrapped_native": "0x4200000000000000000000000000000000000006", + "src_contracts": { + "Arbitrum Mainnet": { + "on_ramp": "0x1E5Ca70d1e7A1B26061125738a880BBeA42FeB21", + "deployed_at": 0 + }, + "Avalanche Mainnet": { + "on_ramp": "0xBE5a9E336D9614024B4Fa10D8112671fc9A42d96", + "deployed_at": 0 + }, + "BSC Mainnet": { + "on_ramp": "0xdd4Fb402d41Beb0eEeF6CfB1bf445f50bDC8c981", + "deployed_at": 0 + }, + "Blast Mainnet": { + "on_ramp": "0xCCC32e2794EaD73f0a0a514Ac1c78D048968ab81", + "deployed_at": 0 + }, + "Ethereum Mainnet": { + "on_ramp": "0xDEA286dc0E01Cb4755650A6CF8d1076b454eA1cb", + "deployed_at": 0 + }, + "Gnosis Mainnet": { + "on_ramp": "0xcDD0e963E0708a4E936202396983E458cFA4A363", + "deployed_at": 0 + }, + "Mode Mainnet": { + "on_ramp": "0x626aCCbDDD73532df1caEDb5628Fdc40C5f429Ba", + "deployed_at": 0 + }, + "Optimism Mainnet": { + "on_ramp": "0xd952FEAcDd5919Cc5E9454b53bF45d4E73dD6457", + "deployed_at": 0 + }, + "Polygon Mainnet": { + "on_ramp": "0x3DB8Bea142e41cA3633890d0e5640F99a895D6A5", + "deployed_at": 0 + } + }, + "dest_contracts": { + "Arbitrum Mainnet": { + "off_ramp": "0x8531E63aE9279a1f0D09eba566CD1b092b95f3D5", + "commit_store": "0x327E13f54c7871a2416006B33B4822eAAD357916", + "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + }, + "Avalanche Mainnet": { + "off_ramp": "0x8345F2fF67e5A65e85dc955DE1414832608E00aD", + "commit_store": "0xd0b13be4c53A6262b47C5DDd36F0257aa714F562", + "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + }, + "BSC Mainnet": { + "off_ramp": "0x48a51f5D38BE630Ddd6417Ea2D9052B8efc91a18", + "commit_store": "0xF97127e77252284EC9D4bc13C247c9D1A99F72B0", + "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + }, + "Blast Mainnet": { + "off_ramp": "0x15F54FDd37ccC8E5a0b64633C95Ef8209Fd86401", + "commit_store": "0x52b5b4f3Cc50E38f736f23897f192430E131ccB8", + "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + }, + "Ethereum Mainnet": { + "off_ramp": "0xEC0cFe335a4d53dBA70CB650Ab56eEc32788F0BB", + "commit_store": "0x0ae3c2c7FB789bd05A450CD3075D11f6c2Ca4F77", + "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + }, + "Gnosis Mainnet": { + "off_ramp": "0xA24D3Bc3A59798a57AF58f69c89DC1C8aFD78F18", + "commit_store": "0x672dbdC3aF7eE37436fe101531D33266D85F33c9", + "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + }, + "Mode Mainnet": { + "off_ramp": "0xFC30bFe46b11D4E25C6f7492fd064A70FbF18848", + "commit_store": "0xaeDBe55633F74A291F0A43Daa0Fd719615b78363", + "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + }, + "Optimism Mainnet": { + "off_ramp": "0xf50c0d2a8B6Db60f1D93E60f03d0413D56153E4F", + "commit_store": "0x16f72C15165f7C9d74c12fDF188E399d4d3724e4", + "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + }, + "Polygon Mainnet": { + "off_ramp": "0x75F29f058b31106F99caFdc17c9b26ADfcC7b5D7", + "commit_store": "0xb719616E732581B570232DfB13Ca49D27667Af9f", + "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + } + } + }, + "Blast Mainnet": { + "is_native_fee_token": true, + "fee_token": "0x4300000000000000000000000000000000000004", + "arm": "0x96aFe20249C4f6f55d2fe0E792138f6a4dC566A4", + "router": "0x12e0B8E349C6fb7E6E40713E8125C3cF1127ea8C", + "price_registry": "0x4f66d9e65af0d3DC27897E29f571f933291bb07c", + "wrapped_native": "0x4300000000000000000000000000000000000004", + "src_contracts": { + "Arbitrum Mainnet": { + "on_ramp": "0x42E1f5f5ACCe6e4971D9B9468D7A9Abed8D69DdD", + "deployed_at": 0 + }, + "BSC Mainnet": { + "on_ramp": "0x9c98d7aE731b0A53bedffBc1a12d9d43501Ea464", + "deployed_at": 0 + }, + "Base Mainnet": { + "on_ramp": "0x955f139225F5d7021EB911ED2787a795f71E5eb6", + "deployed_at": 0 + }, + "Ethereum Mainnet": { + "on_ramp": "0xBD9bf9AA79adF083BB7100848Eb15F4e8282E27e", + "deployed_at": 0 + } + }, + "dest_contracts": { + "Arbitrum Mainnet": { + "off_ramp": "0x01A38cd2da195C704bA192fCCDddd8986cb7EdE9", + "commit_store": "0xab6D69db1C1E9B97a26eB3983b0878AdeD248200", + "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + }, + "BSC Mainnet": { + "off_ramp": "0xabC7Dffb2590c44a201EC7532382e1fc01Cd9eEb", + "commit_store": "0xA3086bf1D609d8e8028E8339e4aa4362C7da339D", + "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + }, + "Base Mainnet": { + "off_ramp": "0x0406F8f66C10Da99ff518bc2242e0Ec486a2c787", + "commit_store": "0xc6A97d753a3001e0B893e5FA2b0ec3d623af6C20", + "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + }, + "Ethereum Mainnet": { + "off_ramp": "0x4e0092bBC8EfAb6Eca295caB66986193b90a1Bb9", + "commit_store": "0xd7cA96B58EE33FdB3aa1392c30eD02645b1F28e2", + "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + } + } + }, + "Celo": { + "is_native_fee_token": true, + "fee_token": "0x2021B12D8138e2D63cF0895eccABC0DFc92416c6", + "arm": "0x832Ca6A279D8F8c695986086B35c70D4E0c817CC", + "router": "0xfB48f15480926A4ADf9116Dca468bDd2EE6C5F62", + "price_registry": "0xD9FcEEA20dBB3Dfb91763B301819C9666429DC26", + "wrapped_native": "0x2021B12D8138e2D63cF0895eccABC0DFc92416c6", + "src_contracts": { + "Ethereum Mainnet": { + "on_ramp": "0x27C96A8a2f70a8408aD6c620717a3bDaA54bb10b", + "deployed_at": 0 + } + }, + "dest_contracts": { + "Ethereum Mainnet": { + "off_ramp": "0x90902C0AEE857F3A42f2beBEa38724cE7b7a0cff", + "commit_store": "0x25adA90B241143DD5Df04Fb06C1fF6E7f7624ad9", + "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + } + } + }, + "Ethereum Mainnet": { + "is_native_fee_token": true, + "fee_token": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", + "arm": "0xdCD48419bD5Cd9d1b097695F2af4Ee125aADF84F", + "router": "0x80226fc0Ee2b096224EeAc085Bb9a8cba1146f7D", + "price_registry": "0x020082A7a9c2510e1921116001152DEE4da81985", + "wrapped_native": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", + "src_contracts": { + "Arbitrum Mainnet": { + "on_ramp": "0x925228D7B82d883Dde340A55Fe8e6dA56244A22C", + "deployed_at": 0 + }, + "Avalanche Mainnet": { + "on_ramp": "0x3df8dAe2d123081c4D5E946E655F7c109B9Dd630", + "deployed_at": 0 + }, + "BSC Mainnet": { + "on_ramp": "0x91D25A56Db77aD5147437d8B83Eb563D46eBFa69", + "deployed_at": 0 + }, + "Base Mainnet": { + "on_ramp": "0xe2c2AB221AA0b957805f229d2AA57fBE2f4dADf7", + "deployed_at": 0 + }, + "Blast Mainnet": { + "on_ramp": "0x4545F9a17DA50110632C14704a15d893BF9CBD27", + "deployed_at": 0 + }, + "Celo": { + "on_ramp": "0xEd5bE9508ae56531cc0EDe6A3bD588Eb9E2e3cfa", + "deployed_at": 0 + }, + "Gnosis Mainnet": { + "on_ramp": "0xF538dA6c673A30338269655f4e019B71ba58CFd4", + "deployed_at": 0 + }, + "Metis Andromeda": { + "on_ramp": "0xa5ef33B57dD8B653F9A9EA7114f46376d18264aC", + "deployed_at": 0 + }, + "Mode Mainnet": { + "on_ramp": "0x466a078d17e3706a9414ACc48029EE9Bae4C9b65", + "deployed_at": 0 + }, + "Optimism Mainnet": { + "on_ramp": "0x86B47d8411006874eEf8E4584BdFD7be8e5549d1", + "deployed_at": 0 + }, + "Polygon Mainnet": { + "on_ramp": "0x35F0ca9Be776E4B38659944c257bDd0ba75F1B8B", + "deployed_at": 0 + }, + "WeMix Mainnet": { + "on_ramp": "0xCbE7e5DA76dC99Ac317adF6d99137005FDA4E2C4", + "deployed_at": 0 + }, + "ZKSync Mainnet": { + "on_ramp": "0xD54C93A99CBCb8D865E13DA321B540171795A89f", + "deployed_at": 0 + } + }, + "dest_contracts": { + "Arbitrum Mainnet": { + "off_ramp": "0xeFC4a18af59398FF23bfe7325F2401aD44286F4d", + "commit_store": "0x9B2EEd6A1e16cB50Ed4c876D2dD69468B21b7749", + "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + }, + "Avalanche Mainnet": { + "off_ramp": "0x569940e02D4425eac61A7601632eC00d69f75c17", + "commit_store": "0x2aa101BF99CaeF7fc1355D4c493a1fe187A007cE", + "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + }, + "BSC Mainnet": { + "off_ramp": "0x7Afe7088aff57173565F4b034167643AA8b9171c", + "commit_store": "0x87c55D48DF6EF7B08153Ab079e76bFEcbb793D75", + "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + }, + "Base Mainnet": { + "off_ramp": "0xdf85c8381954694E74abD07488f452b4c2Cddfb3", + "commit_store": "0x8DC27D621c41a32140e22E2a4dAf1259639BAe04", + "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + }, + "Blast Mainnet": { + "off_ramp": "0x1a904DbbaDdE629a1460e2F6E2E485Ce06Ed7599", + "commit_store": "0x3CB2A81bb8a188C5353CdFa9994ed8666556FC53", + "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + }, + "Celo": { + "off_ramp": "0xd5083684eE92dDeA117636ae5E2F1cb7fE4dfd46", + "commit_store": "0x831097033C88c82a7F1897b168Aa88cC44540C8f", + "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + }, + "Gnosis Mainnet": { + "off_ramp": "0xE93ec2A57e38C8541c893348cCafEAB01F7D47d4", + "commit_store": "0x118a9389960F86390A4F14ce4C95D6ff076C6bFC", + "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + }, + "Metis Andromeda": { + "off_ramp": "0xCe6364dBe64D2789D916180131fAda2ABFF702E8", + "commit_store": "0x3d8a95adA63D406ee8232562AbD83CEdb0B90466", + "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + }, + "Mode Mainnet": { + "off_ramp": "0xE8af3b68eDfFf65Ce48648009982380701f09B92", + "commit_store": "0x76264869a3eBF51a59FCa5ABa84ee2867c7F190e", + "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + }, + "Optimism Mainnet": { + "off_ramp": "0xB095900fB91db00E6abD247A5A5AD1cee3F20BF7", + "commit_store": "0x4af4B497c998007eF83ad130318eB2b925a79dc8", + "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + }, + "Polygon Mainnet": { + "off_ramp": "0x0af338F0E314c7551bcE0EF516d46d855b0Ee395", + "commit_store": "0xD37a60E8C36E802D2E1a6321832Ee85556Beeb76", + "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + }, + "WeMix Mainnet": { + "off_ramp": "0x3a129e6C18b23d18BA9E6Aa14Dc2e79d1f91c6c5", + "commit_store": "0x31f6ab382DDeb9A316Ab61C3945a5292a50a89AB", + "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + }, + "ZKSync Mainnet": { + "off_ramp": "0xb368c8946D9fa5A497cDe1Dff7213f9CdfD143Bf", + "commit_store": "0xa4d264470a67D9f6682EE12Bdc9c35Df44e3F194", + "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + } + } + }, + "Gnosis Mainnet": { + "is_native_fee_token": true, + "fee_token": "0xe91D153E0b41518A2Ce8Dd3D7944Fa863463a97d", + "arm": "0x2ab5ff904CFFdD37f19cC34597cF425916F2DAcA", + "router": "0x4aAD6071085df840abD9Baf1697d5D5992bDadce", + "price_registry": "0xec00a50EFb62F5f686E0FdEFDD6e10744dc53cAD", + "wrapped_native": "0xe91D153E0b41518A2Ce8Dd3D7944Fa863463a97d", + "src_contracts": { + "Arbitrum Mainnet": { + "on_ramp": "0x7A36511202f54a8A3Bc62Cc1df24bd391f7c9864", + "deployed_at": 0 + }, + "Avalanche Mainnet": { + "on_ramp": "0x732753869bc6bB07Ec81A403F926bbF6fC2FeaE2", + "deployed_at": 0 + }, + "BSC Mainnet": { + "on_ramp": "0xD5d33bc0BF395B39514B7f9f8F66ebc9D8e650Cb", + "deployed_at": 0 + }, + "Base Mainnet": { + "on_ramp": "0x400eFb50480a73FEc02b115b53F0Ec6EcFf03C67", + "deployed_at": 0 + }, + "Ethereum Mainnet": { + "on_ramp": "0x0F246651F1c2275B4E14d8ae166D1fd3Af05c405", + "deployed_at": 0 + }, + "Optimism Mainnet": { + "on_ramp": "0x391516732884d3F8Eec3301C19b819E6e6044C17", + "deployed_at": 0 + }, + "Polygon Mainnet": { + "on_ramp": "0x566c7A2Cb557c36082301B97E998721D14E4bF7d", + "deployed_at": 0 + } + }, + "dest_contracts": { + "Arbitrum Mainnet": { + "off_ramp": "0x1bee1FD97824288a36B725f9CF20E07A67d5113b", + "commit_store": "0xB3a48e8664C5dE26822ae44577b100b717C36a54", + "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + }, + "Avalanche Mainnet": { + "off_ramp": "0x633c19cCD7A818770f7BF59eB9C5AB632CDbc4D5", + "commit_store": "0xbbC073fb2D424eA45A571cc4dd91745E45d0aC73", + "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + }, + "BSC Mainnet": { + "off_ramp": "0x4D90524de5783257fd64d1a20689a5b9Bad25de0", + "commit_store": "0xAae8De9f1B7e2FFF0563c2BBf0c69593BD517b52", + "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + }, + "Base Mainnet": { + "off_ramp": "0x9118303DE7f4342F9B057f6EC1Be282aa543D99C", + "commit_store": "0xa75f463b8a1d8bf7694Ac13E02938894F45eFbaA", + "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + }, + "Ethereum Mainnet": { + "off_ramp": "0xFF61E57A2eE83FA262006C2DaF0D5fB2b36F3070", + "commit_store": "0xF433De9A293553c133E2dB90e226c2F2911f435C", + "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + }, + "Optimism Mainnet": { + "off_ramp": "0x9D3aA479525a5BcE776dD83769e9F9b5B4dD4193", + "commit_store": "0x2B721632693A8BbABa3bA5F125C8cD33D66F28F7", + "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + }, + "Polygon Mainnet": { + "off_ramp": "0x9714098CDdAc380D4443293C55B6CBf6D6bbDbEb", + "commit_store": "0x4338f204C7698eE678d6c44117503f812ca1FA69", + "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + } + } + }, + "Kroma Mainnet": { + "is_native_fee_token": true, + "fee_token": "0x4200000000000000000000000000000000000001", + "arm": "0xB558b375D1D8a1aE2c3d5bBe43634BcF4d0d108c", + "router": "0xE93E8B0d1b1CEB44350C8758ed1E2799CCee31aB", + "price_registry": "0x8155B4710e7bbC90924E957104F94Afd4f95Eca2", + "wrapped_native": "0x4200000000000000000000000000000000000001", + "src_contracts": { + "WeMix Mainnet": { + "on_ramp": "0x3C5Ab46fA1dB1dECD854224654313a69bf9fcAD3", + "deployed_at": 0 + } + }, + "dest_contracts": { + "WeMix Mainnet": { + "off_ramp": "0x2B555774B3D1dcbcd76efb7751F3c5FbCFABC5C4", + "commit_store": "0x213124614aAf31eBCE7c612A12aac5f8aAD77DE4", + "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + } + } + }, + "Metis Andromeda": { + "is_native_fee_token": true, + "fee_token": "0x75cb093E4D61d2A2e65D8e0BBb01DE8d89b53481", + "arm": "0xC4BFAc3D31C524A4958c5d5d1e68394d8DEbbE69", + "router": "0x7b9FB8717D306e2e08ce2e1Efa81F026bf9AD13c", + "price_registry": "0xe1A7e2f9E88a72aF3E4790f33FfcDEa43d5eCC7B", + "wrapped_native": "0x75cb093E4D61d2A2e65D8e0BBb01DE8d89b53481", + "src_contracts": { + "Arbitrum Mainnet": { + "on_ramp": "0x87353b87A373E1551D27EDacDaC1644741c6499F", + "deployed_at": 0 + }, + "Ethereum Mainnet": { + "on_ramp": "0xE43f9eD3146d76E627C2504E5140005027992De6", + "deployed_at": 0 + } + }, + "dest_contracts": { + "Arbitrum Mainnet": { + "off_ramp": "0x2cc33de75dAFDb3F8F4f24244a9C420374e2C001", + "commit_store": "0x67fE38dB73be154a1f1a63221F898B9d5EE4eF63", + "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + }, + "Ethereum Mainnet": { + "off_ramp": "0xc2B1A8c931582D041ba5fF30AEB9fA828B30754d", + "commit_store": "0x90073Ea7A1Ee4Fe5d638B4216Bc60479Eba52001", + "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + } + } + }, + "Mode Mainnet": { + "is_native_fee_token": true, + "fee_token": "0x4200000000000000000000000000000000000006", + "arm": "0x77EAF440c5d24e25D1834CBBF623bFd83b8b5dA1", + "router": "0x24C40f13E77De2aFf37c280BA06c333531589bf1", + "price_registry": "0xffDEc5d752dd1fa1f56C236183ACB022e5D9d79e", + "wrapped_native": "0x4200000000000000000000000000000000000006", + "src_contracts": { + "Arbitrum Mainnet": { + "on_ramp": "0x65Ad802d80aD6a96C5a4bc9e57E16099de99Dc7F", + "deployed_at": 0 + }, + "BSC Mainnet": { + "on_ramp": "0x8C5149ff7Cfd99dd561caE9B7abFAA0Ef79eAbeC", + "deployed_at": 0 + }, + "Base Mainnet": { + "on_ramp": "0x71dB32eF442c29d8cbf72a9AFcb1Ef12B35b0BF4", + "deployed_at": 0 + }, + "Ethereum Mainnet": { + "on_ramp": "0xbD5F9C193a7fEF5D578C55Ddfe4d08d6BCc15648", + "deployed_at": 0 + }, + "Optimism Mainnet": { + "on_ramp": "0x659303e8d4306D3ea8676FB034d56FB6f37E19d9", + "deployed_at": 0 + } + }, + "dest_contracts": { + "Arbitrum Mainnet": { + "off_ramp": "0x8d3E1b15ebC96cec1ffc092cEcAeA6c1DD00aF9b", + "commit_store": "0x1f1DEa0210aE346A20E270a1C3355d99b0B949D2", + "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + }, + "BSC Mainnet": { + "off_ramp": "0x7a57670Fa0Cf1Bc2665a1Ae0f5031b9f5a43dD3a", + "commit_store": "0x18ffb74D94175d00D8bB67B70737dE2cE45eed07", + "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + }, + "Base Mainnet": { + "off_ramp": "0xEfa90cE6289A2777cd5B8fb991B2D0Be44cA5067", + "commit_store": "0xACa5f0942Bb7fF297A7c25E8364373702D81bb3f", + "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + }, + "Ethereum Mainnet": { + "off_ramp": "0xdF8f09AB4DfB49dEC8a0B8b7f1B7F4134252D3e9", + "commit_store": "0x8Ae635d264f20f1dbC0dea03712C194AdbeF50D1", + "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + }, + "Optimism Mainnet": { + "off_ramp": "0xE4D6AAF678b986D3E6B7A85FA33d0519716a5525", + "commit_store": "0xBF80E30c8c013Ec0d05e2a959CF8000407C813EC", + "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + } + } + }, + "Optimism Mainnet": { + "is_native_fee_token": true, + "fee_token": "0x4200000000000000000000000000000000000006", + "arm": "0x1c51b6D5BFcFB7ee82C80949DFD146dB157a7E49", + "router": "0x3206695CaE29952f4b0c22a169725a865bc8Ce0f", + "price_registry": "0x9270AAA75F4B9038f4c25fEc665B02a150a90361", + "wrapped_native": "0x4200000000000000000000000000000000000006", + "src_contracts": { + "Arbitrum Mainnet": { + "on_ramp": "0x0C9BE7Cfd12c735E5aaE047C1dCB845d54E518C3", + "deployed_at": 0 + }, + "Avalanche Mainnet": { + "on_ramp": "0xD0D3E757bFBce7ae1881DDD7F6d798DDcE588445", + "deployed_at": 0 + }, + "BSC Mainnet": { + "on_ramp": "0xa3c9544B82846C45BE37593d5d9ACffbE61BF3A6", + "deployed_at": 0 + }, + "Base Mainnet": { + "on_ramp": "0x0b1760A8112183303c5526C6b24569fd3A274f3B", + "deployed_at": 0 + }, + "Ethereum Mainnet": { + "on_ramp": "0x55183Db1d2aE0b63e4c92A64bEF2CBfc2032B127", + "deployed_at": 0 + }, + "Gnosis Mainnet": { + "on_ramp": "0x14aA3CC03583aA557DBca4ce72288Cc5F37DDE34", + "deployed_at": 0 + }, + "Mode Mainnet": { + "on_ramp": "0x034eA573B049210315110f7eA11c9618E32F08Ae", + "deployed_at": 0 + }, + "Polygon Mainnet": { + "on_ramp": "0x6B57145e322c877E7D91Ed8E31266eB5c02F7EfC", + "deployed_at": 0 + }, + "WeMix Mainnet": { + "on_ramp": "0x82e9f4C5ec4a84E310d60D462a12042E5cbA0954", + "deployed_at": 0 + } + }, + "dest_contracts": { + "Arbitrum Mainnet": { + "off_ramp": "0xaC8C94242aa8234Bf89682aBcDDf805AE8cff61D", + "commit_store": "0x55028780918330FD00a34a61D9a7Efd3f43ca845", + "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + }, + "Avalanche Mainnet": { + "off_ramp": "0x8dc6490A6204dF846BaBE809cB695ba17Df1F9B1", + "commit_store": "0xA190660787B6B183Dd82B243eA10e609327c7308", + "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + }, + "BSC Mainnet": { + "off_ramp": "0xE14501F2838F2fA1Ceb52E78ABdA289EcE1705EA", + "commit_store": "0xa8DD25B29787527Df283211C24Ac72B17150A696", + "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + }, + "Base Mainnet": { + "off_ramp": "0xBAE6560eCa9B77Cb047158C783e36F7735C86037", + "commit_store": "0x6168aDF58e1Ad446BaD45c6275Bef60Ef4FFBAb8", + "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + }, + "Ethereum Mainnet": { + "off_ramp": "0xd2D98Be6a1C241e86C807e51cED6ABb51d044203", + "commit_store": "0x4d75A5cE454b264b187BeE9e189aF1564a68408D", + "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + }, + "Gnosis Mainnet": { + "off_ramp": "0x4358640A2419119DBe0933b5F2c288c3EB2c082C", + "commit_store": "0x44d1a05ef6e54a3CB35a1497303bA272f15f45ed", + "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + }, + "Mode Mainnet": { + "off_ramp": "0xDf9717d724828537902Fb0c3B7C56c641463Fa38", + "commit_store": "0x8aEFF283381914E07Fc371601D59648ab6D2C0B1", + "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + }, + "Polygon Mainnet": { + "off_ramp": "0x7c6221880A1D62506b1A08Dab3Bf695A49AcDD22", + "commit_store": "0x0684076EE3595221861C50cDb9Cb66402Ec11Cb9", + "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + }, + "WeMix Mainnet": { + "off_ramp": "0x3e5B3b7559D39563a74434157b31781322dA712D", + "commit_store": "0x7954372FF6f80908e5A2dC2a19d796A1005f91D2", + "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + } + } + }, + "Polygon Mainnet": { + "is_native_fee_token": true, + "fee_token": "0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270", + "arm": "0x569a295a09634Ac9414c3efe4E8931986d68F937", + "router": "0x849c5ED5a80F5B408Dd4969b78c2C8fdf0565Bfe", + "price_registry": "0x30D873664Ba766C983984C7AF9A921ccE36D34e1", + "wrapped_native": "0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270", + "src_contracts": { + "Arbitrum Mainnet": { + "on_ramp": "0xD16D025330Edb91259EEA8ed499daCd39087c295", + "deployed_at": 0 + }, + "Avalanche Mainnet": { + "on_ramp": "0x5FA30697e90eB30954895c45b028F7C0dDD39b12", + "deployed_at": 0 + }, + "BSC Mainnet": { + "on_ramp": "0xF5b5A2fC11BF46B1669C3B19d98B19C79109Dca9", + "deployed_at": 0 + }, + "Base Mainnet": { + "on_ramp": "0x20B028A2e0F6CCe3A11f3CE5F2B8986F932e89b4", + "deployed_at": 0 + }, + "Ethereum Mainnet": { + "on_ramp": "0xFd77c53AA4eF0E3C01f5Ac012BF7Cc7A3ECf5168", + "deployed_at": 0 + }, + "Gnosis Mainnet": { + "on_ramp": "0x4616621704C81801A56D29c961F9395ee153d46C", + "deployed_at": 0 + }, + "Optimism Mainnet": { + "on_ramp": "0x3111cfbF5e84B5D9BD952dd8e957f4Ca75f728Cf", + "deployed_at": 0 + }, + "WeMix Mainnet": { + "on_ramp": "0x5060eF647a1F66BE6eE27FAe3046faf8D53CeB2d", + "deployed_at": 0 + } + }, + "dest_contracts": { + "Arbitrum Mainnet": { + "off_ramp": "0xa8a9eDa2867c2E0CE0d5ECe273961F1EcC3CC25B", + "commit_store": "0xbD4480658dca8496a65046dfD1BDD44EF897Bdb5", + "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + }, + "Avalanche Mainnet": { + "off_ramp": "0xB9e3680639c9F0C4e0b02FD81C445094426244Ae", + "commit_store": "0x8c63d4e67f7c4af6FEd2f56A34fB4e01CB807CFF", + "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + }, + "BSC Mainnet": { + "off_ramp": "0x592773924741F0Da889a0dfdab71171Dd11E054C", + "commit_store": "0xEC4d35E1A85f770f4D93BA43a462c9d87Ef7017e", + "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + }, + "Base Mainnet": { + "off_ramp": "0xD0FA7DE2D18A0c59D3fD7dfC7aB4e913C6Aa7b68", + "commit_store": "0xF88053B9DAC8Dd3039a4eFa8639159aaa3F2D4Cb", + "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + }, + "Ethereum Mainnet": { + "off_ramp": "0x45320085fF051361D301eC1044318213A5387A15", + "commit_store": "0x4Dc771B5ef21ef60c33e2987E092345f2b63aE08", + "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + }, + "Gnosis Mainnet": { + "off_ramp": "0x0A04eC196454825d361886cf4FA113A948164Ef8", + "commit_store": "0x74b72633b63A8f4374a12DB6F609305BC5a1b2d5", + "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + }, + "Optimism Mainnet": { + "off_ramp": "0xBa754ecd3CFA7E9093F688EAc3860cf9D07Fc0AC", + "commit_store": "0x04C0D5302E3D8Ca0A0019141a52a23B59cdb70e4", + "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + }, + "WeMix Mainnet": { + "off_ramp": "0xd7c877ea02310Cce9278D9A048Aa1Bb9aF72F00d", + "commit_store": "0x92A1C927E8E10Ab6A40E5A5154e2300D278d1a67", + "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + } + } + }, + "WeMix Mainnet": { + "is_native_fee_token": true, + "fee_token": "0x7D72b22a74A216Af4a002a1095C8C707d6eC1C5f", + "arm": "0xdBa0afF04bf63Ba6b75DEC94d1A934a367CAA782", + "router": "0x7798b795Fde864f4Cd1b124a38Ba9619B7F8A442", + "price_registry": "0x252863688762aD86868D3d3076233Eacd80c7055", + "wrapped_native": "0x7D72b22a74A216Af4a002a1095C8C707d6eC1C5f", + "src_contracts": { + "Arbitrum Mainnet": { + "on_ramp": "0x9aBfd6f4C865610692AB6fb1Be862575809fFabf", + "deployed_at": 0 + }, + "Avalanche Mainnet": { + "on_ramp": "0xbE0Cfae74677F8dd16a246a3a5c8cbB1973118f4", + "deployed_at": 0 + }, + "BSC Mainnet": { + "on_ramp": "0x56657ec4D15C71f7F3C17ba2b21C853A24Dc5381", + "deployed_at": 0 + }, + "Ethereum Mainnet": { + "on_ramp": "0x190bcE84CF2d500B878966F4Cf98a50d78f2675E", + "deployed_at": 0 + }, + "Kroma Mainnet": { + "on_ramp": "0x47E9AE0A815C94836202E696748A5d5476aD8735", + "deployed_at": 0 + }, + "Optimism Mainnet": { + "on_ramp": "0x70f3b0FD7e6a4B9B623e9AB859604A9EE03e48BD", + "deployed_at": 0 + }, + "Polygon Mainnet": { + "on_ramp": "0x777058C1e1dcE4eB8001F38631a1cd9450816e5a", + "deployed_at": 0 + } + }, + "dest_contracts": { + "Arbitrum Mainnet": { + "off_ramp": "0x2ba68a395B72a6E3498D312efeD755ed2f3CF223", + "commit_store": "0xdAeC234DA83F68707Bb8AcB2ee6a01a5FD4c2391", + "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + }, + "Avalanche Mainnet": { + "off_ramp": "0xFac907F9a1087B846Faa75A14C5d34A8639233d8", + "commit_store": "0xF2812063446c7deD2CA306c67A68364BdDcbEfc5", + "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + }, + "BSC Mainnet": { + "off_ramp": "0x6ec9ca4Cba62cA17c55F05ad2000B46192f02035", + "commit_store": "0x84534BE763366a69710E119c100832955795B34B", + "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + }, + "Ethereum Mainnet": { + "off_ramp": "0xF92Fa796F5307b029c65CA26f322a6D86f211194", + "commit_store": "0xbeC110FF43D52be2066B06525304A9924E16b73b", + "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + }, + "Kroma Mainnet": { + "off_ramp": "0xF886d8DC64E544af4835cbf91e5678A54D95B80e", + "commit_store": "0x8794C9534658fdCC44f2FF6645Bf31cf9F6d2d5D", + "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + }, + "Optimism Mainnet": { + "off_ramp": "0x87220D01DF0fF27149B47227897074653788fd23", + "commit_store": "0xF8dD2be2C6FA43e48A17146380CbEBBB4291807b", + "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + }, + "Polygon Mainnet": { + "off_ramp": "0x8f0229804513A9Bc00c1308414AB279Dbc718ae1", + "commit_store": "0x3A85D1b8641d83a87957C6ECF1b62151213e0842", + "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + } + } + }, + "ZKSync Mainnet": { + "is_native_fee_token": true, + "fee_token": "0x5AEa5775959fBC2557Cc8789bC1bf90A239D9a91", + "arm": "0x4e2438b1395a462E2e8D164b5f3c65d080919449", + "router": "0x748Fd769d81F5D94752bf8B0875E9301d0ba71bB", + "price_registry": "0xa0C6E00a9Fa10A04989c237dF6dfDCe2AaceE4A3", + "wrapped_native": "0x5AEa5775959fBC2557Cc8789bC1bf90A239D9a91", + "src_contracts": { + "Arbitrum Mainnet": { + "on_ramp": "0x9033687a0f03012e015f8f8f2a59da57531d2B43", + "deployed_at": 0 + }, + "Ethereum Mainnet": { + "on_ramp": "0x3B80Fe300c9A611abA0496e2543B66Ff7bD4B9e9", + "deployed_at": 0 + } + }, + "dest_contracts": { + "Arbitrum Mainnet": { + "off_ramp": "0xF0a08aC528668D4fe8C4cF235a8B82cbf242Fa9d", + "commit_store": "0x5a3C9b21b03E4eBcccb57D296e7ff54102F04424", + "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + }, + "Ethereum Mainnet": { + "off_ramp": "0x7c887B97F9Bba9355EC10e2bA949AdB491Ef44Fd", + "commit_store": "0xA42bf0c8794FA8853Ec0F1B24a489972e8CF4C30", + "receiver_dapp": "0xb509c046e1182c7b36d2d9733554bc268716803c" + } + } + } + } +} +""" + +[CCIP.Env] +TTL = '8h' + +[CCIP.Env.Network] +selected_networks = [ + 'ARBITRUM_MAINNET', + 'AVALANCHE_MAINNET', + 'BSC_MAINNET', + 'BASE_MAINNET', + 'ETHEREUM_MAINNET', + 'KROMA_MAINNET', + 'OPTIMISM_MAINNET', + 'POLYGON_MAINNET', + 'WEMIX_MAINNET', + ] + +[CCIP.Groups.load] +NetworkPairs = [ + 'ETHEREUM_MAINNET,OPTIMISM_MAINNET', + 'ETHEREUM_MAINNET,AVALANCHE_MAINNET', + 'ETHEREUM_MAINNET,POLYGON_MAINNET', + 'ETHEREUM_MAINNET,BSC_MAINNET', + 'ETHEREUM_MAINNET,ARBITRUM_MAINNET', + 'ETHEREUM_MAINNET,BASE_MAINNET', + 'ETHEREUM_MAINNET,WEMIX_MAINNET', + 'AVALANCHE_MAINNET,POLYGON_MAINNET', + 'BASE_MAINNET,OPTIMISM_MAINNET', + 'BASE_MAINNET,ARBITRUM_MAINNET', + 'AVALANCHE_MAINNET,BSC_MAINNET', + 'BSC_MAINNET,POLYGON_MAINNET', + 'OPTIMISM_MAINNET,POLYGON_MAINNET', + 'BASE_MAINNET,BSC_MAINNET', + 'POLYGON_MAINNET,ARBITRUM_MAINNET', # added as batch 1 + 'ARBITRUM_MAINNET,BSC_MAINNET', # added as batch 1 + 'ARBITRUM_MAINNET,OPTIMISM_MAINNET', # added as batch 1 + 'AVALANCHE_MAINNET,OPTIMISM_MAINNET', # added as batch 2 + 'AVALANCHE_MAINNET,ARBITRUM_MAINNET', # added as batch 2 + 'BASE_MAINNET,POLYGON_MAINNET', # added as batch 2 + 'BSC_MAINNET,OPTIMISM_MAINNET', # added as batch 2 + 'AVALANCHE_MAINNET,BASE_MAINNET', # added as batch 2 + 'WEMIX_MAINNET,KROMA_MAINNET', + 'BSC_MAINNET,WEMIX_MAINNET', # added as batch 2 + 'AVALANCHE_MAINNET,WEMIX_MAINNET', # added as batch 2 + 'POLYGON_MAINNET,WEMIX_MAINNET', # added as batch 2 + 'WEMIX_MAINNET,ARBITRUM_MAINNET', # added as batch 2 + 'OPTIMISM_MAINNET,WEMIX_MAINNET' # added as batch 2 +] + +BiDirectionalLane = true +PhaseTimeout = '30m' +ExistingDeployment = true + +[CCIP.Groups.load.TokenConfig] +NoOfTokensPerChain = 1 + +[CCIP.Groups.load.LoadProfile] +RequestPerUnitTime = [1] +TimeUnit = '1h' +TestDuration = '5h' +TestRunName = 'Soak_test_mainnet' +FailOnFirstErrorInLoad = true +SkipRequestIfAnotherRequestTriggeredWithin = '40m' + +[[CCIP.Groups.load.LoadProfile.MsgProfile.MsgDetails]] +MsgType = 'Data' +DestGasLimit = 0 +DataLength = 100 +NoOfTokens = 1 +AmountPerToken = 1 + +[CCIP.Groups.smoke] +# these are all the valid network pairs +NetworkPairs = [ + 'ETHEREUM_MAINNET,OPTIMISM_MAINNET', + 'ETHEREUM_MAINNET,AVALANCHE_MAINNET', + 'ETHEREUM_MAINNET,POLYGON_MAINNET', + 'ETHEREUM_MAINNET,BSC_MAINNET', + 'ETHEREUM_MAINNET,ARBITRUM_MAINNET', + 'ETHEREUM_MAINNET,BASE_MAINNET', + 'ETHEREUM_MAINNET,WEMIX_MAINNET', + 'AVALANCHE_MAINNET,POLYGON_MAINNET', + 'BASE_MAINNET,OPTIMISM_MAINNET', + 'BASE_MAINNET,ARBITRUM_MAINNET', + 'AVALANCHE_MAINNET,BSC_MAINNET', + 'BSC_MAINNET,POLYGON_MAINNET', + 'OPTIMISM_MAINNET,POLYGON_MAINNET', + 'BASE_MAINNET,BSC_MAINNET', + 'POLYGON_MAINNET,ARBITRUM_MAINNET', # added as batch 1 + 'ARBITRUM_MAINNET,BSC_MAINNET', # added as batch 1 + 'ARBITRUM_MAINNET,OPTIMISM_MAINNET', # added as batch 1 + 'AVALANCHE_MAINNET,OPTIMISM_MAINNET', # added as batch 2 + 'AVALANCHE_MAINNET,ARBITRUM_MAINNET', # added as batch 2 + 'BASE_MAINNET,POLYGON_MAINNET', # added as batch 2 + 'BSC_MAINNET,OPTIMISM_MAINNET', # added as batch 2 + 'AVALANCHE_MAINNET,BASE_MAINNET', # added as batch 2 + 'WEMIX_MAINNET,KROMA_MAINNET', + 'BSC_MAINNET,WEMIX_MAINNET', # added as batch 2 + 'AVALANCHE_MAINNET,WEMIX_MAINNET', # added as batch 2 + 'POLYGON_MAINNET,WEMIX_MAINNET', # added as batch 2 + 'WEMIX_MAINNET,ARBITRUM_MAINNET', # added as batch 2 + 'OPTIMISM_MAINNET,WEMIX_MAINNET' # added as batch 2 +] + +BiDirectionalLane = true +PhaseTimeout = '20m' +LocalCluster = false +ExistingDeployment = true +ReuseContracts = true + + +[CCIP.Groups.smoke.TokenConfig] +NoOfTokensPerChain = 1 +CCIPOwnerTokens = true + +[CCIP.Groups.smoke.MsgDetails] +MsgType = 'Data' +DestGasLimit = 0 +DataLength = 100 +NoOfTokens = 1 +AmountPerToken = 1 \ No newline at end of file diff --git a/integration-tests/ccip-tests/testconfig/tomls/beta-testnet/testnet-beta-workinglane.toml b/integration-tests/ccip-tests/testconfig/tomls/beta-testnet/testnet-beta-workinglane.toml new file mode 100644 index 00000000000..592cb046ad3 --- /dev/null +++ b/integration-tests/ccip-tests/testconfig/tomls/beta-testnet/testnet-beta-workinglane.toml @@ -0,0 +1,283 @@ +[CCIP] +[CCIP.ContractVersions] +PriceRegistry = 'latest' +OffRamp = 'latest' +OnRamp = 'latest' +TokenPool = 'latest' +CommitStore = 'latest' + +[CCIP.Deployments] +Data = """ +{ + "lane_configs": { + "Arbitrum Sepolia": { + "is_mock_arm": true, + "fee_token": "0xb1D4538B4571d411F07960EF2838Ce337FE1E80E", + "bridge_tokens": null, + "bridge_tokens_pools": null, + "price_aggregators": null, + "arm": "0x2aE6d5495fc20226F433be50e37D59c05D186AaA", + "router": "0x0fF6b6F3Ad10D66600Fd5CC25b98542A05Aa7Bc2", + "price_registry": "0x25d997d8618e1299418b3D905E40bC353ec89F61", + "wrapped_native": "0xE591bf0A0CF924A0674d7792db046B23CEbF5f34", + "src_contracts": { + "Base Sepolia": { + "on_ramp": "0x6BD0f1efA261Ea84DB219c1284b538A65E530ea1", + "deployed_at": 29428386 + }, + "Optimism Sepolia": { + "on_ramp": "0x94cd0d171eF08924F0008305e5Bb90b0fC1b61AB", + "deployed_at": 13945916 + }, + "Sepolia Testnet": { + "on_ramp": "0x44225eb3B73B1b52Dd2ecD258F9b63418eC6Bf79", + "deployed_at": 13730868 + } + }, + "dest_contracts": { + "Base Sepolia": { + "off_ramp": "0x21560B4ACAEdb8AA2Dd935618F15da43197bdc12", + "commit_store": "0x27B882c393151ADD910F3557849AF0bb09c7d5A6", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Optimism Sepolia": { + "off_ramp": "0xAE32FD8Ae148BD88E3da6FaE8Cd7561Eed3ec5Cc", + "commit_store": "0x1f1160Ac7828B647A85c9a6b3A58A232C59D67Ab", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Sepolia Testnet": { + "off_ramp": "0xc136114F379b812345bb7e467ECDdb6D0c87De8b", + "commit_store": "0x42b3EbEA14F6CB803e3C7df84392Efb85CE90168", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + } + } + }, + "Avalanche Fuji": { + "is_mock_arm": true, + "fee_token": "0x0b9d5D9136855f6FEc3c0993feE6E9CE8a297846", + "bridge_tokens": null, + "bridge_tokens_pools": null, + "price_aggregators": null, + "arm": "0xD4A51dC0F5C680A8A18eA4Ec3A2f25C6db9424B7", + "router": "0xa62e685aDFF45f38eC94378513D128F168964E99", + "price_registry": "0xdbeA1a10AC6a2B729bF128aE9281Ed420dbE7113", + "wrapped_native": "0xd00ae08403B9bbb9124bB305C09058E32C39A48c", + "src_contracts": { + "BSC Testnet": { + "on_ramp": "0xe4f1F7750352f1c37C15C4A314554d6A79d7d146", + "deployed_at": 31437550 + } + }, + "dest_contracts": { + "BSC Testnet": { + "off_ramp": "0x796D720ea9D4326ff356eadE13b123B267C03C80", + "commit_store": "0xaDb37cFd91fa9b6Df1DaAcbAfB4cDFF41e06c956", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + } + } + }, + "BSC Testnet": { + "is_mock_arm": true, + "fee_token": "0x84b9B910527Ad5C03A9Ca831909E21e236EA7b06", + "bridge_tokens": null, + "bridge_tokens_pools": null, + "price_aggregators": null, + "arm": "0xbBF534D89d9640e3886db25FE1ffE603Fe160D75", + "router": "0x9CdA5b77eA23459eBaf2e3092c570a6B5605850A", + "price_registry": "0x9213967a47FC3F15A16A0b813208e8Ccb63Dbba6", + "wrapped_native": "0xae13d989daC2f0dEbFf460aC112a837C89BAa7cd", + "src_contracts": { + "Avalanche Fuji": { + "on_ramp": "0x0B4F541a7fcE5c251993Bc19D5A40B661e0463f5", + "deployed_at": 39097639 + } + }, + "dest_contracts": { + "Avalanche Fuji": { + "off_ramp": "0x41E59DCdDec18d7f79DA5F76Ce567d2c5e301E6B", + "commit_store": "0x9487C01D4b3Ae1c9Ac8740A07f3862D646548A14", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + } + } + }, + "Base Sepolia": { + "is_mock_arm": true, + "fee_token": "0xE4aB69C077896252FAFBD49EFD26B5D171A32410", + "bridge_tokens": null, + "bridge_tokens_pools": null, + "price_aggregators": null, + "arm": "0x866faB92E04bAE5EDa238A9cbFf1e56E09508Ade", + "router": "0x2aE6d5495fc20226F433be50e37D59c05D186AaA", + "price_registry": "0xD886E2286Fd1073df82462ea1822119600Af80b6", + "wrapped_native": "0x4200000000000000000000000000000000000006", + "src_contracts": { + "Arbitrum Sepolia": { + "on_ramp": "0xAE32FD8Ae148BD88E3da6FaE8Cd7561Eed3ec5Cc", + "deployed_at": 8133125 + }, + "Optimism Sepolia": { + "on_ramp": "0x9213967a47FC3F15A16A0b813208e8Ccb63Dbba6", + "deployed_at": 11607777 + } + }, + "dest_contracts": { + "Arbitrum Sepolia": { + "off_ramp": "0x34433469A4d6c8b1B0a1a7B91a5C5C2Dd74c67Fb", + "commit_store": "0xFEE7c8E229F538a98437b9A7D0Dd8fCd8A1Ab569", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Optimism Sepolia": { + "off_ramp": "0x0f30449bcCaCCaA7221B3f7C3304c4AaD68068E8", + "commit_store": "0x17a5746c9cf7eAf23533F060F395B2E38eb976ea", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + } + } + }, + "Optimism Sepolia": { + "is_mock_arm": true, + "fee_token": "0xE4aB69C077896252FAFBD49EFD26B5D171A32410", + "bridge_tokens": null, + "bridge_tokens_pools": null, + "price_aggregators": null, + "arm": "0x2aE6d5495fc20226F433be50e37D59c05D186AaA", + "router": "0x0fF6b6F3Ad10D66600Fd5CC25b98542A05Aa7Bc2", + "price_registry": "0x3B80b7Ef5c00Eb892CBe72800C028C47AD6380EF", + "wrapped_native": "0x4200000000000000000000000000000000000006", + "src_contracts": { + "Arbitrum Sepolia": { + "on_ramp": "0x622CB640F52bFfA68b78b2BD12c1940Ca4899621", + "deployed_at": 8020540 + }, + "Base Sepolia": { + "on_ramp": "0x12c164d0778E215873A062cEE2814507417339cB", + "deployed_at": 13590651 + }, + "Sepolia Testnet": { + "on_ramp": "0x0c2c8D4266C98f1b9333D5E1a42f3f775A0005d4", + "deployed_at": 8020948 + } + }, + "dest_contracts": { + "Arbitrum Sepolia": { + "off_ramp": "0x37004c1245a2D5541377e87cA29699492a4114D5", + "commit_store": "0x51158Ca439feA9E809Bc063CfA6701747b05254e", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Base Sepolia": { + "off_ramp": "0xB3F3f362FbeD49fA0086B434051C822B55BaADbD", + "commit_store": "0xD4995B99c484CCABc868b26c0B2C2Ef10ecde3d7", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Sepolia Testnet": { + "off_ramp": "0x80C2aa80F202FeFdFEEF80f516cFd89768c54057", + "commit_store": "0xc1fE981A040D679511ccb9139ca107aCA67520ef", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + } + } + }, + "Sepolia Testnet": { + "is_mock_arm": true, + "fee_token": "0x779877A7B0D9E8603169DdbD7836e478b4624789", + "bridge_tokens": null, + "bridge_tokens_pools": null, + "price_aggregators": null, + "arm": "0x9912a7389382ff55f85A29C9378B38F7B992c4aE", + "router": "0x1E1F3d8Ac7Df65fCcFcc52dbF03929cEE95430ac", + "price_registry": "0x4358e81f88bB27222779c1BC85003A11A1c66f6F", + "wrapped_native": "0x097D90c9d3E0B50Ca60e1ae45F6A81010f9FB534", + "src_contracts": { + "Arbitrum Sepolia": { + "on_ramp": "0x420a7B5ABB8CF27A70E1906F797e24509B11093D", + "deployed_at": 5275652 + }, + "Optimism Sepolia": { + "on_ramp": "0xEb4EBC1930bA81416A48a59142D89722163D85ae", + "deployed_at": 5281150 + } + }, + "dest_contracts": { + "Arbitrum Sepolia": { + "off_ramp": "0x224D1eB3aB2b7F23b66f093F9cBBC68dA77a1986", + "commit_store": "0x35c54cF12FF9B29dBa60dc23EdD1de0F13CC7fc5", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Optimism Sepolia": { + "off_ramp": "0xF21d01D6Ef822FBC56FC6c8F23f74fE3A0cb39aa", + "commit_store": "0x7F6AF440Bcc54f70Fd8AC2E534d37196c0bA1A38", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + } + } + } + } +} +""" + +[CCIP.Env] +TTL = '8h' + +[CCIP.Env.Network] +selected_networks = [ + 'ARBITRUM_SEPOLIA', + 'AVALANCHE_FUJI', + 'BASE_SEPOLIA', + 'BSC_TESTNET', + 'OPTIMISM_SEPOLIA', + 'SEPOLIA' +] + + + +[CCIP.Groups.smoke] +# these are all the valid network pairs +NetworkPairs = [ + 'BSC_TESTNET,AVALANCHE_FUJI', + 'SEPOLIA,ARBITRUM_SEPOLIA', + 'BASE_SEPOLIA,OPTIMISM_SEPOLIA' +] + +BiDirectionalLane = true +PhaseTimeout = '40m' +LocalCluster = false +ExistingDeployment = true +ReuseContracts = true + + +[CCIP.Groups.smoke.TokenConfig] +NoOfTokensPerChain = 1 +CCIPOwnerTokens = true + +[CCIP.Groups.smoke.MsgDetails] +MsgType = 'Data' +DestGasLimit = 0 +DataLength = 100 +NoOfTokens = 1 +AmountPerToken = 1 + +[CCIP.Groups.load] +NetworkPairs = [ + 'AVALANCHE_FUJI,BSC_TESTNET', + 'SEPOLIA,ARBITRUM_SEPOLIA', + 'BASE_SEPOLIA,OPTIMISM_SEPOLIA' +] + +BiDirectionalLane = true +PhaseTimeout = '40m' +ExistingDeployment = true + +[CCIP.Groups.load.TokenConfig] +NoOfTokensPerChain = 1 + +# Soak Test profile +[CCIP.Groups.load.LoadProfile] +RequestPerUnitTime = [1] +TimeUnit = '6m' +TestDuration = '3h' +TestRunName = 'BetaSoakTest_CCIPV1dot5' +FailOnFirstErrorInLoad = true + +[[CCIP.Groups.load.LoadProfile.MsgProfile.MsgDetails]] +MsgType = 'Data' +DestGasLimit = 0 +DataLength = 100 +NoOfTokens = 1 +AmountPerToken = 1 \ No newline at end of file diff --git a/integration-tests/ccip-tests/testconfig/tomls/beta-testnet/testnet-beta-workinglane_native.toml b/integration-tests/ccip-tests/testconfig/tomls/beta-testnet/testnet-beta-workinglane_native.toml new file mode 100644 index 00000000000..fcc063c7659 --- /dev/null +++ b/integration-tests/ccip-tests/testconfig/tomls/beta-testnet/testnet-beta-workinglane_native.toml @@ -0,0 +1,295 @@ +[CCIP] +[CCIP.ContractVersions] +PriceRegistry = 'latest' +OffRamp = 'latest' +OnRamp = 'latest' +TokenPool = 'latest' +CommitStore = 'latest' + +[CCIP.Deployments] +Data = """ +{ + "lane_configs": { + "Arbitrum Sepolia": { + "is_native_fee_token": true, + "is_mock_arm": true, + "fee_token": "0xE591bf0A0CF924A0674d7792db046B23CEbF5f34", + "bridge_tokens": null, + "bridge_tokens_pools": null, + "price_aggregators": null, + "arm": "0x2aE6d5495fc20226F433be50e37D59c05D186AaA", + "router": "0x0fF6b6F3Ad10D66600Fd5CC25b98542A05Aa7Bc2", + "price_registry": "0x25d997d8618e1299418b3D905E40bC353ec89F61", + "wrapped_native": "0xE591bf0A0CF924A0674d7792db046B23CEbF5f34", + "src_contracts": { + "Base Sepolia": { + "on_ramp": "0x6BD0f1efA261Ea84DB219c1284b538A65E530ea1", + "deployed_at": 29428386 + }, + "Optimism Sepolia": { + "on_ramp": "0x94cd0d171eF08924F0008305e5Bb90b0fC1b61AB", + "deployed_at": 13945916 + }, + "Sepolia Testnet": { + "on_ramp": "0x44225eb3B73B1b52Dd2ecD258F9b63418eC6Bf79", + "deployed_at": 13730868 + } + }, + "dest_contracts": { + "Base Sepolia": { + "off_ramp": "0x21560B4ACAEdb8AA2Dd935618F15da43197bdc12", + "commit_store": "0x27B882c393151ADD910F3557849AF0bb09c7d5A6", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Optimism Sepolia": { + "off_ramp": "0xAE32FD8Ae148BD88E3da6FaE8Cd7561Eed3ec5Cc", + "commit_store": "0x1f1160Ac7828B647A85c9a6b3A58A232C59D67Ab", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Sepolia Testnet": { + "off_ramp": "0xc136114F379b812345bb7e467ECDdb6D0c87De8b", + "commit_store": "0x42b3EbEA14F6CB803e3C7df84392Efb85CE90168", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + } + } + }, + "Avalanche Fuji": { + "is_native_fee_token": true, + "is_mock_arm": true, + "fee_token": "0xd00ae08403B9bbb9124bB305C09058E32C39A48c", + "bridge_tokens": [ + "0x0b9d5D9136855f6FEc3c0993feE6E9CE8a297846" + ], + "bridge_tokens_pools": [ + "0x156943ae87AaF63eA9272902Cb05407ec7bc9464" + ], + "price_aggregators": null, + "arm": "0xD4A51dC0F5C680A8A18eA4Ec3A2f25C6db9424B7", + "router": "0xa62e685aDFF45f38eC94378513D128F168964E99", + "price_registry": "0xdbeA1a10AC6a2B729bF128aE9281Ed420dbE7113", + "wrapped_native": "0xd00ae08403B9bbb9124bB305C09058E32C39A48c", + "src_contracts": { + "BSC Testnet": { + "on_ramp": "0xe4f1F7750352f1c37C15C4A314554d6A79d7d146", + "deployed_at": 31437550 + } + }, + "dest_contracts": { + "BSC Testnet": { + "off_ramp": "0x796D720ea9D4326ff356eadE13b123B267C03C80", + "commit_store": "0xaDb37cFd91fa9b6Df1DaAcbAfB4cDFF41e06c956", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + } + } + }, + "BSC Testnet": { + "is_native_fee_token": true, + "is_mock_arm": true, + "fee_token": "0xae13d989daC2f0dEbFf460aC112a837C89BAa7cd", + "bridge_tokens": null, + "bridge_tokens_pools": null, + "price_aggregators": null, + "arm": "0xbBF534D89d9640e3886db25FE1ffE603Fe160D75", + "router": "0x9CdA5b77eA23459eBaf2e3092c570a6B5605850A", + "price_registry": "0x9213967a47FC3F15A16A0b813208e8Ccb63Dbba6", + "wrapped_native": "0xae13d989daC2f0dEbFf460aC112a837C89BAa7cd", + "src_contracts": { + "Avalanche Fuji": { + "on_ramp": "0x0B4F541a7fcE5c251993Bc19D5A40B661e0463f5", + "deployed_at": 39097639 + } + }, + "dest_contracts": { + "Avalanche Fuji": { + "off_ramp": "0x41E59DCdDec18d7f79DA5F76Ce567d2c5e301E6B", + "commit_store": "0x9487C01D4b3Ae1c9Ac8740A07f3862D646548A14", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + } + } + }, + "Base Sepolia": { + "is_native_fee_token": true, + "is_mock_arm": true, + "fee_token": "0x4200000000000000000000000000000000000006", + "bridge_tokens": null, + "bridge_tokens_pools": null, + "price_aggregators": null, + "arm": "0x866faB92E04bAE5EDa238A9cbFf1e56E09508Ade", + "router": "0x2aE6d5495fc20226F433be50e37D59c05D186AaA", + "price_registry": "0xD886E2286Fd1073df82462ea1822119600Af80b6", + "wrapped_native": "0x4200000000000000000000000000000000000006", + "src_contracts": { + "Arbitrum Sepolia": { + "on_ramp": "0xAE32FD8Ae148BD88E3da6FaE8Cd7561Eed3ec5Cc", + "deployed_at": 8133125 + }, + "Optimism Sepolia": { + "on_ramp": "0x9213967a47FC3F15A16A0b813208e8Ccb63Dbba6", + "deployed_at": 11607777 + } + }, + "dest_contracts": { + "Arbitrum Sepolia": { + "off_ramp": "0x34433469A4d6c8b1B0a1a7B91a5C5C2Dd74c67Fb", + "commit_store": "0xFEE7c8E229F538a98437b9A7D0Dd8fCd8A1Ab569", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Optimism Sepolia": { + "off_ramp": "0x0f30449bcCaCCaA7221B3f7C3304c4AaD68068E8", + "commit_store": "0x17a5746c9cf7eAf23533F060F395B2E38eb976ea", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + } + } + }, + "Optimism Sepolia": { + "is_native_fee_token": true, + "is_mock_arm": true, + "fee_token": "0x4200000000000000000000000000000000000006", + "bridge_tokens": null, + "bridge_tokens_pools": null, + "price_aggregators": null, + "arm": "0x2aE6d5495fc20226F433be50e37D59c05D186AaA", + "router": "0x0fF6b6F3Ad10D66600Fd5CC25b98542A05Aa7Bc2", + "price_registry": "0x3B80b7Ef5c00Eb892CBe72800C028C47AD6380EF", + "wrapped_native": "0x4200000000000000000000000000000000000006", + "src_contracts": { + "Arbitrum Sepolia": { + "on_ramp": "0x622CB640F52bFfA68b78b2BD12c1940Ca4899621", + "deployed_at": 8020540 + }, + "Base Sepolia": { + "on_ramp": "0x12c164d0778E215873A062cEE2814507417339cB", + "deployed_at": 13590651 + }, + "Sepolia Testnet": { + "on_ramp": "0x0c2c8D4266C98f1b9333D5E1a42f3f775A0005d4", + "deployed_at": 8020948 + } + }, + "dest_contracts": { + "Arbitrum Sepolia": { + "off_ramp": "0x37004c1245a2D5541377e87cA29699492a4114D5", + "commit_store": "0x51158Ca439feA9E809Bc063CfA6701747b05254e", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Base Sepolia": { + "off_ramp": "0xB3F3f362FbeD49fA0086B434051C822B55BaADbD", + "commit_store": "0xD4995B99c484CCABc868b26c0B2C2Ef10ecde3d7", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Sepolia Testnet": { + "off_ramp": "0x80C2aa80F202FeFdFEEF80f516cFd89768c54057", + "commit_store": "0xc1fE981A040D679511ccb9139ca107aCA67520ef", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + } + } + }, + "Sepolia Testnet": { + "is_native_fee_token": true, + "is_mock_arm": true, + "fee_token": "0x097D90c9d3E0B50Ca60e1ae45F6A81010f9FB534", + "bridge_tokens": null, + "bridge_tokens_pools": null, + "price_aggregators": null, + "arm": "0x9912a7389382ff55f85A29C9378B38F7B992c4aE", + "router": "0x1E1F3d8Ac7Df65fCcFcc52dbF03929cEE95430ac", + "price_registry": "0x4358e81f88bB27222779c1BC85003A11A1c66f6F", + "wrapped_native": "0x097D90c9d3E0B50Ca60e1ae45F6A81010f9FB534", + "src_contracts": { + "Arbitrum Sepolia": { + "on_ramp": "0x420a7B5ABB8CF27A70E1906F797e24509B11093D", + "deployed_at": 5275652 + }, + "Optimism Sepolia": { + "on_ramp": "0xEb4EBC1930bA81416A48a59142D89722163D85ae", + "deployed_at": 5281150 + } + }, + "dest_contracts": { + "Arbitrum Sepolia": { + "off_ramp": "0x224D1eB3aB2b7F23b66f093F9cBBC68dA77a1986", + "commit_store": "0x35c54cF12FF9B29dBa60dc23EdD1de0F13CC7fc5", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Optimism Sepolia": { + "off_ramp": "0xF21d01D6Ef822FBC56FC6c8F23f74fE3A0cb39aa", + "commit_store": "0x7F6AF440Bcc54f70Fd8AC2E534d37196c0bA1A38", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + } + } + } + } +} +""" + +[CCIP.Env] +TTL = '8h' + +[CCIP.Env.Network] +selected_networks = [ + 'ARBITRUM_SEPOLIA', + 'AVALANCHE_FUJI', + 'BASE_SEPOLIA', + 'BSC_TESTNET', + 'OPTIMISM_SEPOLIA', + 'SEPOLIA', +] + + +[CCIP.Env.NewCLCluster.Common.ChainlinkImage] +version = "sha-17ce920" + +[CCIP.Groups.smoke] +# these are all the valid network pairs +NetworkPairs = [ + 'AVALANCHE_FUJI,BSC_TESTNET', + 'SEPOLIA,ARBITRUM_SEPOLIA', + 'BASE_SEPOLIA,OPTIMISM_SEPOLIA', +] + +BiDirectionalLane = true +PhaseTimeout = '30m' +LocalCluster = false +ExistingDeployment = true +ReuseContracts = true + + +[CCIP.Groups.smoke.TokenConfig] +NoOfTokensPerChain = 1 +CCIPOwnerTokens = true + +[CCIP.Groups.smoke.MsgDetails] +MsgType = 'Data' +DestGasLimit = 0 +DataLength = 100 +NoOfTokens = 1 +AmountPerToken = 1 + +[CCIP.Groups.load] +NetworkPairs = [ + 'AVALANCHE_FUJI,BSC_TESTNET', + 'SEPOLIA,ARBITRUM_SEPOLIA', + 'BASE_SEPOLIA,OPTIMISM_SEPOLIA' +] + +BiDirectionalLane = true +PhaseTimeout = '40m' +ExistingDeployment = true + +[CCIP.Groups.load.TokenConfig] +NoOfTokensPerChain = 1 + +# Soak Test profile +[CCIP.Groups.load.LoadProfile] +RequestPerUnitTime = [1] +TimeUnit = '6m' +TestDuration = '3h' +TestRunName = 'BetaSoakTest_V2.14.0-1.5.1' +FailOnFirstErrorInLoad = true + +[[CCIP.Groups.load.LoadProfile.MsgProfile.MsgDetails]] +MsgType = 'Data' +DestGasLimit = 0 +DataLength = 100 +NoOfTokens = 1 +AmountPerToken = 1 \ No newline at end of file diff --git a/integration-tests/ccip-tests/testconfig/tomls/ccip-crib.toml b/integration-tests/ccip-tests/testconfig/tomls/ccip-crib.toml new file mode 100644 index 00000000000..12afcea791f --- /dev/null +++ b/integration-tests/ccip-tests/testconfig/tomls/ccip-crib.toml @@ -0,0 +1,96 @@ +[CCIP] +[CCIP.Env] +Mockserver = 'http://mockserver:1080' + +[CCIP.Env.Network] +selected_networks = ['AVALANCHE_FUJI', 'BSC_TESTNET'] + +[CCIP.Env.Network.EVMNetworks.AVALANCHE_FUJI] +evm_name = 'Avalanche Fuji' +evm_chain_id = 43113 +evm_urls = ['wss://...'] +evm_http_urls = ['https://...'] +evm_keys = [''] +evm_simulated = false +client_implementation = 'Ethereum' +evm_chainlink_transaction_limit = 50000 +evm_transaction_timeout = '2m' +evm_minimum_confirmations = 1 +evm_gas_estimation_buffer = 1000 +evm_supports_eip1559 = true +evm_default_gas_limit = 6000000 +evm_finality_tag = true + +[CCIP.Env.Network.EVMNetworks.BSC_TESTNET] +evm_name = 'BSC Testnet' +evm_chain_id = 97 +evm_urls = ['wss://...'] +evm_http_urls = ['https://...'] +evm_keys = [''] +evm_simulated = false +client_implementation = 'BSC' +evm_chainlink_transaction_limit = 50000 +evm_transaction_timeout = '2m' +evm_minimum_confirmations = 3 +evm_gas_estimation_buffer = 0 +evm_supports_eip1559 = true +evm_default_gas_limit = 6000000 +evm_finality_tag = true + +[CCIP.Env.ExistingCLCluster] +Name = 'crib-ani' +NoOfNodes = 6 + +[[CCIP.Env.ExistingCLCluster.NodeConfigs]] +URL = 'https://crib-ani-demo-node1.main.stage.cldev.sh/' +Email = 'notreal@fakeemail.ch' +Password = 'fj293fbBnlQ!f9vNs' +InternalIP = 'app-node-1' + + +[[CCIP.Env.ExistingCLCluster.NodeConfigs]] +URL = 'https://crib-ani-demo-node2.main.stage.cldev.sh/' +Email = 'notreal@fakeemail.ch' +Password = 'fj293fbBnlQ!f9vNs' +InternalIP = 'app-node-2' + +[[CCIP.Env.ExistingCLCluster.NodeConfigs]] +URL = 'https://crib-ani-demo-node3.main.stage.cldev.sh/' +Email = 'notreal@fakeemail.ch' +Password = 'fj293fbBnlQ!f9vNs' +InternalIP = 'app-node-3' + +[[CCIP.Env.ExistingCLCluster.NodeConfigs]] +URL = 'https://crib-ani-demo-node4.main.stage.cldev.sh/' +Email = 'notreal@fakeemail.ch' +Password = 'fj293fbBnlQ!f9vNs' +InternalIP = 'app-node-4' + +[[CCIP.Env.ExistingCLCluster.NodeConfigs]] +URL = 'https://crib-ani-demo-node5.main.stage.cldev.sh/' +Email = 'notreal@fakeemail.ch' +Password = 'fj293fbBnlQ!f9vNs' +InternalIP = 'app-node-5' + +[[CCIP.Env.ExistingCLCluster.NodeConfigs]] +URL = 'https://crib-ani-demo-node6.main.stage.cldev.sh/' +Email = 'notreal@fakeemail.ch' +Password = 'fj293fbBnlQ!f9vNs' +InternalIP = 'app-node-6' + +[CCIP.Groups] +[CCIP.Groups.smoke] +LocalCluster = false +TestRunName = 'crib-ani-demo' +NodeFunding = 1000.0 + + +[CCIP.Groups.load] +LocalCluster = false + +[CCIP.Groups.load.LoadProfile] +TestRunName = 'crib-ani-demo' +TimeUnit = '1s' +TestDuration = '15m' +RequestPerUnitTime = [1] +NodeFunding = 1000.0 diff --git a/integration-tests/ccip-tests/testconfig/tomls/ccip-default.toml b/integration-tests/ccip-tests/testconfig/tomls/ccip-default.toml new file mode 100644 index 00000000000..b03f03a6dab --- /dev/null +++ b/integration-tests/ccip-tests/testconfig/tomls/ccip-default.toml @@ -0,0 +1,444 @@ +# this file contains the deafult configuration for the test +# all secrets must be stored in .env file and sourced before running the test +[CCIP] +[CCIP.ContractVersions] +PriceRegistry = 'latest' +OffRamp = 'latest' +OnRamp = 'latest' +CommitStore = 'latest' +TokenPool = 'latest' + +# all variables to set up the test environment +[CCIP.Env] +TTL = '5h' +# networks between which lanes will be set up and the messages will be sent +# if more than 2 networks are specified, then lanes will be set up between all possible pairs of networks +# for example , if Networks = ['SIMULATED_1', 'SIMULATED_2', 'SIMULATED_3'], +# then lanes will be set up between SIMULATED_1 and SIMULATED_2, SIMULATED_1 and SIMULATED_3, SIMULATED_2 and SIMULATED_3 +# default value is ['SIMULATED_1', 'SIMULATED_2'] which means that test will create two private geth networks from scratch and set up lanes between them +[CCIP.Env.Network] +selected_networks = ['SIMULATED_1', 'SIMULATED_2'] + +# PrivateEthereumNetworks.NETWORK_NAME contains the configuration of private ethereum network that includes ethereum version, evm node client, chain id, +# certain chain configurations, addresses to fund or custom docker images to be used. These are non-dev networks, but they all run just a single node. +[CCIP.Env.PrivateEthereumNetworks.SIMULATED_1] +# either eth1 or eth2 (for post-Merge); for eth2 Prysm is used for consensus layer. +ethereum_version = "eth1" +# geth, besu, erigon or nethermind +execution_layer = "geth" +# eth2-only, if set to true environment startup will wait until at least 1 epoch has been finalised +wait_for_finalization = false + +[CCIP.Env.PrivateEthereumNetworks.SIMULATED_1.EthereumChainConfig] +# eth2-only, the lower the value the faster the block production (3 is minimum) +seconds_per_slot = 3 +# eth2-only, the lower the value the faster the epoch finalisation (2 is minimum) +slots_per_epoch = 2 +# eht2-only, the lower tha value the faster the chain starts (10 is minimum) +genesis_delay = 15 +# eth2-only, number of validators +validator_count = 4 +chain_id = 1337 +# address that should be founded in genesis wih ETH +addresses_to_fund = [ + "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", + "0x70997970C51812dc3A010C7d01b50e0d17dc79C8", +] + +[CCIP.Env.PrivateEthereumNetworks.SIMULATED_1.EthereumChainConfig.HardForkEpochs] +# eth2-only, epoch at which chain will upgrade do Dencun or Deneb/Cancun (1 is minimum) +Deneb = 500 + +#[CCIP.Env.PrivateEthereumNetworks.SIMULATED_1.CustomDockerImages] +# custom docker image that will be used for execution layer client. It has to be one of: hyperledger/besu, nethermind/nethermind, thorax/erigon or ethereum/client-go. +# instead of using a specific tag you can also use "latest_available" to use latest published tag in Github or "latest_stable" to use latest stable release from Github +# (if corresponding Docker image on Docker Hub has not been published environment creation will fail). +#execution_layer="hyperledger/besu:latest_stable" + +[CCIP.Env.PrivateEthereumNetworks.SIMULATED_2] +ethereum_version = "eth1" +execution_layer = "geth" + +[CCIP.Env.PrivateEthereumNetworks.SIMULATED_2.EthereumChainConfig] +seconds_per_slot = 3 +slots_per_epoch = 2 +genesis_delay = 15 +validator_count = 4 +chain_id = 2337 +addresses_to_fund = [ + "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", + "0x70997970C51812dc3A010C7d01b50e0d17dc79C8", +] + +[CCIP.Env.PrivateEthereumNetworks.SIMULATED_2.EthereumChainConfig.HardForkEpochs] +Deneb = 500 + +[CCIP.Env.Logging] +test_log_collect = false # if set to true will save logs even if test did not fail + +[CCIP.Env.Logging.LogStream] +# supported targets: file, loki, in-memory. if empty no logs will be persistet +log_targets = ["file"] +# context timeout for starting log producer and also time-frame for requesting logs +log_producer_timeout = "10s" +# number of retries before log producer gives up and stops listening to logs +log_producer_retry_limit = 10 + +# these values will be used to set up chainlink DON +# along with these values, the secrets needs to be specified as part of .env variables +# +[CCIP.Env.NewCLCluster] +NoOfNodes = 6 # number of chainlink nodes to be set up in DON, including one bootstrap node +# if tests are run in k8s, then the following values will be used to set up chainlink nodes and postgresql database, +# in case of local deployment through docker container, these values will be ignored +# for k8s deployment, helm charts are used from https://github.com/smartcontractkit/chainlink-testing-framework/tree/main/charts/chainlink/templates +NodeMemory = '4Gi' # memory to be allocated to each chainlink node; only used if tests are in k8s +NodeCPU = '2' # cpu to be allocated to each chainlink node ; only used if tests are in k8s +DBMemory = '4Gi' # memory to be allocated to postgresql database ; only used if tests are in k8s +DBCPU = '2' # cpu to be allocated to postgresql database ; only used if tests are in k8s +DBCapacity = '10Gi' # disk space to be allocated to postgresql database ; only used if tests are in k8s in stateful deployment +IsStateful = true # if true, chainlink nodes and postgresql database will be deployed as stateful set in k8s +DBArgs = [ + 'shared_buffers=1536MB', + 'effective_cache_size=4096MB', + 'work_mem=64MB', +] # postgresql database arguments ; only used if tests are in k8s + +# these values will be used to set up chainlink DON, if all the chainlink nodes are deployed with same configuration +[CCIP.Env.NewCLCluster.Common] +Name = 'node1' # name of the chainlink node, used as prefix for all the chainlink node names , used for k8s deployment +DBImage = 'postgres' # postgresql database image to be used for k8s deployment +DBTag = '13.12' # postgresql database image tag to be used for k8s deployment +# override config toml file for chainlink nodes +BaseConfigTOML = """ +[Feature] +LogPoller = true +CCIP = true + +[Log] +Level = 'debug' +JSONConsole = true + +[Log.File] +MaxSize = '0b' + +[WebServer] +AllowOrigins = '*' +HTTPPort = 6688 +SecureCookies = false +HTTPWriteTimeout = '1m' + +[WebServer.RateLimit] +Authenticated = 2000 +Unauthenticated = 1000 + +[WebServer.TLS] +HTTPSPort = 0 + +[Database] +MaxIdleConns = 10 +MaxOpenConns = 20 +MigrateOnStartup = true + +[OCR2] +Enabled = true +DefaultTransactionQueueDepth = 0 + +[OCR] +Enabled = false +DefaultTransactionQueueDepth = 0 + +[P2P] +[P2P.V2] +Enabled = true +ListenAddresses = ['0.0.0.0:6690'] +AnnounceAddresses = ['0.0.0.0:6690'] +DeltaDial = '500ms' +DeltaReconcile = '5s' +""" + +# override config toml related to EVMNode configs for chainlink nodes; applicable to all EVM node configs in chainlink toml +CommonChainConfigTOML = """ +[GasEstimator] +PriceMax = '200 gwei' +LimitDefault = 6000000 +FeeCapDefault = '200 gwei' +""" + +# chainlink override config toml for EVMNode config specific to EVM chains with chain id as mentioned in the key +[CCIP.Env.NewCLCluster.Common.ChainConfigTOMLByChain] +# applicable for arbitrum-goerli chain +421613 = """ +[GasEstimator] +PriceMax = '400 gwei' +LimitDefault = 100000000 +FeeCapDefault = '200 gwei' +BumpThreshold = 60 +BumpPercent = 20 +BumpMin = '100 gwei' +""" + +# applicable for optimism-goerli chain +420 = """ +[GasEstimator] +PriceMax = '150 gwei' +LimitDefault = 6000000 +FeeCapDefault = '150 gwei' +BumpThreshold = 60 +BumpPercent = 20 +BumpMin = '100 gwei' + +[GasEstimator.BlockHistory] +BlockHistorySize = 200 +EIP1559FeeCapBufferBlocks = 0 +""" + +# applicable for base-goerli chain +84531 = """ +[GasEstimator] +PriceMax = '150 gwei' +LimitDefault = 6000000 +FeeCapDefault = '150 gwei' +BumpThreshold = 60 +BumpPercent = 20 +BumpMin = '100 gwei' + +[GasEstimator.BlockHistory] +BlockHistorySize = 200 +EIP1559FeeCapBufferBlocks = 0 +""" + +# applicable for avalanche-fuji chain +43113 = """ +[GasEstimator] +PriceMax = '200 gwei' +LimitDefault = 6000000 +FeeCapDefault = '200 gwei' +BumpThreshold = 60 +""" + +# applicable for sepolia chain +11155111 = """ +[GasEstimator] +PriceMax = '200 gwei' +LimitDefault = 6000000 +FeeCapDefault = '200 gwei' + +[GasEstimator.BlockHistory] +BlockHistorySize = 200 +EIP1559FeeCapBufferBlocks = 0 +""" + +# the following configs are specific to each test type, smoke, load , chaos, etc... +[CCIP.Groups] +[CCIP.Groups.smoke] +# uncomment the following with specific values of lane combinations to be tested, if you want to run your tests to run only on these specific network pairs +# if specific network pairs are not mentioned, then all the network pairs will be tested based on values in CCIP.Env.NetworkPairs and CCIP.Groups..NoOfNetworks +# if specified, CCIP.Groups..NetworkPairs takes precedence over CCIP.Env.NetworkPairs and CCIP.Groups..NoOfNetworks +#NetworkPairs = ['SEPOLIA,OPTIMISM_GOERLI','SEPOLIA,POLYGON_MUMBAI','AVALANCHE_FUJI,SEPOLIA','SEPOLIA,BASE_GOERLI','SEPOLIA,BSC_TESTNET','SEPOLIA,WEMIX_TESTNET','AVALANCHE_FUJI,OPTIMISM_GOERLI','AVALANCHE_FUJI,POLYGON_MUMBAI','AVALANCHE_FUJI,BSC_TESTNET','AVALANCHE_FUJI,BASE_GOERLI','OPTIMISM_GOERLI,BASE_GOERLI','OPTIMISM_GOERLI,POLYGON_MUMBAI','BSC_TESTNET,POLYGON_MUMBAI','BSC_TESTNET,BASE_GOERLI','WEMIX_TESTNET,KROMA_SEPOLIA'] + +KeepEnvAlive = false # if true, the test will not tear down the test environment after the test is finished +CommitAndExecuteOnSameDON = true # if true, and the test is building the env from scratch, same chainlink nodes will be used for Commit and Execution jobs. +AllowOutOfOrder = false # if true, all the lanes will allow out of order execution and it +# overrides settings from lane_config. To allow out of order execution per lane, then send "allow_out_of_order":true, similar to is_native_fee_token variable. +# Otherwise Commit and execution jobs will be set up in different nodes based on the number of nodes specified in NoOfCommitNodes and CCIP.Env.NewCLCluster.NoOfNodes +BiDirectionalLane = true # True uses both the lanes. If bidirectional is false only one way lane is set up. +NoOfCommitNodes = 5 # no of chainlink nodes with Commit job +PhaseTimeout = '10m' # Duration to wait for the each phase validation(SendRequested, Commit, RMN Blessing, Execution) to time-out. +LocalCluster = true # if true, the test will use the local docker container, otherwise it will use the k8s cluster +ExistingDeployment = false # true if the tests are run on existing environment with already set-up jobs, smart contracts, etc... +# In this case the test will only be used to send and verify ccip requests considering that lanes are already functioning. +# In case of ExistingDeployment = false, the test will deploy it's own contracts and spin up new chainlink nodes with ccip jobs. It will then use +# the newly deployed contracts to send and verify ccip requests. + +ReuseContracts = true # Whether to reuse the contracts deployed in the previous run. Default value is true unless specified +NodeFunding = 1.0 # Amount of native currency to fund the chainlink node with for each network. Default value is 1 for smoke and 20 for load unless specified +NoOfRoutersPerPair = 1 # denotes the number of routers to be deployed per network. mostly required for scalability tests. +MulticallInOneTx = false # if set to true, multiple ccip-send is grouped under one blockchain transaction +NoOfSendsInMulticall = 5 # if MulticallInOneTx=true , this denotes the number of ccip-sends to group in one transaction + +NoOfNetworks = 2 # this is used with Networks in `CCIP.Env`, `NoOfNetworks < len(CCIP.Env.Networks)` test only uses first NoOfNetworks from` CCIP.Env.Networks`. +# This value is ignored if CCIP.Groups..NetworkPairs is provided + + +[CCIP.Groups.smoke.MsgDetails] +MsgType = 'DataWithToken' # type of message to be sent, either 'Token' or 'DataWithToken' Or 'Data' +DestGasLimit = 100000 # change this to 0 gas limit if you are doing ccip-send to an EOA +DataLength = 1000 # length of the data to be sent in ccip message if MsgType = 'Data'/'DataWithToken' +NoOfTokens = 2 # number of bridge tokens to be sent in ccip message if MsgType = 'Token'/'DataWithToken' +AmountPerToken = 1 # amount to be sent for each bridge token in ccip message if MsgType = 'Token'/'DataWithToken' + +[CCIP.Groups.smoke.TokenConfig] +TimeoutForPriceUpdate = '15m' # Duration to wait for the price update to time-out. +# Now testing only with dynamic price getter (no pipeline). +# Could be removed once the pipeline is completely removed. +WithPipeline = false +NoOfTokensPerChain = 2 # number of bridge tokens to be deployed per network; if MsgType = 'Token'/'DataWithToken' +CCIPOwnerTokens = false # if true, the test will use deploy the tokens by the CCIPOwner, otherwise the tokens will be deployed by a non-owner account, only applicable for 1.5 pools and onwards + +#NoOfTokensWithDynamicPrice = 15 # number of tokens with dynamic price to be deployed +#DynamicPriceUpdateInterval ='15s' # Periodic interval to update the price of tokens, if there are tokens with dynamic price + +# uncomment the following if you want to run your tests with specific number of lanes; +# in this case out of all the possible lane combinations, only the ones with the specified number of lanes will be considered +# for example, if you have provided CCIP.Env.Networks = ['SIMULATED_1', 'SIMULATED_2', 'SIMULATED_3'] and CCIP.Groups..MaxNoOfLanes = 2, +# then only random combinations of 2 lanes from the following will be considered for the test : +# ['SIMULATED_1', 'SIMULATED_2'], ['SIMULATED_1', 'SIMULATED_3'], ['SIMULATED_2', 'SIMULATED_3'] +#MaxNoOfLanes = # maximum number of lanes to be added in the test; mainly used for scalability tests + + +[CCIP.Groups.load] +# uncomment the following with specific values of lane combinations to be tested, if you want to run your tests to run only on these specific network pairs +# if specific network pairs are not mentioned, then all the network pairs will be tested based on values in CCIP.Env.NetworkPairs and CCIP.Groups..NoOfNetworks +# if specified, CCIP.Groups..NetworkPairs takes precedence over CCIP.Env.NetworkPairs and CCIP.Groups..NoOfNetworks +#NetworkPairs = ['SEPOLIA,OPTIMISM_GOERLI','SEPOLIA,POLYGON_MUMBAI','AVALANCHE_FUJI,SEPOLIA','SEPOLIA,BASE_GOERLI','SEPOLIA,BSC_TESTNET','SEPOLIA,WEMIX_TESTNET','AVALANCHE_FUJI,OPTIMISM_GOERLI','AVALANCHE_FUJI,POLYGON_MUMBAI','AVALANCHE_FUJI,BSC_TESTNET','AVALANCHE_FUJI,BASE_GOERLI','OPTIMISM_GOERLI,BASE_GOERLI','OPTIMISM_GOERLI,POLYGON_MUMBAI','BSC_TESTNET,POLYGON_MUMBAI','BSC_TESTNET,BASE_GOERLI','WEMIX_TESTNET,KROMA_SEPOLIA'] + +KeepEnvAlive = false # same as above +CommitAndExecuteOnSameDON = true # same as above +AllowOutOfOrder = false # same as above +BiDirectionalLane = true # same as above +NoOfCommitNodes = 5 # same as above +PhaseTimeout = '10m' # same as above +LocalCluster = false # same as above +ExistingDeployment = false # same as above +ReuseContracts = true # same as above +NodeFunding = 20.0 # same as above +NoOfRoutersPerPair = 1 # same as above +MulticallInOneTx = false # same as above +NoOfSendsInMulticall = 5 # same as above +NoOfNetworks = 2 # same as above + +[CCIP.Groups.load.OffRampConfig] +BatchGasLimit = 11000000 + +[CCIP.Groups.load.LoadProfile] +RequestPerUnitTime = [1] # number of ccip requests to be sent per unit time +TimeUnit = '10s' # unit of time for RequestPerUnitTime +TestDuration = '10m' # load test duration, not used for smoke tests +WaitBetweenChaosDuringLoad = '2m' # Duration to wait between each chaos injection during load test; only valid for chaos tests +NetworkChaosDelay = '100ms' # Duration for network chaos delay; only valid for chaos tests using network chaos + +# uncomment the following if you want your test results to be reflected under CCIP test grafana dashboard with namespace label same as the value of the following variable +# TestRunName = __ i.e prod-testnet-2.7.1-ccip1.2.1-beta +# Message Frequency Distribution Example + +# The 'Frequencies' array configures the relative frequency of different message types. +# Each value in the array represents the relative frequency of a message type, +# determining how often each type appears relative to the others. +#[CCIP.Groups.load.LoadProfile.MsgProfile] +#Frequencies = [4, 12, 3, 1] + +# Example Breakdown: +# - Frequencies = [4, 12, 3, 1] +# - Total Sum of Frequencies = 4 + 12 + 3 + 1 = 20 +# - Percentages: +# - Message Type 1: (4 / 20) * 100% = 20% +# - Message Type 2: (12 / 20) * 100% = 60% +# - Message Type 3: (3 / 20) * 100% = 15% +# - Message Type 4: (1 / 20) * 100% = 5% +# These percentages reflect how often each message type should appear in the total set of messages. +# Please note - if the total set of messages is not equal to the multiple of sum of frequencies, the percentages will not be accurate. +[CCIP.Groups.load.LoadProfile.MsgProfile] +Frequencies = [1] # frequency of each message type in the MsgDetails + +[[CCIP.Groups.load.LoadProfile.MsgProfile.MsgDetails]] +MsgType = 'DataWithToken' # type of message to be sent, either 'Token' or 'DataWithToken' Or 'Data' +DestGasLimit = 100000 # change this to 0 gas limit if you are doing ccip-send to an EOA +DataLength = 1000 # length of the data to be sent in ccip message if MsgType = 'Data'/'DataWithToken' +NoOfTokens = 2 # number of bridge tokens to be sent in ccip message if MsgType = 'Token'/'DataWithToken' +AmountPerToken = 1 # amount to be sent for each bridge token in ccip message if MsgType = 'Token'/'DataWithToken' + + +[CCIP.Groups.load.TokenConfig] +TimeoutForPriceUpdate = '15m' # Duration to wait for the price update to time-out. +# Now testing only with dynamic price getter (no pipeline). +# Could be removed once the pipeline is completely removed. +WithPipeline = false +NoOfTokensPerChain = 2 # number of bridge tokens to be deployed per network; if MsgType = 'Token'/'DataWithToken' +CCIPOwnerTokens = false # if true, the test will use deploy the tokens by the CCIPOwner, otherwise the tokens and pools will be deployed by a non-owner account, +# only applicable for 1.5 pools and onwards, if you are running with pre-1.5 pools, then set this to true to deploy token pools by CCIPOwner, otherwise +# the test will fail + +#NoOfTokensWithDynamicPrice = 15 # number of tokens with dynamic price to be deployed +#DynamicPriceUpdateInterval ='15s' # Periodic interval to update the price of tokens, if there are tokens with dynamic price + +# uncomment the following if you want to run your tests with specific number of lanes; +# in this case out of all the possible lane combinations, only the ones with the specified number of lanes will be considered +# for example, if you have provided CCIP.Env.Networks = ['SIMULATED_1', 'SIMULATED_2', 'SIMULATED_3'] and CCIP.Groups..MaxNoOfLanes = 2, +# then only random combinations of 2 lanes from the following will be considered for the test : +# ['SIMULATED_1', 'SIMULATED_2'], ['SIMULATED_1', 'SIMULATED_3'], ['SIMULATED_2', 'SIMULATED_3'] +#MaxNoOfLanes = # maximum number of lanes to be added in the test; mainly used for scalability tests +# + +# Uncomment the following if you want to run your tests with updated OCR params +# otherwise test will use default OCR params from - +# https://github.com/smartcontractkit/chainlink/blob/develop/integration-tests/ccip-tests/contracts/contract_deployer.go#L729-L751 +## OCR Params +#CommitInflightExpiry = '2m' +#ExecInflightExpiry = '2m' +# +#[CCIP.Groups.load.CommitOCRParams] +#DeltaProgress = '2m' +#DeltaResend = '5s' +#DeltaRound = '75s' +#DeltaGrace = '5s' +#MaxDurationQuery = '100ms' +#MaxDurationObservation = '35s' +#MaxDurationReport = '10s' +#MaxDurationShouldAcceptFinalizedReport = '5s' +#MaxDurationShouldTransmitAcceptedReport = '10s' +# +#[CCIP.Groups.load.ExecOCRParams] +#DeltaProgress = '100s' +#DeltaResend = '5s' +#DeltaRound = '40s' +#DeltaGrace = '5s' +#MaxDurationQuery = '100ms' +#MaxDurationObservation = '20s' +#MaxDurationReport = '8s' +#MaxDurationShouldAcceptFinalizedReport = '5s' +#MaxDurationShouldTransmitAcceptedReport = '8s' + +[CCIP.Groups.chaos] +# uncomment the following with specific values of lane combinations to be tested, if you want to run your tests to run only on these specific network pairs +# if specific network pairs are not mentioned, then all the network pairs will be tested based on values in CCIP.Env.NetworkPairs and CCIP.Groups..NoOfNetworks +# if specified, CCIP.Groups..NetworkPairs takes precedence over CCIP.Env.NetworkPairs and CCIP.Groups..NoOfNetworks +#NetworkPairs = ['SEPOLIA,OPTIMISM_GOERLI','SEPOLIA,POLYGON_MUMBAI','AVALANCHE_FUJI,SEPOLIA','SEPOLIA,BASE_GOERLI','SEPOLIA,BSC_TESTNET','SEPOLIA,WEMIX_TESTNET','AVALANCHE_FUJI,OPTIMISM_GOERLI','AVALANCHE_FUJI,POLYGON_MUMBAI','AVALANCHE_FUJI,BSC_TESTNET','AVALANCHE_FUJI,BASE_GOERLI','OPTIMISM_GOERLI,BASE_GOERLI','OPTIMISM_GOERLI,POLYGON_MUMBAI','BSC_TESTNET,POLYGON_MUMBAI','BSC_TESTNET,BASE_GOERLI','WEMIX_TESTNET,KROMA_SEPOLIA'] +KeepEnvAlive = false +CommitAndExecuteOnSameDON = false +AllowOutOfOrder = false +BiDirectionalLane = true +NoOfCommitNodes = 5 +PhaseTimeout = '50m' +LocalCluster = false +ExistingDeployment = false +ReuseContracts = true +NodeFunding = 20.0 +NoOfRoutersPerPair = 1 +MulticallInOneTx = false +NoOfSendsInMulticall = 5 +NoOfNetworks = 2 +# chaos test settings +ChaosDuration = '10m' # Duration for whichever chaos will be injected; only valid for chaos tests + + +[CCIP.Groups.chaos.MsgDetails] +MsgType = 'DataWithToken' # type of message to be sent, either 'Token' or 'DataWithToken' Or 'Data' +DestGasLimit = 100000 # change this to 0 gas limit if you are doing ccip-send to an EOA +DataLength = 1000 # length of the data to be sent in ccip message if MsgType = 'Data'/'DataWithToken' +NoOfTokens = 2 # number of bridge tokens to be sent in ccip message if MsgType = 'Token'/'DataWithToken' +AmountPerToken = 1 # amount to be sent for each bridge token in ccip message if MsgType = 'Token'/'DataWithToken' + +[CCIP.Groups.chaos.TokenConfig] +TimeoutForPriceUpdate = '15m' # Duration to wait for the price update to time-out. +# Now testing only with dynamic price getter (no pipeline). +# Could be removed once the pipeline is completely removed. +WithPipeline = false +NoOfTokensPerChain = 2 # number of bridge tokens to be deployed per network; if MsgType = 'Token'/'DataWithToken' + +# uncomment the following if you want to run your tests with specific number of lanes; +# in this case out of all the possible lane combinations, only the ones with the specified number of lanes will be considered +# for example, if you have provided CCIP.Env.Networks = ['SIMULATED_1', 'SIMULATED_2', 'SIMULATED_3'] and CCIP.Groups..MaxNoOfLanes = 2, +# then only random combinations of 2 lanes from the following will be considered for the test : +# ['SIMULATED_1', 'SIMULATED_2'], ['SIMULATED_1', 'SIMULATED_3'], ['SIMULATED_2', 'SIMULATED_3'] +#MaxNoOfLanes = # maximum number of lanes to be added in the test; mainly used for scalability tests diff --git a/integration-tests/ccip-tests/testconfig/tomls/ccip-reorg.toml b/integration-tests/ccip-tests/testconfig/tomls/ccip-reorg.toml new file mode 100644 index 00000000000..afcba2247fd --- /dev/null +++ b/integration-tests/ccip-tests/testconfig/tomls/ccip-reorg.toml @@ -0,0 +1,64 @@ +[CCIP] +[CCIP.Env] +Mockserver = 'http://mockserver:1080' +[CCIP.Env.Network] +selected_networks= ['SIMULATED_1', 'SIMULATED_2'] + +[CCIP.Env.Network.EVMNetworks.SIMULATED_1] +evm_name = 'source-chain' +evm_chain_id = 1337 +evm_keys = ['59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d', '7c852118294e51e653712a81e05800f419141751be58f605c371e15141b007a6'] +evm_simulated = true +client_implementation = 'Ethereum' +evm_chainlink_transaction_limit = 5000 +evm_transaction_timeout = '3m' +evm_minimum_confirmations = 1 +evm_gas_estimation_buffer = 1000 +evm_supports_eip1559 = true +evm_default_gas_limit = 6000000 +evm_finality_depth = 10 + +[CCIP.Env.Network.EVMNetworks.SIMULATED_2] +evm_name = 'dest-chain' +evm_chain_id = 2337 +evm_keys = ['ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80', '7c852118294e51e653712a81e05800f419141751be58f605c371e15141b007a6'] +evm_simulated = true +client_implementation = 'Ethereum' +evm_chainlink_transaction_limit = 5000 +evm_transaction_timeout = '3m' +evm_minimum_confirmations = 1 +evm_gas_estimation_buffer = 1000 +evm_supports_eip1559 = true +evm_default_gas_limit = 6000000 +evm_finality_depth = 10 + +[CCIP.Env.NewCLCluster] +NoOfNodes = 6 +NodeMemory = '4Gi' +NodeCPU = '2' +DBMemory = '4Gi' +DBCPU = '2' +DBCapacity = '10Gi' +IsStateful = true +DBArgs = ['shared_buffers=1536MB', 'effective_cache_size=4096MB', 'work_mem=64MB'] + +[CCIP.Env.NewCLCluster.Common] +CommonChainConfigTOML = """ +LogPollInterval = '1s' +[HeadTracker] +HistoryDepth = 30 + +[GasEstimator] +PriceMax = '200 gwei' +LimitDefault = 6000000 +FeeCapDefault = '200 gwei' +""" + +[CCIP.Groups.smoke] +PhaseTimeout = '3m' # Duration to wait for the each phase validation(SendRequested, Commit, RMN Blessing, Execution) to time-out. +LocalCluster = true + +[CCIP.Groups.smoke.ReorgProfile] +FinalityDelta = 5 + + diff --git a/integration-tests/ccip-tests/testconfig/tomls/ccip1.4-stress/baseline.toml b/integration-tests/ccip-tests/testconfig/tomls/ccip1.4-stress/baseline.toml new file mode 100644 index 00000000000..d48c0b0f797 --- /dev/null +++ b/integration-tests/ccip-tests/testconfig/tomls/ccip1.4-stress/baseline.toml @@ -0,0 +1,189 @@ +## Baseline performance test on simulated environment (with chaos) +## 40 chains / 400 lanes +## historyDepth 200 / finalityDepth 200 +## block_time = 1s +## throughput 1msg / 5s +## 20% Token, 60% DataWithToken, 15% Regular size msgs, 5% Large msgs +## +## make test_load_ccip testimage=.dkr.ecr..amazonaws.com/chainlink-ccip-tests:ccip-develop \ +## testname=TestLoadCCIPStableRequestTriggeringWithNetworkChaos \ +## override_toml=./testconfig/tomls/ccip-1.4-stress/baseline.toml \ +## secret_toml=./testconfig/tomls/secrets.toml + +[CCIP] +[CCIP.ContractVersions] +PriceRegistry = '1.2.0' +OffRamp = '1.2.0' +OnRamp = '1.2.0' +TokenPool = '1.4.0' +CommitStore = '1.2.0' + +[CCIP.Env] +TTL = '8h' + +[CCIP.Env.Network] +selected_networks= ['PRIVATE-CHAIN-1', 'PRIVATE-CHAIN-2'] + +[CCIP.Env.Network.EVMNetworks.PRIVATE-CHAIN-1] +evm_name = 'private-chain-1' +evm_chain_id = 2337 +evm_urls = ['wss://ignore-this-url.com'] +evm_http_urls = ['https://ignore-this-url.com'] +evm_keys = ['59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d'] +evm_simulated = true +client_implementation = 'Ethereum' +evm_chainlink_transaction_limit = 5000 +evm_transaction_timeout = '3m' +evm_minimum_confirmations = 1 +evm_gas_estimation_buffer = 1000 +evm_supports_eip1559 = true +evm_default_gas_limit = 6000000 +evm_finality_depth = 200 + +[CCIP.Env.Network.EVMNetworks.PRIVATE-CHAIN-2] +evm_name = 'private-chain-2' +evm_chain_id = 1337 +evm_urls = ['wss://ignore-this-url.com'] +evm_http_urls = ['https://ignore-this-url.com'] +evm_keys = ['ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80'] +evm_simulated = true +client_implementation = 'Ethereum' +evm_chainlink_transaction_limit = 5000 +evm_transaction_timeout = '3m' +evm_minimum_confirmations = 1 +evm_gas_estimation_buffer = 1000 +evm_supports_eip1559 = true +evm_default_gas_limit = 6000000 +evm_finality_depth = 200 + +[CCIP.Env.Network.AnvilConfigs.PRIVATE-CHAIN-1] +block_time = 1 + +# +[CCIP.Env.Network.AnvilConfigs.PRIVATE-CHAIN-2] +block_time = 1 + +[CCIP.Env.NewCLCluster] +NoOfNodes = 17 +NodeMemory = '10Gi' +NodeCPU = '6' +DBMemory = '16Gi' +DBCPU = '4' +DBStorageClass = 'gp3' +PromPgExporter = true +DBCapacity = '50Gi' +IsStateful = true +DBArgs = ['shared_buffers=4096MB', 'effective_cache_size=8192MB', 'work_mem=128MB'] + +[CCIP.Env.NewCLCluster.Common] +BaseConfigTOML = """ +[Feature] +LogPoller = true +CCIP = true + +[Log] +Level = 'debug' +JSONConsole = true + +[Log.File] +MaxSize = '0b' + +[WebServer] +AllowOrigins = '*' +HTTPPort = 6688 +SecureCookies = false +HTTPWriteTimeout = '1m' + +[WebServer.RateLimit] +Authenticated = 2000 +Unauthenticated = 1000 + +[WebServer.TLS] +HTTPSPort = 0 + +[Database] +MaxIdleConns = 20 +MaxOpenConns = 30 +MigrateOnStartup = true + +[OCR2] +Enabled = true +DefaultTransactionQueueDepth = 0 + +[OCR] +Enabled = false +DefaultTransactionQueueDepth = 0 + +[P2P] +[P2P.V2] +Enabled = true +ListenAddresses = ['0.0.0.0:6690'] +AnnounceAddresses = ['0.0.0.0:6690'] +DeltaDial = '500ms' +DeltaReconcile = '5s' +""" + +CommonChainConfigTOML = """ +[HeadTracker] +HistoryDepth = 200 + +[GasEstimator] +PriceMax = '200 gwei' +LimitDefault = 6000000 +FeeCapDefault = '200 gwei' +""" + +[CCIP.Groups] +[CCIP.Groups.load] +KeepEnvAlive = true +NoOfCommitNodes = 16 +PhaseTimeout = '40m' +NodeFunding = 1000.0 +NoOfRoutersPerPair = 2 +NoOfNetworks = 40 +MaxNoOfLanes = 400 + +[CCIP.Groups.load.OffRampConfig] +BatchGasLimit = 11000000 + +[CCIP.Groups.load.TokenConfig] +TimeoutForPriceUpdate = '15m' +NoOfTokensPerChain = 10 +NoOfTokensWithDynamicPrice = 10 +DynamicPriceUpdateInterval ='15s' +CCIPOwnerTokens = true + +[CCIP.Groups.load.LoadProfile] +TestDuration = '4h' +TimeUnit = '5s' +RequestPerUnitTime = [1] +OptimizeSpace = true +NetworkChaosDelay = '100ms' + +# to represent 20%, 60%, 15%, 5% of the total messages +[CCIP.Groups.load.LoadProfile.MsgProfile] +Frequencies = [4,12,3,1] + +[[CCIP.Groups.load.LoadProfile.MsgProfile.MsgDetails]] +MsgType = 'Token' +DestGasLimit = 0 +DataLength = 0 +NoOfTokens = 1 +AmountPerToken = 1 + +[[CCIP.Groups.load.LoadProfile.MsgProfile.MsgDetails]] +MsgType = 'DataWithToken' +DestGasLimit = 500000 +DataLength = 5000 +NoOfTokens = 1 +AmountPerToken = 1 + +[[CCIP.Groups.load.LoadProfile.MsgProfile.MsgDetails]] +MsgType = 'Data' +DestGasLimit = 800000 +DataLength = 10000 + +[[CCIP.Groups.load.LoadProfile.MsgProfile.MsgDetails]] +MsgType = 'Data' +DestGasLimit = 2500000 +DataLength = 10000 diff --git a/integration-tests/ccip-tests/testconfig/tomls/ccip1.4-stress/sample-scalability.toml b/integration-tests/ccip-tests/testconfig/tomls/ccip1.4-stress/sample-scalability.toml new file mode 100644 index 00000000000..872a6ae565c --- /dev/null +++ b/integration-tests/ccip-tests/testconfig/tomls/ccip1.4-stress/sample-scalability.toml @@ -0,0 +1,129 @@ +[CCIP] +[CCIP.ContractVersions] +PriceRegistry = '1.2.0' +OffRamp = '1.2.0' +OnRamp = '1.2.0' +TokenPool = '1.4.0' +CommitStore = '1.2.0' + +[CCIP.Env] +TTL = '15h' + +[CCIP.Env.Network] +selected_networks= ['PRIVATE-CHAIN-1', 'PRIVATE-CHAIN-2'] + +[CCIP.Env.Network.EVMNetworks.PRIVATE-CHAIN-1] +evm_name = 'private-chain-1' +evm_chain_id = 2337 +evm_urls = ['wss://ignore-this-url.com'] +evm_http_urls = ['https://ignore-this-url.com'] +evm_keys = ['59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d'] +evm_simulated = true +client_implementation = 'Ethereum' +evm_chainlink_transaction_limit = 5000 +evm_transaction_timeout = '3m' +evm_minimum_confirmations = 1 +evm_gas_estimation_buffer = 1000 +evm_supports_eip1559 = true +evm_default_gas_limit = 6000000 +evm_finality_depth = 1 + +[CCIP.Env.Network.EVMNetworks.PRIVATE-CHAIN-2] +evm_name = 'private-chain-2' +evm_chain_id = 1337 +evm_urls = ['wss://ignore-this-url.com'] +evm_http_urls = ['https://ignore-this-url.com'] +evm_keys = ['ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80'] +evm_simulated = true +client_implementation = 'Ethereum' +evm_chainlink_transaction_limit = 5000 +evm_transaction_timeout = '3m' +evm_minimum_confirmations = 1 +evm_gas_estimation_buffer = 1000 +evm_supports_eip1559 = true +evm_default_gas_limit = 6000000 +evm_finality_depth = 1 + +[CCIP.Env.Network.AnvilConfigs.PRIVATE-CHAIN-1] +block_time = 1 +# +[CCIP.Env.Network.AnvilConfigs.PRIVATE-CHAIN-2] +block_time = 1 + +[CCIP.Env.NewCLCluster] +NoOfNodes = 17 +NodeMemory = '12Gi' +NodeCPU = '6' +DBMemory = '10Gi' +DBCPU = '2' +DBStorageClass = 'gp3' +PromPgExporter = true +DBCapacity = '50Gi' +IsStateful = true +DBArgs = ['shared_buffers=2048MB', 'effective_cache_size=4096MB', 'work_mem=64MB'] + +#[CCIP.Env.NewCLCluster.Common] +#CommonChainConfigTOML = """ +#[HeadTracker] +#HistoryDepth = 3000 +# +#[GasEstimator] +#PriceMax = '200 gwei' +#LimitDefault = 6000000 +#FeeCapDefault = '200 gwei' +#""" + +[CCIP.Groups] +[CCIP.Groups.load] +KeepEnvAlive = true +NoOfCommitNodes = 16 +PhaseTimeout = '40m' +NodeFunding = 1000.0 +NoOfRoutersPerPair = 2 +NoOfNetworks = 40 +MaxNoOfLanes = 200 + +[CCIP.Groups.load.OffRampConfig] +BatchGasLimit = 11000000 + +[CCIP.Groups.load.TokenConfig] +TimeoutForPriceUpdate = '15m' +NoOfTokensPerChain = 60 +NoOfTokensWithDynamicPrice = 15 +DynamicPriceUpdateInterval ='15s' +CCIPOwnerTokens = true + +[CCIP.Groups.load.LoadProfile] +TestDuration = '4h' +TimeUnit = '5s' +RequestPerUnitTime = [1] +OptimizeSpace = true +NetworkChaosDelay = '100ms' + +# to represent 20%, 60%, 15%, 5% of the total messages +[CCIP.Groups.load.LoadProfile.MsgProfile] +Frequencies = [4,12,3,1] + +[[CCIP.Groups.load.LoadProfile.MsgProfile.MsgDetails]] +MsgType = 'Token' +DestGasLimit = 0 +DataLength = 0 +NoOfTokens = 5 +AmountPerToken = 1 + +[[CCIP.Groups.load.LoadProfile.MsgProfile.MsgDetails]] +MsgType = 'DataWithToken' +DestGasLimit = 500000 +DataLength = 5000 +NoOfTokens = 5 +AmountPerToken = 1 + +[[CCIP.Groups.load.LoadProfile.MsgProfile.MsgDetails]] +MsgType = 'Data' +DestGasLimit = 800000 +DataLength = 10000 + +[[CCIP.Groups.load.LoadProfile.MsgProfile.MsgDetails]] +MsgType = 'Data' +DestGasLimit = 2500000 +DataLength = 10000 \ No newline at end of file diff --git a/integration-tests/ccip-tests/testconfig/tomls/ccip1.4-stress/tier-a.toml b/integration-tests/ccip-tests/testconfig/tomls/ccip1.4-stress/tier-a.toml new file mode 100644 index 00000000000..5270de7f6d4 --- /dev/null +++ b/integration-tests/ccip-tests/testconfig/tomls/ccip1.4-stress/tier-a.toml @@ -0,0 +1,240 @@ +## Baseline performance test on simulated environment (with chaos) +## 40 chains / 400 lanes +## historyDepth 200 / finalityDepth 200 +## block_time = 1s +## throughput 1msg / 5s +## 20% Token, 60% DataWithToken, 15% Regular size msgs, 5% Large msgs +## +## make test_load_ccip testimage=.dkr.ecr..amazonaws.com/chainlink-ccip-tests:ccip-develop \ +## testname=TestLoadCCIPStableRequestTriggeringWithNetworkChaos \ +## override_toml=./testconfig/tomls/ccip1.4-stress/tier-a.toml \ +## secret_toml=./testconfig/tomls/secrets.toml + +[CCIP] +[CCIP.ContractVersions] +PriceRegistry = '1.2.0' +OffRamp = '1.2.0' +OnRamp = '1.2.0' +TokenPool = '1.4.0' +CommitStore = '1.2.0' + +[CCIP.Env] +TTL = '8h' + +[CCIP.Env.Network] +selected_networks= ['PRIVATE-CHAIN-1', 'SLOW-CHAIN-1', 'SLOW-CHAIN-2', 'SLOW-CHAIN-3'] + +[CCIP.Env.Network.EVMNetworks.PRIVATE-CHAIN-1] +evm_name = 'private-chain-1' +evm_chain_id = 2337 +evm_urls = ['wss://ignore-this-url.com'] +evm_http_urls = ['https://ignore-this-url.com'] +evm_keys = ['59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d'] +evm_simulated = true +client_implementation = 'Ethereum' +evm_chainlink_transaction_limit = 5000 +evm_transaction_timeout = '3m' +evm_minimum_confirmations = 1 +evm_gas_estimation_buffer = 1000 +evm_supports_eip1559 = true +evm_default_gas_limit = 6000000 +evm_finality_depth = 1 + +[CCIP.Env.Network.EVMNetworks.SLOW-CHAIN-1] +evm_name = 'slow-chain-1' +evm_chain_id = 90000001 +evm_urls = ['wss://ignore-this-url.com'] +evm_http_urls = ['https://ignore-this-url.com'] +evm_keys = ['ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80'] +evm_simulated = true +client_implementation = 'Ethereum' +evm_chainlink_transaction_limit = 5000 +evm_transaction_timeout = '3m' +evm_minimum_confirmations = 1 +evm_gas_estimation_buffer = 1000 +evm_supports_eip1559 = true +evm_default_gas_limit = 6000000 +evm_finality_depth = 1 + +[CCIP.Env.Network.EVMNetworks.SLOW-CHAIN-2] +evm_name = 'slow-chain-2' +evm_chain_id = 90000002 +evm_urls = ['wss://ignore-this-url.com'] +evm_http_urls = ['https://ignore-this-url.com'] +evm_keys = ['ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80'] +evm_simulated = true +client_implementation = 'Ethereum' +evm_chainlink_transaction_limit = 5000 +evm_transaction_timeout = '3m' +evm_minimum_confirmations = 1 +evm_gas_estimation_buffer = 1000 +evm_supports_eip1559 = true +evm_default_gas_limit = 6000000 +evm_finality_depth = 1 + +[CCIP.Env.Network.EVMNetworks.SLOW-CHAIN-3] +evm_name = 'slow-chain-3' +evm_chain_id = 1337 +evm_urls = ['wss://ignore-this-url.com'] +evm_http_urls = ['https://ignore-this-url.com'] +evm_keys = ['ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80'] +evm_simulated = true +client_implementation = 'Ethereum' +evm_chainlink_transaction_limit = 5000 +evm_transaction_timeout = '3m' +evm_minimum_confirmations = 1 +evm_gas_estimation_buffer = 1000 +evm_supports_eip1559 = true +evm_default_gas_limit = 6000000 +evm_finality_depth = 1 + +[CCIP.Env.Network.AnvilConfigs.PRIVATE-CHAIN-1] +block_time = 2 + +# +[CCIP.Env.Network.AnvilConfigs.SLOW-CHAIN-1] +block_time = 12 + +[CCIP.Env.Network.AnvilConfigs.SLOW-CHAIN-2] +block_time = 12 + +[CCIP.Env.Network.AnvilConfigs.SLOW-CHAIN-3] +block_time = 12 + +[CCIP.Env.NewCLCluster] +NoOfNodes = 17 +NodeMemory = '10Gi' +NodeCPU = '6' +DBMemory = '16Gi' +DBCPU = '4' +DBStorageClass = 'gp3' +PromPgExporter = true +DBCapacity = '50Gi' +IsStateful = true +DBArgs = ['shared_buffers=4096MB', 'effective_cache_size=8192MB', 'work_mem=128MB'] + +[CCIP.Env.NewCLCluster.Common] +BaseConfigTOML = """ +[Feature] +LogPoller = true +CCIP = true + +[Log] +Level = 'debug' +JSONConsole = true + +[Log.File] +MaxSize = '0b' + +[WebServer] +AllowOrigins = '*' +HTTPPort = 6688 +SecureCookies = false +HTTPWriteTimeout = '1m' + +[WebServer.RateLimit] +Authenticated = 2000 +Unauthenticated = 1000 + +[WebServer.TLS] +HTTPSPort = 0 + +[Database] +MaxIdleConns = 20 +MaxOpenConns = 30 +MigrateOnStartup = true + +[OCR2] +Enabled = true +DefaultTransactionQueueDepth = 0 + +[OCR] +Enabled = false +DefaultTransactionQueueDepth = 0 + +[P2P] +[P2P.V2] +Enabled = true +ListenAddresses = ['0.0.0.0:6690'] +AnnounceAddresses = ['0.0.0.0:6690'] +DeltaDial = '500ms' +DeltaReconcile = '5s' +""" + +#CommonChainConfigTOML = """ +#[HeadTracker] +#HistoryDepth = 200 +# +#[GasEstimator] +#PriceMax = '200 gwei' +#LimitDefault = 6000000 +#FeeCapDefault = '200 gwei' +#""" + +[CCIP.Groups] +[CCIP.Groups.load] +DenselyConnectedNetworkChainIds = ['90000001', '90000002', '1337'] +KeepEnvAlive = true +NoOfCommitNodes = 16 +PhaseTimeout = '40m' +NodeFunding = 1000.0 +NoOfRoutersPerPair = 2 +NoOfNetworks = 40 +MaxNoOfLanes = 400 + +[CCIP.Groups.load.OffRampConfig] +BatchGasLimit = 11000000 + +[CCIP.Groups.load.TokenConfig] +TimeoutForPriceUpdate = '15m' +NoOfTokensPerChain = 60 +NoOfTokensWithDynamicPrice = 15 +DynamicPriceUpdateInterval ='5m' +CCIPOwnerTokens = true + +[CCIP.Groups.load.LoadProfile] +TestDuration = '4h' +OptimizeSpace = true +NetworkChaosDelay = '100ms' +TimeUnit = '5s' +RequestPerUnitTime = [1] + +[CCIP.Groups.load.LoadProfile.LoadFrequency.slow-chain-1] +TimeUnit = '10s' +RequestPerUnitTime = [1] + +[CCIP.Groups.load.LoadProfile.LoadFrequency.slow-chain-2] +TimeUnit = '10s' +RequestPerUnitTime = [1] + +[CCIP.Groups.load.LoadProfile.LoadFrequency.slow-chain-3] +TimeUnit = '10s' +RequestPerUnitTime = [1] + +# to represent 20%, 60%, 15%, 5% of the total messages +[CCIP.Groups.load.LoadProfile.MsgProfile] +Frequencies = [4,12,3,1] + +[[CCIP.Groups.load.LoadProfile.MsgProfile.MsgDetails]] +MsgType = 'Token' +DestGasLimit = 0 +DataLength = 0 +NoOfTokens = 5 +AmountPerToken = 1 + +[[CCIP.Groups.load.LoadProfile.MsgProfile.MsgDetails]] +MsgType = 'DataWithToken' +DestGasLimit = 500000 +DataLength = 5000 +NoOfTokens = 5 +AmountPerToken = 1 + +[[CCIP.Groups.load.LoadProfile.MsgProfile.MsgDetails]] +MsgType = 'Data' +DestGasLimit = 800000 +DataLength = 10000 + +[[CCIP.Groups.load.LoadProfile.MsgProfile.MsgDetails]] +MsgType = 'Data' +DestGasLimit = 2500000 +DataLength = 10000 \ No newline at end of file diff --git a/integration-tests/ccip-tests/testconfig/tomls/ccip1.4-stress/tier-b.toml b/integration-tests/ccip-tests/testconfig/tomls/ccip1.4-stress/tier-b.toml new file mode 100644 index 00000000000..e69de29bb2d diff --git a/integration-tests/ccip-tests/testconfig/tomls/contract-version1.4.toml b/integration-tests/ccip-tests/testconfig/tomls/contract-version1.4.toml new file mode 100644 index 00000000000..392b058e5c8 --- /dev/null +++ b/integration-tests/ccip-tests/testconfig/tomls/contract-version1.4.toml @@ -0,0 +1,13 @@ +[CCIP] +[CCIP.ContractVersions] +PriceRegistry = '1.2.0' +OffRamp = '1.2.0' +OnRamp = '1.2.0' +TokenPool = '1.4.0' +CommitStore = '1.2.0' + +[CCIP.Groups.smoke.TokenConfig] +CCIPOwnerTokens = true + +[CCIP.Groups.load.TokenConfig] +CCIPOwnerTokens = true \ No newline at end of file diff --git a/integration-tests/ccip-tests/testconfig/tomls/db-compatibility.toml b/integration-tests/ccip-tests/testconfig/tomls/db-compatibility.toml new file mode 100644 index 00000000000..9de5925cb11 --- /dev/null +++ b/integration-tests/ccip-tests/testconfig/tomls/db-compatibility.toml @@ -0,0 +1,34 @@ +[CCIP] +[CCIP.Env] +[CCIP.Env.NewCLCluster] +NoOfNodes = 6 + +[[CCIP.Env.NewCLCluster.Nodes]] +Name = 'node1' +DBImage = 'postgres' +DBTag = '13.14' + +[[CCIP.Env.NewCLCluster.Nodes]] +Name = 'node2' +DBImage = 'postgres' +DBTag = '12.18' + +[[CCIP.Env.NewCLCluster.Nodes]] +Name = 'node3' +DBImage = 'postgres' +DBTag = '14.11' + +[[CCIP.Env.NewCLCluster.Nodes]] +Name = 'node4' +DBImage = 'postgres' +DBTag = '14.8' + +[[CCIP.Env.NewCLCluster.Nodes]] +Name = 'node5' +DBImage = 'postgres' +DBTag = '15.6' + +[[CCIP.Env.NewCLCluster.Nodes]] +Name = 'node6' +DBImage = 'postgres' +DBTag = '15.6' diff --git a/integration-tests/ccip-tests/testconfig/tomls/leader-lane.toml b/integration-tests/ccip-tests/testconfig/tomls/leader-lane.toml new file mode 100644 index 00000000000..76b97ad97ba --- /dev/null +++ b/integration-tests/ccip-tests/testconfig/tomls/leader-lane.toml @@ -0,0 +1,4 @@ +[CCIP] +[CCIP.Groups.smoke] +NoOfNetworks = 4 +NoOfRoutersPerPair = 2 \ No newline at end of file diff --git a/integration-tests/ccip-tests/testconfig/tomls/load-with-arm-curse-uncurse.toml b/integration-tests/ccip-tests/testconfig/tomls/load-with-arm-curse-uncurse.toml new file mode 100644 index 00000000000..e49f1184af7 --- /dev/null +++ b/integration-tests/ccip-tests/testconfig/tomls/load-with-arm-curse-uncurse.toml @@ -0,0 +1,20 @@ +[CCIP] +[CCIP.Env] +TTL = '15h' + +[CCIP.Groups] +[CCIP.Groups.load] +KeepEnvAlive = true +PhaseTimeout = '50m' +NodeFunding = 1000.0 + + +[CCIP.Groups.load.LoadProfile] +RequestPerUnitTime = [1] +TimeUnit = '1m' +TestDuration = '30m' +SendMaxDataInEveryMsgCount = 0 + + + + diff --git a/integration-tests/ccip-tests/testconfig/tomls/node-post-upgrade-compatibility.toml b/integration-tests/ccip-tests/testconfig/tomls/node-post-upgrade-compatibility.toml new file mode 100644 index 00000000000..c1c6c651442 --- /dev/null +++ b/integration-tests/ccip-tests/testconfig/tomls/node-post-upgrade-compatibility.toml @@ -0,0 +1,45 @@ +[CCIP] +[CCIP.ContractVersions] +PriceRegistry = '1.2.0' +OffRamp = '1.2.0' +OnRamp = '1.2.0' +TokenPool = '1.4.0' +CommitStore = '1.2.0' + +[CCIP.Deployments] +DataFile = 'lane-config/.*.json' + +[CCIP.Env] +[CCIP.Env.NewCLCluster] +NoOfNodes = 6 + +[[CCIP.Env.NewCLCluster.Nodes]] +Name = 'node-1' + +[[CCIP.Env.NewCLCluster.Nodes]] +Name = 'node-2' +NeedsUpgrade = true + +[[CCIP.Env.NewCLCluster.Nodes]] +Name = 'node-3' +NeedsUpgrade = true + +[[CCIP.Env.NewCLCluster.Nodes]] +Name = 'node-4' +NeedsUpgrade = true + +[[CCIP.Env.NewCLCluster.Nodes]] +Name = 'node-5' +NeedsUpgrade = true + +[[CCIP.Env.NewCLCluster.Nodes]] +Name = 'node-6' +NeedsUpgrade = true + +[CCIP.Groups] +[CCIP.Groups.load] +LocalCluster = false +ExistingDeployment = true + +[CCIP.Groups.load.LoadProfile] +TestRunName = 'upgrade-test' \ No newline at end of file diff --git a/integration-tests/ccip-tests/testconfig/tomls/node-pre-upgrade-compatibility.toml b/integration-tests/ccip-tests/testconfig/tomls/node-pre-upgrade-compatibility.toml new file mode 100644 index 00000000000..36ada834193 --- /dev/null +++ b/integration-tests/ccip-tests/testconfig/tomls/node-pre-upgrade-compatibility.toml @@ -0,0 +1,13 @@ +[CCIP] +[CCIP.ContractVersions] +PriceRegistry = '1.2.0' +OffRamp = '1.2.0' +OnRamp = '1.2.0' +TokenPool = '1.4.0' +CommitStore = '1.2.0' + +[CCIP.Groups] +[CCIP.Groups.smoke] +LocalCluster = false +KeepEnvAlive = true +StoreLaneConfig = true \ No newline at end of file diff --git a/integration-tests/ccip-tests/testconfig/tomls/prod-testnet/load-prod-testnet.toml b/integration-tests/ccip-tests/testconfig/tomls/prod-testnet/load-prod-testnet.toml new file mode 100644 index 00000000000..f13965d5e67 --- /dev/null +++ b/integration-tests/ccip-tests/testconfig/tomls/prod-testnet/load-prod-testnet.toml @@ -0,0 +1,964 @@ +[CCIP] +[CCIP.ContractVersions] +PriceRegistry = '1.2.0' +OffRamp = '1.2.0' +OnRamp = '1.2.0' +TokenPool = '1.4.0' +CommitStore = '1.2.0' + + +[CCIP.Deployments] +Data = """ +{ + "lane_configs": { + "Arbitrum Sepolia": { + "is_native_fee_token": true, + "fee_token": "0xb1D4538B4571d411F07960EF2838Ce337FE1E80E", + "bridge_tokens": [ + ], + "bridge_tokens_pools": [ + ], + "price_aggregators": null, + "arm": "0x5EF7a726Fd21Fd9D77D34E3C56cfDD8691F7F0ac", + "router": "0x2a9C5afB0d0e4BAb2BCdaE109EC4b0c4Be15a165", + "price_registry": "0x89D5b13908b9063abCC6791dc724bF7B7c93634C", + "wrapped_native": "0xE591bf0A0CF924A0674d7792db046B23CEbF5f34", + "src_contracts": { + "Avalanche Fuji": { + "on_ramp": "0x1Cb56374296ED19E86F68fA437ee679FD7798DaA", + "deployed_at": 33999325 + }, + "Base Sepolia": { + "on_ramp": "0x7854E73C73e7F9bb5b0D5B4861E997f4C6E8dcC6", + "deployed_at": 9199926 + }, + "Gnosis Chiado": { + "on_ramp": "0x973CbE752258D32AE82b60CD1CB656Eebb588dF0", + "deployed_at": 42809650 + }, + "Optimism Sepolia": { + "on_ramp": "0x701Fe16916dd21EFE2f535CA59611D818B017877", + "deployed_at": 35180131 + }, + "Sepolia Testnet": { + "on_ramp": "0x4205E1Ca0202A248A5D42F5975A8FE56F3E302e9", + "deployed_at": 35180131 + }, + "WeMix Testnet": { + "on_ramp": "0xBD4106fBE4699FE212A34Cc21b10BFf22b02d959", + "deployed_at": 18816676 + } + }, + "dest_contracts": { + "Avalanche Fuji": { + "off_ramp": "0xcab0EF91Bee323d1A617c0a027eE753aFd6997E4", + "commit_store": "0x0d90b9b96cBFa0D01635ce12982ccE1b70827c7a", + "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" + }, + "Base Sepolia": { + "off_ramp": "0xc1982985720B959E66c19b64F783361Eb9B60F26", + "commit_store": "0x28F66bB336f6db713d6ad2a3bd1B7a531282A159", + "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" + }, + "Gnosis Chiado": { + "off_ramp": "0x935C26F9a9122E5F9a27f2d3803e74c75B94f5a3", + "commit_store": "0xEdb963Ec5c2E5AbdFdCF137eF44A445a7fa4787A", + "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" + }, + "Optimism Sepolia": { + "off_ramp": "0xfD404A89e1d195F0c65be1A9042C77745197659e", + "commit_store": "0x84B7B012c95f8A152B44Ab3e952f2dEE424fA8e1", + "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" + }, + "Sepolia Testnet": { + "off_ramp": "0x1c71f141b4630EBE52d6aF4894812960abE207eB", + "commit_store": "0xaB0c8Ba51E7Fa3E5693a4Fbb39473520FD85d173", + "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" + }, + "WeMix Testnet": { + "off_ramp": "0x262e16C8D42aa07bE13e58F81e7D9F62F6DE2830", + "commit_store": "0xc132eFAf929299E5ee704Fa6D9796CFa23Bb8b2C", + "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" + } + } + }, + "Avalanche Fuji": { + "fee_token": "0x0b9d5D9136855f6FEc3c0993feE6E9CE8a297846", + "bridge_tokens": [ + ], + "bridge_tokens_pools": [ + ], + "price_aggregators": null, + "arm": "0x0ea0D7B2b78DD3A926fC76d6875a287F0AEB158F", + "router": "0xF694E193200268f9a4868e4Aa017A0118C9a8177", + "price_registry": "0x19e157E5fb1DAec1aE4BaB113fdf077F980704AA", + "wrapped_native": "0xd00ae08403B9bbb9124bB305C09058E32C39A48c", + "src_contracts": { + "Arbitrum Sepolia": { + "on_ramp": "0x8bB16BEDbFd62D1f905ACe8DBBF2954c8EEB4f66", + "deployed_at": 31888860 + }, + "BSC Testnet": { + "on_ramp": "0xF25ECF1Aad9B2E43EDc2960cF66f325783245535", + "deployed_at": 33214865 + }, + "Base Sepolia": { + "on_ramp": "0x1A674645f3EB4147543FCA7d40C5719cbd997362", + "deployed_at": 31235262 + }, + "Gnosis Chiado": { + "on_ramp": "0x1532e5b204ee2b2244170c78E743CB9c168F4DF9", + "deployed_at": 32817266 + }, + "Optimism Sepolia": { + "on_ramp": "0xC334DE5b020e056d0fE766dE46e8d9f306Ffa1E2", + "deployed_at": 30396804 + }, + "Polygon Amoy": { + "on_ramp": "0x610F76A35E17DA4542518D85FfEa12645eF111Fc", + "deployed_at": 31982368 + }, + "Sepolia Testnet": { + "on_ramp": "0x5724B4Cc39a9690135F7273b44Dfd3BA6c0c69aD", + "deployed_at": 33214865 + }, + "WeMix Testnet": { + "on_ramp": "0x677B5ab5C8522d929166c064d5700F147b15fa33", + "deployed_at": 30436465 + } + }, + "dest_contracts": { + "Arbitrum Sepolia": { + "off_ramp": "0x90A74072e7B0c2d59e13aB4d8f93c8198c413194", + "commit_store": "0xf3458CFd2fdf4a6CF0Ce296d520DD21eB194828b", + "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" + }, + "BSC Testnet": { + "off_ramp": "0x10b28009E5D776F1f5AAA73941CE8953B8f42d26", + "commit_store": "0xacDD582F271eCF22FAd6764cCDe1c4a534b732A8", + "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" + }, + "Base Sepolia": { + "off_ramp": "0xdBdE8510226d1E060A3bf982b67705C67f5697e2", + "commit_store": "0x8Ee73BC9492b4182D289E5C1e66e40CD876CC00F", + "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" + }, + "Gnosis Chiado": { + "off_ramp": "0x56dF55aF5F0A4689f3364230587a68eD6A314fAd", + "commit_store": "0xabA7ff98094c4cc7A075812EefF2CD21f6400235", + "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" + }, + "Optimism Sepolia": { + "off_ramp": "0x3d7CbC95DCC33257F14D6Eb780c88Bd56C6335BB", + "commit_store": "0x1fcDC02edDfb405f378ba53cF9E6104feBcB7542", + "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" + }, + "Polygon Amoy": { + "off_ramp": "0x3e33290B90fD0FF30a3FA138934DF028E4eCA348", + "commit_store": "0xCFe3556Aa42d40be09BD23aa80448a19443BE5B1", + "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" + }, + "Sepolia Testnet": { + "off_ramp": "0x9e5e4324F8608D54A50a317832d456a392E4F8C2", + "commit_store": "0x92A51eD3F041B39EbD1e464C1f7cb1e8f8A8c63f", + "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" + }, + "WeMix Testnet": { + "off_ramp": "0xD0D338318bC6837b091FC7AB5F2a94B7783507d5", + "commit_store": "0xd9D479208235c7355848ff4aF26eB5aacfDC30c6", + "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" + } + } + }, + "BSC Testnet": { + "is_native_fee_token": true, + "fee_token": "0x84b9B910527Ad5C03A9Ca831909E21e236EA7b06", + "bridge_tokens": [ + ], + "bridge_tokens_pools": [ + ], + "price_aggregators": null, + "arm": "0xF9a21B587111e7E8745Fb8b13750014f19DB0014", + "router": "0xE1053aE1857476f36A3C62580FF9b016E8EE8F6f", + "price_registry": "0xCCDf022c9d31DC26Ebab4FB92432724a5b79809a", + "wrapped_native": "0xae13d989daC2f0dEbFf460aC112a837C89BAa7cd", + "src_contracts": { + "Avalanche Fuji": { + "on_ramp": "0xa2515683E99F50ADbE177519A46bb20FfdBaA5de", + "deployed_at": 40500000 + }, + "Base Sepolia": { + "on_ramp": "0x3E807220Ca84b997c0d1928162227b46C618e0c5", + "deployed_at": 37115558 + }, + "Gnosis Chiado": { + "on_ramp": "0x8735f991d41eA9cA9D2CC75cD201e4B7C866E63e", + "deployed_at": 40228352 + }, + "Polygon Amoy": { + "on_ramp": "0xf37CcbfC04adc1B56a46B36F811D52C744a1AF78", + "deployed_at": 39572254 + }, + "Sepolia Testnet": { + "on_ramp": "0xB1DE44B04C00eaFe9915a3C07a0CaeA4410537dF", + "deployed_at": 38150066 + }, + "WeMix Testnet": { + "on_ramp": "0x89268Afc1BEA0782a27ba84124E3F42b196af927", + "deployed_at": 38184995 + } + }, + "dest_contracts": { + "Avalanche Fuji": { + "off_ramp": "0x6e6fFCb6B4BED91ff0CC8C2e57EC029dA7DB80C2", + "commit_store": "0x38Bc38Bd824b6eE87571f9D3CFbe6D6E28E3Dc62", + "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" + }, + "Base Sepolia": { + "off_ramp": "0x2C61FD7E93Dc79422861282145c59B56dFbc3a8c", + "commit_store": "0x42fAe5B3605804CF6d08632d7A25864e24F792Ae", + "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" + }, + "Gnosis Chiado": { + "off_ramp": "0x71a44a60832B0F8B63232C9516e7E6aEc3A373Dc", + "commit_store": "0xAC24299a91b72d1Cb5B31147e3CF54964D896974", + "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" + }, + "Polygon Amoy": { + "off_ramp": "0x63440C7747d37bc6154b5538AE32b54FE0965AfA", + "commit_store": "0xAD22fA198CECfC534927aE1D480c460d5bB3460F", + "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" + }, + "Sepolia Testnet": { + "off_ramp": "0xf1c128Fe52Ea78CcAAB407509292E61ce38C1523", + "commit_store": "0x59dFD870dC4bd76A7B879A4f705Fdcd2595f85f9", + "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" + }, + "WeMix Testnet": { + "off_ramp": "0xfd9B19c3725da5B517aA705B848ff3f21F98280e", + "commit_store": "0x3c1F1412563188aBc8FE3fd53E8F1Cb601CaB4f9", + "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" + } + } + }, + "Base Sepolia": { + "is_native_fee_token": true, + "fee_token": "0xE4aB69C077896252FAFBD49EFD26B5D171A32410", + "bridge_tokens": [ + ], + "bridge_tokens_pools": [ + ], + "price_aggregators": null, + "arm": "0x5aA82cA372782d6CC33AA4C830Df2a91017A7e1b", + "router": "0xD3b06cEbF099CE7DA4AcCf578aaebFDBd6e88a93", + "price_registry": "0x4D20536e60832bE579Cd38E89Dc03d11E1741FbA", + "wrapped_native": "0x4200000000000000000000000000000000000006", + "src_contracts": { + "Arbitrum Sepolia": { + "on_ramp": "0x58622a80c6DdDc072F2b527a99BE1D0934eb2b50", + "deployed_at": 5146539 + }, + "Avalanche Fuji": { + "on_ramp": "0xAbA09a1b7b9f13E05A6241292a66793Ec7d43357", + "deployed_at": 7810235 + }, + "BSC Testnet": { + "on_ramp": "0xD806966beAB5A3C75E5B90CDA4a6922C6A9F0c9d", + "deployed_at": 5144127 + }, + "Gnosis Chiado": { + "on_ramp": "0x2Eff2d1BF5C557d6289D208a7a43608f5E3FeCc2", + "deployed_at": 9817141 + }, + "Optimism Sepolia": { + "on_ramp": "0x3b39Cd9599137f892Ad57A4f54158198D445D147", + "deployed_at": 5147649 + }, + "Sepolia Testnet": { + "on_ramp": "0x6486906bB2d85A6c0cCEf2A2831C11A2059ebfea", + "deployed_at": 7810235 + }, + "ethereum-testnet-sepolia-mode-1": { + "on_ramp": "0x3d0115386C01436870a2c47e6297962284E70BA6", + "deployed_at": 10409731 + } + }, + "dest_contracts": { + "Arbitrum Sepolia": { + "off_ramp": "0xd364C06ac99a82a00d3eFF9F2F78E4Abe4b9baAA", + "commit_store": "0xdE8d0f47a71eA3fDFBD3162271652f2847939097", + "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" + }, + "Avalanche Fuji": { + "off_ramp": "0xAd91214efFee446500940c764DF77AF18427294F", + "commit_store": "0x1242b6c5e0e349b8d4BCf0938f961C4B4f7EA3Fa", + "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" + }, + "BSC Testnet": { + "off_ramp": "0xd5E9508921434e8758f4540D55c1c066b7cc1598", + "commit_store": "0x1a86b29364D1B3fA3386329A361aA98A104b2742", + "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" + }, + "Gnosis Chiado": { + "off_ramp": "0x9Bb7e398ef9Acfe9cA584C39B1E233Cba62BB9f7", + "commit_store": "0x1F4B82cDebaC5e3a0Dd53183D47e51808B4a64cB", + "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" + }, + "Optimism Sepolia": { + "off_ramp": "0x86a3910908eCaAA31Fcd9F0fC8841D8E98f1511d", + "commit_store": "0xE99a87C9b5ed4D2b6060195DEea5106ffF655736", + "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" + }, + "Sepolia Testnet": { + "off_ramp": "0x189F61D9B886Dd2975D5Abc893c8Cf5f5effda71", + "commit_store": "0xEE7e27346DCD1e711348D0F7f7ECB53a9a3a08a7", + "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" + }, + "ethereum-testnet-sepolia-mode-1": { + "off_ramp": "0xB26647A23e8b4284375e5C74b77c9557aE709D03", + "commit_store": "0x4b4fEB401d3E613e1D6242E155C83A80BF9ac2C9", + "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" + } + } + }, + "Gnosis Chiado": { + "is_native_fee_token": true, + "fee_token": "0xDCA67FD8324990792C0bfaE95903B8A64097754F", + "bridge_tokens": [ + ], + "bridge_tokens_pools": [ + ], + "price_aggregators": null, + "arm": "0xb6f1Fe2CDE891eFd5Efd2A563C4C2F2549163718", + "router": "0x19b1bac554111517831ACadc0FD119D23Bb14391", + "price_registry": "0x2F4ACd1f8986c6B1788159C4c9a5fC3fceCCE363", + "wrapped_native": "0x18c8a7ec7897177E4529065a7E7B0878358B3BfF", + "src_contracts": { + "Arbitrum Sepolia": { + "on_ramp": "0x473b49fb592B54a4BfCD55d40E048431982879C9", + "deployed_at": 9718588 + }, + "Avalanche Fuji": { + "on_ramp": "0x610F76A35E17DA4542518D85FfEa12645eF111Fc", + "deployed_at": 9718676 + }, + "BSC Testnet": { + "on_ramp": "0xE48E6AA1fc7D0411acEA95F8C6CaD972A37721D4", + "deployed_at": 9718302 + }, + "Base Sepolia": { + "on_ramp": "0x41b4A51cAfb699D9504E89d19D71F92E886028a8", + "deployed_at": 9718513 + }, + "Optimism Sepolia": { + "on_ramp": "0xAae733212981e06D9C978Eb5148F8af03F54b6EF", + "deployed_at": 9718420 + }, + "Polygon Amoy": { + "on_ramp": "0x01800fCDd892e37f7829937271840A6F041bE62E", + "deployed_at": 9718194 + }, + "Sepolia Testnet": { + "on_ramp": "0x4ac7FBEc2A7298AbDf0E0F4fDC45015836C4bAFe", + "deployed_at": 8487681 + } + }, + "dest_contracts": { + "Arbitrum Sepolia": { + "off_ramp": "0x9aA82DBB53bf02096B771D40e9432A323a78fB26", + "commit_store": "0x5CdbA91aBC0cD81FC56bc10Ad1835C9E5fB38e5F", + "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" + }, + "Avalanche Fuji": { + "off_ramp": "0x3e33290B90fD0FF30a3FA138934DF028E4eCA348", + "commit_store": "0xCFe3556Aa42d40be09BD23aa80448a19443BE5B1", + "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" + }, + "BSC Testnet": { + "off_ramp": "0xbc4AD54e91b213D4279af92c0C5518c0b96cf62D", + "commit_store": "0xff84e8Dd4Fd17eaBb23b6AeA6e1981830e54389C", + "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" + }, + "Base Sepolia": { + "off_ramp": "0x4117953A5ceeF12f5B8C1E973b470ab83a8CebA6", + "commit_store": "0x94ad41296186E81f31e1ed0B1BcF5fa9e1721C27", + "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" + }, + "Optimism Sepolia": { + "off_ramp": "0x33d2898F8fb7714FD1661791766f40754982a343", + "commit_store": "0x55d6Df194472f02CD481e506A277c4A29D0D1bCc", + "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" + }, + "Polygon Amoy": { + "off_ramp": "0x450543b1d85ca79885851D7b74dc982981b78229", + "commit_store": "0x23B79d940A769FE31b4C867A8BAE80117f24Ca81", + "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" + }, + "Sepolia Testnet": { + "off_ramp": "0xbf9036529123DE264bFA0FC7362fE25B650D4B16", + "commit_store": "0x5f7F1abD5c5EdaF2636D58B980e85355AF0Ef80d", + "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" + } + } + }, + "Kroma Sepolia": { + "is_native_fee_token": true, + "fee_token": "0xa75cCA5b404ec6F4BB6EC4853D177FE7057085c8", + "bridge_tokens": [ + ], + "bridge_tokens_pools": [ + ], + "price_aggregators": null, + "arm": "0x1E4e4e0d6f6631A45C616F71a1A5cF208DB9eCDe", + "router": "0xA8C0c11bf64AF62CDCA6f93D3769B88BdD7cb93D", + "price_registry": "0xa1ed3A3aA29166C9c8448654A8cA6b7916BC8379", + "wrapped_native": "0x4200000000000000000000000000000000000001", + "src_contracts": { + "WeMix Testnet": { + "on_ramp": "0x6ea155Fc77566D9dcE01B8aa5D7968665dc4f0C5", + "deployed_at": 10290904 + } + }, + "dest_contracts": { + "WeMix Testnet": { + "off_ramp": "0xB602B6E5Caf08ac0C920EAE585aed100a8cF6f3B", + "commit_store": "0x89D5b13908b9063abCC6791dc724bF7B7c93634C", + "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" + } + } + }, + "Optimism Sepolia": { + "is_native_fee_token": true, + "fee_token": "0xE4aB69C077896252FAFBD49EFD26B5D171A32410", + "bridge_tokens": [ + ], + "bridge_tokens_pools": [ + ], + "price_aggregators": null, + "arm": "0xf06Ff5D2084295909119ca541E93635E7D582FFc", + "router": "0x114A20A10b43D4115e5aeef7345a1A71d2a60C57", + "price_registry": "0x782a7Ba95215f2F7c3dD4C153cbB2Ae3Ec2d3215", + "wrapped_native": "0x4200000000000000000000000000000000000006", + "src_contracts": { + "Arbitrum Sepolia": { + "on_ramp": "0x1a86b29364D1B3fA3386329A361aA98A104b2742", + "deployed_at": 10841494 + }, + "Avalanche Fuji": { + "on_ramp": "0x6b38CC6Fa938D5AB09Bdf0CFe580E226fDD793cE", + "deployed_at": 8677537 + }, + "Base Sepolia": { + "on_ramp": "0xe284D2315a28c4d62C419e8474dC457b219DB969", + "deployed_at": 7130524 + }, + "Gnosis Chiado": { + "on_ramp": "0x835a5b8e6CA17c2bB5A336c93a4E22478E6F1C8A", + "deployed_at": 11799783 + }, + "Polygon Amoy": { + "on_ramp": "0x2Cf26fb01E9ccDb831414B766287c0A9e4551089", + "deployed_at": 10813146 + }, + "Sepolia Testnet": { + "on_ramp": "0xC8b93b46BF682c39B3F65Aa1c135bC8A95A5E43a", + "deployed_at": 12165583 + }, + "WeMix Testnet": { + "on_ramp": "0xc7E53f6aB982af7A7C3e470c8cCa283d3399BDAd", + "deployed_at": 8733017 + } + }, + "dest_contracts": { + "Arbitrum Sepolia": { + "off_ramp": "0xDc2c7A3d8068C6F09F0F3648d24C84e372F6014d", + "commit_store": "0xb1aFb5cbE3c29b5Db71F21442BA9EfD450BC23C3", + "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" + }, + "Avalanche Fuji": { + "off_ramp": "0x1F350718e015EB20E5065C09F4A7a3f66888aEeD", + "commit_store": "0x98650A8EB59f75D93563aB34FcF603b1A30e4CBF", + "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" + }, + "Base Sepolia": { + "off_ramp": "0x0a750ca77369e03613d7640548F4b2b1c695c3Bb", + "commit_store": "0x8fEBC74C26129C8d7E60288C6dCCc75eb494aA3C", + "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" + }, + "Gnosis Chiado": { + "off_ramp": "0xCE2CE7F940B7c839384e5D7e079A6aE80e8AD6dB", + "commit_store": "0x1b9D78Ec1CEEC439F0b7eA6C428A1a607D9FA7e4", + "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" + }, + "Polygon Amoy": { + "off_ramp": "0xD667b5706592D0b040C78fEe5EE17D243b7dCB41", + "commit_store": "0x96101BA5250EE9295c193693C1e08A55bC593664", + "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" + }, + "Sepolia Testnet": { + "off_ramp": "0x260AF9b83e0d2Bb6C9015fC9f0BfF8858A0CCE68", + "commit_store": "0x7a0bB92Bc8663abe6296d0162A9b41a2Cb2E0358", + "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" + }, + "WeMix Testnet": { + "off_ramp": "0x9C08B7712af0344188aa5087D9e6aD0f47191037", + "commit_store": "0x4BE6DB0B884169a6A207fe5cad01eB4C025a13dB", + "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" + } + } + }, + "Polygon Amoy": { + "is_native_fee_token": true, + "fee_token": "0x0Fd9e8d3aF1aaee056EB9e802c3A762a667b1904", + "bridge_tokens": [ + ], + "bridge_tokens_pools": [ + ], + "price_aggregators": null, + "arm": "0x50b023c5b33AEe5Adef15C2E95C2fEC690a52fa1", + "router": "0x9C32fCB86BF0f4a1A8921a9Fe46de3198bb884B2", + "price_registry": "0xfb2f2A207dC428da81fbAFfDDe121761f8Be1194", + "wrapped_native": "0x360ad4f9a9A8EFe9A8DCB5f461c4Cc1047E1Dcf9", + "src_contracts": { + "Avalanche Fuji": { + "on_ramp": "0x8Fb98b3837578aceEA32b454f3221FE18D7Ce903", + "deployed_at": 6004551 + }, + "BSC Testnet": { + "on_ramp": "0xC6683ac4a0F62803Bec89a5355B36495ddF2C38b", + "deployed_at": 6005330 + }, + "Gnosis Chiado": { + "on_ramp": "0x2331F6D614C9Fd613Ff59a1aB727f1EDf6c37A68", + "deployed_at": 6897885 + }, + "Optimism Sepolia": { + "on_ramp": "0xA52cDAeb43803A80B3c0C2296f5cFe57e695BE11", + "deployed_at": 6004902 + }, + "Sepolia Testnet": { + "on_ramp": "0x35347A2fC1f2a4c5Eae03339040d0b83b09e6FDA", + "deployed_at": 6004056 + }, + "WeMix Testnet": { + "on_ramp": "0x26546096F64B5eF9A1DcDAe70Df6F4f8c2E10C61", + "deployed_at": 6005611 + } + }, + "dest_contracts": { + "Avalanche Fuji": { + "off_ramp": "0xa733ce82a84335b2E9D864312225B0F3D5d80600", + "commit_store": "0x09B0F93fC2111aE439e853884173AC5b2F809885", + "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" + }, + "BSC Testnet": { + "off_ramp": "0x948dfaa4842fc23e0e362Fe8D4396AaE4E6DF7EA", + "commit_store": "0x7F4e739D40E58BBd59dAD388171d18e37B26326f", + "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" + }, + "Gnosis Chiado": { + "off_ramp": "0x17c542a28e08AEF5697251601C7b2B621d153D42", + "commit_store": "0x811250c20fAB9a1b7ca245453aC214ba637fBEB5", + "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" + }, + "Optimism Sepolia": { + "off_ramp": "0xfFdE9E8c34A27BEBeaCcAcB7b3044A0A364455C9", + "commit_store": "0x74ED442ad211050e9C05Dc9A267E037E3d74A03B", + "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" + }, + "Sepolia Testnet": { + "off_ramp": "0xFb04129aD1EEDB741CC705ebC1978a7aB63e51f6", + "commit_store": "0x63f875240149d29136053C954Ca164a9BfA81F77", + "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" + }, + "WeMix Testnet": { + "off_ramp": "0xdE8451E952Eb43350614839cCAA84f7C8701a09C", + "commit_store": "0xaCdaBa07ECad81dc634458b98673931DD9d3Bc14", + "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" + } + } + }, + "Sepolia Testnet": { + "is_native_fee_token": true, + "fee_token": "0x779877A7B0D9E8603169DdbD7836e478b4624789", + "bridge_tokens": [ + ], + "bridge_tokens_pools": [ + ], + "price_aggregators": null, + "arm": "0xB4d360459F32Dd641Ef5A6985fFbAC5c4e5521aA", + "router": "0x0BF3dE8c5D3e8A2B34D2BEeB17ABfCeBaf363A59", + "price_registry": "0x9EF7D57a4ea30b9e37794E55b0C75F2A70275dCc", + "wrapped_native": "0x097D90c9d3E0B50Ca60e1ae45F6A81010f9FB534", + "src_contracts": { + "Arbitrum Sepolia": { + "on_ramp": "0xe4Dd3B16E09c016402585a8aDFdB4A18f772a07e", + "deployed_at": 5737506 + }, + "Avalanche Fuji": { + "on_ramp": "0x0477cA0a35eE05D3f9f424d88bC0977ceCf339D4", + "deployed_at": 5944649 + }, + "BSC Testnet": { + "on_ramp": "0xD990f8aFA5BCB02f95eEd88ecB7C68f5998bD618", + "deployed_at": 5383500 + }, + "Base Sepolia": { + "on_ramp": "0x2B70a05320cB069e0fB55084D402343F832556E7", + "deployed_at": 5619657 + }, + "Gnosis Chiado": { + "on_ramp": "0x3E842E3A79A00AFdd03B52390B1caC6306Ea257E", + "deployed_at": 5386355 + }, + "Optimism Sepolia": { + "on_ramp": "0x69CaB5A0a08a12BaFD8f5B195989D709E396Ed4d", + "deployed_at": 5937506 + }, + "Polygon Amoy": { + "on_ramp": "0x9f656e0361Fb5Df2ac446102c8aB31855B591692", + "deployed_at": 5723315 + }, + "WeMix Testnet": { + "on_ramp": "0xedFc22336Eb0B9B11Ff37C07777db27BCcDe3C65", + "deployed_at": 5393931 + }, + "celo-testnet-alfajores": { + "on_ramp": "0x3C86d16F52C10B2ff6696a0e1b8E0BcfCC085948", + "deployed_at": 5704643 + }, + "ethereum-testnet-sepolia-blast-1": { + "on_ramp": "0xDB75E9D9ca7577CcBd7232741be954cf26194a66", + "deployed_at": 6040848 + }, + "ethereum-testnet-sepolia-metis-1": { + "on_ramp": "0x1C4640914cd57c5f02a68048A0fbb0E12d904223", + "deployed_at": 6002793 + }, + "ethereum-testnet-sepolia-mode-1": { + "on_ramp": "0xc630fbD4D0F6AEB00aD0793FB827b54fBB78e981", + "deployed_at": 5970819 + } + }, + "dest_contracts": { + "Arbitrum Sepolia": { + "off_ramp": "0xF18896AB20a09A29e64fdEbA99FDb8EC328f43b1", + "commit_store": "0x93Ff9Dd39Dc01eac1fc4d2c9211D95Ee458CAB94", + "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" + }, + "Avalanche Fuji": { + "off_ramp": "0x000b26f604eAadC3D874a4404bde6D64a97d95ca", + "commit_store": "0x2dD9273F8208B8393350508131270A6574A69784", + "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" + }, + "BSC Testnet": { + "off_ramp": "0xdE2d8E126e08d675fCD7fFa5a6CE49925f3Dc692", + "commit_store": "0x0050ac355a82caB31194507f94174297bf0655A7", + "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" + }, + "Base Sepolia": { + "off_ramp": "0x31c0B81832B333419f0DfD36A69F502cF9094aed", + "commit_store": "0xDFcde9d698a2B32DB2537DC9B752Cadd1D846a52", + "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" + }, + "Gnosis Chiado": { + "off_ramp": "0x7db0115A0b3AAb01d30bf81123c5DD7B0C41Add5", + "commit_store": "0x6640723Ea801178c4383FA016b9781e7ef1016EF", + "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" + }, + "Optimism Sepolia": { + "off_ramp": "0xD50590D4438411EDe47029b0FD7901A7145E5Df6", + "commit_store": "0xe85EEE9Fd434A7b8a586Ee086E828abF41839479", + "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" + }, + "Polygon Amoy": { + "off_ramp": "0x5032cbC0C4aEeD25bb6E45D8B3fAF05DB0688C5d", + "commit_store": "0xe6201C9996Cc7B6E828E10CbE937E693d577D318", + "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" + }, + "WeMix Testnet": { + "off_ramp": "0x46b639a3C1a4CBfD326b94a2dB7415c27157282f", + "commit_store": "0x7b74554678816b045c1e7409327E086bD436aa46", + "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" + }, + "celo-testnet-alfajores": { + "off_ramp": "0xB435E0f73c18C5a12C324CA1d02F81F2C3e6e761", + "commit_store": "0xbc5d74957F171e75F92c8F0E1C317A25a56a416D", + "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" + }, + "ethereum-testnet-sepolia-blast-1": { + "off_ramp": "0x4e897e5cF3aC307F0541B2151A88bCD781c153a3", + "commit_store": "0xB656652841F347178e193951C4663652aCe36B74", + "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" + }, + "ethereum-testnet-sepolia-metis-1": { + "off_ramp": "0x4DB693A93E9d5196ECD42EC56CDEAe99dFC652ED", + "commit_store": "0xBfACd78F1412B6f93Ac23409bf456aFec1ABd845", + "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" + }, + "ethereum-testnet-sepolia-mode-1": { + "off_ramp": "0xbEfd8D65F6643De54F0b1268A3bf4618ff85dcB4", + "commit_store": "0x0C161D3470b45Cc677661654C30ce4AdE6aCD288", + "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" + } + } + }, + "WeMix Testnet": { + "is_native_fee_token": true, + "fee_token": "0x3580c7A817cCD41f7e02143BFa411D4EeAE78093", + "bridge_tokens": [ + ], + "bridge_tokens_pools": [ + ], + "price_aggregators": null, + "arm": "0x46fF31494651593973D9b38a872ED5B06f45A693", + "router": "0xA8C0c11bf64AF62CDCA6f93D3769B88BdD7cb93D", + "price_registry": "0x89D17571DB7C9540eeB36760E3c749C8fb984569", + "wrapped_native": "0xbE3686643c05f00eC46e73da594c78098F7a9Ae7", + "src_contracts": { + "Arbitrum Sepolia": { + "on_ramp": "0xA9DE3F7A617D67bC50c56baaCb9E0373C15EbfC6", + "deployed_at": 51216113 + }, + "Avalanche Fuji": { + "on_ramp": "0xC4aC84da458ba8e40210D2dF94C76E9a41f70069", + "deployed_at": 51214769 + }, + "BSC Testnet": { + "on_ramp": "0x5AD6eed6Be0ffaDCA4105050CF0E584D87E0c2F1", + "deployed_at": 51213771 + }, + "Kroma Sepolia": { + "on_ramp": "0x428C4dc89b6Bf908B82d77C9CBceA786ea8cc7D0", + "deployed_at": 51239062 + }, + "Optimism Sepolia": { + "on_ramp": "0x1961a7De751451F410391c251D4D4F98D71B767D", + "deployed_at": 51216748 + }, + "Polygon Amoy": { + "on_ramp": "0xd55148e841e76265B484d399eC71b7076ecB1216", + "deployed_at": 55378685 + }, + "Sepolia Testnet": { + "on_ramp": "0x4d57C6d8037C65fa66D6231844785a428310a735", + "deployed_at": 51239309 + } + }, + "dest_contracts": { + "Arbitrum Sepolia": { + "off_ramp": "0xeB1dFaB2464Bf0574D43e764E0c758f92e7ecAFb", + "commit_store": "0xcEaCa2B7890065c485f3E58657358a185Ad33791", + "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" + }, + "Avalanche Fuji": { + "off_ramp": "0x98e811Df9D2512f1aaf58D534607F583D6c54A4F", + "commit_store": "0x8e538351F6E5B2daF3c90C565C3738bca69a2716", + "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" + }, + "BSC Testnet": { + "off_ramp": "0xB0e7f0fCcD3c961C473E7c44D939C1cDb4Cec1cB", + "commit_store": "0x4B56D8d53f1A6e0117B09700067De99581aA5542", + "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" + }, + "Kroma Sepolia": { + "off_ramp": "0xD685D2d224dd6D0Db2D56497db6270D77D9a7966", + "commit_store": "0x7e062D6880779a0347e7742058C1b1Ee4AA0B137", + "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" + }, + "Optimism Sepolia": { + "off_ramp": "0xA5f97Bc69Bf06e7C37B93265c5457420A92c5F4b", + "commit_store": "0xd48b9213583074f518D8f4336FDf35370D450132", + "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" + }, + "Polygon Amoy": { + "off_ramp": "0x6c8f5999B06FDE17B11E4e3C1062b761766F960f", + "commit_store": "0x957c3c2056192e58A8485eF31165fC490d474239", + "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" + }, + "Sepolia Testnet": { + "off_ramp": "0x8AB103843ED9D28D2C5DAf5FdB9c3e1CE2B6c876", + "commit_store": "0x7d5297c5506ee2A7Ef121Da9bE02b6a6AD30b392", + "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" + } + } + }, + "celo-testnet-alfajores": { + "is_native_fee_token": true, + "fee_token": "0x32E08557B14FaD8908025619797221281D439071", + "bridge_tokens": [ + ], + "bridge_tokens_pools": [ + ], + "price_aggregators": null, + "arm": "0xbE8FD4b84ca8CC2cFAeeEf8dc1388E44860eeEeb", + "router": "0xb00E95b773528E2Ea724DB06B75113F239D15Dca", + "price_registry": "0x8F048206D11B2c69b8963E2EBd5968D141e022f4", + "wrapped_native": "0x99604d0e2EfE7ABFb58BdE565b5330Bb46Ab3Dca", + "src_contracts": { + "Sepolia Testnet": { + "on_ramp": "0x16a020c4bbdE363FaB8481262D30516AdbcfcFc8", + "deployed_at": 23561364 + } + }, + "dest_contracts": { + "Sepolia Testnet": { + "off_ramp": "0xa1b97F92D806BA040daf419AFC2765DC723683a4", + "commit_store": "0xcd92C0599Ac515e7588865cC45Eee21A74816aFc", + "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" + } + } + }, + "ethereum-testnet-sepolia-blast-1": { + "is_native_fee_token": true, + "fee_token": "0x02c359ebf98fc8BF793F970F9B8302bb373BdF32", + "bridge_tokens": [ + ], + "bridge_tokens_pools": [ + ], + "price_aggregators": null, + "arm": "0x9C32fCB86BF0f4a1A8921a9Fe46de3198bb884B2", + "router": "0xfb2f2A207dC428da81fbAFfDDe121761f8Be1194", + "price_registry": "0xc8acE9dF450FaD007755C6C9AB4f0e9c8626E29C", + "wrapped_native": "0x4200000000000000000000000000000000000023", + "src_contracts": { + "Sepolia Testnet": { + "on_ramp": "0x85Ef19FC4C63c70744995DC38CAAEC185E0c619f", + "deployed_at": 6429339 + } + }, + "dest_contracts": { + "Sepolia Testnet": { + "off_ramp": "0x92cD24C278D34C726f377703E50875d8f9535dC2", + "commit_store": "0xcE1b4D50CeD56850182Bd58Ace91171cB249B873", + "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" + } + } + }, + "ethereum-testnet-sepolia-metis-1": { + "is_native_fee_token": true, + "fee_token": "0x9870D6a0e05F867EAAe696e106741843F7fD116D", + "bridge_tokens": [ + ], + "bridge_tokens_pools": [ + ], + "price_aggregators": null, + "arm": "0x26546096F64B5eF9A1DcDAe70Df6F4f8c2E10C61", + "router": "0xaCdaBa07ECad81dc634458b98673931DD9d3Bc14", + "price_registry": "0x5DCE866b3ae6E0Ed153f0e149D7203A1B266cdF5", + "wrapped_native": "0x5c48e07062aC4E2Cf4b9A768a711Aef18e8fbdA0", + "src_contracts": { + "Sepolia Testnet": { + "on_ramp": "0x2Eff2d1BF5C557d6289D208a7a43608f5E3FeCc2", + "deployed_at": 858864 + } + }, + "dest_contracts": { + "Sepolia Testnet": { + "off_ramp": "0x9Bb7e398ef9Acfe9cA584C39B1E233Cba62BB9f7", + "commit_store": "0x1F4B82cDebaC5e3a0Dd53183D47e51808B4a64cB", + "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" + } + } + }, + "ethereum-testnet-sepolia-mode-1": { + "is_native_fee_token": true, + "fee_token": "0x925a4bfE64AE2bFAC8a02b35F78e60C29743755d", + "bridge_tokens": [ + ], + "bridge_tokens_pools": [ + ], + "price_aggregators": null, + "arm": "0x11545812A8d64e4A3A0Ec36b6F70D87b42Ce4a01", + "router": "0xc49ec0eB4beb48B8Da4cceC51AA9A5bD0D0A4c43", + "price_registry": "0xa733ce82a84335b2E9D864312225B0F3D5d80600", + "wrapped_native": "0x4200000000000000000000000000000000000006", + "src_contracts": { + "Base Sepolia": { + "on_ramp": "0x73f7E074bd7291706a0C5412f51DB46441B1aDCB", + "deployed_at": 14359909 + }, + "Sepolia Testnet": { + "on_ramp": "0xfFdE9E8c34A27BEBeaCcAcB7b3044A0A364455C9", + "deployed_at": 14359680 + } + }, + "dest_contracts": { + "Base Sepolia": { + "off_ramp": "0x137a38c6b1Ad20101F93516aB2159Df525309168", + "commit_store": "0x8F43d867969F14619895d71E0A5b89E0bb20bF70", + "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" + }, + "Sepolia Testnet": { + "off_ramp": "0xcD44cec849B6a8eBd5551D6DFeEcA452257Dfe4d", + "commit_store": "0xbA66f08733E6715D33edDfb5a5947676bb45d0e0", + "receiver_dapp": "0x1A2A69e3eB1382FE34Bc579AdD5Bae39e31d4A2c" + } + } + } + } +} +""" + +[CCIP.Env] +TTL = '8h' + +[CCIP.Env.Network] +selected_networks = [ + 'ARBITRUM_SEPOLIA', + 'AVALANCHE_FUJI', + 'OPTIMISM_SEPOLIA', + 'BASE_SEPOLIA', + 'BSC_TESTNET', + 'WEMIX_TESTNET', + 'SEPOLIA', + 'POLYGON_AMOY', + 'KROMA_SEPOLIA', + 'BLAST_SEPOLIA' +] + +[CCIP.Groups.load] +NetworkPairs = [ + 'AVALANCHE_FUJI,SEPOLIA', + 'OPTIMISM_SEPOLIA,BASE_SEPOLIA' +] + +BiDirectionalLane = true +PhaseTimeout = '45m' +ExistingDeployment = true + +NoOfTokensPerChain = 1 + +[CCIP.Groups.load.LoadProfile] +RequestPerUnitTime = [1] +TimeUnit = '5s' +TestDuration = '1h' +TestRunName = 'ccip-prod-testnet-stress' + +# to represent 20%, 60%, 15%, 5% of the total messages +[CCIP.Groups.load.LoadProfile.MsgProfile] +Frequencies = [4,12,3,1] + +[[CCIP.Groups.load.LoadProfile.MsgProfile.MsgDetails]] +MsgType = 'Token' +DestGasLimit = 0 +DataLength = 0 +NoOfTokens = 5 +AmountPerToken = 1 + +[[CCIP.Groups.load.LoadProfile.MsgProfile.MsgDetails]] +MsgType = 'DataWithToken' +DestGasLimit = 500000 +DataLength = 5000 +NoOfTokens = 5 +AmountPerToken = 1 + +[[CCIP.Groups.load.LoadProfile.MsgProfile.MsgDetails]] +MsgType = 'Data' +DestGasLimit = 800000 +DataLength = 10000 + +[[CCIP.Groups.load.LoadProfile.MsgProfile.MsgDetails]] +MsgType = 'Data' +DestGasLimit = 2500000 +DataLength = 10000 \ No newline at end of file diff --git a/integration-tests/ccip-tests/testconfig/tomls/prod-testnet/smoke-release-testing_native.toml b/integration-tests/ccip-tests/testconfig/tomls/prod-testnet/smoke-release-testing_native.toml new file mode 100644 index 00000000000..24e7cbc9c88 --- /dev/null +++ b/integration-tests/ccip-tests/testconfig/tomls/prod-testnet/smoke-release-testing_native.toml @@ -0,0 +1,1035 @@ +[CCIP] +[CCIP.ContractVersions] +PriceRegistry = 'latest' +OffRamp = 'latest' +OnRamp = 'latest' +CommitStore = 'latest' +TokenPool = 'latest' + + +[CCIP.Deployments] +Data = """ +{ + "lane_configs": { + "Arbitrum Sepolia": { + "is_native_fee_token": true, + "fee_token": "0xE591bf0A0CF924A0674d7792db046B23CEbF5f34", + "bridge_tokens": [ + "0xA8C0c11bf64AF62CDCA6f93D3769B88BdD7cb93D" + ], + "bridge_tokens_pools": [ + "0x99685281Ec520a003F1A726A5a8078c2124c1477" + ], + "arm": "0xbcBDf0aDEDC9a33ED5338Bdb4B6F7CE664DC2e8B", + "router": "0x2a9C5afB0d0e4BAb2BCdaE109EC4b0c4Be15a165", + "price_registry": "0x89D5b13908b9063abCC6791dc724bF7B7c93634C", + "wrapped_native": "0xE591bf0A0CF924A0674d7792db046B23CEbF5f34", + "src_contracts": { + "Avalanche Fuji": { + "on_ramp": "0x1Cb56374296ED19E86F68fA437ee679FD7798DaA", + "deployed_at": 0 + }, + "Base Sepolia": { + "on_ramp": "0x7854E73C73e7F9bb5b0D5B4861E997f4C6E8dcC6", + "deployed_at": 0 + }, + "Gnosis Chiado": { + "on_ramp": "0x973CbE752258D32AE82b60CD1CB656Eebb588dF0", + "deployed_at": 0 + }, + "Optimism Sepolia": { + "on_ramp": "0x701Fe16916dd21EFE2f535CA59611D818B017877", + "deployed_at": 0 + }, + "Sepolia Testnet": { + "on_ramp": "0x4205E1Ca0202A248A5D42F5975A8FE56F3E302e9", + "deployed_at": 0 + }, + "WeMix Testnet": { + "on_ramp": "0xBD4106fBE4699FE212A34Cc21b10BFf22b02d959", + "deployed_at": 0 + } + }, + "dest_contracts": { + "Avalanche Fuji": { + "off_ramp": "0xcab0EF91Bee323d1A617c0a027eE753aFd6997E4", + "commit_store": "0x0d90b9b96cBFa0D01635ce12982ccE1b70827c7a", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Base Sepolia": { + "off_ramp": "0xc1982985720B959E66c19b64F783361Eb9B60F26", + "commit_store": "0x28F66bB336f6db713d6ad2a3bd1B7a531282A159", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Gnosis Chiado": { + "off_ramp": "0x935C26F9a9122E5F9a27f2d3803e74c75B94f5a3", + "commit_store": "0xEdb963Ec5c2E5AbdFdCF137eF44A445a7fa4787A", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Optimism Sepolia": { + "off_ramp": "0xfD404A89e1d195F0c65be1A9042C77745197659e", + "commit_store": "0x84B7B012c95f8A152B44Ab3e952f2dEE424fA8e1", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Sepolia Testnet": { + "off_ramp": "0x1c71f141b4630EBE52d6aF4894812960abE207eB", + "commit_store": "0xaB0c8Ba51E7Fa3E5693a4Fbb39473520FD85d173", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "WeMix Testnet": { + "off_ramp": "0x262e16C8D42aa07bE13e58F81e7D9F62F6DE2830", + "commit_store": "0xc132eFAf929299E5ee704Fa6D9796CFa23Bb8b2C", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + } + } + }, + "Avalanche Fuji": { + "is_native_fee_token": true, + "fee_token": "0xd00ae08403B9bbb9124bB305C09058E32C39A48c", + "bridge_tokens": [ + "0xD21341536c5cF5EB1bcb58f6723cE26e8D8E90e4" + ], + "bridge_tokens_pools": [ + "0xEC1062cbDf4fBf31B3A6Aac62B6F6F123bb70E12" + ], + "arm": "0x7e28DD790214139798446A121cFe950B51304684", + "router": "0xF694E193200268f9a4868e4Aa017A0118C9a8177", + "price_registry": "0x19e157E5fb1DAec1aE4BaB113fdf077F980704AA", + "wrapped_native": "0xd00ae08403B9bbb9124bB305C09058E32C39A48c", + "src_contracts": { + "Arbitrum Sepolia": { + "on_ramp": "0x8bB16BEDbFd62D1f905ACe8DBBF2954c8EEB4f66", + "deployed_at": 0 + }, + "BSC Testnet": { + "on_ramp": "0xF25ECF1Aad9B2E43EDc2960cF66f325783245535", + "deployed_at": 0 + }, + "Base Sepolia": { + "on_ramp": "0x1A674645f3EB4147543FCA7d40C5719cbd997362", + "deployed_at": 0 + }, + "Gnosis Chiado": { + "on_ramp": "0x1532e5b204ee2b2244170c78E743CB9c168F4DF9", + "deployed_at": 0 + }, + "Optimism Sepolia": { + "on_ramp": "0xC334DE5b020e056d0fE766dE46e8d9f306Ffa1E2", + "deployed_at": 0 + }, + "Polygon Amoy": { + "on_ramp": "0x610F76A35E17DA4542518D85FfEa12645eF111Fc", + "deployed_at": 0 + }, + "Sepolia Testnet": { + "on_ramp": "0x5724B4Cc39a9690135F7273b44Dfd3BA6c0c69aD", + "deployed_at": 0 + }, + "WeMix Testnet": { + "on_ramp": "0x677B5ab5C8522d929166c064d5700F147b15fa33", + "deployed_at": 0 + } + }, + "dest_contracts": { + "Arbitrum Sepolia": { + "off_ramp": "0x90A74072e7B0c2d59e13aB4d8f93c8198c413194", + "commit_store": "0xf3458CFd2fdf4a6CF0Ce296d520DD21eB194828b", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "BSC Testnet": { + "off_ramp": "0x10b28009E5D776F1f5AAA73941CE8953B8f42d26", + "commit_store": "0xacDD582F271eCF22FAd6764cCDe1c4a534b732A8", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Base Sepolia": { + "off_ramp": "0xdBdE8510226d1E060A3bf982b67705C67f5697e2", + "commit_store": "0x8Ee73BC9492b4182D289E5C1e66e40CD876CC00F", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Gnosis Chiado": { + "off_ramp": "0x56dF55aF5F0A4689f3364230587a68eD6A314fAd", + "commit_store": "0xabA7ff98094c4cc7A075812EefF2CD21f6400235", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Optimism Sepolia": { + "off_ramp": "0x3d7CbC95DCC33257F14D6Eb780c88Bd56C6335BB", + "commit_store": "0x1fcDC02edDfb405f378ba53cF9E6104feBcB7542", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Polygon Amoy": { + "off_ramp": "0x3e33290B90fD0FF30a3FA138934DF028E4eCA348", + "commit_store": "0xCFe3556Aa42d40be09BD23aa80448a19443BE5B1", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Sepolia Testnet": { + "off_ramp": "0x9e5e4324F8608D54A50a317832d456a392E4F8C2", + "commit_store": "0x92A51eD3F041B39EbD1e464C1f7cb1e8f8A8c63f", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "WeMix Testnet": { + "off_ramp": "0xD0D338318bC6837b091FC7AB5F2a94B7783507d5", + "commit_store": "0xd9D479208235c7355848ff4aF26eB5aacfDC30c6", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + } + } + }, + "BSC Testnet": { + "is_native_fee_token": true, + "fee_token": "0xae13d989daC2f0dEbFf460aC112a837C89BAa7cd", + "bridge_tokens": [ + "0xbFA2ACd33ED6EEc0ed3Cc06bF1ac38d22b36B9e9" + ], + "bridge_tokens_pools": [ + "0x31eDe84776DA37e2404eE88d71c234e92cB672e5" + ], + "arm": "0x7D899D26F2E94fFcd4b440C3008B0C6BEfcD3cca", + "router": "0xE1053aE1857476f36A3C62580FF9b016E8EE8F6f", + "price_registry": "0xCCDf022c9d31DC26Ebab4FB92432724a5b79809a", + "wrapped_native": "0xae13d989daC2f0dEbFf460aC112a837C89BAa7cd", + "src_contracts": { + "Avalanche Fuji": { + "on_ramp": "0xa2515683E99F50ADbE177519A46bb20FfdBaA5de", + "deployed_at": 0 + }, + "Base Sepolia": { + "on_ramp": "0x3E807220Ca84b997c0d1928162227b46C618e0c5", + "deployed_at": 0 + }, + "Gnosis Chiado": { + "on_ramp": "0x8735f991d41eA9cA9D2CC75cD201e4B7C866E63e", + "deployed_at": 0 + }, + "Polygon Amoy": { + "on_ramp": "0xf37CcbfC04adc1B56a46B36F811D52C744a1AF78", + "deployed_at": 0 + }, + "Sepolia Testnet": { + "on_ramp": "0xB1DE44B04C00eaFe9915a3C07a0CaeA4410537dF", + "deployed_at": 0 + }, + "WeMix Testnet": { + "on_ramp": "0x89268Afc1BEA0782a27ba84124E3F42b196af927", + "deployed_at": 0 + } + }, + "dest_contracts": { + "Avalanche Fuji": { + "off_ramp": "0x6e6fFCb6B4BED91ff0CC8C2e57EC029dA7DB80C2", + "commit_store": "0x38Bc38Bd824b6eE87571f9D3CFbe6D6E28E3Dc62", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Base Sepolia": { + "off_ramp": "0x2C61FD7E93Dc79422861282145c59B56dFbc3a8c", + "commit_store": "0x42fAe5B3605804CF6d08632d7A25864e24F792Ae", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Gnosis Chiado": { + "off_ramp": "0x71a44a60832B0F8B63232C9516e7E6aEc3A373Dc", + "commit_store": "0xAC24299a91b72d1Cb5B31147e3CF54964D896974", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Polygon Amoy": { + "off_ramp": "0x63440C7747d37bc6154b5538AE32b54FE0965AfA", + "commit_store": "0xAD22fA198CECfC534927aE1D480c460d5bB3460F", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Sepolia Testnet": { + "off_ramp": "0xf1c128Fe52Ea78CcAAB407509292E61ce38C1523", + "commit_store": "0x59dFD870dC4bd76A7B879A4f705Fdcd2595f85f9", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "WeMix Testnet": { + "off_ramp": "0xfd9B19c3725da5B517aA705B848ff3f21F98280e", + "commit_store": "0x3c1F1412563188aBc8FE3fd53E8F1Cb601CaB4f9", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + } + } + }, + "Base Sepolia": { + "is_native_fee_token": true, + "fee_token": "0x4200000000000000000000000000000000000006", + "bridge_tokens": [ + "0x88A2d74F47a237a62e7A51cdDa67270CE381555e" + ], + "bridge_tokens_pools": [ + "0x875207858c691F192C606068f417dCf666b2EC6B" + ], + "arm": "0x7827dD0481EE18DB646bD250d20A8eA43da52146", + "router": "0xD3b06cEbF099CE7DA4AcCf578aaebFDBd6e88a93", + "price_registry": "0x4D20536e60832bE579Cd38E89Dc03d11E1741FbA", + "wrapped_native": "0x4200000000000000000000000000000000000006", + "src_contracts": { + "Arbitrum Sepolia": { + "on_ramp": "0x58622a80c6DdDc072F2b527a99BE1D0934eb2b50", + "deployed_at": 0 + }, + "Avalanche Fuji": { + "on_ramp": "0xAbA09a1b7b9f13E05A6241292a66793Ec7d43357", + "deployed_at": 0 + }, + "BSC Testnet": { + "on_ramp": "0xD806966beAB5A3C75E5B90CDA4a6922C6A9F0c9d", + "deployed_at": 0 + }, + "Gnosis Chiado": { + "on_ramp": "0x2Eff2d1BF5C557d6289D208a7a43608f5E3FeCc2", + "deployed_at": 0 + }, + "Mode Sepolia": { + "on_ramp": "0x3d0115386C01436870a2c47e6297962284E70BA6", + "deployed_at": 0 + }, + "Optimism Sepolia": { + "on_ramp": "0x3b39Cd9599137f892Ad57A4f54158198D445D147", + "deployed_at": 0 + }, + "Sepolia Testnet": { + "on_ramp": "0x6486906bB2d85A6c0cCEf2A2831C11A2059ebfea", + "deployed_at": 0 + } + }, + "dest_contracts": { + "Arbitrum Sepolia": { + "off_ramp": "0xd364C06ac99a82a00d3eFF9F2F78E4Abe4b9baAA", + "commit_store": "0xdE8d0f47a71eA3fDFBD3162271652f2847939097", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Avalanche Fuji": { + "off_ramp": "0xAd91214efFee446500940c764DF77AF18427294F", + "commit_store": "0x1242b6c5e0e349b8d4BCf0938f961C4B4f7EA3Fa", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "BSC Testnet": { + "off_ramp": "0xd5E9508921434e8758f4540D55c1c066b7cc1598", + "commit_store": "0x1a86b29364D1B3fA3386329A361aA98A104b2742", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Gnosis Chiado": { + "off_ramp": "0x9Bb7e398ef9Acfe9cA584C39B1E233Cba62BB9f7", + "commit_store": "0x1F4B82cDebaC5e3a0Dd53183D47e51808B4a64cB", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Mode Sepolia": { + "off_ramp": "0xB26647A23e8b4284375e5C74b77c9557aE709D03", + "commit_store": "0x4b4fEB401d3E613e1D6242E155C83A80BF9ac2C9", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Optimism Sepolia": { + "off_ramp": "0x86a3910908eCaAA31Fcd9F0fC8841D8E98f1511d", + "commit_store": "0xE99a87C9b5ed4D2b6060195DEea5106ffF655736", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Sepolia Testnet": { + "off_ramp": "0x189F61D9B886Dd2975D5Abc893c8Cf5f5effda71", + "commit_store": "0xEE7e27346DCD1e711348D0F7f7ECB53a9a3a08a7", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + } + } + }, + "Blast Sepolia": { + "is_native_fee_token": true, + "fee_token": "0x4200000000000000000000000000000000000023", + "bridge_tokens": [ + "0x8D122C3e8ce9C8B62b87d3551bDfD8C259Bb0771" + ], + "bridge_tokens_pools": [ + "0xFb04129aD1EEDB741CC705ebC1978a7aB63e51f6" + ], + "arm": "0x09c1Ed4b112Fb33e594F2aACfEF407e2F14d7F9b", + "router": "0xfb2f2A207dC428da81fbAFfDDe121761f8Be1194", + "price_registry": "0xc8acE9dF450FaD007755C6C9AB4f0e9c8626E29C", + "wrapped_native": "0x4200000000000000000000000000000000000023", + "src_contracts": { + "Sepolia Testnet": { + "on_ramp": "0x85Ef19FC4C63c70744995DC38CAAEC185E0c619f", + "deployed_at": 0 + } + }, + "dest_contracts": { + "Sepolia Testnet": { + "off_ramp": "0x92cD24C278D34C726f377703E50875d8f9535dC2", + "commit_store": "0xcE1b4D50CeD56850182Bd58Ace91171cB249B873", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + } + } + }, + "Celo Alfajores": { + "is_native_fee_token": true, + "fee_token": "0x99604d0e2EfE7ABFb58BdE565b5330Bb46Ab3Dca", + "bridge_tokens": [ + "0x7e503dd1dAF90117A1b79953321043d9E6815C72" + ], + "bridge_tokens_pools": [ + "0xC6683ac4a0F62803Bec89a5355B36495ddF2C38b" + ], + "arm": "0xEbe35aA4F5e707485484c992AF2069a457b9bBB1", + "router": "0xb00E95b773528E2Ea724DB06B75113F239D15Dca", + "price_registry": "0x8F048206D11B2c69b8963E2EBd5968D141e022f4", + "wrapped_native": "0x99604d0e2EfE7ABFb58BdE565b5330Bb46Ab3Dca", + "src_contracts": { + "Sepolia Testnet": { + "on_ramp": "0x16a020c4bbdE363FaB8481262D30516AdbcfcFc8", + "deployed_at": 0 + } + }, + "dest_contracts": { + "Sepolia Testnet": { + "off_ramp": "0xa1b97F92D806BA040daf419AFC2765DC723683a4", + "commit_store": "0xcd92C0599Ac515e7588865cC45Eee21A74816aFc", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + } + } + }, + "Gnosis Chiado": { + "is_native_fee_token": true, + "fee_token": "0x18c8a7ec7897177E4529065a7E7B0878358B3BfF", + "bridge_tokens": [ + "0xA189971a2c5AcA0DFC5Ee7a2C44a2Ae27b3CF389" + ], + "bridge_tokens_pools": [ + "0xF9a21B587111e7E8745Fb8b13750014f19DB0014" + ], + "arm": "0xfE4fB161D870D0F672Ed9C5A898569603f77983F", + "router": "0x19b1bac554111517831ACadc0FD119D23Bb14391", + "price_registry": "0x2F4ACd1f8986c6B1788159C4c9a5fC3fceCCE363", + "wrapped_native": "0x18c8a7ec7897177E4529065a7E7B0878358B3BfF", + "src_contracts": { + "Arbitrum Sepolia": { + "on_ramp": "0x473b49fb592B54a4BfCD55d40E048431982879C9", + "deployed_at": 0 + }, + "Avalanche Fuji": { + "on_ramp": "0x610F76A35E17DA4542518D85FfEa12645eF111Fc", + "deployed_at": 0 + }, + "BSC Testnet": { + "on_ramp": "0xE48E6AA1fc7D0411acEA95F8C6CaD972A37721D4", + "deployed_at": 0 + }, + "Base Sepolia": { + "on_ramp": "0x41b4A51cAfb699D9504E89d19D71F92E886028a8", + "deployed_at": 0 + }, + "Optimism Sepolia": { + "on_ramp": "0xAae733212981e06D9C978Eb5148F8af03F54b6EF", + "deployed_at": 0 + }, + "Polygon Amoy": { + "on_ramp": "0x01800fCDd892e37f7829937271840A6F041bE62E", + "deployed_at": 0 + }, + "Sepolia Testnet": { + "on_ramp": "0x4ac7FBEc2A7298AbDf0E0F4fDC45015836C4bAFe", + "deployed_at": 0 + } + }, + "dest_contracts": { + "Arbitrum Sepolia": { + "off_ramp": "0x9aA82DBB53bf02096B771D40e9432A323a78fB26", + "commit_store": "0x5CdbA91aBC0cD81FC56bc10Ad1835C9E5fB38e5F", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Avalanche Fuji": { + "off_ramp": "0x3e33290B90fD0FF30a3FA138934DF028E4eCA348", + "commit_store": "0xCFe3556Aa42d40be09BD23aa80448a19443BE5B1", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "BSC Testnet": { + "off_ramp": "0xbc4AD54e91b213D4279af92c0C5518c0b96cf62D", + "commit_store": "0xff84e8Dd4Fd17eaBb23b6AeA6e1981830e54389C", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Base Sepolia": { + "off_ramp": "0x4117953A5ceeF12f5B8C1E973b470ab83a8CebA6", + "commit_store": "0x94ad41296186E81f31e1ed0B1BcF5fa9e1721C27", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Optimism Sepolia": { + "off_ramp": "0x33d2898F8fb7714FD1661791766f40754982a343", + "commit_store": "0x55d6Df194472f02CD481e506A277c4A29D0D1bCc", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Polygon Amoy": { + "off_ramp": "0x450543b1d85ca79885851D7b74dc982981b78229", + "commit_store": "0x23B79d940A769FE31b4C867A8BAE80117f24Ca81", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Sepolia Testnet": { + "off_ramp": "0xbf9036529123DE264bFA0FC7362fE25B650D4B16", + "commit_store": "0x5f7F1abD5c5EdaF2636D58B980e85355AF0Ef80d", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + } + } + }, + "Kroma Sepolia": { + "is_native_fee_token": true, + "fee_token": "0x4200000000000000000000000000000000000001", + "bridge_tokens": [ + "0x6AC3e353D1DDda24d5A5416024d6E436b8817A4e" + ], + "bridge_tokens_pools": [ + "0x0eE8add19554C7bb1920A183Ed47b4FAB9Eb7601" + ], + "arm": "0x08f9Af992368FAc58C936A2c5eBc9092894CEa9b", + "router": "0xA8C0c11bf64AF62CDCA6f93D3769B88BdD7cb93D", + "price_registry": "0xa1ed3A3aA29166C9c8448654A8cA6b7916BC8379", + "wrapped_native": "0x4200000000000000000000000000000000000001", + "src_contracts": { + "WeMix Testnet": { + "on_ramp": "0x6ea155Fc77566D9dcE01B8aa5D7968665dc4f0C5", + "deployed_at": 0 + } + }, + "dest_contracts": { + "WeMix Testnet": { + "off_ramp": "0xB602B6E5Caf08ac0C920EAE585aed100a8cF6f3B", + "commit_store": "0x89D5b13908b9063abCC6791dc724bF7B7c93634C", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + } + } + }, + "Metis Sepolia": { + "is_native_fee_token": true, + "fee_token": "0x5c48e07062aC4E2Cf4b9A768a711Aef18e8fbdA0", + "bridge_tokens": [ + "0x20Aa09AAb761e2E600d65c6929A9fd1E59821D3f" + ], + "bridge_tokens_pools": [ + "0xdE8451E952Eb43350614839cCAA84f7C8701a09C" + ], + "arm": "0xf0607A9BDdB5F54dB59ACaA0837aFec2D1c95df6", + "router": "0xaCdaBa07ECad81dc634458b98673931DD9d3Bc14", + "price_registry": "0x5DCE866b3ae6E0Ed153f0e149D7203A1B266cdF5", + "wrapped_native": "0x5c48e07062aC4E2Cf4b9A768a711Aef18e8fbdA0", + "src_contracts": { + "Sepolia Testnet": { + "on_ramp": "0x2Eff2d1BF5C557d6289D208a7a43608f5E3FeCc2", + "deployed_at": 0 + } + }, + "dest_contracts": { + "Sepolia Testnet": { + "off_ramp": "0x9Bb7e398ef9Acfe9cA584C39B1E233Cba62BB9f7", + "commit_store": "0x1F4B82cDebaC5e3a0Dd53183D47e51808B4a64cB", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + } + } + }, + "Mode Sepolia": { + "is_native_fee_token": true, + "fee_token": "0x4200000000000000000000000000000000000006", + "bridge_tokens": [ + "0xB9d4e1141E67ECFedC8A8139b5229b7FF2BF16F5" + ], + "bridge_tokens_pools": [ + "0x20bBc874bE3Cd94C3E4689EDD5D89dD1cE8Cb7C4" + ], + "arm": "0x9eC8a0AbC75ce08978FAf67958482461bCd93B18", + "router": "0xc49ec0eB4beb48B8Da4cceC51AA9A5bD0D0A4c43", + "price_registry": "0xa733ce82a84335b2E9D864312225B0F3D5d80600", + "wrapped_native": "0x4200000000000000000000000000000000000006", + "src_contracts": { + "Base Sepolia": { + "on_ramp": "0x73f7E074bd7291706a0C5412f51DB46441B1aDCB", + "deployed_at": 0 + }, + "Sepolia Testnet": { + "on_ramp": "0xfFdE9E8c34A27BEBeaCcAcB7b3044A0A364455C9", + "deployed_at": 0 + } + }, + "dest_contracts": { + "Base Sepolia": { + "off_ramp": "0x137a38c6b1Ad20101F93516aB2159Df525309168", + "commit_store": "0x8F43d867969F14619895d71E0A5b89E0bb20bF70", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Sepolia Testnet": { + "off_ramp": "0xcD44cec849B6a8eBd5551D6DFeEcA452257Dfe4d", + "commit_store": "0xbA66f08733E6715D33edDfb5a5947676bb45d0e0", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + } + } + }, + "Optimism Sepolia": { + "is_native_fee_token": true, + "fee_token": "0x4200000000000000000000000000000000000006", + "bridge_tokens": [ + "0x8aF4204e30565DF93352fE8E1De78925F6664dA7" + ], + "bridge_tokens_pools": [ + "0x3Cc9364260D80F09ccAC1eE6B07366dB598900E6" + ], + "arm": "0xF51366F72184E22cF4a7a8362508DB0d3370392d", + "router": "0x114A20A10b43D4115e5aeef7345a1A71d2a60C57", + "price_registry": "0x782a7Ba95215f2F7c3dD4C153cbB2Ae3Ec2d3215", + "wrapped_native": "0x4200000000000000000000000000000000000006", + "src_contracts": { + "Arbitrum Sepolia": { + "on_ramp": "0x1a86b29364D1B3fA3386329A361aA98A104b2742", + "deployed_at": 0 + }, + "Avalanche Fuji": { + "on_ramp": "0x6b38CC6Fa938D5AB09Bdf0CFe580E226fDD793cE", + "deployed_at": 0 + }, + "Base Sepolia": { + "on_ramp": "0xe284D2315a28c4d62C419e8474dC457b219DB969", + "deployed_at": 0 + }, + "Gnosis Chiado": { + "on_ramp": "0x835a5b8e6CA17c2bB5A336c93a4E22478E6F1C8A", + "deployed_at": 0 + }, + "Polygon Amoy": { + "on_ramp": "0x2Cf26fb01E9ccDb831414B766287c0A9e4551089", + "deployed_at": 0 + }, + "Sepolia Testnet": { + "on_ramp": "0xC8b93b46BF682c39B3F65Aa1c135bC8A95A5E43a", + "deployed_at": 0 + }, + "WeMix Testnet": { + "on_ramp": "0xc7E53f6aB982af7A7C3e470c8cCa283d3399BDAd", + "deployed_at": 0 + } + }, + "dest_contracts": { + "Arbitrum Sepolia": { + "off_ramp": "0xDc2c7A3d8068C6F09F0F3648d24C84e372F6014d", + "commit_store": "0xb1aFb5cbE3c29b5Db71F21442BA9EfD450BC23C3", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Avalanche Fuji": { + "off_ramp": "0x1F350718e015EB20E5065C09F4A7a3f66888aEeD", + "commit_store": "0x98650A8EB59f75D93563aB34FcF603b1A30e4CBF", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Base Sepolia": { + "off_ramp": "0x0a750ca77369e03613d7640548F4b2b1c695c3Bb", + "commit_store": "0x8fEBC74C26129C8d7E60288C6dCCc75eb494aA3C", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Gnosis Chiado": { + "off_ramp": "0xCE2CE7F940B7c839384e5D7e079A6aE80e8AD6dB", + "commit_store": "0x1b9D78Ec1CEEC439F0b7eA6C428A1a607D9FA7e4", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Polygon Amoy": { + "off_ramp": "0xD667b5706592D0b040C78fEe5EE17D243b7dCB41", + "commit_store": "0x96101BA5250EE9295c193693C1e08A55bC593664", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Sepolia Testnet": { + "off_ramp": "0x260AF9b83e0d2Bb6C9015fC9f0BfF8858A0CCE68", + "commit_store": "0x7a0bB92Bc8663abe6296d0162A9b41a2Cb2E0358", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "WeMix Testnet": { + "off_ramp": "0x9C08B7712af0344188aa5087D9e6aD0f47191037", + "commit_store": "0x4BE6DB0B884169a6A207fe5cad01eB4C025a13dB", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + } + } + }, + "Polygon Amoy": { + "is_native_fee_token": true, + "fee_token": "0x360ad4f9a9A8EFe9A8DCB5f461c4Cc1047E1Dcf9", + "bridge_tokens": [ + "0xcab0EF91Bee323d1A617c0a027eE753aFd6997E4" + ], + "bridge_tokens_pools": [ + "0x3064fB3EA546EE09A63AB3bD93E83D8B8525C636" + ], + "arm": "0x8b88C39D2875157aB4CE4AD3814409523d539ee1", + "router": "0x9C32fCB86BF0f4a1A8921a9Fe46de3198bb884B2", + "price_registry": "0xfb2f2A207dC428da81fbAFfDDe121761f8Be1194", + "wrapped_native": "0x360ad4f9a9A8EFe9A8DCB5f461c4Cc1047E1Dcf9", + "src_contracts": { + "Avalanche Fuji": { + "on_ramp": "0x8Fb98b3837578aceEA32b454f3221FE18D7Ce903", + "deployed_at": 0 + }, + "BSC Testnet": { + "on_ramp": "0xC6683ac4a0F62803Bec89a5355B36495ddF2C38b", + "deployed_at": 0 + }, + "Gnosis Chiado": { + "on_ramp": "0x2331F6D614C9Fd613Ff59a1aB727f1EDf6c37A68", + "deployed_at": 0 + }, + "Optimism Sepolia": { + "on_ramp": "0xA52cDAeb43803A80B3c0C2296f5cFe57e695BE11", + "deployed_at": 0 + }, + "Sepolia Testnet": { + "on_ramp": "0x35347A2fC1f2a4c5Eae03339040d0b83b09e6FDA", + "deployed_at": 0 + }, + "WeMix Testnet": { + "on_ramp": "0x26546096F64B5eF9A1DcDAe70Df6F4f8c2E10C61", + "deployed_at": 0 + } + }, + "dest_contracts": { + "Avalanche Fuji": { + "off_ramp": "0xa733ce82a84335b2E9D864312225B0F3D5d80600", + "commit_store": "0x09B0F93fC2111aE439e853884173AC5b2F809885", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "BSC Testnet": { + "off_ramp": "0x948dfaa4842fc23e0e362Fe8D4396AaE4E6DF7EA", + "commit_store": "0x7F4e739D40E58BBd59dAD388171d18e37B26326f", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Gnosis Chiado": { + "off_ramp": "0x17c542a28e08AEF5697251601C7b2B621d153D42", + "commit_store": "0x811250c20fAB9a1b7ca245453aC214ba637fBEB5", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Optimism Sepolia": { + "off_ramp": "0xfFdE9E8c34A27BEBeaCcAcB7b3044A0A364455C9", + "commit_store": "0x74ED442ad211050e9C05Dc9A267E037E3d74A03B", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Sepolia Testnet": { + "off_ramp": "0xFb04129aD1EEDB741CC705ebC1978a7aB63e51f6", + "commit_store": "0x63f875240149d29136053C954Ca164a9BfA81F77", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "WeMix Testnet": { + "off_ramp": "0xdE8451E952Eb43350614839cCAA84f7C8701a09C", + "commit_store": "0xaCdaBa07ECad81dc634458b98673931DD9d3Bc14", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + } + } + }, + "Sepolia Testnet": { + "is_native_fee_token": true, + "fee_token": "0x097D90c9d3E0B50Ca60e1ae45F6A81010f9FB534", + "bridge_tokens": [ + "0xFd57b4ddBf88a4e07fF4e34C487b99af2Fe82a05" + ], + "bridge_tokens_pools": [ + "0x38d1ef9619Cd40cf5482C045660Ae7C82Ada062c" + ], + "arm": "0x27Da8735d8d1402cEc072C234759fbbB4dABBC4A", + "router": "0x0BF3dE8c5D3e8A2B34D2BEeB17ABfCeBaf363A59", + "price_registry": "0x9EF7D57a4ea30b9e37794E55b0C75F2A70275dCc", + "wrapped_native": "0x097D90c9d3E0B50Ca60e1ae45F6A81010f9FB534", + "src_contracts": { + "Arbitrum Sepolia": { + "on_ramp": "0xe4Dd3B16E09c016402585a8aDFdB4A18f772a07e", + "deployed_at": 0 + }, + "Avalanche Fuji": { + "on_ramp": "0x0477cA0a35eE05D3f9f424d88bC0977ceCf339D4", + "deployed_at": 0 + }, + "BSC Testnet": { + "on_ramp": "0xD990f8aFA5BCB02f95eEd88ecB7C68f5998bD618", + "deployed_at": 0 + }, + "Base Sepolia": { + "on_ramp": "0x2B70a05320cB069e0fB55084D402343F832556E7", + "deployed_at": 0 + }, + "Blast Sepolia": { + "on_ramp": "0xDB75E9D9ca7577CcBd7232741be954cf26194a66", + "deployed_at": 0 + }, + "Celo Alfajores": { + "on_ramp": "0x3C86d16F52C10B2ff6696a0e1b8E0BcfCC085948", + "deployed_at": 0 + }, + "Gnosis Chiado": { + "on_ramp": "0x3E842E3A79A00AFdd03B52390B1caC6306Ea257E", + "deployed_at": 0 + }, + "Metis Sepolia": { + "on_ramp": "0x1C4640914cd57c5f02a68048A0fbb0E12d904223", + "deployed_at": 0 + }, + "Mode Sepolia": { + "on_ramp": "0xc630fbD4D0F6AEB00aD0793FB827b54fBB78e981", + "deployed_at": 0 + }, + "Optimism Sepolia": { + "on_ramp": "0x69CaB5A0a08a12BaFD8f5B195989D709E396Ed4d", + "deployed_at": 0 + }, + "Polygon Amoy": { + "on_ramp": "0x9f656e0361Fb5Df2ac446102c8aB31855B591692", + "deployed_at": 0 + }, + "WeMix Testnet": { + "on_ramp": "0xedFc22336Eb0B9B11Ff37C07777db27BCcDe3C65", + "deployed_at": 0 + }, + "ZKSync Sepolia": { + "on_ramp": "0x1Acb3A885feA37bdA30AB99b99327b14391f500F", + "deployed_at": 0 + } + }, + "dest_contracts": { + "Arbitrum Sepolia": { + "off_ramp": "0xF18896AB20a09A29e64fdEbA99FDb8EC328f43b1", + "commit_store": "0x93Ff9Dd39Dc01eac1fc4d2c9211D95Ee458CAB94", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Avalanche Fuji": { + "off_ramp": "0x000b26f604eAadC3D874a4404bde6D64a97d95ca", + "commit_store": "0x2dD9273F8208B8393350508131270A6574A69784", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "BSC Testnet": { + "off_ramp": "0xdE2d8E126e08d675fCD7fFa5a6CE49925f3Dc692", + "commit_store": "0x0050ac355a82caB31194507f94174297bf0655A7", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Base Sepolia": { + "off_ramp": "0x31c0B81832B333419f0DfD36A69F502cF9094aed", + "commit_store": "0xDFcde9d698a2B32DB2537DC9B752Cadd1D846a52", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Blast Sepolia": { + "off_ramp": "0x4e897e5cF3aC307F0541B2151A88bCD781c153a3", + "commit_store": "0xB656652841F347178e193951C4663652aCe36B74", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Celo Alfajores": { + "off_ramp": "0xB435E0f73c18C5a12C324CA1d02F81F2C3e6e761", + "commit_store": "0xbc5d74957F171e75F92c8F0E1C317A25a56a416D", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Gnosis Chiado": { + "off_ramp": "0x7db0115A0b3AAb01d30bf81123c5DD7B0C41Add5", + "commit_store": "0x6640723Ea801178c4383FA016b9781e7ef1016EF", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Metis Sepolia": { + "off_ramp": "0x4DB693A93E9d5196ECD42EC56CDEAe99dFC652ED", + "commit_store": "0xBfACd78F1412B6f93Ac23409bf456aFec1ABd845", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Mode Sepolia": { + "off_ramp": "0xbEfd8D65F6643De54F0b1268A3bf4618ff85dcB4", + "commit_store": "0x0C161D3470b45Cc677661654C30ce4AdE6aCD288", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Optimism Sepolia": { + "off_ramp": "0xD50590D4438411EDe47029b0FD7901A7145E5Df6", + "commit_store": "0xe85EEE9Fd434A7b8a586Ee086E828abF41839479", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Polygon Amoy": { + "off_ramp": "0x5032cbC0C4aEeD25bb6E45D8B3fAF05DB0688C5d", + "commit_store": "0xe6201C9996Cc7B6E828E10CbE937E693d577D318", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "WeMix Testnet": { + "off_ramp": "0x46b639a3C1a4CBfD326b94a2dB7415c27157282f", + "commit_store": "0x7b74554678816b045c1e7409327E086bD436aa46", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "ZKSync Sepolia": { + "off_ramp": "0xBaABd4166C892a1081a26535875A8fA3f22937b2", + "commit_store": "0xfda2e83F4D3f42B7629134ecD6E4b29FB8A7A07B", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + } + } + }, + "WeMix Testnet": { + "is_native_fee_token": true, + "fee_token": "0xbE3686643c05f00eC46e73da594c78098F7a9Ae7", + "bridge_tokens": [ + "0xF4E4057FbBc86915F4b2d63EEFFe641C03294ffc" + ], + "bridge_tokens_pools": [ + "0x82A92B2863F93Be70D20660088Ec060720bA2fdb" + ], + "arm": "0x8f6cb63eD5e379722580DFF0A051C140C64F9619", + "router": "0xA8C0c11bf64AF62CDCA6f93D3769B88BdD7cb93D", + "price_registry": "0x89D17571DB7C9540eeB36760E3c749C8fb984569", + "wrapped_native": "0xbE3686643c05f00eC46e73da594c78098F7a9Ae7", + "src_contracts": { + "Arbitrum Sepolia": { + "on_ramp": "0xA9DE3F7A617D67bC50c56baaCb9E0373C15EbfC6", + "deployed_at": 0 + }, + "Avalanche Fuji": { + "on_ramp": "0xC4aC84da458ba8e40210D2dF94C76E9a41f70069", + "deployed_at": 0 + }, + "BSC Testnet": { + "on_ramp": "0x5AD6eed6Be0ffaDCA4105050CF0E584D87E0c2F1", + "deployed_at": 0 + }, + "Kroma Sepolia": { + "on_ramp": "0x428C4dc89b6Bf908B82d77C9CBceA786ea8cc7D0", + "deployed_at": 0 + }, + "Optimism Sepolia": { + "on_ramp": "0x1961a7De751451F410391c251D4D4F98D71B767D", + "deployed_at": 0 + }, + "Polygon Amoy": { + "on_ramp": "0xd55148e841e76265B484d399eC71b7076ecB1216", + "deployed_at": 0 + }, + "Sepolia Testnet": { + "on_ramp": "0x4d57C6d8037C65fa66D6231844785a428310a735", + "deployed_at": 0 + } + }, + "dest_contracts": { + "Arbitrum Sepolia": { + "off_ramp": "0xeB1dFaB2464Bf0574D43e764E0c758f92e7ecAFb", + "commit_store": "0xcEaCa2B7890065c485f3E58657358a185Ad33791", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Avalanche Fuji": { + "off_ramp": "0x98e811Df9D2512f1aaf58D534607F583D6c54A4F", + "commit_store": "0x8e538351F6E5B2daF3c90C565C3738bca69a2716", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "BSC Testnet": { + "off_ramp": "0xB0e7f0fCcD3c961C473E7c44D939C1cDb4Cec1cB", + "commit_store": "0x4B56D8d53f1A6e0117B09700067De99581aA5542", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Kroma Sepolia": { + "off_ramp": "0xD685D2d224dd6D0Db2D56497db6270D77D9a7966", + "commit_store": "0x7e062D6880779a0347e7742058C1b1Ee4AA0B137", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Optimism Sepolia": { + "off_ramp": "0xA5f97Bc69Bf06e7C37B93265c5457420A92c5F4b", + "commit_store": "0xd48b9213583074f518D8f4336FDf35370D450132", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Polygon Amoy": { + "off_ramp": "0x6c8f5999B06FDE17B11E4e3C1062b761766F960f", + "commit_store": "0x957c3c2056192e58A8485eF31165fC490d474239", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Sepolia Testnet": { + "off_ramp": "0x8AB103843ED9D28D2C5DAf5FdB9c3e1CE2B6c876", + "commit_store": "0x7d5297c5506ee2A7Ef121Da9bE02b6a6AD30b392", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + } + } + }, + "ZKSync Sepolia": { + "is_native_fee_token": true, + "fee_token": "0x4317b2eCD41851173175005783322D29E9bAee9E", + "arm": "0x926b4f90610Aa448f27c8e0Fd0afa4A17B7305F9", + "router": "0xA1fdA8aa9A8C4b945C45aD30647b01f07D7A0B16", + "price_registry": "0x648B6BB09bE1C5766C8AC578B9B4aC8497eA671F", + "wrapped_native": "0x4317b2eCD41851173175005783322D29E9bAee9E", + "src_contracts": { + "Sepolia Testnet": { + "on_ramp": "0x79a9a5e9e318e8e109776569574814bbf935125a", + "deployed_at": 0 + } + }, + "dest_contracts": { + "Sepolia Testnet": { + "off_ramp": "0x18FF69051479796175852578725Fc74F58E963F8", + "commit_store": "0xF694b4FD7889480dca3CD41244e8e3395a9EFBa0", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + } + } + } + } +} +""" + +[CCIP.Env] +TTL = '8h' + +[CCIP.Env.Network] +selected_networks = [ + 'ARBITRUM_SEPOLIA', + 'AVALANCHE_FUJI', + 'BASE_SEPOLIA', + 'BLAST_SEPOLIA', + 'BSC_TESTNET', + 'CELO_ALFAJORES', + 'GNOSIS_CHIADO', + 'KROMA_SEPOLIA', + 'MODE_SEPOLIA', + 'OPTIMISM_SEPOLIA', + 'POLYGON_AMOY', + 'SEPOLIA', + 'METIS_SEPOLIA', + 'WEMIX_TESTNET', + 'ZKSYNC_SEPOLIA' +] + +[CCIP.Groups.smoke] +# these are all the valid network pairs +NetworkPairs = [ + 'SEPOLIA,AVALANCHE_FUJI', + 'SEPOLIA,BSC_TESTNET', + 'SEPOLIA,CELO_ALFAJORES', + 'SEPOLIA,ARBITRUM_SEPOLIA', + 'SEPOLIA,BASE_SEPOLIA', + 'SEPOLIA,BLAST_SEPOLIA', + 'SEPOLIA,MODE_SEPOLIA', + 'SEPOLIA,OPTIMISM_SEPOLIA', + 'SEPOLIA,POLYGON_AMOY', + 'SEPOLIA,WEMIX_TESTNET', + 'SEPOLIA,GNOSIS_CHIADO', + 'SEPOLIA,METIS_SEPOLIA', + 'SEPOLIA,ZKSYNC_SEPOLIA', + + 'AVALANCHE_FUJI,BSC_TESTNET', + 'AVALANCHE_FUJI,ARBITRUM_SEPOLIA', + 'AVALANCHE_FUJI,BASE_SEPOLIA', + 'AVALANCHE_FUJI,OPTIMISM_SEPOLIA', + 'AVALANCHE_FUJI,POLYGON_AMOY', + 'AVALANCHE_FUJI,WEMIX_TESTNET', + 'AVALANCHE_FUJI,GNOSIS_CHIADO', + + 'BSC_TESTNET,BASE_SEPOLIA', + 'BSC_TESTNET,POLYGON_AMOY', + 'BSC_TESTNET,WEMIX_TESTNET', + 'BSC_TESTNET,GNOSIS_CHIADO', + + 'ARBITRUM_SEPOLIA,BASE_SEPOLIA', + 'ARBITRUM_SEPOLIA,OPTIMISM_SEPOLIA', + 'ARBITRUM_SEPOLIA,WEMIX_TESTNET', + 'ARBITRUM_SEPOLIA,GNOSIS_CHIADO', + + 'BASE_SEPOLIA,MODE_SEPOLIA', + 'BASE_SEPOLIA,OPTIMISM_SEPOLIA', + 'BASE_SEPOLIA,GNOSIS_CHIADO', + + 'KROMA_SEPOLIA,WEMIX_TESTNET', + + 'OPTIMISM_SEPOLIA,POLYGON_AMOY', + 'OPTIMISM_SEPOLIA,WEMIX_TESTNET', + 'OPTIMISM_SEPOLIA,GNOSIS_CHIADO', + + 'POLYGON_AMOY,WEMIX_TESTNET', + 'POLYGON_AMOY,GNOSIS_CHIADO', +] + +BiDirectionalLane = true +PhaseTimeout = '30m' +LocalCluster = false +ExistingDeployment = true +ReuseContracts = true + + +[CCIP.Groups.smoke.TokenConfig] +NoOfTokensPerChain = 1 +CCIPOwnerTokens = true + +[CCIP.Groups.smoke.MsgDetails] +MsgType = 'Data' +DestGasLimit = 0 +DataLength = 100 +NoOfTokens = 1 +AmountPerToken = 1 \ No newline at end of file diff --git a/integration-tests/ccip-tests/testconfig/tomls/prod-testnet/smoke-release-testing_token_transfer_native.toml b/integration-tests/ccip-tests/testconfig/tomls/prod-testnet/smoke-release-testing_token_transfer_native.toml new file mode 100644 index 00000000000..b1549377fda --- /dev/null +++ b/integration-tests/ccip-tests/testconfig/tomls/prod-testnet/smoke-release-testing_token_transfer_native.toml @@ -0,0 +1,1035 @@ +[CCIP] +[CCIP.ContractVersions] +PriceRegistry = 'latest' +OffRamp = 'latest' +OnRamp = 'latest' +CommitStore = 'latest' +TokenPool = 'latest' + + +[CCIP.Deployments] +Data = """ +{ + "lane_configs": { + "Arbitrum Sepolia": { + "is_native_fee_token": true, + "fee_token": "0xE591bf0A0CF924A0674d7792db046B23CEbF5f34", + "bridge_tokens": [ + "0xA8C0c11bf64AF62CDCA6f93D3769B88BdD7cb93D" + ], + "bridge_tokens_pools": [ + "0x99685281Ec520a003F1A726A5a8078c2124c1477" + ], + "arm": "0xbcBDf0aDEDC9a33ED5338Bdb4B6F7CE664DC2e8B", + "router": "0x2a9C5afB0d0e4BAb2BCdaE109EC4b0c4Be15a165", + "price_registry": "0x89D5b13908b9063abCC6791dc724bF7B7c93634C", + "wrapped_native": "0xE591bf0A0CF924A0674d7792db046B23CEbF5f34", + "src_contracts": { + "Avalanche Fuji": { + "on_ramp": "0x1Cb56374296ED19E86F68fA437ee679FD7798DaA", + "deployed_at": 0 + }, + "Base Sepolia": { + "on_ramp": "0x7854E73C73e7F9bb5b0D5B4861E997f4C6E8dcC6", + "deployed_at": 0 + }, + "Gnosis Chiado": { + "on_ramp": "0x973CbE752258D32AE82b60CD1CB656Eebb588dF0", + "deployed_at": 0 + }, + "Optimism Sepolia": { + "on_ramp": "0x701Fe16916dd21EFE2f535CA59611D818B017877", + "deployed_at": 0 + }, + "Sepolia Testnet": { + "on_ramp": "0x4205E1Ca0202A248A5D42F5975A8FE56F3E302e9", + "deployed_at": 0 + }, + "WeMix Testnet": { + "on_ramp": "0xBD4106fBE4699FE212A34Cc21b10BFf22b02d959", + "deployed_at": 0 + } + }, + "dest_contracts": { + "Avalanche Fuji": { + "off_ramp": "0xcab0EF91Bee323d1A617c0a027eE753aFd6997E4", + "commit_store": "0x0d90b9b96cBFa0D01635ce12982ccE1b70827c7a", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Base Sepolia": { + "off_ramp": "0xc1982985720B959E66c19b64F783361Eb9B60F26", + "commit_store": "0x28F66bB336f6db713d6ad2a3bd1B7a531282A159", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Gnosis Chiado": { + "off_ramp": "0x935C26F9a9122E5F9a27f2d3803e74c75B94f5a3", + "commit_store": "0xEdb963Ec5c2E5AbdFdCF137eF44A445a7fa4787A", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Optimism Sepolia": { + "off_ramp": "0xfD404A89e1d195F0c65be1A9042C77745197659e", + "commit_store": "0x84B7B012c95f8A152B44Ab3e952f2dEE424fA8e1", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Sepolia Testnet": { + "off_ramp": "0x1c71f141b4630EBE52d6aF4894812960abE207eB", + "commit_store": "0xaB0c8Ba51E7Fa3E5693a4Fbb39473520FD85d173", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "WeMix Testnet": { + "off_ramp": "0x262e16C8D42aa07bE13e58F81e7D9F62F6DE2830", + "commit_store": "0xc132eFAf929299E5ee704Fa6D9796CFa23Bb8b2C", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + } + } + }, + "Avalanche Fuji": { + "is_native_fee_token": true, + "fee_token": "0xd00ae08403B9bbb9124bB305C09058E32C39A48c", + "bridge_tokens": [ + "0xD21341536c5cF5EB1bcb58f6723cE26e8D8E90e4" + ], + "bridge_tokens_pools": [ + "0xEC1062cbDf4fBf31B3A6Aac62B6F6F123bb70E12" + ], + "arm": "0x7e28DD790214139798446A121cFe950B51304684", + "router": "0xF694E193200268f9a4868e4Aa017A0118C9a8177", + "price_registry": "0x19e157E5fb1DAec1aE4BaB113fdf077F980704AA", + "wrapped_native": "0xd00ae08403B9bbb9124bB305C09058E32C39A48c", + "src_contracts": { + "Arbitrum Sepolia": { + "on_ramp": "0x8bB16BEDbFd62D1f905ACe8DBBF2954c8EEB4f66", + "deployed_at": 0 + }, + "BSC Testnet": { + "on_ramp": "0xF25ECF1Aad9B2E43EDc2960cF66f325783245535", + "deployed_at": 0 + }, + "Base Sepolia": { + "on_ramp": "0x1A674645f3EB4147543FCA7d40C5719cbd997362", + "deployed_at": 0 + }, + "Gnosis Chiado": { + "on_ramp": "0x1532e5b204ee2b2244170c78E743CB9c168F4DF9", + "deployed_at": 0 + }, + "Optimism Sepolia": { + "on_ramp": "0xC334DE5b020e056d0fE766dE46e8d9f306Ffa1E2", + "deployed_at": 0 + }, + "Polygon Amoy": { + "on_ramp": "0x610F76A35E17DA4542518D85FfEa12645eF111Fc", + "deployed_at": 0 + }, + "Sepolia Testnet": { + "on_ramp": "0x5724B4Cc39a9690135F7273b44Dfd3BA6c0c69aD", + "deployed_at": 0 + }, + "WeMix Testnet": { + "on_ramp": "0x677B5ab5C8522d929166c064d5700F147b15fa33", + "deployed_at": 0 + } + }, + "dest_contracts": { + "Arbitrum Sepolia": { + "off_ramp": "0x90A74072e7B0c2d59e13aB4d8f93c8198c413194", + "commit_store": "0xf3458CFd2fdf4a6CF0Ce296d520DD21eB194828b", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "BSC Testnet": { + "off_ramp": "0x10b28009E5D776F1f5AAA73941CE8953B8f42d26", + "commit_store": "0xacDD582F271eCF22FAd6764cCDe1c4a534b732A8", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Base Sepolia": { + "off_ramp": "0xdBdE8510226d1E060A3bf982b67705C67f5697e2", + "commit_store": "0x8Ee73BC9492b4182D289E5C1e66e40CD876CC00F", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Gnosis Chiado": { + "off_ramp": "0x56dF55aF5F0A4689f3364230587a68eD6A314fAd", + "commit_store": "0xabA7ff98094c4cc7A075812EefF2CD21f6400235", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Optimism Sepolia": { + "off_ramp": "0x3d7CbC95DCC33257F14D6Eb780c88Bd56C6335BB", + "commit_store": "0x1fcDC02edDfb405f378ba53cF9E6104feBcB7542", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Polygon Amoy": { + "off_ramp": "0x3e33290B90fD0FF30a3FA138934DF028E4eCA348", + "commit_store": "0xCFe3556Aa42d40be09BD23aa80448a19443BE5B1", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Sepolia Testnet": { + "off_ramp": "0x9e5e4324F8608D54A50a317832d456a392E4F8C2", + "commit_store": "0x92A51eD3F041B39EbD1e464C1f7cb1e8f8A8c63f", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "WeMix Testnet": { + "off_ramp": "0xD0D338318bC6837b091FC7AB5F2a94B7783507d5", + "commit_store": "0xd9D479208235c7355848ff4aF26eB5aacfDC30c6", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + } + } + }, + "BSC Testnet": { + "is_native_fee_token": true, + "fee_token": "0xae13d989daC2f0dEbFf460aC112a837C89BAa7cd", + "bridge_tokens": [ + "0xbFA2ACd33ED6EEc0ed3Cc06bF1ac38d22b36B9e9" + ], + "bridge_tokens_pools": [ + "0x31eDe84776DA37e2404eE88d71c234e92cB672e5" + ], + "arm": "0x7D899D26F2E94fFcd4b440C3008B0C6BEfcD3cca", + "router": "0xE1053aE1857476f36A3C62580FF9b016E8EE8F6f", + "price_registry": "0xCCDf022c9d31DC26Ebab4FB92432724a5b79809a", + "wrapped_native": "0xae13d989daC2f0dEbFf460aC112a837C89BAa7cd", + "src_contracts": { + "Avalanche Fuji": { + "on_ramp": "0xa2515683E99F50ADbE177519A46bb20FfdBaA5de", + "deployed_at": 0 + }, + "Base Sepolia": { + "on_ramp": "0x3E807220Ca84b997c0d1928162227b46C618e0c5", + "deployed_at": 0 + }, + "Gnosis Chiado": { + "on_ramp": "0x8735f991d41eA9cA9D2CC75cD201e4B7C866E63e", + "deployed_at": 0 + }, + "Polygon Amoy": { + "on_ramp": "0xf37CcbfC04adc1B56a46B36F811D52C744a1AF78", + "deployed_at": 0 + }, + "Sepolia Testnet": { + "on_ramp": "0xB1DE44B04C00eaFe9915a3C07a0CaeA4410537dF", + "deployed_at": 0 + }, + "WeMix Testnet": { + "on_ramp": "0x89268Afc1BEA0782a27ba84124E3F42b196af927", + "deployed_at": 0 + } + }, + "dest_contracts": { + "Avalanche Fuji": { + "off_ramp": "0x6e6fFCb6B4BED91ff0CC8C2e57EC029dA7DB80C2", + "commit_store": "0x38Bc38Bd824b6eE87571f9D3CFbe6D6E28E3Dc62", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Base Sepolia": { + "off_ramp": "0x2C61FD7E93Dc79422861282145c59B56dFbc3a8c", + "commit_store": "0x42fAe5B3605804CF6d08632d7A25864e24F792Ae", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Gnosis Chiado": { + "off_ramp": "0x71a44a60832B0F8B63232C9516e7E6aEc3A373Dc", + "commit_store": "0xAC24299a91b72d1Cb5B31147e3CF54964D896974", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Polygon Amoy": { + "off_ramp": "0x63440C7747d37bc6154b5538AE32b54FE0965AfA", + "commit_store": "0xAD22fA198CECfC534927aE1D480c460d5bB3460F", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Sepolia Testnet": { + "off_ramp": "0xf1c128Fe52Ea78CcAAB407509292E61ce38C1523", + "commit_store": "0x59dFD870dC4bd76A7B879A4f705Fdcd2595f85f9", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "WeMix Testnet": { + "off_ramp": "0xfd9B19c3725da5B517aA705B848ff3f21F98280e", + "commit_store": "0x3c1F1412563188aBc8FE3fd53E8F1Cb601CaB4f9", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + } + } + }, + "Base Sepolia": { + "is_native_fee_token": true, + "fee_token": "0x4200000000000000000000000000000000000006", + "bridge_tokens": [ + "0x88A2d74F47a237a62e7A51cdDa67270CE381555e" + ], + "bridge_tokens_pools": [ + "0x875207858c691F192C606068f417dCf666b2EC6B" + ], + "arm": "0x7827dD0481EE18DB646bD250d20A8eA43da52146", + "router": "0xD3b06cEbF099CE7DA4AcCf578aaebFDBd6e88a93", + "price_registry": "0x4D20536e60832bE579Cd38E89Dc03d11E1741FbA", + "wrapped_native": "0x4200000000000000000000000000000000000006", + "src_contracts": { + "Arbitrum Sepolia": { + "on_ramp": "0x58622a80c6DdDc072F2b527a99BE1D0934eb2b50", + "deployed_at": 0 + }, + "Avalanche Fuji": { + "on_ramp": "0xAbA09a1b7b9f13E05A6241292a66793Ec7d43357", + "deployed_at": 0 + }, + "BSC Testnet": { + "on_ramp": "0xD806966beAB5A3C75E5B90CDA4a6922C6A9F0c9d", + "deployed_at": 0 + }, + "Gnosis Chiado": { + "on_ramp": "0x2Eff2d1BF5C557d6289D208a7a43608f5E3FeCc2", + "deployed_at": 0 + }, + "Mode Sepolia": { + "on_ramp": "0x3d0115386C01436870a2c47e6297962284E70BA6", + "deployed_at": 0 + }, + "Optimism Sepolia": { + "on_ramp": "0x3b39Cd9599137f892Ad57A4f54158198D445D147", + "deployed_at": 0 + }, + "Sepolia Testnet": { + "on_ramp": "0x6486906bB2d85A6c0cCEf2A2831C11A2059ebfea", + "deployed_at": 0 + } + }, + "dest_contracts": { + "Arbitrum Sepolia": { + "off_ramp": "0xd364C06ac99a82a00d3eFF9F2F78E4Abe4b9baAA", + "commit_store": "0xdE8d0f47a71eA3fDFBD3162271652f2847939097", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Avalanche Fuji": { + "off_ramp": "0xAd91214efFee446500940c764DF77AF18427294F", + "commit_store": "0x1242b6c5e0e349b8d4BCf0938f961C4B4f7EA3Fa", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "BSC Testnet": { + "off_ramp": "0xd5E9508921434e8758f4540D55c1c066b7cc1598", + "commit_store": "0x1a86b29364D1B3fA3386329A361aA98A104b2742", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Gnosis Chiado": { + "off_ramp": "0x9Bb7e398ef9Acfe9cA584C39B1E233Cba62BB9f7", + "commit_store": "0x1F4B82cDebaC5e3a0Dd53183D47e51808B4a64cB", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Mode Sepolia": { + "off_ramp": "0xB26647A23e8b4284375e5C74b77c9557aE709D03", + "commit_store": "0x4b4fEB401d3E613e1D6242E155C83A80BF9ac2C9", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Optimism Sepolia": { + "off_ramp": "0x86a3910908eCaAA31Fcd9F0fC8841D8E98f1511d", + "commit_store": "0xE99a87C9b5ed4D2b6060195DEea5106ffF655736", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Sepolia Testnet": { + "off_ramp": "0x189F61D9B886Dd2975D5Abc893c8Cf5f5effda71", + "commit_store": "0xEE7e27346DCD1e711348D0F7f7ECB53a9a3a08a7", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + } + } + }, + "Blast Sepolia": { + "is_native_fee_token": true, + "fee_token": "0x4200000000000000000000000000000000000023", + "bridge_tokens": [ + "0x8D122C3e8ce9C8B62b87d3551bDfD8C259Bb0771" + ], + "bridge_tokens_pools": [ + "0xFb04129aD1EEDB741CC705ebC1978a7aB63e51f6" + ], + "arm": "0x09c1Ed4b112Fb33e594F2aACfEF407e2F14d7F9b", + "router": "0xfb2f2A207dC428da81fbAFfDDe121761f8Be1194", + "price_registry": "0xc8acE9dF450FaD007755C6C9AB4f0e9c8626E29C", + "wrapped_native": "0x4200000000000000000000000000000000000023", + "src_contracts": { + "Sepolia Testnet": { + "on_ramp": "0x85Ef19FC4C63c70744995DC38CAAEC185E0c619f", + "deployed_at": 0 + } + }, + "dest_contracts": { + "Sepolia Testnet": { + "off_ramp": "0x92cD24C278D34C726f377703E50875d8f9535dC2", + "commit_store": "0xcE1b4D50CeD56850182Bd58Ace91171cB249B873", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + } + } + }, + "Celo Alfajores": { + "is_native_fee_token": true, + "fee_token": "0x99604d0e2EfE7ABFb58BdE565b5330Bb46Ab3Dca", + "bridge_tokens": [ + "0x7e503dd1dAF90117A1b79953321043d9E6815C72" + ], + "bridge_tokens_pools": [ + "0xC6683ac4a0F62803Bec89a5355B36495ddF2C38b" + ], + "arm": "0xEbe35aA4F5e707485484c992AF2069a457b9bBB1", + "router": "0xb00E95b773528E2Ea724DB06B75113F239D15Dca", + "price_registry": "0x8F048206D11B2c69b8963E2EBd5968D141e022f4", + "wrapped_native": "0x99604d0e2EfE7ABFb58BdE565b5330Bb46Ab3Dca", + "src_contracts": { + "Sepolia Testnet": { + "on_ramp": "0x16a020c4bbdE363FaB8481262D30516AdbcfcFc8", + "deployed_at": 0 + } + }, + "dest_contracts": { + "Sepolia Testnet": { + "off_ramp": "0xa1b97F92D806BA040daf419AFC2765DC723683a4", + "commit_store": "0xcd92C0599Ac515e7588865cC45Eee21A74816aFc", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + } + } + }, + "Gnosis Chiado": { + "is_native_fee_token": true, + "fee_token": "0x18c8a7ec7897177E4529065a7E7B0878358B3BfF", + "bridge_tokens": [ + "0xA189971a2c5AcA0DFC5Ee7a2C44a2Ae27b3CF389" + ], + "bridge_tokens_pools": [ + "0xF9a21B587111e7E8745Fb8b13750014f19DB0014" + ], + "arm": "0xfE4fB161D870D0F672Ed9C5A898569603f77983F", + "router": "0x19b1bac554111517831ACadc0FD119D23Bb14391", + "price_registry": "0x2F4ACd1f8986c6B1788159C4c9a5fC3fceCCE363", + "wrapped_native": "0x18c8a7ec7897177E4529065a7E7B0878358B3BfF", + "src_contracts": { + "Arbitrum Sepolia": { + "on_ramp": "0x473b49fb592B54a4BfCD55d40E048431982879C9", + "deployed_at": 0 + }, + "Avalanche Fuji": { + "on_ramp": "0x610F76A35E17DA4542518D85FfEa12645eF111Fc", + "deployed_at": 0 + }, + "BSC Testnet": { + "on_ramp": "0xE48E6AA1fc7D0411acEA95F8C6CaD972A37721D4", + "deployed_at": 0 + }, + "Base Sepolia": { + "on_ramp": "0x41b4A51cAfb699D9504E89d19D71F92E886028a8", + "deployed_at": 0 + }, + "Optimism Sepolia": { + "on_ramp": "0xAae733212981e06D9C978Eb5148F8af03F54b6EF", + "deployed_at": 0 + }, + "Polygon Amoy": { + "on_ramp": "0x01800fCDd892e37f7829937271840A6F041bE62E", + "deployed_at": 0 + }, + "Sepolia Testnet": { + "on_ramp": "0x4ac7FBEc2A7298AbDf0E0F4fDC45015836C4bAFe", + "deployed_at": 0 + } + }, + "dest_contracts": { + "Arbitrum Sepolia": { + "off_ramp": "0x9aA82DBB53bf02096B771D40e9432A323a78fB26", + "commit_store": "0x5CdbA91aBC0cD81FC56bc10Ad1835C9E5fB38e5F", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Avalanche Fuji": { + "off_ramp": "0x3e33290B90fD0FF30a3FA138934DF028E4eCA348", + "commit_store": "0xCFe3556Aa42d40be09BD23aa80448a19443BE5B1", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "BSC Testnet": { + "off_ramp": "0xbc4AD54e91b213D4279af92c0C5518c0b96cf62D", + "commit_store": "0xff84e8Dd4Fd17eaBb23b6AeA6e1981830e54389C", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Base Sepolia": { + "off_ramp": "0x4117953A5ceeF12f5B8C1E973b470ab83a8CebA6", + "commit_store": "0x94ad41296186E81f31e1ed0B1BcF5fa9e1721C27", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Optimism Sepolia": { + "off_ramp": "0x33d2898F8fb7714FD1661791766f40754982a343", + "commit_store": "0x55d6Df194472f02CD481e506A277c4A29D0D1bCc", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Polygon Amoy": { + "off_ramp": "0x450543b1d85ca79885851D7b74dc982981b78229", + "commit_store": "0x23B79d940A769FE31b4C867A8BAE80117f24Ca81", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Sepolia Testnet": { + "off_ramp": "0xbf9036529123DE264bFA0FC7362fE25B650D4B16", + "commit_store": "0x5f7F1abD5c5EdaF2636D58B980e85355AF0Ef80d", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + } + } + }, + "Kroma Sepolia": { + "is_native_fee_token": true, + "fee_token": "0x4200000000000000000000000000000000000001", + "bridge_tokens": [ + "0x6AC3e353D1DDda24d5A5416024d6E436b8817A4e" + ], + "bridge_tokens_pools": [ + "0x0eE8add19554C7bb1920A183Ed47b4FAB9Eb7601" + ], + "arm": "0x08f9Af992368FAc58C936A2c5eBc9092894CEa9b", + "router": "0xA8C0c11bf64AF62CDCA6f93D3769B88BdD7cb93D", + "price_registry": "0xa1ed3A3aA29166C9c8448654A8cA6b7916BC8379", + "wrapped_native": "0x4200000000000000000000000000000000000001", + "src_contracts": { + "WeMix Testnet": { + "on_ramp": "0x6ea155Fc77566D9dcE01B8aa5D7968665dc4f0C5", + "deployed_at": 0 + } + }, + "dest_contracts": { + "WeMix Testnet": { + "off_ramp": "0xB602B6E5Caf08ac0C920EAE585aed100a8cF6f3B", + "commit_store": "0x89D5b13908b9063abCC6791dc724bF7B7c93634C", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + } + } + }, + "Metis Sepolia": { + "is_native_fee_token": true, + "fee_token": "0x5c48e07062aC4E2Cf4b9A768a711Aef18e8fbdA0", + "bridge_tokens": [ + "0x20Aa09AAb761e2E600d65c6929A9fd1E59821D3f" + ], + "bridge_tokens_pools": [ + "0xdE8451E952Eb43350614839cCAA84f7C8701a09C" + ], + "arm": "0xf0607A9BDdB5F54dB59ACaA0837aFec2D1c95df6", + "router": "0xaCdaBa07ECad81dc634458b98673931DD9d3Bc14", + "price_registry": "0x5DCE866b3ae6E0Ed153f0e149D7203A1B266cdF5", + "wrapped_native": "0x5c48e07062aC4E2Cf4b9A768a711Aef18e8fbdA0", + "src_contracts": { + "Sepolia Testnet": { + "on_ramp": "0x2Eff2d1BF5C557d6289D208a7a43608f5E3FeCc2", + "deployed_at": 0 + } + }, + "dest_contracts": { + "Sepolia Testnet": { + "off_ramp": "0x9Bb7e398ef9Acfe9cA584C39B1E233Cba62BB9f7", + "commit_store": "0x1F4B82cDebaC5e3a0Dd53183D47e51808B4a64cB", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + } + } + }, + "Mode Sepolia": { + "is_native_fee_token": true, + "fee_token": "0x4200000000000000000000000000000000000006", + "bridge_tokens": [ + "0xB9d4e1141E67ECFedC8A8139b5229b7FF2BF16F5" + ], + "bridge_tokens_pools": [ + "0x20bBc874bE3Cd94C3E4689EDD5D89dD1cE8Cb7C4" + ], + "arm": "0x9eC8a0AbC75ce08978FAf67958482461bCd93B18", + "router": "0xc49ec0eB4beb48B8Da4cceC51AA9A5bD0D0A4c43", + "price_registry": "0xa733ce82a84335b2E9D864312225B0F3D5d80600", + "wrapped_native": "0x4200000000000000000000000000000000000006", + "src_contracts": { + "Base Sepolia": { + "on_ramp": "0x73f7E074bd7291706a0C5412f51DB46441B1aDCB", + "deployed_at": 0 + }, + "Sepolia Testnet": { + "on_ramp": "0xfFdE9E8c34A27BEBeaCcAcB7b3044A0A364455C9", + "deployed_at": 0 + } + }, + "dest_contracts": { + "Base Sepolia": { + "off_ramp": "0x137a38c6b1Ad20101F93516aB2159Df525309168", + "commit_store": "0x8F43d867969F14619895d71E0A5b89E0bb20bF70", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Sepolia Testnet": { + "off_ramp": "0xcD44cec849B6a8eBd5551D6DFeEcA452257Dfe4d", + "commit_store": "0xbA66f08733E6715D33edDfb5a5947676bb45d0e0", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + } + } + }, + "Optimism Sepolia": { + "is_native_fee_token": true, + "fee_token": "0x4200000000000000000000000000000000000006", + "bridge_tokens": [ + "0x8aF4204e30565DF93352fE8E1De78925F6664dA7" + ], + "bridge_tokens_pools": [ + "0x3Cc9364260D80F09ccAC1eE6B07366dB598900E6" + ], + "arm": "0xF51366F72184E22cF4a7a8362508DB0d3370392d", + "router": "0x114A20A10b43D4115e5aeef7345a1A71d2a60C57", + "price_registry": "0x782a7Ba95215f2F7c3dD4C153cbB2Ae3Ec2d3215", + "wrapped_native": "0x4200000000000000000000000000000000000006", + "src_contracts": { + "Arbitrum Sepolia": { + "on_ramp": "0x1a86b29364D1B3fA3386329A361aA98A104b2742", + "deployed_at": 0 + }, + "Avalanche Fuji": { + "on_ramp": "0x6b38CC6Fa938D5AB09Bdf0CFe580E226fDD793cE", + "deployed_at": 0 + }, + "Base Sepolia": { + "on_ramp": "0xe284D2315a28c4d62C419e8474dC457b219DB969", + "deployed_at": 0 + }, + "Gnosis Chiado": { + "on_ramp": "0x835a5b8e6CA17c2bB5A336c93a4E22478E6F1C8A", + "deployed_at": 0 + }, + "Polygon Amoy": { + "on_ramp": "0x2Cf26fb01E9ccDb831414B766287c0A9e4551089", + "deployed_at": 0 + }, + "Sepolia Testnet": { + "on_ramp": "0xC8b93b46BF682c39B3F65Aa1c135bC8A95A5E43a", + "deployed_at": 0 + }, + "WeMix Testnet": { + "on_ramp": "0xc7E53f6aB982af7A7C3e470c8cCa283d3399BDAd", + "deployed_at": 0 + } + }, + "dest_contracts": { + "Arbitrum Sepolia": { + "off_ramp": "0xDc2c7A3d8068C6F09F0F3648d24C84e372F6014d", + "commit_store": "0xb1aFb5cbE3c29b5Db71F21442BA9EfD450BC23C3", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Avalanche Fuji": { + "off_ramp": "0x1F350718e015EB20E5065C09F4A7a3f66888aEeD", + "commit_store": "0x98650A8EB59f75D93563aB34FcF603b1A30e4CBF", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Base Sepolia": { + "off_ramp": "0x0a750ca77369e03613d7640548F4b2b1c695c3Bb", + "commit_store": "0x8fEBC74C26129C8d7E60288C6dCCc75eb494aA3C", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Gnosis Chiado": { + "off_ramp": "0xCE2CE7F940B7c839384e5D7e079A6aE80e8AD6dB", + "commit_store": "0x1b9D78Ec1CEEC439F0b7eA6C428A1a607D9FA7e4", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Polygon Amoy": { + "off_ramp": "0xD667b5706592D0b040C78fEe5EE17D243b7dCB41", + "commit_store": "0x96101BA5250EE9295c193693C1e08A55bC593664", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Sepolia Testnet": { + "off_ramp": "0x260AF9b83e0d2Bb6C9015fC9f0BfF8858A0CCE68", + "commit_store": "0x7a0bB92Bc8663abe6296d0162A9b41a2Cb2E0358", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "WeMix Testnet": { + "off_ramp": "0x9C08B7712af0344188aa5087D9e6aD0f47191037", + "commit_store": "0x4BE6DB0B884169a6A207fe5cad01eB4C025a13dB", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + } + } + }, + "Polygon Amoy": { + "is_native_fee_token": true, + "fee_token": "0x360ad4f9a9A8EFe9A8DCB5f461c4Cc1047E1Dcf9", + "bridge_tokens": [ + "0xcab0EF91Bee323d1A617c0a027eE753aFd6997E4" + ], + "bridge_tokens_pools": [ + "0x3064fB3EA546EE09A63AB3bD93E83D8B8525C636" + ], + "arm": "0x8b88C39D2875157aB4CE4AD3814409523d539ee1", + "router": "0x9C32fCB86BF0f4a1A8921a9Fe46de3198bb884B2", + "price_registry": "0xfb2f2A207dC428da81fbAFfDDe121761f8Be1194", + "wrapped_native": "0x360ad4f9a9A8EFe9A8DCB5f461c4Cc1047E1Dcf9", + "src_contracts": { + "Avalanche Fuji": { + "on_ramp": "0x8Fb98b3837578aceEA32b454f3221FE18D7Ce903", + "deployed_at": 0 + }, + "BSC Testnet": { + "on_ramp": "0xC6683ac4a0F62803Bec89a5355B36495ddF2C38b", + "deployed_at": 0 + }, + "Gnosis Chiado": { + "on_ramp": "0x2331F6D614C9Fd613Ff59a1aB727f1EDf6c37A68", + "deployed_at": 0 + }, + "Optimism Sepolia": { + "on_ramp": "0xA52cDAeb43803A80B3c0C2296f5cFe57e695BE11", + "deployed_at": 0 + }, + "Sepolia Testnet": { + "on_ramp": "0x35347A2fC1f2a4c5Eae03339040d0b83b09e6FDA", + "deployed_at": 0 + }, + "WeMix Testnet": { + "on_ramp": "0x26546096F64B5eF9A1DcDAe70Df6F4f8c2E10C61", + "deployed_at": 0 + } + }, + "dest_contracts": { + "Avalanche Fuji": { + "off_ramp": "0xa733ce82a84335b2E9D864312225B0F3D5d80600", + "commit_store": "0x09B0F93fC2111aE439e853884173AC5b2F809885", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "BSC Testnet": { + "off_ramp": "0x948dfaa4842fc23e0e362Fe8D4396AaE4E6DF7EA", + "commit_store": "0x7F4e739D40E58BBd59dAD388171d18e37B26326f", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Gnosis Chiado": { + "off_ramp": "0x17c542a28e08AEF5697251601C7b2B621d153D42", + "commit_store": "0x811250c20fAB9a1b7ca245453aC214ba637fBEB5", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Optimism Sepolia": { + "off_ramp": "0xfFdE9E8c34A27BEBeaCcAcB7b3044A0A364455C9", + "commit_store": "0x74ED442ad211050e9C05Dc9A267E037E3d74A03B", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Sepolia Testnet": { + "off_ramp": "0xFb04129aD1EEDB741CC705ebC1978a7aB63e51f6", + "commit_store": "0x63f875240149d29136053C954Ca164a9BfA81F77", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "WeMix Testnet": { + "off_ramp": "0xdE8451E952Eb43350614839cCAA84f7C8701a09C", + "commit_store": "0xaCdaBa07ECad81dc634458b98673931DD9d3Bc14", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + } + } + }, + "Sepolia Testnet": { + "is_native_fee_token": true, + "fee_token": "0x097D90c9d3E0B50Ca60e1ae45F6A81010f9FB534", + "bridge_tokens": [ + "0xFd57b4ddBf88a4e07fF4e34C487b99af2Fe82a05" + ], + "bridge_tokens_pools": [ + "0x38d1ef9619Cd40cf5482C045660Ae7C82Ada062c" + ], + "arm": "0x27Da8735d8d1402cEc072C234759fbbB4dABBC4A", + "router": "0x0BF3dE8c5D3e8A2B34D2BEeB17ABfCeBaf363A59", + "price_registry": "0x9EF7D57a4ea30b9e37794E55b0C75F2A70275dCc", + "wrapped_native": "0x097D90c9d3E0B50Ca60e1ae45F6A81010f9FB534", + "src_contracts": { + "Arbitrum Sepolia": { + "on_ramp": "0xe4Dd3B16E09c016402585a8aDFdB4A18f772a07e", + "deployed_at": 0 + }, + "Avalanche Fuji": { + "on_ramp": "0x0477cA0a35eE05D3f9f424d88bC0977ceCf339D4", + "deployed_at": 0 + }, + "BSC Testnet": { + "on_ramp": "0xD990f8aFA5BCB02f95eEd88ecB7C68f5998bD618", + "deployed_at": 0 + }, + "Base Sepolia": { + "on_ramp": "0x2B70a05320cB069e0fB55084D402343F832556E7", + "deployed_at": 0 + }, + "Blast Sepolia": { + "on_ramp": "0xDB75E9D9ca7577CcBd7232741be954cf26194a66", + "deployed_at": 0 + }, + "Celo Alfajores": { + "on_ramp": "0x3C86d16F52C10B2ff6696a0e1b8E0BcfCC085948", + "deployed_at": 0 + }, + "Gnosis Chiado": { + "on_ramp": "0x3E842E3A79A00AFdd03B52390B1caC6306Ea257E", + "deployed_at": 0 + }, + "Metis Sepolia": { + "on_ramp": "0x1C4640914cd57c5f02a68048A0fbb0E12d904223", + "deployed_at": 0 + }, + "Mode Sepolia": { + "on_ramp": "0xc630fbD4D0F6AEB00aD0793FB827b54fBB78e981", + "deployed_at": 0 + }, + "Optimism Sepolia": { + "on_ramp": "0x69CaB5A0a08a12BaFD8f5B195989D709E396Ed4d", + "deployed_at": 0 + }, + "Polygon Amoy": { + "on_ramp": "0x9f656e0361Fb5Df2ac446102c8aB31855B591692", + "deployed_at": 0 + }, + "WeMix Testnet": { + "on_ramp": "0xedFc22336Eb0B9B11Ff37C07777db27BCcDe3C65", + "deployed_at": 0 + }, + "ZKSync Sepolia": { + "on_ramp": "0x1Acb3A885feA37bdA30AB99b99327b14391f500F", + "deployed_at": 0 + } + }, + "dest_contracts": { + "Arbitrum Sepolia": { + "off_ramp": "0xF18896AB20a09A29e64fdEbA99FDb8EC328f43b1", + "commit_store": "0x93Ff9Dd39Dc01eac1fc4d2c9211D95Ee458CAB94", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Avalanche Fuji": { + "off_ramp": "0x000b26f604eAadC3D874a4404bde6D64a97d95ca", + "commit_store": "0x2dD9273F8208B8393350508131270A6574A69784", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "BSC Testnet": { + "off_ramp": "0xdE2d8E126e08d675fCD7fFa5a6CE49925f3Dc692", + "commit_store": "0x0050ac355a82caB31194507f94174297bf0655A7", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Base Sepolia": { + "off_ramp": "0x31c0B81832B333419f0DfD36A69F502cF9094aed", + "commit_store": "0xDFcde9d698a2B32DB2537DC9B752Cadd1D846a52", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Blast Sepolia": { + "off_ramp": "0x4e897e5cF3aC307F0541B2151A88bCD781c153a3", + "commit_store": "0xB656652841F347178e193951C4663652aCe36B74", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Celo Alfajores": { + "off_ramp": "0xB435E0f73c18C5a12C324CA1d02F81F2C3e6e761", + "commit_store": "0xbc5d74957F171e75F92c8F0E1C317A25a56a416D", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Gnosis Chiado": { + "off_ramp": "0x7db0115A0b3AAb01d30bf81123c5DD7B0C41Add5", + "commit_store": "0x6640723Ea801178c4383FA016b9781e7ef1016EF", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Metis Sepolia": { + "off_ramp": "0x4DB693A93E9d5196ECD42EC56CDEAe99dFC652ED", + "commit_store": "0xBfACd78F1412B6f93Ac23409bf456aFec1ABd845", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Mode Sepolia": { + "off_ramp": "0xbEfd8D65F6643De54F0b1268A3bf4618ff85dcB4", + "commit_store": "0x0C161D3470b45Cc677661654C30ce4AdE6aCD288", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Optimism Sepolia": { + "off_ramp": "0xD50590D4438411EDe47029b0FD7901A7145E5Df6", + "commit_store": "0xe85EEE9Fd434A7b8a586Ee086E828abF41839479", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Polygon Amoy": { + "off_ramp": "0x5032cbC0C4aEeD25bb6E45D8B3fAF05DB0688C5d", + "commit_store": "0xe6201C9996Cc7B6E828E10CbE937E693d577D318", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "WeMix Testnet": { + "off_ramp": "0x46b639a3C1a4CBfD326b94a2dB7415c27157282f", + "commit_store": "0x7b74554678816b045c1e7409327E086bD436aa46", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "ZKSync Sepolia": { + "off_ramp": "0xBaABd4166C892a1081a26535875A8fA3f22937b2", + "commit_store": "0xfda2e83F4D3f42B7629134ecD6E4b29FB8A7A07B", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + } + } + }, + "WeMix Testnet": { + "is_native_fee_token": true, + "fee_token": "0xbE3686643c05f00eC46e73da594c78098F7a9Ae7", + "bridge_tokens": [ + "0xF4E4057FbBc86915F4b2d63EEFFe641C03294ffc" + ], + "bridge_tokens_pools": [ + "0x82A92B2863F93Be70D20660088Ec060720bA2fdb" + ], + "arm": "0x8f6cb63eD5e379722580DFF0A051C140C64F9619", + "router": "0xA8C0c11bf64AF62CDCA6f93D3769B88BdD7cb93D", + "price_registry": "0x89D17571DB7C9540eeB36760E3c749C8fb984569", + "wrapped_native": "0xbE3686643c05f00eC46e73da594c78098F7a9Ae7", + "src_contracts": { + "Arbitrum Sepolia": { + "on_ramp": "0xA9DE3F7A617D67bC50c56baaCb9E0373C15EbfC6", + "deployed_at": 0 + }, + "Avalanche Fuji": { + "on_ramp": "0xC4aC84da458ba8e40210D2dF94C76E9a41f70069", + "deployed_at": 0 + }, + "BSC Testnet": { + "on_ramp": "0x5AD6eed6Be0ffaDCA4105050CF0E584D87E0c2F1", + "deployed_at": 0 + }, + "Kroma Sepolia": { + "on_ramp": "0x428C4dc89b6Bf908B82d77C9CBceA786ea8cc7D0", + "deployed_at": 0 + }, + "Optimism Sepolia": { + "on_ramp": "0x1961a7De751451F410391c251D4D4F98D71B767D", + "deployed_at": 0 + }, + "Polygon Amoy": { + "on_ramp": "0xd55148e841e76265B484d399eC71b7076ecB1216", + "deployed_at": 0 + }, + "Sepolia Testnet": { + "on_ramp": "0x4d57C6d8037C65fa66D6231844785a428310a735", + "deployed_at": 0 + } + }, + "dest_contracts": { + "Arbitrum Sepolia": { + "off_ramp": "0xeB1dFaB2464Bf0574D43e764E0c758f92e7ecAFb", + "commit_store": "0xcEaCa2B7890065c485f3E58657358a185Ad33791", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Avalanche Fuji": { + "off_ramp": "0x98e811Df9D2512f1aaf58D534607F583D6c54A4F", + "commit_store": "0x8e538351F6E5B2daF3c90C565C3738bca69a2716", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "BSC Testnet": { + "off_ramp": "0xB0e7f0fCcD3c961C473E7c44D939C1cDb4Cec1cB", + "commit_store": "0x4B56D8d53f1A6e0117B09700067De99581aA5542", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Kroma Sepolia": { + "off_ramp": "0xD685D2d224dd6D0Db2D56497db6270D77D9a7966", + "commit_store": "0x7e062D6880779a0347e7742058C1b1Ee4AA0B137", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Optimism Sepolia": { + "off_ramp": "0xA5f97Bc69Bf06e7C37B93265c5457420A92c5F4b", + "commit_store": "0xd48b9213583074f518D8f4336FDf35370D450132", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Polygon Amoy": { + "off_ramp": "0x6c8f5999B06FDE17B11E4e3C1062b761766F960f", + "commit_store": "0x957c3c2056192e58A8485eF31165fC490d474239", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Sepolia Testnet": { + "off_ramp": "0x8AB103843ED9D28D2C5DAf5FdB9c3e1CE2B6c876", + "commit_store": "0x7d5297c5506ee2A7Ef121Da9bE02b6a6AD30b392", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + } + } + }, + "ZKSync Sepolia": { + "is_native_fee_token": true, + "fee_token": "0x4317b2eCD41851173175005783322D29E9bAee9E", + "arm": "0x926b4f90610Aa448f27c8e0Fd0afa4A17B7305F9", + "router": "0xA1fdA8aa9A8C4b945C45aD30647b01f07D7A0B16", + "price_registry": "0x648B6BB09bE1C5766C8AC578B9B4aC8497eA671F", + "wrapped_native": "0x4317b2eCD41851173175005783322D29E9bAee9E", + "src_contracts": { + "Sepolia Testnet": { + "on_ramp": "0x79a9a5e9e318e8e109776569574814bbf935125a", + "deployed_at": 0 + } + }, + "dest_contracts": { + "Sepolia Testnet": { + "off_ramp": "0x18FF69051479796175852578725Fc74F58E963F8", + "commit_store": "0xF694b4FD7889480dca3CD41244e8e3395a9EFBa0", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + } + } + } + } +} +""" + +[CCIP.Env] +TTL = '8h' + +[CCIP.Env.Network] +selected_networks = [ + 'ARBITRUM_SEPOLIA', + 'AVALANCHE_FUJI', + 'BASE_SEPOLIA', + 'BLAST_SEPOLIA', + 'BSC_TESTNET', + 'CELO_ALFAJORES', + 'GNOSIS_CHIADO', + 'KROMA_SEPOLIA', + 'MODE_SEPOLIA', + 'OPTIMISM_SEPOLIA', + 'POLYGON_AMOY', + 'SEPOLIA', + 'METIS_SEPOLIA', + 'WEMIX_TESTNET', + 'ZKSYNC_SEPOLIA' +] + +[CCIP.Groups.smoke] +# these are all the valid network pairs +NetworkPairs = [ + 'SEPOLIA,AVALANCHE_FUJI', + 'SEPOLIA,BSC_TESTNET', + 'SEPOLIA,CELO_ALFAJORES', + 'SEPOLIA,ARBITRUM_SEPOLIA', + 'SEPOLIA,BASE_SEPOLIA', + 'SEPOLIA,BLAST_SEPOLIA', + 'SEPOLIA,MODE_SEPOLIA', + 'SEPOLIA,OPTIMISM_SEPOLIA', + 'SEPOLIA,POLYGON_AMOY', + 'SEPOLIA,WEMIX_TESTNET', + 'SEPOLIA,GNOSIS_CHIADO', + 'SEPOLIA,METIS_SEPOLIA', + 'SEPOLIA,ZKSYNC_SEPOLIA', + + 'AVALANCHE_FUJI,BSC_TESTNET', + 'AVALANCHE_FUJI,ARBITRUM_SEPOLIA', + 'AVALANCHE_FUJI,BASE_SEPOLIA', + 'AVALANCHE_FUJI,OPTIMISM_SEPOLIA', + 'AVALANCHE_FUJI,POLYGON_AMOY', + 'AVALANCHE_FUJI,WEMIX_TESTNET', + 'AVALANCHE_FUJI,GNOSIS_CHIADO', + + 'BSC_TESTNET,BASE_SEPOLIA', + 'BSC_TESTNET,POLYGON_AMOY', + 'BSC_TESTNET,WEMIX_TESTNET', + 'BSC_TESTNET,GNOSIS_CHIADO', + + 'ARBITRUM_SEPOLIA,BASE_SEPOLIA', + 'ARBITRUM_SEPOLIA,OPTIMISM_SEPOLIA', + 'ARBITRUM_SEPOLIA,WEMIX_TESTNET', + 'ARBITRUM_SEPOLIA,GNOSIS_CHIADO', + + 'BASE_SEPOLIA,MODE_SEPOLIA', + 'BASE_SEPOLIA,OPTIMISM_SEPOLIA', + 'BASE_SEPOLIA,GNOSIS_CHIADO', + + 'KROMA_SEPOLIA,WEMIX_TESTNET', + + 'OPTIMISM_SEPOLIA,POLYGON_AMOY', + 'OPTIMISM_SEPOLIA,WEMIX_TESTNET', + 'OPTIMISM_SEPOLIA,GNOSIS_CHIADO', + + 'POLYGON_AMOY,WEMIX_TESTNET', + 'POLYGON_AMOY,GNOSIS_CHIADO', +] + +BiDirectionalLane = true +PhaseTimeout = '30m' +LocalCluster = false +ExistingDeployment = true +ReuseContracts = true + + +[CCIP.Groups.smoke.TokenConfig] +NoOfTokensPerChain = 1 +CCIPOwnerTokens = true + +[CCIP.Groups.smoke.MsgDetails] +MsgType = 'DataWithToken' +DestGasLimit = 0 +DataLength = 100 +NoOfTokens = 1 +AmountPerToken = 1 \ No newline at end of file diff --git a/integration-tests/ccip-tests/testconfig/tomls/prod-testnet/soak-release-testing_token_transfer_with_native_feetoken.toml b/integration-tests/ccip-tests/testconfig/tomls/prod-testnet/soak-release-testing_token_transfer_with_native_feetoken.toml new file mode 100644 index 00000000000..6a6aa205fce --- /dev/null +++ b/integration-tests/ccip-tests/testconfig/tomls/prod-testnet/soak-release-testing_token_transfer_with_native_feetoken.toml @@ -0,0 +1,1013 @@ +[CCIP] +[CCIP.ContractVersions] +PriceRegistry = '1.2.0' +OffRamp = '1.2.0' +OnRamp = '1.2.0' +TokenPool = '1.4.0' +CommitStore = '1.2.0' + + +[CCIP.Deployments] +Data = """ +{ + "lane_configs": { + "Arbitrum Sepolia": { + "is_native_fee_token": true, + "fee_token": "0xE591bf0A0CF924A0674d7792db046B23CEbF5f34", + "bridge_tokens": [ + "0xA8C0c11bf64AF62CDCA6f93D3769B88BdD7cb93D" + ], + "bridge_tokens_pools": [ + "0x99685281Ec520a003F1A726A5a8078c2124c1477" + ], + "arm": "0xbcBDf0aDEDC9a33ED5338Bdb4B6F7CE664DC2e8B", + "router": "0x2a9C5afB0d0e4BAb2BCdaE109EC4b0c4Be15a165", + "price_registry": "0x89D5b13908b9063abCC6791dc724bF7B7c93634C", + "wrapped_native": "0xE591bf0A0CF924A0674d7792db046B23CEbF5f34", + "src_contracts": { + "Avalanche Fuji": { + "on_ramp": "0x1Cb56374296ED19E86F68fA437ee679FD7798DaA", + "deployed_at": 0 + }, + "Base Sepolia": { + "on_ramp": "0x7854E73C73e7F9bb5b0D5B4861E997f4C6E8dcC6", + "deployed_at": 0 + }, + "Gnosis Chiado": { + "on_ramp": "0x973CbE752258D32AE82b60CD1CB656Eebb588dF0", + "deployed_at": 0 + }, + "Optimism Sepolia": { + "on_ramp": "0x701Fe16916dd21EFE2f535CA59611D818B017877", + "deployed_at": 0 + }, + "Sepolia Testnet": { + "on_ramp": "0x4205E1Ca0202A248A5D42F5975A8FE56F3E302e9", + "deployed_at": 0 + }, + "WeMix Testnet": { + "on_ramp": "0xBD4106fBE4699FE212A34Cc21b10BFf22b02d959", + "deployed_at": 0 + } + }, + "dest_contracts": { + "Avalanche Fuji": { + "off_ramp": "0xcab0EF91Bee323d1A617c0a027eE753aFd6997E4", + "commit_store": "0x0d90b9b96cBFa0D01635ce12982ccE1b70827c7a", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Base Sepolia": { + "off_ramp": "0xc1982985720B959E66c19b64F783361Eb9B60F26", + "commit_store": "0x28F66bB336f6db713d6ad2a3bd1B7a531282A159", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Gnosis Chiado": { + "off_ramp": "0x935C26F9a9122E5F9a27f2d3803e74c75B94f5a3", + "commit_store": "0xEdb963Ec5c2E5AbdFdCF137eF44A445a7fa4787A", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Optimism Sepolia": { + "off_ramp": "0xfD404A89e1d195F0c65be1A9042C77745197659e", + "commit_store": "0x84B7B012c95f8A152B44Ab3e952f2dEE424fA8e1", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Sepolia Testnet": { + "off_ramp": "0x1c71f141b4630EBE52d6aF4894812960abE207eB", + "commit_store": "0xaB0c8Ba51E7Fa3E5693a4Fbb39473520FD85d173", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "WeMix Testnet": { + "off_ramp": "0x262e16C8D42aa07bE13e58F81e7D9F62F6DE2830", + "commit_store": "0xc132eFAf929299E5ee704Fa6D9796CFa23Bb8b2C", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + } + } + }, + "Avalanche Fuji": { + "is_native_fee_token": true, + "fee_token": "0xd00ae08403B9bbb9124bB305C09058E32C39A48c", + "bridge_tokens": [ + "0xD21341536c5cF5EB1bcb58f6723cE26e8D8E90e4" + ], + "bridge_tokens_pools": [ + "0xEC1062cbDf4fBf31B3A6Aac62B6F6F123bb70E12" + ], + "arm": "0x7e28DD790214139798446A121cFe950B51304684", + "router": "0xF694E193200268f9a4868e4Aa017A0118C9a8177", + "price_registry": "0x19e157E5fb1DAec1aE4BaB113fdf077F980704AA", + "wrapped_native": "0xd00ae08403B9bbb9124bB305C09058E32C39A48c", + "src_contracts": { + "Arbitrum Sepolia": { + "on_ramp": "0x8bB16BEDbFd62D1f905ACe8DBBF2954c8EEB4f66", + "deployed_at": 0 + }, + "BSC Testnet": { + "on_ramp": "0xF25ECF1Aad9B2E43EDc2960cF66f325783245535", + "deployed_at": 0 + }, + "Base Sepolia": { + "on_ramp": "0x1A674645f3EB4147543FCA7d40C5719cbd997362", + "deployed_at": 0 + }, + "Gnosis Chiado": { + "on_ramp": "0x1532e5b204ee2b2244170c78E743CB9c168F4DF9", + "deployed_at": 0 + }, + "Optimism Sepolia": { + "on_ramp": "0xC334DE5b020e056d0fE766dE46e8d9f306Ffa1E2", + "deployed_at": 0 + }, + "Polygon Amoy": { + "on_ramp": "0x610F76A35E17DA4542518D85FfEa12645eF111Fc", + "deployed_at": 0 + }, + "Sepolia Testnet": { + "on_ramp": "0x5724B4Cc39a9690135F7273b44Dfd3BA6c0c69aD", + "deployed_at": 0 + }, + "WeMix Testnet": { + "on_ramp": "0x677B5ab5C8522d929166c064d5700F147b15fa33", + "deployed_at": 0 + } + }, + "dest_contracts": { + "Arbitrum Sepolia": { + "off_ramp": "0x90A74072e7B0c2d59e13aB4d8f93c8198c413194", + "commit_store": "0xf3458CFd2fdf4a6CF0Ce296d520DD21eB194828b", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "BSC Testnet": { + "off_ramp": "0x10b28009E5D776F1f5AAA73941CE8953B8f42d26", + "commit_store": "0xacDD582F271eCF22FAd6764cCDe1c4a534b732A8", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Base Sepolia": { + "off_ramp": "0xdBdE8510226d1E060A3bf982b67705C67f5697e2", + "commit_store": "0x8Ee73BC9492b4182D289E5C1e66e40CD876CC00F", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Gnosis Chiado": { + "off_ramp": "0x56dF55aF5F0A4689f3364230587a68eD6A314fAd", + "commit_store": "0xabA7ff98094c4cc7A075812EefF2CD21f6400235", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Optimism Sepolia": { + "off_ramp": "0x3d7CbC95DCC33257F14D6Eb780c88Bd56C6335BB", + "commit_store": "0x1fcDC02edDfb405f378ba53cF9E6104feBcB7542", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Polygon Amoy": { + "off_ramp": "0x3e33290B90fD0FF30a3FA138934DF028E4eCA348", + "commit_store": "0xCFe3556Aa42d40be09BD23aa80448a19443BE5B1", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Sepolia Testnet": { + "off_ramp": "0x9e5e4324F8608D54A50a317832d456a392E4F8C2", + "commit_store": "0x92A51eD3F041B39EbD1e464C1f7cb1e8f8A8c63f", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "WeMix Testnet": { + "off_ramp": "0xD0D338318bC6837b091FC7AB5F2a94B7783507d5", + "commit_store": "0xd9D479208235c7355848ff4aF26eB5aacfDC30c6", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + } + } + }, + "BSC Testnet": { + "is_native_fee_token": true, + "fee_token": "0xae13d989daC2f0dEbFf460aC112a837C89BAa7cd", + "bridge_tokens": [ + "0xbFA2ACd33ED6EEc0ed3Cc06bF1ac38d22b36B9e9" + ], + "bridge_tokens_pools": [ + "0x31eDe84776DA37e2404eE88d71c234e92cB672e5" + ], + "arm": "0x7D899D26F2E94fFcd4b440C3008B0C6BEfcD3cca", + "router": "0xE1053aE1857476f36A3C62580FF9b016E8EE8F6f", + "price_registry": "0xCCDf022c9d31DC26Ebab4FB92432724a5b79809a", + "wrapped_native": "0xae13d989daC2f0dEbFf460aC112a837C89BAa7cd", + "src_contracts": { + "Avalanche Fuji": { + "on_ramp": "0xa2515683E99F50ADbE177519A46bb20FfdBaA5de", + "deployed_at": 0 + }, + "Base Sepolia": { + "on_ramp": "0x3E807220Ca84b997c0d1928162227b46C618e0c5", + "deployed_at": 0 + }, + "Gnosis Chiado": { + "on_ramp": "0x8735f991d41eA9cA9D2CC75cD201e4B7C866E63e", + "deployed_at": 0 + }, + "Polygon Amoy": { + "on_ramp": "0xf37CcbfC04adc1B56a46B36F811D52C744a1AF78", + "deployed_at": 0 + }, + "Sepolia Testnet": { + "on_ramp": "0xB1DE44B04C00eaFe9915a3C07a0CaeA4410537dF", + "deployed_at": 0 + }, + "WeMix Testnet": { + "on_ramp": "0x89268Afc1BEA0782a27ba84124E3F42b196af927", + "deployed_at": 0 + } + }, + "dest_contracts": { + "Avalanche Fuji": { + "off_ramp": "0x6e6fFCb6B4BED91ff0CC8C2e57EC029dA7DB80C2", + "commit_store": "0x38Bc38Bd824b6eE87571f9D3CFbe6D6E28E3Dc62", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Base Sepolia": { + "off_ramp": "0x2C61FD7E93Dc79422861282145c59B56dFbc3a8c", + "commit_store": "0x42fAe5B3605804CF6d08632d7A25864e24F792Ae", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Gnosis Chiado": { + "off_ramp": "0x71a44a60832B0F8B63232C9516e7E6aEc3A373Dc", + "commit_store": "0xAC24299a91b72d1Cb5B31147e3CF54964D896974", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Polygon Amoy": { + "off_ramp": "0x63440C7747d37bc6154b5538AE32b54FE0965AfA", + "commit_store": "0xAD22fA198CECfC534927aE1D480c460d5bB3460F", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Sepolia Testnet": { + "off_ramp": "0xf1c128Fe52Ea78CcAAB407509292E61ce38C1523", + "commit_store": "0x59dFD870dC4bd76A7B879A4f705Fdcd2595f85f9", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "WeMix Testnet": { + "off_ramp": "0xfd9B19c3725da5B517aA705B848ff3f21F98280e", + "commit_store": "0x3c1F1412563188aBc8FE3fd53E8F1Cb601CaB4f9", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + } + } + }, + "Base Sepolia": { + "is_native_fee_token": true, + "fee_token": "0x4200000000000000000000000000000000000006", + "bridge_tokens": [ + "0x88A2d74F47a237a62e7A51cdDa67270CE381555e" + ], + "bridge_tokens_pools": [ + "0x875207858c691F192C606068f417dCf666b2EC6B" + ], + "arm": "0x7827dD0481EE18DB646bD250d20A8eA43da52146", + "router": "0xD3b06cEbF099CE7DA4AcCf578aaebFDBd6e88a93", + "price_registry": "0x4D20536e60832bE579Cd38E89Dc03d11E1741FbA", + "wrapped_native": "0x4200000000000000000000000000000000000006", + "src_contracts": { + "Arbitrum Sepolia": { + "on_ramp": "0x58622a80c6DdDc072F2b527a99BE1D0934eb2b50", + "deployed_at": 0 + }, + "Avalanche Fuji": { + "on_ramp": "0xAbA09a1b7b9f13E05A6241292a66793Ec7d43357", + "deployed_at": 0 + }, + "BSC Testnet": { + "on_ramp": "0xD806966beAB5A3C75E5B90CDA4a6922C6A9F0c9d", + "deployed_at": 0 + }, + "Gnosis Chiado": { + "on_ramp": "0x2Eff2d1BF5C557d6289D208a7a43608f5E3FeCc2", + "deployed_at": 0 + }, + "Mode Sepolia": { + "on_ramp": "0x3d0115386C01436870a2c47e6297962284E70BA6", + "deployed_at": 0 + }, + "Optimism Sepolia": { + "on_ramp": "0x3b39Cd9599137f892Ad57A4f54158198D445D147", + "deployed_at": 0 + }, + "Sepolia Testnet": { + "on_ramp": "0x6486906bB2d85A6c0cCEf2A2831C11A2059ebfea", + "deployed_at": 0 + } + }, + "dest_contracts": { + "Arbitrum Sepolia": { + "off_ramp": "0xd364C06ac99a82a00d3eFF9F2F78E4Abe4b9baAA", + "commit_store": "0xdE8d0f47a71eA3fDFBD3162271652f2847939097", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Avalanche Fuji": { + "off_ramp": "0xAd91214efFee446500940c764DF77AF18427294F", + "commit_store": "0x1242b6c5e0e349b8d4BCf0938f961C4B4f7EA3Fa", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "BSC Testnet": { + "off_ramp": "0xd5E9508921434e8758f4540D55c1c066b7cc1598", + "commit_store": "0x1a86b29364D1B3fA3386329A361aA98A104b2742", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Gnosis Chiado": { + "off_ramp": "0x9Bb7e398ef9Acfe9cA584C39B1E233Cba62BB9f7", + "commit_store": "0x1F4B82cDebaC5e3a0Dd53183D47e51808B4a64cB", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Mode Sepolia": { + "off_ramp": "0xB26647A23e8b4284375e5C74b77c9557aE709D03", + "commit_store": "0x4b4fEB401d3E613e1D6242E155C83A80BF9ac2C9", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Optimism Sepolia": { + "off_ramp": "0x86a3910908eCaAA31Fcd9F0fC8841D8E98f1511d", + "commit_store": "0xE99a87C9b5ed4D2b6060195DEea5106ffF655736", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Sepolia Testnet": { + "off_ramp": "0x189F61D9B886Dd2975D5Abc893c8Cf5f5effda71", + "commit_store": "0xEE7e27346DCD1e711348D0F7f7ECB53a9a3a08a7", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + } + } + }, + "Blast Sepolia": { + "is_native_fee_token": true, + "fee_token": "0x4200000000000000000000000000000000000023", + "bridge_tokens": [ + "0x8D122C3e8ce9C8B62b87d3551bDfD8C259Bb0771" + ], + "bridge_tokens_pools": [ + "0xFb04129aD1EEDB741CC705ebC1978a7aB63e51f6" + ], + "arm": "0x09c1Ed4b112Fb33e594F2aACfEF407e2F14d7F9b", + "router": "0xfb2f2A207dC428da81fbAFfDDe121761f8Be1194", + "price_registry": "0xc8acE9dF450FaD007755C6C9AB4f0e9c8626E29C", + "wrapped_native": "0x4200000000000000000000000000000000000023", + "src_contracts": { + "Sepolia Testnet": { + "on_ramp": "0x85Ef19FC4C63c70744995DC38CAAEC185E0c619f", + "deployed_at": 0 + } + }, + "dest_contracts": { + "Sepolia Testnet": { + "off_ramp": "0x92cD24C278D34C726f377703E50875d8f9535dC2", + "commit_store": "0xcE1b4D50CeD56850182Bd58Ace91171cB249B873", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + } + } + }, + "Celo Alfajores": { + "is_native_fee_token": true, + "fee_token": "0x99604d0e2EfE7ABFb58BdE565b5330Bb46Ab3Dca", + "bridge_tokens": [ + "0x7e503dd1dAF90117A1b79953321043d9E6815C72" + ], + "bridge_tokens_pools": [ + "0xC6683ac4a0F62803Bec89a5355B36495ddF2C38b" + ], + "arm": "0xEbe35aA4F5e707485484c992AF2069a457b9bBB1", + "router": "0xb00E95b773528E2Ea724DB06B75113F239D15Dca", + "price_registry": "0x8F048206D11B2c69b8963E2EBd5968D141e022f4", + "wrapped_native": "0x99604d0e2EfE7ABFb58BdE565b5330Bb46Ab3Dca", + "src_contracts": { + "Sepolia Testnet": { + "on_ramp": "0x16a020c4bbdE363FaB8481262D30516AdbcfcFc8", + "deployed_at": 0 + } + }, + "dest_contracts": { + "Sepolia Testnet": { + "off_ramp": "0xa1b97F92D806BA040daf419AFC2765DC723683a4", + "commit_store": "0xcd92C0599Ac515e7588865cC45Eee21A74816aFc", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + } + } + }, + "Gnosis Chiado": { + "is_native_fee_token": true, + "fee_token": "0x18c8a7ec7897177E4529065a7E7B0878358B3BfF", + "bridge_tokens": [ + "0xA189971a2c5AcA0DFC5Ee7a2C44a2Ae27b3CF389" + ], + "bridge_tokens_pools": [ + "0xF9a21B587111e7E8745Fb8b13750014f19DB0014" + ], + "arm": "0xfE4fB161D870D0F672Ed9C5A898569603f77983F", + "router": "0x19b1bac554111517831ACadc0FD119D23Bb14391", + "price_registry": "0x2F4ACd1f8986c6B1788159C4c9a5fC3fceCCE363", + "wrapped_native": "0x18c8a7ec7897177E4529065a7E7B0878358B3BfF", + "src_contracts": { + "Arbitrum Sepolia": { + "on_ramp": "0x473b49fb592B54a4BfCD55d40E048431982879C9", + "deployed_at": 0 + }, + "Avalanche Fuji": { + "on_ramp": "0x610F76A35E17DA4542518D85FfEa12645eF111Fc", + "deployed_at": 0 + }, + "BSC Testnet": { + "on_ramp": "0xE48E6AA1fc7D0411acEA95F8C6CaD972A37721D4", + "deployed_at": 0 + }, + "Base Sepolia": { + "on_ramp": "0x41b4A51cAfb699D9504E89d19D71F92E886028a8", + "deployed_at": 0 + }, + "Optimism Sepolia": { + "on_ramp": "0xAae733212981e06D9C978Eb5148F8af03F54b6EF", + "deployed_at": 0 + }, + "Polygon Amoy": { + "on_ramp": "0x01800fCDd892e37f7829937271840A6F041bE62E", + "deployed_at": 0 + }, + "Sepolia Testnet": { + "on_ramp": "0x4ac7FBEc2A7298AbDf0E0F4fDC45015836C4bAFe", + "deployed_at": 0 + } + }, + "dest_contracts": { + "Arbitrum Sepolia": { + "off_ramp": "0x9aA82DBB53bf02096B771D40e9432A323a78fB26", + "commit_store": "0x5CdbA91aBC0cD81FC56bc10Ad1835C9E5fB38e5F", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Avalanche Fuji": { + "off_ramp": "0x3e33290B90fD0FF30a3FA138934DF028E4eCA348", + "commit_store": "0xCFe3556Aa42d40be09BD23aa80448a19443BE5B1", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "BSC Testnet": { + "off_ramp": "0xbc4AD54e91b213D4279af92c0C5518c0b96cf62D", + "commit_store": "0xff84e8Dd4Fd17eaBb23b6AeA6e1981830e54389C", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Base Sepolia": { + "off_ramp": "0x4117953A5ceeF12f5B8C1E973b470ab83a8CebA6", + "commit_store": "0x94ad41296186E81f31e1ed0B1BcF5fa9e1721C27", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Optimism Sepolia": { + "off_ramp": "0x33d2898F8fb7714FD1661791766f40754982a343", + "commit_store": "0x55d6Df194472f02CD481e506A277c4A29D0D1bCc", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Polygon Amoy": { + "off_ramp": "0x450543b1d85ca79885851D7b74dc982981b78229", + "commit_store": "0x23B79d940A769FE31b4C867A8BAE80117f24Ca81", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Sepolia Testnet": { + "off_ramp": "0xbf9036529123DE264bFA0FC7362fE25B650D4B16", + "commit_store": "0x5f7F1abD5c5EdaF2636D58B980e85355AF0Ef80d", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + } + } + }, + "Kroma Sepolia": { + "is_native_fee_token": true, + "fee_token": "0x4200000000000000000000000000000000000001", + "bridge_tokens": [ + "0x6AC3e353D1DDda24d5A5416024d6E436b8817A4e" + ], + "bridge_tokens_pools": [ + "0x0eE8add19554C7bb1920A183Ed47b4FAB9Eb7601" + ], + "arm": "0x08f9Af992368FAc58C936A2c5eBc9092894CEa9b", + "router": "0xA8C0c11bf64AF62CDCA6f93D3769B88BdD7cb93D", + "price_registry": "0xa1ed3A3aA29166C9c8448654A8cA6b7916BC8379", + "wrapped_native": "0x4200000000000000000000000000000000000001", + "src_contracts": { + "WeMix Testnet": { + "on_ramp": "0x6ea155Fc77566D9dcE01B8aa5D7968665dc4f0C5", + "deployed_at": 0 + } + }, + "dest_contracts": { + "WeMix Testnet": { + "off_ramp": "0xB602B6E5Caf08ac0C920EAE585aed100a8cF6f3B", + "commit_store": "0x89D5b13908b9063abCC6791dc724bF7B7c93634C", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + } + } + }, + "Metis Sepolia": { + "is_native_fee_token": true, + "fee_token": "0x5c48e07062aC4E2Cf4b9A768a711Aef18e8fbdA0", + "bridge_tokens": [ + "0x20Aa09AAb761e2E600d65c6929A9fd1E59821D3f" + ], + "bridge_tokens_pools": [ + "0xdE8451E952Eb43350614839cCAA84f7C8701a09C" + ], + "arm": "0xf0607A9BDdB5F54dB59ACaA0837aFec2D1c95df6", + "router": "0xaCdaBa07ECad81dc634458b98673931DD9d3Bc14", + "price_registry": "0x5DCE866b3ae6E0Ed153f0e149D7203A1B266cdF5", + "wrapped_native": "0x5c48e07062aC4E2Cf4b9A768a711Aef18e8fbdA0", + "src_contracts": { + "Sepolia Testnet": { + "on_ramp": "0x2Eff2d1BF5C557d6289D208a7a43608f5E3FeCc2", + "deployed_at": 0 + } + }, + "dest_contracts": { + "Sepolia Testnet": { + "off_ramp": "0x9Bb7e398ef9Acfe9cA584C39B1E233Cba62BB9f7", + "commit_store": "0x1F4B82cDebaC5e3a0Dd53183D47e51808B4a64cB", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + } + } + }, + "Mode Sepolia": { + "is_native_fee_token": true, + "fee_token": "0x4200000000000000000000000000000000000006", + "bridge_tokens": [ + "0xB9d4e1141E67ECFedC8A8139b5229b7FF2BF16F5" + ], + "bridge_tokens_pools": [ + "0x20bBc874bE3Cd94C3E4689EDD5D89dD1cE8Cb7C4" + ], + "arm": "0x9eC8a0AbC75ce08978FAf67958482461bCd93B18", + "router": "0xc49ec0eB4beb48B8Da4cceC51AA9A5bD0D0A4c43", + "price_registry": "0xa733ce82a84335b2E9D864312225B0F3D5d80600", + "wrapped_native": "0x4200000000000000000000000000000000000006", + "src_contracts": { + "Base Sepolia": { + "on_ramp": "0x73f7E074bd7291706a0C5412f51DB46441B1aDCB", + "deployed_at": 0 + }, + "Sepolia Testnet": { + "on_ramp": "0xfFdE9E8c34A27BEBeaCcAcB7b3044A0A364455C9", + "deployed_at": 0 + } + }, + "dest_contracts": { + "Base Sepolia": { + "off_ramp": "0x137a38c6b1Ad20101F93516aB2159Df525309168", + "commit_store": "0x8F43d867969F14619895d71E0A5b89E0bb20bF70", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Sepolia Testnet": { + "off_ramp": "0xcD44cec849B6a8eBd5551D6DFeEcA452257Dfe4d", + "commit_store": "0xbA66f08733E6715D33edDfb5a5947676bb45d0e0", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + } + } + }, + "Optimism Sepolia": { + "is_native_fee_token": true, + "fee_token": "0x4200000000000000000000000000000000000006", + "bridge_tokens": [ + "0x8aF4204e30565DF93352fE8E1De78925F6664dA7" + ], + "bridge_tokens_pools": [ + "0x3Cc9364260D80F09ccAC1eE6B07366dB598900E6" + ], + "arm": "0xF51366F72184E22cF4a7a8362508DB0d3370392d", + "router": "0x114A20A10b43D4115e5aeef7345a1A71d2a60C57", + "price_registry": "0x782a7Ba95215f2F7c3dD4C153cbB2Ae3Ec2d3215", + "wrapped_native": "0x4200000000000000000000000000000000000006", + "src_contracts": { + "Arbitrum Sepolia": { + "on_ramp": "0x1a86b29364D1B3fA3386329A361aA98A104b2742", + "deployed_at": 0 + }, + "Avalanche Fuji": { + "on_ramp": "0x6b38CC6Fa938D5AB09Bdf0CFe580E226fDD793cE", + "deployed_at": 0 + }, + "Base Sepolia": { + "on_ramp": "0xe284D2315a28c4d62C419e8474dC457b219DB969", + "deployed_at": 0 + }, + "Gnosis Chiado": { + "on_ramp": "0x835a5b8e6CA17c2bB5A336c93a4E22478E6F1C8A", + "deployed_at": 0 + }, + "Polygon Amoy": { + "on_ramp": "0x2Cf26fb01E9ccDb831414B766287c0A9e4551089", + "deployed_at": 0 + }, + "Sepolia Testnet": { + "on_ramp": "0xC8b93b46BF682c39B3F65Aa1c135bC8A95A5E43a", + "deployed_at": 0 + }, + "WeMix Testnet": { + "on_ramp": "0xc7E53f6aB982af7A7C3e470c8cCa283d3399BDAd", + "deployed_at": 0 + } + }, + "dest_contracts": { + "Arbitrum Sepolia": { + "off_ramp": "0xDc2c7A3d8068C6F09F0F3648d24C84e372F6014d", + "commit_store": "0xb1aFb5cbE3c29b5Db71F21442BA9EfD450BC23C3", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Avalanche Fuji": { + "off_ramp": "0x1F350718e015EB20E5065C09F4A7a3f66888aEeD", + "commit_store": "0x98650A8EB59f75D93563aB34FcF603b1A30e4CBF", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Base Sepolia": { + "off_ramp": "0x0a750ca77369e03613d7640548F4b2b1c695c3Bb", + "commit_store": "0x8fEBC74C26129C8d7E60288C6dCCc75eb494aA3C", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Gnosis Chiado": { + "off_ramp": "0xCE2CE7F940B7c839384e5D7e079A6aE80e8AD6dB", + "commit_store": "0x1b9D78Ec1CEEC439F0b7eA6C428A1a607D9FA7e4", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Polygon Amoy": { + "off_ramp": "0xD667b5706592D0b040C78fEe5EE17D243b7dCB41", + "commit_store": "0x96101BA5250EE9295c193693C1e08A55bC593664", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Sepolia Testnet": { + "off_ramp": "0x260AF9b83e0d2Bb6C9015fC9f0BfF8858A0CCE68", + "commit_store": "0x7a0bB92Bc8663abe6296d0162A9b41a2Cb2E0358", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "WeMix Testnet": { + "off_ramp": "0x9C08B7712af0344188aa5087D9e6aD0f47191037", + "commit_store": "0x4BE6DB0B884169a6A207fe5cad01eB4C025a13dB", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + } + } + }, + "Polygon Amoy": { + "is_native_fee_token": true, + "fee_token": "0x360ad4f9a9A8EFe9A8DCB5f461c4Cc1047E1Dcf9", + "bridge_tokens": [ + "0xcab0EF91Bee323d1A617c0a027eE753aFd6997E4" + ], + "bridge_tokens_pools": [ + "0x3064fB3EA546EE09A63AB3bD93E83D8B8525C636" + ], + "arm": "0x8b88C39D2875157aB4CE4AD3814409523d539ee1", + "router": "0x9C32fCB86BF0f4a1A8921a9Fe46de3198bb884B2", + "price_registry": "0xfb2f2A207dC428da81fbAFfDDe121761f8Be1194", + "wrapped_native": "0x360ad4f9a9A8EFe9A8DCB5f461c4Cc1047E1Dcf9", + "src_contracts": { + "Avalanche Fuji": { + "on_ramp": "0x8Fb98b3837578aceEA32b454f3221FE18D7Ce903", + "deployed_at": 0 + }, + "BSC Testnet": { + "on_ramp": "0xC6683ac4a0F62803Bec89a5355B36495ddF2C38b", + "deployed_at": 0 + }, + "Gnosis Chiado": { + "on_ramp": "0x2331F6D614C9Fd613Ff59a1aB727f1EDf6c37A68", + "deployed_at": 0 + }, + "Optimism Sepolia": { + "on_ramp": "0xA52cDAeb43803A80B3c0C2296f5cFe57e695BE11", + "deployed_at": 0 + }, + "Sepolia Testnet": { + "on_ramp": "0x35347A2fC1f2a4c5Eae03339040d0b83b09e6FDA", + "deployed_at": 0 + }, + "WeMix Testnet": { + "on_ramp": "0x26546096F64B5eF9A1DcDAe70Df6F4f8c2E10C61", + "deployed_at": 0 + } + }, + "dest_contracts": { + "Avalanche Fuji": { + "off_ramp": "0xa733ce82a84335b2E9D864312225B0F3D5d80600", + "commit_store": "0x09B0F93fC2111aE439e853884173AC5b2F809885", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "BSC Testnet": { + "off_ramp": "0x948dfaa4842fc23e0e362Fe8D4396AaE4E6DF7EA", + "commit_store": "0x7F4e739D40E58BBd59dAD388171d18e37B26326f", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Gnosis Chiado": { + "off_ramp": "0x17c542a28e08AEF5697251601C7b2B621d153D42", + "commit_store": "0x811250c20fAB9a1b7ca245453aC214ba637fBEB5", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Optimism Sepolia": { + "off_ramp": "0xfFdE9E8c34A27BEBeaCcAcB7b3044A0A364455C9", + "commit_store": "0x74ED442ad211050e9C05Dc9A267E037E3d74A03B", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Sepolia Testnet": { + "off_ramp": "0xFb04129aD1EEDB741CC705ebC1978a7aB63e51f6", + "commit_store": "0x63f875240149d29136053C954Ca164a9BfA81F77", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "WeMix Testnet": { + "off_ramp": "0xdE8451E952Eb43350614839cCAA84f7C8701a09C", + "commit_store": "0xaCdaBa07ECad81dc634458b98673931DD9d3Bc14", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + } + } + }, + "Sepolia Testnet": { + "is_native_fee_token": true, + "fee_token": "0x097D90c9d3E0B50Ca60e1ae45F6A81010f9FB534", + "bridge_tokens": [ + "0xFd57b4ddBf88a4e07fF4e34C487b99af2Fe82a05" + ], + "bridge_tokens_pools": [ + "0x38d1ef9619Cd40cf5482C045660Ae7C82Ada062c" + ], + "arm": "0x27Da8735d8d1402cEc072C234759fbbB4dABBC4A", + "router": "0x0BF3dE8c5D3e8A2B34D2BEeB17ABfCeBaf363A59", + "price_registry": "0x9EF7D57a4ea30b9e37794E55b0C75F2A70275dCc", + "wrapped_native": "0x097D90c9d3E0B50Ca60e1ae45F6A81010f9FB534", + "src_contracts": { + "Arbitrum Sepolia": { + "on_ramp": "0xe4Dd3B16E09c016402585a8aDFdB4A18f772a07e", + "deployed_at": 0 + }, + "Avalanche Fuji": { + "on_ramp": "0x0477cA0a35eE05D3f9f424d88bC0977ceCf339D4", + "deployed_at": 0 + }, + "BSC Testnet": { + "on_ramp": "0xD990f8aFA5BCB02f95eEd88ecB7C68f5998bD618", + "deployed_at": 0 + }, + "Base Sepolia": { + "on_ramp": "0x2B70a05320cB069e0fB55084D402343F832556E7", + "deployed_at": 0 + }, + "Blast Sepolia": { + "on_ramp": "0xDB75E9D9ca7577CcBd7232741be954cf26194a66", + "deployed_at": 0 + }, + "Celo Alfajores": { + "on_ramp": "0x3C86d16F52C10B2ff6696a0e1b8E0BcfCC085948", + "deployed_at": 0 + }, + "Gnosis Chiado": { + "on_ramp": "0x3E842E3A79A00AFdd03B52390B1caC6306Ea257E", + "deployed_at": 0 + }, + "Metis Sepolia": { + "on_ramp": "0x1C4640914cd57c5f02a68048A0fbb0E12d904223", + "deployed_at": 0 + }, + "Mode Sepolia": { + "on_ramp": "0xc630fbD4D0F6AEB00aD0793FB827b54fBB78e981", + "deployed_at": 0 + }, + "Optimism Sepolia": { + "on_ramp": "0x69CaB5A0a08a12BaFD8f5B195989D709E396Ed4d", + "deployed_at": 0 + }, + "Polygon Amoy": { + "on_ramp": "0x9f656e0361Fb5Df2ac446102c8aB31855B591692", + "deployed_at": 0 + }, + "WeMix Testnet": { + "on_ramp": "0xedFc22336Eb0B9B11Ff37C07777db27BCcDe3C65", + "deployed_at": 0 + }, + "ZKSync Sepolia": { + "on_ramp": "0x1Acb3A885feA37bdA30AB99b99327b14391f500F", + "deployed_at": 0 + } + }, + "dest_contracts": { + "Arbitrum Sepolia": { + "off_ramp": "0xF18896AB20a09A29e64fdEbA99FDb8EC328f43b1", + "commit_store": "0x93Ff9Dd39Dc01eac1fc4d2c9211D95Ee458CAB94", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Avalanche Fuji": { + "off_ramp": "0x000b26f604eAadC3D874a4404bde6D64a97d95ca", + "commit_store": "0x2dD9273F8208B8393350508131270A6574A69784", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "BSC Testnet": { + "off_ramp": "0xdE2d8E126e08d675fCD7fFa5a6CE49925f3Dc692", + "commit_store": "0x0050ac355a82caB31194507f94174297bf0655A7", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Base Sepolia": { + "off_ramp": "0x31c0B81832B333419f0DfD36A69F502cF9094aed", + "commit_store": "0xDFcde9d698a2B32DB2537DC9B752Cadd1D846a52", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Blast Sepolia": { + "off_ramp": "0x4e897e5cF3aC307F0541B2151A88bCD781c153a3", + "commit_store": "0xB656652841F347178e193951C4663652aCe36B74", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Celo Alfajores": { + "off_ramp": "0xB435E0f73c18C5a12C324CA1d02F81F2C3e6e761", + "commit_store": "0xbc5d74957F171e75F92c8F0E1C317A25a56a416D", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Gnosis Chiado": { + "off_ramp": "0x7db0115A0b3AAb01d30bf81123c5DD7B0C41Add5", + "commit_store": "0x6640723Ea801178c4383FA016b9781e7ef1016EF", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Metis Sepolia": { + "off_ramp": "0x4DB693A93E9d5196ECD42EC56CDEAe99dFC652ED", + "commit_store": "0xBfACd78F1412B6f93Ac23409bf456aFec1ABd845", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Mode Sepolia": { + "off_ramp": "0xbEfd8D65F6643De54F0b1268A3bf4618ff85dcB4", + "commit_store": "0x0C161D3470b45Cc677661654C30ce4AdE6aCD288", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Optimism Sepolia": { + "off_ramp": "0xD50590D4438411EDe47029b0FD7901A7145E5Df6", + "commit_store": "0xe85EEE9Fd434A7b8a586Ee086E828abF41839479", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Polygon Amoy": { + "off_ramp": "0x5032cbC0C4aEeD25bb6E45D8B3fAF05DB0688C5d", + "commit_store": "0xe6201C9996Cc7B6E828E10CbE937E693d577D318", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "WeMix Testnet": { + "off_ramp": "0x46b639a3C1a4CBfD326b94a2dB7415c27157282f", + "commit_store": "0x7b74554678816b045c1e7409327E086bD436aa46", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "ZKSync Sepolia": { + "off_ramp": "0xBaABd4166C892a1081a26535875A8fA3f22937b2", + "commit_store": "0xfda2e83F4D3f42B7629134ecD6E4b29FB8A7A07B", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + } + } + }, + "WeMix Testnet": { + "is_native_fee_token": true, + "fee_token": "0xbE3686643c05f00eC46e73da594c78098F7a9Ae7", + "bridge_tokens": [ + "0xF4E4057FbBc86915F4b2d63EEFFe641C03294ffc" + ], + "bridge_tokens_pools": [ + "0x82A92B2863F93Be70D20660088Ec060720bA2fdb" + ], + "arm": "0x8f6cb63eD5e379722580DFF0A051C140C64F9619", + "router": "0xA8C0c11bf64AF62CDCA6f93D3769B88BdD7cb93D", + "price_registry": "0x89D17571DB7C9540eeB36760E3c749C8fb984569", + "wrapped_native": "0xbE3686643c05f00eC46e73da594c78098F7a9Ae7", + "src_contracts": { + "Arbitrum Sepolia": { + "on_ramp": "0xA9DE3F7A617D67bC50c56baaCb9E0373C15EbfC6", + "deployed_at": 0 + }, + "Avalanche Fuji": { + "on_ramp": "0xC4aC84da458ba8e40210D2dF94C76E9a41f70069", + "deployed_at": 0 + }, + "BSC Testnet": { + "on_ramp": "0x5AD6eed6Be0ffaDCA4105050CF0E584D87E0c2F1", + "deployed_at": 0 + }, + "Kroma Sepolia": { + "on_ramp": "0x428C4dc89b6Bf908B82d77C9CBceA786ea8cc7D0", + "deployed_at": 0 + }, + "Optimism Sepolia": { + "on_ramp": "0x1961a7De751451F410391c251D4D4F98D71B767D", + "deployed_at": 0 + }, + "Polygon Amoy": { + "on_ramp": "0xd55148e841e76265B484d399eC71b7076ecB1216", + "deployed_at": 0 + }, + "Sepolia Testnet": { + "on_ramp": "0x4d57C6d8037C65fa66D6231844785a428310a735", + "deployed_at": 0 + } + }, + "dest_contracts": { + "Arbitrum Sepolia": { + "off_ramp": "0xeB1dFaB2464Bf0574D43e764E0c758f92e7ecAFb", + "commit_store": "0xcEaCa2B7890065c485f3E58657358a185Ad33791", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Avalanche Fuji": { + "off_ramp": "0x98e811Df9D2512f1aaf58D534607F583D6c54A4F", + "commit_store": "0x8e538351F6E5B2daF3c90C565C3738bca69a2716", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "BSC Testnet": { + "off_ramp": "0xB0e7f0fCcD3c961C473E7c44D939C1cDb4Cec1cB", + "commit_store": "0x4B56D8d53f1A6e0117B09700067De99581aA5542", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Kroma Sepolia": { + "off_ramp": "0xD685D2d224dd6D0Db2D56497db6270D77D9a7966", + "commit_store": "0x7e062D6880779a0347e7742058C1b1Ee4AA0B137", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Optimism Sepolia": { + "off_ramp": "0xA5f97Bc69Bf06e7C37B93265c5457420A92c5F4b", + "commit_store": "0xd48b9213583074f518D8f4336FDf35370D450132", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Polygon Amoy": { + "off_ramp": "0x6c8f5999B06FDE17B11E4e3C1062b761766F960f", + "commit_store": "0x957c3c2056192e58A8485eF31165fC490d474239", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + }, + "Sepolia Testnet": { + "off_ramp": "0x8AB103843ED9D28D2C5DAf5FdB9c3e1CE2B6c876", + "commit_store": "0x7d5297c5506ee2A7Ef121Da9bE02b6a6AD30b392", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + } + } + }, + "ZKSync Sepolia": { + "is_native_fee_token": true, + "fee_token": "0x4317b2eCD41851173175005783322D29E9bAee9E", + "arm": "0x926b4f90610Aa448f27c8e0Fd0afa4A17B7305F9", + "router": "0xA1fdA8aa9A8C4b945C45aD30647b01f07D7A0B16", + "price_registry": "0x648B6BB09bE1C5766C8AC578B9B4aC8497eA671F", + "wrapped_native": "0x4317b2eCD41851173175005783322D29E9bAee9E", + "src_contracts": { + "Sepolia Testnet": { + "on_ramp": "0x79a9a5e9e318e8e109776569574814bbf935125a", + "deployed_at": 0 + } + }, + "dest_contracts": { + "Sepolia Testnet": { + "off_ramp": "0x18FF69051479796175852578725Fc74F58E963F8", + "commit_store": "0xF694b4FD7889480dca3CD41244e8e3395a9EFBa0", + "receiver_dapp": "0xea387241d834D04CC408f4C2FE7ef2c477E4B3E7" + } + } + } + } +} +""" + +[CCIP.Env] +TTL = '8h' + +[CCIP.Env.Network] +selected_networks = [ + 'ARBITRUM_SEPOLIA', + 'AVALANCHE_FUJI', + 'BASE_SEPOLIA', + 'BLAST_SEPOLIA', + 'BSC_TESTNET', + 'CELO_ALFAJORES', + 'GNOSIS_CHIADO', + 'KROMA_SEPOLIA', + 'MODE_SEPOLIA', + 'OPTIMISM_SEPOLIA', + 'POLYGON_AMOY', + 'SEPOLIA', + 'METIS_SEPOLIA', + 'WEMIX_TESTNET', + 'ZKSYNC_SEPOLIA' +] + +[CCIP.Groups.load] +NetworkPairs = [ + 'AVALANCHE_FUJI,ARBITRUM_SEPOLIA', + 'AVALANCHE_FUJI,BASE_SEPOLIA', + 'AVALANCHE_FUJI,OPTIMISM_SEPOLIA', + 'AVALANCHE_FUJI,POLYGON_AMOY', + 'AVALANCHE_FUJI,GNOSIS_CHIADO', + 'ARBITRUM_SEPOLIA,BASE_SEPOLIA', + 'ARBITRUM_SEPOLIA,OPTIMISM_SEPOLIA', + 'ARBITRUM_SEPOLIA,SEPOLIA', + 'ARBITRUM_SEPOLIA,GNOSIS_CHIADO', + 'BASE_SEPOLIA,MODE_SEPOLIA', + 'BASE_SEPOLIA,OPTIMISM_SEPOLIA', + 'BASE_SEPOLIA,GNOSIS_CHIADO', + 'SEPOLIA,MODE_SEPOLIA', + 'SEPOLIA,CELO_ALFAJORES', + 'SEPOLIA,METIS_SEPOLIA', + 'SEPOLIA,BLAST_SEPOLIA', + 'SEPOLIA,ZKSYNC_SEPOLIA', + 'KROMA_SEPOLIA,WEMIX_TESTNET', + 'OPTIMISM_SEPOLIA,GNOSIS_CHIADO', + 'BSC_TESTNET,GNOSIS_CHIADO', +] + +BiDirectionalLane = true +PhaseTimeout = '20m' +ExistingDeployment = true + +[CCIP.Groups.load.TokenConfig] +NoOfTokensPerChain = 1 + +[CCIP.Groups.load.LoadProfile] +RequestPerUnitTime = [1] +TimeUnit = '6m' +TestDuration = '24h' +TestRunName = 'SoakTest_prod_testnet' +FailOnFirstErrorInLoad = true + +[[CCIP.Groups.load.LoadProfile.MsgProfile.MsgDetails]] +MsgType = 'Data' +DestGasLimit = 0 +DataLength = 100 +NoOfTokens = 1 +AmountPerToken = 1 \ No newline at end of file diff --git a/integration-tests/ccip-tests/testconfig/tomls/usdc_mock_deployment.toml b/integration-tests/ccip-tests/testconfig/tomls/usdc_mock_deployment.toml new file mode 100644 index 00000000000..82a3d492163 --- /dev/null +++ b/integration-tests/ccip-tests/testconfig/tomls/usdc_mock_deployment.toml @@ -0,0 +1,10 @@ +[CCIP] +[CCIP.Groups] +[CCIP.Groups.smoke] +USDCMockDeployment = true + +[CCIP.Groups.smoke.TokenConfig] +NoOfTokensPerChain = 2 + +[CCIP.Groups.smoke.MsgDetails] +NoOfTokens = 3 \ No newline at end of file diff --git a/integration-tests/ccip-tests/testconfig/tomls/varied-block-time-sample.toml b/integration-tests/ccip-tests/testconfig/tomls/varied-block-time-sample.toml new file mode 100644 index 00000000000..dfe947af115 --- /dev/null +++ b/integration-tests/ccip-tests/testconfig/tomls/varied-block-time-sample.toml @@ -0,0 +1,47 @@ +[CCIP] +[CCIP.Env] +[CCIP.Env.Network] +selected_networks= ['PRIVATE-CHAIN-1', 'PRIVATE-CHAIN-2'] + +[CCIP.Env.Network.EVMNetworks.PRIVATE-CHAIN-1] +evm_name = 'private-chain-1' +evm_chain_id = 2337 +evm_urls = ['wss://ignore-this-url.com'] +evm_http_urls = ['https://ignore-this-url.com'] +evm_keys = ['59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d'] +evm_simulated = true +client_implementation = 'Ethereum' +evm_chainlink_transaction_limit = 5000 +evm_transaction_timeout = '3m' +evm_minimum_confirmations = 1 +evm_gas_estimation_buffer = 1000 +evm_supports_eip1559 = true +evm_default_gas_limit = 6000000 +evm_finality_depth = 100 # with 50 blocks of finality, and 12s block time, we have 20 minutes of finality + +[CCIP.Env.Network.EVMNetworks.PRIVATE-CHAIN-2] +evm_name = 'private-chain-2' +evm_chain_id = 1337 +evm_urls = ['wss://ignore-this-url.com'] +evm_http_urls = ['https://ignore-this-url.com'] +evm_keys = ['ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80'] +evm_simulated = true +client_implementation = 'Ethereum' +evm_chainlink_transaction_limit = 5000 +evm_transaction_timeout = '3m' +evm_minimum_confirmations = 1 +evm_gas_estimation_buffer = 1000 +evm_supports_eip1559 = true +evm_default_gas_limit = 6000000 +evm_finality_depth = 1 # with 1 block of finality, and 1s block time, we have instant finality + + +[CCIP.Env.Network.AnvilConfigs.PRIVATE-CHAIN-1] +block_time = 12 + +[CCIP.Env.Network.AnvilConfigs.PRIVATE-CHAIN-2] +block_time = 1 + +[CCIP.Groups] +[CCIP.Groups.smoke] +LocalCluster = false \ No newline at end of file diff --git a/integration-tests/ccip-tests/testreporters/ccip.go b/integration-tests/ccip-tests/testreporters/ccip.go new file mode 100644 index 00000000000..d9c2908304c --- /dev/null +++ b/integration-tests/ccip-tests/testreporters/ccip.go @@ -0,0 +1,476 @@ +package testreporters + +import ( + "encoding/json" + "fmt" + "os" + "path/filepath" + "strings" + "sync" + "testing" + "time" + + "github.com/rs/zerolog" + "github.com/slack-go/slack" + + "github.com/smartcontractkit/chainlink-testing-framework/lib/k8s/config" + "github.com/smartcontractkit/chainlink-testing-framework/lib/testreporters" +) + +type Phase string +type Status string + +const ( + // These are the different phases of a CCIP transaction lifecycle + // You can see an illustration of the flow here: https://docs.chain.link/images/ccip/ccip-diagram-04_v04.webp + TX Phase = "CCIP-Send Transaction" // The initial transaction is sent from the client to the OnRamp + CCIPSendRe Phase = "CCIPSendRequested" // The OnRamp emits the CCIPSendRequested event which acknowledges the transaction requesting a CCIP transfer + SourceLogFinalized Phase = "SourceLogFinalizedTentatively" // The source chain finalizes the transaction where the CCIPSendRequested event was emitted + Commit Phase = "Commit-ReportAccepted" // The destination chain commits to the transaction and emits the ReportAccepted event + ReportBlessed Phase = "ReportBlessedByARM" // The destination chain emits the ReportBlessed event. This is triggered by the RMN, for tests we usually mock it. + E2E Phase = "CommitAndExecute" // This is effectively an alias for the below phase, but it's used to represent the end-to-end flow + ExecStateChanged Phase = "ExecutionStateChanged" // The destination chain emits the ExecutionStateChanged event. This indicates that the transaction has been executed + + Success Status = "✅" + Failure Status = "❌" + Unsure = "⚠️" + slackFile string = "payload_ccip.json" +) + +type AggregatorMetrics struct { + Min float64 `json:"min_duration_for_successful_requests(s),omitempty"` + Max float64 `json:"max_duration_for_successful_requests(s),omitempty"` + Avg float64 `json:"avg_duration_for_successful_requests(s),omitempty"` + sum float64 + count int +} +type TransactionStats struct { + Fee string `json:"fee,omitempty"` + MsgID string `json:"msg_id,omitempty"` + GasUsed uint64 `json:"gas_used,omitempty"` + TxHash string `json:"tx_hash,omitempty"` + NoOfTokensSent int `json:"no_of_tokens_sent,omitempty"` + MessageBytesLength int64 `json:"message_bytes_length,omitempty"` + FinalizedByBlock string `json:"finalized_block_num,omitempty"` + FinalizedAt string `json:"finalized_at,omitempty"` + CommitRoot string `json:"commit_root,omitempty"` +} + +type PhaseStat struct { + SeqNum uint64 `json:"seq_num,omitempty"` + Duration float64 `json:"duration,omitempty"` + Status Status `json:"success"` + SendTransactionStats *TransactionStats `json:"ccip_send_data,omitempty"` +} + +type RequestStat struct { + ReqNo int64 + SeqNum uint64 + SourceNetwork string + DestNetwork string + StatusByPhase map[Phase]PhaseStat `json:"status_by_phase,omitempty"` +} + +func (stat *RequestStat) UpdateState( + lggr *zerolog.Logger, + seqNum uint64, + step Phase, + duration time.Duration, + state Status, + sendTransactionStats *TransactionStats, +) { + durationInSec := duration.Seconds() + stat.SeqNum = seqNum + phaseDetails := PhaseStat{ + SeqNum: seqNum, + Duration: durationInSec, + Status: state, + SendTransactionStats: sendTransactionStats, + } + + event := lggr.Info() + if seqNum != 0 { + event.Uint64("seq num", seqNum) + } + // if any of the phase fails mark the E2E as failed + if state == Failure || state == Unsure { + stat.StatusByPhase[E2E] = PhaseStat{ + SeqNum: seqNum, + Status: state, + } + stat.StatusByPhase[step] = phaseDetails + lggr.Info(). + Str(fmt.Sprint(E2E), string(state)). + Msgf("reqNo %d", stat.ReqNo) + event.Str(string(step), string(state)).Msgf("reqNo %d", stat.ReqNo) + } else { + event.Str(string(step), string(Success)).Msgf("reqNo %d", stat.ReqNo) + // we don't want to save phase details for TX and CCIPSendRe to avoid redundancy if these phases are successful + if step != TX && step != CCIPSendRe { + stat.StatusByPhase[step] = phaseDetails + } + if step == Commit || step == ReportBlessed || step == ExecStateChanged { + stat.StatusByPhase[E2E] = PhaseStat{ + SeqNum: seqNum, + Status: state, + Duration: stat.StatusByPhase[step].Duration + stat.StatusByPhase[E2E].Duration, + } + if step == ExecStateChanged { + lggr.Info(). + Str(fmt.Sprint(E2E), string(Success)). + Msgf("reqNo %d", stat.ReqNo) + } + } + } +} + +func NewCCIPRequestStats(reqNo int64, source, dest string) *RequestStat { + return &RequestStat{ + ReqNo: reqNo, + StatusByPhase: make(map[Phase]PhaseStat), + SourceNetwork: source, + DestNetwork: dest, + } +} + +type CCIPLaneStats struct { + lane string + lggr *zerolog.Logger + TotalRequests int64 `json:"total_requests,omitempty"` // TotalRequests is the total number of requests made + SuccessCountsByPhase map[Phase]int64 `json:"success_counts_by_phase,omitempty"` // SuccessCountsByPhase is the number of requests that succeeded in each phase + FailedCountsByPhase map[Phase]int64 `json:"failed_counts_by_phase,omitempty"` // FailedCountsByPhase is the number of requests that failed in each phase + DurationStatByPhase map[Phase]AggregatorMetrics `json:"duration_stat_by_phase,omitempty"` // DurationStatByPhase is the duration statistics for each phase + statusByPhaseByRequests sync.Map +} + +func (testStats *CCIPLaneStats) UpdatePhaseStatsForReq(stat *RequestStat) { + testStats.statusByPhaseByRequests.Store(stat.ReqNo, stat.StatusByPhase) +} + +func (testStats *CCIPLaneStats) Aggregate(phase Phase, durationInSec float64) { + if prevDur, ok := testStats.DurationStatByPhase[phase]; !ok { + testStats.DurationStatByPhase[phase] = AggregatorMetrics{ + Min: durationInSec, + Max: durationInSec, + sum: durationInSec, + count: 1, + } + } else { + if prevDur.Min > durationInSec { + prevDur.Min = durationInSec + } + if prevDur.Max < durationInSec { + prevDur.Max = durationInSec + } + prevDur.sum = prevDur.sum + durationInSec + prevDur.count++ + testStats.DurationStatByPhase[phase] = prevDur + } +} + +func (testStats *CCIPLaneStats) Finalize(lane string) { + phases := []Phase{E2E, TX, CCIPSendRe, SourceLogFinalized, Commit, ReportBlessed, ExecStateChanged} + events := make(map[Phase]*zerolog.Event) + testStats.statusByPhaseByRequests.Range(func(key, value interface{}) bool { + if reqNo, ok := key.(int64); ok { + if stat, ok := value.(map[Phase]PhaseStat); ok { + for phase, phaseStat := range stat { + if phaseStat.Status == Success { + testStats.SuccessCountsByPhase[phase]++ + testStats.Aggregate(phase, phaseStat.Duration) + } else { + testStats.FailedCountsByPhase[phase]++ + } + } + } + if reqNo > testStats.TotalRequests { + testStats.TotalRequests = reqNo + } + } + return true + }) + // if no phase stats are found return + if testStats.TotalRequests <= 0 { + return + } + testStats.lggr.Info().Int64("Total Requests Triggerred", testStats.TotalRequests).Msg("Test Run Completed") + for _, phase := range phases { + events[phase] = testStats.lggr.Info().Str("Phase", string(phase)) + if phaseStat, ok := testStats.DurationStatByPhase[phase]; ok { + testStats.DurationStatByPhase[phase] = AggregatorMetrics{ + Min: phaseStat.Min, + Max: phaseStat.Max, + Avg: phaseStat.sum / float64(phaseStat.count), + } + events[phase]. + Str("Min Duration for Successful Requests", fmt.Sprintf("%.02f", testStats.DurationStatByPhase[phase].Min)). + Str("Max Duration for Successful Requests", fmt.Sprintf("%.02f", testStats.DurationStatByPhase[phase].Max)). + Str("Average Duration for Successful Requests", fmt.Sprintf("%.02f", testStats.DurationStatByPhase[phase].Avg)) + } + if failed, ok := testStats.FailedCountsByPhase[phase]; ok { + events[phase].Int64("Failed Count", failed) + } + if s, ok := testStats.SuccessCountsByPhase[phase]; ok { + events[phase].Int64("Successful Count", s) + } + events[phase].Msgf("Phase Stats for Lane %s", lane) + } +} + +type CCIPTestReporter struct { + t *testing.T + logger *zerolog.Logger + startTime int64 + endTime int64 + grafanaURLProvider testreporters.GrafanaURLProvider + grafanaURL string + grafanaQueryParams []string + namespace string + reportFilePath string + duration time.Duration // duration is the duration of the test + FailedLanes map[string]Phase `json:"failed_lanes_and_phases,omitempty"` // FailedLanes is the list of lanes that failed and the phase at which it failed + LaneStats map[string]*CCIPLaneStats `json:"lane_stats"` // LaneStats is the statistics for each lane + mu *sync.Mutex + sendSlackReport bool +} + +func (r *CCIPTestReporter) SetSendSlackReport(sendSlackReport bool) { + r.sendSlackReport = sendSlackReport +} + +func (r *CCIPTestReporter) CompleteGrafanaDashboardURL() error { + if r.grafanaURLProvider == nil { + return fmt.Errorf("grafana URL provider is not set") + } + grafanaUrl, err := r.grafanaURLProvider.GetGrafanaBaseURL() + if err != nil { + return err + } + + dashboardUrl, err := r.grafanaURLProvider.GetGrafanaDashboardURL() + if err != nil { + return err + } + r.grafanaURL = fmt.Sprintf("%s%s", grafanaUrl, dashboardUrl) + err = r.AddToGrafanaDashboardQueryParams( + fmt.Sprintf("from=%d", r.startTime), + fmt.Sprintf("to=%d", r.endTime), + fmt.Sprintf("var-remote_runner=%s", r.namespace)) + if err != nil { + return err + } + + err = r.FormatGrafanaURLWithQueryParameters() + if err != nil { + return fmt.Errorf("error formatting grafana URL: %w", err) + } + r.logger.Info().Str("Dashboard", r.grafanaURL).Msg("Dashboard URL") + return nil +} + +// FormatGrafanaURLWithQueryParameters adds query params to the grafana URL +// The query params are added in the format ?key=value if the grafana URL does not have any query params +// If the grafana URL already has query params, the query params are added in the format &key=value +// The function parameter qParam should be in the format key=value +// If the function parameter qParam does not contain an =, an error is returned +func (r *CCIPTestReporter) FormatGrafanaURLWithQueryParameters() error { + for _, v := range r.grafanaQueryParams { + if !strings.Contains(v, "=") { + return fmt.Errorf("invalid query param %s", v) + } + if strings.Contains(r.grafanaURL, "?") { + r.grafanaURL = fmt.Sprintf("%s&%s", r.grafanaURL, v) + continue + } + r.grafanaURL = fmt.Sprintf("%s?%s", r.grafanaURL, v) + } + return nil +} + +// AddToGrafanaDashboardQueryParams adds query params to the QueryParams slice +// The function parameter qParam should be in the format key=value +// If the function parameter qParam does not contain an =, an error is returned +func (r *CCIPTestReporter) AddToGrafanaDashboardQueryParams(qParams ...string) error { + for _, qParam := range qParams { + if !strings.Contains(qParam, "=") { + return fmt.Errorf("invalid query param %s", qParam) + } + r.grafanaQueryParams = append(r.grafanaQueryParams, qParam) + } + return nil +} + +// SendSlackNotification sends a slack notification to the specified channel set in the environment variable "SLACK_CHANNEL" +// notifying the user set in the environment variable "SLACK_USER" +// The function returns an error if the slack notification fails +func (r *CCIPTestReporter) SendSlackNotification(t *testing.T, slackClient *slack.Client, _ testreporters.GrafanaURLProvider) error { + if r.sendSlackReport { + r.logger.Info().Msg("Sending Slack notification") + } else { + r.logger.Info().Msg("Slack notification not enabled") + return nil + } + if testreporters.SlackAPIKey == "" || testreporters.SlackChannel == "" || testreporters.SlackUserID == "" { + r.logger.Warn().Msg("Slack API Key, Channel or User ID not set. Skipping Slack notification") + return nil + } + if slackClient == nil { + slackClient = slack.New(testreporters.SlackAPIKey) + } + + var msgTexts []string + headerText := ":white_check_mark: CCIP Test PASSED :white_check_mark:" + if t.Failed() { + headerText = ":x: CCIP Test FAILED :x:" + } + // If grafanaURLProvider is not set, form the message notifying about the failed lanes with the report file path + if r.grafanaURLProvider == nil { + for name, lane := range r.LaneStats { + if lane.FailedCountsByPhase[E2E] > 0 { + msgTexts = append(msgTexts, + fmt.Sprintf("lane %s :x:", name), + fmt.Sprintf( + "\nNumber of ccip-send= %d"+ + "\nNo of failed requests = %d", lane.TotalRequests, lane.FailedCountsByPhase[E2E])) + } + } + + msgTexts = append(msgTexts, fmt.Sprintf( + "\nTest Run Summary created on _remote-test-runner_ at _%s_\nNotifying <@%s>", + r.reportFilePath, testreporters.SlackUserID)) + } else { + // If grafanaURLProvider is set, form the message with the grafana dashboard link + err := r.CompleteGrafanaDashboardURL() + if err != nil { + return fmt.Errorf("error formatting grafana dashboard URL: %w", err) + } + msgTexts = append(msgTexts, fmt.Sprintf( + "\nTest Run Completed \nNotifying <@%s>\n<%s|CCIP Long Running Tests Dashboard>", + testreporters.SlackUserID, r.grafanaURL)) + } + + messageBlocks := testreporters.SlackNotifyBlocks(headerText, r.namespace, msgTexts) + ts, err := testreporters.SendSlackMessage(slackClient, slack.MsgOptionBlocks(messageBlocks...)) + if err != nil { + fmt.Println(messageBlocks) + return fmt.Errorf("failed to send slack message: %w", err) + } + // if grafanaURLProvider is set, we don't want to write the report in a file + // the report will be shared in terms of grafana dashboard link + if r.grafanaURLProvider == nil { + return testreporters.UploadSlackFile(slackClient, slack.FileUploadParameters{ + Title: fmt.Sprintf("CCIP Test Report %s", r.namespace), + Filetype: "json", + Filename: fmt.Sprintf("ccip_report_%s.csv", r.namespace), + File: r.reportFilePath, + InitialComment: fmt.Sprintf("CCIP Test Report %s.", r.namespace), + Channels: []string{testreporters.SlackChannel}, + ThreadTimestamp: ts, + }) + } + return nil +} + +func (r *CCIPTestReporter) WriteReport(folderPath string) error { + l := r.logger + for k := range r.LaneStats { + r.LaneStats[k].Finalize(k) + // if E2E for the lane has failed + if _, ok := r.LaneStats[k].FailedCountsByPhase[E2E]; ok { + // find the phase at which it failed + for phase, count := range r.LaneStats[k].FailedCountsByPhase { + if count > 0 && phase != E2E { + r.FailedLanes[k] = phase + break + } + } + } + } + if len(r.FailedLanes) > 0 { + r.logger.Info().Interface("List of Failed Lanes", r.FailedLanes).Msg("Failed Lanes") + } + + // if grafanaURLProvider is set, we don't want to write the report in a file + // the report will be shared in terms of grafana dashboard link + if r.grafanaURLProvider != nil { + return nil + } + l.Debug().Str("Folder Path", folderPath).Msg("Writing CCIP Test Report") + if err := testreporters.MkdirIfNotExists(folderPath); err != nil { + return err + } + reportLocation := filepath.Join(folderPath, slackFile) + r.reportFilePath = reportLocation + slackFile, err := os.Create(reportLocation) + defer func() { + err = slackFile.Close() + if err != nil { + l.Error().Err(err).Msg("Error closing slack file") + } + }() + if err != nil { + return err + } + stats, err := json.MarshalIndent(r, "", " ") + if err != nil { + return err + } + _, err = slackFile.Write(stats) + if err != nil { + return err + } + return nil +} + +// SetNamespace sets the namespace of the report for clean reports +func (r *CCIPTestReporter) SetNamespace(namespace string) { + // if the test is run in remote runner, the namespace will be set to the remote runner's namespace + if value, set := os.LookupEnv(config.EnvVarNamespace); set && value != "" { + r.namespace = value + return + } + // if the namespace is not set, set it to the namespace provided + r.namespace = namespace +} + +// SetDuration sets the duration of the test +func (r *CCIPTestReporter) SetDuration(d time.Duration) { + r.duration = d +} + +func (r *CCIPTestReporter) SetGrafanaURLProvider(provider testreporters.GrafanaURLProvider) { + r.grafanaURLProvider = provider +} + +func (r *CCIPTestReporter) AddNewLane(name string, lggr *zerolog.Logger) *CCIPLaneStats { + r.mu.Lock() + defer r.mu.Unlock() + i := &CCIPLaneStats{ + lane: name, + lggr: lggr, + FailedCountsByPhase: make(map[Phase]int64), + SuccessCountsByPhase: make(map[Phase]int64), + DurationStatByPhase: make(map[Phase]AggregatorMetrics), + } + r.LaneStats[name] = i + return i +} + +func (r *CCIPTestReporter) SendReport(t *testing.T, namespace string, slackSend bool) error { + logsPath := filepath.Join("logs", fmt.Sprintf("%s-%s-%d", t.Name(), namespace, time.Now().Unix())) + r.SetNamespace(namespace) + r.endTime = time.Now().UTC().UnixMilli() + r.SetSendSlackReport(r.namespace != "" && slackSend) + return testreporters.SendReport(t, namespace, logsPath, r, nil) +} + +func NewCCIPTestReporter(t *testing.T, lggr *zerolog.Logger) *CCIPTestReporter { + return &CCIPTestReporter{ + LaneStats: make(map[string]*CCIPLaneStats), + startTime: time.Now().UTC().UnixMilli(), + logger: lggr, + t: t, + mu: &sync.Mutex{}, + FailedLanes: make(map[string]Phase), + } +} diff --git a/integration-tests/ccip-tests/testsetups/ccip.go b/integration-tests/ccip-tests/testsetups/ccip.go new file mode 100644 index 00000000000..eee424d50d1 --- /dev/null +++ b/integration-tests/ccip-tests/testsetups/ccip.go @@ -0,0 +1,1436 @@ +package testsetups + +import ( + "context" + "fmt" + "math/big" + "math/rand" + "os" + "regexp" + "strconv" + "strings" + "sync" + "testing" + "time" + + "github.com/AlekSi/pointer" + "github.com/ethereum/go-ethereum/common" + "github.com/google/uuid" + "github.com/pkg/errors" + "github.com/rs/zerolog" + "github.com/rs/zerolog/log" + "github.com/stretchr/testify/require" + "go.uber.org/atomic" + "go.uber.org/multierr" + "go.uber.org/zap/zapcore" + "golang.org/x/sync/errgroup" + + chainselectors "github.com/smartcontractkit/chain-selectors" + + "github.com/smartcontractkit/chainlink-testing-framework/lib/blockchain" + ctfClient "github.com/smartcontractkit/chainlink-testing-framework/lib/client" + ctf_config "github.com/smartcontractkit/chainlink-testing-framework/lib/config" + ctf_config_types "github.com/smartcontractkit/chainlink-testing-framework/lib/config/types" + ctftestenv "github.com/smartcontractkit/chainlink-testing-framework/lib/docker/test_env" + "github.com/smartcontractkit/chainlink-testing-framework/lib/k8s/config" + "github.com/smartcontractkit/chainlink-testing-framework/lib/k8s/environment" + "github.com/smartcontractkit/chainlink-testing-framework/lib/networks" + "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/testcontext" + + integrationactions "github.com/smartcontractkit/chainlink/integration-tests/actions" + "github.com/smartcontractkit/chainlink/integration-tests/ccip-tests/actions" + "github.com/smartcontractkit/chainlink/integration-tests/ccip-tests/contracts" + "github.com/smartcontractkit/chainlink/integration-tests/ccip-tests/contracts/laneconfig" + "github.com/smartcontractkit/chainlink/integration-tests/ccip-tests/testconfig" + ccipconfig "github.com/smartcontractkit/chainlink/integration-tests/ccip-tests/testconfig" + "github.com/smartcontractkit/chainlink/integration-tests/ccip-tests/testreporters" + testutils "github.com/smartcontractkit/chainlink/integration-tests/ccip-tests/utils" + "github.com/smartcontractkit/chainlink/integration-tests/docker/test_env" +) + +var ( + GethResourceProfile = map[string]interface{}{ + "requests": map[string]interface{}{ + "cpu": "4", + "memory": "6Gi", + }, + "limits": map[string]interface{}{ + "cpu": "4", + "memory": "6Gi", + }, + } + // to set default values through test config use sync.once + setContractVersion sync.Once + setOCRParams sync.Once + setConfigOverrides sync.Once +) + +type NetworkPair struct { + NetworkA blockchain.EVMNetwork + NetworkB blockchain.EVMNetwork + ChainClientA blockchain.EVMClient + ChainClientB blockchain.EVMClient +} + +// LeaderLane is to hold the details of leader lane source and destination network +type LeaderLane struct { + source string + dest string +} + +type CCIPTestConfig struct { + Test *testing.T + EnvInput *testconfig.Common + TestGroupInput *testconfig.CCIPTestGroupConfig + VersionInput map[contracts.Name]contracts.Version + ContractsInput *testconfig.CCIPContractConfig + AllNetworks map[string]blockchain.EVMNetwork + SelectedNetworks []blockchain.EVMNetwork + NetworkPairs []NetworkPair + LeaderLanes []LeaderLane + GethResourceProfile map[string]interface{} +} + +func (c *CCIPTestConfig) useExistingDeployment() bool { + return pointer.GetBool(c.TestGroupInput.ExistingDeployment) +} + +func (c *CCIPTestConfig) useSeparateTokenDeployer() bool { + return contracts.NeedTokenAdminRegistry() && + !pointer.GetBool(c.TestGroupInput.TokenConfig.CCIPOwnerTokens) && + !c.useExistingDeployment() +} + +func (c *CCIPTestConfig) MultiCallEnabled() bool { + return pointer.GetBool(c.TestGroupInput.MulticallInOneTx) +} + +func (c *CCIPTestConfig) localCluster() bool { + return pointer.GetBool(c.TestGroupInput.LocalCluster) +} + +func (c *CCIPTestConfig) ExistingCLCluster() bool { + return c.EnvInput.ExistingCLCluster != nil +} + +func (c *CCIPTestConfig) CLClusterNeedsUpgrade() bool { + if c.EnvInput.NewCLCluster == nil { + return false + } + if c.EnvInput.NewCLCluster.Common != nil && c.EnvInput.NewCLCluster.Common.ChainlinkUpgradeImage != nil { + return true + } + for _, node := range c.EnvInput.NewCLCluster.Nodes { + if node.ChainlinkUpgradeImage != nil { + return true + } + } + return false +} + +func (c *CCIPTestConfig) AddPairToNetworkList(networkA, networkB blockchain.EVMNetwork) { + if c.AllNetworks == nil { + c.AllNetworks = make(map[string]blockchain.EVMNetwork) + } + firstOfPairs := []blockchain.EVMNetwork{networkA} + secondOfPairs := []blockchain.EVMNetwork{networkB} + // if no of lanes per pair is greater than 1, copy common contracts from the same network + // if no of lanes per pair is more than 1, the networks are added into the inputs.AllNetworks with a suffix of - + // for example, if no of lanes per pair is 2, and the network pairs are called "testnetA", "testnetB", + // the network will be added as "testnetA-1", testnetA-2","testnetB-1", testnetB-2" + // to deploy 4 lanes between same network pair "testnetA", "testnetB". + // lanes - testnetA-1<->testnetB-1, testnetA-1<-->testnetB-2 , testnetA-2<--> testnetB-1, testnetA-2<--> testnetB-2 + if c.TestGroupInput.NoOfRoutersPerPair > 1 { + firstOfPairs[0].Name = fmt.Sprintf("%s-%d", firstOfPairs[0].Name, 1) + secondOfPairs[0].Name = fmt.Sprintf("%s-%d", secondOfPairs[0].Name, 1) + for i := 1; i < c.TestGroupInput.NoOfRoutersPerPair; i++ { + netsA := networkA + netsA.Name = fmt.Sprintf("%s-%d", netsA.Name, i+1) + netsB := networkB + netsB.Name = fmt.Sprintf("%s-%d", netsB.Name, i+1) + firstOfPairs = append(firstOfPairs, netsA) + secondOfPairs = append(secondOfPairs, netsB) + } + } + + for i := range firstOfPairs { + c.AllNetworks[firstOfPairs[i].Name] = firstOfPairs[i] + c.AllNetworks[secondOfPairs[i].Name] = secondOfPairs[i] + c.NetworkPairs = append(c.NetworkPairs, NetworkPair{ + NetworkA: firstOfPairs[i], + NetworkB: secondOfPairs[i], + }) + } +} + +func (c *CCIPTestConfig) SetNetworkPairs(lggr zerolog.Logger) error { + var allError error + var err error + var inputNetworks []string + c.SelectedNetworks, inputNetworks, err = c.EnvInput.EVMNetworks() + if err != nil { + allError = multierr.Append(allError, fmt.Errorf("failed to get networks: %w", err)) + return allError + } + + networkByChainName := make(map[string]blockchain.EVMNetwork) + for i, net := range c.SelectedNetworks { + networkByChainName[inputNetworks[i]] = net + } + // if network pairs are provided, then use them + if c.TestGroupInput.NetworkPairs != nil { + networkPairs := c.TestGroupInput.NetworkPairs + + for _, pair := range networkPairs { + networkNames := strings.Split(pair, ",") + if len(networkNames) != 2 { + allError = multierr.Append(allError, fmt.Errorf("invalid network pair")) + } + // check if the network names are valid + network1, ok := networkByChainName[networkNames[0]] + if !ok { + allError = multierr.Append(allError, fmt.Errorf("network %s not found in network config", networkNames[0])) + } + network2, ok := networkByChainName[networkNames[1]] + if !ok { + allError = multierr.Append(allError, fmt.Errorf("network %s not found in network config", networkNames[1])) + } + c.AddPairToNetworkList(network1, network2) + } + lggr.Info().Int("Pairs", len(c.NetworkPairs)).Msg("No Of Lanes") + return allError + } + + if c.TestGroupInput.NoOfNetworks == 0 { + c.TestGroupInput.NoOfNetworks = len(c.SelectedNetworks) + } + // TODO remove this when CTF network timeout is fixed + for i := range c.SelectedNetworks { + c.SelectedNetworks[i].Timeout = blockchain.StrDuration{ + Duration: 3 * time.Minute, + } + } + simulated := c.SelectedNetworks[0].Simulated + for i := 1; i < len(c.SelectedNetworks); i++ { + if c.SelectedNetworks[i].Simulated != simulated { + lggr.Fatal().Msg("networks must be of the same type either simulated or real") + } + } + + // if the networks are not simulated use the first p.NoOfNetworks networks from the selected networks + if !simulated && len(c.SelectedNetworks) != c.TestGroupInput.NoOfNetworks { + if len(c.SelectedNetworks) < c.TestGroupInput.NoOfNetworks { + allError = multierr.Append(allError, fmt.Errorf("not enough networks provided")) + } else { + c.SelectedNetworks = c.SelectedNetworks[:c.TestGroupInput.NoOfNetworks] + } + } + // If provided networks is lesser than the required number of networks + // and the provided networks are simulated network, create replicas of the provided networks with + // different chain ids + if simulated && len(c.SelectedNetworks) < c.TestGroupInput.NoOfNetworks { + actualNoOfNetworks := len(c.SelectedNetworks) + n := c.SelectedNetworks[0] + var chainIDs []int64 + existingChainIDs := make(map[uint64]struct{}) + for _, net := range c.SelectedNetworks { + existingChainIDs[uint64(net.ChainID)] = struct{}{} + } + for _, id := range chainselectors.TestChainIds() { + // if the chain id already exists in the already provided selected networks, skip it + if _, exists := existingChainIDs[id]; exists { + continue + } + chainIDs = append(chainIDs, int64(id)) + } + for i := 0; i < c.TestGroupInput.NoOfNetworks-actualNoOfNetworks; i++ { + chainID := chainIDs[i] + // if i is greater than the number of simulated pvt keys, rotate the keys + if i > len(networks.AdditionalSimulatedPvtKeys)-1 { + networks.AdditionalSimulatedPvtKeys = append(networks.AdditionalSimulatedPvtKeys, networks.AdditionalSimulatedPvtKeys...) + } + name := fmt.Sprintf("private-chain-%d", len(c.SelectedNetworks)+1) + c.SelectedNetworks = append(c.SelectedNetworks, blockchain.EVMNetwork{ + Name: name, + ChainID: chainID, + Simulated: true, + PrivateKeys: []string{ + networks.AdditionalSimulatedPvtKeys[i], + "ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80", // second key for token deployments + }, + ChainlinkTransactionLimit: n.ChainlinkTransactionLimit, + Timeout: n.Timeout, + MinimumConfirmations: n.MinimumConfirmations, + GasEstimationBuffer: n.GasEstimationBuffer + 1000, + ClientImplementation: n.ClientImplementation, + DefaultGasLimit: n.DefaultGasLimit, + FinalityDepth: n.FinalityDepth, + SupportsEIP1559: true, + }) + if existing, ok := c.EnvInput.Network.AnvilConfigs[strings.ToUpper(n.Name)]; c.EnvInput.Network.AnvilConfigs != nil && ok { + c.EnvInput.Network.AnvilConfigs[strings.ToUpper(name)] = existing + } + + chainConfig := &ctf_config.EthereumChainConfig{} + err := chainConfig.Default() + if err != nil { + allError = multierr.Append(allError, fmt.Errorf("failed to get default chain config: %w", err)) + } else { + chainConfig.ChainID = int(chainID) + eth1 := ctf_config_types.EthereumVersion_Eth1 + geth := ctf_config_types.ExecutionLayer_Geth + + c.EnvInput.PrivateEthereumNetworks[fmt.Sprint(chainID)] = &ctf_config.EthereumNetworkConfig{ + EthereumVersion: ð1, + ExecutionLayer: &geth, + EthereumChainConfig: chainConfig, + } + } + } + } + + if c.TestGroupInput.NoOfNetworks > 2 { + c.FormNetworkPairCombinations() + } else { + c.AddPairToNetworkList(c.SelectedNetworks[0], c.SelectedNetworks[1]) + } + + // if the number of lanes is lesser than the number of network pairs, choose first c.TestGroupInput.MaxNoOfLanes pairs + if c.TestGroupInput.MaxNoOfLanes > 0 && c.TestGroupInput.MaxNoOfLanes < len(c.NetworkPairs) { + var newNetworkPairs []NetworkPair + denselyConnectedNetworks := make(map[string]struct{}) + // if densely connected networks are provided, choose all the network pairs containing the networks mentioned in the list for DenselyConnectedNetworkChainIds + if c.TestGroupInput.DenselyConnectedNetworkChainIds != nil && len(c.TestGroupInput.DenselyConnectedNetworkChainIds) > 0 { + for _, n := range c.TestGroupInput.DenselyConnectedNetworkChainIds { + denselyConnectedNetworks[n] = struct{}{} + } + for _, pair := range c.NetworkPairs { + if _, exists := denselyConnectedNetworks[strconv.FormatInt(pair.NetworkA.ChainID, 10)]; exists { + newNetworkPairs = append(newNetworkPairs, pair) + } + } + } + // shuffle the network pairs, we want to randomly distribute the network pairs among all available networks + rand.Shuffle(len(c.NetworkPairs), func(i, j int) { + c.NetworkPairs[i], c.NetworkPairs[j] = c.NetworkPairs[j], c.NetworkPairs[i] + }) + // now add the remaining network pairs by skipping the already covered networks + // and adding the remaining pair from the shuffled list + i := len(newNetworkPairs) + j := 0 + for i < c.TestGroupInput.MaxNoOfLanes { + pair := c.NetworkPairs[j] + // if the network is already covered, skip it + if _, exists := denselyConnectedNetworks[strconv.FormatInt(pair.NetworkA.ChainID, 10)]; !exists { + newNetworkPairs = append(newNetworkPairs, pair) + i++ + } + j++ + } + c.NetworkPairs = newNetworkPairs + } + + // setting leader lane details to network pairs if it is enabled and only in simulated environments + if !pointer.GetBool(c.TestGroupInput.ExistingDeployment) { + c.defineLeaderLanes(lggr) + } + for _, n := range c.NetworkPairs { + lggr.Info(). + Str("NetworkA", fmt.Sprintf("%s-%d", n.NetworkA.Name, n.NetworkA.ChainID)). + Str("NetworkB", fmt.Sprintf("%s-%d", n.NetworkB.Name, n.NetworkB.ChainID)). + Msg("Network Pairs") + } + for _, lane := range c.LeaderLanes { + lggr.Info(). + Str("Source", lane.source). + Str("Destination", lane.dest). + Msg("Leader Lane: ") + } + lggr.Info().Int("Pairs", len(c.NetworkPairs)).Msg("No Of Lanes") + + return allError +} + +// defineLeaderLanes goes over the available network pairs and define one leader lane per destination +func (c *CCIPTestConfig) defineLeaderLanes(lggr zerolog.Logger) { + if !isLeaderLaneFeatureEnabled(&lggr) { + return + } + // the way we are defining leader lane is simply by tagging the destination as key along with the first source network + // as value to the map. + leaderLanes := make(map[string]string) + for _, n := range c.NetworkPairs { + if _, ok := leaderLanes[n.NetworkB.Name]; !ok { + leaderLanes[n.NetworkB.Name] = n.NetworkA.Name + } + if pointer.GetBool(c.TestGroupInput.BiDirectionalLane) { + if _, ok := leaderLanes[n.NetworkA.Name]; !ok { + leaderLanes[n.NetworkA.Name] = n.NetworkB.Name + } + } + } + for k, v := range leaderLanes { + c.LeaderLanes = append(c.LeaderLanes, LeaderLane{ + source: v, + dest: k, + }) + } +} + +// isPriceReportingDisabled checks the given lane is leader lane and return boolean accordingly +func (c *CCIPTestConfig) isPriceReportingDisabled(lggr *zerolog.Logger, source, dest string) bool { + for _, leader := range c.LeaderLanes { + if leader.source == source && leader.dest == dest { + lggr.Debug(). + Str("Source", source). + Str("Destination", dest). + Msg("Non-leader lane") + return true + } + } + return false +} + +func isLeaderLaneFeatureEnabled(lggr *zerolog.Logger) bool { + if err := contracts.MatchContractVersionsOrAbove(map[contracts.Name]contracts.Version{ + contracts.OffRampContract: contracts.V1_2_0, + contracts.OnRampContract: contracts.V1_2_0, + }); err != nil { + lggr.Info().Str("Required contract version", contracts.V1_2_0.String()).Msg("Leader lane feature is not enabled") + return false + } + return true +} + +func (c *CCIPTestConfig) FormNetworkPairCombinations() { + for i := 0; i < c.TestGroupInput.NoOfNetworks; i++ { + for j := i + 1; j < c.TestGroupInput.NoOfNetworks; j++ { + c.AddPairToNetworkList(c.SelectedNetworks[i], c.SelectedNetworks[j]) + } + } +} + +func (c *CCIPTestConfig) SetContractVersion() error { + if c.VersionInput == nil { + return nil + } + for contractName, version := range c.VersionInput { + err := contracts.CheckVersionSupported(contractName, version) + if err != nil { + return err + } + contracts.VersionMap[contractName] = version + } + return nil +} + +func (c *CCIPTestConfig) SetOCRParams() error { + if c.TestGroupInput.OffRampConfig != nil { + if c.TestGroupInput.OffRampConfig.InflightExpiry != nil && + c.TestGroupInput.OffRampConfig.InflightExpiry.Duration() > 0 { + actions.InflightExpiryExec = c.TestGroupInput.OffRampConfig.InflightExpiry.Duration() + } + if pointer.GetUint32(c.TestGroupInput.OffRampConfig.BatchGasLimit) > 0 { + actions.BatchGasLimit = pointer.GetUint32(c.TestGroupInput.OffRampConfig.BatchGasLimit) + } + if pointer.GetUint32(c.TestGroupInput.OffRampConfig.MaxDataBytes) > 0 { + actions.MaxDataBytes = pointer.GetUint32(c.TestGroupInput.OffRampConfig.MaxDataBytes) + } + if c.TestGroupInput.OffRampConfig.RootSnooze != nil && + c.TestGroupInput.OffRampConfig.RootSnooze.Duration() > 0 { + actions.RootSnoozeTime = c.TestGroupInput.OffRampConfig.RootSnooze.Duration() + } + } + if c.TestGroupInput.CommitInflightExpiry != nil && c.TestGroupInput.CommitInflightExpiry.Duration() > 0 { + actions.InflightExpiryCommit = c.TestGroupInput.CommitInflightExpiry.Duration() + } + return nil +} + +// TestConfigOverrideOption is a function that modifies the test config and overrides any values passed in by test files +// This is useful for setting up test specific configurations. +// The return should be a short, explanatory string that describes the change made by the override. +// This is logged at the beginning of the test run. +type TestConfigOverrideOption func(*CCIPTestConfig) string + +// UseCCIPOwnerTokens defines whether all tokens are deployed by the same address as the CCIP owner +func UseCCIPOwnerTokens(yes bool) TestConfigOverrideOption { + return func(c *CCIPTestConfig) string { + c.TestGroupInput.TokenConfig.CCIPOwnerTokens = pointer.ToBool(yes) + return fmt.Sprintf("CCIPOwnerTokens set to %t", yes) + } +} + +// WithTokensPerChain sets the number of tokens to deploy on each chain +func WithTokensPerChain(count int) TestConfigOverrideOption { + return func(c *CCIPTestConfig) string { + c.TestGroupInput.TokenConfig.NoOfTokensPerChain = pointer.ToInt(count) + return fmt.Sprintf("NoOfTokensPerChain set to %d", count) + } +} + +// WithMsgDetails sets the message details for the test +func WithMsgDetails(details *testconfig.MsgDetails) TestConfigOverrideOption { + return func(c *CCIPTestConfig) string { + c.TestGroupInput.MsgDetails = details + return "Message set" + } +} + +// WithNoTokensPerMessage sets how many tokens can be sent in a single message +func WithNoTokensPerMessage(noOfTokens int) TestConfigOverrideOption { + return func(c *CCIPTestConfig) string { + c.TestGroupInput.MsgDetails.NoOfTokens = pointer.ToInt(noOfTokens) + return fmt.Sprintf("MsgDetails.NoOfTokens set to %d", noOfTokens) + } +} + +// NewCCIPTestConfig reads the CCIP test config from TOML files, applies any overrides, and configures the test environment +func NewCCIPTestConfig(t *testing.T, lggr zerolog.Logger, tType string, overrides ...TestConfigOverrideOption) *CCIPTestConfig { + testCfg := ccipconfig.GlobalTestConfig() + groupCfg, exists := testCfg.CCIP.Groups[tType] + if !exists { + t.Fatalf("group config for %s does not exist", tType) + } + if tType == ccipconfig.Load { + if testCfg.CCIP.Env.Logging == nil || testCfg.CCIP.Env.Logging.Loki == nil { + t.Fatal("loki config is required to be set for load test") + } + if testCfg.CCIP.Env.Logging == nil || testCfg.CCIP.Env.Logging.Grafana == nil { + t.Fatal("grafana config is required for load test") + } + } + if pointer.GetBool(groupCfg.KeepEnvAlive) { + err := os.Setenv(config.EnvVarKeepEnvironments, "ALWAYS") + if err != nil { + t.Fatal(err) + } + } + ccipTestConfig := &CCIPTestConfig{ + Test: t, + EnvInput: testCfg.CCIP.Env, + ContractsInput: testCfg.CCIP.Deployments, + VersionInput: testCfg.CCIP.ContractVersions, + TestGroupInput: groupCfg, + GethResourceProfile: GethResourceProfile, + } + setContractVersion.Do(func() { + err := ccipTestConfig.SetContractVersion() + if err != nil { + t.Fatal(err) + } + }) + setOCRParams.Do(func() { + err := ccipTestConfig.SetOCRParams() + if err != nil { + t.Fatal(err) + } + }) + setConfigOverrides.Do(func() { + overrideMessages := []string{} + for _, override := range overrides { + if override != nil { + overrideMessages = append(overrideMessages, override(ccipTestConfig)) + } + } + if len(overrideMessages) > 0 { + lggr.Debug().Int("Overrides", len(overrideMessages)).Msg("Test Specific Config Overrides Applied") + for _, msg := range overrideMessages { + lggr.Debug().Msg(msg) + } + } + }) + err := ccipTestConfig.SetNetworkPairs(lggr) + if err != nil { + t.Fatal(err) + } + + return ccipTestConfig +} + +type BiDirectionalLaneConfig struct { + NetworkA blockchain.EVMNetwork + NetworkB blockchain.EVMNetwork + ForwardLane *actions.CCIPLane + ReverseLane *actions.CCIPLane +} + +type CCIPTestSetUpOutputs struct { + SetUpContext context.Context + Cfg *CCIPTestConfig + LaneContractsByNetwork *sync.Map + laneMutex *sync.Mutex + Lanes []*BiDirectionalLaneConfig + Reporter *testreporters.CCIPTestReporter + LaneConfigFile string + LaneConfig *laneconfig.Lanes + TearDown func() error + Env *actions.CCIPTestEnv + Balance *actions.BalanceSheet + BootstrapAdded *atomic.Bool + JobAddGrp *errgroup.Group +} + +func (o *CCIPTestSetUpOutputs) AddToLanes(lane *BiDirectionalLaneConfig) { + o.laneMutex.Lock() + defer o.laneMutex.Unlock() + o.Lanes = append(o.Lanes, lane) +} + +func (o *CCIPTestSetUpOutputs) ReadLanes() []*BiDirectionalLaneConfig { + o.laneMutex.Lock() + defer o.laneMutex.Unlock() + return o.Lanes +} + +func (o *CCIPTestSetUpOutputs) DeployChainContracts( + lggr *zerolog.Logger, + chainClient blockchain.EVMClient, + networkCfg blockchain.EVMNetwork, + noOfTokens int, + tokenDeployerFns []blockchain.ContractDeployer, +) error { + var k8Env *environment.Environment + ccipEnv := o.Env + if ccipEnv != nil { + k8Env = ccipEnv.K8Env + } + if k8Env != nil && chainClient.NetworkSimulated() { + networkCfg.URLs = k8Env.URLs[chainClient.GetNetworkConfig().Name] + } + + mainChainClient, err := blockchain.ConcurrentEVMClient(networkCfg, k8Env, chainClient, *lggr) + if err != nil { + return errors.WithStack(fmt.Errorf("failed to create chain client for %s: %w", networkCfg.Name, err)) + } + + mainChainClient.ParallelTransactions(true) + defer mainChainClient.Close() + ccipCommon, err := actions.DefaultCCIPModule( + lggr, o.Cfg.TestGroupInput, mainChainClient, + ) + if err != nil { + return errors.WithStack(fmt.Errorf("failed to create ccip common module for %s: %w", networkCfg.Name, err)) + } + + cfg := o.LaneConfig.ReadLaneConfig(networkCfg.Name) + + err = ccipCommon.DeployContracts(noOfTokens, tokenDeployerFns, cfg) + if err != nil { + return errors.WithStack(fmt.Errorf("failed to deploy common ccip contracts for %s: %w", networkCfg.Name, err)) + } + ccipCommon.WriteLaneConfig(cfg) + o.LaneContractsByNetwork.Store(networkCfg.Name, cfg) + + return nil +} + +func (o *CCIPTestSetUpOutputs) SetupDynamicTokenPriceUpdates() error { + interval := o.Cfg.TestGroupInput.TokenConfig.DynamicPriceUpdateInterval.Duration() + covered := make(map[string]struct{}) + for _, lanes := range o.ReadLanes() { + lane := lanes.ForwardLane + if _, exists := covered[lane.SourceNetworkName]; !exists { + covered[lane.SourceNetworkName] = struct{}{} + err := lane.Source.Common.UpdateTokenPricesAtRegularInterval(lane.Context, lane.Logger, interval, o.LaneConfig.ReadLaneConfig(lane.SourceNetworkName)) + if err != nil { + return err + } + } + if _, exists := covered[lane.DestNetworkName]; !exists { + covered[lane.DestNetworkName] = struct{}{} + err := lane.Dest.Common.UpdateTokenPricesAtRegularInterval(lane.Context, lane.Logger, interval, o.LaneConfig.ReadLaneConfig(lane.DestNetworkName)) + if err != nil { + return err + } + } + } + return nil +} + +func (o *CCIPTestSetUpOutputs) AddLanesForNetworkPair( + lggr *zerolog.Logger, + networkA, networkB blockchain.EVMNetwork, + chainClientA, chainClientB blockchain.EVMClient, +) error { + var ( + t = o.Cfg.Test + allErrors atomic.Error + k8Env *environment.Environment + ccipEnv = o.Env + namespace = "" + ) + + if o.Cfg.TestGroupInput.LoadProfile != nil { + namespace = o.Cfg.TestGroupInput.LoadProfile.TestRunName + } + bidirectional := pointer.GetBool(o.Cfg.TestGroupInput.BiDirectionalLane) + if ccipEnv != nil { + k8Env = ccipEnv.K8Env + if k8Env != nil { + namespace = k8Env.Cfg.Namespace + } + } + + setUpFuncs, ctx := errgroup.WithContext(testcontext.Get(t)) + + // Use new set of clients(sourceChainClient,destChainClient) + // with new header subscriptions(otherwise transactions + // on one lane will keep on waiting for transactions on other lane for the same network) + // Currently for simulated network clients(from same network) created with NewEVMClient does not sync nonce + // ConcurrentEVMClient is a work-around for that. + sourceChainClientA2B, err := blockchain.ConcurrentEVMClient(networkA, k8Env, chainClientA, *lggr) + if err != nil { + return errors.WithStack(fmt.Errorf("failed to create chain client for %s: %w", networkA.Name, err)) + } + + sourceChainClientA2B.ParallelTransactions(true) + + destChainClientA2B, err := blockchain.ConcurrentEVMClient(networkB, k8Env, chainClientB, *lggr) + if err != nil { + return errors.WithStack(fmt.Errorf("failed to create chain client for %s: %w", networkB.Name, err)) + } + destChainClientA2B.ParallelTransactions(true) + + ccipLaneA2B := &actions.CCIPLane{ + Test: t, + SourceChain: sourceChainClientA2B, + DestChain: destChainClientA2B, + SourceNetworkName: actions.NetworkName(networkA.Name), + DestNetworkName: actions.NetworkName(networkB.Name), + ValidationTimeout: o.Cfg.TestGroupInput.PhaseTimeout.Duration(), + SentReqs: make(map[common.Hash][]actions.CCIPRequest), + TotalFee: big.NewInt(0), + Balance: o.Balance, + Context: testcontext.Get(t), + } + // if it non leader lane, disable the price reporting + ccipLaneA2B.PriceReportingDisabled = len(o.Cfg.LeaderLanes) > 0 && + !o.Cfg.isPriceReportingDisabled(lggr, ccipLaneA2B.SourceNetworkName, ccipLaneA2B.DestNetworkName) + + contractsA, ok := o.LaneContractsByNetwork.Load(networkA.Name) + if !ok { + return errors.WithStack(fmt.Errorf("failed to load lane contracts for %s", networkA.Name)) + } + srcCfg := contractsA.(*laneconfig.LaneConfig) + ccipLaneA2B.SrcNetworkLaneCfg = srcCfg + contractsB, ok := o.LaneContractsByNetwork.Load(networkB.Name) + if !ok { + return errors.WithStack(fmt.Errorf("failed to load lane contracts for %s", networkB.Name)) + } + destCfg := contractsB.(*laneconfig.LaneConfig) + ccipLaneA2B.DstNetworkLaneCfg = destCfg + + a2blogger := lggr.With().Str("env", namespace).Str("Lane", + fmt.Sprintf("%s-->%s", ccipLaneA2B.SourceNetworkName, ccipLaneA2B.DestNetworkName)).Logger() + ccipLaneA2B.Logger = &a2blogger + ccipLaneA2B.Reports = o.Reporter.AddNewLane(fmt.Sprintf("%s To %s", + networkA.Name, networkB.Name), ccipLaneA2B.Logger) + + bidirectionalLane := &BiDirectionalLaneConfig{ + NetworkA: networkA, + NetworkB: networkB, + ForwardLane: ccipLaneA2B, + } + + var ccipLaneB2A *actions.CCIPLane + + if bidirectional { + sourceChainClientB2A, err := blockchain.ConcurrentEVMClient(networkB, k8Env, chainClientB, *lggr) + if err != nil { + return errors.WithStack(fmt.Errorf("failed to create chain client for %s: %w", networkB.Name, err)) + } + sourceChainClientB2A.ParallelTransactions(true) + + destChainClientB2A, err := blockchain.ConcurrentEVMClient(networkA, k8Env, chainClientA, *lggr) + if err != nil { + return errors.WithStack(fmt.Errorf("failed to create chain client for %s: %w", networkA.Name, err)) + } + destChainClientB2A.ParallelTransactions(true) + + ccipLaneB2A = &actions.CCIPLane{ + Test: t, + SourceNetworkName: actions.NetworkName(networkB.Name), + DestNetworkName: actions.NetworkName(networkA.Name), + SourceChain: sourceChainClientB2A, + DestChain: destChainClientB2A, + ValidationTimeout: o.Cfg.TestGroupInput.PhaseTimeout.Duration(), + Balance: o.Balance, + SentReqs: make(map[common.Hash][]actions.CCIPRequest), + TotalFee: big.NewInt(0), + Context: testcontext.Get(t), + SrcNetworkLaneCfg: ccipLaneA2B.DstNetworkLaneCfg, + DstNetworkLaneCfg: ccipLaneA2B.SrcNetworkLaneCfg, + } + // if it non leader lane, disable the price reporting + ccipLaneB2A.PriceReportingDisabled = len(o.Cfg.LeaderLanes) > 0 && + !o.Cfg.isPriceReportingDisabled(lggr, ccipLaneB2A.SourceNetworkName, ccipLaneB2A.DestNetworkName) + b2aLogger := lggr.With().Str("env", namespace).Str("Lane", + fmt.Sprintf("%s-->%s", ccipLaneB2A.SourceNetworkName, ccipLaneB2A.DestNetworkName)).Logger() + ccipLaneB2A.Logger = &b2aLogger + ccipLaneB2A.Reports = o.Reporter.AddNewLane( + fmt.Sprintf("%s To %s", networkB.Name, networkA.Name), ccipLaneB2A.Logger) + bidirectionalLane.ReverseLane = ccipLaneB2A + } + o.AddToLanes(bidirectionalLane) + + setUpFuncs.Go(func() error { + lggr.Info().Msgf("Setting up lane %s to %s", networkA.Name, networkB.Name) + err := ccipLaneA2B.DeployNewCCIPLane( + o.SetUpContext, o.Env, + o.Cfg.TestGroupInput, o.BootstrapAdded, o.JobAddGrp, + ) + if err != nil { + allErrors.Store(multierr.Append(allErrors.Load(), fmt.Errorf("deploying lane %s to %s; err - %w", networkA.Name, networkB.Name, errors.WithStack(err)))) + return err + } + err = o.LaneConfig.WriteLaneConfig(networkA.Name, ccipLaneA2B.SrcNetworkLaneCfg) + if err != nil { + lggr.Error().Err(err).Msgf("error deploying lane %s to %s", networkA.Name, networkB.Name) + allErrors.Store(multierr.Append(allErrors.Load(), fmt.Errorf("writing lane config for %s; err - %w", networkA.Name, errors.WithStack(err)))) + return err + } + err = o.LaneConfig.WriteLaneConfig(networkB.Name, ccipLaneA2B.DstNetworkLaneCfg) + if err != nil { + allErrors.Store(multierr.Append(allErrors.Load(), fmt.Errorf("writing lane config for %s; err - %w", networkB.Name, errors.WithStack(err)))) + return err + } + + // we need to set the remote chains on the pool after the lane is deployed + // it's sufficient to do this only for the forward lane, as the destination pools will also be updated with source pool updates + // The reverse lane will have the same pools as the forward lane but in reverse order of source and destination + err = ccipLaneA2B.SetRemoteChainsOnPool() + if err != nil { + allErrors.Store(multierr.Append(allErrors.Load(), fmt.Errorf("error setting remote chains; err - %w", errors.WithStack(err)))) + return err + } + lggr.Info().Msgf("done setting up lane %s to %s", networkA.Name, networkB.Name) + if o.Cfg.TestGroupInput.LoadProfile != nil && pointer.GetBool(o.Cfg.TestGroupInput.LoadProfile.OptimizeSpace) { + // This is to optimize memory space for load tests with high number of networks, lanes, tokens + ccipLaneA2B.OptimizeStorage() + } + return nil + }) + + setUpFuncs.Go(func() error { + if bidirectional { + lggr.Info().Msgf("Setting up lane %s to %s", networkB.Name, networkA.Name) + err := ccipLaneB2A.DeployNewCCIPLane( + o.SetUpContext, o.Env, + o.Cfg.TestGroupInput, o.BootstrapAdded, o.JobAddGrp, + ) + if err != nil { + lggr.Error().Err(err).Msgf("error deploying lane %s to %s", networkB.Name, networkA.Name) + allErrors.Store(multierr.Append(allErrors.Load(), fmt.Errorf("deploying lane %s to %s; err - %w", networkB.Name, networkA.Name, errors.WithStack(err)))) + return err + } + + err = o.LaneConfig.WriteLaneConfig(networkB.Name, ccipLaneB2A.SrcNetworkLaneCfg) + if err != nil { + allErrors.Store(multierr.Append(allErrors.Load(), fmt.Errorf("writing lane config for %s; err - %w", networkA.Name, errors.WithStack(err)))) + return err + } + err = o.LaneConfig.WriteLaneConfig(networkA.Name, ccipLaneB2A.DstNetworkLaneCfg) + if err != nil { + allErrors.Store( + multierr.Append( + allErrors.Load(), + fmt.Errorf("writing lane config for %s; err - %w", networkB.Name, errors.WithStack(err)), + ), + ) + return err + } + lggr.Info().Msgf("done setting up lane %s to %s", networkB.Name, networkA.Name) + if o.Cfg.TestGroupInput.LoadProfile != nil && pointer.GetBool(o.Cfg.TestGroupInput.LoadProfile.OptimizeSpace) { + // This is to optimize memory space for load tests with high number of networks, lanes, tokens + ccipLaneB2A.OptimizeStorage() + } + return nil + } + return nil + }) + + errs := make(chan error, 1) + go func() { + errs <- setUpFuncs.Wait() + }() + + // wait for either context to get cancelled or all the error-groups to finish execution + for { + select { + case err := <-errs: + // check if there has been any error while waiting for the error groups + // to finish execution + return err + case <-ctx.Done(): + lggr.Print(ctx.Err()) + return allErrors.Load() + } + } +} + +func (o *CCIPTestSetUpOutputs) StartEventWatchers() { + for _, lane := range o.ReadLanes() { + err := lane.ForwardLane.StartEventWatchers() + require.NoError(o.Cfg.Test, err) + if lane.ReverseLane != nil { + err = lane.ReverseLane.StartEventWatchers() + require.NoError(o.Cfg.Test, err) + } + } +} + +func (o *CCIPTestSetUpOutputs) WaitForPriceUpdates() { + t := o.Cfg.Test + priceUpdateGrp, _ := errgroup.WithContext(o.SetUpContext) + for _, lanes := range o.ReadLanes() { + lanes := lanes + forwardLane := lanes.ForwardLane + reverseLane := lanes.ReverseLane + waitForUpdate := func(lane *actions.CCIPLane) error { + defer func() { + lane.Logger.Info(). + Str("source_chain", lane.Source.Common.ChainClient.GetNetworkName()). + Uint64("dest_chain", lane.Source.DestinationChainId). + Str("price_registry", lane.Source.Common.PriceRegistry.Address()). + Msg("Stopping price update watch") + + }() + var allTokens []common.Address + for _, token := range lane.Source.Common.BridgeTokens { + allTokens = append(allTokens, token.ContractAddress) + } + allTokens = append(allTokens, lane.Source.Common.FeeToken.EthAddress) + lane.Logger.Info(). + Str("source_chain", lane.Source.Common.ChainClient.GetNetworkName()). + Uint64("dest_chain", lane.Source.DestinationChainId). + Str("price_registry", lane.Source.Common.PriceRegistry.Address()). + Msgf("Waiting for price update") + err := lane.Source.Common.WaitForPriceUpdates( + o.SetUpContext, lane.Logger, + o.Cfg.TestGroupInput.TokenConfig.TimeoutForPriceUpdate.Duration(), + lane.Source.DestinationChainId, + allTokens, + ) + if err != nil { + return errors.Wrapf(err, "waiting for price update failed on lane %s-->%s", lane.SourceNetworkName, lane.DestNetworkName) + } + return nil + } + + priceUpdateGrp.Go(func() error { + return waitForUpdate(forwardLane) + }) + if lanes.ReverseLane != nil { + priceUpdateGrp.Go(func() error { + return waitForUpdate(reverseLane) + }) + } + } + + require.NoError(t, priceUpdateGrp.Wait()) +} + +// CheckGasUpdateTransaction checks the gas update transactions count +func (o *CCIPTestSetUpOutputs) CheckGasUpdateTransaction(lggr *zerolog.Logger) error { + transactionsBySource := make(map[string]string) + destToSourcesList := make(map[string][]string) + // create a map to hold the unique destination with list of sources + for _, n := range o.Cfg.NetworkPairs { + destToSourcesList[n.NetworkB.Name] = append(destToSourcesList[n.NetworkB.Name], n.NetworkA.Name) + if pointer.GetBool(o.Cfg.TestGroupInput.BiDirectionalLane) { + destToSourcesList[n.NetworkA.Name] = append(destToSourcesList[n.NetworkA.Name], n.NetworkB.Name) + } + } + lggr.Debug().Interface("list", destToSourcesList).Msg("Dest to Source") + // a function to read the gas update events and create a map with unique source and store the tx hash + filterGasUpdateEventTxBySource := func(lane *actions.CCIPLane) error { + for _, g := range lane.Source.Common.GasUpdateEvents { + if g.Value == nil { + return fmt.Errorf("gas update value should not be nil in tx %s", g.Tx) + } + if _, ok := transactionsBySource[g.Source]; !ok { + transactionsBySource[g.Source] = g.Tx + } + } + return nil + } + + for _, lane := range o.ReadLanes() { + if err := filterGasUpdateEventTxBySource(lane.ForwardLane); err != nil { + return fmt.Errorf("error in filtering gas update transactions in the lane source: %s and destination: %s, error: %w", + lane.ForwardLane.SourceNetworkName, lane.ForwardLane.DestNetworkName, err) + } + if lane.ReverseLane != nil { + if err := filterGasUpdateEventTxBySource(lane.ReverseLane); err != nil { + return fmt.Errorf("error in filtering gas update transactions in the lane source: %s and destination: %s, error: %w", + lane.ReverseLane.SourceNetworkName, lane.ReverseLane.DestNetworkName, err) + } + } + } + + lggr.Debug().Interface("Tx hashes by source", transactionsBySource).Msg("Checked Gas Update Transactions by Source") + // when leader lane setup is enabled, number of unique transaction from the source + // should match the number of leader lanes defined. + if len(transactionsBySource) != len(o.Cfg.LeaderLanes) { + lggr.Error(). + Int("Tx hashes expected", len(o.Cfg.LeaderLanes)). + Int("Tx hashes received", len(transactionsBySource)). + Int("Leader lanes count", len(o.Cfg.LeaderLanes)). + Msg("Checked Gas Update transactions count doesn't match") + return fmt.Errorf("checked Gas Update transactions count doesn't match") + } + lggr.Debug(). + Int("Tx hashes by source", len(transactionsBySource)). + Int("Leader lanes count", len(o.Cfg.LeaderLanes)). + Msg("Checked Gas Update transactions count matches") + + return nil +} + +// CCIPDefaultTestSetUp sets up the environment for CCIP tests +// if configureCLNode is set as false, it assumes: +// 1. contracts are already deployed on live networks +// 2. CL nodes are set up and configured with existing contracts +// 3. No k8 env deployment is needed +// It reuses already deployed contracts from the addresses provided in ../contracts/ccip/laneconfig/contracts.json +// +// If bidirectional is true it sets up two-way lanes between NetworkA and NetworkB. Same CL nodes are used for both the lanes. +// If bidirectional is false only one way lane is set up. +// +// Returns - +// 1. CCIPLane for NetworkA --> NetworkB +// 2. If bidirectional is true, CCIPLane for NetworkB --> NetworkA +// 3. If configureCLNode is true, the tearDown func to call when environment needs to be destroyed +func CCIPDefaultTestSetUp( + t *testing.T, + lggr *zerolog.Logger, + envName string, + tokenDeployerFns []blockchain.ContractDeployer, + testConfig *CCIPTestConfig, +) *CCIPTestSetUpOutputs { + var err error + reportPath := "tmp_laneconfig" + filepath := fmt.Sprintf("./%s/tmp_%s.json", reportPath, strings.ReplaceAll(t.Name(), "/", "_")) + reportFile := testutils.FileNameFromPath(filepath) + parent, cancel := context.WithCancel(context.Background()) + defer cancel() + setUpArgs := &CCIPTestSetUpOutputs{ + SetUpContext: parent, + Cfg: testConfig, + Reporter: testreporters.NewCCIPTestReporter(t, lggr), + LaneConfigFile: filepath, + LaneContractsByNetwork: &sync.Map{}, + Balance: actions.NewBalanceSheet(), + BootstrapAdded: atomic.NewBool(false), + JobAddGrp: &errgroup.Group{}, + laneMutex: &sync.Mutex{}, + } + + contractsData, err := setUpArgs.Cfg.ContractsInput.ContractsData() + require.NoError(t, err, "error reading existing lane config") + + chainClientByChainID := setUpArgs.CreateEnvironment(lggr, envName, reportPath) + // if test is run in remote runner, register a clean-up to copy the laneconfig file + if value, set := os.LookupEnv(config.EnvVarJobImage); set && value != "" && + (setUpArgs.Env != nil && setUpArgs.Env.K8Env != nil) && + pointer.GetBool(setUpArgs.Cfg.TestGroupInput.StoreLaneConfig) { + t.Cleanup(func() { + path := fmt.Sprintf("reports/%s/%s", reportPath, reportFile) + dir, err := os.Getwd() + require.NoError(t, err) + destPath := fmt.Sprintf("%s/%s", dir, reportFile) + lggr.Info().Str("srcPath", path).Str("dstPath", destPath).Msg("copying lane config") + err = setUpArgs.Env.K8Env.CopyFromPod("app=runner-data", + "remote-test-runner-data-files", path, destPath) + require.NoError(t, err, "error getting lane config") + }) + } + if setUpArgs.Env != nil { + ccipEnv := setUpArgs.Env + if ccipEnv.K8Env != nil && ccipEnv.K8Env.WillUseRemoteRunner() { + return setUpArgs + } + } + + setUpArgs.LaneConfig, err = laneconfig.ReadLanesFromExistingDeployment(contractsData) + require.NoError(t, err) + + if setUpArgs.LaneConfig == nil { + setUpArgs.LaneConfig = &laneconfig.Lanes{LaneConfigs: make(map[string]*laneconfig.LaneConfig)} + } + laneCfgFile, err := os.Stat(setUpArgs.LaneConfigFile) + if err == nil && laneCfgFile.Size() > 0 { + // remove the existing lane config file + err = os.Remove(setUpArgs.LaneConfigFile) + require.NoError(t, err, "error while removing existing lane config file - %s", setUpArgs.LaneConfigFile) + } + + configureCLNode := !testConfig.useExistingDeployment() + + // if no of lanes per pair is greater than 1, copy common contracts from the same network + // if no of lanes per pair is more than 1, the networks are added into the testConfig.AllNetworks with a suffix of - + // for example, if no of lanes per pair is 2, and the network pairs are called "testnetA", "testnetB", + // the network will be added as "testnetA-1", testnetA-2","testnetB-1", testnetB-2" + // to deploy 2 lanes between same network pair "testnetA", "testnetB". + // In the following the common contracts will be copied from "testnetA" to "testnetA-1" and "testnetA-2" and + // from "testnetB" to "testnetB-1" and "testnetB-2" + for n := range testConfig.AllNetworks { + if setUpArgs.Cfg.TestGroupInput.NoOfRoutersPerPair > 1 { + regex := regexp.MustCompile(`-(\d+)$`) + networkNameToReadCfg := regex.ReplaceAllString(n, "") + reuse := pointer.GetBool(testConfig.TestGroupInput.ReuseContracts) + // if reuse contracts is true, copy common contracts from the same network except the router contract + setUpArgs.LaneConfig.CopyCommonContracts( + networkNameToReadCfg, n, + reuse, testConfig.TestGroupInput.MsgDetails.IsTokenTransfer(), + ) + } + } + + // deploy all chain specific common contracts + chainAddGrp, _ := errgroup.WithContext(setUpArgs.SetUpContext) + lggr.Info().Msg("Deploying common contracts") + + // If we have a token admin registry, we need to use a separate to deploy our test tokens from so that the tokens + // are not owned by the same account that owns the other CCIP contracts. This emulates self-serve token setups where + // the token owner is different from the CCIP contract owner. + if testConfig.useSeparateTokenDeployer() { + for _, net := range testConfig.AllNetworks { + chainClient := chainClientByChainID[net.ChainID] + require.NotNil(t, chainClient, "Chain client not found for chainID %d", net.ChainID) + require.GreaterOrEqual(t, len(chainClient.GetWallets()), 2, "The test is using a TokenAdminRegistry, and has CCIPOwnerTokens set to 'false'. The test needs a second wallet to deploy token contracts from. Please add a second wallet to the 'evm_clients' config option.") + tokenDeployerWallet := chainClient.GetWallets()[1] + // TODO: This is a total guess at how much funds we need to deploy the tokens. This could be way off, especially on live chains. + // There aren't a lot of good ways to estimate this though. See CCIP-2471. + recommendedTokenBalance := new(big.Int).Mul(big.NewInt(5e18), big.NewInt(int64(pointer.GetInt(testConfig.TestGroupInput.TokenConfig.NoOfTokensPerChain)))) + currentTokenBalance, err := chainClient.BalanceAt(context.Background(), common.HexToAddress(tokenDeployerWallet.Address())) + require.NoError(t, err) + if currentTokenBalance.Cmp(recommendedTokenBalance) < 0 { + lggr.Warn(). + Str("Token Deployer Address", tokenDeployerWallet.Address()). + Uint64("Current Balance", currentTokenBalance.Uint64()). + Uint64("Recommended Balance", recommendedTokenBalance.Uint64()). + Msg("Token Deployer wallet may be underfunded. Please ensure it has enough funds to deploy the tokens.") + } + } + } + + for _, net := range testConfig.AllNetworks { + chainClient := chainClientByChainID[net.ChainID] + net := net + net.HTTPURLs = chainClient.GetNetworkConfig().HTTPURLs + net.URLs = chainClient.GetNetworkConfig().URLs + chainAddGrp.Go(func() error { + return setUpArgs.DeployChainContracts( + lggr, chainClient, net, + pointer.GetInt(testConfig.TestGroupInput.TokenConfig.NoOfTokensPerChain), + tokenDeployerFns, + ) + }) + } + require.NoError(t, chainAddGrp.Wait(), "Deploying common contracts shouldn't fail") + + // set up mock server for price pipeline and usdc attestation if not using existing deployment + if !pointer.GetBool(setUpArgs.Cfg.TestGroupInput.ExistingDeployment) { + var killgrave *ctftestenv.Killgrave + if setUpArgs.Env.LocalCluster != nil { + killgrave = setUpArgs.Env.LocalCluster.MockAdapter + } + if setUpArgs.Cfg.TestGroupInput.TokenConfig.IsPipelineSpec() { + // set up mock server for price pipeline. need to set it once for all the lanes as the price pipeline path uses + // regex to match the path for all tokens across all lanes + actions.SetMockserverWithTokenPriceValue(killgrave, setUpArgs.Env.MockServer) + } + if pointer.GetBool(setUpArgs.Cfg.TestGroupInput.USDCMockDeployment) { + // if it's a new USDC deployment, set up mock server for attestation, + // we need to set it only once for all the lanes as the attestation path uses regex to match the path for + // all messages across all lanes + err = actions.SetMockServerWithUSDCAttestation(killgrave, setUpArgs.Env.MockServer) + require.NoError(t, err, "failed to set up mock server for attestation") + } + } + // deploy all lane specific contracts + lggr.Info().Msg("Deploying lane specific contracts") + laneAddGrp, _ := errgroup.WithContext(setUpArgs.SetUpContext) + // for memory management set a batch size for active lane deployment group + laneAddGrp.SetLimit(200) + for _, networkPair := range testConfig.NetworkPairs { + n := networkPair + var ok bool + n.ChainClientA, ok = chainClientByChainID[n.NetworkA.ChainID] + require.True(t, ok, "Chain client for chainID %d not found", n.NetworkA.ChainID) + n.ChainClientB, ok = chainClientByChainID[n.NetworkB.ChainID] + require.True(t, ok, "Chain client for chainID %d not found", n.NetworkB.ChainID) + + n.NetworkA.HTTPURLs = n.ChainClientA.GetNetworkConfig().HTTPURLs + n.NetworkA.URLs = n.ChainClientA.GetNetworkConfig().URLs + n.NetworkB.HTTPURLs = n.ChainClientB.GetNetworkConfig().HTTPURLs + n.NetworkB.URLs = n.ChainClientB.GetNetworkConfig().URLs + + laneAddGrp.Go(func() error { + return setUpArgs.AddLanesForNetworkPair( + lggr, n.NetworkA, n.NetworkB, + chainClientByChainID[n.NetworkA.ChainID], chainClientByChainID[n.NetworkB.ChainID], + ) + }) + } + require.NoError(t, laneAddGrp.Wait()) + err = laneconfig.WriteLanesToJSON(setUpArgs.LaneConfigFile, setUpArgs.LaneConfig) + require.NoError(t, err) + + require.Equal(t, len(setUpArgs.Lanes), len(testConfig.NetworkPairs), + "Number of bi-directional lanes should be equal to number of network pairs") + // only required for env set up + setUpArgs.LaneContractsByNetwork = nil + + if configureCLNode { + // wait for all jobs to get created + lggr.Info().Msg("Waiting for jobs to be created") + require.NoError(t, setUpArgs.JobAddGrp.Wait(), "Creating jobs shouldn't fail") + // wait for price updates to be available + setUpArgs.WaitForPriceUpdates() + if isLeaderLaneFeatureEnabled(lggr) && !pointer.GetBool(setUpArgs.Cfg.TestGroupInput.ExistingDeployment) { + require.NoError(t, setUpArgs.CheckGasUpdateTransaction(lggr), "gas update transaction check shouldn't fail") + } + // if dynamic price update is required + if setUpArgs.Cfg.TestGroupInput.TokenConfig.IsDynamicPriceUpdate() { + require.NoError(t, setUpArgs.SetupDynamicTokenPriceUpdates(), "setting up dynamic price update should not fail") + } + } + + // start event watchers for all lanes + setUpArgs.StartEventWatchers() + // now that lane configs are already dumped to file, we can clean up the lane config map + setUpArgs.LaneConfig = nil + setUpArgs.TearDown = func() error { + var errs error + for _, lanes := range setUpArgs.Lanes { + // if existing deployment is true, don't attempt to pay ccip fees + err := lanes.ForwardLane.CleanUp(configureCLNode) + if err != nil { + errs = multierr.Append(errs, err) + } + if lanes.ReverseLane != nil { + // if existing deployment is true, don't attempt to pay ccip fees + err := lanes.ReverseLane.CleanUp(configureCLNode) + if err != nil { + errs = multierr.Append(errs, err) + } + } + } + return errs + } + lggr.Info().Msg("Test setup completed") + return setUpArgs +} + +// CreateEnvironment creates the environment for the test and registers the test clean-up function to tear down the set-up environment +// It returns the map of chainID to EVMClient +func (o *CCIPTestSetUpOutputs) CreateEnvironment( + lggr *zerolog.Logger, + envName string, + reportPath string, +) map[int64]blockchain.EVMClient { + var ( + testConfig = o.Cfg + t = o.Cfg.Test + + ccipEnv *actions.CCIPTestEnv + k8Env *environment.Environment + err error + chains []blockchain.EVMClient + local *test_env.CLClusterTestEnv + deployCL func() error + ) + + envConfig := createEnvironmentConfig(t, envName, testConfig, reportPath) + + configureCLNode := !testConfig.useExistingDeployment() || pointer.GetString(testConfig.EnvInput.EnvToConnect) != "" + namespace := "" + if testConfig.TestGroupInput.LoadProfile != nil { + namespace = testConfig.TestGroupInput.LoadProfile.TestRunName + } + require.False(t, testConfig.localCluster() && testConfig.ExistingCLCluster(), + "local cluster and existing cluster cannot be true at the same time") + // if it's a new deployment, deploy the env + // Or if EnvToConnect is given connect to that k8 environment + if configureCLNode { + if !testConfig.ExistingCLCluster() { + // if it's a local cluster, deploy the local cluster in docker + if testConfig.localCluster() { + local, deployCL = DeployLocalCluster(t, testConfig) + ccipEnv = &actions.CCIPTestEnv{ + LocalCluster: local, + } + namespace = "local-docker-deployment" + } else { + // Otherwise, deploy the k8s env + lggr.Info().Msg("Deploying test environment") + // deploy the env if configureCLNode is true + k8Env = DeployEnvironments(t, envConfig, testConfig) + ccipEnv = &actions.CCIPTestEnv{K8Env: k8Env} + namespace = ccipEnv.K8Env.Cfg.Namespace + } + } else { + // if there is already a cluster, use the existing cluster to connect to the nodes + ccipEnv = &actions.CCIPTestEnv{} + mockserverURL := pointer.GetString(testConfig.EnvInput.Mockserver) + require.NotEmpty(t, mockserverURL, "mockserver URL cannot be nil") + ccipEnv.MockServer = ctfClient.NewMockserverClient(&ctfClient.MockserverConfig{ + LocalURL: mockserverURL, + ClusterURL: mockserverURL, + }) + } + ccipEnv.CLNodeWithKeyReady, _ = errgroup.WithContext(o.SetUpContext) + o.Env = ccipEnv + if ccipEnv.K8Env != nil && ccipEnv.K8Env.WillUseRemoteRunner() { + return nil + } + } else { + // if configureCLNode is false it means we don't need to deploy any additional pods, + // use a placeholder env to create just the remote runner in it. + if value, set := os.LookupEnv(config.EnvVarJobImage); set && value != "" { + k8Env = environment.New(envConfig) + err = k8Env.Run() + require.NoErrorf(t, err, "error creating environment remote runner") + o.Env = &actions.CCIPTestEnv{K8Env: k8Env} + if k8Env.WillUseRemoteRunner() { + return nil + } + } + } + if o.Cfg.TestGroupInput.LoadProfile != nil { + o.Cfg.TestGroupInput.LoadProfile.SetTestRunName(namespace) + } + chainByChainID := make(map[int64]blockchain.EVMClient) + if pointer.GetBool(testConfig.TestGroupInput.LocalCluster) { + require.NotNil(t, ccipEnv.LocalCluster, "Local cluster shouldn't be nil") + for _, n := range ccipEnv.LocalCluster.EVMNetworks { + if evmClient, err := blockchain.NewEVMClientFromNetwork(*n, *lggr); err == nil { + chainByChainID[evmClient.GetChainID().Int64()] = evmClient + chains = append(chains, evmClient) + } else { + lggr.Error().Err(err).Msgf("EVMClient for chainID %d not found", n.ChainID) + } + } + } else { + for _, n := range testConfig.SelectedNetworks { + if _, ok := chainByChainID[n.ChainID]; ok { + continue + } + var ec blockchain.EVMClient + if k8Env == nil { + ec, err = blockchain.ConnectEVMClient(n, *lggr) + } else { + log.Info().Interface("urls", k8Env.URLs).Msg("URLs") + ec, err = blockchain.NewEVMClient(n, k8Env, *lggr) + } + require.NoError(t, err, "Connecting to blockchain nodes shouldn't fail") + chains = append(chains, ec) + chainByChainID[n.ChainID] = ec + } + } + if configureCLNode { + ccipEnv.CLNodeWithKeyReady.Go(func() error { + var totalNodes int + if !o.Cfg.ExistingCLCluster() { + if ccipEnv.LocalCluster != nil { + err = deployCL() + if err != nil { + return err + } + } + err = ccipEnv.ConnectToDeployedNodes() + if err != nil { + return fmt.Errorf("error connecting to chainlink nodes: %w", err) + } + totalNodes = pointer.GetInt(testConfig.EnvInput.NewCLCluster.NoOfNodes) + } else { + totalNodes = pointer.GetInt(testConfig.EnvInput.ExistingCLCluster.NoOfNodes) + err = ccipEnv.ConnectToExistingNodes(o.Cfg.EnvInput) + if err != nil { + return fmt.Errorf("error deploying and connecting to chainlink nodes: %w", err) + } + } + err = ccipEnv.SetUpNodeKeysAndFund(lggr, big.NewFloat(testConfig.TestGroupInput.NodeFunding), chains) + if err != nil { + return fmt.Errorf("error setting up nodes and keys %w", err) + } + // first node is the bootstrapper + ccipEnv.CommitNodeStartIndex = 1 + ccipEnv.ExecNodeStartIndex = 1 + ccipEnv.NumOfCommitNodes = testConfig.TestGroupInput.NoOfCommitNodes + ccipEnv.NumOfExecNodes = ccipEnv.NumOfCommitNodes + if !pointer.GetBool(testConfig.TestGroupInput.CommitAndExecuteOnSameDON) { + if len(ccipEnv.CLNodesWithKeys) < 11 { + return fmt.Errorf("not enough CL nodes for separate commit and execution nodes") + } + if testConfig.TestGroupInput.NoOfCommitNodes >= totalNodes { + return fmt.Errorf("number of commit nodes can not be greater than total number of nodes in DON") + } + // first two nodes are reserved for bootstrap commit and bootstrap exec + ccipEnv.CommitNodeStartIndex = 2 + ccipEnv.ExecNodeStartIndex = 2 + testConfig.TestGroupInput.NoOfCommitNodes + ccipEnv.NumOfExecNodes = totalNodes - (2 + testConfig.TestGroupInput.NoOfCommitNodes) + if ccipEnv.NumOfExecNodes < 4 { + return fmt.Errorf("insufficient number of exec nodes") + } + } + ccipEnv.NumOfAllowedFaultyExec = (ccipEnv.NumOfExecNodes - 1) / 3 + ccipEnv.NumOfAllowedFaultyCommit = (ccipEnv.NumOfCommitNodes - 1) / 3 + return nil + }) + } + + t.Cleanup(func() { + if configureCLNode { + if ccipEnv.LocalCluster != nil { + err := ccipEnv.LocalCluster.Terminate() + require.NoError(t, err, "Local cluster termination shouldn't fail") + require.NoError(t, o.Reporter.SendReport(t, namespace, false), "Aggregating and sending report shouldn't fail") + return + } + if pointer.GetBool(testConfig.TestGroupInput.KeepEnvAlive) || testConfig.ExistingCLCluster() { + require.NoError(t, o.Reporter.SendReport(t, namespace, true), "Aggregating and sending report shouldn't fail") + return + } + lggr.Info().Msg("Tearing down the environment") + err = integrationactions.TeardownSuite(t, nil, ccipEnv.K8Env, ccipEnv.CLNodes, o.Reporter, zapcore.DPanicLevel, o.Cfg.EnvInput) + require.NoError(t, err, "Environment teardown shouldn't fail") + } else { + //just send the report + require.NoError(t, o.Reporter.SendReport(t, namespace, true), "Aggregating and sending report shouldn't fail") + } + }) + return chainByChainID +} + +func createEnvironmentConfig(t *testing.T, envName string, testConfig *CCIPTestConfig, reportPath string) *environment.Config { + envConfig := &environment.Config{ + NamespacePrefix: envName, + Test: t, + // PreventPodEviction: true, //TODO: enable this once we have a way to handle pod eviction + } + if pointer.GetBool(testConfig.TestGroupInput.StoreLaneConfig) { + envConfig.ReportPath = reportPath + } + // if there is already existing namespace, no need to update any manifest there, we just connect to it + existingEnv := pointer.GetString(testConfig.EnvInput.EnvToConnect) + if existingEnv != "" { + envConfig.Namespace = existingEnv + envConfig.NamespacePrefix = "" + envConfig.SkipManifestUpdate = true + envConfig.RunnerName = fmt.Sprintf("%s-%s", environment.REMOTE_RUNNER_NAME, uuid.NewString()[0:5]) + } + if testConfig.EnvInput.TTL != nil { + envConfig.TTL = testConfig.EnvInput.TTL.Duration() + } + if testConfig.TestGroupInput.LoadProfile != nil && testConfig.TestGroupInput.LoadProfile.TestDuration != nil { + approxDur := testConfig.TestGroupInput.LoadProfile.TestDuration.Duration() + 3*time.Hour + if envConfig.TTL < approxDur { + envConfig.TTL = approxDur + } + } + return envConfig +} diff --git a/integration-tests/ccip-tests/testsetups/test_env.go b/integration-tests/ccip-tests/testsetups/test_env.go new file mode 100644 index 00000000000..263d291453d --- /dev/null +++ b/integration-tests/ccip-tests/testsetups/test_env.go @@ -0,0 +1,597 @@ +package testsetups + +import ( + "bytes" + "fmt" + "os" + "strconv" + "strings" + "testing" + + "github.com/AlekSi/pointer" + "github.com/pkg/errors" + "github.com/rs/zerolog" + "github.com/stretchr/testify/require" + + ctf_config "github.com/smartcontractkit/chainlink-testing-framework/lib/config" + ctf_config_types "github.com/smartcontractkit/chainlink-testing-framework/lib/config/types" + "github.com/smartcontractkit/chainlink-testing-framework/lib/networks" + "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/conversions" + + "github.com/smartcontractkit/chainlink-testing-framework/lib/k8s/pkg/helm/foundry" + + "github.com/smartcontractkit/chainlink-testing-framework/lib/k8s/pkg/helm/mockserver" + mockservercfg "github.com/smartcontractkit/chainlink-testing-framework/lib/k8s/pkg/helm/mockserver-cfg" + + "github.com/smartcontractkit/chainlink-testing-framework/lib/blockchain" + ctftestenv "github.com/smartcontractkit/chainlink-testing-framework/lib/docker/test_env" + "github.com/smartcontractkit/chainlink-testing-framework/lib/k8s/environment" + "github.com/smartcontractkit/chainlink-testing-framework/lib/k8s/pkg/helm/chainlink" + "github.com/smartcontractkit/chainlink-testing-framework/lib/k8s/pkg/helm/reorg" + + "github.com/smartcontractkit/chainlink-common/pkg/config" + k8config "github.com/smartcontractkit/chainlink-testing-framework/lib/k8s/config" + + "github.com/smartcontractkit/chainlink/integration-tests/ccip-tests/actions" + "github.com/smartcontractkit/chainlink/integration-tests/ccip-tests/types/config/node" + "github.com/smartcontractkit/chainlink/integration-tests/docker/test_env" + integrationnodes "github.com/smartcontractkit/chainlink/integration-tests/types/config/node" + evmcfg "github.com/smartcontractkit/chainlink/v2/core/chains/evm/config/toml" + corechainlink "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" +) + +func SetResourceProfile(cpu, mem string) map[string]interface{} { + return map[string]interface{}{ + "requests": map[string]interface{}{ + "cpu": cpu, + "memory": mem, + }, + "limits": map[string]interface{}{ + "cpu": cpu, + "memory": mem, + }, + } +} + +func SetNodeConfig(nets []blockchain.EVMNetwork, nodeConfig, commonChain string, configByChain map[string]string) (*corechainlink.Config, string, error) { + var tomlCfg *corechainlink.Config + var err error + var commonChainConfig *evmcfg.Chain + if commonChain != "" { + err = config.DecodeTOML(bytes.NewReader([]byte(commonChain)), &commonChainConfig) + if err != nil { + return nil, "", err + } + } + configByChainMap := make(map[int64]evmcfg.Chain) + for k, v := range configByChain { + var chain evmcfg.Chain + err = config.DecodeTOML(bytes.NewReader([]byte(v)), &chain) + if err != nil { + return nil, "", err + } + chainId, err := strconv.ParseInt(k, 10, 64) + if err != nil { + return nil, "", err + } + configByChainMap[chainId] = chain + } + if nodeConfig == "" { + tomlCfg = integrationnodes.NewConfig( + integrationnodes.NewBaseConfig(), + node.WithPrivateEVMs(nets, commonChainConfig, configByChainMap)) + } else { + tomlCfg, err = node.NewConfigFromToml([]byte(nodeConfig), node.WithPrivateEVMs(nets, commonChainConfig, configByChainMap)) + if err != nil { + return nil, "", err + } + } + tomlStr, err := tomlCfg.TOMLString() + return tomlCfg, tomlStr, err +} + +func ChainlinkPropsForUpdate( + t *testing.T, + testInputs *CCIPTestConfig, +) (map[string]any, int) { + updateProps := make(map[string]any) + upgradeImage := pointer.GetString(testInputs.EnvInput.NewCLCluster.Common.ChainlinkUpgradeImage.Image) + upgradeTag := pointer.GetString(testInputs.EnvInput.NewCLCluster.Common.ChainlinkUpgradeImage.Version) + noOfNodesToUpgrade := 0 + if len(testInputs.EnvInput.NewCLCluster.Nodes) > 0 { + var nodesMap []map[string]any + for _, clNode := range testInputs.EnvInput.NewCLCluster.Nodes { + if !pointer.GetBool(clNode.NeedsUpgrade) { + continue + } + upgradeImage = pointer.GetString(clNode.ChainlinkUpgradeImage.Image) + upgradeTag = pointer.GetString(clNode.ChainlinkUpgradeImage.Version) + if upgradeImage == "" || upgradeTag == "" { + continue + } + nodeConfig := clNode.BaseConfigTOML + commonChainConfig := clNode.CommonChainConfigTOML + chainConfigByChain := clNode.ChainConfigTOMLByChain + if nodeConfig == "" { + nodeConfig = testInputs.EnvInput.NewCLCluster.Common.BaseConfigTOML + } + if commonChainConfig == "" { + commonChainConfig = testInputs.EnvInput.NewCLCluster.Common.CommonChainConfigTOML + } + if chainConfigByChain == nil { + chainConfigByChain = testInputs.EnvInput.NewCLCluster.Common.ChainConfigTOMLByChain + } + + _, tomlStr, err := SetNodeConfig( + testInputs.SelectedNetworks, + nodeConfig, commonChainConfig, chainConfigByChain, + ) + require.NoError(t, err) + nodesMap = append(nodesMap, map[string]any{ + "name": clNode.Name, + "chainlink": map[string]any{ + "image": map[string]any{ + "image": upgradeImage, + "version": upgradeTag, + }, + }, + "toml": tomlStr, + }) + noOfNodesToUpgrade++ + } + updateProps["nodes"] = nodesMap + } else { + if upgradeImage == "" || upgradeTag == "" { + return nil, 0 + } + updateProps["chainlink"] = map[string]interface{}{ + "image": map[string]interface{}{ + "image": upgradeImage, + "version": upgradeTag, + }, + } + _, tomlStr, err := SetNodeConfig( + testInputs.SelectedNetworks, + testInputs.EnvInput.NewCLCluster.Common.BaseConfigTOML, + testInputs.EnvInput.NewCLCluster.Common.CommonChainConfigTOML, + testInputs.EnvInput.NewCLCluster.Common.ChainConfigTOMLByChain, + ) + require.NoError(t, err) + updateProps["toml"] = tomlStr + noOfNodesToUpgrade = pointer.GetInt(testInputs.EnvInput.NewCLCluster.NoOfNodes) + } + return updateProps, noOfNodesToUpgrade +} + +func ChainlinkChart( + t *testing.T, + testInputs *CCIPTestConfig, + nets []blockchain.EVMNetwork, +) environment.ConnectedChart { + require.NotNil(t, testInputs.EnvInput.NewCLCluster.Common, "Chainlink Common config is not specified") + clProps := make(map[string]interface{}) + clProps["prometheus"] = true + var formattedArgs []string + if len(testInputs.EnvInput.NewCLCluster.DBArgs) > 0 { + for _, arg := range testInputs.EnvInput.NewCLCluster.DBArgs { + formattedArgs = append(formattedArgs, "-c") + formattedArgs = append(formattedArgs, arg) + } + } + clProps["db"] = map[string]interface{}{ + "resources": SetResourceProfile(testInputs.EnvInput.NewCLCluster.DBCPU, testInputs.EnvInput.NewCLCluster.DBMemory), + "additionalArgs": formattedArgs, + "stateful": pointer.GetBool(testInputs.EnvInput.NewCLCluster.IsStateful), + "capacity": testInputs.EnvInput.NewCLCluster.DBCapacity, + "storageClassName": pointer.GetString(testInputs.EnvInput.NewCLCluster.DBStorageClass), + "enablePrometheusPostgresExporter": pointer.GetBool(testInputs.EnvInput.NewCLCluster.PromPgExporter), + "image": map[string]any{ + "image": testInputs.EnvInput.NewCLCluster.Common.DBImage, + "version": testInputs.EnvInput.NewCLCluster.Common.DBTag, + }, + } + clProps["chainlink"] = map[string]interface{}{ + "resources": SetResourceProfile(testInputs.EnvInput.NewCLCluster.NodeCPU, testInputs.EnvInput.NewCLCluster.NodeMemory), + "image": map[string]any{ + "image": pointer.GetString(testInputs.EnvInput.NewCLCluster.Common.ChainlinkImage.Image), + "version": pointer.GetString(testInputs.EnvInput.NewCLCluster.Common.ChainlinkImage.Version), + }, + } + + require.NotNil(t, testInputs.EnvInput, "no env test input specified") + + if len(testInputs.EnvInput.NewCLCluster.Nodes) > 0 { + var nodesMap []map[string]any + for _, clNode := range testInputs.EnvInput.NewCLCluster.Nodes { + nodeConfig := clNode.BaseConfigTOML + commonChainConfig := clNode.CommonChainConfigTOML + chainConfigByChain := clNode.ChainConfigTOMLByChain + if nodeConfig == "" { + nodeConfig = testInputs.EnvInput.NewCLCluster.Common.BaseConfigTOML + } + if commonChainConfig == "" { + commonChainConfig = testInputs.EnvInput.NewCLCluster.Common.CommonChainConfigTOML + } + if chainConfigByChain == nil { + chainConfigByChain = testInputs.EnvInput.NewCLCluster.Common.ChainConfigTOMLByChain + } + + _, tomlStr, err := SetNodeConfig(nets, nodeConfig, commonChainConfig, chainConfigByChain) + require.NoError(t, err) + nodesMap = append(nodesMap, map[string]any{ + "name": clNode.Name, + "chainlink": map[string]any{ + "image": map[string]any{ + "image": pointer.GetString(clNode.ChainlinkImage.Image), + "version": pointer.GetString(clNode.ChainlinkImage.Version), + }, + }, + "db": map[string]any{ + "image": map[string]any{ + "image": clNode.DBImage, + "version": clNode.DBTag, + }, + "storageClassName": "gp3", + }, + "toml": tomlStr, + }) + } + clProps["nodes"] = nodesMap + return chainlink.New(0, clProps) + } + clProps["replicas"] = pointer.GetInt(testInputs.EnvInput.NewCLCluster.NoOfNodes) + _, tomlStr, err := SetNodeConfig( + nets, + testInputs.EnvInput.NewCLCluster.Common.BaseConfigTOML, + testInputs.EnvInput.NewCLCluster.Common.CommonChainConfigTOML, + testInputs.EnvInput.NewCLCluster.Common.ChainConfigTOMLByChain, + ) + require.NoError(t, err) + clProps["toml"] = tomlStr + return chainlink.New(0, clProps) +} + +func DeployLocalCluster( + t *testing.T, + testInputs *CCIPTestConfig, +) (*test_env.CLClusterTestEnv, func() error) { + selectedNetworks := testInputs.SelectedNetworks + + privateEthereumNetworks := []*ctf_config.EthereumNetworkConfig{} + for _, network := range testInputs.EnvInput.PrivateEthereumNetworks { + privateEthereumNetworks = append(privateEthereumNetworks, network) + + for _, networkCfg := range networks.MustGetSelectedNetworkConfig(testInputs.EnvInput.Network) { + for _, key := range networkCfg.PrivateKeys { + address, err := conversions.PrivateKeyHexToAddress(key) + require.NoError(t, err, "failed to convert private key to address: %w", err) + network.EthereumChainConfig.AddressesToFund = append( + network.EthereumChainConfig.AddressesToFund, address.Hex(), + ) + } + } + } + + if len(selectedNetworks) > len(privateEthereumNetworks) { + seen := make(map[int64]bool) + missing := []blockchain.EVMNetwork{} + + for _, network := range privateEthereumNetworks { + seen[int64(network.EthereumChainConfig.ChainID)] = true + } + + for _, network := range selectedNetworks { + if !seen[network.ChainID] { + missing = append(missing, network) + } + } + + for _, network := range missing { + chainConfig := &ctf_config.EthereumChainConfig{} + err := chainConfig.Default() + if err != nil { + require.NoError(t, err, "failed to get default chain config: %w", err) + } else { + chainConfig.ChainID = int(network.ChainID) + eth1 := ctf_config_types.EthereumVersion_Eth1 + geth := ctf_config_types.ExecutionLayer_Geth + + privateEthereumNetworks = append(privateEthereumNetworks, &ctf_config.EthereumNetworkConfig{ + EthereumVersion: ð1, + ExecutionLayer: &geth, + EthereumChainConfig: chainConfig, + }) + } + } + + require.Equal(t, len(selectedNetworks), len(privateEthereumNetworks), "failed to create undefined selected networks. Maybe some of them had the same chain ids?") + } + + env, err := test_env.NewCLTestEnvBuilder(). + WithTestConfig(testInputs.EnvInput). + WithTestInstance(t). + WithPrivateEthereumNetworks(privateEthereumNetworks). + WithMockAdapter(). + WithoutCleanup(). + Build() + require.NoError(t, err) + // the builder builds network with a static network config, we don't want that. + env.EVMNetworks = []*blockchain.EVMNetwork{} + for i, networkCfg := range selectedNetworks { + rpcProvider, err := env.GetRpcProvider(networkCfg.ChainID) + require.NoError(t, err, "Error getting rpc provider") + selectedNetworks[i].URLs = rpcProvider.PrivateWsUrsl() + selectedNetworks[i].HTTPURLs = rpcProvider.PrivateHttpUrls() + newNetwork := networkCfg + newNetwork.URLs = rpcProvider.PublicWsUrls() + newNetwork.HTTPURLs = rpcProvider.PublicHttpUrls() + env.EVMNetworks = append(env.EVMNetworks, &newNetwork) + } + testInputs.SelectedNetworks = selectedNetworks + + // a func to start the CL nodes asynchronously + deployCL := func() error { + noOfNodes := pointer.GetInt(testInputs.EnvInput.NewCLCluster.NoOfNodes) + if env.ClCluster == nil { + env.ClCluster = &test_env.ClCluster{} + } + // if individual nodes are specified, then deploy them with specified configs + if len(testInputs.EnvInput.NewCLCluster.Nodes) > 0 { + for _, clNode := range testInputs.EnvInput.NewCLCluster.Nodes { + toml, _, err := SetNodeConfig( + selectedNetworks, + clNode.BaseConfigTOML, + clNode.CommonChainConfigTOML, + clNode.ChainConfigTOMLByChain, + ) + if err != nil { + return err + } + ccipNode, err := test_env.NewClNode( + []string{env.DockerNetwork.Name}, + pointer.GetString(clNode.ChainlinkImage.Image), + pointer.GetString(clNode.ChainlinkImage.Version), + toml, + env.LogStream, + test_env.WithPgDBOptions( + ctftestenv.WithPostgresImageName(clNode.DBImage), + ctftestenv.WithPostgresImageVersion(clNode.DBTag), + ), + ) + if err != nil { + return err + } + ccipNode.SetTestLogger(t) + env.ClCluster.Nodes = append(env.ClCluster.Nodes, ccipNode) + } + } else { + // if no individual nodes are specified, then deploy the number of nodes specified in the env input with common config + for i := 0; i < noOfNodes; i++ { + toml, _, err := SetNodeConfig( + selectedNetworks, + testInputs.EnvInput.NewCLCluster.Common.BaseConfigTOML, + testInputs.EnvInput.NewCLCluster.Common.CommonChainConfigTOML, + testInputs.EnvInput.NewCLCluster.Common.ChainConfigTOMLByChain, + ) + if err != nil { + return err + } + ccipNode, err := test_env.NewClNode( + []string{env.DockerNetwork.Name}, + pointer.GetString(testInputs.EnvInput.NewCLCluster.Common.ChainlinkImage.Image), + pointer.GetString(testInputs.EnvInput.NewCLCluster.Common.ChainlinkImage.Version), + toml, + env.LogStream, + test_env.WithPgDBOptions( + ctftestenv.WithPostgresImageName(testInputs.EnvInput.NewCLCluster.Common.DBImage), + ctftestenv.WithPostgresImageVersion(testInputs.EnvInput.NewCLCluster.Common.DBTag), + ), + ) + if err != nil { + return err + } + ccipNode.SetTestLogger(t) + env.ClCluster.Nodes = append(env.ClCluster.Nodes, ccipNode) + } + } + return env.ClCluster.Start() + } + return env, deployCL +} + +// UpgradeNodes restarts chainlink nodes in the given range with upgrade image +// startIndex and endIndex are inclusive +func UpgradeNodes( + t *testing.T, + lggr *zerolog.Logger, + testInputs *CCIPTestConfig, + ccipEnv *actions.CCIPTestEnv, +) error { + lggr.Info(). + Msg("Upgrading node version") + // if the test is running on local docker + if pointer.GetBool(testInputs.TestGroupInput.LocalCluster) { + env := ccipEnv.LocalCluster + for i, clNode := range env.ClCluster.Nodes { + upgradeImage := pointer.GetString(testInputs.EnvInput.NewCLCluster.Common.ChainlinkUpgradeImage.Image) + upgradeTag := pointer.GetString(testInputs.EnvInput.NewCLCluster.Common.ChainlinkUpgradeImage.Version) + // if individual node upgrade image is provided, use that + if len(testInputs.EnvInput.NewCLCluster.Nodes) > 0 { + if i < len(testInputs.EnvInput.NewCLCluster.Nodes) { + upgradeImage = pointer.GetString(testInputs.EnvInput.NewCLCluster.Nodes[i].ChainlinkUpgradeImage.Image) + upgradeTag = pointer.GetString(testInputs.EnvInput.NewCLCluster.Nodes[i].ChainlinkUpgradeImage.Version) + } + } + if upgradeImage == "" || upgradeTag == "" { + continue + } + err := clNode.UpgradeVersion(upgradeImage, upgradeTag) + if err != nil { + return err + } + } + } else { + // if the test is running on k8s + k8Env := ccipEnv.K8Env + if k8Env == nil { + return errors.New("k8s environment is nil, cannot restart nodes") + } + props, noOfNodesToUpgrade := ChainlinkPropsForUpdate(t, testInputs) + chartName := ccipEnv.CLNodes[0].ChartName + // explicitly set the env var into false to allow manifest update + // if tests are run in remote runner, it might be set to true to disable manifest update + err := os.Setenv(k8config.EnvVarSkipManifestUpdate, "false") + if err != nil { + return err + } + k8Env.Cfg.SkipManifestUpdate = false + lggr.Info(). + Str("Chart Name", chartName). + Interface("Upgrade Details", props). + Msg("Upgrading Chainlink Node") + k8Env, err = k8Env.UpdateHelm(chartName, props) + if err != nil { + return err + } + err = k8Env.RunUpdated(noOfNodesToUpgrade) + // Run the new environment and wait for changes to show + if err != nil { + return err + } + } + return nil +} + +// DeployEnvironments deploys K8 env for CCIP tests. For tests running on simulated geth it deploys - +// 1. two simulated geth network in non-dev mode +// 2. mockserver ( to set mock price feed details) +// 3. chainlink nodes +func DeployEnvironments( + t *testing.T, + envconfig *environment.Config, + testInputs *CCIPTestConfig, +) *environment.Environment { + selectedNetworks := testInputs.SelectedNetworks + testEnvironment := environment.New(envconfig) + numOfTxNodes := 1 + var charts []string + for i, network := range selectedNetworks { + if testInputs.EnvInput.Network.AnvilConfigs != nil { + // if anvilconfig is specified for a network addhelm for anvil + if anvilConfig, exists := testInputs.EnvInput.Network.AnvilConfigs[strings.ToUpper(network.Name)]; exists { + charts = append(charts, foundry.ChartName) + if anvilConfig.BaseFee == nil { + anvilConfig.BaseFee = pointer.ToInt64(1000000) + } + if anvilConfig.BlockGaslimit == nil { + anvilConfig.BlockGaslimit = pointer.ToInt64(100000000) + } + testEnvironment. + AddHelm(foundry.NewVersioned("0.2.1", &foundry.Props{ + NetworkName: network.Name, + Values: map[string]interface{}{ + "fullnameOverride": actions.NetworkName(network.Name), + "image": map[string]interface{}{ + "repository": "ghcr.io/foundry-rs/foundry", + "tag": "nightly-5ac78a9cd4b94dc53d1fe5e0f42372b28b5a7559", + // "tag": "nightly-ea2eff95b5c17edd3ffbdfc6daab5ce5cc80afc0", + }, + "anvil": map[string]interface{}{ + "chainId": fmt.Sprintf("%d", network.ChainID), + "blockTime": anvilConfig.BlockTime, + "forkURL": anvilConfig.URL, + "forkBlockNumber": anvilConfig.BlockNumber, + "forkRetries": anvilConfig.Retries, + "forkTimeout": anvilConfig.Timeout, + "forkComputeUnitsPerSecond": anvilConfig.ComputePerSecond, + "forkNoRateLimit": anvilConfig.RateLimitDisabled, + "blocksToKeepInMemory": anvilConfig.BlocksToKeepInMem, + "blockGasLimit": fmt.Sprintf("%d", pointer.GetInt64(anvilConfig.BlockGaslimit)), + "baseFee": fmt.Sprintf("%d", pointer.GetInt64(anvilConfig.BaseFee)), + }, + "resources": GethResourceProfile, + "cache": map[string]interface{}{ + "capacity": "150Gi", + }, + }, + })) + selectedNetworks[i].Simulated = true + actions.NetworkChart = foundry.ChartName + continue + } + } + + if !network.Simulated { + charts = append(charts, "") + continue + } + charts = append(charts, strings.ReplaceAll(strings.ToLower(network.Name), " ", "-")) + testEnvironment. + AddHelm(reorg.New(&reorg.Props{ + NetworkName: network.Name, + NetworkType: "simulated-geth-non-dev", + Values: map[string]interface{}{ + "geth": map[string]interface{}{ + "genesis": map[string]interface{}{ + "networkId": fmt.Sprint(network.ChainID), + }, + "tx": map[string]interface{}{ + "replicas": strconv.Itoa(numOfTxNodes), + "resources": testInputs.GethResourceProfile, + }, + "miner": map[string]interface{}{ + "replicas": "0", + "resources": testInputs.GethResourceProfile, + }, + }, + "bootnode": map[string]interface{}{ + "replicas": "1", + }, + }, + })) + } + if pointer.GetBool(testInputs.TestGroupInput.USDCMockDeployment) || + pointer.GetBool(testInputs.TestGroupInput.TokenConfig.WithPipeline) { + testEnvironment. + AddHelm(mockservercfg.New(nil)). + AddHelm(mockserver.New(nil)) + } + err := testEnvironment.Run() + require.NoError(t, err) + + if testEnvironment.WillUseRemoteRunner() { + return testEnvironment + } + urlFinder := func(network blockchain.EVMNetwork, chart string) ([]string, []string) { + if !network.Simulated { + return network.URLs, network.HTTPURLs + } + networkName := actions.NetworkName(network.Name) + var internalWsURLs, internalHttpURLs []string + switch chart { + case foundry.ChartName: + internalWsURLs = append(internalWsURLs, fmt.Sprintf("ws://%s:8545", networkName)) + internalHttpURLs = append(internalHttpURLs, fmt.Sprintf("http://%s:8545", networkName)) + case networkName: + for i := 0; i < numOfTxNodes; i++ { + internalWsURLs = append(internalWsURLs, fmt.Sprintf("ws://%s-ethereum-geth:8546", networkName)) + internalHttpURLs = append(internalHttpURLs, fmt.Sprintf("http://%s-ethereum-geth:8544", networkName)) + } + default: + return network.URLs, network.HTTPURLs + } + + return internalWsURLs, internalHttpURLs + } + var nets []blockchain.EVMNetwork + for i := range selectedNetworks { + nets = append(nets, selectedNetworks[i]) + nets[i].URLs, nets[i].HTTPURLs = urlFinder(selectedNetworks[i], charts[i]) + } + + err = testEnvironment. + AddHelm(ChainlinkChart(t, testInputs, nets)). + Run() + require.NoError(t, err) + return testEnvironment +} diff --git a/integration-tests/ccip-tests/types/config/node/core.go b/integration-tests/ccip-tests/types/config/node/core.go new file mode 100644 index 00000000000..5c9defbbb51 --- /dev/null +++ b/integration-tests/ccip-tests/types/config/node/core.go @@ -0,0 +1,67 @@ +package node + +import ( + "bytes" + "fmt" + "math/big" + + "github.com/smartcontractkit/chainlink-testing-framework/lib/blockchain" + "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/ptr" + + "github.com/smartcontractkit/chainlink-common/pkg/config" + + "github.com/smartcontractkit/chainlink/integration-tests/types/config/node" + itutils "github.com/smartcontractkit/chainlink/integration-tests/utils" + evmcfg "github.com/smartcontractkit/chainlink/v2/core/chains/evm/config/toml" + ubig "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils/big" + "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" +) + +func NewConfigFromToml(tomlConfig []byte, opts ...node.NodeConfigOpt) (*chainlink.Config, error) { + var cfg chainlink.Config + err := config.DecodeTOML(bytes.NewReader(tomlConfig), &cfg) + if err != nil { + return nil, err + } + for _, opt := range opts { + opt(&cfg) + } + return &cfg, nil +} + +func WithPrivateEVMs(networks []blockchain.EVMNetwork, commonChainConfig *evmcfg.Chain, chainSpecificConfig map[int64]evmcfg.Chain) node.NodeConfigOpt { + var evmConfigs []*evmcfg.EVMConfig + for _, network := range networks { + var evmNodes []*evmcfg.Node + for i := range network.URLs { + evmNodes = append(evmNodes, &evmcfg.Node{ + Name: ptr.Ptr(fmt.Sprintf("%s-%d", network.Name, i)), + WSURL: itutils.MustURL(network.URLs[i]), + HTTPURL: itutils.MustURL(network.HTTPURLs[i]), + }) + } + evmConfig := &evmcfg.EVMConfig{ + ChainID: ubig.New(big.NewInt(network.ChainID)), + Nodes: evmNodes, + Chain: evmcfg.Chain{}, + } + if commonChainConfig != nil { + evmConfig.Chain = *commonChainConfig + } + if chainSpecificConfig == nil { + if overriddenChainCfg, ok := chainSpecificConfig[network.ChainID]; ok { + evmConfig.Chain = overriddenChainCfg + } + } + if evmConfig.Chain.FinalityDepth == nil && network.FinalityDepth > 0 { + evmConfig.Chain.FinalityDepth = ptr.Ptr(uint32(network.FinalityDepth)) + } + if evmConfig.Chain.FinalityTagEnabled == nil && network.FinalityTag { + evmConfig.Chain.FinalityTagEnabled = ptr.Ptr(network.FinalityTag) + } + evmConfigs = append(evmConfigs, evmConfig) + } + return func(c *chainlink.Config) { + c.EVM = evmConfigs + } +} diff --git a/integration-tests/ccip-tests/utils/common.go b/integration-tests/ccip-tests/utils/common.go new file mode 100644 index 00000000000..afa8158e450 --- /dev/null +++ b/integration-tests/ccip-tests/utils/common.go @@ -0,0 +1,32 @@ +package utils + +import ( + "path/filepath" + "runtime" + "sync" +) + +func ProjectRoot() string { + _, b, _, _ := runtime.Caller(0) + return filepath.Join(filepath.Dir(b), "/..") +} + +// DeleteNilEntriesFromMap checks for nil entry in map, store all not-nil entries to another map and deallocates previous map +// Deleting keys from a map actually does not delete the key, It just sets the corresponding value to nil. +func DeleteNilEntriesFromMap(inputMap *sync.Map) *sync.Map { + newMap := &sync.Map{} + foundNil := false + inputMap.Range(func(key, value any) bool { + if value != nil { + newMap.Store(key, value) + } + if value == nil { + foundNil = true + } + return true + }) + if foundNil { + runtime.GC() + } + return newMap +} diff --git a/integration-tests/ccip-tests/utils/fileutil.go b/integration-tests/ccip-tests/utils/fileutil.go new file mode 100644 index 00000000000..43e048e1f6b --- /dev/null +++ b/integration-tests/ccip-tests/utils/fileutil.go @@ -0,0 +1,63 @@ +package utils + +import ( + "fmt" + "os" + "path/filepath" + "regexp" + "strings" + + "github.com/rs/zerolog/log" +) + +// FilesWithRegex returns all filepaths under root folder matching with regex pattern +func FilesWithRegex(root, pattern string) ([]string, error) { + r, err := regexp.Compile(pattern) + if err != nil { + return nil, err + } + var filenames []string + err = filepath.Walk(root, func(path string, info os.FileInfo, err error) error { + if err != nil { + return err + } + + // Check if the file matches the regex pattern + if !info.IsDir() && r.MatchString(info.Name()) { + filenames = append(filenames, path) + } + + return nil + }) + return filenames, err +} + +func FileNameFromPath(path string) string { + if !strings.Contains(path, "/") { + return path + } + return strings.Split(path, "/")[len(strings.Split(path, "/"))-1] +} + +// FirstFileFromMatchingPath formats the given filepathWithPattern with actual file path +// if filepathWithPattern is provided with a regex expression it returns the first filepath +// matching with the regex. +// if there is no regex provided in filepathWithPattern it just returns the provided filepath +func FirstFileFromMatchingPath(filepathWithPattern string) (string, error) { + filename := FileNameFromPath(filepathWithPattern) + if strings.Contains(filepathWithPattern, "/") { + rootFolder := strings.Split(filepathWithPattern, filename)[0] + allFiles, err := FilesWithRegex(rootFolder, filename) + if err != nil { + return "", fmt.Errorf("error trying to find file %s:%w", filepathWithPattern, err) + } + if len(allFiles) == 0 { + return "", fmt.Errorf("error trying to find file %s", filepathWithPattern) + } + if len(allFiles) > 1 { + log.Warn().Str("path", filepathWithPattern).Msg("more than one contract config files found in location, using the first one") + } + return allFiles[0], nil + } + return filepathWithPattern, nil +} diff --git a/integration-tests/chaos/automation_chaos_test.go b/integration-tests/chaos/automation_chaos_test.go index e14c35ed17b..c0823f482ad 100644 --- a/integration-tests/chaos/automation_chaos_test.go +++ b/integration-tests/chaos/automation_chaos_test.go @@ -6,21 +6,23 @@ import ( "testing" "time" - seth_utils "github.com/smartcontractkit/chainlink-testing-framework/utils/seth" + "github.com/smartcontractkit/chainlink/integration-tests/actions/automationv2" + + seth_utils "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/seth" "github.com/onsi/gomega" "github.com/stretchr/testify/require" "go.uber.org/zap/zapcore" - ctf_config "github.com/smartcontractkit/chainlink-testing-framework/config" - "github.com/smartcontractkit/chainlink-testing-framework/k8s/chaos" - "github.com/smartcontractkit/chainlink-testing-framework/k8s/environment" - "github.com/smartcontractkit/chainlink-testing-framework/k8s/pkg/helm/chainlink" - "github.com/smartcontractkit/chainlink-testing-framework/k8s/pkg/helm/ethereum" - "github.com/smartcontractkit/chainlink-testing-framework/logging" - "github.com/smartcontractkit/chainlink-testing-framework/networks" - "github.com/smartcontractkit/chainlink-testing-framework/utils/ptr" - "github.com/smartcontractkit/chainlink-testing-framework/utils/testcontext" + ctf_config "github.com/smartcontractkit/chainlink-testing-framework/lib/config" + "github.com/smartcontractkit/chainlink-testing-framework/lib/k8s/chaos" + "github.com/smartcontractkit/chainlink-testing-framework/lib/k8s/environment" + "github.com/smartcontractkit/chainlink-testing-framework/lib/k8s/pkg/helm/chainlink" + "github.com/smartcontractkit/chainlink-testing-framework/lib/k8s/pkg/helm/ethereum" + "github.com/smartcontractkit/chainlink-testing-framework/lib/logging" + "github.com/smartcontractkit/chainlink-testing-framework/lib/networks" + "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/ptr" + "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/testcontext" "github.com/smartcontractkit/chainlink/integration-tests/actions" "github.com/smartcontractkit/chainlink/integration-tests/client" @@ -77,22 +79,6 @@ ListenAddresses = ["0.0.0.0:6690"]` }, }, } - - defaultOCRRegistryConfig = contracts.KeeperRegistrySettings{ - PaymentPremiumPPB: uint32(200000000), - FlatFeeMicroLINK: uint32(0), - BlockCountPerTurn: big.NewInt(10), - CheckGasLimit: uint32(2500000), - StalenessSeconds: big.NewInt(90000), - GasCeilingMultiplier: uint16(1), - MinUpkeepSpend: big.NewInt(0), - MaxPerformGas: uint32(5000000), - FallbackGasPrice: big.NewInt(2e11), - FallbackLinkPrice: big.NewInt(2e18), - MaxCheckDataSize: uint32(5000), - MaxPerformDataSize: uint32(5000), - MaxRevertDataSize: uint32(5000), - } ) func getDefaultAutomationSettings(config *tc.TestConfig) map[string]interface{} { @@ -127,6 +113,7 @@ func TestAutomationChaos(t *testing.T) { "registry_2_0": eth_contracts.RegistryVersion_2_0, "registry_2_1": eth_contracts.RegistryVersion_2_1, "registry_2_2": eth_contracts.RegistryVersion_2_2, + "registry_2_3": eth_contracts.RegistryVersion_2_3, } for name, registryVersion := range registryVersions { @@ -253,48 +240,38 @@ func TestAutomationChaos(t *testing.T) { require.NoError(t, err, "Error tearing down environment") }) - txCost, err := actions.EstimateCostForChainlinkOperations(l, chainClient, network, 1000) - require.NoError(t, err, "Error estimating cost for Chainlink Operations") - err = actions.FundChainlinkNodesFromRootAddress(l, chainClient, contracts.ChainlinkK8sClientToChainlinkNodeWithKeysAndAddress(chainlinkNodes), txCost) - require.NoError(t, err, "Error funding Chainlink nodes") - - linkToken, err := contracts.DeployLinkTokenContract(l, chainClient) - require.NoError(t, err, "Error deploying LINK token") - - registry, registrar := actions.DeployAutoOCRRegistryAndRegistrar( - t, - chainClient, - rv, - defaultOCRRegistryConfig, - linkToken, - ) - - // Fund the registry with LINK - err = linkToken.Transfer(registry.Address(), big.NewInt(0).Mul(big.NewInt(1e18), big.NewInt(int64(numberOfUpkeeps)))) - require.NoError(t, err, "Funding keeper registry contract shouldn't fail") - - actions.CreateOCRKeeperJobs(t, chainlinkNodes, registry.Address(), network.ChainID, 0, rv) - nodesWithoutBootstrap := chainlinkNodes[1:] - defaultOCRRegistryConfig.RegistryVersion = rv - ocrConfig, err := actions.BuildAutoOCR2ConfigVars(t, nodesWithoutBootstrap, defaultOCRRegistryConfig, registrar.Address(), 30*time.Second, registry.ChainModuleAddress(), registry.ReorgProtectionEnabled()) - require.NoError(t, err, "Error building OCR config vars") - - if rv == eth_contracts.RegistryVersion_2_0 { - err = registry.SetConfig(defaultOCRRegistryConfig, ocrConfig) - } else { - err = registry.SetConfigTypeSafe(ocrConfig) + a := automationv2.NewAutomationTestK8s(l, chainClient, chainlinkNodes, &config) + a.SetMercuryCredentialName("cred1") + a.RegistrySettings = actions.ReadRegistryConfig(config) + a.RegistrySettings.RegistryVersion = rv + a.PluginConfig = actions.ReadPluginConfig(config) + a.PublicConfig = actions.ReadPublicConfig(config) + a.RegistrarSettings = contracts.KeeperRegistrarSettings{ + AutoApproveConfigType: uint8(2), + AutoApproveMaxAllowed: 1000, + MinLinkJuels: big.NewInt(0), } - require.NoError(t, err, "Error setting OCR config") - consumersConditional, upkeepidsConditional := actions.DeployConsumers(t, chainClient, registry, registrar, linkToken, numberOfUpkeeps, big.NewInt(defaultLinkFunds), defaultUpkeepGasLimit, false, false, false, nil) - consumersLogtrigger, upkeepidsLogtrigger := actions.DeployConsumers(t, chainClient, registry, registrar, linkToken, numberOfUpkeeps, big.NewInt(defaultLinkFunds), defaultUpkeepGasLimit, true, false, false, nil) + a.SetupAutomationDeployment(t) + + err = actions.FundChainlinkNodesFromRootAddress(l, a.ChainClient, contracts.ChainlinkK8sClientToChainlinkNodeWithKeysAndAddress(chainlinkNodes[1:]), big.NewFloat(*config.Common.ChainlinkNodeFunding)) + require.NoError(t, err, "Error funding Chainlink nodes") - consumers := append(consumersConditional, consumersLogtrigger...) - upkeepIDs := append(upkeepidsConditional, upkeepidsLogtrigger...) + var consumersLogTrigger, consumersConditional []contracts.KeeperConsumer + var upkeepidsConditional, upkeepidsLogTrigger []*big.Int + consumersConditional, upkeepidsConditional = actions.DeployConsumers(t, a.ChainClient, a.Registry, a.Registrar, a.LinkToken, numberOfUpkeeps, big.NewInt(defaultLinkFunds), defaultUpkeepGasLimit, false, false, false, nil, &config) + consumers := consumersConditional + upkeepIDs := upkeepidsConditional + if rv >= eth_contracts.RegistryVersion_2_1 { + consumersLogTrigger, upkeepidsLogTrigger = actions.DeployConsumers(t, a.ChainClient, a.Registry, a.Registrar, a.LinkToken, numberOfUpkeeps, big.NewInt(defaultLinkFunds), defaultUpkeepGasLimit, true, false, false, nil, &config) - for _, c := range consumersLogtrigger { - err = c.Start() - require.NoError(t, err, "Error starting consumer") + consumers = append(consumersConditional, consumersLogTrigger...) + upkeepIDs = append(upkeepidsConditional, upkeepidsLogTrigger...) + + for _, c := range consumersLogTrigger { + err = c.Start() + require.NoError(t, err, "Error starting consumer") + } } l.Info().Msg("Waiting for all upkeeps to be performed") @@ -315,6 +292,13 @@ func TestAutomationChaos(t *testing.T) { _, err = testEnvironment.Chaos.Run(testCase.chaosFunc(testEnvironment.Cfg.Namespace, testCase.chaosProps)) require.NoError(t, err) + if rv >= eth_contracts.RegistryVersion_2_1 { + for _, c := range consumersLogTrigger { + err = c.Start() + require.NoError(t, err, "Error starting consumer") + } + } + gom.Eventually(func(g gomega.Gomega) { // Check if the upkeeps are performing multiple times by analyzing their counters and checking they are greater than 10 for i := 0; i < len(upkeepIDs); i++ { @@ -325,7 +309,7 @@ func TestAutomationChaos(t *testing.T) { g.Expect(counter.Int64()).Should(gomega.BeNumerically(">=", int64(expect)), "Expected consumer counter to be greater than %d, but got %d", expect, counter.Int64()) } - }, "3m", "1s").Should(gomega.Succeed()) // ~1m for cluster setup, ~2m for performing each upkeep 5 times, ~2m buffer + }, "5m", "1s").Should(gomega.Succeed()) // ~1m for cluster setup, ~2m for performing each upkeep 5 times, ~2m buffer }) } diff --git a/integration-tests/chaos/ocr_chaos_test.go b/integration-tests/chaos/ocr_chaos_test.go index 54a02cf64f3..821d3cc48c0 100644 --- a/integration-tests/chaos/ocr_chaos_test.go +++ b/integration-tests/chaos/ocr_chaos_test.go @@ -9,19 +9,19 @@ import ( "github.com/onsi/gomega" "github.com/stretchr/testify/require" - ctfClient "github.com/smartcontractkit/chainlink-testing-framework/client" - ctf_config "github.com/smartcontractkit/chainlink-testing-framework/config" - "github.com/smartcontractkit/chainlink-testing-framework/k8s/chaos" - "github.com/smartcontractkit/chainlink-testing-framework/k8s/environment" - "github.com/smartcontractkit/chainlink-testing-framework/k8s/pkg/helm/chainlink" - "github.com/smartcontractkit/chainlink-testing-framework/k8s/pkg/helm/ethereum" - "github.com/smartcontractkit/chainlink-testing-framework/k8s/pkg/helm/mockserver" - mockservercfg "github.com/smartcontractkit/chainlink-testing-framework/k8s/pkg/helm/mockserver-cfg" - "github.com/smartcontractkit/chainlink-testing-framework/logging" - "github.com/smartcontractkit/chainlink-testing-framework/networks" - "github.com/smartcontractkit/chainlink-testing-framework/utils/ptr" - seth_utils "github.com/smartcontractkit/chainlink-testing-framework/utils/seth" - "github.com/smartcontractkit/chainlink-testing-framework/utils/testcontext" + ctfClient "github.com/smartcontractkit/chainlink-testing-framework/lib/client" + ctf_config "github.com/smartcontractkit/chainlink-testing-framework/lib/config" + "github.com/smartcontractkit/chainlink-testing-framework/lib/k8s/chaos" + "github.com/smartcontractkit/chainlink-testing-framework/lib/k8s/environment" + "github.com/smartcontractkit/chainlink-testing-framework/lib/k8s/pkg/helm/chainlink" + "github.com/smartcontractkit/chainlink-testing-framework/lib/k8s/pkg/helm/ethereum" + "github.com/smartcontractkit/chainlink-testing-framework/lib/k8s/pkg/helm/mockserver" + mockservercfg "github.com/smartcontractkit/chainlink-testing-framework/lib/k8s/pkg/helm/mockserver-cfg" + "github.com/smartcontractkit/chainlink-testing-framework/lib/logging" + "github.com/smartcontractkit/chainlink-testing-framework/lib/networks" + "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/ptr" + seth_utils "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/seth" + "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/testcontext" "github.com/smartcontractkit/chainlink/integration-tests/actions" "github.com/smartcontractkit/chainlink/integration-tests/client" @@ -84,7 +84,7 @@ func TestOCRChaos(t *testing.T) { // and chaos.NewNetworkPartition method (https://chaos-mesh.org/docs/simulate-network-chaos-on-kubernetes/) // in order to regenerate Go bindings if k8s version will be updated // you can pull new CRD spec from your current cluster and check README here - // https://github.com/smartcontractkit/chainlink-testing-framework/k8s/blob/master/README.md + // https://github.com/smartcontractkit/chainlink-testing-framework/lib/k8s/blob/master/README.md NetworkChaosFailMajorityNetwork: { ethereum.New(nil), chainlinkCfg, @@ -178,16 +178,14 @@ func TestOCRChaos(t *testing.T) { require.NoError(t, err, "Error tearing down environment") }) - ms, err := ctfClient.ConnectMockServer(testEnvironment) - require.NoError(t, err, "Creating mockserver clients shouldn't fail") - - linkContract, err := contracts.DeployLinkTokenContract(l, seth) + ms := ctfClient.ConnectMockServer(testEnvironment) + linkContract, err := actions.LinkTokenContract(l, seth, config.OCR) require.NoError(t, err, "Error deploying link token contract") err = actions.FundChainlinkNodesFromRootAddress(l, seth, contracts.ChainlinkK8sClientToChainlinkNodeWithKeysAndAddress(chainlinkNodes), big.NewFloat(10)) require.NoError(t, err) - ocrInstances, err := actions.DeployOCRv1Contracts(l, seth, 1, common.HexToAddress(linkContract.Address()), contracts.ChainlinkK8sClientToChainlinkNodeWithKeysAndAddress(workerNodes)) + ocrInstances, err := actions.SetupOCRv1Contracts(l, seth, config.OCR, common.HexToAddress(linkContract.Address()), contracts.ChainlinkK8sClientToChainlinkNodeWithKeysAndAddress(workerNodes)) require.NoError(t, err) err = actions.CreateOCRJobs(ocrInstances, bootstrapNode, workerNodes, 5, ms, fmt.Sprint(seth.ChainID)) require.NoError(t, err) diff --git a/integration-tests/client/chainlink.go b/integration-tests/client/chainlink.go index 08a47101dc1..ebfd97c48b4 100644 --- a/integration-tests/client/chainlink.go +++ b/integration-tests/client/chainlink.go @@ -2,6 +2,7 @@ package client import ( + "crypto/tls" "fmt" "math/big" "net/http" @@ -45,14 +46,10 @@ type ChainlinkClient struct { // NewChainlinkClient creates a new Chainlink model using a provided config func NewChainlinkClient(c *ChainlinkConfig, logger zerolog.Logger) (*ChainlinkClient, error) { - rc, err := initRestyClient(c.URL, c.Email, c.Password, c.HTTPTimeout) + rc, err := initRestyClient(c.URL, c.Email, c.Password, c.Headers, c.HTTPTimeout) if err != nil { return nil, err } - _, isSet := os.LookupEnv("CL_CLIENT_DEBUG") - if isSet { - rc.SetDebug(true) - } return &ChainlinkClient{ Config: c, APIClient: rc, @@ -61,8 +58,11 @@ func NewChainlinkClient(c *ChainlinkConfig, logger zerolog.Logger) (*ChainlinkCl }, nil } -func initRestyClient(url string, email string, password string, timeout *time.Duration) (*resty.Client, error) { - rc := resty.New().SetBaseURL(url) +func initRestyClient(url string, email string, password string, headers map[string]string, timeout *time.Duration) (*resty.Client, error) { + isDebug := os.Getenv("RESTY_DEBUG") == "true" + // G402 - TODO: certificates + //nolint + rc := resty.New().SetBaseURL(url).SetHeaders(headers).SetTLSClientConfig(&tls.Config{InsecureSkipVerify: true}).SetDebug(isDebug) if timeout != nil { rc.SetTimeout(*timeout) } @@ -74,7 +74,7 @@ func initRestyClient(url string, email string, password string, timeout *time.Du for i := 0; i < retryCount; i++ { resp, err = rc.R().SetBody(session).Post("/sessions") if err != nil { - log.Debug().Err(err).Str("URL", url).Interface("Session Details", session).Msg("Error connecting to Chainlink node, retrying") + log.Warn().Err(err).Str("URL", url).Interface("Session Details", session).Msg("Error connecting to Chainlink node, retrying") time.Sleep(5 * time.Second) } else { break @@ -1112,7 +1112,9 @@ func CreateNodeKeysBundle(nodes []*ChainlinkClient, chainName string, chainId st if err != nil { return nil, nil, err } - + if len(p2pkeys.Data) == 0 { + return nil, nil, fmt.Errorf("found no P2P Keys on the Chainlink node. Node URL: %s", n.URL()) + } peerID := p2pkeys.Data[0].Attributes.PeerID // If there is already a txkey present for the chain skip creating a new one // otherwise the test logic will need multiple key management (like funding all the keys, diff --git a/integration-tests/client/chainlink_k8s.go b/integration-tests/client/chainlink_k8s.go index 794e93f7276..4cdfa96c532 100644 --- a/integration-tests/client/chainlink_k8s.go +++ b/integration-tests/client/chainlink_k8s.go @@ -2,12 +2,11 @@ package client import ( - "os" "regexp" "github.com/rs/zerolog/log" - "github.com/smartcontractkit/chainlink-testing-framework/k8s/environment" + "github.com/smartcontractkit/chainlink-testing-framework/lib/k8s/environment" ) const ( @@ -23,14 +22,10 @@ type ChainlinkK8sClient struct { // NewChainlink creates a new Chainlink model using a provided config func NewChainlinkK8sClient(c *ChainlinkConfig, podName, chartName string) (*ChainlinkK8sClient, error) { - rc, err := initRestyClient(c.URL, c.Email, c.Password, c.HTTPTimeout) + rc, err := initRestyClient(c.URL, c.Email, c.Password, c.Headers, c.HTTPTimeout) if err != nil { return nil, err } - _, isSet := os.LookupEnv("CL_CLIENT_DEBUG") - if isSet { - rc.SetDebug(true) - } return &ChainlinkK8sClient{ ChainlinkClient: &ChainlinkClient{ APIClient: rc, diff --git a/integration-tests/client/chainlink_models.go b/integration-tests/client/chainlink_models.go index a0435d53368..86e9f75902d 100644 --- a/integration-tests/client/chainlink_models.go +++ b/integration-tests/client/chainlink_models.go @@ -20,11 +20,12 @@ type EIServiceConfig struct { // ChainlinkConfig represents the variables needed to connect to a Chainlink node type ChainlinkConfig struct { - URL string `toml:",omitempty"` - Email string `toml:",omitempty"` - Password string `toml:",omitempty"` - InternalIP string `toml:",omitempty"` - HTTPTimeout *time.Duration `toml:"-"` + URL string `toml:",omitempty"` + Email string `toml:",omitempty"` + Password string `toml:",omitempty"` + InternalIP string `toml:",omitempty"` + Headers map[string]string `toml:",omitempty"` + HTTPTimeout *time.Duration `toml:"-"` } // ResponseSlice is the generic model that can be used for all Chainlink API responses that are an slice diff --git a/integration-tests/contracts/contract_models.go b/integration-tests/contracts/contract_models.go index 5983f95c9f5..006ee5db6a8 100644 --- a/integration-tests/contracts/contract_models.go +++ b/integration-tests/contracts/contract_models.go @@ -14,6 +14,8 @@ import ( ocrConfigHelper "github.com/smartcontractkit/libocr/offchainreporting/confighelper" ocrConfigHelper2 "github.com/smartcontractkit/libocr/offchainreporting2plus/confighelper" + "github.com/smartcontractkit/chainlink-common/pkg/config" + "github.com/smartcontractkit/chainlink/integration-tests/client" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/flux_aggregator_wrapper" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/functions_billing_registry_events_mock" @@ -124,22 +126,22 @@ type OffChainAggregatorConfig struct { } type OffChainAggregatorV2Config struct { - DeltaProgress time.Duration - DeltaResend time.Duration - DeltaRound time.Duration - DeltaGrace time.Duration - DeltaStage time.Duration - RMax uint8 - S []int - Oracles []ocrConfigHelper2.OracleIdentityExtra - ReportingPluginConfig []byte - MaxDurationQuery time.Duration - MaxDurationObservation time.Duration - MaxDurationReport time.Duration - MaxDurationShouldAcceptFinalizedReport time.Duration - MaxDurationShouldTransmitAcceptedReport time.Duration - F int - OnchainConfig []byte + DeltaProgress *config.Duration `toml:",omitempty"` + DeltaResend *config.Duration `toml:",omitempty"` + DeltaRound *config.Duration `toml:",omitempty"` + DeltaGrace *config.Duration `toml:",omitempty"` + DeltaStage *config.Duration `toml:",omitempty"` + RMax uint8 `toml:"-"` + S []int `toml:"-"` + Oracles []ocrConfigHelper2.OracleIdentityExtra `toml:"-"` + ReportingPluginConfig []byte `toml:"-"` + MaxDurationQuery *config.Duration `toml:",omitempty"` + MaxDurationObservation *config.Duration `toml:",omitempty"` + MaxDurationReport *config.Duration `toml:",omitempty"` + MaxDurationShouldAcceptFinalizedReport *config.Duration `toml:",omitempty"` + MaxDurationShouldTransmitAcceptedReport *config.Duration `toml:",omitempty"` + F int `toml:"-"` + OnchainConfig []byte `toml:"-"` } type OffchainAggregatorData struct { @@ -149,9 +151,13 @@ type OffchainAggregatorData struct { type ChainlinkNodeWithKeysAndAddress interface { MustReadOCRKeys() (*client.OCRKeys, error) MustReadP2PKeys() (*client.P2PKeys, error) - ExportEVMKeysForChain(string) ([]*client.ExportedEVMKey, error) PrimaryEthAddress() (string, error) EthAddresses() ([]string, error) + ChainlinkKeyExporter +} + +type ChainlinkKeyExporter interface { + ExportEVMKeysForChain(string) ([]*client.ExportedEVMKey, error) } type ChainlinkNodeWithForwarder interface { @@ -224,6 +230,12 @@ type JobByInstance struct { Instance string } +type MockLINKETHFeed interface { + Address() string + LatestRoundData() (*big.Int, error) + LatestRoundDataUpdatedAt() (*big.Int, error) +} + type MockETHLINKFeed interface { Address() string LatestRoundData() (*big.Int, error) diff --git a/integration-tests/contracts/contract_vrf_models.go b/integration-tests/contracts/contract_vrf_models.go index 45825a18ff3..8d1424cbfdf 100644 --- a/integration-tests/contracts/contract_vrf_models.go +++ b/integration-tests/contracts/contract_vrf_models.go @@ -9,7 +9,7 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" - "github.com/smartcontractkit/seth" + "github.com/smartcontractkit/chainlink-testing-framework/seth" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_coordinator_v2" @@ -76,6 +76,8 @@ type VRFCoordinatorV2 interface { WaitForConfigSetEvent(timeout time.Duration) (*CoordinatorConfigSet, error) OracleWithdraw(recipient common.Address, amount *big.Int) error GetBlockHashStoreAddress(ctx context.Context) (common.Address, error) + GetLinkAddress(ctx context.Context) (common.Address, error) + GetLinkNativeFeed(ctx context.Context) (common.Address, error) } type VRFCoordinatorV2_5 interface { @@ -121,6 +123,9 @@ type VRFCoordinatorV2_5 interface { ParseRandomWordsFulfilled(log types.Log) (*CoordinatorRandomWordsFulfilled, error) WaitForConfigSetEvent(timeout time.Duration) (*CoordinatorConfigSet, error) GetBlockHashStoreAddress(ctx context.Context) (common.Address, error) + GetLinkAddress(ctx context.Context) (common.Address, error) + GetLinkNativeFeed(ctx context.Context) (common.Address, error) + GetConfig(ctx context.Context) (vrf_coordinator_v2_5.SConfig, error) } type VRFCoordinatorV2PlusUpgradedVersion interface { diff --git a/integration-tests/contracts/ethereum/OffchainAggregatorEventsMock.go b/integration-tests/contracts/ethereum/OffchainAggregatorEventsMock.go index 86963e01a45..1006daa0345 100644 --- a/integration-tests/contracts/ethereum/OffchainAggregatorEventsMock.go +++ b/integration-tests/contracts/ethereum/OffchainAggregatorEventsMock.go @@ -15,6 +15,7 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/event" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" ) diff --git a/integration-tests/contracts/ethereum/StakingEventsMock.go b/integration-tests/contracts/ethereum/StakingEventsMock.go index 5a1a1663ba9..b3b695ea301 100644 --- a/integration-tests/contracts/ethereum/StakingEventsMock.go +++ b/integration-tests/contracts/ethereum/StakingEventsMock.go @@ -15,6 +15,7 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/event" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" ) diff --git a/integration-tests/contracts/ethereum_contracts.go b/integration-tests/contracts/ethereum_contracts.go index 2db6aeb4637..288a36978a8 100644 --- a/integration-tests/contracts/ethereum_contracts.go +++ b/integration-tests/contracts/ethereum_contracts.go @@ -14,11 +14,13 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/rs/zerolog" "github.com/rs/zerolog/log" + "github.com/smartcontractkit/libocr/gethwrappers/offchainaggregator" "github.com/smartcontractkit/libocr/gethwrappers2/ocr2aggregator" ocrConfigHelper "github.com/smartcontractkit/libocr/offchainreporting/confighelper" ocrTypes "github.com/smartcontractkit/libocr/offchainreporting/types" - "github.com/smartcontractkit/seth" + + "github.com/smartcontractkit/chainlink-testing-framework/seth" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/counter" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/i_automation_registry_master_wrapper_2_3" @@ -202,22 +204,17 @@ type EthereumOffchainAggregator struct { l zerolog.Logger } -func LoadOffchainAggregator(l zerolog.Logger, seth *seth.Client, contractAddress common.Address) (EthereumOffchainAggregator, error) { - abi, err := offchainaggregator.OffchainAggregatorMetaData.GetAbi() - if err != nil { - return EthereumOffchainAggregator{}, fmt.Errorf("failed to get OffChain Aggregator ABI: %w", err) - } - seth.ContractStore.AddABI("OffChainAggregator", *abi) - seth.ContractStore.AddBIN("OffChainAggregator", common.FromHex(offchainaggregator.OffchainAggregatorMetaData.Bin)) +func LoadOffChainAggregator(l zerolog.Logger, sethClient *seth.Client, contractAddress common.Address) (EthereumOffchainAggregator, error) { + loader := seth.NewContractLoader[offchainaggregator.OffchainAggregator](sethClient) + instance, err := loader.LoadContract("LinkToken", contractAddress, offchainaggregator.OffchainAggregatorMetaData.GetAbi, offchainaggregator.NewOffchainAggregator) - ocr, err := offchainaggregator.NewOffchainAggregator(contractAddress, wrappers.MustNewWrappedContractBackend(nil, seth)) if err != nil { - return EthereumOffchainAggregator{}, fmt.Errorf("failed to instantiate OCR instance: %w", err) + return EthereumOffchainAggregator{}, fmt.Errorf("failed to instantiate OCR v2 instance: %w", err) } return EthereumOffchainAggregator{ - client: seth, - ocr: ocr, + client: sethClient, + ocr: instance, address: &contractAddress, l: l, }, nil @@ -355,10 +352,6 @@ func (o *EthereumOffchainAggregator) SetConfig( return err } - // fails with error setting OCR config for contract '0x0DCd1Bf9A1b36cE34237eEaFef220932846BCD82': both gasPrice and (maxFeePerGas or maxPriorityFeePerGas) specified - // but we only have gasPrice set... It also fails with the same error when we enable EIP-1559 - // fails when we wait for it to be minted, inside the wrapper there's no error when we call it, so it must be something inside smart contract - // that's reverting it and maybe the error message is completely off _, err = o.client.Decode(o.ocr.SetConfig(o.client.NewTXOpts(), signers, transmitters, threshold, encodedConfigVersion, encodedConfig)) return err } @@ -582,36 +575,36 @@ type EthereumOffchainAggregatorV2 struct { l zerolog.Logger } -func LoadOffChainAggregatorV2(l zerolog.Logger, seth *seth.Client, contractAddress common.Address) (EthereumOffchainAggregatorV2, error) { - oAbi, err := ocr2aggregator.OCR2AggregatorMetaData.GetAbi() +func LoadOffchainAggregatorV2(l zerolog.Logger, seth *seth.Client, address common.Address) (EthereumOffchainAggregatorV2, error) { + contractAbi, err := ocr2aggregator.OCR2AggregatorMetaData.GetAbi() if err != nil { - return EthereumOffchainAggregatorV2{}, fmt.Errorf("failed to get OffChain Aggregator ABI: %w", err) + return EthereumOffchainAggregatorV2{}, fmt.Errorf("failed to get OffChain Aggregator v2 ABI: %w", err) } - seth.ContractStore.AddABI("OffChainAggregatorV2", *oAbi) + seth.ContractStore.AddABI("OffChainAggregatorV2", *contractAbi) seth.ContractStore.AddBIN("OffChainAggregatorV2", common.FromHex(ocr2aggregator.OCR2AggregatorMetaData.Bin)) - ocr2, err := ocr2aggregator.NewOCR2Aggregator(contractAddress, seth.Client) + ocr2, err := ocr2aggregator.NewOCR2Aggregator(address, seth.Client) if err != nil { - return EthereumOffchainAggregatorV2{}, fmt.Errorf("failed to instantiate OCR instance: %w", err) + return EthereumOffchainAggregatorV2{}, fmt.Errorf("failed to instantiate OCRv2 instance: %w", err) } return EthereumOffchainAggregatorV2{ client: seth, contract: ocr2, - address: &contractAddress, + address: &address, l: l, }, nil } func DeployOffchainAggregatorV2(l zerolog.Logger, seth *seth.Client, linkTokenAddress common.Address, offchainOptions OffchainOptions) (EthereumOffchainAggregatorV2, error) { - oAbi, err := ocr2aggregator.OCR2AggregatorMetaData.GetAbi() + contractAbi, err := ocr2aggregator.OCR2AggregatorMetaData.GetAbi() if err != nil { - return EthereumOffchainAggregatorV2{}, fmt.Errorf("failed to get OffChain Aggregator ABI: %w", err) + return EthereumOffchainAggregatorV2{}, fmt.Errorf("failed to get OffChain Aggregator v2 ABI: %w", err) } - seth.ContractStore.AddABI("OffChainAggregatorV2", *oAbi) + seth.ContractStore.AddABI("OffChainAggregatorV2", *contractAbi) seth.ContractStore.AddBIN("OffChainAggregatorV2", common.FromHex(ocr2aggregator.OCR2AggregatorMetaData.Bin)) - ocrDeploymentData2, err := seth.DeployContract(seth.NewTXOpts(), "OffChainAggregatorV2", *oAbi, common.FromHex(ocr2aggregator.OCR2AggregatorMetaData.Bin), + ocrDeploymentData2, err := seth.DeployContract(seth.NewTXOpts(), "OffChainAggregatorV2", *contractAbi, common.FromHex(ocr2aggregator.OCR2AggregatorMetaData.Bin), linkTokenAddress, offchainOptions.MinimumAnswer, offchainOptions.MaximumAnswer, @@ -622,12 +615,12 @@ func DeployOffchainAggregatorV2(l zerolog.Logger, seth *seth.Client, linkTokenAd ) if err != nil { - return EthereumOffchainAggregatorV2{}, fmt.Errorf("OCR instance deployment have failed: %w", err) + return EthereumOffchainAggregatorV2{}, fmt.Errorf("OCRv2 instance deployment have failed: %w", err) } ocr2, err := ocr2aggregator.NewOCR2Aggregator(ocrDeploymentData2.Address, wrappers.MustNewWrappedContractBackend(nil, seth)) if err != nil { - return EthereumOffchainAggregatorV2{}, fmt.Errorf("failed to instantiate OCR instance: %w", err) + return EthereumOffchainAggregatorV2{}, fmt.Errorf("failed to instantiate OCRv2 instance: %w", err) } return EthereumOffchainAggregatorV2{ @@ -713,9 +706,9 @@ func (e *EthereumOffchainAggregatorV2) SetConfig(ocrConfig *OCRv2Config) error { Interface("Signers", ocrConfig.Signers). Interface("Transmitters", ocrConfig.Transmitters). Uint8("F", ocrConfig.F). - Bytes("OnchainConfig", ocrConfig.OnchainConfig). + Str("OnchainConfig", string(ocrConfig.OnchainConfig)). Uint64("OffchainConfigVersion", ocrConfig.OffchainConfigVersion). - Bytes("OffchainConfig", ocrConfig.OffchainConfig). + Str("OffchainConfig", string(ocrConfig.OffchainConfig)). Msg("Setting OCRv2 Config") _, err := e.client.Decode(e.contract.SetConfig( @@ -770,22 +763,16 @@ func DeployLinkTokenContract(l zerolog.Logger, client *seth.Client) (*EthereumLi } func LoadLinkTokenContract(l zerolog.Logger, client *seth.Client, address common.Address) (*EthereumLinkToken, error) { - abi, err := link_token_interface.LinkTokenMetaData.GetAbi() - if err != nil { - return &EthereumLinkToken{}, fmt.Errorf("failed to get LinkToken ABI: %w", err) - } - - client.ContractStore.AddABI("LinkToken", *abi) - client.ContractStore.AddBIN("LinkToken", common.FromHex(link_token_interface.LinkTokenMetaData.Bin)) + loader := seth.NewContractLoader[link_token_interface.LinkToken](client) + instance, err := loader.LoadContract("LinkToken", address, link_token_interface.LinkTokenMetaData.GetAbi, link_token_interface.NewLinkToken) - linkToken, err := link_token_interface.NewLinkToken(address, wrappers.MustNewWrappedContractBackend(nil, client)) if err != nil { return &EthereumLinkToken{}, fmt.Errorf("failed to instantiate LinkToken instance: %w", err) } return &EthereumLinkToken{ client: client, - instance: linkToken, + instance: instance, address: address, l: l, }, nil @@ -1195,19 +1182,19 @@ func (v *EthereumMockETHLINKFeed) LatestRoundDataUpdatedAt() (*big.Int, error) { return data.UpdatedAt, nil } -func DeployMockETHLINKFeed(client *seth.Client, answer *big.Int) (MockETHLINKFeed, error) { +func DeployMockLINKETHFeed(client *seth.Client, answer *big.Int) (MockLINKETHFeed, error) { abi, err := mock_ethlink_aggregator_wrapper.MockETHLINKAggregatorMetaData.GetAbi() if err != nil { - return &EthereumMockETHLINKFeed{}, fmt.Errorf("failed to get MockETHLINKFeed ABI: %w", err) + return &EthereumMockETHLINKFeed{}, fmt.Errorf("failed to get MockLINKETHFeed ABI: %w", err) } - data, err := client.DeployContract(client.NewTXOpts(), "MockETHLINKFeed", *abi, common.FromHex(mock_ethlink_aggregator_wrapper.MockETHLINKAggregatorMetaData.Bin), answer) + data, err := client.DeployContract(client.NewTXOpts(), "MockLINKETHFeed", *abi, common.FromHex(mock_ethlink_aggregator_wrapper.MockETHLINKAggregatorMetaData.Bin), answer) if err != nil { - return &EthereumMockETHLINKFeed{}, fmt.Errorf("MockETHLINKFeed instance deployment have failed: %w", err) + return &EthereumMockETHLINKFeed{}, fmt.Errorf("MockLINKETHFeed instance deployment have failed: %w", err) } instance, err := mock_ethlink_aggregator_wrapper.NewMockETHLINKAggregator(data.Address, wrappers.MustNewWrappedContractBackend(nil, client)) if err != nil { - return &EthereumMockETHLINKFeed{}, fmt.Errorf("failed to instantiate MockETHLINKFeed instance: %w", err) + return &EthereumMockETHLINKFeed{}, fmt.Errorf("failed to instantiate MockLINKETHFeed instance: %w", err) } return &EthereumMockETHLINKFeed{ @@ -1217,17 +1204,17 @@ func DeployMockETHLINKFeed(client *seth.Client, answer *big.Int) (MockETHLINKFee }, nil } -func LoadMockETHLINKFeed(client *seth.Client, address common.Address) (MockETHLINKFeed, error) { +func LoadMockLINKETHFeed(client *seth.Client, address common.Address) (MockLINKETHFeed, error) { abi, err := mock_ethlink_aggregator_wrapper.MockETHLINKAggregatorMetaData.GetAbi() if err != nil { - return &EthereumMockETHLINKFeed{}, fmt.Errorf("failed to get MockETHLINKFeed ABI: %w", err) + return &EthereumMockETHLINKFeed{}, fmt.Errorf("failed to get MockLINKETHFeed ABI: %w", err) } - client.ContractStore.AddABI("MockETHLINKFeed", *abi) - client.ContractStore.AddBIN("MockETHLINKFeed", common.FromHex(mock_ethlink_aggregator_wrapper.MockETHLINKAggregatorMetaData.Bin)) + client.ContractStore.AddABI("MockLINKETHFeed", *abi) + client.ContractStore.AddBIN("MockLINKETHFeed", common.FromHex(mock_ethlink_aggregator_wrapper.MockETHLINKAggregatorMetaData.Bin)) instance, err := mock_ethlink_aggregator_wrapper.NewMockETHLINKAggregator(address, wrappers.MustNewWrappedContractBackend(nil, client)) if err != nil { - return &EthereumMockETHLINKFeed{}, fmt.Errorf("failed to instantiate MockETHLINKFeed instance: %w", err) + return &EthereumMockETHLINKFeed{}, fmt.Errorf("failed to instantiate MockLINKETHFeed instance: %w", err) } return &EthereumMockETHLINKFeed{ diff --git a/integration-tests/contracts/ethereum_contracts_atlas.go b/integration-tests/contracts/ethereum_contracts_atlas.go index c28e5198682..4636a92a194 100644 --- a/integration-tests/contracts/ethereum_contracts_atlas.go +++ b/integration-tests/contracts/ethereum_contracts_atlas.go @@ -5,7 +5,8 @@ import ( "math/big" "github.com/ethereum/go-ethereum/common" - "github.com/smartcontractkit/seth" + + "github.com/smartcontractkit/chainlink-testing-framework/seth" eth_contracts "github.com/smartcontractkit/chainlink/integration-tests/contracts/ethereum" "github.com/smartcontractkit/chainlink/integration-tests/wrappers" diff --git a/integration-tests/contracts/ethereum_contracts_automation.go b/integration-tests/contracts/ethereum_contracts_automation.go index bd0e1aafc82..3e18fe177f0 100644 --- a/integration-tests/contracts/ethereum_contracts_automation.go +++ b/integration-tests/contracts/ethereum_contracts_automation.go @@ -14,13 +14,14 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/rs/zerolog" - "github.com/smartcontractkit/seth" + + "github.com/smartcontractkit/chainlink-testing-framework/seth" cltypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" registrylogicc23 "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/automation_registry_logic_c_wrapper_2_3" - "github.com/smartcontractkit/chainlink-testing-framework/blockchain" - "github.com/smartcontractkit/chainlink-testing-framework/networks" + "github.com/smartcontractkit/chainlink-testing-framework/lib/blockchain" + "github.com/smartcontractkit/chainlink-testing-framework/lib/networks" "github.com/smartcontractkit/chainlink/integration-tests/contracts/ethereum" eth_contracts "github.com/smartcontractkit/chainlink/integration-tests/contracts/ethereum" "github.com/smartcontractkit/chainlink/integration-tests/testreporters" @@ -147,7 +148,7 @@ type EthereumKeeperRegistry struct { func (v *EthereumKeeperRegistry) ReorgProtectionEnabled() bool { chainId := v.client.ChainID // reorg protection is disabled in polygon zkEVM and Scroll bc currently there is no way to get the block hash onchain - return v.version != ethereum.RegistryVersion_2_2 || (chainId != 1101 && chainId != 1442 && chainId != 2442 && chainId != 534352 && chainId != 534351) + return v.version < ethereum.RegistryVersion_2_2 || (chainId != 1101 && chainId != 1442 && chainId != 2442 && chainId != 534352 && chainId != 534351) } func (v *EthereumKeeperRegistry) ChainModuleAddress() common.Address { @@ -193,10 +194,11 @@ func (v *EthereumKeeperRegistry) RegistryOwnerAddress() common.Address { func (v *EthereumKeeperRegistry) SetConfigTypeSafe(ocrConfig OCRv2Config) error { txOpts := v.client.NewTXOpts() var err error + var decodedTx *seth.DecodedTransaction switch v.version { case ethereum.RegistryVersion_2_1: - _, err = v.client.Decode(v.registry2_1.SetConfigTypeSafe(txOpts, + decodedTx, err = v.client.Decode(v.registry2_1.SetConfigTypeSafe(txOpts, ocrConfig.Signers, ocrConfig.Transmitters, ocrConfig.F, @@ -205,7 +207,7 @@ func (v *EthereumKeeperRegistry) SetConfigTypeSafe(ocrConfig OCRv2Config) error ocrConfig.OffchainConfig, )) case ethereum.RegistryVersion_2_2: - _, err = v.client.Decode(v.registry2_2.SetConfigTypeSafe(txOpts, + decodedTx, err = v.client.Decode(v.registry2_2.SetConfigTypeSafe(txOpts, ocrConfig.Signers, ocrConfig.Transmitters, ocrConfig.F, @@ -214,7 +216,7 @@ func (v *EthereumKeeperRegistry) SetConfigTypeSafe(ocrConfig OCRv2Config) error ocrConfig.OffchainConfig, )) case ethereum.RegistryVersion_2_3: - _, err = v.client.Decode(v.registry2_3.SetConfigTypeSafe(txOpts, + decodedTx, err = v.client.Decode(v.registry2_3.SetConfigTypeSafe(txOpts, ocrConfig.Signers, ocrConfig.Transmitters, ocrConfig.F, @@ -227,7 +229,7 @@ func (v *EthereumKeeperRegistry) SetConfigTypeSafe(ocrConfig OCRv2Config) error default: return fmt.Errorf("SetConfigTypeSafe is not supported in keeper registry version %d", v.version) } - + v.l.Debug().Interface("decodedTx", decodedTx).Msg("SetConfigTypeSafe") return err } @@ -1368,12 +1370,7 @@ func deployRegistry22(client *seth.Client, opts *KeeperRegistryOpts) (KeeperRegi return nil, err } - var allowedReadOnlyAddress common.Address - if chainId == networks.PolygonZkEvmMainnet.ChainID || chainId == networks.PolygonZkEvmCardona.ChainID { - allowedReadOnlyAddress = common.HexToAddress("0x1111111111111111111111111111111111111111") - } else { - allowedReadOnlyAddress = common.HexToAddress("0x0000000000000000000000000000000000000000") - } + allowedReadOnlyAddress := common.HexToAddress("0x0000000000000000000000000000000000000000") logicBAbi, err := registrylogicb22.AutomationRegistryLogicBMetaData.GetAbi() if err != nil { @@ -1456,12 +1453,7 @@ func deployRegistry23(client *seth.Client, opts *KeeperRegistryOpts) (KeeperRegi return nil, err } - var allowedReadOnlyAddress common.Address - if chainId == networks.PolygonZkEvmMainnet.ChainID || chainId == networks.PolygonZkEvmCardona.ChainID { - allowedReadOnlyAddress = common.HexToAddress("0x1111111111111111111111111111111111111111") - } else { - allowedReadOnlyAddress = common.HexToAddress("0x0000000000000000000000000000000000000000") - } + allowedReadOnlyAddress := common.HexToAddress("0x0000000000000000000000000000000000000000") logicCAbi, err := registrylogicc23.AutomationRegistryLogicCMetaData.GetAbi() if err != nil { @@ -1537,7 +1529,7 @@ func deployRegistry23(client *seth.Client, opts *KeeperRegistryOpts) (KeeperRegi } // LoadKeeperRegistry returns deployed on given address EthereumKeeperRegistry -func LoadKeeperRegistry(l zerolog.Logger, client *seth.Client, address common.Address, registryVersion eth_contracts.KeeperRegistryVersion) (KeeperRegistry, error) { +func LoadKeeperRegistry(l zerolog.Logger, client *seth.Client, address common.Address, registryVersion eth_contracts.KeeperRegistryVersion, chainModuleAddress common.Address) (KeeperRegistry, error) { var keeper *EthereumKeeperRegistry var err error switch registryVersion { @@ -1554,7 +1546,7 @@ func LoadKeeperRegistry(l zerolog.Logger, client *seth.Client, address common.Ad case eth_contracts.RegistryVersion_2_2: // why the contract name is not the same as the actual contract name? keeper, err = loadRegistry2_2(client, address) case eth_contracts.RegistryVersion_2_3: - keeper, err = loadRegistry2_3(client, address) + keeper, err = loadRegistry2_3(client, address, chainModuleAddress) default: return nil, fmt.Errorf("keeper registry version %d is not supported", registryVersion) } @@ -1694,24 +1686,24 @@ func loadRegistry2_2(client *seth.Client, address common.Address) (*EthereumKeep }, nil } -func loadRegistry2_3(client *seth.Client, address common.Address) (*EthereumKeeperRegistry, error) { - abi, err := iregistry23.IAutomationRegistryMaster23MetaData.GetAbi() +func loadRegistry2_3(client *seth.Client, address, chainModuleAddress common.Address) (*EthereumKeeperRegistry, error) { + + loader := seth.NewContractLoader[iregistry23.IAutomationRegistryMaster23](client) + instance, err := loader.LoadContract("AutomationRegistry2_3", address, iregistry23.IAutomationRegistryMaster23MetaData.GetAbi, iregistry23.NewIAutomationRegistryMaster23) if err != nil { - return &EthereumKeeperRegistry{}, fmt.Errorf("failed to get AutomationRegistry2_3 ABI: %w", err) + return &EthereumKeeperRegistry{}, fmt.Errorf("failed to load AutomationRegistry2_3 instance: %w", err) } - client.ContractStore.AddABI("AutomationRegistry2_3", *abi) - client.ContractStore.AddBIN("AutomationRegistry2_3", common.FromHex(iregistry23.IAutomationRegistryMaster23MetaData.Bin)) - - instance, err := iregistry23.NewIAutomationRegistryMaster23(address, wrappers.MustNewWrappedContractBackend(nil, client)) + chainModule, err := loadChainModule(client, chainModuleAddress) if err != nil { - return &EthereumKeeperRegistry{}, fmt.Errorf("failed to instantiate AutomationRegistry2_3 instance: %w", err) + return &EthereumKeeperRegistry{}, fmt.Errorf("failed to load chain module: %w", err) } return &EthereumKeeperRegistry{ address: &address, client: client, registry2_3: instance, + chainModule: chainModule, }, nil } @@ -1767,6 +1759,26 @@ func deployOptimismModule(client *seth.Client) (common.Address, error) { return data.Address, nil } +func loadChainModule(client *seth.Client, address common.Address) (*i_chain_module.IChainModule, error) { + abi, err := i_chain_module.IChainModuleMetaData.GetAbi() + if err != nil { + return &i_chain_module.IChainModule{}, fmt.Errorf("failed to get IChainModule ABI: %w", err) + } + + client.ContractStore.AddABI("IChainModule", *abi) + client.ContractStore.AddBIN("IChainModule", common.FromHex(i_chain_module.IChainModuleMetaData.Bin)) + + chainModule, err := i_chain_module.NewIChainModule( + address, + wrappers.MustNewWrappedContractBackend(nil, client), + ) + if err != nil { + return &i_chain_module.IChainModule{}, fmt.Errorf("failed to instantiate IChainModule instance: %w", err) + } + + return chainModule, nil +} + func deployBaseModule(client *seth.Client) (common.Address, error) { abi, err := chain_module_base.ChainModuleBaseMetaData.GetAbi() if err != nil { @@ -2202,17 +2214,10 @@ func LoadKeeperRegistrar(client *seth.Client, address common.Address, registryVe if registryVersion == eth_contracts.RegistryVersion_1_1 || registryVersion == eth_contracts.RegistryVersion_1_2 || registryVersion == eth_contracts.RegistryVersion_1_3 { - abi, err := keeper_registrar_wrapper1_2.KeeperRegistrarMetaData.GetAbi() + loader := seth.NewContractLoader[keeper_registrar_wrapper1_2.KeeperRegistrar](client) + instance, err := loader.LoadContract("KeeperRegistrar1_2", address, keeper_registrar_wrapper1_2.KeeperRegistrarMetaData.GetAbi, keeper_registrar_wrapper1_2.NewKeeperRegistrar) if err != nil { - return &EthereumKeeperRegistrar{}, fmt.Errorf("failed to get KeeperRegistrar1_2 ABI: %w", err) - } - - client.ContractStore.AddABI("KeeperRegistrar1_2", *abi) - client.ContractStore.AddBIN("KeeperRegistrar1_2", common.FromHex(keeper_registrar_wrapper1_2.KeeperRegistrarMetaData.Bin)) - - instance, err := keeper_registrar_wrapper1_2.NewKeeperRegistrar(address, wrappers.MustNewWrappedContractBackend(nil, client)) - if err != nil { - return &EthereumKeeperRegistrar{}, fmt.Errorf("failed to instantiate KeeperRegistrar1_2 instance: %w", err) + return &EthereumKeeperRegistrar{}, fmt.Errorf("failed to load KeeperRegistrar1_2 instance: %w", err) } return &EthereumKeeperRegistrar{ @@ -2221,43 +2226,78 @@ func LoadKeeperRegistrar(client *seth.Client, address common.Address, registryVe registrar: instance, }, err } else if registryVersion == eth_contracts.RegistryVersion_2_0 { - abi, err := keeper_registrar_wrapper2_0.KeeperRegistrarMetaData.GetAbi() + loader := seth.NewContractLoader[keeper_registrar_wrapper2_0.KeeperRegistrar](client) + instance, err := loader.LoadContract("KeeperRegistrar2_0", address, keeper_registrar_wrapper2_0.KeeperRegistrarMetaData.GetAbi, keeper_registrar_wrapper2_0.NewKeeperRegistrar) if err != nil { - return &EthereumKeeperRegistrar{}, fmt.Errorf("failed to get KeeperRegistrar2_0 ABI: %w", err) + return &EthereumKeeperRegistrar{}, fmt.Errorf("failed to load KeeperRegistrar2_0 instance: %w", err) } - client.ContractStore.AddABI("KeeperRegistrar2_0", *abi) - client.ContractStore.AddBIN("KeeperRegistrar2_0", common.FromHex(keeper_registrar_wrapper2_0.KeeperRegistrarMetaData.Bin)) + return &EthereumKeeperRegistrar{ + address: &address, + client: client, + registrar20: instance, + }, nil + } else if registryVersion == eth_contracts.RegistryVersion_2_1 || registryVersion == eth_contracts.RegistryVersion_2_2 { + loader := seth.NewContractLoader[registrar21.AutomationRegistrar](client) + instance, err := loader.LoadContract("KeeperRegistrar2_1", address, registrar21.AutomationRegistrarMetaData.GetAbi, registrar21.NewAutomationRegistrar) + if err != nil { + return &EthereumKeeperRegistrar{}, fmt.Errorf("failed to load KeeperRegistrar2_1 instance: %w", err) + } - instance, err := keeper_registrar_wrapper2_0.NewKeeperRegistrar(address, wrappers.MustNewWrappedContractBackend(nil, client)) + return &EthereumKeeperRegistrar{ + address: &address, + client: client, + registrar21: instance, + }, nil + } else if registryVersion == eth_contracts.RegistryVersion_2_3 { + loader := seth.NewContractLoader[registrar23.AutomationRegistrar](client) + instance, err := loader.LoadContract("KeeperRegistrar2_3", address, registrar23.AutomationRegistrarMetaData.GetAbi, registrar23.NewAutomationRegistrar) if err != nil { - return &EthereumKeeperRegistrar{}, fmt.Errorf("failed to instantiate KeeperRegistrar2_0 instance: %w", err) + return &EthereumKeeperRegistrar{}, fmt.Errorf("failed to load KeeperRegistrar2_3 instance: %w", err) } return &EthereumKeeperRegistrar{ address: &address, client: client, - registrar20: instance, + registrar23: instance, }, nil } + return &EthereumKeeperRegistrar{}, fmt.Errorf("unsupported registry version: %v", registryVersion) +} - abi, err := registrar21.AutomationRegistrarMetaData.GetAbi() - if err != nil { - return &EthereumKeeperRegistrar{}, fmt.Errorf("failed to get KeeperRegistrar2_1 ABI: %w", err) - } +type EthereumAutomationKeeperConsumer struct { + client *seth.Client + consumer *log_upkeep_counter_wrapper.LogUpkeepCounter + address *common.Address +} - client.ContractStore.AddABI("KeeperRegistrar2_1", *abi) - client.ContractStore.AddBIN("KeeperRegistrar2_1", common.FromHex(registrar21.AutomationRegistrarMetaData.Bin)) +func (e EthereumAutomationKeeperConsumer) Address() string { + return e.address.Hex() +} - instance, err := registrar21.NewAutomationRegistrar(address, wrappers.MustNewWrappedContractBackend(nil, client)) +func (e EthereumAutomationKeeperConsumer) Counter(ctx context.Context) (*big.Int, error) { + return e.consumer.Counter(&bind.CallOpts{ + From: e.client.MustGetRootKeyAddress(), + Context: ctx, + }) +} + +func (e EthereumAutomationKeeperConsumer) Start() error { + _, err := e.client.Decode(e.consumer.Start(e.client.NewTXOpts())) + return err +} + +func LoadKeeperConsumer(client *seth.Client, address common.Address) (*EthereumAutomationKeeperConsumer, error) { + loader := seth.NewContractLoader[log_upkeep_counter_wrapper.LogUpkeepCounter](client) + instance, err := loader.LoadContract("KeeperConsumer", address, log_upkeep_counter_wrapper.LogUpkeepCounterMetaData.GetAbi, log_upkeep_counter_wrapper.NewLogUpkeepCounter) if err != nil { - return &EthereumKeeperRegistrar{}, fmt.Errorf("failed to instantiate KeeperRegistrar2_1 instance: %w", err) + return &EthereumAutomationKeeperConsumer{}, fmt.Errorf("failed to load KeeperConsumerMetaData instance: %w", err) } - return &EthereumKeeperRegistrar{ - address: &address, - client: client, - registrar21: instance, + return &EthereumAutomationKeeperConsumer{ + client: client, + consumer: instance, + address: &address, }, nil } @@ -2711,21 +2751,35 @@ func (v *EthereumAutomationConsumerBenchmark) GetUpkeepCount(ctx context.Context }, id) } -// DeployKeeperConsumerBenchmark deploys a keeper consumer benchmark contract with a standard contract backend -func DeployKeeperConsumerBenchmark(client *seth.Client) (AutomationConsumerBenchmark, error) { - return deployKeeperConsumerBenchmarkWithWrapperFn(client, func(client *seth.Client) *wrappers.WrappedContractBackend { +// DeployAutomationConsumerBenchmark deploys a keeper consumer benchmark contract with a standard contract backend +func DeployAutomationConsumerBenchmark(client *seth.Client) (AutomationConsumerBenchmark, error) { + return deployAutomationConsumerBenchmarkWithWrapperFn(client, func(client *seth.Client) *wrappers.WrappedContractBackend { return wrappers.MustNewWrappedContractBackend(nil, client) }) } -// DeployKeeperConsumerBenchmarkWithRetry deploys a keeper consumer benchmark contract with a read-only operations retrying contract backend -func DeployKeeperConsumerBenchmarkWithRetry(client *seth.Client, logger zerolog.Logger, maxAttempts uint, retryDelay time.Duration) (AutomationConsumerBenchmark, error) { - return deployKeeperConsumerBenchmarkWithWrapperFn(client, func(client *seth.Client) *wrappers.WrappedContractBackend { +func LoadAutomationConsumerBenchmark(client *seth.Client, address common.Address) (*EthereumAutomationConsumerBenchmark, error) { + loader := seth.NewContractLoader[automation_consumer_benchmark.AutomationConsumerBenchmark](client) + instance, err := loader.LoadContract("AutomationConsumerBenchmark", address, automation_consumer_benchmark.AutomationConsumerBenchmarkMetaData.GetAbi, automation_consumer_benchmark.NewAutomationConsumerBenchmark) + if err != nil { + return &EthereumAutomationConsumerBenchmark{}, fmt.Errorf("failed to load AutomationConsumerBenchmark instance: %w", err) + } + + return &EthereumAutomationConsumerBenchmark{ + client: client, + consumer: instance, + address: &address, + }, nil +} + +// DeployAutomationConsumerBenchmarkWithRetry deploys a keeper consumer benchmark contract with a read-only operations retrying contract backend +func DeployAutomationConsumerBenchmarkWithRetry(client *seth.Client, logger zerolog.Logger, maxAttempts uint, retryDelay time.Duration) (AutomationConsumerBenchmark, error) { + return deployAutomationConsumerBenchmarkWithWrapperFn(client, func(client *seth.Client) *wrappers.WrappedContractBackend { return wrappers.MustNewRetryingWrappedContractBackend(client, logger, maxAttempts, retryDelay) }) } -func deployKeeperConsumerBenchmarkWithWrapperFn(client *seth.Client, wrapperConstrFn func(client *seth.Client) *wrappers.WrappedContractBackend) (AutomationConsumerBenchmark, error) { +func deployAutomationConsumerBenchmarkWithWrapperFn(client *seth.Client, wrapperConstrFn func(client *seth.Client) *wrappers.WrappedContractBackend) (AutomationConsumerBenchmark, error) { abi, err := automation_consumer_benchmark.AutomationConsumerBenchmarkMetaData.GetAbi() if err != nil { return &EthereumAutomationConsumerBenchmark{}, fmt.Errorf("failed to get AutomationConsumerBenchmark ABI: %w", err) @@ -2747,8 +2801,8 @@ func deployKeeperConsumerBenchmarkWithWrapperFn(client *seth.Client, wrapperCons }, nil } -// KeeperConsumerBenchmarkUpkeepObserver is a header subscription that awaits for a round of upkeeps -type KeeperConsumerBenchmarkUpkeepObserver struct { +// AutomationConsumerBenchmarkUpkeepObserver is a header subscription that awaits for a round of upkeeps +type AutomationConsumerBenchmarkUpkeepObserver struct { instance AutomationConsumerBenchmark registry KeeperRegistry upkeepID *big.Int @@ -2772,9 +2826,9 @@ type KeeperConsumerBenchmarkUpkeepObserver struct { l zerolog.Logger } -// NewKeeperConsumerBenchmarkUpkeepObserver provides a new instance of a NewKeeperConsumerBenchmarkUpkeepObserver +// NewAutomationConsumerBenchmarkUpkeepObserver provides a new instance of a NewAutomationConsumerBenchmarkUpkeepObserver // Used to track and log benchmark test results for keepers -func NewKeeperConsumerBenchmarkUpkeepObserver( +func NewAutomationConsumerBenchmarkUpkeepObserver( contract AutomationConsumerBenchmark, registry KeeperRegistry, upkeepID *big.Int, @@ -2784,8 +2838,8 @@ func NewKeeperConsumerBenchmarkUpkeepObserver( upkeepIndex int64, firstEligibleBuffer int64, logger zerolog.Logger, -) *KeeperConsumerBenchmarkUpkeepObserver { - return &KeeperConsumerBenchmarkUpkeepObserver{ +) *AutomationConsumerBenchmarkUpkeepObserver { + return &AutomationConsumerBenchmarkUpkeepObserver{ instance: contract, registry: registry, upkeepID: upkeepID, @@ -2807,7 +2861,7 @@ func NewKeeperConsumerBenchmarkUpkeepObserver( // ReceiveHeader will query the latest Keeper round and check to see whether upkeep was performed, it returns // true when observation has finished. -func (o *KeeperConsumerBenchmarkUpkeepObserver) ReceiveHeader(receivedHeader *blockchain.SafeEVMHeader) (bool, error) { +func (o *AutomationConsumerBenchmarkUpkeepObserver) ReceiveHeader(receivedHeader *blockchain.SafeEVMHeader) (bool, error) { if receivedHeader.Number.Uint64() <= o.lastBlockNum { // Uncle / reorg we won't count return false, nil } @@ -2910,12 +2964,12 @@ func (o *KeeperConsumerBenchmarkUpkeepObserver) ReceiveHeader(receivedHeader *bl } // Complete returns whether watching for upkeeps has completed -func (o *KeeperConsumerBenchmarkUpkeepObserver) Complete() bool { +func (o *AutomationConsumerBenchmarkUpkeepObserver) Complete() bool { return o.complete } // LogDetails logs the results of the benchmark test to testreporter -func (o *KeeperConsumerBenchmarkUpkeepObserver) LogDetails() { +func (o *AutomationConsumerBenchmarkUpkeepObserver) LogDetails() { report := testreporters.KeeperBenchmarkTestReport{ ContractAddress: o.instance.Address(), TotalEligibleCount: o.countEligible, diff --git a/integration-tests/contracts/ethereum_keeper_contracts.go b/integration-tests/contracts/ethereum_keeper_contracts.go index 34c78b3fc60..90f1af0319b 100644 --- a/integration-tests/contracts/ethereum_keeper_contracts.go +++ b/integration-tests/contracts/ethereum_keeper_contracts.go @@ -150,6 +150,7 @@ type KeeperRegistrySettings struct { MaxPerformGas uint32 // max gas allowed for an upkeep within perform FallbackGasPrice *big.Int // gas price used if the gas price feed is stale FallbackLinkPrice *big.Int // LINK price used if the LINK price feed is stale + FallbackNativePrice *big.Int // Native price used if the Native price feed is stale MaxCheckDataSize uint32 MaxPerformDataSize uint32 MaxRevertDataSize uint32 @@ -173,7 +174,7 @@ func (rcs *KeeperRegistrySettings) Create23OnchainConfig(registrar string, regis ChainModule: chainModuleAddress, ReorgProtectionEnabled: reorgProtectionEnabled, FinanceAdmin: registryOwnerAddress, - FallbackNativePrice: big.NewInt(1), + FallbackNativePrice: rcs.FallbackNativePrice, } } diff --git a/integration-tests/contracts/ethereum_vrf_contracts.go b/integration-tests/contracts/ethereum_vrf_contracts.go index 3a18ae23d0a..144de176ee9 100644 --- a/integration-tests/contracts/ethereum_vrf_contracts.go +++ b/integration-tests/contracts/ethereum_vrf_contracts.go @@ -6,16 +6,20 @@ import ( "math/big" "time" - "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_coordinator_v2_5" - "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_v2plus_load_test_with_metrics" - "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/rs/zerolog/log" - "github.com/smartcontractkit/seth" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/mock_ethlink_aggregator_wrapper" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_coordinator_v2_5" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_v2plus_load_test_with_metrics" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrfv2plus_wrapper" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrfv2plus_wrapper_load_test_consumer" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrfv2plus_wrapper_optimism" + + "github.com/smartcontractkit/chainlink-testing-framework/seth" - "github.com/smartcontractkit/chainlink-testing-framework/blockchain" + "github.com/smartcontractkit/chainlink-testing-framework/lib/blockchain" "github.com/smartcontractkit/chainlink/integration-tests/wrappers" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/batch_blockhash_store" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/blockhash_store" @@ -350,6 +354,26 @@ func DeployVRFMockETHLINKFeed(seth *seth.Client, answer *big.Int) (VRFMockETHLIN }, err } +func LoadVRFMockETHLINKFeed(client *seth.Client, address common.Address) (VRFMockETHLINKFeed, error) { + abi, err := mock_ethlink_aggregator_wrapper.MockETHLINKAggregatorMetaData.GetAbi() + if err != nil { + return &EthereumVRFMockETHLINKFeed{}, fmt.Errorf("failed to get VRFMockETHLINKAggregator ABI: %w", err) + } + client.ContractStore.AddABI("VRFMockETHLINKAggregator", *abi) + client.ContractStore.AddBIN("VRFMockETHLINKAggregator", common.FromHex(mock_ethlink_aggregator_wrapper.MockETHLINKAggregatorMetaData.Bin)) + + instance, err := vrf_mock_ethlink_aggregator.NewVRFMockETHLINKAggregator(address, wrappers.MustNewWrappedContractBackend(nil, client)) + if err != nil { + return &EthereumVRFMockETHLINKFeed{}, fmt.Errorf("failed to instantiate VRFMockETHLINKAggregator instance: %w", err) + } + + return &EthereumVRFMockETHLINKFeed{ + address: address, + client: client, + feed: instance, + }, nil +} + func (v *EthereumBlockhashStore) Address() string { return v.address.Hex() } @@ -506,3 +530,60 @@ func LoadVRFv2PlusLoadTestConsumer(seth *seth.Client, addr string) (VRFv2PlusLoa consumer: contract, }, nil } + +func LoadVRFV2PlusWrapper(seth *seth.Client, addr string) (VRFV2PlusWrapper, error) { + address := common.HexToAddress(addr) + abi, err := vrfv2plus_wrapper.VRFV2PlusWrapperMetaData.GetAbi() + if err != nil { + return nil, fmt.Errorf("failed to get VRFV2PlusWrapper ABI: %w", err) + } + seth.ContractStore.AddABI("VRFV2PlusWrapper", *abi) + seth.ContractStore.AddBIN("VRFV2PlusWrapper", common.FromHex(vrfv2plus_wrapper.VRFV2PlusWrapperMetaData.Bin)) + contract, err := vrfv2plus_wrapper.NewVRFV2PlusWrapper(address, wrappers.MustNewWrappedContractBackend(nil, seth)) + if err != nil { + return nil, fmt.Errorf("failed to instantiate VRFV2PlusWrapper instance: %w", err) + } + return &EthereumVRFV2PlusWrapper{ + client: seth, + address: address, + wrapper: contract, + }, nil +} + +func LoadVRFV2PlusWrapperOptimism(seth *seth.Client, addr string) (*EthereumVRFV2PlusWrapperOptimism, error) { + address := common.HexToAddress(addr) + abi, err := vrfv2plus_wrapper_optimism.VRFV2PlusWrapperOptimismMetaData.GetAbi() + if err != nil { + return nil, fmt.Errorf("failed to get VRFV2PlusWrapper_Optimism ABI: %w", err) + } + seth.ContractStore.AddABI("VRFV2PlusWrapper_Optimism", *abi) + seth.ContractStore.AddBIN("VRFV2PlusWrapper_Optimism", common.FromHex(vrfv2plus_wrapper_optimism.VRFV2PlusWrapperOptimismMetaData.Bin)) + contract, err := vrfv2plus_wrapper_optimism.NewVRFV2PlusWrapperOptimism(address, wrappers.MustNewWrappedContractBackend(nil, seth)) + if err != nil { + return nil, fmt.Errorf("failed to instantiate VRFV2PlusWrapper_Optimism instance: %w", err) + } + return &EthereumVRFV2PlusWrapperOptimism{ + client: seth, + Address: address, + wrapper: contract, + }, nil +} + +func LoadVRFV2WrapperLoadTestConsumer(seth *seth.Client, addr string) (*EthereumVRFV2PlusWrapperLoadTestConsumer, error) { + address := common.HexToAddress(addr) + abi, err := vrfv2plus_wrapper_load_test_consumer.VRFV2PlusWrapperLoadTestConsumerMetaData.GetAbi() + if err != nil { + return nil, fmt.Errorf("failed to get VRFV2PlusWrapperLoadTestConsumer ABI: %w", err) + } + seth.ContractStore.AddABI("VRFV2PlusWrapperLoadTestConsumer", *abi) + seth.ContractStore.AddBIN("VRFV2PlusWrapperLoadTestConsumer", common.FromHex(vrfv2plus_wrapper_load_test_consumer.VRFV2PlusWrapperLoadTestConsumerMetaData.Bin)) + contract, err := vrfv2plus_wrapper_load_test_consumer.NewVRFV2PlusWrapperLoadTestConsumer(address, wrappers.MustNewWrappedContractBackend(nil, seth)) + if err != nil { + return nil, fmt.Errorf("failed to instantiate VRFV2PlusWrapperLoadTestConsumer instance: %w", err) + } + return &EthereumVRFV2PlusWrapperLoadTestConsumer{ + client: seth, + address: address, + consumer: contract, + }, nil +} diff --git a/integration-tests/contracts/ethereum_vrfv2_contracts.go b/integration-tests/contracts/ethereum_vrfv2_contracts.go index a9d1a93769d..708fdb211eb 100644 --- a/integration-tests/contracts/ethereum_vrfv2_contracts.go +++ b/integration-tests/contracts/ethereum_vrfv2_contracts.go @@ -13,7 +13,7 @@ import ( "github.com/ethereum/go-ethereum/core/types" "github.com/rs/zerolog/log" - "github.com/smartcontractkit/seth" + "github.com/smartcontractkit/chainlink-testing-framework/seth" "github.com/smartcontractkit/chainlink/integration-tests/wrappers" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated" @@ -594,6 +594,30 @@ func (v *EthereumVRFCoordinatorV2) ParseLog(log types.Log) (generated.AbigenLog, return v.coordinator.ParseLog(log) } +func (v *EthereumVRFCoordinatorV2) GetLinkAddress(ctx context.Context) (common.Address, error) { + opts := &bind.CallOpts{ + From: v.client.MustGetRootKeyAddress(), + Context: ctx, + } + address, err := v.coordinator.LINK(opts) + if err != nil { + return common.Address{}, err + } + return address, nil +} + +func (v *EthereumVRFCoordinatorV2) GetLinkNativeFeed(ctx context.Context) (common.Address, error) { + opts := &bind.CallOpts{ + From: v.client.MustGetRootKeyAddress(), + Context: ctx, + } + address, err := v.coordinator.LINKETHFEED(opts) + if err != nil { + return common.Address{}, err + } + return address, nil +} + // CancelSubscription cancels subscription by Sub owner, // return funds to specified address, // checks if pending requests for a sub exist diff --git a/integration-tests/contracts/ethereum_vrfv2plus_contracts.go b/integration-tests/contracts/ethereum_vrfv2plus_contracts.go index ea0ee18e937..35d22e8ef5b 100644 --- a/integration-tests/contracts/ethereum_vrfv2plus_contracts.go +++ b/integration-tests/contracts/ethereum_vrfv2plus_contracts.go @@ -11,16 +11,21 @@ import ( "github.com/ethereum/go-ethereum/core/types" "github.com/montanaflynn/stats" - "github.com/smartcontractkit/seth" + "github.com/smartcontractkit/chainlink-testing-framework/seth" "github.com/smartcontractkit/chainlink/integration-tests/wrappers" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/batch_blockhash_store" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/batch_vrf_coordinator_v2plus" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_coordinator_test_v2_5" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_coordinator_v2_5" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_coordinator_v2_5_arbitrum" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_coordinator_v2_5_optimism" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_v2plus_load_test_with_metrics" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_v2plus_upgraded_version" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrfv2plus_wrapper" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrfv2plus_wrapper_arbitrum" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrfv2plus_wrapper_load_test_consumer" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrfv2plus_wrapper_optimism" ) type EthereumVRFCoordinatorV2_5 struct { @@ -29,6 +34,24 @@ type EthereumVRFCoordinatorV2_5 struct { coordinator vrf_coordinator_v2_5.VRFCoordinatorV25Interface } +type EthereumVRFCoordinatorV2_5_Optimism struct { + Address common.Address + client *seth.Client + coordinator vrf_coordinator_v2_5_optimism.VRFCoordinatorV25Optimism +} + +type EthereumVRFCoordinatorV2_5_Arbitrum struct { + Address common.Address + client *seth.Client + coordinator vrf_coordinator_v2_5_arbitrum.VRFCoordinatorV25Arbitrum +} + +type EthereumVRFCoordinatorTestV2_5 struct { + Address common.Address + client *seth.Client + coordinator vrf_coordinator_test_v2_5.VRFCoordinatorTestV25 +} + type EthereumBatchVRFCoordinatorV2Plus struct { address common.Address client *seth.Client @@ -60,6 +83,18 @@ type EthereumVRFV2PlusWrapper struct { wrapper *vrfv2plus_wrapper.VRFV2PlusWrapper } +type EthereumVRFV2PlusWrapperOptimism struct { + Address common.Address + client *seth.Client + wrapper *vrfv2plus_wrapper_optimism.VRFV2PlusWrapperOptimism +} + +type EthereumVRFV2PlusWrapperArbitrum struct { + Address common.Address + client *seth.Client + wrapper *vrfv2plus_wrapper_arbitrum.VRFV2PlusWrapperArbitrum +} + func (v *EthereumVRFV2PlusWrapper) Address() string { return v.address.Hex() } @@ -114,22 +149,22 @@ func (v *EthereumVRFV2PlusWrapper) Coordinator(ctx context.Context) (common.Addr func DeployVRFCoordinatorV2_5(seth *seth.Client, bhsAddr string) (VRFCoordinatorV2_5, error) { abi, err := vrf_coordinator_v2_5.VRFCoordinatorV25MetaData.GetAbi() if err != nil { - return &EthereumVRFCoordinatorV2_5{}, fmt.Errorf("failed to get VRFCoordinatorV2Plus ABI: %w", err) + return &EthereumVRFCoordinatorV2_5{}, fmt.Errorf("failed to get VRFCoordinatorV2_5 ABI: %w", err) } coordinatorDeploymentData, err := seth.DeployContract( seth.NewTXOpts(), - "VRFCoordinatorV2Plus", + "VRFCoordinatorV2_5", *abi, common.FromHex(vrf_coordinator_v2_5.VRFCoordinatorV25MetaData.Bin), common.HexToAddress(bhsAddr)) if err != nil { - return &EthereumVRFCoordinatorV2_5{}, fmt.Errorf("VRFCoordinatorV2Plus instance deployment have failed: %w", err) + return &EthereumVRFCoordinatorV2_5{}, fmt.Errorf("VRFCoordinatorV2_5 instance deployment have failed: %w", err) } contract, err := vrf_coordinator_v2_5.NewVRFCoordinatorV25(coordinatorDeploymentData.Address, wrappers.MustNewWrappedContractBackend(nil, seth)) if err != nil { - return &EthereumVRFCoordinatorV2_5{}, fmt.Errorf("failed to instantiate VRFCoordinatorV2Plus instance: %w", err) + return &EthereumVRFCoordinatorV2_5{}, fmt.Errorf("failed to instantiate VRFCoordinatorV2_5 instance: %w", err) } return &EthereumVRFCoordinatorV2_5{ @@ -139,6 +174,81 @@ func DeployVRFCoordinatorV2_5(seth *seth.Client, bhsAddr string) (VRFCoordinator }, err } +func DeployVRFCoordinatorV2_5_Optimism(seth *seth.Client, bhsAddr string) (*EthereumVRFCoordinatorV2_5_Optimism, error) { + abi, err := vrf_coordinator_v2_5_optimism.VRFCoordinatorV25OptimismMetaData.GetAbi() + if err != nil { + return nil, fmt.Errorf("failed to get VRFCoordinatorV2_5_Optimism ABI: %w", err) + } + coordinatorDeploymentData, err := seth.DeployContract( + seth.NewTXOpts(), + "VRFCoordinatorV2_5_Optimism", + *abi, + common.FromHex(vrf_coordinator_v2_5_optimism.VRFCoordinatorV25OptimismMetaData.Bin), + common.HexToAddress(bhsAddr)) + if err != nil { + return nil, fmt.Errorf("VRFCoordinatorV2_5_Optimism instance deployment have failed: %w", err) + } + contract, err := vrf_coordinator_v2_5_optimism.NewVRFCoordinatorV25Optimism(coordinatorDeploymentData.Address, wrappers.MustNewWrappedContractBackend(nil, seth)) + if err != nil { + return nil, fmt.Errorf("failed to instantiate VRFCoordinatorV2_5_Optimism instance: %w", err) + } + return &EthereumVRFCoordinatorV2_5_Optimism{ + client: seth, + coordinator: *contract, + Address: coordinatorDeploymentData.Address, + }, err +} + +func DeployVRFCoordinatorV2_5_Arbitrum(seth *seth.Client, bhsAddr string) (*EthereumVRFCoordinatorV2_5_Arbitrum, error) { + abi, err := vrf_coordinator_v2_5_arbitrum.VRFCoordinatorV25ArbitrumMetaData.GetAbi() + if err != nil { + return nil, fmt.Errorf("failed to get VRFCoordinatorV2_5_Arbitrum ABI: %w", err) + } + coordinatorDeploymentData, err := seth.DeployContract( + seth.NewTXOpts(), + "VRFCoordinatorV2_5_Arbitrum", + *abi, + common.FromHex(vrf_coordinator_v2_5_arbitrum.VRFCoordinatorV25ArbitrumMetaData.Bin), + common.HexToAddress(bhsAddr)) + if err != nil { + return nil, fmt.Errorf("VRFCoordinatorV2_5_Arbitrum instance deployment have failed: %w", err) + } + contract, err := vrf_coordinator_v2_5_arbitrum.NewVRFCoordinatorV25Arbitrum(coordinatorDeploymentData.Address, wrappers.MustNewWrappedContractBackend(nil, seth)) + if err != nil { + return nil, fmt.Errorf("failed to instantiate VRFCoordinatorV2_5_Arbitrum instance: %w", err) + } + return &EthereumVRFCoordinatorV2_5_Arbitrum{ + client: seth, + coordinator: *contract, + Address: coordinatorDeploymentData.Address, + }, err +} + +func DeployVRFCoordinatorTestV2_5(seth *seth.Client, bhsAddr string) (*EthereumVRFCoordinatorTestV2_5, error) { + abi, err := vrf_coordinator_test_v2_5.VRFCoordinatorTestV25MetaData.GetAbi() + if err != nil { + return nil, fmt.Errorf("failed to get VRFCoordinatorTestV2_5 ABI: %w", err) + } + coordinatorDeploymentData, err := seth.DeployContract( + seth.NewTXOpts(), + "VRFCoordinatorTestV2_5", + *abi, + common.FromHex(vrf_coordinator_test_v2_5.VRFCoordinatorTestV25MetaData.Bin), + common.HexToAddress(bhsAddr)) + if err != nil { + return nil, fmt.Errorf("VRFCoordinatorTestV2_5 instance deployment have failed: %w", err) + } + contract, err := vrf_coordinator_test_v2_5.NewVRFCoordinatorTestV25(coordinatorDeploymentData.Address, wrappers.MustNewWrappedContractBackend(nil, seth)) + if err != nil { + return nil, fmt.Errorf("failed to instantiate VRFCoordinatorTestV2_5 instance: %w", err) + } + return &EthereumVRFCoordinatorTestV2_5{ + client: seth, + coordinator: *contract, + Address: coordinatorDeploymentData.Address, + }, err +} + func DeployBatchVRFCoordinatorV2Plus(seth *seth.Client, coordinatorAddress string) (BatchVRFCoordinatorV2Plus, error) { abi, err := batch_vrf_coordinator_v2plus.BatchVRFCoordinatorV2PlusMetaData.GetAbi() if err != nil { @@ -147,7 +257,7 @@ func DeployBatchVRFCoordinatorV2Plus(seth *seth.Client, coordinatorAddress strin coordinatorDeploymentData, err := seth.DeployContract( seth.NewTXOpts(), - "VRFCoordinatorV2Plus", + "BatchVRFCoordinatorV2Plus", *abi, common.FromHex(batch_vrf_coordinator_v2plus.BatchVRFCoordinatorV2PlusMetaData.Bin), common.HexToAddress(coordinatorAddress)) @@ -301,6 +411,42 @@ func (v *EthereumVRFCoordinatorV2_5) GetBlockHashStoreAddress(ctx context.Contex return blockHashStoreAddress, nil } +func (v *EthereumVRFCoordinatorV2_5) GetLinkAddress(ctx context.Context) (common.Address, error) { + opts := &bind.CallOpts{ + From: v.client.MustGetRootKeyAddress(), + Context: ctx, + } + address, err := v.coordinator.LINK(opts) + if err != nil { + return common.Address{}, err + } + return address, nil +} + +func (v *EthereumVRFCoordinatorV2_5) GetLinkNativeFeed(ctx context.Context) (common.Address, error) { + opts := &bind.CallOpts{ + From: v.client.MustGetRootKeyAddress(), + Context: ctx, + } + address, err := v.coordinator.LINKNATIVEFEED(opts) + if err != nil { + return common.Address{}, err + } + return address, nil +} + +func (v *EthereumVRFCoordinatorV2_5) GetConfig(ctx context.Context) (vrf_coordinator_v2_5.SConfig, error) { + opts := &bind.CallOpts{ + From: v.client.MustGetRootKeyAddress(), + Context: ctx, + } + config, err := v.coordinator.SConfig(opts) + if err != nil { + return vrf_coordinator_v2_5.SConfig{}, err + } + return config, nil +} + // OwnerCancelSubscription cancels subscription by Coordinator owner // return funds to sub owner, // does not check if pending requests for a sub exist @@ -563,6 +709,14 @@ func (v *EthereumVRFCoordinatorV2_5) WaitForConfigSetEvent(timeout time.Duration } } +func (v *EthereumVRFCoordinatorV2_5_Optimism) SetL1FeeCalculation( + mode uint8, + coefficient uint8, +) error { + _, err := v.client.Decode(v.coordinator.SetL1FeeCalculation(v.client.NewTXOpts(), mode, coefficient)) + return err +} + func (v *EthereumVRFv2PlusLoadTestConsumer) Address() string { return v.address.Hex() } @@ -1093,7 +1247,6 @@ func DeployVRFV2PlusWrapper(seth *seth.Client, linkAddr string, linkEthFeedAddr if err != nil { return &EthereumVRFV2PlusWrapper{}, fmt.Errorf("failed to get VRFV2PlusWrapper ABI: %w", err) } - data, err := seth.DeployContract( seth.NewTXOpts(), "VRFV2PlusWrapper", @@ -1104,12 +1257,10 @@ func DeployVRFV2PlusWrapper(seth *seth.Client, linkAddr string, linkEthFeedAddr if err != nil { return &EthereumVRFV2PlusWrapper{}, fmt.Errorf("VRFV2PlusWrapper instance deployment have failed: %w", err) } - contract, err := vrfv2plus_wrapper.NewVRFV2PlusWrapper(data.Address, wrappers.MustNewWrappedContractBackend(nil, seth)) if err != nil { return &EthereumVRFV2PlusWrapper{}, fmt.Errorf("failed to instantiate VRFV2PlusWrapper instance: %w", err) } - return &EthereumVRFV2PlusWrapper{ client: seth, wrapper: contract, @@ -1117,12 +1268,63 @@ func DeployVRFV2PlusWrapper(seth *seth.Client, linkAddr string, linkEthFeedAddr }, err } +func DeployVRFV2PlusWrapperArbitrum(seth *seth.Client, linkAddr string, linkEthFeedAddr string, coordinatorAddr string, subId *big.Int) (*EthereumVRFV2PlusWrapperArbitrum, error) { + abi, err := vrfv2plus_wrapper_arbitrum.VRFV2PlusWrapperArbitrumMetaData.GetAbi() + if err != nil { + return nil, fmt.Errorf("failed to get VRFV2PlusWrapper_Arbitrum ABI: %w", err) + } + data, err := seth.DeployContract( + seth.NewTXOpts(), + "VRFV2PlusWrapper_Arbitrum", + *abi, + common.FromHex(vrfv2plus_wrapper_arbitrum.VRFV2PlusWrapperArbitrumMetaData.Bin), + common.HexToAddress(linkAddr), common.HexToAddress(linkEthFeedAddr), + common.HexToAddress(coordinatorAddr), subId) + if err != nil { + return nil, fmt.Errorf("VRFV2PlusWrapper_Arbitrum instance deployment have failed: %w", err) + } + contract, err := vrfv2plus_wrapper_arbitrum.NewVRFV2PlusWrapperArbitrum(data.Address, wrappers.MustNewWrappedContractBackend(nil, seth)) + if err != nil { + return nil, fmt.Errorf("failed to instantiate VRFV2PlusWrapper_Arbitrum instance: %w", err) + } + return &EthereumVRFV2PlusWrapperArbitrum{ + client: seth, + wrapper: contract, + Address: data.Address, + }, err +} + +func DeployVRFV2PlusWrapperOptimism(seth *seth.Client, linkAddr string, linkEthFeedAddr string, coordinatorAddr string, subId *big.Int) (*EthereumVRFV2PlusWrapperOptimism, error) { + abi, err := vrfv2plus_wrapper_optimism.VRFV2PlusWrapperOptimismMetaData.GetAbi() + if err != nil { + return nil, fmt.Errorf("failed to get VRFV2PlusWrapper_Optimism ABI: %w", err) + } + data, err := seth.DeployContract( + seth.NewTXOpts(), + "VRFV2PlusWrapper_Optimism", + *abi, + common.FromHex(vrfv2plus_wrapper_optimism.VRFV2PlusWrapperOptimismMetaData.Bin), + common.HexToAddress(linkAddr), common.HexToAddress(linkEthFeedAddr), + common.HexToAddress(coordinatorAddr), subId) + if err != nil { + return nil, fmt.Errorf("VRFV2PlusWrapper_Optimism instance deployment have failed: %w", err) + } + contract, err := vrfv2plus_wrapper_optimism.NewVRFV2PlusWrapperOptimism(data.Address, wrappers.MustNewWrappedContractBackend(nil, seth)) + if err != nil { + return nil, fmt.Errorf("failed to instantiate VRFV2PlusWrapper_Optimism instance: %w", err) + } + return &EthereumVRFV2PlusWrapperOptimism{ + client: seth, + wrapper: contract, + Address: data.Address, + }, err +} + func DeployVRFV2PlusWrapperLoadTestConsumer(seth *seth.Client, vrfV2PlusWrapperAddr string) (VRFv2PlusWrapperLoadTestConsumer, error) { abi, err := vrfv2plus_wrapper_load_test_consumer.VRFV2PlusWrapperLoadTestConsumerMetaData.GetAbi() if err != nil { return &EthereumVRFV2PlusWrapperLoadTestConsumer{}, fmt.Errorf("failed to get VRFV2PlusWrapperLoadTestConsumer ABI: %w", err) } - data, err := seth.DeployContract( seth.NewTXOpts(), "VRFV2PlusWrapperLoadTestConsumer", @@ -1137,7 +1339,6 @@ func DeployVRFV2PlusWrapperLoadTestConsumer(seth *seth.Client, vrfV2PlusWrapperA if err != nil { return &EthereumVRFV2PlusWrapperLoadTestConsumer{}, fmt.Errorf("failed to instantiate VRFV2PlusWrapperLoadTestConsumer instance: %w", err) } - return &EthereumVRFV2PlusWrapperLoadTestConsumer{ client: seth, consumer: contract, @@ -1145,6 +1346,11 @@ func DeployVRFV2PlusWrapperLoadTestConsumer(seth *seth.Client, vrfV2PlusWrapperA }, err } +func (v *EthereumVRFV2PlusWrapperOptimism) SetL1FeeCalculation(mode uint8, coefficient uint8) error { + _, err := v.client.Decode(v.wrapper.SetL1FeeCalculation(v.client.NewTXOpts(), mode, coefficient)) + return err +} + func (v *EthereumVRFV2PlusWrapperLoadTestConsumer) Address() string { return v.address.Hex() } diff --git a/integration-tests/contracts/multicall.go b/integration-tests/contracts/multicall.go index 6b73aed084c..cd7134a8d85 100644 --- a/integration-tests/contracts/multicall.go +++ b/integration-tests/contracts/multicall.go @@ -8,7 +8,8 @@ import ( "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" - "github.com/smartcontractkit/seth" + + "github.com/smartcontractkit/chainlink-testing-framework/seth" "github.com/smartcontractkit/chainlink/integration-tests/wrappers" ) diff --git a/integration-tests/contracts/test_contracts.go b/integration-tests/contracts/test_contracts.go index 85e76054c71..f8674e2136d 100644 --- a/integration-tests/contracts/test_contracts.go +++ b/integration-tests/contracts/test_contracts.go @@ -7,7 +7,8 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/rs/zerolog" - "github.com/smartcontractkit/seth" + + "github.com/smartcontractkit/chainlink-testing-framework/seth" "github.com/smartcontractkit/chainlink/integration-tests/wrappers" le "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/log_emitter" diff --git a/integration-tests/crib/README.md b/integration-tests/crib/README.md new file mode 100644 index 00000000000..c37cbfec9c9 --- /dev/null +++ b/integration-tests/crib/README.md @@ -0,0 +1,26 @@ +### Example e2e product test using CRIB + +## Setup CRIB +This is a simple smoke + chaos test for CRIB deployment. +It runs OCRv1 and reboots the environment confirming integration with environment is working and data is properly saved even after reboots. +Go to the [CRIB](https://github.com/smartcontractkit/crib) repository and spin up a cluster. + +```shell +./scripts/cribbit.sh crib-oh-my-crib +devspace deploy --debug --profile local-dev-simulated-core-ocr1 +``` + +## Run the tests +```shell +export CRIB_NAMESPACE=crib-oh-my-crib +export CRIB_NETWORK=geth # only "geth" is supported for now +export CRIB_NODES=5 # min 5 nodes +#export SETH_LOG_LEVEL=debug # these two can be enabled to debug connection issues +#export RESTY_DEBUG=true +#export TEST_PERSISTENCE=true # to run the chaos test +export GAP_URL=https://localhost:8080/primary # only applicable in CI, unset the var to connect locally +go test -v -run TestCRIBChaos +``` + +## Configuring CI workflow +We are using GAP and GATI to access the infrastructure, please follow [configuration guide](https://smartcontract-it.atlassian.net/wiki/spaces/CRIB/pages/909967436/CRIB+CI+Integration) \ No newline at end of file diff --git a/integration-tests/crib/chaos.go b/integration-tests/crib/chaos.go new file mode 100644 index 00000000000..463ced483fa --- /dev/null +++ b/integration-tests/crib/chaos.go @@ -0,0 +1,46 @@ +package crib + +import ( + "time" + + "github.com/chaos-mesh/chaos-mesh/api/v1alpha1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/smartcontractkit/chainlink-testing-framework/havoc" +) + +func rebootCLNamespace(delay time.Duration, namespace string) (*havoc.Chaos, error) { + k8sClient, err := havoc.NewChaosMeshClient() + if err != nil { + return nil, err + } + return havoc.NewChaos(havoc.ChaosOpts{ + Description: "Reboot CRIB", + DelayCreate: delay, + Object: &v1alpha1.PodChaos{ + TypeMeta: metav1.TypeMeta{ + Kind: "PodChaos", + APIVersion: "chaos-mesh.org/v1alpha1", + }, + ObjectMeta: metav1.ObjectMeta{ + Name: "reboot-crib", + Namespace: namespace, + }, + Spec: v1alpha1.PodChaosSpec{ + ContainerSelector: v1alpha1.ContainerSelector{ + PodSelector: v1alpha1.PodSelector{ + Mode: v1alpha1.AllMode, + Selector: v1alpha1.PodSelectorSpec{ + GenericSelectorSpec: v1alpha1.GenericSelectorSpec{ + Namespaces: []string{namespace}, + }, + }, + }, + }, + Action: v1alpha1.PodKillAction, + }, + }, + Client: k8sClient, + Logger: &havoc.Logger, + }) +} diff --git a/integration-tests/crib/connect.go b/integration-tests/crib/connect.go index 446c53d8f38..acc16b74f99 100644 --- a/integration-tests/crib/connect.go +++ b/integration-tests/crib/connect.go @@ -1,33 +1,25 @@ package crib import ( - "fmt" - "os" + "net/http" "time" + "github.com/smartcontractkit/chainlink-testing-framework/lib/crib" + "github.com/pkg/errors" - "github.com/smartcontractkit/seth" - "github.com/smartcontractkit/chainlink-testing-framework/utils/ptr" - seth_utils "github.com/smartcontractkit/chainlink-testing-framework/utils/seth" + "github.com/smartcontractkit/chainlink-testing-framework/seth" + + "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/ptr" + seth_utils "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/seth" tc "github.com/smartcontractkit/chainlink/integration-tests/testconfig" - "github.com/smartcontractkit/chainlink-testing-framework/blockchain" - msClient "github.com/smartcontractkit/chainlink-testing-framework/client" + "github.com/smartcontractkit/chainlink-testing-framework/lib/blockchain" + msClient "github.com/smartcontractkit/chainlink-testing-framework/lib/client" "github.com/smartcontractkit/chainlink/integration-tests/client" ) -const ( - // these are constants for simulated CRIB that should never change - // CRIB: https://github.com/smartcontractkit/crib/tree/main/core - // Core Chart: https://github.com/smartcontractkit/infra-charts/tree/main/chainlink-cluster - mockserverCRIBTemplate = "https://%s-mockserver%s" - internalNodeDNSTemplate = "app-node%d" - ingressNetworkWSURLTemplate = "wss://%s-geth-1337-ws%s" - ingressNetworkHTTPURLTemplate = "https://%s-geth-1337-http%s" -) - -func setSethConfig(cfg tc.TestConfig, netWSURL string, netHTTPURL string) { +func setSethConfig(cfg tc.TestConfig, netWSURL string, netHTTPURL string, headers http.Header) { netName := "CRIB_SIMULATED" cfg.Network.SelectedNetworks = []string{netName} cfg.Network.RpcHttpUrls = map[string][]string{} @@ -35,86 +27,87 @@ func setSethConfig(cfg tc.TestConfig, netWSURL string, netHTTPURL string) { cfg.Network.RpcWsUrls = map[string][]string{} cfg.Network.RpcWsUrls[netName] = []string{netWSURL} cfg.Seth.EphemeralAddrs = ptr.Ptr(int64(0)) + cfg.Seth.RPCHeaders = headers } // ConnectRemote connects to a local environment, see https://github.com/smartcontractkit/crib/tree/main/core // connects to default CRIB network if simulated = true -func ConnectRemote(simulated bool) ( +func ConnectRemote() ( *seth.Client, *msClient.MockserverClient, *client.ChainlinkK8sClient, []*client.ChainlinkK8sClient, + *crib.CoreDONConnectionConfig, error, ) { - ingressSuffix := os.Getenv("K8S_STAGING_INGRESS_SUFFIX") - if ingressSuffix == "" { - return nil, nil, nil, nil, errors.New("K8S_STAGING_INGRESS_SUFFIX must be set to connect to k8s ingresses") + vars, err := crib.CoreDONSimulatedConnection() + if err != nil { + return nil, nil, nil, nil, nil, err } + // TODO: move all the parts of ConnectRemote() to CTF when Seth config refactor is finalized config, err := tc.GetConfig([]string{"CRIB"}, tc.OCR) if err != nil { - return nil, nil, nil, nil, err - } - if config.CRIB.CLNodesNum < 2 { - return nil, nil, nil, nil, fmt.Errorf("not enough chainlink nodes, need at least 2, TOML key: [CRIB.nodes]") + return nil, nil, nil, nil, nil, err } - cfg := config.CRIB - mockserverURL := fmt.Sprintf(mockserverCRIBTemplate, cfg.Namespace, ingressSuffix) var sethClient *seth.Client - if simulated { - netWSURL := fmt.Sprintf(ingressNetworkWSURLTemplate, cfg.Namespace, ingressSuffix) - netHTTPURL := fmt.Sprintf(ingressNetworkHTTPURLTemplate, cfg.Namespace, ingressSuffix) - setSethConfig(config, netWSURL, netHTTPURL) + switch vars.Network { + case "geth": + setSethConfig(config, vars.NetworkWSURL, vars.NetworkHTTPURL, vars.BlockchainNodeHeaders) net := blockchain.EVMNetwork{ - Name: cfg.NetworkName, - Simulated: true, - SupportsEIP1559: true, - ClientImplementation: blockchain.EthereumClientImplementation, - ChainID: 1337, - PrivateKeys: []string{ - "ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80", - }, - URLs: []string{netWSURL}, - HTTPURLs: []string{netHTTPURL}, + Name: vars.Network, + Simulated: true, + SupportsEIP1559: true, + ClientImplementation: blockchain.EthereumClientImplementation, + ChainID: vars.ChainID, + PrivateKeys: vars.PrivateKeys, + URLs: []string{vars.NetworkWSURL}, + HTTPURLs: []string{vars.NetworkHTTPURL}, ChainlinkTransactionLimit: 500000, Timeout: blockchain.StrDuration{Duration: 2 * time.Minute}, MinimumConfirmations: 1, GasEstimationBuffer: 10000, + Headers: vars.BlockchainNodeHeaders, } sethClient, err = seth_utils.GetChainClient(config, net) if err != nil { - return nil, nil, nil, nil, err + return nil, nil, nil, nil, nil, err } + default: + return nil, nil, nil, nil, nil, errors.New("CRIB network is not supported") } // bootstrap node clClients := make([]*client.ChainlinkK8sClient, 0) c, err := client.NewChainlinkK8sClient(&client.ChainlinkConfig{ - URL: fmt.Sprintf("https://%s-node%d%s", cfg.Namespace, 1, ingressSuffix), Email: client.CLNodeTestEmail, - InternalIP: fmt.Sprintf(internalNodeDNSTemplate, 1), Password: client.CLNodeTestPassword, - }, fmt.Sprintf(internalNodeDNSTemplate, 1), cfg.Namespace) + URL: vars.NodeURLs[0], + InternalIP: vars.NodeInternalDNS[0], + Headers: vars.NodeHeaders[0], + }, vars.NodeInternalDNS[0], vars.Namespace) if err != nil { - return nil, nil, nil, nil, err + return nil, nil, nil, nil, nil, err } clClients = append(clClients, c) // all the other nodes, indices of nodes in CRIB starts with 1 - for i := 2; i <= cfg.CLNodesNum; i++ { + for i := 1; i < vars.Nodes; i++ { cl, err := client.NewChainlinkK8sClient(&client.ChainlinkConfig{ - URL: fmt.Sprintf("https://%s-node%d%s", cfg.Namespace, i, ingressSuffix), Email: client.CLNodeTestEmail, - InternalIP: fmt.Sprintf(internalNodeDNSTemplate, i), Password: client.CLNodeTestPassword, - }, fmt.Sprintf(internalNodeDNSTemplate, i), cfg.Namespace) + URL: vars.NodeURLs[i], + InternalIP: vars.NodeInternalDNS[i], + Headers: vars.NodeHeaders[i], + }, vars.NodeInternalDNS[i], vars.Namespace) if err != nil { - return nil, nil, nil, nil, err + return nil, nil, nil, nil, nil, err } clClients = append(clClients, cl) } mockServerClient := msClient.NewMockserverClient(&msClient.MockserverConfig{ - LocalURL: mockserverURL, - ClusterURL: mockserverURL, + LocalURL: vars.MockserverURL, + ClusterURL: "http://mockserver:1080", + Headers: vars.MockserverHeaders, }) //nolint:gosec // G602 - false positive https://github.com/securego/gosec/issues/1005 - return sethClient, mockServerClient, clClients[0], clClients[1:], nil + return sethClient, mockServerClient, clClients[0], clClients[1:], vars, nil } diff --git a/integration-tests/crib/ocr_test.go b/integration-tests/crib/ocr_test.go new file mode 100644 index 00000000000..215734c318e --- /dev/null +++ b/integration-tests/crib/ocr_test.go @@ -0,0 +1,98 @@ +package crib + +import ( + "context" + "os" + "testing" + "time" + + "github.com/smartcontractkit/chainlink-testing-framework/havoc" + "github.com/smartcontractkit/chainlink-testing-framework/lib/client" + "github.com/smartcontractkit/chainlink-testing-framework/lib/logging" + "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/ptr" + + "github.com/stretchr/testify/require" + + "github.com/smartcontractkit/chainlink/integration-tests/actions" + "github.com/smartcontractkit/chainlink/integration-tests/contracts" + + tc "github.com/smartcontractkit/chainlink/integration-tests/testconfig" + ocr_config "github.com/smartcontractkit/chainlink/integration-tests/testconfig/ocr" +) + +// TestCRIBChaos an example of how we can run chaos tests with havoc and core CRIB +func TestCRIBChaos(t *testing.T) { + l := logging.GetTestLogger(t) + config, err := tc.GetConfig([]string{"Crib"}, tc.OCR) + require.NoError(t, err) + + sethClient, msClient, bootstrapNode, workerNodes, _, err := ConnectRemote() + require.NoError(t, err) + + lta, err := actions.SetupOCRv1Cluster(l, sethClient, config.OCR, workerNodes) + require.NoError(t, err) + ocrInstances, err := actions.SetupOCRv1Feed(l, sethClient, lta, config.OCR, msClient, bootstrapNode, workerNodes) + require.NoError(t, err) + + err = actions.SetAllAdapterResponsesToTheSameValue(10, ocrInstances, workerNodes, msClient) + require.NoError(t, err) + actions.SimulateOCRv1EAActivity(l, 3*time.Second, ocrInstances, workerNodes, msClient) + + err = actions.WatchNewOCRRound(l, sethClient, 1, contracts.V1OffChainAgrregatorToOffChainAggregatorWithRounds(ocrInstances), 5*time.Minute) + require.NoError(t, err, "Error watching for new OCR round") + + if os.Getenv("TEST_PERSISTENCE") != "" { + ch, err := rebootCLNamespace( + 1*time.Second, + os.Getenv("CRIB_NAMESPACE"), + ) + require.NoError(t, err, "Error rebooting CL namespace") + ch.Create(context.Background()) + ch.AddListener(havoc.NewChaosLogger(l)) + t.Cleanup(func() { + err := ch.Delete(context.Background()) + require.NoError(t, err, "Error deleting chaos") + }) + require.Eventually(t, func() bool { + err = actions.WatchNewOCRRound(l, sethClient, 3, contracts.V1OffChainAgrregatorToOffChainAggregatorWithRounds(ocrInstances), 5*time.Minute) + if err != nil { + l.Info().Err(err).Msg("OCR round is not there yet") + return false + } + return true + }, 20*time.Minute, 5*time.Second) + } +} + +// TestCRIBRPCChaos and example of how we can run RPC chaos with Geth or Anvil +func TestCRIBRPCChaos(t *testing.T) { + l := logging.GetTestLogger(t) + + sethClient, msClient, bootstrapNode, workerNodes, vars, err := ConnectRemote() + require.NoError(t, err) + + ocrConfig := &ocr_config.Config{ + Contracts: &ocr_config.Contracts{ + ShouldBeUsed: ptr.Ptr(false), + }, + } + + lta, err := actions.SetupOCRv1Cluster(l, sethClient, ocrConfig, workerNodes) + require.NoError(t, err) + ocrInstances, err := actions.SetupOCRv1Feed(l, sethClient, lta, ocrConfig, msClient, bootstrapNode, workerNodes) + require.NoError(t, err) + + err = actions.SetAllAdapterResponsesToTheSameValue(10, ocrInstances, workerNodes, msClient) + require.NoError(t, err) + actions.SimulateOCRv1EAActivity(l, 3*time.Second, ocrInstances, workerNodes, msClient) + + err = actions.WatchNewOCRRound(l, sethClient, 1, contracts.V1OffChainAgrregatorToOffChainAggregatorWithRounds(ocrInstances), 5*time.Minute) + require.NoError(t, err, "Error watching for new OCR round") + + ac := client.NewRPCClient(sethClient.URL, vars.BlockchainNodeHeaders) + err = ac.GethSetHead(10) + require.NoError(t, err) + + err = actions.WatchNewOCRRound(l, sethClient, 3, contracts.V1OffChainAgrregatorToOffChainAggregatorWithRounds(ocrInstances), 5*time.Minute) + require.NoError(t, err, "Error watching for new OCR round") +} diff --git a/integration-tests/deployment/README.md b/integration-tests/deployment/README.md new file mode 100644 index 00000000000..000219c8aba --- /dev/null +++ b/integration-tests/deployment/README.md @@ -0,0 +1,58 @@ +### Overview +The deployment package in the integration-tests Go module serves +as a product agnostic set of environment abstractions used +to deploy and configure products including both on/offchain +dependencies. The environment abstractions allow for +complex and critical deployment/configuration logic to be tested +against ephemeral environments and then exposed for use in persistent +environments like testnet/mainnet. + +### Directory structure + +/deployment +- package name `deployment` +- Product agnostic environment abstractions and helpers using those + abstractions + +/deployment/memory +- package name `memory` +- In-memory environment for fast integration testing +- EVM only + +/deployment/devenv +- Coming soon +- package name `devenv` +- Docker environment for higher fidelity testing +- Support non-EVMs (yet to be implemented) + +/deployment/ccip +- package name `ccipdeployment` +- Files and tests per product deployment/configuration workflows +- Tests can use deployment/memory for fast integration testing +- TODO: System state representation is defined here, need to define + an interface to comply with for all products. + +/deployment/ccip/changeset +- package name `changeset` imported as `ccipchangesets` +- These function like scripts describing state transitions + you wish to apply to _persistent_ environments like testnet/mainnet +- Ordered list of Go functions following the format +```Go +0001_descriptive_name.go +func Apply0001(env deployment.Environment, c ccipdeployment.Config) (deployment.ChangesetOutput, error) +{ + // Deploy contracts, generate MCMS proposals, generate + // job specs according to contracts etc. + return deployment.ChangesetOutput{}, nil +} +0001_descriptive_name_test.go +func TestApply0001(t *testing.T) +{ + // Set up memory env + // Apply0001 function + // Take the artifacts from ChangeSet output + // Apply them to the memory env + // Send traffic, run assertions etc. +} +``` +- Changesets are exposed and applied via a different repo. \ No newline at end of file diff --git a/integration-tests/deployment/address_book.go b/integration-tests/deployment/address_book.go new file mode 100644 index 00000000000..be004f27d0d --- /dev/null +++ b/integration-tests/deployment/address_book.go @@ -0,0 +1,163 @@ +package deployment + +import ( + "fmt" + "strings" + + "github.com/Masterminds/semver/v3" + "github.com/ethereum/go-ethereum/common" + "github.com/pkg/errors" + chainsel "github.com/smartcontractkit/chain-selectors" +) + +var ( + ErrInvalidChainSelector = fmt.Errorf("invalid chain selector") + ErrInvalidAddress = fmt.Errorf("invalid address") + ErrChainNotFound = fmt.Errorf("chain not found") +) + +// ContractType is a simple string type for identifying contract types. +type ContractType string + +var ( + Version1_0_0 = *semver.MustParse("1.0.0") + Version1_1_0 = *semver.MustParse("1.1.0") + Version1_2_0 = *semver.MustParse("1.2.0") + Version1_5_0 = *semver.MustParse("1.5.0") + Version1_6_0_dev = *semver.MustParse("1.6.0-dev") +) + +type TypeAndVersion struct { + Type ContractType + Version semver.Version +} + +func (tv TypeAndVersion) String() string { + return fmt.Sprintf("%s %s", tv.Type, tv.Version.String()) +} + +func (tv TypeAndVersion) Equal(other TypeAndVersion) bool { + return tv.String() == other.String() +} + +func MustTypeAndVersionFromString(s string) TypeAndVersion { + tv, err := TypeAndVersionFromString(s) + if err != nil { + panic(err) + } + return tv +} + +// Note this will become useful for validation. When we want +// to assert an onchain call to typeAndVersion yields whats expected. +func TypeAndVersionFromString(s string) (TypeAndVersion, error) { + parts := strings.Split(s, " ") + if len(parts) != 2 { + return TypeAndVersion{}, fmt.Errorf("invalid type and version string: %s", s) + } + v, err := semver.NewVersion(parts[1]) + if err != nil { + return TypeAndVersion{}, err + } + return TypeAndVersion{ + Type: ContractType(parts[0]), + Version: *v, + }, nil +} + +func NewTypeAndVersion(t ContractType, v semver.Version) TypeAndVersion { + return TypeAndVersion{ + Type: t, + Version: v, + } +} + +// AddressBook is a simple interface for storing and retrieving contract addresses across +// chains. It is family agnostic as the keys are chain selectors. +// We store rather than derive typeAndVersion as some contracts do not support it. +// For ethereum addresses are always stored in EIP55 format. +type AddressBook interface { + Save(chainSelector uint64, address string, tv TypeAndVersion) error + Addresses() (map[uint64]map[string]TypeAndVersion, error) + AddressesForChain(chain uint64) (map[string]TypeAndVersion, error) + // Allows for merging address books (e.g. new deployments with existing ones) + Merge(other AddressBook) error +} + +type AddressBookMap struct { + AddressesByChain map[uint64]map[string]TypeAndVersion +} + +func (m *AddressBookMap) Save(chainSelector uint64, address string, typeAndVersion TypeAndVersion) error { + _, exists := chainsel.ChainBySelector(chainSelector) + if !exists { + return errors.Wrapf(ErrInvalidChainSelector, "chain selector %d", chainSelector) + } + if address == "" || address == common.HexToAddress("0x0").Hex() { + return errors.Wrap(ErrInvalidAddress, "address cannot be empty") + } + if common.IsHexAddress(address) { + // IMPORTANT: WE ALWAYS STANDARDIZE ETHEREUM ADDRESS STRINGS TO EIP55 + address = common.HexToAddress(address).Hex() + } else { + return errors.Wrapf(ErrInvalidAddress, "address %s is not a valid Ethereum address, only Ethereum addresses supported", address) + } + if typeAndVersion.Type == "" { + return fmt.Errorf("type cannot be empty") + } + if _, exists := m.AddressesByChain[chainSelector]; !exists { + // First time chain add, create map + m.AddressesByChain[chainSelector] = make(map[string]TypeAndVersion) + } + if _, exists := m.AddressesByChain[chainSelector][address]; exists { + return fmt.Errorf("address %s already exists for chain %d", address, chainSelector) + } + m.AddressesByChain[chainSelector][address] = typeAndVersion + return nil +} + +func (m *AddressBookMap) Addresses() (map[uint64]map[string]TypeAndVersion, error) { + return m.AddressesByChain, nil +} + +func (m *AddressBookMap) AddressesForChain(chainSelector uint64) (map[string]TypeAndVersion, error) { + _, exists := chainsel.ChainBySelector(chainSelector) + if !exists { + return nil, errors.Wrapf(ErrInvalidChainSelector, "chain selector %d", chainSelector) + } + if _, exists := m.AddressesByChain[chainSelector]; !exists { + return nil, errors.Wrapf(ErrChainNotFound, "chain selector %d", chainSelector) + } + return m.AddressesByChain[chainSelector], nil +} + +// Attention this will mutate existing book +func (m *AddressBookMap) Merge(ab AddressBook) error { + addresses, err := ab.Addresses() + if err != nil { + return err + } + for chain, chainAddresses := range addresses { + for address, typeAndVersions := range chainAddresses { + if err := m.Save(chain, address, typeAndVersions); err != nil { + return err + } + } + } + return nil +} + +// TODO: Maybe could add an environment argument +// which would ensure only mainnet/testnet chain selectors are used +// for further safety? +func NewMemoryAddressBook() *AddressBookMap { + return &AddressBookMap{ + AddressesByChain: make(map[uint64]map[string]TypeAndVersion), + } +} + +func NewMemoryAddressBookFromMap(addressesByChain map[uint64]map[string]TypeAndVersion) *AddressBookMap { + return &AddressBookMap{ + AddressesByChain: addressesByChain, + } +} diff --git a/integration-tests/deployment/address_book_test.go b/integration-tests/deployment/address_book_test.go new file mode 100644 index 00000000000..bf3d2ad965c --- /dev/null +++ b/integration-tests/deployment/address_book_test.go @@ -0,0 +1,120 @@ +package deployment + +import ( + "errors" + "testing" + + "github.com/ethereum/go-ethereum/common" + chainsel "github.com/smartcontractkit/chain-selectors" + "github.com/stretchr/testify/require" + "gotest.tools/v3/assert" +) + +func TestAddressBook_Save(t *testing.T) { + ab := NewMemoryAddressBook() + onRamp100 := NewTypeAndVersion("OnRamp", Version1_0_0) + onRamp110 := NewTypeAndVersion("OnRamp", Version1_1_0) + addr1 := common.HexToAddress("0x1").String() + addr2 := common.HexToAddress("0x2").String() + + err := ab.Save(chainsel.TEST_90000001.Selector, addr1, onRamp100) + require.NoError(t, err) + + // Invalid address + err = ab.Save(chainsel.TEST_90000001.Selector, "asdlfkj", onRamp100) + require.Error(t, err) + assert.Equal(t, errors.Is(err, ErrInvalidAddress), true, "err %s", err) + + // Valid chain but not present. + _, err = ab.AddressesForChain(chainsel.TEST_90000002.Selector) + assert.Equal(t, errors.Is(err, ErrChainNotFound), true, "err %s", err) + + // Invalid selector + err = ab.Save(0, addr1, onRamp100) + require.Error(t, err) + assert.Equal(t, errors.Is(err, ErrInvalidChainSelector), true) + + // Duplicate + err = ab.Save(chainsel.TEST_90000001.Selector, addr1, onRamp100) + require.Error(t, err) + + // Zero address + err = ab.Save(chainsel.TEST_90000001.Selector, common.HexToAddress("0x0").Hex(), onRamp100) + require.Error(t, err) + + // Distinct address same TV will not + err = ab.Save(chainsel.TEST_90000001.Selector, addr2, onRamp100) + require.NoError(t, err) + // Same address different chain will not error + err = ab.Save(chainsel.TEST_90000002.Selector, addr1, onRamp100) + require.NoError(t, err) + // We can save different versions of the same contract + err = ab.Save(chainsel.TEST_90000002.Selector, addr2, onRamp110) + require.NoError(t, err) + + addresses, err := ab.Addresses() + require.NoError(t, err) + assert.DeepEqual(t, addresses, map[uint64]map[string]TypeAndVersion{ + chainsel.TEST_90000001.Selector: { + addr1: onRamp100, + addr2: onRamp100, + }, + chainsel.TEST_90000002.Selector: { + addr1: onRamp100, + addr2: onRamp110, + }, + }) +} + +func TestAddressBook_Merge(t *testing.T) { + onRamp100 := NewTypeAndVersion("OnRamp", Version1_0_0) + onRamp110 := NewTypeAndVersion("OnRamp", Version1_1_0) + addr1 := common.HexToAddress("0x1").String() + addr2 := common.HexToAddress("0x2").String() + a1 := NewMemoryAddressBookFromMap(map[uint64]map[string]TypeAndVersion{ + chainsel.TEST_90000001.Selector: { + addr1: onRamp100, + }, + }) + a2 := NewMemoryAddressBookFromMap(map[uint64]map[string]TypeAndVersion{ + chainsel.TEST_90000001.Selector: { + addr2: onRamp100, + }, + chainsel.TEST_90000002.Selector: { + addr1: onRamp110, + }, + }) + require.NoError(t, a1.Merge(a2)) + + addresses, err := a1.Addresses() + require.NoError(t, err) + assert.DeepEqual(t, addresses, map[uint64]map[string]TypeAndVersion{ + chainsel.TEST_90000001.Selector: { + addr1: onRamp100, + addr2: onRamp100, + }, + chainsel.TEST_90000002.Selector: { + addr1: onRamp110, + }, + }) + + // Merge with conflicting addresses should error + a3 := NewMemoryAddressBookFromMap(map[uint64]map[string]TypeAndVersion{ + chainsel.TEST_90000001.Selector: { + addr1: onRamp100, + }, + }) + require.Error(t, a1.Merge(a3)) + // a1 should not have changed + addresses, err = a1.Addresses() + require.NoError(t, err) + assert.DeepEqual(t, addresses, map[uint64]map[string]TypeAndVersion{ + chainsel.TEST_90000001.Selector: { + addr1: onRamp100, + addr2: onRamp100, + }, + chainsel.TEST_90000002.Selector: { + addr1: onRamp110, + }, + }) +} diff --git a/integration-tests/deployment/ccip/add_chain.go b/integration-tests/deployment/ccip/add_chain.go new file mode 100644 index 00000000000..48cf7542d7f --- /dev/null +++ b/integration-tests/deployment/ccip/add_chain.go @@ -0,0 +1,190 @@ +package ccipdeployment + +import ( + "math/big" + + "github.com/ethereum/go-ethereum/common" + "github.com/smartcontractkit/ccip-owner-contracts/pkg/proposal/mcms" + "github.com/smartcontractkit/ccip-owner-contracts/pkg/proposal/timelock" + + chainsel "github.com/smartcontractkit/chain-selectors" + + "github.com/smartcontractkit/chainlink-ccip/chainconfig" + + "github.com/smartcontractkit/chainlink-common/pkg/types/ccipocr3" + + "github.com/smartcontractkit/chainlink/integration-tests/deployment" + + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/ccip_config" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/fee_quoter" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/onramp" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/capabilities_registry" +) + +// NewChainInboundProposal generates a proposal +// to connect the new chain to the existing chains. +func NewChainInboundProposal( + e deployment.Environment, + state CCIPOnChainState, + homeChainSel uint64, + feedChainSel uint64, + newChainSel uint64, + sources []uint64, + tokenConfig TokenConfig, +) (*timelock.MCMSWithTimelockProposal, error) { + // Generate proposal which enables new destination (from test router) on all source chains. + var batches []timelock.BatchChainOperation + metaDataPerChain := make(map[mcms.ChainIdentifier]mcms.ChainMetadata) + timelockAddresses := make(map[mcms.ChainIdentifier]common.Address) + for _, source := range sources { + chain, _ := chainsel.ChainBySelector(source) + enableOnRampDest, err := state.Chains[source].OnRamp.ApplyDestChainConfigUpdates(SimTransactOpts(), []onramp.OnRampDestChainConfigArgs{ + { + DestChainSelector: newChainSel, + Router: state.Chains[source].TestRouter.Address(), + }, + }) + if err != nil { + return nil, err + } + enableFeeQuoterDest, err := state.Chains[source].FeeQuoter.ApplyDestChainConfigUpdates( + SimTransactOpts(), + []fee_quoter.FeeQuoterDestChainConfigArgs{ + { + DestChainSelector: newChainSel, + DestChainConfig: defaultFeeQuoterDestChainConfig(), + }, + }) + if err != nil { + return nil, err + } + initialPrices, err := state.Chains[source].FeeQuoter.UpdatePrices( + SimTransactOpts(), + fee_quoter.InternalPriceUpdates{ + TokenPriceUpdates: []fee_quoter.InternalTokenPriceUpdate{}, + GasPriceUpdates: []fee_quoter.InternalGasPriceUpdate{ + { + DestChainSelector: newChainSel, + // TODO: parameterize + UsdPerUnitGas: big.NewInt(2e12), + }, + }}) + if err != nil { + return nil, err + } + batches = append(batches, timelock.BatchChainOperation{ + ChainIdentifier: mcms.ChainIdentifier(chain.Selector), + Batch: []mcms.Operation{ + { + // Enable the source in on ramp + To: state.Chains[source].OnRamp.Address(), + Data: enableOnRampDest.Data(), + Value: big.NewInt(0), + }, + { + // Set initial dest prices to unblock testing. + To: state.Chains[source].FeeQuoter.Address(), + Data: initialPrices.Data(), + Value: big.NewInt(0), + }, + { + To: state.Chains[source].FeeQuoter.Address(), + Data: enableFeeQuoterDest.Data(), + Value: big.NewInt(0), + }, + }, + }) + opCount, err := state.Chains[source].Mcm.GetOpCount(nil) + if err != nil { + return nil, err + } + metaDataPerChain[mcms.ChainIdentifier(chain.Selector)] = mcms.ChainMetadata{ + StartingOpCount: opCount.Uint64(), + MCMAddress: state.Chains[source].Mcm.Address(), + } + timelockAddresses[mcms.ChainIdentifier(chain.Selector)] = state.Chains[source].Timelock.Address() + } + + // Home chain new don. + // - Add new DONs for destination to home chain + nodes, err := deployment.NodeInfo(e.NodeIDs, e.Offchain) + if err != nil { + return nil, err + } + encodedExtraChainConfig, err := chainconfig.EncodeChainConfig(chainconfig.ChainConfig{ + GasPriceDeviationPPB: ccipocr3.NewBigIntFromInt64(1000), + DAGasPriceDeviationPPB: ccipocr3.NewBigIntFromInt64(0), + OptimisticConfirmations: 1, + }) + if err != nil { + return nil, err + } + chainConfig := SetupConfigInfo(newChainSel, nodes.NonBootstraps().PeerIDs(), + nodes.DefaultF(), encodedExtraChainConfig) + addChain, err := state.Chains[homeChainSel].CCIPConfig.ApplyChainConfigUpdates(SimTransactOpts(), nil, []ccip_config.CCIPConfigTypesChainConfigInfo{ + chainConfig, + }) + if err != nil { + return nil, err + } + + newDONArgs, err := BuildAddDONArgs( + e.Logger, + state.Chains[newChainSel].OffRamp, + e.Chains[newChainSel], + feedChainSel, + tokenConfig.GetTokenInfo(e.Logger, state.Chains[newChainSel]), + nodes.NonBootstraps(), + ) + if err != nil { + return nil, err + } + addDON, err := state.Chains[homeChainSel].CapabilityRegistry.AddDON(SimTransactOpts(), + nodes.NonBootstraps().PeerIDs(), []capabilities_registry.CapabilitiesRegistryCapabilityConfiguration{ + { + CapabilityId: CCIPCapabilityID, + Config: newDONArgs, + }, + }, false, false, nodes.NonBootstraps().DefaultF()) + if err != nil { + return nil, err + } + homeChain, _ := chainsel.ChainBySelector(homeChainSel) + opCount, err := state.Chains[homeChainSel].Mcm.GetOpCount(nil) + if err != nil { + return nil, err + } + metaDataPerChain[mcms.ChainIdentifier(homeChain.Selector)] = mcms.ChainMetadata{ + StartingOpCount: opCount.Uint64(), + MCMAddress: state.Chains[homeChainSel].Mcm.Address(), + } + timelockAddresses[mcms.ChainIdentifier(homeChain.Selector)] = state.Chains[homeChainSel].Timelock.Address() + batches = append(batches, timelock.BatchChainOperation{ + ChainIdentifier: mcms.ChainIdentifier(homeChain.Selector), + Batch: []mcms.Operation{ + { + // Add the chain first, don needs it to be there. + To: state.Chains[homeChainSel].CCIPConfig.Address(), + Data: addChain.Data(), + Value: big.NewInt(0), + }, + { + To: state.Chains[homeChainSel].CapabilityRegistry.Address(), + Data: addDON.Data(), + Value: big.NewInt(0), + }, + }, + }) + return timelock.NewMCMSWithTimelockProposal( + "1", + 2004259681, // TODO: should be parameterized and based on current block timestamp. + []mcms.Signature{}, + false, + metaDataPerChain, + timelockAddresses, + "blah", // TODO + batches, + timelock.Schedule, + "0s", // TODO: Should be parameterized. + ) +} diff --git a/integration-tests/deployment/ccip/add_chain_test.go b/integration-tests/deployment/ccip/add_chain_test.go new file mode 100644 index 00000000000..dbe86b85368 --- /dev/null +++ b/integration-tests/deployment/ccip/add_chain_test.go @@ -0,0 +1,186 @@ +package ccipdeployment + +import ( + "testing" + "time" + + "github.com/ethereum/go-ethereum/common" + + "github.com/smartcontractkit/chainlink-ccip/pluginconfig" + + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccipocr3" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/testcontext" + + "github.com/smartcontractkit/chainlink/integration-tests/deployment" + + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/offramp" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/router" + "github.com/smartcontractkit/chainlink/v2/core/logger" +) + +func TestAddChainInbound(t *testing.T) { + // 4 chains where the 4th is added after initial deployment. + e := NewEnvironmentWithCRAndJobs(t, logger.TestLogger(t), 4) + require.Equal(t, len(e.Nodes), 5) + state, err := LoadOnchainState(e.Env, e.Ab) + require.NoError(t, err) + // Take first non-home chain as the new chain. + newChain := e.Env.AllChainSelectorsExcluding([]uint64{e.HomeChainSel})[0] + // We deploy to the rest. + initialDeploy := e.Env.AllChainSelectorsExcluding([]uint64{newChain}) + + feeds := state.Chains[e.FeedChainSel].USDFeeds + tokenConfig := NewTokenConfig() + tokenConfig.UpsertTokenInfo(LinkSymbol, + pluginconfig.TokenInfo{ + AggregatorAddress: feeds[LinkSymbol].Address().String(), + Decimals: LinkDecimals, + DeviationPPB: cciptypes.NewBigIntFromInt64(1e9), + }, + ) + ab, err := DeployCCIPContracts(e.Env, DeployCCIPContractConfig{ + HomeChainSel: e.HomeChainSel, + FeedChainSel: e.FeedChainSel, + ChainsToDeploy: initialDeploy, + TokenConfig: tokenConfig, + CCIPOnChainState: state, + }) + require.NoError(t, err) + require.NoError(t, e.Ab.Merge(ab)) + state, err = LoadOnchainState(e.Env, e.Ab) + require.NoError(t, err) + + // Connect all the existing lanes. + for _, source := range initialDeploy { + for _, dest := range initialDeploy { + if source != dest { + require.NoError(t, AddLane(e.Env, state, source, dest)) + } + } + } + + // Deploy contracts to new chain + newAddresses, err := DeployChainContracts(e.Env, e.Env.Chains[newChain], deployment.NewMemoryAddressBook()) + require.NoError(t, err) + require.NoError(t, e.Ab.Merge(newAddresses)) + state, err = LoadOnchainState(e.Env, e.Ab) + require.NoError(t, err) + + // Transfer onramp/fq ownership to timelock. + // Enable the new dest on the test router. + for _, source := range initialDeploy { + tx, err := state.Chains[source].OnRamp.TransferOwnership(e.Env.Chains[source].DeployerKey, state.Chains[source].Timelock.Address()) + require.NoError(t, err) + _, err = deployment.ConfirmIfNoError(e.Env.Chains[source], tx, err) + require.NoError(t, err) + tx, err = state.Chains[source].FeeQuoter.TransferOwnership(e.Env.Chains[source].DeployerKey, state.Chains[source].Timelock.Address()) + require.NoError(t, err) + _, err = deployment.ConfirmIfNoError(e.Env.Chains[source], tx, err) + require.NoError(t, err) + tx, err = state.Chains[source].TestRouter.ApplyRampUpdates(e.Env.Chains[source].DeployerKey, []router.RouterOnRamp{ + { + DestChainSelector: newChain, + OnRamp: state.Chains[source].OnRamp.Address(), + }, + }, nil, nil) + _, err = deployment.ConfirmIfNoError(e.Env.Chains[source], tx, err) + require.NoError(t, err) + } + // Transfer CR contract ownership + tx, err := state.Chains[e.HomeChainSel].CapabilityRegistry.TransferOwnership(e.Env.Chains[e.HomeChainSel].DeployerKey, state.Chains[e.HomeChainSel].Timelock.Address()) + require.NoError(t, err) + _, err = deployment.ConfirmIfNoError(e.Env.Chains[e.HomeChainSel], tx, err) + require.NoError(t, err) + tx, err = state.Chains[e.HomeChainSel].CCIPConfig.TransferOwnership(e.Env.Chains[e.HomeChainSel].DeployerKey, state.Chains[e.HomeChainSel].Timelock.Address()) + require.NoError(t, err) + _, err = deployment.ConfirmIfNoError(e.Env.Chains[e.HomeChainSel], tx, err) + require.NoError(t, err) + + acceptOwnershipProposal, err := GenerateAcceptOwnershipProposal(state, e.HomeChainSel, initialDeploy) + require.NoError(t, err) + acceptOwnershipExec := SignProposal(t, e.Env, acceptOwnershipProposal) + // Apply the accept ownership proposal to all the chains. + for _, sel := range initialDeploy { + ExecuteProposal(t, e.Env, acceptOwnershipExec, state, sel) + } + for _, chain := range initialDeploy { + owner, err2 := state.Chains[chain].OnRamp.Owner(nil) + require.NoError(t, err2) + require.Equal(t, state.Chains[chain].Timelock.Address(), owner) + } + cfgOwner, err := state.Chains[e.HomeChainSel].CCIPConfig.Owner(nil) + require.NoError(t, err) + crOwner, err := state.Chains[e.HomeChainSel].CapabilityRegistry.Owner(nil) + require.NoError(t, err) + require.Equal(t, state.Chains[e.HomeChainSel].Timelock.Address(), cfgOwner) + require.Equal(t, state.Chains[e.HomeChainSel].Timelock.Address(), crOwner) + + // Generate and sign inbound proposal to new 4th chain. + chainInboundProposal, err := NewChainInboundProposal(e.Env, state, e.HomeChainSel, e.FeedChainSel, newChain, initialDeploy, tokenConfig) + require.NoError(t, err) + chainInboundExec := SignProposal(t, e.Env, chainInboundProposal) + for _, sel := range initialDeploy { + ExecuteProposal(t, e.Env, chainInboundExec, state, sel) + } + + // Now configure the new chain using deployer key (not transferred to timelock yet). + var offRampEnables []offramp.OffRampSourceChainConfigArgs + for _, source := range initialDeploy { + offRampEnables = append(offRampEnables, offramp.OffRampSourceChainConfigArgs{ + Router: state.Chains[newChain].Router.Address(), + SourceChainSelector: source, + IsEnabled: true, + OnRamp: common.LeftPadBytes(state.Chains[source].OnRamp.Address().Bytes(), 32), + }) + } + tx, err = state.Chains[newChain].OffRamp.ApplySourceChainConfigUpdates(e.Env.Chains[newChain].DeployerKey, offRampEnables) + require.NoError(t, err) + _, err = deployment.ConfirmIfNoError(e.Env.Chains[newChain], tx, err) + require.NoError(t, err) + // Set the OCR3 config on new 4th chain to enable the plugin. + latestDON, err := LatestCCIPDON(state.Chains[e.HomeChainSel].CapabilityRegistry) + require.NoError(t, err) + ocrConfigs, err := BuildSetOCR3ConfigArgs(latestDON.Id, state.Chains[e.HomeChainSel].CCIPConfig) + require.NoError(t, err) + tx, err = state.Chains[newChain].OffRamp.SetOCR3Configs(e.Env.Chains[newChain].DeployerKey, ocrConfigs) + require.NoError(t, err) + _, err = deployment.ConfirmIfNoError(e.Env.Chains[newChain], tx, err) + require.NoError(t, err) + + // Assert the inbound lanes to the new chain are wired correctly. + state, err = LoadOnchainState(e.Env, e.Ab) + require.NoError(t, err) + for _, chain := range initialDeploy { + cfg, err2 := state.Chains[chain].OnRamp.GetDestChainConfig(nil, newChain) + require.NoError(t, err2) + assert.Equal(t, cfg.Router, state.Chains[chain].TestRouter.Address()) + fqCfg, err2 := state.Chains[chain].FeeQuoter.GetDestChainConfig(nil, newChain) + require.NoError(t, err2) + assert.True(t, fqCfg.IsEnabled) + s, err2 := state.Chains[newChain].OffRamp.GetSourceChainConfig(nil, chain) + require.NoError(t, err2) + assert.Equal(t, common.LeftPadBytes(state.Chains[chain].OnRamp.Address().Bytes(), 32), s.OnRamp) + } + // Ensure job related logs are up to date. + time.Sleep(30 * time.Second) + require.NoError(t, ReplayAllLogs(e.Nodes, e.Env.Chains)) + + // TODO: Send via all inbound lanes and use parallel helper + // Now that the proposal has been executed we expect to be able to send traffic to this new 4th chain. + latesthdr, err := e.Env.Chains[newChain].Client.HeaderByNumber(testcontext.Get(t), nil) + require.NoError(t, err) + startBlock := latesthdr.Number.Uint64() + seqNr := SendRequest(t, e.Env, state, initialDeploy[0], newChain, true) + require.NoError(t, + ConfirmExecWithSeqNr(t, e.Env.Chains[initialDeploy[0]], e.Env.Chains[newChain], state.Chains[newChain].OffRamp, &startBlock, seqNr)) + + linkAddress := state.Chains[newChain].LinkToken.Address() + feeQuoter := state.Chains[newChain].FeeQuoter + timestampedPrice, err := feeQuoter.GetTokenPrice(nil, linkAddress) + require.NoError(t, err) + require.Equal(t, MockLinkPrice, timestampedPrice.Value) +} diff --git a/integration-tests/deployment/ccip/add_lane.go b/integration-tests/deployment/ccip/add_lane.go new file mode 100644 index 00000000000..0e7c01405b1 --- /dev/null +++ b/integration-tests/deployment/ccip/add_lane.go @@ -0,0 +1,122 @@ +package ccipdeployment + +import ( + "encoding/hex" + "math/big" + + "github.com/ethereum/go-ethereum/common" + + "github.com/smartcontractkit/chainlink/integration-tests/deployment" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/offramp" + + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/fee_quoter" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/onramp" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/router" +) + +func AddLane(e deployment.Environment, state CCIPOnChainState, from, to uint64) error { + // TODO: Batch + tx, err := state.Chains[from].Router.ApplyRampUpdates(e.Chains[from].DeployerKey, []router.RouterOnRamp{ + { + DestChainSelector: to, + OnRamp: state.Chains[from].OnRamp.Address(), + }, + }, []router.RouterOffRamp{}, []router.RouterOffRamp{}) + if _, err := deployment.ConfirmIfNoError(e.Chains[from], tx, err); err != nil { + return err + } + tx, err = state.Chains[from].OnRamp.ApplyDestChainConfigUpdates(e.Chains[from].DeployerKey, + []onramp.OnRampDestChainConfigArgs{ + { + DestChainSelector: to, + Router: state.Chains[from].Router.Address(), + }, + }) + if _, err := deployment.ConfirmIfNoError(e.Chains[from], tx, err); err != nil { + return err + } + + _, err = state.Chains[from].FeeQuoter.UpdatePrices( + e.Chains[from].DeployerKey, fee_quoter.InternalPriceUpdates{ + TokenPriceUpdates: []fee_quoter.InternalTokenPriceUpdate{ + { + SourceToken: state.Chains[from].LinkToken.Address(), + UsdPerToken: deployment.E18Mult(20), + }, + { + SourceToken: state.Chains[from].Weth9.Address(), + UsdPerToken: deployment.E18Mult(4000), + }, + }, + GasPriceUpdates: []fee_quoter.InternalGasPriceUpdate{ + { + DestChainSelector: to, + UsdPerUnitGas: big.NewInt(2e12), + }, + }}) + if _, err := deployment.ConfirmIfNoError(e.Chains[from], tx, err); err != nil { + return err + } + + // Enable dest in fee quoter + tx, err = state.Chains[from].FeeQuoter.ApplyDestChainConfigUpdates(e.Chains[from].DeployerKey, + []fee_quoter.FeeQuoterDestChainConfigArgs{ + { + DestChainSelector: to, + DestChainConfig: defaultFeeQuoterDestChainConfig(), + }, + }) + if _, err := deployment.ConfirmIfNoError(e.Chains[from], tx, err); err != nil { + return err + } + + tx, err = state.Chains[to].OffRamp.ApplySourceChainConfigUpdates(e.Chains[to].DeployerKey, + []offramp.OffRampSourceChainConfigArgs{ + { + Router: state.Chains[to].Router.Address(), + SourceChainSelector: from, + IsEnabled: true, + OnRamp: common.LeftPadBytes(state.Chains[from].OnRamp.Address().Bytes(), 32), + }, + }) + if _, err := deployment.ConfirmIfNoError(e.Chains[to], tx, err); err != nil { + return err + } + tx, err = state.Chains[to].Router.ApplyRampUpdates(e.Chains[to].DeployerKey, []router.RouterOnRamp{}, []router.RouterOffRamp{}, []router.RouterOffRamp{ + { + SourceChainSelector: from, + OffRamp: state.Chains[to].OffRamp.Address(), + }, + }) + _, err = deployment.ConfirmIfNoError(e.Chains[to], tx, err) + return err +} + +func defaultFeeQuoterDestChainConfig() fee_quoter.FeeQuoterDestChainConfig { + // https://github.com/smartcontractkit/ccip/blob/c4856b64bd766f1ddbaf5d13b42d3c4b12efde3a/contracts/src/v0.8/ccip/libraries/Internal.sol#L337-L337 + /* + ```Solidity + // bytes4(keccak256("CCIP ChainFamilySelector EVM")) + bytes4 public constant CHAIN_FAMILY_SELECTOR_EVM = 0x2812d52c; + ``` + */ + evmFamilySelector, _ := hex.DecodeString("2812d52c") + return fee_quoter.FeeQuoterDestChainConfig{ + IsEnabled: true, + MaxNumberOfTokensPerMsg: 10, + MaxDataBytes: 256, + MaxPerMsgGasLimit: 3_000_000, + DestGasOverhead: 50_000, + DefaultTokenFeeUSDCents: 1, + DestGasPerPayloadByte: 10, + DestDataAvailabilityOverheadGas: 0, + DestGasPerDataAvailabilityByte: 100, + DestDataAvailabilityMultiplierBps: 1, + DefaultTokenDestGasOverhead: 125_000, + //DefaultTokenDestBytesOverhead: 32, + DefaultTxGasLimit: 200_000, + GasMultiplierWeiPerEth: 1, + NetworkFeeUSDCents: 1, + ChainFamilySelector: [4]byte(evmFamilySelector), + } +} diff --git a/integration-tests/deployment/ccip/add_lane_test.go b/integration-tests/deployment/ccip/add_lane_test.go new file mode 100644 index 00000000000..3da74ec11a8 --- /dev/null +++ b/integration-tests/deployment/ccip/add_lane_test.go @@ -0,0 +1,64 @@ +package ccipdeployment + +import ( + "testing" + + "github.com/stretchr/testify/require" + + "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/testcontext" + + "github.com/smartcontractkit/chainlink/v2/core/logger" +) + +// TestAddLane covers the workflow of adding a lane +// between existing supported chains in CCIP. +func TestAddLane(t *testing.T) { + // TODO: The offchain code doesn't yet support partial lane + // enablement, need to address then re-enable this test. + t.Skip() + e := NewEnvironmentWithCRAndJobs(t, logger.TestLogger(t), 3) + // Here we have CR + nodes set up, but no CCIP contracts deployed. + state, err := LoadOnchainState(e.Env, e.Ab) + require.NoError(t, err) + // Set up CCIP contracts and a DON per chain. + ab, err := DeployCCIPContracts(e.Env, DeployCCIPContractConfig{ + HomeChainSel: e.HomeChainSel, + FeedChainSel: e.FeedChainSel, + TokenConfig: NewTokenConfig(), + CCIPOnChainState: state, + }) + require.NoError(t, err) + require.NoError(t, e.Ab.Merge(ab)) + + // We expect no lanes available on any chain. + state, err = LoadOnchainState(e.Env, e.Ab) + require.NoError(t, err) + for _, chain := range state.Chains { + offRamps, err := chain.Router.GetOffRamps(nil) + require.NoError(t, err) + require.Len(t, offRamps, 0) + } + + // Add one lane and send traffic. + from, to := e.Env.AllChainSelectors()[0], e.Env.AllChainSelectors()[1] + require.NoError(t, AddLane(e.Env, state, from, to)) + + for sel, chain := range state.Chains { + offRamps, err := chain.Router.GetOffRamps(nil) + require.NoError(t, err) + if sel == to { + require.Len(t, offRamps, 1) + } else { + require.Len(t, offRamps, 0) + } + } + latesthdr, err := e.Env.Chains[to].Client.HeaderByNumber(testcontext.Get(t), nil) + require.NoError(t, err) + startBlock := latesthdr.Number.Uint64() + seqNum := SendRequest(t, e.Env, state, from, to, false) + require.Equal(t, uint64(1), seqNum) + require.NoError(t, ConfirmExecWithSeqNr(t, e.Env.Chains[from], e.Env.Chains[to], state.Chains[to].OffRamp, &startBlock, seqNum)) + + // TODO: Add a second lane, then disable the first and + // ensure we can send on the second but not the first. +} diff --git a/integration-tests/deployment/ccip/changeset/1_cap_reg.go b/integration-tests/deployment/ccip/changeset/1_cap_reg.go new file mode 100644 index 00000000000..1ca288321cd --- /dev/null +++ b/integration-tests/deployment/ccip/changeset/1_cap_reg.go @@ -0,0 +1,23 @@ +package changeset + +import ( + "github.com/smartcontractkit/ccip-owner-contracts/pkg/proposal/timelock" + + "github.com/smartcontractkit/chainlink/integration-tests/deployment" + ccipdeployment "github.com/smartcontractkit/chainlink/integration-tests/deployment/ccip" +) + +// Separate migration because cap reg is an env var for CL nodes. +func Apply0001(env deployment.Environment, homeChainSel uint64) (deployment.ChangesetOutput, error) { + // Note we also deploy the cap reg. + ab, _, err := ccipdeployment.DeployCapReg(env.Logger, env.Chains[homeChainSel]) + if err != nil { + env.Logger.Errorw("Failed to deploy cap reg", "err", err, "addresses", ab) + return deployment.ChangesetOutput{}, err + } + return deployment.ChangesetOutput{ + Proposals: []timelock.MCMSWithTimelockProposal{}, + AddressBook: ab, + JobSpecs: nil, + }, nil +} diff --git a/integration-tests/deployment/ccip/changeset/2_initial_deploy.go b/integration-tests/deployment/ccip/changeset/2_initial_deploy.go new file mode 100644 index 00000000000..99d16d21c40 --- /dev/null +++ b/integration-tests/deployment/ccip/changeset/2_initial_deploy.go @@ -0,0 +1,31 @@ +package changeset + +import ( + "github.com/smartcontractkit/ccip-owner-contracts/pkg/proposal/timelock" + + "github.com/smartcontractkit/chainlink/integration-tests/deployment" + + ccipdeployment "github.com/smartcontractkit/chainlink/integration-tests/deployment/ccip" +) + +// We expect the change set input to be unique per change set. +// TODO: Maybe there's a generics approach here? +// Note if the change set is a deployment and it fails we have 2 options: +// - Just throw away the addresses, fix issue and try again (potentially expensive on mainnet) +func Apply0002(env deployment.Environment, c ccipdeployment.DeployCCIPContractConfig) (deployment.ChangesetOutput, error) { + ab, err := ccipdeployment.DeployCCIPContracts(env, c) + if err != nil { + env.Logger.Errorw("Failed to deploy CCIP contracts", "err", err, "addresses", ab) + return deployment.ChangesetOutput{}, deployment.MaybeDataErr(err) + } + js, err := ccipdeployment.NewCCIPJobSpecs(env.NodeIDs, env.Offchain) + if err != nil { + return deployment.ChangesetOutput{}, err + } + return deployment.ChangesetOutput{ + Proposals: []timelock.MCMSWithTimelockProposal{}, + AddressBook: ab, + // Mapping of which nodes get which jobs. + JobSpecs: js, + }, nil +} diff --git a/integration-tests/deployment/ccip/changeset/2_initial_deploy_test.go b/integration-tests/deployment/ccip/changeset/2_initial_deploy_test.go new file mode 100644 index 00000000000..8dc363b0cbb --- /dev/null +++ b/integration-tests/deployment/ccip/changeset/2_initial_deploy_test.go @@ -0,0 +1,106 @@ +package changeset + +import ( + "testing" + + "github.com/smartcontractkit/chainlink-ccip/pluginconfig" + + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccipocr3" + + "github.com/stretchr/testify/require" + + "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/testcontext" + + ccdeploy "github.com/smartcontractkit/chainlink/integration-tests/deployment/ccip" + jobv1 "github.com/smartcontractkit/chainlink/integration-tests/deployment/jd/job/v1" + + "github.com/smartcontractkit/chainlink/v2/core/logger" +) + +func Test0002_InitialDeploy(t *testing.T) { + lggr := logger.TestLogger(t) + ctx := ccdeploy.Context(t) + tenv := ccdeploy.NewEnvironmentWithCRAndFeeds(t, lggr, 3) + e := tenv.Env + nodes := tenv.Nodes + chains := e.Chains + + state, err := ccdeploy.LoadOnchainState(tenv.Env, tenv.Ab) + require.NoError(t, err) + + feeds := state.Chains[tenv.FeedChainSel].USDFeeds + tokenConfig := ccdeploy.NewTokenConfig() + tokenConfig.UpsertTokenInfo(ccdeploy.LinkSymbol, + pluginconfig.TokenInfo{ + AggregatorAddress: feeds[ccdeploy.LinkSymbol].Address().String(), + Decimals: ccdeploy.LinkDecimals, + DeviationPPB: cciptypes.NewBigIntFromInt64(1e9), + }, + ) + // Apply migration + output, err := Apply0002(tenv.Env, ccdeploy.DeployCCIPContractConfig{ + HomeChainSel: tenv.HomeChainSel, + FeedChainSel: tenv.FeedChainSel, + ChainsToDeploy: tenv.Env.AllChainSelectors(), + TokenConfig: tokenConfig, + // Capreg/config and feeds already exist. + CCIPOnChainState: state, + }) + require.NoError(t, err) + // Get new state after migration. + state, err = ccdeploy.LoadOnchainState(e, output.AddressBook) + require.NoError(t, err) + + // Ensure capreg logs are up to date. + require.NoError(t, ccdeploy.ReplayAllLogs(nodes, chains)) + + // Apply the jobs. + for nodeID, jobs := range output.JobSpecs { + for _, job := range jobs { + // Note these auto-accept + _, err := e.Offchain.ProposeJob(ctx, + &jobv1.ProposeJobRequest{ + NodeId: nodeID, + Spec: job, + }) + require.NoError(t, err) + } + } + + // Add all lanes + require.NoError(t, ccdeploy.AddLanesForAll(e, state)) + // Need to keep track of the block number for each chain so that event subscription can be done from that block. + startBlocks := make(map[uint64]*uint64) + // Send a message from each chain to every other chain. + expectedSeqNum := make(map[uint64]uint64) + for src := range e.Chains { + for dest, destChain := range e.Chains { + if src == dest { + continue + } + latesthdr, err := destChain.Client.HeaderByNumber(testcontext.Get(t), nil) + require.NoError(t, err) + block := latesthdr.Number.Uint64() + startBlocks[dest] = &block + seqNum := ccdeploy.SendRequest(t, e, state, src, dest, false) + expectedSeqNum[dest] = seqNum + } + } + + // Wait for all commit reports to land. + ccdeploy.ConfirmCommitForAllWithExpectedSeqNums(t, e, state, expectedSeqNum, startBlocks) + + // After commit is reported on all chains, token prices should be updated in FeeQuoter. + for dest := range e.Chains { + linkAddress := state.Chains[dest].LinkToken.Address() + feeQuoter := state.Chains[dest].FeeQuoter + timestampedPrice, err := feeQuoter.GetTokenPrice(nil, linkAddress) + require.NoError(t, err) + require.Equal(t, ccdeploy.MockLinkPrice, timestampedPrice.Value) + } + + // Wait for all exec reports to land + ccdeploy.ConfirmExecWithSeqNrForAll(t, e, state, expectedSeqNum, startBlocks) + + // TODO: Apply the proposal. +} diff --git a/integration-tests/deployment/ccip/consts.go b/integration-tests/deployment/ccip/consts.go new file mode 100644 index 00000000000..e9b7a9f2cec --- /dev/null +++ b/integration-tests/deployment/ccip/consts.go @@ -0,0 +1,10 @@ +package ccipdeployment + +type TokenSymbol string + +const ( + LinkSymbol TokenSymbol = "LINK" + WethSymbol TokenSymbol = "WETH" + LinkDecimals = 18 + WethDecimals = 18 +) diff --git a/integration-tests/deployment/ccip/deploy.go b/integration-tests/deployment/ccip/deploy.go new file mode 100644 index 00000000000..0f42bd235b9 --- /dev/null +++ b/integration-tests/deployment/ccip/deploy.go @@ -0,0 +1,551 @@ +package ccipdeployment + +import ( + "crypto/ecdsa" + "fmt" + "math/big" + + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/crypto" + "github.com/smartcontractkit/ccip-owner-contracts/pkg/config" + + owner_helpers "github.com/smartcontractkit/ccip-owner-contracts/pkg/gethwrappers" + + "github.com/smartcontractkit/chainlink-common/pkg/logger" + + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/fee_quoter" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/aggregator_v3_interface" + + "github.com/smartcontractkit/chainlink/integration-tests/deployment" + + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/ccip_config" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/maybe_revert_message_receiver" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/nonce_manager" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/offramp" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/onramp" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/rmn_proxy_contract" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/rmn_remote" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/router" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/token_admin_registry" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/weth9" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/capabilities_registry" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/shared/generated/burn_mint_erc677" +) + +var ( + RMNRemote deployment.ContractType = "RMNRemote" + LinkToken deployment.ContractType = "LinkToken" + ARMProxy deployment.ContractType = "ARMProxy" + WETH9 deployment.ContractType = "WETH9" + Router deployment.ContractType = "Router" + CommitStore deployment.ContractType = "CommitStore" + TokenAdminRegistry deployment.ContractType = "TokenAdminRegistry" + NonceManager deployment.ContractType = "NonceManager" + FeeQuoter deployment.ContractType = "FeeQuoter" + ManyChainMultisig deployment.ContractType = "ManyChainMultiSig" + CCIPConfig deployment.ContractType = "CCIPConfig" + RBACTimelock deployment.ContractType = "RBACTimelock" + OnRamp deployment.ContractType = "OnRamp" + OffRamp deployment.ContractType = "OffRamp" + CapabilitiesRegistry deployment.ContractType = "CapabilitiesRegistry" + PriceFeed deployment.ContractType = "PriceFeed" + // Note test router maps to a regular router contract. + TestRouter deployment.ContractType = "TestRouter" + CCIPReceiver deployment.ContractType = "CCIPReceiver" + + TestXXXMCMSSigner *ecdsa.PrivateKey +) + +func init() { + key, err := crypto.GenerateKey() + if err != nil { + panic(err) + } + TestXXXMCMSSigner = key +} + +type Contracts interface { + *capabilities_registry.CapabilitiesRegistry | + *rmn_proxy_contract.RMNProxyContract | + *ccip_config.CCIPConfig | + *nonce_manager.NonceManager | + *fee_quoter.FeeQuoter | + *router.Router | + *token_admin_registry.TokenAdminRegistry | + *weth9.WETH9 | + *rmn_remote.RMNRemote | + *owner_helpers.ManyChainMultiSig | + *owner_helpers.RBACTimelock | + *offramp.OffRamp | + *onramp.OnRamp | + *burn_mint_erc677.BurnMintERC677 | + *maybe_revert_message_receiver.MaybeRevertMessageReceiver | + *aggregator_v3_interface.AggregatorV3Interface +} + +type ContractDeploy[C Contracts] struct { + // We just keep all the deploy return values + // since some will be empty if there's an error. + Address common.Address + Contract C + Tx *types.Transaction + Tv deployment.TypeAndVersion + Err error +} + +// TODO: pull up to general deployment pkg somehow +// without exposing all product specific contracts? +func deployContract[C Contracts]( + lggr logger.Logger, + chain deployment.Chain, + addressBook deployment.AddressBook, + deploy func(chain deployment.Chain) ContractDeploy[C], +) (*ContractDeploy[C], error) { + contractDeploy := deploy(chain) + if contractDeploy.Err != nil { + lggr.Errorw("Failed to deploy contract", "err", contractDeploy.Err) + return nil, contractDeploy.Err + } + _, err := chain.Confirm(contractDeploy.Tx) + if err != nil { + lggr.Errorw("Failed to confirm deployment", "err", err) + return nil, err + } + err = addressBook.Save(chain.Selector, contractDeploy.Address.String(), contractDeploy.Tv) + if err != nil { + lggr.Errorw("Failed to save contract address", "err", err) + return nil, err + } + return &contractDeploy, nil +} + +type DeployCCIPContractConfig struct { + HomeChainSel uint64 + FeedChainSel uint64 + ChainsToDeploy []uint64 + TokenConfig TokenConfig + // Existing contracts which we want to skip deployment + // Leave empty if we want to deploy everything + // TODO: Add skips to deploy function. + CCIPOnChainState +} + +// TODO: Likely we'll want to further parameterize the deployment +// For example a list of contracts to skip deploying if they already exist. +// Or mock vs real RMN. +// Deployment produces an address book of everything it deployed. +func DeployCCIPContracts(e deployment.Environment, c DeployCCIPContractConfig) (deployment.AddressBook, error) { + var ab deployment.AddressBook = deployment.NewMemoryAddressBook() + nodes, err := deployment.NodeInfo(e.NodeIDs, e.Offchain) + if err != nil || len(nodes) == 0 { + e.Logger.Errorw("Failed to get node info", "err", err) + return ab, err + } + if c.Chains[c.HomeChainSel].CapabilityRegistry == nil { + return ab, fmt.Errorf("capability registry not found for home chain %d, needs to be deployed first", c.HomeChainSel) + } + cr, err := c.Chains[c.HomeChainSel].CapabilityRegistry.GetHashedCapabilityId( + &bind.CallOpts{}, CapabilityLabelledName, CapabilityVersion) + if err != nil { + e.Logger.Errorw("Failed to get hashed capability id", "err", err) + return ab, err + } + if cr != CCIPCapabilityID { + return ab, fmt.Errorf("Capability registry does not support CCIP %s %s", hexutil.Encode(cr[:]), hexutil.Encode(CCIPCapabilityID[:])) + } + // Signal to CR that our nodes support CCIP capability. + if err := AddNodes( + c.Chains[c.HomeChainSel].CapabilityRegistry, + e.Chains[c.HomeChainSel], + nodes.NonBootstraps().PeerIDs(), + ); err != nil { + return ab, err + } + + for _, chainSel := range c.ChainsToDeploy { + chain, ok := e.Chains[chainSel] + if !ok { + return ab, fmt.Errorf("Chain %d not found", chainSel) + } + ab, err = DeployChainContracts(e, chain, ab) + if err != nil { + return ab, err + } + chainAddresses, err := ab.AddressesForChain(chain.Selector) + if err != nil { + e.Logger.Errorw("Failed to get chain addresses", "err", err) + return ab, err + } + chainState, err := LoadChainState(chain, chainAddresses) + if err != nil { + e.Logger.Errorw("Failed to load chain state", "err", err) + return ab, err + } + + tokenInfo := c.TokenConfig.GetTokenInfo(e.Logger, chainState) + // TODO: Do we want to extract this? + // Add chain config for each chain. + _, err = AddChainConfig( + e.Logger, + e.Chains[c.HomeChainSel], + c.Chains[c.HomeChainSel].CCIPConfig, + chain.Selector, + nodes.NonBootstraps().PeerIDs()) + if err != nil { + return ab, err + } + + // For each chain, we create a DON on the home chain (2 OCR instances) + if err := AddDON( + e.Logger, + c.Chains[c.HomeChainSel].CapabilityRegistry, + c.Chains[c.HomeChainSel].CCIPConfig, + chainState.OffRamp, + c.FeedChainSel, + tokenInfo, + chain, + e.Chains[c.HomeChainSel], + nodes.NonBootstraps(), + ); err != nil { + e.Logger.Errorw("Failed to add DON", "err", err) + return ab, err + } + } + + return ab, nil +} + +func DeployChainContracts( + e deployment.Environment, + chain deployment.Chain, + ab deployment.AddressBook, +) (deployment.AddressBook, error) { + ccipReceiver, err := deployContract(e.Logger, chain, ab, + func(chain deployment.Chain) ContractDeploy[*maybe_revert_message_receiver.MaybeRevertMessageReceiver] { + receiverAddr, tx, receiver, err2 := maybe_revert_message_receiver.DeployMaybeRevertMessageReceiver( + chain.DeployerKey, + chain.Client, + false, + ) + return ContractDeploy[*maybe_revert_message_receiver.MaybeRevertMessageReceiver]{ + receiverAddr, receiver, tx, deployment.NewTypeAndVersion(CCIPReceiver, deployment.Version1_0_0), err2, + } + }) + if err != nil { + e.Logger.Errorw("Failed to deploy receiver", "err", err) + return ab, err + } + e.Logger.Infow("deployed receiver", "addr", ccipReceiver.Address) + + // TODO: Still waiting for RMNRemote/RMNHome contracts etc. + rmnRemote, err := deployContract(e.Logger, chain, ab, + func(chain deployment.Chain) ContractDeploy[*rmn_remote.RMNRemote] { + rmnRemoteAddr, tx, rmnRemote, err2 := rmn_remote.DeployRMNRemote( + chain.DeployerKey, + chain.Client, + chain.Selector, + ) + return ContractDeploy[*rmn_remote.RMNRemote]{ + rmnRemoteAddr, rmnRemote, tx, deployment.NewTypeAndVersion(RMNRemote, deployment.Version1_6_0_dev), err2, + } + }) + if err != nil { + e.Logger.Errorw("Failed to deploy RMNRemote", "err", err) + return ab, err + } + e.Logger.Infow("deployed RMNRemote", "addr", rmnRemote.Address) + + mcm, err := deployContract(e.Logger, chain, ab, + func(chain deployment.Chain) ContractDeploy[*owner_helpers.ManyChainMultiSig] { + mcmAddr, tx, mcm, err2 := owner_helpers.DeployManyChainMultiSig( + chain.DeployerKey, + chain.Client, + ) + return ContractDeploy[*owner_helpers.ManyChainMultiSig]{ + mcmAddr, mcm, tx, deployment.NewTypeAndVersion(ManyChainMultisig, deployment.Version1_0_0), err2, + } + }) + if err != nil { + e.Logger.Errorw("Failed to deploy mcm", "err", err) + return ab, err + } + // TODO: Parameterize this. + e.Logger.Infow("deployed mcm", "addr", mcm.Address) + publicKey := TestXXXMCMSSigner.Public().(*ecdsa.PublicKey) + // Convert the public key to an Ethereum address + address := crypto.PubkeyToAddress(*publicKey) + c, err := config.NewConfig(1, []common.Address{address}, []config.Config{}) + if err != nil { + e.Logger.Errorw("Failed to create config", "err", err) + return ab, err + } + groupQuorums, groupParents, signerAddresses, signerGroups := c.ExtractSetConfigInputs() + mcmsTx, err := mcm.Contract.SetConfig(chain.DeployerKey, + signerAddresses, + signerGroups, // Signer 1 is int group 0 (root group) with quorum 1. + groupQuorums, + groupParents, + false, + ) + if _, err := deployment.ConfirmIfNoError(chain, mcmsTx, err); err != nil { + e.Logger.Errorw("Failed to confirm mcm config", "err", err) + return ab, err + } + + timelock, err := deployContract(e.Logger, chain, ab, + func(chain deployment.Chain) ContractDeploy[*owner_helpers.RBACTimelock] { + timelock, tx, cc, err2 := owner_helpers.DeployRBACTimelock( + chain.DeployerKey, + chain.Client, + big.NewInt(0), // minDelay + mcm.Address, + // TODO: Actual MCM groups need to be parameterized. + []common.Address{mcm.Address}, // proposers + []common.Address{chain.DeployerKey.From}, //executors + []common.Address{mcm.Address}, // cancellers + []common.Address{mcm.Address}, // bypassers + ) + return ContractDeploy[*owner_helpers.RBACTimelock]{ + timelock, cc, tx, deployment.NewTypeAndVersion(RBACTimelock, deployment.Version1_0_0), err2, + } + }) + if err != nil { + e.Logger.Errorw("Failed to deploy timelock", "err", err) + return ab, err + } + e.Logger.Infow("deployed timelock", "addr", mcm.Address) + + rmnProxy, err := deployContract(e.Logger, chain, ab, + func(chain deployment.Chain) ContractDeploy[*rmn_proxy_contract.RMNProxyContract] { + rmnProxyAddr, tx, rmnProxy, err2 := rmn_proxy_contract.DeployRMNProxyContract( + chain.DeployerKey, + chain.Client, + rmnRemote.Address, + ) + return ContractDeploy[*rmn_proxy_contract.RMNProxyContract]{ + rmnProxyAddr, rmnProxy, tx, deployment.NewTypeAndVersion(ARMProxy, deployment.Version1_0_0), err2, + } + }) + if err != nil { + e.Logger.Errorw("Failed to deploy rmnProxy", "err", err) + return ab, err + } + e.Logger.Infow("deployed rmnProxy", "addr", rmnProxy.Address) + + // TODO: Need general configuration for using pre-existing weth9 + // link tokens. + weth9, err := deployContract(e.Logger, chain, ab, + func(chain deployment.Chain) ContractDeploy[*weth9.WETH9] { + weth9Addr, tx, weth9c, err2 := weth9.DeployWETH9( + chain.DeployerKey, + chain.Client, + ) + return ContractDeploy[*weth9.WETH9]{ + weth9Addr, weth9c, tx, deployment.NewTypeAndVersion(WETH9, deployment.Version1_0_0), err2, + } + }) + if err != nil { + e.Logger.Errorw("Failed to deploy weth9", "err", err) + return ab, err + } + + linkToken, err := deployContract(e.Logger, chain, ab, + func(chain deployment.Chain) ContractDeploy[*burn_mint_erc677.BurnMintERC677] { + linkTokenAddr, tx, linkToken, err2 := burn_mint_erc677.DeployBurnMintERC677( + chain.DeployerKey, + chain.Client, + "Link Token", + "LINK", + uint8(18), + big.NewInt(0).Mul(big.NewInt(1e9), big.NewInt(1e18)), + ) + return ContractDeploy[*burn_mint_erc677.BurnMintERC677]{ + linkTokenAddr, linkToken, tx, deployment.NewTypeAndVersion(LinkToken, deployment.Version1_0_0), err2, + } + }) + if err != nil { + e.Logger.Errorw("Failed to deploy linkToken", "err", err) + return ab, err + } + + routerContract, err := deployContract(e.Logger, chain, ab, + func(chain deployment.Chain) ContractDeploy[*router.Router] { + routerAddr, tx, routerC, err2 := router.DeployRouter( + chain.DeployerKey, + chain.Client, + weth9.Address, + rmnProxy.Address, + ) + return ContractDeploy[*router.Router]{ + routerAddr, routerC, tx, deployment.NewTypeAndVersion(Router, deployment.Version1_2_0), err2, + } + }) + if err != nil { + e.Logger.Errorw("Failed to deploy router", "err", err) + return ab, err + } + e.Logger.Infow("deployed router", "addr", routerContract) + + testRouterContract, err := deployContract(e.Logger, chain, ab, + func(chain deployment.Chain) ContractDeploy[*router.Router] { + routerAddr, tx, routerC, err2 := router.DeployRouter( + chain.DeployerKey, + chain.Client, + weth9.Address, + rmnProxy.Address, + ) + return ContractDeploy[*router.Router]{ + routerAddr, routerC, tx, deployment.NewTypeAndVersion(TestRouter, deployment.Version1_2_0), err2, + } + }) + if err != nil { + e.Logger.Errorw("Failed to deploy test router", "err", err) + return ab, err + } + e.Logger.Infow("deployed test router", "addr", testRouterContract.Address) + + tokenAdminRegistry, err := deployContract(e.Logger, chain, ab, + func(chain deployment.Chain) ContractDeploy[*token_admin_registry.TokenAdminRegistry] { + tokenAdminRegistryAddr, tx, tokenAdminRegistry, err2 := token_admin_registry.DeployTokenAdminRegistry( + chain.DeployerKey, + chain.Client) + return ContractDeploy[*token_admin_registry.TokenAdminRegistry]{ + tokenAdminRegistryAddr, tokenAdminRegistry, tx, deployment.NewTypeAndVersion(TokenAdminRegistry, deployment.Version1_5_0), err2, + } + }) + if err != nil { + e.Logger.Errorw("Failed to deploy token admin registry", "err", err) + return ab, err + } + e.Logger.Infow("deployed tokenAdminRegistry", "addr", tokenAdminRegistry) + + nonceManager, err := deployContract(e.Logger, chain, ab, + func(chain deployment.Chain) ContractDeploy[*nonce_manager.NonceManager] { + nonceManagerAddr, tx, nonceManager, err2 := nonce_manager.DeployNonceManager( + chain.DeployerKey, + chain.Client, + []common.Address{}, // Need to add onRamp after + ) + return ContractDeploy[*nonce_manager.NonceManager]{ + nonceManagerAddr, nonceManager, tx, deployment.NewTypeAndVersion(NonceManager, deployment.Version1_6_0_dev), err2, + } + }) + if err != nil { + e.Logger.Errorw("Failed to deploy router", "err", err) + return ab, err + } + + feeQuoter, err := deployContract(e.Logger, chain, ab, + func(chain deployment.Chain) ContractDeploy[*fee_quoter.FeeQuoter] { + prAddr, tx, pr, err2 := fee_quoter.DeployFeeQuoter( + chain.DeployerKey, + chain.Client, + fee_quoter.FeeQuoterStaticConfig{ + MaxFeeJuelsPerMsg: big.NewInt(0).Mul(big.NewInt(2e2), big.NewInt(1e18)), + LinkToken: linkToken.Address, + StalenessThreshold: uint32(24 * 60 * 60), + }, + []common.Address{timelock.Address}, // timelock should be able to update, ramps added after + []common.Address{weth9.Address, linkToken.Address}, // fee tokens + []fee_quoter.FeeQuoterTokenPriceFeedUpdate{}, + []fee_quoter.FeeQuoterTokenTransferFeeConfigArgs{}, // TODO: tokens + []fee_quoter.FeeQuoterPremiumMultiplierWeiPerEthArgs{ + { + PremiumMultiplierWeiPerEth: 9e17, // 0.9 ETH + Token: linkToken.Address, + }, + { + PremiumMultiplierWeiPerEth: 1e18, + Token: weth9.Address, + }, + }, + []fee_quoter.FeeQuoterDestChainConfigArgs{}, + ) + return ContractDeploy[*fee_quoter.FeeQuoter]{ + prAddr, pr, tx, deployment.NewTypeAndVersion(FeeQuoter, deployment.Version1_6_0_dev), err2, + } + }) + if err != nil { + e.Logger.Errorw("Failed to deploy fee quoter", "err", err) + return ab, err + } + + onRamp, err := deployContract(e.Logger, chain, ab, + func(chain deployment.Chain) ContractDeploy[*onramp.OnRamp] { + onRampAddr, tx, onRamp, err2 := onramp.DeployOnRamp( + chain.DeployerKey, + chain.Client, + onramp.OnRampStaticConfig{ + ChainSelector: chain.Selector, + Rmn: rmnProxy.Address, + NonceManager: nonceManager.Address, + TokenAdminRegistry: tokenAdminRegistry.Address, + }, + onramp.OnRampDynamicConfig{ + FeeQuoter: feeQuoter.Address, + FeeAggregator: common.HexToAddress("0x1"), // TODO real fee aggregator + }, + []onramp.OnRampDestChainConfigArgs{}, + ) + return ContractDeploy[*onramp.OnRamp]{ + onRampAddr, onRamp, tx, deployment.NewTypeAndVersion(OnRamp, deployment.Version1_6_0_dev), err2, + } + }) + if err != nil { + e.Logger.Errorw("Failed to deploy onramp", "err", err) + return ab, err + } + e.Logger.Infow("deployed onramp", "addr", onRamp.Address) + + offRamp, err := deployContract(e.Logger, chain, ab, + func(chain deployment.Chain) ContractDeploy[*offramp.OffRamp] { + offRampAddr, tx, offRamp, err2 := offramp.DeployOffRamp( + chain.DeployerKey, + chain.Client, + offramp.OffRampStaticConfig{ + ChainSelector: chain.Selector, + Rmn: rmnProxy.Address, + NonceManager: nonceManager.Address, + TokenAdminRegistry: tokenAdminRegistry.Address, + }, + offramp.OffRampDynamicConfig{ + FeeQuoter: feeQuoter.Address, + PermissionLessExecutionThresholdSeconds: uint32(86400), + MaxTokenTransferGas: uint32(200_000), + MaxPoolReleaseOrMintGas: uint32(200_000), + }, + []offramp.OffRampSourceChainConfigArgs{}, + ) + return ContractDeploy[*offramp.OffRamp]{ + offRampAddr, offRamp, tx, deployment.NewTypeAndVersion(OffRamp, deployment.Version1_6_0_dev), err2, + } + }) + if err != nil { + e.Logger.Errorw("Failed to deploy offramp", "err", err) + return ab, err + } + e.Logger.Infow("deployed offramp", "addr", offRamp) + + // Basic wiring is always needed. + tx, err := feeQuoter.Contract.ApplyAuthorizedCallerUpdates(chain.DeployerKey, fee_quoter.AuthorizedCallersAuthorizedCallerArgs{ + // TODO: We enable the deployer initially to set prices + // Should be removed after. + AddedCallers: []common.Address{offRamp.Contract.Address(), chain.DeployerKey.From}, + }) + if _, err := deployment.ConfirmIfNoError(chain, tx, err); err != nil { + e.Logger.Errorw("Failed to confirm fee quoter authorized caller update", "err", err) + return ab, err + } + + tx, err = nonceManager.Contract.ApplyAuthorizedCallerUpdates(chain.DeployerKey, nonce_manager.AuthorizedCallersAuthorizedCallerArgs{ + AddedCallers: []common.Address{offRamp.Contract.Address(), onRamp.Contract.Address()}, + }) + if _, err := deployment.ConfirmIfNoError(chain, tx, err); err != nil { + e.Logger.Errorw("Failed to update nonce manager with ramps", "err", err) + return ab, err + } + return ab, nil +} diff --git a/integration-tests/deployment/ccip/deploy_home_chain.go b/integration-tests/deployment/ccip/deploy_home_chain.go new file mode 100644 index 00000000000..5a625a1ef1c --- /dev/null +++ b/integration-tests/deployment/ccip/deploy_home_chain.go @@ -0,0 +1,444 @@ +package ccipdeployment + +import ( + "bytes" + "context" + "fmt" + "time" + + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/pkg/errors" + + "github.com/smartcontractkit/chainlink-ccip/chainconfig" + "github.com/smartcontractkit/chainlink-ccip/pluginconfig" + + commonconfig "github.com/smartcontractkit/chainlink-common/pkg/config" + "github.com/smartcontractkit/chainlink-common/pkg/logger" + "github.com/smartcontractkit/chainlink-common/pkg/types/ccipocr3" + + confighelper2 "github.com/smartcontractkit/libocr/offchainreporting2plus/confighelper" + "github.com/smartcontractkit/libocr/offchainreporting2plus/ocr3confighelper" + ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" + + "github.com/smartcontractkit/chainlink/integration-tests/deployment" + + cctypes "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/types" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/ccip_config" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/ocr3_config_encoder" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/offramp" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/capabilities_registry" +) + +const ( + NodeOperatorID = 1 + CapabilityLabelledName = "ccip" + CapabilityVersion = "v1.0.0" + + FirstBlockAge = 8 * time.Hour + RemoteGasPriceBatchWriteFrequency = 30 * time.Minute + TokenPriceBatchWriteFrequency = 30 * time.Minute + BatchGasLimit = 6_500_000 + RelativeBoostPerWaitHour = 1.5 + InflightCacheExpiry = 10 * time.Minute + RootSnoozeTime = 30 * time.Minute + BatchingStrategyID = 0 + DeltaProgress = 30 * time.Second + DeltaResend = 10 * time.Second + DeltaInitial = 20 * time.Second + DeltaRound = 2 * time.Second + DeltaGrace = 2 * time.Second + DeltaCertifiedCommitRequest = 10 * time.Second + DeltaStage = 10 * time.Second + Rmax = 3 + MaxDurationQuery = 50 * time.Millisecond + MaxDurationObservation = 5 * time.Second + MaxDurationShouldAcceptAttestedReport = 10 * time.Second + MaxDurationShouldTransmitAcceptedReport = 10 * time.Second +) + +var ( + CCIPCapabilityID = utils.Keccak256Fixed(MustABIEncode(`[{"type": "string"}, {"type": "string"}]`, CapabilityLabelledName, CapabilityVersion)) +) + +func MustABIEncode(abiString string, args ...interface{}) []byte { + encoded, err := utils.ABIEncode(abiString, args...) + if err != nil { + panic(err) + } + return encoded +} + +func DeployCapReg(lggr logger.Logger, chain deployment.Chain) (deployment.AddressBook, common.Address, error) { + ab := deployment.NewMemoryAddressBook() + capReg, err := deployContract(lggr, chain, ab, + func(chain deployment.Chain) ContractDeploy[*capabilities_registry.CapabilitiesRegistry] { + crAddr, tx, cr, err2 := capabilities_registry.DeployCapabilitiesRegistry( + chain.DeployerKey, + chain.Client, + ) + return ContractDeploy[*capabilities_registry.CapabilitiesRegistry]{ + Address: crAddr, Contract: cr, Tv: deployment.NewTypeAndVersion(CapabilitiesRegistry, deployment.Version1_0_0), Tx: tx, Err: err2, + } + }) + if err != nil { + lggr.Errorw("Failed to deploy capreg", "err", err) + return ab, common.Address{}, err + } + + lggr.Infow("deployed capreg", "addr", capReg.Address) + ccipConfig, err := deployContract( + lggr, chain, ab, + func(chain deployment.Chain) ContractDeploy[*ccip_config.CCIPConfig] { + ccAddr, tx, cc, err2 := ccip_config.DeployCCIPConfig( + chain.DeployerKey, + chain.Client, + capReg.Address, + ) + return ContractDeploy[*ccip_config.CCIPConfig]{ + Address: ccAddr, Tv: deployment.NewTypeAndVersion(CCIPConfig, deployment.Version1_6_0_dev), Tx: tx, Err: err2, Contract: cc, + } + }) + if err != nil { + lggr.Errorw("Failed to deploy ccip config", "err", err) + return ab, common.Address{}, err + } + lggr.Infow("deployed ccip config", "addr", ccipConfig.Address) + + tx, err := capReg.Contract.AddCapabilities(chain.DeployerKey, []capabilities_registry.CapabilitiesRegistryCapability{ + { + LabelledName: CapabilityLabelledName, + Version: CapabilityVersion, + CapabilityType: 2, // consensus. not used (?) + ResponseType: 0, // report. not used (?) + ConfigurationContract: ccipConfig.Address, + }, + }) + if _, err := deployment.ConfirmIfNoError(chain, tx, err); err != nil { + lggr.Errorw("Failed to add capabilities", "err", err) + return ab, common.Address{}, err + } + // TODO: Just one for testing. + tx, err = capReg.Contract.AddNodeOperators(chain.DeployerKey, []capabilities_registry.CapabilitiesRegistryNodeOperator{ + { + Admin: chain.DeployerKey.From, + Name: "NodeOperator", + }, + }) + if _, err := deployment.ConfirmIfNoError(chain, tx, err); err != nil { + lggr.Errorw("Failed to add node operators", "err", err) + return ab, common.Address{}, err + } + return ab, capReg.Address, nil +} + +func AddNodes( + capReg *capabilities_registry.CapabilitiesRegistry, + chain deployment.Chain, + p2pIDs [][32]byte, +) error { + var nodeParams []capabilities_registry.CapabilitiesRegistryNodeParams + for _, p2pID := range p2pIDs { + // if any p2pIDs are empty throw error + if bytes.Equal(p2pID[:], make([]byte, 32)) { + return errors.Wrapf(errors.New("empty p2pID"), "p2pID: %x selector: %d", p2pID, chain.Selector) + } + nodeParam := capabilities_registry.CapabilitiesRegistryNodeParams{ + NodeOperatorId: NodeOperatorID, + Signer: p2pID, // Not used in tests + P2pId: p2pID, + HashedCapabilityIds: [][32]byte{CCIPCapabilityID}, + } + nodeParams = append(nodeParams, nodeParam) + } + tx, err := capReg.AddNodes(chain.DeployerKey, nodeParams) + if err != nil { + return err + } + _, err = chain.Confirm(tx) + return err +} + +func SetupConfigInfo(chainSelector uint64, readers [][32]byte, fChain uint8, cfg []byte) ccip_config.CCIPConfigTypesChainConfigInfo { + return ccip_config.CCIPConfigTypesChainConfigInfo{ + ChainSelector: chainSelector, + ChainConfig: ccip_config.CCIPConfigTypesChainConfig{ + Readers: readers, + FChain: fChain, + Config: cfg, + }, + } +} + +func AddChainConfig( + lggr logger.Logger, + h deployment.Chain, + ccipConfig *ccip_config.CCIPConfig, + chainSelector uint64, + p2pIDs [][32]byte, +) (ccip_config.CCIPConfigTypesChainConfigInfo, error) { + // First Add ChainConfig that includes all p2pIDs as readers + encodedExtraChainConfig, err := chainconfig.EncodeChainConfig(chainconfig.ChainConfig{ + GasPriceDeviationPPB: ccipocr3.NewBigIntFromInt64(1000), + DAGasPriceDeviationPPB: ccipocr3.NewBigIntFromInt64(0), + OptimisticConfirmations: 1, + }) + if err != nil { + return ccip_config.CCIPConfigTypesChainConfigInfo{}, err + } + chainConfig := SetupConfigInfo(chainSelector, p2pIDs, uint8(len(p2pIDs)/3), encodedExtraChainConfig) + tx, err := ccipConfig.ApplyChainConfigUpdates(h.DeployerKey, nil, []ccip_config.CCIPConfigTypesChainConfigInfo{ + chainConfig, + }) + if _, err := deployment.ConfirmIfNoError(h, tx, err); err != nil { + return ccip_config.CCIPConfigTypesChainConfigInfo{}, err + } + lggr.Infow("Applied chain config updates", "chainConfig", chainConfig) + return chainConfig, nil +} + +func BuildAddDONArgs( + lggr logger.Logger, + offRamp *offramp.OffRamp, + dest deployment.Chain, + feedChainSel uint64, + // Token address on Dest chain to aggregate address on feed chain + tokenInfo map[ocrtypes.Account]pluginconfig.TokenInfo, + nodes deployment.Nodes, +) ([]byte, error) { + p2pIDs := nodes.PeerIDs() + // Get OCR3 Config from helper + var schedule []int + var oracles []confighelper2.OracleIdentityExtra + for _, node := range nodes { + schedule = append(schedule, 1) + cfg := node.SelToOCRConfig[dest.Selector] + oracles = append(oracles, confighelper2.OracleIdentityExtra{ + OracleIdentity: confighelper2.OracleIdentity{ + OnchainPublicKey: cfg.OnchainPublicKey, + TransmitAccount: cfg.TransmitAccount, + OffchainPublicKey: cfg.OffchainPublicKey, + PeerID: cfg.PeerID.String()[4:], + }, ConfigEncryptionPublicKey: cfg.ConfigEncryptionPublicKey, + }) + } + + tabi, err := ocr3_config_encoder.IOCR3ConfigEncoderMetaData.GetAbi() + if err != nil { + return nil, err + } + + // Add DON on capability registry contract + var ocr3Configs []ocr3_config_encoder.CCIPConfigTypesOCR3Config + for _, pluginType := range []cctypes.PluginType{cctypes.PluginTypeCCIPCommit, cctypes.PluginTypeCCIPExec} { + var encodedOffchainConfig []byte + var err2 error + if pluginType == cctypes.PluginTypeCCIPCommit { + encodedOffchainConfig, err2 = pluginconfig.EncodeCommitOffchainConfig(pluginconfig.CommitOffchainConfig{ + RemoteGasPriceBatchWriteFrequency: *commonconfig.MustNewDuration(RemoteGasPriceBatchWriteFrequency), + TokenPriceBatchWriteFrequency: *commonconfig.MustNewDuration(TokenPriceBatchWriteFrequency), + PriceFeedChainSelector: ccipocr3.ChainSelector(feedChainSel), + TokenInfo: tokenInfo, + }) + } else { + encodedOffchainConfig, err2 = pluginconfig.EncodeExecuteOffchainConfig(pluginconfig.ExecuteOffchainConfig{ + BatchGasLimit: BatchGasLimit, + RelativeBoostPerWaitHour: RelativeBoostPerWaitHour, + MessageVisibilityInterval: *commonconfig.MustNewDuration(FirstBlockAge), + InflightCacheExpiry: *commonconfig.MustNewDuration(InflightCacheExpiry), + RootSnoozeTime: *commonconfig.MustNewDuration(RootSnoozeTime), + BatchingStrategyID: BatchingStrategyID, + }) + } + if err2 != nil { + return nil, err2 + } + signers, transmitters, configF, _, offchainConfigVersion, offchainConfig, err2 := ocr3confighelper.ContractSetConfigArgsForTests( + DeltaProgress, + DeltaResend, + DeltaInitial, + DeltaRound, + DeltaGrace, + DeltaCertifiedCommitRequest, + DeltaStage, + Rmax, + schedule, + oracles, + encodedOffchainConfig, + MaxDurationQuery, + MaxDurationObservation, + MaxDurationShouldAcceptAttestedReport, + MaxDurationShouldTransmitAcceptedReport, + int(nodes.DefaultF()), + []byte{}, // empty OnChainConfig + ) + if err2 != nil { + return nil, err2 + } + + signersBytes := make([][]byte, len(signers)) + for i, signer := range signers { + signersBytes[i] = signer + } + + transmittersBytes := make([][]byte, len(transmitters)) + for i, transmitter := range transmitters { + parsed, err2 := common.ParseHexOrString(string(transmitter)) + if err2 != nil { + return nil, err2 + } + transmittersBytes[i] = parsed + } + + ocr3Configs = append(ocr3Configs, ocr3_config_encoder.CCIPConfigTypesOCR3Config{ + PluginType: uint8(pluginType), + ChainSelector: dest.Selector, + F: configF, + OffchainConfigVersion: offchainConfigVersion, + OfframpAddress: offRamp.Address().Bytes(), + P2pIds: p2pIDs, + Signers: signersBytes, + Transmitters: transmittersBytes, + OffchainConfig: offchainConfig, + }) + } + + // TODO: Can just use utils.ABIEncode directly here. + encodedCall, err := tabi.Pack("exposeOCR3Config", ocr3Configs) + if err != nil { + return nil, err + } + + // Trim first four bytes to remove function selector. + encodedConfigs := encodedCall[4:] + return encodedConfigs, nil +} + +func LatestCCIPDON(registry *capabilities_registry.CapabilitiesRegistry) (*capabilities_registry.CapabilitiesRegistryDONInfo, error) { + dons, err := registry.GetDONs(nil) + if err != nil { + return nil, err + } + var ccipDON capabilities_registry.CapabilitiesRegistryDONInfo + for _, don := range dons { + if len(don.CapabilityConfigurations) == 1 && + don.CapabilityConfigurations[0].CapabilityId == CCIPCapabilityID && + don.Id > ccipDON.Id { + ccipDON = don + } + } + return &ccipDON, nil +} + +func BuildSetOCR3ConfigArgs( + donID uint32, + ccipConfig *ccip_config.CCIPConfig, +) ([]offramp.MultiOCR3BaseOCRConfigArgs, error) { + var offrampOCR3Configs []offramp.MultiOCR3BaseOCRConfigArgs + for _, pluginType := range []cctypes.PluginType{cctypes.PluginTypeCCIPCommit, cctypes.PluginTypeCCIPExec} { + ocrConfig, err2 := ccipConfig.GetOCRConfig(&bind.CallOpts{ + Context: context.Background(), + }, donID, uint8(pluginType)) + if err2 != nil { + return nil, err2 + } + if len(ocrConfig) != 1 { + return nil, errors.New("expected exactly one OCR3 config") + } + var signerAddresses []common.Address + for _, signer := range ocrConfig[0].Config.Signers { + signerAddresses = append(signerAddresses, common.BytesToAddress(signer)) + } + + var transmitterAddresses []common.Address + for _, transmitter := range ocrConfig[0].Config.Transmitters { + transmitterAddresses = append(transmitterAddresses, common.BytesToAddress(transmitter)) + } + + offrampOCR3Configs = append(offrampOCR3Configs, offramp.MultiOCR3BaseOCRConfigArgs{ + ConfigDigest: ocrConfig[0].ConfigDigest, + OcrPluginType: uint8(pluginType), + F: ocrConfig[0].Config.F, + IsSignatureVerificationEnabled: pluginType == cctypes.PluginTypeCCIPCommit, + Signers: signerAddresses, + Transmitters: transmitterAddresses, + }) + } + return offrampOCR3Configs, nil +} + +func AddDON( + lggr logger.Logger, + capReg *capabilities_registry.CapabilitiesRegistry, + ccipConfig *ccip_config.CCIPConfig, + offRamp *offramp.OffRamp, + feedChainSel uint64, + // Token address on Dest chain to aggregate address on feed chain + tokenInfo map[ocrtypes.Account]pluginconfig.TokenInfo, + dest deployment.Chain, + home deployment.Chain, + nodes deployment.Nodes, +) error { + encodedConfigs, err := BuildAddDONArgs(lggr, offRamp, dest, feedChainSel, tokenInfo, nodes) + if err != nil { + return err + } + tx, err := capReg.AddDON(home.DeployerKey, nodes.PeerIDs(), []capabilities_registry.CapabilitiesRegistryCapabilityConfiguration{ + { + CapabilityId: CCIPCapabilityID, + Config: encodedConfigs, + }, + }, false, false, nodes.DefaultF()) + if _, err := deployment.ConfirmIfNoError(home, tx, err); err != nil { + return err + } + don, err := LatestCCIPDON(capReg) + if err != nil { + return err + } + offrampOCR3Configs, err := BuildSetOCR3ConfigArgs(don.Id, ccipConfig) + if err != nil { + return err + } + + tx, err = offRamp.SetOCR3Configs(dest.DeployerKey, offrampOCR3Configs) + if _, err := deployment.ConfirmIfNoError(dest, tx, err); err != nil { + return err + } + + for _, pluginType := range []cctypes.PluginType{cctypes.PluginTypeCCIPCommit, cctypes.PluginTypeCCIPExec} { + ocrConfig, err := offRamp.LatestConfigDetails(&bind.CallOpts{ + Context: context.Background(), + }, uint8(pluginType)) + if err != nil { + return err + } + // TODO: assertions to be done as part of full state + // resprentation validation CCIP-3047 + if offrampOCR3Configs[pluginType].ConfigDigest != ocrConfig.ConfigInfo.ConfigDigest { + return fmt.Errorf("%s OCR3 config digest mismatch", pluginType.String()) + } + if offrampOCR3Configs[pluginType].F != ocrConfig.ConfigInfo.F { + return fmt.Errorf("%s OCR3 config F mismatch", pluginType.String()) + } + if offrampOCR3Configs[pluginType].IsSignatureVerificationEnabled != ocrConfig.ConfigInfo.IsSignatureVerificationEnabled { + return fmt.Errorf("%s OCR3 config signature verification mismatch", pluginType.String()) + } + if pluginType == cctypes.PluginTypeCCIPCommit { + // only commit will set signers, exec doesn't need them. + for i, signer := range offrampOCR3Configs[pluginType].Signers { + if !bytes.Equal(signer.Bytes(), ocrConfig.Signers[i].Bytes()) { + return fmt.Errorf("%s OCR3 config signer mismatch", pluginType.String()) + } + } + } + for i, transmitter := range offrampOCR3Configs[pluginType].Transmitters { + if !bytes.Equal(transmitter.Bytes(), ocrConfig.Transmitters[i].Bytes()) { + return fmt.Errorf("%s OCR3 config transmitter mismatch", pluginType.String()) + } + } + } + + return nil +} diff --git a/integration-tests/deployment/ccip/deploy_test.go b/integration-tests/deployment/ccip/deploy_test.go new file mode 100644 index 00000000000..a278f29842e --- /dev/null +++ b/integration-tests/deployment/ccip/deploy_test.go @@ -0,0 +1,76 @@ +package ccipdeployment + +import ( + "encoding/json" + "fmt" + "testing" + + "github.com/stretchr/testify/require" + "go.uber.org/zap/zapcore" + + "github.com/smartcontractkit/chainlink/integration-tests/deployment/memory" + + "github.com/smartcontractkit/chainlink/v2/core/logger" +) + +func TestDeployCCIPContracts(t *testing.T) { + lggr := logger.TestLogger(t) + e := memory.NewMemoryEnvironment(t, lggr, zapcore.InfoLevel, memory.MemoryEnvironmentConfig{ + Bootstraps: 1, + Chains: 2, + Nodes: 4, + }) + // Deploy all the CCIP contracts. + homeChain := e.AllChainSelectors()[HomeChainIndex] + addressBook, _, err := DeployCapReg(lggr, e.Chains[homeChain]) + require.NoError(t, err) + s, err := LoadOnchainState(e, addressBook) + require.NoError(t, err) + + feedChain := e.AllChainSelectors()[FeedChainIndex] + feedAddresses, _, err := DeployFeeds(lggr, e.Chains[feedChain]) + require.NoError(t, err) + + // Merge the feed addresses into the address book. + require.NoError(t, addressBook.Merge(feedAddresses)) + + // Load the state after deploying the cap reg and feeds. + homeAndFeedStates, err := LoadOnchainState(e, addressBook) + require.NoError(t, err) + require.NotNil(t, s.Chains[homeChain].CapabilityRegistry) + require.NotNil(t, s.Chains[homeChain].CCIPConfig) + require.NotNil(t, homeAndFeedStates.Chains[feedChain].USDFeeds) + + ab, err := DeployCCIPContracts(e, DeployCCIPContractConfig{ + HomeChainSel: homeChain, + FeedChainSel: feedChain, + ChainsToDeploy: e.AllChainSelectors(), + TokenConfig: NewTokenConfig(), + CCIPOnChainState: homeAndFeedStates, + }) + require.NoError(t, err) + state, err := LoadOnchainState(e, ab) + require.NoError(t, err) + snap, err := state.View(e.AllChainSelectors()) + require.NoError(t, err) + + // Assert expect every deployed address to be in the address book. + // TODO (CCIP-3047): Add the rest of CCIPv2 representation + b, err := json.MarshalIndent(snap, "", " ") + require.NoError(t, err) + fmt.Println(string(b)) +} + +func TestJobSpecGeneration(t *testing.T) { + lggr := logger.TestLogger(t) + e := memory.NewMemoryEnvironment(t, lggr, zapcore.InfoLevel, memory.MemoryEnvironmentConfig{ + Chains: 1, + Nodes: 1, + }) + js, err := NewCCIPJobSpecs(e.NodeIDs, e.Offchain) + require.NoError(t, err) + for node, jb := range js { + fmt.Println(node, jb) + } + // TODO: Add job assertions +} diff --git a/integration-tests/deployment/ccip/jobs.go b/integration-tests/deployment/ccip/jobs.go new file mode 100644 index 00000000000..49fb1e95422 --- /dev/null +++ b/integration-tests/deployment/ccip/jobs.go @@ -0,0 +1,57 @@ +package ccipdeployment + +import ( + "github.com/smartcontractkit/chainlink/integration-tests/deployment" + "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/validate" + "github.com/smartcontractkit/chainlink/v2/core/services/relay" +) + +// In our case, the only address needed is the cap registry which is actually an env var. +// and will pre-exist for our deployment. So the job specs only depend on the environment operators. +func NewCCIPJobSpecs(nodeIds []string, oc deployment.OffchainClient) (map[string][]string, error) { + nodes, err := deployment.NodeInfo(nodeIds, oc) + if err != nil { + return nil, err + } + // Generate a set of brand new job specs for CCIP for a specific environment + // (including NOPs) and new addresses. + // We want to assign one CCIP capability job to each node. And node with + // an addr we'll list as bootstrapper. + // Find the bootstrap nodes + + nodesToJobSpecs := make(map[string][]string) + for _, node := range nodes { + var spec string + var err error + if !node.IsBootstrap { + spec, err = validate.NewCCIPSpecToml(validate.SpecArgs{ + P2PV2Bootstrappers: nodes.BootstrapLocators(), + CapabilityVersion: CapabilityVersion, + CapabilityLabelledName: CapabilityLabelledName, + OCRKeyBundleIDs: map[string]string{ + // TODO: Validate that that all EVM chains are using the same keybundle. + relay.NetworkEVM: node.FirstOCRKeybundle().KeyBundleID, + }, + P2PKeyID: node.PeerID.String(), + RelayConfigs: nil, + PluginConfig: map[string]any{}, + }) + } else { + spec, err = validate.NewCCIPSpecToml(validate.SpecArgs{ + P2PV2Bootstrappers: []string{}, // Intentionally empty for bootstraps. + CapabilityVersion: CapabilityVersion, + CapabilityLabelledName: CapabilityLabelledName, + OCRKeyBundleIDs: map[string]string{}, + // TODO: validate that all EVM chains are using the same keybundle + P2PKeyID: node.PeerID.String(), + RelayConfigs: nil, + PluginConfig: map[string]any{}, + }) + } + if err != nil { + return nil, err + } + nodesToJobSpecs[node.NodeID] = append(nodesToJobSpecs[node.NodeID], spec) + } + return nodesToJobSpecs, nil +} diff --git a/integration-tests/deployment/ccip/propose.go b/integration-tests/deployment/ccip/propose.go new file mode 100644 index 00000000000..df4fe90a76a --- /dev/null +++ b/integration-tests/deployment/ccip/propose.go @@ -0,0 +1,188 @@ +package ccipdeployment + +import ( + "bytes" + "context" + "math/big" + "testing" + + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/crypto" + owner_helpers "github.com/smartcontractkit/ccip-owner-contracts/pkg/gethwrappers" + "github.com/smartcontractkit/ccip-owner-contracts/pkg/proposal/mcms" + "github.com/smartcontractkit/ccip-owner-contracts/pkg/proposal/timelock" + chainsel "github.com/smartcontractkit/chain-selectors" + "github.com/stretchr/testify/require" + + "github.com/smartcontractkit/chainlink/integration-tests/deployment" +) + +// TODO: Pull up to deploy +func SimTransactOpts() *bind.TransactOpts { + return &bind.TransactOpts{Signer: func(address common.Address, transaction *types.Transaction) (*types.Transaction, error) { + return transaction, nil + }, From: common.HexToAddress("0x0"), NoSend: true, GasLimit: 1_000_000} +} + +func SignProposal(t *testing.T, env deployment.Environment, proposal *timelock.MCMSWithTimelockProposal) *mcms.Executor { + executorClients := make(map[mcms.ChainIdentifier]mcms.ContractDeployBackend) + for _, chain := range env.Chains { + chainselc, exists := chainsel.ChainBySelector(chain.Selector) + require.True(t, exists) + chainSel := mcms.ChainIdentifier(chainselc.Selector) + executorClients[chainSel] = chain.Client + } + executor, err := proposal.ToExecutor(true) + require.NoError(t, err) + payload, err := executor.SigningHash() + require.NoError(t, err) + // Sign the payload + sig, err := crypto.Sign(payload.Bytes(), TestXXXMCMSSigner) + require.NoError(t, err) + mcmSig, err := mcms.NewSignatureFromBytes(sig) + require.NoError(t, err) + executor.Proposal.AddSignature(mcmSig) + require.NoError(t, executor.Proposal.Validate()) + return executor +} + +func ExecuteProposal(t *testing.T, env deployment.Environment, executor *mcms.Executor, + state CCIPOnChainState, sel uint64) { + // Set the root. + tx, err2 := executor.SetRootOnChain(env.Chains[sel].Client, env.Chains[sel].DeployerKey, mcms.ChainIdentifier(sel)) + require.NoError(t, err2) + _, err2 = env.Chains[sel].Confirm(tx) + require.NoError(t, err2) + + // TODO: This sort of helper probably should move to the MCMS lib. + // Execute all the transactions in the proposal which are for this chain. + for _, chainOp := range executor.Operations[mcms.ChainIdentifier(sel)] { + for idx, op := range executor.ChainAgnosticOps { + if bytes.Equal(op.Data, chainOp.Data) && op.To == chainOp.To { + opTx, err3 := executor.ExecuteOnChain(env.Chains[sel].Client, env.Chains[sel].DeployerKey, idx) + require.NoError(t, err3) + block, err3 := env.Chains[sel].Confirm(opTx) + require.NoError(t, err3) + t.Log("executed", chainOp) + it, err3 := state.Chains[sel].Timelock.FilterCallScheduled(&bind.FilterOpts{ + Start: block, + End: &block, + Context: context.Background(), + }, nil, nil) + require.NoError(t, err3) + var calls []owner_helpers.RBACTimelockCall + var pred, salt [32]byte + for it.Next() { + // Note these are the same for the whole batch, can overwrite + pred = it.Event.Predecessor + salt = it.Event.Salt + t.Log("scheduled", it.Event) + calls = append(calls, owner_helpers.RBACTimelockCall{ + Target: it.Event.Target, + Data: it.Event.Data, + Value: it.Event.Value, + }) + } + tx, err := state.Chains[sel].Timelock.ExecuteBatch( + env.Chains[sel].DeployerKey, calls, pred, salt) + require.NoError(t, err) + _, err = env.Chains[sel].Confirm(tx) + require.NoError(t, err) + } + } + } +} + +func GenerateAcceptOwnershipProposal( + state CCIPOnChainState, + homeChain uint64, + chains []uint64, +) (*timelock.MCMSWithTimelockProposal, error) { + // TODO: Accept rest of contracts + var batches []timelock.BatchChainOperation + metaDataPerChain := make(map[mcms.ChainIdentifier]mcms.ChainMetadata) + timelockAddresses := make(map[mcms.ChainIdentifier]common.Address) + for _, sel := range chains { + chain, _ := chainsel.ChainBySelector(sel) + acceptOnRamp, err := state.Chains[sel].OnRamp.AcceptOwnership(SimTransactOpts()) + if err != nil { + return nil, err + } + acceptFeeQuoter, err := state.Chains[sel].FeeQuoter.AcceptOwnership(SimTransactOpts()) + if err != nil { + return nil, err + } + chainSel := mcms.ChainIdentifier(chain.Selector) + opCount, err := state.Chains[sel].Mcm.GetOpCount(nil) + if err != nil { + return nil, err + } + metaDataPerChain[chainSel] = mcms.ChainMetadata{ + MCMAddress: state.Chains[sel].Mcm.Address(), + StartingOpCount: opCount.Uint64(), + } + timelockAddresses[chainSel] = state.Chains[sel].Timelock.Address() + batches = append(batches, timelock.BatchChainOperation{ + ChainIdentifier: chainSel, + Batch: []mcms.Operation{ + { + To: state.Chains[sel].OnRamp.Address(), + Data: acceptOnRamp.Data(), + Value: big.NewInt(0), + }, + { + To: state.Chains[sel].FeeQuoter.Address(), + Data: acceptFeeQuoter.Data(), + Value: big.NewInt(0), + }, + }, + }) + } + + acceptCR, err := state.Chains[homeChain].CapabilityRegistry.AcceptOwnership(SimTransactOpts()) + if err != nil { + return nil, err + } + acceptCCIPConfig, err := state.Chains[homeChain].CCIPConfig.AcceptOwnership(SimTransactOpts()) + if err != nil { + return nil, err + } + homeChainID := mcms.ChainIdentifier(homeChain) + opCount, err := state.Chains[homeChain].Mcm.GetOpCount(nil) + if err != nil { + return nil, err + } + metaDataPerChain[homeChainID] = mcms.ChainMetadata{ + StartingOpCount: opCount.Uint64(), + MCMAddress: state.Chains[homeChain].Mcm.Address(), + } + timelockAddresses[homeChainID] = state.Chains[homeChain].Timelock.Address() + batches = append(batches, timelock.BatchChainOperation{ + ChainIdentifier: homeChainID, + Batch: []mcms.Operation{ + { + To: state.Chains[homeChain].CapabilityRegistry.Address(), + Data: acceptCR.Data(), + Value: big.NewInt(0), + }, + { + To: state.Chains[homeChain].CCIPConfig.Address(), + Data: acceptCCIPConfig.Data(), + Value: big.NewInt(0), + }, + }, + }) + + return timelock.NewMCMSWithTimelockProposal( + "1", + 2004259681, // TODO + []mcms.Signature{}, + false, + metaDataPerChain, + timelockAddresses, + "blah", // TODO + batches, + timelock.Schedule, "0s") +} diff --git a/integration-tests/deployment/ccip/state.go b/integration-tests/deployment/ccip/state.go new file mode 100644 index 00000000000..6b894d93b0e --- /dev/null +++ b/integration-tests/deployment/ccip/state.go @@ -0,0 +1,349 @@ +package ccipdeployment + +import ( + "fmt" + + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/pkg/errors" + chainsel "github.com/smartcontractkit/chain-selectors" + + "github.com/smartcontractkit/chainlink/integration-tests/deployment" + "github.com/smartcontractkit/chainlink/integration-tests/deployment/ccip/view/v1_0" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/commit_store" + + "github.com/smartcontractkit/chainlink/integration-tests/deployment/ccip/view" + "github.com/smartcontractkit/chainlink/integration-tests/deployment/ccip/view/v1_2" + "github.com/smartcontractkit/chainlink/integration-tests/deployment/ccip/view/v1_5" + "github.com/smartcontractkit/chainlink/integration-tests/deployment/ccip/view/v1_6" + + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/ccip_config" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/fee_quoter" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/maybe_revert_message_receiver" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/capabilities_registry" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/shared/generated/burn_mint_erc677" + + owner_wrappers "github.com/smartcontractkit/ccip-owner-contracts/pkg/gethwrappers" + + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/nonce_manager" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/offramp" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/onramp" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/rmn_proxy_contract" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/rmn_remote" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/router" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/token_admin_registry" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/weth9" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/aggregator_v3_interface" +) + +// CCIPChainState holds a Go binding for all the currently deployed CCIP contracts +// on a chain. If a binding is nil, it means here is no such contract on the chain. +type CCIPChainState struct { + OnRamp *onramp.OnRamp + OffRamp *offramp.OffRamp + FeeQuoter *fee_quoter.FeeQuoter + RMNProxy *rmn_proxy_contract.RMNProxyContract + NonceManager *nonce_manager.NonceManager + TokenAdminRegistry *token_admin_registry.TokenAdminRegistry + Router *router.Router + CommitStore *commit_store.CommitStore + Weth9 *weth9.WETH9 + RMNRemote *rmn_remote.RMNRemote + // TODO: May need to support older link too + LinkToken *burn_mint_erc677.BurnMintERC677 + // Map between token Descriptor (e.g. LinkSymbol, WethSymbol) + // and the respective token contract + // This is more of an illustration of how we'll have tokens, and it might need some work later to work properly. + // Not all tokens will be burn and mint tokens. + BurnMintTokens677 map[TokenSymbol]*burn_mint_erc677.BurnMintERC677 + // Map between token Symbol (e.g. LinkSymbol, WethSymbol) + // and the respective aggregator USD feed contract + USDFeeds map[TokenSymbol]*aggregator_v3_interface.AggregatorV3Interface + + // Note we only expect one of these (on the home chain) + CapabilityRegistry *capabilities_registry.CapabilitiesRegistry + CCIPConfig *ccip_config.CCIPConfig + Mcm *owner_wrappers.ManyChainMultiSig + Timelock *owner_wrappers.RBACTimelock + + // Test contracts + Receiver *maybe_revert_message_receiver.MaybeRevertMessageReceiver + TestRouter *router.Router +} + +func (c CCIPChainState) GenerateView() (view.ChainView, error) { + chainView := view.NewChain() + if c.Router != nil { + routerView, err := v1_2.GenerateRouterView(c.Router) + if err != nil { + return chainView, err + } + chainView.Router[c.Router.Address().Hex()] = routerView + } + if c.TokenAdminRegistry != nil { + taView, err := v1_5.GenerateTokenAdminRegistryView(c.TokenAdminRegistry) + if err != nil { + return chainView, err + } + chainView.TokenAdminRegistry[c.TokenAdminRegistry.Address().Hex()] = taView + } + if c.NonceManager != nil { + nmView, err := v1_6.GenerateNonceManagerView(c.NonceManager) + if err != nil { + return chainView, err + } + chainView.NonceManager[c.NonceManager.Address().Hex()] = nmView + } + if c.RMNRemote != nil { + rmnView, err := v1_6.GenerateRMNRemoteView(c.RMNRemote) + if err != nil { + return chainView, err + } + chainView.RMN[c.RMNRemote.Address().Hex()] = rmnView + } + if c.FeeQuoter != nil && c.Router != nil && c.TokenAdminRegistry != nil { + fqView, err := v1_6.GenerateFeeQuoterView(c.FeeQuoter, c.Router, c.TokenAdminRegistry) + if err != nil { + return chainView, err + } + chainView.FeeQuoter[c.FeeQuoter.Address().Hex()] = fqView + } + + if c.OnRamp != nil && c.Router != nil && c.TokenAdminRegistry != nil { + onRampView, err := v1_6.GenerateOnRampView( + c.OnRamp, + c.Router, + c.TokenAdminRegistry, + ) + if err != nil { + return chainView, err + } + chainView.OnRamp[c.OnRamp.Address().Hex()] = onRampView + } + + if c.OffRamp != nil && c.Router != nil { + offRampView, err := v1_6.GenerateOffRampView( + c.OffRamp, + c.Router, + ) + if err != nil { + return chainView, err + } + chainView.OffRamp[c.OffRamp.Address().Hex()] = offRampView + } + + if c.CommitStore != nil { + commitStoreView, err := v1_5.GenerateCommitStoreView(c.CommitStore) + if err != nil { + return chainView, err + } + chainView.CommitStore[c.CommitStore.Address().Hex()] = commitStoreView + } + + if c.RMNProxy != nil { + rmnProxyView, err := v1_0.GenerateRMNProxyView(c.RMNProxy) + if err != nil { + return chainView, err + } + chainView.RMNProxy[c.RMNProxy.Address().Hex()] = rmnProxyView + } + return chainView, nil +} + +// Onchain state always derivable from an address book. +// Offchain state always derivable from a list of nodeIds. +// Note can translate this into Go struct needed for MCMS/Docs/UI. +type CCIPOnChainState struct { + // Populated go bindings for the appropriate version for all contracts. + // We would hold 2 versions of each contract here. Once we upgrade we can phase out the old one. + // When generating bindings, make sure the package name corresponds to the version. + Chains map[uint64]CCIPChainState +} + +func (s CCIPOnChainState) View(chains []uint64) (view.CCIPView, error) { + ccipView := view.NewCCIPView() + for _, chainSelector := range chains { + // TODO: Need a utility for this + chainid, err := chainsel.ChainIdFromSelector(chainSelector) + if err != nil { + return ccipView, err + } + chainName, err := chainsel.NameFromChainId(chainid) + if err != nil { + return ccipView, err + } + if _, ok := s.Chains[chainSelector]; !ok { + return ccipView, fmt.Errorf("chain not supported %d", chainSelector) + } + chainState := s.Chains[chainSelector] + chainView, err := chainState.GenerateView() + if err != nil { + return ccipView, err + } + ccipView.Chains[chainName] = chainView + } + return ccipView, nil +} + +func StateView(e deployment.Environment, ab deployment.AddressBook) (view.CCIPView, error) { + state, err := LoadOnchainState(e, ab) + if err != nil { + return view.CCIPView{}, err + } + return state.View(e.AllChainSelectors()) +} + +func LoadOnchainState(e deployment.Environment, ab deployment.AddressBook) (CCIPOnChainState, error) { + state := CCIPOnChainState{ + Chains: make(map[uint64]CCIPChainState), + } + for chainSelector, chain := range e.Chains { + addresses, err := ab.AddressesForChain(chainSelector) + if err != nil { + // Chain not found in address book, initialize empty + if errors.Is(err, deployment.ErrChainNotFound) { + addresses = make(map[string]deployment.TypeAndVersion) + } else { + return state, err + } + } + chainState, err := LoadChainState(chain, addresses) + if err != nil { + return state, err + } + state.Chains[chainSelector] = chainState + } + return state, nil +} + +// LoadChainState Loads all state for a chain into state +// Modifies map in place +func LoadChainState(chain deployment.Chain, addresses map[string]deployment.TypeAndVersion) (CCIPChainState, error) { + var state CCIPChainState + for address, tvStr := range addresses { + switch tvStr.String() { + case deployment.NewTypeAndVersion(RBACTimelock, deployment.Version1_0_0).String(): + tl, err := owner_wrappers.NewRBACTimelock(common.HexToAddress(address), chain.Client) + if err != nil { + return state, err + } + state.Timelock = tl + case deployment.NewTypeAndVersion(ManyChainMultisig, deployment.Version1_0_0).String(): + mcms, err := owner_wrappers.NewManyChainMultiSig(common.HexToAddress(address), chain.Client) + if err != nil { + return state, err + } + state.Mcm = mcms + case deployment.NewTypeAndVersion(CapabilitiesRegistry, deployment.Version1_0_0).String(): + cr, err := capabilities_registry.NewCapabilitiesRegistry(common.HexToAddress(address), chain.Client) + if err != nil { + return state, err + } + state.CapabilityRegistry = cr + case deployment.NewTypeAndVersion(OnRamp, deployment.Version1_6_0_dev).String(): + onRampC, err := onramp.NewOnRamp(common.HexToAddress(address), chain.Client) + if err != nil { + return state, err + } + state.OnRamp = onRampC + case deployment.NewTypeAndVersion(OffRamp, deployment.Version1_6_0_dev).String(): + offRamp, err := offramp.NewOffRamp(common.HexToAddress(address), chain.Client) + if err != nil { + return state, err + } + state.OffRamp = offRamp + case deployment.NewTypeAndVersion(ARMProxy, deployment.Version1_0_0).String(): + armProxy, err := rmn_proxy_contract.NewRMNProxyContract(common.HexToAddress(address), chain.Client) + if err != nil { + return state, err + } + state.RMNProxy = armProxy + case deployment.NewTypeAndVersion(RMNRemote, deployment.Version1_6_0_dev).String(): + rmnRemote, err := rmn_remote.NewRMNRemote(common.HexToAddress(address), chain.Client) + if err != nil { + return state, err + } + state.RMNRemote = rmnRemote + case deployment.NewTypeAndVersion(WETH9, deployment.Version1_0_0).String(): + weth9, err := weth9.NewWETH9(common.HexToAddress(address), chain.Client) + if err != nil { + return state, err + } + state.Weth9 = weth9 + case deployment.NewTypeAndVersion(NonceManager, deployment.Version1_6_0_dev).String(): + nm, err := nonce_manager.NewNonceManager(common.HexToAddress(address), chain.Client) + if err != nil { + return state, err + } + state.NonceManager = nm + case deployment.NewTypeAndVersion(CommitStore, deployment.Version1_5_0).String(): + cs, err := commit_store.NewCommitStore(common.HexToAddress(address), chain.Client) + if err != nil { + return state, err + } + state.CommitStore = cs + case deployment.NewTypeAndVersion(TokenAdminRegistry, deployment.Version1_5_0).String(): + tm, err := token_admin_registry.NewTokenAdminRegistry(common.HexToAddress(address), chain.Client) + if err != nil { + return state, err + } + state.TokenAdminRegistry = tm + case deployment.NewTypeAndVersion(Router, deployment.Version1_2_0).String(): + r, err := router.NewRouter(common.HexToAddress(address), chain.Client) + if err != nil { + return state, err + } + state.Router = r + case deployment.NewTypeAndVersion(TestRouter, deployment.Version1_2_0).String(): + r, err := router.NewRouter(common.HexToAddress(address), chain.Client) + if err != nil { + return state, err + } + state.TestRouter = r + case deployment.NewTypeAndVersion(FeeQuoter, deployment.Version1_6_0_dev).String(): + fq, err := fee_quoter.NewFeeQuoter(common.HexToAddress(address), chain.Client) + if err != nil { + return state, err + } + state.FeeQuoter = fq + case deployment.NewTypeAndVersion(LinkToken, deployment.Version1_0_0).String(): + lt, err := burn_mint_erc677.NewBurnMintERC677(common.HexToAddress(address), chain.Client) + if err != nil { + return state, err + } + state.LinkToken = lt + case deployment.NewTypeAndVersion(CCIPConfig, deployment.Version1_6_0_dev).String(): + cc, err := ccip_config.NewCCIPConfig(common.HexToAddress(address), chain.Client) + if err != nil { + return state, err + } + state.CCIPConfig = cc + case deployment.NewTypeAndVersion(CCIPReceiver, deployment.Version1_0_0).String(): + mr, err := maybe_revert_message_receiver.NewMaybeRevertMessageReceiver(common.HexToAddress(address), chain.Client) + if err != nil { + return state, err + } + state.Receiver = mr + case deployment.NewTypeAndVersion(PriceFeed, deployment.Version1_0_0).String(): + feed, err := aggregator_v3_interface.NewAggregatorV3Interface(common.HexToAddress(address), chain.Client) + if err != nil { + return state, err + } + if state.USDFeeds == nil { + state.USDFeeds = make(map[TokenSymbol]*aggregator_v3_interface.AggregatorV3Interface) + } + desc, err := feed.Description(&bind.CallOpts{}) + if err != nil { + return state, err + } + key, ok := MockDescriptionToTokenSymbol[desc] + if !ok { + return state, fmt.Errorf("unknown feed description %s", desc) + } + state.USDFeeds[key] = feed + default: + return state, fmt.Errorf("unknown contract %s", tvStr) + } + } + return state, nil +} diff --git a/integration-tests/deployment/ccip/test_assertions.go b/integration-tests/deployment/ccip/test_assertions.go new file mode 100644 index 00000000000..256d4bf8b62 --- /dev/null +++ b/integration-tests/deployment/ccip/test_assertions.go @@ -0,0 +1,250 @@ +package ccipdeployment + +import ( + "context" + "fmt" + "testing" + "time" + + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/accounts/abi/bind/backends" + "github.com/stretchr/testify/require" + "golang.org/x/sync/errgroup" + + "github.com/smartcontractkit/chainlink-common/pkg/types/ccipocr3" + + "github.com/smartcontractkit/chainlink/integration-tests/deployment" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/offramp" +) + +// ConfirmCommitForAllWithExpectedSeqNums waits for all chains in the environment to commit the given expectedSeqNums. +// expectedSeqNums is a map of destinationchain selector to expected sequence number +// startBlocks is a map of destination chain selector to start block number to start watching from. +// If startBlocks is nil, it will start watching from the latest block. +func ConfirmCommitForAllWithExpectedSeqNums( + t *testing.T, + e deployment.Environment, + state CCIPOnChainState, + expectedSeqNums map[uint64]uint64, + startBlocks map[uint64]*uint64, +) { + var wg errgroup.Group + for src, srcChain := range e.Chains { + for dest, dstChain := range e.Chains { + if src == dest { + continue + } + srcChain := srcChain + dstChain := dstChain + wg.Go(func() error { + var startBlock *uint64 + if startBlocks != nil { + startBlock = startBlocks[dstChain.Selector] + } + return ConfirmCommitWithExpectedSeqNumRange( + t, + srcChain, + dstChain, + state.Chains[dstChain.Selector].OffRamp, + startBlock, + ccipocr3.SeqNumRange{ + ccipocr3.SeqNum(expectedSeqNums[dstChain.Selector]), + ccipocr3.SeqNum(expectedSeqNums[dstChain.Selector]), + }) + }) + } + } + require.NoError(t, wg.Wait()) +} + +// ConfirmCommitWithExpectedSeqNumRange waits for a commit report on the destination chain with the expected sequence number range. +// startBlock is the block number to start watching from. +// If startBlock is nil, it will start watching from the latest block. +func ConfirmCommitWithExpectedSeqNumRange( + t *testing.T, + src deployment.Chain, + dest deployment.Chain, + offRamp *offramp.OffRamp, + startBlock *uint64, + expectedSeqNumRange ccipocr3.SeqNumRange, +) error { + sink := make(chan *offramp.OffRampCommitReportAccepted) + subscription, err := offRamp.WatchCommitReportAccepted(&bind.WatchOpts{ + Context: context.Background(), + Start: startBlock, + }, sink) + if err != nil { + return fmt.Errorf("error to subscribe CommitReportAccepted : %w", err) + } + + defer subscription.Unsubscribe() + var duration time.Duration + deadline, ok := t.Deadline() + if ok { + // make this timer end a minute before so that we don't hit the deadline + duration = deadline.Sub(time.Now().Add(-1 * time.Minute)) + } else { + duration = 5 * time.Minute + } + timer := time.NewTimer(duration) + defer timer.Stop() + ticker := time.NewTicker(2 * time.Second) + defer ticker.Stop() + for { + select { + case <-ticker.C: + // if it's simulated backend, commit to ensure mining + if backend, ok := src.Client.(*backends.SimulatedBackend); ok { + backend.Commit() + } + if backend, ok := dest.Client.(*backends.SimulatedBackend); ok { + backend.Commit() + } + t.Logf("Waiting for commit report on chain selector %d from source selector %d expected seq nr range %s", + dest.Selector, src.Selector, expectedSeqNumRange.String()) + case subErr := <-subscription.Err(): + return fmt.Errorf("subscription error: %w", subErr) + case <-timer.C: + return fmt.Errorf("timed out after waiting %s duration for commit report on chain selector %d from source selector %d expected seq nr range %s", + duration.String(), dest.Selector, src.Selector, expectedSeqNumRange.String()) + case report := <-sink: + if len(report.Report.MerkleRoots) > 0 { + // Check the interval of sequence numbers and make sure it matches + // the expected range. + for _, mr := range report.Report.MerkleRoots { + if mr.SourceChainSelector == src.Selector && + uint64(expectedSeqNumRange.Start()) == mr.MinSeqNr && + uint64(expectedSeqNumRange.End()) == mr.MaxSeqNr { + t.Logf("Received commit report on selector %d from source selector %d expected seq nr range %s, token prices: %v", + dest.Selector, src.Selector, expectedSeqNumRange.String(), report.Report.PriceUpdates.TokenPriceUpdates) + return nil + } + } + } + } + } +} + +// ConfirmExecWithSeqNrForAll waits for all chains in the environment to execute the given expectedSeqNums. +// expectedSeqNums is a map of destinationchain selector to expected sequence number +// startBlocks is a map of destination chain selector to start block number to start watching from. +// If startBlocks is nil, it will start watching from the latest block. +func ConfirmExecWithSeqNrForAll( + t *testing.T, + e deployment.Environment, + state CCIPOnChainState, + expectedSeqNums map[uint64]uint64, + startBlocks map[uint64]*uint64, +) { + var wg errgroup.Group + for src, srcChain := range e.Chains { + for dest, dstChain := range e.Chains { + if src == dest { + continue + } + srcChain := srcChain + dstChain := dstChain + wg.Go(func() error { + var startBlock *uint64 + if startBlocks != nil { + startBlock = startBlocks[dstChain.Selector] + } + return ConfirmExecWithSeqNr( + t, + srcChain, + dstChain, + state.Chains[dstChain.Selector].OffRamp, + startBlock, + expectedSeqNums[dstChain.Selector], + ) + }) + } + } + require.NoError(t, wg.Wait()) +} + +// ConfirmExecWithSeqNr waits for an execution state change on the destination chain with the expected sequence number. +// startBlock is the block number to start watching from. +// If startBlock is nil, it will start watching from the latest block. +func ConfirmExecWithSeqNr( + t *testing.T, + source, dest deployment.Chain, + offRamp *offramp.OffRamp, + startBlock *uint64, + expectedSeqNr uint64, +) error { + timer := time.NewTimer(5 * time.Minute) + defer timer.Stop() + tick := time.NewTicker(5 * time.Second) + defer tick.Stop() + sink := make(chan *offramp.OffRampExecutionStateChanged) + subscription, err := offRamp.WatchExecutionStateChanged(&bind.WatchOpts{ + Context: context.Background(), + Start: startBlock, + }, sink, nil, nil, nil) + if err != nil { + return fmt.Errorf("error to subscribe ExecutionStateChanged : %w", err) + } + defer subscription.Unsubscribe() + for { + select { + case <-tick.C: + // TODO: Clean this up + // if it's simulated backend, commit to ensure mining + if backend, ok := source.Client.(*backends.SimulatedBackend); ok { + backend.Commit() + } + if backend, ok := dest.Client.(*backends.SimulatedBackend); ok { + backend.Commit() + } + scc, err := offRamp.GetSourceChainConfig(nil, source.Selector) + if err != nil { + return fmt.Errorf("error to get source chain config : %w", err) + } + executionState, err := offRamp.GetExecutionState(nil, source.Selector, expectedSeqNr) + if err != nil { + return fmt.Errorf("error to get execution state : %w", err) + } + t.Logf("Waiting for ExecutionStateChanged on chain %d (offramp %s) from chain %d with expected sequence number %d, current onchain minSeqNr: %d, execution state: %s", + dest.Selector, offRamp.Address().String(), source.Selector, expectedSeqNr, scc.MinSeqNr, executionStateToString(executionState)) + if executionState == EXECUTION_STATE_SUCCESS { + t.Logf("Observed SUCCESS execution state on chain %d (offramp %s) from chain %d with expected sequence number %d", + dest.Selector, offRamp.Address().String(), source.Selector, expectedSeqNr) + return nil + } + case execEvent := <-sink: + if execEvent.SequenceNumber == expectedSeqNr && execEvent.SourceChainSelector == source.Selector { + t.Logf("Received ExecutionStateChanged on chain %d (offramp %s) from chain %d with expected sequence number %d", + dest.Selector, offRamp.Address().String(), source.Selector, expectedSeqNr) + return nil + } + case <-timer.C: + return fmt.Errorf("timed out waiting for ExecutionStateChanged on chain %d (offramp %s) from chain %d with expected sequence number %d", + dest.Selector, offRamp.Address().String(), source.Selector, expectedSeqNr) + case subErr := <-subscription.Err(): + return fmt.Errorf("subscription error: %w", subErr) + } + } +} + +const ( + EXECUTION_STATE_UNTOUCHED = 0 + EXECUTION_STATE_INPROGRESS = 1 + EXECUTION_STATE_SUCCESS = 2 + EXECUTION_STATE_FAILURE = 3 +) + +func executionStateToString(state uint8) string { + switch state { + case EXECUTION_STATE_UNTOUCHED: + return "UNTOUCHED" + case EXECUTION_STATE_INPROGRESS: + return "IN_PROGRESS" + case EXECUTION_STATE_SUCCESS: + return "SUCCESS" + case EXECUTION_STATE_FAILURE: + return "FAILURE" + default: + return "UNKNOWN" + } +} diff --git a/integration-tests/deployment/ccip/test_helpers.go b/integration-tests/deployment/ccip/test_helpers.go new file mode 100644 index 00000000000..c306ba4fd6a --- /dev/null +++ b/integration-tests/deployment/ccip/test_helpers.go @@ -0,0 +1,348 @@ +package ccipdeployment + +import ( + "context" + "fmt" + "math/big" + "sort" + "testing" + "time" + + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "golang.org/x/sync/errgroup" + + "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/testcontext" + + "github.com/smartcontractkit/chainlink-testing-framework/lib/logging" + + "github.com/ethereum/go-ethereum/common" + "github.com/stretchr/testify/require" + + "go.uber.org/multierr" + "go.uber.org/zap/zapcore" + + chainsel "github.com/smartcontractkit/chain-selectors" + + "github.com/smartcontractkit/chainlink/integration-tests/deployment" + jobv1 "github.com/smartcontractkit/chainlink/integration-tests/deployment/jd/job/v1" + "github.com/smartcontractkit/chainlink/integration-tests/deployment/memory" + "github.com/smartcontractkit/chainlink/integration-tests/docker/test_env" + + "github.com/smartcontractkit/chainlink-common/pkg/logger" + + "github.com/smartcontractkit/chainlink/integration-tests/deployment/devenv" + + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/mock_v3_aggregator_contract" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/router" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/aggregator_v3_interface" +) + +const ( + HomeChainIndex = 0 + FeedChainIndex = 1 +) + +// Context returns a context with the test's deadline, if available. +func Context(tb testing.TB) context.Context { + ctx := context.Background() + var cancel func() + switch t := tb.(type) { + case *testing.T: + if d, ok := t.Deadline(); ok { + ctx, cancel = context.WithDeadline(ctx, d) + } + } + if cancel == nil { + ctx, cancel = context.WithCancel(ctx) + } + tb.Cleanup(cancel) + return ctx +} + +type DeployedEnv struct { + Ab deployment.AddressBook + Env deployment.Environment + HomeChainSel uint64 + FeedChainSel uint64 +} + +type DeployedTestEnvironment struct { + DeployedEnv + Nodes map[string]memory.Node +} + +func SetUpHomeAndFeedChains(t *testing.T, lggr logger.Logger, homeChainSel, feedChainSel uint64, chains map[uint64]deployment.Chain) (deployment.AddressBook, deployment.CapabilityRegistryConfig) { + homeChainEVM, _ := chainsel.ChainIdFromSelector(homeChainSel) + ab, capReg, err := DeployCapReg(lggr, chains[homeChainSel]) + require.NoError(t, err) + + feedAb, _, err := DeployFeeds(lggr, chains[feedChainSel]) + require.NoError(t, err) + require.NoError(t, ab.Merge(feedAb)) + return ab, deployment.CapabilityRegistryConfig{ + EVMChainID: homeChainEVM, + Contract: capReg, + } +} + +// NewEnvironmentWithCRAndFeeds creates a new CCIP environment +// with capreg, feeds and nodes set up. +func NewEnvironmentWithCRAndFeeds(t *testing.T, lggr logger.Logger, numChains int) DeployedTestEnvironment { + require.GreaterOrEqual(t, numChains, 2, "numChains must be at least 2 for home and feed chains") + ctx := Context(t) + chains := memory.NewMemoryChains(t, numChains) + // Lower chainSel is home chain. + var chainSels []uint64 + // Say first chain is home chain. + for chainSel := range chains { + chainSels = append(chainSels, chainSel) + } + sort.Slice(chainSels, func(i, j int) bool { + return chainSels[i] < chainSels[j] + }) + // Take lowest for determinism. + homeChainSel := chainSels[HomeChainIndex] + feedSel := chainSels[FeedChainIndex] + ab, capReg := SetUpHomeAndFeedChains(t, lggr, homeChainSel, feedSel, chains) + + nodes := memory.NewNodes(t, zapcore.InfoLevel, chains, 4, 1, capReg) + for _, node := range nodes { + require.NoError(t, node.App.Start(ctx)) + t.Cleanup(func() { + require.NoError(t, node.App.Stop()) + }) + } + + e := memory.NewMemoryEnvironmentFromChainsNodes(t, lggr, chains, nodes) + return DeployedTestEnvironment{ + DeployedEnv: DeployedEnv{ + Ab: ab, + Env: e, + HomeChainSel: homeChainSel, + FeedChainSel: feedSel, + }, + Nodes: nodes, + } +} + +func NewEnvironmentWithCRAndJobs(t *testing.T, lggr logger.Logger, numChains int) DeployedTestEnvironment { + ctx := Context(t) + e := NewEnvironmentWithCRAndFeeds(t, lggr, numChains) + jbs, err := NewCCIPJobSpecs(e.Env.NodeIDs, e.Env.Offchain) + require.NoError(t, err) + for nodeID, jobs := range jbs { + for _, job := range jobs { + // Note these auto-accept + _, err := e.Env.Offchain.ProposeJob(ctx, + &jobv1.ProposeJobRequest{ + NodeId: nodeID, + Spec: job, + }) + require.NoError(t, err) + } + } + // Wait for plugins to register filters? + // TODO: Investigate how to avoid. + time.Sleep(30 * time.Second) + + // Ensure job related logs are up to date. + require.NoError(t, ReplayAllLogs(e.Nodes, e.Env.Chains)) + return e +} + +func ReplayAllLogs(nodes map[string]memory.Node, chains map[uint64]deployment.Chain) error { + blockBySel := make(map[uint64]uint64) + for sel := range chains { + blockBySel[sel] = 1 + } + for _, node := range nodes { + if err := node.ReplayLogs(blockBySel); err != nil { + return err + } + } + return nil +} + +func SendRequest(t *testing.T, e deployment.Environment, state CCIPOnChainState, src, dest uint64, testRouter bool) uint64 { + msg := router.ClientEVM2AnyMessage{ + Receiver: common.LeftPadBytes(state.Chains[dest].Receiver.Address().Bytes(), 32), + Data: []byte("hello"), + TokenAmounts: nil, // TODO: no tokens for now + // Pay native. + FeeToken: common.HexToAddress("0x0"), + ExtraArgs: nil, // TODO: no extra args for now, falls back to default + } + router := state.Chains[src].Router + if testRouter { + router = state.Chains[src].TestRouter + } + fee, err := router.GetFee( + &bind.CallOpts{Context: context.Background()}, dest, msg) + require.NoError(t, err, deployment.MaybeDataErr(err)) + + t.Logf("Sending CCIP request from chain selector %d to chain selector %d", + src, dest) + e.Chains[src].DeployerKey.Value = fee + tx, err := router.CcipSend( + e.Chains[src].DeployerKey, + dest, + msg) + require.NoError(t, err) + blockNum, err := e.Chains[src].Confirm(tx) + require.NoError(t, err) + it, err := state.Chains[src].OnRamp.FilterCCIPMessageSent(&bind.FilterOpts{ + Start: blockNum, + End: &blockNum, + Context: context.Background(), + }, []uint64{dest}) + require.NoError(t, err) + require.True(t, it.Next()) + seqNum := it.Event.Message.Header.SequenceNumber + t.Logf("CCIP message sent from chain selector %d to chain selector %d tx %s seqNum %d", src, dest, tx.Hash().String(), seqNum) + return seqNum +} + +// DeployedLocalDevEnvironment is a helper struct for setting up a local dev environment with docker +type DeployedLocalDevEnvironment struct { + DeployedEnv + testEnv *test_env.CLClusterTestEnv + DON *devenv.DON +} + +func (d DeployedLocalDevEnvironment) RestartChainlinkNodes(t *testing.T) error { + errGrp := errgroup.Group{} + for _, n := range d.testEnv.ClCluster.Nodes { + n := n + errGrp.Go(func() error { + if err := n.Container.Terminate(testcontext.Get(t)); err != nil { + return err + } + err := n.RestartContainer() + if err != nil { + return err + } + return nil + }) + + } + return errGrp.Wait() +} + +func NewDeployedLocalDevEnvironment(t *testing.T, lggr logger.Logger) DeployedLocalDevEnvironment { + ctx := Context(t) + // create a local docker environment with simulated chains and job-distributor + // we cannot create the chainlink nodes yet as we need to deploy the capability registry first + envConfig, testEnv, cfg := devenv.CreateDockerEnv(t) + require.NotNil(t, envConfig) + require.NotEmpty(t, envConfig.Chains, "chainConfigs should not be empty") + require.NotEmpty(t, envConfig.JDConfig, "jdUrl should not be empty") + chains, err := devenv.NewChains(lggr, envConfig.Chains) + require.NoError(t, err) + // locate the home chain + homeChainSel := envConfig.HomeChainSelector + require.NotEmpty(t, homeChainSel, "homeChainSel should not be empty") + feedSel := envConfig.FeedChainSelector + require.NotEmpty(t, feedSel, "feedSel should not be empty") + ab, capReg := SetUpHomeAndFeedChains(t, lggr, homeChainSel, feedSel, chains) + + // start the chainlink nodes with the CR address + err = devenv.StartChainlinkNodes(t, envConfig, capReg, testEnv, cfg) + require.NoError(t, err) + + e, don, err := devenv.NewEnvironment(ctx, lggr, *envConfig) + require.NoError(t, err) + require.NotNil(t, e) + require.NotNil(t, don) + zeroLogLggr := logging.GetTestLogger(t) + // fund the nodes + devenv.FundNodes(t, zeroLogLggr, testEnv, cfg, don.PluginNodes()) + + return DeployedLocalDevEnvironment{ + DeployedEnv: DeployedEnv{ + Ab: ab, + Env: *e, + HomeChainSel: homeChainSel, + FeedChainSel: feedSel, + }, + DON: don, + testEnv: testEnv, + } +} + +// AddLanesForAll adds densely connected lanes for all chains in the environment so that each chain +// is connected to every other chain except itself. +func AddLanesForAll(e deployment.Environment, state CCIPOnChainState) error { + for source := range e.Chains { + for dest := range e.Chains { + if source != dest { + err := AddLane(e, state, source, dest) + if err != nil { + return err + } + } + } + } + return nil +} + +const ( + // MockLinkAggregatorDescription This is the description of the MockV3Aggregator.sol contract + // nolint:lll + // https://github.com/smartcontractkit/chainlink/blob/a348b98e90527520049c580000a86fb8ceff7fa7/contracts/src/v0.8/tests/MockV3Aggregator.sol#L76-L76 + MockLinkAggregatorDescription = "v0.8/tests/MockV3Aggregator.sol" + // MockWETHAggregatorDescription WETH use description from MockETHUSDAggregator.sol + // nolint:lll + // https://github.com/smartcontractkit/chainlink/blob/a348b98e90527520049c580000a86fb8ceff7fa7/contracts/src/v0.8/automation/testhelpers/MockETHUSDAggregator.sol#L19-L19 + MockWETHAggregatorDescription = "MockETHUSDAggregator" +) + +var ( + MockLinkPrice = big.NewInt(5e18) + // MockDescriptionToTokenSymbol maps a mock feed description to token descriptor + MockDescriptionToTokenSymbol = map[string]TokenSymbol{ + MockLinkAggregatorDescription: LinkSymbol, + MockWETHAggregatorDescription: WethSymbol, + } +) + +func DeployFeeds(lggr logger.Logger, chain deployment.Chain) (deployment.AddressBook, map[string]common.Address, error) { + ab := deployment.NewMemoryAddressBook() + linkTV := deployment.NewTypeAndVersion(PriceFeed, deployment.Version1_0_0) + mockLinkFeed, err := deployContract(lggr, chain, ab, + func(chain deployment.Chain) ContractDeploy[*aggregator_v3_interface.AggregatorV3Interface] { + linkFeed, tx, _, err1 := mock_v3_aggregator_contract.DeployMockV3Aggregator( + chain.DeployerKey, + chain.Client, + LinkDecimals, // decimals + MockLinkPrice, // initialAnswer + ) + aggregatorCr, err2 := aggregator_v3_interface.NewAggregatorV3Interface(linkFeed, chain.Client) + + return ContractDeploy[*aggregator_v3_interface.AggregatorV3Interface]{ + Address: linkFeed, Contract: aggregatorCr, Tv: linkTV, Tx: tx, Err: multierr.Append(err1, err2), + } + }) + + if err != nil { + lggr.Errorw("Failed to deploy link feed", "err", err) + return ab, nil, err + } + + lggr.Infow("deployed mockLinkFeed", "addr", mockLinkFeed.Address) + + desc, err := mockLinkFeed.Contract.Description(&bind.CallOpts{}) + if err != nil { + lggr.Errorw("Failed to get description", "err", err) + return ab, nil, err + } + + if desc != MockLinkAggregatorDescription { + lggr.Errorw("Unexpected description for Link token", "desc", desc) + return ab, nil, fmt.Errorf("unexpected description: %s", desc) + } + + tvToAddress := map[string]common.Address{ + desc: mockLinkFeed.Address, + } + return ab, tvToAddress, nil +} diff --git a/integration-tests/deployment/ccip/token_info.go b/integration-tests/deployment/ccip/token_info.go new file mode 100644 index 00000000000..1ea09949bc4 --- /dev/null +++ b/integration-tests/deployment/ccip/token_info.go @@ -0,0 +1,47 @@ +package ccipdeployment + +import ( + "github.com/smartcontractkit/chainlink-ccip/pluginconfig" + + "github.com/smartcontractkit/chainlink-common/pkg/logger" + + ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" +) + +// TokenConfig mapping between token Symbol (e.g. LinkSymbol, WethSymbol) +// and the respective token info. +type TokenConfig struct { + TokenSymbolToInfo map[TokenSymbol]pluginconfig.TokenInfo +} + +func NewTokenConfig() TokenConfig { + return TokenConfig{ + TokenSymbolToInfo: make(map[TokenSymbol]pluginconfig.TokenInfo), + } +} + +func (tc *TokenConfig) UpsertTokenInfo( + symbol TokenSymbol, + info pluginconfig.TokenInfo, +) { + tc.TokenSymbolToInfo[symbol] = info +} + +// GetTokenInfo Adds mapping between dest chain tokens and their respective aggregators on feed chain. +func (tc *TokenConfig) GetTokenInfo( + lggr logger.Logger, + destState CCIPChainState, +) map[ocrtypes.Account]pluginconfig.TokenInfo { + tokenToAggregate := make(map[ocrtypes.Account]pluginconfig.TokenInfo) + if _, ok := tc.TokenSymbolToInfo[LinkSymbol]; !ok { + lggr.Debugw("Link aggregator not found, deploy without mapping link token") + } else { + lggr.Debugw("Mapping LinkToken to Link aggregator") + acc := ocrtypes.Account(destState.LinkToken.Address().String()) + tokenToAggregate[acc] = tc.TokenSymbolToInfo[LinkSymbol] + } + + // TODO: Populate tokenInfo with weth and the token map in destState + + return tokenToAggregate +} diff --git a/integration-tests/deployment/ccip/view/chain.go b/integration-tests/deployment/ccip/view/chain.go new file mode 100644 index 00000000000..06f0059e67b --- /dev/null +++ b/integration-tests/deployment/ccip/view/chain.go @@ -0,0 +1,42 @@ +package view + +import ( + "github.com/smartcontractkit/chainlink/integration-tests/deployment/ccip/view/v1_0" + "github.com/smartcontractkit/chainlink/integration-tests/deployment/ccip/view/v1_2" + "github.com/smartcontractkit/chainlink/integration-tests/deployment/ccip/view/v1_5" + "github.com/smartcontractkit/chainlink/integration-tests/deployment/ccip/view/v1_6" +) + +type ChainView struct { + // v1.0 + RMNProxy map[string]v1_0.RMNProxyView `json:"rmnProxy,omitempty"` + // v1.2 + Router map[string]v1_2.RouterView `json:"router,omitempty"` + // v1.5 + TokenAdminRegistry map[string]v1_5.TokenAdminRegistryView `json:"tokenAdminRegistry,omitempty"` + CommitStore map[string]v1_5.CommitStoreView `json:"commitStore,omitempty"` + // v1.6 + FeeQuoter map[string]v1_6.FeeQuoterView `json:"feeQuoter,omitempty"` + NonceManager map[string]v1_6.NonceManagerView `json:"nonceManager,omitempty"` + RMN map[string]v1_6.RMNRemoteView `json:"rmn,omitempty"` + OnRamp map[string]v1_6.OnRampView `json:"onRamp,omitempty"` + OffRamp map[string]v1_6.OffRampView `json:"offRamp,omitempty"` +} + +func NewChain() ChainView { + return ChainView{ + // v1.0 + RMNProxy: make(map[string]v1_0.RMNProxyView), + // v1.2 + Router: make(map[string]v1_2.RouterView), + // v1.5 + TokenAdminRegistry: make(map[string]v1_5.TokenAdminRegistryView), + CommitStore: make(map[string]v1_5.CommitStoreView), + // v1.6 + FeeQuoter: make(map[string]v1_6.FeeQuoterView), + NonceManager: make(map[string]v1_6.NonceManagerView), + RMN: make(map[string]v1_6.RMNRemoteView), + OnRamp: make(map[string]v1_6.OnRampView), + OffRamp: make(map[string]v1_6.OffRampView), + } +} diff --git a/integration-tests/deployment/ccip/view/state.go b/integration-tests/deployment/ccip/view/state.go new file mode 100644 index 00000000000..5c86f8e27a5 --- /dev/null +++ b/integration-tests/deployment/ccip/view/state.go @@ -0,0 +1,11 @@ +package view + +type CCIPView struct { + Chains map[string]ChainView `json:"chains,omitempty"` +} + +func NewCCIPView() CCIPView { + return CCIPView{ + Chains: make(map[string]ChainView), + } +} diff --git a/integration-tests/deployment/ccip/view/types/contract_state.go b/integration-tests/deployment/ccip/view/types/contract_state.go new file mode 100644 index 00000000000..f65c510af53 --- /dev/null +++ b/integration-tests/deployment/ccip/view/types/contract_state.go @@ -0,0 +1,33 @@ +package types + +import ( + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" +) + +type ContractMetaData struct { + TypeAndVersion string `json:"typeAndVersion,omitempty"` + Address common.Address `json:"address,omitempty"` + Owner common.Address `json:"owner,omitempty"` +} + +func NewContractMetaData(tv Meta, addr common.Address) (ContractMetaData, error) { + tvStr, err := tv.TypeAndVersion(nil) + if err != nil { + return ContractMetaData{}, err + } + owner, err := tv.Owner(nil) + if err != nil { + return ContractMetaData{}, err + } + return ContractMetaData{ + TypeAndVersion: tvStr, + Address: addr, + Owner: owner, + }, nil +} + +type Meta interface { + TypeAndVersion(opts *bind.CallOpts) (string, error) + Owner(opts *bind.CallOpts) (common.Address, error) +} diff --git a/integration-tests/deployment/ccip/view/v1_0/rmn_proxy_contract.go b/integration-tests/deployment/ccip/view/v1_0/rmn_proxy_contract.go new file mode 100644 index 00000000000..bac32bf0f26 --- /dev/null +++ b/integration-tests/deployment/ccip/view/v1_0/rmn_proxy_contract.go @@ -0,0 +1,33 @@ +package v1_0 + +import ( + "fmt" + + "github.com/ethereum/go-ethereum/common" + + "github.com/smartcontractkit/chainlink/integration-tests/deployment/ccip/view/types" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/rmn_proxy_contract" +) + +type RMNProxyView struct { + types.ContractMetaData + RMN common.Address `json:"rmn"` +} + +func GenerateRMNProxyView(r *rmn_proxy_contract.RMNProxyContract) (RMNProxyView, error) { + if r == nil { + return RMNProxyView{}, fmt.Errorf("cannot generate view for nil RMNProxy") + } + meta, err := types.NewContractMetaData(r, r.Address()) + if err != nil { + return RMNProxyView{}, fmt.Errorf("failed to generate contract metadata for RMNProxy: %w", err) + } + rmn, err := r.GetARM(nil) + if err != nil { + return RMNProxyView{}, fmt.Errorf("failed to get ARM: %w", err) + } + return RMNProxyView{ + ContractMetaData: meta, + RMN: rmn, + }, nil +} diff --git a/integration-tests/deployment/ccip/view/v1_2/router.go b/integration-tests/deployment/ccip/view/v1_2/router.go new file mode 100644 index 00000000000..14a96e86b79 --- /dev/null +++ b/integration-tests/deployment/ccip/view/v1_2/router.go @@ -0,0 +1,71 @@ +package v1_2 + +import ( + "fmt" + + "github.com/ethereum/go-ethereum/common" + + "github.com/smartcontractkit/chainlink/integration-tests/deployment/ccip/view/types" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/router" +) + +type RouterView struct { + types.ContractMetaData + WrappedNative common.Address `json:"wrappedNative,omitempty"` + ARMProxy common.Address `json:"armProxy,omitempty"` + OnRamps map[uint64]common.Address `json:"onRamps,omitempty"` // Map of DestinationChainSelectors to OnRamp Addresses + OffRamps map[uint64]common.Address `json:"offRamps,omitempty"` // Map of SourceChainSelectors to a list of OffRamp Addresses +} + +func GenerateRouterView(r *router.Router) (RouterView, error) { + meta, err := types.NewContractMetaData(r, r.Address()) + if err != nil { + return RouterView{}, fmt.Errorf("view error to get router metadata: %w", err) + } + wrappedNative, err := r.GetWrappedNative(nil) + if err != nil { + return RouterView{}, fmt.Errorf("view error to get router wrapped native: %w", err) + } + armProxy, err := r.GetArmProxy(nil) + if err != nil { + return RouterView{}, fmt.Errorf("view error to get router arm proxy: %w", err) + } + onRamps := make(map[uint64]common.Address) + offRamps := make(map[uint64]common.Address) + offRampList, err := r.GetOffRamps(nil) + if err != nil { + return RouterView{}, fmt.Errorf("view error to get router offRamps: %w", err) + } + for _, offRamp := range offRampList { + offRamps[offRamp.SourceChainSelector] = offRamp.OffRamp + } + for selector := range offRamps { + onRamp, err := r.GetOnRamp(nil, selector) + if err != nil { + return RouterView{}, fmt.Errorf("view error to get router onRamp: %w", err) + } + onRamps[selector] = onRamp + } + return RouterView{ + ContractMetaData: meta, + WrappedNative: wrappedNative, + ARMProxy: armProxy, + OnRamps: onRamps, + OffRamps: offRamps, + }, nil +} + +// From the perspective of the OnRamp, the destination chains are the source chains for the OffRamp. +func GetRemoteChainSelectors(routerContract *router.Router) ([]uint64, error) { + remoteSelectors := make([]uint64, 0) + offRamps, err := routerContract.GetOffRamps(nil) + if err != nil { + return nil, fmt.Errorf("failed to get offRamps from router: %w", err) + } + // lanes are bidirectional, so we get the list of source chains to know which chains are supported as destinations as well + for _, offRamp := range offRamps { + remoteSelectors = append(remoteSelectors, offRamp.SourceChainSelector) + } + + return remoteSelectors, nil +} diff --git a/integration-tests/deployment/ccip/view/v1_5/commit_store.go b/integration-tests/deployment/ccip/view/v1_5/commit_store.go new file mode 100644 index 00000000000..0aa483e1678 --- /dev/null +++ b/integration-tests/deployment/ccip/view/v1_5/commit_store.go @@ -0,0 +1,81 @@ +package v1_5 + +import ( + "fmt" + + "github.com/ethereum/go-ethereum/common" + + "github.com/smartcontractkit/chainlink/integration-tests/deployment/ccip/view/types" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/commit_store" +) + +type CommitStoreView struct { + types.ContractMetaData + DynamicConfig commit_store.CommitStoreDynamicConfig `json:"dynamicConfig"` + ExpectedNextSequenceNumber uint64 `json:"expectedNextSequenceNumber"` + LatestPriceEpochAndRound uint64 `json:"latestPriceEpochAndRound"` + StaticConfig commit_store.CommitStoreStaticConfig `json:"staticConfig"` + Transmitters []common.Address `json:"transmitters"` + IsUnpausedAndNotCursed bool `json:"isUnpausedAndNotCursed"` + LatestConfigDetails commit_store.LatestConfigDetails `json:"latestConfigDetails"` + LatestConfigDigestAndEpoch commit_store.LatestConfigDigestAndEpoch `json:"latestConfigDigestAndEpoch"` + Paused bool `json:"paused"` +} + +func GenerateCommitStoreView(c *commit_store.CommitStore) (CommitStoreView, error) { + if c == nil { + return CommitStoreView{}, fmt.Errorf("cannot generate view for nil CommitStore") + } + meta, err := types.NewContractMetaData(c, c.Address()) + if err != nil { + return CommitStoreView{}, fmt.Errorf("failed to generate contract metadata for CommitStore: %w", err) + } + dynamicConfig, err := c.GetDynamicConfig(nil) + if err != nil { + return CommitStoreView{}, fmt.Errorf("failed to get dynamic config: %w", err) + } + expectedNextSequenceNumber, err := c.GetExpectedNextSequenceNumber(nil) + if err != nil { + return CommitStoreView{}, fmt.Errorf("failed to get expected next sequence number: %w", err) + } + latestPriceEpochAndRound, err := c.GetLatestPriceEpochAndRound(nil) + if err != nil { + return CommitStoreView{}, fmt.Errorf("failed to get latest price epoch and round: %w", err) + } + staticConfig, err := c.GetStaticConfig(nil) + if err != nil { + return CommitStoreView{}, fmt.Errorf("failed to get static config: %w", err) + } + transmitters, err := c.GetTransmitters(nil) + if err != nil { + return CommitStoreView{}, fmt.Errorf("failed to get transmitters: %w", err) + } + isUnpausedAndNotCursed, err := c.IsUnpausedAndNotCursed(nil) + if err != nil { + return CommitStoreView{}, fmt.Errorf("failed to get is unpaused and not cursed: %w", err) + } + latestConfigDetails, err := c.LatestConfigDetails(nil) + if err != nil { + return CommitStoreView{}, fmt.Errorf("failed to get latest config details: %w", err) + } + latestConfigDigestAndEpoch, err := c.LatestConfigDigestAndEpoch(nil) + if err != nil { + return CommitStoreView{}, fmt.Errorf("failed to get latest config digest and epoch: %w", err) + } + paused, err := c.Paused(nil) + if err != nil { + return CommitStoreView{}, fmt.Errorf("failed to get paused: %w", err) + } + return CommitStoreView{ + ContractMetaData: meta, + DynamicConfig: dynamicConfig, + ExpectedNextSequenceNumber: expectedNextSequenceNumber, + LatestPriceEpochAndRound: latestPriceEpochAndRound, + StaticConfig: staticConfig, + Transmitters: transmitters, + IsUnpausedAndNotCursed: isUnpausedAndNotCursed, + LatestConfigDetails: latestConfigDetails, + LatestConfigDigestAndEpoch: latestConfigDigestAndEpoch, + Paused: paused, + }, nil +} diff --git a/integration-tests/deployment/ccip/view/v1_5/tokenadminregistry.go b/integration-tests/deployment/ccip/view/v1_5/tokenadminregistry.go new file mode 100644 index 00000000000..ebfff8c2feb --- /dev/null +++ b/integration-tests/deployment/ccip/view/v1_5/tokenadminregistry.go @@ -0,0 +1,56 @@ +package v1_5 + +import ( + "fmt" + + "github.com/ethereum/go-ethereum/common" + + "github.com/smartcontractkit/chainlink/integration-tests/deployment/ccip/view/types" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/token_admin_registry" +) + +const ( + GetTokensPaginationSize = 20 +) + +type TokenAdminRegistryView struct { + types.ContractMetaData + Tokens []common.Address `json:"tokens"` +} + +func GenerateTokenAdminRegistryView(taContract *token_admin_registry.TokenAdminRegistry) (TokenAdminRegistryView, error) { + if taContract == nil { + return TokenAdminRegistryView{}, fmt.Errorf("token admin registry contract is nil") + } + tokens, err := getAllConfiguredTokensPaginated(taContract) + if err != nil { + return TokenAdminRegistryView{}, fmt.Errorf("view error for token admin registry: %w", err) + } + tvMeta, err := types.NewContractMetaData(taContract, taContract.Address()) + if err != nil { + return TokenAdminRegistryView{}, fmt.Errorf("metadata error for token admin registry: %w", err) + } + return TokenAdminRegistryView{ + ContractMetaData: tvMeta, + Tokens: tokens, + }, nil +} + +// getAllConfiguredTokensPaginated fetches all configured tokens from the TokenAdminRegistry contract in paginated +// manner to avoid RPC timeouts since the list of configured tokens can grow to be very large over time. +func getAllConfiguredTokensPaginated(taContract *token_admin_registry.TokenAdminRegistry) ([]common.Address, error) { + startIndex := uint64(0) + allTokens := make([]common.Address, 0) + for { + fetchedTokens, err := taContract.GetAllConfiguredTokens(nil, startIndex, GetTokensPaginationSize) + if err != nil { + return nil, err + } + allTokens = append(allTokens, fetchedTokens...) + startIndex += GetTokensPaginationSize + if len(fetchedTokens) < GetTokensPaginationSize { + break + } + } + return allTokens, nil +} diff --git a/integration-tests/deployment/ccip/view/v1_6/feequoter.go b/integration-tests/deployment/ccip/view/v1_6/feequoter.go new file mode 100644 index 00000000000..a2694e96a48 --- /dev/null +++ b/integration-tests/deployment/ccip/view/v1_6/feequoter.go @@ -0,0 +1,140 @@ +package v1_6 + +import ( + "fmt" + + "github.com/ethereum/go-ethereum/common" + + "github.com/smartcontractkit/chainlink/integration-tests/deployment/ccip/view/types" + "github.com/smartcontractkit/chainlink/integration-tests/deployment/ccip/view/v1_2" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/fee_quoter" + router1_2 "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/router" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/token_admin_registry" +) + +type FeeQuoterView struct { + types.ContractMetaData + AuthorizedCallers []string `json:"authorizedCallers,omitempty"` + FeeTokens []string `json:"feeTokens,omitempty"` + StaticConfig FeeQuoterStaticConfig `json:"staticConfig,omitempty"` + DestinationChainConfig map[uint64]FeeQuoterDestChainConfig `json:"destinationChainConfig,omitempty"` + TokenPriceFeedConfig map[string]FeeQuoterTokenPriceFeedConfig `json:"tokenPriceFeedConfig,omitempty"` +} + +type FeeQuoterStaticConfig struct { + MaxFeeJuelsPerMsg string `json:"maxFeeJuelsPerMsg,omitempty"` + LinkToken string `json:"linkToken,omitempty"` + StalenessThreshold uint32 `json:"stalenessThreshold,omitempty"` +} + +type FeeQuoterDestChainConfig struct { + IsEnabled bool `json:"isEnabled,omitempty"` + MaxNumberOfTokensPerMsg uint16 `json:"maxNumberOfTokensPerMsg,omitempty"` + MaxDataBytes uint32 `json:"maxDataBytes,omitempty"` + MaxPerMsgGasLimit uint32 `json:"maxPerMsgGasLimit,omitempty"` + DestGasOverhead uint32 `json:"destGasOverhead,omitempty"` + DestGasPerPayloadByte uint16 `json:"destGasPerPayloadByte,omitempty"` + DestDataAvailabilityOverheadGas uint32 `json:"destDataAvailabilityOverheadGas,omitempty"` + DestGasPerDataAvailabilityByte uint16 `json:"destGasPerDataAvailabilityByte,omitempty"` + DestDataAvailabilityMultiplierBps uint16 `json:"destDataAvailabilityMultiplierBps,omitempty"` + DefaultTokenFeeUSDCents uint16 `json:"defaultTokenFeeUSDCents,omitempty"` + DefaultTokenDestGasOverhead uint32 `json:"defaultTokenDestGasOverhead,omitempty"` + DefaultTxGasLimit uint32 `json:"defaultTxGasLimit,omitempty"` + GasMultiplierWeiPerEth uint64 `json:"gasMultiplierWeiPerEth,omitempty"` + NetworkFeeUSDCents uint32 `json:"networkFeeUSDCents,omitempty"` + EnforceOutOfOrder bool `json:"enforceOutOfOrder,omitempty"` + ChainFamilySelector string `json:"chainFamilySelector,omitempty"` +} + +type FeeQuoterTokenPriceFeedConfig struct { + DataFeedAddress string `json:"dataFeedAddress,omitempty"` + TokenDecimals uint8 `json:"tokenDecimals,omitempty"` +} + +func GenerateFeeQuoterView(fqContract *fee_quoter.FeeQuoter, router *router1_2.Router, ta *token_admin_registry.TokenAdminRegistry) (FeeQuoterView, error) { + fq := FeeQuoterView{} + authorizedCallers, err := fqContract.GetAllAuthorizedCallers(nil) + if err != nil { + return FeeQuoterView{}, err + } + fq.AuthorizedCallers = make([]string, 0, len(authorizedCallers)) + for _, ac := range authorizedCallers { + fq.AuthorizedCallers = append(fq.AuthorizedCallers, ac.Hex()) + } + fq.ContractMetaData, err = types.NewContractMetaData(fqContract, fqContract.Address()) + if err != nil { + return FeeQuoterView{}, fmt.Errorf("metadata error for FeeQuoter: %w", err) + } + feeTokens, err := fqContract.GetFeeTokens(nil) + if err != nil { + return FeeQuoterView{}, err + } + fq.FeeTokens = make([]string, 0, len(feeTokens)) + for _, ft := range feeTokens { + fq.FeeTokens = append(fq.FeeTokens, ft.Hex()) + } + staticConfig, err := fqContract.GetStaticConfig(nil) + if err != nil { + return FeeQuoterView{}, err + } + fq.StaticConfig = FeeQuoterStaticConfig{ + MaxFeeJuelsPerMsg: staticConfig.MaxFeeJuelsPerMsg.String(), + LinkToken: staticConfig.LinkToken.Hex(), + StalenessThreshold: staticConfig.StalenessThreshold, + } + // find router contract in dependencies + fq.DestinationChainConfig = make(map[uint64]FeeQuoterDestChainConfig) + destSelectors, err := v1_2.GetRemoteChainSelectors(router) + if err != nil { + return FeeQuoterView{}, fmt.Errorf("view error for FeeQuoter: %w", err) + } + for _, destChainSelector := range destSelectors { + destChainConfig, err := fqContract.GetDestChainConfig(nil, destChainSelector) + if err != nil { + return FeeQuoterView{}, err + } + fq.DestinationChainConfig[destChainSelector] = FeeQuoterDestChainConfig{ + IsEnabled: destChainConfig.IsEnabled, + MaxNumberOfTokensPerMsg: destChainConfig.MaxNumberOfTokensPerMsg, + MaxDataBytes: destChainConfig.MaxDataBytes, + MaxPerMsgGasLimit: destChainConfig.MaxPerMsgGasLimit, + DestGasOverhead: destChainConfig.DestGasOverhead, + DestGasPerPayloadByte: destChainConfig.DestGasPerPayloadByte, + DestDataAvailabilityOverheadGas: destChainConfig.DestDataAvailabilityOverheadGas, + DestGasPerDataAvailabilityByte: destChainConfig.DestGasPerDataAvailabilityByte, + DestDataAvailabilityMultiplierBps: destChainConfig.DestDataAvailabilityMultiplierBps, + DefaultTokenFeeUSDCents: destChainConfig.DefaultTokenFeeUSDCents, + DefaultTokenDestGasOverhead: destChainConfig.DefaultTokenDestGasOverhead, + DefaultTxGasLimit: destChainConfig.DefaultTxGasLimit, + GasMultiplierWeiPerEth: destChainConfig.GasMultiplierWeiPerEth, + NetworkFeeUSDCents: destChainConfig.NetworkFeeUSDCents, + EnforceOutOfOrder: destChainConfig.EnforceOutOfOrder, + ChainFamilySelector: fmt.Sprintf("%x", destChainConfig.ChainFamilySelector), + } + } + fq.TokenPriceFeedConfig = make(map[string]FeeQuoterTokenPriceFeedConfig) + tokens, err := GetSupportedTokens(ta) + if err != nil { + return FeeQuoterView{}, fmt.Errorf("view error for FeeQuoter: %w", err) + } + for _, token := range tokens { + t, err := fqContract.GetTokenPriceFeedConfig(nil, token) + if err != nil { + return FeeQuoterView{}, err + } + fq.TokenPriceFeedConfig[token.String()] = FeeQuoterTokenPriceFeedConfig{ + DataFeedAddress: t.DataFeedAddress.Hex(), + TokenDecimals: t.TokenDecimals, + } + } + return fq, nil +} + +func GetSupportedTokens(taContract *token_admin_registry.TokenAdminRegistry) ([]common.Address, error) { + // TODO : include pagination CCIP-3416 + tokens, err := taContract.GetAllConfiguredTokens(nil, 0, 10) + if err != nil { + return nil, fmt.Errorf("failed to get tokens from token_admin_registry: %w", err) + } + return tokens, nil +} diff --git a/integration-tests/deployment/ccip/view/v1_6/noncemanager.go b/integration-tests/deployment/ccip/view/v1_6/noncemanager.go new file mode 100644 index 00000000000..23df56c3d24 --- /dev/null +++ b/integration-tests/deployment/ccip/view/v1_6/noncemanager.go @@ -0,0 +1,31 @@ +package v1_6 + +import ( + "fmt" + + "github.com/ethereum/go-ethereum/common" + + "github.com/smartcontractkit/chainlink/integration-tests/deployment/ccip/view/types" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/nonce_manager" +) + +type NonceManagerView struct { + types.ContractMetaData + AuthorizedCallers []common.Address `json:"authorizedCallers,omitempty"` +} + +func GenerateNonceManagerView(nm *nonce_manager.NonceManager) (NonceManagerView, error) { + authorizedCallers, err := nm.GetAllAuthorizedCallers(nil) + if err != nil { + return NonceManagerView{}, fmt.Errorf("view error for nonce manager: %w", err) + } + nmMeta, err := types.NewContractMetaData(nm, nm.Address()) + if err != nil { + return NonceManagerView{}, fmt.Errorf("metadata error for nonce manager: %w", err) + } + return NonceManagerView{ + ContractMetaData: nmMeta, + // TODO: these can be resolved using an address book + AuthorizedCallers: authorizedCallers, + }, nil +} diff --git a/integration-tests/deployment/ccip/view/v1_6/offramp.go b/integration-tests/deployment/ccip/view/v1_6/offramp.go new file mode 100644 index 00000000000..38992cb3da1 --- /dev/null +++ b/integration-tests/deployment/ccip/view/v1_6/offramp.go @@ -0,0 +1,64 @@ +package v1_6 + +import ( + "fmt" + + "github.com/smartcontractkit/chainlink/integration-tests/deployment/ccip/view/types" + "github.com/smartcontractkit/chainlink/integration-tests/deployment/ccip/view/v1_2" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/offramp" + router1_2 "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/router" +) + +type OffRampView struct { + types.ContractMetaData + DynamicConfig offramp.OffRampDynamicConfig `json:"dynamicConfig"` + LatestPriceSequenceNumber uint64 `json:"latestPriceSequenceNumber"` + SourceChainConfigs map[uint64]offramp.OffRampSourceChainConfig `json:"sourceChainConfigs"` + StaticConfig offramp.OffRampStaticConfig `json:"staticConfig"` +} + +func GenerateOffRampView( + offRampContract *offramp.OffRamp, + routerContract *router1_2.Router, +) (OffRampView, error) { + tv, err := types.NewContractMetaData(offRampContract, offRampContract.Address()) + if err != nil { + return OffRampView{}, err + } + + dynamicConfig, err := offRampContract.GetDynamicConfig(nil) + if err != nil { + return OffRampView{}, fmt.Errorf("failed to get dynamic config: %w", err) + } + + latestPriceSequenceNumber, err := offRampContract.GetLatestPriceSequenceNumber(nil) + if err != nil { + return OffRampView{}, fmt.Errorf("failed to get latest price sequence number: %w", err) + } + + sourceChainSelectors, err := v1_2.GetRemoteChainSelectors(routerContract) + if err != nil { + return OffRampView{}, fmt.Errorf("failed to get source chain selectors: %w", err) + } + sourceChainConfigs := make(map[uint64]offramp.OffRampSourceChainConfig) + for _, sourceChainSelector := range sourceChainSelectors { + sourceChainConfig, err := offRampContract.GetSourceChainConfig(nil, sourceChainSelector) + if err != nil { + return OffRampView{}, fmt.Errorf("failed to get source chain config: %w", err) + } + sourceChainConfigs[sourceChainSelector] = sourceChainConfig + } + + staticConfig, err := offRampContract.GetStaticConfig(nil) + if err != nil { + return OffRampView{}, fmt.Errorf("failed to get static config: %w", err) + } + + return OffRampView{ + ContractMetaData: tv, + DynamicConfig: dynamicConfig, + LatestPriceSequenceNumber: latestPriceSequenceNumber, + SourceChainConfigs: sourceChainConfigs, + StaticConfig: staticConfig, + }, nil +} diff --git a/integration-tests/deployment/ccip/view/v1_6/onramp.go b/integration-tests/deployment/ccip/view/v1_6/onramp.go new file mode 100644 index 00000000000..72ac9e948ef --- /dev/null +++ b/integration-tests/deployment/ccip/view/v1_6/onramp.go @@ -0,0 +1,107 @@ +package v1_6 + +import ( + "fmt" + + "github.com/ethereum/go-ethereum/common" + + "github.com/smartcontractkit/chainlink/integration-tests/deployment/ccip/view/types" + "github.com/smartcontractkit/chainlink/integration-tests/deployment/ccip/view/v1_2" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/onramp" + router1_2 "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/router" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/token_admin_registry" +) + +type OnRampView struct { + types.ContractMetaData + DynamicConfig onramp.OnRampDynamicConfig `json:"dynamicConfig"` + StaticConfig onramp.OnRampStaticConfig `json:"staticConfig"` + Owner common.Address `json:"owner"` + SourceTokenToPool map[common.Address]common.Address `json:"sourceTokenToPool"` + DestChainSpecificData map[uint64]DestChainSpecificData `json:"destChainSpecificData"` +} + +type DestChainSpecificData struct { + AllowedSendersList []common.Address `json:"allowedSendersList"` + DestChainConfig onramp.GetDestChainConfig `json:"destChainConfig"` + ExpectedNextSeqNum uint64 `json:"expectedNextSeqNum"` + Router common.Address `json:"router"` +} + +func GenerateOnRampView( + onRampContract *onramp.OnRamp, + routerContract *router1_2.Router, + taContract *token_admin_registry.TokenAdminRegistry, +) (OnRampView, error) { + tv, err := types.NewContractMetaData(onRampContract, onRampContract.Address()) + if err != nil { + return OnRampView{}, fmt.Errorf("failed to get contract metadata: %w", err) + } + dynamicConfig, err := onRampContract.GetDynamicConfig(nil) + if err != nil { + return OnRampView{}, fmt.Errorf("failed to get dynamic config: %w", err) + } + + staticConfig, err := onRampContract.GetStaticConfig(nil) + if err != nil { + return OnRampView{}, fmt.Errorf("failed to get static config: %w", err) + } + + owner, err := onRampContract.Owner(nil) + if err != nil { + return OnRampView{}, fmt.Errorf("failed to get owner: %w", err) + } + // populate destChainSelectors from router + destChainSelectors, err := v1_2.GetRemoteChainSelectors(routerContract) + if err != nil { + return OnRampView{}, fmt.Errorf("failed to get destination selectors: %w", err) + } + // populate sourceTokens from token admin registry contract + sourceTokens, err := taContract.GetAllConfiguredTokens(nil, 0, 10) + if err != nil { + return OnRampView{}, fmt.Errorf("failed to get all configured tokens: %w", err) + } + sourceTokenToPool := make(map[common.Address]common.Address) + for _, sourceToken := range sourceTokens { + pool, err := onRampContract.GetPoolBySourceToken(nil, 0, sourceToken) + if err != nil { + return OnRampView{}, fmt.Errorf("failed to get pool by source token: %w", err) + } + sourceTokenToPool[sourceToken] = pool + } + + destChainSpecificData := make(map[uint64]DestChainSpecificData) + for _, destChainSelector := range destChainSelectors { + allowedSendersList, err := onRampContract.GetAllowedSendersList(nil, destChainSelector) + if err != nil { + return OnRampView{}, fmt.Errorf("failed to get allowed senders list: %w", err) + } + destChainConfig, err := onRampContract.GetDestChainConfig(nil, destChainSelector) + if err != nil { + return OnRampView{}, fmt.Errorf("failed to get dest chain config: %w", err) + } + expectedNextSeqNum, err := onRampContract.GetExpectedNextSequenceNumber(nil, destChainSelector) + if err != nil { + return OnRampView{}, fmt.Errorf("failed to get expected next sequence number: %w", err) + } + router, err := onRampContract.GetRouter(nil, destChainSelector) + if err != nil { + return OnRampView{}, fmt.Errorf("failed to get router: %w", err) + } + destChainSpecificData[destChainSelector] = DestChainSpecificData{ + AllowedSendersList: allowedSendersList, + DestChainConfig: destChainConfig, + ExpectedNextSeqNum: expectedNextSeqNum, + Router: router, + } + } + + return OnRampView{ + ContractMetaData: tv, + DynamicConfig: dynamicConfig, + StaticConfig: staticConfig, + Owner: owner, + SourceTokenToPool: sourceTokenToPool, + DestChainSpecificData: destChainSpecificData, + }, nil +} diff --git a/integration-tests/deployment/ccip/view/v1_6/rmnremote.go b/integration-tests/deployment/ccip/view/v1_6/rmnremote.go new file mode 100644 index 00000000000..bf0fefaa2eb --- /dev/null +++ b/integration-tests/deployment/ccip/view/v1_6/rmnremote.go @@ -0,0 +1,54 @@ +package v1_6 + +import ( + "github.com/smartcontractkit/chainlink/integration-tests/deployment/ccip/view/types" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/rmn_remote" +) + +type RMNRemoteView struct { + types.ContractMetaData + IsCursed bool `json:"isCursed"` + Config RMNRemoteVersionedConfig `json:"config,omitempty"` +} + +type RMNRemoteVersionedConfig struct { + Version uint32 `json:"version"` + Signers []RMNRemoteSigner `json:"signers"` + MinSigners uint64 `json:"minSigners"` +} + +type RMNRemoteSigner struct { + OnchainPublicKey string `json:"onchain_public_key"` + NodeIndex uint64 `json:"node_index"` +} + +func GenerateRMNRemoteView(rmnReader *rmn_remote.RMNRemote) (RMNRemoteView, error) { + tv, err := types.NewContractMetaData(rmnReader, rmnReader.Address()) + if err != nil { + return RMNRemoteView{}, err + } + config, err := rmnReader.GetVersionedConfig(nil) + if err != nil { + return RMNRemoteView{}, err + } + rmnConfig := RMNRemoteVersionedConfig{ + Version: config.Version, + Signers: make([]RMNRemoteSigner, 0, len(config.Config.Signers)), + MinSigners: config.Config.MinSigners, + } + for _, signer := range config.Config.Signers { + rmnConfig.Signers = append(rmnConfig.Signers, RMNRemoteSigner{ + OnchainPublicKey: signer.OnchainPublicKey.Hex(), + NodeIndex: signer.NodeIndex, + }) + } + isCursed, err := rmnReader.IsCursed0(nil) + if err != nil { + return RMNRemoteView{}, err + } + return RMNRemoteView{ + ContractMetaData: tv, + IsCursed: isCursed, + Config: rmnConfig, + }, nil +} diff --git a/integration-tests/deployment/changeset.go b/integration-tests/deployment/changeset.go new file mode 100644 index 00000000000..6473bc1320a --- /dev/null +++ b/integration-tests/deployment/changeset.go @@ -0,0 +1,12 @@ +package deployment + +import ( + "github.com/smartcontractkit/ccip-owner-contracts/pkg/proposal/timelock" +) + +// Services as input to CI/Async tasks +type ChangesetOutput struct { + JobSpecs map[string][]string + Proposals []timelock.MCMSWithTimelockProposal + AddressBook AddressBook +} diff --git a/integration-tests/deployment/devenv/.sample.env b/integration-tests/deployment/devenv/.sample.env new file mode 100644 index 00000000000..ddf0b97e9a9 --- /dev/null +++ b/integration-tests/deployment/devenv/.sample.env @@ -0,0 +1,28 @@ +# set the following if you don't want the test to tear down the docker containers after test run is finished +# TESTCONTAINERS_RYUK_DISABLED=true + +E2E_JD_IMAGE= +E2E_JD_VERSION= + +E2E_TEST_CHAINLINK_IMAGE=public.ecr.aws/w0i8p0z9/chainlink-ccip +E2E_TEST_CHAINLINK_VERSION=2.14.0-ccip1.5.0 + +# RPC Configuration +E2E_TEST_SEPOLIA_WALLET_KEY= +E2E_TEST_SEPOLIA_RPC_HTTP_URL_1= +E2E_TEST_SEPOLIA_RPC_HTTP_URL_2= +E2E_TEST_SEPOLIA_RPC_WS_URL_1= +E2E_TEST_SEPOLIA_RPC_WS_URL_2= + +E2E_TEST_AVALANCHE_FUJI_WALLET_KEY= +E2E_TEST_AVALANCHE_FUJI_RPC_HTTP_URL_1= +E2E_TEST_AVALANCHE_FUJI_RPC_HTTP_URL_2= +E2E_TEST_AVALANCHE_FUJI_RPC_WS_URL_1= +E2E_TEST_AVALANCHE_FUJI_RPC_WS_URL_2= + +E2E_TEST_BSC_TESTNET_WALLET_KEY= +E2E_TEST_BSC_TESTNET_RPC_HTTP_URL_1= +E2E_TEST_BSC_TESTNET_RPC_HTTP_URL_2= +E2E_TEST_BSC_TESTNET_RPC_WS_URL_1= +E2E_TEST_BSC_TESTNET_RPC_WS_URL_2= + diff --git a/integration-tests/deployment/devenv/README.md b/integration-tests/deployment/devenv/README.md new file mode 100644 index 00000000000..cb2b5cb8d6f --- /dev/null +++ b/integration-tests/deployment/devenv/README.md @@ -0,0 +1,49 @@ +## Overview + +This package is used to create ephemeral environment for local/CI testing. +It sets up an environment with local Docker containers running Chainlink nodes and a job distributor. +It can either create new simulated private Ethereum network containers or connect to existing testnets/mainnets. + +### Run Tests with Devenv + +The tests created with this environment are run as [end-to-end integration smoke tests](../../smoke). + +Pre-requisites: +- Docker +- Pull access for chainlink and job-distributor images + +#### Setting Up Testconfig with Simulated Private Ethereum Network + +To run tests (e.g., [ccip-test](../../smoke/ccip_test.go)), +you need to set up the testconfig following the [testconfig setup instructions](../../testconfig/README.md). +The testconfig specifies the details of the different configurations to set up the environment and run the tests. +Generally, tests are run with the [default](../../testconfig/default.toml) config unless overridden by product-specific config. +For example, the [ccip-test](../../smoke/ccip_test.go) uses [ccip.toml](../../testconfig/ccip/ccip.toml) to specify +CCIP-specific test environment details. + +There are additional secret configuration parameters required by the `devenv` environment that are not stored in the testconfig. +These are read from environment variables. For example, Chainlink image, Job-Distributor image, etc. +All such environment variables are listed in the [sample.env](./.sample.env) file. +You can create a `.env` file in the same directory of the test and set the required environment variables. + +#### Setting Up Testconfig for Running Tests with Existing Testnet/Mainnet + +To run tests with existing testnet/mainnet, set up the testconfig with the details of the testnet/mainnet networks. +Following the integration-test [testconfig framework](../../testconfig/README.md#configuration-and-overrides), +create a new `overrides.toml` file with testnet/mainnet network details and place it under any location in the `integration-tests` directory. +By default, tests are run with private Ethereum network containers set up in the same Docker network as +the Chainlink nodes and job distributor. To run tests against existing testnet/mainnet, +set the `selected_network` field in the testconfig with the specific network names. + +For example, if running [ccip-smoke](../../smoke/ccip_test.go) tests with Sepolia, Avax, and Binance testnets, +copy the contents of [sepolia_avax_binance.toml](../../testconfig/ccip/overrides/sepolia_avax_binance.toml) +to the `overrides.toml` file. + +Before running the test, ensure that RPC and wallet secrets are set as environment variables. +Refer to the environment variables pattern in the [sample.env](./.sample.env) file to +provide necessary secrets applicable to the network you are running the tests against: +- `E2E_TEST__WALLET_KEY_` +- `E2E_TEST__RPC_HTTP_URL_` +- `E2E_TEST__RPC_WS_URL_` + +Now you are all set to run the tests with the existing testnet/mainnet. \ No newline at end of file diff --git a/integration-tests/deployment/devenv/build_env.go b/integration-tests/deployment/devenv/build_env.go new file mode 100644 index 00000000000..a36a6f51a69 --- /dev/null +++ b/integration-tests/deployment/devenv/build_env.go @@ -0,0 +1,347 @@ +package devenv + +import ( + "fmt" + "math/big" + "os" + "strconv" + "testing" + + "github.com/AlekSi/pointer" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/crypto" + "github.com/rs/zerolog" + chainselectors "github.com/smartcontractkit/chain-selectors" + "github.com/stretchr/testify/require" + "github.com/subosito/gotenv" + + "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/conversions" + "github.com/smartcontractkit/chainlink-testing-framework/seth" + + ctf_config "github.com/smartcontractkit/chainlink-testing-framework/lib/config" + ctftestenv "github.com/smartcontractkit/chainlink-testing-framework/lib/docker/test_env" + "github.com/smartcontractkit/chainlink-testing-framework/lib/docker/test_env/job_distributor" + "github.com/smartcontractkit/chainlink-testing-framework/lib/networks" + "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/ptr" + + "github.com/smartcontractkit/chainlink/integration-tests/actions" + "github.com/smartcontractkit/chainlink/integration-tests/ccip-tests/testsetups" + clclient "github.com/smartcontractkit/chainlink/integration-tests/client" + "github.com/smartcontractkit/chainlink/integration-tests/contracts" + "github.com/smartcontractkit/chainlink/integration-tests/deployment" + "github.com/smartcontractkit/chainlink/integration-tests/docker/test_env" + tc "github.com/smartcontractkit/chainlink/integration-tests/testconfig" + "github.com/smartcontractkit/chainlink/integration-tests/utils" + "github.com/smartcontractkit/chainlink/v2/core/services/relay" +) + +// CreateDockerEnv creates a new test environment with simulated private ethereum networks and job distributor +// It returns the EnvironmentConfig which holds the chain config and JD config +// The test environment is then used to start chainlink nodes +func CreateDockerEnv(t *testing.T) ( + *EnvironmentConfig, + *test_env.CLClusterTestEnv, + tc.TestConfig, +) { + if _, err := os.Stat(".env"); err == nil || !os.IsNotExist(err) { + require.NoError(t, gotenv.Load(".env"), "Error loading .env file") + } + + cfg, err := tc.GetChainAndTestTypeSpecificConfig("Smoke", tc.CCIP) + require.NoError(t, err, "Error getting config") + + evmNetworks := networks.MustGetSelectedNetworkConfig(cfg.GetNetworkConfig()) + + // find out if the selected networks are provided with PrivateEthereumNetworks configs + // if yes, PrivateEthereumNetworkConfig will be used to create simulated private ethereum networks in docker environment + var privateEthereumNetworks []*ctf_config.EthereumNetworkConfig + for _, name := range cfg.GetNetworkConfig().SelectedNetworks { + if network, exists := cfg.CCIP.PrivateEthereumNetworks[name]; exists { + privateEthereumNetworks = append(privateEthereumNetworks, network) + } + } + + builder := test_env.NewCLTestEnvBuilder(). + WithTestConfig(&cfg). + WithTestInstance(t). + WithStandardCleanup() + + // if private ethereum networks are provided, we will use them to create the test environment + // otherwise we will use the network URLs provided in the network config + if len(privateEthereumNetworks) > 0 { + builder = builder.WithPrivateEthereumNetworks(privateEthereumNetworks) + } + env, err := builder.Build() + require.NoError(t, err, "Error building test environment") + + chains := CreateChainConfigFromNetworks(t, env, privateEthereumNetworks, cfg.GetNetworkConfig()) + + var jdConfig JDConfig + // TODO : move this as a part of test_env setup with an input in testconfig + // if JD is not provided, we will spin up a new JD + if cfg.CCIP.GetJDGRPC() == "" && cfg.CCIP.GetJDWSRPC() == "" { + jdDB, err := ctftestenv.NewPostgresDb( + []string{env.DockerNetwork.Name}, + ctftestenv.WithPostgresDbName(cfg.CCIP.GetJDDBName()), + ctftestenv.WithPostgresImageVersion(cfg.CCIP.GetJDDBVersion()), + ) + require.NoError(t, err) + err = jdDB.StartContainer() + require.NoError(t, err) + + jd := job_distributor.New([]string{env.DockerNetwork.Name}, + job_distributor.WithImage(cfg.CCIP.GetJDImage()), + job_distributor.WithVersion(cfg.CCIP.GetJDVersion()), + job_distributor.WithDBURL(jdDB.InternalURL.String()), + ) + err = jd.StartContainer() + require.NoError(t, err) + jdConfig = JDConfig{ + GRPC: jd.Grpc, + // we will use internal wsrpc for nodes on same docker network to connect to JD + WSRPC: jd.InternalWSRPC, + } + } else { + jdConfig = JDConfig{ + GRPC: cfg.CCIP.GetJDGRPC(), + WSRPC: cfg.CCIP.GetJDWSRPC(), + } + } + require.NotEmpty(t, jdConfig, "JD config is empty") + + homeChainSelector, err := cfg.CCIP.GetHomeChainSelector(evmNetworks) + require.NoError(t, err, "Error getting home chain selector") + feedChainSelector, err := cfg.CCIP.GetFeedChainSelector(evmNetworks) + require.NoError(t, err, "Error getting feed chain selector") + + return &EnvironmentConfig{ + Chains: chains, + JDConfig: jdConfig, + HomeChainSelector: homeChainSelector, + FeedChainSelector: feedChainSelector, + }, env, cfg +} + +// StartChainlinkNodes starts docker containers for chainlink nodes on the existing test environment based on provided test config +// Once the nodes starts, it updates the devenv EnvironmentConfig with the node info +// which includes chainlink API URL, email, password and internal IP +func StartChainlinkNodes( + t *testing.T, + envConfig *EnvironmentConfig, + registryConfig deployment.CapabilityRegistryConfig, + env *test_env.CLClusterTestEnv, + cfg tc.TestConfig, +) error { + evmNetworks := networks.MustGetSelectedNetworkConfig(cfg.GetNetworkConfig()) + for i, net := range evmNetworks { + // if network is simulated, update the URLs with private chain RPCs in the docker test environment + // so that nodes can internally connect to the chain + if net.Simulated { + rpcProvider, err := env.GetRpcProvider(net.ChainID) + require.NoError(t, err, "Error getting rpc provider") + evmNetworks[i].HTTPURLs = rpcProvider.PrivateHttpUrls() + evmNetworks[i].URLs = rpcProvider.PrivateWsUrsl() + } + } + noOfNodes := pointer.GetInt(cfg.CCIP.CLNode.NoOfPluginNodes) + pointer.GetInt(cfg.CCIP.CLNode.NoOfBootstraps) + if env.ClCluster == nil { + env.ClCluster = &test_env.ClCluster{} + } + var nodeInfo []NodeInfo + for i := 1; i <= noOfNodes; i++ { + if i <= pointer.GetInt(cfg.CCIP.CLNode.NoOfBootstraps) { + nodeInfo = append(nodeInfo, NodeInfo{ + IsBootstrap: true, + Name: fmt.Sprintf("bootstrap-%d", i), + // TODO : make this configurable + P2PPort: "6690", + }) + } else { + nodeInfo = append(nodeInfo, NodeInfo{ + IsBootstrap: false, + Name: fmt.Sprintf("node-%d", i-1), + // TODO : make this configurable + P2PPort: "6690", + }) + } + toml, _, err := testsetups.SetNodeConfig( + evmNetworks, + cfg.NodeConfig.BaseConfigTOML, + cfg.NodeConfig.CommonChainConfigTOML, + cfg.NodeConfig.ChainConfigTOMLByChainID, + ) + + toml.Capabilities.ExternalRegistry.NetworkID = ptr.Ptr(relay.NetworkEVM) + toml.Capabilities.ExternalRegistry.ChainID = ptr.Ptr(strconv.FormatUint(registryConfig.EVMChainID, 10)) + toml.Capabilities.ExternalRegistry.Address = ptr.Ptr(registryConfig.Contract.String()) + + if err != nil { + return err + } + ccipNode, err := test_env.NewClNode( + []string{env.DockerNetwork.Name}, + pointer.GetString(cfg.GetChainlinkImageConfig().Image), + pointer.GetString(cfg.GetChainlinkImageConfig().Version), + toml, + env.LogStream, + test_env.WithPgDBOptions( + ctftestenv.WithPostgresImageVersion(pointer.GetString(cfg.GetChainlinkImageConfig().PostgresVersion)), + ), + ) + if err != nil { + return err + } + ccipNode.SetTestLogger(t) + env.ClCluster.Nodes = append(env.ClCluster.Nodes, ccipNode) + } + err := env.ClCluster.Start() + if err != nil { + return err + } + for i, n := range env.ClCluster.Nodes { + nodeInfo[i].CLConfig = clclient.ChainlinkConfig{ + URL: n.API.URL(), + Email: n.UserEmail, + Password: n.UserPassword, + InternalIP: n.API.InternalIP(), + } + } + envConfig.nodeInfo = nodeInfo + return nil +} + +// FundNodes sends funds to the chainlink nodes based on the provided test config +// It also sets up a clean-up function to return the funds back to the deployer account once the test is done +// It assumes that the chainlink nodes are already started and the account addresses for all chains are available +func FundNodes(t *testing.T, lggr zerolog.Logger, env *test_env.CLClusterTestEnv, cfg tc.TestConfig, nodes []Node) { + evmNetworks := networks.MustGetSelectedNetworkConfig(cfg.GetNetworkConfig()) + for i, net := range evmNetworks { + // if network is simulated, update the URLs with deployed chain RPCs in the docker test environment + if net.Simulated { + rpcProvider, err := env.GetRpcProvider(net.ChainID) + require.NoError(t, err, "Error getting rpc provider") + evmNetworks[i].HTTPURLs = rpcProvider.PublicHttpUrls() + evmNetworks[i].URLs = rpcProvider.PublicWsUrls() + } + } + t.Cleanup(func() { + for i := range evmNetworks { + // if simulated no need for balance return + if evmNetworks[i].Simulated { + continue + } + evmNetwork := evmNetworks[i] + sethClient, err := utils.TestAwareSethClient(t, cfg, &evmNetwork) + require.NoError(t, err, "Error getting seth client for network %s", evmNetwork.Name) + require.Greater(t, len(sethClient.PrivateKeys), 0, seth.ErrNoKeyLoaded) + var keyExporters []contracts.ChainlinkKeyExporter + for j := range nodes { + node := nodes[j] + keyExporters = append(keyExporters, &node) + } + if err := actions.ReturnFundsFromKeyExporterNodes(lggr, sethClient, keyExporters); err != nil { + lggr.Error().Err(err).Str("Network", evmNetwork.Name). + Msg("Error attempting to return funds from chainlink nodes to network's default wallet. " + + "Environment is left running so you can try manually!") + } + } + }) + for i := range evmNetworks { + evmNetwork := evmNetworks[i] + sethClient, err := utils.TestAwareSethClient(t, cfg, &evmNetwork) + require.NoError(t, err, "Error getting seth client for network %s", evmNetwork.Name) + require.Greater(t, len(sethClient.PrivateKeys), 0, seth.ErrNoKeyLoaded) + privateKey := sethClient.PrivateKeys[0] + for _, node := range nodes { + nodeAddr, ok := node.AccountAddr[uint64(evmNetwork.ChainID)] + require.True(t, ok, "Account address not found for chain %d", evmNetwork.ChainID) + fromAddress, err := actions.PrivateKeyToAddress(privateKey) + require.NoError(t, err, "Error getting address from private key") + amount := big.NewFloat(pointer.GetFloat64(cfg.Common.ChainlinkNodeFunding)) + toAddr := common.HexToAddress(nodeAddr) + receipt, err := actions.SendFunds(lggr, sethClient, actions.FundsToSendPayload{ + ToAddress: toAddr, + Amount: conversions.EtherToWei(amount), + PrivateKey: privateKey, + }) + require.NoError(t, err, "Error sending funds to node %s", node.Name) + require.NotNil(t, receipt, "Receipt is nil") + txHash := "(none)" + if receipt != nil { + txHash = receipt.TxHash.String() + } + lggr.Info(). + Str("From", fromAddress.Hex()). + Str("To", toAddr.String()). + Str("TxHash", txHash). + Str("Amount", amount.String()). + Msg("Funded Chainlink node") + } + } +} + +// CreateChainConfigFromNetworks creates a list of ChainConfig from the network config provided in test config. +// It either creates it from the private ethereum networks created by the test environment or from the +// network URLs provided in the network config ( if the network is a live testnet). +// It uses the private keys from the network config to create the deployer key for each chain. +func CreateChainConfigFromNetworks( + t *testing.T, + env *test_env.CLClusterTestEnv, + privateEthereumNetworks []*ctf_config.EthereumNetworkConfig, + networkConfig *ctf_config.NetworkConfig, +) []ChainConfig { + evmNetworks := networks.MustGetSelectedNetworkConfig(networkConfig) + networkPvtKeys := make(map[int64]string) + for _, net := range evmNetworks { + require.Greater(t, len(net.PrivateKeys), 0, "No private keys found for network") + networkPvtKeys[net.ChainID] = net.PrivateKeys[0] + } + var chains []ChainConfig + // if private ethereum networks are not provided, we will create chains from the network URLs + if len(privateEthereumNetworks) == 0 { + for _, net := range evmNetworks { + chainId := net.ChainID + chainName, err := chainselectors.NameFromChainId(uint64(chainId)) + require.NoError(t, err, "Error getting chain name") + pvtKeyStr, exists := networkPvtKeys[chainId] + require.Truef(t, exists, "Private key not found for chain id %d", chainId) + pvtKey, err := crypto.HexToECDSA(pvtKeyStr) + require.NoError(t, err) + deployer, err := bind.NewKeyedTransactorWithChainID(pvtKey, big.NewInt(chainId)) + require.NoError(t, err) + deployer.GasLimit = net.DefaultGasLimit + chains = append(chains, ChainConfig{ + ChainID: uint64(chainId), + ChainName: chainName, + ChainType: "EVM", + WSRPCs: net.URLs, + HTTPRPCs: net.HTTPURLs, + DeployerKey: deployer, + }) + } + return chains + } + for _, networkCfg := range privateEthereumNetworks { + chainId := networkCfg.EthereumChainConfig.ChainID + chainName, err := chainselectors.NameFromChainId(uint64(chainId)) + require.NoError(t, err, "Error getting chain name") + rpcProvider, err := env.GetRpcProvider(int64(chainId)) + require.NoError(t, err, "Error getting rpc provider") + pvtKeyStr, exists := networkPvtKeys[int64(chainId)] + require.Truef(t, exists, "Private key not found for chain id %d", chainId) + pvtKey, err := crypto.HexToECDSA(pvtKeyStr) + require.NoError(t, err) + deployer, err := bind.NewKeyedTransactorWithChainID(pvtKey, big.NewInt(int64(chainId))) + require.NoError(t, err) + chains = append(chains, ChainConfig{ + ChainID: uint64(chainId), + ChainName: chainName, + ChainType: EVMChainType, + WSRPCs: rpcProvider.PublicWsUrls(), + HTTPRPCs: rpcProvider.PublicHttpUrls(), + DeployerKey: deployer, + }) + } + return chains +} diff --git a/integration-tests/deployment/devenv/chain.go b/integration-tests/deployment/devenv/chain.go new file mode 100644 index 00000000000..de02437fec7 --- /dev/null +++ b/integration-tests/deployment/devenv/chain.go @@ -0,0 +1,95 @@ +package devenv + +import ( + "context" + "fmt" + "time" + + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/ethclient" + "github.com/sethvargo/go-retry" + chainselectors "github.com/smartcontractkit/chain-selectors" + + "github.com/smartcontractkit/chainlink-common/pkg/logger" + + "github.com/smartcontractkit/chainlink/integration-tests/deployment" +) + +const ( + EVMChainType = "EVM" +) + +// ChainConfig holds the configuration for a with a deployer key which can be used to send transactions to the chain. +type ChainConfig struct { + ChainID uint64 // chain id as per EIP-155, mainly applicable for EVM chains + ChainName string // name of the chain populated from chainselector repo + ChainType string // should denote the chain family. Acceptable values are EVM, COSMOS, SOLANA, STARKNET, APTOS etc + WSRPCs []string // websocket rpcs to connect to the chain + HTTPRPCs []string // http rpcs to connect to the chain + DeployerKey *bind.TransactOpts // key to send transactions to the chain +} + +func NewChains(logger logger.Logger, configs []ChainConfig) (map[uint64]deployment.Chain, error) { + chains := make(map[uint64]deployment.Chain) + for _, chainCfg := range configs { + selector, err := chainselectors.SelectorFromChainId(chainCfg.ChainID) + if err != nil { + return nil, fmt.Errorf("failed to get selector from chain id %d: %w", chainCfg.ChainID, err) + } + // TODO : better client handling + var ec *ethclient.Client + for _, rpc := range chainCfg.WSRPCs { + ec, err = ethclient.Dial(rpc) + if err != nil { + logger.Warnf("failed to dial ws rpc %s", rpc) + continue + } + logger.Infof("connected to ws rpc %s", rpc) + break + } + if ec == nil { + return nil, fmt.Errorf("failed to connect to chain %s", chainCfg.ChainName) + } + chains[selector] = deployment.Chain{ + Selector: selector, + Client: ec, + DeployerKey: chainCfg.DeployerKey, + Confirm: func(tx *types.Transaction) (uint64, error) { + var blockNumber uint64 + if tx == nil { + return 0, fmt.Errorf("tx was nil, nothing to confirm") + } + err := retry.Do(context.Background(), + retry.WithMaxDuration(3*time.Minute, retry.NewFibonacci(1*time.Second)), + func(ctx context.Context) error { + chainId, err := ec.ChainID(ctx) + if err != nil { + return fmt.Errorf("failed to get chain id: %w", err) + } + receipt, err := bind.WaitMined(ctx, ec, tx) + if err != nil { + return retry.RetryableError(fmt.Errorf("failed to get receipt for chain %d: %w", chainId, err)) + } + if receipt != nil { + blockNumber = receipt.BlockNumber.Uint64() + } + if receipt.Status == 0 { + t, _, err := ec.TransactionByHash(context.Background(), tx.Hash()) + if err != nil { + return fmt.Errorf("tx %s reverted, failed to get transaction: %w", tx.Hash().Hex(), err) + } + errReason, err := deployment.GetErrorReasonFromTx(ec, chainCfg.DeployerKey.From, *t, receipt) + if err == nil && errReason != "" { + return fmt.Errorf("tx %s reverted,error reason: %s", tx.Hash().Hex(), errReason) + } + return fmt.Errorf("tx %s reverted, could not decode error reason", tx.Hash().Hex()) + } + return nil + }) + return blockNumber, err + }, + } + } + return chains, nil +} diff --git a/integration-tests/deployment/devenv/don.go b/integration-tests/deployment/devenv/don.go new file mode 100644 index 00000000000..9478b729f29 --- /dev/null +++ b/integration-tests/deployment/devenv/don.go @@ -0,0 +1,330 @@ +package devenv + +import ( + "context" + "fmt" + "strconv" + "strings" + + "github.com/AlekSi/pointer" + "github.com/hashicorp/go-multierror" + "github.com/rs/zerolog" + chainsel "github.com/smartcontractkit/chain-selectors" + + clclient "github.com/smartcontractkit/chainlink/integration-tests/client" + nodev1 "github.com/smartcontractkit/chainlink/integration-tests/deployment/jd/node/v1" + "github.com/smartcontractkit/chainlink/integration-tests/deployment/jd/shared/ptypes" + "github.com/smartcontractkit/chainlink/integration-tests/web/sdk/client" +) + +const ( + NodeLabelKeyType = "type" + NodeLabelValueBootstrap = "bootstrap" + NodeLabelValuePlugin = "plugin" +) + +// NodeInfo holds the information required to create a node +type NodeInfo struct { + CLConfig clclient.ChainlinkConfig // config to connect to chainlink node via API + P2PPort string // port for P2P communication + IsBootstrap bool // denotes if the node is a bootstrap node + Name string // name of the node, used to identify the node, helpful in logs + AdminAddr string // admin address to send payments to, applicable only for non-bootstrap nodes +} + +type DON struct { + Nodes []Node +} + +func (don *DON) PluginNodes() []Node { + var pluginNodes []Node + for _, node := range don.Nodes { + for _, label := range node.labels { + if label.Key == NodeLabelKeyType && pointer.GetString(label.Value) == NodeLabelValuePlugin { + pluginNodes = append(pluginNodes, node) + } + } + } + return pluginNodes +} + +// ReplayAllLogs replays all logs for the chains on all nodes for given block numbers for each chain +func (don *DON) ReplayAllLogs(blockbyChain map[uint64]uint64) error { + for _, node := range don.Nodes { + if err := node.ReplayLogs(blockbyChain); err != nil { + return err + } + } + return nil +} + +func (don *DON) NodeIds() []string { + var nodeIds []string + for _, node := range don.Nodes { + nodeIds = append(nodeIds, node.NodeId) + } + return nodeIds +} + +func (don *DON) CreateSupportedChains(ctx context.Context, chains []ChainConfig, jd JobDistributor) error { + var err error + for i := range don.Nodes { + node := &don.Nodes[i] + if err1 := node.CreateCCIPOCRSupportedChains(ctx, chains, jd); err1 != nil { + err = multierror.Append(err, err1) + } + don.Nodes[i] = *node + } + return err +} + +// NewRegisteredDON creates a DON with the given node info, registers the nodes with the job distributor +// and sets up the job distributor in the nodes +func NewRegisteredDON(ctx context.Context, nodeInfo []NodeInfo, jd JobDistributor) (*DON, error) { + don := &DON{ + Nodes: make([]Node, 0), + } + for i, info := range nodeInfo { + if info.Name == "" { + info.Name = fmt.Sprintf("node-%d", i) + } + node, err := NewNode(info) + if err != nil { + return nil, fmt.Errorf("failed to create node %d: %w", i, err) + } + // node Labels so that it's easier to query them + if info.IsBootstrap { + // create multi address for OCR2, applicable only for bootstrap nodes + + node.multiAddr = fmt.Sprintf("%s:%s", info.CLConfig.InternalIP, info.P2PPort) + // no need to set admin address for bootstrap nodes, as there will be no payment + node.adminAddr = "" + node.labels = append(node.labels, &ptypes.Label{ + Key: NodeLabelKeyType, + Value: pointer.ToString(NodeLabelValueBootstrap), + }) + } else { + // multi address is not applicable for non-bootstrap nodes + // explicitly set it to empty string to denote that + node.multiAddr = "" + node.labels = append(node.labels, &ptypes.Label{ + Key: NodeLabelKeyType, + Value: pointer.ToString(NodeLabelValuePlugin), + }) + } + // Set up Job distributor in node and register node with the job distributor + err = node.SetUpAndLinkJobDistributor(ctx, jd) + if err != nil { + return nil, fmt.Errorf("failed to set up job distributor in node %s: %w", info.Name, err) + } + + don.Nodes = append(don.Nodes, *node) + } + return don, nil +} + +func NewNode(nodeInfo NodeInfo) (*Node, error) { + gqlClient, err := client.New(nodeInfo.CLConfig.URL, client.Credentials{ + Email: nodeInfo.CLConfig.Email, + Password: nodeInfo.CLConfig.Password, + }) + if err != nil { + return nil, fmt.Errorf("failed to create node graphql client: %w", err) + } + chainlinkClient, err := clclient.NewChainlinkClient(&nodeInfo.CLConfig, zerolog.Logger{}) + if err != nil { + return nil, fmt.Errorf("failed to create node rest client: %w", err) + } + return &Node{ + gqlClient: gqlClient, + restClient: chainlinkClient, + Name: nodeInfo.Name, + adminAddr: nodeInfo.AdminAddr, + }, nil +} + +type Node struct { + NodeId string // node id returned by job distributor after node is registered with it + JDId string // job distributor id returned by node after Job distributor is created in node + Name string // name of the node + AccountAddr map[uint64]string // chain selector to node's account address mapping for supported chains + gqlClient client.Client // graphql client to interact with the node + restClient *clclient.ChainlinkClient // rest client to interact with the node + labels []*ptypes.Label // labels with which the node is registered with the job distributor + adminAddr string // admin address to send payments to, applicable only for non-bootstrap nodes + multiAddr string // multi address denoting node's FQN (needed for deriving P2PBootstrappers in OCR), applicable only for bootstrap nodes +} + +// CreateCCIPOCRSupportedChains creates a JobDistributorChainConfig for the node. +// It works under assumption that the node is already registered with the job distributor. +// It expects bootstrap nodes to have label with key "type" and value as "bootstrap". +// It fetches the account address, peer id, and OCR2 key bundle id and creates the JobDistributorChainConfig. +func (n *Node) CreateCCIPOCRSupportedChains(ctx context.Context, chains []ChainConfig, jd JobDistributor) error { + for _, chain := range chains { + chainId := strconv.FormatUint(chain.ChainID, 10) + accountAddr, err := n.gqlClient.FetchAccountAddress(ctx, chainId) + if err != nil { + return fmt.Errorf("failed to fetch account address for node %s: %w", n.Name, err) + } + if accountAddr == nil { + return fmt.Errorf("no account address found for node %s", n.Name) + } + if n.AccountAddr == nil { + n.AccountAddr = make(map[uint64]string) + } + n.AccountAddr[chain.ChainID] = *accountAddr + peerID, err := n.gqlClient.FetchP2PPeerID(ctx) + if err != nil { + return fmt.Errorf("failed to fetch peer id for node %s: %w", n.Name, err) + } + if peerID == nil { + return fmt.Errorf("no peer id found for node %s", n.Name) + } + + ocr2BundleId, err := n.gqlClient.FetchOCR2KeyBundleID(ctx, chain.ChainType) + if err != nil { + return fmt.Errorf("failed to fetch OCR2 key bundle id for node %s: %w", n.Name, err) + } + if ocr2BundleId == "" { + return fmt.Errorf("no OCR2 key bundle id found for node %s", n.Name) + } + // fetch node labels to know if the node is bootstrap or plugin + isBootstrap := false + for _, label := range n.labels { + if label.Key == NodeLabelKeyType && pointer.GetString(label.Value) == NodeLabelValueBootstrap { + isBootstrap = true + break + } + } + // JD silently fails to update nodeChainConfig. Therefore, we fetch the node config and + // if it's not updated , we retry creating the chain config. + // as a workaround, we keep trying creating the chain config for 3 times until it's created + retryCount := 1 + for retryCount < 3 { + err = n.gqlClient.CreateJobDistributorChainConfig(ctx, client.JobDistributorChainConfigInput{ + JobDistributorID: n.JDId, + ChainID: chainId, + ChainType: chain.ChainType, + AccountAddr: pointer.GetString(accountAddr), + AdminAddr: n.adminAddr, + Ocr2Enabled: true, + Ocr2IsBootstrap: isBootstrap, + Ocr2Multiaddr: n.multiAddr, + Ocr2P2PPeerID: pointer.GetString(peerID), + Ocr2KeyBundleID: ocr2BundleId, + Ocr2Plugins: `{"commit":true,"execute":true,"median":false,"mercury":false}`, + }) + if err != nil { + return fmt.Errorf("failed to create CCIPOCR2SupportedChains for node %s: %w", n.Name, err) + } + + nodeChainConfigs, err := jd.ListNodeChainConfigs(context.Background(), &nodev1.ListNodeChainConfigsRequest{ + Filter: &nodev1.ListNodeChainConfigsRequest_Filter{ + NodeIds: []string{n.NodeId}, + }}) + if err != nil { + return fmt.Errorf("failed to list node chain configs for node %s: %w", n.Name, err) + } + if nodeChainConfigs != nil && len(nodeChainConfigs.ChainConfigs) > 0 { + break + } + retryCount++ + } + } + return nil +} + +func (n *Node) AcceptJob(ctx context.Context, id string) error { + spec, err := n.gqlClient.ApproveJobProposalSpec(ctx, id, false) + if err != nil { + return err + } + if spec == nil { + return fmt.Errorf("no job proposal spec found for job id %s", id) + } + return nil +} + +// RegisterNodeToJobDistributor fetches the CSA public key of the node and registers the node with the job distributor +// it sets the node id returned by JobDistributor as a result of registration in the node struct +func (n *Node) RegisterNodeToJobDistributor(ctx context.Context, jd JobDistributor) error { + // Get the public key of the node + csaKeyRes, err := n.gqlClient.FetchCSAPublicKey(ctx) + if err != nil { + return err + } + if csaKeyRes == nil { + return fmt.Errorf("no csa key found for node %s", n.Name) + } + csaKey := strings.TrimPrefix(*csaKeyRes, "csa_") + // register the node in the job distributor + registerResponse, err := jd.RegisterNode(ctx, &nodev1.RegisterNodeRequest{ + PublicKey: csaKey, + Labels: n.labels, + Name: n.Name, + }) + + if err != nil { + return fmt.Errorf("failed to register node %s: %w", n.Name, err) + } + if registerResponse.GetNode().GetId() == "" { + return fmt.Errorf("no node id returned from job distributor for node %s", n.Name) + } + n.NodeId = registerResponse.GetNode().GetId() + return nil +} + +// CreateJobDistributor fetches the keypairs from the job distributor and creates the job distributor in the node +// and returns the job distributor id +func (n *Node) CreateJobDistributor(ctx context.Context, jd JobDistributor) (string, error) { + // Get the keypairs from the job distributor + csaKey, err := jd.GetCSAPublicKey(ctx) + if err != nil { + return "", err + } + // create the job distributor in the node with the csa key + return n.gqlClient.CreateJobDistributor(ctx, client.JobDistributorInput{ + Name: "Job Distributor", + Uri: jd.WSRPC, + PublicKey: csaKey, + }) +} + +// SetUpAndLinkJobDistributor sets up the job distributor in the node and registers the node with the job distributor +// it sets the job distributor id for node +func (n *Node) SetUpAndLinkJobDistributor(ctx context.Context, jd JobDistributor) error { + // register the node in the job distributor + err := n.RegisterNodeToJobDistributor(ctx, jd) + if err != nil { + return err + } + // now create the job distributor in the node + id, err := n.CreateJobDistributor(ctx, jd) + if err != nil { + return err + } + n.JDId = id + return nil +} + +func (n *Node) ExportEVMKeysForChain(chainId string) ([]*clclient.ExportedEVMKey, error) { + return n.restClient.ExportEVMKeysForChain(chainId) +} + +// ReplayLogs replays logs for the chains on the node for given block numbers for each chain +func (n *Node) ReplayLogs(blockByChain map[uint64]uint64) error { + for sel, block := range blockByChain { + chainID, err := chainsel.ChainIdFromSelector(sel) + if err != nil { + return err + } + response, _, err := n.restClient.ReplayLogPollerFromBlock(int64(block), int64(chainID)) + if err != nil { + return err + } + if response.Data.Attributes.Message != "Replay started" { + return fmt.Errorf("unexpected response message from log poller's replay: %s", response.Data.Attributes.Message) + } + } + return nil +} diff --git a/integration-tests/deployment/devenv/environment.go b/integration-tests/deployment/devenv/environment.go new file mode 100644 index 00000000000..74cde258cc3 --- /dev/null +++ b/integration-tests/deployment/devenv/environment.go @@ -0,0 +1,56 @@ +package devenv + +import ( + "context" + "fmt" + + "github.com/smartcontractkit/chainlink-common/pkg/logger" + + "github.com/smartcontractkit/chainlink/integration-tests/deployment" +) + +const ( + DevEnv = "devenv" +) + +type EnvironmentConfig struct { + Chains []ChainConfig + HomeChainSelector uint64 + FeedChainSelector uint64 + nodeInfo []NodeInfo + JDConfig JDConfig +} + +func NewEnvironment(ctx context.Context, lggr logger.Logger, config EnvironmentConfig) (*deployment.Environment, *DON, error) { + chains, err := NewChains(lggr, config.Chains) + if err != nil { + return nil, nil, fmt.Errorf("failed to create chains: %w", err) + } + offChain, err := NewJDClient(config.JDConfig) + if err != nil { + return nil, nil, fmt.Errorf("failed to create JD client: %w", err) + } + + jd, ok := offChain.(JobDistributor) + if !ok { + return nil, nil, fmt.Errorf("offchain client does not implement JobDistributor") + } + don, err := NewRegisteredDON(ctx, config.nodeInfo, jd) + if err != nil { + return nil, nil, fmt.Errorf("failed to create registered DON: %w", err) + } + nodeIDs := don.NodeIds() + + err = don.CreateSupportedChains(ctx, config.Chains, jd) + if err != nil { + return nil, nil, err + } + + return &deployment.Environment{ + Name: DevEnv, + Offchain: offChain, + NodeIDs: nodeIDs, + Chains: chains, + Logger: lggr, + }, don, nil +} diff --git a/integration-tests/deployment/devenv/jd.go b/integration-tests/deployment/devenv/jd.go new file mode 100644 index 00000000000..671e6e4cea3 --- /dev/null +++ b/integration-tests/deployment/devenv/jd.go @@ -0,0 +1,71 @@ +package devenv + +import ( + "context" + "fmt" + + "google.golang.org/grpc" + "google.golang.org/grpc/credentials" + "google.golang.org/grpc/credentials/insecure" + + "github.com/smartcontractkit/chainlink/integration-tests/deployment" + csav1 "github.com/smartcontractkit/chainlink/integration-tests/deployment/jd/csa/v1" + jobv1 "github.com/smartcontractkit/chainlink/integration-tests/deployment/jd/job/v1" + nodev1 "github.com/smartcontractkit/chainlink/integration-tests/deployment/jd/node/v1" +) + +type JDConfig struct { + GRPC string + WSRPC string + creds credentials.TransportCredentials +} + +func NewJDConnection(cfg JDConfig) (*grpc.ClientConn, error) { + var opts []grpc.DialOption + // TODO: add auth details + if cfg.creds != nil { + opts = append(opts, grpc.WithTransportCredentials(cfg.creds)) + } else { + opts = append(opts, grpc.WithTransportCredentials(insecure.NewCredentials())) + + } + + conn, err := grpc.NewClient(cfg.GRPC, opts...) + if err != nil { + return nil, fmt.Errorf("failed to connect Job Distributor service. Err: %w", err) + } + + return conn, nil +} + +type JobDistributor struct { + WSRPC string + nodev1.NodeServiceClient + jobv1.JobServiceClient + csav1.CSAServiceClient +} + +func NewJDClient(cfg JDConfig) (deployment.OffchainClient, error) { + conn, err := NewJDConnection(cfg) + if err != nil { + return nil, fmt.Errorf("failed to connect Job Distributor service. Err: %w", err) + } + return JobDistributor{ + WSRPC: cfg.WSRPC, + NodeServiceClient: nodev1.NewNodeServiceClient(conn), + JobServiceClient: jobv1.NewJobServiceClient(conn), + CSAServiceClient: csav1.NewCSAServiceClient(conn), + }, err +} + +func (jd JobDistributor) GetCSAPublicKey(ctx context.Context) (string, error) { + keypairs, err := jd.ListKeypairs(ctx, &csav1.ListKeypairsRequest{}) + if err != nil { + return "", err + } + if keypairs == nil || len(keypairs.Keypairs) == 0 { + return "", fmt.Errorf("no keypairs found") + } + csakey := keypairs.Keypairs[0].PublicKey + return csakey, nil +} diff --git a/integration-tests/deployment/environment.go b/integration-tests/deployment/environment.go new file mode 100644 index 00000000000..0f3c85a3627 --- /dev/null +++ b/integration-tests/deployment/environment.go @@ -0,0 +1,266 @@ +package deployment + +import ( + "bytes" + "context" + "errors" + "fmt" + "math/big" + "sort" + "strconv" + + "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/rpc" + chain_selectors "github.com/smartcontractkit/chain-selectors" + types2 "github.com/smartcontractkit/libocr/offchainreporting2/types" + types3 "github.com/smartcontractkit/libocr/offchainreporting2plus/types" + + csav1 "github.com/smartcontractkit/chainlink/integration-tests/deployment/jd/csa/v1" + + jobv1 "github.com/smartcontractkit/chainlink/integration-tests/deployment/jd/job/v1" + nodev1 "github.com/smartcontractkit/chainlink/integration-tests/deployment/jd/node/v1" + "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" + + "github.com/smartcontractkit/chainlink-common/pkg/logger" +) + +type OnchainClient interface { + // For EVM specifically we can use existing geth interface + // to abstract chain clients. + bind.ContractBackend + bind.DeployBackend +} + +type OffchainClient interface { + // The job distributor grpc interface can be used to abstract offchain read/writes + jobv1.JobServiceClient + nodev1.NodeServiceClient + csav1.CSAServiceClient +} + +type Chain struct { + // Selectors used as canonical chain identifier. + Selector uint64 + Client OnchainClient + // Note the Sign function can be abstract supporting a variety of key storage mechanisms (e.g. KMS etc). + DeployerKey *bind.TransactOpts + Confirm func(tx *types.Transaction) (uint64, error) +} + +type Environment struct { + Name string + Chains map[uint64]Chain + Offchain OffchainClient + NodeIDs []string + Logger logger.Logger +} + +func (e Environment) AllChainSelectors() []uint64 { + var selectors []uint64 + for sel := range e.Chains { + selectors = append(selectors, sel) + } + return selectors +} + +func (e Environment) AllChainSelectorsExcluding(excluding []uint64) []uint64 { + var selectors []uint64 + for sel := range e.Chains { + excluded := false + for _, toExclude := range excluding { + if sel == toExclude { + excluded = true + } + } + if excluded { + continue + } + selectors = append(selectors, sel) + } + return selectors +} + +func ConfirmIfNoError(chain Chain, tx *types.Transaction, err error) (uint64, error) { + if err != nil { + //revive:disable + var d rpc.DataError + ok := errors.As(err, &d) + if ok { + return 0, fmt.Errorf("got Data Error: %s", d.ErrorData()) + } + return 0, err + } + return chain.Confirm(tx) +} + +func MaybeDataErr(err error) error { + //revive:disable + var d rpc.DataError + ok := errors.As(err, &d) + if ok { + return d + } + return err +} + +func UBigInt(i uint64) *big.Int { + return new(big.Int).SetUint64(i) +} + +func E18Mult(amount uint64) *big.Int { + return new(big.Int).Mul(UBigInt(amount), UBigInt(1e18)) +} + +type OCRConfig struct { + OffchainPublicKey types2.OffchainPublicKey + // For EVM-chains, this an *address*. + OnchainPublicKey types2.OnchainPublicKey + PeerID p2pkey.PeerID + TransmitAccount types2.Account + ConfigEncryptionPublicKey types3.ConfigEncryptionPublicKey + KeyBundleID string +} + +// Nodes includes is a group CL nodes. +type Nodes []Node + +// PeerIDs returns peerIDs in a sorted list +func (n Nodes) PeerIDs() [][32]byte { + var peerIDs [][32]byte + for _, node := range n { + peerIDs = append(peerIDs, node.PeerID) + } + sort.Slice(peerIDs, func(i, j int) bool { + return bytes.Compare(peerIDs[i][:], peerIDs[j][:]) < 0 + }) + return peerIDs +} + +func (n Nodes) NonBootstraps() Nodes { + var nonBootstraps Nodes + for _, node := range n { + if node.IsBootstrap { + continue + } + nonBootstraps = append(nonBootstraps, node) + } + return nonBootstraps +} + +func (n Nodes) DefaultF() uint8 { + return uint8(len(n) / 3) +} + +func (n Nodes) BootstrapLocators() []string { + bootstrapMp := make(map[string]struct{}) + for _, node := range n { + if node.IsBootstrap { + bootstrapMp[fmt.Sprintf("%s@%s", + // p2p_12D3... -> 12D3... + node.PeerID.String()[4:], node.MultiAddr)] = struct{}{} + } + } + var locators []string + for b := range bootstrapMp { + locators = append(locators, b) + } + return locators +} + +type Node struct { + NodeID string + SelToOCRConfig map[uint64]OCRConfig + PeerID p2pkey.PeerID + IsBootstrap bool + MultiAddr string +} + +func (n Node) FirstOCRKeybundle() OCRConfig { + for _, ocrConfig := range n.SelToOCRConfig { + return ocrConfig + } + return OCRConfig{} +} + +func MustPeerIDFromString(s string) p2pkey.PeerID { + p := p2pkey.PeerID{} + if err := p.UnmarshalString(s); err != nil { + panic(err) + } + return p +} + +// Gathers all the node info through JD required to be able to set +// OCR config for example. +func NodeInfo(nodeIDs []string, oc OffchainClient) (Nodes, error) { + var nodes []Node + for _, nodeID := range nodeIDs { + // TODO: Filter should accept multiple nodes + nodeChainConfigs, err := oc.ListNodeChainConfigs(context.Background(), &nodev1.ListNodeChainConfigsRequest{Filter: &nodev1.ListNodeChainConfigsRequest_Filter{ + NodeIds: []string{nodeID}, + }}) + if err != nil { + return nil, err + } + selToOCRConfig := make(map[uint64]OCRConfig) + bootstrap := false + var peerID p2pkey.PeerID + var multiAddr string + for _, chainConfig := range nodeChainConfigs.ChainConfigs { + if chainConfig.Chain.Type == nodev1.ChainType_CHAIN_TYPE_SOLANA { + // Note supported for CCIP yet. + continue + } + // NOTE: Assume same peerID/multiAddr for all chains. + // Might make sense to change proto as peerID/multiAddr is 1-1 with nodeID? + peerID = MustPeerIDFromString(chainConfig.Ocr2Config.P2PKeyBundle.PeerId) + multiAddr = chainConfig.Ocr2Config.Multiaddr + if chainConfig.Ocr2Config.IsBootstrap { + // NOTE: Assume same peerID for all chains. + // Might make sense to change proto as peerID is 1-1 with nodeID? + bootstrap = true + break + } + evmChainID, err := strconv.Atoi(chainConfig.Chain.Id) + if err != nil { + return nil, err + } + sel, err := chain_selectors.SelectorFromChainId(uint64(evmChainID)) + if err != nil { + return nil, err + } + b := common.Hex2Bytes(chainConfig.Ocr2Config.OcrKeyBundle.OffchainPublicKey) + var opk types2.OffchainPublicKey + copy(opk[:], b) + + b = common.Hex2Bytes(chainConfig.Ocr2Config.OcrKeyBundle.ConfigPublicKey) + var cpk types3.ConfigEncryptionPublicKey + copy(cpk[:], b) + + selToOCRConfig[sel] = OCRConfig{ + OffchainPublicKey: opk, + OnchainPublicKey: common.HexToAddress(chainConfig.Ocr2Config.OcrKeyBundle.OnchainSigningAddress).Bytes(), + PeerID: MustPeerIDFromString(chainConfig.Ocr2Config.P2PKeyBundle.PeerId), + TransmitAccount: types2.Account(chainConfig.AccountAddress), + ConfigEncryptionPublicKey: cpk, + KeyBundleID: chainConfig.Ocr2Config.OcrKeyBundle.BundleId, + } + } + nodes = append(nodes, Node{ + NodeID: nodeID, + SelToOCRConfig: selToOCRConfig, + IsBootstrap: bootstrap, + PeerID: peerID, + MultiAddr: multiAddr, + }) + } + + return nodes, nil +} + +type CapabilityRegistryConfig struct { + EVMChainID uint64 // chain id of the chain the CR is deployed on + Contract common.Address // address of the CR contract +} diff --git a/integration-tests/deployment/evm_kmsclient.go b/integration-tests/deployment/evm_kmsclient.go new file mode 100644 index 00000000000..07af77523c8 --- /dev/null +++ b/integration-tests/deployment/evm_kmsclient.go @@ -0,0 +1,233 @@ +package deployment + +import ( + "bytes" + "context" + "crypto/ecdsa" + "encoding/asn1" + "encoding/hex" + "fmt" + "math/big" + + "github.com/aws/aws-sdk-go/aws/session" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/kms" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/crypto/secp256k1" +) + +var ( + secp256k1N = crypto.S256().Params().N + secp256k1HalfN = new(big.Int).Div(secp256k1N, big.NewInt(2)) +) + +// See https://docs.aws.amazon.com/kms/latest/APIReference/API_GetPublicKey.html#API_GetPublicKey_ResponseSyntax +// and https://datatracker.ietf.org/doc/html/rfc5280 for why we need to unpack the KMS public key. +type asn1SubjectPublicKeyInfo struct { + AlgorithmIdentifier asn1AlgorithmIdentifier + SubjectPublicKey asn1.BitString +} + +type asn1AlgorithmIdentifier struct { + Algorithm asn1.ObjectIdentifier + Parameters asn1.ObjectIdentifier +} + +// See https://aws.amazon.com/blogs/database/part2-use-aws-kms-to-securely-manage-ethereum-accounts/ for why we +// need to manually prep the signature for Ethereum. +type asn1ECDSASig struct { + R asn1.RawValue + S asn1.RawValue +} + +// TODO: Mockery gen then test with a regular eth key behind the interface. +type KMSClient interface { + GetPublicKey(input *kms.GetPublicKeyInput) (*kms.GetPublicKeyOutput, error) + Sign(input *kms.SignInput) (*kms.SignOutput, error) +} + +type KMS struct { + KmsDeployerKeyId string + KmsDeployerKeyRegion string + AwsProfileName string +} + +func NewKMSClient(config KMS) (KMSClient, error) { + if config.KmsDeployerKeyId == "" { + return nil, fmt.Errorf("KMS key ID is required") + } + if config.KmsDeployerKeyRegion == "" { + return nil, fmt.Errorf("KMS key region is required") + } + var awsSessionFn AwsSessionFn + if config.AwsProfileName != "" { + awsSessionFn = awsSessionFromProfileFn + } else { + awsSessionFn = awsSessionFromEnvVarsFn + } + return kms.New(awsSessionFn(config)), nil +} + +type EVMKMSClient struct { + Client KMSClient + KeyID string +} + +func NewEVMKMSClient(client KMSClient, keyID string) *EVMKMSClient { + return &EVMKMSClient{ + Client: client, + KeyID: keyID, + } +} + +func (c *EVMKMSClient) GetKMSTransactOpts(ctx context.Context, chainID *big.Int) (*bind.TransactOpts, error) { + ecdsaPublicKey, err := c.GetECDSAPublicKey() + if err != nil { + return nil, err + } + + pubKeyBytes := secp256k1.S256().Marshal(ecdsaPublicKey.X, ecdsaPublicKey.Y) + keyAddr := crypto.PubkeyToAddress(*ecdsaPublicKey) + if chainID == nil { + return nil, fmt.Errorf("chainID is required") + } + signer := types.LatestSignerForChainID(chainID) + + signerFn := func(address common.Address, tx *types.Transaction) (*types.Transaction, error) { + if address != keyAddr { + return nil, bind.ErrNotAuthorized + } + + txHashBytes := signer.Hash(tx).Bytes() + + mType := kms.MessageTypeDigest + algo := kms.SigningAlgorithmSpecEcdsaSha256 + signOutput, err := c.Client.Sign( + &kms.SignInput{ + KeyId: &c.KeyID, + SigningAlgorithm: &algo, + MessageType: &mType, + Message: txHashBytes, + }) + if err != nil { + return nil, fmt.Errorf("failed to call kms.Sign() on transaction: %w", err) + } + + ethSig, err := kmsToEthSig(signOutput.Signature, pubKeyBytes, txHashBytes) + if err != nil { + return nil, fmt.Errorf("failed to convert KMS signature to Ethereum signature: %w", err) + } + + return tx.WithSignature(signer, ethSig) + } + + return &bind.TransactOpts{ + From: keyAddr, + Signer: signerFn, + Context: ctx, + }, nil +} + +// GetECDSAPublicKey retrieves the public key from KMS and converts it to its ECDSA representation. +func (c *EVMKMSClient) GetECDSAPublicKey() (*ecdsa.PublicKey, error) { + getPubKeyOutput, err := c.Client.GetPublicKey(&kms.GetPublicKeyInput{ + KeyId: aws.String(c.KeyID), + }) + if err != nil { + return nil, fmt.Errorf("can not get public key from KMS for KeyId=%s: %w", c.KeyID, err) + } + + var asn1pubKeyInfo asn1SubjectPublicKeyInfo + _, err = asn1.Unmarshal(getPubKeyOutput.PublicKey, &asn1pubKeyInfo) + if err != nil { + return nil, fmt.Errorf("can not parse asn1 public key for KeyId=%s: %w", c.KeyID, err) + } + + pubKey, err := crypto.UnmarshalPubkey(asn1pubKeyInfo.SubjectPublicKey.Bytes) + if err != nil { + return nil, fmt.Errorf("can not unmarshal public key bytes: %w", err) + } + return pubKey, nil +} + +func kmsToEthSig(kmsSig, ecdsaPubKeyBytes, hash []byte) ([]byte, error) { + var asn1Sig asn1ECDSASig + _, err := asn1.Unmarshal(kmsSig, &asn1Sig) + if err != nil { + return nil, err + } + + rBytes := asn1Sig.R.Bytes + sBytes := asn1Sig.S.Bytes + + // Adjust S value from signature to match Eth standard. + // See: https://aws.amazon.com/blogs/database/part2-use-aws-kms-to-securely-manage-ethereum-accounts/ + // "After we extract r and s successfully, we have to test if the value of s is greater than secp256k1n/2 as + // specified in EIP-2 and flip it if required." + sBigInt := new(big.Int).SetBytes(sBytes) + if sBigInt.Cmp(secp256k1HalfN) > 0 { + sBytes = new(big.Int).Sub(secp256k1N, sBigInt).Bytes() + } + + return recoverEthSignature(ecdsaPubKeyBytes, hash, rBytes, sBytes) +} + +// See: https://aws.amazon.com/blogs/database/part2-use-aws-kms-to-securely-manage-ethereum-accounts/ +func recoverEthSignature(expectedPublicKeyBytes, txHash, r, s []byte) ([]byte, error) { + rsSig := append(padTo32Bytes(r), padTo32Bytes(s)...) + ethSig := append(rsSig, []byte{0}...) + + recoveredPublicKeyBytes, err := crypto.Ecrecover(txHash, ethSig) + if err != nil { + return nil, fmt.Errorf("failing to call Ecrecover: %w", err) + } + + if hex.EncodeToString(recoveredPublicKeyBytes) != hex.EncodeToString(expectedPublicKeyBytes) { + ethSig = append(rsSig, []byte{1}...) + recoveredPublicKeyBytes, err = crypto.Ecrecover(txHash, ethSig) + if err != nil { + return nil, fmt.Errorf("failing to call Ecrecover: %w", err) + } + + if hex.EncodeToString(recoveredPublicKeyBytes) != hex.EncodeToString(expectedPublicKeyBytes) { + return nil, fmt.Errorf("can not reconstruct public key from sig") + } + } + + return ethSig, nil +} + +func padTo32Bytes(buffer []byte) []byte { + buffer = bytes.TrimLeft(buffer, "\x00") + for len(buffer) < 32 { + zeroBuf := []byte{0} + buffer = append(zeroBuf, buffer...) + } + return buffer +} + +type AwsSessionFn func(config KMS) *session.Session + +var awsSessionFromEnvVarsFn = func(config KMS) *session.Session { + return session.Must( + session.NewSession(&aws.Config{ + Region: aws.String(config.KmsDeployerKeyRegion), + CredentialsChainVerboseErrors: aws.Bool(true), + })) +} + +var awsSessionFromProfileFn = func(config KMS) *session.Session { + return session.Must( + session.NewSessionWithOptions(session.Options{ + SharedConfigState: session.SharedConfigEnable, + Profile: config.AwsProfileName, + Config: aws.Config{ + Region: aws.String(config.KmsDeployerKeyRegion), + CredentialsChainVerboseErrors: aws.Bool(true), + }, + })) +} diff --git a/integration-tests/deployment/evm_kmsclient_test.go b/integration-tests/deployment/evm_kmsclient_test.go new file mode 100644 index 00000000000..8a889a56067 --- /dev/null +++ b/integration-tests/deployment/evm_kmsclient_test.go @@ -0,0 +1,27 @@ +package deployment + +import ( + "encoding/hex" + "testing" + + "github.com/test-go/testify/require" +) + +func TestKMSToEthSigConversion(t *testing.T) { + kmsSigBytes, err := hex.DecodeString("304402206168865941bafcae3a8cf8b26edbb5693d62222b2e54d962c1aabbeaddf33b6802205edc7f597d2bf2d1eaa14fc514a6202bafcffe52b13ae3fec00674d92a874b73") + require.NoError(t, err) + ecdsaPublicKeyBytes, err := hex.DecodeString("04a735e9e3cb526f83be23b03f1f5ae7788a8654e3f0fcfb4f978290de07ebd47da30eeb72e904fdd4a81b46e320908ff4345e119148f89c1f04674c14a506e24b") + require.NoError(t, err) + txHashBytes, err := hex.DecodeString("a2f037301e90f58c084fe4bec2eef14b26e620d6b6cb46051037d03b29ab7d9a") + require.NoError(t, err) + expectedEthSignBytes, err := hex.DecodeString("6168865941bafcae3a8cf8b26edbb5693d62222b2e54d962c1aabbeaddf33b685edc7f597d2bf2d1eaa14fc514a6202bafcffe52b13ae3fec00674d92a874b7300") + require.NoError(t, err) + + actualEthSig, err := kmsToEthSig( + kmsSigBytes, + ecdsaPublicKeyBytes, + txHashBytes, + ) + require.NoError(t, err) + require.Equal(t, expectedEthSignBytes, actualEthSig) +} diff --git a/integration-tests/deployment/helpers.go b/integration-tests/deployment/helpers.go new file mode 100644 index 00000000000..5e81eadd39d --- /dev/null +++ b/integration-tests/deployment/helpers.go @@ -0,0 +1,82 @@ +package deployment + +import ( + "bytes" + "context" + "encoding/hex" + "encoding/json" + "fmt" + "strings" + + "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/pkg/errors" +) + +func GetErrorReasonFromTx(client bind.ContractBackend, from common.Address, tx types.Transaction, receipt *types.Receipt) (string, error) { + call := ethereum.CallMsg{ + From: from, + To: tx.To(), + Data: tx.Data(), + Value: tx.Value(), + Gas: tx.Gas(), + GasPrice: tx.GasPrice(), + } + _, err := client.CallContract(context.Background(), call, receipt.BlockNumber) + if err != nil { + errorReason, err := parseError(err) + if err == nil { + return errorReason, nil + } + } + return "", fmt.Errorf("tx %s reverted with no reason", tx.Hash().Hex()) +} + +func parseError(txError error) (string, error) { + b, err := json.Marshal(txError) + if err != nil { + return "", err + } + var callErr struct { + Code int + Data string `json:"data"` + Message string `json:"message"` + } + if json.Unmarshal(b, &callErr) != nil { + return "", err + } + + if callErr.Data == "" && strings.Contains(callErr.Message, "missing trie node") { + return "", errors.Errorf("please use an archive node") + } + + return callErr.Data, nil +} + +func ParseErrorFromABI(errorString string, contractABI string) (string, error) { + parsedAbi, err := abi.JSON(strings.NewReader(contractABI)) + if err != nil { + return "", errors.Wrap(err, "error loading ABI") + } + errorString = strings.TrimPrefix(errorString, "Reverted ") + errorString = strings.TrimPrefix(errorString, "0x") + + data, err := hex.DecodeString(errorString) + if err != nil { + return "", errors.Wrap(err, "error decoding error string") + } + for errorName, abiError := range parsedAbi.Errors { + if bytes.Equal(data[:4], abiError.ID.Bytes()[:4]) { + // Found a matching error + v, err3 := abiError.Unpack(data) + if err3 != nil { + return "", errors.Wrap(err3, "error unpacking data") + } + return fmt.Sprintf("error is \"%v\" args %v\n", errorName, v), nil + } + } + return "", errors.New("error not found in ABI") +} diff --git a/integration-tests/deployment/jd/csa/v1/csa.pb.go b/integration-tests/deployment/jd/csa/v1/csa.pb.go new file mode 100644 index 00000000000..77ad4be4c0f --- /dev/null +++ b/integration-tests/deployment/jd/csa/v1/csa.pb.go @@ -0,0 +1,418 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.29.0 +// protoc v4.25.3 +// source: csa/v1/csa.proto + +package v1 + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type Keypair struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + PublicKey string `protobuf:"bytes,2,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` + CreatedAt *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` +} + +func (x *Keypair) Reset() { + *x = Keypair{} + if protoimpl.UnsafeEnabled { + mi := &file_csa_v1_csa_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Keypair) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Keypair) ProtoMessage() {} + +func (x *Keypair) ProtoReflect() protoreflect.Message { + mi := &file_csa_v1_csa_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Keypair.ProtoReflect.Descriptor instead. +func (*Keypair) Descriptor() ([]byte, []int) { + return file_csa_v1_csa_proto_rawDescGZIP(), []int{0} +} + +func (x *Keypair) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *Keypair) GetPublicKey() string { + if x != nil { + return x.PublicKey + } + return "" +} + +func (x *Keypair) GetCreatedAt() *timestamppb.Timestamp { + if x != nil { + return x.CreatedAt + } + return nil +} + +type GetKeypairRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *GetKeypairRequest) Reset() { + *x = GetKeypairRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_csa_v1_csa_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetKeypairRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetKeypairRequest) ProtoMessage() {} + +func (x *GetKeypairRequest) ProtoReflect() protoreflect.Message { + mi := &file_csa_v1_csa_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetKeypairRequest.ProtoReflect.Descriptor instead. +func (*GetKeypairRequest) Descriptor() ([]byte, []int) { + return file_csa_v1_csa_proto_rawDescGZIP(), []int{1} +} + +type GetKeypairResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Keypair *Keypair `protobuf:"bytes,1,opt,name=keypair,proto3" json:"keypair,omitempty"` +} + +func (x *GetKeypairResponse) Reset() { + *x = GetKeypairResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_csa_v1_csa_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetKeypairResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetKeypairResponse) ProtoMessage() {} + +func (x *GetKeypairResponse) ProtoReflect() protoreflect.Message { + mi := &file_csa_v1_csa_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetKeypairResponse.ProtoReflect.Descriptor instead. +func (*GetKeypairResponse) Descriptor() ([]byte, []int) { + return file_csa_v1_csa_proto_rawDescGZIP(), []int{2} +} + +func (x *GetKeypairResponse) GetKeypair() *Keypair { + if x != nil { + return x.Keypair + } + return nil +} + +type ListKeypairsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *ListKeypairsRequest) Reset() { + *x = ListKeypairsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_csa_v1_csa_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListKeypairsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListKeypairsRequest) ProtoMessage() {} + +func (x *ListKeypairsRequest) ProtoReflect() protoreflect.Message { + mi := &file_csa_v1_csa_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListKeypairsRequest.ProtoReflect.Descriptor instead. +func (*ListKeypairsRequest) Descriptor() ([]byte, []int) { + return file_csa_v1_csa_proto_rawDescGZIP(), []int{3} +} + +type ListKeypairsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Keypairs []*Keypair `protobuf:"bytes,1,rep,name=keypairs,proto3" json:"keypairs,omitempty"` +} + +func (x *ListKeypairsResponse) Reset() { + *x = ListKeypairsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_csa_v1_csa_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListKeypairsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListKeypairsResponse) ProtoMessage() {} + +func (x *ListKeypairsResponse) ProtoReflect() protoreflect.Message { + mi := &file_csa_v1_csa_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListKeypairsResponse.ProtoReflect.Descriptor instead. +func (*ListKeypairsResponse) Descriptor() ([]byte, []int) { + return file_csa_v1_csa_proto_rawDescGZIP(), []int{4} +} + +func (x *ListKeypairsResponse) GetKeypairs() []*Keypair { + if x != nil { + return x.Keypairs + } + return nil +} + +var File_csa_v1_csa_proto protoreflect.FileDescriptor + +var file_csa_v1_csa_proto_rawDesc = []byte{ + 0x0a, 0x10, 0x63, 0x73, 0x61, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x73, 0x61, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x12, 0x0a, 0x61, 0x70, 0x69, 0x2e, 0x63, 0x73, 0x61, 0x2e, 0x76, 0x31, 0x1a, 0x1f, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, + 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, + 0x73, 0x0a, 0x07, 0x4b, 0x65, 0x79, 0x70, 0x61, 0x69, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x75, + 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, + 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x39, 0x0a, 0x0a, 0x63, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x64, 0x41, 0x74, 0x22, 0x13, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x4b, 0x65, 0x79, 0x70, 0x61, + 0x69, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x43, 0x0a, 0x12, 0x47, 0x65, 0x74, + 0x4b, 0x65, 0x79, 0x70, 0x61, 0x69, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x2d, 0x0a, 0x07, 0x6b, 0x65, 0x79, 0x70, 0x61, 0x69, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x13, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x63, 0x73, 0x61, 0x2e, 0x76, 0x31, 0x2e, 0x4b, 0x65, + 0x79, 0x70, 0x61, 0x69, 0x72, 0x52, 0x07, 0x6b, 0x65, 0x79, 0x70, 0x61, 0x69, 0x72, 0x22, 0x15, + 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, 0x4b, 0x65, 0x79, 0x70, 0x61, 0x69, 0x72, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x47, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x4b, 0x65, 0x79, + 0x70, 0x61, 0x69, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2f, 0x0a, + 0x08, 0x6b, 0x65, 0x79, 0x70, 0x61, 0x69, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x13, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x63, 0x73, 0x61, 0x2e, 0x76, 0x31, 0x2e, 0x4b, 0x65, 0x79, + 0x70, 0x61, 0x69, 0x72, 0x52, 0x08, 0x6b, 0x65, 0x79, 0x70, 0x61, 0x69, 0x72, 0x73, 0x32, 0xac, + 0x01, 0x0a, 0x0a, 0x43, 0x53, 0x41, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x4b, 0x0a, + 0x0a, 0x47, 0x65, 0x74, 0x4b, 0x65, 0x79, 0x70, 0x61, 0x69, 0x72, 0x12, 0x1d, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x63, 0x73, 0x61, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4b, 0x65, 0x79, 0x70, + 0x61, 0x69, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x63, 0x73, 0x61, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4b, 0x65, 0x79, 0x70, 0x61, + 0x69, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x51, 0x0a, 0x0c, 0x4c, 0x69, + 0x73, 0x74, 0x4b, 0x65, 0x79, 0x70, 0x61, 0x69, 0x72, 0x73, 0x12, 0x1f, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x63, 0x73, 0x61, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4b, 0x65, 0x79, 0x70, + 0x61, 0x69, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x63, 0x73, 0x61, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4b, 0x65, 0x79, + 0x70, 0x61, 0x69, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x08, 0x5a, + 0x06, 0x63, 0x73, 0x61, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_csa_v1_csa_proto_rawDescOnce sync.Once + file_csa_v1_csa_proto_rawDescData = file_csa_v1_csa_proto_rawDesc +) + +func file_csa_v1_csa_proto_rawDescGZIP() []byte { + file_csa_v1_csa_proto_rawDescOnce.Do(func() { + file_csa_v1_csa_proto_rawDescData = protoimpl.X.CompressGZIP(file_csa_v1_csa_proto_rawDescData) + }) + return file_csa_v1_csa_proto_rawDescData +} + +var file_csa_v1_csa_proto_msgTypes = make([]protoimpl.MessageInfo, 5) +var file_csa_v1_csa_proto_goTypes = []interface{}{ + (*Keypair)(nil), // 0: api.csa.v1.Keypair + (*GetKeypairRequest)(nil), // 1: api.csa.v1.GetKeypairRequest + (*GetKeypairResponse)(nil), // 2: api.csa.v1.GetKeypairResponse + (*ListKeypairsRequest)(nil), // 3: api.csa.v1.ListKeypairsRequest + (*ListKeypairsResponse)(nil), // 4: api.csa.v1.ListKeypairsResponse + (*timestamppb.Timestamp)(nil), // 5: google.protobuf.Timestamp +} +var file_csa_v1_csa_proto_depIdxs = []int32{ + 5, // 0: api.csa.v1.Keypair.created_at:type_name -> google.protobuf.Timestamp + 0, // 1: api.csa.v1.GetKeypairResponse.keypair:type_name -> api.csa.v1.Keypair + 0, // 2: api.csa.v1.ListKeypairsResponse.keypairs:type_name -> api.csa.v1.Keypair + 1, // 3: api.csa.v1.CSAService.GetKeypair:input_type -> api.csa.v1.GetKeypairRequest + 3, // 4: api.csa.v1.CSAService.ListKeypairs:input_type -> api.csa.v1.ListKeypairsRequest + 2, // 5: api.csa.v1.CSAService.GetKeypair:output_type -> api.csa.v1.GetKeypairResponse + 4, // 6: api.csa.v1.CSAService.ListKeypairs:output_type -> api.csa.v1.ListKeypairsResponse + 5, // [5:7] is the sub-list for method output_type + 3, // [3:5] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name +} + +func init() { file_csa_v1_csa_proto_init() } +func file_csa_v1_csa_proto_init() { + if File_csa_v1_csa_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_csa_v1_csa_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Keypair); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_csa_v1_csa_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetKeypairRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_csa_v1_csa_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetKeypairResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_csa_v1_csa_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListKeypairsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_csa_v1_csa_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListKeypairsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_csa_v1_csa_proto_rawDesc, + NumEnums: 0, + NumMessages: 5, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_csa_v1_csa_proto_goTypes, + DependencyIndexes: file_csa_v1_csa_proto_depIdxs, + MessageInfos: file_csa_v1_csa_proto_msgTypes, + }.Build() + File_csa_v1_csa_proto = out.File + file_csa_v1_csa_proto_rawDesc = nil + file_csa_v1_csa_proto_goTypes = nil + file_csa_v1_csa_proto_depIdxs = nil +} diff --git a/integration-tests/deployment/jd/csa/v1/csa_grpc.pb.go b/integration-tests/deployment/jd/csa/v1/csa_grpc.pb.go new file mode 100644 index 00000000000..7e058bd9fd7 --- /dev/null +++ b/integration-tests/deployment/jd/csa/v1/csa_grpc.pb.go @@ -0,0 +1,146 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc v4.25.3 +// source: csa/v1/csa.proto + +package v1 + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + CSAService_GetKeypair_FullMethodName = "/api.csa.v1.CSAService/GetKeypair" + CSAService_ListKeypairs_FullMethodName = "/api.csa.v1.CSAService/ListKeypairs" +) + +// CSAServiceClient is the client API for CSAService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type CSAServiceClient interface { + GetKeypair(ctx context.Context, in *GetKeypairRequest, opts ...grpc.CallOption) (*GetKeypairResponse, error) + ListKeypairs(ctx context.Context, in *ListKeypairsRequest, opts ...grpc.CallOption) (*ListKeypairsResponse, error) +} + +type cSAServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewCSAServiceClient(cc grpc.ClientConnInterface) CSAServiceClient { + return &cSAServiceClient{cc} +} + +func (c *cSAServiceClient) GetKeypair(ctx context.Context, in *GetKeypairRequest, opts ...grpc.CallOption) (*GetKeypairResponse, error) { + out := new(GetKeypairResponse) + err := c.cc.Invoke(ctx, CSAService_GetKeypair_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *cSAServiceClient) ListKeypairs(ctx context.Context, in *ListKeypairsRequest, opts ...grpc.CallOption) (*ListKeypairsResponse, error) { + out := new(ListKeypairsResponse) + err := c.cc.Invoke(ctx, CSAService_ListKeypairs_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// CSAServiceServer is the server API for CSAService service. +// All implementations must embed UnimplementedCSAServiceServer +// for forward compatibility +type CSAServiceServer interface { + GetKeypair(context.Context, *GetKeypairRequest) (*GetKeypairResponse, error) + ListKeypairs(context.Context, *ListKeypairsRequest) (*ListKeypairsResponse, error) + mustEmbedUnimplementedCSAServiceServer() +} + +// UnimplementedCSAServiceServer must be embedded to have forward compatible implementations. +type UnimplementedCSAServiceServer struct { +} + +func (UnimplementedCSAServiceServer) GetKeypair(context.Context, *GetKeypairRequest) (*GetKeypairResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetKeypair not implemented") +} +func (UnimplementedCSAServiceServer) ListKeypairs(context.Context, *ListKeypairsRequest) (*ListKeypairsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListKeypairs not implemented") +} +func (UnimplementedCSAServiceServer) mustEmbedUnimplementedCSAServiceServer() {} + +// UnsafeCSAServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to CSAServiceServer will +// result in compilation errors. +type UnsafeCSAServiceServer interface { + mustEmbedUnimplementedCSAServiceServer() +} + +func RegisterCSAServiceServer(s grpc.ServiceRegistrar, srv CSAServiceServer) { + s.RegisterService(&CSAService_ServiceDesc, srv) +} + +func _CSAService_GetKeypair_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetKeypairRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CSAServiceServer).GetKeypair(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: CSAService_GetKeypair_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CSAServiceServer).GetKeypair(ctx, req.(*GetKeypairRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _CSAService_ListKeypairs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListKeypairsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CSAServiceServer).ListKeypairs(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: CSAService_ListKeypairs_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CSAServiceServer).ListKeypairs(ctx, req.(*ListKeypairsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// CSAService_ServiceDesc is the grpc.ServiceDesc for CSAService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var CSAService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "api.csa.v1.CSAService", + HandlerType: (*CSAServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetKeypair", + Handler: _CSAService_GetKeypair_Handler, + }, + { + MethodName: "ListKeypairs", + Handler: _CSAService_ListKeypairs_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "csa/v1/csa.proto", +} \ No newline at end of file diff --git a/integration-tests/deployment/jd/job/v1/job.pb.go b/integration-tests/deployment/jd/job/v1/job.pb.go new file mode 100644 index 00000000000..5544a12bdd5 --- /dev/null +++ b/integration-tests/deployment/jd/job/v1/job.pb.go @@ -0,0 +1,1994 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.29.0 +// protoc v4.25.3 +// source: job/v1/job.proto + +package v1 + +import ( + ptypes "github.com/smartcontractkit/chainlink/integration-tests/deployment/jd/shared/ptypes" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// ProposalStatus defines the possible states of a job proposal. +type ProposalStatus int32 + +const ( + ProposalStatus_PROPOSAL_STATUS_UNSPECIFIED ProposalStatus = 0 + ProposalStatus_PROPOSAL_STATUS_PROPOSED ProposalStatus = 1 // Proposal has been made but not yet decided upon. + ProposalStatus_PROPOSAL_STATUS_APPROVED ProposalStatus = 2 // Proposal has been accepted. + ProposalStatus_PROPOSAL_STATUS_REJECTED ProposalStatus = 3 // Proposal has been rejected. + ProposalStatus_PROPOSAL_STATUS_CANCELLED ProposalStatus = 4 // Proposal has been cancelled. + ProposalStatus_PROPOSAL_STATUS_PENDING ProposalStatus = 5 // Proposal is pending review. + ProposalStatus_PROPOSAL_STATUS_REVOKED ProposalStatus = 6 // Proposal has been revoked after being proposed. +) + +// Enum value maps for ProposalStatus. +var ( + ProposalStatus_name = map[int32]string{ + 0: "PROPOSAL_STATUS_UNSPECIFIED", + 1: "PROPOSAL_STATUS_PROPOSED", + 2: "PROPOSAL_STATUS_APPROVED", + 3: "PROPOSAL_STATUS_REJECTED", + 4: "PROPOSAL_STATUS_CANCELLED", + 5: "PROPOSAL_STATUS_PENDING", + 6: "PROPOSAL_STATUS_REVOKED", + } + ProposalStatus_value = map[string]int32{ + "PROPOSAL_STATUS_UNSPECIFIED": 0, + "PROPOSAL_STATUS_PROPOSED": 1, + "PROPOSAL_STATUS_APPROVED": 2, + "PROPOSAL_STATUS_REJECTED": 3, + "PROPOSAL_STATUS_CANCELLED": 4, + "PROPOSAL_STATUS_PENDING": 5, + "PROPOSAL_STATUS_REVOKED": 6, + } +) + +func (x ProposalStatus) Enum() *ProposalStatus { + p := new(ProposalStatus) + *p = x + return p +} + +func (x ProposalStatus) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ProposalStatus) Descriptor() protoreflect.EnumDescriptor { + return file_job_v1_job_proto_enumTypes[0].Descriptor() +} + +func (ProposalStatus) Type() protoreflect.EnumType { + return &file_job_v1_job_proto_enumTypes[0] +} + +func (x ProposalStatus) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ProposalStatus.Descriptor instead. +func (ProposalStatus) EnumDescriptor() ([]byte, []int) { + return file_job_v1_job_proto_rawDescGZIP(), []int{0} +} + +// ProposalDeliveryStatus defines the delivery status of the proposal to the node. +type ProposalDeliveryStatus int32 + +const ( + ProposalDeliveryStatus_PROPOSAL_DELIVERY_STATUS_UNSPECIFIED ProposalDeliveryStatus = 0 + ProposalDeliveryStatus_PROPOSAL_DELIVERY_STATUS_DELIVERED ProposalDeliveryStatus = 1 // Delivered to the node. + ProposalDeliveryStatus_PROPOSAL_DELIVERY_STATUS_ACKNOWLEDGED ProposalDeliveryStatus = 2 // Acknowledged by the node. + ProposalDeliveryStatus_PROPOSAL_DELIVERY_STATUS_FAILED ProposalDeliveryStatus = 3 // Delivery failed. +) + +// Enum value maps for ProposalDeliveryStatus. +var ( + ProposalDeliveryStatus_name = map[int32]string{ + 0: "PROPOSAL_DELIVERY_STATUS_UNSPECIFIED", + 1: "PROPOSAL_DELIVERY_STATUS_DELIVERED", + 2: "PROPOSAL_DELIVERY_STATUS_ACKNOWLEDGED", + 3: "PROPOSAL_DELIVERY_STATUS_FAILED", + } + ProposalDeliveryStatus_value = map[string]int32{ + "PROPOSAL_DELIVERY_STATUS_UNSPECIFIED": 0, + "PROPOSAL_DELIVERY_STATUS_DELIVERED": 1, + "PROPOSAL_DELIVERY_STATUS_ACKNOWLEDGED": 2, + "PROPOSAL_DELIVERY_STATUS_FAILED": 3, + } +) + +func (x ProposalDeliveryStatus) Enum() *ProposalDeliveryStatus { + p := new(ProposalDeliveryStatus) + *p = x + return p +} + +func (x ProposalDeliveryStatus) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ProposalDeliveryStatus) Descriptor() protoreflect.EnumDescriptor { + return file_job_v1_job_proto_enumTypes[1].Descriptor() +} + +func (ProposalDeliveryStatus) Type() protoreflect.EnumType { + return &file_job_v1_job_proto_enumTypes[1] +} + +func (x ProposalDeliveryStatus) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ProposalDeliveryStatus.Descriptor instead. +func (ProposalDeliveryStatus) EnumDescriptor() ([]byte, []int) { + return file_job_v1_job_proto_rawDescGZIP(), []int{1} +} + +// Job represents the structured data of a job within the system. +type Job struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // Unique identifier for the job. + Uuid string `protobuf:"bytes,2,opt,name=uuid,proto3" json:"uuid,omitempty"` // Universally unique identifier for the job. + NodeId string `protobuf:"bytes,3,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` // ID of the node associated with this job. + ProposalIds []string `protobuf:"bytes,4,rep,name=proposal_ids,json=proposalIds,proto3" json:"proposal_ids,omitempty"` // List of proposal IDs associated with this job. + CreatedAt *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` // Timestamp when the job was created. + UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` // Timestamp when the job was last updated. + DeletedAt *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=deleted_at,json=deletedAt,proto3" json:"deleted_at,omitempty"` // Timestamp when the job was deleted, if applicable. + Labels []*ptypes.Label `protobuf:"bytes,8,rep,name=labels,proto3" json:"labels,omitempty"` // Set of labels associated with the job. +} + +func (x *Job) Reset() { + *x = Job{} + if protoimpl.UnsafeEnabled { + mi := &file_job_v1_job_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Job) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Job) ProtoMessage() {} + +func (x *Job) ProtoReflect() protoreflect.Message { + mi := &file_job_v1_job_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Job.ProtoReflect.Descriptor instead. +func (*Job) Descriptor() ([]byte, []int) { + return file_job_v1_job_proto_rawDescGZIP(), []int{0} +} + +func (x *Job) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *Job) GetUuid() string { + if x != nil { + return x.Uuid + } + return "" +} + +func (x *Job) GetNodeId() string { + if x != nil { + return x.NodeId + } + return "" +} + +func (x *Job) GetProposalIds() []string { + if x != nil { + return x.ProposalIds + } + return nil +} + +func (x *Job) GetCreatedAt() *timestamppb.Timestamp { + if x != nil { + return x.CreatedAt + } + return nil +} + +func (x *Job) GetUpdatedAt() *timestamppb.Timestamp { + if x != nil { + return x.UpdatedAt + } + return nil +} + +func (x *Job) GetDeletedAt() *timestamppb.Timestamp { + if x != nil { + return x.DeletedAt + } + return nil +} + +func (x *Job) GetLabels() []*ptypes.Label { + if x != nil { + return x.Labels + } + return nil +} + +// Proposal represents a job proposal. +type Proposal struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // Unique identifier for the proposal. + Revision int64 `protobuf:"varint,2,opt,name=revision,proto3" json:"revision,omitempty"` // Revision number of the proposal. Montonically increasing. + Status ProposalStatus `protobuf:"varint,3,opt,name=status,proto3,enum=api.job.v1.ProposalStatus" json:"status,omitempty"` // Current status of the proposal. + DeliveryStatus ProposalDeliveryStatus `protobuf:"varint,4,opt,name=delivery_status,json=deliveryStatus,proto3,enum=api.job.v1.ProposalDeliveryStatus" json:"delivery_status,omitempty"` // Delivery status of the proposal. + Spec string `protobuf:"bytes,5,opt,name=spec,proto3" json:"spec,omitempty"` // Specification of the job proposed. + JobId string `protobuf:"bytes,6,opt,name=job_id,json=jobId,proto3" json:"job_id,omitempty"` // ID of the job associated with this proposal. + CreatedAt *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` // Timestamp when the proposal was created. + UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,8,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` // Timestamp when the proposal was last updated. + AckedAt *timestamppb.Timestamp `protobuf:"bytes,9,opt,name=acked_at,json=ackedAt,proto3,oneof" json:"acked_at,omitempty"` // Timestamp when the proposal was acknowledged. + ResponseReceivedAt *timestamppb.Timestamp `protobuf:"bytes,10,opt,name=response_received_at,json=responseReceivedAt,proto3,oneof" json:"response_received_at,omitempty"` // Timestamp when a response was received. +} + +func (x *Proposal) Reset() { + *x = Proposal{} + if protoimpl.UnsafeEnabled { + mi := &file_job_v1_job_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Proposal) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Proposal) ProtoMessage() {} + +func (x *Proposal) ProtoReflect() protoreflect.Message { + mi := &file_job_v1_job_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Proposal.ProtoReflect.Descriptor instead. +func (*Proposal) Descriptor() ([]byte, []int) { + return file_job_v1_job_proto_rawDescGZIP(), []int{1} +} + +func (x *Proposal) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *Proposal) GetRevision() int64 { + if x != nil { + return x.Revision + } + return 0 +} + +func (x *Proposal) GetStatus() ProposalStatus { + if x != nil { + return x.Status + } + return ProposalStatus_PROPOSAL_STATUS_UNSPECIFIED +} + +func (x *Proposal) GetDeliveryStatus() ProposalDeliveryStatus { + if x != nil { + return x.DeliveryStatus + } + return ProposalDeliveryStatus_PROPOSAL_DELIVERY_STATUS_UNSPECIFIED +} + +func (x *Proposal) GetSpec() string { + if x != nil { + return x.Spec + } + return "" +} + +func (x *Proposal) GetJobId() string { + if x != nil { + return x.JobId + } + return "" +} + +func (x *Proposal) GetCreatedAt() *timestamppb.Timestamp { + if x != nil { + return x.CreatedAt + } + return nil +} + +func (x *Proposal) GetUpdatedAt() *timestamppb.Timestamp { + if x != nil { + return x.UpdatedAt + } + return nil +} + +func (x *Proposal) GetAckedAt() *timestamppb.Timestamp { + if x != nil { + return x.AckedAt + } + return nil +} + +func (x *Proposal) GetResponseReceivedAt() *timestamppb.Timestamp { + if x != nil { + return x.ResponseReceivedAt + } + return nil +} + +// GetJobRequest specifies the criteria for retrieving a job. +type GetJobRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to IdOneof: + // + // *GetJobRequest_Id + // *GetJobRequest_Uuid + IdOneof isGetJobRequest_IdOneof `protobuf_oneof:"id_oneof"` +} + +func (x *GetJobRequest) Reset() { + *x = GetJobRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_job_v1_job_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetJobRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetJobRequest) ProtoMessage() {} + +func (x *GetJobRequest) ProtoReflect() protoreflect.Message { + mi := &file_job_v1_job_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetJobRequest.ProtoReflect.Descriptor instead. +func (*GetJobRequest) Descriptor() ([]byte, []int) { + return file_job_v1_job_proto_rawDescGZIP(), []int{2} +} + +func (m *GetJobRequest) GetIdOneof() isGetJobRequest_IdOneof { + if m != nil { + return m.IdOneof + } + return nil +} + +func (x *GetJobRequest) GetId() string { + if x, ok := x.GetIdOneof().(*GetJobRequest_Id); ok { + return x.Id + } + return "" +} + +func (x *GetJobRequest) GetUuid() string { + if x, ok := x.GetIdOneof().(*GetJobRequest_Uuid); ok { + return x.Uuid + } + return "" +} + +type isGetJobRequest_IdOneof interface { + isGetJobRequest_IdOneof() +} + +type GetJobRequest_Id struct { + Id string `protobuf:"bytes,1,opt,name=id,proto3,oneof"` // Unique identifier of the job. +} + +type GetJobRequest_Uuid struct { + Uuid string `protobuf:"bytes,2,opt,name=uuid,proto3,oneof"` // Universally unique identifier of the job. +} + +func (*GetJobRequest_Id) isGetJobRequest_IdOneof() {} + +func (*GetJobRequest_Uuid) isGetJobRequest_IdOneof() {} + +// GetJobResponse contains the job details. +type GetJobResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Job *Job `protobuf:"bytes,1,opt,name=job,proto3" json:"job,omitempty"` // Details of the retrieved job. +} + +func (x *GetJobResponse) Reset() { + *x = GetJobResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_job_v1_job_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetJobResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetJobResponse) ProtoMessage() {} + +func (x *GetJobResponse) ProtoReflect() protoreflect.Message { + mi := &file_job_v1_job_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetJobResponse.ProtoReflect.Descriptor instead. +func (*GetJobResponse) Descriptor() ([]byte, []int) { + return file_job_v1_job_proto_rawDescGZIP(), []int{3} +} + +func (x *GetJobResponse) GetJob() *Job { + if x != nil { + return x.Job + } + return nil +} + +// GetProposalRequest specifies the criteria for retrieving a proposal. +type GetProposalRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // Unique identifier of the proposal to retrieve. +} + +func (x *GetProposalRequest) Reset() { + *x = GetProposalRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_job_v1_job_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetProposalRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetProposalRequest) ProtoMessage() {} + +func (x *GetProposalRequest) ProtoReflect() protoreflect.Message { + mi := &file_job_v1_job_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetProposalRequest.ProtoReflect.Descriptor instead. +func (*GetProposalRequest) Descriptor() ([]byte, []int) { + return file_job_v1_job_proto_rawDescGZIP(), []int{4} +} + +func (x *GetProposalRequest) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +// GetProposalResponse contains the proposal details. +type GetProposalResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Proposal *Proposal `protobuf:"bytes,1,opt,name=proposal,proto3" json:"proposal,omitempty"` // Details of the retrieved proposal. +} + +func (x *GetProposalResponse) Reset() { + *x = GetProposalResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_job_v1_job_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetProposalResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetProposalResponse) ProtoMessage() {} + +func (x *GetProposalResponse) ProtoReflect() protoreflect.Message { + mi := &file_job_v1_job_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetProposalResponse.ProtoReflect.Descriptor instead. +func (*GetProposalResponse) Descriptor() ([]byte, []int) { + return file_job_v1_job_proto_rawDescGZIP(), []int{5} +} + +func (x *GetProposalResponse) GetProposal() *Proposal { + if x != nil { + return x.Proposal + } + return nil +} + +// ListJobsRequest specifies filters for listing jobs. +type ListJobsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Filter *ListJobsRequest_Filter `protobuf:"bytes,1,opt,name=filter,proto3" json:"filter,omitempty"` // Filters applied to the job listing. +} + +func (x *ListJobsRequest) Reset() { + *x = ListJobsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_job_v1_job_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListJobsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListJobsRequest) ProtoMessage() {} + +func (x *ListJobsRequest) ProtoReflect() protoreflect.Message { + mi := &file_job_v1_job_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListJobsRequest.ProtoReflect.Descriptor instead. +func (*ListJobsRequest) Descriptor() ([]byte, []int) { + return file_job_v1_job_proto_rawDescGZIP(), []int{6} +} + +func (x *ListJobsRequest) GetFilter() *ListJobsRequest_Filter { + if x != nil { + return x.Filter + } + return nil +} + +// ListJobsResponse contains a list of jobs that match the filters. +type ListJobsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Jobs []*Job `protobuf:"bytes,1,rep,name=jobs,proto3" json:"jobs,omitempty"` // List of jobs. +} + +func (x *ListJobsResponse) Reset() { + *x = ListJobsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_job_v1_job_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListJobsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListJobsResponse) ProtoMessage() {} + +func (x *ListJobsResponse) ProtoReflect() protoreflect.Message { + mi := &file_job_v1_job_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListJobsResponse.ProtoReflect.Descriptor instead. +func (*ListJobsResponse) Descriptor() ([]byte, []int) { + return file_job_v1_job_proto_rawDescGZIP(), []int{7} +} + +func (x *ListJobsResponse) GetJobs() []*Job { + if x != nil { + return x.Jobs + } + return nil +} + +// ListProposalsRequest specifies filters for listing proposals. +type ListProposalsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Filter *ListProposalsRequest_Filter `protobuf:"bytes,1,opt,name=filter,proto3" json:"filter,omitempty"` // Filters applied to the proposal listing. +} + +func (x *ListProposalsRequest) Reset() { + *x = ListProposalsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_job_v1_job_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListProposalsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListProposalsRequest) ProtoMessage() {} + +func (x *ListProposalsRequest) ProtoReflect() protoreflect.Message { + mi := &file_job_v1_job_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListProposalsRequest.ProtoReflect.Descriptor instead. +func (*ListProposalsRequest) Descriptor() ([]byte, []int) { + return file_job_v1_job_proto_rawDescGZIP(), []int{8} +} + +func (x *ListProposalsRequest) GetFilter() *ListProposalsRequest_Filter { + if x != nil { + return x.Filter + } + return nil +} + +// ListProposalsResponse contains a list of proposals that match the filters. +type ListProposalsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Proposals []*Proposal `protobuf:"bytes,1,rep,name=proposals,proto3" json:"proposals,omitempty"` // List of proposals. +} + +func (x *ListProposalsResponse) Reset() { + *x = ListProposalsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_job_v1_job_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListProposalsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListProposalsResponse) ProtoMessage() {} + +func (x *ListProposalsResponse) ProtoReflect() protoreflect.Message { + mi := &file_job_v1_job_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListProposalsResponse.ProtoReflect.Descriptor instead. +func (*ListProposalsResponse) Descriptor() ([]byte, []int) { + return file_job_v1_job_proto_rawDescGZIP(), []int{9} +} + +func (x *ListProposalsResponse) GetProposals() []*Proposal { + if x != nil { + return x.Proposals + } + return nil +} + +// ProposeJobRequest contains the information needed to submit a new job proposal. +type ProposeJobRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + NodeId string `protobuf:"bytes,1,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` // ID of the node to which the job is proposed. + Spec string `protobuf:"bytes,2,opt,name=spec,proto3" json:"spec,omitempty"` // Specification of the job being proposed. + Labels []*ptypes.Label `protobuf:"bytes,3,rep,name=labels,proto3" json:"labels,omitempty"` // Labels to associate with the job. +} + +func (x *ProposeJobRequest) Reset() { + *x = ProposeJobRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_job_v1_job_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ProposeJobRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ProposeJobRequest) ProtoMessage() {} + +func (x *ProposeJobRequest) ProtoReflect() protoreflect.Message { + mi := &file_job_v1_job_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ProposeJobRequest.ProtoReflect.Descriptor instead. +func (*ProposeJobRequest) Descriptor() ([]byte, []int) { + return file_job_v1_job_proto_rawDescGZIP(), []int{10} +} + +func (x *ProposeJobRequest) GetNodeId() string { + if x != nil { + return x.NodeId + } + return "" +} + +func (x *ProposeJobRequest) GetSpec() string { + if x != nil { + return x.Spec + } + return "" +} + +func (x *ProposeJobRequest) GetLabels() []*ptypes.Label { + if x != nil { + return x.Labels + } + return nil +} + +// ProposeJobResponse returns the newly created proposal. +type ProposeJobResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Proposal *Proposal `protobuf:"bytes,1,opt,name=proposal,proto3" json:"proposal,omitempty"` // Details of the newly created proposal. +} + +func (x *ProposeJobResponse) Reset() { + *x = ProposeJobResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_job_v1_job_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ProposeJobResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ProposeJobResponse) ProtoMessage() {} + +func (x *ProposeJobResponse) ProtoReflect() protoreflect.Message { + mi := &file_job_v1_job_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ProposeJobResponse.ProtoReflect.Descriptor instead. +func (*ProposeJobResponse) Descriptor() ([]byte, []int) { + return file_job_v1_job_proto_rawDescGZIP(), []int{11} +} + +func (x *ProposeJobResponse) GetProposal() *Proposal { + if x != nil { + return x.Proposal + } + return nil +} + +// RevokeJobRequest specifies the criteria for revoking a job proposal. +type RevokeJobRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to IdOneof: + // + // *RevokeJobRequest_Id + // *RevokeJobRequest_Uuid + IdOneof isRevokeJobRequest_IdOneof `protobuf_oneof:"id_oneof"` +} + +func (x *RevokeJobRequest) Reset() { + *x = RevokeJobRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_job_v1_job_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RevokeJobRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RevokeJobRequest) ProtoMessage() {} + +func (x *RevokeJobRequest) ProtoReflect() protoreflect.Message { + mi := &file_job_v1_job_proto_msgTypes[12] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RevokeJobRequest.ProtoReflect.Descriptor instead. +func (*RevokeJobRequest) Descriptor() ([]byte, []int) { + return file_job_v1_job_proto_rawDescGZIP(), []int{12} +} + +func (m *RevokeJobRequest) GetIdOneof() isRevokeJobRequest_IdOneof { + if m != nil { + return m.IdOneof + } + return nil +} + +func (x *RevokeJobRequest) GetId() string { + if x, ok := x.GetIdOneof().(*RevokeJobRequest_Id); ok { + return x.Id + } + return "" +} + +func (x *RevokeJobRequest) GetUuid() string { + if x, ok := x.GetIdOneof().(*RevokeJobRequest_Uuid); ok { + return x.Uuid + } + return "" +} + +type isRevokeJobRequest_IdOneof interface { + isRevokeJobRequest_IdOneof() +} + +type RevokeJobRequest_Id struct { + Id string `protobuf:"bytes,1,opt,name=id,proto3,oneof"` // Unique identifier of the proposal to revoke. +} + +type RevokeJobRequest_Uuid struct { + Uuid string `protobuf:"bytes,2,opt,name=uuid,proto3,oneof"` // Universally unique identifier of the proposal to revoke. +} + +func (*RevokeJobRequest_Id) isRevokeJobRequest_IdOneof() {} + +func (*RevokeJobRequest_Uuid) isRevokeJobRequest_IdOneof() {} + +// RevokeJobResponse returns the revoked proposal. +type RevokeJobResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Proposal *Proposal `protobuf:"bytes,1,opt,name=proposal,proto3" json:"proposal,omitempty"` // Details of the revoked proposal. +} + +func (x *RevokeJobResponse) Reset() { + *x = RevokeJobResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_job_v1_job_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RevokeJobResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RevokeJobResponse) ProtoMessage() {} + +func (x *RevokeJobResponse) ProtoReflect() protoreflect.Message { + mi := &file_job_v1_job_proto_msgTypes[13] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RevokeJobResponse.ProtoReflect.Descriptor instead. +func (*RevokeJobResponse) Descriptor() ([]byte, []int) { + return file_job_v1_job_proto_rawDescGZIP(), []int{13} +} + +func (x *RevokeJobResponse) GetProposal() *Proposal { + if x != nil { + return x.Proposal + } + return nil +} + +// DeleteJobRequest specifies the criteria for deleting a job. +type DeleteJobRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to IdOneof: + // + // *DeleteJobRequest_Id + // *DeleteJobRequest_Uuid + IdOneof isDeleteJobRequest_IdOneof `protobuf_oneof:"id_oneof"` +} + +func (x *DeleteJobRequest) Reset() { + *x = DeleteJobRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_job_v1_job_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteJobRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteJobRequest) ProtoMessage() {} + +func (x *DeleteJobRequest) ProtoReflect() protoreflect.Message { + mi := &file_job_v1_job_proto_msgTypes[14] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteJobRequest.ProtoReflect.Descriptor instead. +func (*DeleteJobRequest) Descriptor() ([]byte, []int) { + return file_job_v1_job_proto_rawDescGZIP(), []int{14} +} + +func (m *DeleteJobRequest) GetIdOneof() isDeleteJobRequest_IdOneof { + if m != nil { + return m.IdOneof + } + return nil +} + +func (x *DeleteJobRequest) GetId() string { + if x, ok := x.GetIdOneof().(*DeleteJobRequest_Id); ok { + return x.Id + } + return "" +} + +func (x *DeleteJobRequest) GetUuid() string { + if x, ok := x.GetIdOneof().(*DeleteJobRequest_Uuid); ok { + return x.Uuid + } + return "" +} + +type isDeleteJobRequest_IdOneof interface { + isDeleteJobRequest_IdOneof() +} + +type DeleteJobRequest_Id struct { + Id string `protobuf:"bytes,1,opt,name=id,proto3,oneof"` // Unique identifier of the job to delete. +} + +type DeleteJobRequest_Uuid struct { + Uuid string `protobuf:"bytes,2,opt,name=uuid,proto3,oneof"` // Universally unique identifier of the job to delete. +} + +func (*DeleteJobRequest_Id) isDeleteJobRequest_IdOneof() {} + +func (*DeleteJobRequest_Uuid) isDeleteJobRequest_IdOneof() {} + +// DeleteJobResponse returns details of the deleted job. +type DeleteJobResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Job *Job `protobuf:"bytes,1,opt,name=job,proto3" json:"job,omitempty"` // Details of the deleted job. +} + +func (x *DeleteJobResponse) Reset() { + *x = DeleteJobResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_job_v1_job_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteJobResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteJobResponse) ProtoMessage() {} + +func (x *DeleteJobResponse) ProtoReflect() protoreflect.Message { + mi := &file_job_v1_job_proto_msgTypes[15] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteJobResponse.ProtoReflect.Descriptor instead. +func (*DeleteJobResponse) Descriptor() ([]byte, []int) { + return file_job_v1_job_proto_rawDescGZIP(), []int{15} +} + +func (x *DeleteJobResponse) GetJob() *Job { + if x != nil { + return x.Job + } + return nil +} + +// UpdateJobRequest specifies the criteria for updating a job. +type UpdateJobRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to IdOneof: + // + // *UpdateJobRequest_Id + // *UpdateJobRequest_Uuid + IdOneof isUpdateJobRequest_IdOneof `protobuf_oneof:"id_oneof"` + Labels []*ptypes.Label `protobuf:"bytes,3,rep,name=labels,proto3" json:"labels,omitempty"` // Set of labels associated with the job. +} + +func (x *UpdateJobRequest) Reset() { + *x = UpdateJobRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_job_v1_job_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateJobRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateJobRequest) ProtoMessage() {} + +func (x *UpdateJobRequest) ProtoReflect() protoreflect.Message { + mi := &file_job_v1_job_proto_msgTypes[16] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateJobRequest.ProtoReflect.Descriptor instead. +func (*UpdateJobRequest) Descriptor() ([]byte, []int) { + return file_job_v1_job_proto_rawDescGZIP(), []int{16} +} + +func (m *UpdateJobRequest) GetIdOneof() isUpdateJobRequest_IdOneof { + if m != nil { + return m.IdOneof + } + return nil +} + +func (x *UpdateJobRequest) GetId() string { + if x, ok := x.GetIdOneof().(*UpdateJobRequest_Id); ok { + return x.Id + } + return "" +} + +func (x *UpdateJobRequest) GetUuid() string { + if x, ok := x.GetIdOneof().(*UpdateJobRequest_Uuid); ok { + return x.Uuid + } + return "" +} + +func (x *UpdateJobRequest) GetLabels() []*ptypes.Label { + if x != nil { + return x.Labels + } + return nil +} + +type isUpdateJobRequest_IdOneof interface { + isUpdateJobRequest_IdOneof() +} + +type UpdateJobRequest_Id struct { + Id string `protobuf:"bytes,1,opt,name=id,proto3,oneof"` // Unique identifier of the job to update. +} + +type UpdateJobRequest_Uuid struct { + Uuid string `protobuf:"bytes,2,opt,name=uuid,proto3,oneof"` // Universally unique identifier of the job to update. +} + +func (*UpdateJobRequest_Id) isUpdateJobRequest_IdOneof() {} + +func (*UpdateJobRequest_Uuid) isUpdateJobRequest_IdOneof() {} + +// UpdateJobResponse returns details of the updated job. +type UpdateJobResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Job *Job `protobuf:"bytes,1,opt,name=job,proto3" json:"job,omitempty"` // Details of the updated job. +} + +func (x *UpdateJobResponse) Reset() { + *x = UpdateJobResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_job_v1_job_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateJobResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateJobResponse) ProtoMessage() {} + +func (x *UpdateJobResponse) ProtoReflect() protoreflect.Message { + mi := &file_job_v1_job_proto_msgTypes[17] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateJobResponse.ProtoReflect.Descriptor instead. +func (*UpdateJobResponse) Descriptor() ([]byte, []int) { + return file_job_v1_job_proto_rawDescGZIP(), []int{17} +} + +func (x *UpdateJobResponse) GetJob() *Job { + if x != nil { + return x.Job + } + return nil +} + +type ListJobsRequest_Filter struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Ids []string `protobuf:"bytes,1,rep,name=ids,proto3" json:"ids,omitempty"` // Filter by job IDs. + NodeIds []string `protobuf:"bytes,2,rep,name=node_ids,json=nodeIds,proto3" json:"node_ids,omitempty"` // Filter by node IDs. + Selectors []*ptypes.Selector `protobuf:"bytes,3,rep,name=selectors,proto3" json:"selectors,omitempty"` // Filter by selectors +} + +func (x *ListJobsRequest_Filter) Reset() { + *x = ListJobsRequest_Filter{} + if protoimpl.UnsafeEnabled { + mi := &file_job_v1_job_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListJobsRequest_Filter) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListJobsRequest_Filter) ProtoMessage() {} + +func (x *ListJobsRequest_Filter) ProtoReflect() protoreflect.Message { + mi := &file_job_v1_job_proto_msgTypes[18] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListJobsRequest_Filter.ProtoReflect.Descriptor instead. +func (*ListJobsRequest_Filter) Descriptor() ([]byte, []int) { + return file_job_v1_job_proto_rawDescGZIP(), []int{6, 0} +} + +func (x *ListJobsRequest_Filter) GetIds() []string { + if x != nil { + return x.Ids + } + return nil +} + +func (x *ListJobsRequest_Filter) GetNodeIds() []string { + if x != nil { + return x.NodeIds + } + return nil +} + +func (x *ListJobsRequest_Filter) GetSelectors() []*ptypes.Selector { + if x != nil { + return x.Selectors + } + return nil +} + +type ListProposalsRequest_Filter struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Ids []string `protobuf:"bytes,1,rep,name=ids,proto3" json:"ids,omitempty"` // Filter by proposal IDs. + JobIds []string `protobuf:"bytes,2,rep,name=job_ids,json=jobIds,proto3" json:"job_ids,omitempty"` // Filter by job IDs. +} + +func (x *ListProposalsRequest_Filter) Reset() { + *x = ListProposalsRequest_Filter{} + if protoimpl.UnsafeEnabled { + mi := &file_job_v1_job_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListProposalsRequest_Filter) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListProposalsRequest_Filter) ProtoMessage() {} + +func (x *ListProposalsRequest_Filter) ProtoReflect() protoreflect.Message { + mi := &file_job_v1_job_proto_msgTypes[19] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListProposalsRequest_Filter.ProtoReflect.Descriptor instead. +func (*ListProposalsRequest_Filter) Descriptor() ([]byte, []int) { + return file_job_v1_job_proto_rawDescGZIP(), []int{8, 0} +} + +func (x *ListProposalsRequest_Filter) GetIds() []string { + if x != nil { + return x.Ids + } + return nil +} + +func (x *ListProposalsRequest_Filter) GetJobIds() []string { + if x != nil { + return x.JobIds + } + return nil +} + +var File_job_v1_job_proto protoreflect.FileDescriptor + +var file_job_v1_job_proto_rawDesc = []byte{ + 0x0a, 0x10, 0x6a, 0x6f, 0x62, 0x2f, 0x76, 0x31, 0x2f, 0x6a, 0x6f, 0x62, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x12, 0x0a, 0x61, 0x70, 0x69, 0x2e, 0x6a, 0x6f, 0x62, 0x2e, 0x76, 0x31, 0x1a, 0x1f, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, + 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, + 0x19, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2f, 0x70, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x6c, + 0x61, 0x62, 0x65, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc0, 0x02, 0x0a, 0x03, 0x4a, + 0x6f, 0x62, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, + 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x75, 0x75, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x69, + 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x12, + 0x21, 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x73, 0x18, + 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x49, + 0x64, 0x73, 0x12, 0x39, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x39, 0x0a, + 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x75, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x39, 0x0a, 0x0a, 0x64, 0x65, 0x6c, 0x65, + 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, + 0x64, 0x41, 0x74, 0x12, 0x28, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x08, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x2e, + 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x22, 0x8d, 0x04, + 0x0a, 0x08, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, + 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x72, 0x65, + 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x32, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x6a, 0x6f, 0x62, + 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x53, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x4b, 0x0a, 0x0f, 0x64, 0x65, + 0x6c, 0x69, 0x76, 0x65, 0x72, 0x79, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x0e, 0x32, 0x22, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x6a, 0x6f, 0x62, 0x2e, 0x76, 0x31, + 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x44, 0x65, 0x6c, 0x69, 0x76, 0x65, 0x72, + 0x79, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x0e, 0x64, 0x65, 0x6c, 0x69, 0x76, 0x65, 0x72, + 0x79, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x70, 0x65, 0x63, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x70, 0x65, 0x63, 0x12, 0x15, 0x0a, 0x06, 0x6a, + 0x6f, 0x62, 0x5f, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6a, 0x6f, 0x62, + 0x49, 0x64, 0x12, 0x39, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, + 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x39, 0x0a, + 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x75, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x3a, 0x0a, 0x08, 0x61, 0x63, 0x6b, 0x65, + 0x64, 0x5f, 0x61, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x48, 0x00, 0x52, 0x07, 0x61, 0x63, 0x6b, 0x65, 0x64, 0x41, + 0x74, 0x88, 0x01, 0x01, 0x12, 0x51, 0x0a, 0x14, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x5f, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x0a, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x48, 0x01, + 0x52, 0x12, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, + 0x65, 0x64, 0x41, 0x74, 0x88, 0x01, 0x01, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x61, 0x63, 0x6b, 0x65, + 0x64, 0x5f, 0x61, 0x74, 0x42, 0x17, 0x0a, 0x15, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x5f, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x22, 0x43, 0x0a, + 0x0d, 0x47, 0x65, 0x74, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, + 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x02, 0x69, 0x64, + 0x12, 0x14, 0x0a, 0x04, 0x75, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, + 0x52, 0x04, 0x75, 0x75, 0x69, 0x64, 0x42, 0x0a, 0x0a, 0x08, 0x69, 0x64, 0x5f, 0x6f, 0x6e, 0x65, + 0x6f, 0x66, 0x22, 0x33, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x21, 0x0a, 0x03, 0x6a, 0x6f, 0x62, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x0f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x6a, 0x6f, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x4a, + 0x6f, 0x62, 0x52, 0x03, 0x6a, 0x6f, 0x62, 0x22, 0x24, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x50, 0x72, + 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, + 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x47, 0x0a, + 0x13, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x30, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x6a, 0x6f, 0x62, + 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x52, 0x08, 0x70, 0x72, + 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x22, 0xb7, 0x01, 0x0a, 0x0f, 0x4c, 0x69, 0x73, 0x74, 0x4a, + 0x6f, 0x62, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3a, 0x0a, 0x06, 0x66, 0x69, + 0x6c, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x6a, 0x6f, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4a, 0x6f, 0x62, 0x73, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x52, 0x06, + 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x1a, 0x68, 0x0a, 0x06, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, + 0x12, 0x10, 0x0a, 0x03, 0x69, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x03, 0x69, + 0x64, 0x73, 0x12, 0x19, 0x0a, 0x08, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x02, + 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x73, 0x12, 0x31, 0x0a, + 0x09, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x13, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x2e, 0x53, 0x65, 0x6c, + 0x65, 0x63, 0x74, 0x6f, 0x72, 0x52, 0x09, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x73, + 0x22, 0x37, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x4a, 0x6f, 0x62, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x23, 0x0a, 0x04, 0x6a, 0x6f, 0x62, 0x73, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x6a, 0x6f, 0x62, 0x2e, 0x76, 0x31, 0x2e, + 0x4a, 0x6f, 0x62, 0x52, 0x04, 0x6a, 0x6f, 0x62, 0x73, 0x22, 0x8c, 0x01, 0x0a, 0x14, 0x4c, 0x69, + 0x73, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x3f, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x6a, 0x6f, 0x62, 0x2e, 0x76, 0x31, 0x2e, + 0x4c, 0x69, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x2e, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x52, 0x06, 0x66, 0x69, 0x6c, + 0x74, 0x65, 0x72, 0x1a, 0x33, 0x0a, 0x06, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x10, 0x0a, + 0x03, 0x69, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x03, 0x69, 0x64, 0x73, 0x12, + 0x17, 0x0a, 0x07, 0x6a, 0x6f, 0x62, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, + 0x52, 0x06, 0x6a, 0x6f, 0x62, 0x49, 0x64, 0x73, 0x22, 0x4b, 0x0a, 0x15, 0x4c, 0x69, 0x73, 0x74, + 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x32, 0x0a, 0x09, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x73, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x6a, 0x6f, 0x62, 0x2e, 0x76, + 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x70, + 0x6f, 0x73, 0x61, 0x6c, 0x73, 0x22, 0x6a, 0x0a, 0x11, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, + 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x6e, 0x6f, + 0x64, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6e, 0x6f, 0x64, + 0x65, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x70, 0x65, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x73, 0x70, 0x65, 0x63, 0x12, 0x28, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, + 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x6c, 0x61, + 0x62, 0x65, 0x6c, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, + 0x73, 0x22, 0x46, 0x0a, 0x12, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x4a, 0x6f, 0x62, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x30, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x70, 0x6f, + 0x73, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x6a, 0x6f, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x52, + 0x08, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x22, 0x46, 0x0a, 0x10, 0x52, 0x65, 0x76, + 0x6f, 0x6b, 0x65, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, + 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x02, 0x69, 0x64, 0x12, + 0x14, 0x0a, 0x04, 0x75, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, + 0x04, 0x75, 0x75, 0x69, 0x64, 0x42, 0x0a, 0x0a, 0x08, 0x69, 0x64, 0x5f, 0x6f, 0x6e, 0x65, 0x6f, + 0x66, 0x22, 0x45, 0x0a, 0x11, 0x52, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x4a, 0x6f, 0x62, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x30, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, + 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x6a, + 0x6f, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x52, 0x08, + 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x22, 0x46, 0x0a, 0x10, 0x44, 0x65, 0x6c, 0x65, + 0x74, 0x65, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x02, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, + 0x0a, 0x04, 0x75, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x04, + 0x75, 0x75, 0x69, 0x64, 0x42, 0x0a, 0x0a, 0x08, 0x69, 0x64, 0x5f, 0x6f, 0x6e, 0x65, 0x6f, 0x66, + 0x22, 0x36, 0x0a, 0x11, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x21, 0x0a, 0x03, 0x6a, 0x6f, 0x62, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x6a, 0x6f, 0x62, 0x2e, 0x76, 0x31, 0x2e, + 0x4a, 0x6f, 0x62, 0x52, 0x03, 0x6a, 0x6f, 0x62, 0x22, 0x70, 0x0a, 0x10, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x02, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, + 0x0a, 0x04, 0x75, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x04, + 0x75, 0x75, 0x69, 0x64, 0x12, 0x28, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x03, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x6c, 0x61, 0x62, 0x65, 0x6c, + 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x42, 0x0a, + 0x0a, 0x08, 0x69, 0x64, 0x5f, 0x6f, 0x6e, 0x65, 0x6f, 0x66, 0x22, 0x36, 0x0a, 0x11, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x21, 0x0a, 0x03, 0x6a, 0x6f, 0x62, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x6a, 0x6f, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x4a, 0x6f, 0x62, 0x52, 0x03, 0x6a, + 0x6f, 0x62, 0x2a, 0xe4, 0x01, 0x0a, 0x0e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x53, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1f, 0x0a, 0x1b, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, + 0x4c, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, + 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1c, 0x0a, 0x18, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, + 0x41, 0x4c, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, + 0x45, 0x44, 0x10, 0x01, 0x12, 0x1c, 0x0a, 0x18, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, + 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x41, 0x50, 0x50, 0x52, 0x4f, 0x56, 0x45, 0x44, + 0x10, 0x02, 0x12, 0x1c, 0x0a, 0x18, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, 0x53, + 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x52, 0x45, 0x4a, 0x45, 0x43, 0x54, 0x45, 0x44, 0x10, 0x03, + 0x12, 0x1d, 0x0a, 0x19, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, 0x53, 0x54, 0x41, + 0x54, 0x55, 0x53, 0x5f, 0x43, 0x41, 0x4e, 0x43, 0x45, 0x4c, 0x4c, 0x45, 0x44, 0x10, 0x04, 0x12, + 0x1b, 0x0a, 0x17, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, 0x53, 0x54, 0x41, 0x54, + 0x55, 0x53, 0x5f, 0x50, 0x45, 0x4e, 0x44, 0x49, 0x4e, 0x47, 0x10, 0x05, 0x12, 0x1b, 0x0a, 0x17, + 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, + 0x52, 0x45, 0x56, 0x4f, 0x4b, 0x45, 0x44, 0x10, 0x06, 0x2a, 0xba, 0x01, 0x0a, 0x16, 0x50, 0x72, + 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x44, 0x65, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x79, 0x53, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x12, 0x28, 0x0a, 0x24, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, + 0x5f, 0x44, 0x45, 0x4c, 0x49, 0x56, 0x45, 0x52, 0x59, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, + 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x26, + 0x0a, 0x22, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, 0x44, 0x45, 0x4c, 0x49, 0x56, + 0x45, 0x52, 0x59, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x44, 0x45, 0x4c, 0x49, 0x56, + 0x45, 0x52, 0x45, 0x44, 0x10, 0x01, 0x12, 0x29, 0x0a, 0x25, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, + 0x41, 0x4c, 0x5f, 0x44, 0x45, 0x4c, 0x49, 0x56, 0x45, 0x52, 0x59, 0x5f, 0x53, 0x54, 0x41, 0x54, + 0x55, 0x53, 0x5f, 0x41, 0x43, 0x4b, 0x4e, 0x4f, 0x57, 0x4c, 0x45, 0x44, 0x47, 0x45, 0x44, 0x10, + 0x02, 0x12, 0x23, 0x0a, 0x1f, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, 0x44, 0x45, + 0x4c, 0x49, 0x56, 0x45, 0x52, 0x59, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x46, 0x41, + 0x49, 0x4c, 0x45, 0x44, 0x10, 0x03, 0x32, 0xf5, 0x04, 0x0a, 0x0a, 0x4a, 0x6f, 0x62, 0x53, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x41, 0x0a, 0x06, 0x47, 0x65, 0x74, 0x4a, 0x6f, 0x62, 0x12, + 0x19, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x6a, 0x6f, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, + 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x6a, 0x6f, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4a, 0x6f, 0x62, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x50, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x50, + 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x12, 0x1e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x6a, 0x6f, + 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x6a, 0x6f, + 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x47, 0x0a, 0x08, 0x4c, 0x69, + 0x73, 0x74, 0x4a, 0x6f, 0x62, 0x73, 0x12, 0x1b, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x6a, 0x6f, 0x62, + 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4a, 0x6f, 0x62, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x6a, 0x6f, 0x62, 0x2e, 0x76, 0x31, + 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4a, 0x6f, 0x62, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x00, 0x12, 0x56, 0x0a, 0x0d, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x6f, + 0x73, 0x61, 0x6c, 0x73, 0x12, 0x20, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x6a, 0x6f, 0x62, 0x2e, 0x76, + 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x73, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x6a, 0x6f, 0x62, + 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x4d, 0x0a, 0x0a, 0x50, + 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x4a, 0x6f, 0x62, 0x12, 0x1d, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x6a, 0x6f, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x4a, 0x6f, + 0x62, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x6a, + 0x6f, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x4a, 0x6f, 0x62, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x4a, 0x0a, 0x09, 0x52, 0x65, + 0x76, 0x6f, 0x6b, 0x65, 0x4a, 0x6f, 0x62, 0x12, 0x1c, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x6a, 0x6f, + 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x4a, 0x6f, 0x62, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x6a, 0x6f, 0x62, 0x2e, + 0x76, 0x31, 0x2e, 0x52, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x4a, 0x0a, 0x09, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, + 0x4a, 0x6f, 0x62, 0x12, 0x1c, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x6a, 0x6f, 0x62, 0x2e, 0x76, 0x31, + 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x1d, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x6a, 0x6f, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x44, + 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x00, 0x12, 0x4a, 0x0a, 0x09, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4a, 0x6f, 0x62, 0x12, + 0x1c, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x6a, 0x6f, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x6a, 0x6f, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x08, + 0x5a, 0x06, 0x6a, 0x6f, 0x62, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_job_v1_job_proto_rawDescOnce sync.Once + file_job_v1_job_proto_rawDescData = file_job_v1_job_proto_rawDesc +) + +func file_job_v1_job_proto_rawDescGZIP() []byte { + file_job_v1_job_proto_rawDescOnce.Do(func() { + file_job_v1_job_proto_rawDescData = protoimpl.X.CompressGZIP(file_job_v1_job_proto_rawDescData) + }) + return file_job_v1_job_proto_rawDescData +} + +var file_job_v1_job_proto_enumTypes = make([]protoimpl.EnumInfo, 2) +var file_job_v1_job_proto_msgTypes = make([]protoimpl.MessageInfo, 20) +var file_job_v1_job_proto_goTypes = []interface{}{ + (ProposalStatus)(0), // 0: api.job.v1.ProposalStatus + (ProposalDeliveryStatus)(0), // 1: api.job.v1.ProposalDeliveryStatus + (*Job)(nil), // 2: api.job.v1.Job + (*Proposal)(nil), // 3: api.job.v1.Proposal + (*GetJobRequest)(nil), // 4: api.job.v1.GetJobRequest + (*GetJobResponse)(nil), // 5: api.job.v1.GetJobResponse + (*GetProposalRequest)(nil), // 6: api.job.v1.GetProposalRequest + (*GetProposalResponse)(nil), // 7: api.job.v1.GetProposalResponse + (*ListJobsRequest)(nil), // 8: api.job.v1.ListJobsRequest + (*ListJobsResponse)(nil), // 9: api.job.v1.ListJobsResponse + (*ListProposalsRequest)(nil), // 10: api.job.v1.ListProposalsRequest + (*ListProposalsResponse)(nil), // 11: api.job.v1.ListProposalsResponse + (*ProposeJobRequest)(nil), // 12: api.job.v1.ProposeJobRequest + (*ProposeJobResponse)(nil), // 13: api.job.v1.ProposeJobResponse + (*RevokeJobRequest)(nil), // 14: api.job.v1.RevokeJobRequest + (*RevokeJobResponse)(nil), // 15: api.job.v1.RevokeJobResponse + (*DeleteJobRequest)(nil), // 16: api.job.v1.DeleteJobRequest + (*DeleteJobResponse)(nil), // 17: api.job.v1.DeleteJobResponse + (*UpdateJobRequest)(nil), // 18: api.job.v1.UpdateJobRequest + (*UpdateJobResponse)(nil), // 19: api.job.v1.UpdateJobResponse + (*ListJobsRequest_Filter)(nil), // 20: api.job.v1.ListJobsRequest.Filter + (*ListProposalsRequest_Filter)(nil), // 21: api.job.v1.ListProposalsRequest.Filter + (*timestamppb.Timestamp)(nil), // 22: google.protobuf.Timestamp + (*ptypes.Label)(nil), // 23: api.label.Label + (*ptypes.Selector)(nil), // 24: api.label.Selector +} +var file_job_v1_job_proto_depIdxs = []int32{ + 22, // 0: api.job.v1.Job.created_at:type_name -> google.protobuf.Timestamp + 22, // 1: api.job.v1.Job.updated_at:type_name -> google.protobuf.Timestamp + 22, // 2: api.job.v1.Job.deleted_at:type_name -> google.protobuf.Timestamp + 23, // 3: api.job.v1.Job.labels:type_name -> api.label.Label + 0, // 4: api.job.v1.Proposal.status:type_name -> api.job.v1.ProposalStatus + 1, // 5: api.job.v1.Proposal.delivery_status:type_name -> api.job.v1.ProposalDeliveryStatus + 22, // 6: api.job.v1.Proposal.created_at:type_name -> google.protobuf.Timestamp + 22, // 7: api.job.v1.Proposal.updated_at:type_name -> google.protobuf.Timestamp + 22, // 8: api.job.v1.Proposal.acked_at:type_name -> google.protobuf.Timestamp + 22, // 9: api.job.v1.Proposal.response_received_at:type_name -> google.protobuf.Timestamp + 2, // 10: api.job.v1.GetJobResponse.job:type_name -> api.job.v1.Job + 3, // 11: api.job.v1.GetProposalResponse.proposal:type_name -> api.job.v1.Proposal + 20, // 12: api.job.v1.ListJobsRequest.filter:type_name -> api.job.v1.ListJobsRequest.Filter + 2, // 13: api.job.v1.ListJobsResponse.jobs:type_name -> api.job.v1.Job + 21, // 14: api.job.v1.ListProposalsRequest.filter:type_name -> api.job.v1.ListProposalsRequest.Filter + 3, // 15: api.job.v1.ListProposalsResponse.proposals:type_name -> api.job.v1.Proposal + 23, // 16: api.job.v1.ProposeJobRequest.labels:type_name -> api.label.Label + 3, // 17: api.job.v1.ProposeJobResponse.proposal:type_name -> api.job.v1.Proposal + 3, // 18: api.job.v1.RevokeJobResponse.proposal:type_name -> api.job.v1.Proposal + 2, // 19: api.job.v1.DeleteJobResponse.job:type_name -> api.job.v1.Job + 23, // 20: api.job.v1.UpdateJobRequest.labels:type_name -> api.label.Label + 2, // 21: api.job.v1.UpdateJobResponse.job:type_name -> api.job.v1.Job + 24, // 22: api.job.v1.ListJobsRequest.Filter.selectors:type_name -> api.label.Selector + 4, // 23: api.job.v1.JobService.GetJob:input_type -> api.job.v1.GetJobRequest + 6, // 24: api.job.v1.JobService.GetProposal:input_type -> api.job.v1.GetProposalRequest + 8, // 25: api.job.v1.JobService.ListJobs:input_type -> api.job.v1.ListJobsRequest + 10, // 26: api.job.v1.JobService.ListProposals:input_type -> api.job.v1.ListProposalsRequest + 12, // 27: api.job.v1.JobService.ProposeJob:input_type -> api.job.v1.ProposeJobRequest + 14, // 28: api.job.v1.JobService.RevokeJob:input_type -> api.job.v1.RevokeJobRequest + 16, // 29: api.job.v1.JobService.DeleteJob:input_type -> api.job.v1.DeleteJobRequest + 18, // 30: api.job.v1.JobService.UpdateJob:input_type -> api.job.v1.UpdateJobRequest + 5, // 31: api.job.v1.JobService.GetJob:output_type -> api.job.v1.GetJobResponse + 7, // 32: api.job.v1.JobService.GetProposal:output_type -> api.job.v1.GetProposalResponse + 9, // 33: api.job.v1.JobService.ListJobs:output_type -> api.job.v1.ListJobsResponse + 11, // 34: api.job.v1.JobService.ListProposals:output_type -> api.job.v1.ListProposalsResponse + 13, // 35: api.job.v1.JobService.ProposeJob:output_type -> api.job.v1.ProposeJobResponse + 15, // 36: api.job.v1.JobService.RevokeJob:output_type -> api.job.v1.RevokeJobResponse + 17, // 37: api.job.v1.JobService.DeleteJob:output_type -> api.job.v1.DeleteJobResponse + 19, // 38: api.job.v1.JobService.UpdateJob:output_type -> api.job.v1.UpdateJobResponse + 31, // [31:39] is the sub-list for method output_type + 23, // [23:31] is the sub-list for method input_type + 23, // [23:23] is the sub-list for extension type_name + 23, // [23:23] is the sub-list for extension extendee + 0, // [0:23] is the sub-list for field type_name +} + +func init() { file_job_v1_job_proto_init() } +func file_job_v1_job_proto_init() { + if File_job_v1_job_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_job_v1_job_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Job); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_job_v1_job_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Proposal); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_job_v1_job_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetJobRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_job_v1_job_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetJobResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_job_v1_job_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetProposalRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_job_v1_job_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetProposalResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_job_v1_job_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListJobsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_job_v1_job_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListJobsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_job_v1_job_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListProposalsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_job_v1_job_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListProposalsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_job_v1_job_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ProposeJobRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_job_v1_job_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ProposeJobResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_job_v1_job_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RevokeJobRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_job_v1_job_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RevokeJobResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_job_v1_job_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteJobRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_job_v1_job_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteJobResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_job_v1_job_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateJobRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_job_v1_job_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateJobResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_job_v1_job_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListJobsRequest_Filter); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_job_v1_job_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListProposalsRequest_Filter); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_job_v1_job_proto_msgTypes[1].OneofWrappers = []interface{}{} + file_job_v1_job_proto_msgTypes[2].OneofWrappers = []interface{}{ + (*GetJobRequest_Id)(nil), + (*GetJobRequest_Uuid)(nil), + } + file_job_v1_job_proto_msgTypes[12].OneofWrappers = []interface{}{ + (*RevokeJobRequest_Id)(nil), + (*RevokeJobRequest_Uuid)(nil), + } + file_job_v1_job_proto_msgTypes[14].OneofWrappers = []interface{}{ + (*DeleteJobRequest_Id)(nil), + (*DeleteJobRequest_Uuid)(nil), + } + file_job_v1_job_proto_msgTypes[16].OneofWrappers = []interface{}{ + (*UpdateJobRequest_Id)(nil), + (*UpdateJobRequest_Uuid)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_job_v1_job_proto_rawDesc, + NumEnums: 2, + NumMessages: 20, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_job_v1_job_proto_goTypes, + DependencyIndexes: file_job_v1_job_proto_depIdxs, + EnumInfos: file_job_v1_job_proto_enumTypes, + MessageInfos: file_job_v1_job_proto_msgTypes, + }.Build() + File_job_v1_job_proto = out.File + file_job_v1_job_proto_rawDesc = nil + file_job_v1_job_proto_goTypes = nil + file_job_v1_job_proto_depIdxs = nil +} \ No newline at end of file diff --git a/integration-tests/deployment/jd/job/v1/job_grpc.pb.go b/integration-tests/deployment/jd/job/v1/job_grpc.pb.go new file mode 100644 index 00000000000..1ac2ca13c99 --- /dev/null +++ b/integration-tests/deployment/jd/job/v1/job_grpc.pb.go @@ -0,0 +1,384 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc v4.25.3 +// source: job/v1/job.proto + +package v1 + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + JobService_GetJob_FullMethodName = "/api.job.v1.JobService/GetJob" + JobService_GetProposal_FullMethodName = "/api.job.v1.JobService/GetProposal" + JobService_ListJobs_FullMethodName = "/api.job.v1.JobService/ListJobs" + JobService_ListProposals_FullMethodName = "/api.job.v1.JobService/ListProposals" + JobService_ProposeJob_FullMethodName = "/api.job.v1.JobService/ProposeJob" + JobService_RevokeJob_FullMethodName = "/api.job.v1.JobService/RevokeJob" + JobService_DeleteJob_FullMethodName = "/api.job.v1.JobService/DeleteJob" + JobService_UpdateJob_FullMethodName = "/api.job.v1.JobService/UpdateJob" +) + +// JobServiceClient is the client API for JobService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type JobServiceClient interface { + // GetJob retrieves the details of a specific job by its ID or UUID. + GetJob(ctx context.Context, in *GetJobRequest, opts ...grpc.CallOption) (*GetJobResponse, error) + // GetProposal retrieves the details of a specific proposal by its ID. + GetProposal(ctx context.Context, in *GetProposalRequest, opts ...grpc.CallOption) (*GetProposalResponse, error) + // ListJobs returns a list of jobs, optionally filtered by IDs or node IDs. + ListJobs(ctx context.Context, in *ListJobsRequest, opts ...grpc.CallOption) (*ListJobsResponse, error) + // ListProposals returns a list of proposals, optionally filtered by proposal or job IDs. + ListProposals(ctx context.Context, in *ListProposalsRequest, opts ...grpc.CallOption) (*ListProposalsResponse, error) + // ProposeJob submits a new job proposal to a node. + ProposeJob(ctx context.Context, in *ProposeJobRequest, opts ...grpc.CallOption) (*ProposeJobResponse, error) + // RevokeJob revokes an existing job proposal. + RevokeJob(ctx context.Context, in *RevokeJobRequest, opts ...grpc.CallOption) (*RevokeJobResponse, error) + // DeleteJob deletes a job from the system. + DeleteJob(ctx context.Context, in *DeleteJobRequest, opts ...grpc.CallOption) (*DeleteJobResponse, error) + // UpdateJob updates a job in the system. + UpdateJob(ctx context.Context, in *UpdateJobRequest, opts ...grpc.CallOption) (*UpdateJobResponse, error) +} + +type jobServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewJobServiceClient(cc grpc.ClientConnInterface) JobServiceClient { + return &jobServiceClient{cc} +} + +func (c *jobServiceClient) GetJob(ctx context.Context, in *GetJobRequest, opts ...grpc.CallOption) (*GetJobResponse, error) { + out := new(GetJobResponse) + err := c.cc.Invoke(ctx, JobService_GetJob_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *jobServiceClient) GetProposal(ctx context.Context, in *GetProposalRequest, opts ...grpc.CallOption) (*GetProposalResponse, error) { + out := new(GetProposalResponse) + err := c.cc.Invoke(ctx, JobService_GetProposal_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *jobServiceClient) ListJobs(ctx context.Context, in *ListJobsRequest, opts ...grpc.CallOption) (*ListJobsResponse, error) { + out := new(ListJobsResponse) + err := c.cc.Invoke(ctx, JobService_ListJobs_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *jobServiceClient) ListProposals(ctx context.Context, in *ListProposalsRequest, opts ...grpc.CallOption) (*ListProposalsResponse, error) { + out := new(ListProposalsResponse) + err := c.cc.Invoke(ctx, JobService_ListProposals_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *jobServiceClient) ProposeJob(ctx context.Context, in *ProposeJobRequest, opts ...grpc.CallOption) (*ProposeJobResponse, error) { + out := new(ProposeJobResponse) + err := c.cc.Invoke(ctx, JobService_ProposeJob_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *jobServiceClient) RevokeJob(ctx context.Context, in *RevokeJobRequest, opts ...grpc.CallOption) (*RevokeJobResponse, error) { + out := new(RevokeJobResponse) + err := c.cc.Invoke(ctx, JobService_RevokeJob_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *jobServiceClient) DeleteJob(ctx context.Context, in *DeleteJobRequest, opts ...grpc.CallOption) (*DeleteJobResponse, error) { + out := new(DeleteJobResponse) + err := c.cc.Invoke(ctx, JobService_DeleteJob_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *jobServiceClient) UpdateJob(ctx context.Context, in *UpdateJobRequest, opts ...grpc.CallOption) (*UpdateJobResponse, error) { + out := new(UpdateJobResponse) + err := c.cc.Invoke(ctx, JobService_UpdateJob_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// JobServiceServer is the server API for JobService service. +// All implementations must embed UnimplementedJobServiceServer +// for forward compatibility +type JobServiceServer interface { + // GetJob retrieves the details of a specific job by its ID or UUID. + GetJob(context.Context, *GetJobRequest) (*GetJobResponse, error) + // GetProposal retrieves the details of a specific proposal by its ID. + GetProposal(context.Context, *GetProposalRequest) (*GetProposalResponse, error) + // ListJobs returns a list of jobs, optionally filtered by IDs or node IDs. + ListJobs(context.Context, *ListJobsRequest) (*ListJobsResponse, error) + // ListProposals returns a list of proposals, optionally filtered by proposal or job IDs. + ListProposals(context.Context, *ListProposalsRequest) (*ListProposalsResponse, error) + // ProposeJob submits a new job proposal to a node. + ProposeJob(context.Context, *ProposeJobRequest) (*ProposeJobResponse, error) + // RevokeJob revokes an existing job proposal. + RevokeJob(context.Context, *RevokeJobRequest) (*RevokeJobResponse, error) + // DeleteJob deletes a job from the system. + DeleteJob(context.Context, *DeleteJobRequest) (*DeleteJobResponse, error) + // UpdateJob updates a job in the system. + UpdateJob(context.Context, *UpdateJobRequest) (*UpdateJobResponse, error) + mustEmbedUnimplementedJobServiceServer() +} + +// UnimplementedJobServiceServer must be embedded to have forward compatible implementations. +type UnimplementedJobServiceServer struct { +} + +func (UnimplementedJobServiceServer) GetJob(context.Context, *GetJobRequest) (*GetJobResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetJob not implemented") +} +func (UnimplementedJobServiceServer) GetProposal(context.Context, *GetProposalRequest) (*GetProposalResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetProposal not implemented") +} +func (UnimplementedJobServiceServer) ListJobs(context.Context, *ListJobsRequest) (*ListJobsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListJobs not implemented") +} +func (UnimplementedJobServiceServer) ListProposals(context.Context, *ListProposalsRequest) (*ListProposalsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListProposals not implemented") +} +func (UnimplementedJobServiceServer) ProposeJob(context.Context, *ProposeJobRequest) (*ProposeJobResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ProposeJob not implemented") +} +func (UnimplementedJobServiceServer) RevokeJob(context.Context, *RevokeJobRequest) (*RevokeJobResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RevokeJob not implemented") +} +func (UnimplementedJobServiceServer) DeleteJob(context.Context, *DeleteJobRequest) (*DeleteJobResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteJob not implemented") +} +func (UnimplementedJobServiceServer) UpdateJob(context.Context, *UpdateJobRequest) (*UpdateJobResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateJob not implemented") +} +func (UnimplementedJobServiceServer) mustEmbedUnimplementedJobServiceServer() {} + +// UnsafeJobServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to JobServiceServer will +// result in compilation errors. +type UnsafeJobServiceServer interface { + mustEmbedUnimplementedJobServiceServer() +} + +func RegisterJobServiceServer(s grpc.ServiceRegistrar, srv JobServiceServer) { + s.RegisterService(&JobService_ServiceDesc, srv) +} + +func _JobService_GetJob_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetJobRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(JobServiceServer).GetJob(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: JobService_GetJob_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(JobServiceServer).GetJob(ctx, req.(*GetJobRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _JobService_GetProposal_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetProposalRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(JobServiceServer).GetProposal(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: JobService_GetProposal_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(JobServiceServer).GetProposal(ctx, req.(*GetProposalRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _JobService_ListJobs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListJobsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(JobServiceServer).ListJobs(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: JobService_ListJobs_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(JobServiceServer).ListJobs(ctx, req.(*ListJobsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _JobService_ListProposals_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListProposalsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(JobServiceServer).ListProposals(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: JobService_ListProposals_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(JobServiceServer).ListProposals(ctx, req.(*ListProposalsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _JobService_ProposeJob_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ProposeJobRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(JobServiceServer).ProposeJob(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: JobService_ProposeJob_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(JobServiceServer).ProposeJob(ctx, req.(*ProposeJobRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _JobService_RevokeJob_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RevokeJobRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(JobServiceServer).RevokeJob(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: JobService_RevokeJob_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(JobServiceServer).RevokeJob(ctx, req.(*RevokeJobRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _JobService_DeleteJob_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteJobRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(JobServiceServer).DeleteJob(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: JobService_DeleteJob_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(JobServiceServer).DeleteJob(ctx, req.(*DeleteJobRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _JobService_UpdateJob_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateJobRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(JobServiceServer).UpdateJob(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: JobService_UpdateJob_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(JobServiceServer).UpdateJob(ctx, req.(*UpdateJobRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// JobService_ServiceDesc is the grpc.ServiceDesc for JobService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var JobService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "api.job.v1.JobService", + HandlerType: (*JobServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetJob", + Handler: _JobService_GetJob_Handler, + }, + { + MethodName: "GetProposal", + Handler: _JobService_GetProposal_Handler, + }, + { + MethodName: "ListJobs", + Handler: _JobService_ListJobs_Handler, + }, + { + MethodName: "ListProposals", + Handler: _JobService_ListProposals_Handler, + }, + { + MethodName: "ProposeJob", + Handler: _JobService_ProposeJob_Handler, + }, + { + MethodName: "RevokeJob", + Handler: _JobService_RevokeJob_Handler, + }, + { + MethodName: "DeleteJob", + Handler: _JobService_DeleteJob_Handler, + }, + { + MethodName: "UpdateJob", + Handler: _JobService_UpdateJob_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "job/v1/job.proto", +} \ No newline at end of file diff --git a/integration-tests/deployment/jd/node/v1/node.pb.go b/integration-tests/deployment/jd/node/v1/node.pb.go new file mode 100644 index 00000000000..172e2856454 --- /dev/null +++ b/integration-tests/deployment/jd/node/v1/node.pb.go @@ -0,0 +1,2492 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.29.0 +// protoc v4.25.3 +// source: node/v1/node.proto + +package v1 + +import ( + ptypes "github.com/smartcontractkit/chainlink/integration-tests/deployment/jd/shared/ptypes" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type ChainType int32 + +const ( + ChainType_CHAIN_TYPE_UNSPECIFIED ChainType = 0 + ChainType_CHAIN_TYPE_EVM ChainType = 1 + ChainType_CHAIN_TYPE_SOLANA ChainType = 2 + ChainType_CHAIN_TYPE_STARKNET ChainType = 3 +) + +// Enum value maps for ChainType. +var ( + ChainType_name = map[int32]string{ + 0: "CHAIN_TYPE_UNSPECIFIED", + 1: "CHAIN_TYPE_EVM", + 2: "CHAIN_TYPE_SOLANA", + 3: "CHAIN_TYPE_STARKNET", + } + ChainType_value = map[string]int32{ + "CHAIN_TYPE_UNSPECIFIED": 0, + "CHAIN_TYPE_EVM": 1, + "CHAIN_TYPE_SOLANA": 2, + "CHAIN_TYPE_STARKNET": 3, + } +) + +func (x ChainType) Enum() *ChainType { + p := new(ChainType) + *p = x + return p +} + +func (x ChainType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ChainType) Descriptor() protoreflect.EnumDescriptor { + return file_node_v1_node_proto_enumTypes[0].Descriptor() +} + +func (ChainType) Type() protoreflect.EnumType { + return &file_node_v1_node_proto_enumTypes[0] +} + +func (x ChainType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ChainType.Descriptor instead. +func (ChainType) EnumDescriptor() ([]byte, []int) { + return file_node_v1_node_proto_rawDescGZIP(), []int{0} +} + +// EnableState represents the enabled state of the node. +type EnableState int32 + +const ( + EnableState_ENABLE_STATE_UNSPECIFIED EnableState = 0 + EnableState_ENABLE_STATE_ENABLED EnableState = 1 + EnableState_ENABLE_STATE_DISABLED EnableState = 2 +) + +// Enum value maps for EnableState. +var ( + EnableState_name = map[int32]string{ + 0: "ENABLE_STATE_UNSPECIFIED", + 1: "ENABLE_STATE_ENABLED", + 2: "ENABLE_STATE_DISABLED", + } + EnableState_value = map[string]int32{ + "ENABLE_STATE_UNSPECIFIED": 0, + "ENABLE_STATE_ENABLED": 1, + "ENABLE_STATE_DISABLED": 2, + } +) + +func (x EnableState) Enum() *EnableState { + p := new(EnableState) + *p = x + return p +} + +func (x EnableState) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (EnableState) Descriptor() protoreflect.EnumDescriptor { + return file_node_v1_node_proto_enumTypes[1].Descriptor() +} + +func (EnableState) Type() protoreflect.EnumType { + return &file_node_v1_node_proto_enumTypes[1] +} + +func (x EnableState) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use EnableState.Descriptor instead. +func (EnableState) EnumDescriptor() ([]byte, []int) { + return file_node_v1_node_proto_rawDescGZIP(), []int{1} +} + +// Node represents a node within the Job Distributor system. +type Node struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // Unique identifier for the node. + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` // Human-readable name for the node. + PublicKey string `protobuf:"bytes,3,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` // Public key used for secure communications. + IsEnabled bool `protobuf:"varint,4,opt,name=is_enabled,json=isEnabled,proto3" json:"is_enabled,omitempty"` // Indicates if the node is currently enabled. + IsConnected bool `protobuf:"varint,5,opt,name=is_connected,json=isConnected,proto3" json:"is_connected,omitempty"` // Indicates if the node is currently connected to the network. + Labels []*ptypes.Label `protobuf:"bytes,6,rep,name=labels,proto3" json:"labels,omitempty"` // Set of labels associated with the node. + CreatedAt *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` // Timestamp when the node was created. + UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,8,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` // Timestamp when the node was last updated. +} + +func (x *Node) Reset() { + *x = Node{} + if protoimpl.UnsafeEnabled { + mi := &file_node_v1_node_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Node) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Node) ProtoMessage() {} + +func (x *Node) ProtoReflect() protoreflect.Message { + mi := &file_node_v1_node_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Node.ProtoReflect.Descriptor instead. +func (*Node) Descriptor() ([]byte, []int) { + return file_node_v1_node_proto_rawDescGZIP(), []int{0} +} + +func (x *Node) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *Node) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Node) GetPublicKey() string { + if x != nil { + return x.PublicKey + } + return "" +} + +func (x *Node) GetIsEnabled() bool { + if x != nil { + return x.IsEnabled + } + return false +} + +func (x *Node) GetIsConnected() bool { + if x != nil { + return x.IsConnected + } + return false +} + +func (x *Node) GetLabels() []*ptypes.Label { + if x != nil { + return x.Labels + } + return nil +} + +func (x *Node) GetCreatedAt() *timestamppb.Timestamp { + if x != nil { + return x.CreatedAt + } + return nil +} + +func (x *Node) GetUpdatedAt() *timestamppb.Timestamp { + if x != nil { + return x.UpdatedAt + } + return nil +} + +type Chain struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Type ChainType `protobuf:"varint,2,opt,name=type,proto3,enum=api.node.v1.ChainType" json:"type,omitempty"` +} + +func (x *Chain) Reset() { + *x = Chain{} + if protoimpl.UnsafeEnabled { + mi := &file_node_v1_node_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Chain) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Chain) ProtoMessage() {} + +func (x *Chain) ProtoReflect() protoreflect.Message { + mi := &file_node_v1_node_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Chain.ProtoReflect.Descriptor instead. +func (*Chain) Descriptor() ([]byte, []int) { + return file_node_v1_node_proto_rawDescGZIP(), []int{1} +} + +func (x *Chain) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *Chain) GetType() ChainType { + if x != nil { + return x.Type + } + return ChainType_CHAIN_TYPE_UNSPECIFIED +} + +// The config for Flux Monitor on a specific chain +type FluxMonitorConfig struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Enabled bool `protobuf:"varint,1,opt,name=enabled,proto3" json:"enabled,omitempty"` +} + +func (x *FluxMonitorConfig) Reset() { + *x = FluxMonitorConfig{} + if protoimpl.UnsafeEnabled { + mi := &file_node_v1_node_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FluxMonitorConfig) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FluxMonitorConfig) ProtoMessage() {} + +func (x *FluxMonitorConfig) ProtoReflect() protoreflect.Message { + mi := &file_node_v1_node_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FluxMonitorConfig.ProtoReflect.Descriptor instead. +func (*FluxMonitorConfig) Descriptor() ([]byte, []int) { + return file_node_v1_node_proto_rawDescGZIP(), []int{2} +} + +func (x *FluxMonitorConfig) GetEnabled() bool { + if x != nil { + return x.Enabled + } + return false +} + +// The config for OCR1 on a specific chain +type OCR1Config struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Enabled bool `protobuf:"varint,1,opt,name=enabled,proto3" json:"enabled,omitempty"` + IsBootstrap bool `protobuf:"varint,2,opt,name=is_bootstrap,json=isBootstrap,proto3" json:"is_bootstrap,omitempty"` + P2PKeyBundle *OCR1Config_P2PKeyBundle `protobuf:"bytes,3,opt,name=p2p_key_bundle,json=p2pKeyBundle,proto3" json:"p2p_key_bundle,omitempty"` + OcrKeyBundle *OCR1Config_OCRKeyBundle `protobuf:"bytes,4,opt,name=ocr_key_bundle,json=ocrKeyBundle,proto3" json:"ocr_key_bundle,omitempty"` + Multiaddr string `protobuf:"bytes,5,opt,name=multiaddr,proto3" json:"multiaddr,omitempty"` +} + +func (x *OCR1Config) Reset() { + *x = OCR1Config{} + if protoimpl.UnsafeEnabled { + mi := &file_node_v1_node_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *OCR1Config) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OCR1Config) ProtoMessage() {} + +func (x *OCR1Config) ProtoReflect() protoreflect.Message { + mi := &file_node_v1_node_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use OCR1Config.ProtoReflect.Descriptor instead. +func (*OCR1Config) Descriptor() ([]byte, []int) { + return file_node_v1_node_proto_rawDescGZIP(), []int{3} +} + +func (x *OCR1Config) GetEnabled() bool { + if x != nil { + return x.Enabled + } + return false +} + +func (x *OCR1Config) GetIsBootstrap() bool { + if x != nil { + return x.IsBootstrap + } + return false +} + +func (x *OCR1Config) GetP2PKeyBundle() *OCR1Config_P2PKeyBundle { + if x != nil { + return x.P2PKeyBundle + } + return nil +} + +func (x *OCR1Config) GetOcrKeyBundle() *OCR1Config_OCRKeyBundle { + if x != nil { + return x.OcrKeyBundle + } + return nil +} + +func (x *OCR1Config) GetMultiaddr() string { + if x != nil { + return x.Multiaddr + } + return "" +} + +// The config for OCR2 on a specific chain +type OCR2Config struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Enabled bool `protobuf:"varint,1,opt,name=enabled,proto3" json:"enabled,omitempty"` + IsBootstrap bool `protobuf:"varint,2,opt,name=is_bootstrap,json=isBootstrap,proto3" json:"is_bootstrap,omitempty"` + P2PKeyBundle *OCR2Config_P2PKeyBundle `protobuf:"bytes,3,opt,name=p2p_key_bundle,json=p2pKeyBundle,proto3" json:"p2p_key_bundle,omitempty"` + OcrKeyBundle *OCR2Config_OCRKeyBundle `protobuf:"bytes,4,opt,name=ocr_key_bundle,json=ocrKeyBundle,proto3" json:"ocr_key_bundle,omitempty"` + Multiaddr string `protobuf:"bytes,5,opt,name=multiaddr,proto3" json:"multiaddr,omitempty"` + Plugins *OCR2Config_Plugins `protobuf:"bytes,6,opt,name=plugins,proto3" json:"plugins,omitempty"` + ForwarderAddress *string `protobuf:"bytes,7,opt,name=forwarder_address,json=forwarderAddress,proto3,oneof" json:"forwarder_address,omitempty"` +} + +func (x *OCR2Config) Reset() { + *x = OCR2Config{} + if protoimpl.UnsafeEnabled { + mi := &file_node_v1_node_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *OCR2Config) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OCR2Config) ProtoMessage() {} + +func (x *OCR2Config) ProtoReflect() protoreflect.Message { + mi := &file_node_v1_node_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use OCR2Config.ProtoReflect.Descriptor instead. +func (*OCR2Config) Descriptor() ([]byte, []int) { + return file_node_v1_node_proto_rawDescGZIP(), []int{4} +} + +func (x *OCR2Config) GetEnabled() bool { + if x != nil { + return x.Enabled + } + return false +} + +func (x *OCR2Config) GetIsBootstrap() bool { + if x != nil { + return x.IsBootstrap + } + return false +} + +func (x *OCR2Config) GetP2PKeyBundle() *OCR2Config_P2PKeyBundle { + if x != nil { + return x.P2PKeyBundle + } + return nil +} + +func (x *OCR2Config) GetOcrKeyBundle() *OCR2Config_OCRKeyBundle { + if x != nil { + return x.OcrKeyBundle + } + return nil +} + +func (x *OCR2Config) GetMultiaddr() string { + if x != nil { + return x.Multiaddr + } + return "" +} + +func (x *OCR2Config) GetPlugins() *OCR2Config_Plugins { + if x != nil { + return x.Plugins + } + return nil +} + +func (x *OCR2Config) GetForwarderAddress() string { + if x != nil && x.ForwarderAddress != nil { + return *x.ForwarderAddress + } + return "" +} + +type ChainConfig struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Chain *Chain `protobuf:"bytes,1,opt,name=chain,proto3" json:"chain,omitempty"` + AccountAddress string `protobuf:"bytes,2,opt,name=account_address,json=accountAddress,proto3" json:"account_address,omitempty"` + AdminAddress string `protobuf:"bytes,3,opt,name=admin_address,json=adminAddress,proto3" json:"admin_address,omitempty"` + FluxMonitorConfig *FluxMonitorConfig `protobuf:"bytes,4,opt,name=flux_monitor_config,json=fluxMonitorConfig,proto3" json:"flux_monitor_config,omitempty"` + Ocr1Config *OCR1Config `protobuf:"bytes,5,opt,name=ocr1_config,json=ocr1Config,proto3" json:"ocr1_config,omitempty"` + Ocr2Config *OCR2Config `protobuf:"bytes,6,opt,name=ocr2_config,json=ocr2Config,proto3" json:"ocr2_config,omitempty"` + // For EVM chains, we do not need this value and it is kept in the node's + // keystore. For starknet, because the wallet address needs to be deployed + // using this value and this pub key needs to be passed into the starknet + // relayer, we request the node to send this directly to CLO. + AccountAddressPublicKey *string `protobuf:"bytes,7,opt,name=account_address_public_key,json=accountAddressPublicKey,proto3,oneof" json:"account_address_public_key,omitempty"` +} + +func (x *ChainConfig) Reset() { + *x = ChainConfig{} + if protoimpl.UnsafeEnabled { + mi := &file_node_v1_node_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChainConfig) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChainConfig) ProtoMessage() {} + +func (x *ChainConfig) ProtoReflect() protoreflect.Message { + mi := &file_node_v1_node_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ChainConfig.ProtoReflect.Descriptor instead. +func (*ChainConfig) Descriptor() ([]byte, []int) { + return file_node_v1_node_proto_rawDescGZIP(), []int{5} +} + +func (x *ChainConfig) GetChain() *Chain { + if x != nil { + return x.Chain + } + return nil +} + +func (x *ChainConfig) GetAccountAddress() string { + if x != nil { + return x.AccountAddress + } + return "" +} + +func (x *ChainConfig) GetAdminAddress() string { + if x != nil { + return x.AdminAddress + } + return "" +} + +func (x *ChainConfig) GetFluxMonitorConfig() *FluxMonitorConfig { + if x != nil { + return x.FluxMonitorConfig + } + return nil +} + +func (x *ChainConfig) GetOcr1Config() *OCR1Config { + if x != nil { + return x.Ocr1Config + } + return nil +} + +func (x *ChainConfig) GetOcr2Config() *OCR2Config { + if x != nil { + return x.Ocr2Config + } + return nil +} + +func (x *ChainConfig) GetAccountAddressPublicKey() string { + if x != nil && x.AccountAddressPublicKey != nil { + return *x.AccountAddressPublicKey + } + return "" +} + +// RegisterNodeRequest contains the information needed to register a new node. +type RegisterNodeRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // Desired name for the node. + PublicKey string `protobuf:"bytes,2,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` // Public key for the node. + Labels []*ptypes.Label `protobuf:"bytes,3,rep,name=labels,proto3" json:"labels,omitempty"` // Labels to associate with the node. +} + +func (x *RegisterNodeRequest) Reset() { + *x = RegisterNodeRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_node_v1_node_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RegisterNodeRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RegisterNodeRequest) ProtoMessage() {} + +func (x *RegisterNodeRequest) ProtoReflect() protoreflect.Message { + mi := &file_node_v1_node_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RegisterNodeRequest.ProtoReflect.Descriptor instead. +func (*RegisterNodeRequest) Descriptor() ([]byte, []int) { + return file_node_v1_node_proto_rawDescGZIP(), []int{6} +} + +func (x *RegisterNodeRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *RegisterNodeRequest) GetPublicKey() string { + if x != nil { + return x.PublicKey + } + return "" +} + +func (x *RegisterNodeRequest) GetLabels() []*ptypes.Label { + if x != nil { + return x.Labels + } + return nil +} + +// RegisterNodeResponse returns the newly registered node. +type RegisterNodeResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Node *Node `protobuf:"bytes,1,opt,name=node,proto3" json:"node,omitempty"` // Details of the newly registered node. +} + +func (x *RegisterNodeResponse) Reset() { + *x = RegisterNodeResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_node_v1_node_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RegisterNodeResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RegisterNodeResponse) ProtoMessage() {} + +func (x *RegisterNodeResponse) ProtoReflect() protoreflect.Message { + mi := &file_node_v1_node_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RegisterNodeResponse.ProtoReflect.Descriptor instead. +func (*RegisterNodeResponse) Descriptor() ([]byte, []int) { + return file_node_v1_node_proto_rawDescGZIP(), []int{7} +} + +func (x *RegisterNodeResponse) GetNode() *Node { + if x != nil { + return x.Node + } + return nil +} + +// GetNodeRequest is the request to retrieve a single node by its ID. +type GetNodeRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // Unique identifier of the node to retrieve. +} + +func (x *GetNodeRequest) Reset() { + *x = GetNodeRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_node_v1_node_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetNodeRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetNodeRequest) ProtoMessage() {} + +func (x *GetNodeRequest) ProtoReflect() protoreflect.Message { + mi := &file_node_v1_node_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetNodeRequest.ProtoReflect.Descriptor instead. +func (*GetNodeRequest) Descriptor() ([]byte, []int) { + return file_node_v1_node_proto_rawDescGZIP(), []int{8} +} + +func (x *GetNodeRequest) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +// GetNodeResponse is the response containing the requested node. +type GetNodeResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Node *Node `protobuf:"bytes,1,opt,name=node,proto3" json:"node,omitempty"` // Details of the retrieved node. +} + +func (x *GetNodeResponse) Reset() { + *x = GetNodeResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_node_v1_node_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetNodeResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetNodeResponse) ProtoMessage() {} + +func (x *GetNodeResponse) ProtoReflect() protoreflect.Message { + mi := &file_node_v1_node_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetNodeResponse.ProtoReflect.Descriptor instead. +func (*GetNodeResponse) Descriptor() ([]byte, []int) { + return file_node_v1_node_proto_rawDescGZIP(), []int{9} +} + +func (x *GetNodeResponse) GetNode() *Node { + if x != nil { + return x.Node + } + return nil +} + +// * +// ListNodesRequest is the request object for the ListNodes method. +// +// Provide a filter to return a subset of data. Nodes can be filtered by: +// - ids - A list of node ids. +// - archived - The archived state of the node. +// - selectors - A list of selectors to filter nodes by their labels. +// +// If no filter is provided, all nodes are returned. +type ListNodesRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Filter *ListNodesRequest_Filter `protobuf:"bytes,1,opt,name=filter,proto3" json:"filter,omitempty"` +} + +func (x *ListNodesRequest) Reset() { + *x = ListNodesRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_node_v1_node_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListNodesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListNodesRequest) ProtoMessage() {} + +func (x *ListNodesRequest) ProtoReflect() protoreflect.Message { + mi := &file_node_v1_node_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListNodesRequest.ProtoReflect.Descriptor instead. +func (*ListNodesRequest) Descriptor() ([]byte, []int) { + return file_node_v1_node_proto_rawDescGZIP(), []int{10} +} + +func (x *ListNodesRequest) GetFilter() *ListNodesRequest_Filter { + if x != nil { + return x.Filter + } + return nil +} + +// * +// ListNodesResponse is the response object for the ListNodes method. +// +// It returns a list of nodes that match the filter criteria. +type ListNodesResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Nodes []*Node `protobuf:"bytes,1,rep,name=nodes,proto3" json:"nodes,omitempty"` // List of nodes. +} + +func (x *ListNodesResponse) Reset() { + *x = ListNodesResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_node_v1_node_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListNodesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListNodesResponse) ProtoMessage() {} + +func (x *ListNodesResponse) ProtoReflect() protoreflect.Message { + mi := &file_node_v1_node_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListNodesResponse.ProtoReflect.Descriptor instead. +func (*ListNodesResponse) Descriptor() ([]byte, []int) { + return file_node_v1_node_proto_rawDescGZIP(), []int{11} +} + +func (x *ListNodesResponse) GetNodes() []*Node { + if x != nil { + return x.Nodes + } + return nil +} + +// UpdateNodeRequest contains the information necessary to update a node. +type UpdateNodeRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // Unique identifier of the node to update. + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` // New name for the node, if changing. + PublicKey string `protobuf:"bytes,3,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` // New public key for the node, if changing. + Labels []*ptypes.Label `protobuf:"bytes,4,rep,name=labels,proto3" json:"labels,omitempty"` // New set of labels for the node, if changing. +} + +func (x *UpdateNodeRequest) Reset() { + *x = UpdateNodeRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_node_v1_node_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateNodeRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateNodeRequest) ProtoMessage() {} + +func (x *UpdateNodeRequest) ProtoReflect() protoreflect.Message { + mi := &file_node_v1_node_proto_msgTypes[12] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateNodeRequest.ProtoReflect.Descriptor instead. +func (*UpdateNodeRequest) Descriptor() ([]byte, []int) { + return file_node_v1_node_proto_rawDescGZIP(), []int{12} +} + +func (x *UpdateNodeRequest) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *UpdateNodeRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *UpdateNodeRequest) GetPublicKey() string { + if x != nil { + return x.PublicKey + } + return "" +} + +func (x *UpdateNodeRequest) GetLabels() []*ptypes.Label { + if x != nil { + return x.Labels + } + return nil +} + +// UpdateNodeResponse returns the updated node. +type UpdateNodeResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Node *Node `protobuf:"bytes,1,opt,name=node,proto3" json:"node,omitempty"` // Updated node details. +} + +func (x *UpdateNodeResponse) Reset() { + *x = UpdateNodeResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_node_v1_node_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateNodeResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateNodeResponse) ProtoMessage() {} + +func (x *UpdateNodeResponse) ProtoReflect() protoreflect.Message { + mi := &file_node_v1_node_proto_msgTypes[13] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateNodeResponse.ProtoReflect.Descriptor instead. +func (*UpdateNodeResponse) Descriptor() ([]byte, []int) { + return file_node_v1_node_proto_rawDescGZIP(), []int{13} +} + +func (x *UpdateNodeResponse) GetNode() *Node { + if x != nil { + return x.Node + } + return nil +} + +// DisableNodeRequest is used to mark a node as disabled. +type DisableNodeRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // Unique identifier of the node to disable. +} + +func (x *DisableNodeRequest) Reset() { + *x = DisableNodeRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_node_v1_node_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DisableNodeRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DisableNodeRequest) ProtoMessage() {} + +func (x *DisableNodeRequest) ProtoReflect() protoreflect.Message { + mi := &file_node_v1_node_proto_msgTypes[14] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DisableNodeRequest.ProtoReflect.Descriptor instead. +func (*DisableNodeRequest) Descriptor() ([]byte, []int) { + return file_node_v1_node_proto_rawDescGZIP(), []int{14} +} + +func (x *DisableNodeRequest) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +// DisableNodeResponse returns the disabled node. +type DisableNodeResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Node *Node `protobuf:"bytes,1,opt,name=node,proto3" json:"node,omitempty"` // Disabled node details. +} + +func (x *DisableNodeResponse) Reset() { + *x = DisableNodeResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_node_v1_node_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DisableNodeResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DisableNodeResponse) ProtoMessage() {} + +func (x *DisableNodeResponse) ProtoReflect() protoreflect.Message { + mi := &file_node_v1_node_proto_msgTypes[15] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DisableNodeResponse.ProtoReflect.Descriptor instead. +func (*DisableNodeResponse) Descriptor() ([]byte, []int) { + return file_node_v1_node_proto_rawDescGZIP(), []int{15} +} + +func (x *DisableNodeResponse) GetNode() *Node { + if x != nil { + return x.Node + } + return nil +} + +// EnableNodeRequest is used to reactivate a disabled node. +type EnableNodeRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // Unique identifier of the node to enable. +} + +func (x *EnableNodeRequest) Reset() { + *x = EnableNodeRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_node_v1_node_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EnableNodeRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EnableNodeRequest) ProtoMessage() {} + +func (x *EnableNodeRequest) ProtoReflect() protoreflect.Message { + mi := &file_node_v1_node_proto_msgTypes[16] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EnableNodeRequest.ProtoReflect.Descriptor instead. +func (*EnableNodeRequest) Descriptor() ([]byte, []int) { + return file_node_v1_node_proto_rawDescGZIP(), []int{16} +} + +func (x *EnableNodeRequest) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +// EnableNodeResponse returns the enabled node. +type EnableNodeResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Node *Node `protobuf:"bytes,1,opt,name=node,proto3" json:"node,omitempty"` // Enabled node details. +} + +func (x *EnableNodeResponse) Reset() { + *x = EnableNodeResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_node_v1_node_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EnableNodeResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EnableNodeResponse) ProtoMessage() {} + +func (x *EnableNodeResponse) ProtoReflect() protoreflect.Message { + mi := &file_node_v1_node_proto_msgTypes[17] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EnableNodeResponse.ProtoReflect.Descriptor instead. +func (*EnableNodeResponse) Descriptor() ([]byte, []int) { + return file_node_v1_node_proto_rawDescGZIP(), []int{17} +} + +func (x *EnableNodeResponse) GetNode() *Node { + if x != nil { + return x.Node + } + return nil +} + +type ListNodeChainConfigsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Filter *ListNodeChainConfigsRequest_Filter `protobuf:"bytes,1,opt,name=filter,proto3" json:"filter,omitempty"` +} + +func (x *ListNodeChainConfigsRequest) Reset() { + *x = ListNodeChainConfigsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_node_v1_node_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListNodeChainConfigsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListNodeChainConfigsRequest) ProtoMessage() {} + +func (x *ListNodeChainConfigsRequest) ProtoReflect() protoreflect.Message { + mi := &file_node_v1_node_proto_msgTypes[18] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListNodeChainConfigsRequest.ProtoReflect.Descriptor instead. +func (*ListNodeChainConfigsRequest) Descriptor() ([]byte, []int) { + return file_node_v1_node_proto_rawDescGZIP(), []int{18} +} + +func (x *ListNodeChainConfigsRequest) GetFilter() *ListNodeChainConfigsRequest_Filter { + if x != nil { + return x.Filter + } + return nil +} + +type ListNodeChainConfigsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ChainConfigs []*ChainConfig `protobuf:"bytes,1,rep,name=chain_configs,json=chainConfigs,proto3" json:"chain_configs,omitempty"` +} + +func (x *ListNodeChainConfigsResponse) Reset() { + *x = ListNodeChainConfigsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_node_v1_node_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListNodeChainConfigsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListNodeChainConfigsResponse) ProtoMessage() {} + +func (x *ListNodeChainConfigsResponse) ProtoReflect() protoreflect.Message { + mi := &file_node_v1_node_proto_msgTypes[19] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListNodeChainConfigsResponse.ProtoReflect.Descriptor instead. +func (*ListNodeChainConfigsResponse) Descriptor() ([]byte, []int) { + return file_node_v1_node_proto_rawDescGZIP(), []int{19} +} + +func (x *ListNodeChainConfigsResponse) GetChainConfigs() []*ChainConfig { + if x != nil { + return x.ChainConfigs + } + return nil +} + +type OCR1Config_P2PKeyBundle struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PeerId string `protobuf:"bytes,1,opt,name=peer_id,json=peerId,proto3" json:"peer_id,omitempty"` + PublicKey string `protobuf:"bytes,2,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` +} + +func (x *OCR1Config_P2PKeyBundle) Reset() { + *x = OCR1Config_P2PKeyBundle{} + if protoimpl.UnsafeEnabled { + mi := &file_node_v1_node_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *OCR1Config_P2PKeyBundle) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OCR1Config_P2PKeyBundle) ProtoMessage() {} + +func (x *OCR1Config_P2PKeyBundle) ProtoReflect() protoreflect.Message { + mi := &file_node_v1_node_proto_msgTypes[20] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use OCR1Config_P2PKeyBundle.ProtoReflect.Descriptor instead. +func (*OCR1Config_P2PKeyBundle) Descriptor() ([]byte, []int) { + return file_node_v1_node_proto_rawDescGZIP(), []int{3, 0} +} + +func (x *OCR1Config_P2PKeyBundle) GetPeerId() string { + if x != nil { + return x.PeerId + } + return "" +} + +func (x *OCR1Config_P2PKeyBundle) GetPublicKey() string { + if x != nil { + return x.PublicKey + } + return "" +} + +type OCR1Config_OCRKeyBundle struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + BundleId string `protobuf:"bytes,1,opt,name=bundle_id,json=bundleId,proto3" json:"bundle_id,omitempty"` + ConfigPublicKey string `protobuf:"bytes,2,opt,name=config_public_key,json=configPublicKey,proto3" json:"config_public_key,omitempty"` + OffchainPublicKey string `protobuf:"bytes,3,opt,name=offchain_public_key,json=offchainPublicKey,proto3" json:"offchain_public_key,omitempty"` + OnchainSigningAddress string `protobuf:"bytes,4,opt,name=onchain_signing_address,json=onchainSigningAddress,proto3" json:"onchain_signing_address,omitempty"` +} + +func (x *OCR1Config_OCRKeyBundle) Reset() { + *x = OCR1Config_OCRKeyBundle{} + if protoimpl.UnsafeEnabled { + mi := &file_node_v1_node_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *OCR1Config_OCRKeyBundle) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OCR1Config_OCRKeyBundle) ProtoMessage() {} + +func (x *OCR1Config_OCRKeyBundle) ProtoReflect() protoreflect.Message { + mi := &file_node_v1_node_proto_msgTypes[21] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use OCR1Config_OCRKeyBundle.ProtoReflect.Descriptor instead. +func (*OCR1Config_OCRKeyBundle) Descriptor() ([]byte, []int) { + return file_node_v1_node_proto_rawDescGZIP(), []int{3, 1} +} + +func (x *OCR1Config_OCRKeyBundle) GetBundleId() string { + if x != nil { + return x.BundleId + } + return "" +} + +func (x *OCR1Config_OCRKeyBundle) GetConfigPublicKey() string { + if x != nil { + return x.ConfigPublicKey + } + return "" +} + +func (x *OCR1Config_OCRKeyBundle) GetOffchainPublicKey() string { + if x != nil { + return x.OffchainPublicKey + } + return "" +} + +func (x *OCR1Config_OCRKeyBundle) GetOnchainSigningAddress() string { + if x != nil { + return x.OnchainSigningAddress + } + return "" +} + +type OCR2Config_P2PKeyBundle struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PeerId string `protobuf:"bytes,1,opt,name=peer_id,json=peerId,proto3" json:"peer_id,omitempty"` + PublicKey string `protobuf:"bytes,2,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` +} + +func (x *OCR2Config_P2PKeyBundle) Reset() { + *x = OCR2Config_P2PKeyBundle{} + if protoimpl.UnsafeEnabled { + mi := &file_node_v1_node_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *OCR2Config_P2PKeyBundle) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OCR2Config_P2PKeyBundle) ProtoMessage() {} + +func (x *OCR2Config_P2PKeyBundle) ProtoReflect() protoreflect.Message { + mi := &file_node_v1_node_proto_msgTypes[22] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use OCR2Config_P2PKeyBundle.ProtoReflect.Descriptor instead. +func (*OCR2Config_P2PKeyBundle) Descriptor() ([]byte, []int) { + return file_node_v1_node_proto_rawDescGZIP(), []int{4, 0} +} + +func (x *OCR2Config_P2PKeyBundle) GetPeerId() string { + if x != nil { + return x.PeerId + } + return "" +} + +func (x *OCR2Config_P2PKeyBundle) GetPublicKey() string { + if x != nil { + return x.PublicKey + } + return "" +} + +type OCR2Config_OCRKeyBundle struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + BundleId string `protobuf:"bytes,1,opt,name=bundle_id,json=bundleId,proto3" json:"bundle_id,omitempty"` + ConfigPublicKey string `protobuf:"bytes,2,opt,name=config_public_key,json=configPublicKey,proto3" json:"config_public_key,omitempty"` + OffchainPublicKey string `protobuf:"bytes,3,opt,name=offchain_public_key,json=offchainPublicKey,proto3" json:"offchain_public_key,omitempty"` + OnchainSigningAddress string `protobuf:"bytes,4,opt,name=onchain_signing_address,json=onchainSigningAddress,proto3" json:"onchain_signing_address,omitempty"` +} + +func (x *OCR2Config_OCRKeyBundle) Reset() { + *x = OCR2Config_OCRKeyBundle{} + if protoimpl.UnsafeEnabled { + mi := &file_node_v1_node_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *OCR2Config_OCRKeyBundle) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OCR2Config_OCRKeyBundle) ProtoMessage() {} + +func (x *OCR2Config_OCRKeyBundle) ProtoReflect() protoreflect.Message { + mi := &file_node_v1_node_proto_msgTypes[23] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use OCR2Config_OCRKeyBundle.ProtoReflect.Descriptor instead. +func (*OCR2Config_OCRKeyBundle) Descriptor() ([]byte, []int) { + return file_node_v1_node_proto_rawDescGZIP(), []int{4, 1} +} + +func (x *OCR2Config_OCRKeyBundle) GetBundleId() string { + if x != nil { + return x.BundleId + } + return "" +} + +func (x *OCR2Config_OCRKeyBundle) GetConfigPublicKey() string { + if x != nil { + return x.ConfigPublicKey + } + return "" +} + +func (x *OCR2Config_OCRKeyBundle) GetOffchainPublicKey() string { + if x != nil { + return x.OffchainPublicKey + } + return "" +} + +func (x *OCR2Config_OCRKeyBundle) GetOnchainSigningAddress() string { + if x != nil { + return x.OnchainSigningAddress + } + return "" +} + +type OCR2Config_Plugins struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Commit bool `protobuf:"varint,1,opt,name=commit,proto3" json:"commit,omitempty"` + Execute bool `protobuf:"varint,2,opt,name=execute,proto3" json:"execute,omitempty"` + Median bool `protobuf:"varint,3,opt,name=median,proto3" json:"median,omitempty"` + Mercury bool `protobuf:"varint,4,opt,name=mercury,proto3" json:"mercury,omitempty"` + Rebalancer bool `protobuf:"varint,5,opt,name=rebalancer,proto3" json:"rebalancer,omitempty"` +} + +func (x *OCR2Config_Plugins) Reset() { + *x = OCR2Config_Plugins{} + if protoimpl.UnsafeEnabled { + mi := &file_node_v1_node_proto_msgTypes[24] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *OCR2Config_Plugins) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OCR2Config_Plugins) ProtoMessage() {} + +func (x *OCR2Config_Plugins) ProtoReflect() protoreflect.Message { + mi := &file_node_v1_node_proto_msgTypes[24] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use OCR2Config_Plugins.ProtoReflect.Descriptor instead. +func (*OCR2Config_Plugins) Descriptor() ([]byte, []int) { + return file_node_v1_node_proto_rawDescGZIP(), []int{4, 2} +} + +func (x *OCR2Config_Plugins) GetCommit() bool { + if x != nil { + return x.Commit + } + return false +} + +func (x *OCR2Config_Plugins) GetExecute() bool { + if x != nil { + return x.Execute + } + return false +} + +func (x *OCR2Config_Plugins) GetMedian() bool { + if x != nil { + return x.Median + } + return false +} + +func (x *OCR2Config_Plugins) GetMercury() bool { + if x != nil { + return x.Mercury + } + return false +} + +func (x *OCR2Config_Plugins) GetRebalancer() bool { + if x != nil { + return x.Rebalancer + } + return false +} + +type ListNodesRequest_Filter struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Ids []string `protobuf:"bytes,1,rep,name=ids,proto3" json:"ids,omitempty"` + Enabled EnableState `protobuf:"varint,2,opt,name=enabled,proto3,enum=api.node.v1.EnableState" json:"enabled,omitempty"` + Selectors []*ptypes.Selector `protobuf:"bytes,3,rep,name=selectors,proto3" json:"selectors,omitempty"` +} + +func (x *ListNodesRequest_Filter) Reset() { + *x = ListNodesRequest_Filter{} + if protoimpl.UnsafeEnabled { + mi := &file_node_v1_node_proto_msgTypes[25] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListNodesRequest_Filter) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListNodesRequest_Filter) ProtoMessage() {} + +func (x *ListNodesRequest_Filter) ProtoReflect() protoreflect.Message { + mi := &file_node_v1_node_proto_msgTypes[25] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListNodesRequest_Filter.ProtoReflect.Descriptor instead. +func (*ListNodesRequest_Filter) Descriptor() ([]byte, []int) { + return file_node_v1_node_proto_rawDescGZIP(), []int{10, 0} +} + +func (x *ListNodesRequest_Filter) GetIds() []string { + if x != nil { + return x.Ids + } + return nil +} + +func (x *ListNodesRequest_Filter) GetEnabled() EnableState { + if x != nil { + return x.Enabled + } + return EnableState_ENABLE_STATE_UNSPECIFIED +} + +func (x *ListNodesRequest_Filter) GetSelectors() []*ptypes.Selector { + if x != nil { + return x.Selectors + } + return nil +} + +type ListNodeChainConfigsRequest_Filter struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + NodeIds []string `protobuf:"bytes,1,rep,name=node_ids,json=nodeIds,proto3" json:"node_ids,omitempty"` +} + +func (x *ListNodeChainConfigsRequest_Filter) Reset() { + *x = ListNodeChainConfigsRequest_Filter{} + if protoimpl.UnsafeEnabled { + mi := &file_node_v1_node_proto_msgTypes[26] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListNodeChainConfigsRequest_Filter) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListNodeChainConfigsRequest_Filter) ProtoMessage() {} + +func (x *ListNodeChainConfigsRequest_Filter) ProtoReflect() protoreflect.Message { + mi := &file_node_v1_node_proto_msgTypes[26] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListNodeChainConfigsRequest_Filter.ProtoReflect.Descriptor instead. +func (*ListNodeChainConfigsRequest_Filter) Descriptor() ([]byte, []int) { + return file_node_v1_node_proto_rawDescGZIP(), []int{18, 0} +} + +func (x *ListNodeChainConfigsRequest_Filter) GetNodeIds() []string { + if x != nil { + return x.NodeIds + } + return nil +} + +var File_node_v1_node_proto protoreflect.FileDescriptor + +var file_node_v1_node_proto_rawDesc = []byte{ + 0x0a, 0x12, 0x6e, 0x6f, 0x64, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0b, 0x61, 0x70, 0x69, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x76, + 0x31, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x1a, 0x19, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2f, 0x70, 0x74, 0x79, 0x70, 0x65, + 0x73, 0x2f, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xab, 0x02, + 0x0a, 0x04, 0x4e, 0x6f, 0x64, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x75, + 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, + 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x73, 0x5f, + 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x69, + 0x73, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x69, 0x73, 0x5f, 0x63, + 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, + 0x69, 0x73, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x65, 0x64, 0x12, 0x28, 0x0a, 0x06, 0x6c, + 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x52, 0x06, 0x6c, + 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x39, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, + 0x5f, 0x61, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, + 0x12, 0x39, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x08, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, + 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x22, 0x43, 0x0a, 0x05, 0x43, + 0x68, 0x61, 0x69, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x02, 0x69, 0x64, 0x12, 0x2a, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0e, 0x32, 0x16, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x76, 0x31, + 0x2e, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, + 0x22, 0x2d, 0x0a, 0x11, 0x46, 0x6c, 0x75, 0x78, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x43, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x22, + 0x89, 0x04, 0x0a, 0x0a, 0x4f, 0x43, 0x52, 0x31, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x18, + 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x69, 0x73, 0x5f, 0x62, + 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, + 0x69, 0x73, 0x42, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x12, 0x4a, 0x0a, 0x0e, 0x70, + 0x32, 0x70, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x76, + 0x31, 0x2e, 0x4f, 0x43, 0x52, 0x31, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x50, 0x32, 0x50, + 0x4b, 0x65, 0x79, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x52, 0x0c, 0x70, 0x32, 0x70, 0x4b, 0x65, + 0x79, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x12, 0x4a, 0x0a, 0x0e, 0x6f, 0x63, 0x72, 0x5f, 0x6b, + 0x65, 0x79, 0x5f, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x24, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x43, + 0x52, 0x31, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x4f, 0x43, 0x52, 0x4b, 0x65, 0x79, 0x42, + 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x52, 0x0c, 0x6f, 0x63, 0x72, 0x4b, 0x65, 0x79, 0x42, 0x75, 0x6e, + 0x64, 0x6c, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x61, 0x64, 0x64, 0x72, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x61, 0x64, 0x64, + 0x72, 0x1a, 0x46, 0x0a, 0x0c, 0x50, 0x32, 0x50, 0x4b, 0x65, 0x79, 0x42, 0x75, 0x6e, 0x64, 0x6c, + 0x65, 0x12, 0x17, 0x0a, 0x07, 0x70, 0x65, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x06, 0x70, 0x65, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x75, + 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, + 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x1a, 0xbf, 0x01, 0x0a, 0x0c, 0x4f, 0x43, + 0x52, 0x4b, 0x65, 0x79, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x62, 0x75, + 0x6e, 0x64, 0x6c, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x62, + 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x49, 0x64, 0x12, 0x2a, 0x0a, 0x11, 0x63, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, + 0x4b, 0x65, 0x79, 0x12, 0x2e, 0x0a, 0x13, 0x6f, 0x66, 0x66, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, + 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x11, 0x6f, 0x66, 0x66, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, + 0x4b, 0x65, 0x79, 0x12, 0x36, 0x0a, 0x17, 0x6f, 0x6e, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x73, + 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x15, 0x6f, 0x6e, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x53, 0x69, 0x67, + 0x6e, 0x69, 0x6e, 0x67, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x9c, 0x06, 0x0a, 0x0a, + 0x4f, 0x43, 0x52, 0x32, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, + 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x65, 0x6e, 0x61, + 0x62, 0x6c, 0x65, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x69, 0x73, 0x5f, 0x62, 0x6f, 0x6f, 0x74, 0x73, + 0x74, 0x72, 0x61, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x69, 0x73, 0x42, 0x6f, + 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x12, 0x4a, 0x0a, 0x0e, 0x70, 0x32, 0x70, 0x5f, 0x6b, + 0x65, 0x79, 0x5f, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x24, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x43, + 0x52, 0x32, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x50, 0x32, 0x50, 0x4b, 0x65, 0x79, 0x42, + 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x52, 0x0c, 0x70, 0x32, 0x70, 0x4b, 0x65, 0x79, 0x42, 0x75, 0x6e, + 0x64, 0x6c, 0x65, 0x12, 0x4a, 0x0a, 0x0e, 0x6f, 0x63, 0x72, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x62, + 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x43, 0x52, 0x32, 0x43, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x4f, 0x43, 0x52, 0x4b, 0x65, 0x79, 0x42, 0x75, 0x6e, 0x64, 0x6c, + 0x65, 0x52, 0x0c, 0x6f, 0x63, 0x72, 0x4b, 0x65, 0x79, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x12, + 0x1c, 0x0a, 0x09, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x61, 0x64, 0x64, 0x72, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x09, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x61, 0x64, 0x64, 0x72, 0x12, 0x39, 0x0a, + 0x07, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x43, 0x52, + 0x32, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x52, + 0x07, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x12, 0x30, 0x0a, 0x11, 0x66, 0x6f, 0x72, 0x77, + 0x61, 0x72, 0x64, 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x07, 0x20, + 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x10, 0x66, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x65, 0x72, + 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x88, 0x01, 0x01, 0x1a, 0x46, 0x0a, 0x0c, 0x50, 0x32, + 0x50, 0x4b, 0x65, 0x79, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x70, 0x65, + 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x65, 0x65, + 0x72, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, + 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, + 0x65, 0x79, 0x1a, 0xbf, 0x01, 0x0a, 0x0c, 0x4f, 0x43, 0x52, 0x4b, 0x65, 0x79, 0x42, 0x75, 0x6e, + 0x64, 0x6c, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x5f, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x49, 0x64, + 0x12, 0x2a, 0x0a, 0x11, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, + 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x63, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x2e, 0x0a, 0x13, + 0x6f, 0x66, 0x66, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, + 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x6f, 0x66, 0x66, 0x63, 0x68, + 0x61, 0x69, 0x6e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x36, 0x0a, 0x17, + 0x6f, 0x6e, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, 0x5f, + 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x15, 0x6f, + 0x6e, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x53, 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, 0x41, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x1a, 0x8d, 0x01, 0x0a, 0x07, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, + 0x12, 0x16, 0x0a, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x78, 0x65, 0x63, + 0x75, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x65, 0x78, 0x65, 0x63, 0x75, + 0x74, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x6e, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x06, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, + 0x72, 0x63, 0x75, 0x72, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x6d, 0x65, 0x72, + 0x63, 0x75, 0x72, 0x79, 0x12, 0x1e, 0x0a, 0x0a, 0x72, 0x65, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, + 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x72, 0x65, 0x62, 0x61, 0x6c, 0x61, + 0x6e, 0x63, 0x65, 0x72, 0x42, 0x14, 0x0a, 0x12, 0x5f, 0x66, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, + 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0xaa, 0x03, 0x0a, 0x0b, 0x43, + 0x68, 0x61, 0x69, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x28, 0x0a, 0x05, 0x63, 0x68, + 0x61, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x52, 0x05, 0x63, + 0x68, 0x61, 0x69, 0x6e, 0x12, 0x27, 0x0a, 0x0f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, + 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x61, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x23, 0x0a, + 0x0d, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x41, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x12, 0x4e, 0x0a, 0x13, 0x66, 0x6c, 0x75, 0x78, 0x5f, 0x6d, 0x6f, 0x6e, 0x69, 0x74, + 0x6f, 0x72, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x6c, + 0x75, 0x78, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, + 0x11, 0x66, 0x6c, 0x75, 0x78, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x43, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x12, 0x38, 0x0a, 0x0b, 0x6f, 0x63, 0x72, 0x31, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x6e, 0x6f, + 0x64, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x43, 0x52, 0x31, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x52, 0x0a, 0x6f, 0x63, 0x72, 0x31, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x38, 0x0a, 0x0b, + 0x6f, 0x63, 0x72, 0x32, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x17, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x76, 0x31, 0x2e, + 0x4f, 0x43, 0x52, 0x32, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x0a, 0x6f, 0x63, 0x72, 0x32, + 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x40, 0x0a, 0x1a, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, + 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x17, 0x61, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x50, 0x75, 0x62, 0x6c, + 0x69, 0x63, 0x4b, 0x65, 0x79, 0x88, 0x01, 0x01, 0x42, 0x1d, 0x0a, 0x1b, 0x5f, 0x61, 0x63, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x5f, 0x70, 0x75, 0x62, + 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x22, 0x72, 0x0a, 0x13, 0x52, 0x65, 0x67, 0x69, 0x73, + 0x74, 0x65, 0x72, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, + 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, + 0x79, 0x12, 0x28, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x10, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x2e, 0x4c, 0x61, + 0x62, 0x65, 0x6c, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x22, 0x3d, 0x0a, 0x14, 0x52, + 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x25, 0x0a, 0x04, 0x6e, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x11, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x76, 0x31, 0x2e, + 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x6e, 0x6f, 0x64, 0x65, 0x22, 0x20, 0x0a, 0x0e, 0x47, 0x65, + 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x38, 0x0a, 0x0f, + 0x47, 0x65, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x25, 0x0a, 0x04, 0x6e, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4e, 0x6f, 0x64, 0x65, + 0x52, 0x04, 0x6e, 0x6f, 0x64, 0x65, 0x22, 0xd4, 0x01, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x4e, + 0x6f, 0x64, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3c, 0x0a, 0x06, 0x66, + 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4e, 0x6f, + 0x64, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x46, 0x69, 0x6c, 0x74, 0x65, + 0x72, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x1a, 0x81, 0x01, 0x0a, 0x06, 0x46, 0x69, + 0x6c, 0x74, 0x65, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x69, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x09, 0x52, 0x03, 0x69, 0x64, 0x73, 0x12, 0x32, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, + 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x6e, 0x6f, + 0x64, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x53, 0x74, 0x61, 0x74, + 0x65, 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x31, 0x0a, 0x09, 0x73, 0x65, + 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x2e, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, + 0x6f, 0x72, 0x52, 0x09, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x73, 0x22, 0x3c, 0x0a, + 0x11, 0x4c, 0x69, 0x73, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x27, 0x0a, 0x05, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x11, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x76, 0x31, 0x2e, + 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x05, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x22, 0x80, 0x01, 0x0a, 0x11, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, + 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, + 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, + 0x63, 0x4b, 0x65, 0x79, 0x12, 0x28, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x04, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x6c, 0x61, 0x62, 0x65, 0x6c, + 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x22, 0x3b, + 0x0a, 0x12, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x25, 0x0a, 0x04, 0x6e, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x76, 0x31, + 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x6e, 0x6f, 0x64, 0x65, 0x22, 0x24, 0x0a, 0x12, 0x44, + 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, + 0x64, 0x22, 0x3c, 0x0a, 0x13, 0x44, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x6f, 0x64, 0x65, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x25, 0x0a, 0x04, 0x6e, 0x6f, 0x64, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x6e, 0x6f, 0x64, + 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x6e, 0x6f, 0x64, 0x65, 0x22, + 0x23, 0x0a, 0x11, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x02, 0x69, 0x64, 0x22, 0x3b, 0x0a, 0x12, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x6f, + 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x25, 0x0a, 0x04, 0x6e, 0x6f, + 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x6e, + 0x6f, 0x64, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x6e, 0x6f, 0x64, + 0x65, 0x22, 0x8b, 0x01, 0x0a, 0x1b, 0x4c, 0x69, 0x73, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x68, + 0x61, 0x69, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x47, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x2f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x76, 0x31, 0x2e, + 0x4c, 0x69, 0x73, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x43, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x46, 0x69, 0x6c, 0x74, + 0x65, 0x72, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x1a, 0x23, 0x0a, 0x06, 0x46, 0x69, + 0x6c, 0x74, 0x65, 0x72, 0x12, 0x19, 0x0a, 0x08, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x69, 0x64, 0x73, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x73, 0x22, + 0x5d, 0x0a, 0x1c, 0x4c, 0x69, 0x73, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x68, 0x61, 0x69, 0x6e, + 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x3d, 0x0a, 0x0d, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x6e, 0x6f, 0x64, + 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x52, 0x0c, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, 0x2a, 0x6b, + 0x0a, 0x09, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, 0x16, 0x43, + 0x48, 0x41, 0x49, 0x4e, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, + 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x12, 0x0a, 0x0e, 0x43, 0x48, 0x41, 0x49, 0x4e, + 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x45, 0x56, 0x4d, 0x10, 0x01, 0x12, 0x15, 0x0a, 0x11, 0x43, + 0x48, 0x41, 0x49, 0x4e, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x53, 0x4f, 0x4c, 0x41, 0x4e, 0x41, + 0x10, 0x02, 0x12, 0x17, 0x0a, 0x13, 0x43, 0x48, 0x41, 0x49, 0x4e, 0x5f, 0x54, 0x59, 0x50, 0x45, + 0x5f, 0x53, 0x54, 0x41, 0x52, 0x4b, 0x4e, 0x45, 0x54, 0x10, 0x03, 0x2a, 0x60, 0x0a, 0x0b, 0x45, + 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x1c, 0x0a, 0x18, 0x45, 0x4e, + 0x41, 0x42, 0x4c, 0x45, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, + 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x18, 0x0a, 0x14, 0x45, 0x4e, 0x41, 0x42, + 0x4c, 0x45, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x45, 0x4e, 0x41, 0x42, 0x4c, 0x45, 0x44, + 0x10, 0x01, 0x12, 0x19, 0x0a, 0x15, 0x45, 0x4e, 0x41, 0x42, 0x4c, 0x45, 0x5f, 0x53, 0x54, 0x41, + 0x54, 0x45, 0x5f, 0x44, 0x49, 0x53, 0x41, 0x42, 0x4c, 0x45, 0x44, 0x10, 0x02, 0x32, 0xdf, 0x04, + 0x0a, 0x0b, 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x52, 0x0a, + 0x0b, 0x44, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x12, 0x1f, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x69, 0x73, 0x61, 0x62, + 0x6c, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x69, 0x73, 0x61, + 0x62, 0x6c, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x00, 0x12, 0x4f, 0x0a, 0x0a, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x12, + 0x1e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6e, + 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x1f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6e, + 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x00, 0x12, 0x46, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x12, 0x1b, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4e, + 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4e, 0x6f, 0x64, 0x65, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x4c, 0x0a, 0x09, 0x4c, 0x69, + 0x73, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x12, 0x1d, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x6e, 0x6f, + 0x64, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x6e, 0x6f, 0x64, + 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x6d, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, + 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, + 0x12, 0x28, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, + 0x69, 0x73, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x43, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4e, 0x6f, 0x64, + 0x65, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x55, 0x0a, 0x0c, 0x52, 0x65, 0x67, 0x69, 0x73, + 0x74, 0x65, 0x72, 0x4e, 0x6f, 0x64, 0x65, 0x12, 0x20, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x6e, 0x6f, + 0x64, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x4e, 0x6f, + 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, + 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x4f, + 0x0a, 0x0a, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x12, 0x1e, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, + 0x09, 0x5a, 0x07, 0x6e, 0x6f, 0x64, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, +} + +var ( + file_node_v1_node_proto_rawDescOnce sync.Once + file_node_v1_node_proto_rawDescData = file_node_v1_node_proto_rawDesc +) + +func file_node_v1_node_proto_rawDescGZIP() []byte { + file_node_v1_node_proto_rawDescOnce.Do(func() { + file_node_v1_node_proto_rawDescData = protoimpl.X.CompressGZIP(file_node_v1_node_proto_rawDescData) + }) + return file_node_v1_node_proto_rawDescData +} + +var file_node_v1_node_proto_enumTypes = make([]protoimpl.EnumInfo, 2) +var file_node_v1_node_proto_msgTypes = make([]protoimpl.MessageInfo, 27) +var file_node_v1_node_proto_goTypes = []interface{}{ + (ChainType)(0), // 0: api.node.v1.ChainType + (EnableState)(0), // 1: api.node.v1.EnableState + (*Node)(nil), // 2: api.node.v1.Node + (*Chain)(nil), // 3: api.node.v1.Chain + (*FluxMonitorConfig)(nil), // 4: api.node.v1.FluxMonitorConfig + (*OCR1Config)(nil), // 5: api.node.v1.OCR1Config + (*OCR2Config)(nil), // 6: api.node.v1.OCR2Config + (*ChainConfig)(nil), // 7: api.node.v1.ChainConfig + (*RegisterNodeRequest)(nil), // 8: api.node.v1.RegisterNodeRequest + (*RegisterNodeResponse)(nil), // 9: api.node.v1.RegisterNodeResponse + (*GetNodeRequest)(nil), // 10: api.node.v1.GetNodeRequest + (*GetNodeResponse)(nil), // 11: api.node.v1.GetNodeResponse + (*ListNodesRequest)(nil), // 12: api.node.v1.ListNodesRequest + (*ListNodesResponse)(nil), // 13: api.node.v1.ListNodesResponse + (*UpdateNodeRequest)(nil), // 14: api.node.v1.UpdateNodeRequest + (*UpdateNodeResponse)(nil), // 15: api.node.v1.UpdateNodeResponse + (*DisableNodeRequest)(nil), // 16: api.node.v1.DisableNodeRequest + (*DisableNodeResponse)(nil), // 17: api.node.v1.DisableNodeResponse + (*EnableNodeRequest)(nil), // 18: api.node.v1.EnableNodeRequest + (*EnableNodeResponse)(nil), // 19: api.node.v1.EnableNodeResponse + (*ListNodeChainConfigsRequest)(nil), // 20: api.node.v1.ListNodeChainConfigsRequest + (*ListNodeChainConfigsResponse)(nil), // 21: api.node.v1.ListNodeChainConfigsResponse + (*OCR1Config_P2PKeyBundle)(nil), // 22: api.node.v1.OCR1Config.P2PKeyBundle + (*OCR1Config_OCRKeyBundle)(nil), // 23: api.node.v1.OCR1Config.OCRKeyBundle + (*OCR2Config_P2PKeyBundle)(nil), // 24: api.node.v1.OCR2Config.P2PKeyBundle + (*OCR2Config_OCRKeyBundle)(nil), // 25: api.node.v1.OCR2Config.OCRKeyBundle + (*OCR2Config_Plugins)(nil), // 26: api.node.v1.OCR2Config.Plugins + (*ListNodesRequest_Filter)(nil), // 27: api.node.v1.ListNodesRequest.Filter + (*ListNodeChainConfigsRequest_Filter)(nil), // 28: api.node.v1.ListNodeChainConfigsRequest.Filter + (*ptypes.Label)(nil), // 29: api.label.Label + (*timestamppb.Timestamp)(nil), // 30: google.protobuf.Timestamp + (*ptypes.Selector)(nil), // 31: api.label.Selector +} +var file_node_v1_node_proto_depIdxs = []int32{ + 29, // 0: api.node.v1.Node.labels:type_name -> api.label.Label + 30, // 1: api.node.v1.Node.created_at:type_name -> google.protobuf.Timestamp + 30, // 2: api.node.v1.Node.updated_at:type_name -> google.protobuf.Timestamp + 0, // 3: api.node.v1.Chain.type:type_name -> api.node.v1.ChainType + 22, // 4: api.node.v1.OCR1Config.p2p_key_bundle:type_name -> api.node.v1.OCR1Config.P2PKeyBundle + 23, // 5: api.node.v1.OCR1Config.ocr_key_bundle:type_name -> api.node.v1.OCR1Config.OCRKeyBundle + 24, // 6: api.node.v1.OCR2Config.p2p_key_bundle:type_name -> api.node.v1.OCR2Config.P2PKeyBundle + 25, // 7: api.node.v1.OCR2Config.ocr_key_bundle:type_name -> api.node.v1.OCR2Config.OCRKeyBundle + 26, // 8: api.node.v1.OCR2Config.plugins:type_name -> api.node.v1.OCR2Config.Plugins + 3, // 9: api.node.v1.ChainConfig.chain:type_name -> api.node.v1.Chain + 4, // 10: api.node.v1.ChainConfig.flux_monitor_config:type_name -> api.node.v1.FluxMonitorConfig + 5, // 11: api.node.v1.ChainConfig.ocr1_config:type_name -> api.node.v1.OCR1Config + 6, // 12: api.node.v1.ChainConfig.ocr2_config:type_name -> api.node.v1.OCR2Config + 29, // 13: api.node.v1.RegisterNodeRequest.labels:type_name -> api.label.Label + 2, // 14: api.node.v1.RegisterNodeResponse.node:type_name -> api.node.v1.Node + 2, // 15: api.node.v1.GetNodeResponse.node:type_name -> api.node.v1.Node + 27, // 16: api.node.v1.ListNodesRequest.filter:type_name -> api.node.v1.ListNodesRequest.Filter + 2, // 17: api.node.v1.ListNodesResponse.nodes:type_name -> api.node.v1.Node + 29, // 18: api.node.v1.UpdateNodeRequest.labels:type_name -> api.label.Label + 2, // 19: api.node.v1.UpdateNodeResponse.node:type_name -> api.node.v1.Node + 2, // 20: api.node.v1.DisableNodeResponse.node:type_name -> api.node.v1.Node + 2, // 21: api.node.v1.EnableNodeResponse.node:type_name -> api.node.v1.Node + 28, // 22: api.node.v1.ListNodeChainConfigsRequest.filter:type_name -> api.node.v1.ListNodeChainConfigsRequest.Filter + 7, // 23: api.node.v1.ListNodeChainConfigsResponse.chain_configs:type_name -> api.node.v1.ChainConfig + 1, // 24: api.node.v1.ListNodesRequest.Filter.enabled:type_name -> api.node.v1.EnableState + 31, // 25: api.node.v1.ListNodesRequest.Filter.selectors:type_name -> api.label.Selector + 16, // 26: api.node.v1.NodeService.DisableNode:input_type -> api.node.v1.DisableNodeRequest + 18, // 27: api.node.v1.NodeService.EnableNode:input_type -> api.node.v1.EnableNodeRequest + 10, // 28: api.node.v1.NodeService.GetNode:input_type -> api.node.v1.GetNodeRequest + 12, // 29: api.node.v1.NodeService.ListNodes:input_type -> api.node.v1.ListNodesRequest + 20, // 30: api.node.v1.NodeService.ListNodeChainConfigs:input_type -> api.node.v1.ListNodeChainConfigsRequest + 8, // 31: api.node.v1.NodeService.RegisterNode:input_type -> api.node.v1.RegisterNodeRequest + 14, // 32: api.node.v1.NodeService.UpdateNode:input_type -> api.node.v1.UpdateNodeRequest + 17, // 33: api.node.v1.NodeService.DisableNode:output_type -> api.node.v1.DisableNodeResponse + 19, // 34: api.node.v1.NodeService.EnableNode:output_type -> api.node.v1.EnableNodeResponse + 11, // 35: api.node.v1.NodeService.GetNode:output_type -> api.node.v1.GetNodeResponse + 13, // 36: api.node.v1.NodeService.ListNodes:output_type -> api.node.v1.ListNodesResponse + 21, // 37: api.node.v1.NodeService.ListNodeChainConfigs:output_type -> api.node.v1.ListNodeChainConfigsResponse + 9, // 38: api.node.v1.NodeService.RegisterNode:output_type -> api.node.v1.RegisterNodeResponse + 15, // 39: api.node.v1.NodeService.UpdateNode:output_type -> api.node.v1.UpdateNodeResponse + 33, // [33:40] is the sub-list for method output_type + 26, // [26:33] is the sub-list for method input_type + 26, // [26:26] is the sub-list for extension type_name + 26, // [26:26] is the sub-list for extension extendee + 0, // [0:26] is the sub-list for field type_name +} + +func init() { file_node_v1_node_proto_init() } +func file_node_v1_node_proto_init() { + if File_node_v1_node_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_node_v1_node_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Node); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_node_v1_node_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Chain); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_node_v1_node_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FluxMonitorConfig); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_node_v1_node_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*OCR1Config); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_node_v1_node_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*OCR2Config); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_node_v1_node_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChainConfig); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_node_v1_node_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RegisterNodeRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_node_v1_node_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RegisterNodeResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_node_v1_node_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetNodeRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_node_v1_node_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetNodeResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_node_v1_node_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListNodesRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_node_v1_node_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListNodesResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_node_v1_node_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateNodeRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_node_v1_node_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateNodeResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_node_v1_node_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DisableNodeRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_node_v1_node_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DisableNodeResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_node_v1_node_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EnableNodeRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_node_v1_node_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EnableNodeResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_node_v1_node_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListNodeChainConfigsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_node_v1_node_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListNodeChainConfigsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_node_v1_node_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*OCR1Config_P2PKeyBundle); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_node_v1_node_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*OCR1Config_OCRKeyBundle); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_node_v1_node_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*OCR2Config_P2PKeyBundle); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_node_v1_node_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*OCR2Config_OCRKeyBundle); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_node_v1_node_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*OCR2Config_Plugins); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_node_v1_node_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListNodesRequest_Filter); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_node_v1_node_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListNodeChainConfigsRequest_Filter); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_node_v1_node_proto_msgTypes[4].OneofWrappers = []interface{}{} + file_node_v1_node_proto_msgTypes[5].OneofWrappers = []interface{}{} + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_node_v1_node_proto_rawDesc, + NumEnums: 2, + NumMessages: 27, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_node_v1_node_proto_goTypes, + DependencyIndexes: file_node_v1_node_proto_depIdxs, + EnumInfos: file_node_v1_node_proto_enumTypes, + MessageInfos: file_node_v1_node_proto_msgTypes, + }.Build() + File_node_v1_node_proto = out.File + file_node_v1_node_proto_rawDesc = nil + file_node_v1_node_proto_goTypes = nil + file_node_v1_node_proto_depIdxs = nil +} \ No newline at end of file diff --git a/integration-tests/deployment/jd/node/v1/node_grpc.pb.go b/integration-tests/deployment/jd/node/v1/node_grpc.pb.go new file mode 100644 index 00000000000..70010f3f0c6 --- /dev/null +++ b/integration-tests/deployment/jd/node/v1/node_grpc.pb.go @@ -0,0 +1,343 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc v4.25.3 +// source: node/v1/node.proto + +package v1 + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + NodeService_DisableNode_FullMethodName = "/api.node.v1.NodeService/DisableNode" + NodeService_EnableNode_FullMethodName = "/api.node.v1.NodeService/EnableNode" + NodeService_GetNode_FullMethodName = "/api.node.v1.NodeService/GetNode" + NodeService_ListNodes_FullMethodName = "/api.node.v1.NodeService/ListNodes" + NodeService_ListNodeChainConfigs_FullMethodName = "/api.node.v1.NodeService/ListNodeChainConfigs" + NodeService_RegisterNode_FullMethodName = "/api.node.v1.NodeService/RegisterNode" + NodeService_UpdateNode_FullMethodName = "/api.node.v1.NodeService/UpdateNode" +) + +// NodeServiceClient is the client API for NodeService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type NodeServiceClient interface { + // DisableNode marks a node as disabled, disabling any active operations on it. + DisableNode(ctx context.Context, in *DisableNodeRequest, opts ...grpc.CallOption) (*DisableNodeResponse, error) + // EnableNode enabled a disabled node, allowing operations to resume. + EnableNode(ctx context.Context, in *EnableNodeRequest, opts ...grpc.CallOption) (*EnableNodeResponse, error) + // GetNode retrieves the details of a node by its unique identifier. + GetNode(ctx context.Context, in *GetNodeRequest, opts ...grpc.CallOption) (*GetNodeResponse, error) + // ListNodes returns a list of nodes, optionally filtered by the provided criteria. + ListNodes(ctx context.Context, in *ListNodesRequest, opts ...grpc.CallOption) (*ListNodesResponse, error) + ListNodeChainConfigs(ctx context.Context, in *ListNodeChainConfigsRequest, opts ...grpc.CallOption) (*ListNodeChainConfigsResponse, error) + // RegisterNode registers a new node to the system. + RegisterNode(ctx context.Context, in *RegisterNodeRequest, opts ...grpc.CallOption) (*RegisterNodeResponse, error) + // UpdateNode updates the details of an existing node. + UpdateNode(ctx context.Context, in *UpdateNodeRequest, opts ...grpc.CallOption) (*UpdateNodeResponse, error) +} + +type nodeServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewNodeServiceClient(cc grpc.ClientConnInterface) NodeServiceClient { + return &nodeServiceClient{cc} +} + +func (c *nodeServiceClient) DisableNode(ctx context.Context, in *DisableNodeRequest, opts ...grpc.CallOption) (*DisableNodeResponse, error) { + out := new(DisableNodeResponse) + err := c.cc.Invoke(ctx, NodeService_DisableNode_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *nodeServiceClient) EnableNode(ctx context.Context, in *EnableNodeRequest, opts ...grpc.CallOption) (*EnableNodeResponse, error) { + out := new(EnableNodeResponse) + err := c.cc.Invoke(ctx, NodeService_EnableNode_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *nodeServiceClient) GetNode(ctx context.Context, in *GetNodeRequest, opts ...grpc.CallOption) (*GetNodeResponse, error) { + out := new(GetNodeResponse) + err := c.cc.Invoke(ctx, NodeService_GetNode_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *nodeServiceClient) ListNodes(ctx context.Context, in *ListNodesRequest, opts ...grpc.CallOption) (*ListNodesResponse, error) { + out := new(ListNodesResponse) + err := c.cc.Invoke(ctx, NodeService_ListNodes_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *nodeServiceClient) ListNodeChainConfigs(ctx context.Context, in *ListNodeChainConfigsRequest, opts ...grpc.CallOption) (*ListNodeChainConfigsResponse, error) { + out := new(ListNodeChainConfigsResponse) + err := c.cc.Invoke(ctx, NodeService_ListNodeChainConfigs_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *nodeServiceClient) RegisterNode(ctx context.Context, in *RegisterNodeRequest, opts ...grpc.CallOption) (*RegisterNodeResponse, error) { + out := new(RegisterNodeResponse) + err := c.cc.Invoke(ctx, NodeService_RegisterNode_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *nodeServiceClient) UpdateNode(ctx context.Context, in *UpdateNodeRequest, opts ...grpc.CallOption) (*UpdateNodeResponse, error) { + out := new(UpdateNodeResponse) + err := c.cc.Invoke(ctx, NodeService_UpdateNode_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// NodeServiceServer is the server API for NodeService service. +// All implementations must embed UnimplementedNodeServiceServer +// for forward compatibility +type NodeServiceServer interface { + // DisableNode marks a node as disabled, disabling any active operations on it. + DisableNode(context.Context, *DisableNodeRequest) (*DisableNodeResponse, error) + // EnableNode enabled a disabled node, allowing operations to resume. + EnableNode(context.Context, *EnableNodeRequest) (*EnableNodeResponse, error) + // GetNode retrieves the details of a node by its unique identifier. + GetNode(context.Context, *GetNodeRequest) (*GetNodeResponse, error) + // ListNodes returns a list of nodes, optionally filtered by the provided criteria. + ListNodes(context.Context, *ListNodesRequest) (*ListNodesResponse, error) + ListNodeChainConfigs(context.Context, *ListNodeChainConfigsRequest) (*ListNodeChainConfigsResponse, error) + // RegisterNode registers a new node to the system. + RegisterNode(context.Context, *RegisterNodeRequest) (*RegisterNodeResponse, error) + // UpdateNode updates the details of an existing node. + UpdateNode(context.Context, *UpdateNodeRequest) (*UpdateNodeResponse, error) + mustEmbedUnimplementedNodeServiceServer() +} + +// UnimplementedNodeServiceServer must be embedded to have forward compatible implementations. +type UnimplementedNodeServiceServer struct { +} + +func (UnimplementedNodeServiceServer) DisableNode(context.Context, *DisableNodeRequest) (*DisableNodeResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DisableNode not implemented") +} +func (UnimplementedNodeServiceServer) EnableNode(context.Context, *EnableNodeRequest) (*EnableNodeResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method EnableNode not implemented") +} +func (UnimplementedNodeServiceServer) GetNode(context.Context, *GetNodeRequest) (*GetNodeResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetNode not implemented") +} +func (UnimplementedNodeServiceServer) ListNodes(context.Context, *ListNodesRequest) (*ListNodesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListNodes not implemented") +} +func (UnimplementedNodeServiceServer) ListNodeChainConfigs(context.Context, *ListNodeChainConfigsRequest) (*ListNodeChainConfigsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListNodeChainConfigs not implemented") +} +func (UnimplementedNodeServiceServer) RegisterNode(context.Context, *RegisterNodeRequest) (*RegisterNodeResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RegisterNode not implemented") +} +func (UnimplementedNodeServiceServer) UpdateNode(context.Context, *UpdateNodeRequest) (*UpdateNodeResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateNode not implemented") +} +func (UnimplementedNodeServiceServer) mustEmbedUnimplementedNodeServiceServer() {} + +// UnsafeNodeServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to NodeServiceServer will +// result in compilation errors. +type UnsafeNodeServiceServer interface { + mustEmbedUnimplementedNodeServiceServer() +} + +func RegisterNodeServiceServer(s grpc.ServiceRegistrar, srv NodeServiceServer) { + s.RegisterService(&NodeService_ServiceDesc, srv) +} + +func _NodeService_DisableNode_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DisableNodeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NodeServiceServer).DisableNode(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: NodeService_DisableNode_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NodeServiceServer).DisableNode(ctx, req.(*DisableNodeRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _NodeService_EnableNode_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(EnableNodeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NodeServiceServer).EnableNode(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: NodeService_EnableNode_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NodeServiceServer).EnableNode(ctx, req.(*EnableNodeRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _NodeService_GetNode_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetNodeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NodeServiceServer).GetNode(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: NodeService_GetNode_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NodeServiceServer).GetNode(ctx, req.(*GetNodeRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _NodeService_ListNodes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListNodesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NodeServiceServer).ListNodes(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: NodeService_ListNodes_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NodeServiceServer).ListNodes(ctx, req.(*ListNodesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _NodeService_ListNodeChainConfigs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListNodeChainConfigsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NodeServiceServer).ListNodeChainConfigs(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: NodeService_ListNodeChainConfigs_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NodeServiceServer).ListNodeChainConfigs(ctx, req.(*ListNodeChainConfigsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _NodeService_RegisterNode_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RegisterNodeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NodeServiceServer).RegisterNode(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: NodeService_RegisterNode_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NodeServiceServer).RegisterNode(ctx, req.(*RegisterNodeRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _NodeService_UpdateNode_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateNodeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NodeServiceServer).UpdateNode(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: NodeService_UpdateNode_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NodeServiceServer).UpdateNode(ctx, req.(*UpdateNodeRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// NodeService_ServiceDesc is the grpc.ServiceDesc for NodeService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var NodeService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "api.node.v1.NodeService", + HandlerType: (*NodeServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "DisableNode", + Handler: _NodeService_DisableNode_Handler, + }, + { + MethodName: "EnableNode", + Handler: _NodeService_EnableNode_Handler, + }, + { + MethodName: "GetNode", + Handler: _NodeService_GetNode_Handler, + }, + { + MethodName: "ListNodes", + Handler: _NodeService_ListNodes_Handler, + }, + { + MethodName: "ListNodeChainConfigs", + Handler: _NodeService_ListNodeChainConfigs_Handler, + }, + { + MethodName: "RegisterNode", + Handler: _NodeService_RegisterNode_Handler, + }, + { + MethodName: "UpdateNode", + Handler: _NodeService_UpdateNode_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "node/v1/node.proto", +} \ No newline at end of file diff --git a/integration-tests/deployment/jd/shared/ptypes/label.pb.go b/integration-tests/deployment/jd/shared/ptypes/label.pb.go new file mode 100644 index 00000000000..ab8f0db54c4 --- /dev/null +++ b/integration-tests/deployment/jd/shared/ptypes/label.pb.go @@ -0,0 +1,311 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.29.0 +// protoc v4.25.3 +// source: shared/ptypes/label.proto + +package ptypes + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// SelectorOp defines the operation to be used in a selector +type SelectorOp int32 + +const ( + SelectorOp_EQ SelectorOp = 0 + SelectorOp_NOT_EQ SelectorOp = 1 + SelectorOp_IN SelectorOp = 2 + SelectorOp_NOT_IN SelectorOp = 3 + SelectorOp_EXIST SelectorOp = 4 + SelectorOp_NOT_EXIST SelectorOp = 5 +) + +// Enum value maps for SelectorOp. +var ( + SelectorOp_name = map[int32]string{ + 0: "EQ", + 1: "NOT_EQ", + 2: "IN", + 3: "NOT_IN", + 4: "EXIST", + 5: "NOT_EXIST", + } + SelectorOp_value = map[string]int32{ + "EQ": 0, + "NOT_EQ": 1, + "IN": 2, + "NOT_IN": 3, + "EXIST": 4, + "NOT_EXIST": 5, + } +) + +func (x SelectorOp) Enum() *SelectorOp { + p := new(SelectorOp) + *p = x + return p +} + +func (x SelectorOp) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (SelectorOp) Descriptor() protoreflect.EnumDescriptor { + return file_shared_ptypes_label_proto_enumTypes[0].Descriptor() +} + +func (SelectorOp) Type() protoreflect.EnumType { + return &file_shared_ptypes_label_proto_enumTypes[0] +} + +func (x SelectorOp) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use SelectorOp.Descriptor instead. +func (SelectorOp) EnumDescriptor() ([]byte, []int) { + return file_shared_ptypes_label_proto_rawDescGZIP(), []int{0} +} + +// Label defines a label as a key value pair +type Label struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + Value *string `protobuf:"bytes,2,opt,name=value,proto3,oneof" json:"value,omitempty"` +} + +func (x *Label) Reset() { + *x = Label{} + if protoimpl.UnsafeEnabled { + mi := &file_shared_ptypes_label_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Label) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Label) ProtoMessage() {} + +func (x *Label) ProtoReflect() protoreflect.Message { + mi := &file_shared_ptypes_label_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Label.ProtoReflect.Descriptor instead. +func (*Label) Descriptor() ([]byte, []int) { + return file_shared_ptypes_label_proto_rawDescGZIP(), []int{0} +} + +func (x *Label) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *Label) GetValue() string { + if x != nil && x.Value != nil { + return *x.Value + } + return "" +} + +// Selector defines a selector as a key value pair with an operation +type Selector struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + Op SelectorOp `protobuf:"varint,2,opt,name=op,proto3,enum=api.label.SelectorOp" json:"op,omitempty"` + Value *string `protobuf:"bytes,3,opt,name=value,proto3,oneof" json:"value,omitempty"` +} + +func (x *Selector) Reset() { + *x = Selector{} + if protoimpl.UnsafeEnabled { + mi := &file_shared_ptypes_label_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Selector) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Selector) ProtoMessage() {} + +func (x *Selector) ProtoReflect() protoreflect.Message { + mi := &file_shared_ptypes_label_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Selector.ProtoReflect.Descriptor instead. +func (*Selector) Descriptor() ([]byte, []int) { + return file_shared_ptypes_label_proto_rawDescGZIP(), []int{1} +} + +func (x *Selector) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *Selector) GetOp() SelectorOp { + if x != nil { + return x.Op + } + return SelectorOp_EQ +} + +func (x *Selector) GetValue() string { + if x != nil && x.Value != nil { + return *x.Value + } + return "" +} + +var File_shared_ptypes_label_proto protoreflect.FileDescriptor + +var file_shared_ptypes_label_proto_rawDesc = []byte{ + 0x0a, 0x19, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2f, 0x70, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, + 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x09, 0x61, 0x70, 0x69, + 0x2e, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x22, 0x3e, 0x0a, 0x05, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x12, + 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, + 0x79, 0x12, 0x19, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x48, 0x00, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x88, 0x01, 0x01, 0x42, 0x08, 0x0a, 0x06, + 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x68, 0x0a, 0x08, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, + 0x6f, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x03, 0x6b, 0x65, 0x79, 0x12, 0x25, 0x0a, 0x02, 0x6f, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, + 0x32, 0x15, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x2e, 0x53, 0x65, 0x6c, + 0x65, 0x63, 0x74, 0x6f, 0x72, 0x4f, 0x70, 0x52, 0x02, 0x6f, 0x70, 0x12, 0x19, 0x0a, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x88, 0x01, 0x01, 0x42, 0x08, 0x0a, 0x06, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x2a, 0x4e, 0x0a, 0x0a, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x4f, 0x70, 0x12, 0x06, + 0x0a, 0x02, 0x45, 0x51, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x4e, 0x4f, 0x54, 0x5f, 0x45, 0x51, + 0x10, 0x01, 0x12, 0x06, 0x0a, 0x02, 0x49, 0x4e, 0x10, 0x02, 0x12, 0x0a, 0x0a, 0x06, 0x4e, 0x4f, + 0x54, 0x5f, 0x49, 0x4e, 0x10, 0x03, 0x12, 0x09, 0x0a, 0x05, 0x45, 0x58, 0x49, 0x53, 0x54, 0x10, + 0x04, 0x12, 0x0d, 0x0a, 0x09, 0x4e, 0x4f, 0x54, 0x5f, 0x45, 0x58, 0x49, 0x53, 0x54, 0x10, 0x05, + 0x42, 0x47, 0x5a, 0x45, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, + 0x6d, 0x61, 0x72, 0x74, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x6b, 0x69, 0x74, 0x2f, + 0x6a, 0x6f, 0x62, 0x2d, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x6f, 0x72, 0x2f, + 0x70, 0x6b, 0x67, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x73, 0x68, 0x61, 0x72, + 0x65, 0x64, 0x2f, 0x70, 0x74, 0x79, 0x70, 0x65, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, +} + +var ( + file_shared_ptypes_label_proto_rawDescOnce sync.Once + file_shared_ptypes_label_proto_rawDescData = file_shared_ptypes_label_proto_rawDesc +) + +func file_shared_ptypes_label_proto_rawDescGZIP() []byte { + file_shared_ptypes_label_proto_rawDescOnce.Do(func() { + file_shared_ptypes_label_proto_rawDescData = protoimpl.X.CompressGZIP(file_shared_ptypes_label_proto_rawDescData) + }) + return file_shared_ptypes_label_proto_rawDescData +} + +var file_shared_ptypes_label_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_shared_ptypes_label_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_shared_ptypes_label_proto_goTypes = []interface{}{ + (SelectorOp)(0), // 0: api.label.SelectorOp + (*Label)(nil), // 1: api.label.Label + (*Selector)(nil), // 2: api.label.Selector +} +var file_shared_ptypes_label_proto_depIdxs = []int32{ + 0, // 0: api.label.Selector.op:type_name -> api.label.SelectorOp + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_shared_ptypes_label_proto_init() } +func file_shared_ptypes_label_proto_init() { + if File_shared_ptypes_label_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_shared_ptypes_label_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Label); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_shared_ptypes_label_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Selector); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_shared_ptypes_label_proto_msgTypes[0].OneofWrappers = []interface{}{} + file_shared_ptypes_label_proto_msgTypes[1].OneofWrappers = []interface{}{} + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_shared_ptypes_label_proto_rawDesc, + NumEnums: 1, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_shared_ptypes_label_proto_goTypes, + DependencyIndexes: file_shared_ptypes_label_proto_depIdxs, + EnumInfos: file_shared_ptypes_label_proto_enumTypes, + MessageInfos: file_shared_ptypes_label_proto_msgTypes, + }.Build() + File_shared_ptypes_label_proto = out.File + file_shared_ptypes_label_proto_rawDesc = nil + file_shared_ptypes_label_proto_goTypes = nil + file_shared_ptypes_label_proto_depIdxs = nil +} \ No newline at end of file diff --git a/integration-tests/deployment/memory/chain.go b/integration-tests/deployment/memory/chain.go new file mode 100644 index 00000000000..153d9d19e93 --- /dev/null +++ b/integration-tests/deployment/memory/chain.go @@ -0,0 +1,74 @@ +package memory + +import ( + "math/big" + "testing" + "time" + + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/accounts/abi/bind/backends" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core" + gethtypes "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/params" + chainsel "github.com/smartcontractkit/chain-selectors" + "github.com/stretchr/testify/require" +) + +type EVMChain struct { + Backend *backends.SimulatedBackend + DeployerKey *bind.TransactOpts +} + +// CCIP relies on block timestamps, but SimulatedBackend uses by default clock starting from 1970-01-01 +// This trick is used to move the clock closer to the current time. We set first block to be X hours ago. +// Tests create plenty of transactions so this number can't be too low, every new block mined will tick the clock, +// if you mine more than "X hours" transactions, SimulatedBackend will panic because generated timestamps will be in the future. +func tweakChainTimestamp(t *testing.T, backend *backends.SimulatedBackend, tweak time.Duration) { + blockTime := time.Unix(int64(backend.Blockchain().CurrentHeader().Time), 0) + sinceBlockTime := time.Since(blockTime) + diff := sinceBlockTime - tweak + err := backend.AdjustTime(diff) + require.NoError(t, err, "unable to adjust time on simulated chain") + backend.Commit() + backend.Commit() +} + +func fundAddress(t *testing.T, from *bind.TransactOpts, to common.Address, amount *big.Int, backend *backends.SimulatedBackend) { + nonce, err := backend.PendingNonceAt(Context(t), from.From) + require.NoError(t, err) + gp, err := backend.SuggestGasPrice(Context(t)) + require.NoError(t, err) + rawTx := gethtypes.NewTx(&gethtypes.LegacyTx{ + Nonce: nonce, + GasPrice: gp, + Gas: 21000, + To: &to, + Value: amount, + }) + signedTx, err := from.Signer(from.From, rawTx) + require.NoError(t, err) + err = backend.SendTransaction(Context(t), signedTx) + require.NoError(t, err) + backend.Commit() +} + +func GenerateChains(t *testing.T, numChains int) map[uint64]EVMChain { + chains := make(map[uint64]EVMChain) + for i := 0; i < numChains; i++ { + chainID := chainsel.TEST_90000001.EvmChainID + uint64(i) + key, err := crypto.GenerateKey() + require.NoError(t, err) + owner, err := bind.NewKeyedTransactorWithChainID(key, big.NewInt(1337)) + require.NoError(t, err) + backend := backends.NewSimulatedBackend(core.GenesisAlloc{ + owner.From: {Balance: big.NewInt(0).Mul(big.NewInt(100), big.NewInt(params.Ether))}}, 10000000) + tweakChainTimestamp(t, backend, time.Hour*8) + chains[chainID] = EVMChain{ + Backend: backend, + DeployerKey: owner, + } + } + return chains +} diff --git a/integration-tests/deployment/memory/environment.go b/integration-tests/deployment/memory/environment.go new file mode 100644 index 00000000000..409e8d3a816 --- /dev/null +++ b/integration-tests/deployment/memory/environment.go @@ -0,0 +1,147 @@ +package memory + +import ( + "context" + "fmt" + "testing" + + "github.com/ethereum/go-ethereum/accounts/abi/bind/backends" + "github.com/ethereum/go-ethereum/core/types" + "github.com/hashicorp/consul/sdk/freeport" + "github.com/stretchr/testify/require" + "go.uber.org/zap/zapcore" + + chainsel "github.com/smartcontractkit/chain-selectors" + + "github.com/smartcontractkit/chainlink/integration-tests/deployment" + + "github.com/smartcontractkit/chainlink-common/pkg/logger" +) + +const ( + Memory = "memory" +) + +type MemoryEnvironmentConfig struct { + Chains int + Nodes int + Bootstraps int + RegistryConfig deployment.CapabilityRegistryConfig +} + +// Needed for environment variables on the node which point to prexisitng addresses. +// i.e. CapReg. +func NewMemoryChains(t *testing.T, numChains int) map[uint64]deployment.Chain { + mchains := GenerateChains(t, numChains) + chains := make(map[uint64]deployment.Chain) + for cid, chain := range mchains { + sel, err := chainsel.SelectorFromChainId(cid) + require.NoError(t, err) + chains[sel] = deployment.Chain{ + Selector: sel, + Client: chain.Backend, + DeployerKey: chain.DeployerKey, + Confirm: func(tx *types.Transaction) (uint64, error) { + if tx == nil { + return 0, fmt.Errorf("tx was nil, nothing to confirm") + } + for { + chain.Backend.Commit() + receipt, err := chain.Backend.TransactionReceipt(context.Background(), tx.Hash()) + if err != nil { + t.Log("failed to get receipt", err) + continue + } + if receipt.Status == 0 { + t.Logf("Status (reverted) %d for txhash %s\n", receipt.Status, tx.Hash().Hex()) + } + return receipt.BlockNumber.Uint64(), nil + } + }, + } + } + return chains +} + +func NewNodes(t *testing.T, logLevel zapcore.Level, chains map[uint64]deployment.Chain, numNodes, numBootstraps int, registryConfig deployment.CapabilityRegistryConfig) map[string]Node { + mchains := make(map[uint64]EVMChain) + for _, chain := range chains { + evmChainID, err := chainsel.ChainIdFromSelector(chain.Selector) + if err != nil { + t.Fatal(err) + } + mchains[evmChainID] = EVMChain{ + Backend: chain.Client.(*backends.SimulatedBackend), + DeployerKey: chain.DeployerKey, + } + } + nodesByPeerID := make(map[string]Node) + ports := freeport.GetN(t, numBootstraps+numNodes) + // bootstrap nodes must be separate nodes from plugin nodes, + // since we won't run a bootstrapper and a plugin oracle on the same + // chainlink node in production. + for i := 0; i < numBootstraps; i++ { + node := NewNode(t, ports[i], mchains, logLevel, true /* bootstrap */, registryConfig) + nodesByPeerID[node.Keys.PeerID.String()] = *node + // Note in real env, this ID is allocated by JD. + } + for i := 0; i < numNodes; i++ { + // grab port offset by numBootstraps, since above loop also takes some ports. + node := NewNode(t, ports[numBootstraps+i], mchains, logLevel, false /* bootstrap */, registryConfig) + nodesByPeerID[node.Keys.PeerID.String()] = *node + // Note in real env, this ID is allocated by JD. + } + return nodesByPeerID +} + +func NewMemoryEnvironmentFromChainsNodes(t *testing.T, + lggr logger.Logger, + chains map[uint64]deployment.Chain, + nodes map[string]Node) deployment.Environment { + var nodeIDs []string + for id := range nodes { + nodeIDs = append(nodeIDs, id) + } + return deployment.Environment{ + Name: Memory, + Offchain: NewMemoryJobClient(nodes), + // Note these have the p2p_ prefix. + NodeIDs: nodeIDs, + Chains: chains, + Logger: lggr, + } +} + +//func NewMemoryEnvironmentExistingChains(t *testing.T, lggr logger.Logger, +// chains map[uint64]deployment.Chain, config MemoryEnvironmentConfig) deployment.Environment { +// nodes := NewNodes(t, chains, config.Nodes, config.Bootstraps, config.CapabilityRegistryConfig) +// var nodeIDs []string +// for id := range nodes { +// nodeIDs = append(nodeIDs, id) +// } +// return deployment.Environment{ +// Name: Memory, +// Offchain: NewMemoryJobClient(nodes), +// // Note these have the p2p_ prefix. +// NodeIDs: nodeIDs, +// Chains: chains, +// Logger: lggr, +// } +//} + +// To be used by tests and any kind of deployment logic. +func NewMemoryEnvironment(t *testing.T, lggr logger.Logger, logLevel zapcore.Level, config MemoryEnvironmentConfig) deployment.Environment { + chains := NewMemoryChains(t, config.Chains) + nodes := NewNodes(t, logLevel, chains, config.Nodes, config.Bootstraps, config.RegistryConfig) + var nodeIDs []string + for id := range nodes { + nodeIDs = append(nodeIDs, id) + } + return deployment.Environment{ + Name: Memory, + Offchain: NewMemoryJobClient(nodes), + NodeIDs: nodeIDs, + Chains: chains, + Logger: lggr, + } +} diff --git a/integration-tests/deployment/memory/job_client.go b/integration-tests/deployment/memory/job_client.go new file mode 100644 index 00000000000..25fec711d81 --- /dev/null +++ b/integration-tests/deployment/memory/job_client.go @@ -0,0 +1,161 @@ +package memory + +import ( + "context" + "strconv" + + "github.com/ethereum/go-ethereum/common" + "google.golang.org/grpc" + + csav1 "github.com/smartcontractkit/chainlink/integration-tests/deployment/jd/csa/v1" + jobv1 "github.com/smartcontractkit/chainlink/integration-tests/deployment/jd/job/v1" + nodev1 "github.com/smartcontractkit/chainlink/integration-tests/deployment/jd/node/v1" + "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/validate" +) + +type JobClient struct { + Nodes map[string]Node +} + +func (j JobClient) UpdateJob(ctx context.Context, in *jobv1.UpdateJobRequest, opts ...grpc.CallOption) (*jobv1.UpdateJobResponse, error) { + //TODO CCIP-3108 implement me + panic("implement me") +} + +func (j JobClient) DisableNode(ctx context.Context, in *nodev1.DisableNodeRequest, opts ...grpc.CallOption) (*nodev1.DisableNodeResponse, error) { + //TODO CCIP-3108 implement me + panic("implement me") +} + +func (j JobClient) EnableNode(ctx context.Context, in *nodev1.EnableNodeRequest, opts ...grpc.CallOption) (*nodev1.EnableNodeResponse, error) { + //TODO CCIP-3108 implement me + panic("implement me") +} + +func (j JobClient) RegisterNode(ctx context.Context, in *nodev1.RegisterNodeRequest, opts ...grpc.CallOption) (*nodev1.RegisterNodeResponse, error) { + //TODO implement me + panic("implement me") +} + +func (j JobClient) UpdateNode(ctx context.Context, in *nodev1.UpdateNodeRequest, opts ...grpc.CallOption) (*nodev1.UpdateNodeResponse, error) { + //TODO CCIP-3108 implement me + panic("implement me") +} + +func (j JobClient) GetKeypair(ctx context.Context, in *csav1.GetKeypairRequest, opts ...grpc.CallOption) (*csav1.GetKeypairResponse, error) { + //TODO implement me + panic("implement me") +} + +func (j JobClient) ListKeypairs(ctx context.Context, in *csav1.ListKeypairsRequest, opts ...grpc.CallOption) (*csav1.ListKeypairsResponse, error) { + //TODO CCIP-3108 implement me + panic("implement me") +} + +func (j JobClient) GetNode(ctx context.Context, in *nodev1.GetNodeRequest, opts ...grpc.CallOption) (*nodev1.GetNodeResponse, error) { + //TODO CCIP-3108 implement me + panic("implement me") +} + +func (j JobClient) ListNodes(ctx context.Context, in *nodev1.ListNodesRequest, opts ...grpc.CallOption) (*nodev1.ListNodesResponse, error) { + //TODO CCIP-3108 implement me + panic("implement me") +} + +func (j JobClient) ListNodeChainConfigs(ctx context.Context, in *nodev1.ListNodeChainConfigsRequest, opts ...grpc.CallOption) (*nodev1.ListNodeChainConfigsResponse, error) { + n := j.Nodes[in.Filter.NodeIds[0]] + offpk := n.Keys.OCRKeyBundle.OffchainPublicKey() + cpk := n.Keys.OCRKeyBundle.ConfigEncryptionPublicKey() + var chainConfigs []*nodev1.ChainConfig + for evmChainID, transmitter := range n.Keys.TransmittersByEVMChainID { + chainConfigs = append(chainConfigs, &nodev1.ChainConfig{ + Chain: &nodev1.Chain{ + Id: strconv.Itoa(int(evmChainID)), + Type: nodev1.ChainType_CHAIN_TYPE_EVM, + }, + AccountAddress: transmitter.String(), + AdminAddress: "", + Ocr1Config: nil, + Ocr2Config: &nodev1.OCR2Config{ + Enabled: true, + IsBootstrap: n.IsBoostrap, + P2PKeyBundle: &nodev1.OCR2Config_P2PKeyBundle{ + PeerId: n.Keys.PeerID.String(), + }, + OcrKeyBundle: &nodev1.OCR2Config_OCRKeyBundle{ + BundleId: n.Keys.OCRKeyBundle.ID(), + ConfigPublicKey: common.Bytes2Hex(cpk[:]), + OffchainPublicKey: common.Bytes2Hex(offpk[:]), + OnchainSigningAddress: n.Keys.OCRKeyBundle.OnChainPublicKey(), + }, + Multiaddr: n.Addr.String(), + Plugins: nil, + ForwarderAddress: ptr(""), + }, + }) + } + + // TODO: I think we can pull it from the feeds manager. + return &nodev1.ListNodeChainConfigsResponse{ + ChainConfigs: chainConfigs, + }, nil +} + +func (j JobClient) GetJob(ctx context.Context, in *jobv1.GetJobRequest, opts ...grpc.CallOption) (*jobv1.GetJobResponse, error) { + //TODO CCIP-3108 implement me + panic("implement me") +} + +func (j JobClient) GetProposal(ctx context.Context, in *jobv1.GetProposalRequest, opts ...grpc.CallOption) (*jobv1.GetProposalResponse, error) { + //TODO CCIP-3108 implement me + panic("implement me") +} + +func (j JobClient) ListJobs(ctx context.Context, in *jobv1.ListJobsRequest, opts ...grpc.CallOption) (*jobv1.ListJobsResponse, error) { + //TODO CCIP-3108 implement me + panic("implement me") +} + +func (j JobClient) ListProposals(ctx context.Context, in *jobv1.ListProposalsRequest, opts ...grpc.CallOption) (*jobv1.ListProposalsResponse, error) { + //TODO CCIP-3108 implement me + panic("implement me") +} + +func (j JobClient) ProposeJob(ctx context.Context, in *jobv1.ProposeJobRequest, opts ...grpc.CallOption) (*jobv1.ProposeJobResponse, error) { + n := j.Nodes[in.NodeId] + // TODO: Use FMS + jb, err := validate.ValidatedCCIPSpec(in.Spec) + if err != nil { + return nil, err + } + err = n.App.AddJobV2(ctx, &jb) + if err != nil { + return nil, err + } + return &jobv1.ProposeJobResponse{Proposal: &jobv1.Proposal{ + Id: "", + // Auto approve for now + Status: jobv1.ProposalStatus_PROPOSAL_STATUS_APPROVED, + DeliveryStatus: jobv1.ProposalDeliveryStatus_PROPOSAL_DELIVERY_STATUS_DELIVERED, + Spec: in.Spec, + JobId: jb.ExternalJobID.String(), + CreatedAt: nil, + UpdatedAt: nil, + AckedAt: nil, + ResponseReceivedAt: nil, + }}, nil +} + +func (j JobClient) RevokeJob(ctx context.Context, in *jobv1.RevokeJobRequest, opts ...grpc.CallOption) (*jobv1.RevokeJobResponse, error) { + //TODO CCIP-3108 implement me + panic("implement me") +} + +func (j JobClient) DeleteJob(ctx context.Context, in *jobv1.DeleteJobRequest, opts ...grpc.CallOption) (*jobv1.DeleteJobResponse, error) { + //TODO CCIP-3108 implement me + panic("implement me") +} + +func NewMemoryJobClient(nodesByPeerID map[string]Node) *JobClient { + return &JobClient{nodesByPeerID} +} diff --git a/integration-tests/deployment/memory/node.go b/integration-tests/deployment/memory/node.go new file mode 100644 index 00000000000..1befa38dc69 --- /dev/null +++ b/integration-tests/deployment/memory/node.go @@ -0,0 +1,291 @@ +package memory + +import ( + "context" + "fmt" + "math/big" + "net" + "net/http" + "strconv" + "testing" + "time" + + "github.com/ethereum/go-ethereum/common" + gethtypes "github.com/ethereum/go-ethereum/core/types" + chainsel "github.com/smartcontractkit/chain-selectors" + "github.com/stretchr/testify/require" + "go.uber.org/zap/zapcore" + + coretypes "github.com/smartcontractkit/chainlink-common/pkg/types/core/mocks" + + "github.com/smartcontractkit/chainlink-common/pkg/config" + "github.com/smartcontractkit/chainlink-common/pkg/loop" + "github.com/smartcontractkit/chainlink-common/pkg/utils/mailbox" + + "github.com/smartcontractkit/chainlink/integration-tests/deployment" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" + v2toml "github.com/smartcontractkit/chainlink/v2/core/chains/evm/config/toml" + evmutils "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils/big" + "github.com/smartcontractkit/chainlink/v2/core/chains/legacyevm" + configv2 "github.com/smartcontractkit/chainlink/v2/core/config/toml" + "github.com/smartcontractkit/chainlink/v2/core/logger" + "github.com/smartcontractkit/chainlink/v2/core/logger/audit" + "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" + "github.com/smartcontractkit/chainlink/v2/core/services/keystore" + "github.com/smartcontractkit/chainlink/v2/core/services/keystore/chaintype" + "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ocr2key" + "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" + "github.com/smartcontractkit/chainlink/v2/core/services/relay" + "github.com/smartcontractkit/chainlink/v2/core/utils" + "github.com/smartcontractkit/chainlink/v2/core/utils/testutils/heavyweight" + "github.com/smartcontractkit/chainlink/v2/plugins" +) + +func Context(tb testing.TB) context.Context { + ctx := context.Background() + var cancel func() + switch t := tb.(type) { + case *testing.T: + if d, ok := t.Deadline(); ok { + ctx, cancel = context.WithDeadline(ctx, d) + } + } + if cancel == nil { + ctx, cancel = context.WithCancel(ctx) + } + tb.Cleanup(cancel) + return ctx +} + +type Node struct { + App chainlink.Application + // Transmitter key/OCR keys for this node + Keys Keys + Addr net.TCPAddr + IsBoostrap bool +} + +func (n Node) ReplayLogs(chains map[uint64]uint64) error { + for sel, block := range chains { + chainID, _ := chainsel.ChainIdFromSelector(sel) + if err := n.App.ReplayFromBlock(big.NewInt(int64(chainID)), block, false); err != nil { + return err + } + } + return nil +} + +// Creates a CL node which is: +// - Configured for OCR +// - Configured for the chains specified +// - Transmitter keys funded. +func NewNode( + t *testing.T, + port int, // Port for the P2P V2 listener. + chains map[uint64]EVMChain, + logLevel zapcore.Level, + bootstrap bool, + registryConfig deployment.CapabilityRegistryConfig, +) *Node { + // Do not want to load fixtures as they contain a dummy chainID. + // Create database and initial configuration. + cfg, db := heavyweight.FullTestDBNoFixturesV2(t, func(c *chainlink.Config, s *chainlink.Secrets) { + c.Insecure.OCRDevelopmentMode = ptr(true) // Disables ocr spec validation so we can have fast polling for the test. + + c.Feature.LogPoller = ptr(true) + + // P2P V2 configs. + c.P2P.V2.Enabled = ptr(true) + c.P2P.V2.DeltaDial = config.MustNewDuration(500 * time.Millisecond) + c.P2P.V2.DeltaReconcile = config.MustNewDuration(5 * time.Second) + c.P2P.V2.ListenAddresses = &[]string{fmt.Sprintf("127.0.0.1:%d", port)} + + // Enable Capabilities, This is a pre-requisite for registrySyncer to work. + if registryConfig.Contract != common.HexToAddress("0x0") { + c.Capabilities.ExternalRegistry.NetworkID = ptr(relay.NetworkEVM) + c.Capabilities.ExternalRegistry.ChainID = ptr(strconv.FormatUint(uint64(registryConfig.EVMChainID), 10)) + c.Capabilities.ExternalRegistry.Address = ptr(registryConfig.Contract.String()) + } + + // OCR configs + c.OCR.Enabled = ptr(false) + c.OCR.DefaultTransactionQueueDepth = ptr(uint32(200)) + c.OCR2.Enabled = ptr(true) + c.OCR2.ContractPollInterval = config.MustNewDuration(5 * time.Second) + + c.Log.Level = ptr(configv2.LogLevel(logLevel)) + + var chainConfigs v2toml.EVMConfigs + for chainID := range chains { + chainConfigs = append(chainConfigs, createConfigV2Chain(chainID)) + } + c.EVM = chainConfigs + }) + + // Set logging. + lggr := logger.TestLogger(t) + lggr.SetLogLevel(logLevel) + + // Create clients for the core node backed by sim. + clients := make(map[uint64]client.Client) + for chainID, chain := range chains { + clients[chainID] = client.NewSimulatedBackendClient(t, chain.Backend, big.NewInt(int64(chainID))) + } + + // Create keystore + master := keystore.New(db, utils.FastScryptParams, lggr) + kStore := KeystoreSim{ + eks: &EthKeystoreSim{ + Eth: master.Eth(), + }, + csa: master.CSA(), + } + + // Build evm factory using clients + keystore. + mailMon := mailbox.NewMonitor("node", lggr.Named("mailbox")) + evmOpts := chainlink.EVMFactoryConfig{ + ChainOpts: legacyevm.ChainOpts{ + AppConfig: cfg, + GenEthClient: func(i *big.Int) client.Client { + ethClient, ok := clients[i.Uint64()] + if !ok { + t.Fatal("no backend for chainID", i) + } + return ethClient + }, + MailMon: mailMon, + DS: db, + }, + CSAETHKeystore: kStore, + } + + // Build relayer factory with EVM. + relayerFactory := chainlink.RelayerFactory{ + Logger: lggr, + LoopRegistry: plugins.NewLoopRegistry(lggr.Named("LoopRegistry"), cfg.Tracing(), cfg.Telemetry()), + GRPCOpts: loop.GRPCOpts{}, + CapabilitiesRegistry: coretypes.NewCapabilitiesRegistry(t), + } + initOps := []chainlink.CoreRelayerChainInitFunc{chainlink.InitEVM(context.Background(), relayerFactory, evmOpts)} + rci, err := chainlink.NewCoreRelayerChainInteroperators(initOps...) + require.NoError(t, err) + + app, err := chainlink.NewApplication(chainlink.ApplicationOpts{ + Config: cfg, + DS: db, + KeyStore: master, + RelayerChainInteroperators: rci, + Logger: lggr, + ExternalInitiatorManager: nil, + CloseLogger: lggr.Sync, + UnrestrictedHTTPClient: &http.Client{}, + RestrictedHTTPClient: &http.Client{}, + AuditLogger: audit.NoopLogger, + MailMon: mailMon, + LoopRegistry: plugins.NewLoopRegistry(lggr, cfg.Tracing(), cfg.Telemetry()), + }) + require.NoError(t, err) + t.Cleanup(func() { + require.NoError(t, db.Close()) + }) + keys := CreateKeys(t, app, chains) + + return &Node{ + App: app, + Keys: keys, + Addr: net.TCPAddr{IP: net.ParseIP("127.0.0.1"), Port: port}, + IsBoostrap: bootstrap, + } +} + +type Keys struct { + PeerID p2pkey.PeerID + TransmittersByEVMChainID map[uint64]common.Address + OCRKeyBundle ocr2key.KeyBundle +} + +func CreateKeys(t *testing.T, + app chainlink.Application, chains map[uint64]EVMChain) Keys { + ctx := Context(t) + require.NoError(t, app.GetKeyStore().Unlock(ctx, "password")) + _, err := app.GetKeyStore().P2P().Create(ctx) + require.NoError(t, err) + + p2pIDs, err := app.GetKeyStore().P2P().GetAll() + require.NoError(t, err) + require.Len(t, p2pIDs, 1) + peerID := p2pIDs[0].PeerID() + // create a transmitter for each chain + transmitters := make(map[uint64]common.Address) + for chainID, chain := range chains { + cid := big.NewInt(int64(chainID)) + addrs, err2 := app.GetKeyStore().Eth().EnabledAddressesForChain(Context(t), cid) + require.NoError(t, err2) + if len(addrs) == 1 { + // just fund the address + fundAddress(t, chain.DeployerKey, addrs[0], assets.Ether(10).ToInt(), chain.Backend) + transmitters[chainID] = addrs[0] + } else { + // create key and fund it + _, err3 := app.GetKeyStore().Eth().Create(Context(t), cid) + require.NoError(t, err3, "failed to create key for chain", chainID) + sendingKeys, err3 := app.GetKeyStore().Eth().EnabledAddressesForChain(Context(t), cid) + require.NoError(t, err3) + require.Len(t, sendingKeys, 1) + fundAddress(t, chain.DeployerKey, sendingKeys[0], assets.Ether(10).ToInt(), chain.Backend) + transmitters[chainID] = sendingKeys[0] + } + } + require.Len(t, transmitters, len(chains)) + + keybundle, err := app.GetKeyStore().OCR2().Create(ctx, chaintype.EVM) + require.NoError(t, err) + return Keys{ + PeerID: peerID, + TransmittersByEVMChainID: transmitters, + OCRKeyBundle: keybundle, + } +} + +func createConfigV2Chain(chainID uint64) *v2toml.EVMConfig { + chainIDBig := evmutils.NewI(int64(chainID)) + chain := v2toml.Defaults(chainIDBig) + chain.GasEstimator.LimitDefault = ptr(uint64(5e6)) + chain.LogPollInterval = config.MustNewDuration(500 * time.Millisecond) + chain.Transactions.ForwardersEnabled = ptr(false) + chain.FinalityDepth = ptr(uint32(2)) + return &v2toml.EVMConfig{ + ChainID: chainIDBig, + Enabled: ptr(true), + Chain: chain, + Nodes: v2toml.EVMNodes{&v2toml.Node{}}, + } +} + +func ptr[T any](v T) *T { return &v } + +var _ keystore.Eth = &EthKeystoreSim{} + +type EthKeystoreSim struct { + keystore.Eth +} + +// override +func (e *EthKeystoreSim) SignTx(ctx context.Context, address common.Address, tx *gethtypes.Transaction, chainID *big.Int) (*gethtypes.Transaction, error) { + // always sign with chain id 1337 for the simulated backend + return e.Eth.SignTx(ctx, address, tx, big.NewInt(1337)) +} + +type KeystoreSim struct { + eks keystore.Eth + csa keystore.CSA +} + +func (e KeystoreSim) Eth() keystore.Eth { + return e.eks +} + +func (e KeystoreSim) CSA() keystore.CSA { + return e.csa +} diff --git a/integration-tests/deployment/memory/node_test.go b/integration-tests/deployment/memory/node_test.go new file mode 100644 index 00000000000..4a791bfc1fb --- /dev/null +++ b/integration-tests/deployment/memory/node_test.go @@ -0,0 +1,25 @@ +package memory + +import ( + "testing" + + "github.com/hashicorp/consul/sdk/freeport" + "github.com/stretchr/testify/require" + "go.uber.org/zap/zapcore" + + "github.com/smartcontractkit/chainlink/integration-tests/deployment" +) + +func TestNode(t *testing.T) { + chains := GenerateChains(t, 3) + ports := freeport.GetN(t, 1) + node := NewNode(t, ports[0], chains, zapcore.DebugLevel, false, deployment.CapabilityRegistryConfig{}) + // We expect 3 transmitter keys + keys, err := node.App.GetKeyStore().Eth().GetAll(Context(t)) + require.NoError(t, err) + require.Len(t, keys, 3) + // We expect 3 chains supported + evmChains := node.App.GetRelayers().LegacyEVMChains().Slice() + require.NoError(t, err) + require.Len(t, evmChains, 3) +} diff --git a/integration-tests/deployment/multiclient.go b/integration-tests/deployment/multiclient.go new file mode 100644 index 00000000000..02a18f760df --- /dev/null +++ b/integration-tests/deployment/multiclient.go @@ -0,0 +1,124 @@ +package deployment + +import ( + "context" + "fmt" + "math/big" + "time" + + "github.com/avast/retry-go/v4" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/ethclient" + "github.com/pkg/errors" +) + +const ( + RPC_DEFAULT_RETRY_ATTEMPTS = 10 + RPC_DEFAULT_RETRY_DELAY = 1000 * time.Millisecond +) + +type RetryConfig struct { + Attempts uint + Delay time.Duration +} + +func defaultRetryConfig() RetryConfig { + return RetryConfig{ + Attempts: RPC_DEFAULT_RETRY_ATTEMPTS, + Delay: RPC_DEFAULT_RETRY_DELAY, + } +} + +type RPC struct { + WSURL string + // TODO: http fallback needed for some networks? +} + +// MultiClient should comply with the OnchainClient interface +var _ OnchainClient = &MultiClient{} + +type MultiClient struct { + *ethclient.Client + Backups []*ethclient.Client + RetryConfig RetryConfig +} + +func NewMultiClient(rpcs []RPC, opts ...func(client *MultiClient)) (*MultiClient, error) { + if len(rpcs) == 0 { + return nil, fmt.Errorf("No RPCs provided, need at least one") + } + var mc MultiClient + clients := make([]*ethclient.Client, 0, len(rpcs)) + for _, rpc := range rpcs { + client, err := ethclient.Dial(rpc.WSURL) + if err != nil { + return nil, errors.Wrapf(err, "failed to dial %s", rpc.WSURL) + } + clients = append(clients, client) + } + mc.Client = clients[0] + mc.Backups = clients[1:] + mc.RetryConfig = defaultRetryConfig() + + for _, opt := range opts { + opt(&mc) + } + return &mc, nil +} + +func (mc *MultiClient) TransactionReceipt(ctx context.Context, txHash common.Hash) (*types.Receipt, error) { + var receipt *types.Receipt + err := mc.retryWithBackups(func(client *ethclient.Client) error { + var err error + receipt, err = client.TransactionReceipt(ctx, txHash) + return err + }) + return receipt, err +} + +func (mc *MultiClient) SendTransaction(ctx context.Context, tx *types.Transaction) error { + return mc.retryWithBackups(func(client *ethclient.Client) error { + return client.SendTransaction(ctx, tx) + }) +} + +func (mc *MultiClient) CodeAt(ctx context.Context, account common.Address, blockNumber *big.Int) ([]byte, error) { + var code []byte + err := mc.retryWithBackups(func(client *ethclient.Client) error { + var err error + code, err = client.CodeAt(ctx, account, blockNumber) + return err + }) + return code, err +} + +func (mc *MultiClient) NonceAt(ctx context.Context, account common.Address) (uint64, error) { + var count uint64 + err := mc.retryWithBackups(func(client *ethclient.Client) error { + var err error + count, err = client.NonceAt(ctx, account, nil) + return err + }) + return count, err +} + +func (mc *MultiClient) retryWithBackups(op func(*ethclient.Client) error) error { + var err error + for _, client := range append([]*ethclient.Client{mc.Client}, mc.Backups...) { + err2 := retry.Do(func() error { + err = op(client) + if err != nil { + // TODO: logger? + fmt.Printf("Error %v with client %v\n", err, client) + return err + } + return nil + }, retry.Attempts(mc.RetryConfig.Attempts), retry.Delay(mc.RetryConfig.Delay)) + if err2 == nil { + return nil + } + fmt.Printf("Client %v failed, trying next client\n", client) + } + return errors.Wrapf(err, "All backup clients %v failed", mc.Backups) +} diff --git a/integration-tests/deployment/multiclient_test.go b/integration-tests/deployment/multiclient_test.go new file mode 100644 index 00000000000..a3176691c0c --- /dev/null +++ b/integration-tests/deployment/multiclient_test.go @@ -0,0 +1,36 @@ +package deployment + +import ( + "net/http" + "net/http/httptest" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func TestMultiClient(t *testing.T) { + // Expect an error if no RPCs supplied. + s := httptest.NewServer(http.HandlerFunc(func(writer http.ResponseWriter, request *http.Request) { + writer.WriteHeader(http.StatusOK) + _, err := writer.Write([]byte(`{"jsonrpc":"2.0","id":1,"result":true}`)) + require.NoError(t, err) + })) + defer s.Close() + _, err := NewMultiClient([]RPC{}) + require.Error(t, err) + + // Expect defaults to be set if not provided. + mc, err := NewMultiClient([]RPC{{WSURL: s.URL}}) + require.NoError(t, err) + assert.Equal(t, mc.RetryConfig.Attempts, uint(RPC_DEFAULT_RETRY_ATTEMPTS)) + assert.Equal(t, mc.RetryConfig.Delay, RPC_DEFAULT_RETRY_DELAY) + + // Expect second client to be set as backup. + mc, err = NewMultiClient([]RPC{ + {WSURL: s.URL}, + {WSURL: s.URL}, + }) + require.NoError(t, err) + require.Equal(t, len(mc.Backups), 1) +} diff --git a/integration-tests/docker/cmd/internal/commands.go b/integration-tests/docker/cmd/internal/commands.go index 9939765f7f8..bd9d505a7e3 100644 --- a/integration-tests/docker/cmd/internal/commands.go +++ b/integration-tests/docker/cmd/internal/commands.go @@ -8,8 +8,8 @@ import ( "github.com/rs/zerolog/log" "github.com/spf13/cobra" - ctf_test_env "github.com/smartcontractkit/chainlink-testing-framework/docker/test_env" - "github.com/smartcontractkit/chainlink-testing-framework/logging" + ctf_test_env "github.com/smartcontractkit/chainlink-testing-framework/lib/docker/test_env" + "github.com/smartcontractkit/chainlink-testing-framework/lib/logging" "github.com/smartcontractkit/chainlink/integration-tests/docker/test_env" "github.com/smartcontractkit/chainlink/integration-tests/testconfig" ) diff --git a/integration-tests/docker/test_env/cl_node.go b/integration-tests/docker/test_env/cl_node.go index b28d954688a..02179403acb 100644 --- a/integration-tests/docker/test_env/cl_node.go +++ b/integration-tests/docker/test_env/cl_node.go @@ -21,11 +21,11 @@ import ( tc "github.com/testcontainers/testcontainers-go" tcwait "github.com/testcontainers/testcontainers-go/wait" - "github.com/smartcontractkit/chainlink-testing-framework/docker" - "github.com/smartcontractkit/chainlink-testing-framework/docker/test_env" - "github.com/smartcontractkit/chainlink-testing-framework/logging" - "github.com/smartcontractkit/chainlink-testing-framework/logstream" - "github.com/smartcontractkit/chainlink-testing-framework/utils/testcontext" + "github.com/smartcontractkit/chainlink-testing-framework/lib/docker" + "github.com/smartcontractkit/chainlink-testing-framework/lib/docker/test_env" + "github.com/smartcontractkit/chainlink-testing-framework/lib/logging" + "github.com/smartcontractkit/chainlink-testing-framework/lib/logstream" + "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/testcontext" "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" "github.com/smartcontractkit/chainlink/v2/core/services/keystore/chaintype" @@ -33,11 +33,13 @@ import ( "github.com/smartcontractkit/chainlink/integration-tests/client" it_utils "github.com/smartcontractkit/chainlink/integration-tests/utils" "github.com/smartcontractkit/chainlink/integration-tests/utils/templates" + grapqlClient "github.com/smartcontractkit/chainlink/integration-tests/web/sdk/client" ) var ( - ErrConnectNodeClient = "could not connect Node HTTP Client" - ErrStartCLNodeContainer = "failed to start CL node container" + ErrConnectNodeClient = "could not connect Node HTTP Client" + ErrConnectNodeGraphqlClient = "could not connect Node Graphql Client" + ErrStartCLNodeContainer = "failed to start CL node container" ) const ( @@ -54,6 +56,7 @@ type ClNode struct { UserEmail string `json:"userEmail"` UserPassword string `json:"userPassword"` AlwaysPullImage bool `json:"-"` + GraphqlAPI grapqlClient.Client `json:"-"` t *testing.T l zerolog.Logger } @@ -339,19 +342,25 @@ func (n *ClNode) containerStartOrRestart(restartDb bool) error { Str("userEmail", n.UserEmail). Str("userPassword", n.UserPassword). Msg("Started Chainlink Node container") - clClient, err := client.NewChainlinkClient(&client.ChainlinkConfig{ + config := &client.ChainlinkConfig{ URL: clEndpoint, Email: n.UserEmail, Password: n.UserPassword, InternalIP: ip, - }, - n.l) + } + clClient, err := client.NewChainlinkClient(config, n.l) if err != nil { return fmt.Errorf("%s err: %w", ErrConnectNodeClient, err) } + graphqlClient, err := newChainLinkGraphqlClient(config) + if err != nil { + return fmt.Errorf("%s err: %w", ErrConnectNodeGraphqlClient, err) + } + n.Container = container n.API = clClient + n.GraphqlAPI = graphqlClient return nil } @@ -491,3 +500,11 @@ func (n *ClNode) getContainerRequest(secrets string) ( }, }, nil } + +func newChainLinkGraphqlClient(c *client.ChainlinkConfig) (grapqlClient.Client, error) { + nodeClient, err := grapqlClient.New(c.URL, grapqlClient.Credentials{Email: c.Email, Password: c.Password}) + if err != nil { + return nil, err + } + return nodeClient, nil +} diff --git a/integration-tests/docker/test_env/test_env.go b/integration-tests/docker/test_env/test_env.go index fb72025a05a..52ed5d9b680 100644 --- a/integration-tests/docker/test_env/test_env.go +++ b/integration-tests/docker/test_env/test_env.go @@ -13,13 +13,13 @@ import ( "github.com/rs/zerolog/log" tc "github.com/testcontainers/testcontainers-go" - "github.com/smartcontractkit/chainlink-testing-framework/blockchain" - ctf_config "github.com/smartcontractkit/chainlink-testing-framework/config" - "github.com/smartcontractkit/chainlink-testing-framework/docker" - "github.com/smartcontractkit/chainlink-testing-framework/docker/test_env" - "github.com/smartcontractkit/chainlink-testing-framework/logging" - "github.com/smartcontractkit/chainlink-testing-framework/logstream" - "github.com/smartcontractkit/chainlink-testing-framework/utils/runid" + "github.com/smartcontractkit/chainlink-testing-framework/lib/blockchain" + ctf_config "github.com/smartcontractkit/chainlink-testing-framework/lib/config" + "github.com/smartcontractkit/chainlink-testing-framework/lib/docker" + "github.com/smartcontractkit/chainlink-testing-framework/lib/docker/test_env" + "github.com/smartcontractkit/chainlink-testing-framework/lib/logging" + "github.com/smartcontractkit/chainlink-testing-framework/lib/logstream" + "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/runid" "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" d "github.com/smartcontractkit/chainlink/integration-tests/docker" diff --git a/integration-tests/docker/test_env/test_env_builder.go b/integration-tests/docker/test_env/test_env_builder.go index 19ab64671e8..bd3a458165c 100644 --- a/integration-tests/docker/test_env/test_env_builder.go +++ b/integration-tests/docker/test_env/test_env_builder.go @@ -3,26 +3,30 @@ package test_env import ( "fmt" "os" + "path/filepath" "slices" "strings" "testing" + "time" "github.com/rs/zerolog" "github.com/rs/zerolog/log" - "go.uber.org/zap/zapcore" - "github.com/smartcontractkit/chainlink-testing-framework/blockchain" - ctf_config "github.com/smartcontractkit/chainlink-testing-framework/config" - "github.com/smartcontractkit/chainlink-testing-framework/docker/test_env" - "github.com/smartcontractkit/chainlink-testing-framework/logging" - "github.com/smartcontractkit/chainlink-testing-framework/logstream" - "github.com/smartcontractkit/chainlink-testing-framework/networks" - "github.com/smartcontractkit/chainlink-testing-framework/testreporters" - "github.com/smartcontractkit/chainlink-testing-framework/utils/osutil" - "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" + "github.com/smartcontractkit/chainlink-testing-framework/seth" + + "github.com/smartcontractkit/chainlink-testing-framework/lib/blockchain" + ctf_config "github.com/smartcontractkit/chainlink-testing-framework/lib/config" + "github.com/smartcontractkit/chainlink-testing-framework/lib/docker/test_env" + "github.com/smartcontractkit/chainlink-testing-framework/lib/logging" + "github.com/smartcontractkit/chainlink-testing-framework/lib/logstream" + "github.com/smartcontractkit/chainlink-testing-framework/lib/networks" + "github.com/smartcontractkit/chainlink-testing-framework/lib/testreporters" + "github.com/smartcontractkit/chainlink-testing-framework/lib/testsummary" + "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/osutil" "github.com/smartcontractkit/chainlink/integration-tests/types/config/node" + "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" ) type CleanUpType string @@ -255,7 +259,7 @@ func (b *CLTestEnvBuilder) Build() (*CLClusterTestEnv, error) { b.t.Cleanup(func() { b.l.Info().Msg("Shutting down LogStream") logPath, err := osutil.GetAbsoluteFolderPath("logs") - if err != nil { + if err == nil { b.l.Info().Str("Absolute path", logPath).Msg("LogStream logs folder location") } @@ -280,6 +284,10 @@ func (b *CLTestEnvBuilder) Build() (*CLClusterTestEnv, error) { // new logs can be added to the log stream, so parallel processing would get stuck on waiting for it to be unlocked LogScanningLoop: for i := 0; i < b.clNodesCount; i++ { + // if something went wrong during environment setup we might not have all nodes, and we don't want an NPE + if b == nil || b.te == nil || b.te.ClCluster == nil || b.te.ClCluster.Nodes == nil || len(b.te.ClCluster.Nodes)-1 < i || b.te.ClCluster.Nodes[i] == nil { + continue + } // ignore count return, because we are only interested in the error _, err := logProcessor.ProcessContainerLogs(b.te.ClCluster.Nodes[i].ContainerName, processFn) if err != nil && !strings.Contains(err.Error(), testreporters.MultipleLogsAtLogLevelErr) && !strings.Contains(err.Error(), testreporters.OneLogAtLogLevelErr) { @@ -304,6 +312,47 @@ func (b *CLTestEnvBuilder) Build() (*CLClusterTestEnv, error) { b.te.LogStream.SaveLogLocationInTestSummary() } b.l.Info().Msg("Finished shutting down LogStream") + + if b.t.Failed() || *b.testConfig.GetLoggingConfig().TestLogCollect { + b.l.Info().Msg("Dump state of all Postgres DBs used by Chainlink Nodes") + + dbDumpFolder := "db_dumps" + dbDumpPath := fmt.Sprintf("%s/%s-%s", dbDumpFolder, b.t.Name(), time.Now().Format("2006-01-02T15-04-05")) + if err := os.MkdirAll(dbDumpPath, os.ModePerm); err != nil { + b.l.Error().Err(err).Msg("Error creating folder for Postgres DB dump") + return + } + + absDbDumpPath, err := osutil.GetAbsoluteFolderPath(dbDumpFolder) + if err == nil { + b.l.Info().Str("Absolute path", absDbDumpPath).Msg("PostgresDB dump folder location") + } + + for i := 0; i < b.clNodesCount; i++ { + // if something went wrong during environment setup we might not have all nodes, and we don't want an NPE + if b == nil || b.te == nil || b.te.ClCluster == nil || b.te.ClCluster.Nodes == nil || len(b.te.ClCluster.Nodes)-1 < i || b.te.ClCluster.Nodes[i] == nil || b.te.ClCluster.Nodes[i].PostgresDb == nil { + continue + } + + filePath := filepath.Join(dbDumpPath, fmt.Sprintf("postgres_db_dump_%s.sql", b.te.ClCluster.Nodes[i].ContainerName)) + localDbDumpFile, err := os.Create(filePath) + if err != nil { + b.l.Error().Err(err).Msg("Error creating localDbDumpFile for Postgres DB dump") + _ = localDbDumpFile.Close() + continue + } + + if err := b.te.ClCluster.Nodes[i].PostgresDb.ExecPgDumpFromContainer(localDbDumpFile); err != nil { + b.l.Error().Err(err).Msg("Error dumping Postgres DB") + } + _ = localDbDumpFile.Close() + } + b.l.Info().Msg("Finished dumping state of all Postgres DBs used by Chainlink Nodes") + } + + if b.testConfig.GetSethConfig() != nil && ((b.t.Failed() && slices.Contains(b.testConfig.GetSethConfig().TraceOutputs, seth.TraceOutput_DOT) && b.testConfig.GetSethConfig().TracingLevel != seth.TracingLevel_None) || (!b.t.Failed() && slices.Contains(b.testConfig.GetSethConfig().TraceOutputs, seth.TraceOutput_DOT) && b.testConfig.GetSethConfig().TracingLevel == seth.TracingLevel_All)) { + _ = testsummary.AddEntry(b.t.Name(), "dot_graphs", "true") + } }) } else { b.l.Warn().Msg("LogStream won't be cleaned up, because either test instance is not set or cleanup type is set to none") @@ -361,29 +410,29 @@ func (b *CLTestEnvBuilder) Build() (*CLClusterTestEnv, error) { b.te.rpcProviders[networkConfig.ChainID] = &rpcProvider b.te.EVMNetworks = append(b.te.EVMNetworks, &networkConfig) } + if b.clNodesCount > 0 { + dereferrencedEvms := make([]blockchain.EVMNetwork, 0) + for _, en := range b.te.EVMNetworks { + dereferrencedEvms = append(dereferrencedEvms, *en) + } - dereferrencedEvms := make([]blockchain.EVMNetwork, 0) - for _, en := range b.te.EVMNetworks { - dereferrencedEvms = append(dereferrencedEvms, *en) - } - - nodeConfigInToml := b.testConfig.GetNodeConfig() + nodeConfigInToml := b.testConfig.GetNodeConfig() - nodeConfig, _, err := node.BuildChainlinkNodeConfig( - dereferrencedEvms, - nodeConfigInToml.BaseConfigTOML, - nodeConfigInToml.CommonChainConfigTOML, - nodeConfigInToml.ChainConfigTOMLByChainID, - ) - if err != nil { - return nil, err - } + nodeConfig, _, err := node.BuildChainlinkNodeConfig( + dereferrencedEvms, + nodeConfigInToml.BaseConfigTOML, + nodeConfigInToml.CommonChainConfigTOML, + nodeConfigInToml.ChainConfigTOMLByChainID, + ) + if err != nil { + return nil, err + } - err = b.te.StartClCluster(nodeConfig, b.clNodesCount, b.secretsConfig, b.testConfig, b.clNodesOpts...) - if err != nil { - return nil, err + err = b.te.StartClCluster(nodeConfig, b.clNodesCount, b.secretsConfig, b.testConfig, b.clNodesOpts...) + if err != nil { + return nil, err + } } - b.te.isSimulatedNetwork = true return b.te, nil diff --git a/integration-tests/docker/test_env/test_env_config.go b/integration-tests/docker/test_env/test_env_config.go index 9aefa9615c9..b29cc3e8b56 100644 --- a/integration-tests/docker/test_env/test_env_config.go +++ b/integration-tests/docker/test_env/test_env_config.go @@ -3,7 +3,7 @@ package test_env import ( "encoding/json" - ctf_config "github.com/smartcontractkit/chainlink-testing-framework/config" + ctf_config "github.com/smartcontractkit/chainlink-testing-framework/lib/config" env "github.com/smartcontractkit/chainlink/integration-tests/types/envcommon" ) diff --git a/integration-tests/docs/VRF.md b/integration-tests/docs/VRF.md new file mode 100644 index 00000000000..745bec05864 --- /dev/null +++ b/integration-tests/docs/VRF.md @@ -0,0 +1,65 @@ +# How To Run VRF Tests +* All test configs should be placed in the [integration-tests/testconfig](../testconfig) folder +* All test configs for running tests in live testnets should be under [integration-tests/testconfig/vrfv2plus/overrides](../testconfig/vrfv2plus/overrides) folder + + +## Functional Tests +### In CI - using On Demand Workflows +```bash +gh workflow run "on-demand-vrfv2plus-smoke-tests.yml" \ +--ref develop \ +-f=test_secrets_override_key= \ +-f test_config_override_path= \ +-f test_suite="Selected Tests" \ # Optional, Options - "All Tests", "Selected Tests". Default is "All Tests". If "Selected Tests" is selected, then `test_list_regex` should be provided +-f test_list_regex="" \ # Optional, default is "TestVRFv2Plus$/(Link_Billing|Native_Billing|Direct_Funding)|TestVRFV2PlusWithBHS" which are P0 tests +-f chainlink_version="<>" # Optional, default is image created from develop branch. Not needed if you run tests against existing environment +-f notify_user_id_on_failure= # Optional, default is empty. If provided, will notify the user on slack if the tests fail +``` + +#### Examples: +Run P0 tests against existing environment (Staging) on Arbitrum Sepolia +```bash +gh workflow run "on-demand-vrfv2plus-smoke-tests.yml" \ +--ref develop \ +-f=test_secrets_override_key= \ +-f test_config_override_path=integration-tests/testconfig/vrfv2plus/overrides/staging/arbitrum_sepolia_staging_test_config.toml \ +-f test_suite="Selected Tests" +``` + +Run all tests deploying all contracts, CL nodes with `2.15.0` version on Base Sepolia +```bash +gh workflow run "on-demand-vrfv2plus-smoke-tests.yml" \ +--ref develop \ +-f=test_secrets_override_key= \ +-f test_config_override_path=integration-tests/testconfig/vrfv2plus/overrides/new_env/base_sepolia_new_env_test_config.toml \ +-f test_suite="All Tests" \ +-f chainlink_version="2.15.0" +``` + +### Locally +```bash +cd integration-tests +TEST_LOG_LEVEL=debug \ +BASE64_CONFIG_OVERRIDE=$(cat | base64) \ +go test -v -timeout 15m -run "" ./smoke +``` + +## Performance Tests +```bash +gh workflow run "on-demand-vrfv2plus-performance-test.yml" \ +--ref develop \ +-f=test_secrets_override_key= \ +-f test_config_override_path= \ +-f performanceTestType=“Smoke” # Options - "Smoke", "Soak", "Stress", "Load". +-f test_list_regex="" # Optional, default is "TestVRFV2PlusPerformance" +``` + +#### Examples: +Run SOAK tests against existing environment (Staging) on Base Sepolia +```bash +gh workflow run "on-demand-vrfv2plus-performance-test.yml" \ +--ref develop \ +-f=test_secrets_override_key= \ +-f test_config_override_path=integration-tests/testconfig/vrfv2plus/overrides/staging/base_sepolia_staging_test_config.toml \ +-f performanceTestType=“Soak” +``` diff --git a/integration-tests/experiments/gas_test.go b/integration-tests/experiments/gas_test.go index 4d1f4597111..42e408a1525 100644 --- a/integration-tests/experiments/gas_test.go +++ b/integration-tests/experiments/gas_test.go @@ -5,12 +5,12 @@ import ( "testing" "time" - seth_utils "github.com/smartcontractkit/chainlink-testing-framework/utils/seth" + seth_utils "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/seth" "github.com/stretchr/testify/require" - "github.com/smartcontractkit/chainlink-testing-framework/logging" - "github.com/smartcontractkit/chainlink-testing-framework/networks" + "github.com/smartcontractkit/chainlink-testing-framework/lib/logging" + "github.com/smartcontractkit/chainlink-testing-framework/lib/networks" "github.com/smartcontractkit/chainlink/integration-tests/actions" "github.com/smartcontractkit/chainlink/integration-tests/contracts" tc "github.com/smartcontractkit/chainlink/integration-tests/testconfig" diff --git a/integration-tests/go.mod b/integration-tests/go.mod index 764f41ed765..2d46e7208d8 100644 --- a/integration-tests/go.mod +++ b/integration-tests/go.mod @@ -1,70 +1,83 @@ module github.com/smartcontractkit/chainlink/integration-tests -go 1.21.7 +go 1.22.5 // Make sure we're working with the latest chainlink libs replace github.com/smartcontractkit/chainlink/v2 => ../ require ( - github.com/avast/retry-go/v4 v4.5.1 + dario.cat/mergo v1.0.1 + github.com/AlekSi/pointer v1.1.0 + github.com/Khan/genqlient v0.7.0 + github.com/Masterminds/semver/v3 v3.2.1 + github.com/avast/retry-go/v4 v4.6.0 + github.com/aws/aws-sdk-go v1.45.25 github.com/barkimedes/go-deepcopy v0.0.0-20220514131651-17c30cfc62df - github.com/chaos-mesh/chaos-mesh/api/v1alpha1 v0.0.0-20220226050744-799408773657 + github.com/chaos-mesh/chaos-mesh/api v0.0.0-20240821051457-da69c6d9617a github.com/cli/go-gh/v2 v2.0.0 github.com/ethereum/go-ethereum v1.13.8 - github.com/fxamacker/cbor/v2 v2.5.0 + github.com/fxamacker/cbor/v2 v2.7.0 github.com/go-resty/resty/v2 v2.11.0 github.com/google/go-cmp v0.6.0 github.com/google/uuid v1.6.0 + github.com/hashicorp/consul/sdk v0.16.0 + github.com/hashicorp/go-multierror v1.1.1 github.com/jmoiron/sqlx v1.4.0 github.com/lib/pq v1.10.9 github.com/manifoldco/promptui v0.9.0 github.com/montanaflynn/stats v0.7.1 - github.com/onsi/gomega v1.30.0 + github.com/onsi/gomega v1.33.1 github.com/pelletier/go-toml/v2 v2.2.2 github.com/pkg/errors v0.9.1 - github.com/rs/zerolog v1.31.0 + github.com/prometheus/common v0.59.1 + github.com/rs/zerolog v1.33.0 github.com/scylladb/go-reflectx v1.0.1 github.com/segmentio/ksuid v1.0.4 - github.com/shopspring/decimal v1.3.1 + github.com/sethvargo/go-retry v0.2.4 + github.com/shopspring/decimal v1.4.0 github.com/slack-go/slack v0.12.2 + github.com/smartcontractkit/ccip-owner-contracts v0.0.0-20240926212305-a6deabdfce86 + github.com/smartcontractkit/chain-selectors v1.0.23 github.com/smartcontractkit/chainlink-automation v1.0.4 - github.com/smartcontractkit/chainlink-common v0.1.7-0.20240709155552-d76403db14e5 - github.com/smartcontractkit/chainlink-testing-framework v1.32.0 - github.com/smartcontractkit/chainlink-testing-framework/grafana v0.0.0-20240405215812-5a72bc9af239 + github.com/smartcontractkit/chainlink-ccip v0.0.0-20240930060710-158d2a9ac9ca + github.com/smartcontractkit/chainlink-common v0.2.3-0.20240927162447-20630b333f57 + github.com/smartcontractkit/chainlink-testing-framework/havoc v1.50.0 + github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.9 + github.com/smartcontractkit/chainlink-testing-framework/lib/grafana v1.50.0 + github.com/smartcontractkit/chainlink-testing-framework/seth v1.50.1 + github.com/smartcontractkit/chainlink-testing-framework/wasp v1.50.0 github.com/smartcontractkit/chainlink/v2 v2.0.0-00010101000000-000000000000 - github.com/smartcontractkit/havoc/k8schaos v0.0.0-20240409145249-e78d20847e37 - github.com/smartcontractkit/libocr v0.0.0-20240702141926-063ceef8c42e - github.com/smartcontractkit/seth v1.0.12 - github.com/smartcontractkit/wasp v0.4.7 - github.com/spf13/cobra v1.8.0 + github.com/smartcontractkit/libocr v0.0.0-20240717100443-f6226e09bee7 + github.com/spf13/cobra v1.8.1 github.com/stretchr/testify v1.9.0 + github.com/subosito/gotenv v1.6.0 github.com/test-go/testify v1.1.4 github.com/testcontainers/testcontainers-go v0.28.0 github.com/umbracle/ethgo v0.1.3 - go.uber.org/zap v1.26.0 - golang.org/x/sync v0.7.0 - golang.org/x/text v0.16.0 + go.uber.org/atomic v1.11.0 + go.uber.org/multierr v1.11.0 + go.uber.org/zap v1.27.0 + golang.org/x/crypto v0.27.0 + golang.org/x/exp v0.0.0-20240909161429-701f63a606c0 + golang.org/x/sync v0.8.0 + golang.org/x/text v0.18.0 + google.golang.org/grpc v1.65.0 + google.golang.org/protobuf v1.34.2 gopkg.in/guregu/null.v4 v4.0.0 - k8s.io/apimachinery v0.28.2 + gotest.tools/v3 v3.5.1 + k8s.io/apimachinery v0.31.0 ) // avoids ambigious imports of indirect dependencies exclude github.com/hashicorp/consul v1.2.1 -replace ( - k8s.io/api => k8s.io/api v0.25.11 - k8s.io/client-go => k8s.io/client-go v0.25.11 - k8s.io/kube-openapi => k8s.io/kube-openapi v0.0.0-20230303024457-afdc3dddf62d -) - require ( contrib.go.opencensus.io/exporter/stackdriver v0.13.5 // indirect cosmossdk.io/api v0.3.1 // indirect cosmossdk.io/core v0.5.1 // indirect - cosmossdk.io/depinject v1.0.0-alpha.3 // indirect - cosmossdk.io/errors v1.0.0 // indirect - cosmossdk.io/math v1.0.1 // indirect - dario.cat/mergo v1.0.0 // indirect + cosmossdk.io/depinject v1.0.0-alpha.4 // indirect + cosmossdk.io/errors v1.0.1 // indirect + cosmossdk.io/math v1.3.0 // indirect filippo.io/edwards25519 v1.1.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.1 // indirect @@ -74,32 +87,49 @@ require ( github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect github.com/Azure/go-ntlmssp v0.0.0-20221128193559-754e69321358 // indirect github.com/AzureAD/microsoft-authentication-library-for-go v1.1.1 // indirect - github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d // indirect + github.com/ChainSafe/go-schnorrkel v1.0.0 // indirect github.com/CosmWasm/wasmd v0.40.1 // indirect github.com/CosmWasm/wasmvm v1.2.4 // indirect github.com/DataDog/zstd v1.5.2 // indirect github.com/MakeNowJust/heredoc v1.0.0 // indirect github.com/Masterminds/goutils v1.1.1 // indirect - github.com/Masterminds/semver/v3 v3.2.1 // indirect github.com/Masterminds/sprig/v3 v3.2.3 // indirect - github.com/Microsoft/go-winio v0.6.1 // indirect - github.com/Microsoft/hcsshim v0.11.4 // indirect + github.com/Microsoft/go-winio v0.6.2 // indirect + github.com/Microsoft/hcsshim v0.11.5 // indirect github.com/NethermindEth/juno v0.3.1 // indirect github.com/NethermindEth/starknet.go v0.7.1-0.20240401080518-34a506f3cfdb // indirect github.com/VictoriaMetrics/fastcache v1.12.1 // indirect github.com/XSAM/otelsql v0.27.0 // indirect - github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 // indirect + github.com/agnivade/levenshtein v1.1.1 // indirect + github.com/alecthomas/units v0.0.0-20240626203959-61d1e3462e30 // indirect + github.com/alexflint/go-arg v1.4.2 // indirect + github.com/alexflint/go-scalar v1.0.0 // indirect github.com/armon/go-metrics v0.4.1 // indirect github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect github.com/avast/retry-go v3.0.0+incompatible // indirect - github.com/aws/aws-sdk-go v1.45.25 // indirect + github.com/awalterschulze/gographviz v2.0.3+incompatible // indirect + github.com/aws/aws-sdk-go-v2 v1.30.4 // indirect + github.com/aws/aws-sdk-go-v2/config v1.27.28 // indirect + github.com/aws/aws-sdk-go-v2/credentials v1.17.28 // indirect + github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.12 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.16 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.16 // indirect + github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.4 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.18 // indirect + github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.32.5 // indirect + github.com/aws/aws-sdk-go-v2/service/sso v1.22.5 // indirect + github.com/aws/aws-sdk-go-v2/service/ssooidc v1.26.5 // indirect + github.com/aws/aws-sdk-go-v2/service/sts v1.30.4 // indirect github.com/aws/constructs-go/constructs/v10 v10.1.255 // indirect github.com/aws/jsii-runtime-go v1.75.0 // indirect + github.com/aws/smithy-go v1.20.4 // indirect github.com/bahlo/generic-list-go v0.2.0 // indirect github.com/benbjohnson/clock v1.3.5 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 // indirect github.com/bits-and-blooms/bitset v1.10.0 // indirect + github.com/blang/semver/v4 v4.0.0 // indirect github.com/blendle/zapdriver v1.3.1 // indirect github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect github.com/buger/jsonparser v1.1.1 // indirect @@ -110,41 +140,42 @@ require ( github.com/cenkalti/backoff v2.2.1+incompatible // indirect github.com/cenkalti/backoff/v4 v4.3.0 // indirect github.com/cespare/xxhash v1.1.0 // indirect - github.com/cespare/xxhash/v2 v2.2.0 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/chai2010/gettext-go v1.0.2 // indirect github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d // indirect github.com/chenzhuoyu/iasm v0.9.0 // indirect github.com/chzyer/readline v1.5.1 // indirect github.com/cli/safeexec v1.0.0 // indirect - github.com/cockroachdb/errors v1.9.1 // indirect + github.com/cockroachdb/errors v1.10.0 // indirect github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect github.com/cockroachdb/pebble v0.0.0-20230928194634-aa077af62593 // indirect - github.com/cockroachdb/redact v1.1.3 // indirect + github.com/cockroachdb/redact v1.1.5 // indirect github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect - github.com/cometbft/cometbft v0.37.2 // indirect - github.com/cometbft/cometbft-db v0.7.0 // indirect + github.com/cometbft/cometbft v0.37.5 // indirect + github.com/cometbft/cometbft-db v0.8.0 // indirect github.com/confio/ics23/go v0.9.0 // indirect github.com/consensys/bavard v0.1.13 // indirect github.com/consensys/gnark-crypto v0.12.1 // indirect - github.com/containerd/containerd v1.7.12 // indirect + github.com/containerd/containerd v1.7.18 // indirect + github.com/containerd/errdefs v0.1.0 // indirect github.com/containerd/log v0.1.0 // indirect - github.com/coreos/go-semver v0.3.0 // indirect + github.com/coreos/go-semver v0.3.1 // indirect github.com/coreos/go-systemd/v22 v22.5.0 // indirect github.com/cosmos/btcutil v1.0.5 // indirect - github.com/cosmos/cosmos-proto v1.0.0-beta.2 // indirect - github.com/cosmos/cosmos-sdk v0.47.4 // indirect + github.com/cosmos/cosmos-proto v1.0.0-beta.5 // indirect + github.com/cosmos/cosmos-sdk v0.47.11 // indirect github.com/cosmos/go-bip39 v1.0.0 // indirect github.com/cosmos/gogoproto v1.4.11 // indirect - github.com/cosmos/iavl v0.20.0 // indirect - github.com/cosmos/ibc-go/v7 v7.0.1 // indirect - github.com/cosmos/ics23/go v0.9.1-0.20221207100636-b1abd8678aab // indirect - github.com/cosmos/ledger-cosmos-go v0.12.1 // indirect + github.com/cosmos/iavl v0.20.1 // indirect + github.com/cosmos/ibc-go/v7 v7.5.1 // indirect + github.com/cosmos/ics23/go v0.10.0 // indirect + github.com/cosmos/ledger-cosmos-go v0.12.4 // indirect github.com/cpuguy83/dockercfg v0.3.1 // indirect github.com/crate-crypto/go-ipa v0.0.0-20231025140028-3c0104f4b233 // indirect github.com/crate-crypto/go-kzg-4844 v0.7.0 // indirect github.com/danieljoos/wincred v1.1.2 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect - github.com/deckarep/golang-set/v2 v2.3.0 // indirect + github.com/deckarep/golang-set/v2 v2.6.0 // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect github.com/dennwc/varint v1.0.0 // indirect github.com/dfuse-io/logging v0.0.0-20210109005628-b97a57253f70 // indirect @@ -152,7 +183,7 @@ require ( github.com/dgraph-io/ristretto v0.1.1 // indirect github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect - github.com/distribution/reference v0.5.0 // indirect + github.com/distribution/reference v0.6.0 // indirect github.com/docker/distribution v2.8.2+incompatible // indirect github.com/docker/docker v25.0.2+incompatible // indirect github.com/docker/go-connections v0.5.0 // indirect @@ -161,25 +192,23 @@ require ( github.com/dustin/go-humanize v1.0.1 // indirect github.com/dvsekhvalnov/jose2go v1.7.0 // indirect github.com/edsrzf/mmap-go v1.1.0 // indirect - github.com/emicklei/go-restful/v3 v3.10.2 // indirect + github.com/emicklei/go-restful/v3 v3.12.1 // indirect github.com/esote/minmaxheap v1.0.0 // indirect github.com/ethereum/c-kzg-4844 v0.4.0 // indirect - github.com/evanphx/json-patch v5.6.0+incompatible // indirect - github.com/evanphx/json-patch/v5 v5.6.0 // indirect + github.com/evanphx/json-patch/v5 v5.9.0 // indirect github.com/exponent-io/jsonpath v0.0.0-20210407135951-1de76d718b3f // indirect github.com/facette/natsort v0.0.0-20181210072756-2cd4dd1e2dcb // indirect github.com/fatih/camelcase v1.0.0 // indirect - github.com/fatih/color v1.16.0 // indirect + github.com/fatih/color v1.17.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect - github.com/fsnotify/fsnotify v1.6.0 // indirect - github.com/fvbommel/sortorder v1.0.2 // indirect - github.com/gabriel-vasile/mimetype v1.4.2 // indirect + github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/gabriel-vasile/mimetype v1.4.3 // indirect github.com/gagliardetto/binary v0.7.7 // indirect github.com/gagliardetto/solana-go v1.8.4 // indirect github.com/gagliardetto/treeout v0.1.4 // indirect github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08 // indirect github.com/gballet/go-verkle v0.1.1-0.20231031103413-a67434b50f46 // indirect - github.com/getsentry/sentry-go v0.19.0 // indirect + github.com/getsentry/sentry-go v0.23.0 // indirect github.com/gin-contrib/sessions v0.0.5 // indirect github.com/gin-contrib/sse v0.1.0 // indirect github.com/gin-gonic/gin v1.9.1 // indirect @@ -190,22 +219,23 @@ require ( github.com/go-kit/log v0.2.1 // indirect github.com/go-ldap/ldap/v3 v3.4.6 // indirect github.com/go-logfmt/logfmt v0.6.0 // indirect - github.com/go-logr/logr v1.4.1 // indirect + github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect - github.com/go-ole/go-ole v1.2.6 // indirect + github.com/go-ole/go-ole v1.3.0 // indirect github.com/go-openapi/analysis v0.21.4 // indirect github.com/go-openapi/errors v0.20.4 // indirect - github.com/go-openapi/jsonpointer v0.20.0 // indirect - github.com/go-openapi/jsonreference v0.20.2 // indirect + github.com/go-openapi/jsonpointer v0.21.0 // indirect + github.com/go-openapi/jsonreference v0.21.0 // indirect github.com/go-openapi/loads v0.21.2 // indirect github.com/go-openapi/spec v0.20.9 // indirect github.com/go-openapi/strfmt v0.21.7 // indirect - github.com/go-openapi/swag v0.22.4 // indirect + github.com/go-openapi/swag v0.23.0 // indirect github.com/go-openapi/validate v0.22.1 // indirect github.com/go-playground/locales v0.14.1 // indirect github.com/go-playground/universal-translator v0.18.1 // indirect - github.com/go-playground/validator/v10 v10.15.5 // indirect + github.com/go-playground/validator/v10 v10.22.0 // indirect github.com/go-redis/redis/v8 v8.11.5 // indirect + github.com/go-viper/mapstructure/v2 v2.1.0 // indirect github.com/go-webauthn/webauthn v0.9.4 // indirect github.com/go-webauthn/x v0.1.5 // indirect github.com/goccy/go-json v0.10.2 // indirect @@ -215,18 +245,17 @@ require ( github.com/gogo/protobuf v1.3.3 // indirect github.com/gogo/status v1.1.1 // indirect github.com/golang-jwt/jwt/v5 v5.2.0 // indirect - github.com/golang/glog v1.2.0 // indirect + github.com/golang/glog v1.2.1 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/protobuf v1.5.4 // indirect github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb // indirect github.com/google/btree v1.1.2 // indirect - github.com/google/gnostic v0.6.9 // indirect + github.com/google/gnostic-models v0.6.9-0.20230804172637-c7be7c783f49 // indirect github.com/google/go-github/v41 v41.0.0 // indirect github.com/google/go-querystring v1.1.0 // indirect github.com/google/go-tpm v0.9.0 // indirect github.com/google/gofuzz v1.2.0 // indirect - github.com/google/pprof v0.0.0-20231023181126-ff6d637d2a7b // indirect - github.com/google/s2a-go v0.1.7 // indirect + github.com/google/pprof v0.0.0-20240525223248-4bfdf5a9a2af // indirect github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect github.com/gorilla/context v1.1.1 // indirect github.com/gorilla/mux v1.8.0 // indirect @@ -238,28 +267,26 @@ require ( github.com/grafana/grafana-foundation-sdk/go v0.0.0-20240326122733-6f96a993222b // indirect github.com/grafana/loki v1.6.2-0.20231215164305-b51b7d7b5503 // indirect github.com/grafana/loki/pkg/push v0.0.0-20231201111602-11ef833ed3e4 // indirect - github.com/grafana/pyroscope-go v1.1.1 // indirect - github.com/grafana/pyroscope-go/godeltaprof v0.1.6 // indirect + github.com/grafana/pyroscope-go v1.1.2 // indirect + github.com/grafana/pyroscope-go/godeltaprof v0.1.8 // indirect github.com/grafana/regexp v0.0.0-20221122212121-6b5c0a4cb7fd // indirect github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79 // indirect github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus v1.0.1 // indirect github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.1.0 // indirect github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect - github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0 // indirect github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect github.com/gtank/merlin v0.1.1 // indirect github.com/gtank/ristretto255 v0.1.2 // indirect - github.com/hashicorp/consul/api v1.25.1 // indirect - github.com/hashicorp/consul/sdk v0.16.0 // indirect + github.com/hashicorp/consul/api v1.28.2 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect github.com/hashicorp/go-envparse v0.1.0 // indirect github.com/hashicorp/go-hclog v1.5.0 // indirect github.com/hashicorp/go-immutable-radix v1.3.1 // indirect github.com/hashicorp/go-msgpack v0.5.5 // indirect - github.com/hashicorp/go-multierror v1.1.1 // indirect - github.com/hashicorp/go-plugin v1.6.0 // indirect + github.com/hashicorp/go-plugin v1.6.2-0.20240829161738-06afb6d7ae99 // indirect github.com/hashicorp/go-retryablehttp v0.7.5 // indirect github.com/hashicorp/go-rootcerts v1.0.2 // indirect github.com/hashicorp/go-sockaddr v1.0.2 // indirect @@ -269,6 +296,7 @@ require ( github.com/hashicorp/serf v0.10.1 // indirect github.com/hashicorp/yamux v0.1.1 // indirect github.com/hdevalence/ed25519consensus v0.1.0 // indirect + github.com/holiman/billy v0.0.0-20230718173358-1c7e68d277a7 // indirect github.com/holiman/bloomfilter/v2 v2.0.3 // indirect github.com/holiman/uint256 v1.2.4 // indirect github.com/huandu/skiplist v1.2.0 // indirect @@ -295,15 +323,16 @@ require ( github.com/json-iterator/go v1.1.12 // indirect github.com/julienschmidt/httprouter v1.3.0 // indirect github.com/kelseyhightower/envconfig v1.4.0 // indirect - github.com/klauspost/compress v1.17.3 // indirect + github.com/klauspost/compress v1.17.9 // indirect github.com/klauspost/cpuid/v2 v2.2.5 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect github.com/kylelemons/godebug v1.1.0 // indirect github.com/leanovate/gopter v0.2.10-0.20210127095200-9abe2343507a // indirect - github.com/leodido/go-urn v1.2.4 // indirect + github.com/leodido/go-urn v1.4.0 // indirect github.com/libp2p/go-buffer-pool v0.1.0 // indirect github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de // indirect + github.com/linxGnu/grocksdb v1.7.16 // indirect github.com/logrusorgru/aurora v2.0.3+incompatible // indirect github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect github.com/magiconair/properties v1.8.7 // indirect @@ -311,7 +340,7 @@ require ( github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect github.com/mattn/go-runewidth v0.0.14 // indirect - github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 // indirect + github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect github.com/miekg/dns v1.1.56 // indirect github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 // indirect github.com/mitchellh/copystructure v1.2.0 // indirect @@ -322,7 +351,7 @@ require ( github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/mmcloughlin/addchain v0.4.0 // indirect github.com/moby/patternmatcher v0.6.0 // indirect - github.com/moby/spdystream v0.2.0 // indirect + github.com/moby/spdystream v0.4.0 // indirect github.com/moby/sys/sequential v0.5.0 // indirect github.com/moby/sys/user v0.1.0 // indirect github.com/moby/term v0.5.0 // indirect @@ -335,12 +364,12 @@ require ( github.com/mtibben/percent v0.2.1 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f // indirect - github.com/mwitkow/grpc-proxy v0.0.0-20230212185441-f345521cb9c9 // indirect + github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect github.com/oklog/run v1.1.0 // indirect github.com/oklog/ulid v1.3.1 // indirect github.com/olekukonko/tablewriter v0.0.5 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect - github.com/opencontainers/image-spec v1.1.0-rc5 // indirect + github.com/opencontainers/image-spec v1.1.0 // indirect github.com/opencontainers/runc v1.1.7 // indirect github.com/opentracing-contrib/go-grpc v0.0.0-20210225150812-73cb765af46e // indirect github.com/opentracing-contrib/go-stdlib v1.0.0 // indirect @@ -355,18 +384,19 @@ require ( github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect github.com/prometheus/alertmanager v0.26.0 // indirect - github.com/prometheus/client_golang v1.17.0 // indirect - github.com/prometheus/client_model v0.5.0 // indirect - github.com/prometheus/common v0.45.0 // indirect + github.com/prometheus/client_golang v1.20.0 // indirect + github.com/prometheus/client_model v0.6.1 // indirect github.com/prometheus/common/sigv4 v0.1.0 // indirect github.com/prometheus/exporter-toolkit v0.10.1-0.20230714054209-2f4150c63f97 // indirect - github.com/prometheus/procfs v0.12.0 // indirect - github.com/prometheus/prometheus v0.48.1 // indirect + github.com/prometheus/procfs v0.15.1 // indirect + github.com/prometheus/prometheus v1.8.2-0.20200727090838-6f296594a852 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect github.com/rivo/uniseg v0.4.4 // indirect github.com/robfig/cron/v3 v3.0.1 // indirect github.com/rogpeppe/go-internal v1.12.0 // indirect - github.com/russross/blackfriday v1.6.0 // indirect + github.com/russross/blackfriday/v2 v2.1.0 // indirect + github.com/sagikazarmark/locafero v0.4.0 // indirect + github.com/sagikazarmark/slog-shim v0.1.0 // indirect github.com/santhosh-tekuri/jsonschema/v5 v5.3.1 // indirect github.com/sasha-s/go-deadlock v0.3.1 // indirect github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 // indirect @@ -375,29 +405,27 @@ require ( github.com/shirou/gopsutil/v3 v3.24.3 // indirect github.com/shoenig/go-m1cpu v0.1.6 // indirect github.com/sirupsen/logrus v1.9.3 // indirect - github.com/smartcontractkit/chain-selectors v1.0.10 // indirect - github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20240710121324-3ed288aa9b45 // indirect - github.com/smartcontractkit/chainlink-data-streams v0.0.0-20240702145022-37a2c3a742d1 // indirect - github.com/smartcontractkit/chainlink-feeds v0.0.0-20240522213638-159fb2d99917 // indirect - github.com/smartcontractkit/chainlink-solana v1.0.3-0.20240708150922-0546185ead68 // indirect - github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240709043547-03612098f799 // indirect + github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20240911175228-daf2600bb7b7 // indirect + github.com/smartcontractkit/chainlink-data-streams v0.0.0-20240916152957-433914114bd2 // indirect + github.com/smartcontractkit/chainlink-feeds v0.0.0-20240910155501-42f20443189f // indirect + github.com/smartcontractkit/chainlink-solana v1.1.1-0.20240927143737-7e527aa85bff // indirect + github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240911194142-506bc469d8ae // indirect + github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7 // indirect github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin v0.0.0-20230906073235-9e478e5e19f1 // indirect github.com/smartcontractkit/tdh2/go/tdh2 v0.0.0-20230906073235-9e478e5e19f1 // indirect - github.com/smartcontractkit/wsrpc v0.7.3 // indirect + github.com/smartcontractkit/wsrpc v0.8.2 // indirect github.com/soheilhy/cmux v0.1.5 // indirect github.com/sony/gobreaker v0.5.0 // indirect - github.com/spf13/afero v1.9.5 // indirect + github.com/sourcegraph/conc v0.3.0 // indirect + github.com/spf13/afero v1.11.0 // indirect github.com/spf13/cast v1.6.0 // indirect - github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/spf13/pflag v1.0.5 // indirect - github.com/spf13/viper v1.15.0 // indirect + github.com/spf13/viper v1.19.0 // indirect github.com/status-im/keycard-go v0.2.0 // indirect github.com/streamingfast/logging v0.0.0-20220405224725-2755dab2ce75 // indirect github.com/stretchr/objx v0.5.2 // indirect - github.com/subosito/gotenv v1.4.2 // indirect github.com/supranational/blst v0.3.11 // indirect github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect - github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c // indirect github.com/tendermint/go-amino v0.16.0 // indirect github.com/teris-io/shortid v0.0.0-20201117134242-e59966efd125 // indirect github.com/theodesp/go-heaps v0.0.0-20190520121037-88e35354fe0a // indirect @@ -414,91 +442,101 @@ require ( github.com/ugorji/go/codec v1.2.12 // indirect github.com/umbracle/fastrlp v0.0.0-20220527094140-59d5dd30e722 // indirect github.com/valyala/fastjson v1.4.1 // indirect + github.com/vektah/gqlparser/v2 v2.5.11 // indirect github.com/wk8/go-ordered-map/v2 v2.1.8 // indirect github.com/x448/float16 v0.8.4 // indirect - github.com/xlab/treeprint v1.1.0 // indirect + github.com/xlab/treeprint v1.2.0 // indirect github.com/yusufpapurcu/wmi v1.2.4 // indirect - github.com/zondax/hid v0.9.1 // indirect - github.com/zondax/ledger-go v0.14.1 // indirect + github.com/zondax/hid v0.9.2 // indirect + github.com/zondax/ledger-go v0.14.3 // indirect go.dedis.ch/fixbuf v1.0.3 // indirect go.dedis.ch/kyber/v3 v3.1.0 // indirect - go.etcd.io/bbolt v1.3.7 // indirect - go.etcd.io/etcd/api/v3 v3.5.7 // indirect - go.etcd.io/etcd/client/pkg/v3 v3.5.7 // indirect - go.etcd.io/etcd/client/v3 v3.5.7 // indirect + go.etcd.io/bbolt v1.3.9 // indirect + go.etcd.io/etcd/api/v3 v3.5.14 // indirect + go.etcd.io/etcd/client/pkg/v3 v3.5.14 // indirect + go.etcd.io/etcd/client/v3 v3.5.14 // indirect go.mongodb.org/mongo-driver v1.15.0 // indirect go.opencensus.io v0.24.0 // indirect go.opentelemetry.io/collector/pdata v1.0.0-rcv0016 // indirect go.opentelemetry.io/collector/semconv v0.87.0 // indirect - go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.52.0 // indirect - go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 // indirect - go.opentelemetry.io/otel v1.27.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.27.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.27.0 // indirect - go.opentelemetry.io/otel/metric v1.27.0 // indirect - go.opentelemetry.io/otel/sdk v1.27.0 // indirect - go.opentelemetry.io/otel/trace v1.27.0 // indirect - go.opentelemetry.io/proto/otlp v1.2.0 // indirect - go.starlark.net v0.0.0-20220817180228-f738f5508c12 // indirect - go.uber.org/atomic v1.11.0 // indirect + go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.53.0 // indirect + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.53.0 // indirect + go.opentelemetry.io/otel v1.28.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.0.0-20240823153156-2a54df7bffb9 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.28.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.28.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.28.0 // indirect + go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.4.0 // indirect + go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.28.0 // indirect + go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.28.0 // indirect + go.opentelemetry.io/otel/log v0.4.0 // indirect + go.opentelemetry.io/otel/metric v1.28.0 // indirect + go.opentelemetry.io/otel/sdk v1.28.0 // indirect + go.opentelemetry.io/otel/sdk/log v0.4.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.28.0 // indirect + go.opentelemetry.io/otel/trace v1.28.0 // indirect + go.opentelemetry.io/proto/otlp v1.3.1 // indirect + go.starlark.net v0.0.0-20230525235612-a134d8f9ddca // indirect go.uber.org/goleak v1.3.0 // indirect - go.uber.org/multierr v1.11.0 // indirect go.uber.org/ratelimit v0.3.0 // indirect go4.org/netipx v0.0.0-20230125063823-8449b0a6169f // indirect - golang.org/x/arch v0.7.0 // indirect - golang.org/x/crypto v0.24.0 // indirect - golang.org/x/exp v0.0.0-20240325151524-a685a6edb6d8 // indirect - golang.org/x/mod v0.17.0 // indirect - golang.org/x/net v0.25.0 // indirect - golang.org/x/oauth2 v0.20.0 // indirect - golang.org/x/sys v0.21.0 // indirect - golang.org/x/term v0.21.0 // indirect - golang.org/x/time v0.5.0 // indirect - golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect - gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect - gonum.org/v1/gonum v0.14.0 // indirect - google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20240520151616-dc85e6b867a5 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240520151616-dc85e6b867a5 // indirect - google.golang.org/grpc v1.64.0 // indirect - google.golang.org/protobuf v1.34.1 // indirect + golang.org/x/arch v0.8.0 // indirect + golang.org/x/mod v0.21.0 // indirect + golang.org/x/net v0.29.0 // indirect + golang.org/x/oauth2 v0.22.0 // indirect + golang.org/x/sys v0.25.0 // indirect + golang.org/x/term v0.24.0 // indirect + golang.org/x/time v0.6.0 // indirect + golang.org/x/tools v0.25.0 // indirect + gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect + gonum.org/v1/gonum v0.15.0 // indirect + google.golang.org/genproto v0.0.0-20240711142825-46eb208f015d // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20240822170219-fc7c04adadcd // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd // indirect + gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - k8s.io/api v0.28.2 // indirect - k8s.io/apiextensions-apiserver v0.25.3 // indirect - k8s.io/cli-runtime v0.25.11 // indirect - k8s.io/client-go v0.28.2 // indirect - k8s.io/component-base v0.26.2 // indirect - k8s.io/klog/v2 v2.100.1 // indirect - k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 // indirect - k8s.io/kubectl v0.25.11 // indirect - k8s.io/utils v0.0.0-20230711102312-30195339c3c7 // indirect - nhooyr.io/websocket v1.8.7 // indirect - pgregory.net/rapid v0.5.5 // indirect + k8s.io/api v0.31.0 // indirect + k8s.io/apiextensions-apiserver v0.31.0 // indirect + k8s.io/cli-runtime v0.31.0 // indirect + k8s.io/client-go v0.31.0 // indirect + k8s.io/component-base v0.31.0 // indirect + k8s.io/klog/v2 v2.130.1 // indirect + k8s.io/kube-openapi v0.0.0-20240709000822-3c01b740850f // indirect + k8s.io/kubectl v0.31.0 // indirect + k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 // indirect + nhooyr.io/websocket v1.8.10 // indirect + pgregory.net/rapid v1.1.0 // indirect rsc.io/tmplfunc v0.0.3 // indirect - sigs.k8s.io/controller-runtime v0.13.0 // indirect + sigs.k8s.io/controller-runtime v0.19.0 // indirect sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect - sigs.k8s.io/kustomize/api v0.12.1 // indirect - sigs.k8s.io/kustomize/kyaml v0.13.9 // indirect - sigs.k8s.io/structured-merge-diff/v4 v4.3.0 // indirect + sigs.k8s.io/kustomize/api v0.17.2 // indirect + sigs.k8s.io/kustomize/kyaml v0.17.1 // indirect + sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect sigs.k8s.io/yaml v1.4.0 // indirect ) +exclude github.com/chaos-mesh/chaos-mesh/api/v1alpha1 v0.0.0-20220226050744-799408773657 + replace ( + // until merged upstream: https://github.com/omissis/go-jsonschema/pull/264 + github.com/atombender/go-jsonschema => github.com/nolag/go-jsonschema v0.16.0-rtinianov + github.com/go-kit/log => github.com/go-kit/log v0.2.1 // replicating the replace directive on cosmos SDK github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1 - // until merged upstream: https://github.com/hashicorp/go-plugin/pull/257 - github.com/hashicorp/go-plugin => github.com/smartcontractkit/go-plugin v0.0.0-20240208201424-b3b91517de16 - - // until merged upstream: https://github.com/mwitkow/grpc-proxy/pull/69 - github.com/mwitkow/grpc-proxy => github.com/smartcontractkit/grpc-proxy v0.0.0-20230731113816-f1be6620749f - // type func(a Label, b Label) bool of func(a, b Label) bool {…} does not match inferred type func(a Label, b Label) int for func(a E, b E) int github.com/prometheus/prometheus => github.com/prometheus/prometheus v0.47.2-0.20231010075449-4b9c19fe5510 ) + +replace ( + github.com/prometheus/client_golang => github.com/prometheus/client_golang v1.14.0 + github.com/prometheus/common => github.com/prometheus/common v0.42.0 +) + +replace github.com/sourcegraph/sourcegraph/lib => github.com/sourcegraph/sourcegraph-public-snapshot/lib v0.0.0-20240822153003-c864f15af264 diff --git a/integration-tests/go.sum b/integration-tests/go.sum index 432c30e8e9c..4ff2f7169d1 100644 --- a/integration-tests/go.sum +++ b/integration-tests/go.sum @@ -4,7 +4,6 @@ cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSR cloud.google.com/go v0.43.0/go.mod h1:BOSR3VbTLkk6FDC/TcffxP4NF/FFBGA5ku+jvKOP7pg= cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= -cloud.google.com/go v0.44.3/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= @@ -15,25 +14,27 @@ cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKV cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= -cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= -cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= -cloud.google.com/go v0.75.0/go.mod h1:VGuuCn7PG0dwsd5XPVm2Mm3wlh3EL55/79EKB6hlPTY= -cloud.google.com/go v0.112.1 h1:uJSeirPke5UNZHIb4SxfZklVSiWWVqW4oXlETwZziwM= -cloud.google.com/go v0.112.1/go.mod h1:+Vbu+Y1UU+I1rjmzeMOb/8RfkKJK2Gyxi1X6jJCZLo4= +cloud.google.com/go v0.115.0 h1:CnFSK6Xo3lDYRoBKEcAtia6VSC837/ZkJuRduSFnr14= +cloud.google.com/go v0.115.0/go.mod h1:8jIM5vVgoAEoiVxQ/O4BFTfHqulPZgs/ufEzMcFMdWU= +cloud.google.com/go/auth v0.7.1 h1:Iv1bbpzJ2OIg16m94XI9/tlzZZl3cdeR3nGVGj78N7s= +cloud.google.com/go/auth v0.7.1/go.mod h1:VEc4p5NNxycWQTMQEDQF0bd6aTMb6VgYDXEwiJJQAbs= +cloud.google.com/go/auth/oauth2adapt v0.2.3 h1:MlxF+Pd3OmSudg/b1yZ5lJwoXCEaeedAguodky1PcKI= +cloud.google.com/go/auth/oauth2adapt v0.2.3/go.mod h1:tMQXOfZzFuNuUxOypHlQEXgdfX5cuhwU+ffUuXRJE8I= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= -cloud.google.com/go/compute v1.25.1 h1:ZRpHJedLtTpKgr3RV1Fx23NuaAEN1Zfx9hw1u4aJdjU= -cloud.google.com/go/compute/metadata v0.3.0 h1:Tz+eQXMEqDIKRsmY3cHTL6FVaynIjX2QxYC4trgAKZc= -cloud.google.com/go/compute/metadata v0.3.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k= +cloud.google.com/go/compute v1.27.2 h1:5cE5hdrwJV/92ravlwIFRGnyH9CpLGhh4N0ZDVTU+BA= +cloud.google.com/go/compute/metadata v0.2.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k= +cloud.google.com/go/compute/metadata v0.5.0 h1:Zr0eK8JbFv6+Wi4ilXAR8FJ3wyNdpxHKJNPos6LTZOY= +cloud.google.com/go/compute/metadata v0.5.0/go.mod h1:aHnloV2TPI38yx4s9+wAZhHykWvVCfu7hQbF+9CWoiY= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= -cloud.google.com/go/iam v1.1.6 h1:bEa06k05IO4f4uJonbB5iAgKTPpABy1ayxaIZV/GHVc= -cloud.google.com/go/iam v1.1.6/go.mod h1:O0zxdPeGBoFdWW3HWmBxJsk0pfvNM/p/qa82rWOGTwI= +cloud.google.com/go/iam v1.1.11 h1:0mQ8UKSfdHLut6pH9FM3bI55KWR46ketn0PuXleDyxw= +cloud.google.com/go/iam v1.1.11/go.mod h1:biXoiLWYIKntto2joP+62sd9uW5EpkZmKIvfNcTWlnQ= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= @@ -43,9 +44,8 @@ cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0Zeo cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= -cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= -cloud.google.com/go/storage v1.38.0 h1:Az68ZRGlnNTpIBbLjSMIV2BDcwwXYlRlQzis0llkpJg= -cloud.google.com/go/storage v1.38.0/go.mod h1:tlUADB0mAb9BgYls9lq+8MGkfzOXuLrnHXlpHmvFJoY= +cloud.google.com/go/storage v1.43.0 h1:CcxnSohZwizt4LCzQHWvBf1/kvtHUn7gk9QERXPyXFs= +cloud.google.com/go/storage v1.43.0/go.mod h1:ajvxEa7WmZS1PxvKRq4bq0tFT3vMd502JwstCcYv0Q0= contrib.go.opencensus.io/exporter/stackdriver v0.12.6/go.mod h1:8x999/OcIPy5ivx/wDiV7Gx4D+VUPODf0mWRGRc5kSk= contrib.go.opencensus.io/exporter/stackdriver v0.13.4/go.mod h1:aXENhDJ1Y4lIg4EUaVTwzvYETVNZk10Pu26tevFKLUc= contrib.go.opencensus.io/exporter/stackdriver v0.13.5 h1:TNaexHK16gPUoc7uzELKOU7JULqccn1NDuqUxmxSqfo= @@ -54,18 +54,18 @@ cosmossdk.io/api v0.3.1 h1:NNiOclKRR0AOlO4KIqeaG6PS6kswOMhHD0ir0SscNXE= cosmossdk.io/api v0.3.1/go.mod h1:DfHfMkiNA2Uhy8fj0JJlOCYOBp4eWUUJ1te5zBGNyIw= cosmossdk.io/core v0.5.1 h1:vQVtFrIYOQJDV3f7rw4pjjVqc1id4+mE0L9hHP66pyI= cosmossdk.io/core v0.5.1/go.mod h1:KZtwHCLjcFuo0nmDc24Xy6CRNEL9Vl/MeimQ2aC7NLE= -cosmossdk.io/depinject v1.0.0-alpha.3 h1:6evFIgj//Y3w09bqOUOzEpFj5tsxBqdc5CfkO7z+zfw= -cosmossdk.io/depinject v1.0.0-alpha.3/go.mod h1:eRbcdQ7MRpIPEM5YUJh8k97nxHpYbc3sMUnEtt8HPWU= -cosmossdk.io/errors v1.0.0 h1:nxF07lmlBbB8NKQhtJ+sJm6ef5uV1XkvPXG2bUntb04= -cosmossdk.io/errors v1.0.0/go.mod h1:+hJZLuhdDE0pYN8HkOrVNwrIOYvUGnn6+4fjnJs/oV0= -cosmossdk.io/log v1.1.1-0.20230704160919-88f2c830b0ca h1:msenprh2BLLRwNT7zN56TbBHOGk/7ARQckXHxXyvjoQ= -cosmossdk.io/log v1.1.1-0.20230704160919-88f2c830b0ca/go.mod h1:PkIAKXZvaxrTRc++z53XMRvFk8AcGGWYHcMIPzVYX9c= -cosmossdk.io/math v1.0.1 h1:Qx3ifyOPaMLNH/89WeZFH268yCvU4xEcnPLu3sJqPPg= -cosmossdk.io/math v1.0.1/go.mod h1:Ygz4wBHrgc7g0N+8+MrnTfS9LLn9aaTGa9hKopuym5k= +cosmossdk.io/depinject v1.0.0-alpha.4 h1:PLNp8ZYAMPTUKyG9IK2hsbciDWqna2z1Wsl98okJopc= +cosmossdk.io/depinject v1.0.0-alpha.4/go.mod h1:HeDk7IkR5ckZ3lMGs/o91AVUc7E596vMaOmslGFM3yU= +cosmossdk.io/errors v1.0.1 h1:bzu+Kcr0kS/1DuPBtUFdWjzLqyUuCiyHjyJB6srBV/0= +cosmossdk.io/errors v1.0.1/go.mod h1:MeelVSZThMi4bEakzhhhE/CKqVv3nOJDA25bIqRDu/U= +cosmossdk.io/log v1.3.1 h1:UZx8nWIkfbbNEWusZqzAx3ZGvu54TZacWib3EzUYmGI= +cosmossdk.io/log v1.3.1/go.mod h1:2/dIomt8mKdk6vl3OWJcPk2be3pGOS8OQaLUM/3/tCM= +cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= +cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= cosmossdk.io/tools/rosetta v0.2.1 h1:ddOMatOH+pbxWbrGJKRAawdBkPYLfKXutK9IETnjYxw= cosmossdk.io/tools/rosetta v0.2.1/go.mod h1:Pqdc1FdvkNV3LcNIkYWt2RQY6IP1ge6YWZk8MhhO9Hw= -dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk= -dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= +dario.cat/mergo v1.0.1 h1:Ra4+bf83h2ztPIQYNP99R6m+Y7KfnARDfID+a+vLl4s= +dario.cat/mergo v1.0.1/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.0.0-rc.1/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= @@ -78,7 +78,6 @@ github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24 h1:bvDV9 github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24/go.mod h1:8o94RPi1/7XTJvwPpRSzSUedZrtlirdB3r9Z20bi2f8= github.com/AlekSi/pointer v1.1.0 h1:SSDMPcXD9jSl8FPy9cRzoRaMJtm9g9ggGTxecRUbQoI= github.com/AlekSi/pointer v1.1.0/go.mod h1:y7BvfRI3wXPWKXEBhU71nbnIEEZX0QTSB2Bj48UJIZE= -github.com/AndreasBriese/bbloom v0.0.0-20190306092124-e2d15f34fcf9/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8= github.com/Azure/azure-sdk-for-go v65.0.0+incompatible h1:HzKLt3kIwMm4KeJYTdx9EbjRYTySD/t8i1Ee/W5EGXw= github.com/Azure/azure-sdk-for-go v65.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.8.0 h1:9kDVnTz3vbfweTqAUmk/a/pH5pWFCHtvRpHYC0G/dcA= @@ -111,10 +110,8 @@ github.com/AzureAD/microsoft-authentication-library-for-go v1.1.1 h1:WpB/QDNLpMw github.com/AzureAD/microsoft-authentication-library-for-go v1.1.1/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d h1:nalkkPQcITbvhmL4+C4cKA87NW0tfm3Kl9VXRoPywFg= -github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d/go.mod h1:URdX5+vg25ts3aCh8H5IFZybJYKWhJHYMTnf+ULtoC4= -github.com/CloudyKit/fastprinter v0.0.0-20200109182630-33d98a066a53/go.mod h1:+3IMCy2vIlbG1XG/0ggNQv0SvxCAIpPM5b1nCz56Xno= -github.com/CloudyKit/jet/v3 v3.0.0/go.mod h1:HKQPgSJmdK8hdoAbKUUWajkHyHo4RaU5rMdUywE7VMo= +github.com/ChainSafe/go-schnorrkel v1.0.0 h1:3aDA67lAykLaG1y3AOjs88dMxC88PgUuHRrLeDnvGIM= +github.com/ChainSafe/go-schnorrkel v1.0.0/go.mod h1:dpzHYVxLZcp8pjlV+O+UR8K0Hp/z7vcchBSbMBEhCw4= github.com/CosmWasm/wasmd v0.40.1 h1:LxbO78t/6S8TkeQlUrJ0m5O87HtAwLx4RGHq3rdrOEU= github.com/CosmWasm/wasmd v0.40.1/go.mod h1:6EOwnv7MpuFaEqxcUOdFV9i4yvrdOciaY6VQ1o7A3yg= github.com/CosmWasm/wasmvm v1.2.4 h1:6OfeZuEcEH/9iqwrg2pkeVtDCkMoj9U6PpKtcrCyVrQ= @@ -128,7 +125,8 @@ github.com/GeertJohan/go.incremental v1.0.0/go.mod h1:6fAjUhbVuX1KcMD3c8TEgVUqmo github.com/GeertJohan/go.rice v1.0.0/go.mod h1:eH6gbSOAUv07dQuZVnBmoDP8mgsM1rtixis4Tib9if0= github.com/HdrHistogram/hdrhistogram-go v1.1.2 h1:5IcZpTvzydCQeHzK4Ef/D5rrSqwxob0t8PQPMybUNFM= github.com/HdrHistogram/hdrhistogram-go v1.1.2/go.mod h1:yDgFjdqOqDEKOvasDdhWNXYg9BVp4O+o5f6V/ehm6Oo= -github.com/Joker/hpp v1.0.0/go.mod h1:8x5n+M1Hp5hC0g8okX3sR3vFQwynaX/UgSOM9MeBKzY= +github.com/Khan/genqlient v0.7.0 h1:GZ1meyRnzcDTK48EjqB8t3bcfYvHArCUUvgOwpz1D4w= +github.com/Khan/genqlient v0.7.0/go.mod h1:HNyy3wZvuYwmW3Y7mkoQLZsa/R5n5yIRajS1kPBvSFM= github.com/MakeNowJust/heredoc v1.0.0 h1:cXCdzVdstXyiTqTvfqk9SDHpKNjxuom+DOlyEeQ4pzQ= github.com/MakeNowJust/heredoc v1.0.0/go.mod h1:mG5amYoWBHf8vpLOuehzbGGw0EHxpZZ6lCpQ4fNJ8LE= github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI= @@ -139,10 +137,10 @@ github.com/Masterminds/semver/v3 v3.2.1 h1:RN9w6+7QoMeJVGyfmbcgs28Br8cvmnucEXnY0 github.com/Masterminds/semver/v3 v3.2.1/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYrf8m9wsX0PNOMQ= github.com/Masterminds/sprig/v3 v3.2.3 h1:eL2fZNezLomi0uOLqjQoN6BfsDD+fyLtgbJMAj9n6YA= github.com/Masterminds/sprig/v3 v3.2.3/go.mod h1:rXcFaZ2zZbLRJv/xSysmlgIM1u11eBaRMhvYXJNkGuM= -github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= -github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= -github.com/Microsoft/hcsshim v0.11.4 h1:68vKo2VN8DE9AdN4tnkWnmdhqdbpUFM8OF3Airm7fz8= -github.com/Microsoft/hcsshim v0.11.4/go.mod h1:smjE4dvqPX9Zldna+t5FG3rnoHhaB7QYxPRqGcpAD9w= +github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= +github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= +github.com/Microsoft/hcsshim v0.11.5 h1:haEcLNpj9Ka1gd3B3tAEs9CpE0c+1IhoL59w/exYU38= +github.com/Microsoft/hcsshim v0.11.5/go.mod h1:MV8xMfmECjl5HdO7U/3/hFVnkmSBjAjmA09d4bExKcU= github.com/NethermindEth/juno v0.3.1 h1:AW72LiAm9gqUeCVJWvepnZcTnpU4Vkl0KzPMxS+42FA= github.com/NethermindEth/juno v0.3.1/go.mod h1:SGbTpgGaCsxhFsKOid7Ylnz//WZ8swtILk+NbHGsk/Q= github.com/NethermindEth/starknet.go v0.7.1-0.20240401080518-34a506f3cfdb h1:Mv8SscePPyw2ju4igIJAjFgcq5zCQfjgbz53DwYu5mc= @@ -154,7 +152,6 @@ github.com/OneOfOne/xxhash v1.2.8 h1:31czK/TI9sNkxIKfaUfGlU47BAxQ0ztGgd9vPyqimf8 github.com/OneOfOne/xxhash v1.2.8/go.mod h1:eZbhyaAYD41SGSSsnmcpxVoRiQ/MPUTjUdIIOT9Um7Q= github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= -github.com/Shopify/goreferrer v0.0.0-20181106222321-ec9c9a553398/go.mod h1:a1uqRtAwp2Xwc6WNPJEufxJ7fx3npB4UV/JOLmbu5I0= github.com/VictoriaMetrics/fastcache v1.12.1 h1:i0mICQuojGDL3KblA7wUNlY5lOK6a4bwt3uRKnkZU40= github.com/VictoriaMetrics/fastcache v1.12.1/go.mod h1:tX04vaqcNoQeGLD+ra5pU5sWkuxnzWhEzLwhP9w653o= github.com/VividCortex/gohistogram v1.0.0 h1:6+hBz+qvs0JOrrNhhmR7lFxo5sINxBCGXrdtl/UvroE= @@ -163,19 +160,20 @@ github.com/Workiva/go-datastructures v1.1.0 h1:hu20UpgZneBhQ3ZvwiOGlqJSKIosin2Rd github.com/Workiva/go-datastructures v1.1.0/go.mod h1:1yZL+zfsztete+ePzZz/Zb1/t5BnDuE2Ya2MMGhzP6A= github.com/XSAM/otelsql v0.27.0 h1:i9xtxtdcqXV768a5C6SoT/RkG+ue3JTOgkYInzlTOqs= github.com/XSAM/otelsql v0.27.0/go.mod h1:0mFB3TvLa7NCuhm/2nU7/b2wEtsczkj8Rey8ygO7V+A= -github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY= +github.com/agnivade/levenshtein v1.1.1 h1:QY8M92nrzkmr798gCo3kmMyqXFzdQVpxLlGPRBij0P8= +github.com/agnivade/levenshtein v1.1.1/go.mod h1:veldBMzWxcCG2ZvUTKD2kJNRdCk5hVbJomOvKkmgYbo= github.com/akavel/rsrc v0.8.0/go.mod h1:uLoCtb9J+EyAqh+26kdrTgmzRBFPGOolLWKpdxkKq+c= -github.com/alecthomas/participle/v2 v2.0.0-alpha7 h1:cK4vjj0VSgb3lN1nuKA5F7dw+1s1pWBe5bx7nNCnN+c= -github.com/alecthomas/participle/v2 v2.0.0-alpha7/go.mod h1:NumScqsC42o9x+dGj8/YqsIfhrIQjFEOFovxotbBirA= -github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/kingpin/v2 v2.3.1/go.mod h1:oYL5vtsvEHZGHxU7DMp32Dvx+qL+ptGn6lWaot2vCNE= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= -github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 h1:s6gZFSlWYmbqAuRjVTiNNhvNRfY2Wxp9nhfyel4rklc= github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137/go.mod h1:OMCwj8VM1Kc9e19TLln2VL61YJF0x1XFtfdL4JdbSyE= +github.com/alecthomas/units v0.0.0-20240626203959-61d1e3462e30 h1:t3eaIm0rUkzbrIewtiFmMK5RXHej2XnoXNhxVsAYUfg= +github.com/alecthomas/units v0.0.0-20240626203959-61d1e3462e30/go.mod h1:fvzegU4vN3H1qMT+8wDmzjAcDONcgo2/SZ/TyfdUOFs= github.com/alexbrainman/sspi v0.0.0-20210105120005-909beea2cc74 h1:Kk6a4nehpJ3UuJRqlA3JxYxBZEqCeOmATOvrbT4p9RA= github.com/alexbrainman/sspi v0.0.0-20210105120005-909beea2cc74/go.mod h1:cEWa1LVoE5KvSD9ONXsZrj0z6KqySlCCNKHlLzbqAt4= +github.com/alexflint/go-arg v1.4.2 h1:lDWZAXxpAnZUq4qwb86p/3rIJJ2Li81EoMbTMujhVa0= +github.com/alexflint/go-arg v1.4.2/go.mod h1:9iRbDxne7LcR/GSvEr7ma++GLpdIU1zrghf2y2768kM= +github.com/alexflint/go-scalar v1.0.0 h1:NGupf1XV/Xb04wXskDFzS0KWOLH632W/EO4fAFi+A70= +github.com/alexflint/go-scalar v1.0.0/go.mod h1:GpHzbCOZXEKMEcygYQ5n/aa4Aq84zbxjy3MxYW0gjYw= github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a h1:HbKu58rmZpUGpz5+4FfNmIU+FmZg2P3Xaj2v2bfNWmk= github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a/go.mod h1:SGnFV6hVsYE877CKEZ6tDNTjaSXYUk6QqoIK6PrAtcc= github.com/alicebob/miniredis v2.5.0+incompatible h1:yBHoLpsyjupjz3NL3MhKMVkR41j82Yjf3KFv7ApYzUI= @@ -185,7 +183,11 @@ github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax github.com/allegro/bigcache v1.2.1 h1:hg1sY1raCwic3Vnsvje6TT7/pnZba83LeFck5NrFKSc= github.com/allegro/bigcache v1.2.1/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM= github.com/andres-erbsen/clock v0.0.0-20160526145045-9e14626cd129/go.mod h1:rFgpPQZYZ8vdbc+48xibu8ALc3yeyd64IhHS+PU6Yyg= +github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883 h1:bvNMNQO63//z+xNgfBlViaCIJKLlCJ6/fmUseuG0wVQ= +github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= +github.com/arbovm/levenshtein v0.0.0-20160628152529-48b4e1c0c4d0 h1:jfIu9sQUG6Ig+0+Ap1h4unLjW6YQJpKZVmUzxsD4E/Q= +github.com/arbovm/levenshtein v0.0.0-20160628152529-48b4e1c0c4d0/go.mod h1:t2tdKJDJF9BV14lnkjHmOQgcvEKgtqs5a1N3LNdJhGE= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= @@ -200,18 +202,47 @@ github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 h1:DklsrG3d github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= github.com/avast/retry-go v3.0.0+incompatible h1:4SOWQ7Qs+oroOTQOYnAHqelpCO0biHSxpiH9JdtuBj0= github.com/avast/retry-go v3.0.0+incompatible/go.mod h1:XtSnn+n/sHqQIpZ10K1qAevBhOOCWBLXXy3hyiqqBrY= -github.com/avast/retry-go/v4 v4.5.1 h1:AxIx0HGi4VZ3I02jr78j5lZ3M6x1E0Ivxa6b0pUUh7o= -github.com/avast/retry-go/v4 v4.5.1/go.mod h1:/sipNsvNB3RRuT5iNcb6h73nw3IBmXJ/H3XrCQYSOpc= +github.com/avast/retry-go/v4 v4.6.0 h1:K9xNA+KeB8HHc2aWFuLb25Offp+0iVRXEvFx8IinRJA= +github.com/avast/retry-go/v4 v4.6.0/go.mod h1:gvWlPhBVsvBbLkVGDg/KwvBv0bEkCOLRRSHKIr2PyOE= +github.com/awalterschulze/gographviz v2.0.3+incompatible h1:9sVEXJBJLwGX7EQVhLm2elIKCm7P2YHFC8v6096G09E= +github.com/awalterschulze/gographviz v2.0.3+incompatible/go.mod h1:GEV5wmg4YquNw7v1kkyoX9etIk8yVmXj+AkDHuuETHs= github.com/aws/aws-sdk-go v1.22.1/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.23.20/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.38.35/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= github.com/aws/aws-sdk-go v1.45.25 h1:c4fLlh5sLdK2DCRTY1z0hyuJZU4ygxX8m1FswL6/nF4= github.com/aws/aws-sdk-go v1.45.25/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= +github.com/aws/aws-sdk-go-v2 v1.30.4 h1:frhcagrVNrzmT95RJImMHgabt99vkXGslubDaDagTk8= +github.com/aws/aws-sdk-go-v2 v1.30.4/go.mod h1:CT+ZPWXbYrci8chcARI3OmI/qgd+f6WtuLOoaIA8PR0= +github.com/aws/aws-sdk-go-v2/config v1.27.28 h1:OTxWGW/91C61QlneCtnD62NLb4W616/NM1jA8LhJqbg= +github.com/aws/aws-sdk-go-v2/config v1.27.28/go.mod h1:uzVRVtJSU5EFv6Fu82AoVFKozJi2ZCY6WRCXj06rbvs= +github.com/aws/aws-sdk-go-v2/credentials v1.17.28 h1:m8+AHY/ND8CMHJnPoH7PJIRakWGa4gbfbxuY9TGTUXM= +github.com/aws/aws-sdk-go-v2/credentials v1.17.28/go.mod h1:6TF7dSc78ehD1SL6KpRIPKMA1GyyWflIkjqg+qmf4+c= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.12 h1:yjwoSyDZF8Jth+mUk5lSPJCkMC0lMy6FaCD51jm6ayE= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.12/go.mod h1:fuR57fAgMk7ot3WcNQfb6rSEn+SUffl7ri+aa8uKysI= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.16 h1:TNyt/+X43KJ9IJJMjKfa3bNTiZbUP7DeCxfbTROESwY= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.16/go.mod h1:2DwJF39FlNAUiX5pAc0UNeiz16lK2t7IaFcm0LFHEgc= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.16 h1:jYfy8UPmd+6kJW5YhY0L1/KftReOGxI/4NtVSTh9O/I= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.16/go.mod h1:7ZfEPZxkW42Afq4uQB8H2E2e6ebh6mXTueEpYzjCzcs= +github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1 h1:VaRN3TlFdd6KxX1x3ILT5ynH6HvKgqdiXoTxAF4HQcQ= +github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1/go.mod h1:FbtygfRFze9usAadmnGJNc8KsP346kEe+y2/oyhGAGc= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.4 h1:KypMCbLPPHEmf9DgMGw51jMj77VfGPAN2Kv4cfhlfgI= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.4/go.mod h1:Vz1JQXliGcQktFTN/LN6uGppAIRoLBR2bMvIMP0gOjc= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.18 h1:tJ5RnkHCiSH0jyd6gROjlJtNwov0eGYNz8s8nFcR0jQ= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.18/go.mod h1:++NHzT+nAF7ZPrHPsA+ENvsXkOO8wEu+C6RXltAG4/c= +github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.32.5 h1:UDXu9dqpCZYonj7poM4kFISjzTdWI0v3WUusM+w+Gfc= +github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.32.5/go.mod h1:5NPkI3RsTOhwz1CuG7VVSgJCm3CINKkoIaUbUZWQ67w= +github.com/aws/aws-sdk-go-v2/service/sso v1.22.5 h1:zCsFCKvbj25i7p1u94imVoO447I/sFv8qq+lGJhRN0c= +github.com/aws/aws-sdk-go-v2/service/sso v1.22.5/go.mod h1:ZeDX1SnKsVlejeuz41GiajjZpRSWR7/42q/EyA/QEiM= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.26.5 h1:SKvPgvdvmiTWoi0GAJ7AsJfOz3ngVkD/ERbs5pUnHNI= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.26.5/go.mod h1:20sz31hv/WsPa3HhU3hfrIet2kxM4Pe0r20eBZ20Tac= +github.com/aws/aws-sdk-go-v2/service/sts v1.30.4 h1:iAckBT2OeEK/kBDyN/jDtpEExhjeeA/Im2q4X0rJZT8= +github.com/aws/aws-sdk-go-v2/service/sts v1.30.4/go.mod h1:vmSqFK+BVIwVpDAGZB3CoCXHzurt4qBE8lf+I/kRTh0= github.com/aws/constructs-go/constructs/v10 v10.1.255 h1:5hARfEmhBqHSTQf/C3QLA3sWOxO2Dfja0iA1W7ZcI7g= github.com/aws/constructs-go/constructs/v10 v10.1.255/go.mod h1:DCdBSjN04Ck2pajCacTD4RKFqSA7Utya8d62XreYctI= github.com/aws/jsii-runtime-go v1.75.0 h1:NhpUfyiL7/wsRuUekFsz8FFBCYLfPD/l61kKg9kL/a4= github.com/aws/jsii-runtime-go v1.75.0/go.mod h1:TKCyrtM0pygEPo4rDZzbMSDNCDNTSYSN6/mGyHI6O3I= -github.com/aymerick/raymond v2.0.3-0.20180322193309-b565731e1464+incompatible/go.mod h1:osfaiScAUVup+UC9Nfq76eWqDhXlp+4UYaA8uhTBO6g= +github.com/aws/smithy-go v1.20.4 h1:2HK1zBdPgRbjFOHlfeQZfpC4r72MOb9bZkiFwggKO+4= +github.com/aws/smithy-go v1.20.4/go.mod h1:irrKGvNn1InZwb2d7fkIRNucdfwR8R+Ts3wxYa/cJHg= github.com/bahlo/generic-list-go v0.2.0 h1:5sz/EEAK+ls5wF+NeqDpk5+iNdMDXrh3z3nPnH1Wvgk= github.com/bahlo/generic-list-go v0.2.0/go.mod h1:2KvAjgMlE5NNynlg/5iLrrCCZ2+5xWbdbCW3pNTGyYg= github.com/barkimedes/go-deepcopy v0.0.0-20220514131651-17c30cfc62df h1:GSoSVRLoBaFpOOds6QyY1L8AX7uoY+Ln3BHc22W40X0= @@ -219,8 +250,6 @@ github.com/barkimedes/go-deepcopy v0.0.0-20220514131651-17c30cfc62df/go.mod h1:h github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/benbjohnson/clock v1.3.5 h1:VvXlSJBzZpA/zum6Sj74hxwYI2DIxRWuNIoXAzHZz5o= github.com/benbjohnson/clock v1.3.5/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= -github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= -github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d h1:xDfNPAt8lFiC1UJrqV3uuy861HCTo708pDMbjHHdCas= @@ -231,8 +260,12 @@ github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816/go.mod h1:+zsy github.com/bits-and-blooms/bitset v1.10.0 h1:ePXTeiPEazB5+opbv5fr8umg2R/1NlzgDsyepwsSr88= github.com/bits-and-blooms/bitset v1.10.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8= github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84= +github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM= +github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ= github.com/blendle/zapdriver v1.3.1 h1:C3dydBOWYRiOk+B8X9IVZ5IOe+7cl+tGOexN4QqHfpE= github.com/blendle/zapdriver v1.3.1/go.mod h1:mdXfREi6u5MArG4j9fewC+FGnXaBR+T4Ox4J2u4eHCc= +github.com/bradleyjkemp/cupaloy/v2 v2.6.0 h1:knToPYa2xtfg42U3I6punFEjaGFKWQRXJwj0JTv4mTs= +github.com/bradleyjkemp/cupaloy/v2 v2.6.0/go.mod h1:bm7JXdkRd4BHJk9HpwqAI8BoAY1lps46Enkdqw6aRX0= github.com/btcsuite/btcd v0.22.1 h1:CnwP9LM/M9xuRrGSCGeMVs9iv09uMqwsVX7EeIpgV2c= github.com/btcsuite/btcd/btcec/v2 v2.3.2 h1:5n0X6hX0Zk+6omWcihdYvdAlGf2DfasC0GMf7DClJ3U= github.com/btcsuite/btcd/btcec/v2 v2.3.2/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04= @@ -266,12 +299,14 @@ github.com/cespare/cp v1.1.1/go.mod h1:SOGHArjBr4JWaSDEVpWpo/hNg6RoKrls6Oh40hiwW github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= +github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/chai2010/gettext-go v1.0.2 h1:1Lwwip6Q2QGsAdl/ZKPCwTe9fe0CjlUbqj5bFNSjIRk= github.com/chai2010/gettext-go v1.0.2/go.mod h1:y+wnP2cHYaVj19NZhYKAwEMH2CI1gNHeQQ+5AjwawxA= -github.com/chaos-mesh/chaos-mesh/api/v1alpha1 v0.0.0-20220226050744-799408773657 h1:CyuI+igIjadM/GRnE2o0q+WCwipDh0n2cUYFPAvxziM= -github.com/chaos-mesh/chaos-mesh/api/v1alpha1 v0.0.0-20220226050744-799408773657/go.mod h1:JRiumF+RFsH1mrrP8FUsi9tExPylKkO/oSRWeQEUdLE= +github.com/chaos-mesh/chaos-mesh/api v0.0.0-20240821051457-da69c6d9617a h1:6Pg3a6j/41QDzH/oYcMLwwKsf3x/HXcu9W/dBaf2Hzs= +github.com/chaos-mesh/chaos-mesh/api v0.0.0-20240821051457-da69c6d9617a/go.mod h1:x11iCbZV6hzzSQWMq610B6Wl5Lg1dhwqcVfeiWQQnQQ= github.com/chenzhuoyu/base64x v0.0.0-20211019084208-fb5309c8db06/go.mod h1:DH46F32mSOjUmXrMHnKwZdA8wcEefY7UVqBKYGjpdQY= github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311/go.mod h1:b583jCggY9gE99b6G5LEC39OIiVsWj+R97kbl5odCEk= github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d h1:77cEq6EriyTZ0g/qfRdp61a3Uu/AWrgIq2s0ClJV1g0= @@ -297,48 +332,43 @@ github.com/cli/shurcooL-graphql v0.0.3 h1:CtpPxyGDs136/+ZeyAfUKYmcQBjDlq5aqnrDCW github.com/cli/shurcooL-graphql v0.0.3/go.mod h1:tlrLmw/n5Q/+4qSvosT+9/W5zc8ZMjnJeYBxSdb4nWA= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= -github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= -github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20240318125728-8a4994d93e50 h1:DBmgJDC9dTfkVyGgipamEh2BpGYxScCH1TOF1LL1cXc= -github.com/cncf/xds/go v0.0.0-20240318125728-8a4994d93e50/go.mod h1:5e1+Vvlzido69INQaVO6d87Qn543Xr6nooe9Kz7oBFM= +github.com/cncf/xds/go v0.0.0-20240423153145-555b57ec207b h1:ga8SEFjZ60pxLcmhnThWgvH2wg8376yUJmPhEH4H3kw= +github.com/cncf/xds/go v0.0.0-20240423153145-555b57ec207b/go.mod h1:W+zGtBO5Y1IgJhy4+A9GOqVhqLpfZi+vwmdNXUehLA8= github.com/cockroachdb/apd v1.1.0 h1:3LFP3629v+1aKXU5Q37mxmRxX/pIu1nijXydLShEq5I= github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ= github.com/cockroachdb/apd/v2 v2.0.2 h1:weh8u7Cneje73dDh+2tEVLUvyBc89iwepWCD8b8034E= github.com/cockroachdb/apd/v2 v2.0.2/go.mod h1:DDxRlzC2lo3/vSlmSoS7JkqbbrARPuFOGr0B9pvN3Gw= -github.com/cockroachdb/apd/v3 v3.1.0 h1:MK3Ow7LH0W8zkd5GMKA1PvS9qG3bWFI95WaVNfyZJ/w= -github.com/cockroachdb/apd/v3 v3.1.0/go.mod h1:6qgPBMXjATAdD/VefbRP9NoSLKjbB4LCoA7gN4LpHs4= -github.com/cockroachdb/datadriven v1.0.2/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f h1:otljaYPt5hWxV3MUfO5dFPFiOXg9CyG5/kCfayTqsJ4= github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= -github.com/cockroachdb/errors v1.9.1 h1:yFVvsI0VxmRShfawbt/laCIDy/mtTqqnvoNgiy5bEV8= -github.com/cockroachdb/errors v1.9.1/go.mod h1:2sxOtL2WIc096WSZqZ5h8fa17rdDq9HZOZLBCor4mBk= -github.com/cockroachdb/logtags v0.0.0-20211118104740-dabe8e521a4f/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= +github.com/cockroachdb/errors v1.10.0 h1:lfxS8zZz1+OjtV4MtNWgboi/W5tyLEB6VQZBXN+0VUU= +github.com/cockroachdb/errors v1.10.0/go.mod h1:lknhIsEVQ9Ss/qKDBQS/UqFSvPQjOwNq2qyKAxtHRqE= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= github.com/cockroachdb/pebble v0.0.0-20230928194634-aa077af62593 h1:aPEJyR4rPBvDmeyi+l/FS/VtA00IWvjeFvjen1m1l1A= github.com/cockroachdb/pebble v0.0.0-20230928194634-aa077af62593/go.mod h1:6hk1eMY/u5t+Cf18q5lFMUA1Rc+Sm5I6Ra1QuPyxXCo= -github.com/cockroachdb/redact v1.1.3 h1:AKZds10rFSIj7qADf0g46UixK8NNLwWTNdCIGS5wfSQ= -github.com/cockroachdb/redact v1.1.3/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= +github.com/cockroachdb/redact v1.1.5 h1:u1PMllDkdFfPWaNGMyLD1+so+aq3uUItthCFqzwPJ30= +github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= -github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0/go.mod h1:4Zcjuz89kmFXt9morQgcfYZAYZ5n8WHjt81YYWIwtTM= github.com/coinbase/rosetta-sdk-go/types v1.0.0 h1:jpVIwLcPoOeCR6o1tU+Xv7r5bMONNbHU7MuEHboiFuA= github.com/coinbase/rosetta-sdk-go/types v1.0.0/go.mod h1:eq7W2TMRH22GTW0N0beDnN931DW0/WOI1R2sdHNHG4c= -github.com/cometbft/cometbft v0.37.2 h1:XB0yyHGT0lwmJlFmM4+rsRnczPlHoAKFX6K8Zgc2/Jc= -github.com/cometbft/cometbft v0.37.2/go.mod h1:Y2MMMN//O5K4YKd8ze4r9jmk4Y7h0ajqILXbH5JQFVs= -github.com/cometbft/cometbft-db v0.7.0 h1:uBjbrBx4QzU0zOEnU8KxoDl18dMNgDh+zZRUE0ucsbo= -github.com/cometbft/cometbft-db v0.7.0/go.mod h1:yiKJIm2WKrt6x8Cyxtq9YTEcIMPcEe4XPxhgX59Fzf0= +github.com/cometbft/cometbft v0.37.5 h1:/U/TlgMh4NdnXNo+YU9T2NMCWyhXNDF34Mx582jlvq0= +github.com/cometbft/cometbft v0.37.5/go.mod h1:QC+mU0lBhKn8r9qvmnq53Dmf3DWBt4VtkcKw2C81wxY= +github.com/cometbft/cometbft-db v0.8.0 h1:vUMDaH3ApkX8m0KZvOFFy9b5DZHBAjsnEuo9AKVZpjo= +github.com/cometbft/cometbft-db v0.8.0/go.mod h1:6ASCP4pfhmrCBpfk01/9E1SI29nD3HfVHrY4PG8x5c0= github.com/confio/ics23/go v0.9.0 h1:cWs+wdbS2KRPZezoaaj+qBleXgUk5WOQFMP3CQFGTr4= github.com/confio/ics23/go v0.9.0/go.mod h1:4LPZ2NYqnYIVRklaozjNR1FScgDJ2s5Xrp+e/mYVRak= github.com/consensys/bavard v0.1.13 h1:oLhMLOFGTLdlda/kma4VOJazblc7IM5y5QPd2A/YjhQ= github.com/consensys/bavard v0.1.13/go.mod h1:9ItSMtA/dXMAiL7BG6bqW2m3NdSEObYWoH223nGHukI= github.com/consensys/gnark-crypto v0.12.1 h1:lHH39WuuFgVHONRl3J0LRBtuYdQTumFSDtJF7HpyG8M= github.com/consensys/gnark-crypto v0.12.1/go.mod h1:v2Gy7L/4ZRosZ7Ivs+9SfUDr0f5UlG+EM5t7MPHiLuY= -github.com/containerd/containerd v1.7.12 h1:+KQsnv4VnzyxWcfO9mlxxELaoztsDEjOuCMPAuPqgU0= -github.com/containerd/containerd v1.7.12/go.mod h1:/5OMpE1p0ylxtEUGY8kuCYkDRzJm9NO1TFMWjUpdevk= +github.com/containerd/containerd v1.7.18 h1:jqjZTQNfXGoEaZdW1WwPU0RqSn1Bm2Ay/KJPUuO8nao= +github.com/containerd/containerd v1.7.18/go.mod h1:IYEk9/IO6wAPUz2bCMVUbsfXjzw5UNP5fLz4PsUygQ4= github.com/containerd/continuity v0.4.2 h1:v3y/4Yz5jwnvqPKJJ+7Wf93fyWoCB3F5EclWG023MDM= github.com/containerd/continuity v0.4.2/go.mod h1:F6PTNCKepoxEaXLQp3wDAjygEnImnZ/7o4JzpodfroQ= +github.com/containerd/errdefs v0.1.0 h1:m0wCRBiu1WJT/Fr+iOoQHMQS/eP5myQ8lCv4Dz5ZURM= +github.com/containerd/errdefs v0.1.0/go.mod h1:YgWiiHtLmSeBrvpw+UfPijzbLaB77mEG1WwJTDETIV0= github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I= github.com/containerd/log v0.1.0/go.mod h1:VRRf09a7mHDIRezVKTRCrOq78v577GXq3bSa3EhrzVo= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= @@ -346,8 +376,9 @@ github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmfM= github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/coreos/go-semver v0.3.1 h1:yi21YpKnrx1gt5R+la8n5WgS0kCrsPp33dmEyHReZr4= +github.com/coreos/go-semver v0.3.1/go.mod h1:irMmmIw/7yzSRPWryHsK7EYSg09caPQL03VsM8rvUec= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8iXXhfZs= @@ -355,10 +386,10 @@ github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSV github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cosmos/btcutil v1.0.5 h1:t+ZFcX77LpKtDBhjucvnOH8C2l2ioGsBNEQ3jef8xFk= github.com/cosmos/btcutil v1.0.5/go.mod h1:IyB7iuqZMJlthe2tkIFL33xPyzbFYP0XVdS8P5lUPis= -github.com/cosmos/cosmos-proto v1.0.0-beta.2 h1:X3OKvWgK9Gsejo0F1qs5l8Qn6xJV/AzgIWR2wZ8Nua8= -github.com/cosmos/cosmos-proto v1.0.0-beta.2/go.mod h1:+XRCLJ14pr5HFEHIUcn51IKXD1Fy3rkEQqt4WqmN4V0= -github.com/cosmos/cosmos-sdk v0.47.4 h1:FVUpEprm58nMmBX4xkRdMDaIG5Nr4yy92HZAfGAw9bg= -github.com/cosmos/cosmos-sdk v0.47.4/go.mod h1:R5n+uM7vguVPFap4pgkdvQCT1nVo/OtPwrlAU40rvok= +github.com/cosmos/cosmos-proto v1.0.0-beta.5 h1:eNcayDLpip+zVLRLYafhzLvQlSmyab+RC5W7ZfmxJLA= +github.com/cosmos/cosmos-proto v1.0.0-beta.5/go.mod h1:hQGLpiIUloJBMdQMMWb/4wRApmI9hjHH05nefC0Ojec= +github.com/cosmos/cosmos-sdk v0.47.11 h1:0Qx7eORw0RJqPv+mvDuU8NQ1LV3nJJKJnPoYblWHolc= +github.com/cosmos/cosmos-sdk v0.47.11/go.mod h1:ADjORYzUQqQv/FxDi0H0K5gW/rAk1CiDR3ZKsExfJV0= github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= @@ -366,14 +397,14 @@ github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiK github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ4GUkT+tbFI= github.com/cosmos/gogoproto v1.4.11 h1:LZcMHrx4FjUgrqQSWeaGC1v/TeuVFqSLa43CC6aWR2g= github.com/cosmos/gogoproto v1.4.11/go.mod h1:/g39Mh8m17X8Q/GDEs5zYTSNaNnInBSohtaxzQnYq1Y= -github.com/cosmos/iavl v0.20.0 h1:fTVznVlepH0KK8NyKq8w+U7c2L6jofa27aFX6YGlm38= -github.com/cosmos/iavl v0.20.0/go.mod h1:WO7FyvaZJoH65+HFOsDir7xU9FWk2w9cHXNW1XHcl7A= -github.com/cosmos/ibc-go/v7 v7.0.1 h1:NIBNRWjlOoFvFQu1ZlgwkaSeHO5avf4C1YQiWegt8jw= -github.com/cosmos/ibc-go/v7 v7.0.1/go.mod h1:vEaapV6nuLPQlS+g8IKmxMo6auPi0i7HMv1PhViht/E= -github.com/cosmos/ics23/go v0.9.1-0.20221207100636-b1abd8678aab h1:I9ialKTQo7248V827Bba4OuKPmk+FPzmTVHsLXaIJWw= -github.com/cosmos/ics23/go v0.9.1-0.20221207100636-b1abd8678aab/go.mod h1:2CwqasX5dSD7Hbp/9b6lhK6BwoBDCBldx7gPKRukR60= -github.com/cosmos/ledger-cosmos-go v0.12.1 h1:sMBxza5p/rNK/06nBSNmsI/WDqI0pVJFVNihy1Y984w= -github.com/cosmos/ledger-cosmos-go v0.12.1/go.mod h1:dhO6kj+Y+AHIOgAe4L9HL/6NDdyyth4q238I9yFpD2g= +github.com/cosmos/iavl v0.20.1 h1:rM1kqeG3/HBT85vsZdoSNsehciqUQPWrR4BYmqE2+zg= +github.com/cosmos/iavl v0.20.1/go.mod h1:WO7FyvaZJoH65+HFOsDir7xU9FWk2w9cHXNW1XHcl7A= +github.com/cosmos/ibc-go/v7 v7.5.1 h1:KqS/g7W7EMX1OtOvufS8lWMJibOKpdgtNNZIU6fAgVU= +github.com/cosmos/ibc-go/v7 v7.5.1/go.mod h1:ktFg5GvKOyrGCqTWtW7Grj5uweU4ZapxrNeVS1CLLbo= +github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM= +github.com/cosmos/ics23/go v0.10.0/go.mod h1:ZfJSmng/TBNTBkFemHHHj5YY7VAU/MBU980F4VU1NG0= +github.com/cosmos/ledger-cosmos-go v0.12.4 h1:drvWt+GJP7Aiw550yeb3ON/zsrgW0jgh5saFCr7pDnw= +github.com/cosmos/ledger-cosmos-go v0.12.4/go.mod h1:fjfVWRf++Xkygt9wzCsjEBdjcf7wiiY35fv3ctT+k4M= github.com/cosmos/rosetta-sdk-go v0.10.0 h1:E5RhTruuoA7KTIXUcMicL76cffyeoyvNybzUGSKFTcM= github.com/cosmos/rosetta-sdk-go v0.10.0/go.mod h1:SImAZkb96YbwvoRkzSMQB6noNJXFgWl/ENIznEoYQI4= github.com/cpuguy83/dockercfg v0.3.1 h1:/FpZ+JaygUR/lZP2NlFI2DVfrOEMAIKP5wWEJdoYe9E= @@ -381,8 +412,8 @@ github.com/cpuguy83/dockercfg v0.3.1/go.mod h1:sugsbF4//dDlL/i+S+rtpIWp+5h0BHJHf github.com/cpuguy83/go-md2man v1.0.10 h1:BSKMNlYxDvnunlTymqtgONjNnaRV1sTpcovwwjF22jk= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= -github.com/cpuguy83/go-md2man/v2 v2.0.3 h1:qMCsGGgs+MAzDFyp9LpAe1Lqy/fY/qCovCm0qnXZOBM= -github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/cpuguy83/go-md2man/v2 v2.0.4 h1:wfIWP927BUkWJb2NmU/kNDYIBTh/ziUX91+lVfRxZq4= +github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/crate-crypto/go-ipa v0.0.0-20231025140028-3c0104f4b233 h1:d28BXYi+wUpz1KBmiF9bWrjEMacUEREV6MBi2ODnrfQ= github.com/crate-crypto/go-ipa v0.0.0-20231025140028-3c0104f4b233/go.mod h1:geZJZH3SzKCqnz5VT0q/DyIG/tvu/dZk+VIfXicupJs= github.com/crate-crypto/go-kzg-4844 v0.7.0 h1:C0vgZRk4q4EZ/JgPfzuSoxdCq3C3mOZMBShovmncxvA= @@ -393,10 +424,6 @@ github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7Do github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/creack/pty v1.1.18 h1:n56/Zwd5o6whRC5PMGretI4IdRLlmBXYNjScPaBgsbY= github.com/creack/pty v1.1.18/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4= -github.com/cucumber/common/gherkin/go/v22 v22.0.0 h1:4K8NqptbvdOrjL9DEea6HFjSpbdT9+Q5kgLpmmsHYl0= -github.com/cucumber/common/gherkin/go/v22 v22.0.0/go.mod h1:3mJT10B2GGn3MvVPd3FwR7m2u4tLhSRhWUqJU4KN4Fg= -github.com/cucumber/common/messages/go/v17 v17.1.1 h1:RNqopvIFyLWnKv0LfATh34SWBhXeoFTJnSrgm9cT/Ts= -github.com/cucumber/common/messages/go/v17 v17.1.1/go.mod h1:bpGxb57tDE385Rb2EohgUadLkAbhoC4IyCFi89u/JQI= github.com/daaku/go.zipexe v1.0.0/go.mod h1:z8IiR6TsVLEYKwXAoE/I+8ys/sDkgTzSL0CLnGVd57E= github.com/danieljoos/wincred v1.1.2 h1:QLdCxFs1/Yl4zduvBdcHB8goaYk9RARS2SgLLRuAyr0= github.com/danieljoos/wincred v1.1.2/go.mod h1:GijpziifJoIBfYh+S7BbkdUTU4LfM+QnGqR5Vl2tAx0= @@ -406,8 +433,8 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/deckarep/golang-set/v2 v2.3.0 h1:qs18EKUfHm2X9fA50Mr/M5hccg2tNnVqsiBImnyDs0g= -github.com/deckarep/golang-set/v2 v2.3.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4= +github.com/deckarep/golang-set/v2 v2.6.0 h1:XfcQbWM1LlMB8BsJ8N9vW5ehnnPVIw0je80NsVHagjM= +github.com/deckarep/golang-set/v2 v2.6.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4= github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y= github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etlyjdBU4sfcs2WYQMs= @@ -419,7 +446,6 @@ github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f/go.mod h1:xH/i4TFM github.com/dfuse-io/logging v0.0.0-20201110202154-26697de88c79/go.mod h1:V+ED4kT/t/lKtH99JQmKIb0v9WL3VaYkJ36CfHlVECI= github.com/dfuse-io/logging v0.0.0-20210109005628-b97a57253f70 h1:CuJS05R9jmNlUK8GOxrEELPbfXm0EuGh/30LjkjN5vo= github.com/dfuse-io/logging v0.0.0-20210109005628-b97a57253f70/go.mod h1:EoK/8RFbMEteaCaz89uessDTnCWjbbcr+DXcBh4el5o= -github.com/dgraph-io/badger v1.6.0/go.mod h1:zwt7syl517jmP8s94KqSxTlM6IMsdhYy6psNgSztDR4= github.com/dgraph-io/badger/v2 v2.2007.4 h1:TRWBQg8UrlUhaFdco01nO2uXwzKS7zd+HVdwV/GHc4o= github.com/dgraph-io/badger/v2 v2.2007.4/go.mod h1:vSw/ax2qojzbN6eXHIx6KPKtCSHJN/Uz0X0VPruTIhk= github.com/dgraph-io/ristretto v0.0.3-0.20200630154024-f66de99634de/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70dGTu2u+Ahh6E= @@ -431,11 +457,12 @@ github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 h1:fAjc9m62+UWV/WA github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= -github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= +github.com/dgryski/trifles v0.0.0-20200323201526-dd97f9abfb48 h1:fRzb/w+pyskVMQ+UbP35JkH8yB7MYb4q/qhBarqZE6g= +github.com/dgryski/trifles v0.0.0-20200323201526-dd97f9abfb48/go.mod h1:if7Fbed8SFyPtHLHbg49SI7NAdJiC5WIA09pe59rfAA= github.com/digitalocean/godo v1.99.0 h1:gUHO7n9bDaZFWvbzOum4bXE0/09ZuYA9yA8idQHX57E= github.com/digitalocean/godo v1.99.0/go.mod h1:SsS2oXo2rznfM/nORlZ/6JaUJZFhmKTib1YhopUc8NA= -github.com/distribution/reference v0.5.0 h1:/FUIFXtfc/x2gpa5/VGfiGLuOIdYa1t65IKK2OFGvA0= -github.com/distribution/reference v0.5.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E= +github.com/distribution/reference v0.6.0 h1:0IXCQ5g4/QMHHkarYzh5l+u8T3t73zM5QvfrDyIgxBk= +github.com/distribution/reference v0.6.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E= github.com/dnaeon/go-vcr v1.2.0 h1:zHCHvJYTMh1N7xnV7zf1m1GPBF9Ad0Jk/whtQ1663qI= github.com/dnaeon/go-vcr v1.2.0/go.mod h1:R4UdLID7HZT3taECzJs4YgbbH6PIGXB6W/sc5OLb6RQ= github.com/docker/distribution v2.8.2+incompatible h1:T3de5rq0dB1j30rp0sA2rER+m322EBzniBPB6ZIzuh8= @@ -446,7 +473,6 @@ github.com/docker/go-connections v0.5.0 h1:USnMq7hx7gwdVZq1L49hLXaFtUdTADjXGp+uj github.com/docker/go-connections v0.5.0/go.mod h1:ov60Kzw0kKElRwhNs9UlUHAE/F9Fe6GLaXnqyDdmEXc= github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= -github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= github.com/dominikbraun/graph v0.23.0 h1:TdZB4pPqCLFxYhdyMFb1TBdFxp8XLcJfTTBQucVPgCo= github.com/dominikbraun/graph v0.23.0/go.mod h1:yOjYyogZLY1LSG9E33JWZJiq5k83Qy2C6POAuiViluc= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= @@ -456,16 +482,12 @@ github.com/dvsekhvalnov/jose2go v1.7.0 h1:bnQc8+GMnidJZA8zc6lLEAb4xNrIqHwO+9Tzqv github.com/dvsekhvalnov/jose2go v1.7.0/go.mod h1:QsHjhyTlD/lAVqn/NSbVZmSCGeDehTB/mPZadG+mhXU= github.com/edsrzf/mmap-go v1.1.0 h1:6EUwBLQ/Mcr1EYLE4Tn1VdW1A4ckqCQWZBw8Hr0kjpQ= github.com/edsrzf/mmap-go v1.1.0/go.mod h1:19H/e8pUPLicwkyNgOykDXkJ9F0MHE+Z52B8EIth78Q= -github.com/eknkc/amber v0.0.0-20171010120322-cdade1c07385/go.mod h1:0vRUJqYpeSZifjYj7uP3BG/gKcuzL9xWVV/Y+cK33KM= -github.com/emicklei/go-restful/v3 v3.10.2 h1:hIovbnmBTLjHXkqEBUz3HGpXZdM7ZrE9fJIZIqlJLqE= -github.com/emicklei/go-restful/v3 v3.10.2/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= +github.com/emicklei/go-restful/v3 v3.12.1 h1:PJMDIM/ak7btuL8Ex0iYET9hxM3CI2sjZtzpL63nKAU= +github.com/emicklei/go-restful/v3 v3.12.1/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= -github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= github.com/envoyproxy/go-control-plane v0.12.0 h1:4X+VP1GHd1Mhj6IB5mMeGbLCleqxjletLK6K0rbxyZI= github.com/envoyproxy/go-control-plane v0.12.0/go.mod h1:ZBTaoJ23lqITozF0M6G4/IragXCQKCnYbmlmtHvwRG0= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= @@ -473,40 +495,29 @@ github.com/envoyproxy/protoc-gen-validate v1.0.4 h1:gVPz/FMfvh57HdSJQyvBtF00j8JU github.com/envoyproxy/protoc-gen-validate v1.0.4/go.mod h1:qys6tmnRsYrQqIhm2bvKZH4Blx/1gTIZ2UKVY1M+Yew= github.com/esote/minmaxheap v1.0.0 h1:rgA7StnXXpZG6qlM0S7pUmEv1KpWe32rYT4x8J8ntaA= github.com/esote/minmaxheap v1.0.0/go.mod h1:Ln8+i7fS1k3PLgZI2JAo0iA1as95QnIYiGCrqSJ5FZk= -github.com/etcd-io/bbolt v1.3.3/go.mod h1:ZF2nL25h33cCyBtcyWeZ2/I3HQOfTP+0PIEvHjkjCrw= github.com/ethereum/c-kzg-4844 v0.4.0 h1:3MS1s4JtA868KpJxroZoepdV0ZKBp3u/O5HcZ7R3nlY= github.com/ethereum/c-kzg-4844 v0.4.0/go.mod h1:VewdlzQmpT5QSrVhbBuGoCdFJkpaJlO1aQputP83wc0= github.com/ethereum/go-ethereum v1.13.8 h1:1od+thJel3tM52ZUNQwvpYOeRHlbkVFZ5S8fhi0Lgsg= github.com/ethereum/go-ethereum v1.13.8/go.mod h1:sc48XYQxCzH3fG9BcrXCOOgQk2JfZzNAmIKnceogzsA= -github.com/evanphx/json-patch v0.5.2/go.mod h1:ZWS5hhDbVDyob71nXKNL0+PWn6ToqBHMikGIFbs31qQ= github.com/evanphx/json-patch v5.6.0+incompatible h1:jBYDEEiFBPxA0v50tFdvOzQQTCvpL6mnFh5mB2/l16U= github.com/evanphx/json-patch v5.6.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -github.com/evanphx/json-patch/v5 v5.6.0 h1:b91NhWfaz02IuVxO9faSllyAtNXHMPkC5J8sJCLunww= -github.com/evanphx/json-patch/v5 v5.6.0/go.mod h1:G79N1coSVB93tBe7j6PhzjmR3/2VvlbKOFpnXhI9Bw4= +github.com/evanphx/json-patch/v5 v5.9.0 h1:kcBlZQbplgElYIlo/n1hJbls2z/1awpXxpRi0/FOJfg= +github.com/evanphx/json-patch/v5 v5.9.0/go.mod h1:VNkHZ/282BpEyt/tObQO8s5CMPmYYq14uClGH4abBuQ= github.com/exponent-io/jsonpath v0.0.0-20210407135951-1de76d718b3f h1:Wl78ApPPB2Wvf/TIe2xdyJxTlb6obmF18d8QdkxNDu4= github.com/exponent-io/jsonpath v0.0.0-20210407135951-1de76d718b3f/go.mod h1:OSYXu++VVOHnXeitef/D8n/6y4QV8uLHSFXX4NeXMGc= -github.com/facebookgo/ensure v0.0.0-20200202191622-63f1cf65ac4c h1:8ISkoahWXwZR41ois5lSJBSVw4D0OV19Ht/JSTzvSv0= -github.com/facebookgo/ensure v0.0.0-20200202191622-63f1cf65ac4c/go.mod h1:Yg+htXGokKKdzcwhuNDwVvN+uBxDGXJ7G/VN1d8fa64= -github.com/facebookgo/stack v0.0.0-20160209184415-751773369052 h1:JWuenKqqX8nojtoVVWjGfOF9635RETekkoH6Cc9SX0A= -github.com/facebookgo/stack v0.0.0-20160209184415-751773369052/go.mod h1:UbMTZqLaRiH3MsBH8va0n7s1pQYcu3uTb8G4tygF4Zg= -github.com/facebookgo/subset v0.0.0-20200203212716-c811ad88dec4 h1:7HZCaLC5+BZpmbhCOZJ293Lz68O7PYrF2EzeiFMwCLk= -github.com/facebookgo/subset v0.0.0-20200203212716-c811ad88dec4/go.mod h1:5tD+neXqOorC30/tWg0LCSkrqj/AR6gu8yY8/fpw1q0= github.com/facette/natsort v0.0.0-20181210072756-2cd4dd1e2dcb h1:IT4JYU7k4ikYg1SCxNI1/Tieq/NFvh6dzLdgi7eu0tM= github.com/facette/natsort v0.0.0-20181210072756-2cd4dd1e2dcb/go.mod h1:bH6Xx7IW64qjjJq8M2u4dxNaBiDfKK+z/3eGDpXEQhc= -github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072/go.mod h1:duJ4Jxv5lDcvg4QuQr0oowTf7dz4/CR8NtyCooz9HL8= github.com/fatih/camelcase v1.0.0 h1:hxNvNX/xYBp0ovncs8WyWZrOrpBNub/JfaMvbURyft8= github.com/fatih/camelcase v1.0.0/go.mod h1:yN2Sb0lFhZJUdVvtELVWefmrXpuZESvPmqwoZc+/fpc= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= -github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM= -github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE= -github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= +github.com/fatih/color v1.17.0 h1:GlRw1BRJxkpqUCBKzKOw098ed57fEsKeNjpTe3cSjK4= +github.com/fatih/color v1.17.0/go.mod h1:YZ7TlrGPkiz6ku9fK3TLD/pl3CpsiFyu8N92HLgmosI= github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5 h1:FtmdgXiUlNeRsoNMFlKLDt+S+6hbjVMEW6RGQ7aUf7c= github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0= -github.com/flowstack/go-jsonschema v0.1.1/go.mod h1:yL7fNggx1o8rm9RlgXv7hTBWxdBM0rVwpMwimd3F3N0= github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= @@ -514,14 +525,12 @@ github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7z github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= -github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= -github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= -github.com/fvbommel/sortorder v1.0.2 h1:mV4o8B2hKboCdkJm+a7uX/SIpZob4JzUpc5GGnM45eo= -github.com/fvbommel/sortorder v1.0.2/go.mod h1:uk88iVf1ovNn1iLfgUVU2F9o5eO30ui720w+kxuqRs0= -github.com/fxamacker/cbor/v2 v2.5.0 h1:oHsG0V/Q6E/wqTS2O1Cozzsy69nqCiguo5Q1a1ADivE= -github.com/fxamacker/cbor/v2 v2.5.0/go.mod h1:TA1xS00nchWmaBnEIxPSE5oHLuJBAVvqrtAnWBwBCVo= -github.com/gabriel-vasile/mimetype v1.4.2 h1:w5qFW6JKBz9Y393Y4q372O9A7cUSequkh1Q7OhCmWKU= -github.com/gabriel-vasile/mimetype v1.4.2/go.mod h1:zApsH/mKG4w07erKIaJPFiX0Tsq9BFQgN3qGY5GnNgA= +github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= +github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= +github.com/fxamacker/cbor/v2 v2.7.0 h1:iM5WgngdRBanHcxugY4JySA0nk1wZorNOpTgCMedv5E= +github.com/fxamacker/cbor/v2 v2.7.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ= +github.com/gabriel-vasile/mimetype v1.4.3 h1:in2uUcidCuFcDKtdcBxlR0rJ1+fsokWf+uqxgUFjbI0= +github.com/gabriel-vasile/mimetype v1.4.3/go.mod h1:d8uq/6HKRL6CGdk+aubisF/M5GcPfT7nKyLpA0lbSSk= github.com/gagliardetto/binary v0.7.7 h1:QZpT38+sgoPg+TIQjH94sLbl/vX+nlIRA37pEyOsjfY= github.com/gagliardetto/binary v0.7.7/go.mod h1:mUuay5LL8wFVnIlecHakSZMvcdqfs+CsotR5n77kyjM= github.com/gagliardetto/gofuzz v1.2.2 h1:XL/8qDMzcgvR4+CyRQW9UGdwPRPMHVJfqQ/uMvSUuQw= @@ -530,16 +539,14 @@ github.com/gagliardetto/solana-go v1.8.4 h1:vmD/JmTlonyXGy39bAo0inMhmbdAwV7rXZtL github.com/gagliardetto/solana-go v1.8.4/go.mod h1:i+7aAyNDTHG0jK8GZIBSI4OVvDqkt2Qx+LklYclRNG8= github.com/gagliardetto/treeout v0.1.4 h1:ozeYerrLCmCubo1TcIjFiOWTTGteOOHND1twdFpgwaw= github.com/gagliardetto/treeout v0.1.4/go.mod h1:loUefvXTrlRG5rYmJmExNryyBRh8f89VZhmMOyCyqok= -github.com/gavv/httpexpect v2.0.0+incompatible/go.mod h1:x+9tiU1YnrOvnB725RkpoLv1M62hOWzwo5OXotisrKc= github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08 h1:f6D9Hr8xV8uYKlyuj8XIruxlh9WjVjdh1gIicAS7ays= github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= github.com/gballet/go-verkle v0.1.1-0.20231031103413-a67434b50f46 h1:BAIP2GihuqhwdILrV+7GJel5lyPV3u1+PgzrWLc0TkE= github.com/gballet/go-verkle v0.1.1-0.20231031103413-a67434b50f46/go.mod h1:QNpY22eby74jVhqH4WhDLDwxc/vqsern6pW+u2kbkpc= github.com/gedex/inflector v0.0.0-20170307190818-16278e9db813 h1:Uc+IZ7gYqAf/rSGFplbWBSHaGolEQlNLgMgSE3ccnIQ= github.com/gedex/inflector v0.0.0-20170307190818-16278e9db813/go.mod h1:P+oSoE9yhSRvsmYyZsshflcR6ePWYLql6UU1amW13IM= -github.com/getsentry/sentry-go v0.12.0/go.mod h1:NSap0JBYWzHND8oMbyi0+XZhUalc1TBdRL1M71JZW2c= -github.com/getsentry/sentry-go v0.19.0 h1:BcCH3CN5tXt5aML+gwmbFwVptLLQA+eT866fCO9wVOM= -github.com/getsentry/sentry-go v0.19.0/go.mod h1:y3+lGEFEFexZtpbG1GUE2WD/f9zGyKYwpEqryTOC/nE= +github.com/getsentry/sentry-go v0.23.0 h1:dn+QRCeJv4pPt9OjVXiMcGIBIefaTJPw/h0bZWO05nE= +github.com/getsentry/sentry-go v0.23.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gin-contrib/cors v1.5.0 h1:DgGKV7DDoOn36DFkNtbHrjoRiT5ExCe+PC9/xp7aKvk= github.com/gin-contrib/cors v1.5.0/go.mod h1:TvU7MAZ3EwrPLI2ztzTt3tqgvBCq+wn8WpZmfADjupI= @@ -549,17 +556,12 @@ github.com/gin-contrib/sessions v0.0.5 h1:CATtfHmLMQrMNpJRgzjWXD7worTh7g7ritsQfm github.com/gin-contrib/sessions v0.0.5/go.mod h1:vYAuaUPqie3WUSsft6HUlCjlwwoJQs97miaG2+7neKY= github.com/gin-contrib/size v0.0.0-20230212012657-e14a14094dc4 h1:Z9J0PVIt1PuibOShaOw1jH8hUYz+Ak8NLsR/GI0Hv5I= github.com/gin-contrib/size v0.0.0-20230212012657-e14a14094dc4/go.mod h1:CEPcgZiz8998l9E8fDm16h8UfHRL7b+5oG0j/0koeVw= -github.com/gin-contrib/sse v0.0.0-20190301062529-5545eab6dad3/go.mod h1:VJ0WA2NBN22VlZ2dKZQPAPnyWw5XTlK1KymzLKsr59s= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= -github.com/gin-gonic/gin v1.4.0/go.mod h1:OW2EZn3DO8Ln9oIKOvM++LBO+5UPHJJDH72/q/3rZdM= -github.com/gin-gonic/gin v1.6.3/go.mod h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M= github.com/gin-gonic/gin v1.9.1 h1:4idEAncQnU5cB7BeOkPtxjfCSye0AAm1R0RVIqJ+Jmg= github.com/gin-gonic/gin v1.9.1/go.mod h1:hPrL7YrpYKXt5YId3A/Tnip5kqbEAP+KLuI3SUcPTeU= github.com/go-asn1-ber/asn1-ber v1.5.5 h1:MNHlNMBDgEKD4TcKr36vQN68BA00aDfjIt3/bD50WnA= github.com/go-asn1-ber/asn1-ber v1.5.5/go.mod h1:hEBeB/ic+5LoWskz+yKT7vGhhPYkProFKoKdwZRWMe0= -github.com/go-check/check v0.0.0-20180628173108-788fd7840127/go.mod h1:9ES+weclKsC9YodN5RgxqK/VD9HM9JsCSh7rNhMZE98= -github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= @@ -567,7 +569,6 @@ github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2 github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-json-experiment/json v0.0.0-20231102232822-2e55bd4e08b0 h1:ymLjT4f35nQbASLnvxEde4XOBL+Sn7rFuV+FOJqkljg= github.com/go-json-experiment/json v0.0.0-20231102232822-2e55bd4e08b0/go.mod h1:6daplAwHHGbUGib4990V3Il26O0OC4aRyvewaaAihaA= -github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.12.0 h1:e4o3o3IsBfAKQh5Qbbiqyfu97Ku7jrO/JbohvztANh4= github.com/go-kit/kit v0.12.0/go.mod h1:lHd+EkCZPIwYItmGDDRdhinkzX2A1sj+M9biaEaizzs= @@ -575,22 +576,20 @@ github.com/go-kit/log v0.2.1 h1:MRVx0/zhvdseW+Gza6N9rVzU/IVzaeE1SFI4raAhmBU= github.com/go-kit/log v0.2.1/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= github.com/go-ldap/ldap/v3 v3.4.6 h1:ert95MdbiG7aWo/oPYp9btL3KJlMPKnP58r09rI8T+A= github.com/go-ldap/ldap/v3 v3.4.6/go.mod h1:IGMQANNtxpsOzj7uUAMjpGBaOVTC4DYyIy8VsTdxmtc= -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.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= github.com/go-logfmt/logfmt v0.6.0 h1:wGYYu3uicYdqXVgoYbvnkrPVXkuLM1p1ifugDMEdRi4= github.com/go-logfmt/logfmt v0.6.0/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= -github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= -github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= +github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= -github.com/go-logr/zapr v1.2.3 h1:a9vnzlIBPQBBkeaR9IuMUfmVOrQlkoC4YfPoFkX3T7A= -github.com/go-logr/zapr v1.2.3/go.mod h1:eIauM6P8qSvTw5o2ez6UEAfGjQKrxQTl5EoK+Qa2oG4= -github.com/go-martini/martini v0.0.0-20170121215854-22fa46961aab/go.mod h1:/P9AEU963A2AYjv4d1V5eVL1CQbEJq6aCNHDDjibzu8= -github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= +github.com/go-logr/zapr v1.3.0 h1:XGdV8XW8zdwFiwOA2Dryh1gj2KRQyOOoNmBy4EplIcQ= +github.com/go-logr/zapr v1.3.0/go.mod h1:YKepepNBd1u/oyhd/yQmtjVXmm9uML4IXUgMOwR8/Gg= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= +github.com/go-ole/go-ole v1.3.0 h1:Dt6ye7+vXGIKZ7Xtk4s6/xVdGDQynvom7xCFEdWr6uE= +github.com/go-ole/go-ole v1.3.0/go.mod h1:5LS6F96DhAwUc7C+1HLexzMXY1xGRSryjyPPKW6zv78= github.com/go-openapi/analysis v0.21.2/go.mod h1:HZwRk4RRisyG8vx2Oe6aqeSQcoxRp47Xkp3+K6q+LdY= github.com/go-openapi/analysis v0.21.4 h1:ZDFLvSNxpDaomuCueM0BlSXxpANBlFYiBvr+GXrvIHc= github.com/go-openapi/analysis v0.21.4/go.mod h1:4zQ35W4neeZTqh3ol0rv/O8JBbka9QyAgQRPp9y3pfo= @@ -601,13 +600,12 @@ github.com/go-openapi/errors v0.20.4 h1:unTcVm6PispJsMECE3zWgvG4xTiKda1LIR5rCRWL github.com/go-openapi/errors v0.20.4/go.mod h1:Z3FlZ4I8jEGxjUK+bugx3on2mIAk4txuAOhlsB1FSgk= github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs= -github.com/go-openapi/jsonpointer v0.20.0 h1:ESKJdU9ASRfaPNOPRx12IUyA1vn3R9GiE3KYD14BXdQ= -github.com/go-openapi/jsonpointer v0.20.0/go.mod h1:6PGzBjjIIumbLYysB73Klnms1mwnU4G3YHOECG3CedA= +github.com/go-openapi/jsonpointer v0.21.0 h1:YgdVicSA9vH5RiHs9TZW5oyafXZFc6+2Vc1rr/O9oNQ= +github.com/go-openapi/jsonpointer v0.21.0/go.mod h1:IUyH9l/+uyhIYQ/PXVA41Rexl+kOkAPDdXEYns6fzUY= github.com/go-openapi/jsonreference v0.19.6/go.mod h1:diGHMEHg2IqXZGKxqyvWdfWU/aim5Dprw5bqpKkTvns= github.com/go-openapi/jsonreference v0.20.0/go.mod h1:Ag74Ico3lPc+zR+qjn4XBUmXymS4zJbYVCZmcgkasdo= -github.com/go-openapi/jsonreference v0.20.2 h1:3sVjiK66+uXK/6oQ8xgcRKcFgQ5KXa2KvnJRumpMGbE= -github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k= +github.com/go-openapi/jsonreference v0.21.0 h1:Rs+Y7hSXT83Jacb7kFyjn4ijOuVGSvOdF2+tg1TRrwQ= +github.com/go-openapi/jsonreference v0.21.0/go.mod h1:LmZmgsrTkVg9LG4EaHeY8cBDslNPMo06cago5JNLkm4= github.com/go-openapi/loads v0.21.1/go.mod h1:/DtAMXXneXFjbQMGEtbamCZb+4x7eGwkvZCvBmwUG+g= github.com/go-openapi/loads v0.21.2 h1:r2a/xFIYeZ4Qd2TnGpWDIQNcP80dIaZgf704za8enro= github.com/go-openapi/loads v0.21.2/go.mod h1:Jq58Os6SSGz0rzh62ptiu8Z31I+OTHqmULx5e/gJbNw= @@ -623,23 +621,18 @@ github.com/go-openapi/strfmt v0.21.7/go.mod h1:adeGTkxE44sPyLk0JV235VQAO/ZXUr8KA github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-openapi/swag v0.19.15/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= github.com/go-openapi/swag v0.21.1/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= -github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= -github.com/go-openapi/swag v0.22.4 h1:QLMzNJnMGPRNDCbySlcj1x01tzU8/9LTTL9hZZZogBU= -github.com/go-openapi/swag v0.22.4/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= +github.com/go-openapi/swag v0.23.0 h1:vsEVJDUo2hPJ2tu0/Xc+4noaxyEffXNIs3cOULZ+GrE= +github.com/go-openapi/swag v0.23.0/go.mod h1:esZ8ITTYEsH1V2trKHjAN8Ai7xHb8RV+YSZ577vPjgQ= github.com/go-openapi/validate v0.22.1 h1:G+c2ub6q47kfX1sOBLwIQwzBVt8qmOAARyo/9Fqs9NU= github.com/go-openapi/validate v0.22.1/go.mod h1:rjnrwK57VJ7A8xqfpAOEKRH8yQSGUriMu5/zuPSQ1hg= -github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s= github.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= -github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= -github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= -github.com/go-playground/validator/v10 v10.2.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI= -github.com/go-playground/validator/v10 v10.15.5 h1:LEBecTWb/1j5TNY1YYG2RcOUN3R7NLylN+x8TTueE24= -github.com/go-playground/validator/v10 v10.15.5/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU= +github.com/go-playground/validator/v10 v10.22.0 h1:k6HsTZ0sTnROkhS//R0O+55JgM8C4Bx7ia+JlgcnOao= +github.com/go-playground/validator/v10 v10.22.0/go.mod h1:dbuPbCMFw/DrkbEynArYaCwl3amGuJotoKCe95atGMM= github.com/go-redis/redis/v8 v8.11.5 h1:AcZZR7igkdvfVmQTPnu9WE37LRrO/YrBH5zWyjDC0oI= github.com/go-redis/redis/v8 v8.11.5/go.mod h1:gREzHqY1hg6oD9ngVRbLStwAWKhA0FEgq8Jd4h5lpwo= github.com/go-resty/resty/v2 v2.11.0 h1:i7jMfNOJYMp69lq7qozJP+bjgzfAzeOhuGlyDrqxT/8= @@ -649,9 +642,12 @@ github.com/go-sql-driver/mysql v1.8.1/go.mod h1:wEBSXgmK//2ZFJyE+qWnIsVGmvmEKlqw github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= -github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls= +github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= +github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= github.com/go-test/deep v1.0.4 h1:u2CU3YKy9I2pmu9pX0eq50wCgjfGIt539SqR7FbHiho= github.com/go-test/deep v1.0.4/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= +github.com/go-viper/mapstructure/v2 v2.1.0 h1:gHnMa2Y/pIxElCH2GlZZ1lZSsn6XMtufpGyP1XxdC/w= +github.com/go-viper/mapstructure/v2 v2.1.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= github.com/go-webauthn/webauthn v0.9.4 h1:YxvHSqgUyc5AK2pZbqkWWR55qKeDPhP8zLDr6lpIc2g= github.com/go-webauthn/webauthn v0.9.4/go.mod h1:LqupCtzSef38FcxzaklmOn7AykGKhAhr9xlRbdbgnTw= github.com/go-webauthn/x v0.1.5 h1:V2TCzDU2TGLd0kSZOXdrqDVV5JB9ILnKxA9S53CSBw0= @@ -682,15 +678,6 @@ github.com/gobuffalo/packd v0.1.0/go.mod h1:M2Juc+hhDXf/PnmBANFCqx4DM3wRbgDvnVWe github.com/gobuffalo/packr/v2 v2.0.9/go.mod h1:emmyGweYTm6Kdper+iywB6YK5YzuKchGtJQZ0Odn4pQ= github.com/gobuffalo/packr/v2 v2.2.0/go.mod h1:CaAwI0GPIAv+5wKLtv8Afwl+Cm78K/I/VCm/3ptBN+0= github.com/gobuffalo/syncx v0.0.0-20190224160051-33c29581e754/go.mod h1:HhnNqWY95UYwwW3uSASeV7vtgYkT2t16hJgV3AEPUpw= -github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo= -github.com/gobwas/httphead v0.1.0 h1:exrUm0f4YX0L7EBwZHuCF4GDp8aJfVeBrlLQrs6NqWU= -github.com/gobwas/httphead v0.1.0/go.mod h1:O/RXo79gxV8G+RqlR/otEwx4Q36zl9rqC5u12GKvMCM= -github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= -github.com/gobwas/pool v0.2.1 h1:xfeeEhW7pwmX8nuLVlqbzVc7udMDrwetjEv+TZIz1og= -github.com/gobwas/pool v0.2.1/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= -github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM= -github.com/gobwas/ws v1.2.1 h1:F2aeBZrm2NDsc7vbovKrWSogd4wvfAxg0FQ89/iqOTk= -github.com/gobwas/ws v1.2.1/go.mod h1:hRKAFb8wOxFROYNsT1bqfWnhX+b5MFeJM9r2ZSwg/KY= github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU= github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 h1:ZpnhV/YsD2/4cESfV5+Hoeu/iUR3ruzNvZ+yQfO03a0= @@ -704,18 +691,15 @@ github.com/gofrs/uuid v4.4.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRx github.com/gogo/googleapis v0.0.0-20180223154316-0cd9801be74a/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= github.com/gogo/googleapis v1.4.1 h1:1Yx4Myt7BxzvUr5ldGSbwYiZG6t9wGBZ+8/fX3Wvtq0= github.com/gogo/googleapis v1.4.1/go.mod h1:2lpHqI5OcWCtVElxXnPt+s8oJvMpySlOyM6xDCrzib4= -github.com/gogo/status v1.1.0/go.mod h1:BFv9nrluPLmrS0EmGVvLaPNmRosr9KapBYd5/hpY1WM= github.com/gogo/status v1.1.1 h1:DuHXlSFHNKqTQ+/ACf5Vs6r4X/dH2EgIzR9Vr+H65kg= github.com/gogo/status v1.1.1/go.mod h1:jpG3dM5QPcqu19Hg8lkUhBFBa3TcLs1DG7+2Jqci7oU= -github.com/golang-jwt/jwt v3.2.2+incompatible h1:IfV12K8xAKAnZqdXVzCZ+TOjboZ2keLg81eXfW3O+oY= -github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg= github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= github.com/golang-jwt/jwt/v5 v5.2.0 h1:d/ix8ftRUorsN+5eMIlF4T6J8CAt9rch3My2winC1Jw= github.com/golang-jwt/jwt/v5 v5.2.0/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/glog v1.2.0 h1:uCdmnmatrKCgMBlM4rMuJZWOkPDqdbZPnrMXDY4gI68= -github.com/golang/glog v1.2.0/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w= +github.com/golang/glog v1.2.1 h1:OptwRhECazUx5ix5TTWC3EZhsZEHWcYWY4FQHTIubm4= +github.com/golang/glog v1.2.1/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w= github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -756,15 +740,12 @@ github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEW github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb h1:PBC98N2aIaM3XXiurYmW7fx4GZkL8feAMVq7nEjURHk= github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/gomodule/redigo v1.7.1-0.20190724094224-574c33c3df38/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.1.2 h1:xf4v41cLI2Z6FxbKm+8Bu+m8ifhj15JuZ9sa0jZCMUU= github.com/google/btree v1.1.2/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4= -github.com/google/gnostic v0.6.9 h1:ZK/5VhkoX835RikCHpSUJV9a+S3e1zLh59YnyWeBW+0= -github.com/google/gnostic v0.6.9/go.mod h1:Nm8234We1lq6iB9OmlgNv3nH91XLLVZHCDayfA3xq+E= -github.com/google/gnostic-models v0.6.8 h1:yo/ABAfM5IMRsS1VnXjTBvUb61tFIHozhlYvRgGre9I= -github.com/google/gnostic-models v0.6.8/go.mod h1:5n7qKqH0f5wFt+aWF8CW6pZLLNOfYuF5OpfBSENuI8U= +github.com/google/gnostic-models v0.6.9-0.20230804172637-c7be7c783f49 h1:0VpGH+cDhbDtdcweoyCVsF3fhN8kejK6rFe/2FFX2nU= +github.com/google/gnostic-models v0.6.9-0.20230804172637-c7be7c783f49/go.mod h1:BkkQ4L1KS1xMt2aWSPStnn55ChGC0DPOn2FQYj+f25M= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= @@ -774,16 +755,15 @@ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= +github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-github/v41 v41.0.0 h1:HseJrM2JFf2vfiZJ8anY2hqBjdfY1Vlj/K27ueww4gg= github.com/google/go-github/v41 v41.0.0/go.mod h1:XgmCA5H323A9rtgExdTcnDkcqp6S30AVACCBDOonIxg= -github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= github.com/google/go-tpm v0.9.0 h1:sQF6YqWMi+SCXpsmS3fd21oPy/vSddwZry4JnmltHVk= @@ -794,7 +774,6 @@ github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= -github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/orderedcode v0.0.1 h1:UzfcAexk9Vhv8+9pNOgRu41f16lHq725vPwnSeiG/Us= github.com/google/orderedcode v0.0.1/go.mod h1:iVyU4/qPKHY5h/wSd6rZZCDcLJNxiWO6dvsYES2Sb20= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= @@ -804,12 +783,9 @@ github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20231023181126-ff6d637d2a7b h1:RMpPgZTSApbPf7xaVel+QkoGPRLFLrwFO89uDUHEGf0= -github.com/google/pprof v0.0.0-20231023181126-ff6d637d2a7b/go.mod h1:czg5+yv1E0ZGTi6S6vVK1mke0fV+FaUhNGcd6VRS9Ik= +github.com/google/pprof v0.0.0-20240525223248-4bfdf5a9a2af h1:kmjWCqn2qkEml422C2Rrd27c3VGxi6a/6HNq8QmHRKM= +github.com/google/pprof v0.0.0-20240525223248-4bfdf5a9a2af/go.mod h1:K1liHPHnj73Fdn/EKuT8nrFqBihUSKXoLYU0BuatOYo= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/s2a-go v0.1.7 h1:60BLSyTrOV4/haCDW4zb1guZItoSq8foHCXrAnjBo/o= github.com/google/s2a-go v0.1.7/go.mod h1:50CgR4k1jNlWBu4UfS4AcfhVe1r6pdZPygJ3R8F0Qdw= @@ -818,7 +794,6 @@ github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3 github.com/google/subcommands v1.2.0/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -826,9 +801,8 @@ github.com/googleapis/enterprise-certificate-proxy v0.3.2 h1:Vie5ybvEvT75RniqhfF github.com/googleapis/enterprise-certificate-proxy v0.3.2/go.mod h1:VLSiSSBs/ksPL8kq3OBOQ6WRI2QnaFynd1DCjZ62+V0= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/googleapis/gax-go/v2 v2.12.2 h1:mhN09QQW1jEWeMF74zGR81R30z4VJzjZsfkUhuHF+DA= -github.com/googleapis/gax-go/v2 v2.12.2/go.mod h1:61M8vcyyXR2kqKFxKrfA22jaA8JGF7Dc8App1U3H6jc= -github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= +github.com/googleapis/gax-go/v2 v2.12.3 h1:5/zPPDvw8Q1SuXjrqrZslrqT7dL/uJT2CQii/cLCKqA= +github.com/googleapis/gax-go/v2 v2.12.3/go.mod h1:AKloxT6GtNbaLm8QTNSidHUVsHYcBHwWRvkNFJUQcS4= github.com/gophercloud/gophercloud v1.5.0 h1:cDN6XFCLKiiqvYpjQLq9AiM7RDRbIC9450WpPH+yvXo= github.com/gophercloud/gophercloud v1.5.0/go.mod h1:aAVqcocTSXh2vYFZ1JTvx4EQmfgzxRcNupUfxZbBNDM= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= @@ -843,7 +817,6 @@ github.com/gorilla/securecookie v1.1.2 h1:YCIWL56dvtr73r6715mJs5ZvhtnY73hBvEF8kX github.com/gorilla/securecookie v1.1.2/go.mod h1:NfCASbcHqRSY+3a8tlWJwsQap2VX5pwzwo4h3eOamfo= github.com/gorilla/sessions v1.2.2 h1:lqzMYz6bOfvn2WriPUjNByzeXIlVzURcPmgMczkmTjY= github.com/gorilla/sessions v1.2.2/go.mod h1:ePLdVu+jbEgHH+KWw8I1z2wqd0BAdAQh/8LRvBeoNcQ= -github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY= github.com/gorilla/websocket v1.5.1/go.mod h1:x3kM2JMyaluk02fnUJpQuwD2dCS5NDG2ZHL0uE0tcaY= @@ -857,16 +830,16 @@ github.com/grafana/loki v1.6.2-0.20231215164305-b51b7d7b5503 h1:gdrsYbmk8822v6qv github.com/grafana/loki v1.6.2-0.20231215164305-b51b7d7b5503/go.mod h1:d8seWXCEXkL42mhuIJYcGi6DxfehzoIpLrMQWJojvOo= github.com/grafana/loki/pkg/push v0.0.0-20231201111602-11ef833ed3e4 h1:wQ0FnSeebhJIBkgYOD06Mxk9HV2KhtEG0hp/7R+5RUQ= github.com/grafana/loki/pkg/push v0.0.0-20231201111602-11ef833ed3e4/go.mod h1:f3JSoxBTPXX5ec4FxxeC19nTBSxoTz+cBgS3cYLMcr0= -github.com/grafana/pyroscope-go v1.1.1 h1:PQoUU9oWtO3ve/fgIiklYuGilvsm8qaGhlY4Vw6MAcQ= -github.com/grafana/pyroscope-go v1.1.1/go.mod h1:Mw26jU7jsL/KStNSGGuuVYdUq7Qghem5P8aXYXSXG88= -github.com/grafana/pyroscope-go/godeltaprof v0.1.6 h1:nEdZ8louGAplSvIJi1HVp7kWvFvdiiYg3COLlTwJiFo= -github.com/grafana/pyroscope-go/godeltaprof v0.1.6/go.mod h1:Tk376Nbldo4Cha9RgiU7ik8WKFkNpfds98aUzS8omLE= +github.com/grafana/pyroscope-go v1.1.2 h1:7vCfdORYQMCxIzI3NlYAs3FcBP760+gWuYWOyiVyYx8= +github.com/grafana/pyroscope-go v1.1.2/go.mod h1:HSSmHo2KRn6FasBA4vK7BMiQqyQq8KSuBKvrhkXxYPU= +github.com/grafana/pyroscope-go/godeltaprof v0.1.8 h1:iwOtYXeeVSAeYefJNaxDytgjKtUuKQbJqgAIjlnicKg= +github.com/grafana/pyroscope-go/godeltaprof v0.1.8/go.mod h1:2+l7K7twW49Ct4wFluZD3tZ6e0SjanjcUUBPVD/UuGU= github.com/grafana/regexp v0.0.0-20221122212121-6b5c0a4cb7fd h1:PpuIBO5P3e9hpqBD0O/HjhShYuM6XE0i/lbE6J94kww= github.com/grafana/regexp v0.0.0-20221122212121-6b5c0a4cb7fd/go.mod h1:M5qHK+eWfAv8VR/265dIuEpL3fNfeC21tXXp9itM24A= github.com/graph-gophers/dataloader v5.0.0+incompatible h1:R+yjsbrNq1Mo3aPG+Z/EKYrXrXXUNJHOgbRt+U6jOug= github.com/graph-gophers/dataloader v5.0.0+incompatible/go.mod h1:jk4jk0c5ZISbKaMe8WsVopGB5/15GvGHMdMdPtwlRp4= -github.com/graph-gophers/graphql-go v1.3.0 h1:Eb9x/q6MFpCLz7jBCiP/WTxjSDrYLR1QY41SORZyNJ0= -github.com/graph-gophers/graphql-go v1.3.0/go.mod h1:9CQHMSxwO4MprSdzoIEobiHpoLtHm77vfxsvsIN5Vuc= +github.com/graph-gophers/graphql-go v1.5.0 h1:fDqblo50TEpD0LY7RXk/LFVYEVqo3+tXMNMPSVXA1yc= +github.com/graph-gophers/graphql-go v1.5.0/go.mod h1:YtmJZDLbF1YYNrlNAuiO5zAStUWc3XZT07iGsVqe1Os= github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79 h1:+ngKgrYPPJrOjhax5N+uePQ0Fh1Z7PheYoUI/0nzkPA= github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= @@ -880,8 +853,8 @@ github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgf github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 h1:bkypFPDjIYGfCYD5mRBvpqxfYX1YCS1PXdKYWi8FsN0= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0/go.mod h1:P+Lt/0by1T8bfcF3z737NnSbmxQAppXMRziHUxPOC8k= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0 h1:asbCHRVmodnJTuQ3qamDwqVOIjwqUPTYmYuemVOx+Ys= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0/go.mod h1:ggCgvZ2r7uOoQjOyu2Y1NhHmEPPzzuhWgcza5M1Ji1I= github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645/go.mod h1:6iZfnjpejD4L/4DwD7NryNaJyCQdzwWwH2MWhCA90Kw= github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c h1:6rhixN/i8ZofjG1Y75iExal34USq5p+wiN1tpie8IrU= github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c/go.mod h1:NMPJylDgVpX0MLRlPy15sqSwOFv/U1GZ2m21JhFfek0= @@ -891,8 +864,8 @@ github.com/gtank/merlin v0.1.1/go.mod h1:T86dnYJhcGOh5BjZFCJWTDeTK7XW8uE+E21Cy/b github.com/gtank/ristretto255 v0.1.2 h1:JEqUCPA1NvLq5DwYtuzigd7ss8fwbYay9fi4/5uMzcc= github.com/gtank/ristretto255 v0.1.2/go.mod h1:Ph5OpO6c7xKUGROZfWVLiJf9icMDwUeIvY4OmlYW69o= github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= -github.com/hashicorp/consul/api v1.25.1 h1:CqrdhYzc8XZuPnhIYZWH45toM0LB9ZeYr/gvpLVI3PE= -github.com/hashicorp/consul/api v1.25.1/go.mod h1:iiLVwR/htV7mas/sy0O+XSuEnrdBUUydemjxcUrAt4g= +github.com/hashicorp/consul/api v1.28.2 h1:mXfkRHrpHN4YY3RqL09nXU1eHKLNiuAN4kHvDQ16k/8= +github.com/hashicorp/consul/api v1.28.2/go.mod h1:KyzqzgMEya+IZPcD65YFoOVAgPpbfERu4I/tzG6/ueE= github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= github.com/hashicorp/consul/sdk v0.16.0 h1:SE9m0W6DEfgIVCJX7xU+iv/hUl4m/nxqMTnCdMxDpJ8= github.com/hashicorp/consul/sdk v0.16.0/go.mod h1:7pxqqhqoaPqnBnzXD1StKed62LqJeClzVsUEy85Zr0A= @@ -924,6 +897,8 @@ github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHh github.com/hashicorp/go-multierror v1.1.0/go.mod h1:spPvp8C1qA32ftKqdAHm4hHTbPw+vmowP0z+KUhOZdA= github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= +github.com/hashicorp/go-plugin v1.6.2-0.20240829161738-06afb6d7ae99 h1:OSQYEsRT3tRttZkk6zyC3aAaliwd7Loi/KgXgXxGtwA= +github.com/hashicorp/go-plugin v1.6.2-0.20240829161738-06afb6d7ae99/go.mod h1:CkgLQ5CZqNmdL9U9JzM532t8ZiYQ35+pj3b1FD37R0Q= github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= github.com/hashicorp/go-retryablehttp v0.7.5 h1:bJj+Pj19UZMIweq/iie+1u5YCdGrnxCT9yvm0e+Nd5M= github.com/hashicorp/go-retryablehttp v0.7.5/go.mod h1:Jy/gPYAdjqffZ/yFGCFV2doI5wjtH1ewM9u8iYVjtX8= @@ -940,7 +915,6 @@ github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/b github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8= github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek= github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= @@ -986,13 +960,11 @@ github.com/huandu/xstrings v1.4.0 h1:D17IlohoQq4UcpqD7fDk80P7l+lwAmlFaBHgOipl2FU github.com/huandu/xstrings v1.4.0/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/huin/goupnp v1.3.0 h1:UvLUlWDNpoUdYzb2TCn+MuTWtcjXKSza2n6CBdQ0xXc= github.com/huin/goupnp v1.3.0/go.mod h1:gnGPsThkYa7bFi/KWmEysQRf48l2dvR5bxr2OFckNX8= -github.com/hydrogen18/memlistener v0.0.0-20200120041712-dcc25e7acd91/go.mod h1:qEIFzExnS6016fRpRfxrExeVn2gbClQA99gQhnIcdhE= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/imdario/mergo v0.3.16 h1:wwQJbIsHYGMUyLSPrEq1CT16AhnhNJQ51+4fdHUnCl4= github.com/imdario/mergo v0.3.16/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+hD27ysY= -github.com/imkira/go-interpol v1.1.0/go.mod h1:z0h2/2T3XF8kyEPpRgJ3kmNv+C43p+I/CoI+jC3w2iA= github.com/improbable-eng/grpc-web v0.15.0 h1:BN+7z6uNXZ1tQGcNAuaU1YjsLTApzkjt2tzCixLaUPQ= github.com/improbable-eng/grpc-web v0.15.0/go.mod h1:1sy9HKV4Jt9aEs9JSnkWlRJPuPtwNr0l57L4f878wP8= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= @@ -1002,11 +974,6 @@ github.com/invopop/jsonschema v0.12.0 h1:6ovsNSuvn9wEQVOyc72aycBMVQFKz7cPdMJn10C github.com/invopop/jsonschema v0.12.0/go.mod h1:ffZ5Km5SWWRAIN6wbDXItl95euhFz2uON45H2qjYt+0= github.com/ionos-cloud/sdk-go/v6 v6.1.8 h1:493wE/BkZxJf7x79UCE0cYGPZoqQcPiEBALvt7uVGY0= github.com/ionos-cloud/sdk-go/v6 v6.1.8/go.mod h1:EzEgRIDxBELvfoa/uBN0kOQaqovLjUWEB7iW4/Q+t4k= -github.com/iris-contrib/blackfriday v2.0.0+incompatible/go.mod h1:UzZ2bDEoaSGPbkg6SAB4att1aAwTmVIx/5gCVqeyUdI= -github.com/iris-contrib/go.uuid v2.0.0+incompatible/go.mod h1:iz2lgM/1UnEf1kP0L/+fafWORmlnuysV2EMP8MW+qe0= -github.com/iris-contrib/jade v1.1.3/go.mod h1:H/geBymxJhShH5kecoiOCSssPX7QWYH7UaeZTSWddIk= -github.com/iris-contrib/pongo2 v0.0.1/go.mod h1:Ssh+00+3GAZqSQb30AvBRNxBx7rf0GqwkjqxNd0u65g= -github.com/iris-contrib/schema v0.0.1/go.mod h1:urYA3uvUNG1TIIjOSCzHr9/LmbQo8LrOcOqfqxa4hXw= github.com/jackc/chunkreader v1.0.0/go.mod h1:RT6O25fNZIuasFJRyZ4R/Y2BbhasbmZXF9QQ7T3kePo= github.com/jackc/chunkreader/v2 v2.0.0/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk= github.com/jackc/chunkreader/v2 v2.0.1 h1:i+RDz65UE+mmpjTfyz0MoVTnzeYxroil2G82ki7MGG8= @@ -1079,38 +1046,24 @@ github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFF github.com/jpillora/backoff v1.0.0 h1:uvFg412JmmHBHw7iwprIxkPMI+sGQ4kzOWsMeHnm2EA= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= -github.com/json-iterator/go v1.1.9/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.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= -github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/julienschmidt/httprouter v1.3.0 h1:U0609e9tgbseu3rBINet9P48AI/D3oJs4dN7jwJOQ1U= github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= -github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88/go.mod h1:3w7q1U84EfirKl04SVQ/s7nPm1ZPhiXd34z40TNz36k= github.com/karrick/godirwalk v1.8.0/go.mod h1:H5KPZjojv4lE+QYImBI8xVtrBRgYrIVsaRPx4tDPEn4= github.com/karrick/godirwalk v1.10.3/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0LhBygSwrAsHA= -github.com/kataras/golog v0.0.10/go.mod h1:yJ8YKCmyL+nWjERB90Qwn+bdyBZsaQwU3bTVFgkFIp8= -github.com/kataras/iris/v12 v12.1.8/go.mod h1:LMYy4VlP67TQ3Zgriz8RE2h2kMZV2SgMYbq3UhfoFmE= -github.com/kataras/neffos v0.0.14/go.mod h1:8lqADm8PnbeFfL7CLXh1WHw53dG27MC3pgi2R1rmoTE= -github.com/kataras/pio v0.0.2/go.mod h1:hAoW0t9UmXi4R5Oyq5Z4irTbaTsOemSrDGUtaTl7Dro= -github.com/kataras/sitemap v0.0.5/go.mod h1:KY2eugMKiPwsJgx7+U103YZehfvNGOXURubcGyk0Bz8= github.com/kelseyhightower/envconfig v1.4.0 h1:Im6hONhd3pLkfDFsbRgu68RDNkGF1r3dvMUtDTo2cv8= github.com/kelseyhightower/envconfig v1.4.0/go.mod h1:cccZRl6mQpaq41TPp5QxidR+Sa3axMbJDNb//FQX6Gg= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.8.2/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= -github.com/klauspost/compress v1.9.7/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= -github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.11.4/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= -github.com/klauspost/compress v1.17.3 h1:qkRjuerhUU1EmXLYGkSH6EZL+vPSxIrYjLNAK4slzwA= -github.com/klauspost/compress v1.17.3/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= -github.com/klauspost/cpuid v1.2.1/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= +github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA= +github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/klauspost/cpuid/v2 v2.2.5 h1:0E5MSMDEoAulmXNFquVs//DdoomxaoTY1kUhbc/qbZg= github.com/klauspost/cpuid/v2 v2.2.5/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= @@ -1119,13 +1072,9 @@ github.com/kolo/xmlrpc v0.0.0-20220921171641-a4b6fa1dd06b h1:udzkj9S/zlT5X367kqJ github.com/kolo/xmlrpc v0.0.0-20220921171641-a4b6fa1dd06b/go.mod h1:pcaDhQK0/NJZEvtCO0qQPPropqV0sJOJ6YW7X+9kRwM= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= @@ -1135,13 +1084,10 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/labstack/echo/v4 v4.5.0/go.mod h1:czIriw4a0C1dFun+ObrXp7ok03xON0N1awStJ6ArI7Y= -github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL7NoOu+k= github.com/leanovate/gopter v0.2.10-0.20210127095200-9abe2343507a h1:dHCfT5W7gghzPtfsW488uPmEOm85wewI+ypUwibyTdU= github.com/leanovate/gopter v0.2.10-0.20210127095200-9abe2343507a/go.mod h1:U2L/78B+KVFIx2VmW6onHJQzXtFb+p5y3y2Sh+Jxxv8= -github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= -github.com/leodido/go-urn v1.2.4 h1:XlAE/cm/ms7TE/VMVoduSpNBoyc2dOxHs5MZSwAN63Q= -github.com/leodido/go-urn v1.2.4/go.mod h1:7ZrI8mTSeBSHl/UaRyKQW1qZeMgak41ANeCNaVckg+4= +github.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ= +github.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI= github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.1.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= @@ -1154,6 +1100,10 @@ github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de h1:9TO3cAIGXtEhn github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de/go.mod h1:zAbeS9B/r2mtpb6U+EI2rYA5OAXxsYw6wTamcNW+zcE= github.com/linode/linodego v1.19.0 h1:n4WJrcr9+30e9JGZ6DI0nZbm5SdAj1kSwvvt/998YUw= github.com/linode/linodego v1.19.0/go.mod h1:XZFR+yJ9mm2kwf6itZ6SCpu+6w3KnIevV0Uu5HNWJgQ= +github.com/linxGnu/grocksdb v1.7.16 h1:Q2co1xrpdkr5Hx3Fp+f+f7fRGhQFQhvi/+226dtLmA8= +github.com/linxGnu/grocksdb v1.7.16/go.mod h1:JkS7pl5qWpGpuVb3bPqTz8nC12X3YtPZT+Xq7+QfQo4= +github.com/lithammer/dedent v1.1.0 h1:VNzHMVCBNG1j0fh3OrsFRkVUwStdDArbgBWoPAffktY= +github.com/lithammer/dedent v1.1.0/go.mod h1:jrXYCQtgg0nJiN+StA2KgR7w6CiQNv9Fd/Z9BP0jIOc= github.com/logrusorgru/aurora v2.0.3+incompatible h1:tOpm7WcpBTn4fjmVfgpQq0EfczGlG91VSDkswnjF5A8= github.com/logrusorgru/aurora v2.0.3+incompatible/go.mod h1:7rIyQOR62GCctdiQpZ/zOJlFyk6y+94wXzv6RNZgaR4= github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY= @@ -1177,12 +1127,9 @@ github.com/markbates/oncer v0.0.0-20181203154359-bf2de49a0be2/go.mod h1:Ld9puTsI github.com/markbates/safe v1.0.1/go.mod h1:nAqgmRi7cY2nqMc92/bSEeQA+R4OheNU2T1kNSCBdG0= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= -github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-colorable v0.1.11/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= @@ -1190,7 +1137,6 @@ github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNx github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= @@ -1204,14 +1150,11 @@ github.com/mattn/go-runewidth v0.0.14/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh github.com/mattn/go-sqlite3 v1.14.22/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y= github.com/mattn/go-sqlite3 v2.0.3+incompatible h1:gXHsfypPkaMZrKbD5209QV9jbUTJKjyR5WD3HYQSd+U= github.com/mattn/go-sqlite3 v2.0.3+incompatible/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= -github.com/mattn/goveralls v0.0.2/go.mod h1:8d1ZMHsd7fW6IRPKQh46F2WRpyib5/X4FOpevwGNQEw= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 h1:jWpvCLoY8Z/e3VKvlsiIGKtc+UG6U5vzxaoagmhXfyg= -github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0/go.mod h1:QUyp042oQthUoa9bqDv0ER0wrtXnBruoNd7aNjkbP+k= -github.com/mediocregopher/radix/v3 v3.4.2/go.mod h1:8FL3F6UQRXHXIBSPUs5h0RybMF8i4n7wVopoX3x7Bv8= +github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= +github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= github.com/mfridman/interpolate v0.0.2 h1:pnuTK7MQIxxFz1Gr+rjSIx9u7qVjf5VOoM/u6BbAxPY= github.com/mfridman/interpolate v0.0.2/go.mod h1:p+7uk6oE07mpE/Ik1b8EckO0O4ZXiGAfshKBWLUM9Xg= -github.com/microcosm-cc/bluemonday v1.0.2/go.mod h1:iVP4YcDBq+n/5fb23BhYFvIMq/leAFZyRl6bYmGDlGc= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI= @@ -1254,8 +1197,8 @@ github.com/mmcloughlin/addchain v0.4.0/go.mod h1:A86O+tHqZLMNO4w6ZZ4FlVQEadcoqky github.com/mmcloughlin/profile v0.1.1/go.mod h1:IhHD7q1ooxgwTgjxQYkACGA77oFTDdFVejUS1/tS/qU= github.com/moby/patternmatcher v0.6.0 h1:GmP9lR19aU5GqSSFko+5pRqHi+Ohk1O69aFiKkVGiPk= github.com/moby/patternmatcher v0.6.0/go.mod h1:hDPoyOpDY7OrrMDLaYoY3hf52gNCR/YOUYxkhApJIxc= -github.com/moby/spdystream v0.2.0 h1:cjW1zVyyoiM0T7b6UoySUFqzXMoqRckQtXwGPiBhOM8= -github.com/moby/spdystream v0.2.0/go.mod h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0GqbN2Wy8c= +github.com/moby/spdystream v0.4.0 h1:Vy79D6mHeJJjiPdFEL2yku1kl0chZpJfZcPpb16BRl8= +github.com/moby/spdystream v0.4.0/go.mod h1:xBAYlnt/ay+11ShkdFKNAG7LsyK/tmNBVvVOwrfMgdI= github.com/moby/sys/sequential v0.5.0 h1:OPvI35Lzn9K04PBbCLW0g4LcFAJgHsvXsRyewg5lXtc= github.com/moby/sys/sequential v0.5.0/go.mod h1:tH2cOOs5V9MlPiXcQzRC+eEyab644PWKGRYaaV5ZZlo= github.com/moby/sys/user v0.1.0 h1:WmZ93f5Ux6het5iituh9x2zAG7NFY9Aqi49jjE1PaQg= @@ -1265,7 +1208,6 @@ github.com/moby/term v0.5.0/go.mod h1:8FzsFHVUBGZdbDsJw/ot+X+d5HLUbvklYLJ9uGfcI3 github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= @@ -1278,7 +1220,6 @@ github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A= github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= github.com/mostynb/zstdpool-freelist v0.0.0-20201229113212-927304c0c3b1 h1:mPMvm6X6tf4w8y7j9YIt6V9jfWhL6QlbEc7CCmeQlWk= github.com/mostynb/zstdpool-freelist v0.0.0-20201229113212-927304c0c3b1/go.mod h1:ye2e/VUEtE2BHE+G/QcKkcLQVAEJoYRFj5VUOQatCRE= -github.com/moul/http2curl v1.0.0/go.mod h1:8UbvGypXm98wA/IqH45anm5Y2Z6ep6O31QGOAZ3H0fQ= github.com/mr-tron/base58 v1.2.0 h1:T/HDJBh4ZCPbU39/+c3rRvE0uKBQlU27+QI8LJ4t64o= github.com/mr-tron/base58 v1.2.0/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= github.com/mtibben/percent v0.2.1 h1:5gssi8Nqo8QU/r2pynCm+hBQHpkB/uNK7BJCFogWdzs= @@ -1289,13 +1230,10 @@ github.com/muesli/termenv v0.12.0 h1:KuQRUE3PgxRFWhq4gHvZtPSLCGDqM5q/cYr1pZ39ytc github.com/muesli/termenv v0.12.0/go.mod h1:WCCv32tusQ/EEZ5S8oUIIrC/nIuBcxCVqlN4Xfkv+7A= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= -github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f h1:KUppIJq7/+SVif2QVs3tOP0zanoHgBEVAwHxUSIzRqU= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5VglpSg= -github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzEE/Zbp4w= -github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= -github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= +github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f h1:y5//uYreIhSUg3J1GEMiLbxo1LJaP8RfCpH6pymGZus= +github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nkovacs/streamquote v0.0.0-20170412213628-49af9bddb229/go.mod h1:0aYXnNPJ8l7uZxf45rWW1a/uME32OF0rhiYGNQ2oF2E= github.com/nsf/jsondiff v0.0.0-20210926074059-1e845ec5d249 h1:NHrXEjTNQY7P0Zfx1aMrNhpgxHmow66XQtm0aQLY0AE= @@ -1310,24 +1248,23 @@ github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= -github.com/onsi/ginkgo/v2 v2.13.0 h1:0jY9lJquiL8fcf3M4LAXN5aMlS/b2BV86HFFPCPMgE4= -github.com/onsi/ginkgo/v2 v2.13.0/go.mod h1:TE309ZR8s5FsKKpuB1YAQYBzCaAfUgatB/xlT/ETL/o= +github.com/onsi/ginkgo/v2 v2.19.0 h1:9Cnnf7UHo57Hy3k6/m5k3dRfGTMXGvxhHFvkDTCTpvA= +github.com/onsi/ginkgo/v2 v2.19.0/go.mod h1:rlwLi9PilAFJ8jCg9UE1QP6VBpd6/xj3SRC0d6TU0To= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= -github.com/onsi/gomega v1.30.0 h1:hvMK7xYz4D3HapigLTeGdId/NcfQx1VHMJc60ew99+8= -github.com/onsi/gomega v1.30.0/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ= +github.com/onsi/gomega v1.33.1 h1:dsYjIxxSR755MDmKVsaFQTE22ChNBcuuTWgkUDSubOk= +github.com/onsi/gomega v1.33.1/go.mod h1:U4R44UsT+9eLIaYRB2a5qajjtQYn0hauxvRm16AVYg0= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= -github.com/opencontainers/image-spec v1.1.0-rc5 h1:Ygwkfw9bpDvs+c9E34SdgGOj41dX/cbdlwvlWt0pnFI= -github.com/opencontainers/image-spec v1.1.0-rc5/go.mod h1:X4pATf0uXsnn3g5aiGIsVnJBR4mxhKzfwmvK/B2NTm8= +github.com/opencontainers/image-spec v1.1.0 h1:8SG7/vwALn54lVB/0yZ/MMwhFrPYtpEHQb2IpWsCzug= +github.com/opencontainers/image-spec v1.1.0/go.mod h1:W4s4sFTMaBeK1BQLXbG4AdM2szdn85PY75RI83NrTrM= github.com/opencontainers/runc v1.1.7 h1:y2EZDS8sNng4Ksf0GUYNhKbTShZJPJg1FiXJNH/uoCk= github.com/opencontainers/runc v1.1.7/go.mod h1:CbUumNnWCuTGFukNXahoo/RFBZvDAgRh/smNYNOhA50= github.com/opentracing-contrib/go-grpc v0.0.0-20210225150812-73cb765af46e h1:4cPxUYdgaGzZIT5/j0IfqOrrXmq6bG8AwvwisMXpdrg= @@ -1374,7 +1311,6 @@ github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= @@ -1386,54 +1322,28 @@ github.com/pressly/goose/v3 v3.21.1 h1:5SSAKKWej8LVVzNLuT6KIvP1eFDuPvxa+B6H0w78b github.com/pressly/goose/v3 v3.21.1/go.mod h1:sqthmzV8PitchEkjecFJII//l43dLOCzfWh8pHEe+vE= github.com/prometheus/alertmanager v0.26.0 h1:uOMJWfIwJguc3NaM3appWNbbrh6G/OjvaHMk22aBBYc= github.com/prometheus/alertmanager v0.26.0/go.mod h1:rVcnARltVjavgVaNnmevxK7kOn7IZavyf0KNgHkbEpU= -github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= -github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= -github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= -github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= -github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= -github.com/prometheus/client_golang v1.17.0 h1:rl2sfwZMtSthVU752MqfjQozy7blglC+1SOtjMAMh+Q= -github.com/prometheus/client_golang v1.17.0/go.mod h1:VeL+gMmOAxkS2IqfCq0ZmHSL+LjWfWDUmp1mBz9JgUY= -github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= -github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_golang v1.14.0 h1:nJdhIvne2eSX/XRAFV9PcvFFRbrjbcTUj0VP62TMhnw= +github.com/prometheus/client_golang v1.14.0/go.mod h1:8vpkKitgIVNcqrRBWh1C4TIUQgYNtG/XQE4E/Zae36Y= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.5.0 h1:VQw1hfvPvk3Uv6Qf29VrPF32JB6rtbgI6cYPYQjL0Qw= -github.com/prometheus/client_model v0.5.0/go.mod h1:dTiFglRmd66nLR9Pv9f0mZi7B7fk5Pm3gvsjB5tr+kI= -github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= -github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= -github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= -github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= -github.com/prometheus/common v0.29.0/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= -github.com/prometheus/common v0.45.0 h1:2BGz0eBc2hdMDLnO/8n0jeB3oPrt2D08CekT0lneoxM= -github.com/prometheus/common v0.45.0/go.mod h1:YJmSTw9BoKxJplESWWxlbyttQR4uaEcGyv9MZjVOJsY= +github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w= +github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= +github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= +github.com/prometheus/common v0.42.0 h1:EKsfXEYo4JpWMHH5cg+KOUWeuJSov1Id8zGR8eeI1YM= +github.com/prometheus/common v0.42.0/go.mod h1:xBwqVerjNdUDjgODMpudtOMwlOwf2SaTr1yjz4b7Zbc= github.com/prometheus/common/sigv4 v0.1.0 h1:qoVebwtwwEhS85Czm2dSROY5fTo2PAPEVdDeppTwGX4= github.com/prometheus/common/sigv4 v0.1.0/go.mod h1:2Jkxxk9yYvCkE5G1sQT7GuEXm57JrvHu9k5YwTjsNtI= github.com/prometheus/exporter-toolkit v0.10.1-0.20230714054209-2f4150c63f97 h1:oHcfzdJnM/SFppy2aUlvomk37GI33x9vgJULihE5Dt8= github.com/prometheus/exporter-toolkit v0.10.1-0.20230714054209-2f4150c63f97/go.mod h1:LoBCZeRh+5hX+fSULNyFnagYlQG/gBsyA/deNzROkq8= -github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= -github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= -github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= +github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4= +github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= +github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/prometheus/prometheus v0.47.2-0.20231010075449-4b9c19fe5510 h1:6ksZ7t1hNOzGPPs8DK7SvXQf6UfWzi+W5Z7PCBl8gx4= github.com/prometheus/prometheus v0.47.2-0.20231010075449-4b9c19fe5510/go.mod h1:UC0TwJiF90m2T3iYPQBKnGu8gv3s55dF/EgpTq8gyvo= -github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= -github.com/pyroscope-io/client v0.7.1 h1:yFRhj3vbgjBxehvxQmedmUWJQ4CAfCHhn+itPsuWsHw= -github.com/pyroscope-io/client v0.7.1/go.mod h1:4h21iOU4pUOq0prKyDlvYRL+SCKsBc5wKiEtV+rJGqU= -github.com/pyroscope-io/godeltaprof v0.1.2 h1:MdlEmYELd5w+lvIzmZvXGNMVzW2Qc9jDMuJaPOR75g4= -github.com/pyroscope-io/godeltaprof v0.1.2/go.mod h1:psMITXp90+8pFenXkKIpNhrfmI9saQnPbba27VIaiQE= github.com/rakyll/statik v0.1.7 h1:OF3QCZUuyPxuGEP7B4ypUa7sB/iHtqOTDYZXGM8KOdQ= github.com/rakyll/statik v0.1.7/go.mod h1:AlZONWzMtEnMs7W4e/1LURLiI49pIMmp6V9Unghqrcc= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= -github.com/regen-network/gocuke v0.6.2 h1:pHviZ0kKAq2U2hN2q3smKNxct6hS0mGByFMHGnWA97M= -github.com/regen-network/gocuke v0.6.2/go.mod h1:zYaqIHZobHyd0xOrHGPQjbhGJsuZ1oElx150u2o1xuk= github.com/regen-network/protobuf v1.3.3-alpha.regen.1 h1:OHEc+q5iIAXpqiqFKeLpu5NwTIkVXUs48vFMwzqpqY4= github.com/regen-network/protobuf v1.3.3-alpha.regen.1/go.mod h1:2DjTFR1HhMQhiWC5sZ4OhQ3+NtdbZ6oBDKQwq5Ou+FI= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= @@ -1446,8 +1356,6 @@ github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6L github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.2.2/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= -github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= @@ -1457,16 +1365,18 @@ github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= github.com/rs/zerolog v1.13.0/go.mod h1:YbFCdg8HfsridGWAh22vktObvhZbQsZXe4/zB0OKkWU= github.com/rs/zerolog v1.15.0/go.mod h1:xYTKnLHcpfU2225ny5qZjxnj9NvkumZYjJHlAThCjNc= -github.com/rs/zerolog v1.31.0 h1:FcTR3NnLWW+NnTwwhFWiJSZr4ECLpqCm6QsEnyvbV4A= -github.com/rs/zerolog v1.31.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= +github.com/rs/zerolog v1.33.0 h1:1cU2KZkvPxNyfgEmhHAz/1A9Bz+llsdYzklWFzgp0r8= +github.com/rs/zerolog v1.33.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= -github.com/russross/blackfriday v1.6.0 h1:KqfZb0pUVN2lYqZUYRddxF4OR8ZMURnJIG5Y3VRLtww= -github.com/russross/blackfriday v1.6.0/go.mod h1:ti0ldHuxg49ri4ksnFxlkCfN+hvslNlmVHqNRXXJNAY= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= +github.com/sagikazarmark/locafero v0.4.0 h1:HApY1R9zGo4DBgr7dqsTH/JJxLTTsOt7u6keLGt6kNQ= +github.com/sagikazarmark/locafero v0.4.0/go.mod h1:Pe1W6UlPYUk/+wc/6KFhbORCfqzgYEpgQ3O5fPuL3H4= +github.com/sagikazarmark/slog-shim v0.1.0 h1:diDBnUNK9N/354PgrxMywXnAwEr1QZcOr6gto+ugjYE= +github.com/sagikazarmark/slog-shim v0.1.0/go.mod h1:SrcSrq8aKtyuqEI1uvTDTK1arOWRIczQRv+GVI1AkeQ= github.com/santhosh-tekuri/jsonschema/v5 v5.3.1 h1:lZUw3E0/J3roVtGQ+SCrUrg3ON6NgVqpn3+iol9aGu4= github.com/santhosh-tekuri/jsonschema/v5 v5.3.1/go.mod h1:uToXkOrWAZ6/Oc07xWQrPOhJotwFIyu2bBVN41fcDUY= github.com/sasha-s/go-deadlock v0.3.1 h1:sqv7fDNShgjcaxkO0JNcOAlr8B9+cV5Ey/OB71efZx0= @@ -1474,7 +1384,6 @@ github.com/sasha-s/go-deadlock v0.3.1/go.mod h1:F73l+cr82YSh10GxyRI6qZiCgK64VaZj github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= github.com/scaleway/scaleway-sdk-go v1.0.0-beta.20 h1:a9hSJdJcd16e0HoMsnFvaHvxB3pxSD+SC7+CISp7xY0= github.com/scaleway/scaleway-sdk-go v1.0.0-beta.20/go.mod h1:fCa7OJZ/9DRTnOKmxvT6pn+LPWUptQAmHF/SBJUGEcg= -github.com/schollz/closestmatch v2.1.0+incompatible/go.mod h1:RtP1ddjLong6gTkbtmuhtR2uUrrJOpYzYRvbcPAid+g= github.com/scylladb/go-reflectx v1.0.1 h1:b917wZM7189pZdlND9PbIJ6NQxfDPfBvUaQ7cjj1iZQ= github.com/scylladb/go-reflectx v1.0.1/go.mod h1:rWnOfDIRWBGN0miMLIcoPt/Dhi2doCMZqwMCJ3KupFc= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 h1:nn5Wsu0esKSJiIVhscUtVbo7ada43DJhG55ua/hjS5I= @@ -1483,7 +1392,6 @@ github.com/segmentio/ksuid v1.0.4 h1:sBo2BdShXjmcugAMwjugoGUdUV0pcxY5mW4xKRn3v4c github.com/segmentio/ksuid v1.0.4/go.mod h1:/XUiZBD3kVx5SmUOl55voK5yeAbBNNIed+2O73XgrPE= github.com/sercand/kuberesolver/v5 v5.1.1 h1:CYH+d67G0sGBj7q5wLK61yzqJJ8gLLC8aeprPTHb6yY= github.com/sercand/kuberesolver/v5 v5.1.1/go.mod h1:Fs1KbKhVRnB2aDWN12NjKCB+RgYMWZJ294T3BtmVCpQ= -github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/sergi/go-diff v1.3.1 h1:xkr+Oxo4BOQKmkn/B9eMK0g5Kg/983T9DqqPHwYqD+8= github.com/sergi/go-diff v1.3.1/go.mod h1:aMJSSKb2lpPvRNec0+w3fl7LP9IOFzdc9Pa4NFbPK1I= github.com/sethvargo/go-retry v0.2.4 h1:T+jHEQy/zKJf5s95UkguisicE0zuF9y7+/vgz08Ocec= @@ -1498,56 +1406,57 @@ github.com/shoenig/test v0.6.4 h1:kVTaSd7WLz5WZ2IaoM0RSzRsUD+m8wRR+5qvntpn4LU= github.com/shoenig/test v0.6.4/go.mod h1:byHiCGXqrVaflBLAMq/srcZIHynQPQgeyvkvXnjqq0k= github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4= github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= -github.com/shopspring/decimal v1.3.1 h1:2Usl1nmF/WZucqkFZhnfFYxxxu8LG21F6nPQBE5gKV8= github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= +github.com/shopspring/decimal v1.4.0 h1:bxl37RwXBklmTi0C79JfXCEBD1cqqHt0bbgBAGFp81k= +github.com/shopspring/decimal v1.4.0/go.mod h1:gawqmDU56v4yIKSwfBSFip1HdCCXN8/+DMd9qYNcwME= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= -github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= -github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/slack-go/slack v0.12.2 h1:x3OppyMyGIbbiyFhsBmpf9pwkUzMhthJMRNmNlA4LaQ= github.com/slack-go/slack v0.12.2/go.mod h1:hlGi5oXA+Gt+yWTPP0plCdRKmjsDxecdHxYQdlMQKOw= -github.com/smartcontractkit/chain-selectors v1.0.10 h1:t9kJeE6B6G+hKD0GYR4kGJSCqR1LNS7aI3jT0V+xGrg= -github.com/smartcontractkit/chain-selectors v1.0.10/go.mod h1:d4Hi+E1zqjy9HqMkjBE5q1vcG9VGgxf5VxiRHfzi2kE= +github.com/smartcontractkit/ccip-owner-contracts v0.0.0-20240926212305-a6deabdfce86 h1:qQH6fZZe31nBAG6INHph3z5ysDTPptyu0TR9uoJ1+ok= +github.com/smartcontractkit/ccip-owner-contracts v0.0.0-20240926212305-a6deabdfce86/go.mod h1:WtWOoVQQEHxRHL2hNmuRrvDfYfQG/CioFNoa9Rr2mBE= +github.com/smartcontractkit/chain-selectors v1.0.23 h1:D2Eaex4Cw/O7Lg3tX6WklOqnjjIQAEBnutCtksPzVDY= +github.com/smartcontractkit/chain-selectors v1.0.23/go.mod h1:d4Hi+E1zqjy9HqMkjBE5q1vcG9VGgxf5VxiRHfzi2kE= github.com/smartcontractkit/chainlink-automation v1.0.4 h1:iyW181JjKHLNMnDleI8umfIfVVlwC7+n5izbLSFgjw8= github.com/smartcontractkit/chainlink-automation v1.0.4/go.mod h1:u4NbPZKJ5XiayfKHD/v3z3iflQWqvtdhj13jVZXj/cM= -github.com/smartcontractkit/chainlink-common v0.1.7-0.20240709155552-d76403db14e5 h1:1J1M+rpMJn+5R4EPaU8hbCqR17PFClEBOJyazsvbWck= -github.com/smartcontractkit/chainlink-common v0.1.7-0.20240709155552-d76403db14e5/go.mod h1:fh9eBbrReCmv31bfz52ENCAMa7nTKQbdhb2B3+S2VGo= -github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20240710121324-3ed288aa9b45 h1:NBQLtqk8zsyY4qTJs+NElI3aDFTcAo83JHvqD04EvB0= -github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20240710121324-3ed288aa9b45/go.mod h1:LV0h7QBQUpoC2UUi6TcUvcIFm1xjP/DtEcqV8+qeLUs= -github.com/smartcontractkit/chainlink-data-streams v0.0.0-20240702145022-37a2c3a742d1 h1:dsTmitRaVizHxoYFoGz4+y/zVa8XnvKUiTaZdx+6t9M= -github.com/smartcontractkit/chainlink-data-streams v0.0.0-20240702145022-37a2c3a742d1/go.mod h1:6DgCnHMGdBaIh0bLs1dK0MtdeMZfeNhc/nvBUN6KIUg= -github.com/smartcontractkit/chainlink-feeds v0.0.0-20240522213638-159fb2d99917 h1:MD80ZRCTvxxJ8PBmhtrKoTnky8cVNYrCrIBLVRbrOM0= -github.com/smartcontractkit/chainlink-feeds v0.0.0-20240522213638-159fb2d99917/go.mod h1:jwVxhctE6BgLOSSsVq9wbREpZ8Ev34H+UBxeUhESZRs= -github.com/smartcontractkit/chainlink-solana v1.0.3-0.20240708150922-0546185ead68 h1:kLf20IgCHTNoON0EzWqF5QiZJWZW+i7xWvFPCyIUZTM= -github.com/smartcontractkit/chainlink-solana v1.0.3-0.20240708150922-0546185ead68/go.mod h1:NbXXQaNFskVMYRut0MvBlcHu/vDgipGMwYjamvjVB9Y= -github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240709043547-03612098f799 h1:HyLTySm7BR+oNfZqDTkVJ25wnmcTtxBBD31UkFL+kEM= -github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240709043547-03612098f799/go.mod h1:UVFRacRkP7O7TQAzFmR52v5mUlxf+G1ovMlCQAB/cHU= -github.com/smartcontractkit/chainlink-testing-framework v1.32.0 h1:6emeE/YuMNmdd1pZ3NlJGu94QCa+NUayx26NX0jAQDY= -github.com/smartcontractkit/chainlink-testing-framework v1.32.0/go.mod h1:wSRZGoukZliwfTkghdF4cI1RLHz5k3aDnL+rXhJ6f7k= -github.com/smartcontractkit/chainlink-testing-framework/grafana v0.0.0-20240405215812-5a72bc9af239 h1:Kk5OVlx/5g9q3Z3lhxytZS4/f8ds1MiNM8yaHgK3Oe8= -github.com/smartcontractkit/chainlink-testing-framework/grafana v0.0.0-20240405215812-5a72bc9af239/go.mod h1:DC8sQMyTlI/44UCTL8QWFwb0bYNoXCfjwCv2hMivYZU= -github.com/smartcontractkit/go-plugin v0.0.0-20240208201424-b3b91517de16 h1:TFe+FvzxClblt6qRfqEhUfa4kFQx5UobuoFGO2W4mMo= -github.com/smartcontractkit/go-plugin v0.0.0-20240208201424-b3b91517de16/go.mod h1:lBS5MtSSBZk0SHc66KACcjjlU6WzEVP/8pwz68aMkCI= -github.com/smartcontractkit/grpc-proxy v0.0.0-20230731113816-f1be6620749f h1:hgJif132UCdjo8u43i7iPN1/MFnu49hv7lFGFftCHKU= -github.com/smartcontractkit/grpc-proxy v0.0.0-20230731113816-f1be6620749f/go.mod h1:MvMXoufZAtqExNexqi4cjrNYE9MefKddKylxjS+//n0= -github.com/smartcontractkit/havoc/k8schaos v0.0.0-20240409145249-e78d20847e37 h1:ZEhn2Yo1jY4hqy8nasDL4k4pNtopT3rS3Ap1GDb7ODc= -github.com/smartcontractkit/havoc/k8schaos v0.0.0-20240409145249-e78d20847e37/go.mod h1:/kFr0D7SI/vueXl1N03uzOun4nViGPFRyA5X6eL3jXw= -github.com/smartcontractkit/libocr v0.0.0-20240702141926-063ceef8c42e h1:9ypZ/8aW8Vm497i1gXHcT96oNLiu88jbg9QdX+IUE3E= -github.com/smartcontractkit/libocr v0.0.0-20240702141926-063ceef8c42e/go.mod h1:fb1ZDVXACvu4frX3APHZaEBp0xi1DIm34DcA0CwTsZM= -github.com/smartcontractkit/seth v1.0.12 h1:iVdgMx42XWanPPnBaM5StR4c1XsTr/0/B/kKRZL5BsY= -github.com/smartcontractkit/seth v1.0.12/go.mod h1:thWtbLyW4nRHJGzC5heknQDORoJPErE15sF34LHkorg= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20240930060710-158d2a9ac9ca h1:cvifSiZr9VifpKjgVtGaEqknz2MwpY4shQhoOLpgQUE= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20240930060710-158d2a9ac9ca/go.mod h1:hxKOwuo3HBC9a5hoNOvstl2wVF6Z9kZDssHU5VCdqk8= +github.com/smartcontractkit/chainlink-common v0.2.3-0.20240927162447-20630b333f57 h1:pRiTiFOkPEyvgG0hchcCSZzwUbwYydnZBu0QbVaRnVk= +github.com/smartcontractkit/chainlink-common v0.2.3-0.20240927162447-20630b333f57/go.mod h1:F6WUS6N4mP5ScwpwyTyAJc9/vjR+GXbMCRUOVekQi1g= +github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20240911175228-daf2600bb7b7 h1:lTGIOQYLk1Ufn++X/AvZnt6VOcuhste5yp+C157No/Q= +github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20240911175228-daf2600bb7b7/go.mod h1:BMYE1vC/pGmdFSsOJdPrAA0/4gZ0Xo0SxTMdGspBtRo= +github.com/smartcontractkit/chainlink-data-streams v0.0.0-20240916152957-433914114bd2 h1:yRk4ektpx/UxwarqAfgxUXLrsYXlaNeP1NOwzHGrK2Q= +github.com/smartcontractkit/chainlink-data-streams v0.0.0-20240916152957-433914114bd2/go.mod h1:rNhNSrrRMvkgAm5SA6bNTdh2340bTQQZdUVNtZ2o2bk= +github.com/smartcontractkit/chainlink-feeds v0.0.0-20240910155501-42f20443189f h1:p4p3jBT91EQyLuAMvHD+zNJsuAYI/QjJbzuGUJ7wIgg= +github.com/smartcontractkit/chainlink-feeds v0.0.0-20240910155501-42f20443189f/go.mod h1:FLlWBt2hwiMVgt9AcSo6wBJYIRd/nsc8ENbV1Wir1bw= +github.com/smartcontractkit/chainlink-solana v1.1.1-0.20240927143737-7e527aa85bff h1:piMugtrRlbVdcC6xZF37me686eS1YwpLQ0kN2v2b9YE= +github.com/smartcontractkit/chainlink-solana v1.1.1-0.20240927143737-7e527aa85bff/go.mod h1:5jD47oCERRQ4eGi0iNdk9ZV5HMEdolfQwHpUX1+Ix4s= +github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240911194142-506bc469d8ae h1:d+B8y2Nd/PrnPMNoaSPn3eDgUgxcVcIqAxGrvYu/gGw= +github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240911194142-506bc469d8ae/go.mod h1:ec/a20UZ7YRK4oxJcnTBFzp1+DBcJcwqEaerUMsktMs= +github.com/smartcontractkit/chainlink-testing-framework/havoc v1.50.0 h1:mgjBQIEy+3V3G6K8e+6by3xndgsXdYYsdy+7kzQZwSk= +github.com/smartcontractkit/chainlink-testing-framework/havoc v1.50.0/go.mod h1:pdIxrooP5CFGmC0p5NTOBiZAFtMw+5pTT4de5GY3ywA= +github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.9 h1:/2kAb6y854viKigkdFMWDNNbaz3zD0gAkbZoSHC8Rrg= +github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.9/go.mod h1:7R5wGWWJi0dr5Y5cXbLQ4vSeIj0ElvhBaymcfvqqUmo= +github.com/smartcontractkit/chainlink-testing-framework/lib/grafana v1.50.0 h1:VIxK8u0Jd0Q/VuhmsNm6Bls6Tb31H/sA3A/rbc5hnhg= +github.com/smartcontractkit/chainlink-testing-framework/lib/grafana v1.50.0/go.mod h1:lyAu+oMXdNUzEDScj2DXB2IueY+SDXPPfyl/kb63tMM= +github.com/smartcontractkit/chainlink-testing-framework/seth v1.50.1 h1:2OxnPfvjC+zs0ZokSsRTRnJrEGJ4NVJwZgfroS1lPHs= +github.com/smartcontractkit/chainlink-testing-framework/seth v1.50.1/go.mod h1:afY3QmNgeR/VI1pRbGH8g3YXGy7C2RrFOwUzEFvL3L8= +github.com/smartcontractkit/chainlink-testing-framework/wasp v1.50.0 h1:gfhfTn7HkbUHNooSF3c9vzQyN8meWJVGt6G/pNUbpYk= +github.com/smartcontractkit/chainlink-testing-framework/wasp v1.50.0/go.mod h1:tqajhpUJA/9OaMCLitghBXjAgqYO4i27St0F4TUO3+M= +github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7 h1:12ijqMM9tvYVEm+nR826WsrNi6zCKpwBhuApq127wHs= +github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7/go.mod h1:FX7/bVdoep147QQhsOPkYsPEXhGZjeYx6lBSaSXtZOA= +github.com/smartcontractkit/libocr v0.0.0-20240717100443-f6226e09bee7 h1:e38V5FYE7DA1JfKXeD5Buo/7lczALuVXlJ8YNTAUxcw= +github.com/smartcontractkit/libocr v0.0.0-20240717100443-f6226e09bee7/go.mod h1:fb1ZDVXACvu4frX3APHZaEBp0xi1DIm34DcA0CwTsZM= github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin v0.0.0-20230906073235-9e478e5e19f1 h1:yiKnypAqP8l0OX0P3klzZ7SCcBUxy5KqTAKZmQOvSQE= github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin v0.0.0-20230906073235-9e478e5e19f1/go.mod h1:q6f4fe39oZPdsh1i57WznEZgxd8siidMaSFq3wdPmVg= github.com/smartcontractkit/tdh2/go/tdh2 v0.0.0-20230906073235-9e478e5e19f1 h1:Dai1bn+Q5cpeGMQwRdjOdVjG8mmFFROVkSKuUgBErRQ= github.com/smartcontractkit/tdh2/go/tdh2 v0.0.0-20230906073235-9e478e5e19f1/go.mod h1:G5Sd/yzHWf26rQ+X0nG9E0buKPqRGPMJAfk2gwCzOOw= -github.com/smartcontractkit/wasp v0.4.7 h1:7mKJfwzFbuE8xVLUYtLt7Bjw8q/bmVZRW6Ks8kc1LVM= -github.com/smartcontractkit/wasp v0.4.7/go.mod h1:jeabvyXikb2aNoLQwcZGqaz17efrR8NJhpq4seAmdgs= -github.com/smartcontractkit/wsrpc v0.7.3 h1:CKYZfawZShZGfvsQep1F9oBansnFk9ByZPCdTMpLphw= -github.com/smartcontractkit/wsrpc v0.7.3/go.mod h1:sj7QX2NQibhkhxTfs3KOhAj/5xwgqMipTvJVSssT9i0= +github.com/smartcontractkit/wsrpc v0.8.2 h1:XB/xcn/MMseHW+8JE8+a/rceA86ck7Ur6cEa9LiUC8M= +github.com/smartcontractkit/wsrpc v0.8.2/go.mod h1:2u/wfnhl5R4RlSXseN4n6HHIWk8w1Am3AT6gWftQbNg= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= @@ -1555,12 +1464,14 @@ github.com/soheilhy/cmux v0.1.5 h1:jjzc5WVemNEDTLwv9tlmemhC73tI08BNOIGwBOo10Js= github.com/soheilhy/cmux v0.1.5/go.mod h1:T7TcVDs9LWfQgPlPsdngu6I6QIoyIFZDDC6sNE1GqG0= github.com/sony/gobreaker v0.5.0 h1:dRCvqm0P490vZPmy7ppEk2qCnCieBooFJ+YoXGYB+yg= github.com/sony/gobreaker v0.5.0/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY= +github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo= +github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= -github.com/spf13/afero v1.9.5 h1:stMpOSZFs//0Lv29HduCmli3GUfpFoF3Y1Q/aXj/wVM= -github.com/spf13/afero v1.9.5/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ= +github.com/spf13/afero v1.11.0 h1:WJQKhtpdm3v2IzqG8VMqrr6Rf3UYpEF239Jy9wNepM8= +github.com/spf13/afero v1.11.0/go.mod h1:GH9Y3pIexgf1MTIWtNGyogA5MwRIDXGUr+hbWNoBjkY= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cast v1.6.0 h1:GEiTHELF+vaR5dhz3VqZfFSzZjYbgeKDpBxQVS4GYJ0= @@ -1568,22 +1479,19 @@ github.com/spf13/cast v1.6.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cA github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= github.com/spf13/cobra v1.1.1/go.mod h1:WnodtKOvamDL/PwE2M4iKs8aMDBZ5Q5klgD3qfVJQMI= -github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0= -github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho= +github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM= +github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= -github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= -github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= github.com/spf13/viper v1.7.1/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= -github.com/spf13/viper v1.15.0 h1:js3yy885G8xwJa6iOISGFwd+qlUo5AvyXb7CiihdtiU= -github.com/spf13/viper v1.15.0/go.mod h1:fFcTBJxvhhzSJiZy8n+PeW6t8l+KeT/uTARa0jHOQLA= +github.com/spf13/viper v1.19.0 h1:RWq5SEjt8o25SROyN3z2OrDB9l7RPd3lwTWU8EcEdcI= +github.com/spf13/viper v1.19.0/go.mod h1:GQUN9bilAbhU/jgc1bKs99f/suXKeUMct8Adx5+Ntkg= github.com/status-im/keycard-go v0.2.0 h1:QDLFswOQu1r5jsycloeQh3bVU8n/NatHHaZobtDnDzA= github.com/status-im/keycard-go v0.2.0/go.mod h1:wlp8ZLbsmrF6g6WjugPAx+IzoLrkdf9+mHxBEeo3Hbg= -github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8= github.com/streamingfast/logging v0.0.0-20220405224725-2755dab2ce75 h1:ZqpS7rAhhKD7S7DnrpEdrnW1/gZcv82ytpMviovkli4= github.com/streamingfast/logging v0.0.0-20220405224725-2755dab2ce75/go.mod h1:VlduQ80JcGJSargkRU4Sg9Xo63wZD/l8A5NC/Uo1/uU= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -1603,19 +1511,16 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= -github.com/subosito/gotenv v1.4.2 h1:X1TuBLAMDFbaTAChgCBLu3DU3UPyELpnF2jjJ2cz/S8= -github.com/subosito/gotenv v1.4.2/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= +github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= +github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= github.com/supranational/blst v0.3.11 h1:LyU6FolezeWAhvQk0k6O/d49jqgO52MSDDfYgbeoEm4= github.com/supranational/blst v0.3.11/go.mod h1:jZJtfjgudtNl4en1tzwPIV3KjUnQUvG3/j+w+fVonLw= github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d h1:vfofYNRScrDdvS342BElfbETmL1Aiz3i2t0zfRj16Hs= github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d/go.mod h1:RRCYJbIwD5jmqPI9XoAFR0OcDxqUctll6zUj/+B4S48= -github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c h1:g+WoO5jjkqGAzHWCjJB1zZfXPIAaDpzXIEJ0eS6B5Ok= -github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c/go.mod h1:ahpPrc7HpcfEWDQRZEmnXMzHY03mLDYMCxeDzy46i+8= github.com/tendermint/go-amino v0.16.0 h1:GyhmgQKvqF82e2oZeuMSp9JTN0N09emoSZlb2lyGa2E= github.com/tendermint/go-amino v0.16.0/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoMC9Sphe2ZwGME= github.com/teris-io/shortid v0.0.0-20171029131806-771a37caa5cf/go.mod h1:M8agBzgqHIhgj7wEn9/0hJUZcrvt9VY+Ln+S1I5Mha0= @@ -1653,10 +1558,7 @@ github.com/uber/jaeger-client-go v2.30.0+incompatible h1:D6wyKGCecFaSRUpo8lCVbaO github.com/uber/jaeger-client-go v2.30.0+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk= github.com/uber/jaeger-lib v2.4.1+incompatible h1:td4jdvLcExb4cBISKIpHuGoVXh+dVKhn2Um6rjCsSsg= github.com/uber/jaeger-lib v2.4.1+incompatible/go.mod h1:ComeNDZlWwrWnDv8aPp0Ba6+uUTzImX/AauajbLI56U= -github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= -github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= -github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= github.com/ugorji/go/codec v1.2.12 h1:9LC83zGrHhuUA9l16C9AHXAqEV/2wBQ4nkvumAE65EE= github.com/ugorji/go/codec v1.2.12/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= github.com/ulikunitz/xz v0.5.11 h1:kpFauv27b6ynzBNT/Xy+1k+fK4WswhN/6PN5WhFAGw8= @@ -1673,14 +1575,12 @@ github.com/urfave/cli v1.22.14 h1:ebbhrRiGK2i4naQJr+1Xj92HXZCrK7MsyTS/ob3HnAk= github.com/urfave/cli v1.22.14/go.mod h1:X0eDS6pD6Exaclxm99NJ3FiCDRED7vIHpx2mDOHLvkA= github.com/urfave/cli/v2 v2.25.7 h1:VAzn5oq403l5pHjc4OhD54+XGO9cdKVL/7lDjF+iKUs= github.com/urfave/cli/v2 v2.25.7/go.mod h1:8qnjx1vcq5s2/wpsqoZFndg2CE5tNFyrTvS6SinrnYQ= -github.com/urfave/negroni v1.0.0/go.mod h1:Meg73S6kFm/4PpbYdq35yYWoCZ9mS/YSx+lKnmiohz4= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= -github.com/valyala/fasthttp v1.6.0/go.mod h1:FstJa9V+Pj9vQ7OJie2qMHdwemEDaDiSdBnvPM1Su9w= github.com/valyala/fastjson v1.4.1 h1:hrltpHpIpkaxll8QltMU8c3QZ5+qIiCL8yKqPFJI/yE= github.com/valyala/fastjson v1.4.1/go.mod h1:nV6MsjxL2IMJQUoHDIrjEI7oLyeqK6aBD7EFWPsvP8o= github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= -github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= -github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a/go.mod h1:v3UYOV9WzVtRmSR+PDvWpU/qWl4Wa5LApYYX4ZtKbio= +github.com/vektah/gqlparser/v2 v2.5.11 h1:JJxLtXIoN7+3x6MBdtIP59TP1RANnY7pXOaDnADQSf8= +github.com/vektah/gqlparser/v2 v2.5.11/go.mod h1:1rCcfwB2ekJofmluGWXMSEnPMZgbxzwj6FaZ/4OT8Cc= github.com/vultr/govultr/v2 v2.17.2 h1:gej/rwr91Puc/tgh+j33p/BLR16UrIPnSr+AIwYWZQs= github.com/vultr/govultr/v2 v2.17.2/go.mod h1:ZFOKGWmgjytfyjeyAdhQlSWwTjh2ig+X49cAp50dzXI= github.com/wk8/go-ordered-map/v2 v2.1.8 h1:5h/BUHu93oj4gIdvHHHGsScSTMijfx5PeYkE/fJgbpc= @@ -1692,20 +1592,14 @@ github.com/xdg-go/scram v1.0.2/go.mod h1:1WAq6h33pAW+iRreB34OORO2Nf7qel3VV3fjBj+ github.com/xdg-go/scram v1.1.1/go.mod h1:RaEWvsqvNKKvBPvcKeFjrG2cJqOkHTiyTpzz23ni57g= github.com/xdg-go/stringprep v1.0.2/go.mod h1:8F9zXuvzgwmyT5DUm4GUfZGDdT3W+LCvS6+da4O5kxM= github.com/xdg-go/stringprep v1.0.3/go.mod h1:W3f5j4i+9rC0kuIEJL0ky1VpHXQU3ocBgklLGvcBnW8= -github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= -github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= -github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= +github.com/xhit/go-str2duration v1.2.0/go.mod h1:3cPSlfZlUHVlneIVfePFWcJZsuwf+P1v2SRTV4cUmp4= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= -github.com/xlab/treeprint v1.1.0 h1:G/1DjNkPpfZCFt9CSh6b5/nY4VimlbHF3Rh4obvtzDk= -github.com/xlab/treeprint v1.1.0/go.mod h1:gj5Gd3gPdKtR1ikdDK6fnFLdmIS0X30kTTuNd/WEJu0= +github.com/xlab/treeprint v1.2.0 h1:HzHnuAF1plUN2zGlAFHbSQP2qJ0ZAD3XF5XD7OesXRQ= +github.com/xlab/treeprint v1.2.0/go.mod h1:gj5Gd3gPdKtR1ikdDK6fnFLdmIS0X30kTTuNd/WEJu0= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU= github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8= -github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0/go.mod h1:/LWChgwKmvncFJFHJ7Gvn9wZArjbV5/FppcK2fKk/tI= github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7JulP+udvsHwJoVG1YGAP6VLg4y9I5dyZdqmA= -github.com/yudai/gojsondiff v1.0.0/go.mod h1:AY32+k2cwILAkW1fbgxQ5mUmMiZFgLIV+FBNExI05xg= -github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82/go.mod h1:lgjkn3NuSvDfVJdfcVVdX+jpBxNmX4rDAzaS45IcYoM= -github.com/yudai/pp v2.0.1+incompatible/go.mod h1:PuxR/8QJ7cyCkFp/aUDS+JY727OFEZkTdatxwunjIkc= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -1717,10 +1611,10 @@ github.com/yuin/gopher-lua v1.1.0/go.mod h1:GBR0iDaNXjAgGg9zfCvksxSRnQx76gclCIb7 github.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0= github.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q= -github.com/zondax/hid v0.9.1 h1:gQe66rtmyZ8VeGFcOpbuH3r7erYtNEAezCAYu8LdkJo= -github.com/zondax/hid v0.9.1/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= -github.com/zondax/ledger-go v0.14.1 h1:Pip65OOl4iJ84WTpA4BKChvOufMhhbxED3BaihoZN4c= -github.com/zondax/ledger-go v0.14.1/go.mod h1:fZ3Dqg6qcdXWSOJFKMG8GCTnD7slO/RL2feOQv8K320= +github.com/zondax/hid v0.9.2 h1:WCJFnEDMiqGF64nlZz28E9qLVZ0KSJ7xpc5DLEyma2U= +github.com/zondax/hid v0.9.2/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= +github.com/zondax/ledger-go v0.14.3 h1:wEpJt2CEcBJ428md/5MgSLsXLBos98sBOyxNmCjfUCw= +github.com/zondax/ledger-go v0.14.3/go.mod h1:IKKaoxupuB43g4NxeQmbLXv7T9AlQyie1UpHb342ycI= go.dedis.ch/fixbuf v1.0.3 h1:hGcV9Cd/znUxlusJ64eAlExS+5cJDIyTyEG+otu5wQs= go.dedis.ch/fixbuf v1.0.3/go.mod h1:yzJMt34Wa5xD37V5RTdmp38cz3QhMagdGoem9anUalw= go.dedis.ch/kyber/v3 v3.0.4/go.mod h1:OzvaEnPvKlyrWyp3kGXlFdp7ap1VC6RkZDTaPikqhsQ= @@ -1731,14 +1625,14 @@ go.dedis.ch/protobuf v1.0.5/go.mod h1:eIV4wicvi6JK0q/QnfIEGeSFNG0ZeB24kzut5+HaRL go.dedis.ch/protobuf v1.0.7/go.mod h1:pv5ysfkDX/EawiPqcW3ikOxsL5t+BqnV6xHSmE79KI4= go.dedis.ch/protobuf v1.0.11/go.mod h1:97QR256dnkimeNdfmURz0wAMNVbd1VmLXhG1CrTYrJ4= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.etcd.io/bbolt v1.3.7 h1:j+zJOnnEjF/kyHlDDgGnVL/AIqIJPq8UoB2GSNfkUfQ= -go.etcd.io/bbolt v1.3.7/go.mod h1:N9Mkw9X8x5fupy0IKsmuqVtoGDyxsaDlbk4Rd05IAQw= -go.etcd.io/etcd/api/v3 v3.5.7 h1:sbcmosSVesNrWOJ58ZQFitHMdncusIifYcrBfwrlJSY= -go.etcd.io/etcd/api/v3 v3.5.7/go.mod h1:9qew1gCdDDLu+VwmeG+iFpL+QlpHTo7iubavdVDgCAA= -go.etcd.io/etcd/client/pkg/v3 v3.5.7 h1:y3kf5Gbp4e4q7egZdn5T7W9TSHUvkClN6u+Rq9mEOmg= -go.etcd.io/etcd/client/pkg/v3 v3.5.7/go.mod h1:o0Abi1MK86iad3YrWhgUsbGx1pmTS+hrORWc2CamuhY= -go.etcd.io/etcd/client/v3 v3.5.7 h1:u/OhpiuCgYY8awOHlhIhmGIGpxfBU/GZBUP3m/3/Iz4= -go.etcd.io/etcd/client/v3 v3.5.7/go.mod h1:sOWmj9DZUMyAngS7QQwCyAXXAL6WhgTOPLNS/NabQgw= +go.etcd.io/bbolt v1.3.9 h1:8x7aARPEXiXbHmtUwAIv7eV2fQFHrLLavdiJ3uzJXoI= +go.etcd.io/bbolt v1.3.9/go.mod h1:zaO32+Ti0PK1ivdPtgMESzuzL2VPoIG1PCQNvOdo/dE= +go.etcd.io/etcd/api/v3 v3.5.14 h1:vHObSCxyB9zlF60w7qzAdTcGaglbJOpSj1Xj9+WGxq0= +go.etcd.io/etcd/api/v3 v3.5.14/go.mod h1:BmtWcRlQvwa1h3G2jvKYwIQy4PkHlDej5t7uLMUdJUU= +go.etcd.io/etcd/client/pkg/v3 v3.5.14 h1:SaNH6Y+rVEdxfpA2Jr5wkEvN6Zykme5+YnbCkxvuWxQ= +go.etcd.io/etcd/client/pkg/v3 v3.5.14/go.mod h1:8uMgAokyG1czCtIdsq+AGyYQMvpIKnSvPjFMunkgeZI= +go.etcd.io/etcd/client/v3 v3.5.14 h1:CWfRs4FDaDoSz81giL7zPpZH2Z35tbOrAJkkjMqOupg= +go.etcd.io/etcd/client/v3 v3.5.14/go.mod h1:k3XfdV/VIHy/97rqWjoUzrj9tk7GgJGH9J8L4dNXmAk= go.mongodb.org/mongo-driver v1.7.3/go.mod h1:NqaYOwnXWr5Pm7AOpO5QFxKJ503nbMse/R79oO62zWg= go.mongodb.org/mongo-driver v1.7.5/go.mod h1:VXEWRZ6URJIkUq2SCAyapmhH0ZLRBP+FT4xhp5Zvxng= go.mongodb.org/mongo-driver v1.10.0/go.mod h1:wsihk0Kdgv8Kqu1Anit4sfK+22vSFbUrAVEYRhCXrA8= @@ -1758,35 +1652,46 @@ go.opentelemetry.io/collector/pdata v1.0.0-rcv0016 h1:qCPXSQCoD3qeWFb1RuIks8fw9A go.opentelemetry.io/collector/pdata v1.0.0-rcv0016/go.mod h1:OdN0alYOlYhHXu6BDlGehrZWgtBuiDsz/rlNeJeXiNg= go.opentelemetry.io/collector/semconv v0.87.0 h1:BsG1jdLLRCBRlvUujk4QA86af7r/ZXnizczQpEs/gg8= go.opentelemetry.io/collector/semconv v0.87.0/go.mod h1:j/8THcqVxFna1FpvA2zYIsUperEtOaRaqoLYIN4doWw= -go.opentelemetry.io/contrib v0.20.0 h1:ubFQUn0VCZ0gPwIoJfBJVpeBlyRMxu8Mm/huKWYd9p0= go.opentelemetry.io/contrib/instrumentation/github.com/gin-gonic/gin/otelgin v0.49.0 h1:1f31+6grJmV3X4lxcEvUy13i5/kfDw1nJZwhd8mA4tg= go.opentelemetry.io/contrib/instrumentation/github.com/gin-gonic/gin/otelgin v0.49.0/go.mod h1:1P/02zM3OwkX9uki+Wmxw3a5GVb6KUXRsa7m7bOC9Fg= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.52.0 h1:vS1Ao/R55RNV4O7TA2Qopok8yN+X0LIP6RVWLFkprck= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.52.0/go.mod h1:BMsdeOxN04K0L5FNUBfjFdvwWGNe/rkmSwH4Aelu/X0= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 h1:jq9TW8u3so/bN+JPT166wjOI6/vQPF6Xe7nMNIltagk= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0/go.mod h1:p8pYQP+m5XfbZm9fxtSKAbM6oIllS7s2AfxrChvc7iw= -go.opentelemetry.io/otel v1.27.0 h1:9BZoF3yMK/O1AafMiQTVu0YDj5Ea4hPhxCs7sGva+cg= -go.opentelemetry.io/otel v1.27.0/go.mod h1:DMpAK8fzYRzs+bi3rS5REupisuqTheUlSZJ1WnZaPAQ= -go.opentelemetry.io/otel/exporters/otlp v0.20.0 h1:PTNgq9MRmQqqJY0REVbZFvwkYOA85vbdQU/nVfxDyqg= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.27.0 h1:R9DE4kQ4k+YtfLI2ULwX82VtNQ2J8yZmA7ZIF/D+7Mc= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.27.0/go.mod h1:OQFyQVrDlbe+R7xrEyDr/2Wr67Ol0hRUgsfA+V5A95s= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.27.0 h1:qFffATk0X+HD+f1Z8lswGiOQYKHRlzfmdJm0wEaVrFA= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.27.0/go.mod h1:MOiCmryaYtc+V0Ei+Tx9o5S1ZjA7kzLucuVuyzBZloQ= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.53.0 h1:9G6E0TXzGFVfTnawRzrPl83iHOAV7L8NJiR8RSGYV1g= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.53.0/go.mod h1:azvtTADFQJA8mX80jIH/akaE7h+dbm/sVuaHqN13w74= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.53.0 h1:4K4tsIXefpVJtvA/8srF4V4y0akAoPHkIslgAkjixJA= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.53.0/go.mod h1:jjdQuTGVsXV4vSs+CJ2qYDeDPf9yIJV23qlIzBm73Vg= +go.opentelemetry.io/otel v1.28.0 h1:/SqNcYk+idO0CxKEUOtKQClMK/MimZihKYMruSMViUo= +go.opentelemetry.io/otel v1.28.0/go.mod h1:q68ijF8Fc8CnMHKyzqL6akLO46ePnjkgfIMIjUIX9z4= +go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.0.0-20240823153156-2a54df7bffb9 h1:UiRNKd1OgqsLbFwE+wkAWTdiAxXtCBqKIHeBIse4FUA= +go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.0.0-20240823153156-2a54df7bffb9/go.mod h1:eqZlW3pJWhjyexnDPrdQxix1pn0wwhI4AO4GKpP/bMI= +go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.28.0 h1:U2guen0GhqH8o/G2un8f/aG/y++OuW6MyCo6hT9prXk= +go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.28.0/go.mod h1:yeGZANgEcpdx/WK0IvvRFC+2oLiMS2u4L/0Rj2M2Qr0= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.28.0 h1:3Q/xZUyC1BBkualc9ROb4G8qkH90LXEIICcs5zv1OYY= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.28.0/go.mod h1:s75jGIWA9OfCMzF0xr+ZgfrB5FEbbV7UuYo32ahUiFI= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.28.0 h1:R3X6ZXmNPRR8ul6i3WgFURCHzaXjHdm0karRG/+dj3s= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.28.0/go.mod h1:QWFXnDavXWwMx2EEcZsf3yxgEKAqsxQ+Syjp+seyInw= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.19.0 h1:IeMeyr1aBvBiPVYihXIaeIZba6b8E1bYp7lbdxK8CQg= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.19.0/go.mod h1:oVdCUtjq9MK9BlS7TtucsQwUcXcymNiEDjgDD2jMtZU= -go.opentelemetry.io/otel/metric v1.27.0 h1:hvj3vdEKyeCi4YaYfNjv2NUje8FqKqUY8IlF0FxV/ik= -go.opentelemetry.io/otel/metric v1.27.0/go.mod h1:mVFgmRlhljgBiuk/MP/oKylr4hs85GZAylncepAX/ak= -go.opentelemetry.io/otel/sdk v1.27.0 h1:mlk+/Y1gLPLn84U4tI8d3GNJmGT/eXe3ZuOXN9kTWmI= -go.opentelemetry.io/otel/sdk v1.27.0/go.mod h1:Ha9vbLwJE6W86YstIywK2xFfPjbWlCuwPtMkKdz/Y4A= -go.opentelemetry.io/otel/sdk/metric v1.21.0 h1:smhI5oD714d6jHE6Tie36fPx4WDFIg+Y6RfAY4ICcR0= -go.opentelemetry.io/otel/sdk/metric v1.21.0/go.mod h1:FJ8RAsoPGv/wYMgBdUJXOm+6pzFY3YdljnXtv1SBE8Q= -go.opentelemetry.io/otel/trace v1.27.0 h1:IqYb813p7cmbHk0a5y6pD5JPakbVfftRXABGt5/Rscw= -go.opentelemetry.io/otel/trace v1.27.0/go.mod h1:6RiD1hkAprV4/q+yd2ln1HG9GoPx39SuvvstaLBl+l4= -go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= -go.opentelemetry.io/proto/otlp v1.2.0 h1:pVeZGk7nXDC9O2hncA6nHldxEjm6LByfA2aN8IOkz94= -go.opentelemetry.io/proto/otlp v1.2.0/go.mod h1:gGpR8txAl5M03pDhMC79G6SdqNV26naRm/KDsgaHD8A= -go.starlark.net v0.0.0-20220817180228-f738f5508c12 h1:xOBJXWGEDwU5xSDxH6macxO11Us0AH2fTa9rmsbbF7g= -go.starlark.net v0.0.0-20220817180228-f738f5508c12/go.mod h1:VZcBMdr3cT3PnBoWunTabuSEXwVAH+ZJ5zxfs3AdASk= +go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.4.0 h1:0MH3f8lZrflbUWXVxyBg/zviDFdGE062uKh5+fu8Vv0= +go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.4.0/go.mod h1:Vh68vYiHY5mPdekTr0ox0sALsqjoVy0w3Os278yX5SQ= +go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.28.0 h1:BJee2iLkfRfl9lc7aFmBwkWxY/RI1RDdXepSF6y8TPE= +go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.28.0/go.mod h1:DIzlHs3DRscCIBU3Y9YSzPfScwnYnzfnCd4g8zA7bZc= +go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.28.0 h1:EVSnY9JbEEW92bEkIYOVMw4q1WJxIAGoFTrtYOzWuRQ= +go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.28.0/go.mod h1:Ea1N1QQryNXpCD0I1fdLibBAIpQuBkznMmkdKrapk1Y= +go.opentelemetry.io/otel/log v0.4.0 h1:/vZ+3Utqh18e8TPjuc3ecg284078KWrR8BRz+PQAj3o= +go.opentelemetry.io/otel/log v0.4.0/go.mod h1:DhGnQvky7pHy82MIRV43iXh3FlKN8UUKftn0KbLOq6I= +go.opentelemetry.io/otel/metric v1.28.0 h1:f0HGvSl1KRAU1DLgLGFjrwVyismPlnuU6JD6bOeuA5Q= +go.opentelemetry.io/otel/metric v1.28.0/go.mod h1:Fb1eVBFZmLVTMb6PPohq3TO9IIhUisDsbJoL/+uQW4s= +go.opentelemetry.io/otel/sdk v1.28.0 h1:b9d7hIry8yZsgtbmM0DKyPWMMUMlK9NEKuIG4aBqWyE= +go.opentelemetry.io/otel/sdk v1.28.0/go.mod h1:oYj7ClPUA7Iw3m+r7GeEjz0qckQRJK2B8zjcZEfu7Pg= +go.opentelemetry.io/otel/sdk/log v0.4.0 h1:1mMI22L82zLqf6KtkjrRy5BbagOTWdJsqMY/HSqILAA= +go.opentelemetry.io/otel/sdk/log v0.4.0/go.mod h1:AYJ9FVF0hNOgAVzUG/ybg/QttnXhUePWAupmCqtdESo= +go.opentelemetry.io/otel/sdk/metric v1.28.0 h1:OkuaKgKrgAbYrrY0t92c+cC+2F6hsFNnCQArXCKlg08= +go.opentelemetry.io/otel/sdk/metric v1.28.0/go.mod h1:cWPjykihLAPvXKi4iZc1dpER3Jdq2Z0YLse3moQUCpg= +go.opentelemetry.io/otel/trace v1.28.0 h1:GhQ9cUuQGmNDd5BTCP2dAvv75RdMxEfTmYejp+lkx9g= +go.opentelemetry.io/otel/trace v1.28.0/go.mod h1:jPyXzNPg6da9+38HEwElrQiHlVMTnVfM3/yv2OlIHaI= +go.opentelemetry.io/proto/otlp v1.3.1 h1:TrMUixzpM0yuc/znrFTP9MMRh8trP93mkCiDVeXrui0= +go.opentelemetry.io/proto/otlp v1.3.1/go.mod h1:0X1WI4de4ZsLrrJNLAQbFeLCm3T7yBkR0XqQ7niQU+8= +go.starlark.net v0.0.0-20230525235612-a134d8f9ddca h1:VdD38733bfYv5tUZwEIskMM93VanwNIi5bIKnDrJdEY= +go.starlark.net v0.0.0-20230525235612-a134d8f9ddca/go.mod h1:jxU+3+j+71eXOW14274+SmmuW82qJzl6iZSeqEtTGds= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= @@ -1813,14 +1718,13 @@ go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= go.uber.org/zap v1.14.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= go.uber.org/zap v1.16.0/go.mod h1:MA8QOfq0BHJwdXa996Y4dYkAqRKB8/1K1QMMZVaNZjQ= go.uber.org/zap v1.21.0/go.mod h1:wjWOCqI0f2ZZrJF/UufIOkiC8ii6tm1iqIsLo76RfJw= -go.uber.org/zap v1.24.0/go.mod h1:2kMP+WWQ8aoFoedH3T2sq6iJ2yDWpHbP0f6MQbS9Gkg= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= +go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= go4.org/netipx v0.0.0-20230125063823-8449b0a6169f h1:ketMxHg+vWm3yccyYiq+uK8D3fRmna2Fcj+awpQp84s= go4.org/netipx v0.0.0-20230125063823-8449b0a6169f/go.mod h1:tgPU4N2u9RByaTN3NC2p9xOzyFpte4jYwsIIRF7XlSc= golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= -golang.org/x/arch v0.7.0 h1:pskyeJh/3AmoQ8CPE95vxHLqp1G1GfGNXTmcl9NEKTc= -golang.org/x/arch v0.7.0/go.mod h1:FEVrYAQjsQXMVJ1nsMoVVXPZg6p2JE2mx8psSWTDQys= +golang.org/x/arch v0.8.0 h1:3wRIsP3pM4yUptoR96otTUOXI367OS0+c9eeRi9doIc= +golang.org/x/arch v0.8.0/go.mod h1:FEVrYAQjsQXMVJ1nsMoVVXPZg6p2JE2mx8psSWTDQys= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= @@ -1830,31 +1734,26 @@ golang.org/x/crypto v0.0.0-20190411191339-88737f569e3a/go.mod h1:WFFai1msRO1wXaE golang.org/x/crypto v0.0.0-20190422162423-af44ce270edf/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20191227163750-53104e6ec876/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201203163018-be400aefbc4c/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= -golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= -golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220214200702-86341886e292/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc= golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= -golang.org/x/crypto v0.24.0 h1:mnl8DM0o513X8fdIkmyFE/5hTYxbwYOjDS/+rK6qpRI= -golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM= +golang.org/x/crypto v0.27.0 h1:GXm2NjJrPaiv/h1tb2UH8QfgC/hOf/+z0p6PT8o1w7A= +golang.org/x/crypto v0.27.0/go.mod h1:1Xngt8kV6Dvbssa53Ziq6Eqn0HqbZi5Z6R0ZpwQzt70= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -1865,8 +1764,8 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20240325151524-a685a6edb6d8 h1:aAcj0Da7eBAtrTp03QXWvm88pSyOt+UgdZw2BFZ+lEw= -golang.org/x/exp v0.0.0-20240325151524-a685a6edb6d8/go.mod h1:CQ1k9gNrJ50XIzaKCRR2hssIjF07kZFEiieALBM/ARQ= +golang.org/x/exp v0.0.0-20240909161429-701f63a606c0 h1:e66Fs6Z+fZTbFBAxKfP3PALWBtpfqks2bwGcexMxgtk= +golang.org/x/exp v0.0.0-20240909161429-701f63a606c0/go.mod h1:2TbTHSBQa924w8M6Xs1QcRcFwyucIwBGpK1p2f1YFFY= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -1880,7 +1779,6 @@ golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRu golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= @@ -1889,34 +1787,28 @@ golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzB golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA= -golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.21.0 h1:vvrHzRwRfVKSiLrG+d4FMl/Qi4ukBCE6kZlTUkDYRT0= +golang.org/x/mod v0.21.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190327091125-710a502c58a2/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= -golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190921015927-1a5e07d1ff72/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -1935,11 +1827,8 @@ golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81R golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= golang.org/x/net v0.0.0-20210331212208-0fccb6fa2b5c/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= @@ -1947,32 +1836,28 @@ golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96b golang.org/x/net v0.0.0-20210410081132-afb366fc7cd1/go.mod h1:9tjilg8BloeKEkVJvy7fQ90B1CfIiPueXVOjqfkSzI8= golang.org/x/net v0.0.0-20210421230115-4e50805a0758/go.mod h1:72T/g9IO56b78aLF+1Kcs5dz7/ng1VjMUvfKvpfy+jM= golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= -golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-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-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= -golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac= -golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= +golang.org/x/net v0.29.0 h1:5ORfpBpCs4HzDYoodCDBbwHzdR5UrLBZ3sOnUJmFoHo= +golang.org/x/net v0.29.0/go.mod h1:gLkgy8jTGERgjzMic6DS9+SP0ajcu6Xu3Orq/SpETg0= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/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.20.0 h1:4mQdhULixXKP1rwYBW0vAijoXnkTG0BLCDRzfe1idMo= -golang.org/x/oauth2 v0.20.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= +golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= +golang.org/x/oauth2 v0.5.0/go.mod h1:9/XBHVqLaWO3/BRHs5jbpYCnOZVjj5V0ndyaAM7KB4I= +golang.org/x/oauth2 v0.22.0 h1:BzDx2FehcG7jJwgWLELCdmLuxk2i+x9UDpSiss2u0ZA= +golang.org/x/oauth2 v0.22.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1983,19 +1868,18 @@ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= -golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190124100055-b90733256f2e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -2025,7 +1909,6 @@ golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -2039,39 +1922,27 @@ golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210303074136-134d130e1a04/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210331175145-43e1dd70ce54/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210420072515-93ed5bcd2bfe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210616045830-e2b7044e8c71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210819135213-f52c844e1c1c/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-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220310020820-b874c991c1a5/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -2080,7 +1951,6 @@ golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -2091,20 +1961,21 @@ golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= -golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34= +golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= 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-20201210144234-2321bbc49cbf/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.0.0-20220526004731-065cf7ba2467/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU= golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= -golang.org/x/term v0.21.0 h1:WVXCp+/EBEHOj53Rvu+7KiT/iElMrO8ACK16SMZ3jaA= -golang.org/x/term v0.21.0/go.mod h1:ooXLefLobQVslOqselCNF4SxFAaoS6KujMbsGzSDmX0= +golang.org/x/term v0.24.0 h1:Mh5cbb+Zk2hqqXNO7S1iTjEphVL+jb8ZWaqh/g+JWkM= +golang.org/x/term v0.24.0/go.mod h1:lOBK/LVxemqiMij05LGJ0tzNr8xlmwBRJ81PX6wVLH8= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -2118,23 +1989,20 @@ golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= -golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= -golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= +golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224= +golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20201208040808-7e3f01d25324/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= -golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= +golang.org/x/time v0.6.0 h1:eTDhh4ZXt5Qf0augr54TN6suAUudPcawVZeIAPU7D4U= +golang.org/x/time v0.6.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181221001348-537d06c36207/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190327201419-c70d86f8b7cf/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190329151228-23e29df326fe/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190416151739-9c9e1878f421/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= @@ -2184,21 +2052,14 @@ golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roY golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= -golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= -golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg= -golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= +golang.org/x/tools v0.25.0 h1:oFU9pkj/iJgs+0DT+VMHrx+oBKs/LJMV+Uvg78sl+fE= +golang.org/x/tools v0.25.0/go.mod h1:/vtpO8WL1N9cQC3FN5zPqb//fRXskFHbLKk4OW1Q7rg= golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -2206,10 +2067,10 @@ golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= -gomodules.xyz/jsonpatch/v2 v2.2.0 h1:4pT439QV83L+G9FkcCriY6EkpcK6r6bK+A5FBUMI7qY= -gomodules.xyz/jsonpatch/v2 v2.2.0/go.mod h1:WXp+iVDkoLQqPudfQ9GBlwB2eZ5DKOnjQZCYdOS8GPY= -gonum.org/v1/gonum v0.14.0 h1:2NiG67LD1tEH0D7kM+ps2V+fXmsAnpUeec7n8tcr4S0= -gonum.org/v1/gonum v0.14.0/go.mod h1:AoWeoz0becf9QMWtE8iWXNXc27fK4fNeHNf/oMejGfU= +gomodules.xyz/jsonpatch/v2 v2.4.0 h1:Ci3iUJyx9UeRx7CeFN8ARgGbkESwJK+KB9lLcWxY/Zw= +gomodules.xyz/jsonpatch/v2 v2.4.0/go.mod h1:AH3dM2RI6uoBZxn3LVrfvJ3E0/9dG4cSrbuBJT4moAY= +gonum.org/v1/gonum v0.15.0 h1:2lYxjRbTYyxkJxlhC+LvJIx3SsANPdRybu1tGj9/OrQ= +gonum.org/v1/gonum v0.15.0/go.mod h1:xzZVBJBtS+Mz4q0Yl2LJTk+OxOg4jiXZ7qBoM0uISGo= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= @@ -2227,11 +2088,8 @@ google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0M google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= -google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= -google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= -google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= -google.golang.org/api v0.169.0 h1:QwWPy71FgMWqJN/l6jVlFHUa29a7dcUy02I8o799nPY= -google.golang.org/api v0.169.0/go.mod h1:gpNOiMA2tZ4mf5R9Iwf4rK/Dcz0fbdIgWYWVoxmsyLg= +google.golang.org/api v0.188.0 h1:51y8fJ/b1AaaBRJr4yWm96fPcuxSo0JcegXE3DaHQHw= +google.golang.org/api v0.188.0/go.mod h1:VR0d+2SIiWOYG3r/jdm7adPW9hI2aRv9ETOSCQ9Beag= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -2275,22 +2133,13 @@ google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7Fc google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210401141331-865547bb08e2/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= -google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= -google.golang.org/genproto v0.0.0-20220107163113-42d7afdf6368/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 h1:9+tzLLstTlPTRyJTh+ah5wIMsBW5c4tQwGTN3thOW9Y= -google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9/go.mod h1:mqHbVIp48Muh7Ywss/AD6I5kNVKZMmAa/QEW58Gxp2s= -google.golang.org/genproto/googleapis/api v0.0.0-20240520151616-dc85e6b867a5 h1:P8OJ/WCl/Xo4E4zoe4/bifHpSmmKwARqyqE4nW6J2GQ= -google.golang.org/genproto/googleapis/api v0.0.0-20240520151616-dc85e6b867a5/go.mod h1:RGnPtTG7r4i8sPlNyDeikXF99hMM+hN6QMm4ooG9g2g= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240520151616-dc85e6b867a5 h1:Q2RxlXqh1cgzzUgV261vBO2jI5R/3DD1J2pM0nI4NhU= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240520151616-dc85e6b867a5/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0= +google.golang.org/genproto v0.0.0-20240711142825-46eb208f015d h1:/hmn0Ku5kWij/kjGsrcJeC1T/MrJi2iNWwgAqrihFwc= +google.golang.org/genproto v0.0.0-20240711142825-46eb208f015d/go.mod h1:FfBgJBJg9GcpPvKIuHSZ/aE1g2ecGL74upMzGZjiGEY= +google.golang.org/genproto/googleapis/api v0.0.0-20240822170219-fc7c04adadcd h1:BBOTEWLuuEGQy9n1y9MhVJ9Qt0BDu21X8qZs71/uPZo= +google.golang.org/genproto/googleapis/api v0.0.0-20240822170219-fc7c04adadcd/go.mod h1:fO8wJzT2zbQbAjbIoos1285VfEIYKDDY+Dt+WpTkh6g= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd h1:6TEm2ZxXoQmFWFlt1vNxvVOa1Q0dXFQD1m/rYjXmS0E= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= google.golang.org/grpc v1.12.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= @@ -2306,17 +2155,11 @@ google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKa google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= -google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= -google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= -google.golang.org/grpc v1.64.0 h1:KH3VH9y/MgNQg1dE7b3XfVK0GsPSIzJwdF617gUSbvY= -google.golang.org/grpc v1.64.0/go.mod h1:oxjF8E3FBnjp+/gVFYdWacaLDx9na1aqy9oovLpxQYg= +google.golang.org/grpc v1.65.0 h1:bs/cUb4lp1G5iImFFd3u5ixQzweKizoZJAwBNLR42lc= +google.golang.org/grpc v1.65.0/go.mod h1:WgYC2ypjlB0EiQi6wdKixMqukr6lBc0Vo+oOgjrM5ZQ= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -2329,10 +2172,10 @@ 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.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.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= -google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= -gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= +google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -2341,44 +2184,38 @@ gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/evanphx/json-patch.v4 v4.12.0 h1:n6jtcsulIzXPJaxegRbvFNNrZDjbij7ny3gmSPG+6V4= +gopkg.in/evanphx/json-patch.v4 v4.12.0/go.mod h1:p8EYWUEYMpynmqDbY58zCKCFZw8pRWMG4EsWvDvM72M= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= -gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE= -gopkg.in/go-playground/validator.v8 v8.18.2/go.mod h1:RX2a/7Ha8BgOhfk7j780h4/u/RRjR0eouCJSH80/M2Y= gopkg.in/guregu/null.v4 v4.0.0 h1:1Wm3S1WEA2I26Kq+6vcW+w0gcDo44YKYD7YIEJNHDjg= gopkg.in/guregu/null.v4 v4.0.0/go.mod h1:YoQhUrADuG3i9WqesrCmpNRwm1ypAgSHYqoOcTu/JrI= gopkg.in/inconshreveable/log15.v2 v2.0.0-20180818164646-67afb5ed74ec/go.mod h1:aPpfJ7XW+gOuirDoZ8gHhLh3kZ1B08FtV2bbmy7Jv3s= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/ini.v1 v1.51.1/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/mgo.v2 v2.0.0-20180705113604-9856a29383ce/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA= gopkg.in/natefinch/lumberjack.v2 v2.2.1 h1:bBRl1b0OH9s/DuPhuXpNl+VtCaJXFZ5/uEFST95x9zc= gopkg.in/natefinch/lumberjack.v2 v2.2.1/go.mod h1:YD8tP3GAjkrDg1eZH7EGmyESg/lsYskCTPBJVb9jqSc= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= -gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= -gopkg.in/yaml.v3 v3.0.0-20191120175047-4206685974f2/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20200605160147-a5ece683394c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= -gotest.tools/v3 v3.5.0 h1:Ljk6PdHdOhAb5aDMWXjDLMMhph+BpztA4v1QdqEW2eY= -gotest.tools/v3 v3.5.0/go.mod h1:isy3WKz7GK6uNw/sbHzfKBLvlvXwUyV06n6brMxxopU= +gotest.tools/v3 v3.5.1 h1:EENdUnS3pdur5nybKYIh2Vfgc8IUNBjxDPSjtiJcOzU= +gotest.tools/v3 v3.5.1/go.mod h1:isy3WKz7GK6uNw/sbHzfKBLvlvXwUyV06n6brMxxopU= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= @@ -2387,46 +2224,46 @@ honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.1.3/go.mod h1:NgwopIslSNH47DimFoV78dnkksY2EFtX0ajyb3K/las= -k8s.io/api v0.25.11 h1:4mjYDfE3yp22jrytjH0knwgzjXKkxHX4D01ZCAazvZM= -k8s.io/api v0.25.11/go.mod h1:bK4UvD4bthtutNlvensrfBX21PRQ/vs2cIYggHkOOAo= -k8s.io/apiextensions-apiserver v0.25.3 h1:bfI4KS31w2f9WM1KLGwnwuVlW3RSRPuIsfNF/3HzR0k= -k8s.io/apiextensions-apiserver v0.25.3/go.mod h1:ZJqwpCkxIx9itilmZek7JgfUAM0dnTsA48I4krPqRmo= -k8s.io/apimachinery v0.28.2 h1:KCOJLrc6gu+wV1BYgwik4AF4vXOlVJPdiqn0yAWWwXQ= -k8s.io/apimachinery v0.28.2/go.mod h1:RdzF87y/ngqk9H4z3EL2Rppv5jj95vGS/HaFXrLDApU= -k8s.io/cli-runtime v0.25.11 h1:GE2yNZm1tN+MJtw1SGMOLesLF7Kp7NVAVqRSTbXfu4o= -k8s.io/cli-runtime v0.25.11/go.mod h1:r/nEINuHVEpgGhcd2WamU7hD1t/lMnSz8XM44Autltc= -k8s.io/client-go v0.25.11 h1:DJQ141UsbNRI6wYSlcYLP5J5BW5Wq7Bgm42Ztq2SW70= -k8s.io/client-go v0.25.11/go.mod h1:41Xs7p1SfhoReUnmjjYCfCNWFiq4xSkexwJfbxF2F7A= -k8s.io/component-base v0.26.2 h1:IfWgCGUDzrD6wLLgXEstJKYZKAFS2kO+rBRi0p3LqcI= -k8s.io/component-base v0.26.2/go.mod h1:DxbuIe9M3IZPRxPIzhch2m1eT7uFrSBJUBuVCQEBivs= -k8s.io/klog/v2 v2.100.1 h1:7WCHKK6K8fNhTqfBhISHQ97KrnJNFZMcQvKp7gP/tmg= -k8s.io/klog/v2 v2.100.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= -k8s.io/kube-openapi v0.0.0-20230303024457-afdc3dddf62d h1:VcFq5n7wCJB2FQMCIHfC+f+jNcGgNMar1uKd6rVlifU= -k8s.io/kube-openapi v0.0.0-20230303024457-afdc3dddf62d/go.mod h1:y5VtZWM9sHHc2ZodIH/6SHzXj+TPU5USoA8lcIeKEKY= -k8s.io/kubectl v0.25.11 h1:6bsft5Gan6BCvQ7cJbDRFjTm4Zfq8GuUYpsWAdVngYE= -k8s.io/kubectl v0.25.11/go.mod h1:8mIfgkFgT+yJ8/TlmPW1qoRh46H2si9q5nW8id7i9iM= -k8s.io/utils v0.0.0-20230711102312-30195339c3c7 h1:ZgnF1KZsYxWIifwSNZFZgNtWE89WI5yiP5WwlfDoIyc= -k8s.io/utils v0.0.0-20230711102312-30195339c3c7/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= -nhooyr.io/websocket v1.8.7 h1:usjR2uOr/zjjkVMy0lW+PPohFok7PCow5sDjLgX4P4g= -nhooyr.io/websocket v1.8.7/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0= +k8s.io/api v0.31.0 h1:b9LiSjR2ym/SzTOlfMHm1tr7/21aD7fSkqgD/CVJBCo= +k8s.io/api v0.31.0/go.mod h1:0YiFF+JfFxMM6+1hQei8FY8M7s1Mth+z/q7eF1aJkTE= +k8s.io/apiextensions-apiserver v0.31.0 h1:fZgCVhGwsclj3qCw1buVXCV6khjRzKC5eCFt24kyLSk= +k8s.io/apiextensions-apiserver v0.31.0/go.mod h1:b9aMDEYaEe5sdK+1T0KU78ApR/5ZVp4i56VacZYEHxk= +k8s.io/apimachinery v0.31.0 h1:m9jOiSr3FoSSL5WO9bjm1n6B9KROYYgNZOb4tyZ1lBc= +k8s.io/apimachinery v0.31.0/go.mod h1:rsPdaZJfTfLsNJSQzNHQvYoTmxhoOEofxtOsF3rtsMo= +k8s.io/cli-runtime v0.31.0 h1:V2Q1gj1u3/WfhD475HBQrIYsoryg/LrhhK4RwpN+DhA= +k8s.io/cli-runtime v0.31.0/go.mod h1:vg3H94wsubuvWfSmStDbekvbla5vFGC+zLWqcf+bGDw= +k8s.io/client-go v0.31.0 h1:QqEJzNjbN2Yv1H79SsS+SWnXkBgVu4Pj3CJQgbx0gI8= +k8s.io/client-go v0.31.0/go.mod h1:Y9wvC76g4fLjmU0BA+rV+h2cncoadjvjjkkIGoTLcGU= +k8s.io/component-base v0.31.0 h1:/KIzGM5EvPNQcYgwq5NwoQBaOlVFrghoVGr8lG6vNRs= +k8s.io/component-base v0.31.0/go.mod h1:TYVuzI1QmN4L5ItVdMSXKvH7/DtvIuas5/mm8YT3rTo= +k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= +k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= +k8s.io/kube-openapi v0.0.0-20240709000822-3c01b740850f h1:2sXuKesAYbRHxL3aE2PN6zX/gcJr22cjrsej+W784Tc= +k8s.io/kube-openapi v0.0.0-20240709000822-3c01b740850f/go.mod h1:UxDHUPsUwTOOxSU+oXURfFBcAS6JwiRXTYqYwfuGowc= +k8s.io/kubectl v0.31.0 h1:kANwAAPVY02r4U4jARP/C+Q1sssCcN/1p9Nk+7BQKVg= +k8s.io/kubectl v0.31.0/go.mod h1:pB47hhFypGsaHAPjlwrNbvhXgmuAr01ZBvAIIUaI8d4= +k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 h1:pUdcCO1Lk/tbT5ztQWOBi5HBgbBP1J8+AsQnQCKsi8A= +k8s.io/utils v0.0.0-20240711033017-18e509b52bc8/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= +nhooyr.io/websocket v1.8.10 h1:mv4p+MnGrLDcPlBoWsvPP7XCzTYMXP9F9eIGoKbgx7Q= +nhooyr.io/websocket v1.8.10/go.mod h1:rN9OFWIUwuxg4fR5tELlYC04bXYowCP9GX47ivo2l+c= nullprogram.com/x/optparse v1.0.0/go.mod h1:KdyPE+Igbe0jQUrVfMqDMeJQIJZEuyV7pjYmp6pbG50= -pgregory.net/rapid v0.5.5 h1:jkgx1TjbQPD/feRoK+S/mXw9e1uj6WilpHrXJowi6oA= -pgregory.net/rapid v0.5.5/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= +pgregory.net/rapid v1.1.0 h1:CMa0sjHSru3puNx+J0MIAuiiEV4N0qj8/cMWGBBCsjw= +pgregory.net/rapid v1.1.0/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= rsc.io/tmplfunc v0.0.3 h1:53XFQh69AfOa8Tw0Jm7t+GV7KZhOi6jzsCzTtKbMvzU= rsc.io/tmplfunc v0.0.3/go.mod h1:AG3sTPzElb1Io3Yg4voV9AGZJuleGAwaVRxL9M49PhA= -sigs.k8s.io/controller-runtime v0.13.0 h1:iqa5RNciy7ADWnIc8QxCbOX5FEKVR3uxVxKHRMc2WIQ= -sigs.k8s.io/controller-runtime v0.13.0/go.mod h1:Zbz+el8Yg31jubvAEyglRZGdLAjplZl+PgtYNI6WNTI= +sigs.k8s.io/controller-runtime v0.19.0 h1:nWVM7aq+Il2ABxwiCizrVDSlmDcshi9llbaFbC0ji/Q= +sigs.k8s.io/controller-runtime v0.19.0/go.mod h1:iRmWllt8IlaLjvTTDLhRBXIEtkCK6hwVBJJsYS9Ajf4= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= -sigs.k8s.io/kustomize/api v0.12.1 h1:7YM7gW3kYBwtKvoY216ZzY+8hM+lV53LUayghNRJ0vM= -sigs.k8s.io/kustomize/api v0.12.1/go.mod h1:y3JUhimkZkR6sbLNwfJHxvo1TCLwuwm14sCYnkH6S1s= -sigs.k8s.io/kustomize/kyaml v0.13.9 h1:Qz53EAaFFANyNgyOEJbT/yoIHygK40/ZcvU3rgry2Tk= -sigs.k8s.io/kustomize/kyaml v0.13.9/go.mod h1:QsRbD0/KcU+wdk0/L0fIp2KLnohkVzs6fQ85/nOXac4= -sigs.k8s.io/structured-merge-diff/v4 v4.3.0 h1:UZbZAZfX0wV2zr7YZorDz6GXROfDFj6LvqCRm4VUVKk= -sigs.k8s.io/structured-merge-diff/v4 v4.3.0/go.mod h1:N8hJocpFajUSSeSJ9bOZ77VzejKZaXsTtZo4/u7Io08= +sigs.k8s.io/kustomize/api v0.17.2 h1:E7/Fjk7V5fboiuijoZHgs4aHuexi5Y2loXlVOAVAG5g= +sigs.k8s.io/kustomize/api v0.17.2/go.mod h1:UWTz9Ct+MvoeQsHcJ5e+vziRRkwimm3HytpZgIYqye0= +sigs.k8s.io/kustomize/kyaml v0.17.1 h1:TnxYQxFXzbmNG6gOINgGWQt09GghzgTP6mIurOgrLCQ= +sigs.k8s.io/kustomize/kyaml v0.17.1/go.mod h1:9V0mCjIEYjlXuCdYsSXvyoy2BTsLESH7TlGV81S282U= +sigs.k8s.io/structured-merge-diff/v4 v4.4.1 h1:150L+0vs/8DA78h1u02ooW1/fFq/Lwr+sGiqlzvrtq4= +sigs.k8s.io/structured-merge-diff/v4 v4.4.1/go.mod h1:N8hJocpFajUSSeSJ9bOZ77VzejKZaXsTtZo4/u7Io08= sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= diff --git a/integration-tests/load/README.md b/integration-tests/load/README.md index afcf633e5c3..359de3c6d43 100644 --- a/integration-tests/load/README.md +++ b/integration-tests/load/README.md @@ -70,8 +70,10 @@ Gun should be working with one instance of your product. VU(Virtual user) creates a new instance of your product and works with it in `Call()` ### Cluster mode (k8s) + Add configuration to `overrides.toml` -``` + +```toml [WaspAutoBuild] namespace = "wasp" update_image = true diff --git a/integration-tests/load/automationv2_1/automationv2_1_test.go b/integration-tests/load/automationv2_1/automationv2_1_test.go index b0555cdd3f8..3cd931ecef0 100644 --- a/integration-tests/load/automationv2_1/automationv2_1_test.go +++ b/integration-tests/load/automationv2_1/automationv2_1_test.go @@ -22,21 +22,18 @@ import ( "github.com/slack-go/slack" "github.com/stretchr/testify/require" - ocr3 "github.com/smartcontractkit/libocr/offchainreporting2plus/ocr3confighelper" - "github.com/smartcontractkit/wasp" - - ocr2keepers30config "github.com/smartcontractkit/chainlink-automation/pkg/v3/config" + "github.com/smartcontractkit/chainlink-testing-framework/wasp" "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" - "github.com/smartcontractkit/chainlink-testing-framework/k8s/environment" - "github.com/smartcontractkit/chainlink-testing-framework/k8s/pkg/helm/chainlink" - "github.com/smartcontractkit/chainlink-testing-framework/k8s/pkg/helm/ethereum" - "github.com/smartcontractkit/chainlink-testing-framework/k8s/pkg/helm/wiremock" - "github.com/smartcontractkit/chainlink-testing-framework/logging" - "github.com/smartcontractkit/chainlink-testing-framework/networks" - seth_utils "github.com/smartcontractkit/chainlink-testing-framework/utils/seth" + "github.com/smartcontractkit/chainlink-testing-framework/lib/k8s/environment" + "github.com/smartcontractkit/chainlink-testing-framework/lib/k8s/pkg/helm/chainlink" + "github.com/smartcontractkit/chainlink-testing-framework/lib/k8s/pkg/helm/ethereum" + "github.com/smartcontractkit/chainlink-testing-framework/lib/k8s/pkg/helm/wiremock" + "github.com/smartcontractkit/chainlink-testing-framework/lib/logging" + "github.com/smartcontractkit/chainlink-testing-framework/lib/networks" + seth_utils "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/seth" - ctfconfig "github.com/smartcontractkit/chainlink-testing-framework/config" + ctfconfig "github.com/smartcontractkit/chainlink-testing-framework/lib/config" gowiremock "github.com/wiremock/go-wiremock" @@ -153,6 +150,7 @@ func setUpDataStreamsWireMock(url string) error { func TestLogTrigger(t *testing.T) { ctx := tests.Context(t) l := logging.GetTestLogger(t) + registryVersion := contractseth.RegistryVersion_2_1 loadedTestConfig, err := tc.GetConfig([]string{"Load"}, tc.Automation) if err != nil { @@ -313,65 +311,21 @@ Load Config: multicallAddress, err := contracts.DeployMultiCallContract(chainClient) require.NoError(t, err, "Error deploying multicall contract") - a := automationv2.NewAutomationTestK8s(l, chainClient, chainlinkNodes) - conf := loadedTestConfig.Automation.AutomationConfig - a.RegistrySettings = contracts.KeeperRegistrySettings{ - PaymentPremiumPPB: *conf.RegistrySettings.PaymentPremiumPPB, - FlatFeeMicroLINK: *conf.RegistrySettings.FlatFeeMicroLINK, - CheckGasLimit: *conf.RegistrySettings.CheckGasLimit, - StalenessSeconds: conf.RegistrySettings.StalenessSeconds, - GasCeilingMultiplier: *conf.RegistrySettings.GasCeilingMultiplier, - MaxPerformGas: *conf.RegistrySettings.MaxPerformGas, - MinUpkeepSpend: conf.RegistrySettings.MinUpkeepSpend, - FallbackGasPrice: conf.RegistrySettings.FallbackGasPrice, - FallbackLinkPrice: conf.RegistrySettings.FallbackLinkPrice, - MaxCheckDataSize: *conf.RegistrySettings.MaxCheckDataSize, - MaxPerformDataSize: *conf.RegistrySettings.MaxPerformDataSize, - MaxRevertDataSize: *conf.RegistrySettings.MaxRevertDataSize, - RegistryVersion: contractseth.RegistryVersion_2_1, - } + a := automationv2.NewAutomationTestK8s(l, chainClient, chainlinkNodes, &loadedTestConfig) + a.RegistrySettings = actions.ReadRegistryConfig(loadedTestConfig) + a.RegistrySettings.RegistryVersion = registryVersion + a.PluginConfig = actions.ReadPluginConfig(loadedTestConfig) + a.PublicConfig = actions.ReadPublicConfig(loadedTestConfig) a.RegistrarSettings = contracts.KeeperRegistrarSettings{ AutoApproveConfigType: uint8(2), - AutoApproveMaxAllowed: math.MaxUint16, + AutoApproveMaxAllowed: 1000, MinLinkJuels: big.NewInt(0), } - a.PluginConfig = ocr2keepers30config.OffchainConfig{ - TargetProbability: *conf.PluginConfig.TargetProbability, - TargetInRounds: *conf.PluginConfig.TargetInRounds, - PerformLockoutWindow: *conf.PluginConfig.PerformLockoutWindow, - GasLimitPerReport: *conf.PluginConfig.GasLimitPerReport, - GasOverheadPerUpkeep: *conf.PluginConfig.GasOverheadPerUpkeep, - MinConfirmations: *conf.PluginConfig.MinConfirmations, - MaxUpkeepBatchSize: *conf.PluginConfig.MaxUpkeepBatchSize, - LogProviderConfig: ocr2keepers30config.LogProviderConfig{ - BlockRate: *conf.PluginConfig.LogProviderConfig.BlockRate, - LogLimit: *conf.PluginConfig.LogProviderConfig.LogLimit, - }, - } - a.PublicConfig = ocr3.PublicConfig{ - DeltaProgress: *conf.PublicConfig.DeltaProgress, - DeltaResend: *conf.PublicConfig.DeltaResend, - DeltaInitial: *conf.PublicConfig.DeltaInitial, - DeltaRound: *conf.PublicConfig.DeltaRound, - DeltaGrace: *conf.PublicConfig.DeltaGrace, - DeltaCertifiedCommitRequest: *conf.PublicConfig.DeltaCertifiedCommitRequest, - DeltaStage: *conf.PublicConfig.DeltaStage, - RMax: *conf.PublicConfig.RMax, - MaxDurationQuery: *conf.PublicConfig.MaxDurationQuery, - MaxDurationObservation: *conf.PublicConfig.MaxDurationObservation, - MaxDurationShouldAcceptAttestedReport: *conf.PublicConfig.MaxDurationShouldAcceptAttestedReport, - MaxDurationShouldTransmitAcceptedReport: *conf.PublicConfig.MaxDurationShouldTransmitAcceptedReport, - F: *conf.PublicConfig.F, - } if *loadedTestConfig.Automation.DataStreams.Enabled { a.SetMercuryCredentialName("cred1") } - if *conf.UseLogBufferV1 { - a.SetUseLogBufferV1(true) - } - startTimeTestSetup := time.Now() l.Info().Str("START_TIME", startTimeTestSetup.String()).Msg("Test setup started") diff --git a/integration-tests/load/automationv2_1/gun.go b/integration-tests/load/automationv2_1/gun.go index 162aca251fb..aa61562741c 100644 --- a/integration-tests/load/automationv2_1/gun.go +++ b/integration-tests/load/automationv2_1/gun.go @@ -5,8 +5,10 @@ import ( "sync" "github.com/rs/zerolog" - "github.com/smartcontractkit/seth" - "github.com/smartcontractkit/wasp" + + "github.com/smartcontractkit/chainlink-testing-framework/wasp" + + "github.com/smartcontractkit/chainlink-testing-framework/seth" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/log_emitter" diff --git a/integration-tests/load/automationv2_1/helpers.go b/integration-tests/load/automationv2_1/helpers.go index 30559743e1d..41fa9a0ce1e 100644 --- a/integration-tests/load/automationv2_1/helpers.go +++ b/integration-tests/load/automationv2_1/helpers.go @@ -8,10 +8,11 @@ import ( "github.com/pkg/errors" "github.com/rs/zerolog" "github.com/slack-go/slack" - "github.com/smartcontractkit/seth" - ctf_concurrency "github.com/smartcontractkit/chainlink-testing-framework/concurrency" - reportModel "github.com/smartcontractkit/chainlink-testing-framework/testreporters" + "github.com/smartcontractkit/chainlink-testing-framework/seth" + + ctf_concurrency "github.com/smartcontractkit/chainlink-testing-framework/lib/concurrency" + reportModel "github.com/smartcontractkit/chainlink-testing-framework/lib/testreporters" "github.com/smartcontractkit/chainlink/integration-tests/actions" "github.com/smartcontractkit/chainlink/integration-tests/contracts" tc "github.com/smartcontractkit/chainlink/integration-tests/testconfig" diff --git a/integration-tests/load/functions/functions_test.go b/integration-tests/load/functions/functions_test.go index 374b3df705c..90c163ca372 100644 --- a/integration-tests/load/functions/functions_test.go +++ b/integration-tests/load/functions/functions_test.go @@ -4,9 +4,10 @@ import ( "testing" "time" - "github.com/smartcontractkit/wasp" "github.com/stretchr/testify/require" + "github.com/smartcontractkit/chainlink-testing-framework/wasp" + tc "github.com/smartcontractkit/chainlink/integration-tests/testconfig" ) diff --git a/integration-tests/load/functions/functionscmd/dashboard.go b/integration-tests/load/functions/functionscmd/dashboard.go index ccf56740236..b0a00602f8d 100644 --- a/integration-tests/load/functions/functionscmd/dashboard.go +++ b/integration-tests/load/functions/functionscmd/dashboard.go @@ -4,7 +4,8 @@ import ( "github.com/K-Phoen/grabana/dashboard" "github.com/K-Phoen/grabana/logs" "github.com/K-Phoen/grabana/row" - db "github.com/smartcontractkit/wasp/dashboard" + + db "github.com/smartcontractkit/chainlink-testing-framework/wasp/dashboard" ) func main() { diff --git a/integration-tests/load/functions/gateway_gun.go b/integration-tests/load/functions/gateway_gun.go index cc6132e94e7..38eddd3163e 100644 --- a/integration-tests/load/functions/gateway_gun.go +++ b/integration-tests/load/functions/gateway_gun.go @@ -10,7 +10,8 @@ import ( "github.com/go-resty/resty/v2" "github.com/rs/zerolog/log" "github.com/smartcontractkit/tdh2/go/tdh2/tdh2easy" - "github.com/smartcontractkit/wasp" + + "github.com/smartcontractkit/chainlink-testing-framework/wasp" "github.com/smartcontractkit/chainlink/integration-tests/types" ) diff --git a/integration-tests/load/functions/gateway_test.go b/integration-tests/load/functions/gateway_test.go index dd1092a595c..9812b7ea081 100644 --- a/integration-tests/load/functions/gateway_test.go +++ b/integration-tests/load/functions/gateway_test.go @@ -3,9 +3,10 @@ package loadfunctions import ( "testing" - "github.com/smartcontractkit/wasp" "github.com/stretchr/testify/require" + "github.com/smartcontractkit/chainlink-testing-framework/wasp" + tc "github.com/smartcontractkit/chainlink/integration-tests/testconfig" "github.com/smartcontractkit/chainlink/v2/core/services/gateway/handlers/functions" ) diff --git a/integration-tests/load/functions/onchain_monitoring.go b/integration-tests/load/functions/onchain_monitoring.go index 31ca8752dd3..39c4bdcf94f 100644 --- a/integration-tests/load/functions/onchain_monitoring.go +++ b/integration-tests/load/functions/onchain_monitoring.go @@ -5,9 +5,10 @@ import ( "time" "github.com/rs/zerolog/log" - "github.com/smartcontractkit/wasp" - ctf_config "github.com/smartcontractkit/chainlink-testing-framework/config" + "github.com/smartcontractkit/chainlink-testing-framework/wasp" + + ctf_config "github.com/smartcontractkit/chainlink-testing-framework/lib/config" ) /* Monitors on-chain stats of LoadConsumer and pushes them to Loki every second */ diff --git a/integration-tests/load/functions/request_gun.go b/integration-tests/load/functions/request_gun.go index 6b79a2f19ee..ca9ba82c513 100644 --- a/integration-tests/load/functions/request_gun.go +++ b/integration-tests/load/functions/request_gun.go @@ -1,7 +1,7 @@ package loadfunctions import ( - "github.com/smartcontractkit/wasp" + "github.com/smartcontractkit/chainlink-testing-framework/wasp" ) type TestMode int diff --git a/integration-tests/load/functions/setup.go b/integration-tests/load/functions/setup.go index 5519c90846b..46c2c12921a 100644 --- a/integration-tests/load/functions/setup.go +++ b/integration-tests/load/functions/setup.go @@ -8,18 +8,19 @@ import ( "strconv" "time" - seth_utils "github.com/smartcontractkit/chainlink-testing-framework/utils/seth" + seth_utils "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/seth" "github.com/ethereum/go-ethereum/crypto" "github.com/go-resty/resty/v2" "github.com/rs/zerolog/log" - "github.com/smartcontractkit/seth" "github.com/smartcontractkit/tdh2/go/tdh2/tdh2easy" + "github.com/smartcontractkit/chainlink-testing-framework/seth" + chainlinkutils "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils" - ctf_config "github.com/smartcontractkit/chainlink-testing-framework/config" - "github.com/smartcontractkit/chainlink-testing-framework/networks" + ctf_config "github.com/smartcontractkit/chainlink-testing-framework/lib/config" + "github.com/smartcontractkit/chainlink-testing-framework/lib/networks" "github.com/smartcontractkit/chainlink/integration-tests/contracts" "github.com/smartcontractkit/chainlink/integration-tests/types" diff --git a/integration-tests/load/go.mod b/integration-tests/load/go.mod index 2d1c6d5d12d..4efb4622274 100644 --- a/integration-tests/load/go.mod +++ b/integration-tests/load/go.mod @@ -1,6 +1,6 @@ module github.com/smartcontractkit/chainlink/load-tests -go 1.21.7 +go 1.22.5 // Make sure we're working with the latest chainlink libs replace github.com/smartcontractkit/chainlink/v2 => ../../ @@ -13,33 +13,35 @@ require ( github.com/go-resty/resty/v2 v2.11.0 github.com/pelletier/go-toml/v2 v2.2.2 github.com/pkg/errors v0.9.1 - github.com/rs/zerolog v1.31.0 + github.com/rs/zerolog v1.33.0 github.com/slack-go/slack v0.12.2 - github.com/smartcontractkit/chainlink-automation v1.0.4 - github.com/smartcontractkit/chainlink-common v0.1.7-0.20240709155552-d76403db14e5 - github.com/smartcontractkit/chainlink-testing-framework v1.32.0 + github.com/smartcontractkit/chainlink-common v0.2.3-0.20240927162447-20630b333f57 + github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.9 + github.com/smartcontractkit/chainlink-testing-framework/seth v1.50.1 + github.com/smartcontractkit/chainlink-testing-framework/wasp v1.50.0 github.com/smartcontractkit/chainlink/integration-tests v0.0.0-20240214231432-4ad5eb95178c github.com/smartcontractkit/chainlink/v2 v2.9.0-beta0.0.20240216210048-da02459ddad8 - github.com/smartcontractkit/libocr v0.0.0-20240702141926-063ceef8c42e - github.com/smartcontractkit/seth v1.0.12 github.com/smartcontractkit/tdh2/go/tdh2 v0.0.0-20230906073235-9e478e5e19f1 - github.com/smartcontractkit/wasp v0.4.7 github.com/stretchr/testify v1.9.0 github.com/wiremock/go-wiremock v1.9.0 go.uber.org/ratelimit v0.3.0 ) -// avoids ambigious imports of indirect dependencies -exclude github.com/hashicorp/consul v1.2.1 +require ( + github.com/AlekSi/pointer v1.1.0 // indirect + github.com/smartcontractkit/chainlink-automation v1.0.4 // indirect + github.com/smartcontractkit/chainlink-ccip v0.0.0-20240930060710-158d2a9ac9ca // indirect + github.com/smartcontractkit/libocr v0.0.0-20240717100443-f6226e09bee7 // indirect +) require ( contrib.go.opencensus.io/exporter/stackdriver v0.13.5 // indirect cosmossdk.io/api v0.3.1 // indirect cosmossdk.io/core v0.5.1 // indirect - cosmossdk.io/depinject v1.0.0-alpha.3 // indirect - cosmossdk.io/errors v1.0.0 // indirect - cosmossdk.io/math v1.0.1 // indirect - dario.cat/mergo v1.0.0 // indirect + cosmossdk.io/depinject v1.0.0-alpha.4 // indirect + cosmossdk.io/errors v1.0.1 // indirect + cosmossdk.io/math v1.3.0 // indirect + dario.cat/mergo v1.0.1 // indirect filippo.io/edwards25519 v1.1.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.1 // indirect @@ -49,35 +51,52 @@ require ( github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect github.com/Azure/go-ntlmssp v0.0.0-20221128193559-754e69321358 // indirect github.com/AzureAD/microsoft-authentication-library-for-go v1.1.1 // indirect - github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d // indirect + github.com/ChainSafe/go-schnorrkel v1.0.0 // indirect github.com/CosmWasm/wasmd v0.40.1 // indirect github.com/CosmWasm/wasmvm v1.2.4 // indirect github.com/DataDog/zstd v1.5.2 // indirect github.com/K-Phoen/sdk v0.12.4 // indirect + github.com/Khan/genqlient v0.7.0 // indirect github.com/MakeNowJust/heredoc v1.0.0 // indirect github.com/Masterminds/goutils v1.1.1 // indirect github.com/Masterminds/semver/v3 v3.2.1 // indirect github.com/Masterminds/sprig/v3 v3.2.3 // indirect - github.com/Microsoft/go-winio v0.6.1 // indirect - github.com/Microsoft/hcsshim v0.11.4 // indirect + github.com/Microsoft/go-winio v0.6.2 // indirect + github.com/Microsoft/hcsshim v0.11.5 // indirect github.com/NethermindEth/juno v0.3.1 // indirect github.com/NethermindEth/starknet.go v0.7.1-0.20240401080518-34a506f3cfdb // indirect github.com/VictoriaMetrics/fastcache v1.12.1 // indirect github.com/XSAM/otelsql v0.27.0 // indirect - github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 // indirect + github.com/alecthomas/units v0.0.0-20240626203959-61d1e3462e30 // indirect github.com/armon/go-metrics v0.4.1 // indirect github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect github.com/avast/retry-go v3.0.0+incompatible // indirect - github.com/avast/retry-go/v4 v4.5.1 // indirect + github.com/avast/retry-go/v4 v4.6.0 // indirect + github.com/awalterschulze/gographviz v2.0.3+incompatible // indirect github.com/aws/aws-sdk-go v1.45.25 // indirect + github.com/aws/aws-sdk-go-v2 v1.30.4 // indirect + github.com/aws/aws-sdk-go-v2/config v1.27.28 // indirect + github.com/aws/aws-sdk-go-v2/credentials v1.17.28 // indirect + github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.12 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.16 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.16 // indirect + github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.4 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.18 // indirect + github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.32.5 // indirect + github.com/aws/aws-sdk-go-v2/service/sso v1.22.5 // indirect + github.com/aws/aws-sdk-go-v2/service/ssooidc v1.26.5 // indirect + github.com/aws/aws-sdk-go-v2/service/sts v1.30.4 // indirect github.com/aws/constructs-go/constructs/v10 v10.1.255 // indirect github.com/aws/jsii-runtime-go v1.75.0 // indirect + github.com/aws/smithy-go v1.20.4 // indirect github.com/bahlo/generic-list-go v0.2.0 // indirect github.com/barkimedes/go-deepcopy v0.0.0-20220514131651-17c30cfc62df // indirect github.com/benbjohnson/clock v1.3.5 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 // indirect github.com/bits-and-blooms/bitset v1.10.0 // indirect + github.com/blang/semver/v4 v4.0.0 // indirect github.com/blendle/zapdriver v1.3.1 // indirect github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect github.com/buger/jsonparser v1.1.1 // indirect @@ -88,41 +107,42 @@ require ( github.com/cenkalti/backoff v2.2.1+incompatible // indirect github.com/cenkalti/backoff/v4 v4.3.0 // indirect github.com/cespare/xxhash v1.1.0 // indirect - github.com/cespare/xxhash/v2 v2.2.0 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/chai2010/gettext-go v1.0.2 // indirect - github.com/chaos-mesh/chaos-mesh/api/v1alpha1 v0.0.0-20220226050744-799408773657 // indirect + github.com/chaos-mesh/chaos-mesh/api v0.0.0-20240821051457-da69c6d9617a // indirect github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d // indirect github.com/chenzhuoyu/iasm v0.9.0 // indirect - github.com/cockroachdb/errors v1.9.1 // indirect + github.com/cockroachdb/errors v1.10.0 // indirect github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect github.com/cockroachdb/pebble v0.0.0-20230928194634-aa077af62593 // indirect - github.com/cockroachdb/redact v1.1.3 // indirect + github.com/cockroachdb/redact v1.1.5 // indirect github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect - github.com/cometbft/cometbft v0.37.2 // indirect - github.com/cometbft/cometbft-db v0.7.0 // indirect + github.com/cometbft/cometbft v0.37.5 // indirect + github.com/cometbft/cometbft-db v0.8.0 // indirect github.com/confio/ics23/go v0.9.0 // indirect github.com/consensys/bavard v0.1.13 // indirect github.com/consensys/gnark-crypto v0.12.1 // indirect - github.com/containerd/containerd v1.7.12 // indirect + github.com/containerd/containerd v1.7.18 // indirect github.com/containerd/continuity v0.4.3 // indirect + github.com/containerd/errdefs v0.1.0 // indirect github.com/containerd/log v0.1.0 // indirect - github.com/coreos/go-semver v0.3.0 // indirect + github.com/coreos/go-semver v0.3.1 // indirect github.com/coreos/go-systemd/v22 v22.5.0 // indirect github.com/cosmos/btcutil v1.0.5 // indirect - github.com/cosmos/cosmos-proto v1.0.0-beta.2 // indirect - github.com/cosmos/cosmos-sdk v0.47.4 // indirect + github.com/cosmos/cosmos-proto v1.0.0-beta.5 // indirect + github.com/cosmos/cosmos-sdk v0.47.11 // indirect github.com/cosmos/go-bip39 v1.0.0 // indirect github.com/cosmos/gogoproto v1.4.11 // indirect - github.com/cosmos/iavl v0.20.0 // indirect - github.com/cosmos/ibc-go/v7 v7.0.1 // indirect - github.com/cosmos/ics23/go v0.9.1-0.20221207100636-b1abd8678aab // indirect - github.com/cosmos/ledger-cosmos-go v0.12.1 // indirect + github.com/cosmos/iavl v0.20.1 // indirect + github.com/cosmos/ibc-go/v7 v7.5.1 // indirect + github.com/cosmos/ics23/go v0.10.0 // indirect + github.com/cosmos/ledger-cosmos-go v0.12.4 // indirect github.com/cpuguy83/dockercfg v0.3.1 // indirect github.com/crate-crypto/go-ipa v0.0.0-20231025140028-3c0104f4b233 // indirect github.com/crate-crypto/go-kzg-4844 v0.7.0 // indirect github.com/danieljoos/wincred v1.1.2 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect - github.com/deckarep/golang-set/v2 v2.3.0 // indirect + github.com/deckarep/golang-set/v2 v2.6.0 // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect github.com/dennwc/varint v1.0.0 // indirect github.com/dfuse-io/logging v0.0.0-20210109005628-b97a57253f70 // indirect @@ -130,7 +150,7 @@ require ( github.com/dgraph-io/ristretto v0.1.1 // indirect github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect - github.com/distribution/reference v0.5.0 // indirect + github.com/distribution/reference v0.6.0 // indirect github.com/docker/distribution v2.8.2+incompatible // indirect github.com/docker/docker v25.0.2+incompatible // indirect github.com/docker/go-connections v0.5.0 // indirect @@ -139,26 +159,26 @@ require ( github.com/dustin/go-humanize v1.0.1 // indirect github.com/dvsekhvalnov/jose2go v1.7.0 // indirect github.com/edsrzf/mmap-go v1.1.0 // indirect - github.com/emicklei/go-restful/v3 v3.10.2 // indirect + github.com/emicklei/go-restful/v3 v3.12.1 // indirect github.com/esote/minmaxheap v1.0.0 // indirect github.com/ethereum/c-kzg-4844 v0.4.0 // indirect github.com/evanphx/json-patch v5.6.0+incompatible // indirect - github.com/evanphx/json-patch/v5 v5.6.0 // indirect + github.com/evanphx/json-patch/v5 v5.9.0 // indirect github.com/exponent-io/jsonpath v0.0.0-20210407135951-1de76d718b3f // indirect github.com/facette/natsort v0.0.0-20181210072756-2cd4dd1e2dcb // indirect github.com/fatih/camelcase v1.0.0 // indirect - github.com/fatih/color v1.16.0 // indirect + github.com/fatih/color v1.17.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect - github.com/fsnotify/fsnotify v1.6.0 // indirect - github.com/fvbommel/sortorder v1.0.2 // indirect - github.com/fxamacker/cbor/v2 v2.5.0 // indirect - github.com/gabriel-vasile/mimetype v1.4.2 // indirect + github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/fvbommel/sortorder v1.1.0 // indirect + github.com/fxamacker/cbor/v2 v2.7.0 // indirect + github.com/gabriel-vasile/mimetype v1.4.3 // indirect github.com/gagliardetto/binary v0.7.7 // indirect github.com/gagliardetto/solana-go v1.8.4 // indirect github.com/gagliardetto/treeout v0.1.4 // indirect github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08 // indirect github.com/gballet/go-verkle v0.1.1-0.20231031103413-a67434b50f46 // indirect - github.com/getsentry/sentry-go v0.19.0 // indirect + github.com/getsentry/sentry-go v0.23.0 // indirect github.com/gin-contrib/sessions v0.0.5 // indirect github.com/gin-contrib/sse v0.1.0 // indirect github.com/gin-gonic/gin v1.9.1 // indirect @@ -169,22 +189,23 @@ require ( github.com/go-kit/log v0.2.1 // indirect github.com/go-ldap/ldap/v3 v3.4.6 // indirect github.com/go-logfmt/logfmt v0.6.0 // indirect - github.com/go-logr/logr v1.4.1 // indirect + github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect - github.com/go-ole/go-ole v1.2.6 // indirect + github.com/go-ole/go-ole v1.3.0 // indirect github.com/go-openapi/analysis v0.21.4 // indirect github.com/go-openapi/errors v0.20.4 // indirect - github.com/go-openapi/jsonpointer v0.20.0 // indirect - github.com/go-openapi/jsonreference v0.20.2 // indirect + github.com/go-openapi/jsonpointer v0.21.0 // indirect + github.com/go-openapi/jsonreference v0.21.0 // indirect github.com/go-openapi/loads v0.21.2 // indirect github.com/go-openapi/spec v0.20.9 // indirect github.com/go-openapi/strfmt v0.21.7 // indirect - github.com/go-openapi/swag v0.22.4 // indirect + github.com/go-openapi/swag v0.23.0 // indirect github.com/go-openapi/validate v0.22.1 // indirect github.com/go-playground/locales v0.14.1 // indirect github.com/go-playground/universal-translator v0.18.1 // indirect - github.com/go-playground/validator/v10 v10.15.5 // indirect + github.com/go-playground/validator/v10 v10.22.0 // indirect github.com/go-redis/redis/v8 v8.11.5 // indirect + github.com/go-viper/mapstructure/v2 v2.1.0 // indirect github.com/go-webauthn/webauthn v0.9.4 // indirect github.com/go-webauthn/x v0.1.5 // indirect github.com/goccy/go-json v0.10.2 // indirect @@ -194,18 +215,18 @@ require ( github.com/gogo/protobuf v1.3.3 // indirect github.com/gogo/status v1.1.1 // indirect github.com/golang-jwt/jwt/v5 v5.2.0 // indirect - github.com/golang/glog v1.2.0 // indirect + github.com/golang/glog v1.2.1 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/protobuf v1.5.4 // indirect github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb // indirect github.com/google/btree v1.1.2 // indirect - github.com/google/gnostic v0.6.9 // indirect + github.com/google/gnostic-models v0.6.9-0.20230804172637-c7be7c783f49 // indirect github.com/google/go-cmp v0.6.0 // indirect github.com/google/go-github/v41 v41.0.0 // indirect github.com/google/go-querystring v1.1.0 // indirect github.com/google/go-tpm v0.9.0 // indirect github.com/google/gofuzz v1.2.0 // indirect - github.com/google/pprof v0.0.0-20231023181126-ff6d637d2a7b // indirect + github.com/google/pprof v0.0.0-20240525223248-4bfdf5a9a2af // indirect github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect github.com/google/uuid v1.6.0 // indirect github.com/gorilla/context v1.1.1 // indirect @@ -220,19 +241,19 @@ require ( github.com/grafana/grafana-foundation-sdk/go v0.0.0-20240326122733-6f96a993222b // indirect github.com/grafana/loki v1.6.2-0.20231215164305-b51b7d7b5503 // indirect github.com/grafana/loki/pkg/push v0.0.0-20231201111602-11ef833ed3e4 // indirect - github.com/grafana/pyroscope-go v1.1.1 // indirect - github.com/grafana/pyroscope-go/godeltaprof v0.1.6 // indirect + github.com/grafana/pyroscope-go v1.1.2 // indirect + github.com/grafana/pyroscope-go/godeltaprof v0.1.8 // indirect github.com/grafana/regexp v0.0.0-20221122212121-6b5c0a4cb7fd // indirect github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79 // indirect github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus v1.0.1 // indirect github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.1.0 // indirect github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect - github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0 // indirect github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect github.com/gtank/merlin v0.1.1 // indirect github.com/gtank/ristretto255 v0.1.2 // indirect - github.com/hashicorp/consul/api v1.25.1 // indirect + github.com/hashicorp/consul/api v1.28.2 // indirect github.com/hashicorp/consul/sdk v0.16.0 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect @@ -241,7 +262,7 @@ require ( github.com/hashicorp/go-immutable-radix v1.3.1 // indirect github.com/hashicorp/go-msgpack v0.5.5 // indirect github.com/hashicorp/go-multierror v1.1.1 // indirect - github.com/hashicorp/go-plugin v1.6.0 // indirect + github.com/hashicorp/go-plugin v1.6.2-0.20240829161738-06afb6d7ae99 // indirect github.com/hashicorp/go-retryablehttp v0.7.5 // indirect github.com/hashicorp/go-rootcerts v1.0.2 // indirect github.com/hashicorp/go-sockaddr v1.0.2 // indirect @@ -278,16 +299,17 @@ require ( github.com/json-iterator/go v1.1.12 // indirect github.com/julienschmidt/httprouter v1.3.0 // indirect github.com/kelseyhightower/envconfig v1.4.0 // indirect - github.com/klauspost/compress v1.17.3 // indirect + github.com/klauspost/compress v1.17.9 // indirect github.com/klauspost/cpuid/v2 v2.2.5 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect github.com/kylelemons/godebug v1.1.0 // indirect github.com/leanovate/gopter v0.2.10-0.20210127095200-9abe2343507a // indirect - github.com/leodido/go-urn v1.2.4 // indirect + github.com/leodido/go-urn v1.4.0 // indirect github.com/lib/pq v1.10.9 // indirect github.com/libp2p/go-buffer-pool v0.1.0 // indirect github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de // indirect + github.com/linxGnu/grocksdb v1.7.16 // indirect github.com/logrusorgru/aurora v2.0.3+incompatible // indirect github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect github.com/magiconair/properties v1.8.7 // indirect @@ -295,7 +317,7 @@ require ( github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect github.com/mattn/go-runewidth v0.0.14 // indirect - github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 // indirect + github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect github.com/miekg/dns v1.1.56 // indirect github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 // indirect github.com/mitchellh/copystructure v1.2.0 // indirect @@ -306,7 +328,7 @@ require ( github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/mmcloughlin/addchain v0.4.0 // indirect github.com/moby/patternmatcher v0.6.0 // indirect - github.com/moby/spdystream v0.2.0 // indirect + github.com/moby/spdystream v0.4.0 // indirect github.com/moby/sys/sequential v0.5.0 // indirect github.com/moby/sys/user v0.1.0 // indirect github.com/moby/term v0.5.0 // indirect @@ -320,13 +342,11 @@ require ( github.com/mtibben/percent v0.2.1 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f // indirect - github.com/mwitkow/grpc-proxy v0.0.0-20230212185441-f345521cb9c9 // indirect github.com/oklog/run v1.1.0 // indirect github.com/oklog/ulid v1.3.1 // indirect github.com/olekukonko/tablewriter v0.0.5 // indirect - github.com/onsi/ginkgo/v2 v2.13.0 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect - github.com/opencontainers/image-spec v1.1.0-rc5 // indirect + github.com/opencontainers/image-spec v1.1.0 // indirect github.com/opencontainers/runc v1.1.10 // indirect github.com/opentracing-contrib/go-grpc v0.0.0-20210225150812-73cb765af46e // indirect github.com/opentracing-contrib/go-stdlib v1.0.0 // indirect @@ -341,18 +361,20 @@ require ( github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect github.com/prometheus/alertmanager v0.26.0 // indirect - github.com/prometheus/client_golang v1.17.0 // indirect - github.com/prometheus/client_model v0.5.0 // indirect - github.com/prometheus/common v0.45.0 // indirect + github.com/prometheus/client_golang v1.20.0 // indirect + github.com/prometheus/client_model v0.6.1 // indirect + github.com/prometheus/common v0.59.1 // indirect github.com/prometheus/common/sigv4 v0.1.0 // indirect github.com/prometheus/exporter-toolkit v0.10.1-0.20230714054209-2f4150c63f97 // indirect - github.com/prometheus/procfs v0.12.0 // indirect - github.com/prometheus/prometheus v0.48.1 // indirect + github.com/prometheus/procfs v0.15.1 // indirect + github.com/prometheus/prometheus v1.8.2-0.20200727090838-6f296594a852 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect github.com/rivo/uniseg v0.4.4 // indirect github.com/robfig/cron/v3 v3.0.1 // indirect github.com/rogpeppe/go-internal v1.12.0 // indirect - github.com/russross/blackfriday v1.6.0 // indirect + github.com/russross/blackfriday/v2 v2.1.0 // indirect + github.com/sagikazarmark/locafero v0.4.0 // indirect + github.com/sagikazarmark/slog-shim v0.1.0 // indirect github.com/santhosh-tekuri/jsonschema/v5 v5.3.1 // indirect github.com/sasha-s/go-deadlock v0.3.1 // indirect github.com/scylladb/go-reflectx v1.0.1 // indirect @@ -362,32 +384,33 @@ require ( github.com/shirou/gopsutil v3.21.11+incompatible // indirect github.com/shirou/gopsutil/v3 v3.24.3 // indirect github.com/shoenig/go-m1cpu v0.1.6 // indirect - github.com/shopspring/decimal v1.3.1 // indirect + github.com/shopspring/decimal v1.4.0 // indirect github.com/sirupsen/logrus v1.9.3 // indirect - github.com/smartcontractkit/chain-selectors v1.0.10 // indirect - github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20240710121324-3ed288aa9b45 // indirect - github.com/smartcontractkit/chainlink-data-streams v0.0.0-20240702145022-37a2c3a742d1 // indirect - github.com/smartcontractkit/chainlink-feeds v0.0.0-20240522213638-159fb2d99917 // indirect - github.com/smartcontractkit/chainlink-solana v1.0.3-0.20240708150922-0546185ead68 // indirect - github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240709043547-03612098f799 // indirect - github.com/smartcontractkit/chainlink-testing-framework/grafana v0.0.0-20240405215812-5a72bc9af239 // indirect + github.com/smartcontractkit/chain-selectors v1.0.23 // indirect + github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20240911175228-daf2600bb7b7 // indirect + github.com/smartcontractkit/chainlink-data-streams v0.0.0-20240916152957-433914114bd2 // indirect + github.com/smartcontractkit/chainlink-feeds v0.0.0-20240910155501-42f20443189f // indirect + github.com/smartcontractkit/chainlink-solana v1.1.1-0.20240927143737-7e527aa85bff // indirect + github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240911194142-506bc469d8ae // indirect + github.com/smartcontractkit/chainlink-testing-framework/havoc v1.50.0 // indirect + github.com/smartcontractkit/chainlink-testing-framework/lib/grafana v1.50.0 // indirect + github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7 // indirect github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin v0.0.0-20230906073235-9e478e5e19f1 // indirect - github.com/smartcontractkit/wsrpc v0.7.3 // indirect + github.com/smartcontractkit/wsrpc v0.8.2 // indirect github.com/soheilhy/cmux v0.1.5 // indirect github.com/sony/gobreaker v0.5.0 // indirect - github.com/spf13/afero v1.9.5 // indirect + github.com/sourcegraph/conc v0.3.0 // indirect + github.com/spf13/afero v1.11.0 // indirect github.com/spf13/cast v1.6.0 // indirect - github.com/spf13/cobra v1.8.0 // indirect - github.com/spf13/jwalterweatherman v1.1.0 // indirect + github.com/spf13/cobra v1.8.1 // indirect github.com/spf13/pflag v1.0.5 // indirect - github.com/spf13/viper v1.15.0 // indirect + github.com/spf13/viper v1.19.0 // indirect github.com/status-im/keycard-go v0.2.0 // indirect github.com/streamingfast/logging v0.0.0-20220405224725-2755dab2ce75 // indirect github.com/stretchr/objx v0.5.2 // indirect - github.com/subosito/gotenv v1.4.2 // indirect + github.com/subosito/gotenv v1.6.0 // indirect github.com/supranational/blst v0.3.11 // indirect github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect - github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c // indirect github.com/tendermint/go-amino v0.16.0 // indirect github.com/teris-io/shortid v0.0.0-20201117134242-e59966efd125 // indirect github.com/test-go/testify v1.1.4 // indirect @@ -407,100 +430,148 @@ require ( github.com/umbracle/ethgo v0.1.3 // indirect github.com/umbracle/fastrlp v0.0.0-20220527094140-59d5dd30e722 // indirect github.com/valyala/fastjson v1.4.1 // indirect + github.com/vektah/gqlparser/v2 v2.5.11 // indirect github.com/wk8/go-ordered-map/v2 v2.1.8 // indirect github.com/x448/float16 v0.8.4 // indirect - github.com/xlab/treeprint v1.1.0 // indirect + github.com/xlab/treeprint v1.2.0 // indirect github.com/yusufpapurcu/wmi v1.2.4 // indirect - github.com/zondax/hid v0.9.1 // indirect - github.com/zondax/ledger-go v0.14.1 // indirect + github.com/zondax/hid v0.9.2 // indirect + github.com/zondax/ledger-go v0.14.3 // indirect go.dedis.ch/fixbuf v1.0.3 // indirect go.dedis.ch/kyber/v3 v3.1.0 // indirect - go.etcd.io/bbolt v1.3.7 // indirect - go.etcd.io/etcd/api/v3 v3.5.7 // indirect - go.etcd.io/etcd/client/pkg/v3 v3.5.7 // indirect - go.etcd.io/etcd/client/v3 v3.5.7 // indirect + go.etcd.io/bbolt v1.3.9 // indirect + go.etcd.io/etcd/api/v3 v3.5.14 // indirect + go.etcd.io/etcd/client/pkg/v3 v3.5.14 // indirect + go.etcd.io/etcd/client/v3 v3.5.14 // indirect go.mongodb.org/mongo-driver v1.15.0 // indirect go.opencensus.io v0.24.0 // indirect go.opentelemetry.io/collector/pdata v1.0.0-rcv0016 // indirect go.opentelemetry.io/collector/semconv v0.87.0 // indirect - go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.52.0 // indirect - go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 // indirect - go.opentelemetry.io/otel v1.27.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.27.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.27.0 // indirect - go.opentelemetry.io/otel/metric v1.27.0 // indirect - go.opentelemetry.io/otel/sdk v1.27.0 // indirect - go.opentelemetry.io/otel/trace v1.27.0 // indirect - go.opentelemetry.io/proto/otlp v1.2.0 // indirect - go.starlark.net v0.0.0-20220817180228-f738f5508c12 // indirect + go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.53.0 // indirect + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.53.0 // indirect + go.opentelemetry.io/otel v1.28.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.0.0-20240823153156-2a54df7bffb9 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.28.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.28.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.28.0 // indirect + go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.4.0 // indirect + go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.28.0 // indirect + go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.28.0 // indirect + go.opentelemetry.io/otel/log v0.4.0 // indirect + go.opentelemetry.io/otel/metric v1.28.0 // indirect + go.opentelemetry.io/otel/sdk v1.28.0 // indirect + go.opentelemetry.io/otel/sdk/log v0.4.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.28.0 // indirect + go.opentelemetry.io/otel/trace v1.28.0 // indirect + go.opentelemetry.io/proto/otlp v1.3.1 // indirect + go.starlark.net v0.0.0-20230525235612-a134d8f9ddca // indirect go.uber.org/atomic v1.11.0 // indirect go.uber.org/goleak v1.3.0 // indirect go.uber.org/multierr v1.11.0 // indirect - go.uber.org/zap v1.26.0 // indirect + go.uber.org/zap v1.27.0 // indirect go4.org/netipx v0.0.0-20230125063823-8449b0a6169f // indirect - golang.org/x/arch v0.7.0 // indirect - golang.org/x/crypto v0.24.0 // indirect - golang.org/x/exp v0.0.0-20240325151524-a685a6edb6d8 // indirect - golang.org/x/mod v0.17.0 // indirect - golang.org/x/net v0.25.0 // indirect - golang.org/x/oauth2 v0.20.0 // indirect - golang.org/x/sync v0.7.0 // indirect - golang.org/x/sys v0.21.0 // indirect - golang.org/x/term v0.21.0 // indirect - golang.org/x/text v0.16.0 // indirect - golang.org/x/time v0.5.0 // indirect - golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect - gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect - gonum.org/v1/gonum v0.14.0 // indirect - google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20240520151616-dc85e6b867a5 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240520151616-dc85e6b867a5 // indirect - google.golang.org/grpc v1.64.0 // indirect - google.golang.org/protobuf v1.34.1 // indirect + golang.org/x/arch v0.8.0 // indirect + golang.org/x/crypto v0.27.0 // indirect + golang.org/x/exp v0.0.0-20240909161429-701f63a606c0 // indirect + golang.org/x/mod v0.21.0 // indirect + golang.org/x/net v0.29.0 // indirect + golang.org/x/oauth2 v0.22.0 // indirect + golang.org/x/sync v0.8.0 // indirect + golang.org/x/sys v0.25.0 // indirect + golang.org/x/term v0.24.0 // indirect + golang.org/x/text v0.18.0 // indirect + golang.org/x/time v0.6.0 // indirect + golang.org/x/tools v0.25.0 // indirect + gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect + gonum.org/v1/gonum v0.15.0 // indirect + google.golang.org/genproto v0.0.0-20240711142825-46eb208f015d // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20240822170219-fc7c04adadcd // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd // indirect + google.golang.org/grpc v1.65.0 // indirect + google.golang.org/protobuf v1.34.2 // indirect + gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect gopkg.in/guregu/null.v4 v4.0.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - k8s.io/api v0.28.2 // indirect - k8s.io/apiextensions-apiserver v0.25.3 // indirect - k8s.io/apimachinery v0.28.2 // indirect - k8s.io/cli-runtime v0.25.11 // indirect - k8s.io/client-go v0.28.2 // indirect - k8s.io/component-base v0.26.2 // indirect - k8s.io/klog/v2 v2.100.1 // indirect - k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 // indirect - k8s.io/kubectl v0.25.11 // indirect - k8s.io/utils v0.0.0-20230711102312-30195339c3c7 // indirect - nhooyr.io/websocket v1.8.7 // indirect - pgregory.net/rapid v0.5.5 // indirect + k8s.io/api v0.31.0 // indirect + k8s.io/apiextensions-apiserver v0.31.0 // indirect + k8s.io/apimachinery v0.31.0 // indirect + k8s.io/cli-runtime v0.31.0 // indirect + k8s.io/client-go v1.5.2 // indirect + k8s.io/component-base v0.31.0 // indirect + k8s.io/klog/v2 v2.130.1 // indirect + k8s.io/kube-openapi v0.0.0-20240709000822-3c01b740850f // indirect + k8s.io/kubectl v0.31.0 // indirect + k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 // indirect + nhooyr.io/websocket v1.8.10 // indirect + pgregory.net/rapid v1.1.0 // indirect rsc.io/tmplfunc v0.0.3 // indirect - sigs.k8s.io/controller-runtime v0.13.0 // indirect + sigs.k8s.io/controller-runtime v0.19.0 // indirect sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect - sigs.k8s.io/kustomize/api v0.12.1 // indirect - sigs.k8s.io/kustomize/kyaml v0.13.9 // indirect - sigs.k8s.io/structured-merge-diff/v4 v4.3.0 // indirect - sigs.k8s.io/yaml v1.4.0 // indirect + sigs.k8s.io/kustomize/api v0.17.2 // indirect + sigs.k8s.io/kustomize/kyaml v0.17.1 // indirect + sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect + sigs.k8s.io/yaml v1.4.0 // indirect; indirect nhooyr.io/websocket v1.8.7 // indirect ) +// avoids ambigious imports of indirect dependencies +exclude github.com/hashicorp/consul v1.2.1 + replace ( + // until merged upstream: https://github.com/omissis/go-jsonschema/pull/264 + github.com/atombender/go-jsonschema => github.com/nolag/go-jsonschema v0.16.0-rtinianov + github.com/go-kit/log => github.com/go-kit/log v0.2.1 // replicating the replace directive on cosmos SDK github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1 - // until merged upstream: https://github.com/hashicorp/go-plugin/pull/257 - github.com/hashicorp/go-plugin => github.com/smartcontractkit/go-plugin v0.0.0-20240208201424-b3b91517de16 - - // until merged upstream: https://github.com/mwitkow/grpc-proxy/pull/69 - github.com/mwitkow/grpc-proxy => github.com/smartcontractkit/grpc-proxy v0.0.0-20230731113816-f1be6620749f - // type func(a Label, b Label) bool of func(a, b Label) bool {…} does not match inferred type func(a Label, b Label) int for func(a E, b E) int github.com/prometheus/prometheus => github.com/prometheus/prometheus v0.47.2-0.20231010075449-4b9c19fe5510 +) + +replace ( + github.com/prometheus/client_golang => github.com/prometheus/client_golang v1.14.0 + github.com/prometheus/common => github.com/prometheus/common v0.42.0 +) + +replace github.com/chaos-mesh/chaos-mesh/api => github.com/chaos-mesh/chaos-mesh/api v0.0.0-20240709130330-9f4feec7553f - // Pin K8s versions as their updates are highly disruptive and go mod keeps wanting to update them - k8s.io/api => k8s.io/api v0.25.11 - k8s.io/client-go => k8s.io/client-go v0.25.11 - k8s.io/kube-openapi => k8s.io/kube-openapi v0.0.0-20230303024457-afdc3dddf62d +replace ( + k8s.io/api => k8s.io/api v0.28.2 + k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.28.2 + k8s.io/apimachinery => k8s.io/apimachinery v0.28.2 + k8s.io/apiserver => k8s.io/apiserver v0.28.2 + k8s.io/cli-runtime => k8s.io/cli-runtime v0.28.2 + k8s.io/client-go => k8s.io/client-go v0.28.2 + k8s.io/cloud-provider => k8s.io/cloud-provider v0.28.2 + k8s.io/cluster-bootstrap => k8s.io/cluster-bootstrap v0.28.2 + k8s.io/code-generator => k8s.io/code-generator v0.28.2 + k8s.io/component-base => k8s.io/component-base v0.28.2 + k8s.io/component-helpers => k8s.io/component-helpers v0.28.2 + k8s.io/controller-manager => k8s.io/controller-manager v0.28.2 + k8s.io/cri-api => k8s.io/cri-api v0.28.2 + k8s.io/csi-translation-lib => k8s.io/csi-translation-lib v0.28.2 + k8s.io/dynamic-resource-allocation => k8s.io/dynamic-resource-allocation v0.28.2 + k8s.io/endpointslice => k8s.io/endpointslice v0.28.2 + k8s.io/kms => k8s.io/kms v0.28.2 + k8s.io/kube-aggregator => k8s.io/kube-aggregator v0.28.2 + k8s.io/kube-controller-manager => k8s.io/kube-controller-manager v0.28.2 + k8s.io/kube-proxy => k8s.io/kube-proxy v0.28.2 + k8s.io/kube-scheduler => k8s.io/kube-scheduler v0.28.2 + k8s.io/kubectl => k8s.io/kubectl v0.28.2 + k8s.io/kubelet => k8s.io/kubelet v0.28.2 + k8s.io/legacy-cloud-providers => k8s.io/legacy-cloud-providers v0.28.2 + k8s.io/metrics => k8s.io/metrics v0.28.2 + k8s.io/mount-utils => k8s.io/mount-utils v0.28.2 + k8s.io/pod-security-admission => k8s.io/pod-security-admission v0.28.2 + k8s.io/sample-apiserver => k8s.io/sample-apiserver v0.28.2 + k8s.io/sample-cli-plugin => k8s.io/sample-cli-plugin v0.28.2 + k8s.io/sample-controller => k8s.io/sample-controller v0.28.2 + sigs.k8s.io/controller-runtime => sigs.k8s.io/controller-runtime v0.16.2 ) + +replace github.com/sourcegraph/sourcegraph/lib => github.com/sourcegraph/sourcegraph-public-snapshot/lib v0.0.0-20240822153003-c864f15af264 diff --git a/integration-tests/load/go.sum b/integration-tests/load/go.sum index 3d24dc6c750..2d606ba6f98 100644 --- a/integration-tests/load/go.sum +++ b/integration-tests/load/go.sum @@ -4,7 +4,6 @@ cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSR cloud.google.com/go v0.43.0/go.mod h1:BOSR3VbTLkk6FDC/TcffxP4NF/FFBGA5ku+jvKOP7pg= cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= -cloud.google.com/go v0.44.3/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= @@ -15,25 +14,27 @@ cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKV cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= -cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= -cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= -cloud.google.com/go v0.75.0/go.mod h1:VGuuCn7PG0dwsd5XPVm2Mm3wlh3EL55/79EKB6hlPTY= -cloud.google.com/go v0.112.1 h1:uJSeirPke5UNZHIb4SxfZklVSiWWVqW4oXlETwZziwM= -cloud.google.com/go v0.112.1/go.mod h1:+Vbu+Y1UU+I1rjmzeMOb/8RfkKJK2Gyxi1X6jJCZLo4= +cloud.google.com/go v0.115.0 h1:CnFSK6Xo3lDYRoBKEcAtia6VSC837/ZkJuRduSFnr14= +cloud.google.com/go v0.115.0/go.mod h1:8jIM5vVgoAEoiVxQ/O4BFTfHqulPZgs/ufEzMcFMdWU= +cloud.google.com/go/auth v0.7.1 h1:Iv1bbpzJ2OIg16m94XI9/tlzZZl3cdeR3nGVGj78N7s= +cloud.google.com/go/auth v0.7.1/go.mod h1:VEc4p5NNxycWQTMQEDQF0bd6aTMb6VgYDXEwiJJQAbs= +cloud.google.com/go/auth/oauth2adapt v0.2.3 h1:MlxF+Pd3OmSudg/b1yZ5lJwoXCEaeedAguodky1PcKI= +cloud.google.com/go/auth/oauth2adapt v0.2.3/go.mod h1:tMQXOfZzFuNuUxOypHlQEXgdfX5cuhwU+ffUuXRJE8I= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= -cloud.google.com/go/compute v1.25.1 h1:ZRpHJedLtTpKgr3RV1Fx23NuaAEN1Zfx9hw1u4aJdjU= -cloud.google.com/go/compute/metadata v0.3.0 h1:Tz+eQXMEqDIKRsmY3cHTL6FVaynIjX2QxYC4trgAKZc= -cloud.google.com/go/compute/metadata v0.3.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k= +cloud.google.com/go/compute v1.27.2 h1:5cE5hdrwJV/92ravlwIFRGnyH9CpLGhh4N0ZDVTU+BA= +cloud.google.com/go/compute/metadata v0.2.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k= +cloud.google.com/go/compute/metadata v0.5.0 h1:Zr0eK8JbFv6+Wi4ilXAR8FJ3wyNdpxHKJNPos6LTZOY= +cloud.google.com/go/compute/metadata v0.5.0/go.mod h1:aHnloV2TPI38yx4s9+wAZhHykWvVCfu7hQbF+9CWoiY= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= -cloud.google.com/go/iam v1.1.6 h1:bEa06k05IO4f4uJonbB5iAgKTPpABy1ayxaIZV/GHVc= -cloud.google.com/go/iam v1.1.6/go.mod h1:O0zxdPeGBoFdWW3HWmBxJsk0pfvNM/p/qa82rWOGTwI= +cloud.google.com/go/iam v1.1.11 h1:0mQ8UKSfdHLut6pH9FM3bI55KWR46ketn0PuXleDyxw= +cloud.google.com/go/iam v1.1.11/go.mod h1:biXoiLWYIKntto2joP+62sd9uW5EpkZmKIvfNcTWlnQ= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= @@ -43,9 +44,8 @@ cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0Zeo cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= -cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= -cloud.google.com/go/storage v1.38.0 h1:Az68ZRGlnNTpIBbLjSMIV2BDcwwXYlRlQzis0llkpJg= -cloud.google.com/go/storage v1.38.0/go.mod h1:tlUADB0mAb9BgYls9lq+8MGkfzOXuLrnHXlpHmvFJoY= +cloud.google.com/go/storage v1.43.0 h1:CcxnSohZwizt4LCzQHWvBf1/kvtHUn7gk9QERXPyXFs= +cloud.google.com/go/storage v1.43.0/go.mod h1:ajvxEa7WmZS1PxvKRq4bq0tFT3vMd502JwstCcYv0Q0= contrib.go.opencensus.io/exporter/stackdriver v0.12.6/go.mod h1:8x999/OcIPy5ivx/wDiV7Gx4D+VUPODf0mWRGRc5kSk= contrib.go.opencensus.io/exporter/stackdriver v0.13.4/go.mod h1:aXENhDJ1Y4lIg4EUaVTwzvYETVNZk10Pu26tevFKLUc= contrib.go.opencensus.io/exporter/stackdriver v0.13.5 h1:TNaexHK16gPUoc7uzELKOU7JULqccn1NDuqUxmxSqfo= @@ -54,18 +54,18 @@ cosmossdk.io/api v0.3.1 h1:NNiOclKRR0AOlO4KIqeaG6PS6kswOMhHD0ir0SscNXE= cosmossdk.io/api v0.3.1/go.mod h1:DfHfMkiNA2Uhy8fj0JJlOCYOBp4eWUUJ1te5zBGNyIw= cosmossdk.io/core v0.5.1 h1:vQVtFrIYOQJDV3f7rw4pjjVqc1id4+mE0L9hHP66pyI= cosmossdk.io/core v0.5.1/go.mod h1:KZtwHCLjcFuo0nmDc24Xy6CRNEL9Vl/MeimQ2aC7NLE= -cosmossdk.io/depinject v1.0.0-alpha.3 h1:6evFIgj//Y3w09bqOUOzEpFj5tsxBqdc5CfkO7z+zfw= -cosmossdk.io/depinject v1.0.0-alpha.3/go.mod h1:eRbcdQ7MRpIPEM5YUJh8k97nxHpYbc3sMUnEtt8HPWU= -cosmossdk.io/errors v1.0.0 h1:nxF07lmlBbB8NKQhtJ+sJm6ef5uV1XkvPXG2bUntb04= -cosmossdk.io/errors v1.0.0/go.mod h1:+hJZLuhdDE0pYN8HkOrVNwrIOYvUGnn6+4fjnJs/oV0= -cosmossdk.io/log v1.1.1-0.20230704160919-88f2c830b0ca h1:msenprh2BLLRwNT7zN56TbBHOGk/7ARQckXHxXyvjoQ= -cosmossdk.io/log v1.1.1-0.20230704160919-88f2c830b0ca/go.mod h1:PkIAKXZvaxrTRc++z53XMRvFk8AcGGWYHcMIPzVYX9c= -cosmossdk.io/math v1.0.1 h1:Qx3ifyOPaMLNH/89WeZFH268yCvU4xEcnPLu3sJqPPg= -cosmossdk.io/math v1.0.1/go.mod h1:Ygz4wBHrgc7g0N+8+MrnTfS9LLn9aaTGa9hKopuym5k= +cosmossdk.io/depinject v1.0.0-alpha.4 h1:PLNp8ZYAMPTUKyG9IK2hsbciDWqna2z1Wsl98okJopc= +cosmossdk.io/depinject v1.0.0-alpha.4/go.mod h1:HeDk7IkR5ckZ3lMGs/o91AVUc7E596vMaOmslGFM3yU= +cosmossdk.io/errors v1.0.1 h1:bzu+Kcr0kS/1DuPBtUFdWjzLqyUuCiyHjyJB6srBV/0= +cosmossdk.io/errors v1.0.1/go.mod h1:MeelVSZThMi4bEakzhhhE/CKqVv3nOJDA25bIqRDu/U= +cosmossdk.io/log v1.3.1 h1:UZx8nWIkfbbNEWusZqzAx3ZGvu54TZacWib3EzUYmGI= +cosmossdk.io/log v1.3.1/go.mod h1:2/dIomt8mKdk6vl3OWJcPk2be3pGOS8OQaLUM/3/tCM= +cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= +cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= cosmossdk.io/tools/rosetta v0.2.1 h1:ddOMatOH+pbxWbrGJKRAawdBkPYLfKXutK9IETnjYxw= cosmossdk.io/tools/rosetta v0.2.1/go.mod h1:Pqdc1FdvkNV3LcNIkYWt2RQY6IP1ge6YWZk8MhhO9Hw= -dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk= -dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= +dario.cat/mergo v1.0.1 h1:Ra4+bf83h2ztPIQYNP99R6m+Y7KfnARDfID+a+vLl4s= +dario.cat/mergo v1.0.1/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.0.0-rc.1/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= @@ -78,7 +78,6 @@ github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24 h1:bvDV9 github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24/go.mod h1:8o94RPi1/7XTJvwPpRSzSUedZrtlirdB3r9Z20bi2f8= github.com/AlekSi/pointer v1.1.0 h1:SSDMPcXD9jSl8FPy9cRzoRaMJtm9g9ggGTxecRUbQoI= github.com/AlekSi/pointer v1.1.0/go.mod h1:y7BvfRI3wXPWKXEBhU71nbnIEEZX0QTSB2Bj48UJIZE= -github.com/AndreasBriese/bbloom v0.0.0-20190306092124-e2d15f34fcf9/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8= github.com/Azure/azure-sdk-for-go v65.0.0+incompatible h1:HzKLt3kIwMm4KeJYTdx9EbjRYTySD/t8i1Ee/W5EGXw= github.com/Azure/azure-sdk-for-go v65.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.8.0 h1:9kDVnTz3vbfweTqAUmk/a/pH5pWFCHtvRpHYC0G/dcA= @@ -111,10 +110,8 @@ github.com/AzureAD/microsoft-authentication-library-for-go v1.1.1 h1:WpB/QDNLpMw github.com/AzureAD/microsoft-authentication-library-for-go v1.1.1/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d h1:nalkkPQcITbvhmL4+C4cKA87NW0tfm3Kl9VXRoPywFg= -github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d/go.mod h1:URdX5+vg25ts3aCh8H5IFZybJYKWhJHYMTnf+ULtoC4= -github.com/CloudyKit/fastprinter v0.0.0-20200109182630-33d98a066a53/go.mod h1:+3IMCy2vIlbG1XG/0ggNQv0SvxCAIpPM5b1nCz56Xno= -github.com/CloudyKit/jet/v3 v3.0.0/go.mod h1:HKQPgSJmdK8hdoAbKUUWajkHyHo4RaU5rMdUywE7VMo= +github.com/ChainSafe/go-schnorrkel v1.0.0 h1:3aDA67lAykLaG1y3AOjs88dMxC88PgUuHRrLeDnvGIM= +github.com/ChainSafe/go-schnorrkel v1.0.0/go.mod h1:dpzHYVxLZcp8pjlV+O+UR8K0Hp/z7vcchBSbMBEhCw4= github.com/CosmWasm/wasmd v0.40.1 h1:LxbO78t/6S8TkeQlUrJ0m5O87HtAwLx4RGHq3rdrOEU= github.com/CosmWasm/wasmd v0.40.1/go.mod h1:6EOwnv7MpuFaEqxcUOdFV9i4yvrdOciaY6VQ1o7A3yg= github.com/CosmWasm/wasmvm v1.2.4 h1:6OfeZuEcEH/9iqwrg2pkeVtDCkMoj9U6PpKtcrCyVrQ= @@ -128,11 +125,12 @@ github.com/GeertJohan/go.incremental v1.0.0/go.mod h1:6fAjUhbVuX1KcMD3c8TEgVUqmo github.com/GeertJohan/go.rice v1.0.0/go.mod h1:eH6gbSOAUv07dQuZVnBmoDP8mgsM1rtixis4Tib9if0= github.com/HdrHistogram/hdrhistogram-go v1.1.2 h1:5IcZpTvzydCQeHzK4Ef/D5rrSqwxob0t8PQPMybUNFM= github.com/HdrHistogram/hdrhistogram-go v1.1.2/go.mod h1:yDgFjdqOqDEKOvasDdhWNXYg9BVp4O+o5f6V/ehm6Oo= -github.com/Joker/hpp v1.0.0/go.mod h1:8x5n+M1Hp5hC0g8okX3sR3vFQwynaX/UgSOM9MeBKzY= github.com/K-Phoen/grabana v0.22.1 h1:b/O+C3H2H6VNYSeMCYUO4X4wYuwFXgBcRkvYa+fjpQA= github.com/K-Phoen/grabana v0.22.1/go.mod h1:3LTXrTzQzTKTgvKSXdRjlsJbizSOW/V23Q3iX00R5bU= github.com/K-Phoen/sdk v0.12.4 h1:j2EYuBJm3zDTD0fGKACVFWxAXtkR0q5QzfVqxmHSeGQ= github.com/K-Phoen/sdk v0.12.4/go.mod h1:qmM0wO23CtoDux528MXPpYvS4XkRWkWX6rvX9Za8EVU= +github.com/Khan/genqlient v0.7.0 h1:GZ1meyRnzcDTK48EjqB8t3bcfYvHArCUUvgOwpz1D4w= +github.com/Khan/genqlient v0.7.0/go.mod h1:HNyy3wZvuYwmW3Y7mkoQLZsa/R5n5yIRajS1kPBvSFM= github.com/MakeNowJust/heredoc v1.0.0 h1:cXCdzVdstXyiTqTvfqk9SDHpKNjxuom+DOlyEeQ4pzQ= github.com/MakeNowJust/heredoc v1.0.0/go.mod h1:mG5amYoWBHf8vpLOuehzbGGw0EHxpZZ6lCpQ4fNJ8LE= github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI= @@ -143,10 +141,10 @@ github.com/Masterminds/semver/v3 v3.2.1 h1:RN9w6+7QoMeJVGyfmbcgs28Br8cvmnucEXnY0 github.com/Masterminds/semver/v3 v3.2.1/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYrf8m9wsX0PNOMQ= github.com/Masterminds/sprig/v3 v3.2.3 h1:eL2fZNezLomi0uOLqjQoN6BfsDD+fyLtgbJMAj9n6YA= github.com/Masterminds/sprig/v3 v3.2.3/go.mod h1:rXcFaZ2zZbLRJv/xSysmlgIM1u11eBaRMhvYXJNkGuM= -github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= -github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= -github.com/Microsoft/hcsshim v0.11.4 h1:68vKo2VN8DE9AdN4tnkWnmdhqdbpUFM8OF3Airm7fz8= -github.com/Microsoft/hcsshim v0.11.4/go.mod h1:smjE4dvqPX9Zldna+t5FG3rnoHhaB7QYxPRqGcpAD9w= +github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= +github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= +github.com/Microsoft/hcsshim v0.11.5 h1:haEcLNpj9Ka1gd3B3tAEs9CpE0c+1IhoL59w/exYU38= +github.com/Microsoft/hcsshim v0.11.5/go.mod h1:MV8xMfmECjl5HdO7U/3/hFVnkmSBjAjmA09d4bExKcU= github.com/NethermindEth/juno v0.3.1 h1:AW72LiAm9gqUeCVJWvepnZcTnpU4Vkl0KzPMxS+42FA= github.com/NethermindEth/juno v0.3.1/go.mod h1:SGbTpgGaCsxhFsKOid7Ylnz//WZ8swtILk+NbHGsk/Q= github.com/NethermindEth/starknet.go v0.7.1-0.20240401080518-34a506f3cfdb h1:Mv8SscePPyw2ju4igIJAjFgcq5zCQfjgbz53DwYu5mc= @@ -158,7 +156,6 @@ github.com/OneOfOne/xxhash v1.2.8 h1:31czK/TI9sNkxIKfaUfGlU47BAxQ0ztGgd9vPyqimf8 github.com/OneOfOne/xxhash v1.2.8/go.mod h1:eZbhyaAYD41SGSSsnmcpxVoRiQ/MPUTjUdIIOT9Um7Q= github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= -github.com/Shopify/goreferrer v0.0.0-20181106222321-ec9c9a553398/go.mod h1:a1uqRtAwp2Xwc6WNPJEufxJ7fx3npB4UV/JOLmbu5I0= github.com/VictoriaMetrics/fastcache v1.12.1 h1:i0mICQuojGDL3KblA7wUNlY5lOK6a4bwt3uRKnkZU40= github.com/VictoriaMetrics/fastcache v1.12.1/go.mod h1:tX04vaqcNoQeGLD+ra5pU5sWkuxnzWhEzLwhP9w653o= github.com/VividCortex/gohistogram v1.0.0 h1:6+hBz+qvs0JOrrNhhmR7lFxo5sINxBCGXrdtl/UvroE= @@ -167,17 +164,12 @@ github.com/Workiva/go-datastructures v1.1.0 h1:hu20UpgZneBhQ3ZvwiOGlqJSKIosin2Rd github.com/Workiva/go-datastructures v1.1.0/go.mod h1:1yZL+zfsztete+ePzZz/Zb1/t5BnDuE2Ya2MMGhzP6A= github.com/XSAM/otelsql v0.27.0 h1:i9xtxtdcqXV768a5C6SoT/RkG+ue3JTOgkYInzlTOqs= github.com/XSAM/otelsql v0.27.0/go.mod h1:0mFB3TvLa7NCuhm/2nU7/b2wEtsczkj8Rey8ygO7V+A= -github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY= github.com/akavel/rsrc v0.8.0/go.mod h1:uLoCtb9J+EyAqh+26kdrTgmzRBFPGOolLWKpdxkKq+c= -github.com/alecthomas/participle/v2 v2.0.0-alpha7 h1:cK4vjj0VSgb3lN1nuKA5F7dw+1s1pWBe5bx7nNCnN+c= -github.com/alecthomas/participle/v2 v2.0.0-alpha7/go.mod h1:NumScqsC42o9x+dGj8/YqsIfhrIQjFEOFovxotbBirA= -github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/kingpin/v2 v2.3.1/go.mod h1:oYL5vtsvEHZGHxU7DMp32Dvx+qL+ptGn6lWaot2vCNE= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= -github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 h1:s6gZFSlWYmbqAuRjVTiNNhvNRfY2Wxp9nhfyel4rklc= github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137/go.mod h1:OMCwj8VM1Kc9e19TLln2VL61YJF0x1XFtfdL4JdbSyE= +github.com/alecthomas/units v0.0.0-20240626203959-61d1e3462e30 h1:t3eaIm0rUkzbrIewtiFmMK5RXHej2XnoXNhxVsAYUfg= +github.com/alecthomas/units v0.0.0-20240626203959-61d1e3462e30/go.mod h1:fvzegU4vN3H1qMT+8wDmzjAcDONcgo2/SZ/TyfdUOFs= github.com/alexbrainman/sspi v0.0.0-20210105120005-909beea2cc74 h1:Kk6a4nehpJ3UuJRqlA3JxYxBZEqCeOmATOvrbT4p9RA= github.com/alexbrainman/sspi v0.0.0-20210105120005-909beea2cc74/go.mod h1:cEWa1LVoE5KvSD9ONXsZrj0z6KqySlCCNKHlLzbqAt4= github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a h1:HbKu58rmZpUGpz5+4FfNmIU+FmZg2P3Xaj2v2bfNWmk= @@ -189,6 +181,8 @@ github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax github.com/allegro/bigcache v1.2.1 h1:hg1sY1raCwic3Vnsvje6TT7/pnZba83LeFck5NrFKSc= github.com/allegro/bigcache v1.2.1/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM= github.com/andres-erbsen/clock v0.0.0-20160526145045-9e14626cd129/go.mod h1:rFgpPQZYZ8vdbc+48xibu8ALc3yeyd64IhHS+PU6Yyg= +github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883 h1:bvNMNQO63//z+xNgfBlViaCIJKLlCJ6/fmUseuG0wVQ= +github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= @@ -204,18 +198,47 @@ github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 h1:DklsrG3d github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= github.com/avast/retry-go v3.0.0+incompatible h1:4SOWQ7Qs+oroOTQOYnAHqelpCO0biHSxpiH9JdtuBj0= github.com/avast/retry-go v3.0.0+incompatible/go.mod h1:XtSnn+n/sHqQIpZ10K1qAevBhOOCWBLXXy3hyiqqBrY= -github.com/avast/retry-go/v4 v4.5.1 h1:AxIx0HGi4VZ3I02jr78j5lZ3M6x1E0Ivxa6b0pUUh7o= -github.com/avast/retry-go/v4 v4.5.1/go.mod h1:/sipNsvNB3RRuT5iNcb6h73nw3IBmXJ/H3XrCQYSOpc= +github.com/avast/retry-go/v4 v4.6.0 h1:K9xNA+KeB8HHc2aWFuLb25Offp+0iVRXEvFx8IinRJA= +github.com/avast/retry-go/v4 v4.6.0/go.mod h1:gvWlPhBVsvBbLkVGDg/KwvBv0bEkCOLRRSHKIr2PyOE= +github.com/awalterschulze/gographviz v2.0.3+incompatible h1:9sVEXJBJLwGX7EQVhLm2elIKCm7P2YHFC8v6096G09E= +github.com/awalterschulze/gographviz v2.0.3+incompatible/go.mod h1:GEV5wmg4YquNw7v1kkyoX9etIk8yVmXj+AkDHuuETHs= github.com/aws/aws-sdk-go v1.22.1/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.23.20/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.38.35/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= github.com/aws/aws-sdk-go v1.45.25 h1:c4fLlh5sLdK2DCRTY1z0hyuJZU4ygxX8m1FswL6/nF4= github.com/aws/aws-sdk-go v1.45.25/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= +github.com/aws/aws-sdk-go-v2 v1.30.4 h1:frhcagrVNrzmT95RJImMHgabt99vkXGslubDaDagTk8= +github.com/aws/aws-sdk-go-v2 v1.30.4/go.mod h1:CT+ZPWXbYrci8chcARI3OmI/qgd+f6WtuLOoaIA8PR0= +github.com/aws/aws-sdk-go-v2/config v1.27.28 h1:OTxWGW/91C61QlneCtnD62NLb4W616/NM1jA8LhJqbg= +github.com/aws/aws-sdk-go-v2/config v1.27.28/go.mod h1:uzVRVtJSU5EFv6Fu82AoVFKozJi2ZCY6WRCXj06rbvs= +github.com/aws/aws-sdk-go-v2/credentials v1.17.28 h1:m8+AHY/ND8CMHJnPoH7PJIRakWGa4gbfbxuY9TGTUXM= +github.com/aws/aws-sdk-go-v2/credentials v1.17.28/go.mod h1:6TF7dSc78ehD1SL6KpRIPKMA1GyyWflIkjqg+qmf4+c= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.12 h1:yjwoSyDZF8Jth+mUk5lSPJCkMC0lMy6FaCD51jm6ayE= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.12/go.mod h1:fuR57fAgMk7ot3WcNQfb6rSEn+SUffl7ri+aa8uKysI= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.16 h1:TNyt/+X43KJ9IJJMjKfa3bNTiZbUP7DeCxfbTROESwY= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.16/go.mod h1:2DwJF39FlNAUiX5pAc0UNeiz16lK2t7IaFcm0LFHEgc= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.16 h1:jYfy8UPmd+6kJW5YhY0L1/KftReOGxI/4NtVSTh9O/I= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.16/go.mod h1:7ZfEPZxkW42Afq4uQB8H2E2e6ebh6mXTueEpYzjCzcs= +github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1 h1:VaRN3TlFdd6KxX1x3ILT5ynH6HvKgqdiXoTxAF4HQcQ= +github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1/go.mod h1:FbtygfRFze9usAadmnGJNc8KsP346kEe+y2/oyhGAGc= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.4 h1:KypMCbLPPHEmf9DgMGw51jMj77VfGPAN2Kv4cfhlfgI= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.4/go.mod h1:Vz1JQXliGcQktFTN/LN6uGppAIRoLBR2bMvIMP0gOjc= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.18 h1:tJ5RnkHCiSH0jyd6gROjlJtNwov0eGYNz8s8nFcR0jQ= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.18/go.mod h1:++NHzT+nAF7ZPrHPsA+ENvsXkOO8wEu+C6RXltAG4/c= +github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.32.5 h1:UDXu9dqpCZYonj7poM4kFISjzTdWI0v3WUusM+w+Gfc= +github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.32.5/go.mod h1:5NPkI3RsTOhwz1CuG7VVSgJCm3CINKkoIaUbUZWQ67w= +github.com/aws/aws-sdk-go-v2/service/sso v1.22.5 h1:zCsFCKvbj25i7p1u94imVoO447I/sFv8qq+lGJhRN0c= +github.com/aws/aws-sdk-go-v2/service/sso v1.22.5/go.mod h1:ZeDX1SnKsVlejeuz41GiajjZpRSWR7/42q/EyA/QEiM= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.26.5 h1:SKvPgvdvmiTWoi0GAJ7AsJfOz3ngVkD/ERbs5pUnHNI= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.26.5/go.mod h1:20sz31hv/WsPa3HhU3hfrIet2kxM4Pe0r20eBZ20Tac= +github.com/aws/aws-sdk-go-v2/service/sts v1.30.4 h1:iAckBT2OeEK/kBDyN/jDtpEExhjeeA/Im2q4X0rJZT8= +github.com/aws/aws-sdk-go-v2/service/sts v1.30.4/go.mod h1:vmSqFK+BVIwVpDAGZB3CoCXHzurt4qBE8lf+I/kRTh0= github.com/aws/constructs-go/constructs/v10 v10.1.255 h1:5hARfEmhBqHSTQf/C3QLA3sWOxO2Dfja0iA1W7ZcI7g= github.com/aws/constructs-go/constructs/v10 v10.1.255/go.mod h1:DCdBSjN04Ck2pajCacTD4RKFqSA7Utya8d62XreYctI= github.com/aws/jsii-runtime-go v1.75.0 h1:NhpUfyiL7/wsRuUekFsz8FFBCYLfPD/l61kKg9kL/a4= github.com/aws/jsii-runtime-go v1.75.0/go.mod h1:TKCyrtM0pygEPo4rDZzbMSDNCDNTSYSN6/mGyHI6O3I= -github.com/aymerick/raymond v2.0.3-0.20180322193309-b565731e1464+incompatible/go.mod h1:osfaiScAUVup+UC9Nfq76eWqDhXlp+4UYaA8uhTBO6g= +github.com/aws/smithy-go v1.20.4 h1:2HK1zBdPgRbjFOHlfeQZfpC4r72MOb9bZkiFwggKO+4= +github.com/aws/smithy-go v1.20.4/go.mod h1:irrKGvNn1InZwb2d7fkIRNucdfwR8R+Ts3wxYa/cJHg= github.com/bahlo/generic-list-go v0.2.0 h1:5sz/EEAK+ls5wF+NeqDpk5+iNdMDXrh3z3nPnH1Wvgk= github.com/bahlo/generic-list-go v0.2.0/go.mod h1:2KvAjgMlE5NNynlg/5iLrrCCZ2+5xWbdbCW3pNTGyYg= github.com/barkimedes/go-deepcopy v0.0.0-20220514131651-17c30cfc62df h1:GSoSVRLoBaFpOOds6QyY1L8AX7uoY+Ln3BHc22W40X0= @@ -223,8 +246,6 @@ github.com/barkimedes/go-deepcopy v0.0.0-20220514131651-17c30cfc62df/go.mod h1:h github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/benbjohnson/clock v1.3.5 h1:VvXlSJBzZpA/zum6Sj74hxwYI2DIxRWuNIoXAzHZz5o= github.com/benbjohnson/clock v1.3.5/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= -github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= -github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d h1:xDfNPAt8lFiC1UJrqV3uuy861HCTo708pDMbjHHdCas= @@ -235,6 +256,8 @@ github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816/go.mod h1:+zsy github.com/bits-and-blooms/bitset v1.10.0 h1:ePXTeiPEazB5+opbv5fr8umg2R/1NlzgDsyepwsSr88= github.com/bits-and-blooms/bitset v1.10.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8= github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84= +github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM= +github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ= github.com/blendle/zapdriver v1.3.1 h1:C3dydBOWYRiOk+B8X9IVZ5IOe+7cl+tGOexN4QqHfpE= github.com/blendle/zapdriver v1.3.1/go.mod h1:mdXfREi6u5MArG4j9fewC+FGnXaBR+T4Ox4J2u4eHCc= github.com/btcsuite/btcd v0.22.1 h1:CnwP9LM/M9xuRrGSCGeMVs9iv09uMqwsVX7EeIpgV2c= @@ -270,12 +293,14 @@ github.com/cespare/cp v1.1.1/go.mod h1:SOGHArjBr4JWaSDEVpWpo/hNg6RoKrls6Oh40hiwW github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= +github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/chai2010/gettext-go v1.0.2 h1:1Lwwip6Q2QGsAdl/ZKPCwTe9fe0CjlUbqj5bFNSjIRk= github.com/chai2010/gettext-go v1.0.2/go.mod h1:y+wnP2cHYaVj19NZhYKAwEMH2CI1gNHeQQ+5AjwawxA= -github.com/chaos-mesh/chaos-mesh/api/v1alpha1 v0.0.0-20220226050744-799408773657 h1:CyuI+igIjadM/GRnE2o0q+WCwipDh0n2cUYFPAvxziM= -github.com/chaos-mesh/chaos-mesh/api/v1alpha1 v0.0.0-20220226050744-799408773657/go.mod h1:JRiumF+RFsH1mrrP8FUsi9tExPylKkO/oSRWeQEUdLE= +github.com/chaos-mesh/chaos-mesh/api v0.0.0-20240709130330-9f4feec7553f h1:onZ3oc6l1Gz8pVpQ0c1U1Cb11kIMoDb3xtEy/iZbYZM= +github.com/chaos-mesh/chaos-mesh/api v0.0.0-20240709130330-9f4feec7553f/go.mod h1:x11iCbZV6hzzSQWMq610B6Wl5Lg1dhwqcVfeiWQQnQQ= github.com/chenzhuoyu/base64x v0.0.0-20211019084208-fb5309c8db06/go.mod h1:DH46F32mSOjUmXrMHnKwZdA8wcEefY7UVqBKYGjpdQY= github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311/go.mod h1:b583jCggY9gE99b6G5LEC39OIiVsWj+R97kbl5odCEk= github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d h1:77cEq6EriyTZ0g/qfRdp61a3Uu/AWrgIq2s0ClJV1g0= @@ -291,48 +316,43 @@ github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6D github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= -github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= -github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20240318125728-8a4994d93e50 h1:DBmgJDC9dTfkVyGgipamEh2BpGYxScCH1TOF1LL1cXc= -github.com/cncf/xds/go v0.0.0-20240318125728-8a4994d93e50/go.mod h1:5e1+Vvlzido69INQaVO6d87Qn543Xr6nooe9Kz7oBFM= +github.com/cncf/xds/go v0.0.0-20240423153145-555b57ec207b h1:ga8SEFjZ60pxLcmhnThWgvH2wg8376yUJmPhEH4H3kw= +github.com/cncf/xds/go v0.0.0-20240423153145-555b57ec207b/go.mod h1:W+zGtBO5Y1IgJhy4+A9GOqVhqLpfZi+vwmdNXUehLA8= github.com/cockroachdb/apd v1.1.0 h1:3LFP3629v+1aKXU5Q37mxmRxX/pIu1nijXydLShEq5I= github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ= github.com/cockroachdb/apd/v2 v2.0.2 h1:weh8u7Cneje73dDh+2tEVLUvyBc89iwepWCD8b8034E= github.com/cockroachdb/apd/v2 v2.0.2/go.mod h1:DDxRlzC2lo3/vSlmSoS7JkqbbrARPuFOGr0B9pvN3Gw= -github.com/cockroachdb/apd/v3 v3.1.0 h1:MK3Ow7LH0W8zkd5GMKA1PvS9qG3bWFI95WaVNfyZJ/w= -github.com/cockroachdb/apd/v3 v3.1.0/go.mod h1:6qgPBMXjATAdD/VefbRP9NoSLKjbB4LCoA7gN4LpHs4= -github.com/cockroachdb/datadriven v1.0.2/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f h1:otljaYPt5hWxV3MUfO5dFPFiOXg9CyG5/kCfayTqsJ4= github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= -github.com/cockroachdb/errors v1.9.1 h1:yFVvsI0VxmRShfawbt/laCIDy/mtTqqnvoNgiy5bEV8= -github.com/cockroachdb/errors v1.9.1/go.mod h1:2sxOtL2WIc096WSZqZ5h8fa17rdDq9HZOZLBCor4mBk= -github.com/cockroachdb/logtags v0.0.0-20211118104740-dabe8e521a4f/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= +github.com/cockroachdb/errors v1.10.0 h1:lfxS8zZz1+OjtV4MtNWgboi/W5tyLEB6VQZBXN+0VUU= +github.com/cockroachdb/errors v1.10.0/go.mod h1:lknhIsEVQ9Ss/qKDBQS/UqFSvPQjOwNq2qyKAxtHRqE= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= github.com/cockroachdb/pebble v0.0.0-20230928194634-aa077af62593 h1:aPEJyR4rPBvDmeyi+l/FS/VtA00IWvjeFvjen1m1l1A= github.com/cockroachdb/pebble v0.0.0-20230928194634-aa077af62593/go.mod h1:6hk1eMY/u5t+Cf18q5lFMUA1Rc+Sm5I6Ra1QuPyxXCo= -github.com/cockroachdb/redact v1.1.3 h1:AKZds10rFSIj7qADf0g46UixK8NNLwWTNdCIGS5wfSQ= -github.com/cockroachdb/redact v1.1.3/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= +github.com/cockroachdb/redact v1.1.5 h1:u1PMllDkdFfPWaNGMyLD1+so+aq3uUItthCFqzwPJ30= +github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= -github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0/go.mod h1:4Zcjuz89kmFXt9morQgcfYZAYZ5n8WHjt81YYWIwtTM= github.com/coinbase/rosetta-sdk-go/types v1.0.0 h1:jpVIwLcPoOeCR6o1tU+Xv7r5bMONNbHU7MuEHboiFuA= github.com/coinbase/rosetta-sdk-go/types v1.0.0/go.mod h1:eq7W2TMRH22GTW0N0beDnN931DW0/WOI1R2sdHNHG4c= -github.com/cometbft/cometbft v0.37.2 h1:XB0yyHGT0lwmJlFmM4+rsRnczPlHoAKFX6K8Zgc2/Jc= -github.com/cometbft/cometbft v0.37.2/go.mod h1:Y2MMMN//O5K4YKd8ze4r9jmk4Y7h0ajqILXbH5JQFVs= -github.com/cometbft/cometbft-db v0.7.0 h1:uBjbrBx4QzU0zOEnU8KxoDl18dMNgDh+zZRUE0ucsbo= -github.com/cometbft/cometbft-db v0.7.0/go.mod h1:yiKJIm2WKrt6x8Cyxtq9YTEcIMPcEe4XPxhgX59Fzf0= +github.com/cometbft/cometbft v0.37.5 h1:/U/TlgMh4NdnXNo+YU9T2NMCWyhXNDF34Mx582jlvq0= +github.com/cometbft/cometbft v0.37.5/go.mod h1:QC+mU0lBhKn8r9qvmnq53Dmf3DWBt4VtkcKw2C81wxY= +github.com/cometbft/cometbft-db v0.8.0 h1:vUMDaH3ApkX8m0KZvOFFy9b5DZHBAjsnEuo9AKVZpjo= +github.com/cometbft/cometbft-db v0.8.0/go.mod h1:6ASCP4pfhmrCBpfk01/9E1SI29nD3HfVHrY4PG8x5c0= github.com/confio/ics23/go v0.9.0 h1:cWs+wdbS2KRPZezoaaj+qBleXgUk5WOQFMP3CQFGTr4= github.com/confio/ics23/go v0.9.0/go.mod h1:4LPZ2NYqnYIVRklaozjNR1FScgDJ2s5Xrp+e/mYVRak= github.com/consensys/bavard v0.1.13 h1:oLhMLOFGTLdlda/kma4VOJazblc7IM5y5QPd2A/YjhQ= github.com/consensys/bavard v0.1.13/go.mod h1:9ItSMtA/dXMAiL7BG6bqW2m3NdSEObYWoH223nGHukI= github.com/consensys/gnark-crypto v0.12.1 h1:lHH39WuuFgVHONRl3J0LRBtuYdQTumFSDtJF7HpyG8M= github.com/consensys/gnark-crypto v0.12.1/go.mod h1:v2Gy7L/4ZRosZ7Ivs+9SfUDr0f5UlG+EM5t7MPHiLuY= -github.com/containerd/containerd v1.7.12 h1:+KQsnv4VnzyxWcfO9mlxxELaoztsDEjOuCMPAuPqgU0= -github.com/containerd/containerd v1.7.12/go.mod h1:/5OMpE1p0ylxtEUGY8kuCYkDRzJm9NO1TFMWjUpdevk= +github.com/containerd/containerd v1.7.18 h1:jqjZTQNfXGoEaZdW1WwPU0RqSn1Bm2Ay/KJPUuO8nao= +github.com/containerd/containerd v1.7.18/go.mod h1:IYEk9/IO6wAPUz2bCMVUbsfXjzw5UNP5fLz4PsUygQ4= github.com/containerd/continuity v0.4.3 h1:6HVkalIp+2u1ZLH1J/pYX2oBVXlJZvh1X1A7bEZ9Su8= github.com/containerd/continuity v0.4.3/go.mod h1:F6PTNCKepoxEaXLQp3wDAjygEnImnZ/7o4JzpodfroQ= +github.com/containerd/errdefs v0.1.0 h1:m0wCRBiu1WJT/Fr+iOoQHMQS/eP5myQ8lCv4Dz5ZURM= +github.com/containerd/errdefs v0.1.0/go.mod h1:YgWiiHtLmSeBrvpw+UfPijzbLaB77mEG1WwJTDETIV0= github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I= github.com/containerd/log v0.1.0/go.mod h1:VRRf09a7mHDIRezVKTRCrOq78v577GXq3bSa3EhrzVo= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= @@ -340,8 +360,9 @@ github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmfM= github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/coreos/go-semver v0.3.1 h1:yi21YpKnrx1gt5R+la8n5WgS0kCrsPp33dmEyHReZr4= +github.com/coreos/go-semver v0.3.1/go.mod h1:irMmmIw/7yzSRPWryHsK7EYSg09caPQL03VsM8rvUec= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8iXXhfZs= @@ -349,10 +370,10 @@ github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSV github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cosmos/btcutil v1.0.5 h1:t+ZFcX77LpKtDBhjucvnOH8C2l2ioGsBNEQ3jef8xFk= github.com/cosmos/btcutil v1.0.5/go.mod h1:IyB7iuqZMJlthe2tkIFL33xPyzbFYP0XVdS8P5lUPis= -github.com/cosmos/cosmos-proto v1.0.0-beta.2 h1:X3OKvWgK9Gsejo0F1qs5l8Qn6xJV/AzgIWR2wZ8Nua8= -github.com/cosmos/cosmos-proto v1.0.0-beta.2/go.mod h1:+XRCLJ14pr5HFEHIUcn51IKXD1Fy3rkEQqt4WqmN4V0= -github.com/cosmos/cosmos-sdk v0.47.4 h1:FVUpEprm58nMmBX4xkRdMDaIG5Nr4yy92HZAfGAw9bg= -github.com/cosmos/cosmos-sdk v0.47.4/go.mod h1:R5n+uM7vguVPFap4pgkdvQCT1nVo/OtPwrlAU40rvok= +github.com/cosmos/cosmos-proto v1.0.0-beta.5 h1:eNcayDLpip+zVLRLYafhzLvQlSmyab+RC5W7ZfmxJLA= +github.com/cosmos/cosmos-proto v1.0.0-beta.5/go.mod h1:hQGLpiIUloJBMdQMMWb/4wRApmI9hjHH05nefC0Ojec= +github.com/cosmos/cosmos-sdk v0.47.11 h1:0Qx7eORw0RJqPv+mvDuU8NQ1LV3nJJKJnPoYblWHolc= +github.com/cosmos/cosmos-sdk v0.47.11/go.mod h1:ADjORYzUQqQv/FxDi0H0K5gW/rAk1CiDR3ZKsExfJV0= github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= @@ -360,14 +381,14 @@ github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiK github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ4GUkT+tbFI= github.com/cosmos/gogoproto v1.4.11 h1:LZcMHrx4FjUgrqQSWeaGC1v/TeuVFqSLa43CC6aWR2g= github.com/cosmos/gogoproto v1.4.11/go.mod h1:/g39Mh8m17X8Q/GDEs5zYTSNaNnInBSohtaxzQnYq1Y= -github.com/cosmos/iavl v0.20.0 h1:fTVznVlepH0KK8NyKq8w+U7c2L6jofa27aFX6YGlm38= -github.com/cosmos/iavl v0.20.0/go.mod h1:WO7FyvaZJoH65+HFOsDir7xU9FWk2w9cHXNW1XHcl7A= -github.com/cosmos/ibc-go/v7 v7.0.1 h1:NIBNRWjlOoFvFQu1ZlgwkaSeHO5avf4C1YQiWegt8jw= -github.com/cosmos/ibc-go/v7 v7.0.1/go.mod h1:vEaapV6nuLPQlS+g8IKmxMo6auPi0i7HMv1PhViht/E= -github.com/cosmos/ics23/go v0.9.1-0.20221207100636-b1abd8678aab h1:I9ialKTQo7248V827Bba4OuKPmk+FPzmTVHsLXaIJWw= -github.com/cosmos/ics23/go v0.9.1-0.20221207100636-b1abd8678aab/go.mod h1:2CwqasX5dSD7Hbp/9b6lhK6BwoBDCBldx7gPKRukR60= -github.com/cosmos/ledger-cosmos-go v0.12.1 h1:sMBxza5p/rNK/06nBSNmsI/WDqI0pVJFVNihy1Y984w= -github.com/cosmos/ledger-cosmos-go v0.12.1/go.mod h1:dhO6kj+Y+AHIOgAe4L9HL/6NDdyyth4q238I9yFpD2g= +github.com/cosmos/iavl v0.20.1 h1:rM1kqeG3/HBT85vsZdoSNsehciqUQPWrR4BYmqE2+zg= +github.com/cosmos/iavl v0.20.1/go.mod h1:WO7FyvaZJoH65+HFOsDir7xU9FWk2w9cHXNW1XHcl7A= +github.com/cosmos/ibc-go/v7 v7.5.1 h1:KqS/g7W7EMX1OtOvufS8lWMJibOKpdgtNNZIU6fAgVU= +github.com/cosmos/ibc-go/v7 v7.5.1/go.mod h1:ktFg5GvKOyrGCqTWtW7Grj5uweU4ZapxrNeVS1CLLbo= +github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM= +github.com/cosmos/ics23/go v0.10.0/go.mod h1:ZfJSmng/TBNTBkFemHHHj5YY7VAU/MBU980F4VU1NG0= +github.com/cosmos/ledger-cosmos-go v0.12.4 h1:drvWt+GJP7Aiw550yeb3ON/zsrgW0jgh5saFCr7pDnw= +github.com/cosmos/ledger-cosmos-go v0.12.4/go.mod h1:fjfVWRf++Xkygt9wzCsjEBdjcf7wiiY35fv3ctT+k4M= github.com/cosmos/rosetta-sdk-go v0.10.0 h1:E5RhTruuoA7KTIXUcMicL76cffyeoyvNybzUGSKFTcM= github.com/cosmos/rosetta-sdk-go v0.10.0/go.mod h1:SImAZkb96YbwvoRkzSMQB6noNJXFgWl/ENIznEoYQI4= github.com/cpuguy83/dockercfg v0.3.1 h1:/FpZ+JaygUR/lZP2NlFI2DVfrOEMAIKP5wWEJdoYe9E= @@ -375,8 +396,8 @@ github.com/cpuguy83/dockercfg v0.3.1/go.mod h1:sugsbF4//dDlL/i+S+rtpIWp+5h0BHJHf github.com/cpuguy83/go-md2man v1.0.10 h1:BSKMNlYxDvnunlTymqtgONjNnaRV1sTpcovwwjF22jk= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= -github.com/cpuguy83/go-md2man/v2 v2.0.3 h1:qMCsGGgs+MAzDFyp9LpAe1Lqy/fY/qCovCm0qnXZOBM= -github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/cpuguy83/go-md2man/v2 v2.0.4 h1:wfIWP927BUkWJb2NmU/kNDYIBTh/ziUX91+lVfRxZq4= +github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/crate-crypto/go-ipa v0.0.0-20231025140028-3c0104f4b233 h1:d28BXYi+wUpz1KBmiF9bWrjEMacUEREV6MBi2ODnrfQ= github.com/crate-crypto/go-ipa v0.0.0-20231025140028-3c0104f4b233/go.mod h1:geZJZH3SzKCqnz5VT0q/DyIG/tvu/dZk+VIfXicupJs= github.com/crate-crypto/go-kzg-4844 v0.7.0 h1:C0vgZRk4q4EZ/JgPfzuSoxdCq3C3mOZMBShovmncxvA= @@ -387,10 +408,6 @@ github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7Do github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/creack/pty v1.1.18 h1:n56/Zwd5o6whRC5PMGretI4IdRLlmBXYNjScPaBgsbY= github.com/creack/pty v1.1.18/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4= -github.com/cucumber/common/gherkin/go/v22 v22.0.0 h1:4K8NqptbvdOrjL9DEea6HFjSpbdT9+Q5kgLpmmsHYl0= -github.com/cucumber/common/gherkin/go/v22 v22.0.0/go.mod h1:3mJT10B2GGn3MvVPd3FwR7m2u4tLhSRhWUqJU4KN4Fg= -github.com/cucumber/common/messages/go/v17 v17.1.1 h1:RNqopvIFyLWnKv0LfATh34SWBhXeoFTJnSrgm9cT/Ts= -github.com/cucumber/common/messages/go/v17 v17.1.1/go.mod h1:bpGxb57tDE385Rb2EohgUadLkAbhoC4IyCFi89u/JQI= github.com/daaku/go.zipexe v1.0.0/go.mod h1:z8IiR6TsVLEYKwXAoE/I+8ys/sDkgTzSL0CLnGVd57E= github.com/danieljoos/wincred v1.1.2 h1:QLdCxFs1/Yl4zduvBdcHB8goaYk9RARS2SgLLRuAyr0= github.com/danieljoos/wincred v1.1.2/go.mod h1:GijpziifJoIBfYh+S7BbkdUTU4LfM+QnGqR5Vl2tAx0= @@ -400,8 +417,8 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/deckarep/golang-set/v2 v2.3.0 h1:qs18EKUfHm2X9fA50Mr/M5hccg2tNnVqsiBImnyDs0g= -github.com/deckarep/golang-set/v2 v2.3.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4= +github.com/deckarep/golang-set/v2 v2.6.0 h1:XfcQbWM1LlMB8BsJ8N9vW5ehnnPVIw0je80NsVHagjM= +github.com/deckarep/golang-set/v2 v2.6.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4= github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y= github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etlyjdBU4sfcs2WYQMs= @@ -413,7 +430,6 @@ github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f/go.mod h1:xH/i4TFM github.com/dfuse-io/logging v0.0.0-20201110202154-26697de88c79/go.mod h1:V+ED4kT/t/lKtH99JQmKIb0v9WL3VaYkJ36CfHlVECI= github.com/dfuse-io/logging v0.0.0-20210109005628-b97a57253f70 h1:CuJS05R9jmNlUK8GOxrEELPbfXm0EuGh/30LjkjN5vo= github.com/dfuse-io/logging v0.0.0-20210109005628-b97a57253f70/go.mod h1:EoK/8RFbMEteaCaz89uessDTnCWjbbcr+DXcBh4el5o= -github.com/dgraph-io/badger v1.6.0/go.mod h1:zwt7syl517jmP8s94KqSxTlM6IMsdhYy6psNgSztDR4= github.com/dgraph-io/badger/v2 v2.2007.4 h1:TRWBQg8UrlUhaFdco01nO2uXwzKS7zd+HVdwV/GHc4o= github.com/dgraph-io/badger/v2 v2.2007.4/go.mod h1:vSw/ax2qojzbN6eXHIx6KPKtCSHJN/Uz0X0VPruTIhk= github.com/dgraph-io/ristretto v0.0.3-0.20200630154024-f66de99634de/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70dGTu2u+Ahh6E= @@ -425,11 +441,10 @@ github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 h1:fAjc9m62+UWV/WA github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= -github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= github.com/digitalocean/godo v1.99.0 h1:gUHO7n9bDaZFWvbzOum4bXE0/09ZuYA9yA8idQHX57E= github.com/digitalocean/godo v1.99.0/go.mod h1:SsS2oXo2rznfM/nORlZ/6JaUJZFhmKTib1YhopUc8NA= -github.com/distribution/reference v0.5.0 h1:/FUIFXtfc/x2gpa5/VGfiGLuOIdYa1t65IKK2OFGvA0= -github.com/distribution/reference v0.5.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E= +github.com/distribution/reference v0.6.0 h1:0IXCQ5g4/QMHHkarYzh5l+u8T3t73zM5QvfrDyIgxBk= +github.com/distribution/reference v0.6.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E= github.com/dnaeon/go-vcr v1.2.0 h1:zHCHvJYTMh1N7xnV7zf1m1GPBF9Ad0Jk/whtQ1663qI= github.com/dnaeon/go-vcr v1.2.0/go.mod h1:R4UdLID7HZT3taECzJs4YgbbH6PIGXB6W/sc5OLb6RQ= github.com/docker/distribution v2.8.2+incompatible h1:T3de5rq0dB1j30rp0sA2rER+m322EBzniBPB6ZIzuh8= @@ -440,7 +455,6 @@ github.com/docker/go-connections v0.5.0 h1:USnMq7hx7gwdVZq1L49hLXaFtUdTADjXGp+uj github.com/docker/go-connections v0.5.0/go.mod h1:ov60Kzw0kKElRwhNs9UlUHAE/F9Fe6GLaXnqyDdmEXc= github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= -github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= github.com/dominikbraun/graph v0.23.0 h1:TdZB4pPqCLFxYhdyMFb1TBdFxp8XLcJfTTBQucVPgCo= github.com/dominikbraun/graph v0.23.0/go.mod h1:yOjYyogZLY1LSG9E33JWZJiq5k83Qy2C6POAuiViluc= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= @@ -450,16 +464,12 @@ github.com/dvsekhvalnov/jose2go v1.7.0 h1:bnQc8+GMnidJZA8zc6lLEAb4xNrIqHwO+9Tzqv github.com/dvsekhvalnov/jose2go v1.7.0/go.mod h1:QsHjhyTlD/lAVqn/NSbVZmSCGeDehTB/mPZadG+mhXU= github.com/edsrzf/mmap-go v1.1.0 h1:6EUwBLQ/Mcr1EYLE4Tn1VdW1A4ckqCQWZBw8Hr0kjpQ= github.com/edsrzf/mmap-go v1.1.0/go.mod h1:19H/e8pUPLicwkyNgOykDXkJ9F0MHE+Z52B8EIth78Q= -github.com/eknkc/amber v0.0.0-20171010120322-cdade1c07385/go.mod h1:0vRUJqYpeSZifjYj7uP3BG/gKcuzL9xWVV/Y+cK33KM= -github.com/emicklei/go-restful/v3 v3.10.2 h1:hIovbnmBTLjHXkqEBUz3HGpXZdM7ZrE9fJIZIqlJLqE= -github.com/emicklei/go-restful/v3 v3.10.2/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= +github.com/emicklei/go-restful/v3 v3.12.1 h1:PJMDIM/ak7btuL8Ex0iYET9hxM3CI2sjZtzpL63nKAU= +github.com/emicklei/go-restful/v3 v3.12.1/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= -github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= github.com/envoyproxy/go-control-plane v0.12.0 h1:4X+VP1GHd1Mhj6IB5mMeGbLCleqxjletLK6K0rbxyZI= github.com/envoyproxy/go-control-plane v0.12.0/go.mod h1:ZBTaoJ23lqITozF0M6G4/IragXCQKCnYbmlmtHvwRG0= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= @@ -467,40 +477,29 @@ github.com/envoyproxy/protoc-gen-validate v1.0.4 h1:gVPz/FMfvh57HdSJQyvBtF00j8JU github.com/envoyproxy/protoc-gen-validate v1.0.4/go.mod h1:qys6tmnRsYrQqIhm2bvKZH4Blx/1gTIZ2UKVY1M+Yew= github.com/esote/minmaxheap v1.0.0 h1:rgA7StnXXpZG6qlM0S7pUmEv1KpWe32rYT4x8J8ntaA= github.com/esote/minmaxheap v1.0.0/go.mod h1:Ln8+i7fS1k3PLgZI2JAo0iA1as95QnIYiGCrqSJ5FZk= -github.com/etcd-io/bbolt v1.3.3/go.mod h1:ZF2nL25h33cCyBtcyWeZ2/I3HQOfTP+0PIEvHjkjCrw= github.com/ethereum/c-kzg-4844 v0.4.0 h1:3MS1s4JtA868KpJxroZoepdV0ZKBp3u/O5HcZ7R3nlY= github.com/ethereum/c-kzg-4844 v0.4.0/go.mod h1:VewdlzQmpT5QSrVhbBuGoCdFJkpaJlO1aQputP83wc0= github.com/ethereum/go-ethereum v1.13.8 h1:1od+thJel3tM52ZUNQwvpYOeRHlbkVFZ5S8fhi0Lgsg= github.com/ethereum/go-ethereum v1.13.8/go.mod h1:sc48XYQxCzH3fG9BcrXCOOgQk2JfZzNAmIKnceogzsA= -github.com/evanphx/json-patch v0.5.2/go.mod h1:ZWS5hhDbVDyob71nXKNL0+PWn6ToqBHMikGIFbs31qQ= github.com/evanphx/json-patch v5.6.0+incompatible h1:jBYDEEiFBPxA0v50tFdvOzQQTCvpL6mnFh5mB2/l16U= github.com/evanphx/json-patch v5.6.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -github.com/evanphx/json-patch/v5 v5.6.0 h1:b91NhWfaz02IuVxO9faSllyAtNXHMPkC5J8sJCLunww= -github.com/evanphx/json-patch/v5 v5.6.0/go.mod h1:G79N1coSVB93tBe7j6PhzjmR3/2VvlbKOFpnXhI9Bw4= +github.com/evanphx/json-patch/v5 v5.9.0 h1:kcBlZQbplgElYIlo/n1hJbls2z/1awpXxpRi0/FOJfg= +github.com/evanphx/json-patch/v5 v5.9.0/go.mod h1:VNkHZ/282BpEyt/tObQO8s5CMPmYYq14uClGH4abBuQ= github.com/exponent-io/jsonpath v0.0.0-20210407135951-1de76d718b3f h1:Wl78ApPPB2Wvf/TIe2xdyJxTlb6obmF18d8QdkxNDu4= github.com/exponent-io/jsonpath v0.0.0-20210407135951-1de76d718b3f/go.mod h1:OSYXu++VVOHnXeitef/D8n/6y4QV8uLHSFXX4NeXMGc= -github.com/facebookgo/ensure v0.0.0-20200202191622-63f1cf65ac4c h1:8ISkoahWXwZR41ois5lSJBSVw4D0OV19Ht/JSTzvSv0= -github.com/facebookgo/ensure v0.0.0-20200202191622-63f1cf65ac4c/go.mod h1:Yg+htXGokKKdzcwhuNDwVvN+uBxDGXJ7G/VN1d8fa64= -github.com/facebookgo/stack v0.0.0-20160209184415-751773369052 h1:JWuenKqqX8nojtoVVWjGfOF9635RETekkoH6Cc9SX0A= -github.com/facebookgo/stack v0.0.0-20160209184415-751773369052/go.mod h1:UbMTZqLaRiH3MsBH8va0n7s1pQYcu3uTb8G4tygF4Zg= -github.com/facebookgo/subset v0.0.0-20200203212716-c811ad88dec4 h1:7HZCaLC5+BZpmbhCOZJ293Lz68O7PYrF2EzeiFMwCLk= -github.com/facebookgo/subset v0.0.0-20200203212716-c811ad88dec4/go.mod h1:5tD+neXqOorC30/tWg0LCSkrqj/AR6gu8yY8/fpw1q0= github.com/facette/natsort v0.0.0-20181210072756-2cd4dd1e2dcb h1:IT4JYU7k4ikYg1SCxNI1/Tieq/NFvh6dzLdgi7eu0tM= github.com/facette/natsort v0.0.0-20181210072756-2cd4dd1e2dcb/go.mod h1:bH6Xx7IW64qjjJq8M2u4dxNaBiDfKK+z/3eGDpXEQhc= -github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072/go.mod h1:duJ4Jxv5lDcvg4QuQr0oowTf7dz4/CR8NtyCooz9HL8= github.com/fatih/camelcase v1.0.0 h1:hxNvNX/xYBp0ovncs8WyWZrOrpBNub/JfaMvbURyft8= github.com/fatih/camelcase v1.0.0/go.mod h1:yN2Sb0lFhZJUdVvtELVWefmrXpuZESvPmqwoZc+/fpc= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= -github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM= -github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE= -github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= +github.com/fatih/color v1.17.0 h1:GlRw1BRJxkpqUCBKzKOw098ed57fEsKeNjpTe3cSjK4= +github.com/fatih/color v1.17.0/go.mod h1:YZ7TlrGPkiz6ku9fK3TLD/pl3CpsiFyu8N92HLgmosI= github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5 h1:FtmdgXiUlNeRsoNMFlKLDt+S+6hbjVMEW6RGQ7aUf7c= github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0= -github.com/flowstack/go-jsonschema v0.1.1/go.mod h1:yL7fNggx1o8rm9RlgXv7hTBWxdBM0rVwpMwimd3F3N0= github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= @@ -508,14 +507,14 @@ github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7z github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= -github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= -github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= -github.com/fvbommel/sortorder v1.0.2 h1:mV4o8B2hKboCdkJm+a7uX/SIpZob4JzUpc5GGnM45eo= -github.com/fvbommel/sortorder v1.0.2/go.mod h1:uk88iVf1ovNn1iLfgUVU2F9o5eO30ui720w+kxuqRs0= -github.com/fxamacker/cbor/v2 v2.5.0 h1:oHsG0V/Q6E/wqTS2O1Cozzsy69nqCiguo5Q1a1ADivE= -github.com/fxamacker/cbor/v2 v2.5.0/go.mod h1:TA1xS00nchWmaBnEIxPSE5oHLuJBAVvqrtAnWBwBCVo= -github.com/gabriel-vasile/mimetype v1.4.2 h1:w5qFW6JKBz9Y393Y4q372O9A7cUSequkh1Q7OhCmWKU= -github.com/gabriel-vasile/mimetype v1.4.2/go.mod h1:zApsH/mKG4w07erKIaJPFiX0Tsq9BFQgN3qGY5GnNgA= +github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= +github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= +github.com/fvbommel/sortorder v1.1.0 h1:fUmoe+HLsBTctBDoaBwpQo5N+nrCp8g/BjKb/6ZQmYw= +github.com/fvbommel/sortorder v1.1.0/go.mod h1:uk88iVf1ovNn1iLfgUVU2F9o5eO30ui720w+kxuqRs0= +github.com/fxamacker/cbor/v2 v2.7.0 h1:iM5WgngdRBanHcxugY4JySA0nk1wZorNOpTgCMedv5E= +github.com/fxamacker/cbor/v2 v2.7.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ= +github.com/gabriel-vasile/mimetype v1.4.3 h1:in2uUcidCuFcDKtdcBxlR0rJ1+fsokWf+uqxgUFjbI0= +github.com/gabriel-vasile/mimetype v1.4.3/go.mod h1:d8uq/6HKRL6CGdk+aubisF/M5GcPfT7nKyLpA0lbSSk= github.com/gagliardetto/binary v0.7.7 h1:QZpT38+sgoPg+TIQjH94sLbl/vX+nlIRA37pEyOsjfY= github.com/gagliardetto/binary v0.7.7/go.mod h1:mUuay5LL8wFVnIlecHakSZMvcdqfs+CsotR5n77kyjM= github.com/gagliardetto/gofuzz v1.2.2 h1:XL/8qDMzcgvR4+CyRQW9UGdwPRPMHVJfqQ/uMvSUuQw= @@ -524,16 +523,14 @@ github.com/gagliardetto/solana-go v1.8.4 h1:vmD/JmTlonyXGy39bAo0inMhmbdAwV7rXZtL github.com/gagliardetto/solana-go v1.8.4/go.mod h1:i+7aAyNDTHG0jK8GZIBSI4OVvDqkt2Qx+LklYclRNG8= github.com/gagliardetto/treeout v0.1.4 h1:ozeYerrLCmCubo1TcIjFiOWTTGteOOHND1twdFpgwaw= github.com/gagliardetto/treeout v0.1.4/go.mod h1:loUefvXTrlRG5rYmJmExNryyBRh8f89VZhmMOyCyqok= -github.com/gavv/httpexpect v2.0.0+incompatible/go.mod h1:x+9tiU1YnrOvnB725RkpoLv1M62hOWzwo5OXotisrKc= github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08 h1:f6D9Hr8xV8uYKlyuj8XIruxlh9WjVjdh1gIicAS7ays= github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= github.com/gballet/go-verkle v0.1.1-0.20231031103413-a67434b50f46 h1:BAIP2GihuqhwdILrV+7GJel5lyPV3u1+PgzrWLc0TkE= github.com/gballet/go-verkle v0.1.1-0.20231031103413-a67434b50f46/go.mod h1:QNpY22eby74jVhqH4WhDLDwxc/vqsern6pW+u2kbkpc= github.com/gedex/inflector v0.0.0-20170307190818-16278e9db813 h1:Uc+IZ7gYqAf/rSGFplbWBSHaGolEQlNLgMgSE3ccnIQ= github.com/gedex/inflector v0.0.0-20170307190818-16278e9db813/go.mod h1:P+oSoE9yhSRvsmYyZsshflcR6ePWYLql6UU1amW13IM= -github.com/getsentry/sentry-go v0.12.0/go.mod h1:NSap0JBYWzHND8oMbyi0+XZhUalc1TBdRL1M71JZW2c= -github.com/getsentry/sentry-go v0.19.0 h1:BcCH3CN5tXt5aML+gwmbFwVptLLQA+eT866fCO9wVOM= -github.com/getsentry/sentry-go v0.19.0/go.mod h1:y3+lGEFEFexZtpbG1GUE2WD/f9zGyKYwpEqryTOC/nE= +github.com/getsentry/sentry-go v0.23.0 h1:dn+QRCeJv4pPt9OjVXiMcGIBIefaTJPw/h0bZWO05nE= +github.com/getsentry/sentry-go v0.23.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gin-contrib/cors v1.5.0 h1:DgGKV7DDoOn36DFkNtbHrjoRiT5ExCe+PC9/xp7aKvk= github.com/gin-contrib/cors v1.5.0/go.mod h1:TvU7MAZ3EwrPLI2ztzTt3tqgvBCq+wn8WpZmfADjupI= @@ -543,17 +540,12 @@ github.com/gin-contrib/sessions v0.0.5 h1:CATtfHmLMQrMNpJRgzjWXD7worTh7g7ritsQfm github.com/gin-contrib/sessions v0.0.5/go.mod h1:vYAuaUPqie3WUSsft6HUlCjlwwoJQs97miaG2+7neKY= github.com/gin-contrib/size v0.0.0-20230212012657-e14a14094dc4 h1:Z9J0PVIt1PuibOShaOw1jH8hUYz+Ak8NLsR/GI0Hv5I= github.com/gin-contrib/size v0.0.0-20230212012657-e14a14094dc4/go.mod h1:CEPcgZiz8998l9E8fDm16h8UfHRL7b+5oG0j/0koeVw= -github.com/gin-contrib/sse v0.0.0-20190301062529-5545eab6dad3/go.mod h1:VJ0WA2NBN22VlZ2dKZQPAPnyWw5XTlK1KymzLKsr59s= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= -github.com/gin-gonic/gin v1.4.0/go.mod h1:OW2EZn3DO8Ln9oIKOvM++LBO+5UPHJJDH72/q/3rZdM= -github.com/gin-gonic/gin v1.6.3/go.mod h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M= github.com/gin-gonic/gin v1.9.1 h1:4idEAncQnU5cB7BeOkPtxjfCSye0AAm1R0RVIqJ+Jmg= github.com/gin-gonic/gin v1.9.1/go.mod h1:hPrL7YrpYKXt5YId3A/Tnip5kqbEAP+KLuI3SUcPTeU= github.com/go-asn1-ber/asn1-ber v1.5.5 h1:MNHlNMBDgEKD4TcKr36vQN68BA00aDfjIt3/bD50WnA= github.com/go-asn1-ber/asn1-ber v1.5.5/go.mod h1:hEBeB/ic+5LoWskz+yKT7vGhhPYkProFKoKdwZRWMe0= -github.com/go-check/check v0.0.0-20180628173108-788fd7840127/go.mod h1:9ES+weclKsC9YodN5RgxqK/VD9HM9JsCSh7rNhMZE98= -github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= @@ -561,7 +553,6 @@ github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2 github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-json-experiment/json v0.0.0-20231102232822-2e55bd4e08b0 h1:ymLjT4f35nQbASLnvxEde4XOBL+Sn7rFuV+FOJqkljg= github.com/go-json-experiment/json v0.0.0-20231102232822-2e55bd4e08b0/go.mod h1:6daplAwHHGbUGib4990V3Il26O0OC4aRyvewaaAihaA= -github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.12.0 h1:e4o3o3IsBfAKQh5Qbbiqyfu97Ku7jrO/JbohvztANh4= github.com/go-kit/kit v0.12.0/go.mod h1:lHd+EkCZPIwYItmGDDRdhinkzX2A1sj+M9biaEaizzs= @@ -569,22 +560,20 @@ github.com/go-kit/log v0.2.1 h1:MRVx0/zhvdseW+Gza6N9rVzU/IVzaeE1SFI4raAhmBU= github.com/go-kit/log v0.2.1/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= github.com/go-ldap/ldap/v3 v3.4.6 h1:ert95MdbiG7aWo/oPYp9btL3KJlMPKnP58r09rI8T+A= github.com/go-ldap/ldap/v3 v3.4.6/go.mod h1:IGMQANNtxpsOzj7uUAMjpGBaOVTC4DYyIy8VsTdxmtc= -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.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= github.com/go-logfmt/logfmt v0.6.0 h1:wGYYu3uicYdqXVgoYbvnkrPVXkuLM1p1ifugDMEdRi4= github.com/go-logfmt/logfmt v0.6.0/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= -github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= -github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= +github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= -github.com/go-logr/zapr v1.2.3 h1:a9vnzlIBPQBBkeaR9IuMUfmVOrQlkoC4YfPoFkX3T7A= -github.com/go-logr/zapr v1.2.3/go.mod h1:eIauM6P8qSvTw5o2ez6UEAfGjQKrxQTl5EoK+Qa2oG4= -github.com/go-martini/martini v0.0.0-20170121215854-22fa46961aab/go.mod h1:/P9AEU963A2AYjv4d1V5eVL1CQbEJq6aCNHDDjibzu8= -github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= +github.com/go-logr/zapr v1.2.4 h1:QHVo+6stLbfJmYGkQ7uGHUCu5hnAFAj6mDe6Ea0SeOo= +github.com/go-logr/zapr v1.2.4/go.mod h1:FyHWQIzQORZ0QVE1BtVHv3cKtNLuXsbNLtpuhNapBOA= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= +github.com/go-ole/go-ole v1.3.0 h1:Dt6ye7+vXGIKZ7Xtk4s6/xVdGDQynvom7xCFEdWr6uE= +github.com/go-ole/go-ole v1.3.0/go.mod h1:5LS6F96DhAwUc7C+1HLexzMXY1xGRSryjyPPKW6zv78= github.com/go-openapi/analysis v0.21.2/go.mod h1:HZwRk4RRisyG8vx2Oe6aqeSQcoxRp47Xkp3+K6q+LdY= github.com/go-openapi/analysis v0.21.4 h1:ZDFLvSNxpDaomuCueM0BlSXxpANBlFYiBvr+GXrvIHc= github.com/go-openapi/analysis v0.21.4/go.mod h1:4zQ35W4neeZTqh3ol0rv/O8JBbka9QyAgQRPp9y3pfo= @@ -595,13 +584,12 @@ github.com/go-openapi/errors v0.20.4 h1:unTcVm6PispJsMECE3zWgvG4xTiKda1LIR5rCRWL github.com/go-openapi/errors v0.20.4/go.mod h1:Z3FlZ4I8jEGxjUK+bugx3on2mIAk4txuAOhlsB1FSgk= github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs= -github.com/go-openapi/jsonpointer v0.20.0 h1:ESKJdU9ASRfaPNOPRx12IUyA1vn3R9GiE3KYD14BXdQ= -github.com/go-openapi/jsonpointer v0.20.0/go.mod h1:6PGzBjjIIumbLYysB73Klnms1mwnU4G3YHOECG3CedA= +github.com/go-openapi/jsonpointer v0.21.0 h1:YgdVicSA9vH5RiHs9TZW5oyafXZFc6+2Vc1rr/O9oNQ= +github.com/go-openapi/jsonpointer v0.21.0/go.mod h1:IUyH9l/+uyhIYQ/PXVA41Rexl+kOkAPDdXEYns6fzUY= github.com/go-openapi/jsonreference v0.19.6/go.mod h1:diGHMEHg2IqXZGKxqyvWdfWU/aim5Dprw5bqpKkTvns= github.com/go-openapi/jsonreference v0.20.0/go.mod h1:Ag74Ico3lPc+zR+qjn4XBUmXymS4zJbYVCZmcgkasdo= -github.com/go-openapi/jsonreference v0.20.2 h1:3sVjiK66+uXK/6oQ8xgcRKcFgQ5KXa2KvnJRumpMGbE= -github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k= +github.com/go-openapi/jsonreference v0.21.0 h1:Rs+Y7hSXT83Jacb7kFyjn4ijOuVGSvOdF2+tg1TRrwQ= +github.com/go-openapi/jsonreference v0.21.0/go.mod h1:LmZmgsrTkVg9LG4EaHeY8cBDslNPMo06cago5JNLkm4= github.com/go-openapi/loads v0.21.1/go.mod h1:/DtAMXXneXFjbQMGEtbamCZb+4x7eGwkvZCvBmwUG+g= github.com/go-openapi/loads v0.21.2 h1:r2a/xFIYeZ4Qd2TnGpWDIQNcP80dIaZgf704za8enro= github.com/go-openapi/loads v0.21.2/go.mod h1:Jq58Os6SSGz0rzh62ptiu8Z31I+OTHqmULx5e/gJbNw= @@ -617,23 +605,18 @@ github.com/go-openapi/strfmt v0.21.7/go.mod h1:adeGTkxE44sPyLk0JV235VQAO/ZXUr8KA github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-openapi/swag v0.19.15/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= github.com/go-openapi/swag v0.21.1/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= -github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= -github.com/go-openapi/swag v0.22.4 h1:QLMzNJnMGPRNDCbySlcj1x01tzU8/9LTTL9hZZZogBU= -github.com/go-openapi/swag v0.22.4/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= +github.com/go-openapi/swag v0.23.0 h1:vsEVJDUo2hPJ2tu0/Xc+4noaxyEffXNIs3cOULZ+GrE= +github.com/go-openapi/swag v0.23.0/go.mod h1:esZ8ITTYEsH1V2trKHjAN8Ai7xHb8RV+YSZ577vPjgQ= github.com/go-openapi/validate v0.22.1 h1:G+c2ub6q47kfX1sOBLwIQwzBVt8qmOAARyo/9Fqs9NU= github.com/go-openapi/validate v0.22.1/go.mod h1:rjnrwK57VJ7A8xqfpAOEKRH8yQSGUriMu5/zuPSQ1hg= -github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s= github.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= -github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= -github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= -github.com/go-playground/validator/v10 v10.2.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI= -github.com/go-playground/validator/v10 v10.15.5 h1:LEBecTWb/1j5TNY1YYG2RcOUN3R7NLylN+x8TTueE24= -github.com/go-playground/validator/v10 v10.15.5/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU= +github.com/go-playground/validator/v10 v10.22.0 h1:k6HsTZ0sTnROkhS//R0O+55JgM8C4Bx7ia+JlgcnOao= +github.com/go-playground/validator/v10 v10.22.0/go.mod h1:dbuPbCMFw/DrkbEynArYaCwl3amGuJotoKCe95atGMM= github.com/go-redis/redis/v8 v8.11.5 h1:AcZZR7igkdvfVmQTPnu9WE37LRrO/YrBH5zWyjDC0oI= github.com/go-redis/redis/v8 v8.11.5/go.mod h1:gREzHqY1hg6oD9ngVRbLStwAWKhA0FEgq8Jd4h5lpwo= github.com/go-resty/resty/v2 v2.11.0 h1:i7jMfNOJYMp69lq7qozJP+bjgzfAzeOhuGlyDrqxT/8= @@ -643,9 +626,12 @@ github.com/go-sql-driver/mysql v1.8.1/go.mod h1:wEBSXgmK//2ZFJyE+qWnIsVGmvmEKlqw github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= -github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls= +github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= +github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= github.com/go-test/deep v1.0.4 h1:u2CU3YKy9I2pmu9pX0eq50wCgjfGIt539SqR7FbHiho= github.com/go-test/deep v1.0.4/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= +github.com/go-viper/mapstructure/v2 v2.1.0 h1:gHnMa2Y/pIxElCH2GlZZ1lZSsn6XMtufpGyP1XxdC/w= +github.com/go-viper/mapstructure/v2 v2.1.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= github.com/go-webauthn/webauthn v0.9.4 h1:YxvHSqgUyc5AK2pZbqkWWR55qKeDPhP8zLDr6lpIc2g= github.com/go-webauthn/webauthn v0.9.4/go.mod h1:LqupCtzSef38FcxzaklmOn7AykGKhAhr9xlRbdbgnTw= github.com/go-webauthn/x v0.1.5 h1:V2TCzDU2TGLd0kSZOXdrqDVV5JB9ILnKxA9S53CSBw0= @@ -676,15 +662,6 @@ github.com/gobuffalo/packd v0.1.0/go.mod h1:M2Juc+hhDXf/PnmBANFCqx4DM3wRbgDvnVWe github.com/gobuffalo/packr/v2 v2.0.9/go.mod h1:emmyGweYTm6Kdper+iywB6YK5YzuKchGtJQZ0Odn4pQ= github.com/gobuffalo/packr/v2 v2.2.0/go.mod h1:CaAwI0GPIAv+5wKLtv8Afwl+Cm78K/I/VCm/3ptBN+0= github.com/gobuffalo/syncx v0.0.0-20190224160051-33c29581e754/go.mod h1:HhnNqWY95UYwwW3uSASeV7vtgYkT2t16hJgV3AEPUpw= -github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo= -github.com/gobwas/httphead v0.1.0 h1:exrUm0f4YX0L7EBwZHuCF4GDp8aJfVeBrlLQrs6NqWU= -github.com/gobwas/httphead v0.1.0/go.mod h1:O/RXo79gxV8G+RqlR/otEwx4Q36zl9rqC5u12GKvMCM= -github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= -github.com/gobwas/pool v0.2.1 h1:xfeeEhW7pwmX8nuLVlqbzVc7udMDrwetjEv+TZIz1og= -github.com/gobwas/pool v0.2.1/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= -github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM= -github.com/gobwas/ws v1.2.1 h1:F2aeBZrm2NDsc7vbovKrWSogd4wvfAxg0FQ89/iqOTk= -github.com/gobwas/ws v1.2.1/go.mod h1:hRKAFb8wOxFROYNsT1bqfWnhX+b5MFeJM9r2ZSwg/KY= github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU= github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 h1:ZpnhV/YsD2/4cESfV5+Hoeu/iUR3ruzNvZ+yQfO03a0= @@ -698,18 +675,15 @@ github.com/gofrs/uuid v4.4.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRx github.com/gogo/googleapis v0.0.0-20180223154316-0cd9801be74a/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= github.com/gogo/googleapis v1.4.1 h1:1Yx4Myt7BxzvUr5ldGSbwYiZG6t9wGBZ+8/fX3Wvtq0= github.com/gogo/googleapis v1.4.1/go.mod h1:2lpHqI5OcWCtVElxXnPt+s8oJvMpySlOyM6xDCrzib4= -github.com/gogo/status v1.1.0/go.mod h1:BFv9nrluPLmrS0EmGVvLaPNmRosr9KapBYd5/hpY1WM= github.com/gogo/status v1.1.1 h1:DuHXlSFHNKqTQ+/ACf5Vs6r4X/dH2EgIzR9Vr+H65kg= github.com/gogo/status v1.1.1/go.mod h1:jpG3dM5QPcqu19Hg8lkUhBFBa3TcLs1DG7+2Jqci7oU= -github.com/golang-jwt/jwt v3.2.2+incompatible h1:IfV12K8xAKAnZqdXVzCZ+TOjboZ2keLg81eXfW3O+oY= -github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg= github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= github.com/golang-jwt/jwt/v5 v5.2.0 h1:d/ix8ftRUorsN+5eMIlF4T6J8CAt9rch3My2winC1Jw= github.com/golang-jwt/jwt/v5 v5.2.0/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/glog v1.2.0 h1:uCdmnmatrKCgMBlM4rMuJZWOkPDqdbZPnrMXDY4gI68= -github.com/golang/glog v1.2.0/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w= +github.com/golang/glog v1.2.1 h1:OptwRhECazUx5ix5TTWC3EZhsZEHWcYWY4FQHTIubm4= +github.com/golang/glog v1.2.1/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w= github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -750,15 +724,12 @@ github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEW github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb h1:PBC98N2aIaM3XXiurYmW7fx4GZkL8feAMVq7nEjURHk= github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/gomodule/redigo v1.7.1-0.20190724094224-574c33c3df38/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.1.2 h1:xf4v41cLI2Z6FxbKm+8Bu+m8ifhj15JuZ9sa0jZCMUU= github.com/google/btree v1.1.2/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4= -github.com/google/gnostic v0.6.9 h1:ZK/5VhkoX835RikCHpSUJV9a+S3e1zLh59YnyWeBW+0= -github.com/google/gnostic v0.6.9/go.mod h1:Nm8234We1lq6iB9OmlgNv3nH91XLLVZHCDayfA3xq+E= -github.com/google/gnostic-models v0.6.8 h1:yo/ABAfM5IMRsS1VnXjTBvUb61tFIHozhlYvRgGre9I= -github.com/google/gnostic-models v0.6.8/go.mod h1:5n7qKqH0f5wFt+aWF8CW6pZLLNOfYuF5OpfBSENuI8U= +github.com/google/gnostic-models v0.6.9-0.20230804172637-c7be7c783f49 h1:0VpGH+cDhbDtdcweoyCVsF3fhN8kejK6rFe/2FFX2nU= +github.com/google/gnostic-models v0.6.9-0.20230804172637-c7be7c783f49/go.mod h1:BkkQ4L1KS1xMt2aWSPStnn55ChGC0DPOn2FQYj+f25M= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= @@ -768,16 +739,15 @@ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= +github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-github/v41 v41.0.0 h1:HseJrM2JFf2vfiZJ8anY2hqBjdfY1Vlj/K27ueww4gg= github.com/google/go-github/v41 v41.0.0/go.mod h1:XgmCA5H323A9rtgExdTcnDkcqp6S30AVACCBDOonIxg= -github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= github.com/google/go-tpm v0.9.0 h1:sQF6YqWMi+SCXpsmS3fd21oPy/vSddwZry4JnmltHVk= @@ -788,7 +758,6 @@ github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= -github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/orderedcode v0.0.1 h1:UzfcAexk9Vhv8+9pNOgRu41f16lHq725vPwnSeiG/Us= github.com/google/orderedcode v0.0.1/go.mod h1:iVyU4/qPKHY5h/wSd6rZZCDcLJNxiWO6dvsYES2Sb20= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= @@ -798,12 +767,9 @@ github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20231023181126-ff6d637d2a7b h1:RMpPgZTSApbPf7xaVel+QkoGPRLFLrwFO89uDUHEGf0= -github.com/google/pprof v0.0.0-20231023181126-ff6d637d2a7b/go.mod h1:czg5+yv1E0ZGTi6S6vVK1mke0fV+FaUhNGcd6VRS9Ik= +github.com/google/pprof v0.0.0-20240525223248-4bfdf5a9a2af h1:kmjWCqn2qkEml422C2Rrd27c3VGxi6a/6HNq8QmHRKM= +github.com/google/pprof v0.0.0-20240525223248-4bfdf5a9a2af/go.mod h1:K1liHPHnj73Fdn/EKuT8nrFqBihUSKXoLYU0BuatOYo= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/s2a-go v0.1.7 h1:60BLSyTrOV4/haCDW4zb1guZItoSq8foHCXrAnjBo/o= github.com/google/s2a-go v0.1.7/go.mod h1:50CgR4k1jNlWBu4UfS4AcfhVe1r6pdZPygJ3R8F0Qdw= @@ -812,7 +778,6 @@ github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3 github.com/google/subcommands v1.2.0/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -820,9 +785,8 @@ github.com/googleapis/enterprise-certificate-proxy v0.3.2 h1:Vie5ybvEvT75RniqhfF github.com/googleapis/enterprise-certificate-proxy v0.3.2/go.mod h1:VLSiSSBs/ksPL8kq3OBOQ6WRI2QnaFynd1DCjZ62+V0= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/googleapis/gax-go/v2 v2.12.2 h1:mhN09QQW1jEWeMF74zGR81R30z4VJzjZsfkUhuHF+DA= -github.com/googleapis/gax-go/v2 v2.12.2/go.mod h1:61M8vcyyXR2kqKFxKrfA22jaA8JGF7Dc8App1U3H6jc= -github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= +github.com/googleapis/gax-go/v2 v2.12.3 h1:5/zPPDvw8Q1SuXjrqrZslrqT7dL/uJT2CQii/cLCKqA= +github.com/googleapis/gax-go/v2 v2.12.3/go.mod h1:AKloxT6GtNbaLm8QTNSidHUVsHYcBHwWRvkNFJUQcS4= github.com/gophercloud/gophercloud v1.5.0 h1:cDN6XFCLKiiqvYpjQLq9AiM7RDRbIC9450WpPH+yvXo= github.com/gophercloud/gophercloud v1.5.0/go.mod h1:aAVqcocTSXh2vYFZ1JTvx4EQmfgzxRcNupUfxZbBNDM= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= @@ -837,7 +801,6 @@ github.com/gorilla/securecookie v1.1.2 h1:YCIWL56dvtr73r6715mJs5ZvhtnY73hBvEF8kX github.com/gorilla/securecookie v1.1.2/go.mod h1:NfCASbcHqRSY+3a8tlWJwsQap2VX5pwzwo4h3eOamfo= github.com/gorilla/sessions v1.2.2 h1:lqzMYz6bOfvn2WriPUjNByzeXIlVzURcPmgMczkmTjY= github.com/gorilla/sessions v1.2.2/go.mod h1:ePLdVu+jbEgHH+KWw8I1z2wqd0BAdAQh/8LRvBeoNcQ= -github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY= github.com/gorilla/websocket v1.5.1/go.mod h1:x3kM2JMyaluk02fnUJpQuwD2dCS5NDG2ZHL0uE0tcaY= @@ -855,16 +818,16 @@ github.com/grafana/loki v1.6.2-0.20231215164305-b51b7d7b5503 h1:gdrsYbmk8822v6qv github.com/grafana/loki v1.6.2-0.20231215164305-b51b7d7b5503/go.mod h1:d8seWXCEXkL42mhuIJYcGi6DxfehzoIpLrMQWJojvOo= github.com/grafana/loki/pkg/push v0.0.0-20231201111602-11ef833ed3e4 h1:wQ0FnSeebhJIBkgYOD06Mxk9HV2KhtEG0hp/7R+5RUQ= github.com/grafana/loki/pkg/push v0.0.0-20231201111602-11ef833ed3e4/go.mod h1:f3JSoxBTPXX5ec4FxxeC19nTBSxoTz+cBgS3cYLMcr0= -github.com/grafana/pyroscope-go v1.1.1 h1:PQoUU9oWtO3ve/fgIiklYuGilvsm8qaGhlY4Vw6MAcQ= -github.com/grafana/pyroscope-go v1.1.1/go.mod h1:Mw26jU7jsL/KStNSGGuuVYdUq7Qghem5P8aXYXSXG88= -github.com/grafana/pyroscope-go/godeltaprof v0.1.6 h1:nEdZ8louGAplSvIJi1HVp7kWvFvdiiYg3COLlTwJiFo= -github.com/grafana/pyroscope-go/godeltaprof v0.1.6/go.mod h1:Tk376Nbldo4Cha9RgiU7ik8WKFkNpfds98aUzS8omLE= +github.com/grafana/pyroscope-go v1.1.2 h1:7vCfdORYQMCxIzI3NlYAs3FcBP760+gWuYWOyiVyYx8= +github.com/grafana/pyroscope-go v1.1.2/go.mod h1:HSSmHo2KRn6FasBA4vK7BMiQqyQq8KSuBKvrhkXxYPU= +github.com/grafana/pyroscope-go/godeltaprof v0.1.8 h1:iwOtYXeeVSAeYefJNaxDytgjKtUuKQbJqgAIjlnicKg= +github.com/grafana/pyroscope-go/godeltaprof v0.1.8/go.mod h1:2+l7K7twW49Ct4wFluZD3tZ6e0SjanjcUUBPVD/UuGU= github.com/grafana/regexp v0.0.0-20221122212121-6b5c0a4cb7fd h1:PpuIBO5P3e9hpqBD0O/HjhShYuM6XE0i/lbE6J94kww= github.com/grafana/regexp v0.0.0-20221122212121-6b5c0a4cb7fd/go.mod h1:M5qHK+eWfAv8VR/265dIuEpL3fNfeC21tXXp9itM24A= github.com/graph-gophers/dataloader v5.0.0+incompatible h1:R+yjsbrNq1Mo3aPG+Z/EKYrXrXXUNJHOgbRt+U6jOug= github.com/graph-gophers/dataloader v5.0.0+incompatible/go.mod h1:jk4jk0c5ZISbKaMe8WsVopGB5/15GvGHMdMdPtwlRp4= -github.com/graph-gophers/graphql-go v1.3.0 h1:Eb9x/q6MFpCLz7jBCiP/WTxjSDrYLR1QY41SORZyNJ0= -github.com/graph-gophers/graphql-go v1.3.0/go.mod h1:9CQHMSxwO4MprSdzoIEobiHpoLtHm77vfxsvsIN5Vuc= +github.com/graph-gophers/graphql-go v1.5.0 h1:fDqblo50TEpD0LY7RXk/LFVYEVqo3+tXMNMPSVXA1yc= +github.com/graph-gophers/graphql-go v1.5.0/go.mod h1:YtmJZDLbF1YYNrlNAuiO5zAStUWc3XZT07iGsVqe1Os= github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79 h1:+ngKgrYPPJrOjhax5N+uePQ0Fh1Z7PheYoUI/0nzkPA= github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= @@ -878,8 +841,8 @@ github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgf github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 h1:bkypFPDjIYGfCYD5mRBvpqxfYX1YCS1PXdKYWi8FsN0= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0/go.mod h1:P+Lt/0by1T8bfcF3z737NnSbmxQAppXMRziHUxPOC8k= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0 h1:asbCHRVmodnJTuQ3qamDwqVOIjwqUPTYmYuemVOx+Ys= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0/go.mod h1:ggCgvZ2r7uOoQjOyu2Y1NhHmEPPzzuhWgcza5M1Ji1I= github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645/go.mod h1:6iZfnjpejD4L/4DwD7NryNaJyCQdzwWwH2MWhCA90Kw= github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c h1:6rhixN/i8ZofjG1Y75iExal34USq5p+wiN1tpie8IrU= github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c/go.mod h1:NMPJylDgVpX0MLRlPy15sqSwOFv/U1GZ2m21JhFfek0= @@ -889,8 +852,8 @@ github.com/gtank/merlin v0.1.1/go.mod h1:T86dnYJhcGOh5BjZFCJWTDeTK7XW8uE+E21Cy/b github.com/gtank/ristretto255 v0.1.2 h1:JEqUCPA1NvLq5DwYtuzigd7ss8fwbYay9fi4/5uMzcc= github.com/gtank/ristretto255 v0.1.2/go.mod h1:Ph5OpO6c7xKUGROZfWVLiJf9icMDwUeIvY4OmlYW69o= github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= -github.com/hashicorp/consul/api v1.25.1 h1:CqrdhYzc8XZuPnhIYZWH45toM0LB9ZeYr/gvpLVI3PE= -github.com/hashicorp/consul/api v1.25.1/go.mod h1:iiLVwR/htV7mas/sy0O+XSuEnrdBUUydemjxcUrAt4g= +github.com/hashicorp/consul/api v1.28.2 h1:mXfkRHrpHN4YY3RqL09nXU1eHKLNiuAN4kHvDQ16k/8= +github.com/hashicorp/consul/api v1.28.2/go.mod h1:KyzqzgMEya+IZPcD65YFoOVAgPpbfERu4I/tzG6/ueE= github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= github.com/hashicorp/consul/sdk v0.16.0 h1:SE9m0W6DEfgIVCJX7xU+iv/hUl4m/nxqMTnCdMxDpJ8= github.com/hashicorp/consul/sdk v0.16.0/go.mod h1:7pxqqhqoaPqnBnzXD1StKed62LqJeClzVsUEy85Zr0A= @@ -922,6 +885,8 @@ github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHh github.com/hashicorp/go-multierror v1.1.0/go.mod h1:spPvp8C1qA32ftKqdAHm4hHTbPw+vmowP0z+KUhOZdA= github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= +github.com/hashicorp/go-plugin v1.6.2-0.20240829161738-06afb6d7ae99 h1:OSQYEsRT3tRttZkk6zyC3aAaliwd7Loi/KgXgXxGtwA= +github.com/hashicorp/go-plugin v1.6.2-0.20240829161738-06afb6d7ae99/go.mod h1:CkgLQ5CZqNmdL9U9JzM532t8ZiYQ35+pj3b1FD37R0Q= github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= github.com/hashicorp/go-retryablehttp v0.7.5 h1:bJj+Pj19UZMIweq/iie+1u5YCdGrnxCT9yvm0e+Nd5M= github.com/hashicorp/go-retryablehttp v0.7.5/go.mod h1:Jy/gPYAdjqffZ/yFGCFV2doI5wjtH1ewM9u8iYVjtX8= @@ -938,7 +903,6 @@ github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/b github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8= github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek= github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= @@ -982,13 +946,11 @@ github.com/huandu/xstrings v1.4.0 h1:D17IlohoQq4UcpqD7fDk80P7l+lwAmlFaBHgOipl2FU github.com/huandu/xstrings v1.4.0/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/huin/goupnp v1.3.0 h1:UvLUlWDNpoUdYzb2TCn+MuTWtcjXKSza2n6CBdQ0xXc= github.com/huin/goupnp v1.3.0/go.mod h1:gnGPsThkYa7bFi/KWmEysQRf48l2dvR5bxr2OFckNX8= -github.com/hydrogen18/memlistener v0.0.0-20200120041712-dcc25e7acd91/go.mod h1:qEIFzExnS6016fRpRfxrExeVn2gbClQA99gQhnIcdhE= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/imdario/mergo v0.3.16 h1:wwQJbIsHYGMUyLSPrEq1CT16AhnhNJQ51+4fdHUnCl4= github.com/imdario/mergo v0.3.16/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+hD27ysY= -github.com/imkira/go-interpol v1.1.0/go.mod h1:z0h2/2T3XF8kyEPpRgJ3kmNv+C43p+I/CoI+jC3w2iA= github.com/improbable-eng/grpc-web v0.15.0 h1:BN+7z6uNXZ1tQGcNAuaU1YjsLTApzkjt2tzCixLaUPQ= github.com/improbable-eng/grpc-web v0.15.0/go.mod h1:1sy9HKV4Jt9aEs9JSnkWlRJPuPtwNr0l57L4f878wP8= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= @@ -998,11 +960,6 @@ github.com/invopop/jsonschema v0.12.0 h1:6ovsNSuvn9wEQVOyc72aycBMVQFKz7cPdMJn10C github.com/invopop/jsonschema v0.12.0/go.mod h1:ffZ5Km5SWWRAIN6wbDXItl95euhFz2uON45H2qjYt+0= github.com/ionos-cloud/sdk-go/v6 v6.1.8 h1:493wE/BkZxJf7x79UCE0cYGPZoqQcPiEBALvt7uVGY0= github.com/ionos-cloud/sdk-go/v6 v6.1.8/go.mod h1:EzEgRIDxBELvfoa/uBN0kOQaqovLjUWEB7iW4/Q+t4k= -github.com/iris-contrib/blackfriday v2.0.0+incompatible/go.mod h1:UzZ2bDEoaSGPbkg6SAB4att1aAwTmVIx/5gCVqeyUdI= -github.com/iris-contrib/go.uuid v2.0.0+incompatible/go.mod h1:iz2lgM/1UnEf1kP0L/+fafWORmlnuysV2EMP8MW+qe0= -github.com/iris-contrib/jade v1.1.3/go.mod h1:H/geBymxJhShH5kecoiOCSssPX7QWYH7UaeZTSWddIk= -github.com/iris-contrib/pongo2 v0.0.1/go.mod h1:Ssh+00+3GAZqSQb30AvBRNxBx7rf0GqwkjqxNd0u65g= -github.com/iris-contrib/schema v0.0.1/go.mod h1:urYA3uvUNG1TIIjOSCzHr9/LmbQo8LrOcOqfqxa4hXw= github.com/jackc/chunkreader v1.0.0/go.mod h1:RT6O25fNZIuasFJRyZ4R/Y2BbhasbmZXF9QQ7T3kePo= github.com/jackc/chunkreader/v2 v2.0.0/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk= github.com/jackc/chunkreader/v2 v2.0.1 h1:i+RDz65UE+mmpjTfyz0MoVTnzeYxroil2G82ki7MGG8= @@ -1075,38 +1032,24 @@ github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFF github.com/jpillora/backoff v1.0.0 h1:uvFg412JmmHBHw7iwprIxkPMI+sGQ4kzOWsMeHnm2EA= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= -github.com/json-iterator/go v1.1.9/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.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= -github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/julienschmidt/httprouter v1.3.0 h1:U0609e9tgbseu3rBINet9P48AI/D3oJs4dN7jwJOQ1U= github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= -github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88/go.mod h1:3w7q1U84EfirKl04SVQ/s7nPm1ZPhiXd34z40TNz36k= github.com/karrick/godirwalk v1.8.0/go.mod h1:H5KPZjojv4lE+QYImBI8xVtrBRgYrIVsaRPx4tDPEn4= github.com/karrick/godirwalk v1.10.3/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0LhBygSwrAsHA= -github.com/kataras/golog v0.0.10/go.mod h1:yJ8YKCmyL+nWjERB90Qwn+bdyBZsaQwU3bTVFgkFIp8= -github.com/kataras/iris/v12 v12.1.8/go.mod h1:LMYy4VlP67TQ3Zgriz8RE2h2kMZV2SgMYbq3UhfoFmE= -github.com/kataras/neffos v0.0.14/go.mod h1:8lqADm8PnbeFfL7CLXh1WHw53dG27MC3pgi2R1rmoTE= -github.com/kataras/pio v0.0.2/go.mod h1:hAoW0t9UmXi4R5Oyq5Z4irTbaTsOemSrDGUtaTl7Dro= -github.com/kataras/sitemap v0.0.5/go.mod h1:KY2eugMKiPwsJgx7+U103YZehfvNGOXURubcGyk0Bz8= github.com/kelseyhightower/envconfig v1.4.0 h1:Im6hONhd3pLkfDFsbRgu68RDNkGF1r3dvMUtDTo2cv8= github.com/kelseyhightower/envconfig v1.4.0/go.mod h1:cccZRl6mQpaq41TPp5QxidR+Sa3axMbJDNb//FQX6Gg= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.8.2/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= -github.com/klauspost/compress v1.9.7/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= -github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.11.4/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= -github.com/klauspost/compress v1.17.3 h1:qkRjuerhUU1EmXLYGkSH6EZL+vPSxIrYjLNAK4slzwA= -github.com/klauspost/compress v1.17.3/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= -github.com/klauspost/cpuid v1.2.1/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= +github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA= +github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/klauspost/cpuid/v2 v2.2.5 h1:0E5MSMDEoAulmXNFquVs//DdoomxaoTY1kUhbc/qbZg= github.com/klauspost/cpuid/v2 v2.2.5/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= @@ -1115,13 +1058,9 @@ github.com/kolo/xmlrpc v0.0.0-20220921171641-a4b6fa1dd06b h1:udzkj9S/zlT5X367kqJ github.com/kolo/xmlrpc v0.0.0-20220921171641-a4b6fa1dd06b/go.mod h1:pcaDhQK0/NJZEvtCO0qQPPropqV0sJOJ6YW7X+9kRwM= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= @@ -1131,13 +1070,10 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/labstack/echo/v4 v4.5.0/go.mod h1:czIriw4a0C1dFun+ObrXp7ok03xON0N1awStJ6ArI7Y= -github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL7NoOu+k= github.com/leanovate/gopter v0.2.10-0.20210127095200-9abe2343507a h1:dHCfT5W7gghzPtfsW488uPmEOm85wewI+ypUwibyTdU= github.com/leanovate/gopter v0.2.10-0.20210127095200-9abe2343507a/go.mod h1:U2L/78B+KVFIx2VmW6onHJQzXtFb+p5y3y2Sh+Jxxv8= -github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= -github.com/leodido/go-urn v1.2.4 h1:XlAE/cm/ms7TE/VMVoduSpNBoyc2dOxHs5MZSwAN63Q= -github.com/leodido/go-urn v1.2.4/go.mod h1:7ZrI8mTSeBSHl/UaRyKQW1qZeMgak41ANeCNaVckg+4= +github.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ= +github.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI= github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.1.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= @@ -1150,6 +1086,8 @@ github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de h1:9TO3cAIGXtEhn github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de/go.mod h1:zAbeS9B/r2mtpb6U+EI2rYA5OAXxsYw6wTamcNW+zcE= github.com/linode/linodego v1.19.0 h1:n4WJrcr9+30e9JGZ6DI0nZbm5SdAj1kSwvvt/998YUw= github.com/linode/linodego v1.19.0/go.mod h1:XZFR+yJ9mm2kwf6itZ6SCpu+6w3KnIevV0Uu5HNWJgQ= +github.com/linxGnu/grocksdb v1.7.16 h1:Q2co1xrpdkr5Hx3Fp+f+f7fRGhQFQhvi/+226dtLmA8= +github.com/linxGnu/grocksdb v1.7.16/go.mod h1:JkS7pl5qWpGpuVb3bPqTz8nC12X3YtPZT+Xq7+QfQo4= github.com/logrusorgru/aurora v2.0.3+incompatible h1:tOpm7WcpBTn4fjmVfgpQq0EfczGlG91VSDkswnjF5A8= github.com/logrusorgru/aurora v2.0.3+incompatible/go.mod h1:7rIyQOR62GCctdiQpZ/zOJlFyk6y+94wXzv6RNZgaR4= github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 h1:6E+4a0GO5zZEnZ81pIr0yLvtUWk2if982qA3F3QD6H4= @@ -1171,12 +1109,9 @@ github.com/markbates/oncer v0.0.0-20181203154359-bf2de49a0be2/go.mod h1:Ld9puTsI github.com/markbates/safe v1.0.1/go.mod h1:nAqgmRi7cY2nqMc92/bSEeQA+R4OheNU2T1kNSCBdG0= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= -github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-colorable v0.1.11/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= @@ -1184,7 +1119,6 @@ github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNx github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= @@ -1198,14 +1132,11 @@ github.com/mattn/go-runewidth v0.0.14/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh github.com/mattn/go-sqlite3 v1.14.22/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y= github.com/mattn/go-sqlite3 v2.0.3+incompatible h1:gXHsfypPkaMZrKbD5209QV9jbUTJKjyR5WD3HYQSd+U= github.com/mattn/go-sqlite3 v2.0.3+incompatible/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= -github.com/mattn/goveralls v0.0.2/go.mod h1:8d1ZMHsd7fW6IRPKQh46F2WRpyib5/X4FOpevwGNQEw= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 h1:jWpvCLoY8Z/e3VKvlsiIGKtc+UG6U5vzxaoagmhXfyg= -github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0/go.mod h1:QUyp042oQthUoa9bqDv0ER0wrtXnBruoNd7aNjkbP+k= -github.com/mediocregopher/radix/v3 v3.4.2/go.mod h1:8FL3F6UQRXHXIBSPUs5h0RybMF8i4n7wVopoX3x7Bv8= +github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= +github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= github.com/mfridman/interpolate v0.0.2 h1:pnuTK7MQIxxFz1Gr+rjSIx9u7qVjf5VOoM/u6BbAxPY= github.com/mfridman/interpolate v0.0.2/go.mod h1:p+7uk6oE07mpE/Ik1b8EckO0O4ZXiGAfshKBWLUM9Xg= -github.com/microcosm-cc/bluemonday v1.0.2/go.mod h1:iVP4YcDBq+n/5fb23BhYFvIMq/leAFZyRl6bYmGDlGc= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI= @@ -1248,8 +1179,8 @@ github.com/mmcloughlin/addchain v0.4.0/go.mod h1:A86O+tHqZLMNO4w6ZZ4FlVQEadcoqky github.com/mmcloughlin/profile v0.1.1/go.mod h1:IhHD7q1ooxgwTgjxQYkACGA77oFTDdFVejUS1/tS/qU= github.com/moby/patternmatcher v0.6.0 h1:GmP9lR19aU5GqSSFko+5pRqHi+Ohk1O69aFiKkVGiPk= github.com/moby/patternmatcher v0.6.0/go.mod h1:hDPoyOpDY7OrrMDLaYoY3hf52gNCR/YOUYxkhApJIxc= -github.com/moby/spdystream v0.2.0 h1:cjW1zVyyoiM0T7b6UoySUFqzXMoqRckQtXwGPiBhOM8= -github.com/moby/spdystream v0.2.0/go.mod h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0GqbN2Wy8c= +github.com/moby/spdystream v0.4.0 h1:Vy79D6mHeJJjiPdFEL2yku1kl0chZpJfZcPpb16BRl8= +github.com/moby/spdystream v0.4.0/go.mod h1:xBAYlnt/ay+11ShkdFKNAG7LsyK/tmNBVvVOwrfMgdI= github.com/moby/sys/sequential v0.5.0 h1:OPvI35Lzn9K04PBbCLW0g4LcFAJgHsvXsRyewg5lXtc= github.com/moby/sys/sequential v0.5.0/go.mod h1:tH2cOOs5V9MlPiXcQzRC+eEyab644PWKGRYaaV5ZZlo= github.com/moby/sys/user v0.1.0 h1:WmZ93f5Ux6het5iituh9x2zAG7NFY9Aqi49jjE1PaQg= @@ -1259,7 +1190,6 @@ github.com/moby/term v0.5.0/go.mod h1:8FzsFHVUBGZdbDsJw/ot+X+d5HLUbvklYLJ9uGfcI3 github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= @@ -1272,20 +1202,14 @@ github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A= github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= github.com/mostynb/zstdpool-freelist v0.0.0-20201229113212-927304c0c3b1 h1:mPMvm6X6tf4w8y7j9YIt6V9jfWhL6QlbEc7CCmeQlWk= github.com/mostynb/zstdpool-freelist v0.0.0-20201229113212-927304c0c3b1/go.mod h1:ye2e/VUEtE2BHE+G/QcKkcLQVAEJoYRFj5VUOQatCRE= -github.com/moul/http2curl v1.0.0/go.mod h1:8UbvGypXm98wA/IqH45anm5Y2Z6ep6O31QGOAZ3H0fQ= github.com/mr-tron/base58 v1.2.0 h1:T/HDJBh4ZCPbU39/+c3rRvE0uKBQlU27+QI8LJ4t64o= github.com/mr-tron/base58 v1.2.0/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= github.com/mtibben/percent v0.2.1 h1:5gssi8Nqo8QU/r2pynCm+hBQHpkB/uNK7BJCFogWdzs= github.com/mtibben/percent v0.2.1/go.mod h1:KG9uO+SZkUp+VkRHsCdYQV3XSZrrSpR3O9ibNBTZrns= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= -github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f h1:KUppIJq7/+SVif2QVs3tOP0zanoHgBEVAwHxUSIzRqU= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5VglpSg= -github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzEE/Zbp4w= -github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= -github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nkovacs/streamquote v0.0.0-20170412213628-49af9bddb229/go.mod h1:0aYXnNPJ8l7uZxf45rWW1a/uME32OF0rhiYGNQ2oF2E= github.com/nsf/jsondiff v0.0.0-20210926074059-1e845ec5d249 h1:NHrXEjTNQY7P0Zfx1aMrNhpgxHmow66XQtm0aQLY0AE= @@ -1300,24 +1224,23 @@ github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= -github.com/onsi/ginkgo/v2 v2.13.0 h1:0jY9lJquiL8fcf3M4LAXN5aMlS/b2BV86HFFPCPMgE4= -github.com/onsi/ginkgo/v2 v2.13.0/go.mod h1:TE309ZR8s5FsKKpuB1YAQYBzCaAfUgatB/xlT/ETL/o= +github.com/onsi/ginkgo/v2 v2.17.2 h1:7eMhcy3GimbsA3hEnVKdw/PQM9XN9krpKVXsZdph0/g= +github.com/onsi/ginkgo/v2 v2.17.2/go.mod h1:nP2DPOQoNsQmsVyv5rDA8JkXQoCs6goXIvr/PRJ1eCc= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= -github.com/onsi/gomega v1.30.0 h1:hvMK7xYz4D3HapigLTeGdId/NcfQx1VHMJc60ew99+8= -github.com/onsi/gomega v1.30.0/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ= +github.com/onsi/gomega v1.33.1 h1:dsYjIxxSR755MDmKVsaFQTE22ChNBcuuTWgkUDSubOk= +github.com/onsi/gomega v1.33.1/go.mod h1:U4R44UsT+9eLIaYRB2a5qajjtQYn0hauxvRm16AVYg0= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= -github.com/opencontainers/image-spec v1.1.0-rc5 h1:Ygwkfw9bpDvs+c9E34SdgGOj41dX/cbdlwvlWt0pnFI= -github.com/opencontainers/image-spec v1.1.0-rc5/go.mod h1:X4pATf0uXsnn3g5aiGIsVnJBR4mxhKzfwmvK/B2NTm8= +github.com/opencontainers/image-spec v1.1.0 h1:8SG7/vwALn54lVB/0yZ/MMwhFrPYtpEHQb2IpWsCzug= +github.com/opencontainers/image-spec v1.1.0/go.mod h1:W4s4sFTMaBeK1BQLXbG4AdM2szdn85PY75RI83NrTrM= github.com/opencontainers/runc v1.1.10 h1:EaL5WeO9lv9wmS6SASjszOeQdSctvpbu0DdBQBizE40= github.com/opencontainers/runc v1.1.10/go.mod h1:+/R6+KmDlh+hOO8NkjmgkG9Qzvypzk0yXxAPYYR65+M= github.com/opentracing-contrib/go-grpc v0.0.0-20210225150812-73cb765af46e h1:4cPxUYdgaGzZIT5/j0IfqOrrXmq6bG8AwvwisMXpdrg= @@ -1364,7 +1287,6 @@ github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= @@ -1376,54 +1298,28 @@ github.com/pressly/goose/v3 v3.21.1 h1:5SSAKKWej8LVVzNLuT6KIvP1eFDuPvxa+B6H0w78b github.com/pressly/goose/v3 v3.21.1/go.mod h1:sqthmzV8PitchEkjecFJII//l43dLOCzfWh8pHEe+vE= github.com/prometheus/alertmanager v0.26.0 h1:uOMJWfIwJguc3NaM3appWNbbrh6G/OjvaHMk22aBBYc= github.com/prometheus/alertmanager v0.26.0/go.mod h1:rVcnARltVjavgVaNnmevxK7kOn7IZavyf0KNgHkbEpU= -github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= -github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= -github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= -github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= -github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= -github.com/prometheus/client_golang v1.17.0 h1:rl2sfwZMtSthVU752MqfjQozy7blglC+1SOtjMAMh+Q= -github.com/prometheus/client_golang v1.17.0/go.mod h1:VeL+gMmOAxkS2IqfCq0ZmHSL+LjWfWDUmp1mBz9JgUY= -github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= -github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_golang v1.14.0 h1:nJdhIvne2eSX/XRAFV9PcvFFRbrjbcTUj0VP62TMhnw= +github.com/prometheus/client_golang v1.14.0/go.mod h1:8vpkKitgIVNcqrRBWh1C4TIUQgYNtG/XQE4E/Zae36Y= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.5.0 h1:VQw1hfvPvk3Uv6Qf29VrPF32JB6rtbgI6cYPYQjL0Qw= -github.com/prometheus/client_model v0.5.0/go.mod h1:dTiFglRmd66nLR9Pv9f0mZi7B7fk5Pm3gvsjB5tr+kI= -github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= -github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= -github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= -github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= -github.com/prometheus/common v0.29.0/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= -github.com/prometheus/common v0.45.0 h1:2BGz0eBc2hdMDLnO/8n0jeB3oPrt2D08CekT0lneoxM= -github.com/prometheus/common v0.45.0/go.mod h1:YJmSTw9BoKxJplESWWxlbyttQR4uaEcGyv9MZjVOJsY= +github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w= +github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= +github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= +github.com/prometheus/common v0.42.0 h1:EKsfXEYo4JpWMHH5cg+KOUWeuJSov1Id8zGR8eeI1YM= +github.com/prometheus/common v0.42.0/go.mod h1:xBwqVerjNdUDjgODMpudtOMwlOwf2SaTr1yjz4b7Zbc= github.com/prometheus/common/sigv4 v0.1.0 h1:qoVebwtwwEhS85Czm2dSROY5fTo2PAPEVdDeppTwGX4= github.com/prometheus/common/sigv4 v0.1.0/go.mod h1:2Jkxxk9yYvCkE5G1sQT7GuEXm57JrvHu9k5YwTjsNtI= github.com/prometheus/exporter-toolkit v0.10.1-0.20230714054209-2f4150c63f97 h1:oHcfzdJnM/SFppy2aUlvomk37GI33x9vgJULihE5Dt8= github.com/prometheus/exporter-toolkit v0.10.1-0.20230714054209-2f4150c63f97/go.mod h1:LoBCZeRh+5hX+fSULNyFnagYlQG/gBsyA/deNzROkq8= -github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= -github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= -github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= +github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4= +github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= +github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/prometheus/prometheus v0.47.2-0.20231010075449-4b9c19fe5510 h1:6ksZ7t1hNOzGPPs8DK7SvXQf6UfWzi+W5Z7PCBl8gx4= github.com/prometheus/prometheus v0.47.2-0.20231010075449-4b9c19fe5510/go.mod h1:UC0TwJiF90m2T3iYPQBKnGu8gv3s55dF/EgpTq8gyvo= -github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= -github.com/pyroscope-io/client v0.7.1 h1:yFRhj3vbgjBxehvxQmedmUWJQ4CAfCHhn+itPsuWsHw= -github.com/pyroscope-io/client v0.7.1/go.mod h1:4h21iOU4pUOq0prKyDlvYRL+SCKsBc5wKiEtV+rJGqU= -github.com/pyroscope-io/godeltaprof v0.1.2 h1:MdlEmYELd5w+lvIzmZvXGNMVzW2Qc9jDMuJaPOR75g4= -github.com/pyroscope-io/godeltaprof v0.1.2/go.mod h1:psMITXp90+8pFenXkKIpNhrfmI9saQnPbba27VIaiQE= github.com/rakyll/statik v0.1.7 h1:OF3QCZUuyPxuGEP7B4ypUa7sB/iHtqOTDYZXGM8KOdQ= github.com/rakyll/statik v0.1.7/go.mod h1:AlZONWzMtEnMs7W4e/1LURLiI49pIMmp6V9Unghqrcc= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= -github.com/regen-network/gocuke v0.6.2 h1:pHviZ0kKAq2U2hN2q3smKNxct6hS0mGByFMHGnWA97M= -github.com/regen-network/gocuke v0.6.2/go.mod h1:zYaqIHZobHyd0xOrHGPQjbhGJsuZ1oElx150u2o1xuk= github.com/regen-network/protobuf v1.3.3-alpha.regen.1 h1:OHEc+q5iIAXpqiqFKeLpu5NwTIkVXUs48vFMwzqpqY4= github.com/regen-network/protobuf v1.3.3-alpha.regen.1/go.mod h1:2DjTFR1HhMQhiWC5sZ4OhQ3+NtdbZ6oBDKQwq5Ou+FI= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= @@ -1436,8 +1332,6 @@ github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6L github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.2.2/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= -github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= @@ -1447,16 +1341,18 @@ github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= github.com/rs/zerolog v1.13.0/go.mod h1:YbFCdg8HfsridGWAh22vktObvhZbQsZXe4/zB0OKkWU= github.com/rs/zerolog v1.15.0/go.mod h1:xYTKnLHcpfU2225ny5qZjxnj9NvkumZYjJHlAThCjNc= -github.com/rs/zerolog v1.31.0 h1:FcTR3NnLWW+NnTwwhFWiJSZr4ECLpqCm6QsEnyvbV4A= -github.com/rs/zerolog v1.31.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= +github.com/rs/zerolog v1.33.0 h1:1cU2KZkvPxNyfgEmhHAz/1A9Bz+llsdYzklWFzgp0r8= +github.com/rs/zerolog v1.33.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= -github.com/russross/blackfriday v1.6.0 h1:KqfZb0pUVN2lYqZUYRddxF4OR8ZMURnJIG5Y3VRLtww= -github.com/russross/blackfriday v1.6.0/go.mod h1:ti0ldHuxg49ri4ksnFxlkCfN+hvslNlmVHqNRXXJNAY= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= +github.com/sagikazarmark/locafero v0.4.0 h1:HApY1R9zGo4DBgr7dqsTH/JJxLTTsOt7u6keLGt6kNQ= +github.com/sagikazarmark/locafero v0.4.0/go.mod h1:Pe1W6UlPYUk/+wc/6KFhbORCfqzgYEpgQ3O5fPuL3H4= +github.com/sagikazarmark/slog-shim v0.1.0 h1:diDBnUNK9N/354PgrxMywXnAwEr1QZcOr6gto+ugjYE= +github.com/sagikazarmark/slog-shim v0.1.0/go.mod h1:SrcSrq8aKtyuqEI1uvTDTK1arOWRIczQRv+GVI1AkeQ= github.com/santhosh-tekuri/jsonschema/v5 v5.3.1 h1:lZUw3E0/J3roVtGQ+SCrUrg3ON6NgVqpn3+iol9aGu4= github.com/santhosh-tekuri/jsonschema/v5 v5.3.1/go.mod h1:uToXkOrWAZ6/Oc07xWQrPOhJotwFIyu2bBVN41fcDUY= github.com/sasha-s/go-deadlock v0.3.1 h1:sqv7fDNShgjcaxkO0JNcOAlr8B9+cV5Ey/OB71efZx0= @@ -1464,7 +1360,6 @@ github.com/sasha-s/go-deadlock v0.3.1/go.mod h1:F73l+cr82YSh10GxyRI6qZiCgK64VaZj github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= github.com/scaleway/scaleway-sdk-go v1.0.0-beta.20 h1:a9hSJdJcd16e0HoMsnFvaHvxB3pxSD+SC7+CISp7xY0= github.com/scaleway/scaleway-sdk-go v1.0.0-beta.20/go.mod h1:fCa7OJZ/9DRTnOKmxvT6pn+LPWUptQAmHF/SBJUGEcg= -github.com/schollz/closestmatch v2.1.0+incompatible/go.mod h1:RtP1ddjLong6gTkbtmuhtR2uUrrJOpYzYRvbcPAid+g= github.com/scylladb/go-reflectx v1.0.1 h1:b917wZM7189pZdlND9PbIJ6NQxfDPfBvUaQ7cjj1iZQ= github.com/scylladb/go-reflectx v1.0.1/go.mod h1:rWnOfDIRWBGN0miMLIcoPt/Dhi2doCMZqwMCJ3KupFc= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 h1:nn5Wsu0esKSJiIVhscUtVbo7ada43DJhG55ua/hjS5I= @@ -1473,7 +1368,6 @@ github.com/segmentio/ksuid v1.0.4 h1:sBo2BdShXjmcugAMwjugoGUdUV0pcxY5mW4xKRn3v4c github.com/segmentio/ksuid v1.0.4/go.mod h1:/XUiZBD3kVx5SmUOl55voK5yeAbBNNIed+2O73XgrPE= github.com/sercand/kuberesolver/v5 v5.1.1 h1:CYH+d67G0sGBj7q5wLK61yzqJJ8gLLC8aeprPTHb6yY= github.com/sercand/kuberesolver/v5 v5.1.1/go.mod h1:Fs1KbKhVRnB2aDWN12NjKCB+RgYMWZJ294T3BtmVCpQ= -github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/sergi/go-diff v1.3.1 h1:xkr+Oxo4BOQKmkn/B9eMK0g5Kg/983T9DqqPHwYqD+8= github.com/sergi/go-diff v1.3.1/go.mod h1:aMJSSKb2lpPvRNec0+w3fl7LP9IOFzdc9Pa4NFbPK1I= github.com/sethvargo/go-retry v0.2.4 h1:T+jHEQy/zKJf5s95UkguisicE0zuF9y7+/vgz08Ocec= @@ -1488,54 +1382,55 @@ github.com/shoenig/test v0.6.4 h1:kVTaSd7WLz5WZ2IaoM0RSzRsUD+m8wRR+5qvntpn4LU= github.com/shoenig/test v0.6.4/go.mod h1:byHiCGXqrVaflBLAMq/srcZIHynQPQgeyvkvXnjqq0k= github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4= github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= -github.com/shopspring/decimal v1.3.1 h1:2Usl1nmF/WZucqkFZhnfFYxxxu8LG21F6nPQBE5gKV8= github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= +github.com/shopspring/decimal v1.4.0 h1:bxl37RwXBklmTi0C79JfXCEBD1cqqHt0bbgBAGFp81k= +github.com/shopspring/decimal v1.4.0/go.mod h1:gawqmDU56v4yIKSwfBSFip1HdCCXN8/+DMd9qYNcwME= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= -github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= -github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/slack-go/slack v0.12.2 h1:x3OppyMyGIbbiyFhsBmpf9pwkUzMhthJMRNmNlA4LaQ= github.com/slack-go/slack v0.12.2/go.mod h1:hlGi5oXA+Gt+yWTPP0plCdRKmjsDxecdHxYQdlMQKOw= -github.com/smartcontractkit/chain-selectors v1.0.10 h1:t9kJeE6B6G+hKD0GYR4kGJSCqR1LNS7aI3jT0V+xGrg= -github.com/smartcontractkit/chain-selectors v1.0.10/go.mod h1:d4Hi+E1zqjy9HqMkjBE5q1vcG9VGgxf5VxiRHfzi2kE= +github.com/smartcontractkit/chain-selectors v1.0.23 h1:D2Eaex4Cw/O7Lg3tX6WklOqnjjIQAEBnutCtksPzVDY= +github.com/smartcontractkit/chain-selectors v1.0.23/go.mod h1:d4Hi+E1zqjy9HqMkjBE5q1vcG9VGgxf5VxiRHfzi2kE= github.com/smartcontractkit/chainlink-automation v1.0.4 h1:iyW181JjKHLNMnDleI8umfIfVVlwC7+n5izbLSFgjw8= github.com/smartcontractkit/chainlink-automation v1.0.4/go.mod h1:u4NbPZKJ5XiayfKHD/v3z3iflQWqvtdhj13jVZXj/cM= -github.com/smartcontractkit/chainlink-common v0.1.7-0.20240709155552-d76403db14e5 h1:1J1M+rpMJn+5R4EPaU8hbCqR17PFClEBOJyazsvbWck= -github.com/smartcontractkit/chainlink-common v0.1.7-0.20240709155552-d76403db14e5/go.mod h1:fh9eBbrReCmv31bfz52ENCAMa7nTKQbdhb2B3+S2VGo= -github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20240710121324-3ed288aa9b45 h1:NBQLtqk8zsyY4qTJs+NElI3aDFTcAo83JHvqD04EvB0= -github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20240710121324-3ed288aa9b45/go.mod h1:LV0h7QBQUpoC2UUi6TcUvcIFm1xjP/DtEcqV8+qeLUs= -github.com/smartcontractkit/chainlink-data-streams v0.0.0-20240702145022-37a2c3a742d1 h1:dsTmitRaVizHxoYFoGz4+y/zVa8XnvKUiTaZdx+6t9M= -github.com/smartcontractkit/chainlink-data-streams v0.0.0-20240702145022-37a2c3a742d1/go.mod h1:6DgCnHMGdBaIh0bLs1dK0MtdeMZfeNhc/nvBUN6KIUg= -github.com/smartcontractkit/chainlink-feeds v0.0.0-20240522213638-159fb2d99917 h1:MD80ZRCTvxxJ8PBmhtrKoTnky8cVNYrCrIBLVRbrOM0= -github.com/smartcontractkit/chainlink-feeds v0.0.0-20240522213638-159fb2d99917/go.mod h1:jwVxhctE6BgLOSSsVq9wbREpZ8Ev34H+UBxeUhESZRs= -github.com/smartcontractkit/chainlink-solana v1.0.3-0.20240708150922-0546185ead68 h1:kLf20IgCHTNoON0EzWqF5QiZJWZW+i7xWvFPCyIUZTM= -github.com/smartcontractkit/chainlink-solana v1.0.3-0.20240708150922-0546185ead68/go.mod h1:NbXXQaNFskVMYRut0MvBlcHu/vDgipGMwYjamvjVB9Y= -github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240709043547-03612098f799 h1:HyLTySm7BR+oNfZqDTkVJ25wnmcTtxBBD31UkFL+kEM= -github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240709043547-03612098f799/go.mod h1:UVFRacRkP7O7TQAzFmR52v5mUlxf+G1ovMlCQAB/cHU= -github.com/smartcontractkit/chainlink-testing-framework v1.32.0 h1:6emeE/YuMNmdd1pZ3NlJGu94QCa+NUayx26NX0jAQDY= -github.com/smartcontractkit/chainlink-testing-framework v1.32.0/go.mod h1:wSRZGoukZliwfTkghdF4cI1RLHz5k3aDnL+rXhJ6f7k= -github.com/smartcontractkit/chainlink-testing-framework/grafana v0.0.0-20240405215812-5a72bc9af239 h1:Kk5OVlx/5g9q3Z3lhxytZS4/f8ds1MiNM8yaHgK3Oe8= -github.com/smartcontractkit/chainlink-testing-framework/grafana v0.0.0-20240405215812-5a72bc9af239/go.mod h1:DC8sQMyTlI/44UCTL8QWFwb0bYNoXCfjwCv2hMivYZU= -github.com/smartcontractkit/go-plugin v0.0.0-20240208201424-b3b91517de16 h1:TFe+FvzxClblt6qRfqEhUfa4kFQx5UobuoFGO2W4mMo= -github.com/smartcontractkit/go-plugin v0.0.0-20240208201424-b3b91517de16/go.mod h1:lBS5MtSSBZk0SHc66KACcjjlU6WzEVP/8pwz68aMkCI= -github.com/smartcontractkit/grpc-proxy v0.0.0-20230731113816-f1be6620749f h1:hgJif132UCdjo8u43i7iPN1/MFnu49hv7lFGFftCHKU= -github.com/smartcontractkit/grpc-proxy v0.0.0-20230731113816-f1be6620749f/go.mod h1:MvMXoufZAtqExNexqi4cjrNYE9MefKddKylxjS+//n0= -github.com/smartcontractkit/libocr v0.0.0-20240702141926-063ceef8c42e h1:9ypZ/8aW8Vm497i1gXHcT96oNLiu88jbg9QdX+IUE3E= -github.com/smartcontractkit/libocr v0.0.0-20240702141926-063ceef8c42e/go.mod h1:fb1ZDVXACvu4frX3APHZaEBp0xi1DIm34DcA0CwTsZM= -github.com/smartcontractkit/seth v1.0.12 h1:iVdgMx42XWanPPnBaM5StR4c1XsTr/0/B/kKRZL5BsY= -github.com/smartcontractkit/seth v1.0.12/go.mod h1:thWtbLyW4nRHJGzC5heknQDORoJPErE15sF34LHkorg= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20240930060710-158d2a9ac9ca h1:cvifSiZr9VifpKjgVtGaEqknz2MwpY4shQhoOLpgQUE= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20240930060710-158d2a9ac9ca/go.mod h1:hxKOwuo3HBC9a5hoNOvstl2wVF6Z9kZDssHU5VCdqk8= +github.com/smartcontractkit/chainlink-common v0.2.3-0.20240927162447-20630b333f57 h1:pRiTiFOkPEyvgG0hchcCSZzwUbwYydnZBu0QbVaRnVk= +github.com/smartcontractkit/chainlink-common v0.2.3-0.20240927162447-20630b333f57/go.mod h1:F6WUS6N4mP5ScwpwyTyAJc9/vjR+GXbMCRUOVekQi1g= +github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20240911175228-daf2600bb7b7 h1:lTGIOQYLk1Ufn++X/AvZnt6VOcuhste5yp+C157No/Q= +github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20240911175228-daf2600bb7b7/go.mod h1:BMYE1vC/pGmdFSsOJdPrAA0/4gZ0Xo0SxTMdGspBtRo= +github.com/smartcontractkit/chainlink-data-streams v0.0.0-20240916152957-433914114bd2 h1:yRk4ektpx/UxwarqAfgxUXLrsYXlaNeP1NOwzHGrK2Q= +github.com/smartcontractkit/chainlink-data-streams v0.0.0-20240916152957-433914114bd2/go.mod h1:rNhNSrrRMvkgAm5SA6bNTdh2340bTQQZdUVNtZ2o2bk= +github.com/smartcontractkit/chainlink-feeds v0.0.0-20240910155501-42f20443189f h1:p4p3jBT91EQyLuAMvHD+zNJsuAYI/QjJbzuGUJ7wIgg= +github.com/smartcontractkit/chainlink-feeds v0.0.0-20240910155501-42f20443189f/go.mod h1:FLlWBt2hwiMVgt9AcSo6wBJYIRd/nsc8ENbV1Wir1bw= +github.com/smartcontractkit/chainlink-solana v1.1.1-0.20240927143737-7e527aa85bff h1:piMugtrRlbVdcC6xZF37me686eS1YwpLQ0kN2v2b9YE= +github.com/smartcontractkit/chainlink-solana v1.1.1-0.20240927143737-7e527aa85bff/go.mod h1:5jD47oCERRQ4eGi0iNdk9ZV5HMEdolfQwHpUX1+Ix4s= +github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240911194142-506bc469d8ae h1:d+B8y2Nd/PrnPMNoaSPn3eDgUgxcVcIqAxGrvYu/gGw= +github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240911194142-506bc469d8ae/go.mod h1:ec/a20UZ7YRK4oxJcnTBFzp1+DBcJcwqEaerUMsktMs= +github.com/smartcontractkit/chainlink-testing-framework/havoc v1.50.0 h1:mgjBQIEy+3V3G6K8e+6by3xndgsXdYYsdy+7kzQZwSk= +github.com/smartcontractkit/chainlink-testing-framework/havoc v1.50.0/go.mod h1:pdIxrooP5CFGmC0p5NTOBiZAFtMw+5pTT4de5GY3ywA= +github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.9 h1:/2kAb6y854viKigkdFMWDNNbaz3zD0gAkbZoSHC8Rrg= +github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.9/go.mod h1:7R5wGWWJi0dr5Y5cXbLQ4vSeIj0ElvhBaymcfvqqUmo= +github.com/smartcontractkit/chainlink-testing-framework/lib/grafana v1.50.0 h1:VIxK8u0Jd0Q/VuhmsNm6Bls6Tb31H/sA3A/rbc5hnhg= +github.com/smartcontractkit/chainlink-testing-framework/lib/grafana v1.50.0/go.mod h1:lyAu+oMXdNUzEDScj2DXB2IueY+SDXPPfyl/kb63tMM= +github.com/smartcontractkit/chainlink-testing-framework/seth v1.50.1 h1:2OxnPfvjC+zs0ZokSsRTRnJrEGJ4NVJwZgfroS1lPHs= +github.com/smartcontractkit/chainlink-testing-framework/seth v1.50.1/go.mod h1:afY3QmNgeR/VI1pRbGH8g3YXGy7C2RrFOwUzEFvL3L8= +github.com/smartcontractkit/chainlink-testing-framework/wasp v1.50.0 h1:gfhfTn7HkbUHNooSF3c9vzQyN8meWJVGt6G/pNUbpYk= +github.com/smartcontractkit/chainlink-testing-framework/wasp v1.50.0/go.mod h1:tqajhpUJA/9OaMCLitghBXjAgqYO4i27St0F4TUO3+M= +github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7 h1:12ijqMM9tvYVEm+nR826WsrNi6zCKpwBhuApq127wHs= +github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7/go.mod h1:FX7/bVdoep147QQhsOPkYsPEXhGZjeYx6lBSaSXtZOA= +github.com/smartcontractkit/libocr v0.0.0-20240717100443-f6226e09bee7 h1:e38V5FYE7DA1JfKXeD5Buo/7lczALuVXlJ8YNTAUxcw= +github.com/smartcontractkit/libocr v0.0.0-20240717100443-f6226e09bee7/go.mod h1:fb1ZDVXACvu4frX3APHZaEBp0xi1DIm34DcA0CwTsZM= github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin v0.0.0-20230906073235-9e478e5e19f1 h1:yiKnypAqP8l0OX0P3klzZ7SCcBUxy5KqTAKZmQOvSQE= github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin v0.0.0-20230906073235-9e478e5e19f1/go.mod h1:q6f4fe39oZPdsh1i57WznEZgxd8siidMaSFq3wdPmVg= github.com/smartcontractkit/tdh2/go/tdh2 v0.0.0-20230906073235-9e478e5e19f1 h1:Dai1bn+Q5cpeGMQwRdjOdVjG8mmFFROVkSKuUgBErRQ= github.com/smartcontractkit/tdh2/go/tdh2 v0.0.0-20230906073235-9e478e5e19f1/go.mod h1:G5Sd/yzHWf26rQ+X0nG9E0buKPqRGPMJAfk2gwCzOOw= -github.com/smartcontractkit/wasp v0.4.7 h1:7mKJfwzFbuE8xVLUYtLt7Bjw8q/bmVZRW6Ks8kc1LVM= -github.com/smartcontractkit/wasp v0.4.7/go.mod h1:jeabvyXikb2aNoLQwcZGqaz17efrR8NJhpq4seAmdgs= -github.com/smartcontractkit/wsrpc v0.7.3 h1:CKYZfawZShZGfvsQep1F9oBansnFk9ByZPCdTMpLphw= -github.com/smartcontractkit/wsrpc v0.7.3/go.mod h1:sj7QX2NQibhkhxTfs3KOhAj/5xwgqMipTvJVSssT9i0= +github.com/smartcontractkit/wsrpc v0.8.2 h1:XB/xcn/MMseHW+8JE8+a/rceA86ck7Ur6cEa9LiUC8M= +github.com/smartcontractkit/wsrpc v0.8.2/go.mod h1:2u/wfnhl5R4RlSXseN4n6HHIWk8w1Am3AT6gWftQbNg= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= @@ -1543,12 +1438,14 @@ github.com/soheilhy/cmux v0.1.5 h1:jjzc5WVemNEDTLwv9tlmemhC73tI08BNOIGwBOo10Js= github.com/soheilhy/cmux v0.1.5/go.mod h1:T7TcVDs9LWfQgPlPsdngu6I6QIoyIFZDDC6sNE1GqG0= github.com/sony/gobreaker v0.5.0 h1:dRCvqm0P490vZPmy7ppEk2qCnCieBooFJ+YoXGYB+yg= github.com/sony/gobreaker v0.5.0/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY= +github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo= +github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= -github.com/spf13/afero v1.9.5 h1:stMpOSZFs//0Lv29HduCmli3GUfpFoF3Y1Q/aXj/wVM= -github.com/spf13/afero v1.9.5/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ= +github.com/spf13/afero v1.11.0 h1:WJQKhtpdm3v2IzqG8VMqrr6Rf3UYpEF239Jy9wNepM8= +github.com/spf13/afero v1.11.0/go.mod h1:GH9Y3pIexgf1MTIWtNGyogA5MwRIDXGUr+hbWNoBjkY= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cast v1.6.0 h1:GEiTHELF+vaR5dhz3VqZfFSzZjYbgeKDpBxQVS4GYJ0= @@ -1556,22 +1453,19 @@ github.com/spf13/cast v1.6.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cA github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= github.com/spf13/cobra v1.1.1/go.mod h1:WnodtKOvamDL/PwE2M4iKs8aMDBZ5Q5klgD3qfVJQMI= -github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0= -github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho= +github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM= +github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= -github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= -github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= github.com/spf13/viper v1.7.1/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= -github.com/spf13/viper v1.15.0 h1:js3yy885G8xwJa6iOISGFwd+qlUo5AvyXb7CiihdtiU= -github.com/spf13/viper v1.15.0/go.mod h1:fFcTBJxvhhzSJiZy8n+PeW6t8l+KeT/uTARa0jHOQLA= +github.com/spf13/viper v1.19.0 h1:RWq5SEjt8o25SROyN3z2OrDB9l7RPd3lwTWU8EcEdcI= +github.com/spf13/viper v1.19.0/go.mod h1:GQUN9bilAbhU/jgc1bKs99f/suXKeUMct8Adx5+Ntkg= github.com/status-im/keycard-go v0.2.0 h1:QDLFswOQu1r5jsycloeQh3bVU8n/NatHHaZobtDnDzA= github.com/status-im/keycard-go v0.2.0/go.mod h1:wlp8ZLbsmrF6g6WjugPAx+IzoLrkdf9+mHxBEeo3Hbg= -github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8= github.com/streamingfast/logging v0.0.0-20220405224725-2755dab2ce75 h1:ZqpS7rAhhKD7S7DnrpEdrnW1/gZcv82ytpMviovkli4= github.com/streamingfast/logging v0.0.0-20220405224725-2755dab2ce75/go.mod h1:VlduQ80JcGJSargkRU4Sg9Xo63wZD/l8A5NC/Uo1/uU= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -1591,19 +1485,16 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= -github.com/subosito/gotenv v1.4.2 h1:X1TuBLAMDFbaTAChgCBLu3DU3UPyELpnF2jjJ2cz/S8= -github.com/subosito/gotenv v1.4.2/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= +github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= +github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= github.com/supranational/blst v0.3.11 h1:LyU6FolezeWAhvQk0k6O/d49jqgO52MSDDfYgbeoEm4= github.com/supranational/blst v0.3.11/go.mod h1:jZJtfjgudtNl4en1tzwPIV3KjUnQUvG3/j+w+fVonLw= github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d h1:vfofYNRScrDdvS342BElfbETmL1Aiz3i2t0zfRj16Hs= github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d/go.mod h1:RRCYJbIwD5jmqPI9XoAFR0OcDxqUctll6zUj/+B4S48= -github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c h1:g+WoO5jjkqGAzHWCjJB1zZfXPIAaDpzXIEJ0eS6B5Ok= -github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c/go.mod h1:ahpPrc7HpcfEWDQRZEmnXMzHY03mLDYMCxeDzy46i+8= github.com/tendermint/go-amino v0.16.0 h1:GyhmgQKvqF82e2oZeuMSp9JTN0N09emoSZlb2lyGa2E= github.com/tendermint/go-amino v0.16.0/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoMC9Sphe2ZwGME= github.com/teris-io/shortid v0.0.0-20171029131806-771a37caa5cf/go.mod h1:M8agBzgqHIhgj7wEn9/0hJUZcrvt9VY+Ln+S1I5Mha0= @@ -1639,10 +1530,7 @@ github.com/uber/jaeger-client-go v2.30.0+incompatible h1:D6wyKGCecFaSRUpo8lCVbaO github.com/uber/jaeger-client-go v2.30.0+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk= github.com/uber/jaeger-lib v2.4.1+incompatible h1:td4jdvLcExb4cBISKIpHuGoVXh+dVKhn2Um6rjCsSsg= github.com/uber/jaeger-lib v2.4.1+incompatible/go.mod h1:ComeNDZlWwrWnDv8aPp0Ba6+uUTzImX/AauajbLI56U= -github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= -github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= -github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= github.com/ugorji/go/codec v1.2.12 h1:9LC83zGrHhuUA9l16C9AHXAqEV/2wBQ4nkvumAE65EE= github.com/ugorji/go/codec v1.2.12/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= github.com/ulikunitz/xz v0.5.11 h1:kpFauv27b6ynzBNT/Xy+1k+fK4WswhN/6PN5WhFAGw8= @@ -1659,14 +1547,12 @@ github.com/urfave/cli v1.22.14 h1:ebbhrRiGK2i4naQJr+1Xj92HXZCrK7MsyTS/ob3HnAk= github.com/urfave/cli v1.22.14/go.mod h1:X0eDS6pD6Exaclxm99NJ3FiCDRED7vIHpx2mDOHLvkA= github.com/urfave/cli/v2 v2.25.7 h1:VAzn5oq403l5pHjc4OhD54+XGO9cdKVL/7lDjF+iKUs= github.com/urfave/cli/v2 v2.25.7/go.mod h1:8qnjx1vcq5s2/wpsqoZFndg2CE5tNFyrTvS6SinrnYQ= -github.com/urfave/negroni v1.0.0/go.mod h1:Meg73S6kFm/4PpbYdq35yYWoCZ9mS/YSx+lKnmiohz4= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= -github.com/valyala/fasthttp v1.6.0/go.mod h1:FstJa9V+Pj9vQ7OJie2qMHdwemEDaDiSdBnvPM1Su9w= github.com/valyala/fastjson v1.4.1 h1:hrltpHpIpkaxll8QltMU8c3QZ5+qIiCL8yKqPFJI/yE= github.com/valyala/fastjson v1.4.1/go.mod h1:nV6MsjxL2IMJQUoHDIrjEI7oLyeqK6aBD7EFWPsvP8o= github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= -github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= -github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a/go.mod h1:v3UYOV9WzVtRmSR+PDvWpU/qWl4Wa5LApYYX4ZtKbio= +github.com/vektah/gqlparser/v2 v2.5.11 h1:JJxLtXIoN7+3x6MBdtIP59TP1RANnY7pXOaDnADQSf8= +github.com/vektah/gqlparser/v2 v2.5.11/go.mod h1:1rCcfwB2ekJofmluGWXMSEnPMZgbxzwj6FaZ/4OT8Cc= github.com/vultr/govultr/v2 v2.17.2 h1:gej/rwr91Puc/tgh+j33p/BLR16UrIPnSr+AIwYWZQs= github.com/vultr/govultr/v2 v2.17.2/go.mod h1:ZFOKGWmgjytfyjeyAdhQlSWwTjh2ig+X49cAp50dzXI= github.com/wiremock/go-wiremock v1.9.0 h1:9xcU4/IoEfgCaH4TGhQTtiQyBh2eMtu9JB6ppWduK+E= @@ -1680,20 +1566,14 @@ github.com/xdg-go/scram v1.0.2/go.mod h1:1WAq6h33pAW+iRreB34OORO2Nf7qel3VV3fjBj+ github.com/xdg-go/scram v1.1.1/go.mod h1:RaEWvsqvNKKvBPvcKeFjrG2cJqOkHTiyTpzz23ni57g= github.com/xdg-go/stringprep v1.0.2/go.mod h1:8F9zXuvzgwmyT5DUm4GUfZGDdT3W+LCvS6+da4O5kxM= github.com/xdg-go/stringprep v1.0.3/go.mod h1:W3f5j4i+9rC0kuIEJL0ky1VpHXQU3ocBgklLGvcBnW8= -github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= -github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= -github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= +github.com/xhit/go-str2duration v1.2.0/go.mod h1:3cPSlfZlUHVlneIVfePFWcJZsuwf+P1v2SRTV4cUmp4= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= -github.com/xlab/treeprint v1.1.0 h1:G/1DjNkPpfZCFt9CSh6b5/nY4VimlbHF3Rh4obvtzDk= -github.com/xlab/treeprint v1.1.0/go.mod h1:gj5Gd3gPdKtR1ikdDK6fnFLdmIS0X30kTTuNd/WEJu0= +github.com/xlab/treeprint v1.2.0 h1:HzHnuAF1plUN2zGlAFHbSQP2qJ0ZAD3XF5XD7OesXRQ= +github.com/xlab/treeprint v1.2.0/go.mod h1:gj5Gd3gPdKtR1ikdDK6fnFLdmIS0X30kTTuNd/WEJu0= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU= github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8= -github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0/go.mod h1:/LWChgwKmvncFJFHJ7Gvn9wZArjbV5/FppcK2fKk/tI= github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7JulP+udvsHwJoVG1YGAP6VLg4y9I5dyZdqmA= -github.com/yudai/gojsondiff v1.0.0/go.mod h1:AY32+k2cwILAkW1fbgxQ5mUmMiZFgLIV+FBNExI05xg= -github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82/go.mod h1:lgjkn3NuSvDfVJdfcVVdX+jpBxNmX4rDAzaS45IcYoM= -github.com/yudai/pp v2.0.1+incompatible/go.mod h1:PuxR/8QJ7cyCkFp/aUDS+JY727OFEZkTdatxwunjIkc= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -1705,10 +1585,10 @@ github.com/yuin/gopher-lua v1.1.0/go.mod h1:GBR0iDaNXjAgGg9zfCvksxSRnQx76gclCIb7 github.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0= github.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q= -github.com/zondax/hid v0.9.1 h1:gQe66rtmyZ8VeGFcOpbuH3r7erYtNEAezCAYu8LdkJo= -github.com/zondax/hid v0.9.1/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= -github.com/zondax/ledger-go v0.14.1 h1:Pip65OOl4iJ84WTpA4BKChvOufMhhbxED3BaihoZN4c= -github.com/zondax/ledger-go v0.14.1/go.mod h1:fZ3Dqg6qcdXWSOJFKMG8GCTnD7slO/RL2feOQv8K320= +github.com/zondax/hid v0.9.2 h1:WCJFnEDMiqGF64nlZz28E9qLVZ0KSJ7xpc5DLEyma2U= +github.com/zondax/hid v0.9.2/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= +github.com/zondax/ledger-go v0.14.3 h1:wEpJt2CEcBJ428md/5MgSLsXLBos98sBOyxNmCjfUCw= +github.com/zondax/ledger-go v0.14.3/go.mod h1:IKKaoxupuB43g4NxeQmbLXv7T9AlQyie1UpHb342ycI= go.dedis.ch/fixbuf v1.0.3 h1:hGcV9Cd/znUxlusJ64eAlExS+5cJDIyTyEG+otu5wQs= go.dedis.ch/fixbuf v1.0.3/go.mod h1:yzJMt34Wa5xD37V5RTdmp38cz3QhMagdGoem9anUalw= go.dedis.ch/kyber/v3 v3.0.4/go.mod h1:OzvaEnPvKlyrWyp3kGXlFdp7ap1VC6RkZDTaPikqhsQ= @@ -1719,14 +1599,14 @@ go.dedis.ch/protobuf v1.0.5/go.mod h1:eIV4wicvi6JK0q/QnfIEGeSFNG0ZeB24kzut5+HaRL go.dedis.ch/protobuf v1.0.7/go.mod h1:pv5ysfkDX/EawiPqcW3ikOxsL5t+BqnV6xHSmE79KI4= go.dedis.ch/protobuf v1.0.11/go.mod h1:97QR256dnkimeNdfmURz0wAMNVbd1VmLXhG1CrTYrJ4= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.etcd.io/bbolt v1.3.7 h1:j+zJOnnEjF/kyHlDDgGnVL/AIqIJPq8UoB2GSNfkUfQ= -go.etcd.io/bbolt v1.3.7/go.mod h1:N9Mkw9X8x5fupy0IKsmuqVtoGDyxsaDlbk4Rd05IAQw= -go.etcd.io/etcd/api/v3 v3.5.7 h1:sbcmosSVesNrWOJ58ZQFitHMdncusIifYcrBfwrlJSY= -go.etcd.io/etcd/api/v3 v3.5.7/go.mod h1:9qew1gCdDDLu+VwmeG+iFpL+QlpHTo7iubavdVDgCAA= -go.etcd.io/etcd/client/pkg/v3 v3.5.7 h1:y3kf5Gbp4e4q7egZdn5T7W9TSHUvkClN6u+Rq9mEOmg= -go.etcd.io/etcd/client/pkg/v3 v3.5.7/go.mod h1:o0Abi1MK86iad3YrWhgUsbGx1pmTS+hrORWc2CamuhY= -go.etcd.io/etcd/client/v3 v3.5.7 h1:u/OhpiuCgYY8awOHlhIhmGIGpxfBU/GZBUP3m/3/Iz4= -go.etcd.io/etcd/client/v3 v3.5.7/go.mod h1:sOWmj9DZUMyAngS7QQwCyAXXAL6WhgTOPLNS/NabQgw= +go.etcd.io/bbolt v1.3.9 h1:8x7aARPEXiXbHmtUwAIv7eV2fQFHrLLavdiJ3uzJXoI= +go.etcd.io/bbolt v1.3.9/go.mod h1:zaO32+Ti0PK1ivdPtgMESzuzL2VPoIG1PCQNvOdo/dE= +go.etcd.io/etcd/api/v3 v3.5.14 h1:vHObSCxyB9zlF60w7qzAdTcGaglbJOpSj1Xj9+WGxq0= +go.etcd.io/etcd/api/v3 v3.5.14/go.mod h1:BmtWcRlQvwa1h3G2jvKYwIQy4PkHlDej5t7uLMUdJUU= +go.etcd.io/etcd/client/pkg/v3 v3.5.14 h1:SaNH6Y+rVEdxfpA2Jr5wkEvN6Zykme5+YnbCkxvuWxQ= +go.etcd.io/etcd/client/pkg/v3 v3.5.14/go.mod h1:8uMgAokyG1czCtIdsq+AGyYQMvpIKnSvPjFMunkgeZI= +go.etcd.io/etcd/client/v3 v3.5.14 h1:CWfRs4FDaDoSz81giL7zPpZH2Z35tbOrAJkkjMqOupg= +go.etcd.io/etcd/client/v3 v3.5.14/go.mod h1:k3XfdV/VIHy/97rqWjoUzrj9tk7GgJGH9J8L4dNXmAk= go.mongodb.org/mongo-driver v1.7.3/go.mod h1:NqaYOwnXWr5Pm7AOpO5QFxKJ503nbMse/R79oO62zWg= go.mongodb.org/mongo-driver v1.7.5/go.mod h1:VXEWRZ6URJIkUq2SCAyapmhH0ZLRBP+FT4xhp5Zvxng= go.mongodb.org/mongo-driver v1.10.0/go.mod h1:wsihk0Kdgv8Kqu1Anit4sfK+22vSFbUrAVEYRhCXrA8= @@ -1746,35 +1626,46 @@ go.opentelemetry.io/collector/pdata v1.0.0-rcv0016 h1:qCPXSQCoD3qeWFb1RuIks8fw9A go.opentelemetry.io/collector/pdata v1.0.0-rcv0016/go.mod h1:OdN0alYOlYhHXu6BDlGehrZWgtBuiDsz/rlNeJeXiNg= go.opentelemetry.io/collector/semconv v0.87.0 h1:BsG1jdLLRCBRlvUujk4QA86af7r/ZXnizczQpEs/gg8= go.opentelemetry.io/collector/semconv v0.87.0/go.mod h1:j/8THcqVxFna1FpvA2zYIsUperEtOaRaqoLYIN4doWw= -go.opentelemetry.io/contrib v0.20.0 h1:ubFQUn0VCZ0gPwIoJfBJVpeBlyRMxu8Mm/huKWYd9p0= go.opentelemetry.io/contrib/instrumentation/github.com/gin-gonic/gin/otelgin v0.49.0 h1:1f31+6grJmV3X4lxcEvUy13i5/kfDw1nJZwhd8mA4tg= go.opentelemetry.io/contrib/instrumentation/github.com/gin-gonic/gin/otelgin v0.49.0/go.mod h1:1P/02zM3OwkX9uki+Wmxw3a5GVb6KUXRsa7m7bOC9Fg= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.52.0 h1:vS1Ao/R55RNV4O7TA2Qopok8yN+X0LIP6RVWLFkprck= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.52.0/go.mod h1:BMsdeOxN04K0L5FNUBfjFdvwWGNe/rkmSwH4Aelu/X0= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 h1:jq9TW8u3so/bN+JPT166wjOI6/vQPF6Xe7nMNIltagk= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0/go.mod h1:p8pYQP+m5XfbZm9fxtSKAbM6oIllS7s2AfxrChvc7iw= -go.opentelemetry.io/otel v1.27.0 h1:9BZoF3yMK/O1AafMiQTVu0YDj5Ea4hPhxCs7sGva+cg= -go.opentelemetry.io/otel v1.27.0/go.mod h1:DMpAK8fzYRzs+bi3rS5REupisuqTheUlSZJ1WnZaPAQ= -go.opentelemetry.io/otel/exporters/otlp v0.20.0 h1:PTNgq9MRmQqqJY0REVbZFvwkYOA85vbdQU/nVfxDyqg= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.27.0 h1:R9DE4kQ4k+YtfLI2ULwX82VtNQ2J8yZmA7ZIF/D+7Mc= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.27.0/go.mod h1:OQFyQVrDlbe+R7xrEyDr/2Wr67Ol0hRUgsfA+V5A95s= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.27.0 h1:qFffATk0X+HD+f1Z8lswGiOQYKHRlzfmdJm0wEaVrFA= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.27.0/go.mod h1:MOiCmryaYtc+V0Ei+Tx9o5S1ZjA7kzLucuVuyzBZloQ= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.53.0 h1:9G6E0TXzGFVfTnawRzrPl83iHOAV7L8NJiR8RSGYV1g= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.53.0/go.mod h1:azvtTADFQJA8mX80jIH/akaE7h+dbm/sVuaHqN13w74= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.53.0 h1:4K4tsIXefpVJtvA/8srF4V4y0akAoPHkIslgAkjixJA= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.53.0/go.mod h1:jjdQuTGVsXV4vSs+CJ2qYDeDPf9yIJV23qlIzBm73Vg= +go.opentelemetry.io/otel v1.28.0 h1:/SqNcYk+idO0CxKEUOtKQClMK/MimZihKYMruSMViUo= +go.opentelemetry.io/otel v1.28.0/go.mod h1:q68ijF8Fc8CnMHKyzqL6akLO46ePnjkgfIMIjUIX9z4= +go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.0.0-20240823153156-2a54df7bffb9 h1:UiRNKd1OgqsLbFwE+wkAWTdiAxXtCBqKIHeBIse4FUA= +go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.0.0-20240823153156-2a54df7bffb9/go.mod h1:eqZlW3pJWhjyexnDPrdQxix1pn0wwhI4AO4GKpP/bMI= +go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.28.0 h1:U2guen0GhqH8o/G2un8f/aG/y++OuW6MyCo6hT9prXk= +go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.28.0/go.mod h1:yeGZANgEcpdx/WK0IvvRFC+2oLiMS2u4L/0Rj2M2Qr0= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.28.0 h1:3Q/xZUyC1BBkualc9ROb4G8qkH90LXEIICcs5zv1OYY= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.28.0/go.mod h1:s75jGIWA9OfCMzF0xr+ZgfrB5FEbbV7UuYo32ahUiFI= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.28.0 h1:R3X6ZXmNPRR8ul6i3WgFURCHzaXjHdm0karRG/+dj3s= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.28.0/go.mod h1:QWFXnDavXWwMx2EEcZsf3yxgEKAqsxQ+Syjp+seyInw= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.19.0 h1:IeMeyr1aBvBiPVYihXIaeIZba6b8E1bYp7lbdxK8CQg= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.19.0/go.mod h1:oVdCUtjq9MK9BlS7TtucsQwUcXcymNiEDjgDD2jMtZU= -go.opentelemetry.io/otel/metric v1.27.0 h1:hvj3vdEKyeCi4YaYfNjv2NUje8FqKqUY8IlF0FxV/ik= -go.opentelemetry.io/otel/metric v1.27.0/go.mod h1:mVFgmRlhljgBiuk/MP/oKylr4hs85GZAylncepAX/ak= -go.opentelemetry.io/otel/sdk v1.27.0 h1:mlk+/Y1gLPLn84U4tI8d3GNJmGT/eXe3ZuOXN9kTWmI= -go.opentelemetry.io/otel/sdk v1.27.0/go.mod h1:Ha9vbLwJE6W86YstIywK2xFfPjbWlCuwPtMkKdz/Y4A= -go.opentelemetry.io/otel/sdk/metric v1.21.0 h1:smhI5oD714d6jHE6Tie36fPx4WDFIg+Y6RfAY4ICcR0= -go.opentelemetry.io/otel/sdk/metric v1.21.0/go.mod h1:FJ8RAsoPGv/wYMgBdUJXOm+6pzFY3YdljnXtv1SBE8Q= -go.opentelemetry.io/otel/trace v1.27.0 h1:IqYb813p7cmbHk0a5y6pD5JPakbVfftRXABGt5/Rscw= -go.opentelemetry.io/otel/trace v1.27.0/go.mod h1:6RiD1hkAprV4/q+yd2ln1HG9GoPx39SuvvstaLBl+l4= -go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= -go.opentelemetry.io/proto/otlp v1.2.0 h1:pVeZGk7nXDC9O2hncA6nHldxEjm6LByfA2aN8IOkz94= -go.opentelemetry.io/proto/otlp v1.2.0/go.mod h1:gGpR8txAl5M03pDhMC79G6SdqNV26naRm/KDsgaHD8A= -go.starlark.net v0.0.0-20220817180228-f738f5508c12 h1:xOBJXWGEDwU5xSDxH6macxO11Us0AH2fTa9rmsbbF7g= -go.starlark.net v0.0.0-20220817180228-f738f5508c12/go.mod h1:VZcBMdr3cT3PnBoWunTabuSEXwVAH+ZJ5zxfs3AdASk= +go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.4.0 h1:0MH3f8lZrflbUWXVxyBg/zviDFdGE062uKh5+fu8Vv0= +go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.4.0/go.mod h1:Vh68vYiHY5mPdekTr0ox0sALsqjoVy0w3Os278yX5SQ= +go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.28.0 h1:BJee2iLkfRfl9lc7aFmBwkWxY/RI1RDdXepSF6y8TPE= +go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.28.0/go.mod h1:DIzlHs3DRscCIBU3Y9YSzPfScwnYnzfnCd4g8zA7bZc= +go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.28.0 h1:EVSnY9JbEEW92bEkIYOVMw4q1WJxIAGoFTrtYOzWuRQ= +go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.28.0/go.mod h1:Ea1N1QQryNXpCD0I1fdLibBAIpQuBkznMmkdKrapk1Y= +go.opentelemetry.io/otel/log v0.4.0 h1:/vZ+3Utqh18e8TPjuc3ecg284078KWrR8BRz+PQAj3o= +go.opentelemetry.io/otel/log v0.4.0/go.mod h1:DhGnQvky7pHy82MIRV43iXh3FlKN8UUKftn0KbLOq6I= +go.opentelemetry.io/otel/metric v1.28.0 h1:f0HGvSl1KRAU1DLgLGFjrwVyismPlnuU6JD6bOeuA5Q= +go.opentelemetry.io/otel/metric v1.28.0/go.mod h1:Fb1eVBFZmLVTMb6PPohq3TO9IIhUisDsbJoL/+uQW4s= +go.opentelemetry.io/otel/sdk v1.28.0 h1:b9d7hIry8yZsgtbmM0DKyPWMMUMlK9NEKuIG4aBqWyE= +go.opentelemetry.io/otel/sdk v1.28.0/go.mod h1:oYj7ClPUA7Iw3m+r7GeEjz0qckQRJK2B8zjcZEfu7Pg= +go.opentelemetry.io/otel/sdk/log v0.4.0 h1:1mMI22L82zLqf6KtkjrRy5BbagOTWdJsqMY/HSqILAA= +go.opentelemetry.io/otel/sdk/log v0.4.0/go.mod h1:AYJ9FVF0hNOgAVzUG/ybg/QttnXhUePWAupmCqtdESo= +go.opentelemetry.io/otel/sdk/metric v1.28.0 h1:OkuaKgKrgAbYrrY0t92c+cC+2F6hsFNnCQArXCKlg08= +go.opentelemetry.io/otel/sdk/metric v1.28.0/go.mod h1:cWPjykihLAPvXKi4iZc1dpER3Jdq2Z0YLse3moQUCpg= +go.opentelemetry.io/otel/trace v1.28.0 h1:GhQ9cUuQGmNDd5BTCP2dAvv75RdMxEfTmYejp+lkx9g= +go.opentelemetry.io/otel/trace v1.28.0/go.mod h1:jPyXzNPg6da9+38HEwElrQiHlVMTnVfM3/yv2OlIHaI= +go.opentelemetry.io/proto/otlp v1.3.1 h1:TrMUixzpM0yuc/znrFTP9MMRh8trP93mkCiDVeXrui0= +go.opentelemetry.io/proto/otlp v1.3.1/go.mod h1:0X1WI4de4ZsLrrJNLAQbFeLCm3T7yBkR0XqQ7niQU+8= +go.starlark.net v0.0.0-20230525235612-a134d8f9ddca h1:VdD38733bfYv5tUZwEIskMM93VanwNIi5bIKnDrJdEY= +go.starlark.net v0.0.0-20230525235612-a134d8f9ddca/go.mod h1:jxU+3+j+71eXOW14274+SmmuW82qJzl6iZSeqEtTGds= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= @@ -1801,14 +1692,13 @@ go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= go.uber.org/zap v1.14.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= go.uber.org/zap v1.16.0/go.mod h1:MA8QOfq0BHJwdXa996Y4dYkAqRKB8/1K1QMMZVaNZjQ= go.uber.org/zap v1.21.0/go.mod h1:wjWOCqI0f2ZZrJF/UufIOkiC8ii6tm1iqIsLo76RfJw= -go.uber.org/zap v1.24.0/go.mod h1:2kMP+WWQ8aoFoedH3T2sq6iJ2yDWpHbP0f6MQbS9Gkg= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= +go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= go4.org/netipx v0.0.0-20230125063823-8449b0a6169f h1:ketMxHg+vWm3yccyYiq+uK8D3fRmna2Fcj+awpQp84s= go4.org/netipx v0.0.0-20230125063823-8449b0a6169f/go.mod h1:tgPU4N2u9RByaTN3NC2p9xOzyFpte4jYwsIIRF7XlSc= golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= -golang.org/x/arch v0.7.0 h1:pskyeJh/3AmoQ8CPE95vxHLqp1G1GfGNXTmcl9NEKTc= -golang.org/x/arch v0.7.0/go.mod h1:FEVrYAQjsQXMVJ1nsMoVVXPZg6p2JE2mx8psSWTDQys= +golang.org/x/arch v0.8.0 h1:3wRIsP3pM4yUptoR96otTUOXI367OS0+c9eeRi9doIc= +golang.org/x/arch v0.8.0/go.mod h1:FEVrYAQjsQXMVJ1nsMoVVXPZg6p2JE2mx8psSWTDQys= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= @@ -1818,31 +1708,26 @@ golang.org/x/crypto v0.0.0-20190411191339-88737f569e3a/go.mod h1:WFFai1msRO1wXaE golang.org/x/crypto v0.0.0-20190422162423-af44ce270edf/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20191227163750-53104e6ec876/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201203163018-be400aefbc4c/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= -golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= -golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220214200702-86341886e292/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc= golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= -golang.org/x/crypto v0.24.0 h1:mnl8DM0o513X8fdIkmyFE/5hTYxbwYOjDS/+rK6qpRI= -golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM= +golang.org/x/crypto v0.27.0 h1:GXm2NjJrPaiv/h1tb2UH8QfgC/hOf/+z0p6PT8o1w7A= +golang.org/x/crypto v0.27.0/go.mod h1:1Xngt8kV6Dvbssa53Ziq6Eqn0HqbZi5Z6R0ZpwQzt70= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -1853,8 +1738,8 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20240325151524-a685a6edb6d8 h1:aAcj0Da7eBAtrTp03QXWvm88pSyOt+UgdZw2BFZ+lEw= -golang.org/x/exp v0.0.0-20240325151524-a685a6edb6d8/go.mod h1:CQ1k9gNrJ50XIzaKCRR2hssIjF07kZFEiieALBM/ARQ= +golang.org/x/exp v0.0.0-20240909161429-701f63a606c0 h1:e66Fs6Z+fZTbFBAxKfP3PALWBtpfqks2bwGcexMxgtk= +golang.org/x/exp v0.0.0-20240909161429-701f63a606c0/go.mod h1:2TbTHSBQa924w8M6Xs1QcRcFwyucIwBGpK1p2f1YFFY= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -1868,7 +1753,6 @@ golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRu golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= @@ -1877,34 +1761,28 @@ golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzB golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA= -golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.21.0 h1:vvrHzRwRfVKSiLrG+d4FMl/Qi4ukBCE6kZlTUkDYRT0= +golang.org/x/mod v0.21.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190327091125-710a502c58a2/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= -golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190921015927-1a5e07d1ff72/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -1923,11 +1801,8 @@ golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81R golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= golang.org/x/net v0.0.0-20210331212208-0fccb6fa2b5c/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= @@ -1935,32 +1810,28 @@ golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96b golang.org/x/net v0.0.0-20210410081132-afb366fc7cd1/go.mod h1:9tjilg8BloeKEkVJvy7fQ90B1CfIiPueXVOjqfkSzI8= golang.org/x/net v0.0.0-20210421230115-4e50805a0758/go.mod h1:72T/g9IO56b78aLF+1Kcs5dz7/ng1VjMUvfKvpfy+jM= golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= -golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-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-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= -golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac= -golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= +golang.org/x/net v0.29.0 h1:5ORfpBpCs4HzDYoodCDBbwHzdR5UrLBZ3sOnUJmFoHo= +golang.org/x/net v0.29.0/go.mod h1:gLkgy8jTGERgjzMic6DS9+SP0ajcu6Xu3Orq/SpETg0= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/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.20.0 h1:4mQdhULixXKP1rwYBW0vAijoXnkTG0BLCDRzfe1idMo= -golang.org/x/oauth2 v0.20.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= +golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= +golang.org/x/oauth2 v0.5.0/go.mod h1:9/XBHVqLaWO3/BRHs5jbpYCnOZVjj5V0ndyaAM7KB4I= +golang.org/x/oauth2 v0.22.0 h1:BzDx2FehcG7jJwgWLELCdmLuxk2i+x9UDpSiss2u0ZA= +golang.org/x/oauth2 v0.22.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1971,19 +1842,18 @@ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= -golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190124100055-b90733256f2e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -2012,7 +1882,6 @@ golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -2026,39 +1895,27 @@ golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210303074136-134d130e1a04/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210331175145-43e1dd70ce54/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210420072515-93ed5bcd2bfe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210616045830-e2b7044e8c71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210819135213-f52c844e1c1c/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-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -2066,7 +1923,6 @@ golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -2077,20 +1933,21 @@ golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= -golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34= +golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= 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-20201210144234-2321bbc49cbf/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.0.0-20220526004731-065cf7ba2467/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU= golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= -golang.org/x/term v0.21.0 h1:WVXCp+/EBEHOj53Rvu+7KiT/iElMrO8ACK16SMZ3jaA= -golang.org/x/term v0.21.0/go.mod h1:ooXLefLobQVslOqselCNF4SxFAaoS6KujMbsGzSDmX0= +golang.org/x/term v0.24.0 h1:Mh5cbb+Zk2hqqXNO7S1iTjEphVL+jb8ZWaqh/g+JWkM= +golang.org/x/term v0.24.0/go.mod h1:lOBK/LVxemqiMij05LGJ0tzNr8xlmwBRJ81PX6wVLH8= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -2104,23 +1961,20 @@ golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= -golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= -golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= +golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224= +golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20201208040808-7e3f01d25324/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= -golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= +golang.org/x/time v0.6.0 h1:eTDhh4ZXt5Qf0augr54TN6suAUudPcawVZeIAPU7D4U= +golang.org/x/time v0.6.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181221001348-537d06c36207/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190327201419-c70d86f8b7cf/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190329151228-23e29df326fe/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190416151739-9c9e1878f421/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= @@ -2170,21 +2024,14 @@ golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roY golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= -golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= -golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg= -golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= +golang.org/x/tools v0.25.0 h1:oFU9pkj/iJgs+0DT+VMHrx+oBKs/LJMV+Uvg78sl+fE= +golang.org/x/tools v0.25.0/go.mod h1:/vtpO8WL1N9cQC3FN5zPqb//fRXskFHbLKk4OW1Q7rg= golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -2192,10 +2039,10 @@ golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= -gomodules.xyz/jsonpatch/v2 v2.2.0 h1:4pT439QV83L+G9FkcCriY6EkpcK6r6bK+A5FBUMI7qY= -gomodules.xyz/jsonpatch/v2 v2.2.0/go.mod h1:WXp+iVDkoLQqPudfQ9GBlwB2eZ5DKOnjQZCYdOS8GPY= -gonum.org/v1/gonum v0.14.0 h1:2NiG67LD1tEH0D7kM+ps2V+fXmsAnpUeec7n8tcr4S0= -gonum.org/v1/gonum v0.14.0/go.mod h1:AoWeoz0becf9QMWtE8iWXNXc27fK4fNeHNf/oMejGfU= +gomodules.xyz/jsonpatch/v2 v2.4.0 h1:Ci3iUJyx9UeRx7CeFN8ARgGbkESwJK+KB9lLcWxY/Zw= +gomodules.xyz/jsonpatch/v2 v2.4.0/go.mod h1:AH3dM2RI6uoBZxn3LVrfvJ3E0/9dG4cSrbuBJT4moAY= +gonum.org/v1/gonum v0.15.0 h1:2lYxjRbTYyxkJxlhC+LvJIx3SsANPdRybu1tGj9/OrQ= +gonum.org/v1/gonum v0.15.0/go.mod h1:xzZVBJBtS+Mz4q0Yl2LJTk+OxOg4jiXZ7qBoM0uISGo= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= @@ -2213,11 +2060,8 @@ google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0M google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= -google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= -google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= -google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= -google.golang.org/api v0.169.0 h1:QwWPy71FgMWqJN/l6jVlFHUa29a7dcUy02I8o799nPY= -google.golang.org/api v0.169.0/go.mod h1:gpNOiMA2tZ4mf5R9Iwf4rK/Dcz0fbdIgWYWVoxmsyLg= +google.golang.org/api v0.188.0 h1:51y8fJ/b1AaaBRJr4yWm96fPcuxSo0JcegXE3DaHQHw= +google.golang.org/api v0.188.0/go.mod h1:VR0d+2SIiWOYG3r/jdm7adPW9hI2aRv9ETOSCQ9Beag= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -2261,22 +2105,13 @@ google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7Fc google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210401141331-865547bb08e2/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= -google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= -google.golang.org/genproto v0.0.0-20220107163113-42d7afdf6368/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 h1:9+tzLLstTlPTRyJTh+ah5wIMsBW5c4tQwGTN3thOW9Y= -google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9/go.mod h1:mqHbVIp48Muh7Ywss/AD6I5kNVKZMmAa/QEW58Gxp2s= -google.golang.org/genproto/googleapis/api v0.0.0-20240520151616-dc85e6b867a5 h1:P8OJ/WCl/Xo4E4zoe4/bifHpSmmKwARqyqE4nW6J2GQ= -google.golang.org/genproto/googleapis/api v0.0.0-20240520151616-dc85e6b867a5/go.mod h1:RGnPtTG7r4i8sPlNyDeikXF99hMM+hN6QMm4ooG9g2g= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240520151616-dc85e6b867a5 h1:Q2RxlXqh1cgzzUgV261vBO2jI5R/3DD1J2pM0nI4NhU= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240520151616-dc85e6b867a5/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0= +google.golang.org/genproto v0.0.0-20240711142825-46eb208f015d h1:/hmn0Ku5kWij/kjGsrcJeC1T/MrJi2iNWwgAqrihFwc= +google.golang.org/genproto v0.0.0-20240711142825-46eb208f015d/go.mod h1:FfBgJBJg9GcpPvKIuHSZ/aE1g2ecGL74upMzGZjiGEY= +google.golang.org/genproto/googleapis/api v0.0.0-20240822170219-fc7c04adadcd h1:BBOTEWLuuEGQy9n1y9MhVJ9Qt0BDu21X8qZs71/uPZo= +google.golang.org/genproto/googleapis/api v0.0.0-20240822170219-fc7c04adadcd/go.mod h1:fO8wJzT2zbQbAjbIoos1285VfEIYKDDY+Dt+WpTkh6g= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd h1:6TEm2ZxXoQmFWFlt1vNxvVOa1Q0dXFQD1m/rYjXmS0E= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= google.golang.org/grpc v1.12.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= @@ -2292,17 +2127,11 @@ google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKa google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= -google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= -google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= -google.golang.org/grpc v1.64.0 h1:KH3VH9y/MgNQg1dE7b3XfVK0GsPSIzJwdF617gUSbvY= -google.golang.org/grpc v1.64.0/go.mod h1:oxjF8E3FBnjp+/gVFYdWacaLDx9na1aqy9oovLpxQYg= +google.golang.org/grpc v1.65.0 h1:bs/cUb4lp1G5iImFFd3u5ixQzweKizoZJAwBNLR42lc= +google.golang.org/grpc v1.65.0/go.mod h1:WgYC2ypjlB0EiQi6wdKixMqukr6lBc0Vo+oOgjrM5ZQ= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -2315,10 +2144,10 @@ 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.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.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= -google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= -gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= +google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -2327,35 +2156,30 @@ gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/evanphx/json-patch.v4 v4.12.0 h1:n6jtcsulIzXPJaxegRbvFNNrZDjbij7ny3gmSPG+6V4= +gopkg.in/evanphx/json-patch.v4 v4.12.0/go.mod h1:p8EYWUEYMpynmqDbY58zCKCFZw8pRWMG4EsWvDvM72M= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= -gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE= -gopkg.in/go-playground/validator.v8 v8.18.2/go.mod h1:RX2a/7Ha8BgOhfk7j780h4/u/RRjR0eouCJSH80/M2Y= gopkg.in/guregu/null.v4 v4.0.0 h1:1Wm3S1WEA2I26Kq+6vcW+w0gcDo44YKYD7YIEJNHDjg= gopkg.in/guregu/null.v4 v4.0.0/go.mod h1:YoQhUrADuG3i9WqesrCmpNRwm1ypAgSHYqoOcTu/JrI= gopkg.in/inconshreveable/log15.v2 v2.0.0-20180818164646-67afb5ed74ec/go.mod h1:aPpfJ7XW+gOuirDoZ8gHhLh3kZ1B08FtV2bbmy7Jv3s= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/ini.v1 v1.51.1/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/mgo.v2 v2.0.0-20180705113604-9856a29383ce/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA= gopkg.in/natefinch/lumberjack.v2 v2.2.1 h1:bBRl1b0OH9s/DuPhuXpNl+VtCaJXFZ5/uEFST95x9zc= gopkg.in/natefinch/lumberjack.v2 v2.2.1/go.mod h1:YD8tP3GAjkrDg1eZH7EGmyESg/lsYskCTPBJVb9jqSc= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= -gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= -gopkg.in/yaml.v3 v3.0.0-20191120175047-4206685974f2/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20200605160147-a5ece683394c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= @@ -2363,8 +2187,8 @@ gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= -gotest.tools/v3 v3.5.0 h1:Ljk6PdHdOhAb5aDMWXjDLMMhph+BpztA4v1QdqEW2eY= -gotest.tools/v3 v3.5.0/go.mod h1:isy3WKz7GK6uNw/sbHzfKBLvlvXwUyV06n6brMxxopU= +gotest.tools/v3 v3.5.1 h1:EENdUnS3pdur5nybKYIh2Vfgc8IUNBjxDPSjtiJcOzU= +gotest.tools/v3 v3.5.1/go.mod h1:isy3WKz7GK6uNw/sbHzfKBLvlvXwUyV06n6brMxxopU= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= @@ -2373,46 +2197,46 @@ honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.1.3/go.mod h1:NgwopIslSNH47DimFoV78dnkksY2EFtX0ajyb3K/las= -k8s.io/api v0.25.11 h1:4mjYDfE3yp22jrytjH0knwgzjXKkxHX4D01ZCAazvZM= -k8s.io/api v0.25.11/go.mod h1:bK4UvD4bthtutNlvensrfBX21PRQ/vs2cIYggHkOOAo= -k8s.io/apiextensions-apiserver v0.25.3 h1:bfI4KS31w2f9WM1KLGwnwuVlW3RSRPuIsfNF/3HzR0k= -k8s.io/apiextensions-apiserver v0.25.3/go.mod h1:ZJqwpCkxIx9itilmZek7JgfUAM0dnTsA48I4krPqRmo= +k8s.io/api v0.28.2 h1:9mpl5mOb6vXZvqbQmankOfPIGiudghwCoLl1EYfUZbw= +k8s.io/api v0.28.2/go.mod h1:RVnJBsjU8tcMq7C3iaRSGMeaKt2TWEUXcpIt/90fjEg= +k8s.io/apiextensions-apiserver v0.28.2 h1:J6/QRWIKV2/HwBhHRVITMLYoypCoPY1ftigDM0Kn+QU= +k8s.io/apiextensions-apiserver v0.28.2/go.mod h1:5tnkxLGa9nefefYzWuAlWZ7RZYuN/765Au8cWLA6SRg= k8s.io/apimachinery v0.28.2 h1:KCOJLrc6gu+wV1BYgwik4AF4vXOlVJPdiqn0yAWWwXQ= k8s.io/apimachinery v0.28.2/go.mod h1:RdzF87y/ngqk9H4z3EL2Rppv5jj95vGS/HaFXrLDApU= -k8s.io/cli-runtime v0.25.11 h1:GE2yNZm1tN+MJtw1SGMOLesLF7Kp7NVAVqRSTbXfu4o= -k8s.io/cli-runtime v0.25.11/go.mod h1:r/nEINuHVEpgGhcd2WamU7hD1t/lMnSz8XM44Autltc= -k8s.io/client-go v0.25.11 h1:DJQ141UsbNRI6wYSlcYLP5J5BW5Wq7Bgm42Ztq2SW70= -k8s.io/client-go v0.25.11/go.mod h1:41Xs7p1SfhoReUnmjjYCfCNWFiq4xSkexwJfbxF2F7A= -k8s.io/component-base v0.26.2 h1:IfWgCGUDzrD6wLLgXEstJKYZKAFS2kO+rBRi0p3LqcI= -k8s.io/component-base v0.26.2/go.mod h1:DxbuIe9M3IZPRxPIzhch2m1eT7uFrSBJUBuVCQEBivs= -k8s.io/klog/v2 v2.100.1 h1:7WCHKK6K8fNhTqfBhISHQ97KrnJNFZMcQvKp7gP/tmg= -k8s.io/klog/v2 v2.100.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= -k8s.io/kube-openapi v0.0.0-20230303024457-afdc3dddf62d h1:VcFq5n7wCJB2FQMCIHfC+f+jNcGgNMar1uKd6rVlifU= -k8s.io/kube-openapi v0.0.0-20230303024457-afdc3dddf62d/go.mod h1:y5VtZWM9sHHc2ZodIH/6SHzXj+TPU5USoA8lcIeKEKY= -k8s.io/kubectl v0.25.11 h1:6bsft5Gan6BCvQ7cJbDRFjTm4Zfq8GuUYpsWAdVngYE= -k8s.io/kubectl v0.25.11/go.mod h1:8mIfgkFgT+yJ8/TlmPW1qoRh46H2si9q5nW8id7i9iM= -k8s.io/utils v0.0.0-20230711102312-30195339c3c7 h1:ZgnF1KZsYxWIifwSNZFZgNtWE89WI5yiP5WwlfDoIyc= -k8s.io/utils v0.0.0-20230711102312-30195339c3c7/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= -nhooyr.io/websocket v1.8.7 h1:usjR2uOr/zjjkVMy0lW+PPohFok7PCow5sDjLgX4P4g= -nhooyr.io/websocket v1.8.7/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0= +k8s.io/cli-runtime v0.28.2 h1:64meB2fDj10/ThIMEJLO29a1oujSm0GQmKzh1RtA/uk= +k8s.io/cli-runtime v0.28.2/go.mod h1:bTpGOvpdsPtDKoyfG4EG041WIyFZLV9qq4rPlkyYfDA= +k8s.io/client-go v0.28.2 h1:DNoYI1vGq0slMBN/SWKMZMw0Rq+0EQW6/AK4v9+3VeY= +k8s.io/client-go v0.28.2/go.mod h1:sMkApowspLuc7omj1FOSUxSoqjr+d5Q0Yc0LOFnYFJY= +k8s.io/component-base v0.28.2 h1:Yc1yU+6AQSlpJZyvehm/NkJBII72rzlEsd6MkBQ+G0E= +k8s.io/component-base v0.28.2/go.mod h1:4IuQPQviQCg3du4si8GpMrhAIegxpsgPngPRR/zWpzc= +k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= +k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= +k8s.io/kube-openapi v0.0.0-20240709000822-3c01b740850f h1:2sXuKesAYbRHxL3aE2PN6zX/gcJr22cjrsej+W784Tc= +k8s.io/kube-openapi v0.0.0-20240709000822-3c01b740850f/go.mod h1:UxDHUPsUwTOOxSU+oXURfFBcAS6JwiRXTYqYwfuGowc= +k8s.io/kubectl v0.28.2 h1:fOWOtU6S0smdNjG1PB9WFbqEIMlkzU5ahyHkc7ESHgM= +k8s.io/kubectl v0.28.2/go.mod h1:6EQWTPySF1fn7yKoQZHYf9TPwIl2AygHEcJoxFekr64= +k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 h1:pUdcCO1Lk/tbT5ztQWOBi5HBgbBP1J8+AsQnQCKsi8A= +k8s.io/utils v0.0.0-20240711033017-18e509b52bc8/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= +nhooyr.io/websocket v1.8.10 h1:mv4p+MnGrLDcPlBoWsvPP7XCzTYMXP9F9eIGoKbgx7Q= +nhooyr.io/websocket v1.8.10/go.mod h1:rN9OFWIUwuxg4fR5tELlYC04bXYowCP9GX47ivo2l+c= nullprogram.com/x/optparse v1.0.0/go.mod h1:KdyPE+Igbe0jQUrVfMqDMeJQIJZEuyV7pjYmp6pbG50= -pgregory.net/rapid v0.5.5 h1:jkgx1TjbQPD/feRoK+S/mXw9e1uj6WilpHrXJowi6oA= -pgregory.net/rapid v0.5.5/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= +pgregory.net/rapid v1.1.0 h1:CMa0sjHSru3puNx+J0MIAuiiEV4N0qj8/cMWGBBCsjw= +pgregory.net/rapid v1.1.0/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= rsc.io/tmplfunc v0.0.3 h1:53XFQh69AfOa8Tw0Jm7t+GV7KZhOi6jzsCzTtKbMvzU= rsc.io/tmplfunc v0.0.3/go.mod h1:AG3sTPzElb1Io3Yg4voV9AGZJuleGAwaVRxL9M49PhA= -sigs.k8s.io/controller-runtime v0.13.0 h1:iqa5RNciy7ADWnIc8QxCbOX5FEKVR3uxVxKHRMc2WIQ= -sigs.k8s.io/controller-runtime v0.13.0/go.mod h1:Zbz+el8Yg31jubvAEyglRZGdLAjplZl+PgtYNI6WNTI= +sigs.k8s.io/controller-runtime v0.16.2 h1:mwXAVuEk3EQf478PQwQ48zGOXvW27UJc8NHktQVuIPU= +sigs.k8s.io/controller-runtime v0.16.2/go.mod h1:vpMu3LpI5sYWtujJOa2uPK61nB5rbwlN7BAB8aSLvGU= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= -sigs.k8s.io/kustomize/api v0.12.1 h1:7YM7gW3kYBwtKvoY216ZzY+8hM+lV53LUayghNRJ0vM= -sigs.k8s.io/kustomize/api v0.12.1/go.mod h1:y3JUhimkZkR6sbLNwfJHxvo1TCLwuwm14sCYnkH6S1s= -sigs.k8s.io/kustomize/kyaml v0.13.9 h1:Qz53EAaFFANyNgyOEJbT/yoIHygK40/ZcvU3rgry2Tk= -sigs.k8s.io/kustomize/kyaml v0.13.9/go.mod h1:QsRbD0/KcU+wdk0/L0fIp2KLnohkVzs6fQ85/nOXac4= -sigs.k8s.io/structured-merge-diff/v4 v4.3.0 h1:UZbZAZfX0wV2zr7YZorDz6GXROfDFj6LvqCRm4VUVKk= -sigs.k8s.io/structured-merge-diff/v4 v4.3.0/go.mod h1:N8hJocpFajUSSeSJ9bOZ77VzejKZaXsTtZo4/u7Io08= +sigs.k8s.io/kustomize/api v0.17.2 h1:E7/Fjk7V5fboiuijoZHgs4aHuexi5Y2loXlVOAVAG5g= +sigs.k8s.io/kustomize/api v0.17.2/go.mod h1:UWTz9Ct+MvoeQsHcJ5e+vziRRkwimm3HytpZgIYqye0= +sigs.k8s.io/kustomize/kyaml v0.17.1 h1:TnxYQxFXzbmNG6gOINgGWQt09GghzgTP6mIurOgrLCQ= +sigs.k8s.io/kustomize/kyaml v0.17.1/go.mod h1:9V0mCjIEYjlXuCdYsSXvyoy2BTsLESH7TlGV81S282U= +sigs.k8s.io/structured-merge-diff/v4 v4.4.1 h1:150L+0vs/8DA78h1u02ooW1/fFq/Lwr+sGiqlzvrtq4= +sigs.k8s.io/structured-merge-diff/v4 v4.4.1/go.mod h1:N8hJocpFajUSSeSJ9bOZ77VzejKZaXsTtZo4/u7Io08= sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= diff --git a/integration-tests/load/ocr/gun.go b/integration-tests/load/ocr/gun.go index c4b79ceaf42..990c77e0b3a 100644 --- a/integration-tests/load/ocr/gun.go +++ b/integration-tests/load/ocr/gun.go @@ -6,8 +6,10 @@ import ( "time" "github.com/rs/zerolog" - "github.com/smartcontractkit/seth" - "github.com/smartcontractkit/wasp" + + "github.com/smartcontractkit/chainlink-testing-framework/wasp" + + "github.com/smartcontractkit/chainlink-testing-framework/seth" "github.com/smartcontractkit/chainlink/integration-tests/contracts" ) diff --git a/integration-tests/load/ocr/helper.go b/integration-tests/load/ocr/helper.go deleted file mode 100644 index f95bf143bce..00000000000 --- a/integration-tests/load/ocr/helper.go +++ /dev/null @@ -1,70 +0,0 @@ -package ocr - -import ( - "fmt" - "math/big" - "math/rand" - "time" - - "github.com/ethereum/go-ethereum/common" - "github.com/rs/zerolog" - - "github.com/smartcontractkit/seth" - - client2 "github.com/smartcontractkit/chainlink-testing-framework/client" - "github.com/smartcontractkit/chainlink/integration-tests/actions" - "github.com/smartcontractkit/chainlink/integration-tests/client" - "github.com/smartcontractkit/chainlink/integration-tests/contracts" -) - -func SetupCluster( - l zerolog.Logger, - seth *seth.Client, - workerNodes []*client.ChainlinkK8sClient, -) (common.Address, error) { - err := actions.FundChainlinkNodesFromRootAddress(l, seth, contracts.ChainlinkK8sClientToChainlinkNodeWithKeysAndAddress(workerNodes), big.NewFloat(3)) - if err != nil { - return common.Address{}, err - } - linkContract, err := contracts.DeployLinkTokenContract(l, seth) - if err != nil { - return common.Address{}, err - } - return common.HexToAddress(linkContract.Address()), nil -} - -func SetupFeed( - l zerolog.Logger, - seth *seth.Client, - lta common.Address, - msClient *client2.MockserverClient, - bootstrapNode *client.ChainlinkK8sClient, - workerNodes []*client.ChainlinkK8sClient, -) ([]contracts.OffchainAggregator, error) { - ocrInstances, err := actions.DeployOCRv1Contracts(l, seth, 1, lta, contracts.ChainlinkK8sClientToChainlinkNodeWithKeysAndAddress(workerNodes)) - if err != nil { - return nil, err - } - err = actions.CreateOCRJobs(ocrInstances, bootstrapNode, workerNodes, 5, msClient, fmt.Sprint(seth.ChainID)) - if err != nil { - return nil, err - } - return ocrInstances, nil -} - -func SimulateEAActivity( - l zerolog.Logger, - eaChangeInterval time.Duration, - ocrInstances []contracts.OffchainAggregator, - workerNodes []*client.ChainlinkK8sClient, - msClient *client2.MockserverClient, -) { - go func() { - for { - time.Sleep(eaChangeInterval) - if err := actions.SetAllAdapterResponsesToTheSameValue(rand.Intn(1000), ocrInstances, workerNodes, msClient); err != nil { - l.Error().Err(err).Msg("failed to update mockserver responses") - } - } - }() -} diff --git a/integration-tests/load/ocr/ocr_test.go b/integration-tests/load/ocr/ocr_test.go index 8d4638f9771..55b683a0a74 100644 --- a/integration-tests/load/ocr/ocr_test.go +++ b/integration-tests/load/ocr/ocr_test.go @@ -3,11 +3,13 @@ package ocr import ( "testing" + "github.com/smartcontractkit/chainlink/integration-tests/actions" + "github.com/stretchr/testify/require" - "github.com/smartcontractkit/wasp" + "github.com/smartcontractkit/chainlink-testing-framework/wasp" - "github.com/smartcontractkit/chainlink-testing-framework/logging" + "github.com/smartcontractkit/chainlink-testing-framework/lib/logging" "github.com/smartcontractkit/chainlink/integration-tests/crib" tc "github.com/smartcontractkit/chainlink/integration-tests/testconfig" @@ -26,17 +28,17 @@ func TestOCRLoad(t *testing.T) { config, err := tc.GetConfig([]string{"Load"}, tc.OCR) require.NoError(t, err) - sethClient, msClient, bootstrapNode, workerNodes, err := crib.ConnectRemote(true) + sethClient, msClient, bootstrapNode, workerNodes, _, err := crib.ConnectRemote() require.NoError(t, err) - lta, err := SetupCluster(l, sethClient, workerNodes) + lta, err := actions.SetupOCRv1Cluster(l, sethClient, config.OCR, workerNodes) require.NoError(t, err) - ocrInstances, err := SetupFeed(l, sethClient, lta, msClient, bootstrapNode, workerNodes) + ocrInstances, err := actions.SetupOCRv1Feed(l, sethClient, lta, config.OCR, msClient, bootstrapNode, workerNodes) require.NoError(t, err) cfg := config.OCR cfgl := config.Logging.Loki - SimulateEAActivity(l, cfg.Load.EAChangeInterval.Duration, ocrInstances, workerNodes, msClient) + actions.SimulateOCRv1EAActivity(l, cfg.Load.EAChangeInterval.Duration, ocrInstances, workerNodes, msClient) p := wasp.NewProfile() p.Add(wasp.NewGenerator(&wasp.Config{ @@ -59,10 +61,10 @@ func TestOCRVolume(t *testing.T) { config, err := tc.GetConfig([]string{"Volume"}, tc.OCR) require.NoError(t, err) - sethClient, msClient, bootstrapNode, workerNodes, err := crib.ConnectRemote(true) + sethClient, msClient, bootstrapNode, workerNodes, _, err := crib.ConnectRemote() require.NoError(t, err) - lta, err := SetupCluster(l, sethClient, workerNodes) + lta, err := actions.SetupOCRv1Cluster(l, sethClient, config.OCR, workerNodes) require.NoError(t, err) cfg := config.OCR @@ -75,7 +77,7 @@ func TestOCRVolume(t *testing.T) { LoadType: wasp.VU, CallTimeout: cfg.Volume.VerificationTimeout.Duration, Schedule: wasp.Plain(*cfg.Volume.Rate, cfg.Volume.TestDuration.Duration), - VU: NewVU(l, sethClient, *cfg.Volume.VURequestsPerUnit, cfg.Volume.RateLimitUnitDuration.Duration, lta, bootstrapNode, workerNodes, msClient), + VU: NewVU(l, sethClient, cfg, *cfg.Volume.VURequestsPerUnit, cfg.Volume.RateLimitUnitDuration.Duration, lta, bootstrapNode, workerNodes, msClient), Labels: CommonTestLabels, LokiConfig: wasp.NewLokiConfig(cfgl.Endpoint, cfgl.TenantId, cfgl.BasicAuth, cfgl.BearerToken), })) diff --git a/integration-tests/load/ocr/vu.go b/integration-tests/load/ocr/vu.go index 88f186c5ee1..c337e338a82 100644 --- a/integration-tests/load/ocr/vu.go +++ b/integration-tests/load/ocr/vu.go @@ -8,17 +8,16 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/rs/zerolog" - - "github.com/smartcontractkit/seth" - - "github.com/smartcontractkit/wasp" "go.uber.org/ratelimit" - client2 "github.com/smartcontractkit/chainlink-testing-framework/client" + client2 "github.com/smartcontractkit/chainlink-testing-framework/lib/client" + "github.com/smartcontractkit/chainlink-testing-framework/seth" + "github.com/smartcontractkit/chainlink-testing-framework/wasp" "github.com/smartcontractkit/chainlink/integration-tests/actions" "github.com/smartcontractkit/chainlink/integration-tests/client" "github.com/smartcontractkit/chainlink/integration-tests/contracts" + "github.com/smartcontractkit/chainlink/integration-tests/testconfig/ocr" ) // VU is a virtual user for the OCR load test @@ -36,11 +35,13 @@ type VU struct { msClient *client2.MockserverClient l zerolog.Logger ocrInstances []contracts.OffchainAggregator + config ocr.OffChainAggregatorsConfig } func NewVU( l zerolog.Logger, seth *seth.Client, + config ocr.OffChainAggregatorsConfig, rate int, rateUnit time.Duration, lta common.Address, @@ -59,6 +60,7 @@ func NewVU( msClient: msClient, bootstrapNode: bootstrapNode, workerNodes: workerNodes, + config: config, } } @@ -74,11 +76,12 @@ func (m *VU) Clone(_ *wasp.Generator) wasp.VirtualUser { msClient: m.msClient, bootstrapNode: m.bootstrapNode, workerNodes: m.workerNodes, + config: m.config, } } func (m *VU) Setup(_ *wasp.Generator) error { - ocrInstances, err := actions.DeployOCRv1Contracts(m.l, m.seth, 1, m.lta, contracts.ChainlinkK8sClientToChainlinkNodeWithKeysAndAddress(m.workerNodes)) + ocrInstances, err := actions.SetupOCRv1Contracts(m.l, m.seth, m.config, m.lta, contracts.ChainlinkK8sClientToChainlinkNodeWithKeysAndAddress(m.workerNodes)) if err != nil { return err } diff --git a/integration-tests/load/vrfv2/gun.go b/integration-tests/load/vrfv2/gun.go index bf7449a2470..20a20b40834 100644 --- a/integration-tests/load/vrfv2/gun.go +++ b/integration-tests/load/vrfv2/gun.go @@ -4,10 +4,12 @@ import ( "math/rand" "github.com/rs/zerolog" - "github.com/smartcontractkit/seth" - "github.com/smartcontractkit/wasp" - seth_utils "github.com/smartcontractkit/chainlink-testing-framework/utils/seth" + "github.com/smartcontractkit/chainlink-testing-framework/wasp" + + "github.com/smartcontractkit/chainlink-testing-framework/seth" + + seth_utils "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/seth" vrfcommon "github.com/smartcontractkit/chainlink/integration-tests/actions/vrf/common" "github.com/smartcontractkit/chainlink/integration-tests/actions/vrf/vrfv2" diff --git a/integration-tests/load/vrfv2/onchain_monitoring.go b/integration-tests/load/vrfv2/onchain_monitoring.go index e057e7f8d23..9ba53f39e7f 100644 --- a/integration-tests/load/vrfv2/onchain_monitoring.go +++ b/integration-tests/load/vrfv2/onchain_monitoring.go @@ -6,7 +6,8 @@ import ( "time" "github.com/rs/zerolog/log" - "github.com/smartcontractkit/wasp" + + "github.com/smartcontractkit/chainlink-testing-framework/wasp" "github.com/smartcontractkit/chainlink/integration-tests/contracts" ) diff --git a/integration-tests/load/vrfv2/vrfv2_test.go b/integration-tests/load/vrfv2/vrfv2_test.go index 0075300c7d3..edf68c283e7 100644 --- a/integration-tests/load/vrfv2/vrfv2_test.go +++ b/integration-tests/load/vrfv2/vrfv2_test.go @@ -7,15 +7,16 @@ import ( "testing" "time" - "github.com/smartcontractkit/seth" + "github.com/smartcontractkit/chainlink-testing-framework/seth" "github.com/rs/zerolog/log" - "github.com/smartcontractkit/wasp" - "github.com/smartcontractkit/chainlink-testing-framework/logging" - "github.com/smartcontractkit/chainlink-testing-framework/networks" - "github.com/smartcontractkit/chainlink-testing-framework/utils/ptr" - "github.com/smartcontractkit/chainlink-testing-framework/utils/testcontext" + "github.com/smartcontractkit/chainlink-testing-framework/wasp" + + "github.com/smartcontractkit/chainlink-testing-framework/lib/logging" + "github.com/smartcontractkit/chainlink-testing-framework/lib/networks" + "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/ptr" + "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/testcontext" "github.com/smartcontractkit/chainlink/integration-tests/actions" vrfcommon "github.com/smartcontractkit/chainlink/integration-tests/actions/vrf/common" "github.com/smartcontractkit/chainlink/integration-tests/actions/vrf/vrfv2" @@ -72,9 +73,9 @@ func TestVRFV2Performance(t *testing.T) { Uint16("RandomnessRequestCountPerRequestDeviation", *vrfv2Config.General.RandomnessRequestCountPerRequestDeviation). Bool("UseExistingEnv", *vrfv2Config.General.UseExistingEnv). Msg("Performance Test Configuration") + cleanupFn := func() { teardown(t, vrfContracts.VRFV2Consumers[0], lc, updatedLabels, testReporter, testType, &testConfig) - require.NoError(t, err, "Getting Seth client shouldn't fail") if sethClient.Cfg.IsSimulatedNetwork() { l.Info(). @@ -82,6 +83,8 @@ func TestVRFV2Performance(t *testing.T) { Msg("Network is a simulated network. Skipping fund return for Coordinator Subscriptions.") } else { if *vrfv2Config.General.CancelSubsAfterTestRun { + // wait for all txs to be mined in order to avoid nonce issues + time.Sleep(10 * time.Second) //cancel subs and return funds to sub owner vrfv2.CancelSubsAndReturnFunds(testcontext.Get(t), vrfContracts, sethClient.MustGetRootKeyAddress().Hex(), subIDsForCancellingAfterTest, l) } @@ -307,7 +310,7 @@ func TestVRFV2BHSPerformance(t *testing.T) { wgBlockNumberTobe.Add(1) //Wait at least 256 blocks latestBlockNumber, err := sethClient.Client.BlockNumber(testcontext.Get(t)) - require.NoError(t, err) + require.NoError(t, err, "error getting latest block number") _, err = actions.WaitForBlockNumberToBe( testcontext.Get(t), latestBlockNumber+uint64(257), diff --git a/integration-tests/load/vrfv2/vrfv2cmd/dashboard.go b/integration-tests/load/vrfv2/vrfv2cmd/dashboard.go index e80d7516fd4..24e67991380 100644 --- a/integration-tests/load/vrfv2/vrfv2cmd/dashboard.go +++ b/integration-tests/load/vrfv2/vrfv2cmd/dashboard.go @@ -3,7 +3,7 @@ package main import ( "os" - db "github.com/smartcontractkit/wasp/dashboard" + db "github.com/smartcontractkit/chainlink-testing-framework/wasp/dashboard" "github.com/K-Phoen/grabana/dashboard" "github.com/K-Phoen/grabana/logs" diff --git a/integration-tests/load/vrfv2plus/gun.go b/integration-tests/load/vrfv2plus/gun.go index 430e9f5ff12..4aac3927518 100644 --- a/integration-tests/load/vrfv2plus/gun.go +++ b/integration-tests/load/vrfv2plus/gun.go @@ -5,10 +5,12 @@ import ( "math/rand" "github.com/rs/zerolog" - "github.com/smartcontractkit/seth" - "github.com/smartcontractkit/wasp" - seth_utils "github.com/smartcontractkit/chainlink-testing-framework/utils/seth" + "github.com/smartcontractkit/chainlink-testing-framework/wasp" + + "github.com/smartcontractkit/chainlink-testing-framework/seth" + + seth_utils "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/seth" "github.com/smartcontractkit/chainlink/integration-tests/actions" vrfcommon "github.com/smartcontractkit/chainlink/integration-tests/actions/vrf/common" diff --git a/integration-tests/load/vrfv2plus/onchain_monitoring.go b/integration-tests/load/vrfv2plus/onchain_monitoring.go index 50c0ac18a98..2bb082dc118 100644 --- a/integration-tests/load/vrfv2plus/onchain_monitoring.go +++ b/integration-tests/load/vrfv2plus/onchain_monitoring.go @@ -6,7 +6,8 @@ import ( "time" "github.com/rs/zerolog/log" - "github.com/smartcontractkit/wasp" + + "github.com/smartcontractkit/chainlink-testing-framework/wasp" "github.com/smartcontractkit/chainlink/integration-tests/contracts" ) diff --git a/integration-tests/load/vrfv2plus/vrfv2plus_test.go b/integration-tests/load/vrfv2plus/vrfv2plus_test.go index e8e1d7779c1..d3f985df143 100644 --- a/integration-tests/load/vrfv2plus/vrfv2plus_test.go +++ b/integration-tests/load/vrfv2plus/vrfv2plus_test.go @@ -6,16 +6,17 @@ import ( "testing" "time" - "github.com/smartcontractkit/seth" + "github.com/smartcontractkit/chainlink-testing-framework/seth" "github.com/rs/zerolog/log" - "github.com/smartcontractkit/wasp" "github.com/stretchr/testify/require" - "github.com/smartcontractkit/chainlink-testing-framework/logging" - "github.com/smartcontractkit/chainlink-testing-framework/networks" - "github.com/smartcontractkit/chainlink-testing-framework/utils/ptr" - "github.com/smartcontractkit/chainlink-testing-framework/utils/testcontext" + "github.com/smartcontractkit/chainlink-testing-framework/wasp" + + "github.com/smartcontractkit/chainlink-testing-framework/lib/logging" + "github.com/smartcontractkit/chainlink-testing-framework/lib/networks" + "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/ptr" + "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/testcontext" "github.com/smartcontractkit/chainlink/integration-tests/actions/vrf/vrfv2plus" "github.com/smartcontractkit/chainlink/integration-tests/contracts" "github.com/smartcontractkit/chainlink/integration-tests/testreporters" @@ -81,6 +82,8 @@ func TestVRFV2PlusPerformance(t *testing.T) { Msg("Network is a simulated network. Skipping fund return for Coordinator Subscriptions.") } else { if *testConfig.VRFv2Plus.General.CancelSubsAfterTestRun { + // wait for all txs to be mined in order to avoid nonce issues + time.Sleep(10 * time.Second) //cancel subs and return funds to sub owner vrfv2plus.CancelSubsAndReturnFunds(testcontext.Get(t), vrfContracts, sethClient.MustGetRootKeyAddress().Hex(), subIDsForCancellingAfterTest, l) } diff --git a/integration-tests/load/vrfv2plus/vrfv2pluscmd/dashboard.go b/integration-tests/load/vrfv2plus/vrfv2pluscmd/dashboard.go index 75853e7e211..569a0bd1346 100644 --- a/integration-tests/load/vrfv2plus/vrfv2pluscmd/dashboard.go +++ b/integration-tests/load/vrfv2plus/vrfv2pluscmd/dashboard.go @@ -3,7 +3,7 @@ package main import ( "os" - db "github.com/smartcontractkit/wasp/dashboard" + db "github.com/smartcontractkit/chainlink-testing-framework/wasp/dashboard" "github.com/K-Phoen/grabana/dashboard" "github.com/K-Phoen/grabana/logs" diff --git a/integration-tests/load/zcluster/cluster_entrypoint_test.go b/integration-tests/load/zcluster/cluster_entrypoint_test.go index aace97b0825..0f3ea5e4044 100644 --- a/integration-tests/load/zcluster/cluster_entrypoint_test.go +++ b/integration-tests/load/zcluster/cluster_entrypoint_test.go @@ -3,9 +3,10 @@ package zcluster import ( "testing" - "github.com/smartcontractkit/wasp" "github.com/stretchr/testify/require" + "github.com/smartcontractkit/chainlink-testing-framework/wasp" + tc "github.com/smartcontractkit/chainlink/integration-tests/testconfig" ) diff --git a/integration-tests/migration/upgrade_version_test.go b/integration-tests/migration/upgrade_version_test.go index a17f00e179f..12f0c2a1e74 100644 --- a/integration-tests/migration/upgrade_version_test.go +++ b/integration-tests/migration/upgrade_version_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/smartcontractkit/chainlink-testing-framework/logging" + "github.com/smartcontractkit/chainlink-testing-framework/lib/logging" "github.com/smartcontractkit/chainlink/integration-tests/actions" "github.com/smartcontractkit/chainlink/integration-tests/docker/test_env" diff --git a/integration-tests/reorg/automation_reorg_test.go b/integration-tests/reorg/automation_reorg_test.go index 2a2350e1956..fde37d9f06f 100644 --- a/integration-tests/reorg/automation_reorg_test.go +++ b/integration-tests/reorg/automation_reorg_test.go @@ -2,30 +2,29 @@ package reorg //revive:disable:dot-imports import ( + "context" "fmt" "math/big" "regexp" "strconv" + "strings" "testing" - "time" - seth_utils "github.com/smartcontractkit/chainlink-testing-framework/utils/seth" + "go.uber.org/zap/zapcore" + + "github.com/smartcontractkit/chainlink-testing-framework/lib/testreporters" + sethUtils "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/seth" + "github.com/smartcontractkit/chainlink/integration-tests/actions/automationv2" + "github.com/smartcontractkit/chainlink/integration-tests/docker/test_env" "github.com/onsi/gomega" "github.com/stretchr/testify/require" - "go.uber.org/zap/zapcore" - ctf_client "github.com/smartcontractkit/chainlink-testing-framework/client" - ctf_config "github.com/smartcontractkit/chainlink-testing-framework/config" - "github.com/smartcontractkit/chainlink-testing-framework/k8s/environment" - "github.com/smartcontractkit/chainlink-testing-framework/k8s/pkg/helm/chainlink" - "github.com/smartcontractkit/chainlink-testing-framework/logging" - "github.com/smartcontractkit/chainlink-testing-framework/networks" - "github.com/smartcontractkit/chainlink-testing-framework/utils/testcontext" + ctfClient "github.com/smartcontractkit/chainlink-testing-framework/lib/client" + "github.com/smartcontractkit/chainlink-testing-framework/lib/logging" + "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/testcontext" - geth_helm "github.com/smartcontractkit/chainlink-testing-framework/k8s/pkg/helm/ethereum" "github.com/smartcontractkit/chainlink/integration-tests/actions" - "github.com/smartcontractkit/chainlink/integration-tests/client" "github.com/smartcontractkit/chainlink/integration-tests/contracts" "github.com/smartcontractkit/chainlink/integration-tests/contracts/ethereum" tc "github.com/smartcontractkit/chainlink/integration-tests/testconfig" @@ -35,46 +34,19 @@ var ( reorgBlockCount = 10 // Number of blocks to reorg (should be less than finalityDepth) upkeepCount = 2 nodeCount = 6 - nodeFundsAmount = new(big.Float).SetFloat64(2) // Each node will have 2 ETH defaultUpkeepGasLimit = uint32(2500000) defaultLinkFunds = int64(9e18) finalityDepth int historyDepth int - - defaultAutomationSettings = map[string]interface{}{ - "toml": "", - "db": map[string]interface{}{ - "stateful": false, - "capacity": "1Gi", - "resources": map[string]interface{}{ - "requests": map[string]interface{}{ - "cpu": "250m", - "memory": "256Mi", - }, - "limits": map[string]interface{}{ - "cpu": "250m", - "memory": "256Mi", - }, - }, - }, - } - defaultOCRRegistryConfig = contracts.KeeperRegistrySettings{ - PaymentPremiumPPB: uint32(200000000), - FlatFeeMicroLINK: uint32(0), - BlockCountPerTurn: big.NewInt(10), - CheckGasLimit: uint32(2500000), - StalenessSeconds: big.NewInt(90000), - GasCeilingMultiplier: uint16(1), - MinUpkeepSpend: big.NewInt(0), - MaxPerformGas: uint32(5000000), - FallbackGasPrice: big.NewInt(2e11), - FallbackLinkPrice: big.NewInt(2e18), - MaxCheckDataSize: uint32(5000), - MaxPerformDataSize: uint32(5000), - MaxRevertDataSize: uint32(5000), - } ) +var logScannerSettings = test_env.GetDefaultChainlinkNodeLogScannerSettingsWithExtraAllowedMessages(testreporters.NewAllowedLogMessage( + "Got very old block.", + "It is expected, because we are causing reorgs", + zapcore.DPanicLevel, + testreporters.WarnAboutAllowedMsgs_No, +)) + /* * This test verifies that conditional upkeeps automatically recover from chain reorgs. * @@ -102,10 +74,10 @@ func TestAutomationReorg(t *testing.T) { return 0, fmt.Errorf("no match found for %s", substring) } - finalityDepth, err = findIntValue(c.NodeConfig.CommonChainConfigTOML, "FinalityDepth") + finalityDepth, err = findIntValue(c.NodeConfig.ChainConfigTOMLByChainID["1337"], "FinalityDepth") require.NoError(t, err, "Error getting finality depth") - historyDepth, err = findIntValue(c.NodeConfig.CommonChainConfigTOML, "HistoryDepth") + historyDepth, err = findIntValue(c.NodeConfig.ChainConfigTOMLByChainID["1337"], "HistoryDepth") require.NoError(t, err, "Error getting history depth") require.Less(t, reorgBlockCount, finalityDepth, "Reorg block count should be less than finality depth") @@ -119,6 +91,8 @@ func TestAutomationReorg(t *testing.T) { "registry_2_1_logtrigger": ethereum.RegistryVersion_2_1, "registry_2_2_conditional": ethereum.RegistryVersion_2_2, // Works only on Chainlink Node v2.10.0 or greater "registry_2_2_logtrigger": ethereum.RegistryVersion_2_2, // Works only on Chainlink Node v2.10.0 or greater + "registry_2_3_conditional": ethereum.RegistryVersion_2_3, + "registry_2_3_logtrigger": ethereum.RegistryVersion_2_3, } for n, rv := range registryVersions { @@ -131,106 +105,71 @@ func TestAutomationReorg(t *testing.T) { t.Fatal(err) } - network := networks.MustGetSelectedNetworkConfig(config.Network)[0] - - tomlConfig, err := actions.BuildTOMLNodeConfigForK8s(&config, network) - require.NoError(t, err, "Error building TOML config") - - defaultAutomationSettings["replicas"] = nodeCount - defaultAutomationSettings["toml"] = tomlConfig - - var overrideFn = func(_ interface{}, target interface{}) { - ctf_config.MustConfigOverrideChainlinkVersion(config.GetChainlinkImageConfig(), target) - ctf_config.MightConfigOverridePyroscopeKey(config.GetPyroscopeConfig(), target) + privateNetwork, err := actions.EthereumNetworkConfigFromConfig(l, &config) + require.NoError(t, err, "Error building ethereum network config") + + env, err := test_env.NewCLTestEnvBuilder(). + WithTestInstance(t). + WithTestConfig(&config). + WithPrivateEthereumNetwork(privateNetwork.EthereumNetworkConfig). + WithMockAdapter(). + WithCLNodes(nodeCount). + WithStandardCleanup(). + WithChainlinkNodeLogScanner(logScannerSettings). + Build() + require.NoError(t, err, "Error deploying test environment") + + nodeClients := env.ClCluster.NodeAPIs() + + evmNetwork, err := env.GetFirstEvmNetwork() + require.NoError(t, err, "Error getting first evm network") + + sethClient, err := sethUtils.GetChainClient(&config, *evmNetwork) + require.NoError(t, err, "Error getting seth client") + + err = actions.FundChainlinkNodesFromRootAddress(l, sethClient, contracts.ChainlinkClientToChainlinkNodeWithKeysAndAddress(env.ClCluster.NodeAPIs()), big.NewFloat(*config.GetCommonConfig().ChainlinkNodeFunding)) + require.NoError(t, err, "Failed to fund the nodes") + + gethRPCClient := ctfClient.NewRPCClient(evmNetwork.HTTPURLs[0], nil) + + a := automationv2.NewAutomationTestDocker(l, sethClient, nodeClients, &config) + a.SetMercuryCredentialName("cred1") + a.RegistrySettings = actions.ReadRegistryConfig(config) + a.RegistrySettings.RegistryVersion = registryVersion + a.PluginConfig = actions.ReadPluginConfig(config) + a.PublicConfig = actions.ReadPublicConfig(config) + a.RegistrarSettings = contracts.KeeperRegistrarSettings{ + AutoApproveConfigType: uint8(2), + AutoApproveMaxAllowed: 1000, + MinLinkJuels: big.NewInt(0), } - cd := chainlink.NewWithOverride(0, defaultAutomationSettings, config.ChainlinkImage, overrideFn) - - testEnvironment := environment. - New(&environment.Config{ - NamespacePrefix: fmt.Sprintf("automation-reorg-%d", reorgBlockCount), - TTL: time.Hour * 1, - Test: t}). - // Use Geth blockchain to simulate reorgs - AddHelm(geth_helm.New(&geth_helm.Props{ - NetworkName: network.Name, - Simulated: true, - WsURLs: network.URLs, - })). - AddHelm(cd) - err = testEnvironment.Run() - require.NoError(t, err, "Error setting up test environment") - - if testEnvironment.WillUseRemoteRunner() { - return - } - if !testEnvironment.Cfg.InsideK8s { - // Test is running locally, set forwarded URL of Geth blockchain node - wsURLs := testEnvironment.URLs[network.Name+"_internal"] - httpURLs := testEnvironment.URLs[network.Name+"_internal_http"] - require.NotEmpty(t, wsURLs, "Forwarded Geth URLs should not be empty") - require.NotEmpty(t, httpURLs, "Forwarded Geth URLs should not be empty") - network.URLs = wsURLs - network.HTTPURLs = httpURLs - } + a.SetupAutomationDeployment(t) + a.SetDockerEnv(env) - gethRPCClient := ctf_client.NewRPCClient(network.HTTPURLs[0]) - chainClient, err := seth_utils.GetChainClient(config, network) - require.NoError(t, err, "Error connecting to blockchain") - chainlinkNodes, err := client.ConnectChainlinkNodes(testEnvironment) - require.NoError(t, err, "Error connecting to Chainlink nodes") + sb, err := a.ChainClient.Client.BlockNumber(context.Background()) + require.NoError(t, err, "Failed to get start block") - // Register cleanup for any test t.Cleanup(func() { - err := actions.TeardownSuite(t, chainClient, testEnvironment, chainlinkNodes, nil, zapcore.PanicLevel, &config) - require.NoError(t, err, "Error tearing down environment") + actions.GetStalenessReportCleanupFn(t, a.Logger, a.ChainClient, sb, a.Registry, registryVersion)() }) - err = actions.FundChainlinkNodesFromRootAddress(l, chainClient, contracts.ChainlinkK8sClientToChainlinkNodeWithKeysAndAddress(chainlinkNodes), nodeFundsAmount) - require.NoError(t, err, "Error funding Chainlink nodes") - - linkToken, err := contracts.DeployLinkTokenContract(l, chainClient) - require.NoError(t, err, "Error deploying LINK token") - - registry, registrar := actions.DeployAutoOCRRegistryAndRegistrar( - t, - chainClient, - registryVersion, - defaultOCRRegistryConfig, - linkToken, - ) - - // Fund the registry with LINK - err = linkToken.Transfer(registry.Address(), big.NewInt(0).Mul(big.NewInt(1e18), big.NewInt(int64(upkeepCount)))) - require.NoError(t, err, "Funding keeper registry contract shouldn't fail") - - actions.CreateOCRKeeperJobs(t, chainlinkNodes, registry.Address(), network.ChainID, 0, registryVersion) - nodesWithoutBootstrap := chainlinkNodes[1:] - defaultOCRRegistryConfig.RegistryVersion = registryVersion - ocrConfig, err := actions.BuildAutoOCR2ConfigVars(t, nodesWithoutBootstrap, defaultOCRRegistryConfig, registrar.Address(), 5*time.Second, registry.ChainModuleAddress(), registry.ReorgProtectionEnabled()) - require.NoError(t, err, "OCR2 config should be built successfully") - if registryVersion == ethereum.RegistryVersion_2_0 { - err = registry.SetConfig(defaultOCRRegistryConfig, ocrConfig) - } else { - err = registry.SetConfigTypeSafe(ocrConfig) - } - require.NoError(t, err, "Registry config should be be set successfully") - // Use the name to determine if this is a log trigger or not - isLogTrigger := name == "registry_2_1_logtrigger" || name == "registry_2_2_logtrigger" + isLogTrigger := strings.Contains(name, "logtrigger") consumers, upkeepIDs := actions.DeployConsumers( t, - chainClient, - registry, - registrar, - linkToken, + sethClient, + a.Registry, + a.Registrar, + a.LinkToken, upkeepCount, big.NewInt(defaultLinkFunds), defaultUpkeepGasLimit, isLogTrigger, false, false, - nil, + a.WETHToken, + &config, ) if isLogTrigger { diff --git a/integration-tests/runner_helpers.go b/integration-tests/runner_helpers.go index def2ebdc1d4..bd3ebfa3e30 100644 --- a/integration-tests/runner_helpers.go +++ b/integration-tests/runner_helpers.go @@ -17,7 +17,7 @@ import ( "github.com/manifoldco/promptui" "github.com/rs/zerolog/log" - "github.com/smartcontractkit/chainlink-testing-framework/networks" + "github.com/smartcontractkit/chainlink-testing-framework/lib/networks" ) func waitForWorkflowRun(branch, ghUser string) (string, error) { diff --git a/integration-tests/scripts/buildTests b/integration-tests/scripts/buildTests index b6033c1c415..7be2d0c5a7e 100755 --- a/integration-tests/scripts/buildTests +++ b/integration-tests/scripts/buildTests @@ -8,7 +8,7 @@ set -ex # get this scripts directory SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd) -cd "$SCRIPT_DIR"/../ || exit 1 +cd "$SCRIPT_DIR"/../ || { echo "Error: Failed to change directory to $SCRIPT_DIR/../"; exit 1; } helm repo update @@ -23,10 +23,16 @@ for x in $tosplit do if [ "$x" = "load" ]; then echo "Changing directory and executing go test -c ./... for 'load' package" - pushd "./load" && go test -c -tags embed -o .. ./... + pushd "./load" && go test -c -tags embed -o ../ ./... + popd + elif [ "$x" = "ccip-load" ]; then + echo "Changing directory and executing go test -c ./... for 'ccip-load' package" + pushd "./ccip-tests/load" && go test -c -tags embed -o ../ ./... + mv ../load.test ../ccip-load.test # rename the binary to match the suite name popd else go test -c -tags embed ./"${x}" fi + echo "Built ${x}.test" done IFS=$OIFS diff --git a/integration-tests/scripts/entrypoint b/integration-tests/scripts/entrypoint index d4ebe722a1d..dc4ff1d0dbe 100755 --- a/integration-tests/scripts/entrypoint +++ b/integration-tests/scripts/entrypoint @@ -14,6 +14,11 @@ cd "$SCRIPT_DIR"/../ || exit 1 # SUITE=${SUITE:=} the suite of tests you want to run # TEST_NAME=${TEST_NAME:=} The specific test to run +if [ -z "${SUITE}" ]; then + echo "SUITE is not set. You likely need to set the TEST_SUITE env var in your workflow. Exiting." + exit 1 +fi + # run the tests ./${SUITE}.test -test.v -test.count 1 ${ARGS} -test.run ^${TEST_NAME}$ diff --git a/integration-tests/smoke/README.md b/integration-tests/smoke/README.md index 266720c7bc6..c4aa2b91a14 100644 --- a/integration-tests/smoke/README.md +++ b/integration-tests/smoke/README.md @@ -75,9 +75,3 @@ Then execute: go test -v -run ${TestName} ``` - - -### Debugging CL client API calls -```bash -export CL_CLIENT_DEBUG=true -``` \ No newline at end of file diff --git a/integration-tests/smoke/automation_test.go b/integration-tests/smoke/automation_test.go index 62462d641a8..2e56237e9ca 100644 --- a/integration-tests/smoke/automation_test.go +++ b/integration-tests/smoke/automation_test.go @@ -12,7 +12,7 @@ import ( "testing" "time" - seth_utils "github.com/smartcontractkit/chainlink-testing-framework/utils/seth" + "github.com/smartcontractkit/chainlink/integration-tests/utils" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" @@ -20,12 +20,9 @@ import ( "github.com/onsi/gomega" "github.com/stretchr/testify/require" - ocr3 "github.com/smartcontractkit/libocr/offchainreporting2plus/ocr3confighelper" - - ocr2keepers30config "github.com/smartcontractkit/chainlink-automation/pkg/v3/config" - ctfTestEnv "github.com/smartcontractkit/chainlink-testing-framework/docker/test_env" - "github.com/smartcontractkit/chainlink-testing-framework/logging" - "github.com/smartcontractkit/chainlink-testing-framework/utils/testcontext" + ctftestenv "github.com/smartcontractkit/chainlink-testing-framework/lib/docker/test_env" + "github.com/smartcontractkit/chainlink-testing-framework/lib/logging" + "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/testcontext" "github.com/smartcontractkit/chainlink/integration-tests/actions/automationv2" "github.com/smartcontractkit/chainlink/integration-tests/contracts" @@ -62,24 +59,6 @@ func upgradeChainlinkNodeVersionsLocal( return nil } -func automationDefaultRegistryConfig(c tc.AutomationTestConfig) contracts.KeeperRegistrySettings { - registrySettings := c.GetAutomationConfig().AutomationConfig.RegistrySettings - return contracts.KeeperRegistrySettings{ - PaymentPremiumPPB: *registrySettings.PaymentPremiumPPB, - FlatFeeMicroLINK: *registrySettings.FlatFeeMicroLINK, - CheckGasLimit: *registrySettings.CheckGasLimit, - StalenessSeconds: registrySettings.StalenessSeconds, - GasCeilingMultiplier: *registrySettings.GasCeilingMultiplier, - MinUpkeepSpend: registrySettings.MinUpkeepSpend, - MaxPerformGas: *registrySettings.MaxPerformGas, - FallbackGasPrice: registrySettings.FallbackGasPrice, - FallbackLinkPrice: registrySettings.FallbackLinkPrice, - MaxCheckDataSize: *registrySettings.MaxCheckDataSize, - MaxPerformDataSize: *registrySettings.MaxPerformDataSize, - MaxRevertDataSize: *registrySettings.MaxRevertDataSize, - } -} - func TestMain(m *testing.M) { logging.Init() // config, err := tc.GetConfig(tc.NoTest, tc.Smoke, tc.Automation) @@ -144,7 +123,7 @@ func SetupAutomationBasic(t *testing.T, nodeUpgrade bool) { isMercury := isMercuryV02 || isMercuryV03 a := setupAutomationTestDocker( - t, registryVersion, automationDefaultRegistryConfig(cfg), isMercuryV02, isMercuryV03, &cfg, + t, registryVersion, actions.ReadRegistryConfig(cfg), isMercuryV02, isMercuryV03, &cfg, ) sb, err := a.ChainClient.Client.BlockNumber(context.Background()) @@ -163,6 +142,7 @@ func SetupAutomationBasic(t *testing.T, nodeUpgrade bool) { isMercury, isBillingTokenNative, a.WETHToken, + &cfg, ) // Do it in two separate loops, so we don't end up setting up one upkeep, but starting the consumer for another one @@ -283,26 +263,13 @@ func TestSetUpkeepTriggerConfig(t *testing.T) { require.NoError(t, err, "Failed to get config") a := setupAutomationTestDocker( - t, registryVersion, automationDefaultRegistryConfig(config), false, false, &config, + t, registryVersion, actions.ReadRegistryConfig(config), false, false, &config, ) sb, err := a.ChainClient.Client.BlockNumber(context.Background()) require.NoError(t, err, "Failed to get start block") - consumers, upkeepIDs := actions.DeployConsumers( - t, - a.ChainClient, - a.Registry, - a.Registrar, - a.LinkToken, - defaultAmountOfUpkeeps, - big.NewInt(automationDefaultLinkFunds), - automationDefaultUpkeepGasLimit, - true, - false, - false, - nil, - ) + consumers, upkeepIDs := actions.DeployConsumers(t, a.ChainClient, a.Registry, a.Registrar, a.LinkToken, defaultAmountOfUpkeeps, big.NewInt(automationDefaultLinkFunds), automationDefaultUpkeepGasLimit, true, false, false, nil, &config) // Start log trigger based upkeeps for all consumers for i := 0; i < len(consumers); i++ { @@ -466,26 +433,13 @@ func TestAutomationAddFunds(t *testing.T) { config, err := tc.GetConfig([]string{"Smoke"}, tc.Automation) require.NoError(t, err, "Failed to get config") a := setupAutomationTestDocker( - t, registryVersion, automationDefaultRegistryConfig(config), false, false, &config, + t, registryVersion, actions.ReadRegistryConfig(config), false, false, &config, ) sb, err := a.ChainClient.Client.BlockNumber(context.Background()) require.NoError(t, err, "Failed to get start block") - consumers, upkeepIDs := actions.DeployConsumers( - t, - a.ChainClient, - a.Registry, - a.Registrar, - a.LinkToken, - defaultAmountOfUpkeeps, - big.NewInt(1), - automationDefaultUpkeepGasLimit, - false, - false, - false, - nil, - ) + consumers, upkeepIDs := actions.DeployConsumers(t, a.ChainClient, a.Registry, a.Registrar, a.LinkToken, defaultAmountOfUpkeeps, big.NewInt(1), automationDefaultUpkeepGasLimit, false, false, false, nil, &config) t.Cleanup(func() { actions.GetStalenessReportCleanupFn(t, a.Logger, a.ChainClient, sb, a.Registry, registryVersion)() @@ -546,26 +500,13 @@ func TestAutomationPauseUnPause(t *testing.T) { require.NoError(t, err, "Failed to get config") a := setupAutomationTestDocker( - t, registryVersion, automationDefaultRegistryConfig(config), false, false, &config, + t, registryVersion, actions.ReadRegistryConfig(config), false, false, &config, ) sb, err := a.ChainClient.Client.BlockNumber(context.Background()) require.NoError(t, err, "Failed to get start block") - consumers, upkeepIDs := actions.DeployConsumers( - t, - a.ChainClient, - a.Registry, - a.Registrar, - a.LinkToken, - defaultAmountOfUpkeeps, - big.NewInt(automationDefaultLinkFunds), - automationDefaultUpkeepGasLimit, - false, - false, - false, - nil, - ) + consumers, upkeepIDs := actions.DeployConsumers(t, a.ChainClient, a.Registry, a.Registrar, a.LinkToken, defaultAmountOfUpkeeps, big.NewInt(automationDefaultLinkFunds), automationDefaultUpkeepGasLimit, false, false, false, nil, &config) t.Cleanup(func() { actions.GetStalenessReportCleanupFn(t, a.Logger, a.ChainClient, sb, a.Registry, registryVersion)() @@ -647,26 +588,13 @@ func TestAutomationRegisterUpkeep(t *testing.T) { require.NoError(t, err, "Failed to get config") a := setupAutomationTestDocker( - t, registryVersion, automationDefaultRegistryConfig(config), false, false, &config, + t, registryVersion, actions.ReadRegistryConfig(config), false, false, &config, ) sb, err := a.ChainClient.Client.BlockNumber(context.Background()) require.NoError(t, err, "Failed to get start block") - consumers, upkeepIDs := actions.DeployConsumers( - t, - a.ChainClient, - a.Registry, - a.Registrar, - a.LinkToken, - defaultAmountOfUpkeeps, - big.NewInt(automationDefaultLinkFunds), - automationDefaultUpkeepGasLimit, - false, - false, - false, - nil, - ) + consumers, upkeepIDs := actions.DeployConsumers(t, a.ChainClient, a.Registry, a.Registrar, a.LinkToken, defaultAmountOfUpkeeps, big.NewInt(automationDefaultLinkFunds), automationDefaultUpkeepGasLimit, false, false, false, nil, &config) t.Cleanup(func() { actions.GetStalenessReportCleanupFn(t, a.Logger, a.ChainClient, sb, a.Registry, registryVersion)() @@ -743,26 +671,13 @@ func TestAutomationPauseRegistry(t *testing.T) { require.NoError(t, err, "Failed to get config") a := setupAutomationTestDocker( - t, registryVersion, automationDefaultRegistryConfig(config), false, false, &config, + t, registryVersion, actions.ReadRegistryConfig(config), false, false, &config, ) sb, err := a.ChainClient.Client.BlockNumber(context.Background()) require.NoError(t, err, "Failed to get start block") - consumers, upkeepIDs := actions.DeployConsumers( - t, - a.ChainClient, - a.Registry, - a.Registrar, - a.LinkToken, - defaultAmountOfUpkeeps, - big.NewInt(automationDefaultLinkFunds), - automationDefaultUpkeepGasLimit, - false, - false, - false, - nil, - ) + consumers, upkeepIDs := actions.DeployConsumers(t, a.ChainClient, a.Registry, a.Registrar, a.LinkToken, defaultAmountOfUpkeeps, big.NewInt(automationDefaultLinkFunds), automationDefaultUpkeepGasLimit, false, false, false, nil, &config) t.Cleanup(func() { actions.GetStalenessReportCleanupFn(t, a.Logger, a.ChainClient, sb, a.Registry, registryVersion)() @@ -823,26 +738,13 @@ func TestAutomationKeeperNodesDown(t *testing.T) { require.NoError(t, err, "Failed to get config") a := setupAutomationTestDocker( - t, registryVersion, automationDefaultRegistryConfig(config), false, false, &config, + t, registryVersion, actions.ReadRegistryConfig(config), false, false, &config, ) sb, err := a.ChainClient.Client.BlockNumber(context.Background()) require.NoError(t, err, "Failed to get start block") - consumers, upkeepIDs := actions.DeployConsumers( - t, - a.ChainClient, - a.Registry, - a.Registrar, - a.LinkToken, - defaultAmountOfUpkeeps, - big.NewInt(automationDefaultLinkFunds), - automationDefaultUpkeepGasLimit, - false, - false, - false, - nil, - ) + consumers, upkeepIDs := actions.DeployConsumers(t, a.ChainClient, a.Registry, a.Registrar, a.LinkToken, defaultAmountOfUpkeeps, big.NewInt(automationDefaultLinkFunds), automationDefaultUpkeepGasLimit, false, false, false, nil, &config) t.Cleanup(func() { actions.GetStalenessReportCleanupFn(t, a.Logger, a.ChainClient, sb, a.Registry, registryVersion)() @@ -931,7 +833,7 @@ func TestAutomationPerformSimulation(t *testing.T) { require.NoError(t, err, "Failed to get config") a := setupAutomationTestDocker( - t, registryVersion, automationDefaultRegistryConfig(config), false, false, &config, + t, registryVersion, actions.ReadRegistryConfig(config), false, false, &config, ) sb, err := a.ChainClient.Client.BlockNumber(context.Background()) @@ -950,6 +852,7 @@ func TestAutomationPerformSimulation(t *testing.T) { 5, // Interval of blocks that upkeeps are expected to be performed 100000, // How much gas should be burned on checkUpkeep() calls 4000000, // How much gas should be burned on performUpkeep() calls. Initially set higher than defaultUpkeepGasLimit + &config, ) t.Cleanup(func() { @@ -1002,7 +905,7 @@ func TestAutomationCheckPerformGasLimit(t *testing.T) { config, err := tc.GetConfig([]string{"Smoke"}, tc.Automation) require.NoError(t, err, "Failed to get config") a := setupAutomationTestDocker( - t, registryVersion, automationDefaultRegistryConfig(config), false, false, &config, + t, registryVersion, actions.ReadRegistryConfig(config), false, false, &config, ) sb, err := a.ChainClient.Client.BlockNumber(context.Background()) @@ -1021,6 +924,7 @@ func TestAutomationCheckPerformGasLimit(t *testing.T) { 5, // Interval of blocks that upkeeps are expected to be performed 100000, // How much gas should be burned on checkUpkeep() calls 4000000, // How much gas should be burned on performUpkeep() calls. Initially set higher than defaultUpkeepGasLimit + &config, ) t.Cleanup(func() { @@ -1109,7 +1013,7 @@ func TestAutomationCheckPerformGasLimit(t *testing.T) { } // Now increase checkGasLimit on registry - highCheckGasLimit := automationDefaultRegistryConfig(config) + highCheckGasLimit := actions.ReadRegistryConfig(config) highCheckGasLimit.CheckGasLimit = uint32(5000000) highCheckGasLimit.RegistryVersion = registryVersion @@ -1157,7 +1061,7 @@ func TestUpdateCheckData(t *testing.T) { require.NoError(t, err, "Failed to get config") a := setupAutomationTestDocker( - t, registryVersion, automationDefaultRegistryConfig(config), false, false, &config, + t, registryVersion, actions.ReadRegistryConfig(config), false, false, &config, ) sb, err := a.ChainClient.Client.BlockNumber(context.Background()) @@ -1173,6 +1077,7 @@ func TestUpdateCheckData(t *testing.T) { big.NewInt(automationDefaultLinkFunds), automationDefaultUpkeepGasLimit, []byte(automationExpectedData), + &config, ) t.Cleanup(func() { @@ -1238,26 +1143,13 @@ func TestSetOffchainConfigWithMaxGasPrice(t *testing.T) { t.Fatal(err) } a := setupAutomationTestDocker( - t, registryVersion, automationDefaultRegistryConfig(config), false, false, &config, + t, registryVersion, actions.ReadRegistryConfig(config), false, false, &config, ) sb, err := a.ChainClient.Client.BlockNumber(context.Background()) require.NoError(t, err, "Failed to get start block") - consumers, upkeepIDs := actions.DeployConsumers( - t, - a.ChainClient, - a.Registry, - a.Registrar, - a.LinkToken, - defaultAmountOfUpkeeps, - big.NewInt(automationDefaultLinkFunds), - automationDefaultUpkeepGasLimit, - false, - false, - false, - nil, - ) + consumers, upkeepIDs := actions.DeployConsumers(t, a.ChainClient, a.Registry, a.Registrar, a.LinkToken, defaultAmountOfUpkeeps, big.NewInt(automationDefaultLinkFunds), automationDefaultUpkeepGasLimit, false, false, false, nil, &config) t.Cleanup(func() { actions.GetStalenessReportCleanupFn(t, a.Logger, a.ChainClient, sb, a.Registry, registryVersion)() @@ -1445,7 +1337,7 @@ func setupAutomationTestDocker( evmNetwork, err := env.GetFirstEvmNetwork() require.NoError(t, err, "Error getting first evm network") - sethClient, err := seth_utils.GetChainClient(automationTestConfig, *evmNetwork) + sethClient, err := utils.TestAwareSethClient(t, automationTestConfig, evmNetwork) require.NoError(t, err, "Error getting seth client") err = actions.FundChainlinkNodesFromRootAddress(l, sethClient, contracts.ChainlinkClientToChainlinkNodeWithKeysAndAddress(env.ClCluster.NodeAPIs()), big.NewFloat(*automationTestConfig.GetCommonConfig().ChainlinkNodeFunding)) @@ -1456,7 +1348,7 @@ func setupAutomationTestDocker( _ = actions.ReturnFundsFromNodes(l, sethClient, contracts.ChainlinkClientToChainlinkNodeWithKeysAndAddress(env.ClCluster.NodeAPIs())) }) - a := automationv2.NewAutomationTestDocker(l, sethClient, nodeClients) + a := automationv2.NewAutomationTestDocker(l, sethClient, nodeClients, automationTestConfig) a.SetMercuryCredentialName("cred1") a.RegistrySettings = registryConfig a.RegistrarSettings = contracts.KeeperRegistrarSettings{ @@ -1464,47 +1356,23 @@ func setupAutomationTestDocker( AutoApproveMaxAllowed: 1000, MinLinkJuels: big.NewInt(0), } - plCfg := automationTestConfig.GetAutomationConfig().AutomationConfig.PluginConfig - a.PluginConfig = ocr2keepers30config.OffchainConfig{ - TargetProbability: *plCfg.TargetProbability, - TargetInRounds: *plCfg.TargetInRounds, - PerformLockoutWindow: *plCfg.PerformLockoutWindow, - GasLimitPerReport: *plCfg.GasLimitPerReport, - GasOverheadPerUpkeep: *plCfg.GasOverheadPerUpkeep, - MinConfirmations: *plCfg.MinConfirmations, - MaxUpkeepBatchSize: *plCfg.MaxUpkeepBatchSize, - } - pubCfg := automationTestConfig.GetAutomationConfig().AutomationConfig.PublicConfig - a.PublicConfig = ocr3.PublicConfig{ - DeltaProgress: *pubCfg.DeltaProgress, - DeltaResend: *pubCfg.DeltaResend, - DeltaInitial: *pubCfg.DeltaInitial, - DeltaRound: *pubCfg.DeltaRound, - DeltaGrace: *pubCfg.DeltaGrace, - DeltaCertifiedCommitRequest: *pubCfg.DeltaCertifiedCommitRequest, - DeltaStage: *pubCfg.DeltaStage, - RMax: *pubCfg.RMax, - MaxDurationQuery: *pubCfg.MaxDurationQuery, - MaxDurationObservation: *pubCfg.MaxDurationObservation, - MaxDurationShouldAcceptAttestedReport: *pubCfg.MaxDurationShouldAcceptAttestedReport, - MaxDurationShouldTransmitAcceptedReport: *pubCfg.MaxDurationShouldTransmitAcceptedReport, - F: *pubCfg.F, - } + a.PluginConfig = actions.ReadPluginConfig(automationTestConfig) + a.PublicConfig = actions.ReadPublicConfig(automationTestConfig) a.SetupAutomationDeployment(t) a.SetDockerEnv(env) if isMercuryV02 || isMercuryV03 { - var imposters []ctfTestEnv.KillgraveImposter - mercuryv03Mock200 := ctfTestEnv.KillgraveImposter{ - Request: ctfTestEnv.KillgraveRequest{ + var imposters []ctftestenv.KillgraveImposter + mercuryv03Mock200 := ctftestenv.KillgraveImposter{ + Request: ctftestenv.KillgraveRequest{ Method: http.MethodGet, Endpoint: "/api/v1/reports/bulk", SchemaFile: nil, Params: &map[string]string{"feedIDs": "0x00028c915d6af0fd66bba2d0fc9405226bca8d6806333121a7d9832103d1563c", "timestamp": "{[\\d+]}"}, Headers: nil, }, - Response: ctfTestEnv.KillgraveResponse{ + Response: ctftestenv.KillgraveResponse{ Status: 200, Body: `{"reports":[{"feedID":"0x00028c915d6af0fd66bba2d0fc9405226bca8d6806333121a7d9832103d1563c","validFromTimestamp":0,"observationsTimestamp":0,"fullReport":"0x00066dfcd1ed2d95b18c948dbc5bd64c687afe93e4ca7d663ddec14c20090ad80000000000000000000000000000000000000000000000000000000000081401000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000002200000000000000000000000000000000000000000000000000000000000000280000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001204554482d5553442d415242495452554d2d544553544e455400000000000000000000000000000000000000000000000000000000000000000000000064891c98000000000000000000000000000000000000000000000000000000289ad8d367000000000000000000000000000000000000000000000000000000289acf0b38000000000000000000000000000000000000000000000000000000289b3da40000000000000000000000000000000000000000000000000000000000018ae7ce74d9fa252a8983976eab600dc7590c778d04813430841bc6e765c34cd81a168d00000000000000000000000000000000000000000000000000000000018ae7cb0000000000000000000000000000000000000000000000000000000064891c98000000000000000000000000000000000000000000000000000000000000000260412b94e525ca6cedc9f544fd86f77606d52fe731a5d069dbe836a8bfc0fb8c911963b0ae7a14971f3b4621bffb802ef0605392b9a6c89c7fab1df8633a5ade00000000000000000000000000000000000000000000000000000000000000024500c2f521f83fba5efc2bf3effaaedde43d0a4adff785c1213b712a3aed0d8157642a84324db0cf9695ebd27708d4608eb0337e0dd87b0e43f0fa70c700d911"}]}`, BodyFile: nil, @@ -1513,15 +1381,15 @@ func setupAutomationTestDocker( }, } - mercuryv02Mock200 := ctfTestEnv.KillgraveImposter{ - Request: ctfTestEnv.KillgraveRequest{ + mercuryv02Mock200 := ctftestenv.KillgraveImposter{ + Request: ctftestenv.KillgraveRequest{ Method: http.MethodGet, Endpoint: "/client", SchemaFile: nil, Params: &map[string]string{"feedIdHex": "{0x00028c915d6af0fd66bba2d0fc9405226bca8d6806333121a7d9832103d1563c|0x4554482d5553442d415242495452554d2d544553544e45540000000000000000}", "blockNumber": "{[\\d+]}"}, Headers: nil, }, - Response: ctfTestEnv.KillgraveResponse{ + Response: ctftestenv.KillgraveResponse{ Status: 200, Body: `{"chainlinkBlob":"0x0001c38d71fed6c320b90e84b6f559459814d068e2a1700adc931ca9717d4fe70000000000000000000000000000000000000000000000000000000001a80b52b4bf1233f9cb71144a253a1791b202113c4ab4a92fa1b176d684b4959666ff8200000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000260000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001004254432d5553442d415242495452554d2d544553544e4554000000000000000000000000000000000000000000000000000000000000000000000000645570be000000000000000000000000000000000000000000000000000002af2b818dc5000000000000000000000000000000000000000000000000000002af2426faf3000000000000000000000000000000000000000000000000000002af32dc209700000000000000000000000000000000000000000000000000000000012130f8df0a9745bb6ad5e2df605e158ba8ad8a33ef8a0acf9851f0f01668a3a3f2b68600000000000000000000000000000000000000000000000000000000012130f60000000000000000000000000000000000000000000000000000000000000002c4a7958dce105089cf5edb68dad7dcfe8618d7784eb397f97d5a5fade78c11a58275aebda478968e545f7e3657aba9dcbe8d44605e4c6fde3e24edd5e22c94270000000000000000000000000000000000000000000000000000000000000002459c12d33986018a8959566d145225f0c4a4e61a9a3f50361ccff397899314f0018162cf10cd89897635a0bb62a822355bd199d09f4abe76e4d05261bb44733d"}`, BodyFile: nil, diff --git a/integration-tests/smoke/ccip_test.go b/integration-tests/smoke/ccip_test.go new file mode 100644 index 00000000000..02c8435c222 --- /dev/null +++ b/integration-tests/smoke/ccip_test.go @@ -0,0 +1,112 @@ +package smoke + +import ( + "strconv" + "testing" + + "github.com/stretchr/testify/require" + + "github.com/smartcontractkit/chainlink-ccip/pluginconfig" + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccipocr3" + + "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/testcontext" + + ccipdeployment "github.com/smartcontractkit/chainlink/integration-tests/deployment/ccip" + "github.com/smartcontractkit/chainlink/integration-tests/deployment/ccip/changeset" + jobv1 "github.com/smartcontractkit/chainlink/integration-tests/deployment/jd/job/v1" + "github.com/smartcontractkit/chainlink/v2/core/logger" +) + +func Test0002_InitialDeployOnLocal(t *testing.T) { + lggr := logger.TestLogger(t) + ctx := ccipdeployment.Context(t) + tenv := ccipdeployment.NewDeployedLocalDevEnvironment(t, lggr) + e := tenv.Env + don := tenv.DON + + state, err := ccipdeployment.LoadOnchainState(tenv.Env, tenv.Ab) + require.NoError(t, err) + + feeds := state.Chains[tenv.FeedChainSel].USDFeeds + tokenConfig := ccipdeployment.NewTokenConfig() + tokenConfig.UpsertTokenInfo(ccipdeployment.LinkSymbol, + pluginconfig.TokenInfo{ + AggregatorAddress: feeds[ccipdeployment.LinkSymbol].Address().String(), + Decimals: ccipdeployment.LinkDecimals, + DeviationPPB: cciptypes.NewBigIntFromInt64(1e9), + }, + ) + // Apply migration + output, err := changeset.Apply0002(tenv.Env, ccipdeployment.DeployCCIPContractConfig{ + HomeChainSel: tenv.HomeChainSel, + FeedChainSel: tenv.FeedChainSel, + TokenConfig: tokenConfig, + ChainsToDeploy: tenv.Env.AllChainSelectors(), + // Capreg/config already exist. + CCIPOnChainState: state, + }) + require.NoError(t, err) + // Get new state after migration. + state, err = ccipdeployment.LoadOnchainState(e, output.AddressBook) + require.NoError(t, err) + + // Apply the jobs. + nodeIdToJobIds := make(map[string][]string) + for nodeID, jobs := range output.JobSpecs { + nodeIdToJobIds[nodeID] = make([]string, 0, len(jobs)) + for _, job := range jobs { + res, err := e.Offchain.ProposeJob(ctx, + &jobv1.ProposeJobRequest{ + NodeId: nodeID, + Spec: job, + }) + require.NoError(t, err) + require.NotNil(t, res.Proposal) + nodeIdToJobIds[nodeID] = append(nodeIdToJobIds[nodeID], res.Proposal.JobId) + } + } + + // Accept all the jobs for this node. + for _, n := range don.Nodes { + jobsToAccept, exists := nodeIdToJobIds[n.NodeId] + require.True(t, exists, "node %s has no jobs to accept", n.NodeId) + for i, jobID := range jobsToAccept { + require.NoError(t, n.AcceptJob(ctx, strconv.Itoa(i+1)), "node -%s failed to accept job %s", n.Name, jobID) + } + } + t.Log("Jobs accepted") + + // Add all lanes + require.NoError(t, ccipdeployment.AddLanesForAll(e, state)) + // Need to keep track of the block number for each chain so that event subscription can be done from that block. + startBlocks := make(map[uint64]*uint64) + // Send a message from each chain to every other chain. + expectedSeqNum := make(map[uint64]uint64) + for src := range e.Chains { + for dest, destChain := range e.Chains { + if src == dest { + continue + } + latesthdr, err := destChain.Client.HeaderByNumber(testcontext.Get(t), nil) + require.NoError(t, err) + block := latesthdr.Number.Uint64() + startBlocks[dest] = &block + seqNum := ccipdeployment.SendRequest(t, e, state, src, dest, false) + expectedSeqNum[dest] = seqNum + } + } + + // Wait for all commit reports to land. + ccipdeployment.ConfirmCommitForAllWithExpectedSeqNums(t, e, state, expectedSeqNum, startBlocks) + + // After commit is reported on all chains, token prices should be updated in FeeQuoter. + for dest := range e.Chains { + linkAddress := state.Chains[dest].LinkToken.Address() + feeQuoter := state.Chains[dest].FeeQuoter + timestampedPrice, err := feeQuoter.GetTokenPrice(nil, linkAddress) + require.NoError(t, err) + require.Equal(t, ccipdeployment.MockLinkPrice, timestampedPrice.Value) + } + // Wait for all exec reports to land + ccipdeployment.ConfirmExecWithSeqNrForAll(t, e, state, expectedSeqNum, startBlocks) +} diff --git a/integration-tests/smoke/cron_test.go b/integration-tests/smoke/cron_test.go index 98c1fe0caf7..51db7215186 100644 --- a/integration-tests/smoke/cron_test.go +++ b/integration-tests/smoke/cron_test.go @@ -9,7 +9,7 @@ import ( "github.com/onsi/gomega" "github.com/stretchr/testify/require" - "github.com/smartcontractkit/chainlink-testing-framework/logging" + "github.com/smartcontractkit/chainlink-testing-framework/lib/logging" "github.com/smartcontractkit/chainlink/integration-tests/actions" "github.com/smartcontractkit/chainlink/integration-tests/client" diff --git a/integration-tests/smoke/flux_test.go b/integration-tests/smoke/flux_test.go index d8773690b23..259752a5342 100644 --- a/integration-tests/smoke/flux_test.go +++ b/integration-tests/smoke/flux_test.go @@ -8,13 +8,14 @@ import ( "testing" "time" + "github.com/smartcontractkit/chainlink/integration-tests/utils" + "github.com/ethereum/go-ethereum/common" "github.com/google/uuid" "github.com/stretchr/testify/require" - "github.com/smartcontractkit/chainlink-testing-framework/logging" - seth_utils "github.com/smartcontractkit/chainlink-testing-framework/utils/seth" - "github.com/smartcontractkit/chainlink-testing-framework/utils/testcontext" + "github.com/smartcontractkit/chainlink-testing-framework/lib/logging" + "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/testcontext" "github.com/smartcontractkit/chainlink/integration-tests/actions" "github.com/smartcontractkit/chainlink/integration-tests/client" @@ -49,7 +50,7 @@ func TestFluxBasic(t *testing.T) { evmNetwork, err := env.GetFirstEvmNetwork() require.NoError(t, err, "Error getting first evm network") - sethClient, err := seth_utils.GetChainClient(config, *evmNetwork) + sethClient, err := utils.TestAwareSethClient(t, config, evmNetwork) require.NoError(t, err, "Error getting seth client") adapterUUID := uuid.NewString() diff --git a/integration-tests/smoke/forwarder_ocr_test.go b/integration-tests/smoke/forwarder_ocr_test.go index a249775dc6a..5e5fb1d40b6 100644 --- a/integration-tests/smoke/forwarder_ocr_test.go +++ b/integration-tests/smoke/forwarder_ocr_test.go @@ -6,13 +6,13 @@ import ( "testing" "time" - seth_utils "github.com/smartcontractkit/chainlink-testing-framework/utils/seth" + "github.com/smartcontractkit/chainlink/integration-tests/utils" "github.com/ethereum/go-ethereum/common" "github.com/stretchr/testify/require" - "github.com/smartcontractkit/chainlink-testing-framework/logging" - "github.com/smartcontractkit/chainlink-testing-framework/utils/testcontext" + "github.com/smartcontractkit/chainlink-testing-framework/lib/logging" + "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/testcontext" "github.com/smartcontractkit/chainlink/integration-tests/actions" "github.com/smartcontractkit/chainlink/integration-tests/contracts" @@ -49,7 +49,7 @@ func TestForwarderOCRBasic(t *testing.T) { evmNetwork, err := env.GetFirstEvmNetwork() require.NoError(t, err, "Error getting first evm network") - sethClient, err := seth_utils.GetChainClient(config, *evmNetwork) + sethClient, err := utils.TestAwareSethClient(t, config, evmNetwork) require.NoError(t, err, "Error getting seth client") err = actions.FundChainlinkNodesFromRootAddress(l, sethClient, contracts.ChainlinkClientToChainlinkNodeWithKeysAndAddress(env.ClCluster.NodeAPIs()), big.NewFloat(*config.Common.ChainlinkNodeFunding)) @@ -60,8 +60,8 @@ func TestForwarderOCRBasic(t *testing.T) { _ = actions.ReturnFundsFromNodes(l, sethClient, contracts.ChainlinkClientToChainlinkNodeWithKeysAndAddress(env.ClCluster.NodeAPIs())) }) - lt, err := contracts.DeployLinkTokenContract(l, sethClient) - require.NoError(t, err, "Deploying Link Token Contract shouldn't fail") + linkContract, err := actions.LinkTokenContract(l, sethClient, config.OCR) + require.NoError(t, err, "Error loading/deploying link token contract") fundingAmount := big.NewFloat(.05) l.Info().Str("ETH amount per node", fundingAmount.String()).Msg("Funding Chainlink nodes") @@ -69,7 +69,7 @@ func TestForwarderOCRBasic(t *testing.T) { require.NoError(t, err, "Error funding Chainlink nodes") operators, authorizedForwarders, _ := actions.DeployForwarderContracts( - t, sethClient, common.HexToAddress(lt.Address()), len(workerNodes), + t, sethClient, common.HexToAddress(linkContract.Address()), len(workerNodes), ) require.Equal(t, len(workerNodes), len(operators), "Number of operators should match number of worker nodes") @@ -81,11 +81,12 @@ func TestForwarderOCRBasic(t *testing.T) { require.NoError(t, err, "Accepting Authorize Receivers on Operator shouldn't fail") actions.TrackForwarder(t, sethClient, authorizedForwarders[i], workerNodes[i]) } + ocrInstances, err := actions.DeployOCRContractsForwarderFlow( l, sethClient, - 1, - common.HexToAddress(lt.Address()), + config.OCR, + common.HexToAddress(linkContract.Address()), contracts.ChainlinkClientToChainlinkNodeWithKeysAndAddress(workerNodes), authorizedForwarders, ) diff --git a/integration-tests/smoke/forwarders_ocr2_test.go b/integration-tests/smoke/forwarders_ocr2_test.go index 863b36e4ede..0cc7d9fafe4 100644 --- a/integration-tests/smoke/forwarders_ocr2_test.go +++ b/integration-tests/smoke/forwarders_ocr2_test.go @@ -7,13 +7,13 @@ import ( "testing" "time" - seth_utils "github.com/smartcontractkit/chainlink-testing-framework/utils/seth" + "github.com/smartcontractkit/chainlink/integration-tests/utils" "github.com/ethereum/go-ethereum/common" "github.com/stretchr/testify/require" - "github.com/smartcontractkit/chainlink-testing-framework/logging" - "github.com/smartcontractkit/chainlink-testing-framework/utils/testcontext" + "github.com/smartcontractkit/chainlink-testing-framework/lib/logging" + "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/testcontext" "github.com/smartcontractkit/chainlink/integration-tests/actions" "github.com/smartcontractkit/chainlink/integration-tests/contracts" @@ -50,7 +50,7 @@ func TestForwarderOCR2Basic(t *testing.T) { evmNetwork, err := env.GetFirstEvmNetwork() require.NoError(t, err, "Error getting first evm network") - sethClient, err := seth_utils.GetChainClient(config, *evmNetwork) + sethClient, err := utils.TestAwareSethClient(t, config, evmNetwork) require.NoError(t, err, "Error getting seth client") err = actions.FundChainlinkNodesFromRootAddress(l, sethClient, contracts.ChainlinkClientToChainlinkNodeWithKeysAndAddress(env.ClCluster.NodeAPIs()), big.NewFloat(*config.Common.ChainlinkNodeFunding)) @@ -61,8 +61,8 @@ func TestForwarderOCR2Basic(t *testing.T) { _ = actions.ReturnFundsFromNodes(l, sethClient, contracts.ChainlinkClientToChainlinkNodeWithKeysAndAddress(env.ClCluster.NodeAPIs())) }) - lt, err := contracts.DeployLinkTokenContract(l, sethClient) - require.NoError(t, err, "Deploying Link Token Contract shouldn't fail") + linkContract, err := actions.LinkTokenContract(l, sethClient, config.OCR2) + require.NoError(t, err, "Error loading/deploying link token contract") fundingAmount := big.NewFloat(.05) l.Info().Str("ETH amount per node", fundingAmount.String()).Msg("Funding Chainlink nodes") @@ -70,7 +70,7 @@ func TestForwarderOCR2Basic(t *testing.T) { require.NoError(t, err, "Error funding Chainlink nodes") operators, authorizedForwarders, _ := actions.DeployForwarderContracts( - t, sethClient, common.HexToAddress(lt.Address()), len(workerNodes), + t, sethClient, common.HexToAddress(linkContract.Address()), len(workerNodes), ) require.Equal(t, len(workerNodes), len(operators), "Number of operators should match number of worker nodes") @@ -90,7 +90,7 @@ func TestForwarderOCR2Basic(t *testing.T) { } ocrOffchainOptions := contracts.DefaultOffChainAggregatorOptions() - ocrInstances, err := actions.DeployOCRv2Contracts(l, sethClient, 1, common.HexToAddress(lt.Address()), transmitters, ocrOffchainOptions) + ocrInstances, err := actions.SetupOCRv2Contracts(l, sethClient, config.OCR2, common.HexToAddress(linkContract.Address()), transmitters, ocrOffchainOptions) require.NoError(t, err, "Error deploying OCRv2 contracts with forwarders") ocrv2Config, err := actions.BuildMedianOCR2ConfigLocal(workerNodes, ocrOffchainOptions) diff --git a/integration-tests/smoke/job_distributor_test.go b/integration-tests/smoke/job_distributor_test.go new file mode 100644 index 00000000000..2d1657faf7e --- /dev/null +++ b/integration-tests/smoke/job_distributor_test.go @@ -0,0 +1,60 @@ +package smoke + +import ( + "context" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + "github.com/smartcontractkit/chainlink-testing-framework/lib/logging" + + "github.com/smartcontractkit/chainlink/integration-tests/actions" + "github.com/smartcontractkit/chainlink/integration-tests/docker/test_env" + tc "github.com/smartcontractkit/chainlink/integration-tests/testconfig" + graphqlClient "github.com/smartcontractkit/chainlink/integration-tests/web/sdk/client" +) + +func TestRegisteringMultipleJobDistributor(t *testing.T) { + t.Parallel() + + l := logging.GetTestLogger(t) + + config, err := tc.GetConfig([]string{"Smoke"}, "job_distributor") + require.NoError(t, err, "Error getting config") + + privateNetwork, err := actions.EthereumNetworkConfigFromConfig(l, &config) + require.NoError(t, err, "Error building ethereum network config") + + env, err := test_env.NewCLTestEnvBuilder(). + WithTestConfig(&config). + WithTestInstance(t). + WithStandardCleanup(). + WithPrivateEthereumNetwork(privateNetwork.EthereumNetworkConfig). + WithCLNodes(1). + WithStandardCleanup(). + Build() + require.NoError(t, err) + + ctx := context.Background() + _, err = env.ClCluster.Nodes[0].GraphqlAPI.CreateJobDistributor(ctx, graphqlClient.JobDistributorInput{ + Name: "job-distributor-1", + Uri: "http://job-distributor-1:8080", + PublicKey: "54227538d9352e0a24550a80ab6a7af6e4f1ffbb8a604e913cbb81c484a7f97d", + }) + require.NoError(t, err, "Creating first job distributor in chainlink node shouldn't fail") + + _, err = env.ClCluster.Nodes[0].GraphqlAPI.CreateJobDistributor(ctx, graphqlClient.JobDistributorInput{ + Name: "job-distributor-2", + Uri: "http://job-distributor-2:8080", + PublicKey: "37346b7ea98af21e1309847e00f772826ac3689fe990b1920d01efc58ad2f250", + }) + require.NoError(t, err, "Creating second job distributor in chainlink node shouldn't fail") + + distributors, err := env.ClCluster.Nodes[0].GraphqlAPI.ListJobDistributors(ctx) + require.NoError(t, err, "Listing job distributors in chainlink node shouldn't fail") + require.Len(t, distributors.FeedsManagers.Results, 2, "There should be 2 job distributors") + + assert.Equal(t, "job-distributor-1", distributors.FeedsManagers.Results[0].Name) + assert.Equal(t, "job-distributor-2", distributors.FeedsManagers.Results[1].Name) +} diff --git a/integration-tests/smoke/keeper_test.go b/integration-tests/smoke/keeper_test.go index 4ff1c90bd1e..d9875b8db7f 100644 --- a/integration-tests/smoke/keeper_test.go +++ b/integration-tests/smoke/keeper_test.go @@ -8,16 +8,17 @@ import ( "testing" "time" - seth_utils "github.com/smartcontractkit/chainlink-testing-framework/utils/seth" + "github.com/smartcontractkit/chainlink/integration-tests/utils" "github.com/ethereum/go-ethereum/common" "github.com/onsi/gomega" "github.com/rs/zerolog" - "github.com/smartcontractkit/seth" "github.com/stretchr/testify/require" - "github.com/smartcontractkit/chainlink-testing-framework/logging" - "github.com/smartcontractkit/chainlink-testing-framework/utils/testcontext" + "github.com/smartcontractkit/chainlink-testing-framework/seth" + + "github.com/smartcontractkit/chainlink-testing-framework/lib/logging" + "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/testcontext" "github.com/smartcontractkit/chainlink/integration-tests/actions" "github.com/smartcontractkit/chainlink/integration-tests/client" @@ -1243,7 +1244,7 @@ func setupKeeperTest(l zerolog.Logger, t *testing.T, config *tc.TestConfig) ( evmNetwork, err := env.GetFirstEvmNetwork() require.NoError(t, err, "Error getting first evm network") - sethClient, err := seth_utils.GetChainClient(config, *evmNetwork) + sethClient, err := utils.TestAwareSethClient(t, config, evmNetwork) require.NoError(t, err, "Error getting seth client") err = actions.FundChainlinkNodesFromRootAddress(l, sethClient, contracts.ChainlinkClientToChainlinkNodeWithKeysAndAddress(env.ClCluster.NodeAPIs()), big.NewFloat(*config.Common.ChainlinkNodeFunding)) diff --git a/integration-tests/smoke/log_poller_test.go b/integration-tests/smoke/log_poller_test.go index f1a257552a2..b5891e7a3e8 100644 --- a/integration-tests/smoke/log_poller_test.go +++ b/integration-tests/smoke/log_poller_test.go @@ -7,7 +7,7 @@ import ( "testing" "time" - "github.com/smartcontractkit/seth" + "github.com/smartcontractkit/chainlink-testing-framework/seth" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/onsi/gomega" @@ -15,9 +15,9 @@ import ( "github.com/stretchr/testify/require" "go.uber.org/zap/zapcore" - "github.com/smartcontractkit/chainlink-testing-framework/logging" - "github.com/smartcontractkit/chainlink-testing-framework/testreporters" - "github.com/smartcontractkit/chainlink-testing-framework/utils/testcontext" + "github.com/smartcontractkit/chainlink-testing-framework/lib/logging" + "github.com/smartcontractkit/chainlink-testing-framework/lib/testreporters" + "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/testcontext" "github.com/smartcontractkit/chainlink/integration-tests/actions" "github.com/smartcontractkit/chainlink/integration-tests/contracts" "github.com/smartcontractkit/chainlink/integration-tests/contracts/ethereum" @@ -306,20 +306,7 @@ func prepareEnvironment(l zerolog.Logger, t *testing.T, testConfig *tc.TestConfi logScannerSettings, ) - _, upkeepIDs := actions.DeployConsumers( - t, - chainClient, - registry, - registrar, - linkToken, - upKeepsNeeded, - big.NewInt(int64(9e18)), - uint32(2500000), - true, - false, - false, - nil, - ) + _, upkeepIDs := actions.DeployLegacyConsumers(t, chainClient, registry, registrar, linkToken, upKeepsNeeded, big.NewInt(int64(9e18)), uint32(2500000), true, false, false, nil) err = logpoller.AssertUpkeepIdsUniqueness(upkeepIDs) require.NoError(t, err, "Error asserting upkeep ids uniqueness") diff --git a/integration-tests/smoke/ocr2_test.go b/integration-tests/smoke/ocr2_test.go index 56a95c50bda..325c88f979a 100644 --- a/integration-tests/smoke/ocr2_test.go +++ b/integration-tests/smoke/ocr2_test.go @@ -8,16 +8,17 @@ import ( "testing" "time" - seth_utils "github.com/smartcontractkit/chainlink-testing-framework/utils/seth" + "github.com/smartcontractkit/chainlink/integration-tests/utils" "github.com/ethereum/go-ethereum/common" "github.com/rs/zerolog" - "github.com/smartcontractkit/seth" "github.com/stretchr/testify/require" - "github.com/smartcontractkit/chainlink-testing-framework/logging" - "github.com/smartcontractkit/chainlink-testing-framework/logstream" - "github.com/smartcontractkit/chainlink-testing-framework/utils/testcontext" + "github.com/smartcontractkit/chainlink-testing-framework/seth" + + "github.com/smartcontractkit/chainlink-testing-framework/lib/logging" + "github.com/smartcontractkit/chainlink-testing-framework/lib/logstream" + "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/testcontext" "github.com/smartcontractkit/chainlink/v2/core/config/env" @@ -102,11 +103,11 @@ func TestOCRv2JobReplacement(t *testing.T) { t.Parallel() l := logging.GetTestLogger(t) - env, aggregatorContracts, sethClient := prepareORCv2SmokeTestEnv(t, defaultTestData(), l, 5) - nodeClients := env.ClCluster.NodeAPIs() + testEnv, aggregatorContracts, sethClient := prepareORCv2SmokeTestEnv(t, defaultTestData(), l, 5) + nodeClients := testEnv.ClCluster.NodeAPIs() bootstrapNode, workerNodes := nodeClients[0], nodeClients[1:] - err := env.MockAdapter.SetAdapterBasedIntValuePath("ocr2", []string{http.MethodGet, http.MethodPost}, 10) + err := testEnv.MockAdapter.SetAdapterBasedIntValuePath("ocr2", []string{http.MethodGet, http.MethodPost}, 10) require.NoError(t, err) err = actions.WatchNewOCRRound(l, sethClient, 2, contracts.V2OffChainAgrregatorToOffChainAggregatorWithRounds(aggregatorContracts), time.Minute*5) require.NoError(t, err, "Error watching for new OCR2 round") @@ -124,7 +125,7 @@ func TestOCRv2JobReplacement(t *testing.T) { err = actions.DeleteBridges(nodeClients) require.NoError(t, err) - err = actions.CreateOCRv2JobsLocal(aggregatorContracts, bootstrapNode, workerNodes, env.MockAdapter, "ocr2", 15, uint64(sethClient.ChainID), false, false) + err = actions.CreateOCRv2JobsLocal(aggregatorContracts, bootstrapNode, workerNodes, testEnv.MockAdapter, "ocr2", 15, uint64(sethClient.ChainID), false, false) require.NoError(t, err, "Error creating OCRv2 jobs") err = actions.WatchNewOCRRound(l, sethClient, 3, contracts.V2OffChainAgrregatorToOffChainAggregatorWithRounds(aggregatorContracts), time.Minute*3) @@ -163,14 +164,14 @@ func prepareORCv2SmokeTestEnv(t *testing.T, testData ocr2test, l zerolog.Logger, evmNetwork, err := testEnv.GetFirstEvmNetwork() require.NoError(t, err, "Error getting first evm network") - sethClient, err := seth_utils.GetChainClient(config, *evmNetwork) + sethClient, err := utils.TestAwareSethClient(t, config, evmNetwork) require.NoError(t, err, "Error getting seth client") nodeClients := testEnv.ClCluster.NodeAPIs() bootstrapNode, workerNodes := nodeClients[0], nodeClients[1:] - linkContract, err := contracts.DeployLinkTokenContract(l, sethClient) - require.NoError(t, err, "Error deploying link token contract") + linkContract, err := actions.LinkTokenContract(l, sethClient, config.OCR2) + require.NoError(t, err, "Error loading/deploying link token contract") err = actions.FundChainlinkNodesFromRootAddress(l, sethClient, contracts.ChainlinkClientToChainlinkNodeWithKeysAndAddress(workerNodes), big.NewFloat(*config.Common.ChainlinkNodeFunding)) require.NoError(t, err, "Error funding Chainlink nodes") @@ -190,18 +191,20 @@ func prepareORCv2SmokeTestEnv(t *testing.T, testData ocr2test, l zerolog.Logger, transmitters = append(transmitters, addr) } - ocrOffchainOptions := contracts.DefaultOffChainAggregatorOptions() - aggregatorContracts, err := actions.DeployOCRv2Contracts(l, sethClient, 1, common.HexToAddress(linkContract.Address()), transmitters, ocrOffchainOptions) + ocrOffChainOptions := contracts.DefaultOffChainAggregatorOptions() + aggregatorContracts, err := actions.SetupOCRv2Contracts(l, sethClient, config.OCR2, common.HexToAddress(linkContract.Address()), transmitters, ocrOffChainOptions) require.NoError(t, err, "Error deploying OCRv2 aggregator contracts") err = actions.CreateOCRv2JobsLocal(aggregatorContracts, bootstrapNode, workerNodes, testEnv.MockAdapter, "ocr2", 5, uint64(sethClient.ChainID), false, testData.chainReaderAndCodec) require.NoError(t, err, "Error creating OCRv2 jobs") - ocrv2Config, err := actions.BuildMedianOCR2ConfigLocal(workerNodes, ocrOffchainOptions) - require.NoError(t, err, "Error building OCRv2 config") + if !config.OCR2.UseExistingOffChainAggregatorsContracts() || (config.OCR2.UseExistingOffChainAggregatorsContracts() && config.OCR2.ConfigureExistingOffChainAggregatorsContracts()) { + ocrV2Config, err := actions.BuildMedianOCR2ConfigLocal(workerNodes, ocrOffChainOptions) + require.NoError(t, err, "Error building OCRv2 config") - err = actions.ConfigureOCRv2AggregatorContracts(ocrv2Config, aggregatorContracts) - require.NoError(t, err, "Error configuring OCRv2 aggregator contracts") + err = actions.ConfigureOCRv2AggregatorContracts(ocrV2Config, aggregatorContracts) + require.NoError(t, err, "Error configuring OCRv2 aggregator contracts") + } assertCorrectNodeConfiguration(t, l, clNodeCount, testData, testEnv) diff --git a/integration-tests/smoke/ocr_test.go b/integration-tests/smoke/ocr_test.go index 0b4ac3de30b..a19adb5c022 100644 --- a/integration-tests/smoke/ocr_test.go +++ b/integration-tests/smoke/ocr_test.go @@ -5,20 +5,20 @@ import ( "testing" "time" - seth_utils "github.com/smartcontractkit/chainlink-testing-framework/utils/seth" - "github.com/ethereum/go-ethereum/common" "github.com/rs/zerolog" - "github.com/smartcontractkit/seth" "github.com/stretchr/testify/require" - "github.com/smartcontractkit/chainlink-testing-framework/logging" - "github.com/smartcontractkit/chainlink-testing-framework/utils/testcontext" + "github.com/smartcontractkit/chainlink-testing-framework/seth" + + "github.com/smartcontractkit/chainlink-testing-framework/lib/logging" + "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/testcontext" "github.com/smartcontractkit/chainlink/integration-tests/actions" "github.com/smartcontractkit/chainlink/integration-tests/contracts" "github.com/smartcontractkit/chainlink/integration-tests/docker/test_env" tc "github.com/smartcontractkit/chainlink/integration-tests/testconfig" + "github.com/smartcontractkit/chainlink/integration-tests/utils" ) const ( @@ -99,7 +99,7 @@ func prepareORCv1SmokeTestEnv(t *testing.T, l zerolog.Logger, firstRoundResult i evmNetwork, err := env.GetFirstEvmNetwork() require.NoError(t, err, "Error getting first evm network") - sethClient, err := seth_utils.GetChainClient(config, *evmNetwork) + sethClient, err := utils.TestAwareSethClient(t, config, evmNetwork) require.NoError(t, err, "Error getting seth client") nodeClients := env.ClCluster.NodeAPIs() @@ -113,10 +113,10 @@ func prepareORCv1SmokeTestEnv(t *testing.T, l zerolog.Logger, firstRoundResult i _ = actions.ReturnFundsFromNodes(l, sethClient, contracts.ChainlinkClientToChainlinkNodeWithKeysAndAddress(env.ClCluster.NodeAPIs())) }) - linkContract, err := contracts.DeployLinkTokenContract(l, sethClient) - require.NoError(t, err, "Error deploying link token contract") + linkContract, err := actions.LinkTokenContract(l, sethClient, config.OCR) + require.NoError(t, err, "Error loading/deploying link token contract") - ocrInstances, err := actions.DeployOCRv1Contracts(l, sethClient, 1, common.HexToAddress(linkContract.Address()), contracts.ChainlinkClientToChainlinkNodeWithKeysAndAddress(workerNodes)) + ocrInstances, err := actions.SetupOCRv1Contracts(l, sethClient, config.OCR, common.HexToAddress(linkContract.Address()), contracts.ChainlinkClientToChainlinkNodeWithKeysAndAddress(workerNodes)) require.NoError(t, err, "Error deploying OCR contracts") err = actions.CreateOCRJobsLocal(ocrInstances, bootstrapNode, workerNodes, 5, env.MockAdapter, big.NewInt(sethClient.ChainID)) diff --git a/integration-tests/smoke/reorg_above_finality_test.go b/integration-tests/smoke/reorg_above_finality_test.go index e7b9e4a2183..ea7757a9e75 100644 --- a/integration-tests/smoke/reorg_above_finality_test.go +++ b/integration-tests/smoke/reorg_above_finality_test.go @@ -4,12 +4,12 @@ import ( "testing" "time" - ctf_client "github.com/smartcontractkit/chainlink-testing-framework/client" + ctf_client "github.com/smartcontractkit/chainlink-testing-framework/lib/client" "github.com/pelletier/go-toml/v2" "github.com/stretchr/testify/require" - "github.com/smartcontractkit/chainlink-testing-framework/logging" + "github.com/smartcontractkit/chainlink-testing-framework/lib/logging" "github.com/smartcontractkit/chainlink/integration-tests/actions" "github.com/smartcontractkit/chainlink/integration-tests/docker/test_env" tc "github.com/smartcontractkit/chainlink/integration-tests/testconfig" @@ -53,7 +53,7 @@ func TestReorgAboveFinality_FinalityTagDisabled(t *testing.T) { evmNetwork, err := testEnv.GetFirstEvmNetwork() require.NoError(t, err, "Error getting first evm network") - client := ctf_client.NewRPCClient(evmNetwork.HTTPURLs[0]) + client := ctf_client.NewRPCClient(evmNetwork.HTTPURLs[0], nil) // Wait for chain to progress require.Eventually(t, func() bool { diff --git a/integration-tests/smoke/runlog_test.go b/integration-tests/smoke/runlog_test.go index 515d9dea33c..d081619fe69 100644 --- a/integration-tests/smoke/runlog_test.go +++ b/integration-tests/smoke/runlog_test.go @@ -7,14 +7,14 @@ import ( "strings" "testing" - seth_utils "github.com/smartcontractkit/chainlink-testing-framework/utils/seth" + "github.com/smartcontractkit/chainlink/integration-tests/utils" "github.com/google/uuid" "github.com/onsi/gomega" "github.com/stretchr/testify/require" - "github.com/smartcontractkit/chainlink-testing-framework/logging" - "github.com/smartcontractkit/chainlink-testing-framework/utils/testcontext" + "github.com/smartcontractkit/chainlink-testing-framework/lib/logging" + "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/testcontext" "github.com/smartcontractkit/chainlink/integration-tests/actions" "github.com/smartcontractkit/chainlink/integration-tests/client" @@ -47,7 +47,7 @@ func TestRunLogBasic(t *testing.T) { evmNetwork, err := env.GetFirstEvmNetwork() require.NoError(t, err, "Error getting first evm network") - sethClient, err := seth_utils.GetChainClient(config, *evmNetwork) + sethClient, err := utils.TestAwareSethClient(t, config, evmNetwork) require.NoError(t, err, "Error getting seth client") err = actions.FundChainlinkNodesFromRootAddress(l, sethClient, contracts.ChainlinkClientToChainlinkNodeWithKeysAndAddress(env.ClCluster.NodeAPIs()), big.NewFloat(*config.Common.ChainlinkNodeFunding)) diff --git a/integration-tests/smoke/vrf_test.go b/integration-tests/smoke/vrf_test.go index 04e760796db..822276222a2 100644 --- a/integration-tests/smoke/vrf_test.go +++ b/integration-tests/smoke/vrf_test.go @@ -9,12 +9,11 @@ import ( "github.com/google/uuid" "github.com/onsi/gomega" "github.com/rs/zerolog" - "github.com/smartcontractkit/seth" "github.com/stretchr/testify/require" - "github.com/smartcontractkit/chainlink-testing-framework/logging" - seth_utils "github.com/smartcontractkit/chainlink-testing-framework/utils/seth" - "github.com/smartcontractkit/chainlink-testing-framework/utils/testcontext" + "github.com/smartcontractkit/chainlink-testing-framework/lib/logging" + "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/testcontext" + "github.com/smartcontractkit/chainlink-testing-framework/seth" "github.com/smartcontractkit/chainlink/integration-tests/actions" "github.com/smartcontractkit/chainlink/integration-tests/actions/vrf/vrfv1" @@ -23,6 +22,7 @@ import ( ethcontracts "github.com/smartcontractkit/chainlink/integration-tests/contracts" "github.com/smartcontractkit/chainlink/integration-tests/docker/test_env" tc "github.com/smartcontractkit/chainlink/integration-tests/testconfig" + "github.com/smartcontractkit/chainlink/integration-tests/utils" ) func TestVRFBasic(t *testing.T) { @@ -204,7 +204,7 @@ func prepareVRFtestEnv(t *testing.T, l zerolog.Logger) (*test_env.CLClusterTestE evmNetwork, err := env.GetFirstEvmNetwork() require.NoError(t, err, "Error getting first evm network") - sethClient, err := seth_utils.GetChainClient(config, *evmNetwork) + sethClient, err := utils.TestAwareSethClient(t, config, evmNetwork) require.NoError(t, err, "Error getting seth client") err = actions.FundChainlinkNodesFromRootAddress(l, sethClient, contracts.ChainlinkClientToChainlinkNodeWithKeysAndAddress(env.ClCluster.NodeAPIs()), big.NewFloat(*config.Common.ChainlinkNodeFunding)) diff --git a/integration-tests/smoke/vrfv2_test.go b/integration-tests/smoke/vrfv2_test.go index cf3bc9431dc..8390c27a4b0 100644 --- a/integration-tests/smoke/vrfv2_test.go +++ b/integration-tests/smoke/vrfv2_test.go @@ -10,7 +10,7 @@ import ( "testing" "time" - "github.com/smartcontractkit/seth" + "github.com/smartcontractkit/chainlink-testing-framework/seth" "github.com/ethereum/go-ethereum/common" "github.com/google/go-cmp/cmp" @@ -20,12 +20,12 @@ import ( "go.uber.org/zap/zapcore" commonassets "github.com/smartcontractkit/chainlink-common/pkg/assets" - "github.com/smartcontractkit/chainlink-testing-framework/logging" - "github.com/smartcontractkit/chainlink-testing-framework/networks" - "github.com/smartcontractkit/chainlink-testing-framework/testreporters" - "github.com/smartcontractkit/chainlink-testing-framework/utils/conversions" - "github.com/smartcontractkit/chainlink-testing-framework/utils/ptr" - "github.com/smartcontractkit/chainlink-testing-framework/utils/testcontext" + "github.com/smartcontractkit/chainlink-testing-framework/lib/logging" + "github.com/smartcontractkit/chainlink-testing-framework/lib/networks" + "github.com/smartcontractkit/chainlink-testing-framework/lib/testreporters" + "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/conversions" + "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/ptr" + "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/testcontext" "github.com/smartcontractkit/chainlink/integration-tests/actions" vrfcommon "github.com/smartcontractkit/chainlink/integration-tests/actions/vrf/common" "github.com/smartcontractkit/chainlink/integration-tests/actions/vrf/vrfv2" @@ -40,6 +40,53 @@ const ( SethRootKeyIndex = 0 ) +// vrfv2CleanUpFn is a cleanup function that captures pointers from context, in which it's called and uses them to clean up the test environment +var vrfv2CleanUpFn = func( + t **testing.T, + sethClient **seth.Client, + config **tc.TestConfig, + testEnv **test_env.CLClusterTestEnv, + vrfContracts **vrfcommon.VRFContracts, + subIDsForCancellingAfterTest *[]uint64, + walletAddress **string, +) func() { + return func() { + logger := logging.GetTestLogger(*t) + testConfig := **config + network := networks.MustGetSelectedNetworkConfig(testConfig.GetNetworkConfig())[0] + if network.Simulated { + logger.Info(). + Str("Network Name", network.Name). + Msg("Network is a simulated network. Skipping fund return for Coordinator Subscriptions.") + } else { + if *vrfContracts != nil && *sethClient != nil { + if *testConfig.VRFv2.General.CancelSubsAfterTestRun { + client := *sethClient + var returnToAddress string + if walletAddress == nil || *walletAddress == nil { + returnToAddress = client.MustGetRootKeyAddress().Hex() + } else { + returnToAddress = **walletAddress + } + //cancel subs and return funds to sub owner + vrfv2.CancelSubsAndReturnFunds(testcontext.Get(*t), *vrfContracts, returnToAddress, *subIDsForCancellingAfterTest, logger) + } + } else { + logger.Error().Msg("VRF Contracts and/or Seth client are nil. Cannot execute cleanup") + } + } + if !*testConfig.VRFv2.General.UseExistingEnv { + if *testEnv == nil { + logger.Error().Msg("Test environment is nil. Cannot execute cleanup") + return + } + if err := (*testEnv).Cleanup(test_env.CleanupOpts{TestName: (*t).Name()}); err != nil { + logger.Error().Err(err).Msg("Error cleaning up test environment") + } + } + } +} + func TestVRFv2Basic(t *testing.T) { t.Parallel() var ( @@ -54,30 +101,13 @@ func TestVRFv2Basic(t *testing.T) { config, err := tc.GetChainAndTestTypeSpecificConfig("Smoke", tc.VRFv2) require.NoError(t, err, "Error getting config") - vrfv2Config := config.VRFv2 chainID := networks.MustGetSelectedNetworkConfig(config.GetNetworkConfig())[0].ChainID - cleanupFn := func() { - if sethClient.Cfg.IsSimulatedNetwork() { - l.Info(). - Str("Network Name", sethClient.Cfg.Network.Name). - Msg("Network is a simulated network. Skipping fund return for Coordinator Subscriptions.") - } else { - if *vrfv2Config.General.CancelSubsAfterTestRun { - //cancel subs and return funds to sub owner - vrfv2.CancelSubsAndReturnFunds(testcontext.Get(t), vrfContracts, sethClient.MustGetRootKeyAddress().Hex(), subIDsForCancellingAfterTest, l) - } - } - if !*vrfv2Config.General.UseExistingEnv { - if err := testEnv.Cleanup(test_env.CleanupOpts{TestName: t.Name()}); err != nil { - l.Error().Err(err).Msg("Error cleaning up test environment") - } - } - } + configPtr := &config vrfEnvConfig := vrfcommon.VRFEnvConfig{ TestConfig: config, ChainID: chainID, - CleanupFn: cleanupFn, + CleanupFn: vrfv2CleanUpFn(&t, &sethClient, &configPtr, &testEnv, &vrfContracts, &subIDsForCancellingAfterTest, nil), } newEnvConfig := vrfcommon.NewEnvConfig{ NodesToCreate: []vrfcommon.VRFNodeType{vrfcommon.VRF}, @@ -574,29 +604,12 @@ func TestVRFv2MultipleSendingKeys(t *testing.T) { t.Fatal(err) } chainID := networks.MustGetSelectedNetworkConfig(config.GetNetworkConfig())[0].ChainID - vrfv2Config := config.VRFv2 - cleanupFn := func() { - if sethClient.Cfg.IsSimulatedNetwork() { - l.Info(). - Str("Network Name", sethClient.Cfg.Network.Name). - Msg("Network is a simulated network. Skipping fund return for Coordinator Subscriptions.") - } else { - if *vrfv2Config.General.CancelSubsAfterTestRun { - //cancel subs and return funds to sub owner - vrfv2.CancelSubsAndReturnFunds(testcontext.Get(t), vrfContracts, sethClient.MustGetRootKeyAddress().Hex(), subIDsForCancellingAfterTest, l) - } - } - if !*vrfv2Config.General.UseExistingEnv { - if err := testEnv.Cleanup(test_env.CleanupOpts{TestName: t.Name()}); err != nil { - l.Error().Err(err).Msg("Error cleaning up test environment") - } - } - } + configPtr := &config vrfEnvConfig := vrfcommon.VRFEnvConfig{ TestConfig: config, ChainID: chainID, - CleanupFn: cleanupFn, + CleanupFn: vrfv2CleanUpFn(&t, &sethClient, &configPtr, &testEnv, &vrfContracts, &subIDsForCancellingAfterTest, nil), } newEnvConfig := vrfcommon.NewEnvConfig{ NodesToCreate: []vrfcommon.VRFNodeType{vrfcommon.VRF}, @@ -680,29 +693,12 @@ func TestVRFOwner(t *testing.T) { config, err := tc.GetChainAndTestTypeSpecificConfig("Smoke", tc.VRFv2) require.NoError(t, err, "Error getting config") chainID := networks.MustGetSelectedNetworkConfig(config.GetNetworkConfig())[0].ChainID - vrfv2Config := config.VRFv2 - cleanupFn := func() { - if sethClient.Cfg.IsSimulatedNetwork() { - l.Info(). - Str("Network Name", sethClient.Cfg.Network.Name). - Msg("Network is a simulated network. Skipping fund return for Coordinator Subscriptions.") - } else { - if *vrfv2Config.General.CancelSubsAfterTestRun { - //cancel subs and return funds to sub owner - vrfv2.CancelSubsAndReturnFunds(testcontext.Get(t), vrfContracts, sethClient.MustGetRootKeyAddress().Hex(), subIDsForCancellingAfterTest, l) - } - } - if !*vrfv2Config.General.UseExistingEnv { - if err := testEnv.Cleanup(test_env.CleanupOpts{TestName: t.Name()}); err != nil { - l.Error().Err(err).Msg("Error cleaning up test environment") - } - } - } + configPtr := &config vrfEnvConfig := vrfcommon.VRFEnvConfig{ TestConfig: config, ChainID: chainID, - CleanupFn: cleanupFn, + CleanupFn: vrfv2CleanUpFn(&t, &sethClient, &configPtr, &testEnv, &vrfContracts, &subIDsForCancellingAfterTest, nil), } newEnvConfig := vrfcommon.NewEnvConfig{ NodesToCreate: []vrfcommon.VRFNodeType{vrfcommon.VRF}, @@ -817,24 +813,7 @@ func TestVRFV2WithBHS(t *testing.T) { require.NoError(t, err, "Error getting config") vrfv2Config := config.VRFv2 chainID := networks.MustGetSelectedNetworkConfig(config.GetNetworkConfig())[0].ChainID - - cleanupFn := func() { - if sethClient.Cfg.IsSimulatedNetwork() { - l.Info(). - Str("Network Name", sethClient.Cfg.Network.Name). - Msg("Network is a simulated network. Skipping fund return for Coordinator Subscriptions.") - } else { - if *vrfv2Config.General.CancelSubsAfterTestRun { - //cancel subs and return funds to sub owner - vrfv2.CancelSubsAndReturnFunds(testcontext.Get(t), vrfContracts, sethClient.MustGetRootKeyAddress().Hex(), subIDsForCancellingAfterTest, l) - } - } - if !*vrfv2Config.General.UseExistingEnv { - if err := testEnv.Cleanup(test_env.CleanupOpts{TestName: t.Name()}); err != nil { - l.Error().Err(err).Msg("Error cleaning up test environment") - } - } - } + configPtr := &config //decrease default span for checking blockhashes for unfulfilled requests vrfv2Config.General.BHSJobWaitBlocks = ptr.Ptr(2) @@ -842,7 +821,7 @@ func TestVRFV2WithBHS(t *testing.T) { vrfEnvConfig := vrfcommon.VRFEnvConfig{ TestConfig: config, ChainID: chainID, - CleanupFn: cleanupFn, + CleanupFn: vrfv2CleanUpFn(&t, &sethClient, &configPtr, &testEnv, &vrfContracts, &subIDsForCancellingAfterTest, nil), } newEnvConfig := vrfcommon.NewEnvConfig{ NodesToCreate: []vrfcommon.VRFNodeType{vrfcommon.VRF, vrfcommon.BHS}, @@ -860,7 +839,6 @@ func TestVRFV2WithBHS(t *testing.T) { } //BHS node should fill in blockhashes into BHS contract depending on the waitBlocks and lookBackBlocks settings configCopy := config.MustCopy().(tc.TestConfig) - //Underfund Subscription configCopy.VRFv2.General.SubscriptionFundingAmountLink = ptr.Ptr(float64(0)) consumers, subIDsForBHS, err := vrfv2.SetupNewConsumersAndSubs( @@ -912,11 +890,13 @@ func TestVRFV2WithBHS(t *testing.T) { require.NoError(t, err) err = vrfv2.FundSubscriptions(big.NewFloat(*configCopy.VRFv2.General.SubscriptionFundingAmountLink), vrfContracts.LinkToken, vrfContracts.CoordinatorV2, subIDsForBHS) require.NoError(t, err, "error funding subscriptions") - randomWordsFulfilledEvent, err := vrfContracts.CoordinatorV2.WaitForRandomWordsFulfilledEvent( - contracts.RandomWordsFulfilledEventFilter{ - RequestIds: []*big.Int{randomWordsRequestedEvent.RequestId}, - Timeout: configCopy.VRFv2.General.RandomWordsFulfilledEventTimeout.Duration, - }, + + randomWordsFulfilledEvent, err := vrfv2.WaitRandomWordsFulfilledEvent( + vrfContracts.CoordinatorV2, + randomWordsRequestedEvent.RequestId, + randomWordsRequestedEvent.Raw.BlockNumber, + configCopy.VRFv2.General.RandomWordsFulfilledEventTimeout.Duration, + l, ) require.NoError(t, err, "error waiting for randomness fulfilled event") vrfcommon.LogRandomWordsFulfilledEvent(l, vrfContracts.CoordinatorV2, randomWordsFulfilledEvent, false, 0) @@ -962,9 +942,7 @@ func TestVRFV2WithBHS(t *testing.T) { SethRootKeyIndex, ) require.NoError(t, err, "error requesting randomness") - randRequestBlockNumber := randomWordsRequestedEvent.Raw.BlockNumber - _, err = vrfContracts.BHS.GetBlockHash(testcontext.Get(t), big.NewInt(int64(randRequestBlockNumber))) require.Error(t, err, "error not occurred when getting blockhash for a blocknumber which was not stored in BHS contract") @@ -985,29 +963,37 @@ func TestVRFV2WithBHS(t *testing.T) { metrics, err := consumers[0].GetLoadTestMetrics(testcontext.Get(t)) require.Equal(t, 0, metrics.RequestCount.Cmp(big.NewInt(1))) require.Equal(t, 0, metrics.FulfilmentCount.Cmp(big.NewInt(0))) - - var clNodeTxs *client.TransactionsData - var txHash string gom := gomega.NewGomegaWithT(t) - gom.Eventually(func(g gomega.Gomega) { - clNodeTxs, _, err = nodeTypeToNodeMap[vrfcommon.BHS].CLNode.API.ReadTransactions() - g.Expect(err).ShouldNot(gomega.HaveOccurred(), "error getting CL Node transactions") - l.Info().Int("Number of TXs", len(clNodeTxs.Data)).Msg("BHS Node txs") - g.Expect(len(clNodeTxs.Data)).Should(gomega.BeNumerically("==", 1), "Expected 1 tx posted by BHS Node, but found %d", len(clNodeTxs.Data)) - txHash = clNodeTxs.Data[0].Attributes.Hash - }, "2m", "1s").Should(gomega.Succeed()) - - require.Equal(t, strings.ToLower(vrfContracts.BHS.Address()), strings.ToLower(clNodeTxs.Data[0].Attributes.To)) - - bhsStoreTx, _, err := sethClient.Client.TransactionByHash(testcontext.Get(t), common.HexToHash(txHash)) - require.NoError(t, err, "error getting tx from hash") - bhsStoreTxInputData, err := actions.DecodeTxInputData(blockhash_store.BlockhashStoreABI, bhsStoreTx.Data()) - l.Info(). - Str("Block Number", bhsStoreTxInputData["n"].(*big.Int).String()). - Msg("BHS Node's Store Blockhash for Blocknumber Method TX") - require.Equal(t, randRequestBlockNumber, bhsStoreTxInputData["n"].(*big.Int).Uint64()) + if !*configCopy.VRFv2.General.UseExistingEnv { + l.Info().Msg("Checking BHS Node's transactions") + var clNodeTxs *client.TransactionsData + var txHash string + gom.Eventually(func(g gomega.Gomega) { + clNodeTxs, _, err = nodeTypeToNodeMap[vrfcommon.BHS].CLNode.API.ReadTransactions() + g.Expect(err).ShouldNot(gomega.HaveOccurred(), "error getting CL Node transactions") + g.Expect(len(clNodeTxs.Data)).Should(gomega.BeNumerically("==", 1), "Expected 1 tx posted by BHS Node, but found %d", len(clNodeTxs.Data)) + txHash = clNodeTxs.Data[0].Attributes.Hash + l.Info(). + Str("TX Hash", txHash). + Int("Number of TXs", len(clNodeTxs.Data)). + Msg("BHS Node txs") + }, "2m", "1s").Should(gomega.Succeed()) + + require.Equal(t, strings.ToLower(vrfContracts.BHS.Address()), strings.ToLower(clNodeTxs.Data[0].Attributes.To)) + + bhsStoreTx, _, err := sethClient.Client.TransactionByHash(testcontext.Get(t), common.HexToHash(txHash)) + require.NoError(t, err, "error getting tx from hash") + bhsStoreTxInputData, err := actions.DecodeTxInputData(blockhash_store.BlockhashStoreABI, bhsStoreTx.Data()) + require.NoError(t, err, "error decoding tx input data") + l.Info(). + Str("Block Number", bhsStoreTxInputData["n"].(*big.Int).String()). + Msg("BHS Node's Store Blockhash for Blocknumber Method TX") + require.Equal(t, randRequestBlockNumber, bhsStoreTxInputData["n"].(*big.Int).Uint64()) + } else { + l.Warn().Msg("Skipping BHS Node's transactions check as existing env is used") + } var randRequestBlockHash [32]byte gom.Eventually(func(g gomega.Gomega) { randRequestBlockHash, err = vrfContracts.BHS.GetBlockHash(testcontext.Get(t), big.NewInt(int64(randRequestBlockNumber))) @@ -1027,7 +1013,6 @@ func TestVRFV2NodeReorg(t *testing.T) { env *test_env.CLClusterTestEnv vrfContracts *vrfcommon.VRFContracts subIDsForCancellingAfterTest []uint64 - defaultWalletAddress string vrfKey *vrfcommon.VRFKeyData sethClient *seth.Client ) @@ -1035,33 +1020,16 @@ func TestVRFV2NodeReorg(t *testing.T) { config, err := tc.GetChainAndTestTypeSpecificConfig("Smoke", tc.VRFv2) require.NoError(t, err, "Error getting config") - vrfv2Config := config.VRFv2 network := networks.MustGetSelectedNetworkConfig(config.GetNetworkConfig())[0] if !network.Simulated { t.Skip("Skipped since Reorg test could only be run on Simulated chain.") } chainID := network.ChainID - cleanupFn := func() { - if sethClient.Cfg.IsSimulatedNetwork() { - l.Info(). - Str("Network Name", sethClient.Cfg.Network.Name). - Msg("Network is a simulated network. Skipping fund return for Coordinator Subscriptions.") - } else { - if *vrfv2Config.General.CancelSubsAfterTestRun { - //cancel subs and return funds to sub owner - vrfv2.CancelSubsAndReturnFunds(testcontext.Get(t), vrfContracts, defaultWalletAddress, subIDsForCancellingAfterTest, l) - } - } - if !*vrfv2Config.General.UseExistingEnv { - if err := env.Cleanup(test_env.CleanupOpts{TestName: t.Name()}); err != nil { - l.Error().Err(err).Msg("Error cleaning up test environment") - } - } - } + configPtr := &config chainlinkNodeLogScannerSettings := test_env.GetDefaultChainlinkNodeLogScannerSettingsWithExtraAllowedMessages( testreporters.NewAllowedLogMessage( - "This is a problem and either means a very deep re-org occurred", + "Got very old block.", "Test is expecting a reorg to occur", zapcore.DPanicLevel, testreporters.WarnAboutAllowedMsgs_No), @@ -1074,7 +1042,7 @@ func TestVRFV2NodeReorg(t *testing.T) { vrfEnvConfig := vrfcommon.VRFEnvConfig{ TestConfig: config, ChainID: chainID, - CleanupFn: cleanupFn, + CleanupFn: vrfv2CleanUpFn(&t, &sethClient, &configPtr, &env, &vrfContracts, &subIDsForCancellingAfterTest, nil), } newEnvConfig := vrfcommon.NewEnvConfig{ NodesToCreate: []vrfcommon.VRFNodeType{vrfcommon.VRF}, @@ -1189,11 +1157,12 @@ func TestVRFV2NodeReorg(t *testing.T) { // For context - when performing debug_setHead on geth simulated chain and therefore rewinding chain to a previous block, //then tx that was mined after reorg will not appear in canonical chain contrary to real world scenario //Hence, we only verify that VRF node will not generate fulfillment for the reorged fork request - _, err = vrfContracts.CoordinatorV2.WaitForRandomWordsFulfilledEvent( - contracts.RandomWordsFulfilledEventFilter{ - RequestIds: []*big.Int{randomWordsRequestedEvent.RequestId}, - Timeout: time.Second * 10, - }, + _, err = vrfv2.WaitRandomWordsFulfilledEvent( + vrfContracts.CoordinatorV2, + randomWordsRequestedEvent.RequestId, + randomWordsRequestedEvent.Raw.BlockNumber, + time.Second*10, + l, ) require.Error(t, err, "fulfillment should not be generated for the request which was made on reorged fork on Simulated Chain") }) @@ -1205,7 +1174,6 @@ func TestVRFv2BatchFulfillmentEnabledDisabled(t *testing.T) { env *test_env.CLClusterTestEnv vrfContracts *vrfcommon.VRFContracts subIDsForCancellingAfterTest []uint64 - defaultWalletAddress string vrfKey *vrfcommon.VRFKeyData nodeTypeToNodeMap map[vrfcommon.VRFNodeType]*vrfcommon.VRFNode sethClient *seth.Client @@ -1214,30 +1182,14 @@ func TestVRFv2BatchFulfillmentEnabledDisabled(t *testing.T) { config, err := tc.GetChainAndTestTypeSpecificConfig("Smoke", tc.VRFv2) require.NoError(t, err, "Error getting config") - vrfv2Config := config.VRFv2 network := networks.MustGetSelectedNetworkConfig(config.GetNetworkConfig())[0] chainID := network.ChainID - cleanupFn := func() { - if sethClient.Cfg.IsSimulatedNetwork() { - l.Info(). - Str("Network Name", sethClient.Cfg.Network.Name). - Msg("Network is a simulated network. Skipping fund return for Coordinator Subscriptions.") - } else { - if *vrfv2Config.General.CancelSubsAfterTestRun { - //cancel subs and return funds to sub owner - vrfv2.CancelSubsAndReturnFunds(testcontext.Get(t), vrfContracts, defaultWalletAddress, subIDsForCancellingAfterTest, l) - } - } - if !*vrfv2Config.General.UseExistingEnv { - if err := env.Cleanup(test_env.CleanupOpts{TestName: t.Name()}); err != nil { - l.Error().Err(err).Msg("Error cleaning up test environment") - } - } - } + + configPtr := &config vrfEnvConfig := vrfcommon.VRFEnvConfig{ TestConfig: config, ChainID: chainID, - CleanupFn: cleanupFn, + CleanupFn: vrfv2CleanUpFn(&t, &sethClient, &configPtr, &env, &vrfContracts, &subIDsForCancellingAfterTest, nil), } newEnvConfig := vrfcommon.NewEnvConfig{ NodesToCreate: []vrfcommon.VRFNodeType{vrfcommon.VRF}, @@ -1491,5 +1443,4 @@ func TestVRFv2BatchFulfillmentEnabledDisabled(t *testing.T) { // verify that all fulfillments should be in separate txs require.Equal(t, int(randRequestCount), len(singleFulfillmentTxs)) }) - } diff --git a/integration-tests/smoke/vrfv2plus_test.go b/integration-tests/smoke/vrfv2plus_test.go index b0deaa3c9c8..72c83aa281e 100644 --- a/integration-tests/smoke/vrfv2plus_test.go +++ b/integration-tests/smoke/vrfv2plus_test.go @@ -9,7 +9,7 @@ import ( "testing" "time" - "github.com/smartcontractkit/seth" + "github.com/smartcontractkit/chainlink-testing-framework/seth" "github.com/ethereum/go-ethereum/common" "github.com/google/go-cmp/cmp" @@ -18,12 +18,12 @@ import ( "github.com/stretchr/testify/require" "go.uber.org/zap/zapcore" - "github.com/smartcontractkit/chainlink-testing-framework/blockchain" - "github.com/smartcontractkit/chainlink-testing-framework/logging" - "github.com/smartcontractkit/chainlink-testing-framework/networks" - "github.com/smartcontractkit/chainlink-testing-framework/testreporters" - "github.com/smartcontractkit/chainlink-testing-framework/utils/ptr" - "github.com/smartcontractkit/chainlink-testing-framework/utils/testcontext" + "github.com/smartcontractkit/chainlink-testing-framework/lib/blockchain" + "github.com/smartcontractkit/chainlink-testing-framework/lib/logging" + "github.com/smartcontractkit/chainlink-testing-framework/lib/networks" + "github.com/smartcontractkit/chainlink-testing-framework/lib/testreporters" + "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/ptr" + "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/testcontext" "github.com/smartcontractkit/chainlink/integration-tests/actions" vrfcommon "github.com/smartcontractkit/chainlink/integration-tests/actions/vrf/common" "github.com/smartcontractkit/chainlink/integration-tests/actions/vrf/vrfv2plus" @@ -37,6 +37,47 @@ import ( it_utils "github.com/smartcontractkit/chainlink/integration-tests/utils" ) +// vrfv2PlusCleanUpFn is a cleanup function that captures pointers from context, in which it's called and uses them to clean up the test environment +var vrfv2PlusCleanUpFn = func( + t **testing.T, + sethClient **seth.Client, + config **tc.TestConfig, + testEnv **test_env.CLClusterTestEnv, + vrfContracts **vrfcommon.VRFContracts, + subIDsForCancellingAfterTest *[]*big.Int, +) func() { + return func() { + l := logging.GetTestLogger(*t) + testConfig := **config + network := networks.MustGetSelectedNetworkConfig(testConfig.GetNetworkConfig())[0] + if network.Simulated { + l.Info(). + Str("Network Name", network.Name). + Msg("Network is a simulated network. Skipping fund return for Coordinator Subscriptions.") + } else { + if *vrfContracts != nil && *sethClient != nil { + if *testConfig.VRFv2Plus.General.CancelSubsAfterTestRun { + client := *sethClient + returnToAddress := client.MustGetRootKeyAddress().Hex() + //cancel subs and return funds to sub owner + vrfv2plus.CancelSubsAndReturnFunds(testcontext.Get(*t), *vrfContracts, returnToAddress, *subIDsForCancellingAfterTest, l) + } + } else { + l.Error().Msg("VRF Contracts and/or Seth client are nil. Cannot execute cleanup") + } + } + if !*testConfig.VRFv2Plus.General.UseExistingEnv { + if *testEnv == nil { + l.Error().Msg("Test environment is nil. Cannot execute cleanup") + return + } + if err := (*testEnv).Cleanup(test_env.CleanupOpts{TestName: (*t).Name()}); err != nil { + l.Error().Err(err).Msg("Error cleaning up test environment") + } + } + } +} + func TestVRFv2Plus(t *testing.T) { t.Parallel() var ( @@ -52,30 +93,13 @@ func TestVRFv2Plus(t *testing.T) { config, err := tc.GetChainAndTestTypeSpecificConfig("Smoke", tc.VRFv2Plus) require.NoError(t, err, "Error getting config") - vrfv2PlusConfig := config.VRFv2Plus chainID := networks.MustGetSelectedNetworkConfig(config.GetNetworkConfig())[0].ChainID + configPtr := &config - cleanupFn := func() { - if sethClient.Cfg.IsSimulatedNetwork() { - l.Info(). - Str("Network Name", sethClient.Cfg.Network.Name). - Msg("Network is a simulated network. Skipping fund return for Coordinator Subscriptions.") - } else { - if *vrfv2PlusConfig.General.CancelSubsAfterTestRun { - //cancel subs and return funds to sub owner - vrfv2plus.CancelSubsAndReturnFunds(testcontext.Get(t), vrfContracts, sethClient.MustGetRootKeyAddress().Hex(), subIDsForCancellingAfterTest, l) - } - } - if !*vrfv2PlusConfig.General.UseExistingEnv { - if err := env.Cleanup(test_env.CleanupOpts{TestName: t.Name()}); err != nil { - l.Error().Err(err).Msg("Error cleaning up test environment") - } - } - } vrfEnvConfig := vrfcommon.VRFEnvConfig{ TestConfig: config, ChainID: chainID, - CleanupFn: cleanupFn, + CleanupFn: vrfv2PlusCleanUpFn(&t, &sethClient, &configPtr, &env, &vrfContracts, &subIDsForCancellingAfterTest), } newEnvConfig := vrfcommon.NewEnvConfig{ NodesToCreate: []vrfcommon.VRFNodeType{vrfcommon.VRF}, @@ -127,12 +151,6 @@ func TestVRFv2Plus(t *testing.T) { require.Equal(t, isNativeBilling, randomWordsFulfilledEvent.NativePayment, "RandomWordsFulfilled Event's `NativePayment` field should be false") require.True(t, randomWordsFulfilledEvent.Success, "RandomWordsFulfilled Event's `Success` field should be true") - expectedSubBalanceJuels := new(big.Int).Sub(subBalanceBeforeRequest, randomWordsFulfilledEvent.Payment) - subscription, err = vrfContracts.CoordinatorV2Plus.GetSubscription(testcontext.Get(t), subIDForRequestRandomness) - require.NoError(t, err, "error getting subscription information") - subBalanceAfterRequest := subscription.Balance - require.Equal(t, expectedSubBalanceJuels, subBalanceAfterRequest) - status, err := consumers[0].GetRequestStatus(testcontext.Get(t), randomWordsFulfilledEvent.RequestId) require.NoError(t, err, "error getting rand request status") require.True(t, status.Fulfilled) @@ -143,6 +161,19 @@ func TestVRFv2Plus(t *testing.T) { l.Info().Str("Output", w.String()).Msg("Randomness fulfilled") require.Equal(t, 1, w.Cmp(big.NewInt(0)), "Expected the VRF job give an answer bigger than 0") } + t.Run("Verify Billing", func(t *testing.T) { + actualSubPaymentJuels := randomWordsFulfilledEvent.Payment + + expectedSubBalanceJuels := new(big.Int).Sub(subBalanceBeforeRequest, actualSubPaymentJuels) + subscription, err = vrfContracts.CoordinatorV2Plus.GetSubscription(testcontext.Get(t), subIDForRequestRandomness) + require.NoError(t, err, "error getting subscription information") + subBalanceAfterRequest := subscription.Balance + require.Equal(t, expectedSubBalanceJuels, subBalanceAfterRequest) + + //todo - need to refactor the test so that when running on live testnet and deploying a new environment, + // we would load real Link Token and Link/ETH feed addresses from the config + }) + }) t.Run("Native Billing", func(t *testing.T) { configCopy := config.MustCopy().(tc.TestConfig) @@ -183,12 +214,6 @@ func TestVRFv2Plus(t *testing.T) { require.False(t, randomWordsFulfilledEvent.OnlyPremium) require.Equal(t, isNativeBilling, randomWordsFulfilledEvent.NativePayment) require.True(t, randomWordsFulfilledEvent.Success) - expectedSubBalanceWei := new(big.Int).Sub(subNativeTokenBalanceBeforeRequest, randomWordsFulfilledEvent.Payment) - subscription, err = vrfContracts.CoordinatorV2Plus.GetSubscription(testcontext.Get(t), subID) - require.NoError(t, err) - subBalanceAfterRequest := subscription.NativeBalance - require.Equal(t, expectedSubBalanceWei, subBalanceAfterRequest) - status, err := consumers[0].GetRequestStatus(testcontext.Get(t), randomWordsFulfilledEvent.RequestId) require.NoError(t, err, "error getting rand request status") require.True(t, status.Fulfilled) @@ -199,106 +224,63 @@ func TestVRFv2Plus(t *testing.T) { l.Info().Str("Output", w.String()).Msg("Randomness fulfilled") require.Equal(t, 1, w.Cmp(big.NewInt(0)), "Expected the VRF job give an answer bigger than 0") } - }) - t.Run("VRF Node waits block confirmation number specified by the consumer before sending fulfilment on-chain", func(t *testing.T) { - configCopy := config.MustCopy().(tc.TestConfig) - testConfig := configCopy.VRFv2Plus.General - var isNativeBilling = true - - consumers, subIDs, err := vrfv2plus.SetupNewConsumersAndSubs( - testcontext.Get(t), - sethClient, - vrfContracts.CoordinatorV2Plus, - configCopy, - vrfContracts.LinkToken, - 1, - 1, - l, - ) - require.NoError(t, err, "error setting up new consumers and subs") - subID := subIDs[0] - subscription, err := vrfContracts.CoordinatorV2Plus.GetSubscription(testcontext.Get(t), subID) - require.NoError(t, err, "error getting subscription information") - vrfcommon.LogSubDetails(l, subscription, subID.String(), vrfContracts.CoordinatorV2Plus) - subIDsForCancellingAfterTest = append(subIDsForCancellingAfterTest, subIDs...) - - expectedBlockNumberWait := uint16(10) - testConfig.MinimumConfirmations = ptr.Ptr[uint16](expectedBlockNumberWait) - randomWordsRequestedEvent, randomWordsFulfilledEvent, err := vrfv2plus.RequestRandomnessAndWaitForFulfillment( - consumers[0], - vrfContracts.CoordinatorV2Plus, - vrfKey, - subID, - isNativeBilling, - testConfig, - l, - 0, - ) - require.NoError(t, err, "error requesting randomness and waiting for fulfilment") - - // check that VRF node waited at least the number of blocks specified by the consumer in the rand request min confs field - blockNumberWait := randomWordsRequestedEvent.Raw.BlockNumber - randomWordsFulfilledEvent.Raw.BlockNumber - require.GreaterOrEqual(t, blockNumberWait, uint64(expectedBlockNumberWait)) - - status, err := consumers[0].GetRequestStatus(testcontext.Get(t), randomWordsFulfilledEvent.RequestId) - require.NoError(t, err, "error getting rand request status") - require.True(t, status.Fulfilled) - l.Info().Bool("Fulfilment Status", status.Fulfilled).Msg("Random Words Request Fulfilment Status") - }) - t.Run("CL Node VRF Job Runs", func(t *testing.T) { - configCopy := config.MustCopy().(tc.TestConfig) - var isNativeBilling = false - - consumers, subIDsForRequestRandomness, err := vrfv2plus.SetupNewConsumersAndSubs( - testcontext.Get(t), - sethClient, - vrfContracts.CoordinatorV2Plus, - configCopy, - vrfContracts.LinkToken, - 1, - 1, - l, - ) - require.NoError(t, err, "error setting up new consumers and subs") - subIDForRequestRandomness := subIDsForRequestRandomness[0] - subscription, err := vrfContracts.CoordinatorV2Plus.GetSubscription(testcontext.Get(t), subIDForRequestRandomness) - require.NoError(t, err, "error getting subscription information") - vrfcommon.LogSubDetails(l, subscription, subIDForRequestRandomness.String(), vrfContracts.CoordinatorV2Plus) - subIDsForCancellingAfterTest = append(subIDsForCancellingAfterTest, subIDsForRequestRandomness...) - - jobRunsBeforeTest, err := nodeTypeToNodeMap[vrfcommon.VRF].CLNode.API.MustReadRunsByJob(nodeTypeToNodeMap[vrfcommon.VRF].Job.Data.ID) - require.NoError(t, err, "error reading job runs") - - // test and assert - _, _, err = vrfv2plus.RequestRandomnessAndWaitForFulfillment( - consumers[0], - vrfContracts.CoordinatorV2Plus, - vrfKey, - subIDForRequestRandomness, - isNativeBilling, - configCopy.VRFv2Plus.General, - l, - 0, - ) - require.NoError(t, err, "error requesting randomness and waiting for fulfilment") + t.Run("Verify Billing", func(t *testing.T) { + actualSubPaymentWei := randomWordsFulfilledEvent.Payment + expectedSubBalanceWei := new(big.Int).Sub(subNativeTokenBalanceBeforeRequest, actualSubPaymentWei) + subscription, err = vrfContracts.CoordinatorV2Plus.GetSubscription(testcontext.Get(t), subID) + require.NoError(t, err) + subBalanceAfterRequest := subscription.NativeBalance + require.Equal(t, expectedSubBalanceWei, subBalanceAfterRequest) - jobRuns, err := nodeTypeToNodeMap[vrfcommon.VRF].CLNode.API.MustReadRunsByJob(nodeTypeToNodeMap[vrfcommon.VRF].Job.Data.ID) - require.NoError(t, err, "error reading job runs") - require.Equal(t, len(jobRunsBeforeTest.Data)+1, len(jobRuns.Data)) + // verify that the actual sub payment is within the expected range - this cannot be checked on SIMULATED env + coordinatorConfig, err := vrfContracts.CoordinatorV2Plus.GetConfig(testcontext.Get(t)) + require.NoError(t, err, "error getting coordinator config") + //check that Coordinator config is correct + require.Equal(t, *configCopy.VRFv2Plus.General.FulfillmentFlatFeeNativePPM, coordinatorConfig.FulfillmentFlatFeeNativePPM) + require.Equal(t, *configCopy.VRFv2Plus.General.NativePremiumPercentage, coordinatorConfig.NativePremiumPercentage) + require.Equal(t, *configCopy.VRFv2Plus.General.GasAfterPaymentCalculation, coordinatorConfig.GasAfterPaymentCalculation) + // check that the actual sub payment is within the expected range and is according to the coordinator config's billing settings + fulfillmentTxHash := randomWordsFulfilledEvent.Raw.TxHash + fulfillmentTxReceipt, err := sethClient.Client.TransactionReceipt(testcontext.Get(t), fulfillmentTxHash) + require.NoError(t, err, "error getting fulfilment tx receipt") + + txGasUsed := new(big.Int).SetUint64(fulfillmentTxReceipt.GasUsed) + // we don't have that information for older Geth versions + if fulfillmentTxReceipt.EffectiveGasPrice == nil { + fulfillmentTxReceipt.EffectiveGasPrice = new(big.Int).SetUint64(0) + } + fulfillmentTxFeeWei := new(big.Int).Mul(txGasUsed, fulfillmentTxReceipt.EffectiveGasPrice) + + premiumFeeInDecimal := new(big.Float).Quo(big.NewFloat(float64(*configCopy.VRFv2Plus.General.CoordinatorNativePremiumPercentage)), big.NewFloat(100)) + premiumFeeRatio := new(big.Float).Add(premiumFeeInDecimal, big.NewFloat(1)) + // since - tx fee * (premium fee in decimal + 1) = expected sub payment + fulfillmentTxFeeWeiFloat64, _ := fulfillmentTxFeeWei.Float64() + expectedSubPaymentWeiWithoutFlatFee := new(big.Float).Mul(big.NewFloat(fulfillmentTxFeeWeiFloat64), premiumFeeRatio) + flatFee := new(big.Float).Mul(big.NewFloat(float64(*configCopy.VRFv2Plus.General.FulfillmentFlatFeeNativePPM)), big.NewFloat(1e12)) + expectedSubPaymentWeiWitFlatFee := new(big.Float).Add(expectedSubPaymentWeiWithoutFlatFee, flatFee) + vrfv2plus.LogPaymentDetails(l, fulfillmentTxFeeWei, fulfillmentTxReceipt, actualSubPaymentWei, expectedSubPaymentWeiWitFlatFee, configCopy) + actualSubPaymentWeiFloat, _ := actualSubPaymentWei.Float64() + expectedSubPaymentWeiFloat, _ := expectedSubPaymentWeiWitFlatFee.Float64() + + //verify that the actual sub payment is more than TX fee + require.Equal(t, 1, actualSubPaymentWei.Cmp(fulfillmentTxFeeWei), "the actual sub payment has to be more than the TX fee") + + tolerance := *testConfig.SubBillingTolerance + isWithinTolerance, diff := actions.WithinTolerance(actualSubPaymentWeiFloat, expectedSubPaymentWeiFloat, tolerance) + require.True(t, isWithinTolerance, fmt.Sprintf("Expected the actual sub payment to be within %f tolerance of the expected sub payment. Diff: %f", tolerance, diff)) + }) }) t.Run("Direct Funding", func(t *testing.T) { configCopy := config.MustCopy().(tc.TestConfig) - wrapperContracts, wrapperSubID, err := vrfv2plus.SetupVRFV2PlusWrapperEnvironment( + wrapperContracts, wrapperSubID, err := vrfv2plus.SetupVRFV2PlusWrapperUniverse( testcontext.Get(t), - l, sethClient, + vrfContracts, &configCopy, - vrfContracts.LinkToken, - vrfContracts.MockETHLINKFeed, - vrfContracts.CoordinatorV2Plus, vrfKey.KeyHash, 1, + l, ) require.NoError(t, err) @@ -307,7 +289,7 @@ func TestVRFv2Plus(t *testing.T) { testConfig := configCopy.VRFv2Plus.General var isNativeBilling = false - wrapperConsumerJuelsBalanceBeforeRequest, err := vrfContracts.LinkToken.BalanceOf(testcontext.Get(t), wrapperContracts.LoadTestConsumers[0].Address()) + wrapperConsumerJuelsBalanceBeforeRequest, err := vrfContracts.LinkToken.BalanceOf(testcontext.Get(t), wrapperContracts.WrapperConsumers[0].Address()) require.NoError(t, err, "error getting wrapper consumer balance") wrapperSubscription, err := vrfContracts.CoordinatorV2Plus.GetSubscription(testcontext.Get(t), wrapperSubID) @@ -315,7 +297,7 @@ func TestVRFv2Plus(t *testing.T) { subBalanceBeforeRequest := wrapperSubscription.Balance randomWordsFulfilledEvent, err := vrfv2plus.DirectFundingRequestRandomnessAndWaitForFulfillment( - wrapperContracts.LoadTestConsumers[0], + wrapperContracts.WrapperConsumers[0], vrfContracts.CoordinatorV2Plus, vrfKey, wrapperSubID, @@ -331,13 +313,13 @@ func TestVRFv2Plus(t *testing.T) { subBalanceAfterRequest := wrapperSubscription.Balance require.Equal(t, expectedSubBalanceJuels, subBalanceAfterRequest) - consumerStatus, err := wrapperContracts.LoadTestConsumers[0].GetRequestStatus(testcontext.Get(t), randomWordsFulfilledEvent.RequestId) + consumerStatus, err := wrapperContracts.WrapperConsumers[0].GetRequestStatus(testcontext.Get(t), randomWordsFulfilledEvent.RequestId) require.NoError(t, err, "error getting rand request status") require.True(t, consumerStatus.Fulfilled) expectedWrapperConsumerJuelsBalance := new(big.Int).Sub(wrapperConsumerJuelsBalanceBeforeRequest, consumerStatus.Paid) - wrapperConsumerJuelsBalanceAfterRequest, err := vrfContracts.LinkToken.BalanceOf(testcontext.Get(t), wrapperContracts.LoadTestConsumers[0].Address()) + wrapperConsumerJuelsBalanceAfterRequest, err := vrfContracts.LinkToken.BalanceOf(testcontext.Get(t), wrapperContracts.WrapperConsumers[0].Address()) require.NoError(t, err, "error getting wrapper consumer balance") require.Equal(t, expectedWrapperConsumerJuelsBalance, wrapperConsumerJuelsBalanceAfterRequest) @@ -356,7 +338,7 @@ func TestVRFv2Plus(t *testing.T) { testConfig := configCopy.VRFv2Plus.General var isNativeBilling = true - wrapperConsumerBalanceBeforeRequestWei, err := sethClient.Client.BalanceAt(testcontext.Get(t), common.HexToAddress(wrapperContracts.LoadTestConsumers[0].Address()), nil) + wrapperConsumerBalanceBeforeRequestWei, err := sethClient.Client.BalanceAt(testcontext.Get(t), common.HexToAddress(wrapperContracts.WrapperConsumers[0].Address()), nil) require.NoError(t, err, "error getting wrapper consumer balance") wrapperSubscription, err := vrfContracts.CoordinatorV2Plus.GetSubscription(testcontext.Get(t), wrapperSubID) @@ -364,7 +346,7 @@ func TestVRFv2Plus(t *testing.T) { subBalanceBeforeRequest := wrapperSubscription.NativeBalance randomWordsFulfilledEvent, err := vrfv2plus.DirectFundingRequestRandomnessAndWaitForFulfillment( - wrapperContracts.LoadTestConsumers[0], + wrapperContracts.WrapperConsumers[0], vrfContracts.CoordinatorV2Plus, vrfKey, wrapperSubID, @@ -380,13 +362,13 @@ func TestVRFv2Plus(t *testing.T) { subBalanceAfterRequest := wrapperSubscription.NativeBalance require.Equal(t, expectedSubBalanceWei, subBalanceAfterRequest) - consumerStatus, err := wrapperContracts.LoadTestConsumers[0].GetRequestStatus(testcontext.Get(t), randomWordsFulfilledEvent.RequestId) + consumerStatus, err := wrapperContracts.WrapperConsumers[0].GetRequestStatus(testcontext.Get(t), randomWordsFulfilledEvent.RequestId) require.NoError(t, err, "error getting rand request status") require.True(t, consumerStatus.Fulfilled) expectedWrapperConsumerWeiBalance := new(big.Int).Sub(wrapperConsumerBalanceBeforeRequestWei, consumerStatus.Paid) - wrapperConsumerBalanceAfterRequestWei, err := sethClient.Client.BalanceAt(testcontext.Get(t), common.HexToAddress(wrapperContracts.LoadTestConsumers[0].Address()), nil) + wrapperConsumerBalanceAfterRequestWei, err := sethClient.Client.BalanceAt(testcontext.Get(t), common.HexToAddress(wrapperContracts.WrapperConsumers[0].Address()), nil) require.NoError(t, err, "error getting wrapper consumer balance") require.Equal(t, expectedWrapperConsumerWeiBalance, wrapperConsumerBalanceAfterRequestWei) @@ -401,6 +383,92 @@ func TestVRFv2Plus(t *testing.T) { } }) }) + t.Run("VRF Node waits block confirmation number specified by the consumer before sending fulfilment on-chain", func(t *testing.T) { + configCopy := config.MustCopy().(tc.TestConfig) + testConfig := configCopy.VRFv2Plus.General + var isNativeBilling = true + + consumers, subIDs, err := vrfv2plus.SetupNewConsumersAndSubs( + testcontext.Get(t), + sethClient, + vrfContracts.CoordinatorV2Plus, + configCopy, + vrfContracts.LinkToken, + 1, + 1, + l, + ) + require.NoError(t, err, "error setting up new consumers and subs") + subID := subIDs[0] + subscription, err := vrfContracts.CoordinatorV2Plus.GetSubscription(testcontext.Get(t), subID) + require.NoError(t, err, "error getting subscription information") + vrfcommon.LogSubDetails(l, subscription, subID.String(), vrfContracts.CoordinatorV2Plus) + subIDsForCancellingAfterTest = append(subIDsForCancellingAfterTest, subIDs...) + + expectedBlockNumberWait := uint16(10) + testConfig.MinimumConfirmations = ptr.Ptr[uint16](expectedBlockNumberWait) + randomWordsRequestedEvent, randomWordsFulfilledEvent, err := vrfv2plus.RequestRandomnessAndWaitForFulfillment( + consumers[0], + vrfContracts.CoordinatorV2Plus, + vrfKey, + subID, + isNativeBilling, + testConfig, + l, + 0, + ) + require.NoError(t, err, "error requesting randomness and waiting for fulfilment") + + // check that VRF node waited at least the number of blocks specified by the consumer in the rand request min confs field + blockNumberWait := randomWordsRequestedEvent.Raw.BlockNumber - randomWordsFulfilledEvent.Raw.BlockNumber + require.GreaterOrEqual(t, blockNumberWait, uint64(expectedBlockNumberWait)) + + status, err := consumers[0].GetRequestStatus(testcontext.Get(t), randomWordsFulfilledEvent.RequestId) + require.NoError(t, err, "error getting rand request status") + require.True(t, status.Fulfilled) + l.Info().Bool("Fulfilment Status", status.Fulfilled).Msg("Random Words Request Fulfilment Status") + }) + t.Run("CL Node VRF Job Runs", func(t *testing.T) { + configCopy := config.MustCopy().(tc.TestConfig) + var isNativeBilling = false + + consumers, subIDsForRequestRandomness, err := vrfv2plus.SetupNewConsumersAndSubs( + testcontext.Get(t), + sethClient, + vrfContracts.CoordinatorV2Plus, + configCopy, + vrfContracts.LinkToken, + 1, + 1, + l, + ) + require.NoError(t, err, "error setting up new consumers and subs") + subIDForRequestRandomness := subIDsForRequestRandomness[0] + subscription, err := vrfContracts.CoordinatorV2Plus.GetSubscription(testcontext.Get(t), subIDForRequestRandomness) + require.NoError(t, err, "error getting subscription information") + vrfcommon.LogSubDetails(l, subscription, subIDForRequestRandomness.String(), vrfContracts.CoordinatorV2Plus) + subIDsForCancellingAfterTest = append(subIDsForCancellingAfterTest, subIDsForRequestRandomness...) + + jobRunsBeforeTest, err := nodeTypeToNodeMap[vrfcommon.VRF].CLNode.API.MustReadRunsByJob(nodeTypeToNodeMap[vrfcommon.VRF].Job.Data.ID) + require.NoError(t, err, "error reading job runs") + + // test and assert + _, _, err = vrfv2plus.RequestRandomnessAndWaitForFulfillment( + consumers[0], + vrfContracts.CoordinatorV2Plus, + vrfKey, + subIDForRequestRandomness, + isNativeBilling, + configCopy.VRFv2Plus.General, + l, + 0, + ) + require.NoError(t, err, "error requesting randomness and waiting for fulfilment") + + jobRuns, err := nodeTypeToNodeMap[vrfcommon.VRF].CLNode.API.MustReadRunsByJob(nodeTypeToNodeMap[vrfcommon.VRF].Job.Data.ID) + require.NoError(t, err, "error reading job runs") + require.Equal(t, len(jobRunsBeforeTest.Data)+1, len(jobRuns.Data)) + }) t.Run("Canceling Sub And Returning Funds", func(t *testing.T) { configCopy := config.MustCopy().(tc.TestConfig) @@ -749,30 +817,13 @@ func TestVRFv2PlusMultipleSendingKeys(t *testing.T) { config, err := tc.GetChainAndTestTypeSpecificConfig("Smoke", tc.VRFv2Plus) require.NoError(t, err, "Error getting config") - vrfv2PlusConfig := config.VRFv2Plus chainID := networks.MustGetSelectedNetworkConfig(config.GetNetworkConfig())[0].ChainID + configPtr := &config - cleanupFn := func() { - if sethClient.Cfg.IsSimulatedNetwork() { - l.Info(). - Str("Network Name", sethClient.Cfg.Network.Name). - Msg("Network is a simulated network. Skipping fund return for Coordinator Subscriptions.") - } else { - if *vrfv2PlusConfig.General.CancelSubsAfterTestRun { - //cancel subs and return funds to sub owner - vrfv2plus.CancelSubsAndReturnFunds(testcontext.Get(t), vrfContracts, sethClient.MustGetRootKeyAddress().Hex(), subIDsForCancellingAfterTest, l) - } - } - if !*vrfv2PlusConfig.General.UseExistingEnv { - if err := env.Cleanup(test_env.CleanupOpts{TestName: t.Name()}); err != nil { - l.Error().Err(err).Msg("Error cleaning up test environment") - } - } - } vrfEnvConfig := vrfcommon.VRFEnvConfig{ TestConfig: config, ChainID: chainID, - CleanupFn: cleanupFn, + CleanupFn: vrfv2PlusCleanUpFn(&t, &sethClient, &configPtr, &env, &vrfContracts, &subIDsForCancellingAfterTest), } newEnvConfig := vrfcommon.NewEnvConfig{ NodesToCreate: []vrfcommon.VRFNodeType{vrfcommon.VRF}, @@ -854,30 +905,13 @@ func TestVRFv2PlusMigration(t *testing.T) { config, err := tc.GetChainAndTestTypeSpecificConfig("Smoke", tc.VRFv2Plus) require.NoError(t, err, "Error getting config") - vrfv2PlusConfig := config.VRFv2Plus chainID := networks.MustGetSelectedNetworkConfig(config.GetNetworkConfig())[0].ChainID + configPtr := &config - cleanupFn := func() { - if sethClient.Cfg.IsSimulatedNetwork() { - l.Info(). - Str("Network Name", sethClient.Cfg.Network.Name). - Msg("Network is a simulated network. Skipping fund return for Coordinator Subscriptions.") - } else { - if *vrfv2PlusConfig.General.CancelSubsAfterTestRun { - //cancel subs and return funds to sub owner - vrfv2plus.CancelSubsAndReturnFunds(testcontext.Get(t), vrfContracts, sethClient.MustGetRootKeyAddress().Hex(), subIDsForCancellingAfterTest, l) - } - } - if !*vrfv2PlusConfig.General.UseExistingEnv { - if err := env.Cleanup(test_env.CleanupOpts{TestName: t.Name()}); err != nil { - l.Error().Err(err).Msg("Error cleaning up test environment") - } - } - } vrfEnvConfig := vrfcommon.VRFEnvConfig{ TestConfig: config, ChainID: chainID, - CleanupFn: cleanupFn, + CleanupFn: vrfv2PlusCleanUpFn(&t, &sethClient, &configPtr, &env, &vrfContracts, &subIDsForCancellingAfterTest), } newEnvConfig := vrfcommon.NewEnvConfig{ NodesToCreate: []vrfcommon.VRFNodeType{vrfcommon.VRF}, @@ -1063,16 +1097,14 @@ func TestVRFv2PlusMigration(t *testing.T) { t.Run("Test migration of direct billing using VRFV2PlusWrapper subID", func(t *testing.T) { configCopy := config.MustCopy().(tc.TestConfig) - wrapperContracts, wrapperSubID, err := vrfv2plus.SetupVRFV2PlusWrapperEnvironment( + wrapperContracts, wrapperSubID, err := vrfv2plus.SetupVRFV2PlusWrapperUniverse( testcontext.Get(t), - l, sethClient, + vrfContracts, &configCopy, - vrfContracts.LinkToken, - vrfContracts.MockETHLINKFeed, - vrfContracts.CoordinatorV2Plus, vrfKey.KeyHash, 1, + l, ) require.NoError(t, err) subID := wrapperSubID @@ -1203,7 +1235,7 @@ func TestVRFv2PlusMigration(t *testing.T) { // Verify rand requests fulfills with Link Token billing isNativeBilling := false randomWordsFulfilledEvent, err := vrfv2plus.DirectFundingRequestRandomnessAndWaitForFulfillment( - wrapperContracts.LoadTestConsumers[0], + wrapperContracts.WrapperConsumers[0], newCoordinator, vrfKey, subID, @@ -1212,14 +1244,14 @@ func TestVRFv2PlusMigration(t *testing.T) { l, ) require.NoError(t, err, "error requesting randomness and waiting for fulfilment") - consumerStatus, err := wrapperContracts.LoadTestConsumers[0].GetRequestStatus(testcontext.Get(t), randomWordsFulfilledEvent.RequestId) + consumerStatus, err := wrapperContracts.WrapperConsumers[0].GetRequestStatus(testcontext.Get(t), randomWordsFulfilledEvent.RequestId) require.NoError(t, err, "error getting rand request status") require.True(t, consumerStatus.Fulfilled) // Verify rand requests fulfills with Native Token billing isNativeBilling = true randomWordsFulfilledEvent, err = vrfv2plus.DirectFundingRequestRandomnessAndWaitForFulfillment( - wrapperContracts.LoadTestConsumers[0], + wrapperContracts.WrapperConsumers[0], newCoordinator, vrfKey, subID, @@ -1228,7 +1260,7 @@ func TestVRFv2PlusMigration(t *testing.T) { l, ) require.NoError(t, err, "error requesting randomness and waiting for fulfilment") - consumerStatus, err = wrapperContracts.LoadTestConsumers[0].GetRequestStatus(testcontext.Get(t), randomWordsFulfilledEvent.RequestId) + consumerStatus, err = wrapperContracts.WrapperConsumers[0].GetRequestStatus(testcontext.Get(t), randomWordsFulfilledEvent.RequestId) require.NoError(t, err, "error getting rand request status") require.True(t, consumerStatus.Fulfilled) }) @@ -1250,24 +1282,7 @@ func TestVRFV2PlusWithBHS(t *testing.T) { require.NoError(t, err, "Error getting config") vrfv2PlusConfig := config.VRFv2Plus chainID := networks.MustGetSelectedNetworkConfig(config.GetNetworkConfig())[0].ChainID - - cleanupFn := func() { - if sethClient.Cfg.IsSimulatedNetwork() { - l.Info(). - Str("Network Name", sethClient.Cfg.Network.Name). - Msg("Network is a simulated network. Skipping fund return for Coordinator Subscriptions.") - } else { - if *vrfv2PlusConfig.General.CancelSubsAfterTestRun { - //cancel subs and return funds to sub owner - vrfv2plus.CancelSubsAndReturnFunds(testcontext.Get(t), vrfContracts, sethClient.MustGetRootKeyAddress().Hex(), subIDsForCancellingAfterTest, l) - } - } - if !*vrfv2PlusConfig.General.UseExistingEnv { - if err := env.Cleanup(test_env.CleanupOpts{TestName: t.Name()}); err != nil { - l.Error().Err(err).Msg("Error cleaning up test environment") - } - } - } + configPtr := &config //decrease default span for checking blockhashes for unfulfilled requests vrfv2PlusConfig.General.BHSJobWaitBlocks = ptr.Ptr(2) @@ -1275,7 +1290,7 @@ func TestVRFV2PlusWithBHS(t *testing.T) { vrfEnvConfig := vrfcommon.VRFEnvConfig{ TestConfig: config, ChainID: chainID, - CleanupFn: cleanupFn, + CleanupFn: vrfv2PlusCleanUpFn(&t, &sethClient, &configPtr, &env, &vrfContracts, &subIDsForCancellingAfterTest), } newEnvConfig := vrfcommon.NewEnvConfig{ NodesToCreate: []vrfcommon.VRFNodeType{vrfcommon.VRF, vrfcommon.BHS}, @@ -1347,11 +1362,10 @@ func TestVRFV2PlusWithBHS(t *testing.T) { }() if *configCopy.VRFv2Plus.General.GenerateTXsOnChain { + wg.Add(1) go func() { - _, err := actions.ContinuouslyGenerateTXsOnChain(sethClient, desiredBlockNumberReached, l) + _, err := actions.ContinuouslyGenerateTXsOnChain(sethClient, desiredBlockNumberReached, &wg, l) require.NoError(t, err) - // Wait to let the transactions be mined and avoid nonce issues - time.Sleep(time.Second * 5) }() } wg.Wait() @@ -1365,12 +1379,15 @@ func TestVRFV2PlusWithBHS(t *testing.T) { *configCopy.VRFv2Plus.General.SubscriptionBillingType, ) require.NoError(t, err, "error funding subscriptions") - randomWordsFulfilledEvent, err := vrfContracts.CoordinatorV2Plus.WaitForRandomWordsFulfilledEvent( - contracts.RandomWordsFulfilledEventFilter{ - RequestIds: []*big.Int{randomWordsRequestedEvent.RequestId}, - SubIDs: []*big.Int{subID}, - Timeout: configCopy.VRFv2Plus.General.RandomWordsFulfilledEventTimeout.Duration, - }, + randomWordsFulfilledEvent, err := vrfv2plus.WaitRandomWordsFulfilledEvent( + vrfContracts.CoordinatorV2Plus, + randomWordsRequestedEvent.RequestId, + subID, + randomWordsRequestedEvent.Raw.BlockNumber, + isNativeBilling, + configCopy.VRFv2Plus.General.RandomWordsFulfilledEventTimeout.Duration, + l, + 0, ) require.NoError(t, err, "error waiting for randomness fulfilled event") vrfcommon.LogRandomWordsFulfilledEvent(l, vrfContracts.CoordinatorV2Plus, randomWordsFulfilledEvent, isNativeBilling, 0) @@ -1446,28 +1463,37 @@ func TestVRFV2PlusWithBHS(t *testing.T) { metrics, err := consumers[0].GetLoadTestMetrics(testcontext.Get(t)) require.Equal(t, 0, metrics.RequestCount.Cmp(big.NewInt(1))) require.Equal(t, 0, metrics.FulfilmentCount.Cmp(big.NewInt(0))) - - var clNodeTxs *client.TransactionsData - var txHash string gom := gomega.NewGomegaWithT(t) - gom.Eventually(func(g gomega.Gomega) { - clNodeTxs, _, err = nodeTypeToNodeMap[vrfcommon.BHS].CLNode.API.ReadTransactions() - g.Expect(err).ShouldNot(gomega.HaveOccurred(), "error getting CL Node transactions") - l.Info().Int("Number of TXs", len(clNodeTxs.Data)).Msg("BHS Node txs") - g.Expect(len(clNodeTxs.Data)).Should(gomega.BeNumerically("==", 1), "Expected 1 tx posted by BHS Node, but found %d", len(clNodeTxs.Data)) - txHash = clNodeTxs.Data[0].Attributes.Hash - }, "2m", "1s").Should(gomega.Succeed()) - - require.Equal(t, strings.ToLower(vrfContracts.BHS.Address()), strings.ToLower(clNodeTxs.Data[0].Attributes.To)) - bhsStoreTx, _, err := sethClient.Client.TransactionByHash(testcontext.Get(t), common.HexToHash(txHash)) - require.NoError(t, err, "error getting tx from hash") + if !*configCopy.VRFv2Plus.General.UseExistingEnv { + l.Info().Msg("Checking BHS Node's transactions") + var clNodeTxs *client.TransactionsData + var txHash string + gom.Eventually(func(g gomega.Gomega) { + clNodeTxs, _, err = nodeTypeToNodeMap[vrfcommon.BHS].CLNode.API.ReadTransactions() + g.Expect(err).ShouldNot(gomega.HaveOccurred(), "error getting CL Node transactions") + g.Expect(len(clNodeTxs.Data)).Should(gomega.BeNumerically("==", 1), "Expected 1 tx posted by BHS Node, but found %d", len(clNodeTxs.Data)) + txHash = clNodeTxs.Data[0].Attributes.Hash + l.Info(). + Str("TX Hash", txHash). + Int("Number of TXs", len(clNodeTxs.Data)). + Msg("BHS Node txs") + }, "2m", "1s").Should(gomega.Succeed()) + + require.Equal(t, strings.ToLower(vrfContracts.BHS.Address()), strings.ToLower(clNodeTxs.Data[0].Attributes.To)) + + bhsStoreTx, _, err := sethClient.Client.TransactionByHash(testcontext.Get(t), common.HexToHash(txHash)) + require.NoError(t, err, "error getting tx from hash") - bhsStoreTxInputData, err := actions.DecodeTxInputData(blockhash_store.BlockhashStoreABI, bhsStoreTx.Data()) - l.Info(). - Str("Block Number", bhsStoreTxInputData["n"].(*big.Int).String()). - Msg("BHS Node's Store Blockhash for Blocknumber Method TX") - require.Equal(t, randRequestBlockNumber, bhsStoreTxInputData["n"].(*big.Int).Uint64()) + bhsStoreTxInputData, err := actions.DecodeTxInputData(blockhash_store.BlockhashStoreABI, bhsStoreTx.Data()) + require.NoError(t, err, "error decoding tx input data") + l.Info(). + Str("Block Number", bhsStoreTxInputData["n"].(*big.Int).String()). + Msg("BHS Node's Store Blockhash for Blocknumber Method TX") + require.Equal(t, randRequestBlockNumber, bhsStoreTxInputData["n"].(*big.Int).Uint64()) + } else { + l.Warn().Msg("Skipping BHS Node's transactions check as existing env is used") + } var randRequestBlockHash [32]byte gom.Eventually(func(g gomega.Gomega) { @@ -1496,28 +1522,10 @@ func TestVRFV2PlusWithBHF(t *testing.T) { config, err := tc.GetChainAndTestTypeSpecificConfig("Smoke", tc.VRFv2Plus) require.NoError(t, err, "Error getting config") - vrfv2PlusConfig := config.VRFv2Plus chainID := networks.MustGetSelectedNetworkConfig(config.GetNetworkConfig())[0].ChainID + configPtr := &config - cleanupFn := func() { - if sethClient.Cfg.IsSimulatedNetwork() { - l.Info(). - Str("Network Name", sethClient.Cfg.Network.Name). - Msg("Network is a simulated network. Skipping fund return for Coordinator Subscriptions.") - } else { - if *vrfv2PlusConfig.General.CancelSubsAfterTestRun { - //cancel subs and return funds to sub owner - vrfv2plus.CancelSubsAndReturnFunds(testcontext.Get(t), vrfContracts, sethClient.MustGetRootKeyAddress().Hex(), subIDsForCancellingAfterTest, l) - } - } - if !*vrfv2PlusConfig.General.UseExistingEnv { - if err := env.Cleanup(test_env.CleanupOpts{TestName: t.Name()}); err != nil { - l.Error().Err(err).Msg("Error cleaning up test environment") - } - } - } - - // BHF job config + // BHF job config - NOTE - not possible to create BHF job spec with waitBlocks being less than 256 blocks config.VRFv2Plus.General.BHFJobWaitBlocks = ptr.Ptr(260) config.VRFv2Plus.General.BHFJobLookBackBlocks = ptr.Ptr(500) config.VRFv2Plus.General.BHFJobPollPeriod = ptr.Ptr(blockchain.StrDuration{Duration: time.Second * 30}) @@ -1525,7 +1533,7 @@ func TestVRFV2PlusWithBHF(t *testing.T) { vrfEnvConfig := vrfcommon.VRFEnvConfig{ TestConfig: config, ChainID: chainID, - CleanupFn: cleanupFn, + CleanupFn: vrfv2PlusCleanUpFn(&t, &sethClient, &configPtr, &env, &vrfContracts, &subIDsForCancellingAfterTest), } chainlinkNodeLogScannerSettings := test_env.GetDefaultChainlinkNodeLogScannerSettingsWithExtraAllowedMessages(testreporters.NewAllowedLogMessage( "Pipeline error", @@ -1606,12 +1614,16 @@ func TestVRFV2PlusWithBHF(t *testing.T) { *configCopy.VRFv2Plus.General.SubscriptionBillingType, ) require.NoError(t, err, "error funding subscriptions") - randomWordsFulfilledEvent, err := vrfContracts.CoordinatorV2Plus.WaitForRandomWordsFulfilledEvent( - contracts.RandomWordsFulfilledEventFilter{ - RequestIds: []*big.Int{randomWordsRequestedEvent.RequestId}, - SubIDs: []*big.Int{subID}, - Timeout: configCopy.VRFv2Plus.General.RandomWordsFulfilledEventTimeout.Duration, - }, + + randomWordsFulfilledEvent, err := vrfv2plus.WaitRandomWordsFulfilledEvent( + vrfContracts.CoordinatorV2Plus, + randomWordsRequestedEvent.RequestId, + subID, + randomWordsRequestedEvent.Raw.BlockNumber, + isNativeBilling, + configCopy.VRFv2Plus.General.RandomWordsFulfilledEventTimeout.Duration, + l, + 0, ) require.NoError(t, err, "error waiting for randomness fulfilled event") vrfcommon.LogRandomWordsFulfilledEvent(l, vrfContracts.CoordinatorV2Plus, randomWordsFulfilledEvent, isNativeBilling, 0) @@ -1655,30 +1667,13 @@ func TestVRFv2PlusReplayAfterTimeout(t *testing.T) { config, err := tc.GetChainAndTestTypeSpecificConfig("Smoke", tc.VRFv2Plus) require.NoError(t, err, "Error getting config") - vrfv2PlusConfig := config.VRFv2Plus chainID := networks.MustGetSelectedNetworkConfig(config.GetNetworkConfig())[0].ChainID + configPtr := &config - cleanupFn := func() { - if sethClient.Cfg.IsSimulatedNetwork() { - l.Info(). - Str("Network Name", sethClient.Cfg.Network.Name). - Msg("Network is a simulated network. Skipping fund return for Coordinator Subscriptions.") - } else { - if *vrfv2PlusConfig.General.CancelSubsAfterTestRun { - //cancel subs and return funds to sub owner - vrfv2plus.CancelSubsAndReturnFunds(testcontext.Get(t), vrfContracts, sethClient.MustGetRootKeyAddress().Hex(), subIDsForCancellingAfterTest, l) - } - } - if !*vrfv2PlusConfig.General.UseExistingEnv { - if err := env.Cleanup(test_env.CleanupOpts{TestName: t.Name()}); err != nil { - l.Error().Err(err).Msg("Error cleaning up test environment") - } - } - } vrfEnvConfig := vrfcommon.VRFEnvConfig{ TestConfig: config, ChainID: chainID, - CleanupFn: cleanupFn, + CleanupFn: vrfv2PlusCleanUpFn(&t, &sethClient, &configPtr, &env, &vrfContracts, &subIDsForCancellingAfterTest), } newEnvConfig := vrfcommon.NewEnvConfig{ NodesToCreate: []vrfcommon.VRFNodeType{vrfcommon.VRF}, @@ -1790,12 +1785,15 @@ func TestVRFv2PlusReplayAfterTimeout(t *testing.T) { l.Info().Str("reqID", initialReqRandomWordsRequestedEvent.RequestId.String()). Str("subID", subID.String()). Msg("Waiting for initalReqRandomWordsFulfilledEvent") - initalReqRandomWordsFulfilledEvent, err := vrfContracts.CoordinatorV2Plus.WaitForRandomWordsFulfilledEvent( - contracts.RandomWordsFulfilledEventFilter{ - RequestIds: []*big.Int{initialReqRandomWordsRequestedEvent.RequestId}, - SubIDs: []*big.Int{subID}, - Timeout: configCopy.VRFv2Plus.General.RandomWordsFulfilledEventTimeout.Duration, - }, + initalReqRandomWordsFulfilledEvent, err := vrfv2plus.WaitRandomWordsFulfilledEvent( + vrfContracts.CoordinatorV2Plus, + initialReqRandomWordsRequestedEvent.RequestId, + subID, + initialReqRandomWordsRequestedEvent.Raw.BlockNumber, + isNativeBilling, + configCopy.VRFv2Plus.General.RandomWordsFulfilledEventTimeout.Duration, + l, + 0, ) require.NoError(t, err, "error waiting for initial request RandomWordsFulfilledEvent") @@ -1825,30 +1823,13 @@ func TestVRFv2PlusPendingBlockSimulationAndZeroConfirmationDelays(t *testing.T) config, err := tc.GetChainAndTestTypeSpecificConfig("Smoke", tc.VRFv2Plus) require.NoError(t, err, "Error getting config") - vrfv2PlusConfig := config.VRFv2Plus chainID := networks.MustGetSelectedNetworkConfig(config.GetNetworkConfig())[0].ChainID + configPtr := &config - cleanupFn := func() { - if sethClient.Cfg.IsSimulatedNetwork() { - l.Info(). - Str("Network Name", sethClient.Cfg.Network.Name). - Msg("Network is a simulated network. Skipping fund return for Coordinator Subscriptions.") - } else { - if *vrfv2PlusConfig.General.CancelSubsAfterTestRun { - //cancel subs and return funds to sub owner - vrfv2plus.CancelSubsAndReturnFunds(testcontext.Get(t), vrfContracts, sethClient.MustGetRootKeyAddress().Hex(), subIDsForCancellingAfterTest, l) - } - } - if !*vrfv2PlusConfig.General.UseExistingEnv { - if err := env.Cleanup(test_env.CleanupOpts{TestName: t.Name()}); err != nil { - l.Error().Err(err).Msg("Error cleaning up test environment") - } - } - } vrfEnvConfig := vrfcommon.VRFEnvConfig{ TestConfig: config, ChainID: chainID, - CleanupFn: cleanupFn, + CleanupFn: vrfv2PlusCleanUpFn(&t, &sethClient, &configPtr, &env, &vrfContracts, &subIDsForCancellingAfterTest), } newEnvConfig := vrfcommon.NewEnvConfig{ NodesToCreate: []vrfcommon.VRFNodeType{vrfcommon.VRF}, @@ -1911,7 +1892,6 @@ func TestVRFv2PlusNodeReorg(t *testing.T) { env *test_env.CLClusterTestEnv vrfContracts *vrfcommon.VRFContracts subIDsForCancellingAfterTest []*big.Int - defaultWalletAddress string vrfKey *vrfcommon.VRFKeyData sethClient *seth.Client ) @@ -1919,37 +1899,21 @@ func TestVRFv2PlusNodeReorg(t *testing.T) { config, err := tc.GetChainAndTestTypeSpecificConfig("Smoke", tc.VRFv2Plus) require.NoError(t, err, "Error getting config") - vrfv2PlusConfig := config.VRFv2Plus network := networks.MustGetSelectedNetworkConfig(config.GetNetworkConfig())[0] if !network.Simulated { t.Skip("Skipped since Reorg test could only be run on Simulated chain.") } chainID := network.ChainID - cleanupFn := func() { - if sethClient.Cfg.IsSimulatedNetwork() { - l.Info(). - Str("Network Name", sethClient.Cfg.Network.Name). - Msg("Network is a simulated network. Skipping fund return for Coordinator Subscriptions.") - } else { - if *vrfv2PlusConfig.General.CancelSubsAfterTestRun { - //cancel subs and return funds to sub owner - vrfv2plus.CancelSubsAndReturnFunds(testcontext.Get(t), vrfContracts, defaultWalletAddress, subIDsForCancellingAfterTest, l) - } - } - if !*vrfv2PlusConfig.General.UseExistingEnv { - if err := env.Cleanup(test_env.CleanupOpts{TestName: t.Name()}); err != nil { - l.Error().Err(err).Msg("Error cleaning up test environment") - } - } - } + configPtr := &config + vrfEnvConfig := vrfcommon.VRFEnvConfig{ TestConfig: config, ChainID: chainID, - CleanupFn: cleanupFn, + CleanupFn: vrfv2PlusCleanUpFn(&t, &sethClient, &configPtr, &env, &vrfContracts, &subIDsForCancellingAfterTest), } chainlinkNodeLogScannerSettings := test_env.GetDefaultChainlinkNodeLogScannerSettingsWithExtraAllowedMessages( testreporters.NewAllowedLogMessage( - "This is a problem and either means a very deep re-org occurred", + "Got very old block.", "Test is expecting a reorg to occur", zapcore.DPanicLevel, testreporters.WarnAboutAllowedMsgs_No), @@ -2069,12 +2033,15 @@ func TestVRFv2PlusNodeReorg(t *testing.T) { // For context - when performing debug_setHead on geth simulated chain and therefore rewinding chain to a previous block, //then tx that was mined after reorg will not appear in canonical chain contrary to real world scenario //Hence, we only verify that VRF node will not generate fulfillment for the reorged fork request - _, err = vrfContracts.CoordinatorV2Plus.WaitForRandomWordsFulfilledEvent( - contracts.RandomWordsFulfilledEventFilter{ - RequestIds: []*big.Int{randomWordsRequestedEvent.RequestId}, - SubIDs: []*big.Int{subID}, - Timeout: time.Second * 10, - }, + _, err = vrfv2plus.WaitRandomWordsFulfilledEvent( + vrfContracts.CoordinatorV2Plus, + randomWordsRequestedEvent.RequestId, + subID, + randomWordsRequestedEvent.Raw.BlockNumber, + isNativeBilling, + time.Second*10, + l, + 0, ) require.Error(t, err, "fulfillment should not be generated for the request which was made on reorged fork on Simulated Chain") }) @@ -2087,7 +2054,6 @@ func TestVRFv2PlusBatchFulfillmentEnabledDisabled(t *testing.T) { env *test_env.CLClusterTestEnv vrfContracts *vrfcommon.VRFContracts subIDsForCancellingAfterTest []*big.Int - defaultWalletAddress string vrfKey *vrfcommon.VRFKeyData nodeTypeToNodeMap map[vrfcommon.VRFNodeType]*vrfcommon.VRFNode sethClient *seth.Client @@ -2096,30 +2062,14 @@ func TestVRFv2PlusBatchFulfillmentEnabledDisabled(t *testing.T) { config, err := tc.GetChainAndTestTypeSpecificConfig("Smoke", tc.VRFv2Plus) require.NoError(t, err, "Error getting config") - vrfv2PlusConfig := config.VRFv2Plus network := networks.MustGetSelectedNetworkConfig(config.GetNetworkConfig())[0] chainID := network.ChainID - cleanupFn := func() { - if sethClient.Cfg.IsSimulatedNetwork() { - l.Info(). - Str("Network Name", sethClient.Cfg.Network.Name). - Msg("Network is a simulated network. Skipping fund return for Coordinator Subscriptions.") - } else { - if *vrfv2PlusConfig.General.CancelSubsAfterTestRun { - //cancel subs and return funds to sub owner - vrfv2plus.CancelSubsAndReturnFunds(testcontext.Get(t), vrfContracts, defaultWalletAddress, subIDsForCancellingAfterTest, l) - } - } - if !*vrfv2PlusConfig.General.UseExistingEnv { - if err := env.Cleanup(test_env.CleanupOpts{TestName: t.Name()}); err != nil { - l.Error().Err(err).Msg("Error cleaning up test environment") - } - } - } + configPtr := &config + vrfEnvConfig := vrfcommon.VRFEnvConfig{ TestConfig: config, ChainID: chainID, - CleanupFn: cleanupFn, + CleanupFn: vrfv2PlusCleanUpFn(&t, &sethClient, &configPtr, &env, &vrfContracts, &subIDsForCancellingAfterTest), } newEnvConfig := vrfcommon.NewEnvConfig{ NodesToCreate: []vrfcommon.VRFNodeType{vrfcommon.VRF}, diff --git a/integration-tests/soak/forwarder_ocr_test.go b/integration-tests/soak/forwarder_ocr_test.go index dd7eb102170..292693d5098 100644 --- a/integration-tests/soak/forwarder_ocr_test.go +++ b/integration-tests/soak/forwarder_ocr_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/smartcontractkit/chainlink-testing-framework/logging" + "github.com/smartcontractkit/chainlink-testing-framework/lib/logging" "github.com/smartcontractkit/chainlink/integration-tests/actions" tc "github.com/smartcontractkit/chainlink/integration-tests/testconfig" @@ -42,6 +42,11 @@ func executeForwarderOCRSoakTest(t *testing.T, config *tc.TestConfig) { t.Cleanup(func() { if err := actions.TeardownRemoteSuite(ocrSoakTest.TearDownVals(t)); err != nil { l.Error().Err(err).Msg("Error tearing down environment") + } else { + err := ocrSoakTest.Environment().Client.RemoveNamespace(ocrSoakTest.Environment().Cfg.Namespace) + if err != nil { + l.Error().Err(err).Msg("Error removing namespace") + } } }) ocrSoakTest.Setup(config) diff --git a/integration-tests/soak/ocr_test.go b/integration-tests/soak/ocr_test.go index 1f437e565eb..56e462ef463 100644 --- a/integration-tests/soak/ocr_test.go +++ b/integration-tests/soak/ocr_test.go @@ -4,21 +4,22 @@ import ( "fmt" "testing" - seth_utils "github.com/smartcontractkit/chainlink-testing-framework/utils/seth" + seth_utils "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/seth" "github.com/stretchr/testify/require" - "github.com/smartcontractkit/chainlink-testing-framework/logging" + "github.com/smartcontractkit/chainlink-testing-framework/lib/logging" "time" "github.com/chaos-mesh/chaos-mesh/api/v1alpha1" "github.com/google/uuid" - "github.com/smartcontractkit/havoc/k8schaos" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "github.com/smartcontractkit/chainlink-testing-framework/networks" - "github.com/smartcontractkit/chainlink-testing-framework/utils/ptr" + "github.com/smartcontractkit/chainlink-testing-framework/havoc" + + "github.com/smartcontractkit/chainlink-testing-framework/lib/networks" + "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/ptr" "github.com/smartcontractkit/chainlink/integration-tests/actions" tc "github.com/smartcontractkit/chainlink/integration-tests/testconfig" "github.com/smartcontractkit/chainlink/integration-tests/testsetups" @@ -100,7 +101,7 @@ func TestOCRSoak_RPCDownForAllCLNodes(t *testing.T) { require.NoError(t, err, "Error creating chaos") ocrSoakTest, err := testsetups.NewOCRSoakTest(t, &config, testsetups.WithNamespace(namespace), - testsetups.WithChaos([]*k8schaos.Chaos{chaos}), + testsetups.WithChaos([]*havoc.Chaos{chaos}), ) require.NoError(t, err, "Error creating OCR soak test") executeOCRSoakTest(t, ocrSoakTest, &config) @@ -133,7 +134,7 @@ func TestOCRSoak_RPCDownForHalfCLNodes(t *testing.T) { require.NoError(t, err, "Error creating chaos") ocrSoakTest, err := testsetups.NewOCRSoakTest(t, &config, testsetups.WithNamespace(namespace), - testsetups.WithChaos([]*k8schaos.Chaos{chaos}), + testsetups.WithChaos([]*havoc.Chaos{chaos}), ) require.NoError(t, err, "Error creating OCR soak test") executeOCRSoakTest(t, ocrSoakTest, &config) @@ -160,6 +161,11 @@ func executeOCRSoakTest(t *testing.T, test *testsetups.OCRSoakTest, config *tc.T t.Cleanup(func() { if err := actions.TeardownRemoteSuite(test.TearDownVals(t)); err != nil { l.Error().Err(err).Msg("Error tearing down environment") + } else { + err := test.Environment().Client.RemoveNamespace(test.Environment().Cfg.Namespace) + if err != nil { + l.Error().Err(err).Msg("Error removing namespace") + } } }) if test.Interrupted() { @@ -181,12 +187,12 @@ type GethNetworkDownChaosOpts struct { Duration time.Duration } -func gethNetworkDownChaos(opts GethNetworkDownChaosOpts) (*k8schaos.Chaos, error) { - k8sClient, err := k8schaos.NewChaosMeshClient() +func gethNetworkDownChaos(opts GethNetworkDownChaosOpts) (*havoc.Chaos, error) { + k8sClient, err := havoc.NewChaosMeshClient() if err != nil { return nil, err } - return k8schaos.NewChaos(k8schaos.ChaosOpts{ + return havoc.NewChaos(havoc.ChaosOpts{ Description: opts.Description, DelayCreate: opts.DelayCreate, Object: &v1alpha1.NetworkChaos{ @@ -220,7 +226,7 @@ func gethNetworkDownChaos(opts GethNetworkDownChaosOpts) (*k8schaos.Chaos, error }, }, Client: k8sClient, - Logger: &k8schaos.Logger, + Logger: &havoc.Logger, }) } diff --git a/integration-tests/test.Dockerfile b/integration-tests/test.Dockerfile index fc6eefd650c..6252cfdd426 100644 --- a/integration-tests/test.Dockerfile +++ b/integration-tests/test.Dockerfile @@ -1,10 +1,31 @@ ARG BASE_IMAGE ARG IMAGE_VERSION=latest -FROM ${BASE_IMAGE}:${IMAGE_VERSION} - -ARG SUITES=chaos migration performance reorg smoke soak benchmark +FROM ${BASE_IMAGE}:${IMAGE_VERSION} AS build-env -COPY . testdir/ WORKDIR /go/testdir +RUN mkdir -p /go/testdir/integration-tests/load +COPY go.mod go.sum ./ +COPY integration-tests/go.mod integration-tests/go.sum ./integration-tests/ +COPY integration-tests/load/go.mod integration-tests/load/go.sum ./integration-tests/load/ +RUN cd integration-tests && go mod download +RUN cd integration-tests/load && go mod download + +COPY . . + +ARG SUITES=chaos soak benchmark load ccip-load + RUN /go/testdir/integration-tests/scripts/buildTests "${SUITES}" + +FROM ${BASE_IMAGE}:${IMAGE_VERSION} + +RUN mkdir -p /go/testdir/integration-tests/scripts +# Dependency of CosmWasm/wasmd +COPY --from=build-env /go/pkg/mod/github.com/\!cosm\!wasm/wasmvm@v*/internal/api/libwasmvm.*.so /usr/lib/ +RUN chmod 755 /usr/lib/libwasmvm.*.so +COPY --from=build-env /go/testdir/integration-tests/*.test /go/testdir/integration-tests/ +COPY --from=build-env /go/testdir/integration-tests/ccip-tests/*.test /go/testdir/integration-tests/ +COPY --from=build-env /go/testdir/integration-tests/scripts /go/testdir/integration-tests/scripts/ +RUN echo "All tests" +RUN ls -l /go/testdir/integration-tests/*.test + ENTRYPOINT ["/go/testdir/integration-tests/scripts/entrypoint"] diff --git a/integration-tests/testconfig/README.md b/integration-tests/testconfig/README.md index 7ff6cedd24c..f6186580550 100644 --- a/integration-tests/testconfig/README.md +++ b/integration-tests/testconfig/README.md @@ -23,9 +23,11 @@ The order of precedence for overrides is as follows: * [Environment variable `BASE64_CONFIG_OVERRIDE`](#base64_config_override) ### default.toml + That file is envisioned to contain fundamental and universally applicable settings, such as logging configurations, private Ethereum network settings or Seth networks settings for known networks. ### Product-specific configurations + Product-specific configurations, such as those in `[product_name].toml`, house the bulk of default and variant settings, supporting default configurations like the following in `log_poller.toml`, which should be used by all Log Poller tests: ```toml @@ -47,15 +49,16 @@ max_emit_wait_time_ms = 500 ``` ### overrides.toml + This file is recommended for local use to adjust dynamic variables or modify predefined settings. At the very minimum it should contain the Chainlink image and version, as shown in the example below: ```toml [ChainlinkImage] -image = "your image name" version = "your tag" ``` ### `BASE64_CONFIG_OVERRIDE` + This environment variable is primarily intended for use in continuous integration environments, enabling the substitution of default settings with confidential or user-specific parameters. For instance: ```bash @@ -64,7 +67,6 @@ cat << EOF > config.toml selected_networks=["$SELECTED_NETWORKS"] [ChainlinkImage] -image="" version="$CHAINLINK_VERSION" postgres_version="$CHAINLINK_POSTGRES_VERSION" @@ -80,6 +82,7 @@ BASE64_CONFIG_OVERRIDE=$(cat config.toml | base64 -w 0) echo ::add-mask::$BASE64_CONFIG_OVERRIDE echo "BASE64_CONFIG_OVERRIDE=$BASE64_CONFIG_OVERRIDE" >> $GITHUB_ENV ``` + **It is highly recommended to use reusable GHA actions present in [.actions](../../../.github/.actions) to generate and apply the base64-encoded configuration.** Own implementation of `BASE64_CONFIG_OVERRIDE` generation is discouraged and should be used only if existing actions do not cover the use case. But even in that case it might be a better idea to extend existing actions. This variable is automatically relayed to Kubernetes-based tests, eliminating the need for manual intervention in test scripts. @@ -89,6 +92,18 @@ Test secrets are not stored directly within the `TestConfig` TOML for security r For detailed instructions on how to set test secrets both locally and within CI environments, please visit: [Test Secrets Guide in CTF](https://github.com/smartcontractkit/chainlink-testing-framework/blob/main/config/README.md#test-secrets) +### All test secrets + +See [All E2E Test Secrets in CTF](https://github.com/smartcontractkit/chainlink-testing-framework/blob/main/config/README.md#all-e2e-test-secrets). + +### Core repo specific test secrets + +| Secret | Env Var | Example | Description | +| ----------------------------- | ------------------------------------------------------------------- | -------------------------------------------- | ------------------------------------------------------------------------------------ | +| Data Streams Url | `E2E_TEST_DATA_STREAMS_URL` | `E2E_TEST_DATA_STREAMS_URL=url` | Required by some automation tests to connect to data streams. | +| Data Streams Username | `E2E_TEST_DATA_STREAMS_USERNAME` | `E2E_TEST_DATA_STREAMS_USERNAME=username` | Required by some automation tests to connect to data streams. | +| Data Streams Password | `E2E_TEST_DATA_STREAMS_PASSWORD` | `E2E_TEST_DATA_STREAMS_PASSWORD=password` | Required by some automation tests to connect to data streams. | + ## Named Configurations Named configurations allow for the customization of settings through unique identifiers, such as a test name or type, acting as specific overrides. Here's how you can define and use these configurations: @@ -116,6 +131,7 @@ When processing TOML files, the system initially searches for a general (unnamed Find default node config in `testconfig/default.toml` To set custom config for Chainlink Node use `NodeConfig.BaseConfigTOML` in TOML. Example: + ```toml [NodeConfig] BaseConfigTOML = """ @@ -136,10 +152,14 @@ Enabled = true DefaultTransactionQueueDepth = 0 """ ``` + Note that you cannot override individual values in BaseConfigTOML. You must provide the entire configuration. +This corresponds to [Config struct](../../core/services/chainlink/config.go) in Chainlink Node that excludes all chain-specific configuration, which is built based on selected_networks and either Chainlink Node's defaults for each network, or `ChainConfigTOMLByChainID` (if an entry with matching chain id is defined) or `CommonChainConfigTOML` (if no entry with matching chain id is defined). +If BaseConfigTOML is empty, then default base config provided by the Chainlink Node is used. If tracing is enabled unique id will be generated and shared between all Chainlink nodes in the same test. To set base config for EVM chains use `NodeConfig.CommonChainConfigTOML`. Example: + ```toml CommonChainConfigTOML = """ AutoCreateKey = true @@ -153,12 +173,13 @@ FeeCapDefault = '200 gwei' """ ``` -This is the default configuration used for all EVM chains unless ChainConfigTOMLByChainID is specified. +This is the default configuration used for all EVM chains unless `ChainConfigTOMLByChainID` is specified. Do remember that if either `ChainConfigTOMLByChainID` or `CommonChainConfigTOML` is defined, it will override any defaults that Chainlink Node might have for the given network. Part of the configuration that defines blockchain node URLs is always dynamically generated based on the EVMNetwork configuration. To set custom per-chain config use `[NodeConfig.ChainConfigTOMLByChainID]`. Example: + ```toml [NodeConfig.ChainConfigTOMLByChainID] -# applicable for arbitrum-goerli chain +# applicable only to arbitrum-goerli chain 421613 = """ [GasEstimator] PriceMax = '400 gwei' @@ -170,7 +191,98 @@ BumpMin = '100 gwei' """ ``` -For more examples see `example.toml` in product TOML configs like `testconfig/automation/example.toml`. +For more examples see `example.toml` in product TOML configs like `testconfig/automation/example.toml`. If either ChainConfigTOMLByChainID or CommonChainConfigTOML is defined, it will override any defaults that Chainlink Node might have for the given network. Part of the configuration that defines blockchain node URLs is always dynamically generated based on the EVMNetwork configuration. +Currently, all networks are treated as EVM networks. There's no way to provide Solana, Starknet, Cosmos or Aptos configuration yet. + +### OCR tests contract config +In order to allow running OCR soak/load/smoke tests with already deployed contracts, we have provided an experimental feature for providing addresses of LINK token and OCR contracts in the TOML config. Additionally, user can choose, whether existing OCR contracts should be configured or not. +If no contract addresses are provided, the tests will deploy new contracts. + +The feature is highly configurable and it possible to use existing LINK token contract, but deploy new OCR contracts or vice versa. Both OCRv1 and OCRv2 contracts are supported. + +To use existing LINK and OCRv1 contracts, provide the following configuration in the TOML file: +```toml +[OCR.Contracts] +link_token = "0x88d1239894D9582f5849E5b5a964da9e5730f1E6" +offchain_aggregators = ["0xc1ce3815d6e7f3705265c2577F1342344752A5Eb"] +``` + +For OCRv2, provide the following configuration: +```toml +[OCR2.Contracts] +link_token = "0x88d1239894D9582f5849E5b5a964da9e5730f1E6" +offchain_aggregators = ["0xc1ce3815d6e7f3705265c2577F1342344752A5Eb"] +``` + +If you want to disable them, you can set `use = false` or remove the addresses from the configuration. + +If you want to use existing OCRv1 contract, without configuring it, you can set `configure = false` in the configuration: +```toml +[OCR.Contracts] +link_token = "0x88d1239894D9582f5849E5b5a964da9e5730f1E6" +offchain_aggregators = ["0xc1ce3815d6e7f3705265c2577F1342344752A5Eb"] + +# notice that this address needs to match the one in offchain_aggregators +[OCR.Contracts.Settings."0xc1ce3815d6e7f3705265c2577F1342344752A5Eb"] +configure = false +``` + +Be aware that using multiple existing OCR contracts, but configuring only some of them is not supported. This is not a valid configuration: +```toml +[OCR.Contracts] +link_token = "0x88d1239894D9582f5849E5b5a964da9e5730f1E6" +offchain_aggregators = ["0xc1ce3815d6e7f3705265c2577F1342344752A5Eb", "0x2f4FA21fCd917C448C160caafEC874032F404c08"] + +# notice that this address needs to match the one in offchain_aggregators +[OCR.Contracts.Settings."0xc1ce3815d6e7f3705265c2577F1342344752A5Eb"] +configure = false + +# if setting for a given address is not present, we assume it should be used and configured +# so in this case "0x2f4FA21fCd917C448C160caafEC874032F404c08" will be evaluated as configure = true, +# but "0xc1ce3815d6e7f3705265c2577F1342344752A5Eb" is set to configure = false. +# this will fail configuration validation +``` + +This, more explicit version is also invalid: +```toml +[OCR.Contracts] +link_token = "0x88d1239894D9582f5849E5b5a964da9e5730f1E6" +offchain_aggregators = ["0xc1ce3815d6e7f3705265c2577F1342344752A5Eb", "0x2f4FA21fCd917C448C160caafEC874032F404c08"] + +# notice that this address needs to match the one in offchain_aggregators +[OCR.Contracts.Settings."0xc1ce3815d6e7f3705265c2577F1342344752A5Eb"] +configure = false + +[OCR.Contracts.Settings."0x2f4FA21fCd917C448C160caafEC874032F404c08"] +configure = true +``` + +Similarly, this one is also invalid: +```toml +[OCR.Contracts] +link_token = "0x88d1239894D9582f5849E5b5a964da9e5730f1E6" +offchain_aggregators = ["0xc1ce3815d6e7f3705265c2577F1342344752A5Eb", "0x2f4FA21fCd917C448C160caafEC874032F404c08"] + +# notice that this address needs to match the one in offchain_aggregators +[OCR.Contracts.Settings."0xc1ce3815d6e7f3705265c2577F1342344752A5Eb"] +use = false + +[OCR.Contracts.Settings."0x2f4FA21fCd917C448C160caafEC874032F404c08"] +use = true +``` + +There are no settings available for LINK token contract. + +Last, but not least, when deploying new OCR contracts you need to provide their number. For example: +```toml +# for OCRv1 +[OCR.Common] +number_of_contracts=2 + +# for OCRv2 +[OCR2.Common] +number_of_contracts=2 +``` ### Setting env vars for Chainlink Node @@ -208,7 +320,7 @@ For local testing, it is advisable to place these variables in the `overrides.to ## Embedded config -Because Go automatically excludes TOML files during the compilation of binaries, we must take deliberate steps to include our configuration files in the compiled binary. This can be accomplished by using a custom build tag `-o embed`. Implementing this tag will incorporate all the default configurations located in the `./testconfig` folder directly into the binary. Therefore, when executing tests from the binary, you'll only need to supply the `overrides.toml` file. This file should list only the settings you wish to modify; all other configurations will be sourced from the embedded configurations. You can access these embedded configurations [here](.integration-tests/testconfig/configs_embed.go). +Because Go automatically excludes TOML files during the compilation of binaries, we must take deliberate steps to include our configuration files in the compiled binary. This can be accomplished by using a custom build tag `-o embed`. Implementing this tag will incorporate all the default configurations located in the `./testconfig` folder directly into the binary. Therefore, when executing tests from the binary, you'll only need to supply the `overrides.toml` file. This file should list only the settings you wish to modify; all other configurations will be sourced from the embedded configurations. You can access these embedded configurations [here](./configs_embed.go). ## To bear in mind diff --git a/integration-tests/testconfig/automation/automation.toml b/integration-tests/testconfig/automation/automation.toml index a30202d0ec7..b2e87fa34f9 100644 --- a/integration-tests/testconfig/automation/automation.toml +++ b/integration-tests/testconfig/automation/automation.toml @@ -2,6 +2,9 @@ [Common] chainlink_node_funding = 2.0 +[Pyroscope] +enabled=false + [NodeConfig] BaseConfigTOML = """ [Feature] @@ -82,36 +85,135 @@ max_perform_gas=5_000_000 min_upkeep_spend=0 fallback_gas_price=200_000_000_000 fallback_link_price=2_000_000_000_000_000_000 +fallback_native_price=2_000_000_000_000_000_000 max_check_data_size=5_000 max_perform_data_size=5_000 max_revert_data_size=5_000 # reorg test specific overrides +[Reorg.Common] +chainlink_node_funding = 2.0 + + [Reorg.Automation] -[Reorg.NodeConfig] -CommonChainConfigTOML = """ +[Reorg.NodeConfig.ChainConfigTOMLByChainID] +# applicable for simulated chain +1337 = """ +AutoCreateKey = true FinalityDepth = 20 LogPollInterval = '1s' - +MinContractPayment = 0 [HeadTracker] HistoryDepth = 30 - [GasEstimator] Mode = 'FixedPrice' LimitDefault = 5_000_000 """ -[Reorg.Automation.General] -number_of_nodes=6 -duration=100 -block_time=1 -spec_type="minimum" -chainlink_node_log_level="info" -use_prometheus=false -remove_namespace = true +[Reorg.Automation.AutomationConfig] +use_log_buffer_v1=false + +[Reorg.Automation.AutomationConfig.PublicConfig] +delta_progress=10_000_000_000 +delta_resend=15_000_000_000 +delta_initial=500_000_000 +delta_round=1_000_000_000 +delta_grace=200_000_000 +delta_certified_commit_request=300_000_000 +delta_stage=30_000_000_000 +r_max=24 +f=1 +max_duration_query=20_000_000 +max_duration_observation=20_000_000 +max_duration_should_accept_attested_report=1_200_000_000 +max_duration_should_transmit_accepted_report=20_000_000 + +[Reorg.Automation.AutomationConfig.PluginConfig] +perform_lockout_window=3_600_000 +target_probability="0.999" +target_in_rounds=1 +min_confirmations=0 +gas_limit_per_report=10_300_000 +gas_overhead_per_upkeep=300_000 +max_upkeep_batch_size=10 + +[Reorg.Automation.AutomationConfig.PluginConfig.LogProviderConfig] +block_rate=1 +log_limit=2 + +[Reorg.Automation.AutomationConfig.RegistrySettings] +payment_premium_ppb=200_000_000 +flat_fee_micro_link=0 +check_gas_limit=2_500_000 +staleness_seconds=90000 +gas_ceiling_multiplier=1 +max_perform_gas=5_000_000 +min_upkeep_spend=0 +fallback_gas_price=200_000_000_000 +fallback_link_price=2_000_000_000_000_000_000 +fallback_native_price=2_000_000_000_000_000_000 +max_check_data_size=5_000 +max_perform_data_size=5_000 +max_revert_data_size=5_000 + +# chaos test specific overrides +[Chaos.Common] +chainlink_node_funding = 2.0 + +[Chaos.Automation] + +[Chaos.Automation.AutomationConfig] +use_log_buffer_v1=false + +[Chaos.Automation.AutomationConfig.PublicConfig] +delta_progress=10_000_000_000 +delta_resend=15_000_000_000 +delta_initial=500_000_000 +delta_round=1_000_000_000 +delta_grace=200_000_000 +delta_certified_commit_request=300_000_000 +delta_stage=30_000_000_000 +r_max=24 +f=1 +max_duration_query=20_000_000 +max_duration_observation=20_000_000 +max_duration_should_accept_attested_report=1_200_000_000 +max_duration_should_transmit_accepted_report=20_000_000 + +[Chaos.Automation.AutomationConfig.PluginConfig] +perform_lockout_window=3_600_000 +target_probability="0.999" +target_in_rounds=1 +min_confirmations=0 +gas_limit_per_report=10_300_000 +gas_overhead_per_upkeep=300_000 +max_upkeep_batch_size=10 + +[Chaos.Automation.AutomationConfig.PluginConfig.LogProviderConfig] +block_rate=1 +log_limit=2 + +[Chaos.Automation.AutomationConfig.RegistrySettings] +payment_premium_ppb=200_000_000 +flat_fee_micro_link=0 +check_gas_limit=2_500_000 +staleness_seconds=90000 +gas_ceiling_multiplier=1 +max_perform_gas=5_000_000 +min_upkeep_spend=0 +fallback_gas_price=200_000_000_000 +fallback_link_price=2_000_000_000_000_000_000 +fallback_native_price=2_000_000_000_000_000_000 +max_check_data_size=5_000 +max_perform_data_size=5_000 +max_revert_data_size=5_000 # load test specific overrides +[Load.Logging.Grafana] +base_url="https://grafana.ops.prod.cldev.sh" +dashboard_url="/d/a4899f53-f709-430a-aec2-24f32198dcc9/chainlink-automation-v2-load-test" + [Load.Seth] ephemeral_addresses_number = 100 root_key_funds_buffer = 1_000_000 @@ -197,9 +299,254 @@ max_perform_gas=5_000_000 min_upkeep_spend=0 fallback_gas_price=200_000_000_000 fallback_link_price=2_000_000_000_000_000_000 +fallback_native_price=2_000_000_000_000_000_000 max_check_data_size=5_000 max_perform_data_size=5_000 max_revert_data_size=5_000 [Load.Pyroscope] -enabled=false \ No newline at end of file +enabled=false + +# automation benchmark test specific overrides +[Benchmark.Logging.Grafana] +base_url="https://grafana.ops.prod.cldev.sh" +dashboard_url="/d/Q8n6m1unz/chainlink-automation-benchmark-test" + +# will retry roughly for 1h before giving up (900 * 4s) +[Benchmark.Automation.Resiliency] +# number of retries before giving up +contract_call_limit = 900 +# static interval between retries +contract_call_interval = "4s" + +[Benchmark.Seth] +# keeper benchmark running on simulated network requires 100k per node +root_key_funds_buffer = 1_000_000 + +[Benchmark.Automation] +[Benchmark.Automation.General] +number_of_nodes=6 +duration=3600 +block_time=1 +spec_type="minimum" +chainlink_node_log_level="info" +use_prometheus=false +remove_namespace = true + +[Benchmark.Automation.Benchmark] +registry_to_test = "2_1" +number_of_registries = 1 +number_of_nodes = 6 +number_of_upkeeps = 1000 +upkeep_gas_limit = 1500000 +check_gas_to_burn = 10000 +perform_gas_to_burn = 1000 +block_range = 3600 +block_interval = 60 +forces_single_tx_key = false +delete_jobs_on_end = true + +[Benchmark.NodeConfig] +BaseConfigTOML = """ +[Feature] +LogPoller = true + +[OCR2] +Enabled = true + +[P2P] +[P2P.V2] +Enabled = true +AnnounceAddresses = ["0.0.0.0:6690"] +ListenAddresses = ["0.0.0.0:6690"] +[Keeper] +TurnLookBack = 0 +[WebServer] +HTTPWriteTimeout = '1h' +""" + +CommonChainConfigTOML = """ +""" + +[Benchmark.NodeConfig.ChainConfigTOMLByChainID] +# applicable for simulated chain +1337 = """ +FinalityDepth = 50 +LogPollInterval = '1s' +MinIncomingConfirmations = 1 + +[HeadTracker] +HistoryDepth = 100 + +[GasEstimator] +Mode = 'FixedPrice' +LimitDefault = 5_000_000 +""" + +[Benchmark.Automation.AutomationConfig] +use_log_buffer_v1=false + +[Benchmark.Automation.AutomationConfig.PublicConfig] +delta_progress=10_000_000_000 +delta_resend=15_000_000_000 +delta_initial=500_000_000 +delta_round=1_000_000_000 +delta_grace=200_000_000 +delta_certified_commit_request=300_000_000 +delta_stage=30_000_000_000 +r_max=24 +f=1 +max_duration_query=20_000_000 +max_duration_observation=20_000_000 +max_duration_should_accept_attested_report=1_200_000_000 +max_duration_should_transmit_accepted_report=20_000_000 + +[Benchmark.Automation.AutomationConfig.PluginConfig] +perform_lockout_window=3_600_000 +target_probability="0.999" +target_in_rounds=1 +min_confirmations=0 +gas_limit_per_report=10_300_000 +gas_overhead_per_upkeep=300_000 +max_upkeep_batch_size=10 + +[Benchmark.Automation.AutomationConfig.PluginConfig.LogProviderConfig] +block_rate=1 +log_limit=2 + +[Benchmark.Automation.AutomationConfig.RegistrySettings] +payment_premium_ppb=0 +flat_fee_micro_link=40000 +check_gas_limit=45_000_000 +staleness_seconds=90_000 +gas_ceiling_multiplier=2 +max_perform_gas=5_000_000 +min_upkeep_spend=0 +fallback_gas_price=200_000_000_000 +fallback_link_price=2_000_000_000_000_000_000 +fallback_native_price=2_000_000_000_000_000_000 +max_check_data_size=5_000 +max_perform_data_size=5_000 +max_revert_data_size=5_000 + +# automation soak test specific overrides +[Soak.Logging.Grafana] +base_url="https://grafana.ops.prod.cldev.sh" +dashboard_url="/d/Q8n6m1unz/chainlink-automation-benchmark-test" + +# will retry roughly for 1h before giving up (900 * 4s) +[Soak.Automation.Resiliency] +# number of retries before giving up +contract_call_limit = 900 +# static interval between retries +contract_call_interval = "4s" + +[Soak.Seth] +# keeper benchmark running on simulated network requires 100k per node +root_key_funds_buffer = 1_000_000 + +[Soak.Automation] +[Soak.Automation.General] +number_of_nodes=6 +duration=3600 +block_time=1 +spec_type="minimum" +chainlink_node_log_level="info" +use_prometheus=false +remove_namespace = true + +[Soak.Automation.Benchmark] +registry_to_test = "2_1" +number_of_registries = 1 +number_of_nodes = 6 +number_of_upkeeps = 50 +upkeep_gas_limit = 1500000 +check_gas_to_burn = 10000 +perform_gas_to_burn = 1000 +block_range = 28800 +block_interval = 300 +forces_single_tx_key = false +delete_jobs_on_end = true + +[Soak.NodeConfig] +BaseConfigTOML = """ +[Feature] +LogPoller = true + +[OCR2] +Enabled = true + +[P2P] +[P2P.V2] +Enabled = true +AnnounceAddresses = ["0.0.0.0:6690"] +ListenAddresses = ["0.0.0.0:6690"] +[Keeper] +TurnLookBack = 0 +[WebServer] +HTTPWriteTimeout = '1h' +""" + +CommonChainConfigTOML = """ +""" + +[Soak.NodeConfig.ChainConfigTOMLByChainID] +# applicable for simulated chain +1337 = """ +FinalityDepth = 50 +LogPollInterval = '1s' +MinIncomingConfirmations = 1 + +[HeadTracker] +HistoryDepth = 100 + +[GasEstimator] +Mode = 'FixedPrice' +LimitDefault = 5_000_000 +""" + +[Soak.Automation.AutomationConfig] +use_log_buffer_v1=false + +[Soak.Automation.AutomationConfig.PublicConfig] +delta_progress=10_000_000_000 +delta_resend=15_000_000_000 +delta_initial=500_000_000 +delta_round=1_000_000_000 +delta_grace=200_000_000 +delta_certified_commit_request=300_000_000 +delta_stage=30_000_000_000 +r_max=24 +f=1 +max_duration_query=20_000_000 +max_duration_observation=20_000_000 +max_duration_should_accept_attested_report=1_200_000_000 +max_duration_should_transmit_accepted_report=20_000_000 + +[Soak.Automation.AutomationConfig.PluginConfig] +perform_lockout_window=3_600_000 +target_probability="0.999" +target_in_rounds=1 +min_confirmations=0 +gas_limit_per_report=10_300_000 +gas_overhead_per_upkeep=300_000 +max_upkeep_batch_size=10 + +[Soak.Automation.AutomationConfig.PluginConfig.LogProviderConfig] +block_rate=1 +log_limit=2 + +[Soak.Automation.AutomationConfig.RegistrySettings] +payment_premium_ppb=200_000_000 +flat_fee_micro_link=0 +check_gas_limit=2_500_000 +staleness_seconds=90000 +gas_ceiling_multiplier=1 +max_perform_gas=5_000_000 +min_upkeep_spend=0 +fallback_gas_price=200_000_000_000 +fallback_link_price=2_000_000_000_000_000_000 +fallback_native_price=2_000_000_000_000_000_000 +max_check_data_size=5_000 +max_perform_data_size=5_000 +max_revert_data_size=5_000 diff --git a/integration-tests/testconfig/automation/config.go b/integration-tests/testconfig/automation/config.go index bde989f544b..e462ff15c17 100644 --- a/integration-tests/testconfig/automation/config.go +++ b/integration-tests/testconfig/automation/config.go @@ -2,8 +2,13 @@ package automation import ( "errors" + "fmt" "math/big" "time" + + "github.com/ethereum/go-ethereum/common" + + "github.com/smartcontractkit/chainlink-testing-framework/lib/blockchain" ) type Config struct { @@ -11,6 +16,9 @@ type Config struct { Load []Load `toml:"Load"` DataStreams *DataStreams `toml:"DataStreams"` AutomationConfig *AutomationConfig `toml:"AutomationConfig"` + Resiliency *ResiliencyConfig `toml:"Resiliency"` + Benchmark *Benchmark `toml:"Benchmark"` + Contracts *Contracts `toml:"Contracts"` } func (c *Config) Validate() error { @@ -37,6 +45,57 @@ func (c *Config) Validate() error { return err } } + if c.Resiliency != nil { + if err := c.Resiliency.Validate(); err != nil { + return err + } + } + if c.Benchmark != nil { + if err := c.Benchmark.Validate(); err != nil { + return err + } + } + return nil +} + +type Benchmark struct { + RegistryToTest *string `toml:"registry_to_test"` + NumberOfRegistries *int `toml:"number_of_registries"` + NumberOfUpkeeps *int `toml:"number_of_upkeeps"` + UpkeepGasLimit *int64 `toml:"upkeep_gas_limit"` + CheckGasToBurn *int64 `toml:"check_gas_to_burn"` + PerformGasToBurn *int64 `toml:"perform_gas_to_burn"` + BlockRange *int64 `toml:"block_range"` + BlockInterval *int64 `toml:"block_interval"` + ForceSingleTxKey *bool `toml:"forces_single_tx_key"` + DeleteJobsOnEnd *bool `toml:"delete_jobs_on_end"` +} + +func (c *Benchmark) Validate() error { + if c.RegistryToTest == nil || *c.RegistryToTest == "" { + return errors.New("registry_to_test must be set") + } + if c.NumberOfRegistries == nil || *c.NumberOfRegistries <= 0 { + return errors.New("number_of_registries must be a positive integer") + } + if c.NumberOfUpkeeps == nil || *c.NumberOfUpkeeps <= 0 { + return errors.New("number_of_upkeeps must be a positive integer") + } + if c.UpkeepGasLimit == nil || *c.UpkeepGasLimit <= 0 { + return errors.New("upkeep_gas_limit must be a positive integer") + } + if c.CheckGasToBurn == nil || *c.CheckGasToBurn <= 0 { + return errors.New("check_gas_to_burn must be a positive integer") + } + if c.PerformGasToBurn == nil || *c.PerformGasToBurn <= 0 { + return errors.New("perform_gas_to_burn must be a positive integer") + } + if c.BlockRange == nil || *c.BlockRange <= 0 { + return errors.New("block_range must be a positive integer") + } + if c.BlockInterval == nil || *c.BlockInterval <= 0 { + return errors.New("block_interval must be a positive integer") + } return nil } @@ -129,9 +188,9 @@ func (c *Load) Validate() error { type DataStreams struct { Enabled *bool `toml:"enabled"` - URL *string `toml:"url"` - Username *string `toml:"username"` - Password *string `toml:"password"` + URL *string `toml:"-"` + Username *string `toml:"-"` + Password *string `toml:"-"` DefaultFeedID *string `toml:"default_feed_id"` } @@ -160,7 +219,6 @@ type AutomationConfig struct { PluginConfig *PluginConfig `toml:"PluginConfig"` PublicConfig *PublicConfig `toml:"PublicConfig"` RegistrySettings *RegistrySettings `toml:"RegistrySettings"` - UseLogBufferV1 *bool `toml:"use_log_buffer_v1"` } func (c *AutomationConfig) Validate() error { @@ -170,13 +228,7 @@ func (c *AutomationConfig) Validate() error { if err := c.PublicConfig.Validate(); err != nil { return err } - if err := c.RegistrySettings.Validate(); err != nil { - return err - } - if c.UseLogBufferV1 == nil { - return errors.New("use_log_buffer_v1 must be set") - } - return nil + return c.RegistrySettings.Validate() } type PluginConfig struct { @@ -305,6 +357,7 @@ type RegistrySettings struct { MinUpkeepSpend *big.Int `toml:"min_upkeep_spend"` FallbackGasPrice *big.Int `toml:"fallback_gas_price"` FallbackLinkPrice *big.Int `toml:"fallback_link_price"` + FallbackNativePrice *big.Int `toml:"fallback_native_price"` MaxCheckDataSize *uint32 `toml:"max_check_data_size"` MaxPerformDataSize *uint32 `toml:"max_perform_data_size"` MaxRevertDataSize *uint32 `toml:"max_revert_data_size"` @@ -338,6 +391,9 @@ func (c *RegistrySettings) Validate() error { if c.FallbackLinkPrice == nil || c.FallbackLinkPrice.Cmp(big.NewInt(0)) < 0 { return errors.New("fallback_link_price must be set to a non-negative integer") } + if c.FallbackNativePrice == nil || c.FallbackNativePrice.Cmp(big.NewInt(0)) < 0 { + return errors.New("fallback_native_price must be set to a non-negative integer") + } if c.MaxCheckDataSize == nil || *c.MaxCheckDataSize < 1 { return errors.New("max_check_data_size must be set to a positive integer") } @@ -349,3 +405,445 @@ func (c *RegistrySettings) Validate() error { } return nil } + +type ResiliencyConfig struct { + ContractCallLimit *uint `toml:"contract_call_limit"` + ContractCallInterval *blockchain.StrDuration `toml:"contract_call_interval"` +} + +func (c *ResiliencyConfig) Validate() error { + if c.ContractCallLimit == nil { + return errors.New("contract_call_limit must be set") + } + if c.ContractCallInterval == nil { + return errors.New("contract_call_interval must be set") + } + + return nil +} + +type Contracts struct { + ShouldBeUsed *bool `toml:"use"` + LinkTokenAddress *string `toml:"link_token"` + WethAddress *string `toml:"weth"` + TranscoderAddress *string `toml:"transcoder"` + ChainModuleAddress *string `toml:"chain_module"` + RegistryAddress *string `toml:"registry"` + RegistrarAddress *string `toml:"registrar"` + LinkEthFeedAddress *string `toml:"link_eth_feed"` + EthGasFeedAddress *string `toml:"eth_gas_feed"` + EthUSDFeedAddress *string `toml:"eth_usd_feed"` + LinkUSDFeedAddress *string `toml:"link_usd_feed"` + UpkeepContractAddresses []string `toml:"upkeep_contracts"` + MultiCallAddress *string `toml:"multicall"` + Settings map[string]ContractSetting `toml:"Settings"` +} + +func (o *Contracts) Validate() error { + if o.LinkTokenAddress != nil && !common.IsHexAddress(*o.LinkTokenAddress) { + return errors.New("link_token must be a valid ethereum address") + } + if o.WethAddress != nil && !common.IsHexAddress(*o.WethAddress) { + return errors.New("weth must be a valid ethereum address") + } + if o.TranscoderAddress != nil && !common.IsHexAddress(*o.TranscoderAddress) { + return errors.New("transcoder must be a valid ethereum address") + } + if o.ChainModuleAddress != nil && !common.IsHexAddress(*o.ChainModuleAddress) { + return errors.New("chain_module must be a valid ethereum address") + } + if o.RegistryAddress != nil && !common.IsHexAddress(*o.RegistryAddress) { + return errors.New("registry must be a valid ethereum address") + } + if o.RegistrarAddress != nil && !common.IsHexAddress(*o.RegistrarAddress) { + return errors.New("registrar must be a valid ethereum address") + } + if o.LinkEthFeedAddress != nil && !common.IsHexAddress(*o.LinkEthFeedAddress) { + return errors.New("link_eth_feed must be a valid ethereum address") + } + if o.EthGasFeedAddress != nil && !common.IsHexAddress(*o.EthGasFeedAddress) { + return errors.New("eth_gas_feed must be a valid ethereum address") + } + if o.EthUSDFeedAddress != nil && !common.IsHexAddress(*o.EthUSDFeedAddress) { + return errors.New("eth_usd_feed must be a valid ethereum address") + } + if o.LinkUSDFeedAddress != nil && !common.IsHexAddress(*o.LinkUSDFeedAddress) { + return errors.New("link_usd_feed must be a valid ethereum address") + } + if o.MultiCallAddress != nil && !common.IsHexAddress(*o.MultiCallAddress) { + return errors.New("multicall must be a valid ethereum address") + } + if o.UpkeepContractAddresses != nil { + allEnabled := make(map[bool]int) + allConfigure := make(map[bool]int) + for _, address := range o.UpkeepContractAddresses { + if !common.IsHexAddress(address) { + return fmt.Errorf("upkeep_contracts must be valid ethereum addresses, but %s is not", address) + } + + if v, ok := o.Settings[address]; ok { + if v.ShouldBeUsed != nil { + allEnabled[*v.ShouldBeUsed]++ + } else { + allEnabled[true]++ + } + if v.Configure != nil { + allConfigure[*v.Configure]++ + } else { + allConfigure[true]++ + } + } + } + + if allEnabled[true] > 0 && allEnabled[false] > 0 { + return errors.New("either all or none offchain_aggregators must be used") + } + + if allConfigure[true] > 0 && allConfigure[false] > 0 { + return errors.New("either all or none offchain_aggregators must be configured") + } + } + + return nil +} + +func (c *Config) UseExistingContracts() bool { + if c.Contracts == nil { + return false + } + + if c.Contracts.ShouldBeUsed != nil { + return *c.Contracts.ShouldBeUsed + } + + return false +} + +func (c *Config) LinkTokenContractAddress() (common.Address, error) { + if c.Contracts != nil && c.Contracts.LinkTokenAddress != nil { + return common.HexToAddress(*c.Contracts.LinkTokenAddress), nil + } + + return common.Address{}, errors.New("link token address must be set") +} + +func (c *Config) WethContractAddress() (common.Address, error) { + if c.Contracts != nil && c.Contracts.WethAddress != nil { + return common.HexToAddress(*c.Contracts.WethAddress), nil + } + + return common.Address{}, errors.New("weth address must be set") +} + +func (c *Config) TranscoderContractAddress() (common.Address, error) { + if c.Contracts != nil && c.Contracts.TranscoderAddress != nil { + return common.HexToAddress(*c.Contracts.TranscoderAddress), nil + } + + return common.Address{}, errors.New("transcoder address must be set") +} + +func (c *Config) ChainModuleContractAddress() (common.Address, error) { + if c.Contracts != nil && c.Contracts.ChainModuleAddress != nil { + return common.HexToAddress(*c.Contracts.ChainModuleAddress), nil + } + + return common.Address{}, errors.New("chain module address must be set") +} + +func (c *Config) RegistryContractAddress() (common.Address, error) { + if c.Contracts != nil && c.Contracts.RegistryAddress != nil { + return common.HexToAddress(*c.Contracts.RegistryAddress), nil + } + + return common.Address{}, errors.New("registry address must be set") +} + +func (c *Config) RegistrarContractAddress() (common.Address, error) { + if c.Contracts != nil && c.Contracts.RegistrarAddress != nil { + return common.HexToAddress(*c.Contracts.RegistrarAddress), nil + } + + return common.Address{}, errors.New("registrar address must be set") +} + +func (c *Config) LinkEthFeedContractAddress() (common.Address, error) { + if c.Contracts != nil && c.Contracts.LinkEthFeedAddress != nil { + return common.HexToAddress(*c.Contracts.LinkEthFeedAddress), nil + } + + return common.Address{}, errors.New("link eth feed address must be set") +} + +func (c *Config) EthGasFeedContractAddress() (common.Address, error) { + if c.Contracts != nil && c.Contracts.EthGasFeedAddress != nil { + return common.HexToAddress(*c.Contracts.EthGasFeedAddress), nil + } + + return common.Address{}, errors.New("eth gas feed address must be set") +} + +func (c *Config) EthUSDFeedContractAddress() (common.Address, error) { + if c.Contracts != nil && c.Contracts.EthUSDFeedAddress != nil { + return common.HexToAddress(*c.Contracts.EthUSDFeedAddress), nil + } + + return common.Address{}, errors.New("eth usd feed address must be set") +} + +func (c *Config) LinkUSDFeedContractAddress() (common.Address, error) { + if c.Contracts != nil && c.Contracts.LinkUSDFeedAddress != nil { + return common.HexToAddress(*c.Contracts.LinkUSDFeedAddress), nil + } + + return common.Address{}, errors.New("link usd feed address must be set") +} + +func (c *Config) UpkeepContractAddresses() ([]common.Address, error) { + if c.Contracts != nil && c.Contracts.UpkeepContractAddresses != nil { + addresses := make([]common.Address, len(c.Contracts.UpkeepContractAddresses)) + for i, address := range c.Contracts.UpkeepContractAddresses { + addresses[i] = common.HexToAddress(address) + } + return addresses, nil + } + + return nil, errors.New("upkeep contract addresses must be set") +} + +func (c *Config) MultiCallContractAddress() (common.Address, error) { + if c.Contracts != nil && c.Contracts.MultiCallAddress != nil { + return common.HexToAddress(*c.Contracts.MultiCallAddress), nil + } + + return common.Address{}, errors.New("multicall address must be set") +} + +func (c *Config) UseExistingLinkTokenContract() bool { + if !c.UseExistingContracts() { + return false + } + + if c.Contracts.LinkTokenAddress == nil { + return false + } + + if len(c.Contracts.Settings) == 0 { + return true + } + + if v, ok := c.Contracts.Settings[*c.Contracts.LinkTokenAddress]; ok { + return v.ShouldBeUsed != nil && *v.ShouldBeUsed + } + + return true +} + +func (c *Config) UseExistingWethContract() bool { + if !c.UseExistingContracts() { + return false + } + + if c.Contracts.WethAddress == nil { + return false + } + + if len(c.Contracts.Settings) == 0 { + return true + } + + if v, ok := c.Contracts.Settings[*c.Contracts.WethAddress]; ok { + return v.ShouldBeUsed != nil && *v.ShouldBeUsed + } + + return true +} + +func (c *Config) UseExistingTranscoderContract() bool { + if !c.UseExistingContracts() { + return false + } + + if c.Contracts.TranscoderAddress == nil { + return false + } + + if len(c.Contracts.Settings) == 0 { + return true + } + + if v, ok := c.Contracts.Settings[*c.Contracts.TranscoderAddress]; ok { + return v.ShouldBeUsed != nil && *v.ShouldBeUsed + } + + return true +} + +func (c *Config) UseExistingRegistryContract() bool { + if !c.UseExistingContracts() { + return false + } + + if c.Contracts.RegistryAddress == nil { + return false + } + + if len(c.Contracts.Settings) == 0 { + return true + } + + if v, ok := c.Contracts.Settings[*c.Contracts.RegistryAddress]; ok { + return v.ShouldBeUsed != nil && *v.ShouldBeUsed + } + + return true +} + +func (c *Config) UseExistingRegistrarContract() bool { + if !c.UseExistingContracts() { + return false + } + + if c.Contracts.RegistrarAddress == nil { + return false + } + + if len(c.Contracts.Settings) == 0 { + return true + } + + if v, ok := c.Contracts.Settings[*c.Contracts.RegistrarAddress]; ok { + return v.ShouldBeUsed != nil && *v.ShouldBeUsed + } + + return true +} + +func (c *Config) UseExistingLinkEthFeedContract() bool { + if !c.UseExistingContracts() { + return false + } + + if c.Contracts.LinkEthFeedAddress == nil { + return false + } + + if len(c.Contracts.Settings) == 0 { + return true + } + + if v, ok := c.Contracts.Settings[*c.Contracts.LinkEthFeedAddress]; ok { + return v.ShouldBeUsed != nil && *v.ShouldBeUsed + } + + return true +} + +func (c *Config) UseExistingEthGasFeedContract() bool { + if !c.UseExistingContracts() { + return false + } + + if c.Contracts.EthGasFeedAddress == nil { + return false + } + + if len(c.Contracts.Settings) == 0 { + return true + } + + if v, ok := c.Contracts.Settings[*c.Contracts.EthGasFeedAddress]; ok { + return v.ShouldBeUsed != nil && *v.ShouldBeUsed + } + + return true +} + +func (c *Config) UseExistingEthUSDFeedContract() bool { + if !c.UseExistingContracts() { + return false + } + + if c.Contracts.EthUSDFeedAddress == nil { + return false + } + + if len(c.Contracts.Settings) == 0 { + return true + } + + if v, ok := c.Contracts.Settings[*c.Contracts.EthUSDFeedAddress]; ok { + return v.ShouldBeUsed != nil && *v.ShouldBeUsed + } + + return true +} + +func (c *Config) UseExistingLinkUSDFeedContract() bool { + if !c.UseExistingContracts() { + return false + } + + if c.Contracts.LinkUSDFeedAddress == nil { + return false + } + + if len(c.Contracts.Settings) == 0 { + return true + } + + if v, ok := c.Contracts.Settings[*c.Contracts.LinkUSDFeedAddress]; ok { + return v.ShouldBeUsed != nil && *v.ShouldBeUsed + } + + return true +} + +func (c *Config) UseExistingUpkeepContracts() bool { + if !c.UseExistingContracts() { + return false + } + + if c.Contracts.UpkeepContractAddresses == nil { + return false + } + + if len(c.Contracts.Settings) == 0 { + return true + } + + for _, address := range c.Contracts.UpkeepContractAddresses { + if v, ok := c.Contracts.Settings[address]; ok { + if v.ShouldBeUsed != nil && *v.ShouldBeUsed { + return true + } + } + } + + return false +} + +func (c *Config) UseExistingMultiCallContract() bool { + if !c.UseExistingContracts() { + return false + } + + if c.Contracts.MultiCallAddress == nil { + return false + } + + if len(c.Contracts.Settings) == 0 { + return true + } + + if v, ok := c.Contracts.Settings[*c.Contracts.MultiCallAddress]; ok { + return v.ShouldBeUsed != nil && *v.ShouldBeUsed + } + + return true +} + +type ContractSetting struct { + ShouldBeUsed *bool `toml:"use"` + Configure *bool `toml:"configure"` +} diff --git a/integration-tests/testconfig/automation/example.toml b/integration-tests/testconfig/automation/example.toml index 3b48e89a548..3bbe78d693d 100644 --- a/integration-tests/testconfig/automation/example.toml +++ b/integration-tests/testconfig/automation/example.toml @@ -1,7 +1,6 @@ # Example of full config with all fields # General part [ChainlinkImage] -image="public.ecr.aws/chainlink/chainlink" version="2.7.0" [Logging] @@ -16,38 +15,10 @@ log_producer_timeout="10s" # number of retries before log producer gives up and stops listening to logs log_producer_retry_limit=10 -[Logging.Loki] -tenant_id="tenant_id" -# full URL of Loki ingest endpoint -endpoint="https://loki.url/api/v3/push" -# currently only needed when using public instance -basic_auth_secret="loki-basic-auth" -# only needed for cloud grafana -bearer_token_secret="bearer_token" - -# LogStream will try to shorten Grafana URLs by default (if all 3 variables are set) -[Logging.Grafana] -# grafana url (trailing "/" will be stripped) -base_url="http://grafana.url" -# url of your grafana dashboard (prefix and suffix "/" are stirpped), example: /d/ad61652-2712-1722/my-dashboard -dashboard_url="/d/your-dashboard" -# Grafana dashboard uid to annotate. Find it in Dashboard Settings -> JSON Model -dashboard_uid="dashboard-uid-to-annotate" -bearer_token_secret="my-awesome-token" - # if you want to use polygon_mumbial [Network] selected_networks=["polygon_mumbai"] -[Network.RpcHttpUrls] -polygon_mumbai = ["https://my-rpc-endpoint.io"] - -[Network.RpcWsUrls] -polygon_mumbai = ["https://my-rpc-endpoint.io"] - -[Network.WalletKeys] -polygon_mumbai = ["change-me-to-your-PK"] - [PrivateEthereumNetwork] # pos or pow consensus_type="pos" @@ -163,5 +134,4 @@ use_prometheus=false # upgrade test specific override [TestAutomationNodeUpgrade.ChainlinkUpgradeImage] -image="public.ecr.aws/chainlink/chainlink" version="2.8.0" \ No newline at end of file diff --git a/integration-tests/testconfig/automation/overrides/benchmark/1000Upkeeps-1h-2_1.toml b/integration-tests/testconfig/automation/overrides/benchmark/1000Upkeeps-1h-2_1.toml new file mode 100644 index 00000000000..0b704524e9d --- /dev/null +++ b/integration-tests/testconfig/automation/overrides/benchmark/1000Upkeeps-1h-2_1.toml @@ -0,0 +1,15 @@ +[ChainlinkImage] +version="latest" + +[Benchmark.Automation.Benchmark] +registry_to_test = "2_1" +number_of_registries = 1 +number_of_nodes = 6 +number_of_upkeeps = 1000 +upkeep_gas_limit = 1500000 +check_gas_to_burn = 10000 +perform_gas_to_burn = 1000 +block_range = 3600 +block_interval = 60 +forces_single_tx_key = false +delete_jobs_on_end = true \ No newline at end of file diff --git a/integration-tests/testconfig/automation/overrides/benchmark/1000Upkeeps-1h-2_3.toml b/integration-tests/testconfig/automation/overrides/benchmark/1000Upkeeps-1h-2_3.toml new file mode 100644 index 00000000000..f00bb5ed47b --- /dev/null +++ b/integration-tests/testconfig/automation/overrides/benchmark/1000Upkeeps-1h-2_3.toml @@ -0,0 +1,15 @@ +[ChainlinkImage] +version="latest" + +[Benchmark.Automation.Benchmark] +registry_to_test = "2_3" +number_of_registries = 1 +number_of_nodes = 6 +number_of_upkeeps = 1000 +upkeep_gas_limit = 1500000 +check_gas_to_burn = 10000 +perform_gas_to_burn = 1000 +block_range = 3600 +block_interval = 60 +forces_single_tx_key = false +delete_jobs_on_end = true \ No newline at end of file diff --git a/integration-tests/testconfig/automation/overrides/load/500Upkeeps-1x-1h.toml b/integration-tests/testconfig/automation/overrides/load/500Upkeeps-1x-1h.toml new file mode 100644 index 00000000000..6d58253f526 --- /dev/null +++ b/integration-tests/testconfig/automation/overrides/load/500Upkeeps-1x-1h.toml @@ -0,0 +1,47 @@ +[ChainlinkImage] +version="latest" + +[Load.Seth] +root_key_funds_buffer = 1_000_000 +ephemeral_addresses_number = 300 + +[Load.Seth.nonce_manager] +key_sync_timeout = "100s" + +[Load.Common] +chainlink_node_funding = 1000 + +[Load.Automation.AutomationConfig] +use_log_buffer_v1=false + +[Load.Automation.AutomationConfig.PluginConfig.LogProviderConfig] +block_rate=1 +log_limit=2 + +[Load.Automation] +[Load.Automation.General] +number_of_nodes=6 +duration=3600 +block_time=1 +spec_type="recommended" +chainlink_node_log_level="debug" +use_prometheus=true +remove_namespace = true + +[Load.Automation.DataStreams] +enabled=false + +[[Load.Automation.Load]] +number_of_upkeeps=500 +number_of_events = 1 +number_of_spam_matching_events = 0 +number_of_spam_non_matching_events = 0 +check_burn_amount = 0 +perform_burn_amount = 0 +upkeep_gas_limit = 1000000 +shared_trigger = false +is_streams_lookup = false +feeds = [] + +[Pyroscope] +enabled=false \ No newline at end of file diff --git a/integration-tests/testconfig/automation/overrides/load/50Upkeeps-1x-12h.toml b/integration-tests/testconfig/automation/overrides/load/50Upkeeps-1x-12h.toml new file mode 100644 index 00000000000..8991a6eb903 --- /dev/null +++ b/integration-tests/testconfig/automation/overrides/load/50Upkeeps-1x-12h.toml @@ -0,0 +1,43 @@ +[ChainlinkImage] +version="latest" + +[Load.Seth] +root_key_funds_buffer = 1_000_000 + +[Load.Common] +chainlink_node_funding = 10000 + +[Load.Automation.AutomationConfig] +use_log_buffer_v1=false + +[Load.Automation.AutomationConfig.PluginConfig.LogProviderConfig] +block_rate=1 +log_limit=2 + +[Load.Automation] +[Load.Automation.General] +number_of_nodes=6 +duration=43200 +block_time=1 +spec_type="recommended" +chainlink_node_log_level="debug" +use_prometheus=true +remove_namespace = true + +[Load.Automation.DataStreams] +enabled=false + +[[Load.Automation.Load]] +number_of_upkeeps=50 +number_of_events = 1 +number_of_spam_matching_events = 0 +number_of_spam_non_matching_events = 0 +check_burn_amount = 0 +perform_burn_amount = 0 +upkeep_gas_limit = 1000000 +shared_trigger = false +is_streams_lookup = false +feeds = [] + +[Pyroscope] +enabled=false \ No newline at end of file diff --git a/integration-tests/testconfig/automation/overrides/load/50Upkeeps-1x-1h.toml b/integration-tests/testconfig/automation/overrides/load/50Upkeeps-1x-1h.toml new file mode 100644 index 00000000000..a133fce6dcf --- /dev/null +++ b/integration-tests/testconfig/automation/overrides/load/50Upkeeps-1x-1h.toml @@ -0,0 +1,43 @@ +[ChainlinkImage] +version="latest" + +[Load.Seth] +root_key_funds_buffer = 1_000_000 + +[Load.Common] +chainlink_node_funding = 1000 + +[Load.Automation.AutomationConfig] +use_log_buffer_v1=false + +[Load.Automation.AutomationConfig.PluginConfig.LogProviderConfig] +block_rate=1 +log_limit=2 + +[Load.Automation] +[Load.Automation.General] +number_of_nodes=6 +duration=3600 +block_time=1 +spec_type="recommended" +chainlink_node_log_level="debug" +use_prometheus=true +remove_namespace = true + +[Load.Automation.DataStreams] +enabled=false + +[[Load.Automation.Load]] +number_of_upkeeps=50 +number_of_events = 1 +number_of_spam_matching_events = 0 +number_of_spam_non_matching_events = 0 +check_burn_amount = 0 +perform_burn_amount = 0 +upkeep_gas_limit = 1000000 +shared_trigger = false +is_streams_lookup = false +feeds = [] + +[Pyroscope] +enabled=false \ No newline at end of file diff --git a/integration-tests/testconfig/automation/overrides/soak/50Upkeeps-8h-2_1.toml b/integration-tests/testconfig/automation/overrides/soak/50Upkeeps-8h-2_1.toml new file mode 100644 index 00000000000..fda5cb6ea29 --- /dev/null +++ b/integration-tests/testconfig/automation/overrides/soak/50Upkeeps-8h-2_1.toml @@ -0,0 +1,15 @@ +[ChainlinkImage] +version="latest" + +[Soak.Automation.Benchmark] +registry_to_test = "2_1" +number_of_registries = 1 +number_of_nodes = 6 +number_of_upkeeps = 50 +upkeep_gas_limit = 1500000 +check_gas_to_burn = 10000 +perform_gas_to_burn = 1000 +block_range = 28800 +block_interval = 300 +forces_single_tx_key = false +delete_jobs_on_end = true \ No newline at end of file diff --git a/integration-tests/testconfig/automation/overrides/soak/50Upkeeps-8h-2_3.toml b/integration-tests/testconfig/automation/overrides/soak/50Upkeeps-8h-2_3.toml new file mode 100644 index 00000000000..46ba1ad3e85 --- /dev/null +++ b/integration-tests/testconfig/automation/overrides/soak/50Upkeeps-8h-2_3.toml @@ -0,0 +1,15 @@ +[ChainlinkImage] +version="latest" + +[Soak.Automation.Benchmark] +registry_to_test = "2_3" +number_of_registries = 1 +number_of_nodes = 6 +number_of_upkeeps = 50 +upkeep_gas_limit = 1500000 +check_gas_to_burn = 10000 +perform_gas_to_burn = 1000 +block_range = 28800 +block_interval = 300 +forces_single_tx_key = false +delete_jobs_on_end = true \ No newline at end of file diff --git a/integration-tests/testconfig/ccip/ccip.toml b/integration-tests/testconfig/ccip/ccip.toml new file mode 100644 index 00000000000..5ccda6ab4e3 --- /dev/null +++ b/integration-tests/testconfig/ccip/ccip.toml @@ -0,0 +1,156 @@ +[Common] +# chainlink node funding in native token +chainlink_node_funding = 1 + +[Network] +selected_networks = ['SIMULATED_1', 'SIMULATED_2'] + +[Network.EVMNetworks.SIMULATED_1] +evm_name = 'chain-1337' +evm_chain_id = 1337 +evm_keys = [ + "ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80", + "59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d", +] +evm_simulated = true +client_implementation = 'Ethereum' +evm_chainlink_transaction_limit = 50000 +evm_transaction_timeout = '2m' +evm_minimum_confirmations = 1 +evm_gas_estimation_buffer = 1000 +evm_supports_eip1559 = true +evm_default_gas_limit = 6000000 +evm_finality_depth = 1 + +[Network.EVMNetworks.SIMULATED_2] +evm_name = 'chain-2337' +evm_chain_id = 2337 +evm_keys = [ + "59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d", + "ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80", +] +evm_simulated = true +client_implementation = 'Ethereum' +evm_chainlink_transaction_limit = 50000 +evm_transaction_timeout = '2m' +evm_minimum_confirmations = 1 +evm_gas_estimation_buffer = 1000 +evm_supports_eip1559 = true +evm_default_gas_limit = 6000000 +evm_finality_depth = 1 + +[NodeConfig] +BaseConfigTOML = """ +[Feature] +FeedsManager = true +LogPoller = true +UICSAKeys = true + +[Log] +Level = 'debug' +JSONConsole = true + +[Log.File] +MaxSize = '0b' + +[WebServer] +AllowOrigins = '*' +HTTPPort = 6688 +SecureCookies = false +HTTPWriteTimeout = '3m' +SessionTimeout = '999h0m0s' + +[WebServer.RateLimit] +Authenticated = 2000 +Unauthenticated = 1000 + +[WebServer.TLS] +HTTPSPort = 0 + +[Database] +MaxIdleConns = 20 +MaxOpenConns = 40 +MigrateOnStartup = true + +[OCR2] +Enabled = true +ContractPollInterval = '5s' + +[OCR] +Enabled = false +DefaultTransactionQueueDepth = 200 + +[P2P] +[P2P.V2] +Enabled = true +ListenAddresses = ['0.0.0.0:6690'] +AnnounceAddresses = ['0.0.0.0:6690'] +DeltaDial = '500ms' +DeltaReconcile = '5s' +""" + +CommonChainConfigTOML = """ +LogPollInterval = '500ms' +[Transactions] +ForwardersEnabled = false +[GasEstimator] +LimitDefault = 5000000 +""" + +[CCIP] +HomeChainSelector = '12922642891491394802' # for chain-2337 +FeedChainSelector = '3379446385462418246' # for chain-1337 + +[CCIP.CLNode] +NoOfPluginNodes = 4 +NoOfBootstraps = 1 + +[CCIP.PrivateEthereumNetworks.SIMULATED_1] +# either eth1 or eth2 (for post-Merge); for eth2 Prysm is used for consensus layer. +ethereum_version = "eth1" +# geth, besu, erigon or nethermind +execution_layer = "geth" +# eth2-only, if set to true environment startup will wait until at least 1 epoch has been finalised +wait_for_finalization=false + +[CCIP.PrivateEthereumNetworks.SIMULATED_1.EthereumChainConfig] +# eth2-only, the lower the value the faster the block production (3 is minimum) +seconds_per_slot = 3 +# eth2-only, the lower the value the faster the epoch finalisation (2 is minimum) +slots_per_epoch = 2 +# eht2-only, the lower tha value the faster the chain starts (10 is minimum) +genesis_delay = 15 +# eth2-only, number of validators +validator_count = 4 +chain_id = 1337 +# address that should be founded in genesis wih ETH +addresses_to_fund = [ + "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", + "0x70997970C51812dc3A010C7d01b50e0d17dc79C8", +] + + +#[CCIP.Env.PrivateEthereumNetworks.SIMULATED_1.CustomDockerImages] +# custom docker image that will be used for execution layer client. It has to be one of: hyperledger/besu, nethermind/nethermind, thorax/erigon or ethereum/client-go. +# instead of using a specific tag you can also use "latest_available" to use latest published tag in Github or "latest_stable" to use latest stable release from Github +# (if corresponding Docker image on Docker Hub has not been published environment creation will fail). +#execution_layer="hyperledger/besu:latest_stable" + +[CCIP.PrivateEthereumNetworks.SIMULATED_2] +ethereum_version = "eth1" +execution_layer = "geth" + +[CCIP.PrivateEthereumNetworks.SIMULATED_2.EthereumChainConfig] +seconds_per_slot = 3 +slots_per_epoch = 2 +genesis_delay = 15 +validator_count = 4 +chain_id = 2337 +addresses_to_fund = [ + "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", + "0x70997970C51812dc3A010C7d01b50e0d17dc79C8", +] + +[Seth] +# Seth specific configuration, no need for generating ephemeral addresses for ccip-tests. +ephemeral_addresses_number = 0 \ No newline at end of file diff --git a/integration-tests/testconfig/ccip/config.go b/integration-tests/testconfig/ccip/config.go new file mode 100644 index 00000000000..1b11d246a30 --- /dev/null +++ b/integration-tests/testconfig/ccip/config.go @@ -0,0 +1,148 @@ +package ccip + +import ( + "fmt" + "strconv" + + "github.com/AlekSi/pointer" + chainselectors "github.com/smartcontractkit/chain-selectors" + + "github.com/smartcontractkit/chainlink-testing-framework/lib/blockchain" + + ctfconfig "github.com/smartcontractkit/chainlink-testing-framework/lib/config" + + "github.com/smartcontractkit/chainlink/integration-tests/client" +) + +const ( + E2E_JD_IMAGE = "E2E_JD_IMAGE" + E2E_JD_VERSION = "E2E_JD_VERSION" + E2E_JD_GRPC = "E2E_JD_GRPC" + E2E_JD_WSRPC = "E2E_JD_WSRPC" + DEFAULT_DB_NAME = "JD_DB" + DEFAULT_DB_VERSION = "14.1" +) + +var ( + ErrInvalidHomeChainSelector = fmt.Errorf("invalid home chain selector") + ErrInvalidFeedChainSelector = fmt.Errorf("invalid feed chain selector") +) + +type Config struct { + PrivateEthereumNetworks map[string]*ctfconfig.EthereumNetworkConfig `toml:",omitempty"` + CLNode *NodeConfig `toml:",omitempty"` + JobDistributorConfig JDConfig `toml:",omitempty"` + HomeChainSelector *string `toml:",omitempty"` + FeedChainSelector *string `toml:",omitempty"` +} + +type NodeConfig struct { + NoOfPluginNodes *int `toml:",omitempty"` + NoOfBootstraps *int `toml:",omitempty"` + ClientConfig *client.ChainlinkConfig `toml:",omitempty"` +} + +type JDConfig struct { + Image *string `toml:",omitempty"` + Version *string `toml:",omitempty"` + DBName *string `toml:",omitempty"` + DBVersion *string `toml:",omitempty"` + JDGRPC *string `toml:",omitempty"` + JDWSRPC *string `toml:",omitempty"` +} + +func (o *Config) Validate() error { + return nil +} + +// TODO: include all JD specific input in generic secret handling +func (o *Config) GetJDGRPC() string { + grpc := pointer.GetString(o.JobDistributorConfig.JDGRPC) + if grpc == "" { + return ctfconfig.MustReadEnvVar_String(E2E_JD_GRPC) + } + return grpc +} + +func (o *Config) GetJDWSRPC() string { + wsrpc := pointer.GetString(o.JobDistributorConfig.JDWSRPC) + if wsrpc == "" { + return ctfconfig.MustReadEnvVar_String(E2E_JD_WSRPC) + } + return wsrpc +} + +func (o *Config) GetJDImage() string { + image := pointer.GetString(o.JobDistributorConfig.Image) + if image == "" { + return ctfconfig.MustReadEnvVar_String(E2E_JD_IMAGE) + } + return image +} + +func (o *Config) GetJDVersion() string { + version := pointer.GetString(o.JobDistributorConfig.Version) + if version == "" { + return ctfconfig.MustReadEnvVar_String(E2E_JD_VERSION) + } + return version +} + +func (o *Config) GetJDDBName() string { + dbname := pointer.GetString(o.JobDistributorConfig.DBName) + if dbname == "" { + return DEFAULT_DB_NAME + } + return dbname +} + +func (o *Config) GetJDDBVersion() string { + dbversion := pointer.GetString(o.JobDistributorConfig.DBVersion) + if dbversion == "" { + return DEFAULT_DB_VERSION + } + return dbversion +} + +func (o *Config) GetHomeChainSelector(evmNetworks []blockchain.EVMNetwork) (uint64, error) { + homeChainSelector, err := strconv.ParseUint(pointer.GetString(o.HomeChainSelector), 10, 64) + if err != nil { + return 0, err + } + isValid, err := IsSelectorValid(homeChainSelector, evmNetworks) + if err != nil { + return 0, err + } + if !isValid { + return 0, ErrInvalidHomeChainSelector + } + return homeChainSelector, nil +} + +func (o *Config) GetFeedChainSelector(evmNetworks []blockchain.EVMNetwork) (uint64, error) { + feedChainSelector, err := strconv.ParseUint(pointer.GetString(o.FeedChainSelector), 10, 64) + if err != nil { + return 0, err + } + isValid, err := IsSelectorValid(feedChainSelector, evmNetworks) + if err != nil { + return 0, err + } + if !isValid { + return 0, ErrInvalidFeedChainSelector + } + return feedChainSelector, nil +} + +func IsSelectorValid(selector uint64, evmNetworks []blockchain.EVMNetwork) (bool, error) { + chainId, err := chainselectors.ChainIdFromSelector(selector) + if err != nil { + return false, err + } + for _, net := range evmNetworks { + if net.ChainID == int64(chainId) { + return true, nil + } + } + return false, nil +} diff --git a/integration-tests/testconfig/ccip/overrides/sepolia_avax_binance.toml b/integration-tests/testconfig/ccip/overrides/sepolia_avax_binance.toml new file mode 100644 index 00000000000..06af64d5d91 --- /dev/null +++ b/integration-tests/testconfig/ccip/overrides/sepolia_avax_binance.toml @@ -0,0 +1,55 @@ +[Common] +# chainlink node funding in native token +chainlink_node_funding = 2 + +[Logging] +test_log_collect = true + +[Logging.LogStream] +# supported targets: file, loki, in-memory. if empty no logs will be persisted +log_targets = ["loki"] + +[Network] +selected_networks = ['SEPOLIA', 'AVALANCHE_FUJI', 'BSC_TESTNET'] + +[Network.EVMNetworks.SEPOLIA] +evm_name = 'Sepolia Testnet' +evm_chain_id = 11155111 +evm_simulated = false +client_implementation = 'Ethereum' +evm_chainlink_transaction_limit = 5000 +evm_transaction_timeout = '5m' +evm_minimum_confirmations = 1 +evm_gas_estimation_buffer = 1000 +evm_supports_eip1559 = true +evm_default_gas_limit = 6000000 +evm_finality_tag = true + +[Network.EVMNetworks.AVALANCHE_FUJI] +evm_name = 'Avalanche Fuji' +evm_chain_id = 43113 +evm_simulated = false +client_implementation = 'Ethereum' +evm_chainlink_transaction_limit = 5000 +evm_transaction_timeout = '2m' +evm_minimum_confirmations = 1 +evm_gas_estimation_buffer = 1000 +evm_supports_eip1559 = true +evm_default_gas_limit = 6000000 +evm_finality_tag = true + +[Network.EVMNetworks.BSC_TESTNET] +evm_name = 'BSC Testnet' +evm_chain_id = 97 +evm_simulated = false +client_implementation = 'BSC' +evm_chainlink_transaction_limit = 5000 +evm_transaction_timeout = '2m' +evm_minimum_confirmations = 3 +evm_gas_estimation_buffer = 0 +evm_supports_eip1559 = true +evm_default_gas_limit = 6000000 +evm_finality_tag = true + +[CCIP] +HomeChainSelector = '16015286601757825753' # for sepolia \ No newline at end of file diff --git a/integration-tests/testconfig/common/vrf/common.go b/integration-tests/testconfig/common/vrf/common.go index e213191075f..49cb7c4f257 100644 --- a/integration-tests/testconfig/common/vrf/common.go +++ b/integration-tests/testconfig/common/vrf/common.go @@ -4,7 +4,7 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/pkg/errors" - "github.com/smartcontractkit/chainlink-testing-framework/blockchain" + "github.com/smartcontractkit/chainlink-testing-framework/lib/blockchain" ) type Config struct { @@ -71,10 +71,13 @@ func (c *PerformanceConfig) Validate() error { type ExistingEnvConfig struct { CoordinatorAddress *string `toml:"coordinator_address"` + UseExistingWrapper *bool `toml:"use_existing_wrapper"` + WrapperAddress *string `toml:"wrapper_address"` ConsumerAddress *string `toml:"consumer_address"` - LinkAddress *string `toml:"link_address"` + WrapperConsumerAddress *string `toml:"wrapper_consumer_address"` KeyHash *string `toml:"key_hash"` CreateFundSubsAndAddConsumers *bool `toml:"create_fund_subs_and_add_consumers"` + CreateFundAddWrapperConsumers *bool `toml:"create_fund_add_wrapper_consumers"` NodeSendingKeys []string `toml:"node_sending_keys"` Funding } @@ -83,23 +86,33 @@ func (c *ExistingEnvConfig) Validate() error { if c.CreateFundSubsAndAddConsumers == nil { return errors.New("create_fund_subs_and_add_consumers must be set ") } + if c.CreateFundAddWrapperConsumers == nil { + return errors.New("create_fund_add_wrapper_consumers must be set ") + } if c.CoordinatorAddress == nil { return errors.New("coordinator_address must be set when using existing environment") } if !common.IsHexAddress(*c.CoordinatorAddress) { return errors.New("coordinator_address must be a valid hex address") } + if c.UseExistingWrapper == nil { + return errors.New("use_existing_wrapper must be set ") + } + if *c.UseExistingWrapper { + if c.WrapperAddress == nil { + return errors.New("wrapper_address must be set when using `use_existing_wrapper=true`") + } + if !common.IsHexAddress(*c.WrapperAddress) { + return errors.New("wrapper_address must be a valid hex address") + } + } if c.KeyHash == nil { return errors.New("key_hash must be set when using existing environment") } if *c.KeyHash == "" { return errors.New("key_hash must be a non-empty string") } - if *c.CreateFundSubsAndAddConsumers { - if err := c.Funding.Validate(); err != nil { - return err - } - } else { + if !*c.CreateFundSubsAndAddConsumers { if c.ConsumerAddress == nil || *c.ConsumerAddress == "" { return errors.New("consumer_address must be set when using existing environment") } @@ -107,7 +120,14 @@ func (c *ExistingEnvConfig) Validate() error { return errors.New("consumer_address must be a valid hex address") } } - + if !*c.CreateFundAddWrapperConsumers { + if c.WrapperConsumerAddress == nil || *c.WrapperConsumerAddress == "" { + return errors.New("wrapper_consumer_address must be set when using existing environment") + } + if !common.IsHexAddress(*c.WrapperConsumerAddress) { + return errors.New("wrapper_consumer_address must be a valid hex address") + } + } if c.NodeSendingKeys != nil { for _, key := range c.NodeSendingKeys { if !common.IsHexAddress(key) { @@ -115,7 +135,6 @@ func (c *ExistingEnvConfig) Validate() error { } } } - return nil } @@ -127,7 +146,6 @@ func (c *Funding) Validate() error { if c.NodeSendingKeyFundingMin != nil && *c.NodeSendingKeyFundingMin <= 0 { return errors.New("when set node_sending_key_funding_min must be a positive value") } - return nil } diff --git a/integration-tests/testconfig/configs_embed.go b/integration-tests/testconfig/configs_embed.go index 31303357a43..5de81acb7d9 100644 --- a/integration-tests/testconfig/configs_embed.go +++ b/integration-tests/testconfig/configs_embed.go @@ -18,6 +18,8 @@ import "embed" //go:embed vrf/vrf.toml //go:embed vrfv2/vrfv2.toml //go:embed vrfv2plus/vrfv2plus.toml +//go:embed ccip/ccip.toml + var embeddedConfigsFs embed.FS func init() { diff --git a/integration-tests/testconfig/default.toml b/integration-tests/testconfig/default.toml index d317d05bc49..496a11b64b1 100644 --- a/integration-tests/testconfig/default.toml +++ b/integration-tests/testconfig/default.toml @@ -1,37 +1,76 @@ [Logging] +# set to true to flush logs to selected target regardless of test result; otherwise logs are only flushed if test failed test_log_collect = false +[Logging.Grafana] +base_url="https://grafana.ops.prod.cldev.sh" +base_url_github_ci="http://localhost:8080/primary" +dashboard_url="/d/ddf75041-1e39-42af-aa46-361fe4c36e9e/ci-e2e-tests-logs" + [Logging.LogStream] +# supported targets: file, loki, in-memory. if empty no logs will be persisted log_targets = ["file"] +# context timeout for starting log producer and also time-frame for requesting logs log_producer_timeout = "10s" +# number of retries before log producer gives up and stops listening to logs log_producer_retry_limit = 10 [ChainlinkImage] +# postgres version to use postgres_version = "15.6" -image = "public.ecr.aws/chainlink/chainlink" +# chainlink image tag to use version = "2.12.0" +# Set chainlink image using E2E_TEST_CHAINLINK_IMAGE env, as it is a test secret [Common] +# chainlink node funding in native token chainlink_node_funding = 0.5 [Network] +# slice of networks to use; at lesat one network must be selected; each selected network must either be already defined in the CTF as a known network, or be defined in +# TOML test files as a new network selected_networks = ["simulated"] [PrivateEthereumNetwork] +# ethereum version to use; eth1 or eth2 (post-merge) ethereum_version = "eth1" +# execution layer to use; geth, besu, nethermind, erigon or reth execution_layer = "geth" [PrivateEthereumNetwork.EthereumChainConfig] +# duration of single slot, lower => faster block production, must be >= 3 seconds_per_slot = 3 +# number of slots in epoch, lower => faster epoch finalisation, must be >= 2 slots_per_epoch = 2 +# extra genesis delay, no need to modify, but it should be after all validators/beacon chain starts genesis_delay = 15 +# number of validators in the network validator_count = 4 +# chain id to use chain_id = 1337 +# slice of addresses that will be funded with native token in genesis addresses_to_fund = ["0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266"] +# map of hard fork epochs for each network; key is fork name, value is hard fork epoch +# keep in mind that this depends on the specific version of eth2 client you are using +# this configuration is fault-tolerant and incorrect forks will be ignored [PrivateEthereumNetwork.EthereumChainConfig.HardForkEpochs] Deneb = 500 +# General config of the Chainklink node corresponding to core/services/chainlink/config.go (Config struct) that excludes +# all chain-specific configuration, which is built based on selected_networks and either Chainlink Node's defaults for +# each network, or ChainConfigTOMLByChainID (if an entry with matching chain id is defined) or CommonChainConfigTOML (if no +# entry with matching chain id is defined). +# +# Please remember that if either ChainConfigTOMLByChainID or CommonChainConfigTOML is defined, it will override any defaults +# that Chainlink Node might have for the given network. Part of the configuration that defines blockchain node URLs is always +# dynamically generated based on the EVMNetwork configuration. +# +# Last, but not least, currently all selected networks are treated as EVM networks. There's no way to provide Solana, Starknet, +# Cosmos or Aptos configuration yet. +# +# If BaseConfigTOML is empty, then default base config provided by the Chainlink Node is used. +# Also, if tracing is enabled unique id will be generated and shared between all Chainlink nodes in the same test. [NodeConfig] BaseConfigTOML = """ [Feature] @@ -78,12 +117,14 @@ DeltaDial = '500ms' DeltaReconcile = '5s' """ -# override config toml related to EVMNode configs for chainlink nodes; applicable to all EVM node configs in chainlink toml +# Overrides default config TOML related to EVMNode configs for chainlink nodes; applicable to all EVM node configs in chainlink TOML. +# Do not use it, if you want the default values to be used. Passing blockchain nodes URLs here will have no effect. CommonChainConfigTOML = """ """ [NodeConfig.ChainConfigTOMLByChainID] -# applicable for simulated chain +# Chain-specific EVMNode config TOML for chainlink nodes; applicable to all EVM node configs in chainlink TOML. It takes precedence +# over CommonChainConfigTOML and Chainlink Node's defaults. Passing blockchain nodes URLs here will have no effect. 1337 = """ AutoCreateKey = true FinalityDepth = 1 @@ -97,13 +138,13 @@ FeeCapDefault = '200 gwei' [Seth] # controls which transactions are decoded/traced. Possbile values are: none, all, reverted (default). # if transaction level doesn't match, then calling Decode() does nothing. It's advised to keep it set -# to 'reverted' to limit noise. If you combine it with 'trace_to_json' it will save all possible data -# in JSON files for reverted transactions. +# to 'reverted' to limit noise. tracing_level = "reverted" -# saves each decoding/tracing results to JSON files; what exactly is saved depends on what we +# saves each decoding/tracing results to DOT files; what exactly is saved depends on what we # were able te decode, we try to save maximum information possible. It can either be: # just tx hash, decoded transaction or call trace. Which transactions traces are saved depends # on 'tracing_level'. +trace_outputs = ["dot", "console"] # number of addresses to be generated and runtime, if set to 0, no addresses will be generated # each generated address will receive a proportion of native tokens from root private key's balance @@ -218,66 +259,14 @@ gas_tip_cap = 1_800_000_000 [[Seth.networks]] name = "Sepolia Testnet" transaction_timeout = "3m" -eip_1559_dynamic_fees = false - -# automated gas estimation for live networks -# if set to true we will dynamically estimate gas for every transaction (based on suggested values, priority and congestion rate for last X blocks) -# gas_price_estimation_enabled = true -# number of blocks to use for congestion rate estimation (it will determine buffer added on top of suggested values) -# gas_price_estimation_blocks = 100 -# transaction priority, which determines adjustment factor multiplier applied to suggested values (fast - 1.2x, standard - 1x, slow - 0.8x) -# gas_price_estimation_tx_priority = "standard" - -# URLs -# if set they will overwrite URLs from EVMNetwork that Seth uses, can be either WS(S) or HTTP(S) -# urls_secret = ["ws://your-ws-url:8546"] - -# gas_limits -# gas limit should be explicitly set only if you are connecting to a node that's incapable of estimating gas limit itself (should only happen for very old versions) -# gas_limit = 14_000_000 -# transfer_gas_fee is gas limit that will be used, when funding CL nodes and returning funds from there and when funding and returning funds from ephemeral keys -# we use hardcoded value in order to be estimate how much funds are available for sending or returning after tx costs have been paid -transfer_gas_fee = 21_000 - -# manual settings, used when gas_price_estimation_enabled is false or when it fails -# legacy transactions -gas_price = 50_000_000_000 - -# EIP-1559 transactions -gas_fee_cap = 45_000_000_000 -gas_tip_cap = 10_000_000_000 - -[[Seth.networks]] -name = "Polygon Mumbai" -transaction_timeout = "3m" eip_1559_dynamic_fees = true - -# automated gas estimation for live networks -# if set to true we will dynamically estimate gas for every transaction (based on suggested values, priority and congestion rate for last X blocks) -# gas_price_estimation_enabled = true -# number of blocks to use for congestion rate estimation (it will determine buffer added on top of suggested values) -# gas_price_estimation_blocks = 100 -# transaction priority, which determines adjustment factor multiplier applied to suggested values (fast - 1.2x, standard - 1x, slow - 0.8x) -# gas_price_estimation_tx_priority = "standard" - -# URLs -# if set they will overwrite URLs from EVMNetwork that Seth uses, can be either WS(S) or HTTP(S) -# urls_secret = ["ws://your-ws-url:8546"] - -# gas_limits -# gas limit should be explicitly set only if you are connecting to a node that's incapable of estimating gas limit itself (should only happen for very old versions) -# gas_limit = 6_000_000 -# transfer_gas_fee is gas limit that will be used, when funding CL nodes and returning funds from there and when funding and returning funds from ephemeral keys -# we use hardcoded value in order to be estimate how much funds are available for sending or returning after tx costs have been paid transfer_gas_fee = 21_000 - -# manual settings, used when gas_price_estimation_enabled is false or when it fails -# legacy transactions -gas_price = 1_800_000_000 - -# EIP-1559 transactions -gas_fee_cap = 3_800_000_000 -gas_tip_cap = 1_800_000_000 +gas_price = 105_000_000_000 +gas_fee_cap = 150_312_843_059 +gas_tip_cap = 40_416_094 +gas_price_estimation_enabled = true +gas_price_estimation_blocks = 1000 +gas_price_estimation_tx_priority = "standard" [[Seth.networks]] name = "Polygon Amoy" @@ -286,11 +275,11 @@ eip_1559_dynamic_fees = true # automated gas estimation for live networks # if set to true we will dynamically estimate gas for every transaction (based on suggested values, priority and congestion rate for last X blocks) -# gas_price_estimation_enabled = true +gas_price_estimation_enabled = true # number of blocks to use for congestion rate estimation (it will determine buffer added on top of suggested values) -# gas_price_estimation_blocks = 100 +gas_price_estimation_blocks = 100 # transaction priority, which determines adjustment factor multiplier applied to suggested values (fast - 1.2x, standard - 1x, slow - 0.8x) -# gas_price_estimation_tx_priority = "standard" +gas_price_estimation_tx_priority = "standard" # URLs # if set they will overwrite URLs from EVMNetwork that Seth uses, can be either WS(S) or HTTP(S) @@ -309,39 +298,7 @@ gas_price = 200_000_000_000 # EIP-1559 transactions gas_fee_cap = 200_000_000_000 -gas_tip_cap = 2_000_000_000 - -[[Seth.networks]] -name = "Polygon zkEVM Goerli" -transaction_timeout = "3m" -eip_1559_dynamic_fees = false - -# automated gas estimation for live networks -# if set to true we will dynamically estimate gas for every transaction (based on suggested values, priority and congestion rate for last X blocks) -# gas_price_estimation_enabled = true -# number of blocks to use for congestion rate estimation (it will determine buffer added on top of suggested values) -# gas_price_estimation_blocks = 100 -# transaction priority, which determines adjustment factor multiplier applied to suggested values (fast - 1.2x, standard - 1x, slow - 0.8x) -# gas_price_estimation_tx_priority = "standard" - -# URLs -# if set they will overwrite URLs from EVMNetwork that Seth uses, can be either WS(S) or HTTP(S) -# urls_secret = ["ws://your-ws-url:8546"] - -# gas_limits -# gas limit should be explicitly set only if you are connecting to a node that's incapable of estimating gas limit itself (should only happen for very old versions) -# gas_limit = 9_000_000 -# transfer_gas_fee is gas limit that will be used, when funding CL nodes and returning funds from there and when funding and returning funds from ephemeral keys -# we use hardcoded value in order to be estimate how much funds are available for sending or returning after tx costs have been paid -transfer_gas_fee = 21_000 - -# manual settings, used when gas_price_estimation_enabled is false or when it fails -# legacy transactions -gas_price = 50_000_000 - -# EIP-1559 transactions -gas_fee_cap = 3_800_000_000 -gas_tip_cap = 1_800_000_000 +gas_tip_cap = 25_000_000_000 [[Seth.networks]] name = "Optimism Sepolia" @@ -413,3 +370,300 @@ gas_price_estimation_enabled = true gas_price_estimation_blocks = 100 # priority of the transaction, can be "fast", "standard" or "slow" (the higher the priority, the higher adjustment factor will be used for gas estimation) [default: "standard"] gas_price_estimation_tx_priority = "standard" + + +[[Seth.networks]] +name = "Nexon Mainnet" +transaction_timeout = "3m" +eip_1559_dynamic_fees = true +transfer_gas_fee = 21_000 + +# manual settings, used when gas_price_estimation_enabled is false or when it fails +# legacy transactions +gas_price = 30_000_000_000 + +# EIP-1559 transactions +gas_fee_cap = 30_000_000_000 +gas_tip_cap = 1_800_000_000 + + +[Network.EVMNetworks.NEXON_MAINNET] +evm_name = "NEXON_MAINNET" +#evm_urls = ["rpc ws endpoint"] +#evm_http_urls = ["rpc http endpoint"] +client_implementation = "Ethereum" +#evm_keys = ["private keys you want to use"] +evm_simulated = false +evm_chainlink_transaction_limit = 5000 +evm_minimum_confirmations = 1 +evm_gas_estimation_buffer = 10000 +evm_supports_eip1559 = true +evm_default_gas_limit = 6000000 +evm_chain_id = 60118 + +[[Seth.networks]] +name = "Nexon Stage" +transaction_timeout = "3m" +eip_1559_dynamic_fees = true +transfer_gas_fee = 21_000 + +# manual settings, used when gas_price_estimation_enabled is false or when it fails +# legacy transactions +gas_price = 30_000_000_000 + +# EIP-1559 transactions +gas_fee_cap = 30_000_000_000 +gas_tip_cap = 1_800_000_000 + + +[Network.EVMNetworks.NEXON_STAGE] +evm_name = "NEXON_STAGE" +#evm_urls = ["rpc ws endpoint"] +#evm_http_urls = ["rpc http endpoint"] +client_implementation = "Ethereum" +#evm_keys = ["private keys you want to use"] +evm_simulated = false +evm_chainlink_transaction_limit = 5000 +evm_minimum_confirmations = 1 +evm_gas_estimation_buffer = 10000 +evm_supports_eip1559 = true +evm_default_gas_limit = 6000000 +evm_chain_id = 847799 + + +#### + +[[Seth.networks]] +name = "Nexon QA" +transaction_timeout = "3m" +eip_1559_dynamic_fees = true +transfer_gas_fee = 21_000 + +# manual settings, used when gas_price_estimation_enabled is false or when it fails +# legacy transactions +gas_price = 30_000_000_000 + +# EIP-1559 transactions +gas_fee_cap = 30_000_000_000 +gas_tip_cap = 1_800_000_000 + + +[Network.EVMNetworks.NEXON_QA] +evm_name = "NEXON_QA" +#evm_urls = ["rpc ws endpoint"] +#evm_http_urls = ["rpc http endpoint"] +client_implementation = "Ethereum" +#evm_keys = ["private keys you want to use"] +evm_simulated = false +evm_chainlink_transaction_limit = 5000 +evm_minimum_confirmations = 1 +evm_gas_estimation_buffer = 10000 +evm_supports_eip1559 = true +evm_default_gas_limit = 6000000 +evm_chain_id = 807424 + +##### + +[[Seth.networks]] +name = "Nexon Test" +transaction_timeout = "3m" +eip_1559_dynamic_fees = true +transfer_gas_fee = 21_000 + +# manual settings, used when gas_price_estimation_enabled is false or when it fails +# legacy transactions +gas_price = 30_000_000_000 + +# EIP-1559 transactions +gas_fee_cap = 30_000_000_000 +gas_tip_cap = 1_800_000_000 + + +[Network.EVMNetworks.NEXON_TEST] +evm_name = "NEXON_TEST" +#evm_urls = ["rpc ws endpoint"] +#evm_http_urls = ["rpc http endpoint"] +client_implementation = "Ethereum" +#evm_keys = ["private keys you want to use"] +evm_simulated = false +evm_chainlink_transaction_limit = 5000 +evm_minimum_confirmations = 1 +evm_gas_estimation_buffer = 10000 +evm_supports_eip1559 = true +evm_default_gas_limit = 6000000 +evm_chain_id = 595581 + +##### +[[Seth.networks]] +name = "Nexon Dev" +transaction_timeout = "3m" +eip_1559_dynamic_fees = true +transfer_gas_fee = 21_000 + +# manual settings, used when gas_price_estimation_enabled is false or when it fails +# legacy transactions +gas_price = 30_000_000_000 + +# EIP-1559 transactions +gas_fee_cap = 30_000_000_000 +gas_tip_cap = 1_800_000_000 + + +[Network.EVMNetworks.NEXON_DEV] +evm_name = "NEXON_DEV" +#evm_urls = ["rpc ws endpoint"] +#evm_http_urls = ["rpc http endpoint"] +client_implementation = "Ethereum" +#evm_keys = ["private keys you want to use"] +evm_simulated = false +evm_chainlink_transaction_limit = 5000 +evm_minimum_confirmations = 1 +evm_gas_estimation_buffer = 10000 +evm_supports_eip1559 = true +evm_default_gas_limit = 6000000 +evm_chain_id = 5668 + +[[Seth.networks]] +name = "LINEA_SEPOLIA" +chain_id = "59141" +transaction_timeout = "10m" +transfer_gas_fee = 21_000 +gas_price = 200_000_000_000_000 +eip_1559_dynamic_fees = false +gas_fee_cap = 109_694_825_437 +gas_tip_cap = 30_000_000_000 +gas_price_estimation_enabled = true +gas_price_estimation_blocks = 1000 +gas_price_estimation_tx_priority = "standard" + +[[Seth.networks]] +name = "LINEA_MAINNET" +chain_id = "59144" +transaction_timeout = "10m" +transfer_gas_fee = 21_000 +gas_price = 200_000_000_000_000 +eip_1559_dynamic_fees = false +gas_fee_cap = 109_694_825_437 +gas_tip_cap = 30_000_000_000 +gas_price_estimation_enabled = true +gas_price_estimation_blocks = 1000 +gas_price_estimation_tx_priority = "standard" + +[[Seth.networks]] +name = "ZKSYNC_SEPOLIA" +chain_id = "300" +transaction_timeout = "3m" +transfer_gas_fee = 21_000 +gas_price = 200_000_000_000 +eip_1559_dynamic_fees = true +gas_fee_cap = 109_694_825_437 +gas_tip_cap = 30_000_000_000 +gas_price_estimation_enabled = true +gas_price_estimation_blocks = 1000 +gas_price_estimation_tx_priority = "standard" + +[[Seth.networks]] +name = "ZKSYNC_MAINNET" +chain_id = "324" +transaction_timeout = "3m" +transfer_gas_fee = 21_000 +gas_price = 200_000_000_000 +eip_1559_dynamic_fees = true +gas_fee_cap = 109_694_825_437 +gas_tip_cap = 30_000_000_000 +gas_price_estimation_enabled = true +gas_price_estimation_blocks = 1000 +gas_price_estimation_tx_priority = "standard" + +[[Seth.networks]] +name = "POLYGON_ZKEVM_CARDONA" +transaction_timeout = "3m" +transfer_gas_fee = 21_000 +gas_price = 743_000_000 +eip_1559_dynamic_fees = false +gas_fee_cap = 1_725_800_000 +gas_tip_cap = 822_800_000 +gas_price_estimation_enabled = true +gas_price_estimation_blocks = 1000 +gas_price_estimation_tx_priority = "standard" + +[[Seth.networks]] +name = "HEDERA_TESTNET" +transaction_timeout = "3m" +transfer_gas_fee = 800_000 +gas_limit = 2_000_000 +gas_price = 2_500_000_000_000 +eip_1559_dynamic_fees = false +gas_fee_cap = 109_694_825_437 +gas_tip_cap = 30_000_000_000 +gas_price_estimation_enabled = true +gas_price_estimation_blocks = 1000 +gas_price_estimation_tx_priority = "standard" + +[[Seth.networks]] +name = "TREASURE_RUBY" +transaction_timeout = "10m" +transfer_gas_fee = 21_000 +gas_price = 100_000_000 +eip_1559_dynamic_fees = true +gas_fee_cap = 200_000_000 +gas_tip_cap = 100_000_000 +gas_price_estimation_enabled = true +gas_price_estimation_blocks = 1000 +gas_price_estimation_tx_priority = "standard" + +[[Seth.networks]] +name = "XLAYER_MAINNET" +transaction_timeout = "10m" +transfer_gas_fee = 21_000 +gas_price = 13_400_000_000 +eip_1559_dynamic_fees = false +gas_fee_cap = 109_694_825_437 +gas_tip_cap = 30_000_000_000 +gas_price_estimation_enabled = true +gas_price_estimation_blocks = 500 +gas_price_estimation_tx_priority = "standard" + +[[Seth.networks]] +name = "XLAYER_SEPOLIA" +transaction_timeout = "10m" +transfer_gas_fee = 21_000 +gas_price = 200_000_000_000 +eip_1559_dynamic_fees = false +gas_fee_cap = 109_694_825_437 +gas_tip_cap = 30_000_000_000 +gas_price_estimation_enabled = true +gas_price_estimation_blocks = 500 +gas_price_estimation_tx_priority = "standard" + +[[Seth.networks]] +name = "POLYGON_MAINNET" +transaction_timeout = "3m" +transfer_gas_fee = 21_000 +gas_price = 31_000_000_000 +eip_1559_dynamic_fees = true +gas_fee_cap = 61_000_000_000 +gas_tip_cap = 30_000_000_000 +gas_price_estimation_enabled = true +gas_price_estimation_blocks = 1000 + +[[Seth.networks]] +name = "ARBITRUM_MAINNET" +transaction_timeout = "10m" +transfer_gas_fee = 21_000 +gas_price = 10_000_000 +eip_1559_dynamic_fees = true +gas_fee_cap = 10_000_000 +gas_tip_cap = 0 +gas_price_estimation_enabled = true +gas_price_estimation_blocks = 1000 + +#### + +[Network.EVMNetworks.SONEIUM_SEPOLIA] +evm_name = "SONEIUM_SEPOLIA" +evm_chain_id = 1946 +client_implementation = "Optimism" +evm_simulated = false + +#### diff --git a/integration-tests/testconfig/forwarder_ocr/example.toml b/integration-tests/testconfig/forwarder_ocr/example.toml index 0b762299af1..517a341f803 100644 --- a/integration-tests/testconfig/forwarder_ocr/example.toml +++ b/integration-tests/testconfig/forwarder_ocr/example.toml @@ -1,7 +1,6 @@ # Example of full config with all fields # General part [ChainlinkImage] -image="public.ecr.aws/chainlink/chainlink" version="2.7.0" [Logging] @@ -31,7 +30,7 @@ bearer_token_secret="bearer_token" base_url="http://grafana.url" # url of your grafana dashboard (prefix and suffix "/" are stirpped), example: /d/ad61652-2712-1722/my-dashboard dashboard_url="/d/your-dashboard" -# Grafana dashboard uid to annotate. Find it in Dashboard Settings -> JSON Model +# Grafana dashboard uid to annotate. Find it in Dashboard Settings -> JSON Model dashboard_uid="dashboard-uid-to-annotate" bearer_token_secret="my-awesome-token" @@ -39,15 +38,6 @@ bearer_token_secret="my-awesome-token" [Network] selected_networks=["polygon_mumbai"] -[Network.RpcHttpUrls] -polygon_mumbai = ["https://my-rpc-endpoint.io"] - -[Network.RpcWsUrls] -polygon_mumbai = ["https://my-rpc-endpoint.io"] - -[Network.WalletKeys] -polygon_mumbai = ["change-me-to-your-PK"] - [PrivateEthereumNetwork] # pos or pow consensus_type="pos" @@ -143,6 +133,9 @@ BumpPercent = 20 BumpMin = '100 gwei' """ +[OCR.Common] +number_of_contracts=1 + # load test specific configuration [Load.OCR] [Load.OCR.Common] @@ -162,9 +155,8 @@ chainlink_node_funding = 100 [Soak.OCR] [Soak.OCR.Common] +number_of_contracts=2 test_duration="15m" [Soak.OCR.Soak] -ocr_version="1" -number_of_contracts=2 -time_between_rounds="1m" \ No newline at end of file +time_between_rounds="1m" diff --git a/integration-tests/testconfig/forwarder_ocr/forwarder_ocr.toml b/integration-tests/testconfig/forwarder_ocr/forwarder_ocr.toml index 8fa0fa5db25..68ed21404f3 100644 --- a/integration-tests/testconfig/forwarder_ocr/forwarder_ocr.toml +++ b/integration-tests/testconfig/forwarder_ocr/forwarder_ocr.toml @@ -57,7 +57,10 @@ MinContractPayment = 0 [Transactions] ForwardersEnabled = true - """ +""" + +[OCR.Common] +number_of_contracts=1 # load test specific configuration [Load.OCR] @@ -92,8 +95,8 @@ chainlink_node_funding = 0.5 [Soak.OCR] [Soak.OCR.Common] +number_of_contracts=2 test_duration = "15m" [Soak.OCR.Soak] -number_of_contracts = 2 -time_between_rounds = "1m" +time_between_rounds="1m" diff --git a/integration-tests/testconfig/forwarder_ocr2/example.toml b/integration-tests/testconfig/forwarder_ocr2/example.toml index b3bc45d270c..3ec3e4c690a 100644 --- a/integration-tests/testconfig/forwarder_ocr2/example.toml +++ b/integration-tests/testconfig/forwarder_ocr2/example.toml @@ -31,7 +31,7 @@ bearer_token_secret="bearer_token" base_url="http://grafana.url" # url of your grafana dashboard (prefix and suffix "/" are stirpped), example: /d/ad61652-2712-1722/my-dashboard dashboard_url="/d/your-dashboard" -# Grafana dashboard uid to annotate. Find it in Dashboard Settings -> JSON Model +# Grafana dashboard uid to annotate. Find it in Dashboard Settings -> JSON Model dashboard_uid="dashboard-uid-to-annotate" bearer_token_secret="my-awesome-token" @@ -39,15 +39,6 @@ bearer_token_secret="my-awesome-token" [Network] selected_networks=["polygon_mumbai"] -[Network.RpcHttpUrls] -polygon_mumbai = ["https://my-rpc-endpoint.io"] - -[Network.RpcWsUrls] -polygon_mumbai = ["https://my-rpc-endpoint.io"] - -[Network.WalletKeys] -polygon_mumbai = ["change-me-to-your-PK"] - [PrivateEthereumNetwork] # pos or pow consensus_type="pos" @@ -143,12 +134,15 @@ BumpPercent = 20 BumpMin = '100 gwei' """ +[OCR2.Common] +number_of_contracts=1 + # load test specific configuration -[Load.OCR] -[Load.OCR.Common] +[Load.OCR2] +[Load.OCR2.Common] eth_funds = 3 -[Load.OCR.Load] +[Load.OCR2.Load] test_duration = "3m" rate_limit_unit_duration = "1m" rate = 3 @@ -160,11 +154,10 @@ ea_change_interval = "5s" [Soak.Common] chainlink_node_funding = 100 -[Soak.OCR] -[Soak.OCR.Common] +[Soak.OCR2] +[Soak.OCR2.Common] +number_of_contracts=2 test_duration="15m" -[Soak.OCR.Soak] -ocr_version="1" -number_of_contracts=2 -time_between_rounds="1m" \ No newline at end of file +[Soak.OCR2.Soak] +time_between_rounds="1m" diff --git a/integration-tests/testconfig/forwarder_ocr2/forwarder_ocr2.toml b/integration-tests/testconfig/forwarder_ocr2/forwarder_ocr2.toml index 3f2a8610a83..76d5695a8b6 100644 --- a/integration-tests/testconfig/forwarder_ocr2/forwarder_ocr2.toml +++ b/integration-tests/testconfig/forwarder_ocr2/forwarder_ocr2.toml @@ -53,7 +53,10 @@ MinContractPayment = 0 [Transactions] ForwardersEnabled = true - """ +""" + +[OCR2.Common] +number_of_contracts=1 # load test specific configuration [Load.OCR2.Common] @@ -85,10 +88,10 @@ ea_change_interval = "5s" chainlink_node_funding = 1 [Soak.OCR2.Common] +number_of_contracts=2 test_duration="15m" [Soak.OCR2.Soak] -number_of_contracts=2 time_between_rounds="1m" diff --git a/integration-tests/testconfig/functions/config.go b/integration-tests/testconfig/functions/config.go index 88c0e052951..03adc2f1ec0 100644 --- a/integration-tests/testconfig/functions/config.go +++ b/integration-tests/testconfig/functions/config.go @@ -6,8 +6,8 @@ import ( "github.com/ethereum/go-ethereum/common" - "github.com/smartcontractkit/chainlink-testing-framework/blockchain" - "github.com/smartcontractkit/chainlink-testing-framework/utils/net" + "github.com/smartcontractkit/chainlink-testing-framework/lib/blockchain" + "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/net" ) const ( diff --git a/integration-tests/testconfig/functions/example.toml b/integration-tests/testconfig/functions/example.toml index 7502a6fc440..74d931632a8 100644 --- a/integration-tests/testconfig/functions/example.toml +++ b/integration-tests/testconfig/functions/example.toml @@ -1,7 +1,6 @@ # Example of full config with all fields # General part [ChainlinkImage] -image="public.ecr.aws/chainlink/chainlink" version="2.7.0" [Logging] @@ -16,38 +15,10 @@ log_producer_timeout="10s" # number of retries before log producer gives up and stops listening to logs log_producer_retry_limit=10 -[Logging.Loki] -tenant_id="tenant_id" -# full URL of Loki ingest endpoint -endpoint="https://loki.url/api/v3/push" -# currently only needed when using public instance -basic_auth_secret="loki-basic-auth" -# only needed for cloud grafana -bearer_token_secret="bearer_token" - -# LogStream will try to shorten Grafana URLs by default (if all 3 variables are set) -[Logging.Grafana] -# grafana url (trailing "/" will be stripped) -base_url="http://grafana.url" -# url of your grafana dashboard (prefix and suffix "/" are stirpped), example: /d/ad61652-2712-1722/my-dashboard -dashboard_url="/d/your-dashboard" -# Grafana dashboard uid to annotate. Find it in Dashboard Settings -> JSON Model -dashboard_uid="dashboard-uid-to-annotate" -bearer_token_secret="my-awesome-token" - # if you want to use simulated network [Network] selected_networks=["polygon_mumbai"] -[Network.RpcHttpUrls] -polygon_mumbai = ["https://my-rpc-endpoint.io"] - -[Network.RpcWsUrls] -polygon_mumbai = ["https://my-rpc-endpoint.io"] - -[Network.WalletKeys] -polygon_mumbai = ["change-me-to-your-PK"] - [PrivateEthereumNetwork] # pos or pow consensus_type="pos" diff --git a/integration-tests/testconfig/job_distributor/job_distributor.toml b/integration-tests/testconfig/job_distributor/job_distributor.toml new file mode 100644 index 00000000000..6dae45fb140 --- /dev/null +++ b/integration-tests/testconfig/job_distributor/job_distributor.toml @@ -0,0 +1,46 @@ +[NodeConfig] +BaseConfigTOML = """ +[Feature] +FeedsManager = true +LogPoller = true +UICSAKeys = true +MultiFeedsManagers = true + +[Log] +Level = 'debug' +JSONConsole = true + +[Log.File] +MaxSize = '0b' + +[WebServer] +AllowOrigins = '*' +HTTPPort = 6688 +SecureCookies = false +HTTPWriteTimeout = '3m' +SessionTimeout = '999h0m0s' + +[WebServer.RateLimit] +Authenticated = 2000 +Unauthenticated = 1000 + +[WebServer.TLS] +HTTPSPort = 0 + +[Database] +MaxIdleConns = 20 +MaxOpenConns = 40 +MigrateOnStartup = true + +[OCR] +Enabled = true +DefaultTransactionQueueDepth = 0 + +[P2P] +[P2P.V2] +Enabled = true +ListenAddresses = ['0.0.0.0:6690'] +AnnounceAddresses = ['0.0.0.0:6690'] +DeltaDial = '500ms' +DeltaReconcile = '5s' +""" diff --git a/integration-tests/testconfig/keeper/config.go b/integration-tests/testconfig/keeper/config.go index 0e11266d39f..81a88ef67eb 100644 --- a/integration-tests/testconfig/keeper/config.go +++ b/integration-tests/testconfig/keeper/config.go @@ -1,110 +1,8 @@ package keeper -import ( - "errors" - - "github.com/smartcontractkit/chainlink-testing-framework/blockchain" -) - type Config struct { - Common *Common `toml:"Common"` - Resiliency *ResiliencyConfig `toml:"Resiliency"` } func (c *Config) Validate() error { - if c.Common == nil { - return nil - } - if err := c.Common.Validate(); err != nil { - return err - } - if c.Resiliency == nil { - return nil - } - return c.Resiliency.Validate() -} - -type Common struct { - RegistryToTest *string `toml:"registry_to_test"` - NumberOfRegistries *int `toml:"number_of_registries"` - NumberOfNodes *int `toml:"number_of_nodes"` - NumberOfUpkeeps *int `toml:"number_of_upkeeps"` - UpkeepGasLimit *int64 `toml:"upkeep_gas_limit"` - CheckGasToBurn *int64 `toml:"check_gas_to_burn"` - PerformGasToBurn *int64 `toml:"perform_gas_to_burn"` - MaxPerformGas *int64 `toml:"max_perform_gas"` - BlockRange *int64 `toml:"block_range"` - BlockInterval *int64 `toml:"block_interval"` - ForceSingleTxKey *bool `toml:"forces_single_tx_key"` - DeleteJobsOnEnd *bool `toml:"delete_jobs_on_end"` - RegistryAddress *string `toml:"registry_address"` - RegistrarAddress *string `toml:"registrar_address"` - LinkTokenAddress *string `toml:"link_token_address"` - EthFeedAddress *string `toml:"eth_feed_address"` - GasFeedAddress *string `toml:"gas_feed_address"` -} - -func (c *Common) Validate() error { - if c.RegistryToTest == nil || *c.RegistryToTest == "" { - return errors.New("registry_to_test must be set") - } - if c.NumberOfRegistries == nil || *c.NumberOfRegistries <= 0 { - return errors.New("number_of_registries must be a positive integer") - } - if c.NumberOfNodes == nil || *c.NumberOfNodes <= 0 { - return errors.New("number_of_nodes must be a positive integer") - } - if c.NumberOfUpkeeps == nil || *c.NumberOfUpkeeps <= 0 { - return errors.New("number_of_upkeeps must be a positive integer") - } - if c.UpkeepGasLimit == nil || *c.UpkeepGasLimit <= 0 { - return errors.New("upkeep_gas_limit must be a positive integer") - } - if c.CheckGasToBurn == nil || *c.CheckGasToBurn <= 0 { - return errors.New("check_gas_to_burn must be a positive integer") - } - if c.PerformGasToBurn == nil || *c.PerformGasToBurn <= 0 { - return errors.New("perform_gas_to_burn must be a positive integer") - } - if c.MaxPerformGas == nil || *c.MaxPerformGas <= 0 { - return errors.New("max_perform_gas must be a positive integer") - } - if c.BlockRange == nil || *c.BlockRange <= 0 { - return errors.New("block_range must be a positive integer") - } - if c.BlockInterval == nil || *c.BlockInterval <= 0 { - return errors.New("block_interval must be a positive integer") - } - if c.RegistryAddress == nil { - c.RegistryAddress = new(string) - } - if c.RegistrarAddress == nil { - c.RegistrarAddress = new(string) - } - if c.LinkTokenAddress == nil { - c.LinkTokenAddress = new(string) - } - if c.EthFeedAddress == nil { - c.EthFeedAddress = new(string) - } - if c.GasFeedAddress == nil { - c.GasFeedAddress = new(string) - } - return nil -} - -type ResiliencyConfig struct { - ContractCallLimit *uint `toml:"contract_call_limit"` - ContractCallInterval *blockchain.StrDuration `toml:"contract_call_interval"` -} - -func (c *ResiliencyConfig) Validate() error { - if c.ContractCallLimit == nil { - return errors.New("contract_call_limit must be set") - } - if c.ContractCallInterval == nil { - return errors.New("contract_call_interval must be set") - } - return nil } diff --git a/integration-tests/testconfig/keeper/example.toml b/integration-tests/testconfig/keeper/example.toml index 5abb5835629..4efbf974827 100644 --- a/integration-tests/testconfig/keeper/example.toml +++ b/integration-tests/testconfig/keeper/example.toml @@ -1,7 +1,6 @@ # Example of full config with all fields # General part [ChainlinkImage] -image="public.ecr.aws/chainlink/chainlink" version="2.7.0" [Logging] @@ -16,38 +15,10 @@ log_producer_timeout="10s" # number of retries before log producer gives up and stops listening to logs log_producer_retry_limit=10 -[Logging.Loki] -tenant_id="tenant_id" -# full URL of Loki ingest endpoint -endpoint="https://loki.url/api/v3/push" -# currently only needed when using public instance -basic_auth_secret="loki-basic-auth" -# only needed for cloud grafana -bearer_token_secret="bearer_token" - -# LogStream will try to shorten Grafana URLs by default (if all 3 variables are set) -[Logging.Grafana] -# grafana url (trailing "/" will be stripped) -base_url="http://grafana.url" -# url of your grafana dashboard (prefix and suffix "/" are stirpped), example: /d/ad61652-2712-1722/my-dashboard -dashboard_url="/d/your-dashboard" -# Grafana dashboard uid to annotate. Find it in Dashboard Settings -> JSON Model -dashboard_uid="dashboard-uid-to-annotate" -bearer_token_secret="my-awesome-token" - # if you want to use polygon_mumbial [Network] selected_networks=["polygon_mumbai"] -[Network.RpcHttpUrls] -polygon_mumbai = ["https://my-rpc-endpoint.io"] - -[Network.RpcWsUrls] -polygon_mumbai = ["https://my-rpc-endpoint.io"] - -[Network.WalletKeys] -polygon_mumbai = ["change-me-to-your-PK"] - [PrivateEthereumNetwork] # pos or pow consensus_type="pos" diff --git a/integration-tests/testconfig/keeper/keeper.toml b/integration-tests/testconfig/keeper/keeper.toml index b4a6a3b2c0e..d483d6df493 100644 --- a/integration-tests/testconfig/keeper/keeper.toml +++ b/integration-tests/testconfig/keeper/keeper.toml @@ -32,66 +32,4 @@ HTTPSPort = 0 [Keeper] TurnLookBack = 0 -""" - -[Keeper.Common] -registry_to_test = "2_1" -number_of_registries = 1 -number_of_nodes = 6 -number_of_upkeeps = 500 -upkeep_gas_limit = 1500000 -check_gas_to_burn = 100000 -perform_gas_to_burn = 50000 -max_perform_gas = 5000000 -block_range = 100 -block_interval = 20 -forces_single_tx_key = false -delete_jobs_on_end = true - -# will retry roughly for 1h before giving up (900 * 4s) -[Keeper.Resiliency] -# number of retries before giving up -contract_call_limit = 900 -# static interval between retries -contract_call_interval = "4s" - -[Seth] -# keeper benchmark running on simulated network requires 100k per node -root_key_funds_buffer = 700_000 - -[Benchmark.NodeConfig] -BaseConfigTOML = """ -[Feature] -LogPoller = true - -[OCR2] -Enabled = true - -[P2P] -[P2P.V2] -Enabled = true -AnnounceAddresses = ["0.0.0.0:6690"] -ListenAddresses = ["0.0.0.0:6690"] -[Keeper] -TurnLookBack = 0 -[WebServer] -HTTPWriteTimeout = '1h' -""" - -CommonChainConfigTOML = """ -""" - -[Benchmark.NodeConfig.ChainConfigTOMLByChainID] -# applicable for simulated chain -1337 = """ -FinalityDepth = 50 -LogPollInterval = '1s' -MinIncomingConfirmations = 1 - -[HeadTracker] -HistoryDepth = 100 - -[GasEstimator] -Mode = 'FixedPrice' -LimitDefault = 5_000_000 -""" +""" \ No newline at end of file diff --git a/integration-tests/testconfig/log_poller/config.go b/integration-tests/testconfig/log_poller/config.go index f6e3249432a..00b61f6b1b9 100644 --- a/integration-tests/testconfig/log_poller/config.go +++ b/integration-tests/testconfig/log_poller/config.go @@ -5,7 +5,7 @@ import ( "github.com/ethereum/go-ethereum/accounts/abi" - "github.com/smartcontractkit/chainlink-testing-framework/blockchain" + "github.com/smartcontractkit/chainlink-testing-framework/lib/blockchain" ) type GeneratorType = string diff --git a/integration-tests/testconfig/log_poller/example.toml b/integration-tests/testconfig/log_poller/example.toml index c28d36ae12f..78f3b5482d9 100644 --- a/integration-tests/testconfig/log_poller/example.toml +++ b/integration-tests/testconfig/log_poller/example.toml @@ -1,7 +1,6 @@ # Example of full config with all fields # General part [ChainlinkImage] -image="public.ecr.aws/chainlink/chainlink" version="2.7.0" [Logging] @@ -16,38 +15,10 @@ log_producer_timeout="10s" # number of retries before log producer gives up and stops listening to logs log_producer_retry_limit=10 -[Logging.Loki] -tenant_id="tenant_id" -# full URL of Loki ingest endpoint -endpoint="https://loki.url/api/v3/push" -# currently only needed when using public instance -basic_auth_secret="loki-basic-auth" -# only needed for cloud grafana -bearer_token_secret="bearer_token" - -# LogStream will try to shorten Grafana URLs by default (if all 3 variables are set) -[Logging.Grafana] -# grafana url (trailing "/" will be stripped) -base_url="http://grafana.url" -# url of your grafana dashboard (prefix and suffix "/" are stirpped), example: /d/ad61652-2712-1722/my-dashboard -dashboard_url="/d/your-dashboard" -# Grafana dashboard uid to annotate. Find it in Dashboard Settings -> JSON Model -dashboard_uid="dashboard-uid-to-annotate" -bearer_token_secret="my-awesome-token" - # if you want to use polygon_mumbial [Network] selected_networks=["polygon_mumbai"] -[Network.RpcHttpUrls] -polygon_mumbai = ["https://my-rpc-endpoint.io"] - -[Network.RpcWsUrls] -polygon_mumbai = ["https://my-rpc-endpoint.io"] - -[Network.WalletKeys] -polygon_mumbai = ["change-me-to-your-PK"] - [PrivateEthereumNetwork] # pos or pow consensus_type="pos" diff --git a/integration-tests/testconfig/node/example.toml b/integration-tests/testconfig/node/example.toml index 510379b4f05..bc5628e46b3 100644 --- a/integration-tests/testconfig/node/example.toml +++ b/integration-tests/testconfig/node/example.toml @@ -1,7 +1,6 @@ # Example of full config with all fields # General part [ChainlinkImage] -image="public.ecr.aws/chainlink/chainlink" version="2.7.0" [Logging] @@ -16,38 +15,10 @@ log_producer_timeout="10s" # number of retries before log producer gives up and stops listening to logs log_producer_retry_limit=10 -[Logging.Loki] -tenant_id="tenant_id" -# full URL of Loki ingest endpoint -endpoint="https://loki.url/api/v3/push" -# currently only needed when using public instance -basic_auth_secret="loki-basic-auth" -# only needed for cloud grafana -bearer_token_secret="bearer_token" - -# LogStream will try to shorten Grafana URLs by default (if all 3 variables are set) -[Logging.Grafana] -# grafana url (trailing "/" will be stripped) -base_url="http://grafana.url" -# url of your grafana dashboard (prefix and suffix "/" are stirpped), example: /d/ad61652-2712-1722/my-dashboard -dashboard_url="/d/your-dashboard" -# Grafana dashboard uid to annotate. Find it in Dashboard Settings -> JSON Model -dashboard_uid="dashboard-uid-to-annotate" -bearer_token_secret="my-awesome-token" - # if you want to use polygon_mumbial [Network] selected_networks=["polygon_mumbai"] -[Network.RpcHttpUrls] -polygon_mumbai = ["https://my-rpc-endpoint.io"] - -[Network.RpcWsUrls] -polygon_mumbai = ["https://my-rpc-endpoint.io"] - -[Network.WalletKeys] -polygon_mumbai = ["change-me-to-your-PK"] - [PrivateEthereumNetwork] # pos or pow consensus_type="pos" @@ -77,5 +48,4 @@ chainlink_node_funding = 0.5 # Test-specific part [ChainlinkUpgradeImage] -image="public.ecr.aws/chainlink/chainlink" version="2.8.0" \ No newline at end of file diff --git a/integration-tests/testconfig/ocr/example.toml b/integration-tests/testconfig/ocr/example.toml index 92262241dff..7c1c755567f 100644 --- a/integration-tests/testconfig/ocr/example.toml +++ b/integration-tests/testconfig/ocr/example.toml @@ -1,7 +1,6 @@ # Example of full config with all fields # General part [ChainlinkImage] -image="public.ecr.aws/chainlink/chainlink" version="2.7.0" [Logging] @@ -31,7 +30,7 @@ bearer_token_secret="bearer_token" base_url="http://grafana.url" # url of your grafana dashboard (prefix and suffix "/" are stirpped), example: /d/ad61652-2712-1722/my-dashboard dashboard_url="/d/your-dashboard" -# Grafana dashboard uid to annotate. Find it in Dashboard Settings -> JSON Model +# Grafana dashboard uid to annotate. Find it in Dashboard Settings -> JSON Model dashboard_uid="dashboard-uid-to-annotate" bearer_token_secret="my-awesome-token" @@ -39,15 +38,6 @@ bearer_token_secret="my-awesome-token" [Network] selected_networks=["polygon_mumbai"] -[Network.RpcHttpUrls] -polygon_mumbai = ["https://my-rpc-endpoint.io"] - -[Network.RpcWsUrls] -polygon_mumbai = ["https://my-rpc-endpoint.io"] - -[Network.WalletKeys] -polygon_mumbai = ["change-me-to-your-PK"] - [PrivateEthereumNetwork] # pos or pow consensus_type="pos" @@ -142,6 +132,9 @@ BumpPercent = 20 BumpMin = '100 gwei' """ +[OCR.Common] +number_of_contracts=1 + # load test specific configuration [Load.OCR] [Load.OCR.Common] @@ -161,8 +154,8 @@ chainlink_node_funding = 100 [Soak.OCR] [Soak.OCR.Common] +number_of_contracts=2 test_duration="15m" [Soak.OCR.Soak] -number_of_contracts=2 time_between_rounds="1m" diff --git a/integration-tests/testconfig/ocr/ocr.go b/integration-tests/testconfig/ocr/ocr.go index f23d6473643..240fd2afeaa 100644 --- a/integration-tests/testconfig/ocr/ocr.go +++ b/integration-tests/testconfig/ocr/ocr.go @@ -2,15 +2,19 @@ package ocr import ( "errors" + "fmt" - "github.com/smartcontractkit/chainlink-testing-framework/blockchain" + "github.com/ethereum/go-ethereum/common" + + "github.com/smartcontractkit/chainlink-testing-framework/lib/blockchain" ) type Config struct { - Soak *SoakConfig `toml:"Soak"` - Load *Load `toml:"Load"` - Volume *Volume `toml:"Volume"` - Common *Common `toml:"Common"` + Soak *SoakConfig `toml:"Soak"` + Load *Load `toml:"Load"` + Volume *Volume `toml:"Volume"` + Common *Common `toml:"Common"` + Contracts *Contracts `toml:"Contracts"` } func (o *Config) Validate() error { @@ -29,15 +33,24 @@ func (o *Config) Validate() error { return err } } + if o.Contracts != nil { + if err := o.Contracts.Validate(); err != nil { + return err + } + } return nil } type Common struct { - ETHFunds *int `toml:"eth_funds"` - TestDuration *blockchain.StrDuration `toml:"test_duration"` + NumberOfContracts *int `toml:"number_of_contracts"` + ETHFunds *int `toml:"eth_funds"` + TestDuration *blockchain.StrDuration `toml:"test_duration"` } func (o *Common) Validate() error { + if o.NumberOfContracts != nil && *o.NumberOfContracts < 1 { + return errors.New("when number_of_contracts is set, it must be greater than 0") + } if o.ETHFunds != nil && *o.ETHFunds < 0 { return errors.New("eth_funds must be set and cannot be negative") } @@ -117,16 +130,169 @@ func (o *Volume) Validate() error { } type SoakConfig struct { - NumberOfContracts *int `toml:"number_of_contracts"` TimeBetweenRounds *blockchain.StrDuration `toml:"time_between_rounds"` } func (o *SoakConfig) Validate() error { - if o.NumberOfContracts == nil || *o.NumberOfContracts <= 1 { - return errors.New("number_of_contracts must be set and be greater than 1") - } if o.TimeBetweenRounds == nil || o.TimeBetweenRounds.Duration == 0 { return errors.New("time_between_rounds must be set and be a positive integer") } return nil } + +// For more information on the configuration of contracts, see https://smartcontract-it.atlassian.net/wiki/spaces/TT/pages/828407894/Contracts+addresses+in+TOML+convention +type Contracts struct { + ShouldBeUsed *bool `toml:"use"` + LinkTokenAddress *string `toml:"link_token"` + OffChainAggregatorAddresses []string `toml:"offchain_aggregators"` + Settings map[string]ContractSetting `toml:"Settings"` +} + +func (o *Contracts) Validate() error { + if o.LinkTokenAddress != nil && !common.IsHexAddress(*o.LinkTokenAddress) { + return errors.New("link_token must be a valid ethereum address") + } + if o.OffChainAggregatorAddresses != nil { + allEnabled := make(map[bool]int) + allConfigure := make(map[bool]int) + for _, address := range o.OffChainAggregatorAddresses { + if !common.IsHexAddress(address) { + return fmt.Errorf("offchain_aggregators must be valid ethereum addresses, but %s is not", address) + } + + if v, ok := o.Settings[address]; ok { + if v.ShouldBeUsed != nil { + allEnabled[*v.ShouldBeUsed]++ + } else { + allEnabled[true]++ + } + if v.Configure != nil { + allConfigure[*v.Configure]++ + } else { + allConfigure[true]++ + } + } + } + + if allEnabled[true] > 0 && allEnabled[false] > 0 { + return errors.New("either all or none offchain_aggregators must be used") + } + + if allConfigure[true] > 0 && allConfigure[false] > 0 { + return errors.New("either all or none offchain_aggregators must be configured") + } + } + + return nil +} + +func (o *Config) UseExistingContracts() bool { + if o.Contracts == nil { + return false + } + + if o.Contracts.ShouldBeUsed != nil { + return *o.Contracts.ShouldBeUsed + } + + return false +} + +func (o *Config) LinkTokenContractAddress() (common.Address, error) { + if o.Contracts != nil && o.Contracts.LinkTokenAddress != nil { + return common.HexToAddress(*o.Contracts.LinkTokenAddress), nil + } + + return common.Address{}, errors.New("link token address must be set") +} + +func (o *Config) UseExistingLinkTokenContract() bool { + if !o.UseExistingContracts() { + return false + } + + if o.Contracts.LinkTokenAddress == nil { + return false + } + + if len(o.Contracts.Settings) == 0 { + return true + } + + if v, ok := o.Contracts.Settings[*o.Contracts.LinkTokenAddress]; ok { + return v.ShouldBeUsed != nil && *v.ShouldBeUsed + } + + return true +} + +type ContractSetting struct { + ShouldBeUsed *bool `toml:"use"` + Configure *bool `toml:"configure"` +} + +type OffChainAggregatorsConfig interface { + OffChainAggregatorsContractsAddresses() []common.Address + UseExistingOffChainAggregatorsContracts() bool + ConfigureExistingOffChainAggregatorsContracts() bool + NumberOfContractsToDeploy() int +} + +func (o *Config) UseExistingOffChainAggregatorsContracts() bool { + if !o.UseExistingContracts() { + return false + } + + if len(o.Contracts.OffChainAggregatorAddresses) == 0 { + return false + } + + if len(o.Contracts.Settings) == 0 { + return true + } + + for _, address := range o.Contracts.OffChainAggregatorAddresses { + if v, ok := o.Contracts.Settings[address]; ok { + return v.ShouldBeUsed != nil && *v.ShouldBeUsed + } + } + + return true +} + +func (o *Config) OffChainAggregatorsContractsAddresses() []common.Address { + var ocrInstanceAddresses []common.Address + if !o.UseExistingOffChainAggregatorsContracts() { + return ocrInstanceAddresses + } + + for _, address := range o.Contracts.OffChainAggregatorAddresses { + ocrInstanceAddresses = append(ocrInstanceAddresses, common.HexToAddress(address)) + } + + return ocrInstanceAddresses +} + +func (o *Config) ConfigureExistingOffChainAggregatorsContracts() bool { + if !o.UseExistingOffChainAggregatorsContracts() { + return true + } + + for _, address := range o.Contracts.OffChainAggregatorAddresses { + for maybeOcrAddress, setting := range o.Contracts.Settings { + if maybeOcrAddress == address { + return setting.Configure != nil && *setting.Configure + } + } + } + + return true +} + +func (o *Config) NumberOfContractsToDeploy() int { + if o.Common != nil && o.Common.NumberOfContracts != nil { + return *o.Common.NumberOfContracts + } + + return 0 +} diff --git a/integration-tests/testconfig/ocr/ocr.toml b/integration-tests/testconfig/ocr/ocr.toml index ac0249334da..36cded0b85c 100644 --- a/integration-tests/testconfig/ocr/ocr.toml +++ b/integration-tests/testconfig/ocr/ocr.toml @@ -43,6 +43,9 @@ Enabled = true ListenAddresses = ['0.0.0.0:6690'] """ +[OCR.Common] +number_of_contracts=1 + # load test specific configuration [Load.OCR] [Load.OCR.Common] @@ -77,9 +80,9 @@ chainlink_node_funding = 0.5 [Soak.OCR] [Soak.OCR.Common] test_duration="15m" +number_of_contracts=2 [Soak.OCR.Soak] -number_of_contracts=2 time_between_rounds="1m" # Soak test configuration with Geth reorg below finality with FinalityTagEnabled=false @@ -187,4 +190,4 @@ test_duration="15m" number_of_contracts=2 time_between_rounds="1m" [TestOCRSoak_RPCDownForHalfCLNodes.Network] -selected_networks=["simulated"] +selected_networks=["simulated"] \ No newline at end of file diff --git a/integration-tests/testconfig/ocr/overrides/arbitrum_mainnet.toml b/integration-tests/testconfig/ocr/overrides/arbitrum_mainnet.toml new file mode 100644 index 00000000000..953d9f351a4 --- /dev/null +++ b/integration-tests/testconfig/ocr/overrides/arbitrum_mainnet.toml @@ -0,0 +1,18 @@ +[Network] +selected_networks = ["ARBITRUM_MAINNET"] + +[Soak.Common] +chainlink_node_funding = 0.1 + +[Soak.OCR] +[Soak.OCR.Common] +test_duration = "24h" + +[Soak.OCR.Soak] +time_between_rounds = "10m" + +[OCR.Common] +number_of_contracts = 2 + +[Seth] +experiments_enabled = ["slow_funds_return"] diff --git a/integration-tests/testconfig/ocr/overrides/arbitrum_sepolia.toml b/integration-tests/testconfig/ocr/overrides/arbitrum_sepolia.toml new file mode 100644 index 00000000000..1428e50b0e3 --- /dev/null +++ b/integration-tests/testconfig/ocr/overrides/arbitrum_sepolia.toml @@ -0,0 +1,15 @@ +[Network] +selected_networks = ["ARBITRUM_SEPOLIA"] + +[Soak.Common] +chainlink_node_funding = 1 + +[Soak.OCR] +[Soak.OCR.Common] +test_duration = "24h" + +[Soak.OCR.Soak] +time_between_rounds = "2m" + +[OCR.Common] +number_of_contracts = 2 diff --git a/integration-tests/testconfig/ocr/overrides/base_mainnet.toml b/integration-tests/testconfig/ocr/overrides/base_mainnet.toml new file mode 100644 index 00000000000..a285c23758e --- /dev/null +++ b/integration-tests/testconfig/ocr/overrides/base_mainnet.toml @@ -0,0 +1,18 @@ +[Network] +selected_networks = ["BASE_MAINNET"] + +[Soak.Common] +chainlink_node_funding = 5 + +[Soak.OCR] +[Soak.OCR.Common] +test_duration = "24h" + +[Soak.OCR.Soak] +time_between_rounds = "10m" + +[OCR.Common] +number_of_contracts = 2 + +[Seth] +experiments_enabled = ["slow_funds_return"] diff --git a/integration-tests/testconfig/ocr/overrides/base_sepolia.toml b/integration-tests/testconfig/ocr/overrides/base_sepolia.toml new file mode 100644 index 00000000000..3dbbadcbef2 --- /dev/null +++ b/integration-tests/testconfig/ocr/overrides/base_sepolia.toml @@ -0,0 +1,15 @@ +[Network] +selected_networks = ["BASE_SEPOLIA"] + +[Soak.Common] +chainlink_node_funding = 1 + +[Soak.OCR] +[Soak.OCR.Common] +test_duration = "24h" + +[Soak.OCR.Soak] +time_between_rounds = "2m" + +[OCR.Common] +number_of_contracts = 2 diff --git a/integration-tests/testconfig/ocr/overrides/celo_alfajores.toml b/integration-tests/testconfig/ocr/overrides/celo_alfajores.toml new file mode 100644 index 00000000000..37c4a8cf16d --- /dev/null +++ b/integration-tests/testconfig/ocr/overrides/celo_alfajores.toml @@ -0,0 +1,15 @@ +[Network] +selected_networks = ["CELO_ALFAJORES"] + +[Soak.Common] +chainlink_node_funding = 10 + +[Soak.OCR] +[Soak.OCR.Common] +test_duration = "24h" + +[Soak.OCR.Soak] +time_between_rounds = "2m" + +[OCR.Common] +number_of_contracts = 2 diff --git a/integration-tests/testconfig/ocr/overrides/ethereum_sepolia.toml b/integration-tests/testconfig/ocr/overrides/ethereum_sepolia.toml new file mode 100644 index 00000000000..612e47506a7 --- /dev/null +++ b/integration-tests/testconfig/ocr/overrides/ethereum_sepolia.toml @@ -0,0 +1,15 @@ +[Network] +selected_networks = ["SEPOLIA"] + +[Soak.Common] +chainlink_node_funding = 1 + +[Soak.OCR] +[Soak.OCR.Common] +test_duration = "24h" + +[Soak.OCR.Soak] +time_between_rounds = "2m" + +[OCR.Common] +number_of_contracts = 2 diff --git a/integration-tests/testconfig/ocr/overrides/linea_sepolia.toml b/integration-tests/testconfig/ocr/overrides/linea_sepolia.toml new file mode 100644 index 00000000000..6fa6218d541 --- /dev/null +++ b/integration-tests/testconfig/ocr/overrides/linea_sepolia.toml @@ -0,0 +1,15 @@ +[Network] +selected_networks = ["Linea_Sepolia"] + +[Soak.Common] +chainlink_node_funding = 1 + +[Soak.OCR] +[Soak.OCR.Common] +test_duration = "24h" + +[Soak.OCR.Soak] +time_between_rounds = "2m" + +[OCR.Common] +number_of_contracts = 2 diff --git a/integration-tests/testconfig/ocr/overrides/optimism_mainnet.toml b/integration-tests/testconfig/ocr/overrides/optimism_mainnet.toml new file mode 100644 index 00000000000..eec0640baa3 --- /dev/null +++ b/integration-tests/testconfig/ocr/overrides/optimism_mainnet.toml @@ -0,0 +1,18 @@ +[Network] +selected_networks = ["OPTIMISM_MAINNET"] + +[Soak.Common] +chainlink_node_funding = 0.1 + +[Soak.OCR] +[Soak.OCR.Common] +test_duration = "24h" + +[Soak.OCR.Soak] +time_between_rounds = "10m" + +[OCR.Common] +number_of_contracts = 2 + +[Seth] +experiments_enabled = ["slow_funds_return"] diff --git a/integration-tests/testconfig/ocr/overrides/optimism_sepolia.toml b/integration-tests/testconfig/ocr/overrides/optimism_sepolia.toml new file mode 100644 index 00000000000..fe666b6aa9e --- /dev/null +++ b/integration-tests/testconfig/ocr/overrides/optimism_sepolia.toml @@ -0,0 +1,15 @@ +[Network] +selected_networks = ["OPTIMISM_SEPOLIA"] + +[Soak.Common] +chainlink_node_funding = 1 + +[Soak.OCR] +[Soak.OCR.Common] +test_duration = "24h" + +[Soak.OCR.Soak] +time_between_rounds = "2m" + +[OCR.Common] +number_of_contracts = 2 diff --git a/integration-tests/testconfig/ocr/overrides/scroll_sepolia.toml b/integration-tests/testconfig/ocr/overrides/scroll_sepolia.toml new file mode 100644 index 00000000000..0beedfd05ea --- /dev/null +++ b/integration-tests/testconfig/ocr/overrides/scroll_sepolia.toml @@ -0,0 +1,15 @@ +[Network] +selected_networks = ["SCROLL_SEPOLIA"] + +[Soak.Common] +chainlink_node_funding = 1 + +[Soak.OCR] +[Soak.OCR.Common] +test_duration = "24h" + +[Soak.OCR.Soak] +time_between_rounds = "2m" + +[OCR.Common] +number_of_contracts = 2 diff --git a/integration-tests/testconfig/ocr/overrides/wemix_mainnet.toml b/integration-tests/testconfig/ocr/overrides/wemix_mainnet.toml new file mode 100644 index 00000000000..4a7859db3c9 --- /dev/null +++ b/integration-tests/testconfig/ocr/overrides/wemix_mainnet.toml @@ -0,0 +1,18 @@ +[Network] +selected_networks = ["WEMIX_MAINNET"] + +[Soak.Common] +chainlink_node_funding = 5 + +[Soak.OCR] +[Soak.OCR.Common] +test_duration = "24h" + +[Soak.OCR.Soak] +time_between_rounds = "10m" + +[OCR.Common] +number_of_contracts = 2 + +[Seth] +experiments_enabled = ["slow_funds_return"] diff --git a/integration-tests/testconfig/ocr2/example.toml b/integration-tests/testconfig/ocr2/example.toml index 36e3105f219..319f64d2580 100644 --- a/integration-tests/testconfig/ocr2/example.toml +++ b/integration-tests/testconfig/ocr2/example.toml @@ -1,7 +1,6 @@ # Example of full config with all fields # General part [ChainlinkImage] -image="public.ecr.aws/chainlink/chainlink" version="2.7.0" [Logging] @@ -31,7 +30,7 @@ bearer_token_secret="bearer_token" base_url="http://grafana.url" # url of your grafana dashboard (prefix and suffix "/" are stirpped), example: /d/ad61652-2712-1722/my-dashboard dashboard_url="/d/your-dashboard" -# Grafana dashboard uid to annotate. Find it in Dashboard Settings -> JSON Model +# Grafana dashboard uid to annotate. Find it in Dashboard Settings -> JSON Model dashboard_uid="dashboard-uid-to-annotate" bearer_token_secret="my-awesome-token" @@ -39,15 +38,6 @@ bearer_token_secret="my-awesome-token" [Network] selected_networks=["polygon_mumbai"] -[Network.RpcHttpUrls] -polygon_mumbai = ["https://my-rpc-endpoint.io"] - -[Network.RpcWsUrls] -polygon_mumbai = ["https://my-rpc-endpoint.io"] - -[Network.WalletKeys] -polygon_mumbai = ["change-me-to-your-PK"] - [PrivateEthereumNetwork] # pos or pow consensus_type="pos" @@ -142,6 +132,9 @@ BumpPercent = 20 BumpMin = '100 gwei' """ +[OCR2.Common] +number_of_contracts=1 + # load test specific configuration [Load.OCR2] [Load.OCR2.Common] @@ -161,8 +154,8 @@ chainlink_node_funding = 100 [Soak.OCR2] [Soak.OCR.Common] +number_of_contracts=2 test_duration="15m" [Soak.OCR2.Soak] -number_of_contracts=2 time_between_rounds="1m" diff --git a/integration-tests/testconfig/ocr2/ocr2.go b/integration-tests/testconfig/ocr2/ocr2.go index 73c9cd10056..60169e944fa 100644 --- a/integration-tests/testconfig/ocr2/ocr2.go +++ b/integration-tests/testconfig/ocr2/ocr2.go @@ -1,14 +1,13 @@ package ocr2 import ( - "errors" - - "github.com/smartcontractkit/chainlink-testing-framework/blockchain" + "github.com/smartcontractkit/chainlink/integration-tests/testconfig/ocr" ) type Config struct { - Soak *SoakConfig `toml:"Soak"` - Common *Common `toml:"Common"` + Soak *ocr.SoakConfig `toml:"Soak"` + Common *ocr.Common `toml:"Common"` + Contracts *ocr.Contracts `toml:"Contracts"` } func (o *Config) Validate() error { @@ -22,32 +21,10 @@ func (o *Config) Validate() error { return err } } - return nil -} - -type Common struct { - ETHFunds *int `toml:"eth_funds"` - TestDuration *blockchain.StrDuration `toml:"test_duration"` -} - -func (o *Common) Validate() error { - if o.ETHFunds != nil && *o.ETHFunds < 0 { - return errors.New("eth_funds must be set and cannot be negative") - } - return nil -} - -type SoakConfig struct { - NumberOfContracts *int `toml:"number_of_contracts"` - TimeBetweenRounds *blockchain.StrDuration `toml:"time_between_rounds"` -} - -func (o *SoakConfig) Validate() error { - if o.NumberOfContracts == nil || *o.NumberOfContracts <= 1 { - return errors.New("number_of_contracts must be set and be greater than 1") - } - if o.TimeBetweenRounds == nil || o.TimeBetweenRounds.Duration == 0 { - return errors.New("time_between_rounds must be set and be a positive integer") + if o.Contracts != nil { + if err := o.Contracts.Validate(); err != nil { + return err + } } return nil } diff --git a/integration-tests/testconfig/ocr2/ocr2.toml b/integration-tests/testconfig/ocr2/ocr2.toml index ad195913bd0..62d92574ea8 100644 --- a/integration-tests/testconfig/ocr2/ocr2.toml +++ b/integration-tests/testconfig/ocr2/ocr2.toml @@ -43,6 +43,9 @@ Enabled = true ListenAddresses = ['0.0.0.0:6690'] """ +[OCR2.Common] +number_of_contracts=1 + # load test specific configuration [Load.OCR2] [Load.OCR2.Common] @@ -76,8 +79,8 @@ chainlink_node_funding = 0.5 [Soak.OCR2] [Soak.OCR2.Common] +number_of_contracts=2 test_duration="15m" [Soak.OCR2.Soak] -number_of_contracts=2 time_between_rounds="1m" diff --git a/integration-tests/testconfig/ocr2/overrides/base_sepolia.toml b/integration-tests/testconfig/ocr2/overrides/base_sepolia.toml new file mode 100644 index 00000000000..76e4fc4722d --- /dev/null +++ b/integration-tests/testconfig/ocr2/overrides/base_sepolia.toml @@ -0,0 +1,18 @@ +[Network] +selected_networks = ["BASE_SEPOLIA"] + +[Soak.Common] +chainlink_node_funding = 1 + +[Soak.OCR2] +[Soak.OCR2.Common] +test_duration = "24h" + +[Soak.OCR2.Soak] +time_between_rounds = "2m" + +[OCR2.Common] +number_of_contracts = 2 + +[Seth] +experiments_enabled = ["slow_funds_return"] diff --git a/integration-tests/testconfig/ocr2/overrides/base_sepolia_quick_smoke_test.toml b/integration-tests/testconfig/ocr2/overrides/base_sepolia_quick_smoke_test.toml new file mode 100644 index 00000000000..f4dfe76994b --- /dev/null +++ b/integration-tests/testconfig/ocr2/overrides/base_sepolia_quick_smoke_test.toml @@ -0,0 +1,18 @@ +[Network] +selected_networks = ["BASE_SEPOLIA"] + +[Soak.Common] +chainlink_node_funding = 1 + +[Soak.OCR2] +[Soak.OCR2.Common] +test_duration = "10m" + +[Soak.OCR2.Soak] +time_between_rounds = "2m" + +[OCR2.Common] +number_of_contracts = 2 + +[Seth] +experiments_enabled = ["slow_funds_return"] diff --git a/integration-tests/testconfig/ocr2/overrides/ethereum_sepolia.toml b/integration-tests/testconfig/ocr2/overrides/ethereum_sepolia.toml new file mode 100644 index 00000000000..f7e02407808 --- /dev/null +++ b/integration-tests/testconfig/ocr2/overrides/ethereum_sepolia.toml @@ -0,0 +1,15 @@ +[Network] +selected_networks = ["SEPOLIA"] + +[Soak.Common] +chainlink_node_funding = 1 + +[Soak.OCR2] +[Soak.OCR2.Common] +test_duration = "24h" + +[Soak.OCR2.Soak] +time_between_rounds = "2m" + +[OCR2.Common] +number_of_contracts = 2 diff --git a/integration-tests/testconfig/ocr2/overrides/polygon_amoy.toml b/integration-tests/testconfig/ocr2/overrides/polygon_amoy.toml new file mode 100644 index 00000000000..41a31897c5f --- /dev/null +++ b/integration-tests/testconfig/ocr2/overrides/polygon_amoy.toml @@ -0,0 +1,15 @@ +[Network] +selected_networks = ["POLYGON_AMOY"] + +[Soak.Common] +chainlink_node_funding = 20 + +[Soak.OCR2] +[Soak.OCR2.Common] +test_duration = "24h" + +[Soak.OCR2.Soak] +time_between_rounds = "2m" + +[OCR2.Common] +number_of_contracts = 2 diff --git a/integration-tests/testconfig/ocr2/overrides/polygon_mainnet.toml b/integration-tests/testconfig/ocr2/overrides/polygon_mainnet.toml new file mode 100644 index 00000000000..51da2793133 --- /dev/null +++ b/integration-tests/testconfig/ocr2/overrides/polygon_mainnet.toml @@ -0,0 +1,18 @@ +[Network] +selected_networks = ["POLYGON_MAINNET"] + +[Soak.Common] +chainlink_node_funding = 5 + +[Soak.OCR2] +[Soak.OCR2.Common] +test_duration = "24h" + +[Soak.OCR2.Soak] +time_between_rounds = "10m" + +[OCR2.Common] +number_of_contracts = 2 + +[Seth] +experiments_enabled = ["slow_funds_return"] diff --git a/integration-tests/testconfig/ocr2/overrides/wemix_testnet.toml b/integration-tests/testconfig/ocr2/overrides/wemix_testnet.toml new file mode 100644 index 00000000000..82bc06c17ee --- /dev/null +++ b/integration-tests/testconfig/ocr2/overrides/wemix_testnet.toml @@ -0,0 +1,15 @@ +[Network] +selected_networks = ["WEMIX_TESTNET"] + +[Soak.Common] +chainlink_node_funding = 10 + +[Soak.OCR2] +[Soak.OCR2.Common] +test_duration = "24h" + +[Soak.OCR2.Soak] +time_between_rounds = "2m" + +[OCR2.Common] +number_of_contracts = 2 diff --git a/integration-tests/testconfig/ocr2/overrides/xlayer_sepolia.toml b/integration-tests/testconfig/ocr2/overrides/xlayer_sepolia.toml new file mode 100644 index 00000000000..d58098c5b0f --- /dev/null +++ b/integration-tests/testconfig/ocr2/overrides/xlayer_sepolia.toml @@ -0,0 +1,15 @@ +[Network] +selected_networks = ["xlayer_sepolia"] + +[Soak.Common] +chainlink_node_funding = 1 + +[Soak.OCR2] +[Soak.OCR2.Common] +test_duration = "24h" + +[Soak.OCR2.Soak] +time_between_rounds = "2m" + +[OCR2.Common] +number_of_contracts = 2 diff --git a/integration-tests/testconfig/testconfig.go b/integration-tests/testconfig/testconfig.go index 80f44356c3e..545818e3348 100644 --- a/integration-tests/testconfig/testconfig.go +++ b/integration-tests/testconfig/testconfig.go @@ -10,6 +10,7 @@ import ( "strings" "github.com/barkimedes/go-deepcopy" + "github.com/ethereum/go-ethereum/common" "github.com/google/uuid" "github.com/pelletier/go-toml/v2" "github.com/pkg/errors" @@ -17,16 +18,17 @@ import ( "golang.org/x/text/cases" "golang.org/x/text/language" - "github.com/smartcontractkit/seth" + "github.com/smartcontractkit/chainlink-testing-framework/seth" - ctf_config "github.com/smartcontractkit/chainlink-testing-framework/config" - k8s_config "github.com/smartcontractkit/chainlink-testing-framework/k8s/config" - "github.com/smartcontractkit/chainlink-testing-framework/logging" - "github.com/smartcontractkit/chainlink-testing-framework/networks" - "github.com/smartcontractkit/chainlink-testing-framework/utils/conversions" - "github.com/smartcontractkit/chainlink-testing-framework/utils/osutil" + ctf_config "github.com/smartcontractkit/chainlink-testing-framework/lib/config" + k8s_config "github.com/smartcontractkit/chainlink-testing-framework/lib/k8s/config" + "github.com/smartcontractkit/chainlink-testing-framework/lib/logging" + "github.com/smartcontractkit/chainlink-testing-framework/lib/networks" + "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/conversions" + "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/osutil" a_config "github.com/smartcontractkit/chainlink/integration-tests/testconfig/automation" + ccip_config "github.com/smartcontractkit/chainlink/integration-tests/testconfig/ccip" f_config "github.com/smartcontractkit/chainlink/integration-tests/testconfig/functions" keeper_config "github.com/smartcontractkit/chainlink/integration-tests/testconfig/keeper" lp_config "github.com/smartcontractkit/chainlink/integration-tests/testconfig/log_poller" @@ -72,6 +74,21 @@ type Ocr2TestConfig interface { GetOCR2Config() *ocr_config.Config } +type CCIPTestConfig interface { + GetCCIPConfig() *ccip_config.Config +} + +type LinkTokenContractConfig interface { + LinkTokenContractAddress() (common.Address, error) + UseExistingLinkTokenContract() bool +} + +const ( + E2E_TEST_DATA_STREAMS_URL_ENV = "E2E_TEST_DATA_STREAMS_URL" + E2E_TEST_DATA_STREAMS_USERNAME_ENV = "E2E_TEST_DATA_STREAMS_USERNAME" + E2E_TEST_DATA_STREAMS_PASSWORD_ENV = "E2E_TEST_DATA_STREAMS_PASSWORD" +) + type TestConfig struct { ctf_config.TestConfig @@ -85,17 +102,11 @@ type TestConfig struct { VRF *vrf_config.Config `toml:"VRF"` VRFv2 *vrfv2_config.Config `toml:"VRFv2"` VRFv2Plus *vrfv2plus_config.Config `toml:"VRFv2Plus"` - CRIB *CRIB `toml:"CRIB"` + CCIP *ccip_config.Config `toml:"CCIP"` ConfigurationNames []string `toml:"-"` } -type CRIB struct { - Namespace string `toml:"namespace"` - NetworkName string `toml:"network_name"` - CLNodesNum int `toml:"nodes"` -} - var embeddedConfigs embed.FS var areConfigsEmbedded bool @@ -205,6 +216,10 @@ func (c TestConfig) GetOCRConfig() *ocr_config.Config { return c.OCR } +func (c TestConfig) GetCCIPConfig() *ccip_config.Config { + return c.CCIP +} + func (c TestConfig) GetConfigurationNames() []string { return c.ConfigurationNames } @@ -260,6 +275,8 @@ const ( VRF Product = "vrf" VRFv2 Product = "vrfv2" VRFv2Plus Product = "vrfv2plus" + + CCIP Product = "ccip" ) const TestTypeEnvVarName = "TEST_TYPE" @@ -354,13 +371,19 @@ func GetConfig(configurationNames []string, product Product) (TestConfig, error) } } - // it needs some custom logic, so we do it separately - err := testConfig.readNetworkConfiguration() + logger.Info().Msg("Setting env vars from testsecrets dot-env files") + err := ctf_config.LoadSecretEnvsFromFiles() if err != nil { - return TestConfig{}, errors.Wrapf(err, "error reading network config") + return TestConfig{}, errors.Wrapf(err, "error reading test config values from ~/.testsecrets file") + } + + logger.Info().Msg("Reading config values from existing env vars") + err = testConfig.ReadFromEnvVar() + if err != nil { + return TestConfig{}, errors.Wrapf(err, "error reading test config values from env vars") } - logger.Info().Msg("Reading configs from Base64 override env var") + logger.Info().Msgf("Overriding config from %s env var", Base64OverrideEnvVarName) configEncoded, isSet := os.LookupEnv(Base64OverrideEnvVarName) if isSet && configEncoded != "" { logger.Debug().Msgf("Found base64 config override environment variable '%s' found", Base64OverrideEnvVarName) @@ -381,16 +404,9 @@ func GetConfig(configurationNames []string, product Product) (TestConfig, error) logger.Debug().Msg("Base64 config override from environment variable not found") } - logger.Info().Msg("Loading config values from default ~/.testsecrets env file") - err = ctf_config.LoadSecretEnvsFromFile() + err = testConfig.readNetworkConfiguration() if err != nil { - return TestConfig{}, errors.Wrapf(err, "error reading test config values from ~/.testsecrets file") - } - - logger.Info().Msg("Reading values from environment variables") - err = testConfig.ReadConfigValuesFromEnvVars() - if err != nil { - return TestConfig{}, errors.Wrapf(err, "error reading test config values from env vars") + return TestConfig{}, errors.Wrapf(err, "error reading network config") } logger.Debug().Msg("Validating test config") @@ -411,6 +427,55 @@ func GetConfig(configurationNames []string, product Product) (TestConfig, error) return testConfig, nil } +// Read config values from environment variables +func (c *TestConfig) ReadFromEnvVar() error { + logger := logging.GetTestLogger(nil) + + // Read values for base config from env vars + err := c.TestConfig.ReadFromEnvVar() + if err != nil { + return errors.Wrapf(err, "error reading test config values from env vars") + } + + dsURL := ctf_config.MustReadEnvVar_String(E2E_TEST_DATA_STREAMS_URL_ENV) + if dsURL != "" { + if c.Automation == nil { + c.Automation = &a_config.Config{} + } + if c.Automation.DataStreams == nil { + c.Automation.DataStreams = &a_config.DataStreams{} + } + logger.Debug().Msgf("Using %s env var to override Automation.DataStreams.URL", E2E_TEST_DATA_STREAMS_URL_ENV) + c.Automation.DataStreams.URL = &dsURL + } + + dsUsername := ctf_config.MustReadEnvVar_String(E2E_TEST_DATA_STREAMS_USERNAME_ENV) + if dsUsername != "" { + if c.Automation == nil { + c.Automation = &a_config.Config{} + } + if c.Automation.DataStreams == nil { + c.Automation.DataStreams = &a_config.DataStreams{} + } + logger.Debug().Msgf("Using %s env var to override Automation.DataStreams.Username", E2E_TEST_DATA_STREAMS_USERNAME_ENV) + c.Automation.DataStreams.Username = &dsUsername + } + + dsPassword := ctf_config.MustReadEnvVar_String(E2E_TEST_DATA_STREAMS_PASSWORD_ENV) + if dsPassword != "" { + if c.Automation == nil { + c.Automation = &a_config.Config{} + } + if c.Automation.DataStreams == nil { + c.Automation.DataStreams = &a_config.DataStreams{} + } + logger.Debug().Msgf("Using %s env var to override Automation.DataStreams.Password", E2E_TEST_DATA_STREAMS_PASSWORD_ENV) + c.Automation.DataStreams.Password = &dsPassword + } + + return nil +} + func (c *TestConfig) logRiskySettings(logger zerolog.Logger) { isAnySimulated := false for _, network := range c.Network.SelectedNetworks { @@ -529,10 +594,6 @@ func (c *TestConfig) readNetworkConfiguration() error { c.Network.UpperCaseNetworkNames() c.Network.OverrideURLsAndKeysFromEVMNetwork() - err := c.Network.Default() - if err != nil { - return errors.Wrapf(err, "error reading default network config") - } // this is the only value we need to generate dynamically before starting a new simulated chain if c.PrivateEthereumNetwork != nil && c.PrivateEthereumNetwork.EthereumChainConfig != nil { diff --git a/integration-tests/testconfig/testconfig_test.go b/integration-tests/testconfig/testconfig_test.go index 91d2524fcf0..6a025c35ccc 100644 --- a/integration-tests/testconfig/testconfig_test.go +++ b/integration-tests/testconfig/testconfig_test.go @@ -9,23 +9,24 @@ import ( "github.com/pelletier/go-toml/v2" "github.com/test-go/testify/require" - ctf_config "github.com/smartcontractkit/chainlink-testing-framework/config" - "github.com/smartcontractkit/chainlink-testing-framework/utils/ptr" + ctf_config "github.com/smartcontractkit/chainlink-testing-framework/lib/config" + "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/ptr" a_config "github.com/smartcontractkit/chainlink/integration-tests/testconfig/automation" ) func TestBase64ConfigRead(t *testing.T) { - networkConfigTOML := ` - [RpcHttpUrls] - arbitrum_goerli = ["https://devnet-1.mt/ABC/rpc/"] - optimism_goerli = ["https://devnet-3.mt/ABC/rpc/"] - - [RpcWsUrls] - arbitrum_goerli = ["wss://devnet-1.mt/ABC/rpc/"] - optimism_goerli = ["wss://devnet-2.mt/ABC/rpc/"] - ` - networksEncoded := base64.StdEncoding.EncodeToString([]byte(networkConfigTOML)) - os.Setenv(ctf_config.Base64NetworkConfigEnvVarName, networksEncoded) + os.Setenv("E2E_TEST_ARBITRUM_GOERLI_RPC_HTTP_URL", "https://devnet-1.mt/ABC/rpc/") + os.Setenv("E2E_TEST_ARBITRUM_GOERLI_RPC_WS_URL", "wss://devnet-1.mt/ABC/rpc/") + os.Setenv("E2E_TEST_ARBITRUM_GOERLI_WALLET_KEY", "0x3333333333333333333333333333333333333333") + defer os.Unsetenv("E2E_TEST_ARBITRUM_GOERLI_RPC_HTTP_URL") + defer os.Unsetenv("E2E_TEST_ARBITRUM_GOERLI_RPC_WS_URL") + defer os.Unsetenv("E2E_TEST_ARBITRUM_GOERLI_WALLET_KEY") + os.Setenv("E2E_TEST_OPTIMISM_GOERLI_RPC_HTTP_URL", "https://devnet-3.mt/ABC/rpc/") + os.Setenv("E2E_TEST_OPTIMISM_GOERLI_RPC_WS_URL", "wss://devnet-3.mt/ABC/rpc/") + os.Setenv("E2E_TEST_OPTIMISM_GOERLI_WALLET_KEY", "0x3333333333333333333333333333333333333333") + defer os.Unsetenv("E2E_TEST_OPTIMISM_GOERLI_RPC_HTTP_URL") + defer os.Unsetenv("E2E_TEST_OPTIMISM_GOERLI_RPC_WS_URL") + defer os.Unsetenv("E2E_TEST_OPTIMISM_GOERLI_WALLET_KEY") testConfig := TestConfig{ Automation: &a_config.Config{ @@ -35,6 +36,8 @@ func TestBase64ConfigRead(t *testing.T) { BlockTime: ptr.Ptr(10), SpecType: ptr.Ptr("minimum"), ChainlinkNodeLogLevel: ptr.Ptr("debug"), + UsePrometheus: ptr.Ptr(true), + RemoveNamespace: ptr.Ptr(true), }, Load: []a_config.Load{ { diff --git a/integration-tests/testconfig/vrfv2/config.go b/integration-tests/testconfig/vrfv2/config.go index 76d54a45d5b..5e940403961 100644 --- a/integration-tests/testconfig/vrfv2/config.go +++ b/integration-tests/testconfig/vrfv2/config.go @@ -3,8 +3,6 @@ package testconfig import ( "errors" - "github.com/ethereum/go-ethereum/common" - vrf_common_config "github.com/smartcontractkit/chainlink/integration-tests/testconfig/common/vrf" ) @@ -52,10 +50,6 @@ func (c *ExistingEnvConfig) Validate() error { if *c.SubID == 0 { return errors.New("sub_id must be positive value") } - - if c.LinkAddress != nil && !common.IsHexAddress(*c.LinkAddress) { - return errors.New("link_address must be a valid hex address") - } } return c.Funding.Validate() diff --git a/integration-tests/testconfig/vrfv2/example.toml b/integration-tests/testconfig/vrfv2/example.toml index 9417a422cf0..13af6dee620 100644 --- a/integration-tests/testconfig/vrfv2/example.toml +++ b/integration-tests/testconfig/vrfv2/example.toml @@ -1,7 +1,6 @@ # Example of full config with all fields # General part [ChainlinkImage] -image="public.ecr.aws/chainlink/chainlink" version="2.7.0" [Logging] @@ -16,38 +15,10 @@ log_producer_timeout="10s" # number of retries before log producer gives up and stops listening to logs log_producer_retry_limit=10 -[Logging.Loki] -tenant_id="tenant_id" -# full URL of Loki ingest endpoint -endpoint="https://loki.url/api/v3/push" -# currently only needed when using public instance -basic_auth_secret="loki-basic-auth" -# only needed for cloud grafana -bearer_token_secret="bearer_token" - -# LogStream will try to shorten Grafana URLs by default (if all 3 variables are set) -[Logging.Grafana] -# grafana url (trailing "/" will be stripped) -base_url="http://grafana.url" -# url of your grafana dashboard (prefix and suffix "/" are stirpped), example: /d/ad61652-2712-1722/my-dashboard -dashboard_url="/d/your-dashboard" -# Grafana dashboard uid to annotate. Find it in Dashboard Settings -> JSON Model -dashboard_uid="dashboard-uid-to-annotate" -bearer_token_secret="my-awesome-token" - # if you want to use polygon_mumbial [Network] selected_networks=["polygon_mumbai"] -[Network.RpcHttpUrls] -polygon_mumbai = ["https://my-rpc-endpoint.io"] - -[Network.RpcWsUrls] -polygon_mumbai = ["https://my-rpc-endpoint.io"] - -[Network.WalletKeys] -polygon_mumbai = ["change-me-to-your-PK"] - [PrivateEthereumNetwork] # pos or pow consensus_type="pos" diff --git a/integration-tests/testconfig/vrfv2/overrides/new_env/arbitrum_sepolia_new_env_test_config.toml b/integration-tests/testconfig/vrfv2/overrides/new_env/arbitrum_sepolia_new_env_test_config.toml new file mode 100644 index 00000000000..9181c0f51fa --- /dev/null +++ b/integration-tests/testconfig/vrfv2/overrides/new_env/arbitrum_sepolia_new_env_test_config.toml @@ -0,0 +1,8 @@ +[Network] +selected_networks = ["ARBITRUM_SEPOLIA"] + +[ARBITRUM_SEPOLIA.VRFv2.General] +use_existing_env = false + +[Logging] +test_log_collect = true diff --git a/integration-tests/testconfig/vrfv2/overrides/new_env/avalanche_fuji_new_env_test_config.toml b/integration-tests/testconfig/vrfv2/overrides/new_env/avalanche_fuji_new_env_test_config.toml new file mode 100644 index 00000000000..cfeaa5a7975 --- /dev/null +++ b/integration-tests/testconfig/vrfv2/overrides/new_env/avalanche_fuji_new_env_test_config.toml @@ -0,0 +1,8 @@ +[Network] +selected_networks = ["AVALANCHE_FUJI"] + +[AVALANCHE_FUJI.VRFv2.General] +use_existing_env = false + +[Logging] +test_log_collect = true diff --git a/integration-tests/testconfig/vrfv2/overrides/new_env/bsc_testnet_new_env_test_config.toml b/integration-tests/testconfig/vrfv2/overrides/new_env/bsc_testnet_new_env_test_config.toml new file mode 100644 index 00000000000..ec938767ec5 --- /dev/null +++ b/integration-tests/testconfig/vrfv2/overrides/new_env/bsc_testnet_new_env_test_config.toml @@ -0,0 +1,8 @@ +[Network] +selected_networks = ["BSC_TESTNET"] + +[BSC_TESTNET.VRFv2.General] +use_existing_env = false + +[Logging] +test_log_collect = true diff --git a/integration-tests/testconfig/vrfv2/overrides/new_env/polygon_amoy_new_env_test_config.toml b/integration-tests/testconfig/vrfv2/overrides/new_env/polygon_amoy_new_env_test_config.toml new file mode 100644 index 00000000000..6331647a883 --- /dev/null +++ b/integration-tests/testconfig/vrfv2/overrides/new_env/polygon_amoy_new_env_test_config.toml @@ -0,0 +1,8 @@ +[Network] +selected_networks = ["POLYGON_AMOY"] + +[POLYGON_AMOY.VRFv2.General] +use_existing_env = false + +[Logging] +test_log_collect = true diff --git a/integration-tests/testconfig/vrfv2/overrides/new_env/sepolia_new_env_test_config.toml b/integration-tests/testconfig/vrfv2/overrides/new_env/sepolia_new_env_test_config.toml new file mode 100644 index 00000000000..591f07e6625 --- /dev/null +++ b/integration-tests/testconfig/vrfv2/overrides/new_env/sepolia_new_env_test_config.toml @@ -0,0 +1,8 @@ +[Network] +selected_networks = ["SEPOLIA"] + +[SEPOLIA.VRFv2.General] +use_existing_env = false + +[Logging] +test_log_collect = true diff --git a/integration-tests/testconfig/vrfv2/overrides/staging/polygon_amoy_staging_test_config.toml b/integration-tests/testconfig/vrfv2/overrides/staging/polygon_amoy_staging_test_config.toml new file mode 100644 index 00000000000..acdff9ff4e1 --- /dev/null +++ b/integration-tests/testconfig/vrfv2/overrides/staging/polygon_amoy_staging_test_config.toml @@ -0,0 +1,24 @@ +[Network] +selected_networks = ["POLYGON_AMOY"] + +[POLYGON_AMOY.VRFv2.General] +use_existing_env = true + +[POLYGON_AMOY.VRFv2.ExistingEnv] +coordinator_address = "0x919BEF67CE94604A7Cd5747F2c0088C8EB8A93aa" +consumer_address = "" +sub_id = "" +key_hash = "0xcd9c54d52db91522b69fe8ddc40d1f78156795de0efb2adbc053a438b9ee14a6" +create_fund_subs_and_add_consumers = true +node_sending_key_funding_min = 10 +node_sending_keys = [ + "0xD4B787C4ce6E04c16b5FDce2c25956b8F4432195", + # BHS + "0x638372de870eF0F8E675A3f67F18D5bd4A2fd804", + "0xF9eF03816411D037202d5ed4457dC1613e3bd729", + "0xCD66973f8fbaE787211EC20228c6bd90D83562A8", + "0x242ea1F4Bb72EF643B2D8EF22e18a89f00742F40", + "0xaA09B4F9B5710b239fdbf1D0f535dd7f86F91219", + "0xe6b72B647B8B45C5562F7a5259E187889C747d3b", + "0x2c1185C4d3B0B4a577d4079Ee193A4e293164D9d" +] diff --git a/integration-tests/testconfig/vrfv2/vrfv2.toml b/integration-tests/testconfig/vrfv2/vrfv2.toml index 011e90c15fd..634e3074feb 100644 --- a/integration-tests/testconfig/vrfv2/vrfv2.toml +++ b/integration-tests/testconfig/vrfv2/vrfv2.toml @@ -19,6 +19,7 @@ MaxSize = '0b' [WebServer] AllowOrigins = '*' HTTPPort = 6688 +HTTPWriteTimeout = '1m0s' SecureCookies = false [WebServer.RateLimit] @@ -113,11 +114,17 @@ bhf_job_run_timeout = "1h" [VRFv2.ExistingEnv] coordinator_address = "" -consumer_address = "" -sub_id = 1 key_hash = "" + +use_existing_wrapper = false +wrapper_address = "" create_fund_subs_and_add_consumers = true -link_address = "" +sub_id = 1 +consumer_address = "" + +create_fund_add_wrapper_consumers = true +wrapper_consumer_address = "" + node_sending_key_funding_min = 10 node_sending_keys = [ "", diff --git a/integration-tests/testconfig/vrfv2plus/config.go b/integration-tests/testconfig/vrfv2plus/config.go index eb5ba061984..4ae5ee5c357 100644 --- a/integration-tests/testconfig/vrfv2plus/config.go +++ b/integration-tests/testconfig/vrfv2plus/config.go @@ -55,6 +55,14 @@ type General struct { CoordinatorGasOverheadLink *uint32 `toml:"coordinator_gas_overhead_link"` CoordinatorNativePremiumPercentage *uint8 `toml:"coordinator_native_premium_percentage"` CoordinatorLinkPremiumPercentage *uint8 `toml:"coordinator_link_premium_percentage"` + + //OP Stack chains settings + L1FeeCalculationMode *uint8 `toml:"l1_fee_calculation_mode"` + L1FeeCoefficient *uint8 `toml:"l1_fee_coefficient"` + + UseTestCoordinator *bool `toml:"use_test_coordinator"` + + SubBillingTolerance *float64 `toml:"sub_billing_tolerance_wei"` } func (c *General) Validate() error { @@ -97,6 +105,9 @@ func (c *General) Validate() error { if c.CoordinatorLinkPremiumPercentage == nil { return errors.New("coordinator_link_premium_percentage must not be nil") } + if c.UseTestCoordinator == nil { + return errors.New("use_test_coordinator must not be nil") + } return nil } diff --git a/integration-tests/testconfig/vrfv2plus/example.toml b/integration-tests/testconfig/vrfv2plus/example.toml index d6e7a3f28d5..160e9ba03a9 100644 --- a/integration-tests/testconfig/vrfv2plus/example.toml +++ b/integration-tests/testconfig/vrfv2plus/example.toml @@ -1,7 +1,6 @@ # Example of full config with all fields # General part [ChainlinkImage] -image="public.ecr.aws/chainlink/chainlink" version="2.7.0" [Logging] @@ -16,38 +15,10 @@ log_producer_timeout="10s" # number of retries before log producer gives up and stops listening to logs log_producer_retry_limit=10 -[Logging.Loki] -tenant_id="tenant_id" -# full URL of Loki ingest endpoint -endpoint="https://loki.url/api/v3/push" -# currently only needed when using public instance -basic_auth_secret="loki-basic-auth" -# only needed for cloud grafana -bearer_token_secret="bearer_token" - -# LogStream will try to shorten Grafana URLs by default (if all 3 variables are set) -[Logging.Grafana] -# grafana url (trailing "/" will be stripped) -base_url="http://grafana.url" -# url of your grafana dashboard (prefix and suffix "/" are stirpped), example: /d/ad61652-2712-1722/my-dashboard -dashboard_url="/d/your-dashboard" -# Grafana dashboard uid to annotate. Find it in Dashboard Settings -> JSON Model -dashboard_uid="dashboard-uid-to-annotate" -bearer_token_secret="my-awesome-token" - # if you want to use polygon_mumbial [Network] selected_networks=["polygon_mumbai"] -[Network.RpcHttpUrls] -polygon_mumbai = ["https://my-rpc-endpoint.io"] - -[Network.RpcWsUrls] -polygon_mumbai = ["https://my-rpc-endpoint.io"] - -[Network.WalletKeys] -polygon_mumbai = ["change-me-to-your-PK"] - [PrivateEthereumNetwork] # pos or pow consensus_type="pos" diff --git a/integration-tests/testconfig/vrfv2plus/overrides/new_env/arbitrum_sepolia_new_env_test_config.toml b/integration-tests/testconfig/vrfv2plus/overrides/new_env/arbitrum_sepolia_new_env_test_config.toml new file mode 100644 index 00000000000..271ef037bd3 --- /dev/null +++ b/integration-tests/testconfig/vrfv2plus/overrides/new_env/arbitrum_sepolia_new_env_test_config.toml @@ -0,0 +1,8 @@ +[Network] +selected_networks = ["ARBITRUM_SEPOLIA"] + +[ARBITRUM_SEPOLIA.VRFv2Plus.General] +use_existing_env = false + +[Logging] +test_log_collect = true diff --git a/integration-tests/testconfig/vrfv2plus/overrides/new_env/avalanche_fuji_new_env_test_config.toml b/integration-tests/testconfig/vrfv2plus/overrides/new_env/avalanche_fuji_new_env_test_config.toml new file mode 100644 index 00000000000..273d796ba6f --- /dev/null +++ b/integration-tests/testconfig/vrfv2plus/overrides/new_env/avalanche_fuji_new_env_test_config.toml @@ -0,0 +1,8 @@ +[Network] +selected_networks = ["AVALANCHE_FUJI"] + +[AVALANCHE_FUJI.VRFv2Plus.General] +use_existing_env = false + +[Logging] +test_log_collect = true diff --git a/integration-tests/testconfig/vrfv2plus/overrides/new_env/base_sepolia_new_env_test_config.toml b/integration-tests/testconfig/vrfv2plus/overrides/new_env/base_sepolia_new_env_test_config.toml new file mode 100644 index 00000000000..f93c75cc380 --- /dev/null +++ b/integration-tests/testconfig/vrfv2plus/overrides/new_env/base_sepolia_new_env_test_config.toml @@ -0,0 +1,8 @@ +[Network] +selected_networks = ["BASE_SEPOLIA"] + +[BASE_SEPOLIA.VRFv2Plus.General] +use_existing_env = false + +[Logging] +test_log_collect = true diff --git a/integration-tests/testconfig/vrfv2plus/overrides/new_env/bsc_testnet_new_env_test_config.toml b/integration-tests/testconfig/vrfv2plus/overrides/new_env/bsc_testnet_new_env_test_config.toml new file mode 100644 index 00000000000..16cc9a6e539 --- /dev/null +++ b/integration-tests/testconfig/vrfv2plus/overrides/new_env/bsc_testnet_new_env_test_config.toml @@ -0,0 +1,8 @@ +[Network] +selected_networks = ["BSC_TESTNET"] + +[BSC_TESTNET.VRFv2Plus.General] +use_existing_env = false + +[Logging] +test_log_collect = true diff --git a/integration-tests/testconfig/vrfv2plus/overrides/new_env/nexon_dev_new_env_test_config.toml b/integration-tests/testconfig/vrfv2plus/overrides/new_env/nexon_dev_new_env_test_config.toml new file mode 100644 index 00000000000..5d7b7741081 --- /dev/null +++ b/integration-tests/testconfig/vrfv2plus/overrides/new_env/nexon_dev_new_env_test_config.toml @@ -0,0 +1,8 @@ +[Network] +selected_networks = ["NEXON_DEV"] + +[NEXON_DEV.VRFv2Plus.General] +use_existing_env = false + +[Logging] +test_log_collect = true diff --git a/integration-tests/testconfig/vrfv2plus/overrides/new_env/nexon_qa_new_env_test_config.toml b/integration-tests/testconfig/vrfv2plus/overrides/new_env/nexon_qa_new_env_test_config.toml new file mode 100644 index 00000000000..0f761128afa --- /dev/null +++ b/integration-tests/testconfig/vrfv2plus/overrides/new_env/nexon_qa_new_env_test_config.toml @@ -0,0 +1,8 @@ +[Network] +selected_networks = ["NEXON_QA"] + +[NEXON_QA.VRFv2Plus.General] +use_existing_env = false + +[Logging] +test_log_collect = true diff --git a/integration-tests/testconfig/vrfv2plus/overrides/new_env/nexon_stage_new_env_test_config.toml b/integration-tests/testconfig/vrfv2plus/overrides/new_env/nexon_stage_new_env_test_config.toml new file mode 100644 index 00000000000..5dcd771e9dd --- /dev/null +++ b/integration-tests/testconfig/vrfv2plus/overrides/new_env/nexon_stage_new_env_test_config.toml @@ -0,0 +1,8 @@ +[Network] +selected_networks = ["NEXON_STAGE"] + +[NEXON_STAGE.VRFv2Plus.General] +use_existing_env = false + +[Logging] +test_log_collect = true diff --git a/integration-tests/testconfig/vrfv2plus/overrides/new_env/nexon_test_new_env_test_config.toml b/integration-tests/testconfig/vrfv2plus/overrides/new_env/nexon_test_new_env_test_config.toml new file mode 100644 index 00000000000..d1263df34d0 --- /dev/null +++ b/integration-tests/testconfig/vrfv2plus/overrides/new_env/nexon_test_new_env_test_config.toml @@ -0,0 +1,8 @@ +[Network] +selected_networks = ["NEXON_TEST"] + +[NEXON_TEST.VRFv2Plus.General] +use_existing_env = false + +[Logging] +test_log_collect = true diff --git a/integration-tests/testconfig/vrfv2plus/overrides/new_env/optimism_sepolia_new_env_test_config.toml b/integration-tests/testconfig/vrfv2plus/overrides/new_env/optimism_sepolia_new_env_test_config.toml new file mode 100644 index 00000000000..8fd5b763796 --- /dev/null +++ b/integration-tests/testconfig/vrfv2plus/overrides/new_env/optimism_sepolia_new_env_test_config.toml @@ -0,0 +1,8 @@ +[Network] +selected_networks = ["OPTIMISM_SEPOLIA"] + +[OPTIMISM_SEPOLIA.VRFv2Plus.General] +use_existing_env = false + +[Logging] +test_log_collect = true diff --git a/integration-tests/testconfig/vrfv2plus/overrides/new_env/polygon_amoy_new_env_test_config.toml b/integration-tests/testconfig/vrfv2plus/overrides/new_env/polygon_amoy_new_env_test_config.toml new file mode 100644 index 00000000000..10abe34bb5e --- /dev/null +++ b/integration-tests/testconfig/vrfv2plus/overrides/new_env/polygon_amoy_new_env_test_config.toml @@ -0,0 +1,8 @@ +[Network] +selected_networks = ["POLYGON_AMOY"] + +[POLYGON_AMOY.VRFv2Plus.General] +use_existing_env = false + +[Logging] +test_log_collect = true diff --git a/integration-tests/testconfig/vrfv2plus/overrides/new_env/sepolia_new_env_test_config.toml b/integration-tests/testconfig/vrfv2plus/overrides/new_env/sepolia_new_env_test_config.toml new file mode 100644 index 00000000000..7df808c505f --- /dev/null +++ b/integration-tests/testconfig/vrfv2plus/overrides/new_env/sepolia_new_env_test_config.toml @@ -0,0 +1,8 @@ +[Network] +selected_networks = ["SEPOLIA"] + +[SEPOLIA.VRFv2Plus.General] +use_existing_env = false + +[Logging] +test_log_collect = true diff --git a/integration-tests/testconfig/vrfv2plus/overrides/new_env/soneium_sepolia_new_env_test_config.toml b/integration-tests/testconfig/vrfv2plus/overrides/new_env/soneium_sepolia_new_env_test_config.toml new file mode 100644 index 00000000000..beacf9c5f7c --- /dev/null +++ b/integration-tests/testconfig/vrfv2plus/overrides/new_env/soneium_sepolia_new_env_test_config.toml @@ -0,0 +1,8 @@ +[Network] +selected_networks = ["SONEIUM_SEPOLIA"] + +[SONEIUM_SEPOLIA.VRFv2Plus.General] +use_existing_env = false + +[Logging] +test_log_collect = true diff --git a/integration-tests/testconfig/vrfv2plus/overrides/staging/arbitrum_sepolia_staging_test_config.toml b/integration-tests/testconfig/vrfv2plus/overrides/staging/arbitrum_sepolia_staging_test_config.toml new file mode 100644 index 00000000000..66529bbed3a --- /dev/null +++ b/integration-tests/testconfig/vrfv2plus/overrides/staging/arbitrum_sepolia_staging_test_config.toml @@ -0,0 +1,36 @@ +[Network] +selected_networks = ["ARBITRUM_SEPOLIA"] + +[ARBITRUM_SEPOLIA.VRFv2Plus.General] +use_existing_env = true + +[ARBITRUM_SEPOLIA.VRFv2Plus.ExistingEnv] +coordinator_address = "0xF7ba1Cf141F9729abC43c146dc2bf86EbcfD8603" +consumer_address = "" +sub_id = "" +key_hash = "0xe13aa26fe94bfcd2ae055911f4d3bf1aed54ca6cf77af34e17f918802fd69ba1" +create_fund_subs_and_add_consumers = true +node_sending_key_funding_min = 20 +node_sending_keys = [ + "0xbE21ae371FcA1aC2d8A152e707D21e68d7d99252", + "0xb13e9BA0aE94FD3b89B13b092e6d41614c805134", + "0x27aa703e585Ee165B7c977EAA652eCFa13b08294", + "0x9324643ACD2ec5b0813488E5EdAb64C3758ae4Ee", + "0x7CBA8c8e86f23f23363051650Fe5AE4DE78c3652", + "0x9A0143a4BAB55A826331A8ef82462557633aA016", + "0xD4259633F8e87949F683433a17e1fFcCE27865AC", + "0x5e47B71d6F95f68cd5538907ec6A9635b1Fe30Fa", + "0xa850a1a257FDF439c8f854ce3b89dd5b6F411827", + "0x7c82D56087c10aF2c3970f9a9Be7786B2850ce91", + "0x9545CB59956347d3debf27f5029754bBE1d398FA", + "0xEb8C69ac19709f27A97FB4A561f51AD2F9b34c5B", + # BHS + "0xf0e8cF7Fbd28Fc4D412B76B744CDA269df671F8e", + "0x317A02A658d12E5Bb4A6270171E7385928dD2d53", + "0x480f1dbcEc118Bd91e4dbb7e45bFa4A73180d21f", + "0x500a2662FaF981EC4669f791349D37Cbf1bE7d85", + "0x2ad350374B904c10B47c64ECdBD9e70BB0833Be2", + "0x0b946F0bF4e63C12b5157137f1c130f0788bC1b1", + # BHF + "0x571BBF4a5b07fc3F47Bd3B65CE2FE73739f86623" +] diff --git a/integration-tests/testconfig/vrfv2plus/overrides/staging/avalanche_fuji_staging_test_config.toml b/integration-tests/testconfig/vrfv2plus/overrides/staging/avalanche_fuji_staging_test_config.toml new file mode 100644 index 00000000000..c8566e59a74 --- /dev/null +++ b/integration-tests/testconfig/vrfv2plus/overrides/staging/avalanche_fuji_staging_test_config.toml @@ -0,0 +1,18 @@ +[Network] +selected_networks = ["AVALANCHE_FUJI"] + +[AVALANCHE_FUJI.VRFv2Plus.General] +use_existing_env = true + +[AVALANCHE_FUJI.VRFv2Plus.ExistingEnv] +coordinator_address = "0xE122bf3Badd6545bDec5D4627a6DAd16352A1b36" +consumer_address = "" +sub_id = "" +key_hash = "0x5b03254a80ea3eb72139ff0423cb88be42612780c3dd25f1d95a5ba7708a4be1" +create_fund_subs_and_add_consumers = true +node_sending_key_funding_min = 30 +node_sending_keys = [ + "0x3D7Da5D6A23CA2240CE576C8638C1798a023920a", + # BHS + "0x72c8565279430F5179b0090d51ab8BB53Da323B5" +] diff --git a/integration-tests/testconfig/vrfv2plus/overrides/staging/base_sepolia_staging_test_config.toml b/integration-tests/testconfig/vrfv2plus/overrides/staging/base_sepolia_staging_test_config.toml new file mode 100644 index 00000000000..ad125ae46b4 --- /dev/null +++ b/integration-tests/testconfig/vrfv2plus/overrides/staging/base_sepolia_staging_test_config.toml @@ -0,0 +1,20 @@ +[Network] +selected_networks = ["BASE_SEPOLIA"] + +[BASE_SEPOLIA.VRFv2Plus.General] +use_existing_env = true + +[BASE_SEPOLIA.VRFv2Plus.ExistingEnv] +coordinator_address = "0x2Cf7Bb5923FA4dBdf92981fDBbEe27d13A896705" +consumer_address = "" +sub_id = "" +key_hash = "0x01d1eb450e0271ac86d3b78c7cc799f80e7f80863a4875f6fc7b66629419c951" +create_fund_subs_and_add_consumers = true +node_sending_key_funding_min = 30 +node_sending_keys = [ + "0x5d621FF993B1a990d189936E70021c585e3B0880", + "0x87F701AD21BfAF99eF64596c5CE8762a5Cb9ED13", + "0xe8B0865e9Aae9DE628BE14965Bbd1C0c9C80d245", + # BHS + "0x65C853683beB6363869DDda8534b2aD45786d380", +] diff --git a/integration-tests/testconfig/vrfv2plus/overrides/staging/bsc_testnet_staging_test_config.toml b/integration-tests/testconfig/vrfv2plus/overrides/staging/bsc_testnet_staging_test_config.toml new file mode 100644 index 00000000000..48060a88cf9 --- /dev/null +++ b/integration-tests/testconfig/vrfv2plus/overrides/staging/bsc_testnet_staging_test_config.toml @@ -0,0 +1,18 @@ +[Network] +selected_networks = ["BSC_TESTNET"] + +[BSC_TESTNET.VRFv2Plus.General] +use_existing_env = true + +[BSC_TESTNET.VRFv2Plus.ExistingEnv] +coordinator_address = "0x84A477F6ebF33501eE3ACA86fEcB980b1fC99AC2" +consumer_address = "" +sub_id = "" +key_hash = "0x4d43763d3eff849a89cf578a42787baa32132d7a80032125710e95b3972cd214" +create_fund_subs_and_add_consumers = true +node_sending_key_funding_min = 30 +node_sending_keys = [ + "0x4EE2Cc6D50E8acb6BaEf673B03559525a6c92fB8", + # BHS + "0xAFB44568f7DAc218EA6e1C71c366692ED4758A07" +] diff --git a/integration-tests/testconfig/vrfv2plus/overrides/staging/nexon_dev_staging_test_config.toml b/integration-tests/testconfig/vrfv2plus/overrides/staging/nexon_dev_staging_test_config.toml new file mode 100644 index 00000000000..0121c025526 --- /dev/null +++ b/integration-tests/testconfig/vrfv2plus/overrides/staging/nexon_dev_staging_test_config.toml @@ -0,0 +1,18 @@ +[Network] +selected_networks = ["NEXON_DEV"] + +[NEXON_DEV.VRFv2Plus.General] +use_existing_env = true + +[NEXON_DEV.VRFv2Plus.ExistingEnv] +coordinator_address = "0x6901d7236A823E7B7911d90FBe46E6FA770CC823" +consumer_address = "" +sub_id = "" +key_hash = "0xdc023892a41e5fe74ec7c4c2e8c0a808b01aea7acaf2b2ae30f4e08df877c48b" +create_fund_subs_and_add_consumers = true +node_sending_key_funding_min = 30 +node_sending_keys = [ + "0xF3d9879a75BBD85890056D7c6cB37C555F9b41A3", + # BHS + "0xb544f9D7c16a30af0EEd0afcC4132D1c63bAF8AC", +] diff --git a/integration-tests/testconfig/vrfv2plus/overrides/staging/nexon_qa_staging_test_config.toml b/integration-tests/testconfig/vrfv2plus/overrides/staging/nexon_qa_staging_test_config.toml new file mode 100644 index 00000000000..f45ecde0ed5 --- /dev/null +++ b/integration-tests/testconfig/vrfv2plus/overrides/staging/nexon_qa_staging_test_config.toml @@ -0,0 +1,20 @@ +[Network] +selected_networks = ["NEXON_QA"] + +[NEXON_QA.VRFv2Plus.General] +use_existing_env = true + +[NEXON_QA.VRFv2Plus.ExistingEnv] +coordinator_address = "0xF1F0beBcc284591FCD28d8f2BAc9f30efdA3E0ea" +consumer_address = "" +sub_id = "" +key_hash = "0x7d5692e71807c4c02f5a109627a9ad2b12a361a346790a306983af9a5e3a186f" +create_fund_subs_and_add_consumers = true +node_sending_key_funding_min = 30 +node_sending_keys = [ + "0xB97c0C52A2B957b45DA213e652c76090DDd0FEc6", + "0xe205F5d4a99ca0f474d0b4d12f60a0153c786B4E", + # BHS + "0xf85E291edF0352435f2fD5e817030f6542375a99", +] + diff --git a/integration-tests/testconfig/vrfv2plus/overrides/staging/nexon_stage_staging_test_config.toml b/integration-tests/testconfig/vrfv2plus/overrides/staging/nexon_stage_staging_test_config.toml new file mode 100644 index 00000000000..1a50876a730 --- /dev/null +++ b/integration-tests/testconfig/vrfv2plus/overrides/staging/nexon_stage_staging_test_config.toml @@ -0,0 +1,15 @@ +[Network] +selected_networks = ["NEXON_STAGE"] + +[NEXON_STAGE.VRFv2Plus.General] +use_existing_env = true + +[NEXON_STAGE.VRFv2Plus.ExistingEnv] +coordinator_address = "0xF705dD3e7E717F32de0Cc5F833f8009f16122AD1" +consumer_address = "" +sub_id = "" +key_hash = "0xbc9f525e3e1d9e2336f7c77d5f33f5b60aab3765944617fed7f66a6afecac616" +create_fund_subs_and_add_consumers = true +node_sending_key_funding_min = 30 +node_sending_keys = [ +] diff --git a/integration-tests/testconfig/vrfv2plus/overrides/staging/nexon_test_staging_test_config.toml b/integration-tests/testconfig/vrfv2plus/overrides/staging/nexon_test_staging_test_config.toml new file mode 100644 index 00000000000..4f897f4e1d0 --- /dev/null +++ b/integration-tests/testconfig/vrfv2plus/overrides/staging/nexon_test_staging_test_config.toml @@ -0,0 +1,19 @@ +[Network] +selected_networks = ["NEXON_TEST"] + +[NEXON_TEST.VRFv2Plus.General] +use_existing_env = true + +[NEXON_TEST.VRFv2Plus.ExistingEnv] +coordinator_address = "0xAa92Ba21168B48195cAdB87cfaB3eB70B2499F55" +consumer_address = "" +sub_id = "" +key_hash = "0x0cb2a18e8b762cb4c8f7b17a6cc02ac7b9d2a3346f048cfd2f5d37677f8747d8" +create_fund_subs_and_add_consumers = true +node_sending_key_funding_min = 30 +node_sending_keys = [ + "0xBFD780Af421e98C35918e10B9d6da7389C3e1D10", + "0xbf6c76024672F233aB8164EC00683e1AE774F6b0", + # BHS + "0x2a3900Ac77de110670E060DBFf4fCbe36c6f8170", +] diff --git a/integration-tests/testconfig/vrfv2plus/overrides/staging/optimism_sepolia_staging_test_config.toml b/integration-tests/testconfig/vrfv2plus/overrides/staging/optimism_sepolia_staging_test_config.toml new file mode 100644 index 00000000000..e44085067cf --- /dev/null +++ b/integration-tests/testconfig/vrfv2plus/overrides/staging/optimism_sepolia_staging_test_config.toml @@ -0,0 +1,20 @@ +[Network] +selected_networks = ["OPTIMISM_SEPOLIA"] + +[OPTIMISM_SEPOLIA.VRFv2Plus.General] +use_existing_env = true + +[OPTIMISM_SEPOLIA.VRFv2Plus.ExistingEnv] +coordinator_address = "0xA4a64A217bE85680e0ebB454CD5BF4A1c274Fc7B" +consumer_address = "" +sub_id = "" +key_hash = "0x4b4838bbf22a7c5a871ada8ceab6ded3c2de6cadc037371146ee70f6435325c1" +create_fund_subs_and_add_consumers = true +node_sending_key_funding_min = 30 +node_sending_keys = [ + "0x17509D615052DE3A81a684755Ec118d62C4e1Cd1", + "0x5118ece61294f4dFf4a1fb63b3f036969516dF0a", + "0x89554391652616ea06a408263b9B2b9a70E87204", + # BHS + "0x8DE6446b5022C68F38CD32d04AA0E3b8F4C1aaB6", +] diff --git a/integration-tests/testconfig/vrfv2plus/overrides/staging/polygon_amoy_staging_test_config.toml b/integration-tests/testconfig/vrfv2plus/overrides/staging/polygon_amoy_staging_test_config.toml new file mode 100644 index 00000000000..d2f9727483e --- /dev/null +++ b/integration-tests/testconfig/vrfv2plus/overrides/staging/polygon_amoy_staging_test_config.toml @@ -0,0 +1,32 @@ +[Network] +selected_networks = ["POLYGON_AMOY"] + +[POLYGON_AMOY.VRFv2Plus.General] +use_existing_env = true + +[POLYGON_AMOY.VRFv2Plus.ExistingEnv] +coordinator_address = "0x7541EbaE23f32B4A1A2e7a8Cbf9da9582767A9B4" +consumer_address = "" +sub_id = "" +key_hash = "0xd360445bacd26df47086ccf255c4f932d297ed8d5c7334b51eed32f61c541601" +#key_hash = "0x2328cbee29e32d0b6662d6df82ff0fea7be300bd310561c92f515c9ee19464f1" +#key_hash = "0x25f4e2d0509f42ec77db5380f3433a89fe623fa75f65d5b398d5f498327be4dd" +create_fund_subs_and_add_consumers = true +node_sending_key_funding_min = 10 +node_sending_keys = [ + "0xD96013C241f1741C35a135321969f92Aae02A12F", + "0x0580E61a5523F5CAAC4968E4f8FE63b59596BdD7", + "0xd15FcEa6a6AA17085930Fbd5647A9F7fD2Ff58b8", + "0xB7277cBb6E7028AE65235b8ee9201AcBb14B11d4", + "0x6D36a1dC1eEd25C75961E989c4d01Cd4453bE465", + "0xd299Cd7C0073b71e620bf8A3bfD50F75c0b49af8", + "0x48BE7BAED0b65776D85DF971fA901c637cFC5e87", + # BHS + "0x638372de870eF0F8E675A3f67F18D5bd4A2fd804", + "0xF9eF03816411D037202d5ed4457dC1613e3bd729", + "0xCD66973f8fbaE787211EC20228c6bd90D83562A8", + "0x242ea1F4Bb72EF643B2D8EF22e18a89f00742F40", + "0xaA09B4F9B5710b239fdbf1D0f535dd7f86F91219", + "0xe6b72B647B8B45C5562F7a5259E187889C747d3b", + "0x2c1185C4d3B0B4a577d4079Ee193A4e293164D9d" +] diff --git a/integration-tests/testconfig/vrfv2plus/overrides/staging/sepolia_staging_test_config.toml b/integration-tests/testconfig/vrfv2plus/overrides/staging/sepolia_staging_test_config.toml new file mode 100644 index 00000000000..fd2e6f0bc1d --- /dev/null +++ b/integration-tests/testconfig/vrfv2plus/overrides/staging/sepolia_staging_test_config.toml @@ -0,0 +1,18 @@ +[Network] +selected_networks = ["SEPOLIA"] + +[SEPOLIA.VRFv2Plus.General] +use_existing_env = true + +[SEPOLIA.VRFv2Plus.ExistingEnv] +coordinator_address = "0x2F3b892710523Ee9A85c3155a42089fFe99Ca31e" +consumer_address = "" +sub_id = "" +key_hash = "0xf5b4a359df0598eef89872ea2170f2afa844dbf74b417e6d44d4bda9420aceb2" +create_fund_subs_and_add_consumers = true +node_sending_key_funding_min = 30 +node_sending_keys = [ + "0x0c0DC7f33A1256f0247c5ea75861d385fa5FED31", + # BHS + "0xEd8A4b792d16484f6c9B4df1e721e8280925Db80", +] diff --git a/integration-tests/testconfig/vrfv2plus/overrides/staging/soneium_sepolia_staging_test_config.toml b/integration-tests/testconfig/vrfv2plus/overrides/staging/soneium_sepolia_staging_test_config.toml new file mode 100644 index 00000000000..df973d87022 --- /dev/null +++ b/integration-tests/testconfig/vrfv2plus/overrides/staging/soneium_sepolia_staging_test_config.toml @@ -0,0 +1,20 @@ +[Network] +selected_networks = ["SONEIUM_SEPOLIA"] + +[SONEIUM_SEPOLIA.VRFv2Plus.General] +use_existing_env = true + +[SONEIUM_SEPOLIA.VRFv2Plus.ExistingEnv] +coordinator_address = "0x81e211D679231615C2601E82B658Bde449AF240f" +consumer_address = "" +use_existing_wrapper = true +wrapper_address = "0xD06CfcDAa6f32BB131e693F99f502ac31588CBC8" +sub_id = "" +key_hash = "0x9552c9542c079db4f8c6867e27f6c4780e3e24d895cb0890ca9984764dbe7200" +create_fund_subs_and_add_consumers = true +node_sending_key_funding_min = 1 +node_sending_keys = [ + "0x22643FcF2018ac636477CFE19Ed17071FF7A5cA0", + # BHS + "0xD012B272E8ec6eA7A3373E340Ead52FA2C7352ea", +] diff --git a/integration-tests/testconfig/vrfv2plus/vrfv2plus.toml b/integration-tests/testconfig/vrfv2plus/vrfv2plus.toml index 18837581124..c9f5ac12a81 100644 --- a/integration-tests/testconfig/vrfv2plus/vrfv2plus.toml +++ b/integration-tests/testconfig/vrfv2plus/vrfv2plus.toml @@ -1,4 +1,5 @@ # default config + [NodeConfig] BaseConfigTOML = """ [Feature] @@ -19,6 +20,7 @@ MaxSize = '0b' [WebServer] AllowOrigins = '*' HTTPPort = 6688 +HTTPWriteTimeout = '1m0s' SecureCookies = false [WebServer.RateLimit] @@ -29,7 +31,78 @@ Unauthenticated = 100 HTTPSPort = 0 """ +# Node TOML config depending on the chain [NodeConfig.ChainConfigTOMLByChainID] +# ETHEREUM SEPOLIA +11155111 = """ +BlockBackfillDepth = 500 +MinIncomingConfirmations = 3 + +[GasEstimator] +LimitDefault = 3500000 +""" + +# BNB TESTNET +97 = """ +BlockBackfillDepth = 500 +RPCDefaultBatchSize = 25 +LogBackfillBatchSize = 1000 + +[GasEstimator] +LimitDefault = 3500000 + +[GasEstimator.BlockHistory] +BatchSize = 100 +""" + +# Polygon Amoy +80002 = """ +BlockBackfillDepth = 500 +RPCDefaultBatchSize = 25 +LogBackfillBatchSize = 1000 + +[Transactions] +MaxInFlight = 128 +MaxQueued = 0 + +[GasEstimator] +LimitDefault = 3500000 + +[GasEstimator.BlockHistory] +BatchSize = 100 +""" + +# Avalanche Fuji +43113 = """ +BlockBackfillDepth = 500 +RPCDefaultBatchSize = 25 +LogBackfillBatchSize = 1000 + +[GasEstimator] +LimitDefault = 3500000 + +[GasEstimator.BlockHistory] +BatchSize = 100 +""" + +# Arbitrum Sepolia +# NOTE: PROD env has `LimitDefault = 100_000_000`, but it is decreased in order not to over spend testnet tokens +421614 = """ +BlockBackfillDepth = 15000 +LogBackfillBatchSize = 1000 +RPCDefaultBatchSize = 25 + +[Transactions] +MaxInFlight = 128 +MaxQueued = 0 + +[GasEstimator] +LimitDefault = 3_500_000 + +[GasEstimator.BlockHistory] +BatchSize = 100 +""" + # OPTIMISM SEPOLIA 11155420 = """ BlockBackfillDepth = 500 @@ -52,15 +125,73 @@ RPCDefaultBatchSize = 25 [GasEstimator] LimitDefault = 3500000 +[GasEstimator.BlockHistory] +BatchSize = 100 +""" +# Nexon Staging +847799 = """ +BlockBackfillDepth = 500 +RPCDefaultBatchSize = 25 +LogBackfillBatchSize = 1000 +NoNewHeadsThreshold = '0s' + +[GasEstimator] +LimitDefault = 3500000 + +[GasEstimator.BlockHistory] +BatchSize = 100 +""" + +# Nexon QA +807424 = """ +BlockBackfillDepth = 500 +RPCDefaultBatchSize = 25 +LogBackfillBatchSize = 1000 +NoNewHeadsThreshold = '0s' + +[GasEstimator] +LimitDefault = 3500000 + +[GasEstimator.BlockHistory] +BatchSize = 100 +""" + +# Nexon TEST +595581 = """ +BlockBackfillDepth = 500 +RPCDefaultBatchSize = 25 +LogBackfillBatchSize = 1000 +NoNewHeadsThreshold = '0s' + +[GasEstimator] +LimitDefault = 3500000 + +[GasEstimator.BlockHistory] +BatchSize = 100 +""" + +# Nexon DEV +5668 = """ +BlockBackfillDepth = 500 +RPCDefaultBatchSize = 25 +LogBackfillBatchSize = 1000 +NoNewHeadsThreshold = '0s' + +[GasEstimator] +LimitDefault = 3500000 + [GasEstimator.BlockHistory] BatchSize = 100 """ + [Common] -chainlink_node_funding = 0.5 +chainlink_node_funding = 0.7 [VRFv2Plus] [VRFv2Plus.General] +sub_billing_tolerance_wei = 1e15 +use_test_coordinator = false cancel_subs_after_test_run = true use_existing_env = false #todo - need to have separate minimum_confirmations config for Coordinator, CL Node and Consumer request @@ -97,6 +228,10 @@ fulfillment_flat_fee_link_discount_ppm=0 native_premium_percentage=24 link_premium_percentage=20 +# 0 = L1_GAS_FEES_MODE; 1 = L1_CALLDATA_GAS_COST_MODE; 2 = L1_GAS_FEES_UPPER_BOUND_MODE +l1_fee_calculation_mode = 2 +l1_fee_coefficient = 80 + # Wrapper config wrapped_gas_overhead = 50000 coordinator_gas_overhead_native = 52000 @@ -134,11 +269,17 @@ bhf_job_run_timeout = "1h" [VRFv2Plus.ExistingEnv] coordinator_address = "" -consumer_address = "" -sub_id = "" key_hash = "" + +use_existing_wrapper = false +wrapper_address = "" create_fund_subs_and_add_consumers = true -link_address = "" +sub_id = "" +consumer_address = "" + +create_fund_add_wrapper_consumers = true +wrapper_consumer_address = "" + node_sending_key_funding_min = 1 node_sending_keys = [] @@ -151,19 +292,17 @@ bhs_test_rate_limit_unit_duration = "3s" bhs_test_rps = 1 #SOAK TEST CONFIG -[Soak.Common] -chainlink_node_funding = 0.1 [Soak.VRFv2Plus.General] randomness_request_count_per_request = 4 # amount of randomness requests to make per one TX request randomness_request_count_per_request_deviation = 0 #NOTE - deviation should be less than randomness_request_count_per_request setting number_of_sub_to_create = 1 number_of_sending_keys_to_create = 0 -subscription_funding_amount_link = 50 -subscription_funding_amount_native=10 +subscription_funding_amount_link = 500 +subscription_funding_amount_native = 100 [Soak.VRFv2Plus.Performance] -test_duration = "2m" +test_duration = "2h" rate_limit_unit_duration = "10s" rps = 1 bhs_test_duration = "1m" @@ -195,24 +334,26 @@ bhs_test_rps = 1 chainlink_node_funding = 0.1 [Stress.VRFv2Plus.General] -randomness_request_count_per_request = 3 # amount of randomness requests to make per one TX request -randomness_request_count_per_request_deviation = 2 #NOTE - deviation should be less than randomness_request_count_per_request setting +randomness_request_count_per_request = 30 # amount of randomness requests to make per one TX request +randomness_request_count_per_request_deviation = 0 #NOTE - deviation should be less than randomness_request_count_per_request setting number_of_sub_to_create = 1 number_of_sending_keys_to_create = 0 -subscription_funding_amount_link = 5.0 -subscription_funding_amount_native=1 +subscription_funding_amount_link = 500 +subscription_funding_amount_native=100 [Stress.VRFv2Plus.Performance] -test_duration = "2m" -rate_limit_unit_duration = "3s" +test_duration = "10m" +rate_limit_unit_duration = "10s" rps = 1 bhs_test_duration = "1m" bhs_test_rate_limit_unit_duration = "3s" bhs_test_rps = 1 ### POLYGON AMOY Config - +[POLYGON_AMOY.Common] +chainlink_node_funding = 5 [POLYGON_AMOY.VRFv2Plus.General] +use_test_coordinator = true #todo - need to have separate minimum_confirmations config for Coordinator, CL Node and Consumer request minimum_confirmations = 3 @@ -222,7 +363,7 @@ callback_gas_limit = 1000000 # NEW ENV CONFIG # CL Node config -cl_node_max_gas_price_gwei = 200 +cl_node_max_gas_price_gwei = 500 number_of_sending_keys_to_create = 0 # Coordinator config @@ -260,109 +401,64 @@ bhs_job_poll_period = "2s" bhs_job_run_timeout = "30s" # NEW ENV CONFIG END -[POLYGON_AMOY.VRFv2Plus.ExistingEnv] -coordinator_address = "0x7541EbaE23f32B4A1A2e7a8Cbf9da9582767A9B4" -consumer_address = "" -sub_id = "" -key_hash = "0xd360445bacd26df47086ccf255c4f932d297ed8d5c7334b51eed32f61c541601" -#key_hash = "0x2328cbee29e32d0b6662d6df82ff0fea7be300bd310561c92f515c9ee19464f1" -#key_hash = "0x25f4e2d0509f42ec77db5380f3433a89fe623fa75f65d5b398d5f498327be4dd" -create_fund_subs_and_add_consumers = true -link_address = "0x0Fd9e8d3aF1aaee056EB9e802c3A762a667b1904" -node_sending_key_funding_min = 10 -node_sending_keys = [ - "0xD96013C241f1741C35a135321969f92Aae02A12F", - "0x0580E61a5523F5CAAC4968E4f8FE63b59596BdD7", - "0xd15FcEa6a6AA17085930Fbd5647A9F7fD2Ff58b8", - "0xB7277cBb6E7028AE65235b8ee9201AcBb14B11d4", - "0x6D36a1dC1eEd25C75961E989c4d01Cd4453bE465", - "0xd299Cd7C0073b71e620bf8A3bfD50F75c0b49af8", - "0x48BE7BAED0b65776D85DF971fA901c637cFC5e87", - # BHS - "0x638372de870eF0F8E675A3f67F18D5bd4A2fd804", - "0xF9eF03816411D037202d5ed4457dC1613e3bd729", - "0xCD66973f8fbaE787211EC20228c6bd90D83562A8", - "0x242ea1F4Bb72EF643B2D8EF22e18a89f00742F40", - "0xaA09B4F9B5710b239fdbf1D0f535dd7f86F91219", - "0xe6b72B647B8B45C5562F7a5259E187889C747d3b", - "0x2c1185C4d3B0B4a577d4079Ee193A4e293164D9d" -] - #SMOKE TEST CONFIG [POLYGON_AMOY-Smoke.VRFv2Plus.General] randomness_request_count_per_request = 1 # amount of randomness requests to make per one TX request randomness_request_count_per_request_deviation = 0 #NOTE - deviation should be less than randomness_request_count_per_request setting number_of_sub_to_create = 1 -subscription_funding_amount_link = 5 +subscription_funding_amount_link = 3 subscription_funding_amount_native = 1 -subscription_refunding_amount_link = 5 +subscription_refunding_amount_link = 3 subscription_refunding_amount_native = 1 number_of_words = 1 random_words_fulfilled_event_timeout = "1m30s" wait_for_256_blocks_timeout = "15m" wrapper_consumer_funding_amount_native_token = 1.0 -wrapper_consumer_funding_amount_link = 5 - - -[POLYGON_AMOY-Smoke.VRFv2Plus.Performance] -test_duration = "2s" -rate_limit_unit_duration = "15s" -rps = 1 +wrapper_consumer_funding_amount_link = 3 - -#SOAK TEST CONFIG [POLYGON_AMOY-Soak.VRFv2Plus.General] -randomness_request_count_per_request = 1 # amount of randomness requests to make per one TX request +randomness_request_count_per_request = 4 # amount of randomness requests to make per one TX request randomness_request_count_per_request_deviation = 0 #NOTE - deviation should be less than randomness_request_count_per_request setting number_of_sub_to_create = 1 +number_of_sending_keys_to_create = 0 subscription_funding_amount_link = 500 -subscription_funding_amount_native = 200 +subscription_funding_amount_native = 100 [POLYGON_AMOY-Soak.VRFv2Plus.Performance] -test_duration = "5h" -rate_limit_unit_duration = "3s" -rps = 1 - -# LOAD TEST CONFIG -[POLYGON_AMOY-Load.VRFv2Plus.General] -randomness_request_count_per_request = 3 # amount of randomness requests to make per one TX request -randomness_request_count_per_request_deviation = 2 #NOTE - deviation should be less than randomness_request_count_per_request setting -number_of_sub_to_create = 1 -subscription_funding_amount_link = 300 -subscription_funding_amount_native = 300 - -[POLYGON_AMOY-Load.VRFv2Plus.Performance] -test_duration = "2m" -rate_limit_unit_duration = "3s" +test_duration = "2h" +rate_limit_unit_duration = "10s" rps = 1 - -# STRESS TEST CONFIG [POLYGON_AMOY-Stress.VRFv2Plus.General] -randomness_request_count_per_request = 3 # amount of randomness requests to make per one TX request -randomness_request_count_per_request_deviation = 2 #NOTE - deviation should be less than randomness_request_count_per_request setting +randomness_request_count_per_request = 150 # amount of randomness requests to make per one TX request +randomness_request_count_per_request_deviation = 0 #NOTE - deviation should be less than randomness_request_count_per_request setting number_of_sub_to_create = 1 -subscription_funding_amount_link = 5.0 -subscription_funding_amount_native = 0.1 +number_of_sending_keys_to_create = 0 +subscription_funding_amount_link = 500 +subscription_funding_amount_native=100 [POLYGON_AMOY-Stress.VRFv2Plus.Performance] -test_duration = "2m" -rate_limit_unit_duration = "3s" +test_duration = "10m" +rate_limit_unit_duration = "1m" rps = 1 ### ARBITRUM SEPOLIA Config - [ARBITRUM_SEPOLIA.VRFv2Plus.General] +use_test_coordinator = true #todo - need to have separate minimum_confirmations config for Coordinator, CL Node and Consumer request minimum_confirmations = 0 -subscription_billing_type = "LINK_AND_NATIVE" +## NEW ENV CONFIG +## CL Node config cl_node_max_gas_price_gwei = 50 number_of_sending_keys_to_create = 0 -# Coordinator config +# Consumer Request config +subscription_billing_type = "LINK_AND_NATIVE" callback_gas_limit = 1000000 + +# Coordinator config max_gas_limit_coordinator_config = 2500000 fallback_wei_per_unit_link = "5352799651145251" staleness_seconds = 172_800 @@ -397,37 +493,7 @@ bhs_job_poll_period = "300ms" bhs_job_run_timeout = "30s" # NEW ENV CONFIG END -[ARBITRUM_SEPOLIA.VRFv2Plus.ExistingEnv] -coordinator_address = "0xF7ba1Cf141F9729abC43c146dc2bf86EbcfD8603" -consumer_address = "" -sub_id = "" -key_hash = "0xe13aa26fe94bfcd2ae055911f4d3bf1aed54ca6cf77af34e17f918802fd69ba1" -create_fund_subs_and_add_consumers = true -link_address = "0xb1D4538B4571d411F07960EF2838Ce337FE1E80E" -node_sending_key_funding_min = 20 -node_sending_keys = [ - "0xbE21ae371FcA1aC2d8A152e707D21e68d7d99252", - "0xb13e9BA0aE94FD3b89B13b092e6d41614c805134", - "0x27aa703e585Ee165B7c977EAA652eCFa13b08294", - "0x9324643ACD2ec5b0813488E5EdAb64C3758ae4Ee", - "0x7CBA8c8e86f23f23363051650Fe5AE4DE78c3652", - "0x9A0143a4BAB55A826331A8ef82462557633aA016", - "0xD4259633F8e87949F683433a17e1fFcCE27865AC", - "0x5e47B71d6F95f68cd5538907ec6A9635b1Fe30Fa", - "0xa850a1a257FDF439c8f854ce3b89dd5b6F411827", - "0x7c82D56087c10aF2c3970f9a9Be7786B2850ce91", - "0x9545CB59956347d3debf27f5029754bBE1d398FA", - "0xEb8C69ac19709f27A97FB4A561f51AD2F9b34c5B", - # BHS - "0xf0e8cF7Fbd28Fc4D412B76B744CDA269df671F8e", - "0x317A02A658d12E5Bb4A6270171E7385928dD2d53", - "0x480f1dbcEc118Bd91e4dbb7e45bFa4A73180d21f", - "0x500a2662FaF981EC4669f791349D37Cbf1bE7d85", - "0x2ad350374B904c10B47c64ECdBD9e70BB0833Be2", - "0x0b946F0bF4e63C12b5157137f1c130f0788bC1b1", - # BHF - "0x571BBF4a5b07fc3F47Bd3B65CE2FE73739f86623" -] + #SMOKE TEST CONFIG [ARBITRUM_SEPOLIA-Smoke.VRFv2Plus.General] @@ -436,8 +502,8 @@ randomness_request_count_per_request_deviation = 0 #NOTE - deviation should be l number_of_sub_to_create = 1 subscription_funding_amount_link = 5 subscription_funding_amount_native = 1 -subscription_refunding_amount_link = 20 -subscription_refunding_amount_native = 10 +subscription_refunding_amount_link = 5 +subscription_refunding_amount_native = 1 number_of_words = 1 random_words_fulfilled_event_timeout = "1m30s" wait_for_256_blocks_timeout = "100s" @@ -445,55 +511,37 @@ wait_for_256_blocks_timeout = "100s" wrapper_consumer_funding_amount_native_token = 1.0 wrapper_consumer_funding_amount_link = 5 -[ARBITRUM_SEPOLIA-Smoke.VRFv2Plus.Performance] -test_duration = "1s" -rate_limit_unit_duration = "10s" -rps = 1 - - -#SOAK TEST CONFIG [ARBITRUM_SEPOLIA-Soak.VRFv2Plus.General] randomness_request_count_per_request = 4 # amount of randomness requests to make per one TX request randomness_request_count_per_request_deviation = 0 #NOTE - deviation should be less than randomness_request_count_per_request setting number_of_sub_to_create = 1 -subscription_funding_amount_link = 300 +number_of_sending_keys_to_create = 0 +subscription_funding_amount_link = 500 subscription_funding_amount_native = 100 [ARBITRUM_SEPOLIA-Soak.VRFv2Plus.Performance] -test_duration = "1h" +test_duration = "2h" rate_limit_unit_duration = "10s" rps = 1 -# LOAD TEST CONFIG -[ARBITRUM_SEPOLIA-Load.VRFv2Plus.General] -randomness_request_count_per_request = 1 # amount of randomness requests to make per one TX request -randomness_request_count_per_request_deviation = 0 #NOTE - deviation should be less than randomness_request_count_per_request setting -number_of_sub_to_create = 1 -subscription_funding_amount_link = 100 -subscription_funding_amount_native = 60 - -[ARBITRUM_SEPOLIA-Load.VRFv2Plus.Performance] -test_duration = "30m" -rate_limit_unit_duration = "3s" -rps = 1 - - -# STRESS TEST CONFIG [ARBITRUM_SEPOLIA-Stress.VRFv2Plus.General] -randomness_request_count_per_request = 3 # amount of randomness requests to make per one TX request -randomness_request_count_per_request_deviation = 2 #NOTE - deviation should be less than randomness_request_count_per_request setting +randomness_request_count_per_request = 150 # amount of randomness requests to make per one TX request +randomness_request_count_per_request_deviation = 0 #NOTE - deviation should be less than randomness_request_count_per_request setting number_of_sub_to_create = 1 -subscription_funding_amount_link = 5.0 -subscription_funding_amount_native = 0.1 +number_of_sending_keys_to_create = 0 +subscription_funding_amount_link = 500 +subscription_funding_amount_native=100 [ARBITRUM_SEPOLIA-Stress.VRFv2Plus.Performance] -test_duration = "2m" -rate_limit_unit_duration = "3s" +test_duration = "10m" +rate_limit_unit_duration = "1m" rps = 1 - ### AVALANCHE FUJI Config +[AVALANCHE_FUJI.Common] +chainlink_node_funding = 3 [AVALANCHE_FUJI.VRFv2Plus.General] +use_test_coordinator = true #todo - need to have separate minimum_confirmations config for Coordinator, CL Node and Consumer request minimum_confirmations = 0 @@ -541,29 +589,15 @@ bhs_job_poll_period = "2s" bhs_job_run_timeout = "30s" # NEW ENV CONFIG END -[AVALANCHE_FUJI.VRFv2Plus.ExistingEnv] -coordinator_address = "0xE122bf3Badd6545bDec5D4627a6DAd16352A1b36" -consumer_address = "" -sub_id = "" -key_hash = "0x5b03254a80ea3eb72139ff0423cb88be42612780c3dd25f1d95a5ba7708a4be1" -create_fund_subs_and_add_consumers = true -link_address = "0x0b9d5D9136855f6FEc3c0993feE6E9CE8a297846" -node_sending_key_funding_min = 50 -node_sending_keys = [ - "0x3D7Da5D6A23CA2240CE576C8638C1798a023920a", - # BHS - "0x72c8565279430F5179b0090d51ab8BB53Da323B5" -] - #SMOKE TEST CONFIG [AVALANCHE_FUJI-Smoke.VRFv2Plus.General] randomness_request_count_per_request = 1 # amount of randomness requests to make per one TX request randomness_request_count_per_request_deviation = 0 #NOTE - deviation should be less than randomness_request_count_per_request setting number_of_sub_to_create = 1 -subscription_funding_amount_link = 20 -subscription_funding_amount_native = 20 -subscription_refunding_amount_link = 20 -subscription_refunding_amount_native = 20 +subscription_funding_amount_link = 3 +subscription_funding_amount_native = 1 +subscription_refunding_amount_link = 3 +subscription_refunding_amount_native = 1 number_of_words = 1 random_words_fulfilled_event_timeout = "1m30s" wait_for_256_blocks_timeout = "10m" @@ -571,56 +605,39 @@ wait_for_256_blocks_timeout = "10m" wrapper_consumer_funding_amount_native_token = 1.0 wrapper_consumer_funding_amount_link = 5 -[AVALANCHE_FUJI-Smoke.VRFv2Plus.Performance] -test_duration = "2s" -rate_limit_unit_duration = "10s" -rps = 1 - - -#SOAK TEST CONFIG [AVALANCHE_FUJI-Soak.VRFv2Plus.General] -randomness_request_count_per_request = 1 # amount of randomness requests to make per one TX request +randomness_request_count_per_request = 4 # amount of randomness requests to make per one TX request randomness_request_count_per_request_deviation = 0 #NOTE - deviation should be less than randomness_request_count_per_request setting number_of_sub_to_create = 1 -subscription_funding_amount_link = 400 -subscription_funding_amount_native = 200 +number_of_sending_keys_to_create = 0 +subscription_funding_amount_link = 500 +subscription_funding_amount_native = 100 [AVALANCHE_FUJI-Soak.VRFv2Plus.Performance] -test_duration = "5h" -rate_limit_unit_duration = "3s" -rps = 1 - -# LOAD TEST CONFIG -[AVALANCHE_FUJI-Load.VRFv2Plus.General] -randomness_request_count_per_request = 3 # amount of randomness requests to make per one TX request -randomness_request_count_per_request_deviation = 2 #NOTE - deviation should be less than randomness_request_count_per_request setting -number_of_sub_to_create = 1 -subscription_funding_amount_link = 300 -subscription_funding_amount_native = 300 - -[AVALANCHE_FUJI-Load.VRFv2Plus.Performance] -test_duration = "2m" -rate_limit_unit_duration = "3s" +test_duration = "2h" +rate_limit_unit_duration = "10s" rps = 1 - -# STRESS TEST CONFIG [AVALANCHE_FUJI-Stress.VRFv2Plus.General] -randomness_request_count_per_request = 3 # amount of randomness requests to make per one TX request -randomness_request_count_per_request_deviation = 2 #NOTE - deviation should be less than randomness_request_count_per_request setting +randomness_request_count_per_request = 60 # amount of randomness requests to make per one TX request +randomness_request_count_per_request_deviation = 0 #NOTE - deviation should be less than randomness_request_count_per_request setting number_of_sub_to_create = 1 -subscription_funding_amount_link = 5.0 -subscription_funding_amount_native = 0.1 +number_of_sending_keys_to_create = 0 +subscription_funding_amount_link = 500 +subscription_funding_amount_native=100 [AVALANCHE_FUJI-Stress.VRFv2Plus.Performance] -test_duration = "2m" -rate_limit_unit_duration = "3s" +test_duration = "10m" +rate_limit_unit_duration = "1m" rps = 1 -### ETH SEPOLIA Config -[SEPOLIA.VRFv2Plus.General] +### BASE SEPOLIA Config +[BASE_SEPOLIA.Common] +chainlink_node_funding = 5 +[BASE_SEPOLIA.VRFv2Plus.General] +use_test_coordinator = false #todo - need to have separate minimum_confirmations config for Coordinator, CL Node and Consumer request -minimum_confirmations = 3 +minimum_confirmations = 0 # Consumer Request config subscription_billing_type = "LINK_AND_NATIVE" @@ -628,120 +645,373 @@ callback_gas_limit = 1000000 # NEW ENV CONFIG # CL Node config -cl_node_max_gas_price_gwei = 100 +cl_node_max_gas_price_gwei = 30 number_of_sending_keys_to_create = 0 # Coordinator config max_gas_limit_coordinator_config = 2500000 -fallback_wei_per_unit_link = "5354747932930759" +fallback_wei_per_unit_link = "3962147213857640" staleness_seconds = 172_800 -gas_after_payment_calculation = 38_900 +gas_after_payment_calculation = 42_500 fulfillment_flat_fee_native_ppm = 0 fulfillment_flat_fee_link_discount_ppm = 0 -native_premium_percentage = 24 -link_premium_percentage = 20 +native_premium_percentage = 60 +link_premium_percentage = 50 # Wrapper config wrapped_gas_overhead = 13_400 -coordinator_gas_overhead_native = 90_000 -coordinator_gas_overhead_link = 112_000 +coordinator_gas_overhead_native = 128_500 +coordinator_gas_overhead_link = 150_400 coordinator_gas_overhead_per_word = 435 -coordinator_native_premium_percentage = 24 -coordinator_link_premium_percentage = 20 +coordinator_native_premium_percentage = 60 +coordinator_link_premium_percentage = 50 wrapper_max_number_of_words = 10 # VRF Job config vrf_job_forwarding_allowed = false vrf_job_estimate_gas_multiplier = 1.15 -vrf_job_batch_fulfillment_enabled = false +vrf_job_batch_fulfillment_enabled = true vrf_job_batch_fulfillment_gas_multiplier = 1.1 -vrf_job_poll_period = "5s" +vrf_job_poll_period = "2s" vrf_job_request_timeout = "2h0m0s" -vrf_job_simulation_block = "latest" +vrf_job_simulation_block = "pending" # BHS Job config bhs_job_wait_blocks = 30 bhs_job_lookback_blocks = 200 -bhs_job_poll_period = "30s" -bhs_job_run_timeout = "1m0s" +bhs_job_poll_period = "2s" +bhs_job_run_timeout = "30s" # NEW ENV CONFIG END -[SEPOLIA.VRFv2Plus.ExistingEnv] -coordinator_address = "0x2F3b892710523Ee9A85c3155a42089fFe99Ca31e" -consumer_address = "" -sub_id = "" -key_hash = "0xf5b4a359df0598eef89872ea2170f2afa844dbf74b417e6d44d4bda9420aceb2" -create_fund_subs_and_add_consumers = true -link_address = "0x779877A7B0D9E8603169DdbD7836e478b4624789" -node_sending_key_funding_min = 50 -node_sending_keys = [ - "0x0c0DC7f33A1256f0247c5ea75861d385fa5FED31", - # BHS - "0xEd8A4b792d16484f6c9B4df1e721e8280925Db80", -] +#SMOKE TEST CONFIG +[BASE_SEPOLIA-Smoke.VRFv2Plus.General] +randomness_request_count_per_request = 1 # amount of randomness requests to make per one TX request +randomness_request_count_per_request_deviation = 0 #NOTE - deviation should be less than randomness_request_count_per_request setting +number_of_sub_to_create = 1 +subscription_funding_amount_link = 3 +subscription_funding_amount_native = 1 +subscription_refunding_amount_link = 3 +subscription_refunding_amount_native = 1 +number_of_words = 1 +random_words_fulfilled_event_timeout = "1m30s" +wait_for_256_blocks_timeout = "10m" + +wrapper_consumer_funding_amount_native_token = 1.0 +wrapper_consumer_funding_amount_link = 5 + +[BASE_SEPOLIA-Soak.VRFv2Plus.General] +randomness_request_count_per_request = 4 # amount of randomness requests to make per one TX request +randomness_request_count_per_request_deviation = 0 #NOTE - deviation should be less than randomness_request_count_per_request setting +number_of_sub_to_create = 1 +number_of_sending_keys_to_create = 0 +subscription_funding_amount_link = 500 +subscription_funding_amount_native = 100 + +[BASE_SEPOLIA-Soak.VRFv2Plus.Performance] +test_duration = "2h" +rate_limit_unit_duration = "10s" +rps = 1 + +[BASE_SEPOLIA-Stress.VRFv2Plus.General] +randomness_request_count_per_request = 60 # amount of randomness requests to make per one TX request +randomness_request_count_per_request_deviation = 0 #NOTE - deviation should be less than randomness_request_count_per_request setting +number_of_sub_to_create = 1 +number_of_sending_keys_to_create = 0 +subscription_funding_amount_link = 500 +subscription_funding_amount_native=100 + +[BASE_SEPOLIA-Stress.VRFv2Plus.Performance] +test_duration = "10m" +rate_limit_unit_duration = "1m" +rps = 1 + + +### OPTIMISM SEPOLIA Config +[OPTIMISM_SEPOLIA.Common] +chainlink_node_funding = 5 +[OPTIMISM_SEPOLIA.VRFv2Plus.General] +sub_billing_tolerance_wei = 1e16 +use_test_coordinator = false +#todo - need to have separate minimum_confirmations config for Coordinator, CL Node and Consumer request +minimum_confirmations = 0 + +# Consumer Request config +subscription_billing_type = "LINK_AND_NATIVE" +callback_gas_limit = 1000000 + +# NEW ENV CONFIG +# CL Node config +cl_node_max_gas_price_gwei = 30 +number_of_sending_keys_to_create = 0 + +# Coordinator config +max_gas_limit_coordinator_config = 2500000 +fallback_wei_per_unit_link = "3896881047706782" +staleness_seconds = 172_800 +gas_after_payment_calculation = 42_500 +fulfillment_flat_fee_native_ppm = 0 +fulfillment_flat_fee_link_discount_ppm = 0 +native_premium_percentage = 60 +link_premium_percentage = 50 + +# Wrapper config +wrapped_gas_overhead = 13_400 +coordinator_gas_overhead_native = 128_500 +coordinator_gas_overhead_link = 150_400 +coordinator_gas_overhead_per_word = 435 +coordinator_native_premium_percentage = 60 +coordinator_link_premium_percentage = 50 +wrapper_max_number_of_words = 10 + +# VRF Job config +vrf_job_forwarding_allowed = false +vrf_job_estimate_gas_multiplier = 1.15 +vrf_job_batch_fulfillment_enabled = true +vrf_job_batch_fulfillment_gas_multiplier = 1.1 +vrf_job_poll_period = "2s" +vrf_job_request_timeout = "2h0m0s" +vrf_job_simulation_block = "pending" + +# BHS Job config +bhs_job_wait_blocks = 30 +bhs_job_lookback_blocks = 200 +bhs_job_poll_period = "2s" +bhs_job_run_timeout = "30s" +# NEW ENV CONFIG END #SMOKE TEST CONFIG -[SEPOLIA-Smoke.VRFv2Plus.General] +[OPTIMISM_SEPOLIA-Smoke.VRFv2Plus.General] randomness_request_count_per_request = 1 # amount of randomness requests to make per one TX request randomness_request_count_per_request_deviation = 0 #NOTE - deviation should be less than randomness_request_count_per_request setting number_of_sub_to_create = 1 -subscription_funding_amount_link = 5 +subscription_funding_amount_link = 10 subscription_funding_amount_native = 1 -subscription_refunding_amount_link = 5 +subscription_refunding_amount_link = 10 subscription_refunding_amount_native = 1 number_of_words = 1 random_words_fulfilled_event_timeout = "1m30s" -wait_for_256_blocks_timeout = "70m" +wait_for_256_blocks_timeout = "10m" wrapper_consumer_funding_amount_native_token = 1.0 wrapper_consumer_funding_amount_link = 5 -[SEPOLIA-Smoke.VRFv2Plus.Performance] -test_duration = "2s" -rate_limit_unit_duration = "3s" +[OPTIMISM_SEPOLIA-Soak.VRFv2Plus.General] +randomness_request_count_per_request = 4 # amount of randomness requests to make per one TX request +randomness_request_count_per_request_deviation = 0 #NOTE - deviation should be less than randomness_request_count_per_request setting +number_of_sub_to_create = 1 +number_of_sending_keys_to_create = 0 +subscription_funding_amount_link = 500 +subscription_funding_amount_native = 100 + +[OPTIMISM_SEPOLIA-Soak.VRFv2Plus.Performance] +test_duration = "2h" +rate_limit_unit_duration = "10s" rps = 1 -#SOAK TEST CONFIG -[SEPOLIA-Soak.VRFv2Plus.General] +[OPTIMISM_SEPOLIA-Stress.VRFv2Plus.General] +randomness_request_count_per_request = 60 # amount of randomness requests to make per one TX request +randomness_request_count_per_request_deviation = 0 #NOTE - deviation should be less than randomness_request_count_per_request setting +number_of_sub_to_create = 1 +number_of_sending_keys_to_create = 0 +subscription_funding_amount_link = 500 +subscription_funding_amount_native=100 + +[OPTIMISM_SEPOLIA-Stress.VRFv2Plus.Performance] +test_duration = "10m" +rate_limit_unit_duration = "1m" +rps = 1 + + +### SONEIUM SEPOLIA Config +[SONEIUM_SEPOLIA.Common] +chainlink_node_funding = 5 +[SONEIUM_SEPOLIA.VRFv2Plus.General] +use_test_coordinator = false +#todo - need to have separate minimum_confirmations config for Coordinator, CL Node and Consumer request +minimum_confirmations = 0 + +# Consumer Request config +subscription_billing_type = "LINK_AND_NATIVE" +callback_gas_limit = 1000000 + +# NEW ENV CONFIG +# CL Node config +cl_node_max_gas_price_gwei = 30 +number_of_sending_keys_to_create = 0 + +# Coordinator config +max_gas_limit_coordinator_config = 2500000 +fallback_wei_per_unit_link = "4619667900000000" +staleness_seconds = 172_800 +gas_after_payment_calculation = 42_500 +fulfillment_flat_fee_native_ppm = 0 +fulfillment_flat_fee_link_discount_ppm = 0 +native_premium_percentage = 60 +link_premium_percentage = 50 + +# Wrapper config +wrapped_gas_overhead = 13_400 +coordinator_gas_overhead_native = 128_500 +coordinator_gas_overhead_link = 150_400 +coordinator_gas_overhead_per_word = 435 +coordinator_native_premium_percentage = 60 +coordinator_link_premium_percentage = 50 +wrapper_max_number_of_words = 10 + +# VRF Job config +vrf_job_forwarding_allowed = false +vrf_job_estimate_gas_multiplier = 1.15 +vrf_job_batch_fulfillment_enabled = true +vrf_job_batch_fulfillment_gas_multiplier = 1.1 +vrf_job_poll_period = "2s" +vrf_job_request_timeout = "2h0m0s" +vrf_job_simulation_block = "pending" + +# BHS Job config +bhs_job_wait_blocks = 30 +bhs_job_lookback_blocks = 200 +bhs_job_poll_period = "2s" +bhs_job_run_timeout = "30s" +# NEW ENV CONFIG END + +#SMOKE TEST CONFIG +[SONEIUM_SEPOLIA-Smoke.VRFv2Plus.General] randomness_request_count_per_request = 1 # amount of randomness requests to make per one TX request randomness_request_count_per_request_deviation = 0 #NOTE - deviation should be less than randomness_request_count_per_request setting number_of_sub_to_create = 1 +subscription_funding_amount_link = 3 +subscription_funding_amount_native = 1 +subscription_refunding_amount_link = 3 +subscription_refunding_amount_native = 1 +number_of_words = 1 +random_words_fulfilled_event_timeout = "1m30s" +wait_for_256_blocks_timeout = "10m" + +wrapper_consumer_funding_amount_native_token = 1.0 +wrapper_consumer_funding_amount_link = 5 + +[SONEIUM_SEPOLIA-Soak.VRFv2Plus.General] +randomness_request_count_per_request = 4 # amount of randomness requests to make per one TX request +randomness_request_count_per_request_deviation = 0 #NOTE - deviation should be less than randomness_request_count_per_request setting +number_of_sub_to_create = 1 +number_of_sending_keys_to_create = 0 subscription_funding_amount_link = 500 -subscription_funding_amount_native = 200 +subscription_funding_amount_native = 100 -[SEPOLIA-Soak.VRFv2Plus.Performance] +[SONEIUM_SEPOLIA-Soak.VRFv2Plus.Performance] test_duration = "2h" -rate_limit_unit_duration = "3s" +rate_limit_unit_duration = "10s" rps = 1 -# LOAD TEST CONFIG -[SEPOLIA-Load.VRFv2Plus.General] -randomness_request_count_per_request = 3 # amount of randomness requests to make per one TX request -randomness_request_count_per_request_deviation = 2 #NOTE - deviation should be less than randomness_request_count_per_request setting +[SONEIUM_SEPOLIA-Stress.VRFv2Plus.General] +randomness_request_count_per_request = 60 # amount of randomness requests to make per one TX request +randomness_request_count_per_request_deviation = 0 #NOTE - deviation should be less than randomness_request_count_per_request setting number_of_sub_to_create = 1 -subscription_funding_amount_link = 5.0 -subscription_funding_amount_native = 30 +number_of_sending_keys_to_create = 0 +subscription_funding_amount_link = 500 +subscription_funding_amount_native=100 -[SEPOLIA-Load.VRFv2Plus.Performance] -test_duration = "2m" -rate_limit_unit_duration = "3s" +[SONEIUM_SEPOLIA-Stress.VRFv2Plus.Performance] +test_duration = "10m" +rate_limit_unit_duration = "1m" +rps = 1 + + +### ETH SEPOLIA Config +[SEPOLIA.VRFv2Plus.General] +use_test_coordinator = true +#todo - need to have separate minimum_confirmations config for Coordinator, CL Node and Consumer request +minimum_confirmations = 3 + +# Consumer Request config +subscription_billing_type = "LINK_AND_NATIVE" +callback_gas_limit = 1000000 + +# NEW ENV CONFIG +# CL Node config +cl_node_max_gas_price_gwei = 100 +number_of_sending_keys_to_create = 0 + +# Coordinator config +max_gas_limit_coordinator_config = 2500000 +fallback_wei_per_unit_link = "5354747932930759" +staleness_seconds = 172_800 +gas_after_payment_calculation = 38_900 +fulfillment_flat_fee_native_ppm = 0 +fulfillment_flat_fee_link_discount_ppm = 0 +native_premium_percentage = 24 +link_premium_percentage = 20 + +# Wrapper config +wrapped_gas_overhead = 13_400 +coordinator_gas_overhead_native = 90_000 +coordinator_gas_overhead_link = 112_000 +coordinator_gas_overhead_per_word = 435 +coordinator_native_premium_percentage = 24 +coordinator_link_premium_percentage = 20 +wrapper_max_number_of_words = 10 + +# VRF Job config +vrf_job_forwarding_allowed = false +vrf_job_estimate_gas_multiplier = 1.15 +vrf_job_batch_fulfillment_enabled = false +vrf_job_batch_fulfillment_gas_multiplier = 1.1 +vrf_job_poll_period = "5s" +vrf_job_request_timeout = "2h0m0s" +vrf_job_simulation_block = "latest" + +# BHS Job config +bhs_job_wait_blocks = 30 +bhs_job_lookback_blocks = 200 +bhs_job_poll_period = "30s" +bhs_job_run_timeout = "1m0s" +# NEW ENV CONFIG END + +#SMOKE TEST CONFIG +[SEPOLIA-Smoke.VRFv2Plus.General] +randomness_request_count_per_request = 1 # amount of randomness requests to make per one TX request +randomness_request_count_per_request_deviation = 0 #NOTE - deviation should be less than randomness_request_count_per_request setting +number_of_sub_to_create = 1 +subscription_funding_amount_link = 3 +subscription_funding_amount_native = 1 +subscription_refunding_amount_link = 3 +subscription_refunding_amount_native = 1 +number_of_words = 1 +random_words_fulfilled_event_timeout = "1m30s" +wait_for_256_blocks_timeout = "70m" + +wrapper_consumer_funding_amount_native_token = 1.0 +wrapper_consumer_funding_amount_link = 3 + +[SEPOLIA-Soak.VRFv2Plus.General] +randomness_request_count_per_request = 4 # amount of randomness requests to make per one TX request +randomness_request_count_per_request_deviation = 0 #NOTE - deviation should be less than randomness_request_count_per_request setting +number_of_sub_to_create = 1 +number_of_sending_keys_to_create = 0 +subscription_funding_amount_link = 500 +subscription_funding_amount_native = 100 + +[SEPOLIA-Soak.VRFv2Plus.Performance] +test_duration = "2h" +rate_limit_unit_duration = "10s" rps = 1 -# STRESS TEST CONFIG [SEPOLIA-Stress.VRFv2Plus.General] -randomness_request_count_per_request = 3 # amount of randomness requests to make per one TX request -randomness_request_count_per_request_deviation = 2 #NOTE - deviation should be less than randomness_request_count_per_request setting +randomness_request_count_per_request = 30 # amount of randomness requests to make per one TX request +randomness_request_count_per_request_deviation = 0 #NOTE - deviation should be less than randomness_request_count_per_request setting number_of_sub_to_create = 1 -subscription_funding_amount_link = 5.0 -subscription_funding_amount_native = 0.1 +number_of_sending_keys_to_create = 0 +subscription_funding_amount_link = 500 +subscription_funding_amount_native=100 [SEPOLIA-Stress.VRFv2Plus.Performance] -test_duration = "2m" -rate_limit_unit_duration = "3s" +test_duration = "10m" +rate_limit_unit_duration = "1m" rps = 1 -### BSC SEPOLIA Config +### BSC TESTNET Config [BSC_TESTNET.VRFv2Plus.General] +use_test_coordinator = true #todo - need to have separate minimum_confirmations config for Coordinator, CL Node and Consumer request minimum_confirmations = 3 @@ -789,77 +1059,51 @@ bhs_job_poll_period = "2s" bhs_job_run_timeout = "30s" # NEW ENV CONFIG END -[BSC_TESTNET.VRFv2Plus.ExistingEnv] -coordinator_address = "0x84A477F6ebF33501eE3ACA86fEcB980b1fC99AC2" -consumer_address = "" -sub_id = "" -key_hash = "0x4d43763d3eff849a89cf578a42787baa32132d7a80032125710e95b3972cd214" -create_fund_subs_and_add_consumers = true -link_address = "0x84b9B910527Ad5C03A9Ca831909E21e236EA7b06" -node_sending_key_funding_min = 150 -node_sending_keys = [ - "0x4EE2Cc6D50E8acb6BaEf673B03559525a6c92fB8", - # BHS - "0xAFB44568f7DAc218EA6e1C71c366692ED4758A07" -] - #SMOKE TEST CONFIG [BSC_TESTNET-Smoke.VRFv2Plus.General] randomness_request_count_per_request = 1 # amount of randomness requests to make per one TX request randomness_request_count_per_request_deviation = 0 #NOTE - deviation should be less than randomness_request_count_per_request setting number_of_sub_to_create = 1 -subscription_funding_amount_link = 10 -subscription_funding_amount_native = 10 - -[BSC_TESTNET-Smoke.VRFv2Plus.Performance] -test_duration = "15s" -rate_limit_unit_duration = "3s" -rps = 1 +subscription_funding_amount_link = 3 +subscription_funding_amount_native = 1 +subscription_refunding_amount_link = 3 +subscription_refunding_amount_native = 1 +number_of_words = 1 +random_words_fulfilled_event_timeout = "1m30s" +wait_for_256_blocks_timeout = "15m" +wrapper_consumer_funding_amount_native_token = 1.0 +wrapper_consumer_funding_amount_link = 5 -#SOAK TEST CONFIG [BSC_TESTNET-Soak.VRFv2Plus.General] -randomness_request_count_per_request = 1 # amount of randomness requests to make per one TX request +randomness_request_count_per_request = 4 # amount of randomness requests to make per one TX request randomness_request_count_per_request_deviation = 0 #NOTE - deviation should be less than randomness_request_count_per_request setting number_of_sub_to_create = 1 -subscription_funding_amount_link = 400 -subscription_funding_amount_native = 200 +number_of_sending_keys_to_create = 0 +subscription_funding_amount_link = 500 +subscription_funding_amount_native = 100 [BSC_TESTNET-Soak.VRFv2Plus.Performance] -test_duration = "5h" -rate_limit_unit_duration = "3s" -rps = 1 - -# LOAD TEST CONFIG -[BSC_TESTNET-Load.VRFv2Plus.General] -randomness_request_count_per_request = 3 # amount of randomness requests to make per one TX request -randomness_request_count_per_request_deviation = 2 #NOTE - deviation should be less than randomness_request_count_per_request setting -number_of_sub_to_create = 1 -subscription_funding_amount_link = 300 -subscription_funding_amount_native = 300 - -[BSC_TESTNET-Load.VRFv2Plus.Performance] -test_duration = "2m" -rate_limit_unit_duration = "3s" +test_duration = "2h" +rate_limit_unit_duration = "10s" rps = 1 - -# STRESS TEST CONFIG [BSC_TESTNET-Stress.VRFv2Plus.General] -randomness_request_count_per_request = 3 # amount of randomness requests to make per one TX request -randomness_request_count_per_request_deviation = 2 #NOTE - deviation should be less than randomness_request_count_per_request setting +randomness_request_count_per_request = 60 # amount of randomness requests to make per one TX request +randomness_request_count_per_request_deviation = 0 #NOTE - deviation should be less than randomness_request_count_per_request setting number_of_sub_to_create = 1 -subscription_funding_amount_link = 5.0 -subscription_funding_amount_native = 0.1 +number_of_sending_keys_to_create = 0 +subscription_funding_amount_link = 500 +subscription_funding_amount_native=100 [BSC_TESTNET-Stress.VRFv2Plus.Performance] -test_duration = "2m" -rate_limit_unit_duration = "3s" +test_duration = "10m" +rate_limit_unit_duration = "1m" rps = 1 - ### NEXON QA Config [NEXON_QA.VRFv2Plus.General] +use_test_coordinator = true #todo - need to have separate minimum_confirmations config for Coordinator, CL Node and Consumer request minimum_confirmations = 0 generate_txs_on_chain = true @@ -868,21 +1112,6 @@ generate_txs_on_chain = true subscription_billing_type = "LINK_AND_NATIVE" callback_gas_limit = 1000000 -[NEXON_QA.VRFv2Plus.ExistingEnv] -coordinator_address = "0xF1F0beBcc284591FCD28d8f2BAc9f30efdA3E0ea" -consumer_address = "" -sub_id = "" -key_hash = "0x7d5692e71807c4c02f5a109627a9ad2b12a361a346790a306983af9a5e3a186f" -create_fund_subs_and_add_consumers = true -link_address = "0x92Bd61014c5BDc4A43BBbaAEa63d0694BE43ECDd" -node_sending_key_funding_min = 30 -node_sending_keys = [ - "0xB97c0C52A2B957b45DA213e652c76090DDd0FEc6", - "0xe205F5d4a99ca0f474d0b4d12f60a0153c786B4E", - # BHS - "0xf85E291edF0352435f2fD5e817030f6542375a99", -] - #SMOKE TEST CONFIG [NEXON_QA-Smoke.VRFv2Plus.General] randomness_request_count_per_request = 1 # amount of randomness requests to make per one TX request @@ -898,55 +1127,35 @@ wait_for_256_blocks_timeout = "25m" wrapper_consumer_funding_amount_link = 21 wrapper_consumer_funding_amount_native_token = 3 - -[NEXON_QA-Smoke.VRFv2Plus.Performance] -test_duration = "2s" -rate_limit_unit_duration = "3s" -rps = 1 - - -#SOAK TEST CONFIG [NEXON_QA-Soak.VRFv2Plus.General] -randomness_request_count_per_request = 1 # amount of randomness requests to make per one TX request +randomness_request_count_per_request = 4 # amount of randomness requests to make per one TX request randomness_request_count_per_request_deviation = 0 #NOTE - deviation should be less than randomness_request_count_per_request setting number_of_sub_to_create = 1 -subscription_funding_amount_link = 400 -subscription_funding_amount_native = 200 +number_of_sending_keys_to_create = 0 +subscription_funding_amount_link = 500 +subscription_funding_amount_native = 100 [NEXON_QA-Soak.VRFv2Plus.Performance] -test_duration = "5h" -rate_limit_unit_duration = "3s" -rps = 1 - -# LOAD TEST CONFIG -[NEXON_QA-Load.VRFv2Plus.General] -randomness_request_count_per_request = 3 # amount of randomness requests to make per one TX request -randomness_request_count_per_request_deviation = 2 #NOTE - deviation should be less than randomness_request_count_per_request setting -number_of_sub_to_create = 1 -subscription_funding_amount_link = 300 -subscription_funding_amount_native = 300 - -[NEXON_QA-Load.VRFv2Plus.Performance] -test_duration = "2m" -rate_limit_unit_duration = "3s" +test_duration = "2h" +rate_limit_unit_duration = "10s" rps = 1 - -# STRESS TEST CONFIG [NEXON_QA-Stress.VRFv2Plus.General] -randomness_request_count_per_request = 3 # amount of randomness requests to make per one TX request -randomness_request_count_per_request_deviation = 2 #NOTE - deviation should be less than randomness_request_count_per_request setting +randomness_request_count_per_request = 60 # amount of randomness requests to make per one TX request +randomness_request_count_per_request_deviation = 0 #NOTE - deviation should be less than randomness_request_count_per_request setting number_of_sub_to_create = 1 -subscription_funding_amount_link = 5.0 -subscription_funding_amount_native = 2 +number_of_sending_keys_to_create = 0 +subscription_funding_amount_link = 500 +subscription_funding_amount_native=100 [NEXON_QA-Stress.VRFv2Plus.Performance] -test_duration = "2m" -rate_limit_unit_duration = "3s" +test_duration = "10m" +rate_limit_unit_duration = "1m" rps = 1 ### NEXON DEV Config [NEXON_DEV.VRFv2Plus.General] +use_test_coordinator = true #todo - need to have separate minimum_confirmations config for Coordinator, CL Node and Consumer request minimum_confirmations = 0 generate_txs_on_chain = true @@ -955,20 +1164,6 @@ generate_txs_on_chain = true subscription_billing_type = "LINK_AND_NATIVE" callback_gas_limit = 1000000 -[NEXON_DEV.VRFv2Plus.ExistingEnv] -coordinator_address = "0x6901d7236A823E7B7911d90FBe46E6FA770CC823" -consumer_address = "" -sub_id = "" -key_hash = "0xdc023892a41e5fe74ec7c4c2e8c0a808b01aea7acaf2b2ae30f4e08df877c48b" -create_fund_subs_and_add_consumers = true -link_address = "0xE4DDEDb5A220eC218791dC35b1b4D737ba813EE7" -node_sending_key_funding_min = 30 -node_sending_keys = [ - "0xF3d9879a75BBD85890056D7c6cB37C555F9b41A3", - # BHS - "0xb544f9D7c16a30af0EEd0afcC4132D1c63bAF8AC", -] - #SMOKE TEST CONFIG [NEXON_DEV-Smoke.VRFv2Plus.General] randomness_request_count_per_request = 1 # amount of randomness requests to make per one TX request @@ -984,55 +1179,35 @@ wait_for_256_blocks_timeout = "25m" wrapper_consumer_funding_amount_link = 21 wrapper_consumer_funding_amount_native_token = 3 -[NEXON_DEV-Smoke.VRFv2Plus.Performance] -test_duration = "2s" -rate_limit_unit_duration = "3s" -rps = 1 - - -#SOAK TEST CONFIG [NEXON_DEV-Soak.VRFv2Plus.General] -randomness_request_count_per_request = 1 # amount of randomness requests to make per one TX request +randomness_request_count_per_request = 4 # amount of randomness requests to make per one TX request randomness_request_count_per_request_deviation = 0 #NOTE - deviation should be less than randomness_request_count_per_request setting number_of_sub_to_create = 1 -subscription_funding_amount_link = 400 -subscription_funding_amount_native = 200 +number_of_sending_keys_to_create = 0 +subscription_funding_amount_link = 500 +subscription_funding_amount_native = 100 [NEXON_DEV-Soak.VRFv2Plus.Performance] -test_duration = "5h" -rate_limit_unit_duration = "3s" -rps = 1 - -# LOAD TEST CONFIG -[NEXON_DEV-Load.VRFv2Plus.General] -randomness_request_count_per_request = 3 # amount of randomness requests to make per one TX request -randomness_request_count_per_request_deviation = 2 #NOTE - deviation should be less than randomness_request_count_per_request setting -number_of_sub_to_create = 1 -subscription_funding_amount_link = 300 -subscription_funding_amount_native = 300 - -[NEXON_DEV-Load.VRFv2Plus.Performance] -test_duration = "2m" -rate_limit_unit_duration = "3s" +test_duration = "2h" +rate_limit_unit_duration = "10s" rps = 1 - -# STRESS TEST CONFIG [NEXON_DEV-Stress.VRFv2Plus.General] -randomness_request_count_per_request = 3 # amount of randomness requests to make per one TX request -randomness_request_count_per_request_deviation = 2 #NOTE - deviation should be less than randomness_request_count_per_request setting +randomness_request_count_per_request = 60 # amount of randomness requests to make per one TX request +randomness_request_count_per_request_deviation = 0 #NOTE - deviation should be less than randomness_request_count_per_request setting number_of_sub_to_create = 1 -subscription_funding_amount_link = 5.0 -subscription_funding_amount_native = 0.1 +number_of_sending_keys_to_create = 0 +subscription_funding_amount_link = 500 +subscription_funding_amount_native=100 [NEXON_DEV-Stress.VRFv2Plus.Performance] -test_duration = "2m" -rate_limit_unit_duration = "3s" +test_duration = "10m" +rate_limit_unit_duration = "1m" rps = 1 - ### NEXON TEST Config [NEXON_TEST.VRFv2Plus.General] +use_test_coordinator = true #todo - need to have separate minimum_confirmations config for Coordinator, CL Node and Consumer request minimum_confirmations = 0 generate_txs_on_chain = true @@ -1041,20 +1216,6 @@ generate_txs_on_chain = true subscription_billing_type = "LINK_AND_NATIVE" callback_gas_limit = 1000000 -[NEXON_TEST.VRFv2Plus.ExistingEnv] -coordinator_address = "0xAa92Ba21168B48195cAdB87cfaB3eB70B2499F55" -consumer_address = "" -sub_id = "" -key_hash = "0x0cb2a18e8b762cb4c8f7b17a6cc02ac7b9d2a3346f048cfd2f5d37677f8747d8" -create_fund_subs_and_add_consumers = true -link_address = "0xD694472F1CD02E1f3fc3534386bda6802fCFe0f7" -node_sending_key_funding_min = 30 -node_sending_keys = [ - "0xBFD780Af421e98C35918e10B9d6da7389C3e1D10", - "0xbf6c76024672F233aB8164EC00683e1AE774F6b0", - # BHS - "0x2a3900Ac77de110670E060DBFf4fCbe36c6f8170", -] #SMOKE TEST CONFIG [NEXON_TEST-Smoke.VRFv2Plus.General] @@ -1071,55 +1232,36 @@ wait_for_256_blocks_timeout = "25m" wrapper_consumer_funding_amount_link = 5 wrapper_consumer_funding_amount_native_token = 3 -[NEXON_TEST-Smoke.VRFv2Plus.Performance] -test_duration = "2s" -rate_limit_unit_duration = "3s" -rps = 1 - - -#SOAK TEST CONFIG [NEXON_TEST-Soak.VRFv2Plus.General] -randomness_request_count_per_request = 1 # amount of randomness requests to make per one TX request +randomness_request_count_per_request = 4 # amount of randomness requests to make per one TX request randomness_request_count_per_request_deviation = 0 #NOTE - deviation should be less than randomness_request_count_per_request setting number_of_sub_to_create = 1 -subscription_funding_amount_link = 400 -subscription_funding_amount_native = 200 +number_of_sending_keys_to_create = 0 +subscription_funding_amount_link = 500 +subscription_funding_amount_native = 100 [NEXON_TEST-Soak.VRFv2Plus.Performance] -test_duration = "5h" -rate_limit_unit_duration = "3s" -rps = 1 - -# LOAD TEST CONFIG -[NEXON_TEST-Load.VRFv2Plus.General] -randomness_request_count_per_request = 3 # amount of randomness requests to make per one TX request -randomness_request_count_per_request_deviation = 2 #NOTE - deviation should be less than randomness_request_count_per_request setting -number_of_sub_to_create = 1 -subscription_funding_amount_link = 300 -subscription_funding_amount_native = 300 - -[NEXON_TEST-Load.VRFv2Plus.Performance] -test_duration = "2m" -rate_limit_unit_duration = "3s" +test_duration = "2h" +rate_limit_unit_duration = "10s" rps = 1 - -# STRESS TEST CONFIG [NEXON_TEST-Stress.VRFv2Plus.General] -randomness_request_count_per_request = 3 # amount of randomness requests to make per one TX request -randomness_request_count_per_request_deviation = 2 #NOTE - deviation should be less than randomness_request_count_per_request setting +randomness_request_count_per_request = 60 # amount of randomness requests to make per one TX request +randomness_request_count_per_request_deviation = 0 #NOTE - deviation should be less than randomness_request_count_per_request setting number_of_sub_to_create = 1 -subscription_funding_amount_link = 5.0 -subscription_funding_amount_native = 0.1 +number_of_sending_keys_to_create = 0 +subscription_funding_amount_link = 500 +subscription_funding_amount_native=100 [NEXON_TEST-Stress.VRFv2Plus.Performance] -test_duration = "2m" -rate_limit_unit_duration = "3s" +test_duration = "10m" +rate_limit_unit_duration = "1m" rps = 1 ### NEXON STAGE Config [NEXON_STAGE.VRFv2Plus.General] +use_test_coordinator = true #todo - need to have separate minimum_confirmations config for Coordinator, CL Node and Consumer request minimum_confirmations = 0 generate_txs_on_chain = true @@ -1128,16 +1270,6 @@ generate_txs_on_chain = true subscription_billing_type = "LINK_AND_NATIVE" callback_gas_limit = 1000000 -[NEXON_STAGE.VRFv2Plus.ExistingEnv] -coordinator_address = "0xF705dD3e7E717F32de0Cc5F833f8009f16122AD1" -consumer_address = "" -sub_id = "" -key_hash = "0xbc9f525e3e1d9e2336f7c77d5f33f5b60aab3765944617fed7f66a6afecac616" -create_fund_subs_and_add_consumers = true -link_address = "0x8E3f5E6dFeb4498437149b0d347ef51427dB1DE2" -node_sending_key_funding_min = 30 -node_sending_keys = [ -] #SMOKE TEST CONFIG [NEXON_STAGE-Smoke.VRFv2Plus.General] @@ -1154,48 +1286,28 @@ wait_for_256_blocks_timeout = "25m" wrapper_consumer_funding_amount_link = 21 wrapper_consumer_funding_amount_native_token = 3 -[NEXON_STAGE-Smoke.VRFv2Plus.Performance] -test_duration = "2s" -rate_limit_unit_duration = "3s" -rps = 1 - - -#SOAK TEST CONFIG [NEXON_STAGE-Soak.VRFv2Plus.General] -randomness_request_count_per_request = 1 # amount of randomness requests to make per one TX request +randomness_request_count_per_request = 4 # amount of randomness requests to make per one TX request randomness_request_count_per_request_deviation = 0 #NOTE - deviation should be less than randomness_request_count_per_request setting number_of_sub_to_create = 1 -subscription_funding_amount_link = 400 -subscription_funding_amount_native = 200 +number_of_sending_keys_to_create = 0 +subscription_funding_amount_link = 500 +subscription_funding_amount_native = 100 [NEXON_STAGE-Soak.VRFv2Plus.Performance] -test_duration = "5h" -rate_limit_unit_duration = "3s" -rps = 1 - -# LOAD TEST CONFIG -[NEXON_STAGE-Load.VRFv2Plus.General] -randomness_request_count_per_request = 3 # amount of randomness requests to make per one TX request -randomness_request_count_per_request_deviation = 2 #NOTE - deviation should be less than randomness_request_count_per_request setting -number_of_sub_to_create = 1 -subscription_funding_amount_link = 300 -subscription_funding_amount_native = 300 - -[NEXON_STAGE-Load.VRFv2Plus.Performance] -test_duration = "2m" -rate_limit_unit_duration = "3s" +test_duration = "2h" +rate_limit_unit_duration = "10s" rps = 1 - -# STRESS TEST CONFIG [NEXON_STAGE-Stress.VRFv2Plus.General] -randomness_request_count_per_request = 3 # amount of randomness requests to make per one TX request -randomness_request_count_per_request_deviation = 2 #NOTE - deviation should be less than randomness_request_count_per_request setting +randomness_request_count_per_request = 60 # amount of randomness requests to make per one TX request +randomness_request_count_per_request_deviation = 0 #NOTE - deviation should be less than randomness_request_count_per_request setting number_of_sub_to_create = 1 -subscription_funding_amount_link = 5.0 -subscription_funding_amount_native = 0.1 +number_of_sending_keys_to_create = 0 +subscription_funding_amount_link = 500 +subscription_funding_amount_native=100 [NEXON_STAGE-Stress.VRFv2Plus.Performance] -test_duration = "2m" -rate_limit_unit_duration = "3s" +test_duration = "10m" +rate_limit_unit_duration = "1m" rps = 1 diff --git a/integration-tests/testreporters/keeper.go b/integration-tests/testreporters/keeper.go index 0861203f314..64e3cfa3d65 100644 --- a/integration-tests/testreporters/keeper.go +++ b/integration-tests/testreporters/keeper.go @@ -13,7 +13,7 @@ import ( "github.com/rs/zerolog/log" "github.com/slack-go/slack" - "github.com/smartcontractkit/chainlink-testing-framework/testreporters" + "github.com/smartcontractkit/chainlink-testing-framework/lib/testreporters" "github.com/smartcontractkit/chainlink/integration-tests/client" ) diff --git a/integration-tests/testreporters/keeper_benchmark.go b/integration-tests/testreporters/keeper_benchmark.go index 6d6221fac89..c85de92493e 100644 --- a/integration-tests/testreporters/keeper_benchmark.go +++ b/integration-tests/testreporters/keeper_benchmark.go @@ -14,7 +14,7 @@ import ( "github.com/rs/zerolog/log" "github.com/slack-go/slack" - "github.com/smartcontractkit/chainlink-testing-framework/testreporters" + "github.com/smartcontractkit/chainlink-testing-framework/lib/testreporters" "github.com/smartcontractkit/chainlink/integration-tests/client" ) diff --git a/integration-tests/testreporters/ocr.go b/integration-tests/testreporters/ocr.go index 9a9c4d0d4a0..89e24fb7965 100644 --- a/integration-tests/testreporters/ocr.go +++ b/integration-tests/testreporters/ocr.go @@ -12,7 +12,7 @@ import ( "github.com/rs/zerolog/log" "github.com/slack-go/slack" - "github.com/smartcontractkit/chainlink-testing-framework/testreporters" + "github.com/smartcontractkit/chainlink-testing-framework/lib/testreporters" ) //TODO: This whole process can definitely be simplified and improved, but for some reason I'm getting brain block at the moment diff --git a/integration-tests/testreporters/profile.go b/integration-tests/testreporters/profile.go index 464cfd685e7..967ae9eaed6 100644 --- a/integration-tests/testreporters/profile.go +++ b/integration-tests/testreporters/profile.go @@ -10,7 +10,7 @@ import ( "github.com/slack-go/slack" "golang.org/x/sync/errgroup" - "github.com/smartcontractkit/chainlink-testing-framework/testreporters" + "github.com/smartcontractkit/chainlink-testing-framework/lib/testreporters" "github.com/smartcontractkit/chainlink/integration-tests/client" ) diff --git a/integration-tests/testreporters/vrfv2.go b/integration-tests/testreporters/vrfv2.go index 5f4e9dcc1fc..ba17859512f 100644 --- a/integration-tests/testreporters/vrfv2.go +++ b/integration-tests/testreporters/vrfv2.go @@ -8,7 +8,7 @@ import ( "github.com/slack-go/slack" - "github.com/smartcontractkit/chainlink-testing-framework/testreporters" + "github.com/smartcontractkit/chainlink-testing-framework/lib/testreporters" "github.com/smartcontractkit/chainlink/integration-tests/types" ) diff --git a/integration-tests/testreporters/vrfv2plus.go b/integration-tests/testreporters/vrfv2plus.go index cb65b0f3d40..b71c0b7d928 100644 --- a/integration-tests/testreporters/vrfv2plus.go +++ b/integration-tests/testreporters/vrfv2plus.go @@ -11,7 +11,7 @@ import ( "github.com/slack-go/slack" - "github.com/smartcontractkit/chainlink-testing-framework/testreporters" + "github.com/smartcontractkit/chainlink-testing-framework/lib/testreporters" ) type VRFV2PlusTestReporter struct { diff --git a/integration-tests/testsetups/automation_benchmark.go b/integration-tests/testsetups/automation_benchmark.go new file mode 100644 index 00000000000..ff8100ea437 --- /dev/null +++ b/integration-tests/testsetups/automation_benchmark.go @@ -0,0 +1,763 @@ +package testsetups + +import ( + "context" + "fmt" + "math" + "math/big" + "os" + "os/signal" + "sync/atomic" + "syscall" + "testing" + "time" + + "github.com/smartcontractkit/chainlink/integration-tests/testconfig" + + "github.com/smartcontractkit/chainlink/integration-tests/actions/automationv2" + + geth "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/core/types" + "github.com/pkg/errors" + "github.com/rs/zerolog" + "github.com/rs/zerolog/log" + "github.com/slack-go/slack" + "github.com/stretchr/testify/require" + "golang.org/x/sync/errgroup" + + "github.com/smartcontractkit/chainlink-testing-framework/seth" + + "github.com/smartcontractkit/chainlink-testing-framework/lib/blockchain" + "github.com/smartcontractkit/chainlink-testing-framework/lib/k8s/environment" + "github.com/smartcontractkit/chainlink-testing-framework/lib/logging" + reportModel "github.com/smartcontractkit/chainlink-testing-framework/lib/testreporters" + "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/ptr" + "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/testcontext" + + "github.com/smartcontractkit/chainlink/integration-tests/actions" + "github.com/smartcontractkit/chainlink/integration-tests/client" + "github.com/smartcontractkit/chainlink/integration-tests/contracts" + "github.com/smartcontractkit/chainlink/integration-tests/contracts/ethereum" + autotestconfig "github.com/smartcontractkit/chainlink/integration-tests/testconfig/automation" + "github.com/smartcontractkit/chainlink/integration-tests/testreporters" + tt "github.com/smartcontractkit/chainlink/integration-tests/types" +) + +// KeeperBenchmarkTest builds a test to check that chainlink nodes are able to upkeep a specified amount of Upkeep +// contracts within a certain block time +type KeeperBenchmarkTest struct { + Inputs KeeperBenchmarkTestInputs + TestReporter testreporters.KeeperBenchmarkTestReporter + + t *testing.T + log zerolog.Logger + startingBlock *big.Int + + automationTests []automationv2.AutomationTest + keeperRegistries []contracts.KeeperRegistry + keeperRegistrars []contracts.KeeperRegistrar + keeperConsumerContracts []contracts.AutomationConsumerBenchmark + upkeepIDs [][]*big.Int + + env *environment.Environment + namespace string + chainlinkNodes []*client.ChainlinkK8sClient + chainClient *seth.Client + testConfig tt.AutomationBenchmarkTestConfig + + linkToken contracts.LinkToken +} + +// UpkeepConfig dictates details of how the test's upkeep contracts should be called and configured +type UpkeepConfig struct { + NumberOfUpkeeps int // Number of upkeep contracts + BlockRange int64 // How many blocks to run the test for + BlockInterval int64 // Interval of blocks that upkeeps are expected to be performed + CheckGasToBurn int64 // How much gas should be burned on checkUpkeep() calls + PerformGasToBurn int64 // How much gas should be burned on performUpkeep() calls + UpkeepGasLimit int64 // Maximum gas that can be consumed by the upkeeps + FirstEligibleBuffer int64 // How many blocks to add to randomised first eligible block, set to 0 to disable randomised first eligible block +} + +// KeeperBenchmarkTestInputs are all the required inputs for a Keeper Benchmark Test +type KeeperBenchmarkTestInputs struct { + BlockchainClient *seth.Client // Client for the test to connect to the blockchain with + KeeperRegistrySettings *contracts.KeeperRegistrySettings // Settings of each keeper contract + Upkeeps *UpkeepConfig + Timeout time.Duration // Timeout for the test + ChainlinkNodeFunding *big.Float // Amount of ETH to fund each chainlink node with + UpkeepSLA int64 // SLA in number of blocks for an upkeep to be performed once it becomes eligible + RegistryVersions []ethereum.KeeperRegistryVersion // Registry version to use + ForceSingleTxnKey bool + BlockTime time.Duration + DeltaStage time.Duration + DeleteJobsOnEnd bool +} + +// NewKeeperBenchmarkTest prepares a new keeper benchmark test to be run +func NewKeeperBenchmarkTest(t *testing.T, inputs KeeperBenchmarkTestInputs) *KeeperBenchmarkTest { + return &KeeperBenchmarkTest{ + Inputs: inputs, + t: t, + log: logging.GetTestLogger(t), + } +} + +// Setup prepares contracts for the test +func (k *KeeperBenchmarkTest) Setup(env *environment.Environment, config testconfig.TestConfig) { + startTime := time.Now() + k.TestReporter.Summary.StartTime = startTime.UnixMilli() + k.ensureInputValues() + k.env = env + k.namespace = k.env.Cfg.Namespace + inputs := k.Inputs + k.testConfig = &config + + k.automationTests = make([]automationv2.AutomationTest, len(inputs.RegistryVersions)) + k.keeperRegistries = make([]contracts.KeeperRegistry, len(inputs.RegistryVersions)) + k.keeperRegistrars = make([]contracts.KeeperRegistrar, len(inputs.RegistryVersions)) + k.keeperConsumerContracts = make([]contracts.AutomationConsumerBenchmark, len(inputs.RegistryVersions)) + k.upkeepIDs = make([][]*big.Int, len(inputs.RegistryVersions)) + k.log.Debug().Interface("TestInputs", inputs).Msg("Setting up benchmark test") + + // if not present disable it + if k.testConfig.GetAutomationConfig().Resiliency == nil { + k.testConfig.GetAutomationConfig().Resiliency = &autotestconfig.ResiliencyConfig{ + ContractCallLimit: ptr.Ptr(uint(0)), + ContractCallInterval: ptr.Ptr(blockchain.StrDuration{Duration: 0 * time.Second}), + } + } + + var err error + // Connect to networks and prepare for contract deployment + k.chainlinkNodes, err = client.ConnectChainlinkNodes(k.env) + require.NoError(k.t, err, "Connecting to chainlink nodes shouldn't fail") + + if len(inputs.RegistryVersions) > 1 && !inputs.ForceSingleTxnKey { + for nodeIndex, node := range k.chainlinkNodes { + for registryIndex := 1; registryIndex < len(inputs.RegistryVersions); registryIndex++ { + k.log.Debug().Str("URL", node.URL()).Int("NodeIndex", nodeIndex).Int("RegistryIndex", registryIndex).Msg("Create Tx key") + _, _, err := node.CreateTxKey("evm", fmt.Sprint(k.Inputs.BlockchainClient.ChainID)) + require.NoError(k.t, err, "Creating transaction key shouldn't fail") + } + } + } + + for index := range inputs.RegistryVersions { + k.log.Info().Int("Index", index).Msg("Starting Test Setup") + a := automationv2.NewAutomationTestK8s(k.log, k.chainClient, k.chainlinkNodes, &config) + a.RegistrySettings = *k.Inputs.KeeperRegistrySettings + a.RegistrySettings.RegistryVersion = inputs.RegistryVersions[index] + a.RegistrarSettings = contracts.KeeperRegistrarSettings{ + AutoApproveConfigType: uint8(2), + AutoApproveMaxAllowed: math.MaxUint16, + MinLinkJuels: big.NewInt(0), + } + a.PluginConfig = actions.ReadPluginConfig(config) + a.PublicConfig = actions.ReadPublicConfig(config) + a.SetupAutomationDeploymentWithoutJobs(k.t) + err = a.SetConfigOnRegistry() + require.NoError(k.t, err, "Setting initial config on registry shouldn't fail") + k.SetupBenchmarkKeeperContracts(index, a) + } + + var keysToFund = inputs.RegistryVersions + if inputs.ForceSingleTxnKey { + keysToFund = inputs.RegistryVersions[0:1] + } + + for index := range keysToFund { + // Fund chainlink nodes + nodesToFund := k.chainlinkNodes + if inputs.RegistryVersions[index] >= ethereum.RegistryVersion_2_0 { + nodesToFund = k.chainlinkNodes[1:] + } + err = actions.FundChainlinkNodesAtKeyIndexFromRootAddress(k.log, k.chainClient, contracts.ChainlinkK8sClientToChainlinkNodeWithKeysAndAddress(nodesToFund), k.Inputs.ChainlinkNodeFunding, index) + require.NoError(k.t, err, "Funding Chainlink nodes shouldn't fail") + } + + k.log.Info().Str("Setup Time", time.Since(startTime).String()).Msg("Finished Keeper Benchmark Test Setup") + err = k.SendSlackNotification(nil, &config) + if err != nil { + k.log.Warn().Msg("Sending test start slack notification failed") + } +} + +// Run runs the keeper benchmark test +func (k *KeeperBenchmarkTest) Run() { + u := k.Inputs.Upkeeps + k.TestReporter.Summary.Load.TotalCheckGasPerBlock = int64(u.NumberOfUpkeeps) * u.CheckGasToBurn + k.TestReporter.Summary.Load.TotalPerformGasPerBlock = int64((float64(u.NumberOfUpkeeps) / + float64(u.BlockInterval)) * float64(u.PerformGasToBurn)) + k.TestReporter.Summary.Load.AverageExpectedPerformsPerBlock = float64(u.NumberOfUpkeeps) / + float64(u.BlockInterval) + k.TestReporter.Summary.TestInputs = map[string]interface{}{ + "NumberOfUpkeeps": u.NumberOfUpkeeps, + "CheckGasLimit": k.Inputs.KeeperRegistrySettings.CheckGasLimit, + "MaxPerformGas": k.Inputs.KeeperRegistrySettings.MaxPerformGas, + "CheckGasToBurn": u.CheckGasToBurn, + "PerformGasToBurn": u.PerformGasToBurn, + "BlockRange": u.BlockRange, + "BlockInterval": u.BlockInterval, + "UpkeepSLA": k.Inputs.UpkeepSLA, + "FirstEligibleBuffer": u.FirstEligibleBuffer, + "NumberOfRegistries": len(k.keeperRegistries), + } + inputs := k.Inputs + startingBlock, err := k.chainClient.Client.BlockNumber(testcontext.Get(k.t)) + require.NoError(k.t, err, "Error getting latest block number") + k.startingBlock = big.NewInt(0).SetUint64(startingBlock) + startTime := time.Now() + + for rIndex := range k.keeperRegistries { + var txKeyId = rIndex + if inputs.ForceSingleTxnKey { + txKeyId = 0 + } + k.automationTests[rIndex].SetTransmitterKeyIndex(txKeyId) + k.automationTests[rIndex].AddJobsAndSetConfig(k.t) + // Give time for OCR nodes to bootstrap + time.Sleep(1 * time.Minute) + } + + k.log.Info().Msgf("Waiting for %d blocks for all upkeeps to be performed", inputs.Upkeeps.BlockRange+inputs.UpkeepSLA) + + errgroup, errCtx := errgroup.WithContext(context.Background()) + + var startedObservations = atomic.Int32{} + var finishedObservations = atomic.Int32{} + + // We create as many channels as listening goroutines (1 per upkeep). In the background we will be fanning out + // headers that we get from a single channel connected to EVM node to all upkeep-specific channels. + headerCh := make(chan *blockchain.SafeEVMHeader, 10) + sub, err := k.chainClient.Client.Client().EthSubscribe(context.Background(), headerCh, "newHeads") + require.NoError(k.t, err, "Subscribing to new headers for upkeep observation shouldn't fail") + + totalNumberOfChannels := 0 + for rIndex := range k.keeperRegistries { + totalNumberOfChannels += len(k.upkeepIDs[rIndex]) + } + + contractChannels := make([]chan *blockchain.SafeEVMHeader, totalNumberOfChannels) + for idx := 0; idx < totalNumberOfChannels; idx++ { + contractChannels[idx] = make(chan *blockchain.SafeEVMHeader, 10) // Buffered just in case processing is slow + } + + // signals all goroutines to stop when subscription error occurs + stopAllGoroutinesCh := make(chan struct{}) + + // this goroutine fans out headers to goroutines in the background + // and exists when all goroutines are done or when an error occurs + go func() { + defer func() { + // close all fanning out channels at the very end + for _, ch := range contractChannels { + close(ch) + } + k.log.Debug().Msg("Closed header distribution channels") + }() + for { + select { + case header := <-headerCh: + k.log.Trace().Int64("Number", header.Number.Int64()).Msg("Fanning out new header") + for _, ch := range contractChannels { + ch <- header + } + // we don't really care if it was a success or an error, we just want to exit + // if it was an error, we will have an error in the main goroutine + case <-errCtx.Done(): + k.log.Debug().Msg("All goroutines finished.") + sub.Unsubscribe() + return + case err := <-sub.Err(): + // no need to unsubscribe, subscription errored + k.log.Error().Err(err).Msg("header subscription failed. Trying to reconnect...") + connectionLostAt := time.Now() + // we use infinite loop here on purposes, these nodes can be down for extended periods of time ¯\_(ツ)_/¯ + RECONNECT: + for { + sub, err = k.chainClient.Client.Client().EthSubscribe(context.Background(), headerCh, "newHeads") + if err == nil { + break RECONNECT + } + + time.Sleep(5 * time.Second) + } + k.log.Info().Str("Reconnect Time", time.Since(connectionLostAt).String()).Msg("Reconnected to header subscription") + } + } + }() + + currentChannelIndex := 0 + for rIndex := range k.keeperRegistries { + for index, upkeepID := range k.upkeepIDs[rIndex] { + chIndex := currentChannelIndex + currentChannelIndex++ + upkeepIDCopy := upkeepID + registryIndex := rIndex + upkeepIndex := int64(index) + errgroup.Go(func() error { + startedObservations.Add(1) + k.log.Info().Int("Channel index", chIndex).Str("UpkeepID", upkeepIDCopy.String()).Msg("Starting upkeep observation") + + confirmer := contracts.NewAutomationConsumerBenchmarkUpkeepObserver( + k.keeperConsumerContracts[registryIndex], + k.keeperRegistries[registryIndex], + upkeepIDCopy, + inputs.Upkeeps.BlockRange+inputs.UpkeepSLA, + inputs.UpkeepSLA, + &k.TestReporter, + upkeepIndex, + inputs.Upkeeps.FirstEligibleBuffer, + k.log, + ) + + k.log.Debug().Str("UpkeepID", upkeepIDCopy.String()).Msg("Stared listening to new headers for upkeep observation") + + for { + select { + case <-stopAllGoroutinesCh: // header listening failed, exit + return errors.New("header distribution channel closed") + case <-errCtx.Done(): //one of goroutines errored, shut down gracefully, no need to return error + k.log.Error().Err(errCtx.Err()).Str("UpkeepID", upkeepIDCopy.String()).Msg("Stopping obervations due to error in one of the goroutines") + return nil + case header := <-contractChannels[chIndex]: // new block, check if upkeep was performed + k.log.Trace().Interface("Header number", header.Number).Str("UpkeepID", upkeepIDCopy.String()).Msg("Started processing new header") + finished, headerErr := confirmer.ReceiveHeader(header) + if headerErr != nil { + k.log.Err(headerErr).Str("UpkeepID", upkeepIDCopy.String()).Msg("Error processing header") + return errors.Wrapf(headerErr, "error processing header for upkeep %s", upkeepIDCopy.String()) + } + + if finished { // observations should be completed as we are beyond block range, if there are not there's a bug in test code + finishedObservations.Add(1) + k.log.Info().Str("Done/Total", fmt.Sprintf("%d/%d", finishedObservations.Load(), startedObservations.Load())).Str("UpkeepID", upkeepIDCopy.String()).Msg("Upkeep observation completed") + + if confirmer.Complete() { + confirmer.LogDetails() + return nil + } + return fmt.Errorf("confimer has finished, but without completing observation, this should never happen. Review your code. UpkdeepID: %s", upkeepIDCopy.String()) + } + k.log.Trace().Interface("Header number", header.Number).Str("UpkeepID", upkeepIDCopy.String()).Msg("Finished processing new header") + } + } + }) + } + } + + if err := errgroup.Wait(); err != nil { + k.t.Fatalf("errored when waiting for upkeeps: %v", err) + } + + // Close header distribution channel once all observations are done + close(stopAllGoroutinesCh) + + // Main test loop + k.observeUpkeepEvents() + + // Collect logs for each registry to calculate test metrics + // This test generates a LOT of logs, and we need to break up our reads, or risk getting rate-limited by the node + var ( + endBlock = big.NewInt(0).Add(k.startingBlock, big.NewInt(u.BlockRange)) + registryLogs = make([][]types.Log, len(k.keeperRegistries)) + blockBatchSize int64 = 100 + ) + for rIndex := range k.keeperRegistries { + // Variables for the full registry + var ( + logs []types.Log + timeout = 5 * time.Second + addr = k.keeperRegistries[rIndex].Address() + queryStartBlock = big.NewInt(0).Set(k.startingBlock) + ) + + // Gather logs from the registry in 100 block chunks to avoid read limits + for queryStartBlock.Cmp(endBlock) < 0 { + filterQuery := geth.FilterQuery{ + Addresses: []common.Address{common.HexToAddress(addr)}, + FromBlock: queryStartBlock, + ToBlock: big.NewInt(0).Add(queryStartBlock, big.NewInt(blockBatchSize)), + } + + // This RPC call can possibly time out or otherwise die. Failure is not an option, keep retrying to get our stats. + err = fmt.Errorf("initial error") // to ensure our for loop runs at least once + for err != nil { + ctx, cancel := context.WithTimeout(testcontext.Get(k.t), timeout) + logs, err = k.chainClient.Client.FilterLogs(ctx, filterQuery) + cancel() + if err != nil { + k.log.Error(). + Err(err). + Interface("Filter Query", filterQuery). + Str("Timeout", timeout.String()). + Msg("Error getting logs from chain, trying again") + timeout = time.Duration(math.Min(float64(timeout)*2, float64(2*time.Minute))) + continue + } + k.log.Info(). + Uint64("From Block", queryStartBlock.Uint64()). + Uint64("To Block", filterQuery.ToBlock.Uint64()). + Int("Log Count", len(logs)). + Str("Registry Address", addr). + Msg("Collected logs") + queryStartBlock.Add(queryStartBlock, big.NewInt(blockBatchSize)) + registryLogs[rIndex] = append(registryLogs[rIndex], logs...) + } + } + } + + // Count reverts and stale upkeeps + for rIndex := range k.keeperRegistries { + contractABI := k.contractABI(rIndex) + for _, l := range registryLogs[rIndex] { + log := l + eventDetails, err := contractABI.EventByID(log.Topics[0]) + if err != nil { + k.log.Error().Err(err).Str("Log Hash", log.TxHash.Hex()).Msg("Error getting event details for log, report data inaccurate") + break + } + if eventDetails.Name == "UpkeepPerformed" { + parsedLog, err := k.keeperRegistries[rIndex].ParseUpkeepPerformedLog(&log) + if err != nil { + k.log.Error().Err(err).Str("Log Hash", log.TxHash.Hex()).Msg("Error parsing upkeep performed log, report data inaccurate") + break + } + if !parsedLog.Success { + k.TestReporter.NumRevertedUpkeeps++ + } + } else if eventDetails.Name == "StaleUpkeepReport" { + k.TestReporter.NumStaleUpkeepReports++ + } + } + } + + for _, chainlinkNode := range k.chainlinkNodes { + txData, err := chainlinkNode.MustReadTransactionAttempts() + if err != nil { + k.log.Error().Err(err).Msg("Error reading transaction attempts from Chainlink Node") + } + k.TestReporter.AttemptedChainlinkTransactions = append(k.TestReporter.AttemptedChainlinkTransactions, txData) + } + + k.TestReporter.Summary.Config.Chainlink, err = k.env.ResourcesSummary("app=chainlink-0") + if err != nil { + k.log.Error().Err(err).Msg("Error getting resource summary of chainlink node") + } + + k.TestReporter.Summary.Config.Geth, err = k.env.ResourcesSummary("app=geth") + if err != nil && k.Inputs.BlockchainClient.Cfg.IsSimulatedNetwork() { + k.log.Error().Err(err).Msg("Error getting resource summary of geth node") + } + + endTime := time.Now() + k.TestReporter.Summary.EndTime = endTime.UnixMilli() + (30 * time.Second.Milliseconds()) + + for rIndex := range k.keeperRegistries { + if inputs.DeleteJobsOnEnd { + // Delete keeper jobs on chainlink nodes + actions.DeleteKeeperJobsWithId(k.t, k.chainlinkNodes, rIndex+1) + } + } + + k.log.Info().Str("Run Time", endTime.Sub(startTime).String()).Msg("Finished Keeper Benchmark Test") +} + +// TearDownVals returns the networks that the test is running on +func (k *KeeperBenchmarkTest) TearDownVals(t *testing.T) ( + *testing.T, + *seth.Client, + string, + []*client.ChainlinkK8sClient, + reportModel.TestReporter, + reportModel.GrafanaURLProvider, +) { + return t, k.chainClient, k.namespace, k.chainlinkNodes, &k.TestReporter, k.testConfig +} + +// ********************* +// ****** Helpers ****** +// ********************* + +// observeUpkeepEvents subscribes to Upkeep events on deployed registries and logs them +// WARNING: This should only be used for observation and logging. This isn't a reliable way to build a final report +// due to how fragile subscriptions can be +func (k *KeeperBenchmarkTest) observeUpkeepEvents() { + eventLogs := make(chan types.Log) + registryAddresses := make([]common.Address, len(k.keeperRegistries)) + addressIndexMap := map[common.Address]int{} + for index, registry := range k.keeperRegistries { + registryAddresses[index] = common.HexToAddress(registry.Address()) + addressIndexMap[registryAddresses[index]] = index + } + filterQuery := geth.FilterQuery{ + Addresses: registryAddresses, + FromBlock: k.startingBlock, + } + + ctx, cancel := context.WithTimeout(testcontext.Get(k.t), 5*time.Second) + sub, err := k.chainClient.Client.SubscribeFilterLogs(ctx, filterQuery, eventLogs) + cancel() + require.NoError(k.t, err, "Subscribing to upkeep performed events log shouldn't fail") + + interruption := make(chan os.Signal, 1) + //nolint:staticcheck //ignore SA1016 we need to send the os.Kill signal + signal.Notify(interruption, os.Kill, os.Interrupt, syscall.SIGTERM) + + go func() { + for { + select { + case <-interruption: + k.log.Warn().Msg("Received interrupt signal, test container restarting. Dashboard view will be inaccurate.") + case err := <-sub.Err(): + backoff := time.Second + for err != nil { // Keep retrying until we get a successful subscription + k.log.Error(). + Err(err). + Interface("Query", filterQuery). + Str("Backoff", backoff.String()). + Msg("Error while subscribing to Keeper Event Logs. Resubscribing...") + + ctx, cancel := context.WithTimeout(testcontext.Get(k.t), backoff) + sub, err = k.chainClient.Client.SubscribeFilterLogs(ctx, filterQuery, eventLogs) + cancel() + if err != nil { + time.Sleep(backoff) + backoff = time.Duration(math.Min(float64(backoff)*2, float64(30*time.Second))) + } + } + log.Info().Msg("Resubscribed to Keeper Event Logs") + case vLog := <-eventLogs: + rIndex, ok := addressIndexMap[vLog.Address] + if !ok { + k.log.Error().Str("Address", vLog.Address.Hex()).Msg("Received log from unknown registry") + continue + } + contractABI := k.contractABI(rIndex) + eventDetails, err := contractABI.EventByID(vLog.Topics[0]) + require.NoError(k.t, err, "Getting event details for subscribed log shouldn't fail") + if eventDetails.Name != "UpkeepPerformed" && eventDetails.Name != "StaleUpkeepReport" { + // Skip non upkeepPerformed Logs + continue + } + if vLog.Removed { + k.log.Warn(). + Str("Name", eventDetails.Name). + Str("Registry", k.keeperRegistries[rIndex].Address()). + Msg("Got removed log") + } + if eventDetails.Name == "UpkeepPerformed" { + parsedLog, err := k.keeperRegistries[rIndex].ParseUpkeepPerformedLog(&vLog) + require.NoError(k.t, err, "Parsing upkeep performed log shouldn't fail") + + if parsedLog.Success { + k.log.Info(). + Str("Upkeep ID", parsedLog.Id.String()). + Bool("Success", parsedLog.Success). + Str("From", parsedLog.From.String()). + Str("Registry", k.keeperRegistries[rIndex].Address()). + Msg("Got successful Upkeep Performed log on Registry") + } else { + k.log.Warn(). + Str("Upkeep ID", parsedLog.Id.String()). + Bool("Success", parsedLog.Success). + Str("From", parsedLog.From.String()). + Str("Registry", k.keeperRegistries[rIndex].Address()). + Msg("Got reverted Upkeep Performed log on Registry") + } + } else if eventDetails.Name == "StaleUpkeepReport" { + parsedLog, err := k.keeperRegistries[rIndex].ParseStaleUpkeepReportLog(&vLog) + require.NoError(k.t, err, "Parsing stale upkeep report log shouldn't fail") + k.log.Warn(). + Str("Upkeep ID", parsedLog.Id.String()). + Str("Registry", k.keeperRegistries[rIndex].Address()). + Msg("Got stale Upkeep report log on Registry") + } + } + } + }() +} + +// contractABI returns the ABI of the proper keeper registry contract +func (k *KeeperBenchmarkTest) contractABI(rIndex int) *abi.ABI { + contractABI, err := contracts.GetRegistryContractABI(k.Inputs.RegistryVersions[rIndex]) + require.NoError(k.t, err, "Getting contract ABI shouldn't fail") + return contractABI +} + +// ensureValues ensures that all values needed to run the test are present +func (k *KeeperBenchmarkTest) ensureInputValues() { + inputs := k.Inputs + require.NotNil(k.t, inputs.BlockchainClient, "Need a valid blockchain client to use for the test") + k.chainClient = inputs.BlockchainClient + require.GreaterOrEqual(k.t, inputs.Upkeeps.NumberOfUpkeeps, 1, "Expecting at least 1 keeper contracts") + if inputs.Timeout == 0 { + require.Greater(k.t, inputs.Upkeeps.BlockRange, int64(0), "If no `timeout` is provided, a `testBlockRange` is required") + } else if inputs.Upkeeps.BlockRange <= 0 { + require.GreaterOrEqual(k.t, inputs.Timeout, time.Second, "If no `testBlockRange` is provided a `timeout` is required") + } + require.NotNil(k.t, inputs.KeeperRegistrySettings, "You need to set KeeperRegistrySettings") + require.NotNil(k.t, k.Inputs.ChainlinkNodeFunding, "You need to set a funding amount for chainlink nodes") + clFunds, _ := k.Inputs.ChainlinkNodeFunding.Float64() + require.GreaterOrEqual(k.t, clFunds, 0.0, "Expecting Chainlink node funding to be more than 0 ETH") + require.Greater(k.t, inputs.Upkeeps.CheckGasToBurn, int64(0), "You need to set an expected amount of gas to burn on checkUpkeep()") + require.GreaterOrEqual( + k.t, int64(inputs.KeeperRegistrySettings.CheckGasLimit), inputs.Upkeeps.CheckGasToBurn, "CheckGasLimit should be >= CheckGasToBurn", + ) + require.Greater(k.t, inputs.Upkeeps.PerformGasToBurn, int64(0), "You need to set an expected amount of gas to burn on performUpkeep()") + require.NotNil(k.t, inputs.UpkeepSLA, "Expected UpkeepSLA to be set") + require.NotNil(k.t, inputs.Upkeeps.FirstEligibleBuffer, "You need to set FirstEligibleBuffer") + require.NotNil(k.t, inputs.RegistryVersions[0], "You need to set RegistryVersion") + require.NotNil(k.t, inputs.BlockTime, "You need to set BlockTime") + + if k.Inputs.DeltaStage == 0 { + k.Inputs.DeltaStage = k.Inputs.BlockTime * 5 + } +} + +func (k *KeeperBenchmarkTest) SendSlackNotification(slackClient *slack.Client, config tt.AutomationBenchmarkTestConfig) error { + if slackClient == nil { + slackClient = slack.New(reportModel.SlackAPIKey) + } + + grafanaUrl, err := config.GetGrafanaBaseURL() + if err != nil { + return err + } + + dashboardUrl, err := config.GetGrafanaDashboardURL() + if err != nil { + return err + } + + headerText := ":white_check_mark: Automation Benchmark Test STARTED :white_check_mark:" + formattedDashboardUrl := fmt.Sprintf("%s%s?from=%d&to=%s&var-namespace=%s&var-cl_node=chainlink-0-0", grafanaUrl, dashboardUrl, k.TestReporter.Summary.StartTime, "now", k.env.Cfg.Namespace) + log.Info().Str("Dashboard", formattedDashboardUrl).Msg("Dashboard URL") + + notificationBlocks := []slack.Block{} + notificationBlocks = append(notificationBlocks, + slack.NewHeaderBlock(slack.NewTextBlockObject("plain_text", headerText, true, false))) + notificationBlocks = append(notificationBlocks, + slack.NewContextBlock("context_block", slack.NewTextBlockObject("plain_text", k.env.Cfg.Namespace, false, false))) + notificationBlocks = append(notificationBlocks, slack.NewDividerBlock()) + notificationBlocks = append(notificationBlocks, slack.NewSectionBlock(slack.NewTextBlockObject("mrkdwn", + fmt.Sprintf("<%s|Test Dashboard> \nNotifying <@%s>", + formattedDashboardUrl, reportModel.SlackUserID), false, true), nil, nil)) + + ts, err := reportModel.SendSlackMessage(slackClient, slack.MsgOptionBlocks(notificationBlocks...)) + log.Debug().Str("ts", ts).Msg("Sent Slack Message") + return err +} + +// SetupBenchmarkKeeperContracts deploys a set amount of keeper Benchmark contracts registered to a single registry +func (k *KeeperBenchmarkTest) SetupBenchmarkKeeperContracts(index int, a *automationv2.AutomationTest) { + registryVersion := k.Inputs.RegistryVersions[index] + k.Inputs.KeeperRegistrySettings.RegistryVersion = registryVersion + upkeep := k.Inputs.Upkeeps + var ( + err error + ) + + var consumer contracts.AutomationConsumerBenchmark + if a.TestConfig.GetAutomationConfig().UseExistingUpkeepContracts() { + benchmarkAddresses, err := a.TestConfig.GetAutomationConfig().UpkeepContractAddresses() + require.NoError(k.t, err, "Getting upkeep contract addresses shouldn't fail") + consumer, err = contracts.LoadAutomationConsumerBenchmark(k.chainClient, benchmarkAddresses[0]) + require.NoError(k.t, err, "Loading KeeperConsumerBenchmark shouldn't fail") + } else { + consumer = k.DeployKeeperConsumersBenchmark() + } + + var upkeepAddresses []string + + checkData := make([][]byte, 0) + uint256Ty, err := abi.NewType("uint256", "uint256", nil) + require.NoError(k.t, err) + var data []byte + checkDataAbi := abi.Arguments{ + { + Type: uint256Ty, + }, + { + Type: uint256Ty, + }, + { + Type: uint256Ty, + }, + { + Type: uint256Ty, + }, + { + Type: uint256Ty, + }, + { + Type: uint256Ty, + }, + } + + for i := 0; i < upkeep.NumberOfUpkeeps; i++ { + upkeepAddresses = append(upkeepAddresses, consumer.Address()) + // Compute check data + data, err = checkDataAbi.Pack( + big.NewInt(int64(i)), big.NewInt(upkeep.BlockInterval), big.NewInt(upkeep.BlockRange), + big.NewInt(upkeep.CheckGasToBurn), big.NewInt(upkeep.PerformGasToBurn), big.NewInt(upkeep.FirstEligibleBuffer)) + require.NoError(k.t, err) + k.log.Debug().Str("checkData: ", hexutil.Encode(data)).Int("id", i).Msg("checkData computed") + checkData = append(checkData, data) + } + linkFunds := big.NewInt(0).Mul(big.NewInt(1e18), big.NewInt(upkeep.BlockRange/upkeep.BlockInterval)) + gasPrice := big.NewInt(0).Mul(k.Inputs.KeeperRegistrySettings.FallbackGasPrice, big.NewInt(2)) + minLinkBalance := big.NewInt(0). + Add(big.NewInt(0). + Mul(big.NewInt(0). + Div(big.NewInt(0).Mul(gasPrice, big.NewInt(upkeep.UpkeepGasLimit+80000)), k.Inputs.KeeperRegistrySettings.FallbackLinkPrice), + big.NewInt(1e18+0)), + big.NewInt(0)) + + linkFunds = big.NewInt(0).Add(linkFunds, minLinkBalance) + k.linkToken = a.LinkToken + + err = actions.SetupMultiCallAndFundDeploymentAddresses(k.chainClient, k.linkToken, upkeep.NumberOfUpkeeps, linkFunds, a.TestConfig) + require.NoError(k.t, err, "Sending link funds to deployment addresses shouldn't fail") + + upkeepIds := actions.RegisterUpkeepContractsWithCheckData(k.t, k.chainClient, k.linkToken, linkFunds, uint32(upkeep.UpkeepGasLimit), a.Registry, a.Registrar, upkeep.NumberOfUpkeeps, upkeepAddresses, checkData, false, false, false, nil) + + k.automationTests[index] = *a + k.keeperRegistries[index] = a.Registry + k.keeperRegistrars[index] = a.Registrar + k.upkeepIDs[index] = upkeepIds + k.keeperConsumerContracts[index] = consumer +} + +func (k *KeeperBenchmarkTest) DeployKeeperConsumersBenchmark() contracts.AutomationConsumerBenchmark { + // Deploy consumer + var err error + var keeperConsumerInstance contracts.AutomationConsumerBenchmark + if *k.testConfig.GetAutomationConfig().Resiliency.ContractCallLimit != 0 && k.testConfig.GetAutomationConfig().Resiliency.ContractCallInterval.Duration != 0 { + maxRetryAttempts := *k.testConfig.GetAutomationConfig().Resiliency.ContractCallLimit + callRetryDelay := k.testConfig.GetAutomationConfig().Resiliency.ContractCallInterval.Duration + keeperConsumerInstance, err = contracts.DeployAutomationConsumerBenchmarkWithRetry(k.chainClient, k.log, maxRetryAttempts, callRetryDelay) + if err != nil { + k.log.Error().Err(err).Msg("Deploying AutomationConsumerBenchmark instance shouldn't fail") + keeperConsumerInstance, err = contracts.DeployAutomationConsumerBenchmarkWithRetry(k.chainClient, k.log, maxRetryAttempts, callRetryDelay) + require.NoError(k.t, err, "Error deploying AutomationConsumerBenchmark") + } + } else { + keeperConsumerInstance, err = contracts.DeployAutomationConsumerBenchmark(k.chainClient) + if err != nil { + k.log.Error().Err(err).Msg("Deploying AutomationConsumerBenchmark instance %d shouldn't fail") + keeperConsumerInstance, err = contracts.DeployAutomationConsumerBenchmark(k.chainClient) + require.NoError(k.t, err, "Error deploying AutomationConsumerBenchmark") + } + } + k.log.Debug(). + Str("Contract Address", keeperConsumerInstance.Address()). + Msg("Deployed Keeper Benchmark Contract") + + k.log.Info().Msg("Successfully deployed all Keeper Consumer Contracts") + + return keeperConsumerInstance +} diff --git a/integration-tests/testsetups/keeper_benchmark.go b/integration-tests/testsetups/keeper_benchmark.go deleted file mode 100644 index d50355f39b6..00000000000 --- a/integration-tests/testsetups/keeper_benchmark.go +++ /dev/null @@ -1,840 +0,0 @@ -package testsetups - -import ( - "context" - "fmt" - "math" - "math/big" - "os" - "os/signal" - "sync/atomic" - "syscall" - "testing" - "time" - - geth "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/accounts/abi" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/core/types" - "github.com/pkg/errors" - "github.com/rs/zerolog" - "github.com/rs/zerolog/log" - "github.com/slack-go/slack" - "github.com/smartcontractkit/seth" - "github.com/stretchr/testify/require" - "golang.org/x/sync/errgroup" - - "github.com/smartcontractkit/chainlink-testing-framework/blockchain" - "github.com/smartcontractkit/chainlink-testing-framework/k8s/environment" - "github.com/smartcontractkit/chainlink-testing-framework/logging" - reportModel "github.com/smartcontractkit/chainlink-testing-framework/testreporters" - "github.com/smartcontractkit/chainlink-testing-framework/utils/ptr" - "github.com/smartcontractkit/chainlink-testing-framework/utils/testcontext" - - "github.com/smartcontractkit/chainlink/integration-tests/actions" - "github.com/smartcontractkit/chainlink/integration-tests/client" - "github.com/smartcontractkit/chainlink/integration-tests/contracts" - "github.com/smartcontractkit/chainlink/integration-tests/contracts/ethereum" - keepertestconfig "github.com/smartcontractkit/chainlink/integration-tests/testconfig/keeper" - "github.com/smartcontractkit/chainlink/integration-tests/testreporters" - tt "github.com/smartcontractkit/chainlink/integration-tests/types" -) - -// KeeperBenchmarkTest builds a test to check that chainlink nodes are able to upkeep a specified amount of Upkeep -// contracts within a certain block time -type KeeperBenchmarkTest struct { - Inputs KeeperBenchmarkTestInputs - TestReporter testreporters.KeeperBenchmarkTestReporter - - t *testing.T - log zerolog.Logger - startingBlock *big.Int - - keeperRegistries []contracts.KeeperRegistry - keeperRegistrars []contracts.KeeperRegistrar - keeperConsumerContracts []contracts.AutomationConsumerBenchmark - upkeepIDs [][]*big.Int - - env *environment.Environment - namespace string - chainlinkNodes []*client.ChainlinkK8sClient - chainClient *seth.Client - testConfig tt.KeeperBenchmarkTestConfig - - linkToken contracts.LinkToken - ethFeed contracts.MockETHLINKFeed - gasFeed contracts.MockGasFeed -} - -// UpkeepConfig dictates details of how the test's upkeep contracts should be called and configured -type UpkeepConfig struct { - NumberOfUpkeeps int // Number of upkeep contracts - BlockRange int64 // How many blocks to run the test for - BlockInterval int64 // Interval of blocks that upkeeps are expected to be performed - CheckGasToBurn int64 // How much gas should be burned on checkUpkeep() calls - PerformGasToBurn int64 // How much gas should be burned on performUpkeep() calls - UpkeepGasLimit int64 // Maximum gas that can be consumed by the upkeeps - FirstEligibleBuffer int64 // How many blocks to add to randomised first eligible block, set to 0 to disable randomised first eligible block -} - -// PreDeployedContracts are contracts that are already deployed on a (usually) live testnet chain, so re-deployment -// in unnecessary -type PreDeployedContracts struct { - RegistryAddress string - RegistrarAddress string - LinkTokenAddress string - EthFeedAddress string - GasFeedAddress string -} - -// KeeperBenchmarkTestInputs are all the required inputs for a Keeper Benchmark Test -type KeeperBenchmarkTestInputs struct { - BlockchainClient *seth.Client // Client for the test to connect to the blockchain with - KeeperRegistrySettings *contracts.KeeperRegistrySettings // Settings of each keeper contract - Upkeeps *UpkeepConfig - Contracts *PreDeployedContracts - Timeout time.Duration // Timeout for the test - ChainlinkNodeFunding *big.Float // Amount of ETH to fund each chainlink node with - UpkeepSLA int64 // SLA in number of blocks for an upkeep to be performed once it becomes eligible - RegistryVersions []ethereum.KeeperRegistryVersion // Registry version to use - ForceSingleTxnKey bool - BlockTime time.Duration - DeltaStage time.Duration - DeleteJobsOnEnd bool -} - -// NewKeeperBenchmarkTest prepares a new keeper benchmark test to be run -func NewKeeperBenchmarkTest(t *testing.T, inputs KeeperBenchmarkTestInputs) *KeeperBenchmarkTest { - return &KeeperBenchmarkTest{ - Inputs: inputs, - t: t, - log: logging.GetTestLogger(t), - } -} - -// Setup prepares contracts for the test -func (k *KeeperBenchmarkTest) Setup(env *environment.Environment, config tt.KeeperBenchmarkTestConfig) { - startTime := time.Now() - k.TestReporter.Summary.StartTime = startTime.UnixMilli() - k.ensureInputValues() - k.env = env - k.namespace = k.env.Cfg.Namespace - inputs := k.Inputs - k.testConfig = config - - k.keeperRegistries = make([]contracts.KeeperRegistry, len(inputs.RegistryVersions)) - k.keeperRegistrars = make([]contracts.KeeperRegistrar, len(inputs.RegistryVersions)) - k.keeperConsumerContracts = make([]contracts.AutomationConsumerBenchmark, len(inputs.RegistryVersions)) - k.upkeepIDs = make([][]*big.Int, len(inputs.RegistryVersions)) - k.log.Debug().Interface("TestInputs", inputs).Msg("Setting up benchmark test") - - // if not present disable it - if k.testConfig.GetKeeperConfig().Resiliency == nil { - k.testConfig.GetKeeperConfig().Resiliency = &keepertestconfig.ResiliencyConfig{ - ContractCallLimit: ptr.Ptr(uint(0)), - ContractCallInterval: ptr.Ptr(blockchain.StrDuration{Duration: 0 * time.Second}), - } - } - - var err error - // Connect to networks and prepare for contract deployment - k.chainlinkNodes, err = client.ConnectChainlinkNodes(k.env) - require.NoError(k.t, err, "Connecting to chainlink nodes shouldn't fail") - - if len(inputs.RegistryVersions) > 1 && !inputs.ForceSingleTxnKey { - for nodeIndex, node := range k.chainlinkNodes { - for registryIndex := 1; registryIndex < len(inputs.RegistryVersions); registryIndex++ { - k.log.Debug().Str("URL", node.URL()).Int("NodeIndex", nodeIndex).Int("RegistryIndex", registryIndex).Msg("Create Tx key") - _, _, err := node.CreateTxKey("evm", fmt.Sprint(k.Inputs.BlockchainClient.ChainID)) - require.NoError(k.t, err, "Creating transaction key shouldn't fail") - } - } - } - - c := inputs.Contracts - - if common.IsHexAddress(c.LinkTokenAddress) { - _, err = contracts.LoadLinkTokenContract(k.log, k.chainClient, common.HexToAddress(c.LinkTokenAddress)) - require.NoError(k.t, err, "Loading Link Token Contract shouldn't fail") - } else { - k.linkToken, err = contracts.DeployLinkTokenContract(k.log, k.chainClient) - require.NoError(k.t, err, "Deploying mock Link Token Contract feed shouldn't fail") - } - - if common.IsHexAddress(c.EthFeedAddress) { - _, err = contracts.LoadMockETHLINKFeed(k.chainClient, common.HexToAddress(c.EthFeedAddress)) - require.NoError(k.t, err, "Loading ETH-Link feed Contract shouldn't fail") - } else { - k.ethFeed, err = contracts.DeployMockETHLINKFeed(k.chainClient, big.NewInt(2e18)) - require.NoError(k.t, err, "Deploying mock ETH-Link feed shouldn't fail") - } - - if common.IsHexAddress(c.GasFeedAddress) { - k.gasFeed, err = contracts.LoadMockGASFeed(k.chainClient, common.HexToAddress(c.GasFeedAddress)) - require.NoError(k.t, err, "Loading Gas feed Contract shouldn't fail") - } else { - k.gasFeed, err = contracts.DeployMockGASFeed(k.chainClient, big.NewInt(2e11)) - require.NoError(k.t, err, "Deploying mock gas feed shouldn't fail") - } - - for index := range inputs.RegistryVersions { - k.log.Info().Int("Index", index).Msg("Starting Test Setup") - k.DeployBenchmarkKeeperContracts(index) - } - - var keysToFund = inputs.RegistryVersions - if inputs.ForceSingleTxnKey { - keysToFund = inputs.RegistryVersions[0:1] - } - - for index := range keysToFund { - // Fund chainlink nodes - nodesToFund := k.chainlinkNodes - if inputs.RegistryVersions[index] == ethereum.RegistryVersion_2_0 || inputs.RegistryVersions[index] == ethereum.RegistryVersion_2_1 || inputs.RegistryVersions[index] == ethereum.RegistryVersion_2_2 { - nodesToFund = k.chainlinkNodes[1:] - } - err = actions.FundChainlinkNodesAtKeyIndexFromRootAddress(k.log, k.chainClient, contracts.ChainlinkK8sClientToChainlinkNodeWithKeysAndAddress(nodesToFund), k.Inputs.ChainlinkNodeFunding, index) - require.NoError(k.t, err, "Funding Chainlink nodes shouldn't fail") - } - - k.log.Info().Str("Setup Time", time.Since(startTime).String()).Msg("Finished Keeper Benchmark Test Setup") - err = k.SendSlackNotification(nil, config) - if err != nil { - k.log.Warn().Msg("Sending test start slack notification failed") - } -} - -// Run runs the keeper benchmark test -func (k *KeeperBenchmarkTest) Run() { - u := k.Inputs.Upkeeps - k.TestReporter.Summary.Load.TotalCheckGasPerBlock = int64(u.NumberOfUpkeeps) * u.CheckGasToBurn - k.TestReporter.Summary.Load.TotalPerformGasPerBlock = int64((float64(u.NumberOfUpkeeps) / - float64(u.BlockInterval)) * float64(u.PerformGasToBurn)) - k.TestReporter.Summary.Load.AverageExpectedPerformsPerBlock = float64(u.NumberOfUpkeeps) / - float64(u.BlockInterval) - k.TestReporter.Summary.TestInputs = map[string]interface{}{ - "NumberOfUpkeeps": u.NumberOfUpkeeps, - "BlockCountPerTurn": k.Inputs.KeeperRegistrySettings.BlockCountPerTurn, - "CheckGasLimit": k.Inputs.KeeperRegistrySettings.CheckGasLimit, - "MaxPerformGas": k.Inputs.KeeperRegistrySettings.MaxPerformGas, - "CheckGasToBurn": u.CheckGasToBurn, - "PerformGasToBurn": u.PerformGasToBurn, - "BlockRange": u.BlockRange, - "BlockInterval": u.BlockInterval, - "UpkeepSLA": k.Inputs.UpkeepSLA, - "FirstEligibleBuffer": u.FirstEligibleBuffer, - "NumberOfRegistries": len(k.keeperRegistries), - } - inputs := k.Inputs - startingBlock, err := k.chainClient.Client.BlockNumber(testcontext.Get(k.t)) - require.NoError(k.t, err, "Error getting latest block number") - k.startingBlock = big.NewInt(0).SetUint64(startingBlock) - startTime := time.Now() - - nodesWithoutBootstrap := k.chainlinkNodes[1:] - - for rIndex := range k.keeperRegistries { - var txKeyId = rIndex - if inputs.ForceSingleTxnKey { - txKeyId = 0 - } - kr := k.keeperRegistries[rIndex] - ocrConfig, err := actions.BuildAutoOCR2ConfigVarsWithKeyIndex( - k.t, nodesWithoutBootstrap, *inputs.KeeperRegistrySettings, kr.Address(), k.Inputs.DeltaStage, txKeyId, common.Address{}, kr.ChainModuleAddress(), kr.ReorgProtectionEnabled(), - ) - require.NoError(k.t, err, "Building OCR config shouldn't fail") - - rv := inputs.RegistryVersions[rIndex] - // Send keeper jobs to registry and chainlink nodes - if rv == ethereum.RegistryVersion_2_0 || rv == ethereum.RegistryVersion_2_1 || rv == ethereum.RegistryVersion_2_2 { - actions.CreateOCRKeeperJobs(k.t, k.chainlinkNodes, kr.Address(), k.chainClient.ChainID, txKeyId, rv) - if rv == ethereum.RegistryVersion_2_0 { - err = kr.SetConfig(*inputs.KeeperRegistrySettings, ocrConfig) - } else { - err = kr.SetConfigTypeSafe(ocrConfig) - } - require.NoError(k.t, err, "Registry config should be be set successfully") - // Give time for OCR nodes to bootstrap - time.Sleep(1 * time.Minute) - } else { - actions.CreateKeeperJobsWithKeyIndex(k.t, k.chainlinkNodes, kr, txKeyId, ocrConfig, fmt.Sprint(k.chainClient.ChainID)) - } - } - - k.log.Info().Msgf("Waiting for %d blocks for all upkeeps to be performed", inputs.Upkeeps.BlockRange+inputs.UpkeepSLA) - - errgroup, errCtx := errgroup.WithContext(context.Background()) - - var startedObservations = atomic.Int32{} - var finishedObservations = atomic.Int32{} - - // We create as many channels as listening goroutines (1 per upkeep). In the background we will be fanning out - // headers that we get from a single channel connected to EVM node to all upkeep-specific channels. - headerCh := make(chan *blockchain.SafeEVMHeader, 10) - sub, err := k.chainClient.Client.Client().EthSubscribe(context.Background(), headerCh, "newHeads") - require.NoError(k.t, err, "Subscribing to new headers for upkeep observation shouldn't fail") - - totalNumberOfChannels := 0 - for rIndex := range k.keeperRegistries { - totalNumberOfChannels += len(k.upkeepIDs[rIndex]) - } - - contractChannels := make([]chan *blockchain.SafeEVMHeader, totalNumberOfChannels) - for idx := 0; idx < totalNumberOfChannels; idx++ { - contractChannels[idx] = make(chan *blockchain.SafeEVMHeader, 10) // Buffered just in case processing is slow - } - - // signals all goroutines to stop when subscription error occurs - stopAllGoroutinesCh := make(chan struct{}) - - // this goroutine fans out headers to goroutines in the background - // and exists when all goroutines are done or when an error occurs - go func() { - defer func() { - // close all fanning out channels at the very end - for _, ch := range contractChannels { - close(ch) - } - k.log.Debug().Msg("Closed header distribution channels") - }() - for { - select { - case header := <-headerCh: - k.log.Trace().Int64("Number", header.Number.Int64()).Msg("Fanning out new header") - for _, ch := range contractChannels { - ch <- header - } - // we don't really care if it was a success or an error, we just want to exit - // if it was an error, we will have an error in the main goroutine - case <-errCtx.Done(): - k.log.Debug().Msg("All goroutines finished.") - sub.Unsubscribe() - return - case err := <-sub.Err(): - // no need to unsubscribe, subscription errored - k.log.Error().Err(err).Msg("header subscription failed. Trying to reconnect...") - connectionLostAt := time.Now() - // we use infinite loop here on purposes, these nodes can be down for extended periods of time ¯\_(ツ)_/¯ - RECONNECT: - for { - sub, err = k.chainClient.Client.Client().EthSubscribe(context.Background(), headerCh, "newHeads") - if err == nil { - break RECONNECT - } - - time.Sleep(5 * time.Second) - } - k.log.Info().Str("Reconnect Time", time.Since(connectionLostAt).String()).Msg("Reconnected to header subscription") - } - } - }() - - currentChannelIndex := 0 - for rIndex := range k.keeperRegistries { - for index, upkeepID := range k.upkeepIDs[rIndex] { - chIndex := currentChannelIndex - currentChannelIndex++ - upkeepIDCopy := upkeepID - registryIndex := rIndex - upkeepIndex := int64(index) - errgroup.Go(func() error { - startedObservations.Add(1) - k.log.Info().Int("Channel index", chIndex).Str("UpkeepID", upkeepIDCopy.String()).Msg("Starting upkeep observation") - - confirmer := contracts.NewKeeperConsumerBenchmarkUpkeepObserver( - k.keeperConsumerContracts[registryIndex], - k.keeperRegistries[registryIndex], - upkeepIDCopy, - inputs.Upkeeps.BlockRange+inputs.UpkeepSLA, - inputs.UpkeepSLA, - &k.TestReporter, - upkeepIndex, - inputs.Upkeeps.FirstEligibleBuffer, - k.log, - ) - - k.log.Debug().Str("UpkeepID", upkeepIDCopy.String()).Msg("Stared listening to new headers for upkeep observation") - - for { - select { - case <-stopAllGoroutinesCh: // header listening failed, exit - return errors.New("header distribution channel closed") - case <-errCtx.Done(): //one of goroutines errored, shut down gracefully, no need to return error - k.log.Error().Err(errCtx.Err()).Str("UpkeepID", upkeepIDCopy.String()).Msg("Stopping obervations due to error in one of the goroutines") - return nil - case header := <-contractChannels[chIndex]: // new block, check if upkeep was performed - k.log.Trace().Interface("Header number", header.Number).Str("UpkeepID", upkeepIDCopy.String()).Msg("Started processing new header") - finished, headerErr := confirmer.ReceiveHeader(header) - if headerErr != nil { - k.log.Err(headerErr).Str("UpkeepID", upkeepIDCopy.String()).Msg("Error processing header") - return errors.Wrapf(headerErr, "error processing header for upkeep %s", upkeepIDCopy.String()) - } - - if finished { // observations should be completed as we are beyond block range, if there are not there's a bug in test code - finishedObservations.Add(1) - k.log.Info().Str("Done/Total", fmt.Sprintf("%d/%d", finishedObservations.Load(), startedObservations.Load())).Str("UpkeepID", upkeepIDCopy.String()).Msg("Upkeep observation completed") - - if confirmer.Complete() { - confirmer.LogDetails() - return nil - } - return fmt.Errorf("confimer has finished, but without completing observation, this should never happen. Review your code. UpkdeepID: %s", upkeepIDCopy.String()) - } - k.log.Trace().Interface("Header number", header.Number).Str("UpkeepID", upkeepIDCopy.String()).Msg("Finished processing new header") - } - } - }) - } - } - - if err := errgroup.Wait(); err != nil { - k.t.Fatalf("errored when waiting for upkeeps: %v", err) - } - - // Close header distribution channel once all observations are done - close(stopAllGoroutinesCh) - - // Main test loop - k.observeUpkeepEvents() - - // Collect logs for each registry to calculate test metrics - // This test generates a LOT of logs, and we need to break up our reads, or risk getting rate-limited by the node - var ( - endBlock = big.NewInt(0).Add(k.startingBlock, big.NewInt(u.BlockRange)) - registryLogs = make([][]types.Log, len(k.keeperRegistries)) - blockBatchSize int64 = 100 - ) - for rIndex := range k.keeperRegistries { - // Variables for the full registry - var ( - logs []types.Log - timeout = 5 * time.Second - addr = k.keeperRegistries[rIndex].Address() - queryStartBlock = big.NewInt(0).Set(k.startingBlock) - ) - - // Gather logs from the registry in 100 block chunks to avoid read limits - for queryStartBlock.Cmp(endBlock) < 0 { - filterQuery := geth.FilterQuery{ - Addresses: []common.Address{common.HexToAddress(addr)}, - FromBlock: queryStartBlock, - ToBlock: big.NewInt(0).Add(queryStartBlock, big.NewInt(blockBatchSize)), - } - - // This RPC call can possibly time out or otherwise die. Failure is not an option, keep retrying to get our stats. - err = fmt.Errorf("initial error") // to ensure our for loop runs at least once - for err != nil { - ctx, cancel := context.WithTimeout(testcontext.Get(k.t), timeout) - logs, err = k.chainClient.Client.FilterLogs(ctx, filterQuery) - cancel() - if err != nil { - k.log.Error(). - Err(err). - Interface("Filter Query", filterQuery). - Str("Timeout", timeout.String()). - Msg("Error getting logs from chain, trying again") - timeout = time.Duration(math.Min(float64(timeout)*2, float64(2*time.Minute))) - continue - } - k.log.Info(). - Uint64("From Block", queryStartBlock.Uint64()). - Uint64("To Block", filterQuery.ToBlock.Uint64()). - Int("Log Count", len(logs)). - Str("Registry Address", addr). - Msg("Collected logs") - queryStartBlock.Add(queryStartBlock, big.NewInt(blockBatchSize)) - registryLogs[rIndex] = append(registryLogs[rIndex], logs...) - } - } - } - - // Count reverts and stale upkeeps - for rIndex := range k.keeperRegistries { - contractABI := k.contractABI(rIndex) - for _, l := range registryLogs[rIndex] { - log := l - eventDetails, err := contractABI.EventByID(log.Topics[0]) - if err != nil { - k.log.Error().Err(err).Str("Log Hash", log.TxHash.Hex()).Msg("Error getting event details for log, report data inaccurate") - break - } - if eventDetails.Name == "UpkeepPerformed" { - parsedLog, err := k.keeperRegistries[rIndex].ParseUpkeepPerformedLog(&log) - if err != nil { - k.log.Error().Err(err).Str("Log Hash", log.TxHash.Hex()).Msg("Error parsing upkeep performed log, report data inaccurate") - break - } - if !parsedLog.Success { - k.TestReporter.NumRevertedUpkeeps++ - } - } else if eventDetails.Name == "StaleUpkeepReport" { - k.TestReporter.NumStaleUpkeepReports++ - } - } - } - - for _, chainlinkNode := range k.chainlinkNodes { - txData, err := chainlinkNode.MustReadTransactionAttempts() - if err != nil { - k.log.Error().Err(err).Msg("Error reading transaction attempts from Chainlink Node") - } - k.TestReporter.AttemptedChainlinkTransactions = append(k.TestReporter.AttemptedChainlinkTransactions, txData) - } - - k.TestReporter.Summary.Config.Chainlink, err = k.env.ResourcesSummary("app=chainlink-0") - if err != nil { - k.log.Error().Err(err).Msg("Error getting resource summary of chainlink node") - } - - k.TestReporter.Summary.Config.Geth, err = k.env.ResourcesSummary("app=geth") - if err != nil && k.Inputs.BlockchainClient.Cfg.IsSimulatedNetwork() { - k.log.Error().Err(err).Msg("Error getting resource summary of geth node") - } - - endTime := time.Now() - k.TestReporter.Summary.EndTime = endTime.UnixMilli() + (30 * time.Second.Milliseconds()) - - for rIndex := range k.keeperRegistries { - if inputs.DeleteJobsOnEnd { - // Delete keeper jobs on chainlink nodes - actions.DeleteKeeperJobsWithId(k.t, k.chainlinkNodes, rIndex+1) - } - } - - k.log.Info().Str("Run Time", endTime.Sub(startTime).String()).Msg("Finished Keeper Benchmark Test") -} - -// TearDownVals returns the networks that the test is running on -func (k *KeeperBenchmarkTest) TearDownVals(t *testing.T) ( - *testing.T, - *seth.Client, - string, - []*client.ChainlinkK8sClient, - reportModel.TestReporter, - reportModel.GrafanaURLProvider, -) { - return t, k.chainClient, k.namespace, k.chainlinkNodes, &k.TestReporter, k.testConfig -} - -// ********************* -// ****** Helpers ****** -// ********************* - -// observeUpkeepEvents subscribes to Upkeep events on deployed registries and logs them -// WARNING: This should only be used for observation and logging. This isn't a reliable way to build a final report -// due to how fragile subscriptions can be -func (k *KeeperBenchmarkTest) observeUpkeepEvents() { - eventLogs := make(chan types.Log) - registryAddresses := make([]common.Address, len(k.keeperRegistries)) - addressIndexMap := map[common.Address]int{} - for index, registry := range k.keeperRegistries { - registryAddresses[index] = common.HexToAddress(registry.Address()) - addressIndexMap[registryAddresses[index]] = index - } - filterQuery := geth.FilterQuery{ - Addresses: registryAddresses, - FromBlock: k.startingBlock, - } - - ctx, cancel := context.WithTimeout(testcontext.Get(k.t), 5*time.Second) - sub, err := k.chainClient.Client.SubscribeFilterLogs(ctx, filterQuery, eventLogs) - cancel() - require.NoError(k.t, err, "Subscribing to upkeep performed events log shouldn't fail") - - interruption := make(chan os.Signal, 1) - //nolint:staticcheck //ignore SA1016 we need to send the os.Kill signal - signal.Notify(interruption, os.Kill, os.Interrupt, syscall.SIGTERM) - - go func() { - for { - select { - case <-interruption: - k.log.Warn().Msg("Received interrupt signal, test container restarting. Dashboard view will be inaccurate.") - case err := <-sub.Err(): - backoff := time.Second - for err != nil { // Keep retrying until we get a successful subscription - k.log.Error(). - Err(err). - Interface("Query", filterQuery). - Str("Backoff", backoff.String()). - Msg("Error while subscribing to Keeper Event Logs. Resubscribing...") - - ctx, cancel := context.WithTimeout(testcontext.Get(k.t), backoff) - sub, err = k.chainClient.Client.SubscribeFilterLogs(ctx, filterQuery, eventLogs) - cancel() - if err != nil { - time.Sleep(backoff) - backoff = time.Duration(math.Min(float64(backoff)*2, float64(30*time.Second))) - } - } - log.Info().Msg("Resubscribed to Keeper Event Logs") - case vLog := <-eventLogs: - rIndex, ok := addressIndexMap[vLog.Address] - if !ok { - k.log.Error().Str("Address", vLog.Address.Hex()).Msg("Received log from unknown registry") - continue - } - contractABI := k.contractABI(rIndex) - eventDetails, err := contractABI.EventByID(vLog.Topics[0]) - require.NoError(k.t, err, "Getting event details for subscribed log shouldn't fail") - if eventDetails.Name != "UpkeepPerformed" && eventDetails.Name != "StaleUpkeepReport" { - // Skip non upkeepPerformed Logs - continue - } - if vLog.Removed { - k.log.Warn(). - Str("Name", eventDetails.Name). - Str("Registry", k.keeperRegistries[rIndex].Address()). - Msg("Got removed log") - } - if eventDetails.Name == "UpkeepPerformed" { - parsedLog, err := k.keeperRegistries[rIndex].ParseUpkeepPerformedLog(&vLog) - require.NoError(k.t, err, "Parsing upkeep performed log shouldn't fail") - - if parsedLog.Success { - k.log.Info(). - Str("Upkeep ID", parsedLog.Id.String()). - Bool("Success", parsedLog.Success). - Str("From", parsedLog.From.String()). - Str("Registry", k.keeperRegistries[rIndex].Address()). - Msg("Got successful Upkeep Performed log on Registry") - } else { - k.log.Warn(). - Str("Upkeep ID", parsedLog.Id.String()). - Bool("Success", parsedLog.Success). - Str("From", parsedLog.From.String()). - Str("Registry", k.keeperRegistries[rIndex].Address()). - Msg("Got reverted Upkeep Performed log on Registry") - } - } else if eventDetails.Name == "StaleUpkeepReport" { - parsedLog, err := k.keeperRegistries[rIndex].ParseStaleUpkeepReportLog(&vLog) - require.NoError(k.t, err, "Parsing stale upkeep report log shouldn't fail") - k.log.Warn(). - Str("Upkeep ID", parsedLog.Id.String()). - Str("Registry", k.keeperRegistries[rIndex].Address()). - Msg("Got stale Upkeep report log on Registry") - } - } - } - }() -} - -// contractABI returns the ABI of the proper keeper registry contract -func (k *KeeperBenchmarkTest) contractABI(rIndex int) *abi.ABI { - contractABI, err := contracts.GetRegistryContractABI(k.Inputs.RegistryVersions[rIndex]) - require.NoError(k.t, err, "Getting contract ABI shouldn't fail") - return contractABI -} - -// ensureValues ensures that all values needed to run the test are present -func (k *KeeperBenchmarkTest) ensureInputValues() { - inputs := k.Inputs - require.NotNil(k.t, inputs.BlockchainClient, "Need a valid blockchain client to use for the test") - k.chainClient = inputs.BlockchainClient - require.GreaterOrEqual(k.t, inputs.Upkeeps.NumberOfUpkeeps, 1, "Expecting at least 1 keeper contracts") - if inputs.Timeout == 0 { - require.Greater(k.t, inputs.Upkeeps.BlockRange, int64(0), "If no `timeout` is provided, a `testBlockRange` is required") - } else if inputs.Upkeeps.BlockRange <= 0 { - require.GreaterOrEqual(k.t, inputs.Timeout, time.Second, "If no `testBlockRange` is provided a `timeout` is required") - } - require.NotNil(k.t, inputs.KeeperRegistrySettings, "You need to set KeeperRegistrySettings") - require.NotNil(k.t, k.Inputs.ChainlinkNodeFunding, "You need to set a funding amount for chainlink nodes") - clFunds, _ := k.Inputs.ChainlinkNodeFunding.Float64() - require.GreaterOrEqual(k.t, clFunds, 0.0, "Expecting Chainlink node funding to be more than 0 ETH") - require.Greater(k.t, inputs.Upkeeps.CheckGasToBurn, int64(0), "You need to set an expected amount of gas to burn on checkUpkeep()") - require.GreaterOrEqual( - k.t, int64(inputs.KeeperRegistrySettings.CheckGasLimit), inputs.Upkeeps.CheckGasToBurn, "CheckGasLimit should be >= CheckGasToBurn", - ) - require.Greater(k.t, inputs.Upkeeps.PerformGasToBurn, int64(0), "You need to set an expected amount of gas to burn on performUpkeep()") - require.NotNil(k.t, inputs.UpkeepSLA, "Expected UpkeepSLA to be set") - require.NotNil(k.t, inputs.Upkeeps.FirstEligibleBuffer, "You need to set FirstEligibleBuffer") - require.NotNil(k.t, inputs.RegistryVersions[0], "You need to set RegistryVersion") - require.NotNil(k.t, inputs.BlockTime, "You need to set BlockTime") - - if k.Inputs.DeltaStage == 0 { - k.Inputs.DeltaStage = k.Inputs.BlockTime * 5 - } -} - -func (k *KeeperBenchmarkTest) SendSlackNotification(slackClient *slack.Client, config tt.KeeperBenchmarkTestConfig) error { - if slackClient == nil { - slackClient = slack.New(reportModel.SlackAPIKey) - } - - grafanaUrl, err := config.GetGrafanaBaseURL() - if err != nil { - return err - } - - dashboardUrl, err := config.GetGrafanaDashboardURL() - if err != nil { - return err - } - - headerText := ":white_check_mark: Automation Benchmark Test STARTED :white_check_mark:" - formattedDashboardUrl := fmt.Sprintf("%s%s?from=%d&to=%s&var-namespace=%s&var-cl_node=chainlink-0-0", grafanaUrl, dashboardUrl, k.TestReporter.Summary.StartTime, "now", k.env.Cfg.Namespace) - log.Info().Str("Dashboard", formattedDashboardUrl).Msg("Dashboard URL") - - notificationBlocks := []slack.Block{} - notificationBlocks = append(notificationBlocks, - slack.NewHeaderBlock(slack.NewTextBlockObject("plain_text", headerText, true, false))) - notificationBlocks = append(notificationBlocks, - slack.NewContextBlock("context_block", slack.NewTextBlockObject("plain_text", k.env.Cfg.Namespace, false, false))) - notificationBlocks = append(notificationBlocks, slack.NewDividerBlock()) - notificationBlocks = append(notificationBlocks, slack.NewSectionBlock(slack.NewTextBlockObject("mrkdwn", - fmt.Sprintf("<%s|Test Dashboard> \nNotifying <@%s>", - formattedDashboardUrl, reportModel.SlackUserID), false, true), nil, nil)) - - ts, err := reportModel.SendSlackMessage(slackClient, slack.MsgOptionBlocks(notificationBlocks...)) - log.Debug().Str("ts", ts).Msg("Sent Slack Message") - return err -} - -// DeployBenchmarkKeeperContracts deploys a set amount of keeper Benchmark contracts registered to a single registry -func (k *KeeperBenchmarkTest) DeployBenchmarkKeeperContracts(index int) { - registryVersion := k.Inputs.RegistryVersions[index] - k.Inputs.KeeperRegistrySettings.RegistryVersion = registryVersion - upkeep := k.Inputs.Upkeeps - var ( - registry contracts.KeeperRegistry - registrar contracts.KeeperRegistrar - err error - ) - - // Contract deployment is different for legacy keepers and OCR automation - if registryVersion <= ethereum.RegistryVersion_1_3 { // Legacy keeper - v1.X - registry, err = contracts.DeployKeeperRegistry(k.chainClient, &contracts.KeeperRegistryOpts{ - RegistryVersion: registryVersion, - LinkAddr: k.linkToken.Address(), - ETHFeedAddr: k.ethFeed.Address(), - GasFeedAddr: k.gasFeed.Address(), - TranscoderAddr: actions.ZeroAddress.Hex(), - RegistrarAddr: actions.ZeroAddress.Hex(), - Settings: *k.Inputs.KeeperRegistrySettings, - }) - require.NoError(k.t, err, "Deploying registry contract shouldn't fail") - - // Fund the registry with 1 LINK * amount of AutomationConsumerBenchmark contracts - err := k.linkToken.Transfer(registry.Address(), big.NewInt(0).Mul(big.NewInt(1e18), big.NewInt(int64(k.Inputs.Upkeeps.NumberOfUpkeeps)))) - require.NoError(k.t, err, "Funding keeper registry contract shouldn't fail") - - registrarSettings := contracts.KeeperRegistrarSettings{ - AutoApproveConfigType: 2, - AutoApproveMaxAllowed: math.MaxUint16, - RegistryAddr: registry.Address(), - MinLinkJuels: big.NewInt(0), - } - - registrar, err = contracts.DeployKeeperRegistrar(k.chainClient, registryVersion, k.linkToken.Address(), registrarSettings) - require.NoError(k.t, err, "Funding keeper registrar contract shouldn't fail") - } else { // OCR automation - v2.X - registry, registrar = actions.DeployAutoOCRRegistryAndRegistrar( - k.t, k.chainClient, registryVersion, *k.Inputs.KeeperRegistrySettings, k.linkToken, - ) - - // Fund the registry with LINK - err := k.linkToken.Transfer(registry.Address(), big.NewInt(0).Mul(big.NewInt(1e18), big.NewInt(int64(k.Inputs.Upkeeps.NumberOfUpkeeps)))) - require.NoError(k.t, err, "Funding keeper registry contract shouldn't fail") - ocrConfig, err := actions.BuildAutoOCR2ConfigVars(k.t, k.chainlinkNodes[1:], *k.Inputs.KeeperRegistrySettings, registrar.Address(), k.Inputs.DeltaStage, registry.ChainModuleAddress(), registry.ReorgProtectionEnabled()) - require.NoError(k.t, err, "Building OCR config shouldn't fail") - k.log.Debug().Interface("KeeperRegistrySettings", *k.Inputs.KeeperRegistrySettings).Interface("OCRConfig", ocrConfig).Msg("Config") - require.NoError(k.t, err, "Error building OCR config vars") - if registryVersion == ethereum.RegistryVersion_2_0 { - err = registry.SetConfig(*k.Inputs.KeeperRegistrySettings, ocrConfig) - } else { - err = registry.SetConfigTypeSafe(ocrConfig) - } - require.NoError(k.t, err, "Registry config should be be set successfully") - } - - consumer := k.DeployKeeperConsumersBenchmark() - - var upkeepAddresses []string - - checkData := make([][]byte, 0) - uint256Ty, err := abi.NewType("uint256", "uint256", nil) - require.NoError(k.t, err) - var data []byte - checkDataAbi := abi.Arguments{ - { - Type: uint256Ty, - }, - { - Type: uint256Ty, - }, - { - Type: uint256Ty, - }, - { - Type: uint256Ty, - }, - { - Type: uint256Ty, - }, - { - Type: uint256Ty, - }, - } - - for i := 0; i < upkeep.NumberOfUpkeeps; i++ { - upkeepAddresses = append(upkeepAddresses, consumer.Address()) - // Compute check data - data, err = checkDataAbi.Pack( - big.NewInt(int64(i)), big.NewInt(upkeep.BlockInterval), big.NewInt(upkeep.BlockRange), - big.NewInt(upkeep.CheckGasToBurn), big.NewInt(upkeep.PerformGasToBurn), big.NewInt(upkeep.FirstEligibleBuffer)) - require.NoError(k.t, err) - k.log.Debug().Str("checkData: ", hexutil.Encode(data)).Int("id", i).Msg("checkData computed") - checkData = append(checkData, data) - } - linkFunds := big.NewInt(0).Mul(big.NewInt(1e18), big.NewInt(upkeep.BlockRange/upkeep.BlockInterval)) - gasPrice := big.NewInt(0).Mul(k.Inputs.KeeperRegistrySettings.FallbackGasPrice, big.NewInt(2)) - minLinkBalance := big.NewInt(0). - Add(big.NewInt(0). - Mul(big.NewInt(0). - Div(big.NewInt(0).Mul(gasPrice, big.NewInt(upkeep.UpkeepGasLimit+80000)), k.Inputs.KeeperRegistrySettings.FallbackLinkPrice), - big.NewInt(1e18+0)), - big.NewInt(0)) - - linkFunds = big.NewInt(0).Add(linkFunds, minLinkBalance) - - err = actions.DeployMultiCallAndFundDeploymentAddresses(k.chainClient, k.linkToken, upkeep.NumberOfUpkeeps, linkFunds) - require.NoError(k.t, err, "Sending link funds to deployment addresses shouldn't fail") - - upkeepIds := actions.RegisterUpkeepContractsWithCheckData(k.t, k.chainClient, k.linkToken, linkFunds, uint32(upkeep.UpkeepGasLimit), registry, registrar, upkeep.NumberOfUpkeeps, upkeepAddresses, checkData, false, false, false, nil) - - k.keeperRegistries[index] = registry - k.keeperRegistrars[index] = registrar - k.upkeepIDs[index] = upkeepIds - k.keeperConsumerContracts[index] = consumer -} - -func (k *KeeperBenchmarkTest) DeployKeeperConsumersBenchmark() contracts.AutomationConsumerBenchmark { - // Deploy consumer - var err error - var keeperConsumerInstance contracts.AutomationConsumerBenchmark - if *k.testConfig.GetKeeperConfig().Resiliency.ContractCallLimit != 0 && k.testConfig.GetKeeperConfig().Resiliency.ContractCallInterval.Duration != 0 { - maxRetryAttempts := *k.testConfig.GetKeeperConfig().Resiliency.ContractCallLimit - callRetryDelay := k.testConfig.GetKeeperConfig().Resiliency.ContractCallInterval.Duration - keeperConsumerInstance, err = contracts.DeployKeeperConsumerBenchmarkWithRetry(k.chainClient, k.log, maxRetryAttempts, callRetryDelay) - if err != nil { - k.log.Error().Err(err).Msg("Deploying AutomationConsumerBenchmark instance shouldn't fail") - keeperConsumerInstance, err = contracts.DeployKeeperConsumerBenchmarkWithRetry(k.chainClient, k.log, maxRetryAttempts, callRetryDelay) - require.NoError(k.t, err, "Error deploying AutomationConsumerBenchmark") - } - } else { - keeperConsumerInstance, err = contracts.DeployKeeperConsumerBenchmark(k.chainClient) - if err != nil { - k.log.Error().Err(err).Msg("Deploying AutomationConsumerBenchmark instance %d shouldn't fail") - keeperConsumerInstance, err = contracts.DeployKeeperConsumerBenchmark(k.chainClient) - require.NoError(k.t, err, "Error deploying AutomationConsumerBenchmark") - } - } - k.log.Debug(). - Str("Contract Address", keeperConsumerInstance.Address()). - Msg("Deployed Keeper Benchmark Contract") - - k.log.Info().Msg("Successfully deployed all Keeper Consumer Contracts") - - return keeperConsumerInstance -} diff --git a/integration-tests/testsetups/ocr.go b/integration-tests/testsetups/ocr.go index 45c334bf69d..73b142b6297 100644 --- a/integration-tests/testsetups/ocr.go +++ b/integration-tests/testsetups/ocr.go @@ -15,35 +15,36 @@ import ( "testing" "time" - "github.com/smartcontractkit/chainlink-testing-framework/grafana" - seth_utils "github.com/smartcontractkit/chainlink-testing-framework/utils/seth" + "github.com/smartcontractkit/chainlink-testing-framework/lib/grafana" + seth_utils "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/seth" geth "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/pelletier/go-toml/v2" "github.com/rs/zerolog" - "github.com/smartcontractkit/seth" "github.com/stretchr/testify/require" + "github.com/smartcontractkit/chainlink-testing-framework/seth" + "github.com/smartcontractkit/libocr/gethwrappers/offchainaggregator" "github.com/smartcontractkit/libocr/gethwrappers2/ocr2aggregator" - "github.com/smartcontractkit/havoc/k8schaos" - - "github.com/smartcontractkit/chainlink-testing-framework/blockchain" - ctf_client "github.com/smartcontractkit/chainlink-testing-framework/client" - ctf_config "github.com/smartcontractkit/chainlink-testing-framework/config" - "github.com/smartcontractkit/chainlink-testing-framework/k8s/environment" - "github.com/smartcontractkit/chainlink-testing-framework/k8s/pkg/helm/chainlink" - "github.com/smartcontractkit/chainlink-testing-framework/k8s/pkg/helm/ethereum" - "github.com/smartcontractkit/chainlink-testing-framework/k8s/pkg/helm/foundry" - "github.com/smartcontractkit/chainlink-testing-framework/k8s/pkg/helm/mockserver" - mockservercfg "github.com/smartcontractkit/chainlink-testing-framework/k8s/pkg/helm/mockserver-cfg" - "github.com/smartcontractkit/chainlink-testing-framework/logging" - "github.com/smartcontractkit/chainlink-testing-framework/networks" - reportModel "github.com/smartcontractkit/chainlink-testing-framework/testreporters" - "github.com/smartcontractkit/chainlink-testing-framework/utils/testcontext" + "github.com/smartcontractkit/chainlink-testing-framework/havoc" + + "github.com/smartcontractkit/chainlink-testing-framework/lib/blockchain" + ctf_client "github.com/smartcontractkit/chainlink-testing-framework/lib/client" + ctf_config "github.com/smartcontractkit/chainlink-testing-framework/lib/config" + "github.com/smartcontractkit/chainlink-testing-framework/lib/k8s/environment" + "github.com/smartcontractkit/chainlink-testing-framework/lib/k8s/pkg/helm/chainlink" + "github.com/smartcontractkit/chainlink-testing-framework/lib/k8s/pkg/helm/ethereum" + "github.com/smartcontractkit/chainlink-testing-framework/lib/k8s/pkg/helm/foundry" + "github.com/smartcontractkit/chainlink-testing-framework/lib/k8s/pkg/helm/mockserver" + mockservercfg "github.com/smartcontractkit/chainlink-testing-framework/lib/k8s/pkg/helm/mockserver-cfg" + "github.com/smartcontractkit/chainlink-testing-framework/lib/logging" + "github.com/smartcontractkit/chainlink-testing-framework/lib/networks" + reportModel "github.com/smartcontractkit/chainlink-testing-framework/lib/testreporters" + "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/testcontext" "github.com/smartcontractkit/chainlink/integration-tests/actions" "github.com/smartcontractkit/chainlink/integration-tests/client" @@ -91,12 +92,12 @@ type OCRSoakTest struct { reorgHappened bool // flag to indicate if a reorg happened during the test gasSpikeSimulationHappened bool // flag to indicate if a gas spike simulation happened during the test gasLimitSimulationHappened bool // flag to indicate if a gas limit simulation happened during the test - chaosList []*k8schaos.Chaos // list of chaos simulations to run during the test + chaosList []*havoc.Chaos // list of chaos simulations to run during the test } type OCRSoakTestOption = func(c *OCRSoakTest) -func WithChaos(chaosList []*k8schaos.Chaos) OCRSoakTestOption { +func WithChaos(chaosList []*havoc.Chaos) OCRSoakTestOption { return func(c *OCRSoakTest) { c.chaosList = chaosList } @@ -277,11 +278,11 @@ func (o *OCRSoakTest) Setup(ocrTestConfig tt.OcrTestConfig) { nodes, err := client.ConnectChainlinkNodes(o.testEnvironment) require.NoError(o.t, err, "Connecting to chainlink nodes shouldn't fail") o.bootstrapNode, o.workerNodes = nodes[0], nodes[1:] - o.mockServer, err = ctf_client.ConnectMockServer(o.testEnvironment) + o.mockServer = ctf_client.ConnectMockServer(o.testEnvironment) require.NoError(o.t, err, "Creating mockserver clients shouldn't fail") - linkContract, err := contracts.DeployLinkTokenContract(o.log, sethClient) - require.NoError(o.t, err, "Error deploying LINK contract") + linkContract, err := actions.LinkTokenContract(o.log, sethClient, ocrTestConfig.GetActiveOCRConfig()) + require.NoError(o.t, err, "Error loading/deploying link token contract") // Fund Chainlink nodes, excluding the bootstrap node o.log.Info().Float64("ETH amount per node", *o.Config.Common.ChainlinkNodeFunding).Msg("Funding Chainlink nodes") @@ -289,7 +290,6 @@ func (o *OCRSoakTest) Setup(ocrTestConfig tt.OcrTestConfig) { require.NoError(o.t, err, "Error funding Chainlink nodes") var forwarders []common.Address - if o.OperatorForwarderFlow { var operators []common.Address operators, forwarders, _ = actions.DeployForwarderContracts( @@ -310,17 +310,17 @@ func (o *OCRSoakTest) Setup(ocrTestConfig tt.OcrTestConfig) { o.ocrV1Instances, err = actions.DeployOCRContractsForwarderFlow( o.log, o.seth, - *o.Config.GetActiveOCRConfig().Soak.NumberOfContracts, + o.Config.GetActiveOCRConfig(), common.HexToAddress(linkContract.Address()), contracts.ChainlinkK8sClientToChainlinkNodeWithKeysAndAddress(o.workerNodes), forwarders, ) require.NoError(o.t, err, "Error deploying OCR Forwarder contracts") } else { - o.ocrV1Instances, err = actions.DeployOCRv1Contracts( + o.ocrV1Instances, err = actions.SetupOCRv1Contracts( o.log, sethClient, - *o.Config.GetActiveOCRConfig().Soak.NumberOfContracts, + o.Config.GetActiveOCRConfig(), common.HexToAddress(linkContract.Address()), contracts.ChainlinkK8sClientToChainlinkNodeWithKeysAndAddress(o.workerNodes), ) @@ -342,19 +342,22 @@ func (o *OCRSoakTest) Setup(ocrTestConfig tt.OcrTestConfig) { } ocrOffchainOptions := contracts.DefaultOffChainAggregatorOptions() - o.ocrV2Instances, err = actions.DeployOCRv2Contracts( + o.ocrV2Instances, err = actions.SetupOCRv2Contracts( o.log, o.seth, - *ocrTestConfig.GetActiveOCRConfig().Soak.NumberOfContracts, + ocrTestConfig.GetActiveOCRConfig(), common.HexToAddress(linkContract.Address()), transmitters, ocrOffchainOptions, ) require.NoError(o.t, err, "Error deploying OCRv2 contracts") - contractConfig, err := actions.BuildMedianOCR2Config(o.workerNodes, ocrOffchainOptions) - require.NoError(o.t, err, "Error building median config") - err = actions.ConfigureOCRv2AggregatorContracts(contractConfig, o.ocrV2Instances) - require.NoError(o.t, err, "Error configuring OCRv2 aggregator contracts") + + if !ocrTestConfig.GetActiveOCRConfig().UseExistingOffChainAggregatorsContracts() || (ocrTestConfig.GetActiveOCRConfig().UseExistingOffChainAggregatorsContracts() && ocrTestConfig.GetActiveOCRConfig().ConfigureExistingOffChainAggregatorsContracts()) { + contractConfig, err := actions.BuildMedianOCR2Config(o.workerNodes, ocrOffchainOptions) + require.NoError(o.t, err, "Error building median config") + err = actions.ConfigureOCRv2AggregatorContracts(contractConfig, o.ocrV2Instances) + require.NoError(o.t, err, "Error configuring OCRv2 aggregator contracts") + } } if o.OCRVersion == "1" { @@ -398,7 +401,7 @@ func (o *OCRSoakTest) Run() { o.log.Info(). Str("Test Duration", o.Config.GetActiveOCRConfig().Common.TestDuration.Duration.Truncate(time.Second).String()). - Int("Number of OCR Contracts", *config.GetActiveOCRConfig().Soak.NumberOfContracts). + Int("Number of OCR Contracts", *config.GetActiveOCRConfig().Common.NumberOfContracts). Str("OCR Version", o.OCRVersion). Msg("Starting OCR Soak Test") @@ -529,7 +532,7 @@ func (o *OCRSoakTest) LoadState() error { if testState.OCRVersion == "1" { o.ocrV1Instances = make([]contracts.OffchainAggregator, len(testState.OCRContractAddresses)) for i, addr := range testState.OCRContractAddresses { - instance, err := contracts.LoadOffchainAggregator(o.log, o.seth, common.HexToAddress(addr)) + instance, err := contracts.LoadOffChainAggregator(o.log, o.seth, common.HexToAddress(addr)) if err != nil { return fmt.Errorf("failed to instantiate OCR instance: %w", err) } @@ -538,7 +541,7 @@ func (o *OCRSoakTest) LoadState() error { } else if testState.OCRVersion == "2" { o.ocrV2Instances = make([]contracts.OffchainAggregatorV2, len(testState.OCRContractAddresses)) for i, addr := range testState.OCRContractAddresses { - instance, err := contracts.LoadOffChainAggregatorV2(o.log, o.seth, common.HexToAddress(addr)) + instance, err := contracts.LoadOffchainAggregatorV2(o.log, o.seth, common.HexToAddress(addr)) if err != nil { return err } @@ -546,11 +549,7 @@ func (o *OCRSoakTest) LoadState() error { } } - o.mockServer, err = ctf_client.ConnectMockServerURL(testState.MockServerURL) - if err != nil { - return err - } - + o.mockServer = ctf_client.ConnectMockServerURL(testState.MockServerURL) return err } @@ -564,7 +563,7 @@ func (o *OCRSoakTest) Resume() { Str("Time Left", o.timeLeft.String()). Msg("Resuming OCR Soak Test") - ocrAddresses := make([]common.Address, *o.Config.GetActiveOCRConfig().Soak.NumberOfContracts) + ocrAddresses := make([]common.Address, *o.Config.GetActiveOCRConfig().Common.NumberOfContracts) if o.OCRVersion == "1" { for i, ocrInstance := range o.ocrV1Instances { @@ -683,11 +682,11 @@ func (o *OCRSoakTest) testLoop(testDuration time.Duration, newValue int) { if len(o.chaosList) > 0 { for _, chaos := range o.chaosList { chaos.Create(context.Background()) - chaos.AddListener(k8schaos.NewChaosLogger(o.log)) + chaos.AddListener(havoc.NewChaosLogger(o.log)) chaos.AddListener(ocrTestChaosListener{t: o.t}) // Add Grafana annotation if configured if o.Config.Logging.Grafana != nil && o.Config.Logging.Grafana.BaseUrl != nil && o.Config.Logging.Grafana.BearerToken != nil && o.Config.Logging.Grafana.DashboardUID != nil { - chaos.AddListener(k8schaos.NewSingleLineGrafanaAnnotator(*o.Config.Logging.Grafana.BaseUrl, *o.Config.Logging.Grafana.BearerToken, *o.Config.Logging.Grafana.DashboardUID, o.log)) + chaos.AddListener(havoc.NewSingleLineGrafanaAnnotator(*o.Config.Logging.Grafana.BaseUrl, *o.Config.Logging.Grafana.BearerToken, *o.Config.Logging.Grafana.DashboardUID, o.log)) } else { o.log.Warn().Msg("Skipping Grafana annotation for chaos simulation. Grafana config is missing either BearerToken, BaseUrl or DashboardUID") } @@ -744,7 +743,7 @@ func (o *OCRSoakTest) complete() { } func (o *OCRSoakTest) startGethBlockchainReorg(network blockchain.EVMNetwork, conf ctf_config.ReorgConfig) { - client := ctf_client.NewRPCClient(network.HTTPURLs[0]) + client := ctf_client.NewRPCClient(network.HTTPURLs[0], nil) o.log.Info(). Str("URL", client.URL). Int("Depth", conf.Depth). @@ -756,7 +755,7 @@ func (o *OCRSoakTest) startGethBlockchainReorg(network blockchain.EVMNetwork, co } func (o *OCRSoakTest) startAnvilGasSpikeSimulation(network blockchain.EVMNetwork, conf ctf_config.GasSpikeSimulationConfig) { - client := ctf_client.NewRPCClient(network.HTTPURLs[0]) + client := ctf_client.NewRPCClient(network.HTTPURLs[0], nil) o.log.Info(). Str("URL", client.URL). Any("GasSpikeSimulationConfig", conf). @@ -769,7 +768,7 @@ func (o *OCRSoakTest) startAnvilGasSpikeSimulation(network blockchain.EVMNetwork } func (o *OCRSoakTest) startAnvilGasLimitSimulation(network blockchain.EVMNetwork, conf ctf_config.GasLimitSimulationConfig) { - client := ctf_client.NewRPCClient(network.HTTPURLs[0]) + client := ctf_client.NewRPCClient(network.HTTPURLs[0], nil) latestBlock, err := o.seth.Client.BlockByNumber(context.Background(), nil) require.NoError(o.t, err) newGasLimit := int64(math.Ceil(float64(latestBlock.GasUsed()) * conf.NextGasLimitPercentage)) @@ -1024,12 +1023,12 @@ func (o *OCRSoakTest) collectEvents() error { // ensureValues ensures that all values needed to run the test are present func (o *OCRSoakTest) ensureInputValues() error { - ocrConfig := o.Config.GetActiveOCRConfig().Soak + ocrConfig := o.Config.GetActiveOCRConfig() if o.OCRVersion != "1" && o.OCRVersion != "2" { return fmt.Errorf("OCR version must be 1 or 2, found %s", o.OCRVersion) } - if ocrConfig.NumberOfContracts != nil && *ocrConfig.NumberOfContracts <= 0 { - return fmt.Errorf("number of OCR contracts must be set and greater than 0, found %d", ocrConfig.NumberOfContracts) + if ocrConfig.Common.NumberOfContracts != nil && *ocrConfig.Common.NumberOfContracts <= 0 { + return fmt.Errorf("number of OCR contracts must be set and greater than 0, found %d", ocrConfig.Common.NumberOfContracts) } if o.Config.Common.ChainlinkNodeFunding != nil && *o.Config.Common.ChainlinkNodeFunding <= 0 { return fmt.Errorf("chainlink node funding must be greater than 0, found %f", *o.Config.Common.ChainlinkNodeFunding) @@ -1037,11 +1036,12 @@ func (o *OCRSoakTest) ensureInputValues() error { if o.Config.GetActiveOCRConfig().Common.TestDuration != nil && o.Config.GetActiveOCRConfig().Common.TestDuration.Duration <= time.Minute { return fmt.Errorf("test duration must be greater than 1 minute, found %s", o.Config.GetActiveOCRConfig().Common.TestDuration) } - if ocrConfig.TimeBetweenRounds != nil && ocrConfig.TimeBetweenRounds.Duration >= time.Hour { - return fmt.Errorf("time between rounds must be less than 1 hour, found %s", ocrConfig.TimeBetweenRounds) + soakConfig := ocrConfig.Soak + if soakConfig.TimeBetweenRounds != nil && soakConfig.TimeBetweenRounds.Duration >= time.Hour { + return fmt.Errorf("time between rounds must be less than 1 hour, found %s", soakConfig.TimeBetweenRounds) } - if ocrConfig.TimeBetweenRounds != nil && ocrConfig.TimeBetweenRounds.Duration < time.Second*30 { - return fmt.Errorf("time between rounds must be greater or equal to 30 seconds, found %s", ocrConfig.TimeBetweenRounds) + if soakConfig.TimeBetweenRounds != nil && soakConfig.TimeBetweenRounds.Duration < time.Second*30 { + return fmt.Errorf("time between rounds must be greater or equal to 30 seconds, found %s", soakConfig.TimeBetweenRounds) } return nil @@ -1112,28 +1112,28 @@ type ocrTestChaosListener struct { t *testing.T } -func (l ocrTestChaosListener) OnChaosCreated(_ k8schaos.Chaos) { +func (l ocrTestChaosListener) OnChaosCreated(_ havoc.Chaos) { } -func (l ocrTestChaosListener) OnChaosCreationFailed(chaos k8schaos.Chaos, reason error) { +func (l ocrTestChaosListener) OnChaosCreationFailed(chaos havoc.Chaos, reason error) { // Fail the test if chaos creation fails during chaos simulation require.FailNow(l.t, "Error creating chaos simulation", reason.Error(), chaos) } -func (l ocrTestChaosListener) OnChaosStarted(_ k8schaos.Chaos) { +func (l ocrTestChaosListener) OnChaosStarted(_ havoc.Chaos) { } -func (l ocrTestChaosListener) OnChaosPaused(_ k8schaos.Chaos) { +func (l ocrTestChaosListener) OnChaosPaused(_ havoc.Chaos) { } -func (l ocrTestChaosListener) OnChaosEnded(_ k8schaos.Chaos) { +func (l ocrTestChaosListener) OnChaosEnded(_ havoc.Chaos) { } -func (l ocrTestChaosListener) OnChaosStatusUnknown(_ k8schaos.Chaos) { +func (l ocrTestChaosListener) OnChaosStatusUnknown(_ havoc.Chaos) { } -func (l ocrTestChaosListener) OnScheduleCreated(_ k8schaos.Schedule) { +func (l ocrTestChaosListener) OnScheduleCreated(_ havoc.Schedule) { } -func (l ocrTestChaosListener) OnScheduleDeleted(_ k8schaos.Schedule) { +func (l ocrTestChaosListener) OnScheduleDeleted(_ havoc.Schedule) { } diff --git a/integration-tests/types/config/node/core.go b/integration-tests/types/config/node/core.go index 181d57a17ed..7b5230f401f 100644 --- a/integration-tests/types/config/node/core.go +++ b/integration-tests/types/config/node/core.go @@ -14,8 +14,8 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/config" commonconfig "github.com/smartcontractkit/chainlink-common/pkg/config" - "github.com/smartcontractkit/chainlink-testing-framework/blockchain" - "github.com/smartcontractkit/chainlink-testing-framework/utils/ptr" + "github.com/smartcontractkit/chainlink-testing-framework/lib/blockchain" + "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/ptr" itutils "github.com/smartcontractkit/chainlink/integration-tests/utils" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" evmcfg "github.com/smartcontractkit/chainlink/v2/core/chains/evm/config/toml" diff --git a/integration-tests/types/testconfigs.go b/integration-tests/types/testconfigs.go index ee8a614baef..7a72e9a1dfa 100644 --- a/integration-tests/types/testconfigs.go +++ b/integration-tests/types/testconfigs.go @@ -1,8 +1,9 @@ package types import ( - ctf_config "github.com/smartcontractkit/chainlink-testing-framework/config" - "github.com/smartcontractkit/chainlink-testing-framework/testreporters" + ctf_config "github.com/smartcontractkit/chainlink-testing-framework/lib/config" + "github.com/smartcontractkit/chainlink-testing-framework/lib/testreporters" + tc "github.com/smartcontractkit/chainlink/integration-tests/testconfig" ) @@ -31,10 +32,10 @@ type AutomationTestConfig interface { tc.AutomationTestConfig } -type KeeperBenchmarkTestConfig interface { +type AutomationBenchmarkTestConfig interface { ctf_config.GlobalTestConfig tc.CommonTestConfig - tc.KeeperTestConfig + tc.AutomationTestConfig ctf_config.NamedConfigurations testreporters.GrafanaURLProvider } @@ -51,3 +52,9 @@ type Ocr2TestConfig interface { tc.CommonTestConfig tc.Ocr2TestConfig } + +type CCIPTestConfig interface { + ctf_config.GlobalTestConfig + tc.CommonTestConfig + tc.CCIPTestConfig +} diff --git a/integration-tests/universal/log_poller/gun.go b/integration-tests/universal/log_poller/gun.go index a75209aa101..287041ce411 100644 --- a/integration-tests/universal/log_poller/gun.go +++ b/integration-tests/universal/log_poller/gun.go @@ -7,7 +7,7 @@ import ( "github.com/ethereum/go-ethereum/accounts/abi" "github.com/rs/zerolog" - "github.com/smartcontractkit/wasp" + "github.com/smartcontractkit/chainlink-testing-framework/wasp" "github.com/smartcontractkit/chainlink/integration-tests/contracts" ) diff --git a/integration-tests/universal/log_poller/helpers.go b/integration-tests/universal/log_poller/helpers.go index ee4060f7aba..ec40348947e 100644 --- a/integration-tests/universal/log_poller/helpers.go +++ b/integration-tests/universal/log_poller/helpers.go @@ -13,25 +13,27 @@ import ( "testing" "time" + "github.com/smartcontractkit/chainlink/integration-tests/utils" + + "github.com/jmoiron/sqlx" + + "github.com/smartcontractkit/chainlink-testing-framework/wasp" + + "github.com/smartcontractkit/chainlink-testing-framework/seth" + geth "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/common" geth_types "github.com/ethereum/go-ethereum/core/types" - "github.com/jmoiron/sqlx" "github.com/rs/zerolog" "github.com/scylladb/go-reflectx" "github.com/stretchr/testify/require" - "github.com/smartcontractkit/seth" - "github.com/smartcontractkit/wasp" - - "github.com/smartcontractkit/chainlink-testing-framework/blockchain" - ctf_concurrency "github.com/smartcontractkit/chainlink-testing-framework/concurrency" - ctf_test_env "github.com/smartcontractkit/chainlink-testing-framework/docker/test_env" - "github.com/smartcontractkit/chainlink-testing-framework/logging" - "github.com/smartcontractkit/chainlink-testing-framework/networks" - seth_utils "github.com/smartcontractkit/chainlink-testing-framework/utils/seth" - + "github.com/smartcontractkit/chainlink-testing-framework/lib/blockchain" + ctf_concurrency "github.com/smartcontractkit/chainlink-testing-framework/lib/concurrency" + ctf_test_env "github.com/smartcontractkit/chainlink-testing-framework/lib/docker/test_env" + "github.com/smartcontractkit/chainlink-testing-framework/lib/logging" + "github.com/smartcontractkit/chainlink-testing-framework/lib/networks" "github.com/smartcontractkit/chainlink/integration-tests/actions" "github.com/smartcontractkit/chainlink/integration-tests/client" "github.com/smartcontractkit/chainlink/integration-tests/contracts" @@ -1060,7 +1062,7 @@ func SetupLogPollerTestDocker( evmNetwork, err := env.GetFirstEvmNetwork() require.NoError(t, err, "Error getting first evm network") - chainClient, err := seth_utils.GetChainClient(testConfig, *evmNetwork) + chainClient, err := utils.TestAwareSethClient(t, testConfig, evmNetwork) require.NoError(t, err, "Error getting seth client") err = actions.FundChainlinkNodesFromRootAddress(l, chainClient, contracts.ChainlinkClientToChainlinkNodeWithKeysAndAddress(env.ClCluster.NodeAPIs()), big.NewFloat(chainlinkNodeFunding)) @@ -1072,6 +1074,13 @@ func SetupLogPollerTestDocker( linkToken, err := contracts.DeployLinkTokenContract(l, chainClient) require.NoError(t, err, "Error deploying LINK token") + wethToken, err := contracts.DeployWETHTokenContract(l, chainClient) + require.NoError(t, err, "Error deploying weth token contract") + + // This feed is used for both eth/usd and link/usd + ethUSDFeed, err := contracts.DeployMockETHUSDFeed(chainClient, registryConfig.FallbackLinkPrice) + require.NoError(t, err, "Error deploying eth usd feed contract") + linkBalance, err := linkToken.BalanceOf(context.Background(), chainClient.MustGetRootKeyAddress().Hex()) require.NoError(t, err, "Error getting LINK balance") @@ -1088,6 +1097,8 @@ func SetupLogPollerTestDocker( registryVersion, registryConfig, linkToken, + wethToken, + ethUSDFeed, ) // Fund the registry with LINK diff --git a/integration-tests/utils/seth.go b/integration-tests/utils/seth.go new file mode 100644 index 00000000000..704d9547721 --- /dev/null +++ b/integration-tests/utils/seth.go @@ -0,0 +1,24 @@ +package utils + +import ( + "fmt" + "testing" + + "github.com/smartcontractkit/chainlink-testing-framework/lib/blockchain" + ctf_config "github.com/smartcontractkit/chainlink-testing-framework/lib/config" + seth_utils "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/seth" + pkg_seth "github.com/smartcontractkit/chainlink-testing-framework/seth" +) + +// DynamicArtifactDirConfigFn returns a function that sets Seth's artifacts directory to a unique directory for the test +func DynamicArtifactDirConfigFn(t *testing.T) func(*pkg_seth.Config) error { + return func(cfg *pkg_seth.Config) error { + cfg.ArtifactsDir = fmt.Sprintf("seth_artifacts/%s", t.Name()) + return nil + } +} + +// TestAwareSethClient returns a Seth client with the artifacts directory set to a unique directory for the test +func TestAwareSethClient(t *testing.T, sethConfig ctf_config.SethConfig, evmNetwork *blockchain.EVMNetwork) (*pkg_seth.Client, error) { + return seth_utils.GetChainClientWithConfigFunction(sethConfig, *evmNetwork, DynamicArtifactDirConfigFn(t)) +} diff --git a/integration-tests/utils/templates/secrets.go b/integration-tests/utils/templates/secrets.go index 45edf0d0127..96a16bdb3eb 100644 --- a/integration-tests/utils/templates/secrets.go +++ b/integration-tests/utils/templates/secrets.go @@ -3,7 +3,7 @@ package templates import ( "github.com/google/uuid" - "github.com/smartcontractkit/chainlink-testing-framework/utils/templates" + "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/templates" ) // NodeSecretsTemplate are used as text templates because of secret redacted fields of chainlink.Secrets diff --git a/integration-tests/web/sdk/README.md b/integration-tests/web/sdk/README.md new file mode 100644 index 00000000000..aa730e3a948 --- /dev/null +++ b/integration-tests/web/sdk/README.md @@ -0,0 +1,13 @@ +## GQL SDK + +This package exports a `Client` for interacting with the `feeds-manager` service of core. The implementation is based on code generated via `[genqlient](https://github.com/Khan/genqlient)`. + +### Extending the Client + +Add additional queries or mutations to `genqlient.graphql` and then regenerate the implementation via the Taskfile: + +```bash +$ task generate +``` + +Next, extend the `Client` interface and the `client` implementation. diff --git a/integration-tests/web/sdk/client/client.go b/integration-tests/web/sdk/client/client.go new file mode 100644 index 00000000000..783a8a88565 --- /dev/null +++ b/integration-tests/web/sdk/client/client.go @@ -0,0 +1,253 @@ +package client + +import ( + "context" + "encoding/json" + "fmt" + "net/http" + "strings" + + "github.com/AlekSi/pointer" + "github.com/Khan/genqlient/graphql" + + "github.com/smartcontractkit/chainlink/integration-tests/web/sdk/client/doer" + "github.com/smartcontractkit/chainlink/integration-tests/web/sdk/internal/generated" +) + +type Client interface { + FetchCSAPublicKey(ctx context.Context) (*string, error) + FetchP2PPeerID(ctx context.Context) (*string, error) + FetchAccountAddress(ctx context.Context, chainID string) (*string, error) + FetchOCR2KeyBundleID(ctx context.Context, chainType string) (string, error) + GetJob(ctx context.Context, id string) (*generated.GetJobResponse, error) + ListJobs(ctx context.Context, offset, limit int) (*generated.ListJobsResponse, error) + GetJobDistributor(ctx context.Context, id string) (*generated.GetFeedsManagerResponse, error) + ListJobDistributors(ctx context.Context) (*generated.ListFeedsManagersResponse, error) + CreateJobDistributor(ctx context.Context, cmd JobDistributorInput) (string, error) + UpdateJobDistributor(ctx context.Context, id string, cmd JobDistributorInput) error + CreateJobDistributorChainConfig(ctx context.Context, in JobDistributorChainConfigInput) error + GetJobProposal(ctx context.Context, id string) (*generated.GetJobProposalResponse, error) + ApproveJobProposalSpec(ctx context.Context, id string, force bool) (*JobProposalApprovalSuccessSpec, error) + CancelJobProposalSpec(ctx context.Context, id string) (*generated.CancelJobProposalSpecResponse, error) + RejectJobProposalSpec(ctx context.Context, id string) (*generated.RejectJobProposalSpecResponse, error) + UpdateJobProposalSpecDefinition(ctx context.Context, id string, cmd generated.UpdateJobProposalSpecDefinitionInput) (*generated.UpdateJobProposalSpecDefinitionResponse, error) +} + +type client struct { + gqlClient graphql.Client + credentials Credentials + endpoints endpoints + cookie string +} + +type endpoints struct { + Sessions string + Query string +} + +type Credentials struct { + Email string `json:"email"` + Password string `json:"password"` +} + +func New(baseURI string, creds Credentials) (Client, error) { + ep := endpoints{ + Sessions: baseURI + "/sessions", + Query: baseURI + "/query", + } + c := &client{ + endpoints: ep, + credentials: creds, + } + + if err := c.login(); err != nil { + return nil, fmt.Errorf("failed to login to node: %w", err) + } + + c.gqlClient = graphql.NewClient( + c.endpoints.Query, + doer.NewAuthed(c.cookie), + ) + + return c, nil +} + +func (c *client) FetchCSAPublicKey(ctx context.Context) (*string, error) { + keys, err := generated.FetchCSAKeys(ctx, c.gqlClient) + if err != nil { + return nil, err + } + if keys == nil || len(keys.CsaKeys.GetResults()) == 0 { + return nil, fmt.Errorf("no CSA keys found") + } + return &keys.CsaKeys.GetResults()[0].PublicKey, nil +} + +func (c *client) FetchP2PPeerID(ctx context.Context) (*string, error) { + keys, err := generated.FetchP2PKeys(ctx, c.gqlClient) + if err != nil { + return nil, err + } + if keys == nil || len(keys.P2pKeys.GetResults()) == 0 { + return nil, fmt.Errorf("no P2P keys found") + } + return &keys.P2pKeys.GetResults()[0].PeerID, nil +} + +func (c *client) FetchOCR2KeyBundleID(ctx context.Context, chainType string) (string, error) { + keyBundles, err := generated.FetchOCR2KeyBundles(ctx, c.gqlClient) + if err != nil { + return "", err + } + if keyBundles == nil || len(keyBundles.GetOcr2KeyBundles().Results) == 0 { + return "", fmt.Errorf("no ocr2 keybundle found, check if ocr2 is enabled") + } + for _, keyBundle := range keyBundles.GetOcr2KeyBundles().Results { + if keyBundle.ChainType == generated.OCR2ChainType(chainType) { + return keyBundle.GetId(), nil + } + } + return "", fmt.Errorf("no ocr2 keybundle found for chain type %s", chainType) +} + +func (c *client) FetchAccountAddress(ctx context.Context, chainID string) (*string, error) { + keys, err := generated.FetchAccounts(ctx, c.gqlClient) + if err != nil { + return nil, err + } + if keys == nil || len(keys.EthKeys.GetResults()) == 0 { + return nil, fmt.Errorf("no accounts found") + } + for _, keyDetail := range keys.EthKeys.GetResults() { + if keyDetail.GetChain().Enabled && keyDetail.GetChain().Id == chainID { + return pointer.ToString(keyDetail.Address), nil + } + } + return nil, fmt.Errorf("no account found for chain %s", chainID) +} + +func (c *client) GetJob(ctx context.Context, id string) (*generated.GetJobResponse, error) { + return generated.GetJob(ctx, c.gqlClient, id) +} + +func (c *client) ListJobs(ctx context.Context, offset, limit int) (*generated.ListJobsResponse, error) { + return generated.ListJobs(ctx, c.gqlClient, offset, limit) +} + +func (c *client) GetBridge(ctx context.Context, id string) (*generated.GetBridgeResponse, error) { + return generated.GetBridge(ctx, c.gqlClient, id) +} + +func (c *client) ListBridges(ctx context.Context, offset, limit int) (*generated.ListBridgesResponse, error) { + return generated.ListBridges(ctx, c.gqlClient, offset, limit) +} + +func (c *client) GetJobDistributor(ctx context.Context, id string) (*generated.GetFeedsManagerResponse, error) { + return generated.GetFeedsManager(ctx, c.gqlClient, id) +} + +func (c *client) ListJobDistributors(ctx context.Context) (*generated.ListFeedsManagersResponse, error) { + return generated.ListFeedsManagers(ctx, c.gqlClient) +} + +func (c *client) CreateJobDistributor(ctx context.Context, in JobDistributorInput) (string, error) { + var cmd generated.CreateFeedsManagerInput + err := DecodeInput(in, &cmd) + if err != nil { + return "", err + } + response, err := generated.CreateFeedsManager(ctx, c.gqlClient, cmd) + if err != nil { + return "", err + } + // Access the FeedsManager ID + if success, ok := response.GetCreateFeedsManager().(*generated.CreateFeedsManagerCreateFeedsManagerCreateFeedsManagerSuccess); ok { + feedsManager := success.GetFeedsManager() + return feedsManager.GetId(), nil + } + return "", fmt.Errorf("failed to create feeds manager") +} + +func (c *client) UpdateJobDistributor(ctx context.Context, id string, in JobDistributorInput) error { + var cmd generated.UpdateFeedsManagerInput + err := DecodeInput(in, &cmd) + if err != nil { + return err + } + _, err = generated.UpdateFeedsManager(ctx, c.gqlClient, id, cmd) + return err +} + +func (c *client) CreateJobDistributorChainConfig(ctx context.Context, in JobDistributorChainConfigInput) error { + var cmd generated.CreateFeedsManagerChainConfigInput + err := DecodeInput(in, &cmd) + if err != nil { + return err + } + _, err = generated.CreateFeedsManagerChainConfig(ctx, c.gqlClient, cmd) + return err +} + +func (c *client) GetJobProposal(ctx context.Context, id string) (*generated.GetJobProposalResponse, error) { + return generated.GetJobProposal(ctx, c.gqlClient, id) +} + +func (c *client) ApproveJobProposalSpec(ctx context.Context, id string, force bool) (*JobProposalApprovalSuccessSpec, error) { + res, err := generated.ApproveJobProposalSpec(ctx, c.gqlClient, id, force) + if err != nil { + return nil, err + } + if success, ok := res.GetApproveJobProposalSpec().(*generated.ApproveJobProposalSpecApproveJobProposalSpecApproveJobProposalSpecSuccess); ok { + var cmd JobProposalApprovalSuccessSpec + if success.Spec.Status == generated.SpecStatusApproved { + err := DecodeInput(success.Spec, &cmd) + if err != nil { + return nil, fmt.Errorf("failed to decode job proposal spec: %w ; and job proposal spec not approved", err) + } + return &cmd, nil + } + } + return nil, fmt.Errorf("failed to approve job proposal spec") +} + +func (c *client) CancelJobProposalSpec(ctx context.Context, id string) (*generated.CancelJobProposalSpecResponse, error) { + return generated.CancelJobProposalSpec(ctx, c.gqlClient, id) +} + +func (c *client) RejectJobProposalSpec(ctx context.Context, id string) (*generated.RejectJobProposalSpecResponse, error) { + return generated.RejectJobProposalSpec(ctx, c.gqlClient, id) +} + +func (c *client) UpdateJobProposalSpecDefinition(ctx context.Context, id string, cmd generated.UpdateJobProposalSpecDefinitionInput) (*generated.UpdateJobProposalSpecDefinitionResponse, error) { + return generated.UpdateJobProposalSpecDefinition(ctx, c.gqlClient, id, cmd) +} + +func (c *client) login() error { + b, err := json.Marshal(c.credentials) + if err != nil { + return fmt.Errorf("failed to marshal credentials: %w", err) + } + + payload := strings.NewReader(string(b)) + + req, err := http.NewRequest("POST", c.endpoints.Sessions, payload) + if err != nil { + return err + } + + req.Header.Add("Content-Type", "application/json") + + res, err := http.DefaultClient.Do(req) + if err != nil { + return err + } + defer res.Body.Close() + + cookieHeader := res.Header.Get("Set-Cookie") + if cookieHeader == "" { + return fmt.Errorf("no cookie found in header") + } + + c.cookie = strings.Split(cookieHeader, ";")[0] + return nil +} diff --git a/integration-tests/web/sdk/client/doer/doer.go b/integration-tests/web/sdk/client/doer/doer.go new file mode 100644 index 00000000000..dde842bae5d --- /dev/null +++ b/integration-tests/web/sdk/client/doer/doer.go @@ -0,0 +1,20 @@ +package doer + +import "net/http" + +type Authed struct { + cookie string + wrapped *http.Client +} + +func NewAuthed(cookie string) *Authed { + return &Authed{ + cookie: cookie, + wrapped: http.DefaultClient, + } +} + +func (a *Authed) Do(req *http.Request) (*http.Response, error) { + req.Header.Set("cookie", a.cookie) + return a.wrapped.Do(req) +} diff --git a/integration-tests/web/sdk/client/types.go b/integration-tests/web/sdk/client/types.go new file mode 100644 index 00000000000..d213ee161c6 --- /dev/null +++ b/integration-tests/web/sdk/client/types.go @@ -0,0 +1,60 @@ +package client + +import ( + "bytes" + "encoding/json" + "fmt" + "reflect" +) + +type JobDistributorInput struct { + Name string `json:"name"` + Uri string `json:"uri"` + PublicKey string `json:"publicKey"` +} + +type JobDistributorChainConfigInput struct { + JobDistributorID string `json:"feedsManagerID"` + ChainID string `json:"chainID"` + ChainType string `json:"chainType"` + AccountAddr string `json:"accountAddr"` + AccountAddrPubKey string `json:"accountAddrPubKey"` + AdminAddr string `json:"adminAddr"` + FluxMonitorEnabled bool `json:"fluxMonitorEnabled"` + Ocr1Enabled bool `json:"ocr1Enabled"` + Ocr1IsBootstrap bool `json:"ocr1IsBootstrap"` + Ocr1Multiaddr string `json:"ocr1Multiaddr"` + Ocr1P2PPeerID string `json:"ocr1P2PPeerID"` + Ocr1KeyBundleID string `json:"ocr1KeyBundleID"` + Ocr2Enabled bool `json:"ocr2Enabled"` + Ocr2IsBootstrap bool `json:"ocr2IsBootstrap"` + Ocr2Multiaddr string `json:"ocr2Multiaddr"` + Ocr2ForwarderAddress string `json:"ocr2ForwarderAddress"` + Ocr2P2PPeerID string `json:"ocr2P2PPeerID"` + Ocr2KeyBundleID string `json:"ocr2KeyBundleID"` + Ocr2Plugins string `json:"ocr2Plugins"` +} + +type JobProposalApprovalSuccessSpec struct { + Id string `json:"id"` + Definition string `json:"definition"` + Version int `json:"version"` + Status string `json:"status"` + StatusUpdatedAt string `json:"statusUpdatedAt"` + CreatedAt string `json:"createdAt"` + UpdatedAt string `json:"updatedAt"` +} + +func DecodeInput(in, out any) error { + if reflect.TypeOf(out).Kind() != reflect.Ptr || reflect.ValueOf(out).IsNil() { + return fmt.Errorf("out type must be a non-nil pointer") + } + jsonBytes, err := json.Marshal(in) + if err != nil { + return err + } + + decoder := json.NewDecoder(bytes.NewReader(jsonBytes)) + decoder.DisallowUnknownFields() + return decoder.Decode(out) +} diff --git a/integration-tests/web/sdk/client/types_test.go b/integration-tests/web/sdk/client/types_test.go new file mode 100644 index 00000000000..dd9b48274da --- /dev/null +++ b/integration-tests/web/sdk/client/types_test.go @@ -0,0 +1,67 @@ +package client + +import ( + "testing" + + "github.com/smartcontractkit/chainlink/integration-tests/web/sdk/internal/generated" +) + +func TestDecodeInput(t *testing.T) { + type args struct { + in any + out any + } + tests := []struct { + name string + args args + wantErr bool + errMessage string + }{ + { + name: "success", + args: args{&JobDistributorInput{ + Name: "name", + Uri: "uri", + PublicKey: "publicKey", + }, &generated.CreateFeedsManagerInput{}}, + wantErr: false, + errMessage: "", + }, + { + name: "non-pointer", + args: args{&JobDistributorInput{ + Name: "name", + Uri: "uri", + PublicKey: "publicKey", + }, generated.CreateFeedsManagerInput{}}, + wantErr: true, + errMessage: "out type must be a non-nil pointer", + }, + { + name: "incorrect type", + args: args{&JobDistributorInput{ + Name: "name", + Uri: "uri", + PublicKey: "publicKey", + }, generated.CreateFeedsManagerChainConfigInput{}}, + wantErr: true, + errMessage: "json: cannot unmarshal object into Go value of type generated.CreateFeedsManagerChainConfigInput", + }, + { + name: "success", + args: args{&JobDistributorInput{ + Name: "name", + Uri: "uri", + PublicKey: "publicKey", + }, &generated.UpdateFeedsManagerInput{}}, + wantErr: false, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + if err := DecodeInput(tt.args.in, tt.args.out); (err != nil) != tt.wantErr { + t.Errorf("DecodeInput() error = %v, wantErr %v", err, tt.wantErr) + } + }) + } +} diff --git a/integration-tests/web/sdk/genqlient.yaml b/integration-tests/web/sdk/genqlient.yaml new file mode 100644 index 00000000000..2b861a92ee4 --- /dev/null +++ b/integration-tests/web/sdk/genqlient.yaml @@ -0,0 +1,15 @@ +# Default genqlient config; for full documentation see: +# https://github.com/Khan/genqlient/blob/main/docs/genqlient.yaml +schema: ./internal/schema.graphql + +operations: +- ./internal/genqlient.graphql + +generated: ./internal/generated/generated.go + +bindings: + Time: + type: string + +package_bindings: +- package: github.com/smartcontractkit/chainlink/v2/core/web/gqlscalar diff --git a/integration-tests/web/sdk/internal/generated/generated.go b/integration-tests/web/sdk/internal/generated/generated.go new file mode 100644 index 00000000000..8efde4c453f --- /dev/null +++ b/integration-tests/web/sdk/internal/generated/generated.go @@ -0,0 +1,5880 @@ +// Code generated by github.com/Khan/genqlient, DO NOT EDIT. + +package generated + +import ( + "context" + "encoding/json" + "fmt" + + "github.com/Khan/genqlient/graphql" + "github.com/smartcontractkit/chainlink/v2/core/web/gqlscalar" +) + +// ApproveJobProposalSpecApproveJobProposalSpecApproveJobProposalSpecPayload includes the requested fields of the GraphQL interface ApproveJobProposalSpecPayload. +// +// ApproveJobProposalSpecApproveJobProposalSpecApproveJobProposalSpecPayload is implemented by the following types: +// ApproveJobProposalSpecApproveJobProposalSpecApproveJobProposalSpecSuccess +// ApproveJobProposalSpecApproveJobProposalSpecJobAlreadyExistsError +// ApproveJobProposalSpecApproveJobProposalSpecNotFoundError +type ApproveJobProposalSpecApproveJobProposalSpecApproveJobProposalSpecPayload interface { + implementsGraphQLInterfaceApproveJobProposalSpecApproveJobProposalSpecApproveJobProposalSpecPayload() + // GetTypename returns the receiver's concrete GraphQL type-name (see interface doc for possible values). + GetTypename() string +} + +func (v *ApproveJobProposalSpecApproveJobProposalSpecApproveJobProposalSpecSuccess) implementsGraphQLInterfaceApproveJobProposalSpecApproveJobProposalSpecApproveJobProposalSpecPayload() { +} +func (v *ApproveJobProposalSpecApproveJobProposalSpecJobAlreadyExistsError) implementsGraphQLInterfaceApproveJobProposalSpecApproveJobProposalSpecApproveJobProposalSpecPayload() { +} +func (v *ApproveJobProposalSpecApproveJobProposalSpecNotFoundError) implementsGraphQLInterfaceApproveJobProposalSpecApproveJobProposalSpecApproveJobProposalSpecPayload() { +} + +func __unmarshalApproveJobProposalSpecApproveJobProposalSpecApproveJobProposalSpecPayload(b []byte, v *ApproveJobProposalSpecApproveJobProposalSpecApproveJobProposalSpecPayload) error { + if string(b) == "null" { + return nil + } + + var tn struct { + TypeName string `json:"__typename"` + } + err := json.Unmarshal(b, &tn) + if err != nil { + return err + } + + switch tn.TypeName { + case "ApproveJobProposalSpecSuccess": + *v = new(ApproveJobProposalSpecApproveJobProposalSpecApproveJobProposalSpecSuccess) + return json.Unmarshal(b, *v) + case "JobAlreadyExistsError": + *v = new(ApproveJobProposalSpecApproveJobProposalSpecJobAlreadyExistsError) + return json.Unmarshal(b, *v) + case "NotFoundError": + *v = new(ApproveJobProposalSpecApproveJobProposalSpecNotFoundError) + return json.Unmarshal(b, *v) + case "": + return fmt.Errorf( + "response was missing ApproveJobProposalSpecPayload.__typename") + default: + return fmt.Errorf( + `unexpected concrete type for ApproveJobProposalSpecApproveJobProposalSpecApproveJobProposalSpecPayload: "%v"`, tn.TypeName) + } +} + +func __marshalApproveJobProposalSpecApproveJobProposalSpecApproveJobProposalSpecPayload(v *ApproveJobProposalSpecApproveJobProposalSpecApproveJobProposalSpecPayload) ([]byte, error) { + + var typename string + switch v := (*v).(type) { + case *ApproveJobProposalSpecApproveJobProposalSpecApproveJobProposalSpecSuccess: + typename = "ApproveJobProposalSpecSuccess" + + result := struct { + TypeName string `json:"__typename"` + *ApproveJobProposalSpecApproveJobProposalSpecApproveJobProposalSpecSuccess + }{typename, v} + return json.Marshal(result) + case *ApproveJobProposalSpecApproveJobProposalSpecJobAlreadyExistsError: + typename = "JobAlreadyExistsError" + + result := struct { + TypeName string `json:"__typename"` + *ApproveJobProposalSpecApproveJobProposalSpecJobAlreadyExistsError + }{typename, v} + return json.Marshal(result) + case *ApproveJobProposalSpecApproveJobProposalSpecNotFoundError: + typename = "NotFoundError" + + result := struct { + TypeName string `json:"__typename"` + *ApproveJobProposalSpecApproveJobProposalSpecNotFoundError + }{typename, v} + return json.Marshal(result) + case nil: + return []byte("null"), nil + default: + return nil, fmt.Errorf( + `unexpected concrete type for ApproveJobProposalSpecApproveJobProposalSpecApproveJobProposalSpecPayload: "%T"`, v) + } +} + +// ApproveJobProposalSpecApproveJobProposalSpecApproveJobProposalSpecSuccess includes the requested fields of the GraphQL type ApproveJobProposalSpecSuccess. +type ApproveJobProposalSpecApproveJobProposalSpecApproveJobProposalSpecSuccess struct { + Typename string `json:"__typename"` + Spec ApproveJobProposalSpecApproveJobProposalSpecApproveJobProposalSpecSuccessSpecJobProposalSpec `json:"spec"` +} + +// GetTypename returns ApproveJobProposalSpecApproveJobProposalSpecApproveJobProposalSpecSuccess.Typename, and is useful for accessing the field via an interface. +func (v *ApproveJobProposalSpecApproveJobProposalSpecApproveJobProposalSpecSuccess) GetTypename() string { + return v.Typename +} + +// GetSpec returns ApproveJobProposalSpecApproveJobProposalSpecApproveJobProposalSpecSuccess.Spec, and is useful for accessing the field via an interface. +func (v *ApproveJobProposalSpecApproveJobProposalSpecApproveJobProposalSpecSuccess) GetSpec() ApproveJobProposalSpecApproveJobProposalSpecApproveJobProposalSpecSuccessSpecJobProposalSpec { + return v.Spec +} + +// ApproveJobProposalSpecApproveJobProposalSpecApproveJobProposalSpecSuccessSpecJobProposalSpec includes the requested fields of the GraphQL type JobProposalSpec. +type ApproveJobProposalSpecApproveJobProposalSpecApproveJobProposalSpecSuccessSpecJobProposalSpec struct { + Id string `json:"id"` + Definition string `json:"definition"` + Version int `json:"version"` + Status SpecStatus `json:"status"` + StatusUpdatedAt string `json:"statusUpdatedAt"` + CreatedAt string `json:"createdAt"` + UpdatedAt string `json:"updatedAt"` +} + +// GetId returns ApproveJobProposalSpecApproveJobProposalSpecApproveJobProposalSpecSuccessSpecJobProposalSpec.Id, and is useful for accessing the field via an interface. +func (v *ApproveJobProposalSpecApproveJobProposalSpecApproveJobProposalSpecSuccessSpecJobProposalSpec) GetId() string { + return v.Id +} + +// GetDefinition returns ApproveJobProposalSpecApproveJobProposalSpecApproveJobProposalSpecSuccessSpecJobProposalSpec.Definition, and is useful for accessing the field via an interface. +func (v *ApproveJobProposalSpecApproveJobProposalSpecApproveJobProposalSpecSuccessSpecJobProposalSpec) GetDefinition() string { + return v.Definition +} + +// GetVersion returns ApproveJobProposalSpecApproveJobProposalSpecApproveJobProposalSpecSuccessSpecJobProposalSpec.Version, and is useful for accessing the field via an interface. +func (v *ApproveJobProposalSpecApproveJobProposalSpecApproveJobProposalSpecSuccessSpecJobProposalSpec) GetVersion() int { + return v.Version +} + +// GetStatus returns ApproveJobProposalSpecApproveJobProposalSpecApproveJobProposalSpecSuccessSpecJobProposalSpec.Status, and is useful for accessing the field via an interface. +func (v *ApproveJobProposalSpecApproveJobProposalSpecApproveJobProposalSpecSuccessSpecJobProposalSpec) GetStatus() SpecStatus { + return v.Status +} + +// GetStatusUpdatedAt returns ApproveJobProposalSpecApproveJobProposalSpecApproveJobProposalSpecSuccessSpecJobProposalSpec.StatusUpdatedAt, and is useful for accessing the field via an interface. +func (v *ApproveJobProposalSpecApproveJobProposalSpecApproveJobProposalSpecSuccessSpecJobProposalSpec) GetStatusUpdatedAt() string { + return v.StatusUpdatedAt +} + +// GetCreatedAt returns ApproveJobProposalSpecApproveJobProposalSpecApproveJobProposalSpecSuccessSpecJobProposalSpec.CreatedAt, and is useful for accessing the field via an interface. +func (v *ApproveJobProposalSpecApproveJobProposalSpecApproveJobProposalSpecSuccessSpecJobProposalSpec) GetCreatedAt() string { + return v.CreatedAt +} + +// GetUpdatedAt returns ApproveJobProposalSpecApproveJobProposalSpecApproveJobProposalSpecSuccessSpecJobProposalSpec.UpdatedAt, and is useful for accessing the field via an interface. +func (v *ApproveJobProposalSpecApproveJobProposalSpecApproveJobProposalSpecSuccessSpecJobProposalSpec) GetUpdatedAt() string { + return v.UpdatedAt +} + +// ApproveJobProposalSpecApproveJobProposalSpecJobAlreadyExistsError includes the requested fields of the GraphQL type JobAlreadyExistsError. +type ApproveJobProposalSpecApproveJobProposalSpecJobAlreadyExistsError struct { + Typename string `json:"__typename"` + Message string `json:"message"` + Code ErrorCode `json:"code"` +} + +// GetTypename returns ApproveJobProposalSpecApproveJobProposalSpecJobAlreadyExistsError.Typename, and is useful for accessing the field via an interface. +func (v *ApproveJobProposalSpecApproveJobProposalSpecJobAlreadyExistsError) GetTypename() string { + return v.Typename +} + +// GetMessage returns ApproveJobProposalSpecApproveJobProposalSpecJobAlreadyExistsError.Message, and is useful for accessing the field via an interface. +func (v *ApproveJobProposalSpecApproveJobProposalSpecJobAlreadyExistsError) GetMessage() string { + return v.Message +} + +// GetCode returns ApproveJobProposalSpecApproveJobProposalSpecJobAlreadyExistsError.Code, and is useful for accessing the field via an interface. +func (v *ApproveJobProposalSpecApproveJobProposalSpecJobAlreadyExistsError) GetCode() ErrorCode { + return v.Code +} + +// ApproveJobProposalSpecApproveJobProposalSpecNotFoundError includes the requested fields of the GraphQL type NotFoundError. +type ApproveJobProposalSpecApproveJobProposalSpecNotFoundError struct { + Typename string `json:"__typename"` + Message string `json:"message"` + Code ErrorCode `json:"code"` +} + +// GetTypename returns ApproveJobProposalSpecApproveJobProposalSpecNotFoundError.Typename, and is useful for accessing the field via an interface. +func (v *ApproveJobProposalSpecApproveJobProposalSpecNotFoundError) GetTypename() string { + return v.Typename +} + +// GetMessage returns ApproveJobProposalSpecApproveJobProposalSpecNotFoundError.Message, and is useful for accessing the field via an interface. +func (v *ApproveJobProposalSpecApproveJobProposalSpecNotFoundError) GetMessage() string { + return v.Message +} + +// GetCode returns ApproveJobProposalSpecApproveJobProposalSpecNotFoundError.Code, and is useful for accessing the field via an interface. +func (v *ApproveJobProposalSpecApproveJobProposalSpecNotFoundError) GetCode() ErrorCode { + return v.Code +} + +// ApproveJobProposalSpecResponse is returned by ApproveJobProposalSpec on success. +type ApproveJobProposalSpecResponse struct { + ApproveJobProposalSpec ApproveJobProposalSpecApproveJobProposalSpecApproveJobProposalSpecPayload `json:"-"` +} + +// GetApproveJobProposalSpec returns ApproveJobProposalSpecResponse.ApproveJobProposalSpec, and is useful for accessing the field via an interface. +func (v *ApproveJobProposalSpecResponse) GetApproveJobProposalSpec() ApproveJobProposalSpecApproveJobProposalSpecApproveJobProposalSpecPayload { + return v.ApproveJobProposalSpec +} + +func (v *ApproveJobProposalSpecResponse) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *ApproveJobProposalSpecResponse + ApproveJobProposalSpec json.RawMessage `json:"approveJobProposalSpec"` + graphql.NoUnmarshalJSON + } + firstPass.ApproveJobProposalSpecResponse = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + { + dst := &v.ApproveJobProposalSpec + src := firstPass.ApproveJobProposalSpec + if len(src) != 0 && string(src) != "null" { + err = __unmarshalApproveJobProposalSpecApproveJobProposalSpecApproveJobProposalSpecPayload( + src, dst) + if err != nil { + return fmt.Errorf( + "unable to unmarshal ApproveJobProposalSpecResponse.ApproveJobProposalSpec: %w", err) + } + } + } + return nil +} + +type __premarshalApproveJobProposalSpecResponse struct { + ApproveJobProposalSpec json.RawMessage `json:"approveJobProposalSpec"` +} + +func (v *ApproveJobProposalSpecResponse) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *ApproveJobProposalSpecResponse) __premarshalJSON() (*__premarshalApproveJobProposalSpecResponse, error) { + var retval __premarshalApproveJobProposalSpecResponse + + { + + dst := &retval.ApproveJobProposalSpec + src := v.ApproveJobProposalSpec + var err error + *dst, err = __marshalApproveJobProposalSpecApproveJobProposalSpecApproveJobProposalSpecPayload( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal ApproveJobProposalSpecResponse.ApproveJobProposalSpec: %w", err) + } + } + return &retval, nil +} + +// BridgeParts includes the GraphQL fields of Bridge requested by the fragment BridgeParts. +type BridgeParts struct { + Id string `json:"id"` + Name string `json:"name"` + Url string `json:"url"` + Confirmations int `json:"confirmations"` + OutgoingToken string `json:"outgoingToken"` + MinimumContractPayment string `json:"minimumContractPayment"` + CreatedAt string `json:"createdAt"` +} + +// GetId returns BridgeParts.Id, and is useful for accessing the field via an interface. +func (v *BridgeParts) GetId() string { return v.Id } + +// GetName returns BridgeParts.Name, and is useful for accessing the field via an interface. +func (v *BridgeParts) GetName() string { return v.Name } + +// GetUrl returns BridgeParts.Url, and is useful for accessing the field via an interface. +func (v *BridgeParts) GetUrl() string { return v.Url } + +// GetConfirmations returns BridgeParts.Confirmations, and is useful for accessing the field via an interface. +func (v *BridgeParts) GetConfirmations() int { return v.Confirmations } + +// GetOutgoingToken returns BridgeParts.OutgoingToken, and is useful for accessing the field via an interface. +func (v *BridgeParts) GetOutgoingToken() string { return v.OutgoingToken } + +// GetMinimumContractPayment returns BridgeParts.MinimumContractPayment, and is useful for accessing the field via an interface. +func (v *BridgeParts) GetMinimumContractPayment() string { return v.MinimumContractPayment } + +// GetCreatedAt returns BridgeParts.CreatedAt, and is useful for accessing the field via an interface. +func (v *BridgeParts) GetCreatedAt() string { return v.CreatedAt } + +// CancelJobProposalSpecCancelJobProposalSpecCancelJobProposalSpecPayload includes the requested fields of the GraphQL interface CancelJobProposalSpecPayload. +// +// CancelJobProposalSpecCancelJobProposalSpecCancelJobProposalSpecPayload is implemented by the following types: +// CancelJobProposalSpecCancelJobProposalSpecCancelJobProposalSpecSuccess +// CancelJobProposalSpecCancelJobProposalSpecNotFoundError +type CancelJobProposalSpecCancelJobProposalSpecCancelJobProposalSpecPayload interface { + implementsGraphQLInterfaceCancelJobProposalSpecCancelJobProposalSpecCancelJobProposalSpecPayload() + // GetTypename returns the receiver's concrete GraphQL type-name (see interface doc for possible values). + GetTypename() string +} + +func (v *CancelJobProposalSpecCancelJobProposalSpecCancelJobProposalSpecSuccess) implementsGraphQLInterfaceCancelJobProposalSpecCancelJobProposalSpecCancelJobProposalSpecPayload() { +} +func (v *CancelJobProposalSpecCancelJobProposalSpecNotFoundError) implementsGraphQLInterfaceCancelJobProposalSpecCancelJobProposalSpecCancelJobProposalSpecPayload() { +} + +func __unmarshalCancelJobProposalSpecCancelJobProposalSpecCancelJobProposalSpecPayload(b []byte, v *CancelJobProposalSpecCancelJobProposalSpecCancelJobProposalSpecPayload) error { + if string(b) == "null" { + return nil + } + + var tn struct { + TypeName string `json:"__typename"` + } + err := json.Unmarshal(b, &tn) + if err != nil { + return err + } + + switch tn.TypeName { + case "CancelJobProposalSpecSuccess": + *v = new(CancelJobProposalSpecCancelJobProposalSpecCancelJobProposalSpecSuccess) + return json.Unmarshal(b, *v) + case "NotFoundError": + *v = new(CancelJobProposalSpecCancelJobProposalSpecNotFoundError) + return json.Unmarshal(b, *v) + case "": + return fmt.Errorf( + "response was missing CancelJobProposalSpecPayload.__typename") + default: + return fmt.Errorf( + `unexpected concrete type for CancelJobProposalSpecCancelJobProposalSpecCancelJobProposalSpecPayload: "%v"`, tn.TypeName) + } +} + +func __marshalCancelJobProposalSpecCancelJobProposalSpecCancelJobProposalSpecPayload(v *CancelJobProposalSpecCancelJobProposalSpecCancelJobProposalSpecPayload) ([]byte, error) { + + var typename string + switch v := (*v).(type) { + case *CancelJobProposalSpecCancelJobProposalSpecCancelJobProposalSpecSuccess: + typename = "CancelJobProposalSpecSuccess" + + result := struct { + TypeName string `json:"__typename"` + *CancelJobProposalSpecCancelJobProposalSpecCancelJobProposalSpecSuccess + }{typename, v} + return json.Marshal(result) + case *CancelJobProposalSpecCancelJobProposalSpecNotFoundError: + typename = "NotFoundError" + + result := struct { + TypeName string `json:"__typename"` + *CancelJobProposalSpecCancelJobProposalSpecNotFoundError + }{typename, v} + return json.Marshal(result) + case nil: + return []byte("null"), nil + default: + return nil, fmt.Errorf( + `unexpected concrete type for CancelJobProposalSpecCancelJobProposalSpecCancelJobProposalSpecPayload: "%T"`, v) + } +} + +// CancelJobProposalSpecCancelJobProposalSpecCancelJobProposalSpecSuccess includes the requested fields of the GraphQL type CancelJobProposalSpecSuccess. +type CancelJobProposalSpecCancelJobProposalSpecCancelJobProposalSpecSuccess struct { + Typename string `json:"__typename"` + Spec CancelJobProposalSpecCancelJobProposalSpecCancelJobProposalSpecSuccessSpecJobProposalSpec `json:"spec"` +} + +// GetTypename returns CancelJobProposalSpecCancelJobProposalSpecCancelJobProposalSpecSuccess.Typename, and is useful for accessing the field via an interface. +func (v *CancelJobProposalSpecCancelJobProposalSpecCancelJobProposalSpecSuccess) GetTypename() string { + return v.Typename +} + +// GetSpec returns CancelJobProposalSpecCancelJobProposalSpecCancelJobProposalSpecSuccess.Spec, and is useful for accessing the field via an interface. +func (v *CancelJobProposalSpecCancelJobProposalSpecCancelJobProposalSpecSuccess) GetSpec() CancelJobProposalSpecCancelJobProposalSpecCancelJobProposalSpecSuccessSpecJobProposalSpec { + return v.Spec +} + +// CancelJobProposalSpecCancelJobProposalSpecCancelJobProposalSpecSuccessSpecJobProposalSpec includes the requested fields of the GraphQL type JobProposalSpec. +type CancelJobProposalSpecCancelJobProposalSpecCancelJobProposalSpecSuccessSpecJobProposalSpec struct { + Id string `json:"id"` + Definition string `json:"definition"` + Version int `json:"version"` + Status SpecStatus `json:"status"` + StatusUpdatedAt string `json:"statusUpdatedAt"` + CreatedAt string `json:"createdAt"` + UpdatedAt string `json:"updatedAt"` +} + +// GetId returns CancelJobProposalSpecCancelJobProposalSpecCancelJobProposalSpecSuccessSpecJobProposalSpec.Id, and is useful for accessing the field via an interface. +func (v *CancelJobProposalSpecCancelJobProposalSpecCancelJobProposalSpecSuccessSpecJobProposalSpec) GetId() string { + return v.Id +} + +// GetDefinition returns CancelJobProposalSpecCancelJobProposalSpecCancelJobProposalSpecSuccessSpecJobProposalSpec.Definition, and is useful for accessing the field via an interface. +func (v *CancelJobProposalSpecCancelJobProposalSpecCancelJobProposalSpecSuccessSpecJobProposalSpec) GetDefinition() string { + return v.Definition +} + +// GetVersion returns CancelJobProposalSpecCancelJobProposalSpecCancelJobProposalSpecSuccessSpecJobProposalSpec.Version, and is useful for accessing the field via an interface. +func (v *CancelJobProposalSpecCancelJobProposalSpecCancelJobProposalSpecSuccessSpecJobProposalSpec) GetVersion() int { + return v.Version +} + +// GetStatus returns CancelJobProposalSpecCancelJobProposalSpecCancelJobProposalSpecSuccessSpecJobProposalSpec.Status, and is useful for accessing the field via an interface. +func (v *CancelJobProposalSpecCancelJobProposalSpecCancelJobProposalSpecSuccessSpecJobProposalSpec) GetStatus() SpecStatus { + return v.Status +} + +// GetStatusUpdatedAt returns CancelJobProposalSpecCancelJobProposalSpecCancelJobProposalSpecSuccessSpecJobProposalSpec.StatusUpdatedAt, and is useful for accessing the field via an interface. +func (v *CancelJobProposalSpecCancelJobProposalSpecCancelJobProposalSpecSuccessSpecJobProposalSpec) GetStatusUpdatedAt() string { + return v.StatusUpdatedAt +} + +// GetCreatedAt returns CancelJobProposalSpecCancelJobProposalSpecCancelJobProposalSpecSuccessSpecJobProposalSpec.CreatedAt, and is useful for accessing the field via an interface. +func (v *CancelJobProposalSpecCancelJobProposalSpecCancelJobProposalSpecSuccessSpecJobProposalSpec) GetCreatedAt() string { + return v.CreatedAt +} + +// GetUpdatedAt returns CancelJobProposalSpecCancelJobProposalSpecCancelJobProposalSpecSuccessSpecJobProposalSpec.UpdatedAt, and is useful for accessing the field via an interface. +func (v *CancelJobProposalSpecCancelJobProposalSpecCancelJobProposalSpecSuccessSpecJobProposalSpec) GetUpdatedAt() string { + return v.UpdatedAt +} + +// CancelJobProposalSpecCancelJobProposalSpecNotFoundError includes the requested fields of the GraphQL type NotFoundError. +type CancelJobProposalSpecCancelJobProposalSpecNotFoundError struct { + Typename string `json:"__typename"` + Message string `json:"message"` + Code ErrorCode `json:"code"` +} + +// GetTypename returns CancelJobProposalSpecCancelJobProposalSpecNotFoundError.Typename, and is useful for accessing the field via an interface. +func (v *CancelJobProposalSpecCancelJobProposalSpecNotFoundError) GetTypename() string { + return v.Typename +} + +// GetMessage returns CancelJobProposalSpecCancelJobProposalSpecNotFoundError.Message, and is useful for accessing the field via an interface. +func (v *CancelJobProposalSpecCancelJobProposalSpecNotFoundError) GetMessage() string { + return v.Message +} + +// GetCode returns CancelJobProposalSpecCancelJobProposalSpecNotFoundError.Code, and is useful for accessing the field via an interface. +func (v *CancelJobProposalSpecCancelJobProposalSpecNotFoundError) GetCode() ErrorCode { return v.Code } + +// CancelJobProposalSpecResponse is returned by CancelJobProposalSpec on success. +type CancelJobProposalSpecResponse struct { + CancelJobProposalSpec CancelJobProposalSpecCancelJobProposalSpecCancelJobProposalSpecPayload `json:"-"` +} + +// GetCancelJobProposalSpec returns CancelJobProposalSpecResponse.CancelJobProposalSpec, and is useful for accessing the field via an interface. +func (v *CancelJobProposalSpecResponse) GetCancelJobProposalSpec() CancelJobProposalSpecCancelJobProposalSpecCancelJobProposalSpecPayload { + return v.CancelJobProposalSpec +} + +func (v *CancelJobProposalSpecResponse) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *CancelJobProposalSpecResponse + CancelJobProposalSpec json.RawMessage `json:"cancelJobProposalSpec"` + graphql.NoUnmarshalJSON + } + firstPass.CancelJobProposalSpecResponse = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + { + dst := &v.CancelJobProposalSpec + src := firstPass.CancelJobProposalSpec + if len(src) != 0 && string(src) != "null" { + err = __unmarshalCancelJobProposalSpecCancelJobProposalSpecCancelJobProposalSpecPayload( + src, dst) + if err != nil { + return fmt.Errorf( + "unable to unmarshal CancelJobProposalSpecResponse.CancelJobProposalSpec: %w", err) + } + } + } + return nil +} + +type __premarshalCancelJobProposalSpecResponse struct { + CancelJobProposalSpec json.RawMessage `json:"cancelJobProposalSpec"` +} + +func (v *CancelJobProposalSpecResponse) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *CancelJobProposalSpecResponse) __premarshalJSON() (*__premarshalCancelJobProposalSpecResponse, error) { + var retval __premarshalCancelJobProposalSpecResponse + + { + + dst := &retval.CancelJobProposalSpec + src := v.CancelJobProposalSpec + var err error + *dst, err = __marshalCancelJobProposalSpecCancelJobProposalSpecCancelJobProposalSpecPayload( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal CancelJobProposalSpecResponse.CancelJobProposalSpec: %w", err) + } + } + return &retval, nil +} + +// CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigPayload includes the requested fields of the GraphQL interface CreateFeedsManagerChainConfigPayload. +// +// CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigPayload is implemented by the following types: +// CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigSuccess +// CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigInputErrors +// CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigNotFoundError +type CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigPayload interface { + implementsGraphQLInterfaceCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigPayload() + // GetTypename returns the receiver's concrete GraphQL type-name (see interface doc for possible values). + GetTypename() string +} + +func (v *CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigSuccess) implementsGraphQLInterfaceCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigPayload() { +} +func (v *CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigInputErrors) implementsGraphQLInterfaceCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigPayload() { +} +func (v *CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigNotFoundError) implementsGraphQLInterfaceCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigPayload() { +} + +func __unmarshalCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigPayload(b []byte, v *CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigPayload) error { + if string(b) == "null" { + return nil + } + + var tn struct { + TypeName string `json:"__typename"` + } + err := json.Unmarshal(b, &tn) + if err != nil { + return err + } + + switch tn.TypeName { + case "CreateFeedsManagerChainConfigSuccess": + *v = new(CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigSuccess) + return json.Unmarshal(b, *v) + case "InputErrors": + *v = new(CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigInputErrors) + return json.Unmarshal(b, *v) + case "NotFoundError": + *v = new(CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigNotFoundError) + return json.Unmarshal(b, *v) + case "": + return fmt.Errorf( + "response was missing CreateFeedsManagerChainConfigPayload.__typename") + default: + return fmt.Errorf( + `unexpected concrete type for CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigPayload: "%v"`, tn.TypeName) + } +} + +func __marshalCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigPayload(v *CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigPayload) ([]byte, error) { + + var typename string + switch v := (*v).(type) { + case *CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigSuccess: + typename = "CreateFeedsManagerChainConfigSuccess" + + result := struct { + TypeName string `json:"__typename"` + *CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigSuccess + }{typename, v} + return json.Marshal(result) + case *CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigInputErrors: + typename = "InputErrors" + + result := struct { + TypeName string `json:"__typename"` + *CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigInputErrors + }{typename, v} + return json.Marshal(result) + case *CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigNotFoundError: + typename = "NotFoundError" + + result := struct { + TypeName string `json:"__typename"` + *CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigNotFoundError + }{typename, v} + return json.Marshal(result) + case nil: + return []byte("null"), nil + default: + return nil, fmt.Errorf( + `unexpected concrete type for CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigPayload: "%T"`, v) + } +} + +// CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigSuccess includes the requested fields of the GraphQL type CreateFeedsManagerChainConfigSuccess. +type CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigSuccess struct { + Typename string `json:"__typename"` + ChainConfig CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigSuccessChainConfigFeedsManagerChainConfig `json:"chainConfig"` +} + +// GetTypename returns CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigSuccess.Typename, and is useful for accessing the field via an interface. +func (v *CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigSuccess) GetTypename() string { + return v.Typename +} + +// GetChainConfig returns CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigSuccess.ChainConfig, and is useful for accessing the field via an interface. +func (v *CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigSuccess) GetChainConfig() CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigSuccessChainConfigFeedsManagerChainConfig { + return v.ChainConfig +} + +// CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigSuccessChainConfigFeedsManagerChainConfig includes the requested fields of the GraphQL type FeedsManagerChainConfig. +type CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigSuccessChainConfigFeedsManagerChainConfig struct { + Id string `json:"id"` + ChainID string `json:"chainID"` + ChainType string `json:"chainType"` + AccountAddr string `json:"accountAddr"` + AdminAddr string `json:"adminAddr"` + FluxMonitorJobConfig CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigSuccessChainConfigFeedsManagerChainConfigFluxMonitorJobConfig `json:"fluxMonitorJobConfig"` + Ocr1JobConfig CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigSuccessChainConfigFeedsManagerChainConfigOcr1JobConfigOCR1JobConfig `json:"ocr1JobConfig"` + Ocr2JobConfig CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigSuccessChainConfigFeedsManagerChainConfigOcr2JobConfigOCR2JobConfig `json:"ocr2JobConfig"` +} + +// GetId returns CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigSuccessChainConfigFeedsManagerChainConfig.Id, and is useful for accessing the field via an interface. +func (v *CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigSuccessChainConfigFeedsManagerChainConfig) GetId() string { + return v.Id +} + +// GetChainID returns CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigSuccessChainConfigFeedsManagerChainConfig.ChainID, and is useful for accessing the field via an interface. +func (v *CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigSuccessChainConfigFeedsManagerChainConfig) GetChainID() string { + return v.ChainID +} + +// GetChainType returns CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigSuccessChainConfigFeedsManagerChainConfig.ChainType, and is useful for accessing the field via an interface. +func (v *CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigSuccessChainConfigFeedsManagerChainConfig) GetChainType() string { + return v.ChainType +} + +// GetAccountAddr returns CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigSuccessChainConfigFeedsManagerChainConfig.AccountAddr, and is useful for accessing the field via an interface. +func (v *CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigSuccessChainConfigFeedsManagerChainConfig) GetAccountAddr() string { + return v.AccountAddr +} + +// GetAdminAddr returns CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigSuccessChainConfigFeedsManagerChainConfig.AdminAddr, and is useful for accessing the field via an interface. +func (v *CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigSuccessChainConfigFeedsManagerChainConfig) GetAdminAddr() string { + return v.AdminAddr +} + +// GetFluxMonitorJobConfig returns CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigSuccessChainConfigFeedsManagerChainConfig.FluxMonitorJobConfig, and is useful for accessing the field via an interface. +func (v *CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigSuccessChainConfigFeedsManagerChainConfig) GetFluxMonitorJobConfig() CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigSuccessChainConfigFeedsManagerChainConfigFluxMonitorJobConfig { + return v.FluxMonitorJobConfig +} + +// GetOcr1JobConfig returns CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigSuccessChainConfigFeedsManagerChainConfig.Ocr1JobConfig, and is useful for accessing the field via an interface. +func (v *CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigSuccessChainConfigFeedsManagerChainConfig) GetOcr1JobConfig() CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigSuccessChainConfigFeedsManagerChainConfigOcr1JobConfigOCR1JobConfig { + return v.Ocr1JobConfig +} + +// GetOcr2JobConfig returns CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigSuccessChainConfigFeedsManagerChainConfig.Ocr2JobConfig, and is useful for accessing the field via an interface. +func (v *CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigSuccessChainConfigFeedsManagerChainConfig) GetOcr2JobConfig() CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigSuccessChainConfigFeedsManagerChainConfigOcr2JobConfigOCR2JobConfig { + return v.Ocr2JobConfig +} + +// CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigSuccessChainConfigFeedsManagerChainConfigFluxMonitorJobConfig includes the requested fields of the GraphQL type FluxMonitorJobConfig. +type CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigSuccessChainConfigFeedsManagerChainConfigFluxMonitorJobConfig struct { + Enabled bool `json:"enabled"` +} + +// GetEnabled returns CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigSuccessChainConfigFeedsManagerChainConfigFluxMonitorJobConfig.Enabled, and is useful for accessing the field via an interface. +func (v *CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigSuccessChainConfigFeedsManagerChainConfigFluxMonitorJobConfig) GetEnabled() bool { + return v.Enabled +} + +// CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigSuccessChainConfigFeedsManagerChainConfigOcr1JobConfigOCR1JobConfig includes the requested fields of the GraphQL type OCR1JobConfig. +type CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigSuccessChainConfigFeedsManagerChainConfigOcr1JobConfigOCR1JobConfig struct { + Enabled bool `json:"enabled"` + IsBootstrap bool `json:"isBootstrap"` + Multiaddr string `json:"multiaddr"` + P2pPeerID string `json:"p2pPeerID"` + KeyBundleID string `json:"keyBundleID"` +} + +// GetEnabled returns CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigSuccessChainConfigFeedsManagerChainConfigOcr1JobConfigOCR1JobConfig.Enabled, and is useful for accessing the field via an interface. +func (v *CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigSuccessChainConfigFeedsManagerChainConfigOcr1JobConfigOCR1JobConfig) GetEnabled() bool { + return v.Enabled +} + +// GetIsBootstrap returns CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigSuccessChainConfigFeedsManagerChainConfigOcr1JobConfigOCR1JobConfig.IsBootstrap, and is useful for accessing the field via an interface. +func (v *CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigSuccessChainConfigFeedsManagerChainConfigOcr1JobConfigOCR1JobConfig) GetIsBootstrap() bool { + return v.IsBootstrap +} + +// GetMultiaddr returns CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigSuccessChainConfigFeedsManagerChainConfigOcr1JobConfigOCR1JobConfig.Multiaddr, and is useful for accessing the field via an interface. +func (v *CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigSuccessChainConfigFeedsManagerChainConfigOcr1JobConfigOCR1JobConfig) GetMultiaddr() string { + return v.Multiaddr +} + +// GetP2pPeerID returns CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigSuccessChainConfigFeedsManagerChainConfigOcr1JobConfigOCR1JobConfig.P2pPeerID, and is useful for accessing the field via an interface. +func (v *CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigSuccessChainConfigFeedsManagerChainConfigOcr1JobConfigOCR1JobConfig) GetP2pPeerID() string { + return v.P2pPeerID +} + +// GetKeyBundleID returns CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigSuccessChainConfigFeedsManagerChainConfigOcr1JobConfigOCR1JobConfig.KeyBundleID, and is useful for accessing the field via an interface. +func (v *CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigSuccessChainConfigFeedsManagerChainConfigOcr1JobConfigOCR1JobConfig) GetKeyBundleID() string { + return v.KeyBundleID +} + +// CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigSuccessChainConfigFeedsManagerChainConfigOcr2JobConfigOCR2JobConfig includes the requested fields of the GraphQL type OCR2JobConfig. +type CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigSuccessChainConfigFeedsManagerChainConfigOcr2JobConfigOCR2JobConfig struct { + Enabled bool `json:"enabled"` + IsBootstrap bool `json:"isBootstrap"` + Multiaddr string `json:"multiaddr"` + ForwarderAddress string `json:"forwarderAddress"` + P2pPeerID string `json:"p2pPeerID"` + KeyBundleID string `json:"keyBundleID"` + Plugins CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigSuccessChainConfigFeedsManagerChainConfigOcr2JobConfigOCR2JobConfigPlugins `json:"plugins"` +} + +// GetEnabled returns CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigSuccessChainConfigFeedsManagerChainConfigOcr2JobConfigOCR2JobConfig.Enabled, and is useful for accessing the field via an interface. +func (v *CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigSuccessChainConfigFeedsManagerChainConfigOcr2JobConfigOCR2JobConfig) GetEnabled() bool { + return v.Enabled +} + +// GetIsBootstrap returns CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigSuccessChainConfigFeedsManagerChainConfigOcr2JobConfigOCR2JobConfig.IsBootstrap, and is useful for accessing the field via an interface. +func (v *CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigSuccessChainConfigFeedsManagerChainConfigOcr2JobConfigOCR2JobConfig) GetIsBootstrap() bool { + return v.IsBootstrap +} + +// GetMultiaddr returns CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigSuccessChainConfigFeedsManagerChainConfigOcr2JobConfigOCR2JobConfig.Multiaddr, and is useful for accessing the field via an interface. +func (v *CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigSuccessChainConfigFeedsManagerChainConfigOcr2JobConfigOCR2JobConfig) GetMultiaddr() string { + return v.Multiaddr +} + +// GetForwarderAddress returns CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigSuccessChainConfigFeedsManagerChainConfigOcr2JobConfigOCR2JobConfig.ForwarderAddress, and is useful for accessing the field via an interface. +func (v *CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigSuccessChainConfigFeedsManagerChainConfigOcr2JobConfigOCR2JobConfig) GetForwarderAddress() string { + return v.ForwarderAddress +} + +// GetP2pPeerID returns CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigSuccessChainConfigFeedsManagerChainConfigOcr2JobConfigOCR2JobConfig.P2pPeerID, and is useful for accessing the field via an interface. +func (v *CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigSuccessChainConfigFeedsManagerChainConfigOcr2JobConfigOCR2JobConfig) GetP2pPeerID() string { + return v.P2pPeerID +} + +// GetKeyBundleID returns CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigSuccessChainConfigFeedsManagerChainConfigOcr2JobConfigOCR2JobConfig.KeyBundleID, and is useful for accessing the field via an interface. +func (v *CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigSuccessChainConfigFeedsManagerChainConfigOcr2JobConfigOCR2JobConfig) GetKeyBundleID() string { + return v.KeyBundleID +} + +// GetPlugins returns CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigSuccessChainConfigFeedsManagerChainConfigOcr2JobConfigOCR2JobConfig.Plugins, and is useful for accessing the field via an interface. +func (v *CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigSuccessChainConfigFeedsManagerChainConfigOcr2JobConfigOCR2JobConfig) GetPlugins() CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigSuccessChainConfigFeedsManagerChainConfigOcr2JobConfigOCR2JobConfigPlugins { + return v.Plugins +} + +// CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigSuccessChainConfigFeedsManagerChainConfigOcr2JobConfigOCR2JobConfigPlugins includes the requested fields of the GraphQL type Plugins. +type CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigSuccessChainConfigFeedsManagerChainConfigOcr2JobConfigOCR2JobConfigPlugins struct { + Commit bool `json:"commit"` + Execute bool `json:"execute"` + Median bool `json:"median"` + Mercury bool `json:"mercury"` + Rebalancer bool `json:"rebalancer"` +} + +// GetCommit returns CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigSuccessChainConfigFeedsManagerChainConfigOcr2JobConfigOCR2JobConfigPlugins.Commit, and is useful for accessing the field via an interface. +func (v *CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigSuccessChainConfigFeedsManagerChainConfigOcr2JobConfigOCR2JobConfigPlugins) GetCommit() bool { + return v.Commit +} + +// GetExecute returns CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigSuccessChainConfigFeedsManagerChainConfigOcr2JobConfigOCR2JobConfigPlugins.Execute, and is useful for accessing the field via an interface. +func (v *CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigSuccessChainConfigFeedsManagerChainConfigOcr2JobConfigOCR2JobConfigPlugins) GetExecute() bool { + return v.Execute +} + +// GetMedian returns CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigSuccessChainConfigFeedsManagerChainConfigOcr2JobConfigOCR2JobConfigPlugins.Median, and is useful for accessing the field via an interface. +func (v *CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigSuccessChainConfigFeedsManagerChainConfigOcr2JobConfigOCR2JobConfigPlugins) GetMedian() bool { + return v.Median +} + +// GetMercury returns CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigSuccessChainConfigFeedsManagerChainConfigOcr2JobConfigOCR2JobConfigPlugins.Mercury, and is useful for accessing the field via an interface. +func (v *CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigSuccessChainConfigFeedsManagerChainConfigOcr2JobConfigOCR2JobConfigPlugins) GetMercury() bool { + return v.Mercury +} + +// GetRebalancer returns CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigSuccessChainConfigFeedsManagerChainConfigOcr2JobConfigOCR2JobConfigPlugins.Rebalancer, and is useful for accessing the field via an interface. +func (v *CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigSuccessChainConfigFeedsManagerChainConfigOcr2JobConfigOCR2JobConfigPlugins) GetRebalancer() bool { + return v.Rebalancer +} + +// CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigInputErrors includes the requested fields of the GraphQL type InputErrors. +type CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigInputErrors struct { + Typename string `json:"__typename"` + Errors []CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigInputErrorsErrorsInputError `json:"errors"` +} + +// GetTypename returns CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigInputErrors.Typename, and is useful for accessing the field via an interface. +func (v *CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigInputErrors) GetTypename() string { + return v.Typename +} + +// GetErrors returns CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigInputErrors.Errors, and is useful for accessing the field via an interface. +func (v *CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigInputErrors) GetErrors() []CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigInputErrorsErrorsInputError { + return v.Errors +} + +// CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigInputErrorsErrorsInputError includes the requested fields of the GraphQL type InputError. +type CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigInputErrorsErrorsInputError struct { + Message string `json:"message"` + Path string `json:"path"` +} + +// GetMessage returns CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigInputErrorsErrorsInputError.Message, and is useful for accessing the field via an interface. +func (v *CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigInputErrorsErrorsInputError) GetMessage() string { + return v.Message +} + +// GetPath returns CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigInputErrorsErrorsInputError.Path, and is useful for accessing the field via an interface. +func (v *CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigInputErrorsErrorsInputError) GetPath() string { + return v.Path +} + +// CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigNotFoundError includes the requested fields of the GraphQL type NotFoundError. +type CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigNotFoundError struct { + Typename string `json:"__typename"` + Message string `json:"message"` + Code ErrorCode `json:"code"` +} + +// GetTypename returns CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigNotFoundError.Typename, and is useful for accessing the field via an interface. +func (v *CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigNotFoundError) GetTypename() string { + return v.Typename +} + +// GetMessage returns CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigNotFoundError.Message, and is useful for accessing the field via an interface. +func (v *CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigNotFoundError) GetMessage() string { + return v.Message +} + +// GetCode returns CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigNotFoundError.Code, and is useful for accessing the field via an interface. +func (v *CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigNotFoundError) GetCode() ErrorCode { + return v.Code +} + +type CreateFeedsManagerChainConfigInput struct { + FeedsManagerID string `json:"feedsManagerID"` + ChainID string `json:"chainID"` + ChainType string `json:"chainType"` + AccountAddr string `json:"accountAddr"` + AccountAddrPubKey string `json:"accountAddrPubKey"` + AdminAddr string `json:"adminAddr"` + FluxMonitorEnabled bool `json:"fluxMonitorEnabled"` + Ocr1Enabled bool `json:"ocr1Enabled"` + Ocr1IsBootstrap bool `json:"ocr1IsBootstrap"` + Ocr1Multiaddr string `json:"ocr1Multiaddr"` + Ocr1P2PPeerID string `json:"ocr1P2PPeerID"` + Ocr1KeyBundleID string `json:"ocr1KeyBundleID"` + Ocr2Enabled bool `json:"ocr2Enabled"` + Ocr2IsBootstrap bool `json:"ocr2IsBootstrap"` + Ocr2Multiaddr string `json:"ocr2Multiaddr"` + Ocr2ForwarderAddress string `json:"ocr2ForwarderAddress"` + Ocr2P2PPeerID string `json:"ocr2P2PPeerID"` + Ocr2KeyBundleID string `json:"ocr2KeyBundleID"` + Ocr2Plugins string `json:"ocr2Plugins"` +} + +// GetFeedsManagerID returns CreateFeedsManagerChainConfigInput.FeedsManagerID, and is useful for accessing the field via an interface. +func (v *CreateFeedsManagerChainConfigInput) GetFeedsManagerID() string { return v.FeedsManagerID } + +// GetChainID returns CreateFeedsManagerChainConfigInput.ChainID, and is useful for accessing the field via an interface. +func (v *CreateFeedsManagerChainConfigInput) GetChainID() string { return v.ChainID } + +// GetChainType returns CreateFeedsManagerChainConfigInput.ChainType, and is useful for accessing the field via an interface. +func (v *CreateFeedsManagerChainConfigInput) GetChainType() string { return v.ChainType } + +// GetAccountAddr returns CreateFeedsManagerChainConfigInput.AccountAddr, and is useful for accessing the field via an interface. +func (v *CreateFeedsManagerChainConfigInput) GetAccountAddr() string { return v.AccountAddr } + +// GetAccountAddrPubKey returns CreateFeedsManagerChainConfigInput.AccountAddrPubKey, and is useful for accessing the field via an interface. +func (v *CreateFeedsManagerChainConfigInput) GetAccountAddrPubKey() string { + return v.AccountAddrPubKey +} + +// GetAdminAddr returns CreateFeedsManagerChainConfigInput.AdminAddr, and is useful for accessing the field via an interface. +func (v *CreateFeedsManagerChainConfigInput) GetAdminAddr() string { return v.AdminAddr } + +// GetFluxMonitorEnabled returns CreateFeedsManagerChainConfigInput.FluxMonitorEnabled, and is useful for accessing the field via an interface. +func (v *CreateFeedsManagerChainConfigInput) GetFluxMonitorEnabled() bool { + return v.FluxMonitorEnabled +} + +// GetOcr1Enabled returns CreateFeedsManagerChainConfigInput.Ocr1Enabled, and is useful for accessing the field via an interface. +func (v *CreateFeedsManagerChainConfigInput) GetOcr1Enabled() bool { return v.Ocr1Enabled } + +// GetOcr1IsBootstrap returns CreateFeedsManagerChainConfigInput.Ocr1IsBootstrap, and is useful for accessing the field via an interface. +func (v *CreateFeedsManagerChainConfigInput) GetOcr1IsBootstrap() bool { return v.Ocr1IsBootstrap } + +// GetOcr1Multiaddr returns CreateFeedsManagerChainConfigInput.Ocr1Multiaddr, and is useful for accessing the field via an interface. +func (v *CreateFeedsManagerChainConfigInput) GetOcr1Multiaddr() string { return v.Ocr1Multiaddr } + +// GetOcr1P2PPeerID returns CreateFeedsManagerChainConfigInput.Ocr1P2PPeerID, and is useful for accessing the field via an interface. +func (v *CreateFeedsManagerChainConfigInput) GetOcr1P2PPeerID() string { return v.Ocr1P2PPeerID } + +// GetOcr1KeyBundleID returns CreateFeedsManagerChainConfigInput.Ocr1KeyBundleID, and is useful for accessing the field via an interface. +func (v *CreateFeedsManagerChainConfigInput) GetOcr1KeyBundleID() string { return v.Ocr1KeyBundleID } + +// GetOcr2Enabled returns CreateFeedsManagerChainConfigInput.Ocr2Enabled, and is useful for accessing the field via an interface. +func (v *CreateFeedsManagerChainConfigInput) GetOcr2Enabled() bool { return v.Ocr2Enabled } + +// GetOcr2IsBootstrap returns CreateFeedsManagerChainConfigInput.Ocr2IsBootstrap, and is useful for accessing the field via an interface. +func (v *CreateFeedsManagerChainConfigInput) GetOcr2IsBootstrap() bool { return v.Ocr2IsBootstrap } + +// GetOcr2Multiaddr returns CreateFeedsManagerChainConfigInput.Ocr2Multiaddr, and is useful for accessing the field via an interface. +func (v *CreateFeedsManagerChainConfigInput) GetOcr2Multiaddr() string { return v.Ocr2Multiaddr } + +// GetOcr2ForwarderAddress returns CreateFeedsManagerChainConfigInput.Ocr2ForwarderAddress, and is useful for accessing the field via an interface. +func (v *CreateFeedsManagerChainConfigInput) GetOcr2ForwarderAddress() string { + return v.Ocr2ForwarderAddress +} + +// GetOcr2P2PPeerID returns CreateFeedsManagerChainConfigInput.Ocr2P2PPeerID, and is useful for accessing the field via an interface. +func (v *CreateFeedsManagerChainConfigInput) GetOcr2P2PPeerID() string { return v.Ocr2P2PPeerID } + +// GetOcr2KeyBundleID returns CreateFeedsManagerChainConfigInput.Ocr2KeyBundleID, and is useful for accessing the field via an interface. +func (v *CreateFeedsManagerChainConfigInput) GetOcr2KeyBundleID() string { return v.Ocr2KeyBundleID } + +// GetOcr2Plugins returns CreateFeedsManagerChainConfigInput.Ocr2Plugins, and is useful for accessing the field via an interface. +func (v *CreateFeedsManagerChainConfigInput) GetOcr2Plugins() string { return v.Ocr2Plugins } + +// CreateFeedsManagerChainConfigResponse is returned by CreateFeedsManagerChainConfig on success. +type CreateFeedsManagerChainConfigResponse struct { + CreateFeedsManagerChainConfig CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigPayload `json:"-"` +} + +// GetCreateFeedsManagerChainConfig returns CreateFeedsManagerChainConfigResponse.CreateFeedsManagerChainConfig, and is useful for accessing the field via an interface. +func (v *CreateFeedsManagerChainConfigResponse) GetCreateFeedsManagerChainConfig() CreateFeedsManagerChainConfigCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigPayload { + return v.CreateFeedsManagerChainConfig +} + +func (v *CreateFeedsManagerChainConfigResponse) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *CreateFeedsManagerChainConfigResponse + CreateFeedsManagerChainConfig json.RawMessage `json:"createFeedsManagerChainConfig"` + graphql.NoUnmarshalJSON + } + firstPass.CreateFeedsManagerChainConfigResponse = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + { + dst := &v.CreateFeedsManagerChainConfig + src := firstPass.CreateFeedsManagerChainConfig + if len(src) != 0 && string(src) != "null" { + err = __unmarshalCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigPayload( + src, dst) + if err != nil { + return fmt.Errorf( + "unable to unmarshal CreateFeedsManagerChainConfigResponse.CreateFeedsManagerChainConfig: %w", err) + } + } + } + return nil +} + +type __premarshalCreateFeedsManagerChainConfigResponse struct { + CreateFeedsManagerChainConfig json.RawMessage `json:"createFeedsManagerChainConfig"` +} + +func (v *CreateFeedsManagerChainConfigResponse) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *CreateFeedsManagerChainConfigResponse) __premarshalJSON() (*__premarshalCreateFeedsManagerChainConfigResponse, error) { + var retval __premarshalCreateFeedsManagerChainConfigResponse + + { + + dst := &retval.CreateFeedsManagerChainConfig + src := v.CreateFeedsManagerChainConfig + var err error + *dst, err = __marshalCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigCreateFeedsManagerChainConfigPayload( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal CreateFeedsManagerChainConfigResponse.CreateFeedsManagerChainConfig: %w", err) + } + } + return &retval, nil +} + +// CreateFeedsManagerCreateFeedsManagerCreateFeedsManagerPayload includes the requested fields of the GraphQL interface CreateFeedsManagerPayload. +// +// CreateFeedsManagerCreateFeedsManagerCreateFeedsManagerPayload is implemented by the following types: +// CreateFeedsManagerCreateFeedsManagerCreateFeedsManagerSuccess +// CreateFeedsManagerCreateFeedsManagerDuplicateFeedsManagerError +// CreateFeedsManagerCreateFeedsManagerInputErrors +// CreateFeedsManagerCreateFeedsManagerNotFoundError +// CreateFeedsManagerCreateFeedsManagerSingleFeedsManagerError +type CreateFeedsManagerCreateFeedsManagerCreateFeedsManagerPayload interface { + implementsGraphQLInterfaceCreateFeedsManagerCreateFeedsManagerCreateFeedsManagerPayload() + // GetTypename returns the receiver's concrete GraphQL type-name (see interface doc for possible values). + GetTypename() string +} + +func (v *CreateFeedsManagerCreateFeedsManagerCreateFeedsManagerSuccess) implementsGraphQLInterfaceCreateFeedsManagerCreateFeedsManagerCreateFeedsManagerPayload() { +} +func (v *CreateFeedsManagerCreateFeedsManagerDuplicateFeedsManagerError) implementsGraphQLInterfaceCreateFeedsManagerCreateFeedsManagerCreateFeedsManagerPayload() { +} +func (v *CreateFeedsManagerCreateFeedsManagerInputErrors) implementsGraphQLInterfaceCreateFeedsManagerCreateFeedsManagerCreateFeedsManagerPayload() { +} +func (v *CreateFeedsManagerCreateFeedsManagerNotFoundError) implementsGraphQLInterfaceCreateFeedsManagerCreateFeedsManagerCreateFeedsManagerPayload() { +} +func (v *CreateFeedsManagerCreateFeedsManagerSingleFeedsManagerError) implementsGraphQLInterfaceCreateFeedsManagerCreateFeedsManagerCreateFeedsManagerPayload() { +} + +func __unmarshalCreateFeedsManagerCreateFeedsManagerCreateFeedsManagerPayload(b []byte, v *CreateFeedsManagerCreateFeedsManagerCreateFeedsManagerPayload) error { + if string(b) == "null" { + return nil + } + + var tn struct { + TypeName string `json:"__typename"` + } + err := json.Unmarshal(b, &tn) + if err != nil { + return err + } + + switch tn.TypeName { + case "CreateFeedsManagerSuccess": + *v = new(CreateFeedsManagerCreateFeedsManagerCreateFeedsManagerSuccess) + return json.Unmarshal(b, *v) + case "DuplicateFeedsManagerError": + *v = new(CreateFeedsManagerCreateFeedsManagerDuplicateFeedsManagerError) + return json.Unmarshal(b, *v) + case "InputErrors": + *v = new(CreateFeedsManagerCreateFeedsManagerInputErrors) + return json.Unmarshal(b, *v) + case "NotFoundError": + *v = new(CreateFeedsManagerCreateFeedsManagerNotFoundError) + return json.Unmarshal(b, *v) + case "SingleFeedsManagerError": + *v = new(CreateFeedsManagerCreateFeedsManagerSingleFeedsManagerError) + return json.Unmarshal(b, *v) + case "": + return fmt.Errorf( + "response was missing CreateFeedsManagerPayload.__typename") + default: + return fmt.Errorf( + `unexpected concrete type for CreateFeedsManagerCreateFeedsManagerCreateFeedsManagerPayload: "%v"`, tn.TypeName) + } +} + +func __marshalCreateFeedsManagerCreateFeedsManagerCreateFeedsManagerPayload(v *CreateFeedsManagerCreateFeedsManagerCreateFeedsManagerPayload) ([]byte, error) { + + var typename string + switch v := (*v).(type) { + case *CreateFeedsManagerCreateFeedsManagerCreateFeedsManagerSuccess: + typename = "CreateFeedsManagerSuccess" + + result := struct { + TypeName string `json:"__typename"` + *CreateFeedsManagerCreateFeedsManagerCreateFeedsManagerSuccess + }{typename, v} + return json.Marshal(result) + case *CreateFeedsManagerCreateFeedsManagerDuplicateFeedsManagerError: + typename = "DuplicateFeedsManagerError" + + result := struct { + TypeName string `json:"__typename"` + *CreateFeedsManagerCreateFeedsManagerDuplicateFeedsManagerError + }{typename, v} + return json.Marshal(result) + case *CreateFeedsManagerCreateFeedsManagerInputErrors: + typename = "InputErrors" + + result := struct { + TypeName string `json:"__typename"` + *CreateFeedsManagerCreateFeedsManagerInputErrors + }{typename, v} + return json.Marshal(result) + case *CreateFeedsManagerCreateFeedsManagerNotFoundError: + typename = "NotFoundError" + + result := struct { + TypeName string `json:"__typename"` + *CreateFeedsManagerCreateFeedsManagerNotFoundError + }{typename, v} + return json.Marshal(result) + case *CreateFeedsManagerCreateFeedsManagerSingleFeedsManagerError: + typename = "SingleFeedsManagerError" + + result := struct { + TypeName string `json:"__typename"` + *CreateFeedsManagerCreateFeedsManagerSingleFeedsManagerError + }{typename, v} + return json.Marshal(result) + case nil: + return []byte("null"), nil + default: + return nil, fmt.Errorf( + `unexpected concrete type for CreateFeedsManagerCreateFeedsManagerCreateFeedsManagerPayload: "%T"`, v) + } +} + +// CreateFeedsManagerCreateFeedsManagerCreateFeedsManagerSuccess includes the requested fields of the GraphQL type CreateFeedsManagerSuccess. +type CreateFeedsManagerCreateFeedsManagerCreateFeedsManagerSuccess struct { + Typename string `json:"__typename"` + FeedsManager CreateFeedsManagerCreateFeedsManagerCreateFeedsManagerSuccessFeedsManager `json:"feedsManager"` +} + +// GetTypename returns CreateFeedsManagerCreateFeedsManagerCreateFeedsManagerSuccess.Typename, and is useful for accessing the field via an interface. +func (v *CreateFeedsManagerCreateFeedsManagerCreateFeedsManagerSuccess) GetTypename() string { + return v.Typename +} + +// GetFeedsManager returns CreateFeedsManagerCreateFeedsManagerCreateFeedsManagerSuccess.FeedsManager, and is useful for accessing the field via an interface. +func (v *CreateFeedsManagerCreateFeedsManagerCreateFeedsManagerSuccess) GetFeedsManager() CreateFeedsManagerCreateFeedsManagerCreateFeedsManagerSuccessFeedsManager { + return v.FeedsManager +} + +// CreateFeedsManagerCreateFeedsManagerCreateFeedsManagerSuccessFeedsManager includes the requested fields of the GraphQL type FeedsManager. +type CreateFeedsManagerCreateFeedsManagerCreateFeedsManagerSuccessFeedsManager struct { + FeedsManagerParts `json:"-"` +} + +// GetId returns CreateFeedsManagerCreateFeedsManagerCreateFeedsManagerSuccessFeedsManager.Id, and is useful for accessing the field via an interface. +func (v *CreateFeedsManagerCreateFeedsManagerCreateFeedsManagerSuccessFeedsManager) GetId() string { + return v.FeedsManagerParts.Id +} + +// GetName returns CreateFeedsManagerCreateFeedsManagerCreateFeedsManagerSuccessFeedsManager.Name, and is useful for accessing the field via an interface. +func (v *CreateFeedsManagerCreateFeedsManagerCreateFeedsManagerSuccessFeedsManager) GetName() string { + return v.FeedsManagerParts.Name +} + +// GetUri returns CreateFeedsManagerCreateFeedsManagerCreateFeedsManagerSuccessFeedsManager.Uri, and is useful for accessing the field via an interface. +func (v *CreateFeedsManagerCreateFeedsManagerCreateFeedsManagerSuccessFeedsManager) GetUri() string { + return v.FeedsManagerParts.Uri +} + +// GetPublicKey returns CreateFeedsManagerCreateFeedsManagerCreateFeedsManagerSuccessFeedsManager.PublicKey, and is useful for accessing the field via an interface. +func (v *CreateFeedsManagerCreateFeedsManagerCreateFeedsManagerSuccessFeedsManager) GetPublicKey() string { + return v.FeedsManagerParts.PublicKey +} + +// GetIsConnectionActive returns CreateFeedsManagerCreateFeedsManagerCreateFeedsManagerSuccessFeedsManager.IsConnectionActive, and is useful for accessing the field via an interface. +func (v *CreateFeedsManagerCreateFeedsManagerCreateFeedsManagerSuccessFeedsManager) GetIsConnectionActive() bool { + return v.FeedsManagerParts.IsConnectionActive +} + +// GetCreatedAt returns CreateFeedsManagerCreateFeedsManagerCreateFeedsManagerSuccessFeedsManager.CreatedAt, and is useful for accessing the field via an interface. +func (v *CreateFeedsManagerCreateFeedsManagerCreateFeedsManagerSuccessFeedsManager) GetCreatedAt() string { + return v.FeedsManagerParts.CreatedAt +} + +func (v *CreateFeedsManagerCreateFeedsManagerCreateFeedsManagerSuccessFeedsManager) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *CreateFeedsManagerCreateFeedsManagerCreateFeedsManagerSuccessFeedsManager + graphql.NoUnmarshalJSON + } + firstPass.CreateFeedsManagerCreateFeedsManagerCreateFeedsManagerSuccessFeedsManager = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + err = json.Unmarshal( + b, &v.FeedsManagerParts) + if err != nil { + return err + } + return nil +} + +type __premarshalCreateFeedsManagerCreateFeedsManagerCreateFeedsManagerSuccessFeedsManager struct { + Id string `json:"id"` + + Name string `json:"name"` + + Uri string `json:"uri"` + + PublicKey string `json:"publicKey"` + + IsConnectionActive bool `json:"isConnectionActive"` + + CreatedAt string `json:"createdAt"` +} + +func (v *CreateFeedsManagerCreateFeedsManagerCreateFeedsManagerSuccessFeedsManager) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *CreateFeedsManagerCreateFeedsManagerCreateFeedsManagerSuccessFeedsManager) __premarshalJSON() (*__premarshalCreateFeedsManagerCreateFeedsManagerCreateFeedsManagerSuccessFeedsManager, error) { + var retval __premarshalCreateFeedsManagerCreateFeedsManagerCreateFeedsManagerSuccessFeedsManager + + retval.Id = v.FeedsManagerParts.Id + retval.Name = v.FeedsManagerParts.Name + retval.Uri = v.FeedsManagerParts.Uri + retval.PublicKey = v.FeedsManagerParts.PublicKey + retval.IsConnectionActive = v.FeedsManagerParts.IsConnectionActive + retval.CreatedAt = v.FeedsManagerParts.CreatedAt + return &retval, nil +} + +// CreateFeedsManagerCreateFeedsManagerDuplicateFeedsManagerError includes the requested fields of the GraphQL type DuplicateFeedsManagerError. +type CreateFeedsManagerCreateFeedsManagerDuplicateFeedsManagerError struct { + Typename string `json:"__typename"` +} + +// GetTypename returns CreateFeedsManagerCreateFeedsManagerDuplicateFeedsManagerError.Typename, and is useful for accessing the field via an interface. +func (v *CreateFeedsManagerCreateFeedsManagerDuplicateFeedsManagerError) GetTypename() string { + return v.Typename +} + +// CreateFeedsManagerCreateFeedsManagerInputErrors includes the requested fields of the GraphQL type InputErrors. +type CreateFeedsManagerCreateFeedsManagerInputErrors struct { + Typename string `json:"__typename"` + Errors []CreateFeedsManagerCreateFeedsManagerInputErrorsErrorsInputError `json:"errors"` +} + +// GetTypename returns CreateFeedsManagerCreateFeedsManagerInputErrors.Typename, and is useful for accessing the field via an interface. +func (v *CreateFeedsManagerCreateFeedsManagerInputErrors) GetTypename() string { return v.Typename } + +// GetErrors returns CreateFeedsManagerCreateFeedsManagerInputErrors.Errors, and is useful for accessing the field via an interface. +func (v *CreateFeedsManagerCreateFeedsManagerInputErrors) GetErrors() []CreateFeedsManagerCreateFeedsManagerInputErrorsErrorsInputError { + return v.Errors +} + +// CreateFeedsManagerCreateFeedsManagerInputErrorsErrorsInputError includes the requested fields of the GraphQL type InputError. +type CreateFeedsManagerCreateFeedsManagerInputErrorsErrorsInputError struct { + Message string `json:"message"` + Code ErrorCode `json:"code"` + Path string `json:"path"` +} + +// GetMessage returns CreateFeedsManagerCreateFeedsManagerInputErrorsErrorsInputError.Message, and is useful for accessing the field via an interface. +func (v *CreateFeedsManagerCreateFeedsManagerInputErrorsErrorsInputError) GetMessage() string { + return v.Message +} + +// GetCode returns CreateFeedsManagerCreateFeedsManagerInputErrorsErrorsInputError.Code, and is useful for accessing the field via an interface. +func (v *CreateFeedsManagerCreateFeedsManagerInputErrorsErrorsInputError) GetCode() ErrorCode { + return v.Code +} + +// GetPath returns CreateFeedsManagerCreateFeedsManagerInputErrorsErrorsInputError.Path, and is useful for accessing the field via an interface. +func (v *CreateFeedsManagerCreateFeedsManagerInputErrorsErrorsInputError) GetPath() string { + return v.Path +} + +// CreateFeedsManagerCreateFeedsManagerNotFoundError includes the requested fields of the GraphQL type NotFoundError. +type CreateFeedsManagerCreateFeedsManagerNotFoundError struct { + Typename string `json:"__typename"` + Message string `json:"message"` + Code ErrorCode `json:"code"` +} + +// GetTypename returns CreateFeedsManagerCreateFeedsManagerNotFoundError.Typename, and is useful for accessing the field via an interface. +func (v *CreateFeedsManagerCreateFeedsManagerNotFoundError) GetTypename() string { return v.Typename } + +// GetMessage returns CreateFeedsManagerCreateFeedsManagerNotFoundError.Message, and is useful for accessing the field via an interface. +func (v *CreateFeedsManagerCreateFeedsManagerNotFoundError) GetMessage() string { return v.Message } + +// GetCode returns CreateFeedsManagerCreateFeedsManagerNotFoundError.Code, and is useful for accessing the field via an interface. +func (v *CreateFeedsManagerCreateFeedsManagerNotFoundError) GetCode() ErrorCode { return v.Code } + +// CreateFeedsManagerCreateFeedsManagerSingleFeedsManagerError includes the requested fields of the GraphQL type SingleFeedsManagerError. +type CreateFeedsManagerCreateFeedsManagerSingleFeedsManagerError struct { + Typename string `json:"__typename"` + Message string `json:"message"` + Code ErrorCode `json:"code"` +} + +// GetTypename returns CreateFeedsManagerCreateFeedsManagerSingleFeedsManagerError.Typename, and is useful for accessing the field via an interface. +func (v *CreateFeedsManagerCreateFeedsManagerSingleFeedsManagerError) GetTypename() string { + return v.Typename +} + +// GetMessage returns CreateFeedsManagerCreateFeedsManagerSingleFeedsManagerError.Message, and is useful for accessing the field via an interface. +func (v *CreateFeedsManagerCreateFeedsManagerSingleFeedsManagerError) GetMessage() string { + return v.Message +} + +// GetCode returns CreateFeedsManagerCreateFeedsManagerSingleFeedsManagerError.Code, and is useful for accessing the field via an interface. +func (v *CreateFeedsManagerCreateFeedsManagerSingleFeedsManagerError) GetCode() ErrorCode { + return v.Code +} + +type CreateFeedsManagerInput struct { + Name string `json:"name"` + Uri string `json:"uri"` + PublicKey string `json:"publicKey"` +} + +// GetName returns CreateFeedsManagerInput.Name, and is useful for accessing the field via an interface. +func (v *CreateFeedsManagerInput) GetName() string { return v.Name } + +// GetUri returns CreateFeedsManagerInput.Uri, and is useful for accessing the field via an interface. +func (v *CreateFeedsManagerInput) GetUri() string { return v.Uri } + +// GetPublicKey returns CreateFeedsManagerInput.PublicKey, and is useful for accessing the field via an interface. +func (v *CreateFeedsManagerInput) GetPublicKey() string { return v.PublicKey } + +// CreateFeedsManagerResponse is returned by CreateFeedsManager on success. +type CreateFeedsManagerResponse struct { + CreateFeedsManager CreateFeedsManagerCreateFeedsManagerCreateFeedsManagerPayload `json:"-"` +} + +// GetCreateFeedsManager returns CreateFeedsManagerResponse.CreateFeedsManager, and is useful for accessing the field via an interface. +func (v *CreateFeedsManagerResponse) GetCreateFeedsManager() CreateFeedsManagerCreateFeedsManagerCreateFeedsManagerPayload { + return v.CreateFeedsManager +} + +func (v *CreateFeedsManagerResponse) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *CreateFeedsManagerResponse + CreateFeedsManager json.RawMessage `json:"createFeedsManager"` + graphql.NoUnmarshalJSON + } + firstPass.CreateFeedsManagerResponse = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + { + dst := &v.CreateFeedsManager + src := firstPass.CreateFeedsManager + if len(src) != 0 && string(src) != "null" { + err = __unmarshalCreateFeedsManagerCreateFeedsManagerCreateFeedsManagerPayload( + src, dst) + if err != nil { + return fmt.Errorf( + "unable to unmarshal CreateFeedsManagerResponse.CreateFeedsManager: %w", err) + } + } + } + return nil +} + +type __premarshalCreateFeedsManagerResponse struct { + CreateFeedsManager json.RawMessage `json:"createFeedsManager"` +} + +func (v *CreateFeedsManagerResponse) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *CreateFeedsManagerResponse) __premarshalJSON() (*__premarshalCreateFeedsManagerResponse, error) { + var retval __premarshalCreateFeedsManagerResponse + + { + + dst := &retval.CreateFeedsManager + src := v.CreateFeedsManager + var err error + *dst, err = __marshalCreateFeedsManagerCreateFeedsManagerCreateFeedsManagerPayload( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal CreateFeedsManagerResponse.CreateFeedsManager: %w", err) + } + } + return &retval, nil +} + +type ErrorCode string + +const ( + ErrorCodeNotFound ErrorCode = "NOT_FOUND" + ErrorCodeInvalidInput ErrorCode = "INVALID_INPUT" + ErrorCodeUnprocessable ErrorCode = "UNPROCESSABLE" +) + +// FeedsManagerParts includes the GraphQL fields of FeedsManager requested by the fragment FeedsManagerParts. +type FeedsManagerParts struct { + Id string `json:"id"` + Name string `json:"name"` + Uri string `json:"uri"` + PublicKey string `json:"publicKey"` + IsConnectionActive bool `json:"isConnectionActive"` + CreatedAt string `json:"createdAt"` +} + +// GetId returns FeedsManagerParts.Id, and is useful for accessing the field via an interface. +func (v *FeedsManagerParts) GetId() string { return v.Id } + +// GetName returns FeedsManagerParts.Name, and is useful for accessing the field via an interface. +func (v *FeedsManagerParts) GetName() string { return v.Name } + +// GetUri returns FeedsManagerParts.Uri, and is useful for accessing the field via an interface. +func (v *FeedsManagerParts) GetUri() string { return v.Uri } + +// GetPublicKey returns FeedsManagerParts.PublicKey, and is useful for accessing the field via an interface. +func (v *FeedsManagerParts) GetPublicKey() string { return v.PublicKey } + +// GetIsConnectionActive returns FeedsManagerParts.IsConnectionActive, and is useful for accessing the field via an interface. +func (v *FeedsManagerParts) GetIsConnectionActive() bool { return v.IsConnectionActive } + +// GetCreatedAt returns FeedsManagerParts.CreatedAt, and is useful for accessing the field via an interface. +func (v *FeedsManagerParts) GetCreatedAt() string { return v.CreatedAt } + +// FetchAccountsEthKeysEthKeysPayload includes the requested fields of the GraphQL type EthKeysPayload. +type FetchAccountsEthKeysEthKeysPayload struct { + Results []FetchAccountsEthKeysEthKeysPayloadResultsEthKey `json:"results"` +} + +// GetResults returns FetchAccountsEthKeysEthKeysPayload.Results, and is useful for accessing the field via an interface. +func (v *FetchAccountsEthKeysEthKeysPayload) GetResults() []FetchAccountsEthKeysEthKeysPayloadResultsEthKey { + return v.Results +} + +// FetchAccountsEthKeysEthKeysPayloadResultsEthKey includes the requested fields of the GraphQL type EthKey. +type FetchAccountsEthKeysEthKeysPayloadResultsEthKey struct { + Address string `json:"address"` + IsDisabled bool `json:"isDisabled"` + Chain FetchAccountsEthKeysEthKeysPayloadResultsEthKeyChain `json:"chain"` + EthBalance string `json:"ethBalance"` + LinkBalance string `json:"linkBalance"` +} + +// GetAddress returns FetchAccountsEthKeysEthKeysPayloadResultsEthKey.Address, and is useful for accessing the field via an interface. +func (v *FetchAccountsEthKeysEthKeysPayloadResultsEthKey) GetAddress() string { return v.Address } + +// GetIsDisabled returns FetchAccountsEthKeysEthKeysPayloadResultsEthKey.IsDisabled, and is useful for accessing the field via an interface. +func (v *FetchAccountsEthKeysEthKeysPayloadResultsEthKey) GetIsDisabled() bool { return v.IsDisabled } + +// GetChain returns FetchAccountsEthKeysEthKeysPayloadResultsEthKey.Chain, and is useful for accessing the field via an interface. +func (v *FetchAccountsEthKeysEthKeysPayloadResultsEthKey) GetChain() FetchAccountsEthKeysEthKeysPayloadResultsEthKeyChain { + return v.Chain +} + +// GetEthBalance returns FetchAccountsEthKeysEthKeysPayloadResultsEthKey.EthBalance, and is useful for accessing the field via an interface. +func (v *FetchAccountsEthKeysEthKeysPayloadResultsEthKey) GetEthBalance() string { return v.EthBalance } + +// GetLinkBalance returns FetchAccountsEthKeysEthKeysPayloadResultsEthKey.LinkBalance, and is useful for accessing the field via an interface. +func (v *FetchAccountsEthKeysEthKeysPayloadResultsEthKey) GetLinkBalance() string { + return v.LinkBalance +} + +// FetchAccountsEthKeysEthKeysPayloadResultsEthKeyChain includes the requested fields of the GraphQL type Chain. +type FetchAccountsEthKeysEthKeysPayloadResultsEthKeyChain struct { + Id string `json:"id"` + Enabled bool `json:"enabled"` +} + +// GetId returns FetchAccountsEthKeysEthKeysPayloadResultsEthKeyChain.Id, and is useful for accessing the field via an interface. +func (v *FetchAccountsEthKeysEthKeysPayloadResultsEthKeyChain) GetId() string { return v.Id } + +// GetEnabled returns FetchAccountsEthKeysEthKeysPayloadResultsEthKeyChain.Enabled, and is useful for accessing the field via an interface. +func (v *FetchAccountsEthKeysEthKeysPayloadResultsEthKeyChain) GetEnabled() bool { return v.Enabled } + +// FetchAccountsResponse is returned by FetchAccounts on success. +type FetchAccountsResponse struct { + EthKeys FetchAccountsEthKeysEthKeysPayload `json:"ethKeys"` +} + +// GetEthKeys returns FetchAccountsResponse.EthKeys, and is useful for accessing the field via an interface. +func (v *FetchAccountsResponse) GetEthKeys() FetchAccountsEthKeysEthKeysPayload { return v.EthKeys } + +// FetchCSAKeysCsaKeysCSAKeysPayload includes the requested fields of the GraphQL type CSAKeysPayload. +type FetchCSAKeysCsaKeysCSAKeysPayload struct { + Results []FetchCSAKeysCsaKeysCSAKeysPayloadResultsCSAKey `json:"results"` +} + +// GetResults returns FetchCSAKeysCsaKeysCSAKeysPayload.Results, and is useful for accessing the field via an interface. +func (v *FetchCSAKeysCsaKeysCSAKeysPayload) GetResults() []FetchCSAKeysCsaKeysCSAKeysPayloadResultsCSAKey { + return v.Results +} + +// FetchCSAKeysCsaKeysCSAKeysPayloadResultsCSAKey includes the requested fields of the GraphQL type CSAKey. +type FetchCSAKeysCsaKeysCSAKeysPayloadResultsCSAKey struct { + Id string `json:"id"` + PublicKey string `json:"publicKey"` + Version int `json:"version"` +} + +// GetId returns FetchCSAKeysCsaKeysCSAKeysPayloadResultsCSAKey.Id, and is useful for accessing the field via an interface. +func (v *FetchCSAKeysCsaKeysCSAKeysPayloadResultsCSAKey) GetId() string { return v.Id } + +// GetPublicKey returns FetchCSAKeysCsaKeysCSAKeysPayloadResultsCSAKey.PublicKey, and is useful for accessing the field via an interface. +func (v *FetchCSAKeysCsaKeysCSAKeysPayloadResultsCSAKey) GetPublicKey() string { return v.PublicKey } + +// GetVersion returns FetchCSAKeysCsaKeysCSAKeysPayloadResultsCSAKey.Version, and is useful for accessing the field via an interface. +func (v *FetchCSAKeysCsaKeysCSAKeysPayloadResultsCSAKey) GetVersion() int { return v.Version } + +// FetchCSAKeysResponse is returned by FetchCSAKeys on success. +type FetchCSAKeysResponse struct { + CsaKeys FetchCSAKeysCsaKeysCSAKeysPayload `json:"csaKeys"` +} + +// GetCsaKeys returns FetchCSAKeysResponse.CsaKeys, and is useful for accessing the field via an interface. +func (v *FetchCSAKeysResponse) GetCsaKeys() FetchCSAKeysCsaKeysCSAKeysPayload { return v.CsaKeys } + +// FetchOCR2KeyBundlesOcr2KeyBundlesOCR2KeyBundlesPayload includes the requested fields of the GraphQL type OCR2KeyBundlesPayload. +type FetchOCR2KeyBundlesOcr2KeyBundlesOCR2KeyBundlesPayload struct { + Results []FetchOCR2KeyBundlesOcr2KeyBundlesOCR2KeyBundlesPayloadResultsOCR2KeyBundle `json:"results"` +} + +// GetResults returns FetchOCR2KeyBundlesOcr2KeyBundlesOCR2KeyBundlesPayload.Results, and is useful for accessing the field via an interface. +func (v *FetchOCR2KeyBundlesOcr2KeyBundlesOCR2KeyBundlesPayload) GetResults() []FetchOCR2KeyBundlesOcr2KeyBundlesOCR2KeyBundlesPayloadResultsOCR2KeyBundle { + return v.Results +} + +// FetchOCR2KeyBundlesOcr2KeyBundlesOCR2KeyBundlesPayloadResultsOCR2KeyBundle includes the requested fields of the GraphQL type OCR2KeyBundle. +type FetchOCR2KeyBundlesOcr2KeyBundlesOCR2KeyBundlesPayloadResultsOCR2KeyBundle struct { + Id string `json:"id"` + ChainType OCR2ChainType `json:"chainType"` + ConfigPublicKey string `json:"configPublicKey"` + OnChainPublicKey string `json:"onChainPublicKey"` + OffChainPublicKey string `json:"offChainPublicKey"` +} + +// GetId returns FetchOCR2KeyBundlesOcr2KeyBundlesOCR2KeyBundlesPayloadResultsOCR2KeyBundle.Id, and is useful for accessing the field via an interface. +func (v *FetchOCR2KeyBundlesOcr2KeyBundlesOCR2KeyBundlesPayloadResultsOCR2KeyBundle) GetId() string { + return v.Id +} + +// GetChainType returns FetchOCR2KeyBundlesOcr2KeyBundlesOCR2KeyBundlesPayloadResultsOCR2KeyBundle.ChainType, and is useful for accessing the field via an interface. +func (v *FetchOCR2KeyBundlesOcr2KeyBundlesOCR2KeyBundlesPayloadResultsOCR2KeyBundle) GetChainType() OCR2ChainType { + return v.ChainType +} + +// GetConfigPublicKey returns FetchOCR2KeyBundlesOcr2KeyBundlesOCR2KeyBundlesPayloadResultsOCR2KeyBundle.ConfigPublicKey, and is useful for accessing the field via an interface. +func (v *FetchOCR2KeyBundlesOcr2KeyBundlesOCR2KeyBundlesPayloadResultsOCR2KeyBundle) GetConfigPublicKey() string { + return v.ConfigPublicKey +} + +// GetOnChainPublicKey returns FetchOCR2KeyBundlesOcr2KeyBundlesOCR2KeyBundlesPayloadResultsOCR2KeyBundle.OnChainPublicKey, and is useful for accessing the field via an interface. +func (v *FetchOCR2KeyBundlesOcr2KeyBundlesOCR2KeyBundlesPayloadResultsOCR2KeyBundle) GetOnChainPublicKey() string { + return v.OnChainPublicKey +} + +// GetOffChainPublicKey returns FetchOCR2KeyBundlesOcr2KeyBundlesOCR2KeyBundlesPayloadResultsOCR2KeyBundle.OffChainPublicKey, and is useful for accessing the field via an interface. +func (v *FetchOCR2KeyBundlesOcr2KeyBundlesOCR2KeyBundlesPayloadResultsOCR2KeyBundle) GetOffChainPublicKey() string { + return v.OffChainPublicKey +} + +// FetchOCR2KeyBundlesResponse is returned by FetchOCR2KeyBundles on success. +type FetchOCR2KeyBundlesResponse struct { + Ocr2KeyBundles FetchOCR2KeyBundlesOcr2KeyBundlesOCR2KeyBundlesPayload `json:"ocr2KeyBundles"` +} + +// GetOcr2KeyBundles returns FetchOCR2KeyBundlesResponse.Ocr2KeyBundles, and is useful for accessing the field via an interface. +func (v *FetchOCR2KeyBundlesResponse) GetOcr2KeyBundles() FetchOCR2KeyBundlesOcr2KeyBundlesOCR2KeyBundlesPayload { + return v.Ocr2KeyBundles +} + +// FetchP2PKeysP2pKeysP2PKeysPayload includes the requested fields of the GraphQL type P2PKeysPayload. +type FetchP2PKeysP2pKeysP2PKeysPayload struct { + Results []FetchP2PKeysP2pKeysP2PKeysPayloadResultsP2PKey `json:"results"` +} + +// GetResults returns FetchP2PKeysP2pKeysP2PKeysPayload.Results, and is useful for accessing the field via an interface. +func (v *FetchP2PKeysP2pKeysP2PKeysPayload) GetResults() []FetchP2PKeysP2pKeysP2PKeysPayloadResultsP2PKey { + return v.Results +} + +// FetchP2PKeysP2pKeysP2PKeysPayloadResultsP2PKey includes the requested fields of the GraphQL type P2PKey. +type FetchP2PKeysP2pKeysP2PKeysPayloadResultsP2PKey struct { + Id string `json:"id"` + PeerID string `json:"peerID"` + PublicKey string `json:"publicKey"` +} + +// GetId returns FetchP2PKeysP2pKeysP2PKeysPayloadResultsP2PKey.Id, and is useful for accessing the field via an interface. +func (v *FetchP2PKeysP2pKeysP2PKeysPayloadResultsP2PKey) GetId() string { return v.Id } + +// GetPeerID returns FetchP2PKeysP2pKeysP2PKeysPayloadResultsP2PKey.PeerID, and is useful for accessing the field via an interface. +func (v *FetchP2PKeysP2pKeysP2PKeysPayloadResultsP2PKey) GetPeerID() string { return v.PeerID } + +// GetPublicKey returns FetchP2PKeysP2pKeysP2PKeysPayloadResultsP2PKey.PublicKey, and is useful for accessing the field via an interface. +func (v *FetchP2PKeysP2pKeysP2PKeysPayloadResultsP2PKey) GetPublicKey() string { return v.PublicKey } + +// FetchP2PKeysResponse is returned by FetchP2PKeys on success. +type FetchP2PKeysResponse struct { + P2pKeys FetchP2PKeysP2pKeysP2PKeysPayload `json:"p2pKeys"` +} + +// GetP2pKeys returns FetchP2PKeysResponse.P2pKeys, and is useful for accessing the field via an interface. +func (v *FetchP2PKeysResponse) GetP2pKeys() FetchP2PKeysP2pKeysP2PKeysPayload { return v.P2pKeys } + +// GetBridgeBridge includes the requested fields of the GraphQL type Bridge. +type GetBridgeBridge struct { + Typename string `json:"__typename"` + BridgeParts `json:"-"` +} + +// GetTypename returns GetBridgeBridge.Typename, and is useful for accessing the field via an interface. +func (v *GetBridgeBridge) GetTypename() string { return v.Typename } + +// GetId returns GetBridgeBridge.Id, and is useful for accessing the field via an interface. +func (v *GetBridgeBridge) GetId() string { return v.BridgeParts.Id } + +// GetName returns GetBridgeBridge.Name, and is useful for accessing the field via an interface. +func (v *GetBridgeBridge) GetName() string { return v.BridgeParts.Name } + +// GetUrl returns GetBridgeBridge.Url, and is useful for accessing the field via an interface. +func (v *GetBridgeBridge) GetUrl() string { return v.BridgeParts.Url } + +// GetConfirmations returns GetBridgeBridge.Confirmations, and is useful for accessing the field via an interface. +func (v *GetBridgeBridge) GetConfirmations() int { return v.BridgeParts.Confirmations } + +// GetOutgoingToken returns GetBridgeBridge.OutgoingToken, and is useful for accessing the field via an interface. +func (v *GetBridgeBridge) GetOutgoingToken() string { return v.BridgeParts.OutgoingToken } + +// GetMinimumContractPayment returns GetBridgeBridge.MinimumContractPayment, and is useful for accessing the field via an interface. +func (v *GetBridgeBridge) GetMinimumContractPayment() string { + return v.BridgeParts.MinimumContractPayment +} + +// GetCreatedAt returns GetBridgeBridge.CreatedAt, and is useful for accessing the field via an interface. +func (v *GetBridgeBridge) GetCreatedAt() string { return v.BridgeParts.CreatedAt } + +func (v *GetBridgeBridge) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *GetBridgeBridge + graphql.NoUnmarshalJSON + } + firstPass.GetBridgeBridge = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + err = json.Unmarshal( + b, &v.BridgeParts) + if err != nil { + return err + } + return nil +} + +type __premarshalGetBridgeBridge struct { + Typename string `json:"__typename"` + + Id string `json:"id"` + + Name string `json:"name"` + + Url string `json:"url"` + + Confirmations int `json:"confirmations"` + + OutgoingToken string `json:"outgoingToken"` + + MinimumContractPayment string `json:"minimumContractPayment"` + + CreatedAt string `json:"createdAt"` +} + +func (v *GetBridgeBridge) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *GetBridgeBridge) __premarshalJSON() (*__premarshalGetBridgeBridge, error) { + var retval __premarshalGetBridgeBridge + + retval.Typename = v.Typename + retval.Id = v.BridgeParts.Id + retval.Name = v.BridgeParts.Name + retval.Url = v.BridgeParts.Url + retval.Confirmations = v.BridgeParts.Confirmations + retval.OutgoingToken = v.BridgeParts.OutgoingToken + retval.MinimumContractPayment = v.BridgeParts.MinimumContractPayment + retval.CreatedAt = v.BridgeParts.CreatedAt + return &retval, nil +} + +// GetBridgeBridgeBridgePayload includes the requested fields of the GraphQL interface BridgePayload. +// +// GetBridgeBridgeBridgePayload is implemented by the following types: +// GetBridgeBridge +// GetBridgeBridgeNotFoundError +type GetBridgeBridgeBridgePayload interface { + implementsGraphQLInterfaceGetBridgeBridgeBridgePayload() + // GetTypename returns the receiver's concrete GraphQL type-name (see interface doc for possible values). + GetTypename() string +} + +func (v *GetBridgeBridge) implementsGraphQLInterfaceGetBridgeBridgeBridgePayload() {} +func (v *GetBridgeBridgeNotFoundError) implementsGraphQLInterfaceGetBridgeBridgeBridgePayload() {} + +func __unmarshalGetBridgeBridgeBridgePayload(b []byte, v *GetBridgeBridgeBridgePayload) error { + if string(b) == "null" { + return nil + } + + var tn struct { + TypeName string `json:"__typename"` + } + err := json.Unmarshal(b, &tn) + if err != nil { + return err + } + + switch tn.TypeName { + case "Bridge": + *v = new(GetBridgeBridge) + return json.Unmarshal(b, *v) + case "NotFoundError": + *v = new(GetBridgeBridgeNotFoundError) + return json.Unmarshal(b, *v) + case "": + return fmt.Errorf( + "response was missing BridgePayload.__typename") + default: + return fmt.Errorf( + `unexpected concrete type for GetBridgeBridgeBridgePayload: "%v"`, tn.TypeName) + } +} + +func __marshalGetBridgeBridgeBridgePayload(v *GetBridgeBridgeBridgePayload) ([]byte, error) { + + var typename string + switch v := (*v).(type) { + case *GetBridgeBridge: + typename = "Bridge" + + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalGetBridgeBridge + }{typename, premarshaled} + return json.Marshal(result) + case *GetBridgeBridgeNotFoundError: + typename = "NotFoundError" + + result := struct { + TypeName string `json:"__typename"` + *GetBridgeBridgeNotFoundError + }{typename, v} + return json.Marshal(result) + case nil: + return []byte("null"), nil + default: + return nil, fmt.Errorf( + `unexpected concrete type for GetBridgeBridgeBridgePayload: "%T"`, v) + } +} + +// GetBridgeBridgeNotFoundError includes the requested fields of the GraphQL type NotFoundError. +type GetBridgeBridgeNotFoundError struct { + Typename string `json:"__typename"` + Message string `json:"message"` + Code ErrorCode `json:"code"` +} + +// GetTypename returns GetBridgeBridgeNotFoundError.Typename, and is useful for accessing the field via an interface. +func (v *GetBridgeBridgeNotFoundError) GetTypename() string { return v.Typename } + +// GetMessage returns GetBridgeBridgeNotFoundError.Message, and is useful for accessing the field via an interface. +func (v *GetBridgeBridgeNotFoundError) GetMessage() string { return v.Message } + +// GetCode returns GetBridgeBridgeNotFoundError.Code, and is useful for accessing the field via an interface. +func (v *GetBridgeBridgeNotFoundError) GetCode() ErrorCode { return v.Code } + +// GetBridgeResponse is returned by GetBridge on success. +type GetBridgeResponse struct { + Bridge GetBridgeBridgeBridgePayload `json:"-"` +} + +// GetBridge returns GetBridgeResponse.Bridge, and is useful for accessing the field via an interface. +func (v *GetBridgeResponse) GetBridge() GetBridgeBridgeBridgePayload { return v.Bridge } + +func (v *GetBridgeResponse) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *GetBridgeResponse + Bridge json.RawMessage `json:"bridge"` + graphql.NoUnmarshalJSON + } + firstPass.GetBridgeResponse = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + { + dst := &v.Bridge + src := firstPass.Bridge + if len(src) != 0 && string(src) != "null" { + err = __unmarshalGetBridgeBridgeBridgePayload( + src, dst) + if err != nil { + return fmt.Errorf( + "unable to unmarshal GetBridgeResponse.Bridge: %w", err) + } + } + } + return nil +} + +type __premarshalGetBridgeResponse struct { + Bridge json.RawMessage `json:"bridge"` +} + +func (v *GetBridgeResponse) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *GetBridgeResponse) __premarshalJSON() (*__premarshalGetBridgeResponse, error) { + var retval __premarshalGetBridgeResponse + + { + + dst := &retval.Bridge + src := v.Bridge + var err error + *dst, err = __marshalGetBridgeBridgeBridgePayload( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal GetBridgeResponse.Bridge: %w", err) + } + } + return &retval, nil +} + +// GetFeedsManagerFeedsManager includes the requested fields of the GraphQL type FeedsManager. +type GetFeedsManagerFeedsManager struct { + Typename string `json:"__typename"` + FeedsManagerParts `json:"-"` +} + +// GetTypename returns GetFeedsManagerFeedsManager.Typename, and is useful for accessing the field via an interface. +func (v *GetFeedsManagerFeedsManager) GetTypename() string { return v.Typename } + +// GetId returns GetFeedsManagerFeedsManager.Id, and is useful for accessing the field via an interface. +func (v *GetFeedsManagerFeedsManager) GetId() string { return v.FeedsManagerParts.Id } + +// GetName returns GetFeedsManagerFeedsManager.Name, and is useful for accessing the field via an interface. +func (v *GetFeedsManagerFeedsManager) GetName() string { return v.FeedsManagerParts.Name } + +// GetUri returns GetFeedsManagerFeedsManager.Uri, and is useful for accessing the field via an interface. +func (v *GetFeedsManagerFeedsManager) GetUri() string { return v.FeedsManagerParts.Uri } + +// GetPublicKey returns GetFeedsManagerFeedsManager.PublicKey, and is useful for accessing the field via an interface. +func (v *GetFeedsManagerFeedsManager) GetPublicKey() string { return v.FeedsManagerParts.PublicKey } + +// GetIsConnectionActive returns GetFeedsManagerFeedsManager.IsConnectionActive, and is useful for accessing the field via an interface. +func (v *GetFeedsManagerFeedsManager) GetIsConnectionActive() bool { + return v.FeedsManagerParts.IsConnectionActive +} + +// GetCreatedAt returns GetFeedsManagerFeedsManager.CreatedAt, and is useful for accessing the field via an interface. +func (v *GetFeedsManagerFeedsManager) GetCreatedAt() string { return v.FeedsManagerParts.CreatedAt } + +func (v *GetFeedsManagerFeedsManager) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *GetFeedsManagerFeedsManager + graphql.NoUnmarshalJSON + } + firstPass.GetFeedsManagerFeedsManager = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + err = json.Unmarshal( + b, &v.FeedsManagerParts) + if err != nil { + return err + } + return nil +} + +type __premarshalGetFeedsManagerFeedsManager struct { + Typename string `json:"__typename"` + + Id string `json:"id"` + + Name string `json:"name"` + + Uri string `json:"uri"` + + PublicKey string `json:"publicKey"` + + IsConnectionActive bool `json:"isConnectionActive"` + + CreatedAt string `json:"createdAt"` +} + +func (v *GetFeedsManagerFeedsManager) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *GetFeedsManagerFeedsManager) __premarshalJSON() (*__premarshalGetFeedsManagerFeedsManager, error) { + var retval __premarshalGetFeedsManagerFeedsManager + + retval.Typename = v.Typename + retval.Id = v.FeedsManagerParts.Id + retval.Name = v.FeedsManagerParts.Name + retval.Uri = v.FeedsManagerParts.Uri + retval.PublicKey = v.FeedsManagerParts.PublicKey + retval.IsConnectionActive = v.FeedsManagerParts.IsConnectionActive + retval.CreatedAt = v.FeedsManagerParts.CreatedAt + return &retval, nil +} + +// GetFeedsManagerFeedsManagerFeedsManagerPayload includes the requested fields of the GraphQL interface FeedsManagerPayload. +// +// GetFeedsManagerFeedsManagerFeedsManagerPayload is implemented by the following types: +// GetFeedsManagerFeedsManager +// GetFeedsManagerFeedsManagerNotFoundError +type GetFeedsManagerFeedsManagerFeedsManagerPayload interface { + implementsGraphQLInterfaceGetFeedsManagerFeedsManagerFeedsManagerPayload() + // GetTypename returns the receiver's concrete GraphQL type-name (see interface doc for possible values). + GetTypename() string +} + +func (v *GetFeedsManagerFeedsManager) implementsGraphQLInterfaceGetFeedsManagerFeedsManagerFeedsManagerPayload() { +} +func (v *GetFeedsManagerFeedsManagerNotFoundError) implementsGraphQLInterfaceGetFeedsManagerFeedsManagerFeedsManagerPayload() { +} + +func __unmarshalGetFeedsManagerFeedsManagerFeedsManagerPayload(b []byte, v *GetFeedsManagerFeedsManagerFeedsManagerPayload) error { + if string(b) == "null" { + return nil + } + + var tn struct { + TypeName string `json:"__typename"` + } + err := json.Unmarshal(b, &tn) + if err != nil { + return err + } + + switch tn.TypeName { + case "FeedsManager": + *v = new(GetFeedsManagerFeedsManager) + return json.Unmarshal(b, *v) + case "NotFoundError": + *v = new(GetFeedsManagerFeedsManagerNotFoundError) + return json.Unmarshal(b, *v) + case "": + return fmt.Errorf( + "response was missing FeedsManagerPayload.__typename") + default: + return fmt.Errorf( + `unexpected concrete type for GetFeedsManagerFeedsManagerFeedsManagerPayload: "%v"`, tn.TypeName) + } +} + +func __marshalGetFeedsManagerFeedsManagerFeedsManagerPayload(v *GetFeedsManagerFeedsManagerFeedsManagerPayload) ([]byte, error) { + + var typename string + switch v := (*v).(type) { + case *GetFeedsManagerFeedsManager: + typename = "FeedsManager" + + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalGetFeedsManagerFeedsManager + }{typename, premarshaled} + return json.Marshal(result) + case *GetFeedsManagerFeedsManagerNotFoundError: + typename = "NotFoundError" + + result := struct { + TypeName string `json:"__typename"` + *GetFeedsManagerFeedsManagerNotFoundError + }{typename, v} + return json.Marshal(result) + case nil: + return []byte("null"), nil + default: + return nil, fmt.Errorf( + `unexpected concrete type for GetFeedsManagerFeedsManagerFeedsManagerPayload: "%T"`, v) + } +} + +// GetFeedsManagerFeedsManagerNotFoundError includes the requested fields of the GraphQL type NotFoundError. +type GetFeedsManagerFeedsManagerNotFoundError struct { + Typename string `json:"__typename"` + Message string `json:"message"` + Code ErrorCode `json:"code"` +} + +// GetTypename returns GetFeedsManagerFeedsManagerNotFoundError.Typename, and is useful for accessing the field via an interface. +func (v *GetFeedsManagerFeedsManagerNotFoundError) GetTypename() string { return v.Typename } + +// GetMessage returns GetFeedsManagerFeedsManagerNotFoundError.Message, and is useful for accessing the field via an interface. +func (v *GetFeedsManagerFeedsManagerNotFoundError) GetMessage() string { return v.Message } + +// GetCode returns GetFeedsManagerFeedsManagerNotFoundError.Code, and is useful for accessing the field via an interface. +func (v *GetFeedsManagerFeedsManagerNotFoundError) GetCode() ErrorCode { return v.Code } + +// GetFeedsManagerResponse is returned by GetFeedsManager on success. +type GetFeedsManagerResponse struct { + FeedsManager GetFeedsManagerFeedsManagerFeedsManagerPayload `json:"-"` +} + +// GetFeedsManager returns GetFeedsManagerResponse.FeedsManager, and is useful for accessing the field via an interface. +func (v *GetFeedsManagerResponse) GetFeedsManager() GetFeedsManagerFeedsManagerFeedsManagerPayload { + return v.FeedsManager +} + +func (v *GetFeedsManagerResponse) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *GetFeedsManagerResponse + FeedsManager json.RawMessage `json:"feedsManager"` + graphql.NoUnmarshalJSON + } + firstPass.GetFeedsManagerResponse = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + { + dst := &v.FeedsManager + src := firstPass.FeedsManager + if len(src) != 0 && string(src) != "null" { + err = __unmarshalGetFeedsManagerFeedsManagerFeedsManagerPayload( + src, dst) + if err != nil { + return fmt.Errorf( + "unable to unmarshal GetFeedsManagerResponse.FeedsManager: %w", err) + } + } + } + return nil +} + +type __premarshalGetFeedsManagerResponse struct { + FeedsManager json.RawMessage `json:"feedsManager"` +} + +func (v *GetFeedsManagerResponse) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *GetFeedsManagerResponse) __premarshalJSON() (*__premarshalGetFeedsManagerResponse, error) { + var retval __premarshalGetFeedsManagerResponse + + { + + dst := &retval.FeedsManager + src := v.FeedsManager + var err error + *dst, err = __marshalGetFeedsManagerFeedsManagerFeedsManagerPayload( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal GetFeedsManagerResponse.FeedsManager: %w", err) + } + } + return &retval, nil +} + +// GetJobJob includes the requested fields of the GraphQL type Job. +type GetJobJob struct { + Typename string `json:"__typename"` + JobParts `json:"-"` +} + +// GetTypename returns GetJobJob.Typename, and is useful for accessing the field via an interface. +func (v *GetJobJob) GetTypename() string { return v.Typename } + +// GetId returns GetJobJob.Id, and is useful for accessing the field via an interface. +func (v *GetJobJob) GetId() string { return v.JobParts.Id } + +// GetName returns GetJobJob.Name, and is useful for accessing the field via an interface. +func (v *GetJobJob) GetName() string { return v.JobParts.Name } + +// GetSchemaVersion returns GetJobJob.SchemaVersion, and is useful for accessing the field via an interface. +func (v *GetJobJob) GetSchemaVersion() int { return v.JobParts.SchemaVersion } + +// GetGasLimit returns GetJobJob.GasLimit, and is useful for accessing the field via an interface. +func (v *GetJobJob) GetGasLimit() int { return v.JobParts.GasLimit } + +// GetForwardingAllowed returns GetJobJob.ForwardingAllowed, and is useful for accessing the field via an interface. +func (v *GetJobJob) GetForwardingAllowed() bool { return v.JobParts.ForwardingAllowed } + +// GetMaxTaskDuration returns GetJobJob.MaxTaskDuration, and is useful for accessing the field via an interface. +func (v *GetJobJob) GetMaxTaskDuration() string { return v.JobParts.MaxTaskDuration } + +// GetExternalJobID returns GetJobJob.ExternalJobID, and is useful for accessing the field via an interface. +func (v *GetJobJob) GetExternalJobID() string { return v.JobParts.ExternalJobID } + +// GetType returns GetJobJob.Type, and is useful for accessing the field via an interface. +func (v *GetJobJob) GetType() string { return v.JobParts.Type } + +// GetSpec returns GetJobJob.Spec, and is useful for accessing the field via an interface. +func (v *GetJobJob) GetSpec() JobPartsSpecJobSpec { return v.JobParts.Spec } + +// GetObservationSource returns GetJobJob.ObservationSource, and is useful for accessing the field via an interface. +func (v *GetJobJob) GetObservationSource() string { return v.JobParts.ObservationSource } + +// GetErrors returns GetJobJob.Errors, and is useful for accessing the field via an interface. +func (v *GetJobJob) GetErrors() []JobPartsErrorsJobError { return v.JobParts.Errors } + +func (v *GetJobJob) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *GetJobJob + graphql.NoUnmarshalJSON + } + firstPass.GetJobJob = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + err = json.Unmarshal( + b, &v.JobParts) + if err != nil { + return err + } + return nil +} + +type __premarshalGetJobJob struct { + Typename string `json:"__typename"` + + Id string `json:"id"` + + Name string `json:"name"` + + SchemaVersion int `json:"schemaVersion"` + + GasLimit int `json:"gasLimit"` + + ForwardingAllowed bool `json:"forwardingAllowed"` + + MaxTaskDuration string `json:"maxTaskDuration"` + + ExternalJobID string `json:"externalJobID"` + + Type string `json:"type"` + + Spec json.RawMessage `json:"spec"` + + ObservationSource string `json:"observationSource"` + + Errors []JobPartsErrorsJobError `json:"errors"` +} + +func (v *GetJobJob) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *GetJobJob) __premarshalJSON() (*__premarshalGetJobJob, error) { + var retval __premarshalGetJobJob + + retval.Typename = v.Typename + retval.Id = v.JobParts.Id + retval.Name = v.JobParts.Name + retval.SchemaVersion = v.JobParts.SchemaVersion + retval.GasLimit = v.JobParts.GasLimit + retval.ForwardingAllowed = v.JobParts.ForwardingAllowed + retval.MaxTaskDuration = v.JobParts.MaxTaskDuration + retval.ExternalJobID = v.JobParts.ExternalJobID + retval.Type = v.JobParts.Type + { + + dst := &retval.Spec + src := v.JobParts.Spec + var err error + *dst, err = __marshalJobPartsSpecJobSpec( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal GetJobJob.JobParts.Spec: %w", err) + } + } + retval.ObservationSource = v.JobParts.ObservationSource + retval.Errors = v.JobParts.Errors + return &retval, nil +} + +// GetJobJobJobPayload includes the requested fields of the GraphQL interface JobPayload. +// +// GetJobJobJobPayload is implemented by the following types: +// GetJobJob +// GetJobJobNotFoundError +type GetJobJobJobPayload interface { + implementsGraphQLInterfaceGetJobJobJobPayload() + // GetTypename returns the receiver's concrete GraphQL type-name (see interface doc for possible values). + GetTypename() string +} + +func (v *GetJobJob) implementsGraphQLInterfaceGetJobJobJobPayload() {} +func (v *GetJobJobNotFoundError) implementsGraphQLInterfaceGetJobJobJobPayload() {} + +func __unmarshalGetJobJobJobPayload(b []byte, v *GetJobJobJobPayload) error { + if string(b) == "null" { + return nil + } + + var tn struct { + TypeName string `json:"__typename"` + } + err := json.Unmarshal(b, &tn) + if err != nil { + return err + } + + switch tn.TypeName { + case "Job": + *v = new(GetJobJob) + return json.Unmarshal(b, *v) + case "NotFoundError": + *v = new(GetJobJobNotFoundError) + return json.Unmarshal(b, *v) + case "": + return fmt.Errorf( + "response was missing JobPayload.__typename") + default: + return fmt.Errorf( + `unexpected concrete type for GetJobJobJobPayload: "%v"`, tn.TypeName) + } +} + +func __marshalGetJobJobJobPayload(v *GetJobJobJobPayload) ([]byte, error) { + + var typename string + switch v := (*v).(type) { + case *GetJobJob: + typename = "Job" + + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalGetJobJob + }{typename, premarshaled} + return json.Marshal(result) + case *GetJobJobNotFoundError: + typename = "NotFoundError" + + result := struct { + TypeName string `json:"__typename"` + *GetJobJobNotFoundError + }{typename, v} + return json.Marshal(result) + case nil: + return []byte("null"), nil + default: + return nil, fmt.Errorf( + `unexpected concrete type for GetJobJobJobPayload: "%T"`, v) + } +} + +// GetJobJobNotFoundError includes the requested fields of the GraphQL type NotFoundError. +type GetJobJobNotFoundError struct { + Typename string `json:"__typename"` + Message string `json:"message"` + Code ErrorCode `json:"code"` +} + +// GetTypename returns GetJobJobNotFoundError.Typename, and is useful for accessing the field via an interface. +func (v *GetJobJobNotFoundError) GetTypename() string { return v.Typename } + +// GetMessage returns GetJobJobNotFoundError.Message, and is useful for accessing the field via an interface. +func (v *GetJobJobNotFoundError) GetMessage() string { return v.Message } + +// GetCode returns GetJobJobNotFoundError.Code, and is useful for accessing the field via an interface. +func (v *GetJobJobNotFoundError) GetCode() ErrorCode { return v.Code } + +// GetJobProposalJobProposal includes the requested fields of the GraphQL type JobProposal. +type GetJobProposalJobProposal struct { + Typename string `json:"__typename"` + Id string `json:"id"` + Name string `json:"name"` + Status JobProposalStatus `json:"status"` + RemoteUUID string `json:"remoteUUID"` + ExternalJobID string `json:"externalJobID"` + JobID string `json:"jobID"` + FeedsManager GetJobProposalJobProposalFeedsManager `json:"feedsManager"` + MultiAddrs []string `json:"multiAddrs"` + PendingUpdate bool `json:"pendingUpdate"` + Specs []GetJobProposalJobProposalSpecsJobProposalSpec `json:"specs"` + LatestSpec GetJobProposalJobProposalLatestSpecJobProposalSpec `json:"latestSpec"` +} + +// GetTypename returns GetJobProposalJobProposal.Typename, and is useful for accessing the field via an interface. +func (v *GetJobProposalJobProposal) GetTypename() string { return v.Typename } + +// GetId returns GetJobProposalJobProposal.Id, and is useful for accessing the field via an interface. +func (v *GetJobProposalJobProposal) GetId() string { return v.Id } + +// GetName returns GetJobProposalJobProposal.Name, and is useful for accessing the field via an interface. +func (v *GetJobProposalJobProposal) GetName() string { return v.Name } + +// GetStatus returns GetJobProposalJobProposal.Status, and is useful for accessing the field via an interface. +func (v *GetJobProposalJobProposal) GetStatus() JobProposalStatus { return v.Status } + +// GetRemoteUUID returns GetJobProposalJobProposal.RemoteUUID, and is useful for accessing the field via an interface. +func (v *GetJobProposalJobProposal) GetRemoteUUID() string { return v.RemoteUUID } + +// GetExternalJobID returns GetJobProposalJobProposal.ExternalJobID, and is useful for accessing the field via an interface. +func (v *GetJobProposalJobProposal) GetExternalJobID() string { return v.ExternalJobID } + +// GetJobID returns GetJobProposalJobProposal.JobID, and is useful for accessing the field via an interface. +func (v *GetJobProposalJobProposal) GetJobID() string { return v.JobID } + +// GetFeedsManager returns GetJobProposalJobProposal.FeedsManager, and is useful for accessing the field via an interface. +func (v *GetJobProposalJobProposal) GetFeedsManager() GetJobProposalJobProposalFeedsManager { + return v.FeedsManager +} + +// GetMultiAddrs returns GetJobProposalJobProposal.MultiAddrs, and is useful for accessing the field via an interface. +func (v *GetJobProposalJobProposal) GetMultiAddrs() []string { return v.MultiAddrs } + +// GetPendingUpdate returns GetJobProposalJobProposal.PendingUpdate, and is useful for accessing the field via an interface. +func (v *GetJobProposalJobProposal) GetPendingUpdate() bool { return v.PendingUpdate } + +// GetSpecs returns GetJobProposalJobProposal.Specs, and is useful for accessing the field via an interface. +func (v *GetJobProposalJobProposal) GetSpecs() []GetJobProposalJobProposalSpecsJobProposalSpec { + return v.Specs +} + +// GetLatestSpec returns GetJobProposalJobProposal.LatestSpec, and is useful for accessing the field via an interface. +func (v *GetJobProposalJobProposal) GetLatestSpec() GetJobProposalJobProposalLatestSpecJobProposalSpec { + return v.LatestSpec +} + +// GetJobProposalJobProposalFeedsManager includes the requested fields of the GraphQL type FeedsManager. +type GetJobProposalJobProposalFeedsManager struct { + FeedsManagerParts `json:"-"` +} + +// GetId returns GetJobProposalJobProposalFeedsManager.Id, and is useful for accessing the field via an interface. +func (v *GetJobProposalJobProposalFeedsManager) GetId() string { return v.FeedsManagerParts.Id } + +// GetName returns GetJobProposalJobProposalFeedsManager.Name, and is useful for accessing the field via an interface. +func (v *GetJobProposalJobProposalFeedsManager) GetName() string { return v.FeedsManagerParts.Name } + +// GetUri returns GetJobProposalJobProposalFeedsManager.Uri, and is useful for accessing the field via an interface. +func (v *GetJobProposalJobProposalFeedsManager) GetUri() string { return v.FeedsManagerParts.Uri } + +// GetPublicKey returns GetJobProposalJobProposalFeedsManager.PublicKey, and is useful for accessing the field via an interface. +func (v *GetJobProposalJobProposalFeedsManager) GetPublicKey() string { + return v.FeedsManagerParts.PublicKey +} + +// GetIsConnectionActive returns GetJobProposalJobProposalFeedsManager.IsConnectionActive, and is useful for accessing the field via an interface. +func (v *GetJobProposalJobProposalFeedsManager) GetIsConnectionActive() bool { + return v.FeedsManagerParts.IsConnectionActive +} + +// GetCreatedAt returns GetJobProposalJobProposalFeedsManager.CreatedAt, and is useful for accessing the field via an interface. +func (v *GetJobProposalJobProposalFeedsManager) GetCreatedAt() string { + return v.FeedsManagerParts.CreatedAt +} + +func (v *GetJobProposalJobProposalFeedsManager) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *GetJobProposalJobProposalFeedsManager + graphql.NoUnmarshalJSON + } + firstPass.GetJobProposalJobProposalFeedsManager = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + err = json.Unmarshal( + b, &v.FeedsManagerParts) + if err != nil { + return err + } + return nil +} + +type __premarshalGetJobProposalJobProposalFeedsManager struct { + Id string `json:"id"` + + Name string `json:"name"` + + Uri string `json:"uri"` + + PublicKey string `json:"publicKey"` + + IsConnectionActive bool `json:"isConnectionActive"` + + CreatedAt string `json:"createdAt"` +} + +func (v *GetJobProposalJobProposalFeedsManager) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *GetJobProposalJobProposalFeedsManager) __premarshalJSON() (*__premarshalGetJobProposalJobProposalFeedsManager, error) { + var retval __premarshalGetJobProposalJobProposalFeedsManager + + retval.Id = v.FeedsManagerParts.Id + retval.Name = v.FeedsManagerParts.Name + retval.Uri = v.FeedsManagerParts.Uri + retval.PublicKey = v.FeedsManagerParts.PublicKey + retval.IsConnectionActive = v.FeedsManagerParts.IsConnectionActive + retval.CreatedAt = v.FeedsManagerParts.CreatedAt + return &retval, nil +} + +// GetJobProposalJobProposalJobProposalPayload includes the requested fields of the GraphQL interface JobProposalPayload. +// +// GetJobProposalJobProposalJobProposalPayload is implemented by the following types: +// GetJobProposalJobProposal +// GetJobProposalJobProposalNotFoundError +type GetJobProposalJobProposalJobProposalPayload interface { + implementsGraphQLInterfaceGetJobProposalJobProposalJobProposalPayload() + // GetTypename returns the receiver's concrete GraphQL type-name (see interface doc for possible values). + GetTypename() string +} + +func (v *GetJobProposalJobProposal) implementsGraphQLInterfaceGetJobProposalJobProposalJobProposalPayload() { +} +func (v *GetJobProposalJobProposalNotFoundError) implementsGraphQLInterfaceGetJobProposalJobProposalJobProposalPayload() { +} + +func __unmarshalGetJobProposalJobProposalJobProposalPayload(b []byte, v *GetJobProposalJobProposalJobProposalPayload) error { + if string(b) == "null" { + return nil + } + + var tn struct { + TypeName string `json:"__typename"` + } + err := json.Unmarshal(b, &tn) + if err != nil { + return err + } + + switch tn.TypeName { + case "JobProposal": + *v = new(GetJobProposalJobProposal) + return json.Unmarshal(b, *v) + case "NotFoundError": + *v = new(GetJobProposalJobProposalNotFoundError) + return json.Unmarshal(b, *v) + case "": + return fmt.Errorf( + "response was missing JobProposalPayload.__typename") + default: + return fmt.Errorf( + `unexpected concrete type for GetJobProposalJobProposalJobProposalPayload: "%v"`, tn.TypeName) + } +} + +func __marshalGetJobProposalJobProposalJobProposalPayload(v *GetJobProposalJobProposalJobProposalPayload) ([]byte, error) { + + var typename string + switch v := (*v).(type) { + case *GetJobProposalJobProposal: + typename = "JobProposal" + + result := struct { + TypeName string `json:"__typename"` + *GetJobProposalJobProposal + }{typename, v} + return json.Marshal(result) + case *GetJobProposalJobProposalNotFoundError: + typename = "NotFoundError" + + result := struct { + TypeName string `json:"__typename"` + *GetJobProposalJobProposalNotFoundError + }{typename, v} + return json.Marshal(result) + case nil: + return []byte("null"), nil + default: + return nil, fmt.Errorf( + `unexpected concrete type for GetJobProposalJobProposalJobProposalPayload: "%T"`, v) + } +} + +// GetJobProposalJobProposalLatestSpecJobProposalSpec includes the requested fields of the GraphQL type JobProposalSpec. +type GetJobProposalJobProposalLatestSpecJobProposalSpec struct { + Id string `json:"id"` + Definition string `json:"definition"` + Version int `json:"version"` + Status SpecStatus `json:"status"` + StatusUpdatedAt string `json:"statusUpdatedAt"` + CreatedAt string `json:"createdAt"` + UpdatedAt string `json:"updatedAt"` +} + +// GetId returns GetJobProposalJobProposalLatestSpecJobProposalSpec.Id, and is useful for accessing the field via an interface. +func (v *GetJobProposalJobProposalLatestSpecJobProposalSpec) GetId() string { return v.Id } + +// GetDefinition returns GetJobProposalJobProposalLatestSpecJobProposalSpec.Definition, and is useful for accessing the field via an interface. +func (v *GetJobProposalJobProposalLatestSpecJobProposalSpec) GetDefinition() string { + return v.Definition +} + +// GetVersion returns GetJobProposalJobProposalLatestSpecJobProposalSpec.Version, and is useful for accessing the field via an interface. +func (v *GetJobProposalJobProposalLatestSpecJobProposalSpec) GetVersion() int { return v.Version } + +// GetStatus returns GetJobProposalJobProposalLatestSpecJobProposalSpec.Status, and is useful for accessing the field via an interface. +func (v *GetJobProposalJobProposalLatestSpecJobProposalSpec) GetStatus() SpecStatus { return v.Status } + +// GetStatusUpdatedAt returns GetJobProposalJobProposalLatestSpecJobProposalSpec.StatusUpdatedAt, and is useful for accessing the field via an interface. +func (v *GetJobProposalJobProposalLatestSpecJobProposalSpec) GetStatusUpdatedAt() string { + return v.StatusUpdatedAt +} + +// GetCreatedAt returns GetJobProposalJobProposalLatestSpecJobProposalSpec.CreatedAt, and is useful for accessing the field via an interface. +func (v *GetJobProposalJobProposalLatestSpecJobProposalSpec) GetCreatedAt() string { + return v.CreatedAt +} + +// GetUpdatedAt returns GetJobProposalJobProposalLatestSpecJobProposalSpec.UpdatedAt, and is useful for accessing the field via an interface. +func (v *GetJobProposalJobProposalLatestSpecJobProposalSpec) GetUpdatedAt() string { + return v.UpdatedAt +} + +// GetJobProposalJobProposalNotFoundError includes the requested fields of the GraphQL type NotFoundError. +type GetJobProposalJobProposalNotFoundError struct { + Typename string `json:"__typename"` + Message string `json:"message"` + Code ErrorCode `json:"code"` +} + +// GetTypename returns GetJobProposalJobProposalNotFoundError.Typename, and is useful for accessing the field via an interface. +func (v *GetJobProposalJobProposalNotFoundError) GetTypename() string { return v.Typename } + +// GetMessage returns GetJobProposalJobProposalNotFoundError.Message, and is useful for accessing the field via an interface. +func (v *GetJobProposalJobProposalNotFoundError) GetMessage() string { return v.Message } + +// GetCode returns GetJobProposalJobProposalNotFoundError.Code, and is useful for accessing the field via an interface. +func (v *GetJobProposalJobProposalNotFoundError) GetCode() ErrorCode { return v.Code } + +// GetJobProposalJobProposalSpecsJobProposalSpec includes the requested fields of the GraphQL type JobProposalSpec. +type GetJobProposalJobProposalSpecsJobProposalSpec struct { + Id string `json:"id"` + Definition string `json:"definition"` + Version int `json:"version"` + Status SpecStatus `json:"status"` + StatusUpdatedAt string `json:"statusUpdatedAt"` + CreatedAt string `json:"createdAt"` + UpdatedAt string `json:"updatedAt"` +} + +// GetId returns GetJobProposalJobProposalSpecsJobProposalSpec.Id, and is useful for accessing the field via an interface. +func (v *GetJobProposalJobProposalSpecsJobProposalSpec) GetId() string { return v.Id } + +// GetDefinition returns GetJobProposalJobProposalSpecsJobProposalSpec.Definition, and is useful for accessing the field via an interface. +func (v *GetJobProposalJobProposalSpecsJobProposalSpec) GetDefinition() string { return v.Definition } + +// GetVersion returns GetJobProposalJobProposalSpecsJobProposalSpec.Version, and is useful for accessing the field via an interface. +func (v *GetJobProposalJobProposalSpecsJobProposalSpec) GetVersion() int { return v.Version } + +// GetStatus returns GetJobProposalJobProposalSpecsJobProposalSpec.Status, and is useful for accessing the field via an interface. +func (v *GetJobProposalJobProposalSpecsJobProposalSpec) GetStatus() SpecStatus { return v.Status } + +// GetStatusUpdatedAt returns GetJobProposalJobProposalSpecsJobProposalSpec.StatusUpdatedAt, and is useful for accessing the field via an interface. +func (v *GetJobProposalJobProposalSpecsJobProposalSpec) GetStatusUpdatedAt() string { + return v.StatusUpdatedAt +} + +// GetCreatedAt returns GetJobProposalJobProposalSpecsJobProposalSpec.CreatedAt, and is useful for accessing the field via an interface. +func (v *GetJobProposalJobProposalSpecsJobProposalSpec) GetCreatedAt() string { return v.CreatedAt } + +// GetUpdatedAt returns GetJobProposalJobProposalSpecsJobProposalSpec.UpdatedAt, and is useful for accessing the field via an interface. +func (v *GetJobProposalJobProposalSpecsJobProposalSpec) GetUpdatedAt() string { return v.UpdatedAt } + +// GetJobProposalResponse is returned by GetJobProposal on success. +type GetJobProposalResponse struct { + JobProposal GetJobProposalJobProposalJobProposalPayload `json:"-"` +} + +// GetJobProposal returns GetJobProposalResponse.JobProposal, and is useful for accessing the field via an interface. +func (v *GetJobProposalResponse) GetJobProposal() GetJobProposalJobProposalJobProposalPayload { + return v.JobProposal +} + +func (v *GetJobProposalResponse) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *GetJobProposalResponse + JobProposal json.RawMessage `json:"jobProposal"` + graphql.NoUnmarshalJSON + } + firstPass.GetJobProposalResponse = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + { + dst := &v.JobProposal + src := firstPass.JobProposal + if len(src) != 0 && string(src) != "null" { + err = __unmarshalGetJobProposalJobProposalJobProposalPayload( + src, dst) + if err != nil { + return fmt.Errorf( + "unable to unmarshal GetJobProposalResponse.JobProposal: %w", err) + } + } + } + return nil +} + +type __premarshalGetJobProposalResponse struct { + JobProposal json.RawMessage `json:"jobProposal"` +} + +func (v *GetJobProposalResponse) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *GetJobProposalResponse) __premarshalJSON() (*__premarshalGetJobProposalResponse, error) { + var retval __premarshalGetJobProposalResponse + + { + + dst := &retval.JobProposal + src := v.JobProposal + var err error + *dst, err = __marshalGetJobProposalJobProposalJobProposalPayload( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal GetJobProposalResponse.JobProposal: %w", err) + } + } + return &retval, nil +} + +// GetJobResponse is returned by GetJob on success. +type GetJobResponse struct { + Job GetJobJobJobPayload `json:"-"` +} + +// GetJob returns GetJobResponse.Job, and is useful for accessing the field via an interface. +func (v *GetJobResponse) GetJob() GetJobJobJobPayload { return v.Job } + +func (v *GetJobResponse) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *GetJobResponse + Job json.RawMessage `json:"job"` + graphql.NoUnmarshalJSON + } + firstPass.GetJobResponse = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + { + dst := &v.Job + src := firstPass.Job + if len(src) != 0 && string(src) != "null" { + err = __unmarshalGetJobJobJobPayload( + src, dst) + if err != nil { + return fmt.Errorf( + "unable to unmarshal GetJobResponse.Job: %w", err) + } + } + } + return nil +} + +type __premarshalGetJobResponse struct { + Job json.RawMessage `json:"job"` +} + +func (v *GetJobResponse) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *GetJobResponse) __premarshalJSON() (*__premarshalGetJobResponse, error) { + var retval __premarshalGetJobResponse + + { + + dst := &retval.Job + src := v.Job + var err error + *dst, err = __marshalGetJobJobJobPayload( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal GetJobResponse.Job: %w", err) + } + } + return &retval, nil +} + +// JobParts includes the GraphQL fields of Job requested by the fragment JobParts. +type JobParts struct { + Id string `json:"id"` + Name string `json:"name"` + SchemaVersion int `json:"schemaVersion"` + GasLimit int `json:"gasLimit"` + ForwardingAllowed bool `json:"forwardingAllowed"` + MaxTaskDuration string `json:"maxTaskDuration"` + ExternalJobID string `json:"externalJobID"` + Type string `json:"type"` + Spec JobPartsSpecJobSpec `json:"-"` + ObservationSource string `json:"observationSource"` + Errors []JobPartsErrorsJobError `json:"errors"` +} + +// GetId returns JobParts.Id, and is useful for accessing the field via an interface. +func (v *JobParts) GetId() string { return v.Id } + +// GetName returns JobParts.Name, and is useful for accessing the field via an interface. +func (v *JobParts) GetName() string { return v.Name } + +// GetSchemaVersion returns JobParts.SchemaVersion, and is useful for accessing the field via an interface. +func (v *JobParts) GetSchemaVersion() int { return v.SchemaVersion } + +// GetGasLimit returns JobParts.GasLimit, and is useful for accessing the field via an interface. +func (v *JobParts) GetGasLimit() int { return v.GasLimit } + +// GetForwardingAllowed returns JobParts.ForwardingAllowed, and is useful for accessing the field via an interface. +func (v *JobParts) GetForwardingAllowed() bool { return v.ForwardingAllowed } + +// GetMaxTaskDuration returns JobParts.MaxTaskDuration, and is useful for accessing the field via an interface. +func (v *JobParts) GetMaxTaskDuration() string { return v.MaxTaskDuration } + +// GetExternalJobID returns JobParts.ExternalJobID, and is useful for accessing the field via an interface. +func (v *JobParts) GetExternalJobID() string { return v.ExternalJobID } + +// GetType returns JobParts.Type, and is useful for accessing the field via an interface. +func (v *JobParts) GetType() string { return v.Type } + +// GetSpec returns JobParts.Spec, and is useful for accessing the field via an interface. +func (v *JobParts) GetSpec() JobPartsSpecJobSpec { return v.Spec } + +// GetObservationSource returns JobParts.ObservationSource, and is useful for accessing the field via an interface. +func (v *JobParts) GetObservationSource() string { return v.ObservationSource } + +// GetErrors returns JobParts.Errors, and is useful for accessing the field via an interface. +func (v *JobParts) GetErrors() []JobPartsErrorsJobError { return v.Errors } + +func (v *JobParts) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *JobParts + Spec json.RawMessage `json:"spec"` + graphql.NoUnmarshalJSON + } + firstPass.JobParts = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + { + dst := &v.Spec + src := firstPass.Spec + if len(src) != 0 && string(src) != "null" { + err = __unmarshalJobPartsSpecJobSpec( + src, dst) + if err != nil { + return fmt.Errorf( + "unable to unmarshal JobParts.Spec: %w", err) + } + } + } + return nil +} + +type __premarshalJobParts struct { + Id string `json:"id"` + + Name string `json:"name"` + + SchemaVersion int `json:"schemaVersion"` + + GasLimit int `json:"gasLimit"` + + ForwardingAllowed bool `json:"forwardingAllowed"` + + MaxTaskDuration string `json:"maxTaskDuration"` + + ExternalJobID string `json:"externalJobID"` + + Type string `json:"type"` + + Spec json.RawMessage `json:"spec"` + + ObservationSource string `json:"observationSource"` + + Errors []JobPartsErrorsJobError `json:"errors"` +} + +func (v *JobParts) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *JobParts) __premarshalJSON() (*__premarshalJobParts, error) { + var retval __premarshalJobParts + + retval.Id = v.Id + retval.Name = v.Name + retval.SchemaVersion = v.SchemaVersion + retval.GasLimit = v.GasLimit + retval.ForwardingAllowed = v.ForwardingAllowed + retval.MaxTaskDuration = v.MaxTaskDuration + retval.ExternalJobID = v.ExternalJobID + retval.Type = v.Type + { + + dst := &retval.Spec + src := v.Spec + var err error + *dst, err = __marshalJobPartsSpecJobSpec( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal JobParts.Spec: %w", err) + } + } + retval.ObservationSource = v.ObservationSource + retval.Errors = v.Errors + return &retval, nil +} + +// JobPartsErrorsJobError includes the requested fields of the GraphQL type JobError. +type JobPartsErrorsJobError struct { + Id string `json:"id"` + Description string `json:"description"` + Occurrences int `json:"occurrences"` + CreatedAt string `json:"createdAt"` + UpdatedAt string `json:"updatedAt"` +} + +// GetId returns JobPartsErrorsJobError.Id, and is useful for accessing the field via an interface. +func (v *JobPartsErrorsJobError) GetId() string { return v.Id } + +// GetDescription returns JobPartsErrorsJobError.Description, and is useful for accessing the field via an interface. +func (v *JobPartsErrorsJobError) GetDescription() string { return v.Description } + +// GetOccurrences returns JobPartsErrorsJobError.Occurrences, and is useful for accessing the field via an interface. +func (v *JobPartsErrorsJobError) GetOccurrences() int { return v.Occurrences } + +// GetCreatedAt returns JobPartsErrorsJobError.CreatedAt, and is useful for accessing the field via an interface. +func (v *JobPartsErrorsJobError) GetCreatedAt() string { return v.CreatedAt } + +// GetUpdatedAt returns JobPartsErrorsJobError.UpdatedAt, and is useful for accessing the field via an interface. +func (v *JobPartsErrorsJobError) GetUpdatedAt() string { return v.UpdatedAt } + +// JobPartsSpecBlockHeaderFeederSpec includes the requested fields of the GraphQL type BlockHeaderFeederSpec. +type JobPartsSpecBlockHeaderFeederSpec struct { + Typename string `json:"__typename"` +} + +// GetTypename returns JobPartsSpecBlockHeaderFeederSpec.Typename, and is useful for accessing the field via an interface. +func (v *JobPartsSpecBlockHeaderFeederSpec) GetTypename() string { return v.Typename } + +// JobPartsSpecBlockhashStoreSpec includes the requested fields of the GraphQL type BlockhashStoreSpec. +type JobPartsSpecBlockhashStoreSpec struct { + Typename string `json:"__typename"` +} + +// GetTypename returns JobPartsSpecBlockhashStoreSpec.Typename, and is useful for accessing the field via an interface. +func (v *JobPartsSpecBlockhashStoreSpec) GetTypename() string { return v.Typename } + +// JobPartsSpecBootstrapSpec includes the requested fields of the GraphQL type BootstrapSpec. +type JobPartsSpecBootstrapSpec struct { + Typename string `json:"__typename"` +} + +// GetTypename returns JobPartsSpecBootstrapSpec.Typename, and is useful for accessing the field via an interface. +func (v *JobPartsSpecBootstrapSpec) GetTypename() string { return v.Typename } + +// JobPartsSpecCronSpec includes the requested fields of the GraphQL type CronSpec. +type JobPartsSpecCronSpec struct { + Typename string `json:"__typename"` +} + +// GetTypename returns JobPartsSpecCronSpec.Typename, and is useful for accessing the field via an interface. +func (v *JobPartsSpecCronSpec) GetTypename() string { return v.Typename } + +// JobPartsSpecDirectRequestSpec includes the requested fields of the GraphQL type DirectRequestSpec. +type JobPartsSpecDirectRequestSpec struct { + Typename string `json:"__typename"` +} + +// GetTypename returns JobPartsSpecDirectRequestSpec.Typename, and is useful for accessing the field via an interface. +func (v *JobPartsSpecDirectRequestSpec) GetTypename() string { return v.Typename } + +// JobPartsSpecFluxMonitorSpec includes the requested fields of the GraphQL type FluxMonitorSpec. +type JobPartsSpecFluxMonitorSpec struct { + Typename string `json:"__typename"` +} + +// GetTypename returns JobPartsSpecFluxMonitorSpec.Typename, and is useful for accessing the field via an interface. +func (v *JobPartsSpecFluxMonitorSpec) GetTypename() string { return v.Typename } + +// JobPartsSpecGatewaySpec includes the requested fields of the GraphQL type GatewaySpec. +type JobPartsSpecGatewaySpec struct { + Typename string `json:"__typename"` +} + +// GetTypename returns JobPartsSpecGatewaySpec.Typename, and is useful for accessing the field via an interface. +func (v *JobPartsSpecGatewaySpec) GetTypename() string { return v.Typename } + +// JobPartsSpecJobSpec includes the requested fields of the GraphQL interface JobSpec. +// +// JobPartsSpecJobSpec is implemented by the following types: +// JobPartsSpecBlockHeaderFeederSpec +// JobPartsSpecBlockhashStoreSpec +// JobPartsSpecBootstrapSpec +// JobPartsSpecCronSpec +// JobPartsSpecDirectRequestSpec +// JobPartsSpecFluxMonitorSpec +// JobPartsSpecGatewaySpec +// JobPartsSpecKeeperSpec +// JobPartsSpecOCR2Spec +// JobPartsSpecOCRSpec +// JobPartsSpecStandardCapabilitiesSpec +// JobPartsSpecVRFSpec +// JobPartsSpecWebhookSpec +// JobPartsSpecWorkflowSpec +type JobPartsSpecJobSpec interface { + implementsGraphQLInterfaceJobPartsSpecJobSpec() + // GetTypename returns the receiver's concrete GraphQL type-name (see interface doc for possible values). + GetTypename() string +} + +func (v *JobPartsSpecBlockHeaderFeederSpec) implementsGraphQLInterfaceJobPartsSpecJobSpec() {} +func (v *JobPartsSpecBlockhashStoreSpec) implementsGraphQLInterfaceJobPartsSpecJobSpec() {} +func (v *JobPartsSpecBootstrapSpec) implementsGraphQLInterfaceJobPartsSpecJobSpec() {} +func (v *JobPartsSpecCronSpec) implementsGraphQLInterfaceJobPartsSpecJobSpec() {} +func (v *JobPartsSpecDirectRequestSpec) implementsGraphQLInterfaceJobPartsSpecJobSpec() {} +func (v *JobPartsSpecFluxMonitorSpec) implementsGraphQLInterfaceJobPartsSpecJobSpec() {} +func (v *JobPartsSpecGatewaySpec) implementsGraphQLInterfaceJobPartsSpecJobSpec() {} +func (v *JobPartsSpecKeeperSpec) implementsGraphQLInterfaceJobPartsSpecJobSpec() {} +func (v *JobPartsSpecOCR2Spec) implementsGraphQLInterfaceJobPartsSpecJobSpec() {} +func (v *JobPartsSpecOCRSpec) implementsGraphQLInterfaceJobPartsSpecJobSpec() {} +func (v *JobPartsSpecStandardCapabilitiesSpec) implementsGraphQLInterfaceJobPartsSpecJobSpec() {} +func (v *JobPartsSpecVRFSpec) implementsGraphQLInterfaceJobPartsSpecJobSpec() {} +func (v *JobPartsSpecWebhookSpec) implementsGraphQLInterfaceJobPartsSpecJobSpec() {} +func (v *JobPartsSpecWorkflowSpec) implementsGraphQLInterfaceJobPartsSpecJobSpec() {} + +func __unmarshalJobPartsSpecJobSpec(b []byte, v *JobPartsSpecJobSpec) error { + if string(b) == "null" { + return nil + } + + var tn struct { + TypeName string `json:"__typename"` + } + err := json.Unmarshal(b, &tn) + if err != nil { + return err + } + + switch tn.TypeName { + case "BlockHeaderFeederSpec": + *v = new(JobPartsSpecBlockHeaderFeederSpec) + return json.Unmarshal(b, *v) + case "BlockhashStoreSpec": + *v = new(JobPartsSpecBlockhashStoreSpec) + return json.Unmarshal(b, *v) + case "BootstrapSpec": + *v = new(JobPartsSpecBootstrapSpec) + return json.Unmarshal(b, *v) + case "CronSpec": + *v = new(JobPartsSpecCronSpec) + return json.Unmarshal(b, *v) + case "DirectRequestSpec": + *v = new(JobPartsSpecDirectRequestSpec) + return json.Unmarshal(b, *v) + case "FluxMonitorSpec": + *v = new(JobPartsSpecFluxMonitorSpec) + return json.Unmarshal(b, *v) + case "GatewaySpec": + *v = new(JobPartsSpecGatewaySpec) + return json.Unmarshal(b, *v) + case "KeeperSpec": + *v = new(JobPartsSpecKeeperSpec) + return json.Unmarshal(b, *v) + case "OCR2Spec": + *v = new(JobPartsSpecOCR2Spec) + return json.Unmarshal(b, *v) + case "OCRSpec": + *v = new(JobPartsSpecOCRSpec) + return json.Unmarshal(b, *v) + case "StandardCapabilitiesSpec": + *v = new(JobPartsSpecStandardCapabilitiesSpec) + return json.Unmarshal(b, *v) + case "VRFSpec": + *v = new(JobPartsSpecVRFSpec) + return json.Unmarshal(b, *v) + case "WebhookSpec": + *v = new(JobPartsSpecWebhookSpec) + return json.Unmarshal(b, *v) + case "WorkflowSpec": + *v = new(JobPartsSpecWorkflowSpec) + return json.Unmarshal(b, *v) + case "": + return fmt.Errorf( + "response was missing JobSpec.__typename") + default: + return fmt.Errorf( + `unexpected concrete type for JobPartsSpecJobSpec: "%v"`, tn.TypeName) + } +} + +func __marshalJobPartsSpecJobSpec(v *JobPartsSpecJobSpec) ([]byte, error) { + + var typename string + switch v := (*v).(type) { + case *JobPartsSpecBlockHeaderFeederSpec: + typename = "BlockHeaderFeederSpec" + + result := struct { + TypeName string `json:"__typename"` + *JobPartsSpecBlockHeaderFeederSpec + }{typename, v} + return json.Marshal(result) + case *JobPartsSpecBlockhashStoreSpec: + typename = "BlockhashStoreSpec" + + result := struct { + TypeName string `json:"__typename"` + *JobPartsSpecBlockhashStoreSpec + }{typename, v} + return json.Marshal(result) + case *JobPartsSpecBootstrapSpec: + typename = "BootstrapSpec" + + result := struct { + TypeName string `json:"__typename"` + *JobPartsSpecBootstrapSpec + }{typename, v} + return json.Marshal(result) + case *JobPartsSpecCronSpec: + typename = "CronSpec" + + result := struct { + TypeName string `json:"__typename"` + *JobPartsSpecCronSpec + }{typename, v} + return json.Marshal(result) + case *JobPartsSpecDirectRequestSpec: + typename = "DirectRequestSpec" + + result := struct { + TypeName string `json:"__typename"` + *JobPartsSpecDirectRequestSpec + }{typename, v} + return json.Marshal(result) + case *JobPartsSpecFluxMonitorSpec: + typename = "FluxMonitorSpec" + + result := struct { + TypeName string `json:"__typename"` + *JobPartsSpecFluxMonitorSpec + }{typename, v} + return json.Marshal(result) + case *JobPartsSpecGatewaySpec: + typename = "GatewaySpec" + + result := struct { + TypeName string `json:"__typename"` + *JobPartsSpecGatewaySpec + }{typename, v} + return json.Marshal(result) + case *JobPartsSpecKeeperSpec: + typename = "KeeperSpec" + + result := struct { + TypeName string `json:"__typename"` + *JobPartsSpecKeeperSpec + }{typename, v} + return json.Marshal(result) + case *JobPartsSpecOCR2Spec: + typename = "OCR2Spec" + + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalJobPartsSpecOCR2Spec + }{typename, premarshaled} + return json.Marshal(result) + case *JobPartsSpecOCRSpec: + typename = "OCRSpec" + + result := struct { + TypeName string `json:"__typename"` + *JobPartsSpecOCRSpec + }{typename, v} + return json.Marshal(result) + case *JobPartsSpecStandardCapabilitiesSpec: + typename = "StandardCapabilitiesSpec" + + result := struct { + TypeName string `json:"__typename"` + *JobPartsSpecStandardCapabilitiesSpec + }{typename, v} + return json.Marshal(result) + case *JobPartsSpecVRFSpec: + typename = "VRFSpec" + + result := struct { + TypeName string `json:"__typename"` + *JobPartsSpecVRFSpec + }{typename, v} + return json.Marshal(result) + case *JobPartsSpecWebhookSpec: + typename = "WebhookSpec" + + result := struct { + TypeName string `json:"__typename"` + *JobPartsSpecWebhookSpec + }{typename, v} + return json.Marshal(result) + case *JobPartsSpecWorkflowSpec: + typename = "WorkflowSpec" + + result := struct { + TypeName string `json:"__typename"` + *JobPartsSpecWorkflowSpec + }{typename, v} + return json.Marshal(result) + case nil: + return []byte("null"), nil + default: + return nil, fmt.Errorf( + `unexpected concrete type for JobPartsSpecJobSpec: "%T"`, v) + } +} + +// JobPartsSpecKeeperSpec includes the requested fields of the GraphQL type KeeperSpec. +type JobPartsSpecKeeperSpec struct { + Typename string `json:"__typename"` +} + +// GetTypename returns JobPartsSpecKeeperSpec.Typename, and is useful for accessing the field via an interface. +func (v *JobPartsSpecKeeperSpec) GetTypename() string { return v.Typename } + +// JobPartsSpecOCR2Spec includes the requested fields of the GraphQL type OCR2Spec. +type JobPartsSpecOCR2Spec struct { + Typename string `json:"__typename"` + OCR2Spec `json:"-"` +} + +// GetTypename returns JobPartsSpecOCR2Spec.Typename, and is useful for accessing the field via an interface. +func (v *JobPartsSpecOCR2Spec) GetTypename() string { return v.Typename } + +// GetBlockchainTimeout returns JobPartsSpecOCR2Spec.BlockchainTimeout, and is useful for accessing the field via an interface. +func (v *JobPartsSpecOCR2Spec) GetBlockchainTimeout() string { return v.OCR2Spec.BlockchainTimeout } + +// GetContractID returns JobPartsSpecOCR2Spec.ContractID, and is useful for accessing the field via an interface. +func (v *JobPartsSpecOCR2Spec) GetContractID() string { return v.OCR2Spec.ContractID } + +// GetContractConfigConfirmations returns JobPartsSpecOCR2Spec.ContractConfigConfirmations, and is useful for accessing the field via an interface. +func (v *JobPartsSpecOCR2Spec) GetContractConfigConfirmations() int { + return v.OCR2Spec.ContractConfigConfirmations +} + +// GetContractConfigTrackerPollInterval returns JobPartsSpecOCR2Spec.ContractConfigTrackerPollInterval, and is useful for accessing the field via an interface. +func (v *JobPartsSpecOCR2Spec) GetContractConfigTrackerPollInterval() string { + return v.OCR2Spec.ContractConfigTrackerPollInterval +} + +// GetCreatedAt returns JobPartsSpecOCR2Spec.CreatedAt, and is useful for accessing the field via an interface. +func (v *JobPartsSpecOCR2Spec) GetCreatedAt() string { return v.OCR2Spec.CreatedAt } + +// GetOcrKeyBundleID returns JobPartsSpecOCR2Spec.OcrKeyBundleID, and is useful for accessing the field via an interface. +func (v *JobPartsSpecOCR2Spec) GetOcrKeyBundleID() string { return v.OCR2Spec.OcrKeyBundleID } + +// GetMonitoringEndpoint returns JobPartsSpecOCR2Spec.MonitoringEndpoint, and is useful for accessing the field via an interface. +func (v *JobPartsSpecOCR2Spec) GetMonitoringEndpoint() string { return v.OCR2Spec.MonitoringEndpoint } + +// GetP2pv2Bootstrappers returns JobPartsSpecOCR2Spec.P2pv2Bootstrappers, and is useful for accessing the field via an interface. +func (v *JobPartsSpecOCR2Spec) GetP2pv2Bootstrappers() []string { return v.OCR2Spec.P2pv2Bootstrappers } + +// GetRelay returns JobPartsSpecOCR2Spec.Relay, and is useful for accessing the field via an interface. +func (v *JobPartsSpecOCR2Spec) GetRelay() string { return v.OCR2Spec.Relay } + +// GetRelayConfig returns JobPartsSpecOCR2Spec.RelayConfig, and is useful for accessing the field via an interface. +func (v *JobPartsSpecOCR2Spec) GetRelayConfig() gqlscalar.Map { return v.OCR2Spec.RelayConfig } + +// GetTransmitterID returns JobPartsSpecOCR2Spec.TransmitterID, and is useful for accessing the field via an interface. +func (v *JobPartsSpecOCR2Spec) GetTransmitterID() string { return v.OCR2Spec.TransmitterID } + +// GetPluginType returns JobPartsSpecOCR2Spec.PluginType, and is useful for accessing the field via an interface. +func (v *JobPartsSpecOCR2Spec) GetPluginType() string { return v.OCR2Spec.PluginType } + +// GetPluginConfig returns JobPartsSpecOCR2Spec.PluginConfig, and is useful for accessing the field via an interface. +func (v *JobPartsSpecOCR2Spec) GetPluginConfig() gqlscalar.Map { return v.OCR2Spec.PluginConfig } + +func (v *JobPartsSpecOCR2Spec) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *JobPartsSpecOCR2Spec + graphql.NoUnmarshalJSON + } + firstPass.JobPartsSpecOCR2Spec = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + err = json.Unmarshal( + b, &v.OCR2Spec) + if err != nil { + return err + } + return nil +} + +type __premarshalJobPartsSpecOCR2Spec struct { + Typename string `json:"__typename"` + + BlockchainTimeout string `json:"blockchainTimeout"` + + ContractID string `json:"contractID"` + + ContractConfigConfirmations int `json:"contractConfigConfirmations"` + + ContractConfigTrackerPollInterval string `json:"contractConfigTrackerPollInterval"` + + CreatedAt string `json:"createdAt"` + + OcrKeyBundleID string `json:"ocrKeyBundleID"` + + MonitoringEndpoint string `json:"monitoringEndpoint"` + + P2pv2Bootstrappers []string `json:"p2pv2Bootstrappers"` + + Relay string `json:"relay"` + + RelayConfig gqlscalar.Map `json:"relayConfig"` + + TransmitterID string `json:"transmitterID"` + + PluginType string `json:"pluginType"` + + PluginConfig gqlscalar.Map `json:"pluginConfig"` +} + +func (v *JobPartsSpecOCR2Spec) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *JobPartsSpecOCR2Spec) __premarshalJSON() (*__premarshalJobPartsSpecOCR2Spec, error) { + var retval __premarshalJobPartsSpecOCR2Spec + + retval.Typename = v.Typename + retval.BlockchainTimeout = v.OCR2Spec.BlockchainTimeout + retval.ContractID = v.OCR2Spec.ContractID + retval.ContractConfigConfirmations = v.OCR2Spec.ContractConfigConfirmations + retval.ContractConfigTrackerPollInterval = v.OCR2Spec.ContractConfigTrackerPollInterval + retval.CreatedAt = v.OCR2Spec.CreatedAt + retval.OcrKeyBundleID = v.OCR2Spec.OcrKeyBundleID + retval.MonitoringEndpoint = v.OCR2Spec.MonitoringEndpoint + retval.P2pv2Bootstrappers = v.OCR2Spec.P2pv2Bootstrappers + retval.Relay = v.OCR2Spec.Relay + retval.RelayConfig = v.OCR2Spec.RelayConfig + retval.TransmitterID = v.OCR2Spec.TransmitterID + retval.PluginType = v.OCR2Spec.PluginType + retval.PluginConfig = v.OCR2Spec.PluginConfig + return &retval, nil +} + +// JobPartsSpecOCRSpec includes the requested fields of the GraphQL type OCRSpec. +type JobPartsSpecOCRSpec struct { + Typename string `json:"__typename"` +} + +// GetTypename returns JobPartsSpecOCRSpec.Typename, and is useful for accessing the field via an interface. +func (v *JobPartsSpecOCRSpec) GetTypename() string { return v.Typename } + +// JobPartsSpecStandardCapabilitiesSpec includes the requested fields of the GraphQL type StandardCapabilitiesSpec. +type JobPartsSpecStandardCapabilitiesSpec struct { + Typename string `json:"__typename"` +} + +// GetTypename returns JobPartsSpecStandardCapabilitiesSpec.Typename, and is useful for accessing the field via an interface. +func (v *JobPartsSpecStandardCapabilitiesSpec) GetTypename() string { return v.Typename } + +// JobPartsSpecVRFSpec includes the requested fields of the GraphQL type VRFSpec. +type JobPartsSpecVRFSpec struct { + Typename string `json:"__typename"` +} + +// GetTypename returns JobPartsSpecVRFSpec.Typename, and is useful for accessing the field via an interface. +func (v *JobPartsSpecVRFSpec) GetTypename() string { return v.Typename } + +// JobPartsSpecWebhookSpec includes the requested fields of the GraphQL type WebhookSpec. +type JobPartsSpecWebhookSpec struct { + Typename string `json:"__typename"` +} + +// GetTypename returns JobPartsSpecWebhookSpec.Typename, and is useful for accessing the field via an interface. +func (v *JobPartsSpecWebhookSpec) GetTypename() string { return v.Typename } + +// JobPartsSpecWorkflowSpec includes the requested fields of the GraphQL type WorkflowSpec. +type JobPartsSpecWorkflowSpec struct { + Typename string `json:"__typename"` +} + +// GetTypename returns JobPartsSpecWorkflowSpec.Typename, and is useful for accessing the field via an interface. +func (v *JobPartsSpecWorkflowSpec) GetTypename() string { return v.Typename } + +type JobProposalStatus string + +const ( + JobProposalStatusPending JobProposalStatus = "PENDING" + JobProposalStatusApproved JobProposalStatus = "APPROVED" + JobProposalStatusRejected JobProposalStatus = "REJECTED" + JobProposalStatusCancelled JobProposalStatus = "CANCELLED" + JobProposalStatusDeleted JobProposalStatus = "DELETED" + JobProposalStatusRevoked JobProposalStatus = "REVOKED" +) + +// ListBridgesBridgesBridgesPayload includes the requested fields of the GraphQL type BridgesPayload. +type ListBridgesBridgesBridgesPayload struct { + Results []ListBridgesBridgesBridgesPayloadResultsBridge `json:"results"` + Metadata ListBridgesBridgesBridgesPayloadMetadataPaginationMetadata `json:"metadata"` +} + +// GetResults returns ListBridgesBridgesBridgesPayload.Results, and is useful for accessing the field via an interface. +func (v *ListBridgesBridgesBridgesPayload) GetResults() []ListBridgesBridgesBridgesPayloadResultsBridge { + return v.Results +} + +// GetMetadata returns ListBridgesBridgesBridgesPayload.Metadata, and is useful for accessing the field via an interface. +func (v *ListBridgesBridgesBridgesPayload) GetMetadata() ListBridgesBridgesBridgesPayloadMetadataPaginationMetadata { + return v.Metadata +} + +// ListBridgesBridgesBridgesPayloadMetadataPaginationMetadata includes the requested fields of the GraphQL type PaginationMetadata. +type ListBridgesBridgesBridgesPayloadMetadataPaginationMetadata struct { + Total int `json:"total"` +} + +// GetTotal returns ListBridgesBridgesBridgesPayloadMetadataPaginationMetadata.Total, and is useful for accessing the field via an interface. +func (v *ListBridgesBridgesBridgesPayloadMetadataPaginationMetadata) GetTotal() int { return v.Total } + +// ListBridgesBridgesBridgesPayloadResultsBridge includes the requested fields of the GraphQL type Bridge. +type ListBridgesBridgesBridgesPayloadResultsBridge struct { + BridgeParts `json:"-"` +} + +// GetId returns ListBridgesBridgesBridgesPayloadResultsBridge.Id, and is useful for accessing the field via an interface. +func (v *ListBridgesBridgesBridgesPayloadResultsBridge) GetId() string { return v.BridgeParts.Id } + +// GetName returns ListBridgesBridgesBridgesPayloadResultsBridge.Name, and is useful for accessing the field via an interface. +func (v *ListBridgesBridgesBridgesPayloadResultsBridge) GetName() string { return v.BridgeParts.Name } + +// GetUrl returns ListBridgesBridgesBridgesPayloadResultsBridge.Url, and is useful for accessing the field via an interface. +func (v *ListBridgesBridgesBridgesPayloadResultsBridge) GetUrl() string { return v.BridgeParts.Url } + +// GetConfirmations returns ListBridgesBridgesBridgesPayloadResultsBridge.Confirmations, and is useful for accessing the field via an interface. +func (v *ListBridgesBridgesBridgesPayloadResultsBridge) GetConfirmations() int { + return v.BridgeParts.Confirmations +} + +// GetOutgoingToken returns ListBridgesBridgesBridgesPayloadResultsBridge.OutgoingToken, and is useful for accessing the field via an interface. +func (v *ListBridgesBridgesBridgesPayloadResultsBridge) GetOutgoingToken() string { + return v.BridgeParts.OutgoingToken +} + +// GetMinimumContractPayment returns ListBridgesBridgesBridgesPayloadResultsBridge.MinimumContractPayment, and is useful for accessing the field via an interface. +func (v *ListBridgesBridgesBridgesPayloadResultsBridge) GetMinimumContractPayment() string { + return v.BridgeParts.MinimumContractPayment +} + +// GetCreatedAt returns ListBridgesBridgesBridgesPayloadResultsBridge.CreatedAt, and is useful for accessing the field via an interface. +func (v *ListBridgesBridgesBridgesPayloadResultsBridge) GetCreatedAt() string { + return v.BridgeParts.CreatedAt +} + +func (v *ListBridgesBridgesBridgesPayloadResultsBridge) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *ListBridgesBridgesBridgesPayloadResultsBridge + graphql.NoUnmarshalJSON + } + firstPass.ListBridgesBridgesBridgesPayloadResultsBridge = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + err = json.Unmarshal( + b, &v.BridgeParts) + if err != nil { + return err + } + return nil +} + +type __premarshalListBridgesBridgesBridgesPayloadResultsBridge struct { + Id string `json:"id"` + + Name string `json:"name"` + + Url string `json:"url"` + + Confirmations int `json:"confirmations"` + + OutgoingToken string `json:"outgoingToken"` + + MinimumContractPayment string `json:"minimumContractPayment"` + + CreatedAt string `json:"createdAt"` +} + +func (v *ListBridgesBridgesBridgesPayloadResultsBridge) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *ListBridgesBridgesBridgesPayloadResultsBridge) __premarshalJSON() (*__premarshalListBridgesBridgesBridgesPayloadResultsBridge, error) { + var retval __premarshalListBridgesBridgesBridgesPayloadResultsBridge + + retval.Id = v.BridgeParts.Id + retval.Name = v.BridgeParts.Name + retval.Url = v.BridgeParts.Url + retval.Confirmations = v.BridgeParts.Confirmations + retval.OutgoingToken = v.BridgeParts.OutgoingToken + retval.MinimumContractPayment = v.BridgeParts.MinimumContractPayment + retval.CreatedAt = v.BridgeParts.CreatedAt + return &retval, nil +} + +// ListBridgesResponse is returned by ListBridges on success. +type ListBridgesResponse struct { + Bridges ListBridgesBridgesBridgesPayload `json:"bridges"` +} + +// GetBridges returns ListBridgesResponse.Bridges, and is useful for accessing the field via an interface. +func (v *ListBridgesResponse) GetBridges() ListBridgesBridgesBridgesPayload { return v.Bridges } + +// ListFeedsManagersFeedsManagersFeedsManagersPayload includes the requested fields of the GraphQL type FeedsManagersPayload. +type ListFeedsManagersFeedsManagersFeedsManagersPayload struct { + Results []ListFeedsManagersFeedsManagersFeedsManagersPayloadResultsFeedsManager `json:"results"` +} + +// GetResults returns ListFeedsManagersFeedsManagersFeedsManagersPayload.Results, and is useful for accessing the field via an interface. +func (v *ListFeedsManagersFeedsManagersFeedsManagersPayload) GetResults() []ListFeedsManagersFeedsManagersFeedsManagersPayloadResultsFeedsManager { + return v.Results +} + +// ListFeedsManagersFeedsManagersFeedsManagersPayloadResultsFeedsManager includes the requested fields of the GraphQL type FeedsManager. +type ListFeedsManagersFeedsManagersFeedsManagersPayloadResultsFeedsManager struct { + FeedsManagerParts `json:"-"` +} + +// GetId returns ListFeedsManagersFeedsManagersFeedsManagersPayloadResultsFeedsManager.Id, and is useful for accessing the field via an interface. +func (v *ListFeedsManagersFeedsManagersFeedsManagersPayloadResultsFeedsManager) GetId() string { + return v.FeedsManagerParts.Id +} + +// GetName returns ListFeedsManagersFeedsManagersFeedsManagersPayloadResultsFeedsManager.Name, and is useful for accessing the field via an interface. +func (v *ListFeedsManagersFeedsManagersFeedsManagersPayloadResultsFeedsManager) GetName() string { + return v.FeedsManagerParts.Name +} + +// GetUri returns ListFeedsManagersFeedsManagersFeedsManagersPayloadResultsFeedsManager.Uri, and is useful for accessing the field via an interface. +func (v *ListFeedsManagersFeedsManagersFeedsManagersPayloadResultsFeedsManager) GetUri() string { + return v.FeedsManagerParts.Uri +} + +// GetPublicKey returns ListFeedsManagersFeedsManagersFeedsManagersPayloadResultsFeedsManager.PublicKey, and is useful for accessing the field via an interface. +func (v *ListFeedsManagersFeedsManagersFeedsManagersPayloadResultsFeedsManager) GetPublicKey() string { + return v.FeedsManagerParts.PublicKey +} + +// GetIsConnectionActive returns ListFeedsManagersFeedsManagersFeedsManagersPayloadResultsFeedsManager.IsConnectionActive, and is useful for accessing the field via an interface. +func (v *ListFeedsManagersFeedsManagersFeedsManagersPayloadResultsFeedsManager) GetIsConnectionActive() bool { + return v.FeedsManagerParts.IsConnectionActive +} + +// GetCreatedAt returns ListFeedsManagersFeedsManagersFeedsManagersPayloadResultsFeedsManager.CreatedAt, and is useful for accessing the field via an interface. +func (v *ListFeedsManagersFeedsManagersFeedsManagersPayloadResultsFeedsManager) GetCreatedAt() string { + return v.FeedsManagerParts.CreatedAt +} + +func (v *ListFeedsManagersFeedsManagersFeedsManagersPayloadResultsFeedsManager) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *ListFeedsManagersFeedsManagersFeedsManagersPayloadResultsFeedsManager + graphql.NoUnmarshalJSON + } + firstPass.ListFeedsManagersFeedsManagersFeedsManagersPayloadResultsFeedsManager = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + err = json.Unmarshal( + b, &v.FeedsManagerParts) + if err != nil { + return err + } + return nil +} + +type __premarshalListFeedsManagersFeedsManagersFeedsManagersPayloadResultsFeedsManager struct { + Id string `json:"id"` + + Name string `json:"name"` + + Uri string `json:"uri"` + + PublicKey string `json:"publicKey"` + + IsConnectionActive bool `json:"isConnectionActive"` + + CreatedAt string `json:"createdAt"` +} + +func (v *ListFeedsManagersFeedsManagersFeedsManagersPayloadResultsFeedsManager) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *ListFeedsManagersFeedsManagersFeedsManagersPayloadResultsFeedsManager) __premarshalJSON() (*__premarshalListFeedsManagersFeedsManagersFeedsManagersPayloadResultsFeedsManager, error) { + var retval __premarshalListFeedsManagersFeedsManagersFeedsManagersPayloadResultsFeedsManager + + retval.Id = v.FeedsManagerParts.Id + retval.Name = v.FeedsManagerParts.Name + retval.Uri = v.FeedsManagerParts.Uri + retval.PublicKey = v.FeedsManagerParts.PublicKey + retval.IsConnectionActive = v.FeedsManagerParts.IsConnectionActive + retval.CreatedAt = v.FeedsManagerParts.CreatedAt + return &retval, nil +} + +// ListFeedsManagersResponse is returned by ListFeedsManagers on success. +type ListFeedsManagersResponse struct { + FeedsManagers ListFeedsManagersFeedsManagersFeedsManagersPayload `json:"feedsManagers"` +} + +// GetFeedsManagers returns ListFeedsManagersResponse.FeedsManagers, and is useful for accessing the field via an interface. +func (v *ListFeedsManagersResponse) GetFeedsManagers() ListFeedsManagersFeedsManagersFeedsManagersPayload { + return v.FeedsManagers +} + +// ListJobsJobsJobsPayload includes the requested fields of the GraphQL type JobsPayload. +type ListJobsJobsJobsPayload struct { + Results []ListJobsJobsJobsPayloadResultsJob `json:"results"` + Metadata ListJobsJobsJobsPayloadMetadataPaginationMetadata `json:"metadata"` +} + +// GetResults returns ListJobsJobsJobsPayload.Results, and is useful for accessing the field via an interface. +func (v *ListJobsJobsJobsPayload) GetResults() []ListJobsJobsJobsPayloadResultsJob { return v.Results } + +// GetMetadata returns ListJobsJobsJobsPayload.Metadata, and is useful for accessing the field via an interface. +func (v *ListJobsJobsJobsPayload) GetMetadata() ListJobsJobsJobsPayloadMetadataPaginationMetadata { + return v.Metadata +} + +// ListJobsJobsJobsPayloadMetadataPaginationMetadata includes the requested fields of the GraphQL type PaginationMetadata. +type ListJobsJobsJobsPayloadMetadataPaginationMetadata struct { + Total int `json:"total"` +} + +// GetTotal returns ListJobsJobsJobsPayloadMetadataPaginationMetadata.Total, and is useful for accessing the field via an interface. +func (v *ListJobsJobsJobsPayloadMetadataPaginationMetadata) GetTotal() int { return v.Total } + +// ListJobsJobsJobsPayloadResultsJob includes the requested fields of the GraphQL type Job. +type ListJobsJobsJobsPayloadResultsJob struct { + JobParts `json:"-"` +} + +// GetId returns ListJobsJobsJobsPayloadResultsJob.Id, and is useful for accessing the field via an interface. +func (v *ListJobsJobsJobsPayloadResultsJob) GetId() string { return v.JobParts.Id } + +// GetName returns ListJobsJobsJobsPayloadResultsJob.Name, and is useful for accessing the field via an interface. +func (v *ListJobsJobsJobsPayloadResultsJob) GetName() string { return v.JobParts.Name } + +// GetSchemaVersion returns ListJobsJobsJobsPayloadResultsJob.SchemaVersion, and is useful for accessing the field via an interface. +func (v *ListJobsJobsJobsPayloadResultsJob) GetSchemaVersion() int { return v.JobParts.SchemaVersion } + +// GetGasLimit returns ListJobsJobsJobsPayloadResultsJob.GasLimit, and is useful for accessing the field via an interface. +func (v *ListJobsJobsJobsPayloadResultsJob) GetGasLimit() int { return v.JobParts.GasLimit } + +// GetForwardingAllowed returns ListJobsJobsJobsPayloadResultsJob.ForwardingAllowed, and is useful for accessing the field via an interface. +func (v *ListJobsJobsJobsPayloadResultsJob) GetForwardingAllowed() bool { + return v.JobParts.ForwardingAllowed +} + +// GetMaxTaskDuration returns ListJobsJobsJobsPayloadResultsJob.MaxTaskDuration, and is useful for accessing the field via an interface. +func (v *ListJobsJobsJobsPayloadResultsJob) GetMaxTaskDuration() string { + return v.JobParts.MaxTaskDuration +} + +// GetExternalJobID returns ListJobsJobsJobsPayloadResultsJob.ExternalJobID, and is useful for accessing the field via an interface. +func (v *ListJobsJobsJobsPayloadResultsJob) GetExternalJobID() string { + return v.JobParts.ExternalJobID +} + +// GetType returns ListJobsJobsJobsPayloadResultsJob.Type, and is useful for accessing the field via an interface. +func (v *ListJobsJobsJobsPayloadResultsJob) GetType() string { return v.JobParts.Type } + +// GetSpec returns ListJobsJobsJobsPayloadResultsJob.Spec, and is useful for accessing the field via an interface. +func (v *ListJobsJobsJobsPayloadResultsJob) GetSpec() JobPartsSpecJobSpec { return v.JobParts.Spec } + +// GetObservationSource returns ListJobsJobsJobsPayloadResultsJob.ObservationSource, and is useful for accessing the field via an interface. +func (v *ListJobsJobsJobsPayloadResultsJob) GetObservationSource() string { + return v.JobParts.ObservationSource +} + +// GetErrors returns ListJobsJobsJobsPayloadResultsJob.Errors, and is useful for accessing the field via an interface. +func (v *ListJobsJobsJobsPayloadResultsJob) GetErrors() []JobPartsErrorsJobError { + return v.JobParts.Errors +} + +func (v *ListJobsJobsJobsPayloadResultsJob) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *ListJobsJobsJobsPayloadResultsJob + graphql.NoUnmarshalJSON + } + firstPass.ListJobsJobsJobsPayloadResultsJob = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + err = json.Unmarshal( + b, &v.JobParts) + if err != nil { + return err + } + return nil +} + +type __premarshalListJobsJobsJobsPayloadResultsJob struct { + Id string `json:"id"` + + Name string `json:"name"` + + SchemaVersion int `json:"schemaVersion"` + + GasLimit int `json:"gasLimit"` + + ForwardingAllowed bool `json:"forwardingAllowed"` + + MaxTaskDuration string `json:"maxTaskDuration"` + + ExternalJobID string `json:"externalJobID"` + + Type string `json:"type"` + + Spec json.RawMessage `json:"spec"` + + ObservationSource string `json:"observationSource"` + + Errors []JobPartsErrorsJobError `json:"errors"` +} + +func (v *ListJobsJobsJobsPayloadResultsJob) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *ListJobsJobsJobsPayloadResultsJob) __premarshalJSON() (*__premarshalListJobsJobsJobsPayloadResultsJob, error) { + var retval __premarshalListJobsJobsJobsPayloadResultsJob + + retval.Id = v.JobParts.Id + retval.Name = v.JobParts.Name + retval.SchemaVersion = v.JobParts.SchemaVersion + retval.GasLimit = v.JobParts.GasLimit + retval.ForwardingAllowed = v.JobParts.ForwardingAllowed + retval.MaxTaskDuration = v.JobParts.MaxTaskDuration + retval.ExternalJobID = v.JobParts.ExternalJobID + retval.Type = v.JobParts.Type + { + + dst := &retval.Spec + src := v.JobParts.Spec + var err error + *dst, err = __marshalJobPartsSpecJobSpec( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal ListJobsJobsJobsPayloadResultsJob.JobParts.Spec: %w", err) + } + } + retval.ObservationSource = v.JobParts.ObservationSource + retval.Errors = v.JobParts.Errors + return &retval, nil +} + +// ListJobsResponse is returned by ListJobs on success. +type ListJobsResponse struct { + Jobs ListJobsJobsJobsPayload `json:"jobs"` +} + +// GetJobs returns ListJobsResponse.Jobs, and is useful for accessing the field via an interface. +func (v *ListJobsResponse) GetJobs() ListJobsJobsJobsPayload { return v.Jobs } + +type OCR2ChainType string + +const ( + OCR2ChainTypeEvm OCR2ChainType = "EVM" + OCR2ChainTypeCosmos OCR2ChainType = "COSMOS" + OCR2ChainTypeSolana OCR2ChainType = "SOLANA" + OCR2ChainTypeStarknet OCR2ChainType = "STARKNET" + OCR2ChainTypeAptos OCR2ChainType = "APTOS" +) + +// #################### +// Jobs and Job Proposals +// #################### +type OCR2Spec struct { + BlockchainTimeout string `json:"blockchainTimeout"` + ContractID string `json:"contractID"` + ContractConfigConfirmations int `json:"contractConfigConfirmations"` + ContractConfigTrackerPollInterval string `json:"contractConfigTrackerPollInterval"` + CreatedAt string `json:"createdAt"` + OcrKeyBundleID string `json:"ocrKeyBundleID"` + MonitoringEndpoint string `json:"monitoringEndpoint"` + P2pv2Bootstrappers []string `json:"p2pv2Bootstrappers"` + Relay string `json:"relay"` + RelayConfig gqlscalar.Map `json:"relayConfig"` + TransmitterID string `json:"transmitterID"` + PluginType string `json:"pluginType"` + PluginConfig gqlscalar.Map `json:"pluginConfig"` +} + +// GetBlockchainTimeout returns OCR2Spec.BlockchainTimeout, and is useful for accessing the field via an interface. +func (v *OCR2Spec) GetBlockchainTimeout() string { return v.BlockchainTimeout } + +// GetContractID returns OCR2Spec.ContractID, and is useful for accessing the field via an interface. +func (v *OCR2Spec) GetContractID() string { return v.ContractID } + +// GetContractConfigConfirmations returns OCR2Spec.ContractConfigConfirmations, and is useful for accessing the field via an interface. +func (v *OCR2Spec) GetContractConfigConfirmations() int { return v.ContractConfigConfirmations } + +// GetContractConfigTrackerPollInterval returns OCR2Spec.ContractConfigTrackerPollInterval, and is useful for accessing the field via an interface. +func (v *OCR2Spec) GetContractConfigTrackerPollInterval() string { + return v.ContractConfigTrackerPollInterval +} + +// GetCreatedAt returns OCR2Spec.CreatedAt, and is useful for accessing the field via an interface. +func (v *OCR2Spec) GetCreatedAt() string { return v.CreatedAt } + +// GetOcrKeyBundleID returns OCR2Spec.OcrKeyBundleID, and is useful for accessing the field via an interface. +func (v *OCR2Spec) GetOcrKeyBundleID() string { return v.OcrKeyBundleID } + +// GetMonitoringEndpoint returns OCR2Spec.MonitoringEndpoint, and is useful for accessing the field via an interface. +func (v *OCR2Spec) GetMonitoringEndpoint() string { return v.MonitoringEndpoint } + +// GetP2pv2Bootstrappers returns OCR2Spec.P2pv2Bootstrappers, and is useful for accessing the field via an interface. +func (v *OCR2Spec) GetP2pv2Bootstrappers() []string { return v.P2pv2Bootstrappers } + +// GetRelay returns OCR2Spec.Relay, and is useful for accessing the field via an interface. +func (v *OCR2Spec) GetRelay() string { return v.Relay } + +// GetRelayConfig returns OCR2Spec.RelayConfig, and is useful for accessing the field via an interface. +func (v *OCR2Spec) GetRelayConfig() gqlscalar.Map { return v.RelayConfig } + +// GetTransmitterID returns OCR2Spec.TransmitterID, and is useful for accessing the field via an interface. +func (v *OCR2Spec) GetTransmitterID() string { return v.TransmitterID } + +// GetPluginType returns OCR2Spec.PluginType, and is useful for accessing the field via an interface. +func (v *OCR2Spec) GetPluginType() string { return v.PluginType } + +// GetPluginConfig returns OCR2Spec.PluginConfig, and is useful for accessing the field via an interface. +func (v *OCR2Spec) GetPluginConfig() gqlscalar.Map { return v.PluginConfig } + +// RejectJobProposalSpecRejectJobProposalSpecNotFoundError includes the requested fields of the GraphQL type NotFoundError. +type RejectJobProposalSpecRejectJobProposalSpecNotFoundError struct { + Typename string `json:"__typename"` + Message string `json:"message"` + Code ErrorCode `json:"code"` +} + +// GetTypename returns RejectJobProposalSpecRejectJobProposalSpecNotFoundError.Typename, and is useful for accessing the field via an interface. +func (v *RejectJobProposalSpecRejectJobProposalSpecNotFoundError) GetTypename() string { + return v.Typename +} + +// GetMessage returns RejectJobProposalSpecRejectJobProposalSpecNotFoundError.Message, and is useful for accessing the field via an interface. +func (v *RejectJobProposalSpecRejectJobProposalSpecNotFoundError) GetMessage() string { + return v.Message +} + +// GetCode returns RejectJobProposalSpecRejectJobProposalSpecNotFoundError.Code, and is useful for accessing the field via an interface. +func (v *RejectJobProposalSpecRejectJobProposalSpecNotFoundError) GetCode() ErrorCode { return v.Code } + +// RejectJobProposalSpecRejectJobProposalSpecRejectJobProposalSpecPayload includes the requested fields of the GraphQL interface RejectJobProposalSpecPayload. +// +// RejectJobProposalSpecRejectJobProposalSpecRejectJobProposalSpecPayload is implemented by the following types: +// RejectJobProposalSpecRejectJobProposalSpecNotFoundError +// RejectJobProposalSpecRejectJobProposalSpecRejectJobProposalSpecSuccess +type RejectJobProposalSpecRejectJobProposalSpecRejectJobProposalSpecPayload interface { + implementsGraphQLInterfaceRejectJobProposalSpecRejectJobProposalSpecRejectJobProposalSpecPayload() + // GetTypename returns the receiver's concrete GraphQL type-name (see interface doc for possible values). + GetTypename() string +} + +func (v *RejectJobProposalSpecRejectJobProposalSpecNotFoundError) implementsGraphQLInterfaceRejectJobProposalSpecRejectJobProposalSpecRejectJobProposalSpecPayload() { +} +func (v *RejectJobProposalSpecRejectJobProposalSpecRejectJobProposalSpecSuccess) implementsGraphQLInterfaceRejectJobProposalSpecRejectJobProposalSpecRejectJobProposalSpecPayload() { +} + +func __unmarshalRejectJobProposalSpecRejectJobProposalSpecRejectJobProposalSpecPayload(b []byte, v *RejectJobProposalSpecRejectJobProposalSpecRejectJobProposalSpecPayload) error { + if string(b) == "null" { + return nil + } + + var tn struct { + TypeName string `json:"__typename"` + } + err := json.Unmarshal(b, &tn) + if err != nil { + return err + } + + switch tn.TypeName { + case "NotFoundError": + *v = new(RejectJobProposalSpecRejectJobProposalSpecNotFoundError) + return json.Unmarshal(b, *v) + case "RejectJobProposalSpecSuccess": + *v = new(RejectJobProposalSpecRejectJobProposalSpecRejectJobProposalSpecSuccess) + return json.Unmarshal(b, *v) + case "": + return fmt.Errorf( + "response was missing RejectJobProposalSpecPayload.__typename") + default: + return fmt.Errorf( + `unexpected concrete type for RejectJobProposalSpecRejectJobProposalSpecRejectJobProposalSpecPayload: "%v"`, tn.TypeName) + } +} + +func __marshalRejectJobProposalSpecRejectJobProposalSpecRejectJobProposalSpecPayload(v *RejectJobProposalSpecRejectJobProposalSpecRejectJobProposalSpecPayload) ([]byte, error) { + + var typename string + switch v := (*v).(type) { + case *RejectJobProposalSpecRejectJobProposalSpecNotFoundError: + typename = "NotFoundError" + + result := struct { + TypeName string `json:"__typename"` + *RejectJobProposalSpecRejectJobProposalSpecNotFoundError + }{typename, v} + return json.Marshal(result) + case *RejectJobProposalSpecRejectJobProposalSpecRejectJobProposalSpecSuccess: + typename = "RejectJobProposalSpecSuccess" + + result := struct { + TypeName string `json:"__typename"` + *RejectJobProposalSpecRejectJobProposalSpecRejectJobProposalSpecSuccess + }{typename, v} + return json.Marshal(result) + case nil: + return []byte("null"), nil + default: + return nil, fmt.Errorf( + `unexpected concrete type for RejectJobProposalSpecRejectJobProposalSpecRejectJobProposalSpecPayload: "%T"`, v) + } +} + +// RejectJobProposalSpecRejectJobProposalSpecRejectJobProposalSpecSuccess includes the requested fields of the GraphQL type RejectJobProposalSpecSuccess. +type RejectJobProposalSpecRejectJobProposalSpecRejectJobProposalSpecSuccess struct { + Typename string `json:"__typename"` + Spec RejectJobProposalSpecRejectJobProposalSpecRejectJobProposalSpecSuccessSpecJobProposalSpec `json:"spec"` +} + +// GetTypename returns RejectJobProposalSpecRejectJobProposalSpecRejectJobProposalSpecSuccess.Typename, and is useful for accessing the field via an interface. +func (v *RejectJobProposalSpecRejectJobProposalSpecRejectJobProposalSpecSuccess) GetTypename() string { + return v.Typename +} + +// GetSpec returns RejectJobProposalSpecRejectJobProposalSpecRejectJobProposalSpecSuccess.Spec, and is useful for accessing the field via an interface. +func (v *RejectJobProposalSpecRejectJobProposalSpecRejectJobProposalSpecSuccess) GetSpec() RejectJobProposalSpecRejectJobProposalSpecRejectJobProposalSpecSuccessSpecJobProposalSpec { + return v.Spec +} + +// RejectJobProposalSpecRejectJobProposalSpecRejectJobProposalSpecSuccessSpecJobProposalSpec includes the requested fields of the GraphQL type JobProposalSpec. +type RejectJobProposalSpecRejectJobProposalSpecRejectJobProposalSpecSuccessSpecJobProposalSpec struct { + Id string `json:"id"` + Definition string `json:"definition"` + Version int `json:"version"` + Status SpecStatus `json:"status"` + StatusUpdatedAt string `json:"statusUpdatedAt"` + CreatedAt string `json:"createdAt"` + UpdatedAt string `json:"updatedAt"` +} + +// GetId returns RejectJobProposalSpecRejectJobProposalSpecRejectJobProposalSpecSuccessSpecJobProposalSpec.Id, and is useful for accessing the field via an interface. +func (v *RejectJobProposalSpecRejectJobProposalSpecRejectJobProposalSpecSuccessSpecJobProposalSpec) GetId() string { + return v.Id +} + +// GetDefinition returns RejectJobProposalSpecRejectJobProposalSpecRejectJobProposalSpecSuccessSpecJobProposalSpec.Definition, and is useful for accessing the field via an interface. +func (v *RejectJobProposalSpecRejectJobProposalSpecRejectJobProposalSpecSuccessSpecJobProposalSpec) GetDefinition() string { + return v.Definition +} + +// GetVersion returns RejectJobProposalSpecRejectJobProposalSpecRejectJobProposalSpecSuccessSpecJobProposalSpec.Version, and is useful for accessing the field via an interface. +func (v *RejectJobProposalSpecRejectJobProposalSpecRejectJobProposalSpecSuccessSpecJobProposalSpec) GetVersion() int { + return v.Version +} + +// GetStatus returns RejectJobProposalSpecRejectJobProposalSpecRejectJobProposalSpecSuccessSpecJobProposalSpec.Status, and is useful for accessing the field via an interface. +func (v *RejectJobProposalSpecRejectJobProposalSpecRejectJobProposalSpecSuccessSpecJobProposalSpec) GetStatus() SpecStatus { + return v.Status +} + +// GetStatusUpdatedAt returns RejectJobProposalSpecRejectJobProposalSpecRejectJobProposalSpecSuccessSpecJobProposalSpec.StatusUpdatedAt, and is useful for accessing the field via an interface. +func (v *RejectJobProposalSpecRejectJobProposalSpecRejectJobProposalSpecSuccessSpecJobProposalSpec) GetStatusUpdatedAt() string { + return v.StatusUpdatedAt +} + +// GetCreatedAt returns RejectJobProposalSpecRejectJobProposalSpecRejectJobProposalSpecSuccessSpecJobProposalSpec.CreatedAt, and is useful for accessing the field via an interface. +func (v *RejectJobProposalSpecRejectJobProposalSpecRejectJobProposalSpecSuccessSpecJobProposalSpec) GetCreatedAt() string { + return v.CreatedAt +} + +// GetUpdatedAt returns RejectJobProposalSpecRejectJobProposalSpecRejectJobProposalSpecSuccessSpecJobProposalSpec.UpdatedAt, and is useful for accessing the field via an interface. +func (v *RejectJobProposalSpecRejectJobProposalSpecRejectJobProposalSpecSuccessSpecJobProposalSpec) GetUpdatedAt() string { + return v.UpdatedAt +} + +// RejectJobProposalSpecResponse is returned by RejectJobProposalSpec on success. +type RejectJobProposalSpecResponse struct { + RejectJobProposalSpec RejectJobProposalSpecRejectJobProposalSpecRejectJobProposalSpecPayload `json:"-"` +} + +// GetRejectJobProposalSpec returns RejectJobProposalSpecResponse.RejectJobProposalSpec, and is useful for accessing the field via an interface. +func (v *RejectJobProposalSpecResponse) GetRejectJobProposalSpec() RejectJobProposalSpecRejectJobProposalSpecRejectJobProposalSpecPayload { + return v.RejectJobProposalSpec +} + +func (v *RejectJobProposalSpecResponse) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *RejectJobProposalSpecResponse + RejectJobProposalSpec json.RawMessage `json:"rejectJobProposalSpec"` + graphql.NoUnmarshalJSON + } + firstPass.RejectJobProposalSpecResponse = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + { + dst := &v.RejectJobProposalSpec + src := firstPass.RejectJobProposalSpec + if len(src) != 0 && string(src) != "null" { + err = __unmarshalRejectJobProposalSpecRejectJobProposalSpecRejectJobProposalSpecPayload( + src, dst) + if err != nil { + return fmt.Errorf( + "unable to unmarshal RejectJobProposalSpecResponse.RejectJobProposalSpec: %w", err) + } + } + } + return nil +} + +type __premarshalRejectJobProposalSpecResponse struct { + RejectJobProposalSpec json.RawMessage `json:"rejectJobProposalSpec"` +} + +func (v *RejectJobProposalSpecResponse) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *RejectJobProposalSpecResponse) __premarshalJSON() (*__premarshalRejectJobProposalSpecResponse, error) { + var retval __premarshalRejectJobProposalSpecResponse + + { + + dst := &retval.RejectJobProposalSpec + src := v.RejectJobProposalSpec + var err error + *dst, err = __marshalRejectJobProposalSpecRejectJobProposalSpecRejectJobProposalSpecPayload( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal RejectJobProposalSpecResponse.RejectJobProposalSpec: %w", err) + } + } + return &retval, nil +} + +type SpecStatus string + +const ( + SpecStatusUnknown SpecStatus = "UNKNOWN" + SpecStatusPending SpecStatus = "PENDING" + SpecStatusApproved SpecStatus = "APPROVED" + SpecStatusRejected SpecStatus = "REJECTED" + SpecStatusCancelled SpecStatus = "CANCELLED" + SpecStatusRevoked SpecStatus = "REVOKED" +) + +type UpdateFeedsManagerInput struct { + Name string `json:"name"` + Uri string `json:"uri"` + PublicKey string `json:"publicKey"` +} + +// GetName returns UpdateFeedsManagerInput.Name, and is useful for accessing the field via an interface. +func (v *UpdateFeedsManagerInput) GetName() string { return v.Name } + +// GetUri returns UpdateFeedsManagerInput.Uri, and is useful for accessing the field via an interface. +func (v *UpdateFeedsManagerInput) GetUri() string { return v.Uri } + +// GetPublicKey returns UpdateFeedsManagerInput.PublicKey, and is useful for accessing the field via an interface. +func (v *UpdateFeedsManagerInput) GetPublicKey() string { return v.PublicKey } + +// UpdateFeedsManagerResponse is returned by UpdateFeedsManager on success. +type UpdateFeedsManagerResponse struct { + UpdateFeedsManager UpdateFeedsManagerUpdateFeedsManagerUpdateFeedsManagerPayload `json:"-"` +} + +// GetUpdateFeedsManager returns UpdateFeedsManagerResponse.UpdateFeedsManager, and is useful for accessing the field via an interface. +func (v *UpdateFeedsManagerResponse) GetUpdateFeedsManager() UpdateFeedsManagerUpdateFeedsManagerUpdateFeedsManagerPayload { + return v.UpdateFeedsManager +} + +func (v *UpdateFeedsManagerResponse) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *UpdateFeedsManagerResponse + UpdateFeedsManager json.RawMessage `json:"updateFeedsManager"` + graphql.NoUnmarshalJSON + } + firstPass.UpdateFeedsManagerResponse = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + { + dst := &v.UpdateFeedsManager + src := firstPass.UpdateFeedsManager + if len(src) != 0 && string(src) != "null" { + err = __unmarshalUpdateFeedsManagerUpdateFeedsManagerUpdateFeedsManagerPayload( + src, dst) + if err != nil { + return fmt.Errorf( + "unable to unmarshal UpdateFeedsManagerResponse.UpdateFeedsManager: %w", err) + } + } + } + return nil +} + +type __premarshalUpdateFeedsManagerResponse struct { + UpdateFeedsManager json.RawMessage `json:"updateFeedsManager"` +} + +func (v *UpdateFeedsManagerResponse) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *UpdateFeedsManagerResponse) __premarshalJSON() (*__premarshalUpdateFeedsManagerResponse, error) { + var retval __premarshalUpdateFeedsManagerResponse + + { + + dst := &retval.UpdateFeedsManager + src := v.UpdateFeedsManager + var err error + *dst, err = __marshalUpdateFeedsManagerUpdateFeedsManagerUpdateFeedsManagerPayload( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal UpdateFeedsManagerResponse.UpdateFeedsManager: %w", err) + } + } + return &retval, nil +} + +// UpdateFeedsManagerUpdateFeedsManagerInputErrors includes the requested fields of the GraphQL type InputErrors. +type UpdateFeedsManagerUpdateFeedsManagerInputErrors struct { + Typename string `json:"__typename"` + Errors []UpdateFeedsManagerUpdateFeedsManagerInputErrorsErrorsInputError `json:"errors"` +} + +// GetTypename returns UpdateFeedsManagerUpdateFeedsManagerInputErrors.Typename, and is useful for accessing the field via an interface. +func (v *UpdateFeedsManagerUpdateFeedsManagerInputErrors) GetTypename() string { return v.Typename } + +// GetErrors returns UpdateFeedsManagerUpdateFeedsManagerInputErrors.Errors, and is useful for accessing the field via an interface. +func (v *UpdateFeedsManagerUpdateFeedsManagerInputErrors) GetErrors() []UpdateFeedsManagerUpdateFeedsManagerInputErrorsErrorsInputError { + return v.Errors +} + +// UpdateFeedsManagerUpdateFeedsManagerInputErrorsErrorsInputError includes the requested fields of the GraphQL type InputError. +type UpdateFeedsManagerUpdateFeedsManagerInputErrorsErrorsInputError struct { + Message string `json:"message"` + Code ErrorCode `json:"code"` + Path string `json:"path"` +} + +// GetMessage returns UpdateFeedsManagerUpdateFeedsManagerInputErrorsErrorsInputError.Message, and is useful for accessing the field via an interface. +func (v *UpdateFeedsManagerUpdateFeedsManagerInputErrorsErrorsInputError) GetMessage() string { + return v.Message +} + +// GetCode returns UpdateFeedsManagerUpdateFeedsManagerInputErrorsErrorsInputError.Code, and is useful for accessing the field via an interface. +func (v *UpdateFeedsManagerUpdateFeedsManagerInputErrorsErrorsInputError) GetCode() ErrorCode { + return v.Code +} + +// GetPath returns UpdateFeedsManagerUpdateFeedsManagerInputErrorsErrorsInputError.Path, and is useful for accessing the field via an interface. +func (v *UpdateFeedsManagerUpdateFeedsManagerInputErrorsErrorsInputError) GetPath() string { + return v.Path +} + +// UpdateFeedsManagerUpdateFeedsManagerNotFoundError includes the requested fields of the GraphQL type NotFoundError. +type UpdateFeedsManagerUpdateFeedsManagerNotFoundError struct { + Typename string `json:"__typename"` + Message string `json:"message"` + Code ErrorCode `json:"code"` +} + +// GetTypename returns UpdateFeedsManagerUpdateFeedsManagerNotFoundError.Typename, and is useful for accessing the field via an interface. +func (v *UpdateFeedsManagerUpdateFeedsManagerNotFoundError) GetTypename() string { return v.Typename } + +// GetMessage returns UpdateFeedsManagerUpdateFeedsManagerNotFoundError.Message, and is useful for accessing the field via an interface. +func (v *UpdateFeedsManagerUpdateFeedsManagerNotFoundError) GetMessage() string { return v.Message } + +// GetCode returns UpdateFeedsManagerUpdateFeedsManagerNotFoundError.Code, and is useful for accessing the field via an interface. +func (v *UpdateFeedsManagerUpdateFeedsManagerNotFoundError) GetCode() ErrorCode { return v.Code } + +// UpdateFeedsManagerUpdateFeedsManagerUpdateFeedsManagerPayload includes the requested fields of the GraphQL interface UpdateFeedsManagerPayload. +// +// UpdateFeedsManagerUpdateFeedsManagerUpdateFeedsManagerPayload is implemented by the following types: +// UpdateFeedsManagerUpdateFeedsManagerInputErrors +// UpdateFeedsManagerUpdateFeedsManagerNotFoundError +// UpdateFeedsManagerUpdateFeedsManagerUpdateFeedsManagerSuccess +type UpdateFeedsManagerUpdateFeedsManagerUpdateFeedsManagerPayload interface { + implementsGraphQLInterfaceUpdateFeedsManagerUpdateFeedsManagerUpdateFeedsManagerPayload() + // GetTypename returns the receiver's concrete GraphQL type-name (see interface doc for possible values). + GetTypename() string +} + +func (v *UpdateFeedsManagerUpdateFeedsManagerInputErrors) implementsGraphQLInterfaceUpdateFeedsManagerUpdateFeedsManagerUpdateFeedsManagerPayload() { +} +func (v *UpdateFeedsManagerUpdateFeedsManagerNotFoundError) implementsGraphQLInterfaceUpdateFeedsManagerUpdateFeedsManagerUpdateFeedsManagerPayload() { +} +func (v *UpdateFeedsManagerUpdateFeedsManagerUpdateFeedsManagerSuccess) implementsGraphQLInterfaceUpdateFeedsManagerUpdateFeedsManagerUpdateFeedsManagerPayload() { +} + +func __unmarshalUpdateFeedsManagerUpdateFeedsManagerUpdateFeedsManagerPayload(b []byte, v *UpdateFeedsManagerUpdateFeedsManagerUpdateFeedsManagerPayload) error { + if string(b) == "null" { + return nil + } + + var tn struct { + TypeName string `json:"__typename"` + } + err := json.Unmarshal(b, &tn) + if err != nil { + return err + } + + switch tn.TypeName { + case "InputErrors": + *v = new(UpdateFeedsManagerUpdateFeedsManagerInputErrors) + return json.Unmarshal(b, *v) + case "NotFoundError": + *v = new(UpdateFeedsManagerUpdateFeedsManagerNotFoundError) + return json.Unmarshal(b, *v) + case "UpdateFeedsManagerSuccess": + *v = new(UpdateFeedsManagerUpdateFeedsManagerUpdateFeedsManagerSuccess) + return json.Unmarshal(b, *v) + case "": + return fmt.Errorf( + "response was missing UpdateFeedsManagerPayload.__typename") + default: + return fmt.Errorf( + `unexpected concrete type for UpdateFeedsManagerUpdateFeedsManagerUpdateFeedsManagerPayload: "%v"`, tn.TypeName) + } +} + +func __marshalUpdateFeedsManagerUpdateFeedsManagerUpdateFeedsManagerPayload(v *UpdateFeedsManagerUpdateFeedsManagerUpdateFeedsManagerPayload) ([]byte, error) { + + var typename string + switch v := (*v).(type) { + case *UpdateFeedsManagerUpdateFeedsManagerInputErrors: + typename = "InputErrors" + + result := struct { + TypeName string `json:"__typename"` + *UpdateFeedsManagerUpdateFeedsManagerInputErrors + }{typename, v} + return json.Marshal(result) + case *UpdateFeedsManagerUpdateFeedsManagerNotFoundError: + typename = "NotFoundError" + + result := struct { + TypeName string `json:"__typename"` + *UpdateFeedsManagerUpdateFeedsManagerNotFoundError + }{typename, v} + return json.Marshal(result) + case *UpdateFeedsManagerUpdateFeedsManagerUpdateFeedsManagerSuccess: + typename = "UpdateFeedsManagerSuccess" + + result := struct { + TypeName string `json:"__typename"` + *UpdateFeedsManagerUpdateFeedsManagerUpdateFeedsManagerSuccess + }{typename, v} + return json.Marshal(result) + case nil: + return []byte("null"), nil + default: + return nil, fmt.Errorf( + `unexpected concrete type for UpdateFeedsManagerUpdateFeedsManagerUpdateFeedsManagerPayload: "%T"`, v) + } +} + +// UpdateFeedsManagerUpdateFeedsManagerUpdateFeedsManagerSuccess includes the requested fields of the GraphQL type UpdateFeedsManagerSuccess. +type UpdateFeedsManagerUpdateFeedsManagerUpdateFeedsManagerSuccess struct { + Typename string `json:"__typename"` + FeedsManager UpdateFeedsManagerUpdateFeedsManagerUpdateFeedsManagerSuccessFeedsManager `json:"feedsManager"` +} + +// GetTypename returns UpdateFeedsManagerUpdateFeedsManagerUpdateFeedsManagerSuccess.Typename, and is useful for accessing the field via an interface. +func (v *UpdateFeedsManagerUpdateFeedsManagerUpdateFeedsManagerSuccess) GetTypename() string { + return v.Typename +} + +// GetFeedsManager returns UpdateFeedsManagerUpdateFeedsManagerUpdateFeedsManagerSuccess.FeedsManager, and is useful for accessing the field via an interface. +func (v *UpdateFeedsManagerUpdateFeedsManagerUpdateFeedsManagerSuccess) GetFeedsManager() UpdateFeedsManagerUpdateFeedsManagerUpdateFeedsManagerSuccessFeedsManager { + return v.FeedsManager +} + +// UpdateFeedsManagerUpdateFeedsManagerUpdateFeedsManagerSuccessFeedsManager includes the requested fields of the GraphQL type FeedsManager. +type UpdateFeedsManagerUpdateFeedsManagerUpdateFeedsManagerSuccessFeedsManager struct { + FeedsManagerParts `json:"-"` +} + +// GetId returns UpdateFeedsManagerUpdateFeedsManagerUpdateFeedsManagerSuccessFeedsManager.Id, and is useful for accessing the field via an interface. +func (v *UpdateFeedsManagerUpdateFeedsManagerUpdateFeedsManagerSuccessFeedsManager) GetId() string { + return v.FeedsManagerParts.Id +} + +// GetName returns UpdateFeedsManagerUpdateFeedsManagerUpdateFeedsManagerSuccessFeedsManager.Name, and is useful for accessing the field via an interface. +func (v *UpdateFeedsManagerUpdateFeedsManagerUpdateFeedsManagerSuccessFeedsManager) GetName() string { + return v.FeedsManagerParts.Name +} + +// GetUri returns UpdateFeedsManagerUpdateFeedsManagerUpdateFeedsManagerSuccessFeedsManager.Uri, and is useful for accessing the field via an interface. +func (v *UpdateFeedsManagerUpdateFeedsManagerUpdateFeedsManagerSuccessFeedsManager) GetUri() string { + return v.FeedsManagerParts.Uri +} + +// GetPublicKey returns UpdateFeedsManagerUpdateFeedsManagerUpdateFeedsManagerSuccessFeedsManager.PublicKey, and is useful for accessing the field via an interface. +func (v *UpdateFeedsManagerUpdateFeedsManagerUpdateFeedsManagerSuccessFeedsManager) GetPublicKey() string { + return v.FeedsManagerParts.PublicKey +} + +// GetIsConnectionActive returns UpdateFeedsManagerUpdateFeedsManagerUpdateFeedsManagerSuccessFeedsManager.IsConnectionActive, and is useful for accessing the field via an interface. +func (v *UpdateFeedsManagerUpdateFeedsManagerUpdateFeedsManagerSuccessFeedsManager) GetIsConnectionActive() bool { + return v.FeedsManagerParts.IsConnectionActive +} + +// GetCreatedAt returns UpdateFeedsManagerUpdateFeedsManagerUpdateFeedsManagerSuccessFeedsManager.CreatedAt, and is useful for accessing the field via an interface. +func (v *UpdateFeedsManagerUpdateFeedsManagerUpdateFeedsManagerSuccessFeedsManager) GetCreatedAt() string { + return v.FeedsManagerParts.CreatedAt +} + +func (v *UpdateFeedsManagerUpdateFeedsManagerUpdateFeedsManagerSuccessFeedsManager) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *UpdateFeedsManagerUpdateFeedsManagerUpdateFeedsManagerSuccessFeedsManager + graphql.NoUnmarshalJSON + } + firstPass.UpdateFeedsManagerUpdateFeedsManagerUpdateFeedsManagerSuccessFeedsManager = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + err = json.Unmarshal( + b, &v.FeedsManagerParts) + if err != nil { + return err + } + return nil +} + +type __premarshalUpdateFeedsManagerUpdateFeedsManagerUpdateFeedsManagerSuccessFeedsManager struct { + Id string `json:"id"` + + Name string `json:"name"` + + Uri string `json:"uri"` + + PublicKey string `json:"publicKey"` + + IsConnectionActive bool `json:"isConnectionActive"` + + CreatedAt string `json:"createdAt"` +} + +func (v *UpdateFeedsManagerUpdateFeedsManagerUpdateFeedsManagerSuccessFeedsManager) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *UpdateFeedsManagerUpdateFeedsManagerUpdateFeedsManagerSuccessFeedsManager) __premarshalJSON() (*__premarshalUpdateFeedsManagerUpdateFeedsManagerUpdateFeedsManagerSuccessFeedsManager, error) { + var retval __premarshalUpdateFeedsManagerUpdateFeedsManagerUpdateFeedsManagerSuccessFeedsManager + + retval.Id = v.FeedsManagerParts.Id + retval.Name = v.FeedsManagerParts.Name + retval.Uri = v.FeedsManagerParts.Uri + retval.PublicKey = v.FeedsManagerParts.PublicKey + retval.IsConnectionActive = v.FeedsManagerParts.IsConnectionActive + retval.CreatedAt = v.FeedsManagerParts.CreatedAt + return &retval, nil +} + +type UpdateJobProposalSpecDefinitionInput struct { + Definition string `json:"definition"` +} + +// GetDefinition returns UpdateJobProposalSpecDefinitionInput.Definition, and is useful for accessing the field via an interface. +func (v *UpdateJobProposalSpecDefinitionInput) GetDefinition() string { return v.Definition } + +// UpdateJobProposalSpecDefinitionResponse is returned by UpdateJobProposalSpecDefinition on success. +type UpdateJobProposalSpecDefinitionResponse struct { + UpdateJobProposalSpecDefinition UpdateJobProposalSpecDefinitionUpdateJobProposalSpecDefinitionUpdateJobProposalSpecDefinitionPayload `json:"-"` +} + +// GetUpdateJobProposalSpecDefinition returns UpdateJobProposalSpecDefinitionResponse.UpdateJobProposalSpecDefinition, and is useful for accessing the field via an interface. +func (v *UpdateJobProposalSpecDefinitionResponse) GetUpdateJobProposalSpecDefinition() UpdateJobProposalSpecDefinitionUpdateJobProposalSpecDefinitionUpdateJobProposalSpecDefinitionPayload { + return v.UpdateJobProposalSpecDefinition +} + +func (v *UpdateJobProposalSpecDefinitionResponse) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *UpdateJobProposalSpecDefinitionResponse + UpdateJobProposalSpecDefinition json.RawMessage `json:"updateJobProposalSpecDefinition"` + graphql.NoUnmarshalJSON + } + firstPass.UpdateJobProposalSpecDefinitionResponse = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + { + dst := &v.UpdateJobProposalSpecDefinition + src := firstPass.UpdateJobProposalSpecDefinition + if len(src) != 0 && string(src) != "null" { + err = __unmarshalUpdateJobProposalSpecDefinitionUpdateJobProposalSpecDefinitionUpdateJobProposalSpecDefinitionPayload( + src, dst) + if err != nil { + return fmt.Errorf( + "unable to unmarshal UpdateJobProposalSpecDefinitionResponse.UpdateJobProposalSpecDefinition: %w", err) + } + } + } + return nil +} + +type __premarshalUpdateJobProposalSpecDefinitionResponse struct { + UpdateJobProposalSpecDefinition json.RawMessage `json:"updateJobProposalSpecDefinition"` +} + +func (v *UpdateJobProposalSpecDefinitionResponse) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *UpdateJobProposalSpecDefinitionResponse) __premarshalJSON() (*__premarshalUpdateJobProposalSpecDefinitionResponse, error) { + var retval __premarshalUpdateJobProposalSpecDefinitionResponse + + { + + dst := &retval.UpdateJobProposalSpecDefinition + src := v.UpdateJobProposalSpecDefinition + var err error + *dst, err = __marshalUpdateJobProposalSpecDefinitionUpdateJobProposalSpecDefinitionUpdateJobProposalSpecDefinitionPayload( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal UpdateJobProposalSpecDefinitionResponse.UpdateJobProposalSpecDefinition: %w", err) + } + } + return &retval, nil +} + +// UpdateJobProposalSpecDefinitionUpdateJobProposalSpecDefinitionNotFoundError includes the requested fields of the GraphQL type NotFoundError. +type UpdateJobProposalSpecDefinitionUpdateJobProposalSpecDefinitionNotFoundError struct { + Typename string `json:"__typename"` + Message string `json:"message"` + Code ErrorCode `json:"code"` +} + +// GetTypename returns UpdateJobProposalSpecDefinitionUpdateJobProposalSpecDefinitionNotFoundError.Typename, and is useful for accessing the field via an interface. +func (v *UpdateJobProposalSpecDefinitionUpdateJobProposalSpecDefinitionNotFoundError) GetTypename() string { + return v.Typename +} + +// GetMessage returns UpdateJobProposalSpecDefinitionUpdateJobProposalSpecDefinitionNotFoundError.Message, and is useful for accessing the field via an interface. +func (v *UpdateJobProposalSpecDefinitionUpdateJobProposalSpecDefinitionNotFoundError) GetMessage() string { + return v.Message +} + +// GetCode returns UpdateJobProposalSpecDefinitionUpdateJobProposalSpecDefinitionNotFoundError.Code, and is useful for accessing the field via an interface. +func (v *UpdateJobProposalSpecDefinitionUpdateJobProposalSpecDefinitionNotFoundError) GetCode() ErrorCode { + return v.Code +} + +// UpdateJobProposalSpecDefinitionUpdateJobProposalSpecDefinitionUpdateJobProposalSpecDefinitionPayload includes the requested fields of the GraphQL interface UpdateJobProposalSpecDefinitionPayload. +// +// UpdateJobProposalSpecDefinitionUpdateJobProposalSpecDefinitionUpdateJobProposalSpecDefinitionPayload is implemented by the following types: +// UpdateJobProposalSpecDefinitionUpdateJobProposalSpecDefinitionNotFoundError +// UpdateJobProposalSpecDefinitionUpdateJobProposalSpecDefinitionUpdateJobProposalSpecDefinitionSuccess +type UpdateJobProposalSpecDefinitionUpdateJobProposalSpecDefinitionUpdateJobProposalSpecDefinitionPayload interface { + implementsGraphQLInterfaceUpdateJobProposalSpecDefinitionUpdateJobProposalSpecDefinitionUpdateJobProposalSpecDefinitionPayload() + // GetTypename returns the receiver's concrete GraphQL type-name (see interface doc for possible values). + GetTypename() string +} + +func (v *UpdateJobProposalSpecDefinitionUpdateJobProposalSpecDefinitionNotFoundError) implementsGraphQLInterfaceUpdateJobProposalSpecDefinitionUpdateJobProposalSpecDefinitionUpdateJobProposalSpecDefinitionPayload() { +} +func (v *UpdateJobProposalSpecDefinitionUpdateJobProposalSpecDefinitionUpdateJobProposalSpecDefinitionSuccess) implementsGraphQLInterfaceUpdateJobProposalSpecDefinitionUpdateJobProposalSpecDefinitionUpdateJobProposalSpecDefinitionPayload() { +} + +func __unmarshalUpdateJobProposalSpecDefinitionUpdateJobProposalSpecDefinitionUpdateJobProposalSpecDefinitionPayload(b []byte, v *UpdateJobProposalSpecDefinitionUpdateJobProposalSpecDefinitionUpdateJobProposalSpecDefinitionPayload) error { + if string(b) == "null" { + return nil + } + + var tn struct { + TypeName string `json:"__typename"` + } + err := json.Unmarshal(b, &tn) + if err != nil { + return err + } + + switch tn.TypeName { + case "NotFoundError": + *v = new(UpdateJobProposalSpecDefinitionUpdateJobProposalSpecDefinitionNotFoundError) + return json.Unmarshal(b, *v) + case "UpdateJobProposalSpecDefinitionSuccess": + *v = new(UpdateJobProposalSpecDefinitionUpdateJobProposalSpecDefinitionUpdateJobProposalSpecDefinitionSuccess) + return json.Unmarshal(b, *v) + case "": + return fmt.Errorf( + "response was missing UpdateJobProposalSpecDefinitionPayload.__typename") + default: + return fmt.Errorf( + `unexpected concrete type for UpdateJobProposalSpecDefinitionUpdateJobProposalSpecDefinitionUpdateJobProposalSpecDefinitionPayload: "%v"`, tn.TypeName) + } +} + +func __marshalUpdateJobProposalSpecDefinitionUpdateJobProposalSpecDefinitionUpdateJobProposalSpecDefinitionPayload(v *UpdateJobProposalSpecDefinitionUpdateJobProposalSpecDefinitionUpdateJobProposalSpecDefinitionPayload) ([]byte, error) { + + var typename string + switch v := (*v).(type) { + case *UpdateJobProposalSpecDefinitionUpdateJobProposalSpecDefinitionNotFoundError: + typename = "NotFoundError" + + result := struct { + TypeName string `json:"__typename"` + *UpdateJobProposalSpecDefinitionUpdateJobProposalSpecDefinitionNotFoundError + }{typename, v} + return json.Marshal(result) + case *UpdateJobProposalSpecDefinitionUpdateJobProposalSpecDefinitionUpdateJobProposalSpecDefinitionSuccess: + typename = "UpdateJobProposalSpecDefinitionSuccess" + + result := struct { + TypeName string `json:"__typename"` + *UpdateJobProposalSpecDefinitionUpdateJobProposalSpecDefinitionUpdateJobProposalSpecDefinitionSuccess + }{typename, v} + return json.Marshal(result) + case nil: + return []byte("null"), nil + default: + return nil, fmt.Errorf( + `unexpected concrete type for UpdateJobProposalSpecDefinitionUpdateJobProposalSpecDefinitionUpdateJobProposalSpecDefinitionPayload: "%T"`, v) + } +} + +// UpdateJobProposalSpecDefinitionUpdateJobProposalSpecDefinitionUpdateJobProposalSpecDefinitionSuccess includes the requested fields of the GraphQL type UpdateJobProposalSpecDefinitionSuccess. +type UpdateJobProposalSpecDefinitionUpdateJobProposalSpecDefinitionUpdateJobProposalSpecDefinitionSuccess struct { + Typename string `json:"__typename"` + Spec UpdateJobProposalSpecDefinitionUpdateJobProposalSpecDefinitionUpdateJobProposalSpecDefinitionSuccessSpecJobProposalSpec `json:"spec"` +} + +// GetTypename returns UpdateJobProposalSpecDefinitionUpdateJobProposalSpecDefinitionUpdateJobProposalSpecDefinitionSuccess.Typename, and is useful for accessing the field via an interface. +func (v *UpdateJobProposalSpecDefinitionUpdateJobProposalSpecDefinitionUpdateJobProposalSpecDefinitionSuccess) GetTypename() string { + return v.Typename +} + +// GetSpec returns UpdateJobProposalSpecDefinitionUpdateJobProposalSpecDefinitionUpdateJobProposalSpecDefinitionSuccess.Spec, and is useful for accessing the field via an interface. +func (v *UpdateJobProposalSpecDefinitionUpdateJobProposalSpecDefinitionUpdateJobProposalSpecDefinitionSuccess) GetSpec() UpdateJobProposalSpecDefinitionUpdateJobProposalSpecDefinitionUpdateJobProposalSpecDefinitionSuccessSpecJobProposalSpec { + return v.Spec +} + +// UpdateJobProposalSpecDefinitionUpdateJobProposalSpecDefinitionUpdateJobProposalSpecDefinitionSuccessSpecJobProposalSpec includes the requested fields of the GraphQL type JobProposalSpec. +type UpdateJobProposalSpecDefinitionUpdateJobProposalSpecDefinitionUpdateJobProposalSpecDefinitionSuccessSpecJobProposalSpec struct { + Id string `json:"id"` + Definition string `json:"definition"` + Version int `json:"version"` + Status SpecStatus `json:"status"` + StatusUpdatedAt string `json:"statusUpdatedAt"` + CreatedAt string `json:"createdAt"` + UpdatedAt string `json:"updatedAt"` +} + +// GetId returns UpdateJobProposalSpecDefinitionUpdateJobProposalSpecDefinitionUpdateJobProposalSpecDefinitionSuccessSpecJobProposalSpec.Id, and is useful for accessing the field via an interface. +func (v *UpdateJobProposalSpecDefinitionUpdateJobProposalSpecDefinitionUpdateJobProposalSpecDefinitionSuccessSpecJobProposalSpec) GetId() string { + return v.Id +} + +// GetDefinition returns UpdateJobProposalSpecDefinitionUpdateJobProposalSpecDefinitionUpdateJobProposalSpecDefinitionSuccessSpecJobProposalSpec.Definition, and is useful for accessing the field via an interface. +func (v *UpdateJobProposalSpecDefinitionUpdateJobProposalSpecDefinitionUpdateJobProposalSpecDefinitionSuccessSpecJobProposalSpec) GetDefinition() string { + return v.Definition +} + +// GetVersion returns UpdateJobProposalSpecDefinitionUpdateJobProposalSpecDefinitionUpdateJobProposalSpecDefinitionSuccessSpecJobProposalSpec.Version, and is useful for accessing the field via an interface. +func (v *UpdateJobProposalSpecDefinitionUpdateJobProposalSpecDefinitionUpdateJobProposalSpecDefinitionSuccessSpecJobProposalSpec) GetVersion() int { + return v.Version +} + +// GetStatus returns UpdateJobProposalSpecDefinitionUpdateJobProposalSpecDefinitionUpdateJobProposalSpecDefinitionSuccessSpecJobProposalSpec.Status, and is useful for accessing the field via an interface. +func (v *UpdateJobProposalSpecDefinitionUpdateJobProposalSpecDefinitionUpdateJobProposalSpecDefinitionSuccessSpecJobProposalSpec) GetStatus() SpecStatus { + return v.Status +} + +// GetStatusUpdatedAt returns UpdateJobProposalSpecDefinitionUpdateJobProposalSpecDefinitionUpdateJobProposalSpecDefinitionSuccessSpecJobProposalSpec.StatusUpdatedAt, and is useful for accessing the field via an interface. +func (v *UpdateJobProposalSpecDefinitionUpdateJobProposalSpecDefinitionUpdateJobProposalSpecDefinitionSuccessSpecJobProposalSpec) GetStatusUpdatedAt() string { + return v.StatusUpdatedAt +} + +// GetCreatedAt returns UpdateJobProposalSpecDefinitionUpdateJobProposalSpecDefinitionUpdateJobProposalSpecDefinitionSuccessSpecJobProposalSpec.CreatedAt, and is useful for accessing the field via an interface. +func (v *UpdateJobProposalSpecDefinitionUpdateJobProposalSpecDefinitionUpdateJobProposalSpecDefinitionSuccessSpecJobProposalSpec) GetCreatedAt() string { + return v.CreatedAt +} + +// GetUpdatedAt returns UpdateJobProposalSpecDefinitionUpdateJobProposalSpecDefinitionUpdateJobProposalSpecDefinitionSuccessSpecJobProposalSpec.UpdatedAt, and is useful for accessing the field via an interface. +func (v *UpdateJobProposalSpecDefinitionUpdateJobProposalSpecDefinitionUpdateJobProposalSpecDefinitionSuccessSpecJobProposalSpec) GetUpdatedAt() string { + return v.UpdatedAt +} + +// __ApproveJobProposalSpecInput is used internally by genqlient +type __ApproveJobProposalSpecInput struct { + Id string `json:"id"` + Force bool `json:"force"` +} + +// GetId returns __ApproveJobProposalSpecInput.Id, and is useful for accessing the field via an interface. +func (v *__ApproveJobProposalSpecInput) GetId() string { return v.Id } + +// GetForce returns __ApproveJobProposalSpecInput.Force, and is useful for accessing the field via an interface. +func (v *__ApproveJobProposalSpecInput) GetForce() bool { return v.Force } + +// __CancelJobProposalSpecInput is used internally by genqlient +type __CancelJobProposalSpecInput struct { + Id string `json:"id"` +} + +// GetId returns __CancelJobProposalSpecInput.Id, and is useful for accessing the field via an interface. +func (v *__CancelJobProposalSpecInput) GetId() string { return v.Id } + +// __CreateFeedsManagerChainConfigInput is used internally by genqlient +type __CreateFeedsManagerChainConfigInput struct { + Input CreateFeedsManagerChainConfigInput `json:"input"` +} + +// GetInput returns __CreateFeedsManagerChainConfigInput.Input, and is useful for accessing the field via an interface. +func (v *__CreateFeedsManagerChainConfigInput) GetInput() CreateFeedsManagerChainConfigInput { + return v.Input +} + +// __CreateFeedsManagerInput is used internally by genqlient +type __CreateFeedsManagerInput struct { + Input CreateFeedsManagerInput `json:"input"` +} + +// GetInput returns __CreateFeedsManagerInput.Input, and is useful for accessing the field via an interface. +func (v *__CreateFeedsManagerInput) GetInput() CreateFeedsManagerInput { return v.Input } + +// __GetBridgeInput is used internally by genqlient +type __GetBridgeInput struct { + Id string `json:"id"` +} + +// GetId returns __GetBridgeInput.Id, and is useful for accessing the field via an interface. +func (v *__GetBridgeInput) GetId() string { return v.Id } + +// __GetFeedsManagerInput is used internally by genqlient +type __GetFeedsManagerInput struct { + Id string `json:"id"` +} + +// GetId returns __GetFeedsManagerInput.Id, and is useful for accessing the field via an interface. +func (v *__GetFeedsManagerInput) GetId() string { return v.Id } + +// __GetJobInput is used internally by genqlient +type __GetJobInput struct { + Id string `json:"id"` +} + +// GetId returns __GetJobInput.Id, and is useful for accessing the field via an interface. +func (v *__GetJobInput) GetId() string { return v.Id } + +// __GetJobProposalInput is used internally by genqlient +type __GetJobProposalInput struct { + Id string `json:"id"` +} + +// GetId returns __GetJobProposalInput.Id, and is useful for accessing the field via an interface. +func (v *__GetJobProposalInput) GetId() string { return v.Id } + +// __ListBridgesInput is used internally by genqlient +type __ListBridgesInput struct { + Offset int `json:"offset"` + Limit int `json:"limit"` +} + +// GetOffset returns __ListBridgesInput.Offset, and is useful for accessing the field via an interface. +func (v *__ListBridgesInput) GetOffset() int { return v.Offset } + +// GetLimit returns __ListBridgesInput.Limit, and is useful for accessing the field via an interface. +func (v *__ListBridgesInput) GetLimit() int { return v.Limit } + +// __ListJobsInput is used internally by genqlient +type __ListJobsInput struct { + Offset int `json:"offset"` + Limit int `json:"limit"` +} + +// GetOffset returns __ListJobsInput.Offset, and is useful for accessing the field via an interface. +func (v *__ListJobsInput) GetOffset() int { return v.Offset } + +// GetLimit returns __ListJobsInput.Limit, and is useful for accessing the field via an interface. +func (v *__ListJobsInput) GetLimit() int { return v.Limit } + +// __RejectJobProposalSpecInput is used internally by genqlient +type __RejectJobProposalSpecInput struct { + Id string `json:"id"` +} + +// GetId returns __RejectJobProposalSpecInput.Id, and is useful for accessing the field via an interface. +func (v *__RejectJobProposalSpecInput) GetId() string { return v.Id } + +// __UpdateFeedsManagerInput is used internally by genqlient +type __UpdateFeedsManagerInput struct { + Id string `json:"id"` + Input UpdateFeedsManagerInput `json:"input"` +} + +// GetId returns __UpdateFeedsManagerInput.Id, and is useful for accessing the field via an interface. +func (v *__UpdateFeedsManagerInput) GetId() string { return v.Id } + +// GetInput returns __UpdateFeedsManagerInput.Input, and is useful for accessing the field via an interface. +func (v *__UpdateFeedsManagerInput) GetInput() UpdateFeedsManagerInput { return v.Input } + +// __UpdateJobProposalSpecDefinitionInput is used internally by genqlient +type __UpdateJobProposalSpecDefinitionInput struct { + Id string `json:"id"` + Input UpdateJobProposalSpecDefinitionInput `json:"input"` +} + +// GetId returns __UpdateJobProposalSpecDefinitionInput.Id, and is useful for accessing the field via an interface. +func (v *__UpdateJobProposalSpecDefinitionInput) GetId() string { return v.Id } + +// GetInput returns __UpdateJobProposalSpecDefinitionInput.Input, and is useful for accessing the field via an interface. +func (v *__UpdateJobProposalSpecDefinitionInput) GetInput() UpdateJobProposalSpecDefinitionInput { + return v.Input +} + +// The query or mutation executed by ApproveJobProposalSpec. +const ApproveJobProposalSpec_Operation = ` +mutation ApproveJobProposalSpec ($id: ID!, $force: Boolean) { + approveJobProposalSpec(id: $id, force: $force) { + __typename + ... on ApproveJobProposalSpecSuccess { + spec { + id + definition + version + status + statusUpdatedAt + createdAt + updatedAt + } + } + ... on JobAlreadyExistsError { + message + code + } + ... on NotFoundError { + message + code + } + } +} +` + +func ApproveJobProposalSpec( + ctx_ context.Context, + client_ graphql.Client, + id string, + force bool, +) (*ApproveJobProposalSpecResponse, error) { + req_ := &graphql.Request{ + OpName: "ApproveJobProposalSpec", + Query: ApproveJobProposalSpec_Operation, + Variables: &__ApproveJobProposalSpecInput{ + Id: id, + Force: force, + }, + } + var err_ error + + var data_ ApproveJobProposalSpecResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by CancelJobProposalSpec. +const CancelJobProposalSpec_Operation = ` +mutation CancelJobProposalSpec ($id: ID!) { + cancelJobProposalSpec(id: $id) { + __typename + ... on CancelJobProposalSpecSuccess { + spec { + id + definition + version + status + statusUpdatedAt + createdAt + updatedAt + } + } + ... on NotFoundError { + message + code + } + } +} +` + +func CancelJobProposalSpec( + ctx_ context.Context, + client_ graphql.Client, + id string, +) (*CancelJobProposalSpecResponse, error) { + req_ := &graphql.Request{ + OpName: "CancelJobProposalSpec", + Query: CancelJobProposalSpec_Operation, + Variables: &__CancelJobProposalSpecInput{ + Id: id, + }, + } + var err_ error + + var data_ CancelJobProposalSpecResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by CreateFeedsManager. +const CreateFeedsManager_Operation = ` +mutation CreateFeedsManager ($input: CreateFeedsManagerInput!) { + createFeedsManager(input: $input) { + __typename + ... on CreateFeedsManagerSuccess { + feedsManager { + ... FeedsManagerParts + } + } + ... on SingleFeedsManagerError { + message + code + } + ... on NotFoundError { + message + code + } + ... on InputErrors { + errors { + message + code + path + } + } + } +} +fragment FeedsManagerParts on FeedsManager { + id + name + uri + publicKey + isConnectionActive + createdAt +} +` + +func CreateFeedsManager( + ctx_ context.Context, + client_ graphql.Client, + input CreateFeedsManagerInput, +) (*CreateFeedsManagerResponse, error) { + req_ := &graphql.Request{ + OpName: "CreateFeedsManager", + Query: CreateFeedsManager_Operation, + Variables: &__CreateFeedsManagerInput{ + Input: input, + }, + } + var err_ error + + var data_ CreateFeedsManagerResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by CreateFeedsManagerChainConfig. +const CreateFeedsManagerChainConfig_Operation = ` +mutation CreateFeedsManagerChainConfig ($input: CreateFeedsManagerChainConfigInput!) { + createFeedsManagerChainConfig(input: $input) { + __typename + ... on CreateFeedsManagerChainConfigSuccess { + chainConfig { + id + chainID + chainType + accountAddr + adminAddr + fluxMonitorJobConfig { + enabled + } + ocr1JobConfig { + enabled + isBootstrap + multiaddr + p2pPeerID + keyBundleID + } + ocr2JobConfig { + enabled + isBootstrap + multiaddr + forwarderAddress + p2pPeerID + keyBundleID + plugins { + commit + execute + median + mercury + rebalancer + } + } + } + } + ... on NotFoundError { + message + code + } + ... on InputErrors { + errors { + message + path + } + } + } +} +` + +// createFeedsManagerChainConfig.graphql +func CreateFeedsManagerChainConfig( + ctx_ context.Context, + client_ graphql.Client, + input CreateFeedsManagerChainConfigInput, +) (*CreateFeedsManagerChainConfigResponse, error) { + req_ := &graphql.Request{ + OpName: "CreateFeedsManagerChainConfig", + Query: CreateFeedsManagerChainConfig_Operation, + Variables: &__CreateFeedsManagerChainConfigInput{ + Input: input, + }, + } + var err_ error + + var data_ CreateFeedsManagerChainConfigResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by FetchAccounts. +const FetchAccounts_Operation = ` +query FetchAccounts { + ethKeys { + results { + address + isDisabled + chain { + id + enabled + } + ethBalance + linkBalance + } + } +} +` + +func FetchAccounts( + ctx_ context.Context, + client_ graphql.Client, +) (*FetchAccountsResponse, error) { + req_ := &graphql.Request{ + OpName: "FetchAccounts", + Query: FetchAccounts_Operation, + } + var err_ error + + var data_ FetchAccountsResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by FetchCSAKeys. +const FetchCSAKeys_Operation = ` +query FetchCSAKeys { + csaKeys { + results { + id + publicKey + version + } + } +} +` + +func FetchCSAKeys( + ctx_ context.Context, + client_ graphql.Client, +) (*FetchCSAKeysResponse, error) { + req_ := &graphql.Request{ + OpName: "FetchCSAKeys", + Query: FetchCSAKeys_Operation, + } + var err_ error + + var data_ FetchCSAKeysResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by FetchOCR2KeyBundles. +const FetchOCR2KeyBundles_Operation = ` +query FetchOCR2KeyBundles { + ocr2KeyBundles { + results { + id + chainType + configPublicKey + onChainPublicKey + offChainPublicKey + } + } +} +` + +func FetchOCR2KeyBundles( + ctx_ context.Context, + client_ graphql.Client, +) (*FetchOCR2KeyBundlesResponse, error) { + req_ := &graphql.Request{ + OpName: "FetchOCR2KeyBundles", + Query: FetchOCR2KeyBundles_Operation, + } + var err_ error + + var data_ FetchOCR2KeyBundlesResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by FetchP2PKeys. +const FetchP2PKeys_Operation = ` +query FetchP2PKeys { + p2pKeys { + results { + id + peerID + publicKey + } + } +} +` + +func FetchP2PKeys( + ctx_ context.Context, + client_ graphql.Client, +) (*FetchP2PKeysResponse, error) { + req_ := &graphql.Request{ + OpName: "FetchP2PKeys", + Query: FetchP2PKeys_Operation, + } + var err_ error + + var data_ FetchP2PKeysResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by GetBridge. +const GetBridge_Operation = ` +query GetBridge ($id: ID!) { + bridge(id: $id) { + __typename + ... BridgeParts + ... on NotFoundError { + message + code + } + } +} +fragment BridgeParts on Bridge { + id + name + url + confirmations + outgoingToken + minimumContractPayment + createdAt +} +` + +func GetBridge( + ctx_ context.Context, + client_ graphql.Client, + id string, +) (*GetBridgeResponse, error) { + req_ := &graphql.Request{ + OpName: "GetBridge", + Query: GetBridge_Operation, + Variables: &__GetBridgeInput{ + Id: id, + }, + } + var err_ error + + var data_ GetBridgeResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by GetFeedsManager. +const GetFeedsManager_Operation = ` +query GetFeedsManager ($id: ID!) { + feedsManager(id: $id) { + __typename + ... FeedsManagerParts + ... on NotFoundError { + message + code + } + } +} +fragment FeedsManagerParts on FeedsManager { + id + name + uri + publicKey + isConnectionActive + createdAt +} +` + +func GetFeedsManager( + ctx_ context.Context, + client_ graphql.Client, + id string, +) (*GetFeedsManagerResponse, error) { + req_ := &graphql.Request{ + OpName: "GetFeedsManager", + Query: GetFeedsManager_Operation, + Variables: &__GetFeedsManagerInput{ + Id: id, + }, + } + var err_ error + + var data_ GetFeedsManagerResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by GetJob. +const GetJob_Operation = ` +query GetJob ($id: ID!) { + job(id: $id) { + __typename + ... JobParts + ... on NotFoundError { + message + code + } + } +} +fragment JobParts on Job { + id + name + schemaVersion + gasLimit + forwardingAllowed + maxTaskDuration + externalJobID + type + spec { + __typename + ... on OCR2Spec { + ... OCR2Spec + } + } + observationSource + errors { + id + description + occurrences + createdAt + updatedAt + } +} +fragment OCR2Spec on OCR2Spec { + blockchainTimeout + contractID + contractConfigConfirmations + contractConfigTrackerPollInterval + createdAt + ocrKeyBundleID + monitoringEndpoint + p2pv2Bootstrappers + relay + relayConfig + transmitterID + pluginType + pluginConfig +} +` + +func GetJob( + ctx_ context.Context, + client_ graphql.Client, + id string, +) (*GetJobResponse, error) { + req_ := &graphql.Request{ + OpName: "GetJob", + Query: GetJob_Operation, + Variables: &__GetJobInput{ + Id: id, + }, + } + var err_ error + + var data_ GetJobResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by GetJobProposal. +const GetJobProposal_Operation = ` +query GetJobProposal ($id: ID!) { + jobProposal(id: $id) { + __typename + ... on JobProposal { + id + name + status + remoteUUID + externalJobID + jobID + feedsManager { + ... FeedsManagerParts + } + multiAddrs + pendingUpdate + specs { + id + definition + version + status + statusUpdatedAt + createdAt + updatedAt + } + latestSpec { + id + definition + version + status + statusUpdatedAt + createdAt + updatedAt + } + } + ... on NotFoundError { + message + code + } + } +} +fragment FeedsManagerParts on FeedsManager { + id + name + uri + publicKey + isConnectionActive + createdAt +} +` + +func GetJobProposal( + ctx_ context.Context, + client_ graphql.Client, + id string, +) (*GetJobProposalResponse, error) { + req_ := &graphql.Request{ + OpName: "GetJobProposal", + Query: GetJobProposal_Operation, + Variables: &__GetJobProposalInput{ + Id: id, + }, + } + var err_ error + + var data_ GetJobProposalResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by ListBridges. +const ListBridges_Operation = ` +query ListBridges ($offset: Int, $limit: Int) { + bridges(offset: $offset, limit: $limit) { + results { + ... BridgeParts + } + metadata { + total + } + } +} +fragment BridgeParts on Bridge { + id + name + url + confirmations + outgoingToken + minimumContractPayment + createdAt +} +` + +func ListBridges( + ctx_ context.Context, + client_ graphql.Client, + offset int, + limit int, +) (*ListBridgesResponse, error) { + req_ := &graphql.Request{ + OpName: "ListBridges", + Query: ListBridges_Operation, + Variables: &__ListBridgesInput{ + Offset: offset, + Limit: limit, + }, + } + var err_ error + + var data_ ListBridgesResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by ListFeedsManagers. +const ListFeedsManagers_Operation = ` +query ListFeedsManagers { + feedsManagers { + results { + ... FeedsManagerParts + } + } +} +fragment FeedsManagerParts on FeedsManager { + id + name + uri + publicKey + isConnectionActive + createdAt +} +` + +func ListFeedsManagers( + ctx_ context.Context, + client_ graphql.Client, +) (*ListFeedsManagersResponse, error) { + req_ := &graphql.Request{ + OpName: "ListFeedsManagers", + Query: ListFeedsManagers_Operation, + } + var err_ error + + var data_ ListFeedsManagersResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by ListJobs. +const ListJobs_Operation = ` +query ListJobs ($offset: Int, $limit: Int) { + jobs(offset: $offset, limit: $limit) { + results { + ... JobParts + } + metadata { + total + } + } +} +fragment JobParts on Job { + id + name + schemaVersion + gasLimit + forwardingAllowed + maxTaskDuration + externalJobID + type + spec { + __typename + ... on OCR2Spec { + ... OCR2Spec + } + } + observationSource + errors { + id + description + occurrences + createdAt + updatedAt + } +} +fragment OCR2Spec on OCR2Spec { + blockchainTimeout + contractID + contractConfigConfirmations + contractConfigTrackerPollInterval + createdAt + ocrKeyBundleID + monitoringEndpoint + p2pv2Bootstrappers + relay + relayConfig + transmitterID + pluginType + pluginConfig +} +` + +func ListJobs( + ctx_ context.Context, + client_ graphql.Client, + offset int, + limit int, +) (*ListJobsResponse, error) { + req_ := &graphql.Request{ + OpName: "ListJobs", + Query: ListJobs_Operation, + Variables: &__ListJobsInput{ + Offset: offset, + Limit: limit, + }, + } + var err_ error + + var data_ ListJobsResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by RejectJobProposalSpec. +const RejectJobProposalSpec_Operation = ` +mutation RejectJobProposalSpec ($id: ID!) { + rejectJobProposalSpec(id: $id) { + __typename + ... on RejectJobProposalSpecSuccess { + spec { + id + definition + version + status + statusUpdatedAt + createdAt + updatedAt + } + } + ... on NotFoundError { + message + code + } + } +} +` + +func RejectJobProposalSpec( + ctx_ context.Context, + client_ graphql.Client, + id string, +) (*RejectJobProposalSpecResponse, error) { + req_ := &graphql.Request{ + OpName: "RejectJobProposalSpec", + Query: RejectJobProposalSpec_Operation, + Variables: &__RejectJobProposalSpecInput{ + Id: id, + }, + } + var err_ error + + var data_ RejectJobProposalSpecResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by UpdateFeedsManager. +const UpdateFeedsManager_Operation = ` +mutation UpdateFeedsManager ($id: ID!, $input: UpdateFeedsManagerInput!) { + updateFeedsManager(id: $id, input: $input) { + __typename + ... on UpdateFeedsManagerSuccess { + feedsManager { + ... FeedsManagerParts + } + } + ... on NotFoundError { + message + code + } + ... on InputErrors { + errors { + message + code + path + } + } + } +} +fragment FeedsManagerParts on FeedsManager { + id + name + uri + publicKey + isConnectionActive + createdAt +} +` + +func UpdateFeedsManager( + ctx_ context.Context, + client_ graphql.Client, + id string, + input UpdateFeedsManagerInput, +) (*UpdateFeedsManagerResponse, error) { + req_ := &graphql.Request{ + OpName: "UpdateFeedsManager", + Query: UpdateFeedsManager_Operation, + Variables: &__UpdateFeedsManagerInput{ + Id: id, + Input: input, + }, + } + var err_ error + + var data_ UpdateFeedsManagerResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by UpdateJobProposalSpecDefinition. +const UpdateJobProposalSpecDefinition_Operation = ` +mutation UpdateJobProposalSpecDefinition ($id: ID!, $input: UpdateJobProposalSpecDefinitionInput!) { + updateJobProposalSpecDefinition(id: $id, input: $input) { + __typename + ... on UpdateJobProposalSpecDefinitionSuccess { + spec { + id + definition + version + status + statusUpdatedAt + createdAt + updatedAt + } + } + ... on NotFoundError { + message + code + } + } +} +` + +func UpdateJobProposalSpecDefinition( + ctx_ context.Context, + client_ graphql.Client, + id string, + input UpdateJobProposalSpecDefinitionInput, +) (*UpdateJobProposalSpecDefinitionResponse, error) { + req_ := &graphql.Request{ + OpName: "UpdateJobProposalSpecDefinition", + Query: UpdateJobProposalSpecDefinition_Operation, + Variables: &__UpdateJobProposalSpecDefinitionInput{ + Id: id, + Input: input, + }, + } + var err_ error + + var data_ UpdateJobProposalSpecDefinitionResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} diff --git a/integration-tests/web/sdk/internal/genqlient.graphql b/integration-tests/web/sdk/internal/genqlient.graphql new file mode 100644 index 00000000000..cd1912b88cf --- /dev/null +++ b/integration-tests/web/sdk/internal/genqlient.graphql @@ -0,0 +1,421 @@ +##################### +# CSA Keys +##################### + +query FetchCSAKeys { + csaKeys { + results { + id + publicKey + version + } + } +} + +##################### +# P2P Keys +##################### + +query FetchP2PKeys { + p2pKeys { + results { + id + peerID + publicKey + } + } +} + +##################### +# ethKeys +##################### + +query FetchAccounts { + ethKeys { + results { + address + isDisabled + chain { + id + enabled + } + ethBalance + linkBalance + } + } +} + +##################### +# ocr2KeyBundles +##################### + +query FetchOCR2KeyBundles { + ocr2KeyBundles { + results { + id + chainType + configPublicKey + onChainPublicKey + offChainPublicKey + } + } +} + + +##################### +# Jobs and Job Proposals +##################### +fragment OCR2Spec on OCR2Spec { + blockchainTimeout + contractID + contractConfigConfirmations + contractConfigTrackerPollInterval + createdAt + ocrKeyBundleID + monitoringEndpoint + p2pv2Bootstrappers + relay + relayConfig + transmitterID + pluginType + pluginConfig +} + +fragment JobParts on Job { + id + name + schemaVersion + gasLimit + forwardingAllowed + maxTaskDuration + externalJobID + type + spec { + ... on OCR2Spec { + ...OCR2Spec + } + } + observationSource + errors { + id + description + occurrences + createdAt + updatedAt + } +} + +query GetJob($id: ID!) { + job(id: $id) { + ...JobParts + ... on NotFoundError { + message + code + } + } +} + +query ListJobs($offset: Int, $limit: Int) { + jobs(offset: $offset, limit: $limit) { + results { + ...JobParts + } + metadata { + total + } + } +} + +query GetJobProposal($id: ID!) { + jobProposal(id: $id) { + ... on JobProposal { + id + name + status + remoteUUID + externalJobID + jobID + feedsManager { + ...FeedsManagerParts + } + multiAddrs + pendingUpdate + specs { + id + definition + version + status + statusUpdatedAt + createdAt + updatedAt + } + latestSpec { + id + definition + version + status + statusUpdatedAt + createdAt + updatedAt + } + } + ... on NotFoundError { + message + code + } + } +} + +##################### +# Bridges +##################### + +fragment BridgeParts on Bridge { + id + name + url + confirmations + outgoingToken + minimumContractPayment + createdAt +} + +query ListBridges($offset: Int, $limit: Int) { + bridges(offset: $offset, limit: $limit) { + results { + ...BridgeParts + } + metadata { + total + } + } +} + +query GetBridge($id: ID!) { + bridge(id: $id) { + ...BridgeParts + ... on NotFoundError { + message + code + } + } +} + +##################### +# Feeds Manager +##################### + +fragment FeedsManagerParts on FeedsManager { + id + name + uri + publicKey + isConnectionActive + createdAt +} + +query GetFeedsManager($id: ID!) { + feedsManager(id: $id) { + ...FeedsManagerParts + ... on NotFoundError { + message + code + } + } +} + +query ListFeedsManagers { + feedsManagers { + results { + ...FeedsManagerParts + } + } +} + +mutation CreateFeedsManager($input: CreateFeedsManagerInput!) { + createFeedsManager(input: $input) { + ... on CreateFeedsManagerSuccess { + feedsManager { + ...FeedsManagerParts + } + } + ... on SingleFeedsManagerError { + message + code + } + ... on NotFoundError { + message + code + } + ... on InputErrors { + errors { + message + code + path + } + } + } +} + +mutation UpdateFeedsManager($id: ID!, $input: UpdateFeedsManagerInput!) { + updateFeedsManager(id: $id, input: $input) { + ... on UpdateFeedsManagerSuccess { + feedsManager { + ...FeedsManagerParts + } + } + ... on NotFoundError { + message + code + } + ... on InputErrors { + errors { + message + code + path + } + } + } +} + +# createFeedsManagerChainConfig.graphql +mutation CreateFeedsManagerChainConfig($input: CreateFeedsManagerChainConfigInput!) { + createFeedsManagerChainConfig(input: $input) { + ... on CreateFeedsManagerChainConfigSuccess { + chainConfig { + id + chainID + chainType + accountAddr + adminAddr + fluxMonitorJobConfig { + enabled + } + ocr1JobConfig { + enabled + isBootstrap + multiaddr + p2pPeerID + keyBundleID + } + ocr2JobConfig { + enabled + isBootstrap + multiaddr + forwarderAddress + p2pPeerID + keyBundleID + plugins { + commit + execute + median + mercury + rebalancer + } + } + } + } + ... on NotFoundError { + message + code + } + ... on InputErrors { + errors { + message + path + } + } + } +} + + +##################### +# Job Proposals +##################### + +mutation ApproveJobProposalSpec($id: ID!, $force: Boolean) { + approveJobProposalSpec(id: $id, force: $force) { + ... on ApproveJobProposalSpecSuccess { + spec { + id + definition + version + status + statusUpdatedAt + createdAt + updatedAt + } + } + ... on JobAlreadyExistsError { + message + code + } + ... on NotFoundError { + message + code + } + } +} + +mutation CancelJobProposalSpec($id: ID!) { + cancelJobProposalSpec(id: $id) { + ... on CancelJobProposalSpecSuccess { + spec { + id + definition + version + status + statusUpdatedAt + createdAt + updatedAt + } + } + ... on NotFoundError { + message + code + } + } +} + +mutation RejectJobProposalSpec($id: ID!) { + rejectJobProposalSpec(id: $id) { + ... on RejectJobProposalSpecSuccess { + spec { + id + definition + version + status + statusUpdatedAt + createdAt + updatedAt + } + } + ... on NotFoundError { + message + code + } + } +} + +mutation UpdateJobProposalSpecDefinition( + $id: ID! + $input: UpdateJobProposalSpecDefinitionInput! +) { + updateJobProposalSpecDefinition(id: $id, input: $input) { + ... on UpdateJobProposalSpecDefinitionSuccess { + spec { + id + definition + version + status + statusUpdatedAt + createdAt + updatedAt + } + } + ... on NotFoundError { + message + code + } + } +} diff --git a/integration-tests/web/sdk/internal/schema.graphql b/integration-tests/web/sdk/internal/schema.graphql new file mode 100644 index 00000000000..be09d61ec78 --- /dev/null +++ b/integration-tests/web/sdk/internal/schema.graphql @@ -0,0 +1,1054 @@ +scalar Time +scalar Map +scalar Bytes + +schema { + query: Query + mutation: Mutation +} + +type Query { + bridge(id: ID!): BridgePayload! + bridges(offset: Int, limit: Int): BridgesPayload! + chain(id: ID!): ChainPayload! + chains(offset: Int, limit: Int): ChainsPayload! + configv2: ConfigV2Payload! + csaKeys: CSAKeysPayload! + ethKeys: EthKeysPayload! + ethTransaction(hash: ID!): EthTransactionPayload! + ethTransactions(offset: Int, limit: Int): EthTransactionsPayload! + ethTransactionsAttempts(offset: Int, limit: Int): EthTransactionAttemptsPayload! + features: FeaturesPayload! + feedsManager(id: ID!): FeedsManagerPayload! + feedsManagers: FeedsManagersPayload! + globalLogLevel: GlobalLogLevelPayload! + job(id: ID!): JobPayload! + jobs(offset: Int, limit: Int): JobsPayload! + jobProposal(id: ID!): JobProposalPayload! + jobRun(id: ID!): JobRunPayload! + jobRuns(offset: Int, limit: Int): JobRunsPayload! + node(id: ID!): NodePayload! + nodes(offset: Int, limit: Int): NodesPayload! + ocrKeyBundles: OCRKeyBundlesPayload! + ocr2KeyBundles: OCR2KeyBundlesPayload! + p2pKeys: P2PKeysPayload! + solanaKeys: SolanaKeysPayload! + sqlLogging: GetSQLLoggingPayload! + vrfKey(id: ID!): VRFKeyPayload! + vrfKeys: VRFKeysPayload! +} + +type Mutation { + approveJobProposalSpec(id: ID!, force: Boolean): ApproveJobProposalSpecPayload! + cancelJobProposalSpec(id: ID!): CancelJobProposalSpecPayload! + createAPIToken(input: CreateAPITokenInput!): CreateAPITokenPayload! + createBridge(input: CreateBridgeInput!): CreateBridgePayload! + createCSAKey: CreateCSAKeyPayload! + createFeedsManager(input: CreateFeedsManagerInput!): CreateFeedsManagerPayload! + createFeedsManagerChainConfig(input: CreateFeedsManagerChainConfigInput!): CreateFeedsManagerChainConfigPayload! + createJob(input: CreateJobInput!): CreateJobPayload! + createOCRKeyBundle: CreateOCRKeyBundlePayload! + createOCR2KeyBundle(chainType: OCR2ChainType!): CreateOCR2KeyBundlePayload! + createP2PKey: CreateP2PKeyPayload! + deleteAPIToken(input: DeleteAPITokenInput!): DeleteAPITokenPayload! + deleteBridge(id: ID!): DeleteBridgePayload! + deleteCSAKey(id: ID!): DeleteCSAKeyPayload! + deleteFeedsManagerChainConfig(id: ID!): DeleteFeedsManagerChainConfigPayload! + deleteJob(id: ID!): DeleteJobPayload! + deleteOCRKeyBundle(id: ID!): DeleteOCRKeyBundlePayload! + deleteOCR2KeyBundle(id: ID!): DeleteOCR2KeyBundlePayload! + deleteP2PKey(id: ID!): DeleteP2PKeyPayload! + createVRFKey: CreateVRFKeyPayload! + deleteVRFKey(id: ID!): DeleteVRFKeyPayload! + dismissJobError(id: ID!): DismissJobErrorPayload! + rejectJobProposalSpec(id: ID!): RejectJobProposalSpecPayload! + runJob(id: ID!): RunJobPayload! + setGlobalLogLevel(level: LogLevel!): SetGlobalLogLevelPayload! + setSQLLogging(input: SetSQLLoggingInput!): SetSQLLoggingPayload! + updateBridge(id: ID!, input: UpdateBridgeInput!): UpdateBridgePayload! + updateFeedsManager(id: ID!, input: UpdateFeedsManagerInput!): UpdateFeedsManagerPayload! + updateFeedsManagerChainConfig(id: ID!, input: UpdateFeedsManagerChainConfigInput!): UpdateFeedsManagerChainConfigPayload! + updateJobProposalSpecDefinition(id: ID!, input: UpdateJobProposalSpecDefinitionInput!): UpdateJobProposalSpecDefinitionPayload! + updateUserPassword(input: UpdatePasswordInput!): UpdatePasswordPayload! +} +type APIToken { + accessKey: String! + secret: String! +} + +input CreateAPITokenInput { + password: String! +} + +type CreateAPITokenSuccess { + token: APIToken! +} + +union CreateAPITokenPayload = CreateAPITokenSuccess | InputErrors + +input DeleteAPITokenInput { + password: String! +} + +type DeleteAPITokenResult { + accessKey: String! +} + +type DeleteAPITokenSuccess { + token: DeleteAPITokenResult! +} + +union DeleteAPITokenPayload = DeleteAPITokenSuccess | InputErrors +type Bridge { + id: ID! + name: String! + url: String! + confirmations: Int! + outgoingToken: String! + minimumContractPayment: String! + createdAt: Time! +} + +# BridgePayload defines the response to fetch a single bridge by name +union BridgePayload = Bridge | NotFoundError + +# BridgesPayload defines the response when fetching a page of bridges +type BridgesPayload implements PaginatedPayload { + results: [Bridge!]! + metadata: PaginationMetadata! +} + +# CreateBridgeInput defines the input to create a bridge +input CreateBridgeInput { + name: String! + url: String! + confirmations: Int! + minimumContractPayment: String! +} + +# CreateBridgeSuccess defines the success response when creating a bridge +type CreateBridgeSuccess { + bridge: Bridge! + incomingToken: String! +} + +# CreateBridgeInput defines the response when creating a bridge +union CreateBridgePayload = CreateBridgeSuccess + +# UpdateBridgeInput defines the input to update a bridge +input UpdateBridgeInput { + name: String! + url: String! + confirmations: Int! + minimumContractPayment: String! +} + +# UpdateBridgeSuccess defines the success response when updating a bridge +type UpdateBridgeSuccess { + bridge: Bridge! +} + +# CreateBridgeInput defines the response when updating a bridge +union UpdateBridgePayload = UpdateBridgeSuccess | NotFoundError + +type DeleteBridgeSuccess { + bridge: Bridge! +} + +type DeleteBridgeInvalidNameError implements Error { + code: ErrorCode! + message: String! +} + +type DeleteBridgeConflictError implements Error { + code: ErrorCode! + message: String! +} + +union DeleteBridgePayload = DeleteBridgeSuccess + | DeleteBridgeInvalidNameError + | DeleteBridgeConflictError + | NotFoundError +type Chain { + id: ID! + enabled: Boolean! + config: String! +} + +union ChainPayload = Chain | NotFoundError + +type ChainsPayload implements PaginatedPayload { + results: [Chain!]! + metadata: PaginationMetadata! +} +type ConfigV2Payload { + user: String! + effective: String! +} +type CSAKey { + id: ID! + publicKey: String! + version: Int! +} + +type CSAKeysPayload { + results: [CSAKey!]! +} + +type CreateCSAKeySuccess { + csaKey: CSAKey! +} + +type CSAKeyExistsError implements Error { + message: String! + code: ErrorCode! +} + +union CreateCSAKeyPayload = CreateCSAKeySuccess | CSAKeyExistsError + +type DeleteCSAKeySuccess { + csaKey: CSAKey! +} + +union DeleteCSAKeyPayload = DeleteCSAKeySuccess | NotFoundError +enum ErrorCode { + NOT_FOUND + INVALID_INPUT + UNPROCESSABLE +} + +interface Error { + message: String! + code: ErrorCode! +} + +type NotFoundError implements Error { + message: String! + code: ErrorCode! +} + +type InputError implements Error { + message: String! + code: ErrorCode! + path: String! + } + +type InputErrors { + errors: [InputError!]! +} +type EthKey { + address: String! + isDisabled: Boolean! + createdAt: Time! + updatedAt: Time! + chain: Chain! + ethBalance: String + linkBalance: String + maxGasPriceWei: String +} + +type EthKeysPayload { + results: [EthKey!]! +} +type EthTransaction { + state: String! + data: Bytes! + from: String! + to: String! + gasLimit: String! + value: String! + evmChainID: ID! + nonce: String + gasPrice: String! + hash: String! + hex: String! + sentAt: String + chain: Chain! + attempts: [EthTransactionAttempt!]! +} + +union EthTransactionPayload = EthTransaction | NotFoundError + +type EthTransactionsPayload implements PaginatedPayload { + results: [EthTransaction!]! + metadata: PaginationMetadata! +} +type EthTransactionAttempt { + gasPrice: String! + hash: String! + hex: String! + sentAt: String +} + +type EthTransactionAttemptsPayload implements PaginatedPayload { + results: [EthTransactionAttempt!]! + metadata: PaginationMetadata! +} +type Features { + csa: Boolean! + feedsManager: Boolean! + multiFeedsManagers: Boolean! +} + +# FeaturesPayload defines the response of fetching the features availability in the UI +union FeaturesPayload = Features +enum JobType { + FLUX_MONITOR + OCR + OCR2 +} + +type Plugins { + commit: Boolean! + execute: Boolean! + median: Boolean! + mercury: Boolean! + rebalancer: Boolean! +} + +type FeedsManager { + id: ID! + name: String! + uri: String! + publicKey: String! + jobProposals: [JobProposal!]! + isConnectionActive: Boolean! + createdAt: Time! + chainConfigs: [FeedsManagerChainConfig!]! +} + +type FeedsManagerChainConfig { + id: ID! + chainID: String! + chainType: String! + accountAddr: String! + accountAddrPubKey: String + adminAddr: String! + fluxMonitorJobConfig: FluxMonitorJobConfig! + ocr1JobConfig: OCR1JobConfig! + ocr2JobConfig: OCR2JobConfig! +} + +type FluxMonitorJobConfig { + enabled: Boolean! +} + +type OCR1JobConfig { + enabled: Boolean! + isBootstrap: Boolean! + multiaddr: String + p2pPeerID: String + keyBundleID: String +} + +type OCR2JobConfig { + enabled: Boolean! + isBootstrap: Boolean! + multiaddr: String + forwarderAddress: String + p2pPeerID: String + keyBundleID: String + plugins: Plugins! +} + +# FeedsManagerPayload defines the response to fetch a single feeds manager by id +union FeedsManagerPayload = FeedsManager | NotFoundError + +# FeedsManagersPayload defines the response when fetching feeds managers +type FeedsManagersPayload { + results: [FeedsManager!]! +} + +input CreateFeedsManagerInput { + name: String! + uri: String! + publicKey: String! +} + +# CreateFeedsManagerSuccess defines the success response when creating a feeds +# manager +type CreateFeedsManagerSuccess { + feedsManager: FeedsManager! +} + +type DuplicateFeedsManagerError implements Error { + message: String! + code: ErrorCode! +} + +# DEPRECATED: No longer used since we now support multiple feeds manager. +# Keeping this to avoid breaking change. +type SingleFeedsManagerError implements Error { + message: String! + code: ErrorCode! +} + +# CreateFeedsManagerPayload defines the response when creating a feeds manager +union CreateFeedsManagerPayload = CreateFeedsManagerSuccess + | DuplicateFeedsManagerError + | SingleFeedsManagerError # // TODO: delete once multiple feeds managers support is released + | NotFoundError + | InputErrors + +input UpdateFeedsManagerInput { + name: String! + uri: String! + publicKey: String! +} + +# UpdateFeedsManagerSuccess defines the success response when updating a feeds +# manager +type UpdateFeedsManagerSuccess { + feedsManager: FeedsManager! +} + +# UpdateFeedsManagerPayload defines the response when updating a feeds manager +union UpdateFeedsManagerPayload = UpdateFeedsManagerSuccess + | NotFoundError + | InputErrors + +input CreateFeedsManagerChainConfigInput { + feedsManagerID: ID! + chainID: String! + chainType: String! + accountAddr: String! + accountAddrPubKey: String + adminAddr: String! + fluxMonitorEnabled: Boolean! + ocr1Enabled: Boolean! + ocr1IsBootstrap: Boolean + ocr1Multiaddr: String + ocr1P2PPeerID: String + ocr1KeyBundleID: String + ocr2Enabled: Boolean! + ocr2IsBootstrap: Boolean + ocr2Multiaddr: String + ocr2ForwarderAddress: String + ocr2P2PPeerID: String + ocr2KeyBundleID: String + ocr2Plugins: String! +} + +# CreateFeedsManagerChainConfigSuccess defines the success response when +# creating a chain config for a feeds manager. +type CreateFeedsManagerChainConfigSuccess { + chainConfig: FeedsManagerChainConfig! +} + +# CreateFeedsManagerChainConfigPayload defines the response when creating a +# feeds manager chain config. +union CreateFeedsManagerChainConfigPayload = CreateFeedsManagerChainConfigSuccess + | NotFoundError + | InputErrors + +# DeleteFeedsManagerChainConfigSuccess defines the success response when +# deleting a chain config for a feeds manager. +type DeleteFeedsManagerChainConfigSuccess { + chainConfig: FeedsManagerChainConfig! +} + +# DeleteFeedsManagerChainConfigPayload defines the response when creating a +# feeds manager chain config. +union DeleteFeedsManagerChainConfigPayload = DeleteFeedsManagerChainConfigSuccess + | NotFoundError + +input UpdateFeedsManagerChainConfigInput { + accountAddr: String! + accountAddrPubKey: String + adminAddr: String! + fluxMonitorEnabled: Boolean! + ocr1Enabled: Boolean! + ocr1IsBootstrap: Boolean + ocr1Multiaddr: String + ocr1P2PPeerID: String + ocr1KeyBundleID: String + ocr2Enabled: Boolean! + ocr2IsBootstrap: Boolean + ocr2Multiaddr: String + ocr2ForwarderAddress: String + ocr2P2PPeerID: String + ocr2KeyBundleID: String + ocr2Plugins: String! +} + +# UpdateFeedsManagerChainConfigSuccess defines the success response when +# updating a chain config for a feeds manager. +type UpdateFeedsManagerChainConfigSuccess { + chainConfig: FeedsManagerChainConfig! +} + +# UpdateFeedsManagerChainConfigPayload defines the response when updating a +# feeds manager chain config. +union UpdateFeedsManagerChainConfigPayload = UpdateFeedsManagerChainConfigSuccess + | NotFoundError + | InputErrors +type Job { + id: ID! + name: String! + schemaVersion: Int! + gasLimit: Int + forwardingAllowed: Boolean + maxTaskDuration: String! + externalJobID: String! + type: String! + spec: JobSpec! + runs(offset: Int, limit: Int): JobRunsPayload! + observationSource: String! + errors: [JobError!]! + createdAt: Time! +} + +# JobsPayload defines the response when fetching a page of jobs +type JobsPayload implements PaginatedPayload { + results: [Job!]! + metadata: PaginationMetadata! +} + +# JobPayload defines the response when a job +union JobPayload = Job | NotFoundError + +input CreateJobInput { + TOML: String! +} + +type CreateJobSuccess { + job: Job! +} + +union CreateJobPayload = CreateJobSuccess | InputErrors + +type DeleteJobSuccess { + job: Job! +} + +union DeleteJobPayload = DeleteJobSuccess | NotFoundError +type JobError { + id: ID! + description: String! + occurrences: Int! + createdAt: Time! + updatedAt: Time! +} + +type DismissJobErrorSuccess { + jobError: JobError! +} + +union DismissJobErrorPayload = DismissJobErrorSuccess | NotFoundError +enum JobProposalStatus { + PENDING + APPROVED + REJECTED + CANCELLED + DELETED + REVOKED +} + +type JobProposal { + id: ID! + name: String + status: JobProposalStatus! + remoteUUID: String! + externalJobID: String + jobID: String + feedsManager: FeedsManager! + multiAddrs: [String!]! + pendingUpdate: Boolean! + specs: [JobProposalSpec!]! + latestSpec: JobProposalSpec! +} + +union JobProposalPayload = JobProposal | NotFoundError +enum SpecStatus { + UNKNOWN + PENDING + APPROVED + REJECTED + CANCELLED + REVOKED +} + +type JobProposalSpec { + id: ID! + definition: String! + version: Int! + status: SpecStatus! + statusUpdatedAt: Time! + createdAt: Time! + updatedAt: Time! +} + +type JobAlreadyExistsError implements Error { + message: String! + code: ErrorCode! +} + + +# ApproveJobProposalSpec + +type ApproveJobProposalSpecSuccess { + spec: JobProposalSpec! +} + +union ApproveJobProposalSpecPayload = ApproveJobProposalSpecSuccess | NotFoundError | JobAlreadyExistsError + +# CancelJobProposalSpec + +type CancelJobProposalSpecSuccess { + spec: JobProposalSpec! +} + +union CancelJobProposalSpecPayload = CancelJobProposalSpecSuccess | NotFoundError + + +# RejectJobProposalSpec + +type RejectJobProposalSpecSuccess { + spec: JobProposalSpec! +} + +union RejectJobProposalSpecPayload = RejectJobProposalSpecSuccess | NotFoundError + +# UpdateJobProposalSpec + +input UpdateJobProposalSpecDefinitionInput { + definition: String! +} + +type UpdateJobProposalSpecDefinitionSuccess { + spec: JobProposalSpec! +} + +union UpdateJobProposalSpecDefinitionPayload = UpdateJobProposalSpecDefinitionSuccess | NotFoundError +enum JobRunStatus { + UNKNOWN + RUNNING + SUSPENDED + ERRORED + COMPLETED +} + +type JobRun { + id: ID! + outputs: [String]! + allErrors: [String!]! + fatalErrors: [String!]! + inputs: String! + createdAt: Time! + finishedAt: Time + taskRuns: [TaskRun!]! + status: JobRunStatus! + job: Job! +} + +# JobRunsPayload defines the response when fetching a page of runs +type JobRunsPayload implements PaginatedPayload { + results: [JobRun!]! + metadata: PaginationMetadata! +} + +union JobRunPayload = JobRun | NotFoundError + +type RunJobSuccess { + jobRun: JobRun! +} + +type RunJobCannotRunError implements Error { + message: String! + code: ErrorCode! +} + +union RunJobPayload = RunJobSuccess | NotFoundError | RunJobCannotRunError +enum LogLevel { + DEBUG + INFO + WARN + ERROR +} + +type GlobalLogLevel { + level: LogLevel! +} + +union GlobalLogLevelPayload = GlobalLogLevel + +type LogLevelConfig { + keeper: LogLevel + headTracker: LogLevel + fluxMonitor: LogLevel +} + +input LogLevelConfigInput { + keeper: LogLevel + headTracker: LogLevel + fluxMonitor: LogLevel +} + +input SetServicesLogLevelsInput { + config: LogLevelConfigInput! +} + +type SetServicesLogLevelsSuccess { + config: LogLevelConfig! +} + +union SetServicesLogLevelsPayload = SetServicesLogLevelsSuccess | InputErrors + +type SQLLogging { + enabled: Boolean! +} + +input SetSQLLoggingInput { + enabled: Boolean! +} + +type SetSQLLoggingSuccess { + sqlLogging: SQLLogging! +} + +union SetSQLLoggingPayload = SetSQLLoggingSuccess + +union GetSQLLoggingPayload = SQLLogging + +type SetGlobalLogLevelSuccess { + globalLogLevel: GlobalLogLevel! +} + +union SetGlobalLogLevelPayload = SetGlobalLogLevelSuccess | InputErrors +type Node { + id: ID! + name: String! + wsURL: String! + httpURL: String! + chain: Chain! + state: String! + sendOnly: Boolean! + order: Int +} + +union NodePayload = Node | NotFoundError + +type NodesPayload implements PaginatedPayload { + results: [Node!]! + metadata: PaginationMetadata! +} +type OCRKeyBundle { + id: ID! + configPublicKey: String! + offChainPublicKey: String! + onChainSigningAddress: String! +} + +type OCRKeyBundlesPayload { + results: [OCRKeyBundle!]! +} + +type CreateOCRKeyBundleSuccess { + bundle: OCRKeyBundle! +} + +union CreateOCRKeyBundlePayload = CreateOCRKeyBundleSuccess + +type DeleteOCRKeyBundleSuccess { + bundle: OCRKeyBundle! +} + +union DeleteOCRKeyBundlePayload = DeleteOCRKeyBundleSuccess | NotFoundError +enum OCR2ChainType { + EVM + COSMOS + SOLANA + STARKNET + APTOS +} + +type OCR2KeyBundle { + id: ID! + chainType: OCR2ChainType + configPublicKey: String! + onChainPublicKey: String! + offChainPublicKey: String! +} + +type OCR2KeyBundlesPayload { + results: [OCR2KeyBundle!]! +} + +type CreateOCR2KeyBundleSuccess { + bundle: OCR2KeyBundle! +} + +union CreateOCR2KeyBundlePayload = CreateOCR2KeyBundleSuccess + +type DeleteOCR2KeyBundleSuccess { + bundle: OCR2KeyBundle! +} + +union DeleteOCR2KeyBundlePayload = DeleteOCR2KeyBundleSuccess | NotFoundError +type P2PKey { + id: ID! + peerID: String! + publicKey: String! +} + +type P2PKeysPayload { + results: [P2PKey!]! +} + +type CreateP2PKeySuccess { + p2pKey: P2PKey! +} + +union CreateP2PKeyPayload = CreateP2PKeySuccess + + +type DeleteP2PKeySuccess { + p2pKey: P2PKey! +} + +union DeleteP2PKeyPayload = DeleteP2PKeySuccess | NotFoundError +type PaginationMetadata { + total: Int! +} + +interface PaginatedPayload { + metadata: PaginationMetadata! +} +type SolanaKey { + id: ID! +} + +type SolanaKeysPayload { + results: [SolanaKey!]! +} +union JobSpec = + CronSpec | + DirectRequestSpec | + KeeperSpec | + FluxMonitorSpec | + OCRSpec | + OCR2Spec | + VRFSpec | + WebhookSpec | + BlockhashStoreSpec | + BlockHeaderFeederSpec | + BootstrapSpec | + GatewaySpec | + WorkflowSpec | + StandardCapabilitiesSpec + +type CronSpec { + schedule: String! + evmChainID: String + createdAt: Time! +} + +type DirectRequestSpec { + contractAddress: String! + createdAt: Time! + evmChainID: String + minIncomingConfirmations: Int! + minContractPaymentLinkJuels: String! + requesters: [String!] +} + +type FluxMonitorSpec { + absoluteThreshold: Float! + contractAddress: String! + createdAt: Time! + drumbeatEnabled: Boolean! + drumbeatRandomDelay: String + drumbeatSchedule: String + evmChainID: String + idleTimerDisabled: Boolean! + idleTimerPeriod: String! + minPayment: String + pollTimerDisabled: Boolean! + pollTimerPeriod: String! + threshold: Float! +} + +type KeeperSpec { + contractAddress: String! + createdAt: Time! + evmChainID: String + fromAddress: String +} + +type OCRSpec { + blockchainTimeout: String + contractAddress: String! + contractConfigConfirmations: Int + contractConfigTrackerPollInterval: String + contractConfigTrackerSubscribeInterval: String + createdAt: Time! + evmChainID: String + isBootstrapPeer: Boolean! + keyBundleID: String + observationTimeout: String + p2pv2Bootstrappers: [String!] + transmitterAddress: String + databaseTimeout: String! + observationGracePeriod: String! + contractTransmitterTransmitTimeout: String! +} + +type OCR2Spec { + blockchainTimeout: String + contractID: String! + contractConfigConfirmations: Int + contractConfigTrackerPollInterval: String + createdAt: Time! + ocrKeyBundleID: String + monitoringEndpoint: String + p2pv2Bootstrappers: [String!] + relay: String! + relayConfig: Map! + transmitterID: String + pluginType: String! + pluginConfig: Map! + feedID: String +} + +type VRFSpec { + coordinatorAddress: String! + createdAt: Time! + evmChainID: String + fromAddresses: [String!] + minIncomingConfirmations: Int! + pollPeriod: String! + publicKey: String! + requestedConfsDelay: Int! + requestTimeout: String! + batchCoordinatorAddress: String + batchFulfillmentEnabled: Boolean! + batchFulfillmentGasMultiplier: Float! + customRevertsPipelineEnabled: Boolean + chunkSize: Int! + backoffInitialDelay: String! + backoffMaxDelay: String! + gasLanePrice: String + vrfOwnerAddress: String +} + +type WebhookSpec { + createdAt: Time! +} + +type BlockhashStoreSpec { + coordinatorV1Address: String + coordinatorV2Address: String + coordinatorV2PlusAddress: String + waitBlocks: Int! + lookbackBlocks: Int! + blockhashStoreAddress: String! + trustedBlockhashStoreAddress: String + trustedBlockhashStoreBatchSize: Int! + heartbeatPeriod: String! + pollPeriod: String! + runTimeout: String! + evmChainID: String + fromAddresses: [String!] + createdAt: Time! +} + +type BlockHeaderFeederSpec { + coordinatorV1Address: String + coordinatorV2Address: String + coordinatorV2PlusAddress: String + waitBlocks: Int! + lookbackBlocks: Int! + blockhashStoreAddress: String! + batchBlockhashStoreAddress: String! + pollPeriod: String! + runTimeout: String! + evmChainID: String + getBlockhashesBatchSize: Int! + storeBlockhashesBatchSize: Int! + fromAddresses: [String!] + createdAt: Time! +} + +type BootstrapSpec { + id: ID! + contractID: String! + relay: String! + relayConfig: Map! + monitoringEndpoint: String + blockchainTimeout: String + contractConfigTrackerPollInterval: String + contractConfigConfirmations: Int + createdAt: Time! +} + +type GatewaySpec { + id: ID! + gatewayConfig: Map! + createdAt: Time! +} + +type WorkflowSpec { + id: ID! + workflowID: String! + workflow: String! + workflowOwner: String! + createdAt: Time! + updatedAt: Time! +} + +type StandardCapabilitiesSpec { + id: ID! + createdAt: Time! + command: String! + config: String +} +type TaskRun { + id: ID! + dotID: String! + type: String! + output: String! + error: String + createdAt: Time! + finishedAt: Time +} +type User { + email: String! + createdAt: Time! +} + +input UpdatePasswordInput { + oldPassword: String! + newPassword: String! +} + +type UpdatePasswordSuccess { + user: User! +} + +union UpdatePasswordPayload = UpdatePasswordSuccess | InputErrors +type VRFKey { + id: ID! + compressed: String! + uncompressed: String! + hash: String! +} + +type VRFKeySuccess { + key: VRFKey! +} + +union VRFKeyPayload = VRFKeySuccess | NotFoundError + +type VRFKeysPayload { + results: [VRFKey!]! +} + +type CreateVRFKeyPayload { + key: VRFKey! +} + +type DeleteVRFKeySuccess { + key: VRFKey! +} + +union DeleteVRFKeyPayload = DeleteVRFKeySuccess | NotFoundError diff --git a/integration-tests/web/sdk/main.go b/integration-tests/web/sdk/main.go new file mode 100644 index 00000000000..e2993ddb442 --- /dev/null +++ b/integration-tests/web/sdk/main.go @@ -0,0 +1,21 @@ +package main + +import ( + "fmt" + "os" + + "github.com/Khan/genqlient/generate" + + "github.com/smartcontractkit/chainlink/v2/core/web/schema" +) + +func main() { + schema := schema.MustGetRootSchema() + + if err := os.WriteFile("./internal/schema.graphql", []byte(schema), 0600); err != nil { + fmt.Println(err) + os.Exit(1) + } + + generate.Main() +} diff --git a/integration-tests/web/sdk/taskfile.yml b/integration-tests/web/sdk/taskfile.yml new file mode 100644 index 00000000000..76cf0c9b42d --- /dev/null +++ b/integration-tests/web/sdk/taskfile.yml @@ -0,0 +1,6 @@ +version: '3' + +tasks: + generate: + cmds: + - go run main.go \ No newline at end of file diff --git a/integration-tests/wrappers/contract_caller.go b/integration-tests/wrappers/contract_caller.go index 0eea760e024..14170c7deeb 100644 --- a/integration-tests/wrappers/contract_caller.go +++ b/integration-tests/wrappers/contract_caller.go @@ -16,10 +16,9 @@ import ( "github.com/ethereum/go-ethereum/rpc" "github.com/pkg/errors" "github.com/rs/zerolog" - "github.com/smartcontractkit/seth" - - "github.com/smartcontractkit/chainlink-testing-framework/blockchain" + "github.com/smartcontractkit/chainlink-testing-framework/lib/blockchain" + "github.com/smartcontractkit/chainlink-testing-framework/seth" evmClient "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" ) diff --git a/internal/testdb/testdb.go b/internal/testdb/testdb.go index 9b531166113..88251ae2c6f 100644 --- a/internal/testdb/testdb.go +++ b/internal/testdb/testdb.go @@ -5,6 +5,7 @@ import ( "errors" "fmt" "net/url" + "strings" "github.com/smartcontractkit/chainlink/v2/core/store/dialects" ) @@ -54,3 +55,27 @@ func CreateOrReplace(parsed url.URL, suffix string, withTemplate bool) (string, parsed.Path = fmt.Sprintf("/%s", dbname) return parsed.String(), nil } + +// Drop drops the database at the given URL. +func Drop(dbURL url.URL) error { + if dbURL.Path == "" { + return errors.New("path missing from database URL") + } + dbname := strings.TrimPrefix(dbURL.Path, "/") + + // Cannot drop test database if we are connected to it, so we must connect + // to a different one. 'postgres' should be present on all postgres installations + dbURL.Path = "/postgres" + db, err := sql.Open(string(dialects.Postgres), dbURL.String()) + if err != nil { + return fmt.Errorf("in order to drop the test database, we need to connect to a separate database"+ + " called 'postgres'. But we are unable to open 'postgres' database: %+v\n", err) + } + defer db.Close() + + _, err = db.Exec(fmt.Sprintf("DROP DATABASE IF EXISTS %s", dbname)) + if err != nil { + return fmt.Errorf("unable to drop postgres migrations test database: %v", err) + } + return nil +} diff --git a/main_test.go b/main_test.go index 81e056e3b84..419a4af0517 100644 --- a/main_test.go +++ b/main_test.go @@ -42,6 +42,10 @@ func TestMain(m *testing.M) { })) } +// TestScripts walks through the testdata/scripts directory and runs all tests that end in +// .txt or .txtar with the testscripts library. To run an individual test, specify it in the +// -run param of go test without the txtar or txt suffix, like so: +// go test . -run TestScripts/node/validate/default func TestScripts(t *testing.T) { if testing.Short() { t.Skip("skipping testscript") diff --git a/operator_ui/TAG b/operator_ui/TAG index bd6882b0f5c..b085cda408f 100644 --- a/operator_ui/TAG +++ b/operator_ui/TAG @@ -1 +1 @@ -v0.8.0-094d250 +v0.8.0-b940c8d \ No newline at end of file diff --git a/operator_ui/install.go b/operator_ui/install.go index 1e09783db66..14d920ddd43 100644 --- a/operator_ui/install.go +++ b/operator_ui/install.go @@ -22,7 +22,7 @@ func main() { fullRepo = owner + "/" + repo tagPath = "operator_ui/TAG" unpackDir = "core/web/assets" - downloadTimeoutSeconds = 10 + downloadTimeoutSeconds = 30 ) // Grab first argument as root directory if len(os.Args) < 2 { diff --git a/package.json b/package.json index b60a4573d5e..0382ca4e5cb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "chainlink", - "version": "2.14.0", + "version": "2.17.0", "description": "node of the decentralized oracle network, bridging on and off-chain computation", "main": "index.js", "scripts": { @@ -24,6 +24,6 @@ "devDependencies": { "@changesets/changelog-github": "^0.4.8", "@changesets/cli": "~2.26.2", - "semver": "^7.6.1" + "semver": "^7.6.3" } -} +} \ No newline at end of file diff --git a/plugins/chainlink.Dockerfile b/plugins/chainlink.Dockerfile index 50986396296..6d42567c745 100644 --- a/plugins/chainlink.Dockerfile +++ b/plugins/chainlink.Dockerfile @@ -1,5 +1,5 @@ # Build image: Chainlink binary -FROM golang:1.21-bullseye as buildgo +FROM golang:1.22-bullseye as buildgo RUN go version WORKDIR /chainlink @@ -33,7 +33,7 @@ RUN mkdir /chainlink-starknet RUN go list -m -f "{{.Dir}}" github.com/smartcontractkit/chainlink-starknet/relayer | xargs -I % ln -s % /chainlink-starknet/relayer # Build image: Plugins -FROM golang:1.21-bullseye as buildplugins +FROM golang:1.22-bullseye as buildplugins RUN go version WORKDIR /chainlink-feeds diff --git a/plugins/cmd/chainlink-ocr3-capability/main.go b/plugins/cmd/chainlink-ocr3-capability/main.go index c70a5a6f2ad..fad82c7b73b 100644 --- a/plugins/cmd/chainlink-ocr3-capability/main.go +++ b/plugins/cmd/chainlink-ocr3-capability/main.go @@ -11,7 +11,6 @@ import ( ocr3rp "github.com/smartcontractkit/chainlink-common/pkg/loop/reportingplugins/ocr3" "github.com/smartcontractkit/chainlink-common/pkg/types" "github.com/smartcontractkit/chainlink/v2/core/capabilities" - "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm" ) const ( @@ -24,7 +23,7 @@ func main() { c := ocr3.Config{ Logger: s.Logger, - EncoderFactory: evm.NewEVMEncoder, + EncoderFactory: capabilities.NewEncoder, AggregatorFactory: capabilities.NewAggregator, } p := ocr3.NewOCR3(c) diff --git a/plugins/loop_registry.go b/plugins/loop_registry.go index b796ddf87ee..51c6310ffa7 100644 --- a/plugins/loop_registry.go +++ b/plugins/loop_registry.go @@ -27,15 +27,17 @@ type LoopRegistry struct { mu sync.Mutex registry map[string]*RegisteredLoop - lggr logger.Logger - cfgTracing config.Tracing + lggr logger.Logger + cfgTracing config.Tracing + cfgTelemetry config.Telemetry } -func NewLoopRegistry(lggr logger.Logger, tracingConfig config.Tracing) *LoopRegistry { +func NewLoopRegistry(lggr logger.Logger, tracing config.Tracing, telemetry config.Telemetry) *LoopRegistry { return &LoopRegistry{ - registry: map[string]*RegisteredLoop{}, - lggr: logger.Named(lggr, "LoopRegistry"), - cfgTracing: tracingConfig, + registry: map[string]*RegisteredLoop{}, + lggr: logger.Named(lggr, "LoopRegistry"), + cfgTracing: tracing, + cfgTelemetry: telemetry, } } @@ -65,6 +67,15 @@ func (m *LoopRegistry) Register(id string) (*RegisteredLoop, error) { envCfg.TracingAttributes = m.cfgTracing.Attributes() } + if m.cfgTelemetry != nil { + envCfg.TelemetryEnabled = m.cfgTelemetry.Enabled() + envCfg.TelemetryEndpoint = m.cfgTelemetry.OtelExporterGRPCEndpoint() + envCfg.TelemetryInsecureConnection = m.cfgTelemetry.InsecureConnection() + envCfg.TelemetryCACertFile = m.cfgTelemetry.CACertFile() + envCfg.TelemetryAttributes = m.cfgTelemetry.ResourceAttributes() + envCfg.TelemetryTraceSampleRatio = m.cfgTelemetry.TraceSampleRatio() + } + m.registry[id] = &RegisteredLoop{Name: id, EnvCfg: envCfg} m.lggr.Debugf("Registered loopp %q with config %v, port %d", id, envCfg, envCfg.PrometheusPort) return m.registry[id], nil diff --git a/plugins/loop_registry_test.go b/plugins/loop_registry_test.go index b307469e09b..84b6b0cefc9 100644 --- a/plugins/loop_registry_test.go +++ b/plugins/loop_registry_test.go @@ -5,12 +5,13 @@ import ( "github.com/stretchr/testify/require" + "github.com/smartcontractkit/chainlink-common/pkg/loop" "github.com/smartcontractkit/chainlink/v2/core/logger" ) func TestPluginPortManager(t *testing.T) { // register one - m := NewLoopRegistry(logger.TestLogger(t), nil) + m := NewLoopRegistry(logger.TestLogger(t), nil, nil) pFoo, err := m.Register("foo") require.NoError(t, err) require.Equal(t, "foo", pFoo.Name) @@ -26,37 +27,63 @@ func TestPluginPortManager(t *testing.T) { require.Equal(t, pFoo.EnvCfg.PrometheusPort+1, pBar.EnvCfg.PrometheusPort) } -// Mock tracing config -type MockCfgTracing struct{} +type mockCfgTracing struct{} -func (m *MockCfgTracing) Attributes() map[string]string { +func (m *mockCfgTracing) Attributes() map[string]string { return map[string]string{"attribute": "value"} } -func (m *MockCfgTracing) Enabled() bool { return true } -func (m *MockCfgTracing) NodeID() string { return "" } -func (m *MockCfgTracing) CollectorTarget() string { return "http://localhost:9000" } -func (m *MockCfgTracing) SamplingRatio() float64 { return 0.1 } -func (m *MockCfgTracing) TLSCertPath() string { return "/path/to/cert.pem" } -func (m *MockCfgTracing) Mode() string { return "tls" } +func (m *mockCfgTracing) Enabled() bool { return true } +func (m *mockCfgTracing) NodeID() string { return "" } +func (m *mockCfgTracing) CollectorTarget() string { return "http://localhost:9000" } +func (m *mockCfgTracing) SamplingRatio() float64 { return 0.1 } +func (m *mockCfgTracing) TLSCertPath() string { return "/path/to/cert.pem" } +func (m *mockCfgTracing) Mode() string { return "tls" } + +type mockCfgTelemetry struct{} + +func (m mockCfgTelemetry) Enabled() bool { return true } + +func (m mockCfgTelemetry) InsecureConnection() bool { return true } + +func (m mockCfgTelemetry) CACertFile() string { return "path/to/cert.pem" } + +func (m mockCfgTelemetry) OtelExporterGRPCEndpoint() string { return "http://localhost:9001" } + +func (m mockCfgTelemetry) ResourceAttributes() map[string]string { + return map[string]string{"foo": "bar"} +} + +func (m mockCfgTelemetry) TraceSampleRatio() float64 { return 0.42 } func TestLoopRegistry_Register(t *testing.T) { - mockCfgTracing := &MockCfgTracing{} + mockCfgTracing := &mockCfgTracing{} + mockCfgTelemetry := &mockCfgTelemetry{} registry := make(map[string]*RegisteredLoop) // Create a LoopRegistry instance with mockCfgTracing loopRegistry := &LoopRegistry{ - lggr: logger.TestLogger(t), - registry: registry, - cfgTracing: mockCfgTracing, + lggr: logger.TestLogger(t), + registry: registry, + cfgTracing: mockCfgTracing, + cfgTelemetry: mockCfgTelemetry, } // Test case 1: Register new loop registeredLoop, err := loopRegistry.Register("testID") require.Nil(t, err) require.Equal(t, "testID", registeredLoop.Name) - require.True(t, registeredLoop.EnvCfg.TracingEnabled) - require.Equal(t, "http://localhost:9000", registeredLoop.EnvCfg.TracingCollectorTarget) - require.Equal(t, map[string]string{"attribute": "value"}, registeredLoop.EnvCfg.TracingAttributes) - require.Equal(t, 0.1, registeredLoop.EnvCfg.TracingSamplingRatio) - require.Equal(t, "/path/to/cert.pem", registeredLoop.EnvCfg.TracingTLSCertPath) + + envCfg := registeredLoop.EnvCfg + require.True(t, envCfg.TracingEnabled) + require.Equal(t, "http://localhost:9000", envCfg.TracingCollectorTarget) + require.Equal(t, map[string]string{"attribute": "value"}, envCfg.TracingAttributes) + require.Equal(t, 0.1, envCfg.TracingSamplingRatio) + require.Equal(t, "/path/to/cert.pem", envCfg.TracingTLSCertPath) + + require.True(t, envCfg.TelemetryEnabled) + require.True(t, envCfg.TelemetryInsecureConnection) + require.Equal(t, "path/to/cert.pem", envCfg.TelemetryCACertFile) + require.Equal(t, "http://localhost:9001", envCfg.TelemetryEndpoint) + require.Equal(t, loop.OtelAttributes{"foo": "bar"}, envCfg.TelemetryAttributes) + require.Equal(t, 0.42, envCfg.TelemetryTraceSampleRatio) } diff --git a/plugins/medianpoc/plugin.go b/plugins/medianpoc/plugin.go index 41580afe499..e6ada1bec84 100644 --- a/plugins/medianpoc/plugin.go +++ b/plugins/medianpoc/plugin.go @@ -40,7 +40,7 @@ func (e *PipelineNotFoundError) Error() string { } func (p *Plugin) NewValidationService(ctx context.Context) (core.ValidationService, error) { - s := &reportingPluginValidationService{lggr: p.Logger} + s := &reportingPluginValidationService{Service: services.Config{Name: "ValidationService"}.NewService(p.Logger)} p.SubService(s) return s, nil } @@ -81,7 +81,10 @@ func (p *Plugin) NewReportingPluginFactory( if err != nil { return nil, err } - s := &reportingPluginFactoryService{lggr: p.Logger, ReportingPluginFactory: f} + s := &reportingPluginFactoryService{ + Service: services.Config{Name: "ReportingPluginFactory"}.NewService(p.Logger), + ReportingPluginFactory: f, + } p.SubService(s) return s, nil } @@ -157,28 +160,12 @@ func (p *Plugin) newFactory(ctx context.Context, config core.ReportingPluginServ } type reportingPluginFactoryService struct { - services.StateMachine - lggr logger.Logger + services.Service ocrtypes.ReportingPluginFactory } -func (r *reportingPluginFactoryService) Name() string { return r.lggr.Name() } - -func (r *reportingPluginFactoryService) Start(ctx context.Context) error { - return r.StartOnce("ReportingPluginFactory", func() error { return nil }) -} - -func (r *reportingPluginFactoryService) Close() error { - return r.StopOnce("ReportingPluginFactory", func() error { return nil }) -} - -func (r *reportingPluginFactoryService) HealthReport() map[string]error { - return map[string]error{r.Name(): r.Healthy()} -} - type reportingPluginValidationService struct { - services.StateMachine - lggr logger.Logger + services.Service } func (r *reportingPluginValidationService) ValidateConfig(ctx context.Context, config map[string]interface{}) error { @@ -196,16 +183,3 @@ func (r *reportingPluginValidationService) ValidateConfig(ctx context.Context, c return nil } -func (r *reportingPluginValidationService) Name() string { return r.lggr.Name() } - -func (r *reportingPluginValidationService) Start(ctx context.Context) error { - return r.StartOnce("ValidationService", func() error { return nil }) -} - -func (r *reportingPluginValidationService) Close() error { - return r.StopOnce("ValidationService", func() error { return nil }) -} - -func (r *reportingPluginValidationService) HealthReport() map[string]error { - return map[string]error{r.Name(): r.Healthy()} -} diff --git a/plugins/medianpoc/plugin_test.go b/plugins/medianpoc/plugin_test.go index 22e4c095d6c..d2d17db32a8 100644 --- a/plugins/medianpoc/plugin_test.go +++ b/plugins/medianpoc/plugin_test.go @@ -73,7 +73,7 @@ func (p provider) OnchainConfigCodec() median.OnchainConfigCodec { return mockOnchainConfigCodec{} } -func (p provider) ChainReader() types.ContractReader { +func (p provider) ContractReader() types.ContractReader { return nil } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 95d247d9937..260e6c79c07 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -15,25 +15,25 @@ importers: specifier: ~2.26.2 version: 2.26.2 semver: - specifier: ^7.6.1 - version: 7.6.1 + specifier: ^7.6.3 + version: 7.6.3 packages: - '@babel/code-frame@7.23.5': - resolution: {integrity: sha512-CgH3s1a96LipHCmSUmYFPwY7MNx8C3avkq7i4Wl3cfa662ldtUe4VM1TPXX70pfmrlWTb6jLqTYrZyT2ZTJBgA==} + '@babel/code-frame@7.24.7': + resolution: {integrity: sha512-BcYH1CVJBO9tvyIZ2jVeXgSIMvGZ2FDRvDdOIVQyuklNKSsx+eppDEBq/g47Ayw+RqNFE+URvOShmf+f/qwAlA==} engines: {node: '>=6.9.0'} - '@babel/helper-validator-identifier@7.22.20': - resolution: {integrity: sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==} + '@babel/helper-validator-identifier@7.24.7': + resolution: {integrity: sha512-rR+PBcQ1SMQDDyF6X0wxtG8QyLCgUB0eRAGguqRLfkCA87l7yAP7ehq8SNj96OOGTO8OBV70KhuFYcIkHXOg0w==} engines: {node: '>=6.9.0'} - '@babel/highlight@7.23.4': - resolution: {integrity: sha512-acGdbYSfp2WheJoJm/EBBBLh/ID8KDc64ISZ9DYtBmC8/Q204PZJLHyzeB5qMzJ5trcOkybd78M4x2KWsUq++A==} + '@babel/highlight@7.24.7': + resolution: {integrity: sha512-EStJpq4OuY8xYfhGVXngigBJRWxftKX9ksiGDnmlY3o7B/V7KIAc9X4oiK87uPJSc/vs5L869bem5fhZa8caZw==} engines: {node: '>=6.9.0'} - '@babel/runtime@7.23.9': - resolution: {integrity: sha512-0CX6F+BI2s9dkUqr08KFrAIZgNFj75rdBU/DjCyYLIaV/quFjkk6T+EJ2LkZHyZTbEV4L5p97mNkUsHl2wLFAw==} + '@babel/runtime@7.25.6': + resolution: {integrity: sha512-VBj9MYyDb9tuLq7yzqjgzt6Q+IBQLrGZfdjOekyEirZPHxXWoTSGUTMrpsfi58Up73d13NfYLv8HT9vmznjzhQ==} engines: {node: '>=6.9.0'} '@changesets/apply-release-plan@6.1.4': @@ -174,8 +174,8 @@ packages: resolution: {integrity: sha512-pbnl5XzGBdrFU/wT4jqmJVPn2B6UHPBOhzMQkY/SPUPB6QtUXtmBHBIwCbXJol93mOpGMnQyP/+BB19q04xj7g==} engines: {node: '>=4'} - braces@3.0.2: - resolution: {integrity: sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==} + braces@3.0.3: + resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} engines: {node: '>=8'} breakword@1.0.6: @@ -248,6 +248,18 @@ packages: resolution: {integrity: sha512-QTaY0XjjhTQOdguARF0lGKm5/mEq9PD9/VhZZegHDIBq2tQwgNpHc3dneD4mGo2iJs+fTKv5Bp0fZ+BRuY3Z0g==} engines: {node: '>= 0.1.90'} + data-view-buffer@1.0.1: + resolution: {integrity: sha512-0lht7OugA5x3iJLOWFhWK/5ehONdprk0ISXqVFn/NFrDu+cuc8iADFrGQz5BnRK7LLU3JmkbXSxaqX+/mXYtUA==} + engines: {node: '>= 0.4'} + + data-view-byte-length@1.0.1: + resolution: {integrity: sha512-4J7wRJD3ABAzr8wP+OcIcqq2dlUKp4DVflx++hs5h5ZKydWMI6/D/fAot+yh6g2tHh8fLFTvNOaVN357NvSrOQ==} + engines: {node: '>= 0.4'} + + data-view-byte-offset@1.0.0: + resolution: {integrity: sha512-t/Ygsytq+R995EJ5PZlD4Cu56sWa8InXySaViRzw9apusqsOO2bQP+SbYzAhR0pFKoB+43lYy8rWban9JSuXnA==} + engines: {node: '>= 0.4'} + dataloader@1.4.0: resolution: {integrity: sha512-68s5jYdlvasItOJnCuI2Q9s4q98g0pCyL3HrcKJu8KNugUl8ahgmZYg38ysLTgQjjXX3H8CJLkAvWrclWfcalw==} @@ -292,8 +304,8 @@ packages: error-ex@1.3.2: resolution: {integrity: sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==} - es-abstract@1.22.4: - resolution: {integrity: sha512-vZYJlk2u6qHYxBOTjAeg7qUxHdNfih64Uu2J8QqWgXZ2cri0ZpJAkzDUK/q593+mvKwlxyaxr6F1Q+3LKoQRgg==} + es-abstract@1.23.3: + resolution: {integrity: sha512-e+HfNH61Bj1X9/jLc5v1owaLYuHdeHHSQlkhCBiTK8rBvKaULl/beGMxwrMXjpYrv4pz22BlY570vVePA2ho4A==} engines: {node: '>= 0.4'} es-define-property@1.0.0: @@ -304,6 +316,10 @@ packages: resolution: {integrity: sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==} engines: {node: '>= 0.4'} + es-object-atoms@1.0.0: + resolution: {integrity: sha512-MZ4iQ6JwHOBQjahnjwaC1ZtIBH+2ohjamzAO3oaHcXYup7qxjF2fixyH+Q71voWHeOkI2q/TnJao/KfXYIZWbw==} + engines: {node: '>= 0.4'} + es-set-tostringtag@2.0.3: resolution: {integrity: sha512-3T8uNMC3OQTHkFUsFq8r/BwAXLHvU/9O9mE0fBc/MY5iq/8H7ncvO947LmYA6ldWw9Uh8Yhf25zu6n7nML5QWQ==} engines: {node: '>= 0.4'} @@ -315,8 +331,8 @@ packages: resolution: {integrity: sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==} engines: {node: '>= 0.4'} - escalade@3.1.2: - resolution: {integrity: sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==} + escalade@3.2.0: + resolution: {integrity: sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==} engines: {node: '>=6'} escape-string-regexp@1.0.5: @@ -342,8 +358,8 @@ packages: fastq@1.17.1: resolution: {integrity: sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==} - fill-range@7.0.1: - resolution: {integrity: sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==} + fill-range@7.1.1: + resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} engines: {node: '>=8'} find-up@4.1.0: @@ -394,8 +410,8 @@ packages: resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} engines: {node: '>= 6'} - globalthis@1.0.3: - resolution: {integrity: sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==} + globalthis@1.0.4: + resolution: {integrity: sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ==} engines: {node: '>= 0.4'} globby@11.1.0: @@ -441,8 +457,8 @@ packages: resolution: {integrity: sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==} engines: {node: '>= 0.4'} - hasown@2.0.1: - resolution: {integrity: sha512-1/th4MHjnwncwXsIW6QMzlvYL9kG5e/CpVvLRZe4XPa8TOUNbCELqmvhDmnkNsAjwaG4+I8gJJL0JBvTTLO9qA==} + hasown@2.0.2: + resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==} engines: {node: '>= 0.4'} hosted-git-info@2.8.9: @@ -455,8 +471,8 @@ packages: resolution: {integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==} engines: {node: '>=0.10.0'} - ignore@5.3.1: - resolution: {integrity: sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==} + ignore@5.3.2: + resolution: {integrity: sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==} engines: {node: '>= 4'} indent-string@4.0.0: @@ -489,8 +505,13 @@ packages: resolution: {integrity: sha512-ZYvCgrefwqoQ6yTyYUbQu64HsITZ3NfKX1lzaEYdkTDcfKzzCI/wthRRYKkdjHKFVgNiXKAKm65Zo1pk2as/QQ==} hasBin: true - is-core-module@2.13.1: - resolution: {integrity: sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==} + is-core-module@2.15.1: + resolution: {integrity: sha512-z0vtXSwucUJtANQWldhbtbt7BnL0vxiFjIdDLAatwhDYty2bad6s+rijD6Ri4YuYJubLzIJLUidCh09e1djEVQ==} + engines: {node: '>= 0.4'} + + is-data-view@1.0.1: + resolution: {integrity: sha512-AHkaJrsUVW6wq6JS8y3JnM/GJF/9cf+k20+iDzlSaJrinEo5+7vRiteOSwBhHRiAyQATN1AmY4hwzxJKPmYf+w==} + engines: {node: '>= 0.4'} is-date-object@1.0.5: resolution: {integrity: sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==} @@ -619,8 +640,8 @@ packages: resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} engines: {node: '>= 8'} - micromatch@4.0.5: - resolution: {integrity: sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==} + micromatch@4.0.8: + resolution: {integrity: sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==} engines: {node: '>=8.6'} min-indent@1.0.1: @@ -647,8 +668,9 @@ packages: normalize-package-data@2.5.0: resolution: {integrity: sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==} - object-inspect@1.13.1: - resolution: {integrity: sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==} + object-inspect@1.13.2: + resolution: {integrity: sha512-IRZSRuzJiynemAXPYtPe5BoI/RESNYR7TYm50MC5Mqbd3Jmw5y790sErYw3V6SryFJD64b74qQQs9wn5Bg/k3g==} + engines: {node: '>= 0.4'} object-keys@1.1.1: resolution: {integrity: sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==} @@ -708,6 +730,9 @@ packages: resolution: {integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==} engines: {node: '>=8'} + picocolors@1.1.0: + resolution: {integrity: sha512-TQ92mBOW0l3LeMeyLV6mzy/kWr8lkd/hp3mTg7wYK7zJhuBStmGMBG0BdeDZS/dZx1IukaX6Bk11zcln25o1Aw==} + picomatch@2.3.1: resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} engines: {node: '>=8.6'} @@ -724,8 +749,8 @@ packages: resolution: {integrity: sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q==} engines: {node: '>= 0.4'} - preferred-pm@3.1.3: - resolution: {integrity: sha512-MkXsENfftWSRpzCzImcp4FRsCc3y1opwB73CfCNWyzMqArju2CrlMHlqB7VexKiPEOjGMbttv1r9fSCn5S610w==} + preferred-pm@3.1.4: + resolution: {integrity: sha512-lEHd+yEm22jXdCphDrkvIJQU66EuLojPPtvZkpKIkiD+l0DMThF/niqZKJSoU8Vl7iuvtmzyMhir9LdVy5WMnA==} engines: {node: '>=10'} prettier@2.8.8: @@ -788,8 +813,8 @@ packages: run-parallel@1.2.0: resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} - safe-array-concat@1.1.0: - resolution: {integrity: sha512-ZdQ0Jeb9Ofti4hbt5lX3T2JcAamT9hfzYU1MNB+z/jaEbB6wfFfPIR/zEORmZqobkCCJhSjodobH6WHNmJ97dg==} + safe-array-concat@1.1.2: + resolution: {integrity: sha512-vj6RsCsWBCf19jIeHEfkRMw8DPiBb+DMXklQ/1SGDHOMlHdPUkZXFQ2YdplS23zESTijAcurb1aSgJA3AgMu1Q==} engines: {node: '>=0.4'} safe-regex-test@1.0.3: @@ -803,16 +828,16 @@ packages: resolution: {integrity: sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==} hasBin: true - semver@7.6.1: - resolution: {integrity: sha512-f/vbBsu+fOiYt+lmwZV0rVwJScl46HppnOA1ZvIuBWKOTlllpyJ3bfVax76/OrhCH38dyxoDIA8K7uB963IYgA==} + semver@7.6.3: + resolution: {integrity: sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==} engines: {node: '>=10'} hasBin: true set-blocking@2.0.0: resolution: {integrity: sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==} - set-function-length@1.2.1: - resolution: {integrity: sha512-j4t6ccc+VsKwYHso+kElc5neZpjtq9EnRICFZtWyBsLojhmeF/ZBd/elqm22WJh/BziDe/SBiOeAt0m2mfLD0g==} + set-function-length@1.2.2: + resolution: {integrity: sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==} engines: {node: '>= 0.4'} set-function-name@2.0.2: @@ -827,8 +852,8 @@ packages: resolution: {integrity: sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ==} engines: {node: '>=0.10.0'} - side-channel@1.0.5: - resolution: {integrity: sha512-QcgiIWV4WV7qWExbN5llt6frQB/lBven9pqliLXfGPB+K9ZYXxDozp0wLkHS24kWCm+6YXH/f0HhnObZnZOBnQ==} + side-channel@1.0.6: + resolution: {integrity: sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==} engines: {node: '>= 0.4'} signal-exit@3.0.7: @@ -855,8 +880,8 @@ packages: spdx-expression-parse@3.0.1: resolution: {integrity: sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==} - spdx-license-ids@3.0.17: - resolution: {integrity: sha512-sh8PWc/ftMqAAdFiBu6Fy6JUOYjqDJBJvIhpfDMyHrr0Rbp5liZqd4TjtQ/RgfLjKFZb+LMx5hpml5qOWy0qvg==} + spdx-license-ids@3.0.20: + resolution: {integrity: sha512-jg25NiDV/1fLtSgEgyvVyDunvaNHbuwF9lfNV17gSmPFAlYzdfNBlLtLzXTevwkPj7DhGbmN9VnmJIgLnhvaBw==} sprintf-js@1.0.3: resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} @@ -868,15 +893,16 @@ packages: resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} engines: {node: '>=8'} - string.prototype.trim@1.2.8: - resolution: {integrity: sha512-lfjY4HcixfQXOfaqCvcBuOIapyaroTXhbkfJN3gcB1OtyupngWK4sEET9Knd0cXd28kTUqu/kHoV4HKSJdnjiQ==} + string.prototype.trim@1.2.9: + resolution: {integrity: sha512-klHuCNxiMZ8MlsOihJhJEBJAiMVqU3Z2nEXWfWnIqjN0gEFS9J9+IxKozWWtQGcgoa1WUZzLjKPTr4ZHNFTFxw==} engines: {node: '>= 0.4'} - string.prototype.trimend@1.0.7: - resolution: {integrity: sha512-Ni79DqeB72ZFq1uH/L6zJ+DKZTkOtPIHovb3YZHQViE+HDouuU4mBrLOLDn5Dde3RF8qw5qVETEjhu9locMLvA==} + string.prototype.trimend@1.0.8: + resolution: {integrity: sha512-p73uL5VCHCO2BZZ6krwwQE3kCzM7NKmis8S//xEC6fQonchbum4eP6kR4DLEjQFO3Wnj3Fuo8NM0kOSjVdHjZQ==} - string.prototype.trimstart@1.0.7: - resolution: {integrity: sha512-NGhtDFu3jCEm7B4Fy0DpLewdJQOZcQ0rGbwQ/+stjnrp2i+rlKeCvos9hOIeCmqwratM47OBxY7uFZzjxHXmrg==} + string.prototype.trimstart@1.0.8: + resolution: {integrity: sha512-UXSH262CSZY1tfu3G3Secr6uGLCFVPMhIqHjlgCUtCCcgihYc/xKs9djMTMUOb2j1mVSeU8EU6NWc/iQKU6Gfg==} + engines: {node: '>= 0.4'} strip-ansi@6.0.1: resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} @@ -950,8 +976,8 @@ packages: resolution: {integrity: sha512-Ous0vodHa56FviZucS2E63zkgtgrACj7omjwd/8lTEMEPFFyjfixMZ1ZXenpgCFBBt4EC1J2XsyVS2gkG0eTFA==} engines: {node: '>= 0.4'} - typed-array-length@1.0.5: - resolution: {integrity: sha512-yMi0PlwuznKHxKmcpoOdeLwxBoVPkqZxd7q2FgMkmD3bNwvF5VW0+UlUQ1k1vmktTu4Yu13Q0RIxEP8+B+wloA==} + typed-array-length@1.0.6: + resolution: {integrity: sha512-/OxDN6OtAk5KBpGb28T+HZc2M+ADtvRxXrKKbUwtsLgdoxgX13hyy7ek6bFRl5+aBs2yZzB0c4CnQfAtVypW/g==} engines: {node: '>= 0.4'} unbox-primitive@1.0.2: @@ -979,12 +1005,12 @@ packages: which-module@2.0.1: resolution: {integrity: sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==} - which-pm@2.0.0: - resolution: {integrity: sha512-Lhs9Pmyph0p5n5Z3mVnN0yWcbQYUAD7rbQUiMsQxOJ3T57k7RFe35SUwWMf7dsbDZks1uOmw4AecB/JMDj3v/w==} + which-pm@2.2.0: + resolution: {integrity: sha512-MOiaDbA5ZZgUjkeMWM5EkJp4loW5ZRoa5bc3/aeMox/PJelMhE6t7S/mLuiY43DBupyxH+S0U1bTui9kWUlmsw==} engines: {node: '>=8.15'} - which-typed-array@1.1.14: - resolution: {integrity: sha512-VnXFiIW8yNn9kIHN88xvZ4yOWchftKDsRJ8fEPacX/wl1lOvBrhsJ/OeJCXq7B0AaijRuqgzSKalJoPk+D8MPg==} + which-typed-array@1.1.15: + resolution: {integrity: sha512-oV0jmFtUky6CXfkqehVvBP/LSWJ2sy4vWMioiENyJLePrBO/yKyV9OyJySfAKosh+RYkIl5zJCNZ8/4JncrpdA==} engines: {node: '>= 0.4'} which@1.3.1: @@ -1031,26 +1057,27 @@ packages: snapshots: - '@babel/code-frame@7.23.5': + '@babel/code-frame@7.24.7': dependencies: - '@babel/highlight': 7.23.4 - chalk: 2.4.2 + '@babel/highlight': 7.24.7 + picocolors: 1.1.0 - '@babel/helper-validator-identifier@7.22.20': {} + '@babel/helper-validator-identifier@7.24.7': {} - '@babel/highlight@7.23.4': + '@babel/highlight@7.24.7': dependencies: - '@babel/helper-validator-identifier': 7.22.20 + '@babel/helper-validator-identifier': 7.24.7 chalk: 2.4.2 js-tokens: 4.0.0 + picocolors: 1.1.0 - '@babel/runtime@7.23.9': + '@babel/runtime@7.25.6': dependencies: regenerator-runtime: 0.14.1 '@changesets/apply-release-plan@6.1.4': dependencies: - '@babel/runtime': 7.23.9 + '@babel/runtime': 7.25.6 '@changesets/config': 2.3.1 '@changesets/get-version-range-type': 0.3.2 '@changesets/git': 2.0.0 @@ -1062,16 +1089,16 @@ snapshots: outdent: 0.5.0 prettier: 2.8.8 resolve-from: 5.0.0 - semver: 7.6.1 + semver: 7.6.3 '@changesets/assemble-release-plan@5.2.4': dependencies: - '@babel/runtime': 7.23.9 + '@babel/runtime': 7.25.6 '@changesets/errors': 0.1.4 '@changesets/get-dependents-graph': 1.3.6 '@changesets/types': 5.2.1 '@manypkg/get-packages': 1.1.3 - semver: 7.6.1 + semver: 7.6.3 '@changesets/changelog-git@0.1.14': dependencies: @@ -1087,7 +1114,7 @@ snapshots: '@changesets/cli@2.26.2': dependencies: - '@babel/runtime': 7.23.9 + '@babel/runtime': 7.25.6 '@changesets/apply-release-plan': 6.1.4 '@changesets/assemble-release-plan': 5.2.4 '@changesets/changelog-git': 0.1.14 @@ -1114,9 +1141,9 @@ snapshots: meow: 6.1.1 outdent: 0.5.0 p-limit: 2.3.0 - preferred-pm: 3.1.3 + preferred-pm: 3.1.4 resolve-from: 5.0.0 - semver: 7.6.1 + semver: 7.6.3 spawndamnit: 2.0.0 term-size: 2.2.1 tty-table: 4.2.3 @@ -1129,7 +1156,7 @@ snapshots: '@changesets/types': 5.2.1 '@manypkg/get-packages': 1.1.3 fs-extra: 7.0.1 - micromatch: 4.0.5 + micromatch: 4.0.8 '@changesets/errors@0.1.4': dependencies: @@ -1141,7 +1168,7 @@ snapshots: '@manypkg/get-packages': 1.1.3 chalk: 2.4.2 fs-extra: 7.0.1 - semver: 7.6.1 + semver: 7.6.3 '@changesets/get-github-info@0.5.2': dependencies: @@ -1152,7 +1179,7 @@ snapshots: '@changesets/get-release-plan@3.0.17': dependencies: - '@babel/runtime': 7.23.9 + '@babel/runtime': 7.25.6 '@changesets/assemble-release-plan': 5.2.4 '@changesets/config': 2.3.1 '@changesets/pre': 1.0.14 @@ -1164,12 +1191,12 @@ snapshots: '@changesets/git@2.0.0': dependencies: - '@babel/runtime': 7.23.9 + '@babel/runtime': 7.25.6 '@changesets/errors': 0.1.4 '@changesets/types': 5.2.1 '@manypkg/get-packages': 1.1.3 is-subdir: 1.2.0 - micromatch: 4.0.5 + micromatch: 4.0.8 spawndamnit: 2.0.0 '@changesets/logger@0.0.5': @@ -1183,7 +1210,7 @@ snapshots: '@changesets/pre@1.0.14': dependencies: - '@babel/runtime': 7.23.9 + '@babel/runtime': 7.25.6 '@changesets/errors': 0.1.4 '@changesets/types': 5.2.1 '@manypkg/get-packages': 1.1.3 @@ -1191,7 +1218,7 @@ snapshots: '@changesets/read@0.5.9': dependencies: - '@babel/runtime': 7.23.9 + '@babel/runtime': 7.25.6 '@changesets/git': 2.0.0 '@changesets/logger': 0.0.5 '@changesets/parse': 0.3.16 @@ -1206,7 +1233,7 @@ snapshots: '@changesets/write@0.2.3': dependencies: - '@babel/runtime': 7.23.9 + '@babel/runtime': 7.25.6 '@changesets/types': 5.2.1 fs-extra: 7.0.1 human-id: 1.0.2 @@ -1214,14 +1241,14 @@ snapshots: '@manypkg/find-root@1.1.0': dependencies: - '@babel/runtime': 7.23.9 + '@babel/runtime': 7.25.6 '@types/node': 12.20.55 find-up: 4.1.0 fs-extra: 8.1.0 '@manypkg/get-packages@1.1.3': dependencies: - '@babel/runtime': 7.23.9 + '@babel/runtime': 7.25.6 '@changesets/types': 4.1.0 '@manypkg/find-root': 1.1.0 fs-extra: 8.1.0 @@ -1279,7 +1306,7 @@ snapshots: dependencies: call-bind: 1.0.7 define-properties: 1.2.1 - es-abstract: 1.22.4 + es-abstract: 1.23.3 es-shim-unscopables: 1.0.2 arraybuffer.prototype.slice@1.0.3: @@ -1287,7 +1314,7 @@ snapshots: array-buffer-byte-length: 1.0.1 call-bind: 1.0.7 define-properties: 1.2.1 - es-abstract: 1.22.4 + es-abstract: 1.23.3 es-errors: 1.3.0 get-intrinsic: 1.2.4 is-array-buffer: 3.0.4 @@ -1303,9 +1330,9 @@ snapshots: dependencies: is-windows: 1.0.2 - braces@3.0.2: + braces@3.0.3: dependencies: - fill-range: 7.0.1 + fill-range: 7.1.1 breakword@1.0.6: dependencies: @@ -1317,7 +1344,7 @@ snapshots: es-errors: 1.3.0 function-bind: 1.1.2 get-intrinsic: 1.2.4 - set-function-length: 1.2.1 + set-function-length: 1.2.2 camelcase-keys@6.2.2: dependencies: @@ -1387,6 +1414,24 @@ snapshots: csv-stringify: 5.6.5 stream-transform: 2.1.3 + data-view-buffer@1.0.1: + dependencies: + call-bind: 1.0.7 + es-errors: 1.3.0 + is-data-view: 1.0.1 + + data-view-byte-length@1.0.1: + dependencies: + call-bind: 1.0.7 + es-errors: 1.3.0 + is-data-view: 1.0.1 + + data-view-byte-offset@1.0.0: + dependencies: + call-bind: 1.0.7 + es-errors: 1.3.0 + is-data-view: 1.0.1 + dataloader@1.4.0: {} decamelize-keys@1.1.1: @@ -1431,49 +1476,54 @@ snapshots: dependencies: is-arrayish: 0.2.1 - es-abstract@1.22.4: + es-abstract@1.23.3: dependencies: array-buffer-byte-length: 1.0.1 arraybuffer.prototype.slice: 1.0.3 available-typed-arrays: 1.0.7 call-bind: 1.0.7 + data-view-buffer: 1.0.1 + data-view-byte-length: 1.0.1 + data-view-byte-offset: 1.0.0 es-define-property: 1.0.0 es-errors: 1.3.0 + es-object-atoms: 1.0.0 es-set-tostringtag: 2.0.3 es-to-primitive: 1.2.1 function.prototype.name: 1.1.6 get-intrinsic: 1.2.4 get-symbol-description: 1.0.2 - globalthis: 1.0.3 + globalthis: 1.0.4 gopd: 1.0.1 has-property-descriptors: 1.0.2 has-proto: 1.0.3 has-symbols: 1.0.3 - hasown: 2.0.1 + hasown: 2.0.2 internal-slot: 1.0.7 is-array-buffer: 3.0.4 is-callable: 1.2.7 + is-data-view: 1.0.1 is-negative-zero: 2.0.3 is-regex: 1.1.4 is-shared-array-buffer: 1.0.3 is-string: 1.0.7 is-typed-array: 1.1.13 is-weakref: 1.0.2 - object-inspect: 1.13.1 + object-inspect: 1.13.2 object-keys: 1.1.1 object.assign: 4.1.5 regexp.prototype.flags: 1.5.2 - safe-array-concat: 1.1.0 + safe-array-concat: 1.1.2 safe-regex-test: 1.0.3 - string.prototype.trim: 1.2.8 - string.prototype.trimend: 1.0.7 - string.prototype.trimstart: 1.0.7 + string.prototype.trim: 1.2.9 + string.prototype.trimend: 1.0.8 + string.prototype.trimstart: 1.0.8 typed-array-buffer: 1.0.2 typed-array-byte-length: 1.0.1 typed-array-byte-offset: 1.0.2 - typed-array-length: 1.0.5 + typed-array-length: 1.0.6 unbox-primitive: 1.0.2 - which-typed-array: 1.1.14 + which-typed-array: 1.1.15 es-define-property@1.0.0: dependencies: @@ -1481,15 +1531,19 @@ snapshots: es-errors@1.3.0: {} + es-object-atoms@1.0.0: + dependencies: + es-errors: 1.3.0 + es-set-tostringtag@2.0.3: dependencies: get-intrinsic: 1.2.4 has-tostringtag: 1.0.2 - hasown: 2.0.1 + hasown: 2.0.2 es-shim-unscopables@1.0.2: dependencies: - hasown: 2.0.1 + hasown: 2.0.2 es-to-primitive@1.2.1: dependencies: @@ -1497,7 +1551,7 @@ snapshots: is-date-object: 1.0.5 is-symbol: 1.0.4 - escalade@3.1.2: {} + escalade@3.2.0: {} escape-string-regexp@1.0.5: {} @@ -1517,13 +1571,13 @@ snapshots: '@nodelib/fs.walk': 1.2.8 glob-parent: 5.1.2 merge2: 1.4.1 - micromatch: 4.0.5 + micromatch: 4.0.8 fastq@1.17.1: dependencies: reusify: 1.0.4 - fill-range@7.0.1: + fill-range@7.1.1: dependencies: to-regex-range: 5.0.1 @@ -1539,7 +1593,7 @@ snapshots: find-yarn-workspace-root2@1.2.16: dependencies: - micromatch: 4.0.5 + micromatch: 4.0.8 pkg-dir: 4.2.0 for-each@0.3.3: @@ -1564,7 +1618,7 @@ snapshots: dependencies: call-bind: 1.0.7 define-properties: 1.2.1 - es-abstract: 1.22.4 + es-abstract: 1.23.3 functions-have-names: 1.2.3 functions-have-names@1.2.3: {} @@ -1577,7 +1631,7 @@ snapshots: function-bind: 1.1.2 has-proto: 1.0.3 has-symbols: 1.0.3 - hasown: 2.0.1 + hasown: 2.0.2 get-symbol-description@1.0.2: dependencies: @@ -1589,16 +1643,17 @@ snapshots: dependencies: is-glob: 4.0.3 - globalthis@1.0.3: + globalthis@1.0.4: dependencies: define-properties: 1.2.1 + gopd: 1.0.1 globby@11.1.0: dependencies: array-union: 2.1.0 dir-glob: 3.0.1 fast-glob: 3.3.2 - ignore: 5.3.1 + ignore: 5.3.2 merge2: 1.4.1 slash: 3.0.0 @@ -1630,7 +1685,7 @@ snapshots: dependencies: has-symbols: 1.0.3 - hasown@2.0.1: + hasown@2.0.2: dependencies: function-bind: 1.1.2 @@ -1642,15 +1697,15 @@ snapshots: dependencies: safer-buffer: 2.1.2 - ignore@5.3.1: {} + ignore@5.3.2: {} indent-string@4.0.0: {} internal-slot@1.0.7: dependencies: es-errors: 1.3.0 - hasown: 2.0.1 - side-channel: 1.0.5 + hasown: 2.0.2 + side-channel: 1.0.6 is-array-buffer@3.0.4: dependencies: @@ -1674,9 +1729,13 @@ snapshots: dependencies: ci-info: 3.9.0 - is-core-module@2.13.1: + is-core-module@2.15.1: dependencies: - hasown: 2.0.1 + hasown: 2.0.2 + + is-data-view@1.0.1: + dependencies: + is-typed-array: 1.1.13 is-date-object@1.0.5: dependencies: @@ -1723,7 +1782,7 @@ snapshots: is-typed-array@1.1.13: dependencies: - which-typed-array: 1.1.14 + which-typed-array: 1.1.15 is-weakref@1.0.2: dependencies: @@ -1796,9 +1855,9 @@ snapshots: merge2@1.4.1: {} - micromatch@4.0.5: + micromatch@4.0.8: dependencies: - braces: 3.0.2 + braces: 3.0.3 picomatch: 2.3.1 min-indent@1.0.1: {} @@ -1822,7 +1881,7 @@ snapshots: semver: 5.7.2 validate-npm-package-license: 3.0.4 - object-inspect@1.13.1: {} + object-inspect@1.13.2: {} object-keys@1.1.1: {} @@ -1863,7 +1922,7 @@ snapshots: parse-json@5.2.0: dependencies: - '@babel/code-frame': 7.23.5 + '@babel/code-frame': 7.24.7 error-ex: 1.3.2 json-parse-even-better-errors: 2.3.1 lines-and-columns: 1.2.4 @@ -1874,6 +1933,8 @@ snapshots: path-type@4.0.0: {} + picocolors@1.1.0: {} + picomatch@2.3.1: {} pify@4.0.1: {} @@ -1884,12 +1945,12 @@ snapshots: possible-typed-array-names@1.0.0: {} - preferred-pm@3.1.3: + preferred-pm@3.1.4: dependencies: find-up: 5.0.0 find-yarn-workspace-root2: 1.2.16 path-exists: 4.0.0 - which-pm: 2.0.0 + which-pm: 2.2.0 prettier@2.8.8: {} @@ -1941,7 +2002,7 @@ snapshots: resolve@1.22.8: dependencies: - is-core-module: 2.13.1 + is-core-module: 2.15.1 path-parse: 1.0.7 supports-preserve-symlinks-flag: 1.0.0 @@ -1951,7 +2012,7 @@ snapshots: dependencies: queue-microtask: 1.2.3 - safe-array-concat@1.1.0: + safe-array-concat@1.1.2: dependencies: call-bind: 1.0.7 get-intrinsic: 1.2.4 @@ -1968,11 +2029,11 @@ snapshots: semver@5.7.2: {} - semver@7.6.1: {} + semver@7.6.3: {} set-blocking@2.0.0: {} - set-function-length@1.2.1: + set-function-length@1.2.2: dependencies: define-data-property: 1.1.4 es-errors: 1.3.0 @@ -1994,12 +2055,12 @@ snapshots: shebang-regex@1.0.0: {} - side-channel@1.0.5: + side-channel@1.0.6: dependencies: call-bind: 1.0.7 es-errors: 1.3.0 get-intrinsic: 1.2.4 - object-inspect: 1.13.1 + object-inspect: 1.13.2 signal-exit@3.0.7: {} @@ -2022,16 +2083,16 @@ snapshots: spdx-correct@3.2.0: dependencies: spdx-expression-parse: 3.0.1 - spdx-license-ids: 3.0.17 + spdx-license-ids: 3.0.20 spdx-exceptions@2.5.0: {} spdx-expression-parse@3.0.1: dependencies: spdx-exceptions: 2.5.0 - spdx-license-ids: 3.0.17 + spdx-license-ids: 3.0.20 - spdx-license-ids@3.0.17: {} + spdx-license-ids@3.0.20: {} sprintf-js@1.0.3: {} @@ -2045,23 +2106,24 @@ snapshots: is-fullwidth-code-point: 3.0.0 strip-ansi: 6.0.1 - string.prototype.trim@1.2.8: + string.prototype.trim@1.2.9: dependencies: call-bind: 1.0.7 define-properties: 1.2.1 - es-abstract: 1.22.4 + es-abstract: 1.23.3 + es-object-atoms: 1.0.0 - string.prototype.trimend@1.0.7: + string.prototype.trimend@1.0.8: dependencies: call-bind: 1.0.7 define-properties: 1.2.1 - es-abstract: 1.22.4 + es-object-atoms: 1.0.0 - string.prototype.trimstart@1.0.7: + string.prototype.trimstart@1.0.8: dependencies: call-bind: 1.0.7 define-properties: 1.2.1 - es-abstract: 1.22.4 + es-object-atoms: 1.0.0 strip-ansi@6.0.1: dependencies: @@ -2136,7 +2198,7 @@ snapshots: has-proto: 1.0.3 is-typed-array: 1.1.13 - typed-array-length@1.0.5: + typed-array-length@1.0.6: dependencies: call-bind: 1.0.7 for-each: 0.3.3 @@ -2180,12 +2242,12 @@ snapshots: which-module@2.0.1: {} - which-pm@2.0.0: + which-pm@2.2.0: dependencies: load-yaml-file: 0.2.0 path-exists: 4.0.0 - which-typed-array@1.1.14: + which-typed-array@1.1.15: dependencies: available-typed-arrays: 1.0.7 call-bind: 1.0.7 @@ -2239,7 +2301,7 @@ snapshots: yargs@17.7.2: dependencies: cliui: 8.0.1 - escalade: 3.1.2 + escalade: 3.2.0 get-caller-file: 2.0.5 require-directory: 2.1.1 string-width: 4.2.3 diff --git a/shell.nix b/shell.nix index 9aa24ccdd89..3626cb11cf4 100644 --- a/shell.nix +++ b/shell.nix @@ -1,59 +1,63 @@ -{ pkgs }: -with pkgs; -let +{pkgs}: +with pkgs; let go = go_1_21; postgresql = postgresql_14; nodejs = nodejs-18_x; - nodePackages = pkgs.nodePackages.override { inherit nodejs; }; + nodePackages = pkgs.nodePackages.override {inherit nodejs;}; + pnpm = pnpm_9; mkShell' = mkShell.override { # The current nix default sdk for macOS fails to compile go projects, so we use a newer one for now. - stdenv = if stdenv.isDarwin then overrideSDK stdenv "11.0" else stdenv; + stdenv = + if stdenv.isDarwin + then overrideSDK stdenv "11.0" + else stdenv; }; in -mkShell' { - nativeBuildInputs = [ - go - goreleaser - postgresql - - python3 - python3Packages.pip - protobuf - protoc-gen-go - protoc-gen-go-grpc - - foundry-bin - - curl - nodejs - nodePackages.pnpm - # TODO: compiler / gcc for secp compilation - go-ethereum # geth - go-mockery - - # tooling - gotools - gopls - delve - golangci-lint - github-cli - jq - - # cross-compiling, used in CRIB - zig - - # gofuzz - ] ++ lib.optionals stdenv.isLinux [ - # some dependencies needed for node-gyp on pnpm install - pkg-config - libudev-zero - libusb1 - ]; - LD_LIBRARY_PATH = "${stdenv.cc.cc.lib}/lib64:$LD_LIBRARY_PATH"; - GOROOT = "${go}/share/go"; - - PGDATA = "db"; - CL_DATABASE_URL = "postgresql://chainlink:chainlink@localhost:5432/chainlink_test?sslmode=disable"; - -} + mkShell' { + nativeBuildInputs = + [ + go + goreleaser + postgresql + + python3 + python3Packages.pip + protobuf + protoc-gen-go + protoc-gen-go-grpc + + foundry-bin + + curl + nodejs + pnpm + # TODO: compiler / gcc for secp compilation + go-ethereum # geth + go-mockery + + # tooling + gotools + gopls + delve + golangci-lint + github-cli + jq + + # cross-compiling, used in CRIB + zig + + # gofuzz + ] + ++ lib.optionals stdenv.isLinux [ + # some dependencies needed for node-gyp on pnpm install + pkg-config + libudev-zero + libusb1 + ]; + LD_LIBRARY_PATH = "${stdenv.cc.cc.lib}/lib64:$LD_LIBRARY_PATH"; + GOROOT = "${go}/share/go"; + + PGDATA = "db"; + CL_DATABASE_URL = "postgresql://chainlink:chainlink@localhost:5432/chainlink_test?sslmode=disable"; + } diff --git a/testdata/scripts/health/default.txtar b/testdata/scripts/health/default.txtar index 1dbf6b8eb96..8480345e273 100644 --- a/testdata/scripts/health/default.txtar +++ b/testdata/scripts/health/default.txtar @@ -31,6 +31,7 @@ fj293fbBnlQ!f9vNs HTTPPort = $PORT -- out.txt -- +ok HeadReporter ok JobSpawner ok Mailbox.Monitor ok Mercury.WSRPCPool @@ -38,12 +39,20 @@ ok Mercury.WSRPCPool.CacheSet ok PipelineORM ok PipelineRunner ok PipelineRunner.BridgeCache -ok PromReporter ok TelemetryManager -- out.json -- { "data": [ + { + "type": "checks", + "id": "HeadReporter", + "attributes": { + "name": "HeadReporter", + "status": "passing", + "output": "" + } + }, { "type": "checks", "id": "JobSpawner", @@ -107,15 +116,6 @@ ok TelemetryManager "output": "" } }, - { - "type": "checks", - "id": "PromReporter", - "attributes": { - "name": "PromReporter", - "status": "passing", - "output": "" - } - }, { "type": "checks", "id": "TelemetryManager", @@ -126,4 +126,4 @@ ok TelemetryManager } } ] -} +} \ No newline at end of file diff --git a/testdata/scripts/health/help.txtar b/testdata/scripts/health/help.txtar index 07eb0509e73..68176f05a4e 100644 --- a/testdata/scripts/health/help.txtar +++ b/testdata/scripts/health/help.txtar @@ -9,5 +9,6 @@ USAGE: chainlink health [command options] [arguments...] OPTIONS: - --json, -j json output + --failing, -f filter for failing services + --json, -j json output diff --git a/testdata/scripts/health/multi-chain.txtar b/testdata/scripts/health/multi-chain.txtar index 8178f8e8213..bba3b3e111f 100644 --- a/testdata/scripts/health/multi-chain.txtar +++ b/testdata/scripts/health/multi-chain.txtar @@ -15,6 +15,14 @@ cp stdout compact.json exec jq . compact.json cmp stdout out.json +exec chainlink --remote-node-url $NODEURL health -failing +cmp stdout out-unhealthy.txt + +exec chainlink --remote-node-url $NODEURL health -f -json +cp stdout compact.json +exec jq . compact.json +cmp stdout out-unhealthy.json + -- testdb.txt -- CL_DATABASE_URL -- testport.txt -- @@ -74,7 +82,9 @@ ok EVM.1.Txm ok EVM.1.Txm.BlockHistoryEstimator ok EVM.1.Txm.Broadcaster ok EVM.1.Txm.Confirmer +ok EVM.1.Txm.Finalizer ok EVM.1.Txm.WrappedEvmEstimator +ok HeadReporter ok JobSpawner ok Mailbox.Monitor ok Mercury.WSRPCPool @@ -82,11 +92,14 @@ ok Mercury.WSRPCPool.CacheSet ok PipelineORM ok PipelineRunner ok PipelineRunner.BridgeCache -ok PromReporter ok Solana.Bar ok StarkNet.Baz ok TelemetryManager +-- out-unhealthy.txt -- +! EVM.1.HeadTracker.HeadListener + Listener is not connected + -- out.json -- { "data": [ @@ -207,6 +220,15 @@ ok TelemetryManager "output": "" } }, + { + "type": "checks", + "id": "EVM.1.Txm.Finalizer", + "attributes": { + "name": "EVM.1.Txm.Finalizer", + "status": "passing", + "output": "" + } + }, { "type": "checks", "id": "EVM.1.Txm.WrappedEvmEstimator", @@ -216,6 +238,15 @@ ok TelemetryManager "output": "" } }, + { + "type": "checks", + "id": "HeadReporter", + "attributes": { + "name": "HeadReporter", + "status": "passing", + "output": "" + } + }, { "type": "checks", "id": "JobSpawner", @@ -279,15 +310,6 @@ ok TelemetryManager "output": "" } }, - { - "type": "checks", - "id": "PromReporter", - "attributes": { - "name": "PromReporter", - "status": "passing", - "output": "" - } - }, { "type": "checks", "id": "Solana.Bar", @@ -317,3 +339,17 @@ ok TelemetryManager } ] } +-- out-unhealthy.json -- +{ + "data": [ + { + "type": "checks", + "id": "EVM.1.HeadTracker.HeadListener", + "attributes": { + "name": "EVM.1.HeadTracker.HeadListener", + "status": "failing", + "output": "Listener is not connected" + } + } + ] +} diff --git a/testdata/scripts/node/db/help.txtar b/testdata/scripts/node/db/help.txtar index 4f2fe3e0767..ccdf3431786 100644 --- a/testdata/scripts/node/db/help.txtar +++ b/testdata/scripts/node/db/help.txtar @@ -20,4 +20,4 @@ COMMANDS: OPTIONS: --help, -h show help - \ No newline at end of file + diff --git a/testdata/scripts/node/validate/default.txtar b/testdata/scripts/node/validate/default.txtar index 1063d9c2a5a..ad923919e08 100644 --- a/testdata/scripts/node/validate/default.txtar +++ b/testdata/scripts/node/validate/default.txtar @@ -18,6 +18,8 @@ ShutdownGracePeriod = '5s' FeedsManager = true LogPoller = false UICSAKeys = false +CCIP = true +MultiFeedsManagers = false [Database] DefaultIdleInTxSessionTimeout = '1h0m0s' @@ -45,7 +47,7 @@ LeaseDuration = '10s' LeaseRefreshInterval = '1s' [TelemetryIngress] -UniConn = true +UniConn = false Logging = false BufferSize = 100 MaxBatchSize = 50 @@ -263,11 +265,40 @@ DeltaDial = '15s' DeltaReconcile = '1m0s' ListenAddresses = [] +[Capabilities.Dispatcher] +SupportedVersion = 1 +ReceiverBufferSize = 10000 + +[Capabilities.Dispatcher.RateLimit] +GlobalRPS = 800.0 +GlobalBurst = 1000 +PerSenderRPS = 10.0 +PerSenderBurst = 50 + [Capabilities.ExternalRegistry] Address = '' NetworkID = 'evm' ChainID = '1' +[Capabilities.GatewayConnector] +ChainIDForNodeKey = '' +NodeAddress = '' +DonID = '' +WSHandshakeTimeoutMillis = 0 +AuthMinChallengeLen = 0 +AuthTimestampToleranceSec = 0 + +[[Capabilities.GatewayConnector.Gateways]] +ID = '' +URL = '' + +[Telemetry] +Enabled = false +CACertFile = '' +Endpoint = '' +InsecureConnection = false +TraceSampleRatio = 0.01 + Invalid configuration: invalid secrets: 2 errors: - Database.URL: empty: must be provided and non-empty - Password.Keystore: empty: must be provided and non-empty diff --git a/testdata/scripts/node/validate/defaults-override.txtar b/testdata/scripts/node/validate/defaults-override.txtar new file mode 100644 index 00000000000..5c36fddeaf1 --- /dev/null +++ b/testdata/scripts/node/validate/defaults-override.txtar @@ -0,0 +1,469 @@ +# test with default override +env CL_CHAIN_DEFAULTS=default_overrides +exec chainlink node -c config.toml -s secrets.toml validate +cmp stdout out.txt + +# remove override, FinalityTagEnabled should no longer match +env CL_CHAIN_DEFAULTS= +exec chainlink node -c config.toml -s secrets.toml validate +! cmp stdout out.txt + +# overrides outside of evm suffix, FinalityTagEnabled should not match as override is not applied +env CL_CHAIN_DEFAULTS=default_overrides2 +! exec chainlink node -c config.toml -s secrets.toml validate + +# duplicate chain IDs +env CL_CHAIN_DEFAULTS=default_overrides3 +! exec chainlink node -c config.toml -s secrets.toml validate +stderr 'contains duplicate ChainID' + +-- default_overrides/evm/Ethereum_Mainnet.toml -- +ChainID = '1' +FinalityTagEnabled = false + +-- default_overrides2/Ethereum_Mainnet.toml -- +ChainID = '1' +FinalityTagEnabled = false + +-- default_overrides3/evm/Ethereum_Mainnet.toml -- +ChainID = '1' + +-- default_overrides3/evm/Ethereum_Testnet.toml -- +ChainID = '1' + +-- config.toml -- +Log.Level = 'debug' + +[[EVM]] +ChainID = '1' + +[[EVM.Nodes]] +Name = 'fake' +WSURL = 'wss://foo.bar/ws' +HTTPURL = 'https://foo.bar' + +-- secrets.toml -- +[Database] +URL = 'postgresql://user:pass1234567890abcd@localhost:5432/dbname?sslmode=disable' + +[Password] +Keystore = 'keystore_pass' + +-- out.txt -- +# Secrets: +[Database] +URL = 'xxxxx' +AllowSimplePasswords = false + +[Password] +Keystore = 'xxxxx' + +# Input Configuration: +[Log] +Level = 'debug' + +[[EVM]] +ChainID = '1' + +[[EVM.Nodes]] +Name = 'fake' +WSURL = 'wss://foo.bar/ws' +HTTPURL = 'https://foo.bar' + +# Effective Configuration, with defaults applied: +InsecureFastScrypt = false +RootDir = '~/.chainlink' +ShutdownGracePeriod = '5s' + +[Feature] +FeedsManager = true +LogPoller = false +UICSAKeys = false +CCIP = true +MultiFeedsManagers = false + +[Database] +DefaultIdleInTxSessionTimeout = '1h0m0s' +DefaultLockTimeout = '15s' +DefaultQueryTimeout = '10s' +LogQueries = false +MaxIdleConns = 10 +MaxOpenConns = 100 +MigrateOnStartup = true + +[Database.Backup] +Dir = '' +Frequency = '1h0m0s' +Mode = 'none' +OnVersionUpgrade = true + +[Database.Listener] +MaxReconnectDuration = '10m0s' +MinReconnectInterval = '1m0s' +FallbackPollInterval = '30s' + +[Database.Lock] +Enabled = true +LeaseDuration = '10s' +LeaseRefreshInterval = '1s' + +[TelemetryIngress] +UniConn = false +Logging = false +BufferSize = 100 +MaxBatchSize = 50 +SendInterval = '500ms' +SendTimeout = '10s' +UseBatchSend = true + +[AuditLogger] +Enabled = false +ForwardToUrl = '' +JsonWrapperKey = '' +Headers = [] + +[Log] +Level = 'debug' +JSONConsole = false +UnixTS = false + +[Log.File] +Dir = '' +MaxSize = '5.12gb' +MaxAgeDays = 0 +MaxBackups = 1 + +[WebServer] +AuthenticationMethod = 'local' +AllowOrigins = 'http://localhost:3000,http://localhost:6688' +BridgeResponseURL = '' +BridgeCacheTTL = '0s' +HTTPWriteTimeout = '10s' +HTTPPort = 6688 +SecureCookies = true +SessionTimeout = '15m0s' +SessionReaperExpiration = '240h0m0s' +HTTPMaxSize = '32.77kb' +StartTimeout = '15s' +ListenIP = '0.0.0.0' + +[WebServer.LDAP] +ServerTLS = true +SessionTimeout = '15m0s' +QueryTimeout = '2m0s' +BaseUserAttr = 'uid' +BaseDN = '' +UsersDN = 'ou=users' +GroupsDN = 'ou=groups' +ActiveAttribute = '' +ActiveAttributeAllowedValue = '' +AdminUserGroupCN = 'NodeAdmins' +EditUserGroupCN = 'NodeEditors' +RunUserGroupCN = 'NodeRunners' +ReadUserGroupCN = 'NodeReadOnly' +UserApiTokenEnabled = false +UserAPITokenDuration = '240h0m0s' +UpstreamSyncInterval = '0s' +UpstreamSyncRateLimit = '2m0s' + +[WebServer.MFA] +RPID = '' +RPOrigin = '' + +[WebServer.RateLimit] +Authenticated = 1000 +AuthenticatedPeriod = '1m0s' +Unauthenticated = 5 +UnauthenticatedPeriod = '20s' + +[WebServer.TLS] +CertPath = '' +ForceRedirect = false +Host = '' +HTTPSPort = 6689 +KeyPath = '' +ListenIP = '0.0.0.0' + +[JobPipeline] +ExternalInitiatorsEnabled = false +MaxRunDuration = '10m0s' +MaxSuccessfulRuns = 10000 +ReaperInterval = '1h0m0s' +ReaperThreshold = '24h0m0s' +ResultWriteQueueDepth = 100 +VerboseLogging = true + +[JobPipeline.HTTPRequest] +DefaultTimeout = '15s' +MaxSize = '32.77kb' + +[FluxMonitor] +DefaultTransactionQueueDepth = 1 +SimulateTransactions = false + +[OCR2] +Enabled = false +ContractConfirmations = 3 +BlockchainTimeout = '20s' +ContractPollInterval = '1m0s' +ContractSubscribeInterval = '2m0s' +ContractTransmitterTransmitTimeout = '10s' +DatabaseTimeout = '10s' +KeyBundleID = '0000000000000000000000000000000000000000000000000000000000000000' +CaptureEATelemetry = false +CaptureAutomationCustomTelemetry = true +DefaultTransactionQueueDepth = 1 +SimulateTransactions = false +TraceLogging = false + +[OCR] +Enabled = false +ObservationTimeout = '5s' +BlockchainTimeout = '20s' +ContractPollInterval = '1m0s' +ContractSubscribeInterval = '2m0s' +DefaultTransactionQueueDepth = 1 +KeyBundleID = '0000000000000000000000000000000000000000000000000000000000000000' +SimulateTransactions = false +TransmitterAddress = '' +CaptureEATelemetry = false +TraceLogging = false + +[P2P] +IncomingMessageBufferSize = 10 +OutgoingMessageBufferSize = 10 +PeerID = '' +TraceLogging = false + +[P2P.V2] +Enabled = true +AnnounceAddresses = [] +DefaultBootstrappers = [] +DeltaDial = '15s' +DeltaReconcile = '1m0s' +ListenAddresses = [] + +[Keeper] +DefaultTransactionQueueDepth = 1 +GasPriceBufferPercent = 20 +GasTipCapBufferPercent = 20 +BaseFeeBufferPercent = 20 +MaxGracePeriod = 100 +TurnLookBack = 1000 + +[Keeper.Registry] +CheckGasOverhead = 200000 +PerformGasOverhead = 300000 +MaxPerformDataSize = 5000 +SyncInterval = '30m0s' +SyncUpkeepQueueSize = 10 + +[AutoPprof] +Enabled = false +ProfileRoot = '' +PollInterval = '10s' +GatherDuration = '10s' +GatherTraceDuration = '5s' +MaxProfileSize = '100.00mb' +CPUProfileRate = 1 +MemProfileRate = 1 +BlockProfileRate = 1 +MutexProfileFraction = 1 +MemThreshold = '4.00gb' +GoroutineThreshold = 5000 + +[Pyroscope] +ServerAddress = '' +Environment = 'mainnet' + +[Sentry] +Debug = false +DSN = '' +Environment = '' +Release = '' + +[Insecure] +DevWebServer = false +OCRDevelopmentMode = false +InfiniteDepthQueries = false +DisableRateLimiting = false + +[Tracing] +Enabled = false +CollectorTarget = '' +NodeID = '' +SamplingRatio = 0.0 +Mode = 'tls' +TLSCertPath = '' + +[Mercury] +VerboseLogging = false + +[Mercury.Cache] +LatestReportTTL = '1s' +MaxStaleAge = '1h0m0s' +LatestReportDeadline = '5s' + +[Mercury.TLS] +CertFile = '' + +[Mercury.Transmitter] +TransmitQueueMaxSize = 10000 +TransmitTimeout = '5s' + +[Capabilities] +[Capabilities.Peering] +IncomingMessageBufferSize = 10 +OutgoingMessageBufferSize = 10 +PeerID = '' +TraceLogging = false + +[Capabilities.Peering.V2] +Enabled = false +AnnounceAddresses = [] +DefaultBootstrappers = [] +DeltaDial = '15s' +DeltaReconcile = '1m0s' +ListenAddresses = [] + +[Capabilities.Dispatcher] +SupportedVersion = 1 +ReceiverBufferSize = 10000 + +[Capabilities.Dispatcher.RateLimit] +GlobalRPS = 800.0 +GlobalBurst = 1000 +PerSenderRPS = 10.0 +PerSenderBurst = 50 + +[Capabilities.ExternalRegistry] +Address = '' +NetworkID = 'evm' +ChainID = '1' + +[Capabilities.GatewayConnector] +ChainIDForNodeKey = '' +NodeAddress = '' +DonID = '' +WSHandshakeTimeoutMillis = 0 +AuthMinChallengeLen = 0 +AuthTimestampToleranceSec = 0 + +[[Capabilities.GatewayConnector.Gateways]] +ID = '' +URL = '' + +[Telemetry] +Enabled = false +CACertFile = '' +Endpoint = '' +InsecureConnection = false +TraceSampleRatio = 0.01 + +[[EVM]] +ChainID = '1' +AutoCreateKey = true +BlockBackfillDepth = 10 +BlockBackfillSkip = false +FinalityDepth = 50 +FinalityTagEnabled = false +LinkContractAddress = '0x514910771AF9Ca656af840dff83E8264EcF986CA' +LogBackfillBatchSize = 1000 +LogPollInterval = '15s' +LogKeepBlocksDepth = 100000 +LogPrunePageSize = 0 +BackupLogPollerBlockDelay = 100 +MinIncomingConfirmations = 3 +MinContractPayment = '0.1 link' +NonceAutoSync = true +NoNewHeadsThreshold = '3m0s' +OperatorFactoryAddress = '0x3E64Cd889482443324F91bFA9c84fE72A511f48A' +LogBroadcasterEnabled = true +RPCDefaultBatchSize = 250 +RPCBlockQueryDelay = 1 +FinalizedBlockOffset = 0 +NoNewFinalizedHeadsThreshold = '9m0s' + +[EVM.Transactions] +ForwardersEnabled = false +MaxInFlight = 16 +MaxQueued = 250 +ReaperInterval = '1h0m0s' +ReaperThreshold = '168h0m0s' +ResendAfterThreshold = '1m0s' + +[EVM.Transactions.AutoPurge] +Enabled = false + +[EVM.BalanceMonitor] +Enabled = true + +[EVM.GasEstimator] +Mode = 'BlockHistory' +PriceDefault = '20 gwei' +PriceMax = '115792089237316195423570985008687907853269984665.640564039457584007913129639935 tether' +PriceMin = '1 gwei' +LimitDefault = 500000 +LimitMax = 500000 +LimitMultiplier = '1' +LimitTransfer = 21000 +EstimateLimit = false +BumpMin = '5 gwei' +BumpPercent = 20 +BumpThreshold = 3 +EIP1559DynamicFees = true +FeeCapDefault = '100 gwei' +TipCapDefault = '1 wei' +TipCapMin = '1 wei' + +[EVM.GasEstimator.BlockHistory] +BatchSize = 25 +BlockHistorySize = 4 +CheckInclusionBlocks = 12 +CheckInclusionPercentile = 90 +TransactionPercentile = 50 + +[EVM.GasEstimator.FeeHistory] +CacheTimeout = '10s' + +[EVM.HeadTracker] +HistoryDepth = 100 +MaxBufferSize = 3 +SamplingInterval = '1s' +MaxAllowedFinalityDepth = 10000 +FinalityTagBypass = true +PersistenceEnabled = true + +[EVM.NodePool] +PollFailureThreshold = 5 +PollInterval = '10s' +SelectionMode = 'HighestHead' +SyncThreshold = 5 +LeaseDuration = '0s' +NodeIsSyncingEnabled = false +FinalizedBlockPollInterval = '5s' +EnforceRepeatableRead = false +DeathDeclarationDelay = '10s' +NewHeadsPollInterval = '0s' + +[EVM.OCR] +ContractConfirmations = 4 +ContractTransmitterTransmitTimeout = '10s' +DatabaseTimeout = '10s' +DeltaCOverride = '168h0m0s' +DeltaCJitterOverride = '1h0m0s' +ObservationGracePeriod = '1s' + +[EVM.OCR2] +[EVM.OCR2.Automation] +GasLimit = 10500000 + +[EVM.Workflow] +GasLimitDefault = 400000 + +[[EVM.Nodes]] +Name = 'fake' +WSURL = 'wss://foo.bar/ws' +HTTPURL = 'https://foo.bar' + +Valid configuration. diff --git a/testdata/scripts/node/validate/disk-based-logging-disabled.txtar b/testdata/scripts/node/validate/disk-based-logging-disabled.txtar index 327e84c51bb..9a9f5e88811 100644 --- a/testdata/scripts/node/validate/disk-based-logging-disabled.txtar +++ b/testdata/scripts/node/validate/disk-based-logging-disabled.txtar @@ -62,6 +62,8 @@ ShutdownGracePeriod = '5s' FeedsManager = true LogPoller = false UICSAKeys = false +CCIP = true +MultiFeedsManagers = false [Database] DefaultIdleInTxSessionTimeout = '1h0m0s' @@ -89,7 +91,7 @@ LeaseDuration = '10s' LeaseRefreshInterval = '1s' [TelemetryIngress] -UniConn = true +UniConn = false Logging = false BufferSize = 100 MaxBatchSize = 50 @@ -307,18 +309,47 @@ DeltaDial = '15s' DeltaReconcile = '1m0s' ListenAddresses = [] +[Capabilities.Dispatcher] +SupportedVersion = 1 +ReceiverBufferSize = 10000 + +[Capabilities.Dispatcher.RateLimit] +GlobalRPS = 800.0 +GlobalBurst = 1000 +PerSenderRPS = 10.0 +PerSenderBurst = 50 + [Capabilities.ExternalRegistry] Address = '' NetworkID = 'evm' ChainID = '1' +[Capabilities.GatewayConnector] +ChainIDForNodeKey = '' +NodeAddress = '' +DonID = '' +WSHandshakeTimeoutMillis = 0 +AuthMinChallengeLen = 0 +AuthTimestampToleranceSec = 0 + +[[Capabilities.GatewayConnector.Gateways]] +ID = '' +URL = '' + +[Telemetry] +Enabled = false +CACertFile = '' +Endpoint = '' +InsecureConnection = false +TraceSampleRatio = 0.01 + [[EVM]] ChainID = '1' AutoCreateKey = true BlockBackfillDepth = 10 BlockBackfillSkip = false FinalityDepth = 50 -FinalityTagEnabled = false +FinalityTagEnabled = true LinkContractAddress = '0x514910771AF9Ca656af840dff83E8264EcF986CA' LogBackfillBatchSize = 1000 LogPollInterval = '15s' @@ -330,9 +361,11 @@ MinContractPayment = '0.1 link' NonceAutoSync = true NoNewHeadsThreshold = '3m0s' OperatorFactoryAddress = '0x3E64Cd889482443324F91bFA9c84fE72A511f48A' +LogBroadcasterEnabled = true RPCDefaultBatchSize = 250 RPCBlockQueryDelay = 1 FinalizedBlockOffset = 0 +NoNewFinalizedHeadsThreshold = '9m0s' [EVM.Transactions] ForwardersEnabled = false @@ -357,6 +390,7 @@ LimitDefault = 500000 LimitMax = 500000 LimitMultiplier = '1' LimitTransfer = 21000 +EstimateLimit = false BumpMin = '5 gwei' BumpPercent = 20 BumpThreshold = 3 @@ -372,12 +406,16 @@ CheckInclusionBlocks = 12 CheckInclusionPercentile = 90 TransactionPercentile = 50 +[EVM.GasEstimator.FeeHistory] +CacheTimeout = '10s' + [EVM.HeadTracker] HistoryDepth = 100 MaxBufferSize = 3 SamplingInterval = '1s' MaxAllowedFinalityDepth = 10000 FinalityTagBypass = true +PersistenceEnabled = true [EVM.NodePool] PollFailureThreshold = 5 @@ -389,6 +427,7 @@ NodeIsSyncingEnabled = false FinalizedBlockPollInterval = '5s' EnforceRepeatableRead = false DeathDeclarationDelay = '10s' +NewHeadsPollInterval = '0s' [EVM.OCR] ContractConfirmations = 4 @@ -402,6 +441,9 @@ ObservationGracePeriod = '1s' [EVM.OCR2.Automation] GasLimit = 10500000 +[EVM.Workflow] +GasLimitDefault = 400000 + [[EVM.Nodes]] Name = 'fake' WSURL = 'wss://foo.bar/ws' diff --git a/testdata/scripts/node/validate/disk-based-logging-no-dir.txtar b/testdata/scripts/node/validate/disk-based-logging-no-dir.txtar index 724b59e52d3..8b4089832eb 100644 --- a/testdata/scripts/node/validate/disk-based-logging-no-dir.txtar +++ b/testdata/scripts/node/validate/disk-based-logging-no-dir.txtar @@ -62,6 +62,8 @@ ShutdownGracePeriod = '5s' FeedsManager = true LogPoller = false UICSAKeys = false +CCIP = true +MultiFeedsManagers = false [Database] DefaultIdleInTxSessionTimeout = '1h0m0s' @@ -89,7 +91,7 @@ LeaseDuration = '10s' LeaseRefreshInterval = '1s' [TelemetryIngress] -UniConn = true +UniConn = false Logging = false BufferSize = 100 MaxBatchSize = 50 @@ -307,18 +309,47 @@ DeltaDial = '15s' DeltaReconcile = '1m0s' ListenAddresses = [] +[Capabilities.Dispatcher] +SupportedVersion = 1 +ReceiverBufferSize = 10000 + +[Capabilities.Dispatcher.RateLimit] +GlobalRPS = 800.0 +GlobalBurst = 1000 +PerSenderRPS = 10.0 +PerSenderBurst = 50 + [Capabilities.ExternalRegistry] Address = '' NetworkID = 'evm' ChainID = '1' +[Capabilities.GatewayConnector] +ChainIDForNodeKey = '' +NodeAddress = '' +DonID = '' +WSHandshakeTimeoutMillis = 0 +AuthMinChallengeLen = 0 +AuthTimestampToleranceSec = 0 + +[[Capabilities.GatewayConnector.Gateways]] +ID = '' +URL = '' + +[Telemetry] +Enabled = false +CACertFile = '' +Endpoint = '' +InsecureConnection = false +TraceSampleRatio = 0.01 + [[EVM]] ChainID = '1' AutoCreateKey = true BlockBackfillDepth = 10 BlockBackfillSkip = false FinalityDepth = 50 -FinalityTagEnabled = false +FinalityTagEnabled = true LinkContractAddress = '0x514910771AF9Ca656af840dff83E8264EcF986CA' LogBackfillBatchSize = 1000 LogPollInterval = '15s' @@ -330,9 +361,11 @@ MinContractPayment = '0.1 link' NonceAutoSync = true NoNewHeadsThreshold = '3m0s' OperatorFactoryAddress = '0x3E64Cd889482443324F91bFA9c84fE72A511f48A' +LogBroadcasterEnabled = true RPCDefaultBatchSize = 250 RPCBlockQueryDelay = 1 FinalizedBlockOffset = 0 +NoNewFinalizedHeadsThreshold = '9m0s' [EVM.Transactions] ForwardersEnabled = false @@ -357,6 +390,7 @@ LimitDefault = 500000 LimitMax = 500000 LimitMultiplier = '1' LimitTransfer = 21000 +EstimateLimit = false BumpMin = '5 gwei' BumpPercent = 20 BumpThreshold = 3 @@ -372,12 +406,16 @@ CheckInclusionBlocks = 12 CheckInclusionPercentile = 90 TransactionPercentile = 50 +[EVM.GasEstimator.FeeHistory] +CacheTimeout = '10s' + [EVM.HeadTracker] HistoryDepth = 100 MaxBufferSize = 3 SamplingInterval = '1s' MaxAllowedFinalityDepth = 10000 FinalityTagBypass = true +PersistenceEnabled = true [EVM.NodePool] PollFailureThreshold = 5 @@ -389,6 +427,7 @@ NodeIsSyncingEnabled = false FinalizedBlockPollInterval = '5s' EnforceRepeatableRead = false DeathDeclarationDelay = '10s' +NewHeadsPollInterval = '0s' [EVM.OCR] ContractConfirmations = 4 @@ -402,6 +441,9 @@ ObservationGracePeriod = '1s' [EVM.OCR2.Automation] GasLimit = 10500000 +[EVM.Workflow] +GasLimitDefault = 400000 + [[EVM.Nodes]] Name = 'fake' WSURL = 'wss://foo.bar/ws' diff --git a/testdata/scripts/node/validate/disk-based-logging.txtar b/testdata/scripts/node/validate/disk-based-logging.txtar index e0eefcba85b..ef496ddfd8b 100644 --- a/testdata/scripts/node/validate/disk-based-logging.txtar +++ b/testdata/scripts/node/validate/disk-based-logging.txtar @@ -62,6 +62,8 @@ ShutdownGracePeriod = '5s' FeedsManager = true LogPoller = false UICSAKeys = false +CCIP = true +MultiFeedsManagers = false [Database] DefaultIdleInTxSessionTimeout = '1h0m0s' @@ -89,7 +91,7 @@ LeaseDuration = '10s' LeaseRefreshInterval = '1s' [TelemetryIngress] -UniConn = true +UniConn = false Logging = false BufferSize = 100 MaxBatchSize = 50 @@ -307,18 +309,47 @@ DeltaDial = '15s' DeltaReconcile = '1m0s' ListenAddresses = [] +[Capabilities.Dispatcher] +SupportedVersion = 1 +ReceiverBufferSize = 10000 + +[Capabilities.Dispatcher.RateLimit] +GlobalRPS = 800.0 +GlobalBurst = 1000 +PerSenderRPS = 10.0 +PerSenderBurst = 50 + [Capabilities.ExternalRegistry] Address = '' NetworkID = 'evm' ChainID = '1' +[Capabilities.GatewayConnector] +ChainIDForNodeKey = '' +NodeAddress = '' +DonID = '' +WSHandshakeTimeoutMillis = 0 +AuthMinChallengeLen = 0 +AuthTimestampToleranceSec = 0 + +[[Capabilities.GatewayConnector.Gateways]] +ID = '' +URL = '' + +[Telemetry] +Enabled = false +CACertFile = '' +Endpoint = '' +InsecureConnection = false +TraceSampleRatio = 0.01 + [[EVM]] ChainID = '1' AutoCreateKey = true BlockBackfillDepth = 10 BlockBackfillSkip = false FinalityDepth = 50 -FinalityTagEnabled = false +FinalityTagEnabled = true LinkContractAddress = '0x514910771AF9Ca656af840dff83E8264EcF986CA' LogBackfillBatchSize = 1000 LogPollInterval = '15s' @@ -330,9 +361,11 @@ MinContractPayment = '0.1 link' NonceAutoSync = true NoNewHeadsThreshold = '3m0s' OperatorFactoryAddress = '0x3E64Cd889482443324F91bFA9c84fE72A511f48A' +LogBroadcasterEnabled = true RPCDefaultBatchSize = 250 RPCBlockQueryDelay = 1 FinalizedBlockOffset = 0 +NoNewFinalizedHeadsThreshold = '9m0s' [EVM.Transactions] ForwardersEnabled = false @@ -357,6 +390,7 @@ LimitDefault = 500000 LimitMax = 500000 LimitMultiplier = '1' LimitTransfer = 21000 +EstimateLimit = false BumpMin = '5 gwei' BumpPercent = 20 BumpThreshold = 3 @@ -372,12 +406,16 @@ CheckInclusionBlocks = 12 CheckInclusionPercentile = 90 TransactionPercentile = 50 +[EVM.GasEstimator.FeeHistory] +CacheTimeout = '10s' + [EVM.HeadTracker] HistoryDepth = 100 MaxBufferSize = 3 SamplingInterval = '1s' MaxAllowedFinalityDepth = 10000 FinalityTagBypass = true +PersistenceEnabled = true [EVM.NodePool] PollFailureThreshold = 5 @@ -389,6 +427,7 @@ NodeIsSyncingEnabled = false FinalizedBlockPollInterval = '5s' EnforceRepeatableRead = false DeathDeclarationDelay = '10s' +NewHeadsPollInterval = '0s' [EVM.OCR] ContractConfirmations = 4 @@ -402,6 +441,9 @@ ObservationGracePeriod = '1s' [EVM.OCR2.Automation] GasLimit = 10500000 +[EVM.Workflow] +GasLimitDefault = 400000 + [[EVM.Nodes]] Name = 'fake' WSURL = 'wss://foo.bar/ws' diff --git a/testdata/scripts/node/validate/invalid-ocr-p2p.txtar b/testdata/scripts/node/validate/invalid-ocr-p2p.txtar index 6a09dd06c47..d3e56f97fbb 100644 --- a/testdata/scripts/node/validate/invalid-ocr-p2p.txtar +++ b/testdata/scripts/node/validate/invalid-ocr-p2p.txtar @@ -47,6 +47,8 @@ ShutdownGracePeriod = '5s' FeedsManager = true LogPoller = false UICSAKeys = false +CCIP = true +MultiFeedsManagers = false [Database] DefaultIdleInTxSessionTimeout = '1h0m0s' @@ -74,7 +76,7 @@ LeaseDuration = '10s' LeaseRefreshInterval = '1s' [TelemetryIngress] -UniConn = true +UniConn = false Logging = false BufferSize = 100 MaxBatchSize = 50 @@ -292,11 +294,40 @@ DeltaDial = '15s' DeltaReconcile = '1m0s' ListenAddresses = [] +[Capabilities.Dispatcher] +SupportedVersion = 1 +ReceiverBufferSize = 10000 + +[Capabilities.Dispatcher.RateLimit] +GlobalRPS = 800.0 +GlobalBurst = 1000 +PerSenderRPS = 10.0 +PerSenderBurst = 50 + [Capabilities.ExternalRegistry] Address = '' NetworkID = 'evm' ChainID = '1' +[Capabilities.GatewayConnector] +ChainIDForNodeKey = '' +NodeAddress = '' +DonID = '' +WSHandshakeTimeoutMillis = 0 +AuthMinChallengeLen = 0 +AuthTimestampToleranceSec = 0 + +[[Capabilities.GatewayConnector.Gateways]] +ID = '' +URL = '' + +[Telemetry] +Enabled = false +CACertFile = '' +Endpoint = '' +InsecureConnection = false +TraceSampleRatio = 0.01 + Invalid configuration: invalid configuration: P2P.V2.Enabled: invalid value (false): P2P required for OCR or OCR2. Please enable P2P or disable OCR/OCR2. -- err.txt -- diff --git a/testdata/scripts/node/validate/invalid.txtar b/testdata/scripts/node/validate/invalid.txtar index 1955e919da3..81c5a494440 100644 --- a/testdata/scripts/node/validate/invalid.txtar +++ b/testdata/scripts/node/validate/invalid.txtar @@ -52,6 +52,8 @@ ShutdownGracePeriod = '5s' FeedsManager = true LogPoller = false UICSAKeys = false +CCIP = true +MultiFeedsManagers = false [Database] DefaultIdleInTxSessionTimeout = '1h0m0s' @@ -79,7 +81,7 @@ LeaseDuration = '10s' LeaseRefreshInterval = '1s' [TelemetryIngress] -UniConn = true +UniConn = false Logging = false BufferSize = 100 MaxBatchSize = 50 @@ -297,18 +299,47 @@ DeltaDial = '15s' DeltaReconcile = '1m0s' ListenAddresses = [] +[Capabilities.Dispatcher] +SupportedVersion = 1 +ReceiverBufferSize = 10000 + +[Capabilities.Dispatcher.RateLimit] +GlobalRPS = 800.0 +GlobalBurst = 1000 +PerSenderRPS = 10.0 +PerSenderBurst = 50 + [Capabilities.ExternalRegistry] Address = '' NetworkID = 'evm' ChainID = '1' +[Capabilities.GatewayConnector] +ChainIDForNodeKey = '' +NodeAddress = '' +DonID = '' +WSHandshakeTimeoutMillis = 0 +AuthMinChallengeLen = 0 +AuthTimestampToleranceSec = 0 + +[[Capabilities.GatewayConnector.Gateways]] +ID = '' +URL = '' + +[Telemetry] +Enabled = false +CACertFile = '' +Endpoint = '' +InsecureConnection = false +TraceSampleRatio = 0.01 + [[EVM]] ChainID = '1' AutoCreateKey = true BlockBackfillDepth = 10 BlockBackfillSkip = false FinalityDepth = 50 -FinalityTagEnabled = false +FinalityTagEnabled = true LinkContractAddress = '0x514910771AF9Ca656af840dff83E8264EcF986CA' LogBackfillBatchSize = 1000 LogPollInterval = '15s' @@ -320,9 +351,11 @@ MinContractPayment = '0.1 link' NonceAutoSync = true NoNewHeadsThreshold = '3m0s' OperatorFactoryAddress = '0x3E64Cd889482443324F91bFA9c84fE72A511f48A' +LogBroadcasterEnabled = true RPCDefaultBatchSize = 250 RPCBlockQueryDelay = 1 FinalizedBlockOffset = 0 +NoNewFinalizedHeadsThreshold = '9m0s' [EVM.Transactions] ForwardersEnabled = false @@ -347,6 +380,7 @@ LimitDefault = 500000 LimitMax = 500000 LimitMultiplier = '1' LimitTransfer = 21000 +EstimateLimit = false BumpMin = '5 gwei' BumpPercent = 20 BumpThreshold = 3 @@ -362,12 +396,16 @@ CheckInclusionBlocks = 12 CheckInclusionPercentile = 90 TransactionPercentile = 50 +[EVM.GasEstimator.FeeHistory] +CacheTimeout = '10s' + [EVM.HeadTracker] HistoryDepth = 100 MaxBufferSize = 3 SamplingInterval = '1s' MaxAllowedFinalityDepth = 10000 FinalityTagBypass = true +PersistenceEnabled = true [EVM.NodePool] PollFailureThreshold = 5 @@ -379,6 +417,7 @@ NodeIsSyncingEnabled = false FinalizedBlockPollInterval = '5s' EnforceRepeatableRead = false DeathDeclarationDelay = '10s' +NewHeadsPollInterval = '0s' [EVM.OCR] ContractConfirmations = 4 @@ -392,6 +431,9 @@ ObservationGracePeriod = '1s' [EVM.OCR2.Automation] GasLimit = 10500000 +[EVM.Workflow] +GasLimitDefault = 400000 + [[EVM.Nodes]] Name = 'fake' WSURL = 'wss://foo.bar/ws' diff --git a/testdata/scripts/node/validate/valid.txtar b/testdata/scripts/node/validate/valid.txtar index 3ba20f6f9d6..063436f1079 100644 --- a/testdata/scripts/node/validate/valid.txtar +++ b/testdata/scripts/node/validate/valid.txtar @@ -59,6 +59,8 @@ ShutdownGracePeriod = '5s' FeedsManager = true LogPoller = false UICSAKeys = false +CCIP = true +MultiFeedsManagers = false [Database] DefaultIdleInTxSessionTimeout = '1h0m0s' @@ -86,7 +88,7 @@ LeaseDuration = '10s' LeaseRefreshInterval = '1s' [TelemetryIngress] -UniConn = true +UniConn = false Logging = false BufferSize = 100 MaxBatchSize = 50 @@ -304,18 +306,47 @@ DeltaDial = '15s' DeltaReconcile = '1m0s' ListenAddresses = [] +[Capabilities.Dispatcher] +SupportedVersion = 1 +ReceiverBufferSize = 10000 + +[Capabilities.Dispatcher.RateLimit] +GlobalRPS = 800.0 +GlobalBurst = 1000 +PerSenderRPS = 10.0 +PerSenderBurst = 50 + [Capabilities.ExternalRegistry] Address = '' NetworkID = 'evm' ChainID = '1' +[Capabilities.GatewayConnector] +ChainIDForNodeKey = '' +NodeAddress = '' +DonID = '' +WSHandshakeTimeoutMillis = 0 +AuthMinChallengeLen = 0 +AuthTimestampToleranceSec = 0 + +[[Capabilities.GatewayConnector.Gateways]] +ID = '' +URL = '' + +[Telemetry] +Enabled = false +CACertFile = '' +Endpoint = '' +InsecureConnection = false +TraceSampleRatio = 0.01 + [[EVM]] ChainID = '1' AutoCreateKey = true BlockBackfillDepth = 10 BlockBackfillSkip = false FinalityDepth = 50 -FinalityTagEnabled = false +FinalityTagEnabled = true LinkContractAddress = '0x514910771AF9Ca656af840dff83E8264EcF986CA' LogBackfillBatchSize = 1000 LogPollInterval = '15s' @@ -327,9 +358,11 @@ MinContractPayment = '0.1 link' NonceAutoSync = true NoNewHeadsThreshold = '3m0s' OperatorFactoryAddress = '0x3E64Cd889482443324F91bFA9c84fE72A511f48A' +LogBroadcasterEnabled = true RPCDefaultBatchSize = 250 RPCBlockQueryDelay = 1 FinalizedBlockOffset = 0 +NoNewFinalizedHeadsThreshold = '9m0s' [EVM.Transactions] ForwardersEnabled = false @@ -354,6 +387,7 @@ LimitDefault = 500000 LimitMax = 500000 LimitMultiplier = '1' LimitTransfer = 21000 +EstimateLimit = false BumpMin = '5 gwei' BumpPercent = 20 BumpThreshold = 3 @@ -369,12 +403,16 @@ CheckInclusionBlocks = 12 CheckInclusionPercentile = 90 TransactionPercentile = 50 +[EVM.GasEstimator.FeeHistory] +CacheTimeout = '10s' + [EVM.HeadTracker] HistoryDepth = 100 MaxBufferSize = 3 SamplingInterval = '1s' MaxAllowedFinalityDepth = 10000 FinalityTagBypass = true +PersistenceEnabled = true [EVM.NodePool] PollFailureThreshold = 5 @@ -386,6 +424,7 @@ NodeIsSyncingEnabled = false FinalizedBlockPollInterval = '5s' EnforceRepeatableRead = false DeathDeclarationDelay = '10s' +NewHeadsPollInterval = '0s' [EVM.OCR] ContractConfirmations = 4 @@ -399,6 +438,9 @@ ObservationGracePeriod = '1s' [EVM.OCR2.Automation] GasLimit = 10500000 +[EVM.Workflow] +GasLimitDefault = 400000 + [[EVM.Nodes]] Name = 'fake' WSURL = 'wss://foo.bar/ws' diff --git a/testdata/scripts/node/validate/warnings.txtar b/testdata/scripts/node/validate/warnings.txtar index a652943e26b..ac8489f3246 100644 --- a/testdata/scripts/node/validate/warnings.txtar +++ b/testdata/scripts/node/validate/warnings.txtar @@ -41,6 +41,8 @@ ShutdownGracePeriod = '5s' FeedsManager = true LogPoller = false UICSAKeys = false +CCIP = true +MultiFeedsManagers = false [Database] DefaultIdleInTxSessionTimeout = '1h0m0s' @@ -68,7 +70,7 @@ LeaseDuration = '10s' LeaseRefreshInterval = '1s' [TelemetryIngress] -UniConn = true +UniConn = false Logging = false BufferSize = 100 MaxBatchSize = 50 @@ -286,11 +288,40 @@ DeltaDial = '15s' DeltaReconcile = '1m0s' ListenAddresses = [] +[Capabilities.Dispatcher] +SupportedVersion = 1 +ReceiverBufferSize = 10000 + +[Capabilities.Dispatcher.RateLimit] +GlobalRPS = 800.0 +GlobalBurst = 1000 +PerSenderRPS = 10.0 +PerSenderBurst = 50 + [Capabilities.ExternalRegistry] Address = '' NetworkID = 'evm' ChainID = '1' +[Capabilities.GatewayConnector] +ChainIDForNodeKey = '' +NodeAddress = '' +DonID = '' +WSHandshakeTimeoutMillis = 0 +AuthMinChallengeLen = 0 +AuthTimestampToleranceSec = 0 + +[[Capabilities.GatewayConnector.Gateways]] +ID = '' +URL = '' + +[Telemetry] +Enabled = false +CACertFile = '' +Endpoint = '' +InsecureConnection = false +TraceSampleRatio = 0.01 + # Configuration warning: Tracing.TLSCertPath: invalid value (something): must be empty when Tracing.Mode is 'unencrypted' Valid configuration. diff --git a/tools/bin/go_core_ccip_deployment_tests b/tools/bin/go_core_ccip_deployment_tests new file mode 100755 index 00000000000..54f9b70d269 --- /dev/null +++ b/tools/bin/go_core_ccip_deployment_tests @@ -0,0 +1,43 @@ +#!/usr/bin/env bash +set -o pipefail +set +e + +SCRIPT_PATH=`dirname "$0"`; SCRIPT_PATH=`eval "cd \"$SCRIPT_PATH\" && pwd"` +OUTPUT_FILE="../output.txt" +USE_TEE="${USE_TEE:-true}" + +# To allow reuse in CI from other repositories +TOOLS_PATH=${TOOLS_PATH:-"./tools"} + +echo "Failed tests and panics: ---------------------" +echo "" +use_tee() { + if [ "$USE_TEE" = "true" ]; then + tee "$@" + else + cat > "$@" + fi +} + +cd ./integration-tests || exit +go mod download +go test -json ./deployment/... -covermode=atomic -coverpkg=./... -coverprofile=coverage.txt | use_tee $OUTPUT_FILE +EXITCODE=${PIPESTATUS[0]} + +# Assert no known sensitive strings present in test logger output +printf "\n----------------------------------------------\n\n" +echo "Beginning check of output logs for sensitive strings" +$SCRIPT_PATH/scrub_logs $OUTPUT_FILE +cd .. +if [[ $? != 0 ]]; then + exit 1 +fi + +echo "Exit code: $EXITCODE" +if [[ $EXITCODE != 0 ]]; then + echo "Encountered test failures." +else + echo "All tests passed!" +fi +echo "go_core_ccip_deployment_tests exiting with code $EXITCODE" +exit $EXITCODE diff --git a/tools/bin/go_core_fuzz b/tools/bin/go_core_fuzz index c3119f4beb4..d81e6909300 100755 --- a/tools/bin/go_core_fuzz +++ b/tools/bin/go_core_fuzz @@ -6,6 +6,11 @@ SCRIPT_PATH=`dirname "$0"`; SCRIPT_PATH=`eval "cd \"$SCRIPT_PATH\" && pwd"` OUTPUT_FILE=${OUTPUT_FILE:-"./output.txt"} USE_TEE="${USE_TEE:-true}" +# To allow reuse in CI from other repositories +FUZZ_TOOL_PATH=${FUZZ_TOOL_PATH:-"./fuzz"} +GO_MODULE_ROOT_PATH=${GO_MODULE_ROOT_PATH:-"./"} +FUZZ_TIMEOUT=${FUZZ_TIMEOUT:-10m} + echo "Failed fuzz tests and panics: ---------------------" echo "" use_tee() { @@ -19,7 +24,7 @@ use_tee() { # the amount of --seconds here is subject to change based on how long the CI job takes in the future # as we add more fuzz tests, we should take into consideration increasing this timelapse, so we can have enough coverage. # We are timing out after ~10mins in case the tests hang. (Current CI duration is ~8m, modify if needed) -cd ./fuzz && timeout 10m ./fuzz_all_native.py --ci --seconds 420 | use_tee $OUTPUT_FILE +timeout "${FUZZ_TIMEOUT}" "${FUZZ_TOOL_PATH}"/fuzz_all_native.py --ci --seconds 420 --go_module_root "${GO_MODULE_ROOT_PATH}" | use_tee $OUTPUT_FILE EXITCODE=${PIPESTATUS[0]} # Assert no known sensitive strings present in test logger output diff --git a/tools/bin/go_core_race_tests b/tools/bin/go_core_race_tests index aa6510c1127..d0fcb6cae41 100755 --- a/tools/bin/go_core_race_tests +++ b/tools/bin/go_core_race_tests @@ -4,7 +4,11 @@ OUTPUT_FILE=${OUTPUT_FILE:-"./output.txt"} USE_TEE="${USE_TEE:-true}" TIMEOUT="${TIMEOUT:-30s}" COUNT="${COUNT:-10}" -GO_LDFLAGS=$(bash tools/bin/ldflags) + +# To allow reuse in CI from other repositories +TOOLS_PATH=${TOOLS_PATH:-"./tools"} + +GO_LDFLAGS=$(bash ${TOOLS_PATH}/bin/ldflags) use_tee() { if [ "$USE_TEE" = "true" ]; then tee "$@" diff --git a/tools/bin/go_core_tests b/tools/bin/go_core_tests index 074527698b3..f7c1dfaf231 100755 --- a/tools/bin/go_core_tests +++ b/tools/bin/go_core_tests @@ -6,9 +6,12 @@ SCRIPT_PATH=`dirname "$0"`; SCRIPT_PATH=`eval "cd \"$SCRIPT_PATH\" && pwd"` OUTPUT_FILE=${OUTPUT_FILE:-"./output.txt"} USE_TEE="${USE_TEE:-true}" +# To allow reuse in CI from other repositories +TOOLS_PATH=${TOOLS_PATH:-"./tools"} + echo "Failed tests and panics: ---------------------" echo "" -GO_LDFLAGS=$(bash tools/bin/ldflags) +GO_LDFLAGS=$(bash ${TOOLS_PATH}/bin/ldflags) use_tee() { if [ "$USE_TEE" = "true" ]; then tee "$@" diff --git a/tools/bin/goreleaser_utils b/tools/bin/goreleaser_utils index 4e1b3ffc4db..979204d1e3a 100755 --- a/tools/bin/goreleaser_utils +++ b/tools/bin/goreleaser_utils @@ -25,7 +25,7 @@ _get_arch() { _get_wasmvm_lib_path() { local -r platform="$1" local -r arch="$2" - wasmvm_dir=$(go list -json -m all | jq -r '. | select(.Path == "github.com/CosmWasm/wasmvm") | .Dir') + wasmvm_dir=$(go list -json -m github.com/CosmWasm/wasmvm | jq -r '.Dir') shared_lib_dir="$wasmvm_dir/internal/api" lib_name="libwasmvm" if [ "$platform" == "darwin" ]; then @@ -68,11 +68,13 @@ before_hook() { install_remote_plugins "linux" "amd64" "$gobin"/linux_amd64/ mkdir -p "$lib_path/linux_amd64/plugins" cp "$gobin"/linux_amd64/chainlink* "$lib_path/linux_amd64/plugins" + cp "$gobin"/chainlink* "$lib_path/linux_amd64/plugins" install_local_plugins "linux" "arm64" "$gobin"/linux_arm64/ install_remote_plugins "linux" "arm64" "$gobin"/linux_arm64/ mkdir -p "$lib_path/linux_arm64/plugins" cp "$gobin"/linux_arm64/chainlink* "$lib_path/linux_arm64/plugins" + cp "$gobin"/chainlink* "$lib_path/linux_arm64/plugins" } install_local_plugins() { @@ -94,10 +96,10 @@ get_remote_plugin_paths() { ) for plugin in "${plugins[@]}"; do - plugin_dep_name=$(echo "$plugin" | cut -d"|" -f1) - plugin_main=$(echo "$plugin" | cut -d"|" -f2) + plugin_dep_name=$(echo "$plugin" | cut -d"|" -f1) + plugin_main=$(echo "$plugin" | cut -d"|" -f2) - full_plugin_path=$(go list -m -f "{{.Dir}}" "$plugin_dep_name")"$plugin_main" + full_plugin_path=$(go list -m -f "{{.Dir}}" "$plugin_dep_name")"$plugin_main" echo "$full_plugin_path" done } diff --git a/tools/bin/modgraph b/tools/bin/modgraph index 4d8ad108c65..4080e53abe9 100755 --- a/tools/bin/modgraph +++ b/tools/bin/modgraph @@ -11,11 +11,7 @@ flowchart LR chainlink-cosmos chainlink-solana chainlink-starknet/relayer - subgraph chainlink-integrations - direction LR - chainlink-integrations/evm/relayer - chainlink-integrations/common - end + chainlink-evm end subgraph products @@ -27,8 +23,13 @@ flowchart LR chainlink-vrf end + subgraph tdh2 + tdh2/go/tdh2 + tdh2/go/ocr2/decryptionplugin + end + classDef outline stroke-dasharray:6,fill:none; - class chains,products outline + class chains,products,tdh2 outline " go mod graph | \ # org only diff --git a/tools/ci/gorace_test b/tools/ci/gorace_test deleted file mode 100755 index ebf0b892817..00000000000 --- a/tools/ci/gorace_test +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash - -set -e -GORACE="halt_on_error=1" go test -v -race -parallel 2 -p 1 chainlink/core/internal chainlink/core/services diff --git a/tools/ci/init_gcloud b/tools/ci/init_gcloud deleted file mode 100755 index f1ebb12b59a..00000000000 --- a/tools/ci/init_gcloud +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env bash - -if [ -z "$GCLOUD_SERVICE_KEY" ] -then - echo "Skipping gcloud initiation because no service key is set" - exit 0 -else - echo $GCLOUD_SERVICE_KEY > ${HOME}/gcloud-service-key.json - gcloud auth activate-service-account --key-file=${HOME}/gcloud-service-key.json - gcloud --quiet config set project ${GOOGLE_PROJECT_ID} - gcloud --quiet config set compute/zone ${GOOGLE_COMPUTE_ZONE} -fi diff --git a/tools/docker/README.md b/tools/docker/README.md index e0ccadd68c3..527951e64cc 100644 --- a/tools/docker/README.md +++ b/tools/docker/README.md @@ -23,6 +23,7 @@ cd tools/docker ### Compose script env vars The following env vars are used for the compose script : +- `WITH_OBSERVABILITY=true` to enable grafana, prometheus and alertmanager - `GETH_MODE=true` to use geth instead of parity - `CHAIN_ID=` to specify the chainID (default is 34055 for parity and 1337 for geth) - `HTTPURL=` to specify the RPC node HTTP url (default is set if you use geth or parity) @@ -35,6 +36,10 @@ for example : CHAIN_ID=11155111 WSURL=wss://eth.sepolia HTTPURL=https://eth.sepolia ./compose dev ``` +```sh +WITH_OBSERVABILITY=true ./compose up +``` + ## Dev Will run one node with a postgres database and by default a devnet RPC node that can be either geth or parity. diff --git a/tools/docker/alertmanager/alertmanager.yml b/tools/docker/alertmanager/alertmanager.yml new file mode 100644 index 00000000000..7521fd768b8 --- /dev/null +++ b/tools/docker/alertmanager/alertmanager.yml @@ -0,0 +1,15 @@ + +route: + receiver: 'mail' + repeat_interval: 4h + group_by: [ alertname ] + + +receivers: + - name: 'mail' + email_configs: + - smarthost: 'smtp.gmail.com:465' + auth_username: 'your_mail@gmail.com' + auth_password: "" + from: 'your_mail@gmail.com' + to: 'some_mail@gmail.com' \ No newline at end of file diff --git a/tools/docker/compose b/tools/docker/compose index 0e754a5ffcb..abaf3773336 100755 --- a/tools/docker/compose +++ b/tools/docker/compose @@ -16,7 +16,14 @@ if [ -z "$WSURL" ] && [ -z "$HTTPURL" ]; then fi fi -base="docker-compose $base_files" +args="node" + +if [ "$WITH_OBSERVABILITY" ]; then + base_files="$base_files -f docker-compose.observability.yaml" + args="$args grafana" +fi + +base="docker compose $base_files" dev="$base -f docker-compose.dev.yaml" configure() { @@ -41,7 +48,7 @@ configure() { clean_docker() { $base down -v --remove-orphans $dev down -v --remove-orphans - rm -f config.toml + rm -rf config.toml } usage() { @@ -71,7 +78,7 @@ logs) dev) configure $dev build - $dev up -d node + $dev up -d $args $dev watch --no-up node ;; connect) diff --git a/tools/docker/docker-compose.observability.yaml b/tools/docker/docker-compose.observability.yaml new file mode 100644 index 00000000000..c82c050d58e --- /dev/null +++ b/tools/docker/docker-compose.observability.yaml @@ -0,0 +1,44 @@ +services: + prometheus: + image: prom/prometheus:main + container_name: chainlink-prometheus + volumes: + - ./prometheus/:/etc/prometheus/ + - prometheus_data:/prometheus + command: + - '--config.file=/etc/prometheus/prometheus.yaml' + - '--storage.tsdb.path=/prometheus' + - '--web.console.libraries=/usr/share/prometheus/console_libraries' + - '--web.console.templates=/usr/share/prometheus/consoles' + restart: always + ports: + - 9090:9090 + grafana: + image: grafana/grafana:10.4.3 + user: "472" + depends_on: + - prometheus + - alertmanager + ports: + - 3000:3000 + volumes: + - grafana_data:/var/lib/grafana + - ./grafana/provisioning/:/etc/grafana/provisioning/ + env_file: + - ./grafana/config.monitoring + restart: always + alertmanager: + image: prom/alertmanager:main + container_name: chainlink-alertmanager + volumes: + - "./alertmanager:/config" + - alertmanager-data:/data + command: --config.file=/config/alertmanager.yml --log.level=debug + restart: always + ports: + - 9093:9093 + +volumes: + alertmanager-data: {} + prometheus_data: {} + grafana_data: {} diff --git a/tools/docker/grafana/config.monitoring b/tools/docker/grafana/config.monitoring new file mode 100644 index 00000000000..a2b009166bd --- /dev/null +++ b/tools/docker/grafana/config.monitoring @@ -0,0 +1,2 @@ +GF_SECURITY_ADMIN_PASSWORD=foobar +GF_USERS_ALLOW_SIGN_UP=false \ No newline at end of file diff --git a/tools/docker/grafana/provisioning/datasources/datasource.yml b/tools/docker/grafana/provisioning/datasources/datasource.yml new file mode 100644 index 00000000000..f57418b29f4 --- /dev/null +++ b/tools/docker/grafana/provisioning/datasources/datasource.yml @@ -0,0 +1,59 @@ +# config file version +apiVersion: 1 + +# list of datasources that should be deleted from the database +deleteDatasources: + - name: Prometheus + orgId: 1 + +# list of datasources to insert/update depending +# whats available in the database +datasources: + # name of the datasource. Required + - name: Prometheus + # datasource type. Required + type: prometheus + # access mode. direct or proxy. Required + access: proxy + # org id. will default to orgId 1 if not specified + orgId: 1 + # url + url: http://prometheus:9090 + # database password, if used + password: + # database user, if used + user: + # database name, if used + database: + # enable/disable basic auth + basicAuth: false + # basic auth username, if used + basicAuthUser: + # basic auth password, if used + basicAuthPassword: + # enable/disable with credentials headers + withCredentials: + # mark as default datasource. Max one per org + isDefault: true + # fields that will be converted to json and stored in json_data + jsonData: + graphiteVersion: "1.1" + tlsAuth: false + tlsAuthWithCACert: false + # json object of data that will be encrypted. + secureJsonData: + tlsCACert: "..." + tlsClientCert: "..." + tlsClientKey: "..." + version: 1 + # allow users to edit datasources from the UI. + editable: true + - name: Alertmanager + type: alertmanager + url: http://alertmanager:9093 + access: proxy + jsonData: + # Valid options for implementation include mimir, cortex and prometheus + implementation: prometheus + # Whether or not Grafana should send alert instances to this Alertmanager + handleGrafanaManagedAlerts: false \ No newline at end of file diff --git a/tools/docker/prometheus/prometheus.yaml b/tools/docker/prometheus/prometheus.yaml new file mode 100644 index 00000000000..96ca1064937 --- /dev/null +++ b/tools/docker/prometheus/prometheus.yaml @@ -0,0 +1,13 @@ +global: + scrape_interval: 5s +scrape_configs: + - job_name: 'local_scrape' + scrape_interval: 1s + static_configs: + - targets: ['chainlink-node:6688', 'chainlink-node-2:6688'] + metrics_path: '/metrics' +alerting: + alertmanagers: + - scheme: http + static_configs: + - targets: ['alertmanager:9093'] \ No newline at end of file diff --git a/tools/txtar/visitor.go b/tools/txtar/visitor.go index f945ac35237..d96cdc6f0a8 100644 --- a/tools/txtar/visitor.go +++ b/tools/txtar/visitor.go @@ -13,13 +13,13 @@ const ( NoRecurse RecurseOpt = false ) -type TxtarDirVisitor struct { +type DirVisitor struct { rootDir string cb func(path string) error recurse RecurseOpt } -func (d *TxtarDirVisitor) Walk() error { +func (d *DirVisitor) Walk() error { return filepath.WalkDir(d.rootDir, func(path string, de fs.DirEntry, err error) error { if err != nil { return err @@ -52,7 +52,7 @@ func (d *TxtarDirVisitor) Walk() error { }) } -func (d *TxtarDirVisitor) isRootDir(de fs.DirEntry) (bool, error) { +func (d *DirVisitor) isRootDir(de fs.DirEntry) (bool, error) { fi, err := os.Stat(d.rootDir) if err != nil { return false, err @@ -65,8 +65,8 @@ func (d *TxtarDirVisitor) isRootDir(de fs.DirEntry) (bool, error) { return os.SameFile(fi, fi2), nil } -func NewDirVisitor(rootDir string, recurse RecurseOpt, cb func(path string) error) *TxtarDirVisitor { - return &TxtarDirVisitor{ +func NewDirVisitor(rootDir string, recurse RecurseOpt, cb func(path string) error) *DirVisitor { + return &DirVisitor{ rootDir: rootDir, cb: cb, recurse: recurse,